@rededor/cura 1.8.2-alpha.0 → 2.0.0-alpha.4

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.
Files changed (72) hide show
  1. package/dist/cjs/{cura-accordion_20.cjs.entry.js → cura-accordion_21.cjs.entry.js} +1815 -20
  2. package/dist/cjs/cura-accordion_21.cjs.entry.js.map +1 -0
  3. package/dist/cjs/cura-modal.cjs.entry.js +10 -2
  4. package/dist/cjs/cura-modal.cjs.entry.js.map +1 -1
  5. package/dist/cjs/cura-modal.entry.cjs.js.map +1 -1
  6. package/dist/cjs/cura.cjs.js +1 -1
  7. package/dist/cjs/index-BK9MSAiE.js.map +1 -1
  8. package/dist/cjs/loader.cjs.js +1 -1
  9. package/dist/collection/components/cura-dropdown-search/cura-dropdown-search.css +1 -1
  10. package/dist/collection/components/cura-dropdown-search/cura-dropdown-search.js +24 -4
  11. package/dist/collection/components/cura-dropdown-search/cura-dropdown-search.js.map +1 -1
  12. package/dist/collection/components/cura-modal/cura-modal.js +30 -2
  13. package/dist/collection/components/cura-modal/cura-modal.js.map +1 -1
  14. package/dist/collection/components/cura-modal/cura-modal.stories.js +10 -0
  15. package/dist/collection/components/cura-modal/cura-modal.stories.js.map +1 -1
  16. package/dist/collection/components/forms/cura-input-text/cura-input-text.js +1 -1
  17. package/dist/collection/components/forms/cura-select/cura-select.css +3 -148
  18. package/dist/collection/components/forms/cura-select/cura-select.js +103 -11
  19. package/dist/collection/components/forms/cura-select/cura-select.js.map +1 -1
  20. package/dist/collection/components/forms/cura-select-options/cura-select-option.css +15 -0
  21. package/dist/components/cura-calendar.js +1 -1
  22. package/dist/components/cura-dropdown-search.js +25 -5
  23. package/dist/components/cura-dropdown-search.js.map +1 -1
  24. package/dist/components/cura-input-date.js +3 -3
  25. package/dist/components/cura-modal.js +11 -2
  26. package/dist/components/cura-modal.js.map +1 -1
  27. package/dist/components/cura-select-option.js +1 -1
  28. package/dist/components/cura-select.js +1 -1
  29. package/dist/components/p-CvdWbsfO.js +2147 -0
  30. package/dist/components/p-CvdWbsfO.js.map +1 -0
  31. package/dist/components/p-D1cPOZpG.js.map +1 -1
  32. package/dist/components/{p-BGnJiNyu.js → p-DETZu2ie.js} +4 -4
  33. package/dist/components/{p-BGnJiNyu.js.map → p-DETZu2ie.js.map} +1 -1
  34. package/dist/components/{p-DpIu_Oxz.js → p-Dt450DkQ.js} +3 -3
  35. package/dist/components/p-Dt450DkQ.js.map +1 -0
  36. package/dist/cura/cura-modal.entry.esm.js.map +1 -1
  37. package/dist/cura/cura.esm.js +1 -1
  38. package/dist/cura/p-2ab58335.entry.js +2 -0
  39. package/dist/cura/p-2ab58335.entry.js.map +1 -0
  40. package/dist/cura/p-5ed7ce95.entry.js +2 -0
  41. package/dist/cura/p-5ed7ce95.entry.js.map +1 -0
  42. package/dist/cura/p-PPMZr_VE.js.map +1 -1
  43. package/dist/esm/{cura-accordion_20.entry.js → cura-accordion_21.entry.js} +1815 -21
  44. package/dist/esm/cura-accordion_21.entry.js.map +1 -0
  45. package/dist/esm/cura-modal.entry.js +10 -2
  46. package/dist/esm/cura-modal.entry.js.map +1 -1
  47. package/dist/esm/cura.js +1 -1
  48. package/dist/esm/index-OdKytJIH.js.map +1 -1
  49. package/dist/esm/loader.js +1 -1
  50. package/dist/types/components/cura-dropdown-search/cura-dropdown-search.d.ts +2 -0
  51. package/dist/types/components/cura-modal/cura-modal.d.ts +5 -0
  52. package/dist/types/components/cura-modal/cura-modal.stories.d.ts +11 -0
  53. package/dist/types/components/forms/cura-select/cura-select.d.ts +21 -0
  54. package/dist/types/components.d.ts +10 -0
  55. package/package.json +3 -2
  56. package/dist/cjs/cura-accordion_20.cjs.entry.js.map +0 -1
  57. package/dist/cjs/cura-card.cjs.entry.js +0 -81
  58. package/dist/cjs/cura-card.cjs.entry.js.map +0 -1
  59. package/dist/cjs/cura-card.entry.cjs.js.map +0 -1
  60. package/dist/components/p-BTt-pVTn.js +0 -442
  61. package/dist/components/p-BTt-pVTn.js.map +0 -1
  62. package/dist/components/p-DpIu_Oxz.js.map +0 -1
  63. package/dist/cura/cura-card.entry.esm.js.map +0 -1
  64. package/dist/cura/p-d8aeca82.entry.js +0 -2
  65. package/dist/cura/p-d8aeca82.entry.js.map +0 -1
  66. package/dist/cura/p-deb0b764.entry.js +0 -2
  67. package/dist/cura/p-deb0b764.entry.js.map +0 -1
  68. package/dist/cura/p-df7cb250.entry.js +0 -2
  69. package/dist/cura/p-df7cb250.entry.js.map +0 -1
  70. package/dist/esm/cura-accordion_20.entry.js.map +0 -1
  71. package/dist/esm/cura-card.entry.js +0 -79
  72. package/dist/esm/cura-card.entry.js.map +0 -1
@@ -312,152 +312,6 @@
312
312
  .wrapper.error:not(.transparent) .cura-input-field .feedback-icon {
313
313
  padding-left: 12px;
314
314
  }
315
- .wrapper.small .cura-input-field {
316
- width: 100%;
317
- height: 32px;
318
- display: flex;
319
- flex-direction: row;
320
- align-items: center;
321
- background-color: var(--neutral-purewhite);
322
- border: 2px solid var(--neutral-medium);
323
- border-radius: 4px;
324
- color: var(--primary-base);
325
- letter-spacing: 0.32px;
326
- line-height: 20px;
327
- overflow: hidden;
328
- box-sizing: border-box;
329
- }
330
- .wrapper.small .cura-input-field input {
331
- flex: 1;
332
- width: 100%;
333
- height: 100%;
334
- background: transparent;
335
- border: none;
336
- outline: none;
337
- color: var(--neutral-dark);
338
- font-family: var(--font-family);
339
- font-weight: var(--font-weight-medium);
340
- font-size: 12px;
341
- box-sizing: border-box;
342
- padding: 0px 12px 0px 8px;
343
- }
344
- .wrapper.small .cura-input-field input::placeholder {
345
- color: var(--neutral-dark);
346
- }
347
- .wrapper.small .cura-input-field .feedback-icon {
348
- padding-left: 12px;
349
- }
350
- .wrapper.small .cura-input-field input {
351
- line-height: 13px;
352
- letter-spacing: 0.72px;
353
- }
354
- .wrapper.small .helper-text {
355
- margin-top: 8px;
356
- color: var(--neutral-dark);
357
- font-weight: var(--font-weight-regular);
358
- }
359
- .wrapper.small.label .menu {
360
- top: 53px;
361
- }
362
- .wrapper.small .menu {
363
- top: 33px;
364
- }
365
- .wrapper.medium .cura-input-field {
366
- width: 100%;
367
- height: 40px;
368
- display: flex;
369
- flex-direction: row;
370
- align-items: center;
371
- background-color: var(--neutral-purewhite);
372
- border: 2px solid var(--neutral-medium);
373
- border-radius: 4px;
374
- color: var(--primary-base);
375
- letter-spacing: 0.32px;
376
- line-height: 20px;
377
- overflow: hidden;
378
- box-sizing: border-box;
379
- }
380
- .wrapper.medium .cura-input-field input {
381
- flex: 1;
382
- width: 100%;
383
- height: 100%;
384
- background: transparent;
385
- border: none;
386
- outline: none;
387
- color: var(--neutral-dark);
388
- font-family: var(--font-family);
389
- font-weight: var(--font-weight-medium);
390
- font-size: 14px;
391
- box-sizing: border-box;
392
- padding: 0px 12px 0px 8px;
393
- }
394
- .wrapper.medium .cura-input-field input::placeholder {
395
- color: var(--neutral-dark);
396
- }
397
- .wrapper.medium .cura-input-field .feedback-icon {
398
- padding-left: 12px;
399
- }
400
- .wrapper.medium .cura-input-field input {
401
- line-height: 16px;
402
- letter-spacing: 0.56px;
403
- }
404
- .wrapper.medium .helper-text {
405
- margin-top: 8px;
406
- color: var(--neutral-dark);
407
- font-weight: var(--font-weight-regular);
408
- }
409
- .wrapper.medium.label .menu {
410
- top: 61px;
411
- }
412
- .wrapper.medium .menu {
413
- top: 40px;
414
- }
415
- .wrapper.large .cura-input-field {
416
- width: 100%;
417
- height: 44px;
418
- display: flex;
419
- flex-direction: row;
420
- align-items: center;
421
- background-color: var(--neutral-purewhite);
422
- border: 2px solid var(--neutral-medium);
423
- border-radius: 4px;
424
- color: var(--primary-base);
425
- letter-spacing: 0.32px;
426
- line-height: 20px;
427
- overflow: hidden;
428
- box-sizing: border-box;
429
- }
430
- .wrapper.large .cura-input-field input {
431
- flex: 1;
432
- width: 100%;
433
- height: 100%;
434
- background: transparent;
435
- border: none;
436
- outline: none;
437
- color: var(--neutral-dark);
438
- font-family: var(--font-family);
439
- font-weight: var(--font-weight-medium);
440
- font-size: 16px;
441
- box-sizing: border-box;
442
- padding: 0px 12px 0px 8px;
443
- }
444
- .wrapper.large .cura-input-field input::placeholder {
445
- color: var(--neutral-dark);
446
- }
447
- .wrapper.large .cura-input-field .feedback-icon {
448
- padding-left: 12px;
449
- }
450
- .wrapper.large .helper-text {
451
- margin-top: 8px;
452
- color: var(--neutral-dark);
453
- font-weight: var(--font-weight-bold);
454
- }
455
- .wrapper.large.label .menu {
456
- top: 69px;
457
- }
458
- .wrapper.large .menu {
459
- top: 47px;
460
- }
461
315
  .wrapper.disabled .cura-input-field {
462
316
  background-color: var(--neutral-white);
463
317
  border: 2px solid var(--neutral-base);
@@ -474,9 +328,10 @@
474
328
  }
475
329
 
476
330
  .menu {
477
- position: absolute;
331
+ position: fixed;
478
332
  left: 0;
479
- right: -1px;
333
+ top: 0;
334
+ box-sizing: border-box;
480
335
  background: #fff;
481
336
  border: 2px solid var(--neutral-light);
482
337
  border-radius: 4px;
@@ -1,4 +1,5 @@
1
1
  import { Host, h } from "@stencil/core";
2
+ import { autoUpdate, computePosition, flip, offset, shift, size } from "@floating-ui/dom";
2
3
  export class CuraSelect {
3
4
  constructor() {
4
5
  /**
@@ -72,8 +73,17 @@ export class CuraSelect {
72
73
  * Default: false
73
74
  */
74
75
  this.isOpen = false;
76
+ this.isPositioned = false;
77
+ this.menuStyle = {
78
+ top: '0px',
79
+ left: '0px',
80
+ width: '0px',
81
+ maxHeight: this.maxHeight,
82
+ };
75
83
  this.activeIndex = -1;
84
+ this.preferredPlacement = 'bottom';
76
85
  this.textInput = '';
86
+ this.floatingPlacement = 'bottom-start';
77
87
  /**
78
88
  * Styles to be applied to the component.
79
89
  */
@@ -106,7 +116,7 @@ export class CuraSelect {
106
116
  var _a;
107
117
  const { code: keyCode } = event;
108
118
  if (!this.isOpen && keyCode === 'ArrowDown') {
109
- this.isOpen = true;
119
+ this.openMenu();
110
120
  this.activeIndex = 0;
111
121
  return;
112
122
  }
@@ -122,12 +132,17 @@ export class CuraSelect {
122
132
  (_a = this.options[this.activeIndex]) === null || _a === void 0 ? void 0 : _a.click();
123
133
  }
124
134
  if (keyCode === 'Escape') {
125
- this.isOpen = false;
135
+ this.closeMenu();
126
136
  }
127
137
  };
128
138
  this.handleInputChange = (e) => {
129
139
  this.textInput = e.target.value;
130
- this.isOpen = this.textInput.length > 0;
140
+ if (this.searchBehavior) {
141
+ if (this.textInput.length > 0 && !this.isOpen)
142
+ this.openMenu();
143
+ if (this.textInput.length === 0 && this.isOpen)
144
+ this.closeMenu();
145
+ }
131
146
  this.internals.setFormValue(this.textInput);
132
147
  };
133
148
  this.handleClick = (event) => {
@@ -136,14 +151,20 @@ export class CuraSelect {
136
151
  const target = event.target;
137
152
  if (target.tagName === 'CURA-SELECT-OPTION')
138
153
  return this.onOptiselected(event);
139
- this.isOpen = !this.isOpen;
154
+ this.isOpen ? this.closeMenu() : this.openMenu();
140
155
  };
141
156
  this.handleClickOutside = (event) => {
142
- const clickedOutside = !this.host.contains(event.target);
157
+ const path = (event.composedPath && event.composedPath()) || [];
158
+ const clickedOutside = !path.includes(this.host) && !(this.menuElement && path.includes(this.menuElement));
143
159
  if (clickedOutside) {
144
- this.isOpen = false;
160
+ this.closeMenu();
145
161
  }
146
162
  };
163
+ this.handleViewportChange = () => {
164
+ if (!this.isOpen)
165
+ return;
166
+ this.updateMenuPosition();
167
+ };
147
168
  }
148
169
  updateOptionHighlights(newActiveINdex) {
149
170
  this.options.forEach((option, index) => (option.active = index === newActiveINdex));
@@ -215,6 +236,7 @@ export class CuraSelect {
215
236
  // this.initializeOptions();
216
237
  this.setupMutationObserver();
217
238
  this.addOutsideClickListener();
239
+ this.addPositionListeners();
218
240
  }
219
241
  /**
220
242
  * Lifecycle method called when the component is connected to the DOM.
@@ -228,9 +250,11 @@ export class CuraSelect {
228
250
  * Disconnects the MutationObserver if it exists.
229
251
  */
230
252
  disconnectedCallback() {
231
- var _a;
253
+ var _a, _b;
232
254
  (_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
233
255
  this.removeOutsideClickListener();
256
+ this.removePositionListeners();
257
+ (_b = this.cleanupAutoUpdate) === null || _b === void 0 ? void 0 : _b.call(this);
234
258
  }
235
259
  initializeOptions() {
236
260
  var _a;
@@ -299,7 +323,7 @@ export class CuraSelect {
299
323
  this.internals.setFormValue(this.value);
300
324
  if (this.textInput !== selectedOptionElement.textContent) {
301
325
  this.textInput = selectedOptionElement.textContent;
302
- this.isOpen = false;
326
+ this.closeMenu();
303
327
  this.selected.emit(selectedOptionElement.value);
304
328
  }
305
329
  }
@@ -354,20 +378,85 @@ export class CuraSelect {
354
378
  const icon = { default: this.iconName, success: 'checkCircle', error: 'alertCircle' }[this.status];
355
379
  return h("cura-icon", { class: "feedback-icon", name: icon, iconset: "default", size: this.size === 'large' ? 20 : 16, color: this.getColor('icon'), style: this.styles });
356
380
  }
381
+ openMenu() {
382
+ this.isOpen = true;
383
+ this.isPositioned = false;
384
+ requestAnimationFrame(() => this.setupFloating());
385
+ }
386
+ closeMenu() {
387
+ var _a;
388
+ this.isOpen = false;
389
+ this.isPositioned = false;
390
+ (_a = this.cleanupAutoUpdate) === null || _a === void 0 ? void 0 : _a.call(this);
391
+ }
357
392
  addOutsideClickListener() {
358
393
  document.addEventListener('click', this.handleClickOutside);
359
394
  }
360
395
  removeOutsideClickListener() {
361
396
  document.removeEventListener('click', this.handleClickOutside);
362
397
  }
398
+ addPositionListeners() {
399
+ window.addEventListener('resize', this.handleViewportChange, { passive: true });
400
+ window.addEventListener('scroll', this.handleViewportChange, true);
401
+ }
402
+ removePositionListeners() {
403
+ window.removeEventListener('resize', this.handleViewportChange);
404
+ window.removeEventListener('scroll', this.handleViewportChange, true);
405
+ }
406
+ parseMaxHeight() {
407
+ const numeric = parseFloat(this.maxHeight);
408
+ return Number.isFinite(numeric) ? numeric : 285;
409
+ }
410
+ setupFloating() {
411
+ var _a;
412
+ if (!this.inputWrapper || !this.menuElement)
413
+ return;
414
+ (_a = this.cleanupAutoUpdate) === null || _a === void 0 ? void 0 : _a.call(this);
415
+ this.cleanupAutoUpdate = autoUpdate(this.inputWrapper, this.menuElement, () => {
416
+ this.updateMenuPosition();
417
+ });
418
+ this.updateMenuPosition();
419
+ }
420
+ updateMenuPosition() {
421
+ if (!this.inputWrapper || !this.menuElement)
422
+ return;
423
+ computePosition(this.inputWrapper, this.menuElement, {
424
+ strategy: 'fixed',
425
+ placement: this.floatingPlacement,
426
+ middleware: [
427
+ offset(0),
428
+ flip(),
429
+ shift({ padding: 8 }),
430
+ size({
431
+ apply: ({ rects, availableHeight }) => {
432
+ this.menuStyle = Object.assign(Object.assign({}, this.menuStyle), { width: `${rects.reference.width}px`, maxHeight: `${Math.min(availableHeight, this.parseMaxHeight())}px` });
433
+ },
434
+ }),
435
+ ],
436
+ }).then(({ x, y, placement }) => {
437
+ this.preferredPlacement = placement.startsWith('top') ? 'top' : 'bottom';
438
+ this.menuStyle = Object.assign(Object.assign({}, this.menuStyle), { top: `${y}px`, left: `${x}px` });
439
+ this.isPositioned = true;
440
+ });
441
+ }
363
442
  render() {
364
- return (h(Host, { key: '3aeecef0bff82a4b14c4dee8b222fdf6eb33b2f8', style: this.styles, role: "combobox", "aria-label": this.label, "aria-required": String(this.required), "aria-disabled": String(this.disabled), "aria-invalid": String(this.status === 'error') }, h("div", { key: '00dd10ed04cd3bf0e848d9facc44db794e3580cf', class: this.getClasses(), onMouseEnter: () => (this.isHovered = true), onMouseLeave: () => (this.isHovered = false), onClick: this.handleClick }, this.label && (h("cura-label", { key: 'd0c7293af9ba728293f2b531c2cc0354ba6f9fa0', class: "label", weight: "bold", size: this.size === 'large' ? 'small' : 'xsmall', color: this.getColor('label') }, this.label, " ", this.required && h("span", { key: '2d1e87303eab87280dc8668e390bd5aa696814d9', class: "required" }, "* "))), h("div", { key: 'd0e8464016796145e088f459532a37dfb1852f96', class: {
443
+ return (h(Host, { key: '8a05e5365062b5a2da4f10d7e3ca04f9d3136fba', style: this.styles, role: "combobox", "aria-label": this.label, "aria-required": String(this.required), "aria-disabled": String(this.disabled), "aria-invalid": String(this.status === 'error') }, h("div", { key: 'ab28fd73d68ccdc5ad6dd6cc7f79d879eaf25818', class: this.getClasses(), onMouseEnter: () => (this.isHovered = true), onMouseLeave: () => (this.isHovered = false), onClick: this.handleClick }, this.label && (h("cura-label", { key: '5405aa3706b07640fdfdaa681ad22ea9c5fd9997', class: "label", weight: "bold", size: this.size === 'large' ? 'small' : 'xsmall', color: this.getColor('label') }, this.label, " ", this.required && h("span", { key: '39b37aefbf4e61572607d891eb63c737c332793c', class: "required" }, "* "))), h("div", { key: 'c339ab1ff49699fb0a348a169ba7f545b89bd593', class: {
365
444
  'cura-input-field': true,
366
445
  'open': this.isOpen,
367
- } }, this.renderIcon(), h("input", { key: '8110997e13827855169e58bfee9695a60bf4dbfa', type: "text", autocomplete: "off", onFocus: () => (this.isFocused = true), onBlur: () => (this.isFocused = false), onKeyDown: this.handleKeyNavigation, "aria-required": String(this.required), "aria-disabled": String(this.disabled), "aria-invalid": String(this.status === 'error'), onInput: this.handleInputChange, style: this.styles, placeholder: this.placeholder, disabled: this.disabled, required: this.required, value: this.textInput, readonly: this.searchBehavior ? null : true }), h("button", { key: '7b9b18aebd379b004c08f4bcdb4c72357f29c56c', class: "up-down-button" }, h("cura-icon", { key: '4e1fac2b43502e38db450e319e2283b97ed22fd7', name: this.isOpen ? 'up' : 'down', class: "up-down-icon", color: this.disabled ? 'neutral-dark' : 'primary-base', size: 16, iconset: "default" }))), h("cura-label", { key: '8e89021a023d6ff69a2adb2fe1b9052d1d813d06', class: "helper-text", size: "xsmall", color: this.getColor('text'), weight: this.mode === 'transparent' ? 'bold' : 'regular' }, h("slot", { key: 'a253ffc9f1f1ee84c9dcbc81dc3a650c5105c11e' })), this.isOpen && (h("div", { key: '938f552bebac510a7345c8e7b46d2ef911c19e12', class: {
446
+ }, ref: el => (this.inputWrapper = el) }, this.renderIcon(), h("input", { key: '5118ad409b6b9c48c856670857d3cae26d28fd46', type: "text", autocomplete: "off", onFocus: () => (this.isFocused = true), onBlur: () => (this.isFocused = false), onKeyDown: this.handleKeyNavigation, "aria-required": String(this.required), "aria-disabled": String(this.disabled), "aria-invalid": String(this.status === 'error'), onInput: this.handleInputChange, style: this.styles, placeholder: this.placeholder, disabled: this.disabled, required: this.required, value: this.textInput, readonly: this.searchBehavior ? null : true }), h("button", { key: '53bddc2b1e56462a9181ce99749d98568f1c5dd9', class: "up-down-button" }, h("cura-icon", { key: '01cb20504d2e0506e7210d33e3ca75978a598eff', name: this.isOpen ? 'up' : 'down', class: "up-down-icon", color: this.disabled ? 'neutral-dark' : 'primary-base', size: 16, iconset: "default" }))), h("cura-label", { key: '550c24779f690ebd16bec881770b200ce06f5390', class: "helper-text", size: "xsmall", color: this.getColor('text'), weight: this.mode === 'transparent' ? 'bold' : 'regular' }, h("slot", { key: '530f64f99df6328d3a49a449f8f924e57bb03f21' })), this.isOpen && (h("div", { key: '3ee7a6439c98a0837a3f39d27646ed7a55c630b3', class: {
368
447
  menu: true,
369
448
  open: this.isOpen,
370
- }, style: { '--max-height': this.maxHeight } }, h("slot", { key: '2d54c15bb8df7dfe33fac77cee7778c450946cf7', name: "option" }))))));
449
+ [this.preferredPlacement]: true,
450
+ }, ref: el => (this.menuElement = el), style: {
451
+ '--max-height': this.maxHeight,
452
+ top: this.menuStyle.top,
453
+ left: this.menuStyle.left,
454
+ width: this.menuStyle.width,
455
+ maxHeight: this.menuStyle.maxHeight,
456
+ visibility: this.isPositioned ? 'visible' : 'hidden',
457
+ opacity: this.isPositioned ? '1' : '0',
458
+ pointerEvents: this.isPositioned ? 'auto' : 'none',
459
+ } }, h("slot", { key: '84c3bb501966175635102b2ccbfa0cf43d2112f1', name: "option" }))))));
371
460
  }
372
461
  static get is() { return "cura-select"; }
373
462
  static get encapsulation() { return "shadow"; }
@@ -630,8 +719,11 @@ export class CuraSelect {
630
719
  "isHovered": {},
631
720
  "isFocused": {},
632
721
  "isOpen": {},
722
+ "isPositioned": {},
723
+ "menuStyle": {},
633
724
  "options": {},
634
725
  "activeIndex": {},
726
+ "preferredPlacement": {},
635
727
  "textInput": {}
636
728
  };
637
729
  }
@@ -1 +1 @@
1
- {"version":3,"file":"cura-select.js","sourceRoot":"","sources":["../../../../src/components/forms/cura-select/cura-select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAgB,eAAe,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAQtH,MAAM,OAAO,UAAU;IANvB;QAOE;;;WAGG;QACsB,UAAK,GAAW,EAAE,CAAC;QAE5C;;;WAGG;QACsB,gBAAW,GAAW,EAAE,CAAC;QAElD;;;WAGG;QACqC,UAAK,GAAW,EAAE,CAAC;QAE3D;;;WAGG;QACsB,SAAI,GAA8B,SAAS,CAAC;QAErE;;;WAGG;QACsB,SAAI,GAAiC,QAAQ,CAAC;QAIvE;;;WAGG;QACqC,WAAM,GAAoC,SAAS,CAAC;QAE5F;;;WAGG;QACsB,aAAQ,GAAY,KAAK,CAAC;QAEnD;;;WAGG;QACsB,aAAQ,GAAY,KAAK,CAAC;QAEnD;;;WAGG;QACsB,mBAAc,GAAY,KAAK,CAAC;QAEzD;;;WAGG;QACsB,kBAAa,GAAY,IAAI,CAAC;QAEtD;;;;WAIG;QACsB,cAAS,GAAW,OAAO,CAAC;QAEtD;;;WAGG;QACM,cAAS,GAAY,KAAK,CAAC;QAEpC;;;WAGG;QACM,cAAS,GAAY,KAAK,CAAC;QAEpC;;;WAGG;QACM,WAAM,GAAY,KAAK,CAAC;QAOxB,gBAAW,GAAG,CAAC,CAAC,CAAC;QAOjB,cAAS,GAAG,EAAE,CAAC;QAoDxB;;WAEG;QACH,WAAM,GAAG,EAAE,CAAC;QAEZ;;WAEG;QACH,UAAK,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;QAm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;;CACF","sourcesContent":["import { Component, Element, Host, Prop, State, h, Event, EventEmitter, AttachInternals, Watch } from '@stencil/core';\n\n@Component({\n tag: 'cura-select',\n styleUrl: 'cura-select.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class CuraSelect {\n /**\n * The label text for the select component.\n * Reflects as an attribute in the DOM.\n */\n @Prop({ reflect: true }) label: string = '';\n\n /**\n * Placeholder text for the input field.\n * Reflects as an attribute in the DOM.\n */\n @Prop({ reflect: true }) placeholder: string = '';\n\n /**\n * Current value of the select component.\n * Reflects as an attribute in the DOM and is mutable.\n */\n @Prop({ reflect: true, mutable: true }) value: string = '';\n\n /**\n * Display mode of the select component.\n * Can be 'default' or 'transparent'.\n */\n @Prop({ reflect: true }) mode: 'default' | 'transparent' = 'default';\n\n /**\n * Size of the select component.\n * Can be 'small', 'medium', or 'large'.\n */\n @Prop({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium';\n\n @Prop() iconName?: string;\n\n /**\n * Status of the select component.\n * Can be 'success', 'error', or 'default'.\n */\n @Prop({ reflect: true, mutable: true }) status: 'success' | 'error' | 'default' = 'default';\n\n /**\n * Whether the select component is disabled.\n * Reflects as an attribute in the DOM.\n */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /**\n * Whether the select component is required.\n * Reflects as an attribute in the DOM.\n */\n @Prop({ reflect: true }) required: boolean = false;\n\n /**\n * Enable / Disable search at options by term.\n * Default: false\n */\n @Prop({ reflect: true }) searchBehavior: boolean = false;\n\n /**\n * The search will be sensitive to accents.\n * Default: true\n */\n @Prop({ reflect: true }) caseSensitive: boolean = true;\n\n /**\n * CSS max-height property for dropdown item.\n * Can also be used by css property --max-height.\n * Default: 285px\n */\n @Prop({ reflect: true }) maxHeight: string = '285px';\n\n /**\n * Internal state: Whether the input is hovered.\n * Default: false\n */\n @State() isHovered: boolean = false;\n\n /**\n * Internal state: Whether the input is focused.\n * Default: false\n */\n @State() isFocused: boolean = false;\n\n /**\n * Internal state: Whether the dropdown menu is open.\n * Default: false\n */\n @State() isOpen: boolean = false;\n\n /**\n * Internal state: Collection of options for the select component.\n */\n @State() options: NodeListOf<HTMLCuraSelectOptionElement>;\n\n @State() activeIndex = -1;\n\n @Watch('activeIndex')\n updateOptionHighlights(newActiveINdex: number) {\n this.options.forEach((option, index) => ((option as any).active = index === newActiveINdex));\n }\n\n @State() textInput = '';\n\n @Watch('textInput')\n /**\n * Filters the options based on the current input value.\n */\n filterOptions(newText) {\n this.searchTermInput.emit(newText);\n\n if (!this.isOpen || !this.searchBehavior) {\n return;\n }\n\n const removeAccents = (str: string) => {\n return str.normalize('NFD').replace(/[\\u0300-\\u036f]/g, '');\n };\n\n let searchTerm = newText;\n if (!this.caseSensitive) {\n searchTerm = removeAccents(searchTerm).toLocaleLowerCase();\n }\n\n this.options.forEach(option => {\n let optionValue = option.textContent || '';\n if (!this.caseSensitive) {\n optionValue = removeAccents(optionValue?.toLowerCase());\n }\n const isVisible = optionValue.includes(searchTerm);\n option.style.display = isVisible ? 'block' : 'none';\n });\n }\n\n /**\n * Reference to the host element of the component.\n */\n @Element() host: HTMLElement;\n\n /**\n * Event emitted when an option is selected.\n */\n @Event() selected: EventEmitter;\n\n /**\n * Event emitted when an option is searched.\n */\n @Event() searchTermInput: EventEmitter;\n\n /**\n * MutationObserver to watch changes in the component.\n */\n mutationObserver: MutationObserver;\n\n /**\n * Styles to be applied to the component.\n */\n styles = {};\n\n /**\n * Theme object containing font and color information.\n */\n theme = window.CuraAPI.theme;\n\n @AttachInternals() internals: ElementInternals;\n\n /**\n * Callback for form association.\n */\n formAssociatedCallback(form: { ariaLabel: string }) {\n form.ariaLabel = this.label;\n }\n\n /**\n * Callback to restore the switch state from the form.\n */\n formStateRestoreCallback(state: { value: string }) {\n this.textInput = state.value;\n this.updateSelectedOption();\n }\n\n /**\n * Callback to reset the switch state when the form is reset.\n */\n formResetCallback() {\n this.textInput = '';\n this.clearSelectedAttributes();\n this.internals.setFormValue('');\n this.internals.setValidity({});\n }\n\n /**\n * Callback to update the switch's disabled state when the form's disabled state changes.\n */\n formDisabledCallback(disabled: boolean) {\n this.disabled = disabled;\n }\n\n /**\n * Lifecycle method called before the component is rendered.\n * Initializes the options for the select component.\n */\n componentWillLoad() {\n this.initializeOptions();\n }\n /**\n * Lifecycle method called after the component is rendered.\n * Initializes select-related functionality.\n */\n componentDidLoad() {\n // this.initializeOptions();\n this.setupMutationObserver();\n this.addOutsideClickListener();\n }\n /**\n * Lifecycle method called when the component is connected to the DOM.\n * Applies styles based on the theme.\n */\n connectedCallback() {\n this.applyStyles();\n }\n /**\n * Lifecycle method called when the component is disconnected from the DOM.\n * Disconnects the MutationObserver if it exists.\n */\n disconnectedCallback() {\n this.mutationObserver?.disconnect();\n this.removeOutsideClickListener();\n }\n\n initializeOptions() {\n this.options = this.host.querySelectorAll<HTMLCuraSelectOptionElement>('cura-select-option');\n this.options.forEach(option => {\n option.setAttribute('size', this.size);\n\n const isSelected = this.value === option.value;\n option.setAttribute('selected', JSON.stringify(isSelected));\n\n if (isSelected) {\n this.value = option.value;\n this.internals.setFormValue(option.value);\n }\n });\n\n this.textInput = Array.from(this.options).find(option => option.value === this.value)?.textContent || this.textInput;\n }\n /**\n * Applies styles to the component based on the theme.\n */\n applyStyles() {\n const { fonts, colors } = this.theme;\n const fontWeights = fonts.getWeights();\n\n this.styles = {\n ...this.styles,\n '--font-weight-medium': fontWeights.medium,\n '--font-weight-bold': fontWeights.bold,\n '--font-weight-regular': fontWeights.regular,\n '--font-color': fonts.getColor(),\n '--font-family': fonts.getFamily(),\n '--font-size': fonts.getSize(),\n };\n\n const colorKeys = [\n 'primary-base',\n 'neutral-purewhite',\n 'neutral-white',\n 'neutral-black',\n 'neutral-medium',\n 'neutral-light',\n 'neutral-base',\n 'neutral-dark',\n 'success-dark',\n 'success-darker',\n 'success-lighter',\n 'error-lighter',\n 'error-dark',\n 'error-darker',\n 'error-base',\n 'info-base',\n ];\n\n colorKeys.forEach(key => {\n this.styles[`--${key}`] = colors.getColor(key);\n });\n }\n /**\n * Sets up a MutationObserver to watch for changes in the component.\n */\n setupMutationObserver() {\n this.mutationObserver = new MutationObserver(this.handleMutations);\n this.mutationObserver.observe(this.host, { attributes: true, subtree: true, attributeFilter: ['selected', 'value'] });\n }\n /**\n * Handles mutations observed by the MutationObserver.\n * Updates the selected option or filters options based on the mutation type.\n */\n handleMutations = (mutations: MutationRecord[]) => {\n mutations.forEach(mutation => {\n if (mutation.type === 'attributes') {\n if (mutation.attributeName === 'selected') this.updateSelectedOption();\n }\n });\n };\n /**\n * Handles the selection of an option.\n */\n onOptiselected = (event: Event) => {\n const selectedOption = event.target as HTMLElement;\n this.clearSelectedAttributes();\n selectedOption.setAttribute('selected', 'true');\n };\n\n @Watch('value')\n handleValueChange(newValue: string) {\n this.clearSelectedAttributes();\n\n const selectedOption = this.host.querySelector(`cura-select-option[value=\"${newValue}\"]`);\n\n if (!selectedOption) {\n return;\n }\n\n selectedOption.setAttribute('selected', 'true');\n }\n\n updateSelectedOption() {\n const selectedOptionElement = this.host.querySelector<HTMLCuraSelectOptionElement>('cura-select-option[selected]');\n\n if (!selectedOptionElement) {\n return;\n }\n\n this.value = selectedOptionElement.value;\n this.internals.setFormValue(this.value);\n\n if (this.textInput !== selectedOptionElement.textContent) {\n this.textInput = selectedOptionElement.textContent;\n this.isOpen = false;\n this.selected.emit(selectedOptionElement.value);\n }\n }\n\n /**\n * Clears the 'selected' attribute from all options.\n */\n clearSelectedAttributes() {\n this.options.forEach(option => option.removeAttribute('selected'));\n }\n\n handleKeyNavigation = (event: KeyboardEvent) => {\n const { code: keyCode } = event;\n\n if (!this.isOpen && keyCode === 'ArrowDown') {\n this.isOpen = true;\n this.activeIndex = 0;\n\n return;\n }\n\n if (keyCode === 'ArrowDown') {\n event.preventDefault();\n this.updateActiveIndex(1);\n }\n\n if (keyCode === 'ArrowUp') {\n event.preventDefault();\n this.updateActiveIndex(-1);\n }\n\n if (keyCode === 'Enter' || keyCode === 'Space') {\n this.options[this.activeIndex]?.click();\n }\n\n if (keyCode === 'Escape') {\n this.isOpen = false;\n }\n };\n\n updateActiveIndex(direction: number) {\n if (this.options.length === 0) return;\n this.activeIndex = (this.activeIndex + direction + this.options.length) % this.options.length;\n }\n\n handleInputChange = (e: Event) => {\n this.textInput = (e.target as HTMLInputElement).value;\n this.isOpen = this.textInput.length > 0;\n this.internals.setFormValue(this.textInput);\n };\n\n getClasses() {\n return {\n wrapper: true,\n label: !!this.label,\n disabled: this.disabled,\n transparent: this.mode === 'transparent',\n [this.size.toLowerCase()]: true,\n [this.status.toLowerCase()]: true,\n };\n }\n\n /**\n * Determines the color based on the item type and component state.\n */\n getColor(item: 'label' | 'text' | 'icon') {\n if (this.disabled) return 'neutral-medium';\n\n const isStatusDefault = this.status === 'default';\n const isHoveredOrFocused = this.isFocused || this.isHovered;\n\n if (item === 'label') {\n if (!isStatusDefault || isHoveredOrFocused) return 'neutral-black';\n return 'neutral-dark';\n }\n\n if (isHoveredOrFocused && isStatusDefault) return 'neutral-black';\n if (this.status === 'success') return 'success-dark';\n if (this.status === 'error') return 'error-dark';\n\n return 'neutral-dark';\n }\n\n /**\n * Renders the icon based on the component's status.\n */\n renderIcon() {\n if (this.status === 'default' && !this.iconName) return null;\n const icon = { default: this.iconName, success: 'checkCircle', error: 'alertCircle' }[this.status];\n return <cura-icon class=\"feedback-icon\" name={icon} iconset=\"default\" size={this.size === 'large' ? 20 : 16} color={this.getColor('icon')} style={this.styles} />;\n }\n\n handleClick = (event: MouseEvent) => {\n if (this.disabled) return event.preventDefault();\n const target = event.target as HTMLElement;\n\n if (target.tagName === 'CURA-SELECT-OPTION') return this.onOptiselected(event);\n this.isOpen = !this.isOpen;\n };\n\n handleClickOutside = (event: MouseEvent) => {\n const clickedOutside = !this.host.contains(event.target as Node);\n if (clickedOutside) {\n this.isOpen = false;\n }\n };\n\n private addOutsideClickListener() {\n document.addEventListener('click', this.handleClickOutside);\n }\n\n private removeOutsideClickListener() {\n document.removeEventListener('click', this.handleClickOutside);\n }\n\n render() {\n return (\n <Host style={this.styles}\n role=\"combobox\"\n aria-label={this.label}\n aria-required={String(this.required)}\n aria-disabled={String(this.disabled)}\n aria-invalid={String(this.status === 'error')}>\n <div class={this.getClasses()} onMouseEnter={() => (this.isHovered = true)} onMouseLeave={() => (this.isHovered = false)} onClick={this.handleClick}>\n {this.label && (\n <cura-label class=\"label\" weight=\"bold\" size={this.size === 'large' ? 'small' : 'xsmall'} color={this.getColor('label')}>\n {this.label} {this.required && <span class=\"required\">* </span>}\n </cura-label>\n )}\n\n <div\n class={{\n 'cura-input-field': true,\n 'open': this.isOpen,\n }}\n >\n {this.renderIcon()}\n <input\n type=\"text\"\n autocomplete=\"off\"\n onFocus={() => (this.isFocused = true)}\n onBlur={() => (this.isFocused = false)}\n onKeyDown={this.handleKeyNavigation}\n aria-required={String(this.required)}\n aria-disabled={String(this.disabled)}\n aria-invalid={String(this.status === 'error')}\n onInput={this.handleInputChange}\n style={this.styles}\n placeholder={this.placeholder}\n disabled={this.disabled}\n required={this.required}\n value={this.textInput}\n readonly={this.searchBehavior ? null : true}\n />\n <button class=\"up-down-button\">\n <cura-icon name={this.isOpen ? 'up' : 'down'} class=\"up-down-icon\" color={this.disabled ? 'neutral-dark' : 'primary-base'} size={16} iconset=\"default\" />\n </button>\n </div>\n <cura-label class=\"helper-text\" size=\"xsmall\" color={this.getColor('text')} weight={this.mode === 'transparent' ? 'bold' : 'regular'}>\n <slot></slot>\n </cura-label>\n {this.isOpen && (\n <div\n class={{\n menu: true,\n open: this.isOpen,\n }}\n style={{ '--max-height': this.maxHeight }}\n >\n <slot name=\"option\"></slot>\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"cura-select.js","sourceRoot":"","sources":["../../../../src/components/forms/cura-select/cura-select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,E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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Host, Prop, State, h, Event, EventEmitter, AttachInternals, Watch } from '@stencil/core';\nimport { autoUpdate, computePosition, flip, offset, shift, size, Placement } from '@floating-ui/dom';\n\n@Component({\n tag: 'cura-select',\n styleUrl: 'cura-select.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class CuraSelect {\n /**\n * The label text for the select component.\n * Reflects as an attribute in the DOM.\n */\n @Prop({ reflect: true }) label: string = '';\n\n /**\n * Placeholder text for the input field.\n * Reflects as an attribute in the DOM.\n */\n @Prop({ reflect: true }) placeholder: string = '';\n\n /**\n * Current value of the select component.\n * Reflects as an attribute in the DOM and is mutable.\n */\n @Prop({ reflect: true, mutable: true }) value: string = '';\n\n /**\n * Display mode of the select component.\n * Can be 'default' or 'transparent'.\n */\n @Prop({ reflect: true }) mode: 'default' | 'transparent' = 'default';\n\n /**\n * Size of the select component.\n * Can be 'small', 'medium', or 'large'.\n */\n @Prop({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium';\n\n @Prop() iconName?: string;\n\n /**\n * Status of the select component.\n * Can be 'success', 'error', or 'default'.\n */\n @Prop({ reflect: true, mutable: true }) status: 'success' | 'error' | 'default' = 'default';\n\n /**\n * Whether the select component is disabled.\n * Reflects as an attribute in the DOM.\n */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /**\n * Whether the select component is required.\n * Reflects as an attribute in the DOM.\n */\n @Prop({ reflect: true }) required: boolean = false;\n\n /**\n * Enable / Disable search at options by term.\n * Default: false\n */\n @Prop({ reflect: true }) searchBehavior: boolean = false;\n\n /**\n * The search will be sensitive to accents.\n * Default: true\n */\n @Prop({ reflect: true }) caseSensitive: boolean = true;\n\n /**\n * CSS max-height property for dropdown item.\n * Can also be used by css property --max-height.\n * Default: 285px\n */\n @Prop({ reflect: true }) maxHeight: string = '285px';\n\n /**\n * Internal state: Whether the input is hovered.\n * Default: false\n */\n @State() isHovered: boolean = false;\n\n /**\n * Internal state: Whether the input is focused.\n * Default: false\n */\n @State() isFocused: boolean = false;\n\n /**\n * Internal state: Whether the dropdown menu is open.\n * Default: false\n */\n @State() isOpen: boolean = false;\n @State() isPositioned: boolean = false;\n @State() menuStyle: { top: string; left: string; width: string; maxHeight: string } = {\n top: '0px',\n left: '0px',\n width: '0px',\n maxHeight: this.maxHeight,\n };\n\n /**\n * Internal state: Collection of options for the select component.\n */\n @State() options: NodeListOf<HTMLCuraSelectOptionElement>;\n\n @State() activeIndex = -1;\n @State() preferredPlacement: 'top' | 'bottom' = 'bottom';\n\n @Watch('activeIndex')\n updateOptionHighlights(newActiveINdex: number) {\n this.options.forEach((option, index) => ((option as any).active = index === newActiveINdex));\n }\n\n @State() textInput = '';\n\n inputWrapper?: HTMLDivElement;\n menuElement?: HTMLDivElement;\n cleanupAutoUpdate?: () => void;\n floatingPlacement: Placement = 'bottom-start';\n\n @Watch('textInput')\n /**\n * Filters the options based on the current input value.\n */\n filterOptions(newText) {\n this.searchTermInput.emit(newText);\n\n if (!this.isOpen || !this.searchBehavior) {\n return;\n }\n\n const removeAccents = (str: string) => {\n return str.normalize('NFD').replace(/[\\u0300-\\u036f]/g, '');\n };\n\n let searchTerm = newText;\n if (!this.caseSensitive) {\n searchTerm = removeAccents(searchTerm).toLocaleLowerCase();\n }\n\n this.options.forEach(option => {\n let optionValue = option.textContent || '';\n if (!this.caseSensitive) {\n optionValue = removeAccents(optionValue?.toLowerCase());\n }\n const isVisible = optionValue.includes(searchTerm);\n option.style.display = isVisible ? 'block' : 'none';\n });\n }\n\n /**\n * Reference to the host element of the component.\n */\n @Element() host: HTMLElement;\n\n /**\n * Event emitted when an option is selected.\n */\n @Event() selected: EventEmitter;\n\n /**\n * Event emitted when an option is searched.\n */\n @Event() searchTermInput: EventEmitter;\n\n /**\n * MutationObserver to watch changes in the component.\n */\n mutationObserver: MutationObserver;\n\n /**\n * Styles to be applied to the component.\n */\n styles = {};\n\n /**\n * Theme object containing font and color information.\n */\n theme = window.CuraAPI.theme;\n\n @AttachInternals() internals: ElementInternals;\n\n /**\n * Callback for form association.\n */\n formAssociatedCallback(form: { ariaLabel: string }) {\n form.ariaLabel = this.label;\n }\n\n /**\n * Callback to restore the switch state from the form.\n */\n formStateRestoreCallback(state: { value: string }) {\n this.textInput = state.value;\n this.updateSelectedOption();\n }\n\n /**\n * Callback to reset the switch state when the form is reset.\n */\n formResetCallback() {\n this.textInput = '';\n this.clearSelectedAttributes();\n this.internals.setFormValue('');\n this.internals.setValidity({});\n }\n\n /**\n * Callback to update the switch's disabled state when the form's disabled state changes.\n */\n formDisabledCallback(disabled: boolean) {\n this.disabled = disabled;\n }\n\n /**\n * Lifecycle method called before the component is rendered.\n * Initializes the options for the select component.\n */\n componentWillLoad() {\n this.initializeOptions();\n }\n /**\n * Lifecycle method called after the component is rendered.\n * Initializes select-related functionality.\n */\n componentDidLoad() {\n // this.initializeOptions();\n this.setupMutationObserver();\n this.addOutsideClickListener();\n this.addPositionListeners();\n }\n /**\n * Lifecycle method called when the component is connected to the DOM.\n * Applies styles based on the theme.\n */\n connectedCallback() {\n this.applyStyles();\n }\n /**\n * Lifecycle method called when the component is disconnected from the DOM.\n * Disconnects the MutationObserver if it exists.\n */\n disconnectedCallback() {\n this.mutationObserver?.disconnect();\n this.removeOutsideClickListener();\n this.removePositionListeners();\n this.cleanupAutoUpdate?.();\n }\n\n initializeOptions() {\n this.options = this.host.querySelectorAll<HTMLCuraSelectOptionElement>('cura-select-option');\n this.options.forEach(option => {\n option.setAttribute('size', this.size);\n\n const isSelected = this.value === option.value;\n option.setAttribute('selected', JSON.stringify(isSelected));\n\n if (isSelected) {\n this.value = option.value;\n this.internals.setFormValue(option.value);\n }\n });\n\n this.textInput = Array.from(this.options).find(option => option.value === this.value)?.textContent || this.textInput;\n }\n /**\n * Applies styles to the component based on the theme.\n */\n applyStyles() {\n const { fonts, colors } = this.theme;\n const fontWeights = fonts.getWeights();\n\n this.styles = {\n ...this.styles,\n '--font-weight-medium': fontWeights.medium,\n '--font-weight-bold': fontWeights.bold,\n '--font-weight-regular': fontWeights.regular,\n '--font-color': fonts.getColor(),\n '--font-family': fonts.getFamily(),\n '--font-size': fonts.getSize(),\n };\n\n const colorKeys = [\n 'primary-base',\n 'neutral-purewhite',\n 'neutral-white',\n 'neutral-black',\n 'neutral-medium',\n 'neutral-light',\n 'neutral-base',\n 'neutral-dark',\n 'success-dark',\n 'success-darker',\n 'success-lighter',\n 'error-lighter',\n 'error-dark',\n 'error-darker',\n 'error-base',\n 'info-base',\n ];\n\n colorKeys.forEach(key => {\n this.styles[`--${key}`] = colors.getColor(key);\n });\n }\n /**\n * Sets up a MutationObserver to watch for changes in the component.\n */\n setupMutationObserver() {\n this.mutationObserver = new MutationObserver(this.handleMutations);\n this.mutationObserver.observe(this.host, { attributes: true, subtree: true, attributeFilter: ['selected', 'value'] });\n }\n /**\n * Handles mutations observed by the MutationObserver.\n * Updates the selected option or filters options based on the mutation type.\n */\n handleMutations = (mutations: MutationRecord[]) => {\n mutations.forEach(mutation => {\n if (mutation.type === 'attributes') {\n if (mutation.attributeName === 'selected') this.updateSelectedOption();\n }\n });\n };\n /**\n * Handles the selection of an option.\n */\n onOptiselected = (event: Event) => {\n const selectedOption = event.target as HTMLElement;\n this.clearSelectedAttributes();\n selectedOption.setAttribute('selected', 'true');\n };\n\n @Watch('value')\n handleValueChange(newValue: string) {\n this.clearSelectedAttributes();\n\n const selectedOption = this.host.querySelector(`cura-select-option[value=\"${newValue}\"]`);\n\n if (!selectedOption) {\n return;\n }\n\n selectedOption.setAttribute('selected', 'true');\n }\n\n updateSelectedOption() {\n const selectedOptionElement = this.host.querySelector<HTMLCuraSelectOptionElement>('cura-select-option[selected]');\n\n if (!selectedOptionElement) {\n return;\n }\n\n this.value = selectedOptionElement.value;\n this.internals.setFormValue(this.value);\n\n if (this.textInput !== selectedOptionElement.textContent) {\n this.textInput = selectedOptionElement.textContent;\n this.closeMenu();\n this.selected.emit(selectedOptionElement.value);\n }\n }\n\n /**\n * Clears the 'selected' attribute from all options.\n */\n clearSelectedAttributes() {\n this.options.forEach(option => option.removeAttribute('selected'));\n }\n\n handleKeyNavigation = (event: KeyboardEvent) => {\n const { code: keyCode } = event;\n\n if (!this.isOpen && keyCode === 'ArrowDown') {\n this.openMenu();\n this.activeIndex = 0;\n\n return;\n }\n\n if (keyCode === 'ArrowDown') {\n event.preventDefault();\n this.updateActiveIndex(1);\n }\n\n if (keyCode === 'ArrowUp') {\n event.preventDefault();\n this.updateActiveIndex(-1);\n }\n\n if (keyCode === 'Enter' || keyCode === 'Space') {\n this.options[this.activeIndex]?.click();\n }\n\n if (keyCode === 'Escape') {\n this.closeMenu();\n }\n };\n\n updateActiveIndex(direction: number) {\n if (this.options.length === 0) return;\n this.activeIndex = (this.activeIndex + direction + this.options.length) % this.options.length;\n }\n\n handleInputChange = (e: Event) => {\n this.textInput = (e.target as HTMLInputElement).value;\n if (this.searchBehavior) {\n if (this.textInput.length > 0 && !this.isOpen) this.openMenu();\n if (this.textInput.length === 0 && this.isOpen) this.closeMenu();\n }\n this.internals.setFormValue(this.textInput);\n };\n\n getClasses() {\n return {\n wrapper: true,\n label: !!this.label,\n disabled: this.disabled,\n transparent: this.mode === 'transparent',\n [this.size.toLowerCase()]: true,\n [this.status.toLowerCase()]: true,\n };\n }\n\n /**\n * Determines the color based on the item type and component state.\n */\n getColor(item: 'label' | 'text' | 'icon') {\n if (this.disabled) return 'neutral-medium';\n\n const isStatusDefault = this.status === 'default';\n const isHoveredOrFocused = this.isFocused || this.isHovered;\n\n if (item === 'label') {\n if (!isStatusDefault || isHoveredOrFocused) return 'neutral-black';\n return 'neutral-dark';\n }\n\n if (isHoveredOrFocused && isStatusDefault) return 'neutral-black';\n if (this.status === 'success') return 'success-dark';\n if (this.status === 'error') return 'error-dark';\n\n return 'neutral-dark';\n }\n\n /**\n * Renders the icon based on the component's status.\n */\n renderIcon() {\n if (this.status === 'default' && !this.iconName) return null;\n const icon = { default: this.iconName, success: 'checkCircle', error: 'alertCircle' }[this.status];\n return <cura-icon class=\"feedback-icon\" name={icon} iconset=\"default\" size={this.size === 'large' ? 20 : 16} color={this.getColor('icon')} style={this.styles} />;\n }\n\n private openMenu() {\n this.isOpen = true;\n this.isPositioned = false;\n requestAnimationFrame(() => this.setupFloating());\n }\n\n private closeMenu() {\n this.isOpen = false;\n this.isPositioned = false;\n this.cleanupAutoUpdate?.();\n }\n\n handleClick = (event: MouseEvent) => {\n if (this.disabled) return event.preventDefault();\n const target = event.target as HTMLElement;\n\n if (target.tagName === 'CURA-SELECT-OPTION') return this.onOptiselected(event);\n this.isOpen ? this.closeMenu() : this.openMenu();\n };\n\n handleClickOutside = (event: MouseEvent) => {\n const path = (event.composedPath && event.composedPath()) || [];\n const clickedOutside = !path.includes(this.host) && !(this.menuElement && path.includes(this.menuElement));\n if (clickedOutside) {\n this.closeMenu();\n }\n };\n\n private addOutsideClickListener() {\n document.addEventListener('click', this.handleClickOutside);\n }\n\n private removeOutsideClickListener() {\n document.removeEventListener('click', this.handleClickOutside);\n }\n\n private addPositionListeners() {\n window.addEventListener('resize', this.handleViewportChange, { passive: true });\n window.addEventListener('scroll', this.handleViewportChange, true);\n }\n\n private removePositionListeners() {\n window.removeEventListener('resize', this.handleViewportChange);\n window.removeEventListener('scroll', this.handleViewportChange, true);\n }\n\n private handleViewportChange = () => {\n if (!this.isOpen) return;\n this.updateMenuPosition();\n };\n\n private parseMaxHeight(): number {\n const numeric = parseFloat(this.maxHeight);\n return Number.isFinite(numeric) ? numeric : 285;\n }\n\n private setupFloating() {\n if (!this.inputWrapper || !this.menuElement) return;\n this.cleanupAutoUpdate?.();\n\n this.cleanupAutoUpdate = autoUpdate(this.inputWrapper, this.menuElement, () => {\n this.updateMenuPosition();\n });\n\n this.updateMenuPosition();\n }\n\n private updateMenuPosition() {\n if (!this.inputWrapper || !this.menuElement) return;\n\n computePosition(this.inputWrapper, this.menuElement, {\n strategy: 'fixed',\n placement: this.floatingPlacement,\n middleware: [\n offset(0),\n flip(),\n shift({ padding: 8 }),\n size({\n apply: ({ rects, availableHeight }) => {\n this.menuStyle = {\n ...this.menuStyle,\n width: `${rects.reference.width}px`,\n maxHeight: `${Math.min(availableHeight, this.parseMaxHeight())}px`,\n };\n },\n }),\n ],\n }).then(({ x, y, placement }) => {\n this.preferredPlacement = placement.startsWith('top') ? 'top' : 'bottom';\n this.menuStyle = {\n ...this.menuStyle,\n top: `${y}px`,\n left: `${x}px`,\n };\n this.isPositioned = true;\n });\n }\n\n render() {\n return (\n <Host style={this.styles}\n role=\"combobox\"\n aria-label={this.label}\n aria-required={String(this.required)}\n aria-disabled={String(this.disabled)}\n aria-invalid={String(this.status === 'error')}>\n <div class={this.getClasses()} onMouseEnter={() => (this.isHovered = true)} onMouseLeave={() => (this.isHovered = false)} onClick={this.handleClick}>\n {this.label && (\n <cura-label class=\"label\" weight=\"bold\" size={this.size === 'large' ? 'small' : 'xsmall'} color={this.getColor('label')}>\n {this.label} {this.required && <span class=\"required\">* </span>}\n </cura-label>\n )}\n\n <div\n class={{\n 'cura-input-field': true,\n 'open': this.isOpen,\n }}\n ref={el => (this.inputWrapper = el)}\n >\n {this.renderIcon()}\n <input\n type=\"text\"\n autocomplete=\"off\"\n onFocus={() => (this.isFocused = true)}\n onBlur={() => (this.isFocused = false)}\n onKeyDown={this.handleKeyNavigation}\n aria-required={String(this.required)}\n aria-disabled={String(this.disabled)}\n aria-invalid={String(this.status === 'error')}\n onInput={this.handleInputChange}\n style={this.styles}\n placeholder={this.placeholder}\n disabled={this.disabled}\n required={this.required}\n value={this.textInput}\n readonly={this.searchBehavior ? null : true}\n />\n <button class=\"up-down-button\">\n <cura-icon name={this.isOpen ? 'up' : 'down'} class=\"up-down-icon\" color={this.disabled ? 'neutral-dark' : 'primary-base'} size={16} iconset=\"default\" />\n </button>\n </div>\n <cura-label class=\"helper-text\" size=\"xsmall\" color={this.getColor('text')} weight={this.mode === 'transparent' ? 'bold' : 'regular'}>\n <slot></slot>\n </cura-label>\n {this.isOpen && (\n <div\n class={{\n menu: true,\n open: this.isOpen,\n [this.preferredPlacement]: true,\n }}\n ref={el => (this.menuElement = el)}\n style={{\n '--max-height': this.maxHeight,\n top: this.menuStyle.top,\n left: this.menuStyle.left,\n width: this.menuStyle.width,\n maxHeight: this.menuStyle.maxHeight,\n visibility: this.isPositioned ? 'visible' : 'hidden',\n opacity: this.isPositioned ? '1' : '0',\n pointerEvents: this.isPositioned ? 'auto' : 'none',\n }}\n >\n <slot name=\"option\"></slot>\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"]}
@@ -10,6 +10,7 @@
10
10
  align-items: center;
11
11
  box-sizing: border-box;
12
12
  background: var(--neutral-purewhite);
13
+ border-bottom: 1px solid transparent;
13
14
  }
14
15
  .item.selected {
15
16
  background-color: var(--primary-lighter-50);
@@ -17,13 +18,27 @@
17
18
  }
18
19
  .item:hover:not(.selected) {
19
20
  background: var(--neutral-white);
21
+ }
22
+ .item:hover:not(.selected) {
20
23
  border-bottom: 1px solid var(--neutral-light);
21
24
  }
22
25
  .item.active {
23
26
  background: var(--neutral-white) !important;
27
+ }
28
+ .item.active {
24
29
  border-bottom: 1px solid var(--neutral-light);
25
30
  }
26
31
  .item.selected.active {
27
32
  background-color: var(--primary-lighter-50) !important;
28
33
  box-shadow: none;
34
+ }
35
+
36
+ :host(:last-of-type) .item {
37
+ border-bottom: none;
38
+ }
39
+
40
+ :host(:last-of-type) .item:hover,
41
+ :host(:last-of-type) .item.active,
42
+ :host(:last-of-type) .item.selected {
43
+ border-bottom: none;
29
44
  }
@@ -1,4 +1,4 @@
1
- import { C as CuraCalendar$1, d as defineCustomElement$1 } from './p-BGnJiNyu.js';
1
+ import { C as CuraCalendar$1, d as defineCustomElement$1 } from './p-DETZu2ie.js';
2
2
 
3
3
  const CuraCalendar = CuraCalendar$1;
4
4
  const defineCustomElement = defineCustomElement$1;