@vonage/vivid 3.24.0 → 3.26.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.
- package/accordion/index.js +0 -1
- package/accordion-item/index.js +0 -1
- package/alert/index.js +0 -1
- package/avatar/index.js +0 -1
- package/badge/index.js +0 -1
- package/banner/index.js +0 -1
- package/breadcrumb-item/index.js +0 -1
- package/button/index.js +0 -1
- package/card/index.js +0 -1
- package/checkbox/index.js +0 -1
- package/combobox/index.js +0 -1
- package/custom-elements.json +82 -10
- package/data-grid/index.js +7 -2
- package/dialog/index.js +0 -1
- package/empty-state/index.js +0 -1
- package/fab/index.js +0 -1
- package/icon/index.js +0 -1
- package/index.js +27 -29
- package/lib/action-group/action-group.d.ts +1 -1
- package/lib/avatar/avatar.d.ts +1 -1
- package/lib/checkbox/checkbox.d.ts +0 -1
- package/lib/components.d.ts +0 -2
- package/lib/data-grid/data-grid-cell.d.ts +14 -1
- package/lib/data-grid/data-grid.d.ts +4 -0
- package/lib/data-grid/data-grid.options.d.ts +7 -0
- package/lib/dialog/dialog.d.ts +1 -0
- package/lib/listbox/listbox.d.ts +1 -1
- package/lib/menu/menu.d.ts +0 -1
- package/lib/menu-item/menu-item.d.ts +6 -0
- package/lib/menu-item/menu-item.template.d.ts +2 -3
- package/lib/number-field/number-field.d.ts +1 -1
- package/lib/select/select.d.ts +1 -1
- package/lib/text-field/text-field.d.ts +1 -1
- package/listbox/index.js +56 -11
- package/menu/index.js +2 -3
- package/menu-item/index.js +2 -2
- package/nav/index.js +1 -1
- package/nav-disclosure/index.js +1 -2
- package/nav-item/index.js +1 -2
- package/note/index.js +1 -2
- package/number-field/index.js +1 -2
- package/option/index.js +0 -1
- package/package.json +1 -1
- package/pagination/index.js +1 -2
- package/popup/index.js +0 -1
- package/progress/index.js +1 -1
- package/radio/index.js +1 -1
- package/radio-group/index.js +1 -1
- package/select/index.js +1 -2
- package/shared/definition.js +1 -1
- package/shared/definition10.js +1 -1
- package/shared/definition11.js +1 -1
- package/shared/definition12.js +1 -1
- package/shared/definition14.js +1 -1
- package/shared/definition15.js +1 -1
- package/shared/definition16.js +2 -2
- package/shared/definition17.js +1 -1
- package/shared/definition18.js +1 -1
- package/shared/definition19.js +1 -1
- package/shared/definition2.js +1 -1
- package/shared/definition21.js +1 -1
- package/shared/definition22.js +76 -21
- package/shared/definition23.js +5 -4
- package/shared/definition24.js +1 -1
- package/shared/definition25.js +1 -1
- package/shared/definition26.js +1 -1
- package/shared/definition27.js +1 -1
- package/shared/definition29.js +368 -48
- package/shared/definition30.js +301 -298
- package/shared/definition31.js +14 -366
- package/shared/definition32.js +70 -13
- package/shared/definition33.js +25 -64
- package/shared/definition34.js +39 -27
- package/shared/definition35.js +431 -31
- package/shared/definition36.js +214 -430
- package/shared/definition37.js +70 -209
- package/shared/definition38.js +33 -81
- package/shared/definition39.js +423 -32
- package/shared/definition4.js +1 -1
- package/shared/definition40.js +586 -358
- package/shared/definition41.js +73 -648
- package/shared/definition42.js +584 -70
- package/shared/definition43.js +81 -538
- package/shared/definition44.js +52 -127
- package/shared/definition45.js +16 -56
- package/shared/definition46.js +485 -17
- package/shared/definition47.js +99 -477
- package/shared/definition48.js +19 -114
- package/shared/definition49.js +276 -19
- package/shared/definition5.js +1 -1
- package/shared/definition50.js +89 -245
- package/shared/definition51.js +629 -109
- package/shared/definition52.js +86 -601
- package/shared/definition53.js +68 -112
- package/shared/definition54.js +294 -69
- package/shared/definition6.js +1 -1
- package/shared/definition7.js +1 -1
- package/shared/definition8.js +2 -2
- package/shared/definition9.js +1 -1
- package/shared/es.object.assign.js +1 -1
- package/shared/es.regexp.to-string.js +1 -1
- package/shared/es.string.includes.js +1 -1
- package/shared/form-elements.js +1 -1
- package/shared/icon.js +17 -13
- package/shared/index.js +1 -1
- package/shared/patterns/form-elements/form-elements.d.ts +4 -4
- package/shared/string-trim.js +1 -1
- package/shared/text-field.js +1 -1
- package/shared/to-string.js +1 -1
- package/side-drawer/index.js +1 -1
- package/slider/index.js +1 -1
- package/styles/core/all.css +1 -1
- package/styles/core/theme.css +1 -1
- package/styles/core/typography.css +1 -1
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/switch/index.js +1 -2
- package/tab/index.js +1 -2
- package/tab-panel/index.js +1 -1
- package/tabs/index.js +3 -4
- package/tag/index.js +1 -2
- package/tag-group/index.js +1 -1
- package/text-anchor/index.js +0 -1
- package/text-area/index.js +1 -2
- package/text-field/index.js +3 -2
- package/toggletip/index.js +1 -2
- package/tooltip/index.js +1 -2
- package/tree-item/index.js +1 -2
- package/tree-view/index.js +1 -1
- package/vivid.api.json +19 -210
- package/shared/definition55.js +0 -305
- package/shared/engine-is-node.js +0 -8
package/shared/definition36.js
CHANGED
|
@@ -1,449 +1,233 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import './focus.js';
|
|
6
|
-
import { f as formElements, F as FormElementSuccessText, a as FormElementHelperText, b as FormElementCharCount, g as getFeedbackTemplate } from './form-elements.js';
|
|
7
|
-
import { S as StartEnd } from './start-end.js';
|
|
8
|
-
import { a as applyMixins } from './apply-mixins.js';
|
|
9
|
-
import { D as DelegatesARIATextbox } from './text-field2.js';
|
|
10
|
-
import { F as FormAssociated } from './form-associated.js';
|
|
11
|
-
import { b as keyArrowDown, c as keyArrowUp } from './key-codes.js';
|
|
1
|
+
import { a as Size, B as Button, b as buttonRegistries } from './definition7.js';
|
|
2
|
+
import { g as global$1, l as fails$1, k as functionUncurryThis, G as _export, F as FoundationElement, _ as __decorate, a as attr, b as __metadata, o as observable, S as volatile, h as html, r as registerFactory } from './index.js';
|
|
3
|
+
import { t as toString$1 } from './to-string.js';
|
|
4
|
+
import { w as whitespaces$1, s as stringTrim } from './string-trim.js';
|
|
12
5
|
import './es.regexp.to-string.js';
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
6
|
+
import './es.string.includes.js';
|
|
7
|
+
import { e as elements } from './node-observation.js';
|
|
15
8
|
import { r as ref } from './ref.js';
|
|
9
|
+
import { r as repeat } from './repeat.js';
|
|
10
|
+
import { c as children } from './children.js';
|
|
16
11
|
import { c as classNames } from './class-names.js';
|
|
12
|
+
import { w as when } from './when.js';
|
|
17
13
|
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* A form-associated base class for the {@link @microsoft/fast-foundation#(NumberField:class)} component.
|
|
22
|
-
*
|
|
23
|
-
* @internal
|
|
24
|
-
*/
|
|
25
|
-
class FormAssociatedNumberField extends FormAssociated(_NumberField) {
|
|
26
|
-
constructor() {
|
|
27
|
-
super(...arguments);
|
|
28
|
-
this.proxy = document.createElement("input");
|
|
29
|
-
}
|
|
30
|
-
}
|
|
14
|
+
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-flex;\n justify-content: space-between;\n}\n\n.buttons-wrapper {\n display: flex;\n column-gap: 4px;\n}\n\n.dots {\n align-self: center;\n text-align: center;\n}\n.dots:not(.size-super-condensed) {\n font: var(--vvd-typography-base-bold);\n}\n.dots.size-super-condensed {\n font: var(--vvd-typography-base-condensed-bold);\n inline-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 16));\n}\n.dots.size-condensed {\n inline-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 8));\n}\n.dots.size-normal {\n inline-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2)));\n}";
|
|
31
15
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
*/
|
|
100
|
-
minChanged(previous, next) {
|
|
101
|
-
var _a;
|
|
102
|
-
this.min = Math.min(next, (_a = this.max) !== null && _a !== void 0 ? _a : next);
|
|
103
|
-
const max = Math.max(this.min, this.max);
|
|
104
|
-
if (this.max !== undefined && this.max !== max) {
|
|
105
|
-
this.max = max;
|
|
106
|
-
}
|
|
107
|
-
this.value = this.getValidValue(this.value);
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* The value property, typed as a number.
|
|
111
|
-
*
|
|
112
|
-
* @public
|
|
113
|
-
*/
|
|
114
|
-
get valueAsNumber() {
|
|
115
|
-
return parseFloat(super.value);
|
|
116
|
-
}
|
|
117
|
-
set valueAsNumber(next) {
|
|
118
|
-
this.value = next.toString();
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Validates that the value is a number between the min and max
|
|
122
|
-
* @param previous - previous stored value
|
|
123
|
-
* @param next - value being updated
|
|
124
|
-
* @param updateControl - should the text field be updated with value, defaults to true
|
|
125
|
-
* @internal
|
|
126
|
-
*/
|
|
127
|
-
valueChanged(previous, next) {
|
|
128
|
-
this.value = this.getValidValue(next);
|
|
129
|
-
if (next !== this.value) {
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
if (this.control && !this.isUserInput) {
|
|
133
|
-
this.control.value = this.value;
|
|
134
|
-
}
|
|
135
|
-
super.valueChanged(previous, this.value);
|
|
136
|
-
if (previous !== undefined && !this.isUserInput) {
|
|
137
|
-
this.$emit("input");
|
|
138
|
-
this.$emit("change");
|
|
16
|
+
var global = global$1;
|
|
17
|
+
var fails = fails$1;
|
|
18
|
+
var uncurryThis = functionUncurryThis;
|
|
19
|
+
var toString = toString$1;
|
|
20
|
+
var trim = stringTrim.trim;
|
|
21
|
+
var whitespaces = whitespaces$1;
|
|
22
|
+
|
|
23
|
+
var $parseInt$1 = global.parseInt;
|
|
24
|
+
var Symbol = global.Symbol;
|
|
25
|
+
var ITERATOR = Symbol && Symbol.iterator;
|
|
26
|
+
var hex = /^[+-]?0x/i;
|
|
27
|
+
var exec = uncurryThis(hex.exec);
|
|
28
|
+
var FORCED = $parseInt$1(whitespaces + '08') !== 8 || $parseInt$1(whitespaces + '0x16') !== 22
|
|
29
|
+
// MS Edge 18- broken with boxed symbols
|
|
30
|
+
|| (ITERATOR && !fails(function () { $parseInt$1(Object(ITERATOR)); }));
|
|
31
|
+
|
|
32
|
+
// `parseInt` method
|
|
33
|
+
// https://tc39.es/ecma262/#sec-parseint-string-radix
|
|
34
|
+
var numberParseInt = FORCED ? function parseInt(string, radix) {
|
|
35
|
+
var S = trim(toString(string));
|
|
36
|
+
return $parseInt$1(S, (radix >>> 0) || (exec(hex, S) ? 16 : 10));
|
|
37
|
+
} : $parseInt$1;
|
|
38
|
+
|
|
39
|
+
var $ = _export;
|
|
40
|
+
var $parseInt = numberParseInt;
|
|
41
|
+
|
|
42
|
+
// `parseInt` method
|
|
43
|
+
// https://tc39.es/ecma262/#sec-parseint-string-radix
|
|
44
|
+
$({ global: true, forced: parseInt != $parseInt }, {
|
|
45
|
+
parseInt: $parseInt
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
const MAX_DIGITS_AND_PLACEHOLDERS = 7;
|
|
49
|
+
const totalConverter = {
|
|
50
|
+
fromView: value => parseInt(value, 10),
|
|
51
|
+
toView: value => value.toString()
|
|
52
|
+
};
|
|
53
|
+
class Pagination extends FoundationElement {
|
|
54
|
+
constructor() {
|
|
55
|
+
super();
|
|
56
|
+
this.navIcons = false;
|
|
57
|
+
this.total = 0;
|
|
58
|
+
this.selectedIndex = 0;
|
|
59
|
+
this.addEventListener('tabpressed', e => {
|
|
60
|
+
const {
|
|
61
|
+
value: currentLabel,
|
|
62
|
+
shiftKey
|
|
63
|
+
} = e.detail;
|
|
64
|
+
const index = this.paginationButtons.findIndex(button => Number(button.label) === currentLabel);
|
|
65
|
+
const focusDirection = shiftKey ? -1 : 1;
|
|
66
|
+
const newIndex = index + focusDirection;
|
|
67
|
+
if (newIndex < 0) {
|
|
68
|
+
return this.prevButton.focus();
|
|
69
|
+
}
|
|
70
|
+
if (newIndex > this.paginationButtons.length - 1) {
|
|
71
|
+
return this.nextButton.focus();
|
|
72
|
+
}
|
|
73
|
+
this.paginationButtons && this.paginationButtons[index + focusDirection].focus();
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
get pagesList() {
|
|
77
|
+
return new Array(this.total < MAX_DIGITS_AND_PLACEHOLDERS ? this.total : MAX_DIGITS_AND_PLACEHOLDERS).fill(0).map((_, i, arr) => {
|
|
78
|
+
if (i === 0) return 1;
|
|
79
|
+
if (i === arr.length - 1) return this.total;
|
|
80
|
+
if (this.selectedIndex !== undefined && this.total > MAX_DIGITS_AND_PLACEHOLDERS) {
|
|
81
|
+
if (this.selectedIndex < 4) {
|
|
82
|
+
if (i === MAX_DIGITS_AND_PLACEHOLDERS - 2) return '...';
|
|
139
83
|
}
|
|
140
|
-
this.
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
validate() {
|
|
144
|
-
super.validate(this.control);
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* Sets the internal value to a valid number between the min and max properties
|
|
148
|
-
* @param value - user input
|
|
149
|
-
*
|
|
150
|
-
* @internal
|
|
151
|
-
*/
|
|
152
|
-
getValidValue(value) {
|
|
153
|
-
var _a, _b;
|
|
154
|
-
let validValue = parseFloat(parseFloat(value).toPrecision(12));
|
|
155
|
-
if (isNaN(validValue)) {
|
|
156
|
-
validValue = "";
|
|
84
|
+
if (this.selectedIndex >= 4 && this.selectedIndex <= this.total - 5) {
|
|
85
|
+
if (i > 1 && i < MAX_DIGITS_AND_PLACEHOLDERS - 2) return this.selectedIndex + (i - 2);
|
|
86
|
+
if (i === 1 || i === MAX_DIGITS_AND_PLACEHOLDERS - 2) return '...';
|
|
157
87
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
88
|
+
if (this.selectedIndex > this.total - 5) {
|
|
89
|
+
if (i > 1) return this.total - (6 - i);
|
|
90
|
+
if (i === 1) return '...';
|
|
161
91
|
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
stepUp() {
|
|
170
|
-
const value = parseFloat(this.value);
|
|
171
|
-
const stepUpValue = !isNaN(value)
|
|
172
|
-
? value + this.step
|
|
173
|
-
: this.min > 0
|
|
174
|
-
? this.min
|
|
175
|
-
: this.max < 0
|
|
176
|
-
? this.max
|
|
177
|
-
: !this.min
|
|
178
|
-
? this.step
|
|
179
|
-
: 0;
|
|
180
|
-
this.value = stepUpValue.toString();
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
* Decrements the value using the step value
|
|
184
|
-
*
|
|
185
|
-
* @public
|
|
186
|
-
*/
|
|
187
|
-
stepDown() {
|
|
188
|
-
const value = parseFloat(this.value);
|
|
189
|
-
const stepDownValue = !isNaN(value)
|
|
190
|
-
? value - this.step
|
|
191
|
-
: this.min > 0
|
|
192
|
-
? this.min
|
|
193
|
-
: this.max < 0
|
|
194
|
-
? this.max
|
|
195
|
-
: !this.min
|
|
196
|
-
? 0 - this.step
|
|
197
|
-
: 0;
|
|
198
|
-
this.value = stepDownValue.toString();
|
|
199
|
-
}
|
|
200
|
-
/**
|
|
201
|
-
* Sets up the initial state of the number field
|
|
202
|
-
* @internal
|
|
203
|
-
*/
|
|
204
|
-
connectedCallback() {
|
|
205
|
-
super.connectedCallback();
|
|
206
|
-
this.proxy.setAttribute("type", "number");
|
|
207
|
-
this.validate();
|
|
208
|
-
this.control.value = this.value;
|
|
209
|
-
if (this.autofocus) {
|
|
210
|
-
DOM.queueUpdate(() => {
|
|
211
|
-
this.focus();
|
|
212
|
-
});
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
/**
|
|
216
|
-
* Selects all the text in the number field
|
|
217
|
-
*
|
|
218
|
-
* @public
|
|
219
|
-
*/
|
|
220
|
-
select() {
|
|
221
|
-
this.control.select();
|
|
222
|
-
/**
|
|
223
|
-
* The select event does not permeate the shadow DOM boundary.
|
|
224
|
-
* This fn effectively proxies the select event,
|
|
225
|
-
* emitting a `select` event whenever the internal
|
|
226
|
-
* control emits a `select` event
|
|
227
|
-
*/
|
|
228
|
-
this.$emit("select");
|
|
229
|
-
}
|
|
230
|
-
/**
|
|
231
|
-
* Handles the internal control's `input` event
|
|
232
|
-
* @internal
|
|
233
|
-
*/
|
|
234
|
-
handleTextInput() {
|
|
235
|
-
this.control.value = this.control.value.replace(/[^0-9\-+e.]/g, "");
|
|
236
|
-
this.isUserInput = true;
|
|
237
|
-
this.value = this.control.value;
|
|
238
|
-
}
|
|
239
|
-
/**
|
|
240
|
-
* Change event handler for inner control.
|
|
241
|
-
* @remarks
|
|
242
|
-
* "Change" events are not `composable` so they will not
|
|
243
|
-
* permeate the shadow DOM boundary. This fn effectively proxies
|
|
244
|
-
* the change event, emitting a `change` event whenever the internal
|
|
245
|
-
* control emits a `change` event
|
|
246
|
-
* @internal
|
|
247
|
-
*/
|
|
248
|
-
handleChange() {
|
|
249
|
-
this.$emit("change");
|
|
250
|
-
}
|
|
251
|
-
/**
|
|
252
|
-
* Handles the internal control's `keydown` event
|
|
253
|
-
* @internal
|
|
254
|
-
*/
|
|
255
|
-
handleKeyDown(e) {
|
|
256
|
-
const key = e.key;
|
|
257
|
-
switch (key) {
|
|
258
|
-
case keyArrowUp:
|
|
259
|
-
this.stepUp();
|
|
260
|
-
return false;
|
|
261
|
-
case keyArrowDown:
|
|
262
|
-
this.stepDown();
|
|
263
|
-
return false;
|
|
264
|
-
}
|
|
265
|
-
return true;
|
|
266
|
-
}
|
|
267
|
-
/**
|
|
268
|
-
* Handles populating the input field with a validated value when
|
|
269
|
-
* leaving the input field.
|
|
270
|
-
* @internal
|
|
271
|
-
*/
|
|
272
|
-
handleBlur() {
|
|
273
|
-
this.control.value = this.value;
|
|
92
|
+
}
|
|
93
|
+
return i + 1;
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
totalChanged(_, newValue) {
|
|
97
|
+
if (newValue < 0) {
|
|
98
|
+
this.total = 0;
|
|
274
99
|
}
|
|
100
|
+
this.selectedIndex = 0;
|
|
101
|
+
}
|
|
102
|
+
selectedIndexChanged(oldValue, newValue) {
|
|
103
|
+
if (oldValue === undefined) return;
|
|
104
|
+
this.$emit('pagination-change', {
|
|
105
|
+
selectedIndex: newValue,
|
|
106
|
+
total: this.total,
|
|
107
|
+
oldIndex: oldValue
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
paginationButtonsChanged(_, newValue) {
|
|
111
|
+
newValue.forEach(button => {
|
|
112
|
+
button.shadowRoot.querySelector('button').classList.add('icon-only');
|
|
113
|
+
});
|
|
114
|
+
}
|
|
275
115
|
}
|
|
276
|
-
__decorate([
|
|
277
|
-
|
|
278
|
-
],
|
|
279
|
-
__decorate([
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
],
|
|
285
|
-
__decorate([
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
],
|
|
294
|
-
__decorate([
|
|
295
|
-
attr({ converter: nullableNumberConverter })
|
|
296
|
-
], NumberField$1.prototype, "minlength", void 0);
|
|
297
|
-
__decorate([
|
|
298
|
-
attr({ converter: nullableNumberConverter })
|
|
299
|
-
], NumberField$1.prototype, "size", void 0);
|
|
300
|
-
__decorate([
|
|
301
|
-
attr({ converter: nullableNumberConverter })
|
|
302
|
-
], NumberField$1.prototype, "step", void 0);
|
|
303
|
-
__decorate([
|
|
304
|
-
attr({ converter: nullableNumberConverter })
|
|
305
|
-
], NumberField$1.prototype, "max", void 0);
|
|
306
|
-
__decorate([
|
|
307
|
-
attr({ converter: nullableNumberConverter })
|
|
308
|
-
], NumberField$1.prototype, "min", void 0);
|
|
309
|
-
__decorate([
|
|
310
|
-
observable
|
|
311
|
-
], NumberField$1.prototype, "defaultSlottedNodes", void 0);
|
|
312
|
-
applyMixins(NumberField$1, StartEnd, DelegatesARIATextbox);
|
|
313
|
-
|
|
314
|
-
var css_248z = "/**\n * Do not edit directly\n * Generated on Thu, 13 Jul 2023 12:46:24 GMT\n */\n:host {\n display: inline-block;\n}\n\n.base {\n --_text-field-gutter: calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2))) / 2.5);\n --_text-field-icon-size: calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2))) / 2);\n display: inline-grid;\n width: 100%;\n gap: 4px;\n grid-template-columns: min-content 1fr max-content;\n}\n.base {\n --_appearance-color-text: var(--vvd-color-canvas-text);\n --_appearance-color-fill: var(--_connotation-color-backdrop);\n --_appearance-color-outline: var(--_connotation-color-intermediate);\n}\n.base.appearance-ghost {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.base:where(:hover, .hover):where(:not(:disabled, .disabled, .readonly)) {\n --_appearance-color-text: var(--vvd-color-canvas-text);\n --_appearance-color-fill: var(--_connotation-color-backdrop);\n --_appearance-color-outline: var(--_connotation-color-firm);\n}\n.base:where(:hover, .hover):where(:not(:disabled, .disabled, .readonly)).appearance-ghost {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: var(--_connotation-color-faint);\n --_appearance-color-outline: transparent;\n}\n.base:where(:disabled, .disabled) {\n --_appearance-color-text: var(--vvd-color-neutral-300);\n --_appearance-color-fill: var(--vvd-color-neutral-100);\n --_appearance-color-outline: var(--vvd-color-neutral-300);\n}\n.base:where(:disabled, .disabled).appearance-ghost {\n --_appearance-color-text: var(--vvd-color-neutral-300);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.base:where(.readonly):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--vvd-color-canvas-text);\n --_appearance-color-fill: var(--vvd-color-neutral-200);\n --_appearance-color-outline: var(--vvd-color-neutral-400);\n}\n.base:where(.readonly):where(:not(:disabled, .disabled)).appearance-ghost {\n --_appearance-color-text: var(--vvd-color-neutral-600);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.base.connotation-success {\n /* @cssprop [--vvd-text-field-success-primary=var(--vvd-color-success-500)] */\n --_connotation-color-primary: var(--vvd-text-field-success-primary, var(--vvd-color-success-500));\n /* @cssprop [--vvd-text-field-success-backdrop=var(--vvd-color-success-50)] */\n --_connotation-color-backdrop: var(--vvd-text-field-success-backdrop, var(--vvd-color-success-50));\n /* @cssprop [--vvd-text-field-success-intermediate=var(--vvd-color-success-500)] */\n --_connotation-color-intermediate: var(--vvd-text-field-success-intermediate, var(--vvd-color-success-500));\n /* @cssprop [--vvd-text-field-success-firm=var(--vvd-color-success-600)] */\n --_connotation-color-firm: var(--vvd-text-field-success-firm, var(--vvd-color-success-600));\n /* @cssprop [--vvd-text-field-success-faint=var(--vvd-color-success-50)] */\n --_connotation-color-faint: var(--vvd-text-field-success-faint, var(--vvd-color-success-50));\n /* @cssprop [--vvd-text-field-success-soft=var(--vvd-color-success-100)] */\n --_connotation-color-soft: var(--vvd-text-field-success-soft, var(--vvd-color-success-100));\n}\n.base.connotation-alert {\n /* @cssprop [--vvd-text-field-alert-primary=var(--vvd-color-alert-500)] */\n --_connotation-color-primary: var(--vvd-text-field-alert-primary, var(--vvd-color-alert-500));\n /* @cssprop [--vvd-text-field-alert-backdrop=var(--vvd-color-alert-50)] */\n --_connotation-color-backdrop: var(--vvd-text-field-alert-backdrop, var(--vvd-color-alert-50));\n /* @cssprop [--vvd-text-field-alert-intermediate=var(--vvd-color-alert-500)] */\n --_connotation-color-intermediate: var(--vvd-text-field-alert-intermediate, var(--vvd-color-alert-500));\n /* @cssprop [--vvd-text-field-alert-firm=var(--vvd-color-alert-600)] */\n --_connotation-color-firm: var(--vvd-text-field-alert-firm, var(--vvd-color-alert-600));\n /* @cssprop [--vvd-text-field-alert-faint=var(--vvd-color-alert-50)] */\n --_connotation-color-faint: var(--vvd-text-field-alert-faint, var(--vvd-color-alert-50));\n /* @cssprop [--vvd-text-field-alert-soft=var(--vvd-color-alert-100)] */\n --_connotation-color-soft: var(--vvd-text-field-alert-soft, var(--vvd-color-alert-100));\n}\n.base:not(.connotation-success, .connotation-alert) {\n /* @cssprop [--vvd-text-field-accent-primary=var(--vvd-color-canvas-text)] */\n --_connotation-color-primary: var(--vvd-text-field-accent-primary, var(--vvd-color-canvas-text));\n /* @cssprop [--vvd-text-field-accent-backdrop=var(--vvd-color-canvas)] */\n --_connotation-color-backdrop: var(--vvd-text-field-accent-backdrop, var(--vvd-color-canvas));\n /* @cssprop [--vvd-text-field-accent-intermediate=var(--vvd-color-neutral-500)] */\n --_connotation-color-intermediate: var(--vvd-text-field-accent-intermediate, var(--vvd-color-neutral-500));\n /* @cssprop [--vvd-text-field-accent-firm=var(--vvd-color-canvas-text)] */\n --_connotation-color-firm: var(--vvd-text-field-accent-firm, var(--vvd-color-canvas-text));\n /* @cssprop [--vvd-text-field-accent-faint=var(--vvd-color-neutral-50)] */\n --_connotation-color-faint: var(--vvd-text-field-accent-faint, var(--vvd-color-neutral-50));\n /* @cssprop [--vvd-text-field-accent-soft=var(--vvd-color-neutral-100)] */\n --_connotation-color-soft: var(--vvd-text-field-accent-soft, var(--vvd-color-neutral-100));\n}\n@supports (user-select: none) {\n .base {\n user-select: none;\n }\n}\n.base:not(.disabled) {\n --_low-ink-color: var(--vvd-color-neutral-600);\n}\n.base.disabled {\n --_low-ink-color: var(--_appearance-color-text);\n}\n\n.label {\n color: var(--vvd-color-canvas-text);\n contain: inline-size;\n font: var(--vvd-typography-base);\n grid-column: 1/4;\n grid-row: 1;\n}\n.char-count + .label {\n grid-column: 1/3;\n}\n\n.char-count {\n color: var(--_low-ink-color);\n font: var(--vvd-typography-base);\n grid-column: 3/4;\n}\n\n.fieldset {\n position: relative;\n display: flex;\n align-items: center;\n grid-column: 1/4;\n transition: color 0.2s;\n /* Shape */\n}\n.base > .fieldset {\n block-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2)));\n}\n.base:not(.shape-pill) .fieldset {\n border-radius: 6px;\n}\n.base.shape-pill .fieldset {\n border-radius: 24px;\n}\n\n.control {\n width: 100%;\n border: 0 none;\n appearance: none; /* for box-shadow visibility on IOS */\n background-color: var(--_appearance-color-fill);\n block-size: 100%;\n border-radius: inherit;\n box-shadow: inset 0 0 0 1px var(--_appearance-color-outline);\n color: var(--_appearance-color-text);\n font: var(--vvd-typography-base);\n padding-block: 0;\n padding-inline-end: var(--_text-field-gutter);\n padding-inline-start: var(--_text-field-gutter);\n transition: box-shadow 0.2s, background-color 0.2s;\n}\n.control:disabled {\n cursor: not-allowed;\n opacity: 1; /* 2. correct opacity on iOS */\n -webkit-text-fill-color: var(--_appearance-color-text); /* 1. sets text fill to current `color` for safari */\n}\n.control::placeholder, .control:disabled::placeholder {\n opacity: 1; /* 2. correct opacity on iOS */\n -webkit-text-fill-color: var(--_low-ink-color); /* 1. sets text fill to current `color` for safari */\n}\n@supports selector(:focus-visible) {\n .control:focus {\n outline: none;\n }\n}\n\n.icon {\n position: absolute;\n z-index: 1;\n color: var(--_low-ink-color);\n font-size: var(--_text-field-icon-size);\n inset-inline-start: var(--_text-field-gutter);\n line-height: 1;\n}\n.icon + .control {\n padding-inline-start: calc(var(--_text-field-icon-size) + var(--_text-field-gutter) * 2);\n}\n\n.focus-indicator {\n --focus-stroke-gap-color: transparent;\n pointer-events: none;\n}\n.fieldset:not(:focus-visible, :focus-within) > .focus-indicator {\n display: none;\n}\n\n.control {\n padding-inline-end: 70px;\n}\n.control::-webkit-outer-spin-button, .control::-webkit-inner-spin-button {\n appearance: none;\n}\n.control-buttons {\n position: absolute;\n z-index: 1;\n right: 3px;\n display: flex;\n}\n.readonly .control-buttons, .disabled .control-buttons {\n pointer-events: none;\n}\n.control-buttons .divider {\n margin-block: 8px;\n}\n.control-buttons > * {\n flex-shrink: 0;\n}\n\n.disabled .focus-indicator {\n display: none;\n pointer-events: none;\n}";
|
|
116
|
+
__decorate([attr, __metadata("design:type", String)], Pagination.prototype, "size", void 0);
|
|
117
|
+
__decorate([observable, __metadata("design:type", Array)], Pagination.prototype, "paginationButtons", void 0);
|
|
118
|
+
__decorate([observable, __metadata("design:type", Function)], Pagination.prototype, "prevButton", void 0);
|
|
119
|
+
__decorate([observable, __metadata("design:type", Function)], Pagination.prototype, "nextButton", void 0);
|
|
120
|
+
__decorate([attr({
|
|
121
|
+
attribute: 'nav-icons',
|
|
122
|
+
mode: 'boolean'
|
|
123
|
+
}), __metadata("design:type", Object)], Pagination.prototype, "navIcons", void 0);
|
|
124
|
+
__decorate([volatile, __metadata("design:type", Object), __metadata("design:paramtypes", [])], Pagination.prototype, "pagesList", null);
|
|
125
|
+
__decorate([attr({
|
|
126
|
+
mode: 'reflect',
|
|
127
|
+
converter: totalConverter
|
|
128
|
+
}), __metadata("design:type", Number)], Pagination.prototype, "total", void 0);
|
|
129
|
+
__decorate([attr({
|
|
130
|
+
mode: 'reflect',
|
|
131
|
+
converter: totalConverter,
|
|
132
|
+
attribute: 'selected-index'
|
|
133
|
+
}), __metadata("design:type", Object)], Pagination.prototype, "selectedIndex", void 0);
|
|
315
134
|
|
|
316
|
-
let
|
|
317
|
-
__decorate([attr, __metadata("design:type", String)], NumberField.prototype, "appearance", void 0);
|
|
318
|
-
__decorate([attr, __metadata("design:type", String)], NumberField.prototype, "shape", void 0);
|
|
319
|
-
__decorate([attr, __metadata("design:type", String)], NumberField.prototype, "autoComplete", void 0);
|
|
320
|
-
NumberField = __decorate([formElements], NumberField);
|
|
321
|
-
applyMixins(NumberField, AffixIcon, FormElementCharCount, FormElementHelperText, FormElementSuccessText);
|
|
322
|
-
|
|
323
|
-
let _ = t => t,
|
|
135
|
+
let _2 = t => t,
|
|
324
136
|
_t,
|
|
325
137
|
_t2,
|
|
326
|
-
_t3
|
|
327
|
-
|
|
328
|
-
const
|
|
329
|
-
const
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
value
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
|
|
138
|
+
_t3,
|
|
139
|
+
_t4;
|
|
140
|
+
const ALLOWED_SIZES = [Size.SuperCondensed, Size.Condensed, Size.Normal];
|
|
141
|
+
const handleSelection = (value, {
|
|
142
|
+
parent: x
|
|
143
|
+
}) => {
|
|
144
|
+
return x.selectedIndex = Number(value) - 1;
|
|
145
|
+
};
|
|
146
|
+
const handleKeyDown = (value, {
|
|
147
|
+
event,
|
|
148
|
+
parent
|
|
149
|
+
}) => {
|
|
150
|
+
if (event.key === ' ' || event.key === 'Enter') {
|
|
151
|
+
handleSelection(value, {
|
|
152
|
+
parent
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
if (event.key === 'Tab') {
|
|
156
|
+
event.target.dispatchEvent(new CustomEvent('tabpressed', {
|
|
157
|
+
detail: {
|
|
158
|
+
value,
|
|
159
|
+
shiftKey: event.shiftKey
|
|
160
|
+
},
|
|
161
|
+
bubbles: true,
|
|
162
|
+
composed: true
|
|
163
|
+
}));
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
const getClasses = _ => classNames('control');
|
|
167
|
+
function getButtonAppearance(value, {
|
|
168
|
+
parent
|
|
169
|
+
}) {
|
|
170
|
+
return parent.selectedIndex === Number(value) - 1 ? 'filled' : 'ghost';
|
|
354
171
|
}
|
|
355
|
-
|
|
172
|
+
const paginationButtonRenderer = buttonTag => html(_t || (_t = _2`
|
|
173
|
+
${0}
|
|
174
|
+
${0}`), when(value => value !== '...', html(_t2 || (_t2 = _2`
|
|
175
|
+
<${0} class="vwc-pagination-button"
|
|
176
|
+
label="${0}"
|
|
177
|
+
appearance="${0}"
|
|
178
|
+
size="${0}"
|
|
179
|
+
tabindex="0"
|
|
180
|
+
aria-pressed="${0}"
|
|
181
|
+
@click="${0}"
|
|
182
|
+
@keydown="${0}"
|
|
183
|
+
</${0}>
|
|
184
|
+
`), buttonTag, value => value, getButtonAppearance, (_, {
|
|
185
|
+
parent: x
|
|
186
|
+
}) => getPaginationSize(x), (value, {
|
|
187
|
+
parent
|
|
188
|
+
}) => parent.selectedIndex === Number(value) - 1, handleSelection, handleKeyDown, buttonTag)), when(value => value === '...', html(_t3 || (_t3 = _2`<div class="dots size-${0}">...</div>`), getPaginationSize)));
|
|
189
|
+
const getPaginationSize = x => {
|
|
190
|
+
if (!x.size || !ALLOWED_SIZES.includes(x.size)) {
|
|
191
|
+
return Size.SuperCondensed;
|
|
192
|
+
}
|
|
193
|
+
return x.size;
|
|
194
|
+
};
|
|
195
|
+
const PaginationTemplate = context => {
|
|
356
196
|
const buttonTag = context.tagFor(Button);
|
|
357
|
-
const
|
|
358
|
-
return html(
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
<input class="control"
|
|
384
|
-
id="control"
|
|
385
|
-
@input="${0}"
|
|
386
|
-
@change="${0}"
|
|
387
|
-
?autofocus="${0}"
|
|
388
|
-
?disabled="${0}"
|
|
389
|
-
list="${0}"
|
|
390
|
-
step="${0}"
|
|
391
|
-
max="${0}"
|
|
392
|
-
min="${0}"
|
|
393
|
-
maxlength="${0}"
|
|
394
|
-
minlength="${0}"
|
|
395
|
-
placeholder="${0}"
|
|
396
|
-
?readonly="${0}"
|
|
397
|
-
?required="${0}"
|
|
398
|
-
size="${0}"
|
|
399
|
-
autocomplete="${0}"
|
|
400
|
-
name="${0}"
|
|
401
|
-
?spellcheck="${0}"
|
|
402
|
-
:value="${0}"
|
|
403
|
-
type="text"
|
|
404
|
-
aria-atomic="${0}"
|
|
405
|
-
aria-busy="${0}"
|
|
406
|
-
aria-controls="${0}"
|
|
407
|
-
aria-current="${0}"
|
|
408
|
-
aria-describedby="${0}"
|
|
409
|
-
aria-details="${0}"
|
|
410
|
-
aria-disabled="${0}"
|
|
411
|
-
aria-errormessage="${0}"
|
|
412
|
-
aria-flowto="${0}"
|
|
413
|
-
aria-haspopup="${0}"
|
|
414
|
-
aria-hidden="${0}"
|
|
415
|
-
aria-invalid="${0}"
|
|
416
|
-
aria-keyshortcuts="${0}"
|
|
417
|
-
aria-label="${0}"
|
|
418
|
-
aria-labelledby="${0}"
|
|
419
|
-
aria-live="${0}"
|
|
420
|
-
aria-owns="${0}"
|
|
421
|
-
aria-relevant="${0}"
|
|
422
|
-
aria-roledescription="${0}"
|
|
423
|
-
${0}
|
|
424
|
-
/>
|
|
425
|
-
${0}
|
|
426
|
-
${0}
|
|
427
|
-
</div>
|
|
428
|
-
${0}
|
|
429
|
-
${0}
|
|
430
|
-
${0}
|
|
431
|
-
</div>
|
|
432
|
-
`), getStateClasses, when(x => x.label, renderLabel()), x => x.handleTextInput(), x => x.handleChange(), x => x.autofocus, x => x.disabled, x => x.list, x => x.step ? x.step : null, x => x.max, x => x.min, x => x.maxlength, x => x.minlength, 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.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, () => numberControlButtons(context), when(x => {
|
|
433
|
-
var _a;
|
|
434
|
-
return !x.successText && !x.errorValidationMessage && ((_a = x.helperText) === null || _a === void 0 ? void 0 : _a.length);
|
|
435
|
-
}, getFeedbackTemplate('helper', context)), when(x => !x.successText && x.errorValidationMessage, getFeedbackTemplate('error', context)), when(x => x.successText, getFeedbackTemplate('success', context)));
|
|
197
|
+
const paginationButtonTemplate = paginationButtonRenderer(buttonTag);
|
|
198
|
+
return html(_t4 || (_t4 = _2`
|
|
199
|
+
<div class="${0}">
|
|
200
|
+
<${0} class="prev-button" ${0}
|
|
201
|
+
label="${0}"
|
|
202
|
+
icon="${0}"
|
|
203
|
+
size="${0}"
|
|
204
|
+
?disabled="${0}"
|
|
205
|
+
@click="${0}"
|
|
206
|
+
></${0}>
|
|
207
|
+
<div id="buttons-wrapper" class="buttons-wrapper" ${0}>
|
|
208
|
+
${0}
|
|
209
|
+
</div>
|
|
210
|
+
<${0} class="next-button" ${0}
|
|
211
|
+
label="${0}"
|
|
212
|
+
icon="${0}"
|
|
213
|
+
size="${0}"
|
|
214
|
+
?disabled="${0}"
|
|
215
|
+
@click="${0}"
|
|
216
|
+
></${0}>
|
|
217
|
+
</div>`), getClasses, buttonTag, ref('prevButton'), x => !x.navIcons ? 'Previous' : null, x => x.navIcons ? 'chevron-left-line' : null, getPaginationSize, x => x.total === 0 || x.selectedIndex === 0, x => x.selectedIndex !== undefined && x.selectedIndex--, buttonTag, children({
|
|
218
|
+
property: 'paginationButtons',
|
|
219
|
+
filter: elements(buttonTag)
|
|
220
|
+
}), repeat(x => x.pagesList, paginationButtonTemplate, {
|
|
221
|
+
positioning: true
|
|
222
|
+
}), buttonTag, ref('nextButton'), x => !x.navIcons ? 'Next' : null, x => x.navIcons ? 'chevron-right-line' : null, getPaginationSize, x => x.total === 0 || x.selectedIndex === x.total - 1, x => x.selectedIndex !== undefined && x.selectedIndex++, buttonTag);
|
|
436
223
|
};
|
|
437
224
|
|
|
438
|
-
const
|
|
439
|
-
baseName: '
|
|
440
|
-
template:
|
|
441
|
-
styles: css_248z
|
|
442
|
-
shadowOptions: {
|
|
443
|
-
delegatesFocus: true
|
|
444
|
-
}
|
|
225
|
+
const paginationDefinition = Pagination.compose({
|
|
226
|
+
baseName: 'pagination',
|
|
227
|
+
template: PaginationTemplate,
|
|
228
|
+
styles: css_248z
|
|
445
229
|
});
|
|
446
|
-
const
|
|
447
|
-
const
|
|
230
|
+
const paginationRegistries = [paginationDefinition(), buttonRegistries];
|
|
231
|
+
const registerPagination = registerFactory(paginationRegistries);
|
|
448
232
|
|
|
449
|
-
export {
|
|
233
|
+
export { paginationRegistries as a, paginationDefinition as p, registerPagination as r };
|