Added for & checked attribute template functions. Added form element template.
This commit is contained in:
		| @@ -558,6 +558,26 @@ class IgniteTemplate { | |||||||
|         return this.attribute("id", value, converter); |         return this.attribute("id", value, converter); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * Sets the for attribute of the element to be constructed by this template. | ||||||
|  |      * @param {String|IgniteProperty} value The value to set for the for attribute of the element this template will construct. | ||||||
|  |      * @param {Function} converter An optional function that can convert the value if needed. | ||||||
|  |      * @returns This ignite template so function calls can be chained. | ||||||
|  |      */ | ||||||
|  |     for(value, converter = null) { | ||||||
|  |         return this.attribute("for", value, converter); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * Adds a checked attribute to this template. | ||||||
|  |      * @param {Boolean|IgniteProperty} value The value to set for the checked attribute.  | ||||||
|  |      * @param {*} converter Optional function that can convert the value if needed. | ||||||
|  |      * @returns This ignite template so function calls can be chained. | ||||||
|  |      */ | ||||||
|  |     checked(value, converter = null) { | ||||||
|  |         return this.attribute("checked", value, converter); | ||||||
|  |     } | ||||||
|  |  | ||||||
|     /** |     /** | ||||||
|      * Sets the type attribute of the element to be constructed by this template. |      * Sets the type attribute of the element to be constructed by this template. | ||||||
|      * @param {String|IgniteProperty} value The value to set for the type attribute of the element this template will construct. |      * @param {String|IgniteProperty} value The value to set for the type attribute of the element this template will construct. | ||||||
| @@ -1327,6 +1347,18 @@ class script extends IgniteTemplate { | |||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
|  | /** | ||||||
|  |  * An ignite template that can be used to construct a form element. | ||||||
|  |  */ | ||||||
|  | class form extends IgniteTemplate { | ||||||
|  |     /**  | ||||||
|  |      * @param  {...String|Number|IgniteProperty|IgniteTemplate} children A series of children to be added to this template. | ||||||
|  |      */ | ||||||
|  |     constructor(...children) { | ||||||
|  |         super("form", children); | ||||||
|  |     } | ||||||
|  | } | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * An ignite template that can be used to construct a progress element. |  * An ignite template that can be used to construct a progress element. | ||||||
|  */ |  */ | ||||||
| @@ -2243,5 +2275,6 @@ export { | |||||||
|     thead, |     thead, | ||||||
|     progress, |     progress, | ||||||
|     svg, |     svg, | ||||||
|     circle |     circle, | ||||||
|  |     form | ||||||
| }; | }; | ||||||
		Reference in New Issue
	
	Block a user