@nysds/nys-select 1.11.3 → 1.12.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.
@@ -1,12 +1,12 @@
1
- import { LitElement as f, html as v, unsafeCSS as _ } from "lit";
1
+ import { LitElement as v, html as f, unsafeCSS as _ } from "lit";
2
2
  import { property as o } from "lit/decorators.js";
3
3
  import { ifDefined as b } from "lit/directives/if-defined.js";
4
- var m = Object.defineProperty, p = (u, e, t, d) => {
5
- for (var l = void 0, s = u.length - 1, r; s >= 0; s--)
6
- (r = u[s]) && (l = r(e, t, l) || l);
4
+ var m = Object.defineProperty, u = (y, e, t, d) => {
5
+ for (var l = void 0, s = y.length - 1, r; s >= 0; s--)
6
+ (r = y[s]) && (l = r(e, t, l) || l);
7
7
  return l && m(e, t, l), l;
8
8
  };
9
- class h extends f {
9
+ class c extends v {
10
10
  constructor() {
11
11
  super(...arguments), this.disabled = !1, this.selected = !1, this.value = "", this.label = "", this.hidden = !1;
12
12
  }
@@ -18,7 +18,7 @@ class h extends f {
18
18
  });
19
19
  }
20
20
  render() {
21
- return v`
21
+ return f`
22
22
  <option
23
23
  ?disabled=${this.disabled}
24
24
  ?selected=${this.selected}
@@ -31,46 +31,37 @@ class h extends f {
31
31
  `;
32
32
  }
33
33
  }
34
- p([
34
+ u([
35
35
  o({ type: Boolean, reflect: !0 })
36
- ], h.prototype, "disabled");
37
- p([
36
+ ], c.prototype, "disabled");
37
+ u([
38
38
  o({ type: Boolean, reflect: !0 })
39
- ], h.prototype, "selected");
40
- p([
39
+ ], c.prototype, "selected");
40
+ u([
41
41
  o({ type: String })
42
- ], h.prototype, "value");
43
- p([
42
+ ], c.prototype, "value");
43
+ u([
44
44
  o({ type: String })
45
- ], h.prototype, "label");
46
- p([
45
+ ], c.prototype, "label");
46
+ u([
47
47
  o({ type: Boolean, reflect: !0 })
48
- ], h.prototype, "hidden");
49
- customElements.define("nys-option", h);
48
+ ], c.prototype, "hidden");
49
+ customElements.define("nys-option", c);
50
50
  const g = ':host{--_nys-select-width: 100%;--_nys-select-font-family: var( --nys-font-family-ui, var( --nys-font-family-sans, "Proxima Nova", "Helvetica Neue", "Helvetica", "Arial", sans-serif ) );--_nys-select-font-size: var(--nys-font-size-ui-md, 16px);--_nys-select-font-weight: var(--nys-font-weight-regular, 400);--_nys-select-line-height: var(--nys-font-lineheight-ui-md, 24px);--_nys-select-gap: var(--nys-space-50, 4px);--_nys-select-border-radius: var(--nys-radius-md, 4px);--_nys-select-padding: var(--nys-space-100, 8px) var(--nys-space-400, 32px) var(--nys-space-100, 8px) var(--nys-space-100, 8px);--_nys-select-color: var(--nys-color-text, #1b1b1b);--_nys-select-color--error: var( --nys-color-danger, var(--nys-color-red-600, #b52c2c) );--_nys-select-background-color: var(--nys-color-ink-reverse, #fff);--_nys-select-background-color--disabled: var( --nys-color-neutral-50, #ededed );--_nys-select-color--disabled: var(--nys-color-text-disabled, #bec0c1);--_nys-select-border-width: var(--nys-border-width-sm, 1px);--_nys-select-border-color: var(--nys-color-neutral-400, #909395);--_nys-select-border-color--hover: var(--nys-color-neutral-900, #1b1b1b);--_nys-select-border-color--focus: var(--nys-color-focus, #004dd1);--_nys-select-border-color--disabled: var(--nys-color-neutral-200, #bec0c1);--_nys-select-border-default: var(--nys-border-width-sm, 1px) solid var(--nys-color-neutral-400, #909395);--_nys-select-border-focus: var(--nys-border-width-sm, 1px) solid var(--nys-color-focus, var(--nys-color-blue-600, #004dd1));--_nys-select-border-disabled: var(--nys-border-width-sm, 1px) solid var(--nys-color-neutral-200, #bec0c1);--_nys-select-border-hover: var(--nys-border-width-sm, 1px) solid var(--nys-color-neutral-900, #1b1b1b)}.nys-select{display:flex;flex-direction:column;gap:var(--_nys-select-gap);font-family:var(--_nys-select-font-family)}.nys-select__select{color:var(--_nys-select-color);font-weight:var(--_nys-select-font-weight);font-family:var(--_nys-select-font-family);border-radius:var(--_nys-select-border-radius);border:solid var(--_nys-select-border-width) var(--_nys-select-border-color);font-size:var(--_nys-select-font-size);padding:var(--_nys-select-padding);width:var(--_nys-select-width);max-width:100%;text-indent:1px;text-overflow:"";background:var(--_nys-select-background-color);-webkit-appearance:none;-moz-appearance:none;appearance:none;text-overflow:ellipsis}.nys-select__selectwrapper{position:relative;display:inline-block;width:var(--_nys-select-width);max-width:100%}.nys-select__icon{color:var(--_nys-select-color);position:absolute;right:10px;top:50%;transform:translateY(-50%);pointer-events:none}:host([width=sm]){--_nys-select-width: var(--nys-select-form-width-sm, 88px)}:host([width=md]){--_nys-select-width: var(--nys-select-form-width-md, 200px)}:host([width=lg]){--_nys-select-width: var(--nys-select-form-width-lg, 384px)}:host([width=full]){--_nys-select-width: 100%;flex:1}.nys-select__select:hover:not(:disabled){cursor:pointer;border-color:var(--_nys-select-border-color--hover);outline:solid var(--_nys-select-border-width) var(--_nys-select-border-color--hover)}.nys-select__select:focus{border-color:var(--_nys-select-border-color--focus);outline:solid var(--_nys-select-border-width) var(--_nys-select-border-color--focus)}.nys-select__select:disabled{background-color:var(--_nys-select-background-color--disabled);border-color:var(--_nys-select-border-color--disabled);cursor:not-allowed;color:var(--_nys-select-color--disabled)}.nys-select__select:disabled~.nys-select__icon{color:var(--_nys-select-color--disabled)}:host([showError]){--_nys-select-border-default: var(--nys-border-width-sm, 1px) solid var(--_nys-select-color--error)}';
51
- var w = Object.defineProperty, x = Object.getOwnPropertyDescriptor, n = (u, e, t, d) => {
52
- for (var l = d > 1 ? void 0 : d ? x(e, t) : e, s = u.length - 1, r; s >= 0; s--)
53
- (r = u[s]) && (l = (d ? r(e, t, l) : r(l)) || l);
54
- return d && l && w(e, t, l), l;
51
+ var w = Object.defineProperty, n = (y, e, t, d) => {
52
+ for (var l = void 0, s = y.length - 1, r; s >= 0; s--)
53
+ (r = y[s]) && (l = r(e, t, l) || l);
54
+ return l && w(e, t, l), l;
55
55
  };
56
- let E = 0;
57
- var c;
58
- const i = (c = class extends f {
56
+ let x = 0;
57
+ const p = class p extends v {
59
58
  // allows use of elementInternals' API
60
59
  constructor() {
61
- super(), this.id = "", this.name = "", this.label = "", this.description = "", this.value = "", this.disabled = !1, this.required = !1, this.optional = !1, this._tooltip = "", this.form = null, this.inverted = !1, this.showError = !1, this.errorMessage = "", this._width = "full", this._originalErrorMessage = "", this._hasUserInteracted = !1, this._internals = this.attachInternals();
62
- }
63
- get width() {
64
- return this._width;
65
- }
66
- set width(e) {
67
- this._width = c.VALID_WIDTHS.includes(
68
- e
69
- ) ? e : "full";
60
+ super(), this.id = "", this.name = "", this.label = "", this.description = "", this.value = "", this.disabled = !1, this.required = !1, this.optional = !1, this.tooltip = "", this.form = null, this.inverted = !1, this.showError = !1, this.errorMessage = "", this.width = "full", this._originalErrorMessage = "", this._hasUserInteracted = !1, this._internals = this.attachInternals();
70
61
  }
71
62
  // Generate a unique ID if one is not provided
72
63
  connectedCallback() {
73
- super.connectedCallback(), this.id || (this.id = `nys-select-${Date.now()}-${E++}`), this._originalErrorMessage = this.errorMessage ?? "", this.addEventListener("invalid", this._handleInvalid);
64
+ super.connectedCallback(), this.id || (this.id = `nys-select-${Date.now()}-${x++}`), this._originalErrorMessage = this.errorMessage ?? "", this.addEventListener("invalid", this._handleInvalid);
74
65
  }
75
66
  disconnectedCallback() {
76
67
  super.disconnectedCallback(), this.removeEventListener("invalid", this._handleInvalid);
@@ -92,7 +83,7 @@ const i = (c = class extends f {
92
83
  Array.from(t.children).forEach((s) => {
93
84
  s.hasAttribute("data-native") || s.remove();
94
85
  }), e.assignedElements({ flatten: !0 }).forEach((s) => {
95
- if (s instanceof h) {
86
+ if (s instanceof c) {
96
87
  const r = document.createElement("option");
97
88
  r.value = s.value, r.textContent = s.label || s.textContent?.trim() || "", r.disabled = s.disabled, r.selected = s.selected, t.appendChild(r);
98
89
  return;
@@ -105,12 +96,12 @@ const i = (c = class extends f {
105
96
  if (s.tagName === "OPTGROUP") {
106
97
  const r = document.createElement("optgroup");
107
98
  r.label = s.label, s.disabled && (r.disabled = !0), Array.from(s.children).forEach((a) => {
108
- if (a instanceof h) {
109
- const y = document.createElement("option");
110
- y.value = a.value, y.textContent = a.label || a.textContent?.trim() || "", y.disabled = a.disabled, y.selected = a.selected, r.appendChild(y);
99
+ if (a instanceof c) {
100
+ const h = document.createElement("option");
101
+ h.value = a.value, h.textContent = a.label || a.textContent?.trim() || "", h.disabled = a.disabled, h.selected = a.selected, r.appendChild(h);
111
102
  } else if (a.tagName === "OPTION") {
112
- const y = a.cloneNode(!0);
113
- r.appendChild(y);
103
+ const h = a.cloneNode(!0);
104
+ r.appendChild(h);
114
105
  }
115
106
  }), t.appendChild(r);
116
107
  return;
@@ -119,7 +110,7 @@ const i = (c = class extends f {
119
110
  const l = Array.from(t.options).find((s) => s.selected);
120
111
  l && (this.value = l.value, this._internals.setFormValue(this.value));
121
112
  }
122
- /********************** Form Integration **********************/
113
+ // Form Integration
123
114
  _setValue() {
124
115
  this._internals.setFormValue(this.value), this._manageRequire();
125
116
  }
@@ -142,7 +133,7 @@ const i = (c = class extends f {
142
133
  let t = e.validationMessage;
143
134
  this._manageRequire(), this._setValidityMessage(t);
144
135
  }
145
- /********************** Functions **********************/
136
+ // Functions
146
137
  // This helper function is called to perform the element's native validation.
147
138
  checkValidity() {
148
139
  const e = this.shadowRoot?.querySelector("select");
@@ -158,7 +149,7 @@ const i = (c = class extends f {
158
149
  ) === this && t.focus() : t.focus();
159
150
  }
160
151
  }
161
- /******************** Event Handlers ********************/
152
+ // Event Handlers
162
153
  // Handle change event to bubble up selected value
163
154
  _handleChange(e) {
164
155
  const t = e.target;
@@ -186,14 +177,14 @@ const i = (c = class extends f {
186
177
  }
187
178
  }
188
179
  render() {
189
- return v`
180
+ return f`
190
181
  <div class="nys-select">
191
182
  <nys-label
192
183
  for=${this.id + "--native"}
193
184
  label=${this.label}
194
185
  description=${this.description}
195
186
  flag=${this.required ? "required" : this.optional ? "optional" : ""}
196
- _tooltip=${this._tooltip}
187
+ tooltip=${this.tooltip}
197
188
  ?inverted=${this.inverted}
198
189
  >
199
190
  <slot name="description" slot="description">${this.description}</slot>
@@ -229,53 +220,54 @@ const i = (c = class extends f {
229
220
  </div>
230
221
  `;
231
222
  }
232
- }, c.styles = _(g), c.VALID_WIDTHS = ["sm", "md", "lg", "full"], c.formAssociated = !0, c);
223
+ };
224
+ p.styles = _(g), p.formAssociated = !0;
225
+ let i = p;
233
226
  n([
234
227
  o({ type: String, reflect: !0 })
235
- ], i.prototype, "id", 2);
228
+ ], i.prototype, "id");
236
229
  n([
237
230
  o({ type: String, reflect: !0 })
238
- ], i.prototype, "name", 2);
231
+ ], i.prototype, "name");
239
232
  n([
240
233
  o({ type: String })
241
- ], i.prototype, "label", 2);
234
+ ], i.prototype, "label");
242
235
  n([
243
236
  o({ type: String })
244
- ], i.prototype, "description", 2);
237
+ ], i.prototype, "description");
245
238
  n([
246
239
  o({ type: String })
247
- ], i.prototype, "value", 2);
240
+ ], i.prototype, "value");
248
241
  n([
249
242
  o({ type: Boolean, reflect: !0 })
250
- ], i.prototype, "disabled", 2);
243
+ ], i.prototype, "disabled");
251
244
  n([
252
245
  o({ type: Boolean, reflect: !0 })
253
- ], i.prototype, "required", 2);
246
+ ], i.prototype, "required");
254
247
  n([
255
248
  o({ type: Boolean, reflect: !0 })
256
- ], i.prototype, "optional", 2);
249
+ ], i.prototype, "optional");
257
250
  n([
258
251
  o({ type: String })
259
- ], i.prototype, "_tooltip", 2);
252
+ ], i.prototype, "tooltip");
260
253
  n([
261
254
  o({ type: String, reflect: !0 })
262
- ], i.prototype, "form", 2);
255
+ ], i.prototype, "form");
263
256
  n([
264
257
  o({ type: Boolean, reflect: !0 })
265
- ], i.prototype, "inverted", 2);
258
+ ], i.prototype, "inverted");
266
259
  n([
267
260
  o({ type: Boolean, reflect: !0 })
268
- ], i.prototype, "showError", 2);
261
+ ], i.prototype, "showError");
269
262
  n([
270
263
  o({ type: String })
271
- ], i.prototype, "errorMessage", 2);
264
+ ], i.prototype, "errorMessage");
272
265
  n([
273
- o({ reflect: !0 })
274
- ], i.prototype, "width", 1);
275
- let $ = i;
276
- customElements.get("nys-select") || customElements.define("nys-select", $);
266
+ o({ type: String, reflect: !0 })
267
+ ], i.prototype, "width");
268
+ customElements.get("nys-select") || customElements.define("nys-select", i);
277
269
  export {
278
- h as NysOption,
279
- $ as NysSelect
270
+ c as NysOption,
271
+ i as NysSelect
280
272
  };
281
273
  //# sourceMappingURL=nys-select.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nys-select.js","sources":["../src/nys-option.ts","../src/nys-select.ts"],"sourcesContent":["import { LitElement, html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\n\nexport class NysOption extends LitElement {\n @property({ type: Boolean, reflect: true }) disabled = false;\n @property({ type: Boolean, reflect: true }) selected = false;\n @property({ type: String }) value = \"\";\n @property({ type: String }) label = \"\";\n @property({ type: Boolean, reflect: true }) hidden = false;\n\n firstUpdated() {\n const slot = this.shadowRoot?.querySelector(\"slot\");\n if (slot) {\n slot.addEventListener(\"slotchange\", () => {\n const assignedNodes = slot.assignedNodes({ flatten: true });\n if (assignedNodes.length > 0) {\n this.label = assignedNodes[0].textContent?.trim() || \"\";\n }\n });\n }\n }\n\n render() {\n return html`\n <option\n ?disabled=${this.disabled}\n ?selected=${this.selected}\n value=${this.value}\n label=${this.label}\n ?hidden=${this.hidden}\n >\n <slot>${this.label}</slot>\n </option>\n `;\n }\n}\n\ncustomElements.define(\"nys-option\", NysOption);\n","import { LitElement, html, unsafeCSS } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { NysOption } from \"./nys-option\";\n// @ts-ignore: SCSS module imported via bundler as inline\nimport styles from \"./nys-select.scss?inline\";\n\nlet selectIdCounter = 0; // Counter for generating unique IDs\n\nexport class NysSelect extends LitElement {\n static styles = unsafeCSS(styles);\n\n @property({ type: String, reflect: true }) id = \"\";\n @property({ type: String, reflect: true }) name = \"\";\n @property({ type: String }) label = \"\";\n @property({ type: String }) description = \"\";\n @property({ type: String }) value = \"\";\n @property({ type: Boolean, reflect: true }) disabled = false;\n @property({ type: Boolean, reflect: true }) required = false;\n @property({ type: Boolean, reflect: true }) optional = false;\n @property({ type: String }) _tooltip = \"\";\n @property({ type: String, reflect: true }) form: string | null = null;\n @property({ type: Boolean, reflect: true }) inverted = false;\n @property({ type: Boolean, reflect: true }) showError = false;\n @property({ type: String }) errorMessage = \"\";\n private static readonly VALID_WIDTHS = [\"sm\", \"md\", \"lg\", \"full\"] as const;\n private _width: (typeof NysSelect.VALID_WIDTHS)[number] = \"full\";\n\n // Getter and setter for the `width` property.\n @property({ reflect: true })\n get width(): (typeof NysSelect.VALID_WIDTHS)[number] {\n return this._width;\n }\n\n set width(value: string) {\n // Check if the provided value is in VALID_WIDTHS. If not, default to \"full\".\n this._width = NysSelect.VALID_WIDTHS.includes(\n value as (typeof NysSelect.VALID_WIDTHS)[number],\n )\n ? (value as (typeof NysSelect.VALID_WIDTHS)[number])\n : \"full\";\n }\n\n private _originalErrorMessage = \"\";\n\n private _hasUserInteracted = false; // need this flag for \"eager mode\"\n private _internals: ElementInternals;\n\n /********************** Lifecycle updates **********************/\n static formAssociated = true; // allows use of elementInternals' API\n\n constructor() {\n super();\n this._internals = this.attachInternals();\n }\n\n // Generate a unique ID if one is not provided\n connectedCallback() {\n super.connectedCallback();\n if (!this.id) {\n this.id = `nys-select-${Date.now()}-${selectIdCounter++}`;\n }\n\n this._originalErrorMessage = this.errorMessage ?? \"\";\n this.addEventListener(\"invalid\", this._handleInvalid);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener(\"invalid\", this._handleInvalid);\n }\n\n firstUpdated() {\n //read in slotted options\n const slot = this.shadowRoot?.querySelector(\n 'slot:not([name=\"description\"])',\n ) as HTMLSlotElement | null;\n\n if (slot) {\n this._handleSlotChange();\n }\n\n // This ensures our element always participates in the form\n this._setValue();\n }\n\n // This callback is automatically called when the parent form is reset.\n formResetCallback() {\n this.value = \"\";\n }\n\n private _handleSlotChange() {\n const slot = this.shadowRoot?.querySelector(\n 'slot:not([name=\"description\"])',\n ) as HTMLSlotElement | null;\n const select = this.shadowRoot?.querySelector(\"select\");\n\n if (!slot || !select) return;\n\n // Clean up any previously cloned <option> or <optgroup> elements so we don't get duplicates\n Array.from(select.children).forEach((child) => {\n if (!(child as HTMLElement).hasAttribute(\"data-native\")) {\n child.remove();\n }\n });\n\n const assignedElements = slot.assignedElements({ flatten: true });\n\n assignedElements.forEach((node) => {\n // ---- Handle <nys-option> ----\n if (node instanceof NysOption) {\n const optionElement = document.createElement(\"option\");\n optionElement.value = node.value;\n optionElement.textContent =\n node.label || node.textContent?.trim() || \"\";\n optionElement.disabled = node.disabled;\n optionElement.selected = node.selected;\n select.appendChild(optionElement);\n return;\n }\n\n // ---- Handle native <option> ----\n if (node.tagName === \"OPTION\") {\n const original = node as HTMLOptionElement;\n const optionClone = original.cloneNode(true) as HTMLOptionElement;\n\n optionClone.setAttribute(\"data-native\", \"true\");\n optionClone.disabled = original.disabled;\n optionClone.selected = original.selected;\n\n select.appendChild(optionClone);\n return;\n }\n\n // ---- Handle <optgroup> ----\n if (node.tagName === \"OPTGROUP\") {\n const groupClone = document.createElement(\"optgroup\");\n groupClone.label = (node as HTMLOptGroupElement).label;\n if ((node as HTMLOptGroupElement).disabled) {\n groupClone.disabled = true;\n }\n\n // iterate children inside optgroup (could be nys-option or native option)\n Array.from(node.children).forEach((child) => {\n if (child instanceof NysOption) {\n const option = document.createElement(\"option\");\n option.value = child.value;\n option.textContent = child.label || child.textContent?.trim() || \"\";\n option.disabled = child.disabled;\n option.selected = child.selected;\n groupClone.appendChild(option);\n } else if (child.tagName === \"OPTION\") {\n const optionClone = child.cloneNode(true) as HTMLOptionElement;\n groupClone.appendChild(optionClone);\n }\n });\n\n select.appendChild(groupClone);\n return;\n }\n });\n\n // Sync initial selected state into component value\n const selectedOption = Array.from(select.options).find((o) => o.selected);\n\n if (selectedOption) {\n this.value = selectedOption.value;\n this._internals.setFormValue(this.value);\n }\n }\n\n /********************** Form Integration **********************/\n private _setValue() {\n // // set value to the option that is selected by default\n // const select = this.shadowRoot?.querySelector(\"select\");\n // if (!select) return;\n\n // // for each option, see if it's selected\n // Array.from(select.options).forEach((option) => {\n // if (option.selected) {\n // this.value = option.value;\n // }\n // });\n\n this._internals.setFormValue(this.value);\n this._manageRequire(); // Check validation when value is set\n }\n\n private _manageRequire() {\n const select = this.shadowRoot?.querySelector(\"select\");\n if (!select) return;\n\n const message = this.errorMessage || \"This field is required.\";\n const isInvalid = this.required && !this.value;\n\n if (isInvalid) {\n this._internals.ariaRequired = \"true\"; // Screen readers should announce error\n this._internals.setValidity({ valueMissing: true }, message, select);\n } else {\n this._internals.ariaRequired = \"false\"; // Reset when valid\n this._internals.setValidity({});\n this._hasUserInteracted = false; // Reset the interaction flag, make lazy again\n }\n }\n\n private _setValidityMessage(message: string = \"\") {\n const select = this.shadowRoot?.querySelector(\"select\");\n if (!select) return;\n\n // Toggle the HTML <div> tag error message\n this.showError = !!message;\n\n // If user sets errorMessage, this will always override the native validation message\n if (this._originalErrorMessage?.trim() && message !== \"\") {\n this.errorMessage = this._originalErrorMessage;\n } else {\n this.errorMessage = message;\n }\n\n const validityState = message ? { customError: true } : {};\n this._internals.setValidity(validityState, this.errorMessage, select);\n }\n\n private _validate() {\n const select = this.shadowRoot?.querySelector(\"select\");\n if (!select) return;\n\n // Get the native validation state\n let message = select.validationMessage;\n this._manageRequire(); // Makes sure the required state is checked\n\n this._setValidityMessage(message);\n }\n\n /********************** Functions **********************/\n // This helper function is called to perform the element's native validation.\n checkValidity(): boolean {\n const select = this.shadowRoot?.querySelector(\"select\");\n return select ? select.checkValidity() : true;\n }\n\n private _handleInvalid(event: Event) {\n event.preventDefault();\n this._hasUserInteracted = true; // Start aggressive mode due to form submission\n this._validate();\n this.showError = true;\n\n const select = this.shadowRoot?.querySelector(\"select\");\n if (select) {\n // Focus only if this is the first invalid element (top-down approach)\n const form = this._internals.form;\n if (form) {\n const elements = Array.from(form.elements) as Array<\n HTMLElement & { checkValidity?: () => boolean }\n >;\n // Find the first element in the form that is invalid\n const firstInvalidElement = elements.find(\n (element) =>\n typeof element.checkValidity === \"function\" &&\n !element.checkValidity(),\n );\n if (firstInvalidElement === this) {\n select.focus();\n }\n } else {\n // If not part of a form, simply focus.\n select.focus();\n }\n }\n }\n\n /******************** Event Handlers ********************/\n // Handle change event to bubble up selected value\n private _handleChange(e: Event) {\n const select = e.target as HTMLSelectElement;\n this.value = select.value;\n this._internals.setFormValue(this.value);\n\n // Clear error immediately if value is now valid\n if (this.required && this.value) {\n this.showError = false;\n this.errorMessage = \"\";\n this._internals.setValidity({});\n }\n\n // Validate aggressively if the user has already interacted\n if (this._hasUserInteracted) {\n this._validate();\n }\n\n this.dispatchEvent(\n new CustomEvent(\"nys-change\", {\n detail: { id: this.id, value: this.value },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n // Handle focus event\n private _handleFocus() {\n this.dispatchEvent(new Event(\"nys-focus\"));\n }\n\n // Handle blur event\n private _handleBlur() {\n if (!this._hasUserInteracted) {\n this._hasUserInteracted = true;\n }\n this._validate();\n this.dispatchEvent(new Event(\"nys-blur\"));\n }\n\n // Check if the current value matches any option, and if so, set it as selected\n updated(changedProperties: Map<string, unknown>): void {\n super.updated(changedProperties);\n\n // This ensures the value is set correctly after the component renders\n if (changedProperties.has(\"value\")) {\n const selectElement = this.shadowRoot?.querySelector(\"select\");\n if (selectElement) {\n selectElement.value = this.value;\n }\n }\n }\n\n render() {\n return html`\n <div class=\"nys-select\">\n <nys-label\n for=${this.id + \"--native\"}\n label=${this.label}\n description=${this.description}\n flag=${this.required ? \"required\" : this.optional ? \"optional\" : \"\"}\n _tooltip=${this._tooltip}\n ?inverted=${this.inverted}\n >\n <slot name=\"description\" slot=\"description\">${this.description}</slot>\n </nys-label>\n <div class=\"nys-select__selectwrapper\">\n <select\n class=\"nys-select__select\"\n name=${this.name}\n id=${this.id + \"--native\"}\n form=${ifDefined(this.form || undefined)}\n ?disabled=${this.disabled}\n ?required=${this.required}\n aria-disabled=\"${this.disabled}\"\n aria-label=\"${[this.label, this.description]\n .filter(Boolean)\n .join(\" \")}\"\n .value=${this.value}\n @focus=\"${this._handleFocus}\"\n @blur=\"${this._handleBlur}\"\n @change=\"${this._handleChange}\"\n >\n <option data-native hidden disabled value=\"\"></option>\n </select>\n <slot style=\"display: none;\"></slot>\n <nys-icon\n name=\"expand_all\"\n size=\"2xl\"\n class=\"nys-select__icon\"\n ></nys-icon>\n </div>\n <nys-errormessage\n ?showError=${this.showError}\n errorMessage=${this.errorMessage}\n ></nys-errormessage>\n </div>\n `;\n }\n}\n\nif (!customElements.get(\"nys-select\")) {\n customElements.define(\"nys-select\", NysSelect);\n}\n"],"names":["NysOption","LitElement","slot","assignedNodes","html","__decorateClass","property","selectIdCounter","_NysSelect","_a","value","select","child","node","optionElement","original","optionClone","groupClone","option","selectedOption","o","message","validityState","event","form","element","changedProperties","selectElement","ifDefined","unsafeCSS","styles","NysSelect"],"mappings":";;;;;;;;AAGO,MAAMA,UAAkBC,EAAW;AAAA,EAAnC,cAAA;AAAA,UAAA,GAAA,SAAA,GACuC,KAAA,WAAW,IACX,KAAA,WAAW,IAC3B,KAAA,QAAQ,IACR,KAAA,QAAQ,IACQ,KAAA,SAAS;AAAA,EAAA;AAAA,EAErD,eAAe;AACb,UAAMC,IAAO,KAAK,YAAY,cAAc,MAAM;AAClD,IAAIA,KACFA,EAAK,iBAAiB,cAAc,MAAM;AACxC,YAAMC,IAAgBD,EAAK,cAAc,EAAE,SAAS,IAAM;AAC1D,MAAIC,EAAc,SAAS,MACzB,KAAK,QAAQA,EAAc,CAAC,EAAE,aAAa,UAAU;AAAA,IAEzD,CAAC;AAAA,EAEL;AAAA,EAEA,SAAS;AACP,WAAOC;AAAA;AAAA,oBAES,KAAK,QAAQ;AAAA,oBACb,KAAK,QAAQ;AAAA,gBACjB,KAAK,KAAK;AAAA,gBACV,KAAK,KAAK;AAAA,kBAC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,EAA3BC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GAXfE,EAWiB,WAAA,YAAA,CAAA;AACeH,EAAA;AAAA,EAA1CC,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GAZ9BE,EAYgC,WAAA,QAAA,CAAA;AACCH,EAAA;AAAA,EAA3CC,EAAS,EAAE,MAAM,SAAS,SAAS,IAAM;AAAA,GAb/BE,EAaiC,WAAA,YAAA,CAAA;AACAH,EAAA;AAAA,EAA3CC,EAAS,EAAE,MAAM,SAAS,SAAS,IAAM;AAAA,GAd/BE,EAciC,WAAA,aAAA,CAAA;AAChBH,EAAA;AAAA,EAA3BC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GAffE,EAeiB,WAAA,gBAAA,CAAA;AAMxBH,EAAA;AAAA,EADHC,EAAS,EAAE,SAAS,GAAA,CAAM;AAAA,GApBhBE,EAqBP,WAAA,SAAA,CAAA;AArBC,IAAMuB,IAANvB;AA6WF,eAAe,IAAI,YAAY,KAClC,eAAe,OAAO,cAAcuB,CAAS;"}
1
+ {"version":3,"file":"nys-select.js","sources":["../src/nys-option.ts","../src/nys-select.ts"],"sourcesContent":["import { LitElement, html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\n\nexport class NysOption extends LitElement {\n @property({ type: Boolean, reflect: true }) disabled = false;\n @property({ type: Boolean, reflect: true }) selected = false;\n @property({ type: String }) value = \"\";\n @property({ type: String }) label = \"\";\n @property({ type: Boolean, reflect: true }) hidden = false;\n\n firstUpdated() {\n const slot = this.shadowRoot?.querySelector(\"slot\");\n if (slot) {\n slot.addEventListener(\"slotchange\", () => {\n const assignedNodes = slot.assignedNodes({ flatten: true });\n if (assignedNodes.length > 0) {\n this.label = assignedNodes[0].textContent?.trim() || \"\";\n }\n });\n }\n }\n\n render() {\n return html`\n <option\n ?disabled=${this.disabled}\n ?selected=${this.selected}\n value=${this.value}\n label=${this.label}\n ?hidden=${this.hidden}\n >\n <slot>${this.label}</slot>\n </option>\n `;\n }\n}\n\ncustomElements.define(\"nys-option\", NysOption);\n","import { LitElement, html, unsafeCSS } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { NysOption } from \"./nys-option\";\n// @ts-ignore: SCSS module imported via bundler as inline\nimport styles from \"./nys-select.scss?inline\";\n\nlet selectIdCounter = 0; // Counter for generating unique IDs\n\nexport class NysSelect extends LitElement {\n static styles = unsafeCSS(styles);\n\n @property({ type: String, reflect: true }) id = \"\";\n @property({ type: String, reflect: true }) name = \"\";\n @property({ type: String }) label = \"\";\n @property({ type: String }) description = \"\";\n @property({ type: String }) value = \"\";\n @property({ type: Boolean, reflect: true }) disabled = false;\n @property({ type: Boolean, reflect: true }) required = false;\n @property({ type: Boolean, reflect: true }) optional = false;\n @property({ type: String }) tooltip = \"\";\n @property({ type: String, reflect: true }) form: string | null = null;\n @property({ type: Boolean, reflect: true }) inverted = false;\n @property({ type: Boolean, reflect: true }) showError = false;\n @property({ type: String }) errorMessage = \"\";\n @property({ type: String, reflect: true }) width:\n | \"sm\"\n | \"md\"\n | \"lg\"\n | \"full\" = \"full\";\n\n private _originalErrorMessage = \"\";\n\n private _hasUserInteracted = false; // need this flag for \"eager mode\"\n private _internals: ElementInternals;\n\n // Lifecycle updates\n static formAssociated = true; // allows use of elementInternals' API\n\n constructor() {\n super();\n this._internals = this.attachInternals();\n }\n\n // Generate a unique ID if one is not provided\n connectedCallback() {\n super.connectedCallback();\n if (!this.id) {\n this.id = `nys-select-${Date.now()}-${selectIdCounter++}`;\n }\n\n this._originalErrorMessage = this.errorMessage ?? \"\";\n this.addEventListener(\"invalid\", this._handleInvalid);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener(\"invalid\", this._handleInvalid);\n }\n\n firstUpdated() {\n //read in slotted options\n const slot = this.shadowRoot?.querySelector(\n 'slot:not([name=\"description\"])',\n ) as HTMLSlotElement | null;\n\n if (slot) {\n this._handleSlotChange();\n }\n\n // This ensures our element always participates in the form\n this._setValue();\n }\n\n // This callback is automatically called when the parent form is reset.\n formResetCallback() {\n this.value = \"\";\n }\n\n private _handleSlotChange() {\n const slot = this.shadowRoot?.querySelector(\n 'slot:not([name=\"description\"])',\n ) as HTMLSlotElement | null;\n const select = this.shadowRoot?.querySelector(\"select\");\n\n if (!slot || !select) return;\n\n // Clean up any previously cloned <option> or <optgroup> elements so we don't get duplicates\n Array.from(select.children).forEach((child) => {\n if (!(child as HTMLElement).hasAttribute(\"data-native\")) {\n child.remove();\n }\n });\n\n const assignedElements = slot.assignedElements({ flatten: true });\n\n assignedElements.forEach((node) => {\n // ---- Handle <nys-option> ----\n if (node instanceof NysOption) {\n const optionElement = document.createElement(\"option\");\n optionElement.value = node.value;\n optionElement.textContent =\n node.label || node.textContent?.trim() || \"\";\n optionElement.disabled = node.disabled;\n optionElement.selected = node.selected;\n select.appendChild(optionElement);\n return;\n }\n\n // ---- Handle native <option> ----\n if (node.tagName === \"OPTION\") {\n const original = node as HTMLOptionElement;\n const optionClone = original.cloneNode(true) as HTMLOptionElement;\n\n optionClone.setAttribute(\"data-native\", \"true\");\n optionClone.disabled = original.disabled;\n optionClone.selected = original.selected;\n\n select.appendChild(optionClone);\n return;\n }\n\n // ---- Handle <optgroup> ----\n if (node.tagName === \"OPTGROUP\") {\n const groupClone = document.createElement(\"optgroup\");\n groupClone.label = (node as HTMLOptGroupElement).label;\n if ((node as HTMLOptGroupElement).disabled) {\n groupClone.disabled = true;\n }\n\n // iterate children inside optgroup (could be nys-option or native option)\n Array.from(node.children).forEach((child) => {\n if (child instanceof NysOption) {\n const option = document.createElement(\"option\");\n option.value = child.value;\n option.textContent = child.label || child.textContent?.trim() || \"\";\n option.disabled = child.disabled;\n option.selected = child.selected;\n groupClone.appendChild(option);\n } else if (child.tagName === \"OPTION\") {\n const optionClone = child.cloneNode(true) as HTMLOptionElement;\n groupClone.appendChild(optionClone);\n }\n });\n\n select.appendChild(groupClone);\n return;\n }\n });\n\n // Sync initial selected state into component value\n const selectedOption = Array.from(select.options).find((o) => o.selected);\n\n if (selectedOption) {\n this.value = selectedOption.value;\n this._internals.setFormValue(this.value);\n }\n }\n\n // Form Integration\n private _setValue() {\n // // set value to the option that is selected by default\n // const select = this.shadowRoot?.querySelector(\"select\");\n // if (!select) return;\n\n // // for each option, see if it's selected\n // Array.from(select.options).forEach((option) => {\n // if (option.selected) {\n // this.value = option.value;\n // }\n // });\n\n this._internals.setFormValue(this.value);\n this._manageRequire(); // Check validation when value is set\n }\n\n private _manageRequire() {\n const select = this.shadowRoot?.querySelector(\"select\");\n if (!select) return;\n\n const message = this.errorMessage || \"This field is required.\";\n const isInvalid = this.required && !this.value;\n\n if (isInvalid) {\n this._internals.ariaRequired = \"true\"; // Screen readers should announce error\n this._internals.setValidity({ valueMissing: true }, message, select);\n } else {\n this._internals.ariaRequired = \"false\"; // Reset when valid\n this._internals.setValidity({});\n this._hasUserInteracted = false; // Reset the interaction flag, make lazy again\n }\n }\n\n private _setValidityMessage(message: string = \"\") {\n const select = this.shadowRoot?.querySelector(\"select\");\n if (!select) return;\n\n // Toggle the HTML <div> tag error message\n this.showError = !!message;\n\n // If user sets errorMessage, this will always override the native validation message\n if (this._originalErrorMessage?.trim() && message !== \"\") {\n this.errorMessage = this._originalErrorMessage;\n } else {\n this.errorMessage = message;\n }\n\n const validityState = message ? { customError: true } : {};\n this._internals.setValidity(validityState, this.errorMessage, select);\n }\n\n private _validate() {\n const select = this.shadowRoot?.querySelector(\"select\");\n if (!select) return;\n\n // Get the native validation state\n let message = select.validationMessage;\n this._manageRequire(); // Makes sure the required state is checked\n\n this._setValidityMessage(message);\n }\n\n // Functions\n // This helper function is called to perform the element's native validation.\n checkValidity(): boolean {\n const select = this.shadowRoot?.querySelector(\"select\");\n return select ? select.checkValidity() : true;\n }\n\n private _handleInvalid(event: Event) {\n event.preventDefault();\n this._hasUserInteracted = true; // Start aggressive mode due to form submission\n this._validate();\n this.showError = true;\n\n const select = this.shadowRoot?.querySelector(\"select\");\n if (select) {\n // Focus only if this is the first invalid element (top-down approach)\n const form = this._internals.form;\n if (form) {\n const elements = Array.from(form.elements) as Array<\n HTMLElement & { checkValidity?: () => boolean }\n >;\n // Find the first element in the form that is invalid\n const firstInvalidElement = elements.find(\n (element) =>\n typeof element.checkValidity === \"function\" &&\n !element.checkValidity(),\n );\n if (firstInvalidElement === this) {\n select.focus();\n }\n } else {\n // If not part of a form, simply focus.\n select.focus();\n }\n }\n }\n\n // Event Handlers\n // Handle change event to bubble up selected value\n private _handleChange(e: Event) {\n const select = e.target as HTMLSelectElement;\n this.value = select.value;\n this._internals.setFormValue(this.value);\n\n // Clear error immediately if value is now valid\n if (this.required && this.value) {\n this.showError = false;\n this.errorMessage = \"\";\n this._internals.setValidity({});\n }\n\n // Validate aggressively if the user has already interacted\n if (this._hasUserInteracted) {\n this._validate();\n }\n\n this.dispatchEvent(\n new CustomEvent(\"nys-change\", {\n detail: { id: this.id, value: this.value },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n // Handle focus event\n private _handleFocus() {\n this.dispatchEvent(new Event(\"nys-focus\"));\n }\n\n // Handle blur event\n private _handleBlur() {\n if (!this._hasUserInteracted) {\n this._hasUserInteracted = true;\n }\n this._validate();\n this.dispatchEvent(new Event(\"nys-blur\"));\n }\n\n // Check if the current value matches any option, and if so, set it as selected\n updated(changedProperties: Map<string, unknown>): void {\n super.updated(changedProperties);\n\n // This ensures the value is set correctly after the component renders\n if (changedProperties.has(\"value\")) {\n const selectElement = this.shadowRoot?.querySelector(\"select\");\n if (selectElement) {\n selectElement.value = this.value;\n }\n }\n }\n\n render() {\n return html`\n <div class=\"nys-select\">\n <nys-label\n for=${this.id + \"--native\"}\n label=${this.label}\n description=${this.description}\n flag=${this.required ? \"required\" : this.optional ? \"optional\" : \"\"}\n tooltip=${this.tooltip}\n ?inverted=${this.inverted}\n >\n <slot name=\"description\" slot=\"description\">${this.description}</slot>\n </nys-label>\n <div class=\"nys-select__selectwrapper\">\n <select\n class=\"nys-select__select\"\n name=${this.name}\n id=${this.id + \"--native\"}\n form=${ifDefined(this.form || undefined)}\n ?disabled=${this.disabled}\n ?required=${this.required}\n aria-disabled=\"${this.disabled}\"\n aria-label=\"${[this.label, this.description]\n .filter(Boolean)\n .join(\" \")}\"\n .value=${this.value}\n @focus=\"${this._handleFocus}\"\n @blur=\"${this._handleBlur}\"\n @change=\"${this._handleChange}\"\n >\n <option data-native hidden disabled value=\"\"></option>\n </select>\n <slot style=\"display: none;\"></slot>\n <nys-icon\n name=\"expand_all\"\n size=\"2xl\"\n class=\"nys-select__icon\"\n ></nys-icon>\n </div>\n <nys-errormessage\n ?showError=${this.showError}\n errorMessage=${this.errorMessage}\n ></nys-errormessage>\n </div>\n `;\n }\n}\n\nif (!customElements.get(\"nys-select\")) {\n customElements.define(\"nys-select\", NysSelect);\n}\n"],"names":["NysOption","LitElement","slot","assignedNodes","html","__decorateClass","property","selectIdCounter","_NysSelect","select","child","node","optionElement","original","optionClone","groupClone","option","selectedOption","o","message","validityState","event","form","element","changedProperties","selectElement","ifDefined","unsafeCSS","styles","NysSelect"],"mappings":";;;;;;;;AAGO,MAAMA,UAAkBC,EAAW;AAAA,EAAnC,cAAA;AAAA,UAAA,GAAA,SAAA,GACuC,KAAA,WAAW,IACX,KAAA,WAAW,IAC3B,KAAA,QAAQ,IACR,KAAA,QAAQ,IACQ,KAAA,SAAS;AAAA,EAAA;AAAA,EAErD,eAAe;AACb,UAAMC,IAAO,KAAK,YAAY,cAAc,MAAM;AAClD,IAAIA,KACFA,EAAK,iBAAiB,cAAc,MAAM;AACxC,YAAMC,IAAgBD,EAAK,cAAc,EAAE,SAAS,IAAM;AAC1D,MAAIC,EAAc,SAAS,MACzB,KAAK,QAAQA,EAAc,CAAC,EAAE,aAAa,UAAU;AAAA,IAEzD,CAAC;AAAA,EAEL;AAAA,EAEA,SAAS;AACP,WAAOC;AAAA;AAAA,oBAES,KAAK,QAAQ;AAAA,oBACb,KAAK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CxB,EAAA;AAAA,EAA3CC,EAAS,EAAE,MAAM,SAAS,SAAS,IAAM;AAAA,GAb/BuB,EAaiC,WAAA,UAAA;AACAxB,EAAA;AAAA,EAA3CC,EAAS,EAAE,MAAM,SAAS,SAAS,IAAM;AAAA,GAd/BuB,EAciC,WAAA,WAAA;AAChBxB,EAAA;AAAA,EAA3BC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GAffuB,EAeiB,WAAA,cAAA;AACexB,EAAA;AAAA,EAA1CC,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GAhB9BuB,EAgBgC,WAAA,OAAA;AAiVxC,eAAe,IAAI,YAAY,KAClC,eAAe,OAAO,cAAcA,CAAS;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nysds/nys-select",
3
- "version": "1.11.3",
3
+ "version": "1.12.0",
4
4
  "description": "The Select component from the NYS Design System.",
5
5
  "module": "dist/nys-select.js",
6
6
  "exports": {
@@ -22,9 +22,9 @@
22
22
  "lit-analyze": "lit-analyzer '**/*.ts'"
23
23
  },
24
24
  "dependencies": {
25
- "@nysds/nys-icon": "^1.11.3",
26
- "@nysds/nys-label": "^1.11.3",
27
- "@nysds/nys-errormessage": "^1.11.3"
25
+ "@nysds/nys-icon": "^1.12.0",
26
+ "@nysds/nys-label": "^1.12.0",
27
+ "@nysds/nys-errormessage": "^1.12.0"
28
28
  },
29
29
  "devDependencies": {
30
30
  "lit": "^3.3.1",