@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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SynTextarea
|
|
3
|
-
} from "./chunk.
|
|
3
|
+
} from "./chunk.LOUVN7OA.js";
|
|
4
4
|
|
|
5
5
|
// src/components/textarea/textarea.ts
|
|
6
6
|
var textarea_default = SynTextarea;
|
|
@@ -9,4 +9,4 @@ SynTextarea.define("syn-textarea");
|
|
|
9
9
|
export {
|
|
10
10
|
textarea_default
|
|
11
11
|
};
|
|
12
|
-
//# sourceMappingURL=chunk.
|
|
12
|
+
//# sourceMappingURL=chunk.SAHA7Z3T.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/prio-nav/prio-nav.ts"],
|
|
4
|
+
"sourcesContent": ["import SynPrioNav from './prio-nav.component.js';\n\nexport * from './prio-nav.component.js';\nexport default SynPrioNav;\n\nSynPrioNav.define('syn-prio-nav');\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'syn-prio-nav': SynPrioNav;\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;AAGA,IAAO,mBAAQ;AAEf,WAAW,OAAO,cAAc;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SynRadio
|
|
3
|
-
} from "./chunk.
|
|
3
|
+
} from "./chunk.OEMIM5RD.js";
|
|
4
4
|
|
|
5
5
|
// src/components/radio/radio.ts
|
|
6
6
|
var radio_default = SynRadio;
|
|
@@ -9,4 +9,4 @@ SynRadio.define("syn-radio");
|
|
|
9
9
|
export {
|
|
10
10
|
radio_default
|
|
11
11
|
};
|
|
12
|
-
//# sourceMappingURL=chunk.
|
|
12
|
+
//# sourceMappingURL=chunk.SOAZXMVH.js.map
|
|
@@ -156,6 +156,7 @@ var switch_styles_default = css`
|
|
|
156
156
|
|
|
157
157
|
:host([required]) .switch__label::after {
|
|
158
158
|
content: var(--syn-input-required-content);
|
|
159
|
+
color: var(--syn-input-required-content-color);
|
|
159
160
|
margin-inline-start: var(--syn-input-required-content-offset);
|
|
160
161
|
}
|
|
161
162
|
|
|
@@ -170,4 +171,4 @@ var switch_styles_default = css`
|
|
|
170
171
|
export {
|
|
171
172
|
switch_styles_default
|
|
172
173
|
};
|
|
173
|
-
//# sourceMappingURL=chunk.
|
|
174
|
+
//# sourceMappingURL=chunk.TAO5QIIQ.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/components/switch/switch.styles.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 { css } from 'lit';\n\nexport default css`\n\t/* stylelint-disable */\n :host {\n display: inline-block;\n }\n\n :host([size='small']) {\n --height: var(--syn-toggle-size-small);\n --thumb-size: calc(var(--syn-toggle-size-small) + 4px);\n --width: calc(var(--height) * 2);\n\n font-size: var(--syn-input-font-size-small);\n }\n\n :host([size='medium']) {\n --height: var(--syn-toggle-size-medium);\n --thumb-size: calc(var(--syn-toggle-size-medium) + 4px);\n --width: calc(var(--height) * 2);\n\n font-size: var(--syn-input-font-size-medium);\n }\n\n :host([size='large']) {\n --height: var(--syn-toggle-size-large);\n --thumb-size: calc(var(--syn-toggle-size-large) + 4px);\n --width: calc(var(--height) * 2);\n\n font-size: var(--syn-input-font-size-large);\n }\n\n .switch {\n position: relative;\n display: inline-flex;\n align-items: center;\n font-family: var(--syn-input-font-family);\n font-size: inherit;\n font-weight: var(--syn-input-font-weight);\n color: var(--syn-input-label-color);\n vertical-align: middle;\n cursor: pointer;\n }\n\n .switch__control {\n flex: 0 0 auto;\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: var(--width);\n height: var(--height);\n background-color: var(--syn-color-neutral-400);\n border: solid var(--syn-input-border-width) var(--syn-color-neutral-400);\n border-radius: var(--height);\n transition:\n var(--syn-transition-fast) border-color,\n var(--syn-transition-fast) background-color;\n }\n\n .switch__control .switch__thumb {\n width: var(--thumb-size);\n height: var(--thumb-size);\n background-color: var(--syn-color-neutral-0);\n border-radius: 50%;\n border: solid var(--syn-input-border-width) var(--syn-color-neutral-400);\n translate: calc((var(--width) - var(--height)) / -2);\n transition:\n var(--syn-transition-fast) translate ease,\n var(--syn-transition-fast) background-color,\n var(--syn-transition-fast) border-color,\n var(--syn-transition-fast) box-shadow;\n }\n\n .switch__input {\n position: absolute;\n opacity: 0;\n padding: 0;\n margin: 0;\n pointer-events: none;\n }\n\n /* Hover */\n .switch:not(.switch--checked):not(.switch--disabled) .switch__control:hover {\n background-color: var(--syn-color-neutral-400);\n border-color: var(--syn-color-neutral-400);\n }\n\n .switch:not(.switch--checked):not(.switch--disabled) .switch__control:hover .switch__thumb {\n background-color: var(--syn-color-neutral-0);\n border-color: var(--syn-color-neutral-400);\n }\n\n /* Focus */\n .switch:not(.switch--checked):not(.switch--disabled) .switch__input:focus-visible ~ .switch__control {\n background-color: var(--syn-color-neutral-400);\n border-color: var(--syn-color-neutral-400);\n }\n\n .switch:not(.switch--checked):not(.switch--disabled) .switch__input:focus-visible ~ .switch__control .switch__thumb {\n background-color: var(--syn-color-neutral-0);\n border-color: var(--syn-color-primary-600);\n outline: var(--syn-focus-ring);\n outline-offset: var(--syn-focus-ring-offset);\n }\n\n /* Checked */\n .switch--checked .switch__control {\n background-color: var(--syn-color-primary-600);\n border-color: var(--syn-color-primary-600);\n }\n\n .switch--checked .switch__control .switch__thumb {\n background-color: var(--syn-color-neutral-0);\n border-color: var(--syn-color-primary-600);\n translate: calc((var(--width) - var(--height)) / 2);\n }\n\n /* Checked + hover */\n .switch.switch--checked:not(.switch--disabled) .switch__control:hover {\n background-color: var(--syn-color-primary-600);\n border-color: var(--syn-color-primary-600);\n }\n\n .switch.switch--checked:not(.switch--disabled) .switch__control:hover .switch__thumb {\n background-color: var(--syn-color-neutral-0);\n border-color: var(--syn-color-primary-600);\n }\n\n /* Checked + focus */\n .switch.switch--checked:not(.switch--disabled) .switch__input:focus-visible ~ .switch__control {\n background-color: var(--syn-color-primary-600);\n border-color: var(--syn-color-primary-600);\n }\n\n .switch.switch--checked:not(.switch--disabled) .switch__input:focus-visible ~ .switch__control .switch__thumb {\n background-color: var(--syn-color-neutral-0);\n border-color: var(--syn-color-primary-600);\n outline: var(--syn-focus-ring);\n outline-offset: var(--syn-focus-ring-offset);\n }\n\n /* Disabled */\n .switch--disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .switch__label {\n display: inline-block;\n line-height: var(--height);\n margin-inline-start: 0.5em;\n user-select: none;\n -webkit-user-select: none;\n }\n\n :host([required]) .switch__label::after {\n content: var(--syn-input-required-content);\n margin-inline-start: var(--syn-input-required-content-offset);\n }\n\n @media (forced-colors: active) {\n .switch.switch--checked:not(.switch--disabled) .switch__control:hover .switch__thumb,\n .switch--checked .switch__control .switch__thumb {\n background-color: ButtonText;\n }\n }\n`;\n"],
|
|
5
|
-
"mappings": ";AAMA,SAAS,WAAW;AAEpB,IAAO,wBAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
|
|
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 { css } from 'lit';\n\nexport default css`\n\t/* stylelint-disable */\n :host {\n display: inline-block;\n }\n\n :host([size='small']) {\n --height: var(--syn-toggle-size-small);\n --thumb-size: calc(var(--syn-toggle-size-small) + 4px);\n --width: calc(var(--height) * 2);\n\n font-size: var(--syn-input-font-size-small);\n }\n\n :host([size='medium']) {\n --height: var(--syn-toggle-size-medium);\n --thumb-size: calc(var(--syn-toggle-size-medium) + 4px);\n --width: calc(var(--height) * 2);\n\n font-size: var(--syn-input-font-size-medium);\n }\n\n :host([size='large']) {\n --height: var(--syn-toggle-size-large);\n --thumb-size: calc(var(--syn-toggle-size-large) + 4px);\n --width: calc(var(--height) * 2);\n\n font-size: var(--syn-input-font-size-large);\n }\n\n .switch {\n position: relative;\n display: inline-flex;\n align-items: center;\n font-family: var(--syn-input-font-family);\n font-size: inherit;\n font-weight: var(--syn-input-font-weight);\n color: var(--syn-input-label-color);\n vertical-align: middle;\n cursor: pointer;\n }\n\n .switch__control {\n flex: 0 0 auto;\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: var(--width);\n height: var(--height);\n background-color: var(--syn-color-neutral-400);\n border: solid var(--syn-input-border-width) var(--syn-color-neutral-400);\n border-radius: var(--height);\n transition:\n var(--syn-transition-fast) border-color,\n var(--syn-transition-fast) background-color;\n }\n\n .switch__control .switch__thumb {\n width: var(--thumb-size);\n height: var(--thumb-size);\n background-color: var(--syn-color-neutral-0);\n border-radius: 50%;\n border: solid var(--syn-input-border-width) var(--syn-color-neutral-400);\n translate: calc((var(--width) - var(--height)) / -2);\n transition:\n var(--syn-transition-fast) translate ease,\n var(--syn-transition-fast) background-color,\n var(--syn-transition-fast) border-color,\n var(--syn-transition-fast) box-shadow;\n }\n\n .switch__input {\n position: absolute;\n opacity: 0;\n padding: 0;\n margin: 0;\n pointer-events: none;\n }\n\n /* Hover */\n .switch:not(.switch--checked):not(.switch--disabled) .switch__control:hover {\n background-color: var(--syn-color-neutral-400);\n border-color: var(--syn-color-neutral-400);\n }\n\n .switch:not(.switch--checked):not(.switch--disabled) .switch__control:hover .switch__thumb {\n background-color: var(--syn-color-neutral-0);\n border-color: var(--syn-color-neutral-400);\n }\n\n /* Focus */\n .switch:not(.switch--checked):not(.switch--disabled) .switch__input:focus-visible ~ .switch__control {\n background-color: var(--syn-color-neutral-400);\n border-color: var(--syn-color-neutral-400);\n }\n\n .switch:not(.switch--checked):not(.switch--disabled) .switch__input:focus-visible ~ .switch__control .switch__thumb {\n background-color: var(--syn-color-neutral-0);\n border-color: var(--syn-color-primary-600);\n outline: var(--syn-focus-ring);\n outline-offset: var(--syn-focus-ring-offset);\n }\n\n /* Checked */\n .switch--checked .switch__control {\n background-color: var(--syn-color-primary-600);\n border-color: var(--syn-color-primary-600);\n }\n\n .switch--checked .switch__control .switch__thumb {\n background-color: var(--syn-color-neutral-0);\n border-color: var(--syn-color-primary-600);\n translate: calc((var(--width) - var(--height)) / 2);\n }\n\n /* Checked + hover */\n .switch.switch--checked:not(.switch--disabled) .switch__control:hover {\n background-color: var(--syn-color-primary-600);\n border-color: var(--syn-color-primary-600);\n }\n\n .switch.switch--checked:not(.switch--disabled) .switch__control:hover .switch__thumb {\n background-color: var(--syn-color-neutral-0);\n border-color: var(--syn-color-primary-600);\n }\n\n /* Checked + focus */\n .switch.switch--checked:not(.switch--disabled) .switch__input:focus-visible ~ .switch__control {\n background-color: var(--syn-color-primary-600);\n border-color: var(--syn-color-primary-600);\n }\n\n .switch.switch--checked:not(.switch--disabled) .switch__input:focus-visible ~ .switch__control .switch__thumb {\n background-color: var(--syn-color-neutral-0);\n border-color: var(--syn-color-primary-600);\n outline: var(--syn-focus-ring);\n outline-offset: var(--syn-focus-ring-offset);\n }\n\n /* Disabled */\n .switch--disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .switch__label {\n display: inline-block;\n line-height: var(--height);\n margin-inline-start: 0.5em;\n user-select: none;\n -webkit-user-select: none;\n }\n\n :host([required]) .switch__label::after {\n content: var(--syn-input-required-content);\n color: var(--syn-input-required-content-color);\n margin-inline-start: var(--syn-input-required-content-offset);\n }\n\n @media (forced-colors: active) {\n .switch.switch--checked:not(.switch--disabled) .switch__control:hover .switch__thumb,\n .switch--checked .switch__control .switch__thumb {\n background-color: ButtonText;\n }\n }\n`;\n"],
|
|
5
|
+
"mappings": ";AAMA,SAAS,WAAW;AAEpB,IAAO,wBAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
import {
|
|
11
11
|
SynergyElement,
|
|
12
12
|
component_styles_default
|
|
13
|
-
} from "./chunk.
|
|
13
|
+
} from "./chunk.VCFVQ6KS.js";
|
|
14
14
|
import {
|
|
15
15
|
__decorateClass
|
|
16
16
|
} from "./chunk.QNDC5KWA.js";
|
|
@@ -41,4 +41,4 @@ __decorateClass([
|
|
|
41
41
|
export {
|
|
42
42
|
SynDivider
|
|
43
43
|
};
|
|
44
|
-
//# sourceMappingURL=chunk.
|
|
44
|
+
//# sourceMappingURL=chunk.TUFBQA52.js.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk.XIUSSERX.js";
|
|
7
7
|
import {
|
|
8
8
|
SynButtonGroup
|
|
9
|
-
} from "./chunk.
|
|
9
|
+
} from "./chunk.CCITL3IY.js";
|
|
10
10
|
import {
|
|
11
11
|
form_control_custom_styles_default,
|
|
12
12
|
form_control_styles_default
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
customErrorValidityState,
|
|
17
17
|
validValidityState,
|
|
18
18
|
valueMissingValidityState
|
|
19
|
-
} from "./chunk.
|
|
19
|
+
} from "./chunk.JUJZBRXD.js";
|
|
20
20
|
import {
|
|
21
21
|
HasSlotController
|
|
22
22
|
} from "./chunk.66WXVGAW.js";
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
import {
|
|
27
27
|
SynergyElement,
|
|
28
28
|
component_styles_default
|
|
29
|
-
} from "./chunk.
|
|
29
|
+
} from "./chunk.VCFVQ6KS.js";
|
|
30
30
|
import {
|
|
31
31
|
__decorateClass
|
|
32
32
|
} from "./chunk.QNDC5KWA.js";
|
|
@@ -356,4 +356,4 @@ __decorateClass([
|
|
|
356
356
|
export {
|
|
357
357
|
SynRadioGroup
|
|
358
358
|
};
|
|
359
|
-
//# sourceMappingURL=chunk.
|
|
359
|
+
//# sourceMappingURL=chunk.TWZC4LT2.js.map
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import {
|
|
2
|
+
prio_nav_styles_default
|
|
3
|
+
} from "./chunk.74N5WLM5.js";
|
|
4
|
+
import {
|
|
5
|
+
filterOnlyNavItems,
|
|
6
|
+
getAssignedElementsForSlot
|
|
7
|
+
} from "./chunk.XNP4OTUB.js";
|
|
8
|
+
import {
|
|
9
|
+
SynNavItem
|
|
10
|
+
} from "./chunk.ONVWJKVD.js";
|
|
11
|
+
import {
|
|
12
|
+
SynMenu
|
|
13
|
+
} from "./chunk.PCI22DJU.js";
|
|
14
|
+
import {
|
|
15
|
+
SynDropdown
|
|
16
|
+
} from "./chunk.2URWP5LD.js";
|
|
17
|
+
import {
|
|
18
|
+
SynIcon
|
|
19
|
+
} from "./chunk.I3SSNN7J.js";
|
|
20
|
+
import {
|
|
21
|
+
SynergyElement,
|
|
22
|
+
component_styles_default
|
|
23
|
+
} from "./chunk.VCFVQ6KS.js";
|
|
24
|
+
import {
|
|
25
|
+
__decorateClass
|
|
26
|
+
} from "./chunk.QNDC5KWA.js";
|
|
27
|
+
|
|
28
|
+
// src/components/prio-nav/prio-nav.component.ts
|
|
29
|
+
import { classMap } from "lit/directives/class-map.js";
|
|
30
|
+
import { html } from "lit/static-html.js";
|
|
31
|
+
import { property, query, state } from "lit/decorators.js";
|
|
32
|
+
var SynPrioNav = class extends SynergyElement {
|
|
33
|
+
constructor() {
|
|
34
|
+
super(...arguments);
|
|
35
|
+
this.priorityMenuLabel = "Menu";
|
|
36
|
+
this.itemPositionsCached = false;
|
|
37
|
+
this.amountOfNavItems = 0;
|
|
38
|
+
this.amountOfVisibleItems = 0;
|
|
39
|
+
this.hasItemsInDropdown = false;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Get a list of all slotted `<syn-nav-item />` elements
|
|
43
|
+
* that are either in the main slot or the priority menu slot
|
|
44
|
+
*/
|
|
45
|
+
getSlottedNavItems() {
|
|
46
|
+
const navItemsInDefaultSlot = filterOnlyNavItems(getAssignedElementsForSlot(this.defaultSlot));
|
|
47
|
+
const navItemsInMenuSlot = filterOnlyNavItems(getAssignedElementsForSlot(this.menuSlot));
|
|
48
|
+
return navItemsInDefaultSlot.concat(navItemsInMenuSlot);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Cache the items right offset position to make faster checks placement into priority menu
|
|
52
|
+
* @param items The items to cache the position for
|
|
53
|
+
*/
|
|
54
|
+
cacheItemPositions(items) {
|
|
55
|
+
items.forEach((item) => {
|
|
56
|
+
item.removeAttribute("slot");
|
|
57
|
+
const { right } = item.getBoundingClientRect();
|
|
58
|
+
item.dataset.right = right.toString();
|
|
59
|
+
});
|
|
60
|
+
this.itemPositionsCached = true;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Determines which items should be shown or hidden, depending on the current width
|
|
64
|
+
*/
|
|
65
|
+
handlePriorityMenu() {
|
|
66
|
+
const navItems = this.getSlottedNavItems();
|
|
67
|
+
if (!this.itemPositionsCached) {
|
|
68
|
+
this.cacheItemPositions(navItems);
|
|
69
|
+
}
|
|
70
|
+
const { width } = this.horizontalNav.getBoundingClientRect();
|
|
71
|
+
const { clientWidth } = this.priorityMenu;
|
|
72
|
+
const finalWidth = width - clientWidth;
|
|
73
|
+
let firstHiddenItemRightPos;
|
|
74
|
+
let visibleItems = 0;
|
|
75
|
+
navItems.forEach((item) => {
|
|
76
|
+
const isHidden = firstHiddenItemRightPos || parseFloat(item.dataset.right) >= finalWidth;
|
|
77
|
+
if (isHidden) {
|
|
78
|
+
item.removeAttribute("horizontal");
|
|
79
|
+
item.setAttribute("slot", "menu");
|
|
80
|
+
item.setAttribute("role", "menuitem");
|
|
81
|
+
if (!firstHiddenItemRightPos) {
|
|
82
|
+
firstHiddenItemRightPos = parseFloat(item.dataset.right);
|
|
83
|
+
}
|
|
84
|
+
} else {
|
|
85
|
+
visibleItems += 1;
|
|
86
|
+
item.setAttribute("horizontal", "true");
|
|
87
|
+
item.removeAttribute("slot");
|
|
88
|
+
item.removeAttribute("tabindex");
|
|
89
|
+
if (item.dataset.originalRole) {
|
|
90
|
+
item.setAttribute("role", item.dataset.originalRole);
|
|
91
|
+
} else {
|
|
92
|
+
item.removeAttribute("role");
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
this.hasItemsInDropdown = visibleItems !== navItems.length;
|
|
97
|
+
this.amountOfVisibleItems = visibleItems;
|
|
98
|
+
}
|
|
99
|
+
renderPriorityMenu() {
|
|
100
|
+
return html`
|
|
101
|
+
<syn-dropdown
|
|
102
|
+
class=${classMap({
|
|
103
|
+
"priority-menu": true,
|
|
104
|
+
"priority-menu--has-visible-items": this.amountOfVisibleItems !== 0,
|
|
105
|
+
"priority-menu--hidden": !this.hasItemsInDropdown
|
|
106
|
+
})}
|
|
107
|
+
part="priority-menu"
|
|
108
|
+
placement="bottom-end"
|
|
109
|
+
>
|
|
110
|
+
<syn-nav-item class="priority-menu__nav-item" slot="trigger" horizontal part="priority-menu-nav-item">
|
|
111
|
+
<syn-icon
|
|
112
|
+
class="priority-menu__icon"
|
|
113
|
+
label="More"
|
|
114
|
+
library="system"
|
|
115
|
+
name="more"
|
|
116
|
+
part="priority-menu-icon"
|
|
117
|
+
slot="prefix"
|
|
118
|
+
>
|
|
119
|
+
</syn-icon>
|
|
120
|
+
<span
|
|
121
|
+
class=${classMap({
|
|
122
|
+
"priority-menu__label": true,
|
|
123
|
+
"priority-menu__label--visible": this.amountOfVisibleItems === 0
|
|
124
|
+
})}
|
|
125
|
+
part="priority-menu-label"
|
|
126
|
+
>
|
|
127
|
+
${this.priorityMenuLabel}
|
|
128
|
+
</span>
|
|
129
|
+
</syn-nav-item>
|
|
130
|
+
|
|
131
|
+
<syn-menu part="priority-menu-container">
|
|
132
|
+
<slot name="menu"></slot>
|
|
133
|
+
</syn-menu>
|
|
134
|
+
|
|
135
|
+
</syn-dropdown>
|
|
136
|
+
`;
|
|
137
|
+
}
|
|
138
|
+
slotChange() {
|
|
139
|
+
const slottedItems = this.getSlottedNavItems();
|
|
140
|
+
if (slottedItems.length !== this.amountOfNavItems) {
|
|
141
|
+
this.cacheItemPositions(slottedItems);
|
|
142
|
+
this.handlePriorityMenu();
|
|
143
|
+
this.amountOfNavItems = slottedItems.length;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
firstUpdated() {
|
|
147
|
+
this.getSlottedNavItems().forEach((item) => {
|
|
148
|
+
var _a;
|
|
149
|
+
item.dataset.originalRole = (_a = item.getAttribute("role")) != null ? _a : "";
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
connectedCallback() {
|
|
153
|
+
super.connectedCallback();
|
|
154
|
+
this.resizeObserver = new ResizeObserver(() => this.handlePriorityMenu());
|
|
155
|
+
this.resizeObserver.observe(this);
|
|
156
|
+
}
|
|
157
|
+
disconnectedCallback() {
|
|
158
|
+
super.disconnectedCallback();
|
|
159
|
+
this.resizeObserver.unobserve(this);
|
|
160
|
+
}
|
|
161
|
+
render() {
|
|
162
|
+
return html`
|
|
163
|
+
<nav class="horizontal-nav" part="base">
|
|
164
|
+
<slot @slotchange=${this.slotChange}></slot>
|
|
165
|
+
${this.renderPriorityMenu()}
|
|
166
|
+
</nav>
|
|
167
|
+
`;
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
SynPrioNav.styles = [component_styles_default, prio_nav_styles_default];
|
|
171
|
+
SynPrioNav.dependencies = {
|
|
172
|
+
"syn-dropdown": SynDropdown,
|
|
173
|
+
"syn-icon": SynIcon,
|
|
174
|
+
"syn-menu": SynMenu,
|
|
175
|
+
"syn-nav-item": SynNavItem
|
|
176
|
+
};
|
|
177
|
+
__decorateClass([
|
|
178
|
+
query("slot:not([name])")
|
|
179
|
+
], SynPrioNav.prototype, "defaultSlot", 2);
|
|
180
|
+
__decorateClass([
|
|
181
|
+
query("slot[name=menu]")
|
|
182
|
+
], SynPrioNav.prototype, "menuSlot", 2);
|
|
183
|
+
__decorateClass([
|
|
184
|
+
query(".horizontal-nav")
|
|
185
|
+
], SynPrioNav.prototype, "horizontalNav", 2);
|
|
186
|
+
__decorateClass([
|
|
187
|
+
query(".priority-menu")
|
|
188
|
+
], SynPrioNav.prototype, "priorityMenu", 2);
|
|
189
|
+
__decorateClass([
|
|
190
|
+
property({ attribute: "priority-menu-label" })
|
|
191
|
+
], SynPrioNav.prototype, "priorityMenuLabel", 2);
|
|
192
|
+
__decorateClass([
|
|
193
|
+
state()
|
|
194
|
+
], SynPrioNav.prototype, "itemPositionsCached", 2);
|
|
195
|
+
__decorateClass([
|
|
196
|
+
state()
|
|
197
|
+
], SynPrioNav.prototype, "amountOfNavItems", 2);
|
|
198
|
+
__decorateClass([
|
|
199
|
+
state()
|
|
200
|
+
], SynPrioNav.prototype, "amountOfVisibleItems", 2);
|
|
201
|
+
__decorateClass([
|
|
202
|
+
state()
|
|
203
|
+
], SynPrioNav.prototype, "hasItemsInDropdown", 2);
|
|
204
|
+
|
|
205
|
+
export {
|
|
206
|
+
SynPrioNav
|
|
207
|
+
};
|
|
208
|
+
//# sourceMappingURL=chunk.U2H36O5J.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/prio-nav/prio-nav.component.ts"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable no-param-reassign */\nimport type { CSSResultGroup } from 'lit';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { html } from 'lit/static-html.js';\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 './prio-nav.styles.js';\nimport SynDropdown from '../dropdown/dropdown.component.js';\nimport SynIcon from '../icon/icon.component.js';\nimport SynMenu from '../menu/menu.component.js';\nimport SynNavItem from '../nav-item/nav-item.component.js';\nimport {\n filterOnlyNavItems,\n getAssignedElementsForSlot,\n} from './utils.js';\n\n/**\n * @summary The `<syn-prio-nav />` element provides a generic navigation bar\n * that can be used to group multiple navigation items (usually horizontal `<syn-nav-item />`s)\n * together. It will automatically group all items not visible in the viewport into a custom\n * priority menu.\n *\n * @example\n * <syn-prio-nav>\n * <syn-nav-item current horizontal>Item 1</syn-nav-item>\n * <button role=\"menuitem\">Item 2 (custom)</button>\n * <syn-nav-item horizontal>Item 3</syn-nav-item>\n * </syn-prio-nav>\n *\n * @documentation https://synergy-design-system.github.io/?path=/docs/components-syn-prio-nav--docs\n * @status stable\n * @since 1.14.0\n *\n * @dependency syn-dropdown\n * @dependency syn-icon\n * @dependency syn-menu\n * @dependency syn-nav-item\n *\n * @slot - The given navigation items. Must be horizontal `<syn-nav-item>`s\n * or have a role of \"menuitem\"\n *\n * @csspart base - The component's base wrapper.\n * @csspart priority-menu - The wrapper around the priority menu\n * @csspart priority-menu-nav-item - The navigation item for the priority menu\n * @csspart priority-menu-label - The label for the priority menu\n * @csspart priority-menu-icon - The icon for the priority menu\n * @csspart priority-menu-container - The container for the shifted navigation items,\n * if there is not enough space.\n *\n */\nexport default class SynPrioNav extends SynergyElement {\n static styles: CSSResultGroup = [componentStyles, styles];\n\n static dependencies = {\n 'syn-dropdown': SynDropdown,\n 'syn-icon': SynIcon,\n 'syn-menu': SynMenu,\n 'syn-nav-item': SynNavItem,\n };\n\n /**\n * Internal resize observer\n */\n private resizeObserver: ResizeObserver;\n\n /**\n * Reference to the rendered children slot\n */\n @query('slot:not([name])') private defaultSlot: HTMLSlotElement;\n\n /**\n * Reference to the slot where priority menu items are placed\n */\n @query('slot[name=menu]') private menuSlot: HTMLSlotElement;\n\n /**\n * The wrapper that holds the horizontal navigation items\n */\n @query('.horizontal-nav') private horizontalNav: HTMLDivElement;\n\n /**\n * The priority menu dropdown\n */\n @query('.priority-menu') private priorityMenu: SynDropdown;\n\n /**\n * The components priority menu label.\n * This will be shown after the priority menu 3 dots link\n */\n @property({ attribute: 'priority-menu-label' }) priorityMenuLabel = 'Menu';\n\n /**\n * Internal state reflecting if the item positions have been cached\n */\n @state() private itemPositionsCached = false;\n\n /**\n * The amount of nav items that are currently slotted\n */\n @state() private amountOfNavItems = 0;\n\n /**\n * The amount of items that are currently visible\n */\n @state() private amountOfVisibleItems = 0;\n\n /**\n * Internal state reflecting if there are items in the priority menu\n */\n @state() private hasItemsInDropdown = false;\n\n /**\n * Get a list of all slotted `<syn-nav-item />` elements\n * that are either in the main slot or the priority menu slot\n */\n private getSlottedNavItems() {\n const navItemsInDefaultSlot = filterOnlyNavItems(getAssignedElementsForSlot(this.defaultSlot));\n const navItemsInMenuSlot = filterOnlyNavItems(getAssignedElementsForSlot(this.menuSlot));\n return navItemsInDefaultSlot.concat(navItemsInMenuSlot);\n }\n\n /**\n * Cache the items right offset position to make faster checks placement into priority menu\n * @param items The items to cache the position for\n */\n private cacheItemPositions(items: SynNavItem[]) {\n items.forEach(item => {\n // We have to measure while the items are in the primary slot,\n // else we will just get the placement in the priority menu\n item.removeAttribute('slot');\n const { right } = item.getBoundingClientRect();\n item.dataset.right = right.toString();\n });\n\n this.itemPositionsCached = true;\n }\n\n /**\n * Determines which items should be shown or hidden, depending on the current width\n */\n private handlePriorityMenu() {\n const navItems = this.getSlottedNavItems();\n\n if (!this.itemPositionsCached) {\n this.cacheItemPositions(navItems);\n }\n\n // Get the widths of the horizontal nav and the priority menu\n // We subtract the width of the priority menu to get the final width\n const { width } = this.horizontalNav.getBoundingClientRect();\n const { clientWidth } = this.priorityMenu;\n const finalWidth = width - clientWidth;\n\n // Cache the first item\n let firstHiddenItemRightPos: number | undefined;\n\n let visibleItems = 0;\n\n // Save the position of all the elements in a cache\n navItems.forEach(item => {\n // Make sure to use the cache obtained in createGhostItems\n const isHidden = firstHiddenItemRightPos || parseFloat(item.dataset.right!) >= finalWidth;\n\n if (isHidden) {\n item.removeAttribute('horizontal');\n item.setAttribute('slot', 'menu');\n\n // Makes sure the item is focusable in a syn-dropdown\n item.setAttribute('role', 'menuitem');\n\n // Get the position of the first item\n // Will get used to position the priority menu\n if (!firstHiddenItemRightPos) {\n firstHiddenItemRightPos = parseFloat(item.dataset.right!);\n }\n } else {\n visibleItems += 1;\n item.setAttribute('horizontal', 'true');\n item.removeAttribute('slot');\n item.removeAttribute('tabindex');\n\n // Reset the role to the original value\n if (item.dataset.originalRole) {\n item.setAttribute('role', item.dataset.originalRole);\n } else {\n item.removeAttribute('role');\n }\n }\n });\n\n // Tell the render call that we have items in the priority menu\n // and toggle the visibility of the priority menu label\n this.hasItemsInDropdown = visibleItems !== navItems.length;\n this.amountOfVisibleItems = visibleItems;\n }\n\n private renderPriorityMenu() {\n return html`\n <syn-dropdown\n class=${classMap({\n 'priority-menu': true,\n 'priority-menu--has-visible-items': this.amountOfVisibleItems !== 0,\n 'priority-menu--hidden': !this.hasItemsInDropdown,\n })}\n part=\"priority-menu\"\n placement=\"bottom-end\"\n >\n <syn-nav-item class=\"priority-menu__nav-item\" slot=\"trigger\" horizontal part=\"priority-menu-nav-item\">\n <syn-icon \n class=\"priority-menu__icon\"\n label=\"More\"\n library=\"system\"\n name=\"more\"\n part=\"priority-menu-icon\"\n slot=\"prefix\"\n >\n </syn-icon>\n <span\n class=${classMap({\n 'priority-menu__label': true,\n 'priority-menu__label--visible': this.amountOfVisibleItems === 0,\n })}\n part=\"priority-menu-label\"\n >\n ${this.priorityMenuLabel}\n </span>\n </syn-nav-item>\n\n <syn-menu part=\"priority-menu-container\">\n <slot name=\"menu\"></slot>\n </syn-menu>\n\n </syn-dropdown>\n `;\n }\n\n private slotChange() {\n const slottedItems = this.getSlottedNavItems();\n\n // Make sure to trigger a recalculation of the item positions if we a new list of slotted items\n if (slottedItems.length !== this.amountOfNavItems) {\n this.cacheItemPositions(slottedItems);\n this.handlePriorityMenu();\n this.amountOfNavItems = slottedItems.length;\n }\n }\n\n protected firstUpdated() {\n // Cache the original role of the items so we can reset it if needed.\n this.getSlottedNavItems().forEach(item => {\n item.dataset.originalRole = item.getAttribute('role') ?? '';\n });\n }\n\n connectedCallback() {\n super.connectedCallback();\n this.resizeObserver = new ResizeObserver(() => this.handlePriorityMenu());\n this.resizeObserver.observe(this);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.resizeObserver.unobserve(this);\n }\n\n render() {\n /* eslint-disable @typescript-eslint/unbound-method */\n return html`\n <nav class=\"horizontal-nav\" part=\"base\">\n <slot @slotchange=${this.slotChange}></slot>\n ${this.renderPriorityMenu()}\n </nav>\n `;\n /* eslint-enable @typescript-eslint/unbound-method */\n }\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
import {
|
|
2
|
+
side_nav_styles_default
|
|
3
|
+
} from "./chunk.GO3CCKC3.js";
|
|
4
|
+
import {
|
|
5
|
+
SynDivider
|
|
6
|
+
} from "./chunk.TUFBQA52.js";
|
|
7
|
+
import {
|
|
8
|
+
SynDrawer
|
|
9
|
+
} from "./chunk.3M6IVPMZ.js";
|
|
10
|
+
import {
|
|
11
|
+
unlockBodyScrolling
|
|
12
|
+
} from "./chunk.RIJKFEYZ.js";
|
|
13
|
+
import {
|
|
14
|
+
waitForEvent
|
|
15
|
+
} from "./chunk.7BEVGRQ2.js";
|
|
16
|
+
import {
|
|
17
|
+
getAnimation,
|
|
18
|
+
setAnimation,
|
|
19
|
+
setDefaultAnimation
|
|
20
|
+
} from "./chunk.QAUTITK3.js";
|
|
21
|
+
import {
|
|
22
|
+
HasSlotController
|
|
23
|
+
} from "./chunk.66WXVGAW.js";
|
|
24
|
+
import {
|
|
25
|
+
watch
|
|
26
|
+
} from "./chunk.AVTU2BGE.js";
|
|
27
|
+
import {
|
|
28
|
+
LocalizeController
|
|
29
|
+
} from "./chunk.GEHO4WRP.js";
|
|
30
|
+
import {
|
|
31
|
+
SynergyElement,
|
|
32
|
+
component_styles_default
|
|
33
|
+
} from "./chunk.VCFVQ6KS.js";
|
|
34
|
+
import {
|
|
35
|
+
__decorateClass
|
|
36
|
+
} from "./chunk.QNDC5KWA.js";
|
|
37
|
+
|
|
38
|
+
// src/components/side-nav/side-nav.component.ts
|
|
39
|
+
import { classMap } from "lit/directives/class-map.js";
|
|
40
|
+
import { html } from "lit/static-html.js";
|
|
41
|
+
import { property, query, state } from "lit/decorators.js";
|
|
42
|
+
var SynSideNav = class extends SynergyElement {
|
|
43
|
+
constructor() {
|
|
44
|
+
super();
|
|
45
|
+
this.hasSlotController = new HasSlotController(this, "[default]", "footer");
|
|
46
|
+
this.localize = new LocalizeController(this);
|
|
47
|
+
this.isAnimationActive = false;
|
|
48
|
+
this.open = false;
|
|
49
|
+
this.rail = false;
|
|
50
|
+
this.noFocusTrapping = false;
|
|
51
|
+
this.handleMouseEnter = this.handleMouseEnter.bind(this);
|
|
52
|
+
this.handleMouseLeave = this.handleMouseLeave.bind(this);
|
|
53
|
+
}
|
|
54
|
+
setDelayedCallback(callback) {
|
|
55
|
+
clearTimeout(this.timeout);
|
|
56
|
+
this.timeout = setTimeout(callback, 100);
|
|
57
|
+
}
|
|
58
|
+
handleMouseEnter() {
|
|
59
|
+
this.setDelayedCallback(() => {
|
|
60
|
+
this.open = true;
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
handleMouseLeave() {
|
|
64
|
+
this.setDelayedCallback(() => {
|
|
65
|
+
this.open = false;
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
handleRequestClose() {
|
|
69
|
+
if (this.open) {
|
|
70
|
+
this.open = false;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
addMouseListener() {
|
|
74
|
+
var _a, _b;
|
|
75
|
+
(_a = this.drawer.shadowRoot.querySelector(".drawer__panel")) == null ? void 0 : _a.addEventListener("mouseenter", this.handleMouseEnter);
|
|
76
|
+
(_b = this.drawer.shadowRoot.querySelector(".drawer__panel")) == null ? void 0 : _b.addEventListener("mouseleave", this.handleMouseLeave);
|
|
77
|
+
}
|
|
78
|
+
removeMouseListener() {
|
|
79
|
+
var _a, _b;
|
|
80
|
+
(_a = this.drawer.shadowRoot.querySelector(".drawer__panel")) == null ? void 0 : _a.removeEventListener("mouseenter", this.handleMouseEnter);
|
|
81
|
+
(_b = this.drawer.shadowRoot.querySelector(".drawer__panel")) == null ? void 0 : _b.removeEventListener("mouseleave", this.handleMouseLeave);
|
|
82
|
+
}
|
|
83
|
+
setDrawerVisibility(isVisible) {
|
|
84
|
+
var _a;
|
|
85
|
+
this.drawer.shadowRoot.querySelector(".drawer").hidden = !isVisible;
|
|
86
|
+
(_a = this.drawer.shadowRoot.querySelector(".drawer__panel")) == null ? void 0 : _a.setAttribute("aria-hidden", isVisible ? "false" : "true");
|
|
87
|
+
}
|
|
88
|
+
forceDrawerVisibilityForRailMode() {
|
|
89
|
+
return waitForEvent(this, "syn-after-hide").then(() => {
|
|
90
|
+
this.setDrawerVisibility(true);
|
|
91
|
+
this.isAnimationActive = false;
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
setDrawerAnimations() {
|
|
95
|
+
const showAnimation = getAnimation(this, `sideNav.show${this.rail ? "Rail" : "NonRail"}`, { dir: this.localize.dir() });
|
|
96
|
+
const hideAnimation = getAnimation(this, `sideNav.hide${this.rail ? "Rail" : "NonRail"}`, { dir: this.localize.dir() });
|
|
97
|
+
const hideOverlay = getAnimation(this, "sideNav.overlay.hide", { dir: this.localize.dir() });
|
|
98
|
+
const showOverlay = getAnimation(this, "sideNav.overlay.show", { dir: this.localize.dir() });
|
|
99
|
+
setAnimation(this.drawer, "drawer.showStart", showAnimation);
|
|
100
|
+
setAnimation(this.drawer, "drawer.hideStart", hideAnimation);
|
|
101
|
+
setAnimation(this.drawer, "drawer.overlay.hide", hideOverlay);
|
|
102
|
+
setAnimation(this.drawer, "drawer.overlay.show", showOverlay);
|
|
103
|
+
}
|
|
104
|
+
handleModeChange() {
|
|
105
|
+
this.setDrawerAnimations();
|
|
106
|
+
if (this.rail) {
|
|
107
|
+
this.addMouseListener();
|
|
108
|
+
this.setDrawerVisibility(true);
|
|
109
|
+
} else {
|
|
110
|
+
this.removeMouseListener();
|
|
111
|
+
if (!this.open) {
|
|
112
|
+
this.setDrawerVisibility(false);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
handleOpenChange() {
|
|
117
|
+
if (this.rail) {
|
|
118
|
+
this.isAnimationActive = true;
|
|
119
|
+
if (!this.open) {
|
|
120
|
+
this.forceDrawerVisibilityForRailMode();
|
|
121
|
+
} else {
|
|
122
|
+
waitForEvent(this.drawer, "syn-after-show").then(() => {
|
|
123
|
+
this.isAnimationActive = false;
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
handleFocusTrapping() {
|
|
129
|
+
if (!this.rail) {
|
|
130
|
+
if (this.noFocusTrapping) {
|
|
131
|
+
this.drawer.modal.activateExternal();
|
|
132
|
+
} else {
|
|
133
|
+
this.drawer.modal.deactivateExternal();
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
/** Shows the side-nav. */
|
|
138
|
+
async show() {
|
|
139
|
+
if (this.open) {
|
|
140
|
+
return void 0;
|
|
141
|
+
}
|
|
142
|
+
this.open = true;
|
|
143
|
+
return waitForEvent(this, "syn-after-show");
|
|
144
|
+
}
|
|
145
|
+
/** Hides the side-nav */
|
|
146
|
+
async hide() {
|
|
147
|
+
if (!this.open) {
|
|
148
|
+
return void 0;
|
|
149
|
+
}
|
|
150
|
+
this.open = false;
|
|
151
|
+
return waitForEvent(this, "syn-after-hide");
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Initial setup for first render like special rail mode handling and drawer animations.
|
|
155
|
+
* */
|
|
156
|
+
firstUpdated() {
|
|
157
|
+
this.setDrawerAnimations();
|
|
158
|
+
if (this.rail) {
|
|
159
|
+
this.drawer.updateComplete.then(() => {
|
|
160
|
+
this.addMouseListener();
|
|
161
|
+
this.setDrawerVisibility(true);
|
|
162
|
+
});
|
|
163
|
+
} else if (this.noFocusTrapping) {
|
|
164
|
+
this.drawer.modal.activateExternal();
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
disconnectedCallback() {
|
|
168
|
+
super.disconnectedCallback();
|
|
169
|
+
unlockBodyScrolling(this.drawer);
|
|
170
|
+
this.drawer.modal.deactivate();
|
|
171
|
+
}
|
|
172
|
+
render() {
|
|
173
|
+
const isTouch = window.navigator.maxTouchPoints > 0 || !!("ontouchstart" in window);
|
|
174
|
+
const hasFooter = this.hasSlotController.test("footer");
|
|
175
|
+
return html`
|
|
176
|
+
<nav
|
|
177
|
+
class=${classMap({
|
|
178
|
+
"side-nav": true,
|
|
179
|
+
"side-nav--animation": this.isAnimationActive,
|
|
180
|
+
"side-nav--fix": !this.rail,
|
|
181
|
+
"side-nav--has-footer": hasFooter,
|
|
182
|
+
"side-nav--open": this.open,
|
|
183
|
+
"side-nav--rail": this.rail,
|
|
184
|
+
"side-nav--touch": isTouch
|
|
185
|
+
})}
|
|
186
|
+
part="base"
|
|
187
|
+
>
|
|
188
|
+
|
|
189
|
+
<syn-drawer
|
|
190
|
+
class="side-nav__drawer"
|
|
191
|
+
?contained=${this.rail}
|
|
192
|
+
exportparts="overlay"
|
|
193
|
+
label=${this.localize.term("sideNav")}
|
|
194
|
+
no-header
|
|
195
|
+
?open=${this.open}
|
|
196
|
+
part="drawer"
|
|
197
|
+
placement="start"
|
|
198
|
+
@syn-request-close=${this.handleRequestClose}
|
|
199
|
+
>
|
|
200
|
+
<div part="content-container" class="side-nav__content-container">
|
|
201
|
+
<slot part="content" ></slot>
|
|
202
|
+
</div>
|
|
203
|
+
|
|
204
|
+
<footer class="side-nav__footer" part="footer-container" slot="footer">
|
|
205
|
+
|
|
206
|
+
${hasFooter ? html`<syn-divider part="footer-divider" class="side-nav__footer-divider"></syn-divider>` : ""}
|
|
207
|
+
<slot name="footer" part="footer" ></slot>
|
|
208
|
+
|
|
209
|
+
</footer>
|
|
210
|
+
|
|
211
|
+
</syn-drawer>
|
|
212
|
+
|
|
213
|
+
</nav>
|
|
214
|
+
`;
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
SynSideNav.styles = [component_styles_default, side_nav_styles_default];
|
|
218
|
+
SynSideNav.dependencies = {
|
|
219
|
+
"syn-divider": SynDivider,
|
|
220
|
+
"syn-drawer": SynDrawer
|
|
221
|
+
};
|
|
222
|
+
__decorateClass([
|
|
223
|
+
state()
|
|
224
|
+
], SynSideNav.prototype, "isAnimationActive", 2);
|
|
225
|
+
__decorateClass([
|
|
226
|
+
query(".side-nav__drawer")
|
|
227
|
+
], SynSideNav.prototype, "drawer", 2);
|
|
228
|
+
__decorateClass([
|
|
229
|
+
property({ reflect: true, type: Boolean })
|
|
230
|
+
], SynSideNav.prototype, "open", 2);
|
|
231
|
+
__decorateClass([
|
|
232
|
+
property({ reflect: true, type: Boolean })
|
|
233
|
+
], SynSideNav.prototype, "rail", 2);
|
|
234
|
+
__decorateClass([
|
|
235
|
+
property({ attribute: "no-focus-trapping", reflect: true, type: Boolean })
|
|
236
|
+
], SynSideNav.prototype, "noFocusTrapping", 2);
|
|
237
|
+
__decorateClass([
|
|
238
|
+
watch("rail", { waitUntilFirstUpdate: true })
|
|
239
|
+
], SynSideNav.prototype, "handleModeChange", 1);
|
|
240
|
+
__decorateClass([
|
|
241
|
+
watch("open", { waitUntilFirstUpdate: true })
|
|
242
|
+
], SynSideNav.prototype, "handleOpenChange", 1);
|
|
243
|
+
__decorateClass([
|
|
244
|
+
watch("noFocusTrapping", { waitUntilFirstUpdate: true })
|
|
245
|
+
], SynSideNav.prototype, "handleFocusTrapping", 1);
|
|
246
|
+
setDefaultAnimation("sideNav.showRail", {
|
|
247
|
+
keyframes: [
|
|
248
|
+
{ width: "4.5rem" },
|
|
249
|
+
{ width: "25rem" }
|
|
250
|
+
],
|
|
251
|
+
options: { duration: 250, easing: "ease" }
|
|
252
|
+
});
|
|
253
|
+
setDefaultAnimation("sideNav.showNonRail", {
|
|
254
|
+
keyframes: [
|
|
255
|
+
{ opacity: 0, translate: "-100%" },
|
|
256
|
+
{ opacity: 1, translate: "0" }
|
|
257
|
+
],
|
|
258
|
+
options: { duration: 250, easing: "ease" }
|
|
259
|
+
});
|
|
260
|
+
setDefaultAnimation("sideNav.hideNonRail", {
|
|
261
|
+
keyframes: [
|
|
262
|
+
{ opacity: 1, translate: "0" },
|
|
263
|
+
{ opacity: 0, translate: "-100%" }
|
|
264
|
+
],
|
|
265
|
+
options: { duration: 250, easing: "ease" }
|
|
266
|
+
});
|
|
267
|
+
setDefaultAnimation("sideNav.hideRail", {
|
|
268
|
+
keyframes: [
|
|
269
|
+
{ width: "25rem" },
|
|
270
|
+
{ width: "4.5rem" }
|
|
271
|
+
],
|
|
272
|
+
options: { duration: 250, easing: "ease" }
|
|
273
|
+
});
|
|
274
|
+
setDefaultAnimation("sideNav.overlay.show", {
|
|
275
|
+
keyframes: [{ opacity: 0 }, { opacity: 1 }],
|
|
276
|
+
options: { duration: 250 }
|
|
277
|
+
});
|
|
278
|
+
setDefaultAnimation("sideNav.overlay.hide", {
|
|
279
|
+
keyframes: [{ opacity: 1 }, { opacity: 0 }],
|
|
280
|
+
options: { duration: 250 }
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
export {
|
|
284
|
+
SynSideNav
|
|
285
|
+
};
|
|
286
|
+
//# sourceMappingURL=chunk.UHVHULGW.js.map
|