@vonage/vivid 5.4.0 → 5.6.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/LICENSE.md +201 -0
- package/accordion/definition.cjs +5 -0
- package/accordion/definition.js +5 -0
- package/accordion/index.cjs +1 -1
- package/accordion/index.js +14 -3
- package/alert/definition.cjs +4 -12
- package/alert/definition.js +5 -13
- package/alert/index.cjs +11 -11
- package/alert/index.js +33 -37
- package/audio-player/definition.cjs +4 -0
- package/audio-player/definition.js +4 -0
- package/audio-player/index.cjs +1 -1
- package/audio-player/index.js +8 -2
- package/banner/definition.cjs +2 -4
- package/banner/definition.js +2 -4
- package/banner/index.cjs +2 -2
- package/banner/index.js +1 -1
- package/breadcrumb/definition.cjs +1 -0
- package/breadcrumb/definition.js +1 -0
- package/breadcrumb/index.cjs +1 -1
- package/breadcrumb/index.js +1 -0
- package/bundled/affix.js +1 -1
- package/bundled/anchored.cjs +1 -1
- package/bundled/anchored.js +6 -6
- package/bundled/attribute-binding-behaviour.cjs +1 -1
- package/bundled/attribute-binding-behaviour.js +3 -1
- package/bundled/base-color-picker.cjs +18 -13
- package/bundled/base-color-picker.js +107 -84
- package/bundled/base-progress.cjs +1 -1
- package/bundled/base-progress.js +3 -0
- package/bundled/button.cjs +1 -1
- package/bundled/button.js +14 -10
- package/bundled/calendar-picker.template.cjs +1 -1
- package/bundled/calendar-picker.template.js +4 -2
- package/bundled/char-count.cjs +1 -1
- package/bundled/char-count.js +1 -1
- package/bundled/definition10.cjs +7 -7
- package/bundled/definition10.js +29 -19
- package/bundled/definition11.cjs +12 -19
- package/bundled/definition11.js +73 -204
- package/bundled/definition12.cjs +19 -10
- package/bundled/definition12.js +218 -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 +86 -117
- package/bundled/definition18.cjs +13 -12
- package/bundled/definition18.js +125 -71
- package/bundled/definition19.cjs +16 -16
- package/bundled/definition19.js +132 -94
- package/bundled/definition2.cjs +8 -9
- package/bundled/definition2.js +89 -142
- package/bundled/definition22.cjs +1 -1
- package/bundled/definition22.js +1 -0
- package/bundled/definition3.cjs +1 -1
- package/bundled/definition3.js +2 -1
- package/bundled/definition5.cjs +1 -1
- package/bundled/definition5.js +9 -3
- package/bundled/definition6.cjs +1 -1
- package/bundled/definition6.js +1 -0
- package/bundled/definition7.cjs +1 -1
- package/bundled/definition7.js +7 -4
- package/bundled/definition8.cjs +1 -1
- package/bundled/definition8.js +1 -0
- package/bundled/definition9.cjs +6 -6
- package/bundled/definition9.js +545 -488
- package/bundled/delegates-aria.cjs +1 -1
- package/bundled/delegates-aria.js +3 -1
- package/bundled/form-associated.cjs +1 -1
- package/bundled/form-associated.js +11 -3
- package/bundled/host-semantics.js +4 -4
- package/bundled/listbox.cjs +1 -1
- package/bundled/listbox.js +22 -4
- package/bundled/localized.cjs +1 -1
- package/bundled/localized.js +149 -66
- package/bundled/mixins.cjs +4 -4
- package/bundled/mixins.js +11 -8
- package/bundled/picker-field.template.cjs +14 -14
- package/bundled/picker-field.template.js +36 -56
- package/bundled/scrollIntoView.cjs +1 -1
- package/bundled/scrollIntoView.js +4 -1
- package/bundled/text-field.cjs +1 -1
- package/bundled/text-field.js +1 -1
- package/bundled/time-selection-picker.template.cjs +12 -12
- package/bundled/time-selection-picker.template.js +16 -12
- package/bundled/trapped-focus.cjs +1 -0
- package/bundled/trapped-focus.js +26 -0
- package/bundled/vivid-element.cjs +4 -4
- package/bundled/vivid-element.js +529 -492
- package/calendar/definition.cjs +2 -0
- package/calendar/definition.js +2 -0
- package/calendar/index.cjs +13 -13
- package/calendar/index.js +174 -144
- package/checkbox/definition.cjs +1 -0
- package/checkbox/definition.js +1 -0
- package/color-picker/definition.cjs +213 -112
- package/color-picker/definition.js +213 -112
- package/color-picker/index.cjs +104 -75
- package/color-picker/index.js +417 -326
- package/combobox/definition.cjs +17 -6
- package/combobox/definition.js +17 -6
- package/combobox/index.cjs +14 -9
- package/combobox/index.js +54 -42
- package/contextual-help/index.cjs +1 -1
- package/contextual-help/index.js +1 -1
- package/custom-elements.json +6976 -484
- package/data-grid/definition.cjs +105 -7
- package/data-grid/definition.js +105 -7
- package/data-grid/index.cjs +52 -38
- package/data-grid/index.js +313 -242
- package/date-picker/index.cjs +1 -1
- package/date-picker/index.js +2 -2
- package/date-range-picker/definition.cjs +2 -0
- package/date-range-picker/definition.js +2 -0
- package/date-range-picker/index.cjs +1 -1
- package/date-range-picker/index.js +7 -3
- package/date-time-picker/index.cjs +1 -1
- package/date-time-picker/index.js +2 -2
- package/dial-pad/definition.cjs +148 -0
- package/dial-pad/definition.js +148 -0
- package/dial-pad/index.cjs +27 -20
- package/dial-pad/index.js +202 -101
- package/dialog/definition.cjs +1 -0
- package/dialog/definition.js +1 -0
- package/dialog/index.cjs +1 -1
- package/dialog/index.js +1 -0
- package/divider/index.cjs +1 -1
- package/divider/index.js +1 -1
- package/fab/definition.cjs +1 -0
- package/fab/definition.js +1 -0
- package/fab/index.cjs +1 -1
- package/fab/index.js +1 -0
- package/file-picker/definition.cjs +7 -2
- package/file-picker/definition.js +7 -2
- package/file-picker/index.cjs +6 -6
- package/file-picker/index.js +82 -73
- package/icon/definition.cjs +66 -41
- package/icon/definition.js +67 -42
- package/index.cjs +21 -0
- package/index.js +1 -1
- package/lib/color-picker/color-picker.d.ts +390 -12
- package/lib/color-picker/locale.d.ts +4 -0
- package/lib/data-grid/locale.d.ts +5 -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 -1
- package/lib/menu/menu.d.ts +4 -4
- package/lib/rich-text-editor/definition.d.ts +3 -2
- package/lib/rich-text-editor/locale.d.ts +29 -3
- package/lib/rich-text-editor/popover.d.ts +19 -0
- package/lib/rich-text-editor/rich-text-editor.d.ts +16 -45
- package/lib/rich-text-editor/rich-text-editor.template.d.ts +2 -2
- package/lib/rich-text-editor/rte/config.d.ts +18 -0
- package/lib/rich-text-editor/rte/document.d.ts +28 -0
- package/lib/rich-text-editor/rte/exports.d.ts +23 -0
- package/lib/rich-text-editor/rte/feature.d.ts +46 -0
- package/lib/rich-text-editor/rte/features/internal/basic-text-blocks.d.ts +33 -0
- package/lib/rich-text-editor/rte/features/internal/foreign-html.d.ts +11 -0
- package/lib/rich-text-editor/rte/features/internal/history.d.ts +10 -0
- package/lib/rich-text-editor/rte/features/internal/text-style.d.ts +18 -0
- package/lib/rich-text-editor/rte/html-parser.d.ts +24 -0
- package/lib/rich-text-editor/rte/html-serializer.d.ts +30 -0
- package/lib/rich-text-editor/rte/instance.d.ts +57 -0
- package/lib/rich-text-editor/rte/utils/default-textblock.d.ts +2 -0
- package/lib/rich-text-editor/rte/utils/impl.d.ts +1 -0
- package/lib/rich-text-editor/rte/utils/textblock-attrs.d.ts +29 -0
- package/lib/rich-text-editor/rte/utils/textblock-marks.d.ts +10 -0
- package/lib/rich-text-editor/rte/utils/ui.d.ts +109 -0
- package/lib/simple-color-picker/simple-color-picker.d.ts +6 -5
- package/lib/text-area/text-area.d.ts +1 -1
- package/lib/text-field/text-field.d.ts +1 -1
- package/lib/time-picker/time-picker.d.ts +20 -20
- package/lib/toggletip/toggletip.d.ts +4 -4
- package/lib/tooltip/tooltip.d.ts +4 -4
- package/locales/de-DE.cjs +58 -7
- package/locales/de-DE.js +58 -7
- package/locales/en-GB.cjs +60 -9
- package/locales/en-GB.js +60 -9
- package/locales/en-US.cjs +60 -9
- package/locales/en-US.js +60 -9
- package/locales/ja-JP.cjs +59 -8
- package/locales/ja-JP.js +59 -8
- package/locales/zh-CN.cjs +58 -7
- package/locales/zh-CN.js +58 -7
- package/menu/definition.cjs +1 -0
- package/menu/definition.js +1 -0
- package/number-field/definition.cjs +5 -3
- package/number-field/definition.js +5 -3
- package/number-field/index.cjs +5 -3
- package/number-field/index.js +34 -32
- package/option/index.cjs +1 -1
- package/option/index.js +1 -1
- package/package.json +76 -62
- package/pagination/definition.cjs +2 -0
- package/pagination/definition.js +2 -0
- package/pagination/index.cjs +1 -1
- package/pagination/index.js +2 -0
- package/progress-ring/index.cjs +1 -1
- package/progress-ring/index.js +1 -1
- package/radio/definition.cjs +4 -0
- package/radio/definition.js +4 -0
- 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/range-slider/definition.cjs +2 -1
- package/range-slider/definition.js +2 -1
- package/range-slider/index.cjs +1 -1
- package/range-slider/index.js +3 -1
- package/rich-text-editor/definition.cjs +17942 -1074
- package/rich-text-editor/definition.js +17926 -1079
- package/rich-text-editor/index.cjs +29 -130
- package/rich-text-editor/index.js +5565 -2474
- package/searchable-select/definition.cjs +6 -2
- package/searchable-select/definition.js +6 -2
- package/searchable-select/index.cjs +1 -1
- package/searchable-select/index.js +14 -10
- package/select/definition.cjs +22 -4
- package/select/definition.js +22 -4
- 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/patterns/anchored.d.ts +8 -8
- package/shared/patterns/char-count/char-count.d.ts +1 -1
- package/shared/patterns/localized.d.ts +386 -0
- 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/shared/utils/promise.d.ts +7 -0
- package/simple-color-picker/definition.cjs +11 -6
- package/simple-color-picker/definition.js +11 -6
- package/simple-color-picker/index.cjs +6 -6
- package/simple-color-picker/index.js +44 -39
- package/slider/definition.cjs +7 -1
- package/slider/definition.js +7 -1
- package/styles/core/all.css +5 -1
- package/styles/core/theme.css +5 -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/switch/definition.cjs +1 -0
- package/switch/definition.js +1 -0
- package/switch/index.cjs +1 -1
- package/switch/index.js +1 -0
- package/tabs/definition.cjs +2 -0
- package/tabs/definition.js +2 -0
- package/tabs/index.cjs +1 -1
- package/tabs/index.js +2 -0
- 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/definition.cjs +13 -7
- package/text-area/definition.js +13 -7
- package/text-area/index.cjs +6 -6
- package/text-area/index.js +20 -14
- package/text-field/definition.cjs +16 -6
- package/text-field/definition.js +16 -6
- package/time-picker/index.cjs +1 -1
- package/time-picker/index.js +1 -1
- package/toggletip/definition.cjs +5 -1
- package/toggletip/definition.js +5 -1
- package/toggletip/index.cjs +1 -1
- package/toggletip/index.js +1 -1
- package/tooltip/definition.cjs +6 -3
- package/tooltip/definition.js +6 -3
- package/tooltip/index.cjs +1 -1
- package/tooltip/index.js +1 -1
- package/tree-view/definition.cjs +28 -6
- package/tree-view/definition.js +28 -6
- package/tree-view/index.cjs +1 -1
- package/tree-view/index.js +28 -6
- package/unbundled/_commonjsHelpers.cjs +0 -26
- package/unbundled/_commonjsHelpers.js +1 -26
- package/unbundled/attribute-binding-behaviour.cjs +1 -0
- package/unbundled/attribute-binding-behaviour.js +1 -0
- package/unbundled/base-color-picker.cjs +45 -21
- package/unbundled/base-color-picker.js +45 -21
- package/unbundled/base-progress.cjs +3 -0
- package/unbundled/base-progress.js +3 -0
- package/unbundled/button.cjs +14 -10
- package/unbundled/button.js +14 -10
- package/unbundled/calendar-picker.template.cjs +3 -1
- package/unbundled/calendar-picker.template.js +3 -1
- package/unbundled/definition.cjs +1 -0
- package/unbundled/definition.js +1 -0
- package/unbundled/definition2.cjs +4 -1
- package/unbundled/definition2.js +4 -1
- package/unbundled/definition3.cjs +1 -0
- package/unbundled/definition3.js +1 -0
- package/unbundled/definition4.cjs +1 -0
- package/unbundled/definition4.js +1 -0
- package/unbundled/definition5.cjs +3 -2
- package/unbundled/definition5.js +4 -3
- package/unbundled/delegates-aria.cjs +1 -0
- package/unbundled/delegates-aria.js +1 -0
- package/unbundled/form-associated.cjs +4 -0
- package/unbundled/form-associated.js +4 -0
- package/unbundled/listbox.cjs +16 -1
- package/unbundled/listbox.js +16 -1
- package/unbundled/localized.cjs +36 -0
- package/unbundled/localized.js +37 -2
- package/unbundled/mixins.cjs +2 -0
- package/unbundled/mixins.js +2 -0
- package/unbundled/picker-field.template.cjs +3 -35
- package/unbundled/picker-field.template.js +3 -34
- package/unbundled/scrollIntoView.cjs +1 -0
- package/unbundled/scrollIntoView.js +1 -0
- package/unbundled/text-field.cjs +1 -1
- package/unbundled/text-field.js +1 -1
- package/unbundled/time-selection-picker.template.cjs +5 -1
- package/unbundled/time-selection-picker.template.js +5 -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/video-player/definition.cjs +54 -44
- package/video-player/definition.js +50 -40
- package/video-player/index.cjs +28 -28
- package/video-player/index.js +1448 -1442
- package/visually-hidden/index.cjs +1 -1
- package/visually-hidden/index.js +1 -1
- package/vivid.api.json +6463 -6099
- package/bundled/_has.cjs +0 -1
- package/bundled/_has.js +0 -34
- package/lib/rich-text-editor/facades/prose-mirror-vivid.schema.d.ts +0 -4
- package/lib/rich-text-editor/facades/vivid-prose-mirror.facade.d.ts +0 -18
- package/lib/rich-text-editor/image-placeholder/definition.d.ts +0 -2
- package/lib/rich-text-editor/image-placeholder/image-placeholder.d.ts +0 -7
- package/lib/rich-text-editor/image-placeholder/image-placeholder.template.d.ts +0 -4
- package/lib/rich-text-editor/menubar/consts.d.ts +0 -18
- package/lib/rich-text-editor/menubar/definition.d.ts +0 -2
- package/lib/rich-text-editor/menubar/menubar.d.ts +0 -386
- package/lib/rich-text-editor/menubar/menubar.template.d.ts +0 -4
|
@@ -1,56 +1,66 @@
|
|
|
1
|
-
import { F as
|
|
2
|
-
import { U as
|
|
3
|
-
import { w as
|
|
4
|
-
import { L as
|
|
5
|
-
import { F as
|
|
6
|
-
import { c as
|
|
7
|
-
function
|
|
8
|
-
if (!
|
|
9
|
-
const s =
|
|
10
|
-
return /^[0-9a-fA-F]{3}$/.test(s) ? s.split("").map((
|
|
1
|
+
import { F as g } from "./form-associated.js";
|
|
2
|
+
import { U as y, h as m, a as S, o as w } from "./vivid-element.js";
|
|
3
|
+
import { w as b } from "./when.js";
|
|
4
|
+
import { L as I } from "./localized.js";
|
|
5
|
+
import { F as B } from "./form-element.js";
|
|
6
|
+
import { c as $ } from "./class-names.js";
|
|
7
|
+
function C(a) {
|
|
8
|
+
if (!a) return null;
|
|
9
|
+
const s = a.trim().replace(/^#/, "");
|
|
10
|
+
return /^[0-9a-fA-F]{3}$/.test(s) ? s.split("").map((n) => n + n).join("").toLowerCase() : /^[0-9a-fA-F]{6}$/.test(s) ? s.toLowerCase() : null;
|
|
11
11
|
}
|
|
12
|
-
function P(
|
|
13
|
-
return
|
|
12
|
+
function P(a) {
|
|
13
|
+
return C(a) !== null;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
const s =
|
|
15
|
+
function _(a) {
|
|
16
|
+
const s = C(a);
|
|
17
17
|
if (!s) return 0;
|
|
18
|
-
const
|
|
19
|
-
return 0.2126 *
|
|
18
|
+
const n = parseInt(s.slice(0, 2), 16) / 255, t = parseInt(s.slice(2, 4), 16) / 255, o = parseInt(s.slice(4, 6), 16) / 255, e = n <= 0.03928 ? n / 12.92 : Math.pow((n + 0.055) / 1.055, 2.4), r = t <= 0.03928 ? t / 12.92 : Math.pow((t + 0.055) / 1.055, 2.4), l = o <= 0.03928 ? o / 12.92 : Math.pow((o + 0.055) / 1.055, 2.4);
|
|
19
|
+
return 0.2126 * e + 0.7152 * r + 0.0722 * l;
|
|
20
20
|
}
|
|
21
|
-
function A(
|
|
22
|
-
const
|
|
23
|
-
return (
|
|
21
|
+
function A(a, s) {
|
|
22
|
+
const n = _(a), t = _(s), o = Math.max(n, t), e = Math.min(n, t);
|
|
23
|
+
return (o + 0.05) / (e + 0.05);
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
return s || (s = document.querySelector(".vvd-root") || document.documentElement), getComputedStyle(s).getPropertyValue(
|
|
25
|
+
function v(a, s) {
|
|
26
|
+
return s || (s = document.querySelector(".vvd-root") || document.documentElement), getComputedStyle(s).getPropertyValue(a).trim();
|
|
27
27
|
}
|
|
28
|
-
var x = Object.defineProperty,
|
|
29
|
-
for (var
|
|
30
|
-
(
|
|
31
|
-
return
|
|
28
|
+
var x = Object.defineProperty, f = (a, s, n, t) => {
|
|
29
|
+
for (var o = void 0, e = a.length - 1, r; e >= 0; e--)
|
|
30
|
+
(r = a[e]) && (o = r(s, n, o) || o);
|
|
31
|
+
return o && x(s, n, o), o;
|
|
32
32
|
};
|
|
33
|
-
const q = (
|
|
34
|
-
class s extends
|
|
35
|
-
|
|
33
|
+
const q = (a) => {
|
|
34
|
+
class s extends I(
|
|
35
|
+
B(g(a))
|
|
36
36
|
) {
|
|
37
37
|
constructor() {
|
|
38
38
|
super(...arguments), this.proxy = document.createElement("input"), this.open = !1, this.swatches = [], this._canvasColor = "";
|
|
39
39
|
}
|
|
40
40
|
connectedCallback() {
|
|
41
|
-
super.connectedCallback(),
|
|
41
|
+
super.connectedCallback(), requestAnimationFrame(() => {
|
|
42
|
+
this._refreshCanvasColor();
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* @internal
|
|
47
|
+
*/
|
|
48
|
+
get _computedCanvasColor() {
|
|
49
|
+
return this._canvasColor || (this._canvasColor = v("--vvd-color-canvas", this)), this._canvasColor;
|
|
42
50
|
}
|
|
43
51
|
/**
|
|
44
52
|
* @internal
|
|
45
53
|
*/
|
|
46
54
|
_refreshCanvasColor() {
|
|
47
|
-
this._canvasColor =
|
|
55
|
+
this._canvasColor = v("--vvd-color-canvas", this);
|
|
48
56
|
}
|
|
49
57
|
/**
|
|
50
58
|
* @internal
|
|
51
59
|
*/
|
|
52
|
-
_applyContrastClass(
|
|
53
|
-
|
|
60
|
+
_applyContrastClass(t, o = 3) {
|
|
61
|
+
if (!t) return !1;
|
|
62
|
+
const e = this._computedCanvasColor;
|
|
63
|
+
return e ? A(t, e) < o : !1;
|
|
54
64
|
}
|
|
55
65
|
/**
|
|
56
66
|
* @internal
|
|
@@ -61,12 +71,13 @@ const q = (o) => {
|
|
|
61
71
|
/**
|
|
62
72
|
* @internal
|
|
63
73
|
*/
|
|
64
|
-
_handleSwatchSelection(
|
|
65
|
-
this.value ===
|
|
74
|
+
_handleSwatchSelection(t) {
|
|
75
|
+
this.value === t ? this.value = "" : this.value = t, this.$emit("change"), this.open = !1;
|
|
66
76
|
}
|
|
67
77
|
/**
|
|
68
78
|
* @internal
|
|
69
|
-
|
|
79
|
+
* /
|
|
80
|
+
/* v8 ignore next -- @preserve */
|
|
70
81
|
_handleColorSaving() {
|
|
71
82
|
}
|
|
72
83
|
/**
|
|
@@ -79,16 +90,16 @@ const q = (o) => {
|
|
|
79
90
|
* @internal
|
|
80
91
|
*/
|
|
81
92
|
_returnFocusToAnchor() {
|
|
82
|
-
const
|
|
83
|
-
|
|
93
|
+
const t = this._getFocusReturnEl();
|
|
94
|
+
t && y.enqueue(() => t.focus());
|
|
84
95
|
}
|
|
85
96
|
/**
|
|
86
97
|
* @internal
|
|
87
98
|
*/
|
|
88
99
|
_getGridCells() {
|
|
89
|
-
const
|
|
90
|
-
return
|
|
91
|
-
|
|
100
|
+
const t = this.shadowRoot?.querySelector('[role="grid"]');
|
|
101
|
+
return t ? Array.from(
|
|
102
|
+
t.querySelectorAll(
|
|
92
103
|
'[role="gridcell"], [data-vvd-role="gridcell"]'
|
|
93
104
|
)
|
|
94
105
|
) : [];
|
|
@@ -96,36 +107,41 @@ const q = (o) => {
|
|
|
96
107
|
/**
|
|
97
108
|
* @internal
|
|
98
109
|
*/
|
|
99
|
-
_handleCellKeydown(
|
|
100
|
-
const
|
|
101
|
-
switch (
|
|
102
|
-
case "ArrowRight":
|
|
103
|
-
|
|
110
|
+
_handleCellKeydown(t, o, e, r) {
|
|
111
|
+
const l = this._getRowLength(), c = this._getGridCells().length, u = Math.floor(e / l), h = e % l, d = Math.ceil(c / l);
|
|
112
|
+
switch (t.key) {
|
|
113
|
+
case "ArrowRight": {
|
|
114
|
+
/* v8 ignore else -- @preserve */
|
|
115
|
+
return h < l - 1 && e + 1 < c && this._focusSwatchByIndex(e + 1), !1;
|
|
116
|
+
}
|
|
104
117
|
case "ArrowLeft":
|
|
105
|
-
return h > 0 && this._focusSwatchByIndex(
|
|
106
|
-
case "ArrowDown":
|
|
107
|
-
|
|
118
|
+
return h > 0 && this._focusSwatchByIndex(e - 1), !1;
|
|
119
|
+
case "ArrowDown": {
|
|
120
|
+
/* v8 ignore else -- @preserve */
|
|
121
|
+
return u < d - 1 && e + l < c && this._focusSwatchByIndex(e + l), !1;
|
|
122
|
+
}
|
|
108
123
|
case "ArrowUp":
|
|
109
|
-
return u > 0 && this._focusSwatchByIndex(
|
|
124
|
+
return u > 0 && this._focusSwatchByIndex(e - l), !1;
|
|
110
125
|
case "PageDown": {
|
|
111
|
-
const i = (
|
|
126
|
+
const i = (d - 1) * l, p = Math.min(
|
|
112
127
|
i + h,
|
|
113
128
|
c - 1
|
|
114
129
|
);
|
|
115
|
-
|
|
130
|
+
/* v8 ignore else -- @preserve */
|
|
131
|
+
return e !== p && this._focusSwatchByIndex(p), !1;
|
|
116
132
|
}
|
|
117
133
|
case "PageUp": {
|
|
118
134
|
const i = Math.min(h, c - 1);
|
|
119
|
-
return
|
|
135
|
+
return e !== i && this._focusSwatchByIndex(i), !1;
|
|
120
136
|
}
|
|
121
137
|
case "Home":
|
|
122
|
-
return
|
|
138
|
+
return t.ctrlKey ? this._focusSwatchByIndex(0) : this._focusSwatchByIndex(u * l), !1;
|
|
123
139
|
case "End":
|
|
124
|
-
if (
|
|
140
|
+
if (t.ctrlKey)
|
|
125
141
|
this._focusSwatchByIndex(c - 1);
|
|
126
142
|
else {
|
|
127
143
|
const i = Math.min(
|
|
128
|
-
(u + 1) *
|
|
144
|
+
(u + 1) * l - 1,
|
|
129
145
|
c - 1
|
|
130
146
|
);
|
|
131
147
|
this._focusSwatchByIndex(i);
|
|
@@ -133,7 +149,7 @@ const q = (o) => {
|
|
|
133
149
|
return !1;
|
|
134
150
|
case "Enter":
|
|
135
151
|
case " ":
|
|
136
|
-
return
|
|
152
|
+
return r && this._handleColorSaving(), o && !r && (this._handleSwatchSelection(o), this._returnFocusToAnchor()), !1;
|
|
137
153
|
case "Escape":
|
|
138
154
|
return this.open = !1, this._returnFocusToAnchor(), !1;
|
|
139
155
|
case "Tab":
|
|
@@ -145,48 +161,55 @@ const q = (o) => {
|
|
|
145
161
|
/**
|
|
146
162
|
* @internal
|
|
147
163
|
*/
|
|
148
|
-
_focusSwatchByIndex(
|
|
149
|
-
const
|
|
150
|
-
|
|
164
|
+
_focusSwatchByIndex(t) {
|
|
165
|
+
const o = this._getGridCells();
|
|
166
|
+
t < 0 || t >= o.length || o[t]?.focus();
|
|
151
167
|
}
|
|
152
168
|
/**
|
|
153
169
|
* @internal
|
|
154
170
|
*/
|
|
155
|
-
_renderColorSwatch(
|
|
156
|
-
return
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
171
|
+
_renderColorSwatch(t, o) {
|
|
172
|
+
return m`
|
|
173
|
+
<${o} placement="top"
|
|
174
|
+
text="${(e) => e.label ?? e.value}"
|
|
175
|
+
exportparts="vvd-theme-alternate">
|
|
176
|
+
<button
|
|
177
|
+
slot="anchor"
|
|
178
|
+
class="swatch ${(e, r) => $(
|
|
179
|
+
r.parent.value === e.value ? "selected" : "",
|
|
180
|
+
r.parent._applyContrastClass(e.value) ? "contrast" : ""
|
|
161
181
|
)}"
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
182
|
+
role="gridcell"
|
|
183
|
+
style="--swatch-color: ${(e) => e.value};"
|
|
184
|
+
tabindex="${(e, r) => r.index === 0 ? "0" : "-1"}"
|
|
185
|
+
aria-label="${(e, r) => r.parent.locale.baseColorPicker.colorSwatchLabel(
|
|
166
186
|
e.value,
|
|
167
187
|
e.label,
|
|
168
|
-
|
|
188
|
+
r.parent.value === e.value
|
|
169
189
|
)}"
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
190
|
+
@click="${(e, r) => r.parent._handleSwatchSelection(e.value)}"
|
|
191
|
+
@keydown="${(e, r) => r.parent._handleCellKeydown(
|
|
192
|
+
r.event,
|
|
173
193
|
e.value,
|
|
174
|
-
|
|
194
|
+
r.index
|
|
175
195
|
)}"
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
(e,
|
|
179
|
-
|
|
196
|
+
>
|
|
197
|
+
${b(
|
|
198
|
+
(e, r) => r.parent.value === e.value,
|
|
199
|
+
m`<${t} size="-6" name="check-solid" aria-hidden="true"></${t}>`
|
|
180
200
|
)}
|
|
181
|
-
|
|
201
|
+
</button>
|
|
202
|
+
</${o}>
|
|
182
203
|
`;
|
|
183
204
|
}
|
|
184
205
|
}
|
|
185
|
-
return
|
|
186
|
-
|
|
187
|
-
], s.prototype, "open"),
|
|
188
|
-
|
|
189
|
-
], s.prototype, "swatches"),
|
|
206
|
+
return f([
|
|
207
|
+
S({ mode: "boolean" })
|
|
208
|
+
], s.prototype, "open"), f([
|
|
209
|
+
w
|
|
210
|
+
], s.prototype, "swatches"), f([
|
|
211
|
+
w
|
|
212
|
+
], s.prototype, "_canvasColor"), s;
|
|
190
213
|
};
|
|
191
214
|
export {
|
|
192
215
|
q as B,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const t=require("./vivid-element.cjs");var c=Object.defineProperty,o=(a,n,s,i)=>{for(var e=void 0,l=a.length-1,p;l>=0;l--)(p=a[l])&&(e=p(n,s,e)||e);return e&&c(n,s,e),e};class r extends t.VividElement{constructor(){super(...arguments),this.percentComplete=0}valueChanged(){this.$fastController.isConnected&&this.updatePercentComplete()}minChanged(){this.$fastController.isConnected&&this.updatePercentComplete()}maxChanged(){this.$fastController.isConnected&&this.updatePercentComplete()}connectedCallback(){super.connectedCallback(),this.updatePercentComplete()}updatePercentComplete(){const n=typeof this.min=="number"?this.min:0,s=typeof this.max=="number"?this.max:100,i=typeof this.value=="number"?this.value:0,e=s-n;this.percentComplete=e===0?0:Math.fround((i-n)/e*100)}}o([t.attr({converter:t.nullableNumberConverter})],r.prototype,"value");o([t.attr({converter:t.nullableNumberConverter})],r.prototype,"min");o([t.attr({converter:t.nullableNumberConverter})],r.prototype,"max");o([t.attr({mode:"boolean"})],r.prototype,"paused");o([t.observable],r.prototype,"percentComplete");exports.BaseProgress=r;
|
|
1
|
+
"use strict";const t=require("./vivid-element.cjs");var c=Object.defineProperty,o=(a,n,s,i)=>{for(var e=void 0,l=a.length-1,p;l>=0;l--)(p=a[l])&&(e=p(n,s,e)||e);return e&&c(n,s,e),e};class r extends t.VividElement{constructor(){super(...arguments),this.percentComplete=0}valueChanged(){/* v8 ignore if -- @preserve */this.$fastController.isConnected&&this.updatePercentComplete()}minChanged(){/* v8 ignore if -- @preserve */this.$fastController.isConnected&&this.updatePercentComplete()}maxChanged(){/* v8 ignore if -- @preserve */this.$fastController.isConnected&&this.updatePercentComplete()}connectedCallback(){super.connectedCallback(),this.updatePercentComplete()}updatePercentComplete(){const n=typeof this.min=="number"?this.min:0,s=typeof this.max=="number"?this.max:100,i=typeof this.value=="number"?this.value:0,e=s-n;this.percentComplete=e===0?0:Math.fround((i-n)/e*100)}}o([t.attr({converter:t.nullableNumberConverter})],r.prototype,"value");o([t.attr({converter:t.nullableNumberConverter})],r.prototype,"min");o([t.attr({converter:t.nullableNumberConverter})],r.prototype,"max");o([t.attr({mode:"boolean"})],r.prototype,"paused");o([t.observable],r.prototype,"percentComplete");exports.BaseProgress=r;
|
package/bundled/base-progress.js
CHANGED
|
@@ -12,18 +12,21 @@ class o extends m {
|
|
|
12
12
|
* @internal
|
|
13
13
|
*/
|
|
14
14
|
valueChanged() {
|
|
15
|
+
/* v8 ignore if -- @preserve */
|
|
15
16
|
this.$fastController.isConnected && this.updatePercentComplete();
|
|
16
17
|
}
|
|
17
18
|
/**
|
|
18
19
|
* @internal
|
|
19
20
|
*/
|
|
20
21
|
minChanged() {
|
|
22
|
+
/* v8 ignore if -- @preserve */
|
|
21
23
|
this.$fastController.isConnected && this.updatePercentComplete();
|
|
22
24
|
}
|
|
23
25
|
/**
|
|
24
26
|
* @private
|
|
25
27
|
*/
|
|
26
28
|
maxChanged() {
|
|
29
|
+
/* v8 ignore if -- @preserve */
|
|
27
30
|
this.$fastController.isConnected && this.updatePercentComplete();
|
|
28
31
|
}
|
|
29
32
|
/**
|
package/bundled/button.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const c=require("./delegates-aria.cjs"),
|
|
1
|
+
"use strict";const c=require("./delegates-aria.cjs"),t=require("./vivid-element.cjs"),d=require("./form-associated.cjs");var l=Object.defineProperty,r=(n,e,o,p)=>{for(var s=void 0,a=n.length-1,h;a>=0;a--)(h=n[a])&&(s=h(e,o,s)||s);return s&&l(e,o,s),s};class i extends c.DelegatesAria(d.FormAssociated(t.VividElement)){constructor(){super(...arguments),this.proxy=document.createElement("input"),this.handleClick=e=>{/* v8 ignore else -- @preserve */this.disabled&&e.stopPropagation()},this.handleSubmission=()=>{this.form&&(this.attachProxy(),this.form.requestSubmit(this.proxy),this.detachProxy())},this.handleFormReset=()=>{this.form?.reset()},this.handleUnsupportedDelegatesFocus=()=>{/* v8 ignore else -- @preserve */this.$fastController.definition.shadowOptions&&window.ShadowRoot&&!window.ShadowRoot.prototype.hasOwnProperty("delegatesFocus")&&this.$fastController.definition.shadowOptions.delegatesFocus&&Object.defineProperty(this,"focus",{value:()=>{this.control.focus()},configurable:!0})}}formactionChanged(){/* v8 ignore if -- @preserve */this.proxy instanceof HTMLInputElement&&(this.proxy.formAction=this.formaction)}formenctypeChanged(){/* v8 ignore if -- @preserve */this.proxy instanceof HTMLInputElement&&(this.proxy.formEnctype=this.formenctype)}formmethodChanged(){/* v8 ignore if -- @preserve */this.proxy instanceof HTMLInputElement&&(this.proxy.formMethod=this.formmethod)}formnovalidateChanged(){/* v8 ignore if -- @preserve */this.proxy instanceof HTMLInputElement&&(this.proxy.formNoValidate=this.formnovalidate)}formtargetChanged(){/* v8 ignore if -- @preserve */this.proxy instanceof HTMLInputElement&&(this.proxy.formTarget=this.formtarget)}typeChanged(e,o){/* v8 ignore if -- @preserve */this.proxy instanceof HTMLInputElement&&(this.proxy.type=this.type),o==="submit"&&this.addEventListener("click",this.handleSubmission),e==="submit"&&this.removeEventListener("click",this.handleSubmission),o==="reset"&&this.addEventListener("click",this.handleFormReset),e==="reset"&&this.removeEventListener("click",this.handleFormReset)}validate(){super.validate(this.control)}connectedCallback(){super.connectedCallback(),this.proxy.setAttribute("type",this.type),this.handleUnsupportedDelegatesFocus(),this.autofocus&&t.Updates.enqueue(()=>{this.focus()}),Array.from(this.control.children).forEach(o=>{o.addEventListener("click",this.handleClick)})}disconnectedCallback(){super.disconnectedCallback(),Array.from(this.control.children).forEach(o=>{o.removeEventListener("click",this.handleClick)})}}r([t.attr({mode:"boolean"})],i.prototype,"autofocus");r([t.attr({attribute:"form"})],i.prototype,"formId");r([t.attr],i.prototype,"formaction");r([t.attr],i.prototype,"formenctype");r([t.attr],i.prototype,"formmethod");r([t.attr({mode:"boolean"})],i.prototype,"formnovalidate");r([t.attr],i.prototype,"formtarget");r([t.attr],i.prototype,"type");exports.VividFoundationButton=i;
|
package/bundled/button.js
CHANGED
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
import { D as c } from "./delegates-aria.js";
|
|
2
|
-
import { V as d, U as
|
|
3
|
-
import { F as
|
|
2
|
+
import { V as d, U as l, a as o } from "./vivid-element.js";
|
|
3
|
+
import { F as p } from "./form-associated.js";
|
|
4
4
|
var f = Object.defineProperty, i = (n, t, e, m) => {
|
|
5
5
|
for (var r = void 0, a = n.length - 1, h; a >= 0; a--)
|
|
6
6
|
(h = n[a]) && (r = h(t, e, r) || r);
|
|
7
7
|
return r && f(t, e, r), r;
|
|
8
8
|
};
|
|
9
9
|
class s extends c(
|
|
10
|
-
|
|
10
|
+
p(d)
|
|
11
11
|
) {
|
|
12
12
|
constructor() {
|
|
13
13
|
super(...arguments), this.proxy = document.createElement("input"), this.handleClick = (t) => {
|
|
14
|
+
/* v8 ignore else -- @preserve */
|
|
14
15
|
this.disabled && t.stopPropagation();
|
|
15
16
|
}, this.handleSubmission = () => {
|
|
16
17
|
this.form && (this.attachProxy(), this.form.requestSubmit(this.proxy), this.detachProxy());
|
|
17
18
|
}, this.handleFormReset = () => {
|
|
18
19
|
this.form?.reset();
|
|
19
20
|
}, this.handleUnsupportedDelegatesFocus = () => {
|
|
21
|
+
/* v8 ignore else -- @preserve */
|
|
20
22
|
this.$fastController.definition.shadowOptions && window.ShadowRoot && /* eslint-disable-next-line */
|
|
21
23
|
!window.ShadowRoot.prototype.hasOwnProperty("delegatesFocus") && this.$fastController.definition.shadowOptions.delegatesFocus && Object.defineProperty(this, "focus", {
|
|
22
24
|
value: () => {
|
|
@@ -28,26 +30,32 @@ class s extends c(
|
|
|
28
30
|
}
|
|
29
31
|
// @ts-expect-error Function is delcared but not used
|
|
30
32
|
formactionChanged() {
|
|
33
|
+
/* v8 ignore if -- @preserve */
|
|
31
34
|
this.proxy instanceof HTMLInputElement && (this.proxy.formAction = this.formaction);
|
|
32
35
|
}
|
|
33
36
|
// @ts-expect-error Function is delcared but not used
|
|
34
37
|
formenctypeChanged() {
|
|
38
|
+
/* v8 ignore if -- @preserve */
|
|
35
39
|
this.proxy instanceof HTMLInputElement && (this.proxy.formEnctype = this.formenctype);
|
|
36
40
|
}
|
|
37
41
|
// @ts-expect-error Function is delcared but not used
|
|
38
42
|
formmethodChanged() {
|
|
43
|
+
/* v8 ignore if -- @preserve */
|
|
39
44
|
this.proxy instanceof HTMLInputElement && (this.proxy.formMethod = this.formmethod);
|
|
40
45
|
}
|
|
41
46
|
// @ts-expect-error Function is delcared but not used
|
|
42
47
|
formnovalidateChanged() {
|
|
48
|
+
/* v8 ignore if -- @preserve */
|
|
43
49
|
this.proxy instanceof HTMLInputElement && (this.proxy.formNoValidate = this.formnovalidate);
|
|
44
50
|
}
|
|
45
51
|
// @ts-expect-error Function is delcared but not used
|
|
46
52
|
formtargetChanged() {
|
|
53
|
+
/* v8 ignore if -- @preserve */
|
|
47
54
|
this.proxy instanceof HTMLInputElement && (this.proxy.formTarget = this.formtarget);
|
|
48
55
|
}
|
|
49
56
|
// @ts-expect-error Function is delcared but not used
|
|
50
57
|
typeChanged(t, e) {
|
|
58
|
+
/* v8 ignore if -- @preserve */
|
|
51
59
|
this.proxy instanceof HTMLInputElement && (this.proxy.type = this.type), e === "submit" && this.addEventListener("click", this.handleSubmission), t === "submit" && this.removeEventListener("click", this.handleSubmission), e === "reset" && this.addEventListener("click", this.handleFormReset), t === "reset" && this.removeEventListener("click", this.handleFormReset);
|
|
52
60
|
}
|
|
53
61
|
/** {@inheritDoc (FormAssociated:interface).validate} */
|
|
@@ -58,11 +66,9 @@ class s extends c(
|
|
|
58
66
|
* @internal
|
|
59
67
|
*/
|
|
60
68
|
connectedCallback() {
|
|
61
|
-
super.connectedCallback(), this.proxy.setAttribute("type", this.type), this.handleUnsupportedDelegatesFocus(), this.autofocus &&
|
|
69
|
+
super.connectedCallback(), this.proxy.setAttribute("type", this.type), this.handleUnsupportedDelegatesFocus(), this.autofocus && l.enqueue(() => {
|
|
62
70
|
this.focus();
|
|
63
|
-
})
|
|
64
|
-
const t = Array.from(this.control.children);
|
|
65
|
-
t && t.forEach((e) => {
|
|
71
|
+
}), Array.from(this.control.children).forEach((e) => {
|
|
66
72
|
e.addEventListener("click", this.handleClick);
|
|
67
73
|
});
|
|
68
74
|
}
|
|
@@ -70,9 +76,7 @@ class s extends c(
|
|
|
70
76
|
* @internal
|
|
71
77
|
*/
|
|
72
78
|
disconnectedCallback() {
|
|
73
|
-
super.disconnectedCallback()
|
|
74
|
-
const t = Array.from(this.control.children);
|
|
75
|
-
t && t.forEach((e) => {
|
|
79
|
+
super.disconnectedCallback(), Array.from(this.control.children).forEach((e) => {
|
|
76
80
|
e.removeEventListener("click", this.handleClick);
|
|
77
81
|
});
|
|
78
82
|
}
|