@vonage/vivid 3.27.0 → 3.28.2
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 -1
- package/accordion/index.js +0 -2
- package/accordion-item/index.js +0 -2
- package/alert/index.js +0 -2
- package/avatar/index.js +0 -2
- package/badge/index.js +0 -2
- package/banner/index.js +0 -2
- package/breadcrumb-item/index.js +0 -2
- package/button/index.js +0 -2
- package/calendar/index.js +0 -1
- package/calendar-event/index.js +0 -2
- package/card/index.js +0 -2
- package/checkbox/index.js +0 -2
- package/combobox/index.js +0 -3
- package/custom-elements.json +142 -53
- package/data-grid/index.js +1 -5
- package/dialog/index.js +0 -2
- package/empty-state/index.js +0 -2
- package/fab/index.js +0 -2
- package/file-picker/index.js +0 -2
- package/icon/index.js +0 -2
- package/index.d.ts +3 -3
- package/index.js +1 -6
- package/lib/accordion/accordion.d.ts +5 -5
- package/lib/accordion/accordion.template.d.ts +3 -3
- package/lib/accordion/definition.d.ts +2 -2
- package/lib/accordion/index.d.ts +1 -1
- package/lib/accordion-item/accordion-item.d.ts +12 -12
- package/lib/accordion-item/accordion-item.template.d.ts +4 -4
- package/lib/accordion-item/definition.d.ts +1 -1
- package/lib/accordion-item/index.d.ts +1 -1
- package/lib/action-group/action-group.d.ts +11 -11
- package/lib/action-group/action-group.template.d.ts +4 -4
- package/lib/action-group/definition.d.ts +2 -2
- package/lib/action-group/index.d.ts +1 -1
- package/lib/alert/alert.d.ts +22 -22
- package/lib/alert/alert.template.d.ts +4 -4
- package/lib/alert/definition.d.ts +2 -2
- package/lib/alert/index.d.ts +1 -1
- package/lib/avatar/avatar.d.ts +14 -14
- package/lib/avatar/avatar.template.d.ts +4 -4
- package/lib/avatar/definition.d.ts +2 -2
- package/lib/avatar/index.d.ts +1 -1
- package/lib/badge/badge.d.ts +14 -14
- package/lib/badge/badge.template.d.ts +4 -4
- package/lib/badge/definition.d.ts +4 -4
- package/lib/badge/index.d.ts +1 -1
- package/lib/banner/banner.d.ts +20 -20
- package/lib/banner/banner.template.d.ts +4 -4
- package/lib/banner/definition.d.ts +2 -2
- package/lib/banner/index.d.ts +1 -1
- package/lib/breadcrumb/breadcrumb.d.ts +3 -3
- package/lib/breadcrumb/breadcrumb.template.d.ts +4 -4
- package/lib/breadcrumb/definition.d.ts +1 -1
- package/lib/breadcrumb/index.d.ts +1 -1
- package/lib/breadcrumb-item/breadcrumb-item.d.ts +5 -5
- package/lib/breadcrumb-item/breadcrumb-item.template.d.ts +4 -4
- package/lib/breadcrumb-item/definition.d.ts +1 -1
- package/lib/breadcrumb-item/index.d.ts +1 -1
- package/lib/button/button.d.ts +18 -18
- package/lib/button/button.template.d.ts +4 -4
- package/lib/button/definition.d.ts +2 -2
- package/lib/button/index.d.ts +1 -1
- package/lib/calendar/calendar.d.ts +13 -13
- package/lib/calendar/calendar.template.d.ts +4 -4
- package/lib/calendar/definition.d.ts +1 -1
- package/lib/calendar/helpers/calendar.date-functions.d.ts +2 -2
- package/lib/calendar/helpers/calendar.event-context.d.ts +6 -6
- package/lib/calendar/helpers/calendar.keyboard-interactions.d.ts +9 -9
- package/lib/calendar/index.d.ts +1 -1
- package/lib/calendar-event/calendar-event.d.ts +13 -13
- package/lib/calendar-event/calendar-event.template.d.ts +4 -4
- package/lib/calendar-event/definition.d.ts +2 -2
- package/lib/calendar-event/index.d.ts +1 -1
- package/lib/card/card.d.ts +10 -10
- package/lib/card/card.template.d.ts +4 -4
- package/lib/card/definition.d.ts +1 -1
- package/lib/card/index.d.ts +1 -1
- package/lib/checkbox/checkbox.d.ts +10 -11
- package/lib/checkbox/checkbox.template.d.ts +4 -4
- package/lib/checkbox/definition.d.ts +1 -1
- package/lib/checkbox/index.d.ts +1 -1
- package/lib/combobox/combobox.d.ts +12 -13
- package/lib/combobox/combobox.template.d.ts +4 -4
- package/lib/combobox/definition.d.ts +3 -4
- package/lib/combobox/index.d.ts +1 -1
- package/lib/components.d.ts +52 -52
- package/lib/data-grid/data-grid-cell.d.ts +22 -22
- package/lib/data-grid/data-grid-cell.template.d.ts +4 -4
- package/lib/data-grid/data-grid-row.d.ts +4 -4
- package/lib/data-grid/data-grid-row.template.d.ts +3 -3
- package/lib/data-grid/data-grid.d.ts +20 -20
- package/lib/data-grid/data-grid.options.d.ts +38 -38
- package/lib/data-grid/data-grid.template.d.ts +3 -3
- package/lib/data-grid/definition.d.ts +6 -6
- package/lib/data-grid/index.d.ts +1 -1
- package/lib/dialog/definition.d.ts +2 -2
- package/lib/dialog/dialog.d.ts +26 -26
- package/lib/dialog/dialog.template.d.ts +4 -4
- package/lib/dialog/index.d.ts +1 -1
- package/lib/divider/definition.d.ts +1 -1
- package/lib/divider/divider.d.ts +3 -3
- package/lib/divider/divider.template.d.ts +4 -4
- package/lib/divider/index.d.ts +1 -1
- package/lib/elevation/definition.d.ts +1 -1
- package/lib/elevation/elevation.d.ts +5 -5
- package/lib/elevation/elevation.template.d.ts +4 -4
- package/lib/elevation/index.d.ts +1 -1
- package/lib/empty-state/definition.d.ts +3 -3
- package/lib/empty-state/empty-state.d.ts +5 -5
- package/lib/empty-state/empty-state.template.d.ts +4 -4
- package/lib/empty-state/index.d.ts +1 -1
- package/lib/enums.d.ts +60 -60
- package/lib/fab/definition.d.ts +4 -4
- package/lib/fab/fab.d.ts +12 -12
- package/lib/fab/fab.template.d.ts +4 -4
- package/lib/fab/index.d.ts +1 -1
- package/lib/file-picker/definition.d.ts +3 -3
- package/lib/file-picker/file-picker.d.ts +22 -22
- package/lib/file-picker/file-picker.template.d.ts +4 -4
- package/lib/file-picker/index.d.ts +1 -1
- package/lib/focus/definition.d.ts +3 -3
- package/lib/focus/focus.d.ts +3 -3
- package/lib/focus/focus.template.d.ts +4 -4
- package/lib/focus/index.d.ts +1 -1
- package/lib/header/definition.d.ts +3 -3
- package/lib/header/header.d.ts +5 -5
- package/lib/header/header.template.d.ts +4 -4
- package/lib/header/index.d.ts +1 -1
- package/lib/icon/definition.d.ts +4 -4
- package/lib/icon/icon.d.ts +12 -12
- package/lib/icon/icon.placeholder.d.ts +1 -1
- package/lib/icon/icon.template.d.ts +4 -4
- package/lib/icon/index.d.ts +1 -1
- package/lib/layout/definition.d.ts +4 -4
- package/lib/layout/index.d.ts +1 -1
- package/lib/layout/layout.d.ts +17 -17
- package/lib/layout/layout.template.d.ts +4 -4
- package/lib/listbox/definition.d.ts +4 -4
- package/lib/listbox/index.d.ts +1 -1
- package/lib/listbox/listbox.d.ts +6 -6
- package/lib/listbox/listbox.template.d.ts +4 -4
- package/lib/menu/definition.d.ts +12 -12
- package/lib/menu/index.d.ts +1 -1
- package/lib/menu/menu.d.ts +16 -15
- package/lib/menu/menu.template.d.ts +3 -3
- package/lib/menu-item/definition.d.ts +3 -3
- package/lib/menu-item/index.d.ts +1 -1
- package/lib/menu-item/menu-item.d.ts +14 -14
- package/lib/menu-item/menu-item.template.d.ts +4 -4
- package/lib/nav/definition.d.ts +3 -3
- package/lib/nav/index.d.ts +1 -1
- package/lib/nav/nav.d.ts +3 -3
- package/lib/nav/nav.template.d.ts +4 -4
- package/lib/nav-disclosure/definition.d.ts +3 -3
- package/lib/nav-disclosure/index.d.ts +1 -1
- package/lib/nav-disclosure/nav-disclosure.d.ts +10 -10
- package/lib/nav-disclosure/nav-disclosure.template.d.ts +4 -4
- package/lib/nav-item/definition.d.ts +3 -3
- package/lib/nav-item/index.d.ts +1 -1
- package/lib/nav-item/nav-item.d.ts +7 -7
- package/lib/nav-item/nav-item.template.d.ts +4 -4
- package/lib/note/definition.d.ts +4 -4
- package/lib/note/index.d.ts +1 -1
- package/lib/note/note.d.ts +10 -10
- package/lib/note/note.template.d.ts +4 -4
- package/lib/number-field/definition.d.ts +5 -5
- package/lib/number-field/index.d.ts +1 -1
- package/lib/number-field/number-field.d.ts +13 -13
- package/lib/number-field/number-field.template.d.ts +4 -4
- package/lib/option/definition.d.ts +3 -3
- package/lib/option/index.d.ts +1 -1
- package/lib/option/option.d.ts +12 -12
- package/lib/option/option.template.d.ts +4 -4
- package/lib/pagination/definition.d.ts +3 -3
- package/lib/pagination/index.d.ts +1 -1
- package/lib/pagination/pagination.d.ts +18 -18
- package/lib/pagination/pagination.template.d.ts +4 -4
- package/lib/popup/definition.d.ts +5 -5
- package/lib/popup/index.d.ts +1 -1
- package/lib/popup/popup.d.ts +21 -21
- package/lib/popup/popup.template.d.ts +4 -4
- package/lib/progress/definition.d.ts +4 -4
- package/lib/progress/index.d.ts +1 -1
- package/lib/progress/progress.d.ts +9 -9
- package/lib/progress/progress.template.d.ts +5 -5
- package/lib/progress-ring/definition.d.ts +4 -4
- package/lib/progress-ring/index.d.ts +1 -1
- package/lib/progress-ring/progress-ring.d.ts +7 -7
- package/lib/progress-ring/progress-ring.template.d.ts +4 -4
- package/lib/radio/definition.d.ts +3 -3
- package/lib/radio/index.d.ts +1 -1
- package/lib/radio/radio.d.ts +7 -7
- package/lib/radio/radio.template.d.ts +4 -4
- package/lib/radio-group/definition.d.ts +11 -11
- package/lib/radio-group/index.d.ts +1 -1
- package/lib/radio-group/radio-group.d.ts +4 -4
- package/lib/radio-group/radio-group.template.d.ts +4 -4
- package/lib/select/definition.d.ts +4 -4
- package/lib/select/index.d.ts +1 -1
- package/lib/select/select.d.ts +17 -18
- package/lib/select/select.template.d.ts +4 -4
- package/lib/side-drawer/definition.d.ts +3 -3
- package/lib/side-drawer/index.d.ts +1 -1
- package/lib/side-drawer/side-drawer.d.ts +9 -9
- package/lib/side-drawer/side-drawer.template.d.ts +4 -4
- package/lib/slider/definition.d.ts +3 -3
- package/lib/slider/index.d.ts +1 -1
- package/lib/slider/slider.d.ts +4 -4
- package/lib/slider/slider.template.d.ts +4 -4
- package/lib/switch/definition.d.ts +4 -4
- package/lib/switch/index.d.ts +1 -1
- package/lib/switch/switch.d.ts +7 -7
- package/lib/switch/switch.template.d.ts +4 -4
- package/lib/tab/definition.d.ts +4 -4
- package/lib/tab/index.d.ts +1 -1
- package/lib/tab/tab.d.ts +14 -14
- package/lib/tab/tab.template.d.ts +3 -3
- package/lib/tab-panel/definition.d.ts +3 -3
- package/lib/tab-panel/index.d.ts +1 -1
- package/lib/tab-panel/tab-panel.d.ts +3 -3
- package/lib/tab-panel/tab-panel.template.d.ts +2 -2
- package/lib/tabs/definition.d.ts +3 -3
- package/lib/tabs/index.d.ts +1 -1
- package/lib/tabs/tabs.d.ts +15 -15
- package/lib/tabs/tabs.template.d.ts +2 -2
- package/lib/tag/definition.d.ts +4 -4
- package/lib/tag/index.d.ts +1 -1
- package/lib/tag/tag.d.ts +22 -22
- package/lib/tag/tag.template.d.ts +4 -4
- package/lib/tag-group/definition.d.ts +3 -3
- package/lib/tag-group/index.d.ts +1 -1
- package/lib/tag-group/tag-group.d.ts +3 -3
- package/lib/tag-group/tag-group.template.d.ts +4 -4
- package/lib/text-anchor/definition.d.ts +3 -3
- package/lib/text-anchor/index.d.ts +1 -1
- package/lib/text-anchor/text-anchor.d.ts +7 -7
- package/lib/text-anchor/text-anchor.template.d.ts +4 -4
- package/lib/text-area/definition.d.ts +4 -4
- package/lib/text-area/index.d.ts +1 -1
- package/lib/text-area/text-area.d.ts +8 -9
- package/lib/text-area/text-area.template.d.ts +4 -4
- package/lib/text-field/definition.d.ts +4 -4
- package/lib/text-field/index.d.ts +1 -1
- package/lib/text-field/text-field.d.ts +13 -14
- package/lib/text-field/text-field.template.d.ts +4 -4
- package/lib/toggletip/definition.d.ts +3 -3
- package/lib/toggletip/index.d.ts +1 -1
- package/lib/toggletip/toggletip.d.ts +15 -15
- package/lib/toggletip/toggletip.template.d.ts +4 -4
- package/lib/tooltip/definition.d.ts +3 -3
- package/lib/tooltip/index.d.ts +1 -1
- package/lib/tooltip/tooltip.d.ts +14 -14
- package/lib/tooltip/tooltip.template.d.ts +4 -4
- package/lib/tree-item/definition.d.ts +3 -3
- package/lib/tree-item/index.d.ts +1 -1
- package/lib/tree-item/tree-item.d.ts +7 -7
- package/lib/tree-item/tree-item.template.d.ts +4 -4
- package/lib/tree-view/definition.d.ts +3 -3
- package/lib/tree-view/index.d.ts +1 -1
- package/lib/tree-view/tree-view.d.ts +3 -3
- package/lib/tree-view/tree-view.template.d.ts +2 -2
- package/listbox/index.js +17 -21
- package/menu/index.js +0 -3
- package/menu-item/index.js +0 -3
- package/nav-disclosure/index.js +0 -2
- package/nav-item/index.js +0 -2
- package/note/index.js +0 -2
- package/number-field/index.js +0 -3
- package/option/index.js +0 -2
- package/package.json +9 -8
- package/pagination/index.js +1 -5
- package/popup/index.js +0 -3
- package/radio-group/index.js +2 -2
- package/select/index.js +0 -3
- package/shared/affix.js +2 -5
- package/shared/anchor.js +2 -1
- package/shared/apply-mixins.js +1 -1
- package/shared/definition.js +7 -9
- package/shared/definition10.js +13 -17
- package/shared/definition11.js +6 -9
- package/shared/definition12.js +16 -18
- package/shared/definition13.js +6 -8
- package/shared/definition14.js +7 -12
- package/shared/definition15.js +43 -52
- package/shared/definition16.js +8 -71
- package/shared/definition17.js +36 -45
- package/shared/definition18.js +19 -24
- package/shared/definition19.js +45 -49
- package/shared/definition2.js +24 -28
- package/shared/definition20.js +389 -280
- package/shared/definition21.js +12 -16
- package/shared/definition22.js +82 -168
- package/shared/definition23.js +35 -41
- package/shared/definition24.js +6 -8
- package/shared/definition25.js +10 -14
- package/shared/definition26.js +40 -42
- package/shared/definition27.js +24 -27
- package/shared/definition28.js +6 -8
- package/shared/definition29.js +3 -5
- package/shared/definition3.js +5 -9
- package/shared/definition30.js +83 -45
- package/shared/definition31.js +33 -43
- package/shared/definition32.js +2 -4
- package/shared/definition33.js +11 -15
- package/shared/definition34.js +5 -9
- package/shared/definition35.js +7 -11
- package/shared/definition36.js +66 -71
- package/shared/definition37.js +60 -101
- package/shared/definition38.js +14 -46
- package/shared/definition39.js +11 -14
- package/shared/definition4.js +3 -5
- package/shared/definition40.js +17 -20
- package/shared/definition41.js +56 -62
- package/shared/definition42.js +8 -11
- package/shared/definition43.js +20 -58
- package/shared/definition44.js +14 -17
- package/shared/definition45.js +8 -10
- package/shared/definition46.js +2 -4
- package/shared/definition47.js +12 -15
- package/shared/definition48.js +19 -24
- package/shared/definition49.js +3 -5
- package/shared/definition5.js +7 -8
- package/shared/definition50.js +51 -55
- package/shared/definition51.js +56 -60
- package/shared/definition52.js +12 -520
- package/shared/definition53.js +9 -11
- package/shared/definition54.js +27 -31
- package/shared/definition55.js +12 -14
- package/shared/definition6.js +17 -23
- package/shared/definition7.js +43 -47
- package/shared/definition8.js +3 -5
- package/shared/definition9.js +13 -17
- package/shared/design-system/index.d.ts +3 -3
- package/shared/focus2.js +1 -3
- package/shared/form-associated.js +1 -1
- package/shared/form-elements.js +16 -20
- package/shared/icon.js +2 -1171
- package/shared/index.js +41 -1549
- package/shared/listbox.js +1 -1
- package/shared/patterns/affix.d.ts +9 -9
- package/shared/patterns/focus.d.ts +3 -3
- package/shared/patterns/form-elements/form-elements.d.ts +57 -57
- package/shared/patterns/form-elements/index.d.ts +1 -1
- package/shared/patterns/index.d.ts +3 -3
- package/shared/repeat.js +1 -1
- package/shared/text-anchor.template.js +38 -40
- package/shared/text-field.js +1 -1
- package/shared/text-field2.js +1 -1
- package/shared/when.js +19 -5
- package/slider/index.js +0 -3
- 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 +17 -17
- package/styles/tokens/theme-light.css +17 -17
- package/switch/index.js +0 -2
- package/tab/index.js +0 -2
- package/tabs/index.js +0 -2
- package/tag/index.js +0 -2
- package/text-anchor/index.js +0 -2
- package/text-area/index.js +0 -2
- package/text-field/index.js +0 -2
- package/toggletip/index.js +0 -4
- package/tooltip/index.js +0 -3
- package/tree-item/index.js +1 -3
- package/vivid.api.json +48 -84
- package/shared/es.object.assign.js +0 -68
- package/shared/es.regexp.to-string.js +0 -61
- package/shared/es.string.includes.js +0 -83
- package/shared/string-trim.js +0 -40
- package/shared/to-string.js +0 -51
package/shared/definition37.js
CHANGED
|
@@ -1,49 +1,13 @@
|
|
|
1
1
|
import { a as Size, B as Button, b as buttonRegistries } from './definition7.js';
|
|
2
|
-
import {
|
|
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';
|
|
2
|
+
import { F as FoundationElement, _ as __decorate, a as attr, b as __metadata, o as observable, v as volatile, h as html, r as registerFactory } from './index.js';
|
|
7
3
|
import { e as elements } from './node-observation.js';
|
|
8
4
|
import { r as ref } from './ref.js';
|
|
9
|
-
import { r as repeat } from './repeat.js';
|
|
10
5
|
import { c as children } from './children.js';
|
|
6
|
+
import { r as repeat } from './repeat.js';
|
|
11
7
|
import { c as classNames } from './class-names.js';
|
|
12
8
|
import { w as when } from './when.js';
|
|
13
9
|
|
|
14
|
-
var css_248z = "/**\n * Do not edit directly\n * Generated on
|
|
15
|
-
|
|
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
|
-
});
|
|
10
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Mon, 07 Aug 2023 18:00:27 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}";
|
|
47
11
|
|
|
48
12
|
const MAX_DIGITS_AND_PLACEHOLDERS = 7;
|
|
49
13
|
const totalConverter = {
|
|
@@ -51,6 +15,26 @@ const totalConverter = {
|
|
|
51
15
|
toView: value => value.toString()
|
|
52
16
|
};
|
|
53
17
|
class Pagination extends FoundationElement {
|
|
18
|
+
get pagesList() {
|
|
19
|
+
return new Array(this.total < MAX_DIGITS_AND_PLACEHOLDERS ? this.total : MAX_DIGITS_AND_PLACEHOLDERS).fill(0).map((_, i, arr) => {
|
|
20
|
+
if (i === 0) return 1;
|
|
21
|
+
if (i === arr.length - 1) return this.total;
|
|
22
|
+
if (this.selectedIndex !== undefined && this.total > MAX_DIGITS_AND_PLACEHOLDERS) {
|
|
23
|
+
if (this.selectedIndex < 4) {
|
|
24
|
+
if (i === MAX_DIGITS_AND_PLACEHOLDERS - 2) return '...';
|
|
25
|
+
}
|
|
26
|
+
if (this.selectedIndex >= 4 && this.selectedIndex <= this.total - 5) {
|
|
27
|
+
if (i > 1 && i < MAX_DIGITS_AND_PLACEHOLDERS - 2) return this.selectedIndex + (i - 2);
|
|
28
|
+
if (i === 1 || i === MAX_DIGITS_AND_PLACEHOLDERS - 2) return '...';
|
|
29
|
+
}
|
|
30
|
+
if (this.selectedIndex > this.total - 5) {
|
|
31
|
+
if (i > 1) return this.total - (6 - i);
|
|
32
|
+
if (i === 1) return '...';
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return i + 1;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
54
38
|
constructor() {
|
|
55
39
|
super();
|
|
56
40
|
this.navIcons = false;
|
|
@@ -73,26 +57,6 @@ class Pagination extends FoundationElement {
|
|
|
73
57
|
this.paginationButtons && this.paginationButtons[index + focusDirection].focus();
|
|
74
58
|
});
|
|
75
59
|
}
|
|
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
60
|
totalChanged(_, newValue) {
|
|
97
61
|
if (newValue < 0) {
|
|
98
62
|
this.total = 0;
|
|
@@ -132,11 +96,6 @@ __decorate([attr({
|
|
|
132
96
|
attribute: 'selected-index'
|
|
133
97
|
}), __metadata("design:type", Object)], Pagination.prototype, "selectedIndex", void 0);
|
|
134
98
|
|
|
135
|
-
let _2 = t => t,
|
|
136
|
-
_t,
|
|
137
|
-
_t2,
|
|
138
|
-
_t3,
|
|
139
|
-
_t4;
|
|
140
99
|
const ALLOWED_SIZES = [Size.SuperCondensed, Size.Condensed, Size.Normal];
|
|
141
100
|
const handleSelection = (value, {
|
|
142
101
|
parent: x
|
|
@@ -169,23 +128,23 @@ function getButtonAppearance(value, {
|
|
|
169
128
|
}) {
|
|
170
129
|
return parent.selectedIndex === Number(value) - 1 ? 'filled' : 'ghost';
|
|
171
130
|
}
|
|
172
|
-
const paginationButtonRenderer = buttonTag => html
|
|
173
|
-
${
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
size="${0}"
|
|
179
|
-
tabindex="0"
|
|
180
|
-
aria-pressed="${0}"
|
|
181
|
-
@click="${0}"
|
|
182
|
-
@keydown="${0}"
|
|
183
|
-
</${0}>
|
|
184
|
-
`), buttonTag, value => value, getButtonAppearance, (_, {
|
|
131
|
+
const paginationButtonRenderer = buttonTag => html`
|
|
132
|
+
${when(value => value !== '...', html`
|
|
133
|
+
<${buttonTag} class="vwc-pagination-button"
|
|
134
|
+
label="${value => value}"
|
|
135
|
+
appearance="${getButtonAppearance}"
|
|
136
|
+
size="${(_, {
|
|
185
137
|
parent: x
|
|
186
|
-
}) => getPaginationSize(x)
|
|
138
|
+
}) => getPaginationSize(x)}"
|
|
139
|
+
tabindex="0"
|
|
140
|
+
aria-pressed="${(value, {
|
|
187
141
|
parent
|
|
188
|
-
}) => parent.selectedIndex === Number(value) - 1
|
|
142
|
+
}) => parent.selectedIndex === Number(value) - 1}"
|
|
143
|
+
@click="${handleSelection}"
|
|
144
|
+
@keydown="${handleKeyDown}"
|
|
145
|
+
</${buttonTag}>
|
|
146
|
+
`)}
|
|
147
|
+
${when(value => value === '...', html`<div class="dots size-${getPaginationSize}">...</div>`)}`;
|
|
189
148
|
const getPaginationSize = x => {
|
|
190
149
|
if (!x.size || !ALLOWED_SIZES.includes(x.size)) {
|
|
191
150
|
return Size.SuperCondensed;
|
|
@@ -195,31 +154,31 @@ const getPaginationSize = x => {
|
|
|
195
154
|
const PaginationTemplate = context => {
|
|
196
155
|
const buttonTag = context.tagFor(Button);
|
|
197
156
|
const paginationButtonTemplate = paginationButtonRenderer(buttonTag);
|
|
198
|
-
return html
|
|
199
|
-
<div class="${
|
|
200
|
-
<${
|
|
201
|
-
label="${
|
|
202
|
-
icon="${
|
|
203
|
-
size="${
|
|
204
|
-
?disabled="${0}"
|
|
205
|
-
@click="${
|
|
206
|
-
></${
|
|
207
|
-
<div id="buttons-wrapper" class="buttons-wrapper" ${
|
|
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({
|
|
157
|
+
return html`
|
|
158
|
+
<div class="${getClasses}">
|
|
159
|
+
<${buttonTag} class="prev-button" ${ref('prevButton')}
|
|
160
|
+
label="${x => !x.navIcons ? 'Previous' : null}"
|
|
161
|
+
icon="${x => x.navIcons ? 'chevron-left-line' : null}"
|
|
162
|
+
size="${getPaginationSize}"
|
|
163
|
+
?disabled="${x => x.total === 0 || x.selectedIndex === 0}"
|
|
164
|
+
@click="${x => x.selectedIndex !== undefined && x.selectedIndex--}"
|
|
165
|
+
></${buttonTag}>
|
|
166
|
+
<div id="buttons-wrapper" class="buttons-wrapper" ${children({
|
|
218
167
|
property: 'paginationButtons',
|
|
219
168
|
filter: elements(buttonTag)
|
|
220
|
-
})
|
|
169
|
+
})}>
|
|
170
|
+
${repeat(x => x.pagesList, paginationButtonTemplate, {
|
|
221
171
|
positioning: true
|
|
222
|
-
})
|
|
172
|
+
})}
|
|
173
|
+
</div>
|
|
174
|
+
<${buttonTag} class="next-button" ${ref('nextButton')}
|
|
175
|
+
label="${x => !x.navIcons ? 'Next' : null}"
|
|
176
|
+
icon="${x => x.navIcons ? 'chevron-right-line' : null}"
|
|
177
|
+
size="${getPaginationSize}"
|
|
178
|
+
?disabled="${x => x.total === 0 || x.selectedIndex === x.total - 1}"
|
|
179
|
+
@click="${x => x.selectedIndex !== undefined && x.selectedIndex++}"
|
|
180
|
+
></${buttonTag}>
|
|
181
|
+
</div>`;
|
|
223
182
|
};
|
|
224
183
|
|
|
225
184
|
const paginationDefinition = Pagination.compose({
|
package/shared/definition38.js
CHANGED
|
@@ -1,37 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { _ as __decorate, a as attr, b as __metadata, h as html, r as registerFactory } from './index.js';
|
|
2
2
|
import { B as BaseProgress } from './base-progress.js';
|
|
3
3
|
import { w as when } from './when.js';
|
|
4
4
|
import { c as classNames } from './class-names.js';
|
|
5
5
|
|
|
6
|
-
var css_248z = "/**\n * Do not edit directly\n * Generated on
|
|
7
|
-
|
|
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
|
-
});
|
|
6
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Mon, 07 Aug 2023 18:00:27 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}";
|
|
35
7
|
|
|
36
8
|
class Progress extends BaseProgress {
|
|
37
9
|
constructor() {
|
|
@@ -45,10 +17,6 @@ __decorate([attr({
|
|
|
45
17
|
mode: 'boolean'
|
|
46
18
|
}), __metadata("design:type", Object)], Progress.prototype, "reverse", void 0);
|
|
47
19
|
|
|
48
|
-
let _2 = t => t,
|
|
49
|
-
_t,
|
|
50
|
-
_t2,
|
|
51
|
-
_t3;
|
|
52
20
|
const getClasses = ({
|
|
53
21
|
connotation,
|
|
54
22
|
shape,
|
|
@@ -56,31 +24,31 @@ const getClasses = ({
|
|
|
56
24
|
paused
|
|
57
25
|
}) => classNames('base', [`connotation-${connotation}`, Boolean(connotation)], [`shape-${shape}`, Boolean(shape)], ['reverse', Boolean(reverse)], ['paused', Boolean(paused)]);
|
|
58
26
|
function determinate() {
|
|
59
|
-
return html
|
|
60
|
-
<span class="determinate" style="width: ${
|
|
27
|
+
return html`
|
|
28
|
+
<span class="determinate" style="width: ${x => x.percentComplete}%"></span>`;
|
|
61
29
|
}
|
|
62
30
|
function indeterminate() {
|
|
63
|
-
return html
|
|
31
|
+
return html`
|
|
64
32
|
<span class="indeterminate" name="indeterminate">
|
|
65
33
|
<span class="indicator-1"></span>
|
|
66
34
|
<span class="indicator-2"></span>
|
|
67
|
-
</span
|
|
35
|
+
</span>`;
|
|
68
36
|
}
|
|
69
37
|
const ProgressTemplate = _ => {
|
|
70
|
-
return html
|
|
38
|
+
return html`
|
|
71
39
|
<div
|
|
72
40
|
role="progressbar"
|
|
73
|
-
aria-valuenow="${
|
|
74
|
-
aria-valuemin="${
|
|
75
|
-
aria-valuemax="${
|
|
76
|
-
class="${
|
|
41
|
+
aria-valuenow="${x => x.value}"
|
|
42
|
+
aria-valuemin="${x => x.min}"
|
|
43
|
+
aria-valuemax="${x => x.max}"
|
|
44
|
+
class="${getClasses}"
|
|
77
45
|
>
|
|
78
46
|
<div class="progress">
|
|
79
|
-
${
|
|
80
|
-
${
|
|
47
|
+
${when(x => typeof x.value === 'number', determinate())}
|
|
48
|
+
${when(x => typeof x.value !== 'number', indeterminate())}
|
|
81
49
|
</div>
|
|
82
50
|
</div>
|
|
83
|
-
|
|
51
|
+
`;
|
|
84
52
|
};
|
|
85
53
|
|
|
86
54
|
const progressDefinition = Progress.compose({
|
package/shared/definition39.js
CHANGED
|
@@ -5,11 +5,8 @@ import { f as focusTemplateFactory } from './focus2.js';
|
|
|
5
5
|
import { w as when } from './when.js';
|
|
6
6
|
import { c as classNames } from './class-names.js';
|
|
7
7
|
|
|
8
|
-
var css_248z = "/**\n * Do not edit directly\n * Generated on
|
|
8
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Mon, 07 Aug 2023 18:00:27 GMT\n */\n@supports selector(:focus-visible) {\n :host(:focus) {\n outline: none;\n }\n}\n.base {\n display: inline-flex;\n align-items: center;\n cursor: pointer;\n gap: 8px;\n}\n.base.connotation-cta {\n /* @cssprop [--vvd-radio-cta-primary=var(--vvd-color-cta-500)] */\n --_connotation-color-primary: var(--vvd-radio-cta-primary, var(--vvd-color-cta-500));\n /* @cssprop [--vvd-radio-cta-primary-text=var(--vvd-color-canvas)] */\n --_connotation-color-primary-text: var(--vvd-radio-cta-primary-text, var(--vvd-color-canvas));\n /* @cssprop [--vvd-radio-cta-primary-increment=var(--vvd-color-cta-600)] */\n --_connotation-color-primary-increment: var(--vvd-radio-cta-primary-increment, var(--vvd-color-cta-600));\n /* @cssprop [--vvd-radio-cta-intermediate=var(--vvd-color-cta-500)] */\n --_connotation-color-intermediate: var(--vvd-radio-cta-intermediate, var(--vvd-color-cta-500));\n /* @cssprop [--vvd-radio-cta-backdrop=var(--vvd-color-cta-50)] */\n --_connotation-color-backdrop: var(--vvd-radio-cta-backdrop, var(--vvd-color-cta-50));\n /* @cssprop [--vvd-radio-cta-firm=var(--vvd-color-cta-600)] */\n --_connotation-color-firm: var(--vvd-radio-cta-firm, var(--vvd-color-cta-600));\n}\n.base:not(.connotation-cta) {\n /* @cssprop [--vvd-radio-accent-primary=var(--vvd-color-canvas-text)] */\n --_connotation-color-primary: var(--vvd-radio-accent-primary, var(--vvd-color-canvas-text));\n /* @cssprop [--vvd-radio-accent-primary-text=var(--vvd-color-canvas)] */\n --_connotation-color-primary-text: var(--vvd-radio-accent-primary-text, var(--vvd-color-canvas));\n /* @cssprop [--vvd-radio-accent-primary-increment=var(--vvd-color-neutral-800)] */\n --_connotation-color-primary-increment: var(--vvd-radio-accent-primary-increment, var(--vvd-color-neutral-800));\n /* @cssprop [--vvd-radio-accent-intermediate=var(--vvd-color-neutral-500)] */\n --_connotation-color-intermediate: var(--vvd-radio-accent-intermediate, var(--vvd-color-neutral-500));\n /* @cssprop [--vvd-radio-accent-backdrop=var(--vvd-color-canvas)] */\n --_connotation-color-backdrop: var(--vvd-radio-accent-backdrop, var(--vvd-color-canvas));\n /* @cssprop [--vvd-radio-accent-firm=var(--vvd-color-canvas-text)] */\n --_connotation-color-firm: var(--vvd-radio-accent-firm, var(--vvd-color-canvas-text));\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: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(:checked, .checked):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--_connotation-color-primary-text);\n --_appearance-color-fill: var(--_connotation-color-primary);\n --_appearance-color-outline: var(--_connotation-color-primary);\n}\n.base:where(:checked, .checked):where(:hover, .hover) {\n --_appearance-color-text: var(--_connotation-color-primary-text);\n --_appearance-color-fill: var(--_connotation-color-primary-increment);\n --_appearance-color-outline: var(--_connotation-color-primary);\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(.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@supports (user-select: none) {\n .base {\n user-select: none;\n }\n}\n.base.disabled {\n cursor: not-allowed;\n pointer-events: none;\n}\n\n.control {\n position: relative;\n flex-shrink: 0;\n block-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 20));\n border-radius: 50%;\n box-shadow: inset 0 0 0 2px var(--_appearance-color-outline);\n inline-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 20));\n}\n.base:not(.checked) .control {\n background-color: var(--_appearance-color-fill);\n}\n.control::after {\n position: absolute;\n background-color: var(--_appearance-color-outline);\n border-radius: inherit;\n content: \"\";\n inset: 5px;\n opacity: 1;\n transition: opacity 0.2s;\n}\n.base:not(.checked) .control::after {\n opacity: 0;\n}\n\nlabel {\n color: var(--vvd-color-canvas-text);\n cursor: pointer;\n font: var(--vvd-typography-base);\n}\n\n.focus-indicator {\n --focus-inset: -3px;\n --focus-stroke-gap-color: transparent;\n border-radius: 50%;\n}\n:host(:not(:focus-visible)) .focus-indicator {\n display: none;\n}";
|
|
9
9
|
|
|
10
|
-
let _ = t => t,
|
|
11
|
-
_t,
|
|
12
|
-
_t2;
|
|
13
10
|
const getClasses = ({
|
|
14
11
|
connotation,
|
|
15
12
|
checked,
|
|
@@ -18,21 +15,21 @@ const getClasses = ({
|
|
|
18
15
|
}) => classNames('base', [`connotation-${connotation}`, Boolean(connotation)], ['checked', Boolean(checked)], ['readonly', Boolean(readOnly)], ['disabled', Boolean(disabled)]);
|
|
19
16
|
const RadioTemplate = context => {
|
|
20
17
|
const focusTemplate = focusTemplateFactory(context);
|
|
21
|
-
return html
|
|
22
|
-
<div class="${
|
|
18
|
+
return html`
|
|
19
|
+
<div class="${getClasses}"
|
|
23
20
|
role="radio"
|
|
24
|
-
aria-checked="${
|
|
25
|
-
aria-required="${
|
|
26
|
-
aria-disabled="${
|
|
27
|
-
@keypress="${
|
|
28
|
-
@click="${
|
|
21
|
+
aria-checked="${x => x.checked}"
|
|
22
|
+
aria-required="${x => x.required}"
|
|
23
|
+
aria-disabled="${x => x.disabled}"
|
|
24
|
+
@keypress="${(x, c) => x.keypressHandler(c.event)}"
|
|
25
|
+
@click="${(x, c) => x.clickHandler(c.event)}"
|
|
29
26
|
>
|
|
30
27
|
<div class="control">
|
|
31
|
-
${
|
|
28
|
+
${() => focusTemplate}
|
|
32
29
|
</div>
|
|
33
|
-
${
|
|
30
|
+
${when(x => x.label, html`<label class="label">${x => x.label}</label>`)}
|
|
34
31
|
</div>
|
|
35
|
-
|
|
32
|
+
`;
|
|
36
33
|
};
|
|
37
34
|
|
|
38
35
|
const radioDefinition = Radio.compose({
|
package/shared/definition4.js
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { h as html, r as registerFactory } from './index.js';
|
|
2
2
|
import { F as Focus } from './focus.js';
|
|
3
3
|
|
|
4
|
-
var css_248z = "/**\n * Do not edit directly\n * Generated on
|
|
4
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Mon, 07 Aug 2023 18:00:27 GMT\n */\n:host {\n display: contents;\n border-radius: inherit;\n}\n\n.control {\n position: absolute;\n z-index: 1;\n box-sizing: border-box;\n border-radius: inherit;\n box-shadow: inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);\n inset: var(--focus-inset, 0);\n outline: 2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));\n outline-offset: -2px;\n}";
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const focusTemplate = () => html(_t || (_t = _`
|
|
9
|
-
<span class="control"></span>`));
|
|
6
|
+
const focusTemplate = () => html`
|
|
7
|
+
<span class="control"></span>`;
|
|
10
8
|
|
|
11
9
|
const focusDefinition = Focus.compose({
|
|
12
10
|
baseName: 'focus',
|
package/shared/definition40.js
CHANGED
|
@@ -3,10 +3,10 @@ import { D as Direction, g as getDirection } from './direction.js';
|
|
|
3
3
|
import { h as keyArrowRight, i as keyArrowLeft, A as ArrowKeys, c as keyArrowUp, b as keyArrowDown, d as keyEnter } from './key-codes.js';
|
|
4
4
|
import { O as Orientation } from './aria.js';
|
|
5
5
|
import { R as Radio } from './radio.js';
|
|
6
|
-
import { e as elements } from './node-observation.js';
|
|
7
6
|
import { O as Orientation$1 } from './aria2.js';
|
|
8
|
-
import {
|
|
7
|
+
import { e as elements } from './node-observation.js';
|
|
9
8
|
import { w as when } from './when.js';
|
|
9
|
+
import { s as slotted } from './slotted.js';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* An Radio Group Custom HTML Element.
|
|
@@ -394,36 +394,33 @@ __decorate([
|
|
|
394
394
|
observable
|
|
395
395
|
], RadioGroup$1.prototype, "slottedRadioButtons", void 0);
|
|
396
396
|
|
|
397
|
-
var css_248z = "/**\n * Do not edit directly\n * Generated on
|
|
397
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Mon, 07 Aug 2023 18:00:27 GMT\n */\n.positioning-region {\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n}\n.positioning-region.vertical {\n flex-direction: column;\n}\nlabel + .positioning-region {\n margin-block-start: 8px;\n}\n\nlabel {\n color: var(--vvd-color-canvas-text);\n font: var(--vvd-typography-base);\n}";
|
|
398
398
|
|
|
399
399
|
class RadioGroup extends RadioGroup$1 {}
|
|
400
400
|
__decorate([attr, __metadata("design:type", String)], RadioGroup.prototype, "label", void 0);
|
|
401
401
|
|
|
402
|
-
let _ = t => t,
|
|
403
|
-
_t,
|
|
404
|
-
_t2;
|
|
405
402
|
const RadioGroupTemplate = context => {
|
|
406
|
-
return html
|
|
403
|
+
return html`
|
|
407
404
|
<template
|
|
408
405
|
role="radiogroup"
|
|
409
|
-
aria-disabled="${
|
|
410
|
-
aria-readonly="${
|
|
411
|
-
aria-orientation="${
|
|
412
|
-
@click="${
|
|
413
|
-
@keydown="${
|
|
414
|
-
@focusout="${
|
|
406
|
+
aria-disabled="${x => x.disabled}"
|
|
407
|
+
aria-readonly="${x => x.readOnly}"
|
|
408
|
+
aria-orientation="${x => x.orientation}"
|
|
409
|
+
@click="${(x, c) => x.clickHandler(c.event)}"
|
|
410
|
+
@keydown="${(x, c) => x.keydownHandler(c.event)}"
|
|
411
|
+
@focusout="${(x, c) => x.focusOutHandler(c.event)}"
|
|
415
412
|
>
|
|
416
413
|
|
|
417
|
-
${
|
|
414
|
+
${when(x => x.label, html`<label>${x => x.label}</label>`)}
|
|
418
415
|
|
|
419
|
-
<div class="positioning-region ${
|
|
420
|
-
<slot ${
|
|
421
|
-
</div>
|
|
422
|
-
</template>
|
|
423
|
-
`), x => x.disabled, x => x.readOnly, x => x.orientation, (x, c) => x.clickHandler(c.event), (x, c) => x.keydownHandler(c.event), (x, c) => x.focusOutHandler(c.event), when(x => x.label, html(_t2 || (_t2 = _`<label>${0}</label>`), x => x.label)), x => x.orientation === Orientation$1.horizontal ? 'horizontal' : 'vertical', slotted({
|
|
416
|
+
<div class="positioning-region ${x => x.orientation === Orientation$1.horizontal ? 'horizontal' : 'vertical'}">
|
|
417
|
+
<slot ${slotted({
|
|
424
418
|
property: 'slottedRadioButtons',
|
|
425
419
|
filter: elements(context.tagFor(Radio))
|
|
426
|
-
})
|
|
420
|
+
})}></slot>
|
|
421
|
+
</div>
|
|
422
|
+
</template>
|
|
423
|
+
`;
|
|
427
424
|
};
|
|
428
425
|
|
|
429
426
|
const radioGroupDefinition = RadioGroup.compose({
|