@mhmo91/schmancy 0.2.161 → 0.2.165
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/{animated-text-CSOz5SCF.cjs → animated-text-DykevNAQ.cjs} +2 -2
- package/dist/{animated-text-CSOz5SCF.cjs.map → animated-text-DykevNAQ.cjs.map} +1 -1
- package/dist/{animated-text-DUB2OEsp.js → animated-text-lA1qYOb3.js} +3 -3
- package/dist/{animated-text-DUB2OEsp.js.map → animated-text-lA1qYOb3.js.map} +1 -1
- package/dist/animated-text.cjs +1 -1
- package/dist/animated-text.js +1 -1
- package/dist/area.cjs +1 -1
- package/dist/{area.component-kK1WKJY2.cjs → area.component-DAzIOTvX.cjs} +2 -2
- package/dist/{area.component-kK1WKJY2.cjs.map → area.component-DAzIOTvX.cjs.map} +1 -1
- package/dist/{area.component-B_aHh7nO.js → area.component-DbLTnRuW.js} +3 -3
- package/dist/{area.component-B_aHh7nO.js.map → area.component-DbLTnRuW.js.map} +1 -1
- package/dist/area.js +1 -1
- package/dist/{autocomplete-BKPUk9e5.cjs → autocomplete-DB1BIFBS.cjs} +2 -2
- package/dist/{autocomplete-BKPUk9e5.cjs.map → autocomplete-DB1BIFBS.cjs.map} +1 -1
- package/dist/{autocomplete-Di9kiTER.js → autocomplete-VHq-wIav.js} +3 -3
- package/dist/{autocomplete-Di9kiTER.js.map → autocomplete-VHq-wIav.js.map} +1 -1
- package/dist/autocomplete.cjs +1 -1
- package/dist/autocomplete.js +1 -1
- package/dist/badge.cjs +1 -1
- package/dist/badge.js +1 -1
- package/dist/busy.cjs +1 -1
- package/dist/busy.js +1 -1
- package/dist/button.cjs +1 -1
- package/dist/button.js +1 -1
- package/dist/card.cjs +1 -1
- package/dist/card.js +1 -1
- package/dist/{checkbox-CwMYYFc5.cjs → checkbox-9PyWz5FJ.cjs} +2 -2
- package/dist/{checkbox-CwMYYFc5.cjs.map → checkbox-9PyWz5FJ.cjs.map} +1 -1
- package/dist/{checkbox-Dr_Nv_NO.js → checkbox-D2X1Yff3.js} +2 -2
- package/dist/{checkbox-Dr_Nv_NO.js.map → checkbox-D2X1Yff3.js.map} +1 -1
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/{chips-CMSDxpu9.cjs → chips-Bv2hdmMK.cjs} +2 -2
- package/dist/{chips-CMSDxpu9.cjs.map → chips-Bv2hdmMK.cjs.map} +1 -1
- package/dist/{chips-Dy8t83by.js → chips-pqAEZ-DH.js} +3 -3
- package/dist/{chips-Dy8t83by.js.map → chips-pqAEZ-DH.js.map} +1 -1
- package/dist/chips.cjs +1 -1
- package/dist/chips.js +1 -1
- package/dist/components.cjs +1 -1
- package/dist/components.js +1 -1
- package/dist/content-drawer.cjs +1 -1
- package/dist/content-drawer.js +1 -1
- package/dist/{date-range-BSRsyfMM.js → date-range-7_L_ECbS.js} +3 -3
- package/dist/{date-range-BSRsyfMM.js.map → date-range-7_L_ECbS.js.map} +1 -1
- package/dist/{date-range-B2cD9hQe.cjs → date-range-Dpvip0Kf.cjs} +2 -2
- package/dist/{date-range-B2cD9hQe.cjs.map → date-range-Dpvip0Kf.cjs.map} +1 -1
- package/dist/date-range.cjs +1 -1
- package/dist/date-range.js +1 -1
- package/dist/{delay-DUjqSk9U.cjs → delay-D0Np7OmS.cjs} +2 -2
- package/dist/{delay-DUjqSk9U.cjs.map → delay-D0Np7OmS.cjs.map} +1 -1
- package/dist/{delay-CoyF7a2c.js → delay-DiN5nFO-.js} +2 -2
- package/dist/{delay-CoyF7a2c.js.map → delay-DiN5nFO-.js.map} +1 -1
- package/dist/delay.cjs +1 -1
- package/dist/delay.js +1 -1
- package/dist/{divider-D-3b8xBH.cjs → divider-B56pVfQK.cjs} +2 -2
- package/dist/{divider-D-3b8xBH.cjs.map → divider-B56pVfQK.cjs.map} +1 -1
- package/dist/{divider-CwrrRepk.js → divider-BpVwalY9.js} +3 -3
- package/dist/{divider-CwrrRepk.js.map → divider-BpVwalY9.js.map} +1 -1
- package/dist/divider.cjs +1 -1
- package/dist/divider.js +1 -1
- package/dist/dropdown-content-Db639XJB.cjs +53 -0
- package/dist/dropdown-content-Db639XJB.cjs.map +1 -0
- package/dist/dropdown-content-aNqgmuB9.js +124 -0
- package/dist/dropdown-content-aNqgmuB9.js.map +1 -0
- package/dist/dropdown.cjs +2 -0
- package/dist/dropdown.cjs.map +1 -0
- package/dist/dropdown.js +6 -0
- package/dist/dropdown.js.map +1 -0
- package/dist/extra.cjs +1 -1
- package/dist/extra.js +1 -1
- package/dist/{flex-D4HMvbL2.js → flex-B2plWeGc.js} +2 -2
- package/dist/{flex-D4HMvbL2.js.map → flex-B2plWeGc.js.map} +1 -1
- package/dist/{flex-BJPUKHgq.cjs → flex-Crv0q1Ni.cjs} +2 -2
- package/dist/{flex-BJPUKHgq.cjs.map → flex-Crv0q1Ni.cjs.map} +1 -1
- package/dist/{form-D-CN4Npb.js → form-9Gu7_vfY.js} +2 -2
- package/dist/{form-D-CN4Npb.js.map → form-9Gu7_vfY.js.map} +1 -1
- package/dist/{form-CPm25cLE.cjs → form-DYaROiIF.cjs} +2 -2
- package/dist/{form-CPm25cLE.cjs.map → form-DYaROiIF.cjs.map} +1 -1
- package/dist/form.cjs +1 -1
- package/dist/form.js +1 -1
- package/dist/{icon-baMFKlix.js → icon-BWnY3Sgg.js} +3 -3
- package/dist/{icon-baMFKlix.js.map → icon-BWnY3Sgg.js.map} +1 -1
- package/dist/{icon-DUTbI5sF.cjs → icon-D5bKkv2u.cjs} +2 -2
- package/dist/{icon-DUTbI5sF.cjs.map → icon-D5bKkv2u.cjs.map} +1 -1
- package/dist/{icon-button-M79Lwelv.cjs → icon-button-DPm9yazs.cjs} +2 -2
- package/dist/{icon-button-M79Lwelv.cjs.map → icon-button-DPm9yazs.cjs.map} +1 -1
- package/dist/{icon-button-Dytz2u7f.js → icon-button-iP7bvDh9.js} +3 -3
- package/dist/{icon-button-Dytz2u7f.js.map → icon-button-iP7bvDh9.js.map} +1 -1
- package/dist/icons.cjs +1 -1
- package/dist/icons.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +122 -121
- package/dist/{input-D390Osy4.js → input-Ca6zzXC1.js} +2 -2
- package/dist/{input-D390Osy4.js.map → input-Ca6zzXC1.js.map} +1 -1
- package/dist/{input-C2wFU_S6.cjs → input-DxJNIkJF.cjs} +2 -2
- package/dist/{input-C2wFU_S6.cjs.map → input-DxJNIkJF.cjs.map} +1 -1
- package/dist/input.cjs +1 -1
- package/dist/input.js +1 -1
- package/dist/layout.cjs +1 -1
- package/dist/layout.js +1 -1
- package/dist/{list-Bn-B6Pbl.cjs → list-BSiDxGZM.cjs} +2 -2
- package/dist/{list-Bn-B6Pbl.cjs.map → list-BSiDxGZM.cjs.map} +1 -1
- package/dist/{list-BJFvg0LF.js → list-D35IuiWE.js} +2 -2
- package/dist/{list-BJFvg0LF.js.map → list-D35IuiWE.js.map} +1 -1
- package/dist/list.cjs +1 -1
- package/dist/list.js +1 -1
- package/dist/{litElement.mixin-CwAqMl79.cjs → litElement.mixin-BDAc5mMz.cjs} +2 -2
- package/dist/{litElement.mixin-CwAqMl79.cjs.map → litElement.mixin-BDAc5mMz.cjs.map} +1 -1
- package/dist/{litElement.mixin-CRbxrdrS.js → litElement.mixin-DamySMT5.js} +2 -2
- package/dist/{litElement.mixin-CRbxrdrS.js.map → litElement.mixin-DamySMT5.js.map} +1 -1
- package/dist/{menu-5krKi7zq.js → menu-BvEZcVjD.js} +3 -3
- package/dist/{menu-5krKi7zq.js.map → menu-BvEZcVjD.js.map} +1 -1
- package/dist/{menu-D6SHzgaV.cjs → menu-DO4J9xKl.cjs} +2 -2
- package/dist/{menu-D6SHzgaV.cjs.map → menu-DO4J9xKl.cjs.map} +1 -1
- package/dist/menu.cjs +1 -1
- package/dist/menu.js +1 -1
- package/dist/nav-drawer.cjs +1 -1
- package/dist/nav-drawer.js +1 -1
- package/dist/{notification-container-wVKpwK8s.js → notification-service-5KQWCCvu.js} +127 -94
- package/dist/notification-service-5KQWCCvu.js.map +1 -0
- package/dist/{notification-container-DUtK-Voc.cjs → notification-service-BFepRkx9.cjs} +19 -19
- package/dist/notification-service-BFepRkx9.cjs.map +1 -0
- package/dist/notification.cjs +1 -1
- package/dist/notification.js +5 -7
- package/dist/notification.js.map +1 -1
- package/dist/{option-BAMNOMye.js → option-DG1Ko33C.js} +2 -2
- package/dist/{option-BAMNOMye.js.map → option-DG1Ko33C.js.map} +1 -1
- package/dist/{option-DBh0pEws.cjs → option-DzxWSiKo.cjs} +2 -2
- package/dist/{option-DBh0pEws.cjs.map → option-DzxWSiKo.cjs.map} +1 -1
- package/dist/option.cjs +1 -1
- package/dist/option.js +1 -1
- package/dist/{payment-card-form-CklVDo7L.cjs → payment-card-form-DxD9nGB0.cjs} +2 -2
- package/dist/{payment-card-form-CklVDo7L.cjs.map → payment-card-form-DxD9nGB0.cjs.map} +1 -1
- package/dist/{payment-card-form-CNWsIJhu.js → payment-card-form-qTHGWvQQ.js} +3 -3
- package/dist/{payment-card-form-CNWsIJhu.js.map → payment-card-form-qTHGWvQQ.js.map} +1 -1
- package/dist/{radio-group-CRXQ4ajE.js → radio-group-S32ENLKc.js} +2 -2
- package/dist/{radio-group-CRXQ4ajE.js.map → radio-group-S32ENLKc.js.map} +1 -1
- package/dist/{radio-group-8d4MJqaa.cjs → radio-group-ujiKRIzu.cjs} +2 -2
- package/dist/{radio-group-8d4MJqaa.cjs.map → radio-group-ujiKRIzu.cjs.map} +1 -1
- package/dist/radio-group.cjs +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/rxjs-utils.js +4 -4
- package/dist/{schmancy-steps-container-KinQK3rz.cjs → schmancy-steps-container-C0r65UXb.cjs} +2 -2
- package/dist/{schmancy-steps-container-KinQK3rz.cjs.map → schmancy-steps-container-C0r65UXb.cjs.map} +1 -1
- package/dist/{schmancy-steps-container-DzeJED2U.js → schmancy-steps-container-C2bF45xo.js} +2 -2
- package/dist/{schmancy-steps-container-DzeJED2U.js.map → schmancy-steps-container-C2bF45xo.js.map} +1 -1
- package/dist/{select-DlblA74_.cjs → select-8C2C6mqT.cjs} +2 -2
- package/dist/{select-DlblA74_.cjs.map → select-8C2C6mqT.cjs.map} +1 -1
- package/dist/{select-dxNE4mnd.js → select-OC2POpYJ.js} +3 -3
- package/dist/{select-dxNE4mnd.js.map → select-OC2POpYJ.js.map} +1 -1
- package/dist/select.cjs +1 -1
- package/dist/select.js +1 -1
- package/dist/selector-hook-omsuyAOu.js.map +1 -1
- package/dist/{sheet-D2sUghqi.cjs → sheet-5NN9kqLw.cjs} +2 -2
- package/dist/{sheet-D2sUghqi.cjs.map → sheet-5NN9kqLw.cjs.map} +1 -1
- package/dist/{sheet-CAs7kMKz.js → sheet-K0eVqQGM.js} +3 -3
- package/dist/{sheet-CAs7kMKz.js.map → sheet-K0eVqQGM.js.map} +1 -1
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.js +1 -1
- package/dist/{slider-DCysIErg.js → slider-pthecQmM.js} +3 -3
- package/dist/{slider-DCysIErg.js.map → slider-pthecQmM.js.map} +1 -1
- package/dist/{slider-VShAooYp.cjs → slider-zbnPbKrH.cjs} +2 -2
- package/dist/{slider-VShAooYp.cjs.map → slider-zbnPbKrH.cjs.map} +1 -1
- package/dist/slider.cjs +1 -1
- package/dist/slider.js +1 -1
- package/dist/{spinner-UC31R_xS.js → spinner-BA-AdJft.js} +3 -3
- package/dist/{spinner-UC31R_xS.js.map → spinner-BA-AdJft.js.map} +1 -1
- package/dist/{spinner-Dv-uGeoR.cjs → spinner-DJUPKRaj.cjs} +2 -2
- package/dist/{spinner-Dv-uGeoR.cjs.map → spinner-DJUPKRaj.cjs.map} +1 -1
- package/dist/steps.cjs +1 -1
- package/dist/steps.js +1 -1
- package/dist/{surface-ClnnQP3o.cjs → surface-B0EP0wlI.cjs} +2 -2
- package/dist/{surface-ClnnQP3o.cjs.map → surface-B0EP0wlI.cjs.map} +1 -1
- package/dist/{surface-B3v9NfAj.js → surface-MaIcngHu.js} +2 -2
- package/dist/{surface-B3v9NfAj.js.map → surface-MaIcngHu.js.map} +1 -1
- package/dist/surface.cjs +1 -1
- package/dist/surface.js +1 -1
- package/dist/{table-CWDtSTrW.cjs → table-DSg5xpqj.cjs} +2 -2
- package/dist/{table-CWDtSTrW.cjs.map → table-DSg5xpqj.cjs.map} +1 -1
- package/dist/{table-BZ4h621V.js → table-y955qHc7.js} +2 -2
- package/dist/{table-BZ4h621V.js.map → table-y955qHc7.js.map} +1 -1
- package/dist/table.cjs +1 -1
- package/dist/table.js +1 -1
- package/dist/{tabs-group-WJjM75TT.js → tabs-group-CDVLZfL5.js} +2 -2
- package/dist/{tabs-group-WJjM75TT.js.map → tabs-group-CDVLZfL5.js.map} +1 -1
- package/dist/{tabs-group-Bb4uOpJc.cjs → tabs-group-Dd-mfajz.cjs} +2 -2
- package/dist/{tabs-group-Bb4uOpJc.cjs.map → tabs-group-Dd-mfajz.cjs.map} +1 -1
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.js +1 -1
- package/dist/tailwind.mixin-CAvg5VIG.cjs +2 -0
- package/dist/{tailwind.mixin-DLuYz9Iz.cjs.map → tailwind.mixin-CAvg5VIG.cjs.map} +1 -1
- package/dist/tailwind.mixin-CgdpQXVy.js +43 -0
- package/dist/{tailwind.mixin-B_hJc1PP.js.map → tailwind.mixin-CgdpQXVy.js.map} +1 -1
- package/dist/teleport.cjs +1 -1
- package/dist/{teleport.component-Dxn-H8Xp.js → teleport.component-BQoWidXp.js} +43 -42
- package/dist/{teleport.component-Dxn-H8Xp.js.map → teleport.component-BQoWidXp.js.map} +1 -1
- package/dist/{teleport.component-BivAjnQn.cjs → teleport.component-BYnumidn.cjs} +2 -2
- package/dist/{teleport.component-BivAjnQn.cjs.map → teleport.component-BYnumidn.cjs.map} +1 -1
- package/dist/teleport.js +1 -1
- package/dist/{textarea-B5V4jvIX.js → textarea-CCD5vT2R.js} +2 -2
- package/dist/{textarea-B5V4jvIX.js.map → textarea-CCD5vT2R.js.map} +1 -1
- package/dist/{textarea-B3_G9W-u.cjs → textarea-znssoPdJ.cjs} +2 -2
- package/dist/{textarea-B3_G9W-u.cjs.map → textarea-znssoPdJ.cjs.map} +1 -1
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.js +1 -1
- package/dist/{theme-button-C6pyxtwQ.cjs → theme-button-BMe6kTMr.cjs} +2 -2
- package/dist/{theme-button-C6pyxtwQ.cjs.map → theme-button-BMe6kTMr.cjs.map} +1 -1
- package/dist/{theme-button-D-ojrnYh.js → theme-button-ByhGFrM6.js} +2 -2
- package/dist/{theme-button-D-ojrnYh.js.map → theme-button-ByhGFrM6.js.map} +1 -1
- package/dist/theme-button.cjs +1 -1
- package/dist/theme-button.js +1 -1
- package/dist/theme.cjs +1 -1
- package/dist/{theme.component-B6Hvc574.js → theme.component-BLmnJdq6.js} +2 -2
- package/dist/{theme.component-B6Hvc574.js.map → theme.component-BLmnJdq6.js.map} +1 -1
- package/dist/{theme.component-DR4uOck9.cjs → theme.component-CJDShQ7P.cjs} +2 -2
- package/dist/{theme.component-DR4uOck9.cjs.map → theme.component-CJDShQ7P.cjs.map} +1 -1
- package/dist/theme.js +1 -1
- package/dist/{timezone-vGpDPCRT.cjs → timezone-BxvSIDGa.cjs} +2 -2
- package/dist/{timezone-vGpDPCRT.cjs.map → timezone-BxvSIDGa.cjs.map} +1 -1
- package/dist/{timezone-CyDIsW4A.js → timezone-DKHJwBwL.js} +3 -3
- package/dist/{timezone-CyDIsW4A.js.map → timezone-DKHJwBwL.js.map} +1 -1
- package/dist/{tooltip-BJ_lQc8I.cjs → tooltip-BU1ScbI9.cjs} +2 -2
- package/dist/{tooltip-BJ_lQc8I.cjs.map → tooltip-BU1ScbI9.cjs.map} +1 -1
- package/dist/{tooltip-Ck-JUG_m.js → tooltip-DLLzuUKg.js} +2 -2
- package/dist/{tooltip-Ck-JUG_m.js.map → tooltip-DLLzuUKg.js.map} +1 -1
- package/dist/tooltip.cjs +1 -1
- package/dist/tooltip.js +1 -1
- package/dist/{tree-plC4VSNF.cjs → tree-DJ0dLSbg.cjs} +2 -2
- package/dist/{tree-plC4VSNF.cjs.map → tree-DJ0dLSbg.cjs.map} +1 -1
- package/dist/{tree-BE0sci4r.js → tree-Dxc1tbC8.js} +2 -2
- package/dist/{tree-BE0sci4r.js.map → tree-Dxc1tbC8.js.map} +1 -1
- package/dist/tree.cjs +1 -1
- package/dist/tree.js +1 -1
- package/dist/{typewriter-bUthirMf.js → typewriter-BhxAnEeh.js} +4 -4
- package/dist/{typewriter-bUthirMf.js.map → typewriter-BhxAnEeh.js.map} +1 -1
- package/dist/{typewriter-CwrZhpWq.cjs → typewriter-a5uyOTf4.cjs} +2 -2
- package/dist/{typewriter-CwrZhpWq.cjs.map → typewriter-a5uyOTf4.cjs.map} +1 -1
- package/dist/typewriter.cjs +1 -1
- package/dist/typewriter.js +1 -1
- package/dist/{typography-CRoZbt0O.cjs → typography-BbsRPqla.cjs} +2 -2
- package/dist/{typography-CRoZbt0O.cjs.map → typography-BbsRPqla.cjs.map} +1 -1
- package/dist/{typography-BB5uUnkZ.js → typography-agkJjhZH.js} +2 -2
- package/dist/{typography-BB5uUnkZ.js.map → typography-agkJjhZH.js.map} +1 -1
- package/dist/typography.cjs +1 -1
- package/dist/typography.js +1 -1
- package/package.json +1 -1
- package/types/src/dropdown/dropdown-component.d.ts +52 -0
- package/types/src/dropdown/dropdown-content.d.ts +32 -0
- package/types/src/dropdown/index.d.ts +2 -0
- package/types/src/index.d.ts +1 -0
- package/types/src/notification/index.d.ts +1 -1
- package/types/src/notification/notification-service.d.ts +20 -0
- package/dist/notification-container-DUtK-Voc.cjs.map +0 -1
- package/dist/notification-container-wVKpwK8s.js.map +0 -1
- package/dist/notification-service-DWeUoHi2.js +0 -29
- package/dist/notification-service-DWeUoHi2.js.map +0 -1
- package/dist/notification-service-DXXrRCmK.cjs +0 -2
- package/dist/notification-service-DXXrRCmK.cjs.map +0 -1
- package/dist/tailwind.mixin-B_hJc1PP.js +0 -43
- package/dist/tailwind.mixin-DLuYz9Iz.cjs +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-
|
|
1
|
+
{"version":3,"file":"menu-BvEZcVjD.js","sources":["../src/menu/menu-item.ts","../src/menu/menu.ts"],"sourcesContent":["import { $LitElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\nimport { fromEvent, takeUntil } from 'rxjs'\n\n@customElement('schmancy-menu-item')\nexport default class SchmancyMenuItem extends $LitElement(css`\n\t:host {\n\t\tdisplay: block;\n\t}\n`) {\n\tconnectedCallback(): void {\n\t\tsuper.connectedCallback()\n\t\tfromEvent(this, 'click')\n\t\t\t.pipe(takeUntil(this.disconnecting))\n\t\t\t.subscribe(e => {\n\t\t\t\te.stopPropagation()\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent('schmancy-menu-item-click', {\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t})\n\t}\n\tprotected render(): unknown {\n\t\treturn html`\n\t\t\t<schmancy-list-item>\n\t\t\t\t<slot></slot>\n\t\t\t</schmancy-list-item>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-menu-item': SchmancyMenuItem\n\t}\n}\n","import { autoUpdate, computePosition, flip, offset, shift, size } from '@floating-ui/dom'\nimport { TailwindElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, query, queryAssignedElements } from 'lit/decorators.js'\nimport { filter, fromEvent, takeUntil, tap } from 'rxjs'\n\n@customElement('schmancy-menu')\nexport default class SchmancyMenu extends TailwindElement(css`\n\t:host {\n\t\tposition: relative;\n\t\tdisplay: inline-block;\n\t}\n\n\t#menu {\n\t\tdisplay: none;\n\t}\n\n\t#menu[data-show='true'] {\n\t\tdisplay: block;\n\t}\n`) {\n\t@queryAssignedElements({ flatten: true, slot: 'button' })\n\tbuttonElement!: Array<HTMLElement>\n\n\t@query('#menu') menuElement!: HTMLElement\n\n\tprivate cleanup?: any\n\n\tprivate getMiddleware() {\n\t\treturn [\n\t\t\toffset(5),\n\t\t\tflip(),\n\t\t\tshift({ padding: 5 }),\n\t\t\tsize({\n\t\t\t\tapply({ availableHeight, elements }) {\n\t\t\t\t\telements.floating.style.maxHeight = `${availableHeight}px`\n\t\t\t\t},\n\t\t\t}),\n\t\t]\n\t}\n\n\tasync updatePosition() {\n\t\tif (!this.buttonElement[0] || !this.menuElement) {\n\t\t\treturn\n\t\t}\n\n\t\tawait computePosition(this.buttonElement[0], this.menuElement, {\n\t\t\tplacement: 'bottom-start',\n\t\t\tmiddleware: this.getMiddleware(),\n\t\t}).then(({ x, y }) => {\n\t\t\tObject.assign(this.menuElement.style, {\n\t\t\t\tleft: `${x}px`,\n\t\t\t\ttop: `${y}px`,\n\t\t\t})\n\t\t})\n\t}\n\n\tprivate showMenu() {\n\t\tif (!this.buttonElement[0] || !this.menuElement) return\n\n\t\tthis.menuElement.dataset.show = 'true'\n\n\t\tthis.cleanup = autoUpdate(this.buttonElement[0], this.menuElement, () => {\n\t\t\tcomputePosition(this.buttonElement[0], this.menuElement, {\n\t\t\t\tplacement: 'bottom-start',\n\t\t\t\tmiddleware: this.getMiddleware(),\n\t\t\t}).then(({ x, y, strategy }) => {\n\t\t\t\tObject.assign(this.menuElement.style, {\n\t\t\t\t\tleft: `${x}px`,\n\t\t\t\t\ttop: `${y}px`,\n\t\t\t\t\tposition: strategy,\n\t\t\t\t})\n\t\t\t})\n\t\t})\n\n\t\tconst animation = this.menuElement.animate(\n\t\t\t[\n\t\t\t\t{ opacity: 0, transform: 'scale(0.95)' },\n\t\t\t\t{ opacity: 1, transform: 'scale(1)' },\n\t\t\t],\n\t\t\t{\n\t\t\t\tduration: 100,\n\t\t\t\teasing: 'cubic-bezier(0.55, 0.085, 0.68, 0.53)',\n\t\t\t},\n\t\t)\n\n\t\tanimation.onfinish = () => {}\n\t}\n\n\tprivate async hideMenu() {\n\t\t// Make hideMenu async\n\t\tif (this.cleanup) {\n\t\t\tawait this.cleanup() // Await the cleanup!\n\t\t\tthis.cleanup = undefined\n\t\t}\n\t\tthis.menuElement.dataset.show = 'false'\n\n\t\tconst animation = this.menuElement.animate(\n\t\t\t[\n\t\t\t\t{ opacity: 1, transform: 'scale(1)' },\n\t\t\t\t{ opacity: 0, transform: 'scale(0.95)' },\n\t\t\t],\n\t\t\t{\n\t\t\t\tduration: 75,\n\t\t\t\teasing: 'cubic-bezier(0.55, 0.085, 0.68, 0.53)',\n\t\t\t},\n\t\t)\n\t\tanimation.onfinish = () => {} // No need for a promise now\n\t}\n\n\tfirstUpdated(): void {\n\t\tfromEvent(this.buttonElement, 'click')\n\t\t\t.pipe(\n\t\t\t\ttap(e => e.stopPropagation()),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(() => {\n\t\t\t\tthis.showMenu()\n\t\t\t})\n\n\t\tfromEvent(this, 'schmancy-menu-item-click')\n\t\t\t.pipe(\n\t\t\t\ttap(e => e.stopPropagation()),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(() => {\n\t\t\t\tthis.hideMenu()\n\t\t\t})\n\n\t\tfromEvent(document, 'click')\n\t\t\t.pipe(\n\t\t\t\tfilter((e: Event) => !this.contains(e.target as Node)),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t\ttap(() => {\n\t\t\t\t\tif (this.menuElement.dataset.show === 'true') {\n\t\t\t\t\t\tthis.hideMenu()\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\n\trender() {\n\t\treturn html`\n\t\t\t<slot name=\"button\">\n\t\t\t\t<schmancy-icon-button> more_vert </schmancy-icon-button>\n\t\t\t</slot>\n\t\t\t<ul\n\t\t\t\tid=\"menu\"\n\t\t\t\tclass=\"absolute z-50 border-outlineVariant rounded-md min-w-[160px] max-w-[320px] w-max bg-surface-default max-h-[90vh] shadow-1 overflow-y-auto\"\n\t\t\t\trole=\"menu\"\n\t\t\t\taria-orientation=\"vertical\"\n\t\t\t\taria-labelledby=\"options-menu-4-button\"\n\t\t\t>\n\t\t\t\t<slot></slot>\n\t\t\t</ul>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-menu': SchmancyMenu\n\t}\n}\n"],"names":["SchmancyMenuItem","$LitElement","css","super","connectedCallback","fromEvent","this","pipe","takeUntil","disconnecting","subscribe","e","stopPropagation","dispatchEvent","CustomEvent","bubbles","composed","render","html","customElement","SchmancyMenu","TailwindElement","getMiddleware","offset","flip","shift","padding","size","availableHeight","elements","floating","style","maxHeight","updatePosition","buttonElement","menuElement","computePosition","placement","middleware","then","x","y","Object","assign","left","top","dataset","show","cleanup","autoUpdate","strategy","position","animate","opacity","transform","duration","easing","onfinish","firstUpdated","tap","showMenu","hideMenu","document","filter","contains","target","__decorateClass","queryAssignedElements","flatten","slot","prototype","query"],"mappings":";;;;;;;;;AAMA,IAAqBA,IAArB,cAA8CC,EAAYC;AAAAA;AAAAA;AAAAA;AAAAA,CAKzD,EAAA;AAAA,EAAA,oBACCC;AAAAA,UAAMC,kBACIC,GAAAA,EAAAC,MAAM,OAAA,EACdC,KAAKC,EAAUF,KAAKG,aAAAA,CAAAA,EACpBC,UAAeC,OAAAA;AACfA,QAAEC,gBAAAA,GACGN,KAAAO,cACJ,IAAIC,YAAY,4BAA4B,EAC3CC,SAAS,IACTC,UAAU,GAAA,CAAA,CAAA;AAAA,IAEZ,CACA;AAAA,EAAA;AAAA,EAEO,SAAAC;AACF,WAAAC;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,EAAA;AApBYlB;AAAAA;;;GAArB,CADCmB,EAAc,wBACMnB;;;;;ACCrB,IAAqBoB,IAArB,cAA0CC,EAAgBnB;AAAAA;AAAAA;AAAAA;AAAAA;A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hBnD,CAAAA,EAAAA,UAAAA;AAAAA,EAAU;AAAA,EAGb,SACQ;AAAA,WAAAQ;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,EAAA;AAzHRgD;AAAAA,EAAA,CADCC,EAAsB,EAAEC,SAAAA,IAAeC,MAAM,SAAA,CAAA,CAAA,GAd1BjD,EAepBkD,WAAA,iBAAA,CAAA,GAEgBJ,EAAA,CAAfK,EAAM,OAjBanD,CAAAA,GAAAA,EAiBJkD,WAAA,eAAA,IAjBIlD,IAArB8C,EAAA,CADC/C,EAAc,eACMC,CAAAA,GAAAA,CAAAA;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const i=require("rxjs");require("lit/directives/class-map.js"),require("lit/directives/style-map.js");const d=require("./litElement.mixin-
|
|
1
|
+
"use strict";const i=require("rxjs");require("lit/directives/class-map.js"),require("lit/directives/style-map.js");const d=require("./litElement.mixin-BDAc5mMz.cjs"),b=require("./tailwind.mixin-CAvg5VIG.cjs"),u=require("lit"),c=require("lit/decorators.js"),l=require("@floating-ui/dom");var y=Object.getOwnPropertyDescriptor;let p=class extends d.$LitElement(u.css`
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
}
|
|
@@ -33,4 +33,4 @@
|
|
|
33
33
|
<slot></slot>
|
|
34
34
|
</ul>
|
|
35
35
|
`}};h([c.queryAssignedElements({flatten:!0,slot:"button"})],m.prototype,"buttonElement",2),h([c.query("#menu")],m.prototype,"menuElement",2),m=h([c.customElement("schmancy-menu")],m);
|
|
36
|
-
//# sourceMappingURL=menu-
|
|
36
|
+
//# sourceMappingURL=menu-DO4J9xKl.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-
|
|
1
|
+
{"version":3,"file":"menu-DO4J9xKl.cjs","sources":["../src/menu/menu-item.ts","../src/menu/menu.ts"],"sourcesContent":["import { $LitElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\nimport { fromEvent, takeUntil } from 'rxjs'\n\n@customElement('schmancy-menu-item')\nexport default class SchmancyMenuItem extends $LitElement(css`\n\t:host {\n\t\tdisplay: block;\n\t}\n`) {\n\tconnectedCallback(): void {\n\t\tsuper.connectedCallback()\n\t\tfromEvent(this, 'click')\n\t\t\t.pipe(takeUntil(this.disconnecting))\n\t\t\t.subscribe(e => {\n\t\t\t\te.stopPropagation()\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent('schmancy-menu-item-click', {\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t})\n\t}\n\tprotected render(): unknown {\n\t\treturn html`\n\t\t\t<schmancy-list-item>\n\t\t\t\t<slot></slot>\n\t\t\t</schmancy-list-item>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-menu-item': SchmancyMenuItem\n\t}\n}\n","import { autoUpdate, computePosition, flip, offset, shift, size } from '@floating-ui/dom'\nimport { TailwindElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, query, queryAssignedElements } from 'lit/decorators.js'\nimport { filter, fromEvent, takeUntil, tap } from 'rxjs'\n\n@customElement('schmancy-menu')\nexport default class SchmancyMenu extends TailwindElement(css`\n\t:host {\n\t\tposition: relative;\n\t\tdisplay: inline-block;\n\t}\n\n\t#menu {\n\t\tdisplay: none;\n\t}\n\n\t#menu[data-show='true'] {\n\t\tdisplay: block;\n\t}\n`) {\n\t@queryAssignedElements({ flatten: true, slot: 'button' })\n\tbuttonElement!: Array<HTMLElement>\n\n\t@query('#menu') menuElement!: HTMLElement\n\n\tprivate cleanup?: any\n\n\tprivate getMiddleware() {\n\t\treturn [\n\t\t\toffset(5),\n\t\t\tflip(),\n\t\t\tshift({ padding: 5 }),\n\t\t\tsize({\n\t\t\t\tapply({ availableHeight, elements }) {\n\t\t\t\t\telements.floating.style.maxHeight = `${availableHeight}px`\n\t\t\t\t},\n\t\t\t}),\n\t\t]\n\t}\n\n\tasync updatePosition() {\n\t\tif (!this.buttonElement[0] || !this.menuElement) {\n\t\t\treturn\n\t\t}\n\n\t\tawait computePosition(this.buttonElement[0], this.menuElement, {\n\t\t\tplacement: 'bottom-start',\n\t\t\tmiddleware: this.getMiddleware(),\n\t\t}).then(({ x, y }) => {\n\t\t\tObject.assign(this.menuElement.style, {\n\t\t\t\tleft: `${x}px`,\n\t\t\t\ttop: `${y}px`,\n\t\t\t})\n\t\t})\n\t}\n\n\tprivate showMenu() {\n\t\tif (!this.buttonElement[0] || !this.menuElement) return\n\n\t\tthis.menuElement.dataset.show = 'true'\n\n\t\tthis.cleanup = autoUpdate(this.buttonElement[0], this.menuElement, () => {\n\t\t\tcomputePosition(this.buttonElement[0], this.menuElement, {\n\t\t\t\tplacement: 'bottom-start',\n\t\t\t\tmiddleware: this.getMiddleware(),\n\t\t\t}).then(({ x, y, strategy }) => {\n\t\t\t\tObject.assign(this.menuElement.style, {\n\t\t\t\t\tleft: `${x}px`,\n\t\t\t\t\ttop: `${y}px`,\n\t\t\t\t\tposition: strategy,\n\t\t\t\t})\n\t\t\t})\n\t\t})\n\n\t\tconst animation = this.menuElement.animate(\n\t\t\t[\n\t\t\t\t{ opacity: 0, transform: 'scale(0.95)' },\n\t\t\t\t{ opacity: 1, transform: 'scale(1)' },\n\t\t\t],\n\t\t\t{\n\t\t\t\tduration: 100,\n\t\t\t\teasing: 'cubic-bezier(0.55, 0.085, 0.68, 0.53)',\n\t\t\t},\n\t\t)\n\n\t\tanimation.onfinish = () => {}\n\t}\n\n\tprivate async hideMenu() {\n\t\t// Make hideMenu async\n\t\tif (this.cleanup) {\n\t\t\tawait this.cleanup() // Await the cleanup!\n\t\t\tthis.cleanup = undefined\n\t\t}\n\t\tthis.menuElement.dataset.show = 'false'\n\n\t\tconst animation = this.menuElement.animate(\n\t\t\t[\n\t\t\t\t{ opacity: 1, transform: 'scale(1)' },\n\t\t\t\t{ opacity: 0, transform: 'scale(0.95)' },\n\t\t\t],\n\t\t\t{\n\t\t\t\tduration: 75,\n\t\t\t\teasing: 'cubic-bezier(0.55, 0.085, 0.68, 0.53)',\n\t\t\t},\n\t\t)\n\t\tanimation.onfinish = () => {} // No need for a promise now\n\t}\n\n\tfirstUpdated(): void {\n\t\tfromEvent(this.buttonElement, 'click')\n\t\t\t.pipe(\n\t\t\t\ttap(e => e.stopPropagation()),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(() => {\n\t\t\t\tthis.showMenu()\n\t\t\t})\n\n\t\tfromEvent(this, 'schmancy-menu-item-click')\n\t\t\t.pipe(\n\t\t\t\ttap(e => e.stopPropagation()),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(() => {\n\t\t\t\tthis.hideMenu()\n\t\t\t})\n\n\t\tfromEvent(document, 'click')\n\t\t\t.pipe(\n\t\t\t\tfilter((e: Event) => !this.contains(e.target as Node)),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t\ttap(() => {\n\t\t\t\t\tif (this.menuElement.dataset.show === 'true') {\n\t\t\t\t\t\tthis.hideMenu()\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\n\trender() {\n\t\treturn html`\n\t\t\t<slot name=\"button\">\n\t\t\t\t<schmancy-icon-button> more_vert </schmancy-icon-button>\n\t\t\t</slot>\n\t\t\t<ul\n\t\t\t\tid=\"menu\"\n\t\t\t\tclass=\"absolute z-50 border-outlineVariant rounded-md min-w-[160px] max-w-[320px] w-max bg-surface-default max-h-[90vh] shadow-1 overflow-y-auto\"\n\t\t\t\trole=\"menu\"\n\t\t\t\taria-orientation=\"vertical\"\n\t\t\t\taria-labelledby=\"options-menu-4-button\"\n\t\t\t>\n\t\t\t\t<slot></slot>\n\t\t\t</ul>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-menu': SchmancyMenu\n\t}\n}\n"],"names":["SchmancyMenuItem","$LitElement","css","super","connectedCallback","fromEvent","this","pipe","takeUntil","disconnecting","subscribe","e","stopPropagation","dispatchEvent","CustomEvent","bubbles","composed","html","customElement","SchmancyMenu","TailwindElement","offset","flip","shift","padding","size","apply","availableHeight","elements","floating","style","maxHeight","updatePosition","buttonElement","menuElement","computePosition","placement","middleware","getMiddleware","then","x","y","Object","assign","left","top","dataset","show","cleanup","autoUpdate","strategy","position","animate","opacity","transform","duration","easing","onfinish","tap","showMenu","hideMenu","document","filter","contains","target","__decorateClass","queryAssignedElements","flatten","slot","prototype","query"],"mappings":"qUAMA,IAAqBA,EAArB,cAA8CC,EAAAA,YAAYC,EAAAA;AAAAA;AAAAA;AAAAA;AAAAA,CAKzD,CAAA,CAAA,mBACCC,CAAAA,MAAMC,kBACIC,EAAAA,EAAAA,UAAAC,KAAM,OAAA,EACdC,KAAKC,EAAAA,UAAUF,KAAKG,aACpBC,CAAAA,EAAAA,UAAeC,IACfA,EAAEC,gBAAAA,EACGN,KAAAO,cACJ,IAAIC,YAAY,2BAA4B,CAC3CC,WACAC,SAAAA,EAEF,CAAA,CAAA,CAAA,CAAA,CACA,CAEO,QACF,CAAA,OAAAC,EAAAA;AAAAA;AAAAA;AAAAA;AAAAA,GAAA,CApBYjB,EAAAA,wGAArB,CADCkB,EAAAA,cAAc,oBAAA,CAAA,EACMlB,mMCCrB,IAAqBmB,EAArB,cAA0CC,EAAAA,gBAAgBlB,EAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,CAqBjD,CAAA,CAAA,eACA,CAAA,MAAA,CACNmB,EAAAA,OAAO,CAAA,EACPC,SACAC,QAAM,CAAEC,QAAS,CACjBC,CAAAA,EAAAA,OAAK,CACJ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AAM,QAAA,CAAA,CAAA,EAd1BjD,EAepBkD,UAAA,gBAAA,CAAA,EAEgBJ,EAAA,CAAfK,EAAAA,MAAM,OAjBanD,CAAAA,EAAAA,EAiBJkD,UAAA,cAAA,CAjBIlD,EAAAA,EAArB8C,EAAA,CADC/C,EAAAA,cAAc,eACMC,CAAAA,EAAAA,CAAAA"}
|
package/dist/menu.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";require("./menu-
|
|
1
|
+
"use strict";require("./menu-DO4J9xKl.cjs");
|
|
2
2
|
//# sourceMappingURL=menu.cjs.map
|
package/dist/menu.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import "./menu-
|
|
1
|
+
import "./menu-BvEZcVjD.js";
|
|
2
2
|
//# sourceMappingURL=menu.js.map
|
package/dist/nav-drawer.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./teleport.component-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./teleport.component-BYnumidn.cjs");exports.$drawer=e.$drawer,Object.defineProperty(exports,"SchmancyDrawerAppbar",{enumerable:!0,get:()=>e.SchmancyDrawerAppbar}),exports.SchmancyDrawerNavbarMode=e.SchmancyDrawerNavbarMode,exports.SchmancyDrawerNavbarState=e.SchmancyDrawerNavbarState,Object.defineProperty(exports,"SchmancyNavigationDrawer",{enumerable:!0,get:()=>e.SchmancyNavigationDrawer}),Object.defineProperty(exports,"SchmancyNavigationDrawerContent",{enumerable:!0,get:()=>e.SchmancyNavigationDrawerContent}),Object.defineProperty(exports,"SchmancyNavigationDrawerSidebar",{enumerable:!0,get:()=>e.SchmancyNavigationDrawerSidebar}),exports.schmancyNavDrawer=e.schmancyNavDrawer;
|
|
2
2
|
//# sourceMappingURL=nav-drawer.cjs.map
|
package/dist/nav-drawer.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { fromEvent as
|
|
2
|
-
import { classMap as
|
|
3
|
-
import { styleMap as
|
|
4
|
-
import { $ as
|
|
5
|
-
import "./tailwind.mixin-
|
|
6
|
-
import { c as
|
|
7
|
-
import { S as
|
|
1
|
+
import { fromEvent as S, takeUntil as C } from "rxjs";
|
|
2
|
+
import { classMap as b } from "lit/directives/class-map.js";
|
|
3
|
+
import { styleMap as V } from "lit/directives/style-map.js";
|
|
4
|
+
import { $ as A } from "./litElement.mixin-DamySMT5.js";
|
|
5
|
+
import "./tailwind.mixin-CgdpQXVy.js";
|
|
6
|
+
import { c as x } from "./ripple-BumgqsDT.js";
|
|
7
|
+
import { S as f } from "./theme.interface-C5Kj6WjD.js";
|
|
8
8
|
import { html as d } from "lit";
|
|
9
|
-
import { property as p, state as
|
|
10
|
-
import { repeat as
|
|
11
|
-
var
|
|
12
|
-
for (var o, n = i > 1 ? void 0 : i ?
|
|
13
|
-
return i && n &&
|
|
9
|
+
import { property as p, state as g, customElement as _ } from "lit/decorators.js";
|
|
10
|
+
import { repeat as k } from "lit/directives/repeat.js";
|
|
11
|
+
var $ = Object.defineProperty, R = Object.getOwnPropertyDescriptor, u = (s, t, e, i) => {
|
|
12
|
+
for (var o, n = i > 1 ? void 0 : i ? R(t, e) : t, a = s.length - 1; a >= 0; a--) (o = s[a]) && (n = (i ? o(t, e, n) : o(n)) || n);
|
|
13
|
+
return i && n && $(t, e, n), n;
|
|
14
14
|
};
|
|
15
|
-
let
|
|
15
|
+
let l = class extends A(":host{display:block;margin-bottom:10px}:host:last-child{margin-bottom:0}.notification{width:100%;max-width:400px;border-radius:8px;box-shadow:var(--schmancy-sys-elevation-2);overflow:hidden;transform:translate(0);opacity:1;transition:transform .3s ease-out,opacity .3s ease-out;background-color:var(--schmancy-sys-color-surface-container);color:var(--schmancy-sys-color-surface-on)}.notification.info{border-left:4px solid var(--schmancy-sys-color-primary-default)}.notification.success{border-left:4px solid var(--schmancy-sys-color-success-default)}.notification.warning{border-left:4px solid var(--schmancy-sys-color-tertiary-default)}.notification.error{border-left:4px solid var(--schmancy-sys-color-error-default)}.notification.closing{transform:translate(120%);opacity:0}.notification .notification-content{display:flex;padding:16px;align-items:flex-start;position:relative}.notification .icon-container{flex-shrink:0;margin-right:12px;display:flex;align-items:center;justify-content:center}.notification .content{flex:1;min-width:0;display:flex;flex-direction:column}.notification .title{font-weight:600;font-size:16px;margin-bottom:4px;word-break:break-word}.notification .message{font-size:14px;word-break:break-word}.notification .close-button{background:transparent;border:none;cursor:pointer;color:var(--schmancy-sys-color-surface-onVariant);padding:4px;margin-left:8px;border-radius:4px;display:flex;align-items:center;justify-content:center}.notification .close-button:hover{background-color:#0000000d}.notification .close-button:focus{outline:none;box-shadow:0 0 0 2px var(--schmancy-sys-color-primary-default)}.notification .progress-bar-container{height:4px;width:100%;background-color:#0000001a;overflow:hidden}.notification .progress-bar{height:100%;width:100%;transition:width .1s linear}") {
|
|
16
16
|
constructor() {
|
|
17
17
|
super(...arguments), this.title = "", this.message = "", this.type = "info", this.closable = !0, this.duration = 5e3, this.id = `notification-${Date.now()}-${Math.floor(1e4 * Math.random())}`, this.playSound = !0, this._visible = !0, this._progress = 100, this._hovered = !1, this._closing = !1;
|
|
18
18
|
}
|
|
@@ -22,17 +22,17 @@ let c = class extends T(":host{display:block;margin-bottom:10px}:host:last-child
|
|
|
22
22
|
disconnectedCallback() {
|
|
23
23
|
this._clearTimers(), super.disconnectedCallback();
|
|
24
24
|
}
|
|
25
|
-
updated(
|
|
26
|
-
super.updated(
|
|
25
|
+
updated(s) {
|
|
26
|
+
super.updated(s), s.has("duration") && this.duration > 0 && (this._clearTimers(), this._startAutoCloseTimer());
|
|
27
27
|
}
|
|
28
28
|
_startAutoCloseTimer() {
|
|
29
29
|
if (this.duration <= 0) return;
|
|
30
|
-
const
|
|
30
|
+
const s = Date.now() + this.duration;
|
|
31
31
|
this._autoCloseTimer = window.setTimeout(() => {
|
|
32
32
|
this.close();
|
|
33
33
|
}, this.duration), this._progressTimer = window.setInterval(() => {
|
|
34
34
|
if (this._hovered) return;
|
|
35
|
-
const t = Date.now(), e = Math.max(0,
|
|
35
|
+
const t = Date.now(), e = Math.max(0, s - t);
|
|
36
36
|
this._progress = e / this.duration * 100, e <= 0 && this._clearTimers();
|
|
37
37
|
}, 16);
|
|
38
38
|
}
|
|
@@ -44,16 +44,16 @@ let c = class extends T(":host{display:block;margin-bottom:10px}:host:last-child
|
|
|
44
44
|
}
|
|
45
45
|
_resumeTimers() {
|
|
46
46
|
if (this.duration > 0) {
|
|
47
|
-
const
|
|
48
|
-
if (
|
|
47
|
+
const s = this._progress / 100 * this.duration;
|
|
48
|
+
if (s > 0) {
|
|
49
49
|
this._autoCloseTimer = window.setTimeout(() => {
|
|
50
50
|
this.close();
|
|
51
|
-
},
|
|
52
|
-
const t = Date.now() +
|
|
51
|
+
}, s);
|
|
52
|
+
const t = Date.now() + s;
|
|
53
53
|
this._progressTimer = window.setInterval(() => {
|
|
54
54
|
if (this._hovered) return;
|
|
55
55
|
const e = Date.now(), i = Math.max(0, t - e);
|
|
56
|
-
this._progress = i /
|
|
56
|
+
this._progress = i / s * 100, i <= 0 && this._clearTimers();
|
|
57
57
|
}, 16);
|
|
58
58
|
}
|
|
59
59
|
}
|
|
@@ -74,17 +74,17 @@ let c = class extends T(":host{display:block;margin-bottom:10px}:host:last-child
|
|
|
74
74
|
}
|
|
75
75
|
render() {
|
|
76
76
|
if (!this._visible && this._closing) return d``;
|
|
77
|
-
const
|
|
77
|
+
const s = this._getTypeStyles();
|
|
78
78
|
return d`
|
|
79
79
|
<div
|
|
80
|
-
class=${
|
|
80
|
+
class=${b({ notification: !0, closing: this._closing, [this.type]: !0 })}
|
|
81
81
|
role="alert"
|
|
82
|
-
style=${
|
|
82
|
+
style=${V({ transform: this._closing ? "translateX(120%)" : "translateX(0)", opacity: this._closing ? "0" : "1" })}
|
|
83
83
|
@mouseenter=${this._handleMouseEnter}
|
|
84
84
|
@mouseleave=${this._handleMouseLeave}
|
|
85
85
|
>
|
|
86
86
|
<div class="notification-content">
|
|
87
|
-
<div class="icon-container" ${
|
|
87
|
+
<div class="icon-container" ${x({ color: s.iconColor })}>${s.icon}</div>
|
|
88
88
|
|
|
89
89
|
<div class="content">
|
|
90
90
|
${this.title ? d` <div class="title">${this.title}</div> ` : ""}
|
|
@@ -116,7 +116,7 @@ let c = class extends T(":host{display:block;margin-bottom:10px}:host:last-child
|
|
|
116
116
|
<div
|
|
117
117
|
class="progress-bar"
|
|
118
118
|
style="width: ${this._progress}%"
|
|
119
|
-
${
|
|
119
|
+
${x({ bgColor: s.progressColor })}
|
|
120
120
|
></div>
|
|
121
121
|
</div>
|
|
122
122
|
` : ""}
|
|
@@ -140,7 +140,7 @@ let c = class extends T(":host{display:block;margin-bottom:10px}:host:last-child
|
|
|
140
140
|
<path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path>
|
|
141
141
|
<polyline points="22 4 12 14.01 9 11.01"></polyline>
|
|
142
142
|
</svg>
|
|
143
|
-
`, iconColor:
|
|
143
|
+
`, iconColor: f.sys.color.success.default, progressColor: f.sys.color.success.default };
|
|
144
144
|
case "warning":
|
|
145
145
|
return { icon: d`
|
|
146
146
|
<svg
|
|
@@ -157,7 +157,7 @@ let c = class extends T(":host{display:block;margin-bottom:10px}:host:last-child
|
|
|
157
157
|
<line x1="12" y1="9" x2="12" y2="13"></line>
|
|
158
158
|
<line x1="12" y1="17" x2="12.01" y2="17"></line>
|
|
159
159
|
</svg>
|
|
160
|
-
`, iconColor:
|
|
160
|
+
`, iconColor: f.sys.color.tertiary.default, progressColor: f.sys.color.tertiary.default };
|
|
161
161
|
case "error":
|
|
162
162
|
return { icon: d`
|
|
163
163
|
<svg
|
|
@@ -174,7 +174,7 @@ let c = class extends T(":host{display:block;margin-bottom:10px}:host:last-child
|
|
|
174
174
|
<line x1="15" y1="9" x2="9" y2="15"></line>
|
|
175
175
|
<line x1="9" y1="9" x2="15" y2="15"></line>
|
|
176
176
|
</svg>
|
|
177
|
-
`, iconColor:
|
|
177
|
+
`, iconColor: f.sys.color.error.default, progressColor: f.sys.color.error.default };
|
|
178
178
|
default:
|
|
179
179
|
return { icon: d`
|
|
180
180
|
<svg
|
|
@@ -191,12 +191,12 @@ let c = class extends T(":host{display:block;margin-bottom:10px}:host:last-child
|
|
|
191
191
|
<line x1="12" y1="16" x2="12" y2="12"></line>
|
|
192
192
|
<line x1="12" y1="8" x2="12.01" y2="8"></line>
|
|
193
193
|
</svg>
|
|
194
|
-
`, iconColor:
|
|
194
|
+
`, iconColor: f.sys.color.primary.default, progressColor: f.sys.color.primary.default };
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
197
|
};
|
|
198
|
-
u([p({ type: String })],
|
|
199
|
-
class
|
|
198
|
+
u([p({ type: String })], l.prototype, "title", 2), u([p({ type: String })], l.prototype, "message", 2), u([p({ type: String })], l.prototype, "type", 2), u([p({ type: Boolean })], l.prototype, "closable", 2), u([p({ type: Number })], l.prototype, "duration", 2), u([p({ type: String })], l.prototype, "id", 2), u([p({ type: Boolean })], l.prototype, "playSound", 2), u([g()], l.prototype, "_visible", 2), u([g()], l.prototype, "_progress", 2), u([g()], l.prototype, "_hovered", 2), u([g()], l.prototype, "_closing", 2), u([g()], l.prototype, "_autoCloseTimer", 2), u([g()], l.prototype, "_progressTimer", 2), l = u([_("sch-notification")], l);
|
|
199
|
+
class O {
|
|
200
200
|
constructor() {
|
|
201
201
|
this.audioContext = null;
|
|
202
202
|
}
|
|
@@ -208,71 +208,71 @@ class $ {
|
|
|
208
208
|
return this.audioContext;
|
|
209
209
|
}
|
|
210
210
|
playInfoSound(t = 0.2) {
|
|
211
|
-
const e = this.getAudioContext(), i = e.currentTime, o = e.createOscillator(), n = e.createGain(),
|
|
212
|
-
o.type = "sine", o.frequency.setValueAtTime(392, i), o.frequency.exponentialRampToValueAtTime(523.25, i + 0.25),
|
|
211
|
+
const e = this.getAudioContext(), i = e.currentTime, o = e.createOscillator(), n = e.createGain(), a = e.createBiquadFilter();
|
|
212
|
+
o.type = "sine", o.frequency.setValueAtTime(392, i), o.frequency.exponentialRampToValueAtTime(523.25, i + 0.25), a.type = "lowpass", a.frequency.value = 1500, n.gain.setValueAtTime(1e-4, i), n.gain.exponentialRampToValueAtTime(t, i + 0.15), n.gain.exponentialRampToValueAtTime(1e-4, i + 0.4), o.connect(a).connect(n).connect(e.destination), o.start(i), o.stop(i + 0.45);
|
|
213
213
|
}
|
|
214
214
|
playSuccessSound(t = 0.2) {
|
|
215
|
-
const e = this.getAudioContext(), i = e.currentTime, o = (n,
|
|
216
|
-
const
|
|
217
|
-
|
|
215
|
+
const e = this.getAudioContext(), i = e.currentTime, o = (n, a, r) => {
|
|
216
|
+
const c = e.createOscillator(), w = e.createGain(), T = e.createBiquadFilter();
|
|
217
|
+
c.type = "sine", c.frequency.setValueAtTime(n, i), T.type = "lowpass", T.frequency.value = 4 * n, w.gain.setValueAtTime(1e-4, i), w.gain.exponentialRampToValueAtTime(t, i + 0.1), w.gain.exponentialRampToValueAtTime(1e-4, i + r), c.connect(T).connect(w).connect(e.destination), c.start(i + a), c.stop(i + r);
|
|
218
218
|
};
|
|
219
219
|
o(659.25, 0, 0.6), o(523.25, 0.05, 0.55);
|
|
220
220
|
}
|
|
221
221
|
playWarningSound(t = 0.25) {
|
|
222
|
-
const e = this.getAudioContext(), i = e.currentTime, o = e.createOscillator(), n = e.createOscillator(),
|
|
223
|
-
o.type = "sine", n.type = "sine", o.frequency.setValueAtTime(349.23, i), n.frequency.setValueAtTime(440, i), r.type = "lowpass", r.frequency.value = 1e3,
|
|
222
|
+
const e = this.getAudioContext(), i = e.currentTime, o = e.createOscillator(), n = e.createOscillator(), a = e.createGain(), r = e.createBiquadFilter();
|
|
223
|
+
o.type = "sine", n.type = "sine", o.frequency.setValueAtTime(349.23, i), n.frequency.setValueAtTime(440, i), r.type = "lowpass", r.frequency.value = 1e3, a.gain.setValueAtTime(1e-4, i), a.gain.exponentialRampToValueAtTime(t, i + 0.08), a.gain.exponentialRampToValueAtTime(1e-4, i + 0.5), o.connect(r), n.connect(r), r.connect(a).connect(e.destination), o.start(i), n.start(i), o.stop(i + 0.55), n.stop(i + 0.55);
|
|
224
224
|
}
|
|
225
225
|
playErrorSound(t = 0.25) {
|
|
226
|
-
const e = this.getAudioContext(), i = e.currentTime, o = e.createOscillator(), n = e.createGain(),
|
|
227
|
-
o.type = "triangle", o.frequency.setValueAtTime(220, i), o.frequency.exponentialRampToValueAtTime(1760, i + 0.3),
|
|
226
|
+
const e = this.getAudioContext(), i = e.currentTime, o = e.createOscillator(), n = e.createGain(), a = e.createBiquadFilter();
|
|
227
|
+
o.type = "triangle", o.frequency.setValueAtTime(220, i), o.frequency.exponentialRampToValueAtTime(1760, i + 0.3), a.type = "lowpass", a.frequency.value = 800, a.Q.value = 0.5, n.gain.setValueAtTime(1e-4, i), n.gain.exponentialRampToValueAtTime(0.8 * t, i + 0.1), n.gain.exponentialRampToValueAtTime(1e-4, i + 0.7), o.connect(a).connect(n).connect(e.destination), o.start(i), o.stop(i + 0.75);
|
|
228
228
|
}
|
|
229
229
|
async generateAudioFiles(t = 0.25) {
|
|
230
230
|
const i = {};
|
|
231
231
|
return i.info = await this.generateAudioFile(async (o) => {
|
|
232
232
|
const n = o.createOscillator();
|
|
233
233
|
n.type = "sine", n.frequency.setValueAtTime(320, 0), n.frequency.exponentialRampToValueAtTime(520, 0.3);
|
|
234
|
-
const
|
|
235
|
-
|
|
234
|
+
const a = o.createGain();
|
|
235
|
+
a.gain.setValueAtTime(0, 0), a.gain.linearRampToValueAtTime(t, 0.1), a.gain.linearRampToValueAtTime(0, 0.5), n.connect(a), a.connect(o.destination), n.start(), n.stop(0.5);
|
|
236
236
|
}, 44100, 1), i.success = await this.generateAudioFile(async (o) => {
|
|
237
237
|
const n = o.createOscillator();
|
|
238
238
|
n.type = "sine", n.frequency.setValueAtTime(660, 0);
|
|
239
|
-
const
|
|
240
|
-
|
|
239
|
+
const a = o.createOscillator();
|
|
240
|
+
a.type = "sine", a.frequency.setValueAtTime(440, 0);
|
|
241
241
|
const r = o.createGain();
|
|
242
242
|
r.gain.setValueAtTime(0, 0), r.gain.linearRampToValueAtTime(t, 0.1), r.gain.linearRampToValueAtTime(0, 0.5);
|
|
243
|
-
const
|
|
244
|
-
|
|
243
|
+
const c = o.createGain();
|
|
244
|
+
c.gain.setValueAtTime(0, 0), c.gain.linearRampToValueAtTime(0.6 * t, 0.15), c.gain.linearRampToValueAtTime(0, 0.7), n.connect(r), r.connect(o.destination), a.connect(c), c.connect(o.destination), n.start(), a.start(0.15), n.stop(0.5), a.stop(0.7);
|
|
245
245
|
}, 44100, 1), i.warning = await this.generateAudioFile(async (o) => {
|
|
246
246
|
const n = o.createOscillator();
|
|
247
247
|
n.type = "sine", n.frequency.setValueAtTime(293.66, 0);
|
|
248
|
-
const
|
|
249
|
-
|
|
248
|
+
const a = o.createOscillator();
|
|
249
|
+
a.type = "sine", a.frequency.setValueAtTime(349.23, 0);
|
|
250
250
|
const r = o.createGain();
|
|
251
|
-
r.gain.setValueAtTime(0, 0), r.gain.linearRampToValueAtTime(t, 0.1), r.gain.linearRampToValueAtTime(0.6 * t, 0.2), r.gain.linearRampToValueAtTime(0.8 * t, 0.3), r.gain.linearRampToValueAtTime(0, 0.6), n.connect(r),
|
|
251
|
+
r.gain.setValueAtTime(0, 0), r.gain.linearRampToValueAtTime(t, 0.1), r.gain.linearRampToValueAtTime(0.6 * t, 0.2), r.gain.linearRampToValueAtTime(0.8 * t, 0.3), r.gain.linearRampToValueAtTime(0, 0.6), n.connect(r), a.connect(r), r.connect(o.destination), n.start(), a.start(), n.stop(0.6), a.stop(0.6);
|
|
252
252
|
}, 44100, 1), i.error = await this.generateAudioFile(async (o) => {
|
|
253
253
|
const n = o.createOscillator();
|
|
254
254
|
n.type = "sine", n.frequency.setValueAtTime(196, 0);
|
|
255
|
-
const
|
|
256
|
-
|
|
255
|
+
const a = o.createGain();
|
|
256
|
+
a.gain.setValueAtTime(0, 0), a.gain.linearRampToValueAtTime(t, 0.1), a.gain.linearRampToValueAtTime(0.4 * t, 0.2), a.gain.linearRampToValueAtTime(0.6 * t, 0.3), a.gain.linearRampToValueAtTime(0, 0.7);
|
|
257
257
|
const r = o.createBiquadFilter();
|
|
258
|
-
r.type = "lowpass", r.frequency.value = 600, r.Q.value = 0.7, n.connect(r), r.connect(
|
|
258
|
+
r.type = "lowpass", r.frequency.value = 600, r.Q.value = 0.7, n.connect(r), r.connect(a), a.connect(o.destination), n.start(), n.stop(0.7);
|
|
259
259
|
}, 44100, 1), i;
|
|
260
260
|
}
|
|
261
261
|
async generateAudioFile(t, e = 44100, i = 1) {
|
|
262
262
|
const o = new OfflineAudioContext(2, e * i, e);
|
|
263
263
|
await t(o);
|
|
264
|
-
const n = await o.startRendering(),
|
|
265
|
-
return URL.createObjectURL(
|
|
264
|
+
const n = await o.startRendering(), a = this.audioBufferToWav(n);
|
|
265
|
+
return URL.createObjectURL(a);
|
|
266
266
|
}
|
|
267
267
|
audioBufferToWav(t) {
|
|
268
|
-
const e = t.numberOfChannels, i = t.sampleRate, o = 2 * e, n = this.getAudioSamples(t, 16),
|
|
269
|
-
return this.writeString(
|
|
268
|
+
const e = t.numberOfChannels, i = t.sampleRate, o = 2 * e, n = this.getAudioSamples(t, 16), a = 2 * n.length, r = new ArrayBuffer(44 + a), c = new DataView(r);
|
|
269
|
+
return this.writeString(c, 0, "RIFF"), c.setUint32(4, 36 + a, !0), this.writeString(c, 8, "WAVE"), this.writeString(c, 12, "fmt "), c.setUint32(16, 16, !0), c.setUint16(20, 1, !0), c.setUint16(22, e, !0), c.setUint32(24, i, !0), c.setUint32(28, i * o, !0), c.setUint16(32, o, !0), c.setUint16(34, 16, !0), this.writeString(c, 36, "data"), c.setUint32(40, a, !0), this.writeInt16Samples(c, 44, n), new Blob([r], { type: "audio/wav" });
|
|
270
270
|
}
|
|
271
271
|
getAudioSamples(t, e) {
|
|
272
|
-
const i = t.numberOfChannels, o = t.length, n = [],
|
|
273
|
-
for (let r = 0; r < o; r++) for (let
|
|
274
|
-
const
|
|
275
|
-
n.push(
|
|
272
|
+
const i = t.numberOfChannels, o = t.length, n = [], a = e === 16 ? 32768 : 128;
|
|
273
|
+
for (let r = 0; r < o; r++) for (let c = 0; c < i; c++) {
|
|
274
|
+
const w = t.getChannelData(c)[r], T = Math.max(-1, Math.min(1, w));
|
|
275
|
+
n.push(T * a);
|
|
276
276
|
}
|
|
277
277
|
return n;
|
|
278
278
|
}
|
|
@@ -283,9 +283,9 @@ class $ {
|
|
|
283
283
|
for (let o = 0; o < i.length; o++) t.setUint8(e + o, i.charCodeAt(o));
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
|
-
class
|
|
286
|
+
class B {
|
|
287
287
|
constructor() {
|
|
288
|
-
this.audioContext = null, this.soundBuffers = /* @__PURE__ */ new Map(), this.volume = 0.5, this.muted = !1, this.soundGenerator = new
|
|
288
|
+
this.audioContext = null, this.soundBuffers = /* @__PURE__ */ new Map(), this.volume = 0.5, this.muted = !1, this.soundGenerator = new O(), this.soundUrls = { info: "/assets/sounds/notification-info.mp3", success: "/assets/sounds/notification-success.mp3", warning: "/assets/sounds/notification-warning.mp3", error: "/assets/sounds/notification-error.mp3" }, this.initializeAudioFiles();
|
|
289
289
|
}
|
|
290
290
|
async initializeAudioFiles() {
|
|
291
291
|
try {
|
|
@@ -324,8 +324,8 @@ class R {
|
|
|
324
324
|
const e = this.getAudioContext();
|
|
325
325
|
if (e.state === "suspended" && await e.resume(), this.soundUrls[t].startsWith("blob:")) return void this.playFallbackSound(t);
|
|
326
326
|
if (!this.soundBuffers.has(t)) try {
|
|
327
|
-
const
|
|
328
|
-
this.soundBuffers.set(t,
|
|
327
|
+
const a = await this.loadSound(t);
|
|
328
|
+
this.soundBuffers.set(t, a);
|
|
329
329
|
} catch {
|
|
330
330
|
return void this.playDirectGeneratedSound(t);
|
|
331
331
|
}
|
|
@@ -391,45 +391,45 @@ class R {
|
|
|
391
391
|
return this.soundUrls[t];
|
|
392
392
|
}
|
|
393
393
|
}
|
|
394
|
-
var
|
|
395
|
-
for (var o, n = i > 1 ? void 0 : i ? q(t, e) : t,
|
|
396
|
-
return i && n &&
|
|
394
|
+
var U = Object.defineProperty, q = Object.getOwnPropertyDescriptor, v = (s, t, e, i) => {
|
|
395
|
+
for (var o, n = i > 1 ? void 0 : i ? q(t, e) : t, a = s.length - 1; a >= 0; a--) (o = s[a]) && (n = (i ? o(t, e, n) : o(n)) || n);
|
|
396
|
+
return i && n && U(t, e, n), n;
|
|
397
397
|
};
|
|
398
|
-
let
|
|
398
|
+
let y = class extends A(":host{display:block}.notification-container{position:fixed;z-index:9999;padding:12px;pointer-events:none;width:100%;max-width:424px}.notification-container sch-notification{pointer-events:auto}.notification-container.top-right{top:0;right:0;display:flex;flex-direction:column-reverse}.notification-container.top-left{top:0;left:0;display:flex;flex-direction:column-reverse}.notification-container.bottom-right{bottom:0;right:0;display:flex;flex-direction:column}.notification-container.bottom-left{bottom:0;left:0;display:flex;flex-direction:column}.notification-container.top-center{top:0;left:50%;transform:translate(-50%);display:flex;flex-direction:column-reverse}.notification-container.bottom-center{bottom:0;left:50%;transform:translate(-50%);display:flex;flex-direction:column}") {
|
|
399
399
|
constructor() {
|
|
400
|
-
super(...arguments), this.position = "top-right", this.maxVisibleNotifications =
|
|
400
|
+
super(...arguments), this.position = "top-right", this.maxVisibleNotifications = 2, this.playSound = !1, this.audioVolume = 0.1, this._notifications = [], this._audioService = new B();
|
|
401
401
|
}
|
|
402
402
|
connectedCallback() {
|
|
403
|
-
super.connectedCallback(), this._audioService.setVolume(this.audioVolume),
|
|
404
|
-
this.addNotification(
|
|
405
|
-
}), this.addEventListener("playsound", (
|
|
406
|
-
this.playSound && this._audioService.playSound(
|
|
403
|
+
super.connectedCallback(), this._audioService.setVolume(this.audioVolume), S(window, "schmancy-notification").pipe(C(this.disconnecting)).subscribe((s) => {
|
|
404
|
+
this.addNotification(s.detail);
|
|
405
|
+
}), this.addEventListener("playsound", (s) => {
|
|
406
|
+
this.playSound && this._audioService.playSound(s.detail.type);
|
|
407
407
|
});
|
|
408
408
|
}
|
|
409
|
-
addNotification(
|
|
410
|
-
const t =
|
|
409
|
+
addNotification(s) {
|
|
410
|
+
const t = s.id || `notification-${Date.now()}-${Math.floor(1e4 * Math.random())}`, e = { id: t, title: s.title || "", message: s.message, type: s.type || "info", duration: s.duration !== void 0 ? s.duration : 750, closable: s.closable === void 0 || s.closable, playSound: s.playSound !== void 0 ? s.playSound : this.playSound };
|
|
411
411
|
return this.position.startsWith("top") ? this._notifications = [...this._notifications, e] : this._notifications = [e, ...this._notifications], this._notifications.length > this.maxVisibleNotifications && (this._notifications = this._notifications.slice(-this.maxVisibleNotifications)), e.playSound && this._audioService.playSound(e.type), t;
|
|
412
412
|
}
|
|
413
|
-
removeNotification(
|
|
414
|
-
this._notifications = this._notifications.filter((t) => t.id !==
|
|
413
|
+
removeNotification(s) {
|
|
414
|
+
this._notifications = this._notifications.filter((t) => t.id !== s);
|
|
415
415
|
}
|
|
416
|
-
_handleClose(
|
|
417
|
-
const t =
|
|
416
|
+
_handleClose(s) {
|
|
417
|
+
const t = s.detail.id;
|
|
418
418
|
this.removeNotification(t);
|
|
419
419
|
}
|
|
420
420
|
render() {
|
|
421
421
|
return d`
|
|
422
422
|
<div
|
|
423
|
-
class=${
|
|
423
|
+
class=${b({ "notification-container": !0, [this.position]: !0 })}
|
|
424
424
|
>
|
|
425
|
-
${
|
|
425
|
+
${k(this._notifications, (s) => s.id, (s) => d`
|
|
426
426
|
<sch-notification
|
|
427
|
-
.id=${
|
|
428
|
-
.title=${
|
|
429
|
-
.message=${
|
|
430
|
-
.type=${
|
|
431
|
-
.duration=${
|
|
432
|
-
?closable=${
|
|
427
|
+
.id=${s.id}
|
|
428
|
+
.title=${s.title}
|
|
429
|
+
.message=${s.message}
|
|
430
|
+
.type=${s.type}
|
|
431
|
+
.duration=${s.duration}
|
|
432
|
+
?closable=${s.closable}
|
|
433
433
|
?playSound=${!1} /* We already played the sound on add */
|
|
434
434
|
@close=${this._handleClose}
|
|
435
435
|
></sch-notification>
|
|
@@ -438,10 +438,43 @@ let m = class extends T(":host{display:block}.notification-container{position:fi
|
|
|
438
438
|
`;
|
|
439
439
|
}
|
|
440
440
|
};
|
|
441
|
-
|
|
441
|
+
v([p({ type: String })], y.prototype, "position", 2), v([p({ type: Number })], y.prototype, "maxVisibleNotifications", 2), v([p({ type: Boolean })], y.prototype, "playSound", 2), v([p({ type: Number })], y.prototype, "audioVolume", 2), v([g()], y.prototype, "_notifications", 2), y = v([_("sch-notification-container")], y);
|
|
442
|
+
const m = class m {
|
|
443
|
+
constructor() {
|
|
444
|
+
}
|
|
445
|
+
static getInstance() {
|
|
446
|
+
return m.instance || (m.instance = new m()), m.instance;
|
|
447
|
+
}
|
|
448
|
+
notify(t) {
|
|
449
|
+
const e = { ...m.DEFAULT_OPTIONS, ...t, duration: t.duration ?? m.DEFAULT_OPTIONS.duration }, i = e.id || `notification-${Date.now()}-${Math.floor(1e4 * Math.random())}`, o = new CustomEvent("schmancy-notification", { bubbles: !0, composed: !0, detail: { ...e, id: i } });
|
|
450
|
+
return window.dispatchEvent(o), i;
|
|
451
|
+
}
|
|
452
|
+
info(t, e = {}) {
|
|
453
|
+
return this.notify({ message: t, type: "info", ...e });
|
|
454
|
+
}
|
|
455
|
+
success(t, e = {}) {
|
|
456
|
+
return this.notify({ message: t, type: "success", ...e });
|
|
457
|
+
}
|
|
458
|
+
warning(t, e = {}) {
|
|
459
|
+
return this.notify({ message: t, type: "warning", ...e });
|
|
460
|
+
}
|
|
461
|
+
error(t, e = {}) {
|
|
462
|
+
return this.notify({ message: t, type: "error", ...e });
|
|
463
|
+
}
|
|
464
|
+
customDuration(t, e, i = {}) {
|
|
465
|
+
return this.notify({ message: t, duration: e, ...i });
|
|
466
|
+
}
|
|
467
|
+
persistent(t, e = {}) {
|
|
468
|
+
return this.notify({ message: t, duration: 0, ...e });
|
|
469
|
+
}
|
|
470
|
+
};
|
|
471
|
+
m.DEFAULT_OPTIONS = { duration: 1e3, closable: !0, playSound: !0 };
|
|
472
|
+
let h = m;
|
|
473
|
+
const P = { show: (s) => h.getInstance().notify(s), info: (s, t = {}) => h.getInstance().info(s, t), success: (s, t = {}) => h.getInstance().success(s, t), warning: (s, t = {}) => h.getInstance().warning(s, t), error: (s, t = {}) => h.getInstance().error(s, t), customDuration: (s, t, e = {}) => h.getInstance().customDuration(s, t, e), persistent: (s, t = {}) => h.getInstance().persistent(s, t) };
|
|
442
474
|
export {
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
475
|
+
P as $,
|
|
476
|
+
B as N,
|
|
477
|
+
l as S,
|
|
478
|
+
y as a
|
|
446
479
|
};
|
|
447
|
-
//# sourceMappingURL=notification-
|
|
480
|
+
//# sourceMappingURL=notification-service-5KQWCCvu.js.map
|