Version 3.18.1
Show:

File: attribute/js/ComplexAttribute.js

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