Compare commits

...

2 Commits

  1. 3
      package.json
  2. 33
      src/builder.js
  3. 2
      src/color.js

3
package.json

@ -14,6 +14,9 @@
},
"author": "",
"license": "ISC",
"dependencies": {
},
"devDependencies": {
"typescript": "^5.6.2"
}

33
src/builder.js

@ -48,6 +48,33 @@ const builder = {
* @returns {Component}
*/
input: function (attr = {}) { return builder.genTag("input", attr); },
inputTags: function (attr = {}) {
return {
button() { return builder.genTag("input", Object.assign(attr, { "type": "button" })) },
checkbox() { return builder.genTag("input", Object.assign(attr, { "type": "checkbox" })) },
color() { return builder.genTag("input", Object.assign(attr, { "type": "color" })) },
date() { return builder.genTag("input", Object.assign(attr, { "type": "date" })) },
datetime() { return builder.genTag("input", Object.assign(attr, { "type": "datetime" })) },
datetime_local() { return builder.genTag("input", Object.assign(attr, { "type": "datetime-local" })) },
email() { return builder.genTag("input", Object.assign(attr, { "type": "email" })) },
file() { return builder.genTag("input", Object.assign(attr, { "type": "file" })) },
image() { return builder.genTag("input", Object.assign(attr, { "type": "image" })) },
month() { return builder.genTag("input", Object.assign(attr, { "type": "month" })) },
number() { return builder.genTag("input", Object.assign(attr, { "type": "number" })) },
password() { return builder.genTag("input", Object.assign(attr, { "type": "password" })) },
radio() { return builder.genTag("input", Object.assign(attr, { "type": "radio" })) },
range() { return builder.genTag("input", Object.assign(attr, { "type": "range" })) },
reset() { return builder.genTag("input", Object.assign(attr, { "type": "reset" })) },
search() { return builder.genTag("input", Object.assign(attr, { "type": "search" })) },
submit() { return builder.genTag("input", Object.assign(attr, { "type": "submit" })) },
tel() { return builder.genTag("input", Object.assign(attr, { "type": "tel" })) },
text() { return builder.genTag("input", Object.assign(attr, { "type": "text" })) },
time() { return builder.genTag("input", Object.assign(attr, { "type": "time" })) },
url() { return builder.genTag("input", Object.assign(attr, { "type": "url" })) },
week() { return builder.genTag("input", Object.assign(attr, { "type": "week" })) }
}
},
/**
*
* @param {Map<string,string>} attr
@ -90,12 +117,6 @@ const builder = {
* @returns {Component}
*/
option: function (attr = {}) { return builder.genTag("option", attr); },
/**
*
* @param {Map<string,string>} attr
* @returns {Component}
*/
select: function (attr = {}) { return builder.genTag("select", attr); },
/**
*
* @param {Map<string,string>} attr

2
src/color.js

@ -619,4 +619,4 @@ const MaterialFiveHundredlColors = Object.freeze({
GOLD: new Color(255, 235, 59),
YELLO_ORANGE: new Color(255, 152, 0),
ORANGE: new Color(255, 87, 34),
})
});

Loading…
Cancel
Save