@ds-autonomie/web-components 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +318 -0
- package/LICENSE +8 -0
- package/README.md +3 -0
- package/dist/chunks/chunk.23TOS4ZE.js +29 -0
- package/dist/chunks/chunk.2FK6USFR.js +63 -0
- package/dist/chunks/chunk.2HUORR44.js +76 -0
- package/dist/chunks/chunk.3BL7JA77.js +59 -0
- package/dist/chunks/chunk.3RBCYA4F.js +147 -0
- package/dist/chunks/chunk.3XRQRY25.js +25 -0
- package/dist/chunks/chunk.42W4S2HN.js +145 -0
- package/dist/chunks/chunk.4A3WMGMZ.js +79 -0
- package/dist/chunks/chunk.4A57I2HX.js +241 -0
- package/dist/chunks/chunk.4XT2OJD2.js +75 -0
- package/dist/chunks/chunk.5LT3B7MI.js +372 -0
- package/dist/chunks/chunk.5WAZTHII.js +37 -0
- package/dist/chunks/chunk.5XL2LZLC.js +100 -0
- package/dist/chunks/chunk.5XUV3SRW.js +420 -0
- package/dist/chunks/chunk.6FAUBLR3.js +84 -0
- package/dist/chunks/chunk.6M63UXML.js +35 -0
- package/dist/chunks/chunk.6PS5KB3O.js +53 -0
- package/dist/chunks/chunk.6ZQ4OQ2C.js +51 -0
- package/dist/chunks/chunk.73T7TU6S.js +24 -0
- package/dist/chunks/chunk.7J7CS3BK.js +43 -0
- package/dist/chunks/chunk.7NWAYDYI.js +168 -0
- package/dist/chunks/chunk.7ZCCXTFG.js +301 -0
- package/dist/chunks/chunk.A2PAK6VF.js +206 -0
- package/dist/chunks/chunk.ABGBXXKA.js +164 -0
- package/dist/chunks/chunk.AQRNB4GJ.js +33 -0
- package/dist/chunks/chunk.AR5HJD7F.js +111 -0
- package/dist/chunks/chunk.B4BZKR24.js +16 -0
- package/dist/chunks/chunk.BD63GRU5.js +132 -0
- package/dist/chunks/chunk.BEB47LM2.js +278 -0
- package/dist/chunks/chunk.BLPP3Q5H.js +555 -0
- package/dist/chunks/chunk.CJIL3BLA.js +45 -0
- package/dist/chunks/chunk.CPXD6UYZ.js +34 -0
- package/dist/chunks/chunk.D7CATJYB.js +36 -0
- package/dist/chunks/chunk.DC6CT5PU.js +109 -0
- package/dist/chunks/chunk.DRGGQ4WL.js +9 -0
- package/dist/chunks/chunk.DSGUQNN4.js +26 -0
- package/dist/chunks/chunk.DURVPB6M.js +391 -0
- package/dist/chunks/chunk.DXVNWE2M.js +166 -0
- package/dist/chunks/chunk.EFQHAGXP.js +26 -0
- package/dist/chunks/chunk.EHVJT7BH.js +215 -0
- package/dist/chunks/chunk.EKWYMXQO.js +166 -0
- package/dist/chunks/chunk.EMIT7S33.js +71 -0
- package/dist/chunks/chunk.EMJZLQCL.js +60 -0
- package/dist/chunks/chunk.ENKP2IFW.js +361 -0
- package/dist/chunks/chunk.EU56EW33.js +91 -0
- package/dist/chunks/chunk.EYZGEU3G.js +45 -0
- package/dist/chunks/chunk.FDYFSRSX.js +33 -0
- package/dist/chunks/chunk.FIGO7UV2.js +77 -0
- package/dist/chunks/chunk.G7AELPSO.js +131 -0
- package/dist/chunks/chunk.GI7VDIWX.js +24 -0
- package/dist/chunks/chunk.GYTA2LJC.js +145 -0
- package/dist/chunks/chunk.HAL7R4WT.js +0 -0
- package/dist/chunks/chunk.HC5BO5YV.js +405 -0
- package/dist/chunks/chunk.HH63FIEF.js +122 -0
- package/dist/chunks/chunk.HLYGKGDG.js +308 -0
- package/dist/chunks/chunk.I33L3NO6.js +122 -0
- package/dist/chunks/chunk.IGYXUK7A.js +19 -0
- package/dist/chunks/chunk.INCGVIAQ.js +61 -0
- package/dist/chunks/chunk.IOFPPNUO.js +25 -0
- package/dist/chunks/chunk.IRQOFNJE.js +317 -0
- package/dist/chunks/chunk.ISAFRNR2.js +112 -0
- package/dist/chunks/chunk.J2XNYTTZ.js +715 -0
- package/dist/chunks/chunk.JETXIC4F.js +150 -0
- package/dist/chunks/chunk.JT7UJED5.js +33 -0
- package/dist/chunks/chunk.K6WCEYZI.js +52 -0
- package/dist/chunks/chunk.KBT2EKLF.js +25 -0
- package/dist/chunks/chunk.KDAK2GXX.js +58 -0
- package/dist/chunks/chunk.KHIMMW3T.js +33 -0
- package/dist/chunks/chunk.KIFBWPW5.js +298 -0
- package/dist/chunks/chunk.KOH5V4C6.js +552 -0
- package/dist/chunks/chunk.LC54322H.js +99 -0
- package/dist/chunks/chunk.LMJPQPQT.js +26 -0
- package/dist/chunks/chunk.LT7JMZ3T.js +371 -0
- package/dist/chunks/chunk.M245ZGRR.js +80 -0
- package/dist/chunks/chunk.MOWTZFON.js +63 -0
- package/dist/chunks/chunk.MY434P47.js +125 -0
- package/dist/chunks/chunk.N6VVY6XD.js +91 -0
- package/dist/chunks/chunk.NDEZEB3Z.js +402 -0
- package/dist/chunks/chunk.NHRDZGLI.js +81 -0
- package/dist/chunks/chunk.NKKVGICB.js +114 -0
- package/dist/chunks/chunk.NNBOLKWI.js +17 -0
- package/dist/chunks/chunk.O73OYTYJ.js +319 -0
- package/dist/chunks/chunk.OBU65KDL.js +29 -0
- package/dist/chunks/chunk.ODSCDJDO.js +91 -0
- package/dist/chunks/chunk.OVK7QCA7.js +441 -0
- package/dist/chunks/chunk.PQWQ42E2.js +150 -0
- package/dist/chunks/chunk.PULHNCDM.js +98 -0
- package/dist/chunks/chunk.PWWER3ZK.js +806 -0
- package/dist/chunks/chunk.QFJA3MTV.js +66 -0
- package/dist/chunks/chunk.QKNNLZ2M.js +361 -0
- package/dist/chunks/chunk.QL5C2XOW.js +0 -0
- package/dist/chunks/chunk.RDGMZ5XB.js +24 -0
- package/dist/chunks/chunk.RIJQGADY.js +108 -0
- package/dist/chunks/chunk.RMCOWJOW.js +17 -0
- package/dist/chunks/chunk.RY4QCT3T.js +29 -0
- package/dist/chunks/chunk.S4ATPBQN.js +89 -0
- package/dist/chunks/chunk.SGIGGO5M.js +86 -0
- package/dist/chunks/chunk.SQMWMSBA.js +207 -0
- package/dist/chunks/chunk.TJOP7HQP.js +14 -0
- package/dist/chunks/chunk.TUVJKY7S.js +21 -0
- package/dist/chunks/chunk.UA32LJYW.js +230 -0
- package/dist/chunks/chunk.UEUTSYIH.js +60 -0
- package/dist/chunks/chunk.UPYCV66H.js +111 -0
- package/dist/chunks/chunk.UV53JTE3.js +128 -0
- package/dist/chunks/chunk.UZLQVFDR.js +386 -0
- package/dist/chunks/chunk.V7RJROLH.js +48 -0
- package/dist/chunks/chunk.VFYKLPN2.js +144 -0
- package/dist/chunks/chunk.VRY3E2XG.js +196 -0
- package/dist/chunks/chunk.WE6IG5XG.js +164 -0
- package/dist/chunks/chunk.WFHOSUOX.js +263 -0
- package/dist/chunks/chunk.WHK7EFIM.js +264 -0
- package/dist/chunks/chunk.WIEJJS3W.js +88 -0
- package/dist/chunks/chunk.WK7RWLAK.js +54 -0
- package/dist/chunks/chunk.WNHQYL5W.js +298 -0
- package/dist/chunks/chunk.WSVP75MH.js +102 -0
- package/dist/chunks/chunk.XNEONNEJ.js +23 -0
- package/dist/chunks/chunk.XSCX6TC5.js +127 -0
- package/dist/chunks/chunk.XWUQFDIN.js +15 -0
- package/dist/chunks/chunk.Y3ZUFLVS.js +90 -0
- package/dist/chunks/chunk.YCXTCVAZ.js +30 -0
- package/dist/chunks/chunk.YIY5RM53.js +66 -0
- package/dist/chunks/chunk.YL3TSWVM.js +17 -0
- package/dist/chunks/chunk.YS7MY5CH.js +512 -0
- package/dist/chunks/chunk.YY6AEXJK.js +33 -0
- package/dist/chunks/chunk.YZHDFJWJ.js +17 -0
- package/dist/chunks/chunk.Z6TBD2AC.js +125 -0
- package/dist/chunks/chunk.ZKYSHEVZ.js +22 -0
- package/dist/chunks/chunk.ZVGZDTBF.js +104 -0
- package/dist/components/accordion/accordion.d.ts +49 -0
- package/dist/components/accordion/accordion.js +23 -0
- package/dist/components/accordion/accordion.styles.d.ts +2 -0
- package/dist/components/accordion/accordion.styles.js +8 -0
- package/dist/components/alert/alert.d.ts +52 -0
- package/dist/components/alert/alert.js +25 -0
- package/dist/components/alert/alert.styles.d.ts +2 -0
- package/dist/components/alert/alert.styles.js +8 -0
- package/dist/components/animation/animation.d.ts +81 -0
- package/dist/components/animation/animation.js +12 -0
- package/dist/components/animation/animation.styles.d.ts +2 -0
- package/dist/components/animation/animation.styles.js +8 -0
- package/dist/components/animation/animations.d.ts +6 -0
- package/dist/components/animation/animations.js +11 -0
- package/dist/components/avatar/avatar.d.ts +42 -0
- package/dist/components/avatar/avatar.js +19 -0
- package/dist/components/avatar/avatar.styles.d.ts +2 -0
- package/dist/components/avatar/avatar.styles.js +8 -0
- package/dist/components/avatar-group/avatar-group.d.ts +21 -0
- package/dist/components/avatar-group/avatar-group.js +9 -0
- package/dist/components/avatar-group/avatar-group.styles.d.ts +2 -0
- package/dist/components/avatar-group/avatar-group.styles.js +7 -0
- package/dist/components/badge/badge.d.ts +23 -0
- package/dist/components/badge/badge.js +10 -0
- package/dist/components/badge/badge.styles.d.ts +2 -0
- package/dist/components/badge/badge.styles.js +8 -0
- package/dist/components/breadcrumb/breadcrumb.d.ts +23 -0
- package/dist/components/breadcrumb/breadcrumb.js +20 -0
- package/dist/components/breadcrumb/breadcrumb.styles.d.ts +2 -0
- package/dist/components/breadcrumb/breadcrumb.styles.js +8 -0
- package/dist/components/breadcrumb-item/breadcrumb-item.d.ts +30 -0
- package/dist/components/breadcrumb-item/breadcrumb-item.js +12 -0
- package/dist/components/breadcrumb-item/breadcrumb-item.styles.d.ts +2 -0
- package/dist/components/breadcrumb-item/breadcrumb-item.styles.js +8 -0
- package/dist/components/button/button.d.ts +120 -0
- package/dist/components/button/button.js +24 -0
- package/dist/components/button/button.styles.d.ts +2 -0
- package/dist/components/button/button.styles.js +8 -0
- package/dist/components/card/card.d.ts +22 -0
- package/dist/components/card/card.js +11 -0
- package/dist/components/card/card.styles.d.ts +2 -0
- package/dist/components/card/card.styles.js +8 -0
- package/dist/components/checkbox/checkbox.d.ts +93 -0
- package/dist/components/checkbox/checkbox.js +24 -0
- package/dist/components/checkbox/checkbox.styles.d.ts +2 -0
- package/dist/components/checkbox/checkbox.styles.js +9 -0
- package/dist/components/checkbox-button/checkbox-button.d.ts +48 -0
- package/dist/components/checkbox-button/checkbox-button.js +21 -0
- package/dist/components/checkbox-button/checkbox-button.styles.d.ts +2 -0
- package/dist/components/checkbox-button/checkbox-button.styles.js +9 -0
- package/dist/components/checkbox-group/checkbox-group.d.ts +85 -0
- package/dist/components/checkbox-group/checkbox-group.js +16 -0
- package/dist/components/checkbox-group/checkbox-group.styles.d.ts +2 -0
- package/dist/components/checkbox-group/checkbox-group.styles.js +9 -0
- package/dist/components/dialog/dialog.d.ts +70 -0
- package/dist/components/dialog/dialog.js +28 -0
- package/dist/components/dialog/dialog.styles.d.ts +2 -0
- package/dist/components/dialog/dialog.styles.js +8 -0
- package/dist/components/divider/divider.d.ts +17 -0
- package/dist/components/divider/divider.js +10 -0
- package/dist/components/divider/divider.styles.d.ts +2 -0
- package/dist/components/divider/divider.styles.js +8 -0
- package/dist/components/drawer/drawer.d.ts +77 -0
- package/dist/components/drawer/drawer.js +28 -0
- package/dist/components/drawer/drawer.styles.d.ts +2 -0
- package/dist/components/drawer/drawer.styles.js +8 -0
- package/dist/components/dropdown/dropdown.d.ts +87 -0
- package/dist/components/dropdown/dropdown.js +15 -0
- package/dist/components/dropdown/dropdown.styles.d.ts +2 -0
- package/dist/components/dropdown/dropdown.styles.js +8 -0
- package/dist/components/error-text/error-text.d.ts +18 -0
- package/dist/components/error-text/error-text.js +9 -0
- package/dist/components/error-text/error-text.styles.d.ts +2 -0
- package/dist/components/error-text/error-text.styles.js +7 -0
- package/dist/components/format-bytes/format-bytes.d.ts +22 -0
- package/dist/components/format-bytes/format-bytes.js +9 -0
- package/dist/components/format-date/format-date.d.ts +42 -0
- package/dist/components/format-date/format-date.js +9 -0
- package/dist/components/format-number/format-number.d.ts +36 -0
- package/dist/components/format-number/format-number.js +9 -0
- package/dist/components/icon/icon.d.ts +40 -0
- package/dist/components/icon/icon.js +17 -0
- package/dist/components/icon/icon.styles.d.ts +2 -0
- package/dist/components/icon/icon.styles.js +8 -0
- package/dist/components/icon/library.d.ts +21 -0
- package/dist/components/icon/library.default.d.ts +3 -0
- package/dist/components/icon/library.default.js +8 -0
- package/dist/components/icon/library.js +18 -0
- package/dist/components/icon/library.system.d.ts +3 -0
- package/dist/components/icon/library.system.js +7 -0
- package/dist/components/icon/request.d.ts +11 -0
- package/dist/components/icon/request.js +8 -0
- package/dist/components/icon-button/icon-button.d.ts +59 -0
- package/dist/components/icon-button/icon-button.js +19 -0
- package/dist/components/icon-button/icon-button.styles.d.ts +2 -0
- package/dist/components/icon-button/icon-button.styles.js +8 -0
- package/dist/components/include/include.d.ts +32 -0
- package/dist/components/include/include.js +12 -0
- package/dist/components/include/include.styles.d.ts +2 -0
- package/dist/components/include/include.styles.js +8 -0
- package/dist/components/include/request.d.ts +8 -0
- package/dist/components/include/request.js +7 -0
- package/dist/components/input/input.d.ts +165 -0
- package/dist/components/input/input.js +27 -0
- package/dist/components/input/input.styles.d.ts +2 -0
- package/dist/components/input/input.styles.js +9 -0
- package/dist/components/input/input.utils.d.ts +4 -0
- package/dist/components/input/input.utils.js +9 -0
- package/dist/components/input-mask/input-mask.configs.d.ts +42 -0
- package/dist/components/input-mask/input-mask.configs.js +11 -0
- package/dist/components/input-mask/input-mask.d.ts +127 -0
- package/dist/components/input-mask/input-mask.js +19 -0
- package/dist/components/input-mask/input-mask.styles.d.ts +2 -0
- package/dist/components/input-mask/input-mask.styles.js +9 -0
- package/dist/components/input-mask/input-mask.utils.d.ts +7 -0
- package/dist/components/input-mask/input-mask.utils.js +19 -0
- package/dist/components/input-phone/input-phone.configs.d.ts +14 -0
- package/dist/components/input-phone/input-phone.configs.js +7 -0
- package/dist/components/input-phone/input-phone.d.ts +138 -0
- package/dist/components/input-phone/input-phone.js +49 -0
- package/dist/components/input-phone/input-phone.styles.d.ts +2 -0
- package/dist/components/input-phone/input-phone.styles.js +9 -0
- package/dist/components/input-phone/input-phone.utils.d.ts +9 -0
- package/dist/components/input-phone/input-phone.utils.js +13 -0
- package/dist/components/menu/menu.d.ts +43 -0
- package/dist/components/menu/menu.js +10 -0
- package/dist/components/menu/menu.styles.d.ts +2 -0
- package/dist/components/menu/menu.styles.js +8 -0
- package/dist/components/menu-item/menu-item.d.ts +44 -0
- package/dist/components/menu-item/menu-item.js +20 -0
- package/dist/components/menu-item/menu-item.styles.d.ts +2 -0
- package/dist/components/menu-item/menu-item.styles.js +8 -0
- package/dist/components/menu-label/menu-label.d.ts +17 -0
- package/dist/components/menu-label/menu-label.js +10 -0
- package/dist/components/menu-label/menu-label.styles.d.ts +2 -0
- package/dist/components/menu-label/menu-label.styles.js +8 -0
- package/dist/components/mutation-observer/mutation-observer.d.ts +44 -0
- package/dist/components/mutation-observer/mutation-observer.js +11 -0
- package/dist/components/mutation-observer/mutation-observer.styles.d.ts +2 -0
- package/dist/components/mutation-observer/mutation-observer.styles.js +8 -0
- package/dist/components/option/option.d.ts +50 -0
- package/dist/components/option/option.js +20 -0
- package/dist/components/option/option.styles.d.ts +2 -0
- package/dist/components/option/option.styles.js +8 -0
- package/dist/components/popup/popup.d.ts +123 -0
- package/dist/components/popup/popup.js +10 -0
- package/dist/components/popup/popup.styles.d.ts +2 -0
- package/dist/components/popup/popup.styles.js +8 -0
- package/dist/components/progress-bar/progress-bar.d.ts +23 -0
- package/dist/components/progress-bar/progress-bar.js +11 -0
- package/dist/components/progress-bar/progress-bar.styles.d.ts +2 -0
- package/dist/components/progress-bar/progress-bar.styles.js +8 -0
- package/dist/components/progress-ring/progress-ring.d.ts +25 -0
- package/dist/components/progress-ring/progress-ring.js +11 -0
- package/dist/components/progress-ring/progress-ring.styles.d.ts +2 -0
- package/dist/components/progress-ring/progress-ring.styles.js +8 -0
- package/dist/components/radio/radio.d.ts +46 -0
- package/dist/components/radio/radio.js +19 -0
- package/dist/components/radio/radio.styles.d.ts +2 -0
- package/dist/components/radio/radio.styles.js +8 -0
- package/dist/components/radio-button/radio-button.d.ts +47 -0
- package/dist/components/radio-button/radio-button.js +13 -0
- package/dist/components/radio-button/radio-button.styles.d.ts +2 -0
- package/dist/components/radio-button/radio-button.styles.js +9 -0
- package/dist/components/radio-group/radio-group.d.ts +91 -0
- package/dist/components/radio-group/radio-group.js +16 -0
- package/dist/components/radio-group/radio-group.styles.d.ts +2 -0
- package/dist/components/radio-group/radio-group.styles.js +9 -0
- package/dist/components/relative-time/relative-time.d.ts +34 -0
- package/dist/components/relative-time/relative-time.js +9 -0
- package/dist/components/resize-observer/resize-observer.d.ts +31 -0
- package/dist/components/resize-observer/resize-observer.js +11 -0
- package/dist/components/resize-observer/resize-observer.styles.d.ts +2 -0
- package/dist/components/resize-observer/resize-observer.styles.js +8 -0
- package/dist/components/select/select.d.ts +166 -0
- package/dist/components/select/select.js +36 -0
- package/dist/components/select/select.styles.d.ts +2 -0
- package/dist/components/select/select.styles.js +9 -0
- package/dist/components/skeleton/skeleton.d.ts +21 -0
- package/dist/components/skeleton/skeleton.js +10 -0
- package/dist/components/skeleton/skeleton.styles.d.ts +2 -0
- package/dist/components/skeleton/skeleton.styles.js +8 -0
- package/dist/components/spinner/spinner.d.ts +21 -0
- package/dist/components/spinner/spinner.js +11 -0
- package/dist/components/spinner/spinner.styles.d.ts +2 -0
- package/dist/components/spinner/spinner.styles.js +8 -0
- package/dist/components/tab/tab.d.ts +44 -0
- package/dist/components/tab/tab.js +12 -0
- package/dist/components/tab/tab.styles.d.ts +2 -0
- package/dist/components/tab/tab.styles.js +8 -0
- package/dist/components/tab-group/tab-group.d.ts +61 -0
- package/dist/components/tab-group/tab-group.js +13 -0
- package/dist/components/tab-group/tab-group.styles.d.ts +2 -0
- package/dist/components/tab-group/tab-group.styles.js +8 -0
- package/dist/components/tab-panel/tab-panel.d.ts +25 -0
- package/dist/components/tab-panel/tab-panel.js +11 -0
- package/dist/components/tab-panel/tab-panel.styles.d.ts +2 -0
- package/dist/components/tab-panel/tab-panel.styles.js +8 -0
- package/dist/components/tag/tag.d.ts +34 -0
- package/dist/components/tag/tag.js +22 -0
- package/dist/components/tag/tag.styles.d.ts +2 -0
- package/dist/components/tag/tag.styles.js +8 -0
- package/dist/components/textarea/textarea.d.ts +137 -0
- package/dist/components/textarea/textarea.js +17 -0
- package/dist/components/textarea/textarea.styles.d.ts +2 -0
- package/dist/components/textarea/textarea.styles.js +9 -0
- package/dist/components/tooltip/tooltip.d.ts +80 -0
- package/dist/components/tooltip/tooltip.js +17 -0
- package/dist/components/tooltip/tooltip.styles.d.ts +2 -0
- package/dist/components/tooltip/tooltip.styles.js +8 -0
- package/dist/components/tree/tree.d.ts +53 -0
- package/dist/components/tree/tree.js +33 -0
- package/dist/components/tree/tree.styles.d.ts +2 -0
- package/dist/components/tree/tree.styles.js +8 -0
- package/dist/components/tree-item/tree-item.d.ts +69 -0
- package/dist/components/tree-item/tree-item.js +31 -0
- package/dist/components/tree-item/tree-item.styles.d.ts +2 -0
- package/dist/components/tree-item/tree-item.styles.js +8 -0
- package/dist/components/visually-hidden/visually-hidden.d.ts +17 -0
- package/dist/components/visually-hidden/visually-hidden.js +10 -0
- package/dist/components/visually-hidden/visually-hidden.styles.d.ts +2 -0
- package/dist/components/visually-hidden/visually-hidden.styles.js +8 -0
- package/dist/custom-elements.json +14628 -0
- package/dist/design-system-autoloader.d.ts +4 -0
- package/dist/design-system-autoloader.js +46 -0
- package/dist/design-system.d.ts +58 -0
- package/dist/design-system.js +309 -0
- package/dist/events/dsa-after-collapse.d.ts +7 -0
- package/dist/events/dsa-after-collapse.js +1 -0
- package/dist/events/dsa-after-expand.d.ts +7 -0
- package/dist/events/dsa-after-expand.js +1 -0
- package/dist/events/dsa-after-hide.d.ts +7 -0
- package/dist/events/dsa-after-hide.js +1 -0
- package/dist/events/dsa-after-show.d.ts +7 -0
- package/dist/events/dsa-after-show.js +1 -0
- package/dist/events/dsa-blur.d.ts +7 -0
- package/dist/events/dsa-blur.js +1 -0
- package/dist/events/dsa-cancel.d.ts +7 -0
- package/dist/events/dsa-cancel.js +1 -0
- package/dist/events/dsa-change.d.ts +7 -0
- package/dist/events/dsa-change.js +1 -0
- package/dist/events/dsa-clear.d.ts +7 -0
- package/dist/events/dsa-clear.js +1 -0
- package/dist/events/dsa-close.d.ts +7 -0
- package/dist/events/dsa-close.js +1 -0
- package/dist/events/dsa-collapse.d.ts +7 -0
- package/dist/events/dsa-collapse.js +1 -0
- package/dist/events/dsa-error.d.ts +9 -0
- package/dist/events/dsa-error.js +1 -0
- package/dist/events/dsa-expand.d.ts +7 -0
- package/dist/events/dsa-expand.js +1 -0
- package/dist/events/dsa-finish.d.ts +7 -0
- package/dist/events/dsa-finish.js +1 -0
- package/dist/events/dsa-focus.d.ts +7 -0
- package/dist/events/dsa-focus.js +1 -0
- package/dist/events/dsa-hide.d.ts +7 -0
- package/dist/events/dsa-hide.js +1 -0
- package/dist/events/dsa-hover.d.ts +10 -0
- package/dist/events/dsa-hover.js +1 -0
- package/dist/events/dsa-initial-focus.d.ts +7 -0
- package/dist/events/dsa-initial-focus.js +1 -0
- package/dist/events/dsa-input.d.ts +7 -0
- package/dist/events/dsa-input.js +1 -0
- package/dist/events/dsa-invalid.d.ts +7 -0
- package/dist/events/dsa-invalid.js +1 -0
- package/dist/events/dsa-lazy-change.d.ts +7 -0
- package/dist/events/dsa-lazy-change.js +1 -0
- package/dist/events/dsa-lazy-load.d.ts +7 -0
- package/dist/events/dsa-lazy-load.js +1 -0
- package/dist/events/dsa-load.d.ts +7 -0
- package/dist/events/dsa-load.js +1 -0
- package/dist/events/dsa-mutation.d.ts +9 -0
- package/dist/events/dsa-mutation.js +1 -0
- package/dist/events/dsa-remove.d.ts +7 -0
- package/dist/events/dsa-remove.js +1 -0
- package/dist/events/dsa-reposition.d.ts +7 -0
- package/dist/events/dsa-reposition.js +1 -0
- package/dist/events/dsa-request-close.d.ts +9 -0
- package/dist/events/dsa-request-close.js +1 -0
- package/dist/events/dsa-resize.d.ts +9 -0
- package/dist/events/dsa-resize.js +1 -0
- package/dist/events/dsa-select.d.ts +10 -0
- package/dist/events/dsa-select.js +1 -0
- package/dist/events/dsa-selection-change.d.ts +10 -0
- package/dist/events/dsa-selection-change.js +1 -0
- package/dist/events/dsa-show.d.ts +7 -0
- package/dist/events/dsa-show.js +1 -0
- package/dist/events/dsa-start.d.ts +7 -0
- package/dist/events/dsa-start.js +1 -0
- package/dist/events/dsa-tab-hide.d.ts +9 -0
- package/dist/events/dsa-tab-hide.js +1 -0
- package/dist/events/dsa-tab-show.d.ts +9 -0
- package/dist/events/dsa-tab-show.js +1 -0
- package/dist/events/events.d.ts +32 -0
- package/dist/events/events.js +1 -0
- package/dist/internal/animate.d.ts +22 -0
- package/dist/internal/animate.js +56 -0
- package/dist/internal/components/button-group/button-group.d.ts +34 -0
- package/dist/internal/components/button-group/button-group.js +110 -0
- package/dist/internal/components/button-group/button-group.styles.d.ts +2 -0
- package/dist/internal/components/button-group/button-group.styles.js +19 -0
- package/dist/internal/debounce.d.ts +1 -0
- package/dist/internal/debounce.js +26 -0
- package/dist/internal/default-value.d.ts +2 -0
- package/dist/internal/default-value.js +38 -0
- package/dist/internal/drag.d.ts +15 -0
- package/dist/internal/drag.js +27 -0
- package/dist/internal/event.d.ts +2 -0
- package/dist/internal/event.js +12 -0
- package/dist/internal/form.d.ts +73 -0
- package/dist/internal/form.js +328 -0
- package/dist/internal/math.d.ts +2 -0
- package/dist/internal/math.js +11 -0
- package/dist/internal/modal.d.ts +12 -0
- package/dist/internal/modal.js +51 -0
- package/dist/internal/offset.d.ts +11 -0
- package/dist/internal/offset.js +13 -0
- package/dist/internal/scroll.d.ts +11 -0
- package/dist/internal/scroll.js +63 -0
- package/dist/internal/shoelace-element.d.ts +43 -0
- package/dist/internal/shoelace-element.js +21 -0
- package/dist/internal/slot.d.ts +23 -0
- package/dist/internal/slot.js +84 -0
- package/dist/internal/string.d.ts +2 -0
- package/dist/internal/string.js +4 -0
- package/dist/internal/tabbable.d.ts +8 -0
- package/dist/internal/tabbable.js +79 -0
- package/dist/internal/test/data-testid-helpers.d.ts +12 -0
- package/dist/internal/test/data-testid-helpers.js +14 -0
- package/dist/internal/test/element-visible-overflow.d.ts +11 -0
- package/dist/internal/test/element-visible-overflow.js +18 -0
- package/dist/internal/test/form-control-base-tests.d.ts +7 -0
- package/dist/internal/test/form-control-base-tests.js +262 -0
- package/dist/internal/test/wait-for-scrolling.d.ts +9 -0
- package/dist/internal/test/wait-for-scrolling.js +34 -0
- package/dist/internal/test.d.ts +20 -0
- package/dist/internal/test.js +71 -0
- package/dist/internal/watch.d.ts +26 -0
- package/dist/internal/watch.js +38 -0
- package/dist/styles/component.styles.d.ts +2 -0
- package/dist/styles/component.styles.js +16 -0
- package/dist/styles/form-control.styles.d.ts +2 -0
- package/dist/styles/form-control.styles.js +142 -0
- package/dist/themes/dsa-wc-theme.css +1218 -0
- package/dist/themes/dsa-wc-theme.min.css +1 -0
- package/dist/themes/dsa-wc-theme.styles.js +1229 -0
- package/dist/translations/en-gb.d.ts +3 -0
- package/dist/translations/en-gb.js +21 -0
- package/dist/translations/en.d.ts +3 -0
- package/dist/translations/en.js +7 -0
- package/dist/translations/fr.d.ts +3 -0
- package/dist/translations/fr.js +7 -0
- package/dist/utilities/animation-registry.d.ts +24 -0
- package/dist/utilities/animation-registry.js +11 -0
- package/dist/utilities/animation.d.ts +1 -0
- package/dist/utilities/animation.js +10 -0
- package/dist/utilities/base-path.d.ts +18 -0
- package/dist/utilities/base-path.js +9 -0
- package/dist/utilities/form.d.ts +11 -0
- package/dist/utilities/form.js +43 -0
- package/dist/utilities/icon-library.d.ts +1 -0
- package/dist/utilities/icon-library.js +13 -0
- package/dist/utilities/localize.d.ts +39 -0
- package/dist/utilities/localize.js +9 -0
- package/dist/utilities/storybook.d.ts +46 -0
- package/dist/utilities/storybook.js +54 -0
- package/dist/vscode.html-custom-data.json +2392 -0
- package/dist/web-types.json +8687 -0
- package/package.json +109 -0
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import {
|
|
2
|
+
radio_styles_default
|
|
3
|
+
} from "./chunk.VFYKLPN2.js";
|
|
4
|
+
import {
|
|
5
|
+
watch
|
|
6
|
+
} from "./chunk.D7CATJYB.js";
|
|
7
|
+
import {
|
|
8
|
+
ShoelaceElement
|
|
9
|
+
} from "./chunk.YCXTCVAZ.js";
|
|
10
|
+
import {
|
|
11
|
+
__decorateClass
|
|
12
|
+
} from "./chunk.6M63UXML.js";
|
|
13
|
+
|
|
14
|
+
// src/components/radio/radio.ts
|
|
15
|
+
import { html } from "lit";
|
|
16
|
+
import { customElement, property, state } from "lit/decorators.js";
|
|
17
|
+
import { classMap } from "lit/directives/class-map.js";
|
|
18
|
+
var DSARadio = class extends ShoelaceElement {
|
|
19
|
+
constructor() {
|
|
20
|
+
super(...arguments);
|
|
21
|
+
this.checked = false;
|
|
22
|
+
this.hasFocus = false;
|
|
23
|
+
this.size = "medium";
|
|
24
|
+
this.disabled = false;
|
|
25
|
+
this.error = false;
|
|
26
|
+
}
|
|
27
|
+
connectedCallback() {
|
|
28
|
+
super.connectedCallback();
|
|
29
|
+
this.handleBlur = this.handleBlur.bind(this);
|
|
30
|
+
this.handleClick = this.handleClick.bind(this);
|
|
31
|
+
this.handleFocus = this.handleFocus.bind(this);
|
|
32
|
+
this.setInitialAttributes();
|
|
33
|
+
this.addEventListeners();
|
|
34
|
+
}
|
|
35
|
+
disconnectedCallback() {
|
|
36
|
+
this.removeEventListeners();
|
|
37
|
+
}
|
|
38
|
+
addEventListeners() {
|
|
39
|
+
this.addEventListener("blur", this.handleBlur);
|
|
40
|
+
this.addEventListener("click", this.handleClick);
|
|
41
|
+
this.addEventListener("focus", this.handleFocus);
|
|
42
|
+
}
|
|
43
|
+
removeEventListeners() {
|
|
44
|
+
this.removeEventListener("blur", this.handleBlur);
|
|
45
|
+
this.removeEventListener("click", this.handleClick);
|
|
46
|
+
this.removeEventListener("focus", this.handleFocus);
|
|
47
|
+
}
|
|
48
|
+
handleBlur() {
|
|
49
|
+
this.hasFocus = false;
|
|
50
|
+
this.emit("dsa-blur");
|
|
51
|
+
}
|
|
52
|
+
handleClick() {
|
|
53
|
+
if (!this.disabled) {
|
|
54
|
+
this.checked = true;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
handleFocus() {
|
|
58
|
+
this.hasFocus = true;
|
|
59
|
+
this.emit("dsa-focus");
|
|
60
|
+
}
|
|
61
|
+
setInitialAttributes() {
|
|
62
|
+
this.setAttribute("role", "radio");
|
|
63
|
+
this.setAttribute("aria-disabled", this.disabled ? "true" : "false");
|
|
64
|
+
}
|
|
65
|
+
handleCheckedChange() {
|
|
66
|
+
this.setAttribute("aria-checked", this.checked ? "true" : "false");
|
|
67
|
+
}
|
|
68
|
+
handleDisabledChange() {
|
|
69
|
+
this.setAttribute("aria-disabled", this.disabled ? "true" : "false");
|
|
70
|
+
}
|
|
71
|
+
handleErrorChange() {
|
|
72
|
+
if (this.error) {
|
|
73
|
+
this.setAttribute("aria-invalid", "true");
|
|
74
|
+
} else {
|
|
75
|
+
this.removeAttribute("aria-invalid");
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
render() {
|
|
79
|
+
return html`
|
|
80
|
+
<span
|
|
81
|
+
part="base"
|
|
82
|
+
class=${classMap({
|
|
83
|
+
radio: true,
|
|
84
|
+
"radio--checked": this.checked,
|
|
85
|
+
"radio--disabled": this.disabled,
|
|
86
|
+
"radio--focused": this.hasFocus,
|
|
87
|
+
"radio--small": this.size === "small",
|
|
88
|
+
"radio--medium": this.size === "medium",
|
|
89
|
+
"radio--large": this.size === "large"
|
|
90
|
+
})}
|
|
91
|
+
>
|
|
92
|
+
<span
|
|
93
|
+
part="${`control${this.checked ? " control--checked" : ""}`}"
|
|
94
|
+
class="radio__control"
|
|
95
|
+
>
|
|
96
|
+
${this.checked ? html`
|
|
97
|
+
<dsa-icon
|
|
98
|
+
part="checked-icon"
|
|
99
|
+
class="radio__checked-icon"
|
|
100
|
+
name="circle_filled"
|
|
101
|
+
></dsa-icon>
|
|
102
|
+
` : ""}
|
|
103
|
+
</span>
|
|
104
|
+
|
|
105
|
+
<slot
|
|
106
|
+
part="label"
|
|
107
|
+
class=${classMap({
|
|
108
|
+
radio__label: true,
|
|
109
|
+
"radio__label--error": this.error
|
|
110
|
+
})}
|
|
111
|
+
></slot>
|
|
112
|
+
</span>
|
|
113
|
+
`;
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
DSARadio.styles = radio_styles_default;
|
|
117
|
+
__decorateClass([
|
|
118
|
+
state()
|
|
119
|
+
], DSARadio.prototype, "checked", 2);
|
|
120
|
+
__decorateClass([
|
|
121
|
+
state()
|
|
122
|
+
], DSARadio.prototype, "hasFocus", 2);
|
|
123
|
+
__decorateClass([
|
|
124
|
+
property()
|
|
125
|
+
], DSARadio.prototype, "value", 2);
|
|
126
|
+
__decorateClass([
|
|
127
|
+
property({ reflect: true })
|
|
128
|
+
], DSARadio.prototype, "size", 2);
|
|
129
|
+
__decorateClass([
|
|
130
|
+
property({ type: Boolean, reflect: true })
|
|
131
|
+
], DSARadio.prototype, "disabled", 2);
|
|
132
|
+
__decorateClass([
|
|
133
|
+
property({ type: Boolean })
|
|
134
|
+
], DSARadio.prototype, "error", 2);
|
|
135
|
+
__decorateClass([
|
|
136
|
+
watch("checked")
|
|
137
|
+
], DSARadio.prototype, "handleCheckedChange", 1);
|
|
138
|
+
__decorateClass([
|
|
139
|
+
watch("disabled", { waitUntilFirstUpdate: true })
|
|
140
|
+
], DSARadio.prototype, "handleDisabledChange", 1);
|
|
141
|
+
__decorateClass([
|
|
142
|
+
watch("error")
|
|
143
|
+
], DSARadio.prototype, "handleErrorChange", 1);
|
|
144
|
+
DSARadio = __decorateClass([
|
|
145
|
+
customElement("dsa-radio")
|
|
146
|
+
], DSARadio);
|
|
147
|
+
|
|
148
|
+
export {
|
|
149
|
+
DSARadio
|
|
150
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {
|
|
2
|
+
form_control_styles_default
|
|
3
|
+
} from "./chunk.3RBCYA4F.js";
|
|
4
|
+
import {
|
|
5
|
+
component_styles_default
|
|
6
|
+
} from "./chunk.TUVJKY7S.js";
|
|
7
|
+
|
|
8
|
+
// src/components/radio-group/radio-group.styles.ts
|
|
9
|
+
import { css } from "lit";
|
|
10
|
+
var radio_group_styles_default = css`
|
|
11
|
+
${component_styles_default}
|
|
12
|
+
${form_control_styles_default}
|
|
13
|
+
|
|
14
|
+
:host {
|
|
15
|
+
display: block;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.visually-hidden {
|
|
19
|
+
position: absolute;
|
|
20
|
+
width: 1px;
|
|
21
|
+
height: 1px;
|
|
22
|
+
padding: 0;
|
|
23
|
+
margin: -1px;
|
|
24
|
+
overflow: hidden;
|
|
25
|
+
clip: rect(0, 0, 0, 0);
|
|
26
|
+
white-space: nowrap;
|
|
27
|
+
border: 0;
|
|
28
|
+
}
|
|
29
|
+
`;
|
|
30
|
+
|
|
31
|
+
export {
|
|
32
|
+
radio_group_styles_default
|
|
33
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import {
|
|
2
|
+
spinner_styles_default
|
|
3
|
+
} from "./chunk.S4ATPBQN.js";
|
|
4
|
+
import {
|
|
5
|
+
LocalizeController
|
|
6
|
+
} from "./chunk.5XL2LZLC.js";
|
|
7
|
+
import {
|
|
8
|
+
ShoelaceElement
|
|
9
|
+
} from "./chunk.YCXTCVAZ.js";
|
|
10
|
+
import {
|
|
11
|
+
__decorateClass
|
|
12
|
+
} from "./chunk.6M63UXML.js";
|
|
13
|
+
|
|
14
|
+
// src/components/spinner/spinner.ts
|
|
15
|
+
import { html } from "lit";
|
|
16
|
+
import { customElement, property } from "lit/decorators.js";
|
|
17
|
+
import { classMap } from "lit/directives/class-map.js";
|
|
18
|
+
var DSASpinner = class extends ShoelaceElement {
|
|
19
|
+
constructor() {
|
|
20
|
+
super(...arguments);
|
|
21
|
+
this.localize = new LocalizeController(this);
|
|
22
|
+
this.variant = "base";
|
|
23
|
+
}
|
|
24
|
+
render() {
|
|
25
|
+
return html`
|
|
26
|
+
<svg
|
|
27
|
+
part="base"
|
|
28
|
+
class=${classMap({
|
|
29
|
+
spinner: true,
|
|
30
|
+
"spinner--on-base": this.variant === "base",
|
|
31
|
+
"spinner--on-floating": this.variant === "floating"
|
|
32
|
+
})}
|
|
33
|
+
role="progressbar"
|
|
34
|
+
aria-valuetext=${this.localize.term("loading")}
|
|
35
|
+
>
|
|
36
|
+
<circle class="spinner__track"></circle>
|
|
37
|
+
<circle class="spinner__indicator"></circle>
|
|
38
|
+
</svg>
|
|
39
|
+
`;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
DSASpinner.styles = spinner_styles_default;
|
|
43
|
+
__decorateClass([
|
|
44
|
+
property({ reflect: true })
|
|
45
|
+
], DSASpinner.prototype, "variant", 2);
|
|
46
|
+
DSASpinner = __decorateClass([
|
|
47
|
+
customElement("dsa-spinner")
|
|
48
|
+
], DSASpinner);
|
|
49
|
+
|
|
50
|
+
export {
|
|
51
|
+
DSASpinner
|
|
52
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// src/components/input/input.utils.ts
|
|
2
|
+
function isPrefixIconOverriden(type) {
|
|
3
|
+
return ["email", "password", "search"].includes(type);
|
|
4
|
+
}
|
|
5
|
+
var values = {
|
|
6
|
+
email: { iconName: "email", partName: "email-icon", ariaLabel: "email" },
|
|
7
|
+
password: {
|
|
8
|
+
iconName: "lock",
|
|
9
|
+
partName: "password-lock-icon",
|
|
10
|
+
ariaLabel: "password-lock"
|
|
11
|
+
},
|
|
12
|
+
search: {
|
|
13
|
+
iconName: "search",
|
|
14
|
+
partName: "search-icon",
|
|
15
|
+
ariaLabel: "search"
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
function getOverridenIconDetails(type) {
|
|
19
|
+
return values[type];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export {
|
|
23
|
+
isPrefixIconOverriden,
|
|
24
|
+
getOverridenIconDetails
|
|
25
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import {
|
|
2
|
+
LocalizeController
|
|
3
|
+
} from "./chunk.5XL2LZLC.js";
|
|
4
|
+
import {
|
|
5
|
+
ShoelaceElement
|
|
6
|
+
} from "./chunk.YCXTCVAZ.js";
|
|
7
|
+
import {
|
|
8
|
+
__decorateClass
|
|
9
|
+
} from "./chunk.6M63UXML.js";
|
|
10
|
+
|
|
11
|
+
// src/components/format-bytes/format-bytes.ts
|
|
12
|
+
import { customElement, property } from "lit/decorators.js";
|
|
13
|
+
var DSAFormatBytes = class extends ShoelaceElement {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.localize = new LocalizeController(this);
|
|
17
|
+
this.value = 0;
|
|
18
|
+
this.unit = "byte";
|
|
19
|
+
this.display = "short";
|
|
20
|
+
}
|
|
21
|
+
render() {
|
|
22
|
+
if (isNaN(this.value)) {
|
|
23
|
+
return "";
|
|
24
|
+
}
|
|
25
|
+
const bitPrefixes = ["", "kilo", "mega", "giga", "tera"];
|
|
26
|
+
const bytePrefixes = ["", "kilo", "mega", "giga", "tera", "peta"];
|
|
27
|
+
const prefix = this.unit === "bit" ? bitPrefixes : bytePrefixes;
|
|
28
|
+
const index = Math.max(
|
|
29
|
+
0,
|
|
30
|
+
Math.min(Math.floor(Math.log10(this.value) / 3), prefix.length - 1)
|
|
31
|
+
);
|
|
32
|
+
const unit = prefix[index] + this.unit;
|
|
33
|
+
const valueToFormat = parseFloat(
|
|
34
|
+
(this.value / Math.pow(1e3, index)).toPrecision(3)
|
|
35
|
+
);
|
|
36
|
+
return this.localize.number(valueToFormat, {
|
|
37
|
+
style: "unit",
|
|
38
|
+
unit,
|
|
39
|
+
unitDisplay: this.display
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
__decorateClass([
|
|
44
|
+
property({ type: Number })
|
|
45
|
+
], DSAFormatBytes.prototype, "value", 2);
|
|
46
|
+
__decorateClass([
|
|
47
|
+
property()
|
|
48
|
+
], DSAFormatBytes.prototype, "unit", 2);
|
|
49
|
+
__decorateClass([
|
|
50
|
+
property()
|
|
51
|
+
], DSAFormatBytes.prototype, "display", 2);
|
|
52
|
+
DSAFormatBytes = __decorateClass([
|
|
53
|
+
customElement("dsa-format-bytes")
|
|
54
|
+
], DSAFormatBytes);
|
|
55
|
+
|
|
56
|
+
export {
|
|
57
|
+
DSAFormatBytes
|
|
58
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {
|
|
2
|
+
avatar_group_styles_default
|
|
3
|
+
} from "./chunk.XWUQFDIN.js";
|
|
4
|
+
import {
|
|
5
|
+
ShoelaceElement
|
|
6
|
+
} from "./chunk.YCXTCVAZ.js";
|
|
7
|
+
import {
|
|
8
|
+
__decorateClass
|
|
9
|
+
} from "./chunk.6M63UXML.js";
|
|
10
|
+
|
|
11
|
+
// src/components/avatar-group/avatar-group.ts
|
|
12
|
+
import { html } from "lit";
|
|
13
|
+
import { customElement, query } from "lit/decorators.js";
|
|
14
|
+
var DSAAvatarGroup = class extends ShoelaceElement {
|
|
15
|
+
render() {
|
|
16
|
+
return html`
|
|
17
|
+
<div part="base" class="avatar-group" role="group">
|
|
18
|
+
<slot></slot>
|
|
19
|
+
</div>
|
|
20
|
+
`;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
DSAAvatarGroup.styles = avatar_group_styles_default;
|
|
24
|
+
__decorateClass([
|
|
25
|
+
query("slot")
|
|
26
|
+
], DSAAvatarGroup.prototype, "defaultSlot", 2);
|
|
27
|
+
DSAAvatarGroup = __decorateClass([
|
|
28
|
+
customElement("dsa-avatar-group")
|
|
29
|
+
], DSAAvatarGroup);
|
|
30
|
+
|
|
31
|
+
export {
|
|
32
|
+
DSAAvatarGroup
|
|
33
|
+
};
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__spreadProps,
|
|
3
|
+
__spreadValues
|
|
4
|
+
} from "./chunk.6M63UXML.js";
|
|
5
|
+
|
|
6
|
+
// src/internal/form.ts
|
|
7
|
+
var formCollections = /* @__PURE__ */ new WeakMap();
|
|
8
|
+
var reportValidityOverloads = /* @__PURE__ */ new WeakMap();
|
|
9
|
+
var userInteractedControls = /* @__PURE__ */ new WeakSet();
|
|
10
|
+
var interactions = /* @__PURE__ */ new WeakMap();
|
|
11
|
+
var FormControlController = class {
|
|
12
|
+
constructor(host, options) {
|
|
13
|
+
(this.host = host).addController(this);
|
|
14
|
+
this.options = __spreadValues({
|
|
15
|
+
form: (input) => {
|
|
16
|
+
if (input.hasAttribute("form") && input.getAttribute("form") !== "") {
|
|
17
|
+
const root = input.getRootNode();
|
|
18
|
+
const formId = input.getAttribute("form");
|
|
19
|
+
if (formId) {
|
|
20
|
+
return root.getElementById(formId);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return input.closest("form");
|
|
24
|
+
},
|
|
25
|
+
name: (input) => input.name,
|
|
26
|
+
value: (input) => input.value,
|
|
27
|
+
defaultValue: (input) => input.defaultValue,
|
|
28
|
+
disabled: (input) => {
|
|
29
|
+
var _a;
|
|
30
|
+
return (_a = input.disabled) != null ? _a : false;
|
|
31
|
+
},
|
|
32
|
+
reportValidity: (input) => typeof input.reportValidity === "function" ? input.reportValidity() : true,
|
|
33
|
+
// TODO: Decide if using unknown here is a good decision
|
|
34
|
+
setValue: (input, value) => input.value = value,
|
|
35
|
+
assumeInteractionOn: ["dsa-input"]
|
|
36
|
+
}, options);
|
|
37
|
+
this.handleFormData = this.handleFormData.bind(this);
|
|
38
|
+
this.handleFormSubmit = this.handleFormSubmit.bind(this);
|
|
39
|
+
this.handleFormReset = this.handleFormReset.bind(this);
|
|
40
|
+
this.reportFormValidity = this.reportFormValidity.bind(this);
|
|
41
|
+
this.handleInteraction = this.handleInteraction.bind(this);
|
|
42
|
+
}
|
|
43
|
+
hostConnected() {
|
|
44
|
+
const form = this.options.form(this.host);
|
|
45
|
+
if (form) {
|
|
46
|
+
this.attachForm(form);
|
|
47
|
+
}
|
|
48
|
+
interactions.set(this.host, []);
|
|
49
|
+
this.options.assumeInteractionOn.forEach((event) => {
|
|
50
|
+
this.host.addEventListener(event, this.handleInteraction);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
hostDisconnected() {
|
|
54
|
+
this.detachForm();
|
|
55
|
+
interactions.delete(this.host);
|
|
56
|
+
this.options.assumeInteractionOn.forEach((event) => {
|
|
57
|
+
this.host.removeEventListener(event, this.handleInteraction);
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
hostUpdated() {
|
|
61
|
+
const form = this.options.form(this.host);
|
|
62
|
+
if (!form) {
|
|
63
|
+
this.detachForm();
|
|
64
|
+
}
|
|
65
|
+
if (form && this.form !== form) {
|
|
66
|
+
this.detachForm();
|
|
67
|
+
this.attachForm(form);
|
|
68
|
+
}
|
|
69
|
+
if (this.host.hasUpdated) {
|
|
70
|
+
this.setValidity(this.host.validity.valid);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
attachForm(form) {
|
|
74
|
+
if (form) {
|
|
75
|
+
this.form = form;
|
|
76
|
+
if (formCollections.has(this.form)) {
|
|
77
|
+
formCollections.get(this.form).add(this.host);
|
|
78
|
+
} else {
|
|
79
|
+
formCollections.set(
|
|
80
|
+
this.form,
|
|
81
|
+
/* @__PURE__ */ new Set([this.host])
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
this.form.addEventListener("formdata", this.handleFormData);
|
|
85
|
+
this.form.addEventListener("submit", this.handleFormSubmit);
|
|
86
|
+
this.form.addEventListener("reset", this.handleFormReset);
|
|
87
|
+
if (!reportValidityOverloads.has(this.form)) {
|
|
88
|
+
reportValidityOverloads.set(this.form, this.form.reportValidity);
|
|
89
|
+
this.form.reportValidity = () => this.reportFormValidity();
|
|
90
|
+
}
|
|
91
|
+
} else {
|
|
92
|
+
this.form = void 0;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
detachForm() {
|
|
96
|
+
var _a;
|
|
97
|
+
if (this.form) {
|
|
98
|
+
(_a = formCollections.get(this.form)) == null ? void 0 : _a.delete(this.host);
|
|
99
|
+
this.form.removeEventListener("formdata", this.handleFormData);
|
|
100
|
+
this.form.removeEventListener("submit", this.handleFormSubmit);
|
|
101
|
+
this.form.removeEventListener("reset", this.handleFormReset);
|
|
102
|
+
if (reportValidityOverloads.has(this.form)) {
|
|
103
|
+
this.form.reportValidity = reportValidityOverloads.get(this.form);
|
|
104
|
+
reportValidityOverloads.delete(this.form);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
this.form = void 0;
|
|
108
|
+
}
|
|
109
|
+
handleFormData(event) {
|
|
110
|
+
const disabled = this.options.disabled(this.host);
|
|
111
|
+
const name = this.options.name(this.host);
|
|
112
|
+
const value = this.options.value(this.host);
|
|
113
|
+
const isButton = this.host.tagName.toLowerCase() === "dsa-button";
|
|
114
|
+
if (!disabled && !isButton && typeof name === "string" && name.length > 0 && typeof value !== "undefined") {
|
|
115
|
+
if (Array.isArray(value)) {
|
|
116
|
+
value.forEach((val) => {
|
|
117
|
+
event.formData.append(
|
|
118
|
+
name,
|
|
119
|
+
val.toString()
|
|
120
|
+
);
|
|
121
|
+
});
|
|
122
|
+
} else {
|
|
123
|
+
event.formData.append(
|
|
124
|
+
name,
|
|
125
|
+
value.toString()
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
handleFormSubmit(event) {
|
|
131
|
+
var _a;
|
|
132
|
+
const disabled = this.options.disabled(this.host);
|
|
133
|
+
const reportValidity = this.options.reportValidity;
|
|
134
|
+
if (this.form && !this.form.noValidate) {
|
|
135
|
+
(_a = formCollections.get(this.form)) == null ? void 0 : _a.forEach((control) => {
|
|
136
|
+
this.setUserInteracted(control, true);
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
if (this.form && !this.form.noValidate && !disabled && !reportValidity(this.host)) {
|
|
140
|
+
event.preventDefault();
|
|
141
|
+
event.stopImmediatePropagation();
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
handleFormReset() {
|
|
145
|
+
this.options.setValue(this.host, this.options.defaultValue(this.host));
|
|
146
|
+
this.setUserInteracted(this.host, false);
|
|
147
|
+
interactions.set(this.host, []);
|
|
148
|
+
}
|
|
149
|
+
handleInteraction(event) {
|
|
150
|
+
const emittedEvents = interactions.get(this.host);
|
|
151
|
+
if (!emittedEvents.includes(event.type)) {
|
|
152
|
+
emittedEvents.push(event.type);
|
|
153
|
+
}
|
|
154
|
+
if (emittedEvents.length === this.options.assumeInteractionOn.length) {
|
|
155
|
+
this.setUserInteracted(this.host, true);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
reportFormValidity() {
|
|
159
|
+
if (this.form && !this.form.noValidate) {
|
|
160
|
+
const elements = this.form.querySelectorAll("*");
|
|
161
|
+
for (const element of elements) {
|
|
162
|
+
if (typeof element.reportValidity === "function") {
|
|
163
|
+
if (!element.reportValidity()) {
|
|
164
|
+
return false;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
return true;
|
|
170
|
+
}
|
|
171
|
+
setUserInteracted(el, hasInteracted) {
|
|
172
|
+
if (hasInteracted) {
|
|
173
|
+
userInteractedControls.add(el);
|
|
174
|
+
} else {
|
|
175
|
+
userInteractedControls.delete(el);
|
|
176
|
+
}
|
|
177
|
+
el.requestUpdate();
|
|
178
|
+
}
|
|
179
|
+
doAction(type, submitter) {
|
|
180
|
+
if (this.form) {
|
|
181
|
+
const button = document.createElement("button");
|
|
182
|
+
button.type = type;
|
|
183
|
+
button.style.position = "absolute";
|
|
184
|
+
button.style.width = "0";
|
|
185
|
+
button.style.height = "0";
|
|
186
|
+
button.style.clipPath = "inset(50%)";
|
|
187
|
+
button.style.overflow = "hidden";
|
|
188
|
+
button.style.whiteSpace = "nowrap";
|
|
189
|
+
if (submitter) {
|
|
190
|
+
button.name = submitter.name;
|
|
191
|
+
button.value = submitter.value;
|
|
192
|
+
[
|
|
193
|
+
"formaction",
|
|
194
|
+
"formenctype",
|
|
195
|
+
"formmethod",
|
|
196
|
+
"formnovalidate",
|
|
197
|
+
"formtarget"
|
|
198
|
+
].forEach((attr) => {
|
|
199
|
+
if (submitter.hasAttribute(attr)) {
|
|
200
|
+
button.setAttribute(attr, submitter.getAttribute(attr));
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
this.form.append(button);
|
|
205
|
+
button.click();
|
|
206
|
+
button.remove();
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
/** Returns the associated `<form>` element, if one exists. */
|
|
210
|
+
getForm() {
|
|
211
|
+
var _a;
|
|
212
|
+
return (_a = this.form) != null ? _a : null;
|
|
213
|
+
}
|
|
214
|
+
/** Resets the form, restoring all the control to their default value */
|
|
215
|
+
reset(submitter) {
|
|
216
|
+
this.doAction("reset", submitter);
|
|
217
|
+
}
|
|
218
|
+
/** Submits the form, triggering validation and form data injection. */
|
|
219
|
+
submit(submitter) {
|
|
220
|
+
this.doAction("submit", submitter);
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Synchronously sets the form control's validity. Call this when you know the future validity but need to update
|
|
224
|
+
* the host element immediately, i.e. before Lit updates the component in the next update.
|
|
225
|
+
*/
|
|
226
|
+
setValidity(isValid) {
|
|
227
|
+
const host = this.host;
|
|
228
|
+
const hasInteracted = Boolean(userInteractedControls.has(host));
|
|
229
|
+
const required = Boolean(host.required);
|
|
230
|
+
host.toggleAttribute("data-required", required);
|
|
231
|
+
host.toggleAttribute("data-optional", !required);
|
|
232
|
+
host.toggleAttribute("data-invalid", !isValid);
|
|
233
|
+
host.toggleAttribute("data-valid", isValid);
|
|
234
|
+
host.toggleAttribute("data-user-invalid", !isValid && hasInteracted);
|
|
235
|
+
host.toggleAttribute("data-user-valid", isValid && hasInteracted);
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Updates the form control's validity based on the current value of `host.validity.valid`. Call this when anything
|
|
239
|
+
* that affects constraint validation changes so the component receives the correct validity states.
|
|
240
|
+
*/
|
|
241
|
+
updateValidity() {
|
|
242
|
+
const host = this.host;
|
|
243
|
+
this.setValidity(host.validity.valid);
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Dispatches a non-bubbling, cancelable custom event of type `dsa-invalid`.
|
|
247
|
+
* If the `dsa-invalid` event will be cancelled then the original `invalid`
|
|
248
|
+
* event (which may have been passed as argument) will also be cancelled.
|
|
249
|
+
* If no original `invalid` event has been passed then the `dsa-invalid`
|
|
250
|
+
* event will be cancelled before being dispatched.
|
|
251
|
+
*/
|
|
252
|
+
emitInvalidEvent(originalInvalidEvent) {
|
|
253
|
+
const slInvalidEvent = new CustomEvent(
|
|
254
|
+
"dsa-invalid",
|
|
255
|
+
{
|
|
256
|
+
bubbles: false,
|
|
257
|
+
composed: false,
|
|
258
|
+
cancelable: true,
|
|
259
|
+
detail: {}
|
|
260
|
+
}
|
|
261
|
+
);
|
|
262
|
+
if (!originalInvalidEvent) {
|
|
263
|
+
slInvalidEvent.preventDefault();
|
|
264
|
+
}
|
|
265
|
+
if (!this.host.dispatchEvent(slInvalidEvent)) {
|
|
266
|
+
originalInvalidEvent == null ? void 0 : originalInvalidEvent.preventDefault();
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
var validValidityState = Object.freeze({
|
|
271
|
+
badInput: false,
|
|
272
|
+
customError: false,
|
|
273
|
+
patternMismatch: false,
|
|
274
|
+
rangeOverflow: false,
|
|
275
|
+
rangeUnderflow: false,
|
|
276
|
+
stepMismatch: false,
|
|
277
|
+
tooLong: false,
|
|
278
|
+
tooShort: false,
|
|
279
|
+
typeMismatch: false,
|
|
280
|
+
valid: true,
|
|
281
|
+
valueMissing: false
|
|
282
|
+
});
|
|
283
|
+
var valueMissingValidityState = Object.freeze(__spreadProps(__spreadValues({}, validValidityState), {
|
|
284
|
+
valid: false,
|
|
285
|
+
valueMissing: true
|
|
286
|
+
}));
|
|
287
|
+
var customErrorValidityState = Object.freeze(__spreadProps(__spreadValues({}, validValidityState), {
|
|
288
|
+
valid: false,
|
|
289
|
+
customError: true
|
|
290
|
+
}));
|
|
291
|
+
|
|
292
|
+
export {
|
|
293
|
+
formCollections,
|
|
294
|
+
FormControlController,
|
|
295
|
+
validValidityState,
|
|
296
|
+
valueMissingValidityState,
|
|
297
|
+
customErrorValidityState
|
|
298
|
+
};
|