@synergy-design-system/components 1.14.0 → 1.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{chunk.525LGYB4.js → chunk.2URWP5LD.js} +10 -4
- package/dist/chunks/chunk.2URWP5LD.js.map +7 -0
- package/dist/chunks/{chunk.DXL3JN6D.js → chunk.3EONOQ2P.js} +2 -2
- package/dist/chunks/{chunk.COFVSXEF.js → chunk.3M6IVPMZ.js} +6 -6
- package/dist/chunks/{chunk.YRMXDJFM.js → chunk.4MBMY5UE.js} +2 -2
- package/dist/chunks/{chunk.GDHER3FZ.js → chunk.4RMP4EST.js} +2 -2
- package/dist/chunks/{chunk.UEQDHG7J.js → chunk.5I7DR4UT.js} +2 -2
- package/dist/chunks/{chunk.MEDX62IL.js → chunk.5OV7FNMN.js} +3 -3
- package/dist/chunks/{chunk.7UVCYUNR.js → chunk.66MOXMDP.js} +2 -2
- package/dist/chunks/{chunk.QQB6JCQY.js → chunk.6V72DOSV.js} +16 -17
- package/dist/chunks/chunk.6V72DOSV.js.map +7 -0
- package/dist/chunks/chunk.74N5WLM5.js +53 -0
- package/dist/chunks/chunk.74N5WLM5.js.map +7 -0
- package/dist/chunks/{chunk.A6S4OYWD.js → chunk.7NH6SYGG.js} +21 -17
- package/dist/chunks/chunk.7NH6SYGG.js.map +7 -0
- package/dist/chunks/{chunk.VSEAHAW7.js → chunk.7PYQKCMR.js} +3 -3
- package/dist/chunks/{chunk.B57ZVQ2Q.js → chunk.ABSGP4AA.js} +2 -2
- package/dist/chunks/{chunk.JDXKGJ63.js → chunk.AOKNP4QD.js} +42 -2
- package/dist/chunks/{chunk.JDXKGJ63.js.map → chunk.AOKNP4QD.js.map} +2 -2
- package/dist/chunks/{chunk.4QS5IWYB.js → chunk.AW2HNLNP.js} +1 -9
- package/dist/chunks/{chunk.4QS5IWYB.js.map → chunk.AW2HNLNP.js.map} +2 -2
- package/dist/chunks/{chunk.PAK472WN.js → chunk.BKRTJVKH.js} +2 -2
- package/dist/chunks/{chunk.QFMUPETV.js → chunk.BQ3U6CVQ.js} +3 -3
- package/dist/chunks/{chunk.H33SDUY3.js → chunk.CCITL3IY.js} +14 -11
- package/dist/chunks/chunk.CCITL3IY.js.map +7 -0
- package/dist/chunks/{chunk.SRZMRKLQ.js → chunk.CNKXQN5I.js} +4 -4
- package/dist/chunks/{chunk.PSTO5STZ.js → chunk.CXLJMDBV.js} +2 -2
- package/dist/chunks/{chunk.4MRXASVT.js → chunk.D63XRN3X.js} +2 -2
- package/dist/chunks/{chunk.2NRG7KJT.js → chunk.E3MWAHV4.js} +2 -2
- package/dist/chunks/{chunk.EZE5M5XB.js → chunk.EHMIJIZ2.js} +2 -2
- package/dist/chunks/{chunk.2SLHEFOH.js → chunk.ENAW6YL5.js} +7 -7
- package/dist/chunks/chunk.EQ2W2Z5B.js +12 -0
- package/dist/chunks/chunk.EQ2W2Z5B.js.map +7 -0
- package/dist/chunks/{chunk.KUO3KJOC.js → chunk.GBARDV25.js} +2 -2
- package/dist/chunks/{chunk.RK7OBPZ5.js → chunk.GEHO4WRP.js} +2 -2
- package/dist/chunks/{chunk.RK7OBPZ5.js.map → chunk.GEHO4WRP.js.map} +1 -1
- package/dist/chunks/chunk.GO3CCKC3.js +96 -0
- package/dist/chunks/chunk.GO3CCKC3.js.map +7 -0
- package/dist/chunks/{chunk.64MHCKTF.js → chunk.H3GKRGN6.js} +7 -7
- package/dist/chunks/{chunk.CSOIUDS4.js → chunk.HZTZOBNJ.js} +2 -2
- package/dist/chunks/{chunk.4LMFTSOM.js → chunk.I3SSNN7J.js} +10 -4
- package/dist/chunks/chunk.I3SSNN7J.js.map +7 -0
- package/dist/chunks/{chunk.BUIBP2TA.js → chunk.INLTRHSF.js} +2 -2
- package/dist/chunks/{chunk.GGY5VQYA.js → chunk.IVHB4EQ6.js} +3 -3
- package/dist/chunks/chunk.IVHB4EQ6.js.map +7 -0
- package/dist/chunks/{chunk.2ZEMD2N7.js → chunk.J3HTR5NX.js} +2 -2
- package/dist/chunks/{chunk.RRWSXFQ5.js → chunk.JDBDBGQP.js} +3 -2
- package/dist/chunks/{chunk.RRWSXFQ5.js.map → chunk.JDBDBGQP.js.map} +2 -2
- package/dist/chunks/{chunk.Q4CT57M2.js → chunk.JJZKPNJZ.js} +2 -2
- package/dist/chunks/{chunk.SZCGMXW5.js → chunk.JUJZBRXD.js} +2 -2
- package/dist/chunks/chunk.JUJZBRXD.js.map +7 -0
- package/dist/chunks/{chunk.722JR5BD.js → chunk.K2H37OYP.js} +6 -6
- package/dist/chunks/{chunk.722JR5BD.js.map → chunk.K2H37OYP.js.map} +2 -2
- package/dist/chunks/chunk.K6AHAO25.js +166 -0
- package/dist/chunks/chunk.K6AHAO25.js.map +7 -0
- package/dist/chunks/{chunk.2OLQHFOR.js → chunk.KJ7V3TWI.js} +3 -3
- package/dist/chunks/{chunk.UYD2OVFV.js → chunk.KZMWNTUS.js} +2 -2
- package/dist/chunks/chunk.KZMWNTUS.js.map +7 -0
- package/dist/chunks/chunk.L4UUXVRZ.js +312 -0
- package/dist/chunks/chunk.L4UUXVRZ.js.map +7 -0
- package/dist/chunks/{chunk.ETREUSYO.js → chunk.LFNAPJXT.js} +4 -4
- package/dist/chunks/{chunk.H7XP6JAS.js → chunk.LOUVN7OA.js} +3 -3
- package/dist/chunks/{chunk.3STW62TA.js → chunk.NIYKFSPR.js} +2 -1
- package/dist/chunks/{chunk.3STW62TA.js.map → chunk.NIYKFSPR.js.map} +2 -2
- package/dist/chunks/{chunk.34NAFEQ7.js → chunk.NLWT6VZN.js} +2 -2
- package/dist/chunks/{chunk.ZLEQ5DOF.js → chunk.NOB4TQLJ.js} +2 -2
- package/dist/chunks/{chunk.7UUZ5ISH.js → chunk.O3AC2EVL.js} +3 -3
- package/dist/chunks/chunk.OCH36GVS.js +12 -0
- package/dist/chunks/chunk.OCH36GVS.js.map +7 -0
- package/dist/chunks/{chunk.OLM7IVHA.js → chunk.OEMIM5RD.js} +6 -6
- package/dist/chunks/chunk.ONVWJKVD.js +318 -0
- package/dist/chunks/chunk.ONVWJKVD.js.map +7 -0
- package/dist/chunks/{chunk.ITUSK365.js → chunk.PCI22DJU.js} +2 -2
- package/dist/chunks/{chunk.3HTXK6WY.js → chunk.PGM6WEYY.js} +2 -2
- package/dist/chunks/{chunk.SJMMPKWP.js → chunk.Q4CRAGN3.js} +11 -11
- package/dist/chunks/{chunk.SJMMPKWP.js.map → chunk.Q4CRAGN3.js.map} +1 -1
- package/dist/chunks/{chunk.CG753OYA.js → chunk.Q7WVOJG4.js} +2 -2
- package/dist/chunks/{chunk.ZIQXX272.js → chunk.QPK7SLOE.js} +2 -2
- package/dist/chunks/{chunk.V53WYKEU.js → chunk.QY3GFWGZ.js} +6 -1
- package/dist/chunks/{chunk.V53WYKEU.js.map → chunk.QY3GFWGZ.js.map} +2 -2
- package/dist/chunks/{chunk.2QYALZBT.js → chunk.RIJKFEYZ.js} +14 -7
- package/dist/chunks/chunk.RIJKFEYZ.js.map +7 -0
- package/dist/chunks/{chunk.MQCFDVLW.js → chunk.SAHA7Z3T.js} +2 -2
- package/dist/chunks/chunk.SHOXPF5L.js +12 -0
- package/dist/chunks/chunk.SHOXPF5L.js.map +7 -0
- package/dist/chunks/{chunk.VDYPXC2H.js → chunk.SOAZXMVH.js} +2 -2
- package/dist/chunks/{chunk.ADRKUQGR.js → chunk.TAO5QIIQ.js} +2 -1
- package/dist/chunks/{chunk.ADRKUQGR.js.map → chunk.TAO5QIIQ.js.map} +2 -2
- package/dist/chunks/{chunk.5HAKNNIR.js → chunk.TUFBQA52.js} +2 -2
- package/dist/chunks/{chunk.P2D7PUR2.js → chunk.TWZC4LT2.js} +4 -4
- package/dist/chunks/chunk.U2H36O5J.js +208 -0
- package/dist/chunks/chunk.U2H36O5J.js.map +7 -0
- package/dist/chunks/chunk.UHVHULGW.js +286 -0
- package/dist/chunks/chunk.UHVHULGW.js.map +7 -0
- package/dist/chunks/{chunk.5TOD3QS2.js → chunk.VCFVQ6KS.js} +2 -2
- package/dist/chunks/{chunk.5TOD3QS2.js.map → chunk.VCFVQ6KS.js.map} +1 -1
- package/dist/chunks/{chunk.N4VSEIRQ.js → chunk.VTKIDI7N.js} +7 -1
- package/dist/chunks/{chunk.N4VSEIRQ.js.map → chunk.VTKIDI7N.js.map} +2 -2
- package/dist/chunks/{chunk.PEMSU7RY.js → chunk.WM7IMLTR.js} +2 -2
- package/dist/chunks/{chunk.2KV3G5JF.js → chunk.WMYFFFHI.js} +2 -2
- package/dist/chunks/{chunk.VCXIV7H4.js → chunk.WPAPTZLW.js} +3 -3
- package/dist/chunks/{chunk.EWGDHM27.js → chunk.WZWI3VYU.js} +2 -2
- package/dist/chunks/{chunk.NXX572OD.js → chunk.XADGSL34.js} +2 -2
- package/dist/chunks/chunk.XNP4OTUB.js +16 -0
- package/dist/chunks/chunk.XNP4OTUB.js.map +7 -0
- package/dist/chunks/{chunk.KEEDSK2V.js → chunk.ZM72G6GO.js} +4 -4
- package/dist/components/badge/badge.component.js +4 -4
- package/dist/components/badge/badge.js +5 -5
- package/dist/components/button/button.component.js +10 -10
- package/dist/components/button/button.js +11 -11
- package/dist/components/button/button.styles.js +1 -1
- package/dist/components/button-group/button-group.component.js +2 -2
- package/dist/components/button-group/button-group.js +3 -3
- package/dist/components/checkbox/checkbox.component.js +7 -7
- package/dist/components/checkbox/checkbox.js +8 -8
- package/dist/components/checkbox/checkbox.styles.js +1 -1
- package/dist/components/divider/divider.component.js +2 -2
- package/dist/components/divider/divider.js +3 -3
- package/dist/components/drawer/drawer.component.js +10 -10
- package/dist/components/drawer/drawer.custom.styles.js +1 -1
- package/dist/components/drawer/drawer.js +11 -11
- package/dist/components/dropdown/dropdown.component.d.ts +4 -0
- package/dist/components/dropdown/dropdown.component.js +5 -5
- package/dist/components/dropdown/dropdown.js +6 -6
- package/dist/components/header/header.component.d.ts +42 -1
- package/dist/components/header/header.component.js +9 -7
- package/dist/components/header/header.js +10 -8
- package/dist/components/header/header.styles.js +1 -1
- package/dist/components/icon/icon.component.js +4 -4
- package/dist/components/icon/icon.js +5 -5
- package/dist/components/icon/library.js +2 -2
- package/dist/components/icon/library.system.js +1 -1
- package/dist/components/icon-button/icon-button.component.js +5 -5
- package/dist/components/icon-button/icon-button.js +6 -6
- package/dist/components/input/input.component.js +10 -10
- package/dist/components/input/input.js +11 -11
- package/dist/components/input/input.styles.js +1 -1
- package/dist/components/menu/menu.component.js +2 -2
- package/dist/components/menu/menu.js +3 -3
- package/dist/components/menu-item/menu-item.component.js +10 -10
- package/dist/components/menu-item/menu-item.js +11 -11
- package/dist/components/menu-item/submenu-controller.js +3 -3
- package/dist/components/menu-label/menu-label.component.js +3 -3
- package/dist/components/menu-label/menu-label.js +4 -4
- package/dist/components/nav-item/nav-item.component.d.ts +145 -0
- package/dist/components/nav-item/nav-item.component.js +15 -0
- package/dist/components/nav-item/nav-item.component.js.map +7 -0
- package/dist/components/nav-item/nav-item.d.ts +8 -0
- package/dist/components/nav-item/nav-item.js +16 -0
- package/dist/components/nav-item/nav-item.js.map +7 -0
- package/dist/components/nav-item/nav-item.styles.d.ts +2 -0
- package/dist/components/nav-item/nav-item.styles.js +8 -0
- package/dist/components/nav-item/nav-item.styles.js.map +7 -0
- package/dist/components/optgroup/optgroup.component.js +3 -3
- package/dist/components/optgroup/optgroup.js +4 -4
- package/dist/components/option/option.component.js +7 -7
- package/dist/components/option/option.js +8 -8
- package/dist/components/popup/popup.component.d.ts +1 -0
- package/dist/components/popup/popup.component.js +2 -2
- package/dist/components/popup/popup.js +3 -3
- package/dist/components/prio-nav/prio-nav.component.d.ts +110 -0
- package/dist/components/prio-nav/prio-nav.component.js +38 -0
- package/dist/components/prio-nav/prio-nav.component.js.map +7 -0
- package/dist/components/prio-nav/prio-nav.d.ts +8 -0
- package/dist/components/prio-nav/prio-nav.js +39 -0
- package/dist/components/prio-nav/prio-nav.js.map +7 -0
- package/dist/components/prio-nav/prio-nav.styles.d.ts +2 -0
- package/dist/components/prio-nav/prio-nav.styles.js +8 -0
- package/dist/components/prio-nav/prio-nav.styles.js.map +7 -0
- package/dist/components/prio-nav/utils.d.ts +20 -0
- package/dist/components/prio-nav/utils.js +12 -0
- package/dist/components/prio-nav/utils.js.map +7 -0
- package/dist/components/radio/radio.component.js +6 -6
- package/dist/components/radio/radio.js +7 -7
- package/dist/components/radio-button/radio-button.component.js +4 -4
- package/dist/components/radio-button/radio-button.js +5 -5
- package/dist/components/radio-button/radio-button.styles.js +2 -2
- package/dist/components/radio-group/radio-group.component.js +4 -4
- package/dist/components/radio-group/radio-group.js +5 -5
- package/dist/components/select/select.component.js +12 -12
- package/dist/components/select/select.js +13 -13
- package/dist/components/side-nav/side-nav.component.d.ts +122 -0
- package/dist/components/side-nav/side-nav.component.js +34 -0
- package/dist/components/side-nav/side-nav.component.js.map +7 -0
- package/dist/components/side-nav/side-nav.d.ts +8 -0
- package/dist/components/side-nav/side-nav.js +35 -0
- package/dist/components/side-nav/side-nav.js.map +7 -0
- package/dist/components/side-nav/side-nav.styles.d.ts +2 -0
- package/dist/components/side-nav/side-nav.styles.js +8 -0
- package/dist/components/side-nav/side-nav.styles.js.map +7 -0
- package/dist/components/spinner/spinner.component.js +4 -4
- package/dist/components/switch/switch.component.js +4 -4
- package/dist/components/switch/switch.js +5 -5
- package/dist/components/switch/switch.styles.js +1 -1
- package/dist/components/tag/tag.component.js +8 -8
- package/dist/components/tag/tag.js +9 -9
- package/dist/components/textarea/textarea.component.js +3 -3
- package/dist/components/textarea/textarea.js +4 -4
- package/dist/custom-elements.json +2086 -860
- package/dist/events/events.d.ts +2 -0
- package/dist/events/syn-burger-menu-hide.d.ts +6 -0
- package/dist/events/syn-burger-menu-show.d.ts +6 -0
- package/dist/synergy.d.ts +3 -0
- package/dist/synergy.js +97 -78
- package/dist/themes/utility.css +2 -1
- package/dist/translations/de.js +7 -2
- package/dist/translations/de.js.map +2 -2
- package/dist/translations/en.js +1 -1
- package/dist/utilities/form.js +2 -2
- package/dist/utilities/icon-library.js +2 -2
- package/dist/utilities/localize.d.ts +3 -0
- package/dist/utilities/localize.js +2 -2
- package/dist/vscode.html-custom-data.json +125 -19
- package/package.json +5 -4
- package/dist/chunks/chunk.2QYALZBT.js.map +0 -7
- package/dist/chunks/chunk.4LMFTSOM.js.map +0 -7
- package/dist/chunks/chunk.525LGYB4.js.map +0 -7
- package/dist/chunks/chunk.A6S4OYWD.js.map +0 -7
- package/dist/chunks/chunk.GGY5VQYA.js.map +0 -7
- package/dist/chunks/chunk.H33SDUY3.js.map +0 -7
- package/dist/chunks/chunk.L6ZUZPOW.js +0 -80
- package/dist/chunks/chunk.L6ZUZPOW.js.map +0 -7
- package/dist/chunks/chunk.QQB6JCQY.js.map +0 -7
- package/dist/chunks/chunk.SZCGMXW5.js.map +0 -7
- package/dist/chunks/chunk.UYD2OVFV.js.map +0 -7
- /package/dist/chunks/{chunk.DXL3JN6D.js.map → chunk.3EONOQ2P.js.map} +0 -0
- /package/dist/chunks/{chunk.COFVSXEF.js.map → chunk.3M6IVPMZ.js.map} +0 -0
- /package/dist/chunks/{chunk.YRMXDJFM.js.map → chunk.4MBMY5UE.js.map} +0 -0
- /package/dist/chunks/{chunk.GDHER3FZ.js.map → chunk.4RMP4EST.js.map} +0 -0
- /package/dist/chunks/{chunk.UEQDHG7J.js.map → chunk.5I7DR4UT.js.map} +0 -0
- /package/dist/chunks/{chunk.MEDX62IL.js.map → chunk.5OV7FNMN.js.map} +0 -0
- /package/dist/chunks/{chunk.7UVCYUNR.js.map → chunk.66MOXMDP.js.map} +0 -0
- /package/dist/chunks/{chunk.VSEAHAW7.js.map → chunk.7PYQKCMR.js.map} +0 -0
- /package/dist/chunks/{chunk.B57ZVQ2Q.js.map → chunk.ABSGP4AA.js.map} +0 -0
- /package/dist/chunks/{chunk.PAK472WN.js.map → chunk.BKRTJVKH.js.map} +0 -0
- /package/dist/chunks/{chunk.QFMUPETV.js.map → chunk.BQ3U6CVQ.js.map} +0 -0
- /package/dist/chunks/{chunk.SRZMRKLQ.js.map → chunk.CNKXQN5I.js.map} +0 -0
- /package/dist/chunks/{chunk.PSTO5STZ.js.map → chunk.CXLJMDBV.js.map} +0 -0
- /package/dist/chunks/{chunk.4MRXASVT.js.map → chunk.D63XRN3X.js.map} +0 -0
- /package/dist/chunks/{chunk.2NRG7KJT.js.map → chunk.E3MWAHV4.js.map} +0 -0
- /package/dist/chunks/{chunk.EZE5M5XB.js.map → chunk.EHMIJIZ2.js.map} +0 -0
- /package/dist/chunks/{chunk.2SLHEFOH.js.map → chunk.ENAW6YL5.js.map} +0 -0
- /package/dist/chunks/{chunk.KUO3KJOC.js.map → chunk.GBARDV25.js.map} +0 -0
- /package/dist/chunks/{chunk.64MHCKTF.js.map → chunk.H3GKRGN6.js.map} +0 -0
- /package/dist/chunks/{chunk.CSOIUDS4.js.map → chunk.HZTZOBNJ.js.map} +0 -0
- /package/dist/chunks/{chunk.BUIBP2TA.js.map → chunk.INLTRHSF.js.map} +0 -0
- /package/dist/chunks/{chunk.2ZEMD2N7.js.map → chunk.J3HTR5NX.js.map} +0 -0
- /package/dist/chunks/{chunk.Q4CT57M2.js.map → chunk.JJZKPNJZ.js.map} +0 -0
- /package/dist/chunks/{chunk.2OLQHFOR.js.map → chunk.KJ7V3TWI.js.map} +0 -0
- /package/dist/chunks/{chunk.ETREUSYO.js.map → chunk.LFNAPJXT.js.map} +0 -0
- /package/dist/chunks/{chunk.H7XP6JAS.js.map → chunk.LOUVN7OA.js.map} +0 -0
- /package/dist/chunks/{chunk.34NAFEQ7.js.map → chunk.NLWT6VZN.js.map} +0 -0
- /package/dist/chunks/{chunk.ZLEQ5DOF.js.map → chunk.NOB4TQLJ.js.map} +0 -0
- /package/dist/chunks/{chunk.7UUZ5ISH.js.map → chunk.O3AC2EVL.js.map} +0 -0
- /package/dist/chunks/{chunk.OLM7IVHA.js.map → chunk.OEMIM5RD.js.map} +0 -0
- /package/dist/chunks/{chunk.ITUSK365.js.map → chunk.PCI22DJU.js.map} +0 -0
- /package/dist/chunks/{chunk.3HTXK6WY.js.map → chunk.PGM6WEYY.js.map} +0 -0
- /package/dist/chunks/{chunk.CG753OYA.js.map → chunk.Q7WVOJG4.js.map} +0 -0
- /package/dist/chunks/{chunk.ZIQXX272.js.map → chunk.QPK7SLOE.js.map} +0 -0
- /package/dist/chunks/{chunk.MQCFDVLW.js.map → chunk.SAHA7Z3T.js.map} +0 -0
- /package/dist/chunks/{chunk.VDYPXC2H.js.map → chunk.SOAZXMVH.js.map} +0 -0
- /package/dist/chunks/{chunk.5HAKNNIR.js.map → chunk.TUFBQA52.js.map} +0 -0
- /package/dist/chunks/{chunk.P2D7PUR2.js.map → chunk.TWZC4LT2.js.map} +0 -0
- /package/dist/chunks/{chunk.PEMSU7RY.js.map → chunk.WM7IMLTR.js.map} +0 -0
- /package/dist/chunks/{chunk.2KV3G5JF.js.map → chunk.WMYFFFHI.js.map} +0 -0
- /package/dist/chunks/{chunk.VCXIV7H4.js.map → chunk.WPAPTZLW.js.map} +0 -0
- /package/dist/chunks/{chunk.EWGDHM27.js.map → chunk.WZWI3VYU.js.map} +0 -0
- /package/dist/chunks/{chunk.NXX572OD.js.map → chunk.XADGSL34.js.map} +0 -0
- /package/dist/chunks/{chunk.KEEDSK2V.js.map → chunk.ZM72G6GO.js.map} +0 -0
|
@@ -25,6 +25,23 @@
|
|
|
25
25
|
}
|
|
26
26
|
]
|
|
27
27
|
},
|
|
28
|
+
{
|
|
29
|
+
"name": "syn-button-group",
|
|
30
|
+
"description": "Button groups can be used to group related buttons into sections.\n---\n\n\n### **Slots:**\n - _default_ - One or more `<syn-button>` elements to display in the button group.\n\n### **CSS Parts:**\n - **base** - The component's base wrapper.",
|
|
31
|
+
"attributes": [
|
|
32
|
+
{
|
|
33
|
+
"name": "label",
|
|
34
|
+
"description": "A label to use for the button group. This won't be displayed on the screen, but it will be announced by assistive\ndevices when interacting with the control and is strongly recommended.",
|
|
35
|
+
"values": []
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
"references": [
|
|
39
|
+
{
|
|
40
|
+
"name": "Documentation",
|
|
41
|
+
"url": "https://synergy.style/components/button-group"
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
},
|
|
28
45
|
{
|
|
29
46
|
"name": "syn-button",
|
|
30
47
|
"description": "Buttons represent actions that are available to the user.\n---\n\n\n### **Events:**\n - **syn-blur** - Emitted when the button loses focus.\n- **syn-focus** - Emitted when the button gains focus.\n- **syn-invalid** - Emitted when the form control has been checked for validity and its constraints aren't satisfied.\n\n### **Methods:**\n - **click()** - Simulates a click on the button.\n- **focus(options: _FocusOptions_)** - Sets focus on the button.\n- **blur()** - Removes focus from the button.\n- **checkValidity()** - Checks for validity but does not show a validation message. Returns `true` when valid and `false` when invalid.\n- **getForm(): _HTMLFormElement | null_** - Gets the associated form, if one exists.\n- **reportValidity()** - Checks for validity and shows the browser's validation message if the control is invalid.\n- **setCustomValidity(message: _string_)** - Sets a custom validation message. Pass an empty string to restore validity.\n\n### **Slots:**\n - _default_ - The button's label.\n- **prefix** - A presentational prefix icon or similar element.\n- **suffix** - A presentational suffix icon or similar element.\n\n### **CSS Parts:**\n - **base** - The component's base wrapper.\n- **prefix** - The container that wraps the prefix.\n- **label** - The button's label.\n- **suffix** - The container that wraps the suffix.\n- **caret** - The button's caret icon, an `<syn-icon>` element.\n- **spinner** - The spinner that shows when the button is in the loading state.",
|
|
@@ -154,23 +171,6 @@
|
|
|
154
171
|
}
|
|
155
172
|
]
|
|
156
173
|
},
|
|
157
|
-
{
|
|
158
|
-
"name": "syn-button-group",
|
|
159
|
-
"description": "Button groups can be used to group related buttons into sections.\n---\n\n\n### **Slots:**\n - _default_ - One or more `<syn-button>` elements to display in the button group.\n\n### **CSS Parts:**\n - **base** - The component's base wrapper.",
|
|
160
|
-
"attributes": [
|
|
161
|
-
{
|
|
162
|
-
"name": "label",
|
|
163
|
-
"description": "A label to use for the button group. This won't be displayed on the screen, but it will be announced by assistive\ndevices when interacting with the control and is strongly recommended.",
|
|
164
|
-
"values": []
|
|
165
|
-
}
|
|
166
|
-
],
|
|
167
|
-
"references": [
|
|
168
|
-
{
|
|
169
|
-
"name": "Documentation",
|
|
170
|
-
"url": "https://synergy.style/components/button-group"
|
|
171
|
-
}
|
|
172
|
-
]
|
|
173
|
-
},
|
|
174
174
|
{
|
|
175
175
|
"name": "syn-checkbox",
|
|
176
176
|
"description": "Checkboxes allow the user to toggle an option on or off.\n---\n\n\n### **Events:**\n - **syn-blur** - Emitted when the checkbox loses focus.\n- **syn-change** - Emitted when the checked state changes.\n- **syn-focus** - Emitted when the checkbox gains focus.\n- **syn-input** - Emitted when the checkbox receives input.\n- **syn-invalid** - Emitted when the form control has been checked for validity and its constraints aren't satisfied.\n\n### **Methods:**\n - **click()** - Simulates a click on the checkbox.\n- **focus(options: _FocusOptions_)** - Sets focus on the checkbox.\n- **blur()** - Removes focus from the checkbox.\n- **checkValidity()** - Checks for validity but does not show a validation message. Returns `true` when valid and `false` when invalid.\n- **getForm(): _HTMLFormElement | null_** - Gets the associated form, if one exists.\n- **reportValidity()** - Checks for validity and shows the browser's validation message if the control is invalid.\n- **setCustomValidity(message: _string_)** - Sets a custom validation message. The value provided will be shown to the user when the form is submitted. To clear\nthe custom validation message, call this method with an empty string.\n\n### **Slots:**\n - _default_ - The checkbox's label.\n- **help-text** - Text that describes how to use the checkbox. Alternatively, you can use the `help-text` attribute.\n\n### **CSS Parts:**\n - **base** - The component's base wrapper.\n- **control** - The square container that wraps the checkbox's checked state.\n- **control--checked** - Matches the control part when the checkbox is checked.\n- **control--indeterminate** - Matches the control part when the checkbox is indeterminate.\n- **checked-icon** - The checked icon, an `<syn-icon>` element.\n- **indeterminate-icon** - The indeterminate icon, an `<syn-icon>` element.\n- **label** - The container that wraps the checkbox's label.\n- **form-control-help-text** - The help text's wrapper.",
|
|
@@ -344,6 +344,15 @@
|
|
|
344
344
|
"name": "hoist",
|
|
345
345
|
"description": "Enable this option to prevent the panel from being clipped when the component is placed inside a container with\n`overflow: auto|scroll`. Hoisting uses a fixed positioning strategy that works in many, but not all, scenarios.",
|
|
346
346
|
"values": []
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
"name": "sync",
|
|
350
|
+
"description": "Syncs the popup width or height to that of the trigger element.",
|
|
351
|
+
"values": [
|
|
352
|
+
{ "name": "width" },
|
|
353
|
+
{ "name": "height" },
|
|
354
|
+
{ "name": "both" }
|
|
355
|
+
]
|
|
347
356
|
}
|
|
348
357
|
],
|
|
349
358
|
"references": [
|
|
@@ -355,11 +364,21 @@
|
|
|
355
364
|
},
|
|
356
365
|
{
|
|
357
366
|
"name": "syn-header",
|
|
358
|
-
"description": "The <syn-header /> element provides a generic application header\nthat can be used to add applications name, toolbar and primary navigation.\n---\n\n\n### **Slots:**\n - _default_ - The label for the header.\n- **logo** - The logo that should be displayed. Will fall back to the SICK logo if not provided.\n- **meta-navigation** - The meta-navigation is used to add various application toolbar icons. Best used with `<syn-icon-button />` and `<syn-drop-down />`\n- **navigation** - This slot can be used to add an optional horizontal navigation\n\n### **CSS Parts:**\n - **base** - The component's base wrapper.\n- **content** - The wrapper most content items reside\n- **logo** - The wrapper the application logo resides in\n- **label** - The element wrapping the application name\n- **meta-navigation** - The Item wrapping the optional application menu\n- **navigation** - The wrapper that is holding the optional top navigation section",
|
|
367
|
+
"description": "The <syn-header /> element provides a generic application header\nthat can be used to add applications name, toolbar and primary navigation.\n---\n\n\n### **Events:**\n - **syn-burger-menu-show** - Emitted when the burger menu button is toggled to visible\n- **syn-burger-menu-hide** - Emitted when the burger menu button is toggled to not visible\n\n### **Methods:**\n - **connectSideNavigation(sideNav: _SynSideNav_)** - Connect a `syn-side-nav` to add automatic interaction of the header with the side navigation\nlike showing the burger menu icon and open / close handling.\n\nIf no side navigation is connected, the header will use the first `syn-side-nav` element it\nfinds.\n\n### **Slots:**\n - _default_ - The label for the header.\n- **logo** - The logo that should be displayed. Will fall back to the SICK logo if not provided.\n- **meta-navigation** - The meta-navigation is used to add various application toolbar icons. Best used with `<syn-icon-button />` and `<syn-drop-down />`\n- **navigation** - This slot can be used to add an optional horizontal navigation\n- **show-burger-menu** - An icon to use in lieu of the default show burger menu icon\n- **hide-burger-menu** - An icon to use in lieu of the default hide burger menu icon\n\n### **CSS Parts:**\n - **base** - The component's base wrapper.\n- **content** - The wrapper most content items reside\n- **logo** - The wrapper the application logo resides in\n- **label** - The element wrapping the application name\n- **meta-navigation** - The Item wrapping the optional application menu\n- **navigation** - The wrapper that is holding the optional top navigation section\n- **burger-menu-toggle-button** - The button that toggles the burger menu",
|
|
359
368
|
"attributes": [
|
|
360
369
|
{
|
|
361
370
|
"name": "label",
|
|
362
|
-
"description": "The headers label. If you need to display HTML, use the `
|
|
371
|
+
"description": "The headers label. If you need to display HTML, use the `default` slot instead.",
|
|
372
|
+
"values": []
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
"name": "show-burger-menu",
|
|
376
|
+
"description": "Adds a button to toggle the burger menu's visibility.\nThe button is added automatically, if the component finds a syn-side-nav in non-rail mode.",
|
|
377
|
+
"values": []
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
"name": "burger-menu-visible",
|
|
381
|
+
"description": "Determines whether or not the burger menu is currently visible.",
|
|
363
382
|
"values": []
|
|
364
383
|
}
|
|
365
384
|
],
|
|
@@ -730,6 +749,49 @@
|
|
|
730
749
|
}
|
|
731
750
|
]
|
|
732
751
|
},
|
|
752
|
+
{
|
|
753
|
+
"name": "syn-nav-item",
|
|
754
|
+
"description": "Flexible button / link component that can be used to quickly build navigations.\nTakes one of 3 forms:\n- button (default),\n- link (overrides button if a 'href' is provided),\n- or accordion (overrides all other if 'children' slot is defined).\n---\n\n\n### **Events:**\n - **syn-show** - Emitted when the navigation item: - has children, - and is clicked while HTML details are hidden.\n- **syn-hide** - Emitted when the navigation item: - has children, - and is clicked while HTML details are shown.\n- **syn-blur** - Emitted when the button loses focus.\n- **syn-focus** - Emitted when the button gains focus.\n\n### **Methods:**\n - **blur()** - Removes focus from the button.\n- **click()** - Simulates a click on the nav-items button, link or summary.\n- **focus(options: _FocusOptions_)** - Sets focus on the nav-item\n\n### **Slots:**\n - _default_ - The navigation item's label.\n- **prefix** - A presentational prefix icon or similar element.\n- **suffix** - A presentational suffix icon or similar element.\n- **children** - Slot used to provide nested child navigation elements. If provided, details and summary elements will be used. A chevron will be shown on the right side regardless of the chevron property.\n\n### **CSS Properties:**\n - **--indentation** - Numeric value, indicating the level the item is placed at. _(default: undefined)_\n- **--indentation-stepping** - The amount of pixels each level will indent. _(default: undefined)_\n- **--display-children** - Display property of the children. Defaults to \"contents\" _(default: undefined)_\n\n### **CSS Parts:**\n - **base** - The component's base wrapper including children.\n- **children** - The wrapper that holds the children\n- **content-wrapper** - The component's content wrapper.\n- **content** - The component's content excluding children.\n- **current-indicator** - The indicator used when current is set to true\n- **chevron** - The container that wraps the chevron.\n- **details** - The details element rendered when there are children available\n- **divider** - The components optional top divider.\n- **prefix** - The container that wraps the prefix.\n- **suffix** - The container that wraps the suffix.",
|
|
755
|
+
"attributes": [
|
|
756
|
+
{
|
|
757
|
+
"name": "href",
|
|
758
|
+
"description": "The navigation item's href target.\nIf provided, the navigation item will use an anchor tag otherwise it will use a button tag.\n\nIf the 'children' slot is provided, the navigation item will ignore the 'href' and use\naccordion behavior.",
|
|
759
|
+
"values": []
|
|
760
|
+
},
|
|
761
|
+
{ "name": "current", "values": [] },
|
|
762
|
+
{
|
|
763
|
+
"name": "disabled",
|
|
764
|
+
"description": "Disables the navigation item.",
|
|
765
|
+
"values": []
|
|
766
|
+
},
|
|
767
|
+
{
|
|
768
|
+
"name": "horizontal",
|
|
769
|
+
"description": "The navigation item's orientation.",
|
|
770
|
+
"values": []
|
|
771
|
+
},
|
|
772
|
+
{
|
|
773
|
+
"name": "chevron",
|
|
774
|
+
"description": "Appends a chevron to the right side of a navigation item.\nOnly used if `horizontal` is false.",
|
|
775
|
+
"values": []
|
|
776
|
+
},
|
|
777
|
+
{
|
|
778
|
+
"name": "open",
|
|
779
|
+
"description": "Reflects HTML details element state and allows control from parent.\nOnly used if `horizontal` is false and `children` is defined.",
|
|
780
|
+
"values": []
|
|
781
|
+
},
|
|
782
|
+
{
|
|
783
|
+
"name": "divider",
|
|
784
|
+
"description": "Toggle to true to show a divider above the element.\nOnly available when horizontal is false.",
|
|
785
|
+
"values": []
|
|
786
|
+
}
|
|
787
|
+
],
|
|
788
|
+
"references": [
|
|
789
|
+
{
|
|
790
|
+
"name": "Documentation",
|
|
791
|
+
"url": "https://synergy.style/components/nav-item"
|
|
792
|
+
}
|
|
793
|
+
]
|
|
794
|
+
},
|
|
733
795
|
{
|
|
734
796
|
"name": "syn-optgroup",
|
|
735
797
|
"description": "The <syn-optgroup> element creates a grouping for <syn-option>s within a <syn-select>.\n---\n\n\n### **Slots:**\n - _default_ - The given options. Must be `<syn-option>` elements.\n- **prefix** - A presentational prefix icon or similar element.\n- **label** - The label for the optgroup\n- **suffix** - A presentational suffix icon or similar element.\n\n### **CSS Properties:**\n - **--display-divider** - Display property of the divider. Defaults to \"block\" _(default: undefined)_\n\n### **CSS Parts:**\n - **base** - The component's base wrapper.\n- **label-container** - The container that wraps prefix, label and base\n- **divider** - The divider that is displayed above the content\n- **prefix** - The container that wraps the prefix.\n- **suffix** - The container that wraps the suffix.\n- **options** - The container that wraps the <syn-option> elements.",
|
|
@@ -923,6 +985,23 @@
|
|
|
923
985
|
}
|
|
924
986
|
]
|
|
925
987
|
},
|
|
988
|
+
{
|
|
989
|
+
"name": "syn-prio-nav",
|
|
990
|
+
"description": "The `<syn-prio-nav />` element provides a generic navigation bar\nthat can be used to group multiple navigation items (usually horizontal `<syn-nav-item />`s)\ntogether. It will automatically group all items not visible in the viewport into a custom\npriority menu.\n---\n\n\n### **Slots:**\n - _default_ - The given navigation items. Must be horizontal `<syn-nav-item>`s or have a role of \"menuitem\"\n\n### **CSS Parts:**\n - **base** - The component's base wrapper.\n- **priority-menu** - The wrapper around the priority menu\n- **priority-menu-nav-item** - The navigation item for the priority menu\n- **priority-menu-label** - The label for the priority menu\n- **priority-menu-icon** - The icon for the priority menu\n- **priority-menu-container** - The container for the shifted navigation items, if there is not enough space.",
|
|
991
|
+
"attributes": [
|
|
992
|
+
{
|
|
993
|
+
"name": "priority-menu-label",
|
|
994
|
+
"description": "The components priority menu label.\nThis will be shown after the priority menu 3 dots link",
|
|
995
|
+
"values": []
|
|
996
|
+
}
|
|
997
|
+
],
|
|
998
|
+
"references": [
|
|
999
|
+
{
|
|
1000
|
+
"name": "Documentation",
|
|
1001
|
+
"url": "https://synergy.style/components/prio-nav"
|
|
1002
|
+
}
|
|
1003
|
+
]
|
|
1004
|
+
},
|
|
926
1005
|
{
|
|
927
1006
|
"name": "syn-radio",
|
|
928
1007
|
"description": "Radios allow the user to select a single option from a group.\n---\n\n\n### **Events:**\n - **syn-blur** - Emitted when the control loses focus.\n- **syn-focus** - Emitted when the control gains focus.\n\n### **Slots:**\n - _default_ - The radio's label.\n\n### **CSS Parts:**\n - **base** - The component's base wrapper.\n- **control** - The circular container that wraps the radio's checked state.\n- **control--checked** - The radio control when the radio is checked.\n- **checked-icon** - The checked icon, an `<syn-icon>` element.\n- **label** - The container that wraps the radio's label.",
|
|
@@ -1135,6 +1214,33 @@
|
|
|
1135
1214
|
}
|
|
1136
1215
|
]
|
|
1137
1216
|
},
|
|
1217
|
+
{
|
|
1218
|
+
"name": "syn-side-nav",
|
|
1219
|
+
"description": "The <syn-side-nav /> element contains secondary navigation and fits below the header.\nIt can be used to group multiple navigation items (<syn-nav-item />s) together.\n---\n\n\n### **Events:**\n - **syn-show** - Emitted when the side-nav opens.\n- **syn-after-show** - Emitted after the side-nav opens and all animations are complete.\n- **syn-hide** - Emitted when the side-nav closes.\n- **syn-after-hide** - Emitted after the side-nav closes and all animations are complete.\n\n### **Methods:**\n - **show()** - Shows the side-nav.\n- **hide()** - Hides the side-nav\n\n### **Slots:**\n - _default_ - The main content of the side-nav. Used for <syn-nav-item /> elements.\n- **footer** - The footer content of the side-nav. Used for <syn-nav-item /> elements. Please avoid having to many nav-items as it can massively influence the user experience.\n\n### **CSS Properties:**\n - **--side-nav-open-width** - The width of the side-nav if in open state _(default: undefined)_\n- **--side-nav-rail-width** - The width of the side-nav if in rail mode without open _(default: undefined)_\n\n### **CSS Parts:**\n - **base** - The components base wrapper\n- **drawer** - The drawer that is used under the hood for creating the side-nav\n- **content-container** - The components main content container\n- **content** - The components main content\n- **footer-container** - The components footer content container\n- **footer-divider** - The components footer divider\n- **footer** - The components footer content\n- **overlay** - The overlay that covers the screen behind the side-nav.",
|
|
1220
|
+
"attributes": [
|
|
1221
|
+
{
|
|
1222
|
+
"name": "open",
|
|
1223
|
+
"description": "Indicates whether or not the side-nav is open.\nYou can toggle this attribute to show and hide the side-nav, or you can use the `show()` and\n`hide()` methods and this attribute will reflect the side-nav's open state.\n\nDepending if the rail attribute is set or not, the behavior will differ.\n\n__Non rail__:\nWith `open` will show the side-nav.\nWithout `open`, the side-nav will be hidden.\n\n__Rail__:\nWith `open` will show the whole side-nav with an overlay for touch devices\nor without an overlay for non-touch devices.\nWithout `open`, the side-nav will only show the prefix of nav-item's.",
|
|
1224
|
+
"values": []
|
|
1225
|
+
},
|
|
1226
|
+
{
|
|
1227
|
+
"name": "rail",
|
|
1228
|
+
"description": "Use the rail attribute to only show the prefix of navigation items in closed state.\nThis will open on hover on the rail navigation.\nOn touch devices the navigation opens on click and shows an overlay.\n\nNote: The Rail is only an option if all Navigation Items on the first level have an Icon.\nIf this is not the case you should use a burger navigation.",
|
|
1229
|
+
"values": []
|
|
1230
|
+
},
|
|
1231
|
+
{
|
|
1232
|
+
"name": "no-focus-trapping",
|
|
1233
|
+
"description": "By default, the side-nav traps the focus if in non-rail mode and open.\nTo disable the focus trapping, set this attribute.",
|
|
1234
|
+
"values": []
|
|
1235
|
+
}
|
|
1236
|
+
],
|
|
1237
|
+
"references": [
|
|
1238
|
+
{
|
|
1239
|
+
"name": "Documentation",
|
|
1240
|
+
"url": "https://synergy.style/components/side-nav"
|
|
1241
|
+
}
|
|
1242
|
+
]
|
|
1243
|
+
},
|
|
1138
1244
|
{
|
|
1139
1245
|
"name": "syn-spinner",
|
|
1140
1246
|
"description": "Spinners are used to show the progress of an indeterminate operation.\n---\n\n\n### **CSS Properties:**\n - **--track-width** - The width of the track. _(default: undefined)_\n- **--track-color** - The color of the track. _(default: undefined)_\n- **--indicator-color** - The color of the spinner's indicator. _(default: undefined)_\n- **--speed** - The time it takes for the spinner to complete one animation cycle. _(default: undefined)_\n\n### **CSS Parts:**\n - **base** - The component's base wrapper.",
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"url": "https://www.sick.com"
|
|
5
5
|
},
|
|
6
6
|
"name": "@synergy-design-system/components",
|
|
7
|
-
"version": "1.
|
|
7
|
+
"version": "1.16.0",
|
|
8
8
|
"description": "",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
"@semantic-release/exec": "^6.0.3",
|
|
49
49
|
"@semantic-release/git": "^10.0.1",
|
|
50
50
|
"@types/mocha": "^10.0.6",
|
|
51
|
+
"@types/sinon": "^17.0.3",
|
|
51
52
|
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
|
52
53
|
"@typescript-eslint/parser": "^6.21.0",
|
|
53
54
|
"@web/dev-server-esbuild": "^1.0.2",
|
|
@@ -88,9 +89,9 @@
|
|
|
88
89
|
"user-agent-data-types": "^0.4.2",
|
|
89
90
|
"vendorism": "^3.0.0",
|
|
90
91
|
"vue-tsc": "^1.8.27",
|
|
91
|
-
"@synergy-design-system/
|
|
92
|
-
"@synergy-design-system/tokens": "1.
|
|
93
|
-
"@synergy-design-system/
|
|
92
|
+
"@synergy-design-system/eslint-config-syn": "0.1.0",
|
|
93
|
+
"@synergy-design-system/tokens": "1.11.0",
|
|
94
|
+
"@synergy-design-system/stylelint-config-syn": "0.1.0"
|
|
94
95
|
},
|
|
95
96
|
"release": {
|
|
96
97
|
"branches": [
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/internal/offset.ts", "../../src/internal/scroll.ts"],
|
|
4
|
-
"sourcesContent": ["// ---------------------------------------------------------------------\n// \uD83D\uDD12 AUTOGENERATED BY VENDORISM\n// Removing this comment will prevent it from being managed by it.\n// ---------------------------------------------------------------------\n\n/* eslint-disable */\n/**\n * Returns an element's offset relative to its parent. Similar to element.offsetTop and element.offsetLeft, except the\n * parent doesn't have to be positioned relative or absolute.\n *\n * NOTE: This was created to work around what appears to be a bug in Chrome where a slotted element's offsetParent seems\n * to ignore elements inside the surrounding shadow DOM: https://bugs.chromium.org/p/chromium/issues/detail?id=920069\n */\nexport function getOffset(element: HTMLElement, parent: HTMLElement) {\n return {\n top: Math.round(element.getBoundingClientRect().top - parent.getBoundingClientRect().top),\n left: Math.round(element.getBoundingClientRect().left - parent.getBoundingClientRect().left)\n };\n}\n", "// ---------------------------------------------------------------------\n// \uD83D\uDD12 AUTOGENERATED BY VENDORISM\n// Removing this comment will prevent it from being managed by it.\n// ---------------------------------------------------------------------\n\n/* eslint-disable */\nimport { getOffset } from './offset.js';\n\nconst locks = new Set();\n\n/** Returns the width of the document's scrollbar */\nfunction getScrollbarWidth() {\n const documentWidth = document.documentElement.clientWidth;\n return Math.abs(window.innerWidth - documentWidth);\n}\n\n/**\n * Prevents body scrolling. Keeps track of which elements requested a lock so multiple levels of locking are possible\n * without premature unlocking.\n */\nexport function lockBodyScrolling(lockingEl: HTMLElement) {\n locks.add(lockingEl);\n\n // When the first lock is created, set the scroll lock size to match the scrollbar's width to prevent content from\n // shifting. We only do this on the first lock because the scrollbar width will measure zero after overflow is hidden.\n if (!document.body.classList.contains('syn-scroll-lock')) {\n const scrollbarWidth = getScrollbarWidth(); // must be measured before the `syn-scroll-lock` class is applied\n document.body.classList.add('syn-scroll-lock');\n document.body.style.setProperty('--syn-scroll-lock-size', `${scrollbarWidth}px`);\n }\n}\n\n/**\n * Unlocks body scrolling. Scrolling will only be unlocked once all elements that requested a lock call this method.\n */\nexport function unlockBodyScrolling(lockingEl: HTMLElement) {\n locks.delete(lockingEl);\n\n if (locks.size === 0) {\n document.body.classList.remove('syn-scroll-lock');\n document.body.style.removeProperty('--syn-scroll-lock-size');\n }\n}\n\n/** Scrolls an element into view of its container. If the element is already in view, nothing will happen. */\nexport function scrollIntoView(\n element: HTMLElement,\n container: HTMLElement,\n direction: 'horizontal' | 'vertical' | 'both' = 'vertical',\n behavior: 'smooth' | 'auto' = 'smooth'\n) {\n const offset = getOffset(element, container);\n const offsetTop = offset.top + container.scrollTop;\n const offsetLeft = offset.left + container.scrollLeft;\n const minX = container.scrollLeft;\n const maxX = container.scrollLeft + container.offsetWidth;\n const minY = container.scrollTop;\n const maxY = container.scrollTop + container.offsetHeight;\n\n if (direction === 'horizontal' || direction === 'both') {\n if (offsetLeft < minX) {\n container.scrollTo({ left: offsetLeft, behavior });\n } else if (offsetLeft + element.clientWidth > maxX) {\n container.scrollTo({ left: offsetLeft - container.offsetWidth + element.clientWidth, behavior });\n }\n }\n\n if (direction === 'vertical' || direction === 'both') {\n if (offsetTop < minY) {\n container.scrollTo({ top: offsetTop, behavior });\n } else if (offsetTop + element.clientHeight > maxY) {\n container.scrollTo({ top: offsetTop - container.offsetHeight + element.clientHeight, behavior });\n }\n }\n}\n"],
|
|
5
|
-
"mappings": ";AAaO,SAAS,UAAU,SAAsB,QAAqB;AACnE,SAAO;AAAA,IACL,KAAK,KAAK,MAAM,QAAQ,sBAAsB,EAAE,MAAM,OAAO,sBAAsB,EAAE,GAAG;AAAA,IACxF,MAAM,KAAK,MAAM,QAAQ,sBAAsB,EAAE,OAAO,OAAO,sBAAsB,EAAE,IAAI;AAAA,EAC7F;AACF;;;ACVA,IAAM,QAAQ,oBAAI,IAAI;AAGtB,SAAS,oBAAoB;AAC3B,QAAM,gBAAgB,SAAS,gBAAgB;AAC/C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AS,CAAC;AAAA,IACjG;AAAA,EACF;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/components/icon/icon.component.ts"],
|
|
4
|
-
"sourcesContent": ["// ---------------------------------------------------------------------\n// \uD83D\uDD12 AUTOGENERATED BY VENDORISM\n// Removing this comment will prevent it from being managed by it.\n// ---------------------------------------------------------------------\n\n/* eslint-disable */\nimport { getIconLibrary, type IconLibrary, unwatchIcon, watchIcon } from './library.js';\nimport { html } from 'lit';\nimport { isTemplateResult } from 'lit/directive-helpers.js';\nimport { property, state } from 'lit/decorators.js';\nimport { watch } from '../../internal/watch.js';\nimport componentStyles from '../../styles/component.styles.js';\nimport SynergyElement from '../../internal/synergy-element.js';\nimport styles from './icon.styles.js';\nimport customStyles from './icon.custom.styles.js';\nimport type { CSSResultGroup, HTMLTemplateResult } from 'lit';\n\nconst CACHEABLE_ERROR = Symbol();\nconst RETRYABLE_ERROR = Symbol();\ntype SVGResult = HTMLTemplateResult | SVGSVGElement | typeof RETRYABLE_ERROR | typeof CACHEABLE_ERROR;\n\nlet parser: DOMParser;\nconst iconCache = new Map<string, Promise<SVGResult>>();\n\ninterface IconSource {\n url?: string;\n fromLibrary: boolean;\n}\n\n/**\n * @summary Icons are symbols that can be used to represent various options within an application.\n * @documentation https://synergy.style/components/icon\n * @status stable\n * @since 2.0\n *\n * @event syn-load - Emitted when the icon has loaded. When using `spriteSheet: true` this will not emit.\n * @event syn-error - Emitted when the icon fails to load due to an error. When using `spriteSheet: true` this will not emit.\n *\n * @csspart svg - The internal SVG element.\n * @csspart use - The <use> element generated when using `spriteSheet: true`\n */\nexport default class SynIcon extends SynergyElement {\n static styles: CSSResultGroup = [componentStyles, styles, customStyles];\n\n private initialRender = false;\n\n /** Given a URL, this function returns the resulting SVG element or an appropriate error symbol. */\n private async resolveIcon(url: string, library?: IconLibrary): Promise<SVGResult> {\n let fileData: Response;\n\n if (library?.spriteSheet) {\n return html`<svg part=\"svg\">\n <use part=\"use\" href=\"${url}\"></use>\n </svg>`;\n }\n\n try {\n fileData = await fetch(url, { mode: 'cors' });\n if (!fileData.ok) return fileData.status === 410 ? CACHEABLE_ERROR : RETRYABLE_ERROR;\n } catch {\n return RETRYABLE_ERROR;\n }\n\n try {\n const div = document.createElement('div');\n div.innerHTML = await fileData.text();\n\n const svg = div.firstElementChild;\n if (svg?.tagName?.toLowerCase() !== 'svg') return CACHEABLE_ERROR;\n\n if (!parser) parser = new DOMParser();\n const doc = parser.parseFromString(svg.outerHTML, 'text/html');\n\n const svgEl = doc.body.querySelector('svg');\n if (!svgEl) return CACHEABLE_ERROR;\n\n svgEl.part.add('svg');\n return document.adoptNode(svgEl);\n } catch {\n return CACHEABLE_ERROR;\n }\n }\n\n @state() private svg: SVGElement | HTMLTemplateResult | null = null;\n\n /** The name of the icon to draw. Available names depend on the icon library being used. */\n @property({ reflect: true }) name?: string;\n\n /**\n * An external URL of an SVG file. Be sure you trust the content you are including, as it will be executed as code and\n * can result in XSS attacks.\n */\n @property() src?: string;\n\n /**\n * An alternate description to use for assistive devices. If omitted, the icon will be considered presentational and\n * ignored by assistive devices.\n */\n @property() label = '';\n\n /** The name of a registered custom icon library. */\n @property({ reflect: true }) library = 'default';\n\n connectedCallback() {\n super.connectedCallback();\n watchIcon(this);\n }\n\n firstUpdated() {\n this.initialRender = true;\n this.setIcon();\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n unwatchIcon(this);\n }\n\n private getIconSource(): IconSource {\n const library = getIconLibrary(this.library);\n if (this.name && library) {\n return {\n url: library.resolver(this.name),\n fromLibrary: true\n };\n }\n\n return {\n url: this.src,\n fromLibrary: false\n };\n }\n\n @watch('label')\n handleLabelChange() {\n const hasLabel = typeof this.label === 'string' && this.label.length > 0;\n\n if (hasLabel) {\n this.setAttribute('role', 'img');\n this.setAttribute('aria-label', this.label);\n this.removeAttribute('aria-hidden');\n } else {\n this.removeAttribute('role');\n this.removeAttribute('aria-label');\n this.setAttribute('aria-hidden', 'true');\n }\n }\n\n @watch(['name', 'src', 'library'])\n async setIcon() {\n const { url, fromLibrary } = this.getIconSource();\n const library = fromLibrary ? getIconLibrary(this.library) : undefined;\n\n if (!url) {\n this.svg = null;\n return;\n }\n\n let iconResolver = iconCache.get(url);\n if (!iconResolver) {\n iconResolver = this.resolveIcon(url, library);\n iconCache.set(url, iconResolver);\n }\n\n // If we haven't rendered yet, exit early. This avoids unnecessary work due to watching multiple props.\n if (!this.initialRender) {\n return;\n }\n\n const svg = await iconResolver;\n\n if (svg === RETRYABLE_ERROR) {\n iconCache.delete(url);\n }\n\n if (url !== this.getIconSource().url) {\n // If the url has changed while fetching the icon, ignore this request\n return;\n }\n\n if (isTemplateResult(svg)) {\n this.svg = svg;\n return;\n }\n\n switch (svg) {\n case RETRYABLE_ERROR:\n case CACHEABLE_ERROR:\n this.svg = null;\n this.emit('syn-error');\n break;\n default:\n this.svg = svg.cloneNode(true) as SVGElement;\n library?.mutator?.(this.svg);\n this.emit('syn-load');\n }\n }\n\n render() {\n return this.svg;\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAOA,SAAS,YAAY;AACrB,SAAS,wBAAwB;AACjC,SAAS,UAAU,aAAa;AAQhC,IAAM,kBAAkB,OAAO;AAC/B,IAAM,kBAAkB,OAAO;AAG/B,IAAI;AACJ,IAAM,YAAY,oBAAI,IAAgC;AAmBtD,IAAqB,UAArB,cAAqC,eAAe;AAAA,EAApD;AAAA;AAGE,SAAQ,gBAAgB;AAuCf,SAAQ,MAA8C;AAenD,iBAAQ;AAGS,mBAAU;AAAA;AAAA;AAAA,EAtDvC,MAAc,YAAY,KAAa,SAA2C;AA/CpF;AAgDI,QAAI;AAEJ,QAAI,mCAAS,aAAa;AACxB,aAAO;AAAA,gCACmB,GAAG;AAAA;AAAA,IAE/B;AAEA,QAAI;AACF,iBAAW,MAAM,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AMA;AAAA,EAAX,SAAS;AAAA,GAzDS,QAyDP;AAGiB;AAAA,EAA5B,SAAS,EAAE,SAAS,KAAK,CAAC;AAAA,GA5DR,QA4DU;AAiC7B;AAAA,EADC,MAAM,OAAO;AAAA,GA5FK,QA6FnB;AAeM;AAAA,EADL,MAAM,CAAC,QAAQ,OAAO,SAAS,CAAC;AAAA,GA3Gd,QA4Gb;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/components/dropdown/dropdown.component.ts"],
|
|
4
|
-
"sourcesContent": ["// ---------------------------------------------------------------------\n// \uD83D\uDD12 AUTOGENERATED BY VENDORISM\n// Removing this comment will prevent it from being managed by it.\n// ---------------------------------------------------------------------\n\n/* eslint-disable */\nimport { animateTo, stopAnimations } from '../../internal/animate.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { getAnimation, setDefaultAnimation } from '../../utilities/animation-registry.js';\nimport { getTabbableBoundary } from '../../internal/tabbable.js';\nimport { html } from 'lit';\nimport { LocalizeController } from '../../utilities/localize.js';\nimport { property, query } from 'lit/decorators.js';\nimport { waitForEvent } from '../../internal/event.js';\nimport { watch } from '../../internal/watch.js';\nimport componentStyles from '../../styles/component.styles.js';\nimport SynergyElement from '../../internal/synergy-element.js';\nimport SynPopup from '../popup/popup.component.js';\nimport styles from './dropdown.styles.js';\nimport customStyles from './dropdown.custom.styles.js';\nimport type { CSSResultGroup } from 'lit';\nimport type { SynSelectEvent } from '../../events/syn-select.js';\nimport type SynButton from '../button/button.js';\nimport type SynIconButton from '../icon-button/icon-button.js';\nimport type SynMenu from '../menu/menu.js';\n\n/**\n * @summary Dropdowns expose additional content that \"drops down\" in a panel.\n * @documentation https://synergy.style/components/dropdown\n * @status stable\n * @since 2.0\n *\n * @dependency syn-popup\n *\n * @slot - The dropdown's main content.\n * @slot trigger - The dropdown's trigger, usually a `<syn-button>` element.\n *\n * @event syn-show - Emitted when the dropdown opens.\n * @event syn-after-show - Emitted after the dropdown opens and all animations are complete.\n * @event syn-hide - Emitted when the dropdown closes.\n * @event syn-after-hide - Emitted after the dropdown closes and all animations are complete.\n *\n * @csspart base - The component's base wrapper.\n * @csspart trigger - The container that wraps the trigger.\n * @csspart panel - The panel that gets shown when the dropdown is open.\n *\n * @animation dropdown.show - The animation to use when showing the dropdown.\n * @animation dropdown.hide - The animation to use when hiding the dropdown.\n */\nexport default class SynDropdown extends SynergyElement {\n static styles: CSSResultGroup = [componentStyles, styles, customStyles];\n static dependencies = { 'syn-popup': SynPopup };\n\n @query('.dropdown') popup: SynPopup;\n @query('.dropdown__trigger') trigger: HTMLSlotElement;\n @query('.dropdown__panel') panel: HTMLSlotElement;\n\n private readonly localize = new LocalizeController(this);\n private closeWatcher: CloseWatcher | null;\n\n /**\n * Indicates whether or not the dropdown is open. You can toggle this attribute to show and hide the dropdown, or you\n * can use the `show()` and `hide()` methods and this attribute will reflect the dropdown's open state.\n */\n @property({ type: Boolean, reflect: true }) open = false;\n\n /**\n * The preferred placement of the dropdown panel. Note that the actual placement may vary as needed to keep the panel\n * inside of the viewport.\n */\n @property({ reflect: true }) placement:\n | 'top'\n | 'top-start'\n | 'top-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'right'\n | 'right-start'\n | 'right-end'\n | 'left'\n | 'left-start'\n | 'left-end' = 'bottom-start';\n\n /** Disables the dropdown so the panel will not open. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /**\n * By default, the dropdown is closed when an item is selected. This attribute will keep it open instead. Useful for\n * dropdowns that allow for multiple interactions.\n */\n @property({ attribute: 'stay-open-on-select', type: Boolean, reflect: true }) stayOpenOnSelect = false;\n\n /**\n * The dropdown will close when the user interacts outside of this element (e.g. clicking). Useful for composing other\n * components that use a dropdown internally.\n */\n @property({ attribute: false }) containingElement?: HTMLElement;\n\n /** The distance in pixels from which to offset the panel away from its trigger. */\n @property({ type: Number }) distance = 0;\n\n /** The distance in pixels from which to offset the panel along its trigger. */\n @property({ type: Number }) skidding = 0;\n\n /**\n * Enable this option to prevent the panel from being clipped when the component is placed inside a container with\n * `overflow: auto|scroll`. Hoisting uses a fixed positioning strategy that works in many, but not all, scenarios.\n */\n @property({ type: Boolean }) hoist = false;\n\n connectedCallback() {\n super.connectedCallback();\n\n if (!this.containingElement) {\n this.containingElement = this;\n }\n }\n\n firstUpdated() {\n this.panel.hidden = !this.open;\n\n // If the dropdown is visible on init, update its position\n if (this.open) {\n this.addOpenListeners();\n this.popup.active = true;\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeOpenListeners();\n this.hide();\n }\n\n focusOnTrigger() {\n const trigger = this.trigger.assignedElements({ flatten: true })[0] as HTMLElement | undefined;\n if (typeof trigger?.focus === 'function') {\n trigger.focus();\n }\n }\n\n getMenu() {\n return this.panel.assignedElements({ flatten: true }).find(el => el.tagName.toLowerCase() === 'syn-menu') as\n | SynMenu\n | undefined;\n }\n\n private handleKeyDown = (event: KeyboardEvent) => {\n // Close when escape is pressed inside an open dropdown. We need to listen on the panel itself and stop propagation\n // in case any ancestors are also listening for this key.\n if (this.open && event.key === 'Escape') {\n event.stopPropagation();\n this.hide();\n this.focusOnTrigger();\n }\n };\n\n private handleDocumentKeyDown = (event: KeyboardEvent) => {\n // Close when escape or tab is pressed\n if (event.key === 'Escape' && this.open && !this.closeWatcher) {\n event.stopPropagation();\n this.focusOnTrigger();\n this.hide();\n return;\n }\n\n // Handle tabbing\n if (event.key === 'Tab') {\n // Tabbing within an open menu should close the dropdown and refocus the trigger\n if (this.open && document.activeElement?.tagName.toLowerCase() === 'syn-menu-item') {\n event.preventDefault();\n this.hide();\n this.focusOnTrigger();\n return;\n }\n\n // Tabbing outside of the containing element closes the panel\n //\n // If the dropdown is used within a shadow DOM, we need to obtain the activeElement within that shadowRoot,\n // otherwise `document.activeElement` will only return the name of the parent shadow DOM element.\n setTimeout(() => {\n const activeElement =\n this.containingElement?.getRootNode() instanceof ShadowRoot\n ? document.activeElement?.shadowRoot?.activeElement\n : document.activeElement;\n\n if (\n !this.containingElement ||\n activeElement?.closest(this.containingElement.tagName.toLowerCase()) !== this.containingElement\n ) {\n this.hide();\n }\n });\n }\n };\n\n private handleDocumentMouseDown = (event: MouseEvent) => {\n // Close when clicking outside of the containing element\n const path = event.composedPath();\n if (this.containingElement && !path.includes(this.containingElement)) {\n this.hide();\n }\n };\n\n private handlePanelSelect = (event: SynSelectEvent) => {\n const target = event.target as HTMLElement;\n\n // Hide the dropdown when a menu item is selected\n if (!this.stayOpenOnSelect && target.tagName.toLowerCase() === 'syn-menu') {\n this.hide();\n this.focusOnTrigger();\n }\n };\n\n handleTriggerClick() {\n if (this.open) {\n this.hide();\n } else {\n this.show();\n this.focusOnTrigger();\n }\n }\n\n async handleTriggerKeyDown(event: KeyboardEvent) {\n // When spacebar/enter is pressed, show the panel but don't focus on the menu. This let's the user press the same\n // key again to hide the menu in case they don't want to make a selection.\n if ([' ', 'Enter'].includes(event.key)) {\n event.preventDefault();\n this.handleTriggerClick();\n return;\n }\n\n const menu = this.getMenu();\n\n if (menu) {\n const menuItems = menu.getAllItems();\n const firstMenuItem = menuItems[0];\n const lastMenuItem = menuItems[menuItems.length - 1];\n\n // When up/down is pressed, we make the assumption that the user is familiar with the menu and plans to make a\n // selection. Rather than toggle the panel, we focus on the menu (if one exists) and activate the first item for\n // faster navigation.\n if (['ArrowDown', 'ArrowUp', 'Home', 'End'].includes(event.key)) {\n event.preventDefault();\n\n // Show the menu if it's not already open\n if (!this.open) {\n this.show();\n\n // Wait for the dropdown to open before focusing, but not the animation\n await this.updateComplete;\n }\n\n if (menuItems.length > 0) {\n // Focus on the first/last menu item after showing\n this.updateComplete.then(() => {\n if (event.key === 'ArrowDown' || event.key === 'Home') {\n menu.setCurrentItem(firstMenuItem);\n firstMenuItem.focus();\n }\n\n if (event.key === 'ArrowUp' || event.key === 'End') {\n menu.setCurrentItem(lastMenuItem);\n lastMenuItem.focus();\n }\n });\n }\n }\n }\n }\n\n handleTriggerKeyUp(event: KeyboardEvent) {\n // Prevent space from triggering a click event in Firefox\n if (event.key === ' ') {\n event.preventDefault();\n }\n }\n\n handleTriggerSlotChange() {\n this.updateAccessibleTrigger();\n }\n\n //\n // Slotted triggers can be arbitrary content, but we need to link them to the dropdown panel with `aria-haspopup` and\n // `aria-expanded`. These must be applied to the \"accessible trigger\" (the tabbable portion of the trigger element\n // that gets slotted in) so screen readers will understand them. The accessible trigger could be the slotted element,\n // a child of the slotted element, or an element in the slotted element's shadow root.\n //\n // For example, the accessible trigger of an <syn-button> is a <button> located inside its shadow root.\n //\n // To determine this, we assume the first tabbable element in the trigger slot is the \"accessible trigger.\"\n //\n updateAccessibleTrigger() {\n const assignedElements = this.trigger.assignedElements({ flatten: true }) as HTMLElement[];\n const accessibleTrigger = assignedElements.find(el => getTabbableBoundary(el).start);\n let target: HTMLElement;\n\n if (accessibleTrigger) {\n switch (accessibleTrigger.tagName.toLowerCase()) {\n // Synergy buttons have to update the internal button so it's announced correctly by screen readers\n case 'syn-button':\n case 'syn-icon-button':\n target = (accessibleTrigger as SynButton | SynIconButton).button;\n break;\n\n default:\n target = accessibleTrigger;\n }\n\n target.setAttribute('aria-haspopup', 'true');\n target.setAttribute('aria-expanded', this.open ? 'true' : 'false');\n }\n }\n\n /** Shows the dropdown panel. */\n async show() {\n if (this.open) {\n return undefined;\n }\n\n this.open = true;\n return waitForEvent(this, 'syn-after-show');\n }\n\n /** Hides the dropdown panel */\n async hide() {\n if (!this.open) {\n return undefined;\n }\n\n this.open = false;\n return waitForEvent(this, 'syn-after-hide');\n }\n\n /**\n * Instructs the dropdown menu to reposition. Useful when the position or size of the trigger changes when the menu\n * is activated.\n */\n reposition() {\n this.popup.reposition();\n }\n\n addOpenListeners() {\n this.panel.addEventListener('syn-select', this.handlePanelSelect);\n if ('CloseWatcher' in window) {\n this.closeWatcher?.destroy();\n this.closeWatcher = new CloseWatcher();\n this.closeWatcher.onclose = () => {\n this.hide();\n this.focusOnTrigger();\n };\n } else {\n this.panel.addEventListener('keydown', this.handleKeyDown);\n }\n document.addEventListener('keydown', this.handleDocumentKeyDown);\n document.addEventListener('mousedown', this.handleDocumentMouseDown);\n }\n\n removeOpenListeners() {\n if (this.panel) {\n this.panel.removeEventListener('syn-select', this.handlePanelSelect);\n this.panel.removeEventListener('keydown', this.handleKeyDown);\n }\n document.removeEventListener('keydown', this.handleDocumentKeyDown);\n document.removeEventListener('mousedown', this.handleDocumentMouseDown);\n this.closeWatcher?.destroy();\n }\n\n @watch('open', { waitUntilFirstUpdate: true })\n async handleOpenChange() {\n if (this.disabled) {\n this.open = false;\n return;\n }\n\n this.updateAccessibleTrigger();\n\n if (this.open) {\n // Show\n this.emit('syn-show');\n this.addOpenListeners();\n\n await stopAnimations(this);\n this.panel.hidden = false;\n this.popup.active = true;\n const { keyframes, options } = getAnimation(this, 'dropdown.show', { dir: this.localize.dir() });\n await animateTo(this.popup.popup, keyframes, options);\n\n this.emit('syn-after-show');\n } else {\n // Hide\n this.emit('syn-hide');\n this.removeOpenListeners();\n\n await stopAnimations(this);\n const { keyframes, options } = getAnimation(this, 'dropdown.hide', { dir: this.localize.dir() });\n await animateTo(this.popup.popup, keyframes, options);\n this.panel.hidden = true;\n this.popup.active = false;\n\n this.emit('syn-after-hide');\n }\n }\n\n render() {\n return html`\n <syn-popup\n part=\"base\"\n id=\"dropdown\"\n placement=${this.placement}\n distance=${this.distance}\n skidding=${this.skidding}\n strategy=${this.hoist ? 'fixed' : 'absolute'}\n flip\n shift\n auto-size=\"vertical\"\n auto-size-padding=\"10\"\n class=${classMap({\n dropdown: true,\n 'dropdown--open': this.open\n })}\n >\n <slot\n name=\"trigger\"\n slot=\"anchor\"\n part=\"trigger\"\n class=\"dropdown__trigger\"\n @click=${this.handleTriggerClick}\n @keydown=${this.handleTriggerKeyDown}\n @keyup=${this.handleTriggerKeyUp}\n @slotchange=${this.handleTriggerSlotChange}\n ></slot>\n\n <div aria-hidden=${this.open ? 'false' : 'true'} aria-labelledby=\"dropdown\">\n <slot part=\"panel\" class=\"dropdown__panel\"></slot>\n </div>\n </syn-popup>\n `;\n }\n}\n\nsetDefaultAnimation('dropdown.show', {\n keyframes: [\n { opacity: 0, scale: 0.9 },\n { opacity: 1, scale: 1 }\n ],\n options: { duration: 100, easing: 'ease' }\n});\n\nsetDefaultAnimation('dropdown.hide', {\n keyframes: [\n { opacity: 1, scale: 1 },\n { opacity: 0, scale: 0.9 }\n ],\n options: { duration: 100, easing: 'ease' }\n});\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,SAAS,gBAAgB;AAGzB,SAAS,YAAY;AAErB,SAAS,UAAU,aAAa;AAqChC,IAAqB,cAArB,cAAyC,eAAe;AAAA,EAAxD;AAAA;AAQE,SAAiB,WAAW,IAAI,mBAAmB,IAAI;AAOX,gBAAO;AAMtB,qBAYZ;AAG2B,oBAAW;AAMuB,4BAAmB;AASrE,oBAAW;AAGX,oBAAW;AAMV,iBAAQ;AAuCrC,SAAQ,gBAAgB,CAAC,UAAyB;AAGhD,UAAI,KAAK,QAAQ,MAAM,QAAQ,UAAU;AACvC,cAAM,gBAAgB;AACtB,aAAK,KAAK;AACV,aAAK,eAAe;AAAA,MACtB;AAAA,IACF;AAEA,SAAQ,wBAAwB,CAAC,UAAyB;AA9J5D;AAgKI,UAAI,MAAM,QAAQ,YAAY,KAAK,QAAQ,CAAC,KAAK,cAAc;AAC7D,cAAM,gBAAgB;AACtB,aAAK,eAAe;AACpB,aAAK,KAAK;AACV;AAAA,MACF;AAGA,UAAI,MAAM,QAAQ,OAAO;AAEvB,YAAI,KAAK,UAAQ,cAAS,kBAAT,mBAAwB,QAAQ,mBAAkB,iBAAiB;AAClF,gBAAM,eAAe;AACrB,eAAK,KAAK;AACV,eAAK,eAAe;AACpB;AAAA,QACF;AAMA,mBAAW,MAAM;AArLvB,cAAAA,KAAA;AAs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,YAiUb;AAwER,oBAAoB,iBAAiB;AAAA,EACnC,WAAW;AAAA,IACT,EAAE,SAAS,GAAG,OAAO,IAAI;AAAA,IACzB,EAAE,SAAS,GAAG,OAAO,EAAE;AAAA,EACzB;AAAA,EACA,SAAS,EAAE,UAAU,KAAK,QAAQ,OAAO;AAC3C,CAAC;AAED,oBAAoB,iBAAiB;AAAA,EACnC,WAAW;AAAA,IACT,EAAE,SAAS,GAAG,OAAO,EAAE;AAAA,IACvB,EAAE,SAAS,GAAG,OAAO,IAAI;AAAA,EAC3B;AAAA,EACA,SAAS,EAAE,UAAU,KAAK,QAAQ,OAAO;AAC3C,CAAC;",
|
|
6
|
-
"names": ["_a"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/components/select/select.component.ts"],
|
|
4
|
-
"sourcesContent": ["// ---------------------------------------------------------------------\n// \uD83D\uDD12 AUTOGENERATED BY VENDORISM\n// Removing this comment will prevent it from being managed by it.\n// ---------------------------------------------------------------------\n\n/* eslint-disable */\nimport { animateTo, stopAnimations } from '../../internal/animate.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { defaultValue } from '../../internal/default-value.js';\nimport { FormControlController } from '../../internal/form.js';\nimport { getAnimation, setDefaultAnimation } from '../../utilities/animation-registry.js';\nimport { HasSlotController } from '../../internal/slot.js';\nimport { html } from 'lit';\nimport { LocalizeController } from '../../utilities/localize.js';\nimport { property, query, state } from 'lit/decorators.js';\nimport { scrollIntoView } from '../../internal/scroll.js';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js';\nimport { waitForEvent } from '../../internal/event.js';\nimport { watch } from '../../internal/watch.js';\nimport componentStyles from '../../styles/component.styles.js';\nimport formControlStyles from '../../styles/form-control.styles.js';\nimport formControlCustomStyles from '../../styles/form-control.custom.styles.js';\nimport SynergyElement from '../../internal/synergy-element.js';\nimport SynIcon from '../icon/icon.component.js';\nimport SynPopup from '../popup/popup.component.js';\nimport SynTag from '../tag/tag.component.js';\nimport styles from './select.styles.js';\nimport customStyles from './select.custom.styles.js';\nimport type { CSSResultGroup, TemplateResult } from 'lit';\nimport type { SynergyFormControl } from '../../internal/synergy-element.js';\nimport type { SynRemoveEvent } from '../../events/syn-remove.js';\nimport type SynOption from '../option/option.component.js';\n\n/**\n * @summary Selects allow you to choose items from a menu of predefined options.\n * @documentation https://synergy.style/components/select\n * @status stable\n * @since 2.0\n *\n * @dependency syn-icon\n * @dependency syn-popup\n * @dependency syn-tag\n *\n * @slot - The listbox options. Must be `<syn-option>` elements. You can use `<syn-divider>` to group items visually.\n * @slot label - The input's label. Alternatively, you can use the `label` attribute.\n * @slot prefix - Used to prepend a presentational icon or similar element to the combobox.\n * @slot clear-icon - An icon to use in lieu of the default clear icon.\n * @slot expand-icon - The icon to show when the control is expanded and collapsed. Rotates on open and close.\n * @slot help-text - Text that describes how to use the input. Alternatively, you can use the `help-text` attribute.\n *\n * @event syn-change - Emitted when the control's value changes.\n * @event syn-clear - Emitted when the control's value is cleared.\n * @event syn-input - Emitted when the control receives input.\n * @event syn-focus - Emitted when the control gains focus.\n * @event syn-blur - Emitted when the control loses focus.\n * @event syn-show - Emitted when the select's menu opens.\n * @event syn-after-show - Emitted after the select's menu opens and all animations are complete.\n * @event syn-hide - Emitted when the select's menu closes.\n * @event syn-after-hide - Emitted after the select's menu closes and all animations are complete.\n * @event syn-invalid - Emitted when the form control has been checked for validity and its constraints aren't satisfied.\n *\n * @csspart form-control - The form control that wraps the label, input, and help text.\n * @csspart form-control-label - The label's wrapper.\n * @csspart form-control-input - The select's wrapper.\n * @csspart form-control-help-text - The help text's wrapper.\n * @csspart combobox - The container the wraps the prefix, combobox, clear icon, and expand button.\n * @csspart prefix - The container that wraps the prefix slot.\n * @csspart display-input - The element that displays the selected option's label, an `<input>` element.\n * @csspart listbox - The listbox container where options are slotted.\n * @csspart tags - The container that houses option tags when `multiselect` is used.\n * @csspart tag - The individual tags that represent each multiselect option.\n * @csspart tag__base - The tag's base part.\n * @csspart tag__content - The tag's content part.\n * @csspart tag__remove-button - The tag's remove button.\n * @csspart tag__remove-button__base - The tag's remove button base part.\n * @csspart clear-button - The clear button.\n * @csspart expand-icon - The container that wraps the expand icon.\n */\nexport default class SynSelect extends SynergyElement implements SynergyFormControl {\n static styles: CSSResultGroup = [componentStyles, formControlStyles, styles, formControlCustomStyles, customStyles];\n static dependencies = {\n 'syn-icon': SynIcon,\n 'syn-popup': SynPopup,\n 'syn-tag': SynTag\n };\n\n private readonly formControlController = new FormControlController(this, {\n assumeInteractionOn: ['syn-blur', 'syn-input']\n });\n private readonly hasSlotController = new HasSlotController(this, 'help-text', 'label');\n private readonly localize = new LocalizeController(this);\n private typeToSelectString = '';\n private typeToSelectTimeout: number;\n private closeWatcher: CloseWatcher | null;\n\n @query('.select') popup: SynPopup;\n @query('.select__combobox') combobox: HTMLSlotElement;\n @query('.select__display-input') displayInput: HTMLInputElement;\n @query('.select__value-input') valueInput: HTMLInputElement;\n @query('.select__listbox') listbox: HTMLSlotElement;\n\n @state() private hasFocus = false;\n @state() displayLabel = '';\n @state() currentOption: SynOption;\n @state() selectedOptions: SynOption[] = [];\n\n /** The name of the select, submitted as a name/value pair with form data. */\n @property() name = '';\n\n /**\n * The current value of the select, submitted as a name/value pair with form data. When `multiple` is enabled, the\n * value attribute will be a space-delimited list of values based on the options selected, and the value property will\n * be an array. **For this reason, values must not contain spaces.**\n */\n @property({\n converter: {\n fromAttribute: (value: string) => value.split(' '),\n toAttribute: (value: string[]) => value.join(' ')\n }\n })\n value: string | string[] = '';\n\n /** The default value of the form control. Primarily used for resetting the form control. */\n @defaultValue() defaultValue: string | string[] = '';\n\n /** The select's size. */\n @property({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium';\n\n /** Placeholder text to show as a hint when the select is empty. */\n @property() placeholder = '';\n\n /** Allows more than one option to be selected. */\n @property({ type: Boolean, reflect: true }) multiple = false;\n\n /**\n * The maximum number of selected options to show when `multiple` is true. After the maximum, \"+n\" will be shown to\n * indicate the number of additional items that are selected. Set to 0 to remove the limit.\n */\n @property({ attribute: 'max-options-visible', type: Number }) maxOptionsVisible = 3;\n\n /** Disables the select control. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** Adds a clear button when the select is not empty. */\n @property({ type: Boolean }) clearable = false;\n\n /**\n * Indicates whether or not the select is open. You can toggle this attribute to show and hide the menu, or you can\n * use the `show()` and `hide()` methods and this attribute will reflect the select's open state.\n */\n @property({ type: Boolean, reflect: true }) open = false;\n\n /**\n * Enable this option to prevent the listbox from being clipped when the component is placed inside a container with\n * `overflow: auto|scroll`. Hoisting uses a fixed positioning strategy that works in many, but not all, scenarios.\n */\n @property({ type: Boolean }) hoist = false;\n\n /** The select's label. If you need to display HTML, use the `label` slot instead. */\n @property() label = '';\n\n /**\n * The preferred placement of the select's menu. Note that the actual placement may vary as needed to keep the listbox\n * inside of the viewport.\n */\n @property({ reflect: true }) placement: 'top' | 'bottom' = 'bottom';\n\n /** The select's help text. If you need to display HTML, use the `help-text` slot instead. */\n @property({ attribute: 'help-text' }) helpText = '';\n\n /**\n * By default, form controls are associated with the nearest containing `<form>` element. This attribute allows you\n * to place the form control outside of a form and associate it with the form that has this `id`. The form must be in\n * the same document or shadow root for this to work.\n */\n @property({ reflect: true }) form = '';\n\n /** The select's required attribute. */\n @property({ type: Boolean, reflect: true }) required = false;\n\n /**\n * A function that customizes the tags to be rendered when multiple=true. The first argument is the option, the second\n * is the current tag's index. The function should return either a Lit TemplateResult or a string containing trusted HTML of the symbol to render at\n * the specified value.\n */\n @property() getTag: (option: SynOption, index: number) => TemplateResult | string | HTMLElement = option => {\n return html`\n <syn-tag\n part=\"tag\"\n exportparts=\"\n base:tag__base,\n content:tag__content,\n remove-button:tag__remove-button,\n remove-button__base:tag__remove-button__base\n \"\n size=${this.size}\n removable\n @syn-remove=${(event: SynRemoveEvent) => this.handleTagRemove(event, option)}\n >\n ${option.getTextLabel()}\n </syn-tag>\n `;\n };\n\n /** Gets the validity state object */\n get validity() {\n return this.valueInput.validity;\n }\n\n /** Gets the validation message */\n get validationMessage() {\n return this.valueInput.validationMessage;\n }\n\n connectedCallback() {\n super.connectedCallback();\n\n // Because this is a form control, it shouldn't be opened initially\n this.open = false;\n }\n\n private addOpenListeners() {\n //\n // Listen on the root node instead of the document in case the elements are inside a shadow root\n //\n // https://github.com/synergy-design-system/synergy/issues/1763\n //\n const root = this.getRootNode();\n if ('CloseWatcher' in window) {\n this.closeWatcher?.destroy();\n this.closeWatcher = new CloseWatcher();\n this.closeWatcher.onclose = () => {\n if (this.open) {\n this.hide();\n this.displayInput.focus({ preventScroll: true });\n }\n };\n }\n root.addEventListener('focusin', this.handleDocumentFocusIn);\n root.addEventListener('keydown', this.handleDocumentKeyDown);\n root.addEventListener('mousedown', this.handleDocumentMouseDown);\n }\n\n private removeOpenListeners() {\n const root = this.getRootNode();\n root.removeEventListener('focusin', this.handleDocumentFocusIn);\n root.removeEventListener('keydown', this.handleDocumentKeyDown);\n root.removeEventListener('mousedown', this.handleDocumentMouseDown);\n this.closeWatcher?.destroy();\n }\n\n private handleFocus() {\n this.hasFocus = true;\n this.displayInput.setSelectionRange(0, 0);\n this.emit('syn-focus');\n }\n\n private handleBlur() {\n this.hasFocus = false;\n this.emit('syn-blur');\n }\n\n private handleDocumentFocusIn = (event: KeyboardEvent) => {\n // Close when focusing out of the select\n const path = event.composedPath();\n if (this && !path.includes(this)) {\n this.hide();\n }\n };\n\n private handleDocumentKeyDown = (event: KeyboardEvent) => {\n const target = event.target as HTMLElement;\n const isClearButton = target.closest('.select__clear') !== null;\n const isIconButton = target.closest('syn-icon-button') !== null;\n\n // Ignore presses when the target is an icon button (e.g. the remove button in <syn-tag>)\n if (isClearButton || isIconButton) {\n return;\n }\n\n // Close when pressing escape\n if (event.key === 'Escape' && this.open && !this.closeWatcher) {\n event.preventDefault();\n event.stopPropagation();\n this.hide();\n this.displayInput.focus({ preventScroll: true });\n }\n\n // Handle enter and space. When pressing space, we allow for type to select behaviors so if there's anything in the\n // buffer we _don't_ close it.\n if (event.key === 'Enter' || (event.key === ' ' && this.typeToSelectString === '')) {\n event.preventDefault();\n event.stopImmediatePropagation();\n\n // If it's not open, open it\n if (!this.open) {\n this.show();\n return;\n }\n\n // If it is open, update the value based on the current selection and close it\n if (this.currentOption && !this.currentOption.disabled) {\n if (this.multiple) {\n this.toggleOptionSelection(this.currentOption);\n } else {\n this.setSelectedOptions(this.currentOption);\n }\n\n // Emit after updating\n this.updateComplete.then(() => {\n this.emit('syn-input');\n this.emit('syn-change');\n });\n\n if (!this.multiple) {\n this.hide();\n this.displayInput.focus({ preventScroll: true });\n }\n }\n\n return;\n }\n\n // Navigate options\n if (['ArrowUp', 'ArrowDown', 'Home', 'End'].includes(event.key)) {\n const allOptions = this.getAllOptions();\n const currentIndex = allOptions.indexOf(this.currentOption);\n let newIndex = Math.max(0, currentIndex);\n\n // Prevent scrolling\n event.preventDefault();\n\n // Open it\n if (!this.open) {\n this.show();\n\n // If an option is already selected, stop here because we want that one to remain highlighted when the listbox\n // opens for the first time\n if (this.currentOption) {\n return;\n }\n }\n\n if (event.key === 'ArrowDown') {\n newIndex = currentIndex + 1;\n if (newIndex > allOptions.length - 1) newIndex = 0;\n } else if (event.key === 'ArrowUp') {\n newIndex = currentIndex - 1;\n if (newIndex < 0) newIndex = allOptions.length - 1;\n } else if (event.key === 'Home') {\n newIndex = 0;\n } else if (event.key === 'End') {\n newIndex = allOptions.length - 1;\n }\n\n this.setCurrentOption(allOptions[newIndex]);\n }\n\n // All other \"printable\" keys trigger type to select\n if (event.key.length === 1 || event.key === 'Backspace') {\n const allOptions = this.getAllOptions();\n\n // Don't block important key combos like CMD+R\n if (event.metaKey || event.ctrlKey || event.altKey) {\n return;\n }\n\n // Open, unless the key that triggered is backspace\n if (!this.open) {\n if (event.key === 'Backspace') {\n return;\n }\n\n this.show();\n }\n\n event.stopPropagation();\n event.preventDefault();\n\n clearTimeout(this.typeToSelectTimeout);\n this.typeToSelectTimeout = window.setTimeout(() => (this.typeToSelectString = ''), 1000);\n\n if (event.key === 'Backspace') {\n this.typeToSelectString = this.typeToSelectString.slice(0, -1);\n } else {\n this.typeToSelectString += event.key.toLowerCase();\n }\n\n for (const option of allOptions) {\n const label = option.getTextLabel().toLowerCase();\n\n if (label.startsWith(this.typeToSelectString)) {\n this.setCurrentOption(option);\n break;\n }\n }\n }\n };\n\n private handleDocumentMouseDown = (event: MouseEvent) => {\n // Close when clicking outside of the select\n const path = event.composedPath();\n if (this && !path.includes(this)) {\n this.hide();\n }\n };\n\n private handleLabelClick() {\n this.displayInput.focus();\n }\n\n private handleComboboxMouseDown(event: MouseEvent) {\n const path = event.composedPath();\n const isIconButton = path.some(el => el instanceof Element && el.tagName.toLowerCase() === 'syn-icon-button');\n\n // Ignore disabled controls and clicks on tags (remove buttons)\n if (this.disabled || isIconButton) {\n return;\n }\n\n event.preventDefault();\n this.displayInput.focus({ preventScroll: true });\n this.open = !this.open;\n }\n\n private handleComboboxKeyDown(event: KeyboardEvent) {\n if (event.key === 'Tab') {\n return;\n }\n\n event.stopPropagation();\n this.handleDocumentKeyDown(event);\n }\n\n private handleClearClick(event: MouseEvent) {\n event.stopPropagation();\n\n if (this.value !== '') {\n this.setSelectedOptions([]);\n this.displayInput.focus({ preventScroll: true });\n\n // Emit after update\n this.updateComplete.then(() => {\n this.emit('syn-clear');\n this.emit('syn-input');\n this.emit('syn-change');\n });\n }\n }\n\n private handleClearMouseDown(event: MouseEvent) {\n // Don't lose focus or propagate events when clicking the clear button\n event.stopPropagation();\n event.preventDefault();\n }\n\n private handleOptionClick(event: MouseEvent) {\n const target = event.target as HTMLElement;\n const option = target.closest('syn-option');\n const oldValue = this.value;\n\n if (option && !option.disabled) {\n if (this.multiple) {\n this.toggleOptionSelection(option);\n } else {\n this.setSelectedOptions(option);\n }\n\n // Set focus after updating so the value is announced by screen readers\n this.updateComplete.then(() => this.displayInput.focus({ preventScroll: true }));\n\n if (this.value !== oldValue) {\n // Emit after updating\n this.updateComplete.then(() => {\n this.emit('syn-input');\n this.emit('syn-change');\n });\n }\n\n if (!this.multiple) {\n this.hide();\n this.displayInput.focus({ preventScroll: true });\n }\n }\n }\n\n private handleDefaultSlotChange() {\n const allOptions = this.getAllOptions();\n const value = Array.isArray(this.value) ? this.value : [this.value];\n const values: string[] = [];\n\n // Check for duplicate values in menu items\n if (customElements.get('syn-option')) {\n allOptions.forEach(option => values.push(option.value));\n\n // Select only the options that match the new value\n this.setSelectedOptions(allOptions.filter(el => value.includes(el.value)));\n } else {\n // Rerun this handler when <syn-option> is registered\n customElements.whenDefined('syn-option').then(() => this.handleDefaultSlotChange());\n }\n }\n\n private handleTagRemove(event: SynRemoveEvent, option: SynOption) {\n event.stopPropagation();\n\n if (!this.disabled) {\n this.toggleOptionSelection(option, false);\n\n // Emit after updating\n this.updateComplete.then(() => {\n this.emit('syn-input');\n this.emit('syn-change');\n });\n }\n }\n\n // Gets an array of all <syn-option> elements\n private getAllOptions() {\n return [...this.querySelectorAll<SynOption>('syn-option')];\n }\n\n // Gets the first <syn-option> element\n private getFirstOption() {\n return this.querySelector<SynOption>('syn-option');\n }\n\n // Sets the current option, which is the option the user is currently interacting with (e.g. via keyboard). Only one\n // option may be \"current\" at a time.\n private setCurrentOption(option: SynOption | null) {\n const allOptions = this.getAllOptions();\n\n // Clear selection\n allOptions.forEach(el => {\n el.current = false;\n el.tabIndex = -1;\n });\n\n // Select the target option\n if (option) {\n this.currentOption = option;\n option.current = true;\n option.tabIndex = 0;\n option.focus();\n }\n }\n\n // Sets the selected option(s)\n private setSelectedOptions(option: SynOption | SynOption[]) {\n const allOptions = this.getAllOptions();\n const newSelectedOptions = Array.isArray(option) ? option : [option];\n\n // Clear existing selection\n allOptions.forEach(el => (el.selected = false));\n\n // Set the new selection\n if (newSelectedOptions.length) {\n newSelectedOptions.forEach(el => (el.selected = true));\n }\n\n // Update selection, value, and display label\n this.selectionChanged();\n }\n\n // Toggles an option's selected state\n private toggleOptionSelection(option: SynOption, force?: boolean) {\n if (force === true || force === false) {\n option.selected = force;\n } else {\n option.selected = !option.selected;\n }\n\n this.selectionChanged();\n }\n\n // This method must be called whenever the selection changes. It will update the selected options cache, the current\n // value, and the display value\n private selectionChanged() {\n // Update selected options cache\n this.selectedOptions = this.getAllOptions().filter(el => el.selected);\n\n // Update the value and display label\n if (this.multiple) {\n this.value = this.selectedOptions.map(el => el.value);\n\n if (this.placeholder && this.value.length === 0) {\n // When no items are selected, keep the value empty so the placeholder shows\n this.displayLabel = '';\n } else {\n this.displayLabel = this.localize.term('numOptionsSelected', this.selectedOptions.length);\n }\n } else {\n this.value = this.selectedOptions[0]?.value ?? '';\n this.displayLabel = this.selectedOptions[0]?.getTextLabel() ?? '';\n }\n\n // Update validity\n this.updateComplete.then(() => {\n this.formControlController.updateValidity();\n });\n }\n protected get tags() {\n return this.selectedOptions.map((option, index) => {\n if (index < this.maxOptionsVisible || this.maxOptionsVisible <= 0) {\n const tag = this.getTag(option, index);\n // Wrap so we can handle the remove\n return html`<div @syn-remove=${(e: SynRemoveEvent) => this.handleTagRemove(e, option)}>\n ${typeof tag === 'string' ? unsafeHTML(tag) : tag}\n </div>`;\n } else if (index === this.maxOptionsVisible) {\n // Hit tag limit\n return html`<syn-tag>+${this.selectedOptions.length - index}</syn-tag>`;\n }\n return html``;\n });\n }\n\n private handleInvalid(event: Event) {\n this.formControlController.setValidity(false);\n this.formControlController.emitInvalidEvent(event);\n }\n\n @watch('disabled', { waitUntilFirstUpdate: true })\n handleDisabledChange() {\n // Close the listbox when the control is disabled\n if (this.disabled) {\n this.open = false;\n this.handleOpenChange();\n }\n }\n\n @watch('value', { waitUntilFirstUpdate: true })\n handleValueChange() {\n const allOptions = this.getAllOptions();\n const value = Array.isArray(this.value) ? this.value : [this.value];\n\n // Select only the options that match the new value\n this.setSelectedOptions(allOptions.filter(el => value.includes(el.value)));\n }\n\n @watch('open', { waitUntilFirstUpdate: true })\n async handleOpenChange() {\n if (this.open && !this.disabled) {\n // Reset the current option\n this.setCurrentOption(this.selectedOptions[0] || this.getFirstOption());\n\n // Show\n this.emit('syn-show');\n this.addOpenListeners();\n\n await stopAnimations(this);\n this.listbox.hidden = false;\n this.popup.active = true;\n\n // Select the appropriate option based on value after the listbox opens\n requestAnimationFrame(() => {\n this.setCurrentOption(this.currentOption);\n });\n\n const { keyframes, options } = getAnimation(this, 'select.show', { dir: this.localize.dir() });\n await animateTo(this.popup.popup, keyframes, options);\n\n // Make sure the current option is scrolled into view (required for Safari)\n if (this.currentOption) {\n scrollIntoView(this.currentOption, this.listbox, 'vertical', 'auto');\n }\n\n this.emit('syn-after-show');\n } else {\n // Hide\n this.emit('syn-hide');\n this.removeOpenListeners();\n\n await stopAnimations(this);\n const { keyframes, options } = getAnimation(this, 'select.hide', { dir: this.localize.dir() });\n await animateTo(this.popup.popup, keyframes, options);\n this.listbox.hidden = true;\n this.popup.active = false;\n\n this.emit('syn-after-hide');\n }\n }\n\n /** Shows the listbox. */\n async show() {\n if (this.open || this.disabled) {\n this.open = false;\n return undefined;\n }\n\n this.open = true;\n return waitForEvent(this, 'syn-after-show');\n }\n\n /** Hides the listbox. */\n async hide() {\n if (!this.open || this.disabled) {\n this.open = false;\n return undefined;\n }\n\n this.open = false;\n return waitForEvent(this, 'syn-after-hide');\n }\n\n /** Checks for validity but does not show a validation message. Returns `true` when valid and `false` when invalid. */\n checkValidity() {\n return this.valueInput.checkValidity();\n }\n\n /** Gets the associated form, if one exists. */\n getForm(): HTMLFormElement | null {\n return this.formControlController.getForm();\n }\n\n /** Checks for validity and shows the browser's validation message if the control is invalid. */\n reportValidity() {\n return this.valueInput.reportValidity();\n }\n\n /** Sets a custom validation message. Pass an empty string to restore validity. */\n setCustomValidity(message: string) {\n this.valueInput.setCustomValidity(message);\n this.formControlController.updateValidity();\n }\n\n /** Sets focus on the control. */\n focus(options?: FocusOptions) {\n this.displayInput.focus(options);\n }\n\n /** Removes focus from the control. */\n blur() {\n this.displayInput.blur();\n }\n\n render() {\n const hasLabelSlot = this.hasSlotController.test('label');\n const hasHelpTextSlot = this.hasSlotController.test('help-text');\n const hasLabel = this.label ? true : !!hasLabelSlot;\n const hasHelpText = this.helpText ? true : !!hasHelpTextSlot;\n const hasClearIcon = this.clearable && !this.disabled && this.value.length > 0;\n const isPlaceholderVisible = this.placeholder && this.value.length === 0;\n\n return html`\n <div\n part=\"form-control\"\n class=${classMap({\n 'form-control': true,\n 'form-control--small': this.size === 'small',\n 'form-control--medium': this.size === 'medium',\n 'form-control--large': this.size === 'large',\n 'form-control--has-label': hasLabel,\n 'form-control--has-help-text': hasHelpText\n })}\n >\n <label\n id=\"label\"\n part=\"form-control-label\"\n class=\"form-control__label\"\n aria-hidden=${hasLabel ? 'false' : 'true'}\n @click=${this.handleLabelClick}\n >\n <slot name=\"label\">${this.label}</slot>\n </label>\n\n <div part=\"form-control-input\" class=\"form-control-input\">\n <syn-popup\n class=${classMap({\n select: true,\n 'select--standard': true,\n 'select--open': this.open,\n 'select--disabled': this.disabled,\n 'select--multiple': this.multiple,\n 'select--focused': this.hasFocus,\n 'select--placeholder-visible': isPlaceholderVisible,\n 'select--top': this.placement === 'top',\n 'select--bottom': this.placement === 'bottom',\n 'select--small': this.size === 'small',\n 'select--medium': this.size === 'medium',\n 'select--large': this.size === 'large'\n })}\n placement=${this.placement}\n strategy=${this.hoist ? 'fixed' : 'absolute'}\n flip\n shift\n sync=\"width\"\n auto-size=\"vertical\"\n auto-size-padding=\"10\"\n >\n <div\n part=\"combobox\"\n class=\"select__combobox\"\n slot=\"anchor\"\n @keydown=${this.handleComboboxKeyDown}\n @mousedown=${this.handleComboboxMouseDown}\n >\n <slot part=\"prefix\" name=\"prefix\" class=\"select__prefix\"></slot>\n\n <input\n part=\"display-input\"\n class=\"select__display-input\"\n type=\"text\"\n placeholder=${this.placeholder}\n .disabled=${this.disabled}\n .value=${this.displayLabel}\n autocomplete=\"off\"\n spellcheck=\"false\"\n autocapitalize=\"off\"\n readonly\n aria-controls=\"listbox\"\n aria-expanded=${this.open ? 'true' : 'false'}\n aria-haspopup=\"listbox\"\n aria-labelledby=\"label\"\n aria-disabled=${this.disabled ? 'true' : 'false'}\n aria-describedby=\"help-text\"\n role=\"combobox\"\n tabindex=\"0\"\n @focus=${this.handleFocus}\n @blur=${this.handleBlur}\n />\n\n ${this.multiple ? html`<div part=\"tags\" class=\"select__tags\">${this.tags}</div>` : ''}\n\n <input\n class=\"select__value-input\"\n type=\"text\"\n ?disabled=${this.disabled}\n ?required=${this.required}\n .value=${Array.isArray(this.value) ? this.value.join(', ') : this.value}\n tabindex=\"-1\"\n aria-hidden=\"true\"\n @focus=${() => this.focus()}\n @invalid=${this.handleInvalid}\n />\n\n ${hasClearIcon\n ? html`\n <button\n part=\"clear-button\"\n class=\"select__clear\"\n type=\"button\"\n aria-label=${this.localize.term('clearEntry')}\n @mousedown=${this.handleClearMouseDown}\n @click=${this.handleClearClick}\n tabindex=\"-1\"\n >\n <slot name=\"clear-icon\">\n <syn-icon name=\"x-circle-fill\" library=\"system\"></syn-icon>\n </slot>\n </button>\n `\n : ''}\n\n <slot name=\"expand-icon\" part=\"expand-icon\" class=\"select__expand-icon\">\n <syn-icon library=\"system\" name=\"chevron-down\"></syn-icon>\n </slot>\n </div>\n\n <div\n id=\"listbox\"\n role=\"listbox\"\n aria-expanded=${this.open ? 'true' : 'false'}\n aria-multiselectable=${this.multiple ? 'true' : 'false'}\n aria-labelledby=\"label\"\n part=\"listbox\"\n class=\"select__listbox\"\n tabindex=\"-1\"\n @mouseup=${this.handleOptionClick}\n @slotchange=${this.handleDefaultSlotChange}\n >\n <slot></slot>\n </div>\n </syn-popup>\n </div>\n\n <div\n part=\"form-control-help-text\"\n id=\"help-text\"\n class=\"form-control__help-text\"\n aria-hidden=${hasHelpText ? 'false' : 'true'}\n >\n <slot name=\"help-text\">${this.helpText}</slot>\n </div>\n </div>\n `;\n }\n}\n\nsetDefaultAnimation('select.show', {\n keyframes: [\n { opacity: 0, scale: 0.9 },\n { opacity: 1, scale: 1 }\n ],\n options: { duration: 100, easing: 'ease' }\n});\n\nsetDefaultAnimation('select.hide', {\n keyframes: [\n { opacity: 1, scale: 1 },\n { opacity: 0, scale: 0.9 }\n ],\n options: { duration: 100, easing: 'ease' }\n});\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,SAAS,gBAAgB;AAKzB,SAAS,YAAY;AAErB,SAAS,UAAU,OAAO,aAAa;AAEvC,SAAS,kBAAkB;AA8D3B,IAAqB,YAArB,cAAuC,eAA6C;AAAA,EAApF;AAAA;AAQE,SAAiB,wBAAwB,IAAI,sBAAsB,MAAM;AAAA,MACvE,qBAAqB,CAAC,YAAY,WAAW;AAAA,IAC/C,CAAC;AACD,SAAiB,oBAAoB,IAAI,kBAAkB,MAAM,aAAa,OAAO;AACrF,SAAiB,WAAW,IAAI,mBAAmB,IAAI;AACvD,SAAQ,qBAAqB;AAUpB,SAAQ,WAAW;AACnB,wBAAe;AAEf,2BAA+B,CAAC;AAG7B,gBAAO;AAanB,iBAA2B;AAGX,wBAAkC;AAGrB,gBAAqC;AAGtD,uBAAc;AAGkB,oBAAW;AAMO,6BAAoB;AAGtC,oBAAW;AAG1B,qBAAY;AAMG,gBAAO;AAMtB,iBAAQ;AAGzB,iBAAQ;AAMS,qBAA8B;AAGrB,oBAAW;AAOpB,gBAAO;AAGQ,oBAAW;AAO3C,kBAAsF,YAAU;AAC1G,aAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eASI,KAAK,IAAI;AAAA;AAAA,sBAEF,CAAC,UAA0B,KAAK,gBAAgB,OAAO,MAAM,CAAC;AAAA;AAAA,UAE1E,OAAO,aAAa,CAAC;AAAA;AAAA;AAAA,IAG7B;AA4DA,SAAQ,wBAAwB,CAAC,UAAyB;AAExD,YAAM,OAAO,MAAM,aAAa;AAChC,U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AAG,OAAO,EAAE;AAAA,IACvB,EAAE,SAAS,GAAG,OAAO,IAAI;AAAA,EAC3B;AAAA,EACA,SAAS,EAAE,UAAU,KAAK,QAAQ,OAAO;AAC3C,CAAC;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/components/popup/popup.component.ts"],
|
|
4
|
-
"sourcesContent": ["// ---------------------------------------------------------------------\n// \uD83D\uDD12 AUTOGENERATED BY VENDORISM\n// Removing this comment will prevent it from being managed by it.\n// ---------------------------------------------------------------------\n\n/* eslint-disable */\nimport { arrow, autoUpdate, computePosition, flip, offset, platform, shift, size } from '@floating-ui/dom';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { html } from 'lit';\nimport { offsetParent } from 'composed-offset-position';\nimport { property, query } from 'lit/decorators.js';\nimport componentStyles from '../../styles/component.styles.js';\nimport SynergyElement from '../../internal/synergy-element.js';\nimport styles from './popup.styles.js';\nimport type { CSSResultGroup } from 'lit';\n\nexport interface VirtualElement {\n getBoundingClientRect: () => DOMRect;\n}\n\nfunction isVirtualElement(e: unknown): e is VirtualElement {\n return e !== null && typeof e === 'object' && 'getBoundingClientRect' in e;\n}\n\n/**\n * @summary Popup is a utility that lets you declaratively anchor \"popup\" containers to another element.\n * @documentation https://synergy.style/components/popup\n * @status stable\n * @since 2.0\n *\n * @event syn-reposition - Emitted when the popup is repositioned. This event can fire a lot, so avoid putting expensive\n * operations in your listener or consider debouncing it.\n *\n * @slot - The popup's content.\n * @slot anchor - The element the popup will be anchored to. If the anchor lives outside of the popup, you can use the\n * `anchor` attribute or property instead.\n *\n * @csspart arrow - The arrow's container. Avoid setting `top|bottom|left|right` properties, as these values are\n * assigned dynamically as the popup moves. This is most useful for applying a background color to match the popup, and\n * maybe a border or box shadow.\n * @csspart popup - The popup's container. Useful for setting a background color, box shadow, etc.\n * @csspart hover-bridge - The hover bridge element. Only available when the `hover-bridge` option is enabled.\n *\n * @cssproperty [--arrow-size=6px] - The size of the arrow. Note that an arrow won't be shown unless the `arrow`\n * attribute is used.\n * @cssproperty [--arrow-color=var(--syn-color-neutral-0)] - The color of the arrow.\n * @cssproperty [--auto-size-available-width] - A read-only custom property that determines the amount of width the\n * popup can be before overflowing. Useful for positioning child elements that need to overflow. This property is only\n * available when using `auto-size`.\n * @cssproperty [--auto-size-available-height] - A read-only custom property that determines the amount of height the\n * popup can be before overflowing. Useful for positioning child elements that need to overflow. This property is only\n * available when using `auto-size`.\n */\nexport default class SynPopup extends SynergyElement {\n static styles: CSSResultGroup = [componentStyles, styles];\n\n private anchorEl: Element | VirtualElement | null;\n private cleanup: ReturnType<typeof autoUpdate> | undefined;\n\n /** A reference to the internal popup container. Useful for animating and styling the popup with JavaScript. */\n @query('.popup') popup: HTMLElement;\n @query('.popup__arrow') private arrowEl: HTMLElement;\n\n /**\n * The element the popup will be anchored to. If the anchor lives outside of the popup, you can provide the anchor\n * element `id`, a DOM element reference, or a `VirtualElement`. If the anchor lives inside the popup, use the\n * `anchor` slot instead.\n */\n @property() anchor: Element | string | VirtualElement;\n\n /**\n * Activates the positioning logic and shows the popup. When this attribute is removed, the positioning logic is torn\n * down and the popup will be hidden.\n */\n @property({ type: Boolean, reflect: true }) active = false;\n\n /**\n * The preferred placement of the popup. Note that the actual placement will vary as configured to keep the\n * panel inside of the viewport.\n */\n @property({ reflect: true }) placement:\n | 'top'\n | 'top-start'\n | 'top-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'right'\n | 'right-start'\n | 'right-end'\n | 'left'\n | 'left-start'\n | 'left-end' = 'top';\n\n /**\n * Determines how the popup is positioned. The `absolute` strategy works well in most cases, but if overflow is\n * clipped, using a `fixed` position strategy can often workaround it.\n */\n @property({ reflect: true }) strategy: 'absolute' | 'fixed' = 'absolute';\n\n /** The distance in pixels from which to offset the panel away from its anchor. */\n @property({ type: Number }) distance = 0;\n\n /** The distance in pixels from which to offset the panel along its anchor. */\n @property({ type: Number }) skidding = 0;\n\n /**\n * Attaches an arrow to the popup. The arrow's size and color can be customized using the `--arrow-size` and\n * `--arrow-color` custom properties. For additional customizations, you can also target the arrow using\n * `::part(arrow)` in your stylesheet.\n */\n @property({ type: Boolean }) arrow = false;\n\n /**\n * The placement of the arrow. The default is `anchor`, which will align the arrow as close to the center of the\n * anchor as possible, considering available space and `arrow-padding`. A value of `start`, `end`, or `center` will\n * align the arrow to the start, end, or center of the popover instead.\n */\n @property({ attribute: 'arrow-placement' }) arrowPlacement: 'start' | 'end' | 'center' | 'anchor' = 'anchor';\n\n /**\n * The amount of padding between the arrow and the edges of the popup. If the popup has a border-radius, for example,\n * this will prevent it from overflowing the corners.\n */\n @property({ attribute: 'arrow-padding', type: Number }) arrowPadding = 10;\n\n /**\n * When set, placement of the popup will flip to the opposite site to keep it in view. You can use\n * `flipFallbackPlacements` to further configure how the fallback placement is determined.\n */\n @property({ type: Boolean }) flip = false;\n\n /**\n * If the preferred placement doesn't fit, popup will be tested in these fallback placements until one fits. Must be a\n * string of any number of placements separated by a space, e.g. \"top bottom left\". If no placement fits, the flip\n * fallback strategy will be used instead.\n * */\n @property({\n attribute: 'flip-fallback-placements',\n converter: {\n fromAttribute: (value: string) => {\n return value\n .split(' ')\n .map(p => p.trim())\n .filter(p => p !== '');\n },\n toAttribute: (value: []) => {\n return value.join(' ');\n }\n }\n })\n flipFallbackPlacements = '';\n\n /**\n * When neither the preferred placement nor the fallback placements fit, this value will be used to determine whether\n * the popup should be positioned using the best available fit based on available space or as it was initially\n * preferred.\n */\n @property({ attribute: 'flip-fallback-strategy' }) flipFallbackStrategy: 'best-fit' | 'initial' = 'best-fit';\n\n /**\n * The flip boundary describes clipping element(s) that overflow will be checked relative to when flipping. By\n * default, the boundary includes overflow ancestors that will cause the element to be clipped. If needed, you can\n * change the boundary by passing a reference to one or more elements to this property.\n */\n @property({ type: Object }) flipBoundary: Element | Element[];\n\n /** The amount of padding, in pixels, to exceed before the flip behavior will occur. */\n @property({ attribute: 'flip-padding', type: Number }) flipPadding = 0;\n\n /** Moves the popup along the axis to keep it in view when clipped. */\n @property({ type: Boolean }) shift = false;\n\n /**\n * The shift boundary describes clipping element(s) that overflow will be checked relative to when shifting. By\n * default, the boundary includes overflow ancestors that will cause the element to be clipped. If needed, you can\n * change the boundary by passing a reference to one or more elements to this property.\n */\n @property({ type: Object }) shiftBoundary: Element | Element[];\n\n /** The amount of padding, in pixels, to exceed before the shift behavior will occur. */\n @property({ attribute: 'shift-padding', type: Number }) shiftPadding = 0;\n\n /** When set, this will cause the popup to automatically resize itself to prevent it from overflowing. */\n @property({ attribute: 'auto-size' }) autoSize: 'horizontal' | 'vertical' | 'both';\n\n /** Syncs the popup's width or height to that of the anchor element. */\n @property() sync: 'width' | 'height' | 'both';\n\n /**\n * The auto-size boundary describes clipping element(s) that overflow will be checked relative to when resizing. By\n * default, the boundary includes overflow ancestors that will cause the element to be clipped. If needed, you can\n * change the boundary by passing a reference to one or more elements to this property.\n */\n @property({ type: Object }) autoSizeBoundary: Element | Element[];\n\n /** The amount of padding, in pixels, to exceed before the auto-size behavior will occur. */\n @property({ attribute: 'auto-size-padding', type: Number }) autoSizePadding = 0;\n\n /**\n * When a gap exists between the anchor and the popup element, this option will add a \"hover bridge\" that fills the\n * gap using an invisible element. This makes listening for events such as `mouseenter` and `mouseleave` more sane\n * because the pointer never technically leaves the element. The hover bridge will only be drawn when the popover is\n * active.\n */\n @property({ attribute: 'hover-bridge', type: Boolean }) hoverBridge = false;\n\n async connectedCallback() {\n super.connectedCallback();\n\n // Start the positioner after the first update\n await this.updateComplete;\n this.start();\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.stop();\n }\n\n async updated(changedProps: Map<string, unknown>) {\n super.updated(changedProps);\n\n // Start or stop the positioner when active changes\n if (changedProps.has('active')) {\n if (this.active) {\n this.start();\n } else {\n this.stop();\n }\n }\n\n // Update the anchor when anchor changes\n if (changedProps.has('anchor')) {\n this.handleAnchorChange();\n }\n\n // All other properties will trigger a reposition when active\n if (this.active) {\n await this.updateComplete;\n this.reposition();\n }\n }\n\n private async handleAnchorChange() {\n await this.stop();\n\n if (this.anchor && typeof this.anchor === 'string') {\n // Locate the anchor by id\n const root = this.getRootNode() as Document | ShadowRoot;\n this.anchorEl = root.getElementById(this.anchor);\n } else if (this.anchor instanceof Element || isVirtualElement(this.anchor)) {\n // Use the anchor's reference\n this.anchorEl = this.anchor;\n } else {\n // Look for a slotted anchor\n this.anchorEl = this.querySelector<HTMLElement>('[slot=\"anchor\"]');\n }\n\n // If the anchor is a <slot>, we'll use the first assigned element as the target since slots use `display: contents`\n // and positioning can't be calculated on them\n if (this.anchorEl instanceof HTMLSlotElement) {\n this.anchorEl = this.anchorEl.assignedElements({ flatten: true })[0] as HTMLElement;\n }\n\n // If the anchor is valid, start it up\n if (this.anchorEl) {\n this.start();\n }\n }\n\n private start() {\n // We can't start the positioner without an anchor\n if (!this.anchorEl) {\n return;\n }\n\n this.cleanup = autoUpdate(this.anchorEl, this.popup, () => {\n this.reposition();\n });\n }\n\n private async stop(): Promise<void> {\n return new Promise(resolve => {\n if (this.cleanup) {\n this.cleanup();\n this.cleanup = undefined;\n this.removeAttribute('data-current-placement');\n this.style.removeProperty('--auto-size-available-width');\n this.style.removeProperty('--auto-size-available-height');\n requestAnimationFrame(() => resolve());\n } else {\n resolve();\n }\n });\n }\n\n /** Forces the popup to recalculate and reposition itself. */\n reposition() {\n // Nothing to do if the popup is inactive or the anchor doesn't exist\n if (!this.active || !this.anchorEl) {\n return;\n }\n\n //\n // NOTE: Floating UI middlewares are order dependent: https://floating-ui.com/docs/middleware\n //\n const middleware = [\n // The offset middleware goes first\n offset({ mainAxis: this.distance, crossAxis: this.skidding })\n ];\n\n // First we sync width/height\n if (this.sync) {\n middleware.push(\n size({\n apply: ({ rects }) => {\n const syncWidth = this.sync === 'width' || this.sync === 'both';\n const syncHeight = this.sync === 'height' || this.sync === 'both';\n this.popup.style.width = syncWidth ? `${rects.reference.width}px` : '';\n this.popup.style.height = syncHeight ? `${rects.reference.height}px` : '';\n }\n })\n );\n } else {\n // Cleanup styles if we're not matching width/height\n this.popup.style.width = '';\n this.popup.style.height = '';\n }\n\n // Then we flip\n if (this.flip) {\n middleware.push(\n flip({\n boundary: this.flipBoundary,\n // @ts-expect-error - We're converting a string attribute to an array here\n fallbackPlacements: this.flipFallbackPlacements,\n fallbackStrategy: this.flipFallbackStrategy === 'best-fit' ? 'bestFit' : 'initialPlacement',\n padding: this.flipPadding\n })\n );\n }\n\n // Then we shift\n if (this.shift) {\n middleware.push(\n shift({\n boundary: this.shiftBoundary,\n padding: this.shiftPadding\n })\n );\n }\n\n // Now we adjust the size as needed\n if (this.autoSize) {\n middleware.push(\n size({\n boundary: this.autoSizeBoundary,\n padding: this.autoSizePadding,\n apply: ({ availableWidth, availableHeight }) => {\n if (this.autoSize === 'vertical' || this.autoSize === 'both') {\n this.style.setProperty('--auto-size-available-height', `${availableHeight}px`);\n } else {\n this.style.removeProperty('--auto-size-available-height');\n }\n\n if (this.autoSize === 'horizontal' || this.autoSize === 'both') {\n this.style.setProperty('--auto-size-available-width', `${availableWidth}px`);\n } else {\n this.style.removeProperty('--auto-size-available-width');\n }\n }\n })\n );\n } else {\n // Cleanup styles if we're no longer using auto-size\n this.style.removeProperty('--auto-size-available-width');\n this.style.removeProperty('--auto-size-available-height');\n }\n\n // Finally, we add an arrow\n if (this.arrow) {\n middleware.push(\n arrow({\n element: this.arrowEl,\n padding: this.arrowPadding\n })\n );\n }\n\n //\n // Use custom positioning logic if the strategy is absolute. Otherwise, fall back to the default logic.\n //\n // More info: https://github.com/synergy-design-system/synergy/issues/1135\n //\n const getOffsetParent =\n this.strategy === 'absolute'\n ? (element: Element) => platform.getOffsetParent(element, offsetParent)\n : platform.getOffsetParent;\n\n computePosition(this.anchorEl, this.popup, {\n placement: this.placement,\n middleware,\n strategy: this.strategy,\n platform: {\n ...platform,\n getOffsetParent\n }\n }).then(({ x, y, middlewareData, placement }) => {\n //\n // Even though we have our own localization utility, it uses different heuristics to determine RTL. Because of\n // that, we'll use the same approach that Floating UI uses.\n //\n // Source: https://github.com/floating-ui/floating-ui/blob/cb3b6ab07f95275730d3e6e46c702f8d4908b55c/packages/dom/src/utils/getDocumentRect.ts#L31\n //\n const isRtl = getComputedStyle(this).direction === 'rtl';\n const staticSide = { top: 'bottom', right: 'left', bottom: 'top', left: 'right' }[placement.split('-')[0]]!;\n\n this.setAttribute('data-current-placement', placement);\n\n Object.assign(this.popup.style, {\n left: `${x}px`,\n top: `${y}px`\n });\n\n if (this.arrow) {\n const arrowX = middlewareData.arrow!.x;\n const arrowY = middlewareData.arrow!.y;\n let top = '';\n let right = '';\n let bottom = '';\n let left = '';\n\n if (this.arrowPlacement === 'start') {\n // Start\n const value = typeof arrowX === 'number' ? `calc(${this.arrowPadding}px - var(--arrow-padding-offset))` : '';\n top = typeof arrowY === 'number' ? `calc(${this.arrowPadding}px - var(--arrow-padding-offset))` : '';\n right = isRtl ? value : '';\n left = isRtl ? '' : value;\n } else if (this.arrowPlacement === 'end') {\n // End\n const value = typeof arrowX === 'number' ? `calc(${this.arrowPadding}px - var(--arrow-padding-offset))` : '';\n right = isRtl ? '' : value;\n left = isRtl ? value : '';\n bottom = typeof arrowY === 'number' ? `calc(${this.arrowPadding}px - var(--arrow-padding-offset))` : '';\n } else if (this.arrowPlacement === 'center') {\n // Center\n left = typeof arrowX === 'number' ? `calc(50% - var(--arrow-size-diagonal))` : '';\n top = typeof arrowY === 'number' ? `calc(50% - var(--arrow-size-diagonal))` : '';\n } else {\n // Anchor (default)\n left = typeof arrowX === 'number' ? `${arrowX}px` : '';\n top = typeof arrowY === 'number' ? `${arrowY}px` : '';\n }\n\n Object.assign(this.arrowEl.style, {\n top,\n right,\n bottom,\n left,\n [staticSide]: 'calc(var(--arrow-size-diagonal) * -1)'\n });\n }\n });\n\n // Wait until the new position is drawn before updating the hover bridge, otherwise it can get out of sync\n requestAnimationFrame(() => this.updateHoverBridge());\n\n this.emit('syn-reposition');\n }\n\n private updateHoverBridge = () => {\n if (this.hoverBridge && this.anchorEl) {\n const anchorRect = this.anchorEl.getBoundingClientRect();\n const popupRect = this.popup.getBoundingClientRect();\n const isVertical = this.placement.includes('top') || this.placement.includes('bottom');\n let topLeftX = 0;\n let topLeftY = 0;\n let topRightX = 0;\n let topRightY = 0;\n let bottomLeftX = 0;\n let bottomLeftY = 0;\n let bottomRightX = 0;\n let bottomRightY = 0;\n\n if (isVertical) {\n if (anchorRect.top < popupRect.top) {\n // Anchor is above\n topLeftX = anchorRect.left;\n topLeftY = anchorRect.bottom;\n topRightX = anchorRect.right;\n topRightY = anchorRect.bottom;\n\n bottomLeftX = popupRect.left;\n bottomLeftY = popupRect.top;\n bottomRightX = popupRect.right;\n bottomRightY = popupRect.top;\n } else {\n // Anchor is below\n topLeftX = popupRect.left;\n topLeftY = popupRect.bottom;\n topRightX = popupRect.right;\n topRightY = popupRect.bottom;\n\n bottomLeftX = anchorRect.left;\n bottomLeftY = anchorRect.top;\n bottomRightX = anchorRect.right;\n bottomRightY = anchorRect.top;\n }\n } else {\n if (anchorRect.left < popupRect.left) {\n // Anchor is on the left\n topLeftX = anchorRect.right;\n topLeftY = anchorRect.top;\n topRightX = popupRect.left;\n topRightY = popupRect.top;\n\n bottomLeftX = anchorRect.right;\n bottomLeftY = anchorRect.bottom;\n bottomRightX = popupRect.left;\n bottomRightY = popupRect.bottom;\n } else {\n // Anchor is on the right\n topLeftX = popupRect.right;\n topLeftY = popupRect.top;\n topRightX = anchorRect.left;\n topRightY = anchorRect.top;\n\n bottomLeftX = popupRect.right;\n bottomLeftY = popupRect.bottom;\n bottomRightX = anchorRect.left;\n bottomRightY = anchorRect.bottom;\n }\n }\n\n this.style.setProperty('--hover-bridge-top-left-x', `${topLeftX}px`);\n this.style.setProperty('--hover-bridge-top-left-y', `${topLeftY}px`);\n this.style.setProperty('--hover-bridge-top-right-x', `${topRightX}px`);\n this.style.setProperty('--hover-bridge-top-right-y', `${topRightY}px`);\n this.style.setProperty('--hover-bridge-bottom-left-x', `${bottomLeftX}px`);\n this.style.setProperty('--hover-bridge-bottom-left-y', `${bottomLeftY}px`);\n this.style.setProperty('--hover-bridge-bottom-right-x', `${bottomRightX}px`);\n this.style.setProperty('--hover-bridge-bottom-right-y', `${bottomRightY}px`);\n }\n };\n\n render() {\n return html`\n <slot name=\"anchor\" @slotchange=${this.handleAnchorChange}></slot>\n\n <span\n part=\"hover-bridge\"\n class=${classMap({\n 'popup-hover-bridge': true,\n 'popup-hover-bridge--visible': this.hoverBridge && this.active\n })}\n ></span>\n\n <div\n part=\"popup\"\n class=${classMap({\n popup: true,\n 'popup--active': this.active,\n 'popup--fixed': this.strategy === 'fixed',\n 'popup--has-arrow': this.arrow\n })}\n >\n <slot></slot>\n ${this.arrow ? html`<div part=\"arrow\" class=\"popup__arrow\" role=\"presentation\"></div>` : ''}\n </div>\n `;\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;AAMA,SAAS,OAAO,YAAY,iBAAiB,MAAM,QAAQ,UAAU,OAAO,YAAY;AACxF,SAAS,gBAAgB;AACzB,SAAS,YAAY;AACrB,SAAS,oBAAoB;AAC7B,SAAS,UAAU,aAAa;AAUhC,SAAS,iBAAiB,GAAiC;AACzD,SAAO,MAAM,QAAQ,OAAO,MAAM,YAAY,2BAA2B;AAC3E;AA+BA,IAAqB,WAArB,cAAsC,eAAe;AAAA,EAArD;AAAA;AAqB8C,kBAAS;AAMxB,qBAYZ;AAMY,oBAAiC;AAGlC,oBAAW;AAGX,oBAAW;AAOV,iBAAQ;AAOO,0BAAwD;AAM5C,wBAAe;AAM1C,gBAAO;AAqBpC,kCAAyB;AAO0B,gCAA+C;AAU3C,uBAAc;AAGxC,iBAAQ;AAUmB,wBAAe;AAgBX,2BAAkB;AAQtB,uBAAc;AA0QtE,SAAQ,oBAAoB,MAAM;AAChC,UAAI,KAAK,eAAe,KAAK,UAAU;AACr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E,WAAW,YAAY,CAAC;AAAA,GAnIjB,SAmImB;AAG1B;AAAA,EAAX,SAAS;AAAA,GAtIS,SAsIP;AAOgB;AAAA,EAA3B,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GA7IP,SA6IS;AAGgC;AAAA,EAA3D,SAAS,EAAE,WAAW,qBAAqB,MAAM,OAAO,CAAC;AAAA,GAhJvC,SAgJyC;AAQJ;AAAA,EAAvD,SAAS,EAAE,WAAW,gBAAgB,MAAM,QAAQ,CAAC;AAAA,GAxJnC,SAwJqC;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/components/button-group/button-group.component.ts"],
|
|
4
|
-
"sourcesContent": ["// ---------------------------------------------------------------------\n// \uD83D\uDD12 AUTOGENERATED BY VENDORISM\n// Removing this comment will prevent it from being managed by it.\n// ---------------------------------------------------------------------\n\n/* eslint-disable */\nimport { html } from 'lit';\nimport { property, query, state } from 'lit/decorators.js';\nimport componentStyles from '../../styles/component.styles.js';\nimport SynergyElement from '../../internal/synergy-element.js';\nimport styles from './button-group.styles.js';\nimport type { CSSResultGroup } from 'lit';\n\n/**\n * @summary Button groups can be used to group related buttons into sections.\n * @documentation https://synergy.style/components/button-group\n * @status stable\n * @since 2.0\n *\n * @slot - One or more `<syn-button>` elements to display in the button group.\n *\n * @csspart base - The component's base wrapper.\n */\nexport default class SynButtonGroup extends SynergyElement {\n static styles: CSSResultGroup = [componentStyles, styles];\n\n @query('slot') defaultSlot: HTMLSlotElement;\n\n @state() disableRole = false;\n\n /**\n * A label to use for the button group. This won't be displayed on the screen, but it will be announced by assistive\n * devices when interacting with the control and is strongly recommended.\n */\n @property() label = '';\n\n private handleFocus(event: Event) {\n const button = findButton(event.target as HTMLElement);\n button?.classList.add('syn-button-group__button--focus');\n }\n\n private handleBlur(event: Event) {\n const button = findButton(event.target as HTMLElement);\n button?.classList.remove('syn-button-group__button--focus');\n }\n\n private handleMouseOver(event: Event) {\n const button = findButton(event.target as HTMLElement);\n button?.classList.add('syn-button-group__button--hover');\n }\n\n private handleMouseOut(event: Event) {\n const button = findButton(event.target as HTMLElement);\n button?.classList.remove('syn-button-group__button--hover');\n }\n\n private handleSlotChange() {\n const slottedElements = [...this.defaultSlot.assignedElements({ flatten: true })] as HTMLElement[];\n\n slottedElements.forEach(el => {\n const index = slottedElements.indexOf(el);\n const button = findButton(el);\n\n if (button) {\n button.classList.add('syn-button-group__button');\n button.classList.toggle('syn-button-group__button--first', index === 0);\n button.classList.toggle('syn-button-group__button--inner', index > 0 && index < slottedElements.length - 1);\n button.classList.toggle('syn-button-group__button--last', index === slottedElements.length - 1);\n button.classList.toggle('syn-button-group__button--radio', button.tagName.toLowerCase() === 'syn-radio-button');\n }\n });\n }\n\n render() {\n // eslint-disable-next-line lit-a11y/mouse-events-have-key-events\n return html`\n <div\n part=\"base\"\n class=\"button-group\"\n role=\"${this.disableRole ? 'presentation' : 'group'}\"\n aria-label=${this.label}\n @focusout=${this.handleBlur}\n @focusin=${this.handleFocus}\n @mouseover=${this.handleMouseOver}\n @mouseout=${this.handleMouseOut}\n >\n <slot @slotchange=${this.handleSlotChange}></slot>\n </div>\n `;\n }\n}\n\nfunction findButton(el: HTMLElement) {\n const selector = 'syn-button, syn-radio-button';\n\n // The button could be the target element or a child of it (e.g. a dropdown or tooltip anchor)\n return el.closest(selector) ?? el.querySelector(selector);\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;AAMA,SAAS,YAAY;AACrB,SAAS,UAAU,OAAO,aAAa;AAgBvC,IAAqB,iBAArB,cAA4C,eAAe;AAAA,EAA3D;AAAA;AAKW,uBAAc;AAMX,iBAAQ;AAAA;AAAA,EAEZ,YAAY,OAAc;AAChC,UAAM,SAAS,WAAW,MAAM,MAAqB;AACrD,qCAAQ,UAAU,IAAI;AAAA,EACxB;AAAA,EAEQ,WAAW,OAAc;AAC/B,UAAM,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