@vonage/vivid 4.19.0-preview.0 → 4.19.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.
Files changed (90) hide show
  1. package/custom-elements.json +922 -742
  2. package/index.cjs +5 -0
  3. package/index.d.ts +1 -0
  4. package/index.js +2 -2
  5. package/lib/action-group/action-group.d.ts +0 -118
  6. package/lib/banner/banner.d.ts +0 -118
  7. package/lib/breadcrumb-item/breadcrumb-item.d.ts +0 -118
  8. package/lib/checkbox/checkbox.d.ts +0 -118
  9. package/lib/date-picker/date-picker.d.ts +0 -472
  10. package/lib/date-range-picker/date-range-picker.d.ts +0 -236
  11. package/lib/date-time-picker/date-time-picker.d.ts +0 -472
  12. package/lib/date-time-picker/definition.d.ts +2 -0
  13. package/lib/dialog/dialog.d.ts +0 -118
  14. package/lib/divider/divider.d.ts +0 -118
  15. package/lib/menu/menu.d.ts +0 -236
  16. package/lib/nav-disclosure/nav-disclosure.d.ts +0 -118
  17. package/lib/number-field/number-field.d.ts +0 -118
  18. package/lib/option/option.d.ts +2 -3
  19. package/lib/pagination/pagination.d.ts +1 -0
  20. package/lib/progress/progress.d.ts +0 -118
  21. package/lib/progress-ring/progress-ring.d.ts +0 -118
  22. package/lib/rich-text-editor/definition.d.ts +2 -0
  23. package/lib/rich-text-editor/facades/vivid-prose-mirror.facade.d.ts +1 -0
  24. package/lib/rich-text-editor/menubar/definition.d.ts +2 -0
  25. package/lib/rich-text-editor/menubar/menubar.d.ts +4 -0
  26. package/lib/rich-text-editor/menubar/menubar.template.d.ts +4 -0
  27. package/lib/rich-text-editor/rich-text-editor.d.ts +7 -0
  28. package/lib/searchable-select/locale.d.ts +1 -0
  29. package/lib/searchable-select/searchable-select.d.ts +1 -1
  30. package/lib/selectable-box/selectable-box.d.ts +0 -118
  31. package/lib/slider/slider.d.ts +0 -118
  32. package/lib/split-button/split-button.d.ts +0 -118
  33. package/lib/switch/switch.d.ts +0 -118
  34. package/lib/tag-group/tag-group.d.ts +0 -118
  35. package/lib/tag-name-map.d.ts +73 -0
  36. package/lib/text-anchor/text-anchor.d.ts +0 -118
  37. package/lib/text-area/text-area.d.ts +0 -118
  38. package/lib/text-field/text-field.d.ts +0 -118
  39. package/lib/time-picker/time-picker.d.ts +0 -236
  40. package/lib/toggletip/toggletip.d.ts +0 -118
  41. package/lib/tooltip/tooltip.d.ts +0 -118
  42. package/locales/de-DE.cjs +1 -0
  43. package/locales/de-DE.js +1 -0
  44. package/locales/en-GB.cjs +1 -0
  45. package/locales/en-GB.js +1 -0
  46. package/locales/en-US.cjs +1 -0
  47. package/locales/en-US.js +1 -0
  48. package/locales/ja-JP.cjs +1 -0
  49. package/locales/ja-JP.js +1 -0
  50. package/locales/zh-CN.cjs +1 -0
  51. package/locales/zh-CN.js +1 -0
  52. package/package.json +1 -1
  53. package/shared/aria/delegates-aria.d.ts +0 -118
  54. package/shared/definition20.cjs +10 -10
  55. package/shared/definition20.js +1 -1
  56. package/shared/definition30.cjs +1 -1
  57. package/shared/definition30.js +1 -1
  58. package/shared/definition36.cjs +7 -7
  59. package/shared/definition36.js +7 -7
  60. package/shared/definition37.cjs +15 -1
  61. package/shared/definition37.js +15 -1
  62. package/shared/definition4.cjs +13 -12
  63. package/shared/definition4.js +13 -12
  64. package/shared/definition43.cjs +221 -12
  65. package/shared/definition43.js +222 -14
  66. package/shared/definition44.cjs +35 -39
  67. package/shared/definition44.js +35 -39
  68. package/shared/definition63.cjs +232 -157
  69. package/shared/definition63.js +232 -157
  70. package/shared/foundation/button/button.d.ts +0 -118
  71. package/shared/option.cjs +16 -19
  72. package/shared/option.js +16 -19
  73. package/shared/patterns/anchored.d.ts +0 -236
  74. package/shared/picker-field/mixins/calendar-picker.d.ts +0 -118
  75. package/shared/picker-field/mixins/calendar-picker.template.d.ts +0 -118
  76. package/shared/picker-field/mixins/min-max-calendar-picker.d.ts +0 -236
  77. package/shared/picker-field/mixins/single-date-picker.d.ts +0 -354
  78. package/shared/picker-field/mixins/single-value-picker.d.ts +0 -118
  79. package/shared/picker-field/mixins/time-selection-picker.d.ts +0 -236
  80. package/shared/picker-field/mixins/time-selection-picker.template.d.ts +0 -236
  81. package/shared/picker-field.template.js +1 -1
  82. package/shared/vivid-element.cjs +1 -1
  83. package/shared/vivid-element.js +1 -1
  84. package/styles/core/all.css +1 -1
  85. package/styles/core/theme.css +1 -1
  86. package/styles/core/typography.css +1 -1
  87. package/styles/tokens/theme-dark.css +4 -4
  88. package/styles/tokens/theme-light.css +4 -4
  89. package/styles/tokens/vivid-2-compat.css +1 -1
  90. package/vivid.api.json +1260 -556
@@ -1,6 +1,7 @@
1
1
  import { B as Button, c as chevronTemplateFactory, b as buttonDefinition } from './definition11.js';
2
2
  import { P as Popup, p as popupDefinition } from './definition65.js';
3
3
  import { I as Icon, i as iconDefinition } from './definition28.js';
4
+ import { P as ProgressRing, p as progressRingDefinition } from './definition38.js';
4
5
  import { V as VividElement, O as Observable, D as DOM, a as attr, n as nullableNumberConverter, o as observable, h as html, d as createRegisterFunction, f as defineVividComponent } from './vivid-element.js';
5
6
  import { a as applyMixinsWithObservables } from './applyMixinsWithObservables.js';
6
7
  import { s as scrollIntoView } from './scrollIntoView.js';
@@ -8,9 +9,8 @@ import { F as FormAssociated } from './form-associated.js';
8
9
  import { A as AffixIconWithTrailing, a as affixIconTemplateFactory, I as IconWrapper } from './affix.js';
9
10
  import { L as Localized } from './localized.js';
10
11
  import { F as FormElementSuccessText, a as FormElementHelperText, e as errorText, f as formElements, g as getFeedbackTemplate } from './form-elements.js';
11
- import { a as applyMixins } from './apply-mixins.js';
12
12
  import { i as isListboxOption } from './option.js';
13
- import { P as ProgressRing, p as progressRingDefinition } from './definition38.js';
13
+ import { a as applyMixins } from './apply-mixins.js';
14
14
  import { w as when } from './when.js';
15
15
  import { r as ref } from './ref.js';
16
16
  import { s as slotted } from './slotted.js';
@@ -65,7 +65,7 @@ let SearchableSelect = class extends FormAssociatedSearchableSelect {
65
65
  this.maxLines = null;
66
66
  this.values = [];
67
67
  this.initialValues = [];
68
- this._internalSearchText = null;
68
+ this._currentSearchText = null;
69
69
  // --- Slotted options ---
70
70
  /**
71
71
  * @internal
@@ -179,29 +179,30 @@ let SearchableSelect = class extends FormAssociatedSearchableSelect {
179
179
  /**
180
180
  * @internal
181
181
  */
182
- _internalSearchTextChanged(newValue, oldValue) {
183
- if (oldValue !== newValue) {
184
- __privateMethod(this, _SearchableSelect_instances, updateFilteredOptions_fn).call(this);
185
- this.$emit("input:search-text", void 0, {
186
- bubbles: false,
187
- composed: false
188
- });
189
- }
182
+ _currentSearchTextChanged() {
183
+ __privateMethod(this, _SearchableSelect_instances, updateFilteredOptions_fn).call(this);
184
+ this.$emit("search-text-change", void 0, {
185
+ bubbles: false,
186
+ composed: false
187
+ });
190
188
  }
189
+ /**
190
+ * The current search text of the component.
191
+ */
191
192
  get searchText() {
192
- return this._internalSearchText ?? "";
193
+ return this._currentSearchText ?? "";
193
194
  }
194
195
  /**
195
196
  * @internal
196
197
  */
197
198
  get _inputValue() {
198
- return this._internalSearchText ?? (!this.multiple && this.value !== "" ? __privateMethod(this, _SearchableSelect_instances, textForValue_fn).call(this, this.value) : "");
199
+ return this._currentSearchText ?? (!this.multiple && this.value !== "" ? __privateMethod(this, _SearchableSelect_instances, textForValue_fn).call(this, this.value) ?? "" : "");
199
200
  }
200
201
  /**
201
202
  * @internal
202
203
  */
203
204
  _onInputInput(event) {
204
- this._internalSearchText = event.target.value;
205
+ this._currentSearchText = event.target.value;
205
206
  }
206
207
  /**
207
208
  * @internal
@@ -215,7 +216,7 @@ let SearchableSelect = class extends FormAssociatedSearchableSelect {
215
216
  */
216
217
  _onInputBlur(_) {
217
218
  this.open = false;
218
- this._internalSearchText = null;
219
+ this._currentSearchText = null;
219
220
  this._changeDescription = "";
220
221
  }
221
222
  /**
@@ -333,6 +334,12 @@ let SearchableSelect = class extends FormAssociatedSearchableSelect {
333
334
  _tagIconSlotName(value) {
334
335
  return `_tag-icon-${this.values.indexOf(value)}`;
335
336
  }
337
+ /**
338
+ * @internal
339
+ */
340
+ optionFilterChanged() {
341
+ __privateMethod(this, _SearchableSelect_instances, updateFilteredOptions_fn).call(this);
342
+ }
336
343
  // --- Tags ---
337
344
  /**
338
345
  * @internal
@@ -492,9 +499,6 @@ updateValuesThroughUserInteraction_fn = function(newValues) {
492
499
  updateValuesWhileMaintainingOrder_fn = function(newValues) {
493
500
  const oldSet = new Set(this.values);
494
501
  const newSet = new Set(newValues);
495
- if (oldSet.size === newSet.size && [...oldSet].every((v) => newSet.has(v))) {
496
- return;
497
- }
498
502
  this.values = [...this.values].filter((v) => newSet.has(v)).concat([...newValues].filter((v) => !oldSet.has(v)));
499
503
  };
500
504
  isValidValue_fn = function(value) {
@@ -531,7 +535,7 @@ handleOptionInteraction_fn = function(option) {
531
535
  this._changeDescription = isSelection ? this.locale.searchableSelect.optionSelectedMessage(option.text) : this.locale.searchableSelect.optionDeselectedMessage(option.text);
532
536
  __privateMethod(this, _SearchableSelect_instances, updateValuesThroughUserInteraction_fn).call(this, newValues);
533
537
  if (shouldClearSearchText) {
534
- this._internalSearchText = null;
538
+ this._currentSearchText = null;
535
539
  }
536
540
  };
537
541
  _clonedTagIcons = new WeakMap();
@@ -557,17 +561,12 @@ updateClonedTagIconOfOption_fn = function(option) {
557
561
  };
558
562
  updateFilteredOptions_fn = function() {
559
563
  const newFilteredOptions = [];
560
- const filterOption = this.filterOption ?? ((option, searchText) => option.text.toLowerCase().includes(searchText.toLowerCase()));
564
+ const optionFilter = this.optionFilter ?? ((option, searchText) => option.text.toLowerCase().includes(searchText.toLowerCase()));
561
565
  for (const option of this._slottedOptions ?? []) {
562
- if (this.searchText === "") {
563
- option._hidden = false;
564
- option._internalHighlightText = "";
565
- } else {
566
- const matches = filterOption(option, this.searchText);
567
- option._hidden = !matches;
568
- option._internalHighlightText = matches ? this.searchText : "";
569
- }
570
- if (!option.hidden && !option._hidden) {
566
+ option._vvdSearchText = this.searchText;
567
+ const matches = !this.searchText || optionFilter(option, this.searchText);
568
+ option._isNotMatching = !matches;
569
+ if (!option.hidden && matches) {
571
570
  newFilteredOptions.push(option);
572
571
  }
573
572
  }
@@ -628,10 +627,7 @@ highlightNextOption_fn = function() {
628
627
  __privateMethod(this, _SearchableSelect_instances, transitionHighlightedOptionTo_fn).call(this, (this._highlightedOptionIndex ?? -1) + 1);
629
628
  };
630
629
  textForValue_fn = function(value) {
631
- const option = this._slottedOptions.find(
632
- (option2) => option2.value === value
633
- );
634
- return option.text;
630
+ return this._slottedOptions?.find((option) => option.value === value)?.text;
635
631
  };
636
632
  /**
637
633
  * @internal
@@ -799,19 +795,19 @@ __decorateClass$1([
799
795
  ], SearchableSelect.prototype, "_input", 2);
800
796
  __decorateClass$1([
801
797
  observable
802
- ], SearchableSelect.prototype, "_internalSearchText", 2);
798
+ ], SearchableSelect.prototype, "_currentSearchText", 2);
803
799
  __decorateClass$1([
804
800
  observable
805
801
  ], SearchableSelect.prototype, "_slottedOptions", 2);
806
802
  __decorateClass$1([
807
803
  observable
808
- ], SearchableSelect.prototype, "_filteredOptions", 2);
804
+ ], SearchableSelect.prototype, "optionFilter", 2);
809
805
  __decorateClass$1([
810
806
  observable
811
- ], SearchableSelect.prototype, "_filteredEnabledOptions", 2);
807
+ ], SearchableSelect.prototype, "_filteredOptions", 2);
812
808
  __decorateClass$1([
813
809
  observable
814
- ], SearchableSelect.prototype, "filterOption", 2);
810
+ ], SearchableSelect.prototype, "_filteredEnabledOptions", 2);
815
811
  __decorateClass$1([
816
812
  attr({
817
813
  mode: "boolean"
@@ -1082,8 +1078,8 @@ function renderControl(context) {
1082
1078
  html`<div class="empty-message">
1083
1079
  ${when(
1084
1080
  (x) => x.loading,
1085
- html` <slot name="loading-options">
1086
- Loading...
1081
+ html`<slot name="loading-options">
1082
+ ${(x) => x.locale.searchableSelect.loadingOptionsMessage}
1087
1083
  </slot>`
1088
1084
  )}
1089
1085
  ${when(