@govbr-ds/webcomponents 2.0.0-next.2 → 2.0.0-next.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +193 -97
- package/dist/cjs/app-globals-77a217c6.js +11 -0
- package/dist/cjs/app-globals-77a217c6.js.map +1 -0
- package/dist/cjs/br-avatar.cjs.entry.js +77 -0
- package/dist/cjs/br-avatar.cjs.entry.js.map +1 -0
- package/dist/cjs/br-button_2.cjs.entry.js +2491 -0
- package/dist/cjs/br-button_2.cjs.entry.js.map +1 -0
- package/dist/cjs/br-checkbox_4.cjs.entry.js +346 -0
- package/dist/cjs/br-checkbox_4.cjs.entry.js.map +1 -0
- package/dist/cjs/br-dropdown.cjs.entry.js +100 -0
- package/dist/cjs/br-dropdown.cjs.entry.js.map +1 -0
- package/dist/cjs/br-item.cjs.entry.js +146 -0
- package/dist/cjs/br-item.cjs.entry.js.map +1 -0
- package/dist/cjs/br-loading.cjs.entry.js +43 -0
- package/dist/cjs/br-loading.cjs.entry.js.map +1 -0
- package/dist/cjs/br-message.cjs.entry.js +68 -0
- package/dist/cjs/br-message.cjs.entry.js.map +1 -0
- package/dist/cjs/br-select.cjs.entry.js +281 -0
- package/dist/cjs/br-select.cjs.entry.js.map +1 -0
- package/dist/cjs/br-switch.cjs.entry.js +81 -0
- package/dist/cjs/br-switch.cjs.entry.js.map +1 -0
- package/dist/cjs/br-tag.cjs.entry.js +88 -0
- package/dist/cjs/br-tag.cjs.entry.js.map +1 -0
- package/dist/cjs/br-textarea.cjs.entry.js +102 -0
- package/dist/cjs/br-textarea.cjs.entry.js.map +1 -0
- package/dist/cjs/br-upload.cjs.entry.js +168 -0
- package/dist/cjs/br-upload.cjs.entry.js.map +1 -0
- package/dist/cjs/index-86e7422e.js +1856 -0
- package/dist/cjs/index-86e7422e.js.map +1 -0
- package/dist/cjs/index.cjs.js +8 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/inherited-attributes-16f7d388.js +107 -0
- package/dist/cjs/inherited-attributes-16f7d388.js.map +1 -0
- package/dist/cjs/loader.cjs.js +21 -0
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/cjs/v4-2a0fe526.js +74 -0
- package/dist/cjs/v4-2a0fe526.js.map +1 -0
- package/dist/cjs/webcomponents.cjs.js +52 -0
- package/dist/cjs/webcomponents.cjs.js.map +1 -0
- package/dist/collection/collection-manifest.json +27 -0
- package/dist/collection/components/avatar/avatar.css +540 -0
- package/dist/collection/components/avatar/avatar.js +222 -0
- package/dist/collection/components/avatar/avatar.js.map +1 -0
- package/dist/collection/components/button/button.css +802 -0
- package/dist/collection/components/button/button.js +236 -0
- package/dist/collection/components/button/button.js.map +1 -0
- package/dist/collection/components/checkbox/checkbox.css +597 -0
- package/dist/collection/components/checkbox/checkbox.js +279 -0
- package/dist/collection/components/checkbox/checkbox.js.map +1 -0
- package/dist/collection/components/dropdown/dropdown.css +467 -0
- package/dist/collection/components/dropdown/dropdown.js +185 -0
- package/dist/collection/components/dropdown/dropdown.js.map +1 -0
- package/dist/collection/components/icon/icon.css +452 -0
- package/dist/collection/components/icon/icon.js +176 -0
- package/dist/collection/components/icon/icon.js.map +1 -0
- package/dist/collection/components/input/input.css +673 -0
- package/dist/collection/components/input/input.js +580 -0
- package/dist/collection/components/input/input.js.map +1 -0
- package/dist/collection/components/item/item.css +662 -0
- package/dist/collection/components/item/item.js +376 -0
- package/dist/collection/components/item/item.js.map +1 -0
- package/dist/collection/components/list/list.css +564 -0
- package/dist/collection/components/list/list.js +138 -0
- package/dist/collection/components/list/list.js.map +1 -0
- package/dist/collection/components/loading/loading.css +653 -0
- package/dist/collection/components/loading/loading.js +119 -0
- package/dist/collection/components/loading/loading.js.map +1 -0
- package/dist/collection/components/message/message.css +600 -0
- package/dist/collection/components/message/message.js +211 -0
- package/dist/collection/components/message/message.js.map +1 -0
- package/dist/collection/components/radio/radio.css +552 -0
- package/dist/collection/components/radio/radio.js +247 -0
- package/dist/collection/components/radio/radio.js.map +1 -0
- package/dist/collection/components/select/select.css +857 -0
- package/dist/collection/components/select/select.js +491 -0
- package/dist/collection/components/select/select.js.map +1 -0
- package/dist/collection/components/switch/switch.css +623 -0
- package/dist/collection/components/switch/switch.js +320 -0
- package/dist/collection/components/switch/switch.js.map +1 -0
- package/dist/collection/components/tag/tag.css +645 -0
- package/dist/collection/components/tag/tag.js +256 -0
- package/dist/collection/components/tag/tag.js.map +1 -0
- package/dist/collection/components/textarea/textarea.css +518 -0
- package/dist/collection/components/textarea/textarea.js +298 -0
- package/dist/collection/components/textarea/textarea.js.map +1 -0
- package/dist/collection/components/upload/upload.css +562 -0
- package/dist/collection/components/upload/upload.js +469 -0
- package/dist/collection/components/upload/upload.js.map +1 -0
- package/dist/collection/index.js +2 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/pages/components/button/index.js +18 -0
- package/dist/collection/pages/components/checkbox/index.js +18 -0
- package/dist/collection/pages/components/dropdown/index.js +18 -0
- package/dist/collection/pages/components/icon/index.js +18 -0
- package/dist/collection/pages/components/input/index.js +27 -0
- package/dist/collection/pages/components/item/index.js +18 -0
- package/dist/collection/pages/components/list/index.js +19 -0
- package/dist/collection/pages/components/message/index.js +18 -0
- package/dist/collection/pages/components/radio/index.js +18 -0
- package/dist/collection/pages/components/select/index.js +18 -0
- package/dist/collection/pages/components/switch/index.js +18 -0
- package/dist/collection/pages/components/tag/index.js +18 -0
- package/dist/collection/pages/components/textarea/index.js +19 -0
- package/dist/collection/pages/components/upload/index.js +19 -0
- package/dist/collection/pages/scripts/menu.js +226 -0
- package/dist/collection/pages/scripts/pageLoader.js +180 -0
- package/dist/collection/scripts/menu.js +151 -0
- package/dist/collection/utils/inherited-attributes.js +102 -0
- package/dist/collection/utils/inherited-attributes.js.map +1 -0
- package/dist/collection/utils/interfaces.js +2 -0
- package/dist/collection/utils/interfaces.js.map +1 -0
- package/dist/collection/utils/unique-id-generator.js +13 -0
- package/dist/collection/utils/unique-id-generator.js.map +1 -0
- package/dist/components/br-avatar.d.ts +11 -0
- package/dist/components/br-avatar.js +6 -0
- package/dist/components/br-avatar.js.map +1 -0
- package/dist/components/br-button.d.ts +11 -0
- package/dist/components/br-button.js +6 -0
- package/dist/components/br-button.js.map +1 -0
- package/dist/components/br-checkbox.d.ts +11 -0
- package/dist/components/br-checkbox.js +6 -0
- package/dist/components/br-checkbox.js.map +1 -0
- package/dist/components/br-dropdown.d.ts +11 -0
- package/dist/components/br-dropdown.js +6 -0
- package/dist/components/br-dropdown.js.map +1 -0
- package/dist/components/br-icon.d.ts +11 -0
- package/dist/components/br-icon.js +6 -0
- package/dist/components/br-icon.js.map +1 -0
- package/dist/components/br-input.d.ts +11 -0
- package/dist/components/br-input.js +6 -0
- package/dist/components/br-input.js.map +1 -0
- package/dist/components/br-item.d.ts +11 -0
- package/dist/components/br-item.js +6 -0
- package/dist/components/br-item.js.map +1 -0
- package/dist/components/br-list.d.ts +11 -0
- package/dist/components/br-list.js +6 -0
- package/dist/components/br-list.js.map +1 -0
- package/dist/components/br-loading.d.ts +11 -0
- package/dist/components/br-loading.js +6 -0
- package/dist/components/br-loading.js.map +1 -0
- package/dist/components/br-message.d.ts +11 -0
- package/dist/components/br-message.js +6 -0
- package/dist/components/br-message.js.map +1 -0
- package/dist/components/br-radio.d.ts +11 -0
- package/dist/components/br-radio.js +6 -0
- package/dist/components/br-radio.js.map +1 -0
- package/dist/components/br-select.d.ts +11 -0
- package/dist/components/br-select.js +6 -0
- package/dist/components/br-select.js.map +1 -0
- package/dist/components/br-switch.d.ts +11 -0
- package/dist/components/br-switch.js +6 -0
- package/dist/components/br-switch.js.map +1 -0
- package/dist/components/br-tag.d.ts +11 -0
- package/dist/components/br-tag.js +6 -0
- package/dist/components/br-tag.js.map +1 -0
- package/dist/components/br-textarea.d.ts +11 -0
- package/dist/components/br-textarea.js +6 -0
- package/dist/components/br-textarea.js.map +1 -0
- package/dist/components/br-upload.d.ts +11 -0
- package/dist/components/br-upload.js +6 -0
- package/dist/components/br-upload.js.map +1 -0
- package/dist/components/index.d.ts +33 -0
- package/dist/components/index.js +6 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/p-22068d3c.js +6 -0
- package/dist/components/p-22068d3c.js.map +1 -0
- package/dist/components/p-62776355.js +6 -0
- package/dist/components/p-62776355.js.map +1 -0
- package/dist/components/p-67617725.js +6 -0
- package/dist/components/p-67617725.js.map +1 -0
- package/dist/components/p-74a4eb38.js +6 -0
- package/dist/components/p-74a4eb38.js.map +1 -0
- package/dist/components/p-7882cb21.js +6 -0
- package/dist/components/p-7882cb21.js.map +1 -0
- package/dist/components/p-7aca304a.js +6 -0
- package/dist/components/p-7aca304a.js.map +1 -0
- package/dist/components/p-b4b55ab7.js +17 -0
- package/dist/components/p-b4b55ab7.js.map +1 -0
- package/dist/components/p-d5a8d30c.js +6 -0
- package/dist/components/p-d5a8d30c.js.map +1 -0
- package/dist/components/p-fabd9bdd.js +7 -0
- package/dist/components/p-fabd9bdd.js.map +1 -0
- package/dist/esm/app-globals-72548b13.js +9 -0
- package/dist/esm/app-globals-72548b13.js.map +1 -0
- package/dist/esm/br-avatar.entry.js +73 -0
- package/dist/esm/br-avatar.entry.js.map +1 -0
- package/dist/esm/br-button_2.entry.js +2486 -0
- package/dist/esm/br-button_2.entry.js.map +1 -0
- package/dist/esm/br-checkbox_4.entry.js +339 -0
- package/dist/esm/br-checkbox_4.entry.js.map +1 -0
- package/dist/esm/br-dropdown.entry.js +96 -0
- package/dist/esm/br-dropdown.entry.js.map +1 -0
- package/dist/esm/br-item.entry.js +142 -0
- package/dist/esm/br-item.entry.js.map +1 -0
- package/dist/esm/br-loading.entry.js +39 -0
- package/dist/esm/br-loading.entry.js.map +1 -0
- package/dist/esm/br-message.entry.js +64 -0
- package/dist/esm/br-message.entry.js.map +1 -0
- package/dist/esm/br-select.entry.js +277 -0
- package/dist/esm/br-select.entry.js.map +1 -0
- package/dist/esm/br-switch.entry.js +77 -0
- package/dist/esm/br-switch.entry.js.map +1 -0
- package/dist/esm/br-tag.entry.js +84 -0
- package/dist/esm/br-tag.entry.js.map +1 -0
- package/dist/esm/br-textarea.entry.js +98 -0
- package/dist/esm/br-textarea.entry.js.map +1 -0
- package/dist/esm/br-upload.entry.js +164 -0
- package/dist/esm/br-upload.entry.js.map +1 -0
- package/dist/esm/index-14721f44.js +1826 -0
- package/dist/esm/index-14721f44.js.map +1 -0
- package/dist/esm/index.js +6 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/inherited-attributes-553a7c36.js +105 -0
- package/dist/esm/inherited-attributes-553a7c36.js.map +1 -0
- package/dist/esm/loader.js +17 -0
- package/dist/esm/loader.js.map +1 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/esm/v4-c99c1585.js +72 -0
- package/dist/esm/v4-c99c1585.js.map +1 -0
- package/dist/esm/webcomponents.js +47 -0
- package/dist/esm/webcomponents.js.map +1 -0
- package/dist/esm-es5/app-globals-72548b13.js +6 -0
- package/dist/esm-es5/app-globals-72548b13.js.map +1 -0
- package/dist/esm-es5/br-avatar.entry.js +6 -0
- package/dist/esm-es5/br-avatar.entry.js.map +1 -0
- package/dist/esm-es5/br-button_2.entry.js +17 -0
- package/dist/esm-es5/br-button_2.entry.js.map +1 -0
- package/dist/esm-es5/br-checkbox_4.entry.js +6 -0
- package/dist/esm-es5/br-checkbox_4.entry.js.map +1 -0
- package/dist/esm-es5/br-dropdown.entry.js +6 -0
- package/dist/esm-es5/br-dropdown.entry.js.map +1 -0
- package/dist/esm-es5/br-item.entry.js +6 -0
- package/dist/esm-es5/br-item.entry.js.map +1 -0
- package/dist/esm-es5/br-loading.entry.js +6 -0
- package/dist/esm-es5/br-loading.entry.js.map +1 -0
- package/dist/esm-es5/br-message.entry.js +6 -0
- package/dist/esm-es5/br-message.entry.js.map +1 -0
- package/dist/esm-es5/br-select.entry.js +6 -0
- package/dist/esm-es5/br-select.entry.js.map +1 -0
- package/dist/esm-es5/br-switch.entry.js +6 -0
- package/dist/esm-es5/br-switch.entry.js.map +1 -0
- package/dist/esm-es5/br-tag.entry.js +6 -0
- package/dist/esm-es5/br-tag.entry.js.map +1 -0
- package/dist/esm-es5/br-textarea.entry.js +6 -0
- package/dist/esm-es5/br-textarea.entry.js.map +1 -0
- package/dist/esm-es5/br-upload.entry.js +6 -0
- package/dist/esm-es5/br-upload.entry.js.map +1 -0
- package/dist/esm-es5/index-14721f44.js +6 -0
- package/dist/esm-es5/index-14721f44.js.map +1 -0
- package/dist/esm-es5/index.js +5 -0
- package/dist/esm-es5/index.js.map +1 -0
- package/dist/esm-es5/inherited-attributes-553a7c36.js +6 -0
- package/dist/esm-es5/inherited-attributes-553a7c36.js.map +1 -0
- package/dist/esm-es5/loader.js +6 -0
- package/dist/esm-es5/loader.js.map +1 -0
- package/dist/esm-es5/v4-c99c1585.js +6 -0
- package/dist/esm-es5/v4-c99c1585.js.map +1 -0
- package/dist/esm-es5/webcomponents.js +6 -0
- package/dist/esm-es5/webcomponents.js.map +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/playwright.config.js +39 -0
- package/dist/playwright.config.js.map +1 -0
- package/dist/types/builds/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/packages/webcomponents/.stencil/playwright.config.d.ts +5 -0
- package/dist/types/components/avatar/avatar.d.ts +60 -0
- package/dist/types/components/button/button.d.ts +64 -0
- package/dist/types/components/checkbox/checkbox.d.ts +78 -0
- package/dist/types/components/dropdown/dropdown.d.ts +64 -0
- package/dist/types/components/icon/icon.d.ts +58 -0
- package/dist/types/components/input/input.d.ts +151 -0
- package/dist/types/components/item/item.d.ts +96 -0
- package/dist/types/components/list/list.d.ts +34 -0
- package/dist/types/components/loading/loading.d.ts +34 -0
- package/dist/types/components/message/message.d.ts +62 -0
- package/dist/types/components/radio/radio.d.ts +75 -0
- package/dist/types/components/select/select.d.ts +98 -0
- package/dist/types/components/switch/switch.d.ts +78 -0
- package/dist/types/components/tag/tag.d.ts +73 -0
- package/dist/types/components/textarea/textarea.d.ts +66 -0
- package/dist/types/components/upload/upload.d.ts +160 -0
- package/dist/types/components.d.ts +1790 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/stencil-public-runtime.d.ts +1680 -0
- package/dist/types/utils/inherited-attributes.d.ts +20 -0
- package/dist/types/utils/interfaces.d.ts +3 -0
- package/dist/types/utils/unique-id-generator.d.ts +1 -0
- package/dist/webcomponents/index.esm.js +6 -0
- package/dist/webcomponents/index.esm.js.map +1 -0
- package/dist/webcomponents/p-11e8c72f.entry.js +6 -0
- package/dist/webcomponents/p-11e8c72f.entry.js.map +1 -0
- package/dist/webcomponents/p-1accc2ab.system.entry.js +6 -0
- package/dist/webcomponents/p-1accc2ab.system.entry.js.map +1 -0
- package/dist/webcomponents/p-254a2b7c.js +6 -0
- package/dist/webcomponents/p-254a2b7c.js.map +1 -0
- package/dist/webcomponents/p-36e48582.system.entry.js +6 -0
- package/dist/webcomponents/p-36e48582.system.entry.js.map +1 -0
- package/dist/webcomponents/p-37440256.entry.js +6 -0
- package/dist/webcomponents/p-37440256.entry.js.map +1 -0
- package/dist/webcomponents/p-44554246.system.entry.js +6 -0
- package/dist/webcomponents/p-44554246.system.entry.js.map +1 -0
- package/dist/webcomponents/p-55f80a96.system.entry.js +6 -0
- package/dist/webcomponents/p-55f80a96.system.entry.js.map +1 -0
- package/dist/webcomponents/p-563bea26.entry.js +6 -0
- package/dist/webcomponents/p-563bea26.entry.js.map +1 -0
- package/dist/webcomponents/p-58d37ac2.entry.js +6 -0
- package/dist/webcomponents/p-58d37ac2.entry.js.map +1 -0
- package/dist/webcomponents/p-64f4ecea.system.entry.js +6 -0
- package/dist/webcomponents/p-64f4ecea.system.entry.js.map +1 -0
- package/dist/webcomponents/p-6e286eba.system.js +6 -0
- package/dist/webcomponents/p-6e286eba.system.js.map +1 -0
- package/dist/webcomponents/p-703a633a.system.js +6 -0
- package/dist/webcomponents/p-703a633a.system.js.map +1 -0
- package/dist/webcomponents/p-74a4eb38.js +6 -0
- package/dist/webcomponents/p-74a4eb38.js.map +1 -0
- package/dist/webcomponents/p-76326737.system.entry.js +6 -0
- package/dist/webcomponents/p-76326737.system.entry.js.map +1 -0
- package/dist/webcomponents/p-797376a2.system.entry.js +17 -0
- package/dist/webcomponents/p-797376a2.system.entry.js.map +1 -0
- package/dist/webcomponents/p-7f8c5016.entry.js +6 -0
- package/dist/webcomponents/p-7f8c5016.entry.js.map +1 -0
- package/dist/webcomponents/p-90e2e623.system.js +6 -0
- package/dist/webcomponents/p-90e2e623.system.js.map +1 -0
- package/dist/webcomponents/p-a44ad074.entry.js +6 -0
- package/dist/webcomponents/p-a44ad074.entry.js.map +1 -0
- package/dist/webcomponents/p-a71689a5.system.js +6 -0
- package/dist/webcomponents/p-a71689a5.system.js.map +1 -0
- package/dist/webcomponents/p-aaa17439.entry.js +6 -0
- package/dist/webcomponents/p-aaa17439.entry.js.map +1 -0
- package/dist/webcomponents/p-aaca726d.system.js +7 -0
- package/dist/webcomponents/p-aaca726d.system.js.map +1 -0
- package/dist/webcomponents/p-aec894fa.system.entry.js +6 -0
- package/dist/webcomponents/p-aec894fa.system.entry.js.map +1 -0
- package/dist/webcomponents/p-b16b1de5.entry.js +6 -0
- package/dist/webcomponents/p-b16b1de5.entry.js.map +1 -0
- package/dist/webcomponents/p-b6af61ad.entry.js +6 -0
- package/dist/webcomponents/p-b6af61ad.entry.js.map +1 -0
- package/dist/webcomponents/p-c696c385.entry.js +17 -0
- package/dist/webcomponents/p-c696c385.entry.js.map +1 -0
- package/dist/webcomponents/p-d1e0a8ff.entry.js +6 -0
- package/dist/webcomponents/p-d1e0a8ff.entry.js.map +1 -0
- package/dist/webcomponents/p-d31732da.system.entry.js +6 -0
- package/dist/webcomponents/p-d31732da.system.entry.js.map +1 -0
- package/dist/webcomponents/p-d5a8d30c.js +6 -0
- package/dist/webcomponents/p-d5a8d30c.js.map +1 -0
- package/dist/webcomponents/p-db4b272c.system.entry.js +6 -0
- package/dist/webcomponents/p-db4b272c.system.entry.js.map +1 -0
- package/dist/webcomponents/p-dbd35139.js +7 -0
- package/dist/webcomponents/p-dbd35139.js.map +1 -0
- package/dist/webcomponents/p-e751c991.system.js +6 -0
- package/dist/webcomponents/p-e751c991.system.js.map +1 -0
- package/dist/webcomponents/p-e76f7113.system.entry.js +6 -0
- package/dist/webcomponents/p-e76f7113.system.entry.js.map +1 -0
- package/dist/webcomponents/p-f05d11f7.entry.js +6 -0
- package/dist/webcomponents/p-f05d11f7.entry.js.map +1 -0
- package/dist/webcomponents/p-f5412db6.system.entry.js +6 -0
- package/dist/webcomponents/p-f5412db6.system.entry.js.map +1 -0
- package/dist/webcomponents/webcomponents.esm.js +6 -0
- package/dist/webcomponents/webcomponents.esm.js.map +1 -0
- package/dist/webcomponents/webcomponents.js +127 -0
- package/hydrate/index.d.ts +242 -0
- package/hydrate/index.js +22414 -0
- package/hydrate/index.mjs +22406 -0
- package/hydrate/package.json +12 -0
- package/loader/cdn.js +6 -0
- package/loader/index.cjs.js +6 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +6 -0
- package/loader/index.js +7 -0
- package/loader/package.json +11 -0
- package/package.json +54 -89
- package/vscode-data.json +960 -0
- package/dist/webcomponents.common.js +0 -23958
- package/dist/webcomponents.common.js.map +0 -1
- package/dist/webcomponents.umd.js +0 -23969
- package/dist/webcomponents.umd.js.map +0 -1
- package/dist/webcomponents.umd.min.js +0 -8
- package/dist/webcomponents.umd.min.js.map +0 -1
|
@@ -0,0 +1,580 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Construído com @govbr-ds/webcomponents
|
|
3
|
+
* Padrão Digital de Governo.
|
|
4
|
+
*/
|
|
5
|
+
import { h, Host } from "@stencil/core";
|
|
6
|
+
import { v4 as uuidv4 } from "uuid";
|
|
7
|
+
import { inheritAriaAttributes } from "../../utils/inherited-attributes";
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* Para uma descrição detalhada, consulte a [documentação do GovBR-DS](https://www.gov.br/ds/components/input?tab=designer).
|
|
11
|
+
*
|
|
12
|
+
* @slot action - Botão à direita do input.
|
|
13
|
+
* @slot icon - Ícone à esquerda do input.
|
|
14
|
+
* @slot help-text - Personalização do texto de ajuda.
|
|
15
|
+
*/
|
|
16
|
+
export class Input {
|
|
17
|
+
constructor() {
|
|
18
|
+
this.inheritedAttributes = {};
|
|
19
|
+
this.handleInput = (event) => {
|
|
20
|
+
this.value = event.target.value;
|
|
21
|
+
this.valueChange.emit(this.value);
|
|
22
|
+
};
|
|
23
|
+
this.renderLabel = () => {
|
|
24
|
+
var _a;
|
|
25
|
+
if (((_a = this.label) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
26
|
+
if (this.isInline) {
|
|
27
|
+
return (h("div", { class: "input-label" }, h("label", { class: "text-nowrap", htmlFor: this.customId }, this.label)));
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
return h("label", { htmlFor: this.customId }, this.label);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
this.renderInput = () => {
|
|
35
|
+
return (h("input", Object.assign({ class: this.isHighlight ? 'input-highlight' : null, id: this.customId, autocomplete: this.autocomplete, disabled: this.disabled, autoCorrect: this.autocorrect, min: this.min, max: this.max, minLength: this.minlength, maxLength: this.maxlength, multiple: this.multiple, name: this.name, pattern: this.pattern, step: this.step, onInput: this.handleInput, placeholder: this.placeholder, readonly: this.readonly, required: this.required, title: this.el.title, type: this.type, value: this.value }, this.inheritedAttributes)));
|
|
36
|
+
};
|
|
37
|
+
this.renderHelpText = () => {
|
|
38
|
+
var _a;
|
|
39
|
+
return ((_a = this.helpText) === null || _a === void 0 ? void 0 : _a.length) > 0 ? h("p", null, this.helpText) : h("slot", { name: "help-text" });
|
|
40
|
+
};
|
|
41
|
+
this.renderIconPassword = () => {
|
|
42
|
+
const iconName = this.isPasswordVisible ? 'fa-solid:eye-slash' : 'fa-solid:eye';
|
|
43
|
+
return h("br-icon", { "icon-name": iconName });
|
|
44
|
+
};
|
|
45
|
+
this.togglePasswordVisibility = () => {
|
|
46
|
+
const input = this.el.shadowRoot.querySelector('input');
|
|
47
|
+
this.isPasswordVisible = !this.isPasswordVisible;
|
|
48
|
+
input.type = this.isPasswordVisible ? 'text' : 'password';
|
|
49
|
+
};
|
|
50
|
+
this.renderInlineInputContent = () => {
|
|
51
|
+
if (this.hasIconSlot) {
|
|
52
|
+
return h("div", { class: "input-content" }, this.renderInputWithIcon());
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
return h("div", { class: "input-content" }, this.renderInputWithoutIcon());
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
this.renderInputContent = () => {
|
|
59
|
+
return this.hasIconSlot ? this.renderInputWithIcon() : this.renderInputWithoutIcon();
|
|
60
|
+
};
|
|
61
|
+
this.renderInputWithIcon = () => {
|
|
62
|
+
return (h("div", { class: "input-group" }, this.renderIconSlot(), this.renderInput(), this.renderButton(), this.renderHelpText()));
|
|
63
|
+
};
|
|
64
|
+
this.renderInputWithoutIcon = () => {
|
|
65
|
+
return [this.renderInput(), this.renderButton(), this.renderHelpText()];
|
|
66
|
+
};
|
|
67
|
+
this.customId = `br-input-${uuidv4()}`;
|
|
68
|
+
this.type = 'text';
|
|
69
|
+
this.autocomplete = undefined;
|
|
70
|
+
this.density = 'medium';
|
|
71
|
+
this.disabled = false;
|
|
72
|
+
this.isInline = false;
|
|
73
|
+
this.isHighlight = false;
|
|
74
|
+
this.state = undefined;
|
|
75
|
+
this.label = undefined;
|
|
76
|
+
this.name = undefined;
|
|
77
|
+
this.placeholder = undefined;
|
|
78
|
+
this.readonly = false;
|
|
79
|
+
this.required = false;
|
|
80
|
+
this.value = undefined;
|
|
81
|
+
this.helpText = undefined;
|
|
82
|
+
this.autocorrect = 'off';
|
|
83
|
+
this.min = undefined;
|
|
84
|
+
this.max = undefined;
|
|
85
|
+
this.minlength = undefined;
|
|
86
|
+
this.maxlength = undefined;
|
|
87
|
+
this.multiple = false;
|
|
88
|
+
this.pattern = undefined;
|
|
89
|
+
this.step = undefined;
|
|
90
|
+
this.isPasswordVisible = false;
|
|
91
|
+
this.hasIconSlot = false;
|
|
92
|
+
this.hasActionSlot = false;
|
|
93
|
+
}
|
|
94
|
+
componentWillLoad() {
|
|
95
|
+
this.hasIconSlot = this.hasSlotContent('icon');
|
|
96
|
+
this.hasActionSlot = this.hasSlotContent('action');
|
|
97
|
+
this.inheritedAttributes = inheritAriaAttributes(this.el);
|
|
98
|
+
}
|
|
99
|
+
getInputCssClassMap() {
|
|
100
|
+
return {
|
|
101
|
+
'br-input': true,
|
|
102
|
+
'input-button': this.hasActionSlot,
|
|
103
|
+
small: this.density === 'small',
|
|
104
|
+
large: this.density === 'large',
|
|
105
|
+
medium: this.density === 'medium',
|
|
106
|
+
'input-inline': this.isInline,
|
|
107
|
+
'input-highlight': this.isHighlight,
|
|
108
|
+
success: this.state === 'success',
|
|
109
|
+
danger: this.state === 'danger',
|
|
110
|
+
info: this.state === 'info',
|
|
111
|
+
warning: this.state === 'warning',
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
hasSlotContent(slotName) {
|
|
115
|
+
return this.el.querySelector(`[slot="${slotName}"]`) !== null;
|
|
116
|
+
}
|
|
117
|
+
renderIconSlot() {
|
|
118
|
+
if (this.hasSlotContent('icon')) {
|
|
119
|
+
return (h("div", { class: "input-icon" }, h("slot", { name: "icon" })));
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
renderButton() {
|
|
123
|
+
if (this.type === 'password') {
|
|
124
|
+
return (h("br-button", { class: "button-transform", shape: "circle", density: "small", "aria-label": "bot\u00E3o de a\u00E7\u00E3o do \u00EDcone", onClick: this.togglePasswordVisibility }, this.renderIconPassword()));
|
|
125
|
+
}
|
|
126
|
+
else if (this.hasSlotContent('action')) {
|
|
127
|
+
return (h("br-button", { class: "button-transform", shape: "circle", density: "small", "aria-label": "bot\u00E3o de a\u00E7\u00E3o do \u00EDcone" }, h("slot", { name: "action" })));
|
|
128
|
+
}
|
|
129
|
+
return null;
|
|
130
|
+
}
|
|
131
|
+
render() {
|
|
132
|
+
return (h(Host, { key: 'd5e8fec1c09589e9c9e9aa206b3c1669ef1f04f8' }, h("div", { key: '431430f8d91e3086b114d4bc7fa3b43e9b5b9eab', class: this.getInputCssClassMap() }, this.renderLabel(), this.isInline ? this.renderInlineInputContent() : this.renderInputContent())));
|
|
133
|
+
}
|
|
134
|
+
static get is() { return "br-input"; }
|
|
135
|
+
static get encapsulation() { return "shadow"; }
|
|
136
|
+
static get formAssociated() { return true; }
|
|
137
|
+
static get originalStyleUrls() {
|
|
138
|
+
return {
|
|
139
|
+
"$": ["input.scss"]
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
static get styleUrls() {
|
|
143
|
+
return {
|
|
144
|
+
"$": ["input.css"]
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
static get properties() {
|
|
148
|
+
return {
|
|
149
|
+
"customId": {
|
|
150
|
+
"type": "string",
|
|
151
|
+
"mutable": false,
|
|
152
|
+
"complexType": {
|
|
153
|
+
"original": "string",
|
|
154
|
+
"resolved": "string",
|
|
155
|
+
"references": {}
|
|
156
|
+
},
|
|
157
|
+
"required": false,
|
|
158
|
+
"optional": false,
|
|
159
|
+
"docs": {
|
|
160
|
+
"tags": [],
|
|
161
|
+
"text": "Identificador \u00FAnico do input.\nCaso n\u00E3o seja fornecido, um ID gerado automaticamente ser\u00E1 usado."
|
|
162
|
+
},
|
|
163
|
+
"attribute": "id",
|
|
164
|
+
"reflect": true,
|
|
165
|
+
"defaultValue": "`br-input-${uuidv4()}`"
|
|
166
|
+
},
|
|
167
|
+
"type": {
|
|
168
|
+
"type": "string",
|
|
169
|
+
"mutable": false,
|
|
170
|
+
"complexType": {
|
|
171
|
+
"original": "| 'color'\n | 'email'\n | 'hidden'\n | 'password'\n | 'range'\n | 'search'\n | 'number'\n | 'tel'\n | 'text'\n | 'file'\n | 'url'",
|
|
172
|
+
"resolved": "\"color\" | \"email\" | \"file\" | \"hidden\" | \"number\" | \"password\" | \"range\" | \"search\" | \"tel\" | \"text\" | \"url\"",
|
|
173
|
+
"references": {}
|
|
174
|
+
},
|
|
175
|
+
"required": false,
|
|
176
|
+
"optional": false,
|
|
177
|
+
"docs": {
|
|
178
|
+
"tags": [],
|
|
179
|
+
"text": "Especifica o tipo de entrada do campo. Pode ser um dos seguintes:\n- 'color': Seletor de cor\n- 'email': Campo para e-mail\n- 'hidden': Campo oculto\n- 'password': Campo para senha\n- 'range': Controle deslizante\n- 'search': Campo de pesquisa\n- 'number': Campo para n\u00FAmeros\n- 'tel': Campo para n\u00FAmeros de telefone\n- 'text': Campo de texto padr\u00E3o\n- 'url': Campo para URLs"
|
|
180
|
+
},
|
|
181
|
+
"attribute": "type",
|
|
182
|
+
"reflect": true,
|
|
183
|
+
"defaultValue": "'text'"
|
|
184
|
+
},
|
|
185
|
+
"autocomplete": {
|
|
186
|
+
"type": "string",
|
|
187
|
+
"mutable": false,
|
|
188
|
+
"complexType": {
|
|
189
|
+
"original": "'on' | 'off'",
|
|
190
|
+
"resolved": "\"off\" | \"on\"",
|
|
191
|
+
"references": {}
|
|
192
|
+
},
|
|
193
|
+
"required": false,
|
|
194
|
+
"optional": false,
|
|
195
|
+
"docs": {
|
|
196
|
+
"tags": [],
|
|
197
|
+
"text": "Controla o comportamento de preenchimento autom\u00E1tico do navegador para o input."
|
|
198
|
+
},
|
|
199
|
+
"attribute": "autocomplete",
|
|
200
|
+
"reflect": true
|
|
201
|
+
},
|
|
202
|
+
"density": {
|
|
203
|
+
"type": "string",
|
|
204
|
+
"mutable": false,
|
|
205
|
+
"complexType": {
|
|
206
|
+
"original": "'large' | 'medium' | 'small'",
|
|
207
|
+
"resolved": "\"large\" | \"medium\" | \"small\"",
|
|
208
|
+
"references": {}
|
|
209
|
+
},
|
|
210
|
+
"required": false,
|
|
211
|
+
"optional": false,
|
|
212
|
+
"docs": {
|
|
213
|
+
"tags": [],
|
|
214
|
+
"text": "Ajusta a densidade, alterando o espa\u00E7amento interno para um visual mais compacto ou mais expandido."
|
|
215
|
+
},
|
|
216
|
+
"attribute": "density",
|
|
217
|
+
"reflect": true,
|
|
218
|
+
"defaultValue": "'medium'"
|
|
219
|
+
},
|
|
220
|
+
"disabled": {
|
|
221
|
+
"type": "boolean",
|
|
222
|
+
"mutable": false,
|
|
223
|
+
"complexType": {
|
|
224
|
+
"original": "boolean",
|
|
225
|
+
"resolved": "boolean",
|
|
226
|
+
"references": {}
|
|
227
|
+
},
|
|
228
|
+
"required": false,
|
|
229
|
+
"optional": false,
|
|
230
|
+
"docs": {
|
|
231
|
+
"tags": [],
|
|
232
|
+
"text": "Desativa o input, tornando-o n\u00E3o interativo."
|
|
233
|
+
},
|
|
234
|
+
"attribute": "disabled",
|
|
235
|
+
"reflect": true,
|
|
236
|
+
"defaultValue": "false"
|
|
237
|
+
},
|
|
238
|
+
"isInline": {
|
|
239
|
+
"type": "boolean",
|
|
240
|
+
"mutable": false,
|
|
241
|
+
"complexType": {
|
|
242
|
+
"original": "boolean",
|
|
243
|
+
"resolved": "boolean",
|
|
244
|
+
"references": {}
|
|
245
|
+
},
|
|
246
|
+
"required": false,
|
|
247
|
+
"optional": false,
|
|
248
|
+
"docs": {
|
|
249
|
+
"tags": [],
|
|
250
|
+
"text": "Se verdadeiro, o r\u00F3tulo e o input estar\u00E3o na mesma linha (layout inline)."
|
|
251
|
+
},
|
|
252
|
+
"attribute": "is-inline",
|
|
253
|
+
"reflect": true,
|
|
254
|
+
"defaultValue": "false"
|
|
255
|
+
},
|
|
256
|
+
"isHighlight": {
|
|
257
|
+
"type": "boolean",
|
|
258
|
+
"mutable": false,
|
|
259
|
+
"complexType": {
|
|
260
|
+
"original": "boolean",
|
|
261
|
+
"resolved": "boolean",
|
|
262
|
+
"references": {}
|
|
263
|
+
},
|
|
264
|
+
"required": false,
|
|
265
|
+
"optional": false,
|
|
266
|
+
"docs": {
|
|
267
|
+
"tags": [],
|
|
268
|
+
"text": "Se verdadeiro, o input ter\u00E1 destaque visual."
|
|
269
|
+
},
|
|
270
|
+
"attribute": "is-highlight",
|
|
271
|
+
"reflect": true,
|
|
272
|
+
"defaultValue": "false"
|
|
273
|
+
},
|
|
274
|
+
"state": {
|
|
275
|
+
"type": "string",
|
|
276
|
+
"mutable": false,
|
|
277
|
+
"complexType": {
|
|
278
|
+
"original": "'info' | 'warning' | 'danger' | 'success'",
|
|
279
|
+
"resolved": "\"danger\" | \"info\" | \"success\" | \"warning\"",
|
|
280
|
+
"references": {}
|
|
281
|
+
},
|
|
282
|
+
"required": false,
|
|
283
|
+
"optional": false,
|
|
284
|
+
"docs": {
|
|
285
|
+
"tags": [],
|
|
286
|
+
"text": "Define o estado do input\nOs poss\u00EDveis valores s\u00E3o:\n- 'info': Mensagem informativa.\n- 'warning': Mensagem de aviso.\n- 'danger': Mensagem de erro ou alerta.\n- 'success': Mensagem de sucesso.\nO valor padr\u00E3o \u00E9 'info'."
|
|
287
|
+
},
|
|
288
|
+
"attribute": "state",
|
|
289
|
+
"reflect": true
|
|
290
|
+
},
|
|
291
|
+
"label": {
|
|
292
|
+
"type": "string",
|
|
293
|
+
"mutable": false,
|
|
294
|
+
"complexType": {
|
|
295
|
+
"original": "string",
|
|
296
|
+
"resolved": "string",
|
|
297
|
+
"references": {}
|
|
298
|
+
},
|
|
299
|
+
"required": false,
|
|
300
|
+
"optional": false,
|
|
301
|
+
"docs": {
|
|
302
|
+
"tags": [],
|
|
303
|
+
"text": "Texto exibido como r\u00F3tulo do input."
|
|
304
|
+
},
|
|
305
|
+
"attribute": "label",
|
|
306
|
+
"reflect": true
|
|
307
|
+
},
|
|
308
|
+
"name": {
|
|
309
|
+
"type": "string",
|
|
310
|
+
"mutable": false,
|
|
311
|
+
"complexType": {
|
|
312
|
+
"original": "string",
|
|
313
|
+
"resolved": "string",
|
|
314
|
+
"references": {}
|
|
315
|
+
},
|
|
316
|
+
"required": false,
|
|
317
|
+
"optional": false,
|
|
318
|
+
"docs": {
|
|
319
|
+
"tags": [],
|
|
320
|
+
"text": "Nome do input, utilizado para identifica\u00E7\u00E3o em formul\u00E1rios."
|
|
321
|
+
},
|
|
322
|
+
"attribute": "name",
|
|
323
|
+
"reflect": true
|
|
324
|
+
},
|
|
325
|
+
"placeholder": {
|
|
326
|
+
"type": "string",
|
|
327
|
+
"mutable": false,
|
|
328
|
+
"complexType": {
|
|
329
|
+
"original": "string",
|
|
330
|
+
"resolved": "string",
|
|
331
|
+
"references": {}
|
|
332
|
+
},
|
|
333
|
+
"required": false,
|
|
334
|
+
"optional": false,
|
|
335
|
+
"docs": {
|
|
336
|
+
"tags": [],
|
|
337
|
+
"text": "Texto exibido dentro do input quando est\u00E1 vazio, fornecendo uma dica ou sugest\u00E3o ao usu\u00E1rio."
|
|
338
|
+
},
|
|
339
|
+
"attribute": "placeholder",
|
|
340
|
+
"reflect": true
|
|
341
|
+
},
|
|
342
|
+
"readonly": {
|
|
343
|
+
"type": "boolean",
|
|
344
|
+
"mutable": false,
|
|
345
|
+
"complexType": {
|
|
346
|
+
"original": "boolean",
|
|
347
|
+
"resolved": "boolean",
|
|
348
|
+
"references": {}
|
|
349
|
+
},
|
|
350
|
+
"required": false,
|
|
351
|
+
"optional": false,
|
|
352
|
+
"docs": {
|
|
353
|
+
"tags": [],
|
|
354
|
+
"text": "Se verdadeiro, o valor do input \u00E9 exibido, mas n\u00E3o pode ser editado pelo usu\u00E1rio."
|
|
355
|
+
},
|
|
356
|
+
"attribute": "readonly",
|
|
357
|
+
"reflect": true,
|
|
358
|
+
"defaultValue": "false"
|
|
359
|
+
},
|
|
360
|
+
"required": {
|
|
361
|
+
"type": "boolean",
|
|
362
|
+
"mutable": false,
|
|
363
|
+
"complexType": {
|
|
364
|
+
"original": "boolean",
|
|
365
|
+
"resolved": "boolean",
|
|
366
|
+
"references": {}
|
|
367
|
+
},
|
|
368
|
+
"required": false,
|
|
369
|
+
"optional": false,
|
|
370
|
+
"docs": {
|
|
371
|
+
"tags": [],
|
|
372
|
+
"text": "Se verdadeiro, o input \u00E9 obrigat\u00F3rio e deve ser preenchido antes que o formul\u00E1rio possa ser enviado."
|
|
373
|
+
},
|
|
374
|
+
"attribute": "required",
|
|
375
|
+
"reflect": true,
|
|
376
|
+
"defaultValue": "false"
|
|
377
|
+
},
|
|
378
|
+
"value": {
|
|
379
|
+
"type": "string",
|
|
380
|
+
"mutable": true,
|
|
381
|
+
"complexType": {
|
|
382
|
+
"original": "string",
|
|
383
|
+
"resolved": "string",
|
|
384
|
+
"references": {}
|
|
385
|
+
},
|
|
386
|
+
"required": false,
|
|
387
|
+
"optional": false,
|
|
388
|
+
"docs": {
|
|
389
|
+
"tags": [],
|
|
390
|
+
"text": "Valor inicial exibido no input.\nPode ser alterado pelo usu\u00E1rio se a propriedade `readonly` n\u00E3o estiver ativa."
|
|
391
|
+
},
|
|
392
|
+
"attribute": "value",
|
|
393
|
+
"reflect": true
|
|
394
|
+
},
|
|
395
|
+
"helpText": {
|
|
396
|
+
"type": "string",
|
|
397
|
+
"mutable": false,
|
|
398
|
+
"complexType": {
|
|
399
|
+
"original": "string",
|
|
400
|
+
"resolved": "string",
|
|
401
|
+
"references": {}
|
|
402
|
+
},
|
|
403
|
+
"required": false,
|
|
404
|
+
"optional": false,
|
|
405
|
+
"docs": {
|
|
406
|
+
"tags": [],
|
|
407
|
+
"text": "Texto adicional que fornece ajuda ou informa\u00E7\u00F5es sobre o input."
|
|
408
|
+
},
|
|
409
|
+
"attribute": "help-text",
|
|
410
|
+
"reflect": true
|
|
411
|
+
},
|
|
412
|
+
"autocorrect": {
|
|
413
|
+
"type": "string",
|
|
414
|
+
"mutable": false,
|
|
415
|
+
"complexType": {
|
|
416
|
+
"original": "'off' | 'on'",
|
|
417
|
+
"resolved": "\"off\" | \"on\"",
|
|
418
|
+
"references": {}
|
|
419
|
+
},
|
|
420
|
+
"required": false,
|
|
421
|
+
"optional": false,
|
|
422
|
+
"docs": {
|
|
423
|
+
"tags": [],
|
|
424
|
+
"text": "Controla a corre\u00E7\u00E3o autom\u00E1tica do texto."
|
|
425
|
+
},
|
|
426
|
+
"attribute": "autocorrect",
|
|
427
|
+
"reflect": true,
|
|
428
|
+
"defaultValue": "'off'"
|
|
429
|
+
},
|
|
430
|
+
"min": {
|
|
431
|
+
"type": "number",
|
|
432
|
+
"mutable": false,
|
|
433
|
+
"complexType": {
|
|
434
|
+
"original": "number",
|
|
435
|
+
"resolved": "number",
|
|
436
|
+
"references": {}
|
|
437
|
+
},
|
|
438
|
+
"required": false,
|
|
439
|
+
"optional": false,
|
|
440
|
+
"docs": {
|
|
441
|
+
"tags": [],
|
|
442
|
+
"text": "Define o valor m\u00EDnimo para campos de entrada num\u00E9ricos."
|
|
443
|
+
},
|
|
444
|
+
"attribute": "min",
|
|
445
|
+
"reflect": true
|
|
446
|
+
},
|
|
447
|
+
"max": {
|
|
448
|
+
"type": "number",
|
|
449
|
+
"mutable": false,
|
|
450
|
+
"complexType": {
|
|
451
|
+
"original": "number",
|
|
452
|
+
"resolved": "number",
|
|
453
|
+
"references": {}
|
|
454
|
+
},
|
|
455
|
+
"required": false,
|
|
456
|
+
"optional": false,
|
|
457
|
+
"docs": {
|
|
458
|
+
"tags": [],
|
|
459
|
+
"text": "Define o valor m\u00E1ximo para campos de entrada num\u00E9ricos."
|
|
460
|
+
},
|
|
461
|
+
"attribute": "max",
|
|
462
|
+
"reflect": true
|
|
463
|
+
},
|
|
464
|
+
"minlength": {
|
|
465
|
+
"type": "number",
|
|
466
|
+
"mutable": false,
|
|
467
|
+
"complexType": {
|
|
468
|
+
"original": "number",
|
|
469
|
+
"resolved": "number",
|
|
470
|
+
"references": {}
|
|
471
|
+
},
|
|
472
|
+
"required": false,
|
|
473
|
+
"optional": false,
|
|
474
|
+
"docs": {
|
|
475
|
+
"tags": [],
|
|
476
|
+
"text": "Define o comprimento m\u00EDnimo do valor do campo de entrada."
|
|
477
|
+
},
|
|
478
|
+
"attribute": "minlength",
|
|
479
|
+
"reflect": true
|
|
480
|
+
},
|
|
481
|
+
"maxlength": {
|
|
482
|
+
"type": "number",
|
|
483
|
+
"mutable": false,
|
|
484
|
+
"complexType": {
|
|
485
|
+
"original": "number",
|
|
486
|
+
"resolved": "number",
|
|
487
|
+
"references": {}
|
|
488
|
+
},
|
|
489
|
+
"required": false,
|
|
490
|
+
"optional": false,
|
|
491
|
+
"docs": {
|
|
492
|
+
"tags": [],
|
|
493
|
+
"text": "Define o comprimento m\u00E1ximo do valor do campo de entrada."
|
|
494
|
+
},
|
|
495
|
+
"attribute": "maxlength",
|
|
496
|
+
"reflect": true
|
|
497
|
+
},
|
|
498
|
+
"multiple": {
|
|
499
|
+
"type": "boolean",
|
|
500
|
+
"mutable": false,
|
|
501
|
+
"complexType": {
|
|
502
|
+
"original": "boolean",
|
|
503
|
+
"resolved": "boolean",
|
|
504
|
+
"references": {}
|
|
505
|
+
},
|
|
506
|
+
"required": false,
|
|
507
|
+
"optional": false,
|
|
508
|
+
"docs": {
|
|
509
|
+
"tags": [],
|
|
510
|
+
"text": "Se verdadeiro, permite a sele\u00E7\u00E3o de m\u00FAltiplos arquivos."
|
|
511
|
+
},
|
|
512
|
+
"attribute": "multiple",
|
|
513
|
+
"reflect": true,
|
|
514
|
+
"defaultValue": "false"
|
|
515
|
+
},
|
|
516
|
+
"pattern": {
|
|
517
|
+
"type": "string",
|
|
518
|
+
"mutable": false,
|
|
519
|
+
"complexType": {
|
|
520
|
+
"original": "string",
|
|
521
|
+
"resolved": "string",
|
|
522
|
+
"references": {}
|
|
523
|
+
},
|
|
524
|
+
"required": false,
|
|
525
|
+
"optional": false,
|
|
526
|
+
"docs": {
|
|
527
|
+
"tags": [],
|
|
528
|
+
"text": "Define o padr\u00E3o de entrada para valida\u00E7\u00E3o."
|
|
529
|
+
},
|
|
530
|
+
"attribute": "pattern",
|
|
531
|
+
"reflect": true
|
|
532
|
+
},
|
|
533
|
+
"step": {
|
|
534
|
+
"type": "number",
|
|
535
|
+
"mutable": false,
|
|
536
|
+
"complexType": {
|
|
537
|
+
"original": "number",
|
|
538
|
+
"resolved": "number",
|
|
539
|
+
"references": {}
|
|
540
|
+
},
|
|
541
|
+
"required": false,
|
|
542
|
+
"optional": false,
|
|
543
|
+
"docs": {
|
|
544
|
+
"tags": [],
|
|
545
|
+
"text": "Define o valor do passo para campos de entrada num\u00E9ricos."
|
|
546
|
+
},
|
|
547
|
+
"attribute": "step",
|
|
548
|
+
"reflect": true
|
|
549
|
+
}
|
|
550
|
+
};
|
|
551
|
+
}
|
|
552
|
+
static get states() {
|
|
553
|
+
return {
|
|
554
|
+
"isPasswordVisible": {},
|
|
555
|
+
"hasIconSlot": {},
|
|
556
|
+
"hasActionSlot": {}
|
|
557
|
+
};
|
|
558
|
+
}
|
|
559
|
+
static get events() {
|
|
560
|
+
return [{
|
|
561
|
+
"method": "valueChange",
|
|
562
|
+
"name": "valueChange",
|
|
563
|
+
"bubbles": true,
|
|
564
|
+
"cancelable": true,
|
|
565
|
+
"composed": true,
|
|
566
|
+
"docs": {
|
|
567
|
+
"tags": [],
|
|
568
|
+
"text": "Valor atualizado do input"
|
|
569
|
+
},
|
|
570
|
+
"complexType": {
|
|
571
|
+
"original": "string",
|
|
572
|
+
"resolved": "string",
|
|
573
|
+
"references": {}
|
|
574
|
+
}
|
|
575
|
+
}];
|
|
576
|
+
}
|
|
577
|
+
static get elementRef() { return "el"; }
|
|
578
|
+
static get attachInternalsMemberName() { return "elementInternals"; }
|
|
579
|
+
}
|
|
580
|
+
//# sourceMappingURL=input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.js","sourceRoot":"","sources":["../../../../src/components/input/input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,SAAS,EA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, Component, Element, Event, EventEmitter, h, Host, Prop, State } from '@stencil/core'\nimport { v4 as uuidv4 } from 'uuid'\n\nimport { Attributes, inheritAriaAttributes } from '../../utils/inherited-attributes'\nimport { CssClassMap } from '../../utils/interfaces'\n\n/**\n *\n * Para uma descrição detalhada, consulte a [documentação do GovBR-DS](https://www.gov.br/ds/components/input?tab=designer).\n *\n * @slot action - Botão à direita do input.\n * @slot icon - Ícone à esquerda do input.\n * @slot help-text - Personalização do texto de ajuda.\n */\n@Component({\n tag: 'br-input',\n styleUrl: 'input.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class Input {\n /**\n * Referência ao elemento host do componente.\n * Utilize esta propriedade para acessar e manipular o elemento do DOM associado ao componente.\n */\n @Element() el: HTMLBrInputElement\n\n @AttachInternals() elementInternals: ElementInternals\n\n /**\n * Identificador único do input.\n * Caso não seja fornecido, um ID gerado automaticamente será usado.\n */\n @Prop({ reflect: true, attribute: 'id' }) customId: string = `br-input-${uuidv4()}`\n\n /**\n * Especifica o tipo de entrada do campo. Pode ser um dos seguintes:\n * - 'color': Seletor de cor\n * - 'email': Campo para e-mail\n * - 'hidden': Campo oculto\n * - 'password': Campo para senha\n * - 'range': Controle deslizante\n * - 'search': Campo de pesquisa\n * - 'number': Campo para números\n * - 'tel': Campo para números de telefone\n * - 'text': Campo de texto padrão\n * - 'url': Campo para URLs\n */\n @Prop({ reflect: true }) type:\n | 'color'\n | 'email'\n | 'hidden'\n | 'password'\n | 'range'\n | 'search'\n | 'number'\n | 'tel'\n | 'text'\n | 'file'\n | 'url' = 'text'\n\n /**\n * Controla o comportamento de preenchimento automático do navegador para o input.\n */\n @Prop({ reflect: true }) autocomplete: 'on' | 'off'\n\n /**\n * Ajusta a densidade, alterando o espaçamento interno para um visual mais compacto ou mais expandido.\n */\n @Prop({ reflect: true }) density: 'large' | 'medium' | 'small' = 'medium'\n\n /**\n * Desativa o input, tornando-o não interativo.\n */\n @Prop({ reflect: true }) disabled: boolean = false\n\n /**\n * Se verdadeiro, o rótulo e o input estarão na mesma linha (layout inline).\n */\n @Prop({ reflect: true }) isInline: boolean = false\n\n /**\n * Se verdadeiro, o input terá destaque visual.\n */\n @Prop({ reflect: true }) isHighlight: boolean = false\n\n /**\n * Define o estado do input\n * Os possíveis valores são:\n * - 'info': Mensagem informativa.\n * - 'warning': Mensagem de aviso.\n * - 'danger': Mensagem de erro ou alerta.\n * - 'success': Mensagem de sucesso.\n * O valor padrão é 'info'.\n */\n @Prop({ reflect: true }) state: 'info' | 'warning' | 'danger' | 'success'\n\n /**\n * Texto exibido como rótulo do input.\n */\n @Prop({ reflect: true }) label: string\n\n /**\n * Nome do input, utilizado para identificação em formulários.\n */\n @Prop({ reflect: true }) name: string\n\n /**\n * Texto exibido dentro do input quando está vazio, fornecendo uma dica ou sugestão ao usuário.\n */\n @Prop({ reflect: true }) placeholder: string\n\n /**\n * Se verdadeiro, o valor do input é exibido, mas não pode ser editado pelo usuário.\n */\n @Prop({ reflect: true }) readonly: boolean = false\n\n /**\n * Se verdadeiro, o input é obrigatório e deve ser preenchido antes que o formulário possa ser enviado.\n */\n @Prop({ reflect: true }) required: boolean = false\n\n /**\n * Valor inicial exibido no input.\n * Pode ser alterado pelo usuário se a propriedade `readonly` não estiver ativa.\n */\n @Prop({ reflect: true, mutable: true }) value: string\n\n /**\n * Texto adicional que fornece ajuda ou informações sobre o input.\n */\n @Prop({ reflect: true }) helpText: string\n\n /**\n * Controla a correção automática do texto.\n */\n @Prop({ reflect: true }) autocorrect: 'off' | 'on' = 'off'\n\n /**\n * Define o valor mínimo para campos de entrada numéricos.\n */\n @Prop({ reflect: true }) min: number\n\n /**\n * Define o valor máximo para campos de entrada numéricos.\n */\n @Prop({ reflect: true }) max: number\n\n /**\n * Define o comprimento mínimo do valor do campo de entrada.\n */\n @Prop({ reflect: true }) minlength: number\n\n /**\n * Define o comprimento máximo do valor do campo de entrada.\n */\n @Prop({ reflect: true }) maxlength: number\n\n /**\n * Se verdadeiro, permite a seleção de múltiplos arquivos.\n */\n @Prop({ reflect: true }) multiple: boolean = false\n\n /**\n * Define o padrão de entrada para validação.\n */\n @Prop({ reflect: true }) pattern: string\n\n /**\n * Define o valor do passo para campos de entrada numéricos.\n */\n @Prop({ reflect: true }) step: number\n\n @State() isPasswordVisible: boolean = false\n\n @State() hasIconSlot: boolean = false\n\n @State() hasActionSlot: boolean = false\n\n componentWillLoad() {\n this.hasIconSlot = this.hasSlotContent('icon')\n this.hasActionSlot = this.hasSlotContent('action')\n this.inheritedAttributes = inheritAriaAttributes(this.el)\n }\n\n private getInputCssClassMap(): CssClassMap {\n return {\n 'br-input': true,\n 'input-button': this.hasActionSlot,\n small: this.density === 'small',\n large: this.density === 'large',\n medium: this.density === 'medium',\n 'input-inline': this.isInline,\n 'input-highlight': this.isHighlight,\n success: this.state === 'success',\n danger: this.state === 'danger',\n info: this.state === 'info',\n warning: this.state === 'warning',\n }\n }\n\n private inheritedAttributes: Attributes = {}\n\n /**\n * Valor atualizado do input\n */\n @Event() valueChange!: EventEmitter<string>\n private readonly handleInput = (event: Event) => {\n this.value = (event.target as HTMLInputElement).value\n this.valueChange.emit(this.value)\n }\n\n private readonly renderLabel = () => {\n if (this.label?.length > 0) {\n if (this.isInline) {\n return (\n <div class=\"input-label\">\n <label class=\"text-nowrap\" htmlFor={this.customId}>\n {this.label}\n </label>\n </div>\n )\n } else {\n return <label htmlFor={this.customId}>{this.label}</label>\n }\n }\n }\n\n private hasSlotContent(slotName: string): boolean {\n return this.el.querySelector(`[slot=\"${slotName}\"]`) !== null\n }\n\n private readonly renderInput = () => {\n return (\n <input\n class={this.isHighlight ? 'input-highlight' : null}\n id={this.customId}\n autocomplete={this.autocomplete}\n disabled={this.disabled}\n autoCorrect={this.autocorrect}\n min={this.min}\n max={this.max}\n minLength={this.minlength}\n maxLength={this.maxlength}\n multiple={this.multiple}\n name={this.name}\n pattern={this.pattern}\n step={this.step}\n onInput={this.handleInput}\n placeholder={this.placeholder}\n readonly={this.readonly}\n required={this.required}\n title={this.el.title}\n type={this.type}\n value={this.value}\n {...this.inheritedAttributes}\n />\n )\n }\n\n private readonly renderHelpText = () => {\n return this.helpText?.length > 0 ? <p>{this.helpText}</p> : <slot name=\"help-text\"></slot>\n }\n\n private readonly renderIconPassword = () => {\n const iconName = this.isPasswordVisible ? 'fa-solid:eye-slash' : 'fa-solid:eye'\n return <br-icon icon-name={iconName}></br-icon>\n }\n\n private readonly togglePasswordVisibility = () => {\n const input = this.el.shadowRoot.querySelector('input')\n this.isPasswordVisible = !this.isPasswordVisible\n input.type = this.isPasswordVisible ? 'text' : 'password'\n }\n\n private renderIconSlot() {\n if (this.hasSlotContent('icon')) {\n return (\n <div class=\"input-icon\">\n <slot name=\"icon\"></slot>\n </div>\n )\n }\n }\n\n private renderButton() {\n if (this.type === 'password') {\n return (\n <br-button\n class=\"button-transform\"\n shape=\"circle\"\n density=\"small\"\n aria-label=\"botão de ação do ícone\"\n onClick={this.togglePasswordVisibility}\n >\n {this.renderIconPassword()}\n </br-button>\n )\n } else if (this.hasSlotContent('action')) {\n return (\n <br-button\n class=\"button-transform\"\n shape=\"circle\"\n density=\"small\"\n aria-label=\"botão de ação do ícone\"\n // onClick={this.onIconAction}\n >\n <slot name=\"action\"></slot>\n </br-button>\n )\n }\n return null\n }\n\n private readonly renderInlineInputContent = () => {\n if (this.hasIconSlot) {\n return <div class=\"input-content\">{this.renderInputWithIcon()}</div>\n } else {\n return <div class=\"input-content\">{this.renderInputWithoutIcon()}</div>\n }\n }\n\n private readonly renderInputContent = () => {\n return this.hasIconSlot ? this.renderInputWithIcon() : this.renderInputWithoutIcon()\n }\n\n private readonly renderInputWithIcon = () => {\n return (\n <div class=\"input-group\">\n {this.renderIconSlot()}\n {this.renderInput()}\n {this.renderButton()}\n {this.renderHelpText()}\n </div>\n )\n }\n\n private readonly renderInputWithoutIcon = () => {\n return [this.renderInput(), this.renderButton(), this.renderHelpText()]\n }\n\n render() {\n return (\n <Host>\n <div class={this.getInputCssClassMap()}>\n {this.renderLabel()}\n\n {this.isInline ? this.renderInlineInputContent() : this.renderInputContent()}\n </div>\n </Host>\n )\n }\n}\n"]}
|