@ganpatiinfo/gids-core-web 3.1.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/css/index.css +977 -0
- package/dist/css/index.css.map +1 -1
- package/dist/custom-elements.json +90 -0
- package/dist/gids-field.d.ts +11 -0
- package/dist/gids-field.js +1 -0
- package/dist/gids-icon.d.ts +1 -1
- package/dist/gids-icon.js +1 -1
- package/dist/gids-input.d.ts +11 -0
- package/dist/gids-input.js +1 -0
- package/dist/gids-notification.d.ts +11 -0
- package/dist/gids-notification.js +1 -0
- package/dist/gids-overlay-provider.d.ts +11 -0
- package/dist/gids-overlay-provider.js +1 -0
- package/dist/gids-password-field.d.ts +11 -0
- package/dist/gids-password-field.js +1 -0
- package/dist/gids-scrim.d.ts +11 -0
- package/dist/gids-scrim.js +1 -0
- package/dist/gids-snackbar.d.ts +11 -0
- package/dist/gids-snackbar.js +1 -0
- package/dist/gids-text-field.d.ts +11 -0
- package/dist/gids-text-field.js +1 -0
- package/dist/gids-toggle-button.d.ts +1 -1
- package/dist/gids-toggle-button.js +1 -1
- package/dist/index.js +1 -1
- package/dist/p-B2zUuNXz.js +1 -0
- package/dist/p-BVh4zbX4.js +1 -0
- package/dist/p-BplPYg8z.js +1 -0
- package/dist/p-CVtNa0cL.js +1 -0
- package/dist/p-CWdkmFbc.js +1 -0
- package/dist/p-DijVkS9b.js +1 -0
- package/dist/p-DybsMR13.js +1 -0
- package/dist/p-ibikYq-w.js +1 -0
- package/dist/p-veoOgDXg.js +1 -0
- package/dist/types/components/html/GidsDismissButton/GidsDismissButton.d.ts +6 -0
- package/dist/types/components/html/GidsHeading/GidsHeading.d.ts +6 -0
- package/dist/types/components/html/GidsLogo/GidsLogo.d.ts +9 -0
- package/dist/types/components/html/GidsRequirementsMeter/GidsRequirementsMeter.d.ts +4 -0
- package/dist/types/components/html/GidsSearchBar/GidsSearchBar.d.ts +10 -0
- package/dist/types/components/html/GidsSegmentedControl/GidsSegmentedControl.d.ts +1 -1
- package/dist/types/components/html/GidsSegmentedTabItem/GidsSegmentedTabItem.d.ts +1 -1
- package/dist/types/components/html/GidsStatusTag/GidsStatusTag.d.ts +5 -0
- package/dist/types/components/html/GidsStepper/GidsStepper.d.ts +7 -0
- package/dist/types/components/html/GidsStrengthMeter/GidsStrengthMeter.d.ts +5 -0
- package/dist/types/components/html/GidsTopNavigation/GidsTopNavigation.d.ts +8 -0
- package/dist/types/components/html/_GidsNotificationContainer/GidsNotificationContainer.d.ts +7 -0
- package/dist/types/components/html/_GidsRequirementsMeterLabel/GidsRequirementsMeterLabel.d.ts +4 -0
- package/dist/types/components/html/_GidsSideMenuItem/GidsSideMenuItem.d.ts +7 -0
- package/dist/types/components/html/_GidsSnackbarContainer/GidsSnackbarContainer.d.ts +6 -0
- package/dist/types/components/webComponents/GidsField/GidsField.d.ts +54 -0
- package/dist/types/components/webComponents/GidsInput/GidsInput.d.ts +27 -0
- package/dist/types/components/webComponents/GidsNotification/GidsNotification.d.ts +17 -0
- package/dist/types/components/webComponents/GidsOverlayProvider/GidsOverlayProvider.d.ts +23 -0
- package/dist/types/components/webComponents/GidsOverlayProvider/GidsOverlayProviderUtils.d.ts +8 -0
- package/dist/types/components/webComponents/GidsPasswordField/GidsPasswordField.d.ts +49 -0
- package/dist/types/components/webComponents/GidsScrim/GidsScrim.d.ts +7 -0
- package/dist/types/components/webComponents/GidsSnackbar/GidsSnackbar.d.ts +15 -0
- package/dist/types/components/webComponents/GidsTextField/GidsTextField.d.ts +39 -0
- package/dist/types/components.d.ts +455 -4
- package/dist-bundled/es/gids-field.js +6 -0
- package/dist-bundled/es/gids-icon.js +16 -200
- package/dist-bundled/es/gids-input.js +6 -0
- package/dist-bundled/es/gids-notification.js +31 -0
- package/dist-bundled/es/gids-overlay-provider.js +209 -0
- package/dist-bundled/es/gids-password-field.js +221 -0
- package/dist-bundled/es/gids-scrim.js +35 -0
- package/dist-bundled/es/gids-snackbar.js +31 -0
- package/dist-bundled/es/gids-text-field.js +78 -0
- package/dist-bundled/es/gids-toggle-button.js +14 -55
- package/dist-bundled/es/index.js +8 -7
- package/dist-bundled/es/p-B2zUuNXz-BLBgQDu7.js +45 -0
- package/dist-bundled/es/p-BVh4zbX4-C4UJ8LPX.js +74 -0
- package/dist-bundled/es/p-BplPYg8z-B8uAAfo4.js +181 -0
- package/dist-bundled/es/p-CVtNa0cL-sSVeJsR3.js +15 -0
- package/dist-bundled/es/p-CWdkmFbc-D89ZE8Mi.js +24 -0
- package/dist-bundled/es/p-DijVkS9b-CtFkEtlE.js +35 -0
- package/dist-bundled/es/p-DybsMR13-DpmsG3Q1.js +31 -0
- package/dist-bundled/es/p-ibikYq-w-BsGxk8ro.js +635 -0
- package/dist-bundled/es/p-veoOgDXg-DElc87c0.js +192 -0
- package/dist-bundled/umd/gids-field.umd.js +5 -0
- package/dist-bundled/umd/gids-icon.umd.js +5 -1
- package/dist-bundled/umd/gids-input.umd.js +5 -0
- package/dist-bundled/umd/gids-notification.umd.js +5 -0
- package/dist-bundled/umd/gids-overlay-provider.umd.js +5 -0
- package/dist-bundled/umd/gids-password-field.umd.js +5 -0
- package/dist-bundled/umd/gids-scrim.umd.js +5 -0
- package/dist-bundled/umd/gids-snackbar.umd.js +5 -0
- package/dist-bundled/umd/gids-text-field.umd.js +5 -0
- package/dist-bundled/umd/gids-toggle-button.umd.js +6 -2
- package/dist-bundled/umd/index.umd.js +5 -1
- package/dist-bundled/umd-complete/gids-core-web.umd.js +6 -2
- package/package.json +71 -7
- package/dist/p-CgujYzVX.js +0 -1
- package/dist-bundled/es/p-CgujYzVX-xo1axnk6.js +0 -465
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import { C as S, f as P, V as v, N as x, R as i, L as T, H as h } from "./p-ibikYq-w-BsGxk8ro.js";
|
|
2
|
+
import { i as C } from "./p-B2zUuNXz-BLBgQDu7.js";
|
|
3
|
+
import { n as L, o as O } from "./p-DijVkS9b-CtFkEtlE.js";
|
|
4
|
+
import { a as F } from "./p-CWdkmFbc-D89ZE8Mi.js";
|
|
5
|
+
import { g as k, d as j } from "./p-veoOgDXg-DElc87c0.js";
|
|
6
|
+
import { h as E } from "./p-BplPYg8z-B8uAAfo4.js";
|
|
7
|
+
import { r as G } from "./p-BVh4zbX4-C4UJ8LPX.js";
|
|
8
|
+
import { c as g } from "./clsx-OuTLNxxd.js";
|
|
9
|
+
const f = /[A-Z]/, p = /[a-z]/, b = /[0-9]/, q = /[^A-Za-z0-9]/, z = ({ text: e, meterRules: t = [], textMinLength: s = 0 }) => {
|
|
10
|
+
if (!e || e === "")
|
|
11
|
+
return 0;
|
|
12
|
+
let n = 0;
|
|
13
|
+
return t.includes("1-uppercase") && f.test(e) && n++, t.includes("1-lowercase") && p.test(e) && n++, t.includes("1-digit") && b.test(e) && n++, t.includes("1-special-character") && q.test(e) && n++, t.includes("include-min-length") && s && s > 0 && e.length >= s && n++, n;
|
|
14
|
+
}, B = ({ textScore: e, maxScore: t }) => {
|
|
15
|
+
const s = t > 0 ? e / t * 100 : 0;
|
|
16
|
+
return s <= 20 ? "is-weak" : s <= 40 ? "is-medium" : s <= 60 ? "is-good-enough" : s <= 80 ? "is-good" : "is-strong";
|
|
17
|
+
}, A = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
18
|
+
__proto__: null,
|
|
19
|
+
getColorModifierByScore: B,
|
|
20
|
+
getStrengthMeterScore: z,
|
|
21
|
+
include1DigitReg: b,
|
|
22
|
+
include1LowercaseLetterReg: p,
|
|
23
|
+
include1SpecialCharReg: q,
|
|
24
|
+
include1UppercaseLetterReg: f
|
|
25
|
+
}, Symbol.toStringTag, { value: "Module" })), d = ({ requirementRule: e, textMinLength: t }) => e === "include-min-length" && t && t > 0, R = (e) => {
|
|
26
|
+
const t = [];
|
|
27
|
+
return e && e.length > 0 && e.map((s) => {
|
|
28
|
+
s?.requirementRule && t.push(s.requirementRule);
|
|
29
|
+
}), t;
|
|
30
|
+
}, I = ({ rule: e, textMinLength: t = 0, text: s }) => {
|
|
31
|
+
if (!s || s === "" || !e && !t)
|
|
32
|
+
return !1;
|
|
33
|
+
switch (e) {
|
|
34
|
+
case "1-uppercase":
|
|
35
|
+
return f.test(s);
|
|
36
|
+
case "1-lowercase":
|
|
37
|
+
return p.test(s);
|
|
38
|
+
case "1-digit":
|
|
39
|
+
return b.test(s);
|
|
40
|
+
case "1-special-character":
|
|
41
|
+
return q.test(s);
|
|
42
|
+
case "include-min-length":
|
|
43
|
+
return d({
|
|
44
|
+
requirementRule: "include-min-length",
|
|
45
|
+
textMinLength: t
|
|
46
|
+
}) === !0 && s.length >= t;
|
|
47
|
+
default:
|
|
48
|
+
return !1;
|
|
49
|
+
}
|
|
50
|
+
}, m = (e) => {
|
|
51
|
+
const t = [
|
|
52
|
+
{
|
|
53
|
+
requirementRule: "1-uppercase",
|
|
54
|
+
requirementText: "Password must contain atleast 1 uppercase letter."
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
requirementRule: "1-digit",
|
|
58
|
+
requirementText: "Password must contain atleast 1 digit."
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
requirementRule: "1-special-character",
|
|
62
|
+
requirementText: "Password must contain atleast 1 special character."
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
requirementRule: "1-lowercase",
|
|
66
|
+
requirementText: "Password must contain atleast 1 lowercase letter."
|
|
67
|
+
}
|
|
68
|
+
];
|
|
69
|
+
return d({
|
|
70
|
+
requirementRule: "include-min-length",
|
|
71
|
+
textMinLength: e
|
|
72
|
+
}) && t.push({
|
|
73
|
+
requirementRule: "include-min-length",
|
|
74
|
+
requirementText: `Password must be of minimum ${e} characters long.`
|
|
75
|
+
}), {
|
|
76
|
+
defaultMeterRules: R(t),
|
|
77
|
+
defaultRequirementsMeterRules: t
|
|
78
|
+
};
|
|
79
|
+
}, V = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
80
|
+
__proto__: null,
|
|
81
|
+
checkRequirementRuleSatisfied: I,
|
|
82
|
+
getDefaultRulesAndRequirementsForMeters: m,
|
|
83
|
+
getMeterRulesFromRequirements: R,
|
|
84
|
+
minLengthRuleCanBeApplied: d
|
|
85
|
+
}, Symbol.toStringTag, { value: "Module" })), N = (e) => {
|
|
86
|
+
switch (e) {
|
|
87
|
+
case "error":
|
|
88
|
+
return "danger";
|
|
89
|
+
case "information":
|
|
90
|
+
return "information";
|
|
91
|
+
case "warning":
|
|
92
|
+
return "warning";
|
|
93
|
+
case "success":
|
|
94
|
+
return "positive";
|
|
95
|
+
default:
|
|
96
|
+
return "globe";
|
|
97
|
+
}
|
|
98
|
+
}, $ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
99
|
+
__proto__: null,
|
|
100
|
+
getRequirementsMeterLabelLeadingIcon: N
|
|
101
|
+
}, Symbol.toStringTag, { value: "Module" })), D = (e) => {
|
|
102
|
+
switch (e) {
|
|
103
|
+
case "error":
|
|
104
|
+
return "error";
|
|
105
|
+
case "success":
|
|
106
|
+
return "success";
|
|
107
|
+
default:
|
|
108
|
+
return "default";
|
|
109
|
+
}
|
|
110
|
+
}, H = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
111
|
+
__proto__: null,
|
|
112
|
+
inputToGidsFieldStatusForPassword: D
|
|
113
|
+
}, Symbol.toStringTag, { value: "Module" })), U = (e) => g("gids-strength-meter", e), Z = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
114
|
+
__proto__: null,
|
|
115
|
+
getGidsStrengthMeterClassNames: U
|
|
116
|
+
}, Symbol.toStringTag, { value: "Module" })), W = ({ status: e }, t) => g("gids-requirements-meter-label", {
|
|
117
|
+
"gids-requirements-meter-label--error": e === "error",
|
|
118
|
+
"gids-requirements-meter-label--information": e === "information",
|
|
119
|
+
"gids-requirements-meter-label--warning": e === "warning",
|
|
120
|
+
"gids-requirements-meter-label--success": e === "success"
|
|
121
|
+
}, t), J = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
122
|
+
__proto__: null,
|
|
123
|
+
getGidsRequirementsMeterLabelClassNames: W
|
|
124
|
+
}, Symbol.toStringTag, { value: "Module" })), K = (e) => g("gids-requirements-meter", e), Q = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
125
|
+
__proto__: null,
|
|
126
|
+
getGidsRequirementsMeterClassNames: K
|
|
127
|
+
}, Symbol.toStringTag, { value: "Module" })), { inputToGidsFieldStatusForPassword: X } = H, Y = (e) => e === "implicit" || e === void 0 ? "implicit" : X(e), ee = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
128
|
+
__proto__: null,
|
|
129
|
+
inputToGidsFieldStatusForPassword: Y
|
|
130
|
+
}, Symbol.toStringTag, { value: "Module" })), { getGidsStrengthMeterClassNames: te } = Z, { getStrengthMeterScore: se, getColorModifierByScore: re } = A, ie = ({ text: e, textMinLength: t, meterRules: s = ["1-uppercase", "1-lowercase", "1-digit", "1-special-character", "include-min-length"], class: n }) => {
|
|
131
|
+
const a = (r, l, u) => i("div", { key: r, class: ["gids-strength-meter__strength-" + r, u ? "is-active" : "", u ? l : ""].filter(Boolean).join(" ") });
|
|
132
|
+
return s.length > 0 ? i("div", { class: te(n) }, (() => {
|
|
133
|
+
const r = s.length, l = se({ text: e, textMinLength: t, meterRules: s }), u = re({ textScore: l, maxScore: r });
|
|
134
|
+
return Array.from({ length: r }, ((_, c) => {
|
|
135
|
+
const o = c + 1, w = o <= l;
|
|
136
|
+
return s[o] === "include-min-length" ? d({ requirementRule: "include-min-length", textMinLength: t }) ? a(o, u, w) : null : a(o, u, w);
|
|
137
|
+
}));
|
|
138
|
+
})()) : null;
|
|
139
|
+
}, { getGidsRequirementsMeterLabelClassNames: ne } = J, { getRequirementsMeterLabelLeadingIcon: le } = $, ae = (e) => {
|
|
140
|
+
const { label: t, status: s = "default", leadingIconVisible: n = !0, class: a } = e, r = le(s);
|
|
141
|
+
return i("div", { class: ne({ status: s }, a) }, n && s && r ? i(j, { name: r, size: "sm", appearance: "filled" }) : null, t && t !== "" ? i("span", null, t) : null);
|
|
142
|
+
}, { checkRequirementRuleSatisfied: ue } = V, { getGidsRequirementsMeterClassNames: oe } = Q, de = ({ requirements: e = [], text: t, textMinLength: s, class: n }) => {
|
|
143
|
+
const a = (r, l) => i(ae, { status: l ? "success" : "error", label: r.requirementText });
|
|
144
|
+
return i("div", { class: oe(n) }, (console.log("requirements", e), e.map(((r) => {
|
|
145
|
+
if (r?.requirementText && r?.requirementRule) {
|
|
146
|
+
const l = ue({ rule: r.requirementRule, textMinLength: s, text: t });
|
|
147
|
+
return r.requirementRule === "include-min-length" ? d({ requirementRule: r.requirementRule, textMinLength: s }) ? a(r, l) : null : a(r, l);
|
|
148
|
+
}
|
|
149
|
+
return null;
|
|
150
|
+
}))));
|
|
151
|
+
}, { inputToGidsFieldStatusForPassword: ce } = ee, M = S(class extends P {
|
|
152
|
+
constructor(e) {
|
|
153
|
+
super(), e !== !1 && this.__registerHost(), this.gidsPasswordFieldClear = v(this, "gidsPasswordFieldClear"), this.gidsPasswordFieldRevealPassword = v(this, "gidsPasswordFieldRevealPassword"), this.isPasswordRevealed = !1, this.meterRules = [], this.requirementsMeterRequirements = [], this.requirements = [], this.#t = k(), this._handleDismiss = () => {
|
|
154
|
+
const t = this.#e?.querySelector("input.gids-input__control");
|
|
155
|
+
t && (t.value = "", t.dispatchEvent(new globalThis.Event("input", { bubbles: !0 }))), this.value = "", this.gidsPasswordFieldClear.emit();
|
|
156
|
+
}, this._handleRevealPassword = () => {
|
|
157
|
+
const t = this.#e?.querySelector("input.gids-input__control");
|
|
158
|
+
this.isPasswordRevealed = t?.value != null && t.value !== "" && this.isPasswordRevealed === !1, this._el.dispatchEvent(new CustomEvent("gidsPasswordFieldRevealPassword", { detail: { passwordRevealed: this.isPasswordRevealed }, bubbles: !0, composed: !0 }));
|
|
159
|
+
}, this._handleInput = (t) => {
|
|
160
|
+
this.value = t.target?.value;
|
|
161
|
+
}, this._handleInputFocusAndBlur = (t) => {
|
|
162
|
+
this._el.dispatchEvent(new FocusEvent(t.type, { relatedTarget: t.relatedTarget }));
|
|
163
|
+
}, this._isRequirementAndStrengthMeterVisible = () => {
|
|
164
|
+
const t = this.requirements;
|
|
165
|
+
return !!(t && t.length > 0);
|
|
166
|
+
}, this._handleRequirementsMeter = () => {
|
|
167
|
+
const t = this._isRequirementAndStrengthMeterVisible();
|
|
168
|
+
this.requirementsMeterRequirements = this.requirements && this.requirements.length > 0 ? this.requirements : [], this.meterRules = t ? R(this.requirements) : [];
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
_startSlotContentObserver() {
|
|
172
|
+
this._slotContentObserver = new MutationObserver((() => {
|
|
173
|
+
x(this);
|
|
174
|
+
})), this._slotContentObserver.observe(this._el, { childList: !0, subtree: !1, attributes: !0, attributeFilter: ["slot"] });
|
|
175
|
+
}
|
|
176
|
+
handleRequirementsChange(e) {
|
|
177
|
+
e === void 0 && (this.requirements = m(this.textMinLength).defaultRequirementsMeterRules), this._handleRequirementsMeter();
|
|
178
|
+
}
|
|
179
|
+
componentWillLoad() {
|
|
180
|
+
this.requirements || (this.requirements = m(this.textMinLength).defaultRequirementsMeterRules), this._handleRequirementsMeter();
|
|
181
|
+
}
|
|
182
|
+
connectedCallback() {
|
|
183
|
+
const e = C();
|
|
184
|
+
e !== void 0 && this._el.shadowRoot?.adoptedStyleSheets.push(e), this._handleRequirementsMeter(), this._startSlotContentObserver();
|
|
185
|
+
}
|
|
186
|
+
disconnectedCallback() {
|
|
187
|
+
this._slotContentObserver?.disconnect(), this._slotContentObserver = void 0;
|
|
188
|
+
}
|
|
189
|
+
#t;
|
|
190
|
+
#e;
|
|
191
|
+
render() {
|
|
192
|
+
const { id: e, ...t } = this.inputProps ?? {}, s = e ?? this.#t, n = this.showClearButton && this.value !== void 0 && this.value.length > 0, a = this.showRevealPasswordButton, r = { ...t }, l = r?.placeholder && r.placeholder != "" ? r.placeholder : "Enter password", u = this.isPasswordRevealed, _ = this.meterRules, c = this.textMinLength !== void 0 ? this.textMinLength : 8;
|
|
193
|
+
return i(T, { key: "84bc020da1e496c4127ef65e4f7432b1ffb9654c" }, i("gids-field", { key: "484452f7974320a9aa937435cfb2a38027de9bc8", disabled: this.disabled, count: void 0, helperText: this.helperText, statusText: this.statusText, status: ce(this.status) }, i(L, { key: "d89c25ed9f385009ce353bb5ceee083f25b6a685", slot: "label", disabled: this.disabled, info: i("slot", { name: "info" }), fieldRequirement: this.fieldRequirement, fieldRequirementOptionalText: this.fieldRequirementOptionalText, fieldRequirementRequiredText: this.fieldRequirementRequiredText, isLabelSentence: this.isLabelSentence, htmlFor: s }, this.label), i("gids-input", { key: "83c256b3a95e253c9fed98c31b28350dfaa91f01", ref: (o) => this.#e = o, appearance: "default", status: this.status, loading: this.loading, value: this.value, defaultValue: this.defaultValue, name: this.name, required: this.required, disabled: this.disabled, readOnly: this.readOnly, leadingLabel: void 0, trailingLabel: void 0, onFocus: this._handleInputFocusAndBlur, onBlur: this._handleInputFocusAndBlur, onInput: this._handleInput, inputProps: { ...r, placeholder: l, type: u ? "text" : "password", id: s, maxLength: this.maxLength } }, i("slot", { key: "7c60013a0c976f72e68c7055885969d0dfcc86bc", name: "leadingIcon" }), i("slot", { key: "d04ba13ed7d1188085cee4f77f2ead6f5d63688e", name: "leadingAccessory" }), i("div", { key: "a527bcf421410accbb74effe758eee728c152ac8", slot: "trailingAccessory", class: "gids-password-field__trailing-accessory" }, n && i(O, { key: "9a2aa3cd9bd7cb11dc48976e7bafa1ac9c86fde8", label: "clear text", size: "lg", onPressDismiss: this._handleDismiss }), a && i(F, { key: "d1b11a62438c98f74ce0c52b49ebd72727a42305", appearance: "default", size: "xs", width: "intrinsic", disabled: this.disabled, onClick: this._handleRevealPassword }, u ? "Hide" : "Show")))), i("div", { key: "2ba8e5b0e4c3fef3c19d151455cdefea6c619126", class: "gids-password-field__meters-container" }, i(ie, { key: "57b83f9ac75d5fac702b7992863ea6603fc48dd1", meterRules: _, text: this.value, textMinLength: c }), i(de, { key: "018f5c35f66b3d80aade1b827b323274b27fd7bb", requirements: this.requirementsMeterRequirements, text: this.value, textMinLength: c })));
|
|
194
|
+
}
|
|
195
|
+
get _el() {
|
|
196
|
+
return this;
|
|
197
|
+
}
|
|
198
|
+
static get watchers() {
|
|
199
|
+
return { requirements: [{ handleRequirementsChange: 0 }], textMinLength: [{ handleRequirementsChange: 0 }] };
|
|
200
|
+
}
|
|
201
|
+
}, [260, "gids-password-field", { label: [513], showClearButton: [516, "show-clear-button"], showRevealPasswordButton: [516, "show-reveal-password-button"], helperText: [513, "helper-text"], statusText: [513, "status-text"], status: [513], loading: [516], name: [513], required: [516], maxLength: [514, "maxlength"], value: [1], defaultValue: [513, "default-value"], disabled: [516], readOnly: [516, "readonly"], inputProps: [16], fieldRequirement: [513, "field-requirement"], fieldRequirementOptionalText: [1, "field-requirement-optional-text"], fieldRequirementRequiredText: [1, "field-requirement-required-text"], isLabelSentence: [16], textMinLength: [514, "text-min-length"], requirements: [16], isPasswordRevealed: [32], meterRules: [32], requirementsMeterRequirements: [32] }, void 0, { requirements: [{ handleRequirementsChange: 0 }], textMinLength: [{ handleRequirementsChange: 0 }] }]);
|
|
202
|
+
function y() {
|
|
203
|
+
typeof customElements < "u" && ["gids-password-field", "gids-field", "gids-input"].forEach(((e) => {
|
|
204
|
+
switch (e) {
|
|
205
|
+
case "gids-password-field":
|
|
206
|
+
customElements.get(h(e)) || customElements.define(h(e), M);
|
|
207
|
+
break;
|
|
208
|
+
case "gids-field":
|
|
209
|
+
customElements.get(h(e)) || E();
|
|
210
|
+
break;
|
|
211
|
+
case "gids-input":
|
|
212
|
+
customElements.get(h(e)) || G();
|
|
213
|
+
}
|
|
214
|
+
}));
|
|
215
|
+
}
|
|
216
|
+
y();
|
|
217
|
+
const _e = M, we = y;
|
|
218
|
+
export {
|
|
219
|
+
_e as GidsPasswordField,
|
|
220
|
+
we as defineCustomElement
|
|
221
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { C as i, f as c, R as t, H as s } from "./p-ibikYq-w-BsGxk8ro.js";
|
|
2
|
+
import { i as a } from "./p-B2zUuNXz-BLBgQDu7.js";
|
|
3
|
+
import { c as n } from "./clsx-OuTLNxxd.js";
|
|
4
|
+
const l = (e) => n("gids-scrim", e), d = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
5
|
+
__proto__: null,
|
|
6
|
+
getGidsScrimClassNames: l
|
|
7
|
+
}, Symbol.toStringTag, { value: "Module" })), { getGidsScrimClassNames: m } = d, o = i(class extends c {
|
|
8
|
+
constructor(e) {
|
|
9
|
+
super(), e !== !1 && this.__registerHost(), this.__attachShadow();
|
|
10
|
+
}
|
|
11
|
+
connectedCallback() {
|
|
12
|
+
const e = a();
|
|
13
|
+
e !== void 0 && this._el.shadowRoot?.adoptedStyleSheets.push(e);
|
|
14
|
+
}
|
|
15
|
+
render() {
|
|
16
|
+
return t("div", { key: "befcd12706dbf780586972ee76bda7d7a64e8702", class: m(this.extraClasses) }, t("slot", { key: "a7bf7c4732706d7bc954d5160b6154868a785913" }));
|
|
17
|
+
}
|
|
18
|
+
get _el() {
|
|
19
|
+
return this;
|
|
20
|
+
}
|
|
21
|
+
static get style() {
|
|
22
|
+
return ".gids-scrim{display:flex;flex-direction:column;background-color:var(--gids-color-background-scrim);height:100vh !important;position:absolute;top:0;bottom:0;left:0;right:0;z-index:1001;align-items:center;justify-content:center;backdrop-filter:blur(calc(var(24px) / 2))}";
|
|
23
|
+
}
|
|
24
|
+
}, [257, "gids-scrim", { extraClasses: [513, "extra-classes"] }]);
|
|
25
|
+
function r() {
|
|
26
|
+
typeof customElements < "u" && ["gids-scrim"].forEach(((e) => {
|
|
27
|
+
e === "gids-scrim" && (customElements.get(s(e)) || customElements.define(s(e), o));
|
|
28
|
+
}));
|
|
29
|
+
}
|
|
30
|
+
r();
|
|
31
|
+
const b = o, p = r;
|
|
32
|
+
export {
|
|
33
|
+
b as GidsScrim,
|
|
34
|
+
p as defineCustomElement
|
|
35
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { C as a, f as o, H as s } from "./p-ibikYq-w-BsGxk8ro.js";
|
|
2
|
+
import { e as i } from "./p-CVtNa0cL-sSVeJsR3.js";
|
|
3
|
+
const e = a(class extends o {
|
|
4
|
+
constructor(t) {
|
|
5
|
+
super(), t !== !1 && this.__registerHost(), this.__attachShadow(), this.appearance = "default", this.show = !1, this.position = "bottom-center";
|
|
6
|
+
}
|
|
7
|
+
async showSnackbar() {
|
|
8
|
+
const t = i(this._el);
|
|
9
|
+
t && this.show && t.queueComponent({ message: this.message, appearance: this.appearance, buttonLabel: this.buttonLabel, onButtonClick: this.onButtonClick, position: this.position, componentName: "snackbar", timerInMs: this.timerInMs }), this.onQueueSnackbar && this.onQueueSnackbar(), this.show = !1;
|
|
10
|
+
}
|
|
11
|
+
render() {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
get _el() {
|
|
15
|
+
return this;
|
|
16
|
+
}
|
|
17
|
+
static get watchers() {
|
|
18
|
+
return { show: [{ showSnackbar: 0 }] };
|
|
19
|
+
}
|
|
20
|
+
}, [1, "gids-snackbar", { message: [513], appearance: [513], show: [516], onQueueSnackbar: [16], buttonLabel: [513, "button-label"], position: [513], timerInMs: [514, "timer-in-ms"], onButtonClick: [16] }, void 0, { show: [{ showSnackbar: 0 }] }]);
|
|
21
|
+
function n() {
|
|
22
|
+
typeof customElements < "u" && ["gids-snackbar"].forEach(((t) => {
|
|
23
|
+
t === "gids-snackbar" && (customElements.get(s(t)) || customElements.define(s(t), e));
|
|
24
|
+
}));
|
|
25
|
+
}
|
|
26
|
+
n();
|
|
27
|
+
const h = e, u = n;
|
|
28
|
+
export {
|
|
29
|
+
h as GidsSnackbar,
|
|
30
|
+
u as defineCustomElement
|
|
31
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { C as u, f as c, V as h, N as f, R as i, H as s } from "./p-ibikYq-w-BsGxk8ro.js";
|
|
2
|
+
import { i as b } from "./p-B2zUuNXz-BLBgQDu7.js";
|
|
3
|
+
import { o as m, n as p } from "./p-DijVkS9b-CtFkEtlE.js";
|
|
4
|
+
import { h as g } from "./p-BplPYg8z-B8uAAfo4.js";
|
|
5
|
+
import { r as x } from "./p-BVh4zbX4-C4UJ8LPX.js";
|
|
6
|
+
import { g as _ } from "./p-veoOgDXg-DElc87c0.js";
|
|
7
|
+
const v = (e, t) => {
|
|
8
|
+
if (!(e === void 0 || t === void 0))
|
|
9
|
+
return `${e} / ${Math.max(t, 0)}`;
|
|
10
|
+
}, T = (e) => {
|
|
11
|
+
switch (e) {
|
|
12
|
+
case "error":
|
|
13
|
+
return "error";
|
|
14
|
+
case "success":
|
|
15
|
+
return "success";
|
|
16
|
+
default:
|
|
17
|
+
return "default";
|
|
18
|
+
}
|
|
19
|
+
}, n = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
20
|
+
__proto__: null,
|
|
21
|
+
formatCharCount: v,
|
|
22
|
+
inputToGidsFieldStatus: T
|
|
23
|
+
}, Symbol.toStringTag, { value: "Module" })), { inputToGidsFieldStatus: y } = n, q = (e) => e === "implicit" || e === void 0 ? "implicit" : y(e), C = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
24
|
+
__proto__: null,
|
|
25
|
+
inputToGidsFieldStatus: q
|
|
26
|
+
}, Symbol.toStringTag, { value: "Module" })), { formatCharCount: F } = n, { inputToGidsFieldStatus: O } = C, l = u(class extends c {
|
|
27
|
+
constructor(e) {
|
|
28
|
+
super(), e !== !1 && this.__registerHost(), this.gidsTextFieldClear = h(this, "gidsTextFieldClear"), this.#e = _(), this._handleDismiss = () => {
|
|
29
|
+
const t = this.#t?.querySelector("input.gids-input__control");
|
|
30
|
+
t && (t.value = "", t.dispatchEvent(new globalThis.Event("input", { bubbles: !0 }))), this.value = "", this.gidsTextFieldClear.emit();
|
|
31
|
+
}, this._handleInput = (t) => {
|
|
32
|
+
this.value = t.target?.value;
|
|
33
|
+
}, this._handleInputFocusAndBlur = (t) => {
|
|
34
|
+
this._el.dispatchEvent(new FocusEvent(t.type, { relatedTarget: t.relatedTarget }));
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
_startSlotContentObserver() {
|
|
38
|
+
this._slotContentObserver = new MutationObserver((() => {
|
|
39
|
+
f(this);
|
|
40
|
+
})), this._slotContentObserver.observe(this._el, { childList: !0, subtree: !1, attributes: !0, attributeFilter: ["slot"] });
|
|
41
|
+
}
|
|
42
|
+
connectedCallback() {
|
|
43
|
+
const e = b();
|
|
44
|
+
e !== void 0 && this._el.shadowRoot?.adoptedStyleSheets.push(e), this._startSlotContentObserver();
|
|
45
|
+
}
|
|
46
|
+
disconnectedCallback() {
|
|
47
|
+
this._slotContentObserver?.disconnect(), this._slotContentObserver = void 0;
|
|
48
|
+
}
|
|
49
|
+
#e;
|
|
50
|
+
#t;
|
|
51
|
+
render() {
|
|
52
|
+
const { id: e, ...t } = this.inputProps ?? {}, a = e ?? this.#e, d = this.showClearButton && this.value !== void 0 && this.value.length > 0;
|
|
53
|
+
return i("gids-field", { key: "7aa5bbe489adc1310365d37aac41ca9772fa1d0f", disabled: this.disabled, count: F(this.value?.length, this.maxLength), helperText: this.helperText, statusText: this.statusText, status: O(this.status) }, i(p, { key: "5a9bf6cfe25a0800b466a0aaccd21ac80aca59bb", slot: "label", disabled: this.disabled, info: i("slot", { name: "info" }), fieldRequirement: this.fieldRequirement, fieldRequirementOptionalText: this.fieldRequirementOptionalText, fieldRequirementRequiredText: this.fieldRequirementRequiredText, isLabelSentence: this.isLabelSentence, htmlFor: a }, this.label), i("gids-input", { key: "53f0d81f5227ed7a872ec9acebb559d21c4adc6e", ref: (o) => this.#t = o, appearance: this.appearance, status: this.status, loading: this.loading, value: this.value, defaultValue: this.defaultValue, name: this.name, required: this.required, disabled: this.disabled, readOnly: this.readOnly, leadingLabel: this.leadingLabel, trailingLabel: this.trailingLabel, onFocus: this._handleInputFocusAndBlur, onBlur: this._handleInputFocusAndBlur, onInput: this._handleInput, inputProps: { ...t, type: this.type, id: a, maxLength: this.maxLength } }, i("slot", { key: "42a2856da9b6d31452fc3fb199eacb336bff3475", name: "leadingIcon" }), i("slot", { key: "3b5cbe26cc943ffeab09231a7d7df750f7b473f7", name: "leadingAccessory" }), d && i(m, { key: "51a7942f8e31430bf1d74abad31049e9ad11f92e", label: "clear text", slot: "trailingAccessory", size: "lg", onPressDismiss: this._handleDismiss }), i("slot", { key: "ae4eccacb0f60d70b57e5df949f7a0dbc9098654", name: "trailingIcon" })));
|
|
54
|
+
}
|
|
55
|
+
get _el() {
|
|
56
|
+
return this;
|
|
57
|
+
}
|
|
58
|
+
}, [260, "gids-text-field", { label: [513], showClearButton: [516, "show-clear-button"], helperText: [513, "helper-text"], statusText: [513, "status-text"], appearance: [513], status: [513], leadingLabel: [513, "leading-label"], trailingLabel: [513, "trailing-label"], loading: [516], type: [513], name: [513], required: [516], maxLength: [514, "maxlength"], value: [1], defaultValue: [513, "default-value"], disabled: [516], readOnly: [516, "readonly"], inputProps: [16], fieldRequirement: [513, "field-requirement"], fieldRequirementOptionalText: [1, "field-requirement-optional-text"], fieldRequirementRequiredText: [1, "field-requirement-required-text"], isLabelSentence: [16] }]);
|
|
59
|
+
function r() {
|
|
60
|
+
typeof customElements < "u" && ["gids-text-field", "gids-field", "gids-input"].forEach(((e) => {
|
|
61
|
+
switch (e) {
|
|
62
|
+
case "gids-text-field":
|
|
63
|
+
customElements.get(s(e)) || customElements.define(s(e), l);
|
|
64
|
+
break;
|
|
65
|
+
case "gids-field":
|
|
66
|
+
customElements.get(s(e)) || g();
|
|
67
|
+
break;
|
|
68
|
+
case "gids-input":
|
|
69
|
+
customElements.get(s(e)) || x();
|
|
70
|
+
}
|
|
71
|
+
}));
|
|
72
|
+
}
|
|
73
|
+
r();
|
|
74
|
+
const I = l, G = r;
|
|
75
|
+
export {
|
|
76
|
+
I as GidsTextField,
|
|
77
|
+
G as defineCustomElement
|
|
78
|
+
};
|
|
@@ -1,48 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
"gids-spinner-control--sm": e === "sm",
|
|
6
|
-
// 'gids-spinner-control--md': size === 'md',
|
|
7
|
-
"gids-spinner-control--lg": e === "lg",
|
|
8
|
-
"gids-spinner-control--xl": e === "xl",
|
|
9
|
-
"gids-spinner-control--2xl": e === "2xl",
|
|
10
|
-
"gids-spinner-control--determinate": t === !1
|
|
11
|
-
}, n, i), D = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
12
|
-
__proto__: null,
|
|
13
|
-
getGidsSpinnerControlClassNames: z
|
|
14
|
-
}, Symbol.toStringTag, { value: "Module" })), G = ({ appearance: e, size: t, width: n, destructive: i, loading: l }, o, a) => _("gids-button", {
|
|
15
|
-
"gids-button--primary": e === "primary",
|
|
16
|
-
"gids-button--subtle": e === "subtle",
|
|
17
|
-
"gids-button--xs": t === "xs",
|
|
18
|
-
"gids-button--sm": t === "sm",
|
|
19
|
-
// 'gids-button--md': size === 'md',
|
|
20
|
-
"gids-button--lg": t === "lg",
|
|
21
|
-
"gids-button--full-width": n === "full",
|
|
22
|
-
"gids-button--destructive": i,
|
|
23
|
-
"gids-button--icon-only": o,
|
|
24
|
-
"gids-button--loading": l
|
|
25
|
-
}, a), N = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
26
|
-
__proto__: null,
|
|
27
|
-
getGidsButtonClassNames: G
|
|
28
|
-
}, Symbol.toStringTag, { value: "Module" })), r = 64, y = 10, x = r / 2 - y / 2, L = r / 2, u = 2 * Math.PI * x, P = `0 0 ${r} ${r}`, T = (e = 0, t) => {
|
|
29
|
-
const n = typeof t == "number" && t > 0 ? t : 1, l = Math.max(0, Math.min(n, e)) / n * 100, o = (u * l / 100).toFixed(2), a = (u - parseFloat(o)).toFixed(2);
|
|
30
|
-
return `${o} ${a}`;
|
|
31
|
-
}, A = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
32
|
-
__proto__: null,
|
|
33
|
-
calculateStrokeDasharray: T,
|
|
34
|
-
centerPosition: L,
|
|
35
|
-
circumference: u,
|
|
36
|
-
radius: x,
|
|
37
|
-
thickness: y,
|
|
38
|
-
viewBox: P
|
|
39
|
-
}, Symbol.toStringTag, { value: "Module" })), b = (e) => e !== void 0 && (!Array.isArray(e) || e.length > 0), { getGidsSpinnerControlClassNames: F } = D, { calculateStrokeDasharray: H, thickness: f, radius: m, centerPosition: c, viewBox: V } = A, R = ({ size: e, indeterminate: t, value: n, max: i, ...l }) => {
|
|
40
|
-
let o;
|
|
41
|
-
return t || (o = { strokeDashArray: H(n, i || 0), strokeDashoffset: "0" }), s("svg", { class: F({ size: e, indeterminate: t, value: n }), viewBox: V, ...l }, s("circle", { class: "gids-spinner-control__track", cx: c, cy: c, r: m, "stroke-width": f }), s("circle", { style: o, class: "gids-spinner-control__progress", cx: c, cy: c, r: m, "stroke-width": f }));
|
|
42
|
-
}, { getGidsButtonClassNames: q } = N, J = ({ appearance: e, size: t, destructive: n, loading: i, width: l, leadingIcon: o, trailingIcon: a, as: w, disabled: S, class: I, forceIconOnly: C = !1, ...d }, h) => {
|
|
43
|
-
const g = w || "button", E = t === "lg" || t === void 0 ? "md" : t;
|
|
44
|
-
return g !== "button" || "type" in d || (d.type = "button"), s(g, { class: q({ appearance: e, size: t, destructive: n, loading: i, width: l }, C || h.length === 0 && b(o) && !b(a), I), disabled: g === "button" ? S : void 0, ...d }, s("span", { class: "gids-button__content" }, o, h), i && s(R, { size: E, indeterminate: !0 }), a);
|
|
45
|
-
}, v = O(class extends M {
|
|
1
|
+
import { C as l, f as n, V as d, R as t, D as a, H as s } from "./p-ibikYq-w-BsGxk8ro.js";
|
|
2
|
+
import { a as c } from "./p-CWdkmFbc-D89ZE8Mi.js";
|
|
3
|
+
import { i as h } from "./p-B2zUuNXz-BLBgQDu7.js";
|
|
4
|
+
const i = l(class extends n {
|
|
46
5
|
get selected() {
|
|
47
6
|
return this.#e ?? this.defaultSelected;
|
|
48
7
|
}
|
|
@@ -50,11 +9,11 @@ const z = ({ size: e, indeterminate: t, value: n }, i) => _("gids-spinner-contro
|
|
|
50
9
|
this.#e = e === void 0 ? void 0 : !!e;
|
|
51
10
|
}
|
|
52
11
|
constructor(e) {
|
|
53
|
-
super(), e !== !1 && this.__registerHost(), this.__attachShadow(), this.select =
|
|
12
|
+
super(), e !== !1 && this.__registerHost(), this.__attachShadow(), this.select = d(this, "select"), this._toggle = this._toggle.bind(this);
|
|
54
13
|
}
|
|
55
14
|
#e;
|
|
56
15
|
connectedCallback() {
|
|
57
|
-
const e =
|
|
16
|
+
const e = h();
|
|
58
17
|
e !== void 0 && this._el.shadowRoot?.adoptedStyleSheets.push(e);
|
|
59
18
|
}
|
|
60
19
|
_toggle() {
|
|
@@ -62,9 +21,9 @@ const z = ({ size: e, indeterminate: t, value: n }, i) => _("gids-spinner-contro
|
|
|
62
21
|
this._el.selected = e, this.select?.emit(e);
|
|
63
22
|
}
|
|
64
23
|
render() {
|
|
65
|
-
return
|
|
24
|
+
return t(a, { key: "629bf94de5dcf8979c4c52f749e6f1528506cb7f" }, t("style", { key: "45b2ada2ba3e26b574f7c34675622db5352802d2" }, `:host {
|
|
66
25
|
display: ${this.width === "full" ? "block" : "inline-block"}
|
|
67
|
-
}`),
|
|
26
|
+
}`), t(c, { key: "2f93e85e5dbf968c09c245e71a41a9b587ead04c", appearance: this.appearance, size: this.size, width: this.width, disabled: this.disabled, onClick: this._toggle, "aria-pressed": this.selected ? "true" : "false", leadingIcon: t("slot", { name: "leadingIcon" }), trailingIcon: t("slot", { name: "trailingIcon" }), forceIconOnly: this._onlyHasLeadingIcon() }, t("slot", { key: "599d014741a1d931f44976866e92837ed2184e5f" })));
|
|
68
27
|
}
|
|
69
28
|
_onlyHasLeadingIcon() {
|
|
70
29
|
const e = this._el.childNodes;
|
|
@@ -74,14 +33,14 @@ const z = ({ size: e, indeterminate: t, value: n }, i) => _("gids-spinner-contro
|
|
|
74
33
|
return this;
|
|
75
34
|
}
|
|
76
35
|
}, [257, "gids-toggle-button", { disabled: [516], appearance: [513], size: [513], width: [513], defaultSelected: [516, "default-selected"], selected: [6660] }]);
|
|
77
|
-
function
|
|
36
|
+
function o() {
|
|
78
37
|
typeof customElements < "u" && ["gids-toggle-button"].forEach(((e) => {
|
|
79
|
-
e === "gids-toggle-button" && (customElements.get(
|
|
38
|
+
e === "gids-toggle-button" && (customElements.get(s(e)) || customElements.define(s(e), i));
|
|
80
39
|
}));
|
|
81
40
|
}
|
|
82
|
-
|
|
83
|
-
const
|
|
41
|
+
o();
|
|
42
|
+
const u = i, b = o;
|
|
84
43
|
export {
|
|
85
|
-
|
|
86
|
-
|
|
44
|
+
u as GidsToggleButton,
|
|
45
|
+
b as defineCustomElement
|
|
87
46
|
};
|
package/dist-bundled/es/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { w as n, a as f, j as P, F as A, b as G } from "./p-ibikYq-w-BsGxk8ro.js";
|
|
2
|
+
import { i as l, n as m } from "./p-B2zUuNXz-BLBgQDu7.js";
|
|
2
3
|
import { s as a } from "./assets-Drv1fXkA.js";
|
|
3
4
|
function t(s, e) {
|
|
4
5
|
a(s, e);
|
|
@@ -10,13 +11,13 @@ const r = (s) => {
|
|
|
10
11
|
};
|
|
11
12
|
export {
|
|
12
13
|
n as getAssetPath,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
l as getConstructedGidsStylesheet,
|
|
15
|
+
m as refreshConstructedGidsStylesheet,
|
|
16
|
+
f as render,
|
|
17
|
+
P as setAssetPath,
|
|
17
18
|
r as setGidsAssetFilePaths,
|
|
18
19
|
t as setGidsAssetPaths,
|
|
19
20
|
i as setGidsDefaultAssetDirPath,
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
A as setNonce,
|
|
22
|
+
G as setPlatformOptions
|
|
22
23
|
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
const l = globalThis.CSSStyleSheet !== void 0 ? new CSSStyleSheet() : void 0;
|
|
2
|
+
let a = !1;
|
|
3
|
+
l && document.adoptedStyleSheets ? document.adoptedStyleSheets.push(l) : console.warn("CSSStyleSheet is not defined. Omitting constructed stylesheet behaviour.");
|
|
4
|
+
let u = null;
|
|
5
|
+
const d = globalThis.MutationObserver !== void 0 ? new MutationObserver((() => {
|
|
6
|
+
h();
|
|
7
|
+
})) : void 0, h = () => {
|
|
8
|
+
if (l === void 0) return !1;
|
|
9
|
+
const i = (() => {
|
|
10
|
+
if (l === void 0) return;
|
|
11
|
+
const o = [];
|
|
12
|
+
for (let n = 0; n < document.styleSheets.length; n++) {
|
|
13
|
+
const t = document.styleSheets.item(n);
|
|
14
|
+
if (t) try {
|
|
15
|
+
let e = -1, r = 0;
|
|
16
|
+
for (let s = 0; s < t.cssRules.length; s++) {
|
|
17
|
+
const c = t.cssRules.item(s);
|
|
18
|
+
if (c?.cssText.startsWith("gids-global-styles-start")) e = s;
|
|
19
|
+
else if (e > -1) {
|
|
20
|
+
if (c?.cssText.startsWith("gids-global-styles-end")) {
|
|
21
|
+
r = s - e + 1;
|
|
22
|
+
break;
|
|
23
|
+
}
|
|
24
|
+
o.push(c);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
if (e > -1) return { rulesStartIndex: e, originalRulesCount: r, rules: o, styleSheet: t };
|
|
28
|
+
} catch (e) {
|
|
29
|
+
if (!(e instanceof DOMException)) throw e;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
})();
|
|
33
|
+
if (i !== void 0) {
|
|
34
|
+
const o = i.styleSheet.ownerNode;
|
|
35
|
+
return d !== void 0 && o !== u && (u && d.disconnect(), o instanceof Element && d.observe(o, { childList: !0, characterData: !0, subtree: !0 }), u = o), l.replaceSync(((n) => n.rules.map(((t) => t.cssText)).join(""))(i)), ((n) => {
|
|
36
|
+
const { rulesStartIndex: t, originalRulesCount: e, styleSheet: r } = n;
|
|
37
|
+
for (let s = 0; s < e; s++) r.deleteRule(t);
|
|
38
|
+
})(i), !0;
|
|
39
|
+
}
|
|
40
|
+
return console.warn("refreshConstructedGidsStylesheet: Gids stylesheet is not found in document."), !1;
|
|
41
|
+
}, S = () => (a || (a = h()), l);
|
|
42
|
+
export {
|
|
43
|
+
S as i,
|
|
44
|
+
h as n
|
|
45
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { H as s, C as l, f as d, R as a, L as u } from "./p-ibikYq-w-BsGxk8ro.js";
|
|
2
|
+
import { d as n } from "./p-veoOgDXg-DElc87c0.js";
|
|
3
|
+
import { l as r } from "./p-DybsMR13-DpmsG3Q1.js";
|
|
4
|
+
const c = (e) => e.type === "hidden", f = (e) => {
|
|
5
|
+
if (!(e instanceof HTMLElement))
|
|
6
|
+
return !1;
|
|
7
|
+
const { nodeName: t } = e;
|
|
8
|
+
return !!([
|
|
9
|
+
"BUTTON",
|
|
10
|
+
"DETAILS",
|
|
11
|
+
"EMBED",
|
|
12
|
+
"IFRAME",
|
|
13
|
+
"KEYGEN",
|
|
14
|
+
"LABEL",
|
|
15
|
+
"SELECT",
|
|
16
|
+
"TEXTAREA"
|
|
17
|
+
].includes(t) || t === "A" && e.hasAttribute("href") || e instanceof HTMLInputElement && !c(e) || ["AUDIO", "VIDEO"].includes(t) && e.hasAttribute("controls") || ["IMG", "OBJECT"].includes(t) && e.hasAttribute("usemap") || e.hasAttribute("tabindex") && e.tabIndex > -1);
|
|
18
|
+
}, o = l(class extends d {
|
|
19
|
+
constructor(e) {
|
|
20
|
+
super(), e !== !1 && this.__registerHost(), this.#e = {}, this._focusInput = (t) => {
|
|
21
|
+
const i = t.target;
|
|
22
|
+
i === this.#t || this._isWithinInteractiveElement(i) || this.#t?.focus();
|
|
23
|
+
}, this._handleInputFocusAndBlur = (t) => {
|
|
24
|
+
this._el.dispatchEvent(new FocusEvent(t.type, { relatedTarget: t.relatedTarget }));
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
get defaultValue() {
|
|
28
|
+
return this.#t?.defaultValue ?? this.#e.defaultValue ?? "";
|
|
29
|
+
}
|
|
30
|
+
set defaultValue(e) {
|
|
31
|
+
this.#t ? this.#t.defaultValue = e : this.#e.defaultValue = e;
|
|
32
|
+
}
|
|
33
|
+
get value() {
|
|
34
|
+
return this.#t?.value ?? this.#e.value ?? this.#e.defaultValue ?? "";
|
|
35
|
+
}
|
|
36
|
+
set value(e) {
|
|
37
|
+
this.#t ? this.#t.value = e : this.#e.value = e;
|
|
38
|
+
}
|
|
39
|
+
#t;
|
|
40
|
+
#e;
|
|
41
|
+
_isWithinInteractiveElement(e) {
|
|
42
|
+
if (e === null || e === this._el || !this._el.contains(e)) return !1;
|
|
43
|
+
if (f(e)) return !0;
|
|
44
|
+
{
|
|
45
|
+
const t = e.parentElement;
|
|
46
|
+
if (t) return this._isWithinInteractiveElement(t);
|
|
47
|
+
}
|
|
48
|
+
return !1;
|
|
49
|
+
}
|
|
50
|
+
connectedCallback() {
|
|
51
|
+
this._el.addEventListener("click", this._focusInput);
|
|
52
|
+
}
|
|
53
|
+
disconnectedCallback() {
|
|
54
|
+
this._el.removeEventListener("click", this._focusInput);
|
|
55
|
+
}
|
|
56
|
+
render() {
|
|
57
|
+
return a(u, { key: "281c832656cace745109fdd8208fe24b90f2c126" }, a("slot", { key: "5f8424a1d9bc196e3efee9d1e5d099bed15ddb4b", name: "leadingIcon" }), this.leadingLabel && a("span", { key: "2ce161a38f74618d60f38028c646c80e361aeced", class: "gids-input__label" }, this.leadingLabel), a("slot", { key: "12383525faf774eef618705cf68338a4fc9c9e55", name: "leadingAccessory" }), a("input", { key: "19de1aa1ad2a47db2979dfcbbf9b8e49d045f5af", ...this.inputProps, ref: (e) => {
|
|
58
|
+
this.#t = e, this.#e.value !== void 0 && (this.#t.value = this.#e.value, delete this.#e.value), this.#e.defaultValue !== void 0 && (this.#t.defaultValue = this.#e.defaultValue, delete this.#e.defaultValue);
|
|
59
|
+
}, class: "gids-input__control", name: this.name, disabled: this.disabled, readOnly: this.readOnly, required: this.required, onFocus: this._handleInputFocusAndBlur, onBlur: this._handleInputFocusAndBlur }), a("slot", { key: "3e0f6ae8c23b2536891ddd0adb7be1215d86ac66", name: "trailingAccessory" }), this.trailingLabel && a("span", { key: "9b2ac9fbf6c198dd0a4e1decf4631b2b46902587", class: "gids-input__label" }, this.trailingLabel), a("slot", { key: "d9848f786ce38136f1ad8c07d685215ede87f157", name: "trailingIcon" }), this.status === "incomplete" && a(n, { key: "bc8bcc01f07bd345b448f4662a37b28d8029a94f", name: "warning", appearance: "filled", class: "gids-input__warning-icon" }), this.status === "complete" && a(n, { key: "cafc44041a1d4eac859face7ec5eea2ced1ca3f5", name: "positive", appearance: "filled", class: "gids-input__positive-icon" }), this.loading && a(r, { key: "0daca638742b098d06da6cd9a7b9cfd6e9c90921", size: "md", indeterminate: !0 }));
|
|
60
|
+
}
|
|
61
|
+
get _el() {
|
|
62
|
+
return this;
|
|
63
|
+
}
|
|
64
|
+
}, [260, "gids-input", { appearance: [513], defaultValue: [6657, "default-value"], disabled: [516], inputProps: [16], leadingLabel: [513, "leading-label"], trailingLabel: [513, "trailing-label"], loading: [516], name: [513], readOnly: [516, "readonly"], required: [516], status: [513], value: [6145] }]);
|
|
65
|
+
function h() {
|
|
66
|
+
typeof customElements < "u" && ["gids-input"].forEach(((e) => {
|
|
67
|
+
e === "gids-input" && (customElements.get(s(e)) || customElements.define(s(e), o));
|
|
68
|
+
}));
|
|
69
|
+
}
|
|
70
|
+
h();
|
|
71
|
+
export {
|
|
72
|
+
o as l,
|
|
73
|
+
h as r
|
|
74
|
+
};
|