@ganpatiinfo/gids-core-web 3.1.0 → 4.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 +847 -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.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-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.js +1 -1
- package/dist/index.js +1 -1
- package/dist/p-B2zUuNXz.js +1 -0
- package/dist/p-CVtNa0cL.js +1 -0
- package/dist/p-CWdkmFbc.js +1 -0
- package/dist/p-D4xtPT_U.js +1 -0
- package/dist/p-DijVkS9b.js +1 -0
- package/dist/p-DybsMR13.js +1 -0
- package/dist/p-RqpjvEHh.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/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/_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/GidsSnackbar/GidsSnackbar.d.ts +15 -0
- package/dist/types/components/webComponents/GidsTextField/GidsTextField.d.ts +39 -0
- package/dist/types/components.d.ts +437 -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-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-CVtNa0cL-sSVeJsR3.js +15 -0
- package/dist-bundled/es/p-CWdkmFbc-D89ZE8Mi.js +24 -0
- package/dist-bundled/es/p-D4xtPT_U-04HkZiXU.js +181 -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-RqpjvEHh-BGGYsIBf.js +74 -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-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 +63 -7
- package/dist/p-CgujYzVX.js +0 -1
- package/dist-bundled/es/p-CgujYzVX-xo1axnk6.js +0 -465
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { H as l, C as n, f as r, R as o, D as d } from "./p-ibikYq-w-BsGxk8ro.js";
|
|
2
|
+
import { d as h } from "./p-veoOgDXg-DElc87c0.js";
|
|
3
|
+
import { i as c } from "./p-B2zUuNXz-BLBgQDu7.js";
|
|
4
|
+
import { c as _ } from "./clsx-OuTLNxxd.js";
|
|
5
|
+
const g = (t) => _("gids-field", t), u = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
6
|
+
__proto__: null,
|
|
7
|
+
getGidsFieldClassNames: g
|
|
8
|
+
}, Symbol.toStringTag, { value: "Module" })), { getGidsFieldClassNames: f } = u, p = n(class extends r {
|
|
9
|
+
constructor(t) {
|
|
10
|
+
super(), t !== !1 && this.__registerHost(), this.__attachShadow(), this.status = "implicit", this._hasLabel = !1, this._controlListenerTargets = [], this._controlTouched = !1, this._handleLabelSlotChange = () => {
|
|
11
|
+
this._hasLabel = (this._labelSlot?.assignedElements()?.length ?? 0) > 0;
|
|
12
|
+
}, this._setLabelSlot = (e) => {
|
|
13
|
+
this._labelSlot = e ?? void 0, this._handleLabelSlotChange();
|
|
14
|
+
}, this._setControlSlot = (e) => {
|
|
15
|
+
this._controlSlot = e ?? void 0, this._handleControlSlotChange();
|
|
16
|
+
}, this._handleControlSlotChange = () => {
|
|
17
|
+
const e = this._controlSlot?.assignedNodes({ flatten: !0 }) ?? [], s = this._findTextControl(e);
|
|
18
|
+
this._attachControlElement(s);
|
|
19
|
+
}, this._handleControlValueInput = (e) => {
|
|
20
|
+
if (!this._controlTouched) {
|
|
21
|
+
const s = e.target;
|
|
22
|
+
s instanceof HTMLInputElement && (s.type === "checkbox" || s.type === "radio") && (this._controlTouched = !0);
|
|
23
|
+
}
|
|
24
|
+
this._updateControlValidationState();
|
|
25
|
+
}, this._handleControlBlur = () => {
|
|
26
|
+
this._controlTouched = !0, this._updateControlValidationState();
|
|
27
|
+
}, this._handleControlInvalid = () => {
|
|
28
|
+
this._controlTouched = !0, this._updateControlValidationState();
|
|
29
|
+
}, this._handleFormReset = () => {
|
|
30
|
+
this._controlTouched = !1, this._updateControlValidationState();
|
|
31
|
+
}, this._handleFormSubmit = () => {
|
|
32
|
+
this._controlTouched = !0, this._updateControlValidationState();
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
_handleStatusChange() {
|
|
36
|
+
this._isImplicitStatus() || this._controlValidationMessage === void 0 ? this._updateControlValidationState() : this._controlValidationMessage = void 0;
|
|
37
|
+
}
|
|
38
|
+
connectedCallback() {
|
|
39
|
+
const t = c();
|
|
40
|
+
t !== void 0 && this._el.shadowRoot?.adoptedStyleSheets.push(t);
|
|
41
|
+
}
|
|
42
|
+
componentDidLoad() {
|
|
43
|
+
setTimeout((() => {
|
|
44
|
+
this._handleControlSlotChange(), this._handleLabelSlotChange();
|
|
45
|
+
}));
|
|
46
|
+
}
|
|
47
|
+
async reScanControl() {
|
|
48
|
+
this._handleControlSlotChange();
|
|
49
|
+
}
|
|
50
|
+
disconnectedCallback() {
|
|
51
|
+
this._detachControlElement(), this._detachFormListeners();
|
|
52
|
+
}
|
|
53
|
+
render() {
|
|
54
|
+
const t = this._hasStatusText(), e = this._controlValidationMessage !== void 0 ? this._controlValidationMessage : this._shouldRenderExplicitStatusText() ? this.statusText : void 0, s = this._getCurrentStatus(), i = ["gids-field__status-text"];
|
|
55
|
+
if (t) {
|
|
56
|
+
const a = this._getStatusModifierClass(s, "gids-field__status-text");
|
|
57
|
+
a != null && i.push(a);
|
|
58
|
+
}
|
|
59
|
+
return o(d, { key: "fed52ee2bacf334f4ec630fdaea5285d8aee56b3" }, o("div", { key: "fe65a5714ae0e8369a2e6d91f5ccbe37ce1b04b4", class: f() }, o("div", { key: "37d656971e39e9c26085b54fd253f9758e6110fa", class: "gids-field__header", hidden: !this._hasLabelContent() }, o("slot", { key: "eda62c8170fb5caf2e69f66bae079d1646a52ff8", ref: this._setLabelSlot, name: "label", onSlotchange: this._handleControlSlotChange }), o("div", { key: "28677c5ebd0e8bfb7f9f0c43634c9a70b84f4cd0", class: "gids-field__count", "aria-live": "polite" }, this.count)), o("div", { key: "0a816504a863304e13be74c64429b74700fc3590", class: "gids-field__control" }, o("slot", { key: "1081771bfb182da6b0527303132555458de3ff2e", ref: this._setControlSlot, onSlotchange: this._handleControlSlotChange })), o("p", { key: "632636f8c4d819b6c32658a7ae72ab9308973fda", class: "gids-field__supporting-text", hidden: !this._shouldShowHelperText() }, this.helperText), t ? o("p", { class: i.join(" "), role: "status", "aria-live": "polite" }, this._renderStatusIcon(s), e !== void 0 ? o("span", null, e) : null) : null));
|
|
60
|
+
}
|
|
61
|
+
_hasLabelContent() {
|
|
62
|
+
return this._hasLabel;
|
|
63
|
+
}
|
|
64
|
+
_hasHelperText() {
|
|
65
|
+
return this._hasText(this.helperText);
|
|
66
|
+
}
|
|
67
|
+
_shouldShowHelperText() {
|
|
68
|
+
return !!this._hasHelperText() && !this._hasStatusText();
|
|
69
|
+
}
|
|
70
|
+
_hasStatusText() {
|
|
71
|
+
return this._isImplicitStatus() ? this._controlValidationMessage !== void 0 : this._shouldRenderExplicitStatusText();
|
|
72
|
+
}
|
|
73
|
+
_shouldRenderExplicitStatusText() {
|
|
74
|
+
return !this._isImplicitStatus() && this.status !== "default" && this._hasText(this.statusText);
|
|
75
|
+
}
|
|
76
|
+
_renderStatusIcon(t) {
|
|
77
|
+
if (!this._hasStatusText()) return;
|
|
78
|
+
const e = this._getStatusIconName(t);
|
|
79
|
+
if (e === void 0) return;
|
|
80
|
+
const s = ["gids-field__status-icon"], i = this._getStatusModifierClass(t, "gids-field__status-icon");
|
|
81
|
+
i != null && s.push(i);
|
|
82
|
+
let a = t;
|
|
83
|
+
return t === "error" && (a = "danger"), t === "success" && (a = "positive"), o(h, { appearance: "filled", size: "sm", alt: "", name: e, class: s.join(" "), style: { "--gidsIcon-color": `var(--gids-color-icon-${a})` } });
|
|
84
|
+
}
|
|
85
|
+
_getCurrentStatus() {
|
|
86
|
+
return this._isImplicitStatus() && this._controlValidationMessage != null ? "error" : this.status ?? "implicit";
|
|
87
|
+
}
|
|
88
|
+
_getStatusIconName(t) {
|
|
89
|
+
if (t !== "implicit") return t === "success" ? "positive" : t === "error" ? "danger" : void 0;
|
|
90
|
+
}
|
|
91
|
+
_isImplicitStatus() {
|
|
92
|
+
return this.status === "implicit" || this.status === void 0;
|
|
93
|
+
}
|
|
94
|
+
_hasText(t) {
|
|
95
|
+
return typeof t == "string" && t.trim().length > 0;
|
|
96
|
+
}
|
|
97
|
+
_getStatusModifierClass(t, e) {
|
|
98
|
+
if (t !== "implicit") return `${e}--${t}`;
|
|
99
|
+
}
|
|
100
|
+
_attachControlElement(t) {
|
|
101
|
+
if (this._controlElement === t) return this._updateControlValidationState(), void this._attachFormListeners(t?.form ?? this._el.closest("form"));
|
|
102
|
+
if (this._detachControlElement(), this._controlElement = t, this._resetControlValidationState(), this._controlListenerTargets = [], t) {
|
|
103
|
+
const e = this._getControlListenerTargets(t);
|
|
104
|
+
this._controlListenerTargets = e, e.forEach(((s) => {
|
|
105
|
+
s.addEventListener("input", this._handleControlValueInput), s.addEventListener("change", this._handleControlValueInput), s.addEventListener("blur", this._handleControlBlur, !0), s.addEventListener("invalid", this._handleControlInvalid);
|
|
106
|
+
})), this._attachFormListeners(t.form ?? this._el.closest("form"));
|
|
107
|
+
}
|
|
108
|
+
this._updateControlValidationState();
|
|
109
|
+
}
|
|
110
|
+
_detachControlElement() {
|
|
111
|
+
this._controlListenerTargets.length > 0 && (this._controlListenerTargets?.forEach(((t) => {
|
|
112
|
+
t.removeEventListener("input", this._handleControlValueInput), t.removeEventListener("change", this._handleControlValueInput), t.removeEventListener("blur", this._handleControlBlur, !0), t.removeEventListener("invalid", this._handleControlInvalid);
|
|
113
|
+
})), this._controlListenerTargets = []), this._controlElement = null, this._resetControlValidationState(), this._detachFormListeners();
|
|
114
|
+
}
|
|
115
|
+
_getControlListenerTargets(t) {
|
|
116
|
+
return t instanceof HTMLInputElement && t.type === "radio" && t.name != null ? this._getRadioGroupControls(t) : [t];
|
|
117
|
+
}
|
|
118
|
+
_getRadioGroupControls(t) {
|
|
119
|
+
const e = t.form;
|
|
120
|
+
if (e && t.name != null) {
|
|
121
|
+
const s = e.elements.namedItem(t.name);
|
|
122
|
+
if (s instanceof RadioNodeList) {
|
|
123
|
+
const i = Array.from(s).filter(((a) => a instanceof HTMLInputElement && a.type === "radio" && this._el.contains(a)));
|
|
124
|
+
if (i.length > 0) return i;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
if (t.name != null) {
|
|
128
|
+
const s = `input[type="radio"][name="${CSS.escape(t.name)}"]`, i = Array.from(this._el.querySelectorAll(s));
|
|
129
|
+
if (i.length > 0) return i;
|
|
130
|
+
}
|
|
131
|
+
return [t];
|
|
132
|
+
}
|
|
133
|
+
_attachFormListeners(t) {
|
|
134
|
+
t !== void 0 && (t !== null ? t !== this._formElement && (this._detachFormListeners(), this._formElement = t, this._formElement.addEventListener("reset", this._handleFormReset), this._formElement.addEventListener("submit", this._handleFormSubmit)) : this._detachFormListeners());
|
|
135
|
+
}
|
|
136
|
+
_detachFormListeners() {
|
|
137
|
+
this._formElement && (this._formElement.removeEventListener("reset", this._handleFormReset), this._formElement.removeEventListener("submit", this._handleFormSubmit), this._formElement = null);
|
|
138
|
+
}
|
|
139
|
+
_findTextControl(t) {
|
|
140
|
+
for (const e of t) {
|
|
141
|
+
if (e.nodeType !== Node.ELEMENT_NODE) continue;
|
|
142
|
+
const s = e, i = this._asTextControl(s);
|
|
143
|
+
if (i !== null) return i;
|
|
144
|
+
const a = s.querySelector("input, textarea");
|
|
145
|
+
if (a instanceof HTMLInputElement || a instanceof HTMLTextAreaElement) return a;
|
|
146
|
+
}
|
|
147
|
+
return null;
|
|
148
|
+
}
|
|
149
|
+
_asTextControl(t) {
|
|
150
|
+
return t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement ? t : null;
|
|
151
|
+
}
|
|
152
|
+
_resetControlValidationState() {
|
|
153
|
+
this._controlTouched = !1, this._controlValidationMessage !== void 0 && (this._controlValidationMessage = void 0);
|
|
154
|
+
}
|
|
155
|
+
_updateControlValidationState() {
|
|
156
|
+
if (!this._isImplicitStatus()) return void (this._controlValidationMessage !== void 0 && (this._controlValidationMessage = void 0));
|
|
157
|
+
const t = this._controlElement;
|
|
158
|
+
if (!t || t.disabled) return void (this._controlValidationMessage !== void 0 && (this._controlValidationMessage = void 0));
|
|
159
|
+
const e = t.validationMessage?.trim() ?? "";
|
|
160
|
+
this._controlTouched && t.matches(":user-invalid") && e.length > 0 ? this._controlValidationMessage !== e && (this._controlValidationMessage = e) : this._controlValidationMessage !== void 0 && (this._controlValidationMessage = void 0);
|
|
161
|
+
}
|
|
162
|
+
get _el() {
|
|
163
|
+
return this;
|
|
164
|
+
}
|
|
165
|
+
static get watchers() {
|
|
166
|
+
return { status: [{ _handleStatusChange: 0 }] };
|
|
167
|
+
}
|
|
168
|
+
static get style() {
|
|
169
|
+
return ".gids-field{display:flex;flex-direction:column;gap:var(--gids-gap-075)}.gids-field__header{display:flex;gap:var(--gids-gap-100);align-items:flex-start}.gids-field__header[hidden]{display:none}.gids-field__count{margin-left:auto;color:var(--gids-color-text-subtle);text-align:right;white-space:nowrap;font-family:var(--gids-typography-label-x-small__font-family);font-size:var(--gids-typography-label-x-small__font-size);font-weight:var(--gids-typography-label-x-small__font-weight);letter-spacing:var(--gids-typography-label-x-small__letter-spacing);line-height:var(--gids-typography-label-x-small__line-height);text-transform:var(--gids-typography-label-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-x-small__font-variant-caps, inherit)}:host([disabled]) .gids-field__count{color:var(--gids-color-text-disabled)}.gids-field__control{display:flex;flex-direction:column;gap:var(--gids-gap-050)}.gids-field__supporting-text,.gids-field__status-text{margin:0;padding-top:var(--gids-padding-vertical-edge-to-element-050);font-family:var(--gids-typography-paragraph-x-small__font-family);font-size:var(--gids-typography-paragraph-x-small__font-size);font-weight:var(--gids-typography-paragraph-x-small__font-weight);letter-spacing:var(--gids-typography-paragraph-x-small__letter-spacing);line-height:var(--gids-typography-paragraph-x-small__line-height);text-transform:var(--gids-typography-paragraph-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-paragraph-x-small__font-variant-caps, inherit)}.gids-field__supporting-text{color:var(--gids-color-text-subtlest)}.gids-field__status-text{display:flex;align-items:flex-start;gap:var(--gids-gap-050)}.gids-field__status-text .gids-field__status-icon{margin-top:max(0px, -1 * (var(--gids-size-160) - var(--gids-typograpy-paragraph-x-small__line-height) * var(--gids-typograpy-paragraph-x-small__font-size)) / 2)}.gids-field__status-text>span{margin-top:max(0px, (var(--gids-size-160) - var(--gids-typograpy-paragraph-x-small__line-height) * var(--gids-typograpy-paragraph-x-small__font-size)) / 2)}.gids-field__status-icon{flex-shrink:0}.gids-field__status-text--information{color:var(--gids-color-text-information);--gids-field-status-icon-color:$icon-color}.gids-field__status-icon--information{--gidsIcon-color:$icon-color}.gids-field__status-text--success{color:var(--gids-color-text-positive);--gids-field-status-icon-color:$icon-color}.gids-field__status-icon--success{--gidsIcon-color:$icon-color}.gids-field__status-text--warning{color:var(--gids-color-text-warning);--gids-field-status-icon-color:$icon-color}.gids-field__status-icon--warning{--gidsIcon-color:$icon-color}.gids-field__status-text--error{color:var(--gids-color-text-danger);--gids-field-status-icon-color:$icon-color}.gids-field__status-icon--error{--gidsIcon-color:$icon-color}";
|
|
170
|
+
}
|
|
171
|
+
}, [257, "gids-field", { disabled: [516], count: [513], helperText: [513, "helper-text"], statusText: [513, "status-text"], status: [513], _controlValidationMessage: [32], _hasLabel: [32], reScanControl: [64] }, void 0, { status: [{ _handleStatusChange: 0 }] }]);
|
|
172
|
+
function m() {
|
|
173
|
+
typeof customElements < "u" && ["gids-field"].forEach(((t) => {
|
|
174
|
+
t === "gids-field" && (customElements.get(l(t)) || customElements.define(l(t), p));
|
|
175
|
+
}));
|
|
176
|
+
}
|
|
177
|
+
m();
|
|
178
|
+
export {
|
|
179
|
+
p as d,
|
|
180
|
+
m as h
|
|
181
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { R as o } from "./p-ibikYq-w-BsGxk8ro.js";
|
|
2
|
+
import { d as f } from "./p-veoOgDXg-DElc87c0.js";
|
|
3
|
+
import { c as u } from "./clsx-OuTLNxxd.js";
|
|
4
|
+
const _ = ({ disabled: e }, s) => u("gids-label", { "gids-label--disabled": e }, s), y = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
5
|
+
__proto__: null,
|
|
6
|
+
getGidsLabelClassNames: _
|
|
7
|
+
}, Symbol.toStringTag, { value: "Module" })), b = (e) => {
|
|
8
|
+
const s = Array.isArray(e) ? e[e.length - 1] : e;
|
|
9
|
+
return typeof s == "string" && s.trim().endsWith(".");
|
|
10
|
+
}, S = /\w/, h = (e) => e.replace(S, (s) => s.toLocaleUpperCase()), c = (e, s) => typeof e == "function" ? e(s) : s ? h(e) : e, C = ({ children: e, fieldRequirement: s, fieldRequirementOptionalText: t, fieldRequirementRequiredText: r, isLabelSentence: i }) => {
|
|
11
|
+
const n = i ? i(e) : b(e);
|
|
12
|
+
if (s === "required")
|
|
13
|
+
return c(r && r.length > 0 ? r : "(required)", n);
|
|
14
|
+
if (s === "optional")
|
|
15
|
+
return c(t && t.length > 0 ? t : "(optional)", n);
|
|
16
|
+
}, j = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
17
|
+
__proto__: null,
|
|
18
|
+
getIndicatorText: C,
|
|
19
|
+
isSentence: b
|
|
20
|
+
}, Symbol.toStringTag, { value: "Module" })), L = ({ appearance: e, size: s }, t) => u("gids-dismiss-button", {
|
|
21
|
+
"gids-dismiss-button--sm": s === "sm",
|
|
22
|
+
// 'gids-dismiss-button--md': size === 'md',
|
|
23
|
+
"gids-dismiss-button--lg": s === "lg",
|
|
24
|
+
"gids-dismiss-button--bold": e === "bold"
|
|
25
|
+
}, t), O = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
26
|
+
__proto__: null,
|
|
27
|
+
getGidsDismissButtonClassNames: L
|
|
28
|
+
}, Symbol.toStringTag, { value: "Module" })), { getIndicatorText: v } = j, { getGidsLabelClassNames: z } = y, T = ({ disabled: e, fieldRequirement: s, fieldRequirementOptionalText: t, fieldRequirementRequiredText: r, info: i, htmlFor: n, labelId: l, class: m, isLabelSentence: g, ...p }, a) => {
|
|
29
|
+
const d = v({ children: a, fieldRequirement: s, fieldRequirementOptionalText: t, fieldRequirementRequiredText: r, isLabelSentence: g });
|
|
30
|
+
return o("div", { class: z({ disabled: e }, m), ...p }, o("label", { htmlFor: n, id: l }, a, d && o("span", { class: "gids-label__field-requirement" }, d)), i);
|
|
31
|
+
}, { getGidsDismissButtonClassNames: F } = O, x = ({ appearance: e = "subtle", size: s = "md", disabled: t = !1, class: r, onPressDismiss: i, label: n, ...l }) => o("button", { class: F({ appearance: e, size: s }, r), onClick: i, disabled: t, "aria-label": n, ...l }, o(f, { name: "cross", appearance: "regular" }));
|
|
32
|
+
export {
|
|
33
|
+
T as n,
|
|
34
|
+
x as o
|
|
35
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { R as l } from "./p-ibikYq-w-BsGxk8ro.js";
|
|
2
|
+
import { c as x } from "./clsx-OuTLNxxd.js";
|
|
3
|
+
const f = ({ size: e, indeterminate: t, value: n }, r) => x("gids-spinner-control", {
|
|
4
|
+
"gids-spinner-control--xs": e === "xs",
|
|
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, r), h = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
12
|
+
__proto__: null,
|
|
13
|
+
getGidsSpinnerControlClassNames: f
|
|
14
|
+
}, Symbol.toStringTag, { value: "Module" })), c = 64, g = 10, u = c / 2 - g / 2, _ = c / 2, a = 2 * Math.PI * u, y = `0 0 ${c} ${c}`, k = (e = 0, t) => {
|
|
15
|
+
const n = typeof t == "number" && t > 0 ? t : 1, i = Math.max(0, Math.min(n, e)) / n * 100, o = (a * i / 100).toFixed(2), m = (a - parseFloat(o)).toFixed(2);
|
|
16
|
+
return `${o} ${m}`;
|
|
17
|
+
}, v = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
18
|
+
__proto__: null,
|
|
19
|
+
calculateStrokeDasharray: k,
|
|
20
|
+
centerPosition: _,
|
|
21
|
+
circumference: a,
|
|
22
|
+
radius: u,
|
|
23
|
+
thickness: g,
|
|
24
|
+
viewBox: y
|
|
25
|
+
}, Symbol.toStringTag, { value: "Module" })), { getGidsSpinnerControlClassNames: S } = h, { calculateStrokeDasharray: b, thickness: d, radius: p, centerPosition: s, viewBox: M } = v, P = ({ size: e, indeterminate: t, value: n, max: r, ...i }) => {
|
|
26
|
+
let o;
|
|
27
|
+
return t || (o = { strokeDashArray: b(n, r || 0), strokeDashoffset: "0" }), l("svg", { class: S({ size: e, indeterminate: t, value: n }), viewBox: M, ...i }, l("circle", { class: "gids-spinner-control__track", cx: s, cy: s, r: p, "stroke-width": d }), l("circle", { style: o, class: "gids-spinner-control__progress", cx: s, cy: s, r: p, "stroke-width": d }));
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
P as l
|
|
31
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { H as s, C as l, f as u, R as i, L as d } 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 u {
|
|
19
|
+
constructor(e) {
|
|
20
|
+
super(), e !== !1 && this.__registerHost(), this.#e = {}, this._focusInput = (t) => {
|
|
21
|
+
const a = t.target;
|
|
22
|
+
a === this.#t || this._isWithinInteractiveElement(a) || 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 i(d, { key: "9d1ed3749495c830b3940d4da09056620ccaef1d" }, i("slot", { key: "ae4b6e25b50e1b2fc04ff7eb1b2695437b25b974", name: "leadingIcon" }), this.leadingLabel && i("span", { key: "408038e8921dc443f14b5c57541d8ca74205e193", class: "gids-input__label" }, this.leadingLabel), i("slot", { key: "033b3c940545c99f3aa356e08267c77c25c0f89c", name: "leadingAccessory" }), i("input", { key: "d302436fe388ce84e775ee73c83723cd4bfb46b3", ...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 }), i("slot", { key: "85d41d8a06da0c88a6defe65eae2d6f1e69c3abd", name: "trailingAccessory" }), this.trailingLabel && i("span", { key: "1fec370bdb270031d6e3cdd9bed84871116be21f", class: "gids-input__label" }, this.trailingLabel), i("slot", { key: "65800ff524221d70b659901d440c5459e64975a8", name: "trailingIcon" }), this.status === "incomplete" && i(n, { key: "2bec2513415dad3294abc23ebcdc0493fa44399a", name: "warning", appearance: "filled", class: "gids-input__warning-icon" }), this.status === "complete" && i(n, { key: "2e21e9cb5ccfad300400c97dba89642395f84b04", name: "positive", appearance: "filled", class: "gids-input__positive-icon" }), this.loading && i(r, { key: "5fb23cf0b1e280cf7acd8ccd47c1a8d9611a1f19", 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
|
+
};
|