@mhmo91/schmancy 0.2.30 → 0.2.32
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-C5zM-91H.cjs → animated-text-BaBhfH9-.cjs} +2 -2
- package/dist/{animated-text-C5zM-91H.cjs.map → animated-text-BaBhfH9-.cjs.map} +1 -1
- package/dist/{animated-text-IHZ7LNnc.js → animated-text-DGtz8VY6.js} +3 -3
- package/dist/{animated-text-IHZ7LNnc.js.map → animated-text-DGtz8VY6.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-BrPf_qdG.js → area.component-C0FNto7b.js} +3 -3
- package/dist/{area.component-BrPf_qdG.js.map → area.component-C0FNto7b.js.map} +1 -1
- package/dist/{area.component-DCLLi1YA.cjs → area.component-Cyuo6xHE.cjs} +2 -2
- package/dist/{area.component-DCLLi1YA.cjs.map → area.component-Cyuo6xHE.cjs.map} +1 -1
- package/dist/area.js +1 -1
- package/dist/{autocomplete-Dfq-Rhjy.cjs → autocomplete-CVCCpsJR.cjs} +2 -2
- package/dist/{autocomplete-Dfq-Rhjy.cjs.map → autocomplete-CVCCpsJR.cjs.map} +1 -1
- package/dist/{autocomplete-CcDfKbfJ.js → autocomplete-necrthpm.js} +3 -3
- package/dist/{autocomplete-CcDfKbfJ.js.map → autocomplete-necrthpm.js.map} +1 -1
- package/dist/autocomplete.cjs +1 -1
- package/dist/autocomplete.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-BdsGj_z6.cjs → checkbox-BQyaMIBT.cjs} +2 -2
- package/dist/{checkbox-BdsGj_z6.cjs.map → checkbox-BQyaMIBT.cjs.map} +1 -1
- package/dist/{checkbox-DV8tPYX0.js → checkbox-C-FsqHd7.js} +2 -2
- package/dist/{checkbox-DV8tPYX0.js.map → checkbox-C-FsqHd7.js.map} +1 -1
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/{chips-Ca-SY6mg.js → chips-5MAVX_8i.js} +3 -3
- package/dist/{chips-Ca-SY6mg.js.map → chips-5MAVX_8i.js.map} +1 -1
- package/dist/{chips-Z8e_rQtM.cjs → chips-S8GQbwuT.cjs} +2 -2
- package/dist/{chips-Z8e_rQtM.cjs.map → chips-S8GQbwuT.cjs.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-DdGaWGVn.js → date-range-BrhS49sX.js} +3 -3
- package/dist/{date-range-DdGaWGVn.js.map → date-range-BrhS49sX.js.map} +1 -1
- package/dist/{date-range-CDX0VlcK.cjs → date-range-CgzLVw9_.cjs} +2 -2
- package/dist/{date-range-CDX0VlcK.cjs.map → date-range-CgzLVw9_.cjs.map} +1 -1
- package/dist/date-range.cjs +1 -1
- package/dist/date-range.js +1 -1
- package/dist/{delay-DsFVHHw2.cjs → delay-CfvY-Kc_.cjs} +2 -2
- package/dist/{delay-DsFVHHw2.cjs.map → delay-CfvY-Kc_.cjs.map} +1 -1
- package/dist/{delay-BWLlCMKV.js → delay-DsItaFEi.js} +2 -2
- package/dist/{delay-BWLlCMKV.js.map → delay-DsItaFEi.js.map} +1 -1
- package/dist/delay.cjs +1 -1
- package/dist/delay.js +1 -1
- package/dist/{divider-B7kWs-q5.js → divider-TGUqVNoE.js} +3 -3
- package/dist/{divider-B7kWs-q5.js.map → divider-TGUqVNoE.js.map} +1 -1
- package/dist/{divider-CjgOM462.cjs → divider-o0WOGz7O.cjs} +2 -2
- package/dist/{divider-CjgOM462.cjs.map → divider-o0WOGz7O.cjs.map} +1 -1
- package/dist/divider.cjs +1 -1
- package/dist/divider.js +1 -1
- package/dist/{form-BUV1hUzI.js → form-DpL0hjdB.js} +2 -2
- package/dist/{form-BUV1hUzI.js.map → form-DpL0hjdB.js.map} +1 -1
- package/dist/{form-DyYGOlOR.cjs → form-FczT_SmF.cjs} +2 -2
- package/dist/{form-DyYGOlOR.cjs.map → form-FczT_SmF.cjs.map} +1 -1
- package/dist/form.cjs +1 -1
- package/dist/form.js +1 -1
- package/dist/{icon-DPN7kWO0.cjs → icon-COCJGwqR.cjs} +2 -2
- package/dist/{icon-DPN7kWO0.cjs.map → icon-COCJGwqR.cjs.map} +1 -1
- package/dist/{icon-CWvUTBIP.js → icon-DxUojoLL.js} +3 -3
- package/dist/{icon-CWvUTBIP.js.map → icon-DxUojoLL.js.map} +1 -1
- package/dist/{icon-button-DHiO0w8J.cjs → icon-button-CQofSdke.cjs} +2 -2
- package/dist/{icon-button-DHiO0w8J.cjs.map → icon-button-CQofSdke.cjs.map} +1 -1
- package/dist/{icon-button-CbEs8eyS.js → icon-button-CRLIK8u7.js} +3 -3
- package/dist/{icon-button-CbEs8eyS.js.map → icon-button-CRLIK8u7.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 +81 -80
- package/dist/{input-D3hti5wB.js → input-BAf2RdFP.js} +2 -2
- package/dist/{input-D3hti5wB.js.map → input-BAf2RdFP.js.map} +1 -1
- package/dist/{input-2kqgsr0S.cjs → input-omxDRvEs.cjs} +2 -2
- package/dist/{input-2kqgsr0S.cjs.map → input-omxDRvEs.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-Cq9RDYF_.cjs → list-Z-PMCdO3.cjs} +2 -2
- package/dist/{list-Cq9RDYF_.cjs.map → list-Z-PMCdO3.cjs.map} +1 -1
- package/dist/{list-D3m-rd6d.js → list-vgCwNf1V.js} +2 -2
- package/dist/{list-D3m-rd6d.js.map → list-vgCwNf1V.js.map} +1 -1
- package/dist/list.cjs +1 -1
- package/dist/list.js +1 -1
- package/dist/{litElement.mixin-DWxwPXWQ.cjs → litElement.mixin-BILTK9_q.cjs} +2 -2
- package/dist/{litElement.mixin-DWxwPXWQ.cjs.map → litElement.mixin-BILTK9_q.cjs.map} +1 -1
- package/dist/{litElement.mixin-CjxO_zfv.js → litElement.mixin-Crnj9WR4.js} +2 -2
- package/dist/{litElement.mixin-CjxO_zfv.js.map → litElement.mixin-Crnj9WR4.js.map} +1 -1
- package/dist/{menu-ifiBMg-F.cjs → menu-DH-ohLu1.cjs} +2 -2
- package/dist/{menu-ifiBMg-F.cjs.map → menu-DH-ohLu1.cjs.map} +1 -1
- package/dist/{menu-CCQYHiy2.js → menu-KDSzXZBL.js} +3 -3
- package/dist/{menu-CCQYHiy2.js.map → menu-KDSzXZBL.js.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 +6 -5
- package/dist/notification.cjs +1 -1
- package/dist/notification.js +1 -1
- package/dist/{option-DOBWmGE5.cjs → option-BqkECJuR.cjs} +2 -2
- package/dist/{option-DOBWmGE5.cjs.map → option-BqkECJuR.cjs.map} +1 -1
- package/dist/{option-CM24cDF6.js → option-J1jC8uMC.js} +2 -2
- package/dist/{option-CM24cDF6.js.map → option-J1jC8uMC.js.map} +1 -1
- package/dist/option.cjs +1 -1
- package/dist/option.js +1 -1
- package/dist/{outlet-u1_Qa8Li.cjs → outlet-CKML-ZhR.cjs} +2 -2
- package/dist/{outlet-u1_Qa8Li.cjs.map → outlet-CKML-ZhR.cjs.map} +1 -1
- package/dist/{outlet-BsrhXTEg.js → outlet-ylHmdM1r.js} +2 -2
- package/dist/{outlet-BsrhXTEg.js.map → outlet-ylHmdM1r.js.map} +1 -1
- package/dist/{payment-card-form-B7tV2ttW.cjs → payment-card-form-BWafJ1-J.cjs} +2 -2
- package/dist/{payment-card-form-B7tV2ttW.cjs.map → payment-card-form-BWafJ1-J.cjs.map} +1 -1
- package/dist/{payment-card-form-CTZsSGOB.js → payment-card-form-p5862ywL.js} +3 -3
- package/dist/{payment-card-form-CTZsSGOB.js.map → payment-card-form-p5862ywL.js.map} +1 -1
- package/dist/{radio-group-m5Swl5cq.cjs → radio-group-CvWw3ryp.cjs} +2 -2
- package/dist/{radio-group-m5Swl5cq.cjs.map → radio-group-CvWw3ryp.cjs.map} +1 -1
- package/dist/{radio-group-dN2lWcFu.js → radio-group-tjKdSId8.js} +2 -2
- package/dist/{radio-group-dN2lWcFu.js.map → radio-group-tjKdSId8.js.map} +1 -1
- package/dist/radio-group.cjs +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/{scroll-DnAxN1uS.cjs → scroll-B0Ym9pDE.cjs} +19 -15
- package/dist/scroll-B0Ym9pDE.cjs.map +1 -0
- package/dist/{scroll-Bl-fR7Vv.js → scroll-DTFALUcJ.js} +57 -49
- package/dist/scroll-DTFALUcJ.js.map +1 -0
- package/dist/{select-ljp7-IxH.cjs → select-DDVA_OMg.cjs} +2 -2
- package/dist/{select-ljp7-IxH.cjs.map → select-DDVA_OMg.cjs.map} +1 -1
- package/dist/{select-BakBo7W1.js → select-DvjDZldC.js} +3 -3
- package/dist/{select-BakBo7W1.js.map → select-DvjDZldC.js.map} +1 -1
- package/dist/select.cjs +1 -1
- package/dist/select.js +1 -1
- package/dist/{sheet-BGNoewvS.js → sheet-CYUlr3Dn.js} +3 -3
- package/dist/{sheet-BGNoewvS.js.map → sheet-CYUlr3Dn.js.map} +1 -1
- package/dist/{sheet-DPHbRnXg.cjs → sheet-D3dWRFGY.cjs} +2 -2
- package/dist/{sheet-DPHbRnXg.cjs.map → sheet-D3dWRFGY.cjs.map} +1 -1
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.js +1 -1
- package/dist/{slider-FTwWTvKi.js → slider-akhKEvvj.js} +3 -3
- package/dist/{slider-FTwWTvKi.js.map → slider-akhKEvvj.js.map} +1 -1
- package/dist/{slider-ds6hnN7n.cjs → slider-ooQm1mwd.cjs} +2 -2
- package/dist/{slider-ds6hnN7n.cjs.map → slider-ooQm1mwd.cjs.map} +1 -1
- package/dist/slider.cjs +1 -1
- package/dist/slider.js +1 -1
- package/dist/{spinner-8GhT-bLm.cjs → spinner-J2X8jDeV.cjs} +2 -2
- package/dist/{spinner-8GhT-bLm.cjs.map → spinner-J2X8jDeV.cjs.map} +1 -1
- package/dist/{spinner-zxOxMm7j.js → spinner-qsSO70a0.js} +3 -3
- package/dist/{spinner-zxOxMm7j.js.map → spinner-qsSO70a0.js.map} +1 -1
- package/dist/{surface-DdbqvBbW.js → surface-BrkDCXlB.js} +2 -2
- package/dist/{surface-DdbqvBbW.js.map → surface-BrkDCXlB.js.map} +1 -1
- package/dist/{surface-BzSJT7y7.cjs → surface-Crysq7RB.cjs} +2 -2
- package/dist/{surface-BzSJT7y7.cjs.map → surface-Crysq7RB.cjs.map} +1 -1
- package/dist/surface.cjs +1 -1
- package/dist/surface.js +1 -1
- package/dist/{table-6bRKgCJ9.js → table-Bf5_xdES.js} +2 -2
- package/dist/{table-6bRKgCJ9.js.map → table-Bf5_xdES.js.map} +1 -1
- package/dist/{table-BDIhXdSA.cjs → table-SpcWe88h.cjs} +2 -2
- package/dist/{table-BDIhXdSA.cjs.map → table-SpcWe88h.cjs.map} +1 -1
- package/dist/table.cjs +1 -1
- package/dist/table.js +1 -1
- package/dist/{tabs-group-DBybIi8n.js → tabs-group-CQPqQzWj.js} +2 -2
- package/dist/{tabs-group-DBybIi8n.js.map → tabs-group-CQPqQzWj.js.map} +1 -1
- package/dist/{tabs-group-CHAAr7Wl.cjs → tabs-group-Dg0JGCPp.cjs} +2 -2
- package/dist/{tabs-group-CHAAr7Wl.cjs.map → tabs-group-Dg0JGCPp.cjs.map} +1 -1
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.js +1 -1
- package/dist/{tailwind.mixin-_mD_GeAp.cjs → tailwind.mixin-BN3VyP3_.cjs} +2 -2
- package/dist/{tailwind.mixin-_mD_GeAp.cjs.map → tailwind.mixin-BN3VyP3_.cjs.map} +1 -1
- package/dist/{tailwind.mixin-DtR4DQvn.js → tailwind.mixin-Cfc4hNUi.js} +2 -2
- package/dist/{tailwind.mixin-DtR4DQvn.js.map → tailwind.mixin-Cfc4hNUi.js.map} +1 -1
- package/dist/teleport.cjs +1 -1
- package/dist/{teleport.component-BMTgJEZ0.cjs → teleport.component-D38Y8hRr.cjs} +15 -15
- package/dist/teleport.component-D38Y8hRr.cjs.map +1 -0
- package/dist/{teleport.component-B5i3T7cn.js → teleport.component-DeXc-lOk.js} +56 -55
- package/dist/teleport.component-DeXc-lOk.js.map +1 -0
- package/dist/teleport.js +1 -1
- package/dist/{textarea-BchwVUAo.js → textarea-DgJxsRf4.js} +2 -2
- package/dist/{textarea-BchwVUAo.js.map → textarea-DgJxsRf4.js.map} +1 -1
- package/dist/{textarea-CJhi4hDu.cjs → textarea-Ds98JJZp.cjs} +2 -2
- package/dist/{textarea-CJhi4hDu.cjs.map → textarea-Ds98JJZp.cjs.map} +1 -1
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.js +1 -1
- package/dist/{theme-button-DoIFEVSv.cjs → theme-button-D7SdMUiQ.cjs} +2 -2
- package/dist/{theme-button-DoIFEVSv.cjs.map → theme-button-D7SdMUiQ.cjs.map} +1 -1
- package/dist/{theme-button-dxTV0k03.js → theme-button-YZbAZLim.js} +2 -2
- package/dist/{theme-button-dxTV0k03.js.map → theme-button-YZbAZLim.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-Dhm3MpVW.cjs → theme.component-CYinFFe3.cjs} +2 -2
- package/dist/{theme.component-Dhm3MpVW.cjs.map → theme.component-CYinFFe3.cjs.map} +1 -1
- package/dist/{theme.component-DwZx0sdk.js → theme.component-DPgXiGI7.js} +2 -2
- package/dist/{theme.component-DwZx0sdk.js.map → theme.component-DPgXiGI7.js.map} +1 -1
- package/dist/theme.js +1 -1
- package/dist/{tree-BkhYPaz6.cjs → tree-DIR5jj1o.cjs} +2 -2
- package/dist/{tree-BkhYPaz6.cjs.map → tree-DIR5jj1o.cjs.map} +1 -1
- package/dist/{tree-C7GnGCWU.js → tree-dLY00b8v.js} +2 -2
- package/dist/{tree-C7GnGCWU.js.map → tree-dLY00b8v.js.map} +1 -1
- package/dist/tree.cjs +1 -1
- package/dist/tree.js +1 -1
- package/dist/{typewriter-DfOKVMWh.js → typewriter-4SHCjdfN.js} +4 -4
- package/dist/{typewriter-DfOKVMWh.js.map → typewriter-4SHCjdfN.js.map} +1 -1
- package/dist/{typewriter-DGIW1V_b.cjs → typewriter-CEZSb7Sl.cjs} +2 -2
- package/dist/{typewriter-DGIW1V_b.cjs.map → typewriter-CEZSb7Sl.cjs.map} +1 -1
- package/dist/typewriter.cjs +1 -1
- package/dist/typewriter.js +1 -1
- package/dist/{typography-En0tk2d5.js → typography-BcdSzAwq.js} +2 -2
- package/dist/{typography-En0tk2d5.js.map → typography-BcdSzAwq.js.map} +1 -1
- package/dist/{typography-DQHpwRFR.cjs → typography-Cj1G0Eh0.cjs} +2 -2
- package/dist/{typography-DQHpwRFR.cjs.map → typography-Cj1G0Eh0.cjs.map} +1 -1
- package/dist/typography.cjs +1 -1
- package/dist/typography.js +1 -1
- package/package.json +1 -1
- package/types/src/layout/scroll/scroll.d.ts +10 -0
- package/types/src/nav-drawer/$navbar.d.ts +2 -1
- package/dist/scroll-Bl-fR7Vv.js.map +0 -1
- package/dist/scroll-DnAxN1uS.cjs.map +0 -1
- package/dist/teleport.component-B5i3T7cn.js.map +0 -1
- package/dist/teleport.component-BMTgJEZ0.cjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"litElement.mixin-
|
|
1
|
+
{"version":3,"file":"litElement.mixin-BILTK9_q.cjs","sources":["../mixins/litElement.mixin.ts"],"sourcesContent":["import { CSSResult, LitElement } from 'lit'\nimport { TailwindElement } from './tailwind.mixin'\nimport { BaseElement, IBaseMixin } from './baseElement'\nimport { Constructor } from './constructor'\n\nexport const $LitElement = <T extends CSSResult>(componentStyle?: T) => {\n\tclass TailwindMixinClass extends BaseElement(TailwindElement(componentStyle)) {\n\t\tdisconnectedCallback = () => {\n\t\t\tsuper.disconnectedCallback()\n\t\t}\n\t}\n\treturn TailwindMixinClass as CustomElementConstructor &\n\t\tConstructor<LitElement> &\n\t\tConstructor<IBaseMixin> /* see \"typing the subclass\" below */\n}\n"],"names":["componentStyle","TailwindMixinClass","BaseElement","TailwindElement","constructor","super","arguments","this","disconnectedCallback"],"mappings":"kFAKiDA,GAAAA,CAChD,MAAMC,UAA2BC,EAAAA,YAAYC,kBAAgBH,IAA7D,aAAAI,CAAAC,MAAAC,GAAAA,SAAAA,EACCC,KAAAC,qBAAuB,IACtBH,CAAAA,MAAMG,qBAAqB,CAAA,CAC5B,CAEM,CAAA,OAAAP,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as t, T as r } from "./tailwind.mixin-
|
|
1
|
+
import { B as t, T as r } from "./tailwind.mixin-Cfc4hNUi.js";
|
|
2
2
|
const n = (s) => {
|
|
3
3
|
class e extends t(r(s)) {
|
|
4
4
|
constructor() {
|
|
@@ -12,4 +12,4 @@ const n = (s) => {
|
|
|
12
12
|
export {
|
|
13
13
|
n as $
|
|
14
14
|
};
|
|
15
|
-
//# sourceMappingURL=litElement.mixin-
|
|
15
|
+
//# sourceMappingURL=litElement.mixin-Crnj9WR4.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"litElement.mixin-
|
|
1
|
+
{"version":3,"file":"litElement.mixin-Crnj9WR4.js","sources":["../mixins/litElement.mixin.ts"],"sourcesContent":["import { CSSResult, LitElement } from 'lit'\nimport { TailwindElement } from './tailwind.mixin'\nimport { BaseElement, IBaseMixin } from './baseElement'\nimport { Constructor } from './constructor'\n\nexport const $LitElement = <T extends CSSResult>(componentStyle?: T) => {\n\tclass TailwindMixinClass extends BaseElement(TailwindElement(componentStyle)) {\n\t\tdisconnectedCallback = () => {\n\t\t\tsuper.disconnectedCallback()\n\t\t}\n\t}\n\treturn TailwindMixinClass as CustomElementConstructor &\n\t\tConstructor<LitElement> &\n\t\tConstructor<IBaseMixin> /* see \"typing the subclass\" below */\n}\n"],"names":["$LitElement","componentStyle","TailwindMixinClass","BaseElement","TailwindElement","super","arguments","this","disconnectedCallback"],"mappings":";AAKa,MAAAA,IAAoCC,CAAAA;EAChD,MAAMC,UAA2BC,EAAYC,EAAgBH,CAA7D,CAAA,EAAA;AAAA,IAAA;AAAAI,YAAAC,GAAAA,SAAAA,GACCC,KAAAC,uBAAuB,MACtBH;AAAAA,cAAMG;MAAqB;AAAA,IAC5B;AAAA,EAAA;AAEM,SAAAN;AAAA;"}
|
|
@@ -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-BILTK9_q.cjs"),b=require("./tailwind.mixin-BN3VyP3_.cjs"),p=require("lit"),l=require("lit/decorators.js"),m=require("@floating-ui/dom");var y=Object.defineProperty,f=Object.getOwnPropertyDescriptor;let h=class extends d.$LitElement(p.css`
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
}
|
|
@@ -28,4 +28,4 @@
|
|
|
28
28
|
<slot></slot>
|
|
29
29
|
</schmancy-list>
|
|
30
30
|
`}};u([l.state()],c.prototype,"open",2),u([l.queryAssignedElements({flatten:!0,slot:"button"})],c.prototype,"buttonElement",2),u([l.query("#menu")],c.prototype,"menuElement",2),c=u([l.customElement("schmancy-menu")],c);
|
|
31
|
-
//# sourceMappingURL=menu-
|
|
31
|
+
//# sourceMappingURL=menu-DH-ohLu1.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-
|
|
1
|
+
{"version":3,"file":"menu-DH-ohLu1.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 { computePosition, flip, offset, shift } from '@floating-ui/dom'\nimport { TailwindElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, query, queryAssignedElements, state } from 'lit/decorators.js'\nimport { from, fromEvent, switchMap, 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@state() open = false\n\n\t@queryAssignedElements({ flatten: true, slot: 'button' })\n\tbuttonElement!: Array<HTMLElement>\n\n\t@query('#menu') menuElement!: HTMLElement\n\n\topenMenu() {\n\t\tthis.open = true\n\t\tthis.positionMenu()\n\n\t\t// Approx. \"easeInQuad\" with a cubic-bezier:\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\treturn new Promise<void>(resolve => {\n\t\t\tanimation.onfinish = () => resolve()\n\t\t})\n\t}\n\n\tcloseMenu(e?: Event) {\n\t\tif (e && e instanceof Event) {\n\t\t\te.preventDefault()\n\t\t\te.stopPropagation()\n\t\t}\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\n\t\treturn new Promise<void>(resolve => {\n\t\t\tanimation.onfinish = () => {\n\t\t\t\tthis.open = false\n\t\t\t\tresolve()\n\t\t\t}\n\t\t})\n\t}\n\n\tasync positionMenu() {\n\t\tif (this.buttonElement.length && this.menuElement) {\n\t\t\tconst { x, y } = await computePosition(this.buttonElement[0], this.menuElement, {\n\t\t\t\tplacement: 'bottom-start',\n\t\t\t\tmiddleware: [offset(5), flip(), shift({ padding: 5 })],\n\t\t\t})\n\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\tposition: 'absolute',\n\t\t\t})\n\t\t}\n\t}\n\n\tprotected firstUpdated(): 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\tswitchMap(() => from(this.openMenu())),\n\t\t\t)\n\t\t\t.subscribe()\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\tswitchMap(() => from(this.closeMenu())),\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<div class=\"fixed inset-0 z-50\" .hidden=${!this.open} @click=${this.closeMenu}></div>\n\t\t\t<schmancy-list\n\t\t\t\tid=\"menu\"\n\t\t\t\t.hidden=${!this.open}\n\t\t\t\tclass=\"absolute z-50 border-outlineVariant rounded-md \n min-w-[160px] max-w-[320px] w-max bg-surface-default\"\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</schmancy-list>\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","constructor","arguments","open","positionMenu","animation","menuElement","animate","opacity","transform","duration","easing","Promise","resolve","onfinish","Event","preventDefault","buttonElement","length","x","y","computePosition","placement","middleware","offset","flip","shift","padding","Object","assign","style","left","top","position","firstUpdated","tap","switchMap","from","openMenu","closeMenu","render","__decorateClass","state","prototype","queryAssignedElements","flatten","slot","query"],"mappings":"6VAMA,IAAqBA,EAArB,cAA8CC,EAAAA,YAAYC,EAAAA;AAAAA;AAAAA;AAAAA;AAAAA,CAKzD,CAAA,CAAA,mBACCC,CAAAA,MAAM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AA,CAEgBF,EAAAA,EAAA,CAAfM,EAAAA,MAAM,OAXahD,CAAAA,EAAAA,EAWJ4C,UAAA,cAAA,GAXI5C,EAArB0C,EAAA,CADC3C,EAAAA,cAAc,eACMC,CAAAA,EAAAA,CAAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { fromEvent as m, takeUntil as l, tap as p, switchMap as u, from as h } from "rxjs";
|
|
2
2
|
import "lit/directives/class-map.js";
|
|
3
3
|
import "lit/directives/style-map.js";
|
|
4
|
-
import { $ as g } from "./litElement.mixin-
|
|
5
|
-
import { T as v } from "./tailwind.mixin-
|
|
4
|
+
import { $ as g } from "./litElement.mixin-Crnj9WR4.js";
|
|
5
|
+
import { T as v } from "./tailwind.mixin-Cfc4hNUi.js";
|
|
6
6
|
import { css as b, html as f } from "lit";
|
|
7
7
|
import { customElement as y, state as E, queryAssignedElements as w, query as k } from "lit/decorators.js";
|
|
8
8
|
import { computePosition as x, offset as P, flip as M, shift as O } from "@floating-ui/dom";
|
|
@@ -88,4 +88,4 @@ let r = class extends v(b`
|
|
|
88
88
|
}
|
|
89
89
|
};
|
|
90
90
|
c([E()], r.prototype, "open", 2), c([w({ flatten: !0, slot: "button" })], r.prototype, "buttonElement", 2), c([k("#menu")], r.prototype, "menuElement", 2), r = c([y("schmancy-menu")], r);
|
|
91
|
-
//# sourceMappingURL=menu-
|
|
91
|
+
//# sourceMappingURL=menu-KDSzXZBL.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-
|
|
1
|
+
{"version":3,"file":"menu-KDSzXZBL.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 { computePosition, flip, offset, shift } from '@floating-ui/dom'\nimport { TailwindElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, query, queryAssignedElements, state } from 'lit/decorators.js'\nimport { from, fromEvent, switchMap, 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@state() open = false\n\n\t@queryAssignedElements({ flatten: true, slot: 'button' })\n\tbuttonElement!: Array<HTMLElement>\n\n\t@query('#menu') menuElement!: HTMLElement\n\n\topenMenu() {\n\t\tthis.open = true\n\t\tthis.positionMenu()\n\n\t\t// Approx. \"easeInQuad\" with a cubic-bezier:\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\treturn new Promise<void>(resolve => {\n\t\t\tanimation.onfinish = () => resolve()\n\t\t})\n\t}\n\n\tcloseMenu(e?: Event) {\n\t\tif (e && e instanceof Event) {\n\t\t\te.preventDefault()\n\t\t\te.stopPropagation()\n\t\t}\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\n\t\treturn new Promise<void>(resolve => {\n\t\t\tanimation.onfinish = () => {\n\t\t\t\tthis.open = false\n\t\t\t\tresolve()\n\t\t\t}\n\t\t})\n\t}\n\n\tasync positionMenu() {\n\t\tif (this.buttonElement.length && this.menuElement) {\n\t\t\tconst { x, y } = await computePosition(this.buttonElement[0], this.menuElement, {\n\t\t\t\tplacement: 'bottom-start',\n\t\t\t\tmiddleware: [offset(5), flip(), shift({ padding: 5 })],\n\t\t\t})\n\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\tposition: 'absolute',\n\t\t\t})\n\t\t}\n\t}\n\n\tprotected firstUpdated(): 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\tswitchMap(() => from(this.openMenu())),\n\t\t\t)\n\t\t\t.subscribe()\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\tswitchMap(() => from(this.closeMenu())),\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<div class=\"fixed inset-0 z-50\" .hidden=${!this.open} @click=${this.closeMenu}></div>\n\t\t\t<schmancy-list\n\t\t\t\tid=\"menu\"\n\t\t\t\t.hidden=${!this.open}\n\t\t\t\tclass=\"absolute z-50 border-outlineVariant rounded-md \n min-w-[160px] max-w-[320px] w-max bg-surface-default\"\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</schmancy-list>\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","arguments","open","openMenu","positionMenu","animation","menuElement","animate","opacity","transform","duration","easing","Promise","resolve","onfinish","Event","preventDefault","buttonElement","length","x","y","computePosition","placement","middleware","offset","flip","shift","padding","Object","assign","style","left","top","position","firstUpdated","tap","switchMap","from","closeMenu","__decorateClass","state","prototype","queryAssignedElements","flatten","slot","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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");
|
|
2
2
|
//# sourceMappingURL=menu.cjs.map
|
package/dist/menu.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import "./menu-
|
|
1
|
+
import "./menu-KDSzXZBL.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-D38Y8hRr.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,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $ as c, i as e, k as n, l as m, m as s, j as h, n as i, h as t } from "./teleport.component-DeXc-lOk.js";
|
|
2
2
|
export {
|
|
3
|
-
c as
|
|
3
|
+
c as $drawer,
|
|
4
|
+
e as SchmancyDrawerAppbar,
|
|
4
5
|
n as SchmancyDrawerNavbarMode,
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
m as SchmancyDrawerNavbarState,
|
|
7
|
+
s as SchmancyNavigationDrawer,
|
|
7
8
|
h as SchmancyNavigationDrawerContent,
|
|
8
9
|
i as SchmancyNavigationDrawerSidebar,
|
|
9
|
-
|
|
10
|
+
t as schmancyNavDrawer
|
|
10
11
|
};
|
|
11
12
|
//# sourceMappingURL=nav-drawer.js.map
|
package/dist/notification.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./outlet-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./outlet-CKML-ZhR.cjs");exports.$notify=e.$notify,Object.defineProperty(exports,"SchmancyNotification",{enumerable:!0,get:()=>e.SchmancyNotification}),Object.defineProperty(exports,"SchmancyNotificationOutlet",{enumerable:!0,get:()=>e.SchmancyNotificationOutlet});
|
|
2
2
|
//# sourceMappingURL=notification.cjs.map
|
package/dist/notification.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";require("rxjs"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js");const c=require("./tailwind.mixin-
|
|
1
|
+
"use strict";require("rxjs"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js");const c=require("./tailwind.mixin-BN3VyP3_.cjs"),u=require("lit"),i=require("lit/decorators.js");var h=Object.defineProperty,y=Object.getOwnPropertyDescriptor,n=(t,e,a,s)=>{for(var l,r=s>1?void 0:s?y(e,a):e,p=t.length-1;p>=0;p--)(l=t[p])&&(r=(s?l(e,a,r):l(r))||r);return s&&r&&h(e,a,r),r};let o=class extends c.TailwindElement(){constructor(){super(...arguments),this.value="",this.selected=!1}handleOptionClick(t){this.value=t,this.dispatchEvent(new CustomEvent("click",{detail:{value:t,label:this.label??this.innerText},bubbles:!0,composed:!0}))}render(){const t={"font-semibold relative cursor-pointer py-2 px-3":!0,"bg-secondary-container text-secondery-onContainer":this.selected};return u.html` <li
|
|
2
2
|
tabindex="0"
|
|
3
3
|
class="${this.classMap(t)}"
|
|
4
4
|
role="option"
|
|
@@ -11,4 +11,4 @@
|
|
|
11
11
|
<slot name="support"></slot>
|
|
12
12
|
</schmancy-flex>
|
|
13
13
|
</li>`}};n([i.property({type:String,reflect:!0})],o.prototype,"value",2),n([i.property({type:String,reflect:!0})],o.prototype,"label",2),n([i.property({type:Boolean})],o.prototype,"selected",2),o=n([i.customElement("schmancy-option")],o);
|
|
14
|
-
//# sourceMappingURL=option-
|
|
14
|
+
//# sourceMappingURL=option-BqkECJuR.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"option-
|
|
1
|
+
{"version":3,"file":"option-BqkECJuR.cjs","sources":["../src/option/option.ts"],"sourcesContent":["import { TailwindElement } from '@mixins/index'\nimport { html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nexport type SchmancyOptionChangeEvent = CustomEvent<{\n\tvalue: string\n\tlabel: string\n}>\n@customElement('schmancy-option')\nexport default class SchmancyOption extends TailwindElement() {\n\t@property({ type: String, reflect: true }) value: string = ''\n\t@property({ type: String, reflect: true }) label: string | undefined\n\t@property({ type: Boolean }) selected: boolean = false\n\n\thandleOptionClick(option: string) {\n\t\tthis.value = option\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('click', {\n\t\t\t\tdetail: { value: option, label: this.label ?? this.innerText },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}) as SchmancyOptionChangeEvent,\n\t\t)\n\t}\n\n\tprotected render(): unknown {\n\t\tconst classes = {\n\t\t\t'font-semibold relative cursor-pointer py-2 px-3': true,\n\t\t\t'bg-secondary-container text-secondery-onContainer': this.selected,\n\t\t}\n\t\tconst stateLayerClasses = {\n\t\t\t'duration-500 transition-opacity': true,\n\t\t\t'hover:bg-surface-on opacity-[0.08] cursor-pointer absolute inset-0': true,\n\t\t}\n\n\t\treturn html` <li\n\t\t\ttabindex=\"0\"\n\t\t\tclass=\"${this.classMap(classes)}\"\n\t\t\trole=\"option\"\n\t\t\t@click=${e => {\n\t\t\t\te.stopPropagation()\n\t\t\t\te.preventDefault()\n\t\t\t\tthis.handleOptionClick(this.value)\n\t\t\t}}\n\t\t\t@keydown=${e => {\n\t\t\t\tif (e.key === 'Enter' || e.key === ' ') {\n\t\t\t\t\te.stopPropagation()\n\t\t\t\t\te.preventDefault()\n\t\t\t\t\tthis.handleOptionClick(this.value)\n\t\t\t\t}\n\t\t\t}}\n\t\t>\n\t\t\t<div class=\"${this.classMap(stateLayerClasses)}\"></div>\n\t\t\t<schmancy-flex align=\"center\" justify=\"between\">\n\t\t\t\t<slot></slot>\n\t\t\t\t<slot name=\"support\"></slot>\n\t\t\t</schmancy-flex>\n\t\t</li>`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-option': SchmancyOption\n\t}\n}\n"],"names":["SchmancyOption","TailwindElement","super","arguments","this","value","selected","option","dispatchEvent","CustomEvent","detail","label","innerText","bubbles","composed","render","classes","html","classMap","e","stopPropagation","preventDefault","handleOptionClick","key","__decorateClass","property","type","String","reflect","prototype","Boolean","customElement"],"mappings":"4YAQA,IAAqBA,EAArB,cAA4CC,EAAAA,gBAA5C,CAAA,CAAA,aAAAC,CAAAA,MAAAA,GAAAC,SAC4DC,EAAAA,KAAAC,MAAA,GAEVD,KAAAE,SAAAA,EAAA,CAEjD,kBAAkBC,EACjBH,CAAAA,KAAKC,MAAQE,EACRH,KAAAI,cACJ,IAAIC,YAAY,QAAS,CACxBC,OAAQ,CAAEL,MAAOE,EAAQI,MAAOP,KAAKO,OAASP,KAAKQ,SACnDC,EAAAA,QAAAA,GACAC,SAAAA,EAEF,CAAA,CAAA,CAAA,CAGS,QAAAC,CACT,MAAMC,EAAU,CACf,kDAAA,GACA,oDAAqDZ,KAAKE,QAAAA,EAOpD,OAAAW;;YAEGb,KAAKc,SAASF,CAAAA,CAAAA;AAAAA;AAAAA,YAETG,GAAAA,CACbA,EAAEC,gBACFD,EAAAA,EAAEE,iBACGjB,KAAAkB,kBAAkBlB,KAAKC,KAAK,CAAA,CAAA;AAAA,cAElBc,GAAAA,CACXA,EAAEI,MAAQ,SAAWJ,EAAEI,MAAQ,MAClCJ,EAAEC,gBAAAA,EACFD,EAAEE,eAAAA,EACGjB,KAAAkB,kBAAkBlB,KAAKC,KAAK,EAAA,CAAA;AAAA;AAAA,iBAIrBD,KAAKc,SAtBM,CACzB,kCAAmC,GACnC,qEAAsE,EAAA,CAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAoBxB,CAAA,EA1CLM,EAAA,CAA1CC,EAAAA,SAAS,CAAEC,KAAMC,OAAQC,QAAS,EAAA,CAAA,CAAA,EADf5B,EACuB6B,UAAA,QAAA,GACAL,EAAA,CAA1CC,EAAAA,SAAS,CAAEC,KAAMC,OAAQC,QAAAA,EAFN5B,CAAAA,CAAAA,EAAAA,EAEuB6B,UAAA,QAAA,CAAA,EACdL,EAAA,CAA5BC,WAAS,CAAEC,KAAMI,WAHE9B,EAGS6B,UAAA,WAAA,CAHT7B,EAAAA,EAArBwB,EAAA,CADCO,EAAAA,cAAc,iBACM/B,CAAAA,EAAAA,CAAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "rxjs";
|
|
2
2
|
import "lit/directives/class-map.js";
|
|
3
3
|
import "lit/directives/style-map.js";
|
|
4
|
-
import { T as c } from "./tailwind.mixin-
|
|
4
|
+
import { T as c } from "./tailwind.mixin-Cfc4hNUi.js";
|
|
5
5
|
import { html as h } from "lit";
|
|
6
6
|
import { property as p, customElement as u } from "lit/decorators.js";
|
|
7
7
|
var d = Object.defineProperty, y = Object.getOwnPropertyDescriptor, i = (t, e, n, s) => {
|
|
@@ -37,4 +37,4 @@ let r = class extends c() {
|
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
39
|
i([p({ type: String, reflect: !0 })], r.prototype, "value", 2), i([p({ type: String, reflect: !0 })], r.prototype, "label", 2), i([p({ type: Boolean })], r.prototype, "selected", 2), r = i([u("schmancy-option")], r);
|
|
40
|
-
//# sourceMappingURL=option-
|
|
40
|
+
//# sourceMappingURL=option-J1jC8uMC.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"option-
|
|
1
|
+
{"version":3,"file":"option-J1jC8uMC.js","sources":["../src/option/option.ts"],"sourcesContent":["import { TailwindElement } from '@mixins/index'\nimport { html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nexport type SchmancyOptionChangeEvent = CustomEvent<{\n\tvalue: string\n\tlabel: string\n}>\n@customElement('schmancy-option')\nexport default class SchmancyOption extends TailwindElement() {\n\t@property({ type: String, reflect: true }) value: string = ''\n\t@property({ type: String, reflect: true }) label: string | undefined\n\t@property({ type: Boolean }) selected: boolean = false\n\n\thandleOptionClick(option: string) {\n\t\tthis.value = option\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('click', {\n\t\t\t\tdetail: { value: option, label: this.label ?? this.innerText },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}) as SchmancyOptionChangeEvent,\n\t\t)\n\t}\n\n\tprotected render(): unknown {\n\t\tconst classes = {\n\t\t\t'font-semibold relative cursor-pointer py-2 px-3': true,\n\t\t\t'bg-secondary-container text-secondery-onContainer': this.selected,\n\t\t}\n\t\tconst stateLayerClasses = {\n\t\t\t'duration-500 transition-opacity': true,\n\t\t\t'hover:bg-surface-on opacity-[0.08] cursor-pointer absolute inset-0': true,\n\t\t}\n\n\t\treturn html` <li\n\t\t\ttabindex=\"0\"\n\t\t\tclass=\"${this.classMap(classes)}\"\n\t\t\trole=\"option\"\n\t\t\t@click=${e => {\n\t\t\t\te.stopPropagation()\n\t\t\t\te.preventDefault()\n\t\t\t\tthis.handleOptionClick(this.value)\n\t\t\t}}\n\t\t\t@keydown=${e => {\n\t\t\t\tif (e.key === 'Enter' || e.key === ' ') {\n\t\t\t\t\te.stopPropagation()\n\t\t\t\t\te.preventDefault()\n\t\t\t\t\tthis.handleOptionClick(this.value)\n\t\t\t\t}\n\t\t\t}}\n\t\t>\n\t\t\t<div class=\"${this.classMap(stateLayerClasses)}\"></div>\n\t\t\t<schmancy-flex align=\"center\" justify=\"between\">\n\t\t\t\t<slot></slot>\n\t\t\t\t<slot name=\"support\"></slot>\n\t\t\t</schmancy-flex>\n\t\t</li>`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-option': SchmancyOption\n\t}\n}\n"],"names":["SchmancyOption","TailwindElement","super","arguments","this","value","selected","option","dispatchEvent","CustomEvent","detail","label","innerText","bubbles","composed","classes","html","classMap","e","stopPropagation","preventDefault","handleOptionClick","key","__decorateClass","property","type","String","reflect","prototype","Boolean","customElement"],"mappings":";;;;;;;;;;AAQA,IAAqBA,IAArB,cAA4CC,EAA5C,EAAA;AAAA,EAAA,cAAAC;AAAAA,UAAAA,GAAAC,SAC4DC,GAAAA,KAAAC,QAAA,IAEVD,KAAAE,WAAA;AAAA,EAAA;AAAA,EAEjD,kBAAkBC,GAAAA;AACjBH,SAAKC,QAAQE,GACRH,KAAAI,cACJ,IAAIC,YAAY,SAAS,EACxBC,QAAQ,EAAEL,OAAOE,GAAQI,OAAOP,KAAKO,SAASP,KAAKQ,UACnDC,GAAAA,SAAAA,IACAC,UAAAA;EAEF;AAAA,EAGS,SACT;AAAA,UAAMC,IAAU,EACf,mDAAmD,IACnD,qDAAqDX,KAAKE,SAOpD;AAAA,WAAAU;AAAAA;AAAAA,YAEGZ,KAAKa,SAASF,CAAAA,CAAAA;AAAAA;AAAAA,YAETG,CAAAA,MAAAA;AACbA,MAAAA,EAAEC,gBACFD,GAAAA,EAAEE,kBACGhB,KAAAiB,kBAAkBjB,KAAKC,KAAK;AAAA,IAAA,CAAA;AAAA,cAElBa,CAAAA,MAAAA;AACD,MAAVA,EAAEI,QAAQ,WAAWJ,EAAEI,QAAQ,QAClCJ,EAAEC,gBAAAA,GACFD,EAAEE,eAAAA,GACGhB,KAAAiB,kBAAkBjB,KAAKC,KAAK;AAAA,IAAA,CAAA;AAAA;AAAA,iBAIrBD,KAAKa,SAtBM,EACzB,mCAAmC,IACnC,sEAAsE,GAAA,CAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAoBxB;AAAA;AA1CLM,EAAA,CAA1CC,EAAS,EAAEC,MAAMC,QAAQC,SAAS,GAAA,CAAA,CAAA,GADf3B,EACuB4B,WAAA,SAAA,CACAL,GAAAA,EAAA,CAA1CC,EAAS,EAAEC,MAAMC,QAAQC,SAAAA,GAFN3B,CAAAA,CAAAA,GAAAA,EAEuB4B,WAAA,SAAA,CAAA,GACdL,EAAA,CAA5BC,EAAS,EAAEC,MAAMI,QAHE7B,CAAAA,CAAAA,GAAAA,EAGS4B,WAAA,YAAA,CAAA,GAHT5B,IAArBuB,EAAA,CADCO,EAAc,iBACM9B,CAAAA,GAAAA,CAAAA;"}
|
package/dist/option.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";require("./option-
|
|
1
|
+
"use strict";require("./option-BqkECJuR.cjs");
|
|
2
2
|
//# sourceMappingURL=option.cjs.map
|
package/dist/option.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import "./option-
|
|
1
|
+
import "./option-J1jC8uMC.js";
|
|
2
2
|
//# sourceMappingURL=option.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const a=require("rxjs");require("lit/directives/class-map.js"),require("lit/directives/style-map.js");const p=require("./tailwind.mixin-
|
|
1
|
+
"use strict";const a=require("rxjs");require("lit/directives/class-map.js"),require("lit/directives/style-map.js");const p=require("./tailwind.mixin-BN3VyP3_.cjs"),u=require("lit"),d=require("lit/decorators.js");function l(e,t){const n=document.createElement("schmancy-notification");return n.setAttribute("type",t),n.innerHTML=e,n}const s=new a.Subject,f=new a.Subject,v={success:(e,t)=>{const n=l(e,"success");return s.next({component:n,config:t}),n},error:(e,t)=>{const n=l(e,"error");return s.next({component:n,config:t}),n},warning:(e,t)=>{const n=l(e,"warning");return s.next({component:n,config:t}),n},info:(e,t)=>{const n=l(e,"info");return s.next({component:n,config:t}),n},dismiss:e=>{f.next(e)}};s.pipe(a.buffer(s.pipe(a.debounceTime(1e3)))).subscribe(e=>{if(e.length>1){const t=e[e.length-1];s.next({component:t.component,config:t.config})}}),s.subscribe(({component:e,config:t})=>{var n;(n=document.body)==null||n.appendChild(e),a.race(a.fromEvent(e,"close"),a.timer((t==null?void 0:t.duration)??3e3)).subscribe(()=>{e.remove()})}),f.subscribe(e=>{e.dispatchEvent(new CustomEvent("close"))});var h=Object.defineProperty,y=Object.getOwnPropertyDescriptor,m=(e,t,n,o)=>{for(var c,i=o>1?void 0:o?y(t,n):t,r=e.length-1;r>=0;r--)(c=e[r])&&(i=(o?c(t,n,i):c(i))||i);return o&&i&&h(t,n,i),i};exports.SchmancyNotification=class extends p.TailwindElement(){constructor(){super(...arguments),this.type="success"}render(){return u.html`
|
|
2
2
|
<div
|
|
3
3
|
aria-live="assertive"
|
|
4
4
|
class="pointer-events-none z-100 fixed inset-0 flex items-end px-4 py-6 sm:items-start sm:p-6"
|
|
@@ -58,4 +58,4 @@
|
|
|
58
58
|
</div>
|
|
59
59
|
</div>
|
|
60
60
|
`}},m([d.property({type:String})],exports.SchmancyNotification.prototype,"type",2),exports.SchmancyNotification=m([d.customElement("schmancy-notification")],exports.SchmancyNotification);var g=Object.defineProperty,b=Object.getOwnPropertyDescriptor;exports.SchmancyNotificationOutlet=class extends p.TailwindElement(){render(){return u.html` <slot></slot> `}},exports.SchmancyNotificationOutlet=((e,t,n,o)=>{for(var c,i=o>1?void 0:o?b(t,n):t,r=e.length-1;r>=0;r--)(c=e[r])&&(i=(o?c(t,n,i):c(i))||i);return o&&i&&g(t,n,i),i})([d.customElement("schmancy-notification-outlet")],exports.SchmancyNotificationOutlet),exports.$notify=v;
|
|
61
|
-
//# sourceMappingURL=outlet-
|
|
61
|
+
//# sourceMappingURL=outlet-CKML-ZhR.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outlet-u1_Qa8Li.cjs","sources":["../src/notification/$notification.ts","../src/notification/notification.ts","../src/notification/outlet.ts"],"sourcesContent":["import { Subject, buffer, debounceTime, fromEvent, race, timer } from 'rxjs'\nimport { SchmancyNotification } from './notification'\n\nexport type TNotification = 'success' | 'error' | 'warning' | 'info'\nexport type TNotificationConfig = {\n\taction?: typeof Function\n\tduration?: number\n}\n\n// Create a notification component and assign it the proper type.\nfunction createNotificationComponent(message: string, type: TNotification): SchmancyNotification {\n\tconst notificationComponent = document.createElement('schmancy-notification') as SchmancyNotification\n\tnotificationComponent.setAttribute('type', type)\n\tnotificationComponent.innerHTML = message\n\treturn notificationComponent\n}\n\n// Main notifications subject: each emission will schedule a notification.\nconst $notifications = new Subject<{\n\tcomponent: SchmancyNotification\n\tconfig?: TNotificationConfig\n}>()\n\n// New subject to handle explicit dismiss calls.\nconst $dismissNotification = new Subject<SchmancyNotification>()\n\n// Exported API for notifications\nexport const $notify = {\n\tsuccess: (message: string, config?: TNotificationConfig) => {\n\t\tconst component = createNotificationComponent(message, 'success')\n\t\t$notifications.next({ component, config })\n\t\treturn component\n\t},\n\terror: (message: string, config?: TNotificationConfig) => {\n\t\tconst component = createNotificationComponent(message, 'error')\n\t\t$notifications.next({ component, config })\n\t\treturn component\n\t},\n\twarning: (message: string, config?: TNotificationConfig) => {\n\t\tconst component = createNotificationComponent(message, 'warning')\n\t\t$notifications.next({ component, config })\n\t\treturn component\n\t},\n\tinfo: (message: string, config?: TNotificationConfig) => {\n\t\tconst component = createNotificationComponent(message, 'info')\n\t\t$notifications.next({ component, config })\n\t\treturn component\n\t},\n\t// New dismiss method: call this with a notification component to dismiss it early.\n\tdismiss: (component: SchmancyNotification) => {\n\t\t$dismissNotification.next(component)\n\t},\n}\n\n// Optional: If you want to collapse multiple notifications into a single one,\n// the same logic as before can be retained.\n$notifications.pipe(buffer($notifications.pipe(debounceTime(1000)))).subscribe(notifications => {\n\tif (notifications.length > 1) {\n\t\tconst notification = notifications[notifications.length - 1]\n\t\t// Re-emit the latest notification for display.\n\t\t$notifications.next({ component: notification.component, config: notification.config })\n\t}\n})\n\n// Whenever a notification is published, append it to the DOM and set up removal.\n$notifications.subscribe(({ component, config }) => {\n\tdocument.body?.appendChild(component)\n\n\t// Create a race: wait for either the component’s own 'close' event (or an external dismiss)\n\t// or a timeout based on the config's duration (default: 3000ms).\n\trace(fromEvent(component, 'close'), timer(config?.duration ?? 3000)).subscribe(() => {\n\t\tcomponent.remove()\n\t})\n})\n\n// Listen for explicit dismiss calls. When a notification is to be dismissed via $notify.dismiss(),\n// dispatch a 'close' event on it. This will trigger the race above.\n$dismissNotification.subscribe(component => {\n\t// You could also include any additional logic here if needed.\n\tcomponent.dispatchEvent(new CustomEvent('close'))\n})\n","import { TailwindElement } from '@mixins/index'\nimport { $notify } from '@schmancy/notification'\nimport { html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n@customElement('schmancy-notification')\nexport class SchmancyNotification extends TailwindElement() {\n\t@property({ type: String })\n\ttype: 'success' | 'error' | 'warning' | 'info' = 'success'\n\n\trender() {\n\t\treturn html`\n\t\t\t<div\n\t\t\t\taria-live=\"assertive\"\n\t\t\t\tclass=\"pointer-events-none z-100 fixed inset-0 flex items-end px-4 py-6 sm:items-start sm:p-6\"\n\t\t\t>\n\t\t\t\t<div class=\"flex w-full flex-col items-center space-y-4 sm:items-end\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tclass=\"pointer-events-auto w-full max-w-sm overflow-hidden rounded-lg bg-surface-container shadow-lg ring-1 ring-outlineVariant ring-opacity-5\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<div class=\"p-2\">\n\t\t\t\t\t\t\t<div class=\"flex items-center\">\n\t\t\t\t\t\t\t\t<div class=\"shrink-0\">\n\t\t\t\t\t\t\t\t\t${this.type === 'success'\n\t\t\t\t\t\t\t\t\t\t? html` <svg\n\t\t\t\t\t\t\t\t\t\t\t\tclass=\"h-6 w-6 text-success-default\"\n\t\t\t\t\t\t\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\t\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\t\t\t\t\t\t\tstroke-width=\"1.5\"\n\t\t\t\t\t\t\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\t\t\t\t\t\t\t\t\td=\"M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z\"\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t</svg>`\n\t\t\t\t\t\t\t\t\t\t: html` <svg\n\t\t\t\t\t\t\t\t\t\t\t\tclass=\"h-6 w-6 text-error-default\"\n\t\t\t\t\t\t\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\t\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\t\t\t\t\t\t\tstroke-width=\"1.5\"\n\t\t\t\t\t\t\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\t\t\t\t\t\t\t\t\td=\"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z\"\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t</svg>`}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"ml-3 w-0 flex-1 pt-0.5\">\n\t\t\t\t\t\t\t\t\t<p class=\" text-sm \">\n\t\t\t\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"ml-4 flex shrink-0\">\n\t\t\t\t\t\t\t\t\t<schmancy-icon-button\n\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\t@click=${() => {\n\t\t\t\t\t\t\t\t\t\t\t$notify.dismiss(this)\n\t\t\t\t\t\t\t\t\t\t\tthis.dispatchEvent(new CustomEvent('close'))\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<span class=\"sr-only\">Close</span>\n\t\t\t\t\t\t\t\t\t\tclose\n\t\t\t\t\t\t\t\t\t</schmancy-icon-button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-notification': SchmancyNotification\n\t}\n}\n","import { TailwindElement } from '@mixins/index'\nimport { html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\n@customElement('schmancy-notification-outlet')\nexport class SchmancyNotificationOutlet extends TailwindElement() {\n\trender() {\n\t\treturn html` <slot></slot> `\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-notification-outlet': SchmancyNotificationOutlet\n\t}\n}\n"],"names":["createNotificationComponent","message","type","notificationComponent","document","createElement","setAttribute","innerHTML","$notifications","Subject","$dismissNotification","$notify","success","config","component","next","error","warning","info","dismiss","pipe","buffer","debounceTime","subscribe","notifications","length","notification","body","appendChild","race","fromEvent","timer","duration","remove","dispatchEvent","CustomEvent","SchmancyNotification","TailwindElement","super","arguments","this","html","__decorateClass","property","String","prototype","customElement","SchmancyNotificationOutlet"],"mappings":"oNAUA,SAASA,EAA4BC,EAAiBC,EAAAA,CAC/C,MAAAC,EAAwBC,SAASC,cAAc,uBAG9C,EAAA,OAFeF,EAAAG,aAAa,OAAQJ,CAAAA,EAC3CC,EAAsBI,UAAYN,EAC3BE,CACR,CAGA,MAAMK,EAAiB,IAAIC,EAAAA,QAMrBC,EAAuB,IAAID,EAAAA,QAGpBE,EAAU,CACtBC,QAAS,CAACX,EAAiBY,IAAAA,CACpB,MAAAC,EAAYd,EAA4BC,EAAS,SAEhD,EAAA,OADPO,EAAeO,KAAK,CAAED,UAAWD,EAAAA,OAAAA,CAAAA,CAAAA,EAC1BC,CAAA,EAERE,MAAO,CAACf,EAAiBY,IAAAA,CAClB,MAAAC,EAAYd,EAA4BC,EAAS,OAEhD,EAAA,OADPO,EAAeO,KAAK,CAAED,UAAAA,EAAWD,OAC1BC,CAAAA,CAAAA,EAAAA,CAAA,EAERG,QAAS,CAAChB,EAAiBY,IACpB,CAAA,MAAAC,EAAYd,EAA4BC,EAAS,SAAA,EAEhD,OADPO,EAAeO,KAAK,CAAED,UAAAA,EAAWD,OAC1BC,CAAAA,CAAAA,EAAAA,CAAA,EAERI,KAAM,CAACjB,EAAiBY,IACjB,CAAA,MAAAC,EAAYd,EAA4BC,EAAS,MAAA,EAEhD,OADPO,EAAeO,KAAK,CAAED,UAAWD,EAAAA,OAAAA,CAAAA,CAAAA,EAC1BC,CAAA,EAGRK,QAAUL,GAAAA,CACTJ,EAAqBK,KAAKD,CAAS,CAAA,CAAA,EAMrCN,EAAeY,KAAKC,EAAAA,OAAOb,EAAeY,KAAKE,EAAAA,aAAa,GAAA,CAAA,CAAA,CAAA,EAASC,UAA2BC,GAAAA,CAC3F,GAAAA,EAAcC,OAAS,EAA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AAA,QAANA,qBAAAM,EAAA,CADNI,EAAAA,cAAc,uBAAA,CAAA,EACFV,4FCAAW,QAAAA,2BAAN,cAAyCV,EAAAA,gBAC/C,CAAA,CAAA,SACQ,OAAAI,EAAAA,qBAAA,CAAA,EAFIM,QAANA,6JAAA,CADND,EAAAA,cAAc,8BACFC,CAAAA,EAAAA"}
|
|
1
|
+
{"version":3,"file":"outlet-CKML-ZhR.cjs","sources":["../src/notification/$notification.ts","../src/notification/notification.ts","../src/notification/outlet.ts"],"sourcesContent":["import { Subject, buffer, debounceTime, fromEvent, race, timer } from 'rxjs'\nimport { SchmancyNotification } from './notification'\n\nexport type TNotification = 'success' | 'error' | 'warning' | 'info'\nexport type TNotificationConfig = {\n\taction?: typeof Function\n\tduration?: number\n}\n\n// Create a notification component and assign it the proper type.\nfunction createNotificationComponent(message: string, type: TNotification): SchmancyNotification {\n\tconst notificationComponent = document.createElement('schmancy-notification') as SchmancyNotification\n\tnotificationComponent.setAttribute('type', type)\n\tnotificationComponent.innerHTML = message\n\treturn notificationComponent\n}\n\n// Main notifications subject: each emission will schedule a notification.\nconst $notifications = new Subject<{\n\tcomponent: SchmancyNotification\n\tconfig?: TNotificationConfig\n}>()\n\n// New subject to handle explicit dismiss calls.\nconst $dismissNotification = new Subject<SchmancyNotification>()\n\n// Exported API for notifications\nexport const $notify = {\n\tsuccess: (message: string, config?: TNotificationConfig) => {\n\t\tconst component = createNotificationComponent(message, 'success')\n\t\t$notifications.next({ component, config })\n\t\treturn component\n\t},\n\terror: (message: string, config?: TNotificationConfig) => {\n\t\tconst component = createNotificationComponent(message, 'error')\n\t\t$notifications.next({ component, config })\n\t\treturn component\n\t},\n\twarning: (message: string, config?: TNotificationConfig) => {\n\t\tconst component = createNotificationComponent(message, 'warning')\n\t\t$notifications.next({ component, config })\n\t\treturn component\n\t},\n\tinfo: (message: string, config?: TNotificationConfig) => {\n\t\tconst component = createNotificationComponent(message, 'info')\n\t\t$notifications.next({ component, config })\n\t\treturn component\n\t},\n\t// New dismiss method: call this with a notification component to dismiss it early.\n\tdismiss: (component: SchmancyNotification) => {\n\t\t$dismissNotification.next(component)\n\t},\n}\n\n// Optional: If you want to collapse multiple notifications into a single one,\n// the same logic as before can be retained.\n$notifications.pipe(buffer($notifications.pipe(debounceTime(1000)))).subscribe(notifications => {\n\tif (notifications.length > 1) {\n\t\tconst notification = notifications[notifications.length - 1]\n\t\t// Re-emit the latest notification for display.\n\t\t$notifications.next({ component: notification.component, config: notification.config })\n\t}\n})\n\n// Whenever a notification is published, append it to the DOM and set up removal.\n$notifications.subscribe(({ component, config }) => {\n\tdocument.body?.appendChild(component)\n\n\t// Create a race: wait for either the component’s own 'close' event (or an external dismiss)\n\t// or a timeout based on the config's duration (default: 3000ms).\n\trace(fromEvent(component, 'close'), timer(config?.duration ?? 3000)).subscribe(() => {\n\t\tcomponent.remove()\n\t})\n})\n\n// Listen for explicit dismiss calls. When a notification is to be dismissed via $notify.dismiss(),\n// dispatch a 'close' event on it. This will trigger the race above.\n$dismissNotification.subscribe(component => {\n\t// You could also include any additional logic here if needed.\n\tcomponent.dispatchEvent(new CustomEvent('close'))\n})\n","import { TailwindElement } from '@mixins/index'\nimport { $notify } from '@schmancy/notification'\nimport { html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n@customElement('schmancy-notification')\nexport class SchmancyNotification extends TailwindElement() {\n\t@property({ type: String })\n\ttype: 'success' | 'error' | 'warning' | 'info' = 'success'\n\n\trender() {\n\t\treturn html`\n\t\t\t<div\n\t\t\t\taria-live=\"assertive\"\n\t\t\t\tclass=\"pointer-events-none z-100 fixed inset-0 flex items-end px-4 py-6 sm:items-start sm:p-6\"\n\t\t\t>\n\t\t\t\t<div class=\"flex w-full flex-col items-center space-y-4 sm:items-end\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tclass=\"pointer-events-auto w-full max-w-sm overflow-hidden rounded-lg bg-surface-container shadow-lg ring-1 ring-outlineVariant ring-opacity-5\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<div class=\"p-2\">\n\t\t\t\t\t\t\t<div class=\"flex items-center\">\n\t\t\t\t\t\t\t\t<div class=\"shrink-0\">\n\t\t\t\t\t\t\t\t\t${this.type === 'success'\n\t\t\t\t\t\t\t\t\t\t? html` <svg\n\t\t\t\t\t\t\t\t\t\t\t\tclass=\"h-6 w-6 text-success-default\"\n\t\t\t\t\t\t\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\t\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\t\t\t\t\t\t\tstroke-width=\"1.5\"\n\t\t\t\t\t\t\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\t\t\t\t\t\t\t\t\td=\"M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z\"\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t</svg>`\n\t\t\t\t\t\t\t\t\t\t: html` <svg\n\t\t\t\t\t\t\t\t\t\t\t\tclass=\"h-6 w-6 text-error-default\"\n\t\t\t\t\t\t\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\t\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\t\t\t\t\t\t\tstroke-width=\"1.5\"\n\t\t\t\t\t\t\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\t\t\t\t\t\t\t\t\td=\"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z\"\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t</svg>`}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"ml-3 w-0 flex-1 pt-0.5\">\n\t\t\t\t\t\t\t\t\t<p class=\" text-sm \">\n\t\t\t\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"ml-4 flex shrink-0\">\n\t\t\t\t\t\t\t\t\t<schmancy-icon-button\n\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\t@click=${() => {\n\t\t\t\t\t\t\t\t\t\t\t$notify.dismiss(this)\n\t\t\t\t\t\t\t\t\t\t\tthis.dispatchEvent(new CustomEvent('close'))\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<span class=\"sr-only\">Close</span>\n\t\t\t\t\t\t\t\t\t\tclose\n\t\t\t\t\t\t\t\t\t</schmancy-icon-button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-notification': SchmancyNotification\n\t}\n}\n","import { TailwindElement } from '@mixins/index'\nimport { html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\n@customElement('schmancy-notification-outlet')\nexport class SchmancyNotificationOutlet extends TailwindElement() {\n\trender() {\n\t\treturn html` <slot></slot> `\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-notification-outlet': SchmancyNotificationOutlet\n\t}\n}\n"],"names":["createNotificationComponent","message","type","notificationComponent","document","createElement","setAttribute","innerHTML","$notifications","Subject","$dismissNotification","$notify","success","config","component","next","error","warning","info","dismiss","pipe","buffer","debounceTime","subscribe","notifications","length","notification","body","appendChild","race","fromEvent","timer","duration","remove","dispatchEvent","CustomEvent","SchmancyNotification","TailwindElement","super","arguments","this","html","__decorateClass","property","String","prototype","customElement","SchmancyNotificationOutlet"],"mappings":"oNAUA,SAASA,EAA4BC,EAAiBC,EAAAA,CAC/C,MAAAC,EAAwBC,SAASC,cAAc,uBAG9C,EAAA,OAFeF,EAAAG,aAAa,OAAQJ,CAAAA,EAC3CC,EAAsBI,UAAYN,EAC3BE,CACR,CAGA,MAAMK,EAAiB,IAAIC,EAAAA,QAMrBC,EAAuB,IAAID,EAAAA,QAGpBE,EAAU,CACtBC,QAAS,CAACX,EAAiBY,IAAAA,CACpB,MAAAC,EAAYd,EAA4BC,EAAS,SAEhD,EAAA,OADPO,EAAeO,KAAK,CAAED,UAAWD,EAAAA,OAAAA,CAAAA,CAAAA,EAC1BC,CAAA,EAERE,MAAO,CAACf,EAAiBY,IAAAA,CAClB,MAAAC,EAAYd,EAA4BC,EAAS,OAEhD,EAAA,OADPO,EAAeO,KAAK,CAAED,UAAAA,EAAWD,OAC1BC,CAAAA,CAAAA,EAAAA,CAAA,EAERG,QAAS,CAAChB,EAAiBY,IACpB,CAAA,MAAAC,EAAYd,EAA4BC,EAAS,SAAA,EAEhD,OADPO,EAAeO,KAAK,CAAED,UAAAA,EAAWD,OAC1BC,CAAAA,CAAAA,EAAAA,CAAA,EAERI,KAAM,CAACjB,EAAiBY,IACjB,CAAA,MAAAC,EAAYd,EAA4BC,EAAS,MAAA,EAEhD,OADPO,EAAeO,KAAK,CAAED,UAAWD,EAAAA,O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AChBA,KAAKN,cAAc,IAAIC,YAAY,OAAQ,CAAA,CAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAC3C,CAxDVO,EAAAA,EAAA,CADCC,WAAS,CAAEzC,KAAM0C,MAAAA,CAAAA,CAAAA,EADNR,6BAEZS,UAAA,OAAA,CAFYT,EAAAA,QAANA,qBAAAM,EAAA,CADNI,EAAAA,cAAc,uBAAA,CAAA,EACFV,4FCAAW,QAAAA,2BAAN,cAAyCV,EAAAA,gBAC/C,CAAA,CAAA,SACQ,OAAAI,EAAAA,qBAAA,CAAA,EAFIM,QAANA,6JAAA,CADND,EAAAA,cAAc,8BACFC,CAAAA,EAAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Subject as m, buffer as g, debounceTime as x, race as y, fromEvent as b, timer as w } from "rxjs";
|
|
2
2
|
import "lit/directives/class-map.js";
|
|
3
3
|
import "lit/directives/style-map.js";
|
|
4
|
-
import { T as v } from "./tailwind.mixin-
|
|
4
|
+
import { T as v } from "./tailwind.mixin-Cfc4hNUi.js";
|
|
5
5
|
import { html as l } from "lit";
|
|
6
6
|
import { property as k, customElement as f } from "lit/decorators.js";
|
|
7
7
|
function a(e, t) {
|
|
@@ -125,4 +125,4 @@ export {
|
|
|
125
125
|
d as S,
|
|
126
126
|
u as a
|
|
127
127
|
};
|
|
128
|
-
//# sourceMappingURL=outlet-
|
|
128
|
+
//# sourceMappingURL=outlet-ylHmdM1r.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outlet-BsrhXTEg.js","sources":["../src/notification/$notification.ts","../src/notification/notification.ts","../src/notification/outlet.ts"],"sourcesContent":["import { Subject, buffer, debounceTime, fromEvent, race, timer } from 'rxjs'\nimport { SchmancyNotification } from './notification'\n\nexport type TNotification = 'success' | 'error' | 'warning' | 'info'\nexport type TNotificationConfig = {\n\taction?: typeof Function\n\tduration?: number\n}\n\n// Create a notification component and assign it the proper type.\nfunction createNotificationComponent(message: string, type: TNotification): SchmancyNotification {\n\tconst notificationComponent = document.createElement('schmancy-notification') as SchmancyNotification\n\tnotificationComponent.setAttribute('type', type)\n\tnotificationComponent.innerHTML = message\n\treturn notificationComponent\n}\n\n// Main notifications subject: each emission will schedule a notification.\nconst $notifications = new Subject<{\n\tcomponent: SchmancyNotification\n\tconfig?: TNotificationConfig\n}>()\n\n// New subject to handle explicit dismiss calls.\nconst $dismissNotification = new Subject<SchmancyNotification>()\n\n// Exported API for notifications\nexport const $notify = {\n\tsuccess: (message: string, config?: TNotificationConfig) => {\n\t\tconst component = createNotificationComponent(message, 'success')\n\t\t$notifications.next({ component, config })\n\t\treturn component\n\t},\n\terror: (message: string, config?: TNotificationConfig) => {\n\t\tconst component = createNotificationComponent(message, 'error')\n\t\t$notifications.next({ component, config })\n\t\treturn component\n\t},\n\twarning: (message: string, config?: TNotificationConfig) => {\n\t\tconst component = createNotificationComponent(message, 'warning')\n\t\t$notifications.next({ component, config })\n\t\treturn component\n\t},\n\tinfo: (message: string, config?: TNotificationConfig) => {\n\t\tconst component = createNotificationComponent(message, 'info')\n\t\t$notifications.next({ component, config })\n\t\treturn component\n\t},\n\t// New dismiss method: call this with a notification component to dismiss it early.\n\tdismiss: (component: SchmancyNotification) => {\n\t\t$dismissNotification.next(component)\n\t},\n}\n\n// Optional: If you want to collapse multiple notifications into a single one,\n// the same logic as before can be retained.\n$notifications.pipe(buffer($notifications.pipe(debounceTime(1000)))).subscribe(notifications => {\n\tif (notifications.length > 1) {\n\t\tconst notification = notifications[notifications.length - 1]\n\t\t// Re-emit the latest notification for display.\n\t\t$notifications.next({ component: notification.component, config: notification.config })\n\t}\n})\n\n// Whenever a notification is published, append it to the DOM and set up removal.\n$notifications.subscribe(({ component, config }) => {\n\tdocument.body?.appendChild(component)\n\n\t// Create a race: wait for either the component’s own 'close' event (or an external dismiss)\n\t// or a timeout based on the config's duration (default: 3000ms).\n\trace(fromEvent(component, 'close'), timer(config?.duration ?? 3000)).subscribe(() => {\n\t\tcomponent.remove()\n\t})\n})\n\n// Listen for explicit dismiss calls. When a notification is to be dismissed via $notify.dismiss(),\n// dispatch a 'close' event on it. This will trigger the race above.\n$dismissNotification.subscribe(component => {\n\t// You could also include any additional logic here if needed.\n\tcomponent.dispatchEvent(new CustomEvent('close'))\n})\n","import { TailwindElement } from '@mixins/index'\nimport { $notify } from '@schmancy/notification'\nimport { html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n@customElement('schmancy-notification')\nexport class SchmancyNotification extends TailwindElement() {\n\t@property({ type: String })\n\ttype: 'success' | 'error' | 'warning' | 'info' = 'success'\n\n\trender() {\n\t\treturn html`\n\t\t\t<div\n\t\t\t\taria-live=\"assertive\"\n\t\t\t\tclass=\"pointer-events-none z-100 fixed inset-0 flex items-end px-4 py-6 sm:items-start sm:p-6\"\n\t\t\t>\n\t\t\t\t<div class=\"flex w-full flex-col items-center space-y-4 sm:items-end\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tclass=\"pointer-events-auto w-full max-w-sm overflow-hidden rounded-lg bg-surface-container shadow-lg ring-1 ring-outlineVariant ring-opacity-5\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<div class=\"p-2\">\n\t\t\t\t\t\t\t<div class=\"flex items-center\">\n\t\t\t\t\t\t\t\t<div class=\"shrink-0\">\n\t\t\t\t\t\t\t\t\t${this.type === 'success'\n\t\t\t\t\t\t\t\t\t\t? html` <svg\n\t\t\t\t\t\t\t\t\t\t\t\tclass=\"h-6 w-6 text-success-default\"\n\t\t\t\t\t\t\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\t\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\t\t\t\t\t\t\tstroke-width=\"1.5\"\n\t\t\t\t\t\t\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\t\t\t\t\t\t\t\t\td=\"M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z\"\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t</svg>`\n\t\t\t\t\t\t\t\t\t\t: html` <svg\n\t\t\t\t\t\t\t\t\t\t\t\tclass=\"h-6 w-6 text-error-default\"\n\t\t\t\t\t\t\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\t\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\t\t\t\t\t\t\tstroke-width=\"1.5\"\n\t\t\t\t\t\t\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\t\t\t\t\t\t\t\t\td=\"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z\"\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t</svg>`}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"ml-3 w-0 flex-1 pt-0.5\">\n\t\t\t\t\t\t\t\t\t<p class=\" text-sm \">\n\t\t\t\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"ml-4 flex shrink-0\">\n\t\t\t\t\t\t\t\t\t<schmancy-icon-button\n\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\t@click=${() => {\n\t\t\t\t\t\t\t\t\t\t\t$notify.dismiss(this)\n\t\t\t\t\t\t\t\t\t\t\tthis.dispatchEvent(new CustomEvent('close'))\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<span class=\"sr-only\">Close</span>\n\t\t\t\t\t\t\t\t\t\tclose\n\t\t\t\t\t\t\t\t\t</schmancy-icon-button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-notification': SchmancyNotification\n\t}\n}\n","import { TailwindElement } from '@mixins/index'\nimport { html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\n@customElement('schmancy-notification-outlet')\nexport class SchmancyNotificationOutlet extends TailwindElement() {\n\trender() {\n\t\treturn html` <slot></slot> `\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-notification-outlet': SchmancyNotificationOutlet\n\t}\n}\n"],"names":["createNotificationComponent","message","type","notificationComponent","document","createElement","setAttribute","innerHTML","$notifications","Subject","$dismissNotification","$notify","success","config","component","next","error","warning","info","dismiss","pipe","buffer","debounceTime","subscribe","notifications","length","notification","body","appendChild","race","fromEvent","timer","duration","remove","dispatchEvent","CustomEvent","SchmancyNotification","TailwindElement","super","arguments","this","html","__decorateClass","property","String","prototype","customElement","SchmancyNotificationOutlet"],"mappings":";;;;;;AAUA,SAASA,EAA4BC,GAAiBC,GAAAA;AAC/C,QAAAC,IAAwBC,SAASC,cAAc,uBAG9C;AAAA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A;"}
|
|
1
|
+
{"version":3,"file":"outlet-ylHmdM1r.js","sources":["../src/notification/$notification.ts","../src/notification/notification.ts","../src/notification/outlet.ts"],"sourcesContent":["import { Subject, buffer, debounceTime, fromEvent, race, timer } from 'rxjs'\nimport { SchmancyNotification } from './notification'\n\nexport type TNotification = 'success' | 'error' | 'warning' | 'info'\nexport type TNotificationConfig = {\n\taction?: typeof Function\n\tduration?: number\n}\n\n// Create a notification component and assign it the proper type.\nfunction createNotificationComponent(message: string, type: TNotification): SchmancyNotification {\n\tconst notificationComponent = document.createElement('schmancy-notification') as SchmancyNotification\n\tnotificationComponent.setAttribute('type', type)\n\tnotificationComponent.innerHTML = message\n\treturn notificationComponent\n}\n\n// Main notifications subject: each emission will schedule a notification.\nconst $notifications = new Subject<{\n\tcomponent: SchmancyNotification\n\tconfig?: TNotificationConfig\n}>()\n\n// New subject to handle explicit dismiss calls.\nconst $dismissNotification = new Subject<SchmancyNotification>()\n\n// Exported API for notifications\nexport const $notify = {\n\tsuccess: (message: string, config?: TNotificationConfig) => {\n\t\tconst component = createNotificationComponent(message, 'success')\n\t\t$notifications.next({ component, config })\n\t\treturn component\n\t},\n\terror: (message: string, config?: TNotificationConfig) => {\n\t\tconst component = createNotificationComponent(message, 'error')\n\t\t$notifications.next({ component, config })\n\t\treturn component\n\t},\n\twarning: (message: string, config?: TNotificationConfig) => {\n\t\tconst component = createNotificationComponent(message, 'warning')\n\t\t$notifications.next({ component, config })\n\t\treturn component\n\t},\n\tinfo: (message: string, config?: TNotificationConfig) => {\n\t\tconst component = createNotificationComponent(message, 'info')\n\t\t$notifications.next({ component, config })\n\t\treturn component\n\t},\n\t// New dismiss method: call this with a notification component to dismiss it early.\n\tdismiss: (component: SchmancyNotification) => {\n\t\t$dismissNotification.next(component)\n\t},\n}\n\n// Optional: If you want to collapse multiple notifications into a single one,\n// the same logic as before can be retained.\n$notifications.pipe(buffer($notifications.pipe(debounceTime(1000)))).subscribe(notifications => {\n\tif (notifications.length > 1) {\n\t\tconst notification = notifications[notifications.length - 1]\n\t\t// Re-emit the latest notification for display.\n\t\t$notifications.next({ component: notification.component, config: notification.config })\n\t}\n})\n\n// Whenever a notification is published, append it to the DOM and set up removal.\n$notifications.subscribe(({ component, config }) => {\n\tdocument.body?.appendChild(component)\n\n\t// Create a race: wait for either the component’s own 'close' event (or an external dismiss)\n\t// or a timeout based on the config's duration (default: 3000ms).\n\trace(fromEvent(component, 'close'), timer(config?.duration ?? 3000)).subscribe(() => {\n\t\tcomponent.remove()\n\t})\n})\n\n// Listen for explicit dismiss calls. When a notification is to be dismissed via $notify.dismiss(),\n// dispatch a 'close' event on it. This will trigger the race above.\n$dismissNotification.subscribe(component => {\n\t// You could also include any additional logic here if needed.\n\tcomponent.dispatchEvent(new CustomEvent('close'))\n})\n","import { TailwindElement } from '@mixins/index'\nimport { $notify } from '@schmancy/notification'\nimport { html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n@customElement('schmancy-notification')\nexport class SchmancyNotification extends TailwindElement() {\n\t@property({ type: String })\n\ttype: 'success' | 'error' | 'warning' | 'info' = 'success'\n\n\trender() {\n\t\treturn html`\n\t\t\t<div\n\t\t\t\taria-live=\"assertive\"\n\t\t\t\tclass=\"pointer-events-none z-100 fixed inset-0 flex items-end px-4 py-6 sm:items-start sm:p-6\"\n\t\t\t>\n\t\t\t\t<div class=\"flex w-full flex-col items-center space-y-4 sm:items-end\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tclass=\"pointer-events-auto w-full max-w-sm overflow-hidden rounded-lg bg-surface-container shadow-lg ring-1 ring-outlineVariant ring-opacity-5\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<div class=\"p-2\">\n\t\t\t\t\t\t\t<div class=\"flex items-center\">\n\t\t\t\t\t\t\t\t<div class=\"shrink-0\">\n\t\t\t\t\t\t\t\t\t${this.type === 'success'\n\t\t\t\t\t\t\t\t\t\t? html` <svg\n\t\t\t\t\t\t\t\t\t\t\t\tclass=\"h-6 w-6 text-success-default\"\n\t\t\t\t\t\t\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\t\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\t\t\t\t\t\t\tstroke-width=\"1.5\"\n\t\t\t\t\t\t\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\t\t\t\t\t\t\t\t\td=\"M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z\"\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t</svg>`\n\t\t\t\t\t\t\t\t\t\t: html` <svg\n\t\t\t\t\t\t\t\t\t\t\t\tclass=\"h-6 w-6 text-error-default\"\n\t\t\t\t\t\t\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\t\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\t\t\t\t\t\t\tstroke-width=\"1.5\"\n\t\t\t\t\t\t\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\t\t\t\t\t\t\t\t\td=\"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z\"\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t</svg>`}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"ml-3 w-0 flex-1 pt-0.5\">\n\t\t\t\t\t\t\t\t\t<p class=\" text-sm \">\n\t\t\t\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"ml-4 flex shrink-0\">\n\t\t\t\t\t\t\t\t\t<schmancy-icon-button\n\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\t@click=${() => {\n\t\t\t\t\t\t\t\t\t\t\t$notify.dismiss(this)\n\t\t\t\t\t\t\t\t\t\t\tthis.dispatchEvent(new CustomEvent('close'))\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<span class=\"sr-only\">Close</span>\n\t\t\t\t\t\t\t\t\t\tclose\n\t\t\t\t\t\t\t\t\t</schmancy-icon-button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-notification': SchmancyNotification\n\t}\n}\n","import { TailwindElement } from '@mixins/index'\nimport { html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\n@customElement('schmancy-notification-outlet')\nexport class SchmancyNotificationOutlet extends TailwindElement() {\n\trender() {\n\t\treturn html` <slot></slot> `\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-notification-outlet': SchmancyNotificationOutlet\n\t}\n}\n"],"names":["createNotificationComponent","message","type","notificationComponent","document","createElement","setAttribute","innerHTML","$notifications","Subject","$dismissNotification","$notify","success","config","component","next","error","warning","info","dismiss","pipe","buffer","debounceTime","subscribe","notifications","length","notification","body","appendChild","race","fromEvent","timer","duration","remove","dispatchEvent","CustomEvent","SchmancyNotification","TailwindElement","super","arguments","this","html","__decorateClass","property","String","prototype","customElement","SchmancyNotificationOutlet"],"mappings":";;;;;;AAUA,SAASA,EAA4BC,GAAiBC,GAAAA;AAC/C,QAAAC,IAAwBC,SAASC,cAAc,uBAG9C;AAAA,SAFeF,EAAAG,aAAa,QAAQJ,CAAAA,GAC3CC,EAAsBI,YAAYN,GAC3BE;AACR;AAGA,MAAMK,IAAiB,IAAIC,KAMrBC,IAAuB,IAAID,KAGpBE,IAAU,EACtBC,SAAS,CAACX,GAAiBY,MACpB;AAAA,QAAAC,IAAYd,EAA4BC,GAAS,SAAA;AAEhD,SADPO,EAAeO,KAAK,EAAED,WAAWD,GAAAA,QAAAA,EAAAA,CAAAA,GAC1BC;AAAA,GAERE,OAAO,CAACf,GAAiBY,MAClB;AAAA,QAAAC,IAAYd,EAA4BC,GAAS,OAAA;AAEhD,SADPO,EAAeO,KAAK,EAAED,WAAWD,GAAAA,QAAAA,EAAAA,CAAAA,GAC1BC;AAAA,GAERG,SAAS,CAAChB,GAAiBY,MAAAA;AACpB,QAAAC,IAAYd,EAA4BC,GAAS,SAEhD;AAAA,SADPO,EAAeO,KAAK,EAAED,WAAAA,GAAWD,QAC1BC,EAAAA,CAAAA,GAAAA;AAAA,GAERI,MAAM,CAACjB,GAAiBY,MACjB;AAAA,QAAAC,IAAYd,EAA4BC,GAAS,MAAA;AAEhD,SADPO,EAAeO,KAAK,EAAED,WAAWD,GAAAA,QAAAA,EAAAA,CAAAA,GAC1BC;AAAA,GAGRK,SAAUL,OAAAA;AACTJ,EAAAA,EAAqBK,KAAKD,CAAS;AAAA,EAAA;AAMrCN,EAAeY,KAAKC,EAAOb,EAAeY,KAAKE,EAAa,QAASC,UAA2BC,OAAAA;AAC3F,MAAAA,EAAcC,SAAS,GAAG;AAC7B,UAAMC,I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DVO,EAAA,CADCC,EAAS,EAAEzC,MAAM0C,OAAAA,CAAAA,CAAAA,GADNR,EAEZS,WAAA,QAAA,CAFYT,GAAAA,IAANM,EAAA,CADNI,EAAc,2BACFV;;ACAA,IAAAW,IAAN,cAAyCV,EAC/C,EAAA;AAAA,EAAA;AACQ,WAAAI;AAAAA,EAAA;AAAA;AAFIM;;;GAAN,CADND,EAAc,8BACFC,CAAAA,GAAAA,CAAAA;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";require("rxjs"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js");const w=require("./litElement.mixin-DWxwPXWQ.cjs");require("./tailwind.mixin-_mD_GeAp.cjs");const b=require("lit"),f=require("lit/decorators.js");var x=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},y=function(e,t,r,i,n,a,o,s,d,p){var l=this;l.numeralDecimalMark=e||".",l.numeralIntegerScale=t>0?t:0,l.numeralDecimalScale=r>=0?r:2,l.numeralThousandsGroupStyle=i||y.groupStyle.thousand,l.numeralPositiveOnly=!!n,l.stripLeadingZeroes=a!==!1,l.prefix=o||o===""?o:"",l.signBeforePrefix=!!s,l.tailPrefix=!!d,l.delimiter=p||p===""?p:",",l.delimiterRE=p?new RegExp("\\"+p,"g"):""};y.groupStyle={thousand:"thousand",lakh:"lakh",wan:"wan",none:"none"},y.prototype={getRawValue:function(e){return e.replace(this.delimiterRE,"").replace(this.numeralDecimalMark,".")},format:function(e){var t,r,i,n,a=this,o="";switch(e=e.replace(/[A-Za-z]/g,"").replace(a.numeralDecimalMark,"M").replace(/[^\dM-]/g,"").replace(/^\-/,"N").replace(/\-/g,"").replace("N",a.numeralPositiveOnly?"":"-").replace("M",a.numeralDecimalMark),a.stripLeadingZeroes&&(e=e.replace(/^(-)?0+(?=\d)/,"$1")),r=e.slice(0,1)==="-"?"-":"",i=a.prefix!==void 0?a.signBeforePrefix?r+a.prefix:a.prefix+r:r,n=e,e.indexOf(a.numeralDecimalMark)>=0&&(n=(t=e.split(a.numeralDecimalMark))[0],o=a.numeralDecimalMark+t[1].slice(0,a.numeralDecimalScale)),r==="-"&&(n=n.slice(1)),a.numeralIntegerScale>0&&(n=n.slice(0,a.numeralIntegerScale)),a.numeralThousandsGroupStyle){case y.groupStyle.lakh:n=n.replace(/(\d)(?=(\d\d)+\d$)/g,"$1"+a.delimiter);break;case y.groupStyle.wan:n=n.replace(/(\d)(?=(\d{4})+$)/g,"$1"+a.delimiter);break;case y.groupStyle.thousand:n=n.replace(/(\d)(?=(\d{3})+$)/g,"$1"+a.delimiter)}return a.tailPrefix?r+n.toString()+(a.numeralDecimalScale>0?o.toString():"")+a.prefix:i+n.toString()+(a.numeralDecimalScale>0?o.toString():"")}};var I=y,k=function(e,t,r){var i=this;i.date=[],i.blocks=[],i.datePattern=e,i.dateMin=t.split("-").reverse().map(function(n){return parseInt(n,10)}),i.dateMin.length===2&&i.dateMin.unshift(0),i.dateMax=r.split("-").reverse().map(function(n){return parseInt(n,10)}),i.dateMax.length===2&&i.dateMax.unshift(0),i.initBlocks()};k.prototype={initBlocks:function(){var e=this;e.datePattern.forEach(function(t){t==="Y"?e.blocks.push(4):e.blocks.push(2)})},getISOFormatDate:function(){var e=this,t=e.date;return t[2]?t[2]+"-"+e.addLeadingZero(t[1])+"-"+e.addLeadingZero(t[0]):""},getBlocks:function(){return this.blocks},getValidatedDate:function(e){var t=this,r="";return e=e.replace(/[^\d]/g,""),t.blocks.forEach(function(i,n){if(e.length>0){var a=e.slice(0,i),o=a.slice(0,1),s=e.slice(i);switch(t.datePattern[n]){case"d":a==="00"?a="01":parseInt(o,10)>3?a="0"+o:parseInt(a,10)>31&&(a="31");break;case"m":a==="00"?a="01":parseInt(o,10)>1?a="0"+o:parseInt(a,10)>12&&(a="12")}r+=a,e=s}}),this.getFixedDateString(r)},getFixedDateString:function(e){var t,r,i,n=this,a=n.datePattern,o=[],s=0,d=0,p=0,l=0,m=0,u=0,g=!1;return e.length===4&&a[0].toLowerCase()!=="y"&&a[1].toLowerCase()!=="y"&&(m=2-(l=a[0]==="d"?0:2),t=parseInt(e.slice(l,l+2),10),r=parseInt(e.slice(m,m+2),10),o=this.getFixedDate(t,r,0)),e.length===8&&(a.forEach(function(h,C){switch(h){case"d":s=C;break;case"m":d=C;break;default:p=C}}),u=2*p,l=s<=p?2*s:2*s+2,m=d<=p?2*d:2*d+2,t=parseInt(e.slice(l,l+2),10),r=parseInt(e.slice(m,m+2),10),i=parseInt(e.slice(u,u+4),10),g=e.slice(u,u+4).length===4,o=this.getFixedDate(t,r,i)),e.length!==4||a[0]!=="y"&&a[1]!=="y"||(u=2-(m=a[0]==="m"?0:2),r=parseInt(e.slice(m,m+2),10),i=parseInt(e.slice(u,u+2),10),g=e.slice(u,u+2).length===2,o=[0,r,i]),e.length!==6||a[0]!=="Y"&&a[1]!=="Y"||(u=2-.5*(m=a[0]==="m"?0:4),r=parseInt(e.slice(m,m+2),10),i=parseInt(e.slice(u,u+4),10),g=e.slice(u,u+4).length===4,o=[0,r,i]),o=n.getRangeFixedDate(o),n.date=o,o.length===0?e:a.reduce(function(h,C){switch(C){case"d":return h+(o[0]===0?"":n.addLeadingZero(o[0]));case"m":return h+(o[1]===0?"":n.addLeadingZero(o[1]));case"y":return h+(g?n.addLeadingZeroForYear(o[2],!1):"");case"Y":return h+(g?n.addLeadingZeroForYear(o[2],!0):"")}},"")},getRangeFixedDate:function(e){var t=this,r=t.datePattern,i=t.dateMin||[],n=t.dateMax||[];return!e.length||i.length<3&&n.length<3||r.find(function(a){return a.toLowerCase()==="y"})&&e[2]===0?e:n.length&&(n[2]<e[2]||n[2]===e[2]&&(n[1]<e[1]||n[1]===e[1]&&n[0]<e[0]))?n:i.length&&(i[2]>e[2]||i[2]===e[2]&&(i[1]>e[1]||i[1]===e[1]&&i[0]>e[0]))?i:e},getFixedDate:function(e,t,r){return e=Math.min(e,31),t=Math.min(t,12),r=parseInt(r||0,10),(t<7&&t%2==0||t>8&&t%2==1)&&(e=Math.min(e,t===2?this.isLeapYear(r)?29:28:30)),[e,t,r]},isLeapYear:function(e){return e%4==0&&e%100!=0||e%400==0},addLeadingZero:function(e){return(e<10?"0":"")+e},addLeadingZeroForYear:function(e,t){return t?(e<10?"000":e<100?"00":e<1e3?"0":"")+e:(e<10?"0":"")+e}};var L=k,F=function(e,t){var r=this;r.time=[],r.blocks=[],r.timePattern=e,r.timeFormat=t,r.initBlocks()};F.prototype={initBlocks:function(){var e=this;e.timePattern.forEach(function(){e.blocks.push(2)})},getISOFormatTime:function(){var e=this,t=e.time;return t[2]?e.addLeadingZero(t[0])+":"+e.addLeadingZero(t[1])+":"+e.addLeadingZero(t[2]):""},getBlocks:function(){return this.blocks},getTimeFormatOptions:function(){return String(this.timeFormat)==="12"?{maxHourFirstDigit:1,maxHours:12,maxMinutesFirstDigit:5,maxMinutes:60}:{maxHourFirstDigit:2,maxHours:23,maxMinutesFirstDigit:5,maxMinutes:60}},getValidatedTime:function(e){var t=this,r="";e=e.replace(/[^\d]/g,"");var i=t.getTimeFormatOptions();return t.blocks.forEach(function(n,a){if(e.length>0){var o=e.slice(0,n),s=o.slice(0,1),d=e.slice(n);switch(t.timePattern[a]){case"h":parseInt(s,10)>i.maxHourFirstDigit?o="0"+s:parseInt(o,10)>i.maxHours&&(o=i.maxHours+"");break;case"m":case"s":parseInt(s,10)>i.maxMinutesFirstDigit?o="0"+s:parseInt(o,10)>i.maxMinutes&&(o=i.maxMinutes+"")}r+=o,e=d}}),this.getFixedTimeString(r)},getFixedTimeString:function(e){var t,r,i,n=this,a=n.timePattern,o=[],s=0,d=0,p=0,l=0,m=0,u=0;return e.length===6&&(a.forEach(function(g,h){switch(g){case"s":s=2*h;break;case"m":d=2*h;break;case"h":p=2*h}}),u=p,m=d,l=s,t=parseInt(e.slice(l,l+2),10),r=parseInt(e.slice(m,m+2),10),i=parseInt(e.slice(u,u+2),10),o=this.getFixedTime(i,r,t)),e.length===4&&n.timePattern.indexOf("s")<0&&(a.forEach(function(g,h){switch(g){case"m":d=2*h;break;case"h":p=2*h}}),u=p,m=d,t=0,r=parseInt(e.slice(m,m+2),10),i=parseInt(e.slice(u,u+2),10),o=this.getFixedTime(i,r,t)),n.time=o,o.length===0?e:a.reduce(function(g,h){switch(h){case"s":return g+n.addLeadingZero(o[2]);case"m":return g+n.addLeadingZero(o[1]);case"h":return g+n.addLeadingZero(o[0])}},"")},getFixedTime:function(e,t,r){return r=Math.min(parseInt(r||0,10),60),t=Math.min(t,60),[e=Math.min(e,60),t,r]},addLeadingZero:function(e){return(e<10?"0":"")+e}};var V=F,P=function(e,t){var r=this;r.delimiter=t||t===""?t:" ",r.delimiterRE=t?new RegExp("\\"+t,"g"):"",r.formatter=e};P.prototype={setFormatter:function(e){this.formatter=e},format:function(e){var t=this;t.formatter.clear();for(var r,i="",n=!1,a=0,o=(e=(e=(e=e.replace(/[^\d+]/g,"")).replace(/^\+/,"B").replace(/\+/g,"").replace("B","+")).replace(t.delimiterRE,"")).length;a<o;a++)r=t.formatter.inputDigit(e.charAt(a)),/[\s()-]/g.test(r)?(i=r,n=!0):n||(i=r);return i=(i=i.replace(/[()]/g,"")).replace(/[\s-]/g,t.delimiter)}};var M=P,D={blocks:{uatp:[4,5,6],amex:[4,6,5],diners:[4,6,4],discover:[4,4,4,4],mastercard:[4,4,4,4],dankort:[4,4,4,4],instapayment:[4,4,4,4],jcb15:[4,6,5],jcb:[4,4,4,4],maestro:[4,4,4,4],visa:[4,4,4,4],mir:[4,4,4,4],unionPay:[4,4,4,4],general:[4,4,4,4]},re:{uatp:/^(?!1800)1\d{0,14}/,amex:/^3[47]\d{0,13}/,discover:/^(?:6011|65\d{0,2}|64[4-9]\d?)\d{0,12}/,diners:/^3(?:0([0-5]|9)|[689]\d?)\d{0,11}/,mastercard:/^(5[1-5]\d{0,2}|22[2-9]\d{0,1}|2[3-7]\d{0,2})\d{0,12}/,dankort:/^(5019|4175|4571)\d{0,12}/,instapayment:/^63[7-9]\d{0,13}/,jcb15:/^(?:2131|1800)\d{0,11}/,jcb:/^(?:35\d{0,2})\d{0,12}/,maestro:/^(?:5[0678]\d{0,2}|6304|67\d{0,2})\d{0,12}/,mir:/^220[0-4]\d{0,12}/,visa:/^4\d{0,15}/,unionPay:/^(62|81)\d{0,14}/},getStrictBlocks:function(e){var t=e.reduce(function(r,i){return r+i},0);return e.concat(19-t)},getInfo:function(e,t){var r=D.blocks,i=D.re;for(var n in t=!!t,i)if(i[n].test(e)){var a=r[n];return{type:n,blocks:t?this.getStrictBlocks(a):a}}return{type:"unknown",blocks:t?this.getStrictBlocks(r.general):r.general}}},E=D,T={noop:function(){},strip:function(e,t){return e.replace(t,"")},getPostDelimiter:function(e,t,r){if(r.length===0)return e.slice(-t.length)===t?t:"";var i="";return r.forEach(function(n){e.slice(-n.length)===n&&(i=n)}),i},getDelimiterREByDelimiter:function(e){return new RegExp(e.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),"g")},getNextCursorPosition:function(e,t,r,i,n){return t.length===e?r.length:e+this.getPositionOffset(e,t,r,i,n)},getPositionOffset:function(e,t,r,i,n){var a,o,s;return a=this.stripDelimiters(t.slice(0,e),i,n),o=this.stripDelimiters(r.slice(0,e),i,n),(s=a.length-o.length)!==0?s/Math.abs(s):0},stripDelimiters:function(e,t,r){var i=this;if(r.length===0){var n=t?i.getDelimiterREByDelimiter(t):"";return e.replace(n,"")}return r.forEach(function(a){a.split("").forEach(function(o){e=e.replace(i.getDelimiterREByDelimiter(o),"")})}),e},headStr:function(e,t){return e.slice(0,t)},getMaxLength:function(e){return e.reduce(function(t,r){return t+r},0)},getPrefixStrippedValue:function(e,t,r,i,n,a,o,s,d){if(r===0)return e;if(e===t&&e!=="")return"";if(d&&e.slice(0,1)=="-"){var p=i.slice(0,1)=="-"?i.slice(1):i;return"-"+this.getPrefixStrippedValue(e.slice(1),t,r,p,n,a,o,s,d)}if(i.slice(0,r)!==t&&!s||i.slice(-r)!==t&&s)return o&&!i&&e?e:"";var l=this.stripDelimiters(i,n,a);return e.slice(0,r)===t||s?e.slice(-r)!==t&&s?l.slice(0,-r-1):s?e.slice(0,-r):e.slice(r):l.slice(r)},getFirstDiffIndex:function(e,t){for(var r=0;e.charAt(r)===t.charAt(r);)if(e.charAt(r++)==="")return-1;return r},getFormattedValue:function(e,t,r,i,n,a){var o="",s=n.length>0,d="";return r===0?e:(t.forEach(function(p,l){if(e.length>0){var m=e.slice(0,p),u=e.slice(p);d=s?n[a?l-1:l]||d:i,a?(l>0&&(o+=d),o+=m):(o+=m,m.length===p&&l<r-1&&(o+=d)),e=u}}),o)},fixPrefixCursor:function(e,t,r,i){if(e){var n=e.value,a=r||i[0]||" ";if(e.setSelectionRange&&t&&!(t.length+a.length<=n.length)){var o=2*n.length;setTimeout(function(){e.setSelectionRange(o,o)},1)}}},checkFullSelection:function(e){try{return(window.getSelection()||document.getSelection()||{}).toString().length===e.length}catch{}return!1},setSelection:function(e,t,r){if(e===this.getActiveElement(r)&&!(e&&e.value.length<=t))if(e.createTextRange){var i=e.createTextRange();i.move("character",t),i.select()}else try{e.setSelectionRange(t,t)}catch{}},getActiveElement:function(e){var t=e.activeElement;return t&&t.shadowRoot?this.getActiveElement(t.shadowRoot):t},isAndroid:function(){return navigator&&/android/i.test(navigator.userAgent)},isAndroidBackspaceKeydown:function(e,t){return!!(this.isAndroid()&&e&&t)&&t===e.slice(0,-1)}},B={assign:function(e,t){return t=t||{},(e=e||{}).creditCard=!!t.creditCard,e.creditCardStrictMode=!!t.creditCardStrictMode,e.creditCardType="",e.onCreditCardTypeChanged=t.onCreditCardTypeChanged||function(){},e.phone=!!t.phone,e.phoneRegionCode=t.phoneRegionCode||"AU",e.phoneFormatter={},e.time=!!t.time,e.timePattern=t.timePattern||["h","m","s"],e.timeFormat=t.timeFormat||"24",e.timeFormatter={},e.date=!!t.date,e.datePattern=t.datePattern||["d","m","Y"],e.dateMin=t.dateMin||"",e.dateMax=t.dateMax||"",e.dateFormatter={},e.numeral=!!t.numeral,e.numeralIntegerScale=t.numeralIntegerScale>0?t.numeralIntegerScale:0,e.numeralDecimalScale=t.numeralDecimalScale>=0?t.numeralDecimalScale:2,e.numeralDecimalMark=t.numeralDecimalMark||".",e.numeralThousandsGroupStyle=t.numeralThousandsGroupStyle||"thousand",e.numeralPositiveOnly=!!t.numeralPositiveOnly,e.stripLeadingZeroes=t.stripLeadingZeroes!==!1,e.signBeforePrefix=!!t.signBeforePrefix,e.tailPrefix=!!t.tailPrefix,e.swapHiddenInput=!!t.swapHiddenInput,e.numericOnly=e.creditCard||e.date||!!t.numericOnly,e.uppercase=!!t.uppercase,e.lowercase=!!t.lowercase,e.prefix=e.creditCard||e.date?"":t.prefix||"",e.noImmediatePrefix=!!t.noImmediatePrefix,e.prefixLength=e.prefix.length,e.rawValueTrimPrefix=!!t.rawValueTrimPrefix,e.copyDelimiter=!!t.copyDelimiter,e.initValue=t.initValue!==void 0&&t.initValue!==null?t.initValue.toString():"",e.delimiter=t.delimiter||t.delimiter===""?t.delimiter:t.date?"/":t.time?":":t.numeral?",":(t.phone," "),e.delimiterLength=e.delimiter.length,e.delimiterLazyShow=!!t.delimiterLazyShow,e.delimiters=t.delimiters||[],e.blocks=t.blocks||[],e.blocksLength=e.blocks.length,e.root=typeof x=="object"&&x?x:window,e.document=t.document||e.root.document,e.maxLength=0,e.backspace=!1,e.result="",e.onValueChanged=t.onValueChanged||function(){},e}},c=function(e,t){var r=this;if(typeof e=="string"?(r.element=document.querySelector(e),document.querySelectorAll(e).length>1):e.length!==void 0&&e.length>0?(r.element=e[0],e.length>1):r.element=e,!r.element)throw new Error("[cleave.js] Please check the element");t.initValue=r.element.value,r.properties=c.DefaultProperties.assign({},t),r.init()};c.prototype={init:function(){var e=this,t=e.properties;t.numeral||t.phone||t.creditCard||t.time||t.date||t.blocksLength!==0||t.prefix?(t.maxLength=c.Util.getMaxLength(t.blocks),e.isAndroid=c.Util.isAndroid(),e.lastInputValue="",e.isBackward="",e.onChangeListener=e.onChange.bind(e),e.onKeyDownListener=e.onKeyDown.bind(e),e.onFocusListener=e.onFocus.bind(e),e.onCutListener=e.onCut.bind(e),e.onCopyListener=e.onCopy.bind(e),e.initSwapHiddenInput(),e.element.addEventListener("input",e.onChangeListener),e.element.addEventListener("keydown",e.onKeyDownListener),e.element.addEventListener("focus",e.onFocusListener),e.element.addEventListener("cut",e.onCutListener),e.element.addEventListener("copy",e.onCopyListener),e.initPhoneFormatter(),e.initDateFormatter(),e.initTimeFormatter(),e.initNumeralFormatter(),(t.initValue||t.prefix&&!t.noImmediatePrefix)&&e.onInput(t.initValue)):e.onInput(t.initValue)},initSwapHiddenInput:function(){var e=this;if(e.properties.swapHiddenInput){var t=e.element.cloneNode(!0);e.element.parentNode.insertBefore(t,e.element),e.elementSwapHidden=e.element,e.elementSwapHidden.type="hidden",e.element=t,e.element.id=""}},initNumeralFormatter:function(){var e=this.properties;e.numeral&&(e.numeralFormatter=new c.NumeralFormatter(e.numeralDecimalMark,e.numeralIntegerScale,e.numeralDecimalScale,e.numeralThousandsGroupStyle,e.numeralPositiveOnly,e.stripLeadingZeroes,e.prefix,e.signBeforePrefix,e.tailPrefix,e.delimiter))},initTimeFormatter:function(){var e=this.properties;e.time&&(e.timeFormatter=new c.TimeFormatter(e.timePattern,e.timeFormat),e.blocks=e.timeFormatter.getBlocks(),e.blocksLength=e.blocks.length,e.maxLength=c.Util.getMaxLength(e.blocks))},initDateFormatter:function(){var e=this.properties;e.date&&(e.dateFormatter=new c.DateFormatter(e.datePattern,e.dateMin,e.dateMax),e.blocks=e.dateFormatter.getBlocks(),e.blocksLength=e.blocks.length,e.maxLength=c.Util.getMaxLength(e.blocks))},initPhoneFormatter:function(){var e=this.properties;if(e.phone)try{e.phoneFormatter=new c.PhoneFormatter(new e.root.Cleave.AsYouTypeFormatter(e.phoneRegionCode),e.delimiter)}catch{throw new Error("[cleave.js] Please include phone-type-formatter.{country}.js lib")}},onKeyDown:function(e){var t=this,r=e.which||e.keyCode;t.lastInputValue=t.element.value,t.isBackward=r===8},onChange:function(e){var t=this,r=t.properties,i=c.Util;t.isBackward=t.isBackward||e.inputType==="deleteContentBackward";var n=i.getPostDelimiter(t.lastInputValue,r.delimiter,r.delimiters);t.isBackward&&n?r.postDelimiterBackspace=n:r.postDelimiterBackspace=!1,this.onInput(this.element.value)},onFocus:function(){var e=this,t=e.properties;e.lastInputValue=e.element.value,t.prefix&&t.noImmediatePrefix&&!e.element.value&&this.onInput(t.prefix),c.Util.fixPrefixCursor(e.element,t.prefix,t.delimiter,t.delimiters)},onCut:function(e){c.Util.checkFullSelection(this.element.value)&&(this.copyClipboardData(e),this.onInput(""))},onCopy:function(e){c.Util.checkFullSelection(this.element.value)&&this.copyClipboardData(e)},copyClipboardData:function(e){var t=this.properties,r=c.Util,i=this.element.value,n="";n=t.copyDelimiter?i:r.stripDelimiters(i,t.delimiter,t.delimiters);try{e.clipboardData?e.clipboardData.setData("Text",n):window.clipboardData.setData("Text",n),e.preventDefault()}catch{}},onInput:function(e){var t=this,r=t.properties,i=c.Util,n=i.getPostDelimiter(e,r.delimiter,r.delimiters);return r.numeral||!r.postDelimiterBackspace||n||(e=i.headStr(e,e.length-r.postDelimiterBackspace.length)),r.phone?(!r.prefix||r.noImmediatePrefix&&!e.length?r.result=r.phoneFormatter.format(e):r.result=r.prefix+r.phoneFormatter.format(e).slice(r.prefix.length),void t.updateValueState()):r.numeral?(r.prefix&&r.noImmediatePrefix&&e.length===0?r.result="":r.result=r.numeralFormatter.format(e),void t.updateValueState()):(r.date&&(e=r.dateFormatter.getValidatedDate(e)),r.time&&(e=r.timeFormatter.getValidatedTime(e)),e=i.stripDelimiters(e,r.delimiter,r.delimiters),e=i.getPrefixStrippedValue(e,r.prefix,r.prefixLength,r.result,r.delimiter,r.delimiters,r.noImmediatePrefix,r.tailPrefix,r.signBeforePrefix),e=r.numericOnly?i.strip(e,/[^\d]/g):e,e=r.uppercase?e.toUpperCase():e,e=r.lowercase?e.toLowerCase():e,r.prefix&&(r.tailPrefix?e+=r.prefix:e=r.prefix+e,r.blocksLength===0)?(r.result=e,void t.updateValueState()):(r.creditCard&&t.updateCreditCardPropsByValue(e),e=i.headStr(e,r.maxLength),r.result=i.getFormattedValue(e,r.blocks,r.blocksLength,r.delimiter,r.delimiters,r.delimiterLazyShow),void t.updateValueState()))},updateCreditCardPropsByValue:function(e){var t,r=this.properties,i=c.Util;i.headStr(r.result,4)!==i.headStr(e,4)&&(t=c.CreditCardDetector.getInfo(e,r.creditCardStrictMode),r.blocks=t.blocks,r.blocksLength=r.blocks.length,r.maxLength=i.getMaxLength(r.blocks),r.creditCardType!==t.type&&(r.creditCardType=t.type,r.onCreditCardTypeChanged.call(this,r.creditCardType)))},updateValueState:function(){var e=this,t=c.Util,r=e.properties;if(e.element){var i=e.element.selectionEnd,n=e.element.value,a=r.result;i=t.getNextCursorPosition(i,n,a,r.delimiter,r.delimiters),e.isAndroid?window.setTimeout(function(){e.element.value=a,t.setSelection(e.element,i,r.document,!1),e.callOnValueChanged()},1):(e.element.value=a,r.swapHiddenInput&&(e.elementSwapHidden.value=e.getRawValue()),t.setSelection(e.element,i,r.document,!1),e.callOnValueChanged())}},callOnValueChanged:function(){var e=this,t=e.properties;t.onValueChanged.call(e,{target:{name:e.element.name,value:t.result,rawValue:e.getRawValue()}})},setPhoneRegionCode:function(e){var t=this;t.properties.phoneRegionCode=e,t.initPhoneFormatter(),t.onChange()},setRawValue:function(e){var t=this,r=t.properties;e=e!=null?e.toString():"",r.numeral&&(e=e.replace(".",r.numeralDecimalMark)),r.postDelimiterBackspace=!1,t.element.value=e,t.onInput(e)},getRawValue:function(){var e=this.properties,t=c.Util,r=this.element.value;return e.rawValueTrimPrefix&&(r=t.getPrefixStrippedValue(r,e.prefix,e.prefixLength,e.result,e.delimiter,e.delimiters,e.noImmediatePrefix,e.tailPrefix,e.signBeforePrefix)),r=e.numeral?e.numeralFormatter.getRawValue(r):t.stripDelimiters(r,e.delimiter,e.delimiters)},getISOFormatDate:function(){var e=this.properties;return e.date?e.dateFormatter.getISOFormatDate():""},getISOFormatTime:function(){var e=this.properties;return e.time?e.timeFormatter.getISOFormatTime():""},getFormattedValue:function(){return this.element.value},destroy:function(){var e=this;e.element.removeEventListener("input",e.onChangeListener),e.element.removeEventListener("keydown",e.onKeyDownListener),e.element.removeEventListener("focus",e.onFocusListener),e.element.removeEventListener("cut",e.onCutListener),e.element.removeEventListener("copy",e.onCopyListener)},toString:function(){return"[Cleave Object]"}},c.NumeralFormatter=I,c.DateFormatter=L,c.TimeFormatter=V,c.PhoneFormatter=M,c.CreditCardDetector=E,c.Util=T,c.DefaultProperties=B,(typeof x=="object"&&x?x:window).Cleave=c;var S=c,N=Object.defineProperty,R=Object.getOwnPropertyDescriptor,v=(e,t,r,i)=>{for(var n,a=i>1?void 0:i?R(t,r):t,o=e.length-1;o>=0;o--)(n=e[o])&&(a=(i?n(t,r,a):n(a))||a);return i&&a&&N(t,r,a),a};exports.SchmancyPaymentCardForm=class extends w.$LitElement(){constructor(){super(...arguments),this.value={cardName:"",cardNumber:"",expirationDate:"",cvv:""}}firstUpdated(){new S(this.cardNumberInput,{creditCard:!0,creditCardStrictMode:!0,onCreditCardTypeChanged:e=>{e==="unknown"?this.cardNumberInput.setCustomValidity("Please enter a valid card number."):this.cardNumberInput.setCustomValidity("")}}),new S(this.expirationDateInput,{date:!0,datePattern:["m","y"],onValueChanged:e=>{!e.target.value||e.target.value.length<5?this.expirationDateInput.setCustomValidity("Please enter a valid expiration date."):this.expirationDateInput.setCustomValidity("")}}),new S(this.cvvInput,{blocks:[4],numericOnly:!0,onValueChanged:e=>{e.target.value.length<3?this.cvvInput.setCustomValidity("Please enter a valid CVV."):this.cvvInput.setCustomValidity("")}}),new S(this.cardNameInput,{uppercase:!0,delimiter:" "})}reportValidity(){return this.form.reportValidity()}checkValidity(){return!!this.form.reportValidity()}emitChange(){this.dispatchEvent(new CustomEvent("change",{detail:{...this.value}}))}render(){return b.html` <schmancy-form
|
|
1
|
+
"use strict";require("rxjs"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js");const w=require("./litElement.mixin-BILTK9_q.cjs");require("./tailwind.mixin-BN3VyP3_.cjs");const b=require("lit"),f=require("lit/decorators.js");var x=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},y=function(e,t,r,i,n,a,o,s,d,p){var l=this;l.numeralDecimalMark=e||".",l.numeralIntegerScale=t>0?t:0,l.numeralDecimalScale=r>=0?r:2,l.numeralThousandsGroupStyle=i||y.groupStyle.thousand,l.numeralPositiveOnly=!!n,l.stripLeadingZeroes=a!==!1,l.prefix=o||o===""?o:"",l.signBeforePrefix=!!s,l.tailPrefix=!!d,l.delimiter=p||p===""?p:",",l.delimiterRE=p?new RegExp("\\"+p,"g"):""};y.groupStyle={thousand:"thousand",lakh:"lakh",wan:"wan",none:"none"},y.prototype={getRawValue:function(e){return e.replace(this.delimiterRE,"").replace(this.numeralDecimalMark,".")},format:function(e){var t,r,i,n,a=this,o="";switch(e=e.replace(/[A-Za-z]/g,"").replace(a.numeralDecimalMark,"M").replace(/[^\dM-]/g,"").replace(/^\-/,"N").replace(/\-/g,"").replace("N",a.numeralPositiveOnly?"":"-").replace("M",a.numeralDecimalMark),a.stripLeadingZeroes&&(e=e.replace(/^(-)?0+(?=\d)/,"$1")),r=e.slice(0,1)==="-"?"-":"",i=a.prefix!==void 0?a.signBeforePrefix?r+a.prefix:a.prefix+r:r,n=e,e.indexOf(a.numeralDecimalMark)>=0&&(n=(t=e.split(a.numeralDecimalMark))[0],o=a.numeralDecimalMark+t[1].slice(0,a.numeralDecimalScale)),r==="-"&&(n=n.slice(1)),a.numeralIntegerScale>0&&(n=n.slice(0,a.numeralIntegerScale)),a.numeralThousandsGroupStyle){case y.groupStyle.lakh:n=n.replace(/(\d)(?=(\d\d)+\d$)/g,"$1"+a.delimiter);break;case y.groupStyle.wan:n=n.replace(/(\d)(?=(\d{4})+$)/g,"$1"+a.delimiter);break;case y.groupStyle.thousand:n=n.replace(/(\d)(?=(\d{3})+$)/g,"$1"+a.delimiter)}return a.tailPrefix?r+n.toString()+(a.numeralDecimalScale>0?o.toString():"")+a.prefix:i+n.toString()+(a.numeralDecimalScale>0?o.toString():"")}};var I=y,k=function(e,t,r){var i=this;i.date=[],i.blocks=[],i.datePattern=e,i.dateMin=t.split("-").reverse().map(function(n){return parseInt(n,10)}),i.dateMin.length===2&&i.dateMin.unshift(0),i.dateMax=r.split("-").reverse().map(function(n){return parseInt(n,10)}),i.dateMax.length===2&&i.dateMax.unshift(0),i.initBlocks()};k.prototype={initBlocks:function(){var e=this;e.datePattern.forEach(function(t){t==="Y"?e.blocks.push(4):e.blocks.push(2)})},getISOFormatDate:function(){var e=this,t=e.date;return t[2]?t[2]+"-"+e.addLeadingZero(t[1])+"-"+e.addLeadingZero(t[0]):""},getBlocks:function(){return this.blocks},getValidatedDate:function(e){var t=this,r="";return e=e.replace(/[^\d]/g,""),t.blocks.forEach(function(i,n){if(e.length>0){var a=e.slice(0,i),o=a.slice(0,1),s=e.slice(i);switch(t.datePattern[n]){case"d":a==="00"?a="01":parseInt(o,10)>3?a="0"+o:parseInt(a,10)>31&&(a="31");break;case"m":a==="00"?a="01":parseInt(o,10)>1?a="0"+o:parseInt(a,10)>12&&(a="12")}r+=a,e=s}}),this.getFixedDateString(r)},getFixedDateString:function(e){var t,r,i,n=this,a=n.datePattern,o=[],s=0,d=0,p=0,l=0,m=0,u=0,g=!1;return e.length===4&&a[0].toLowerCase()!=="y"&&a[1].toLowerCase()!=="y"&&(m=2-(l=a[0]==="d"?0:2),t=parseInt(e.slice(l,l+2),10),r=parseInt(e.slice(m,m+2),10),o=this.getFixedDate(t,r,0)),e.length===8&&(a.forEach(function(h,C){switch(h){case"d":s=C;break;case"m":d=C;break;default:p=C}}),u=2*p,l=s<=p?2*s:2*s+2,m=d<=p?2*d:2*d+2,t=parseInt(e.slice(l,l+2),10),r=parseInt(e.slice(m,m+2),10),i=parseInt(e.slice(u,u+4),10),g=e.slice(u,u+4).length===4,o=this.getFixedDate(t,r,i)),e.length!==4||a[0]!=="y"&&a[1]!=="y"||(u=2-(m=a[0]==="m"?0:2),r=parseInt(e.slice(m,m+2),10),i=parseInt(e.slice(u,u+2),10),g=e.slice(u,u+2).length===2,o=[0,r,i]),e.length!==6||a[0]!=="Y"&&a[1]!=="Y"||(u=2-.5*(m=a[0]==="m"?0:4),r=parseInt(e.slice(m,m+2),10),i=parseInt(e.slice(u,u+4),10),g=e.slice(u,u+4).length===4,o=[0,r,i]),o=n.getRangeFixedDate(o),n.date=o,o.length===0?e:a.reduce(function(h,C){switch(C){case"d":return h+(o[0]===0?"":n.addLeadingZero(o[0]));case"m":return h+(o[1]===0?"":n.addLeadingZero(o[1]));case"y":return h+(g?n.addLeadingZeroForYear(o[2],!1):"");case"Y":return h+(g?n.addLeadingZeroForYear(o[2],!0):"")}},"")},getRangeFixedDate:function(e){var t=this,r=t.datePattern,i=t.dateMin||[],n=t.dateMax||[];return!e.length||i.length<3&&n.length<3||r.find(function(a){return a.toLowerCase()==="y"})&&e[2]===0?e:n.length&&(n[2]<e[2]||n[2]===e[2]&&(n[1]<e[1]||n[1]===e[1]&&n[0]<e[0]))?n:i.length&&(i[2]>e[2]||i[2]===e[2]&&(i[1]>e[1]||i[1]===e[1]&&i[0]>e[0]))?i:e},getFixedDate:function(e,t,r){return e=Math.min(e,31),t=Math.min(t,12),r=parseInt(r||0,10),(t<7&&t%2==0||t>8&&t%2==1)&&(e=Math.min(e,t===2?this.isLeapYear(r)?29:28:30)),[e,t,r]},isLeapYear:function(e){return e%4==0&&e%100!=0||e%400==0},addLeadingZero:function(e){return(e<10?"0":"")+e},addLeadingZeroForYear:function(e,t){return t?(e<10?"000":e<100?"00":e<1e3?"0":"")+e:(e<10?"0":"")+e}};var L=k,F=function(e,t){var r=this;r.time=[],r.blocks=[],r.timePattern=e,r.timeFormat=t,r.initBlocks()};F.prototype={initBlocks:function(){var e=this;e.timePattern.forEach(function(){e.blocks.push(2)})},getISOFormatTime:function(){var e=this,t=e.time;return t[2]?e.addLeadingZero(t[0])+":"+e.addLeadingZero(t[1])+":"+e.addLeadingZero(t[2]):""},getBlocks:function(){return this.blocks},getTimeFormatOptions:function(){return String(this.timeFormat)==="12"?{maxHourFirstDigit:1,maxHours:12,maxMinutesFirstDigit:5,maxMinutes:60}:{maxHourFirstDigit:2,maxHours:23,maxMinutesFirstDigit:5,maxMinutes:60}},getValidatedTime:function(e){var t=this,r="";e=e.replace(/[^\d]/g,"");var i=t.getTimeFormatOptions();return t.blocks.forEach(function(n,a){if(e.length>0){var o=e.slice(0,n),s=o.slice(0,1),d=e.slice(n);switch(t.timePattern[a]){case"h":parseInt(s,10)>i.maxHourFirstDigit?o="0"+s:parseInt(o,10)>i.maxHours&&(o=i.maxHours+"");break;case"m":case"s":parseInt(s,10)>i.maxMinutesFirstDigit?o="0"+s:parseInt(o,10)>i.maxMinutes&&(o=i.maxMinutes+"")}r+=o,e=d}}),this.getFixedTimeString(r)},getFixedTimeString:function(e){var t,r,i,n=this,a=n.timePattern,o=[],s=0,d=0,p=0,l=0,m=0,u=0;return e.length===6&&(a.forEach(function(g,h){switch(g){case"s":s=2*h;break;case"m":d=2*h;break;case"h":p=2*h}}),u=p,m=d,l=s,t=parseInt(e.slice(l,l+2),10),r=parseInt(e.slice(m,m+2),10),i=parseInt(e.slice(u,u+2),10),o=this.getFixedTime(i,r,t)),e.length===4&&n.timePattern.indexOf("s")<0&&(a.forEach(function(g,h){switch(g){case"m":d=2*h;break;case"h":p=2*h}}),u=p,m=d,t=0,r=parseInt(e.slice(m,m+2),10),i=parseInt(e.slice(u,u+2),10),o=this.getFixedTime(i,r,t)),n.time=o,o.length===0?e:a.reduce(function(g,h){switch(h){case"s":return g+n.addLeadingZero(o[2]);case"m":return g+n.addLeadingZero(o[1]);case"h":return g+n.addLeadingZero(o[0])}},"")},getFixedTime:function(e,t,r){return r=Math.min(parseInt(r||0,10),60),t=Math.min(t,60),[e=Math.min(e,60),t,r]},addLeadingZero:function(e){return(e<10?"0":"")+e}};var V=F,P=function(e,t){var r=this;r.delimiter=t||t===""?t:" ",r.delimiterRE=t?new RegExp("\\"+t,"g"):"",r.formatter=e};P.prototype={setFormatter:function(e){this.formatter=e},format:function(e){var t=this;t.formatter.clear();for(var r,i="",n=!1,a=0,o=(e=(e=(e=e.replace(/[^\d+]/g,"")).replace(/^\+/,"B").replace(/\+/g,"").replace("B","+")).replace(t.delimiterRE,"")).length;a<o;a++)r=t.formatter.inputDigit(e.charAt(a)),/[\s()-]/g.test(r)?(i=r,n=!0):n||(i=r);return i=(i=i.replace(/[()]/g,"")).replace(/[\s-]/g,t.delimiter)}};var M=P,D={blocks:{uatp:[4,5,6],amex:[4,6,5],diners:[4,6,4],discover:[4,4,4,4],mastercard:[4,4,4,4],dankort:[4,4,4,4],instapayment:[4,4,4,4],jcb15:[4,6,5],jcb:[4,4,4,4],maestro:[4,4,4,4],visa:[4,4,4,4],mir:[4,4,4,4],unionPay:[4,4,4,4],general:[4,4,4,4]},re:{uatp:/^(?!1800)1\d{0,14}/,amex:/^3[47]\d{0,13}/,discover:/^(?:6011|65\d{0,2}|64[4-9]\d?)\d{0,12}/,diners:/^3(?:0([0-5]|9)|[689]\d?)\d{0,11}/,mastercard:/^(5[1-5]\d{0,2}|22[2-9]\d{0,1}|2[3-7]\d{0,2})\d{0,12}/,dankort:/^(5019|4175|4571)\d{0,12}/,instapayment:/^63[7-9]\d{0,13}/,jcb15:/^(?:2131|1800)\d{0,11}/,jcb:/^(?:35\d{0,2})\d{0,12}/,maestro:/^(?:5[0678]\d{0,2}|6304|67\d{0,2})\d{0,12}/,mir:/^220[0-4]\d{0,12}/,visa:/^4\d{0,15}/,unionPay:/^(62|81)\d{0,14}/},getStrictBlocks:function(e){var t=e.reduce(function(r,i){return r+i},0);return e.concat(19-t)},getInfo:function(e,t){var r=D.blocks,i=D.re;for(var n in t=!!t,i)if(i[n].test(e)){var a=r[n];return{type:n,blocks:t?this.getStrictBlocks(a):a}}return{type:"unknown",blocks:t?this.getStrictBlocks(r.general):r.general}}},E=D,T={noop:function(){},strip:function(e,t){return e.replace(t,"")},getPostDelimiter:function(e,t,r){if(r.length===0)return e.slice(-t.length)===t?t:"";var i="";return r.forEach(function(n){e.slice(-n.length)===n&&(i=n)}),i},getDelimiterREByDelimiter:function(e){return new RegExp(e.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),"g")},getNextCursorPosition:function(e,t,r,i,n){return t.length===e?r.length:e+this.getPositionOffset(e,t,r,i,n)},getPositionOffset:function(e,t,r,i,n){var a,o,s;return a=this.stripDelimiters(t.slice(0,e),i,n),o=this.stripDelimiters(r.slice(0,e),i,n),(s=a.length-o.length)!==0?s/Math.abs(s):0},stripDelimiters:function(e,t,r){var i=this;if(r.length===0){var n=t?i.getDelimiterREByDelimiter(t):"";return e.replace(n,"")}return r.forEach(function(a){a.split("").forEach(function(o){e=e.replace(i.getDelimiterREByDelimiter(o),"")})}),e},headStr:function(e,t){return e.slice(0,t)},getMaxLength:function(e){return e.reduce(function(t,r){return t+r},0)},getPrefixStrippedValue:function(e,t,r,i,n,a,o,s,d){if(r===0)return e;if(e===t&&e!=="")return"";if(d&&e.slice(0,1)=="-"){var p=i.slice(0,1)=="-"?i.slice(1):i;return"-"+this.getPrefixStrippedValue(e.slice(1),t,r,p,n,a,o,s,d)}if(i.slice(0,r)!==t&&!s||i.slice(-r)!==t&&s)return o&&!i&&e?e:"";var l=this.stripDelimiters(i,n,a);return e.slice(0,r)===t||s?e.slice(-r)!==t&&s?l.slice(0,-r-1):s?e.slice(0,-r):e.slice(r):l.slice(r)},getFirstDiffIndex:function(e,t){for(var r=0;e.charAt(r)===t.charAt(r);)if(e.charAt(r++)==="")return-1;return r},getFormattedValue:function(e,t,r,i,n,a){var o="",s=n.length>0,d="";return r===0?e:(t.forEach(function(p,l){if(e.length>0){var m=e.slice(0,p),u=e.slice(p);d=s?n[a?l-1:l]||d:i,a?(l>0&&(o+=d),o+=m):(o+=m,m.length===p&&l<r-1&&(o+=d)),e=u}}),o)},fixPrefixCursor:function(e,t,r,i){if(e){var n=e.value,a=r||i[0]||" ";if(e.setSelectionRange&&t&&!(t.length+a.length<=n.length)){var o=2*n.length;setTimeout(function(){e.setSelectionRange(o,o)},1)}}},checkFullSelection:function(e){try{return(window.getSelection()||document.getSelection()||{}).toString().length===e.length}catch{}return!1},setSelection:function(e,t,r){if(e===this.getActiveElement(r)&&!(e&&e.value.length<=t))if(e.createTextRange){var i=e.createTextRange();i.move("character",t),i.select()}else try{e.setSelectionRange(t,t)}catch{}},getActiveElement:function(e){var t=e.activeElement;return t&&t.shadowRoot?this.getActiveElement(t.shadowRoot):t},isAndroid:function(){return navigator&&/android/i.test(navigator.userAgent)},isAndroidBackspaceKeydown:function(e,t){return!!(this.isAndroid()&&e&&t)&&t===e.slice(0,-1)}},B={assign:function(e,t){return t=t||{},(e=e||{}).creditCard=!!t.creditCard,e.creditCardStrictMode=!!t.creditCardStrictMode,e.creditCardType="",e.onCreditCardTypeChanged=t.onCreditCardTypeChanged||function(){},e.phone=!!t.phone,e.phoneRegionCode=t.phoneRegionCode||"AU",e.phoneFormatter={},e.time=!!t.time,e.timePattern=t.timePattern||["h","m","s"],e.timeFormat=t.timeFormat||"24",e.timeFormatter={},e.date=!!t.date,e.datePattern=t.datePattern||["d","m","Y"],e.dateMin=t.dateMin||"",e.dateMax=t.dateMax||"",e.dateFormatter={},e.numeral=!!t.numeral,e.numeralIntegerScale=t.numeralIntegerScale>0?t.numeralIntegerScale:0,e.numeralDecimalScale=t.numeralDecimalScale>=0?t.numeralDecimalScale:2,e.numeralDecimalMark=t.numeralDecimalMark||".",e.numeralThousandsGroupStyle=t.numeralThousandsGroupStyle||"thousand",e.numeralPositiveOnly=!!t.numeralPositiveOnly,e.stripLeadingZeroes=t.stripLeadingZeroes!==!1,e.signBeforePrefix=!!t.signBeforePrefix,e.tailPrefix=!!t.tailPrefix,e.swapHiddenInput=!!t.swapHiddenInput,e.numericOnly=e.creditCard||e.date||!!t.numericOnly,e.uppercase=!!t.uppercase,e.lowercase=!!t.lowercase,e.prefix=e.creditCard||e.date?"":t.prefix||"",e.noImmediatePrefix=!!t.noImmediatePrefix,e.prefixLength=e.prefix.length,e.rawValueTrimPrefix=!!t.rawValueTrimPrefix,e.copyDelimiter=!!t.copyDelimiter,e.initValue=t.initValue!==void 0&&t.initValue!==null?t.initValue.toString():"",e.delimiter=t.delimiter||t.delimiter===""?t.delimiter:t.date?"/":t.time?":":t.numeral?",":(t.phone," "),e.delimiterLength=e.delimiter.length,e.delimiterLazyShow=!!t.delimiterLazyShow,e.delimiters=t.delimiters||[],e.blocks=t.blocks||[],e.blocksLength=e.blocks.length,e.root=typeof x=="object"&&x?x:window,e.document=t.document||e.root.document,e.maxLength=0,e.backspace=!1,e.result="",e.onValueChanged=t.onValueChanged||function(){},e}},c=function(e,t){var r=this;if(typeof e=="string"?(r.element=document.querySelector(e),document.querySelectorAll(e).length>1):e.length!==void 0&&e.length>0?(r.element=e[0],e.length>1):r.element=e,!r.element)throw new Error("[cleave.js] Please check the element");t.initValue=r.element.value,r.properties=c.DefaultProperties.assign({},t),r.init()};c.prototype={init:function(){var e=this,t=e.properties;t.numeral||t.phone||t.creditCard||t.time||t.date||t.blocksLength!==0||t.prefix?(t.maxLength=c.Util.getMaxLength(t.blocks),e.isAndroid=c.Util.isAndroid(),e.lastInputValue="",e.isBackward="",e.onChangeListener=e.onChange.bind(e),e.onKeyDownListener=e.onKeyDown.bind(e),e.onFocusListener=e.onFocus.bind(e),e.onCutListener=e.onCut.bind(e),e.onCopyListener=e.onCopy.bind(e),e.initSwapHiddenInput(),e.element.addEventListener("input",e.onChangeListener),e.element.addEventListener("keydown",e.onKeyDownListener),e.element.addEventListener("focus",e.onFocusListener),e.element.addEventListener("cut",e.onCutListener),e.element.addEventListener("copy",e.onCopyListener),e.initPhoneFormatter(),e.initDateFormatter(),e.initTimeFormatter(),e.initNumeralFormatter(),(t.initValue||t.prefix&&!t.noImmediatePrefix)&&e.onInput(t.initValue)):e.onInput(t.initValue)},initSwapHiddenInput:function(){var e=this;if(e.properties.swapHiddenInput){var t=e.element.cloneNode(!0);e.element.parentNode.insertBefore(t,e.element),e.elementSwapHidden=e.element,e.elementSwapHidden.type="hidden",e.element=t,e.element.id=""}},initNumeralFormatter:function(){var e=this.properties;e.numeral&&(e.numeralFormatter=new c.NumeralFormatter(e.numeralDecimalMark,e.numeralIntegerScale,e.numeralDecimalScale,e.numeralThousandsGroupStyle,e.numeralPositiveOnly,e.stripLeadingZeroes,e.prefix,e.signBeforePrefix,e.tailPrefix,e.delimiter))},initTimeFormatter:function(){var e=this.properties;e.time&&(e.timeFormatter=new c.TimeFormatter(e.timePattern,e.timeFormat),e.blocks=e.timeFormatter.getBlocks(),e.blocksLength=e.blocks.length,e.maxLength=c.Util.getMaxLength(e.blocks))},initDateFormatter:function(){var e=this.properties;e.date&&(e.dateFormatter=new c.DateFormatter(e.datePattern,e.dateMin,e.dateMax),e.blocks=e.dateFormatter.getBlocks(),e.blocksLength=e.blocks.length,e.maxLength=c.Util.getMaxLength(e.blocks))},initPhoneFormatter:function(){var e=this.properties;if(e.phone)try{e.phoneFormatter=new c.PhoneFormatter(new e.root.Cleave.AsYouTypeFormatter(e.phoneRegionCode),e.delimiter)}catch{throw new Error("[cleave.js] Please include phone-type-formatter.{country}.js lib")}},onKeyDown:function(e){var t=this,r=e.which||e.keyCode;t.lastInputValue=t.element.value,t.isBackward=r===8},onChange:function(e){var t=this,r=t.properties,i=c.Util;t.isBackward=t.isBackward||e.inputType==="deleteContentBackward";var n=i.getPostDelimiter(t.lastInputValue,r.delimiter,r.delimiters);t.isBackward&&n?r.postDelimiterBackspace=n:r.postDelimiterBackspace=!1,this.onInput(this.element.value)},onFocus:function(){var e=this,t=e.properties;e.lastInputValue=e.element.value,t.prefix&&t.noImmediatePrefix&&!e.element.value&&this.onInput(t.prefix),c.Util.fixPrefixCursor(e.element,t.prefix,t.delimiter,t.delimiters)},onCut:function(e){c.Util.checkFullSelection(this.element.value)&&(this.copyClipboardData(e),this.onInput(""))},onCopy:function(e){c.Util.checkFullSelection(this.element.value)&&this.copyClipboardData(e)},copyClipboardData:function(e){var t=this.properties,r=c.Util,i=this.element.value,n="";n=t.copyDelimiter?i:r.stripDelimiters(i,t.delimiter,t.delimiters);try{e.clipboardData?e.clipboardData.setData("Text",n):window.clipboardData.setData("Text",n),e.preventDefault()}catch{}},onInput:function(e){var t=this,r=t.properties,i=c.Util,n=i.getPostDelimiter(e,r.delimiter,r.delimiters);return r.numeral||!r.postDelimiterBackspace||n||(e=i.headStr(e,e.length-r.postDelimiterBackspace.length)),r.phone?(!r.prefix||r.noImmediatePrefix&&!e.length?r.result=r.phoneFormatter.format(e):r.result=r.prefix+r.phoneFormatter.format(e).slice(r.prefix.length),void t.updateValueState()):r.numeral?(r.prefix&&r.noImmediatePrefix&&e.length===0?r.result="":r.result=r.numeralFormatter.format(e),void t.updateValueState()):(r.date&&(e=r.dateFormatter.getValidatedDate(e)),r.time&&(e=r.timeFormatter.getValidatedTime(e)),e=i.stripDelimiters(e,r.delimiter,r.delimiters),e=i.getPrefixStrippedValue(e,r.prefix,r.prefixLength,r.result,r.delimiter,r.delimiters,r.noImmediatePrefix,r.tailPrefix,r.signBeforePrefix),e=r.numericOnly?i.strip(e,/[^\d]/g):e,e=r.uppercase?e.toUpperCase():e,e=r.lowercase?e.toLowerCase():e,r.prefix&&(r.tailPrefix?e+=r.prefix:e=r.prefix+e,r.blocksLength===0)?(r.result=e,void t.updateValueState()):(r.creditCard&&t.updateCreditCardPropsByValue(e),e=i.headStr(e,r.maxLength),r.result=i.getFormattedValue(e,r.blocks,r.blocksLength,r.delimiter,r.delimiters,r.delimiterLazyShow),void t.updateValueState()))},updateCreditCardPropsByValue:function(e){var t,r=this.properties,i=c.Util;i.headStr(r.result,4)!==i.headStr(e,4)&&(t=c.CreditCardDetector.getInfo(e,r.creditCardStrictMode),r.blocks=t.blocks,r.blocksLength=r.blocks.length,r.maxLength=i.getMaxLength(r.blocks),r.creditCardType!==t.type&&(r.creditCardType=t.type,r.onCreditCardTypeChanged.call(this,r.creditCardType)))},updateValueState:function(){var e=this,t=c.Util,r=e.properties;if(e.element){var i=e.element.selectionEnd,n=e.element.value,a=r.result;i=t.getNextCursorPosition(i,n,a,r.delimiter,r.delimiters),e.isAndroid?window.setTimeout(function(){e.element.value=a,t.setSelection(e.element,i,r.document,!1),e.callOnValueChanged()},1):(e.element.value=a,r.swapHiddenInput&&(e.elementSwapHidden.value=e.getRawValue()),t.setSelection(e.element,i,r.document,!1),e.callOnValueChanged())}},callOnValueChanged:function(){var e=this,t=e.properties;t.onValueChanged.call(e,{target:{name:e.element.name,value:t.result,rawValue:e.getRawValue()}})},setPhoneRegionCode:function(e){var t=this;t.properties.phoneRegionCode=e,t.initPhoneFormatter(),t.onChange()},setRawValue:function(e){var t=this,r=t.properties;e=e!=null?e.toString():"",r.numeral&&(e=e.replace(".",r.numeralDecimalMark)),r.postDelimiterBackspace=!1,t.element.value=e,t.onInput(e)},getRawValue:function(){var e=this.properties,t=c.Util,r=this.element.value;return e.rawValueTrimPrefix&&(r=t.getPrefixStrippedValue(r,e.prefix,e.prefixLength,e.result,e.delimiter,e.delimiters,e.noImmediatePrefix,e.tailPrefix,e.signBeforePrefix)),r=e.numeral?e.numeralFormatter.getRawValue(r):t.stripDelimiters(r,e.delimiter,e.delimiters)},getISOFormatDate:function(){var e=this.properties;return e.date?e.dateFormatter.getISOFormatDate():""},getISOFormatTime:function(){var e=this.properties;return e.time?e.timeFormatter.getISOFormatTime():""},getFormattedValue:function(){return this.element.value},destroy:function(){var e=this;e.element.removeEventListener("input",e.onChangeListener),e.element.removeEventListener("keydown",e.onKeyDownListener),e.element.removeEventListener("focus",e.onFocusListener),e.element.removeEventListener("cut",e.onCutListener),e.element.removeEventListener("copy",e.onCopyListener)},toString:function(){return"[Cleave Object]"}},c.NumeralFormatter=I,c.DateFormatter=L,c.TimeFormatter=V,c.PhoneFormatter=M,c.CreditCardDetector=E,c.Util=T,c.DefaultProperties=B,(typeof x=="object"&&x?x:window).Cleave=c;var S=c,N=Object.defineProperty,R=Object.getOwnPropertyDescriptor,v=(e,t,r,i)=>{for(var n,a=i>1?void 0:i?R(t,r):t,o=e.length-1;o>=0;o--)(n=e[o])&&(a=(i?n(t,r,a):n(a))||a);return i&&a&&N(t,r,a),a};exports.SchmancyPaymentCardForm=class extends w.$LitElement(){constructor(){super(...arguments),this.value={cardName:"",cardNumber:"",expirationDate:"",cvv:""}}firstUpdated(){new S(this.cardNumberInput,{creditCard:!0,creditCardStrictMode:!0,onCreditCardTypeChanged:e=>{e==="unknown"?this.cardNumberInput.setCustomValidity("Please enter a valid card number."):this.cardNumberInput.setCustomValidity("")}}),new S(this.expirationDateInput,{date:!0,datePattern:["m","y"],onValueChanged:e=>{!e.target.value||e.target.value.length<5?this.expirationDateInput.setCustomValidity("Please enter a valid expiration date."):this.expirationDateInput.setCustomValidity("")}}),new S(this.cvvInput,{blocks:[4],numericOnly:!0,onValueChanged:e=>{e.target.value.length<3?this.cvvInput.setCustomValidity("Please enter a valid CVV."):this.cvvInput.setCustomValidity("")}}),new S(this.cardNameInput,{uppercase:!0,delimiter:" "})}reportValidity(){return this.form.reportValidity()}checkValidity(){return!!this.form.reportValidity()}emitChange(){this.dispatchEvent(new CustomEvent("change",{detail:{...this.value}}))}render(){return b.html` <schmancy-form
|
|
2
2
|
@change=${e=>{e.stopPropagation(),e.preventDefault()}}
|
|
3
3
|
>
|
|
4
4
|
<schmancy-grid gap="sm">
|
|
@@ -45,4 +45,4 @@
|
|
|
45
45
|
</schmancy-grid>
|
|
46
46
|
</schmancy-grid>
|
|
47
47
|
</schmancy-form>`}},v([f.property({type:Object,reflect:!0})],exports.SchmancyPaymentCardForm.prototype,"value",2),v([f.state()],exports.SchmancyPaymentCardForm.prototype,"cardName",2),v([f.state()],exports.SchmancyPaymentCardForm.prototype,"cardNumber",2),v([f.state()],exports.SchmancyPaymentCardForm.prototype,"expirationDate",2),v([f.state()],exports.SchmancyPaymentCardForm.prototype,"cvv",2),v([f.query("#cardNumber")],exports.SchmancyPaymentCardForm.prototype,"cardNumberInput",2),v([f.query("#expirationDate")],exports.SchmancyPaymentCardForm.prototype,"expirationDateInput",2),v([f.query("#cvv")],exports.SchmancyPaymentCardForm.prototype,"cvvInput",2),v([f.query("#cardName")],exports.SchmancyPaymentCardForm.prototype,"cardNameInput",2),v([f.query("schmancy-form")],exports.SchmancyPaymentCardForm.prototype,"form",2),exports.SchmancyPaymentCardForm=v([f.customElement("schmancy-payment-card-form")],exports.SchmancyPaymentCardForm);
|
|
48
|
-
//# sourceMappingURL=payment-card-form-
|
|
48
|
+
//# sourceMappingURL=payment-card-form-BWafJ1-J.cjs.map
|