@vonage/vivid 4.12.0 → 4.13.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 (124) hide show
  1. package/custom-elements.json +2339 -288
  2. package/lib/accordion/accordion.d.ts +21 -2
  3. package/lib/accordion-item/accordion-item.d.ts +6 -2
  4. package/lib/calendar/calendar.d.ts +1 -1
  5. package/lib/date-picker/date-picker.d.ts +1 -0
  6. package/lib/file-picker/file-picker.d.ts +6 -0
  7. package/lib/menu/menu.d.ts +16 -3
  8. package/lib/menu-item/menu-item.d.ts +10 -2
  9. package/lib/option/option.d.ts +27 -7
  10. package/lib/radio/radio.d.ts +12 -2
  11. package/lib/radio/radio.form-associated.d.ts +10 -0
  12. package/lib/radio-group/radio-group.d.ts +20 -2
  13. package/lib/switch/switch.d.ts +5 -2
  14. package/lib/switch/switch.form-associated.d.ts +10 -0
  15. package/lib/tab/tab.d.ts +3 -2
  16. package/lib/tab-panel/tab-panel.d.ts +2 -2
  17. package/lib/tabs/tabs.d.ts +33 -11
  18. package/lib/text-area/text-area.d.ts +25 -3
  19. package/lib/text-area/text-field.form-associated.d.ts +10 -0
  20. package/lib/text-field/text-field.d.ts +28 -3
  21. package/lib/text-field/text-field.form-associated.d.ts +10 -0
  22. package/package.json +1 -1
  23. package/shared/date-picker/date-picker-base.d.ts +1 -0
  24. package/shared/definition.cjs +29 -72
  25. package/shared/definition.js +30 -73
  26. package/shared/definition11.cjs +1 -1
  27. package/shared/definition11.js +1 -1
  28. package/shared/definition16.cjs +1 -2
  29. package/shared/definition16.js +1 -2
  30. package/shared/definition17.cjs +3 -3
  31. package/shared/definition17.js +3 -3
  32. package/shared/definition18.cjs +6 -1
  33. package/shared/definition18.js +6 -1
  34. package/shared/definition19.cjs +17 -8
  35. package/shared/definition19.js +17 -8
  36. package/shared/definition2.cjs +154 -187
  37. package/shared/definition2.js +157 -190
  38. package/shared/definition20.cjs +3 -2
  39. package/shared/definition20.js +3 -2
  40. package/shared/definition21.cjs +1 -1
  41. package/shared/definition21.js +1 -1
  42. package/shared/definition24.cjs +1 -1
  43. package/shared/definition24.js +1 -1
  44. package/shared/definition25.cjs +24 -3
  45. package/shared/definition25.js +24 -3
  46. package/shared/definition29.cjs +358 -559
  47. package/shared/definition29.js +359 -560
  48. package/shared/definition30.cjs +2 -0
  49. package/shared/definition30.js +2 -0
  50. package/shared/definition35.cjs +223 -3
  51. package/shared/definition35.js +223 -3
  52. package/shared/definition36.cjs +149 -14
  53. package/shared/definition36.js +150 -15
  54. package/shared/definition40.cjs +226 -399
  55. package/shared/definition40.js +229 -402
  56. package/shared/definition42.cjs +3 -2
  57. package/shared/definition42.js +3 -2
  58. package/shared/definition43.cjs +1 -0
  59. package/shared/definition43.js +1 -0
  60. package/shared/definition44.cjs +1 -1
  61. package/shared/definition44.js +1 -1
  62. package/shared/definition46.cjs +1 -1
  63. package/shared/definition46.js +1 -1
  64. package/shared/definition47.cjs +8 -16
  65. package/shared/definition47.js +4 -12
  66. package/shared/definition49.cjs +64 -89
  67. package/shared/definition49.js +66 -91
  68. package/shared/definition5.cjs +1 -1
  69. package/shared/definition5.js +1 -1
  70. package/shared/definition50.cjs +1 -11
  71. package/shared/definition50.js +1 -11
  72. package/shared/definition51.cjs +5 -15
  73. package/shared/definition51.js +6 -16
  74. package/shared/definition52.cjs +284 -20
  75. package/shared/definition52.js +288 -24
  76. package/shared/definition55.cjs +160 -180
  77. package/shared/definition55.js +160 -180
  78. package/shared/definition56.cjs +3 -307
  79. package/shared/definition56.js +5 -309
  80. package/shared/definition57.cjs +34 -11
  81. package/shared/definition57.js +30 -7
  82. package/shared/definition61.cjs +1 -1
  83. package/shared/definition61.js +1 -1
  84. package/shared/definition62.cjs +17 -8
  85. package/shared/definition62.js +17 -8
  86. package/shared/definition64.cjs +18 -7
  87. package/shared/definition64.js +19 -8
  88. package/shared/form-associated.cjs +1 -1
  89. package/shared/form-associated.js +1 -1
  90. package/shared/icon.cjs +1 -1
  91. package/shared/icon.js +1 -1
  92. package/shared/index.cjs +1 -0
  93. package/shared/index.js +1 -1
  94. package/shared/key-codes.cjs +1 -94
  95. package/shared/key-codes.js +2 -89
  96. package/shared/key-codes2.cjs +87 -1
  97. package/shared/key-codes2.js +83 -2
  98. package/shared/listbox.cjs +204 -10
  99. package/shared/listbox.js +200 -6
  100. package/shared/{direction.cjs → localization.cjs} +12 -3
  101. package/shared/{direction.js → localization.js} +12 -3
  102. package/shared/numbers.cjs +0 -12
  103. package/shared/numbers.js +1 -12
  104. package/shared/presentationDate.cjs +22 -8
  105. package/shared/presentationDate.js +16 -2
  106. package/shared/radio.cjs +92 -117
  107. package/shared/radio.js +93 -118
  108. package/shared/slider.template.cjs +2 -15
  109. package/shared/slider.template.js +2 -14
  110. package/shared/strings.cjs +26 -0
  111. package/shared/strings.js +25 -1
  112. package/shared/text-field2.cjs +538 -194
  113. package/shared/text-field2.js +539 -195
  114. package/styles/core/all.css +21 -1
  115. package/styles/core/theme.css +21 -1
  116. package/styles/core/typography.css +1 -1
  117. package/styles/tokens/theme-dark.css +4 -4
  118. package/styles/tokens/theme-light.css +4 -4
  119. package/styles/tokens/vivid-2-compat.css +1 -1
  120. package/vivid.api.json +44 -0
  121. package/shared/Reflector.cjs +0 -71
  122. package/shared/Reflector.js +0 -69
  123. package/shared/listbox-option.cjs +0 -204
  124. package/shared/listbox-option.js +0 -201
package/shared/listbox.js CHANGED
@@ -1,11 +1,11 @@
1
- import { k as keyArrowLeft, a as keyArrowRight } from './key-codes2.js';
2
- import { F as FoundationElement, O as Observable, _ as __decorate, a as attr, o as observable, D as DOM, n as nullableNumberConverter } from './index.js';
3
- import { i as isListboxOption } from './listbox-option.js';
1
+ import { e as keyArrowLeft, f as keyArrowRight } from './key-codes.js';
2
+ import { _ as __decorate, o as observable, a as attr, F as FoundationElement, O as Observable, D as DOM, n as nullableNumberConverter } from './index.js';
4
3
  import { A as ARIAGlobalStatesAndProperties } from './aria-global.js';
4
+ import { S as StartEnd } from './start-end.js';
5
5
  import { a as applyMixins } from './apply-mixins.js';
6
- import { a as keySpace, b as keyEscape, k as keyEnter, c as keyTab, d as keyEnd, e as keyArrowUp, f as keyArrowDown, g as keyHome } from './key-codes.js';
7
- import { u as uniqueId } from './strings.js';
8
- import { i as inRange } from './numbers.js';
6
+ import { i as isHTMLElement } from './dom.js';
7
+ import { a as keySpace, b as keyEscape, k as keyEnter, c as keyTab, d as keyEnd, e as keyArrowUp, f as keyArrowDown, g as keyHome } from './key-codes2.js';
8
+ import { u as uniqueId, i as inRange } from './strings.js';
9
9
 
10
10
  /**
11
11
  * Returns the index of the last element in the array where predicate is true, and -1 otherwise.
@@ -23,6 +23,200 @@ function findLastIndex(array, predicate) {
23
23
  return -1;
24
24
  }
25
25
 
26
+ /**
27
+ * Determines if the element is a {@link (ListboxOption:class)}
28
+ *
29
+ * @param element - the element to test.
30
+ * @public
31
+ */
32
+ function isListboxOption(el) {
33
+ return (isHTMLElement(el) &&
34
+ (el.getAttribute("role") === "option" ||
35
+ el instanceof HTMLOptionElement));
36
+ }
37
+ /**
38
+ * An Option Custom HTML Element.
39
+ * Implements {@link https://www.w3.org/TR/wai-aria-1.1/#option | ARIA option }.
40
+ *
41
+ * @slot start - Content which can be provided before the listbox option content
42
+ * @slot end - Content which can be provided after the listbox option content
43
+ * @slot - The default slot for listbox option content
44
+ * @csspart content - Wraps the listbox option content
45
+ *
46
+ * @public
47
+ */
48
+ class ListboxOption extends FoundationElement {
49
+ constructor(text, value, defaultSelected, selected) {
50
+ super();
51
+ /**
52
+ * The defaultSelected state of the option.
53
+ * @public
54
+ */
55
+ this.defaultSelected = false;
56
+ /**
57
+ * Tracks whether the "selected" property has been changed.
58
+ * @internal
59
+ */
60
+ this.dirtySelected = false;
61
+ /**
62
+ * The checked state of the control.
63
+ *
64
+ * @public
65
+ */
66
+ this.selected = this.defaultSelected;
67
+ /**
68
+ * Track whether the value has been changed from the initial value
69
+ */
70
+ this.dirtyValue = false;
71
+ if (text) {
72
+ this.textContent = text;
73
+ }
74
+ if (value) {
75
+ this.initialValue = value;
76
+ }
77
+ if (defaultSelected) {
78
+ this.defaultSelected = defaultSelected;
79
+ }
80
+ if (selected) {
81
+ this.selected = selected;
82
+ }
83
+ this.proxy = new Option(`${this.textContent}`, this.initialValue, this.defaultSelected, this.selected);
84
+ this.proxy.disabled = this.disabled;
85
+ }
86
+ /**
87
+ * Updates the ariaChecked property when the checked property changes.
88
+ *
89
+ * @param prev - the previous checked value
90
+ * @param next - the current checked value
91
+ *
92
+ * @public
93
+ */
94
+ checkedChanged(prev, next) {
95
+ if (typeof next === "boolean") {
96
+ this.ariaChecked = next ? "true" : "false";
97
+ return;
98
+ }
99
+ this.ariaChecked = null;
100
+ }
101
+ /**
102
+ * Updates the proxy's text content when the default slot changes.
103
+ * @param prev - the previous content value
104
+ * @param next - the current content value
105
+ *
106
+ * @internal
107
+ */
108
+ contentChanged(prev, next) {
109
+ if (this.proxy instanceof HTMLOptionElement) {
110
+ this.proxy.textContent = this.textContent;
111
+ }
112
+ this.$emit("contentchange", null, { bubbles: true });
113
+ }
114
+ defaultSelectedChanged() {
115
+ if (!this.dirtySelected) {
116
+ this.selected = this.defaultSelected;
117
+ if (this.proxy instanceof HTMLOptionElement) {
118
+ this.proxy.selected = this.defaultSelected;
119
+ }
120
+ }
121
+ }
122
+ disabledChanged(prev, next) {
123
+ this.ariaDisabled = this.disabled ? "true" : "false";
124
+ if (this.proxy instanceof HTMLOptionElement) {
125
+ this.proxy.disabled = this.disabled;
126
+ }
127
+ }
128
+ selectedAttributeChanged() {
129
+ this.defaultSelected = this.selectedAttribute;
130
+ if (this.proxy instanceof HTMLOptionElement) {
131
+ this.proxy.defaultSelected = this.defaultSelected;
132
+ }
133
+ }
134
+ selectedChanged() {
135
+ this.ariaSelected = this.selected ? "true" : "false";
136
+ if (!this.dirtySelected) {
137
+ this.dirtySelected = true;
138
+ }
139
+ if (this.proxy instanceof HTMLOptionElement) {
140
+ this.proxy.selected = this.selected;
141
+ }
142
+ }
143
+ initialValueChanged(previous, next) {
144
+ // If the value is clean and the component is connected to the DOM
145
+ // then set value equal to the attribute value.
146
+ if (!this.dirtyValue) {
147
+ this.value = this.initialValue;
148
+ this.dirtyValue = false;
149
+ }
150
+ }
151
+ get label() {
152
+ var _a;
153
+ return (_a = this.value) !== null && _a !== void 0 ? _a : this.text;
154
+ }
155
+ get text() {
156
+ var _a, _b;
157
+ return (_b = (_a = this.textContent) === null || _a === void 0 ? void 0 : _a.replace(/\s+/g, " ").trim()) !== null && _b !== void 0 ? _b : "";
158
+ }
159
+ set value(next) {
160
+ const newValue = `${next !== null && next !== void 0 ? next : ""}`;
161
+ this._value = newValue;
162
+ this.dirtyValue = true;
163
+ if (this.proxy instanceof HTMLOptionElement) {
164
+ this.proxy.value = newValue;
165
+ }
166
+ Observable.notify(this, "value");
167
+ }
168
+ get value() {
169
+ var _a;
170
+ Observable.track(this, "value");
171
+ return (_a = this._value) !== null && _a !== void 0 ? _a : this.text;
172
+ }
173
+ get form() {
174
+ return this.proxy ? this.proxy.form : null;
175
+ }
176
+ }
177
+ __decorate([
178
+ observable
179
+ ], ListboxOption.prototype, "checked", void 0);
180
+ __decorate([
181
+ observable
182
+ ], ListboxOption.prototype, "content", void 0);
183
+ __decorate([
184
+ observable
185
+ ], ListboxOption.prototype, "defaultSelected", void 0);
186
+ __decorate([
187
+ attr({ mode: "boolean" })
188
+ ], ListboxOption.prototype, "disabled", void 0);
189
+ __decorate([
190
+ attr({ attribute: "selected", mode: "boolean" })
191
+ ], ListboxOption.prototype, "selectedAttribute", void 0);
192
+ __decorate([
193
+ observable
194
+ ], ListboxOption.prototype, "selected", void 0);
195
+ __decorate([
196
+ attr({ attribute: "value", mode: "fromView" })
197
+ ], ListboxOption.prototype, "initialValue", void 0);
198
+ /**
199
+ * States and properties relating to the ARIA `option` role.
200
+ *
201
+ * @public
202
+ */
203
+ class DelegatesARIAListboxOption {
204
+ }
205
+ __decorate([
206
+ observable
207
+ ], DelegatesARIAListboxOption.prototype, "ariaChecked", void 0);
208
+ __decorate([
209
+ observable
210
+ ], DelegatesARIAListboxOption.prototype, "ariaPosInSet", void 0);
211
+ __decorate([
212
+ observable
213
+ ], DelegatesARIAListboxOption.prototype, "ariaSelected", void 0);
214
+ __decorate([
215
+ observable
216
+ ], DelegatesARIAListboxOption.prototype, "ariaSetSize", void 0);
217
+ applyMixins(DelegatesARIAListboxOption, ARIAGlobalStatesAndProperties);
218
+ applyMixins(ListboxOption, StartEnd, DelegatesARIAListboxOption);
219
+
26
220
  /**
27
221
  * A Listbox Custom HTML Element.
28
222
  * Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#listbox | ARIA listbox }.
@@ -3,11 +3,11 @@
3
3
  /**
4
4
  * Expose ltr and rtl strings
5
5
  */
6
- exports.Direction = void 0;
6
+ var Direction;
7
7
  (function (Direction) {
8
8
  Direction["ltr"] = "ltr";
9
9
  Direction["rtl"] = "rtl";
10
- })(exports.Direction || (exports.Direction = {}));
10
+ })(Direction || (Direction = {}));
11
11
 
12
12
  /**
13
13
  * a method to determine the current localization direction of the view
@@ -16,7 +16,16 @@ exports.Direction = void 0;
16
16
  */
17
17
  const getDirection = (rootNode) => {
18
18
  const dirNode = rootNode.closest("[dir]");
19
- return dirNode !== null && dirNode.dir === "rtl" ? exports.Direction.rtl : exports.Direction.ltr;
19
+ return dirNode !== null && dirNode.dir === "rtl" ? Direction.rtl : Direction.ltr;
20
20
  };
21
21
 
22
+ /**
23
+ * Expose ltr and rtl strings
24
+ */
25
+ exports.Direction = void 0;
26
+ (function (Direction) {
27
+ Direction["ltr"] = "ltr";
28
+ Direction["rtl"] = "rtl";
29
+ })(exports.Direction || (exports.Direction = {}));
30
+
22
31
  exports.getDirection = getDirection;
@@ -1,11 +1,11 @@
1
1
  /**
2
2
  * Expose ltr and rtl strings
3
3
  */
4
- var Direction;
4
+ var Direction$1;
5
5
  (function (Direction) {
6
6
  Direction["ltr"] = "ltr";
7
7
  Direction["rtl"] = "rtl";
8
- })(Direction || (Direction = {}));
8
+ })(Direction$1 || (Direction$1 = {}));
9
9
 
10
10
  /**
11
11
  * a method to determine the current localization direction of the view
@@ -14,7 +14,16 @@ var Direction;
14
14
  */
15
15
  const getDirection = (rootNode) => {
16
16
  const dirNode = rootNode.closest("[dir]");
17
- return dirNode !== null && dirNode.dir === "rtl" ? Direction.rtl : Direction.ltr;
17
+ return dirNode !== null && dirNode.dir === "rtl" ? Direction$1.rtl : Direction$1.ltr;
18
18
  };
19
19
 
20
+ /**
21
+ * Expose ltr and rtl strings
22
+ */
23
+ var Direction;
24
+ (function (Direction) {
25
+ Direction["ltr"] = "ltr";
26
+ Direction["rtl"] = "rtl";
27
+ })(Direction || (Direction = {}));
28
+
20
29
  export { Direction as D, getDirection as g };
@@ -21,18 +21,6 @@ function wrapInBounds(min, max, value) {
21
21
  function limit(min, max, value) {
22
22
  return Math.min(Math.max(value, min), max);
23
23
  }
24
- /**
25
- * Determines if a number value is within a specified range.
26
- *
27
- * @param value - the value to check
28
- * @param min - the range start
29
- * @param max - the range end
30
- */
31
- function inRange(value, min, max = 0) {
32
- [min, max] = [min, max].sort((a, b) => a - b);
33
- return min <= value && value < max;
34
- }
35
24
 
36
- exports.inRange = inRange;
37
25
  exports.limit = limit;
38
26
  exports.wrapInBounds = wrapInBounds;
package/shared/numbers.js CHANGED
@@ -19,16 +19,5 @@ function wrapInBounds(min, max, value) {
19
19
  function limit(min, max, value) {
20
20
  return Math.min(Math.max(value, min), max);
21
21
  }
22
- /**
23
- * Determines if a number value is within a specified range.
24
- *
25
- * @param value - the value to check
26
- * @param min - the range start
27
- * @param max - the range end
28
- */
29
- function inRange(value, min, max = 0) {
30
- [min, max] = [min, max].sort((a, b) => a - b);
31
- return min <= value && value < max;
32
- }
33
22
 
34
- export { inRange as i, limit as l, wrapInBounds as w };
23
+ export { limit as l, wrapInBounds as w };
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- const definition$2 = require('./definition11.cjs');
3
+ const definition$1 = require('./definition11.cjs');
4
4
  const definition = require('./definition64.cjs');
5
- const definition$1 = require('./definition56.cjs');
6
- const definition$3 = require('./definition22.cjs');
5
+ const textField = require('./text-field2.cjs');
6
+ const definition$2 = require('./definition22.cjs');
7
7
  const index = require('./index.cjs');
8
8
  const ref = require('./ref.cjs');
9
9
  const slotted = require('./slotted.cjs');
@@ -5525,7 +5525,7 @@ const areMonthsEqual = (a, b) => compareMonths(a, b) === 0;
5525
5525
  const monthToStr = ({ month, year }) => `${year.toString().padStart(4, "0")}-${(month + 1).toString().padStart(2, "0")}`;
5526
5526
 
5527
5527
  function renderDialogHeader(context) {
5528
- const buttonTag = context.tagFor(definition$2.Button$1);
5528
+ const buttonTag = context.tagFor(definition$1.Button$1);
5529
5529
  return index.html`<div class="header">
5530
5530
  ${when.when(
5531
5531
  (x) => x.prevYearButton,
@@ -5615,7 +5615,7 @@ function renderDialogHeader(context) {
5615
5615
  </div>`;
5616
5616
  }
5617
5617
  function renderCalendarGrid(context) {
5618
- const dividerTag = context.tagFor(definition$3.Divider);
5618
+ const dividerTag = context.tagFor(definition$2.Divider);
5619
5619
  return index.html`<div
5620
5620
  class="calendar"
5621
5621
  role="grid"
@@ -5705,7 +5705,7 @@ function renderCalendarGrid(context) {
5705
5705
  )}`;
5706
5706
  }
5707
5707
  function renderMonthPickerGrid(context) {
5708
- const dividerTag = context.tagFor(definition$3.Divider);
5708
+ const dividerTag = context.tagFor(definition$2.Divider);
5709
5709
  return index.html`
5710
5710
  <${dividerTag}
5711
5711
  class="months-separator"
@@ -5779,8 +5779,8 @@ function renderMonthPickerGrid(context) {
5779
5779
  }
5780
5780
  const DatePickerBaseTemplate = (context, _) => {
5781
5781
  const popupTag = context.tagFor(definition.Popup);
5782
- const textFieldTag = context.tagFor(definition$1.TextField);
5783
- const buttonTag = context.tagFor(definition$2.Button$1);
5782
+ const textFieldTag = context.tagFor(textField.TextField);
5783
+ const buttonTag = context.tagFor(definition$1.Button$1);
5784
5784
  return index.html`<div class="base" @keydown="${(x, { event }) => x._onBaseKeyDown(event)}">
5785
5785
  <${textFieldTag} id="text-field"
5786
5786
  ${ref.ref("_textFieldEl")}
@@ -5991,6 +5991,12 @@ class DatePickerBase extends FormAssociatedDatePickerBase {
5991
5991
  this.#onFocusOut = () => {
5992
5992
  this.$emit("blur", void 0, { bubbles: false });
5993
5993
  };
5994
+ // Reformat the presentation value when the locale changes
5995
+ this.#localeChangeHandler = {
5996
+ handleChange: () => {
5997
+ this._updatePresentationValue();
5998
+ }
5999
+ };
5994
6000
  this._popupOpen = false;
5995
6001
  this.#dismissOnClickOutside = (event) => {
5996
6002
  if (!this._popupOpen) {
@@ -6081,12 +6087,18 @@ class DatePickerBase extends FormAssociatedDatePickerBase {
6081
6087
  document.addEventListener("click", this.#dismissOnClickOutside);
6082
6088
  this.addEventListener("focusin", this.#onFocusIn);
6083
6089
  this.addEventListener("focusout", this.#onFocusOut);
6090
+ this.#localeChangeObserver = index.Observable.binding(
6091
+ () => this.locale,
6092
+ this.#localeChangeHandler
6093
+ );
6094
+ this.#localeChangeObserver.observe(this, index.defaultExecutionContext);
6084
6095
  }
6085
6096
  disconnectedCallback() {
6086
6097
  super.disconnectedCallback();
6087
6098
  document.removeEventListener("click", this.#dismissOnClickOutside);
6088
6099
  this.removeEventListener("focusin", this.#onFocusIn);
6089
6100
  this.removeEventListener("focusout", this.#onFocusOut);
6101
+ this.#localeChangeObserver.disconnect();
6090
6102
  }
6091
6103
  #onFocusIn;
6092
6104
  #onFocusOut;
@@ -6099,6 +6111,8 @@ class DatePickerBase extends FormAssociatedDatePickerBase {
6099
6111
  }
6100
6112
  super.validate(this._textFieldEl?.querySelector("input") ?? void 0);
6101
6113
  }
6114
+ #localeChangeHandler;
6115
+ #localeChangeObserver;
6102
6116
  #dismissOnClickOutside;
6103
6117
  #openPopupIfPossible() {
6104
6118
  if (!this.readOnly) {
@@ -1,8 +1,8 @@
1
1
  import { c as Button } from './definition11.js';
2
2
  import { P as Popup } from './definition64.js';
3
- import { T as TextField } from './definition56.js';
3
+ import { T as TextField } from './text-field2.js';
4
4
  import { D as Divider } from './definition22.js';
5
- import { h as html, F as FoundationElement, D as DOM, a as attr, o as observable, v as volatile } from './index.js';
5
+ import { h as html, F as FoundationElement, O as Observable, g as defaultExecutionContext, D as DOM, a as attr, o as observable, v as volatile } from './index.js';
6
6
  import { r as ref } from './ref.js';
7
7
  import { s as slotted } from './slotted.js';
8
8
  import { r as repeat } from './repeat.js';
@@ -5989,6 +5989,12 @@ class DatePickerBase extends FormAssociatedDatePickerBase {
5989
5989
  this.#onFocusOut = () => {
5990
5990
  this.$emit("blur", void 0, { bubbles: false });
5991
5991
  };
5992
+ // Reformat the presentation value when the locale changes
5993
+ this.#localeChangeHandler = {
5994
+ handleChange: () => {
5995
+ this._updatePresentationValue();
5996
+ }
5997
+ };
5992
5998
  this._popupOpen = false;
5993
5999
  this.#dismissOnClickOutside = (event) => {
5994
6000
  if (!this._popupOpen) {
@@ -6079,12 +6085,18 @@ class DatePickerBase extends FormAssociatedDatePickerBase {
6079
6085
  document.addEventListener("click", this.#dismissOnClickOutside);
6080
6086
  this.addEventListener("focusin", this.#onFocusIn);
6081
6087
  this.addEventListener("focusout", this.#onFocusOut);
6088
+ this.#localeChangeObserver = Observable.binding(
6089
+ () => this.locale,
6090
+ this.#localeChangeHandler
6091
+ );
6092
+ this.#localeChangeObserver.observe(this, defaultExecutionContext);
6082
6093
  }
6083
6094
  disconnectedCallback() {
6084
6095
  super.disconnectedCallback();
6085
6096
  document.removeEventListener("click", this.#dismissOnClickOutside);
6086
6097
  this.removeEventListener("focusin", this.#onFocusIn);
6087
6098
  this.removeEventListener("focusout", this.#onFocusOut);
6099
+ this.#localeChangeObserver.disconnect();
6088
6100
  }
6089
6101
  #onFocusIn;
6090
6102
  #onFocusOut;
@@ -6097,6 +6109,8 @@ class DatePickerBase extends FormAssociatedDatePickerBase {
6097
6109
  }
6098
6110
  super.validate(this._textFieldEl?.querySelector("input") ?? void 0);
6099
6111
  }
6112
+ #localeChangeHandler;
6113
+ #localeChangeObserver;
6100
6114
  #dismissOnClickOutside;
6101
6115
  #openPopupIfPossible() {
6102
6116
  if (!this.readOnly) {