@tylertech/forge 3.0.0-next.17 → 3.0.0-next.19
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 +231 -124
- package/dist/esm/accordion/index.js +1 -1
- package/dist/esm/app-bar/app-bar/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-area/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.6J27XSTE.js → chunk.2AVJJJNS.js} +2 -2
- package/dist/esm/chunks/{chunk.H6AG3EFX.js → chunk.2F2N4WBN.js} +2 -2
- package/dist/esm/chunks/chunk.3WT7HPA7.js +12 -0
- package/dist/esm/chunks/{chunk.W7CM652O.js → chunk.4EBFMRTJ.js} +2 -2
- package/dist/esm/chunks/{chunk.6RZCV4ZV.js → chunk.4HZ6SNRV.js} +2 -2
- package/dist/esm/chunks/{chunk.HPCXVNG6.js → chunk.4SP42UG3.js} +2 -2
- package/dist/esm/chunks/{chunk.HPCXVNG6.js.map → chunk.4SP42UG3.js.map} +3 -3
- package/dist/esm/chunks/{chunk.XPIAOMSC.js → chunk.4YKLCBP2.js} +2 -2
- package/dist/esm/chunks/{chunk.O47OSK6Z.js → chunk.54DNA2QP.js} +2 -2
- package/dist/esm/chunks/{chunk.O47OSK6Z.js.map → chunk.54DNA2QP.js.map} +1 -1
- package/dist/esm/chunks/{chunk.2NGPMBVU.js → chunk.5JSCGQ7H.js} +2 -2
- package/dist/esm/chunks/{chunk.42VNZ74O.js → chunk.5NHGVUVR.js} +2 -2
- package/dist/esm/chunks/{chunk.Z7SLVU2O.js → chunk.5PNJOQDZ.js} +2 -2
- package/dist/esm/chunks/{chunk.IDB4KFSQ.js → chunk.66RZ2CUB.js} +2 -2
- package/dist/esm/chunks/{chunk.PR76A5VF.js → chunk.6DPDC4ON.js} +2 -2
- package/dist/esm/chunks/{chunk.ZZRAZZ3N.js → chunk.7AE3ATT3.js} +2 -2
- package/dist/esm/chunks/{chunk.AWEDY45N.js → chunk.AXBMJBED.js} +2 -2
- package/dist/esm/chunks/{chunk.NHYJMP25.js → chunk.B2RYZJGJ.js} +2 -2
- package/dist/esm/chunks/{chunk.S3KKICL3.js → chunk.CISGGM56.js} +2 -2
- package/dist/esm/chunks/{chunk.LXFL2C62.js → chunk.CJUX3PL5.js} +2 -2
- package/dist/esm/chunks/{chunk.VOL4DT5F.js → chunk.DYBD4IRT.js} +2 -2
- package/dist/esm/chunks/{chunk.LDHY3O6H.js → chunk.E2FS4PJS.js} +2 -2
- package/dist/esm/chunks/chunk.E7TIN4JS.js +7 -0
- package/dist/esm/chunks/chunk.E7TIN4JS.js.map +7 -0
- package/dist/esm/chunks/{chunk.OJHNLDNM.js → chunk.F3FWXBDS.js} +2 -2
- package/dist/esm/chunks/{chunk.3PHNRX5D.js → chunk.FOQH2SSU.js} +2 -2
- package/dist/esm/chunks/{chunk.GFKYBECY.js → chunk.FXDHZCID.js} +2 -2
- package/dist/esm/chunks/{chunk.SN3VXOWN.js → chunk.FZC3WXSY.js} +2 -2
- package/dist/esm/chunks/chunk.GAQ3POUT.js +7 -0
- package/dist/esm/chunks/chunk.GAQ3POUT.js.map +7 -0
- package/dist/esm/chunks/{chunk.HBFU4EGB.js → chunk.IE42X2LV.js} +2 -2
- package/dist/esm/chunks/{chunk.JRROGJ2G.js → chunk.IO3A5OM6.js} +2 -2
- package/dist/esm/chunks/{chunk.EPVNVBZI.js → chunk.J5MWS2KZ.js} +2 -2
- package/dist/esm/chunks/{chunk.6YDMW2GO.js → chunk.JO6GPIMF.js} +2 -2
- package/dist/esm/chunks/{chunk.5YTYVHYR.js → chunk.JUXSSZ3B.js} +2 -2
- package/dist/esm/chunks/{chunk.FTADCSFT.js → chunk.KIQZLNDG.js} +2 -2
- package/dist/esm/chunks/{chunk.VX7H6YHF.js → chunk.LNMQ5A25.js} +2 -2
- package/dist/esm/chunks/{chunk.YCG7OVYF.js → chunk.MBXBM6UI.js} +2 -2
- package/dist/esm/chunks/{chunk.SUR46MJG.js → chunk.N2DHFDXD.js} +2 -2
- package/dist/esm/chunks/{chunk.OD54UG2G.js → chunk.NSKIEZWE.js} +2 -2
- package/dist/esm/chunks/{chunk.6JR2HMWB.js → chunk.NY3N6KUZ.js} +2 -2
- package/dist/esm/chunks/{chunk.ZTBOQMRE.js → chunk.O6WN2UP6.js} +2 -2
- package/dist/esm/chunks/{chunk.JMIUB3S3.js → chunk.OWYOZF53.js} +2 -2
- package/dist/esm/chunks/{chunk.ND2X5OQ4.js → chunk.OXGCNOUY.js} +2 -2
- package/dist/esm/chunks/{chunk.OAZXY4Q5.js → chunk.QIMAHW7V.js} +2 -2
- package/dist/esm/chunks/{chunk.ZJQLVAJY.js → chunk.QXZ3AAXD.js} +2 -2
- package/dist/esm/chunks/{chunk.TGGC2THA.js → chunk.RB435MRJ.js} +2 -2
- package/dist/esm/chunks/{chunk.O7DID7GP.js → chunk.RBG6AMLV.js} +2 -2
- package/dist/esm/chunks/{chunk.ZZV7P3FR.js → chunk.RN634NOB.js} +2 -2
- package/dist/esm/chunks/{chunk.7QO5JEOC.js → chunk.RQ3RHGLB.js} +2 -2
- package/dist/esm/chunks/{chunk.NPCUVYWP.js → chunk.S2KPWTRW.js} +2 -2
- package/dist/esm/chunks/{chunk.ME7ICFCZ.js → chunk.SWDOKJUF.js} +2 -2
- package/dist/esm/chunks/{chunk.MMMG4MZ3.js → chunk.ULZJYWM2.js} +2 -2
- package/dist/esm/chunks/{chunk.PGSL6NFZ.js → chunk.VGKNQYHG.js} +2 -2
- package/dist/esm/chunks/{chunk.VLADAZRB.js → chunk.VRTR7WMN.js} +2 -2
- package/dist/esm/chunks/{chunk.NBYCIDFC.js → chunk.W2W3NTFC.js} +2 -2
- package/dist/esm/chunks/{chunk.ZSHN7Z45.js → chunk.WKLDPPHS.js} +2 -2
- package/dist/esm/chunks/{chunk.4X4SSZQU.js → chunk.WM6ZUVDR.js} +2 -2
- package/dist/esm/chunks/{chunk.TRSICKKS.js → chunk.XH63INIK.js} +2 -2
- package/dist/esm/chunks/{chunk.VNH44AGF.js → chunk.Y7ZZ7HDC.js} +2 -2
- package/dist/esm/chunks/{chunk.MTZOQQXR.js → chunk.YGXXWF52.js} +2 -2
- package/dist/esm/chunks/{chunk.KVPKVWCZ.js → chunk.YHIHHGMQ.js} +2 -2
- package/dist/esm/chunks/{chunk.OVDO5RVX.js → chunk.YOKBWEXF.js} +2 -2
- package/dist/esm/chunks/{chunk.L5OB7WM2.js → chunk.ZYYPOLIG.js} +2 -2
- 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/deprecated/button/index.js +1 -1
- package/dist/esm/deprecated/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/floating-action-button/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/label/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/overlay/index.js +1 -1
- package/dist/esm/paginator/index.js +1 -1
- package/dist/esm/popover/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/radio/radio/index.js +1 -1
- package/dist/esm/radio/radio-group/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-button/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 +1 -1
- 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/time-picker/index.js +1 -1
- package/dist/esm/toast/index.js +1 -1
- package/dist/esm/tooltip/index.js +1 -1
- package/dist/forge-dark.css +1 -1
- package/esm/banner/banner-adapter.d.ts +18 -18
- package/esm/banner/banner-adapter.js +26 -23
- package/esm/banner/banner-constants.d.ts +20 -16
- package/esm/banner/banner-constants.js +19 -21
- package/esm/banner/banner-foundation.d.ts +15 -14
- package/esm/banner/banner-foundation.js +54 -43
- package/esm/banner/banner.d.ts +36 -7
- package/esm/banner/banner.js +51 -18
- package/esm/core/utils/position-utils.d.ts +2 -10
- package/esm/core/utils/position-utils.js +8 -17
- package/esm/core/utils/utils.d.ts +6 -0
- package/esm/core/utils/utils.js +9 -0
- package/esm/overlay/overlay-adapter.d.ts +1 -2
- package/esm/overlay/overlay-adapter.js +9 -13
- package/esm/overlay/overlay-constants.d.ts +6 -1
- package/esm/overlay/overlay-constants.js +22 -0
- package/esm/overlay/overlay-foundation.js +1 -5
- package/esm/split-view/split-view-panel/split-view-panel.js +1 -1
- package/package.json +1 -1
- package/styles/banner/_core.scss +59 -0
- package/styles/banner/_token-utils.scss +30 -0
- package/styles/banner/banner.scss +137 -9
- package/styles/banner/index.scss +6 -0
- package/styles/core/styles/tokens/banner/_tokens.scss +26 -0
- package/styles/theme/_theme-dark.scss +0 -6
- package/dist/esm/chunks/chunk.53HPDCFR.js +0 -7
- package/dist/esm/chunks/chunk.53HPDCFR.js.map +0 -7
- package/dist/esm/chunks/chunk.DFRD7A2Y.js +0 -7
- package/dist/esm/chunks/chunk.DFRD7A2Y.js.map +0 -7
- package/dist/esm/chunks/chunk.YVCGGQQG.js +0 -12
- package/styles/badge/_mixins.scss +0 -125
- package/styles/badge/_variables.scss +0 -87
- package/styles/banner/_mixins.scss +0 -219
- package/styles/banner/_variables.scss +0 -88
- /package/dist/esm/chunks/{chunk.6J27XSTE.js.map → chunk.2AVJJJNS.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.H6AG3EFX.js.map → chunk.2F2N4WBN.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.YVCGGQQG.js.map → chunk.3WT7HPA7.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.W7CM652O.js.map → chunk.4EBFMRTJ.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.6RZCV4ZV.js.map → chunk.4HZ6SNRV.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.XPIAOMSC.js.map → chunk.4YKLCBP2.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.2NGPMBVU.js.map → chunk.5JSCGQ7H.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.42VNZ74O.js.map → chunk.5NHGVUVR.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.Z7SLVU2O.js.map → chunk.5PNJOQDZ.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.IDB4KFSQ.js.map → chunk.66RZ2CUB.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.PR76A5VF.js.map → chunk.6DPDC4ON.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.ZZRAZZ3N.js.map → chunk.7AE3ATT3.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.AWEDY45N.js.map → chunk.AXBMJBED.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.NHYJMP25.js.map → chunk.B2RYZJGJ.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.S3KKICL3.js.map → chunk.CISGGM56.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.LXFL2C62.js.map → chunk.CJUX3PL5.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.VOL4DT5F.js.map → chunk.DYBD4IRT.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.LDHY3O6H.js.map → chunk.E2FS4PJS.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.OJHNLDNM.js.map → chunk.F3FWXBDS.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.3PHNRX5D.js.map → chunk.FOQH2SSU.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.GFKYBECY.js.map → chunk.FXDHZCID.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.SN3VXOWN.js.map → chunk.FZC3WXSY.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.HBFU4EGB.js.map → chunk.IE42X2LV.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.JRROGJ2G.js.map → chunk.IO3A5OM6.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.EPVNVBZI.js.map → chunk.J5MWS2KZ.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.6YDMW2GO.js.map → chunk.JO6GPIMF.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.5YTYVHYR.js.map → chunk.JUXSSZ3B.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.FTADCSFT.js.map → chunk.KIQZLNDG.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.VX7H6YHF.js.map → chunk.LNMQ5A25.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.YCG7OVYF.js.map → chunk.MBXBM6UI.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.SUR46MJG.js.map → chunk.N2DHFDXD.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.OD54UG2G.js.map → chunk.NSKIEZWE.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.6JR2HMWB.js.map → chunk.NY3N6KUZ.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.ZTBOQMRE.js.map → chunk.O6WN2UP6.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.JMIUB3S3.js.map → chunk.OWYOZF53.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.ND2X5OQ4.js.map → chunk.OXGCNOUY.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.OAZXY4Q5.js.map → chunk.QIMAHW7V.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.ZJQLVAJY.js.map → chunk.QXZ3AAXD.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.TGGC2THA.js.map → chunk.RB435MRJ.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.O7DID7GP.js.map → chunk.RBG6AMLV.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.ZZV7P3FR.js.map → chunk.RN634NOB.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.7QO5JEOC.js.map → chunk.RQ3RHGLB.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.NPCUVYWP.js.map → chunk.S2KPWTRW.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.ME7ICFCZ.js.map → chunk.SWDOKJUF.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.MMMG4MZ3.js.map → chunk.ULZJYWM2.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.PGSL6NFZ.js.map → chunk.VGKNQYHG.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.VLADAZRB.js.map → chunk.VRTR7WMN.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.NBYCIDFC.js.map → chunk.W2W3NTFC.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.ZSHN7Z45.js.map → chunk.WKLDPPHS.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.4X4SSZQU.js.map → chunk.WM6ZUVDR.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.TRSICKKS.js.map → chunk.XH63INIK.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.VNH44AGF.js.map → chunk.Y7ZZ7HDC.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.MTZOQQXR.js.map → chunk.YGXXWF52.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.KVPKVWCZ.js.map → chunk.YHIHHGMQ.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.OVDO5RVX.js.map → chunk.YOKBWEXF.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.L5OB7WM2.js.map → chunk.ZYYPOLIG.js.map} +0 -0
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* Copyright 2023 Tyler Technologies, Inc.
|
|
4
4
|
* License: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import{a as F}from"./chunk.JBQXD3FJ.js";import{b as se}from"./chunk.PZAL7VQF.js";import{a as Z}from"./chunk.IDB4KFSQ.js";import{h as oe,i as ne}from"./chunk.LXFL2C62.js";import{c as J}from"./chunk.HBFU4EGB.js";import{f as Q}from"./chunk.JMIUB3S3.js";import{b as te}from"./chunk.STIZCKQA.js";import{a as C,e as ee}from"./chunk.253H47GA.js";import{b as ie}from"./chunk.JLDKNU5Q.js";import{c as pe}from"./chunk.O5HBMTSZ.js";import{a as le,b as ae}from"./chunk.LEN33O6V.js";import{a as re}from"./chunk.ZSZFWZAI.js";import{a as j}from"./chunk.OR5GB6X3.js";import{c as W,g as K,h as q}from"./chunk.EWT2PBEP.js";import{d as Y,l as X}from"./chunk.L7BSLZCB.js";import{a as z}from"./chunk.YTBNAGLS.js";import{a as $}from"./chunk.HPCXVNG6.js";import{a as R}from"./chunk.ZY3ETQ3D.js";import{a}from"./chunk.NVUMRW44.js";import{a as H,b as G,c as V}from"./chunk.UVXKHQQZ.js";import{a as N,e as U,f as L}from"./chunk.TPXXHX5J.js";import{a as D}from"./chunk.MGLWXAZO.js";import{m as B,s as M,t as k,v as A}from"./chunk.HZUQXCOQ.js";import{a as y,b as h,c as x,j as T,k as f,l as S,n as w,o as P}from"./chunk.J2M2MXP2.js";import{a as E,d as p}from"./chunk.M3QDAYD2.js";var g=`${G}autocomplete`,me={MODE:"mode",MULTIPLE:"multiple",DEBOUNCE:"debounce",FILTER_ON_FOCUS:"filter-on-focus",FILTER_FOCUS_FIRST:"filter-focus-first",ALLOW_UNMATCHED:"allow-unmatched",POPUP_TARGET:"popup-target",POPUP_CLASSES:"popup-classes",OPTION_LIMIT:"option-limit",OBSERVE_SCROLL:"observe-scroll",OBSERVE_SCROLL_THRESHOLD:"observe-scroll-threshold",SYNC_POPUP_WIDTH:"sync-popup-width",OPEN:"open",MATCH_KEY:"match-key",FILTER_TEXT:"filter-text",DROPDOWN_ICON_OPEN:"data-forge-dropdown-icon-open"},fe={INPUT:re.selectors.INPUT,DROPDOWN_ICON:"[data-forge-dropdown-icon],[data-forge-dropdown-icon],[forge-dropdown-icon],.forge-dropdown-icon",CLEAR_BUTTON:"[data-forge-autocomplete-clear],[forge-autocomplete-clear]"},ve={DEFAULT_DEBOUNCE_TIME:V,NUM_SKELETON_ITEMS:3},be={CHANGE:`${g}-change`,SELECT:`${g}-select`,SCROLLED_BOTTOM:`${g}-scrolled-bottom`},o={elementName:g,attributes:me,selectors:fe,numbers:ve,events:be},ue=(e=>(e.Default="default",e.Stateless="stateless",e))(ue||{});var O=class extends R{constructor(e){super(e);this.setInputElement()}setInputElement(){let e=M(this._component,o.selectors.INPUT,!1);return e.length&&(this._inputElement=e[0]),this._inputElement}setInputAttribute(e,t){this._inputElement.setAttribute(e,t)}addInputListener(e,t){this._inputElement.addEventListener(e,t)}removeInputListener(e,t){this._inputElement.removeEventListener(e,t)}initializeInputAccessibility(e){this._inputElement.setAttribute("autocomplete","off"),this._inputElement.setAttribute("role","combobox"),this._inputElement.setAttribute("aria-live","polite"),this._inputElement.setAttribute("aria-atomic","true"),this._inputElement.setAttribute("aria-haspopup","true"),this._inputElement.setAttribute("aria-expanded","false"),this._inputElement.setAttribute("aria-autocomplete","list")}isWrappingChipField(){return!!this._component.querySelector(F.elementName)}show(e,t){this._targetElement=this._getTargetElement(t),this._targetElement&&(this._listDropdown=new oe(this._targetElement,e),this._listDropdown.open(),this._inputElement.setAttribute("aria-expanded","true"),this._inputElement.setAttribute("aria-controls",`list-dropdown-popup-${e.id}`),this._tryToggleDropdownIconRotation(!0))}hide(e){if(!this._listDropdown)return;let{targetElement:t}=this._listDropdown.dropdownElement;t.removeEventListener(C.events.BLUR,e),this.setBusyVisibility(!1),this._tryToggleDropdownIconRotation(!1),this._inputElement.removeAttribute("aria-activedescendant"),this._inputElement.removeAttribute("aria-controls"),this._inputElement.setAttribute("aria-expanded","false"),this._listDropdown.close(),this._listDropdown=void 0}setBusyVisibility(e){var t;(t=this._listDropdown)==null||t.setBusyVisibility(e)}setDismissListener(e){if(!this._listDropdown||!this._listDropdown.dropdownElement)return;let t=this._listDropdown.dropdownElement;t.targetElement&&t.targetElement.addEventListener(C.events.BLUR,e)}focus(){window.requestAnimationFrame(()=>this._inputElement.focus())}setOptions(e){var t;(t=this._listDropdown)==null||t.setOptions(e)}appendOptions(e){var t;(t=this._listDropdown)==null||t.appendOptions(e)}setSelectedText(e){this._inputElement.value=e}getInputValue(){return this._inputElement.value}setInputValue(e){this._inputElement.value=e}selectInputValue(){window.requestAnimationFrame(()=>this._inputElement.select())}isFocusWithinPopup(e){return!this._listDropdown||!this._listDropdown.dropdownElement?!1:this._listDropdown.dropdownElement.contains(e)}hasFocus(){let e=k(this._component.ownerDocument);return e===this._inputElement||this.isFocusWithinPopup(e)}hasInputElement(){return!!this._inputElement}setDropdownIconListener(e,t){window.requestAnimationFrame(()=>{let i=this._component.querySelector(o.selectors.DROPDOWN_ICON);i&&i.addEventListener(e,t)})}removeDropdownIconListener(e,t){let i=this._component.querySelector(o.selectors.DROPDOWN_ICON);i&&i.removeEventListener(e,t)}setClearButtonListener(e,t){window.requestAnimationFrame(()=>{let i=this._component.querySelector(o.selectors.CLEAR_BUTTON);i&&i.addEventListener(e,t)})}removeClearButtonListener(e,t){let i=this._component.querySelector(o.selectors.CLEAR_BUTTON);i&&i.removeEventListener(e,t)}propagateKey(e){var t;(t=this._listDropdown)==null||t.handleKey(e)}updateActiveDescendant(e){this._targetElement&&A(this._inputElement,!!e,"aria-activedescendant",e)}getTargetElementWidth(e){return this._targetElement||(this._targetElement=this._getTargetElement(e)),this._targetElement.getBoundingClientRect().width}getPopupElement(){var e,t;return(t=(e=this._listDropdown)==null?void 0:e.dropdownElement)!=null?t:null}activateFirstOption(){var e;(e=this._listDropdown)==null||e.activateFirstOption()}activateSelectedOption(){var e;(e=this._listDropdown)==null||e.activateSelectedOption()}activateOptionByIndex(e){var t;(t=this._listDropdown)==null||t.activateOption(e)}getActiveOptionIndex(){var e,t;return(t=(e=this._listDropdown)==null?void 0:e.getActiveOptionIndex())!=null?t:null}clearActiveOption(){var e;(e=this._listDropdown)==null||e.clearActiveOption()}setSelectedOptions(e){if(this._listDropdown){let t=e.map(i=>i.value);this._listDropdown.setSelectedValues(t)}}queueDropdownPositionUpdate(){this.getPopupElement()&&window.requestAnimationFrame(()=>{let e=this.getPopupElement();e==null||e.position()})}_getTargetElement(e){return e?this._component.querySelector(e)||this._getDefaultTargetElement():this._getDefaultTargetElement()}_getDefaultTargetElement(){let e=this._component.querySelector("forge-text-field");if(e&&e.shadowRoot){let i=L(e,le.selectors.ROOT);if(i)return i}let t=this._component.querySelector("forge-chip-field");if(t&&t.shadowRoot){let i=L(t,F.selectors.ROOT);if(i)return i}return this._component.querySelector("input")||this._component}_tryToggleDropdownIconRotation(e){let t=this._component.querySelector(o.selectors.DROPDOWN_ICON);t&&A(t,e,o.attributes.DROPDOWN_ICON_OPEN)}};var de=(e=>(e[e.Option=0]="Option",e[e.Group=1]="Group",e))(de||{});function v(u,d){let e=u.some(i=>h(i)&&T(i)&&i.hasOwnProperty("options")&&(i.hasOwnProperty("text")||i.hasOwnProperty("builder"))),t=u.some(i=>h(i)&&T(i)&&i.hasOwnProperty("label")&&i.hasOwnProperty("value"));return e&&d===1||t&&d===0}function ce(u,d){return u.find(e=>e.value===d)}function b(u,d,e=null){return e?!(e in u.value)||!(e in d)?!1:w(u.value[e],d[e]):w(u.value,d)}var I=class extends ne{constructor(e){super();this._adapter=e;this._isInitialized=!1;this._isDropdownOpen=!1;this._mode="default";this._multiple=!1;this._debounce=o.numbers.DEFAULT_DEBOUNCE_TIME;this._allowUnmatched=!1;this._filterOnFocus=!0;this._filterFocusFirst=!0;this._options=[];this._filterText="";this._selectedOptions=[];this._values=[];this._pendingFilterPromises=[];this._matchKey=null;this._clickListener=t=>this._onClick(t),this._focusListener=()=>this._onFocus(),this._blurListener=t=>this._onBlur(t),this._keydownListener=t=>this._onKeydown(t),this._dropdownIconClickListener=t=>this._onDropdownIconClick(t),this._dropdownScrollEndListener=()=>this._onDropdownScrollEnd(),this._dropdownIconMouseDownListener=t=>this._onDropdownIconMouseDown(t),this._clearButtonListener=t=>this._onClear(t),this._dismissListener=()=>this._onDismiss(),this._activeChangeListener=t=>this._adapter.updateActiveDescendant(t),this._targetWidthCallback=()=>this._adapter.getTargetElementWidth(this._popupTarget),this._identifier=y()}async initialize(){if(!this._adapter.hasInputElement()&&!this._adapter.setInputElement())throw new Error("An input element is required as a child of the autocomplete component.");if(this._setInputListener(),this._setFilterCallback(),this._attachListeners(),this._initializeAccessibility(),this._values.length){if(!this._selectedOptions.length){try{await this._executeFilter()}catch(e){console.error(e)}this._updateSelectedOptions(this._values)}this._adapter.setSelectedText(this._getSelectedText())}this._isInitialized=!0}disconnect(){this._isInitialized&&(this._detachListeners(),this._isInitialized=!1),this._isDropdownOpen&&this._closeDropdown()}async forceFilter({preserveValue:e}){this._options=[],await this._executeFilter(!0,!0),e&&this._options.push(...this._selectedOptions),this._applyValue(this._values)}_attachListeners(){this._adapter.addInputListener("click",this._clickListener),this._adapter.addInputListener("focus",this._focusListener),this._adapter.addInputListener("blur",this._blurListener),this._adapter.addInputListener("input",this._inputListener),this._adapter.addInputListener("keydown",this._keydownListener),this._adapter.setDropdownIconListener("click",this._dropdownIconClickListener),this._adapter.setDropdownIconListener("mousedown",this._dropdownIconMouseDownListener),this._adapter.setClearButtonListener("click",this._clearButtonListener)}_detachListeners(){this._adapter.removeInputListener("click",this._clickListener),this._adapter.removeInputListener("focus",this._focusListener),this._adapter.removeInputListener("blur",this._blurListener),this._adapter.removeInputListener("input",this._inputListener),this._adapter.removeInputListener("keydown",this._keydownListener),this._adapter.removeDropdownIconListener("click",this._dropdownIconClickListener),this._adapter.removeDropdownIconListener("mousedown",this._dropdownIconMouseDownListener),this._adapter.removeClearButtonListener("click",this._clearButtonListener)}_setInputListener(){this._inputListener=e=>this._onInput(e)}_setFilterCallback(){this._filterFn=h(this._debounce)&&this._debounce>0?P(this._debounceFilter,this._debounce,!1):this._debounceFilter}_initializeAccessibility(){this._adapter.initializeInputAccessibility(this._identifier)}get _flatOptions(){return v(this._options,1)?this._options.reduce((e,t)=>e.concat(t.options),[]):this._options}_onClick(e){!this._isDropdownOpen&&this._filterOnFocus&&this._showDropdown()}_onDropdownIconMouseDown(e){e.preventDefault()}_onDropdownIconClick(e){this._isDropdownOpen?this._closeDropdown():(this._adapter.focus(),window.requestAnimationFrame(()=>this._showDropdown()))}_onClear(e){this._filterText="",this._clearValue(),this._adapter.setSelectedText(this._getSelectedText())}_onDropdownScrollEnd(){this._adapter.emitHostEvent(o.events.SCROLLED_BOTTOM)}_onFocus(){!this._isDropdownOpen&&this._adapter.getInputValue()&&!D.isMobile&&this._adapter.selectInputValue()}_onBlur(e){this._adapter.isFocusWithinPopup(e.relatedTarget)||this._applyBlur()}_applyBlur(){this._isDropdownOpen&&this._closeDropdown(),this._mode!=="stateless"&&(this._selectedOptions.length?this._adapter.setSelectedText(this._getSelectedText()):this._allowUnmatched||(this._filterText="",this._adapter.setSelectedText("")))}_onInput(e){this._selectedOptions.length&&!this._multiple&&(!this._adapter.getInputValue()||this._allowUnmatched)&&!this._adapter.isWrappingChipField()&&(this._selectedOptions=[],this._values=[],this._emitChangeEvent()),this._filterText=this._adapter.getInputValue(),this._filterFn()}async _debounceFilter({checkFocus:e=!0}={}){if(!e&&!this._adapter.hasFocus()){this._pendingFilterPromises=[],this._isDropdownOpen&&this._closeDropdown();return}let t=this._filterText,i=this._executeFilter();this._pendingFilterPromises.push(i),this._isDropdownOpen?this._adapter.setBusyVisibility(!0):this._showDropdown({filter:!1});try{await i}catch(n){this._pendingFilterPromises=[],this._isDropdownOpen&&this._closeDropdown();return}if(t===this._filterText)this._pendingFilterPromises=[],this._onFilterComplete();else{let n=this._pendingFilterPromises.indexOf(i);n!==-1&&this._pendingFilterPromises.splice(n,1)}}_onKeydown(e){switch(e.key){case"Tab":this._isDropdownOpen&&!this._multiple&&this._selectActiveOption(!1);break;case"Esc":case"Escape":this._isDropdownOpen&&(e.preventDefault(),e.stopPropagation(),this._closeDropdown());break;case"Down":case"ArrowDown":e.preventDefault(),this._isDropdownOpen?this._adapter.propagateKey(e.key):this._showDropdown({activateFirst:!0,activateSelected:!0});break;case"Up":case"ArrowUp":e.preventDefault(),this._isDropdownOpen&&this._adapter.propagateKey(e.key);break;case"Enter":case"Home":case"End":this._isDropdownOpen&&(e.key==="Enter"&&e.stopPropagation(),e.preventDefault(),this._adapter.propagateKey(e.key));break;case"Backspace":case"Delete":let t=e.target,i=this._adapter.getInputValue(),n=t.value.substring(t.selectionStart,t.selectionEnd)===t.value,l=i.length===1&&t.selectionEnd===1,c=i.length===1&&t.selectionEnd===0,_=!i||n||l||c;!this._adapter.isWrappingChipField()&&_&&!this._multiple&&this._values.length&&this._clearValue();break}}_executeFilter(e=!0,t=!1){if(!this._filter||typeof this._filter!="function")throw new Error('A filter callback must be provided. Did you set the "filter" property?');let i=this._filter,n=e?this._filterText:"",l=t?this._getValue():null;return new Promise((c,_)=>Promise.resolve(i(n,l)).then(r=>{this._options=r,c(this._options)}).catch(r=>_(`An unexpected error occurred while filtering: ${r}`)))}_onFilterComplete(){if(!this._adapter.hasFocus()){this._isDropdownOpen&&this._closeDropdown();return}if(this._options.length){let e=this._allowUnmatched&&!this._selectedOptions.length;this._dropdownReady({userTriggered:e}),this._filterFocusFirst&&this._filterText&&this._adapter.activateFirstOption()}else this._closeDropdown()}_clearValue(){this._selectedOptions=[],this._values=[],this._isDropdownOpen&&(this._adapter.setSelectedOptions([]),this._adapter.clearActiveOption()),this._emitChangeEvent()}async _showDropdown({filter:e=!0,userTriggered:t=!0,activateFirst:i=!1,activateSelected:n=!1}={}){let l=this._allowUnmatched&&!this._selectedOptions.length;this._isDropdownOpen=!0;let c;if(this._optionBuilder){let r=this._optionBuilder;c=(m,_e)=>r(m,this._filterText,_e)}let _={options:this._options,multiple:this._multiple,selectedValues:[...this._values],id:`forge-autocomplete-${this._identifier}`,asyncStyle:"skeleton",optionLimit:this._optionLimit,popupClasses:this._popupClasses,headerBuilder:this._popupHeaderBuilder,footerBuilder:this._popupFooterBuilder,transform:r=>{if(this._filterText){let m=$(r,this._filterText);if(m)return m}return r},allowBusy:!0,optionBuilder:c,syncWidth:this._syncPopupWidth,observeScroll:this._observeScroll,observeScrollThreshold:this._observeScrollThreshold,scrollEndListener:this._dropdownScrollEndListener,activeChangeCallback:this._activeChangeListener,targetWidthCallback:this._targetWidthCallback,selectCallback:r=>this._onSelect(r),closeCallback:()=>this._closeDropdown()};if(this._adapter.show(_,this._popupTarget),this._adapter.toggleHostAttribute(o.attributes.OPEN,this._isDropdownOpen),e){this._options.length&&this._adapter.setBusyVisibility(!0);try{await this._executeFilter(l)}catch(r){console.error(r)}this._updateSelectedOptions(this._values)}this._pendingFilterPromises.length||this._dropdownReady({userTriggered:t,activateFirst:i,activateSelected:n})}_dropdownReady({userTriggered:e=!0,activateFirst:t=!1,activateSelected:i=!1}={}){if(!this._isDropdownOpen||!this._options.length||e&&!this._adapter.hasFocus()){this._closeDropdown();return}this._sortSelectedOptions(),this._adapter.setBusyVisibility(!1),this._adapter.setOptions(this._options),this._adapter.setSelectedOptions(this._selectedOptions),this._adapter.setDismissListener(this._dismissListener),i&&this._selectedOptions.length?this._adapter.activateSelectedOption():t&&this._adapter.activateFirstOption()}_closeDropdown(){this._multiple&&(this._filterText=""),this._isDropdownOpen=!1,this._adapter.hide(this._dismissListener),this._sortSelectedOptions(),this._adapter.toggleHostAttribute(o.attributes.OPEN,this._isDropdownOpen)}_sortSelectedOptions(){if(this._multiple&&this._selectedOptions.length&&v(this._options,0)){let e=[],t=[];this._options.forEach(i=>{this._selectedOptions.find(n=>b(n,i.value,this._matchKey))?e.push(i):t.push(i)}),this._options=[...e,...t]}}async _onSelect(e,t=!0){if(this._valueChanging)return;if(this._mode==="stateless"){let n={value:e};this._adapter.emitHostEvent(o.events.SELECT,n,!0,!0)&&(this._filterText="",this._multiple||this._closeDropdown());return}let i=()=>{let l=this._flatOptions.find(r=>b(r,e,this._matchKey)),c=l?l.value:"",_=l?l.label:"";if(this._multiple){let r=ce(this._selectedOptions,c);if(r){let m=this._selectedOptions.indexOf(r);this._selectedOptions.splice(m,1)}else this._selectedOptions.push(l)}else h(c)?(this._selectedOptions[0]=l,this._filterText=_):(this._selectedOptions=[],this._filterText="");this._isDropdownOpen&&this._adapter.setSelectedOptions(this._selectedOptions),this._values=this._selectedOptions.map(r=>r.value),this._adapter.setSelectedText(this._getSelectedText()),!D.isMobile&&t&&this._adapter.selectInputValue(),this._emitChangeEvent(),this._tryUpdateDropdownPosition()};this._isDropdownOpen&&!this._multiple&&this._closeDropdown(),typeof this._beforeValueChange=="function"?(this._valueChanging=Promise.resolve(this._beforeValueChange.call(null,e,this._matchKey)),await this._valueChanging?i():this._tryUpdateDropdownPosition(),this._valueChanging=void 0):i()}_selectActiveOption(e=!0){let t=this._adapter.getActiveOptionIndex();if(typeof t=="number"&&t>=0){let i=this._flatOptions[t];i&&this._onSelect(i.value,e)}}_emitChangeEvent(){this._adapter.emitHostEvent(o.events.CHANGE,this._getValue(),!0)}_tryUpdateDropdownPosition(){this._isDropdownOpen&&this._adapter.queueDropdownPositionUpdate()}_getValue(){return this._values?this._values.length?this._multiple?[...this._values]:this._values[0]:this._multiple?[]:null:null}_getSelectedText(){var e,t;return this._adapter.isWrappingChipField()?"":this._selectedTextBuilder?this._selectedTextBuilder(this._selectedOptions):this._multiple?this._values.length?this._values.length===1?(t=(e=this._selectedOptions[0])==null?void 0:e.label)!=null?t:"":`${this._values.length} options selected`:"":this._selectedOptions.filter(i=>i&&i.label).map(i=>i.label).join(" ").trim()}_onDismiss(){this._closeDropdown()}async _applyValue(e){let t=[];this._selectedOptions=[],Array.isArray(e)?t=e:t=h(e)?[e]:[],!this._multiple&&t.length>1&&(t=[t[0]]),v(t,0)?(this._values=t.map(n=>n.value),this._selectedOptions=t):this._values=t;let i=this._flatOptions;if(t.length&&i.length&&this._updateSelectedOptions(t),this._values.length&&!this._selectedOptions.length&&this._filter&&this._isInitialized){try{await this._executeFilter(!1,!0)}catch(n){console.error(n)}this._updateSelectedOptions(this._values)}this._multiple?this._filterText="":this._filterText=this._selectedOptions.length?this._selectedOptions[0].label:"",this._isInitialized&&this._adapter.setSelectedText(this._getSelectedText()),this._isDropdownOpen&&this._adapter.setSelectedOptions(this._selectedOptions)}_updateSelectedOptions(e){let t=[...this._flatOptions,...this._selectedOptions];if(this._selectedOptions.length&&(this._selectedOptions=[]),v(e,0))for(let i of e){let n=t.find(l=>b(l,i.value,this._matchKey));n?this._selectedOptions.push(n):this._selectedOptions.push(i)}else for(let i of e){let n=t.find(l=>b(l,i,this._matchKey));n?this._selectedOptions.push(n):this._allowUnmatched&&this._selectedOptions.push({label:i,value:i})}}get mode(){return this._mode}set mode(e){this._mode!==e&&(this._mode=e,this._mode==="stateless"&&(this._selectedOptions=[],this._isDropdownOpen&&this._closeDropdown()),this._adapter.setHostAttribute(o.attributes.MODE,this._mode))}get multiple(){return this._multiple}set multiple(e){this._multiple!==e&&(this._multiple=e,this._adapter.setHostAttribute(o.attributes.MULTIPLE,h(this._multiple)?this._multiple.toString():""))}get value(){return this._getValue()}set value(e){let t=[];e==null?t=[]:Array.isArray(e)?t=structuredClone(e):x(e)?t=[e]:t=[structuredClone(e)],(t.length!==this._values.length||t.some(n=>!this._values.includes(n)))&&this._applyValue(e)}get filterOnFocus(){return this._filterOnFocus}set filterOnFocus(e){this._filterOnFocus!==e&&(this._filterOnFocus=e,this._adapter.setHostAttribute(o.attributes.FILTER_ON_FOCUS,h(this._filterOnFocus)?this._filterOnFocus.toString():""))}get filterFocusFirst(){return this._filterFocusFirst}set filterFocusFirst(e){this._filterFocusFirst!==e&&(this._filterFocusFirst=e,this._adapter.toggleHostAttribute(o.attributes.FILTER_FOCUS_FIRST,this._filterFocusFirst))}get allowUnmatched(){return this._allowUnmatched}set allowUnmatched(e){this._allowUnmatched!==e&&(this._allowUnmatched=e,h(this._allowUnmatched)&&this._adapter.setHostAttribute(o.attributes.ALLOW_UNMATCHED,this._allowUnmatched.toString()))}get matchKey(){return this._matchKey}set matchKey(e){this._matchKey!==e&&(this._matchKey=e)}get popupTarget(){return this._popupTarget}set popupTarget(e){this._popupTarget!==e&&(this._popupTarget=e)}get filterText(){return this._filterText}set filterText(e){this._filterText!==e&&(this._filterText=this._allowUnmatched?e:"",this._isInitialized&&this._allowUnmatched&&(this._adapter.setInputValue(this._filterText),this._isDropdownOpen&&this._debounceFilter({checkFocus:!1})))}get popupClasses(){return Array.isArray(this._popupClasses)?[...this._popupClasses]:[this._popupClasses]}set popupClasses(e){this._popupClasses!==e&&(this._popupClasses=Array.isArray(e)?[...e]:[e])}set popupHeaderBuilder(e){this._popupHeaderBuilder=e}set popupFooterBuilder(e){this._popupFooterBuilder=e}get syncPopupWidth(){return this._syncPopupWidth}set syncPopupWidth(e){this._syncPopupWidth!==e&&(this._syncPopupWidth=e)}get optionLimit(){return this._optionLimit}set optionLimit(e){this._optionLimit!==e&&(this._optionLimit=e)}get debounce(){return this._debounce}set debounce(e){this._debounce!==e&&(this._debounce=e,this._isInitialized&&this._setFilterCallback(),this._adapter.setHostAttribute(o.attributes.DEBOUNCE,h(this._debounce)?this._debounce.toString():""))}get optionBuilder(){return this._optionBuilder}set optionBuilder(e){this._optionBuilder=e}get filter(){return this._filter}set filter(e){this._filter!==e&&(this._filter=e,this._isInitialized&&this._values.length&&!this._flatOptions.length&&this._filter&&this._executeFilter().then(()=>{this._updateSelectedOptions(this._values),this._adapter.setSelectedText(this._getSelectedText())}))}get selectedTextBuilder(){return this._selectedTextBuilder}set selectedTextBuilder(e){this._selectedTextBuilder=e,this._selectedOptions.length&&this._adapter.setSelectedText(this._getSelectedText())}get observeScroll(){return this._observeScroll}set observeScroll(e){this._observeScroll=e}get observeScrollThreshold(){return this._observeScrollThreshold}set observeScrollThreshold(e){this._observeScrollThreshold=e}appendOptions(e){this._isDropdownOpen&&(this._options=[...this._options,...e],this._adapter.appendOptions(e))}get isInitialized(){return this._isInitialized}get open(){return this._isDropdownOpen}set open(e){this._isDropdownOpen!==e&&(e?this._showDropdown({userTriggered:!1}):this._closeDropdown())}get beforeValueChange(){return this._beforeValueChange}set beforeValueChange(e){e!==this._beforeValueChange&&(this._beforeValueChange=e)}get popupElement(){return this._adapter.getPopupElement()}};var ge="<template><slot></slot></template>",Oe=":host{display:block}:host([hidden]){display:none}",s=class extends Z{constructor(){super();Y.define([W,q,K]),U(this,ge,Oe),this._foundation=new I(new O(this))}static get observedAttributes(){return[o.attributes.MODE,o.attributes.MULTIPLE,o.attributes.DEBOUNCE,o.attributes.FILTER_ON_FOCUS,o.attributes.FILTER_FOCUS_FIRST,o.attributes.ALLOW_UNMATCHED,o.attributes.POPUP_TARGET,o.attributes.POPUP_CLASSES,o.attributes.OBSERVE_SCROLL,o.attributes.OBSERVE_SCROLL_THRESHOLD,o.attributes.OPTION_LIMIT,o.attributes.SYNC_POPUP_WIDTH,o.attributes.OPEN,o.attributes.MATCH_KEY,o.attributes.FILTER_TEXT]}connectedCallback(){this.querySelector(o.selectors.INPUT)?this._foundation.initialize():B(this,o.selectors.INPUT).then(()=>this._foundation.initialize())}disconnectedCallback(){this._foundation.disconnect()}attributeChangedCallback(e,t,i){switch(super.attributeChangedCallback(e,t,i),e){case o.attributes.MODE:this.mode=i;break;case o.attributes.MULTIPLE:this.multiple=f(i);break;case o.attributes.DEBOUNCE:this.debounce=S(i);break;case o.attributes.FILTER_ON_FOCUS:this.filterOnFocus=f(i);break;case o.attributes.FILTER_FOCUS_FIRST:this.filterFocusFirst=f(i);break;case o.attributes.ALLOW_UNMATCHED:this.allowUnmatched=f(i);break;case o.attributes.POPUP_TARGET:this.popupTarget=i;break;case o.attributes.OPEN:this.open=f(i);break;case o.attributes.MATCH_KEY:this.matchKey=i;break;case o.attributes.FILTER_TEXT:this.filterText=i;break}}appendOptions(e){this._foundation.appendOptions(e)}openDropdown(){this.open=!0}closeDropdown(){this.open=!1}forceFilter(e={preserveValue:!1}){this._foundation.forceFilter(e)}};p([a()],s.prototype,"mode",2),p([a()],s.prototype,"multiple",2),p([a()],s.prototype,"value",2),p([a()],s.prototype,"debounce",2),p([a()],s.prototype,"filterOnFocus",2),p([a()],s.prototype,"filterFocusFirst",2),p([a()],s.prototype,"allowUnmatched",2),p([a()],s.prototype,"popupTarget",2),p([a()],s.prototype,"filterText",2),p([a()],s.prototype,"optionBuilder",2),p([a()],s.prototype,"filter",2),p([a()],s.prototype,"selectedTextBuilder",2),p([a()],s.prototype,"open",2),p([a()],s.prototype,"matchKey",2),p([a({set:!1})],s.prototype,"isInitialized",2),p([a({set:!1})],s.prototype,"popupElement",2),p([a()],s.prototype,"beforeValueChange",2),s=p([H({name:o.elementName,dependencies:[pe,ee,J,Q,se,ie,te,X]})],s);var he=class extends z{constructor(e){super(e)}_build(){let e=document.createElement(o.elementName);return this._attachTextField(e),e}get textFieldDelegate(){return this._textFieldDelegate}get value(){return this._element.value}set value(e){this._element.value=e}get disabled(){return this._textFieldDelegate.inputElement.disabled}set disabled(e){this._textFieldDelegate.inputElement.disabled=e}get invalid(){return this._textFieldDelegate.invalid||!1}set invalid(e){this._textFieldDelegate.invalid=e}onChange(e){this._element.addEventListener(o.events.CHANGE,t=>e(t.detail))}onFocus(e){this._textFieldDelegate.inputElement.addEventListener("focus",t=>e(t))}onBlur(e){this._textFieldDelegate.inputElement.addEventListener("blur",t=>e(t))}_attachTextField(e){var i,n,l,c,_,r;let t={props:E({},(n=(i=this._config.options)==null?void 0:i.textFieldDelegateConfig)==null?void 0:n.props),options:E({},(c=(l=this._config.options)==null?void 0:l.textFieldDelegateConfig)==null?void 0:c.options)};t.options||(t.options={}),((_=this._config.options)==null?void 0:_.useDropdownIcon)!==!1&&!((r=t.options)!=null&&r.trailingElement)&&(t.options.trailingElement=this._createDropdownIconElement()),this._textFieldDelegate=new ae(t),e.appendChild(this._textFieldDelegate.element)}_createDropdownIconElement(){let e={props:{slot:"trailing",name:"arrow_drop_down"},options:{attributes:{"forge-dropdown-icon":""}}};return new j(e).element}};function Wt(){N(s)}export{o as a,ue as b,O as c,de as d,v as e,ce as f,b as g,I as h,s as i,he as j,Wt as k};
|
|
7
|
-
//# sourceMappingURL=chunk.
|
|
6
|
+
import{a as F}from"./chunk.JBQXD3FJ.js";import{b as se}from"./chunk.PZAL7VQF.js";import{a as Z}from"./chunk.66RZ2CUB.js";import{h as oe,i as ne}from"./chunk.CJUX3PL5.js";import{c as J}from"./chunk.IE42X2LV.js";import{f as Q}from"./chunk.OWYOZF53.js";import{b as te}from"./chunk.STIZCKQA.js";import{a as C,e as ee}from"./chunk.253H47GA.js";import{b as ie}from"./chunk.JLDKNU5Q.js";import{c as pe}from"./chunk.O5HBMTSZ.js";import{a as le,b as ae}from"./chunk.LEN33O6V.js";import{a as re}from"./chunk.ZSZFWZAI.js";import{a as j}from"./chunk.OR5GB6X3.js";import{c as W,g as K,h as q}from"./chunk.EWT2PBEP.js";import{d as Y,l as X}from"./chunk.L7BSLZCB.js";import{a as z}from"./chunk.YTBNAGLS.js";import{a as $}from"./chunk.4SP42UG3.js";import{a as R}from"./chunk.ZY3ETQ3D.js";import{a}from"./chunk.NVUMRW44.js";import{a as H,b as G,c as V}from"./chunk.UVXKHQQZ.js";import{a as N,e as U,f as L}from"./chunk.TPXXHX5J.js";import{a as D}from"./chunk.MGLWXAZO.js";import{m as B,s as M,t as k,v as A}from"./chunk.HZUQXCOQ.js";import{a as y,b as h,c as x,j as T,k as f,l as S,n as w,o as P}from"./chunk.J2M2MXP2.js";import{a as E,d as p}from"./chunk.M3QDAYD2.js";var g=`${G}autocomplete`,me={MODE:"mode",MULTIPLE:"multiple",DEBOUNCE:"debounce",FILTER_ON_FOCUS:"filter-on-focus",FILTER_FOCUS_FIRST:"filter-focus-first",ALLOW_UNMATCHED:"allow-unmatched",POPUP_TARGET:"popup-target",POPUP_CLASSES:"popup-classes",OPTION_LIMIT:"option-limit",OBSERVE_SCROLL:"observe-scroll",OBSERVE_SCROLL_THRESHOLD:"observe-scroll-threshold",SYNC_POPUP_WIDTH:"sync-popup-width",OPEN:"open",MATCH_KEY:"match-key",FILTER_TEXT:"filter-text",DROPDOWN_ICON_OPEN:"data-forge-dropdown-icon-open"},fe={INPUT:re.selectors.INPUT,DROPDOWN_ICON:"[data-forge-dropdown-icon],[data-forge-dropdown-icon],[forge-dropdown-icon],.forge-dropdown-icon",CLEAR_BUTTON:"[data-forge-autocomplete-clear],[forge-autocomplete-clear]"},ve={DEFAULT_DEBOUNCE_TIME:V,NUM_SKELETON_ITEMS:3},be={CHANGE:`${g}-change`,SELECT:`${g}-select`,SCROLLED_BOTTOM:`${g}-scrolled-bottom`},o={elementName:g,attributes:me,selectors:fe,numbers:ve,events:be},ue=(e=>(e.Default="default",e.Stateless="stateless",e))(ue||{});var O=class extends R{constructor(e){super(e);this.setInputElement()}setInputElement(){let e=M(this._component,o.selectors.INPUT,!1);return e.length&&(this._inputElement=e[0]),this._inputElement}setInputAttribute(e,t){this._inputElement.setAttribute(e,t)}addInputListener(e,t){this._inputElement.addEventListener(e,t)}removeInputListener(e,t){this._inputElement.removeEventListener(e,t)}initializeInputAccessibility(e){this._inputElement.setAttribute("autocomplete","off"),this._inputElement.setAttribute("role","combobox"),this._inputElement.setAttribute("aria-live","polite"),this._inputElement.setAttribute("aria-atomic","true"),this._inputElement.setAttribute("aria-haspopup","true"),this._inputElement.setAttribute("aria-expanded","false"),this._inputElement.setAttribute("aria-autocomplete","list")}isWrappingChipField(){return!!this._component.querySelector(F.elementName)}show(e,t){this._targetElement=this._getTargetElement(t),this._targetElement&&(this._listDropdown=new oe(this._targetElement,e),this._listDropdown.open(),this._inputElement.setAttribute("aria-expanded","true"),this._inputElement.setAttribute("aria-controls",`list-dropdown-popup-${e.id}`),this._tryToggleDropdownIconRotation(!0))}hide(e){if(!this._listDropdown)return;let{targetElement:t}=this._listDropdown.dropdownElement;t.removeEventListener(C.events.BLUR,e),this.setBusyVisibility(!1),this._tryToggleDropdownIconRotation(!1),this._inputElement.removeAttribute("aria-activedescendant"),this._inputElement.removeAttribute("aria-controls"),this._inputElement.setAttribute("aria-expanded","false"),this._listDropdown.close(),this._listDropdown=void 0}setBusyVisibility(e){var t;(t=this._listDropdown)==null||t.setBusyVisibility(e)}setDismissListener(e){if(!this._listDropdown||!this._listDropdown.dropdownElement)return;let t=this._listDropdown.dropdownElement;t.targetElement&&t.targetElement.addEventListener(C.events.BLUR,e)}focus(){window.requestAnimationFrame(()=>this._inputElement.focus())}setOptions(e){var t;(t=this._listDropdown)==null||t.setOptions(e)}appendOptions(e){var t;(t=this._listDropdown)==null||t.appendOptions(e)}setSelectedText(e){this._inputElement.value=e}getInputValue(){return this._inputElement.value}setInputValue(e){this._inputElement.value=e}selectInputValue(){window.requestAnimationFrame(()=>this._inputElement.select())}isFocusWithinPopup(e){return!this._listDropdown||!this._listDropdown.dropdownElement?!1:this._listDropdown.dropdownElement.contains(e)}hasFocus(){let e=k(this._component.ownerDocument);return e===this._inputElement||this.isFocusWithinPopup(e)}hasInputElement(){return!!this._inputElement}setDropdownIconListener(e,t){window.requestAnimationFrame(()=>{let i=this._component.querySelector(o.selectors.DROPDOWN_ICON);i&&i.addEventListener(e,t)})}removeDropdownIconListener(e,t){let i=this._component.querySelector(o.selectors.DROPDOWN_ICON);i&&i.removeEventListener(e,t)}setClearButtonListener(e,t){window.requestAnimationFrame(()=>{let i=this._component.querySelector(o.selectors.CLEAR_BUTTON);i&&i.addEventListener(e,t)})}removeClearButtonListener(e,t){let i=this._component.querySelector(o.selectors.CLEAR_BUTTON);i&&i.removeEventListener(e,t)}propagateKey(e){var t;(t=this._listDropdown)==null||t.handleKey(e)}updateActiveDescendant(e){this._targetElement&&A(this._inputElement,!!e,"aria-activedescendant",e)}getTargetElementWidth(e){return this._targetElement||(this._targetElement=this._getTargetElement(e)),this._targetElement.getBoundingClientRect().width}getPopupElement(){var e,t;return(t=(e=this._listDropdown)==null?void 0:e.dropdownElement)!=null?t:null}activateFirstOption(){var e;(e=this._listDropdown)==null||e.activateFirstOption()}activateSelectedOption(){var e;(e=this._listDropdown)==null||e.activateSelectedOption()}activateOptionByIndex(e){var t;(t=this._listDropdown)==null||t.activateOption(e)}getActiveOptionIndex(){var e,t;return(t=(e=this._listDropdown)==null?void 0:e.getActiveOptionIndex())!=null?t:null}clearActiveOption(){var e;(e=this._listDropdown)==null||e.clearActiveOption()}setSelectedOptions(e){if(this._listDropdown){let t=e.map(i=>i.value);this._listDropdown.setSelectedValues(t)}}queueDropdownPositionUpdate(){this.getPopupElement()&&window.requestAnimationFrame(()=>{let e=this.getPopupElement();e==null||e.position()})}_getTargetElement(e){return e?this._component.querySelector(e)||this._getDefaultTargetElement():this._getDefaultTargetElement()}_getDefaultTargetElement(){let e=this._component.querySelector("forge-text-field");if(e&&e.shadowRoot){let i=L(e,le.selectors.ROOT);if(i)return i}let t=this._component.querySelector("forge-chip-field");if(t&&t.shadowRoot){let i=L(t,F.selectors.ROOT);if(i)return i}return this._component.querySelector("input")||this._component}_tryToggleDropdownIconRotation(e){let t=this._component.querySelector(o.selectors.DROPDOWN_ICON);t&&A(t,e,o.attributes.DROPDOWN_ICON_OPEN)}};var de=(e=>(e[e.Option=0]="Option",e[e.Group=1]="Group",e))(de||{});function v(u,d){let e=u.some(i=>h(i)&&T(i)&&i.hasOwnProperty("options")&&(i.hasOwnProperty("text")||i.hasOwnProperty("builder"))),t=u.some(i=>h(i)&&T(i)&&i.hasOwnProperty("label")&&i.hasOwnProperty("value"));return e&&d===1||t&&d===0}function ce(u,d){return u.find(e=>e.value===d)}function b(u,d,e=null){return e?!(e in u.value)||!(e in d)?!1:w(u.value[e],d[e]):w(u.value,d)}var I=class extends ne{constructor(e){super();this._adapter=e;this._isInitialized=!1;this._isDropdownOpen=!1;this._mode="default";this._multiple=!1;this._debounce=o.numbers.DEFAULT_DEBOUNCE_TIME;this._allowUnmatched=!1;this._filterOnFocus=!0;this._filterFocusFirst=!0;this._options=[];this._filterText="";this._selectedOptions=[];this._values=[];this._pendingFilterPromises=[];this._matchKey=null;this._clickListener=t=>this._onClick(t),this._focusListener=()=>this._onFocus(),this._blurListener=t=>this._onBlur(t),this._keydownListener=t=>this._onKeydown(t),this._dropdownIconClickListener=t=>this._onDropdownIconClick(t),this._dropdownScrollEndListener=()=>this._onDropdownScrollEnd(),this._dropdownIconMouseDownListener=t=>this._onDropdownIconMouseDown(t),this._clearButtonListener=t=>this._onClear(t),this._dismissListener=()=>this._onDismiss(),this._activeChangeListener=t=>this._adapter.updateActiveDescendant(t),this._targetWidthCallback=()=>this._adapter.getTargetElementWidth(this._popupTarget),this._identifier=y()}async initialize(){if(!this._adapter.hasInputElement()&&!this._adapter.setInputElement())throw new Error("An input element is required as a child of the autocomplete component.");if(this._setInputListener(),this._setFilterCallback(),this._attachListeners(),this._initializeAccessibility(),this._values.length){if(!this._selectedOptions.length){try{await this._executeFilter()}catch(e){console.error(e)}this._updateSelectedOptions(this._values)}this._adapter.setSelectedText(this._getSelectedText())}this._isInitialized=!0}disconnect(){this._isInitialized&&(this._detachListeners(),this._isInitialized=!1),this._isDropdownOpen&&this._closeDropdown()}async forceFilter({preserveValue:e}){this._options=[],await this._executeFilter(!0,!0),e&&this._options.push(...this._selectedOptions),this._applyValue(this._values)}_attachListeners(){this._adapter.addInputListener("click",this._clickListener),this._adapter.addInputListener("focus",this._focusListener),this._adapter.addInputListener("blur",this._blurListener),this._adapter.addInputListener("input",this._inputListener),this._adapter.addInputListener("keydown",this._keydownListener),this._adapter.setDropdownIconListener("click",this._dropdownIconClickListener),this._adapter.setDropdownIconListener("mousedown",this._dropdownIconMouseDownListener),this._adapter.setClearButtonListener("click",this._clearButtonListener)}_detachListeners(){this._adapter.removeInputListener("click",this._clickListener),this._adapter.removeInputListener("focus",this._focusListener),this._adapter.removeInputListener("blur",this._blurListener),this._adapter.removeInputListener("input",this._inputListener),this._adapter.removeInputListener("keydown",this._keydownListener),this._adapter.removeDropdownIconListener("click",this._dropdownIconClickListener),this._adapter.removeDropdownIconListener("mousedown",this._dropdownIconMouseDownListener),this._adapter.removeClearButtonListener("click",this._clearButtonListener)}_setInputListener(){this._inputListener=e=>this._onInput(e)}_setFilterCallback(){this._filterFn=h(this._debounce)&&this._debounce>0?P(this._debounceFilter,this._debounce,!1):this._debounceFilter}_initializeAccessibility(){this._adapter.initializeInputAccessibility(this._identifier)}get _flatOptions(){return v(this._options,1)?this._options.reduce((e,t)=>e.concat(t.options),[]):this._options}_onClick(e){!this._isDropdownOpen&&this._filterOnFocus&&this._showDropdown()}_onDropdownIconMouseDown(e){e.preventDefault()}_onDropdownIconClick(e){this._isDropdownOpen?this._closeDropdown():(this._adapter.focus(),window.requestAnimationFrame(()=>this._showDropdown()))}_onClear(e){this._filterText="",this._clearValue(),this._adapter.setSelectedText(this._getSelectedText())}_onDropdownScrollEnd(){this._adapter.emitHostEvent(o.events.SCROLLED_BOTTOM)}_onFocus(){!this._isDropdownOpen&&this._adapter.getInputValue()&&!D.isMobile&&this._adapter.selectInputValue()}_onBlur(e){this._adapter.isFocusWithinPopup(e.relatedTarget)||this._applyBlur()}_applyBlur(){this._isDropdownOpen&&this._closeDropdown(),this._mode!=="stateless"&&(this._selectedOptions.length?this._adapter.setSelectedText(this._getSelectedText()):this._allowUnmatched||(this._filterText="",this._adapter.setSelectedText("")))}_onInput(e){this._selectedOptions.length&&!this._multiple&&(!this._adapter.getInputValue()||this._allowUnmatched)&&!this._adapter.isWrappingChipField()&&(this._selectedOptions=[],this._values=[],this._emitChangeEvent()),this._filterText=this._adapter.getInputValue(),this._filterFn()}async _debounceFilter({checkFocus:e=!0}={}){if(!e&&!this._adapter.hasFocus()){this._pendingFilterPromises=[],this._isDropdownOpen&&this._closeDropdown();return}let t=this._filterText,i=this._executeFilter();this._pendingFilterPromises.push(i),this._isDropdownOpen?this._adapter.setBusyVisibility(!0):this._showDropdown({filter:!1});try{await i}catch(n){this._pendingFilterPromises=[],this._isDropdownOpen&&this._closeDropdown();return}if(t===this._filterText)this._pendingFilterPromises=[],this._onFilterComplete();else{let n=this._pendingFilterPromises.indexOf(i);n!==-1&&this._pendingFilterPromises.splice(n,1)}}_onKeydown(e){switch(e.key){case"Tab":this._isDropdownOpen&&!this._multiple&&this._selectActiveOption(!1);break;case"Esc":case"Escape":this._isDropdownOpen&&(e.preventDefault(),e.stopPropagation(),this._closeDropdown());break;case"Down":case"ArrowDown":e.preventDefault(),this._isDropdownOpen?this._adapter.propagateKey(e.key):this._showDropdown({activateFirst:!0,activateSelected:!0});break;case"Up":case"ArrowUp":e.preventDefault(),this._isDropdownOpen&&this._adapter.propagateKey(e.key);break;case"Enter":case"Home":case"End":this._isDropdownOpen&&(e.key==="Enter"&&e.stopPropagation(),e.preventDefault(),this._adapter.propagateKey(e.key));break;case"Backspace":case"Delete":let t=e.target,i=this._adapter.getInputValue(),n=t.value.substring(t.selectionStart,t.selectionEnd)===t.value,l=i.length===1&&t.selectionEnd===1,c=i.length===1&&t.selectionEnd===0,_=!i||n||l||c;!this._adapter.isWrappingChipField()&&_&&!this._multiple&&this._values.length&&this._clearValue();break}}_executeFilter(e=!0,t=!1){if(!this._filter||typeof this._filter!="function")throw new Error('A filter callback must be provided. Did you set the "filter" property?');let i=this._filter,n=e?this._filterText:"",l=t?this._getValue():null;return new Promise((c,_)=>Promise.resolve(i(n,l)).then(r=>{this._options=r,c(this._options)}).catch(r=>_(`An unexpected error occurred while filtering: ${r}`)))}_onFilterComplete(){if(!this._adapter.hasFocus()){this._isDropdownOpen&&this._closeDropdown();return}if(this._options.length){let e=this._allowUnmatched&&!this._selectedOptions.length;this._dropdownReady({userTriggered:e}),this._filterFocusFirst&&this._filterText&&this._adapter.activateFirstOption()}else this._closeDropdown()}_clearValue(){this._selectedOptions=[],this._values=[],this._isDropdownOpen&&(this._adapter.setSelectedOptions([]),this._adapter.clearActiveOption()),this._emitChangeEvent()}async _showDropdown({filter:e=!0,userTriggered:t=!0,activateFirst:i=!1,activateSelected:n=!1}={}){let l=this._allowUnmatched&&!this._selectedOptions.length;this._isDropdownOpen=!0;let c;if(this._optionBuilder){let r=this._optionBuilder;c=(m,_e)=>r(m,this._filterText,_e)}let _={options:this._options,multiple:this._multiple,selectedValues:[...this._values],id:`forge-autocomplete-${this._identifier}`,asyncStyle:"skeleton",optionLimit:this._optionLimit,popupClasses:this._popupClasses,headerBuilder:this._popupHeaderBuilder,footerBuilder:this._popupFooterBuilder,transform:r=>{if(this._filterText){let m=$(r,this._filterText);if(m)return m}return r},allowBusy:!0,optionBuilder:c,syncWidth:this._syncPopupWidth,observeScroll:this._observeScroll,observeScrollThreshold:this._observeScrollThreshold,scrollEndListener:this._dropdownScrollEndListener,activeChangeCallback:this._activeChangeListener,targetWidthCallback:this._targetWidthCallback,selectCallback:r=>this._onSelect(r),closeCallback:()=>this._closeDropdown()};if(this._adapter.show(_,this._popupTarget),this._adapter.toggleHostAttribute(o.attributes.OPEN,this._isDropdownOpen),e){this._options.length&&this._adapter.setBusyVisibility(!0);try{await this._executeFilter(l)}catch(r){console.error(r)}this._updateSelectedOptions(this._values)}this._pendingFilterPromises.length||this._dropdownReady({userTriggered:t,activateFirst:i,activateSelected:n})}_dropdownReady({userTriggered:e=!0,activateFirst:t=!1,activateSelected:i=!1}={}){if(!this._isDropdownOpen||!this._options.length||e&&!this._adapter.hasFocus()){this._closeDropdown();return}this._sortSelectedOptions(),this._adapter.setBusyVisibility(!1),this._adapter.setOptions(this._options),this._adapter.setSelectedOptions(this._selectedOptions),this._adapter.setDismissListener(this._dismissListener),i&&this._selectedOptions.length?this._adapter.activateSelectedOption():t&&this._adapter.activateFirstOption()}_closeDropdown(){this._multiple&&(this._filterText=""),this._isDropdownOpen=!1,this._adapter.hide(this._dismissListener),this._sortSelectedOptions(),this._adapter.toggleHostAttribute(o.attributes.OPEN,this._isDropdownOpen)}_sortSelectedOptions(){if(this._multiple&&this._selectedOptions.length&&v(this._options,0)){let e=[],t=[];this._options.forEach(i=>{this._selectedOptions.find(n=>b(n,i.value,this._matchKey))?e.push(i):t.push(i)}),this._options=[...e,...t]}}async _onSelect(e,t=!0){if(this._valueChanging)return;if(this._mode==="stateless"){let n={value:e};this._adapter.emitHostEvent(o.events.SELECT,n,!0,!0)&&(this._filterText="",this._multiple||this._closeDropdown());return}let i=()=>{let l=this._flatOptions.find(r=>b(r,e,this._matchKey)),c=l?l.value:"",_=l?l.label:"";if(this._multiple){let r=ce(this._selectedOptions,c);if(r){let m=this._selectedOptions.indexOf(r);this._selectedOptions.splice(m,1)}else this._selectedOptions.push(l)}else h(c)?(this._selectedOptions[0]=l,this._filterText=_):(this._selectedOptions=[],this._filterText="");this._isDropdownOpen&&this._adapter.setSelectedOptions(this._selectedOptions),this._values=this._selectedOptions.map(r=>r.value),this._adapter.setSelectedText(this._getSelectedText()),!D.isMobile&&t&&this._adapter.selectInputValue(),this._emitChangeEvent(),this._tryUpdateDropdownPosition()};this._isDropdownOpen&&!this._multiple&&this._closeDropdown(),typeof this._beforeValueChange=="function"?(this._valueChanging=Promise.resolve(this._beforeValueChange.call(null,e,this._matchKey)),await this._valueChanging?i():this._tryUpdateDropdownPosition(),this._valueChanging=void 0):i()}_selectActiveOption(e=!0){let t=this._adapter.getActiveOptionIndex();if(typeof t=="number"&&t>=0){let i=this._flatOptions[t];i&&this._onSelect(i.value,e)}}_emitChangeEvent(){this._adapter.emitHostEvent(o.events.CHANGE,this._getValue(),!0)}_tryUpdateDropdownPosition(){this._isDropdownOpen&&this._adapter.queueDropdownPositionUpdate()}_getValue(){return this._values?this._values.length?this._multiple?[...this._values]:this._values[0]:this._multiple?[]:null:null}_getSelectedText(){var e,t;return this._adapter.isWrappingChipField()?"":this._selectedTextBuilder?this._selectedTextBuilder(this._selectedOptions):this._multiple?this._values.length?this._values.length===1?(t=(e=this._selectedOptions[0])==null?void 0:e.label)!=null?t:"":`${this._values.length} options selected`:"":this._selectedOptions.filter(i=>i&&i.label).map(i=>i.label).join(" ").trim()}_onDismiss(){this._closeDropdown()}async _applyValue(e){let t=[];this._selectedOptions=[],Array.isArray(e)?t=e:t=h(e)?[e]:[],!this._multiple&&t.length>1&&(t=[t[0]]),v(t,0)?(this._values=t.map(n=>n.value),this._selectedOptions=t):this._values=t;let i=this._flatOptions;if(t.length&&i.length&&this._updateSelectedOptions(t),this._values.length&&!this._selectedOptions.length&&this._filter&&this._isInitialized){try{await this._executeFilter(!1,!0)}catch(n){console.error(n)}this._updateSelectedOptions(this._values)}this._multiple?this._filterText="":this._filterText=this._selectedOptions.length?this._selectedOptions[0].label:"",this._isInitialized&&this._adapter.setSelectedText(this._getSelectedText()),this._isDropdownOpen&&this._adapter.setSelectedOptions(this._selectedOptions)}_updateSelectedOptions(e){let t=[...this._flatOptions,...this._selectedOptions];if(this._selectedOptions.length&&(this._selectedOptions=[]),v(e,0))for(let i of e){let n=t.find(l=>b(l,i.value,this._matchKey));n?this._selectedOptions.push(n):this._selectedOptions.push(i)}else for(let i of e){let n=t.find(l=>b(l,i,this._matchKey));n?this._selectedOptions.push(n):this._allowUnmatched&&this._selectedOptions.push({label:i,value:i})}}get mode(){return this._mode}set mode(e){this._mode!==e&&(this._mode=e,this._mode==="stateless"&&(this._selectedOptions=[],this._isDropdownOpen&&this._closeDropdown()),this._adapter.setHostAttribute(o.attributes.MODE,this._mode))}get multiple(){return this._multiple}set multiple(e){this._multiple!==e&&(this._multiple=e,this._adapter.setHostAttribute(o.attributes.MULTIPLE,h(this._multiple)?this._multiple.toString():""))}get value(){return this._getValue()}set value(e){let t=[];e==null?t=[]:Array.isArray(e)?t=structuredClone(e):x(e)?t=[e]:t=[structuredClone(e)],(t.length!==this._values.length||t.some(n=>!this._values.includes(n)))&&this._applyValue(e)}get filterOnFocus(){return this._filterOnFocus}set filterOnFocus(e){this._filterOnFocus!==e&&(this._filterOnFocus=e,this._adapter.setHostAttribute(o.attributes.FILTER_ON_FOCUS,h(this._filterOnFocus)?this._filterOnFocus.toString():""))}get filterFocusFirst(){return this._filterFocusFirst}set filterFocusFirst(e){this._filterFocusFirst!==e&&(this._filterFocusFirst=e,this._adapter.toggleHostAttribute(o.attributes.FILTER_FOCUS_FIRST,this._filterFocusFirst))}get allowUnmatched(){return this._allowUnmatched}set allowUnmatched(e){this._allowUnmatched!==e&&(this._allowUnmatched=e,h(this._allowUnmatched)&&this._adapter.setHostAttribute(o.attributes.ALLOW_UNMATCHED,this._allowUnmatched.toString()))}get matchKey(){return this._matchKey}set matchKey(e){this._matchKey!==e&&(this._matchKey=e)}get popupTarget(){return this._popupTarget}set popupTarget(e){this._popupTarget!==e&&(this._popupTarget=e)}get filterText(){return this._filterText}set filterText(e){this._filterText!==e&&(this._filterText=this._allowUnmatched?e:"",this._isInitialized&&this._allowUnmatched&&(this._adapter.setInputValue(this._filterText),this._isDropdownOpen&&this._debounceFilter({checkFocus:!1})))}get popupClasses(){return Array.isArray(this._popupClasses)?[...this._popupClasses]:[this._popupClasses]}set popupClasses(e){this._popupClasses!==e&&(this._popupClasses=Array.isArray(e)?[...e]:[e])}set popupHeaderBuilder(e){this._popupHeaderBuilder=e}set popupFooterBuilder(e){this._popupFooterBuilder=e}get syncPopupWidth(){return this._syncPopupWidth}set syncPopupWidth(e){this._syncPopupWidth!==e&&(this._syncPopupWidth=e)}get optionLimit(){return this._optionLimit}set optionLimit(e){this._optionLimit!==e&&(this._optionLimit=e)}get debounce(){return this._debounce}set debounce(e){this._debounce!==e&&(this._debounce=e,this._isInitialized&&this._setFilterCallback(),this._adapter.setHostAttribute(o.attributes.DEBOUNCE,h(this._debounce)?this._debounce.toString():""))}get optionBuilder(){return this._optionBuilder}set optionBuilder(e){this._optionBuilder=e}get filter(){return this._filter}set filter(e){this._filter!==e&&(this._filter=e,this._isInitialized&&this._values.length&&!this._flatOptions.length&&this._filter&&this._executeFilter().then(()=>{this._updateSelectedOptions(this._values),this._adapter.setSelectedText(this._getSelectedText())}))}get selectedTextBuilder(){return this._selectedTextBuilder}set selectedTextBuilder(e){this._selectedTextBuilder=e,this._selectedOptions.length&&this._adapter.setSelectedText(this._getSelectedText())}get observeScroll(){return this._observeScroll}set observeScroll(e){this._observeScroll=e}get observeScrollThreshold(){return this._observeScrollThreshold}set observeScrollThreshold(e){this._observeScrollThreshold=e}appendOptions(e){this._isDropdownOpen&&(this._options=[...this._options,...e],this._adapter.appendOptions(e))}get isInitialized(){return this._isInitialized}get open(){return this._isDropdownOpen}set open(e){this._isDropdownOpen!==e&&(e?this._showDropdown({userTriggered:!1}):this._closeDropdown())}get beforeValueChange(){return this._beforeValueChange}set beforeValueChange(e){e!==this._beforeValueChange&&(this._beforeValueChange=e)}get popupElement(){return this._adapter.getPopupElement()}};var ge="<template><slot></slot></template>",Oe=":host{display:block}:host([hidden]){display:none}",s=class extends Z{constructor(){super();Y.define([W,q,K]),U(this,ge,Oe),this._foundation=new I(new O(this))}static get observedAttributes(){return[o.attributes.MODE,o.attributes.MULTIPLE,o.attributes.DEBOUNCE,o.attributes.FILTER_ON_FOCUS,o.attributes.FILTER_FOCUS_FIRST,o.attributes.ALLOW_UNMATCHED,o.attributes.POPUP_TARGET,o.attributes.POPUP_CLASSES,o.attributes.OBSERVE_SCROLL,o.attributes.OBSERVE_SCROLL_THRESHOLD,o.attributes.OPTION_LIMIT,o.attributes.SYNC_POPUP_WIDTH,o.attributes.OPEN,o.attributes.MATCH_KEY,o.attributes.FILTER_TEXT]}connectedCallback(){this.querySelector(o.selectors.INPUT)?this._foundation.initialize():B(this,o.selectors.INPUT).then(()=>this._foundation.initialize())}disconnectedCallback(){this._foundation.disconnect()}attributeChangedCallback(e,t,i){switch(super.attributeChangedCallback(e,t,i),e){case o.attributes.MODE:this.mode=i;break;case o.attributes.MULTIPLE:this.multiple=f(i);break;case o.attributes.DEBOUNCE:this.debounce=S(i);break;case o.attributes.FILTER_ON_FOCUS:this.filterOnFocus=f(i);break;case o.attributes.FILTER_FOCUS_FIRST:this.filterFocusFirst=f(i);break;case o.attributes.ALLOW_UNMATCHED:this.allowUnmatched=f(i);break;case o.attributes.POPUP_TARGET:this.popupTarget=i;break;case o.attributes.OPEN:this.open=f(i);break;case o.attributes.MATCH_KEY:this.matchKey=i;break;case o.attributes.FILTER_TEXT:this.filterText=i;break}}appendOptions(e){this._foundation.appendOptions(e)}openDropdown(){this.open=!0}closeDropdown(){this.open=!1}forceFilter(e={preserveValue:!1}){this._foundation.forceFilter(e)}};p([a()],s.prototype,"mode",2),p([a()],s.prototype,"multiple",2),p([a()],s.prototype,"value",2),p([a()],s.prototype,"debounce",2),p([a()],s.prototype,"filterOnFocus",2),p([a()],s.prototype,"filterFocusFirst",2),p([a()],s.prototype,"allowUnmatched",2),p([a()],s.prototype,"popupTarget",2),p([a()],s.prototype,"filterText",2),p([a()],s.prototype,"optionBuilder",2),p([a()],s.prototype,"filter",2),p([a()],s.prototype,"selectedTextBuilder",2),p([a()],s.prototype,"open",2),p([a()],s.prototype,"matchKey",2),p([a({set:!1})],s.prototype,"isInitialized",2),p([a({set:!1})],s.prototype,"popupElement",2),p([a()],s.prototype,"beforeValueChange",2),s=p([H({name:o.elementName,dependencies:[pe,ee,J,Q,se,ie,te,X]})],s);var he=class extends z{constructor(e){super(e)}_build(){let e=document.createElement(o.elementName);return this._attachTextField(e),e}get textFieldDelegate(){return this._textFieldDelegate}get value(){return this._element.value}set value(e){this._element.value=e}get disabled(){return this._textFieldDelegate.inputElement.disabled}set disabled(e){this._textFieldDelegate.inputElement.disabled=e}get invalid(){return this._textFieldDelegate.invalid||!1}set invalid(e){this._textFieldDelegate.invalid=e}onChange(e){this._element.addEventListener(o.events.CHANGE,t=>e(t.detail))}onFocus(e){this._textFieldDelegate.inputElement.addEventListener("focus",t=>e(t))}onBlur(e){this._textFieldDelegate.inputElement.addEventListener("blur",t=>e(t))}_attachTextField(e){var i,n,l,c,_,r;let t={props:E({},(n=(i=this._config.options)==null?void 0:i.textFieldDelegateConfig)==null?void 0:n.props),options:E({},(c=(l=this._config.options)==null?void 0:l.textFieldDelegateConfig)==null?void 0:c.options)};t.options||(t.options={}),((_=this._config.options)==null?void 0:_.useDropdownIcon)!==!1&&!((r=t.options)!=null&&r.trailingElement)&&(t.options.trailingElement=this._createDropdownIconElement()),this._textFieldDelegate=new ae(t),e.appendChild(this._textFieldDelegate.element)}_createDropdownIconElement(){let e={props:{slot:"trailing",name:"arrow_drop_down"},options:{attributes:{"forge-dropdown-icon":""}}};return new j(e).element}};function Wt(){N(s)}export{o as a,ue as b,O as c,de as d,v as e,ce as f,b as g,I as h,s as i,he as j,Wt as k};
|
|
7
|
+
//# sourceMappingURL=chunk.5PNJOQDZ.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 t}from"./chunk.
|
|
7
|
-
//# sourceMappingURL=chunk.
|
|
6
|
+
import{a as t}from"./chunk.CJUX3PL5.js";import{a as r}from"./chunk.NVUMRW44.js";import{k as l}from"./chunk.TPXXHX5J.js";import{k as p,l as s}from"./chunk.J2M2MXP2.js";import{d as o}from"./chunk.M3QDAYD2.js";var e=class extends l{constructor(){super()}attributeChangedCallback(a,u,i){switch(a){case t.attributes.POPUP_CLASSES:this.popupClasses=i;break;case t.attributes.OPTION_LIMIT:this.optionLimit=s(i);break;case t.attributes.OBSERVE_SCROLL:this.observeScroll=p(i);break;case t.attributes.OBSERVE_SCROLL_THRESHOLD:this.observeScrollThreshold=s(i);break;case t.attributes.SYNC_POPUP_WIDTH:this.syncPopupWidth=p(i);break;case t.attributes.CONSTRAIN_POPUP_WIDTH:this.constrainPopupWidth=p(i);break;case t.attributes.WRAP_OPTION_TEXT:this.wrapOptionText=p(i);break}}};o([r()],e.prototype,"popupClasses",2),o([r()],e.prototype,"popupHeaderBuilder",2),o([r()],e.prototype,"popupFooterBuilder",2),o([r()],e.prototype,"syncPopupWidth",2),o([r()],e.prototype,"optionLimit",2),o([r()],e.prototype,"observeScroll",2),o([r()],e.prototype,"observeScrollThreshold",2),o([r()],e.prototype,"constrainPopupWidth",2),o([r()],e.prototype,"wrapOptionText",2);export{e as a};
|
|
7
|
+
//# sourceMappingURL=chunk.66RZ2CUB.js.map
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* Copyright 2023 Tyler Technologies, Inc.
|
|
4
4
|
* License: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import{d as P}from"./chunk.VX7H6YHF.js";import{d as L}from"./chunk.NPCUVYWP.js";import{j as I}from"./chunk.EWT2PBEP.js";import{d as N,l as B}from"./chunk.L7BSLZCB.js";import{a as M}from"./chunk.ZY3ETQ3D.js";import{a as r}from"./chunk.NVUMRW44.js";import{a as O,b as y}from"./chunk.UVXKHQQZ.js";import{a as E,e as x,f as c,i as A,k as C}from"./chunk.TPXXHX5J.js";import{d as u,g as T,i as v}from"./chunk.HZUQXCOQ.js";import{c as f,h as d,k as h}from"./chunk.J2M2MXP2.js";import{d as a}from"./chunk.M3QDAYD2.js";var p=`${y}toast`,w={TOP_MARGIN_TOP:"--forge-toast-top-margin-top",BOTTOM_MARGIN_BOTTOM:"--forge-toast-bottom-margin-bottom",TOP_LEFT_MARGIN_TOP:"--forge-toast-top-left-margin-top",TOP_LEFT_MARGIN_LEFT:"--forge-toast-top-left-margin-left",TOP_RIGHT_MARGIN_TOP:"--forge-toast-top-right-margin-top",TOP_RIGHT_MARGIN_RIGHT:"--forge-toast-top-right-margin-right",BOTTOM_LEFT_MARGIN_BOTTOM:"--forge-toast-bottom-left-margin-bottom",BOTTOM_LEFT_MARGIN_LEFT:"--forge-toast-bottom-left-margin-left",BOTTOM_RIGHT_MARGIN_RIGHT:"--forge-toast-bottom-right-margin-right",BOTTOM_RIGHT_MARGIN_BOTTOM:"--forge-toast-bottom-right-margin-bottom"},m={CONTAINER:"forge-toast__container",MESSAGE:"forge-toast__message",ACTION_BUTTON:"forge-toast__action-button",CLOSE_BUTTON:"forge-toast__close-button",TOP:"forge-toast__container--top",TOP_LEFT:"forge-toast__container--top-left",TOP_RIGHT:"forge-toast__container--top-right",BOTTOM:"forge-toast__container--bottom",BOTTOM_LEFT:"forge-toast__container--bottom-left",BOTTOM_RIGHT:"forge-toast__container--bottom-right",ACTIVE:"forge-toast__container--active",CUSTOM:"forge-toast__container--custom"},k={CONTAINER:`.${m.CONTAINER}`,MESSAGE:`.${m.MESSAGE}`,ACTION_BUTTON:`.${m.ACTION_BUTTON}`,CLOSE_BUTTON:`.${m.CLOSE_BUTTON}`},S={MESSAGE:"message",ACTION_TEXT:"action-text",DURATION:"duration",PLACEMENT:"placement",SHOW_CLOSE:"show-close"},R={ACTION:`${p}-action`,CLOSE:`${p}-close`},H={PLACEMENT:"bottom",DURATION:2750},t={elementName:p,classes:m,selectors:k,attributes:S,defaults:H,events:R,customCssPositionProperties:w};var l=class extends M{constructor(e){super(e);this._containerElement=c(e,t.selectors.CONTAINER),this._messageElement=c(e,t.selectors.MESSAGE),this._actionButtonElement=c(e,t.selectors.ACTION_BUTTON),this._closeButtonElement=c(e,t.selectors.CLOSE_BUTTON)}setHostAttribute(e,i){this._component.getAttribute(e)!==i&&this._component.setAttribute(e,i)}setMessage(e){this._messageElement.innerText=e}setMessageTemplate(e){this._containerElement.classList.add(t.classes.CUSTOM),f(e)?this._component.innerHTML=e:(u(this._messageElement),this._component.appendChild(e))}setActionVisibility(e){this._actionButtonPlaceholder=A(this._component,e,t.elementName,t.selectors.ACTION_BUTTON,this._actionButtonElement,this._actionButtonPlaceholder)}setActionText(e){this._actionButtonElement.innerText=e}registerActionListener(e,i){this._actionButtonElement.addEventListener(e,i)}deregisterActionListener(e,i){this._actionButtonElement.removeEventListener(e,i)}setPlacement(e){T([t.classes.TOP,t.classes.TOP_LEFT,t.classes.TOP_RIGHT,t.classes.BOTTOM,t.classes.BOTTOM_LEFT,t.classes.BOTTOM_RIGHT],this._containerElement);let i=this._getPlacementClass(e);i&&this._containerElement.classList.add(i)}setActive(e){if(e)window.getComputedStyle(this._containerElement).getPropertyValue("bottom"),this._containerElement.classList.add(t.classes.ACTIVE);else{this._containerElement.classList.remove(t.classes.ACTIVE);let i=()=>{this._containerElement.removeEventListener("transitionend",i),v(this._component)};this._containerElement.addEventListener("transitionend",i)}}setCloseButtonVisibility(e){e?this._closeButtonElement.style.removeProperty("display"):this._closeButtonElement.style.display="none"}registerCloseListener(e){this._closeButtonElement.addEventListener("click",e)}_getPlacementClass(e){switch(e){case"top":return t.classes.TOP;case"top-start":return t.classes.TOP_LEFT;case"top-end":return t.classes.TOP_RIGHT;case"bottom":return t.classes.BOTTOM;case"bottom-start":return t.classes.BOTTOM_LEFT;case"bottom-end":return t.classes.BOTTOM_RIGHT}return null}};var _=class{constructor(o){this._adapter=o;this._duration=t.defaults.DURATION;this._placement=t.defaults.PLACEMENT;this._showClose=!0;this._hasAction=!1;this._isActive=!1;this._actionListener=e=>this._onAction(e),this._closeListener=e=>this._onClose(e)}initialize(){this._adapter.setPlacement(this._placement),this._adapter.registerCloseListener(this._closeListener),this._adapter.setCloseButtonVisibility(this._showClose),this._adapter.setActionVisibility(!!this._actionText),this.show()}show(){if(d(this._builder)){let o=this._builder();this._adapter.setMessageTemplate(o)}this._isActive=!0,this._adapter.setActive(!0),isFinite(this._duration)&&this._duration>0&&(this._hideTimeout=setTimeout(()=>this.hide(!0),this._duration))}hide(o=!1){this._isActive&&(this._isActive=!1,this._adapter.setActive(!1),this._hideTimeout&&(clearTimeout(this._hideTimeout),this._hideTimeout=void 0),o&&this._adapter.emitHostEvent(t.events.CLOSE))}_onAction(o){o.stopPropagation(),this._adapter.emitHostEvent(t.events.ACTION)}_onClose(o){this.hide(!0)}get message(){return this._message}set message(o){this._message!==o&&(this._message=o,this._adapter.setMessage(this._message),this._adapter.setHostAttribute(t.attributes.MESSAGE,this._message))}get actionText(){return this._actionText}set actionText(o){this._actionText!==o&&(this._actionText=o,this._actionText?this._hasAction?this._adapter.setActionText(this._actionText):(this._adapter.setActionText(this._actionText),this._adapter.setActionVisibility(!0),this._adapter.registerActionListener("click",this._actionListener),this._hasAction=!0):this._hasAction&&(this._adapter.setActionText(""),this._adapter.setActionVisibility(!1),this._adapter.deregisterActionListener("click",this._actionListener),this._hasAction=!1),this._adapter.setHostAttribute(t.attributes.ACTION_TEXT,this._actionText))}get duration(){return this._duration}set duration(o){this._duration!==o&&(this._duration=o,this._hideTimeout&&(clearTimeout(this._hideTimeout),this._hideTimeout=setTimeout(()=>this.hide(!0),this._duration)))}get placement(){return this._placement}set placement(o){this._placement!==o&&(this._placement=o,this._adapter.setPlacement(this._placement)),this._adapter.setHostAttribute(t.attributes.PLACEMENT,this._placement)}get builder(){return this._builder}set builder(o){this._builder=o}get showClose(){return this._showClose}set showClose(o){this._showClose!==o&&(this._showClose=o,this._adapter.setCloseButtonVisibility(this._showClose),this._adapter.setHostAttribute(t.attributes.SHOW_CLOSE,this._showClose.toString()))}};var G='<template><div class="forge-toast__container" aria-live="assertive" aria-atomic="true" part="root"><slot></slot><div class="forge-toast__message" part="message"></div><div class="forge-toast__action-container" part="action-container"><forge-button part="action-button" class="forge-toast__action-button" part="action-button-element"></forge-button><forge-icon-button part="close-button" class="forge-toast__close-button" aria-label="Close toast message" part="close-button-element"><forge-icon name="close" part="close-button-icon"></forge-icon></forge-icon-button></div></div></template>',z=".forge-toast__container{z-index:9;z-index:var(--forge-z-index-notification,9);-webkit-box-shadow:0 3px 5px -1px rgba(0,0,0,.2),0 6px 10px 0 rgba(0,0,0,.14),0 1px 18px 0 rgba(0,0,0,.12);box-shadow:0 3px 5px -1px rgba(0,0,0,.2),0 6px 10px 0 rgba(0,0,0,.14),0 1px 18px 0 rgba(0,0,0,.12);background-color:#333;background-color:var(--forge-toast-theme-background,#333);display:-webkit-box;display:flex;position:fixed;border-radius:2px;-webkit-transition:-webkit-transform 250ms 0s cubic-bezier(.4, 0, 1, 1);transition:-webkit-transform 250ms 0s cubic-bezier(.4, 0, 1, 1);transition:transform 250ms 0s cubic-bezier(.4, 0, 1, 1);transition:transform 250ms 0s cubic-bezier(.4, 0, 1, 1),-webkit-transform 250ms 0s cubic-bezier(.4, 0, 1, 1);-webkit-box-align:center;align-items:center;-webkit-box-pack:justify;justify-content:space-between;-webkit-box-sizing:border-box;box-sizing:border-box;padding:4px 8px 4px 16px;min-height:48px}@media (max-width:599px){.forge-toast__container{bottom:0;width:100%;border-radius:0;-webkit-transform:translateY(100%);transform:translateY(100%)}}.forge-toast__container ::slotted(*){color:rgba(255,255,255,.87);color:var(--forge-toast-theme-on-background,rgba(255,255,255,.87))}@media (min-width:600px){.forge-toast__container{min-width:344px;max-width:568px}.forge-toast__container.forge-toast__container--top,.forge-toast__container.forge-toast__container--top-left,.forge-toast__container.forge-toast__container--top-right{top:0}.forge-toast__container.forge-toast__container--top{left:50%;-webkit-transform:translateX(-50%) translateY(-100%);transform:translateX(-50%) translateY(-100%);margin-top:0;margin-top:var(--forge-toast-top-margin-top,0)}.forge-toast__container.forge-toast__container--bottom{left:50%;-webkit-transform:translateX(-50%) translateY(100%);transform:translateX(-50%) translateY(100%);margin-bottom:0;margin-bottom:var(--forge-toast-bottom-margin-bottom,0)}.forge-toast__container.forge-toast__container--top-left,.forge-toast__container.forge-toast__container--top-right{-webkit-transform:translateY(-100%);transform:translateY(-100%)}.forge-toast__container.forge-toast__container--bottom-left,.forge-toast__container.forge-toast__container--bottom-right{-webkit-transform:translateY(100%);transform:translateY(100%)}.forge-toast__container.forge-toast__container--bottom,.forge-toast__container.forge-toast__container--bottom-left,.forge-toast__container.forge-toast__container--bottom-right{bottom:0}.forge-toast__container.forge-toast__container--bottom-left{margin-bottom:24px;margin-bottom:var(--forge-toast-bottom-left-margin-bottom,24px);margin-left:24px;margin-left:var(--forge-toast-bottom-left-margin-left,24px);left:0}.forge-toast__container.forge-toast__container--bottom-right{margin-bottom:24px;margin-bottom:var(--forge-toast-bottom-right-margin-bottom,24px);margin-right:24px;margin-right:var(--forge-toast-bottom-right-margin-right,24px)}.forge-toast__container.forge-toast__container--top-left{margin-top:24px;margin-top:var(--forge-toast-top-left-margin-top,24px);margin-left:24px;margin-left:var(--forge-toast-top-left-margin-left,24px);left:0}.forge-toast__container.forge-toast__container--top-right{margin-top:24px;margin-top:var(--forge-toast-top-right-margin-top,24px);margin-right:24px;margin-right:var(--forge-toast-top-right-margin-right,24px);right:0}.forge-toast__container.forge-toast__container--bottom-right{margin-bottom:24px;margin-bottom:var(--forge-toast-bottom-right-margin-bottom,24px);margin-right:24px;margin-right:var(--forge-toast-bottom-right-margin-right,24px);right:0}}.forge-toast__container--active{-webkit-transition:-webkit-transform 250ms 0s cubic-bezier(0, 0, .2, 1);transition:-webkit-transform 250ms 0s cubic-bezier(0, 0, .2, 1);transition:transform 250ms 0s cubic-bezier(0, 0, .2, 1);transition:transform 250ms 0s cubic-bezier(0, 0, .2, 1),-webkit-transform 250ms 0s cubic-bezier(0, 0, .2, 1)}.forge-toast__container--active>.forge-toast__message{opacity:1}.forge-toast__container--active>.forge-toast__action-button{opacity:1}@media (max-width:599px){.forge-toast__container--active{-webkit-transform:translateY(0)!important;transform:translateY(0)!important}}@media (min-width:600px){.forge-toast__container--active.forge-toast__container--bottom,.forge-toast__container--active.forge-toast__container--top{-webkit-transform:translateX(-50%) translateY(0)!important;transform:translateX(-50%) translateY(0)!important}.forge-toast__container--active.forge-toast__container--bottom-left,.forge-toast__container--active.forge-toast__container--bottom-right,.forge-toast__container--active.forge-toast__container--top-left,.forge-toast__container--active.forge-toast__container--top-right{-webkit-transform:translateY(0)!important;transform:translateY(0)!important}}.forge-toast__container--custom{min-width:0;max-width:none}.forge-toast__message{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-body1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:1rem;font-size:var(--mdc-typography-body1-font-size, 1rem);line-height:1.5rem;line-height:var(--mdc-typography-body1-line-height, 1.5rem);font-weight:400;font-weight:var(--mdc-typography-body1-font-weight,400);letter-spacing:.03125em;letter-spacing:var(--mdc-typography-body1-letter-spacing, .03125em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-body1-text-decoration,inherit);text-decoration:var(--mdc-typography-body1-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-body1-text-transform,inherit);color:rgba(255,255,255,.87);color:var(--forge-toast-theme-on-background,rgba(255,255,255,.87));display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;-webkit-transition:opacity .3s 0s cubic-bezier(.4, 0, 1, 1);transition:opacity .3s 0s cubic-bezier(.4, 0, 1, 1);opacity:0}.forge-toast__action-container{display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;margin-left:8px}.forge-toast__action-button{--forge-theme-primary:#ffc107;--forge-theme-primary:var(--forge-toast-theme-action, #ffc107)}.forge-toast__close-button{color:rgba(255,255,255,.87);color:var(--forge-toast-theme-on-background,rgba(255,255,255,.87));margin-left:8px}.forge-toast__close-button::after,.forge-toast__close-button::before{background-color:rgba(255,255,255,.87);background-color:var(--forge-toast-theme-on-background,rgba(255,255,255,.87))}:host{display:inline-block}:host([hidden]){display:none}",s=class extends C{constructor(){super();N.define(I),x(this,G,z),this._foundation=new _(new l(this))}static get observedAttributes(){return[t.attributes.MESSAGE,t.attributes.ACTION_TEXT,t.attributes.DURATION,t.attributes.PLACEMENT,t.attributes.SHOW_CLOSE]}initializedCallback(){this._foundation.initialize()}attributeChangedCallback(e,i,n){switch(e){case t.attributes.MESSAGE:this.message=n;break;case t.attributes.ACTION_TEXT:this.actionText=n;break;case t.attributes.DURATION:let g=Number(n);this.duration=g&&g>0?g:t.defaults.DURATION;break;case t.attributes.PLACEMENT:this.placement=n||t.defaults.PLACEMENT;break;case t.attributes.SHOW_CLOSE:this.showClose=h(n);break}}hide(){this._foundation.hide()}};a([r()],s.prototype,"message",2),a([r()],s.prototype,"actionText",2),a([r()],s.prototype,"duration",2),a([r()],s.prototype,"placement",2),a([r()],s.prototype,"builder",2),a([r()],s.prototype,"showClose",2),s=a([O({name:t.elementName,dependencies:[P,L,B]})],s);function ft(){E(s)}export{t as a,l as b,_ as c,s as d,ft as e};
|
|
7
|
-
//# sourceMappingURL=chunk.
|
|
6
|
+
import{d as P}from"./chunk.LNMQ5A25.js";import{d as L}from"./chunk.S2KPWTRW.js";import{j as I}from"./chunk.EWT2PBEP.js";import{d as N,l as B}from"./chunk.L7BSLZCB.js";import{a as M}from"./chunk.ZY3ETQ3D.js";import{a as r}from"./chunk.NVUMRW44.js";import{a as O,b as y}from"./chunk.UVXKHQQZ.js";import{a as E,e as x,f as c,i as A,k as C}from"./chunk.TPXXHX5J.js";import{d as u,g as T,i as v}from"./chunk.HZUQXCOQ.js";import{c as f,h as d,k as h}from"./chunk.J2M2MXP2.js";import{d as a}from"./chunk.M3QDAYD2.js";var p=`${y}toast`,w={TOP_MARGIN_TOP:"--forge-toast-top-margin-top",BOTTOM_MARGIN_BOTTOM:"--forge-toast-bottom-margin-bottom",TOP_LEFT_MARGIN_TOP:"--forge-toast-top-left-margin-top",TOP_LEFT_MARGIN_LEFT:"--forge-toast-top-left-margin-left",TOP_RIGHT_MARGIN_TOP:"--forge-toast-top-right-margin-top",TOP_RIGHT_MARGIN_RIGHT:"--forge-toast-top-right-margin-right",BOTTOM_LEFT_MARGIN_BOTTOM:"--forge-toast-bottom-left-margin-bottom",BOTTOM_LEFT_MARGIN_LEFT:"--forge-toast-bottom-left-margin-left",BOTTOM_RIGHT_MARGIN_RIGHT:"--forge-toast-bottom-right-margin-right",BOTTOM_RIGHT_MARGIN_BOTTOM:"--forge-toast-bottom-right-margin-bottom"},m={CONTAINER:"forge-toast__container",MESSAGE:"forge-toast__message",ACTION_BUTTON:"forge-toast__action-button",CLOSE_BUTTON:"forge-toast__close-button",TOP:"forge-toast__container--top",TOP_LEFT:"forge-toast__container--top-left",TOP_RIGHT:"forge-toast__container--top-right",BOTTOM:"forge-toast__container--bottom",BOTTOM_LEFT:"forge-toast__container--bottom-left",BOTTOM_RIGHT:"forge-toast__container--bottom-right",ACTIVE:"forge-toast__container--active",CUSTOM:"forge-toast__container--custom"},k={CONTAINER:`.${m.CONTAINER}`,MESSAGE:`.${m.MESSAGE}`,ACTION_BUTTON:`.${m.ACTION_BUTTON}`,CLOSE_BUTTON:`.${m.CLOSE_BUTTON}`},S={MESSAGE:"message",ACTION_TEXT:"action-text",DURATION:"duration",PLACEMENT:"placement",SHOW_CLOSE:"show-close"},R={ACTION:`${p}-action`,CLOSE:`${p}-close`},H={PLACEMENT:"bottom",DURATION:2750},t={elementName:p,classes:m,selectors:k,attributes:S,defaults:H,events:R,customCssPositionProperties:w};var l=class extends M{constructor(e){super(e);this._containerElement=c(e,t.selectors.CONTAINER),this._messageElement=c(e,t.selectors.MESSAGE),this._actionButtonElement=c(e,t.selectors.ACTION_BUTTON),this._closeButtonElement=c(e,t.selectors.CLOSE_BUTTON)}setHostAttribute(e,i){this._component.getAttribute(e)!==i&&this._component.setAttribute(e,i)}setMessage(e){this._messageElement.innerText=e}setMessageTemplate(e){this._containerElement.classList.add(t.classes.CUSTOM),f(e)?this._component.innerHTML=e:(u(this._messageElement),this._component.appendChild(e))}setActionVisibility(e){this._actionButtonPlaceholder=A(this._component,e,t.elementName,t.selectors.ACTION_BUTTON,this._actionButtonElement,this._actionButtonPlaceholder)}setActionText(e){this._actionButtonElement.innerText=e}registerActionListener(e,i){this._actionButtonElement.addEventListener(e,i)}deregisterActionListener(e,i){this._actionButtonElement.removeEventListener(e,i)}setPlacement(e){T([t.classes.TOP,t.classes.TOP_LEFT,t.classes.TOP_RIGHT,t.classes.BOTTOM,t.classes.BOTTOM_LEFT,t.classes.BOTTOM_RIGHT],this._containerElement);let i=this._getPlacementClass(e);i&&this._containerElement.classList.add(i)}setActive(e){if(e)window.getComputedStyle(this._containerElement).getPropertyValue("bottom"),this._containerElement.classList.add(t.classes.ACTIVE);else{this._containerElement.classList.remove(t.classes.ACTIVE);let i=()=>{this._containerElement.removeEventListener("transitionend",i),v(this._component)};this._containerElement.addEventListener("transitionend",i)}}setCloseButtonVisibility(e){e?this._closeButtonElement.style.removeProperty("display"):this._closeButtonElement.style.display="none"}registerCloseListener(e){this._closeButtonElement.addEventListener("click",e)}_getPlacementClass(e){switch(e){case"top":return t.classes.TOP;case"top-start":return t.classes.TOP_LEFT;case"top-end":return t.classes.TOP_RIGHT;case"bottom":return t.classes.BOTTOM;case"bottom-start":return t.classes.BOTTOM_LEFT;case"bottom-end":return t.classes.BOTTOM_RIGHT}return null}};var _=class{constructor(o){this._adapter=o;this._duration=t.defaults.DURATION;this._placement=t.defaults.PLACEMENT;this._showClose=!0;this._hasAction=!1;this._isActive=!1;this._actionListener=e=>this._onAction(e),this._closeListener=e=>this._onClose(e)}initialize(){this._adapter.setPlacement(this._placement),this._adapter.registerCloseListener(this._closeListener),this._adapter.setCloseButtonVisibility(this._showClose),this._adapter.setActionVisibility(!!this._actionText),this.show()}show(){if(d(this._builder)){let o=this._builder();this._adapter.setMessageTemplate(o)}this._isActive=!0,this._adapter.setActive(!0),isFinite(this._duration)&&this._duration>0&&(this._hideTimeout=setTimeout(()=>this.hide(!0),this._duration))}hide(o=!1){this._isActive&&(this._isActive=!1,this._adapter.setActive(!1),this._hideTimeout&&(clearTimeout(this._hideTimeout),this._hideTimeout=void 0),o&&this._adapter.emitHostEvent(t.events.CLOSE))}_onAction(o){o.stopPropagation(),this._adapter.emitHostEvent(t.events.ACTION)}_onClose(o){this.hide(!0)}get message(){return this._message}set message(o){this._message!==o&&(this._message=o,this._adapter.setMessage(this._message),this._adapter.setHostAttribute(t.attributes.MESSAGE,this._message))}get actionText(){return this._actionText}set actionText(o){this._actionText!==o&&(this._actionText=o,this._actionText?this._hasAction?this._adapter.setActionText(this._actionText):(this._adapter.setActionText(this._actionText),this._adapter.setActionVisibility(!0),this._adapter.registerActionListener("click",this._actionListener),this._hasAction=!0):this._hasAction&&(this._adapter.setActionText(""),this._adapter.setActionVisibility(!1),this._adapter.deregisterActionListener("click",this._actionListener),this._hasAction=!1),this._adapter.setHostAttribute(t.attributes.ACTION_TEXT,this._actionText))}get duration(){return this._duration}set duration(o){this._duration!==o&&(this._duration=o,this._hideTimeout&&(clearTimeout(this._hideTimeout),this._hideTimeout=setTimeout(()=>this.hide(!0),this._duration)))}get placement(){return this._placement}set placement(o){this._placement!==o&&(this._placement=o,this._adapter.setPlacement(this._placement)),this._adapter.setHostAttribute(t.attributes.PLACEMENT,this._placement)}get builder(){return this._builder}set builder(o){this._builder=o}get showClose(){return this._showClose}set showClose(o){this._showClose!==o&&(this._showClose=o,this._adapter.setCloseButtonVisibility(this._showClose),this._adapter.setHostAttribute(t.attributes.SHOW_CLOSE,this._showClose.toString()))}};var G='<template><div class="forge-toast__container" aria-live="assertive" aria-atomic="true" part="root"><slot></slot><div class="forge-toast__message" part="message"></div><div class="forge-toast__action-container" part="action-container"><forge-button part="action-button" class="forge-toast__action-button" part="action-button-element"></forge-button><forge-icon-button part="close-button" class="forge-toast__close-button" aria-label="Close toast message" part="close-button-element"><forge-icon name="close" part="close-button-icon"></forge-icon></forge-icon-button></div></div></template>',z=".forge-toast__container{z-index:9;z-index:var(--forge-z-index-notification,9);-webkit-box-shadow:0 3px 5px -1px rgba(0,0,0,.2),0 6px 10px 0 rgba(0,0,0,.14),0 1px 18px 0 rgba(0,0,0,.12);box-shadow:0 3px 5px -1px rgba(0,0,0,.2),0 6px 10px 0 rgba(0,0,0,.14),0 1px 18px 0 rgba(0,0,0,.12);background-color:#333;background-color:var(--forge-toast-theme-background,#333);display:-webkit-box;display:flex;position:fixed;border-radius:2px;-webkit-transition:-webkit-transform 250ms 0s cubic-bezier(.4, 0, 1, 1);transition:-webkit-transform 250ms 0s cubic-bezier(.4, 0, 1, 1);transition:transform 250ms 0s cubic-bezier(.4, 0, 1, 1);transition:transform 250ms 0s cubic-bezier(.4, 0, 1, 1),-webkit-transform 250ms 0s cubic-bezier(.4, 0, 1, 1);-webkit-box-align:center;align-items:center;-webkit-box-pack:justify;justify-content:space-between;-webkit-box-sizing:border-box;box-sizing:border-box;padding:4px 8px 4px 16px;min-height:48px}@media (max-width:599px){.forge-toast__container{bottom:0;width:100%;border-radius:0;-webkit-transform:translateY(100%);transform:translateY(100%)}}.forge-toast__container ::slotted(*){color:rgba(255,255,255,.87);color:var(--forge-toast-theme-on-background,rgba(255,255,255,.87))}@media (min-width:600px){.forge-toast__container{min-width:344px;max-width:568px}.forge-toast__container.forge-toast__container--top,.forge-toast__container.forge-toast__container--top-left,.forge-toast__container.forge-toast__container--top-right{top:0}.forge-toast__container.forge-toast__container--top{left:50%;-webkit-transform:translateX(-50%) translateY(-100%);transform:translateX(-50%) translateY(-100%);margin-top:0;margin-top:var(--forge-toast-top-margin-top,0)}.forge-toast__container.forge-toast__container--bottom{left:50%;-webkit-transform:translateX(-50%) translateY(100%);transform:translateX(-50%) translateY(100%);margin-bottom:0;margin-bottom:var(--forge-toast-bottom-margin-bottom,0)}.forge-toast__container.forge-toast__container--top-left,.forge-toast__container.forge-toast__container--top-right{-webkit-transform:translateY(-100%);transform:translateY(-100%)}.forge-toast__container.forge-toast__container--bottom-left,.forge-toast__container.forge-toast__container--bottom-right{-webkit-transform:translateY(100%);transform:translateY(100%)}.forge-toast__container.forge-toast__container--bottom,.forge-toast__container.forge-toast__container--bottom-left,.forge-toast__container.forge-toast__container--bottom-right{bottom:0}.forge-toast__container.forge-toast__container--bottom-left{margin-bottom:24px;margin-bottom:var(--forge-toast-bottom-left-margin-bottom,24px);margin-left:24px;margin-left:var(--forge-toast-bottom-left-margin-left,24px);left:0}.forge-toast__container.forge-toast__container--bottom-right{margin-bottom:24px;margin-bottom:var(--forge-toast-bottom-right-margin-bottom,24px);margin-right:24px;margin-right:var(--forge-toast-bottom-right-margin-right,24px)}.forge-toast__container.forge-toast__container--top-left{margin-top:24px;margin-top:var(--forge-toast-top-left-margin-top,24px);margin-left:24px;margin-left:var(--forge-toast-top-left-margin-left,24px);left:0}.forge-toast__container.forge-toast__container--top-right{margin-top:24px;margin-top:var(--forge-toast-top-right-margin-top,24px);margin-right:24px;margin-right:var(--forge-toast-top-right-margin-right,24px);right:0}.forge-toast__container.forge-toast__container--bottom-right{margin-bottom:24px;margin-bottom:var(--forge-toast-bottom-right-margin-bottom,24px);margin-right:24px;margin-right:var(--forge-toast-bottom-right-margin-right,24px);right:0}}.forge-toast__container--active{-webkit-transition:-webkit-transform 250ms 0s cubic-bezier(0, 0, .2, 1);transition:-webkit-transform 250ms 0s cubic-bezier(0, 0, .2, 1);transition:transform 250ms 0s cubic-bezier(0, 0, .2, 1);transition:transform 250ms 0s cubic-bezier(0, 0, .2, 1),-webkit-transform 250ms 0s cubic-bezier(0, 0, .2, 1)}.forge-toast__container--active>.forge-toast__message{opacity:1}.forge-toast__container--active>.forge-toast__action-button{opacity:1}@media (max-width:599px){.forge-toast__container--active{-webkit-transform:translateY(0)!important;transform:translateY(0)!important}}@media (min-width:600px){.forge-toast__container--active.forge-toast__container--bottom,.forge-toast__container--active.forge-toast__container--top{-webkit-transform:translateX(-50%) translateY(0)!important;transform:translateX(-50%) translateY(0)!important}.forge-toast__container--active.forge-toast__container--bottom-left,.forge-toast__container--active.forge-toast__container--bottom-right,.forge-toast__container--active.forge-toast__container--top-left,.forge-toast__container--active.forge-toast__container--top-right{-webkit-transform:translateY(0)!important;transform:translateY(0)!important}}.forge-toast__container--custom{min-width:0;max-width:none}.forge-toast__message{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-body1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:1rem;font-size:var(--mdc-typography-body1-font-size, 1rem);line-height:1.5rem;line-height:var(--mdc-typography-body1-line-height, 1.5rem);font-weight:400;font-weight:var(--mdc-typography-body1-font-weight,400);letter-spacing:.03125em;letter-spacing:var(--mdc-typography-body1-letter-spacing, .03125em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-body1-text-decoration,inherit);text-decoration:var(--mdc-typography-body1-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-body1-text-transform,inherit);color:rgba(255,255,255,.87);color:var(--forge-toast-theme-on-background,rgba(255,255,255,.87));display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;-webkit-transition:opacity .3s 0s cubic-bezier(.4, 0, 1, 1);transition:opacity .3s 0s cubic-bezier(.4, 0, 1, 1);opacity:0}.forge-toast__action-container{display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;margin-left:8px}.forge-toast__action-button{--forge-theme-primary:#ffc107;--forge-theme-primary:var(--forge-toast-theme-action, #ffc107)}.forge-toast__close-button{color:rgba(255,255,255,.87);color:var(--forge-toast-theme-on-background,rgba(255,255,255,.87));margin-left:8px}.forge-toast__close-button::after,.forge-toast__close-button::before{background-color:rgba(255,255,255,.87);background-color:var(--forge-toast-theme-on-background,rgba(255,255,255,.87))}:host{display:inline-block}:host([hidden]){display:none}",s=class extends C{constructor(){super();N.define(I),x(this,G,z),this._foundation=new _(new l(this))}static get observedAttributes(){return[t.attributes.MESSAGE,t.attributes.ACTION_TEXT,t.attributes.DURATION,t.attributes.PLACEMENT,t.attributes.SHOW_CLOSE]}initializedCallback(){this._foundation.initialize()}attributeChangedCallback(e,i,n){switch(e){case t.attributes.MESSAGE:this.message=n;break;case t.attributes.ACTION_TEXT:this.actionText=n;break;case t.attributes.DURATION:let g=Number(n);this.duration=g&&g>0?g:t.defaults.DURATION;break;case t.attributes.PLACEMENT:this.placement=n||t.defaults.PLACEMENT;break;case t.attributes.SHOW_CLOSE:this.showClose=h(n);break}}hide(){this._foundation.hide()}};a([r()],s.prototype,"message",2),a([r()],s.prototype,"actionText",2),a([r()],s.prototype,"duration",2),a([r()],s.prototype,"placement",2),a([r()],s.prototype,"builder",2),a([r()],s.prototype,"showClose",2),s=a([O({name:t.elementName,dependencies:[P,L,B]})],s);function ft(){E(s)}export{t as a,l as b,_ as c,s as d,ft as e};
|
|
7
|
+
//# sourceMappingURL=chunk.6DPDC4ON.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 b}from"./chunk.IC4DLKE3.js";import{a as E}from"./chunk.LEN33O6V.js";import{a as I}from"./chunk.NPCUVYWP.js";import{c as m,d as k}from"./chunk.QG5EYBS3.js";import{a as y}from"./chunk.XIQFHO5R.js";import{a as C}from"./chunk.ZY3ETQ3D.js";import{a as l}from"./chunk.NVUMRW44.js";import{f as v,k as f}from"./chunk.TPXXHX5J.js";import{a as g}from"./chunk.MGLWXAZO.js";import{m as D}from"./chunk.HZUQXCOQ.js";import{a as h,g as u,k as d,m as _}from"./chunk.J2M2MXP2.js";import{d as r}from"./chunk.M3QDAYD2.js";var P={MIN:"min",MAX:"max",OPEN:"open",DISABLED:"disabled",POPUP_CLASSES:"popup-classes",MASKED:"masked",MASK_FORMAT:"mask-format",SHOW_MASK_FORMAT:"show-mask-format",VALUE_MODE:"value-mode",ALLOW_INVALID_DATE:"allow-invalid-date",SHOW_TODAY:"show-today",SHOW_CLEAR:"show-clear",DISABLED_DAYS_OF_WEEK:"disabled-days-of-week",YEAR_RANGE:"year-range",LOCALE:"locale"},O={TOGGLE:"forge-date-picker-toggle"},S={INPUT:"input",TOGGLE:"[forge-date-picker-toggle],[data-forge-date-picker-toggle]"},s={observedAttributes:P,attributes:O,selectors:S};var n=class extends f{constructor(){super()}connectedCallback(){this.querySelector(s.selectors.INPUT)?this._foundation.initialize():D(this,s.selectors.INPUT).then(()=>{this._foundation.initialize()})}disconnectedCallback(){this._foundation.disconnect()}attributeChangedCallback(t,a,i){switch(t){case s.observedAttributes.MIN:this.min=i;break;case s.observedAttributes.MAX:this.max=i;break;case s.observedAttributes.OPEN:this.open=d(i);break;case s.observedAttributes.POPUP_CLASSES:this.popupClasses=i;break;case s.observedAttributes.DISABLED:this.disabled=d(i);break;case s.observedAttributes.MASKED:this.masked=d(i);break;case s.observedAttributes.SHOW_MASK_FORMAT:this.showMaskFormat=d(i);break;case s.observedAttributes.MASK_FORMAT:this.maskFormat=i;break;case s.observedAttributes.VALUE_MODE:this.valueMode=i;break;case s.observedAttributes.ALLOW_INVALID_DATE:this.allowInvalidDate=d(i);break;case s.observedAttributes.SHOW_TODAY:this.showToday=d(i);break;case s.observedAttributes.SHOW_CLEAR:this.showClear=d(i);break;case s.observedAttributes.DISABLED_DAYS_OF_WEEK:this.disabledDaysOfWeek=_(i);break;case s.observedAttributes.YEAR_RANGE:this.yearRange=i;break;case s.observedAttributes.LOCALE:this.locale=i;break}}};r([l()],n.prototype,"value",2),r([l()],n.prototype,"min",2),r([l()],n.prototype,"max",2),r([l()],n.prototype,"disabledDates",2),r([l()],n.prototype,"open",2),r([l()],n.prototype,"popupClasses",2),r([l()],n.prototype,"disabled",2),r([l()],n.prototype,"masked",2),r([l()],n.prototype,"maskFormat",2),r([l()],n.prototype,"showMaskFormat",2),r([l()],n.prototype,"valueMode",2),r([l()],n.prototype,"notifyInputValueChanges",2),r([l()],n.prototype,"allowInvalidDate",2),r([l()],n.prototype,"showToday",2),r([l()],n.prototype,"showClear",2),r([l()],n.prototype,"parseCallback",2),r([l()],n.prototype,"formatCallback",2),r([l()],n.prototype,"prepareMaskCallback",2),r([l()],n.prototype,"disabledDaysOfWeek",2),r([l()],n.prototype,"disableDayCallback",2),r([l()],n.prototype,"yearRange",2),r([l()],n.prototype,"locale",2);function w(p){let e=document.createElement("forge-icon-button");e.type="button",e.tabIndex=-1,e.setAttribute("aria-label","Toggle calendar"),e.slot="trailing",e.density="medium",e.style.marginRight="4px";let t=document.createElement("forge-icon");return t.name=p,e.appendChild(t),e}var M=class extends C{constructor(t){super(t);this._valueChangeListeners=[];this._identifier=h()}initialize(){this._initializeInput()}destroy(){var t;(t=this._calendarDropdown)==null||t.destroy(),this.destroyValueChangeListener()}destroyValueChangeListener(){this._valueChangeListeners.forEach(t=>t())}addToggleListener(t,a){var i;(i=this._toggleElement)==null||i.addEventListener(t,a)}removeToggleListener(t,a){var i;(i=this._toggleElement)==null||i.removeEventListener(t,a)}attachCalendar(t,a){var i,o,c;if(this._calendarDropdown&&((i=this._calendarDropdown)==null||i.destroy()),this._initializeCalendarDropdown(),!this._calendarDropdown)throw new Error("CalendarDropdown was not initialized.");a&&Object.assign(this._calendarDropdown,a),this._calendarDropdown.open(t),(o=this._calendarDropdown.dropdownElement)==null||o.style.setProperty("--forge-calendar-width","320px"),(c=this._calendarDropdown.calendar)==null||c.style.setProperty("margin","8px")}detachCalendar(){this._calendarDropdown&&this._calendarDropdown.isOpen&&this._calendarDropdown.close()}goToCalendarDate(t){var a,i;(i=(a=this._calendarDropdown)==null?void 0:a.calendar)==null||i.goToDate(t,!0)}addDateSelectListener(t){var a,i;(i=(a=this._calendarDropdown)==null?void 0:a.calendar)==null||i.addEventListener(b.events.DATE_SELECT,t)}removeDateSelectListener(t){var a,i;(i=(a=this._calendarDropdown)==null?void 0:a.calendar)==null||i.removeEventListener(b.events.DATE_SELECT,t)}setCalendarValue(t){var a;(a=this._calendarDropdown)!=null&&a.calendar&&(this._calendarDropdown.calendar.value=t)}setCalendarMinDate(t){var a;(a=this._calendarDropdown)!=null&&a.calendar&&(this._calendarDropdown.calendar.min=t)}setCalendarMaxDate(t){var a;(a=this._calendarDropdown)!=null&&a.calendar&&(this._calendarDropdown.calendar.max=t)}setCalendarDisabledDates(t){var a;(a=this._calendarDropdown)!=null&&a.calendar&&(this._calendarDropdown.calendar.disabledDates=t)}setCalendarDisabledDaysOfWeek(t){var a;(a=this._calendarDropdown)!=null&&a.calendar&&(this._calendarDropdown.calendar.disabledDaysOfWeek=t)}setCalendarDisableDayCallback(t){var a;(a=this._calendarDropdown)!=null&&a.calendar&&(this._calendarDropdown.calendar.disabledDateBuilder=t)}setCalendarActiveDate(t){var a,i;(i=(a=this._calendarDropdown)==null?void 0:a.calendar)==null||i.setActiveDate(t)}getCalendarActiveDate(){var t,a;return(a=(t=this._calendarDropdown)==null?void 0:t.calendar)==null?void 0:a.activeDate}setCalendarYearRange(t){var a,i;(i=(a=this._calendarDropdown)==null?void 0:a.calendar)!=null&&i.yearRange&&(this._calendarDropdown.calendar.yearRange=t)}setCalendarLocale(t){var a;(a=this._calendarDropdown)!=null&&a.calendar&&(this._calendarDropdown.locale=t)}propagateCalendarKey(t){var a,i;(i=(a=this._calendarDropdown)==null?void 0:a.calendar)==null||i.handleKey(t)}tryCreateToggle(){let t=this._component.querySelector("forge-text-field"),a=this._component.querySelector(s.selectors.TOGGLE);if(t){let i=t.querySelector(`${I.elementName}[slot=trailing]`);if(i||a){this._toggleElement=i||a;return}let o=this._createToggleElement();t.appendChild(o),this._toggleElement=o}else a&&(this._toggleElement=a)}_createToggleElement(){return w("insert_invitation")}_getDefaultTargetElement(){let t=this._component.querySelector("forge-text-field");if(t&&t.shadowRoot){let a=v(t,E.selectors.ROOT);if(a)return a}return this._component.querySelector("input")||this._component}};var A=class{constructor(e){this._adapter=e;this._value=null;this._min=null;this._max=null;this._disabledDates=null;this._open=!1;this._disabled=!1;this._masked=!0;this._maskFormat=y;this._showMaskFormat=!1;this._valueMode="object";this._notifyInputValueChanges=!0;this._allowInvalidDate=!1;this._showToday=!1;this._showClear=!1;this._yearRange="-50:+50";this._isInitialized=!1;this._inputListener=t=>this._onInput(t),this._inputKeydownListener=t=>this._onInputKeydown(t),this._inputFocusListener=t=>this._onInputFocus(t),this._inputBlurListener=t=>this._onInputBlur(t),this._inputValueChangedListener=t=>this._onInputValueChanged(t),this._dropdownCloseListener=()=>this._onDropdownClose(),this._toggleMousedownListener=t=>this._onToggleMousedown(t),this._dateSelectListener=t=>this._onDateSelected(t.detail),this._activeChangeListener=t=>this._onActiveDescendantChanged(t),this._todayListener=()=>this._onToday(),this._clearListener=()=>this._onClear()}initialize(){var e;if(this._adapter.initialize(),this._adapter.initializeAccessibility(),!this._adapter.hasInputElement())throw new Error("Unable to locate child <input> element.");(e=this._initializeState)==null||e.call(this),this._adapter.tryCreateToggle(),this._masked||this._setInputChangeListeners(),this._initializeListeners(),this._setFormattedInputValue(!0),this._applyDisabled(),this._applyMask(),this._initializeValueChangedListeners(),this._isInitialized=!0}disconnect(){this._isInitialized=!1,this._destroyListeners(),this._masked&&this._adapter.destroyMask(),this._closeCalendar(),this._adapter.destroy()}_initializeListeners(){this._adapter.addToggleListener("mousedown",this._toggleMousedownListener),this._adapter.addInputListener("keydown",this._inputKeydownListener,!0),this._adapter.addInputListener("focus",this._inputFocusListener),this._adapter.addInputListener("blur",this._inputBlurListener)}_initializeValueChangedListeners(){this._adapter.setInputValueChangedListener(this,this._inputValueChangedListener)}_setInputChangeListeners(){this._adapter.addInputListener("input",this._inputListener)}_removeInputChangeListeners(){this._adapter.removeInputListener("input",this._inputListener)}_destroyListeners(){this._adapter.removeToggleListener("mousedown",this._toggleMousedownListener),this._adapter.removeInputListener("keydown",this._inputKeydownListener,!0),this._adapter.removeInputListener("focus",this._inputFocusListener),this._adapter.removeInputListener("blur",this._inputBlurListener),this._removeInputChangeListeners()}_onInput(e){this._handleInput(this._adapter.getInputValue())}_onInputFocus(e){this.masked&&this.showMaskFormat&&this._applyMask(),this._adapter.selectInputText()}_onInputBlur(e){this.masked&&this.showMaskFormat&&this._applyMask(),this._formatInputValue(),this._open&&!this._adapter.isInputFocused()&&this._closeCalendar(!0)}_openCalendar(e=!1){this._formatInputValue();let t={mode:this._mode,value:this._getCurrentValue(),min:this._min,max:this._max,disabledDates:this._disabledDates,yearRange:this._yearRange,todayButton:this._showToday,clearButton:this._showClear,todayCallback:this._todayListener,clearCallback:this._clearListener,disabledDateBuilder:this._disableDayCallback,disabledDaysOfWeek:this._disabledDaysOfWeek,preventFocus:!0,menuAnimation:"fade",fixedHeight:!0,selectionFollowsMonth:!0,locale:this._locale},a={popupClasses:this._popupClasses,closeCallback:this._dropdownCloseListener,activeChangeCallback:this._activeChangeListener};this._adapter.attachCalendar(t,a),this._adapter.addDateSelectListener(this._dateSelectListener),this._open=!0,this._adapter.setHostAttribute(s.observedAttributes.OPEN),e&&this._emitOpenEvent()}_closeCalendar(e=!1){this._open=!1,this._adapter.removeHostAttribute(s.observedAttributes.OPEN),this._adapter.removeDateSelectListener(this._dateSelectListener),this._adapter.detachCalendar(),e&&this._emitCloseEvent()}_onInputKeydown(e){if(e.shiftKey)switch(e.key){case"Delete":case"Backspace":e.preventDefault(),this._onClear(),this._open&&this._closeCalendar(!0);return;case"ArrowLeft":case"ArrowRight":case"m":case"M":case"y":case"Y":case"d":case"D":if(this._open){e.preventDefault(),this._adapter.propagateCalendarKey(e);return}break}switch(e.key){case"Escape":this._open&&(e.preventDefault(),e.stopPropagation(),this._closeCalendar(!0));break;case"ArrowDown":e.preventDefault(),this._open?this._adapter.propagateCalendarKey(e):(this._adapter.selectInputText(),this._openCalendar(!0));break;case"ArrowUp":this._open&&(e.preventDefault(),this._adapter.propagateCalendarKey(e));break;case"ArrowLeft":case"ArrowRight":case"Enter":case"Home":case"End":if(this._open){e.key==="Enter"&&e.stopPropagation(),e.preventDefault();let t=["ArrowLeft","ArrowRight"].includes(e.key);this._masked&&t&&e.stopImmediatePropagation(),this._adapter.propagateCalendarKey(e)}break;case"n":case"t":e.preventDefault(),this._onToday(),this._open&&this._closeCalendar(!0);break;case"PageUp":case"PageDown":this._open&&(e.preventDefault(),this._adapter.propagateCalendarKey(e));break;case"Tab":if(this._open){let t=this._adapter.getCalendarActiveDate();t&&this._onDateSelected({date:t,selected:!0,type:"date"})}break}}_getSanitizedDateString(e){return e.replace(/_|[a-z]|[A-Z]/g,"").replace(/\/$|\/\/$/,"")}_onToggleMousedown(e){this._disabled||(e.stopPropagation(),!this._adapter.isInputDisabled()&&(e.preventDefault(),this._open?this._closeCalendar(!0):(g.isMobile?this._adapter.tryBlurInput():this._adapter.tryFocusInput(),this._openCalendar(!0))))}_onDropdownClose(){this._closeCalendar(!0)}_onActiveDescendantChanged(e){this._adapter.setActiveDescendant(e)}_formatInputValue(){let e=this._adapter.getInputValue();if(e){let t=this._parseDateString(e);if(u(t)&&this._isDateValueAcceptable(t)){let a=this._formatDate(t);a&&a!==e&&this._adapter.setInputValue(a,this._notifyInputValueChanges)}else this._allowInvalidDate||this._adapter.setInputValue("",this._notifyInputValueChanges)}}_formatDate(e){return u(e)?typeof this._formatCallback=="function"?this._formatCallback(e):k(e):""}_parseDateString(e){if(e=e.replace(/_|\s/g,""),!e||!e.length)return null;let t=typeof this._parseCallback=="function"?this._parseCallback(e):m(e);return u(t)?t:null}_coerceDateValue(e){return typeof e=="string"?this._parseDateString(e):e}_getTypedValue(e){switch(this._valueMode){case"object":return e;case"string":return this._formatDate(e);case"iso-string":return e&&e.setHours(0,0,0,0),e?e.toISOString():null;default:return e}}_isDateValueAcceptable(e){if(!e||this._allowInvalidDate)return!0;let t=()=>this._min&&!this._allowInvalidDate?this._min.getTime()<=e.getTime():!0,a=()=>this._max&&!this._allowInvalidDate?this._max.getTime()>=e.getTime():!0,i=()=>Array.isArray(this._disabledDates)?this._disabledDates:this._disabledDates?[this._disabledDates]:[],o=()=>!i().some(L=>L.getTime()===e.getTime()),c=()=>!(this._disabledDaysOfWeek&&this._disabledDaysOfWeek.includes(e.getDay())),T=()=>typeof this._disableDayCallback!="function"||!this._disableDayCallback(e);return t()&&a()&&o()&&c()&&T()}_initializeMask(){let e={showMaskFormat:this._showMaskFormat&&this._adapter.isInputFocused(),pattern:this._maskFormat,onChange:t=>this._handleInput(t)};this._prepareMaskCallback&&(e.prepareCallback=(t,a,i,o)=>this._prepareMaskCallback.call(null,t,a,i,o)),this._adapter.initializeMask(e)}_applyMask(){this._masked?this._initializeMask():(this._adapter.destroyMask(),this._formatInputValue())}_applyMin(){this._isInitialized&&this._adapter.setCalendarMinDate(this._min)}_applyMax(){this._isInitialized&&this._adapter.setCalendarMaxDate(this._max)}_applyDisableDayCallback(){this._adapter.setCalendarDisableDayCallback(this._disableDayCallback)}_applyDisabled(){this._adapter.setDisabled(this._disabled)}get valueMode(){return this._valueMode}set valueMode(e){if(this._valueMode!==e){if(!["object","string","iso-string"].includes(e))return;this._valueMode=e,this._emitChangeEvent(this._value),this._adapter.setHostAttribute(s.observedAttributes.VALUE_MODE,this._valueMode)}}get min(){return this._min?new Date(this._min.getTime()):null}set min(e){if(this._min!==e){let t=this._coerceDateValue(e);this._min=t?new Date(t.getTime()):null,this._applyMin(),this._isInitialized&&this._open&&this._adapter.setCalendarMinDate(this._min)}}get max(){return this._max?new Date(this._max.getTime()):null}set max(e){this._max!==e&&(this._max=this._coerceDateValue(e),this._applyMax(),this._isInitialized&&this._open&&this._adapter.setCalendarMaxDate(this._max))}get open(){return this._open}set open(e){this._open!==e&&this._isInitialized&&(this._open=e,this._open?this._openCalendar():this._closeCalendar())}get disabled(){return this._disabled}set disabled(e){this._disabled!==e&&(this._disabled=e,this._isInitialized&&this._applyDisabled())}get disabledDates(){return this._disabledDates?Array.isArray(this._disabledDates)?this._disabledDates.map(e=>new Date(e.getTime())):new Date(this._disabledDates.getTime()):null}set disabledDates(e){e?Array.isArray(e)?this._disabledDates=e.map(t=>new Date(t.getTime())):this._disabledDates=new Date(e.getTime()):this._disabledDates=null,this._isInitialized&&this._open&&this._adapter.setCalendarDisabledDates(this._disabledDates),this._applyDisabledDates()}get popupClasses(){return Array.isArray(this._popupClasses)?[...this._popupClasses]:this._popupClasses}set popupClasses(e){Array.isArray(e)?this._popupClasses=[...e]:this._popupClasses=e}get masked(){return this._masked}set masked(e){this._masked!==e&&(this._masked=e,this._isInitialized&&(this._masked?(this._removeInputChangeListeners(),this._applyMask()):(this._adapter.destroyMask(),this._setInputChangeListeners(),this._formatInputValue())))}get maskFormat(){return this._maskFormat}set maskFormat(e){this._maskFormat!==e&&(this._maskFormat=e,this._isInitialized&&this._applyMask())}get showMaskFormat(){return this._showMaskFormat}set showMaskFormat(e){this._showMaskFormat!==e&&(this._showMaskFormat=e)}get notifyInputValueChanges(){return this._notifyInputValueChanges}set notifyInputValueChanges(e){this._notifyInputValueChanges=e}get allowInvalidDate(){return this._allowInvalidDate}set allowInvalidDate(e){this._allowInvalidDate!==e&&(this._allowInvalidDate=e,this._adapter.toggleHostAttribute(s.observedAttributes.ALLOW_INVALID_DATE,this._allowInvalidDate))}get disabledDaysOfWeek(){return this._disabledDaysOfWeek}set disabledDaysOfWeek(e){this._disabledDaysOfWeek!==e&&(this._disabledDaysOfWeek=e,this._isInitialized&&this._open&&this._adapter.setCalendarDisabledDaysOfWeek(this._disabledDaysOfWeek),this._applyDisabledDaysOfWeek())}get disableDayCallback(){return this._disableDayCallback}set disableDayCallback(e){e!==this._disableDayCallback&&(this._disableDayCallback=e,this._applyDisableDayCallback())}get parseCallback(){return this._parseCallback}set parseCallback(e){this._parseCallback=e,this._isInitialized&&this._applyMask()}get formatCallback(){return this._formatCallback}set formatCallback(e){this._formatCallback=e,this._isInitialized&&this._applyMask()}get prepareMaskCallback(){return this._prepareMaskCallback}set prepareMaskCallback(e){this._prepareMaskCallback=e,this._isInitialized&&this._applyMask()}get showToday(){return this._showToday}set showToday(e){this._showToday=e}get showClear(){return this._showClear}set showClear(e){this._showClear=e}get yearRange(){return this._yearRange}set yearRange(e){this._yearRange!==e&&(this._yearRange=e,this._isInitialized&&this._open&&this._adapter.setCalendarYearRange(this._yearRange))}get locale(){return this._locale}set locale(e){this._locale!==e&&(this._locale=e,this._isInitialized&&this._open&&this._adapter.setCalendarLocale(this._locale))}};export{s as a,n as b,w as c,M as d,A as e};
|
|
7
|
-
//# sourceMappingURL=chunk.
|
|
6
|
+
import{a as b}from"./chunk.IC4DLKE3.js";import{a as E}from"./chunk.LEN33O6V.js";import{a as I}from"./chunk.S2KPWTRW.js";import{c as m,d as k}from"./chunk.QG5EYBS3.js";import{a as y}from"./chunk.XIQFHO5R.js";import{a as C}from"./chunk.ZY3ETQ3D.js";import{a as l}from"./chunk.NVUMRW44.js";import{f as v,k as f}from"./chunk.TPXXHX5J.js";import{a as g}from"./chunk.MGLWXAZO.js";import{m as D}from"./chunk.HZUQXCOQ.js";import{a as h,g as u,k as d,m as _}from"./chunk.J2M2MXP2.js";import{d as r}from"./chunk.M3QDAYD2.js";var P={MIN:"min",MAX:"max",OPEN:"open",DISABLED:"disabled",POPUP_CLASSES:"popup-classes",MASKED:"masked",MASK_FORMAT:"mask-format",SHOW_MASK_FORMAT:"show-mask-format",VALUE_MODE:"value-mode",ALLOW_INVALID_DATE:"allow-invalid-date",SHOW_TODAY:"show-today",SHOW_CLEAR:"show-clear",DISABLED_DAYS_OF_WEEK:"disabled-days-of-week",YEAR_RANGE:"year-range",LOCALE:"locale"},O={TOGGLE:"forge-date-picker-toggle"},S={INPUT:"input",TOGGLE:"[forge-date-picker-toggle],[data-forge-date-picker-toggle]"},s={observedAttributes:P,attributes:O,selectors:S};var n=class extends f{constructor(){super()}connectedCallback(){this.querySelector(s.selectors.INPUT)?this._foundation.initialize():D(this,s.selectors.INPUT).then(()=>{this._foundation.initialize()})}disconnectedCallback(){this._foundation.disconnect()}attributeChangedCallback(t,a,i){switch(t){case s.observedAttributes.MIN:this.min=i;break;case s.observedAttributes.MAX:this.max=i;break;case s.observedAttributes.OPEN:this.open=d(i);break;case s.observedAttributes.POPUP_CLASSES:this.popupClasses=i;break;case s.observedAttributes.DISABLED:this.disabled=d(i);break;case s.observedAttributes.MASKED:this.masked=d(i);break;case s.observedAttributes.SHOW_MASK_FORMAT:this.showMaskFormat=d(i);break;case s.observedAttributes.MASK_FORMAT:this.maskFormat=i;break;case s.observedAttributes.VALUE_MODE:this.valueMode=i;break;case s.observedAttributes.ALLOW_INVALID_DATE:this.allowInvalidDate=d(i);break;case s.observedAttributes.SHOW_TODAY:this.showToday=d(i);break;case s.observedAttributes.SHOW_CLEAR:this.showClear=d(i);break;case s.observedAttributes.DISABLED_DAYS_OF_WEEK:this.disabledDaysOfWeek=_(i);break;case s.observedAttributes.YEAR_RANGE:this.yearRange=i;break;case s.observedAttributes.LOCALE:this.locale=i;break}}};r([l()],n.prototype,"value",2),r([l()],n.prototype,"min",2),r([l()],n.prototype,"max",2),r([l()],n.prototype,"disabledDates",2),r([l()],n.prototype,"open",2),r([l()],n.prototype,"popupClasses",2),r([l()],n.prototype,"disabled",2),r([l()],n.prototype,"masked",2),r([l()],n.prototype,"maskFormat",2),r([l()],n.prototype,"showMaskFormat",2),r([l()],n.prototype,"valueMode",2),r([l()],n.prototype,"notifyInputValueChanges",2),r([l()],n.prototype,"allowInvalidDate",2),r([l()],n.prototype,"showToday",2),r([l()],n.prototype,"showClear",2),r([l()],n.prototype,"parseCallback",2),r([l()],n.prototype,"formatCallback",2),r([l()],n.prototype,"prepareMaskCallback",2),r([l()],n.prototype,"disabledDaysOfWeek",2),r([l()],n.prototype,"disableDayCallback",2),r([l()],n.prototype,"yearRange",2),r([l()],n.prototype,"locale",2);function w(p){let e=document.createElement("forge-icon-button");e.type="button",e.tabIndex=-1,e.setAttribute("aria-label","Toggle calendar"),e.slot="trailing",e.density="medium",e.style.marginRight="4px";let t=document.createElement("forge-icon");return t.name=p,e.appendChild(t),e}var M=class extends C{constructor(t){super(t);this._valueChangeListeners=[];this._identifier=h()}initialize(){this._initializeInput()}destroy(){var t;(t=this._calendarDropdown)==null||t.destroy(),this.destroyValueChangeListener()}destroyValueChangeListener(){this._valueChangeListeners.forEach(t=>t())}addToggleListener(t,a){var i;(i=this._toggleElement)==null||i.addEventListener(t,a)}removeToggleListener(t,a){var i;(i=this._toggleElement)==null||i.removeEventListener(t,a)}attachCalendar(t,a){var i,o,c;if(this._calendarDropdown&&((i=this._calendarDropdown)==null||i.destroy()),this._initializeCalendarDropdown(),!this._calendarDropdown)throw new Error("CalendarDropdown was not initialized.");a&&Object.assign(this._calendarDropdown,a),this._calendarDropdown.open(t),(o=this._calendarDropdown.dropdownElement)==null||o.style.setProperty("--forge-calendar-width","320px"),(c=this._calendarDropdown.calendar)==null||c.style.setProperty("margin","8px")}detachCalendar(){this._calendarDropdown&&this._calendarDropdown.isOpen&&this._calendarDropdown.close()}goToCalendarDate(t){var a,i;(i=(a=this._calendarDropdown)==null?void 0:a.calendar)==null||i.goToDate(t,!0)}addDateSelectListener(t){var a,i;(i=(a=this._calendarDropdown)==null?void 0:a.calendar)==null||i.addEventListener(b.events.DATE_SELECT,t)}removeDateSelectListener(t){var a,i;(i=(a=this._calendarDropdown)==null?void 0:a.calendar)==null||i.removeEventListener(b.events.DATE_SELECT,t)}setCalendarValue(t){var a;(a=this._calendarDropdown)!=null&&a.calendar&&(this._calendarDropdown.calendar.value=t)}setCalendarMinDate(t){var a;(a=this._calendarDropdown)!=null&&a.calendar&&(this._calendarDropdown.calendar.min=t)}setCalendarMaxDate(t){var a;(a=this._calendarDropdown)!=null&&a.calendar&&(this._calendarDropdown.calendar.max=t)}setCalendarDisabledDates(t){var a;(a=this._calendarDropdown)!=null&&a.calendar&&(this._calendarDropdown.calendar.disabledDates=t)}setCalendarDisabledDaysOfWeek(t){var a;(a=this._calendarDropdown)!=null&&a.calendar&&(this._calendarDropdown.calendar.disabledDaysOfWeek=t)}setCalendarDisableDayCallback(t){var a;(a=this._calendarDropdown)!=null&&a.calendar&&(this._calendarDropdown.calendar.disabledDateBuilder=t)}setCalendarActiveDate(t){var a,i;(i=(a=this._calendarDropdown)==null?void 0:a.calendar)==null||i.setActiveDate(t)}getCalendarActiveDate(){var t,a;return(a=(t=this._calendarDropdown)==null?void 0:t.calendar)==null?void 0:a.activeDate}setCalendarYearRange(t){var a,i;(i=(a=this._calendarDropdown)==null?void 0:a.calendar)!=null&&i.yearRange&&(this._calendarDropdown.calendar.yearRange=t)}setCalendarLocale(t){var a;(a=this._calendarDropdown)!=null&&a.calendar&&(this._calendarDropdown.locale=t)}propagateCalendarKey(t){var a,i;(i=(a=this._calendarDropdown)==null?void 0:a.calendar)==null||i.handleKey(t)}tryCreateToggle(){let t=this._component.querySelector("forge-text-field"),a=this._component.querySelector(s.selectors.TOGGLE);if(t){let i=t.querySelector(`${I.elementName}[slot=trailing]`);if(i||a){this._toggleElement=i||a;return}let o=this._createToggleElement();t.appendChild(o),this._toggleElement=o}else a&&(this._toggleElement=a)}_createToggleElement(){return w("insert_invitation")}_getDefaultTargetElement(){let t=this._component.querySelector("forge-text-field");if(t&&t.shadowRoot){let a=v(t,E.selectors.ROOT);if(a)return a}return this._component.querySelector("input")||this._component}};var A=class{constructor(e){this._adapter=e;this._value=null;this._min=null;this._max=null;this._disabledDates=null;this._open=!1;this._disabled=!1;this._masked=!0;this._maskFormat=y;this._showMaskFormat=!1;this._valueMode="object";this._notifyInputValueChanges=!0;this._allowInvalidDate=!1;this._showToday=!1;this._showClear=!1;this._yearRange="-50:+50";this._isInitialized=!1;this._inputListener=t=>this._onInput(t),this._inputKeydownListener=t=>this._onInputKeydown(t),this._inputFocusListener=t=>this._onInputFocus(t),this._inputBlurListener=t=>this._onInputBlur(t),this._inputValueChangedListener=t=>this._onInputValueChanged(t),this._dropdownCloseListener=()=>this._onDropdownClose(),this._toggleMousedownListener=t=>this._onToggleMousedown(t),this._dateSelectListener=t=>this._onDateSelected(t.detail),this._activeChangeListener=t=>this._onActiveDescendantChanged(t),this._todayListener=()=>this._onToday(),this._clearListener=()=>this._onClear()}initialize(){var e;if(this._adapter.initialize(),this._adapter.initializeAccessibility(),!this._adapter.hasInputElement())throw new Error("Unable to locate child <input> element.");(e=this._initializeState)==null||e.call(this),this._adapter.tryCreateToggle(),this._masked||this._setInputChangeListeners(),this._initializeListeners(),this._setFormattedInputValue(!0),this._applyDisabled(),this._applyMask(),this._initializeValueChangedListeners(),this._isInitialized=!0}disconnect(){this._isInitialized=!1,this._destroyListeners(),this._masked&&this._adapter.destroyMask(),this._closeCalendar(),this._adapter.destroy()}_initializeListeners(){this._adapter.addToggleListener("mousedown",this._toggleMousedownListener),this._adapter.addInputListener("keydown",this._inputKeydownListener,!0),this._adapter.addInputListener("focus",this._inputFocusListener),this._adapter.addInputListener("blur",this._inputBlurListener)}_initializeValueChangedListeners(){this._adapter.setInputValueChangedListener(this,this._inputValueChangedListener)}_setInputChangeListeners(){this._adapter.addInputListener("input",this._inputListener)}_removeInputChangeListeners(){this._adapter.removeInputListener("input",this._inputListener)}_destroyListeners(){this._adapter.removeToggleListener("mousedown",this._toggleMousedownListener),this._adapter.removeInputListener("keydown",this._inputKeydownListener,!0),this._adapter.removeInputListener("focus",this._inputFocusListener),this._adapter.removeInputListener("blur",this._inputBlurListener),this._removeInputChangeListeners()}_onInput(e){this._handleInput(this._adapter.getInputValue())}_onInputFocus(e){this.masked&&this.showMaskFormat&&this._applyMask(),this._adapter.selectInputText()}_onInputBlur(e){this.masked&&this.showMaskFormat&&this._applyMask(),this._formatInputValue(),this._open&&!this._adapter.isInputFocused()&&this._closeCalendar(!0)}_openCalendar(e=!1){this._formatInputValue();let t={mode:this._mode,value:this._getCurrentValue(),min:this._min,max:this._max,disabledDates:this._disabledDates,yearRange:this._yearRange,todayButton:this._showToday,clearButton:this._showClear,todayCallback:this._todayListener,clearCallback:this._clearListener,disabledDateBuilder:this._disableDayCallback,disabledDaysOfWeek:this._disabledDaysOfWeek,preventFocus:!0,menuAnimation:"fade",fixedHeight:!0,selectionFollowsMonth:!0,locale:this._locale},a={popupClasses:this._popupClasses,closeCallback:this._dropdownCloseListener,activeChangeCallback:this._activeChangeListener};this._adapter.attachCalendar(t,a),this._adapter.addDateSelectListener(this._dateSelectListener),this._open=!0,this._adapter.setHostAttribute(s.observedAttributes.OPEN),e&&this._emitOpenEvent()}_closeCalendar(e=!1){this._open=!1,this._adapter.removeHostAttribute(s.observedAttributes.OPEN),this._adapter.removeDateSelectListener(this._dateSelectListener),this._adapter.detachCalendar(),e&&this._emitCloseEvent()}_onInputKeydown(e){if(e.shiftKey)switch(e.key){case"Delete":case"Backspace":e.preventDefault(),this._onClear(),this._open&&this._closeCalendar(!0);return;case"ArrowLeft":case"ArrowRight":case"m":case"M":case"y":case"Y":case"d":case"D":if(this._open){e.preventDefault(),this._adapter.propagateCalendarKey(e);return}break}switch(e.key){case"Escape":this._open&&(e.preventDefault(),e.stopPropagation(),this._closeCalendar(!0));break;case"ArrowDown":e.preventDefault(),this._open?this._adapter.propagateCalendarKey(e):(this._adapter.selectInputText(),this._openCalendar(!0));break;case"ArrowUp":this._open&&(e.preventDefault(),this._adapter.propagateCalendarKey(e));break;case"ArrowLeft":case"ArrowRight":case"Enter":case"Home":case"End":if(this._open){e.key==="Enter"&&e.stopPropagation(),e.preventDefault();let t=["ArrowLeft","ArrowRight"].includes(e.key);this._masked&&t&&e.stopImmediatePropagation(),this._adapter.propagateCalendarKey(e)}break;case"n":case"t":e.preventDefault(),this._onToday(),this._open&&this._closeCalendar(!0);break;case"PageUp":case"PageDown":this._open&&(e.preventDefault(),this._adapter.propagateCalendarKey(e));break;case"Tab":if(this._open){let t=this._adapter.getCalendarActiveDate();t&&this._onDateSelected({date:t,selected:!0,type:"date"})}break}}_getSanitizedDateString(e){return e.replace(/_|[a-z]|[A-Z]/g,"").replace(/\/$|\/\/$/,"")}_onToggleMousedown(e){this._disabled||(e.stopPropagation(),!this._adapter.isInputDisabled()&&(e.preventDefault(),this._open?this._closeCalendar(!0):(g.isMobile?this._adapter.tryBlurInput():this._adapter.tryFocusInput(),this._openCalendar(!0))))}_onDropdownClose(){this._closeCalendar(!0)}_onActiveDescendantChanged(e){this._adapter.setActiveDescendant(e)}_formatInputValue(){let e=this._adapter.getInputValue();if(e){let t=this._parseDateString(e);if(u(t)&&this._isDateValueAcceptable(t)){let a=this._formatDate(t);a&&a!==e&&this._adapter.setInputValue(a,this._notifyInputValueChanges)}else this._allowInvalidDate||this._adapter.setInputValue("",this._notifyInputValueChanges)}}_formatDate(e){return u(e)?typeof this._formatCallback=="function"?this._formatCallback(e):k(e):""}_parseDateString(e){if(e=e.replace(/_|\s/g,""),!e||!e.length)return null;let t=typeof this._parseCallback=="function"?this._parseCallback(e):m(e);return u(t)?t:null}_coerceDateValue(e){return typeof e=="string"?this._parseDateString(e):e}_getTypedValue(e){switch(this._valueMode){case"object":return e;case"string":return this._formatDate(e);case"iso-string":return e&&e.setHours(0,0,0,0),e?e.toISOString():null;default:return e}}_isDateValueAcceptable(e){if(!e||this._allowInvalidDate)return!0;let t=()=>this._min&&!this._allowInvalidDate?this._min.getTime()<=e.getTime():!0,a=()=>this._max&&!this._allowInvalidDate?this._max.getTime()>=e.getTime():!0,i=()=>Array.isArray(this._disabledDates)?this._disabledDates:this._disabledDates?[this._disabledDates]:[],o=()=>!i().some(L=>L.getTime()===e.getTime()),c=()=>!(this._disabledDaysOfWeek&&this._disabledDaysOfWeek.includes(e.getDay())),T=()=>typeof this._disableDayCallback!="function"||!this._disableDayCallback(e);return t()&&a()&&o()&&c()&&T()}_initializeMask(){let e={showMaskFormat:this._showMaskFormat&&this._adapter.isInputFocused(),pattern:this._maskFormat,onChange:t=>this._handleInput(t)};this._prepareMaskCallback&&(e.prepareCallback=(t,a,i,o)=>this._prepareMaskCallback.call(null,t,a,i,o)),this._adapter.initializeMask(e)}_applyMask(){this._masked?this._initializeMask():(this._adapter.destroyMask(),this._formatInputValue())}_applyMin(){this._isInitialized&&this._adapter.setCalendarMinDate(this._min)}_applyMax(){this._isInitialized&&this._adapter.setCalendarMaxDate(this._max)}_applyDisableDayCallback(){this._adapter.setCalendarDisableDayCallback(this._disableDayCallback)}_applyDisabled(){this._adapter.setDisabled(this._disabled)}get valueMode(){return this._valueMode}set valueMode(e){if(this._valueMode!==e){if(!["object","string","iso-string"].includes(e))return;this._valueMode=e,this._emitChangeEvent(this._value),this._adapter.setHostAttribute(s.observedAttributes.VALUE_MODE,this._valueMode)}}get min(){return this._min?new Date(this._min.getTime()):null}set min(e){if(this._min!==e){let t=this._coerceDateValue(e);this._min=t?new Date(t.getTime()):null,this._applyMin(),this._isInitialized&&this._open&&this._adapter.setCalendarMinDate(this._min)}}get max(){return this._max?new Date(this._max.getTime()):null}set max(e){this._max!==e&&(this._max=this._coerceDateValue(e),this._applyMax(),this._isInitialized&&this._open&&this._adapter.setCalendarMaxDate(this._max))}get open(){return this._open}set open(e){this._open!==e&&this._isInitialized&&(this._open=e,this._open?this._openCalendar():this._closeCalendar())}get disabled(){return this._disabled}set disabled(e){this._disabled!==e&&(this._disabled=e,this._isInitialized&&this._applyDisabled())}get disabledDates(){return this._disabledDates?Array.isArray(this._disabledDates)?this._disabledDates.map(e=>new Date(e.getTime())):new Date(this._disabledDates.getTime()):null}set disabledDates(e){e?Array.isArray(e)?this._disabledDates=e.map(t=>new Date(t.getTime())):this._disabledDates=new Date(e.getTime()):this._disabledDates=null,this._isInitialized&&this._open&&this._adapter.setCalendarDisabledDates(this._disabledDates),this._applyDisabledDates()}get popupClasses(){return Array.isArray(this._popupClasses)?[...this._popupClasses]:this._popupClasses}set popupClasses(e){Array.isArray(e)?this._popupClasses=[...e]:this._popupClasses=e}get masked(){return this._masked}set masked(e){this._masked!==e&&(this._masked=e,this._isInitialized&&(this._masked?(this._removeInputChangeListeners(),this._applyMask()):(this._adapter.destroyMask(),this._setInputChangeListeners(),this._formatInputValue())))}get maskFormat(){return this._maskFormat}set maskFormat(e){this._maskFormat!==e&&(this._maskFormat=e,this._isInitialized&&this._applyMask())}get showMaskFormat(){return this._showMaskFormat}set showMaskFormat(e){this._showMaskFormat!==e&&(this._showMaskFormat=e)}get notifyInputValueChanges(){return this._notifyInputValueChanges}set notifyInputValueChanges(e){this._notifyInputValueChanges=e}get allowInvalidDate(){return this._allowInvalidDate}set allowInvalidDate(e){this._allowInvalidDate!==e&&(this._allowInvalidDate=e,this._adapter.toggleHostAttribute(s.observedAttributes.ALLOW_INVALID_DATE,this._allowInvalidDate))}get disabledDaysOfWeek(){return this._disabledDaysOfWeek}set disabledDaysOfWeek(e){this._disabledDaysOfWeek!==e&&(this._disabledDaysOfWeek=e,this._isInitialized&&this._open&&this._adapter.setCalendarDisabledDaysOfWeek(this._disabledDaysOfWeek),this._applyDisabledDaysOfWeek())}get disableDayCallback(){return this._disableDayCallback}set disableDayCallback(e){e!==this._disableDayCallback&&(this._disableDayCallback=e,this._applyDisableDayCallback())}get parseCallback(){return this._parseCallback}set parseCallback(e){this._parseCallback=e,this._isInitialized&&this._applyMask()}get formatCallback(){return this._formatCallback}set formatCallback(e){this._formatCallback=e,this._isInitialized&&this._applyMask()}get prepareMaskCallback(){return this._prepareMaskCallback}set prepareMaskCallback(e){this._prepareMaskCallback=e,this._isInitialized&&this._applyMask()}get showToday(){return this._showToday}set showToday(e){this._showToday=e}get showClear(){return this._showClear}set showClear(e){this._showClear=e}get yearRange(){return this._yearRange}set yearRange(e){this._yearRange!==e&&(this._yearRange=e,this._isInitialized&&this._open&&this._adapter.setCalendarYearRange(this._yearRange))}get locale(){return this._locale}set locale(e){this._locale!==e&&(this._locale=e,this._isInitialized&&this._open&&this._adapter.setCalendarLocale(this._locale))}};export{s as a,n as b,w as c,M as d,A as e};
|
|
7
|
+
//# sourceMappingURL=chunk.7AE3ATT3.js.map
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* Copyright 2023 Tyler Technologies, Inc.
|
|
4
4
|
* License: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import{d as t}from"./chunk.
|
|
7
|
-
//# sourceMappingURL=chunk.
|
|
6
|
+
import{d as t}from"./chunk.FOQH2SSU.js";import{a as o}from"./chunk.TPXXHX5J.js";function m(){o(t)}export{m as a};
|
|
7
|
+
//# sourceMappingURL=chunk.AXBMJBED.js.map
|