@beeq/core 1.7.0 → 1.8.0-beta.1
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/dist/beeq/beeq.esm.js +43 -1
- package/dist/beeq/beeq.esm.js.map +1 -1
- package/dist/beeq/index.esm.js +64 -1
- package/dist/beeq/index.esm.js.map +1 -1
- package/dist/beeq/p-063a3968.entry.js +388 -0
- package/dist/beeq/p-063a3968.entry.js.map +1 -0
- package/dist/beeq/p-0979fdfd.entry.js +297 -0
- package/dist/beeq/{p-a453d36c.entry.js.map → p-0979fdfd.entry.js.map} +1 -1
- package/dist/beeq/p-0ab0b58d.js +25 -1
- package/dist/beeq/p-0ab0b58d.js.map +1 -1
- package/dist/beeq/p-0c42c08a.js +1811 -0
- package/dist/beeq/p-0c42c08a.js.map +1 -0
- package/dist/beeq/p-0f48adcc.entry.js +117 -0
- package/dist/beeq/{p-bcf6e585.entry.js.map → p-0f48adcc.entry.js.map} +1 -1
- package/dist/beeq/p-115ed5b2.js +25 -1
- package/dist/beeq/p-115ed5b2.js.map +1 -1
- package/dist/beeq/p-14b44a4b.entry.js +205 -0
- package/dist/beeq/{p-4f8ce653.entry.js.map → p-14b44a4b.entry.js.map} +1 -1
- package/dist/beeq/p-1715ac80.entry.js +274 -0
- package/dist/beeq/{p-554d0f45.entry.js.map → p-1715ac80.entry.js.map} +1 -1
- package/dist/beeq/p-1c8b6eb4.js +12 -1
- package/dist/beeq/p-1c8b6eb4.js.map +1 -1
- package/dist/beeq/p-1f3a4359.js +11 -1
- package/dist/beeq/p-1f3a4359.js.map +1 -1
- package/dist/beeq/p-242ac28a.entry.js +145 -0
- package/dist/beeq/{p-64835973.entry.js.map → p-242ac28a.entry.js.map} +1 -1
- package/dist/beeq/p-297fb76b.entry.js +220 -0
- package/dist/beeq/{p-4291b23f.entry.js.map → p-297fb76b.entry.js.map} +1 -1
- package/dist/beeq/p-2bb65f53.entry.js +204 -0
- package/dist/beeq/p-2bb65f53.entry.js.map +1 -0
- package/dist/beeq/p-2e66fc4f.entry.js +434 -0
- package/dist/beeq/{p-bcc85103.entry.js.map → p-2e66fc4f.entry.js.map} +1 -1
- package/dist/beeq/p-36652891.entry.js +102 -0
- package/dist/beeq/{p-21a51ee0.entry.js.map → p-36652891.entry.js.map} +1 -1
- package/dist/beeq/p-38d4bd8a.js +1939 -0
- package/dist/beeq/p-38d4bd8a.js.map +1 -0
- package/dist/beeq/p-39b7c578.entry.js +84 -0
- package/dist/beeq/{p-3711298a.entry.js.map → p-39b7c578.entry.js.map} +1 -1
- package/dist/beeq/p-39d77ba6.entry.js +90 -0
- package/dist/beeq/{p-f7d3f428.entry.js.map → p-39d77ba6.entry.js.map} +1 -1
- package/dist/beeq/p-3fd0d92d.js +1228 -1
- package/dist/beeq/p-3fd0d92d.js.map +1 -1
- package/dist/beeq/p-4688e046.js +16 -0
- package/dist/beeq/{p-aee056e5.js.map → p-4688e046.js.map} +1 -1
- package/dist/beeq/p-49249dda.entry.js +156 -0
- package/dist/beeq/{p-a062b9c4.entry.js.map → p-49249dda.entry.js.map} +1 -1
- package/dist/beeq/p-548b45b7.entry.js +104 -0
- package/dist/beeq/{p-c3e33045.entry.js.map → p-548b45b7.entry.js.map} +1 -1
- package/dist/beeq/p-57621be1.js +9 -1
- package/dist/beeq/p-57621be1.js.map +1 -1
- package/dist/beeq/p-57a55ac5.entry.js +261 -0
- package/dist/beeq/{p-d4ca1283.entry.js.map → p-57a55ac5.entry.js.map} +1 -1
- package/dist/beeq/p-5e11b866.entry.js +102 -0
- package/dist/beeq/{p-39f3d9d2.entry.js.map → p-5e11b866.entry.js.map} +1 -1
- package/dist/beeq/p-687da041.js +20 -1
- package/dist/beeq/p-687da041.js.map +1 -1
- package/dist/beeq/p-6a4e104b.entry.js +263 -0
- package/dist/beeq/{p-7691bdfc.entry.js.map → p-6a4e104b.entry.js.map} +1 -1
- package/dist/beeq/p-6a5a79a3.entry.js +184 -0
- package/dist/beeq/{p-fbb780c2.entry.js.map → p-6a5a79a3.entry.js.map} +1 -1
- package/dist/beeq/p-7f301da8.entry.js +508 -0
- package/dist/beeq/p-7f301da8.entry.js.map +1 -0
- package/dist/beeq/p-81f1c3ba.entry.js +121 -0
- package/dist/beeq/{p-819acf02.entry.js.map → p-81f1c3ba.entry.js.map} +1 -1
- package/dist/beeq/p-822773ae.entry.js +195 -0
- package/dist/beeq/{p-b2c55a62.entry.js.map → p-822773ae.entry.js.map} +1 -1
- package/dist/beeq/p-951ba558.js +64 -1
- package/dist/beeq/p-951ba558.js.map +1 -1
- package/dist/beeq/p-99829fc7.js +8 -1
- package/dist/beeq/p-99829fc7.js.map +1 -1
- package/dist/beeq/p-9990889d.entry.js +222 -0
- package/dist/beeq/{p-a9ca89e7.entry.js.map → p-9990889d.entry.js.map} +1 -1
- package/dist/beeq/p-a1b43de6.entry.js +248 -0
- package/dist/beeq/{p-889e6317.entry.js.map → p-a1b43de6.entry.js.map} +1 -1
- package/dist/beeq/p-a5dc1c94.js +118 -1
- package/dist/beeq/p-a5dc1c94.js.map +1 -1
- package/dist/beeq/p-a6489187.entry.js +103 -0
- package/dist/beeq/{p-d62cad31.entry.js.map → p-a6489187.entry.js.map} +1 -1
- package/dist/beeq/p-a8cad5ab.js +5 -1
- package/dist/beeq/p-a8cad5ab.js.map +1 -1
- package/dist/beeq/p-ac969486.entry.js +330 -0
- package/dist/beeq/{p-d9a3844f.entry.js.map → p-ac969486.entry.js.map} +1 -1
- package/dist/beeq/p-af062402.js +12 -0
- package/dist/beeq/p-af062402.js.map +1 -0
- package/dist/beeq/p-afc9fd80.entry.js +144 -0
- package/dist/beeq/{p-8b870d05.entry.js.map → p-afc9fd80.entry.js.map} +1 -1
- package/dist/beeq/p-bef53750.js +79 -0
- package/dist/beeq/p-bef53750.js.map +1 -0
- package/dist/beeq/p-bf2320dd.entry.js +329 -0
- package/dist/beeq/{p-67367b7d.entry.js.map → p-bf2320dd.entry.js.map} +1 -1
- package/dist/beeq/p-c34e292e.entry.js +127 -0
- package/dist/beeq/{p-5402707e.entry.js.map → p-c34e292e.entry.js.map} +1 -1
- package/dist/beeq/p-d7a88b16.js +87 -1
- package/dist/beeq/p-d7a88b16.js.map +1 -1
- package/dist/beeq/p-db18eba1.entry.js +173 -0
- package/dist/beeq/{p-02202605.entry.js.map → p-db18eba1.entry.js.map} +1 -1
- package/dist/beeq/p-dd950c12.entry.js +309 -0
- package/dist/beeq/p-dd950c12.entry.js.map +1 -0
- package/dist/beeq/p-e301647a.entry.js +87 -0
- package/dist/beeq/{p-6b824dba.entry.js.map → p-e301647a.entry.js.map} +1 -1
- package/dist/beeq/p-e3aa2886.entry.js +203 -0
- package/dist/beeq/{p-9c3030c7.entry.js.map → p-e3aa2886.entry.js.map} +1 -1
- package/dist/beeq/p-e41f07ae.entry.js +173 -0
- package/dist/beeq/p-e41f07ae.entry.js.map +1 -0
- package/dist/beeq/p-e88257a8.entry.js +259 -0
- package/dist/beeq/p-e88257a8.entry.js.map +1 -0
- package/dist/beeq/p-e9a54b49.entry.js +145 -0
- package/dist/beeq/{p-61c97bdc.entry.js.map → p-e9a54b49.entry.js.map} +1 -1
- package/dist/beeq/p-ecd27cf2.js +11 -1
- package/dist/beeq/p-ecd27cf2.js.map +1 -1
- package/dist/beeq/p-f77d9b8b.entry.js +144 -0
- package/dist/beeq/{p-a2157e4d.entry.js.map → p-f77d9b8b.entry.js.map} +1 -1
- package/dist/beeq/p-fd658de1.entry.js +135 -0
- package/dist/beeq/{p-c88ca7e9.entry.js.map → p-fd658de1.entry.js.map} +1 -1
- package/dist/beeq/p-ffb48c40.entry.js +258 -0
- package/dist/beeq/p-ffb48c40.entry.js.map +1 -0
- package/dist/beeq/p-ffddc425.entry.js +149 -0
- package/dist/beeq/{p-2e8e7e37.entry.js.map → p-ffddc425.entry.js.map} +1 -1
- package/dist/cjs/app-globals-b11284b9.js.map +1 -1
- package/dist/cjs/assetsPath-3938a05d.js +78 -0
- package/dist/cjs/assetsPath-3938a05d.js.map +1 -0
- package/dist/cjs/beeq.cjs.js +2 -2
- package/dist/cjs/bq-accordion-group.cjs.entry.js +2 -2
- package/dist/cjs/bq-accordion.cjs.entry.js +2 -2
- package/dist/cjs/bq-alert.cjs.entry.js +2 -2
- package/dist/cjs/bq-avatar.cjs.entry.js +2 -2
- package/dist/cjs/bq-badge.cjs.entry.js +2 -2
- package/dist/cjs/bq-breadcrumb-item.cjs.entry.js +3 -3
- package/dist/cjs/bq-breadcrumb.cjs.entry.js +2 -2
- package/dist/cjs/bq-button_2.cjs.entry.js +25 -21
- package/dist/cjs/bq-button_2.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-card.cjs.entry.js +2 -2
- package/dist/cjs/bq-checkbox.cjs.entry.js +57 -6
- package/dist/cjs/bq-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-date-picker.cjs.entry.js +3 -3
- package/dist/cjs/bq-dialog.cjs.entry.js +3 -3
- package/dist/cjs/bq-divider.cjs.entry.js +2 -2
- package/dist/cjs/bq-drawer.cjs.entry.js +7 -7
- package/dist/cjs/bq-drawer.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-dropdown_2.cjs.entry.js +2 -2
- package/dist/cjs/bq-empty-state.cjs.entry.js +2 -2
- package/dist/cjs/bq-input.cjs.entry.js +43 -16
- package/dist/cjs/bq-input.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-notification.cjs.entry.js +2 -2
- package/dist/cjs/bq-option-group.cjs.entry.js +1 -1
- package/dist/cjs/bq-option-list_2.cjs.entry.js +5 -5
- package/dist/cjs/bq-option.cjs.entry.js +2 -2
- package/dist/cjs/bq-page-title.cjs.entry.js +2 -2
- package/dist/cjs/bq-progress.cjs.entry.js +2 -2
- package/dist/cjs/bq-radio-group.cjs.entry.js +2 -2
- package/dist/cjs/bq-radio.cjs.entry.js +1 -1
- package/dist/cjs/bq-select.cjs.entry.js +78 -30
- package/dist/cjs/bq-select.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-side-menu-item.cjs.entry.js +2 -2
- package/dist/cjs/bq-side-menu.cjs.entry.js +2 -2
- package/dist/cjs/bq-slider.cjs.entry.js +2 -2
- package/dist/cjs/bq-spinner.cjs.entry.js +2 -2
- package/dist/cjs/bq-status.cjs.entry.js +2 -2
- package/dist/cjs/bq-step-item.cjs.entry.js +2 -2
- package/dist/cjs/bq-steps.cjs.entry.js +2 -2
- package/dist/cjs/bq-switch.cjs.entry.js +2 -2
- package/dist/cjs/bq-tab-group.cjs.entry.js +32 -16
- package/dist/cjs/bq-tab-group.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-tab.cjs.entry.js +14 -8
- package/dist/cjs/bq-tab.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-tab.types-a8b320b0.js +15 -0
- package/dist/cjs/bq-tab.types-a8b320b0.js.map +1 -0
- package/dist/cjs/bq-textarea.cjs.entry.js +5 -5
- package/dist/cjs/bq-toast.cjs.entry.js +3 -3
- package/dist/cjs/bq-tooltip.cjs.entry.js +3 -3
- package/dist/cjs/{index-76b0999c.js → index-1d3aac65.js} +48 -2
- package/dist/cjs/index-1d3aac65.js.map +1 -0
- package/dist/cjs/{index-a09d1c08.js → index-e4c116b6.js} +12 -9
- package/dist/cjs/index-e4c116b6.js.map +1 -0
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/{isDefined-4f4a320b.js → isDefined-750bffc4.js} +2 -2
- package/dist/cjs/{isDefined-4f4a320b.js.map → isDefined-750bffc4.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/components/checkbox/bq-checkbox.js +67 -3
- package/dist/collection/components/checkbox/bq-checkbox.js.map +1 -1
- package/dist/collection/components/dialog/scss/bq-dialog.css +1 -1
- package/dist/collection/components/drawer/bq-drawer.js +7 -5
- package/dist/collection/components/drawer/bq-drawer.js.map +1 -1
- package/dist/collection/components/drawer/scss/bq-drawer.css +1 -1
- package/dist/collection/components/icon/helper/request.js +23 -19
- package/dist/collection/components/icon/helper/request.js.map +1 -1
- package/dist/collection/components/input/bq-input.js +34 -13
- package/dist/collection/components/input/bq-input.js.map +1 -1
- package/dist/collection/components/select/bq-select.js +71 -29
- package/dist/collection/components/select/bq-select.js.map +1 -1
- package/dist/collection/components/tab/bq-tab.js +62 -4
- package/dist/collection/components/tab/bq-tab.js.map +1 -1
- package/dist/collection/components/tab/bq-tab.types.js +2 -0
- package/dist/collection/components/tab/bq-tab.types.js.map +1 -1
- package/dist/collection/components/tab/scss/bq-tab.css +1 -1
- package/dist/collection/components/tab-group/bq-tab-group.js +81 -14
- package/dist/collection/components/tab-group/bq-tab-group.js.map +1 -1
- package/dist/collection/components/tab-group/scss/bq-tab-group.css +1 -1
- package/dist/collection/components/tag/bq-tag.js +3 -3
- package/dist/collection/components/textarea/bq-textarea.js +3 -3
- package/dist/collection/components/toast/bq-toast.js +1 -1
- package/dist/collection/components/tooltip/bq-tooltip.js +1 -1
- package/dist/collection/shared/utils/assetsPath.js +52 -26
- package/dist/collection/shared/utils/assetsPath.js.map +1 -1
- package/dist/components/assetsPath.js +52 -26
- package/dist/components/assetsPath.js.map +1 -1
- package/dist/components/bq-checkbox.js +53 -6
- package/dist/components/bq-checkbox.js.map +1 -1
- package/dist/components/bq-dialog.js +1 -1
- package/dist/components/bq-drawer.js +5 -5
- package/dist/components/bq-drawer.js.map +1 -1
- package/dist/components/bq-icon2.js +23 -19
- package/dist/components/bq-icon2.js.map +1 -1
- package/dist/components/bq-input.js +35 -13
- package/dist/components/bq-input.js.map +1 -1
- package/dist/components/bq-select.js +71 -28
- package/dist/components/bq-select.js.map +1 -1
- package/dist/components/bq-tab-group.js +36 -16
- package/dist/components/bq-tab-group.js.map +1 -1
- package/dist/components/bq-tab.js +17 -7
- package/dist/components/bq-tab.js.map +1 -1
- package/dist/components/bq-tab.types.js +3 -1
- package/dist/components/bq-tab.types.js.map +1 -1
- package/dist/components/bq-tag2.js +3 -3
- package/dist/components/bq-textarea.js +3 -3
- package/dist/components/bq-toast.js +1 -1
- package/dist/components/bq-tooltip2.js +1 -1
- package/dist/components/index2.js +11 -8
- package/dist/components/index2.js.map +1 -1
- package/dist/esm/app-globals-de5a646b.js.map +1 -1
- package/dist/esm/assetsPath-a1b58980.js +75 -0
- package/dist/esm/assetsPath-a1b58980.js.map +1 -0
- package/dist/esm/beeq.js +3 -3
- package/dist/esm/bq-accordion-group.entry.js +2 -2
- package/dist/esm/bq-accordion.entry.js +2 -2
- package/dist/esm/bq-alert.entry.js +2 -2
- package/dist/esm/bq-avatar.entry.js +2 -2
- package/dist/esm/bq-badge.entry.js +2 -2
- package/dist/esm/bq-breadcrumb-item.entry.js +3 -3
- package/dist/esm/bq-breadcrumb.entry.js +2 -2
- package/dist/esm/bq-button_2.entry.js +25 -21
- package/dist/esm/bq-button_2.entry.js.map +1 -1
- package/dist/esm/bq-card.entry.js +2 -2
- package/dist/esm/bq-checkbox.entry.js +57 -6
- package/dist/esm/bq-checkbox.entry.js.map +1 -1
- package/dist/esm/bq-date-picker.entry.js +3 -3
- package/dist/esm/bq-dialog.entry.js +3 -3
- package/dist/esm/bq-divider.entry.js +2 -2
- package/dist/esm/bq-drawer.entry.js +7 -7
- package/dist/esm/bq-drawer.entry.js.map +1 -1
- package/dist/esm/bq-dropdown_2.entry.js +2 -2
- package/dist/esm/bq-empty-state.entry.js +2 -2
- package/dist/esm/bq-input.entry.js +43 -16
- package/dist/esm/bq-input.entry.js.map +1 -1
- package/dist/esm/bq-notification.entry.js +2 -2
- package/dist/esm/bq-option-group.entry.js +1 -1
- package/dist/esm/bq-option-list_2.entry.js +5 -5
- package/dist/esm/bq-option.entry.js +2 -2
- package/dist/esm/bq-page-title.entry.js +2 -2
- package/dist/esm/bq-progress.entry.js +2 -2
- package/dist/esm/bq-radio-group.entry.js +2 -2
- package/dist/esm/bq-radio.entry.js +1 -1
- package/dist/esm/bq-select.entry.js +79 -31
- package/dist/esm/bq-select.entry.js.map +1 -1
- package/dist/esm/bq-side-menu-item.entry.js +2 -2
- package/dist/esm/bq-side-menu.entry.js +2 -2
- package/dist/esm/bq-slider.entry.js +2 -2
- package/dist/esm/bq-spinner.entry.js +2 -2
- package/dist/esm/bq-status.entry.js +2 -2
- package/dist/esm/bq-step-item.entry.js +2 -2
- package/dist/esm/bq-steps.entry.js +2 -2
- package/dist/esm/bq-switch.entry.js +2 -2
- package/dist/esm/bq-tab-group.entry.js +32 -16
- package/dist/esm/bq-tab-group.entry.js.map +1 -1
- package/dist/esm/bq-tab.entry.js +14 -8
- package/dist/esm/bq-tab.entry.js.map +1 -1
- package/dist/esm/bq-tab.types-36e2666e.js +11 -0
- package/dist/esm/bq-tab.types-36e2666e.js.map +1 -0
- package/dist/esm/bq-textarea.entry.js +5 -5
- package/dist/esm/bq-toast.entry.js +3 -3
- package/dist/esm/bq-tooltip.entry.js +3 -3
- package/dist/esm/{index-138f308e.js → index-136429a6.js} +12 -9
- package/dist/esm/index-136429a6.js.map +1 -0
- package/dist/esm/{index-7eed7a88.js → index-f69556fe.js} +48 -2
- package/dist/esm/index-f69556fe.js.map +1 -0
- package/dist/esm/index.js +3 -3
- package/dist/esm/{isDefined-91ae4cd3.js → isDefined-170f3095.js} +2 -2
- package/dist/esm/{isDefined-91ae4cd3.js.map → isDefined-170f3095.js.map} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/hydrate/index.js +348 -133
- package/dist/hydrate/index.mjs +348 -133
- package/dist/types/components/checkbox/bq-checkbox.d.ts +9 -0
- package/dist/types/components/drawer/bq-drawer.d.ts +3 -1
- package/dist/types/components/input/bq-input.d.ts +4 -1
- package/dist/types/components/select/bq-select.d.ts +18 -0
- package/dist/types/components/tab/bq-tab.d.ts +5 -1
- package/dist/types/components/tab/bq-tab.types.d.ts +4 -0
- package/dist/types/components/tab-group/bq-tab-group.d.ts +5 -1
- package/dist/types/components.d.ts +42 -2
- package/dist/types/home/workflows/workspace/packages/beeq/.stencil/packages/beeq/stencil.config.d.ts +2 -0
- package/dist/types/shared/utils/assetsPath.d.ts +18 -11
- package/package.json +24 -24
- package/dist/beeq/p-02202605.entry.js +0 -6
- package/dist/beeq/p-0f528ec6.js +0 -6
- package/dist/beeq/p-0f528ec6.js.map +0 -1
- package/dist/beeq/p-1d3f236b.entry.js +0 -6
- package/dist/beeq/p-1d3f236b.entry.js.map +0 -1
- package/dist/beeq/p-21a51ee0.entry.js +0 -6
- package/dist/beeq/p-2e8e7e37.entry.js +0 -6
- package/dist/beeq/p-3711298a.entry.js +0 -6
- package/dist/beeq/p-39f3d9d2.entry.js +0 -6
- package/dist/beeq/p-3a1f06e1.entry.js +0 -6
- package/dist/beeq/p-3a1f06e1.entry.js.map +0 -1
- package/dist/beeq/p-4291b23f.entry.js +0 -6
- package/dist/beeq/p-463a17cf.js +0 -7
- package/dist/beeq/p-463a17cf.js.map +0 -1
- package/dist/beeq/p-48b27aef.entry.js +0 -6
- package/dist/beeq/p-48b27aef.entry.js.map +0 -1
- package/dist/beeq/p-4f8ce653.entry.js +0 -6
- package/dist/beeq/p-5402707e.entry.js +0 -6
- package/dist/beeq/p-554d0f45.entry.js +0 -6
- package/dist/beeq/p-61c97bdc.entry.js +0 -6
- package/dist/beeq/p-64835973.entry.js +0 -6
- package/dist/beeq/p-67367b7d.entry.js +0 -6
- package/dist/beeq/p-68fdea6a.js +0 -6
- package/dist/beeq/p-68fdea6a.js.map +0 -1
- package/dist/beeq/p-6b824dba.entry.js +0 -6
- package/dist/beeq/p-6edc8a33.js +0 -6
- package/dist/beeq/p-6edc8a33.js.map +0 -1
- package/dist/beeq/p-7567ae06.entry.js +0 -6
- package/dist/beeq/p-7567ae06.entry.js.map +0 -1
- package/dist/beeq/p-7691bdfc.entry.js +0 -6
- package/dist/beeq/p-819acf02.entry.js +0 -6
- package/dist/beeq/p-889e6317.entry.js +0 -6
- package/dist/beeq/p-8b870d05.entry.js +0 -6
- package/dist/beeq/p-9c3030c7.entry.js +0 -6
- package/dist/beeq/p-a062b9c4.entry.js +0 -6
- package/dist/beeq/p-a2157e4d.entry.js +0 -6
- package/dist/beeq/p-a453d36c.entry.js +0 -6
- package/dist/beeq/p-a9ca89e7.entry.js +0 -6
- package/dist/beeq/p-aae41e31.entry.js +0 -6
- package/dist/beeq/p-aae41e31.entry.js.map +0 -1
- package/dist/beeq/p-aee056e5.js +0 -6
- package/dist/beeq/p-b2c55a62.entry.js +0 -6
- package/dist/beeq/p-bcc85103.entry.js +0 -6
- package/dist/beeq/p-bcf6e585.entry.js +0 -6
- package/dist/beeq/p-c3e33045.entry.js +0 -6
- package/dist/beeq/p-c88ca7e9.entry.js +0 -6
- package/dist/beeq/p-cec068b9.entry.js +0 -6
- package/dist/beeq/p-cec068b9.entry.js.map +0 -1
- package/dist/beeq/p-d4ca1283.entry.js +0 -6
- package/dist/beeq/p-d62cad31.entry.js +0 -6
- package/dist/beeq/p-d9a3844f.entry.js +0 -6
- package/dist/beeq/p-ec4a6d10.entry.js +0 -6
- package/dist/beeq/p-ec4a6d10.entry.js.map +0 -1
- package/dist/beeq/p-f7d3f428.entry.js +0 -6
- package/dist/beeq/p-fbb780c2.entry.js +0 -6
- package/dist/cjs/assetsPath-eac0a3bf.js +0 -52
- package/dist/cjs/assetsPath-eac0a3bf.js.map +0 -1
- package/dist/cjs/bq-tab.types-9fe0234a.js +0 -11
- package/dist/cjs/bq-tab.types-9fe0234a.js.map +0 -1
- package/dist/cjs/index-76b0999c.js.map +0 -1
- package/dist/cjs/index-a09d1c08.js.map +0 -1
- package/dist/esm/assetsPath-ae18c25e.js +0 -49
- package/dist/esm/assetsPath-ae18c25e.js.map +0 -1
- package/dist/esm/bq-tab.types-f64aa67d.js +0 -9
- package/dist/esm/bq-tab.types-f64aa67d.js.map +0 -1
- package/dist/esm/index-138f308e.js.map +0 -1
- package/dist/esm/index-7eed7a88.js.map +0 -1
- package/dist/types/home/runner/work/BEEQ/BEEQ/packages/beeq/.stencil/packages/beeq/stencil.config.d.ts +0 -2
- /package/dist/types/home/{runner/work/BEEQ/BEEQ → workflows/workspace}/packages/beeq/.stencil/tailwind.config.d.ts +0 -0
|
@@ -5,33 +5,37 @@
|
|
|
5
5
|
/* -------------------------------------------------------------------------- */
|
|
6
6
|
/* Icon request helper */
|
|
7
7
|
/* -------------------------------------------------------------------------- */
|
|
8
|
-
import { isString } from "../../../shared/utils";
|
|
8
|
+
import { isNil, isString } from "../../../shared/utils";
|
|
9
9
|
const requests = new Map();
|
|
10
10
|
const fetchSvg = async (url, sanitize) => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
if (typeof fetch === 'undefined' || typeof document === 'undefined')
|
|
12
|
+
return;
|
|
13
|
+
if (requests.has(url))
|
|
14
|
+
return requests.get(url);
|
|
15
|
+
try {
|
|
16
|
+
const response = await fetch(url);
|
|
17
|
+
if (!response.ok) {
|
|
18
|
+
iconContent.set(url, '');
|
|
19
|
+
return;
|
|
20
20
|
}
|
|
21
|
+
let svgContent = (await response.text()) || '';
|
|
22
|
+
if (svgContent && sanitize !== false)
|
|
23
|
+
svgContent = validateContent(svgContent);
|
|
24
|
+
iconContent.set(url, svgContent);
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
console.error(`[BqIcon] Failed to fetch SVG from ${url}:`, error);
|
|
21
28
|
iconContent.set(url, '');
|
|
22
|
-
// cache for the same requests
|
|
23
|
-
requests.set(url, req);
|
|
24
|
-
return req;
|
|
25
29
|
}
|
|
26
|
-
iconContent.set(url, '');
|
|
27
|
-
return Promise.resolve();
|
|
28
30
|
};
|
|
29
31
|
export const iconContent = new Map();
|
|
30
32
|
export const getSvgContent = async (url, sanitize) => {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
if (
|
|
34
|
-
|
|
33
|
+
let req = requests.get(url);
|
|
34
|
+
// NOTE: if the request does not exists we will cache it
|
|
35
|
+
if (isNil(req)) {
|
|
36
|
+
req = fetchSvg(url, sanitize);
|
|
37
|
+
requests.set(url, req);
|
|
38
|
+
}
|
|
35
39
|
return req;
|
|
36
40
|
};
|
|
37
41
|
export const validateContent = (svgContent) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../../../../../../src/components/icon/helper/request.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,gFAAgF;AAChF,gFAAgF;AAEhF,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../../../../../../src/components/icon/helper/request.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,gFAAgF;AAChF,gFAAgF;AAEhF,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAExD,MAAM,QAAQ,GAAG,IAAI,GAAG,EAA4B,CAAC;AAErD,MAAM,QAAQ,GAAG,KAAK,EAAE,GAAW,EAAE,QAAiB,EAAoB,EAAE;IAC1E,IAAI,OAAO,KAAK,KAAK,WAAW,IAAI,OAAO,QAAQ,KAAK,WAAW;QAAE,OAAO;IAE5E,IAAI,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC;QAAE,OAAO,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAEhD,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC;QAElC,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,WAAW,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;YACzB,OAAO;QACT,CAAC;QAED,IAAI,UAAU,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC;QAE/C,IAAI,UAAU,IAAI,QAAQ,KAAK,KAAK;YAAE,UAAU,GAAG,eAAe,CAAC,UAAU,CAAC,CAAC;QAE/E,WAAW,CAAC,GAAG,CAAC,GAAG,EAAE,UAAU,CAAC,CAA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;QAED,KAAK,MAAM,SAAS,IAAI,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAkB,EAAE,CAAC;YAClE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;gBAAE,OAAO,KAAK,CAAC;QACxC,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC","sourcesContent":["/* -------------------------------------------------------------------------- */\n/* Icon request helper */\n/* -------------------------------------------------------------------------- */\n\nimport { isNil, isString } from '../../../shared/utils';\n\nconst requests = new Map<string, Promise<unknown>>();\n\nconst fetchSvg = async (url: string, sanitize: boolean): Promise<unknown> => {\n if (typeof fetch === 'undefined' || typeof document === 'undefined') return;\n\n if (requests.has(url)) return requests.get(url);\n\n try {\n const response = await fetch(url);\n\n if (!response.ok) {\n iconContent.set(url, '');\n return;\n }\n\n let svgContent = (await response.text()) || '';\n\n if (svgContent && sanitize !== false) svgContent = validateContent(svgContent);\n\n iconContent.set(url, svgContent);\n } catch (error) {\n console.error(`[BqIcon] Failed to fetch SVG from ${url}:`, error);\n iconContent.set(url, '');\n }\n};\n\nexport const iconContent = new Map<string, string>();\n\nexport const getSvgContent = async (url: string, sanitize: boolean) => {\n let req = requests.get(url);\n\n // NOTE: if the request does not exists we will cache it\n if (isNil(req)) {\n req = fetchSvg(url, sanitize);\n requests.set(url, req);\n }\n return req;\n};\n\nexport const validateContent = (svgContent: string): string => {\n const svgTag = 'svg';\n const iconCssClass = 'bq-icon__svg';\n\n const div = document.createElement('div');\n div.innerHTML = svgContent;\n\n for (let i = div.childNodes.length - 1; i >= 0; i--) {\n if (div.childNodes[i].nodeName.toLowerCase() !== svgTag) {\n div.removeChild(div.childNodes[i]);\n }\n }\n\n // must only have 1 root element\n const svgElm = div.firstElementChild;\n if (svgElm && svgElm.nodeName.toLowerCase() === svgTag) {\n // keep other CSS classes (if there's any) and add the `bq-icon__svg` CSS class\n const othersCssClasses = svgElm.getAttribute('class') || '';\n svgElm.setAttribute('class', `${othersCssClasses} ${iconCssClass}`.trim());\n // set the shadow DOM part for the SVG element\n svgElm.setAttribute('part', svgTag);\n\n // remove height and width attribute, if for some reason they are still present in the SVG tag\n svgElm.removeAttribute('height');\n svgElm.removeAttribute('width');\n\n // root element must be an svg\n // lets double check we've got valid elements\n // do not allow scripts\n if (isValid(svgElm as HTMLElement)) return div.innerHTML;\n }\n\n return '';\n};\n\nexport const isValid = (elm: HTMLElement): boolean => {\n if (elm.nodeType === Node.ELEMENT_NODE) {\n if (elm.nodeName.toLowerCase() === 'script') return false;\n\n for (const attribute of Array.from(elm.attributes)) {\n const value = attribute.value;\n if (isString(value) && value.toLowerCase().startsWith('on')) {\n return false;\n }\n }\n\n for (const childNode of Array.from(elm.children) as HTMLElement[]) {\n if (!isValid(childNode)) return false;\n }\n }\n return true;\n};\n"]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* © https://beeq.design - Apache 2 License.
|
|
4
4
|
*/
|
|
5
5
|
import { h } from "@stencil/core";
|
|
6
|
-
import { debounce, hasSlotContent, isDefined, isHTMLElement } from "../../shared/utils";
|
|
6
|
+
import { debounce, hasSlotContent, isDefined, isHTMLElement, isNil } from "../../shared/utils";
|
|
7
7
|
/**
|
|
8
8
|
* @part base - The component's base wrapper.
|
|
9
9
|
* @part button - The native HTML button used under the hood in the clear button.
|
|
@@ -48,6 +48,7 @@ export class BqInput {
|
|
|
48
48
|
if (!isHTMLElement(ev.target, 'input'))
|
|
49
49
|
return;
|
|
50
50
|
this.value = this.type === 'number' ? Number(ev.target.value) : ev.target.value;
|
|
51
|
+
this.internals.setFormValue(`${this.value}`);
|
|
51
52
|
this.debounceBqInput = debounce(() => {
|
|
52
53
|
this.bqInput.emit({ value: this.value, el: this.el });
|
|
53
54
|
}, this.debounceTime);
|
|
@@ -59,18 +60,29 @@ export class BqInput {
|
|
|
59
60
|
if (!isHTMLElement(ev.target, 'input'))
|
|
60
61
|
return;
|
|
61
62
|
this.value = this.type === 'number' ? Number(ev.target.value) : ev.target.value;
|
|
63
|
+
this.internals.setFormValue(`${this.value}`);
|
|
62
64
|
this.bqChange.emit({ value: this.value, el: this.el });
|
|
63
65
|
};
|
|
64
|
-
this.
|
|
66
|
+
this.handleClear = () => {
|
|
65
67
|
if (this.disabled)
|
|
66
68
|
return;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
this.
|
|
71
|
-
|
|
72
|
-
|
|
69
|
+
const { inputElem, internals } = this;
|
|
70
|
+
// Clear input element value
|
|
71
|
+
inputElem.value = '';
|
|
72
|
+
this.value = inputElem.value;
|
|
73
|
+
// Update associated form control value
|
|
74
|
+
internals.setFormValue(undefined);
|
|
75
|
+
};
|
|
76
|
+
this.handleClearClick = (ev) => {
|
|
73
77
|
ev.stopPropagation();
|
|
78
|
+
this.handleClear();
|
|
79
|
+
const { bqClear, bqChange, bqInput, el, inputElem } = this;
|
|
80
|
+
// Emit events
|
|
81
|
+
bqClear.emit(el);
|
|
82
|
+
bqInput.emit({ value: this.value, el });
|
|
83
|
+
bqChange.emit({ value: this.value, el });
|
|
84
|
+
// Refocus input element
|
|
85
|
+
inputElem.focus();
|
|
74
86
|
};
|
|
75
87
|
this.handleLabelSlotChange = () => {
|
|
76
88
|
this.hasLabel = hasSlotContent(this.labelElem);
|
|
@@ -118,37 +130,45 @@ export class BqInput {
|
|
|
118
130
|
handleValueChange() {
|
|
119
131
|
if (Array.isArray(this.value)) {
|
|
120
132
|
this.hasValue = this.value.some((val) => val.length > 0);
|
|
133
|
+
this.internals.setFormValue(this.value.join(','));
|
|
121
134
|
return;
|
|
122
135
|
}
|
|
123
136
|
this.hasValue = isDefined(this.value);
|
|
137
|
+
this.internals.setFormValue(`${this.value}`);
|
|
124
138
|
}
|
|
125
139
|
// Component lifecycle events
|
|
126
140
|
// Ordered by their natural call order
|
|
127
141
|
// =====================================
|
|
128
|
-
|
|
142
|
+
componentWillLoad() {
|
|
129
143
|
this.handleValueChange();
|
|
130
144
|
}
|
|
145
|
+
formResetCallback() {
|
|
146
|
+
if (isNil(this.value))
|
|
147
|
+
return;
|
|
148
|
+
this.handleClear();
|
|
149
|
+
}
|
|
131
150
|
// render() function
|
|
132
151
|
// Always the last one in the class.
|
|
133
152
|
// ===================================
|
|
134
153
|
render() {
|
|
135
|
-
return (h("div", { key: '
|
|
154
|
+
return (h("div", { key: 'c9d184b8abfbaebda3478f7b8892c7d2bf024fdc', class: "bq-input", part: "base" }, h("label", { key: 'a938804cb78f78b65c1c2139d90fd98e5edecb52', class: { 'bq-input--label': true, '!hidden': !this.hasLabel }, htmlFor: this.name || this.fallbackInputId, ref: (labelElem) => (this.labelElem = labelElem), part: "label" }, h("slot", { key: '37c407ab1b0399be8371629431d839f138f751df', name: "label", onSlotchange: this.handleLabelSlotChange })), h("div", { key: '130305745ed36bbe2d1012508f3ae2653b6794b2', class: {
|
|
136
155
|
'bq-input--control': true,
|
|
137
156
|
[`validation-${this.validationStatus}`]: true,
|
|
138
157
|
disabled: this.disabled,
|
|
139
|
-
}, part: "control" }, h("span", { key: '
|
|
158
|
+
}, part: "control" }, h("span", { key: '59c8d5f28373cae3741f4420da1fbc4744869806', class: { 'bq-input--control__prefix': true, '!hidden': !this.hasPrefix }, ref: (spanElem) => (this.prefixElem = spanElem), part: "prefix" }, h("slot", { key: '4f6a705b9a4e7deb46e334c11c6b242b091afec6', name: "prefix", onSlotchange: this.handlePrefixSlotChange })), h("input", { key: '6c238b5c2329d3f77dd4cb8a0aac9ffbfc937aad', id: this.name || this.fallbackInputId, class: "bq-input--control__input", "aria-disabled": this.disabled ? 'true' : 'false', autoCapitalize: this.autocapitalize, autoComplete: this.autocomplete, autoCorrect: this.autocorrect, autoFocus: this.autofocus, disabled: this.disabled, form: this.form, inputMode: this.inputmode, max: this.max, maxLength: this.maxlength, min: this.min, minLength: this.minlength, name: this.name, pattern: this.pattern, placeholder: this.placeholder, ref: (inputElem) => (this.inputElem = inputElem), readOnly: this.readonly, required: this.required, step: this.step, type: this.type, value: this.value, part: "input",
|
|
140
159
|
// Events
|
|
141
160
|
onBlur: this.handleBlur, onChange: this.handleChange, onFocus: this.handleFocus, onInput: this.handleInput }), this.hasValue && !this.disabled && !this.disableClear && (
|
|
142
161
|
// The clear button will be visible as long as the input has a value
|
|
143
162
|
// and the parent group is hovered or has focus-within
|
|
144
|
-
h("bq-button", { key: '
|
|
163
|
+
h("bq-button", { key: 'bae89f316a8c7cfb04d1bcff8df6e418c93fa838', class: "bq-input--control__clear ms-[--bq-input--gap] hidden", appearance: "text", "aria-label": this.clearButtonLabel, size: "small", onBqClick: this.handleClearClick, part: "clear-btn", exportparts: "button" }, h("slot", { key: 'd00287e78d20d2fdcbac8aa89a3bb30c40c6b8f1', name: "clear-icon" }, h("bq-icon", { key: '9be1f57ece6cea670a5c7adc76fb70feb66663c5', name: "x-circle", class: "flex" })))), h("span", { key: '93421c6d1e061e2a19315d1d8aadbcc2a01f19c3', class: { 'bq-input--control__suffix': true, '!hidden': !this.hasSuffix }, ref: (spanElem) => (this.suffixElem = spanElem), part: "suffix" }, h("slot", { key: 'ccb589bdc3b227467885d728c82f3fcedacb1695', name: "suffix", onSlotchange: this.handleSuffixSlotChange }))), h("div", { key: 'b0374c936b4e3839ed936ade23ad59aa3c69cf9a', class: {
|
|
145
164
|
[`bq-input--helper-text validation-${this.validationStatus}`]: true,
|
|
146
165
|
'!hidden': !this.hasHelperText,
|
|
147
|
-
}, ref: (divElem) => (this.helperTextElem = divElem), part: "helper-text" }, h("slot", { key: '
|
|
166
|
+
}, ref: (divElem) => (this.helperTextElem = divElem), part: "helper-text" }, h("slot", { key: 'a0a8c8d546efa959d6126e96ddf97a702263026f', name: "helper-text", onSlotchange: this.handleHelperTextSlotChange }))));
|
|
148
167
|
}
|
|
149
168
|
static get is() { return "bq-input"; }
|
|
150
169
|
static get encapsulation() { return "shadow"; }
|
|
151
170
|
static get delegatesFocus() { return true; }
|
|
171
|
+
static get formAssociated() { return true; }
|
|
152
172
|
static get originalStyleUrls() {
|
|
153
173
|
return {
|
|
154
174
|
"$": ["./scss/bq-input.scss"]
|
|
@@ -703,5 +723,6 @@ export class BqInput {
|
|
|
703
723
|
"methodName": "handleValueChange"
|
|
704
724
|
}];
|
|
705
725
|
}
|
|
726
|
+
static get attachInternalsMemberName() { return "internals"; }
|
|
706
727
|
}
|
|
707
728
|
//# sourceMappingURL=bq-input.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bq-input.js","sourceRoot":"","sources":["../../../../../../src/components/input/bq-input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAG/F,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,SAAS,EAAE,aAAa,EAAa,MAAM,oBAAoB,CAAC;AAEnG;;;;;;;;;;GAUG;AAQH,MAAM,OAAO,OAAO;;QAWV,oBAAe,GAAG,OAAO,CAAC;QAqLlC,YAAY;QACZ,iBAAiB;QAEjB,qBAAqB;QACrB,iDAAiD;QACjD,wBAAwB;QACxB,gCAAgC;QAChC,gDAAgD;QAChD,kDAAkD;QAElD,gBAAgB;QAChB,2BAA2B;QAC3B,wDAAwD;QACxD,0DAA0D;QAElD,eAAU,GAAG,GAAG,EAAE;YACxB,IAAI,IAAI,CAAC,QAAQ;gBAAE,OAAO;YAE1B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC5B,CAAC,CAAC;QAEM,gBAAW,GAAG,GAAG,EAAE;YACzB,IAAI,IAAI,CAAC,QAAQ;gBAAE,OAAO;YAE1B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC7B,CAAC,CAAC;QAEM,gBAAW,GAAG,CAAC,EAAS,EAAE,EAAE;;YAClC,IAAI,IAAI,CAAC,QAAQ;gBAAE,OAAO;YAE1B,M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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Prop, State, Watch } from '@stencil/core';\n\nimport { TInputType, TInputValidation, TInputValue } from './bq-input.types';\nimport { debounce, hasSlotContent, isDefined, isHTMLElement, TDebounce } from '../../shared/utils';\n\n/**\n * @part base - The component's base wrapper.\n * @part button - The native HTML button used under the hood in the clear button.\n * @part clear-btn - The clear button.\n * @part control - The input control wrapper.\n * @part helper-text - The helper text slot container.\n * @part label - The label slot container.\n * @part input - The native HTML input element used under the hood.\n * @part prefix - The prefix slot container.\n * @part suffix - The suffix slot container.\n */\n@Component({\n tag: 'bq-input',\n styleUrl: './scss/bq-input.scss',\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class BqInput {\n // Own Properties\n // ====================\n\n private helperTextElem?: HTMLElement;\n private inputElem?: HTMLInputElement;\n private labelElem?: HTMLElement;\n private prefixElem?: HTMLElement;\n private suffixElem?: HTMLElement;\n\n private debounceBqInput: TDebounce<void>;\n private fallbackInputId = 'input';\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqInputElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() hasHelperText = false;\n @State() hasLabel = false;\n @State() hasPrefix = false;\n @State() hasSuffix = false;\n @State() hasValue = false;\n\n // Public Property API\n // ========================\n\n /**\n * Controls whether or not the input field should be capitalized and how.\n * Possible values are 'off', 'none', 'on', 'sentences', 'words', and 'characters'.\n * See: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autocapitalize\n */\n @Prop({ reflect: true }) autocapitalize: string = 'off';\n\n /**\n * Specifies whether or not the input field should have autocomplete enabled.\n * See: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values\n */\n @Prop({ reflect: true }) autocomplete: string = 'off';\n\n /**\n * Controls whether or not the input field should have autocorrect enabled.\n * Possible values are 'on' and 'off'.\n */\n @Prop({ reflect: true }) autocorrect: 'on' | 'off' = 'off';\n\n /** If true, the input will be focused on component render */\n @Prop({ reflect: true }) autofocus: boolean;\n\n /** The clear button aria label */\n @Prop({ reflect: true }) clearButtonLabel? = 'Clear value';\n\n /**\n * The amount of time, in milliseconds, to wait before emitting the `bqInput` event after the input value changes.\n * A value of 0 means no debouncing will occur.\n */\n @Prop({ reflect: true, mutable: true }) debounceTime? = 0;\n\n /**\n * Indicates whether the input is disabled or not.\n * If `true`, the input is disabled and cannot be interacted with.\n */\n @Prop({ mutable: true }) disabled?: boolean = false;\n\n /** If true, the clear button won't be displayed */\n @Prop({ reflect: true }) disableClear? = false;\n\n /** The ID of the form that the input field belongs to. */\n @Prop({ reflect: true }) form?: string;\n\n /**\n * The inputmode attribute specifies what kind of input mechanism would be most helpful for users entering content into the input field.\n * This allows a browser to display an appropriate virtual keyboard while editing.\n * Possible values are 'none', 'text', 'decimal', 'numeric', 'tel', 'search', 'email', 'url', and 'date'.\n */\n @Prop() inputmode?: string;\n\n /**\n * The maximum value that the input field can accept.\n * Only applies to date and number input types.\n */\n @Prop({ reflect: true }) max?: number | string;\n\n /** The maximum number of characters that the input field can accept. */\n @Prop({ reflect: true }) maxlength: number;\n\n /**\n * The minimum value that the input field can accept.\n * Only applies to date and number input types.\n */\n @Prop({ reflect: true }) min?: number | string;\n\n /** The minimum number of characters that the input field can accept. */\n @Prop({ reflect: true }) minlength: number;\n\n /** The input field name. */\n @Prop({ reflect: true }) name!: string;\n\n /**\n * Specifies a regular expression the form control's value should match.\n * See: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern\n */\n @Prop({ reflect: true }) pattern?: string;\n\n /** The input placeholder text value */\n @Prop({ reflect: true }) placeholder?: string;\n\n /** If true, the input field cannot be modified. */\n @Prop({ reflect: true }) readonly?: boolean;\n\n /** Indicates whether or not the input field is required to be filled out before submitting the form. */\n @Prop({ reflect: true }) required?: boolean;\n\n /**\n * A number that specifies the granularity that the value must adhere to.\n * Valid for date, month, week, time, datetime-local, number, and range.\n * See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#step\n */\n @Prop({ reflect: true }) step: number | 'any';\n\n /**\n * The type attribute specifies the type of input field to display.\n * Possible values are 'text', 'password', 'email', 'number', 'tel', 'search', 'url', and more.\n * See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types\n */\n @Prop({ reflect: true }) type: TInputType = 'text';\n\n /**\n * The validation status of the input.\n *\n * @remarks\n * This property is used to indicate the validation status of the input. It can be set to one of the following values:\n * - `'none'`: No validation status is set.\n * - `'error'`: The input has a validation error.\n * - `'warning'`: The input has a validation warning.\n * - `'success'`: The input has passed validation.\n */\n @Prop({ reflect: true }) validationStatus: TInputValidation = 'none';\n\n /** The input value, it can be used to reset the input to a previous value */\n @Prop({ reflect: true, mutable: true }) value: TInputValue;\n\n // Prop lifecycle events\n // =======================\n\n @Watch('value')\n handleValueChange() {\n if (Array.isArray(this.value)) {\n this.hasValue = this.value.some((val) => val.length > 0);\n return;\n }\n\n this.hasValue = isDefined(this.value);\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Callback handler emitted when the input loses focus */\n @Event() bqBlur!: EventEmitter<HTMLBqInputElement>;\n\n /**\n * Callback handler emitted when the input value has changed and the input loses focus.\n * This handler is called whenever the user finishes typing or pasting text into the input field and then clicks outside of the input field.\n */\n @Event() bqChange!: EventEmitter<{ value: string | number | string[]; el: HTMLBqInputElement }>;\n\n /** Callback handler emitted when the input value has been cleared */\n @Event() bqClear!: EventEmitter<HTMLBqInputElement>;\n\n /** Callback handler emitted when the input has received focus */\n @Event() bqFocus!: EventEmitter<HTMLBqInputElement>;\n\n /**\n * Callback handler emitted when the input value changes.\n * This handler is called whenever the user types or pastes text into the input field.\n */\n @Event() bqInput!: EventEmitter<{ value: string | number | string[]; el: HTMLBqInputElement }>;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n componentDidLoad() {\n this.handleValueChange();\n }\n\n // Listeners\n // ==============\n\n // Public methods API\n // These methods are exposed on the host element.\n // Always use two lines.\n // Public Methods must be async.\n // Requires JSDocs for public API documentation.\n // ===============================================\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private handleBlur = () => {\n if (this.disabled) return;\n\n this.bqBlur.emit(this.el);\n };\n\n private handleFocus = () => {\n if (this.disabled) return;\n\n this.bqFocus.emit(this.el);\n };\n\n private handleInput = (ev: Event) => {\n if (this.disabled) return;\n\n this.debounceBqInput?.cancel();\n\n if (!isHTMLElement(ev.target, 'input')) return;\n this.value = this.type === 'number' ? Number(ev.target.value) : ev.target.value;\n\n this.debounceBqInput = debounce(() => {\n this.bqInput.emit({ value: this.value, el: this.el });\n }, this.debounceTime);\n this.debounceBqInput();\n };\n\n private handleChange = (ev: Event) => {\n if (this.disabled) return;\n\n if (!isHTMLElement(ev.target, 'input')) return;\n this.value = this.type === 'number' ? Number(ev.target.value) : ev.target.value;\n\n this.bqChange.emit({ value: this.value, el: this.el });\n };\n\n private handleClearClick = (ev: CustomEvent) => {\n if (this.disabled) return;\n\n this.inputElem.value = '';\n this.value = this.inputElem.value;\n\n this.bqClear.emit(this.el);\n this.bqInput.emit({ value: this.value, el: this.el });\n this.bqChange.emit({ value: this.value, el: this.el });\n this.inputElem.focus();\n\n ev.stopPropagation();\n };\n\n private handleLabelSlotChange = () => {\n this.hasLabel = hasSlotContent(this.labelElem);\n };\n\n private handlePrefixSlotChange = () => {\n this.hasPrefix = hasSlotContent(this.prefixElem);\n };\n\n private handleSuffixSlotChange = () => {\n this.hasSuffix = hasSlotContent(this.suffixElem);\n };\n\n private handleHelperTextSlotChange = () => {\n this.hasHelperText = hasSlotContent(this.helperTextElem);\n };\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n return (\n <div class=\"bq-input\" part=\"base\">\n {/* Label */}\n <label\n class={{ 'bq-input--label': true, '!hidden': !this.hasLabel }}\n htmlFor={this.name || this.fallbackInputId}\n ref={(labelElem) => (this.labelElem = labelElem)}\n part=\"label\"\n >\n <slot name=\"label\" onSlotchange={this.handleLabelSlotChange} />\n </label>\n {/* Input control group */}\n <div\n class={{\n 'bq-input--control': true,\n [`validation-${this.validationStatus}`]: true,\n disabled: this.disabled,\n }}\n part=\"control\"\n >\n {/* Prefix */}\n <span\n class={{ 'bq-input--control__prefix': true, '!hidden': !this.hasPrefix }}\n ref={(spanElem) => (this.prefixElem = spanElem)}\n part=\"prefix\"\n >\n <slot name=\"prefix\" onSlotchange={this.handlePrefixSlotChange} />\n </span>\n {/* HTML Input */}\n <input\n id={this.name || this.fallbackInputId}\n class=\"bq-input--control__input\"\n aria-disabled={this.disabled ? 'true' : 'false'}\n autoCapitalize={this.autocapitalize}\n autoComplete={this.autocomplete}\n autoCorrect={this.autocorrect}\n autoFocus={this.autofocus}\n disabled={this.disabled}\n form={this.form}\n inputMode={this.inputmode}\n max={this.max}\n maxLength={this.maxlength}\n min={this.min}\n minLength={this.minlength}\n name={this.name}\n pattern={this.pattern}\n placeholder={this.placeholder}\n ref={(inputElem) => (this.inputElem = inputElem)}\n readOnly={this.readonly}\n required={this.required}\n step={this.step}\n type={this.type}\n value={this.value}\n part=\"input\"\n // Events\n onBlur={this.handleBlur}\n onChange={this.handleChange}\n onFocus={this.handleFocus}\n onInput={this.handleInput}\n />\n {/* Clear Button */}\n {this.hasValue && !this.disabled && !this.disableClear && (\n // The clear button will be visible as long as the input has a value\n // and the parent group is hovered or has focus-within\n <bq-button\n class=\"bq-input--control__clear ms-[--bq-input--gap] hidden\"\n appearance=\"text\"\n aria-label={this.clearButtonLabel}\n size=\"small\"\n onBqClick={this.handleClearClick}\n part=\"clear-btn\"\n exportparts=\"button\"\n >\n <slot name=\"clear-icon\">\n <bq-icon name=\"x-circle\" class=\"flex\" />\n </slot>\n </bq-button>\n )}\n {/* Suffix */}\n <span\n class={{ 'bq-input--control__suffix': true, '!hidden': !this.hasSuffix }}\n ref={(spanElem) => (this.suffixElem = spanElem)}\n part=\"suffix\"\n >\n <slot name=\"suffix\" onSlotchange={this.handleSuffixSlotChange} />\n </span>\n </div>\n {/* Helper text */}\n <div\n class={{\n [`bq-input--helper-text validation-${this.validationStatus}`]: true,\n '!hidden': !this.hasHelperText,\n }}\n ref={(divElem) => (this.helperTextElem = divElem)}\n part=\"helper-text\"\n >\n <slot name=\"helper-text\" onSlotchange={this.handleHelperTextSlotChange} />\n </div>\n </div>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"bq-input.js","sourceRoot":"","sources":["../../../../../../src/components/input/bq-input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAGhH,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,SAAS,EAAE,aAAa,EAAE,KAAK,EAAa,MAAM,oBAAoB,CAAC;AAE1G;;;;;;;;;;GAUG;AASH,MAAM,OAAO,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,6DAAM,IAAI,EAAC,aAAa,EAAC,YAAY,EAAE,IAAI,CAAC,0BAA0B,GAAI,CACtE,CACF,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { AttachInternals, Component, Element, Event, EventEmitter, h, Prop, State, Watch } from '@stencil/core';\n\nimport { TInputType, TInputValidation, TInputValue } from './bq-input.types';\nimport { debounce, hasSlotContent, isDefined, isHTMLElement, isNil, TDebounce } from '../../shared/utils';\n\n/**\n * @part base - The component's base wrapper.\n * @part button - The native HTML button used under the hood in the clear button.\n * @part clear-btn - The clear button.\n * @part control - The input control wrapper.\n * @part helper-text - The helper text slot container.\n * @part label - The label slot container.\n * @part input - The native HTML input element used under the hood.\n * @part prefix - The prefix slot container.\n * @part suffix - The suffix slot container.\n */\n@Component({\n tag: 'bq-input',\n styleUrl: './scss/bq-input.scss',\n formAssociated: true,\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class BqInput {\n // Own Properties\n // ====================\n\n private helperTextElem?: HTMLElement;\n private inputElem?: HTMLInputElement;\n private labelElem?: HTMLElement;\n private prefixElem?: HTMLElement;\n private suffixElem?: HTMLElement;\n\n private debounceBqInput: TDebounce<void>;\n private fallbackInputId = 'input';\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqInputElement;\n @AttachInternals() internals!: ElementInternals;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() hasHelperText = false;\n @State() hasLabel = false;\n @State() hasPrefix = false;\n @State() hasSuffix = false;\n @State() hasValue = false;\n\n // Public Property API\n // ========================\n\n /**\n * Controls whether or not the input field should be capitalized and how.\n * Possible values are 'off', 'none', 'on', 'sentences', 'words', and 'characters'.\n * See: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autocapitalize\n */\n @Prop({ reflect: true }) autocapitalize: string = 'off';\n\n /**\n * Specifies whether or not the input field should have autocomplete enabled.\n * See: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values\n */\n @Prop({ reflect: true }) autocomplete: string = 'off';\n\n /**\n * Controls whether or not the input field should have autocorrect enabled.\n * Possible values are 'on' and 'off'.\n */\n @Prop({ reflect: true }) autocorrect: 'on' | 'off' = 'off';\n\n /** If true, the input will be focused on component render */\n @Prop({ reflect: true }) autofocus: boolean;\n\n /** The clear button aria label */\n @Prop({ reflect: true }) clearButtonLabel? = 'Clear value';\n\n /**\n * The amount of time, in milliseconds, to wait before emitting the `bqInput` event after the input value changes.\n * A value of 0 means no debouncing will occur.\n */\n @Prop({ reflect: true, mutable: true }) debounceTime? = 0;\n\n /**\n * Indicates whether the input is disabled or not.\n * If `true`, the input is disabled and cannot be interacted with.\n */\n @Prop({ mutable: true }) disabled?: boolean = false;\n\n /** If true, the clear button won't be displayed */\n @Prop({ reflect: true }) disableClear? = false;\n\n /** The ID of the form that the input field belongs to. */\n @Prop({ reflect: true }) form?: string;\n\n /**\n * The inputmode attribute specifies what kind of input mechanism would be most helpful for users entering content into the input field.\n * This allows a browser to display an appropriate virtual keyboard while editing.\n * Possible values are 'none', 'text', 'decimal', 'numeric', 'tel', 'search', 'email', 'url', and 'date'.\n */\n @Prop() inputmode?: string;\n\n /**\n * The maximum value that the input field can accept.\n * Only applies to date and number input types.\n */\n @Prop({ reflect: true }) max?: number | string;\n\n /** The maximum number of characters that the input field can accept. */\n @Prop({ reflect: true }) maxlength: number;\n\n /**\n * The minimum value that the input field can accept.\n * Only applies to date and number input types.\n */\n @Prop({ reflect: true }) min?: number | string;\n\n /** The minimum number of characters that the input field can accept. */\n @Prop({ reflect: true }) minlength: number;\n\n /** The input field name. */\n @Prop({ reflect: true }) name!: string;\n\n /**\n * Specifies a regular expression the form control's value should match.\n * See: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern\n */\n @Prop({ reflect: true }) pattern?: string;\n\n /** The input placeholder text value */\n @Prop({ reflect: true }) placeholder?: string;\n\n /** If true, the input field cannot be modified. */\n @Prop({ reflect: true }) readonly?: boolean;\n\n /** Indicates whether or not the input field is required to be filled out before submitting the form. */\n @Prop({ reflect: true }) required?: boolean;\n\n /**\n * A number that specifies the granularity that the value must adhere to.\n * Valid for date, month, week, time, datetime-local, number, and range.\n * See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#step\n */\n @Prop({ reflect: true }) step: number | 'any';\n\n /**\n * The type attribute specifies the type of input field to display.\n * Possible values are 'text', 'password', 'email', 'number', 'tel', 'search', 'url', and more.\n * See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types\n */\n @Prop({ reflect: true }) type: TInputType = 'text';\n\n /**\n * The validation status of the input.\n *\n * @remarks\n * This property is used to indicate the validation status of the input. It can be set to one of the following values:\n * - `'none'`: No validation status is set.\n * - `'error'`: The input has a validation error.\n * - `'warning'`: The input has a validation warning.\n * - `'success'`: The input has passed validation.\n */\n @Prop({ reflect: true }) validationStatus: TInputValidation = 'none';\n\n /** The input value, it can be used to reset the input to a previous value */\n @Prop({ reflect: true, mutable: true }) value: TInputValue;\n\n // Prop lifecycle events\n // =======================\n\n @Watch('value')\n handleValueChange() {\n if (Array.isArray(this.value)) {\n this.hasValue = this.value.some((val) => val.length > 0);\n this.internals.setFormValue(this.value.join(','));\n return;\n }\n\n this.hasValue = isDefined(this.value);\n this.internals.setFormValue(`${this.value}`);\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Callback handler emitted when the input loses focus */\n @Event() bqBlur!: EventEmitter<HTMLBqInputElement>;\n\n /**\n * Callback handler emitted when the input value has changed and the input loses focus.\n * This handler is called whenever the user finishes typing or pasting text into the input field and then clicks outside of the input field.\n */\n @Event() bqChange!: EventEmitter<{ value: string | number | string[]; el: HTMLBqInputElement }>;\n\n /** Callback handler emitted when the input value has been cleared */\n @Event() bqClear!: EventEmitter<HTMLBqInputElement>;\n\n /** Callback handler emitted when the input has received focus */\n @Event() bqFocus!: EventEmitter<HTMLBqInputElement>;\n\n /**\n * Callback handler emitted when the input value changes.\n * This handler is called whenever the user types or pastes text into the input field.\n */\n @Event() bqInput!: EventEmitter<{ value: string | number | string[]; el: HTMLBqInputElement }>;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n componentWillLoad() {\n this.handleValueChange();\n }\n\n formResetCallback() {\n if (isNil(this.value)) return;\n\n this.handleClear();\n }\n\n // Listeners\n // ==============\n\n // Public methods API\n // These methods are exposed on the host element.\n // Always use two lines.\n // Public Methods must be async.\n // Requires JSDocs for public API documentation.\n // ===============================================\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private handleBlur = () => {\n if (this.disabled) return;\n\n this.bqBlur.emit(this.el);\n };\n\n private handleFocus = () => {\n if (this.disabled) return;\n\n this.bqFocus.emit(this.el);\n };\n\n private handleInput = (ev: Event) => {\n if (this.disabled) return;\n\n this.debounceBqInput?.cancel();\n\n if (!isHTMLElement(ev.target, 'input')) return;\n this.value = this.type === 'number' ? Number(ev.target.value) : ev.target.value;\n this.internals.setFormValue(`${this.value}`);\n\n this.debounceBqInput = debounce(() => {\n this.bqInput.emit({ value: this.value, el: this.el });\n }, this.debounceTime);\n this.debounceBqInput();\n };\n\n private handleChange = (ev: Event) => {\n if (this.disabled) return;\n\n if (!isHTMLElement(ev.target, 'input')) return;\n this.value = this.type === 'number' ? Number(ev.target.value) : ev.target.value;\n this.internals.setFormValue(`${this.value}`);\n\n this.bqChange.emit({ value: this.value, el: this.el });\n };\n\n private handleClear = () => {\n if (this.disabled) return;\n\n const { inputElem, internals } = this;\n\n // Clear input element value\n inputElem.value = '';\n this.value = inputElem.value;\n\n // Update associated form control value\n internals.setFormValue(undefined);\n };\n\n private handleClearClick = (ev: CustomEvent) => {\n ev.stopPropagation();\n this.handleClear();\n\n const { bqClear, bqChange, bqInput, el, inputElem } = this;\n // Emit events\n bqClear.emit(el);\n bqInput.emit({ value: this.value, el });\n bqChange.emit({ value: this.value, el });\n // Refocus input element\n inputElem.focus();\n };\n\n private handleLabelSlotChange = () => {\n this.hasLabel = hasSlotContent(this.labelElem);\n };\n\n private handlePrefixSlotChange = () => {\n this.hasPrefix = hasSlotContent(this.prefixElem);\n };\n\n private handleSuffixSlotChange = () => {\n this.hasSuffix = hasSlotContent(this.suffixElem);\n };\n\n private handleHelperTextSlotChange = () => {\n this.hasHelperText = hasSlotContent(this.helperTextElem);\n };\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n return (\n <div class=\"bq-input\" part=\"base\">\n {/* Label */}\n <label\n class={{ 'bq-input--label': true, '!hidden': !this.hasLabel }}\n htmlFor={this.name || this.fallbackInputId}\n ref={(labelElem) => (this.labelElem = labelElem)}\n part=\"label\"\n >\n <slot name=\"label\" onSlotchange={this.handleLabelSlotChange} />\n </label>\n {/* Input control group */}\n <div\n class={{\n 'bq-input--control': true,\n [`validation-${this.validationStatus}`]: true,\n disabled: this.disabled,\n }}\n part=\"control\"\n >\n {/* Prefix */}\n <span\n class={{ 'bq-input--control__prefix': true, '!hidden': !this.hasPrefix }}\n ref={(spanElem) => (this.prefixElem = spanElem)}\n part=\"prefix\"\n >\n <slot name=\"prefix\" onSlotchange={this.handlePrefixSlotChange} />\n </span>\n {/* HTML Input */}\n <input\n id={this.name || this.fallbackInputId}\n class=\"bq-input--control__input\"\n aria-disabled={this.disabled ? 'true' : 'false'}\n autoCapitalize={this.autocapitalize}\n autoComplete={this.autocomplete}\n autoCorrect={this.autocorrect}\n autoFocus={this.autofocus}\n disabled={this.disabled}\n form={this.form}\n inputMode={this.inputmode}\n max={this.max}\n maxLength={this.maxlength}\n min={this.min}\n minLength={this.minlength}\n name={this.name}\n pattern={this.pattern}\n placeholder={this.placeholder}\n ref={(inputElem) => (this.inputElem = inputElem)}\n readOnly={this.readonly}\n required={this.required}\n step={this.step}\n type={this.type}\n value={this.value}\n part=\"input\"\n // Events\n onBlur={this.handleBlur}\n onChange={this.handleChange}\n onFocus={this.handleFocus}\n onInput={this.handleInput}\n />\n {/* Clear Button */}\n {this.hasValue && !this.disabled && !this.disableClear && (\n // The clear button will be visible as long as the input has a value\n // and the parent group is hovered or has focus-within\n <bq-button\n class=\"bq-input--control__clear ms-[--bq-input--gap] hidden\"\n appearance=\"text\"\n aria-label={this.clearButtonLabel}\n size=\"small\"\n onBqClick={this.handleClearClick}\n part=\"clear-btn\"\n exportparts=\"button\"\n >\n <slot name=\"clear-icon\">\n <bq-icon name=\"x-circle\" class=\"flex\" />\n </slot>\n </bq-button>\n )}\n {/* Suffix */}\n <span\n class={{ 'bq-input--control__suffix': true, '!hidden': !this.hasSuffix }}\n ref={(spanElem) => (this.suffixElem = spanElem)}\n part=\"suffix\"\n >\n <slot name=\"suffix\" onSlotchange={this.handleSuffixSlotChange} />\n </span>\n </div>\n {/* Helper text */}\n <div\n class={{\n [`bq-input--helper-text validation-${this.validationStatus}`]: true,\n '!hidden': !this.hasHelperText,\n }}\n ref={(divElem) => (this.helperTextElem = divElem)}\n part=\"helper-text\"\n >\n <slot name=\"helper-text\" onSlotchange={this.handleHelperTextSlotChange} />\n </div>\n </div>\n );\n }\n}\n"]}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Built by Endavans
|
|
3
3
|
* © https://beeq.design - Apache 2 License.
|
|
4
4
|
*/
|
|
5
|
-
import { h } from "@stencil/core";
|
|
6
|
-
import { debounce,
|
|
5
|
+
import { h, } from "@stencil/core";
|
|
6
|
+
import { debounce, hasSlotContent, isDefined, isHTMLElement, isNil, isString } from "../../shared/utils";
|
|
7
7
|
/**
|
|
8
8
|
* @part base - The component's base wrapper.
|
|
9
9
|
* @part button - The native HTML button used under the hood in the clear button.
|
|
@@ -125,34 +125,58 @@ export class BqSelect {
|
|
|
125
125
|
this.options.forEach((item) => (item.hidden = false));
|
|
126
126
|
};
|
|
127
127
|
this.syncItemsFromValue = () => {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
if (!items.length)
|
|
128
|
+
const { internals, options, value } = this;
|
|
129
|
+
if (!options.length)
|
|
131
130
|
return;
|
|
132
131
|
// Sync selected state of the BqOption elements
|
|
133
|
-
this.
|
|
134
|
-
|
|
135
|
-
|
|
132
|
+
this.syncSelectedOptionsState();
|
|
133
|
+
if (this.multiple) {
|
|
134
|
+
// Sync selected options for multiple selection mode
|
|
135
|
+
this.selectedOptions = options.filter((option) => { var _a; return (_a = this.value) === null || _a === void 0 ? void 0 : _a.includes(option.value); });
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
// Sync display label for single selection mode
|
|
139
|
+
this.updateDisplayLabel();
|
|
140
|
+
}
|
|
141
|
+
internals.setFormValue(!isNil(value) ? `${value}` : undefined);
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* Syncs the selected state of the BqOption elements which value is included in the `value` property.
|
|
145
|
+
* Notice that value can be a string or an array of strings.
|
|
146
|
+
*
|
|
147
|
+
* @private
|
|
148
|
+
* @memberof BqSelect
|
|
149
|
+
*/
|
|
150
|
+
this.syncSelectedOptionsState = () => {
|
|
151
|
+
const { options, multiple, value } = this;
|
|
152
|
+
const lowerCaseValue = String(value).toLowerCase();
|
|
153
|
+
options.forEach((option) => {
|
|
154
|
+
if (multiple && Array.isArray(value)) {
|
|
155
|
+
option.selected = value.includes(option.value);
|
|
136
156
|
}
|
|
137
157
|
else {
|
|
138
|
-
option.selected = option.value.toLowerCase() ===
|
|
158
|
+
option.selected = option.value.toLowerCase() === lowerCaseValue;
|
|
139
159
|
}
|
|
140
160
|
});
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}
|
|
161
|
+
};
|
|
162
|
+
/**
|
|
163
|
+
* Updates the display value of the input element based on the selected option.
|
|
164
|
+
*
|
|
165
|
+
* @private
|
|
166
|
+
* @memberof BqSelect
|
|
167
|
+
*/
|
|
168
|
+
this.updateDisplayLabel = () => {
|
|
169
|
+
const { value, options, inputElem } = this;
|
|
170
|
+
const checkedItem = options.find((item) => item.value === value);
|
|
171
|
+
const displayValue = checkedItem ? this.getOptionLabel(checkedItem) : '';
|
|
172
|
+
inputElem.value = displayValue;
|
|
173
|
+
this.displayValue = displayValue;
|
|
150
174
|
};
|
|
151
175
|
this.getOptionLabel = (item) => {
|
|
152
|
-
|
|
153
|
-
if (!
|
|
176
|
+
var _a;
|
|
177
|
+
if (!item)
|
|
154
178
|
return;
|
|
155
|
-
return
|
|
179
|
+
return (_a = item.innerText.trim()) !== null && _a !== void 0 ? _a : '';
|
|
156
180
|
};
|
|
157
181
|
this.displayValue = undefined;
|
|
158
182
|
this.hasHelperText = false;
|
|
@@ -190,6 +214,7 @@ export class BqSelect {
|
|
|
190
214
|
if (this.multiple && isString(this.value)) {
|
|
191
215
|
// NOTE: we ensure that value is an array, changing the value will trigger Watch to execute thus the return
|
|
192
216
|
this.value = Array.from(JSON.parse(String(this.value)));
|
|
217
|
+
this.internals.setFormValue(this.value.join(','));
|
|
193
218
|
return;
|
|
194
219
|
}
|
|
195
220
|
this.syncItemsFromValue();
|
|
@@ -208,6 +233,16 @@ export class BqSelect {
|
|
|
208
233
|
}
|
|
209
234
|
this.handleValueChange();
|
|
210
235
|
}
|
|
236
|
+
formAssociatedCallback() {
|
|
237
|
+
this.internals.role = 'combobox';
|
|
238
|
+
this.internals.ariaExpanded = this.open ? 'true' : 'false';
|
|
239
|
+
}
|
|
240
|
+
async formResetCallback() {
|
|
241
|
+
if (isNil(this.value))
|
|
242
|
+
return;
|
|
243
|
+
this.internals.setValidity({});
|
|
244
|
+
this.clear();
|
|
245
|
+
}
|
|
211
246
|
// Listeners
|
|
212
247
|
// ==============
|
|
213
248
|
handleOpenChange(ev) {
|
|
@@ -236,14 +271,19 @@ export class BqSelect {
|
|
|
236
271
|
async clear() {
|
|
237
272
|
if (this.disabled)
|
|
238
273
|
return;
|
|
274
|
+
const { multiple, inputElem, bqClear, el } = this;
|
|
275
|
+
// Clear value and selected options
|
|
239
276
|
this.value = undefined;
|
|
240
277
|
this.selectedOptions = [];
|
|
241
|
-
if
|
|
278
|
+
// Clear display value and input element if not multiple
|
|
279
|
+
if (!multiple) {
|
|
242
280
|
this.displayValue = undefined;
|
|
243
|
-
|
|
281
|
+
inputElem.value = undefined;
|
|
244
282
|
}
|
|
283
|
+
// Update form value and reset options visibility
|
|
245
284
|
this.resetOptionsVisibility();
|
|
246
|
-
|
|
285
|
+
// Emit clear event
|
|
286
|
+
bqClear.emit(el);
|
|
247
287
|
}
|
|
248
288
|
get options() {
|
|
249
289
|
return Array.from(this.el.querySelectorAll('bq-option'));
|
|
@@ -283,23 +323,24 @@ export class BqSelect {
|
|
|
283
323
|
// ===================================
|
|
284
324
|
render() {
|
|
285
325
|
const labelId = `bq-select__label-${this.name || this.fallbackInputId}`;
|
|
286
|
-
return (h("div", { key: '
|
|
326
|
+
return (h("div", { key: 'b0822a6c3f418c4baadbdd0fffe0678c85d4a858', class: "bq-select", part: "base" }, h("label", { key: '1cdf1bbf83b43cc794b08ba4fe175317cd562930', id: labelId, class: { 'bq-select__label': true, '!hidden': !this.hasLabel }, htmlFor: this.name || this.fallbackInputId, ref: (labelElem) => (this.labelElem = labelElem), part: "label" }, h("slot", { key: '98b253b36c68a4ab56f269959f50f0539ddaf9b3', name: "label", onSlotchange: this.handleLabelSlotChange })), h("bq-dropdown", { key: 'b614f2d5b71c6d1b246c19b716cebca8a5776c63', class: "bq-select__dropdown w-full", disabled: this.disabled, distance: this.distance, keepOpenOnSelect: this.keepOpenOnSelect, open: this.open, panelHeight: this.panelHeight, placement: this.placement, sameWidth: this.sameWidth, skidding: this.skidding, strategy: this.strategy, exportparts: "panel" }, h("div", { key: 'c0f4ea4d05b2411ebe95f32393702e1b566203c4', class: {
|
|
287
327
|
'bq-select__control': true,
|
|
288
328
|
[`validation-${this.validationStatus}`]: true,
|
|
289
329
|
disabled: this.disabled,
|
|
290
|
-
}, part: "control", slot: "trigger" }, h("span", { key: '
|
|
330
|
+
}, part: "control", slot: "trigger" }, h("span", { key: 'e87b700d7682189ae49c28ce5f0341ca32944827', class: { 'bq-select__control--prefix': true, '!hidden': !this.hasPrefix }, ref: (spanElem) => (this.prefixElem = spanElem), part: "prefix" }, h("slot", { key: 'b2117317d53f0fd3c62880fb73f47d8a0032bd0e', name: "prefix", onSlotchange: this.handlePrefixSlotChange })), h("div", { key: '22c024d6ab811d60930217b4e0f0397f47f4af4e', class: "flex flex-1 overflow-x-auto", part: "input-outline" }, this.multiple && (h("span", { key: '230c6552acbcb80cd15dc2b712da9b48b4fb0a87', class: "bq-select__tags", part: "tags" }, h("slot", { key: 'd466eb5a20ef181e6c7671a9c4f177d6e2e3bd30', name: "tags" }, this.displayTags))), h("input", { key: 'f7b1dd41dfa8a87cbc5747fd9b3f8d965c1702c9', id: this.name || this.fallbackInputId, class: "bq-select__control--input flex-grow is-full", autoComplete: "off", autoCapitalize: "off", autoFocus: this.autofocus, "aria-disabled": this.disabled ? 'true' : 'false', "aria-controls": `bq-options-${this.name}`, "aria-expanded": this.open ? 'true' : 'false', "aria-haspopup": "listbox", disabled: this.disabled, form: this.form, name: this.name, placeholder: this.displayPlaceholder, ref: (inputElem) => (this.inputElem = inputElem), readOnly: this.readonly, required: this.required, role: "combobox", spellcheck: false, type: "text", value: this.displayValue, part: "input",
|
|
291
331
|
// Events
|
|
292
332
|
onBlur: this.handleBlur, onFocus: this.handleFocus, onInput: this.handleSearchFilter })), this.hasClearIcon && (
|
|
293
333
|
// The clear button will be visible as long as the input has a value
|
|
294
334
|
// and the parent group is hovered or has focus-within
|
|
295
|
-
h("bq-button", { key: '
|
|
335
|
+
h("bq-button", { key: 'a414e48a85ecb319fbd2dfa92303d56139281947', class: "bq-select__control--clear ms-[--bq-select--gap]", appearance: "text", "aria-label": this.clearButtonLabel, size: "small", onBqClick: this.handleClearClick, part: "clear-btn", exportparts: "button", tabIndex: -1 }, h("slot", { key: 'adb12a220b55c1b0b772f1309b0dfcf1f3543879', name: "clear-icon" }, h("bq-icon", { key: '9f4c77e3f7547b39f7015a34d99f44acae1ff552', name: "x-circle", class: "flex" })))), h("span", { key: '57f5b28c0cdb54098c683b437a9e9b18df122d99', class: { 'bq-select__control--suffix': true, 'rotate-180': this.open, 'rotate-0': !this.open }, ref: (spanElem) => (this.suffixElem = spanElem), part: "suffix" }, h("slot", { key: 'a897f738544a13d4283232d7e6601210477884fa', name: "suffix", onSlotchange: this.handleSuffixSlotChange }, h("bq-icon", { key: '4d92c46edda852f4290f4d26294a4d396e3359c8', name: "caret-down", class: "flex" })))), h("bq-option-list", { key: 'e1d33bd852ccddb2b11871a8a589bfd7424659ca', id: `bq-options-${this.name}`, onBqSelect: this.handleSelect, "aria-expanded": this.open ? 'true' : 'false', exportparts: "base:option-list", role: "listbox" }, h("slot", { key: 'efc2746ae6ed636498a93f02852c2b5f9b6810ed' }))), h("div", { key: '7af06c40296fb14b27d53f903a84acb879a0c48c', class: {
|
|
296
336
|
[`bq-select__helper-text validation-${this.validationStatus}`]: true,
|
|
297
337
|
'!hidden': !this.hasHelperText,
|
|
298
|
-
}, ref: (divElem) => (this.helperTextElem = divElem), part: "helper-text" }, h("slot", { key: '
|
|
338
|
+
}, ref: (divElem) => (this.helperTextElem = divElem), part: "helper-text" }, h("slot", { key: '82a339ec99ea0d9fbc991644f609e93fddf0aed1', name: "helper-text", onSlotchange: this.handleHelperTextSlotChange }))));
|
|
299
339
|
}
|
|
300
340
|
static get is() { return "bq-select"; }
|
|
301
341
|
static get encapsulation() { return "shadow"; }
|
|
302
342
|
static get delegatesFocus() { return true; }
|
|
343
|
+
static get formAssociated() { return true; }
|
|
303
344
|
static get originalStyleUrls() {
|
|
304
345
|
return {
|
|
305
346
|
"$": ["./scss/bq-select.scss"]
|
|
@@ -707,7 +748,7 @@ export class BqSelect {
|
|
|
707
748
|
"references": {
|
|
708
749
|
"TSelectValue": {
|
|
709
750
|
"location": "local",
|
|
710
|
-
"path": "/home/
|
|
751
|
+
"path": "/home/workflows/workspace/packages/beeq/src/components/select/bq-select.tsx",
|
|
711
752
|
"id": "../../packages/beeq/src/components/select/bq-select.tsx::TSelectValue"
|
|
712
753
|
}
|
|
713
754
|
}
|
|
@@ -872,5 +913,6 @@ export class BqSelect {
|
|
|
872
913
|
"passive": false
|
|
873
914
|
}];
|
|
874
915
|
}
|
|
916
|
+
static get attachInternalsMemberName() { return "internals"; }
|
|
875
917
|
}
|
|
876
918
|
//# sourceMappingURL=bq-select.js.map
|