@vonage/vivid 4.25.0 → 4.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/custom-elements.json +3371 -1999
- package/lib/accordion-item/accordion-item.d.ts +2 -2
- package/lib/action-group/action-group.d.ts +1 -1
- package/lib/alert/alert.d.ts +5 -5
- package/lib/audio-player/audio-player.d.ts +3 -3
- package/lib/avatar/avatar.d.ts +393 -1
- package/lib/avatar/avatar.template.d.ts +2 -2
- package/lib/badge/badge.d.ts +2 -2
- package/lib/banner/banner.d.ts +6 -6
- package/lib/breadcrumb/breadcrumb.d.ts +1 -1
- package/lib/breadcrumb-item/breadcrumb-item.d.ts +1 -1
- package/lib/button/button.d.ts +6 -6
- package/lib/calendar/calendar.d.ts +2 -0
- package/lib/calendar-event/calendar-event.d.ts +1 -1
- package/lib/card/card.d.ts +1 -1
- package/lib/checkbox/checkbox.d.ts +10 -10
- package/lib/combobox/combobox.d.ts +11 -11
- package/lib/data-grid/data-grid-cell.d.ts +6 -4
- package/lib/data-grid/data-grid-row.d.ts +1 -0
- package/lib/data-grid/data-grid.d.ts +1 -1
- package/lib/date-picker/date-picker.d.ts +75 -75
- package/lib/date-picker/date-picker.template.d.ts +1 -1
- package/lib/date-range-picker/date-range-picker.d.ts +44 -44
- package/lib/date-range-picker/date-range-picker.template.d.ts +1 -1
- package/lib/date-time-picker/date-time-picker.d.ts +64 -64
- package/lib/date-time-picker/date-time-picker.template.d.ts +1 -1
- package/lib/dial-pad/dial-pad.d.ts +3 -3
- package/lib/dialog/dialog.d.ts +5 -4
- package/lib/divider/divider.d.ts +1 -1
- package/lib/fab/fab.d.ts +2 -2
- package/lib/file-picker/file-picker.d.ts +10 -10
- package/lib/header/header.d.ts +1 -1
- package/lib/menu/menu.d.ts +2 -2
- package/lib/menu-item/menu-item.d.ts +3 -3
- package/lib/nav/nav.d.ts +1 -1
- package/lib/nav-disclosure/nav-disclosure.d.ts +3 -3
- package/lib/nav-item/nav-item.d.ts +3 -3
- package/lib/note/note.d.ts +2 -2
- package/lib/number-field/locale.d.ts +3 -2
- package/lib/number-field/number-field.d.ts +15 -15
- package/lib/option/option.d.ts +3 -3
- package/lib/pagination/locale.d.ts +5 -0
- package/lib/pagination/pagination.d.ts +341 -2
- package/lib/popup/popup.d.ts +1 -0
- package/lib/progress/progress.d.ts +1 -1
- package/lib/progress-ring/progress-ring.d.ts +1 -1
- package/lib/radio/radio.d.ts +3 -3
- package/lib/radio-group/radio-group.d.ts +4 -4
- package/lib/range-slider/range-slider.d.ts +5 -5
- package/lib/rich-text-editor/menubar/menubar.d.ts +3 -3
- package/lib/rich-text-editor/rich-text-editor.d.ts +3 -3
- package/lib/searchable-select/locale.d.ts +1 -1
- package/lib/searchable-select/option-tag.d.ts +3 -3
- package/lib/searchable-select/searchable-select.d.ts +15 -15
- package/lib/select/select.d.ts +12 -12
- package/lib/selectable-box/selectable-box.d.ts +1 -1
- package/lib/slider/slider.d.ts +5 -5
- package/lib/split-button/split-button.d.ts +6 -6
- package/lib/switch/switch.d.ts +2 -2
- package/lib/tab/tab.d.ts +6 -6
- package/lib/tab-panel/tab-panel.d.ts +1 -1
- package/lib/tag/locale.d.ts +3 -0
- package/lib/tag/tag.d.ts +343 -6
- package/lib/tag-group/tag-group.d.ts +1 -1
- package/lib/text-area/text-area.d.ts +14 -14
- package/lib/text-field/text-field.d.ts +16 -16
- package/lib/time-picker/time-picker.d.ts +21 -21
- package/lib/toggletip/toggletip.d.ts +1 -1
- package/lib/tooltip/tooltip.d.ts +1 -1
- package/lib/tree-item/tree-item.d.ts +3 -3
- package/lib/tree-view/tree-view.d.ts +1 -1
- package/lib/video-player/video-player.d.ts +3 -3
- package/locales/de-DE.cjs +40 -5
- package/locales/de-DE.js +40 -5
- package/locales/en-GB.cjs +40 -5
- package/locales/en-GB.js +40 -5
- package/locales/en-US.cjs +40 -5
- package/locales/en-US.js +40 -5
- package/locales/ja-JP.cjs +40 -5
- package/locales/ja-JP.js +40 -5
- package/locales/zh-CN.cjs +40 -5
- package/locales/zh-CN.js +40 -5
- package/package.json +73 -45
- package/shared/aria/delegates-aria.d.ts +1 -1
- package/shared/aria/host-semantics.d.ts +1 -1
- package/shared/calendar-picker.template.cjs +40 -13
- package/shared/calendar-picker.template.js +40 -13
- package/shared/definition.cjs +19 -3
- package/shared/definition.js +20 -4
- package/shared/definition11.cjs +1 -1
- package/shared/definition11.js +1 -1
- package/shared/definition13.cjs +25 -0
- package/shared/definition13.js +26 -1
- package/shared/definition15.cjs +1 -1
- package/shared/definition15.js +1 -1
- package/shared/definition16.cjs +1 -1
- package/shared/definition16.js +1 -1
- package/shared/definition17.cjs +602 -522
- package/shared/definition17.js +600 -520
- package/shared/definition18.cjs +8 -1
- package/shared/definition18.js +8 -1
- package/shared/definition19.cjs +9 -2
- package/shared/definition19.js +9 -2
- package/shared/definition2.cjs +1 -1
- package/shared/definition2.js +1 -1
- package/shared/definition20.cjs +3 -1
- package/shared/definition20.js +3 -1
- package/shared/definition21.cjs +2 -2
- package/shared/definition21.js +2 -2
- package/shared/definition22.cjs +9 -3
- package/shared/definition22.js +9 -3
- package/shared/definition28.cjs +2 -2
- package/shared/definition28.js +2 -2
- package/shared/definition3.cjs +1 -1
- package/shared/definition3.js +1 -1
- package/shared/definition30.cjs +1 -1
- package/shared/definition30.js +1 -1
- package/shared/definition31.cjs +1 -1
- package/shared/definition31.js +1 -1
- package/shared/definition32.cjs +1 -1
- package/shared/definition32.js +1 -1
- package/shared/definition36.cjs +41 -30
- package/shared/definition36.js +34 -23
- package/shared/definition38.cjs +30 -23
- package/shared/definition38.js +30 -23
- package/shared/definition4.cjs +1 -1
- package/shared/definition4.js +1 -1
- package/shared/definition41.cjs +1 -1
- package/shared/definition41.js +1 -1
- package/shared/definition42.cjs +2 -2
- package/shared/definition42.js +2 -2
- package/shared/definition44.cjs +129 -117
- package/shared/definition44.js +130 -118
- package/shared/definition45.cjs +17 -7
- package/shared/definition45.js +17 -7
- package/shared/definition46.cjs +1 -1
- package/shared/definition46.js +1 -1
- package/shared/definition49.cjs +6 -6
- package/shared/definition49.js +6 -6
- package/shared/definition54.cjs +2 -2
- package/shared/definition54.js +2 -2
- package/shared/definition56.cjs +5 -4
- package/shared/definition56.js +5 -4
- package/shared/definition57.cjs +1 -1
- package/shared/definition57.js +1 -1
- package/shared/definition58.cjs +1 -1
- package/shared/definition58.js +1 -1
- package/shared/definition59.cjs +3 -1
- package/shared/definition59.js +3 -1
- package/shared/definition6.cjs +45 -12
- package/shared/definition6.js +45 -12
- package/shared/definition63.cjs +2 -2
- package/shared/definition63.js +2 -2
- package/shared/definition64.cjs +136 -38
- package/shared/definition64.js +136 -38
- package/shared/definition67.cjs +36 -15
- package/shared/definition67.js +37 -16
- package/shared/feedback/feedback-message.d.ts +1 -1
- package/shared/feedback/mixins.d.ts +2 -2
- package/shared/form-associated.cjs +4 -0
- package/shared/form-associated.js +4 -0
- package/shared/foundation/button/button.d.ts +1 -1
- package/shared/foundation/vivid-element/vivid-element.d.ts +2 -0
- package/shared/key-codes.js +1 -1
- package/shared/localization/Locale.d.ts +4 -0
- package/shared/mixins.cjs +4 -1
- package/shared/mixins.js +4 -1
- package/shared/patterns/affix.d.ts +2 -2
- package/shared/patterns/char-count/char-count.d.ts +1 -1
- package/shared/patterns/form-elements/with-success-text.d.ts +1 -1
- package/shared/patterns/linkable.d.ts +1 -1
- package/shared/patterns/localized.d.ts +1 -1
- package/shared/patterns/trapped-focus.d.ts +1 -1
- package/shared/picker-field/mixins/calendar-picker.d.ts +2 -2
- package/shared/picker-field/mixins/calendar-picker.locale.d.ts +5 -0
- package/shared/picker-field/mixins/calendar-picker.template.d.ts +2 -2
- package/shared/picker-field/mixins/calendar-segments/segment.d.ts +1 -0
- package/shared/picker-field/mixins/inline-time-picker/inline-time-picker.d.ts +1 -1
- package/shared/picker-field/mixins/min-max-calendar-picker.d.ts +4 -4
- package/shared/picker-field/mixins/single-date-picker.d.ts +4 -4
- package/shared/picker-field/mixins/single-value-picker.d.ts +1 -1
- package/shared/picker-field/mixins/time-selection-picker.d.ts +2 -2
- package/shared/picker-field/mixins/time-selection-picker.template.d.ts +2 -2
- package/shared/picker-field/picker-field.d.ts +3 -3
- package/shared/picker-field.template.cjs +13 -13
- package/shared/picker-field.template.js +13 -13
- package/shared/vivid-element.cjs +11 -1
- package/shared/vivid-element.js +11 -1
- package/styles/core/all.css +5 -5
- package/styles/core/theme.css +2 -2
- package/styles/core/typography.css +4 -4
- package/styles/fonts/spezia-variable.css +15 -15
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/styles/tokens/vivid-2-compat.css +1 -1
- package/vivid.api.json +395 -277
package/package.json
CHANGED
|
@@ -1,46 +1,74 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
2
|
+
"name": "@vonage/vivid",
|
|
3
|
+
"version": "4.27.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"module": "./index.js",
|
|
6
|
+
"main": "./index.cjs",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./index.d.ts",
|
|
10
|
+
"import": "./index.js",
|
|
11
|
+
"require": "./index.cjs"
|
|
12
|
+
},
|
|
13
|
+
"./*": {
|
|
14
|
+
"types": "./*/index.d.ts",
|
|
15
|
+
"import": "./*/index.js",
|
|
16
|
+
"require": "./*/index.cjs"
|
|
17
|
+
},
|
|
18
|
+
"./locales/*": {
|
|
19
|
+
"types": "./locales/*.d.ts",
|
|
20
|
+
"import": "./locales/*.js",
|
|
21
|
+
"require": "./locales/*.cjs"
|
|
22
|
+
},
|
|
23
|
+
"./*.css": "./*.css"
|
|
24
|
+
},
|
|
25
|
+
"sideEffects": [
|
|
26
|
+
"./*/index.js",
|
|
27
|
+
"./*/index.cjs",
|
|
28
|
+
"*.css"
|
|
29
|
+
],
|
|
30
|
+
"customElements": "custom-elements.json",
|
|
31
|
+
"homepage": "https://vivid.deno.dev",
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "https://github.com/vonage/vivid-3",
|
|
35
|
+
"directory": "libs/components"
|
|
36
|
+
},
|
|
37
|
+
"bugs": {
|
|
38
|
+
"url": "https://github.com/Vonage/vivid-3/issues"
|
|
39
|
+
},
|
|
40
|
+
"license": "Apache-2.0",
|
|
41
|
+
"scripts": {
|
|
42
|
+
"prebuild": "cem analyze --config ./cem.config.mjs",
|
|
43
|
+
"build": "vite build",
|
|
44
|
+
"postbuild": "api-extractor run -c ./dist/api-extractor.json && tsx scripts/copyPackageJson.ts",
|
|
45
|
+
"dev": "WATCH_MODE=true vite build -w",
|
|
46
|
+
"lint": "eslint . --max-warnings=0",
|
|
47
|
+
"lint:fix": "eslint . --max-warnings=0 --fix",
|
|
48
|
+
"stylelint": "stylelint 'src/**/*.{css,scss}'",
|
|
49
|
+
"stylelint:fix": "stylelint 'src/**/*.{css,scss}' --fix",
|
|
50
|
+
"test": "vitest run",
|
|
51
|
+
"test:coverage": "vitest run --coverage",
|
|
52
|
+
"e2e": "playwright test",
|
|
53
|
+
"e2e:ui": "playwright test --ui",
|
|
54
|
+
"e2e:docker": "PW_TEST_CONNECT_WS_ENDPOINT=ws://0.0.0.0:3000/ playwright test",
|
|
55
|
+
"e2e:docker:ui": "PW_TEST_CONNECT_WS_ENDPOINT=ws://0.0.0.0:3000/ playwright test --ui",
|
|
56
|
+
"typecheck": "tsc --noEmit"
|
|
57
|
+
},
|
|
58
|
+
"dependencies": {
|
|
59
|
+
"@floating-ui/dom": "^1.6.13",
|
|
60
|
+
"@microsoft/fast-element": "^1.14.0",
|
|
61
|
+
"@microsoft/fast-web-utilities": "^6.0.0"
|
|
62
|
+
},
|
|
63
|
+
"devDependencies": {
|
|
64
|
+
"@repo/cem-analyzer-plugins": "*",
|
|
65
|
+
"@repo/consts": "*",
|
|
66
|
+
"@repo/eslint-config": "*",
|
|
67
|
+
"@repo/eslint-plugin-repo": "*",
|
|
68
|
+
"@repo/shared": "*",
|
|
69
|
+
"@repo/stylelint-config": "*",
|
|
70
|
+
"@repo/styles": "*",
|
|
71
|
+
"@repo/typescript-config": "*",
|
|
72
|
+
"@repo/vitest-config": "*"
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -9,10 +9,10 @@ export declare function delegateAria<T>(boundProperties?: BoundAriaProperties<T>
|
|
|
9
9
|
export declare const DelegatesAria: <T extends Constructor<VividElement>>(Base: T) => {
|
|
10
10
|
new (...args: any[]): {
|
|
11
11
|
_vividAriaBehaviour: "delegate";
|
|
12
|
+
connectedCallback(): void;
|
|
12
13
|
specialHandling: boolean;
|
|
13
14
|
readonly $fastController: import("@microsoft/fast-element").Controller;
|
|
14
15
|
$emit(type: string, detail?: any, options?: Omit<CustomEventInit<any>, "detail"> | undefined): boolean | void;
|
|
15
|
-
connectedCallback(): void;
|
|
16
16
|
disconnectedCallback(): void;
|
|
17
17
|
attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
|
|
18
18
|
accessKey: string;
|
|
@@ -6,10 +6,10 @@ export declare function applyHostSemantics<T>(boundProperties?: BoundAriaPropert
|
|
|
6
6
|
export declare const HostSemantics: <T extends Constructor<VividElement>>(Base: T) => {
|
|
7
7
|
new (...args: any[]): {
|
|
8
8
|
_vividAriaBehaviour: "host";
|
|
9
|
+
connectedCallback(): void;
|
|
9
10
|
specialHandling: boolean;
|
|
10
11
|
readonly $fastController: import("@microsoft/fast-element").Controller;
|
|
11
12
|
$emit(type: string, detail?: any, options?: Omit<CustomEventInit<any>, "detail"> | undefined): boolean | void;
|
|
12
|
-
connectedCallback(): void;
|
|
13
13
|
disconnectedCallback(): void;
|
|
14
14
|
attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
|
|
15
15
|
accessKey: string;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
const vividElement = require('./vivid-element.cjs');
|
|
4
4
|
const divider = require('./divider.cjs');
|
|
5
5
|
const definition = require('./definition11.cjs');
|
|
6
|
+
const definition$1 = require('./definition66.cjs');
|
|
6
7
|
const repeat = require('./repeat.cjs');
|
|
7
8
|
const when = require('./when.cjs');
|
|
8
9
|
const classNames = require('./class-names.cjs');
|
|
@@ -5775,6 +5776,9 @@ const CalendarPicker = (Base) => {
|
|
|
5775
5776
|
type: "month-picker",
|
|
5776
5777
|
title: `${this._monthPickerYear}`,
|
|
5777
5778
|
titleClickable: true,
|
|
5779
|
+
titleAriaLabel: this.locale.calendarPicker.showCalendarForMonthLabel(
|
|
5780
|
+
`${this.locale.calendarPicker.months.name[this._selectedMonth.month]} ${this._selectedMonth.year}`
|
|
5781
|
+
),
|
|
5778
5782
|
prevYearButton: true,
|
|
5779
5783
|
nextYearButton: true,
|
|
5780
5784
|
months: buildMonthPickerGrid(
|
|
@@ -5793,6 +5797,9 @@ const CalendarPicker = (Base) => {
|
|
|
5793
5797
|
type: "calendar",
|
|
5794
5798
|
title: `${this.locale.calendarPicker.months.name[month.month]} ${month.year}`,
|
|
5795
5799
|
titleClickable: isSingle,
|
|
5800
|
+
titleAriaLabel: this.locale.calendarPicker.changeMonthLabel(
|
|
5801
|
+
`${this.locale.calendarPicker.months.name[month.month]} ${month.year}`
|
|
5802
|
+
),
|
|
5796
5803
|
prevYearButton: isFirst && isSingle,
|
|
5797
5804
|
prevMonthButton: isFirst,
|
|
5798
5805
|
nextMonthButton: isLast,
|
|
@@ -6089,6 +6096,7 @@ function renderDialogHeader(context) {
|
|
|
6089
6096
|
id="${(x) => `grid-label-${x.id}`}"
|
|
6090
6097
|
class="title-action button"
|
|
6091
6098
|
aria-live="polite"
|
|
6099
|
+
aria-label="${(x) => x.titleAriaLabel}"
|
|
6092
6100
|
@click="${(_, c) => c.parent._onTitleActionClick()}"
|
|
6093
6101
|
>
|
|
6094
6102
|
${(x) => x.title}
|
|
@@ -6141,6 +6149,7 @@ function renderDialogHeader(context) {
|
|
|
6141
6149
|
}
|
|
6142
6150
|
function renderCalendarGrid(context) {
|
|
6143
6151
|
const dividerTag = context.tagFor(divider.Divider);
|
|
6152
|
+
const visuallyHiddenTag = context.tagFor(definition$1.VisuallyHidden);
|
|
6144
6153
|
return vividElement.html`
|
|
6145
6154
|
<div
|
|
6146
6155
|
class='calendar'
|
|
@@ -6213,16 +6222,9 @@ function renderCalendarGrid(context) {
|
|
|
6213
6222
|
x.date
|
|
6214
6223
|
)}"
|
|
6215
6224
|
tabindex="${(x, c) => x.date === c.parentContext.parentContext.parent._tabbableDate ? 2 : -1}"
|
|
6216
|
-
aria-selected="${(x, c) => c.parentContext.parentContext.parent._isDateAriaSelected(
|
|
6217
|
-
x.date
|
|
6218
|
-
)}"
|
|
6219
6225
|
data-date="${(x) => x.date}"
|
|
6220
|
-
@click="${(x, c) => c.parentContext.parentContext.parent._onDateClick(
|
|
6221
|
-
|
|
6222
|
-
)}"
|
|
6223
|
-
@focus="${(x, c) => c.parentContext.parentContext.parent._onDateFocus(
|
|
6224
|
-
x.date
|
|
6225
|
-
)}"
|
|
6226
|
+
@click="${(x, c) => c.parentContext.parentContext.parent._onDateClick(x.date)}"
|
|
6227
|
+
@focus="${(x, c) => c.parentContext.parentContext.parent._onDateFocus(x.date)}"
|
|
6226
6228
|
@mouseenter="${(x, c) => c.parentContext.parentContext.parent._onDateMouseEnter(
|
|
6227
6229
|
x.date
|
|
6228
6230
|
)}"
|
|
@@ -6235,6 +6237,21 @@ function renderCalendarGrid(context) {
|
|
|
6235
6237
|
)}"
|
|
6236
6238
|
>
|
|
6237
6239
|
${(x) => x.label}
|
|
6240
|
+
<${visuallyHiddenTag}>${(x, c) => {
|
|
6241
|
+
const picker = c.parentContext.parentContext.parent;
|
|
6242
|
+
const announcements = [];
|
|
6243
|
+
if (x.date === picker._currentDate) {
|
|
6244
|
+
announcements.push(
|
|
6245
|
+
picker.locale.calendarPicker.todayLabel
|
|
6246
|
+
);
|
|
6247
|
+
}
|
|
6248
|
+
if (picker._isDateAriaSelected(x.date)) {
|
|
6249
|
+
announcements.push(
|
|
6250
|
+
picker.locale.calendarPicker.selectedLabel
|
|
6251
|
+
);
|
|
6252
|
+
}
|
|
6253
|
+
return announcements.join(" ");
|
|
6254
|
+
}}</${visuallyHiddenTag}>
|
|
6238
6255
|
</button>
|
|
6239
6256
|
</span>`
|
|
6240
6257
|
)}
|
|
@@ -6246,6 +6263,7 @@ function renderCalendarGrid(context) {
|
|
|
6246
6263
|
}
|
|
6247
6264
|
function renderMonthPickerGrid(context) {
|
|
6248
6265
|
const dividerTag = context.tagFor(divider.Divider);
|
|
6266
|
+
const visuallyHiddenTag = context.tagFor(definition$1.VisuallyHidden);
|
|
6249
6267
|
return vividElement.html`
|
|
6250
6268
|
<${dividerTag}
|
|
6251
6269
|
class='months-separator'
|
|
@@ -6288,10 +6306,6 @@ function renderMonthPickerGrid(context) {
|
|
|
6288
6306
|
c.parentContext.parentContext.parent._tabbableMonth
|
|
6289
6307
|
) ? 2 : -1}"
|
|
6290
6308
|
aria-label="${(x) => x.monthName}"
|
|
6291
|
-
aria-selected="${(x, c) => areMonthsEqual(
|
|
6292
|
-
x.month,
|
|
6293
|
-
c.parentContext.parentContext.parent._selectedMonth
|
|
6294
|
-
)}"
|
|
6295
6309
|
data-month="${(x) => monthToStr(x.month)}"
|
|
6296
6310
|
?disabled="${(x, c) => !c.parentContext.parentContext.parent._isMonthInValidRange(
|
|
6297
6311
|
x.month
|
|
@@ -6308,6 +6322,19 @@ function renderMonthPickerGrid(context) {
|
|
|
6308
6322
|
)}"
|
|
6309
6323
|
>
|
|
6310
6324
|
${(x) => x.label}
|
|
6325
|
+
<${visuallyHiddenTag}>${(x, c) => {
|
|
6326
|
+
const picker = c.parentContext.parentContext.parent;
|
|
6327
|
+
const announcements = [];
|
|
6328
|
+
if (areMonthsEqual(x.month, picker._currentMonth)) {
|
|
6329
|
+
announcements.push(picker.locale.calendarPicker.currentLabel);
|
|
6330
|
+
}
|
|
6331
|
+
if (areMonthsEqual(x.month, picker._selectedMonth)) {
|
|
6332
|
+
announcements.push(
|
|
6333
|
+
picker.locale.calendarPicker.selectedLabel
|
|
6334
|
+
);
|
|
6335
|
+
}
|
|
6336
|
+
return announcements.join(" ");
|
|
6337
|
+
}}</${visuallyHiddenTag}>
|
|
6311
6338
|
</button>
|
|
6312
6339
|
</span>
|
|
6313
6340
|
`
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { o as observable, v as volatile, D as DOM, a as attr, h as html } from './vivid-element.js';
|
|
2
2
|
import { D as Divider } from './divider.js';
|
|
3
3
|
import { B as Button } from './definition11.js';
|
|
4
|
+
import { V as VisuallyHidden } from './definition66.js';
|
|
4
5
|
import { r as repeat } from './repeat.js';
|
|
5
6
|
import { w as when } from './when.js';
|
|
6
7
|
import { c as classNames } from './class-names.js';
|
|
@@ -5773,6 +5774,9 @@ const CalendarPicker = (Base) => {
|
|
|
5773
5774
|
type: "month-picker",
|
|
5774
5775
|
title: `${this._monthPickerYear}`,
|
|
5775
5776
|
titleClickable: true,
|
|
5777
|
+
titleAriaLabel: this.locale.calendarPicker.showCalendarForMonthLabel(
|
|
5778
|
+
`${this.locale.calendarPicker.months.name[this._selectedMonth.month]} ${this._selectedMonth.year}`
|
|
5779
|
+
),
|
|
5776
5780
|
prevYearButton: true,
|
|
5777
5781
|
nextYearButton: true,
|
|
5778
5782
|
months: buildMonthPickerGrid(
|
|
@@ -5791,6 +5795,9 @@ const CalendarPicker = (Base) => {
|
|
|
5791
5795
|
type: "calendar",
|
|
5792
5796
|
title: `${this.locale.calendarPicker.months.name[month.month]} ${month.year}`,
|
|
5793
5797
|
titleClickable: isSingle,
|
|
5798
|
+
titleAriaLabel: this.locale.calendarPicker.changeMonthLabel(
|
|
5799
|
+
`${this.locale.calendarPicker.months.name[month.month]} ${month.year}`
|
|
5800
|
+
),
|
|
5794
5801
|
prevYearButton: isFirst && isSingle,
|
|
5795
5802
|
prevMonthButton: isFirst,
|
|
5796
5803
|
nextMonthButton: isLast,
|
|
@@ -6087,6 +6094,7 @@ function renderDialogHeader(context) {
|
|
|
6087
6094
|
id="${(x) => `grid-label-${x.id}`}"
|
|
6088
6095
|
class="title-action button"
|
|
6089
6096
|
aria-live="polite"
|
|
6097
|
+
aria-label="${(x) => x.titleAriaLabel}"
|
|
6090
6098
|
@click="${(_, c) => c.parent._onTitleActionClick()}"
|
|
6091
6099
|
>
|
|
6092
6100
|
${(x) => x.title}
|
|
@@ -6139,6 +6147,7 @@ function renderDialogHeader(context) {
|
|
|
6139
6147
|
}
|
|
6140
6148
|
function renderCalendarGrid(context) {
|
|
6141
6149
|
const dividerTag = context.tagFor(Divider);
|
|
6150
|
+
const visuallyHiddenTag = context.tagFor(VisuallyHidden);
|
|
6142
6151
|
return html`
|
|
6143
6152
|
<div
|
|
6144
6153
|
class='calendar'
|
|
@@ -6211,16 +6220,9 @@ function renderCalendarGrid(context) {
|
|
|
6211
6220
|
x.date
|
|
6212
6221
|
)}"
|
|
6213
6222
|
tabindex="${(x, c) => x.date === c.parentContext.parentContext.parent._tabbableDate ? 2 : -1}"
|
|
6214
|
-
aria-selected="${(x, c) => c.parentContext.parentContext.parent._isDateAriaSelected(
|
|
6215
|
-
x.date
|
|
6216
|
-
)}"
|
|
6217
6223
|
data-date="${(x) => x.date}"
|
|
6218
|
-
@click="${(x, c) => c.parentContext.parentContext.parent._onDateClick(
|
|
6219
|
-
|
|
6220
|
-
)}"
|
|
6221
|
-
@focus="${(x, c) => c.parentContext.parentContext.parent._onDateFocus(
|
|
6222
|
-
x.date
|
|
6223
|
-
)}"
|
|
6224
|
+
@click="${(x, c) => c.parentContext.parentContext.parent._onDateClick(x.date)}"
|
|
6225
|
+
@focus="${(x, c) => c.parentContext.parentContext.parent._onDateFocus(x.date)}"
|
|
6224
6226
|
@mouseenter="${(x, c) => c.parentContext.parentContext.parent._onDateMouseEnter(
|
|
6225
6227
|
x.date
|
|
6226
6228
|
)}"
|
|
@@ -6233,6 +6235,21 @@ function renderCalendarGrid(context) {
|
|
|
6233
6235
|
)}"
|
|
6234
6236
|
>
|
|
6235
6237
|
${(x) => x.label}
|
|
6238
|
+
<${visuallyHiddenTag}>${(x, c) => {
|
|
6239
|
+
const picker = c.parentContext.parentContext.parent;
|
|
6240
|
+
const announcements = [];
|
|
6241
|
+
if (x.date === picker._currentDate) {
|
|
6242
|
+
announcements.push(
|
|
6243
|
+
picker.locale.calendarPicker.todayLabel
|
|
6244
|
+
);
|
|
6245
|
+
}
|
|
6246
|
+
if (picker._isDateAriaSelected(x.date)) {
|
|
6247
|
+
announcements.push(
|
|
6248
|
+
picker.locale.calendarPicker.selectedLabel
|
|
6249
|
+
);
|
|
6250
|
+
}
|
|
6251
|
+
return announcements.join(" ");
|
|
6252
|
+
}}</${visuallyHiddenTag}>
|
|
6236
6253
|
</button>
|
|
6237
6254
|
</span>`
|
|
6238
6255
|
)}
|
|
@@ -6244,6 +6261,7 @@ function renderCalendarGrid(context) {
|
|
|
6244
6261
|
}
|
|
6245
6262
|
function renderMonthPickerGrid(context) {
|
|
6246
6263
|
const dividerTag = context.tagFor(Divider);
|
|
6264
|
+
const visuallyHiddenTag = context.tagFor(VisuallyHidden);
|
|
6247
6265
|
return html`
|
|
6248
6266
|
<${dividerTag}
|
|
6249
6267
|
class='months-separator'
|
|
@@ -6286,10 +6304,6 @@ function renderMonthPickerGrid(context) {
|
|
|
6286
6304
|
c.parentContext.parentContext.parent._tabbableMonth
|
|
6287
6305
|
) ? 2 : -1}"
|
|
6288
6306
|
aria-label="${(x) => x.monthName}"
|
|
6289
|
-
aria-selected="${(x, c) => areMonthsEqual(
|
|
6290
|
-
x.month,
|
|
6291
|
-
c.parentContext.parentContext.parent._selectedMonth
|
|
6292
|
-
)}"
|
|
6293
6307
|
data-month="${(x) => monthToStr(x.month)}"
|
|
6294
6308
|
?disabled="${(x, c) => !c.parentContext.parentContext.parent._isMonthInValidRange(
|
|
6295
6309
|
x.month
|
|
@@ -6306,6 +6320,19 @@ function renderMonthPickerGrid(context) {
|
|
|
6306
6320
|
)}"
|
|
6307
6321
|
>
|
|
6308
6322
|
${(x) => x.label}
|
|
6323
|
+
<${visuallyHiddenTag}>${(x, c) => {
|
|
6324
|
+
const picker = c.parentContext.parentContext.parent;
|
|
6325
|
+
const announcements = [];
|
|
6326
|
+
if (areMonthsEqual(x.month, picker._currentMonth)) {
|
|
6327
|
+
announcements.push(picker.locale.calendarPicker.currentLabel);
|
|
6328
|
+
}
|
|
6329
|
+
if (areMonthsEqual(x.month, picker._selectedMonth)) {
|
|
6330
|
+
announcements.push(
|
|
6331
|
+
picker.locale.calendarPicker.selectedLabel
|
|
6332
|
+
);
|
|
6333
|
+
}
|
|
6334
|
+
return announcements.join(" ");
|
|
6335
|
+
}}</${visuallyHiddenTag}>
|
|
6309
6336
|
</button>
|
|
6310
6337
|
</span>
|
|
6311
6338
|
`
|
package/shared/definition.cjs
CHANGED
|
@@ -4,6 +4,7 @@ const vividElement = require('./vivid-element.cjs');
|
|
|
4
4
|
const definition = require('./definition28.cjs');
|
|
5
5
|
const affix = require('./affix.cjs');
|
|
6
6
|
const ref = require('./ref.cjs');
|
|
7
|
+
const slotted = require('./slotted.cjs');
|
|
7
8
|
const when = require('./when.cjs');
|
|
8
9
|
|
|
9
10
|
const styles = ":host{--_vvd-accordion-item-accent-firm-wrapper: var( --vvd-accordion-item-accent-firm )}.heading-button{--vvd-accordion-item-accent-firm: var( --_vvd-accordion-item-accent-firm-wrapper, var(--vvd-accordion-item-accent-primary) )}:host{display:flex;box-sizing:border-box;flex-direction:column}.heading-container{margin:0}.heading-button{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.heading-button:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}.heading-button:where(.active,:active):where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.heading-button{--_connotation-color-faint: var(--vvd-accordion-item-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-soft: var(--vvd-accordion-item-accent-soft, var(--vvd-color-neutral-100));--_connotation-color-firm: var(--vvd-accordion-item-accent-firm, var(--vvd-color-canvas-text))}.heading-button{--focus-stroke-gap-color: transparent;display:flex;width:100%;align-items:center;padding:16px;border:none;background-color:var(--_appearance-color-fill);color:var(--_appearance-color-text);cursor:pointer;text-align:left}.heading-button:focus-visible{box-shadow:0 0 0 4px color-mix(in srgb,var(--vvd-color-cta-500),transparent 85%),inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:1px solid var(--focus-stroke-color, var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset, 0px))}.heading-button.size-condensed{font:var(--vvd-typography-base-extended-bold);gap:12px}.heading-button:not(.size-condensed){font:var(--vvd-typography-heading-4);gap:16px}.heading-content{flex:auto}.meta{overflow:hidden;max-width:var(--accordion-item-meta-inline-size, 20%);flex-shrink:0;color:var(--vvd-color-neutral-600);text-align:end;text-overflow:ellipsis;white-space:nowrap}.heading-button:not(.size-condensed) .meta{font:var(--vvd-typography-base-bold)}.heading-button.size-condensed .meta{font:var(--vvd-typography-base-condensed-bold)}.region{display:none;padding:8px 32px 24px 16px}.region:not(.size-condensed).padded{padding-inline-start:52px}:host([expanded]) .region{display:block}.region.size-condensed.padded{padding-inline-start:44px}slot[name=icon]{color:var(--vvd-color-neutral-600)}.heading-button:not(.size-condensed) slot[name=icon]{font:inherit}.heading-button.size-condensed slot[name=icon]{font:var(--vvd-typography-base-extended)}:host(:not([icon-trailing])) slot[name=icon]:last-of-type{color:var(--_appearance-color-text)}";
|
|
@@ -52,12 +53,18 @@ __decorateClass([
|
|
|
52
53
|
__decorateClass([
|
|
53
54
|
vividElement.attr
|
|
54
55
|
], AccordionItem.prototype, "heading");
|
|
56
|
+
__decorateClass([
|
|
57
|
+
vividElement.observable
|
|
58
|
+
], AccordionItem.prototype, "_headingSlottedContent");
|
|
55
59
|
__decorateClass([
|
|
56
60
|
vividElement.attr({ mode: "boolean", attribute: "no-indicator" })
|
|
57
61
|
], AccordionItem.prototype, "noIndicator");
|
|
58
62
|
__decorateClass([
|
|
59
63
|
vividElement.attr
|
|
60
64
|
], AccordionItem.prototype, "meta");
|
|
65
|
+
__decorateClass([
|
|
66
|
+
vividElement.observable
|
|
67
|
+
], AccordionItem.prototype, "_metaSlottedContent");
|
|
61
68
|
__decorateClass([
|
|
62
69
|
vividElement.attr
|
|
63
70
|
], AccordionItem.prototype, "size");
|
|
@@ -77,13 +84,22 @@ const header = (context, hTag) => {
|
|
|
77
84
|
|
|
78
85
|
${(x) => !x.iconTrailing ? affixIconTemplate(x.icon, affix.IconWrapper.Slot) : null}
|
|
79
86
|
|
|
80
|
-
<span class="heading-content"
|
|
87
|
+
<span class="heading-content">
|
|
88
|
+
<slot name="heading" ${slotted.slotted("_headingSlottedContent")}></slot>
|
|
89
|
+
${when.when(
|
|
90
|
+
(x) => x.heading && !x._headingSlottedContent?.length,
|
|
91
|
+
vividElement.html`${(x) => x.heading}`
|
|
92
|
+
)}
|
|
93
|
+
</span>
|
|
81
94
|
|
|
82
|
-
|
|
95
|
+
<span class="meta">
|
|
96
|
+
<slot name="meta" ${slotted.slotted("_metaSlottedContent")}></slot>
|
|
97
|
+
${when.when((x) => x.meta && !x._metaSlottedContent?.length, vividElement.html`${(x) => x.meta}`)}
|
|
98
|
+
</span>
|
|
83
99
|
|
|
84
100
|
${(x) => x.icon && x.iconTrailing ? affixIconTemplate(x.icon) : null}
|
|
85
101
|
${(x) => !(x.icon && x.iconTrailing) && !x.noIndicator ? affixIconTemplate(
|
|
86
|
-
x.expanded ? "chevron-up-
|
|
102
|
+
x.expanded ? "chevron-up-line" : "chevron-down-line"
|
|
87
103
|
) : null}
|
|
88
104
|
|
|
89
105
|
</button>
|
package/shared/definition.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { V as VividElement, a as attr, n as nullableNumberConverter, h as html, d as createRegisterFunction, f as defineVividComponent } from './vivid-element.js';
|
|
1
|
+
import { V as VividElement, a as attr, n as nullableNumberConverter, o as observable, h as html, d as createRegisterFunction, f as defineVividComponent } from './vivid-element.js';
|
|
2
2
|
import { i as iconDefinition } from './definition28.js';
|
|
3
3
|
import { A as AffixIconWithTrailing, a as affixIconTemplateFactory, I as IconWrapper } from './affix.js';
|
|
4
4
|
import { r as ref } from './ref.js';
|
|
5
|
+
import { s as slotted } from './slotted.js';
|
|
5
6
|
import { w as when } from './when.js';
|
|
6
7
|
|
|
7
8
|
const styles = ":host{--_vvd-accordion-item-accent-firm-wrapper: var( --vvd-accordion-item-accent-firm )}.heading-button{--vvd-accordion-item-accent-firm: var( --_vvd-accordion-item-accent-firm-wrapper, var(--vvd-accordion-item-accent-primary) )}:host{display:flex;box-sizing:border-box;flex-direction:column}.heading-container{margin:0}.heading-button{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.heading-button:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}.heading-button:where(.active,:active):where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.heading-button{--_connotation-color-faint: var(--vvd-accordion-item-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-soft: var(--vvd-accordion-item-accent-soft, var(--vvd-color-neutral-100));--_connotation-color-firm: var(--vvd-accordion-item-accent-firm, var(--vvd-color-canvas-text))}.heading-button{--focus-stroke-gap-color: transparent;display:flex;width:100%;align-items:center;padding:16px;border:none;background-color:var(--_appearance-color-fill);color:var(--_appearance-color-text);cursor:pointer;text-align:left}.heading-button:focus-visible{box-shadow:0 0 0 4px color-mix(in srgb,var(--vvd-color-cta-500),transparent 85%),inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:1px solid var(--focus-stroke-color, var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset, 0px))}.heading-button.size-condensed{font:var(--vvd-typography-base-extended-bold);gap:12px}.heading-button:not(.size-condensed){font:var(--vvd-typography-heading-4);gap:16px}.heading-content{flex:auto}.meta{overflow:hidden;max-width:var(--accordion-item-meta-inline-size, 20%);flex-shrink:0;color:var(--vvd-color-neutral-600);text-align:end;text-overflow:ellipsis;white-space:nowrap}.heading-button:not(.size-condensed) .meta{font:var(--vvd-typography-base-bold)}.heading-button.size-condensed .meta{font:var(--vvd-typography-base-condensed-bold)}.region{display:none;padding:8px 32px 24px 16px}.region:not(.size-condensed).padded{padding-inline-start:52px}:host([expanded]) .region{display:block}.region.size-condensed.padded{padding-inline-start:44px}slot[name=icon]{color:var(--vvd-color-neutral-600)}.heading-button:not(.size-condensed) slot[name=icon]{font:inherit}.heading-button.size-condensed slot[name=icon]{font:var(--vvd-typography-base-extended)}:host(:not([icon-trailing])) slot[name=icon]:last-of-type{color:var(--_appearance-color-text)}";
|
|
@@ -50,12 +51,18 @@ __decorateClass([
|
|
|
50
51
|
__decorateClass([
|
|
51
52
|
attr
|
|
52
53
|
], AccordionItem.prototype, "heading");
|
|
54
|
+
__decorateClass([
|
|
55
|
+
observable
|
|
56
|
+
], AccordionItem.prototype, "_headingSlottedContent");
|
|
53
57
|
__decorateClass([
|
|
54
58
|
attr({ mode: "boolean", attribute: "no-indicator" })
|
|
55
59
|
], AccordionItem.prototype, "noIndicator");
|
|
56
60
|
__decorateClass([
|
|
57
61
|
attr
|
|
58
62
|
], AccordionItem.prototype, "meta");
|
|
63
|
+
__decorateClass([
|
|
64
|
+
observable
|
|
65
|
+
], AccordionItem.prototype, "_metaSlottedContent");
|
|
59
66
|
__decorateClass([
|
|
60
67
|
attr
|
|
61
68
|
], AccordionItem.prototype, "size");
|
|
@@ -75,13 +82,22 @@ const header = (context, hTag) => {
|
|
|
75
82
|
|
|
76
83
|
${(x) => !x.iconTrailing ? affixIconTemplate(x.icon, IconWrapper.Slot) : null}
|
|
77
84
|
|
|
78
|
-
<span class="heading-content"
|
|
85
|
+
<span class="heading-content">
|
|
86
|
+
<slot name="heading" ${slotted("_headingSlottedContent")}></slot>
|
|
87
|
+
${when(
|
|
88
|
+
(x) => x.heading && !x._headingSlottedContent?.length,
|
|
89
|
+
html`${(x) => x.heading}`
|
|
90
|
+
)}
|
|
91
|
+
</span>
|
|
79
92
|
|
|
80
|
-
|
|
93
|
+
<span class="meta">
|
|
94
|
+
<slot name="meta" ${slotted("_metaSlottedContent")}></slot>
|
|
95
|
+
${when((x) => x.meta && !x._metaSlottedContent?.length, html`${(x) => x.meta}`)}
|
|
96
|
+
</span>
|
|
81
97
|
|
|
82
98
|
${(x) => x.icon && x.iconTrailing ? affixIconTemplate(x.icon) : null}
|
|
83
99
|
${(x) => !(x.icon && x.iconTrailing) && !x.noIndicator ? affixIconTemplate(
|
|
84
|
-
x.expanded ? "chevron-up-
|
|
100
|
+
x.expanded ? "chevron-up-line" : "chevron-down-line"
|
|
85
101
|
) : null}
|
|
86
102
|
|
|
87
103
|
</button>
|
package/shared/definition11.cjs
CHANGED
|
@@ -160,7 +160,7 @@ const buttonContent = (context) => {
|
|
|
160
160
|
vividElement.html`<span class="text" aria-hidden="true">${(x) => x.label}</span>`
|
|
161
161
|
)}
|
|
162
162
|
<span class="sr-only"
|
|
163
|
-
>${(x) => x.pending ? x.locale.button.pendingLabel : x.
|
|
163
|
+
>${(x) => x.pending ? x.locale.button.pendingLabel : x.ariaLabel ?? x.label}</span
|
|
164
164
|
>
|
|
165
165
|
</span>
|
|
166
166
|
${when.when((x) => x.dropdownIndicator, chevronTemplate)}`;
|
package/shared/definition11.js
CHANGED
|
@@ -158,7 +158,7 @@ const buttonContent = (context) => {
|
|
|
158
158
|
html`<span class="text" aria-hidden="true">${(x) => x.label}</span>`
|
|
159
159
|
)}
|
|
160
160
|
<span class="sr-only"
|
|
161
|
-
>${(x) => x.pending ? x.locale.button.pendingLabel : x.
|
|
161
|
+
>${(x) => x.pending ? x.locale.button.pendingLabel : x.ariaLabel ?? x.label}</span
|
|
162
162
|
>
|
|
163
163
|
</span>
|
|
164
164
|
${when((x) => x.dropdownIndicator, chevronTemplate)}`;
|
package/shared/definition13.cjs
CHANGED
|
@@ -527,6 +527,14 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
527
527
|
if (result) __defProp(target, key, result);
|
|
528
528
|
return result;
|
|
529
529
|
};
|
|
530
|
+
const isScrollable = (node) => {
|
|
531
|
+
const overflowY = window.getComputedStyle(node).overflowY;
|
|
532
|
+
const overflowX = window.getComputedStyle(node).overflowX;
|
|
533
|
+
return {
|
|
534
|
+
vertical: (overflowY === "auto" || overflowY === "scroll") && node.scrollHeight > node.clientHeight,
|
|
535
|
+
horizontal: (overflowX === "auto" || overflowX === "scroll") && node.scrollWidth > node.clientWidth
|
|
536
|
+
};
|
|
537
|
+
};
|
|
530
538
|
class Calendar extends vividElement.VividElement {
|
|
531
539
|
constructor() {
|
|
532
540
|
super(...arguments);
|
|
@@ -613,6 +621,23 @@ class Calendar extends vividElement.VividElement {
|
|
|
613
621
|
}
|
|
614
622
|
return !isArrow;
|
|
615
623
|
}
|
|
624
|
+
connectedCallback() {
|
|
625
|
+
super.connectedCallback();
|
|
626
|
+
this.initializeScrollPosition();
|
|
627
|
+
}
|
|
628
|
+
initializeScrollPosition() {
|
|
629
|
+
if (!isScrollable(this).vertical) {
|
|
630
|
+
return;
|
|
631
|
+
}
|
|
632
|
+
const initialScrollHour = 8;
|
|
633
|
+
const rowHeight = this.scrollHeight / this._hours;
|
|
634
|
+
const scrollPosition = rowHeight * (initialScrollHour - 1);
|
|
635
|
+
vividElement.DOM.queueUpdate(() => {
|
|
636
|
+
this.scrollTo({
|
|
637
|
+
top: scrollPosition
|
|
638
|
+
});
|
|
639
|
+
});
|
|
640
|
+
}
|
|
616
641
|
}
|
|
617
642
|
__decorateClass([
|
|
618
643
|
vividElement.attr
|
package/shared/definition13.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { V as VividElement, a as attr, h as html, d as createRegisterFunction, f as defineVividComponent } from './vivid-element.js';
|
|
1
|
+
import { V as VividElement, D as DOM, a as attr, h as html, d as createRegisterFunction, f as defineVividComponent } from './vivid-element.js';
|
|
2
2
|
import { d as Sticky } from './enums.js';
|
|
3
3
|
import { C as CalendarEvent } from './calendar-event.js';
|
|
4
4
|
import { b as _has, _ as _curry1, a as _curry2 } from './_has.js';
|
|
@@ -525,6 +525,14 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
525
525
|
if (result) __defProp(target, key, result);
|
|
526
526
|
return result;
|
|
527
527
|
};
|
|
528
|
+
const isScrollable = (node) => {
|
|
529
|
+
const overflowY = window.getComputedStyle(node).overflowY;
|
|
530
|
+
const overflowX = window.getComputedStyle(node).overflowX;
|
|
531
|
+
return {
|
|
532
|
+
vertical: (overflowY === "auto" || overflowY === "scroll") && node.scrollHeight > node.clientHeight,
|
|
533
|
+
horizontal: (overflowX === "auto" || overflowX === "scroll") && node.scrollWidth > node.clientWidth
|
|
534
|
+
};
|
|
535
|
+
};
|
|
528
536
|
class Calendar extends VividElement {
|
|
529
537
|
constructor() {
|
|
530
538
|
super(...arguments);
|
|
@@ -611,6 +619,23 @@ class Calendar extends VividElement {
|
|
|
611
619
|
}
|
|
612
620
|
return !isArrow;
|
|
613
621
|
}
|
|
622
|
+
connectedCallback() {
|
|
623
|
+
super.connectedCallback();
|
|
624
|
+
this.initializeScrollPosition();
|
|
625
|
+
}
|
|
626
|
+
initializeScrollPosition() {
|
|
627
|
+
if (!isScrollable(this).vertical) {
|
|
628
|
+
return;
|
|
629
|
+
}
|
|
630
|
+
const initialScrollHour = 8;
|
|
631
|
+
const rowHeight = this.scrollHeight / this._hours;
|
|
632
|
+
const scrollPosition = rowHeight * (initialScrollHour - 1);
|
|
633
|
+
DOM.queueUpdate(() => {
|
|
634
|
+
this.scrollTo({
|
|
635
|
+
top: scrollPosition
|
|
636
|
+
});
|
|
637
|
+
});
|
|
638
|
+
}
|
|
614
639
|
}
|
|
615
640
|
__decorateClass([
|
|
616
641
|
attr
|
package/shared/definition15.cjs
CHANGED
|
@@ -124,7 +124,7 @@ __decorateClass([
|
|
|
124
124
|
vividElement.observable
|
|
125
125
|
], Checkbox.prototype, "defaultSlottedNodes");
|
|
126
126
|
__decorateClass([
|
|
127
|
-
vividElement.
|
|
127
|
+
vividElement.attr({ attribute: "indeterminate", mode: "boolean" })
|
|
128
128
|
], Checkbox.prototype, "indeterminate");
|
|
129
129
|
__decorateClass([
|
|
130
130
|
vividElement.observable
|
package/shared/definition15.js
CHANGED
|
@@ -122,7 +122,7 @@ __decorateClass([
|
|
|
122
122
|
observable
|
|
123
123
|
], Checkbox.prototype, "defaultSlottedNodes");
|
|
124
124
|
__decorateClass([
|
|
125
|
-
|
|
125
|
+
attr({ attribute: "indeterminate", mode: "boolean" })
|
|
126
126
|
], Checkbox.prototype, "indeterminate");
|
|
127
127
|
__decorateClass([
|
|
128
128
|
observable
|
package/shared/definition16.cjs
CHANGED
|
@@ -160,7 +160,7 @@ class Combobox extends mixins.WithFeedback(
|
|
|
160
160
|
}
|
|
161
161
|
if (this.open) {
|
|
162
162
|
const capturedOption = e.target.closest(
|
|
163
|
-
`option,[role=option]`
|
|
163
|
+
`option,[role=option],[data-vvd-component=option]`
|
|
164
164
|
);
|
|
165
165
|
if (!capturedOption || capturedOption.disabled) {
|
|
166
166
|
return;
|
package/shared/definition16.js
CHANGED
|
@@ -158,7 +158,7 @@ class Combobox extends WithFeedback(
|
|
|
158
158
|
}
|
|
159
159
|
if (this.open) {
|
|
160
160
|
const capturedOption = e.target.closest(
|
|
161
|
-
`option,[role=option]`
|
|
161
|
+
`option,[role=option],[data-vvd-component=option]`
|
|
162
162
|
);
|
|
163
163
|
if (!capturedOption || capturedOption.disabled) {
|
|
164
164
|
return;
|