@vonage/vivid 3.26.0 → 3.27.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 (101) hide show
  1. package/README.md +2 -0
  2. package/custom-elements.json +300 -0
  3. package/file-picker/index.js +26 -0
  4. package/header/index.js +1 -1
  5. package/index.js +30 -29
  6. package/layout/index.js +1 -1
  7. package/lib/components.d.ts +1 -1
  8. package/lib/file-picker/definition.d.ts +3 -0
  9. package/lib/file-picker/file-picker.d.ts +22 -0
  10. package/lib/file-picker/file-picker.template.d.ts +4 -0
  11. package/lib/file-picker/index.d.ts +1 -0
  12. package/lib/menu/menu.d.ts +1 -0
  13. package/listbox/index.js +1 -1
  14. package/menu/index.js +2 -2
  15. package/menu-item/index.js +1 -1
  16. package/nav/index.js +1 -1
  17. package/nav-disclosure/index.js +1 -1
  18. package/nav-item/index.js +1 -1
  19. package/note/index.js +1 -1
  20. package/number-field/index.js +1 -1
  21. package/package.json +2 -1
  22. package/pagination/index.js +1 -1
  23. package/progress/index.js +1 -1
  24. package/radio/index.js +1 -1
  25. package/radio-group/index.js +1 -1
  26. package/select/index.js +1 -1
  27. package/shared/definition.js +1 -1
  28. package/shared/definition10.js +1 -1
  29. package/shared/definition11.js +1 -1
  30. package/shared/definition12.js +1 -1
  31. package/shared/definition14.js +1 -1
  32. package/shared/definition15.js +1 -1
  33. package/shared/definition16.js +1 -1
  34. package/shared/definition17.js +1 -1
  35. package/shared/definition18.js +1 -1
  36. package/shared/definition19.js +1 -1
  37. package/shared/definition2.js +1 -1
  38. package/shared/definition20.js +1 -1
  39. package/shared/definition21.js +1 -1
  40. package/shared/definition22.js +2 -2
  41. package/shared/definition23.js +1 -1
  42. package/shared/definition24.js +1 -1
  43. package/shared/definition25.js +1 -1
  44. package/shared/definition26.js +1 -1
  45. package/shared/definition27.js +2285 -45
  46. package/shared/definition28.js +46 -36
  47. package/shared/definition29.js +38 -368
  48. package/shared/definition30.js +307 -299
  49. package/shared/definition31.js +375 -14
  50. package/shared/definition32.js +13 -70
  51. package/shared/definition33.js +66 -25
  52. package/shared/definition34.js +27 -39
  53. package/shared/definition35.js +31 -431
  54. package/shared/definition36.js +430 -214
  55. package/shared/definition37.js +209 -70
  56. package/shared/definition38.js +81 -33
  57. package/shared/definition39.js +32 -423
  58. package/shared/definition4.js +1 -1
  59. package/shared/definition40.js +358 -586
  60. package/shared/definition41.js +648 -73
  61. package/shared/definition42.js +70 -584
  62. package/shared/definition43.js +538 -81
  63. package/shared/definition44.js +127 -52
  64. package/shared/definition45.js +56 -16
  65. package/shared/definition46.js +17 -485
  66. package/shared/definition47.js +477 -99
  67. package/shared/definition48.js +114 -19
  68. package/shared/definition49.js +19 -276
  69. package/shared/definition5.js +1 -1
  70. package/shared/definition50.js +245 -89
  71. package/shared/definition51.js +117 -628
  72. package/shared/definition52.js +601 -86
  73. package/shared/definition53.js +112 -68
  74. package/shared/definition54.js +69 -294
  75. package/shared/definition55.js +305 -0
  76. package/shared/definition6.js +1 -1
  77. package/shared/definition7.js +4 -3
  78. package/shared/definition9.js +1 -1
  79. package/shared/form-elements.js +1 -1
  80. package/shared/patterns/form-elements/form-elements.d.ts +4 -4
  81. package/shared/text-field.js +1 -1
  82. package/side-drawer/index.js +1 -1
  83. package/slider/index.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/switch/index.js +1 -1
  90. package/tab/index.js +1 -1
  91. package/tab-panel/index.js +1 -1
  92. package/tabs/index.js +3 -3
  93. package/tag/index.js +1 -1
  94. package/tag-group/index.js +1 -1
  95. package/text-area/index.js +1 -1
  96. package/text-field/index.js +1 -1
  97. package/toggletip/index.js +1 -1
  98. package/tooltip/index.js +1 -1
  99. package/tree-item/index.js +1 -1
  100. package/tree-view/index.js +1 -1
  101. package/vivid.api.json +139 -741
@@ -1,639 +1,128 @@
1
- import { l as fails$5, g as global$3, K as functionCall, k as functionUncurryThis, a9 as shared$1, aa as objectCreate, L as internalState, G as _export, w as wellKnownSymbol$2, H as defineBuiltIn$1, ab as createNonEnumerableProperty$1, U as requireObjectCoercible$2, ac as toIntegerOrInfinity$2, a2 as toObject$1, q as anObject$2, m as isCallable$2, c as classofRaw, s as isNullOrUndefined$1, ad as toLength$1, P as getMethod$1, F as FoundationElement, W as __classPrivateFieldSet, V as __classPrivateFieldGet, Y as DOM, _ as __decorate, a as attr, b as __metadata, h as html, r as registerFactory } from './index.js';
2
- import { P as Popup, p as popupRegistries } from './definition20.js';
3
- import { r as regexpFlags$1 } from './es.regexp.to-string.js';
4
- import { t as toString$3 } from './to-string.js';
5
- import { f as functionUncurryThisClause, a as functionApply } from './icon.js';
1
+ import { _ as __decorate, a as attr, b as __metadata, o as observable, h as html, r as registerFactory } from './index.js';
2
+ import { f as focusRegistries } from './definition4.js';
3
+ import { i as iconRegistries } from './definition3.js';
4
+ import { b as AffixIcon, a as affixIconTemplateFactory } from './affix.js';
5
+ import './focus.js';
6
+ import { e as errorText, f as formElements, F as FormElementSuccessText, a as FormElementHelperText, b as FormElementCharCount, g as getFeedbackTemplate } from './form-elements.js';
7
+ import { T as TextField$1 } from './text-field2.js';
8
+ import { a as applyMixins } from './apply-mixins.js';
9
+ import { c as css_248z } from './text-field.js';
10
+ import { f as focusTemplateFactory } from './focus2.js';
6
11
  import { w as when } from './when.js';
12
+ import { s as slotted } from './slotted.js';
13
+ import { r as ref } from './ref.js';
7
14
  import { c as classNames } from './class-names.js';
8
15
 
9
- var css_248z = "/**\n * Do not edit directly\n * Generated on Tue, 25 Jul 2023 07:38:24 GMT\n */\n.control {\n display: inline-block;\n}\n\n.content-wrapper {\n width: var(--toggletip-inline-size, auto);\n padding: 16px;\n}\n\n.headline {\n font: var(--vvd-typography-base-bold);\n}\n\n.action-items {\n display: flex;\n justify-content: flex-end;\n gap: 10px;\n}\n\n::slotted([slot=action-items]) {\n margin-block-start: 16px;\n}";
16
+ let TextField = class TextField extends TextField$1 {};
17
+ __decorate([attr, __metadata("design:type", String)], TextField.prototype, "appearance", void 0);
18
+ __decorate([attr, __metadata("design:type", String)], TextField.prototype, "shape", void 0);
19
+ __decorate([attr, __metadata("design:type", String)], TextField.prototype, "autoComplete", void 0);
20
+ __decorate([observable, __metadata("design:type", Array)], TextField.prototype, "actionItemsSlottedContent", void 0);
21
+ TextField = __decorate([errorText, formElements], TextField);
22
+ applyMixins(TextField, AffixIcon, FormElementCharCount, FormElementHelperText, FormElementSuccessText);
10
23
 
11
- var fails$4 = fails$5;
12
- var global$2 = global$3;
13
-
14
- // babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
15
- var $RegExp$2 = global$2.RegExp;
16
-
17
- var UNSUPPORTED_Y$1 = fails$4(function () {
18
- var re = $RegExp$2('a', 'y');
19
- re.lastIndex = 2;
20
- return re.exec('abcd') != null;
21
- });
22
-
23
- // UC Browser bug
24
- // https://github.com/zloirock/core-js/issues/1008
25
- var MISSED_STICKY = UNSUPPORTED_Y$1 || fails$4(function () {
26
- return !$RegExp$2('a', 'y').sticky;
27
- });
28
-
29
- var BROKEN_CARET = UNSUPPORTED_Y$1 || fails$4(function () {
30
- // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
31
- var re = $RegExp$2('^r', 'gy');
32
- re.lastIndex = 2;
33
- return re.exec('str') != null;
34
- });
35
-
36
- var regexpStickyHelpers = {
37
- BROKEN_CARET: BROKEN_CARET,
38
- MISSED_STICKY: MISSED_STICKY,
39
- UNSUPPORTED_Y: UNSUPPORTED_Y$1
40
- };
41
-
42
- var fails$3 = fails$5;
43
- var global$1 = global$3;
44
-
45
- // babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
46
- var $RegExp$1 = global$1.RegExp;
47
-
48
- var regexpUnsupportedDotAll = fails$3(function () {
49
- var re = $RegExp$1('.', 's');
50
- return !(re.dotAll && re.exec('\n') && re.flags === 's');
51
- });
52
-
53
- var fails$2 = fails$5;
54
- var global = global$3;
55
-
56
- // babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
57
- var $RegExp = global.RegExp;
58
-
59
- var regexpUnsupportedNcg = fails$2(function () {
60
- var re = $RegExp('(?<a>b)', 'g');
61
- return re.exec('b').groups.a !== 'b' ||
62
- 'b'.replace(re, '$<a>c') !== 'bc';
63
- });
64
-
65
- /* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
66
- /* eslint-disable regexp/no-useless-quantifier -- testing */
67
- var call$2 = functionCall;
68
- var uncurryThis$4 = functionUncurryThis;
69
- var toString$2 = toString$3;
70
- var regexpFlags = regexpFlags$1;
71
- var stickyHelpers = regexpStickyHelpers;
72
- var shared = shared$1.exports;
73
- var create = objectCreate;
74
- var getInternalState = internalState.get;
75
- var UNSUPPORTED_DOT_ALL = regexpUnsupportedDotAll;
76
- var UNSUPPORTED_NCG = regexpUnsupportedNcg;
77
-
78
- var nativeReplace = shared('native-string-replace', String.prototype.replace);
79
- var nativeExec = RegExp.prototype.exec;
80
- var patchedExec = nativeExec;
81
- var charAt$3 = uncurryThis$4(''.charAt);
82
- var indexOf = uncurryThis$4(''.indexOf);
83
- var replace$1 = uncurryThis$4(''.replace);
84
- var stringSlice$3 = uncurryThis$4(''.slice);
85
-
86
- var UPDATES_LAST_INDEX_WRONG = (function () {
87
- var re1 = /a/;
88
- var re2 = /b*/g;
89
- call$2(nativeExec, re1, 'a');
90
- call$2(nativeExec, re2, 'a');
91
- return re1.lastIndex !== 0 || re2.lastIndex !== 0;
92
- })();
93
-
94
- var UNSUPPORTED_Y = stickyHelpers.BROKEN_CARET;
95
-
96
- // nonparticipating capturing group, copied from es5-shim's String#split patch.
97
- var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
98
-
99
- var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG;
100
-
101
- if (PATCH) {
102
- patchedExec = function exec(string) {
103
- var re = this;
104
- var state = getInternalState(re);
105
- var str = toString$2(string);
106
- var raw = state.raw;
107
- var result, reCopy, lastIndex, match, i, object, group;
108
-
109
- if (raw) {
110
- raw.lastIndex = re.lastIndex;
111
- result = call$2(patchedExec, raw, str);
112
- re.lastIndex = raw.lastIndex;
113
- return result;
114
- }
115
-
116
- var groups = state.groups;
117
- var sticky = UNSUPPORTED_Y && re.sticky;
118
- var flags = call$2(regexpFlags, re);
119
- var source = re.source;
120
- var charsAdded = 0;
121
- var strCopy = str;
122
-
123
- if (sticky) {
124
- flags = replace$1(flags, 'y', '');
125
- if (indexOf(flags, 'g') === -1) {
126
- flags += 'g';
127
- }
128
-
129
- strCopy = stringSlice$3(str, re.lastIndex);
130
- // Support anchored sticky behavior.
131
- if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt$3(str, re.lastIndex - 1) !== '\n')) {
132
- source = '(?: ' + source + ')';
133
- strCopy = ' ' + strCopy;
134
- charsAdded++;
135
- }
136
- // ^(? + rx + ) is needed, in combination with some str slicing, to
137
- // simulate the 'y' flag.
138
- reCopy = new RegExp('^(?:' + source + ')', flags);
139
- }
140
-
141
- if (NPCG_INCLUDED) {
142
- reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
143
- }
144
- if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
145
-
146
- match = call$2(nativeExec, sticky ? reCopy : re, strCopy);
147
-
148
- if (sticky) {
149
- if (match) {
150
- match.input = stringSlice$3(match.input, charsAdded);
151
- match[0] = stringSlice$3(match[0], charsAdded);
152
- match.index = re.lastIndex;
153
- re.lastIndex += match[0].length;
154
- } else re.lastIndex = 0;
155
- } else if (UPDATES_LAST_INDEX_WRONG && match) {
156
- re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
157
- }
158
- if (NPCG_INCLUDED && match && match.length > 1) {
159
- // Fix browsers whose `exec` methods don't consistently return `undefined`
160
- // for NPCG, like IE8. NOTE: This doesn't work for /(.?)?/
161
- call$2(nativeReplace, match[0], reCopy, function () {
162
- for (i = 1; i < arguments.length - 2; i++) {
163
- if (arguments[i] === undefined) match[i] = undefined;
164
- }
165
- });
166
- }
167
-
168
- if (match && groups) {
169
- match.groups = object = create(null);
170
- for (i = 0; i < groups.length; i++) {
171
- group = groups[i];
172
- object[group[0]] = match[group[1]];
173
- }
174
- }
175
-
176
- return match;
177
- };
24
+ let _ = t => t,
25
+ _t,
26
+ _t2,
27
+ _t3;
28
+ const getStateClasses = ({
29
+ errorValidationMessage,
30
+ disabled,
31
+ value,
32
+ readOnly,
33
+ placeholder,
34
+ appearance,
35
+ shape,
36
+ label,
37
+ successText,
38
+ actionItemsSlottedContent
39
+ }) => classNames(['error connotation-alert', Boolean(errorValidationMessage)], ['disabled', disabled], ['has-value', Boolean(value)], ['readonly', readOnly], ['placeholder', Boolean(placeholder)], [`appearance-${appearance}`, Boolean(appearance)], [`shape-${shape}`, Boolean(shape)], ['no-label', !label], ['success connotation-success', Boolean(successText)], ['action-items', !!(actionItemsSlottedContent === null || actionItemsSlottedContent === void 0 ? void 0 : actionItemsSlottedContent.length)]);
40
+ function renderLabel() {
41
+ return html(_t || (_t = _`
42
+ <label for="control" class="label">
43
+ ${0}
44
+ </label>`), x => x.label);
178
45
  }
179
-
180
- var regexpExec$2 = patchedExec;
181
-
182
- var $ = _export;
183
- var exec = regexpExec$2;
184
-
185
- // `RegExp.prototype.exec` method
186
- // https://tc39.es/ecma262/#sec-regexp.prototype.exec
187
- $({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, {
188
- exec: exec
189
- });
190
-
191
- // TODO: Remove from `core-js@4` since it's moved to entry points
192
-
193
- var uncurryThis$3 = functionUncurryThisClause;
194
- var defineBuiltIn = defineBuiltIn$1;
195
- var regexpExec$1 = regexpExec$2;
196
- var fails$1 = fails$5;
197
- var wellKnownSymbol$1 = wellKnownSymbol$2;
198
- var createNonEnumerableProperty = createNonEnumerableProperty$1;
199
-
200
- var SPECIES = wellKnownSymbol$1('species');
201
- var RegExpPrototype = RegExp.prototype;
202
-
203
- var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
204
- var SYMBOL = wellKnownSymbol$1(KEY);
205
-
206
- var DELEGATES_TO_SYMBOL = !fails$1(function () {
207
- // String methods call symbol-named RegEp methods
208
- var O = {};
209
- O[SYMBOL] = function () { return 7; };
210
- return ''[KEY](O) != 7;
211
- });
212
-
213
- var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails$1(function () {
214
- // Symbol-named RegExp methods call .exec
215
- var execCalled = false;
216
- var re = /a/;
217
-
218
- if (KEY === 'split') {
219
- // We can't use real regex here since it causes deoptimization
220
- // and serious performance degradation in V8
221
- // https://github.com/zloirock/core-js/issues/306
222
- re = {};
223
- // RegExp[@@split] doesn't call the regex's exec method, but first creates
224
- // a new one. We need to return the patched regex when creating the new one.
225
- re.constructor = {};
226
- re.constructor[SPECIES] = function () { return re; };
227
- re.flags = '';
228
- re[SYMBOL] = /./[SYMBOL];
229
- }
230
-
231
- re.exec = function () { execCalled = true; return null; };
232
-
233
- re[SYMBOL]('');
234
- return !execCalled;
235
- });
236
-
237
- if (
238
- !DELEGATES_TO_SYMBOL ||
239
- !DELEGATES_TO_EXEC ||
240
- FORCED
241
- ) {
242
- var uncurriedNativeRegExpMethod = uncurryThis$3(/./[SYMBOL]);
243
- var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
244
- var uncurriedNativeMethod = uncurryThis$3(nativeMethod);
245
- var $exec = regexp.exec;
246
- if ($exec === regexpExec$1 || $exec === RegExpPrototype.exec) {
247
- if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
248
- // The native String method already delegates to @@method (this
249
- // polyfilled function), leasing to infinite recursion.
250
- // We avoid it by directly calling the native @@method method.
251
- return { done: true, value: uncurriedNativeRegExpMethod(regexp, str, arg2) };
252
- }
253
- return { done: true, value: uncurriedNativeMethod(str, regexp, arg2) };
254
- }
255
- return { done: false };
256
- });
257
-
258
- defineBuiltIn(String.prototype, KEY, methods[0]);
259
- defineBuiltIn(RegExpPrototype, SYMBOL, methods[1]);
260
- }
261
-
262
- if (SHAM) createNonEnumerableProperty(RegExpPrototype[SYMBOL], 'sham', true);
263
- };
264
-
265
- var uncurryThis$2 = functionUncurryThis;
266
- var toIntegerOrInfinity$1 = toIntegerOrInfinity$2;
267
- var toString$1 = toString$3;
268
- var requireObjectCoercible$1 = requireObjectCoercible$2;
269
-
270
- var charAt$2 = uncurryThis$2(''.charAt);
271
- var charCodeAt = uncurryThis$2(''.charCodeAt);
272
- var stringSlice$2 = uncurryThis$2(''.slice);
273
-
274
- var createMethod = function (CONVERT_TO_STRING) {
275
- return function ($this, pos) {
276
- var S = toString$1(requireObjectCoercible$1($this));
277
- var position = toIntegerOrInfinity$1(pos);
278
- var size = S.length;
279
- var first, second;
280
- if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
281
- first = charCodeAt(S, position);
282
- return first < 0xD800 || first > 0xDBFF || position + 1 === size
283
- || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF
284
- ? CONVERT_TO_STRING
285
- ? charAt$2(S, position)
286
- : first
287
- : CONVERT_TO_STRING
288
- ? stringSlice$2(S, position, position + 2)
289
- : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
290
- };
291
- };
292
-
293
- var stringMultibyte = {
294
- // `String.prototype.codePointAt` method
295
- // https://tc39.es/ecma262/#sec-string.prototype.codepointat
296
- codeAt: createMethod(false),
297
- // `String.prototype.at` method
298
- // https://github.com/mathiasbynens/String.prototype.at
299
- charAt: createMethod(true)
300
- };
301
-
302
- var charAt$1 = stringMultibyte.charAt;
303
-
304
- // `AdvanceStringIndex` abstract operation
305
- // https://tc39.es/ecma262/#sec-advancestringindex
306
- var advanceStringIndex$1 = function (S, index, unicode) {
307
- return index + (unicode ? charAt$1(S, index).length : 1);
308
- };
309
-
310
- var uncurryThis$1 = functionUncurryThis;
311
- var toObject = toObject$1;
312
-
313
- var floor = Math.floor;
314
- var charAt = uncurryThis$1(''.charAt);
315
- var replace = uncurryThis$1(''.replace);
316
- var stringSlice$1 = uncurryThis$1(''.slice);
317
- var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
318
- var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
319
-
320
- // `GetSubstitution` abstract operation
321
- // https://tc39.es/ecma262/#sec-getsubstitution
322
- var getSubstitution$1 = function (matched, str, position, captures, namedCaptures, replacement) {
323
- var tailPos = position + matched.length;
324
- var m = captures.length;
325
- var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
326
- if (namedCaptures !== undefined) {
327
- namedCaptures = toObject(namedCaptures);
328
- symbols = SUBSTITUTION_SYMBOLS;
329
- }
330
- return replace(replacement, symbols, function (match, ch) {
331
- var capture;
332
- switch (charAt(ch, 0)) {
333
- case '$': return '$';
334
- case '&': return matched;
335
- case '`': return stringSlice$1(str, 0, position);
336
- case "'": return stringSlice$1(str, tailPos);
337
- case '<':
338
- capture = namedCaptures[stringSlice$1(ch, 1, -1)];
339
- break;
340
- default: // \d\d?
341
- var n = +ch;
342
- if (n === 0) return match;
343
- if (n > m) {
344
- var f = floor(n / 10);
345
- if (f === 0) return match;
346
- if (f <= m) return captures[f - 1] === undefined ? charAt(ch, 1) : captures[f - 1] + charAt(ch, 1);
347
- return match;
348
- }
349
- capture = captures[n - 1];
350
- }
351
- return capture === undefined ? '' : capture;
352
- });
353
- };
354
-
355
- var call$1 = functionCall;
356
- var anObject$1 = anObject$2;
357
- var isCallable$1 = isCallable$2;
358
- var classof = classofRaw;
359
- var regexpExec = regexpExec$2;
360
-
361
- var $TypeError = TypeError;
362
-
363
- // `RegExpExec` abstract operation
364
- // https://tc39.es/ecma262/#sec-regexpexec
365
- var regexpExecAbstract = function (R, S) {
366
- var exec = R.exec;
367
- if (isCallable$1(exec)) {
368
- var result = call$1(exec, R, S);
369
- if (result !== null) anObject$1(result);
370
- return result;
371
- }
372
- if (classof(R) === 'RegExp') return call$1(regexpExec, R, S);
373
- throw $TypeError('RegExp#exec called on incompatible receiver');
374
- };
375
-
376
- var apply = functionApply;
377
- var call = functionCall;
378
- var uncurryThis = functionUncurryThis;
379
- var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
380
- var fails = fails$5;
381
- var anObject = anObject$2;
382
- var isCallable = isCallable$2;
383
- var isNullOrUndefined = isNullOrUndefined$1;
384
- var toIntegerOrInfinity = toIntegerOrInfinity$2;
385
- var toLength = toLength$1;
386
- var toString = toString$3;
387
- var requireObjectCoercible = requireObjectCoercible$2;
388
- var advanceStringIndex = advanceStringIndex$1;
389
- var getMethod = getMethod$1;
390
- var getSubstitution = getSubstitution$1;
391
- var regExpExec = regexpExecAbstract;
392
- var wellKnownSymbol = wellKnownSymbol$2;
393
-
394
- var REPLACE = wellKnownSymbol('replace');
395
- var max = Math.max;
396
- var min = Math.min;
397
- var concat = uncurryThis([].concat);
398
- var push = uncurryThis([].push);
399
- var stringIndexOf = uncurryThis(''.indexOf);
400
- var stringSlice = uncurryThis(''.slice);
401
-
402
- var maybeToString = function (it) {
403
- return it === undefined ? it : String(it);
404
- };
405
-
406
- // IE <= 11 replaces $0 with the whole match, as if it was $&
407
- // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
408
- var REPLACE_KEEPS_$0 = (function () {
409
- // eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing
410
- return 'a'.replace(/./, '$0') === '$0';
411
- })();
412
-
413
- // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
414
- var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
415
- if (/./[REPLACE]) {
416
- return /./[REPLACE]('a', '$0') === '';
417
- }
418
- return false;
419
- })();
420
-
421
- var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
422
- var re = /./;
423
- re.exec = function () {
424
- var result = [];
425
- result.groups = { a: '7' };
426
- return result;
427
- };
428
- // eslint-disable-next-line regexp/no-useless-dollar-replacements -- false positive
429
- return ''.replace(re, '$<a>') !== '7';
430
- });
431
-
432
- // @@replace logic
433
- fixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNative) {
434
- var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
435
-
436
- return [
437
- // `String.prototype.replace` method
438
- // https://tc39.es/ecma262/#sec-string.prototype.replace
439
- function replace(searchValue, replaceValue) {
440
- var O = requireObjectCoercible(this);
441
- var replacer = isNullOrUndefined(searchValue) ? undefined : getMethod(searchValue, REPLACE);
442
- return replacer
443
- ? call(replacer, searchValue, O, replaceValue)
444
- : call(nativeReplace, toString(O), searchValue, replaceValue);
445
- },
446
- // `RegExp.prototype[@@replace]` method
447
- // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
448
- function (string, replaceValue) {
449
- var rx = anObject(this);
450
- var S = toString(string);
451
-
452
- if (
453
- typeof replaceValue == 'string' &&
454
- stringIndexOf(replaceValue, UNSAFE_SUBSTITUTE) === -1 &&
455
- stringIndexOf(replaceValue, '$<') === -1
456
- ) {
457
- var res = maybeCallNative(nativeReplace, rx, S, replaceValue);
458
- if (res.done) return res.value;
459
- }
460
-
461
- var functionalReplace = isCallable(replaceValue);
462
- if (!functionalReplace) replaceValue = toString(replaceValue);
463
-
464
- var global = rx.global;
465
- if (global) {
466
- var fullUnicode = rx.unicode;
467
- rx.lastIndex = 0;
468
- }
469
- var results = [];
470
- while (true) {
471
- var result = regExpExec(rx, S);
472
- if (result === null) break;
473
-
474
- push(results, result);
475
- if (!global) break;
476
-
477
- var matchStr = toString(result[0]);
478
- if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
479
- }
480
-
481
- var accumulatedResult = '';
482
- var nextSourcePosition = 0;
483
- for (var i = 0; i < results.length; i++) {
484
- result = results[i];
485
-
486
- var matched = toString(result[0]);
487
- var position = max(min(toIntegerOrInfinity(result.index), S.length), 0);
488
- var captures = [];
489
- // NOTE: This is equivalent to
490
- // captures = result.slice(1).map(maybeToString)
491
- // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
492
- // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
493
- // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
494
- for (var j = 1; j < result.length; j++) push(captures, maybeToString(result[j]));
495
- var namedCaptures = result.groups;
496
- if (functionalReplace) {
497
- var replacerArgs = concat([matched], captures, position, S);
498
- if (namedCaptures !== undefined) push(replacerArgs, namedCaptures);
499
- var replacement = toString(apply(replaceValue, undefined, replacerArgs));
500
- } else {
501
- replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
502
- }
503
- if (position >= nextSourcePosition) {
504
- accumulatedResult += stringSlice(S, nextSourcePosition, position) + replacement;
505
- nextSourcePosition = position + matched.length;
506
- }
507
- }
508
- return accumulatedResult + stringSlice(S, nextSourcePosition);
509
- }
510
- ];
511
- }, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
512
-
513
- var _Toggletip_instances, _Toggletip_observer, _Toggletip_anchorEl, _Toggletip_observeMissingAnchor, _Toggletip_ANCHOR_ARIA_LABEL_SUFFIX, _Toggletip_setupAnchor, _Toggletip_cleanupAnchor, _Toggletip_openIfClosed, _Toggletip_closeOnClickOutside, _Toggletip_closeOnEscape;
514
- class Toggletip extends FoundationElement {
515
- constructor() {
516
- super(...arguments);
517
- _Toggletip_instances.add(this);
518
- _Toggletip_observer.set(this, void 0);
519
- _Toggletip_anchorEl.set(this, null);
520
- _Toggletip_observeMissingAnchor.set(this, anchorId => {
521
- __classPrivateFieldSet(this, _Toggletip_observer, new MutationObserver(() => {
522
- const anchor = document.getElementById(anchorId);
523
- if (anchor) {
524
- __classPrivateFieldSet(this, _Toggletip_anchorEl, anchor, "f");
525
- __classPrivateFieldGet(this, _Toggletip_instances, "m", _Toggletip_setupAnchor).call(this, __classPrivateFieldGet(this, _Toggletip_anchorEl, "f"));
526
- __classPrivateFieldGet(this, _Toggletip_observer, "f").disconnect();
527
- __classPrivateFieldSet(this, _Toggletip_observer, undefined, "f");
528
- }
529
- }), "f");
530
- __classPrivateFieldGet(this, _Toggletip_observer, "f").observe(document.body, {
531
- childList: true,
532
- subtree: true
533
- });
534
- });
535
- _Toggletip_ANCHOR_ARIA_LABEL_SUFFIX.set(this, ' ; Show more information');
536
- this.alternate = false;
537
- this.placement = 'right';
538
- this.anchor = '';
539
- this.open = false;
540
- _Toggletip_openIfClosed.set(this, () => {
541
- if (!this.open) DOM.queueUpdate(() => this.open = true);
542
- });
543
- _Toggletip_closeOnClickOutside.set(this, e => {
544
- if (!this.contains(e.target)) this.open = false;
545
- });
546
- _Toggletip_closeOnEscape.set(this, e => {
547
- if (e.key === 'Escape') this.open = false;
548
- });
549
- }
550
- anchorChanged(_, newValue) {
551
- var _a;
552
- if (__classPrivateFieldGet(this, _Toggletip_anchorEl, "f")) __classPrivateFieldGet(this, _Toggletip_instances, "m", _Toggletip_cleanupAnchor).call(this, __classPrivateFieldGet(this, _Toggletip_anchorEl, "f"));
553
- (_a = __classPrivateFieldGet(this, _Toggletip_observer, "f")) === null || _a === void 0 ? void 0 : _a.disconnect();
554
- __classPrivateFieldSet(this, _Toggletip_anchorEl, newValue instanceof HTMLElement ? newValue : document.getElementById(newValue), "f");
555
- if (__classPrivateFieldGet(this, _Toggletip_anchorEl, "f")) {
556
- __classPrivateFieldGet(this, _Toggletip_instances, "m", _Toggletip_setupAnchor).call(this, __classPrivateFieldGet(this, _Toggletip_anchorEl, "f"));
557
- } else {
558
- __classPrivateFieldGet(this, _Toggletip_observeMissingAnchor, "f").call(this, newValue);
559
- }
560
- }
561
- openChanged(oldValue, newValue) {
562
- if (oldValue === undefined) return;
563
- if (newValue) {
564
- document.addEventListener('click', __classPrivateFieldGet(this, _Toggletip_closeOnClickOutside, "f"));
565
- document.addEventListener('keydown', __classPrivateFieldGet(this, _Toggletip_closeOnEscape, "f"));
566
- this.setAttribute('role', 'status');
567
- } else {
568
- document.removeEventListener('click', __classPrivateFieldGet(this, _Toggletip_closeOnClickOutside, "f"));
569
- document.removeEventListener('keydown', __classPrivateFieldGet(this, _Toggletip_closeOnEscape, "f"));
570
- this.removeAttribute('role');
571
- }
572
- if (__classPrivateFieldGet(this, _Toggletip_anchorEl, "f")) {
573
- __classPrivateFieldGet(this, _Toggletip_anchorEl, "f").ariaExpanded = this.open.toString();
574
- }
575
- }
576
- disconnectedCallback() {
577
- var _a;
578
- super.disconnectedCallback();
579
- if (__classPrivateFieldGet(this, _Toggletip_anchorEl, "f")) __classPrivateFieldGet(this, _Toggletip_instances, "m", _Toggletip_cleanupAnchor).call(this, __classPrivateFieldGet(this, _Toggletip_anchorEl, "f"));
580
- (_a = __classPrivateFieldGet(this, _Toggletip_observer, "f")) === null || _a === void 0 ? void 0 : _a.disconnect();
581
- document.removeEventListener('keydown', __classPrivateFieldGet(this, _Toggletip_closeOnEscape, "f"));
582
- }
46
+ function renderCharCount() {
47
+ return html(_t2 || (_t2 = _`
48
+ <span class="char-count">${0} / ${0}</span>
49
+ `), x => x.value ? x.value.length : 0, x => x.maxlength);
583
50
  }
584
- _Toggletip_observer = new WeakMap(), _Toggletip_anchorEl = new WeakMap(), _Toggletip_observeMissingAnchor = new WeakMap(), _Toggletip_ANCHOR_ARIA_LABEL_SUFFIX = new WeakMap(), _Toggletip_openIfClosed = new WeakMap(), _Toggletip_closeOnClickOutside = new WeakMap(), _Toggletip_closeOnEscape = new WeakMap(), _Toggletip_instances = new WeakSet(), _Toggletip_setupAnchor = function _Toggletip_setupAnchor(a) {
585
- var _a;
586
- a.addEventListener('click', __classPrivateFieldGet(this, _Toggletip_openIfClosed, "f"), true);
587
- a.ariaLabel = ((_a = a.ariaLabel) !== null && _a !== void 0 ? _a : '') + __classPrivateFieldGet(this, _Toggletip_ANCHOR_ARIA_LABEL_SUFFIX, "f");
588
- }, _Toggletip_cleanupAnchor = function _Toggletip_cleanupAnchor(a) {
589
- a.removeEventListener('click', __classPrivateFieldGet(this, _Toggletip_openIfClosed, "f"), true);
590
- if (a.ariaLabel) a.ariaLabel = a.ariaLabel.replace(__classPrivateFieldGet(this, _Toggletip_ANCHOR_ARIA_LABEL_SUFFIX, "f"), '');
591
- };
592
- __decorate([attr, __metadata("design:type", String)], Toggletip.prototype, "headline", void 0);
593
- __decorate([attr({
594
- mode: 'boolean'
595
- }), __metadata("design:type", Object)], Toggletip.prototype, "alternate", void 0);
596
- __decorate([attr({
597
- mode: 'fromView'
598
- }), __metadata("design:type", String)], Toggletip.prototype, "placement", void 0);
599
- __decorate([attr({
600
- mode: 'fromView'
601
- }), __metadata("design:type", Object)], Toggletip.prototype, "anchor", void 0);
602
- __decorate([attr({
603
- mode: 'boolean'
604
- }), __metadata("design:type", Object)], Toggletip.prototype, "open", void 0);
605
-
606
- let _2 = t => t,
607
- _t,
608
- _t2;
609
- const getClasses = _ => classNames('control');
610
- const ToggletipTemplate = context => {
611
- const popup = context.tagFor(Popup);
612
- return html(_t || (_t = _2`
613
- <${0}
614
- class="${0}"
615
- arrow
616
- :anchor="${0}"
617
- :open="${0}"
618
- ?alternate="${0}"
619
- placement="${0}"
620
- exportparts="vvd-theme-alternate"
621
- >
622
- <div class="content-wrapper">
623
- ${0}
624
- <slot></slot>
625
- <footer class="action-items"><slot name="action-items"></slot></footer>
51
+ const TextfieldTemplate = context => {
52
+ const affixIconTemplate = affixIconTemplateFactory(context);
53
+ const focusTemplate = focusTemplateFactory(context);
54
+ return html(_t3 || (_t3 = _`
55
+ <div class="base ${0}">
56
+ ${0}
57
+ ${0}
58
+ <div class="fieldset">
59
+ ${0}
60
+ <div class="wrapper">
61
+ <input class="control"
62
+ id="control"
63
+ @input="${0}"
64
+ @change="${0}"
65
+ ?autofocus="${0}"
66
+ ?disabled="${0}"
67
+ list="${0}"
68
+ maxlength="${0}"
69
+ minlength="${0}"
70
+ pattern="${0}"
71
+ placeholder="${0}"
72
+ ?readonly="${0}"
73
+ ?required="${0}"
74
+ size="${0}"
75
+ autocomplete="${0}"
76
+ name="${0}"
77
+ ?spellcheck="${0}"
78
+ :value="${0}"
79
+ type="${0}"
80
+ aria-atomic="${0}"
81
+ aria-busy="${0}"
82
+ aria-controls="${0}"
83
+ aria-current="${0}"
84
+ aria-describedby="${0}"
85
+ aria-details="${0}"
86
+ aria-disabled="${0}"
87
+ aria-errormessage="${0}"
88
+ aria-flowto="${0}"
89
+ aria-haspopup="${0}"
90
+ aria-hidden="${0}"
91
+ aria-invalid="${0}"
92
+ aria-keyshortcuts="${0}"
93
+ aria-label="${0}"
94
+ aria-labelledby="${0}"
95
+ aria-live="${0}"
96
+ aria-owns="${0}"
97
+ aria-relevant="${0}"
98
+ aria-roledescription="${0}"
99
+ ${0}
100
+ />
101
+ ${0}
102
+ </div>
103
+ <div class="action-items-wrapper">
104
+ <slot name="action-items" ${0}></slot>
626
105
  </div>
627
- </${0}>
628
- `), popup, getClasses, x => x.anchor, x => x.open, x => !x.alternate, x => x.placement, when(x => x.headline, html(_t2 || (_t2 = _2`<header class="headline">${0}</header>`), x => x.headline)), popup);
106
+
107
+ </div>
108
+ ${0}
109
+ ${0}
110
+ ${0}
111
+ </div>`), getStateClasses, when(x => x.charCount && x.maxlength, renderCharCount()), when(x => x.label, renderLabel()), x => affixIconTemplate(x.icon), x => x.handleTextInput(), x => x.handleChange(), x => x.autofocus, x => x.disabled, x => x.list, x => x.maxlength, x => x.minlength, x => x.pattern, x => x.placeholder, x => x.readOnly, x => x.required, x => x.size, x => x.autoComplete, x => x.name, x => x.spellcheck, x => x.value, x => x.type, x => x.ariaAtomic, x => x.ariaBusy, x => x.ariaControls, x => x.ariaCurrent, x => x.ariaDescribedby, x => x.ariaDetails, x => x.ariaDisabled, x => x.ariaErrormessage, x => x.ariaFlowto, x => x.ariaHaspopup, x => x.ariaHidden, x => x.ariaInvalid, x => x.ariaKeyshortcuts, x => x.ariaLabel, x => x.ariaLabelledby, x => x.ariaLive, x => x.ariaOwns, x => x.ariaRelevant, x => x.ariaRoledescription, ref('control'), () => focusTemplate, slotted('actionItemsSlottedContent'), when(x => {
112
+ var _a;
113
+ return !x.successText && !x.errorValidationMessage && ((_a = x.helperText) === null || _a === void 0 ? void 0 : _a.length);
114
+ }, getFeedbackTemplate('helper', context)), when(x => !x.successText && x.errorValidationMessage, getFeedbackTemplate('error', context)), when(x => x.successText, getFeedbackTemplate('success', context)));
629
115
  };
630
116
 
631
- const toggletipDefinition = Toggletip.compose({
632
- baseName: 'toggletip',
633
- template: ToggletipTemplate,
634
- styles: css_248z
117
+ const textFieldDefinition = TextField.compose({
118
+ baseName: 'text-field',
119
+ template: TextfieldTemplate,
120
+ styles: css_248z,
121
+ shadowOptions: {
122
+ delegatesFocus: true
123
+ }
635
124
  });
636
- const toggletipRegistries = [toggletipDefinition(), ...popupRegistries];
637
- const registerToggletip = registerFactory(toggletipRegistries);
125
+ const textFieldRegistries = [textFieldDefinition(), ...iconRegistries, ...focusRegistries];
126
+ const registerTextField = registerFactory(textFieldRegistries);
638
127
 
639
- export { toggletipRegistries as a, registerToggletip as r, toggletipDefinition as t };
128
+ export { textFieldRegistries as a, registerTextField as r, textFieldDefinition as t };