@vonage/vivid 5.4.0 → 5.5.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/bundled/base-color-picker.cjs +18 -13
- package/bundled/base-color-picker.js +98 -81
- package/bundled/calendar-picker.template.cjs +1 -1
- package/bundled/calendar-picker.template.js +2 -2
- package/bundled/char-count.cjs +1 -1
- package/bundled/char-count.js +1 -1
- package/bundled/definition10.cjs +1 -1
- package/bundled/definition10.js +2 -2
- package/bundled/definition11.cjs +12 -19
- package/bundled/definition11.js +73 -204
- package/bundled/definition12.cjs +19 -10
- package/bundled/definition12.js +217 -36
- package/bundled/definition13.cjs +10 -1
- package/bundled/definition13.js +38 -14
- package/bundled/definition14.cjs +1 -5
- package/bundled/definition14.js +15 -24
- package/bundled/definition15.cjs +5 -30
- package/bundled/definition15.js +22 -73
- package/bundled/definition16.cjs +30 -19
- package/bundled/definition16.js +74 -97
- package/bundled/definition17.cjs +19 -13
- package/bundled/definition17.js +83 -117
- package/bundled/definition18.cjs +13 -12
- package/bundled/definition18.js +114 -71
- package/bundled/definition19.cjs +16 -16
- package/bundled/definition19.js +87 -84
- package/bundled/definition2.cjs +9 -9
- package/bundled/definition2.js +84 -129
- package/bundled/definition3.cjs +1 -1
- package/bundled/definition3.js +1 -1
- package/bundled/listbox.cjs +1 -1
- package/bundled/listbox.js +1 -1
- package/bundled/localized.cjs +1 -1
- package/bundled/localized.js +48 -35
- package/bundled/mixins.cjs +1 -1
- package/bundled/mixins.js +1 -1
- package/bundled/picker-field.template.cjs +14 -14
- package/bundled/picker-field.template.js +35 -56
- package/bundled/time-selection-picker.template.cjs +12 -12
- package/bundled/time-selection-picker.template.js +13 -12
- package/bundled/trapped-focus.cjs +1 -0
- package/bundled/trapped-focus.js +26 -0
- package/bundled/vivid-element.cjs +1 -1
- package/bundled/vivid-element.js +1 -1
- package/calendar/index.cjs +13 -13
- package/calendar/index.js +172 -144
- package/color-picker/definition.cjs +208 -112
- package/color-picker/definition.js +208 -112
- package/color-picker/index.cjs +104 -75
- package/color-picker/index.js +412 -326
- package/combobox/index.cjs +1 -1
- package/combobox/index.js +1 -1
- package/contextual-help/index.cjs +1 -1
- package/contextual-help/index.js +1 -1
- package/custom-elements.json +49 -0
- package/data-grid/index.cjs +1 -1
- package/data-grid/index.js +1 -1
- package/date-picker/index.cjs +1 -1
- package/date-picker/index.js +2 -2
- package/date-range-picker/index.cjs +1 -1
- package/date-range-picker/index.js +2 -2
- package/date-time-picker/index.cjs +1 -1
- package/date-time-picker/index.js +2 -2
- package/dial-pad/definition.cjs +139 -0
- package/dial-pad/definition.js +139 -0
- package/dial-pad/index.cjs +27 -20
- package/dial-pad/index.js +177 -100
- package/divider/index.cjs +1 -1
- package/divider/index.js +1 -1
- package/icon/definition.cjs +56 -22
- package/icon/definition.js +56 -22
- package/lib/color-picker/color-picker.d.ts +390 -12
- package/lib/color-picker/locale.d.ts +4 -0
- package/lib/date-picker/date-picker.d.ts +38 -38
- package/lib/date-range-picker/date-range-picker.d.ts +20 -20
- package/lib/date-time-picker/date-time-picker.d.ts +40 -40
- package/lib/dial-pad/dial-pad.d.ts +1 -0
- package/lib/icon/icon.d.ts +1 -0
- package/lib/simple-color-picker/simple-color-picker.d.ts +2 -1
- package/lib/time-picker/time-picker.d.ts +20 -20
- package/locales/de-DE.cjs +16 -3
- package/locales/de-DE.js +16 -3
- package/locales/en-GB.cjs +17 -4
- package/locales/en-GB.js +17 -4
- package/locales/en-US.cjs +17 -4
- package/locales/en-US.js +17 -4
- package/locales/ja-JP.cjs +16 -3
- package/locales/ja-JP.js +16 -3
- package/locales/zh-CN.cjs +15 -2
- package/locales/zh-CN.js +15 -2
- package/number-field/index.cjs +1 -1
- package/number-field/index.js +3 -3
- package/option/index.cjs +1 -1
- package/option/index.js +1 -1
- package/package.json +1 -1
- package/progress-ring/index.cjs +1 -1
- package/progress-ring/index.js +1 -1
- package/radio/index.cjs +1 -1
- package/radio/index.js +1 -1
- package/radio-group/index.cjs +1 -1
- package/radio-group/index.js +1 -1
- package/rich-text-editor/index.cjs +1 -1
- package/rich-text-editor/index.js +3 -3
- package/searchable-select/index.cjs +1 -1
- package/searchable-select/index.js +3 -3
- package/select/definition.cjs +6 -3
- package/select/definition.js +6 -3
- package/selectable-box/index.cjs +1 -1
- package/selectable-box/index.js +1 -1
- package/shared/color-picker/base-color-picker.d.ts +2 -1
- package/shared/picker-field/mixins/calendar-picker.d.ts +10 -10
- package/shared/picker-field/mixins/calendar-picker.template.d.ts +10 -10
- package/shared/picker-field/mixins/min-max-calendar-picker.d.ts +20 -20
- package/shared/picker-field/mixins/single-date-picker.d.ts +28 -28
- package/shared/picker-field/mixins/single-value-picker.d.ts +8 -8
- package/shared/picker-field/mixins/time-selection-picker.d.ts +20 -20
- package/shared/picker-field/mixins/time-selection-picker.template.d.ts +20 -20
- package/simple-color-picker/definition.cjs +8 -6
- package/simple-color-picker/definition.js +8 -6
- package/simple-color-picker/index.cjs +6 -6
- package/simple-color-picker/index.js +41 -39
- package/styles/core/all.css +1 -1
- package/styles/core/theme.css +1 -1
- package/styles/core/typography.css +1 -1
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/styles/tokens/vivid-2-compat.css +1 -1
- package/tag/definition.cjs +34 -14
- package/tag/definition.js +34 -14
- package/tag/index.cjs +25 -12
- package/tag/index.js +64 -47
- package/tag-group/definition.cjs +1 -2
- package/tag-group/definition.js +1 -2
- package/tag-group/index.cjs +1 -1
- package/tag-group/index.js +11 -12
- package/text-area/index.cjs +1 -1
- package/text-area/index.js +2 -2
- package/time-picker/index.cjs +1 -1
- package/time-picker/index.js +1 -1
- package/toggletip/index.cjs +1 -1
- package/toggletip/index.js +1 -1
- package/tooltip/definition.cjs +2 -2
- package/tooltip/definition.js +2 -2
- package/tooltip/index.cjs +1 -1
- package/tooltip/index.js +1 -1
- package/unbundled/base-color-picker.cjs +36 -18
- package/unbundled/base-color-picker.js +36 -18
- package/unbundled/calendar-picker.template.cjs +1 -1
- package/unbundled/calendar-picker.template.js +1 -1
- package/unbundled/picker-field.template.cjs +2 -35
- package/unbundled/picker-field.template.js +2 -34
- package/unbundled/time-selection-picker.template.cjs +2 -1
- package/unbundled/time-selection-picker.template.js +2 -1
- package/unbundled/trapped-focus.cjs +37 -0
- package/unbundled/trapped-focus.js +34 -0
- package/unbundled/vivid-element.cjs +1 -1
- package/unbundled/vivid-element.js +1 -1
- package/visually-hidden/index.cjs +1 -1
- package/visually-hidden/index.js +1 -1
- package/bundled/_has.cjs +0 -1
- package/bundled/_has.js +0 -34
|
@@ -7,7 +7,7 @@ const divider = require('./divider.cjs');
|
|
|
7
7
|
const button_definition = require('./definition.cjs');
|
|
8
8
|
const visuallyHidden_definition = require('../visually-hidden/definition.cjs');
|
|
9
9
|
|
|
10
|
-
const calendarStyles = ".segments{display:inline-flex
|
|
10
|
+
const calendarStyles = ".segments{gap:24px}@media (width >= 648px){.segments{display:inline-flex}}.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:8px}.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}.calendar .calendar-day.start,.calendar .calendar-day.end{border:2px solid var(--vvd-color-cta-50);background-color:var(--vvd-color-cta-200)}.calendar:focus-visible .calendar .calendar-day.start,.calendar:focus-visible .calendar .calendar-day.end{border-width:3px}.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{--_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}@media (hover: hover){.button: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.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:active:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.button.active:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.button.selected:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}@media (hover: hover){.button.selected: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.selected.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.selected:disabled{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-200);--_appearance-color-outline: transparent}.button.selected.disabled{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-200);--_appearance-color-outline: transparent}.button{position:relative;padding:0;border:none;background-color:var(--_appearance-color-fill);color:var(--_appearance-color-text);cursor:pointer}.button:disabled{cursor:not-allowed}.button:focus:not(.title-action),.button.title-action:focus-visible{--focus-stroke-gap-color: transparent;color:var(--vvd-color-canvas-text);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))}.button:focus:not(.title-action).start,.button:focus:not(.title-action).end,.button.title-action:focus-visible.start,.button.title-action:focus-visible.end{border-width:3px}.button.current{border:1px solid var(--vvd-color-neutral-200)}.button.selected{border:1px solid var(--vvd-color-neutral-900)}";
|
|
11
11
|
|
|
12
12
|
const formatDateStr = (date) => dateFns.formatISO(date, { representation: "date" });
|
|
13
13
|
const currentDateStr = (now = /* @__PURE__ */ new Date()) => formatDateStr(now);
|
|
@@ -5,7 +5,7 @@ import { D as Divider } from './divider.js';
|
|
|
5
5
|
import { B as Button } from './definition.js';
|
|
6
6
|
import { VwcVisuallyHiddenElement as VisuallyHidden } from '../visually-hidden/definition.js';
|
|
7
7
|
|
|
8
|
-
const calendarStyles = ".segments{display:inline-flex
|
|
8
|
+
const calendarStyles = ".segments{gap:24px}@media (width >= 648px){.segments{display:inline-flex}}.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:8px}.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}.calendar .calendar-day.start,.calendar .calendar-day.end{border:2px solid var(--vvd-color-cta-50);background-color:var(--vvd-color-cta-200)}.calendar:focus-visible .calendar .calendar-day.start,.calendar:focus-visible .calendar .calendar-day.end{border-width:3px}.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{--_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}@media (hover: hover){.button: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.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:active:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.button.active:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.button.selected:where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}@media (hover: hover){.button.selected: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.selected.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.selected:disabled{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-200);--_appearance-color-outline: transparent}.button.selected.disabled{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-200);--_appearance-color-outline: transparent}.button{position:relative;padding:0;border:none;background-color:var(--_appearance-color-fill);color:var(--_appearance-color-text);cursor:pointer}.button:disabled{cursor:not-allowed}.button:focus:not(.title-action),.button.title-action:focus-visible{--focus-stroke-gap-color: transparent;color:var(--vvd-color-canvas-text);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))}.button:focus:not(.title-action).start,.button:focus:not(.title-action).end,.button.title-action:focus-visible.start,.button.title-action:focus-visible.end{border-width:3px}.button.current{border:1px solid var(--vvd-color-neutral-200)}.button.selected{border:1px solid var(--vvd-color-neutral-900)}";
|
|
9
9
|
|
|
10
10
|
const formatDateStr = (date) => formatISO(date, { representation: "date" });
|
|
11
11
|
const currentDateStr = (now = /* @__PURE__ */ new Date()) => formatDateStr(now);
|
|
@@ -8,45 +8,13 @@ const vividElement = require('./vivid-element.cjs');
|
|
|
8
8
|
const withContextualHelp = require('./with-contextual-help.cjs');
|
|
9
9
|
const withErrorText = require('./with-error-text.cjs');
|
|
10
10
|
const formElement = require('./form-element.cjs');
|
|
11
|
+
const trappedFocus = require('./trapped-focus.cjs');
|
|
11
12
|
const localized = require('./localized.cjs');
|
|
12
13
|
const fastWebUtilities = require('@microsoft/fast-web-utilities');
|
|
13
14
|
const popup_definition = require('./definition5.cjs');
|
|
14
15
|
const textField_definition = require('../text-field/definition.cjs');
|
|
15
16
|
const button_definition = require('./definition.cjs');
|
|
16
17
|
|
|
17
|
-
const ignoredEvents = /* @__PURE__ */ new WeakSet();
|
|
18
|
-
const ignoreEventInFocusTraps = (event) => {
|
|
19
|
-
ignoredEvents.add(event);
|
|
20
|
-
};
|
|
21
|
-
const TrappedFocus = (Base) => {
|
|
22
|
-
class TrappedFocusElement extends Base {
|
|
23
|
-
/**
|
|
24
|
-
* @returns Whether focus was trapped.
|
|
25
|
-
* @internal
|
|
26
|
-
*/
|
|
27
|
-
_trappedFocus(event, getFocusableEls) {
|
|
28
|
-
if (!ignoredEvents.has(event) && event.key === "Tab") {
|
|
29
|
-
const focusableEls = getFocusableEls();
|
|
30
|
-
const firstFocusableEl = focusableEls[0];
|
|
31
|
-
const lastFocusableEl = focusableEls[focusableEls.length - 1];
|
|
32
|
-
if (event.shiftKey) {
|
|
33
|
-
if (this.shadowRoot.activeElement === firstFocusableEl) {
|
|
34
|
-
lastFocusableEl.focus();
|
|
35
|
-
return true;
|
|
36
|
-
}
|
|
37
|
-
} else {
|
|
38
|
-
if (this.shadowRoot.activeElement === lastFocusableEl) {
|
|
39
|
-
firstFocusableEl.focus();
|
|
40
|
-
return true;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
return false;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
return TrappedFocusElement;
|
|
48
|
-
};
|
|
49
|
-
|
|
50
18
|
const pickerFieldStyles = ":host{display:inline-block}.base{display:inline-block;inline-size:100%}.control{inline-size:100%}.dialog{display:inline-flex;flex-direction:column}.dialog--padded{padding:12px;gap:12px}.dialog .footer{display:flex;align-items:center;justify-content:flex-end;padding:8px;gap:8px}.dialog .footer--with-separator{border-top:1px solid var(--vvd-color-neutral-200)}";
|
|
51
19
|
|
|
52
20
|
var __defProp = Object.defineProperty;
|
|
@@ -61,7 +29,7 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
61
29
|
class PickerField extends withContextualHelp.WithContextualHelp(
|
|
62
30
|
mixins.WithFeedback(
|
|
63
31
|
withErrorText.WithErrorText(
|
|
64
|
-
formElement.FormElement(TrappedFocus(localized.Localized(formAssociated.FormAssociated(vividElement.VividElement))))
|
|
32
|
+
formElement.FormElement(trappedFocus.TrappedFocus(localized.Localized(formAssociated.FormAssociated(vividElement.VividElement))))
|
|
65
33
|
)
|
|
66
34
|
)
|
|
67
35
|
) {
|
|
@@ -308,5 +276,4 @@ const PickerFieldTemplate = (context, popupContentTemplate, { withSeparator, pad
|
|
|
308
276
|
|
|
309
277
|
exports.PickerField = PickerField;
|
|
310
278
|
exports.PickerFieldTemplate = PickerFieldTemplate;
|
|
311
|
-
exports.ignoreEventInFocusTraps = ignoreEventInFocusTraps;
|
|
312
279
|
exports.pickerFieldStyles = pickerFieldStyles;
|
|
@@ -6,45 +6,13 @@ import { V as VividElement } from './vivid-element.js';
|
|
|
6
6
|
import { W as WithContextualHelp } from './with-contextual-help.js';
|
|
7
7
|
import { W as WithErrorText } from './with-error-text.js';
|
|
8
8
|
import { F as FormElement } from './form-element.js';
|
|
9
|
+
import { T as TrappedFocus } from './trapped-focus.js';
|
|
9
10
|
import { L as Localized } from './localized.js';
|
|
10
11
|
import { classNames } from '@microsoft/fast-web-utilities';
|
|
11
12
|
import { P as Popup } from './definition5.js';
|
|
12
13
|
import { VwcTextFieldElement as TextField } from '../text-field/definition.js';
|
|
13
14
|
import { B as Button } from './definition.js';
|
|
14
15
|
|
|
15
|
-
const ignoredEvents = /* @__PURE__ */ new WeakSet();
|
|
16
|
-
const ignoreEventInFocusTraps = (event) => {
|
|
17
|
-
ignoredEvents.add(event);
|
|
18
|
-
};
|
|
19
|
-
const TrappedFocus = (Base) => {
|
|
20
|
-
class TrappedFocusElement extends Base {
|
|
21
|
-
/**
|
|
22
|
-
* @returns Whether focus was trapped.
|
|
23
|
-
* @internal
|
|
24
|
-
*/
|
|
25
|
-
_trappedFocus(event, getFocusableEls) {
|
|
26
|
-
if (!ignoredEvents.has(event) && event.key === "Tab") {
|
|
27
|
-
const focusableEls = getFocusableEls();
|
|
28
|
-
const firstFocusableEl = focusableEls[0];
|
|
29
|
-
const lastFocusableEl = focusableEls[focusableEls.length - 1];
|
|
30
|
-
if (event.shiftKey) {
|
|
31
|
-
if (this.shadowRoot.activeElement === firstFocusableEl) {
|
|
32
|
-
lastFocusableEl.focus();
|
|
33
|
-
return true;
|
|
34
|
-
}
|
|
35
|
-
} else {
|
|
36
|
-
if (this.shadowRoot.activeElement === lastFocusableEl) {
|
|
37
|
-
firstFocusableEl.focus();
|
|
38
|
-
return true;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
return false;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
return TrappedFocusElement;
|
|
46
|
-
};
|
|
47
|
-
|
|
48
16
|
const pickerFieldStyles = ":host{display:inline-block}.base{display:inline-block;inline-size:100%}.control{inline-size:100%}.dialog{display:inline-flex;flex-direction:column}.dialog--padded{padding:12px;gap:12px}.dialog .footer{display:flex;align-items:center;justify-content:flex-end;padding:8px;gap:8px}.dialog .footer--with-separator{border-top:1px solid var(--vvd-color-neutral-200)}";
|
|
49
17
|
|
|
50
18
|
var __defProp = Object.defineProperty;
|
|
@@ -304,4 +272,4 @@ const PickerFieldTemplate = (context, popupContentTemplate, { withSeparator, pad
|
|
|
304
272
|
</div>`;
|
|
305
273
|
};
|
|
306
274
|
|
|
307
|
-
export { PickerFieldTemplate as P, PickerField as a,
|
|
275
|
+
export { PickerFieldTemplate as P, PickerField as a, pickerFieldStyles as p };
|
|
@@ -6,6 +6,7 @@ const pickerField_template = require('./picker-field.template.cjs');
|
|
|
6
6
|
const singleValuePicker = require('./single-value-picker.cjs');
|
|
7
7
|
const fastWebUtilities = require('@microsoft/fast-web-utilities');
|
|
8
8
|
const scrollIntoView = require('./scrollIntoView.cjs');
|
|
9
|
+
const trappedFocus = require('./trapped-focus.cjs');
|
|
9
10
|
const localized = require('./localized.cjs');
|
|
10
11
|
|
|
11
12
|
const isValidTimeStr = (timeStr) => {
|
|
@@ -261,7 +262,7 @@ const onBaseKeyDown = (x, event) => {
|
|
|
261
262
|
const focusableElements = x.shadowRoot.querySelectorAll(".picker");
|
|
262
263
|
const terminalElement = event.shiftKey ? focusableElements[0] : focusableElements[focusableElements.length - 1];
|
|
263
264
|
if (x.shadowRoot.activeElement !== terminalElement) {
|
|
264
|
-
|
|
265
|
+
trappedFocus.ignoreEventInFocusTraps(event);
|
|
265
266
|
}
|
|
266
267
|
x._applyFocusedClass();
|
|
267
268
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { V as VividElement, d as defineVividComponent } from './vivid-element.js';
|
|
2
2
|
import { when, html, repeat, observable, attr, nullableNumberConverter, Observable, ExecutionContext, Updates, volatile, ref } from '@microsoft/fast-element';
|
|
3
|
-
import {
|
|
3
|
+
import { a as PickerField } from './picker-field.template.js';
|
|
4
4
|
import { S as SingleValuePicker } from './single-value-picker.js';
|
|
5
5
|
import { classNames } from '@microsoft/fast-web-utilities';
|
|
6
6
|
import { s as scrollIntoView } from './scrollIntoView.js';
|
|
7
|
+
import { i as ignoreEventInFocusTraps } from './trapped-focus.js';
|
|
7
8
|
import { L as Localized } from './localized.js';
|
|
8
9
|
|
|
9
10
|
const isValidTimeStr = (timeStr) => {
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const ignoredEvents = /* @__PURE__ */ new WeakSet();
|
|
4
|
+
const ignoreEventInFocusTraps = (event) => {
|
|
5
|
+
ignoredEvents.add(event);
|
|
6
|
+
};
|
|
7
|
+
const TrappedFocus = (Base) => {
|
|
8
|
+
class TrappedFocusElement extends Base {
|
|
9
|
+
/**
|
|
10
|
+
* @returns Whether focus was trapped.
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
_trappedFocus(event, getFocusableEls) {
|
|
14
|
+
if (!ignoredEvents.has(event) && event.key === "Tab") {
|
|
15
|
+
const focusableEls = getFocusableEls();
|
|
16
|
+
const firstFocusableEl = focusableEls[0];
|
|
17
|
+
const lastFocusableEl = focusableEls[focusableEls.length - 1];
|
|
18
|
+
if (event.shiftKey) {
|
|
19
|
+
if (this.shadowRoot.activeElement === firstFocusableEl) {
|
|
20
|
+
lastFocusableEl.focus();
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
} else {
|
|
24
|
+
if (this.shadowRoot.activeElement === lastFocusableEl) {
|
|
25
|
+
firstFocusableEl.focus();
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return TrappedFocusElement;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
exports.TrappedFocus = TrappedFocus;
|
|
37
|
+
exports.ignoreEventInFocusTraps = ignoreEventInFocusTraps;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
const ignoredEvents = /* @__PURE__ */ new WeakSet();
|
|
2
|
+
const ignoreEventInFocusTraps = (event) => {
|
|
3
|
+
ignoredEvents.add(event);
|
|
4
|
+
};
|
|
5
|
+
const TrappedFocus = (Base) => {
|
|
6
|
+
class TrappedFocusElement extends Base {
|
|
7
|
+
/**
|
|
8
|
+
* @returns Whether focus was trapped.
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
_trappedFocus(event, getFocusableEls) {
|
|
12
|
+
if (!ignoredEvents.has(event) && event.key === "Tab") {
|
|
13
|
+
const focusableEls = getFocusableEls();
|
|
14
|
+
const firstFocusableEl = focusableEls[0];
|
|
15
|
+
const lastFocusableEl = focusableEls[focusableEls.length - 1];
|
|
16
|
+
if (event.shiftKey) {
|
|
17
|
+
if (this.shadowRoot.activeElement === firstFocusableEl) {
|
|
18
|
+
lastFocusableEl.focus();
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
} else {
|
|
22
|
+
if (this.shadowRoot.activeElement === lastFocusableEl) {
|
|
23
|
+
firstFocusableEl.focus();
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return TrappedFocusElement;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export { TrappedFocus as T, ignoreEventInFocusTraps as i };
|
|
@@ -268,7 +268,7 @@ const ReplacedPropHandling = (Base) => {
|
|
|
268
268
|
|
|
269
269
|
class VividElement extends AriaMixin(ReplacedPropHandling(fastElement.FASTElement)) {
|
|
270
270
|
static {
|
|
271
|
-
this.VIVID_VERSION = "5.
|
|
271
|
+
this.VIVID_VERSION = "5.5.0";
|
|
272
272
|
}
|
|
273
273
|
/**
|
|
274
274
|
* Add data-vvd-component attribute with component name globally,
|
|
@@ -266,7 +266,7 @@ const ReplacedPropHandling = (Base) => {
|
|
|
266
266
|
|
|
267
267
|
class VividElement extends AriaMixin(ReplacedPropHandling(FASTElement)) {
|
|
268
268
|
static {
|
|
269
|
-
this.VIVID_VERSION = "5.
|
|
269
|
+
this.VIVID_VERSION = "5.5.0";
|
|
270
270
|
}
|
|
271
271
|
/**
|
|
272
272
|
* Add data-vvd-component attribute with component name globally,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const i=require("../bundled/
|
|
1
|
+
"use strict";const i=require("../bundled/definition14.cjs");i.registerVisuallyHidden();
|
package/visually-hidden/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { r } from "../bundled/
|
|
1
|
+
import { r } from "../bundled/definition14.js";
|
|
2
2
|
r();
|
package/bundled/_has.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";function e(r){return r!=null&&typeof r=="object"&&r["@@functional/placeholder"]===!0}function o(r){return function n(t){return arguments.length===0||e(t)?n:r.apply(this,arguments)}}function i(r){return function n(t,c){switch(arguments.length){case 0:return n;case 1:return e(t)?n:o(function(u){return r(t,u)});default:return e(t)&&e(c)?n:e(t)?o(function(u){return r(u,c)}):e(c)?o(function(u){return r(t,u)}):r(t,c)}}}function l(r,n){return Object.prototype.hasOwnProperty.call(n,r)}exports._curry1=o;exports._curry2=i;exports._has=l;
|
package/bundled/_has.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
function e(r) {
|
|
2
|
-
return r != null && typeof r == "object" && r["@@functional/placeholder"] === !0;
|
|
3
|
-
}
|
|
4
|
-
function o(r) {
|
|
5
|
-
return function n(t) {
|
|
6
|
-
return arguments.length === 0 || e(t) ? n : r.apply(this, arguments);
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
function i(r) {
|
|
10
|
-
return function n(t, c) {
|
|
11
|
-
switch (arguments.length) {
|
|
12
|
-
case 0:
|
|
13
|
-
return n;
|
|
14
|
-
case 1:
|
|
15
|
-
return e(t) ? n : o(function(u) {
|
|
16
|
-
return r(t, u);
|
|
17
|
-
});
|
|
18
|
-
default:
|
|
19
|
-
return e(t) && e(c) ? n : e(t) ? o(function(u) {
|
|
20
|
-
return r(u, c);
|
|
21
|
-
}) : e(c) ? o(function(u) {
|
|
22
|
-
return r(t, u);
|
|
23
|
-
}) : r(t, c);
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
function l(r, n) {
|
|
28
|
-
return Object.prototype.hasOwnProperty.call(n, r);
|
|
29
|
-
}
|
|
30
|
-
export {
|
|
31
|
-
l as _,
|
|
32
|
-
o as a,
|
|
33
|
-
i as b
|
|
34
|
-
};
|