@zanichelli/albe-web-components 2.31.0 → 2.31.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/CHANGELOG.md +1161 -1159
- package/LICENSE +21 -21
- package/dist/cjs/{breakpoints-776c8868.js → breakpoints-88c4fd6c.js} +1 -1
- package/dist/cjs/{index-8f7af00e.js → index-8f4b351d.js} +248 -248
- package/dist/cjs/index.cjs.js +5 -5
- package/dist/cjs/{utils-98538463.js → utils-6d6841cc.js} +63 -63
- package/dist/cjs/z-alert_66.cjs.entry.js +3359 -3321
- package/dist/cjs/z-app-header.cjs.entry.js +133 -133
- package/dist/cjs/z-candybar.cjs.entry.js +8 -8
- package/dist/cjs/z-cookiebar.cjs.entry.js +31 -31
- package/dist/cjs/z-heading.cjs.entry.js +8 -8
- package/dist/cjs/z-messages-pocket.cjs.entry.js +36 -36
- package/dist/cjs/z-modal-login.cjs.entry.js +71 -71
- package/dist/cjs/z-myz-card-dictionary.cjs.entry.js +25 -25
- package/dist/cjs/z-myz-card-footer-sections.cjs.entry.js +8 -8
- package/dist/cjs/z-myz-card-info.cjs.entry.js +109 -109
- package/dist/cjs/z-myz-topbar.cjs.entry.js +183 -183
- package/dist/cjs/z-navigation-tab.cjs.entry.js +34 -34
- package/dist/cjs/z-navigation-tabs.cjs.entry.js +90 -90
- package/dist/cjs/z-otp.cjs.entry.js +30 -30
- package/dist/cjs/z-pocket-message.cjs.entry.js +8 -8
- package/dist/cjs/z-pocket_3.cjs.entry.js +102 -102
- package/dist/cjs/z-registro-table-footer.cjs.entry.js +12 -12
- package/dist/cjs/z-slideshow.cjs.entry.js +101 -101
- package/dist/cjs/z-toast-notification-list.cjs.entry.js +45 -45
- package/dist/cjs/z-toast-notification.cjs.entry.js +190 -190
- package/dist/collection/beans/index.js +249 -249
- package/dist/collection/components/buttons/z-button/index.js +219 -219
- package/dist/collection/components/buttons/z-button/styles.css +231 -231
- package/dist/collection/components/buttons/z-button-filter/index.js +155 -155
- package/dist/collection/components/buttons/z-button-filter/styles.css +74 -74
- package/dist/collection/components/buttons/z-button-sort/index.js +216 -216
- package/dist/collection/components/buttons/z-button-sort/styles.css +101 -101
- package/dist/collection/components/buttons/z-chip/index.js +59 -59
- package/dist/collection/components/buttons/z-chip/styles.css +17 -17
- package/dist/collection/components/buttons/z-toggle-button/index.js +122 -122
- package/dist/collection/components/buttons/z-toggle-button/styles.css +62 -62
- package/dist/collection/components/footer/z-footer/index.js +286 -286
- package/dist/collection/components/footer/z-footer/styles.css +241 -241
- package/dist/collection/components/footer/z-footer-link/index.js +37 -37
- package/dist/collection/components/footer/z-footer-link/styles.css +33 -33
- package/dist/collection/components/footer/z-footer-section/index.js +51 -51
- package/dist/collection/components/footer/z-footer-section/styles.css +163 -163
- package/dist/collection/components/footer/z-footer-social/index.js +68 -68
- package/dist/collection/components/footer/z-footer-social/styles.css +23 -23
- package/dist/collection/components/icons/icons.js +473 -435
- package/dist/collection/components/icons/z-icon/index.js +110 -110
- package/dist/collection/components/icons/z-icon/styles.css +14 -14
- package/dist/collection/components/icons/z-icon-package/index.js +20 -20
- package/dist/collection/components/icons/z-icon-package/styles.css +16 -16
- package/dist/collection/components/indicators/z-stepper/index.js +17 -17
- package/dist/collection/components/indicators/z-stepper/styles.css +19 -19
- package/dist/collection/components/indicators/z-stepper-item/index.js +93 -93
- package/dist/collection/components/indicators/z-stepper-item/styles.css +115 -115
- package/dist/collection/components/inputs/z-combobox/index.js +480 -480
- package/dist/collection/components/inputs/z-combobox/styles.css +148 -148
- package/dist/collection/components/inputs/z-input/index.js +821 -821
- package/dist/collection/components/inputs/z-input/styles.css +304 -304
- package/dist/collection/components/inputs/z-input-label/index.js +72 -72
- package/dist/collection/components/inputs/z-input-label/styles.css +16 -16
- package/dist/collection/components/inputs/z-input-message/index.js +64 -64
- package/dist/collection/components/inputs/z-input-message/styles.css +33 -33
- package/dist/collection/components/inputs/z-select/index.js +647 -647
- package/dist/collection/components/inputs/z-select/styles.css +131 -131
- package/dist/collection/components/list/z-list/index.js +57 -57
- package/dist/collection/components/list/z-list/styles.css +7 -7
- package/dist/collection/components/list/z-list-element/index.js +439 -439
- package/dist/collection/components/list/z-list-element/styles.css +133 -133
- package/dist/collection/components/list/z-list-group/index.js +144 -144
- package/dist/collection/components/list/z-list-group/styles.css +22 -22
- package/dist/collection/components/list/z-toast-notification-list/index.js +97 -97
- package/dist/collection/components/list/z-toast-notification-list/styles.css +107 -107
- package/dist/collection/components/logo/z-logo/index.js +128 -128
- package/dist/collection/components/logo/z-logo/styles.css +28 -28
- package/dist/collection/components/modal/z-modal/index.js +160 -160
- package/dist/collection/components/modal/z-modal/styles.css +185 -185
- package/dist/collection/components/modal/z-modal-login/index.js +272 -272
- package/dist/collection/components/modal/z-modal-login/styles.css +159 -159
- package/dist/collection/components/navigation/z-app-header/index.js +267 -267
- package/dist/collection/components/navigation/z-app-header/styles.css +445 -445
- package/dist/collection/components/navigation/z-app-switcher/index.js +70 -70
- package/dist/collection/components/navigation/z-app-switcher/styles.css +35 -35
- package/dist/collection/components/navigation/z-app-topbar/index.js +156 -156
- package/dist/collection/components/navigation/z-app-topbar/styles.css +71 -71
- package/dist/collection/components/navigation/z-link/index.js +309 -309
- package/dist/collection/components/navigation/z-link/styles.css +160 -160
- package/dist/collection/components/navigation/z-menu/index.js +223 -223
- package/dist/collection/components/navigation/z-menu/styles.css +149 -149
- package/dist/collection/components/navigation/z-menu-dropdown/index.js +125 -125
- package/dist/collection/components/navigation/z-menu-dropdown/styles.css +146 -146
- package/dist/collection/components/navigation/z-menu-section/index.js +109 -109
- package/dist/collection/components/navigation/z-menu-section/styles.css +91 -91
- package/dist/collection/components/navigation/z-navigation-tab/index.js +151 -151
- package/dist/collection/components/navigation/z-navigation-tab/styles.css +113 -113
- package/dist/collection/components/navigation/z-navigation-tabs/index.js +179 -179
- package/dist/collection/components/navigation/z-navigation-tabs/styles.css +117 -117
- package/dist/collection/components/navigation/z-user-dropdown/index.js +252 -252
- package/dist/collection/components/navigation/z-user-dropdown/styles.css +315 -315
- package/dist/collection/components/notification/z-candybar/index.js +18 -18
- package/dist/collection/components/notification/z-candybar/styles.css +61 -61
- package/dist/collection/components/notification/z-cookiebar/index.js +111 -111
- package/dist/collection/components/notification/z-cookiebar/styles.css +109 -109
- package/dist/collection/components/notification/z-info-box/index.js +79 -79
- package/dist/collection/components/notification/z-info-box/styles.css +23 -23
- package/dist/collection/components/notification/z-notification/index.js +171 -171
- package/dist/collection/components/notification/z-notification/styles.css +93 -93
- package/dist/collection/components/notification/z-toast-notification/index.js +402 -402
- package/dist/collection/components/notification/z-toast-notification/styles.css +247 -247
- package/dist/collection/components/notification/z-tooltip/index.js +379 -379
- package/dist/collection/components/notification/z-tooltip/styles.css +128 -128
- package/dist/collection/components/pagination/z-pagination-bar/index.js +278 -278
- package/dist/collection/components/pagination/z-pagination-bar/styles.css +23 -23
- package/dist/collection/components/pagination/z-pagination-page/index.js +129 -129
- package/dist/collection/components/pagination/z-pagination-page/styles.css +57 -57
- package/dist/collection/components/panel/z-panel-elem/index.js +193 -193
- package/dist/collection/components/panel/z-panel-elem/styles.css +39 -39
- package/dist/collection/components/typography/z-body/index.js +66 -66
- package/dist/collection/components/typography/z-heading/index.js +66 -66
- package/dist/collection/components/typography/z-typography/index.js +84 -84
- package/dist/collection/components/typography/z-typography/styles.css +61 -61
- package/dist/collection/components/z-avatar/index.js +137 -137
- package/dist/collection/components/z-avatar/styles.css +35 -35
- package/dist/collection/components/z-card/index.js +153 -153
- package/dist/collection/components/z-card/styles.css +188 -188
- package/dist/collection/components/z-contextual-menu/index.js +122 -122
- package/dist/collection/components/z-contextual-menu/styles.css +45 -45
- package/dist/collection/components/z-divider/index.js +89 -89
- package/dist/collection/components/z-divider/styles.css +37 -37
- package/dist/collection/components/z-ghost-loading/index.js +14 -14
- package/dist/collection/components/z-ghost-loading/styles.css +34 -34
- package/dist/collection/components/z-popover/index.js +274 -274
- package/dist/collection/components/z-popover/styles.css +236 -236
- package/dist/collection/components/z-status-tag/index.js +125 -125
- package/dist/collection/components/z-status-tag/styles.css +133 -133
- package/dist/collection/constants/breakpoints.js +3 -3
- package/dist/collection/constants/icons.js +6 -6
- package/dist/collection/index.js +5 -5
- package/dist/collection/snowflakes/myz/card/z-myz-card/index.js +119 -119
- package/dist/collection/snowflakes/myz/card/z-myz-card/styles.css +38 -38
- package/dist/collection/snowflakes/myz/card/z-myz-card-alert/index.js +148 -148
- package/dist/collection/snowflakes/myz/card/z-myz-card-alert/styles.css +62 -62
- package/dist/collection/snowflakes/myz/card/z-myz-card-body/index.js +20 -20
- package/dist/collection/snowflakes/myz/card/z-myz-card-body/styles.css +13 -13
- package/dist/collection/snowflakes/myz/card/z-myz-card-cover/index.js +87 -87
- package/dist/collection/snowflakes/myz/card/z-myz-card-cover/styles.css +11 -11
- package/dist/collection/snowflakes/myz/card/z-myz-card-dictionary/index.js +177 -177
- package/dist/collection/snowflakes/myz/card/z-myz-card-dictionary/styles.css +85 -85
- package/dist/collection/snowflakes/myz/card/z-myz-card-footer/index.js +190 -190
- package/dist/collection/snowflakes/myz/card/z-myz-card-footer/styles.css +137 -137
- package/dist/collection/snowflakes/myz/card/z-myz-card-footer-sections/index.js +23 -23
- package/dist/collection/snowflakes/myz/card/z-myz-card-footer-sections/styles.css +32 -32
- package/dist/collection/snowflakes/myz/card/z-myz-card-header/index.js +101 -101
- package/dist/collection/snowflakes/myz/card/z-myz-card-header/styles.css +46 -46
- package/dist/collection/snowflakes/myz/card/z-myz-card-icon/index.js +74 -74
- package/dist/collection/snowflakes/myz/card/z-myz-card-icon/styles.css +70 -70
- package/dist/collection/snowflakes/myz/card/z-myz-card-info/index.js +213 -213
- package/dist/collection/snowflakes/myz/card/z-myz-card-info/styles.css +124 -124
- package/dist/collection/snowflakes/myz/card/z-myz-card-list/index.js +53 -53
- package/dist/collection/snowflakes/myz/card/z-myz-card-list/styles.css +41 -41
- package/dist/collection/snowflakes/myz/list/z-myz-list/index.js +70 -70
- package/dist/collection/snowflakes/myz/list/z-myz-list/styles.css +4 -4
- package/dist/collection/snowflakes/myz/list/z-myz-list-item/index.js +188 -188
- package/dist/collection/snowflakes/myz/list/z-myz-list-item/styles.css +48 -48
- package/dist/collection/snowflakes/myz/pocket/z-messages-pocket/index.js +121 -121
- package/dist/collection/snowflakes/myz/pocket/z-messages-pocket/styles.css +106 -106
- package/dist/collection/snowflakes/myz/pocket/z-pocket/index.js +181 -181
- package/dist/collection/snowflakes/myz/pocket/z-pocket/styles.css +56 -56
- package/dist/collection/snowflakes/myz/pocket/z-pocket-body/index.js +77 -77
- package/dist/collection/snowflakes/myz/pocket/z-pocket-body/styles.css +49 -49
- package/dist/collection/snowflakes/myz/pocket/z-pocket-header/index.js +86 -86
- package/dist/collection/snowflakes/myz/pocket/z-pocket-header/styles.css +40 -40
- package/dist/collection/snowflakes/myz/pocket/z-pocket-message/index.js +23 -23
- package/dist/collection/snowflakes/myz/pocket/z-pocket-message/styles.css +53 -53
- package/dist/collection/snowflakes/myz/topbar/index.js +428 -428
- package/dist/collection/snowflakes/myz/topbar/styles.css +594 -594
- package/dist/collection/snowflakes/myz/z-alert/index.js +42 -42
- package/dist/collection/snowflakes/myz/z-alert/styles.css +28 -28
- package/dist/collection/snowflakes/myz/z-otp/index.js +114 -114
- package/dist/collection/snowflakes/myz/z-otp/styles.css +47 -47
- package/dist/collection/snowflakes/myz/z-slideshow/index.js +165 -165
- package/dist/collection/snowflakes/myz/z-slideshow/styles.css +128 -128
- package/dist/collection/snowflakes/registro-table/z-registro-table/index.js +365 -365
- package/dist/collection/snowflakes/registro-table/z-registro-table/styles.css +166 -166
- package/dist/collection/snowflakes/registro-table/z-registro-table-body/index.js +19 -19
- package/dist/collection/snowflakes/registro-table/z-registro-table-body/styles.css +9 -9
- package/dist/collection/snowflakes/registro-table/z-registro-table-cell/index.js +58 -58
- package/dist/collection/snowflakes/registro-table/z-registro-table-cell/styles.css +39 -39
- package/dist/collection/snowflakes/registro-table/z-registro-table-empty-box/index.js +69 -69
- package/dist/collection/snowflakes/registro-table/z-registro-table-empty-box/styles.css +24 -24
- package/dist/collection/snowflakes/registro-table/z-registro-table-expanded-row/index.js +36 -36
- package/dist/collection/snowflakes/registro-table/z-registro-table-expanded-row/styles.css +16 -16
- package/dist/collection/snowflakes/registro-table/z-registro-table-footer/index.js +18 -18
- package/dist/collection/snowflakes/registro-table/z-registro-table-footer/styles.css +5 -5
- package/dist/collection/snowflakes/registro-table/z-registro-table-head/index.js +18 -18
- package/dist/collection/snowflakes/registro-table/z-registro-table-head/styles.css +5 -5
- package/dist/collection/snowflakes/registro-table/z-registro-table-header/index.js +240 -240
- package/dist/collection/snowflakes/registro-table/z-registro-table-header/styles.css +67 -67
- package/dist/collection/snowflakes/registro-table/z-registro-table-header-row/index.js +37 -37
- package/dist/collection/snowflakes/registro-table/z-registro-table-header-row/styles.css +13 -13
- package/dist/collection/snowflakes/registro-table/z-registro-table-row/index.js +86 -86
- package/dist/collection/snowflakes/registro-table/z-registro-table-row/styles.css +54 -54
- package/dist/collection/snowflakes/registro-table/z-registro-table-sticky-footer/index.js +17 -17
- package/dist/collection/snowflakes/registro-table/z-registro-table-sticky-footer/styles.css +10 -10
- package/dist/collection/themes/index.story.js +18 -18
- package/dist/collection/utils/utils.js +82 -82
- package/dist/esm/{breakpoints-14432d05.js → breakpoints-c386984e.js} +1 -1
- package/dist/esm/{index-e9a16abc.js → index-0258069c.js} +248 -248
- package/dist/esm/index.js +5 -5
- package/dist/esm/polyfills/core-js.js +0 -0
- package/dist/esm/polyfills/dom.js +0 -0
- package/dist/esm/polyfills/es5-html-element.js +0 -0
- package/dist/esm/polyfills/index.js +0 -0
- package/dist/esm/polyfills/system.js +0 -0
- package/dist/esm/{utils-84f318dc.js → utils-0345e333.js} +63 -63
- package/dist/esm/z-alert_66.entry.js +3359 -3321
- package/dist/esm/z-app-header.entry.js +133 -133
- package/dist/esm/z-candybar.entry.js +8 -8
- package/dist/esm/z-cookiebar.entry.js +31 -31
- package/dist/esm/z-heading.entry.js +8 -8
- package/dist/esm/z-messages-pocket.entry.js +36 -36
- package/dist/esm/z-modal-login.entry.js +71 -71
- package/dist/esm/z-myz-card-dictionary.entry.js +25 -25
- package/dist/esm/z-myz-card-footer-sections.entry.js +8 -8
- package/dist/esm/z-myz-card-info.entry.js +109 -109
- package/dist/esm/z-myz-topbar.entry.js +183 -183
- package/dist/esm/z-navigation-tab.entry.js +34 -34
- package/dist/esm/z-navigation-tabs.entry.js +90 -90
- package/dist/esm/z-otp.entry.js +30 -30
- package/dist/esm/z-pocket-message.entry.js +8 -8
- package/dist/esm/z-pocket_3.entry.js +102 -102
- package/dist/esm/z-registro-table-footer.entry.js +12 -12
- package/dist/esm/z-slideshow.entry.js +101 -101
- package/dist/esm/z-toast-notification-list.entry.js +45 -45
- package/dist/esm/z-toast-notification.entry.js +190 -190
- package/dist/types/beans/index.d.ts +334 -334
- package/dist/types/components/buttons/z-button/index.d.ts +29 -29
- package/dist/types/components/buttons/z-button-filter/index.d.ts +22 -22
- package/dist/types/components/buttons/z-button-sort/index.d.ts +28 -28
- package/dist/types/components/buttons/z-chip/index.d.ts +6 -6
- package/dist/types/components/buttons/z-toggle-button/index.d.ts +16 -16
- package/dist/types/components/footer/z-footer/index.d.ts +46 -46
- package/dist/types/components/footer/z-footer-link/index.d.ts +8 -8
- package/dist/types/components/footer/z-footer-section/index.d.ts +10 -10
- package/dist/types/components/footer/z-footer-social/index.d.ts +9 -9
- package/dist/types/components/icons/icons.d.ts +443 -405
- package/dist/types/components/icons/z-icon/index.d.ts +14 -14
- package/dist/types/components/icons/z-icon-package/index.d.ts +3 -3
- package/dist/types/components/indicators/z-stepper/index.d.ts +6 -6
- package/dist/types/components/indicators/z-stepper-item/index.d.ts +19 -19
- package/dist/types/components/inputs/z-combobox/index.d.ts +62 -62
- package/dist/types/components/inputs/z-input/index.d.ts +102 -102
- package/dist/types/components/inputs/z-input-label/index.d.ts +9 -9
- package/dist/types/components/inputs/z-input-message/index.d.ts +9 -9
- package/dist/types/components/inputs/z-select/index.d.ts +73 -73
- package/dist/types/components/list/z-list/index.d.ts +11 -11
- package/dist/types/components/list/z-list-element/index.d.ts +79 -79
- package/dist/types/components/list/z-list-group/index.d.ts +24 -24
- package/dist/types/components/list/z-toast-notification-list/index.d.ts +14 -14
- package/dist/types/components/logo/z-logo/index.d.ts +15 -15
- package/dist/types/components/modal/z-modal/index.d.ts +25 -25
- package/dist/types/components/modal/z-modal-login/index.d.ts +42 -42
- package/dist/types/components/navigation/z-app-header/index.d.ts +67 -67
- package/dist/types/components/navigation/z-app-switcher/index.d.ts +12 -12
- package/dist/types/components/navigation/z-app-topbar/index.d.ts +20 -20
- package/dist/types/components/navigation/z-link/index.d.ts +41 -41
- package/dist/types/components/navigation/z-menu/index.d.ts +52 -52
- package/dist/types/components/navigation/z-menu-dropdown/index.d.ts +19 -19
- package/dist/types/components/navigation/z-menu-section/index.d.ts +24 -24
- package/dist/types/components/navigation/z-navigation-tab/index.d.ts +16 -16
- package/dist/types/components/navigation/z-navigation-tabs/index.d.ts +32 -32
- package/dist/types/components/navigation/z-user-dropdown/index.d.ts +39 -39
- package/dist/types/components/notification/z-candybar/index.d.ts +6 -6
- package/dist/types/components/notification/z-cookiebar/index.d.ts +16 -16
- package/dist/types/components/notification/z-info-box/index.d.ts +14 -14
- package/dist/types/components/notification/z-notification/index.d.ts +24 -24
- package/dist/types/components/notification/z-toast-notification/index.d.ts +56 -56
- package/dist/types/components/notification/z-tooltip/index.d.ts +41 -41
- package/dist/types/components/pagination/z-pagination-bar/index.d.ts +42 -42
- package/dist/types/components/pagination/z-pagination-page/index.d.ts +15 -15
- package/dist/types/components/panel/z-panel-elem/index.d.ts +25 -25
- package/dist/types/components/typography/z-body/index.d.ts +6 -6
- package/dist/types/components/typography/z-heading/index.d.ts +6 -6
- package/dist/types/components/typography/z-typography/index.d.ts +8 -8
- package/dist/types/components/z-avatar/index.d.ts +16 -16
- package/dist/types/components/z-card/index.d.ts +29 -29
- package/dist/types/components/z-contextual-menu/index.d.ts +22 -22
- package/dist/types/components/z-divider/index.d.ts +10 -10
- package/dist/types/components/z-ghost-loading/index.d.ts +3 -3
- package/dist/types/components/z-popover/index.d.ts +29 -29
- package/dist/types/components/z-status-tag/index.d.ts +15 -15
- package/dist/types/constants/breakpoints.d.ts +3 -3
- package/dist/types/constants/icons.d.ts +6 -6
- package/dist/types/index.d.ts +5 -5
- package/dist/types/snowflakes/myz/card/z-myz-card/index.d.ts +16 -16
- package/dist/types/snowflakes/myz/card/z-myz-card-alert/index.d.ts +20 -20
- package/dist/types/snowflakes/myz/card/z-myz-card-body/index.d.ts +7 -7
- package/dist/types/snowflakes/myz/card/z-myz-card-cover/index.d.ts +12 -12
- package/dist/types/snowflakes/myz/card/z-myz-card-dictionary/index.d.ts +24 -24
- package/dist/types/snowflakes/myz/card/z-myz-card-footer/index.d.ts +34 -34
- package/dist/types/snowflakes/myz/card/z-myz-card-footer-sections/index.d.ts +7 -7
- package/dist/types/snowflakes/myz/card/z-myz-card-header/index.d.ts +23 -23
- package/dist/types/snowflakes/myz/card/z-myz-card-icon/index.d.ts +9 -9
- package/dist/types/snowflakes/myz/card/z-myz-card-info/index.d.ts +36 -36
- package/dist/types/snowflakes/myz/card/z-myz-card-list/index.d.ts +10 -10
- package/dist/types/snowflakes/myz/list/z-myz-list/index.d.ts +11 -11
- package/dist/types/snowflakes/myz/list/z-myz-list-item/index.d.ts +25 -25
- package/dist/types/snowflakes/myz/pocket/z-messages-pocket/index.d.ts +16 -16
- package/dist/types/snowflakes/myz/pocket/z-pocket/index.d.ts +25 -25
- package/dist/types/snowflakes/myz/pocket/z-pocket-body/index.d.ts +12 -12
- package/dist/types/snowflakes/myz/pocket/z-pocket-header/index.d.ts +18 -18
- package/dist/types/snowflakes/myz/pocket/z-pocket-message/index.d.ts +7 -7
- package/dist/types/snowflakes/myz/topbar/index.d.ts +61 -61
- package/dist/types/snowflakes/myz/z-alert/index.d.ts +9 -9
- package/dist/types/snowflakes/myz/z-otp/index.d.ts +13 -13
- package/dist/types/snowflakes/myz/z-slideshow/index.d.ts +30 -30
- package/dist/types/snowflakes/registro-table/z-registro-table/index.d.ts +48 -48
- package/dist/types/snowflakes/registro-table/z-registro-table-body/index.d.ts +5 -5
- package/dist/types/snowflakes/registro-table/z-registro-table-cell/index.d.ts +9 -9
- package/dist/types/snowflakes/registro-table/z-registro-table-empty-box/index.d.ts +12 -12
- package/dist/types/snowflakes/registro-table/z-registro-table-expanded-row/index.d.ts +5 -5
- package/dist/types/snowflakes/registro-table/z-registro-table-footer/index.d.ts +5 -5
- package/dist/types/snowflakes/registro-table/z-registro-table-head/index.d.ts +5 -5
- package/dist/types/snowflakes/registro-table/z-registro-table-header/index.d.ts +27 -27
- package/dist/types/snowflakes/registro-table/z-registro-table-header-row/index.d.ts +5 -5
- package/dist/types/snowflakes/registro-table/z-registro-table-row/index.d.ts +11 -11
- package/dist/types/snowflakes/registro-table/z-registro-table-sticky-footer/index.d.ts +6 -6
- package/dist/types/utils/utils.d.ts +11 -11
- package/dist/web-components-library/index.esm.js +1 -1
- package/dist/web-components-library/{p-fc133dd1.entry.js → p-02e55441.entry.js} +1 -1
- package/{www/build/p-35b2df47.entry.js → dist/web-components-library/p-1442c0b2.entry.js} +1 -1
- package/dist/web-components-library/{p-609908af.entry.js → p-18f6f866.entry.js} +1 -1
- package/dist/web-components-library/{p-aa7c40c3.entry.js → p-231e7797.entry.js} +1 -1
- package/dist/web-components-library/{p-8c6cba93.entry.js → p-2f354863.entry.js} +1 -1
- package/dist/web-components-library/{p-21ffb0b5.entry.js → p-35b1f338.entry.js} +1 -1
- package/dist/web-components-library/{p-91f5e2f8.entry.js → p-3cdefa38.entry.js} +1 -1
- package/dist/web-components-library/{p-a75b3177.entry.js → p-4a6ec3df.entry.js} +1 -1
- package/dist/web-components-library/{p-a54ab38c.entry.js → p-5cdcaa8c.entry.js} +1 -1
- package/dist/web-components-library/{p-e8b36609.entry.js → p-b80081c9.entry.js} +1 -1
- package/dist/web-components-library/{p-d3279fd6.entry.js → p-d4830f32.entry.js} +1 -1
- package/dist/web-components-library/{p-acdb443b.js → p-d63b9ed3.js} +0 -0
- package/dist/web-components-library/{p-e35d3552.js → p-d69e14fb.js} +0 -0
- package/dist/web-components-library/{p-f53af59a.js → p-e7304c42.js} +1 -1
- package/dist/web-components-library/p-f43d8b59.entry.js +7 -0
- package/{www/build/p-cdb9067a.entry.js → dist/web-components-library/p-f83347fd.entry.js} +1 -1
- package/dist/web-components-library/{p-45940723.entry.js → p-ff6b02d1.entry.js} +1 -1
- package/dist/web-components-library/web-components-library.css +1 -1
- package/dist/web-components-library/web-components-library.esm.js +1 -1
- package/package.json +90 -90
- package/react/components.d.ts +89 -89
- package/react/components.js +95 -95
- package/react/index.d.ts +1 -1
- package/react/index.js +13 -13
- package/react/react-component-lib/createComponent.d.ts +10 -10
- package/react/react-component-lib/createComponent.js +65 -65
- package/react/react-component-lib/createOverlayComponent.d.ts +20 -20
- package/react/react-component-lib/createOverlayComponent.js +95 -95
- package/react/react-component-lib/index.d.ts +2 -2
- package/react/react-component-lib/index.js +7 -7
- package/react/react-component-lib/interfaces.d.ts +29 -29
- package/react/react-component-lib/interfaces.js +2 -2
- package/react/react-component-lib/utils/attachProps.d.ts +12 -12
- package/react/react-component-lib/utils/attachProps.js +102 -102
- package/react/react-component-lib/utils/case.d.ts +2 -2
- package/react/react-component-lib/utils/case.js +11 -11
- package/react/react-component-lib/utils/dev.d.ts +2 -2
- package/react/react-component-lib/utils/dev.js +17 -17
- package/react/react-component-lib/utils/index.d.ts +7 -7
- package/react/react-component-lib/utils/index.js +38 -38
- package/readme.md +236 -236
- package/src-react/index.ts +1 -0
- package/www/build/index.esm.js +1 -1
- package/www/build/{p-fc133dd1.entry.js → p-02e55441.entry.js} +1 -1
- package/{dist/web-components-library/p-35b2df47.entry.js → www/build/p-1442c0b2.entry.js} +1 -1
- package/www/build/{p-609908af.entry.js → p-18f6f866.entry.js} +1 -1
- package/www/build/{p-aa7c40c3.entry.js → p-231e7797.entry.js} +1 -1
- package/www/build/{p-8c6cba93.entry.js → p-2f354863.entry.js} +1 -1
- package/www/build/{p-21ffb0b5.entry.js → p-35b1f338.entry.js} +1 -1
- package/www/build/{p-91f5e2f8.entry.js → p-3cdefa38.entry.js} +1 -1
- package/www/build/{p-a75b3177.entry.js → p-4a6ec3df.entry.js} +1 -1
- package/www/build/{p-a54ab38c.entry.js → p-5cdcaa8c.entry.js} +1 -1
- package/www/build/p-6ba3b440.css +792 -0
- package/www/build/{p-e8b36609.entry.js → p-b80081c9.entry.js} +1 -1
- package/www/build/{p-d3279fd6.entry.js → p-d4830f32.entry.js} +1 -1
- package/www/build/{p-acdb443b.js → p-d63b9ed3.js} +0 -0
- package/www/build/{p-e35d3552.js → p-d69e14fb.js} +0 -0
- package/www/build/{p-f53af59a.js → p-e7304c42.js} +1 -1
- package/www/build/p-f43d8b59.entry.js +7 -0
- package/{dist/web-components-library/p-cdb9067a.entry.js → www/build/p-f83347fd.entry.js} +1 -1
- package/www/build/p-f9b40a11.js +122 -0
- package/www/build/{p-45940723.entry.js → p-ff6b02d1.entry.js} +1 -1
- package/www/build/web-components-library.css +1 -1
- package/www/build/web-components-library.esm.js +1 -1
- package/www/index.html +1 -1
- package/www/pages/notification.html +244 -244
- package/dist/web-components-library/p-8afd98e0.entry.js +0 -7
- package/www/build/p-2e3d31b3.js +0 -1
- package/www/build/p-8afd98e0.entry.js +0 -7
- package/www/build/p-ea943cbd.css +0 -1
|
@@ -1,647 +1,647 @@
|
|
|
1
|
-
import { Component, Prop, State, h, Event, Watch, Element, Method, } from "@stencil/core";
|
|
2
|
-
import { keybordKeyCodeEnum, InputStatusEnum, } from "../../../beans";
|
|
3
|
-
import { randomId, handleKeyboardSubmit, getClickedElement, getElementTree, } from "../../../utils/utils";
|
|
4
|
-
export class ZSelect {
|
|
5
|
-
constructor() {
|
|
6
|
-
/** the id of the input element */
|
|
7
|
-
this.htmlid = `id-${randomId()}`;
|
|
8
|
-
/** the input is disabled */
|
|
9
|
-
this.disabled = false;
|
|
10
|
-
/** the input is readonly */
|
|
11
|
-
this.readonly = false;
|
|
12
|
-
/** show input helper message (optional): available for text, password, number, email, textarea, select */
|
|
13
|
-
this.hasmessage = true;
|
|
14
|
-
/** the input has autocomplete option */
|
|
15
|
-
this.autocomplete = false;
|
|
16
|
-
/** multiple options can be selected */
|
|
17
|
-
this.multiple = false;
|
|
18
|
-
/** no result text message */
|
|
19
|
-
this.noresultslabel = "Nessun risultato";
|
|
20
|
-
this.isOpen = false;
|
|
21
|
-
this.itemsList = [];
|
|
22
|
-
this.toggleSelectUl = this.toggleSelectUl.bind(this);
|
|
23
|
-
this.selectItem = this.selectItem.bind(this);
|
|
24
|
-
this.handleSelectFocus = this.handleSelectFocus.bind(this);
|
|
25
|
-
}
|
|
26
|
-
watchItems() {
|
|
27
|
-
this.itemsList = this.getInitialItemsArray();
|
|
28
|
-
this.selectedItems = this.itemsList.filter((item) => item.selected);
|
|
29
|
-
}
|
|
30
|
-
/** get the input selected options */
|
|
31
|
-
async getSelectedItems() {
|
|
32
|
-
return this.selectedItems;
|
|
33
|
-
}
|
|
34
|
-
/** get the input value */
|
|
35
|
-
async getValue() {
|
|
36
|
-
return this.getSelectedValues();
|
|
37
|
-
}
|
|
38
|
-
/** set the input value */
|
|
39
|
-
async setValue(value) {
|
|
40
|
-
let values = [];
|
|
41
|
-
if (typeof value === "string") {
|
|
42
|
-
values.push(value);
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
values = value;
|
|
46
|
-
}
|
|
47
|
-
this.selectedItems = this.itemsList.filter((item) => values.includes(item.id));
|
|
48
|
-
}
|
|
49
|
-
emitOptionSelect() {
|
|
50
|
-
this.optionSelect.emit({
|
|
51
|
-
id: this.htmlid,
|
|
52
|
-
selected: this.getSelectedValues(),
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
componentWillLoad() {
|
|
56
|
-
this.watchItems();
|
|
57
|
-
}
|
|
58
|
-
componentWillRender() {
|
|
59
|
-
this.filterItems(this.searchString);
|
|
60
|
-
}
|
|
61
|
-
getInitialItemsArray() {
|
|
62
|
-
return typeof this.items === "string" ? JSON.parse(this.items) : this.items;
|
|
63
|
-
}
|
|
64
|
-
mapSelectedItemsToItemsArray() {
|
|
65
|
-
const initialItemsList = this.getInitialItemsArray();
|
|
66
|
-
return initialItemsList.map((item) => {
|
|
67
|
-
const found = this.selectedItems.find((selected) => selected.id === item.id);
|
|
68
|
-
item.selected = !!found;
|
|
69
|
-
return item;
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
getSelectedValues() {
|
|
73
|
-
if (this.multiple) {
|
|
74
|
-
return this.selectedItems.map((item) => item.id);
|
|
75
|
-
}
|
|
76
|
-
if (!this.multiple && this.selectedItems.length) {
|
|
77
|
-
return this.selectedItems[0].id;
|
|
78
|
-
}
|
|
79
|
-
return null;
|
|
80
|
-
}
|
|
81
|
-
filterItems(searchString) {
|
|
82
|
-
const prevList = this.mapSelectedItemsToItemsArray();
|
|
83
|
-
if (!(searchString === null || searchString === void 0 ? void 0 : searchString.length)) {
|
|
84
|
-
this.itemsList = prevList;
|
|
85
|
-
}
|
|
86
|
-
else {
|
|
87
|
-
this.itemsList = prevList
|
|
88
|
-
.filter((item) => {
|
|
89
|
-
return item.name.toUpperCase().includes(searchString.toUpperCase());
|
|
90
|
-
})
|
|
91
|
-
.map((item) => {
|
|
92
|
-
const start = item.name
|
|
93
|
-
.toUpperCase()
|
|
94
|
-
.indexOf(searchString.toUpperCase());
|
|
95
|
-
const end = start + searchString.length;
|
|
96
|
-
const newName = item.name.substring(0, start) +
|
|
97
|
-
item.name.substring(start, end).bold() +
|
|
98
|
-
item.name.substring(end, item.name.length);
|
|
99
|
-
item.name = newName;
|
|
100
|
-
return item;
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
hasAutcomplete() {
|
|
105
|
-
return (this.autocomplete === true ||
|
|
106
|
-
this.autocomplete === "true" ||
|
|
107
|
-
this.autocomplete === "on");
|
|
108
|
-
}
|
|
109
|
-
handleInputChange(e) {
|
|
110
|
-
this.searchString = e.detail.value;
|
|
111
|
-
if (!this.isOpen)
|
|
112
|
-
this.toggleSelectUl();
|
|
113
|
-
}
|
|
114
|
-
selectItem(item, selected) {
|
|
115
|
-
if (item && item.disabled)
|
|
116
|
-
return;
|
|
117
|
-
this.itemsList = this.mapSelectedItemsToItemsArray();
|
|
118
|
-
this.itemsList = this.itemsList.map((i) => {
|
|
119
|
-
if (!this.multiple)
|
|
120
|
-
i.selected = false;
|
|
121
|
-
if (i.id === (item ? item.id : null))
|
|
122
|
-
i.selected = selected;
|
|
123
|
-
return i;
|
|
124
|
-
});
|
|
125
|
-
this.selectedItems = this.itemsList.filter((item) => item.selected);
|
|
126
|
-
this.emitOptionSelect();
|
|
127
|
-
if (this.searchString)
|
|
128
|
-
this.searchString = null;
|
|
129
|
-
}
|
|
130
|
-
arrowsSelectNav(e, key) {
|
|
131
|
-
const arrows = [keybordKeyCodeEnum.ARROW_DOWN, keybordKeyCodeEnum.ARROW_UP];
|
|
132
|
-
if (!arrows.includes(e.keyCode))
|
|
133
|
-
return;
|
|
134
|
-
e.preventDefault();
|
|
135
|
-
e.stopPropagation();
|
|
136
|
-
if (!this.isOpen)
|
|
137
|
-
this.toggleSelectUl();
|
|
138
|
-
let index;
|
|
139
|
-
if (e.keyCode === keybordKeyCodeEnum.ARROW_DOWN) {
|
|
140
|
-
index = key + 1 === this.itemsList.length ? 0 : key + 1;
|
|
141
|
-
}
|
|
142
|
-
else if (e.keyCode === keybordKeyCodeEnum.ARROW_UP) {
|
|
143
|
-
index = key <= 0 ? this.itemsList.length - 1 : key - 1;
|
|
144
|
-
}
|
|
145
|
-
this.focusSelectItem(index);
|
|
146
|
-
}
|
|
147
|
-
focusSelectItem(index) {
|
|
148
|
-
const focusElem = this.element.querySelector(`#${this.htmlid}_${index}`);
|
|
149
|
-
if (focusElem)
|
|
150
|
-
focusElem.focus();
|
|
151
|
-
}
|
|
152
|
-
toggleSelectUl(selfFocusOnClose = false) {
|
|
153
|
-
if (this.disabled || this.readonly)
|
|
154
|
-
return;
|
|
155
|
-
if (!this.isOpen) {
|
|
156
|
-
document.addEventListener("click", this.handleSelectFocus);
|
|
157
|
-
document.addEventListener("keyup", this.handleSelectFocus);
|
|
158
|
-
}
|
|
159
|
-
else {
|
|
160
|
-
document.removeEventListener("click", this.handleSelectFocus);
|
|
161
|
-
document.removeEventListener("keyup", this.handleSelectFocus);
|
|
162
|
-
if (selfFocusOnClose) {
|
|
163
|
-
this.element
|
|
164
|
-
.querySelector(`#${this.htmlid}_input`)
|
|
165
|
-
.focus();
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
this.isOpen = !this.isOpen;
|
|
169
|
-
}
|
|
170
|
-
handleInputClick(e) {
|
|
171
|
-
const cp = e.composedPath();
|
|
172
|
-
const clearIcon = cp.find((item) => item.classList && item.classList.contains("resetIcon"));
|
|
173
|
-
if (clearIcon) {
|
|
174
|
-
e.stopPropagation();
|
|
175
|
-
return;
|
|
176
|
-
}
|
|
177
|
-
this.toggleSelectUl();
|
|
178
|
-
}
|
|
179
|
-
handleSelectFocus(e) {
|
|
180
|
-
if (e instanceof KeyboardEvent && e.keyCode === keybordKeyCodeEnum.ESC) {
|
|
181
|
-
e.stopPropagation();
|
|
182
|
-
return this.toggleSelectUl(true);
|
|
183
|
-
}
|
|
184
|
-
if (e instanceof KeyboardEvent &&
|
|
185
|
-
e.keyCode !== keybordKeyCodeEnum.TAB &&
|
|
186
|
-
e.keyCode !== keybordKeyCodeEnum.ENTER) {
|
|
187
|
-
return;
|
|
188
|
-
}
|
|
189
|
-
const tree = getElementTree(getClickedElement());
|
|
190
|
-
const parent = tree.find((elem) => {
|
|
191
|
-
return ((elem.nodeName.toLowerCase() === "z-input" &&
|
|
192
|
-
elem.id === `${this.htmlid}_input`) ||
|
|
193
|
-
(this.multiple &&
|
|
194
|
-
elem.nodeName.toLowerCase() === "ul" &&
|
|
195
|
-
elem.id === this.htmlid));
|
|
196
|
-
});
|
|
197
|
-
if (!parent) {
|
|
198
|
-
this.toggleSelectUl(e instanceof MouseEvent ? true : false);
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
scrollToLetter(letter) {
|
|
202
|
-
const foundItem = this.itemsList.find((item) => item.name.charAt(0) === letter);
|
|
203
|
-
if (foundItem)
|
|
204
|
-
this.focusSelectItem(this.itemsList.indexOf(foundItem));
|
|
205
|
-
}
|
|
206
|
-
renderLabel() {
|
|
207
|
-
if (!this.label)
|
|
208
|
-
return;
|
|
209
|
-
return (h("z-input-label", { htmlfor: this.htmlid, value: this.label, disabled: this.disabled, "aria-label": this.label, id: `${this.htmlid}_input_label` }));
|
|
210
|
-
}
|
|
211
|
-
renderInput() {
|
|
212
|
-
return (h("z-input", { id: `${this.htmlid}_input`, htmlid: `${this.htmlid}_input`, placeholder: this.placeholder, value: !this.isOpen && !this.multiple && this.selectedItems.length
|
|
213
|
-
? this.selectedItems[0].name.replace(/<[^>]+>/g, "")
|
|
214
|
-
: null, "aria-label": this.ariaLabel, icon: this.isOpen ? "caret-up" : "caret-down", hasclearicon: this.hasAutcomplete(), hasmessage: false, disabled: this.disabled, readonly: this.readonly || (!this.hasAutcomplete() && this.isOpen), status: this.isOpen ? InputStatusEnum.selecting : this.status, onClick: (e) => {
|
|
215
|
-
this.handleInputClick(e);
|
|
216
|
-
}, onKeyUp: (e) => {
|
|
217
|
-
if (e.keyCode !== 13)
|
|
218
|
-
e.preventDefault();
|
|
219
|
-
handleKeyboardSubmit(e, this.toggleSelectUl);
|
|
220
|
-
}, onKeyDown: (e) => {
|
|
221
|
-
return this.arrowsSelectNav(e, this.selectedItems.length
|
|
222
|
-
? this.itemsList.indexOf(this.selectedItems[0])
|
|
223
|
-
: -1);
|
|
224
|
-
}, onInputChange: (e) => {
|
|
225
|
-
this.handleInputChange(e);
|
|
226
|
-
}, onKeyPress: (e) => {
|
|
227
|
-
if (!this.hasAutcomplete()) {
|
|
228
|
-
e.preventDefault();
|
|
229
|
-
this.scrollToLetter(String.fromCharCode(e.keyCode));
|
|
230
|
-
}
|
|
231
|
-
} }));
|
|
232
|
-
}
|
|
233
|
-
renderChips() {
|
|
234
|
-
if (!this.multiple || !this.selectedItems.length)
|
|
235
|
-
return;
|
|
236
|
-
return (h("div", { class: `chipsWrapper ${this.isOpen ? "open" : ""}` }, this.selectedItems.map((item) => (h("z-button-filter", { filterid: item.id, filtername: item.name.replace(/<[^>]+>/g, ""), issmall: true, onRemovefilter: () => this.selectItem(item, false) })))));
|
|
237
|
-
}
|
|
238
|
-
renderSelectUl() {
|
|
239
|
-
return (h("div", { class: this.isOpen ? "open" : "closed", tabindex: "-1" },
|
|
240
|
-
h("div", { class: "ulScrollWrapper", tabindex: "-1" },
|
|
241
|
-
h("ul", { role: "listbox", tabindex: this.disabled || this.readonly || !this.isOpen ? -1 : 0, id: this.htmlid, "aria-activedescendant": !this.multiple && this.selectedItems.length
|
|
242
|
-
? this.selectedItems[0].id
|
|
243
|
-
: null, "aria-multiselectable": !!this.multiple, class: `
|
|
244
|
-
${this.disabled ? " disabled" : ""}
|
|
245
|
-
${this.readonly ? " readonly" : ""}
|
|
246
|
-
${!this.isOpen && this.status
|
|
247
|
-
? " input_" + this.status
|
|
248
|
-
: " input_default"}
|
|
249
|
-
${this.selectedItems.length ? " filled" : ""}
|
|
250
|
-
` }, this.renderSelectUlItems()))));
|
|
251
|
-
}
|
|
252
|
-
renderSelectUlItems() {
|
|
253
|
-
if (!this.itemsList.length)
|
|
254
|
-
return this.renderNoSearchResults();
|
|
255
|
-
return this.itemsList.map((item, key) => {
|
|
256
|
-
return (h("li", { role: "option", tabindex: item.disabled || !this.isOpen ? -1 : 0, "aria-selected": !!item.selected, class: item.disabled && "disabled", id: `${this.htmlid}_${key}`, onClick: () => this.selectItem(item, true), onKeyUp: (e) => handleKeyboardSubmit(e, this.selectItem, item, true), onKeyDown: (e) => this.arrowsSelectNav(e, key) },
|
|
257
|
-
h("span", { innerHTML: item.name })));
|
|
258
|
-
});
|
|
259
|
-
}
|
|
260
|
-
renderNoSearchResults() {
|
|
261
|
-
return (h("li", { class: "noResults" },
|
|
262
|
-
h("z-icon", { name: "multiply-circle" }),
|
|
263
|
-
this.noresultslabel));
|
|
264
|
-
}
|
|
265
|
-
renderMessage() {
|
|
266
|
-
if (!this.hasmessage)
|
|
267
|
-
return;
|
|
268
|
-
return h("z-input-message", { message: this.message, status: this.status });
|
|
269
|
-
}
|
|
270
|
-
render() {
|
|
271
|
-
return (h("div", { class: "selectWrapper" },
|
|
272
|
-
this.renderLabel(),
|
|
273
|
-
this.renderChips(),
|
|
274
|
-
this.renderInput(),
|
|
275
|
-
this.renderSelectUl(),
|
|
276
|
-
this.renderMessage()));
|
|
277
|
-
}
|
|
278
|
-
static get is() { return "z-select"; }
|
|
279
|
-
static get encapsulation() { return "scoped"; }
|
|
280
|
-
static get originalStyleUrls() { return {
|
|
281
|
-
"$": ["styles.css"]
|
|
282
|
-
}; }
|
|
283
|
-
static get styleUrls() { return {
|
|
284
|
-
"$": ["styles.css"]
|
|
285
|
-
}; }
|
|
286
|
-
static get properties() { return {
|
|
287
|
-
"htmlid": {
|
|
288
|
-
"type": "string",
|
|
289
|
-
"mutable": false,
|
|
290
|
-
"complexType": {
|
|
291
|
-
"original": "string",
|
|
292
|
-
"resolved": "string",
|
|
293
|
-
"references": {}
|
|
294
|
-
},
|
|
295
|
-
"required": false,
|
|
296
|
-
"optional": false,
|
|
297
|
-
"docs": {
|
|
298
|
-
"tags": [],
|
|
299
|
-
"text": "the id of the input element"
|
|
300
|
-
},
|
|
301
|
-
"attribute": "htmlid",
|
|
302
|
-
"reflect": false,
|
|
303
|
-
"defaultValue": "`id-${randomId()}`"
|
|
304
|
-
},
|
|
305
|
-
"items": {
|
|
306
|
-
"type": "string",
|
|
307
|
-
"mutable": false,
|
|
308
|
-
"complexType": {
|
|
309
|
-
"original": "SelectItemBean[] | string",
|
|
310
|
-
"resolved": "SelectItemBean[] | string",
|
|
311
|
-
"references": {
|
|
312
|
-
"SelectItemBean": {
|
|
313
|
-
"location": "import",
|
|
314
|
-
"path": "../../../beans"
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
},
|
|
318
|
-
"required": false,
|
|
319
|
-
"optional": false,
|
|
320
|
-
"docs": {
|
|
321
|
-
"tags": [],
|
|
322
|
-
"text": "the input select options"
|
|
323
|
-
},
|
|
324
|
-
"attribute": "items",
|
|
325
|
-
"reflect": false
|
|
326
|
-
},
|
|
327
|
-
"name": {
|
|
328
|
-
"type": "string",
|
|
329
|
-
"mutable": false,
|
|
330
|
-
"complexType": {
|
|
331
|
-
"original": "string",
|
|
332
|
-
"resolved": "string",
|
|
333
|
-
"references": {}
|
|
334
|
-
},
|
|
335
|
-
"required": false,
|
|
336
|
-
"optional": true,
|
|
337
|
-
"docs": {
|
|
338
|
-
"tags": [],
|
|
339
|
-
"text": "the input name"
|
|
340
|
-
},
|
|
341
|
-
"attribute": "name",
|
|
342
|
-
"reflect": false
|
|
343
|
-
},
|
|
344
|
-
"label": {
|
|
345
|
-
"type": "string",
|
|
346
|
-
"mutable": false,
|
|
347
|
-
"complexType": {
|
|
348
|
-
"original": "string",
|
|
349
|
-
"resolved": "string",
|
|
350
|
-
"references": {}
|
|
351
|
-
},
|
|
352
|
-
"required": false,
|
|
353
|
-
"optional": true,
|
|
354
|
-
"docs": {
|
|
355
|
-
"tags": [],
|
|
356
|
-
"text": "the input label"
|
|
357
|
-
},
|
|
358
|
-
"attribute": "label",
|
|
359
|
-
"reflect": false
|
|
360
|
-
},
|
|
361
|
-
"ariaLabel": {
|
|
362
|
-
"type": "string",
|
|
363
|
-
"mutable": false,
|
|
364
|
-
"complexType": {
|
|
365
|
-
"original": "string",
|
|
366
|
-
"resolved": "string",
|
|
367
|
-
"references": {}
|
|
368
|
-
},
|
|
369
|
-
"required": false,
|
|
370
|
-
"optional": true,
|
|
371
|
-
"docs": {
|
|
372
|
-
"tags": [],
|
|
373
|
-
"text": "the input aria-label"
|
|
374
|
-
},
|
|
375
|
-
"attribute": "aria-label",
|
|
376
|
-
"reflect": false
|
|
377
|
-
},
|
|
378
|
-
"disabled": {
|
|
379
|
-
"type": "boolean",
|
|
380
|
-
"mutable": false,
|
|
381
|
-
"complexType": {
|
|
382
|
-
"original": "boolean",
|
|
383
|
-
"resolved": "boolean",
|
|
384
|
-
"references": {}
|
|
385
|
-
},
|
|
386
|
-
"required": false,
|
|
387
|
-
"optional": true,
|
|
388
|
-
"docs": {
|
|
389
|
-
"tags": [],
|
|
390
|
-
"text": "the input is disabled"
|
|
391
|
-
},
|
|
392
|
-
"attribute": "disabled",
|
|
393
|
-
"reflect": false,
|
|
394
|
-
"defaultValue": "false"
|
|
395
|
-
},
|
|
396
|
-
"readonly": {
|
|
397
|
-
"type": "boolean",
|
|
398
|
-
"mutable": false,
|
|
399
|
-
"complexType": {
|
|
400
|
-
"original": "boolean",
|
|
401
|
-
"resolved": "boolean",
|
|
402
|
-
"references": {}
|
|
403
|
-
},
|
|
404
|
-
"required": false,
|
|
405
|
-
"optional": true,
|
|
406
|
-
"docs": {
|
|
407
|
-
"tags": [],
|
|
408
|
-
"text": "the input is readonly"
|
|
409
|
-
},
|
|
410
|
-
"attribute": "readonly",
|
|
411
|
-
"reflect": false,
|
|
412
|
-
"defaultValue": "false"
|
|
413
|
-
},
|
|
414
|
-
"placeholder": {
|
|
415
|
-
"type": "string",
|
|
416
|
-
"mutable": false,
|
|
417
|
-
"complexType": {
|
|
418
|
-
"original": "string",
|
|
419
|
-
"resolved": "string",
|
|
420
|
-
"references": {}
|
|
421
|
-
},
|
|
422
|
-
"required": false,
|
|
423
|
-
"optional": true,
|
|
424
|
-
"docs": {
|
|
425
|
-
"tags": [],
|
|
426
|
-
"text": "the input placeholder (optional)"
|
|
427
|
-
},
|
|
428
|
-
"attribute": "placeholder",
|
|
429
|
-
"reflect": false
|
|
430
|
-
},
|
|
431
|
-
"htmltitle": {
|
|
432
|
-
"type": "string",
|
|
433
|
-
"mutable": false,
|
|
434
|
-
"complexType": {
|
|
435
|
-
"original": "string",
|
|
436
|
-
"resolved": "string",
|
|
437
|
-
"references": {}
|
|
438
|
-
},
|
|
439
|
-
"required": false,
|
|
440
|
-
"optional": true,
|
|
441
|
-
"docs": {
|
|
442
|
-
"tags": [],
|
|
443
|
-
"text": "the input html title (optional)"
|
|
444
|
-
},
|
|
445
|
-
"attribute": "htmltitle",
|
|
446
|
-
"reflect": false
|
|
447
|
-
},
|
|
448
|
-
"status": {
|
|
449
|
-
"type": "string",
|
|
450
|
-
"mutable": false,
|
|
451
|
-
"complexType": {
|
|
452
|
-
"original": "InputStatusBean",
|
|
453
|
-
"resolved": "\"error\" | \"selecting\" | \"success\" | \"warning\"",
|
|
454
|
-
"references": {
|
|
455
|
-
"InputStatusBean": {
|
|
456
|
-
"location": "import",
|
|
457
|
-
"path": "../../../beans"
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
},
|
|
461
|
-
"required": false,
|
|
462
|
-
"optional": true,
|
|
463
|
-
"docs": {
|
|
464
|
-
"tags": [],
|
|
465
|
-
"text": "the input status (optional): available for text, password, number, email, textarea, select"
|
|
466
|
-
},
|
|
467
|
-
"attribute": "status",
|
|
468
|
-
"reflect": false
|
|
469
|
-
},
|
|
470
|
-
"hasmessage": {
|
|
471
|
-
"type": "boolean",
|
|
472
|
-
"mutable": false,
|
|
473
|
-
"complexType": {
|
|
474
|
-
"original": "boolean",
|
|
475
|
-
"resolved": "boolean",
|
|
476
|
-
"references": {}
|
|
477
|
-
},
|
|
478
|
-
"required": false,
|
|
479
|
-
"optional": true,
|
|
480
|
-
"docs": {
|
|
481
|
-
"tags": [],
|
|
482
|
-
"text": "show input helper message (optional): available for text, password, number, email, textarea, select"
|
|
483
|
-
},
|
|
484
|
-
"attribute": "hasmessage",
|
|
485
|
-
"reflect": false,
|
|
486
|
-
"defaultValue": "true"
|
|
487
|
-
},
|
|
488
|
-
"message": {
|
|
489
|
-
"type": "string",
|
|
490
|
-
"mutable": false,
|
|
491
|
-
"complexType": {
|
|
492
|
-
"original": "string",
|
|
493
|
-
"resolved": "string",
|
|
494
|
-
"references": {}
|
|
495
|
-
},
|
|
496
|
-
"required": false,
|
|
497
|
-
"optional": true,
|
|
498
|
-
"docs": {
|
|
499
|
-
"tags": [],
|
|
500
|
-
"text": "input helper message (optional): available for text, password, number, email, textarea, select"
|
|
501
|
-
},
|
|
502
|
-
"attribute": "message",
|
|
503
|
-
"reflect": false
|
|
504
|
-
},
|
|
505
|
-
"autocomplete": {
|
|
506
|
-
"type": "any",
|
|
507
|
-
"mutable": false,
|
|
508
|
-
"complexType": {
|
|
509
|
-
"original": "boolean | string",
|
|
510
|
-
"resolved": "boolean | string",
|
|
511
|
-
"references": {}
|
|
512
|
-
},
|
|
513
|
-
"required": false,
|
|
514
|
-
"optional": true,
|
|
515
|
-
"docs": {
|
|
516
|
-
"tags": [],
|
|
517
|
-
"text": "the input has autocomplete option"
|
|
518
|
-
},
|
|
519
|
-
"attribute": "autocomplete",
|
|
520
|
-
"reflect": false,
|
|
521
|
-
"defaultValue": "false"
|
|
522
|
-
},
|
|
523
|
-
"multiple": {
|
|
524
|
-
"type": "boolean",
|
|
525
|
-
"mutable": false,
|
|
526
|
-
"complexType": {
|
|
527
|
-
"original": "boolean",
|
|
528
|
-
"resolved": "boolean",
|
|
529
|
-
"references": {}
|
|
530
|
-
},
|
|
531
|
-
"required": false,
|
|
532
|
-
"optional": true,
|
|
533
|
-
"docs": {
|
|
534
|
-
"tags": [],
|
|
535
|
-
"text": "multiple options can be selected"
|
|
536
|
-
},
|
|
537
|
-
"attribute": "multiple",
|
|
538
|
-
"reflect": false,
|
|
539
|
-
"defaultValue": "false"
|
|
540
|
-
},
|
|
541
|
-
"noresultslabel": {
|
|
542
|
-
"type": "string",
|
|
543
|
-
"mutable": false,
|
|
544
|
-
"complexType": {
|
|
545
|
-
"original": "string",
|
|
546
|
-
"resolved": "string",
|
|
547
|
-
"references": {}
|
|
548
|
-
},
|
|
549
|
-
"required": false,
|
|
550
|
-
"optional": true,
|
|
551
|
-
"docs": {
|
|
552
|
-
"tags": [],
|
|
553
|
-
"text": "no result text message"
|
|
554
|
-
},
|
|
555
|
-
"attribute": "noresultslabel",
|
|
556
|
-
"reflect": false,
|
|
557
|
-
"defaultValue": "\"Nessun risultato\""
|
|
558
|
-
}
|
|
559
|
-
}; }
|
|
560
|
-
static get states() { return {
|
|
561
|
-
"isOpen": {},
|
|
562
|
-
"selectedItems": {},
|
|
563
|
-
"searchString": {}
|
|
564
|
-
}; }
|
|
565
|
-
static get events() { return [{
|
|
566
|
-
"method": "optionSelect",
|
|
567
|
-
"name": "optionSelect",
|
|
568
|
-
"bubbles": true,
|
|
569
|
-
"cancelable": true,
|
|
570
|
-
"composed": true,
|
|
571
|
-
"docs": {
|
|
572
|
-
"tags": [],
|
|
573
|
-
"text": "Emitted on select option selection, returns select id, selected item id (or array of selected items ids if multiple)"
|
|
574
|
-
},
|
|
575
|
-
"complexType": {
|
|
576
|
-
"original": "any",
|
|
577
|
-
"resolved": "any",
|
|
578
|
-
"references": {}
|
|
579
|
-
}
|
|
580
|
-
}]; }
|
|
581
|
-
static get methods() { return {
|
|
582
|
-
"getSelectedItems": {
|
|
583
|
-
"complexType": {
|
|
584
|
-
"signature": "() => Promise<SelectItemBean[]>",
|
|
585
|
-
"parameters": [],
|
|
586
|
-
"references": {
|
|
587
|
-
"Promise": {
|
|
588
|
-
"location": "global"
|
|
589
|
-
},
|
|
590
|
-
"SelectItemBean": {
|
|
591
|
-
"location": "import",
|
|
592
|
-
"path": "../../../beans"
|
|
593
|
-
}
|
|
594
|
-
},
|
|
595
|
-
"return": "Promise<SelectItemBean[]>"
|
|
596
|
-
},
|
|
597
|
-
"docs": {
|
|
598
|
-
"text": "get the input selected options",
|
|
599
|
-
"tags": []
|
|
600
|
-
}
|
|
601
|
-
},
|
|
602
|
-
"getValue": {
|
|
603
|
-
"complexType": {
|
|
604
|
-
"signature": "() => Promise<string | string[]>",
|
|
605
|
-
"parameters": [],
|
|
606
|
-
"references": {
|
|
607
|
-
"Promise": {
|
|
608
|
-
"location": "global"
|
|
609
|
-
}
|
|
610
|
-
},
|
|
611
|
-
"return": "Promise<string | string[]>"
|
|
612
|
-
},
|
|
613
|
-
"docs": {
|
|
614
|
-
"text": "get the input value",
|
|
615
|
-
"tags": []
|
|
616
|
-
}
|
|
617
|
-
},
|
|
618
|
-
"setValue": {
|
|
619
|
-
"complexType": {
|
|
620
|
-
"signature": "(value: string | string[]) => Promise<void>",
|
|
621
|
-
"parameters": [{
|
|
622
|
-
"tags": [],
|
|
623
|
-
"text": ""
|
|
624
|
-
}],
|
|
625
|
-
"references": {
|
|
626
|
-
"Promise": {
|
|
627
|
-
"location": "global"
|
|
628
|
-
},
|
|
629
|
-
"SelectItemBean": {
|
|
630
|
-
"location": "import",
|
|
631
|
-
"path": "../../../beans"
|
|
632
|
-
}
|
|
633
|
-
},
|
|
634
|
-
"return": "Promise<void>"
|
|
635
|
-
},
|
|
636
|
-
"docs": {
|
|
637
|
-
"text": "set the input value",
|
|
638
|
-
"tags": []
|
|
639
|
-
}
|
|
640
|
-
}
|
|
641
|
-
}; }
|
|
642
|
-
static get elementRef() { return "element"; }
|
|
643
|
-
static get watchers() { return [{
|
|
644
|
-
"propName": "items",
|
|
645
|
-
"methodName": "watchItems"
|
|
646
|
-
}]; }
|
|
647
|
-
}
|
|
1
|
+
import { Component, Prop, State, h, Event, Watch, Element, Method, } from "@stencil/core";
|
|
2
|
+
import { keybordKeyCodeEnum, InputStatusEnum, } from "../../../beans";
|
|
3
|
+
import { randomId, handleKeyboardSubmit, getClickedElement, getElementTree, } from "../../../utils/utils";
|
|
4
|
+
export class ZSelect {
|
|
5
|
+
constructor() {
|
|
6
|
+
/** the id of the input element */
|
|
7
|
+
this.htmlid = `id-${randomId()}`;
|
|
8
|
+
/** the input is disabled */
|
|
9
|
+
this.disabled = false;
|
|
10
|
+
/** the input is readonly */
|
|
11
|
+
this.readonly = false;
|
|
12
|
+
/** show input helper message (optional): available for text, password, number, email, textarea, select */
|
|
13
|
+
this.hasmessage = true;
|
|
14
|
+
/** the input has autocomplete option */
|
|
15
|
+
this.autocomplete = false;
|
|
16
|
+
/** multiple options can be selected */
|
|
17
|
+
this.multiple = false;
|
|
18
|
+
/** no result text message */
|
|
19
|
+
this.noresultslabel = "Nessun risultato";
|
|
20
|
+
this.isOpen = false;
|
|
21
|
+
this.itemsList = [];
|
|
22
|
+
this.toggleSelectUl = this.toggleSelectUl.bind(this);
|
|
23
|
+
this.selectItem = this.selectItem.bind(this);
|
|
24
|
+
this.handleSelectFocus = this.handleSelectFocus.bind(this);
|
|
25
|
+
}
|
|
26
|
+
watchItems() {
|
|
27
|
+
this.itemsList = this.getInitialItemsArray();
|
|
28
|
+
this.selectedItems = this.itemsList.filter((item) => item.selected);
|
|
29
|
+
}
|
|
30
|
+
/** get the input selected options */
|
|
31
|
+
async getSelectedItems() {
|
|
32
|
+
return this.selectedItems;
|
|
33
|
+
}
|
|
34
|
+
/** get the input value */
|
|
35
|
+
async getValue() {
|
|
36
|
+
return this.getSelectedValues();
|
|
37
|
+
}
|
|
38
|
+
/** set the input value */
|
|
39
|
+
async setValue(value) {
|
|
40
|
+
let values = [];
|
|
41
|
+
if (typeof value === "string") {
|
|
42
|
+
values.push(value);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
values = value;
|
|
46
|
+
}
|
|
47
|
+
this.selectedItems = this.itemsList.filter((item) => values.includes(item.id));
|
|
48
|
+
}
|
|
49
|
+
emitOptionSelect() {
|
|
50
|
+
this.optionSelect.emit({
|
|
51
|
+
id: this.htmlid,
|
|
52
|
+
selected: this.getSelectedValues(),
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
componentWillLoad() {
|
|
56
|
+
this.watchItems();
|
|
57
|
+
}
|
|
58
|
+
componentWillRender() {
|
|
59
|
+
this.filterItems(this.searchString);
|
|
60
|
+
}
|
|
61
|
+
getInitialItemsArray() {
|
|
62
|
+
return typeof this.items === "string" ? JSON.parse(this.items) : this.items;
|
|
63
|
+
}
|
|
64
|
+
mapSelectedItemsToItemsArray() {
|
|
65
|
+
const initialItemsList = this.getInitialItemsArray();
|
|
66
|
+
return initialItemsList.map((item) => {
|
|
67
|
+
const found = this.selectedItems.find((selected) => selected.id === item.id);
|
|
68
|
+
item.selected = !!found;
|
|
69
|
+
return item;
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
getSelectedValues() {
|
|
73
|
+
if (this.multiple) {
|
|
74
|
+
return this.selectedItems.map((item) => item.id);
|
|
75
|
+
}
|
|
76
|
+
if (!this.multiple && this.selectedItems.length) {
|
|
77
|
+
return this.selectedItems[0].id;
|
|
78
|
+
}
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
filterItems(searchString) {
|
|
82
|
+
const prevList = this.mapSelectedItemsToItemsArray();
|
|
83
|
+
if (!(searchString === null || searchString === void 0 ? void 0 : searchString.length)) {
|
|
84
|
+
this.itemsList = prevList;
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
this.itemsList = prevList
|
|
88
|
+
.filter((item) => {
|
|
89
|
+
return item.name.toUpperCase().includes(searchString.toUpperCase());
|
|
90
|
+
})
|
|
91
|
+
.map((item) => {
|
|
92
|
+
const start = item.name
|
|
93
|
+
.toUpperCase()
|
|
94
|
+
.indexOf(searchString.toUpperCase());
|
|
95
|
+
const end = start + searchString.length;
|
|
96
|
+
const newName = item.name.substring(0, start) +
|
|
97
|
+
item.name.substring(start, end).bold() +
|
|
98
|
+
item.name.substring(end, item.name.length);
|
|
99
|
+
item.name = newName;
|
|
100
|
+
return item;
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
hasAutcomplete() {
|
|
105
|
+
return (this.autocomplete === true ||
|
|
106
|
+
this.autocomplete === "true" ||
|
|
107
|
+
this.autocomplete === "on");
|
|
108
|
+
}
|
|
109
|
+
handleInputChange(e) {
|
|
110
|
+
this.searchString = e.detail.value;
|
|
111
|
+
if (!this.isOpen)
|
|
112
|
+
this.toggleSelectUl();
|
|
113
|
+
}
|
|
114
|
+
selectItem(item, selected) {
|
|
115
|
+
if (item && item.disabled)
|
|
116
|
+
return;
|
|
117
|
+
this.itemsList = this.mapSelectedItemsToItemsArray();
|
|
118
|
+
this.itemsList = this.itemsList.map((i) => {
|
|
119
|
+
if (!this.multiple)
|
|
120
|
+
i.selected = false;
|
|
121
|
+
if (i.id === (item ? item.id : null))
|
|
122
|
+
i.selected = selected;
|
|
123
|
+
return i;
|
|
124
|
+
});
|
|
125
|
+
this.selectedItems = this.itemsList.filter((item) => item.selected);
|
|
126
|
+
this.emitOptionSelect();
|
|
127
|
+
if (this.searchString)
|
|
128
|
+
this.searchString = null;
|
|
129
|
+
}
|
|
130
|
+
arrowsSelectNav(e, key) {
|
|
131
|
+
const arrows = [keybordKeyCodeEnum.ARROW_DOWN, keybordKeyCodeEnum.ARROW_UP];
|
|
132
|
+
if (!arrows.includes(e.keyCode))
|
|
133
|
+
return;
|
|
134
|
+
e.preventDefault();
|
|
135
|
+
e.stopPropagation();
|
|
136
|
+
if (!this.isOpen)
|
|
137
|
+
this.toggleSelectUl();
|
|
138
|
+
let index;
|
|
139
|
+
if (e.keyCode === keybordKeyCodeEnum.ARROW_DOWN) {
|
|
140
|
+
index = key + 1 === this.itemsList.length ? 0 : key + 1;
|
|
141
|
+
}
|
|
142
|
+
else if (e.keyCode === keybordKeyCodeEnum.ARROW_UP) {
|
|
143
|
+
index = key <= 0 ? this.itemsList.length - 1 : key - 1;
|
|
144
|
+
}
|
|
145
|
+
this.focusSelectItem(index);
|
|
146
|
+
}
|
|
147
|
+
focusSelectItem(index) {
|
|
148
|
+
const focusElem = this.element.querySelector(`#${this.htmlid}_${index}`);
|
|
149
|
+
if (focusElem)
|
|
150
|
+
focusElem.focus();
|
|
151
|
+
}
|
|
152
|
+
toggleSelectUl(selfFocusOnClose = false) {
|
|
153
|
+
if (this.disabled || this.readonly)
|
|
154
|
+
return;
|
|
155
|
+
if (!this.isOpen) {
|
|
156
|
+
document.addEventListener("click", this.handleSelectFocus);
|
|
157
|
+
document.addEventListener("keyup", this.handleSelectFocus);
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
document.removeEventListener("click", this.handleSelectFocus);
|
|
161
|
+
document.removeEventListener("keyup", this.handleSelectFocus);
|
|
162
|
+
if (selfFocusOnClose) {
|
|
163
|
+
this.element
|
|
164
|
+
.querySelector(`#${this.htmlid}_input`)
|
|
165
|
+
.focus();
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
this.isOpen = !this.isOpen;
|
|
169
|
+
}
|
|
170
|
+
handleInputClick(e) {
|
|
171
|
+
const cp = e.composedPath();
|
|
172
|
+
const clearIcon = cp.find((item) => item.classList && item.classList.contains("resetIcon"));
|
|
173
|
+
if (clearIcon) {
|
|
174
|
+
e.stopPropagation();
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
this.toggleSelectUl();
|
|
178
|
+
}
|
|
179
|
+
handleSelectFocus(e) {
|
|
180
|
+
if (e instanceof KeyboardEvent && e.keyCode === keybordKeyCodeEnum.ESC) {
|
|
181
|
+
e.stopPropagation();
|
|
182
|
+
return this.toggleSelectUl(true);
|
|
183
|
+
}
|
|
184
|
+
if (e instanceof KeyboardEvent &&
|
|
185
|
+
e.keyCode !== keybordKeyCodeEnum.TAB &&
|
|
186
|
+
e.keyCode !== keybordKeyCodeEnum.ENTER) {
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
const tree = getElementTree(getClickedElement());
|
|
190
|
+
const parent = tree.find((elem) => {
|
|
191
|
+
return ((elem.nodeName.toLowerCase() === "z-input" &&
|
|
192
|
+
elem.id === `${this.htmlid}_input`) ||
|
|
193
|
+
(this.multiple &&
|
|
194
|
+
elem.nodeName.toLowerCase() === "ul" &&
|
|
195
|
+
elem.id === this.htmlid));
|
|
196
|
+
});
|
|
197
|
+
if (!parent) {
|
|
198
|
+
this.toggleSelectUl(e instanceof MouseEvent ? true : false);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
scrollToLetter(letter) {
|
|
202
|
+
const foundItem = this.itemsList.find((item) => item.name.charAt(0) === letter);
|
|
203
|
+
if (foundItem)
|
|
204
|
+
this.focusSelectItem(this.itemsList.indexOf(foundItem));
|
|
205
|
+
}
|
|
206
|
+
renderLabel() {
|
|
207
|
+
if (!this.label)
|
|
208
|
+
return;
|
|
209
|
+
return (h("z-input-label", { htmlfor: this.htmlid, value: this.label, disabled: this.disabled, "aria-label": this.label, id: `${this.htmlid}_input_label` }));
|
|
210
|
+
}
|
|
211
|
+
renderInput() {
|
|
212
|
+
return (h("z-input", { id: `${this.htmlid}_input`, htmlid: `${this.htmlid}_input`, placeholder: this.placeholder, value: !this.isOpen && !this.multiple && this.selectedItems.length
|
|
213
|
+
? this.selectedItems[0].name.replace(/<[^>]+>/g, "")
|
|
214
|
+
: null, "aria-label": this.ariaLabel, icon: this.isOpen ? "caret-up" : "caret-down", hasclearicon: this.hasAutcomplete(), hasmessage: false, disabled: this.disabled, readonly: this.readonly || (!this.hasAutcomplete() && this.isOpen), status: this.isOpen ? InputStatusEnum.selecting : this.status, onClick: (e) => {
|
|
215
|
+
this.handleInputClick(e);
|
|
216
|
+
}, onKeyUp: (e) => {
|
|
217
|
+
if (e.keyCode !== 13)
|
|
218
|
+
e.preventDefault();
|
|
219
|
+
handleKeyboardSubmit(e, this.toggleSelectUl);
|
|
220
|
+
}, onKeyDown: (e) => {
|
|
221
|
+
return this.arrowsSelectNav(e, this.selectedItems.length
|
|
222
|
+
? this.itemsList.indexOf(this.selectedItems[0])
|
|
223
|
+
: -1);
|
|
224
|
+
}, onInputChange: (e) => {
|
|
225
|
+
this.handleInputChange(e);
|
|
226
|
+
}, onKeyPress: (e) => {
|
|
227
|
+
if (!this.hasAutcomplete()) {
|
|
228
|
+
e.preventDefault();
|
|
229
|
+
this.scrollToLetter(String.fromCharCode(e.keyCode));
|
|
230
|
+
}
|
|
231
|
+
} }));
|
|
232
|
+
}
|
|
233
|
+
renderChips() {
|
|
234
|
+
if (!this.multiple || !this.selectedItems.length)
|
|
235
|
+
return;
|
|
236
|
+
return (h("div", { class: `chipsWrapper ${this.isOpen ? "open" : ""}` }, this.selectedItems.map((item) => (h("z-button-filter", { filterid: item.id, filtername: item.name.replace(/<[^>]+>/g, ""), issmall: true, onRemovefilter: () => this.selectItem(item, false) })))));
|
|
237
|
+
}
|
|
238
|
+
renderSelectUl() {
|
|
239
|
+
return (h("div", { class: this.isOpen ? "open" : "closed", tabindex: "-1" },
|
|
240
|
+
h("div", { class: "ulScrollWrapper", tabindex: "-1" },
|
|
241
|
+
h("ul", { role: "listbox", tabindex: this.disabled || this.readonly || !this.isOpen ? -1 : 0, id: this.htmlid, "aria-activedescendant": !this.multiple && this.selectedItems.length
|
|
242
|
+
? this.selectedItems[0].id
|
|
243
|
+
: null, "aria-multiselectable": !!this.multiple, class: `
|
|
244
|
+
${this.disabled ? " disabled" : ""}
|
|
245
|
+
${this.readonly ? " readonly" : ""}
|
|
246
|
+
${!this.isOpen && this.status
|
|
247
|
+
? " input_" + this.status
|
|
248
|
+
: " input_default"}
|
|
249
|
+
${this.selectedItems.length ? " filled" : ""}
|
|
250
|
+
` }, this.renderSelectUlItems()))));
|
|
251
|
+
}
|
|
252
|
+
renderSelectUlItems() {
|
|
253
|
+
if (!this.itemsList.length)
|
|
254
|
+
return this.renderNoSearchResults();
|
|
255
|
+
return this.itemsList.map((item, key) => {
|
|
256
|
+
return (h("li", { role: "option", tabindex: item.disabled || !this.isOpen ? -1 : 0, "aria-selected": !!item.selected, class: item.disabled && "disabled", id: `${this.htmlid}_${key}`, onClick: () => this.selectItem(item, true), onKeyUp: (e) => handleKeyboardSubmit(e, this.selectItem, item, true), onKeyDown: (e) => this.arrowsSelectNav(e, key) },
|
|
257
|
+
h("span", { innerHTML: item.name })));
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
renderNoSearchResults() {
|
|
261
|
+
return (h("li", { class: "noResults" },
|
|
262
|
+
h("z-icon", { name: "multiply-circle" }),
|
|
263
|
+
this.noresultslabel));
|
|
264
|
+
}
|
|
265
|
+
renderMessage() {
|
|
266
|
+
if (!this.hasmessage)
|
|
267
|
+
return;
|
|
268
|
+
return h("z-input-message", { message: this.message, status: this.status });
|
|
269
|
+
}
|
|
270
|
+
render() {
|
|
271
|
+
return (h("div", { class: "selectWrapper" },
|
|
272
|
+
this.renderLabel(),
|
|
273
|
+
this.renderChips(),
|
|
274
|
+
this.renderInput(),
|
|
275
|
+
this.renderSelectUl(),
|
|
276
|
+
this.renderMessage()));
|
|
277
|
+
}
|
|
278
|
+
static get is() { return "z-select"; }
|
|
279
|
+
static get encapsulation() { return "scoped"; }
|
|
280
|
+
static get originalStyleUrls() { return {
|
|
281
|
+
"$": ["styles.css"]
|
|
282
|
+
}; }
|
|
283
|
+
static get styleUrls() { return {
|
|
284
|
+
"$": ["styles.css"]
|
|
285
|
+
}; }
|
|
286
|
+
static get properties() { return {
|
|
287
|
+
"htmlid": {
|
|
288
|
+
"type": "string",
|
|
289
|
+
"mutable": false,
|
|
290
|
+
"complexType": {
|
|
291
|
+
"original": "string",
|
|
292
|
+
"resolved": "string",
|
|
293
|
+
"references": {}
|
|
294
|
+
},
|
|
295
|
+
"required": false,
|
|
296
|
+
"optional": false,
|
|
297
|
+
"docs": {
|
|
298
|
+
"tags": [],
|
|
299
|
+
"text": "the id of the input element"
|
|
300
|
+
},
|
|
301
|
+
"attribute": "htmlid",
|
|
302
|
+
"reflect": false,
|
|
303
|
+
"defaultValue": "`id-${randomId()}`"
|
|
304
|
+
},
|
|
305
|
+
"items": {
|
|
306
|
+
"type": "string",
|
|
307
|
+
"mutable": false,
|
|
308
|
+
"complexType": {
|
|
309
|
+
"original": "SelectItemBean[] | string",
|
|
310
|
+
"resolved": "SelectItemBean[] | string",
|
|
311
|
+
"references": {
|
|
312
|
+
"SelectItemBean": {
|
|
313
|
+
"location": "import",
|
|
314
|
+
"path": "../../../beans"
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
"required": false,
|
|
319
|
+
"optional": false,
|
|
320
|
+
"docs": {
|
|
321
|
+
"tags": [],
|
|
322
|
+
"text": "the input select options"
|
|
323
|
+
},
|
|
324
|
+
"attribute": "items",
|
|
325
|
+
"reflect": false
|
|
326
|
+
},
|
|
327
|
+
"name": {
|
|
328
|
+
"type": "string",
|
|
329
|
+
"mutable": false,
|
|
330
|
+
"complexType": {
|
|
331
|
+
"original": "string",
|
|
332
|
+
"resolved": "string",
|
|
333
|
+
"references": {}
|
|
334
|
+
},
|
|
335
|
+
"required": false,
|
|
336
|
+
"optional": true,
|
|
337
|
+
"docs": {
|
|
338
|
+
"tags": [],
|
|
339
|
+
"text": "the input name"
|
|
340
|
+
},
|
|
341
|
+
"attribute": "name",
|
|
342
|
+
"reflect": false
|
|
343
|
+
},
|
|
344
|
+
"label": {
|
|
345
|
+
"type": "string",
|
|
346
|
+
"mutable": false,
|
|
347
|
+
"complexType": {
|
|
348
|
+
"original": "string",
|
|
349
|
+
"resolved": "string",
|
|
350
|
+
"references": {}
|
|
351
|
+
},
|
|
352
|
+
"required": false,
|
|
353
|
+
"optional": true,
|
|
354
|
+
"docs": {
|
|
355
|
+
"tags": [],
|
|
356
|
+
"text": "the input label"
|
|
357
|
+
},
|
|
358
|
+
"attribute": "label",
|
|
359
|
+
"reflect": false
|
|
360
|
+
},
|
|
361
|
+
"ariaLabel": {
|
|
362
|
+
"type": "string",
|
|
363
|
+
"mutable": false,
|
|
364
|
+
"complexType": {
|
|
365
|
+
"original": "string",
|
|
366
|
+
"resolved": "string",
|
|
367
|
+
"references": {}
|
|
368
|
+
},
|
|
369
|
+
"required": false,
|
|
370
|
+
"optional": true,
|
|
371
|
+
"docs": {
|
|
372
|
+
"tags": [],
|
|
373
|
+
"text": "the input aria-label"
|
|
374
|
+
},
|
|
375
|
+
"attribute": "aria-label",
|
|
376
|
+
"reflect": false
|
|
377
|
+
},
|
|
378
|
+
"disabled": {
|
|
379
|
+
"type": "boolean",
|
|
380
|
+
"mutable": false,
|
|
381
|
+
"complexType": {
|
|
382
|
+
"original": "boolean",
|
|
383
|
+
"resolved": "boolean",
|
|
384
|
+
"references": {}
|
|
385
|
+
},
|
|
386
|
+
"required": false,
|
|
387
|
+
"optional": true,
|
|
388
|
+
"docs": {
|
|
389
|
+
"tags": [],
|
|
390
|
+
"text": "the input is disabled"
|
|
391
|
+
},
|
|
392
|
+
"attribute": "disabled",
|
|
393
|
+
"reflect": false,
|
|
394
|
+
"defaultValue": "false"
|
|
395
|
+
},
|
|
396
|
+
"readonly": {
|
|
397
|
+
"type": "boolean",
|
|
398
|
+
"mutable": false,
|
|
399
|
+
"complexType": {
|
|
400
|
+
"original": "boolean",
|
|
401
|
+
"resolved": "boolean",
|
|
402
|
+
"references": {}
|
|
403
|
+
},
|
|
404
|
+
"required": false,
|
|
405
|
+
"optional": true,
|
|
406
|
+
"docs": {
|
|
407
|
+
"tags": [],
|
|
408
|
+
"text": "the input is readonly"
|
|
409
|
+
},
|
|
410
|
+
"attribute": "readonly",
|
|
411
|
+
"reflect": false,
|
|
412
|
+
"defaultValue": "false"
|
|
413
|
+
},
|
|
414
|
+
"placeholder": {
|
|
415
|
+
"type": "string",
|
|
416
|
+
"mutable": false,
|
|
417
|
+
"complexType": {
|
|
418
|
+
"original": "string",
|
|
419
|
+
"resolved": "string",
|
|
420
|
+
"references": {}
|
|
421
|
+
},
|
|
422
|
+
"required": false,
|
|
423
|
+
"optional": true,
|
|
424
|
+
"docs": {
|
|
425
|
+
"tags": [],
|
|
426
|
+
"text": "the input placeholder (optional)"
|
|
427
|
+
},
|
|
428
|
+
"attribute": "placeholder",
|
|
429
|
+
"reflect": false
|
|
430
|
+
},
|
|
431
|
+
"htmltitle": {
|
|
432
|
+
"type": "string",
|
|
433
|
+
"mutable": false,
|
|
434
|
+
"complexType": {
|
|
435
|
+
"original": "string",
|
|
436
|
+
"resolved": "string",
|
|
437
|
+
"references": {}
|
|
438
|
+
},
|
|
439
|
+
"required": false,
|
|
440
|
+
"optional": true,
|
|
441
|
+
"docs": {
|
|
442
|
+
"tags": [],
|
|
443
|
+
"text": "the input html title (optional)"
|
|
444
|
+
},
|
|
445
|
+
"attribute": "htmltitle",
|
|
446
|
+
"reflect": false
|
|
447
|
+
},
|
|
448
|
+
"status": {
|
|
449
|
+
"type": "string",
|
|
450
|
+
"mutable": false,
|
|
451
|
+
"complexType": {
|
|
452
|
+
"original": "InputStatusBean",
|
|
453
|
+
"resolved": "\"error\" | \"selecting\" | \"success\" | \"warning\"",
|
|
454
|
+
"references": {
|
|
455
|
+
"InputStatusBean": {
|
|
456
|
+
"location": "import",
|
|
457
|
+
"path": "../../../beans"
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
},
|
|
461
|
+
"required": false,
|
|
462
|
+
"optional": true,
|
|
463
|
+
"docs": {
|
|
464
|
+
"tags": [],
|
|
465
|
+
"text": "the input status (optional): available for text, password, number, email, textarea, select"
|
|
466
|
+
},
|
|
467
|
+
"attribute": "status",
|
|
468
|
+
"reflect": false
|
|
469
|
+
},
|
|
470
|
+
"hasmessage": {
|
|
471
|
+
"type": "boolean",
|
|
472
|
+
"mutable": false,
|
|
473
|
+
"complexType": {
|
|
474
|
+
"original": "boolean",
|
|
475
|
+
"resolved": "boolean",
|
|
476
|
+
"references": {}
|
|
477
|
+
},
|
|
478
|
+
"required": false,
|
|
479
|
+
"optional": true,
|
|
480
|
+
"docs": {
|
|
481
|
+
"tags": [],
|
|
482
|
+
"text": "show input helper message (optional): available for text, password, number, email, textarea, select"
|
|
483
|
+
},
|
|
484
|
+
"attribute": "hasmessage",
|
|
485
|
+
"reflect": false,
|
|
486
|
+
"defaultValue": "true"
|
|
487
|
+
},
|
|
488
|
+
"message": {
|
|
489
|
+
"type": "string",
|
|
490
|
+
"mutable": false,
|
|
491
|
+
"complexType": {
|
|
492
|
+
"original": "string",
|
|
493
|
+
"resolved": "string",
|
|
494
|
+
"references": {}
|
|
495
|
+
},
|
|
496
|
+
"required": false,
|
|
497
|
+
"optional": true,
|
|
498
|
+
"docs": {
|
|
499
|
+
"tags": [],
|
|
500
|
+
"text": "input helper message (optional): available for text, password, number, email, textarea, select"
|
|
501
|
+
},
|
|
502
|
+
"attribute": "message",
|
|
503
|
+
"reflect": false
|
|
504
|
+
},
|
|
505
|
+
"autocomplete": {
|
|
506
|
+
"type": "any",
|
|
507
|
+
"mutable": false,
|
|
508
|
+
"complexType": {
|
|
509
|
+
"original": "boolean | string",
|
|
510
|
+
"resolved": "boolean | string",
|
|
511
|
+
"references": {}
|
|
512
|
+
},
|
|
513
|
+
"required": false,
|
|
514
|
+
"optional": true,
|
|
515
|
+
"docs": {
|
|
516
|
+
"tags": [],
|
|
517
|
+
"text": "the input has autocomplete option"
|
|
518
|
+
},
|
|
519
|
+
"attribute": "autocomplete",
|
|
520
|
+
"reflect": false,
|
|
521
|
+
"defaultValue": "false"
|
|
522
|
+
},
|
|
523
|
+
"multiple": {
|
|
524
|
+
"type": "boolean",
|
|
525
|
+
"mutable": false,
|
|
526
|
+
"complexType": {
|
|
527
|
+
"original": "boolean",
|
|
528
|
+
"resolved": "boolean",
|
|
529
|
+
"references": {}
|
|
530
|
+
},
|
|
531
|
+
"required": false,
|
|
532
|
+
"optional": true,
|
|
533
|
+
"docs": {
|
|
534
|
+
"tags": [],
|
|
535
|
+
"text": "multiple options can be selected"
|
|
536
|
+
},
|
|
537
|
+
"attribute": "multiple",
|
|
538
|
+
"reflect": false,
|
|
539
|
+
"defaultValue": "false"
|
|
540
|
+
},
|
|
541
|
+
"noresultslabel": {
|
|
542
|
+
"type": "string",
|
|
543
|
+
"mutable": false,
|
|
544
|
+
"complexType": {
|
|
545
|
+
"original": "string",
|
|
546
|
+
"resolved": "string",
|
|
547
|
+
"references": {}
|
|
548
|
+
},
|
|
549
|
+
"required": false,
|
|
550
|
+
"optional": true,
|
|
551
|
+
"docs": {
|
|
552
|
+
"tags": [],
|
|
553
|
+
"text": "no result text message"
|
|
554
|
+
},
|
|
555
|
+
"attribute": "noresultslabel",
|
|
556
|
+
"reflect": false,
|
|
557
|
+
"defaultValue": "\"Nessun risultato\""
|
|
558
|
+
}
|
|
559
|
+
}; }
|
|
560
|
+
static get states() { return {
|
|
561
|
+
"isOpen": {},
|
|
562
|
+
"selectedItems": {},
|
|
563
|
+
"searchString": {}
|
|
564
|
+
}; }
|
|
565
|
+
static get events() { return [{
|
|
566
|
+
"method": "optionSelect",
|
|
567
|
+
"name": "optionSelect",
|
|
568
|
+
"bubbles": true,
|
|
569
|
+
"cancelable": true,
|
|
570
|
+
"composed": true,
|
|
571
|
+
"docs": {
|
|
572
|
+
"tags": [],
|
|
573
|
+
"text": "Emitted on select option selection, returns select id, selected item id (or array of selected items ids if multiple)"
|
|
574
|
+
},
|
|
575
|
+
"complexType": {
|
|
576
|
+
"original": "any",
|
|
577
|
+
"resolved": "any",
|
|
578
|
+
"references": {}
|
|
579
|
+
}
|
|
580
|
+
}]; }
|
|
581
|
+
static get methods() { return {
|
|
582
|
+
"getSelectedItems": {
|
|
583
|
+
"complexType": {
|
|
584
|
+
"signature": "() => Promise<SelectItemBean[]>",
|
|
585
|
+
"parameters": [],
|
|
586
|
+
"references": {
|
|
587
|
+
"Promise": {
|
|
588
|
+
"location": "global"
|
|
589
|
+
},
|
|
590
|
+
"SelectItemBean": {
|
|
591
|
+
"location": "import",
|
|
592
|
+
"path": "../../../beans"
|
|
593
|
+
}
|
|
594
|
+
},
|
|
595
|
+
"return": "Promise<SelectItemBean[]>"
|
|
596
|
+
},
|
|
597
|
+
"docs": {
|
|
598
|
+
"text": "get the input selected options",
|
|
599
|
+
"tags": []
|
|
600
|
+
}
|
|
601
|
+
},
|
|
602
|
+
"getValue": {
|
|
603
|
+
"complexType": {
|
|
604
|
+
"signature": "() => Promise<string | string[]>",
|
|
605
|
+
"parameters": [],
|
|
606
|
+
"references": {
|
|
607
|
+
"Promise": {
|
|
608
|
+
"location": "global"
|
|
609
|
+
}
|
|
610
|
+
},
|
|
611
|
+
"return": "Promise<string | string[]>"
|
|
612
|
+
},
|
|
613
|
+
"docs": {
|
|
614
|
+
"text": "get the input value",
|
|
615
|
+
"tags": []
|
|
616
|
+
}
|
|
617
|
+
},
|
|
618
|
+
"setValue": {
|
|
619
|
+
"complexType": {
|
|
620
|
+
"signature": "(value: string | string[]) => Promise<void>",
|
|
621
|
+
"parameters": [{
|
|
622
|
+
"tags": [],
|
|
623
|
+
"text": ""
|
|
624
|
+
}],
|
|
625
|
+
"references": {
|
|
626
|
+
"Promise": {
|
|
627
|
+
"location": "global"
|
|
628
|
+
},
|
|
629
|
+
"SelectItemBean": {
|
|
630
|
+
"location": "import",
|
|
631
|
+
"path": "../../../beans"
|
|
632
|
+
}
|
|
633
|
+
},
|
|
634
|
+
"return": "Promise<void>"
|
|
635
|
+
},
|
|
636
|
+
"docs": {
|
|
637
|
+
"text": "set the input value",
|
|
638
|
+
"tags": []
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
}; }
|
|
642
|
+
static get elementRef() { return "element"; }
|
|
643
|
+
static get watchers() { return [{
|
|
644
|
+
"propName": "items",
|
|
645
|
+
"methodName": "watchItems"
|
|
646
|
+
}]; }
|
|
647
|
+
}
|