@mhmo91/schmancy 0.4.10 → 0.4.12
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-Dh_Ony1b.cjs → animated-text-BD04H8eV.cjs} +2 -2
- package/dist/{animated-text-Dh_Ony1b.cjs.map → animated-text-BD04H8eV.cjs.map} +1 -1
- package/dist/{animated-text-Be02uXuq.js → animated-text-TALC3vSJ.js} +6 -6
- package/dist/{animated-text-Be02uXuq.js.map → animated-text-TALC3vSJ.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-CVYJtXrI.js → area.component-DXcT-c4L.js} +6 -6
- package/dist/{area.component-CVYJtXrI.js.map → area.component-DXcT-c4L.js.map} +1 -1
- package/dist/{area.component-DTc1TOLd.cjs → area.component-GvVVYEaK.cjs} +2 -2
- package/dist/{area.component-DTc1TOLd.cjs.map → area.component-GvVVYEaK.cjs.map} +1 -1
- package/dist/area.js +1 -1
- package/dist/{autocomplete-CzTNaIqf.cjs → autocomplete-B-UCdew3.cjs} +2 -2
- package/dist/{autocomplete-CzTNaIqf.cjs.map → autocomplete-B-UCdew3.cjs.map} +1 -1
- package/dist/{autocomplete-D1bwPNoy.js → autocomplete-gfBf6Pph.js} +2 -2
- package/dist/{autocomplete-D1bwPNoy.js.map → autocomplete-gfBf6Pph.js.map} +1 -1
- package/dist/autocomplete.cjs +1 -1
- package/dist/autocomplete.js +1 -1
- package/dist/{avatar-D35JpOv5.js → avatar-Cjrrnfhg.js} +33 -33
- package/dist/{avatar-D35JpOv5.js.map → avatar-Cjrrnfhg.js.map} +1 -1
- package/dist/{avatar-CFu-31B1.cjs → avatar-UkdZfXJj.cjs} +2 -2
- package/dist/{avatar-CFu-31B1.cjs.map → avatar-UkdZfXJj.cjs.map} +1 -1
- package/dist/badge.cjs +1 -1
- package/dist/badge.js +1 -1
- package/dist/busy.cjs +1 -1
- package/dist/busy.js +1 -1
- package/dist/button.cjs +1 -1
- package/dist/button.js +1 -1
- package/dist/card.cjs +1 -1
- package/dist/card.js +1 -1
- package/dist/{checkbox-ZW_jmRBP.js → checkbox-DsmG1Evz.js} +5 -5
- package/dist/{checkbox-ZW_jmRBP.js.map → checkbox-DsmG1Evz.js.map} +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/{chips-DFam160B.js → chips-CtQ6KScS.js} +12 -12
- package/dist/{chips-DFam160B.js.map → chips-CtQ6KScS.js.map} +1 -1
- package/dist/{chips-DwvB_B3m.cjs → chips-TCtGSVDM.cjs} +2 -2
- package/dist/{chips-DwvB_B3m.cjs.map → chips-TCtGSVDM.cjs.map} +1 -1
- package/dist/chips.cjs +1 -1
- package/dist/chips.js +1 -1
- package/dist/{circular-progress-BARPJm-e.js → circular-progress-CUp7rBzy.js} +7 -7
- package/dist/{circular-progress-BARPJm-e.js.map → circular-progress-CUp7rBzy.js.map} +1 -1
- package/dist/{circular-progress-BDZFB3WR.cjs → circular-progress-Cud0rg3a.cjs} +2 -2
- package/dist/{circular-progress-BDZFB3WR.cjs.map → circular-progress-Cud0rg3a.cjs.map} +1 -1
- package/dist/circular-progress.cjs +1 -1
- package/dist/circular-progress.js +1 -1
- package/dist/code-highlight.cjs +1 -1
- package/dist/code-highlight.js +1 -1
- package/dist/{code-preview-CFnSKSqn.cjs → code-preview-DM8oGBFy.cjs} +2 -2
- package/dist/{code-preview-CFnSKSqn.cjs.map → code-preview-DM8oGBFy.cjs.map} +1 -1
- package/dist/{code-preview-BxswKcO8.js → code-preview-N0FaD6oD.js} +7 -7
- package/dist/{code-preview-BxswKcO8.js.map → code-preview-N0FaD6oD.js.map} +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-Cq8Wdd8b.cjs → date-range-DBdwrYhp.cjs} +2 -2
- package/dist/{date-range-Cq8Wdd8b.cjs.map → date-range-DBdwrYhp.cjs.map} +1 -1
- package/dist/{date-range-Fij9AQth.js → date-range-DnYewL7B.js} +7 -7
- package/dist/{date-range-Fij9AQth.js.map → date-range-DnYewL7B.js.map} +1 -1
- package/dist/date-range.cjs +1 -1
- package/dist/date-range.js +1 -1
- package/dist/{delay-aA1TyZTr.js → delay-C0F-H48q.js} +11 -11
- package/dist/{delay-aA1TyZTr.js.map → delay-C0F-H48q.js.map} +1 -1
- package/dist/delay.js +1 -1
- package/dist/{dialog-content-DpotaqHz.js → dialog-content-COidAlIa.js} +9 -9
- package/dist/{dialog-content-DpotaqHz.js.map → dialog-content-COidAlIa.js.map} +1 -1
- package/dist/{dialog-content-NyJfG7nL.cjs → dialog-content-CyPNCPyp.cjs} +2 -2
- package/dist/{dialog-content-NyJfG7nL.cjs.map → dialog-content-CyPNCPyp.cjs.map} +1 -1
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.js +1 -1
- package/dist/{divider-CEMmRD_e.js → divider-CHtq7YkK.js} +6 -6
- package/dist/{divider-CEMmRD_e.js.map → divider-CHtq7YkK.js.map} +1 -1
- package/dist/{divider-CMM91UNF.cjs → divider-Cy75eDOI.cjs} +2 -2
- package/dist/{divider-CMM91UNF.cjs.map → divider-Cy75eDOI.cjs.map} +1 -1
- package/dist/divider.cjs +1 -1
- package/dist/divider.js +1 -1
- package/dist/{dropdown-content-CUn_E7cR.cjs → dropdown-content-AKsZIRkY.cjs} +2 -2
- package/dist/{dropdown-content-CUn_E7cR.cjs.map → dropdown-content-AKsZIRkY.cjs.map} +1 -1
- package/dist/{dropdown-content-Cw5wN3oE.js → dropdown-content-DgscCd-v.js} +9 -9
- package/dist/{dropdown-content-Cw5wN3oE.js.map → dropdown-content-DgscCd-v.js.map} +1 -1
- package/dist/dropdown.cjs +1 -1
- package/dist/dropdown.js +1 -1
- package/dist/extra.cjs +1 -1
- package/dist/extra.js +1 -1
- package/dist/{form-DNXmZlmc.js → form-BFc52uuY.js} +9 -9
- package/dist/{form-DNXmZlmc.js.map → form-BFc52uuY.js.map} +1 -1
- package/dist/{form-BdGYvvVv.cjs → form-DfUjGCp4.cjs} +2 -2
- package/dist/{form-BdGYvvVv.cjs.map → form-DfUjGCp4.cjs.map} +1 -1
- package/dist/form.cjs +1 -1
- package/dist/form.js +1 -1
- package/dist/formField.mixin-CuGsxsHl.js +48 -0
- package/dist/formField.mixin-CuGsxsHl.js.map +1 -0
- package/dist/formField.mixin-Cxw6KKHR.cjs +2 -0
- package/dist/formField.mixin-Cxw6KKHR.cjs.map +1 -0
- package/dist/{icon-CiYXCpzk.cjs → icon-Csw2jGjz.cjs} +2 -2
- package/dist/{icon-CiYXCpzk.cjs.map → icon-Csw2jGjz.cjs.map} +1 -1
- package/dist/{icon-BzxYzucF.js → icon-PHYf6Ww3.js} +6 -6
- package/dist/{icon-BzxYzucF.js.map → icon-PHYf6Ww3.js.map} +1 -1
- package/dist/{icon-button-CVF8ZGrd.cjs → icon-button-B4ItyJ98.cjs} +2 -2
- package/dist/{icon-button-CVF8ZGrd.cjs.map → icon-button-B4ItyJ98.cjs.map} +1 -1
- package/dist/{icon-button-VqejfzxG.js → icon-button-D889ly9B.js} +7 -7
- package/dist/{icon-button-VqejfzxG.js.map → icon-button-D889ly9B.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 +33 -33
- package/dist/{input-d4jaMv22.js → input-CMRD9x7X.js} +75 -82
- package/dist/input-CMRD9x7X.js.map +1 -0
- package/dist/input-kbXFeZdd.cjs +122 -0
- package/dist/input-kbXFeZdd.cjs.map +1 -0
- package/dist/input.cjs +1 -1
- package/dist/input.js +1 -1
- package/dist/{list-L1m51qC0.js → list-B-vruXz6.js} +6 -6
- package/dist/{list-L1m51qC0.js.map → list-B-vruXz6.js.map} +1 -1
- package/dist/{list-DN2eHabm.cjs → list-CSu6cyoR.cjs} +2 -2
- package/dist/{list-DN2eHabm.cjs.map → list-CSu6cyoR.cjs.map} +1 -1
- package/dist/list.cjs +1 -1
- package/dist/list.js +1 -1
- package/dist/{media-C0AR69S2.js → media-B_Me35Lz.js} +11 -11
- package/dist/{media-C0AR69S2.js.map → media-B_Me35Lz.js.map} +1 -1
- package/dist/{media-yXym3iTa.cjs → media-BfzuayBO.cjs} +2 -2
- package/dist/{media-yXym3iTa.cjs.map → media-BfzuayBO.cjs.map} +1 -1
- package/dist/{menu-CKDW29ZR.cjs → menu-BDv4zBeO.cjs} +2 -2
- package/dist/{menu-CKDW29ZR.cjs.map → menu-BDv4zBeO.cjs.map} +1 -1
- package/dist/{menu-Bhh6qxR6.js → menu-CXq_e2XW.js} +9 -9
- package/dist/{menu-Bhh6qxR6.js.map → menu-CXq_e2XW.js.map} +1 -1
- package/dist/menu.cjs +1 -1
- package/dist/menu.js +1 -1
- package/dist/mixins/index.ts +1 -0
- package/dist/nav-drawer.cjs +1 -1
- package/dist/nav-drawer.js +1 -1
- package/dist/{notification-service-CG4XTrXU.js → notification-service-CD96gC_Q.js} +2 -2
- package/dist/{notification-service-CG4XTrXU.js.map → notification-service-CD96gC_Q.js.map} +1 -1
- package/dist/{notification-service-CRbqdLm_.cjs → notification-service-CzJSG4Sn.cjs} +2 -2
- package/dist/{notification-service-CRbqdLm_.cjs.map → notification-service-CzJSG4Sn.cjs.map} +1 -1
- package/dist/notification.cjs +1 -1
- package/dist/notification.js +1 -1
- package/dist/{option-Cj25fsD1.js → option-CVtfqsYE.js} +5 -5
- package/dist/{option-Cj25fsD1.js.map → option-CVtfqsYE.js.map} +1 -1
- package/dist/{option-DFNHF3bL.cjs → option-h_WFbBOi.cjs} +2 -2
- package/dist/{option-DFNHF3bL.cjs.map → option-h_WFbBOi.cjs.map} +1 -1
- package/dist/option.cjs +1 -1
- package/dist/option.js +1 -1
- package/dist/{payment-card-form-CEANJmNw.cjs → payment-card-form-BskQ6TgU.cjs} +2 -2
- package/dist/{payment-card-form-CEANJmNw.cjs.map → payment-card-form-BskQ6TgU.cjs.map} +1 -1
- package/dist/{payment-card-form-YzyxteTK.js → payment-card-form-tNrkE6OQ.js} +9 -9
- package/dist/{payment-card-form-YzyxteTK.js.map → payment-card-form-tNrkE6OQ.js.map} +1 -1
- package/dist/radio-button-DF08cuJS.js +114 -0
- package/dist/radio-button-DF08cuJS.js.map +1 -0
- package/dist/radio-button-DnCXtbRy.cjs +41 -0
- package/dist/radio-button-DnCXtbRy.cjs.map +1 -0
- package/dist/radio-group.cjs +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/{select-IgXxVwZQ.js → select-BLigK7WJ.js} +8 -8
- package/dist/{select-IgXxVwZQ.js.map → select-BLigK7WJ.js.map} +1 -1
- package/dist/{select-Cr15D48_.cjs → select-BtsHlkD9.cjs} +2 -2
- package/dist/{select-Cr15D48_.cjs.map → select-BtsHlkD9.cjs.map} +1 -1
- package/dist/select.cjs +1 -1
- package/dist/select.js +1 -1
- package/dist/{sheet-9m-LkKNU.js → sheet-Bq4x2qJR.js} +5 -5
- package/dist/{sheet-9m-LkKNU.js.map → sheet-Bq4x2qJR.js.map} +1 -1
- package/dist/{sheet-u1RXiD4G.cjs → sheet-H3p6cwja.cjs} +2 -2
- package/dist/{sheet-u1RXiD4G.cjs.map → sheet-H3p6cwja.cjs.map} +1 -1
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.js +1 -1
- package/dist/{slider-BvOKAD4l.js → slider-B8oe73hM.js} +7 -7
- package/dist/{slider-BvOKAD4l.js.map → slider-B8oe73hM.js.map} +1 -1
- package/dist/{slider-BFJ0OVq5.cjs → slider-Cfo8tVKG.cjs} +2 -2
- package/dist/{slider-BFJ0OVq5.cjs.map → slider-Cfo8tVKG.cjs.map} +1 -1
- package/dist/slider.cjs +1 -1
- package/dist/slider.js +1 -1
- package/dist/{spinner-CRWcQJjQ.cjs → spinner-DnRMrl9v.cjs} +2 -2
- package/dist/{spinner-CRWcQJjQ.cjs.map → spinner-DnRMrl9v.cjs.map} +1 -1
- package/dist/{spinner-jaFB6wer.js → spinner-U7S7P4no.js} +9 -9
- package/dist/{spinner-jaFB6wer.js.map → spinner-U7S7P4no.js.map} +1 -1
- package/dist/{tabs-compatibility-DFaq5_66.cjs → tabs-compatibility-9Rd3aAz8.cjs} +2 -2
- package/dist/{tabs-compatibility-DFaq5_66.cjs.map → tabs-compatibility-9Rd3aAz8.cjs.map} +1 -1
- package/dist/{tabs-compatibility-CHTrE420.js → tabs-compatibility-Bhqb9_1G.js} +7 -7
- package/dist/{tabs-compatibility-CHTrE420.js.map → tabs-compatibility-Bhqb9_1G.js.map} +1 -1
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.js +1 -1
- package/dist/teleport.cjs +1 -1
- package/dist/teleport.js +1 -1
- package/dist/{theme-button-C97XGkCl.js → theme-button-gIEpz0yO.js} +5 -5
- package/dist/{theme-button-C97XGkCl.js.map → theme-button-gIEpz0yO.js.map} +1 -1
- package/dist/{theme-button-25FKBtFN.cjs → theme-button-oLGQfECu.cjs} +2 -2
- package/dist/{theme-button-25FKBtFN.cjs.map → theme-button-oLGQfECu.cjs.map} +1 -1
- package/dist/theme-button.cjs +1 -1
- package/dist/theme-button.js +1 -1
- package/dist/{timezone-BurrHk00.js → timezone-Bo5mdJkY.js} +7 -7
- package/dist/{timezone-BurrHk00.js.map → timezone-Bo5mdJkY.js.map} +1 -1
- package/dist/{timezone-BWn9DNZY.cjs → timezone-DjBVPwPe.cjs} +2 -2
- package/dist/{timezone-BWn9DNZY.cjs.map → timezone-DjBVPwPe.cjs.map} +1 -1
- package/dist/{tree-z1EoelBs.cjs → tree-BjNNPfOq.cjs} +2 -2
- package/dist/{tree-z1EoelBs.cjs.map → tree-BjNNPfOq.cjs.map} +1 -1
- package/dist/{tree-DzHOYcn8.js → tree-DYiGGb5x.js} +6 -6
- package/dist/{tree-DzHOYcn8.js.map → tree-DYiGGb5x.js.map} +1 -1
- package/dist/tree.cjs +1 -1
- package/dist/tree.js +1 -1
- package/dist/{typewriter-D_bqiukY.cjs → typewriter-CQWBe0l-.cjs} +2 -2
- package/dist/{typewriter-D_bqiukY.cjs.map → typewriter-CQWBe0l-.cjs.map} +1 -1
- package/dist/{typewriter-BiBJSC2J.js → typewriter-DNyZpGkL.js} +10 -10
- package/dist/{typewriter-BiBJSC2J.js.map → typewriter-DNyZpGkL.js.map} +1 -1
- package/dist/typewriter.cjs +1 -1
- package/dist/typewriter.js +1 -1
- package/package.json +1 -1
- package/dist/input-DfBGrUet.cjs +0 -122
- package/dist/input-DfBGrUet.cjs.map +0 -1
- package/dist/input-d4jaMv22.js.map +0 -1
- package/dist/radio-button-BVeem3E9.cjs +0 -41
- package/dist/radio-button-BVeem3E9.cjs.map +0 -1
- package/dist/radio-button-CBcYZCqv.js +0 -151
- package/dist/radio-button-CBcYZCqv.js.map +0 -1
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import { nothing as E, html as b, LitElement as w } from "lit";
|
|
2
|
-
import { property as i, query as k, state as f, customElement as
|
|
2
|
+
import { property as i, query as k, state as f, customElement as R } from "lit/decorators.js";
|
|
3
3
|
import { ifDefined as h } from "lit/directives/if-defined.js";
|
|
4
|
-
import { createRef as S, ref as
|
|
4
|
+
import { createRef as S, ref as V } from "lit/directives/ref.js";
|
|
5
5
|
import { when as x } from "lit/directives/when.js";
|
|
6
|
-
import { fromEvent as p, map as $, takeUntil as
|
|
6
|
+
import { fromEvent as p, map as $, takeUntil as c, distinctUntilChanged as C, filter as v } from "rxjs";
|
|
7
7
|
import "lit/directives/class-map.js";
|
|
8
8
|
import "lit/directives/style-map.js";
|
|
9
|
-
import { T as
|
|
9
|
+
import { T as O } from "./tailwind.mixin-Dx35wOig.js";
|
|
10
10
|
import { c as g } from "./ripple-BumgqsDT.js";
|
|
11
|
-
import { S as
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
import { S as d } from "./theme.interface-C5Kj6WjD.js";
|
|
12
|
+
import { S as I } from "./formField.mixin-CuGsxsHl.js";
|
|
13
|
+
const z = ":host{border:unset!important;line-height:unset!important;background:unset!important;padding:unset!important;font-size:unset!important;box-shadow:unset!important;width:-webkit-fill-available}:host:focus{box-shadow:unset!important}input:focus-visible{outline:none!important}input{font-family:inherit;font-size:inherit;font-weight:inherit;line-height:inherit;color:inherit;letter-spacing:inherit;text-transform:inherit;text-decoration:inherit;text-indent:inherit;text-shadow:inherit;text-overflow:inherit;text-rendering:inherit;text-size-adjust:inherit;text-align-last:inherit}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}@keyframes onAutoFillStart{}input:-webkit-autofill{animation-name:onAutoFillStart}input:-webkit-autofill,input:-webkit-autofill:hover,input:-webkit-autofill:focus,input:-webkit-autofill:active{-webkit-box-shadow:0 0 0 30px var(--schmancy-sys-color-surface-highest) inset!important;-webkit-text-fill-color:var(--schmancy-sys-color-surface-on)!important;transition:background-color 5000s ease-in-out 0s}@-moz-document url-prefix(){input:-moz-autofill,input:-moz-autofill:focus{background-color:var(--schmancy-sys-color-surface-highest)!important;color:var(--schmancy-sys-color-surface-on)!important}}input:autofill,input:autofill:hover,input:autofill:focus,input:autofill:active{background-color:var(--schmancy-sys-color-surface-highest)!important;color:var(--schmancy-sys-color-surface-on)!important}";
|
|
14
|
+
var T = Object.defineProperty, A = Object.getOwnPropertyDescriptor, r = (t, e, a, l) => {
|
|
15
|
+
for (var m, u = l > 1 ? void 0 : l ? A(e, a) : e, y = t.length - 1; y >= 0; y--) (m = t[y]) && (u = (l ? m(e, a, u) : m(u)) || u);
|
|
16
|
+
return l && u && T(e, a, u), u;
|
|
16
17
|
};
|
|
17
|
-
let s = class extends z
|
|
18
|
+
let s = class extends O(z) {
|
|
18
19
|
constructor() {
|
|
19
20
|
if (super(), this.id = "", this.label = "", this.type = "text", this.name = `name_${Date.now()}`, this.placeholder = "", this.value = "", this.required = !1, this.disabled = !1, this.readonly = !1, this.clickable = !1, this.spellcheck = !1, this.align = "left", this.autofocus = !1, this.autocomplete = "on", this.tabIndex = 0, this.error = !1, this.size = "md", this.validateOn = "touched", this.validationMessage = "", this.inputRef = S(), this.isAutofilled = !1, this.touched = !1, this.dirty = !1, this.submitted = !1, this.defaultValue = "", "attachInternals" in this) try {
|
|
20
21
|
this.internals = this.attachInternals();
|
|
@@ -84,8 +85,8 @@ let s = class extends z(O) {
|
|
|
84
85
|
}
|
|
85
86
|
validateInput(t = !1) {
|
|
86
87
|
if (this.disabled) return;
|
|
87
|
-
const e = this.shouldShowValidation(t),
|
|
88
|
-
e && l ? (this.error = !0, this.validationMessage = this.inputElement?.validationMessage || "") :
|
|
88
|
+
const e = this.shouldShowValidation(t), a = this.inputElement?.validity ?? { customError: !1, valid: !0 }, l = !a.valid && !a.customError;
|
|
89
|
+
e && l ? (this.error = !0, this.validationMessage = this.inputElement?.validationMessage || "") : a.valid ? (this.error = !1, a.customError || (this.validationMessage = "")) : e || (this.error = !1), this.updateValidityState();
|
|
89
90
|
}
|
|
90
91
|
checkValidity() {
|
|
91
92
|
const t = this.inputRef.value?.checkValidity() ?? !0;
|
|
@@ -108,38 +109,38 @@ let s = class extends z(O) {
|
|
|
108
109
|
p(this.inputElement, "input").pipe($((t) => {
|
|
109
110
|
const e = t;
|
|
110
111
|
return { value: t.target.value, inputType: e.inputType, data: e.data, isComposing: e.isComposing, originalEvent: t };
|
|
111
|
-
}),
|
|
112
|
+
}), c(this.disconnecting)).subscribe((t) => {
|
|
112
113
|
this.value = t.value, this.dirty = this.value !== this.defaultValue;
|
|
113
114
|
const e = new CustomEvent("input", { detail: { value: t.value }, bubbles: !0, composed: !0 });
|
|
114
115
|
Object.defineProperties(e, { inputType: { value: t.inputType }, data: { value: t.data }, isComposing: { value: t.isComposing } }), this.dispatchEvent(e), this.validateInput();
|
|
115
|
-
}), p(this.inputElement, "change").pipe($((t) => t.target.value), C(),
|
|
116
|
+
}), p(this.inputElement, "change").pipe($((t) => t.target.value), C(), c(this.disconnecting)).subscribe((t) => {
|
|
116
117
|
this.value = t, this.dirty = this.value !== this.defaultValue, this.dispatchEvent(new CustomEvent("change", { detail: { value: t }, bubbles: !0, composed: !0 })), this.validateInput();
|
|
117
118
|
});
|
|
118
119
|
}
|
|
119
120
|
setupFocusBlurEvents() {
|
|
120
|
-
p(this.inputElement, "focus").pipe(
|
|
121
|
+
p(this.inputElement, "focus").pipe(c(this.disconnecting)).subscribe((t) => {
|
|
121
122
|
const e = new CustomEvent("focus", { bubbles: t.bubbles, cancelable: t.cancelable, composed: t.composed });
|
|
122
123
|
Object.defineProperties(e, { relatedTarget: { value: t.relatedTarget } }), this.dispatchEvent(e);
|
|
123
|
-
}), p(this.inputElement, "blur").pipe(
|
|
124
|
+
}), p(this.inputElement, "blur").pipe(c(this.disconnecting)).subscribe((t) => {
|
|
124
125
|
this.touched = !0, this.disabled || this.validateInput();
|
|
125
126
|
const e = new CustomEvent("blur", { bubbles: t.bubbles, cancelable: t.cancelable, composed: t.composed });
|
|
126
127
|
Object.defineProperties(e, { relatedTarget: { value: t.relatedTarget } }), this.dispatchEvent(e);
|
|
127
128
|
});
|
|
128
129
|
}
|
|
129
130
|
setupAutofillDetection() {
|
|
130
|
-
p(this.inputElement, "animationstart").pipe(v((t) => t.animationName === "onAutoFillStart"),
|
|
131
|
+
p(this.inputElement, "animationstart").pipe(v((t) => t.animationName === "onAutoFillStart"), c(this.disconnecting)).subscribe((t) => {
|
|
131
132
|
const { value: e } = t.target;
|
|
132
133
|
this.value = e, this.isAutofilled = !0, this.dirty = this.value !== this.defaultValue, this.dispatchEvent(new CustomEvent("autofill", { detail: { value: e }, bubbles: !0, composed: !0 })), this.dispatchEvent(new CustomEvent("change", { detail: { value: e }, bubbles: !0, composed: !0 }));
|
|
133
|
-
}), p(this.inputElement, "animationstart").pipe(v((t) => t.animationName === "onAutoFillCancel"),
|
|
134
|
+
}), p(this.inputElement, "animationstart").pipe(v((t) => t.animationName === "onAutoFillCancel"), c(this.disconnecting)).subscribe(() => {
|
|
134
135
|
this.isAutofilled = !1;
|
|
135
136
|
});
|
|
136
137
|
}
|
|
137
138
|
setupEnterKeyEvents() {
|
|
138
|
-
p(this.inputElement, "keyup").pipe(v((t) => t.key === "Enter"),
|
|
139
|
+
p(this.inputElement, "keyup").pipe(v((t) => t.key === "Enter"), c(this.disconnecting)).subscribe((t) => {
|
|
139
140
|
const { value: e } = t.target;
|
|
140
141
|
this.value = e, this.dirty = this.value !== this.defaultValue;
|
|
141
|
-
const
|
|
142
|
-
Object.defineProperties(
|
|
142
|
+
const a = new CustomEvent("enter", { detail: { value: e }, bubbles: !0, composed: !0 });
|
|
143
|
+
Object.defineProperties(a, { key: { value: "Enter" }, code: { value: "Enter" }, keyCode: { value: 13 }, which: { value: 13 } }), this.dispatchEvent(a);
|
|
143
144
|
});
|
|
144
145
|
}
|
|
145
146
|
select() {
|
|
@@ -148,8 +149,8 @@ let s = class extends z(O) {
|
|
|
148
149
|
getValidity() {
|
|
149
150
|
return this.inputRef.value?.validity;
|
|
150
151
|
}
|
|
151
|
-
setSelectionRange(t, e,
|
|
152
|
-
this.inputRef.value?.setSelectionRange(t, e,
|
|
152
|
+
setSelectionRange(t, e, a) {
|
|
153
|
+
this.inputRef.value?.setSelectionRange(t, e, a);
|
|
153
154
|
}
|
|
154
155
|
get selectionStart() {
|
|
155
156
|
return this.inputRef.value?.selectionStart ?? null;
|
|
@@ -160,8 +161,8 @@ let s = class extends z(O) {
|
|
|
160
161
|
get selectionDirection() {
|
|
161
162
|
return this.inputRef.value?.selectionDirection ?? null;
|
|
162
163
|
}
|
|
163
|
-
setRangeText(t, e,
|
|
164
|
-
e !== void 0 &&
|
|
164
|
+
setRangeText(t, e, a, l) {
|
|
165
|
+
e !== void 0 && a !== void 0 ? this.inputRef.value?.setRangeText(t, e, a, l) : this.inputRef.value?.setRangeText(t);
|
|
165
166
|
}
|
|
166
167
|
focus(t) {
|
|
167
168
|
this.inputRef.value?.focus(t), this.dispatchEvent(new Event("focus"));
|
|
@@ -173,7 +174,7 @@ let s = class extends z(O) {
|
|
|
173
174
|
this.inputRef.value?.blur(), this.dispatchEvent(new Event("blur"));
|
|
174
175
|
}
|
|
175
176
|
render() {
|
|
176
|
-
const { height: t, padding: e, fontSize:
|
|
177
|
+
const { height: t, padding: e, fontSize: a } = (() => {
|
|
177
178
|
switch (this.size) {
|
|
178
179
|
case "sm":
|
|
179
180
|
return { height: "40px", padding: "0 8px", fontSize: "0.875rem" };
|
|
@@ -182,14 +183,14 @@ let s = class extends z(O) {
|
|
|
182
183
|
default:
|
|
183
184
|
return { height: "50px", padding: "0 16px", fontSize: "1rem" };
|
|
184
185
|
}
|
|
185
|
-
})(), l = { "w-full flex-1 rounded-[8px] border-0 bg-surface-highest text-surface-on": !0, "outline-secondary-default focus:outline-1 ": !0, "outline-secondary-default focus:outline-1": !0, "disabled:opacity-40 disabled:cursor-not-allowed": !0, "placeholder:text-muted": !0, "ring-0 ring-inset focus:ring-1 focus:ring-inset": !0, "ring-secondary-default ring-outline focus:ring-secondary-default": !this.error, "ring-error-default focus:ring-error-default": this.error, "caret-transparent focus:outline-hidden cursor-pointer text-select-none": this.readonly, "cursor-pointer": this.clickable, "text-center": this.align === "center", "text-right": this.align === "right", autofilled: this.isAutofilled }, m = { "opacity-40": this.disabled, "block mb-[4px]": !0, "text-sm": this.size === "sm", "text-base": this.size === "md", "text-lg": this.size === "lg" }, u = { height: t, padding: e, fontSize:
|
|
186
|
+
})(), l = { "w-full flex-1 rounded-[8px] border-0 bg-surface-highest text-surface-on": !0, "outline-secondary-default focus:outline-1 ": !0, "outline-secondary-default focus:outline-1": !0, "disabled:opacity-40 disabled:cursor-not-allowed": !0, "placeholder:text-muted": !0, "ring-0 ring-inset focus:ring-1 focus:ring-inset": !0, "ring-secondary-default ring-outline focus:ring-secondary-default": !this.error, "ring-error-default focus:ring-error-default": this.error, "caret-transparent focus:outline-hidden cursor-pointer text-select-none": this.readonly, "cursor-pointer": this.clickable, "text-center": this.align === "center", "text-right": this.align === "right", autofilled: this.isAutofilled }, m = { "opacity-40": this.disabled, "block mb-[4px]": !0, "text-sm": this.size === "sm", "text-base": this.size === "md", "text-lg": this.size === "lg" }, u = { height: t, padding: e, fontSize: a };
|
|
186
187
|
return b`
|
|
187
188
|
${x(this.label, () => b`
|
|
188
189
|
<label
|
|
189
190
|
for=${this.id}
|
|
190
191
|
id="label-${this.id}"
|
|
191
192
|
class=${this.classMap(m)}
|
|
192
|
-
${g({ color: this.error ?
|
|
193
|
+
${g({ color: this.error ? d.sys.color.error.default : d.sys.color.primary.default })}
|
|
193
194
|
>
|
|
194
195
|
<schmancy-typography type="label" token=${this.size === "sm" ? "sm" : this.size === "lg" ? "lg" : "md"}>
|
|
195
196
|
${this.label}
|
|
@@ -198,8 +199,8 @@ let s = class extends z(O) {
|
|
|
198
199
|
`)}
|
|
199
200
|
|
|
200
201
|
<input
|
|
201
|
-
${g({ bgColor:
|
|
202
|
-
${
|
|
202
|
+
${g({ bgColor: d.sys.color.surface.highest, color: d.sys.color.surface.on })}
|
|
203
|
+
${V(this.inputRef)}
|
|
203
204
|
id=${this.id}
|
|
204
205
|
name=${this.name}
|
|
205
206
|
class=${this.classMap(l)}
|
|
@@ -232,7 +233,7 @@ let s = class extends z(O) {
|
|
|
232
233
|
<div
|
|
233
234
|
id="hint-${this.id}"
|
|
234
235
|
class="${this.size === "sm" ? "pt-[1px] text-xs" : this.size === "lg" ? "pt-[3px] text-base" : "pt-[2px] text-sm"}"
|
|
235
|
-
${g({ color: this.error ?
|
|
236
|
+
${g({ color: this.error ? d.sys.color.error.default : d.sys.color.primary.default })}
|
|
236
237
|
>
|
|
237
238
|
<schmancy-typography
|
|
238
239
|
align="left"
|
|
@@ -246,37 +247,30 @@ let s = class extends z(O) {
|
|
|
246
247
|
`;
|
|
247
248
|
}
|
|
248
249
|
};
|
|
249
|
-
s._idCounter = 0, s.formAssociated = !0, s.shadowRootOptions = { ...w.shadowRootOptions, delegatesFocus: !0 }, r([i({ reflect: !0 })], s.prototype, "id", 2), r([i({ type: String })], s.prototype, "label", 2), r([i({ reflect: !0 })], s.prototype, "type", 2), r([i()], s.prototype, "name", 2), r([i()], s.prototype, "placeholder", 2), r([i({ type: String, reflect: !0 })], s.prototype, "value", 2), r([i({ type: String, reflect: !0 })], s.prototype, "pattern", 2), r([i({ type: Boolean, reflect: !0 })], s.prototype, "required", 2), r([i({ type: Boolean, reflect: !0 })], s.prototype, "disabled", 2), r([i({ type: Boolean, reflect: !0 })], s.prototype, "readonly", 2), r([i({ type: Boolean, reflect: !0 })], s.prototype, "clickable", 2), r([i({ type: Boolean, reflect: !0 })], s.prototype, "spellcheck", 2), r([i({ type: String, reflect: !0 })], s.prototype, "align", 2), r([i()], s.prototype, "inputmode", 2), r([i({ type: Number, reflect: !0 })], s.prototype, "minlength", 2), r([i({ type: Number })], s.prototype, "maxlength", 2), r([i()], s.prototype, "min", 2), r([i()], s.prototype, "max", 2), r([i({ type: Number, reflect: !0 })], s.prototype, "step", 2), r([i({ type: Boolean })], s.prototype, "autofocus", 2), r([i({ type: String, reflect: !0 })], s.prototype, "autocomplete", 2), r([i({ type: Number, reflect: !0 })], s.prototype, "tabIndex", 2), r([i()], s.prototype, "hint", 2), r([i({ type: Boolean, reflect: !0 })], s.prototype, "error", 2), r([i({ type: String, reflect: !0 })], s.prototype, "size", 2), r([i({ type: String })], s.prototype, "validateOn", 2), r([i({ type: String })], s.prototype, "list", 2), r([i({ type: String })], s.prototype, "validationMessage", 2), r([k("input")], s.prototype, "inputElement", 2), r([f()], s.prototype, "isAutofilled", 2), r([f()], s.prototype, "touched", 2), r([f()], s.prototype, "dirty", 2), r([f()], s.prototype, "submitted", 2), r([f()], s.prototype, "defaultValue", 2), s = r([
|
|
250
|
-
var
|
|
251
|
-
for (var m, u = l > 1 ? void 0 : l ?
|
|
252
|
-
return l && u &&
|
|
250
|
+
s._idCounter = 0, s.formAssociated = !0, s.shadowRootOptions = { ...w.shadowRootOptions, delegatesFocus: !0 }, r([i({ reflect: !0 })], s.prototype, "id", 2), r([i({ type: String })], s.prototype, "label", 2), r([i({ reflect: !0 })], s.prototype, "type", 2), r([i()], s.prototype, "name", 2), r([i()], s.prototype, "placeholder", 2), r([i({ type: String, reflect: !0 })], s.prototype, "value", 2), r([i({ type: String, reflect: !0 })], s.prototype, "pattern", 2), r([i({ type: Boolean, reflect: !0 })], s.prototype, "required", 2), r([i({ type: Boolean, reflect: !0 })], s.prototype, "disabled", 2), r([i({ type: Boolean, reflect: !0 })], s.prototype, "readonly", 2), r([i({ type: Boolean, reflect: !0 })], s.prototype, "clickable", 2), r([i({ type: Boolean, reflect: !0 })], s.prototype, "spellcheck", 2), r([i({ type: String, reflect: !0 })], s.prototype, "align", 2), r([i()], s.prototype, "inputmode", 2), r([i({ type: Number, reflect: !0 })], s.prototype, "minlength", 2), r([i({ type: Number })], s.prototype, "maxlength", 2), r([i()], s.prototype, "min", 2), r([i()], s.prototype, "max", 2), r([i({ type: Number, reflect: !0 })], s.prototype, "step", 2), r([i({ type: Boolean })], s.prototype, "autofocus", 2), r([i({ type: String, reflect: !0 })], s.prototype, "autocomplete", 2), r([i({ type: Number, reflect: !0 })], s.prototype, "tabIndex", 2), r([i()], s.prototype, "hint", 2), r([i({ type: Boolean, reflect: !0 })], s.prototype, "error", 2), r([i({ type: String, reflect: !0 })], s.prototype, "size", 2), r([i({ type: String })], s.prototype, "validateOn", 2), r([i({ type: String })], s.prototype, "list", 2), r([i({ type: String })], s.prototype, "validationMessage", 2), r([k("input")], s.prototype, "inputElement", 2), r([f()], s.prototype, "isAutofilled", 2), r([f()], s.prototype, "touched", 2), r([f()], s.prototype, "dirty", 2), r([f()], s.prototype, "submitted", 2), r([f()], s.prototype, "defaultValue", 2), s = r([R("sch-input")], s);
|
|
251
|
+
var M = Object.defineProperty, D = Object.getOwnPropertyDescriptor, o = (t, e, a, l) => {
|
|
252
|
+
for (var m, u = l > 1 ? void 0 : l ? D(e, a) : e, y = t.length - 1; y >= 0; y--) (m = t[y]) && (u = (l ? m(e, a, u) : m(u)) || u);
|
|
253
|
+
return l && u && M(e, a, u), u;
|
|
253
254
|
};
|
|
254
|
-
let
|
|
255
|
+
let n = class extends I(z) {
|
|
255
256
|
constructor() {
|
|
256
|
-
|
|
257
|
-
this.internals = this.attachInternals();
|
|
258
|
-
} catch {
|
|
259
|
-
this.internals = void 0;
|
|
260
|
-
}
|
|
257
|
+
super(...arguments), this.value = "", this.type = "text", this.placeholder = "", this.clickable = !1, this.spellcheck = !1, this.align = "left", this.autofocus = !1, this.autocomplete = "on", this.tabIndex = 0, this.size = "md", this.validateOn = "touched", this.inputRef = S(), this.isAutofilled = !1, this.touched = !1, this.dirty = !1, this.submitted = !1, this.defaultValue = "";
|
|
261
258
|
}
|
|
262
259
|
willUpdate(t) {
|
|
263
|
-
this.id || (this.id = "sch-input-" +
|
|
264
|
-
}
|
|
265
|
-
get form() {
|
|
266
|
-
return this.internals?.form ?? null;
|
|
260
|
+
this.id || (this.id = "sch-input-" + n._idCounter++), super.willUpdate(t);
|
|
267
261
|
}
|
|
268
262
|
updated(t) {
|
|
269
|
-
super.updated(t), t.has("value") && (this.value !== this.defaultValue && (this.dirty = !0), this.
|
|
263
|
+
super.updated(t), t.has("value") && (this.value !== this.defaultValue && (this.dirty = !0), this.validateInput()), !this.hasUpdated && t.has("value") && (this.defaultValue = this.value);
|
|
270
264
|
}
|
|
271
265
|
connectedCallback() {
|
|
272
266
|
super.connectedCallback(), this.defaultValue = this.value, this.setupFormIntegration(), this.setupExternalLabelAssociation();
|
|
273
267
|
}
|
|
274
268
|
setupFormIntegration() {
|
|
275
|
-
this.
|
|
269
|
+
this.form && (this.formResetObserver = new MutationObserver((t) => {
|
|
276
270
|
for (const e of t) e.type === "attributes" && e.attributeName === "reset" && this.resetToDefault();
|
|
277
|
-
}), this.formResetObserver.observe(this.
|
|
271
|
+
}), this.formResetObserver.observe(this.form, { attributes: !0, childList: !1, subtree: !1 }), this.form.addEventListener("reset", () => {
|
|
278
272
|
this.resetToDefault();
|
|
279
|
-
}), this.
|
|
273
|
+
}), this.form.addEventListener("submit", () => {
|
|
280
274
|
this.submitted = !0, this.validateInput(!0);
|
|
281
275
|
}));
|
|
282
276
|
}
|
|
@@ -316,25 +310,24 @@ let a = class extends z(O) {
|
|
|
316
310
|
return this.submitted;
|
|
317
311
|
}
|
|
318
312
|
}
|
|
319
|
-
updateValidityState() {
|
|
320
|
-
this.error ? this.validationMessage ? this.internals?.setValidity({ customError: !0 }, this.validationMessage, this.inputElement) : this.internals?.setValidity({ customError: !0 }, "Invalid input", this.inputElement) : this.internals?.setValidity({});
|
|
321
|
-
}
|
|
322
313
|
validateInput(t = !1) {
|
|
323
314
|
if (this.disabled) return;
|
|
324
|
-
const e = this.shouldShowValidation(t),
|
|
325
|
-
e && l ? (this.error = !0, this.validationMessage = this.inputElement?.validationMessage || "") :
|
|
315
|
+
const e = this.shouldShowValidation(t), a = this.inputElement?.validity ?? { customError: !1, valid: !0 }, l = !a.valid && !a.customError;
|
|
316
|
+
e && l ? (this.error = !0, this.validationMessage = this.inputElement?.validationMessage || "") : a.valid ? (this.error = !1, a.customError || (this.validationMessage = "")) : e || (this.error = !1);
|
|
326
317
|
}
|
|
327
318
|
checkValidity() {
|
|
328
|
-
const t = this.inputRef.value?.checkValidity() ?? !0;
|
|
329
|
-
return
|
|
319
|
+
const t = this.inputRef.value?.checkValidity() ?? !0, e = super.checkValidity();
|
|
320
|
+
return t && e;
|
|
330
321
|
}
|
|
331
322
|
reportValidity() {
|
|
332
323
|
this.touched = !0, this.submitted = !0;
|
|
333
324
|
const t = this.inputRef.value?.reportValidity() ?? !0;
|
|
334
|
-
|
|
325
|
+
this.validateInput(!0);
|
|
326
|
+
const e = super.reportValidity();
|
|
327
|
+
return t && e;
|
|
335
328
|
}
|
|
336
329
|
setCustomValidity(t) {
|
|
337
|
-
this.inputRef.value && this.inputRef.value.setCustomValidity(t),
|
|
330
|
+
this.inputRef.value && this.inputRef.value.setCustomValidity(t), super.setCustomValidity(t), this.error = t !== "" && this.shouldShowValidation();
|
|
338
331
|
}
|
|
339
332
|
firstUpdated() {
|
|
340
333
|
this.autofocus && setTimeout(() => {
|
|
@@ -345,38 +338,38 @@ let a = class extends z(O) {
|
|
|
345
338
|
p(this.inputElement, "input").pipe($((t) => {
|
|
346
339
|
const e = t;
|
|
347
340
|
return { value: t.target.value, inputType: e.inputType, data: e.data, isComposing: e.isComposing, originalEvent: t };
|
|
348
|
-
}),
|
|
341
|
+
}), c(this.disconnecting)).subscribe((t) => {
|
|
349
342
|
this.value = t.value, this.dirty = this.value !== this.defaultValue;
|
|
350
343
|
const e = new CustomEvent("input", { detail: { value: t.value }, bubbles: !0, composed: !0 });
|
|
351
344
|
Object.defineProperties(e, { inputType: { value: t.inputType }, data: { value: t.data }, isComposing: { value: t.isComposing } }), this.dispatchEvent(e), this.validateInput();
|
|
352
|
-
}), p(this.inputElement, "change").pipe($((t) => t.target.value), C(),
|
|
353
|
-
this.value = t, this.dirty = this.value !== this.defaultValue, this.
|
|
345
|
+
}), p(this.inputElement, "change").pipe($((t) => t.target.value), C(), c(this.disconnecting)).subscribe((t) => {
|
|
346
|
+
this.value = t, this.dirty = this.value !== this.defaultValue, this.emitChange({ value: t }), this.validateInput();
|
|
354
347
|
});
|
|
355
348
|
}
|
|
356
349
|
setupFocusBlurEvents() {
|
|
357
|
-
p(this.inputElement, "focus").pipe(
|
|
350
|
+
p(this.inputElement, "focus").pipe(c(this.disconnecting)).subscribe((t) => {
|
|
358
351
|
const e = new CustomEvent("focus", { bubbles: t.bubbles, cancelable: t.cancelable, composed: t.composed });
|
|
359
352
|
Object.defineProperties(e, { relatedTarget: { value: t.relatedTarget } }), this.dispatchEvent(e);
|
|
360
|
-
}), p(this.inputElement, "blur").pipe(
|
|
353
|
+
}), p(this.inputElement, "blur").pipe(c(this.disconnecting)).subscribe((t) => {
|
|
361
354
|
this.touched = !0, this.disabled || this.validateInput();
|
|
362
355
|
const e = new CustomEvent("blur", { bubbles: t.bubbles, cancelable: t.cancelable, composed: t.composed });
|
|
363
356
|
Object.defineProperties(e, { relatedTarget: { value: t.relatedTarget } }), this.dispatchEvent(e);
|
|
364
357
|
});
|
|
365
358
|
}
|
|
366
359
|
setupAutofillDetection() {
|
|
367
|
-
p(this.inputElement, "animationstart").pipe(v((t) => t.animationName === "onAutoFillStart"),
|
|
360
|
+
p(this.inputElement, "animationstart").pipe(v((t) => t.animationName === "onAutoFillStart"), c(this.disconnecting)).subscribe((t) => {
|
|
368
361
|
const { value: e } = t.target;
|
|
369
|
-
this.value = e, this.isAutofilled = !0, this.dirty = this.value !== this.defaultValue, this.dispatchEvent(new CustomEvent("autofill", { detail: { value: e }, bubbles: !0, composed: !0 })), this.
|
|
370
|
-
}), p(this.inputElement, "animationstart").pipe(v((t) => t.animationName === "onAutoFillCancel"),
|
|
362
|
+
this.value = e, this.isAutofilled = !0, this.dirty = this.value !== this.defaultValue, this.dispatchEvent(new CustomEvent("autofill", { detail: { value: e }, bubbles: !0, composed: !0 })), this.emitChange({ value: e });
|
|
363
|
+
}), p(this.inputElement, "animationstart").pipe(v((t) => t.animationName === "onAutoFillCancel"), c(this.disconnecting)).subscribe(() => {
|
|
371
364
|
this.isAutofilled = !1;
|
|
372
365
|
});
|
|
373
366
|
}
|
|
374
367
|
setupEnterKeyEvents() {
|
|
375
|
-
p(this.inputElement, "
|
|
368
|
+
p(this.inputElement, "keydown").pipe(v((t) => t.key === "Enter"), c(this.disconnecting)).subscribe((t) => {
|
|
376
369
|
const { value: e } = t.target;
|
|
377
|
-
this.value = e, this.dirty = this.value !== this.defaultValue;
|
|
378
|
-
const
|
|
379
|
-
Object.defineProperties(
|
|
370
|
+
this.value !== e && (this.value = e, this.dirty = this.value !== this.defaultValue), this.inputElement.blur();
|
|
371
|
+
const a = new CustomEvent("enter", { detail: { value: this.value }, bubbles: !0, composed: !0 });
|
|
372
|
+
Object.defineProperties(a, { key: { value: "Enter" }, code: { value: "Enter" }, keyCode: { value: 13 }, which: { value: 13 } }), this.dispatchEvent(a);
|
|
380
373
|
});
|
|
381
374
|
}
|
|
382
375
|
select() {
|
|
@@ -385,8 +378,8 @@ let a = class extends z(O) {
|
|
|
385
378
|
getValidity() {
|
|
386
379
|
return this.inputRef.value?.validity;
|
|
387
380
|
}
|
|
388
|
-
setSelectionRange(t, e,
|
|
389
|
-
this.inputRef.value?.setSelectionRange(t, e,
|
|
381
|
+
setSelectionRange(t, e, a) {
|
|
382
|
+
this.inputRef.value?.setSelectionRange(t, e, a);
|
|
390
383
|
}
|
|
391
384
|
get selectionStart() {
|
|
392
385
|
return this.inputRef.value?.selectionStart ?? null;
|
|
@@ -397,8 +390,8 @@ let a = class extends z(O) {
|
|
|
397
390
|
get selectionDirection() {
|
|
398
391
|
return this.inputRef.value?.selectionDirection ?? null;
|
|
399
392
|
}
|
|
400
|
-
setRangeText(t, e,
|
|
401
|
-
e !== void 0 &&
|
|
393
|
+
setRangeText(t, e, a, l) {
|
|
394
|
+
e !== void 0 && a !== void 0 ? this.inputRef.value?.setRangeText(t, e, a, l) : this.inputRef.value?.setRangeText(t);
|
|
402
395
|
}
|
|
403
396
|
focus(t) {
|
|
404
397
|
this.inputRef.value?.focus(t), this.dispatchEvent(new Event("focus"));
|
|
@@ -410,7 +403,7 @@ let a = class extends z(O) {
|
|
|
410
403
|
this.inputRef.value?.blur(), this.dispatchEvent(new Event("blur"));
|
|
411
404
|
}
|
|
412
405
|
render() {
|
|
413
|
-
const { height: t, padding: e, fontSize:
|
|
406
|
+
const { height: t, padding: e, fontSize: a } = (() => {
|
|
414
407
|
switch (this.size) {
|
|
415
408
|
case "sm":
|
|
416
409
|
return { height: "40px", padding: "0 8px", fontSize: "0.875rem" };
|
|
@@ -419,14 +412,14 @@ let a = class extends z(O) {
|
|
|
419
412
|
default:
|
|
420
413
|
return { height: "50px", padding: "0 16px", fontSize: "1rem" };
|
|
421
414
|
}
|
|
422
|
-
})(), l = { "w-full flex-1 rounded-[8px] border-0 bg-surface-highest text-surface-on": !0, "outline-secondary-default focus:outline-1 ": !0, "outline-secondary-default focus:outline-1": !0, "disabled:opacity-40 disabled:cursor-not-allowed": !0, "placeholder:text-muted": !0, "ring-0 ring-inset focus:ring-1 focus:ring-inset": !0, "ring-secondary-default ring-outline focus:ring-secondary-default": !this.error, "ring-error-default focus:ring-error-default": this.error, "caret-transparent focus:outline-hidden cursor-pointer text-select-none": this.readonly, "cursor-pointer": this.clickable, "text-center": this.align === "center", "text-right": this.align === "right", autofilled: this.isAutofilled }, m = { "opacity-40": this.disabled, "block mb-[4px]": !0, "text-sm": this.size === "sm", "text-base": this.size === "md", "text-lg": this.size === "lg" }, u = { height: t, padding: e, fontSize:
|
|
415
|
+
})(), l = { "w-full flex-1 rounded-[8px] border-0 bg-surface-highest text-surface-on": !0, "outline-secondary-default focus:outline-1 ": !0, "outline-secondary-default focus:outline-1": !0, "disabled:opacity-40 disabled:cursor-not-allowed": !0, "placeholder:text-muted": !0, "ring-0 ring-inset focus:ring-1 focus:ring-inset": !0, "ring-secondary-default ring-outline focus:ring-secondary-default": !this.error, "ring-error-default focus:ring-error-default": this.error, "caret-transparent focus:outline-hidden cursor-pointer text-select-none": this.readonly, "cursor-pointer": this.clickable, "text-center": this.align === "center", "text-right": this.align === "right", autofilled: this.isAutofilled }, m = { "opacity-40": this.disabled, "block mb-[4px]": !0, "text-sm": this.size === "sm", "text-base": this.size === "md", "text-lg": this.size === "lg" }, u = { height: t, padding: e, fontSize: a };
|
|
423
416
|
return b`
|
|
424
417
|
${x(this.label, () => b`
|
|
425
418
|
<label
|
|
426
419
|
for=${this.id}
|
|
427
420
|
id="label-${this.id}"
|
|
428
421
|
class=${this.classMap(m)}
|
|
429
|
-
${g({ color: this.error ?
|
|
422
|
+
${g({ color: this.error ? d.sys.color.error.default : d.sys.color.primary.default })}
|
|
430
423
|
>
|
|
431
424
|
<schmancy-typography type="label" token=${this.size === "sm" ? "sm" : this.size === "lg" ? "lg" : "md"}>
|
|
432
425
|
${this.label}
|
|
@@ -435,8 +428,8 @@ let a = class extends z(O) {
|
|
|
435
428
|
`)}
|
|
436
429
|
|
|
437
430
|
<input
|
|
438
|
-
${g({ bgColor:
|
|
439
|
-
${
|
|
431
|
+
${g({ bgColor: d.sys.color.surface.highest, color: d.sys.color.surface.on })}
|
|
432
|
+
${V(this.inputRef)}
|
|
440
433
|
id=${this.id}
|
|
441
434
|
name=${this.name}
|
|
442
435
|
class=${this.classMap(l)}
|
|
@@ -469,7 +462,7 @@ let a = class extends z(O) {
|
|
|
469
462
|
<div
|
|
470
463
|
id="hint-${this.id}"
|
|
471
464
|
class="${this.size === "sm" ? "pt-[1px] text-xs" : this.size === "lg" ? "pt-[3px] text-base" : "pt-[2px] text-sm"}"
|
|
472
|
-
${g({ color: this.error ?
|
|
465
|
+
${g({ color: this.error ? d.sys.color.error.default : d.sys.color.primary.default })}
|
|
473
466
|
>
|
|
474
467
|
<schmancy-typography
|
|
475
468
|
align="left"
|
|
@@ -483,5 +476,5 @@ let a = class extends z(O) {
|
|
|
483
476
|
`;
|
|
484
477
|
}
|
|
485
478
|
};
|
|
486
|
-
|
|
487
|
-
//# sourceMappingURL=input-
|
|
479
|
+
n._idCounter = 0, n.shadowRootOptions = { ...w.shadowRootOptions, delegatesFocus: !0 }, o([i({ type: String, reflect: !0 })], n.prototype, "value", 2), o([i({ reflect: !0 })], n.prototype, "type", 2), o([i()], n.prototype, "placeholder", 2), o([i({ type: String, reflect: !0 })], n.prototype, "pattern", 2), o([i({ type: Boolean, reflect: !0 })], n.prototype, "clickable", 2), o([i({ type: Boolean, reflect: !0 })], n.prototype, "spellcheck", 2), o([i({ type: String, reflect: !0 })], n.prototype, "align", 2), o([i()], n.prototype, "inputmode", 2), o([i({ type: Number, reflect: !0 })], n.prototype, "minlength", 2), o([i({ type: Number })], n.prototype, "maxlength", 2), o([i()], n.prototype, "min", 2), o([i()], n.prototype, "max", 2), o([i({ type: Number, reflect: !0 })], n.prototype, "step", 2), o([i({ type: Boolean })], n.prototype, "autofocus", 2), o([i({ type: String, reflect: !0 })], n.prototype, "autocomplete", 2), o([i({ type: Number, reflect: !0 })], n.prototype, "tabIndex", 2), o([i({ type: String, reflect: !0 })], n.prototype, "size", 2), o([i({ type: String })], n.prototype, "validateOn", 2), o([i({ type: String })], n.prototype, "list", 2), o([k("input")], n.prototype, "inputElement", 2), o([f()], n.prototype, "isAutofilled", 2), o([f()], n.prototype, "touched", 2), o([f()], n.prototype, "dirty", 2), o([f()], n.prototype, "submitted", 2), o([f()], n.prototype, "defaultValue", 2), n = o([R("schmancy-input")], n);
|
|
480
|
+
//# sourceMappingURL=input-CMRD9x7X.js.map
|