1 |
efrain |
1 |
YUI.add('attribute-complex', function (Y, NAME) {
|
|
|
2 |
|
|
|
3 |
/**
|
|
|
4 |
* Adds support for attribute providers to handle complex attributes in the constructor
|
|
|
5 |
*
|
|
|
6 |
* @module attribute
|
|
|
7 |
* @submodule attribute-complex
|
|
|
8 |
* @for Attribute
|
|
|
9 |
* @deprecated AttributeComplex's overrides are now part of AttributeCore.
|
|
|
10 |
*/
|
|
|
11 |
|
|
|
12 |
var Attribute = Y.Attribute;
|
|
|
13 |
|
|
|
14 |
Attribute.Complex = function() {};
|
|
|
15 |
Attribute.Complex.prototype = {
|
|
|
16 |
|
|
|
17 |
/**
|
|
|
18 |
* Utility method to split out simple attribute name/value pairs ("x")
|
|
|
19 |
* from complex attribute name/value pairs ("x.y.z"), so that complex
|
|
|
20 |
* attributes can be keyed by the top level attribute name.
|
|
|
21 |
*
|
|
|
22 |
* @method _normAttrVals
|
|
|
23 |
* @param {Object} valueHash An object with attribute name/value pairs
|
|
|
24 |
*
|
|
|
25 |
* @return {Object} An object literal with 2 properties - "simple" and "complex",
|
|
|
26 |
* containing simple and complex attribute values respectively keyed
|
|
|
27 |
* by the top level attribute name, or null, if valueHash is falsey.
|
|
|
28 |
*
|
|
|
29 |
* @private
|
|
|
30 |
*/
|
|
|
31 |
_normAttrVals : Attribute.prototype._normAttrVals,
|
|
|
32 |
|
|
|
33 |
/**
|
|
|
34 |
* Returns the initial value of the given attribute from
|
|
|
35 |
* either the default configuration provided, or the
|
|
|
36 |
* over-ridden value if it exists in the set of initValues
|
|
|
37 |
* provided and the attribute is not read-only.
|
|
|
38 |
*
|
|
|
39 |
* @param {String} attr The name of the attribute
|
|
|
40 |
* @param {Object} cfg The attribute configuration object
|
|
|
41 |
* @param {Object} initValues The object with simple and complex attribute name/value pairs returned from _normAttrVals
|
|
|
42 |
*
|
|
|
43 |
* @return {Any} The initial value of the attribute.
|
|
|
44 |
*
|
|
|
45 |
* @method _getAttrInitVal
|
|
|
46 |
* @private
|
|
|
47 |
*/
|
|
|
48 |
_getAttrInitVal : Attribute.prototype._getAttrInitVal
|
|
|
49 |
|
|
|
50 |
};
|
|
|
51 |
|
|
|
52 |
// Consistency with the rest of the Attribute addons for now.
|
|
|
53 |
Y.AttributeComplex = Attribute.Complex;
|
|
|
54 |
|
|
|
55 |
|
|
|
56 |
}, '3.18.1', {"requires": ["attribute-base"]});
|