@vonage/vivid 4.3.0 → 4.5.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 (161) hide show
  1. package/api-extractor.json +25 -0
  2. package/custom-elements.json +444 -692
  3. package/index.cjs +18 -17
  4. package/index.js +3 -3
  5. package/lib/dialog/dialog.d.ts +1 -0
  6. package/lib/empty-state/definition.d.ts +1 -0
  7. package/lib/empty-state/empty-state.d.ts +5 -0
  8. package/lib/enums.d.ts +4 -0
  9. package/lib/fab/fab.d.ts +1 -1
  10. package/lib/icon/icon.d.ts +1 -1
  11. package/lib/popup/popup.d.ts +5 -0
  12. package/lib/range-slider/range-slider.d.ts +2 -0
  13. package/lib/select/select.d.ts +1 -0
  14. package/lib/slider/slider.d.ts +5 -0
  15. package/lib/slider/slider.template.d.ts +2 -2
  16. package/lib/tabs/tabs.d.ts +2 -0
  17. package/lib/video-player/video-player.d.ts +0 -1
  18. package/listbox/index.cjs +1 -1
  19. package/listbox/index.js +1 -1
  20. package/package.json +6 -1
  21. package/shared/anchored.js +1 -1
  22. package/shared/calendar-event.js +1 -1
  23. package/shared/definition.cjs +2 -2
  24. package/shared/definition.js +2 -2
  25. package/shared/definition11.cjs +1 -1
  26. package/shared/definition11.js +1 -1
  27. package/shared/definition12.cjs +1 -1
  28. package/shared/definition12.js +1 -1
  29. package/shared/definition13.js +1 -1
  30. package/shared/definition15.cjs +7 -8
  31. package/shared/definition15.js +2 -3
  32. package/shared/definition16.cjs +10 -6
  33. package/shared/definition16.js +9 -5
  34. package/shared/definition17.cjs +2 -2
  35. package/shared/definition17.js +2 -2
  36. package/shared/definition18.cjs +3 -4
  37. package/shared/definition18.js +1 -2
  38. package/shared/definition19.cjs +3 -4
  39. package/shared/definition19.js +1 -2
  40. package/shared/definition20.cjs +2 -4
  41. package/shared/definition20.js +3 -5
  42. package/shared/definition21.cjs +72 -34
  43. package/shared/definition21.js +73 -35
  44. package/shared/definition23.cjs +18 -3
  45. package/shared/definition23.js +18 -3
  46. package/shared/definition24.cjs +2 -2
  47. package/shared/definition24.js +2 -2
  48. package/shared/definition25.cjs +7 -8
  49. package/shared/definition25.js +3 -4
  50. package/shared/definition26.js +1 -1
  51. package/shared/definition27.cjs +1 -1
  52. package/shared/definition27.js +1 -1
  53. package/shared/definition28.js +1 -1
  54. package/shared/definition29.cjs +4 -4
  55. package/shared/definition29.js +4 -4
  56. package/shared/definition3.cjs +1 -1
  57. package/shared/definition3.js +2 -2
  58. package/shared/definition30.cjs +3 -2
  59. package/shared/definition30.js +3 -2
  60. package/shared/definition31.cjs +1 -1
  61. package/shared/definition31.js +2 -2
  62. package/shared/definition32.cjs +1 -1
  63. package/shared/definition32.js +1 -1
  64. package/shared/definition34.cjs +2 -3
  65. package/shared/definition34.js +2 -3
  66. package/shared/definition35.cjs +10 -10
  67. package/shared/definition35.js +5 -5
  68. package/shared/definition36.cjs +1 -1
  69. package/shared/definition36.js +1 -1
  70. package/shared/definition37.js +1 -1
  71. package/shared/definition38.cjs +1 -1
  72. package/shared/definition38.js +1 -1
  73. package/shared/definition4.cjs +5 -3
  74. package/shared/definition4.js +6 -4
  75. package/shared/definition41.cjs +1 -1
  76. package/shared/definition41.js +1 -1
  77. package/shared/definition42.cjs +127 -23
  78. package/shared/definition42.js +127 -23
  79. package/shared/definition43.cjs +18 -11
  80. package/shared/definition43.js +13 -6
  81. package/shared/definition44.cjs +1 -1
  82. package/shared/definition44.js +2 -2
  83. package/shared/definition45.cjs +3 -2
  84. package/shared/definition45.js +4 -3
  85. package/shared/definition46.cjs +97 -14
  86. package/shared/definition46.js +98 -15
  87. package/shared/definition47.cjs +2 -3
  88. package/shared/definition47.js +3 -4
  89. package/shared/definition48.cjs +1 -1
  90. package/shared/definition48.js +1 -1
  91. package/shared/definition5.cjs +4 -5
  92. package/shared/definition5.js +4 -5
  93. package/shared/definition50.cjs +1 -1
  94. package/shared/definition50.js +1 -1
  95. package/shared/definition51.cjs +56 -10
  96. package/shared/definition51.js +56 -10
  97. package/shared/definition52.js +1 -1
  98. package/shared/definition53.cjs +1 -1
  99. package/shared/definition53.js +2 -2
  100. package/shared/definition54.cjs +8 -9
  101. package/shared/definition54.js +2 -3
  102. package/shared/definition55.cjs +8 -8
  103. package/shared/definition55.js +2 -2
  104. package/shared/definition56.cjs +9 -9
  105. package/shared/definition56.js +7 -7
  106. package/shared/definition57.cjs +10 -1
  107. package/shared/definition57.js +11 -2
  108. package/shared/definition58.cjs +7 -1
  109. package/shared/definition58.js +8 -2
  110. package/shared/definition59.cjs +1 -1
  111. package/shared/definition59.js +1 -1
  112. package/shared/definition6.cjs +1 -1
  113. package/shared/definition6.js +1 -1
  114. package/shared/definition61.cjs +65845 -2
  115. package/shared/definition61.js +65845 -2
  116. package/shared/definition62.js +1 -1
  117. package/shared/definition63.cjs +155 -2
  118. package/shared/definition63.js +156 -4
  119. package/shared/definition7.cjs +1 -1
  120. package/shared/definition7.js +1 -1
  121. package/shared/definition8.cjs +2 -3
  122. package/shared/definition8.js +3 -4
  123. package/shared/definition9.cjs +1 -1
  124. package/shared/definition9.js +1 -1
  125. package/shared/dialog/index.d.ts +1 -0
  126. package/shared/enums.cjs +6 -0
  127. package/shared/enums.js +6 -1
  128. package/shared/form-elements.cjs +236 -0
  129. package/shared/form-elements.js +229 -0
  130. package/shared/icon.js +1 -1
  131. package/shared/index2.cjs +6 -256
  132. package/shared/index2.js +6 -249
  133. package/shared/localized.cjs +26 -2
  134. package/shared/localized.js +25 -2
  135. package/shared/patterns/anchored.d.ts +4 -4
  136. package/shared/playbackRates.cjs +13 -0
  137. package/shared/playbackRates.js +11 -0
  138. package/shared/presentationDate.cjs +9 -9
  139. package/shared/presentationDate.js +9 -9
  140. package/shared/slider.template.cjs +27 -4
  141. package/shared/slider.template.js +27 -4
  142. package/shared/text-anchor.cjs +1 -1
  143. package/shared/text-anchor.js +1 -1
  144. package/shared/text-field.cjs +1 -1
  145. package/shared/text-field.js +1 -1
  146. package/shared/utils/playbackRates.d.ts +1 -0
  147. package/styles/core/all.css +1 -1
  148. package/styles/core/theme.css +1 -1
  149. package/styles/core/typography.css +1 -1
  150. package/styles/tokens/theme-dark.css +4 -4
  151. package/styles/tokens/theme-light.css +4 -4
  152. package/styles/tokens/vivid-2-compat.css +1 -1
  153. package/tsdoc-metadata.json +11 -0
  154. package/vivid.api.json +228 -8
  155. package/appearance-ui/index.cjs +0 -102
  156. package/appearance-ui/index.js +0 -100
  157. package/lib/appearance-ui/appearance-ui.d.ts +0 -12
  158. package/lib/appearance-ui/appearance-ui.template.d.ts +0 -4
  159. package/lib/appearance-ui/definition.d.ts +0 -3
  160. package/shared/video-player.cjs +0 -65860
  161. package/shared/video-player.js +0 -65857
package/shared/index2.cjs CHANGED
@@ -1,261 +1,11 @@
1
1
  'use strict';
2
2
 
3
- const icon = require('./icon.cjs');
4
- const index = require('./index.cjs');
5
- const slotted = require('./slotted.cjs');
6
- const classNames = require('./class-names.cjs');
7
- const when = require('./when.cjs');
8
- const locales_enUS = require('../locales/en-US.cjs');
9
-
10
- const messageStyles = ".sr-only{position:absolute;overflow:hidden;width:1px;height:1px;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap}.message{display:none;contain:inline-size;font:var(--vvd-typography-base-condensed);gap:4px;grid-column:1/-1}.message--visible{display:flex}.message-text{color:var(--vvd-color-canvas-text)}.helper-message .message-text{color:var(--_low-ink-color)}.message-icon{font-size:16px}.success-message .message-icon{color:var(--vvd-color-success-500)}.error-message .message-icon{color:var(--vvd-color-alert-500)}";
11
-
12
- var __defProp$1 = Object.defineProperty;
13
- var __decorateClass$1 = (decorators, target, key, kind) => {
14
- var result = void 0 ;
15
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
16
- if (decorator = decorators[i])
17
- result = (decorator(target, key, result) ) || result;
18
- if (result) __defProp$1(target, key, result);
19
- return result;
20
- };
21
- class FormElementHelperText {
22
- }
23
- __decorateClass$1([
24
- index.attr({ attribute: "helper-text" })
25
- ], FormElementHelperText.prototype, "helperText");
26
- __decorateClass$1([
27
- index.observable
28
- ], FormElementHelperText.prototype, "_helperTextSlottedContent");
29
- class FormElementSuccessText {
30
- }
31
- __decorateClass$1([
32
- index.attr({ attribute: "success-text" })
33
- ], FormElementSuccessText.prototype, "successText");
34
- class FormElementCharCount {
35
- constructor() {
36
- this.charCount = false;
37
- }
38
- }
39
- __decorateClass$1([
40
- index.attr({
41
- attribute: "char-count",
42
- mode: "boolean"
43
- })
44
- ], FormElementCharCount.prototype, "charCount");
45
- function formElements(constructor) {
46
- let currentPrototype = constructor.prototype;
47
- while (currentPrototype) {
48
- const parentPrototype = Object.getPrototypeOf(currentPrototype);
49
- if (currentPrototype.validate && !parentPrototype.validate) {
50
- currentPrototype.validate = function(anchor) {
51
- if (this.proxy instanceof HTMLElement && this.elementInternals) {
52
- const isValid = this.proxy.validity.valid;
53
- const controlIsInvalidDueToMinOrMaxLength = this.control && this.control.validity && !this.control.validity.valid && (this.control.validity.tooShort || this.control.validity.tooLong);
54
- if (isValid && controlIsInvalidDueToMinOrMaxLength) {
55
- this.setValidity(
56
- this.control.validity,
57
- this.control.validationMessage,
58
- anchor
59
- );
60
- } else {
61
- this.setValidity(
62
- this.proxy.validity,
63
- this.proxy.validationMessage,
64
- anchor
65
- );
66
- }
67
- }
68
- };
69
- break;
70
- }
71
- currentPrototype = parentPrototype;
72
- }
73
- class Decorated extends constructor {
74
- constructor(...args) {
75
- super(...args);
76
- this.errorValidationMessage = "";
77
- this.#forceErrorDisplay = false;
78
- this.#hasBeenTouched = false;
79
- this.#handleInvalidEvent = () => {
80
- this.#forceErrorDisplay = true;
81
- this.validate();
82
- };
83
- this.validate = () => {
84
- super.validate();
85
- const shouldShowValidationError = this.#forceErrorDisplay || this.#hasBeenTouched && this.dirtyValue;
86
- this.errorValidationMessage = shouldShowValidationError ? this.validationMessage : "";
87
- };
88
- this.addEventListener("blur", () => {
89
- this.#hasBeenTouched = true;
90
- this.#forceErrorDisplay = false;
91
- this.validate();
92
- });
93
- this.addEventListener("focus", () => {
94
- this.#hasBeenTouched = false;
95
- });
96
- this.addEventListener("invalid", () => {
97
- this.proxy.dispatchEvent(new Event("invalid"));
98
- });
99
- }
100
- #forceErrorDisplay;
101
- #hasBeenTouched;
102
- connectedCallback() {
103
- super.connectedCallback();
104
- this.proxy.addEventListener("invalid", this.#handleInvalidEvent);
105
- }
106
- #handleInvalidEvent;
107
- disconnectedCallback() {
108
- super.disconnectedCallback();
109
- this.proxy.removeEventListener("invalid", this.#handleInvalidEvent);
110
- }
111
- formResetCallback() {
112
- this.#forceErrorDisplay = false;
113
- super.formResetCallback();
114
- this.validate();
115
- }
116
- }
117
- __decorateClass$1([
118
- index.attr
119
- ], Decorated.prototype, "label");
120
- __decorateClass$1([
121
- index.observable
122
- ], Decorated.prototype, "errorValidationMessage");
123
- return Decorated;
124
- }
125
- const feedback = {
126
- helper: {
127
- messageProperty: "helperText",
128
- className: "helper",
129
- slot: {
130
- name: "helper-text",
131
- slottedContentProperty: "_helperTextSlottedContent"
132
- },
133
- role: "none"
134
- },
135
- error: {
136
- messageProperty: "errorValidationMessage",
137
- className: "error",
138
- iconType: "info-line",
139
- role: "status"
140
- },
141
- success: {
142
- messageProperty: "successText",
143
- className: "success",
144
- iconType: "check-circle-line",
145
- role: "none"
146
- }
147
- };
148
- const isFeedbackAvailable = (config, x) => Boolean(
149
- x[config.messageProperty] || config.slot && x[config.slot.slottedContentProperty]?.length
150
- );
151
- function getFeedbackTemplate(context) {
152
- return index.html`
153
- <style>
154
- ${messageStyles}
155
- </style>
156
- ${getFeedbackTypeTemplate(
157
- context,
158
- feedback.helper,
159
- (x) => isFeedbackAvailable(feedback.helper, x) && !isFeedbackAvailable(feedback.error, x) && !isFeedbackAvailable(feedback.success, x)
160
- )}
161
- ${getFeedbackTypeTemplate(
162
- context,
163
- feedback.error,
164
- (x) => isFeedbackAvailable(feedback.error, x) && !isFeedbackAvailable(feedback.success, x)
165
- )}
166
- ${getFeedbackTypeTemplate(
167
- context,
168
- feedback.success,
169
- (x) => isFeedbackAvailable(feedback.success, x)
170
- )}
171
- `;
172
- }
173
- function getFeedbackTypeTemplate(context, config, shouldShow) {
174
- const iconTag = context.tagFor(icon.Icon);
175
- const messageTemplate = index.html`${(x) => x[config.messageProperty]}`;
176
- const innerTemplate = config.slot ? index.html`<slot
177
- name="${config.slot.name}"
178
- ${slotted.slotted(config.slot.slottedContentProperty)}
179
- >${messageTemplate}</slot
180
- >` : messageTemplate;
181
- return index.html`<div
182
- class="${(x) => classNames.classNames(
183
- "message",
184
- `${config.className}-message`,
185
- ["message--visible", config.role === "status" || shouldShow(x)],
186
- ["sr-only", !shouldShow(x)]
187
- )}"
188
- role="${config.role}"
189
- aria-atomic="false"
190
- >
191
- ${when.when(
192
- (x) => shouldShow(x) && config.iconType,
193
- index.html`<${iconTag} class="message-icon" name="${config.iconType}"></${iconTag}>`
194
- )}
195
- <span class="message-text">${innerTemplate}</span>
196
- </div>`;
197
- }
198
- function errorText(constructor) {
199
- class Decorated extends constructor {
200
- #blockValidateCalls = false;
201
- constructor(...args) {
202
- super(...args);
203
- this._validate = this.validate;
204
- this.validate = () => {
205
- if (!this.#blockValidateCalls) this._validate();
206
- };
207
- }
208
- errorTextChanged(_, newErrorText) {
209
- if (newErrorText) {
210
- this.#forceCustomError(newErrorText);
211
- } else {
212
- this.#clearCustomErrorAndRevalidate();
213
- }
214
- }
215
- #forceCustomError(errorMessage) {
216
- this.setValidity({ customError: true }, errorMessage, this.control);
217
- this.errorValidationMessage = errorMessage;
218
- this.#blockValidateCalls = true;
219
- }
220
- #clearCustomErrorAndRevalidate() {
221
- this.setValidity({}, "", this.control);
222
- this.#blockValidateCalls = false;
223
- this.validate();
224
- }
225
- }
226
- __decorateClass$1([
227
- index.attr({ attribute: "error-text" })
228
- ], Decorated.prototype, "errorText");
229
- return Decorated;
230
- }
231
-
232
- var __defProp = Object.defineProperty;
233
- var __decorateClass = (decorators, target, key, kind) => {
234
- var result = void 0 ;
235
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
236
- if (decorator = decorators[i])
237
- result = (decorator(target, key, result) ) || result;
238
- if (result) __defProp(target, key, result);
239
- return result;
240
- };
241
- class CurrentLocale {
242
- constructor() {
243
- this.locale = locales_enUS;
3
+ function handleEscapeKeyAndStopPropogation(event) {
4
+ if (event.key === "Escape") {
5
+ event.stopPropagation();
6
+ return true;
244
7
  }
8
+ return false;
245
9
  }
246
- __decorateClass([
247
- index.observable
248
- ], CurrentLocale.prototype, "locale");
249
- const currentLocale = new CurrentLocale();
250
- const setLocale = (locale) => {
251
- currentLocale.locale = locale;
252
- };
253
10
 
254
- exports.FormElementCharCount = FormElementCharCount;
255
- exports.FormElementHelperText = FormElementHelperText;
256
- exports.FormElementSuccessText = FormElementSuccessText;
257
- exports.currentLocale = currentLocale;
258
- exports.errorText = errorText;
259
- exports.formElements = formElements;
260
- exports.getFeedbackTemplate = getFeedbackTemplate;
261
- exports.setLocale = setLocale;
11
+ exports.handleEscapeKeyAndStopPropogation = handleEscapeKeyAndStopPropogation;
package/shared/index2.js CHANGED
@@ -1,252 +1,9 @@
1
- import { I as Icon } from './icon.js';
2
- import { a as attr, o as observable, h as html } from './index.js';
3
- import { s as slotted } from './slotted.js';
4
- import { c as classNames } from './class-names.js';
5
- import { w as when } from './when.js';
6
- import enUS from '../locales/en-US.js';
7
-
8
- const messageStyles = ".sr-only{position:absolute;overflow:hidden;width:1px;height:1px;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap}.message{display:none;contain:inline-size;font:var(--vvd-typography-base-condensed);gap:4px;grid-column:1/-1}.message--visible{display:flex}.message-text{color:var(--vvd-color-canvas-text)}.helper-message .message-text{color:var(--_low-ink-color)}.message-icon{font-size:16px}.success-message .message-icon{color:var(--vvd-color-success-500)}.error-message .message-icon{color:var(--vvd-color-alert-500)}";
9
-
10
- var __defProp$1 = Object.defineProperty;
11
- var __decorateClass$1 = (decorators, target, key, kind) => {
12
- var result = void 0 ;
13
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
14
- if (decorator = decorators[i])
15
- result = (decorator(target, key, result) ) || result;
16
- if (result) __defProp$1(target, key, result);
17
- return result;
18
- };
19
- class FormElementHelperText {
20
- }
21
- __decorateClass$1([
22
- attr({ attribute: "helper-text" })
23
- ], FormElementHelperText.prototype, "helperText");
24
- __decorateClass$1([
25
- observable
26
- ], FormElementHelperText.prototype, "_helperTextSlottedContent");
27
- class FormElementSuccessText {
28
- }
29
- __decorateClass$1([
30
- attr({ attribute: "success-text" })
31
- ], FormElementSuccessText.prototype, "successText");
32
- class FormElementCharCount {
33
- constructor() {
34
- this.charCount = false;
35
- }
36
- }
37
- __decorateClass$1([
38
- attr({
39
- attribute: "char-count",
40
- mode: "boolean"
41
- })
42
- ], FormElementCharCount.prototype, "charCount");
43
- function formElements(constructor) {
44
- let currentPrototype = constructor.prototype;
45
- while (currentPrototype) {
46
- const parentPrototype = Object.getPrototypeOf(currentPrototype);
47
- if (currentPrototype.validate && !parentPrototype.validate) {
48
- currentPrototype.validate = function(anchor) {
49
- if (this.proxy instanceof HTMLElement && this.elementInternals) {
50
- const isValid = this.proxy.validity.valid;
51
- const controlIsInvalidDueToMinOrMaxLength = this.control && this.control.validity && !this.control.validity.valid && (this.control.validity.tooShort || this.control.validity.tooLong);
52
- if (isValid && controlIsInvalidDueToMinOrMaxLength) {
53
- this.setValidity(
54
- this.control.validity,
55
- this.control.validationMessage,
56
- anchor
57
- );
58
- } else {
59
- this.setValidity(
60
- this.proxy.validity,
61
- this.proxy.validationMessage,
62
- anchor
63
- );
64
- }
65
- }
66
- };
67
- break;
68
- }
69
- currentPrototype = parentPrototype;
70
- }
71
- class Decorated extends constructor {
72
- constructor(...args) {
73
- super(...args);
74
- this.errorValidationMessage = "";
75
- this.#forceErrorDisplay = false;
76
- this.#hasBeenTouched = false;
77
- this.#handleInvalidEvent = () => {
78
- this.#forceErrorDisplay = true;
79
- this.validate();
80
- };
81
- this.validate = () => {
82
- super.validate();
83
- const shouldShowValidationError = this.#forceErrorDisplay || this.#hasBeenTouched && this.dirtyValue;
84
- this.errorValidationMessage = shouldShowValidationError ? this.validationMessage : "";
85
- };
86
- this.addEventListener("blur", () => {
87
- this.#hasBeenTouched = true;
88
- this.#forceErrorDisplay = false;
89
- this.validate();
90
- });
91
- this.addEventListener("focus", () => {
92
- this.#hasBeenTouched = false;
93
- });
94
- this.addEventListener("invalid", () => {
95
- this.proxy.dispatchEvent(new Event("invalid"));
96
- });
97
- }
98
- #forceErrorDisplay;
99
- #hasBeenTouched;
100
- connectedCallback() {
101
- super.connectedCallback();
102
- this.proxy.addEventListener("invalid", this.#handleInvalidEvent);
103
- }
104
- #handleInvalidEvent;
105
- disconnectedCallback() {
106
- super.disconnectedCallback();
107
- this.proxy.removeEventListener("invalid", this.#handleInvalidEvent);
108
- }
109
- formResetCallback() {
110
- this.#forceErrorDisplay = false;
111
- super.formResetCallback();
112
- this.validate();
113
- }
114
- }
115
- __decorateClass$1([
116
- attr
117
- ], Decorated.prototype, "label");
118
- __decorateClass$1([
119
- observable
120
- ], Decorated.prototype, "errorValidationMessage");
121
- return Decorated;
122
- }
123
- const feedback = {
124
- helper: {
125
- messageProperty: "helperText",
126
- className: "helper",
127
- slot: {
128
- name: "helper-text",
129
- slottedContentProperty: "_helperTextSlottedContent"
130
- },
131
- role: "none"
132
- },
133
- error: {
134
- messageProperty: "errorValidationMessage",
135
- className: "error",
136
- iconType: "info-line",
137
- role: "status"
138
- },
139
- success: {
140
- messageProperty: "successText",
141
- className: "success",
142
- iconType: "check-circle-line",
143
- role: "none"
144
- }
145
- };
146
- const isFeedbackAvailable = (config, x) => Boolean(
147
- x[config.messageProperty] || config.slot && x[config.slot.slottedContentProperty]?.length
148
- );
149
- function getFeedbackTemplate(context) {
150
- return html`
151
- <style>
152
- ${messageStyles}
153
- </style>
154
- ${getFeedbackTypeTemplate(
155
- context,
156
- feedback.helper,
157
- (x) => isFeedbackAvailable(feedback.helper, x) && !isFeedbackAvailable(feedback.error, x) && !isFeedbackAvailable(feedback.success, x)
158
- )}
159
- ${getFeedbackTypeTemplate(
160
- context,
161
- feedback.error,
162
- (x) => isFeedbackAvailable(feedback.error, x) && !isFeedbackAvailable(feedback.success, x)
163
- )}
164
- ${getFeedbackTypeTemplate(
165
- context,
166
- feedback.success,
167
- (x) => isFeedbackAvailable(feedback.success, x)
168
- )}
169
- `;
170
- }
171
- function getFeedbackTypeTemplate(context, config, shouldShow) {
172
- const iconTag = context.tagFor(Icon);
173
- const messageTemplate = html`${(x) => x[config.messageProperty]}`;
174
- const innerTemplate = config.slot ? html`<slot
175
- name="${config.slot.name}"
176
- ${slotted(config.slot.slottedContentProperty)}
177
- >${messageTemplate}</slot
178
- >` : messageTemplate;
179
- return html`<div
180
- class="${(x) => classNames(
181
- "message",
182
- `${config.className}-message`,
183
- ["message--visible", config.role === "status" || shouldShow(x)],
184
- ["sr-only", !shouldShow(x)]
185
- )}"
186
- role="${config.role}"
187
- aria-atomic="false"
188
- >
189
- ${when(
190
- (x) => shouldShow(x) && config.iconType,
191
- html`<${iconTag} class="message-icon" name="${config.iconType}"></${iconTag}>`
192
- )}
193
- <span class="message-text">${innerTemplate}</span>
194
- </div>`;
195
- }
196
- function errorText(constructor) {
197
- class Decorated extends constructor {
198
- #blockValidateCalls = false;
199
- constructor(...args) {
200
- super(...args);
201
- this._validate = this.validate;
202
- this.validate = () => {
203
- if (!this.#blockValidateCalls) this._validate();
204
- };
205
- }
206
- errorTextChanged(_, newErrorText) {
207
- if (newErrorText) {
208
- this.#forceCustomError(newErrorText);
209
- } else {
210
- this.#clearCustomErrorAndRevalidate();
211
- }
212
- }
213
- #forceCustomError(errorMessage) {
214
- this.setValidity({ customError: true }, errorMessage, this.control);
215
- this.errorValidationMessage = errorMessage;
216
- this.#blockValidateCalls = true;
217
- }
218
- #clearCustomErrorAndRevalidate() {
219
- this.setValidity({}, "", this.control);
220
- this.#blockValidateCalls = false;
221
- this.validate();
222
- }
223
- }
224
- __decorateClass$1([
225
- attr({ attribute: "error-text" })
226
- ], Decorated.prototype, "errorText");
227
- return Decorated;
228
- }
229
-
230
- var __defProp = Object.defineProperty;
231
- var __decorateClass = (decorators, target, key, kind) => {
232
- var result = void 0 ;
233
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
234
- if (decorator = decorators[i])
235
- result = (decorator(target, key, result) ) || result;
236
- if (result) __defProp(target, key, result);
237
- return result;
238
- };
239
- class CurrentLocale {
240
- constructor() {
241
- this.locale = enUS;
1
+ function handleEscapeKeyAndStopPropogation(event) {
2
+ if (event.key === "Escape") {
3
+ event.stopPropagation();
4
+ return true;
242
5
  }
6
+ return false;
243
7
  }
244
- __decorateClass([
245
- observable
246
- ], CurrentLocale.prototype, "locale");
247
- const currentLocale = new CurrentLocale();
248
- const setLocale = (locale) => {
249
- currentLocale.locale = locale;
250
- };
251
8
 
252
- export { FormElementSuccessText as F, FormElementHelperText as a, FormElementCharCount as b, currentLocale as c, errorText as e, formElements as f, getFeedbackTemplate as g, setLocale as s };
9
+ export { handleEscapeKeyAndStopPropogation as h };
@@ -1,11 +1,35 @@
1
1
  'use strict';
2
2
 
3
- const index = require('./index2.cjs');
3
+ const locales_enUS = require('../locales/en-US.cjs');
4
+ const index = require('./index.cjs');
5
+
6
+ var __defProp = Object.defineProperty;
7
+ var __decorateClass = (decorators, target, key, kind) => {
8
+ var result = void 0 ;
9
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
10
+ if (decorator = decorators[i])
11
+ result = (decorator(target, key, result) ) || result;
12
+ if (result) __defProp(target, key, result);
13
+ return result;
14
+ };
15
+ class CurrentLocale {
16
+ constructor() {
17
+ this.locale = locales_enUS;
18
+ }
19
+ }
20
+ __decorateClass([
21
+ index.observable
22
+ ], CurrentLocale.prototype, "locale");
23
+ const currentLocale = new CurrentLocale();
24
+ const setLocale = (locale) => {
25
+ currentLocale.locale = locale;
26
+ };
4
27
 
5
28
  class Localized {
6
29
  get locale() {
7
- return index.currentLocale.locale;
30
+ return currentLocale.locale;
8
31
  }
9
32
  }
10
33
 
11
34
  exports.Localized = Localized;
35
+ exports.setLocale = setLocale;
@@ -1,4 +1,27 @@
1
- import { c as currentLocale } from './index2.js';
1
+ import enUS from '../locales/en-US.js';
2
+ import { o as observable } from './index.js';
3
+
4
+ var __defProp = Object.defineProperty;
5
+ var __decorateClass = (decorators, target, key, kind) => {
6
+ var result = void 0 ;
7
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
8
+ if (decorator = decorators[i])
9
+ result = (decorator(target, key, result) ) || result;
10
+ if (result) __defProp(target, key, result);
11
+ return result;
12
+ };
13
+ class CurrentLocale {
14
+ constructor() {
15
+ this.locale = enUS;
16
+ }
17
+ }
18
+ __decorateClass([
19
+ observable
20
+ ], CurrentLocale.prototype, "locale");
21
+ const currentLocale = new CurrentLocale();
22
+ const setLocale = (locale) => {
23
+ currentLocale.locale = locale;
24
+ };
2
25
 
3
26
  class Localized {
4
27
  get locale() {
@@ -6,4 +29,4 @@ class Localized {
6
29
  }
7
30
  }
8
31
 
9
- export { Localized as L };
32
+ export { Localized as L, setLocale as s };
@@ -14,10 +14,10 @@ export declare function anchored<T extends {
14
14
  _slottedAnchor?: HTMLElement[] | undefined;
15
15
  _slottedAnchorChanged(): void;
16
16
  _anchorEl?: HTMLElement | undefined;
17
- "__#5@#updateAnchorEl": () => void;
18
- "__#5@#observer"?: MutationObserver | undefined;
19
- "__#5@#observeMissingAnchor": (anchorId: string) => void;
20
- "__#5@#cleanupObserverIfNeeded": () => void;
17
+ "__#6@#updateAnchorEl": () => void;
18
+ "__#6@#observer"?: MutationObserver | undefined;
19
+ "__#6@#observeMissingAnchor": (anchorId: string) => void;
20
+ "__#6@#cleanupObserverIfNeeded": () => void;
21
21
  connectedCallback(): void;
22
22
  disconnectedCallback(): void;
23
23
  };
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ function getPlaybackRatesArray(playbackRates) {
4
+ if (playbackRates === "") return [];
5
+ const ratesArray = [];
6
+ playbackRates.split(",").forEach((numStr) => {
7
+ const num = Number(numStr);
8
+ if (!isNaN(num)) ratesArray.push(num);
9
+ });
10
+ return ratesArray;
11
+ }
12
+
13
+ exports.getPlaybackRatesArray = getPlaybackRatesArray;
@@ -0,0 +1,11 @@
1
+ function getPlaybackRatesArray(playbackRates) {
2
+ if (playbackRates === "") return [];
3
+ const ratesArray = [];
4
+ playbackRates.split(",").forEach((numStr) => {
5
+ const num = Number(numStr);
6
+ if (!isNaN(num)) ratesArray.push(num);
7
+ });
8
+ return ratesArray;
9
+ }
10
+
11
+ export { getPlaybackRatesArray as g };