@tylertech/forge 3.0.0-next.8 → 3.0.0-next.9
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/custom-elements.json +2080 -487
- package/dist/button/forge-button.css +1 -1
- package/dist/esm/accordion/index.js +1 -1
- package/dist/esm/app-bar/help-button/index.js +1 -1
- package/dist/esm/app-bar/index.js +1 -1
- package/dist/esm/app-bar/menu-button/index.js +1 -1
- package/dist/esm/app-bar/notification-button/index.js +1 -1
- package/dist/esm/app-bar/profile-button/index.js +1 -1
- package/dist/esm/app-bar/search/index.js +1 -1
- package/dist/esm/autocomplete/index.js +1 -1
- package/dist/esm/banner/index.js +1 -1
- package/dist/esm/bottom-sheet/index.js +1 -1
- package/dist/esm/busy-indicator/index.js +1 -1
- package/dist/esm/button/index.js +1 -1
- package/dist/esm/button-toggle/button-toggle/index.js +1 -1
- package/dist/esm/button-toggle/button-toggle-group/index.js +1 -1
- package/dist/esm/button-toggle/index.js +1 -1
- package/dist/esm/calendar/calendar-dropdown/index.js +1 -1
- package/dist/esm/calendar/calendar-menu/index.js +1 -1
- package/dist/esm/calendar/index.js +1 -1
- package/dist/esm/checkbox/index.js +1 -1
- package/dist/esm/chip-field/index.js +1 -1
- package/dist/esm/chips/chip/index.js +1 -1
- package/dist/esm/chips/chip-set/index.js +1 -1
- package/dist/esm/chips/index.js +1 -1
- package/dist/esm/chunks/{chunk.PPPTT3SM.js → chunk.2VP57RZO.js} +2 -2
- package/dist/esm/chunks/{chunk.PPPTT3SM.js.map → chunk.2VP57RZO.js.map} +2 -2
- package/dist/esm/chunks/{chunk.TXFYS6EU.js → chunk.33EJTOVA.js} +2 -2
- package/dist/esm/chunks/{chunk.OTVT3XM2.js → chunk.3JDFBEF7.js} +2 -2
- package/dist/esm/chunks/chunk.3ME47JIX.js +7 -0
- package/dist/esm/chunks/chunk.3ME47JIX.js.map +7 -0
- package/dist/esm/chunks/{chunk.V6JVHYVW.js → chunk.44UCSD46.js} +2 -2
- package/dist/esm/chunks/{chunk.EUE3OVC7.js → chunk.4WVHON6T.js} +2 -2
- package/dist/esm/chunks/chunk.4WVHON6T.js.map +7 -0
- package/dist/esm/chunks/{chunk.6SBTLXLH.js → chunk.5IQGVS6U.js} +2 -2
- package/dist/esm/chunks/{chunk.6SBTLXLH.js.map → chunk.5IQGVS6U.js.map} +1 -1
- package/dist/esm/chunks/{chunk.7JQHQKXN.js → chunk.6MPXRRMB.js} +2 -2
- package/dist/esm/chunks/{chunk.MXNLCQRB.js → chunk.6VDF54LZ.js} +2 -2
- package/dist/esm/chunks/{chunk.GF2GUVYS.js → chunk.7TGGJGTG.js} +2 -2
- package/dist/esm/chunks/{chunk.GF2GUVYS.js.map → chunk.7TGGJGTG.js.map} +1 -1
- package/dist/esm/chunks/{chunk.4EB5NVCK.js → chunk.AHHNJSZK.js} +2 -2
- package/dist/esm/chunks/chunk.BBKRPL6R.js +7 -0
- package/dist/esm/chunks/chunk.BBKRPL6R.js.map +7 -0
- package/dist/esm/chunks/{chunk.BSTIDYQJ.js → chunk.BBWMSCVG.js} +2 -2
- package/dist/esm/chunks/{chunk.BKCEVPKW.js → chunk.BDCJIRNK.js} +2 -2
- package/dist/esm/chunks/{chunk.IIXLFXHZ.js → chunk.BSVFCJCQ.js} +2 -2
- package/dist/esm/chunks/chunk.CAUWWFF4.js +7 -0
- package/dist/esm/chunks/chunk.CAUWWFF4.js.map +7 -0
- package/dist/esm/chunks/{chunk.SYZB7B4F.js → chunk.CL65KLH7.js} +2 -2
- package/dist/esm/chunks/{chunk.4LVS2EYJ.js → chunk.DFGBVJBE.js} +2 -2
- package/dist/esm/chunks/chunk.DXZ5LVFJ.js +7 -0
- package/dist/esm/chunks/chunk.DXZ5LVFJ.js.map +7 -0
- package/dist/esm/chunks/{chunk.YUAU5IWT.js → chunk.F776DWXU.js} +2 -2
- package/dist/esm/chunks/{chunk.HKJEGD6C.js → chunk.FIBGOPNP.js} +2 -2
- package/dist/esm/chunks/{chunk.HKJEGD6C.js.map → chunk.FIBGOPNP.js.map} +1 -1
- package/dist/esm/chunks/{chunk.CN27IHDN.js → chunk.GEGK55XX.js} +2 -2
- package/dist/esm/chunks/{chunk.CN27IHDN.js.map → chunk.GEGK55XX.js.map} +2 -2
- package/dist/esm/chunks/{chunk.2QFIMTVP.js → chunk.GT3XBPZY.js} +2 -2
- package/dist/esm/chunks/{chunk.5MK5YWCK.js → chunk.HUGRRRQA.js} +2 -2
- package/dist/esm/chunks/{chunk.GJW4WS4I.js → chunk.HXJCTE47.js} +2 -2
- package/dist/esm/chunks/{chunk.RHYRMQS7.js → chunk.IPGZ24EH.js} +2 -2
- package/dist/esm/chunks/{chunk.RHYRMQS7.js.map → chunk.IPGZ24EH.js.map} +1 -1
- package/dist/esm/chunks/chunk.ISC7SZSP.js +7 -0
- package/dist/esm/chunks/chunk.ISC7SZSP.js.map +7 -0
- package/dist/esm/chunks/{chunk.RUSHOL23.js → chunk.JAAJDT5E.js} +2 -2
- package/dist/esm/chunks/{chunk.SIJGKRYS.js → chunk.JCRC2VEI.js} +2 -2
- package/dist/esm/chunks/{chunk.SIJGKRYS.js.map → chunk.JCRC2VEI.js.map} +1 -1
- package/dist/esm/chunks/{chunk.3AF7CJP2.js → chunk.JFKSREWG.js} +2 -2
- package/dist/esm/chunks/{chunk.3AF7CJP2.js.map → chunk.JFKSREWG.js.map} +1 -1
- package/dist/esm/chunks/{chunk.FAANPQES.js → chunk.JL4XB4RI.js} +2 -2
- package/dist/esm/chunks/{chunk.24L5GDD2.js → chunk.JTIPXKV6.js} +2 -2
- package/dist/esm/chunks/{chunk.24L5GDD2.js.map → chunk.JTIPXKV6.js.map} +2 -2
- package/dist/esm/chunks/chunk.KO45GDOA.js +7 -0
- package/dist/esm/chunks/{chunk.2CTK5R37.js.map → chunk.KO45GDOA.js.map} +2 -2
- package/dist/esm/chunks/chunk.KSCUIS5C.js +7 -0
- package/dist/esm/chunks/chunk.KSCUIS5C.js.map +7 -0
- package/dist/esm/chunks/{chunk.2LRDPTHK.js → chunk.M2M47T4L.js} +2 -2
- package/dist/esm/chunks/{chunk.JVW6JGV3.js → chunk.MGWY7YIL.js} +2 -2
- package/dist/esm/chunks/{chunk.JVW6JGV3.js.map → chunk.MGWY7YIL.js.map} +2 -2
- package/dist/esm/chunks/{chunk.3CBVRCKM.js → chunk.MJSLXZBM.js} +2 -2
- package/dist/esm/chunks/{chunk.3CBVRCKM.js.map → chunk.MJSLXZBM.js.map} +1 -1
- package/dist/esm/chunks/{chunk.2YAU7AXH.js → chunk.N7PQ2MUQ.js} +2 -2
- package/dist/esm/chunks/{chunk.2YAU7AXH.js.map → chunk.N7PQ2MUQ.js.map} +1 -1
- package/dist/esm/chunks/{chunk.NDGFQILG.js → chunk.NE4NCRRZ.js} +2 -2
- package/dist/esm/chunks/chunk.NF4J3Q5X.js +7 -0
- package/dist/esm/chunks/chunk.NF4J3Q5X.js.map +7 -0
- package/dist/esm/chunks/chunk.OEYALYRM.js +7 -0
- package/dist/esm/chunks/chunk.OEYALYRM.js.map +7 -0
- package/dist/esm/chunks/{chunk.GHSAKRYH.js → chunk.OKKH7F7M.js} +2 -2
- package/dist/esm/chunks/{chunk.AGMPIMJV.js → chunk.QL45FKVJ.js} +2 -2
- package/dist/esm/chunks/{chunk.AGMPIMJV.js.map → chunk.QL45FKVJ.js.map} +2 -2
- package/dist/esm/chunks/chunk.QU76MOCS.js +12 -0
- package/dist/esm/chunks/chunk.QU76MOCS.js.map +7 -0
- package/dist/esm/chunks/{chunk.5PHLKON3.js → chunk.R5HZFOUK.js} +2 -2
- package/dist/esm/chunks/{chunk.5PHLKON3.js.map → chunk.R5HZFOUK.js.map} +2 -2
- package/dist/esm/chunks/chunk.SAXRW6GB.js +7 -0
- package/dist/esm/chunks/chunk.SAXRW6GB.js.map +7 -0
- package/dist/esm/chunks/{chunk.2IQGDFQS.js → chunk.SEP3L4QL.js} +2 -2
- package/dist/esm/chunks/{chunk.2IQGDFQS.js.map → chunk.SEP3L4QL.js.map} +1 -1
- package/dist/esm/chunks/{chunk.Z5TWWM7I.js → chunk.SN5LPTHH.js} +2 -2
- package/dist/esm/chunks/{chunk.Z5TWWM7I.js.map → chunk.SN5LPTHH.js.map} +1 -1
- package/dist/esm/chunks/{chunk.CNQESSA3.js → chunk.UKFJHDO7.js} +2 -2
- package/dist/esm/chunks/{chunk.IGK3VYZG.js → chunk.VI2GRQO3.js} +2 -2
- package/dist/esm/chunks/{chunk.A5MBSCSQ.js → chunk.VNOJO2PF.js} +2 -2
- package/dist/esm/chunks/chunk.W7PZTNZ4.js +7 -0
- package/dist/esm/chunks/chunk.W7PZTNZ4.js.map +7 -0
- package/dist/esm/chunks/{chunk.2YX7ASSX.js → chunk.WXN4S7CN.js} +2 -2
- package/dist/esm/chunks/{chunk.ER52NFXX.js → chunk.X5BG35YX.js} +2 -2
- package/dist/esm/chunks/{chunk.THPU5KBV.js → chunk.XRESQBNE.js} +2 -2
- package/dist/esm/chunks/{chunk.632OMHHN.js → chunk.YDY2IGBF.js} +2 -2
- package/dist/esm/chunks/{chunk.632OMHHN.js.map → chunk.YDY2IGBF.js.map} +1 -1
- package/dist/esm/chunks/{chunk.QYKO543K.js → chunk.YWCLKUK7.js} +2 -2
- package/dist/esm/chunks/{chunk.QA3NU7EN.js → chunk.Z4J4D5FD.js} +2 -2
- package/dist/esm/chunks/{chunk.QA3NU7EN.js.map → chunk.Z4J4D5FD.js.map} +1 -1
- package/dist/esm/chunks/{chunk.V4RBOYNH.js → chunk.ZTGPXIC2.js} +2 -2
- package/dist/esm/chunks/{chunk.V4RBOYNH.js.map → chunk.ZTGPXIC2.js.map} +1 -1
- package/dist/esm/circular-progress/index.js +1 -1
- package/dist/esm/color-picker/index.js +1 -1
- package/dist/esm/core/index.js +1 -1
- package/dist/esm/core/utils/index.js +1 -1
- package/dist/esm/date-picker/index.js +1 -1
- package/dist/esm/date-range-picker/index.js +1 -1
- package/dist/esm/expansion-panel/index.js +1 -1
- package/dist/esm/file-picker/index.js +1 -1
- package/dist/esm/focus-indicator/index.js +1 -1
- package/dist/esm/icon/index.js +1 -1
- package/dist/esm/icon-button/index.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/list/index.js +1 -1
- package/dist/esm/list/list/index.js +1 -1
- package/dist/esm/list/list-item/index.js +1 -1
- package/dist/esm/list-dropdown/index.js +1 -1
- package/dist/esm/menu/index.js +1 -1
- package/dist/esm/open-icon/index.js +1 -1
- package/dist/esm/paginator/index.js +1 -1
- package/dist/esm/profile-card/index.js +1 -1
- package/dist/esm/quantity-field/index.js +1 -1
- package/dist/esm/radio/index.js +1 -1
- package/dist/esm/select/core/index.js +1 -1
- package/dist/esm/select/index.js +1 -1
- package/dist/esm/select/select/index.js +1 -1
- package/dist/esm/select/select-dropdown/index.js +1 -1
- package/dist/esm/slider/index.js +1 -1
- package/dist/esm/split-view/index.js +1 -1
- package/dist/esm/split-view/split-view/index.js +1 -1
- package/dist/esm/split-view/split-view-panel/index.js +1 -1
- package/dist/esm/state-layer/index.js +7 -0
- package/dist/esm/state-layer/index.js.map +7 -0
- package/dist/esm/stepper/index.js +1 -1
- package/dist/esm/stepper/step/index.js +1 -1
- package/dist/esm/stepper/stepper/index.js +1 -1
- package/dist/esm/switch/index.js +1 -1
- package/dist/esm/table/index.js +1 -1
- package/dist/esm/tabs/index.js +1 -1
- package/dist/esm/tabs/tab/index.js +1 -1
- package/dist/esm/tabs/tab-bar/index.js +1 -1
- package/dist/esm/text-field/index.js +1 -1
- package/dist/esm/time-picker/index.js +1 -1
- package/dist/esm/toast/index.js +1 -1
- package/dist/forge-dark.css +1 -1
- package/dist/forge.css +1 -1
- package/dist/icon-button/forge-icon-button.css +1 -1
- package/dist/table/forge-table.css +1 -1
- package/dist/theme/forge-theme.css +1 -1
- package/esm/app-bar/app-bar.js +1 -1
- package/esm/banner/banner.js +1 -1
- package/esm/bottom-sheet/bottom-sheet.js +1 -1
- package/esm/busy-indicator/busy-indicator.js +1 -1
- package/esm/button/button.d.ts +1 -0
- package/esm/button/button.js +8 -2
- package/esm/button-toggle/button-toggle/button-toggle.js +1 -1
- package/esm/calendar/calendar-menu/calendar-menu.js +1 -1
- package/esm/calendar/calendar.js +1 -1
- package/esm/checkbox/checkbox-adapter.d.ts +1 -0
- package/esm/checkbox/checkbox-adapter.js +9 -2
- package/esm/checkbox/checkbox.js +1 -1
- package/esm/chip-field/chip-field.js +1 -1
- package/esm/chips/chip/chip.js +1 -1
- package/esm/circular-progress/circular-progress.d.ts +3 -3
- package/esm/circular-progress/circular-progress.js +4 -4
- package/esm/color-picker/color-picker.js +1 -1
- package/esm/core/testing/pointer.d.ts +13 -0
- package/esm/core/testing/pointer.js +42 -0
- package/esm/core/utils/utils.d.ts +16 -2
- package/esm/core/utils/utils.js +47 -6
- package/esm/file-picker/file-picker.js +1 -1
- package/esm/focus-indicator/focus-indicator-adapter.d.ts +0 -8
- package/esm/focus-indicator/focus-indicator-adapter.js +2 -22
- package/esm/focus-indicator/focus-indicator-foundation.js +1 -1
- package/esm/focus-indicator/focus-indicator.js +1 -1
- package/esm/icon-button/icon-button.d.ts +1 -0
- package/esm/icon-button/icon-button.js +9 -2
- package/esm/index.d.ts +1 -0
- package/esm/index.js +3 -0
- package/esm/list/list-item/list-item-adapter.d.ts +3 -3
- package/esm/list/list-item/list-item-adapter.js +2 -2
- package/esm/list/list-item/list-item-foundation.d.ts +1 -0
- package/esm/list/list-item/list-item-foundation.js +8 -1
- package/esm/list/list-item/list-item.js +1 -1
- package/esm/paginator/paginator.js +1 -1
- package/esm/profile-card/profile-card.js +1 -1
- package/esm/radio/radio-adapter.d.ts +1 -0
- package/esm/radio/radio-adapter.js +9 -2
- package/esm/select/select/select.js +1 -1
- package/esm/slider/slider-adapter.d.ts +0 -16
- package/esm/slider/slider-adapter.js +11 -71
- package/esm/slider/slider-constants.d.ts +0 -3
- package/esm/slider/slider-constants.js +0 -3
- package/esm/slider/slider-foundation.d.ts +0 -1
- package/esm/slider/slider-foundation.js +0 -6
- package/esm/slider/slider-utils.js +3 -3
- package/esm/slider/slider.d.ts +0 -1
- package/esm/slider/slider.js +5 -6
- package/esm/split-view/split-view-panel/split-view-panel.js +1 -1
- package/esm/state-layer/index.d.ts +10 -0
- package/esm/state-layer/index.js +14 -0
- package/esm/state-layer/state-layer-adapter.d.ts +41 -0
- package/esm/state-layer/state-layer-adapter.js +101 -0
- package/esm/state-layer/state-layer-constants.d.ts +79 -0
- package/esm/state-layer/state-layer-constants.js +89 -0
- package/esm/state-layer/state-layer-foundation.d.ts +57 -0
- package/esm/state-layer/state-layer-foundation.js +237 -0
- package/esm/state-layer/state-layer-utils.d.ts +26 -0
- package/esm/state-layer/state-layer-utils.js +54 -0
- package/esm/state-layer/state-layer.d.ts +66 -0
- package/esm/state-layer/state-layer.js +96 -0
- package/esm/stepper/step/step.js +1 -1
- package/esm/switch/switch.js +10 -3
- package/esm/tabs/tab/tab-adapter.d.ts +3 -5
- package/esm/tabs/tab/tab-adapter.js +6 -15
- package/esm/tabs/tab/tab-constants.d.ts +0 -1
- package/esm/tabs/tab/tab-constants.js +0 -1
- package/esm/tabs/tab/tab-foundation.d.ts +0 -1
- package/esm/tabs/tab/tab-foundation.js +1 -3
- package/esm/tabs/tab/tab.d.ts +0 -1
- package/esm/tabs/tab/tab.js +5 -6
- package/esm/tabs/tab-bar/tab-bar.d.ts +2 -2
- package/esm/tabs/tab-bar/tab-bar.js +3 -3
- package/esm/text-field/text-field.js +1 -1
- package/esm/toast/toast.js +1 -1
- package/package.json +1 -1
- package/styles/app-bar/_mixins.scss +9 -1
- package/styles/circular-progress/_mixins.scss +3 -10
- package/styles/core/{style-layer → styles}/circular-progress/_core.scss +5 -8
- package/styles/core/styles/focus-indicator/_core.scss +5 -0
- package/styles/core/styles/focus-indicator/_variables.scss +8 -0
- package/styles/core/styles/focus-indicator/index.scss +7 -0
- package/styles/core/{style-layer → styles}/slider/_core.scss +13 -31
- package/styles/core/styles/state-layer/_core.scss +144 -0
- package/styles/core/styles/state-layer/_variables.scss +8 -0
- package/styles/core/{style-layer/tabs/tab → styles/state-layer}/index.scss +0 -4
- package/styles/core/{style-layer → styles}/tabs/tab/_core.scss +36 -40
- package/styles/core/{style-layer → styles}/tabs/tab-bar/_core.scss +2 -2
- package/styles/core/{style-layer → styles}/tabs/tab-bar/_variables.scss +1 -1
- package/styles/core/styles/tabs/tab-bar/index.scss +7 -0
- package/styles/core/styles/tokens/_color-palette.scss +299 -0
- package/styles/core/styles/tokens/circular-progress/_tokens.scss +14 -0
- package/styles/core/styles/tokens/focus-indicator/_tokens.scss +24 -0
- package/styles/core/styles/tokens/index.scss +58 -0
- package/styles/core/styles/tokens/state-layer/_tokens.scss +17 -0
- package/styles/core/styles/tokens/theme/_tokens.scss +185 -0
- package/styles/core/styles/tokens/typography/_tokens.scss +47 -0
- package/styles/core/styles/utils/_elevation.scss +5 -0
- package/styles/focus-indicator/_mixins.scss +4 -13
- package/styles/focus-indicator/_variables.scss +0 -15
- package/styles/linear-progress/_mixins.scss +1 -1
- package/styles/linear-progress/_variables.scss +1 -1
- package/styles/slider/_mixins.scss +8 -1
- package/styles/state-layer/_mixins.scss +23 -0
- package/styles/state-layer/state-layer.scss +20 -0
- package/styles/tabs/tab/_mixins.scss +9 -1
- package/styles/tabs/tab/_variables.scss +2 -0
- package/styles/tabs/tab-bar/_mixins.scss +2 -1
- package/styles/tabs/tab-bar/_variables.scss +2 -2
- package/styles/theme/_theme-dark.scss +5 -3
- package/styles/theme/_theme.scss +3 -36
- package/dist/esm/chunks/chunk.246JM2YT.js +0 -7
- package/dist/esm/chunks/chunk.246JM2YT.js.map +0 -7
- package/dist/esm/chunks/chunk.2CTK5R37.js +0 -7
- package/dist/esm/chunks/chunk.2XFVFZ3P.js +0 -7
- package/dist/esm/chunks/chunk.2XFVFZ3P.js.map +0 -7
- package/dist/esm/chunks/chunk.57XQ4F6F.js +0 -12
- package/dist/esm/chunks/chunk.57XQ4F6F.js.map +0 -7
- package/dist/esm/chunks/chunk.5IVB5L5Z.js +0 -7
- package/dist/esm/chunks/chunk.5IVB5L5Z.js.map +0 -7
- package/dist/esm/chunks/chunk.A5R7KUIP.js +0 -7
- package/dist/esm/chunks/chunk.A5R7KUIP.js.map +0 -7
- package/dist/esm/chunks/chunk.C2LTB7EX.js +0 -7
- package/dist/esm/chunks/chunk.C2LTB7EX.js.map +0 -7
- package/dist/esm/chunks/chunk.EUE3OVC7.js.map +0 -7
- package/dist/esm/chunks/chunk.GUYPITGA.js +0 -7
- package/dist/esm/chunks/chunk.GUYPITGA.js.map +0 -7
- package/dist/esm/chunks/chunk.JQIOVCKI.js +0 -7
- package/dist/esm/chunks/chunk.JQIOVCKI.js.map +0 -7
- package/dist/esm/chunks/chunk.LJYTJ3RV.js +0 -7
- package/dist/esm/chunks/chunk.LJYTJ3RV.js.map +0 -7
- package/dist/esm/chunks/chunk.NVMILGC2.js +0 -7
- package/dist/esm/chunks/chunk.NVMILGC2.js.map +0 -7
- package/esm/slider/slider-handle-ripple.d.ts +0 -18
- package/esm/slider/slider-handle-ripple.js +0 -37
- package/esm/tabs/tab/tab-ripple.d.ts +0 -17
- package/esm/tabs/tab/tab-ripple.js +0 -33
- package/styles/circular-progress/_variables.scss +0 -12
- /package/dist/esm/chunks/{chunk.TXFYS6EU.js.map → chunk.33EJTOVA.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.OTVT3XM2.js.map → chunk.3JDFBEF7.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.V6JVHYVW.js.map → chunk.44UCSD46.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.7JQHQKXN.js.map → chunk.6MPXRRMB.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.MXNLCQRB.js.map → chunk.6VDF54LZ.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.4EB5NVCK.js.map → chunk.AHHNJSZK.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.BSTIDYQJ.js.map → chunk.BBWMSCVG.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.BKCEVPKW.js.map → chunk.BDCJIRNK.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.IIXLFXHZ.js.map → chunk.BSVFCJCQ.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.SYZB7B4F.js.map → chunk.CL65KLH7.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.4LVS2EYJ.js.map → chunk.DFGBVJBE.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.YUAU5IWT.js.map → chunk.F776DWXU.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.2QFIMTVP.js.map → chunk.GT3XBPZY.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.5MK5YWCK.js.map → chunk.HUGRRRQA.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.GJW4WS4I.js.map → chunk.HXJCTE47.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.RUSHOL23.js.map → chunk.JAAJDT5E.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.FAANPQES.js.map → chunk.JL4XB4RI.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.2LRDPTHK.js.map → chunk.M2M47T4L.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.NDGFQILG.js.map → chunk.NE4NCRRZ.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.GHSAKRYH.js.map → chunk.OKKH7F7M.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.CNQESSA3.js.map → chunk.UKFJHDO7.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.IGK3VYZG.js.map → chunk.VI2GRQO3.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.A5MBSCSQ.js.map → chunk.VNOJO2PF.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.2YX7ASSX.js.map → chunk.WXN4S7CN.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.ER52NFXX.js.map → chunk.X5BG35YX.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.THPU5KBV.js.map → chunk.XRESQBNE.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.QYKO543K.js.map → chunk.YWCLKUK7.js.map} +0 -0
- /package/styles/core/{style-layer → styles}/circular-progress/_animations.scss +0 -0
- /package/styles/core/{style-layer → styles}/circular-progress/_variables.scss +0 -0
- /package/styles/core/{style-layer → styles}/circular-progress/index.scss +0 -0
- /package/styles/core/{style-layer → styles}/core/_config.scss +0 -0
- /package/styles/core/{style-layer → styles}/linear-progress/_animations.scss +0 -0
- /package/styles/core/{style-layer → styles}/linear-progress/_core.scss +0 -0
- /package/styles/core/{style-layer → styles}/linear-progress/_variables.scss +0 -0
- /package/styles/core/{style-layer → styles}/linear-progress/index.scss +0 -0
- /package/styles/core/{style-layer → styles}/slider/_functions.scss +0 -0
- /package/styles/core/{style-layer → styles}/slider/_variables.scss +0 -0
- /package/styles/core/{style-layer → styles}/slider/index.scss +0 -0
- /package/styles/core/{style-layer → styles}/tabs/tab/_variables.scss +0 -0
- /package/styles/core/{style-layer/tabs/tab-bar → styles/tabs/tab}/index.scss +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/tabs/tab-bar/tab-bar-constants.ts", "../../src/tabs/tab/tab-constants.ts", "../../src/tabs/tab/tab-adapter.ts", "../../src/tabs/tab/tab-foundation.ts", "../../src/tabs/tab/tab.ts"],
|
|
4
|
+
"sourcesContent": ["import { COMPONENT_NAME_PREFIX } from '../../constants';\n\nconst elementName: keyof HTMLElementTagNameMap = `${COMPONENT_NAME_PREFIX}tab-bar`;\n\nconst attributes = {\n DISABLED: 'disabled',\n ACTIVE_TAB: 'active-tab',\n VERTICAL: 'vertical',\n STACKED: 'stacked',\n CLUSTERED: 'clustered',\n SECONDARY: 'secondary',\n INVERTED: 'inverted',\n AUTO_ACTIVATE: 'auto-activate',\n SCROLL_BUTTONS: 'scroll-buttons'\n};\n\nconst selectors = {\n CONTAINER: '.container',\n SCROLL_CONTAINER: '.scroll-container',\n DEFAULT_SLOT: 'slot:not([name])'\n};\n\nconst classes = {\n SCROLL_BUTTON: 'scroll-button'\n};\n\nconst events = {\n CHANGE: `${elementName}-change`\n};\n\nconst numbers = {\n SCROLL_MARGIN: 48\n};\n\nexport const TAB_BAR_CONSTANTS = {\n attributes,\n elementName,\n events,\n selectors,\n classes,\n numbers\n};\n\nexport const NAVIGATION_KEYS = new Map([\n ['default', new Set(['Home', 'End'])],\n ['horizontal', new Set(['ArrowLeft', 'ArrowRight'])],\n ['vertical', new Set(['ArrowUp', 'ArrowDown'])]\n]);\n", "import { COMPONENT_NAME_PREFIX } from '../../constants';\n\nconst elementName: keyof HTMLElementTagNameMap = `${COMPONENT_NAME_PREFIX}tab`;\n\nconst attributes = {\n DISABLED: 'disabled',\n SELECTED: 'selected',\n VERTICAL: 'vertical',\n STACKED: 'stacked',\n SECONDARY: 'secondary',\n INVERTED: 'inverted'\n};\n\nconst selectors = {\n INDICATOR: '.indicator'\n};\n\nconst classes = {\n SELECTED: 'selected'\n};\n\nconst events = {\n SELECT: `${elementName}-select`\n};\n\nconst strings = {\n EASING: 'cubic-bezier(0.4, 0, 0.2, 1)'\n};\n\nconst numbers = {\n ANIMATION_DURATION: 250\n};\n\nexport const TAB_CONSTANTS = {\n elementName,\n attributes,\n selectors,\n classes,\n events,\n strings,\n numbers\n};\n\n", "import { getShadowElement, requireParent, toggleAttribute } from '@tylertech/forge-core';\nimport { IStateLayerComponent, STATE_LAYER_CONSTANTS } from '../../state-layer';\nimport { BaseAdapter, IBaseAdapter } from '../../core/base/base-adapter';\nimport { TAB_BAR_CONSTANTS } from '../tab-bar/tab-bar-constants';\nimport type { ITabComponent } from './tab';\nimport { TAB_CONSTANTS } from './tab-constants';\n\nexport interface ITabAdapter extends IBaseAdapter {\n initialize(): void;\n addInteractionListener(type: string, listener: EventListener): void;\n setDisabled(value: boolean): void;\n setSelected(value: boolean): void;\n animateSelected(): void;\n animateStateLayer(): void;\n}\n\nexport class TabAdapter extends BaseAdapter<ITabComponent> implements ITabAdapter {\n private readonly _tabIndicatorElement: HTMLElement;\n private readonly _stateLayerElement: IStateLayerComponent;\n\n constructor(component: ITabComponent) {\n super(component);\n this._tabIndicatorElement = getShadowElement(this._component, TAB_CONSTANTS.selectors.INDICATOR);\n this._stateLayerElement = getShadowElement(this._component, STATE_LAYER_CONSTANTS.elementName) as IStateLayerComponent;\n }\n\n public initialize(): void {\n this._component.tabIndex = this._component.selected ? 0 : -1;\n this._component.setAttribute('role', 'tab');\n this._component.setAttribute('aria-selected', this._component.selected ? 'true' : 'false');\n }\n\n public addInteractionListener(type: string, listener: EventListener): void {\n this._component.addEventListener(type, listener);\n }\n\n public setDisabled(value: boolean): void {\n this._stateLayerElement.disabled = value;\n this._component.tabIndex = value ? -1 : this._component.selected ? 0 : -1;\n this._component.setAttribute('aria-disabled', String(value));\n toggleAttribute(this._component, value, TAB_CONSTANTS.attributes.DISABLED, String(value));\n }\n\n public setSelected(value: boolean): void {\n this._component.tabIndex = value ? 0 : -1;\n this._component.setAttribute('aria-selected', String(value));\n }\n\n public animateSelected(): void {\n this._tabIndicatorElement.getAnimations().forEach(a => a.cancel());\n const frames = this._getKeyframes();\n if (frames) {\n this._tabIndicatorElement.animate(frames, { duration: TAB_CONSTANTS.numbers.ANIMATION_DURATION, easing: TAB_CONSTANTS.strings.EASING });\n }\n }\n\n public animateStateLayer(): void {\n this._stateLayerElement.playAnimation();\n }\n\n private _getKeyframes(): Keyframe[] | null {\n const reduceMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n\n if (!this._component.selected) {\n return reduceMotion ? [{ opacity: 1 }, { transform: 'none' }] : null;\n }\n\n const from: Keyframe = {};\n const isVertical = this._component.vertical;\n const selectedTabIndicator = this._getSelectedTabIndicator();\n const fromRect = selectedTabIndicator?.getBoundingClientRect() ?? {} as DOMRect;\n const fromPos = isVertical ? fromRect.top : fromRect.left;\n const fromExtent = isVertical ? fromRect.height : fromRect.width;\n const toRect = this._tabIndicatorElement.getBoundingClientRect();\n const toPos = isVertical ? toRect.top : toRect.left;\n const toExtent = isVertical ? toRect.height : toRect.width;\n const axis = isVertical ? 'Y' : 'X';\n const scale = fromExtent / toExtent;\n\n if (!reduceMotion && fromPos !== undefined && toPos !== undefined && !isNaN(scale)) {\n from.transform = `translate${axis}(${(fromPos - toPos).toFixed(4)}px) scale${axis}(${scale.toFixed(4)})`;\n } else {\n from.opacity = 0;\n }\n\n return [from, { transform: 'none' }];\n }\n\n private _getSelectedTabIndicator(): HTMLElement | null {\n const tabsEl = requireParent(this._component, TAB_BAR_CONSTANTS.elementName);\n if (tabsEl) {\n const tabChildren = Array.from(tabsEl.querySelectorAll(TAB_CONSTANTS.elementName)) as ITabComponent[];\n const selectedTab = tabChildren.find(tab => tab.hasAttribute(TAB_CONSTANTS.attributes.SELECTED));\n if (selectedTab) {\n return getShadowElement(selectedTab, TAB_CONSTANTS.selectors.INDICATOR);\n }\n }\n return null;\n }\n}\n", "import { ICustomElementFoundation } from '@tylertech/forge-core';\n\nimport { ITabAdapter } from './tab-adapter';\nimport { TAB_CONSTANTS } from './tab-constants';\n\nexport interface ITabFoundation extends ICustomElementFoundation {\n disabled: boolean;\n selected: boolean;\n vertical: boolean;\n stacked: boolean;\n secondary: boolean;\n inverted: boolean;\n}\n\nexport class TabFoundation implements ITabFoundation {\n // State\n private _selected = false;\n private _disabled = false;\n private _vertical = false;\n private _stacked = false;\n private _secondary = false;\n private _inverted = false;\n\n // Listeners\n private _clickListener: EventListener;\n private _keydownListener: EventListener;\n\n constructor(private _adapter: ITabAdapter) {\n this._clickListener = () => this._onClick();\n this._keydownListener = (evt: KeyboardEvent) => this._onKeydown(evt);\n }\n\n public initialize(): void {\n this._adapter.initialize();\n this._adapter.addInteractionListener('click', this._clickListener);\n this._adapter.addInteractionListener('keydown', this._keydownListener);\n }\n\n private _onClick(): void {\n if (this._disabled || this._selected) {\n return;\n }\n this._dispatchSelectEvent();\n }\n\n private _onKeydown(evt: KeyboardEvent): void {\n if (this._disabled || this._selected) {\n return;\n }\n\n const isSelectionKey = evt.key === ' ' || evt.key === 'Enter';\n if (isSelectionKey) {\n evt.preventDefault();\n this._adapter.animateStateLayer();\n this._dispatchSelectEvent();\n }\n }\n\n private _dispatchSelectEvent(): void {\n this._adapter.emitHostEvent(TAB_CONSTANTS.events.SELECT, { bubbles: true, composed: true });\n }\n\n public get disabled(): boolean {\n return this._disabled;\n }\n public set disabled(value: boolean) {\n if (this._disabled !== value) {\n this._disabled = value;\n this._adapter.setDisabled(this._disabled);\n this._adapter.toggleHostAttribute(TAB_CONSTANTS.attributes.DISABLED, this._disabled);\n }\n }\n\n public get selected(): boolean {\n return this._selected;\n }\n public set selected(value: boolean) {\n if (this._selected !== value) {\n this._selected = value;\n this._adapter.setSelected(this._selected);\n this._adapter.animateSelected();\n this._adapter.toggleHostAttribute(TAB_CONSTANTS.attributes.SELECTED, this._selected);\n }\n }\n\n public get vertical(): boolean {\n return this._vertical;\n }\n public set vertical(value: boolean) {\n if (this._vertical !== value) {\n this._vertical = value;\n this._adapter.toggleHostAttribute(TAB_CONSTANTS.attributes.VERTICAL, this._vertical);\n }\n }\n\n public get stacked(): boolean {\n return this._stacked;\n }\n public set stacked(value: boolean) {\n if (this._stacked !== value) {\n this._stacked = value;\n this._adapter.toggleHostAttribute(TAB_CONSTANTS.attributes.STACKED, this._stacked);\n }\n }\n\n public get secondary(): boolean {\n return this._secondary;\n }\n public set secondary(value: boolean) {\n if (this._secondary !== value) {\n this._secondary = value;\n this._adapter.toggleHostAttribute(TAB_CONSTANTS.attributes.SECONDARY, this._secondary);\n }\n }\n\n public get inverted(): boolean {\n return this._inverted;\n }\n public set inverted(value: boolean) {\n if (this._inverted !== value) {\n this._inverted = value;\n this._adapter.toggleHostAttribute(TAB_CONSTANTS.attributes.INVERTED, this._inverted);\n }\n }\n}\n", "import { CustomElement, attachShadowTemplate, coerceBoolean, FoundationProperty } from '@tylertech/forge-core';\n\nimport { TabAdapter } from './tab-adapter';\nimport { TabFoundation } from './tab-foundation';\nimport { TAB_CONSTANTS } from './tab-constants';\nimport { BaseComponent, IBaseComponent } from '../../core/base/base-component';\nimport { FocusIndicatorComponent } from '../../focus-indicator/focus-indicator';\nimport { StateLayerComponent } from '../../state-layer/state-layer';\n\nconst template = '<template><div class=\\\"forge-tab\\\" part=\\\"container\\\"><span class=\\\"content\\\" part=\\\"content\\\"><slot name=\\\"leading\\\"></slot><span class=\\\"label\\\" part=\\\"label\\\"><slot></slot></span><slot name=\\\"trailing\\\"></slot><span class=\\\"indicator\\\" part=\\\"indicator\\\"></span></span><forge-state-layer target=\\\":host\\\"></forge-state-layer><forge-focus-indicator target=\\\":host\\\" inward></forge-focus-indicator></div></template>';\nconst styles = '.forge-tab{--_active-color:var(--forge-tab-active-color, var(--forge-theme-primary, #3f51b5));--_inactive-color:var(--forge-tab-inactive-color, var(--forge-theme-text-secondary, rgba(0, 0, 0, 0.54)));--_active-indicator-color:var(--forge-tab-indicator-color, var(--_active-color));--_active-indicator-height:var(--forge-tab-indicator-height, 3px);--_active-indicator-shape:var(--forge-tab-indicator-shape, 3px 3px 0 0);--_container-color:var(--forge-tab-container-color, transparent);--_container-height:var(--forge-tab-container-height, 48px);--_container-shape:var(--forge-tab-shape, 0);--_content-height:var(--forge-tab-height, 48px);--_active-focus-icon-color:var(--forge-tab-active-focus-icon-color, var(--_active-color));--_active-hover-icon-color:var(--forge-tab-active-hover-icon-color, var(--_active-color));--_active-icon-color:var(--forge-tab-active-icon-color, var(--_active-color));--_active-pressed-icon-color:var(--forge-tab-active-pressed-icon-color, var(--_active-color));--_icon-size:var(--forge-tab-icon-size, 24px);--_focus-icon-color:var(--forge-tab-focus-icon-color, var(--_inactive-color));--_hover-icon-color:var(--forge-tab-hover-icon-color, var(--_inactive-color));--_icon-color:var(--forge-tab-icon-color, var(--_inactive-color));--_pressed-icon-color:var(--forge-tab-pressed-icon-color, var(--_inactive-color));--_active-focus-label-text-color:var(--forge-tab-active-focus-label-text-color, var(--_active-color));--_active-hover-label-text-color:var(--forge-tab-active-hover-label-text-color, var(--_active-color));--_active-label-text-color:var(--forge-tab-active-label-text-color, var(--_active-color));--_active-pressed-label-text-color:var(--forge-tab-active-pressed-label-text-color, var(--_active-color));--_focus-label-text-color:var(--forge-tab-focus-label-text-color, var(--_inactive-color));--_hover-label-text-color:var(--forge-tab-hover-label-text-color, var(--_inactive-color));--_label-text-color:var(--forge-tab-label-text-color, var(--_inactive-color));--_pressed-label-text-color:var(--forge-tab-pressed-label-text-color, var(--_inactive-color));-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-button-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.875rem;font-size:var(--mdc-typography-button-font-size, .875rem);line-height:2.25rem;line-height:var(--mdc-typography-button-line-height, 2.25rem);font-weight:500;font-weight:var(--mdc-typography-button-font-weight,500);letter-spacing:.0892857143em;letter-spacing:var(--mdc-typography-button-letter-spacing, .0892857143em);text-decoration:none;-webkit-text-decoration:var(--mdc-typography-button-text-decoration,none);text-decoration:var(--mdc-typography-button-text-decoration,none);text-transform:uppercase;text-transform:var(--mdc-typography-button-text-transform,uppercase);display:-webkit-inline-box;display:inline-flex;-webkit-box-align:center;align-items:center;-webkit-box-pack:center;justify-content:center;-webkit-box-sizing:border-box;box-sizing:border-box;border:none;outline:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-appearance:none;vertical-align:middle;background:0 0;text-decoration:none;width:100%;position:relative;padding:0;margin:0;z-index:0;background-color:var(--_container-color);color:var(--_label-text-color);min-height:var(--_container-height)}.forge-tab::-moz-focus-inner{padding:0;border:0}.forge-tab ::slotted([slot=leading]),.forge-tab ::slotted([slot=trailing]){display:-webkit-inline-box;display:inline-flex;position:relative;-webkit-writing-mode:horizontal-tb;-ms-writing-mode:lr-tb;writing-mode:horizontal-tb;fill:currentColor;color:var(--_icon-color);font-size:var(--_icon-size);width:var(--_icon-size);height:var(--_icon-size)}.forge-tab:hover{color:var(--_hover-label-text-color);cursor:pointer}.forge-tab:hover ::slotted([slot=leading]),.forge-tab:hover ::slotted([slot=trailing]){color:var(--_hover-icon-color)}.forge-tab .content{position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;display:-webkit-inline-box;display:inline-flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;-webkit-box-align:center;align-items:center;-webkit-box-pack:center;justify-content:center;white-space:nowrap;-webkit-transition:150ms color linear;transition:150ms color linear;max-height:calc(var(--_content-height) + 16px);min-height:var(--_content-height);padding:8px 16px;gap:4px}.forge-tab .content .label{display:inline-block;line-height:1}.forge-tab .indicator{position:absolute;-webkit-box-sizing:border-box;box-sizing:border-box;z-index:-1;-webkit-transform-origin:bottom left;transform-origin:bottom left;background:var(--_active-indicator-color);border-radius:var(--_active-indicator-shape);height:var(--_active-indicator-height);inset:auto 0 0;opacity:0}::slotted(*),host{white-space:nowrap}forge-focus-indicator{--forge-focus-indicator-color:var(--_active-color)}forge-state-layer{--forge-state-layer-color:var(--_active-color)}forge-focus-indicator{--forge-focus-indicator-shape:8px}:host{display:-webkit-inline-box;display:inline-flex;outline:0;-webkit-tap-highlight-color:transparent;vertical-align:middle}:host([hidden]){display:none}:host(:focus) .forge-tab{color:var(--_focus-label-text-color)}:host(:focus) .forge-tab ::slotted([slot=leading]),:host(:focus) .forge-tab ::slotted([slot=trailing]){color:var(--_focus-icon-color)}:host(:active) .forge-tab{color:var(--_pressed-label-text-color);outline:0}:host(:active) .forge-tab ::slotted([slot=leading]),:host(:active) .forge-tab ::slotted([slot=trailing]){color:var(--_pressed-icon-color)}:host([disabled]){cursor:not-allowed;opacity:var(--forge-tab-disabled-opacity, .38)}:host([disabled]) .forge-tab{pointer-events:none}:host([selected]) .forge-tab{color:var(--_active-label-text-color)}:host([selected]) .forge-tab ::slotted([slot=leading]),:host([selected]) .forge-tab ::slotted([slot=trailing]){color:var(--_active-icon-color)}:host([selected]) .forge-tab:hover{color:var(--_active-hover-label-text-color)}:host([selected]) .forge-tab:hover ::slotted([slot=leading]),:host([selected]) .forge-tab:hover ::slotted([slot=trailing]){color:var(--_active-hover-icon-color)}:host([selected]) .indicator{opacity:1}@media (forced-colors:active){:host([selected]) .forge-tab{--_active-indicator-color:CanvasText}}:host([selected]) forge-focus-indicator{--forge-focus-indicator-offset-block:0 calc(var(--_active-indicator-height) + 1px)}:host([selected]) forge-state-layer{--forge-state-layer-color:var(--_active-indicator-color)}:host([selected]:focus) .forge-tab{color:var(--_active-focus-label-text-color)}:host([selected]:focus) .forge-tab ::slotted([slot=leading]),:host([selected]:focus) .forge-tab ::slotted([slot=trailing]){color:var(--_active-focus-icon-color)}:host([selected]:active) .forge-tab{color:var(--_active-pressed-label-text-color)}:host([selected]:active) .forge-tab ::slotted([slot=leading]),:host([selected]:active) .forge-tab ::slotted([slot=trailing]){color:var(--_active-pressed-icon-color)}:host([stacked]) .forge-tab{--_container-height:64px;--_content-height:64px}:host([stacked]) .forge-tab .content{-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}:host([secondary]) .forge-tab{--_active-indicator-height:var(--forge-tab-active-indicator-height, 2px);--_active-indicator-shape:var(--forge-tab-indicator-shape, 0)}:host([secondary]) .content{width:100%}:host([secondary]) .indicator{min-width:100%}:host([vertical]) .forge-tab{width:100%;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;border-bottom:none}:host([vertical]) .content{width:100%}:host([vertical]) .indicator{height:100%;min-width:var(--_active-indicator-height);inset:0 0 0 auto}:host([vertical][secondary]) .content{min-height:100%}:host([vertical]:not([secondary])) .forge-tab{--_active-indicator-shape:3px 0 0 3px}:host([inverted]) .forge-tab{--_active-indicator-shape:var(--forge-tab-indicator-shape, 0 0 3px 3px)}:host([inverted]) .indicator{inset:0 0 auto;-webkit-transform-origin:top left;transform-origin:top left}:host([inverted][vertical]) .forge-tab{--_active-indicator-shape:var(--forge-tab-indicator-shape, 0 3px 3px 0)}:host([inverted][vertical]) .indicator{inset:0 auto 0 0}';\n\nexport interface ITabComponent extends IBaseComponent {\n disabled: boolean;\n selected: boolean;\n vertical: boolean;\n stacked: boolean;\n secondary: boolean;\n inverted: boolean;\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'forge-tab': ITabComponent;\n }\n\n interface HTMLElementEventMap {\n 'forge-tab-select': CustomEvent<void>;\n }\n}\n\n/**\n * @tag forge-tab\n * \n * @property {boolean} disabled - The disabled state of the tab.\n * @property {boolean} selected - The selected state of the tab.\n * @property {boolean} vertical - Controls whether the tab is vertical or horizontal.\n * @property {boolean} stacked - Controls whether the tab is taller to allow for slotted leading/trailing elements.\n * @property {boolean} secondary - Controls whether the tab is styled as secondary tab navigation.\n * @property {boolean} inverted - Controls whether the tab indicator is rendered on the opposite side of the tab.\n * \n * @attribute disabled - The disabled state of the tab.\n * @attribute selected - The selected state of the tab.\n * @attribute vertical - Controls whether the tab is vertical or horizontal.\n * @attribute stacked - Controls whether the tab is taller to allow for slotted leading/trailing elements.\n * @attribute secondary - Controls whether the tab is styled as secondary tab navigation.\n * \n * @event forge-tab-select - Dispatched when the tab is selected.\n * \n * @cssproperty --forge-tab-indicator-color - The color of the tab indicator. Defaults to the primary theme.\n * @cssproperty --forge-tab-indicator-height - The height of the tab indicator.\n * @cssproperty --forge-tab-indicator-shape - The shape of the tab indicator.\n * @cssproperty --forge-tab-container-color - The color of the tab container. Defaults to the surface theme.\n * @cssproperty --forge-tab-height - The height of the tab.\n * @cssproperty --forge-tab-shape - The shape of the tab.\n * @cssproperty --forge-tab-disabled-opacity - The opacity of the tab when disabled.\n * @cssproperty --forge-tab-active-focus-icon-color - The color of the icon when the tab is active and focused. Defaults to the primary theme.\n * @cssproperty --forge-tab-active-hover-icon-color - The color of the icon when the tab is active and hovered. Defaults to the primary theme.\n * @cssproperty --forge-tab-active-icon-color - The color of the icon when the tab is active. Defaults to the primary theme.\n * @cssproperty --forge-tab-active-pressed-icon-color - The color of the icon when the tab is active and pressed. Defaults to the primary theme.\n * @cssproperty --forge-tab-icon-size - The size of the icon.\n * @cssproperty --forge-tab-focus-icon-color - The color of the icon when the tab is focused. Defaults to the text-on-background theme.\n * @cssproperty --forge-tab-hover-icon-color - The color of the icon when the tab is hovered. Defaults to the text-on-background theme.\n * @cssproperty --forge-tab-icon-color - The color of the icon. Defaults to the text-on-background theme.\n * @cssproperty --forge-tab-pressed-icon-color - The color of the icon when the tab is pressed. Defaults to the text-on-background theme.\n * @cssproperty --forge-tab-active-focus-label-text-color - The color of the label text when the tab is active and focused. Defaults to the primary theme.\n * @cssproperty --forge-tab-active-hover-label-text-color - The color of the label text when the tab is active and hovered. Defaults to the primary theme.\n * @cssproperty --forge-tab-active-label-text-color - The color of the label text when the tab is active. Defaults to the primary theme.\n * @cssproperty --forge-tab-active-pressed-label-text-color - The color of the label text when the tab is active and pressed. Defaults to the primary theme.\n * @cssproperty --forge-tab-focus-label-text-color - The color of the label text when the tab is focused. Defaults to the text-on-background theme.\n * @cssproperty --forge-tab-hover-label-text-color - The color of the label text when the tab is hovered. Defaults to the text-on-background theme.\n * @cssproperty --forge-tab-label-text-color - The color of the label text. Defaults to the text-on-background theme.\n * @cssproperty --forge-tab-pressed-label-text-color - The color of the label text when the tab is pressed. Defaults to the text-on-background theme.\n * \n * @csspart container - The tab container.\n * @csspart content - The tab content container.\n * @csspart label - The tab label container.\n * @csspart indicator - The tab active indicator.\n */\n@CustomElement({\n name: TAB_CONSTANTS.elementName,\n dependencies: [\n FocusIndicatorComponent,\n StateLayerComponent\n ]\n})\nexport class TabComponent extends BaseComponent implements ITabComponent {\n public static get observedAttributes(): string[] {\n return [\n TAB_CONSTANTS.attributes.DISABLED,\n TAB_CONSTANTS.attributes.SELECTED,\n TAB_CONSTANTS.attributes.VERTICAL,\n TAB_CONSTANTS.attributes.STACKED,\n TAB_CONSTANTS.attributes.SECONDARY,\n TAB_CONSTANTS.attributes.INVERTED\n ];\n }\n\n private _foundation: TabFoundation;\n\n constructor() {\n super();\n attachShadowTemplate(this, template, styles);\n this._foundation = new TabFoundation(new TabAdapter(this));\n }\n\n public connectedCallback(): void {\n this._foundation.initialize();\n }\n\n public attributeChangedCallback(name: string, oldValue: string, newValue: string): void {\n switch (name) {\n case TAB_CONSTANTS.attributes.DISABLED:\n this.disabled = coerceBoolean(newValue);\n break;\n case TAB_CONSTANTS.attributes.SELECTED:\n this.selected = coerceBoolean(newValue);\n break;\n case TAB_CONSTANTS.attributes.VERTICAL:\n this.vertical = coerceBoolean(newValue);\n break;\n case TAB_CONSTANTS.attributes.STACKED:\n this.stacked = coerceBoolean(newValue);\n break;\n case TAB_CONSTANTS.attributes.SECONDARY:\n this.secondary = coerceBoolean(newValue);\n break;\n case TAB_CONSTANTS.attributes.INVERTED:\n this.inverted = coerceBoolean(newValue);\n break;\n }\n }\n\n @FoundationProperty()\n public declare disabled: boolean;\n \n @FoundationProperty()\n public declare selected: boolean;\n\n @FoundationProperty()\n public declare vertical: boolean;\n\n @FoundationProperty()\n public declare stacked: boolean;\n\n @FoundationProperty()\n public declare secondary: boolean;\n\n @FoundationProperty()\n public declare inverted: boolean;\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["elementName", "COMPONENT_NAME_PREFIX", "attributes", "selectors", "classes", "events", "numbers", "TAB_BAR_CONSTANTS", "NAVIGATION_KEYS", "elementName", "COMPONENT_NAME_PREFIX", "attributes", "selectors", "classes", "events", "strings", "numbers", "TAB_CONSTANTS", "TabAdapter", "BaseAdapter", "component", "getShadowElement", "TAB_CONSTANTS", "STATE_LAYER_CONSTANTS", "type", "listener", "value", "toggleAttribute", "a", "frames", "_a", "reduceMotion", "from", "isVertical", "selectedTabIndicator", "fromRect", "fromPos", "fromExtent", "toRect", "toPos", "toExtent", "axis", "scale", "tabsEl", "requireParent", "TAB_BAR_CONSTANTS", "selectedTab", "tab", "TabFoundation", "_adapter", "evt", "TAB_CONSTANTS", "value", "template", "styles", "TabComponent", "BaseComponent", "attachShadowTemplate", "TabFoundation", "TabAdapter", "TAB_CONSTANTS", "name", "oldValue", "newValue", "coerceBoolean", "__decorateClass", "FoundationProperty", "CustomElement", "FocusIndicatorComponent", "StateLayerComponent"]
|
|
7
|
+
}
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* Copyright 2023 Tyler Technologies, Inc.
|
|
4
4
|
* License: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import{a as k}from"./chunk.6YPD6CQM.js";import{a as X}from"./chunk.ZIB7L7DZ.js";import{a as b}from"./chunk.7G72CBOJ.js";import{a as Y,b as J}from"./chunk.5IVB5L5Z.js";import{a as Q}from"./chunk.IDD54B5P.js";import{a as z}from"./chunk.LEVFMI2Q.js";import{g as O,h as I}from"./chunk.FYWPZFLJ.js";import{a as j,d as q}from"./chunk.H5D54EHO.js";import{d as $}from"./chunk.DTZFWZPB.js";import{f as H}from"./chunk.NK7H3MMM.js";import{d as R,e as M,f as B,i as U,x as K}from"./chunk.CFDK4RCW.js";import{b as _,d as V,h as P,j as v,n as g,p as G}from"./chunk.J2M2MXP2.js";import{a as A}from"./chunk.M3QDAYD2.js";var he={POPUP_CLASSES:"popup-classes",OPTION_LIMIT:"option-limit",OBSERVE_SCROLL:"observe-scroll",OBSERVE_SCROLL_THRESHOLD:"observe-scroll-threshold",SYNC_POPUP_WIDTH:"sync-popup-width",CONSTRAIN_POPUP_WIDTH:"constrain-popup-width",WRAP_OPTION_TEXT:"wrap-option-text",CHECKBOX_ELEMENT:"data-list-dropdown-checkbox",DATA_ALLOW_FOCUS:"data-list-dropdown-allow-focus"},me={GROUP_WRAPPER:"forge-list-dropdown__group-wrapper"},u={attributes:he,classes:me},Z={options:[],syncWidth:!1,selectedValues:[],multiple:!1},ee=(o=>(o.None="none",o.Standard="standard",o.Menu="menu",o))(ee||{}),te=(t=>(t.Spinner="spinner",t.Skeleton="skeleton",t))(te||{});var E=class{constructor(){this._listenerMap=new Map}_emit(e,t){let o=this._listenerMap.get(e);o&&o.length&&o.forEach(n=>n({type:e,data:t}))}hasListeners(e){return e?this._listenerMap.has(e):this._listenerMap.size>0}addListener(e,t){if(!this._listenerMap.has(e))this._listenerMap.set(e,[t]);else{let o=this._listenerMap.get(e);o&&o.push(t)}}removeListener(e,t){let o=this._listenerMap.get(e);o&&o.length&&o.includes(t)&&(o.splice(o.indexOf(t),1),o.length||this._listenerMap.delete(e))}};var f;(function(i){i.Up="up",i.Down="down",i.Left="left",i.Right="right"})(f||(f={}));var c;(function(i){i.Scroll="scroll",i.Scrolled="scrolled",i.ScrolledStart="scrolled-start",i.ScrolledEnd="scrolled-end"})(c||(c={}));var _e=100,w=class extends E{constructor(e,t={}){super(),this._element=e,this._config=t,this._axis="vertical",this._scrollThreshold=0,this._lastScrollPosition=0,this._lastScrollTop=0,this._lastScrollLeft=0,this._isListening=!1,this._initialize()}destroy(){this.stop()}start(){this._isListening||(this._element.addEventListener("scroll",this._scrollListener),this._isListening=!0)}stop(){this._element.removeEventListener("scroll",this._scrollListener),this._isListening=!1}_initialize(){if(this._config.throttle){let e=this._config.throttleTime||_e;this._scrollListener=G(()=>this._onScroll(),e)}else this._scrollListener=()=>this._onScroll();(!_(this._config.paused)||!this._config.paused)&&this.start(),_(this._config.axis)&&(this._axis=this._config.axis),_(this._config.scrollThreshold)&&V(this._config.scrollThreshold)&&(this._scrollThreshold=this._config.scrollThreshold)}_isScrollAxis(){let e=this._lastScrollTop!==this._element.scrollTop,t=this._lastScrollLeft!==this._element.scrollLeft;return this._axis==="vertical"&&e||this._axis==="horizontal"&&t}_onScroll(){if(!this._isScrollAxis())return;let e=this.scrollPosition,t=this._lastScrollPosition-e<0?this._axis==="vertical"?f.Down:f.Right:this._axis==="vertical"?f.Up:f.Left;this._emit(c.Scroll,{direction:t,position:e}),this._lastScrollPosition<=this._scrollThreshold&&e>this._scrollThreshold?this._emit(c.Scrolled,!0):this._lastScrollPosition>=this._scrollThreshold&&(this._scrollThreshold>0?e<this._scrollThreshold:e===0)&&this._emit(c.Scrolled,!1);let o=Math.round(e-this._scrollThreshold),n=Math.round(this.scrollSize-e);this._lastScrollPosition>=this._scrollThreshold&&o<=0?this._emit(c.ScrolledStart):this._lastScrollPosition<=this.scrollSize-this._scrollThreshold&&n<=this._scrollThreshold&&this._emit(c.ScrolledEnd),this._lastScrollPosition=e||0,this._lastScrollTop=this._element.scrollTop||0,this._lastScrollLeft=this._element.scrollLeft||0}get scrollPosition(){return this._axis==="vertical"?this._element.scrollTop:this._element.scrollLeft}get isScrolled(){return this.scrollPosition>this._scrollThreshold}get isScrolledStart(){return this.scrollPosition===0}get isScrolledEnd(){return this.scrollPosition===this._element.scrollWidth}get isScrollable(){return this._axis==="vertical"?this._element.scrollHeight>this._element.clientHeight:this._element.scrollWidth>this._element.clientWidth}get scrollSize(){return(this._axis==="vertical"?this._element.scrollHeight:this._element.scrollWidth)-this.elementSize}get elementSize(){return this._axis==="vertical"?this._element.clientHeight:this._element.clientWidth}setScrollPosition(e){this._axis==="vertical"?this._element.scrollTop=e:this._element.scrollLeft=e}};function oe(i,e){let t=fe(i,e),o=`list-dropdown-popup-${i.id}`;switch(t.addEventListener("mousedown",n=>{let a=z(n);if(a.find(h=>h.nodeType===1&&h.hasAttribute(u.attributes.DATA_ALLOW_FOCUS)))return;a.find(h=>h.id===o||h.id===i.id)&&n.preventDefault()}),i.type){case"menu":t.setAttribute("role","menu"),t.setAttribute("aria-orientation","vertical");break;default:t.setAttribute("role","listbox")}return i.id&&(t.id=o),i.popupClasses&&B(i.popupClasses,t),t}function fe(i,e){var o;let t=document.createElement("forge-popup");switch(t.targetElement=e,t.placement=i.popupPlacement||"bottom-start",t.manageFocus=!1,t.static=!!i.popupStatic,(o=i.popupFallbackPlacements)!=null&&o.length&&(t.fallbackPlacements=i.popupFallbackPlacements),i.constrainViewportWidth&&t.setAttribute(b.attributes.CONSTRAIN_VIEWPORT_WIDTH,""),i.popupOffset&&(t.offset=i.popupOffset),i.type){case"menu":t.animationType="menu";break;case"none":t.animationType="none";break;default:t.animationType="dropdown"}return t}function ne(i){let e=document.createElement(Y.elementName);return e.id=`list-dropdown-list-${i.id}`,e.propagateClick=!1,e}function y(i,e,t,o=0,n=!0){let a=ge(t||i.options),d=N(a),L=!!i.optionLimit,h=i.optionLimit||0,ae=o;for(let m of a){let x=e;if(m.builder&&typeof m.builder=="function"){let s=m.builder(m);if(s){let p=document.createElement("div");p.classList.add(u.classes.GROUP_WRAPPER),x=p,typeof s=="string"?p.innerHTML=s:s instanceof HTMLElement&&p.appendChild(s),e.appendChild(p)}}else if(m.text){let s=document.createElement("div");s.classList.add(u.classes.GROUP_WRAPPER);let p=document.createElement("div");p.textContent=m.text,p.classList.add("forge-typography--overline"),p.style.fontFamily="Roboto,sans-serif",p.style.fontSize="0.75rem",p.style.lineHeight="2rem",p.style.letterSpacing="0.16667em",p.style.fontWeight="500",p.style.margin="4px 8px",x=s,s.appendChild(p),e.appendChild(s)}for(let s of m.options){if(s.divider){let r=ve();e.appendChild(r);continue}if(L&&--h<0)break;let p=i.selectedValues?i.selectedValues.some(r=>g(r,s.value)):!1;if(!n&&p)continue;let l=document.createElement("forge-list-item");switch(l.value=s.value,l.id=`list-dropdown-option-${i.id}-${ae++}`,l.style.cursor="pointer",i.wrapOptionText&&(l.wrap=!0),s.optionClass&&(typeof s.optionClass=="string"||Array.isArray(s.optionClass)&&s.optionClass.length)&&B(s.optionClass,l),i.type){case"menu":l.setAttribute("role","menuitem");break;case"none":break;default:l.setAttribute("role","option")}if(i.dense&&(l.dense=!0),i.optionBuilder&&typeof i.optionBuilder=="function"){let r=i.optionBuilder(s,l);r&&(typeof r=="string"?l.innerHTML=r:l.appendChild(r))}else if(typeof i.transform!="function")l.textContent=s.label||"";else{let r=i.transform(s.label);typeof r=="string"?l.textContent=r:typeof r=="object"&&r.nodeType!==void 0&&l.appendChild(r)}if(i.multiple){let r=C(p);l.appendChild(r),l.setAttribute("aria-selected",`${p}`),l.setAttribute("aria-checked",`${p}`)}if(s.elementAttributes&&s.elementAttributes.forEach((r,F)=>{l.setAttribute(F,r)}),s.leadingBuilder){let r=s.leadingBuilder();v(r)&&(r.slot="leading",l.appendChild(r))}else if(s.leadingIcon){let r=ie(s.leadingIconType,s.leadingIcon,s.leadingIconClass||i.iconClass);r.slot="leading",l.appendChild(r)}if(s.trailingBuilder){let r=s.trailingBuilder();v(r)&&(r.slot="trailing",l.appendChild(r))}else if(s.trailingIcon){let r=ie(s.trailingIconType,s.trailingIcon,s.trailingIconClass||i.iconClass);r.slot="trailing",l.appendChild(r)}if(s.disabled?(l.disabled=s.disabled,l.setAttribute("aria-disabled","true")):(l.style.cursor="pointer",l.setAttribute("aria-disabled","false")),p&&(l.selected=!0),l.setAttribute("aria-selected",p?"true":"false"),!s.disabled&&typeof i.cascadingElementFactory=="function"&&Array.isArray(s.options)&&s.options.length){let r=document.createElement("forge-icon");r.name="arrow_right",r.slot="trailing",l.appendChild(r);let ce={index:d.filter(ue=>!ue.divider).indexOf(s),options:s.options,parentValue:s.value},W=i.cascadingElementFactory.call(null,ce);W.appendChild(l),l=W}x.appendChild(l)}}}function C(i){let e=document.createElement("forge-icon");return e.setAttribute(u.attributes.CHECKBOX_ELEMENT,""),e.name=i?I.name:O.name,e.slot="leading",e.style.marginRight="16px",e.style.verticalAlign="middle",e}function ve(){let i=document.createElement("forge-divider");return i.setAttribute("aria-hidden","true"),i}function ie(i="font",e,t){if(i==="component"){let n=document.createElement("forge-icon");return t&&n.classList.add(t),n.setAttribute("aria-hidden","true"),n.name=e,n}let o=document.createElement("i");return o.classList.add(t||$),o.setAttribute("aria-hidden","true"),o.textContent=e,o}function se(i){switch(i){case"skeleton":return Le();default:return be()}}function be(){let i=document.createElement("div");i.style.display="flex",i.style.justifyContent="center",i.style.alignItems="center",i.style.padding="8px",i.style.boxSizing="border-box";let e=document.createElement("forge-circular-progress");return e.style.setProperty("--forge-circular-progress-size","24px"),i.appendChild(e),i}function Le(){let i=document.createElement("forge-list"),e=document.createElement("div");e.style.minWidth="192px";for(let t=0;t<3;t++){let o=document.createElement(Q.elementName);o.setAttribute("list-item",""),e.appendChild(o)}return i.appendChild(e),i}function re(){let i=document.createElement(X.elementName);return i.determinate=!1,i.style.position="absolute",i.style.top="0",i.style.left="0",i.style.right="0",i.style.width="100%",i}function ge(i){return le(i,1)?i:[{text:"",options:i}]}function le(i,e){let t=i.some(n=>_(n)&&v(n)&&n.hasOwnProperty("options")&&(n.hasOwnProperty("text")||n.hasOwnProperty("builder"))),o=i.some(n=>_(n)&&v(n)&&n.hasOwnProperty("label")&&n.hasOwnProperty("value"));return t&&e===1||o&&e===0}function N(i){return le(i,1)?i.reduce((t,o)=>t.concat(o.options),[]):[...i]}var S=class{constructor(e,t){this._adapter=e;this._open=!1;this._config=Object.assign(A({},Z),A({},t)),this._selectListener=(o,n)=>this._onSelect(o,n),this._closeListener=()=>{typeof this._config.closeCallback=="function"&&this._config.closeCallback()},this._scrollEndListener=()=>{this._config.observeScroll&&typeof this._config.scrollEndListener=="function"&&this._config.scrollEndListener()}}destroy(){this._open&&this.close()}open(){this._open||(this._open=!0,this._adapter.open(this._config,this._selectListener,this._closeListener),window.requestAnimationFrame(()=>{this._open&&this.activateInitialOption()}),this._config.observeScroll&&this._config.scrollEndListener&&this._adapter.setScrollBottomListener(this._scrollEndListener,this._config.observeScrollThreshold||0))}close(){this._open&&(this._open=!1,this._adapter.close(),this._config.observeScroll&&this._config.scrollEndListener&&this._adapter.removeScrollBottomListener(this._scrollEndListener))}_onSelect(e,t){if(typeof this._config.activeChangeCallback=="function"&&this._config.activeChangeCallback(t),typeof this._config.selectCallback=="function"&&this._config.selectCallback(e),this._open){let o=this._config.syncWidth===void 0;this._adapter.syncWidth(o)}}getActiveOptionIndex(){return this._adapter.getActiveOptionIndex()}getActiveOption(){let e=this.getActiveOptionIndex();return e>=0?this._nonDividerOptions[e]:void 0}toggleOptionMultiple(e,t){return this._adapter.toggleOptionMultiple(e,t)}activateSelectedOption(){this._adapter.activateSelectedOption(this._config)}activateFirstOption(){let e=this._nonDividerOptions.findIndex(t=>!t.disabled);return e!==-1&&this.activateOption(e),e}activateLastOption(){let e=this._nonDividerOptions,t=e.length-1-e.findIndex(o=>!o.disabled);return t!==-1&&this.activateOption(t),t}activateOption(e,t){return this._adapter.activateOption(e,this._config.activeChangeCallback,t)}activateInitialOption(){typeof this._config.activeStartIndex=="number"&&this._nonDividerOptions[this._config.activeStartIndex]?(this.activateOption(this._config.activeStartIndex,!1),this._adapter.scrollSelectedOptionIntoView(!1)):this._config.selectedValues&&this._config.selectedValues.length?this._adapter.scrollSelectedOptionIntoView(!1):typeof this._config.visibleStartIndex=="number"&&this._nonDividerOptions[this._config.visibleStartIndex]&&this._adapter.scrollOptionIntoView(this._config.visibleStartIndex)}setSelectedValues(e){Array.isArray(e)||(e=[e]),!this._config.multiple&&e.length>1&&(e=[e[0]]),this._config.selectedValues=e,this._adapter.setSelectedValues(e,this._config.multiple)}clearActiveOption(){this._adapter.clearActiveOption()}setOptions(e){this._config.options=e,this._open&&(this._adapter.setOptions(this._config),this.activateInitialOption())}appendOptions(e){this._config.options=[...this._config.options,...e],this._open&&this._adapter.appendOptions(e,this._config)}get dropdownElement(){return this._adapter.dropdownElement}scrollSelectedOptionIntoView(e=!0){this._adapter.scrollSelectedOptionIntoView(e)}setScrollBottomListener(e,t){this._config.scrollEndListener=e,this._config.observeScroll=!0,this._config.observeScrollThreshold=t,this._adapter.setScrollBottomListener(this._scrollEndListener,this._config.observeScrollThreshold||0)}removeScrollBottomListener(){this._config.scrollEndListener=void 0,this._adapter.removeScrollBottomListener(this._scrollEndListener)}setBusyVisibility(e){this._config.allowBusy&&this._adapter.setBusyVisibility(e)}handleKey(e){switch(e){case"Enter":case"NumpadEnter":let t=this.getActiveOptionIndex(),o=this._nonDividerOptions[t];if(this._canSelectOption(o)){let d=this._adapter.getActiveOptionIdByIndex(t);d&&this._onSelect(o.value,d)}break;case"Up":case"ArrowUp":case"Down":case"ArrowDown":let n=this._nonDividerOptions;if(n.length&&n.every(d=>!this._canSelectOption(d)))return;let a=this._getNextActiveOptionIndex(e);this.activateOption(a);break;case"Home":this.activateFirstOption();break;case"End":this.activateLastOption();break}}_canSelectOption(e){return e&&!e.disabled&&!e.divider}_getNextActiveOptionIndex(e){let t=this._adapter.getActiveOptionIndex();return t===-1&&(t=this._adapter.getSelectedOptionIndex()),e==="ArrowUp"||e==="Up"?this._getPreviousHighlightableOptionIndex(t,this._nonDividerOptions):this._getNextHighlightableOptionIndex(t,this._nonDividerOptions)}_getPreviousHighlightableOptionIndex(e,t){let o=e<=0?t.length-1:e-1;return t[o].disabled?this._getPreviousHighlightableOptionIndex(o,t):o}_getNextHighlightableOptionIndex(e,t){let o=e===t.length-1?0:e+1;return t[o].disabled?this._getNextHighlightableOptionIndex(o,t):o}get _flatOptions(){return N(this._config.options)}get _nonDividerOptions(){return this._flatOptions.filter(e=>!e.divider)}};var D=class{constructor(e){this._targetElement=e}get dropdownElement(){return this._dropdownElement}open(e,t,o){this._dropdownElement=oe(e,this._targetElement),this.syncWidth(!!e.syncWidth,e.targetWidthCallback),e.allowBusy&&(this._busyElement=re(),this._busyElement.style.display="none",this._dropdownElement.appendChild(this._busyElement)),e.headerBuilder&&(this._headerElement=e.headerBuilder(),this._headerElement&&this._headerElement.setAttribute(u.attributes.DATA_ALLOW_FOCUS,"")),e.footerBuilder&&(this._footerElement=e.footerBuilder(),this._footerElement&&this._footerElement.setAttribute(u.attributes.DATA_ALLOW_FOCUS,"")),this._listElement=ne(e),this._listElement.addEventListener("forge-list-item-select",n=>{n.detail.listItem.setAttribute("aria-selected","true"),t(n.detail.value,n.detail.listItem.id)}),e.options.length?(y(e,this._listElement),this._dropdownElement.appendChild(this._listElement),this._headerElement&&this._dropdownElement.insertAdjacentElement("afterbegin",this._headerElement),this._footerElement&&this._dropdownElement.appendChild(this._footerElement)):e.allowBusy&&(this._asyncElement=se(e.asyncStyle),this._dropdownElement.appendChild(this._asyncElement)),this._announcerElement=k(),this._announcerElement.id=`${e.id}-activedescendant`,this._dropdownElement.appendChild(this._announcerElement),this._dropdownElement.open=!0}close(){this._dropdownElement&&(this._dropdownElement.open=!1,this._dropdownElement=void 0,this._listElement=void 0,this._announcerElement=void 0)}setScrollBottomListener(e,t){if(this._dropdownElement&&!this._scrollObserver){let o=H(this._dropdownElement,b.selectors.CONTAINER),n={scrollThreshold:t};this._scrollObserver=new w(o,n),this._scrollObserver.addListener(c.ScrolledEnd,e)}}removeScrollBottomListener(e){this._scrollObserver&&this._scrollObserver.removeListener(c.ScrolledEnd,e)}getActiveOptionIndex(){if(!this._dropdownElement)return-1;let e=this._getListItemElements(),t=[...e].reverse().find(o=>o.active);return t?e.indexOf(t):-1}getSelectedOptionIndex(){return this._getListItemElements().findIndex(t=>t.selected)}getActiveOptionIdByIndex(e){if(!this._dropdownElement)return null;let o=this._getListItemElements()[e];return o?o.id:null}toggleOptionMultiple(e,t){if(!this._dropdownElement)return;let o=this._getListItemElements();o.length&&o[e]&&this._toggleSelectedOption(o[e],t)}scrollOptionIntoView(e,t=!0){let o=this._getListItemElements()[e];o&&this._scrollListItemIntoView(o,t?"smooth":"auto","center")}scrollSelectedOptionIntoView(e=!0){let t=this._getSelectedListItem();this._scrollListItemIntoView(t,e?"smooth":"auto","center")}activateSelectedOption(e){let t=this._getListItemElements();t.length&&t.filter(a=>a.active).forEach(a=>a.active=!1);let o=this._getSelectedListItem();o&&this._activateListOption(o,e.activeChangeCallback)}activateOption(e,t,o=!0){if(!this._dropdownElement)return;let n=this._getListItemElements();n.length&&(n.filter(d=>d.active).forEach(d=>d.active=!1),this._activateListOption(n[e],t),this._scrollListItemIntoView(n[e],o?"smooth":"auto"))}setSelectedValues(e,t=!1){if(!this._dropdownElement)return;let o=this._getListItemElements();for(let n of o){let a=e.some(d=>g(d,n.value));if(n.selected=a,t){let d=n.querySelector(`[${u.attributes.CHECKBOX_ELEMENT}]`);if(d){let L=C(a);M(L,d)}}}}clearActiveOption(){this._getListItemElements().forEach(t=>t.active=!1)}syncWidth(e,t){this._dropdownElement&&(this._dropdownElement.style[e?"width":"minWidth"]=`${this._getTargetElementWidth(t)}px`)}setOptions(e){!this._dropdownElement||!this._listElement||(this._asyncElement&&this._asyncElement.isConnected&&U(this._asyncElement),this._busyElement&&(this._busyElement.style.display="none"),this._listElement.isConnected||this._dropdownElement.appendChild(this._listElement),R(this._listElement),y(e,this._listElement),this._headerElement&&!this._headerElement.isConnected&&this._dropdownElement.insertAdjacentElement("afterbegin",this._headerElement),this._footerElement&&!this._footerElement.isConnected&&this._dropdownElement.insertAdjacentElement("beforeend",this._footerElement),"position"in this._dropdownElement&&typeof this._dropdownElement.position=="function"&&this._dropdownElement.position())}appendOptions(e,t){!this._dropdownElement||!this._listElement||y(t,this._listElement,e,this._listElement.childElementCount,!1)}setBusyVisibility(e){this._dropdownElement&&(e?this._busyElement.style.removeProperty("display"):this._busyElement.style.display="none")}getScreenWidth(){return window.innerWidth}_getListItemElements(){return this._dropdownElement?Array.from(this._dropdownElement.querySelectorAll(J.elementName)):[]}_toggleSelectedOption(e,t){if(!this._dropdownElement)return;let o=this._getListItemElements();if(o.length){let a=o.filter(d=>d!==e&&d.active);a.length&&a.forEach(d=>d.active=!1)}e.selected=t,e.setAttribute("aria-selected",`${t}`),e.setAttribute("aria-checked",`${t}`),t&&(e.active=!0);let n=e.querySelector(`${j.elementName}[slot=leading]`);if(n){let a=C(t);M(a,n)}}_getTargetElementWidth(e){return e&&P(e)?e():this._targetElement.getBoundingClientRect().width}_activateListOption(e,t){e&&!e.disabled&&(e.active=!0,t&&P(t)&&t(e.id))}_scrollListItemIntoView(e,t="auto",o="nearest"){if(e&&this._dropdownElement&&this._dropdownElement.isConnected){let n=H(this._dropdownElement,b.selectors.CONTAINER);n&&K(n,e,t,o)}}_getSelectedListItem(){return this._getListItemElements().find(t=>t.selected)}};var pe=class{constructor(e,t){this._targetElement=e;q.define([I,O]),this._foundation=new S(new D(this._targetElement),t)}destroy(){this._foundation.destroy()}open(){this._foundation.open()}close(){this._foundation.close()}getActiveOptionIndex(){return this._foundation.getActiveOptionIndex()}getActiveOption(){return this._foundation.getActiveOption()}toggleOptionMultiple(e,t){return this._foundation.toggleOptionMultiple(e,t)}activateSelectedOption(){this._foundation.activateSelectedOption()}activateFirstOption(){return this._foundation.activateFirstOption()}activateOption(e){return this._foundation.activateOption(e)}activateInitialOption(){return this._foundation.activateInitialOption()}clearActiveOption(){this._foundation.clearActiveOption()}setSelectedValues(e){return this._foundation.setSelectedValues(e)}get dropdownElement(){return this._foundation.dropdownElement}setOptions(e){this._foundation.setOptions(e)}appendOptions(e){this._foundation.appendOptions(e)}scrollSelectedOptionIntoView(e){this._foundation.scrollSelectedOptionIntoView()}setScrollBottomListener(e,t){this._foundation.setScrollBottomListener(e,t)}removeScrollBottomListener(){this._foundation.removeScrollBottomListener()}setBusyVisibility(e){this._foundation.setBusyVisibility(e)}handleKey(e){this._foundation.handleKey(e)}};var T=class{constructor(){this._popupClasses=[];this._syncPopupWidth=!1;this._optionLimit=0;this._observeScroll=!1;this._observeScrollThreshold=0;this._constrainPopupWidth=!0;this._wrapOptionText=!1}get syncPopupWidth(){return this._syncPopupWidth}set syncPopupWidth(e){this._syncPopupWidth=e}get popupClasses(){return this._popupClasses}set popupClasses(e){typeof e=="string"&&(e=[e]),Array.isArray(e)&&(this._popupClasses=e)}get observeScroll(){return this._observeScroll}set observeScroll(e){this._observeScroll=e}get observeScrollThreshold(){return this._observeScrollThreshold}set observeScrollThreshold(e){this._observeScrollThreshold=e}get optionLimit(){return this._optionLimit}set optionLimit(e){this._optionLimit=e}get popupHeaderBuilder(){return this._popupHeaderBuilder}set popupHeaderBuilder(e){this._popupHeaderBuilder=e}get popupFooterBuilder(){return this._popupFooterBuilder}set popupFooterBuilder(e){this._popupFooterBuilder=e}get constrainPopupWidth(){return this._constrainPopupWidth}set constrainPopupWidth(e){this._constrainPopupWidth=e}get wrapOptionText(){return this._wrapOptionText}set wrapOptionText(e){this._wrapOptionText=e}_applySelection(){}};var de=class extends T{constructor(t){super();this._config=t;this._open=!1;this._options=[];this._childOpen=!1;this._popupHasMouse=!1;this._targetMouseEnterListener=o=>this._onTargetMouseEnter(o),this._targetMouseLeaveListener=o=>this._onTargetMouseLeave(o),this._childPopupMouseEnterListener=()=>this._onChildPopupMouseEnter(),this._childPopupMouseLeaveListener=()=>this._onChildPopupMouseLeave(),this._documentMouseMoveListener=o=>this._mouseCoords={x:o.pageX,y:o.pageY}}_onChildPopupMouseEnter(){this._popupHasMouse=!0}_onChildPopupMouseLeave(){this._popupHasMouse=!1,setTimeout(()=>{let t=document.elementFromPoint(this._mouseCoords.x,this._mouseCoords.y);!this._popupHasMouse&&!this._childOpen&&(!t||!this._isOwnElement(t))&&(this._setCascadeTargetInactive(),this._closeDropdown())},this._config.popupTimeout)}_onTargetMouseEnter(t){this._options.length&&this._openDropdown({fromKeyboard:!1})}_onTargetMouseLeave(t){this._activeMouseLeaveTimeout=window.setTimeout(()=>{if(!(!this._open||this._childOpen)){if(this._mouseCoords){let o=document.elementFromPoint(this._mouseCoords.x,this._mouseCoords.y);if(o&&this._isOwnElement(o))return}this._setCascadeTargetInactive(),this._closeDropdown()}},this._config.targetTimeout)}_clearMouseLeaveTimeout(){this._activeMouseLeaveTimeout!==void 0&&window.clearTimeout(this._activeMouseLeaveTimeout)}};export{u as a,Z as b,ee as c,te as d,le as e,S as f,D as g,pe as h,T as i,de as j};
|
|
7
|
-
//# sourceMappingURL=chunk.
|
|
6
|
+
import{a as k}from"./chunk.6YPD6CQM.js";import{a as Y,b as J}from"./chunk.SAXRW6GB.js";import{a as X}from"./chunk.ZIB7L7DZ.js";import{a as b}from"./chunk.7G72CBOJ.js";import{a as Q}from"./chunk.IDD54B5P.js";import{a as z}from"./chunk.LEVFMI2Q.js";import{g as O,h as I}from"./chunk.FYWPZFLJ.js";import{a as j,d as q}from"./chunk.H5D54EHO.js";import{d as $}from"./chunk.DTZFWZPB.js";import{f as H}from"./chunk.NK7H3MMM.js";import{d as R,e as M,f as B,i as U,x as K}from"./chunk.CFDK4RCW.js";import{b as _,d as V,h as P,j as v,n as g,p as G}from"./chunk.J2M2MXP2.js";import{a as A}from"./chunk.M3QDAYD2.js";var he={POPUP_CLASSES:"popup-classes",OPTION_LIMIT:"option-limit",OBSERVE_SCROLL:"observe-scroll",OBSERVE_SCROLL_THRESHOLD:"observe-scroll-threshold",SYNC_POPUP_WIDTH:"sync-popup-width",CONSTRAIN_POPUP_WIDTH:"constrain-popup-width",WRAP_OPTION_TEXT:"wrap-option-text",CHECKBOX_ELEMENT:"data-list-dropdown-checkbox",DATA_ALLOW_FOCUS:"data-list-dropdown-allow-focus"},me={GROUP_WRAPPER:"forge-list-dropdown__group-wrapper"},u={attributes:he,classes:me},Z={options:[],syncWidth:!1,selectedValues:[],multiple:!1},ee=(o=>(o.None="none",o.Standard="standard",o.Menu="menu",o))(ee||{}),te=(t=>(t.Spinner="spinner",t.Skeleton="skeleton",t))(te||{});var E=class{constructor(){this._listenerMap=new Map}_emit(e,t){let o=this._listenerMap.get(e);o&&o.length&&o.forEach(n=>n({type:e,data:t}))}hasListeners(e){return e?this._listenerMap.has(e):this._listenerMap.size>0}addListener(e,t){if(!this._listenerMap.has(e))this._listenerMap.set(e,[t]);else{let o=this._listenerMap.get(e);o&&o.push(t)}}removeListener(e,t){let o=this._listenerMap.get(e);o&&o.length&&o.includes(t)&&(o.splice(o.indexOf(t),1),o.length||this._listenerMap.delete(e))}};var f;(function(i){i.Up="up",i.Down="down",i.Left="left",i.Right="right"})(f||(f={}));var c;(function(i){i.Scroll="scroll",i.Scrolled="scrolled",i.ScrolledStart="scrolled-start",i.ScrolledEnd="scrolled-end"})(c||(c={}));var _e=100,w=class extends E{constructor(e,t={}){super(),this._element=e,this._config=t,this._axis="vertical",this._scrollThreshold=0,this._lastScrollPosition=0,this._lastScrollTop=0,this._lastScrollLeft=0,this._isListening=!1,this._initialize()}destroy(){this.stop()}start(){this._isListening||(this._element.addEventListener("scroll",this._scrollListener),this._isListening=!0)}stop(){this._element.removeEventListener("scroll",this._scrollListener),this._isListening=!1}_initialize(){if(this._config.throttle){let e=this._config.throttleTime||_e;this._scrollListener=G(()=>this._onScroll(),e)}else this._scrollListener=()=>this._onScroll();(!_(this._config.paused)||!this._config.paused)&&this.start(),_(this._config.axis)&&(this._axis=this._config.axis),_(this._config.scrollThreshold)&&V(this._config.scrollThreshold)&&(this._scrollThreshold=this._config.scrollThreshold)}_isScrollAxis(){let e=this._lastScrollTop!==this._element.scrollTop,t=this._lastScrollLeft!==this._element.scrollLeft;return this._axis==="vertical"&&e||this._axis==="horizontal"&&t}_onScroll(){if(!this._isScrollAxis())return;let e=this.scrollPosition,t=this._lastScrollPosition-e<0?this._axis==="vertical"?f.Down:f.Right:this._axis==="vertical"?f.Up:f.Left;this._emit(c.Scroll,{direction:t,position:e}),this._lastScrollPosition<=this._scrollThreshold&&e>this._scrollThreshold?this._emit(c.Scrolled,!0):this._lastScrollPosition>=this._scrollThreshold&&(this._scrollThreshold>0?e<this._scrollThreshold:e===0)&&this._emit(c.Scrolled,!1);let o=Math.round(e-this._scrollThreshold),n=Math.round(this.scrollSize-e);this._lastScrollPosition>=this._scrollThreshold&&o<=0?this._emit(c.ScrolledStart):this._lastScrollPosition<=this.scrollSize-this._scrollThreshold&&n<=this._scrollThreshold&&this._emit(c.ScrolledEnd),this._lastScrollPosition=e||0,this._lastScrollTop=this._element.scrollTop||0,this._lastScrollLeft=this._element.scrollLeft||0}get scrollPosition(){return this._axis==="vertical"?this._element.scrollTop:this._element.scrollLeft}get isScrolled(){return this.scrollPosition>this._scrollThreshold}get isScrolledStart(){return this.scrollPosition===0}get isScrolledEnd(){return this.scrollPosition===this._element.scrollWidth}get isScrollable(){return this._axis==="vertical"?this._element.scrollHeight>this._element.clientHeight:this._element.scrollWidth>this._element.clientWidth}get scrollSize(){return(this._axis==="vertical"?this._element.scrollHeight:this._element.scrollWidth)-this.elementSize}get elementSize(){return this._axis==="vertical"?this._element.clientHeight:this._element.clientWidth}setScrollPosition(e){this._axis==="vertical"?this._element.scrollTop=e:this._element.scrollLeft=e}};function oe(i,e){let t=fe(i,e),o=`list-dropdown-popup-${i.id}`;switch(t.addEventListener("mousedown",n=>{let a=z(n);if(a.find(h=>h.nodeType===1&&h.hasAttribute(u.attributes.DATA_ALLOW_FOCUS)))return;a.find(h=>h.id===o||h.id===i.id)&&n.preventDefault()}),i.type){case"menu":t.setAttribute("role","menu"),t.setAttribute("aria-orientation","vertical");break;default:t.setAttribute("role","listbox")}return i.id&&(t.id=o),i.popupClasses&&B(i.popupClasses,t),t}function fe(i,e){var o;let t=document.createElement("forge-popup");switch(t.targetElement=e,t.placement=i.popupPlacement||"bottom-start",t.manageFocus=!1,t.static=!!i.popupStatic,(o=i.popupFallbackPlacements)!=null&&o.length&&(t.fallbackPlacements=i.popupFallbackPlacements),i.constrainViewportWidth&&t.setAttribute(b.attributes.CONSTRAIN_VIEWPORT_WIDTH,""),i.popupOffset&&(t.offset=i.popupOffset),i.type){case"menu":t.animationType="menu";break;case"none":t.animationType="none";break;default:t.animationType="dropdown"}return t}function ne(i){let e=document.createElement(Y.elementName);return e.id=`list-dropdown-list-${i.id}`,e.propagateClick=!1,e}function y(i,e,t,o=0,n=!0){let a=ge(t||i.options),d=N(a),L=!!i.optionLimit,h=i.optionLimit||0,ae=o;for(let m of a){let x=e;if(m.builder&&typeof m.builder=="function"){let s=m.builder(m);if(s){let p=document.createElement("div");p.classList.add(u.classes.GROUP_WRAPPER),x=p,typeof s=="string"?p.innerHTML=s:s instanceof HTMLElement&&p.appendChild(s),e.appendChild(p)}}else if(m.text){let s=document.createElement("div");s.classList.add(u.classes.GROUP_WRAPPER);let p=document.createElement("div");p.textContent=m.text,p.classList.add("forge-typography--overline"),p.style.fontFamily="Roboto,sans-serif",p.style.fontSize="0.75rem",p.style.lineHeight="2rem",p.style.letterSpacing="0.16667em",p.style.fontWeight="500",p.style.margin="4px 8px",x=s,s.appendChild(p),e.appendChild(s)}for(let s of m.options){if(s.divider){let r=ve();e.appendChild(r);continue}if(L&&--h<0)break;let p=i.selectedValues?i.selectedValues.some(r=>g(r,s.value)):!1;if(!n&&p)continue;let l=document.createElement("forge-list-item");switch(l.value=s.value,l.id=`list-dropdown-option-${i.id}-${ae++}`,l.style.cursor="pointer",i.wrapOptionText&&(l.wrap=!0),s.optionClass&&(typeof s.optionClass=="string"||Array.isArray(s.optionClass)&&s.optionClass.length)&&B(s.optionClass,l),i.type){case"menu":l.setAttribute("role","menuitem");break;case"none":break;default:l.setAttribute("role","option")}if(i.dense&&(l.dense=!0),i.optionBuilder&&typeof i.optionBuilder=="function"){let r=i.optionBuilder(s,l);r&&(typeof r=="string"?l.innerHTML=r:l.appendChild(r))}else if(typeof i.transform!="function")l.textContent=s.label||"";else{let r=i.transform(s.label);typeof r=="string"?l.textContent=r:typeof r=="object"&&r.nodeType!==void 0&&l.appendChild(r)}if(i.multiple){let r=C(p);l.appendChild(r),l.setAttribute("aria-selected",`${p}`),l.setAttribute("aria-checked",`${p}`)}if(s.elementAttributes&&s.elementAttributes.forEach((r,F)=>{l.setAttribute(F,r)}),s.leadingBuilder){let r=s.leadingBuilder();v(r)&&(r.slot="leading",l.appendChild(r))}else if(s.leadingIcon){let r=ie(s.leadingIconType,s.leadingIcon,s.leadingIconClass||i.iconClass);r.slot="leading",l.appendChild(r)}if(s.trailingBuilder){let r=s.trailingBuilder();v(r)&&(r.slot="trailing",l.appendChild(r))}else if(s.trailingIcon){let r=ie(s.trailingIconType,s.trailingIcon,s.trailingIconClass||i.iconClass);r.slot="trailing",l.appendChild(r)}if(s.disabled?(l.disabled=s.disabled,l.setAttribute("aria-disabled","true")):(l.style.cursor="pointer",l.setAttribute("aria-disabled","false")),p&&(l.selected=!0),l.setAttribute("aria-selected",p?"true":"false"),!s.disabled&&typeof i.cascadingElementFactory=="function"&&Array.isArray(s.options)&&s.options.length){let r=document.createElement("forge-icon");r.name="arrow_right",r.slot="trailing",l.appendChild(r);let ce={index:d.filter(ue=>!ue.divider).indexOf(s),options:s.options,parentValue:s.value},W=i.cascadingElementFactory.call(null,ce);W.appendChild(l),l=W}x.appendChild(l)}}}function C(i){let e=document.createElement("forge-icon");return e.setAttribute(u.attributes.CHECKBOX_ELEMENT,""),e.name=i?I.name:O.name,e.slot="leading",e.style.marginRight="16px",e.style.verticalAlign="middle",e}function ve(){let i=document.createElement("forge-divider");return i.setAttribute("aria-hidden","true"),i}function ie(i="font",e,t){if(i==="component"){let n=document.createElement("forge-icon");return t&&n.classList.add(t),n.setAttribute("aria-hidden","true"),n.name=e,n}let o=document.createElement("i");return o.classList.add(t||$),o.setAttribute("aria-hidden","true"),o.textContent=e,o}function se(i){switch(i){case"skeleton":return Le();default:return be()}}function be(){let i=document.createElement("div");i.style.display="flex",i.style.justifyContent="center",i.style.alignItems="center",i.style.padding="8px",i.style.boxSizing="border-box";let e=document.createElement("forge-circular-progress");return e.style.setProperty("--forge-circular-progress-size","24px"),i.appendChild(e),i}function Le(){let i=document.createElement("forge-list"),e=document.createElement("div");e.style.minWidth="192px";for(let t=0;t<3;t++){let o=document.createElement(Q.elementName);o.setAttribute("list-item",""),e.appendChild(o)}return i.appendChild(e),i}function re(){let i=document.createElement(X.elementName);return i.determinate=!1,i.style.position="absolute",i.style.top="0",i.style.left="0",i.style.right="0",i.style.width="100%",i}function ge(i){return le(i,1)?i:[{text:"",options:i}]}function le(i,e){let t=i.some(n=>_(n)&&v(n)&&n.hasOwnProperty("options")&&(n.hasOwnProperty("text")||n.hasOwnProperty("builder"))),o=i.some(n=>_(n)&&v(n)&&n.hasOwnProperty("label")&&n.hasOwnProperty("value"));return t&&e===1||o&&e===0}function N(i){return le(i,1)?i.reduce((t,o)=>t.concat(o.options),[]):[...i]}var S=class{constructor(e,t){this._adapter=e;this._open=!1;this._config=Object.assign(A({},Z),A({},t)),this._selectListener=(o,n)=>this._onSelect(o,n),this._closeListener=()=>{typeof this._config.closeCallback=="function"&&this._config.closeCallback()},this._scrollEndListener=()=>{this._config.observeScroll&&typeof this._config.scrollEndListener=="function"&&this._config.scrollEndListener()}}destroy(){this._open&&this.close()}open(){this._open||(this._open=!0,this._adapter.open(this._config,this._selectListener,this._closeListener),window.requestAnimationFrame(()=>{this._open&&this.activateInitialOption()}),this._config.observeScroll&&this._config.scrollEndListener&&this._adapter.setScrollBottomListener(this._scrollEndListener,this._config.observeScrollThreshold||0))}close(){this._open&&(this._open=!1,this._adapter.close(),this._config.observeScroll&&this._config.scrollEndListener&&this._adapter.removeScrollBottomListener(this._scrollEndListener))}_onSelect(e,t){if(typeof this._config.activeChangeCallback=="function"&&this._config.activeChangeCallback(t),typeof this._config.selectCallback=="function"&&this._config.selectCallback(e),this._open){let o=this._config.syncWidth===void 0;this._adapter.syncWidth(o)}}getActiveOptionIndex(){return this._adapter.getActiveOptionIndex()}getActiveOption(){let e=this.getActiveOptionIndex();return e>=0?this._nonDividerOptions[e]:void 0}toggleOptionMultiple(e,t){return this._adapter.toggleOptionMultiple(e,t)}activateSelectedOption(){this._adapter.activateSelectedOption(this._config)}activateFirstOption(){let e=this._nonDividerOptions.findIndex(t=>!t.disabled);return e!==-1&&this.activateOption(e),e}activateLastOption(){let e=this._nonDividerOptions,t=e.length-1-e.findIndex(o=>!o.disabled);return t!==-1&&this.activateOption(t),t}activateOption(e,t){return this._adapter.activateOption(e,this._config.activeChangeCallback,t)}activateInitialOption(){typeof this._config.activeStartIndex=="number"&&this._nonDividerOptions[this._config.activeStartIndex]?(this.activateOption(this._config.activeStartIndex,!1),this._adapter.scrollSelectedOptionIntoView(!1)):this._config.selectedValues&&this._config.selectedValues.length?this._adapter.scrollSelectedOptionIntoView(!1):typeof this._config.visibleStartIndex=="number"&&this._nonDividerOptions[this._config.visibleStartIndex]&&this._adapter.scrollOptionIntoView(this._config.visibleStartIndex)}setSelectedValues(e){Array.isArray(e)||(e=[e]),!this._config.multiple&&e.length>1&&(e=[e[0]]),this._config.selectedValues=e,this._adapter.setSelectedValues(e,this._config.multiple)}clearActiveOption(){this._adapter.clearActiveOption()}setOptions(e){this._config.options=e,this._open&&(this._adapter.setOptions(this._config),this.activateInitialOption())}appendOptions(e){this._config.options=[...this._config.options,...e],this._open&&this._adapter.appendOptions(e,this._config)}get dropdownElement(){return this._adapter.dropdownElement}scrollSelectedOptionIntoView(e=!0){this._adapter.scrollSelectedOptionIntoView(e)}setScrollBottomListener(e,t){this._config.scrollEndListener=e,this._config.observeScroll=!0,this._config.observeScrollThreshold=t,this._adapter.setScrollBottomListener(this._scrollEndListener,this._config.observeScrollThreshold||0)}removeScrollBottomListener(){this._config.scrollEndListener=void 0,this._adapter.removeScrollBottomListener(this._scrollEndListener)}setBusyVisibility(e){this._config.allowBusy&&this._adapter.setBusyVisibility(e)}handleKey(e){switch(e){case"Enter":case"NumpadEnter":let t=this.getActiveOptionIndex(),o=this._nonDividerOptions[t];if(this._canSelectOption(o)){let d=this._adapter.getActiveOptionIdByIndex(t);d&&this._onSelect(o.value,d)}break;case"Up":case"ArrowUp":case"Down":case"ArrowDown":let n=this._nonDividerOptions;if(n.length&&n.every(d=>!this._canSelectOption(d)))return;let a=this._getNextActiveOptionIndex(e);this.activateOption(a);break;case"Home":this.activateFirstOption();break;case"End":this.activateLastOption();break}}_canSelectOption(e){return e&&!e.disabled&&!e.divider}_getNextActiveOptionIndex(e){let t=this._adapter.getActiveOptionIndex();return t===-1&&(t=this._adapter.getSelectedOptionIndex()),e==="ArrowUp"||e==="Up"?this._getPreviousHighlightableOptionIndex(t,this._nonDividerOptions):this._getNextHighlightableOptionIndex(t,this._nonDividerOptions)}_getPreviousHighlightableOptionIndex(e,t){let o=e<=0?t.length-1:e-1;return t[o].disabled?this._getPreviousHighlightableOptionIndex(o,t):o}_getNextHighlightableOptionIndex(e,t){let o=e===t.length-1?0:e+1;return t[o].disabled?this._getNextHighlightableOptionIndex(o,t):o}get _flatOptions(){return N(this._config.options)}get _nonDividerOptions(){return this._flatOptions.filter(e=>!e.divider)}};var D=class{constructor(e){this._targetElement=e}get dropdownElement(){return this._dropdownElement}open(e,t,o){this._dropdownElement=oe(e,this._targetElement),this.syncWidth(!!e.syncWidth,e.targetWidthCallback),e.allowBusy&&(this._busyElement=re(),this._busyElement.style.display="none",this._dropdownElement.appendChild(this._busyElement)),e.headerBuilder&&(this._headerElement=e.headerBuilder(),this._headerElement&&this._headerElement.setAttribute(u.attributes.DATA_ALLOW_FOCUS,"")),e.footerBuilder&&(this._footerElement=e.footerBuilder(),this._footerElement&&this._footerElement.setAttribute(u.attributes.DATA_ALLOW_FOCUS,"")),this._listElement=ne(e),this._listElement.addEventListener("forge-list-item-select",n=>{n.detail.listItem.setAttribute("aria-selected","true"),t(n.detail.value,n.detail.listItem.id)}),e.options.length?(y(e,this._listElement),this._dropdownElement.appendChild(this._listElement),this._headerElement&&this._dropdownElement.insertAdjacentElement("afterbegin",this._headerElement),this._footerElement&&this._dropdownElement.appendChild(this._footerElement)):e.allowBusy&&(this._asyncElement=se(e.asyncStyle),this._dropdownElement.appendChild(this._asyncElement)),this._announcerElement=k(),this._announcerElement.id=`${e.id}-activedescendant`,this._dropdownElement.appendChild(this._announcerElement),this._dropdownElement.open=!0}close(){this._dropdownElement&&(this._dropdownElement.open=!1,this._dropdownElement=void 0,this._listElement=void 0,this._announcerElement=void 0)}setScrollBottomListener(e,t){if(this._dropdownElement&&!this._scrollObserver){let o=H(this._dropdownElement,b.selectors.CONTAINER),n={scrollThreshold:t};this._scrollObserver=new w(o,n),this._scrollObserver.addListener(c.ScrolledEnd,e)}}removeScrollBottomListener(e){this._scrollObserver&&this._scrollObserver.removeListener(c.ScrolledEnd,e)}getActiveOptionIndex(){if(!this._dropdownElement)return-1;let e=this._getListItemElements(),t=[...e].reverse().find(o=>o.active);return t?e.indexOf(t):-1}getSelectedOptionIndex(){return this._getListItemElements().findIndex(t=>t.selected)}getActiveOptionIdByIndex(e){if(!this._dropdownElement)return null;let o=this._getListItemElements()[e];return o?o.id:null}toggleOptionMultiple(e,t){if(!this._dropdownElement)return;let o=this._getListItemElements();o.length&&o[e]&&this._toggleSelectedOption(o[e],t)}scrollOptionIntoView(e,t=!0){let o=this._getListItemElements()[e];o&&this._scrollListItemIntoView(o,t?"smooth":"auto","center")}scrollSelectedOptionIntoView(e=!0){let t=this._getSelectedListItem();this._scrollListItemIntoView(t,e?"smooth":"auto","center")}activateSelectedOption(e){let t=this._getListItemElements();t.length&&t.filter(a=>a.active).forEach(a=>a.active=!1);let o=this._getSelectedListItem();o&&this._activateListOption(o,e.activeChangeCallback)}activateOption(e,t,o=!0){if(!this._dropdownElement)return;let n=this._getListItemElements();n.length&&(n.filter(d=>d.active).forEach(d=>d.active=!1),this._activateListOption(n[e],t),this._scrollListItemIntoView(n[e],o?"smooth":"auto"))}setSelectedValues(e,t=!1){if(!this._dropdownElement)return;let o=this._getListItemElements();for(let n of o){let a=e.some(d=>g(d,n.value));if(n.selected=a,t){let d=n.querySelector(`[${u.attributes.CHECKBOX_ELEMENT}]`);if(d){let L=C(a);M(L,d)}}}}clearActiveOption(){this._getListItemElements().forEach(t=>t.active=!1)}syncWidth(e,t){this._dropdownElement&&(this._dropdownElement.style[e?"width":"minWidth"]=`${this._getTargetElementWidth(t)}px`)}setOptions(e){!this._dropdownElement||!this._listElement||(this._asyncElement&&this._asyncElement.isConnected&&U(this._asyncElement),this._busyElement&&(this._busyElement.style.display="none"),this._listElement.isConnected||this._dropdownElement.appendChild(this._listElement),R(this._listElement),y(e,this._listElement),this._headerElement&&!this._headerElement.isConnected&&this._dropdownElement.insertAdjacentElement("afterbegin",this._headerElement),this._footerElement&&!this._footerElement.isConnected&&this._dropdownElement.insertAdjacentElement("beforeend",this._footerElement),"position"in this._dropdownElement&&typeof this._dropdownElement.position=="function"&&this._dropdownElement.position())}appendOptions(e,t){!this._dropdownElement||!this._listElement||y(t,this._listElement,e,this._listElement.childElementCount,!1)}setBusyVisibility(e){this._dropdownElement&&(e?this._busyElement.style.removeProperty("display"):this._busyElement.style.display="none")}getScreenWidth(){return window.innerWidth}_getListItemElements(){return this._dropdownElement?Array.from(this._dropdownElement.querySelectorAll(J.elementName)):[]}_toggleSelectedOption(e,t){if(!this._dropdownElement)return;let o=this._getListItemElements();if(o.length){let a=o.filter(d=>d!==e&&d.active);a.length&&a.forEach(d=>d.active=!1)}e.selected=t,e.setAttribute("aria-selected",`${t}`),e.setAttribute("aria-checked",`${t}`),t&&(e.active=!0);let n=e.querySelector(`${j.elementName}[slot=leading]`);if(n){let a=C(t);M(a,n)}}_getTargetElementWidth(e){return e&&P(e)?e():this._targetElement.getBoundingClientRect().width}_activateListOption(e,t){e&&!e.disabled&&(e.active=!0,t&&P(t)&&t(e.id))}_scrollListItemIntoView(e,t="auto",o="nearest"){if(e&&this._dropdownElement&&this._dropdownElement.isConnected){let n=H(this._dropdownElement,b.selectors.CONTAINER);n&&K(n,e,t,o)}}_getSelectedListItem(){return this._getListItemElements().find(t=>t.selected)}};var pe=class{constructor(e,t){this._targetElement=e;q.define([I,O]),this._foundation=new S(new D(this._targetElement),t)}destroy(){this._foundation.destroy()}open(){this._foundation.open()}close(){this._foundation.close()}getActiveOptionIndex(){return this._foundation.getActiveOptionIndex()}getActiveOption(){return this._foundation.getActiveOption()}toggleOptionMultiple(e,t){return this._foundation.toggleOptionMultiple(e,t)}activateSelectedOption(){this._foundation.activateSelectedOption()}activateFirstOption(){return this._foundation.activateFirstOption()}activateOption(e){return this._foundation.activateOption(e)}activateInitialOption(){return this._foundation.activateInitialOption()}clearActiveOption(){this._foundation.clearActiveOption()}setSelectedValues(e){return this._foundation.setSelectedValues(e)}get dropdownElement(){return this._foundation.dropdownElement}setOptions(e){this._foundation.setOptions(e)}appendOptions(e){this._foundation.appendOptions(e)}scrollSelectedOptionIntoView(e){this._foundation.scrollSelectedOptionIntoView()}setScrollBottomListener(e,t){this._foundation.setScrollBottomListener(e,t)}removeScrollBottomListener(){this._foundation.removeScrollBottomListener()}setBusyVisibility(e){this._foundation.setBusyVisibility(e)}handleKey(e){this._foundation.handleKey(e)}};var T=class{constructor(){this._popupClasses=[];this._syncPopupWidth=!1;this._optionLimit=0;this._observeScroll=!1;this._observeScrollThreshold=0;this._constrainPopupWidth=!0;this._wrapOptionText=!1}get syncPopupWidth(){return this._syncPopupWidth}set syncPopupWidth(e){this._syncPopupWidth=e}get popupClasses(){return this._popupClasses}set popupClasses(e){typeof e=="string"&&(e=[e]),Array.isArray(e)&&(this._popupClasses=e)}get observeScroll(){return this._observeScroll}set observeScroll(e){this._observeScroll=e}get observeScrollThreshold(){return this._observeScrollThreshold}set observeScrollThreshold(e){this._observeScrollThreshold=e}get optionLimit(){return this._optionLimit}set optionLimit(e){this._optionLimit=e}get popupHeaderBuilder(){return this._popupHeaderBuilder}set popupHeaderBuilder(e){this._popupHeaderBuilder=e}get popupFooterBuilder(){return this._popupFooterBuilder}set popupFooterBuilder(e){this._popupFooterBuilder=e}get constrainPopupWidth(){return this._constrainPopupWidth}set constrainPopupWidth(e){this._constrainPopupWidth=e}get wrapOptionText(){return this._wrapOptionText}set wrapOptionText(e){this._wrapOptionText=e}_applySelection(){}};var de=class extends T{constructor(t){super();this._config=t;this._open=!1;this._options=[];this._childOpen=!1;this._popupHasMouse=!1;this._targetMouseEnterListener=o=>this._onTargetMouseEnter(o),this._targetMouseLeaveListener=o=>this._onTargetMouseLeave(o),this._childPopupMouseEnterListener=()=>this._onChildPopupMouseEnter(),this._childPopupMouseLeaveListener=()=>this._onChildPopupMouseLeave(),this._documentMouseMoveListener=o=>this._mouseCoords={x:o.pageX,y:o.pageY}}_onChildPopupMouseEnter(){this._popupHasMouse=!0}_onChildPopupMouseLeave(){this._popupHasMouse=!1,setTimeout(()=>{let t=document.elementFromPoint(this._mouseCoords.x,this._mouseCoords.y);!this._popupHasMouse&&!this._childOpen&&(!t||!this._isOwnElement(t))&&(this._setCascadeTargetInactive(),this._closeDropdown())},this._config.popupTimeout)}_onTargetMouseEnter(t){this._options.length&&this._openDropdown({fromKeyboard:!1})}_onTargetMouseLeave(t){this._activeMouseLeaveTimeout=window.setTimeout(()=>{if(!(!this._open||this._childOpen)){if(this._mouseCoords){let o=document.elementFromPoint(this._mouseCoords.x,this._mouseCoords.y);if(o&&this._isOwnElement(o))return}this._setCascadeTargetInactive(),this._closeDropdown()}},this._config.targetTimeout)}_clearMouseLeaveTimeout(){this._activeMouseLeaveTimeout!==void 0&&window.clearTimeout(this._activeMouseLeaveTimeout)}};export{u as a,Z as b,ee as c,te as d,le as e,S as f,D as g,pe as h,T as i,de as j};
|
|
7
|
+
//# sourceMappingURL=chunk.CL65KLH7.js.map
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* Copyright 2023 Tyler Technologies, Inc.
|
|
4
4
|
* License: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import{a as L}from"./chunk.2QSDH3PC.js";import{b as o}from"./chunk.IWA3CYIB.js";import{a as G}from"./chunk.GHSAKRYH.js";import{h as k,i as P}from"./chunk.SYZB7B4F.js";import{a as V}from"./chunk.7G72CBOJ.js";import{a as d}from"./chunk.NVUMRW44.js";import{a as B}from"./chunk.5V5ABSHI.js";import{i as S}from"./chunk.CFDK4RCW.js";import{a as T,b as c,j as I,k as y,n as x}from"./chunk.J2M2MXP2.js";import{a as b,d as a}from"./chunk.M3QDAYD2.js";var M={VALUE:"value",MULTIPLE:"multiple",OBSERVE_SCROLL:"observe-scroll",OBSERVE_SCROLL_THRESHOLD:"observe-scroll-threshold",POPUP_CLASSES:"popup-classes",OPTION_LIMIT:"option-limit",SYNC_POPUP_WIDTH:"sync-popup-width",CONSTRAIN_POPUP_WIDTH:"constrain-popup-width",WRAP_OPTION_TEXT:"wrap-option-text"},U=b({},M),R={CHANGE:"change"},m={attributes:U,events:R};var N=(e=>(e[e.Option=0]="Option",e[e.Group=1]="Group",e))(N||{});function C(l,O){let e=l.some(i=>w(i)),t=l.some(i=>W(i));return e&&O===1||t&&O===0}function w(l){return c(l)&&I(l)&&l.hasOwnProperty("options")}function W(l){return c(l)&&I(l)&&l.hasOwnProperty("label")&&l.hasOwnProperty("value")}var H=class extends P{constructor(e){super();this._adapter=e;this._options=[];this._value=[];this._multiple=!1;this._open=!1;this._selectedValues=[];this._selectedLabels=[];this._selectedIndexes=[];this._filterString="";this._focusListener=t=>this._onFocus(t),this._blurListener=t=>this._onBlur(t),this._clickListener=t=>this._onClick(t),this._keydownListener=t=>this._onKeydown(t),this._optionsChangedListener=t=>this._onOptionsChanged(t),this._activeChangeListener=t=>this._onActiveOptionChanged(t),this._dropdownScrollEndListener=()=>this._onDropdownScrollEnd(),this._dismissListener=()=>this._onDismiss(),this._identifier=T()}_onFocus(e){}initialize(){this._optionListenerDestructor&&this._optionListenerDestructor(),this._optionListenerDestructor=this._adapter.setOptionsListener(this._optionsChangedListener),this._initializeValue()}initializeTarget(){this._adapter.initializeAccessibility(),this._adapter.setMultiple(this._multiple),this._adapter.addClickListener(this._clickListener),this._adapter.addTargetListener("blur",this._blurListener),this._adapter.addTargetListener("focus",this._focusListener),this._adapter.addTargetListener("keydown",this._keydownListener)}disconnect(){this._adapter.removeClickListener(this._clickListener),this._adapter.removeTargetListener("blur",this._blurListener),this._adapter.removeTargetListener("focus",this._focusListener),this._adapter.removeTargetListener("keydown",this._keydownListener),this._open&&this._closeDropdown(),this._optionListenerDestructor&&this._optionListenerDestructor()}appendOptions(e){this._adapter.setOptions(e,!1),this._open&&this._adapter.appendDropdownOptions(e)}selectAll(){this._multiple&&(this.value=this._flatOptions.map(e=>e.value))}deselectAll(){this._multiple&&(this.value=[])}get _flatOptions(){return C(this._options,1)?[].concat.apply([],this._options.map(e=>e.options)):this._options}get _nonDividerOptions(){return this._flatOptions.filter(e=>!e.divider)}_initializeValue(){let e=this._options.length&&this._options||this._adapter.getOptions();c(this._value)&&e.length&&this._applyValue(this._value)}_onClick(e){e.button===0&&(this._open?this._closeDropdown():this._openDropdown())}_onBlur(e){this._adapter.isFocusWithinPopup(e.relatedTarget)||this._open&&this._closeDropdown()}_openDropdown(){if(this._options=this._adapter.getOptions(),!this._flatOptions.length)return;this._open=!0;let e={options:this._options,multiple:this._multiple,selectedValues:[...this._selectedValues],id:this._identifier,optionBuilder:this._optionBuilder,syncWidth:this._syncPopupWidth,constrainViewportWidth:this._constrainPopupWidth,wrapOptionText:this._wrapOptionText,observeScroll:this._observeScroll,observeScrollThreshold:this._observeScrollThreshold,scrollEndListener:this._dropdownScrollEndListener,activeChangeCallback:this._activeChangeListener,targetWidthCallback:this._targetWidthCallback,popupClasses:this._popupClasses,optionLimit:this._optionLimit,headerBuilder:this._popupHeaderBuilder,footerBuilder:this._popupFooterBuilder,closeCallback:()=>this._closeDropdown(),selectCallback:t=>{let i=this._flatOptions,n=i.find(r=>r.value===t);if(n){let r=i.indexOf(n);this._onSelect(n,r,!0)}}};this._adapter.open(e),this._adapter.setDismissListener(this._dismissListener)}_closeDropdown(){this._open=!1,this._adapter.close()}async _onSelect(e,t,i=!0){return new Promise(async n=>{if(this._valueChanging)return Promise.resolve(!1);let r=e?e.value:"",u=e?e.label:"",v=[...this._value],f=[...this._selectedValues],g=[...this._selectedLabels],D=[...this._selectedIndexes];if(this._multiple)if(this._selectedValues.includes(r)){let h=this._selectedValues.indexOf(r);this._selectedValues.splice(h,1),this._selectedLabels.splice(h,1),this._selectedIndexes.splice(h,1)}else this._selectedValues.push(r),this._selectedLabels.push(u),this._selectedIndexes.push(t);else c(r)?(this._selectedValues[0]=r,this._selectedLabels[0]=u,this._selectedIndexes[0]=t):(this._selectedValues=[],this._selectedLabels=[],this._selectedIndexes=[]);this._value=[...this._selectedValues];let s=()=>{this._selectedValues=[...f],this._selectedLabels=[...g],this._selectedIndexes=[...D],this._value=[...v]},_=()=>{if(this._multiple){let h=this._selectedIndexes.includes(t);this._adapter.toggleOptionMultiple(t,h)}this._applySelection()},E=this.multiple?[...this._selectedValues]:this._selectedValues[0];if(this._open&&i&&!this._multiple&&this._closeDropdown(),typeof this._beforeValueChange=="function"){this._valueChanging=Promise.resolve(this._beforeValueChange.call(null,E));let h=await this._valueChanging;if(this._valueChanging=void 0,!h)return s(),this._tryUpdateDropdownPosition(),n(!1)}let A=!this._adapter.emitHostEvent(m.events.CHANGE,E,!0,!0);A?s():_(),this._tryUpdateDropdownPosition(),n(!A)})}_selectActiveOption(){let e=this._adapter.getActiveOptionIndex();e>=0&&this._nonDividerOptions[e]&&this._onSelect(this._nonDividerOptions[e],e)}_tryUpdateDropdownPosition(){this._open&&this._adapter.queueDropdownPositionUpdate()}_reset(){this._selectedValues=[],this._selectedLabels=[],this._selectedIndexes=[]}_applyValue(e){this._selectedValues=[],this._selectedLabels=[],this._options=this._adapter.getOptions(),Array.isArray(e)||(e=[e]),this._value=[];for(let t of e){this._value.includes(t)||this._value.push(t);let i=this._flatOptions.find(n=>x(n.value,t));i&&(this._selectedValues.push(i.value),this._selectedLabels.push(i.label))}this._selectedIndexes=this._selectedValues.map(t=>this._flatOptions.findIndex(i=>i.value===t)),this._adapter.patchSelectedValues(this._selectedValues)}_onDismiss(){this._closeDropdown()}_getSelectedText(){if(typeof this._selectedTextBuilder=="function"){let e=this._flatOptions.filter(t=>this._selectedValues.includes(t.value));return this._selectedTextBuilder(e)}return this._multiple?this._selectedLabels.length?this._selectedLabels.length===1?this._selectedLabels[0]:`${this._selectedLabels.length} options selected`:"":this._selectedLabels.filter(e=>e&&e.length).join(" ").trim()}_onKeydown(e){let t=e.key==="Escape"||e.keyCode===27,i=e.key==="Enter"||e.keyCode===13,n=e.key==="Space"||e.keyCode===32,r=e.key==="ArrowDown"||e.keyCode===40,u=e.key==="ArrowUp"||e.keyCode===38,v=e.keyCode>=48&&e.keyCode<=90,f=e.key==="Home"||e.keyCode===36,g=e.key==="End"||e.keyCode===35;if(e.key==="Tab"&&this._open&&!this._multiple){this._selectActiveOption();return}if(!v&&this._filterTimeout&&(window.clearTimeout(this._filterTimeout),this._filterString="",this._filterTimeout=void 0),t&&(e.preventDefault(),e.stopPropagation(),this._open)){this._closeDropdown();return}if(n)e.preventDefault(),this._open?this._closeDropdown():this._openDropdown();else if(i)this._open&&(e.stopPropagation(),e.preventDefault(),this._options=this._adapter.getOptions(),this._selectActiveOption());else if(u||r){if(e.preventDefault(),!this._open){this._openDropdown(),this._adapter.activateFirstOption();return}if(this._flatOptions.length===0)return;let s=0;this._open?(s=this._adapter.getActiveOptionIndex(),s===-1&&(s=this._getFirstSelectedOptionIndex())):s=this._getFirstSelectedOptionIndex(),u?s=this._getPreviousHighlightableOptionIndex(s,this._nonDividerOptions):s=this._getNextHighlightableOptionIndex(s,this._nonDividerOptions),this._adapter.highlightActiveOption(s)}else if(f)this._open&&(e.preventDefault(),this._adapter.highlightActiveOption(this._nonDividerOptions.findIndex(s=>!s.disabled)));else if(g){if(this._open){e.preventDefault();let s=this._nonDividerOptions;for(let _=s.length-1;_>=0;_--)if(!s[_].disabled){this._adapter.highlightActiveOption(_);break}}}else v&&this._filter(e.key)}_getFirstSelectedOptionIndex(){return this._nonDividerOptions.findIndex(e=>this._selectedValues.includes(e.value))}_getPreviousHighlightableOptionIndex(e,t){let i=e;return i<=0?i=t.length-1:i--,t[i].disabled?this._getPreviousHighlightableOptionIndex(i,t):i}_getNextHighlightableOptionIndex(e,t){let i=e;return i===t.length-1?i=0:i++,t[i].disabled?this._getNextHighlightableOptionIndex(i,t):i}_filter(e){this._filterTimeout&&(window.clearTimeout(this._filterTimeout),this._filterTimeout=void 0),this._filterString+=e,this._filterTimeout=window.setTimeout(()=>{this._filterString="",this._filterTimeout=void 0},300),this._options=this._adapter.getOptions();let t=this._flatOptions.find(i=>!i.disabled&&i.label.toLowerCase().startsWith(this._filterString.toLowerCase()));if(t){let i=this._flatOptions.indexOf(t);this._open?this._adapter.highlightActiveOption(i):this._multiple||this._onSelect(t,i,!1)}}_onOptionsChanged(e){this._options=e,this._applyValue(this._value)}_onActiveOptionChanged(e){this._adapter.updateActiveDescendant(e)}get value(){return this._multiple?[...this._value]:this._value[0]}set value(e){let t;Array.isArray(e)?t=[...e]:t=e,this._applyValue(t)}get selectedIndex(){return this._multiple?[...this._selectedIndexes]:this._selectedIndexes[0]}set selectedIndex(e){this._options=this._adapter.getOptions();let t;if(Array.isArray(e)?t=[...e]:t=[e],t.sort(),this.multiple)this.value=t.map(i=>this._flatOptions[i]).filter(i=>i).map(i=>i.value);else{let i=this._flatOptions[t[t.length-1]];if(!i)return;this.value=i.value}}get options(){return this._adapter.getOptions()}set options(e){let t;C(e,1)?t=e.map(i=>b({},i)):t=e.map(i=>b({},i)),this._options=t,this._adapter.setOptions(t),this._initializeValue(),this._open&&this._adapter.setDropdownOptions(t)}get multiple(){return this._multiple}set multiple(e){this._multiple!==e&&(this._multiple=e,this._reset(),this._open&&this._closeDropdown(),this._adapter.setMultiple(this._multiple))}get open(){return this._open}set open(e){this._open!==e&&(e?this._openDropdown():this._closeDropdown())}get optionBuilder(){return this._optionBuilder}set optionBuilder(e){this._optionBuilder=e}get selectedTextBuilder(){return this._selectedTextBuilder}set selectedTextBuilder(e){this._selectedTextBuilder=e}get optionLimit(){return this._optionLimit}set optionLimit(e){this._optionLimit=e}get popupClasses(){return this._popupClasses}set popupClasses(e){this._popupClasses=e}get popupHeaderBuilder(){return this._popupHeaderBuilder}set popupHeaderBuilder(e){this._popupHeaderBuilder=e}get popupFooterBuilder(){return this._popupFooterBuilder}set popupFooterBuilder(e){this._popupFooterBuilder=e}get popupElement(){return this._adapter.popupElement}get beforeValueChange(){return this._beforeValueChange}set beforeValueChange(e){this._beforeValueChange=e}};var p=class extends G{constructor(){super()}attributeChangedCallback(e,t,i){switch(super.attributeChangedCallback(e,t,i),e){case m.attributes.MULTIPLE:this.multiple=y(i);break;case m.attributes.VALUE:this.value=i;break}}appendOptions(e){this._foundation.appendOptions(e)}selectAll(){this._foundation.selectAll()}deselectAll(){this._foundation.deselectAll()}connectedCallback(){this._foundation.initialize()}disconnectedCallback(){this._foundation.disconnect()}};a([d()],p.prototype,"value",2),a([d()],p.prototype,"selectedIndex",2),a([d()],p.prototype,"options",2),a([d()],p.prototype,"multiple",2),a([d()],p.prototype,"open",2),a([d()],p.prototype,"optionBuilder",2),a([d()],p.prototype,"selectedTextBuilder",2),a([d()],p.prototype,"beforeValueChange",2),a([d({set:!1})],p.prototype,"popupElement",2);var F=class extends B{constructor(e){super(e)}get popupElement(){var e;return(e=this._listDropdown)==null?void 0:e.dropdownElement}getOptions(){let e=Array.from(this._component.querySelectorAll(L.elementName));if(e.length)return e.map(t=>{let i=Array.from(t.querySelectorAll(o.elementName)),n=this._createOptionsFromElements(i);return{text:t.label,builder:t.builder,value:t.value,options:n}});{let t=Array.from(this._component.querySelectorAll(o.elementName));return this._createOptionsFromElements(t)}}_createOptionsFromElements(e){return e.map(t=>{let i=t.hasAttribute(o.attributes.OPTION_CLASS)?t.getAttribute(o.attributes.OPTION_CLASS):t.optionClass;return typeof i=="string"&&(i=i.split(" ")),{label:t.hasAttribute(o.attributes.LABEL)?t.getAttribute(o.attributes.LABEL):c(t.label)?t.label:t.innerText,value:t.hasAttribute(o.attributes.VALUE)?t.getAttribute(o.attributes.VALUE):t.value,disabled:t.hasAttribute(o.attributes.DISABLED),divider:t.hasAttribute(o.attributes.DIVIDER),optionClass:i,leadingIcon:t.hasAttribute(o.attributes.LEADING_ICON)?t.getAttribute(o.attributes.LEADING_ICON):t.leadingIcon,leadingIconClass:t.hasAttribute(o.attributes.LEADING_ICON_CLASS)?t.getAttribute(o.attributes.LEADING_ICON_CLASS):t.leadingIconClass,leadingIconType:t.hasAttribute(o.attributes.LEADING_ICON_TYPE)?t.getAttribute(o.attributes.LEADING_ICON_TYPE):t.leadingIconType,trailingIcon:t.hasAttribute(o.attributes.TRAILING_ICON)?t.getAttribute(o.attributes.TRAILING_ICON):t.trailingIcon,trailingIconClass:t.hasAttribute(o.attributes.TRAILING_ICON_CLASS)?t.getAttribute(o.attributes.TRAILING_ICON_CLASS):t.trailingIconClass,trailingIconType:t.hasAttribute(o.attributes.TRAILING_ICON_TYPE)?t.getAttribute(o.attributes.TRAILING_ICON_TYPE):t.trailingIconType,leadingBuilder:t.leadingBuilder,trailingBuilder:t.trailingBuilder}})}open(e){this._listDropdown=new k(this._targetElement,e),this._listDropdown.open()}close(){this._listDropdown&&(this._listDropdown.close(),this._listDropdown.destroy(),this._listDropdown=void 0)}setDismissListener(e){if(!this._listDropdown||!this._listDropdown.dropdownElement)return;let t=this._listDropdown.dropdownElement;t.targetElement&&t.targetElement.addEventListener(V.events.BLUR,e)}toggleOptionMultiple(e,t){var i;(i=this._listDropdown)==null||i.toggleOptionMultiple(e,t)}getActiveOptionIndex(){var e,t;return(t=(e=this._listDropdown)==null?void 0:e.getActiveOptionIndex())!=null?t:-1}activateSelectedOption(){var e;(e=this._listDropdown)==null||e.activateSelectedOption()}activateFirstOption(){var e;(e=this._listDropdown)==null||e.activateFirstOption()}highlightActiveOption(e){var t;(t=this._listDropdown)==null||t.activateOption(e)}patchSelectedValues(e){var t;(t=this._listDropdown)==null||t.setSelectedValues(e)}setOptionsListener(e){let t=n=>{n.stopPropagation(),e(this.getOptions())};this._component.addEventListener(o.events.VALUE_CHANGE,t);let i=new MutationObserver(()=>e(this.getOptions()));return i.observe(this._component,{childList:!0,subtree:!0}),()=>{this._component.removeEventListener(o.events.VALUE_CHANGE,t),i.disconnect()}}setOptions(e,t=!0){t&&this._clearOptions();for(let i of e)if(w(i)){let n=this._createOptionGroupElement(i);for(let r of i.options){let u=this._createOptionElement(r);n.appendChild(u)}this._component.appendChild(n)}else{let n=this._createOptionElement(i);this._component.appendChild(n)}}appendDropdownOptions(e){var t;(t=this._listDropdown)==null||t.appendOptions(e)}setDropdownOptions(e){var t;(t=this._listDropdown)==null||t.setOptions(e)}scrollSelectedOptionIntoView(){var e;(e=this._listDropdown)==null||e.scrollSelectedOptionIntoView()}isFocusWithinPopup(e){return!this._listDropdown||!this._listDropdown.dropdownElement?!1:this._listDropdown.dropdownElement.contains(e)}queueDropdownPositionUpdate(){this.popupElement&&window.requestAnimationFrame(()=>{let e=this.popupElement;e==null||e.position()})}_clearOptions(){Array.from(this._component.querySelectorAll(L.elementName)).forEach(i=>S(i)),Array.from(this._component.querySelectorAll(o.elementName)).forEach(i=>S(i))}_createOptionGroupElement(e){let t=document.createElement("forge-option-group");return Object.assign(t,e),t}_createOptionElement(e){let t=document.createElement("forge-option");return Object.assign(t,e),t.textContent=e.label,t}};export{m as a,N as b,C as c,w as d,W as e,H as f,p as g,F as h};
|
|
7
|
-
//# sourceMappingURL=chunk.
|
|
6
|
+
import{a as L}from"./chunk.2QSDH3PC.js";import{b as o}from"./chunk.IWA3CYIB.js";import{a as G}from"./chunk.OKKH7F7M.js";import{h as k,i as P}from"./chunk.CL65KLH7.js";import{a as V}from"./chunk.7G72CBOJ.js";import{a as d}from"./chunk.NVUMRW44.js";import{a as B}from"./chunk.5V5ABSHI.js";import{i as S}from"./chunk.CFDK4RCW.js";import{a as T,b as c,j as I,k as y,n as x}from"./chunk.J2M2MXP2.js";import{a as b,d as a}from"./chunk.M3QDAYD2.js";var M={VALUE:"value",MULTIPLE:"multiple",OBSERVE_SCROLL:"observe-scroll",OBSERVE_SCROLL_THRESHOLD:"observe-scroll-threshold",POPUP_CLASSES:"popup-classes",OPTION_LIMIT:"option-limit",SYNC_POPUP_WIDTH:"sync-popup-width",CONSTRAIN_POPUP_WIDTH:"constrain-popup-width",WRAP_OPTION_TEXT:"wrap-option-text"},U=b({},M),R={CHANGE:"change"},m={attributes:U,events:R};var N=(e=>(e[e.Option=0]="Option",e[e.Group=1]="Group",e))(N||{});function C(l,O){let e=l.some(i=>w(i)),t=l.some(i=>W(i));return e&&O===1||t&&O===0}function w(l){return c(l)&&I(l)&&l.hasOwnProperty("options")}function W(l){return c(l)&&I(l)&&l.hasOwnProperty("label")&&l.hasOwnProperty("value")}var H=class extends P{constructor(e){super();this._adapter=e;this._options=[];this._value=[];this._multiple=!1;this._open=!1;this._selectedValues=[];this._selectedLabels=[];this._selectedIndexes=[];this._filterString="";this._focusListener=t=>this._onFocus(t),this._blurListener=t=>this._onBlur(t),this._clickListener=t=>this._onClick(t),this._keydownListener=t=>this._onKeydown(t),this._optionsChangedListener=t=>this._onOptionsChanged(t),this._activeChangeListener=t=>this._onActiveOptionChanged(t),this._dropdownScrollEndListener=()=>this._onDropdownScrollEnd(),this._dismissListener=()=>this._onDismiss(),this._identifier=T()}_onFocus(e){}initialize(){this._optionListenerDestructor&&this._optionListenerDestructor(),this._optionListenerDestructor=this._adapter.setOptionsListener(this._optionsChangedListener),this._initializeValue()}initializeTarget(){this._adapter.initializeAccessibility(),this._adapter.setMultiple(this._multiple),this._adapter.addClickListener(this._clickListener),this._adapter.addTargetListener("blur",this._blurListener),this._adapter.addTargetListener("focus",this._focusListener),this._adapter.addTargetListener("keydown",this._keydownListener)}disconnect(){this._adapter.removeClickListener(this._clickListener),this._adapter.removeTargetListener("blur",this._blurListener),this._adapter.removeTargetListener("focus",this._focusListener),this._adapter.removeTargetListener("keydown",this._keydownListener),this._open&&this._closeDropdown(),this._optionListenerDestructor&&this._optionListenerDestructor()}appendOptions(e){this._adapter.setOptions(e,!1),this._open&&this._adapter.appendDropdownOptions(e)}selectAll(){this._multiple&&(this.value=this._flatOptions.map(e=>e.value))}deselectAll(){this._multiple&&(this.value=[])}get _flatOptions(){return C(this._options,1)?[].concat.apply([],this._options.map(e=>e.options)):this._options}get _nonDividerOptions(){return this._flatOptions.filter(e=>!e.divider)}_initializeValue(){let e=this._options.length&&this._options||this._adapter.getOptions();c(this._value)&&e.length&&this._applyValue(this._value)}_onClick(e){e.button===0&&(this._open?this._closeDropdown():this._openDropdown())}_onBlur(e){this._adapter.isFocusWithinPopup(e.relatedTarget)||this._open&&this._closeDropdown()}_openDropdown(){if(this._options=this._adapter.getOptions(),!this._flatOptions.length)return;this._open=!0;let e={options:this._options,multiple:this._multiple,selectedValues:[...this._selectedValues],id:this._identifier,optionBuilder:this._optionBuilder,syncWidth:this._syncPopupWidth,constrainViewportWidth:this._constrainPopupWidth,wrapOptionText:this._wrapOptionText,observeScroll:this._observeScroll,observeScrollThreshold:this._observeScrollThreshold,scrollEndListener:this._dropdownScrollEndListener,activeChangeCallback:this._activeChangeListener,targetWidthCallback:this._targetWidthCallback,popupClasses:this._popupClasses,optionLimit:this._optionLimit,headerBuilder:this._popupHeaderBuilder,footerBuilder:this._popupFooterBuilder,closeCallback:()=>this._closeDropdown(),selectCallback:t=>{let i=this._flatOptions,n=i.find(r=>r.value===t);if(n){let r=i.indexOf(n);this._onSelect(n,r,!0)}}};this._adapter.open(e),this._adapter.setDismissListener(this._dismissListener)}_closeDropdown(){this._open=!1,this._adapter.close()}async _onSelect(e,t,i=!0){return new Promise(async n=>{if(this._valueChanging)return Promise.resolve(!1);let r=e?e.value:"",u=e?e.label:"",v=[...this._value],f=[...this._selectedValues],g=[...this._selectedLabels],D=[...this._selectedIndexes];if(this._multiple)if(this._selectedValues.includes(r)){let h=this._selectedValues.indexOf(r);this._selectedValues.splice(h,1),this._selectedLabels.splice(h,1),this._selectedIndexes.splice(h,1)}else this._selectedValues.push(r),this._selectedLabels.push(u),this._selectedIndexes.push(t);else c(r)?(this._selectedValues[0]=r,this._selectedLabels[0]=u,this._selectedIndexes[0]=t):(this._selectedValues=[],this._selectedLabels=[],this._selectedIndexes=[]);this._value=[...this._selectedValues];let s=()=>{this._selectedValues=[...f],this._selectedLabels=[...g],this._selectedIndexes=[...D],this._value=[...v]},_=()=>{if(this._multiple){let h=this._selectedIndexes.includes(t);this._adapter.toggleOptionMultiple(t,h)}this._applySelection()},E=this.multiple?[...this._selectedValues]:this._selectedValues[0];if(this._open&&i&&!this._multiple&&this._closeDropdown(),typeof this._beforeValueChange=="function"){this._valueChanging=Promise.resolve(this._beforeValueChange.call(null,E));let h=await this._valueChanging;if(this._valueChanging=void 0,!h)return s(),this._tryUpdateDropdownPosition(),n(!1)}let A=!this._adapter.emitHostEvent(m.events.CHANGE,E,!0,!0);A?s():_(),this._tryUpdateDropdownPosition(),n(!A)})}_selectActiveOption(){let e=this._adapter.getActiveOptionIndex();e>=0&&this._nonDividerOptions[e]&&this._onSelect(this._nonDividerOptions[e],e)}_tryUpdateDropdownPosition(){this._open&&this._adapter.queueDropdownPositionUpdate()}_reset(){this._selectedValues=[],this._selectedLabels=[],this._selectedIndexes=[]}_applyValue(e){this._selectedValues=[],this._selectedLabels=[],this._options=this._adapter.getOptions(),Array.isArray(e)||(e=[e]),this._value=[];for(let t of e){this._value.includes(t)||this._value.push(t);let i=this._flatOptions.find(n=>x(n.value,t));i&&(this._selectedValues.push(i.value),this._selectedLabels.push(i.label))}this._selectedIndexes=this._selectedValues.map(t=>this._flatOptions.findIndex(i=>i.value===t)),this._adapter.patchSelectedValues(this._selectedValues)}_onDismiss(){this._closeDropdown()}_getSelectedText(){if(typeof this._selectedTextBuilder=="function"){let e=this._flatOptions.filter(t=>this._selectedValues.includes(t.value));return this._selectedTextBuilder(e)}return this._multiple?this._selectedLabels.length?this._selectedLabels.length===1?this._selectedLabels[0]:`${this._selectedLabels.length} options selected`:"":this._selectedLabels.filter(e=>e&&e.length).join(" ").trim()}_onKeydown(e){let t=e.key==="Escape"||e.keyCode===27,i=e.key==="Enter"||e.keyCode===13,n=e.key==="Space"||e.keyCode===32,r=e.key==="ArrowDown"||e.keyCode===40,u=e.key==="ArrowUp"||e.keyCode===38,v=e.keyCode>=48&&e.keyCode<=90,f=e.key==="Home"||e.keyCode===36,g=e.key==="End"||e.keyCode===35;if(e.key==="Tab"&&this._open&&!this._multiple){this._selectActiveOption();return}if(!v&&this._filterTimeout&&(window.clearTimeout(this._filterTimeout),this._filterString="",this._filterTimeout=void 0),t&&(e.preventDefault(),e.stopPropagation(),this._open)){this._closeDropdown();return}if(n)e.preventDefault(),this._open?this._closeDropdown():this._openDropdown();else if(i)this._open&&(e.stopPropagation(),e.preventDefault(),this._options=this._adapter.getOptions(),this._selectActiveOption());else if(u||r){if(e.preventDefault(),!this._open){this._openDropdown(),this._adapter.activateFirstOption();return}if(this._flatOptions.length===0)return;let s=0;this._open?(s=this._adapter.getActiveOptionIndex(),s===-1&&(s=this._getFirstSelectedOptionIndex())):s=this._getFirstSelectedOptionIndex(),u?s=this._getPreviousHighlightableOptionIndex(s,this._nonDividerOptions):s=this._getNextHighlightableOptionIndex(s,this._nonDividerOptions),this._adapter.highlightActiveOption(s)}else if(f)this._open&&(e.preventDefault(),this._adapter.highlightActiveOption(this._nonDividerOptions.findIndex(s=>!s.disabled)));else if(g){if(this._open){e.preventDefault();let s=this._nonDividerOptions;for(let _=s.length-1;_>=0;_--)if(!s[_].disabled){this._adapter.highlightActiveOption(_);break}}}else v&&this._filter(e.key)}_getFirstSelectedOptionIndex(){return this._nonDividerOptions.findIndex(e=>this._selectedValues.includes(e.value))}_getPreviousHighlightableOptionIndex(e,t){let i=e;return i<=0?i=t.length-1:i--,t[i].disabled?this._getPreviousHighlightableOptionIndex(i,t):i}_getNextHighlightableOptionIndex(e,t){let i=e;return i===t.length-1?i=0:i++,t[i].disabled?this._getNextHighlightableOptionIndex(i,t):i}_filter(e){this._filterTimeout&&(window.clearTimeout(this._filterTimeout),this._filterTimeout=void 0),this._filterString+=e,this._filterTimeout=window.setTimeout(()=>{this._filterString="",this._filterTimeout=void 0},300),this._options=this._adapter.getOptions();let t=this._flatOptions.find(i=>!i.disabled&&i.label.toLowerCase().startsWith(this._filterString.toLowerCase()));if(t){let i=this._flatOptions.indexOf(t);this._open?this._adapter.highlightActiveOption(i):this._multiple||this._onSelect(t,i,!1)}}_onOptionsChanged(e){this._options=e,this._applyValue(this._value)}_onActiveOptionChanged(e){this._adapter.updateActiveDescendant(e)}get value(){return this._multiple?[...this._value]:this._value[0]}set value(e){let t;Array.isArray(e)?t=[...e]:t=e,this._applyValue(t)}get selectedIndex(){return this._multiple?[...this._selectedIndexes]:this._selectedIndexes[0]}set selectedIndex(e){this._options=this._adapter.getOptions();let t;if(Array.isArray(e)?t=[...e]:t=[e],t.sort(),this.multiple)this.value=t.map(i=>this._flatOptions[i]).filter(i=>i).map(i=>i.value);else{let i=this._flatOptions[t[t.length-1]];if(!i)return;this.value=i.value}}get options(){return this._adapter.getOptions()}set options(e){let t;C(e,1)?t=e.map(i=>b({},i)):t=e.map(i=>b({},i)),this._options=t,this._adapter.setOptions(t),this._initializeValue(),this._open&&this._adapter.setDropdownOptions(t)}get multiple(){return this._multiple}set multiple(e){this._multiple!==e&&(this._multiple=e,this._reset(),this._open&&this._closeDropdown(),this._adapter.setMultiple(this._multiple))}get open(){return this._open}set open(e){this._open!==e&&(e?this._openDropdown():this._closeDropdown())}get optionBuilder(){return this._optionBuilder}set optionBuilder(e){this._optionBuilder=e}get selectedTextBuilder(){return this._selectedTextBuilder}set selectedTextBuilder(e){this._selectedTextBuilder=e}get optionLimit(){return this._optionLimit}set optionLimit(e){this._optionLimit=e}get popupClasses(){return this._popupClasses}set popupClasses(e){this._popupClasses=e}get popupHeaderBuilder(){return this._popupHeaderBuilder}set popupHeaderBuilder(e){this._popupHeaderBuilder=e}get popupFooterBuilder(){return this._popupFooterBuilder}set popupFooterBuilder(e){this._popupFooterBuilder=e}get popupElement(){return this._adapter.popupElement}get beforeValueChange(){return this._beforeValueChange}set beforeValueChange(e){this._beforeValueChange=e}};var p=class extends G{constructor(){super()}attributeChangedCallback(e,t,i){switch(super.attributeChangedCallback(e,t,i),e){case m.attributes.MULTIPLE:this.multiple=y(i);break;case m.attributes.VALUE:this.value=i;break}}appendOptions(e){this._foundation.appendOptions(e)}selectAll(){this._foundation.selectAll()}deselectAll(){this._foundation.deselectAll()}connectedCallback(){this._foundation.initialize()}disconnectedCallback(){this._foundation.disconnect()}};a([d()],p.prototype,"value",2),a([d()],p.prototype,"selectedIndex",2),a([d()],p.prototype,"options",2),a([d()],p.prototype,"multiple",2),a([d()],p.prototype,"open",2),a([d()],p.prototype,"optionBuilder",2),a([d()],p.prototype,"selectedTextBuilder",2),a([d()],p.prototype,"beforeValueChange",2),a([d({set:!1})],p.prototype,"popupElement",2);var F=class extends B{constructor(e){super(e)}get popupElement(){var e;return(e=this._listDropdown)==null?void 0:e.dropdownElement}getOptions(){let e=Array.from(this._component.querySelectorAll(L.elementName));if(e.length)return e.map(t=>{let i=Array.from(t.querySelectorAll(o.elementName)),n=this._createOptionsFromElements(i);return{text:t.label,builder:t.builder,value:t.value,options:n}});{let t=Array.from(this._component.querySelectorAll(o.elementName));return this._createOptionsFromElements(t)}}_createOptionsFromElements(e){return e.map(t=>{let i=t.hasAttribute(o.attributes.OPTION_CLASS)?t.getAttribute(o.attributes.OPTION_CLASS):t.optionClass;return typeof i=="string"&&(i=i.split(" ")),{label:t.hasAttribute(o.attributes.LABEL)?t.getAttribute(o.attributes.LABEL):c(t.label)?t.label:t.innerText,value:t.hasAttribute(o.attributes.VALUE)?t.getAttribute(o.attributes.VALUE):t.value,disabled:t.hasAttribute(o.attributes.DISABLED),divider:t.hasAttribute(o.attributes.DIVIDER),optionClass:i,leadingIcon:t.hasAttribute(o.attributes.LEADING_ICON)?t.getAttribute(o.attributes.LEADING_ICON):t.leadingIcon,leadingIconClass:t.hasAttribute(o.attributes.LEADING_ICON_CLASS)?t.getAttribute(o.attributes.LEADING_ICON_CLASS):t.leadingIconClass,leadingIconType:t.hasAttribute(o.attributes.LEADING_ICON_TYPE)?t.getAttribute(o.attributes.LEADING_ICON_TYPE):t.leadingIconType,trailingIcon:t.hasAttribute(o.attributes.TRAILING_ICON)?t.getAttribute(o.attributes.TRAILING_ICON):t.trailingIcon,trailingIconClass:t.hasAttribute(o.attributes.TRAILING_ICON_CLASS)?t.getAttribute(o.attributes.TRAILING_ICON_CLASS):t.trailingIconClass,trailingIconType:t.hasAttribute(o.attributes.TRAILING_ICON_TYPE)?t.getAttribute(o.attributes.TRAILING_ICON_TYPE):t.trailingIconType,leadingBuilder:t.leadingBuilder,trailingBuilder:t.trailingBuilder}})}open(e){this._listDropdown=new k(this._targetElement,e),this._listDropdown.open()}close(){this._listDropdown&&(this._listDropdown.close(),this._listDropdown.destroy(),this._listDropdown=void 0)}setDismissListener(e){if(!this._listDropdown||!this._listDropdown.dropdownElement)return;let t=this._listDropdown.dropdownElement;t.targetElement&&t.targetElement.addEventListener(V.events.BLUR,e)}toggleOptionMultiple(e,t){var i;(i=this._listDropdown)==null||i.toggleOptionMultiple(e,t)}getActiveOptionIndex(){var e,t;return(t=(e=this._listDropdown)==null?void 0:e.getActiveOptionIndex())!=null?t:-1}activateSelectedOption(){var e;(e=this._listDropdown)==null||e.activateSelectedOption()}activateFirstOption(){var e;(e=this._listDropdown)==null||e.activateFirstOption()}highlightActiveOption(e){var t;(t=this._listDropdown)==null||t.activateOption(e)}patchSelectedValues(e){var t;(t=this._listDropdown)==null||t.setSelectedValues(e)}setOptionsListener(e){let t=n=>{n.stopPropagation(),e(this.getOptions())};this._component.addEventListener(o.events.VALUE_CHANGE,t);let i=new MutationObserver(()=>e(this.getOptions()));return i.observe(this._component,{childList:!0,subtree:!0}),()=>{this._component.removeEventListener(o.events.VALUE_CHANGE,t),i.disconnect()}}setOptions(e,t=!0){t&&this._clearOptions();for(let i of e)if(w(i)){let n=this._createOptionGroupElement(i);for(let r of i.options){let u=this._createOptionElement(r);n.appendChild(u)}this._component.appendChild(n)}else{let n=this._createOptionElement(i);this._component.appendChild(n)}}appendDropdownOptions(e){var t;(t=this._listDropdown)==null||t.appendOptions(e)}setDropdownOptions(e){var t;(t=this._listDropdown)==null||t.setOptions(e)}scrollSelectedOptionIntoView(){var e;(e=this._listDropdown)==null||e.scrollSelectedOptionIntoView()}isFocusWithinPopup(e){return!this._listDropdown||!this._listDropdown.dropdownElement?!1:this._listDropdown.dropdownElement.contains(e)}queueDropdownPositionUpdate(){this.popupElement&&window.requestAnimationFrame(()=>{let e=this.popupElement;e==null||e.position()})}_clearOptions(){Array.from(this._component.querySelectorAll(L.elementName)).forEach(i=>S(i)),Array.from(this._component.querySelectorAll(o.elementName)).forEach(i=>S(i))}_createOptionGroupElement(e){let t=document.createElement("forge-option-group");return Object.assign(t,e),t}_createOptionElement(e){let t=document.createElement("forge-option");return Object.assign(t,e),t.textContent=e.label,t}};export{m as a,N as b,C as c,w as d,W as e,H as f,p as g,F as h};
|
|
7
|
+
//# sourceMappingURL=chunk.DFGBVJBE.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2023 Tyler Technologies, Inc.
|
|
4
|
+
* License: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import{b,c as z}from"./chunk.SZIM4KFZ.js";import{b as x}from"./chunk.ISC7SZSP.js";import{a as C}from"./chunk.NVUMRW44.js";import{a as w,b as L}from"./chunk.DTZFWZPB.js";import{a as E,e as I,f as m,k as R}from"./chunk.NK7H3MMM.js";import{f as v,g as y,s as k}from"./chunk.CFDK4RCW.js";import{k as _}from"./chunk.J2M2MXP2.js";import{a as g,b as h,d as p}from"./chunk.M3QDAYD2.js";var D=`${L}radio`,A={RADIO:"mdc-radio",RADIO_DENSE:"forge-radio--dense",DISABLED:"mdc-radio--disabled",WRAPPER_DISABLED:"forge-radio-wrapper--disabled",CHECKED:"forge-radio--checked",FOCUSED:"forge-radio--focused",ENABLED:"forge-radio--enabled"},S={WRAPPER:".forge-radio-wrapper",RADIO:".mdc-radio",RADIO_INPUT:'input[type="radio"]',LABEL:"label"},O={DENSE:"dense",ROLE:"role",RADIOGROUP_ROLE:"radiogroup",SLOT:"slot"},N=["checked","disabled"],i={elementName:D,classes:A,selectors:S,attributes:O,inputProperties:N};var d=class{constructor(e){this._adapter=e;this._dense=!1}connect(){this._adapter.connect(),this._adapter.deferRippleInitialization(),this._focusListenerCallback=()=>this._adapter.syncFocusedStateWithInput(),this._disabledListenerCallback=()=>this._adapter.syncDisabledStateWithInput(),this._syncRadiogroupCheckStyles=()=>this._adapter.syncRadiogroupCheckStyles(),this._addFocusEventListeners(),this._addInputDisabledListener(),this._extendNativeInputSetter(),this._addRadioChangeListener(),this._adapter.syncCheckedStateWithInput(),this._adapter.syncDisabledStateWithInput(),this._adapter.syncFocusedStateWithInput(),this._applyDense(),this.syncCheckedState()}disconnect(){this._removeFocusEventListeners(),this._removeInputDisabledListener(),this._adapter.revertNativeInputSetter(),this._removeRadioChangeListener(),this._adapter.destroyRipple()}syncCheckedState(){this._adapter.syncCheckedStateWithInput()}_applyDense(){this._dense?(this._adapter.addRootClass(i.classes.RADIO_DENSE),this._adapter.setHostAttribute(i.attributes.DENSE)):(this._adapter.removeRootClass(i.classes.RADIO_DENSE),this._adapter.removeHostAttribute(i.attributes.DENSE))}_extendNativeInputSetter(){this._adapter.extendNativeInputSetter(this._syncRadiogroupCheckStyles)}_addRadioChangeListener(){this._adapter.addInputEventListener("change",this._syncRadiogroupCheckStyles)}_removeRadioChangeListener(){this._adapter.removeInputEventListener("change",this._syncRadiogroupCheckStyles)}_addFocusEventListeners(){this._adapter.addInputEventListener("focus",this._focusListenerCallback),this._adapter.addInputEventListener("blur",this._focusListenerCallback)}_removeFocusEventListeners(){this._adapter.removeInputEventListener("focus",this._focusListenerCallback),this._adapter.removeInputEventListener("blur",this._focusListenerCallback)}_addInputDisabledListener(){this._adapter.addInputDisabledAttributeChangeListener(this._disabledListenerCallback)}_removeInputDisabledListener(){this._adapter.removeInputDisabledAttributeChangeListener()}get dense(){return this._dense}set dense(e){this._dense!==e&&(this._dense=e,this._applyDense())}};var c=class{constructor(e){this._component=e;this._rootElement=m(this._component,i.selectors.RADIO),this._containerElement=m(this._component,i.selectors.WRAPPER)}get root(){return this._rootElement}get unbounded(){return!0}get disabled(){return this._isDisabled()}connect(){let e=this._component.querySelector(i.selectors.LABEL);e&&e.setAttribute(i.attributes.SLOT,i.selectors.LABEL)}async deferRippleInitialization(){let{userInteraction:e,destroy:t}=x(this._rootElement);this._destroyUserInteractionListener=t;let{type:r}=await e;this._destroyUserInteractionListener=void 0,this._rippleInstance||(this._rippleInstance=this._createRipple(),r==="focusin"&&this._rippleInstance.handleFocus())}destroyRipple(){var e;typeof this._destroyUserInteractionListener=="function"&&(this._destroyUserInteractionListener(),this._destroyUserInteractionListener=void 0),(e=this._rippleInstance)==null||e.destroy(),this._rippleInstance=void 0}setHostAttribute(e,t=""){this._component.setAttribute(e,t)}removeHostAttribute(e){this._component.removeAttribute(e)}addRootClass(e){this._rootElement.classList.add(e)}removeRootClass(e){this._rootElement.classList.remove(e)}addContainerClass(e){this._containerElement.classList.add(e)}removeContainerClass(e){this._containerElement.classList.remove(e)}syncDisabledStateWithInput(){this.inputDisabled?(this.addRootClass(i.classes.DISABLED),this.removeRootClass(i.classes.ENABLED),this.addContainerClass(i.classes.WRAPPER_DISABLED)):(this.addRootClass(i.classes.ENABLED),this.removeRootClass(i.classes.DISABLED),this.removeContainerClass(i.classes.WRAPPER_DISABLED))}syncFocusedStateWithInput(){k()===this._inputElement?this.addRootClass(i.classes.FOCUSED):this.removeRootClass(i.classes.FOCUSED)}syncCheckedStateWithInput(){this.inputChecked?this.addRootClass(i.classes.CHECKED):this.removeRootClass(i.classes.CHECKED)}addInputEventListener(e,t){this._inputElement&&this._inputElement.addEventListener(e,t)}removeInputEventListener(e,t){this._inputElement&&this._inputElement.removeEventListener(e,t)}addInputDisabledAttributeChangeListener(e){this._setupInputDisabledAttributeMutationObserver(e)}removeInputDisabledAttributeChangeListener(){this._cleanupInputDisabledAttributeMutationObserver()}getRadiosFromContainingRadiogroup(){let e=this._getContainingRadioGroup(this._component);return e==null?null:e.querySelectorAll(i.elementName)}syncRadiogroupCheckStyles(){let e=this.getRadiosFromContainingRadiogroup();e&&e.forEach(t=>t.syncCheckedState())}extendNativeInputSetter(e){if(!this._inputElement)return;let t=this._inputElement,r=Object.getPrototypeOf(t);i.inputProperties.forEach(o=>{let a=Object.getOwnPropertyDescriptor(r,o);if(this._validPropertyDescriptor(a)&&a){let f={configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:l=>{var s;(s=a.set)==null||s.call(t,l),e()}};Object.defineProperty(t,o,f)}})}revertNativeInputSetter(){if(!this._inputElement)return;let e=this._inputElement,t=Object.getPrototypeOf(e);i.inputProperties.forEach(r=>{let o=Object.getOwnPropertyDescriptor(t,r);this._validPropertyDescriptor(o)&&Object.defineProperty(e,r,o)})}_validPropertyDescriptor(e){return!!e&&typeof e.set=="function"}_getContainingRadioGroup(e){if(!e||!e.parentElement)throw new Error('Unable to locate ancestor element with role="radiogroup". When using radios, a parent with this attribute must be applied.');let t=e.parentElement,r=t.getAttribute(i.attributes.ROLE);return r&&r.toLocaleLowerCase()===i.attributes.RADIOGROUP_ROLE.toLocaleLowerCase()?t:this._getContainingRadioGroup(t)}_setupInputDisabledAttributeMutationObserver(e){if(!this._inputElement)return;this._cleanupInputDisabledAttributeMutationObserver();let t=o=>this._inputDisabledAttributeMutationCallback(o,e);this._inputAttributeMutationObserver=new MutationObserver(t);let r={attributes:!0,attributeOldValue:!0,attributeFilter:["disabled"]};this._inputAttributeMutationObserver.observe(this._inputElement,r)}_cleanupInputDisabledAttributeMutationObserver(){this._inputAttributeMutationObserver&&(this._inputAttributeMutationObserver.disconnect(),delete this._inputAttributeMutationObserver)}_inputDisabledAttributeMutationCallback(e,t){for(let r of e)r.type!=="attributes"||!r.attributeName||r.attributeName!=="disabled"||r.target[r.attributeName]===r.oldValue||t()}get inputDisabled(){return this._inputElement?this._inputElement.disabled:!1}get inputChecked(){return this._inputElement?this._inputElement.checked:!1}get _inputElement(){return this._nativeInputElement||(this._nativeInputElement=this._component.querySelector(i.selectors.RADIO_INPUT)),this._nativeInputElement}_isDisabled(){return this._inputElement?this._inputElement.disabled:!1}_createRipple(){let e=h(g({},b.createAdapter(this)),{deregisterInteractionHandler:(t,r)=>{this._inputElement&&this._inputElement.removeEventListener(t,r,{passive:!0})},isSurfaceActive:()=>this._inputElement?this._inputElement.matches(":active"):!1,isUnbounded:()=>!!this.unbounded,registerInteractionHandler:(t,r)=>{this._inputElement&&this._inputElement.addEventListener(t,r,{passive:!0})},isSurfaceDisabled:()=>this._inputElement?this._inputElement.disabled:!1,addClass:t=>v(t,this._rootElement),removeClass:t=>y(t,this._rootElement),updateCssVariable:(t,r)=>this._rootElement.style.setProperty(t,r)});return new b(this._rootElement,new z(e))}};var P='<template><div class="forge-radio-wrapper forge-form-field" part="root"><div class="mdc-radio" part="container"><slot></slot><div class="mdc-radio__background" part="background"><div class="mdc-radio__outer-circle" part="outer-circle"></div><div class="mdc-radio__inner-circle" part="inner-circle"></div></div><div class="mdc-radio__ripple" part="ripple-container"></div></div><slot name="label"></slot></div></template>',M='.mdc-radio{padding:10px;display:inline-block;position:relative;-webkit-box-flex:0;flex:0 0 auto;-webkit-box-sizing:content-box;box-sizing:content-box;width:20px;height:20px;cursor:pointer;will-change:opacity,transform,border-color,color}.mdc-radio.forge-radio--enabled .mdc-radio__background .mdc-radio__outer-circle{border-color:rgba(0,0,0,.54);border-color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.mdc-radio.forge-radio--enabled.forge-radio--checked .mdc-radio__background .mdc-radio__outer-circle{border-color:#3d5afe;border-color:var(--forge-theme-tertiary,#3d5afe)}.mdc-radio.forge-radio--enabled .mdc-radio__background .mdc-radio__inner-circle{border-color:#3d5afe;border-color:var(--forge-theme-tertiary,#3d5afe)}.mdc-radio.mdc-radio--disabled .mdc-radio__background .mdc-radio__outer-circle{border-color:rgba(0,0,0,.26);border-color:var(--forge-theme-form-field-icon-disabled-on-background,rgba(0,0,0,.26))}.mdc-radio.mdc-radio--disabled.forge-radio--checked .mdc-radio__background .mdc-radio__outer-circle{border-color:rgba(0,0,0,.26);border-color:var(--forge-theme-form-field-icon-disabled-on-background,rgba(0,0,0,.26))}.mdc-radio.mdc-radio--disabled .mdc-radio__background .mdc-radio__inner-circle{border-color:rgba(0,0,0,.26);border-color:var(--forge-theme-form-field-icon-disabled-on-background,rgba(0,0,0,.26))}.mdc-radio .mdc-radio__background::before{background-color:#3d5afe;background-color:var(--forge-theme-tertiary,#3d5afe)}.mdc-radio .mdc-radio__background::before{top:-10px;left:-10px;width:40px;height:40px}.mdc-radio .mdc-radio__native-control{top:0;right:0;left:0;width:40px;height:40px}@media screen and (forced-colors:active),(-ms-high-contrast:active){.mdc-radio.mdc-radio--disabled .mdc-radio__background .mdc-radio__outer-circle{border-color:GrayText}.mdc-radio.mdc-radio--disabled.forge-radio--checked .mdc-radio__background .mdc-radio__outer-circle{border-color:GrayText}.mdc-radio.mdc-radio--disabled .mdc-radio__background .mdc-radio__inner-circle{border-color:GrayText}}.mdc-radio__background{display:inline-block;position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;width:20px;height:20px}.mdc-radio__background::before{position:absolute;-webkit-transform:scale(0,0);transform:scale(0,0);border-radius:50%;opacity:0;pointer-events:none;content:"";-webkit-transition:opacity 120ms 0s cubic-bezier(.4, 0, .6, 1),-webkit-transform 120ms 0s cubic-bezier(.4, 0, .6, 1);transition:opacity 120ms 0s cubic-bezier(.4, 0, .6, 1),-webkit-transform 120ms 0s cubic-bezier(.4, 0, .6, 1);transition:opacity 120ms 0s cubic-bezier(.4, 0, .6, 1),transform 120ms 0s cubic-bezier(.4, 0, .6, 1);transition:opacity 120ms 0s cubic-bezier(.4, 0, .6, 1),transform 120ms 0s cubic-bezier(.4, 0, .6, 1),-webkit-transform 120ms 0s cubic-bezier(.4, 0, .6, 1)}.mdc-radio__outer-circle{position:absolute;top:0;left:0;-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;height:100%;border-width:2px;border-style:solid;border-radius:50%;-webkit-transition:border-color 120ms 0s cubic-bezier(.4, 0, .6, 1);transition:border-color 120ms 0s cubic-bezier(.4, 0, .6, 1)}.mdc-radio__inner-circle{position:absolute;top:0;left:0;-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;height:100%;-webkit-transform:scale(0,0);transform:scale(0,0);border-width:10px;border-style:solid;border-radius:50%;-webkit-transition:border-color 120ms 0s cubic-bezier(.4, 0, .6, 1),-webkit-transform 120ms 0s cubic-bezier(.4, 0, .6, 1);transition:border-color 120ms 0s cubic-bezier(.4, 0, .6, 1),-webkit-transform 120ms 0s cubic-bezier(.4, 0, .6, 1);transition:transform 120ms 0s cubic-bezier(.4, 0, .6, 1),border-color 120ms 0s cubic-bezier(.4, 0, .6, 1);transition:transform 120ms 0s cubic-bezier(.4, 0, .6, 1),border-color 120ms 0s cubic-bezier(.4, 0, .6, 1),-webkit-transform 120ms 0s cubic-bezier(.4, 0, .6, 1)}.mdc-radio ::slotted(input[type=radio]){position:absolute;margin:0;padding:0;opacity:0;cursor:inherit;z-index:1;top:0;right:0;left:0;width:40px;height:40px}.mdc-radio.forge-radio--dense{padding:4px;margin:0}.mdc-radio.forge-radio--dense .mdc-radio__background::before{top:-4px;left:-4px;width:28px;height:28px}.mdc-radio.forge-radio--dense .mdc-radio__native-control{top:0;right:0;left:0;width:28px;height:28px}.mdc-radio.forge-radio--dense ::slotted(input[type=radio]){width:28px;height:28px}.mdc-radio--disabled+::slotted(label){color:rgba(0,0,0,.38);color:var(--forge-theme-label-disabled-on-background,rgba(0,0,0,.38))}.forge-radio--checked .mdc-radio__background,.mdc-radio--disabled .mdc-radio__background{-webkit-transition:opacity 120ms 0s cubic-bezier(0, 0, .2, 1),-webkit-transform 120ms 0s cubic-bezier(0, 0, .2, 1);transition:opacity 120ms 0s cubic-bezier(0, 0, .2, 1),-webkit-transform 120ms 0s cubic-bezier(0, 0, .2, 1);transition:opacity 120ms 0s cubic-bezier(0, 0, .2, 1),transform 120ms 0s cubic-bezier(0, 0, .2, 1);transition:opacity 120ms 0s cubic-bezier(0, 0, .2, 1),transform 120ms 0s cubic-bezier(0, 0, .2, 1),-webkit-transform 120ms 0s cubic-bezier(0, 0, .2, 1)}.forge-radio--checked .mdc-radio__background .mdc-radio__outer-circle,.mdc-radio--disabled .mdc-radio__background .mdc-radio__outer-circle{-webkit-transition:border-color 120ms 0s cubic-bezier(0, 0, .2, 1);transition:border-color 120ms 0s cubic-bezier(0, 0, .2, 1)}.forge-radio--checked .mdc-radio__background .mdc-radio__inner-circle,.mdc-radio--disabled .mdc-radio__background .mdc-radio__inner-circle{-webkit-transition:border-color 120ms 0s cubic-bezier(0, 0, .2, 1),-webkit-transform 120ms 0s cubic-bezier(0, 0, .2, 1);transition:border-color 120ms 0s cubic-bezier(0, 0, .2, 1),-webkit-transform 120ms 0s cubic-bezier(0, 0, .2, 1);transition:transform 120ms 0s cubic-bezier(0, 0, .2, 1),border-color 120ms 0s cubic-bezier(0, 0, .2, 1);transition:transform 120ms 0s cubic-bezier(0, 0, .2, 1),border-color 120ms 0s cubic-bezier(0, 0, .2, 1),-webkit-transform 120ms 0s cubic-bezier(0, 0, .2, 1)}.mdc-radio--disabled{cursor:default;pointer-events:none}.forge-radio--checked .mdc-radio__background .mdc-radio__inner-circle{-webkit-transform:scale(.5);transform:scale(.5);-webkit-transition:border-color 120ms 0s cubic-bezier(0, 0, .2, 1),-webkit-transform 120ms 0s cubic-bezier(0, 0, .2, 1);transition:border-color 120ms 0s cubic-bezier(0, 0, .2, 1),-webkit-transform 120ms 0s cubic-bezier(0, 0, .2, 1);transition:transform 120ms 0s cubic-bezier(0, 0, .2, 1),border-color 120ms 0s cubic-bezier(0, 0, .2, 1);transition:transform 120ms 0s cubic-bezier(0, 0, .2, 1),border-color 120ms 0s cubic-bezier(0, 0, .2, 1),-webkit-transform 120ms 0s cubic-bezier(0, 0, .2, 1)}.mdc-radio--disabled .mdc-radio__background{cursor:default}.forge-radio--focused .mdc-radio__background::before{-webkit-transform:scale(1);transform:scale(1);opacity:.12;-webkit-transition:opacity 120ms 0s cubic-bezier(0, 0, .2, 1),-webkit-transform 120ms 0s cubic-bezier(0, 0, .2, 1);transition:opacity 120ms 0s cubic-bezier(0, 0, .2, 1),-webkit-transform 120ms 0s cubic-bezier(0, 0, .2, 1);transition:opacity 120ms 0s cubic-bezier(0, 0, .2, 1),transform 120ms 0s cubic-bezier(0, 0, .2, 1);transition:opacity 120ms 0s cubic-bezier(0, 0, .2, 1),transform 120ms 0s cubic-bezier(0, 0, .2, 1),-webkit-transform 120ms 0s cubic-bezier(0, 0, .2, 1)}@-webkit-keyframes mdc-ripple-fg-radius-in{from{-webkit-animation-timing-function:cubic-bezier(0.4,0,0.2,1);animation-timing-function:cubic-bezier(0.4,0,0.2,1);-webkit-transform:translate(var(--mdc-ripple-fg-translate-start,0)) scale(1);transform:translate(var(--mdc-ripple-fg-translate-start,0)) scale(1)}to{-webkit-transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1));transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1))}}@keyframes mdc-ripple-fg-radius-in{from{-webkit-animation-timing-function:cubic-bezier(0.4,0,0.2,1);animation-timing-function:cubic-bezier(0.4,0,0.2,1);-webkit-transform:translate(var(--mdc-ripple-fg-translate-start,0)) scale(1);transform:translate(var(--mdc-ripple-fg-translate-start,0)) scale(1)}to{-webkit-transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1));transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1))}}@-webkit-keyframes mdc-ripple-fg-opacity-in{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@keyframes mdc-ripple-fg-opacity-in{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@-webkit-keyframes mdc-ripple-fg-opacity-out{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}@keyframes mdc-ripple-fg-opacity-out{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}.mdc-radio{--mdc-ripple-fg-size:0;--mdc-ripple-left:0;--mdc-ripple-top:0;--mdc-ripple-fg-scale:1;--mdc-ripple-fg-translate-end:0;--mdc-ripple-fg-translate-start:0;-webkit-tap-highlight-color:transparent;will-change:transform,opacity}.mdc-radio .mdc-radio__ripple::after,.mdc-radio .mdc-radio__ripple::before{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:""}.mdc-radio .mdc-radio__ripple::before{-webkit-transition:opacity 15ms linear,background-color 15ms linear;transition:opacity 15ms linear,background-color 15ms linear;z-index:1;z-index:var(--mdc-ripple-z-index,1)}.mdc-radio .mdc-radio__ripple::after{z-index:0;z-index:var(--mdc-ripple-z-index,0)}.mdc-radio.mdc-ripple-upgraded .mdc-radio__ripple::before{-webkit-transform:scale(var(--mdc-ripple-fg-scale,1));transform:scale(var(--mdc-ripple-fg-scale,1))}.mdc-radio.mdc-ripple-upgraded .mdc-radio__ripple::after{top:0;left:0;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:center center;transform-origin:center center}.mdc-radio.mdc-ripple-upgraded--unbounded .mdc-radio__ripple::after{top:var(--mdc-ripple-top,0);left:var(--mdc-ripple-left,0)}.mdc-radio.mdc-ripple-upgraded--foreground-activation .mdc-radio__ripple::after{-webkit-animation:mdc-ripple-fg-radius-in 225ms forwards,mdc-ripple-fg-opacity-in 75ms forwards;animation:mdc-ripple-fg-radius-in 225ms forwards,mdc-ripple-fg-opacity-in 75ms forwards}.mdc-radio.mdc-ripple-upgraded--foreground-deactivation .mdc-radio__ripple::after{-webkit-animation:mdc-ripple-fg-opacity-out 150ms;animation:mdc-ripple-fg-opacity-out 150ms;-webkit-transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1));transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1))}.mdc-radio .mdc-radio__ripple::after,.mdc-radio .mdc-radio__ripple::before{top:calc(50% - 50%);left:calc(50% - 50%);width:100%;height:100%}.mdc-radio.mdc-ripple-upgraded .mdc-radio__ripple::after,.mdc-radio.mdc-ripple-upgraded .mdc-radio__ripple::before{top:var(--mdc-ripple-top,calc(50% - 50%));left:var(--mdc-ripple-left,calc(50% - 50%));width:var(--mdc-ripple-fg-size,100%);height:var(--mdc-ripple-fg-size,100%)}.mdc-radio.mdc-ripple-upgraded .mdc-radio__ripple::after{width:var(--mdc-ripple-fg-size,100%);height:var(--mdc-ripple-fg-size,100%)}.mdc-radio .mdc-radio__ripple::after,.mdc-radio .mdc-radio__ripple::before{background-color:#3d5afe;background-color:var(--forge-theme-tertiary,#3d5afe)}.mdc-radio.mdc-ripple-surface--hover .mdc-radio__ripple::before,.mdc-radio:hover .mdc-radio__ripple::before{opacity:.04;opacity:var(--mdc-ripple-hover-opacity, .04)}.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__ripple::before,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__ripple::before{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.12;opacity:var(--mdc-ripple-focus-opacity, .12)}.mdc-radio:not(.mdc-ripple-upgraded) .mdc-radio__ripple::after{-webkit-transition:opacity 150ms linear;transition:opacity 150ms linear}.mdc-radio:not(.mdc-ripple-upgraded):active .mdc-radio__ripple::after{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.12;opacity:var(--mdc-ripple-press-opacity, .12)}.mdc-radio.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-radio.mdc-ripple-upgraded .mdc-radio__background::before,.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__background::before{content:none}.mdc-radio__ripple{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.forge-radio-wrapper--disabled{cursor:not-allowed}.forge-radio-wrapper--disabled ::slotted(label){cursor:not-allowed}.forge-form-field{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-body2-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.875rem;font-size:var(--mdc-typography-body2-font-size, .875rem);line-height:1.25rem;line-height:var(--mdc-typography-body2-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-body2-font-weight,400);letter-spacing:.0178571429em;letter-spacing:var(--mdc-typography-body2-letter-spacing, .0178571429em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-body2-text-decoration,inherit);text-decoration:var(--mdc-typography-body2-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-body2-text-transform,inherit);color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87));display:-webkit-inline-box;display:inline-flex;-webkit-box-align:center;align-items:center;vertical-align:middle}.forge-form-field ::slotted([slot=label]){-webkit-box-ordinal-group:1;order:0;margin-right:auto;padding-left:4px}.forge-form-field forge-switch~::slotted([slot=label]){padding-left:8px}.forge-form-field--align-end ::slotted([slot=label]){-webkit-box-ordinal-group:0;order:-1;margin-left:auto;padding-right:4px}:host{display:inline-block}:host([hidden]){display:none}',n=class extends R{constructor(){super();I(this,P,M),this._foundation=new d(new c(this))}static get observedAttributes(){return[i.attributes.DENSE]}connectedCallback(){this._ensureRadioInputElement().then(()=>this._foundation.connect())}disconnectedCallback(){this._foundation.disconnect()}attributeChangedCallback(t,r,o){switch(t){case i.attributes.DENSE:this.dense=_(o);break}}_ensureRadioInputElement(){return new Promise(t=>{if(this.querySelector(i.selectors.RADIO_INPUT)){t();return}let o=new MutationObserver(a=>{a.reduce((l,s)=>l+s.addedNodes.length,0)>0&&this.querySelector(i.selectors.RADIO_INPUT)&&(o.disconnect(),t())});o.observe(this,{childList:!0,subtree:!0})})}syncCheckedState(){this._foundation.syncCheckedState()}};p([C()],n.prototype,"dense",2),n=p([w({name:i.elementName})],n);function ae(){E(n)}export{i as a,n as b,ae as c};
|
|
7
|
+
//# sourceMappingURL=chunk.DXZ5LVFJ.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/radio/radio-constants.ts", "../../src/radio/radio-foundation.ts", "../../src/radio/radio-adapter.ts", "../../src/radio/radio.ts", "../../src/radio/index.ts"],
|
|
4
|
+
"sourcesContent": ["import { COMPONENT_NAME_PREFIX } from '../constants';\n\nconst elementName: keyof HTMLElementTagNameMap = `${COMPONENT_NAME_PREFIX}radio`;\n\nconst classes = {\n RADIO: 'mdc-radio',\n RADIO_DENSE: 'forge-radio--dense',\n DISABLED: 'mdc-radio--disabled',\n WRAPPER_DISABLED: 'forge-radio-wrapper--disabled',\n CHECKED: 'forge-radio--checked',\n FOCUSED: 'forge-radio--focused',\n ENABLED: 'forge-radio--enabled'\n};\n\nconst selectors = {\n WRAPPER: '.forge-radio-wrapper',\n RADIO: '.mdc-radio',\n RADIO_INPUT: 'input[type=\"radio\"]',\n LABEL: 'label'\n};\n\nconst attributes = {\n DENSE: 'dense',\n ROLE: 'role',\n RADIOGROUP_ROLE: 'radiogroup',\n SLOT: 'slot'\n};\n\nconst inputProperties = ['checked', 'disabled'];\n\nexport const RADIO_CONSTANTS = {\n elementName,\n classes,\n selectors,\n attributes,\n inputProperties\n};\n", "import { ICustomElementFoundation } from '@tylertech/forge-core';\n\nimport { IRadioAdapter } from './radio-adapter';\nimport { RADIO_CONSTANTS } from './radio-constants';\n\nexport interface IRadioFoundation extends ICustomElementFoundation {\n dense: boolean;\n}\n\nexport class RadioFoundation implements IRadioFoundation {\n private _dense = false;\n private _focusListenerCallback: () => void;\n private _disabledListenerCallback: () => void;\n private _syncRadiogroupCheckStyles: () => void;\n\n constructor(private _adapter: IRadioAdapter) {}\n\n public connect(): void {\n this._adapter.connect();\n this._adapter.deferRippleInitialization();\n this._focusListenerCallback = () => this._adapter.syncFocusedStateWithInput();\n this._disabledListenerCallback = () => this._adapter.syncDisabledStateWithInput();\n this._syncRadiogroupCheckStyles = () => this._adapter.syncRadiogroupCheckStyles();\n this._addFocusEventListeners();\n this._addInputDisabledListener();\n this._extendNativeInputSetter();\n this._addRadioChangeListener();\n this._adapter.syncCheckedStateWithInput();\n this._adapter.syncDisabledStateWithInput();\n this._adapter.syncFocusedStateWithInput();\n this._applyDense();\n this.syncCheckedState();\n }\n\n public disconnect(): void {\n this._removeFocusEventListeners();\n this._removeInputDisabledListener();\n this._adapter.revertNativeInputSetter();\n this._removeRadioChangeListener();\n this._adapter.destroyRipple();\n }\n\n public syncCheckedState(): void {\n this._adapter.syncCheckedStateWithInput();\n }\n\n private _applyDense(): void {\n if (this._dense) {\n this._adapter.addRootClass(RADIO_CONSTANTS.classes.RADIO_DENSE);\n this._adapter.setHostAttribute(RADIO_CONSTANTS.attributes.DENSE);\n } else {\n this._adapter.removeRootClass(RADIO_CONSTANTS.classes.RADIO_DENSE);\n this._adapter.removeHostAttribute(RADIO_CONSTANTS.attributes.DENSE);\n }\n }\n\n private _extendNativeInputSetter(): void {\n this._adapter.extendNativeInputSetter(this._syncRadiogroupCheckStyles);\n }\n\n private _addRadioChangeListener(): void {\n this._adapter.addInputEventListener('change', this._syncRadiogroupCheckStyles);\n }\n\n private _removeRadioChangeListener(): void {\n this._adapter.removeInputEventListener('change', this._syncRadiogroupCheckStyles);\n }\n\n private _addFocusEventListeners(): void {\n this._adapter.addInputEventListener('focus', this._focusListenerCallback);\n this._adapter.addInputEventListener('blur', this._focusListenerCallback);\n }\n\n private _removeFocusEventListeners(): void {\n this._adapter.removeInputEventListener('focus', this._focusListenerCallback);\n this._adapter.removeInputEventListener('blur', this._focusListenerCallback);\n }\n\n private _addInputDisabledListener(): void {\n this._adapter.addInputDisabledAttributeChangeListener(this._disabledListenerCallback);\n }\n\n private _removeInputDisabledListener(): void {\n this._adapter.removeInputDisabledAttributeChangeListener();\n }\n\n public get dense(): boolean {\n return this._dense;\n }\n public set dense(value: boolean) {\n if (this._dense !== value) {\n this._dense = value;\n this._applyDense();\n }\n }\n}\n", "import { addClass, getShadowElement, removeClass, getActiveElement } from '@tylertech/forge-core';\nimport { IRadioComponent } from './radio';\nimport { RADIO_CONSTANTS } from './radio-constants';\nimport { ForgeRipple, ForgeRippleAdapter, ForgeRippleCapableSurface, ForgeRippleFoundation } from '../ripple';\nimport { createUserInteractionListener } from '../core/utils';\n\nexport interface IRadioAdapter {\n connect(): void;\n deferRippleInitialization(): Promise<void>;\n destroyRipple(): void;\n setHostAttribute(name: string, value?: string): void;\n removeHostAttribute(name: string): void;\n addRootClass(className: string): void;\n removeRootClass(className: string): void;\n addContainerClass(className: string): void;\n removeContainerClass(className: string): void;\n syncCheckedStateWithInput(): void;\n syncFocusedStateWithInput(): void;\n syncDisabledStateWithInput(): void;\n addInputEventListener(event: string, callback: (event: Event) => void): void;\n removeInputEventListener(event: string, callback: (event: Event) => void): void;\n addInputDisabledAttributeChangeListener(callback: () => void): void;\n removeInputDisabledAttributeChangeListener(): void;\n extendNativeInputSetter(callback: () => void): void;\n revertNativeInputSetter(): void;\n syncRadiogroupCheckStyles(): void;\n}\n\nexport class RadioAdapter implements IRadioAdapter, ForgeRippleCapableSurface {\n private _rootElement: HTMLElement;\n private _containerElement: HTMLElement;\n private _nativeInputElement: HTMLInputElement | null;\n private _inputAttributeMutationObserver?: MutationObserver;\n private _rippleInstance: ForgeRipple | undefined;\n private _destroyUserInteractionListener: (() => void) | undefined;\n\n constructor(private _component: IRadioComponent) {\n this._rootElement = getShadowElement(this._component, RADIO_CONSTANTS.selectors.RADIO);\n this._containerElement = getShadowElement(this._component, RADIO_CONSTANTS.selectors.WRAPPER);\n }\n\n // ForgeRippleCapableSurface\n public get root(): Element {\n return this._rootElement;\n }\n\n public get unbounded(): boolean | undefined {\n return true;\n }\n\n public get disabled(): boolean | undefined {\n return this._isDisabled();\n }\n\n public connect(): void {\n const labelElement = this._component.querySelector(RADIO_CONSTANTS.selectors.LABEL) as HTMLLabelElement;\n if (labelElement) {\n labelElement.setAttribute(RADIO_CONSTANTS.attributes.SLOT, RADIO_CONSTANTS.selectors.LABEL);\n }\n }\n\n public async deferRippleInitialization(): Promise<void> {\n const { userInteraction, destroy } = createUserInteractionListener(this._rootElement);\n this._destroyUserInteractionListener = destroy;\n const { type } = await userInteraction;\n this._destroyUserInteractionListener = undefined;\n if (!this._rippleInstance) {\n this._rippleInstance = this._createRipple();\n if (type === 'focusin') {\n this._rippleInstance.handleFocus();\n }\n }\n }\n\n public destroyRipple(): void {\n if (typeof this._destroyUserInteractionListener === 'function') {\n this._destroyUserInteractionListener();\n this._destroyUserInteractionListener = undefined;\n }\n\n this._rippleInstance?.destroy();\n this._rippleInstance = undefined;\n }\n\n public setHostAttribute(name: string, value = ''): void {\n this._component.setAttribute(name, value);\n }\n\n public removeHostAttribute(name: string): void {\n this._component.removeAttribute(name);\n }\n\n public addRootClass(className: string): void {\n this._rootElement.classList.add(className);\n }\n\n public removeRootClass(className: string): void {\n this._rootElement.classList.remove(className);\n }\n\n public addContainerClass(className: string): void {\n this._containerElement.classList.add(className);\n }\n\n public removeContainerClass(className: string): void {\n this._containerElement.classList.remove(className);\n }\n\n public syncDisabledStateWithInput(): void {\n if (this.inputDisabled) {\n this.addRootClass(RADIO_CONSTANTS.classes.DISABLED);\n this.removeRootClass(RADIO_CONSTANTS.classes.ENABLED);\n this.addContainerClass(RADIO_CONSTANTS.classes.WRAPPER_DISABLED);\n } else {\n this.addRootClass(RADIO_CONSTANTS.classes.ENABLED);\n this.removeRootClass(RADIO_CONSTANTS.classes.DISABLED);\n this.removeContainerClass(RADIO_CONSTANTS.classes.WRAPPER_DISABLED);\n }\n }\n\n public syncFocusedStateWithInput(): void {\n if (getActiveElement() === this._inputElement) {\n this.addRootClass(RADIO_CONSTANTS.classes.FOCUSED);\n } else {\n this.removeRootClass(RADIO_CONSTANTS.classes.FOCUSED);\n }\n }\n\n public syncCheckedStateWithInput(): void {\n if (this.inputChecked) {\n this.addRootClass(RADIO_CONSTANTS.classes.CHECKED);\n } else {\n this.removeRootClass(RADIO_CONSTANTS.classes.CHECKED);\n }\n }\n\n public addInputEventListener(event: string, callback: (event: Event) => void): void {\n if (!this._inputElement) {\n return;\n }\n\n this._inputElement.addEventListener(event, callback);\n }\n\n public removeInputEventListener(event: string, callback: (event: Event) => void): void {\n if (!this._inputElement) {\n return;\n }\n\n this._inputElement.removeEventListener(event, callback);\n }\n\n public addInputDisabledAttributeChangeListener(callback: () => void): void {\n this._setupInputDisabledAttributeMutationObserver(callback);\n }\n\n public removeInputDisabledAttributeChangeListener(): void {\n this._cleanupInputDisabledAttributeMutationObserver();\n }\n\n // Get the collection of all forge-radios under the containing radiogroup ancestor.\n public getRadiosFromContainingRadiogroup(): NodeListOf<IRadioComponent> | null {\n const radioGroup = this._getContainingRadioGroup(this._component);\n if (radioGroup == null) {\n return null;\n }\n\n return radioGroup.querySelectorAll(RADIO_CONSTANTS.elementName);\n }\n\n public syncRadiogroupCheckStyles(): void {\n const radios = this.getRadiosFromContainingRadiogroup();\n if (radios) {\n radios.forEach(x => x.syncCheckedState());\n }\n }\n\n public extendNativeInputSetter(callback: () => void): void {\n if (!this._inputElement) {\n return;\n }\n\n const nativeInput = this._inputElement;\n const inputProto = Object.getPrototypeOf(nativeInput);\n RADIO_CONSTANTS.inputProperties.forEach(controlState => {\n const desc = Object.getOwnPropertyDescriptor(inputProto, controlState) as PropertyDescriptor;\n // We have to check for this descriptor, since some browsers (Safari) don't support its return.\n // See: https://bugs.webkit.org/show_bug.cgi?id=49739\n if (!this._validPropertyDescriptor(desc)) {\n return;\n }\n\n if (desc) {\n const nativeInputDesc = {\n configurable: desc.configurable,\n enumerable: desc.enumerable,\n get: desc.get,\n set: (state: boolean) => {\n desc.set?.call(nativeInput, state);\n callback();\n }\n };\n Object.defineProperty(nativeInput, controlState, nativeInputDesc);\n }\n });\n }\n\n public revertNativeInputSetter(): void {\n if (!this._inputElement) {\n return;\n }\n\n const nativeInput = this._inputElement;\n const inputProto = Object.getPrototypeOf(nativeInput);\n RADIO_CONSTANTS.inputProperties.forEach(controlState => {\n const desc = Object.getOwnPropertyDescriptor(inputProto, controlState) as PropertyDescriptor;\n // We have to check for this descriptor, since some browsers (Safari) don't support its return.\n // See: https://bugs.webkit.org/show_bug.cgi?id=49739\n if (!this._validPropertyDescriptor(desc)) {\n return;\n }\n Object.defineProperty(nativeInput, controlState, desc);\n });\n }\n\n private _validPropertyDescriptor(inputPropDesc: PropertyDescriptor | undefined): boolean {\n return !!inputPropDesc && typeof inputPropDesc.set === 'function';\n }\n\n // Recursively crawl up the node tree looking for the containing radiogroup ancestor element.\n private _getContainingRadioGroup(element: HTMLElement): HTMLElement | null {\n if (!element || !element.parentElement) {\n throw new Error('Unable to locate ancestor element with role=\"radiogroup\". When using radios, a parent with this attribute must be applied.');\n }\n\n const parentElement = element.parentElement;\n const roleValue = parentElement.getAttribute(RADIO_CONSTANTS.attributes.ROLE);\n if (!!roleValue && roleValue.toLocaleLowerCase() === RADIO_CONSTANTS.attributes.RADIOGROUP_ROLE.toLocaleLowerCase()) {\n return parentElement;\n }\n\n return this._getContainingRadioGroup(parentElement);\n }\n\n private _setupInputDisabledAttributeMutationObserver(callback: () => void): void {\n if (!this._inputElement) {\n return;\n }\n\n this._cleanupInputDisabledAttributeMutationObserver();\n const mutationCallback = (mutationRecords: MutationRecord[]): void => this._inputDisabledAttributeMutationCallback(mutationRecords, callback);\n this._inputAttributeMutationObserver = new MutationObserver(mutationCallback);\n const mutationOptions: MutationObserverInit = {\n attributes: true,\n attributeOldValue: true,\n attributeFilter: ['disabled']\n };\n this._inputAttributeMutationObserver.observe(this._inputElement, mutationOptions);\n }\n\n private _cleanupInputDisabledAttributeMutationObserver(): void {\n if (this._inputAttributeMutationObserver) {\n this._inputAttributeMutationObserver.disconnect();\n delete this._inputAttributeMutationObserver;\n }\n }\n\n private _inputDisabledAttributeMutationCallback(mutationRecords: MutationRecord[], callback: () => void): void {\n for (const mutationRecord of mutationRecords) {\n // Skip:\n // - Non-attribute mutations.\n // - Mutations without an attribute name.\n // - Mutations without a matching attribute name.\n // - Mutations that did not change the attribute value.\n if (mutationRecord.type !== 'attributes'\n || !mutationRecord.attributeName\n || mutationRecord.attributeName !== 'disabled'\n || mutationRecord.target[mutationRecord.attributeName] === mutationRecord.oldValue) {\n continue;\n }\n\n callback();\n }\n }\n\n public get inputDisabled(): boolean {\n if (!this._inputElement) {\n return false;\n }\n\n return this._inputElement.disabled;\n }\n\n public get inputChecked(): boolean {\n if (!this._inputElement) {\n return false;\n }\n\n return this._inputElement.checked;\n }\n\n private get _inputElement(): HTMLInputElement | null {\n if (!this._nativeInputElement) {\n this._nativeInputElement = this._component.querySelector<HTMLInputElement>(RADIO_CONSTANTS.selectors.RADIO_INPUT);\n }\n\n return this._nativeInputElement;\n }\n\n private _isDisabled(): boolean {\n return this._inputElement ? this._inputElement.disabled : false;\n }\n\n private _createRipple(): ForgeRipple {\n const adapter: ForgeRippleAdapter = {\n ...ForgeRipple.createAdapter(this),\n deregisterInteractionHandler: (evtType, handler) => {\n if (this._inputElement) {\n this._inputElement.removeEventListener(evtType, handler, { passive: true } as AddEventListenerOptions);\n }\n },\n isSurfaceActive: () => this._inputElement ? this._inputElement.matches(':active') : false,\n isUnbounded: () => Boolean(this.unbounded),\n registerInteractionHandler: (evtType, handler) => {\n if (this._inputElement) {\n this._inputElement.addEventListener(evtType, handler, { passive: true });\n }\n },\n isSurfaceDisabled: () => this._inputElement ? this._inputElement.disabled : false,\n addClass: (className: string) => addClass(className, this._rootElement),\n removeClass: (className: string) => removeClass(className, this._rootElement),\n updateCssVariable: (varName: string, value: string | null) => this._rootElement.style.setProperty(varName, value)\n };\n return new ForgeRipple(this._rootElement, new ForgeRippleFoundation(adapter));\n }\n}\n", "import { CustomElement, attachShadowTemplate, FoundationProperty, coerceBoolean } from '@tylertech/forge-core';\nimport { RADIO_CONSTANTS } from './radio-constants';\nimport { RadioFoundation } from './radio-foundation';\nimport { RadioAdapter } from './radio-adapter';\nimport { BaseComponent, IBaseComponent } from '../core/base/base-component';\n\nconst template = '<template><div class=\\\"forge-radio-wrapper forge-form-field\\\" part=\\\"root\\\"><div class=\\\"mdc-radio\\\" part=\\\"container\\\"><slot></slot><div class=\\\"mdc-radio__background\\\" part=\\\"background\\\"><div class=\\\"mdc-radio__outer-circle\\\" part=\\\"outer-circle\\\"></div><div class=\\\"mdc-radio__inner-circle\\\" part=\\\"inner-circle\\\"></div></div><div class=\\\"mdc-radio__ripple\\\" part=\\\"ripple-container\\\"></div></div><slot name=\\\"label\\\"></slot></div></template>';\nconst styles = '.mdc-radio{padding:10px;display:inline-block;position:relative;-webkit-box-flex:0;flex:0 0 auto;-webkit-box-sizing:content-box;box-sizing:content-box;width:20px;height:20px;cursor:pointer;will-change:opacity,transform,border-color,color}.mdc-radio.forge-radio--enabled .mdc-radio__background .mdc-radio__outer-circle{border-color:rgba(0,0,0,.54);border-color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.mdc-radio.forge-radio--enabled.forge-radio--checked .mdc-radio__background .mdc-radio__outer-circle{border-color:#3d5afe;border-color:var(--forge-theme-tertiary,#3d5afe)}.mdc-radio.forge-radio--enabled .mdc-radio__background .mdc-radio__inner-circle{border-color:#3d5afe;border-color:var(--forge-theme-tertiary,#3d5afe)}.mdc-radio.mdc-radio--disabled .mdc-radio__background .mdc-radio__outer-circle{border-color:rgba(0,0,0,.26);border-color:var(--forge-theme-form-field-icon-disabled-on-background,rgba(0,0,0,.26))}.mdc-radio.mdc-radio--disabled.forge-radio--checked .mdc-radio__background .mdc-radio__outer-circle{border-color:rgba(0,0,0,.26);border-color:var(--forge-theme-form-field-icon-disabled-on-background,rgba(0,0,0,.26))}.mdc-radio.mdc-radio--disabled .mdc-radio__background .mdc-radio__inner-circle{border-color:rgba(0,0,0,.26);border-color:var(--forge-theme-form-field-icon-disabled-on-background,rgba(0,0,0,.26))}.mdc-radio .mdc-radio__background::before{background-color:#3d5afe;background-color:var(--forge-theme-tertiary,#3d5afe)}.mdc-radio .mdc-radio__background::before{top:-10px;left:-10px;width:40px;height:40px}.mdc-radio .mdc-radio__native-control{top:0;right:0;left:0;width:40px;height:40px}@media screen and (forced-colors:active),(-ms-high-contrast:active){.mdc-radio.mdc-radio--disabled .mdc-radio__background .mdc-radio__outer-circle{border-color:GrayText}.mdc-radio.mdc-radio--disabled.forge-radio--checked .mdc-radio__background .mdc-radio__outer-circle{border-color:GrayText}.mdc-radio.mdc-radio--disabled .mdc-radio__background .mdc-radio__inner-circle{border-color:GrayText}}.mdc-radio__background{display:inline-block;position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;width:20px;height:20px}.mdc-radio__background::before{position:absolute;-webkit-transform:scale(0,0);transform:scale(0,0);border-radius:50%;opacity:0;pointer-events:none;content:\\\"\\\";-webkit-transition:opacity 120ms 0s cubic-bezier(.4, 0, .6, 1),-webkit-transform 120ms 0s cubic-bezier(.4, 0, .6, 1);transition:opacity 120ms 0s cubic-bezier(.4, 0, .6, 1),-webkit-transform 120ms 0s cubic-bezier(.4, 0, .6, 1);transition:opacity 120ms 0s cubic-bezier(.4, 0, .6, 1),transform 120ms 0s cubic-bezier(.4, 0, .6, 1);transition:opacity 120ms 0s cubic-bezier(.4, 0, .6, 1),transform 120ms 0s cubic-bezier(.4, 0, .6, 1),-webkit-transform 120ms 0s cubic-bezier(.4, 0, .6, 1)}.mdc-radio__outer-circle{position:absolute;top:0;left:0;-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;height:100%;border-width:2px;border-style:solid;border-radius:50%;-webkit-transition:border-color 120ms 0s cubic-bezier(.4, 0, .6, 1);transition:border-color 120ms 0s cubic-bezier(.4, 0, .6, 1)}.mdc-radio__inner-circle{position:absolute;top:0;left:0;-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;height:100%;-webkit-transform:scale(0,0);transform:scale(0,0);border-width:10px;border-style:solid;border-radius:50%;-webkit-transition:border-color 120ms 0s cubic-bezier(.4, 0, .6, 1),-webkit-transform 120ms 0s cubic-bezier(.4, 0, .6, 1);transition:border-color 120ms 0s cubic-bezier(.4, 0, .6, 1),-webkit-transform 120ms 0s cubic-bezier(.4, 0, .6, 1);transition:transform 120ms 0s cubic-bezier(.4, 0, .6, 1),border-color 120ms 0s cubic-bezier(.4, 0, .6, 1);transition:transform 120ms 0s cubic-bezier(.4, 0, .6, 1),border-color 120ms 0s cubic-bezier(.4, 0, .6, 1),-webkit-transform 120ms 0s cubic-bezier(.4, 0, .6, 1)}.mdc-radio ::slotted(input[type=radio]){position:absolute;margin:0;padding:0;opacity:0;cursor:inherit;z-index:1;top:0;right:0;left:0;width:40px;height:40px}.mdc-radio.forge-radio--dense{padding:4px;margin:0}.mdc-radio.forge-radio--dense .mdc-radio__background::before{top:-4px;left:-4px;width:28px;height:28px}.mdc-radio.forge-radio--dense .mdc-radio__native-control{top:0;right:0;left:0;width:28px;height:28px}.mdc-radio.forge-radio--dense ::slotted(input[type=radio]){width:28px;height:28px}.mdc-radio--disabled+::slotted(label){color:rgba(0,0,0,.38);color:var(--forge-theme-label-disabled-on-background,rgba(0,0,0,.38))}.forge-radio--checked .mdc-radio__background,.mdc-radio--disabled .mdc-radio__background{-webkit-transition:opacity 120ms 0s cubic-bezier(0, 0, .2, 1),-webkit-transform 120ms 0s cubic-bezier(0, 0, .2, 1);transition:opacity 120ms 0s cubic-bezier(0, 0, .2, 1),-webkit-transform 120ms 0s cubic-bezier(0, 0, .2, 1);transition:opacity 120ms 0s cubic-bezier(0, 0, .2, 1),transform 120ms 0s cubic-bezier(0, 0, .2, 1);transition:opacity 120ms 0s cubic-bezier(0, 0, .2, 1),transform 120ms 0s cubic-bezier(0, 0, .2, 1),-webkit-transform 120ms 0s cubic-bezier(0, 0, .2, 1)}.forge-radio--checked .mdc-radio__background .mdc-radio__outer-circle,.mdc-radio--disabled .mdc-radio__background .mdc-radio__outer-circle{-webkit-transition:border-color 120ms 0s cubic-bezier(0, 0, .2, 1);transition:border-color 120ms 0s cubic-bezier(0, 0, .2, 1)}.forge-radio--checked .mdc-radio__background .mdc-radio__inner-circle,.mdc-radio--disabled .mdc-radio__background .mdc-radio__inner-circle{-webkit-transition:border-color 120ms 0s cubic-bezier(0, 0, .2, 1),-webkit-transform 120ms 0s cubic-bezier(0, 0, .2, 1);transition:border-color 120ms 0s cubic-bezier(0, 0, .2, 1),-webkit-transform 120ms 0s cubic-bezier(0, 0, .2, 1);transition:transform 120ms 0s cubic-bezier(0, 0, .2, 1),border-color 120ms 0s cubic-bezier(0, 0, .2, 1);transition:transform 120ms 0s cubic-bezier(0, 0, .2, 1),border-color 120ms 0s cubic-bezier(0, 0, .2, 1),-webkit-transform 120ms 0s cubic-bezier(0, 0, .2, 1)}.mdc-radio--disabled{cursor:default;pointer-events:none}.forge-radio--checked .mdc-radio__background .mdc-radio__inner-circle{-webkit-transform:scale(.5);transform:scale(.5);-webkit-transition:border-color 120ms 0s cubic-bezier(0, 0, .2, 1),-webkit-transform 120ms 0s cubic-bezier(0, 0, .2, 1);transition:border-color 120ms 0s cubic-bezier(0, 0, .2, 1),-webkit-transform 120ms 0s cubic-bezier(0, 0, .2, 1);transition:transform 120ms 0s cubic-bezier(0, 0, .2, 1),border-color 120ms 0s cubic-bezier(0, 0, .2, 1);transition:transform 120ms 0s cubic-bezier(0, 0, .2, 1),border-color 120ms 0s cubic-bezier(0, 0, .2, 1),-webkit-transform 120ms 0s cubic-bezier(0, 0, .2, 1)}.mdc-radio--disabled .mdc-radio__background{cursor:default}.forge-radio--focused .mdc-radio__background::before{-webkit-transform:scale(1);transform:scale(1);opacity:.12;-webkit-transition:opacity 120ms 0s cubic-bezier(0, 0, .2, 1),-webkit-transform 120ms 0s cubic-bezier(0, 0, .2, 1);transition:opacity 120ms 0s cubic-bezier(0, 0, .2, 1),-webkit-transform 120ms 0s cubic-bezier(0, 0, .2, 1);transition:opacity 120ms 0s cubic-bezier(0, 0, .2, 1),transform 120ms 0s cubic-bezier(0, 0, .2, 1);transition:opacity 120ms 0s cubic-bezier(0, 0, .2, 1),transform 120ms 0s cubic-bezier(0, 0, .2, 1),-webkit-transform 120ms 0s cubic-bezier(0, 0, .2, 1)}@-webkit-keyframes mdc-ripple-fg-radius-in{from{-webkit-animation-timing-function:cubic-bezier(0.4,0,0.2,1);animation-timing-function:cubic-bezier(0.4,0,0.2,1);-webkit-transform:translate(var(--mdc-ripple-fg-translate-start,0)) scale(1);transform:translate(var(--mdc-ripple-fg-translate-start,0)) scale(1)}to{-webkit-transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1));transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1))}}@keyframes mdc-ripple-fg-radius-in{from{-webkit-animation-timing-function:cubic-bezier(0.4,0,0.2,1);animation-timing-function:cubic-bezier(0.4,0,0.2,1);-webkit-transform:translate(var(--mdc-ripple-fg-translate-start,0)) scale(1);transform:translate(var(--mdc-ripple-fg-translate-start,0)) scale(1)}to{-webkit-transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1));transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1))}}@-webkit-keyframes mdc-ripple-fg-opacity-in{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@keyframes mdc-ripple-fg-opacity-in{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@-webkit-keyframes mdc-ripple-fg-opacity-out{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}@keyframes mdc-ripple-fg-opacity-out{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}.mdc-radio{--mdc-ripple-fg-size:0;--mdc-ripple-left:0;--mdc-ripple-top:0;--mdc-ripple-fg-scale:1;--mdc-ripple-fg-translate-end:0;--mdc-ripple-fg-translate-start:0;-webkit-tap-highlight-color:transparent;will-change:transform,opacity}.mdc-radio .mdc-radio__ripple::after,.mdc-radio .mdc-radio__ripple::before{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:\\\"\\\"}.mdc-radio .mdc-radio__ripple::before{-webkit-transition:opacity 15ms linear,background-color 15ms linear;transition:opacity 15ms linear,background-color 15ms linear;z-index:1;z-index:var(--mdc-ripple-z-index,1)}.mdc-radio .mdc-radio__ripple::after{z-index:0;z-index:var(--mdc-ripple-z-index,0)}.mdc-radio.mdc-ripple-upgraded .mdc-radio__ripple::before{-webkit-transform:scale(var(--mdc-ripple-fg-scale,1));transform:scale(var(--mdc-ripple-fg-scale,1))}.mdc-radio.mdc-ripple-upgraded .mdc-radio__ripple::after{top:0;left:0;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:center center;transform-origin:center center}.mdc-radio.mdc-ripple-upgraded--unbounded .mdc-radio__ripple::after{top:var(--mdc-ripple-top,0);left:var(--mdc-ripple-left,0)}.mdc-radio.mdc-ripple-upgraded--foreground-activation .mdc-radio__ripple::after{-webkit-animation:mdc-ripple-fg-radius-in 225ms forwards,mdc-ripple-fg-opacity-in 75ms forwards;animation:mdc-ripple-fg-radius-in 225ms forwards,mdc-ripple-fg-opacity-in 75ms forwards}.mdc-radio.mdc-ripple-upgraded--foreground-deactivation .mdc-radio__ripple::after{-webkit-animation:mdc-ripple-fg-opacity-out 150ms;animation:mdc-ripple-fg-opacity-out 150ms;-webkit-transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1));transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1))}.mdc-radio .mdc-radio__ripple::after,.mdc-radio .mdc-radio__ripple::before{top:calc(50% - 50%);left:calc(50% - 50%);width:100%;height:100%}.mdc-radio.mdc-ripple-upgraded .mdc-radio__ripple::after,.mdc-radio.mdc-ripple-upgraded .mdc-radio__ripple::before{top:var(--mdc-ripple-top,calc(50% - 50%));left:var(--mdc-ripple-left,calc(50% - 50%));width:var(--mdc-ripple-fg-size,100%);height:var(--mdc-ripple-fg-size,100%)}.mdc-radio.mdc-ripple-upgraded .mdc-radio__ripple::after{width:var(--mdc-ripple-fg-size,100%);height:var(--mdc-ripple-fg-size,100%)}.mdc-radio .mdc-radio__ripple::after,.mdc-radio .mdc-radio__ripple::before{background-color:#3d5afe;background-color:var(--forge-theme-tertiary,#3d5afe)}.mdc-radio.mdc-ripple-surface--hover .mdc-radio__ripple::before,.mdc-radio:hover .mdc-radio__ripple::before{opacity:.04;opacity:var(--mdc-ripple-hover-opacity, .04)}.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__ripple::before,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__ripple::before{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.12;opacity:var(--mdc-ripple-focus-opacity, .12)}.mdc-radio:not(.mdc-ripple-upgraded) .mdc-radio__ripple::after{-webkit-transition:opacity 150ms linear;transition:opacity 150ms linear}.mdc-radio:not(.mdc-ripple-upgraded):active .mdc-radio__ripple::after{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.12;opacity:var(--mdc-ripple-press-opacity, .12)}.mdc-radio.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-radio.mdc-ripple-upgraded .mdc-radio__background::before,.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__background::before{content:none}.mdc-radio__ripple{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.forge-radio-wrapper--disabled{cursor:not-allowed}.forge-radio-wrapper--disabled ::slotted(label){cursor:not-allowed}.forge-form-field{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-body2-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.875rem;font-size:var(--mdc-typography-body2-font-size, .875rem);line-height:1.25rem;line-height:var(--mdc-typography-body2-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-body2-font-weight,400);letter-spacing:.0178571429em;letter-spacing:var(--mdc-typography-body2-letter-spacing, .0178571429em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-body2-text-decoration,inherit);text-decoration:var(--mdc-typography-body2-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-body2-text-transform,inherit);color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87));display:-webkit-inline-box;display:inline-flex;-webkit-box-align:center;align-items:center;vertical-align:middle}.forge-form-field ::slotted([slot=label]){-webkit-box-ordinal-group:1;order:0;margin-right:auto;padding-left:4px}.forge-form-field forge-switch~::slotted([slot=label]){padding-left:8px}.forge-form-field--align-end ::slotted([slot=label]){-webkit-box-ordinal-group:0;order:-1;margin-left:auto;padding-right:4px}:host{display:inline-block}:host([hidden]){display:none}';\n\nexport interface IRadioComponent extends IBaseComponent {\n dense: boolean;\n syncCheckedState(): void;\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'forge-radio': IRadioComponent;\n }\n}\n\n/**\n * The custom element class behind the `<forge-radio>` element.\n * \n * @tag forge-radio\n */\n@CustomElement({\n name: RADIO_CONSTANTS.elementName\n})\nexport class RadioComponent extends BaseComponent implements IRadioComponent {\n public static get observedAttributes(): string[] {\n return [\n RADIO_CONSTANTS.attributes.DENSE\n ];\n }\n\n protected _foundation: RadioFoundation;\n\n constructor() {\n super();\n attachShadowTemplate(this, template, styles);\n this._foundation = new RadioFoundation(new RadioAdapter(this));\n }\n\n public connectedCallback(): void {\n this._ensureRadioInputElement().then(() => this._foundation.connect());\n }\n\n public disconnectedCallback(): void {\n this._foundation.disconnect();\n }\n\n public attributeChangedCallback(name: string, oldValue: string, newValue: string): void {\n switch (name) {\n case RADIO_CONSTANTS.attributes.DENSE:\n this.dense = coerceBoolean(newValue);\n break;\n }\n }\n\n private _ensureRadioInputElement(): Promise<void> {\n // Not using core function ensureChild because it was not selecting the input properly\n return new Promise<void>(resolve => {\n const element = this.querySelector(RADIO_CONSTANTS.selectors.RADIO_INPUT);\n if (element) {\n resolve();\n return;\n }\n\n const observer = new MutationObserver(changes => {\n const hasAddedNodes = changes.reduce((prev, curr) => prev + curr.addedNodes.length, 0) > 0;\n if (hasAddedNodes) {\n if (this.querySelector(RADIO_CONSTANTS.selectors.RADIO_INPUT)) {\n observer.disconnect();\n resolve();\n }\n }\n });\n observer.observe(this, { childList: true, subtree: true });\n });\n }\n\n public syncCheckedState(): void {\n this._foundation.syncCheckedState();\n }\n\n /** Gets/sets whether the radio button is dense. */\n @FoundationProperty()\n public declare dense: boolean;\n}\n", "import { defineCustomElement } from '@tylertech/forge-core';\n\nimport { RadioComponent } from './radio';\n\nexport * from './radio-constants';\nexport * from './radio';\n\nexport function defineRadioComponent(): void {\n defineCustomElement(RadioComponent);\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["elementName", "COMPONENT_NAME_PREFIX", "classes", "selectors", "attributes", "inputProperties", "RADIO_CONSTANTS", "RadioFoundation", "_adapter", "RADIO_CONSTANTS", "value", "RadioAdapter", "_component", "getShadowElement", "RADIO_CONSTANTS", "labelElement", "userInteraction", "destroy", "createUserInteractionListener", "type", "_a", "name", "value", "className", "getActiveElement", "event", "callback", "radioGroup", "radios", "x", "nativeInput", "inputProto", "controlState", "desc", "nativeInputDesc", "state", "inputPropDesc", "element", "parentElement", "roleValue", "mutationCallback", "mutationRecords", "mutationOptions", "mutationRecord", "adapter", "__spreadProps", "__spreadValues", "ForgeRipple", "evtType", "handler", "addClass", "removeClass", "varName", "ForgeRippleFoundation", "template", "styles", "RadioComponent", "BaseComponent", "attachShadowTemplate", "RadioFoundation", "RadioAdapter", "RADIO_CONSTANTS", "name", "oldValue", "newValue", "coerceBoolean", "resolve", "observer", "changes", "prev", "curr", "__decorateClass", "FoundationProperty", "CustomElement", "defineRadioComponent", "defineCustomElement", "RadioComponent"]
|
|
7
|
+
}
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* Copyright 2023 Tyler Technologies, Inc.
|
|
4
4
|
* License: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import{a as z,b as B,c as H,d as K,e as U}from"./chunk.TXFYS6EU.js";import{E as S}from"./chunk.24L5GDD2.js";import{a}from"./chunk.44IUAOBP.js";import{F as O}from"./chunk.V6JVHYVW.js";import{e as w}from"./chunk.7G72CBOJ.js";import{a as _}from"./chunk.PHTOULRR.js";import{e as v}from"./chunk.UV3WIHCM.js";import{a as V}from"./chunk.MGLWXAZO.js";import{b as N}from"./chunk.A5R7KUIP.js";import{l as A}from"./chunk.FYWPZFLJ.js";import{d as R,l as x}from"./chunk.H5D54EHO.js";import{b as T}from"./chunk.XIQFHO5R.js";import{e as p}from"./chunk.DMCBAYQX.js";import{a as L}from"./chunk.G4IN6Y46.js";import{a as E}from"./chunk.NVUMRW44.js";import{a as M,b as F}from"./chunk.DTZFWZPB.js";import{a as y,e as P,h as D}from"./chunk.NK7H3MMM.js";import{s as k}from"./chunk.CFDK4RCW.js";import{f as g,g as b}from"./chunk.J2M2MXP2.js";import{d as h}from"./chunk.M3QDAYD2.js";var d=`${F}date-range-picker`,m=class u{constructor(r){r&&(this.from=r.from,this.to=r.to)}copy(){return new u(this)}},q={FROM:"from",TO:"to",END_VALUE:"end-value"},G={INPUT:"input"},W={CHANGE:`${d}-change`,OPEN:`${d}-open`,CLOSE:`${d}-close`,INPUT:`${d}-input`},n={elementName:d,selectors:G,events:W,observedAttributes:q};var c=class extends K{constructor(t){super(t);this._dropdownIdentifier=`forge-date-range-picker-${this._identifier}`}_initializeInput(){if(this._fromInputElement=this._component.querySelectorAll(n.selectors.INPUT)[0],this._toInputElement=this._component.querySelectorAll(n.selectors.INPUT)[1],!this._fromInputElement||!this._fromInputElement)throw new Error(`The ${n.elementName} requires two inputs`)}_initializeCalendarDropdown(){let t=this._getDefaultTargetElement();this._calendarDropdown=new O(t,this._dropdownIdentifier)}initializeMask(t){var e;(e=this._fromInputMask)==null||e.destroy(),this._fromInputMask=new T(this._fromInputElement,t)}destroyMask(){var t;(t=this._fromInputMask)==null||t.destroy(),this._fromInputMask=void 0}initializeToMask(t){var e;(e=this._toInputMask)==null||e.destroy(),this._toInputMask=new T(this._toInputElement,t)}destroyToMask(){var t;(t=this._toInputMask)==null||t.destroy(),this._toInputMask=void 0}destroy(){super.destroy(),this._destroyToValueChangeListener()}_destroyToValueChangeListener(){typeof this._toValueChangeListener=="function"&&this._toValueChangeListener()}initializeAccessibility(){this._applyToInputs(t=>t.setAttribute("autocomplete","off")),this._applyToInputs(t=>t.setAttribute("autocorrect","off")),this._applyToInputs(t=>t.setAttribute("autocapitalize","off")),this._applyToInputs(t=>t.setAttribute("spellcheck","false")),this._applyToInputs(t=>t.setAttribute("role","combobox")),this._applyToInputs(t=>t.setAttribute("aria-live","assertive")),this._applyToInputs(t=>t.setAttribute("aria-atomic","true")),this._applyToInputs(t=>t.setAttribute("aria-haspopup","true")),this._applyToInputs(t=>t.setAttribute("aria-expanded","false")),this._applyToInputs(t=>t.setAttribute("aria-owns",this._dropdownIdentifier))}addInputListener(t,e,i){var o;(o=this._fromInputElement)==null||o.addEventListener(t,e,{capture:i})}addToInputListener(t,e,i){var o;(o=this._toInputElement)==null||o.addEventListener(t,e,{capture:i})}removeInputListener(t,e){var i;(i=this._fromInputElement)==null||i.removeEventListener(t,e)}removeToInputListener(t,e){var i;(i=this._toInputElement)==null||i.removeEventListener(t,e)}setInputValueChangedListener(t,e){this._valueChangeListeners.length&&this.destroyValueChangeListener();let i=v(t,this._fromInputElement,"value",e);this._valueChangeListeners.push(i)}setToInputValueChangedListener(t,e){this._destroyToValueChangeListener(),this._toValueChangeListener=v(t,this._toInputElement,"value",e)}hasInputElement(){return!!this._fromInputElement&&!!this._toInputElement}attachCalendar(t,e){super.attachCalendar(t,e),this._fromInputElement.setAttribute("aria-expanded","true")}detachCalendar(){super.detachCalendar(),this._fromInputElement&&(this._fromInputElement.setAttribute("aria-expanded","false"),this._fromInputElement.removeAttribute("aria-activedescendant"))}setActiveDescendant(t){this._fromInputElement.setAttribute("aria-activedescendant",t)}setInputValue(t,e){this._fromInputElement.value!==t&&(this._fromInputElement.value=t,this._fromInputMask&&this._fromInputMask.updateMask(),e&&(this._fromInputElement.dispatchEvent(new Event("change")),this._fromInputElement.dispatchEvent(new Event("input"))))}setToInputValue(t,e){this._toInputElement.value!==t&&(this._toInputElement.value=t,this._toInputMask&&this._toInputMask.updateMask(),e&&(this._toInputElement.dispatchEvent(new Event("change")),this._toInputElement.dispatchEvent(new Event("input"))))}isInputDisabled(){return this._fromInputElement.disabled}isInputFocused(t){if(t&&this._toInputElement===t||this._fromInputElement===t)return!0;let e=k();return this._toInputElement===e||this._fromInputElement===e}getInputValue(){return this._fromInputElement.value}getToInputValue(){return this._toInputElement.value}setDisabled(t){this._fromInputElement.disabled=t,this._toInputElement.disabled=t,this._toInputElement.setAttribute("aria-disabled",t.toString()),this._fromInputElement.setAttribute("aria-disabled",t.toString()),this._toggleElement&&(this._toggleElement.setAttribute("aria-disabled",t.toString()),this._toggleElement.hasOwnProperty("disabled")&&(this._toggleElement.disabled=t))}emitInputEvent(t,e){D(this._fromInputElement,t,e)}emitToInputEvent(t,e){D(this._toInputElement,t,e)}_createToggleElement(){return H("date_range")}tryFocusInput(){this._fromInputElement.focus()}tryBlurInput(){this._fromInputElement.blur()}selectInputText(){this._fromInputElement.select()}selectToInputText(){this._toInputElement.select()}_applyToInputs(t){[this._fromInputElement,this._toInputElement].forEach(t)}};var f=class extends U{constructor(t){super(t);this._mode="range";this._from=null;this._to=null;this._toInputListener=e=>this._onToInput(e),this._toInputValueChangedListener=e=>this._onToInputValueChanged(e),this._toInputKeydownListener=e=>this._onInputKeydown(e),this._toInputFocusListener=e=>this._onToInputFocus(),this._toInputBlurListener=e=>this._onToInputBlur(e)}_initializeState(){this._applyToMask(),this._from||(this._from=this._coerceDateValue(this._adapter.getInputValue())),this._to||(this._to=this._coerceDateValue(this._adapter.getToInputValue()))}_initializeListeners(){super._initializeListeners(),this._adapter.addToInputListener("keydown",this._toInputKeydownListener),this._adapter.addToInputListener("focus",this._toInputFocusListener),this._adapter.addToInputListener("blur",this._toInputBlurListener)}_initializeValueChangedListeners(){super._initializeValueChangedListeners(),this._adapter.setToInputValueChangedListener(this,this._toInputValueChangedListener)}_setInputChangeListeners(){super._setInputChangeListeners(),this._adapter.addToInputListener("input",this._toInputListener)}_removeInputChangeListeners(){super._removeInputChangeListeners(),this._adapter.removeToInputListener("input",this._toInputListener)}_openCalendar(t){this._formatToInputValue(),super._openCalendar(t);let e=this._getCurrentValue();e!=null&&e.to?this._adapter.goToCalendarDate(new Date(e.to)):e!=null&&e.from&&this._adapter.goToCalendarDate(new Date(e.from))}_emitChangeEvent(t,e){let i=this._getTypedValue(t&&t.from||null),o=this._getTypedValue(t&&t.to||null),l=new m({from:i,to:o});return this._adapter.emitHostEvent(n.events.CHANGE,l,!0,!e)?(this._setValue(this._coerceDateValue(t&&t.from||null)),this._setToValue(this._coerceDateValue(t&&t.to||null)),!0):!1}_emitOpenEvent(){this._adapter.emitHostEvent(n.events.OPEN,void 0,!1)}_emitCloseEvent(){this._adapter.emitHostEvent(n.events.CLOSE,void 0,!1)}_onToday(){let t=new Date,e=this._open?new a({from:this._from||t,to:this._to||void 0}):new a({from:t});this._isDateRangeAcceptable(e)&&(this.value=e,this._onDateSelected({date:t,range:e,selected:!0,type:"date"}),this._adapter.setCalendarActiveDate(t))}_onClear(){this._onDateSelected({date:null,range:new a,selected:!1,type:"date"}),this._closeCalendar(!0)}_getCurrentValue(){return this._value}_applyToMask(){this._masked?this._initializeToMask():(this._adapter.destroyToMask(),this._formatToInputValue())}_formatToInputValue(){let t=this._adapter.getToInputValue();if(t){let e=this._parseDateString(t);if(b(e)&&this._isDateValueAcceptable(e)){let i=this._formatDate(e);i&&this._adapter.setToInputValue(i,this._notifyInputValueChanges)}else this._allowInvalidDate||this._adapter.setToInputValue("",this._notifyInputValueChanges)}}_setFormattedInputValue(t){let e=this._formatDate(this._from);!e&&!this._allowInvalidDate&&(e=""),this._adapter.setInputValue(e,t?!1:this._notifyInputValueChanges)}_setFormattedToInputValue(t){let e=this._formatDate(this._to);!e&&!this._allowInvalidDate&&(e=""),this._adapter.setToInputValue(e,t?!1:this._notifyInputValueChanges)}_isDateRangeAcceptable(t){if(!(t!=null&&t.to))return!0;let e=()=>this._isDateValueAcceptable(t.from),i=()=>this._isDateValueAcceptable(t.to),o=()=>t!=null&&t.from&&(t!=null&&t.to)?t.from.getTime()<=t.to.getTime():!0;return e()&&i()&&o()}_setValue(t){this._isDateValueAcceptable(t)&&(this._from=t||null,this._value?this._value.from=this._from:this._value={from:this._from,to:this._to})}_setToValue(t){this._isDateValueAcceptable(t)&&(this._to=t||null,this._value?this._value.to=this._to:this._value={from:this._from,to:this._to})}_onDateSelected(t){let e=t.range;if(t.rangeSelectionState==="to"&&this._closeCalendar(!0),!this._emitChangeEvent(e!=null?e:null))return;let i=this._formatDate(e&&e.from||null),o=this._formatDate(e&&e.to||null);this._adapter.setInputValue(i,this._notifyInputValueChanges),this._adapter.setToInputValue(o,this._notifyInputValueChanges),this._formatInputValue(),this._formatToInputValue(),this._from=e&&e.from||null,this._to=e&&e.to||null,V.isMobile||(o?this._adapter.selectToInputText():this._adapter.selectInputText())}_applyMin(){this._from&&!this._isDateValueAcceptable(this._from)&&(this._emitChangeEvent(new a({to:this._to||void 0}),!0),this._setFormattedInputValue()),this._to&&!this._isDateValueAcceptable(this._to)&&(this._emitChangeEvent(new a({from:this._from||void 0}),!0),this._setFormattedToInputValue()),super._applyMin()}_applyMax(){this._from&&!this._isDateValueAcceptable(this._from)&&(this._emitChangeEvent(new a({to:this._to||void 0}),!0),this._setFormattedInputValue()),this._to&&!this._isDateValueAcceptable(this._to)&&(this._emitChangeEvent(new a({from:this._from||void 0}),!0),this._setFormattedToInputValue()),super._applyMax()}_initializeToMask(){if(!this._masked)return;let t={showMaskFormat:this._showMaskFormat&&this._adapter.isInputFocused(),pattern:this._maskFormat,onChange:e=>this._handleToInput(e)};this._prepareMaskCallback&&(t.prepareCallback=(e,i,o,l)=>this._prepareMaskCallback.call(null,e,i,o,l)),this._adapter.initializeToMask(t)}_applyDisabledDates(){this._from&&!this._isDateValueAcceptable(this._from)&&(this._emitChangeEvent(new a({to:this._to||void 0}),!0),this._setFormattedInputValue()),this._to&&!this._isDateValueAcceptable(this._to)&&(this._emitChangeEvent(new a({from:this._from||void 0}),!0),this._setFormattedToInputValue())}_applyDisabledDaysOfWeek(){this._from&&!this._isDateValueAcceptable(this._from)&&(this._emitChangeEvent(null,!0),this._setFormattedInputValue()),this._to&&!this._isDateValueAcceptable(this._to)&&(this._emitChangeEvent(null,!0),this._setFormattedToInputValue())}_onToInput(t){this._handleInput(this._adapter.getInputValue())}_handleInput(t){let e=this._getSanitizedDateString(t),i=this._coerceDateValue(e);this._masked&&this._adapter.emitInputEvent(n.events.INPUT,e),!p(i,this._from)&&this._isDateValueAcceptable(i)&&this._emitChangeEvent(new a({from:i||void 0,to:this._to||void 0}))}_handleToInput(t){let e=this._getSanitizedDateString(t),i=this._coerceDateValue(e);this._masked&&this._adapter.emitToInputEvent(n.events.INPUT,e),!p(i,this._to)&&this._isDateValueAcceptable(i)&&this._emitChangeEvent(new a({from:this._from||void 0,to:i||void 0}))}_onToInputFocus(){this._adapter.selectToInputText(),this.masked&&this._showMaskFormat&&(this._initializeMask(),this._initializeToMask())}_onToInputBlur(t){this._masked&&!this._adapter.isInputFocused(t.relatedTarget)&&(this._initializeMask(),this._initializeToMask()),this._formatToInputValue(),this._open&&this._closeCalendar(!0)}_onInputFocus(t){this._adapter.selectInputText(),this.masked&&this._showMaskFormat&&(this._initializeMask(),this._initializeToMask())}_onInputBlur(t){this.masked&&!this._adapter.isInputFocused(t.relatedTarget)&&(this._initializeMask(),this._initializeToMask()),this._formatInputValue(),this._open&&!this._adapter.isInputFocused(t.relatedTarget)&&this._closeCalendar(!0)}_onInputValueChanged(t){if(this._masked)return;let e=this._getSanitizedDateString(t),i=this._coerceDateValue(e);p(i,this._from)||(this.from=i,this._emitChangeEvent(new a({from:i||void 0,to:this._to||void 0})))}_onToInputValueChanged(t){if(this._masked)return;let e=this._getSanitizedDateString(t),i=this._coerceDateValue(e);p(i,this._to)||(this.to=i,this._emitChangeEvent(new a({from:this._from||void 0,to:i||void 0})))}get value(){return{from:this.from,to:this.to}}set value(t){t||(t={from:null,to:null}),t.from===void 0&&(t.from=null),t.to===void 0&&(t.to=null),this.from=t.from,this.to=t.to,this._value={from:this.from,to:this.to}}get from(){let t=this._getTypedValue(this._from);return t?g(t)?new Date(t.getTime()):t:null}set from(t){this._from!==t&&(this._setValue(this._coerceDateValue(t)),this._isInitialized&&(this._setFormattedInputValue(),this._open&&this._adapter.setCalendarValue(new a({from:this._coerceDateValue(t)||void 0,to:this._coerceDateValue(this._to)||void 0}))))}get to(){let t=this._getTypedValue(this._to);return t?g(t)?new Date(t.getTime()):t:null}set to(t){this._to!==t&&(this._setToValue(this._coerceDateValue(t)),this._isInitialized&&(this._setFormattedToInputValue(),this._open&&this._adapter.setCalendarValue(new a({to:this._coerceDateValue(t)||void 0,from:this._coerceDateValue(this._from)||void 0}))))}};var X="<template><slot></slot></template>",j=":host{display:block}:host([hidden]){display:none}",s=class extends B{constructor(){super();R.define(A),P(this,X,j),this._foundation=new f(new c(this))}static get observedAttributes(){return[...Object.values(z.observedAttributes),n.observedAttributes.FROM,n.observedAttributes.TO]}attributeChangedCallback(t,e,i){switch(t){case n.observedAttributes.FROM:this.from=i;return;case n.observedAttributes.TO:this.to=i;return}super.attributeChangedCallback(t,e,i)}};h([E()],s.prototype,"from",2),h([E()],s.prototype,"to",2),s=h([M({name:n.elementName,dependencies:[w,S,N,x]})],s);var $=class extends L{constructor(t){super(t)}_build(){let t=document.createElement(n.elementName);return this._attachTextField(t),t}get fromInput(){return this._textField.querySelector(`input[${_.attributes.MULTI_INPUT}-0]`)}get toInput(){return this._textField.querySelector(`input[${_.attributes.MULTI_INPUT}-1]`)}get textField(){return this._textField}get value(){return this._element.value}set value(t){this._element.value=t}get disabled(){return this._element.disabled}set disabled(t){this._element.disabled=t}get invalid(){return this._textField.invalid||!1}set invalid(t){this._textField.invalid=t}onChange(t){this._element.addEventListener(n.events.CHANGE,e=>t(e.detail))}onFocus(t){this._element.addEventListener("focusin",e=>{!this._element.contains(e.relatedTarget)&&t(e)})}onBlur(t){this._element.addEventListener("focusout",e=>{!this._element.contains(e.relatedTarget)&&t(e)})}_attachTextField(t){var i,o,l,I,C;this._textField=document.createElement(_.elementName),(i=this._config.options)!=null&&i.required&&(this._textField.required=!0),(o=this._config.options)!=null&&o.density&&(this._textField.density=this._config.options.density),this._fromInput=document.createElement("input"),this._fromInput.type="text",this._fromInput.placeholder=((l=this._config.options)==null?void 0:l.fromPlaceholder)||"From",this._textField.appendChild(this._fromInput),this._toInput=document.createElement("input"),this._toInput.type="text",this._toInput.placeholder=((I=this._config.options)==null?void 0:I.toPlaceholder)||"To",this._textField.appendChild(this._toInput);let e=document.createElement("label");e.textContent=((C=this._config.options)==null?void 0:C.label)||"Choose date range",this._textField.appendChild(e),t.appendChild(this._textField)}};function qt(){y(s)}export{m as a,n as b,c,f as d,s as e,$ as f,qt as g};
|
|
7
|
-
//# sourceMappingURL=chunk.
|
|
6
|
+
import{a as z,b as B,c as H,d as K,e as U}from"./chunk.33EJTOVA.js";import{E as S}from"./chunk.JTIPXKV6.js";import{a}from"./chunk.44IUAOBP.js";import{F as O}from"./chunk.44UCSD46.js";import{e as w}from"./chunk.7G72CBOJ.js";import{a as _}from"./chunk.PHTOULRR.js";import{e as v}from"./chunk.UV3WIHCM.js";import{a as V}from"./chunk.MGLWXAZO.js";import{b as N}from"./chunk.KSCUIS5C.js";import{l as A}from"./chunk.FYWPZFLJ.js";import{d as R,l as x}from"./chunk.H5D54EHO.js";import{b as T}from"./chunk.XIQFHO5R.js";import{e as p}from"./chunk.DMCBAYQX.js";import{a as L}from"./chunk.G4IN6Y46.js";import{a as E}from"./chunk.NVUMRW44.js";import{a as M,b as F}from"./chunk.DTZFWZPB.js";import{a as y,e as P,h as D}from"./chunk.NK7H3MMM.js";import{s as k}from"./chunk.CFDK4RCW.js";import{f as g,g as b}from"./chunk.J2M2MXP2.js";import{d as h}from"./chunk.M3QDAYD2.js";var d=`${F}date-range-picker`,m=class u{constructor(r){r&&(this.from=r.from,this.to=r.to)}copy(){return new u(this)}},q={FROM:"from",TO:"to",END_VALUE:"end-value"},G={INPUT:"input"},W={CHANGE:`${d}-change`,OPEN:`${d}-open`,CLOSE:`${d}-close`,INPUT:`${d}-input`},n={elementName:d,selectors:G,events:W,observedAttributes:q};var c=class extends K{constructor(t){super(t);this._dropdownIdentifier=`forge-date-range-picker-${this._identifier}`}_initializeInput(){if(this._fromInputElement=this._component.querySelectorAll(n.selectors.INPUT)[0],this._toInputElement=this._component.querySelectorAll(n.selectors.INPUT)[1],!this._fromInputElement||!this._fromInputElement)throw new Error(`The ${n.elementName} requires two inputs`)}_initializeCalendarDropdown(){let t=this._getDefaultTargetElement();this._calendarDropdown=new O(t,this._dropdownIdentifier)}initializeMask(t){var e;(e=this._fromInputMask)==null||e.destroy(),this._fromInputMask=new T(this._fromInputElement,t)}destroyMask(){var t;(t=this._fromInputMask)==null||t.destroy(),this._fromInputMask=void 0}initializeToMask(t){var e;(e=this._toInputMask)==null||e.destroy(),this._toInputMask=new T(this._toInputElement,t)}destroyToMask(){var t;(t=this._toInputMask)==null||t.destroy(),this._toInputMask=void 0}destroy(){super.destroy(),this._destroyToValueChangeListener()}_destroyToValueChangeListener(){typeof this._toValueChangeListener=="function"&&this._toValueChangeListener()}initializeAccessibility(){this._applyToInputs(t=>t.setAttribute("autocomplete","off")),this._applyToInputs(t=>t.setAttribute("autocorrect","off")),this._applyToInputs(t=>t.setAttribute("autocapitalize","off")),this._applyToInputs(t=>t.setAttribute("spellcheck","false")),this._applyToInputs(t=>t.setAttribute("role","combobox")),this._applyToInputs(t=>t.setAttribute("aria-live","assertive")),this._applyToInputs(t=>t.setAttribute("aria-atomic","true")),this._applyToInputs(t=>t.setAttribute("aria-haspopup","true")),this._applyToInputs(t=>t.setAttribute("aria-expanded","false")),this._applyToInputs(t=>t.setAttribute("aria-owns",this._dropdownIdentifier))}addInputListener(t,e,i){var o;(o=this._fromInputElement)==null||o.addEventListener(t,e,{capture:i})}addToInputListener(t,e,i){var o;(o=this._toInputElement)==null||o.addEventListener(t,e,{capture:i})}removeInputListener(t,e){var i;(i=this._fromInputElement)==null||i.removeEventListener(t,e)}removeToInputListener(t,e){var i;(i=this._toInputElement)==null||i.removeEventListener(t,e)}setInputValueChangedListener(t,e){this._valueChangeListeners.length&&this.destroyValueChangeListener();let i=v(t,this._fromInputElement,"value",e);this._valueChangeListeners.push(i)}setToInputValueChangedListener(t,e){this._destroyToValueChangeListener(),this._toValueChangeListener=v(t,this._toInputElement,"value",e)}hasInputElement(){return!!this._fromInputElement&&!!this._toInputElement}attachCalendar(t,e){super.attachCalendar(t,e),this._fromInputElement.setAttribute("aria-expanded","true")}detachCalendar(){super.detachCalendar(),this._fromInputElement&&(this._fromInputElement.setAttribute("aria-expanded","false"),this._fromInputElement.removeAttribute("aria-activedescendant"))}setActiveDescendant(t){this._fromInputElement.setAttribute("aria-activedescendant",t)}setInputValue(t,e){this._fromInputElement.value!==t&&(this._fromInputElement.value=t,this._fromInputMask&&this._fromInputMask.updateMask(),e&&(this._fromInputElement.dispatchEvent(new Event("change")),this._fromInputElement.dispatchEvent(new Event("input"))))}setToInputValue(t,e){this._toInputElement.value!==t&&(this._toInputElement.value=t,this._toInputMask&&this._toInputMask.updateMask(),e&&(this._toInputElement.dispatchEvent(new Event("change")),this._toInputElement.dispatchEvent(new Event("input"))))}isInputDisabled(){return this._fromInputElement.disabled}isInputFocused(t){if(t&&this._toInputElement===t||this._fromInputElement===t)return!0;let e=k();return this._toInputElement===e||this._fromInputElement===e}getInputValue(){return this._fromInputElement.value}getToInputValue(){return this._toInputElement.value}setDisabled(t){this._fromInputElement.disabled=t,this._toInputElement.disabled=t,this._toInputElement.setAttribute("aria-disabled",t.toString()),this._fromInputElement.setAttribute("aria-disabled",t.toString()),this._toggleElement&&(this._toggleElement.setAttribute("aria-disabled",t.toString()),this._toggleElement.hasOwnProperty("disabled")&&(this._toggleElement.disabled=t))}emitInputEvent(t,e){D(this._fromInputElement,t,e)}emitToInputEvent(t,e){D(this._toInputElement,t,e)}_createToggleElement(){return H("date_range")}tryFocusInput(){this._fromInputElement.focus()}tryBlurInput(){this._fromInputElement.blur()}selectInputText(){this._fromInputElement.select()}selectToInputText(){this._toInputElement.select()}_applyToInputs(t){[this._fromInputElement,this._toInputElement].forEach(t)}};var f=class extends U{constructor(t){super(t);this._mode="range";this._from=null;this._to=null;this._toInputListener=e=>this._onToInput(e),this._toInputValueChangedListener=e=>this._onToInputValueChanged(e),this._toInputKeydownListener=e=>this._onInputKeydown(e),this._toInputFocusListener=e=>this._onToInputFocus(),this._toInputBlurListener=e=>this._onToInputBlur(e)}_initializeState(){this._applyToMask(),this._from||(this._from=this._coerceDateValue(this._adapter.getInputValue())),this._to||(this._to=this._coerceDateValue(this._adapter.getToInputValue()))}_initializeListeners(){super._initializeListeners(),this._adapter.addToInputListener("keydown",this._toInputKeydownListener),this._adapter.addToInputListener("focus",this._toInputFocusListener),this._adapter.addToInputListener("blur",this._toInputBlurListener)}_initializeValueChangedListeners(){super._initializeValueChangedListeners(),this._adapter.setToInputValueChangedListener(this,this._toInputValueChangedListener)}_setInputChangeListeners(){super._setInputChangeListeners(),this._adapter.addToInputListener("input",this._toInputListener)}_removeInputChangeListeners(){super._removeInputChangeListeners(),this._adapter.removeToInputListener("input",this._toInputListener)}_openCalendar(t){this._formatToInputValue(),super._openCalendar(t);let e=this._getCurrentValue();e!=null&&e.to?this._adapter.goToCalendarDate(new Date(e.to)):e!=null&&e.from&&this._adapter.goToCalendarDate(new Date(e.from))}_emitChangeEvent(t,e){let i=this._getTypedValue(t&&t.from||null),o=this._getTypedValue(t&&t.to||null),l=new m({from:i,to:o});return this._adapter.emitHostEvent(n.events.CHANGE,l,!0,!e)?(this._setValue(this._coerceDateValue(t&&t.from||null)),this._setToValue(this._coerceDateValue(t&&t.to||null)),!0):!1}_emitOpenEvent(){this._adapter.emitHostEvent(n.events.OPEN,void 0,!1)}_emitCloseEvent(){this._adapter.emitHostEvent(n.events.CLOSE,void 0,!1)}_onToday(){let t=new Date,e=this._open?new a({from:this._from||t,to:this._to||void 0}):new a({from:t});this._isDateRangeAcceptable(e)&&(this.value=e,this._onDateSelected({date:t,range:e,selected:!0,type:"date"}),this._adapter.setCalendarActiveDate(t))}_onClear(){this._onDateSelected({date:null,range:new a,selected:!1,type:"date"}),this._closeCalendar(!0)}_getCurrentValue(){return this._value}_applyToMask(){this._masked?this._initializeToMask():(this._adapter.destroyToMask(),this._formatToInputValue())}_formatToInputValue(){let t=this._adapter.getToInputValue();if(t){let e=this._parseDateString(t);if(b(e)&&this._isDateValueAcceptable(e)){let i=this._formatDate(e);i&&this._adapter.setToInputValue(i,this._notifyInputValueChanges)}else this._allowInvalidDate||this._adapter.setToInputValue("",this._notifyInputValueChanges)}}_setFormattedInputValue(t){let e=this._formatDate(this._from);!e&&!this._allowInvalidDate&&(e=""),this._adapter.setInputValue(e,t?!1:this._notifyInputValueChanges)}_setFormattedToInputValue(t){let e=this._formatDate(this._to);!e&&!this._allowInvalidDate&&(e=""),this._adapter.setToInputValue(e,t?!1:this._notifyInputValueChanges)}_isDateRangeAcceptable(t){if(!(t!=null&&t.to))return!0;let e=()=>this._isDateValueAcceptable(t.from),i=()=>this._isDateValueAcceptable(t.to),o=()=>t!=null&&t.from&&(t!=null&&t.to)?t.from.getTime()<=t.to.getTime():!0;return e()&&i()&&o()}_setValue(t){this._isDateValueAcceptable(t)&&(this._from=t||null,this._value?this._value.from=this._from:this._value={from:this._from,to:this._to})}_setToValue(t){this._isDateValueAcceptable(t)&&(this._to=t||null,this._value?this._value.to=this._to:this._value={from:this._from,to:this._to})}_onDateSelected(t){let e=t.range;if(t.rangeSelectionState==="to"&&this._closeCalendar(!0),!this._emitChangeEvent(e!=null?e:null))return;let i=this._formatDate(e&&e.from||null),o=this._formatDate(e&&e.to||null);this._adapter.setInputValue(i,this._notifyInputValueChanges),this._adapter.setToInputValue(o,this._notifyInputValueChanges),this._formatInputValue(),this._formatToInputValue(),this._from=e&&e.from||null,this._to=e&&e.to||null,V.isMobile||(o?this._adapter.selectToInputText():this._adapter.selectInputText())}_applyMin(){this._from&&!this._isDateValueAcceptable(this._from)&&(this._emitChangeEvent(new a({to:this._to||void 0}),!0),this._setFormattedInputValue()),this._to&&!this._isDateValueAcceptable(this._to)&&(this._emitChangeEvent(new a({from:this._from||void 0}),!0),this._setFormattedToInputValue()),super._applyMin()}_applyMax(){this._from&&!this._isDateValueAcceptable(this._from)&&(this._emitChangeEvent(new a({to:this._to||void 0}),!0),this._setFormattedInputValue()),this._to&&!this._isDateValueAcceptable(this._to)&&(this._emitChangeEvent(new a({from:this._from||void 0}),!0),this._setFormattedToInputValue()),super._applyMax()}_initializeToMask(){if(!this._masked)return;let t={showMaskFormat:this._showMaskFormat&&this._adapter.isInputFocused(),pattern:this._maskFormat,onChange:e=>this._handleToInput(e)};this._prepareMaskCallback&&(t.prepareCallback=(e,i,o,l)=>this._prepareMaskCallback.call(null,e,i,o,l)),this._adapter.initializeToMask(t)}_applyDisabledDates(){this._from&&!this._isDateValueAcceptable(this._from)&&(this._emitChangeEvent(new a({to:this._to||void 0}),!0),this._setFormattedInputValue()),this._to&&!this._isDateValueAcceptable(this._to)&&(this._emitChangeEvent(new a({from:this._from||void 0}),!0),this._setFormattedToInputValue())}_applyDisabledDaysOfWeek(){this._from&&!this._isDateValueAcceptable(this._from)&&(this._emitChangeEvent(null,!0),this._setFormattedInputValue()),this._to&&!this._isDateValueAcceptable(this._to)&&(this._emitChangeEvent(null,!0),this._setFormattedToInputValue())}_onToInput(t){this._handleInput(this._adapter.getInputValue())}_handleInput(t){let e=this._getSanitizedDateString(t),i=this._coerceDateValue(e);this._masked&&this._adapter.emitInputEvent(n.events.INPUT,e),!p(i,this._from)&&this._isDateValueAcceptable(i)&&this._emitChangeEvent(new a({from:i||void 0,to:this._to||void 0}))}_handleToInput(t){let e=this._getSanitizedDateString(t),i=this._coerceDateValue(e);this._masked&&this._adapter.emitToInputEvent(n.events.INPUT,e),!p(i,this._to)&&this._isDateValueAcceptable(i)&&this._emitChangeEvent(new a({from:this._from||void 0,to:i||void 0}))}_onToInputFocus(){this._adapter.selectToInputText(),this.masked&&this._showMaskFormat&&(this._initializeMask(),this._initializeToMask())}_onToInputBlur(t){this._masked&&!this._adapter.isInputFocused(t.relatedTarget)&&(this._initializeMask(),this._initializeToMask()),this._formatToInputValue(),this._open&&this._closeCalendar(!0)}_onInputFocus(t){this._adapter.selectInputText(),this.masked&&this._showMaskFormat&&(this._initializeMask(),this._initializeToMask())}_onInputBlur(t){this.masked&&!this._adapter.isInputFocused(t.relatedTarget)&&(this._initializeMask(),this._initializeToMask()),this._formatInputValue(),this._open&&!this._adapter.isInputFocused(t.relatedTarget)&&this._closeCalendar(!0)}_onInputValueChanged(t){if(this._masked)return;let e=this._getSanitizedDateString(t),i=this._coerceDateValue(e);p(i,this._from)||(this.from=i,this._emitChangeEvent(new a({from:i||void 0,to:this._to||void 0})))}_onToInputValueChanged(t){if(this._masked)return;let e=this._getSanitizedDateString(t),i=this._coerceDateValue(e);p(i,this._to)||(this.to=i,this._emitChangeEvent(new a({from:this._from||void 0,to:i||void 0})))}get value(){return{from:this.from,to:this.to}}set value(t){t||(t={from:null,to:null}),t.from===void 0&&(t.from=null),t.to===void 0&&(t.to=null),this.from=t.from,this.to=t.to,this._value={from:this.from,to:this.to}}get from(){let t=this._getTypedValue(this._from);return t?g(t)?new Date(t.getTime()):t:null}set from(t){this._from!==t&&(this._setValue(this._coerceDateValue(t)),this._isInitialized&&(this._setFormattedInputValue(),this._open&&this._adapter.setCalendarValue(new a({from:this._coerceDateValue(t)||void 0,to:this._coerceDateValue(this._to)||void 0}))))}get to(){let t=this._getTypedValue(this._to);return t?g(t)?new Date(t.getTime()):t:null}set to(t){this._to!==t&&(this._setToValue(this._coerceDateValue(t)),this._isInitialized&&(this._setFormattedToInputValue(),this._open&&this._adapter.setCalendarValue(new a({to:this._coerceDateValue(t)||void 0,from:this._coerceDateValue(this._from)||void 0}))))}};var X="<template><slot></slot></template>",j=":host{display:block}:host([hidden]){display:none}",s=class extends B{constructor(){super();R.define(A),P(this,X,j),this._foundation=new f(new c(this))}static get observedAttributes(){return[...Object.values(z.observedAttributes),n.observedAttributes.FROM,n.observedAttributes.TO]}attributeChangedCallback(t,e,i){switch(t){case n.observedAttributes.FROM:this.from=i;return;case n.observedAttributes.TO:this.to=i;return}super.attributeChangedCallback(t,e,i)}};h([E()],s.prototype,"from",2),h([E()],s.prototype,"to",2),s=h([M({name:n.elementName,dependencies:[w,S,N,x]})],s);var $=class extends L{constructor(t){super(t)}_build(){let t=document.createElement(n.elementName);return this._attachTextField(t),t}get fromInput(){return this._textField.querySelector(`input[${_.attributes.MULTI_INPUT}-0]`)}get toInput(){return this._textField.querySelector(`input[${_.attributes.MULTI_INPUT}-1]`)}get textField(){return this._textField}get value(){return this._element.value}set value(t){this._element.value=t}get disabled(){return this._element.disabled}set disabled(t){this._element.disabled=t}get invalid(){return this._textField.invalid||!1}set invalid(t){this._textField.invalid=t}onChange(t){this._element.addEventListener(n.events.CHANGE,e=>t(e.detail))}onFocus(t){this._element.addEventListener("focusin",e=>{!this._element.contains(e.relatedTarget)&&t(e)})}onBlur(t){this._element.addEventListener("focusout",e=>{!this._element.contains(e.relatedTarget)&&t(e)})}_attachTextField(t){var i,o,l,I,C;this._textField=document.createElement(_.elementName),(i=this._config.options)!=null&&i.required&&(this._textField.required=!0),(o=this._config.options)!=null&&o.density&&(this._textField.density=this._config.options.density),this._fromInput=document.createElement("input"),this._fromInput.type="text",this._fromInput.placeholder=((l=this._config.options)==null?void 0:l.fromPlaceholder)||"From",this._textField.appendChild(this._fromInput),this._toInput=document.createElement("input"),this._toInput.type="text",this._toInput.placeholder=((I=this._config.options)==null?void 0:I.toPlaceholder)||"To",this._textField.appendChild(this._toInput);let e=document.createElement("label");e.textContent=((C=this._config.options)==null?void 0:C.label)||"Choose date range",this._textField.appendChild(e),t.appendChild(this._textField)}};function qt(){y(s)}export{m as a,n as b,c,f as d,s as e,$ as f,qt as g};
|
|
7
|
+
//# sourceMappingURL=chunk.F776DWXU.js.map
|