@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.
- package/README.md +2 -0
- package/custom-elements.json +300 -0
- package/file-picker/index.js +26 -0
- package/header/index.js +1 -1
- package/index.js +30 -29
- package/layout/index.js +1 -1
- package/lib/components.d.ts +1 -1
- package/lib/file-picker/definition.d.ts +3 -0
- package/lib/file-picker/file-picker.d.ts +22 -0
- package/lib/file-picker/file-picker.template.d.ts +4 -0
- package/lib/file-picker/index.d.ts +1 -0
- package/lib/menu/menu.d.ts +1 -0
- package/listbox/index.js +1 -1
- package/menu/index.js +2 -2
- package/menu-item/index.js +1 -1
- package/nav/index.js +1 -1
- package/nav-disclosure/index.js +1 -1
- package/nav-item/index.js +1 -1
- package/note/index.js +1 -1
- package/number-field/index.js +1 -1
- package/package.json +2 -1
- package/pagination/index.js +1 -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 -1
- 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 +1 -1
- 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/definition20.js +1 -1
- package/shared/definition21.js +1 -1
- package/shared/definition22.js +2 -2
- package/shared/definition23.js +1 -1
- package/shared/definition24.js +1 -1
- package/shared/definition25.js +1 -1
- package/shared/definition26.js +1 -1
- package/shared/definition27.js +2285 -45
- package/shared/definition28.js +46 -36
- package/shared/definition29.js +38 -368
- package/shared/definition30.js +307 -299
- package/shared/definition31.js +375 -14
- package/shared/definition32.js +13 -70
- package/shared/definition33.js +66 -25
- package/shared/definition34.js +27 -39
- package/shared/definition35.js +31 -431
- package/shared/definition36.js +430 -214
- package/shared/definition37.js +209 -70
- package/shared/definition38.js +81 -33
- package/shared/definition39.js +32 -423
- package/shared/definition4.js +1 -1
- package/shared/definition40.js +358 -586
- package/shared/definition41.js +648 -73
- package/shared/definition42.js +70 -584
- package/shared/definition43.js +538 -81
- package/shared/definition44.js +127 -52
- package/shared/definition45.js +56 -16
- package/shared/definition46.js +17 -485
- package/shared/definition47.js +477 -99
- package/shared/definition48.js +114 -19
- package/shared/definition49.js +19 -276
- package/shared/definition5.js +1 -1
- package/shared/definition50.js +245 -89
- package/shared/definition51.js +117 -628
- package/shared/definition52.js +601 -86
- package/shared/definition53.js +112 -68
- package/shared/definition54.js +69 -294
- package/shared/definition55.js +305 -0
- package/shared/definition6.js +1 -1
- package/shared/definition7.js +4 -3
- package/shared/definition9.js +1 -1
- package/shared/form-elements.js +1 -1
- package/shared/patterns/form-elements/form-elements.d.ts +4 -4
- package/shared/text-field.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 -1
- package/tab/index.js +1 -1
- package/tab-panel/index.js +1 -1
- package/tabs/index.js +3 -3
- package/tag/index.js +1 -1
- package/tag-group/index.js +1 -1
- package/text-area/index.js +1 -1
- package/text-field/index.js +1 -1
- package/toggletip/index.js +1 -1
- package/tooltip/index.js +1 -1
- package/tree-item/index.js +1 -1
- package/tree-view/index.js +1 -1
- package/vivid.api.json +139 -741
package/shared/definition37.js
CHANGED
|
@@ -1,94 +1,233 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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';
|
|
5
|
+
import './es.regexp.to-string.js';
|
|
6
|
+
import './es.string.includes.js';
|
|
7
|
+
import { e as elements } from './node-observation.js';
|
|
8
|
+
import { r as ref } from './ref.js';
|
|
9
|
+
import { r as repeat } from './repeat.js';
|
|
10
|
+
import { c as children } from './children.js';
|
|
4
11
|
import { c as classNames } from './class-names.js';
|
|
12
|
+
import { w as when } from './when.js';
|
|
5
13
|
|
|
6
|
-
var css_248z = "/**\n * Do not edit directly\n * Generated on
|
|
14
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Thu, 03 Aug 2023 09:40:18 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}";
|
|
7
15
|
|
|
8
|
-
var
|
|
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;
|
|
9
22
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
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)); }));
|
|
16
31
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
var
|
|
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;
|
|
20
38
|
|
|
21
|
-
var
|
|
22
|
-
var
|
|
39
|
+
var $ = _export;
|
|
40
|
+
var $parseInt = numberParseInt;
|
|
23
41
|
|
|
24
|
-
// `
|
|
25
|
-
// https://tc39.es/ecma262/#sec-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
$({ target: 'Array', proto: true, forced: String(test) === String(test.reverse()) }, {
|
|
29
|
-
reverse: function reverse() {
|
|
30
|
-
// eslint-disable-next-line no-self-assign -- dirty hack
|
|
31
|
-
if (isArray(this)) this.length = this.length;
|
|
32
|
-
return nativeReverse(this);
|
|
33
|
-
}
|
|
42
|
+
// `parseInt` method
|
|
43
|
+
// https://tc39.es/ecma262/#sec-parseint-string-radix
|
|
44
|
+
$({ global: true, forced: parseInt != $parseInt }, {
|
|
45
|
+
parseInt: $parseInt
|
|
34
46
|
});
|
|
35
47
|
|
|
36
|
-
|
|
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 {
|
|
37
54
|
constructor() {
|
|
38
|
-
super(
|
|
39
|
-
this.
|
|
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 '...';
|
|
83
|
+
}
|
|
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 '...';
|
|
87
|
+
}
|
|
88
|
+
if (this.selectedIndex > this.total - 5) {
|
|
89
|
+
if (i > 1) return this.total - (6 - i);
|
|
90
|
+
if (i === 1) return '...';
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return i + 1;
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
totalChanged(_, newValue) {
|
|
97
|
+
if (newValue < 0) {
|
|
98
|
+
this.total = 0;
|
|
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
|
+
});
|
|
40
114
|
}
|
|
41
115
|
}
|
|
42
|
-
__decorate([attr
|
|
43
|
-
__decorate([
|
|
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);
|
|
44
120
|
__decorate([attr({
|
|
121
|
+
attribute: 'nav-icons',
|
|
45
122
|
mode: 'boolean'
|
|
46
|
-
}), __metadata("design:type", Object)],
|
|
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);
|
|
47
134
|
|
|
48
135
|
let _2 = t => t,
|
|
49
136
|
_t,
|
|
50
137
|
_t2,
|
|
51
|
-
_t3
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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';
|
|
68
171
|
}
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
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 => {
|
|
196
|
+
const buttonTag = context.tagFor(Button);
|
|
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);
|
|
84
223
|
};
|
|
85
224
|
|
|
86
|
-
const
|
|
87
|
-
baseName: '
|
|
88
|
-
template:
|
|
225
|
+
const paginationDefinition = Pagination.compose({
|
|
226
|
+
baseName: 'pagination',
|
|
227
|
+
template: PaginationTemplate,
|
|
89
228
|
styles: css_248z
|
|
90
229
|
});
|
|
91
|
-
const
|
|
92
|
-
const
|
|
230
|
+
const paginationRegistries = [paginationDefinition(), buttonRegistries];
|
|
231
|
+
const registerPagination = registerFactory(paginationRegistries);
|
|
93
232
|
|
|
94
|
-
export {
|
|
233
|
+
export { paginationRegistries as a, paginationDefinition as p, registerPagination as r };
|
package/shared/definition38.js
CHANGED
|
@@ -1,46 +1,94 @@
|
|
|
1
|
-
import { h as html, r as registerFactory } from './index.js';
|
|
2
|
-
import {
|
|
3
|
-
import { R as Radio } from './radio.js';
|
|
4
|
-
import { f as focusTemplateFactory } from './focus2.js';
|
|
1
|
+
import { c as classofRaw, G as _export, k as functionUncurryThis, _ as __decorate, a as attr, b as __metadata, h as html, r as registerFactory } from './index.js';
|
|
2
|
+
import { B as BaseProgress } from './base-progress.js';
|
|
5
3
|
import { w as when } from './when.js';
|
|
6
4
|
import { c as classNames } from './class-names.js';
|
|
7
5
|
|
|
8
|
-
var css_248z = "/**\n * Do not edit directly\n * Generated on
|
|
6
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Thu, 03 Aug 2023 09:40:18 GMT\n */\n.base {\n height: 6px;\n align-items: center;\n margin: 0;\n outline: none;\n}\n.base:not(.connotation-pacific).connotation-cta {\n /* @cssprop [--vvd-progress-cta-primary=var(--vvd-color-cta-500)] */\n --_connotation-color-primary: var(--vvd-progress-cta-primary, var(--vvd-color-cta-500));\n /* @cssprop [--vvd-progress-cta-soft=var(--vvd-color-cta-100)] */\n --_connotation-color-soft: var(--vvd-progress-cta-soft, var(--vvd-color-cta-100));\n}\n.base:not(.connotation-pacific).connotation-alert {\n /* @cssprop [--vvd-progress-alert-primary=var(--vvd-color-alert-500)] */\n --_connotation-color-primary: var(--vvd-progress-alert-primary, var(--vvd-color-alert-500));\n /* @cssprop [--vvd-progress-alert-soft=var(--vvd-color-alert-100)] */\n --_connotation-color-soft: var(--vvd-progress-alert-soft, var(--vvd-color-alert-100));\n}\n.base:not(.connotation-pacific).connotation-success {\n /* @cssprop [--vvd-progress-success-primary=var(--vvd-color-success-500)] */\n --_connotation-color-primary: var(--vvd-progress-success-primary, var(--vvd-color-success-500));\n /* @cssprop [--vvd-progress-success-soft=var(--vvd-color-success-100)] */\n --_connotation-color-soft: var(--vvd-progress-success-soft, var(--vvd-color-success-100));\n}\n.base:not(.connotation-pacific):not(.connotation-cta, .connotation-alert, .connotation-success) {\n /* @cssprop [--vvd-progress-accent-primary=var(--vvd-color-canvas-text)] */\n --_connotation-color-primary: var(--vvd-progress-accent-primary, var(--vvd-color-canvas-text));\n /* @cssprop [--vvd-progress-accent-soft=var(--vvd-color-neutral-100)] */\n --_connotation-color-soft: var(--vvd-progress-accent-soft, var(--vvd-color-neutral-100));\n}\n.base:not(.connotation-pacific) {\n --_appearance-color-text: var(--_connotation-color-contrast);\n --_appearance-color-fill: var(--_connotation-color-soft);\n --_appearance-color-outline: transparent;\n}\n.base.connotation-pacific {\n --_connotation-color-primary: linear-gradient(to right, var(--vvd-color-information-200), var(--vvd-color-cta-600));\n}\n\n.progress {\n position: relative;\n display: flex;\n overflow: hidden;\n align-items: center;\n block-size: 100%;\n inline-size: 100%;\n /* Shape */\n}\n.base:not(.connotation-pacific) .progress {\n background-color: var(--_appearance-color-fill);\n}\n.base.connotation-pacific .progress {\n background-color: var(--vvd-color-neutral-100);\n}\n.base:not(.shape-sharp) .progress {\n border-radius: 3px;\n}\n\n.indeterminate {\n display: flex;\n background-color: var(--_connotation-color-primary);\n block-size: 100%;\n border-radius: inherit;\n inline-size: 100%;\n}\n\n.determinate {\n background-color: var(--_connotation-color-primary);\n block-size: 100%;\n border-radius: inherit;\n transition: all 0.2s ease-in-out;\n}\n.connotation-pacific .determinate {\n background-image: var(--_connotation-color-primary);\n}\n.reverse .determinate {\n position: absolute;\n right: 0;\n}\n.paused .determinate {\n background: var(--vvd-color-neutral-300);\n}\n\n.indicator-1 {\n animation: indeterminate-1 2s infinite;\n inline-size: 30%;\n}\n\n.indicator-2 {\n animation: indeterminate-2 2s infinite;\n inline-size: 60%;\n}\n\n.indicator-1,\n.indicator-2 {\n position: absolute;\n animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1);\n background-color: var(--vvd-color-neutral-100);\n block-size: 100%;\n opacity: 0;\n}\n.connotation-pacific .indicator-1,\n.connotation-pacific .indicator-2 {\n background-image: var(--_connotation-color-primary);\n}\n.paused .indicator-1,\n.paused .indicator-2 {\n animation-play-state: paused;\n background-color: var(--_connotation-color-primary);\n}\n.reverse .indicator-1,\n.reverse .indicator-2 {\n animation-direction: reverse;\n}\n\n@keyframes indeterminate-1 {\n 0% {\n opacity: 1;\n transform: translateX(-100%);\n }\n 70% {\n opacity: 1;\n transform: translateX(300%);\n }\n 70.01% {\n opacity: 0;\n }\n 100% {\n opacity: 0;\n transform: translateX(300%);\n }\n}\n@keyframes indeterminate-2 {\n 0% {\n opacity: 0;\n transform: translateX(-150%);\n }\n 29.99% {\n opacity: 0;\n }\n 30% {\n opacity: 1;\n transform: translateX(-150%);\n }\n 100% {\n opacity: 1;\n transform: translateX(166.66%);\n }\n}";
|
|
9
7
|
|
|
10
|
-
|
|
8
|
+
var classof = classofRaw;
|
|
9
|
+
|
|
10
|
+
// `IsArray` abstract operation
|
|
11
|
+
// https://tc39.es/ecma262/#sec-isarray
|
|
12
|
+
// eslint-disable-next-line es/no-array-isarray -- safe
|
|
13
|
+
var isArray$1 = Array.isArray || function isArray(argument) {
|
|
14
|
+
return classof(argument) == 'Array';
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
var $ = _export;
|
|
18
|
+
var uncurryThis = functionUncurryThis;
|
|
19
|
+
var isArray = isArray$1;
|
|
20
|
+
|
|
21
|
+
var nativeReverse = uncurryThis([].reverse);
|
|
22
|
+
var test = [1, 2];
|
|
23
|
+
|
|
24
|
+
// `Array.prototype.reverse` method
|
|
25
|
+
// https://tc39.es/ecma262/#sec-array.prototype.reverse
|
|
26
|
+
// fix for Safari 12.0 bug
|
|
27
|
+
// https://bugs.webkit.org/show_bug.cgi?id=188794
|
|
28
|
+
$({ target: 'Array', proto: true, forced: String(test) === String(test.reverse()) }, {
|
|
29
|
+
reverse: function reverse() {
|
|
30
|
+
// eslint-disable-next-line no-self-assign -- dirty hack
|
|
31
|
+
if (isArray(this)) this.length = this.length;
|
|
32
|
+
return nativeReverse(this);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
class Progress extends BaseProgress {
|
|
37
|
+
constructor() {
|
|
38
|
+
super(...arguments);
|
|
39
|
+
this.reverse = false;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
__decorate([attr(), __metadata("design:type", String)], Progress.prototype, "shape", void 0);
|
|
43
|
+
__decorate([attr(), __metadata("design:type", String)], Progress.prototype, "connotation", void 0);
|
|
44
|
+
__decorate([attr({
|
|
45
|
+
mode: 'boolean'
|
|
46
|
+
}), __metadata("design:type", Object)], Progress.prototype, "reverse", void 0);
|
|
47
|
+
|
|
48
|
+
let _2 = t => t,
|
|
11
49
|
_t,
|
|
12
|
-
_t2
|
|
50
|
+
_t2,
|
|
51
|
+
_t3;
|
|
13
52
|
const getClasses = ({
|
|
14
53
|
connotation,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}) => classNames('base', [`connotation-${connotation}`, Boolean(connotation)], [
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
54
|
+
shape,
|
|
55
|
+
reverse,
|
|
56
|
+
paused
|
|
57
|
+
}) => classNames('base', [`connotation-${connotation}`, Boolean(connotation)], [`shape-${shape}`, Boolean(shape)], ['reverse', Boolean(reverse)], ['paused', Boolean(paused)]);
|
|
58
|
+
function determinate() {
|
|
59
|
+
return html(_t || (_t = _2`
|
|
60
|
+
<span class="determinate" style="width: ${0}%"></span>`), x => x.percentComplete);
|
|
61
|
+
}
|
|
62
|
+
function indeterminate() {
|
|
63
|
+
return html(_t2 || (_t2 = _2`
|
|
64
|
+
<span class="indeterminate" name="indeterminate">
|
|
65
|
+
<span class="indicator-1"></span>
|
|
66
|
+
<span class="indicator-2"></span>
|
|
67
|
+
</span>`));
|
|
68
|
+
}
|
|
69
|
+
const ProgressTemplate = _ => {
|
|
70
|
+
return html(_t3 || (_t3 = _2`
|
|
71
|
+
<div
|
|
72
|
+
role="progressbar"
|
|
73
|
+
aria-valuenow="${0}"
|
|
74
|
+
aria-valuemin="${0}"
|
|
75
|
+
aria-valuemax="${0}"
|
|
76
|
+
class="${0}"
|
|
77
|
+
>
|
|
78
|
+
<div class="progress">
|
|
79
|
+
${0}
|
|
80
|
+
${0}
|
|
81
|
+
</div>
|
|
34
82
|
</div>
|
|
35
|
-
|
|
83
|
+
`), x => x.value, x => x.min, x => x.max, getClasses, when(x => typeof x.value === 'number', determinate()), when(x => typeof x.value !== 'number', indeterminate()));
|
|
36
84
|
};
|
|
37
85
|
|
|
38
|
-
const
|
|
39
|
-
baseName: '
|
|
40
|
-
template:
|
|
86
|
+
const progressDefinition = Progress.compose({
|
|
87
|
+
baseName: 'progress',
|
|
88
|
+
template: ProgressTemplate,
|
|
41
89
|
styles: css_248z
|
|
42
90
|
});
|
|
43
|
-
const
|
|
44
|
-
const
|
|
91
|
+
const progressRegistries = [progressDefinition()];
|
|
92
|
+
const registerProgress = registerFactory(progressRegistries);
|
|
45
93
|
|
|
46
|
-
export {
|
|
94
|
+
export { progressRegistries as a, progressDefinition as p, registerProgress as r };
|