@vonage/vivid 4.11.0 → 4.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +899 -442
- package/lib/accordion/accordion.d.ts +21 -2
- package/lib/accordion-item/accordion-item.d.ts +6 -2
- package/lib/calendar/calendar.d.ts +1 -1
- package/lib/date-picker/date-picker.d.ts +1 -0
- package/lib/fab/fab.d.ts +2 -2
- package/lib/radio/radio.d.ts +12 -2
- package/lib/radio/radio.form-associated.d.ts +10 -0
- package/lib/radio-group/radio-group.d.ts +20 -2
- package/lib/tab/tab.d.ts +3 -2
- package/lib/tab-panel/tab-panel.d.ts +2 -2
- package/lib/tabs/tabs.d.ts +30 -9
- package/package.json +1 -1
- package/shared/date-picker/date-picker-base.d.ts +1 -0
- package/shared/definition.cjs +29 -72
- package/shared/definition.js +30 -73
- package/shared/definition16.cjs +1 -2
- package/shared/definition16.js +1 -2
- package/shared/definition17.cjs +2 -2
- package/shared/definition17.js +2 -2
- package/shared/definition18.cjs +6 -1
- package/shared/definition18.js +6 -1
- package/shared/definition19.cjs +17 -8
- package/shared/definition19.js +17 -8
- package/shared/definition2.cjs +154 -187
- package/shared/definition2.js +157 -190
- package/shared/definition20.cjs +1 -1
- package/shared/definition20.js +1 -1
- package/shared/definition24.cjs +11 -11
- package/shared/definition24.js +11 -11
- package/shared/definition29.cjs +2 -2
- package/shared/definition29.js +2 -2
- package/shared/definition35.cjs +1 -1
- package/shared/definition35.js +1 -1
- package/shared/definition40.cjs +226 -399
- package/shared/definition40.js +229 -402
- package/shared/definition42.cjs +3 -2
- package/shared/definition42.js +3 -2
- package/shared/definition43.cjs +1 -0
- package/shared/definition43.js +1 -0
- package/shared/definition44.cjs +1 -1
- package/shared/definition44.js +1 -1
- package/shared/definition47.cjs +3 -2
- package/shared/definition47.js +3 -2
- package/shared/definition49.cjs +1 -1
- package/shared/definition49.js +1 -1
- package/shared/definition5.cjs +1 -1
- package/shared/definition5.js +1 -1
- package/shared/definition50.cjs +1 -11
- package/shared/definition50.js +1 -11
- package/shared/definition51.cjs +4 -14
- package/shared/definition51.js +5 -15
- package/shared/definition52.cjs +269 -19
- package/shared/definition52.js +273 -23
- package/shared/definition57.cjs +26 -4
- package/shared/definition57.js +27 -5
- package/shared/definition58.cjs +1 -1
- package/shared/definition58.js +1 -1
- package/shared/definition59.cjs +1 -1
- package/shared/definition59.js +1 -1
- package/shared/definition61.cjs +1 -1
- package/shared/definition61.js +1 -1
- package/shared/definition62.cjs +17 -8
- package/shared/definition62.js +17 -8
- package/shared/definition64.cjs +55 -30
- package/shared/definition64.js +55 -30
- package/shared/form-associated.cjs +1 -1
- package/shared/form-associated.js +1 -1
- package/shared/foundation/button/button.d.ts +1 -1
- package/shared/foundation/button/button.template.d.ts +2 -2
- package/shared/icon.cjs +1 -1
- package/shared/icon.js +1 -1
- package/shared/index.cjs +1 -0
- package/shared/index.js +1 -1
- package/shared/key-codes.cjs +1 -94
- package/shared/key-codes.js +2 -89
- package/shared/key-codes2.cjs +87 -1
- package/shared/key-codes2.js +83 -2
- package/shared/listbox.cjs +6 -7
- package/shared/listbox.js +3 -4
- package/shared/numbers.cjs +0 -12
- package/shared/numbers.js +1 -12
- package/shared/presentationDate.cjs +14 -0
- package/shared/presentationDate.js +15 -1
- package/shared/radio.cjs +92 -117
- package/shared/radio.js +93 -118
- package/shared/slider.template.cjs +2 -15
- package/shared/slider.template.js +2 -14
- package/shared/strings.cjs +26 -0
- package/shared/strings.js +25 -1
- 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/shared/key-codes2.cjs
CHANGED
|
@@ -1,5 +1,81 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Key Code values
|
|
5
|
+
* @deprecated - KeyCodes are deprecated, use individual string key exports
|
|
6
|
+
*/
|
|
7
|
+
var KeyCodes;
|
|
8
|
+
(function (KeyCodes) {
|
|
9
|
+
KeyCodes[KeyCodes["alt"] = 18] = "alt";
|
|
10
|
+
KeyCodes[KeyCodes["arrowDown"] = 40] = "arrowDown";
|
|
11
|
+
KeyCodes[KeyCodes["arrowLeft"] = 37] = "arrowLeft";
|
|
12
|
+
KeyCodes[KeyCodes["arrowRight"] = 39] = "arrowRight";
|
|
13
|
+
KeyCodes[KeyCodes["arrowUp"] = 38] = "arrowUp";
|
|
14
|
+
KeyCodes[KeyCodes["back"] = 8] = "back";
|
|
15
|
+
KeyCodes[KeyCodes["backSlash"] = 220] = "backSlash";
|
|
16
|
+
KeyCodes[KeyCodes["break"] = 19] = "break";
|
|
17
|
+
KeyCodes[KeyCodes["capsLock"] = 20] = "capsLock";
|
|
18
|
+
KeyCodes[KeyCodes["closeBracket"] = 221] = "closeBracket";
|
|
19
|
+
KeyCodes[KeyCodes["colon"] = 186] = "colon";
|
|
20
|
+
KeyCodes[KeyCodes["colon2"] = 59] = "colon2";
|
|
21
|
+
KeyCodes[KeyCodes["comma"] = 188] = "comma";
|
|
22
|
+
KeyCodes[KeyCodes["ctrl"] = 17] = "ctrl";
|
|
23
|
+
KeyCodes[KeyCodes["delete"] = 46] = "delete";
|
|
24
|
+
KeyCodes[KeyCodes["end"] = 35] = "end";
|
|
25
|
+
KeyCodes[KeyCodes["enter"] = 13] = "enter";
|
|
26
|
+
KeyCodes[KeyCodes["equals"] = 187] = "equals";
|
|
27
|
+
KeyCodes[KeyCodes["equals2"] = 61] = "equals2";
|
|
28
|
+
KeyCodes[KeyCodes["equals3"] = 107] = "equals3";
|
|
29
|
+
KeyCodes[KeyCodes["escape"] = 27] = "escape";
|
|
30
|
+
KeyCodes[KeyCodes["forwardSlash"] = 191] = "forwardSlash";
|
|
31
|
+
KeyCodes[KeyCodes["function1"] = 112] = "function1";
|
|
32
|
+
KeyCodes[KeyCodes["function10"] = 121] = "function10";
|
|
33
|
+
KeyCodes[KeyCodes["function11"] = 122] = "function11";
|
|
34
|
+
KeyCodes[KeyCodes["function12"] = 123] = "function12";
|
|
35
|
+
KeyCodes[KeyCodes["function2"] = 113] = "function2";
|
|
36
|
+
KeyCodes[KeyCodes["function3"] = 114] = "function3";
|
|
37
|
+
KeyCodes[KeyCodes["function4"] = 115] = "function4";
|
|
38
|
+
KeyCodes[KeyCodes["function5"] = 116] = "function5";
|
|
39
|
+
KeyCodes[KeyCodes["function6"] = 117] = "function6";
|
|
40
|
+
KeyCodes[KeyCodes["function7"] = 118] = "function7";
|
|
41
|
+
KeyCodes[KeyCodes["function8"] = 119] = "function8";
|
|
42
|
+
KeyCodes[KeyCodes["function9"] = 120] = "function9";
|
|
43
|
+
KeyCodes[KeyCodes["home"] = 36] = "home";
|
|
44
|
+
KeyCodes[KeyCodes["insert"] = 45] = "insert";
|
|
45
|
+
KeyCodes[KeyCodes["menu"] = 93] = "menu";
|
|
46
|
+
KeyCodes[KeyCodes["minus"] = 189] = "minus";
|
|
47
|
+
KeyCodes[KeyCodes["minus2"] = 109] = "minus2";
|
|
48
|
+
KeyCodes[KeyCodes["numLock"] = 144] = "numLock";
|
|
49
|
+
KeyCodes[KeyCodes["numPad0"] = 96] = "numPad0";
|
|
50
|
+
KeyCodes[KeyCodes["numPad1"] = 97] = "numPad1";
|
|
51
|
+
KeyCodes[KeyCodes["numPad2"] = 98] = "numPad2";
|
|
52
|
+
KeyCodes[KeyCodes["numPad3"] = 99] = "numPad3";
|
|
53
|
+
KeyCodes[KeyCodes["numPad4"] = 100] = "numPad4";
|
|
54
|
+
KeyCodes[KeyCodes["numPad5"] = 101] = "numPad5";
|
|
55
|
+
KeyCodes[KeyCodes["numPad6"] = 102] = "numPad6";
|
|
56
|
+
KeyCodes[KeyCodes["numPad7"] = 103] = "numPad7";
|
|
57
|
+
KeyCodes[KeyCodes["numPad8"] = 104] = "numPad8";
|
|
58
|
+
KeyCodes[KeyCodes["numPad9"] = 105] = "numPad9";
|
|
59
|
+
KeyCodes[KeyCodes["numPadDivide"] = 111] = "numPadDivide";
|
|
60
|
+
KeyCodes[KeyCodes["numPadDot"] = 110] = "numPadDot";
|
|
61
|
+
KeyCodes[KeyCodes["numPadMinus"] = 109] = "numPadMinus";
|
|
62
|
+
KeyCodes[KeyCodes["numPadMultiply"] = 106] = "numPadMultiply";
|
|
63
|
+
KeyCodes[KeyCodes["numPadPlus"] = 107] = "numPadPlus";
|
|
64
|
+
KeyCodes[KeyCodes["openBracket"] = 219] = "openBracket";
|
|
65
|
+
KeyCodes[KeyCodes["pageDown"] = 34] = "pageDown";
|
|
66
|
+
KeyCodes[KeyCodes["pageUp"] = 33] = "pageUp";
|
|
67
|
+
KeyCodes[KeyCodes["period"] = 190] = "period";
|
|
68
|
+
KeyCodes[KeyCodes["print"] = 44] = "print";
|
|
69
|
+
KeyCodes[KeyCodes["quote"] = 222] = "quote";
|
|
70
|
+
KeyCodes[KeyCodes["scrollLock"] = 145] = "scrollLock";
|
|
71
|
+
KeyCodes[KeyCodes["shift"] = 16] = "shift";
|
|
72
|
+
KeyCodes[KeyCodes["space"] = 32] = "space";
|
|
73
|
+
KeyCodes[KeyCodes["tab"] = 9] = "tab";
|
|
74
|
+
KeyCodes[KeyCodes["tilde"] = 192] = "tilde";
|
|
75
|
+
KeyCodes[KeyCodes["windowsLeft"] = 91] = "windowsLeft";
|
|
76
|
+
KeyCodes[KeyCodes["windowsOpera"] = 219] = "windowsOpera";
|
|
77
|
+
KeyCodes[KeyCodes["windowsRight"] = 92] = "windowsRight";
|
|
78
|
+
})(KeyCodes || (KeyCodes = {}));
|
|
3
79
|
/**
|
|
4
80
|
* String values for use with KeyboardEvent.key
|
|
5
81
|
*/
|
|
@@ -7,10 +83,15 @@ const keyArrowDown = "ArrowDown";
|
|
|
7
83
|
const keyArrowLeft = "ArrowLeft";
|
|
8
84
|
const keyArrowRight = "ArrowRight";
|
|
9
85
|
const keyArrowUp = "ArrowUp";
|
|
10
|
-
const keyEnd = "End";
|
|
11
86
|
const keyEnter = "Enter";
|
|
87
|
+
const keyEscape = "Escape";
|
|
12
88
|
const keyHome = "Home";
|
|
89
|
+
const keyEnd = "End";
|
|
90
|
+
const keyFunction2 = "F2";
|
|
91
|
+
const keyPageDown = "PageDown";
|
|
92
|
+
const keyPageUp = "PageUp";
|
|
13
93
|
const keySpace = " ";
|
|
94
|
+
const keyTab = "Tab";
|
|
14
95
|
|
|
15
96
|
exports.keyArrowDown = keyArrowDown;
|
|
16
97
|
exports.keyArrowLeft = keyArrowLeft;
|
|
@@ -18,5 +99,10 @@ exports.keyArrowRight = keyArrowRight;
|
|
|
18
99
|
exports.keyArrowUp = keyArrowUp;
|
|
19
100
|
exports.keyEnd = keyEnd;
|
|
20
101
|
exports.keyEnter = keyEnter;
|
|
102
|
+
exports.keyEscape = keyEscape;
|
|
103
|
+
exports.keyFunction2 = keyFunction2;
|
|
21
104
|
exports.keyHome = keyHome;
|
|
105
|
+
exports.keyPageDown = keyPageDown;
|
|
106
|
+
exports.keyPageUp = keyPageUp;
|
|
22
107
|
exports.keySpace = keySpace;
|
|
108
|
+
exports.keyTab = keyTab;
|
package/shared/key-codes2.js
CHANGED
|
@@ -1,3 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Key Code values
|
|
3
|
+
* @deprecated - KeyCodes are deprecated, use individual string key exports
|
|
4
|
+
*/
|
|
5
|
+
var KeyCodes;
|
|
6
|
+
(function (KeyCodes) {
|
|
7
|
+
KeyCodes[KeyCodes["alt"] = 18] = "alt";
|
|
8
|
+
KeyCodes[KeyCodes["arrowDown"] = 40] = "arrowDown";
|
|
9
|
+
KeyCodes[KeyCodes["arrowLeft"] = 37] = "arrowLeft";
|
|
10
|
+
KeyCodes[KeyCodes["arrowRight"] = 39] = "arrowRight";
|
|
11
|
+
KeyCodes[KeyCodes["arrowUp"] = 38] = "arrowUp";
|
|
12
|
+
KeyCodes[KeyCodes["back"] = 8] = "back";
|
|
13
|
+
KeyCodes[KeyCodes["backSlash"] = 220] = "backSlash";
|
|
14
|
+
KeyCodes[KeyCodes["break"] = 19] = "break";
|
|
15
|
+
KeyCodes[KeyCodes["capsLock"] = 20] = "capsLock";
|
|
16
|
+
KeyCodes[KeyCodes["closeBracket"] = 221] = "closeBracket";
|
|
17
|
+
KeyCodes[KeyCodes["colon"] = 186] = "colon";
|
|
18
|
+
KeyCodes[KeyCodes["colon2"] = 59] = "colon2";
|
|
19
|
+
KeyCodes[KeyCodes["comma"] = 188] = "comma";
|
|
20
|
+
KeyCodes[KeyCodes["ctrl"] = 17] = "ctrl";
|
|
21
|
+
KeyCodes[KeyCodes["delete"] = 46] = "delete";
|
|
22
|
+
KeyCodes[KeyCodes["end"] = 35] = "end";
|
|
23
|
+
KeyCodes[KeyCodes["enter"] = 13] = "enter";
|
|
24
|
+
KeyCodes[KeyCodes["equals"] = 187] = "equals";
|
|
25
|
+
KeyCodes[KeyCodes["equals2"] = 61] = "equals2";
|
|
26
|
+
KeyCodes[KeyCodes["equals3"] = 107] = "equals3";
|
|
27
|
+
KeyCodes[KeyCodes["escape"] = 27] = "escape";
|
|
28
|
+
KeyCodes[KeyCodes["forwardSlash"] = 191] = "forwardSlash";
|
|
29
|
+
KeyCodes[KeyCodes["function1"] = 112] = "function1";
|
|
30
|
+
KeyCodes[KeyCodes["function10"] = 121] = "function10";
|
|
31
|
+
KeyCodes[KeyCodes["function11"] = 122] = "function11";
|
|
32
|
+
KeyCodes[KeyCodes["function12"] = 123] = "function12";
|
|
33
|
+
KeyCodes[KeyCodes["function2"] = 113] = "function2";
|
|
34
|
+
KeyCodes[KeyCodes["function3"] = 114] = "function3";
|
|
35
|
+
KeyCodes[KeyCodes["function4"] = 115] = "function4";
|
|
36
|
+
KeyCodes[KeyCodes["function5"] = 116] = "function5";
|
|
37
|
+
KeyCodes[KeyCodes["function6"] = 117] = "function6";
|
|
38
|
+
KeyCodes[KeyCodes["function7"] = 118] = "function7";
|
|
39
|
+
KeyCodes[KeyCodes["function8"] = 119] = "function8";
|
|
40
|
+
KeyCodes[KeyCodes["function9"] = 120] = "function9";
|
|
41
|
+
KeyCodes[KeyCodes["home"] = 36] = "home";
|
|
42
|
+
KeyCodes[KeyCodes["insert"] = 45] = "insert";
|
|
43
|
+
KeyCodes[KeyCodes["menu"] = 93] = "menu";
|
|
44
|
+
KeyCodes[KeyCodes["minus"] = 189] = "minus";
|
|
45
|
+
KeyCodes[KeyCodes["minus2"] = 109] = "minus2";
|
|
46
|
+
KeyCodes[KeyCodes["numLock"] = 144] = "numLock";
|
|
47
|
+
KeyCodes[KeyCodes["numPad0"] = 96] = "numPad0";
|
|
48
|
+
KeyCodes[KeyCodes["numPad1"] = 97] = "numPad1";
|
|
49
|
+
KeyCodes[KeyCodes["numPad2"] = 98] = "numPad2";
|
|
50
|
+
KeyCodes[KeyCodes["numPad3"] = 99] = "numPad3";
|
|
51
|
+
KeyCodes[KeyCodes["numPad4"] = 100] = "numPad4";
|
|
52
|
+
KeyCodes[KeyCodes["numPad5"] = 101] = "numPad5";
|
|
53
|
+
KeyCodes[KeyCodes["numPad6"] = 102] = "numPad6";
|
|
54
|
+
KeyCodes[KeyCodes["numPad7"] = 103] = "numPad7";
|
|
55
|
+
KeyCodes[KeyCodes["numPad8"] = 104] = "numPad8";
|
|
56
|
+
KeyCodes[KeyCodes["numPad9"] = 105] = "numPad9";
|
|
57
|
+
KeyCodes[KeyCodes["numPadDivide"] = 111] = "numPadDivide";
|
|
58
|
+
KeyCodes[KeyCodes["numPadDot"] = 110] = "numPadDot";
|
|
59
|
+
KeyCodes[KeyCodes["numPadMinus"] = 109] = "numPadMinus";
|
|
60
|
+
KeyCodes[KeyCodes["numPadMultiply"] = 106] = "numPadMultiply";
|
|
61
|
+
KeyCodes[KeyCodes["numPadPlus"] = 107] = "numPadPlus";
|
|
62
|
+
KeyCodes[KeyCodes["openBracket"] = 219] = "openBracket";
|
|
63
|
+
KeyCodes[KeyCodes["pageDown"] = 34] = "pageDown";
|
|
64
|
+
KeyCodes[KeyCodes["pageUp"] = 33] = "pageUp";
|
|
65
|
+
KeyCodes[KeyCodes["period"] = 190] = "period";
|
|
66
|
+
KeyCodes[KeyCodes["print"] = 44] = "print";
|
|
67
|
+
KeyCodes[KeyCodes["quote"] = 222] = "quote";
|
|
68
|
+
KeyCodes[KeyCodes["scrollLock"] = 145] = "scrollLock";
|
|
69
|
+
KeyCodes[KeyCodes["shift"] = 16] = "shift";
|
|
70
|
+
KeyCodes[KeyCodes["space"] = 32] = "space";
|
|
71
|
+
KeyCodes[KeyCodes["tab"] = 9] = "tab";
|
|
72
|
+
KeyCodes[KeyCodes["tilde"] = 192] = "tilde";
|
|
73
|
+
KeyCodes[KeyCodes["windowsLeft"] = 91] = "windowsLeft";
|
|
74
|
+
KeyCodes[KeyCodes["windowsOpera"] = 219] = "windowsOpera";
|
|
75
|
+
KeyCodes[KeyCodes["windowsRight"] = 92] = "windowsRight";
|
|
76
|
+
})(KeyCodes || (KeyCodes = {}));
|
|
1
77
|
/**
|
|
2
78
|
* String values for use with KeyboardEvent.key
|
|
3
79
|
*/
|
|
@@ -5,9 +81,14 @@ const keyArrowDown = "ArrowDown";
|
|
|
5
81
|
const keyArrowLeft = "ArrowLeft";
|
|
6
82
|
const keyArrowRight = "ArrowRight";
|
|
7
83
|
const keyArrowUp = "ArrowUp";
|
|
8
|
-
const keyEnd = "End";
|
|
9
84
|
const keyEnter = "Enter";
|
|
85
|
+
const keyEscape = "Escape";
|
|
10
86
|
const keyHome = "Home";
|
|
87
|
+
const keyEnd = "End";
|
|
88
|
+
const keyFunction2 = "F2";
|
|
89
|
+
const keyPageDown = "PageDown";
|
|
90
|
+
const keyPageUp = "PageUp";
|
|
11
91
|
const keySpace = " ";
|
|
92
|
+
const keyTab = "Tab";
|
|
12
93
|
|
|
13
|
-
export {
|
|
94
|
+
export { keySpace as a, keyEscape as b, keyTab as c, keyEnd as d, keyArrowUp as e, keyArrowDown as f, keyHome as g, keyArrowRight as h, keyArrowLeft as i, keyPageDown as j, keyEnter as k, keyPageUp as l, keyFunction2 as m };
|
package/shared/listbox.cjs
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const keyCodes$1 = require('./key-
|
|
3
|
+
const keyCodes$1 = require('./key-codes.cjs');
|
|
4
4
|
const index = require('./index.cjs');
|
|
5
5
|
const listboxOption = require('./listbox-option.cjs');
|
|
6
6
|
const ariaGlobal = require('./aria-global.cjs');
|
|
7
7
|
const applyMixins = require('./apply-mixins.cjs');
|
|
8
|
-
const keyCodes = require('./key-
|
|
8
|
+
const keyCodes = require('./key-codes2.cjs');
|
|
9
9
|
const strings = require('./strings.cjs');
|
|
10
|
-
const numbers = require('./numbers.cjs');
|
|
11
10
|
|
|
12
11
|
/**
|
|
13
12
|
* Returns the index of the last element in the array where predicate is true, and -1 otherwise.
|
|
@@ -642,7 +641,7 @@ class ListboxElement extends Listbox$1 {
|
|
|
642
641
|
this.rangeStartIndex = this.activeIndex + 1;
|
|
643
642
|
}
|
|
644
643
|
this.options.forEach((o, i) => {
|
|
645
|
-
o.checked =
|
|
644
|
+
o.checked = strings.inRange(i, this.rangeStartIndex);
|
|
646
645
|
});
|
|
647
646
|
}
|
|
648
647
|
else {
|
|
@@ -667,7 +666,7 @@ class ListboxElement extends Listbox$1 {
|
|
|
667
666
|
this.rangeStartIndex = this.activeIndex;
|
|
668
667
|
}
|
|
669
668
|
this.options.forEach((o, i) => {
|
|
670
|
-
o.checked =
|
|
669
|
+
o.checked = strings.inRange(i, this.rangeStartIndex, this.options.length);
|
|
671
670
|
});
|
|
672
671
|
}
|
|
673
672
|
else {
|
|
@@ -708,7 +707,7 @@ class ListboxElement extends Listbox$1 {
|
|
|
708
707
|
this.rangeStartIndex = this.activeIndex;
|
|
709
708
|
}
|
|
710
709
|
this.options.forEach((o, i) => {
|
|
711
|
-
o.checked =
|
|
710
|
+
o.checked = strings.inRange(i, this.rangeStartIndex, this.activeIndex + 1);
|
|
712
711
|
});
|
|
713
712
|
}
|
|
714
713
|
else {
|
|
@@ -736,7 +735,7 @@ class ListboxElement extends Listbox$1 {
|
|
|
736
735
|
this.rangeStartIndex += 1;
|
|
737
736
|
}
|
|
738
737
|
this.options.forEach((o, i) => {
|
|
739
|
-
o.checked =
|
|
738
|
+
o.checked = strings.inRange(i, this.activeIndex, this.rangeStartIndex);
|
|
740
739
|
});
|
|
741
740
|
}
|
|
742
741
|
else {
|
package/shared/listbox.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { e as keyArrowLeft, f as keyArrowRight } from './key-codes.js';
|
|
2
2
|
import { F as FoundationElement, O as Observable, _ as __decorate, a as attr, o as observable, D as DOM, n as nullableNumberConverter } from './index.js';
|
|
3
3
|
import { i as isListboxOption } from './listbox-option.js';
|
|
4
4
|
import { A as ARIAGlobalStatesAndProperties } from './aria-global.js';
|
|
5
5
|
import { a as applyMixins } from './apply-mixins.js';
|
|
6
|
-
import { a as keySpace, b as keyEscape, k as keyEnter, c as keyTab, d as keyEnd, e as keyArrowUp, f as keyArrowDown, g as keyHome } from './key-
|
|
7
|
-
import { u as uniqueId } from './strings.js';
|
|
8
|
-
import { i as inRange } from './numbers.js';
|
|
6
|
+
import { a as keySpace, b as keyEscape, k as keyEnter, c as keyTab, d as keyEnd, e as keyArrowUp, f as keyArrowDown, g as keyHome } from './key-codes2.js';
|
|
7
|
+
import { u as uniqueId, i as inRange } from './strings.js';
|
|
9
8
|
|
|
10
9
|
/**
|
|
11
10
|
* Returns the index of the last element in the array where predicate is true, and -1 otherwise.
|
package/shared/numbers.cjs
CHANGED
|
@@ -21,18 +21,6 @@ function wrapInBounds(min, max, value) {
|
|
|
21
21
|
function limit(min, max, value) {
|
|
22
22
|
return Math.min(Math.max(value, min), max);
|
|
23
23
|
}
|
|
24
|
-
/**
|
|
25
|
-
* Determines if a number value is within a specified range.
|
|
26
|
-
*
|
|
27
|
-
* @param value - the value to check
|
|
28
|
-
* @param min - the range start
|
|
29
|
-
* @param max - the range end
|
|
30
|
-
*/
|
|
31
|
-
function inRange(value, min, max = 0) {
|
|
32
|
-
[min, max] = [min, max].sort((a, b) => a - b);
|
|
33
|
-
return min <= value && value < max;
|
|
34
|
-
}
|
|
35
24
|
|
|
36
|
-
exports.inRange = inRange;
|
|
37
25
|
exports.limit = limit;
|
|
38
26
|
exports.wrapInBounds = wrapInBounds;
|
package/shared/numbers.js
CHANGED
|
@@ -19,16 +19,5 @@ function wrapInBounds(min, max, value) {
|
|
|
19
19
|
function limit(min, max, value) {
|
|
20
20
|
return Math.min(Math.max(value, min), max);
|
|
21
21
|
}
|
|
22
|
-
/**
|
|
23
|
-
* Determines if a number value is within a specified range.
|
|
24
|
-
*
|
|
25
|
-
* @param value - the value to check
|
|
26
|
-
* @param min - the range start
|
|
27
|
-
* @param max - the range end
|
|
28
|
-
*/
|
|
29
|
-
function inRange(value, min, max = 0) {
|
|
30
|
-
[min, max] = [min, max].sort((a, b) => a - b);
|
|
31
|
-
return min <= value && value < max;
|
|
32
|
-
}
|
|
33
22
|
|
|
34
|
-
export {
|
|
23
|
+
export { limit as l, wrapInBounds as w };
|
|
@@ -5991,6 +5991,12 @@ class DatePickerBase extends FormAssociatedDatePickerBase {
|
|
|
5991
5991
|
this.#onFocusOut = () => {
|
|
5992
5992
|
this.$emit("blur", void 0, { bubbles: false });
|
|
5993
5993
|
};
|
|
5994
|
+
// Reformat the presentation value when the locale changes
|
|
5995
|
+
this.#localeChangeHandler = {
|
|
5996
|
+
handleChange: () => {
|
|
5997
|
+
this._updatePresentationValue();
|
|
5998
|
+
}
|
|
5999
|
+
};
|
|
5994
6000
|
this._popupOpen = false;
|
|
5995
6001
|
this.#dismissOnClickOutside = (event) => {
|
|
5996
6002
|
if (!this._popupOpen) {
|
|
@@ -6081,12 +6087,18 @@ class DatePickerBase extends FormAssociatedDatePickerBase {
|
|
|
6081
6087
|
document.addEventListener("click", this.#dismissOnClickOutside);
|
|
6082
6088
|
this.addEventListener("focusin", this.#onFocusIn);
|
|
6083
6089
|
this.addEventListener("focusout", this.#onFocusOut);
|
|
6090
|
+
this.#localeChangeObserver = index.Observable.binding(
|
|
6091
|
+
() => this.locale,
|
|
6092
|
+
this.#localeChangeHandler
|
|
6093
|
+
);
|
|
6094
|
+
this.#localeChangeObserver.observe(this, index.defaultExecutionContext);
|
|
6084
6095
|
}
|
|
6085
6096
|
disconnectedCallback() {
|
|
6086
6097
|
super.disconnectedCallback();
|
|
6087
6098
|
document.removeEventListener("click", this.#dismissOnClickOutside);
|
|
6088
6099
|
this.removeEventListener("focusin", this.#onFocusIn);
|
|
6089
6100
|
this.removeEventListener("focusout", this.#onFocusOut);
|
|
6101
|
+
this.#localeChangeObserver.disconnect();
|
|
6090
6102
|
}
|
|
6091
6103
|
#onFocusIn;
|
|
6092
6104
|
#onFocusOut;
|
|
@@ -6099,6 +6111,8 @@ class DatePickerBase extends FormAssociatedDatePickerBase {
|
|
|
6099
6111
|
}
|
|
6100
6112
|
super.validate(this._textFieldEl?.querySelector("input") ?? void 0);
|
|
6101
6113
|
}
|
|
6114
|
+
#localeChangeHandler;
|
|
6115
|
+
#localeChangeObserver;
|
|
6102
6116
|
#dismissOnClickOutside;
|
|
6103
6117
|
#openPopupIfPossible() {
|
|
6104
6118
|
if (!this.readOnly) {
|
|
@@ -2,7 +2,7 @@ import { c as Button } from './definition11.js';
|
|
|
2
2
|
import { P as Popup } from './definition64.js';
|
|
3
3
|
import { T as TextField } from './definition56.js';
|
|
4
4
|
import { D as Divider } from './definition22.js';
|
|
5
|
-
import { h as html, F as FoundationElement, D as DOM, a as attr, o as observable, v as volatile } from './index.js';
|
|
5
|
+
import { h as html, F as FoundationElement, O as Observable, g as defaultExecutionContext, D as DOM, a as attr, o as observable, v as volatile } from './index.js';
|
|
6
6
|
import { r as ref } from './ref.js';
|
|
7
7
|
import { s as slotted } from './slotted.js';
|
|
8
8
|
import { r as repeat } from './repeat.js';
|
|
@@ -5989,6 +5989,12 @@ class DatePickerBase extends FormAssociatedDatePickerBase {
|
|
|
5989
5989
|
this.#onFocusOut = () => {
|
|
5990
5990
|
this.$emit("blur", void 0, { bubbles: false });
|
|
5991
5991
|
};
|
|
5992
|
+
// Reformat the presentation value when the locale changes
|
|
5993
|
+
this.#localeChangeHandler = {
|
|
5994
|
+
handleChange: () => {
|
|
5995
|
+
this._updatePresentationValue();
|
|
5996
|
+
}
|
|
5997
|
+
};
|
|
5992
5998
|
this._popupOpen = false;
|
|
5993
5999
|
this.#dismissOnClickOutside = (event) => {
|
|
5994
6000
|
if (!this._popupOpen) {
|
|
@@ -6079,12 +6085,18 @@ class DatePickerBase extends FormAssociatedDatePickerBase {
|
|
|
6079
6085
|
document.addEventListener("click", this.#dismissOnClickOutside);
|
|
6080
6086
|
this.addEventListener("focusin", this.#onFocusIn);
|
|
6081
6087
|
this.addEventListener("focusout", this.#onFocusOut);
|
|
6088
|
+
this.#localeChangeObserver = Observable.binding(
|
|
6089
|
+
() => this.locale,
|
|
6090
|
+
this.#localeChangeHandler
|
|
6091
|
+
);
|
|
6092
|
+
this.#localeChangeObserver.observe(this, defaultExecutionContext);
|
|
6082
6093
|
}
|
|
6083
6094
|
disconnectedCallback() {
|
|
6084
6095
|
super.disconnectedCallback();
|
|
6085
6096
|
document.removeEventListener("click", this.#dismissOnClickOutside);
|
|
6086
6097
|
this.removeEventListener("focusin", this.#onFocusIn);
|
|
6087
6098
|
this.removeEventListener("focusout", this.#onFocusOut);
|
|
6099
|
+
this.#localeChangeObserver.disconnect();
|
|
6088
6100
|
}
|
|
6089
6101
|
#onFocusIn;
|
|
6090
6102
|
#onFocusOut;
|
|
@@ -6097,6 +6109,8 @@ class DatePickerBase extends FormAssociatedDatePickerBase {
|
|
|
6097
6109
|
}
|
|
6098
6110
|
super.validate(this._textFieldEl?.querySelector("input") ?? void 0);
|
|
6099
6111
|
}
|
|
6112
|
+
#localeChangeHandler;
|
|
6113
|
+
#localeChangeObserver;
|
|
6100
6114
|
#dismissOnClickOutside;
|
|
6101
6115
|
#openPopupIfPossible() {
|
|
6102
6116
|
if (!this.readOnly) {
|
package/shared/radio.cjs
CHANGED
|
@@ -1,128 +1,18 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const index = require('./index.cjs');
|
|
4
3
|
const formAssociated = require('./form-associated.cjs');
|
|
4
|
+
const index = require('./index.cjs');
|
|
5
5
|
const keyCodes = require('./key-codes.cjs');
|
|
6
6
|
|
|
7
7
|
class _Radio extends index.FoundationElement {
|
|
8
8
|
}
|
|
9
|
-
/**
|
|
10
|
-
* A form-associated base class for the {@link @microsoft/fast-foundation#(Radio:class)} component.
|
|
11
|
-
*
|
|
12
|
-
* @internal
|
|
13
|
-
*/
|
|
14
9
|
class FormAssociatedRadio extends formAssociated.CheckableFormAssociated(_Radio) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.proxy = document.createElement("input");
|
|
13
|
+
}
|
|
19
14
|
}
|
|
20
15
|
|
|
21
|
-
/**
|
|
22
|
-
* A Radio Custom HTML Element.
|
|
23
|
-
* Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#radio | ARIA radio }.
|
|
24
|
-
*
|
|
25
|
-
* @slot checked-indicator - The checked indicator
|
|
26
|
-
* @slot - The default slot for the label
|
|
27
|
-
* @csspart control - The element representing the visual radio control
|
|
28
|
-
* @csspart label - The label
|
|
29
|
-
* @fires change - Emits a custom change event when the checked state changes
|
|
30
|
-
*
|
|
31
|
-
* @public
|
|
32
|
-
*/
|
|
33
|
-
let Radio$1 = class Radio extends FormAssociatedRadio {
|
|
34
|
-
constructor() {
|
|
35
|
-
super();
|
|
36
|
-
/**
|
|
37
|
-
* The element's value to be included in form submission when checked.
|
|
38
|
-
* Default to "on" to reach parity with input[type="radio"]
|
|
39
|
-
*
|
|
40
|
-
* @internal
|
|
41
|
-
*/
|
|
42
|
-
this.initialValue = "on";
|
|
43
|
-
/**
|
|
44
|
-
* @internal
|
|
45
|
-
*/
|
|
46
|
-
this.keypressHandler = (e) => {
|
|
47
|
-
switch (e.key) {
|
|
48
|
-
case keyCodes.keySpace:
|
|
49
|
-
if (!this.checked && !this.readOnly) {
|
|
50
|
-
this.checked = true;
|
|
51
|
-
}
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
return true;
|
|
55
|
-
};
|
|
56
|
-
this.proxy.setAttribute("type", "radio");
|
|
57
|
-
}
|
|
58
|
-
readOnlyChanged() {
|
|
59
|
-
if (this.proxy instanceof HTMLInputElement) {
|
|
60
|
-
this.proxy.readOnly = this.readOnly;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* @internal
|
|
65
|
-
*/
|
|
66
|
-
defaultCheckedChanged() {
|
|
67
|
-
var _a;
|
|
68
|
-
if (this.$fastController.isConnected && !this.dirtyChecked) {
|
|
69
|
-
// Setting this.checked will cause us to enter a dirty state,
|
|
70
|
-
// but if we are clean when defaultChecked is changed, we want to stay
|
|
71
|
-
// in a clean state, so reset this.dirtyChecked
|
|
72
|
-
if (!this.isInsideRadioGroup()) {
|
|
73
|
-
this.checked = (_a = this.defaultChecked) !== null && _a !== void 0 ? _a : false;
|
|
74
|
-
this.dirtyChecked = false;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* @internal
|
|
80
|
-
*/
|
|
81
|
-
connectedCallback() {
|
|
82
|
-
var _a, _b;
|
|
83
|
-
super.connectedCallback();
|
|
84
|
-
this.validate();
|
|
85
|
-
if (((_a = this.parentElement) === null || _a === void 0 ? void 0 : _a.getAttribute("role")) !== "radiogroup" &&
|
|
86
|
-
this.getAttribute("tabindex") === null) {
|
|
87
|
-
if (!this.disabled) {
|
|
88
|
-
this.setAttribute("tabindex", "0");
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
if (this.checkedAttribute) {
|
|
92
|
-
if (!this.dirtyChecked) {
|
|
93
|
-
// Setting this.checked will cause us to enter a dirty state,
|
|
94
|
-
// but if we are clean when defaultChecked is changed, we want to stay
|
|
95
|
-
// in a clean state, so reset this.dirtyChecked
|
|
96
|
-
if (!this.isInsideRadioGroup()) {
|
|
97
|
-
this.checked = (_b = this.defaultChecked) !== null && _b !== void 0 ? _b : false;
|
|
98
|
-
this.dirtyChecked = false;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
isInsideRadioGroup() {
|
|
104
|
-
const parent = this.closest("[role=radiogroup]");
|
|
105
|
-
return parent !== null;
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* @internal
|
|
109
|
-
*/
|
|
110
|
-
clickHandler(e) {
|
|
111
|
-
if (!this.disabled && !this.readOnly && !this.checked) {
|
|
112
|
-
this.checked = true;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
index.__decorate([
|
|
117
|
-
index.attr({ attribute: "readonly", mode: "boolean" })
|
|
118
|
-
], Radio$1.prototype, "readOnly", void 0);
|
|
119
|
-
index.__decorate([
|
|
120
|
-
index.observable
|
|
121
|
-
], Radio$1.prototype, "name", void 0);
|
|
122
|
-
index.__decorate([
|
|
123
|
-
index.observable
|
|
124
|
-
], Radio$1.prototype, "defaultSlottedNodes", void 0);
|
|
125
|
-
|
|
126
16
|
var __defProp = Object.defineProperty;
|
|
127
17
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
128
18
|
var result = void 0 ;
|
|
@@ -132,10 +22,86 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
132
22
|
if (result) __defProp(target, key, result);
|
|
133
23
|
return result;
|
|
134
24
|
};
|
|
135
|
-
class Radio extends
|
|
25
|
+
class Radio extends FormAssociatedRadio {
|
|
136
26
|
constructor() {
|
|
137
|
-
super(
|
|
27
|
+
super();
|
|
138
28
|
this.ariaLabel = null;
|
|
29
|
+
/**
|
|
30
|
+
* The element's value to be included in form submission when checked.
|
|
31
|
+
* Default to "on" to reach parity with input[type="radio"]
|
|
32
|
+
*
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
35
|
+
this.initialValue = "on";
|
|
36
|
+
this.defaultSlottedNodes = [];
|
|
37
|
+
/**
|
|
38
|
+
* @internal
|
|
39
|
+
*/
|
|
40
|
+
this.keypressHandler = (e) => {
|
|
41
|
+
switch (e.key) {
|
|
42
|
+
case keyCodes.keySpace:
|
|
43
|
+
if (!this.checked && !this.readOnly) {
|
|
44
|
+
this.checked = true;
|
|
45
|
+
}
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
return true;
|
|
49
|
+
};
|
|
50
|
+
this.proxy.setAttribute("type", "radio");
|
|
51
|
+
}
|
|
52
|
+
// Map to proxy element
|
|
53
|
+
/**
|
|
54
|
+
* @internal
|
|
55
|
+
*/
|
|
56
|
+
readOnlyChanged() {
|
|
57
|
+
if (this.proxy instanceof HTMLInputElement) {
|
|
58
|
+
this.proxy.readOnly = this.readOnly;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* @internal
|
|
63
|
+
*/
|
|
64
|
+
defaultCheckedChanged() {
|
|
65
|
+
if (this.$fastController.isConnected && !this.dirtyChecked) {
|
|
66
|
+
if (!this.isInsideRadioGroup()) {
|
|
67
|
+
this.checked = this.defaultChecked;
|
|
68
|
+
this.dirtyChecked = false;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* @internal
|
|
74
|
+
*/
|
|
75
|
+
connectedCallback() {
|
|
76
|
+
super.connectedCallback();
|
|
77
|
+
this.validate();
|
|
78
|
+
if (this.parentElement.getAttribute("role") !== "radiogroup" && this.getAttribute("tabindex") === null) {
|
|
79
|
+
if (!this.disabled) {
|
|
80
|
+
this.setAttribute("tabindex", "0");
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
if (this.checkedAttribute) {
|
|
84
|
+
if (!this.dirtyChecked) {
|
|
85
|
+
if (!this.isInsideRadioGroup()) {
|
|
86
|
+
this.checked = this.defaultChecked;
|
|
87
|
+
this.dirtyChecked = false;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
isInsideRadioGroup() {
|
|
93
|
+
const parent = this.closest(
|
|
94
|
+
"[role=radiogroup]"
|
|
95
|
+
);
|
|
96
|
+
return parent !== null;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* @internal
|
|
100
|
+
*/
|
|
101
|
+
clickHandler(_) {
|
|
102
|
+
if (!this.disabled && !this.readOnly && !this.checked) {
|
|
103
|
+
this.checked = true;
|
|
104
|
+
}
|
|
139
105
|
}
|
|
140
106
|
}
|
|
141
107
|
__decorateClass([
|
|
@@ -147,5 +113,14 @@ __decorateClass([
|
|
|
147
113
|
__decorateClass([
|
|
148
114
|
index.attr
|
|
149
115
|
], Radio.prototype, "connotation");
|
|
116
|
+
__decorateClass([
|
|
117
|
+
index.attr({ attribute: "readonly", mode: "boolean" })
|
|
118
|
+
], Radio.prototype, "readOnly");
|
|
119
|
+
__decorateClass([
|
|
120
|
+
index.observable
|
|
121
|
+
], Radio.prototype, "name");
|
|
122
|
+
__decorateClass([
|
|
123
|
+
index.observable
|
|
124
|
+
], Radio.prototype, "defaultSlottedNodes");
|
|
150
125
|
|
|
151
126
|
exports.Radio = Radio;
|