@vonage/vivid 3.51.0 → 3.52.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/alert/index.cjs +1 -1
- package/alert/index.js +1 -1
- package/appearance-ui/index.cjs +19 -11
- package/appearance-ui/index.js +19 -11
- package/audio-player/index.cjs +2 -1
- package/audio-player/index.js +2 -1
- package/card/index.cjs +1 -1
- package/card/index.js +1 -1
- package/combobox/index.cjs +2 -5
- package/combobox/index.js +2 -5
- package/custom-elements.json +1357 -529
- package/date-picker/index.cjs +3 -6
- package/date-picker/index.js +3 -6
- package/date-range-picker/index.cjs +2 -5
- package/date-range-picker/index.js +2 -5
- package/dialog/index.cjs +1 -1
- package/dialog/index.js +1 -1
- package/elevation/index.cjs +1 -1
- package/elevation/index.js +1 -1
- package/file-picker/index.cjs +0 -2
- package/file-picker/index.js +0 -2
- package/header/index.cjs +1 -1
- package/header/index.js +1 -1
- package/index.cjs +60 -58
- package/index.js +22 -23
- package/lib/avatar/definition.d.ts +1 -1
- package/lib/button/button.d.ts +1 -0
- package/lib/button/definition.d.ts +1 -1
- package/lib/calendar-event/definition.d.ts +1 -1
- package/lib/components.d.ts +1 -0
- package/lib/layout/definition.d.ts +1 -1
- package/lib/menu-item/menu-item.d.ts +3 -0
- package/lib/range-slider/definition.d.ts +3 -0
- package/lib/range-slider/locale.d.ts +4 -0
- package/lib/range-slider/range-slider.d.ts +32 -0
- package/lib/range-slider/range-slider.form-associated.d.ts +10 -0
- package/lib/range-slider/range-slider.template.d.ts +4 -0
- package/lib/range-slider/utils/lerp.d.ts +2 -0
- package/lib/range-slider/utils/roundToStepValue.d.ts +1 -0
- package/lib/slider/slider.template.d.ts +1 -0
- package/lib/split-button/definition.d.ts +1 -1
- package/listbox/index.cjs +23 -22
- package/listbox/index.js +23 -22
- package/locales/en-GB.cjs +4 -0
- package/locales/en-GB.js +4 -0
- package/locales/en-US.cjs +4 -0
- package/locales/en-US.js +4 -0
- package/locales/ja-JP.cjs +5 -1
- package/locales/ja-JP.js +5 -1
- package/locales/zh-CN.cjs +4 -0
- package/locales/zh-CN.js +4 -0
- package/menu/index.cjs +3 -3
- package/menu/index.js +3 -3
- package/menu-item/index.cjs +2 -2
- package/menu-item/index.js +2 -2
- package/number-field/index.cjs +0 -2
- package/number-field/index.js +0 -2
- package/package.json +34 -34
- package/popup/index.cjs +2 -2
- package/popup/index.js +2 -2
- package/range-slider/index.cjs +22 -0
- package/range-slider/index.js +20 -0
- package/select/index.cjs +3 -3
- package/select/index.js +3 -3
- package/selectable-box/index.cjs +1 -1
- package/selectable-box/index.js +1 -1
- package/shared/Reflector.cjs +5 -1
- package/shared/Reflector.js +5 -1
- package/shared/affix.cjs +11 -4
- package/shared/affix.js +12 -4
- package/shared/anchored.cjs +8 -2
- package/shared/anchored.js +8 -2
- package/shared/definition.cjs +8 -3
- package/shared/definition.js +8 -3
- package/shared/definition10.cjs +5 -5
- package/shared/definition10.js +5 -5
- package/shared/definition11.cjs +75 -47
- package/shared/definition11.js +76 -48
- package/shared/definition12.cjs +12 -14
- package/shared/definition12.js +12 -14
- package/shared/definition13.cjs +118 -75
- package/shared/definition13.js +118 -75
- package/shared/definition14.cjs +33 -32
- package/shared/definition14.js +33 -32
- package/shared/definition15.cjs +20 -7
- package/shared/definition15.js +20 -7
- package/shared/definition16.cjs +37 -42
- package/shared/definition16.js +36 -41
- package/shared/definition17.cjs +125 -65
- package/shared/definition17.js +126 -66
- package/shared/definition18.cjs +30 -14
- package/shared/definition18.js +30 -14
- package/shared/definition19.cjs +116 -80
- package/shared/definition19.js +116 -80
- package/shared/definition2.cjs +10 -5
- package/shared/definition2.js +10 -5
- package/shared/definition20.cjs +16 -15
- package/shared/definition20.js +16 -15
- package/shared/definition21.cjs +6 -10
- package/shared/definition21.js +6 -10
- package/shared/definition22.cjs +14 -18
- package/shared/definition22.js +14 -18
- package/shared/definition23.cjs +34 -35
- package/shared/definition23.js +34 -35
- package/shared/definition24.cjs +116 -69
- package/shared/definition24.js +116 -69
- package/shared/definition25.cjs +2 -4
- package/shared/definition25.js +2 -4
- package/shared/definition26.cjs +9 -8
- package/shared/definition26.js +9 -8
- package/shared/definition27.cjs +7 -5
- package/shared/definition27.js +7 -5
- package/shared/definition28.cjs +209 -143
- package/shared/definition28.js +209 -143
- package/shared/definition29.cjs +10 -4
- package/shared/definition29.js +10 -4
- package/shared/definition3.cjs +7 -10
- package/shared/definition3.js +7 -10
- package/shared/definition30.cjs +7 -5
- package/shared/definition30.js +7 -5
- package/shared/definition31.cjs +2 -4
- package/shared/definition31.js +2 -4
- package/shared/definition32.cjs +1 -3
- package/shared/definition32.js +1 -3
- package/shared/definition33.cjs +7 -10
- package/shared/definition33.js +7 -10
- package/shared/definition34.cjs +76 -59
- package/shared/definition34.js +76 -59
- package/shared/definition35.cjs +19 -20
- package/shared/definition35.js +19 -20
- package/shared/definition36.cjs +30 -14
- package/shared/definition36.js +30 -14
- package/shared/definition37.cjs +33 -46
- package/shared/definition37.js +33 -46
- package/shared/definition38.cjs +31 -33
- package/shared/definition38.js +31 -33
- package/shared/definition39.cjs +13 -4
- package/shared/definition39.js +13 -4
- package/shared/definition4.cjs +23 -11
- package/shared/definition4.js +23 -11
- package/shared/definition40.cjs +19 -14
- package/shared/definition40.js +19 -14
- package/shared/definition41.cjs +534 -635
- package/shared/definition41.js +534 -635
- package/shared/definition42.cjs +674 -106
- package/shared/definition42.js +673 -105
- package/shared/definition43.cjs +122 -79
- package/shared/definition43.js +120 -77
- package/shared/definition44.cjs +72 -567
- package/shared/definition44.js +71 -565
- package/shared/definition45.cjs +520 -118
- package/shared/definition45.js +518 -117
- package/shared/definition46.cjs +117 -130
- package/shared/definition46.js +116 -129
- package/shared/definition47.cjs +152 -18
- package/shared/definition47.js +151 -17
- package/shared/definition48.cjs +20 -77
- package/shared/definition48.js +19 -76
- package/shared/definition49.cjs +52 -495
- package/shared/definition49.js +51 -494
- package/shared/definition5.cjs +20 -17
- package/shared/definition5.js +20 -17
- package/shared/definition50.cjs +525 -24
- package/shared/definition50.js +524 -23
- package/shared/definition51.cjs +28 -119
- package/shared/definition51.js +26 -118
- package/shared/definition52.cjs +113 -266
- package/shared/definition52.js +113 -265
- package/shared/definition53.cjs +285 -245
- package/shared/definition53.js +285 -245
- package/shared/definition54.cjs +285 -751
- package/shared/definition54.js +284 -750
- package/shared/definition55.cjs +828 -99
- package/shared/definition55.js +827 -98
- package/shared/definition56.cjs +126 -77
- package/shared/definition56.js +125 -76
- package/shared/definition57.cjs +125 -71
- package/shared/definition57.js +124 -70
- package/shared/definition58.cjs +73 -287
- package/shared/definition58.js +74 -288
- package/shared/definition59.cjs +298 -40
- package/shared/definition59.js +297 -39
- package/shared/definition6.cjs +3 -4
- package/shared/definition6.js +3 -4
- package/shared/definition60.cjs +24 -1784
- package/shared/definition60.js +23 -1783
- package/shared/definition61.cjs +1819 -11
- package/shared/definition61.js +1818 -11
- package/shared/definition7.cjs +6 -4
- package/shared/definition7.js +6 -4
- package/shared/definition8.cjs +25 -18
- package/shared/definition8.js +25 -18
- package/shared/definition9.cjs +6 -9
- package/shared/definition9.js +6 -9
- package/shared/icon.cjs +7 -2
- package/shared/icon.js +7 -2
- package/shared/index2.cjs +1 -1
- package/shared/index2.js +1 -1
- package/shared/key-codes2.cjs +8 -0
- package/shared/key-codes2.js +5 -1
- package/shared/localization/Locale.d.ts +2 -0
- package/shared/patterns/index.d.ts +0 -1
- package/shared/presentationDate.cjs +126 -78
- package/shared/presentationDate.js +126 -78
- package/shared/slider.template.cjs +71 -0
- package/shared/slider.template.js +67 -0
- package/shared/text-anchor.template.cjs +30 -35
- package/shared/text-anchor.template.js +30 -35
- package/shared/text-field.cjs +1 -1
- package/shared/text-field.js +1 -1
- package/side-drawer/index.cjs +1 -1
- package/side-drawer/index.js +1 -1
- package/slider/index.cjs +2 -1
- package/slider/index.js +2 -1
- package/split-button/index.cjs +1 -1
- package/split-button/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/fonts/spezia-variable.css +39 -13
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/styles/tokens/vivid-2-compat.css +4 -2
- package/switch/index.cjs +1 -1
- package/switch/index.js +1 -1
- package/tab/index.cjs +1 -1
- package/tab/index.js +1 -1
- package/tab-panel/index.cjs +1 -1
- package/tab-panel/index.js +1 -1
- package/tabs/index.cjs +3 -3
- package/tabs/index.js +3 -3
- package/tag/index.cjs +1 -1
- package/tag/index.js +1 -1
- package/tag-group/index.cjs +1 -1
- package/tag-group/index.js +1 -1
- package/text-area/index.cjs +1 -1
- package/text-area/index.js +1 -1
- package/text-field/index.cjs +1 -4
- package/text-field/index.js +1 -4
- package/time-picker/index.cjs +4 -7
- package/time-picker/index.js +4 -7
- package/toggletip/index.cjs +3 -3
- package/toggletip/index.js +3 -3
- package/tooltip/index.cjs +3 -3
- package/tooltip/index.js +3 -3
- package/tree-item/index.cjs +1 -1
- package/tree-item/index.js +1 -1
- package/tree-view/index.cjs +1 -1
- package/tree-view/index.js +1 -1
- package/vivid.api.json +117 -1
- package/focus/index.cjs +0 -7
- package/focus/index.js +0 -5
- package/lib/focus/definition.d.ts +0 -3
- package/lib/focus/focus.d.ts +0 -3
- package/lib/focus/focus.template.d.ts +0 -4
- package/lib/popup/popup.d.ts +0 -21
- package/shared/focus.cjs +0 -8
- package/shared/focus.js +0 -6
- package/shared/focus2.cjs +0 -11
- package/shared/focus2.js +0 -9
- package/shared/patterns/focus.d.ts +0 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const definition$2 = require('./definition11.cjs');
|
|
4
|
-
const definition = require('./
|
|
5
|
-
const definition$1 = require('./
|
|
4
|
+
const definition = require('./definition61.cjs');
|
|
5
|
+
const definition$1 = require('./definition54.cjs');
|
|
6
6
|
const definition$3 = require('./definition21.cjs');
|
|
7
7
|
const index = require('./index.cjs');
|
|
8
8
|
const ref = require('./ref.cjs');
|
|
@@ -16,7 +16,7 @@ const trappedFocus = require('./trapped-focus.cjs');
|
|
|
16
16
|
const formAssociated = require('./form-associated.cjs');
|
|
17
17
|
const applyMixins = require('./apply-mixins.cjs');
|
|
18
18
|
|
|
19
|
-
const styles = ":host{display:inline-block}.base{display:inline-block;inline-size:100%}.control{inline-size:100%}.dialog{display:inline-flex;flex-direction:column;padding:12px;gap:12px}.dialog .footer{display:flex;align-items:center;justify-content:flex-end;padding:8px;gap:8px}.segments{display:flex;gap:24px}.segment{display:flex;flex-direction:column;gap:12px}.segment .header{display:flex;align-items:center;padding-block:8px}.segment .title{display:flex;flex-grow:1;justify-content:center}.segment .title-action{block-size:24px;
|
|
19
|
+
const styles = ":host{display:inline-block}.base{display:inline-block;inline-size:100%}.control{inline-size:100%}.dialog{display:inline-flex;flex-direction:column;padding:12px;gap:12px}.dialog .footer{display:flex;align-items:center;justify-content:flex-end;padding:8px;gap:8px}.segments{display:flex;gap:24px}.segment{display:flex;flex-direction:column;gap:12px}.segment .header{display:flex;align-items:center;padding-block:8px}.segment .title{display:flex;flex-grow:1;justify-content:center}.segment .title-action{border-radius:8px;block-size:24px;font:var(--vvd-typography-base-extended);padding-inline:6px}.calendar{display:flex;flex-direction:column;margin-top:8px;gap:4px}.calendar .calendar-separator{margin-inline:10px}.calendar .calendar-weekdays{display:flex;justify-content:center}.calendar .calendar-weekday{display:inline-flex;align-items:center;justify-content:center;block-size:16px;font:var(--vvd-typography-base-condensed);inline-size:40px}.calendar .calendar-week{display:flex;justify-content:center}.calendar .calendar-day{display:inline-flex;align-items:center;justify-content:center;border-radius:50%;aspect-ratio:1/1;block-size:28px;font:var(--vvd-typography-base);margin-inline:6px;--focus-inset: -2px}.calendar .calendar-day.start,.calendar .calendar-day.end{border:2px solid var(--vvd-color-cta-50);background-color:var(--vvd-color-cta-200)}.calendar .calendar-day:before,.calendar .calendar-day:after{position:absolute;z-index:-1;display:block;width:20px;height:28px}.calendar .calendar-day:before{right:50%}.calendar .calendar-day:after{left:50%}.calendar .calendar-day.range:before,.calendar .calendar-day.range:after{background-color:var(--vvd-color-cta-50)}.calendar .calendar-day.range:not(.start):before,.calendar .calendar-day.range:not(.end):after{content:\"\"}.calendar .calendar-day.outside-month,.calendar .calendar-day:disabled{color:var(--vvd-color-neutral-400)}.months-separator{margin-inline:-12px}.month-grid{display:flex;flex-direction:column;gap:34px}.month-grid .months-row{display:flex;justify-content:center;gap:29px}.month-grid .month{display:inline-flex;align-items:center;justify-content:center;border-radius:50%;aspect-ratio:1/1;block-size:48px;font:var(--vvd-typography-base-extended);text-transform:uppercase}.month-grid .month:disabled{color:var(--vvd-color-neutral-400)}.button{position:relative;padding:0;border:none;background-color:var(--_appearance-color-fill);color:var(--_appearance-color-text);cursor:pointer}.button{--_connotation-color-primary: var(--vvd-date-picker-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-firm: var(--vvd-date-picker-accent-firm, var(--vvd-color-canvas-text));--_connotation-color-faint: var(--vvd-date-picker-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-soft: var(--vvd-date-picker-accent-soft, var(--vvd-color-neutral-100));--_connotation-color-dim: var(--vvd-date-picker-accent-dim, var(--vvd-color-neutral-200));--_connotation-color-pale: var(--vvd-date-picker-accent-pale, var(--vvd-color-neutral-300))}.button{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.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}.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}.button:where(.selected):where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.button:where(.selected):where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-dim);--_appearance-color-outline: transparent}.button:where(.selected):where(.disabled,:disabled){--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-200);--_appearance-color-outline: transparent}.button:focus-visible{--focus-stroke-gap-color: transparent;box-shadow:inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));outline-offset:calc(-2px - var(--focus-inset, 0px));color:var(--vvd-color-canvas-text)}.button.current{border:1px solid var(--vvd-color-neutral-200)}.button:disabled{cursor:not-allowed}\n";
|
|
20
20
|
|
|
21
21
|
function _typeof(obj) {
|
|
22
22
|
"@babel/helpers - typeof";
|
|
@@ -5279,26 +5279,32 @@ function renderDialogHeader(context) {
|
|
|
5279
5279
|
`
|
|
5280
5280
|
)}
|
|
5281
5281
|
<div class="title">
|
|
5282
|
-
${when.when(
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
|
|
5286
|
-
|
|
5287
|
-
|
|
5288
|
-
|
|
5289
|
-
|
|
5290
|
-
|
|
5291
|
-
|
|
5292
|
-
|
|
5293
|
-
|
|
5294
|
-
|
|
5295
|
-
|
|
5296
|
-
|
|
5297
|
-
|
|
5298
|
-
|
|
5299
|
-
|
|
5300
|
-
|
|
5301
|
-
|
|
5282
|
+
${when.when(
|
|
5283
|
+
(x) => x.titleClickable,
|
|
5284
|
+
index.html`
|
|
5285
|
+
<button
|
|
5286
|
+
tabindex="1"
|
|
5287
|
+
id="${(x) => `grid-label-${x.id}`}"
|
|
5288
|
+
class="title-action button"
|
|
5289
|
+
aria-live="polite"
|
|
5290
|
+
@click="${(_, c) => c.parent._onTitleActionClick()}"
|
|
5291
|
+
>
|
|
5292
|
+
${(x) => x.title}
|
|
5293
|
+
</button>
|
|
5294
|
+
`
|
|
5295
|
+
)}
|
|
5296
|
+
${when.when(
|
|
5297
|
+
(x) => !x.titleClickable,
|
|
5298
|
+
index.html`
|
|
5299
|
+
<div
|
|
5300
|
+
id="${(x) => `grid-label-${x.id}`}"
|
|
5301
|
+
class="title-action"
|
|
5302
|
+
aria-live="polite"
|
|
5303
|
+
>
|
|
5304
|
+
${(x) => x.title}
|
|
5305
|
+
</div>
|
|
5306
|
+
`
|
|
5307
|
+
)}
|
|
5302
5308
|
</div>
|
|
5303
5309
|
|
|
5304
5310
|
${when.when(
|
|
@@ -5355,9 +5361,8 @@ function renderCalendarGrid(context) {
|
|
|
5355
5361
|
<${dividerTag} class="calendar-separator" role="presentation"></${dividerTag}>
|
|
5356
5362
|
${repeat.repeat(
|
|
5357
5363
|
(x) => x.calendar.grid,
|
|
5358
|
-
index.html`
|
|
5359
|
-
|
|
5360
|
-
${repeat.repeat(
|
|
5364
|
+
index.html` <div class="calendar-week" role="row">
|
|
5365
|
+
${repeat.repeat(
|
|
5361
5366
|
(x) => x,
|
|
5362
5367
|
index.html`
|
|
5363
5368
|
${when.when(
|
|
@@ -5366,40 +5371,60 @@ function renderCalendarGrid(context) {
|
|
|
5366
5371
|
)}
|
|
5367
5372
|
${when.when(
|
|
5368
5373
|
(x, c) => !c.parentContext.parentContext.parent._hideDatesOutsideMonth || !x.isOutsideMonth,
|
|
5369
|
-
index.html`
|
|
5370
|
-
|
|
5371
|
-
|
|
5372
|
-
class="${(x, c) => classNames.classNames(
|
|
5374
|
+
index.html` <span role="gridcell">
|
|
5375
|
+
<button
|
|
5376
|
+
class="${(x, c) => classNames.classNames(
|
|
5373
5377
|
"calendar-day",
|
|
5374
5378
|
"button",
|
|
5375
|
-
[
|
|
5376
|
-
|
|
5377
|
-
|
|
5378
|
-
|
|
5379
|
-
[
|
|
5379
|
+
[
|
|
5380
|
+
"current",
|
|
5381
|
+
x.date === c.parentContext.parentContext.parent._currentDate
|
|
5382
|
+
],
|
|
5383
|
+
[
|
|
5384
|
+
"selected",
|
|
5385
|
+
c.parentContext.parentContext.parent._isDateSelected(x.date)
|
|
5386
|
+
],
|
|
5387
|
+
[
|
|
5388
|
+
"range",
|
|
5389
|
+
c.parentContext.parentContext.parent._isDateInSelectedRange(
|
|
5390
|
+
x.date
|
|
5391
|
+
)
|
|
5392
|
+
],
|
|
5393
|
+
[
|
|
5394
|
+
"start",
|
|
5395
|
+
c.parentContext.parentContext.parent._isDateRangeStart(
|
|
5396
|
+
x.date
|
|
5397
|
+
)
|
|
5398
|
+
],
|
|
5399
|
+
[
|
|
5400
|
+
"end",
|
|
5401
|
+
c.parentContext.parentContext.parent._isDateRangeEnd(x.date)
|
|
5402
|
+
],
|
|
5380
5403
|
["outside-month", x.isOutsideMonth]
|
|
5381
5404
|
)}"
|
|
5382
|
-
|
|
5383
|
-
|
|
5384
|
-
|
|
5385
|
-
|
|
5386
|
-
|
|
5387
|
-
|
|
5388
|
-
|
|
5389
|
-
|
|
5390
|
-
|
|
5405
|
+
?disabled="${(x, c) => !c.parentContext.parentContext.parent._isDateInValidRange(
|
|
5406
|
+
x.date
|
|
5407
|
+
)}"
|
|
5408
|
+
tabindex="${(x, c) => x.date === c.parentContext.parentContext.parent._tabbableDate ? 2 : -1}"
|
|
5409
|
+
aria-selected="${(x, c) => c.parentContext.parentContext.parent._isDateAriaSelected(x.date)}"
|
|
5410
|
+
data-date="${(x) => x.date}"
|
|
5411
|
+
@click="${(x, c) => c.parentContext.parentContext.parent._onDateClick(x.date)}"
|
|
5412
|
+
@focus="${(x, c) => c.parentContext.parentContext.parent._onDateFocus(x.date)}"
|
|
5413
|
+
@mouseenter="${(x, c) => c.parentContext.parentContext.parent._onDateMouseEnter(x.date)}"
|
|
5414
|
+
@mouseleave="${(x, c) => c.parentContext.parentContext.parent._onDateMouseLeave(x.date)}"
|
|
5415
|
+
@keydown="${(x, c) => c.parentContext.parentContext.parent._onDateKeydown(
|
|
5391
5416
|
x.date,
|
|
5392
5417
|
c.event
|
|
5393
5418
|
)}"
|
|
5394
|
-
|
|
5395
|
-
|
|
5396
|
-
|
|
5397
|
-
|
|
5419
|
+
>
|
|
5420
|
+
${(x) => x.label}
|
|
5421
|
+
</button>
|
|
5422
|
+
</span>`
|
|
5398
5423
|
)}
|
|
5399
5424
|
</div>
|
|
5400
5425
|
`
|
|
5401
5426
|
)}
|
|
5402
|
-
|
|
5427
|
+
</div>`
|
|
5403
5428
|
)}`;
|
|
5404
5429
|
}
|
|
5405
5430
|
function renderMonthPickerGrid(context) {
|
|
@@ -5421,9 +5446,9 @@ function renderMonthPickerGrid(context) {
|
|
|
5421
5446
|
${repeat.repeat(
|
|
5422
5447
|
(x) => x,
|
|
5423
5448
|
index.html`
|
|
5424
|
-
|
|
5425
|
-
|
|
5426
|
-
|
|
5449
|
+
<span role="gridcell">
|
|
5450
|
+
<button
|
|
5451
|
+
class="${(x, c) => classNames.classNames(
|
|
5427
5452
|
"month",
|
|
5428
5453
|
"button",
|
|
5429
5454
|
[
|
|
@@ -5441,24 +5466,33 @@ function renderMonthPickerGrid(context) {
|
|
|
5441
5466
|
)
|
|
5442
5467
|
]
|
|
5443
5468
|
)}"
|
|
5444
|
-
|
|
5445
|
-
|
|
5446
|
-
|
|
5469
|
+
tabindex="${(x, c) => c.parentContext.parentContext.parent._tabbableMonth && areMonthsEqual(
|
|
5470
|
+
x.month,
|
|
5471
|
+
c.parentContext.parentContext.parent._tabbableMonth
|
|
5472
|
+
) ? 2 : -1}"
|
|
5473
|
+
aria-label="${(x) => x.monthName}"
|
|
5474
|
+
aria-selected="${(x, c) => areMonthsEqual(
|
|
5447
5475
|
x.month,
|
|
5448
5476
|
c.parentContext.parentContext.parent._selectedMonth
|
|
5449
5477
|
)}"
|
|
5450
|
-
|
|
5451
|
-
|
|
5452
|
-
|
|
5453
|
-
|
|
5454
|
-
|
|
5478
|
+
data-month="${(x) => monthToStr(x.month)}"
|
|
5479
|
+
?disabled="${(x, c) => !c.parentContext.parentContext.parent._isMonthInValidRange(
|
|
5480
|
+
x.month
|
|
5481
|
+
)}"
|
|
5482
|
+
@click="${(x, c) => c.parentContext.parentContext.parent._onMonthClick(
|
|
5483
|
+
x.month
|
|
5484
|
+
)}"
|
|
5485
|
+
@focus="${(x, c) => c.parentContext.parentContext.parent._onMonthFocus(
|
|
5486
|
+
x.month
|
|
5487
|
+
)}"
|
|
5488
|
+
@keydown="${(x, c) => c.parentContext.parentContext.parent._onMonthKeydown(
|
|
5455
5489
|
x.month,
|
|
5456
5490
|
c.event
|
|
5457
5491
|
)}"
|
|
5458
|
-
|
|
5459
|
-
|
|
5460
|
-
|
|
5461
|
-
|
|
5492
|
+
>
|
|
5493
|
+
${(x) => x.label}
|
|
5494
|
+
</button>
|
|
5495
|
+
</span>
|
|
5462
5496
|
`
|
|
5463
5497
|
)}
|
|
5464
5498
|
</div>
|
|
@@ -5508,18 +5542,17 @@ const DatePickerBaseTemplate = (context, _) => {
|
|
|
5508
5542
|
<div class="segments">
|
|
5509
5543
|
${repeat.repeat(
|
|
5510
5544
|
(x) => x._segments,
|
|
5511
|
-
index.html`
|
|
5512
|
-
|
|
5513
|
-
|
|
5514
|
-
${when.when(
|
|
5545
|
+
index.html` <div class="segment">
|
|
5546
|
+
${renderDialogHeader(context)}
|
|
5547
|
+
${when.when(
|
|
5515
5548
|
(x) => x.type === "month-picker",
|
|
5516
5549
|
index.html`${renderMonthPickerGrid(context)}`
|
|
5517
5550
|
)}
|
|
5518
|
-
|
|
5551
|
+
${when.when(
|
|
5519
5552
|
(x) => x.type === "calendar",
|
|
5520
5553
|
index.html`${renderCalendarGrid(context)}`
|
|
5521
5554
|
)}
|
|
5522
|
-
|
|
5555
|
+
</div>`
|
|
5523
5556
|
)}
|
|
5524
5557
|
</div>
|
|
5525
5558
|
<div class="footer">
|
|
@@ -5576,7 +5609,12 @@ const buildDateGrid = ({ month, year }, getDay) => {
|
|
|
5576
5609
|
let week = [];
|
|
5577
5610
|
for (let i = 0; i < totalDaysInCalendar; i++) {
|
|
5578
5611
|
const dayIndexInMonth = i - firstDayInWeek;
|
|
5579
|
-
week.push(
|
|
5612
|
+
week.push(
|
|
5613
|
+
gridDate(
|
|
5614
|
+
addDays$1(firstDay, dayIndexInMonth),
|
|
5615
|
+
isOutsideMonth(dayIndexInMonth, daysInMonth)
|
|
5616
|
+
)
|
|
5617
|
+
);
|
|
5580
5618
|
if (week.length === 7) {
|
|
5581
5619
|
grid.push(week);
|
|
5582
5620
|
week = [];
|
|
@@ -5619,7 +5657,9 @@ const yearOfDate = (dateStr) => {
|
|
|
5619
5657
|
|
|
5620
5658
|
class _DatePickerBase extends index.FoundationElement {
|
|
5621
5659
|
}
|
|
5622
|
-
class FormAssociatedDatePickerBase extends formAssociated.FormAssociated(
|
|
5660
|
+
class FormAssociatedDatePickerBase extends formAssociated.FormAssociated(
|
|
5661
|
+
_DatePickerBase
|
|
5662
|
+
) {
|
|
5623
5663
|
constructor() {
|
|
5624
5664
|
super(...arguments);
|
|
5625
5665
|
this.proxy = document.createElement("input");
|
|
@@ -5724,7 +5764,10 @@ class DatePickerBase extends FormAssociatedDatePickerBase {
|
|
|
5724
5764
|
_adjustSelectedMonthToEnsureVisibilityOf(date) {
|
|
5725
5765
|
const month = monthOfDate(date);
|
|
5726
5766
|
const firstDisplayedMonth = this._selectedMonth;
|
|
5727
|
-
const lastDisplayedMonth = addMonths(
|
|
5767
|
+
const lastDisplayedMonth = addMonths(
|
|
5768
|
+
this._selectedMonth,
|
|
5769
|
+
this._numCalendars - 1
|
|
5770
|
+
);
|
|
5728
5771
|
if (compareMonths(month, firstDisplayedMonth) < 0) {
|
|
5729
5772
|
this._selectedMonth = month;
|
|
5730
5773
|
return true;
|
|
@@ -5834,7 +5877,9 @@ class DatePickerBase extends FormAssociatedDatePickerBase {
|
|
|
5834
5877
|
} else {
|
|
5835
5878
|
this.#openPopupIfPossible();
|
|
5836
5879
|
index.DOM.processUpdates();
|
|
5837
|
-
const tabbableDate = this.shadowRoot.querySelector(
|
|
5880
|
+
const tabbableDate = this.shadowRoot.querySelector(
|
|
5881
|
+
`[data-date="${this._tabbableDate}"]`
|
|
5882
|
+
);
|
|
5838
5883
|
tabbableDate.focus();
|
|
5839
5884
|
}
|
|
5840
5885
|
}
|
|
@@ -6015,9 +6060,9 @@ class DatePickerBase extends FormAssociatedDatePickerBase {
|
|
|
6015
6060
|
this._lastFocussedDate = date;
|
|
6016
6061
|
}
|
|
6017
6062
|
get _tabbableDate() {
|
|
6018
|
-
const datesInSegments = this._segments.filter(
|
|
6019
|
-
(segment) => segment.
|
|
6020
|
-
);
|
|
6063
|
+
const datesInSegments = this._segments.filter(
|
|
6064
|
+
(segment) => segment.type === "calendar"
|
|
6065
|
+
).flatMap((segment) => segment.calendar.grid.flat().map((d) => d.date));
|
|
6021
6066
|
const candidates = [
|
|
6022
6067
|
this._lastFocussedDate,
|
|
6023
6068
|
...this._getSelectedDates(),
|
|
@@ -6025,7 +6070,10 @@ class DatePickerBase extends FormAssociatedDatePickerBase {
|
|
|
6025
6070
|
...datesInSegments
|
|
6026
6071
|
];
|
|
6027
6072
|
const firstVisibleMonth = this._selectedMonth;
|
|
6028
|
-
const lastVisibleMonth = addMonths(
|
|
6073
|
+
const lastVisibleMonth = addMonths(
|
|
6074
|
+
this._selectedMonth,
|
|
6075
|
+
this._numCalendars - 1
|
|
6076
|
+
);
|
|
6029
6077
|
return candidates.find(
|
|
6030
6078
|
(date) => date && compareMonths(monthOfDate(date), firstVisibleMonth) >= 0 && compareMonths(monthOfDate(date), lastVisibleMonth) <= 0 && this._isDateInValidRange(date)
|
|
6031
6079
|
) ?? null;
|