@ni/fast-foundation 10.1.1 → 10.1.3
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/dist/dts/di/di.d.ts +3 -3
- package/dist/dts/number-field/number-field.d.ts +1 -0
- package/dist/esm/accordion/accordion.js +1 -3
- package/dist/esm/breadcrumb/breadcrumb.js +12 -6
- package/dist/esm/button/button.js +14 -7
- package/dist/esm/calendar/calendar.js +1 -1
- package/dist/esm/di/di.js +0 -3
- package/dist/esm/number-field/number-field.js +11 -7
- package/dist/esm/switch/switch.js +12 -4
- package/dist/esm/tabs/tabs.js +12 -6
- package/dist/fast-foundation.d.ts +4 -3
- package/dist/fast-foundation.js +79 -42
- package/dist/fast-foundation.min.js +3 -3
- package/package.json +3 -3
package/dist/dts/di/di.d.ts
CHANGED
|
@@ -567,7 +567,7 @@ export declare function transient<T extends Constructable>(target: T & Partial<R
|
|
|
567
567
|
type SingletonOptions = {
|
|
568
568
|
scoped: boolean;
|
|
569
569
|
};
|
|
570
|
-
|
|
570
|
+
type SingletonDecoratorType = <T extends Constructable>(target: T & Partial<RegisterSelf<T>>) => T & RegisterSelf<T>;
|
|
571
571
|
/**
|
|
572
572
|
* Registers the decorated class as a singleton dependency; the class will only be created once. Each
|
|
573
573
|
* consecutive time the dependency is resolved, the same instance will be returned.
|
|
@@ -580,11 +580,11 @@ declare function singletonDecorator<T extends Constructable>(target: T & Partial
|
|
|
580
580
|
*
|
|
581
581
|
* @public
|
|
582
582
|
*/
|
|
583
|
-
export declare function singleton<T extends Constructable>():
|
|
583
|
+
export declare function singleton<T extends Constructable>(): SingletonDecoratorType;
|
|
584
584
|
/**
|
|
585
585
|
* @public
|
|
586
586
|
*/
|
|
587
|
-
export declare function singleton<T extends Constructable>(options?: SingletonOptions):
|
|
587
|
+
export declare function singleton<T extends Constructable>(options?: SingletonOptions): SingletonDecoratorType;
|
|
588
588
|
/**
|
|
589
589
|
* Registers the `target` class as a singleton dependency; the class will only be created once. Each
|
|
590
590
|
* consecutive time the dependency is resolved, the same instance will be returned.
|
|
@@ -160,6 +160,7 @@ export declare class NumberField extends FormAssociatedNumberField {
|
|
|
160
160
|
valueChanged(previous: string, next: string): void;
|
|
161
161
|
/** {@inheritDoc (FormAssociated:interface).validate} */
|
|
162
162
|
validate(): void;
|
|
163
|
+
private limitPrecision;
|
|
163
164
|
/**
|
|
164
165
|
* Sets the internal value to a valid number between the min and max properties
|
|
165
166
|
* @param value - user input
|
|
@@ -54,9 +54,7 @@ export class Accordion extends FoundationElement {
|
|
|
54
54
|
if (item instanceof AccordionItem) {
|
|
55
55
|
item.addEventListener("change", this.activeItemChange);
|
|
56
56
|
if (this.isSingleExpandMode()) {
|
|
57
|
-
this.activeItemIndex
|
|
58
|
-
? (item.expanded = false)
|
|
59
|
-
: (item.expanded = true);
|
|
57
|
+
item.expanded = this.activeItemIndex === index;
|
|
60
58
|
}
|
|
61
59
|
}
|
|
62
60
|
const itemId = this.accordionIds[index];
|
|
@@ -54,14 +54,20 @@ export class Breadcrumb extends FoundationElement {
|
|
|
54
54
|
if (childNodeWithHref === null &&
|
|
55
55
|
item.hasAttribute("href") &&
|
|
56
56
|
item instanceof BreadcrumbItem) {
|
|
57
|
-
isLastNode
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
if (isLastNode) {
|
|
58
|
+
item.setAttribute("aria-current", "page");
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
item.removeAttribute("aria-current");
|
|
62
|
+
}
|
|
60
63
|
}
|
|
61
64
|
else if (childNodeWithHref !== null) {
|
|
62
|
-
isLastNode
|
|
63
|
-
|
|
64
|
-
|
|
65
|
+
if (isLastNode) {
|
|
66
|
+
childNodeWithHref.setAttribute("aria-current", "page");
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
childNodeWithHref.removeAttribute("aria-current");
|
|
70
|
+
}
|
|
65
71
|
}
|
|
66
72
|
}
|
|
67
73
|
}
|
|
@@ -41,9 +41,12 @@ export class Button extends FormAssociatedButton {
|
|
|
41
41
|
}
|
|
42
42
|
// Browser support for requestSubmit is not comprehensive
|
|
43
43
|
// so click the proxy if it isn't supported
|
|
44
|
-
typeof this.form.requestSubmit === "function"
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
if (typeof this.form.requestSubmit === "function") {
|
|
45
|
+
this.form.requestSubmit(this.proxy);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
this.proxy.click();
|
|
49
|
+
}
|
|
47
50
|
if (!attached) {
|
|
48
51
|
this.detachProxy();
|
|
49
52
|
}
|
|
@@ -101,10 +104,14 @@ export class Button extends FormAssociatedButton {
|
|
|
101
104
|
if (this.proxy instanceof HTMLInputElement) {
|
|
102
105
|
this.proxy.type = this.type;
|
|
103
106
|
}
|
|
104
|
-
next === "submit"
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
107
|
+
if (next === "submit")
|
|
108
|
+
this.addEventListener("click", this.handleSubmission);
|
|
109
|
+
if (previous === "submit")
|
|
110
|
+
this.removeEventListener("click", this.handleSubmission);
|
|
111
|
+
if (next === "reset")
|
|
112
|
+
this.addEventListener("click", this.handleFormReset);
|
|
113
|
+
if (previous === "reset")
|
|
114
|
+
this.removeEventListener("click", this.handleFormReset);
|
|
108
115
|
}
|
|
109
116
|
/** {@inheritDoc (FormAssociated:interface).validate} */
|
|
110
117
|
validate() {
|
package/dist/esm/di/di.js
CHANGED
|
@@ -566,9 +566,6 @@ export function transient(target) {
|
|
|
566
566
|
return target == null ? transientDecorator : transientDecorator(target);
|
|
567
567
|
}
|
|
568
568
|
const defaultSingletonOptions = { scoped: false };
|
|
569
|
-
function singletonDecorator(target) {
|
|
570
|
-
return DI.singleton(target);
|
|
571
|
-
}
|
|
572
569
|
/**
|
|
573
570
|
* @public
|
|
574
571
|
*/
|
|
@@ -119,6 +119,9 @@ export class NumberField extends FormAssociatedNumberField {
|
|
|
119
119
|
validate() {
|
|
120
120
|
super.validate(this.control);
|
|
121
121
|
}
|
|
122
|
+
limitPrecision(value) {
|
|
123
|
+
return parseFloat(value.toPrecision(15));
|
|
124
|
+
}
|
|
122
125
|
/**
|
|
123
126
|
* Sets the internal value to a valid number between the min and max properties
|
|
124
127
|
* @param value - user input
|
|
@@ -126,16 +129,17 @@ export class NumberField extends FormAssociatedNumberField {
|
|
|
126
129
|
* @internal
|
|
127
130
|
*/
|
|
128
131
|
getValidValue(value) {
|
|
129
|
-
|
|
130
|
-
let validValue = parseFloat(parseFloat(value).toPrecision(15));
|
|
132
|
+
let validValue = this.limitPrecision(parseFloat(value));
|
|
131
133
|
if (isNaN(validValue)) {
|
|
132
|
-
|
|
134
|
+
return "";
|
|
135
|
+
}
|
|
136
|
+
if (this.max !== undefined) {
|
|
137
|
+
validValue = Math.min(validValue, this.limitPrecision(this.max));
|
|
133
138
|
}
|
|
134
|
-
|
|
135
|
-
validValue = Math.
|
|
136
|
-
validValue = Math.max(validValue, (_b = this.min) !== null && _b !== void 0 ? _b : validValue).toString();
|
|
139
|
+
if (this.min !== undefined) {
|
|
140
|
+
validValue = Math.max(validValue, this.limitPrecision(this.min));
|
|
137
141
|
}
|
|
138
|
-
return validValue;
|
|
142
|
+
return validValue.toString();
|
|
139
143
|
}
|
|
140
144
|
/**
|
|
141
145
|
* Increments the value using the step value
|
|
@@ -23,9 +23,12 @@ export class Switch extends FormAssociatedSwitch {
|
|
|
23
23
|
if (this.proxy instanceof HTMLInputElement) {
|
|
24
24
|
this.proxy.readOnly = this.readOnly;
|
|
25
25
|
}
|
|
26
|
-
this.readOnly
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
if (this.readOnly) {
|
|
27
|
+
this.classList.add("readonly");
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
this.classList.remove("readonly");
|
|
31
|
+
}
|
|
29
32
|
}
|
|
30
33
|
constructor() {
|
|
31
34
|
super();
|
|
@@ -68,7 +71,12 @@ export class Switch extends FormAssociatedSwitch {
|
|
|
68
71
|
/**
|
|
69
72
|
* @deprecated - this behavior already exists in the template and should not exist in the class.
|
|
70
73
|
*/
|
|
71
|
-
|
|
74
|
+
if (this.checked) {
|
|
75
|
+
this.classList.add("checked");
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
this.classList.remove("checked");
|
|
79
|
+
}
|
|
72
80
|
}
|
|
73
81
|
}
|
|
74
82
|
__decorate([
|
package/dist/esm/tabs/tabs.js
CHANGED
|
@@ -96,9 +96,12 @@ export class Tabs extends FoundationElement {
|
|
|
96
96
|
tab.style[gridHorizontalProperty] = "";
|
|
97
97
|
tab.style[gridVerticalProperty] = "";
|
|
98
98
|
tab.style[gridProperty] = `${index + 1}`;
|
|
99
|
-
!this.isHorizontal()
|
|
100
|
-
|
|
101
|
-
|
|
99
|
+
if (!this.isHorizontal()) {
|
|
100
|
+
tab.classList.add("vertical");
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
tab.classList.remove("vertical");
|
|
104
|
+
}
|
|
102
105
|
});
|
|
103
106
|
};
|
|
104
107
|
this.setTabPanels = () => {
|
|
@@ -107,9 +110,12 @@ export class Tabs extends FoundationElement {
|
|
|
107
110
|
const tabpanelId = this.tabpanelIds[index];
|
|
108
111
|
tabpanel.setAttribute("id", tabpanelId);
|
|
109
112
|
tabpanel.setAttribute("aria-labelledby", tabId);
|
|
110
|
-
this.activeTabIndex !== index
|
|
111
|
-
|
|
112
|
-
|
|
113
|
+
if (this.activeTabIndex !== index) {
|
|
114
|
+
tabpanel.setAttribute("hidden", "");
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
tabpanel.removeAttribute("hidden");
|
|
118
|
+
}
|
|
113
119
|
});
|
|
114
120
|
};
|
|
115
121
|
this.handleTabClick = (event) => {
|
|
@@ -6096,6 +6096,7 @@ export declare class NumberField extends FormAssociatedNumberField {
|
|
|
6096
6096
|
valueChanged(previous: string, next: string): void;
|
|
6097
6097
|
/** {@inheritDoc (FormAssociated:interface).validate} */
|
|
6098
6098
|
validate(): void;
|
|
6099
|
+
private limitPrecision;
|
|
6099
6100
|
/**
|
|
6100
6101
|
* Sets the internal value to a valid number between the min and max properties
|
|
6101
6102
|
* @param value - user input
|
|
@@ -7856,12 +7857,12 @@ export declare const ServiceLocator: InterfaceSymbol<ServiceLocator>;
|
|
|
7856
7857
|
*
|
|
7857
7858
|
* @public
|
|
7858
7859
|
*/
|
|
7859
|
-
export declare function singleton<T extends Constructable>():
|
|
7860
|
+
export declare function singleton<T extends Constructable>(): SingletonDecoratorType;
|
|
7860
7861
|
|
|
7861
7862
|
/**
|
|
7862
7863
|
* @public
|
|
7863
7864
|
*/
|
|
7864
|
-
export declare function singleton<T extends Constructable>(options?: SingletonOptions):
|
|
7865
|
+
export declare function singleton<T extends Constructable>(options?: SingletonOptions): SingletonDecoratorType;
|
|
7865
7866
|
|
|
7866
7867
|
/**
|
|
7867
7868
|
* Registers the `target` class as a singleton dependency; the class will only be created once. Each
|
|
@@ -7879,7 +7880,7 @@ export declare function singleton<T extends Constructable>(options?: SingletonOp
|
|
|
7879
7880
|
*/
|
|
7880
7881
|
export declare function singleton<T extends Constructable>(target: T & Partial<RegisterSelf<T>>): T & RegisterSelf<T>;
|
|
7881
7882
|
|
|
7882
|
-
declare
|
|
7883
|
+
declare type SingletonDecoratorType = <T extends Constructable>(target: T & Partial<RegisterSelf<T>>) => T & RegisterSelf<T>;
|
|
7883
7884
|
|
|
7884
7885
|
declare type SingletonOptions = {
|
|
7885
7886
|
scoped: boolean;
|
package/dist/fast-foundation.js
CHANGED
|
@@ -273,9 +273,12 @@ const DOM = Object.freeze({
|
|
|
273
273
|
* If the value is true, the attribute is added; otherwise it is removed.
|
|
274
274
|
*/
|
|
275
275
|
setBooleanAttribute(element, attributeName, value) {
|
|
276
|
-
value
|
|
277
|
-
|
|
278
|
-
|
|
276
|
+
if (value) {
|
|
277
|
+
element.setAttribute(attributeName, "");
|
|
278
|
+
}
|
|
279
|
+
else {
|
|
280
|
+
element.removeAttribute(attributeName);
|
|
281
|
+
}
|
|
279
282
|
},
|
|
280
283
|
/**
|
|
281
284
|
* Removes all the child nodes of the provided parent node.
|
|
@@ -1724,7 +1727,7 @@ if (DOM.supportsAdoptedStyleSheets) {
|
|
|
1724
1727
|
}
|
|
1725
1728
|
};
|
|
1726
1729
|
}
|
|
1727
|
-
catch (
|
|
1730
|
+
catch (_a) {
|
|
1728
1731
|
// Do nothing if an error is thrown, the default
|
|
1729
1732
|
// case handles FrozenArray.
|
|
1730
1733
|
}
|
|
@@ -2310,9 +2313,14 @@ class Controller extends PropertyChangeNotifier {
|
|
|
2310
2313
|
const behavior = behaviors[i];
|
|
2311
2314
|
if (targetBehaviors.has(behavior)) {
|
|
2312
2315
|
const count = targetBehaviors.get(behavior) - 1;
|
|
2313
|
-
count === 0 || force
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
+
if (count === 0 || force) {
|
|
2317
|
+
if (targetBehaviors.delete(behavior)) {
|
|
2318
|
+
behaviorsToUnbind.push(behavior);
|
|
2319
|
+
}
|
|
2320
|
+
}
|
|
2321
|
+
else {
|
|
2322
|
+
targetBehaviors.set(behavior, count);
|
|
2323
|
+
}
|
|
2316
2324
|
}
|
|
2317
2325
|
}
|
|
2318
2326
|
if (this._isConnected) {
|
|
@@ -5560,7 +5568,7 @@ function canUseFocusVisible() {
|
|
|
5560
5568
|
styleElement.sheet.insertRule("foo:focus-visible {color:inherit}", 0);
|
|
5561
5569
|
_canUseFocusVisible = true;
|
|
5562
5570
|
}
|
|
5563
|
-
catch (
|
|
5571
|
+
catch (_a) {
|
|
5564
5572
|
_canUseFocusVisible = false;
|
|
5565
5573
|
}
|
|
5566
5574
|
finally {
|
|
@@ -5785,9 +5793,7 @@ class Accordion extends FoundationElement {
|
|
|
5785
5793
|
if (item instanceof AccordionItem) {
|
|
5786
5794
|
item.addEventListener("change", this.activeItemChange);
|
|
5787
5795
|
if (this.isSingleExpandMode()) {
|
|
5788
|
-
this.activeItemIndex
|
|
5789
|
-
? (item.expanded = false)
|
|
5790
|
-
: (item.expanded = true);
|
|
5796
|
+
item.expanded = this.activeItemIndex === index;
|
|
5791
5797
|
}
|
|
5792
5798
|
}
|
|
5793
5799
|
const itemId = this.accordionIds[index];
|
|
@@ -7460,14 +7466,20 @@ class Breadcrumb extends FoundationElement {
|
|
|
7460
7466
|
if (childNodeWithHref === null &&
|
|
7461
7467
|
item.hasAttribute("href") &&
|
|
7462
7468
|
item instanceof BreadcrumbItem) {
|
|
7463
|
-
isLastNode
|
|
7464
|
-
|
|
7465
|
-
|
|
7469
|
+
if (isLastNode) {
|
|
7470
|
+
item.setAttribute("aria-current", "page");
|
|
7471
|
+
}
|
|
7472
|
+
else {
|
|
7473
|
+
item.removeAttribute("aria-current");
|
|
7474
|
+
}
|
|
7466
7475
|
}
|
|
7467
7476
|
else if (childNodeWithHref !== null) {
|
|
7468
|
-
isLastNode
|
|
7469
|
-
|
|
7470
|
-
|
|
7477
|
+
if (isLastNode) {
|
|
7478
|
+
childNodeWithHref.setAttribute("aria-current", "page");
|
|
7479
|
+
}
|
|
7480
|
+
else {
|
|
7481
|
+
childNodeWithHref.removeAttribute("aria-current");
|
|
7482
|
+
}
|
|
7471
7483
|
}
|
|
7472
7484
|
}
|
|
7473
7485
|
}
|
|
@@ -8040,9 +8052,12 @@ class Button extends FormAssociatedButton {
|
|
|
8040
8052
|
}
|
|
8041
8053
|
// Browser support for requestSubmit is not comprehensive
|
|
8042
8054
|
// so click the proxy if it isn't supported
|
|
8043
|
-
typeof this.form.requestSubmit === "function"
|
|
8044
|
-
|
|
8045
|
-
|
|
8055
|
+
if (typeof this.form.requestSubmit === "function") {
|
|
8056
|
+
this.form.requestSubmit(this.proxy);
|
|
8057
|
+
}
|
|
8058
|
+
else {
|
|
8059
|
+
this.proxy.click();
|
|
8060
|
+
}
|
|
8046
8061
|
if (!attached) {
|
|
8047
8062
|
this.detachProxy();
|
|
8048
8063
|
}
|
|
@@ -8100,10 +8115,14 @@ class Button extends FormAssociatedButton {
|
|
|
8100
8115
|
if (this.proxy instanceof HTMLInputElement) {
|
|
8101
8116
|
this.proxy.type = this.type;
|
|
8102
8117
|
}
|
|
8103
|
-
next === "submit"
|
|
8104
|
-
|
|
8105
|
-
|
|
8106
|
-
|
|
8118
|
+
if (next === "submit")
|
|
8119
|
+
this.addEventListener("click", this.handleSubmission);
|
|
8120
|
+
if (previous === "submit")
|
|
8121
|
+
this.removeEventListener("click", this.handleSubmission);
|
|
8122
|
+
if (next === "reset")
|
|
8123
|
+
this.addEventListener("click", this.handleFormReset);
|
|
8124
|
+
if (previous === "reset")
|
|
8125
|
+
this.removeEventListener("click", this.handleFormReset);
|
|
8107
8126
|
}
|
|
8108
8127
|
/** {@inheritDoc (FormAssociated:interface).validate} */
|
|
8109
8128
|
validate() {
|
|
@@ -8553,7 +8572,7 @@ class Calendar extends FoundationElement {
|
|
|
8553
8572
|
* @public
|
|
8554
8573
|
*/
|
|
8555
8574
|
handleDateSelect(event, day) {
|
|
8556
|
-
event.preventDefault;
|
|
8575
|
+
event.preventDefault();
|
|
8557
8576
|
this.$emit("dateselected", day);
|
|
8558
8577
|
}
|
|
8559
8578
|
/**
|
|
@@ -16129,6 +16148,9 @@ class NumberField extends FormAssociatedNumberField {
|
|
|
16129
16148
|
validate() {
|
|
16130
16149
|
super.validate(this.control);
|
|
16131
16150
|
}
|
|
16151
|
+
limitPrecision(value) {
|
|
16152
|
+
return parseFloat(value.toPrecision(15));
|
|
16153
|
+
}
|
|
16132
16154
|
/**
|
|
16133
16155
|
* Sets the internal value to a valid number between the min and max properties
|
|
16134
16156
|
* @param value - user input
|
|
@@ -16136,16 +16158,17 @@ class NumberField extends FormAssociatedNumberField {
|
|
|
16136
16158
|
* @internal
|
|
16137
16159
|
*/
|
|
16138
16160
|
getValidValue(value) {
|
|
16139
|
-
|
|
16140
|
-
let validValue = parseFloat(parseFloat(value).toPrecision(15));
|
|
16161
|
+
let validValue = this.limitPrecision(parseFloat(value));
|
|
16141
16162
|
if (isNaN(validValue)) {
|
|
16142
|
-
|
|
16163
|
+
return "";
|
|
16143
16164
|
}
|
|
16144
|
-
|
|
16145
|
-
validValue = Math.min(validValue, (
|
|
16146
|
-
validValue = Math.max(validValue, (_b = this.min) !== null && _b !== void 0 ? _b : validValue).toString();
|
|
16165
|
+
if (this.max !== undefined) {
|
|
16166
|
+
validValue = Math.min(validValue, this.limitPrecision(this.max));
|
|
16147
16167
|
}
|
|
16148
|
-
|
|
16168
|
+
if (this.min !== undefined) {
|
|
16169
|
+
validValue = Math.max(validValue, this.limitPrecision(this.min));
|
|
16170
|
+
}
|
|
16171
|
+
return validValue.toString();
|
|
16149
16172
|
}
|
|
16150
16173
|
/**
|
|
16151
16174
|
* Increments the value using the step value
|
|
@@ -19110,9 +19133,12 @@ class Switch extends FormAssociatedSwitch {
|
|
|
19110
19133
|
if (this.proxy instanceof HTMLInputElement) {
|
|
19111
19134
|
this.proxy.readOnly = this.readOnly;
|
|
19112
19135
|
}
|
|
19113
|
-
this.readOnly
|
|
19114
|
-
|
|
19115
|
-
|
|
19136
|
+
if (this.readOnly) {
|
|
19137
|
+
this.classList.add("readonly");
|
|
19138
|
+
}
|
|
19139
|
+
else {
|
|
19140
|
+
this.classList.remove("readonly");
|
|
19141
|
+
}
|
|
19116
19142
|
}
|
|
19117
19143
|
constructor() {
|
|
19118
19144
|
super();
|
|
@@ -19155,7 +19181,12 @@ class Switch extends FormAssociatedSwitch {
|
|
|
19155
19181
|
/**
|
|
19156
19182
|
* @deprecated - this behavior already exists in the template and should not exist in the class.
|
|
19157
19183
|
*/
|
|
19158
|
-
|
|
19184
|
+
if (this.checked) {
|
|
19185
|
+
this.classList.add("checked");
|
|
19186
|
+
}
|
|
19187
|
+
else {
|
|
19188
|
+
this.classList.remove("checked");
|
|
19189
|
+
}
|
|
19159
19190
|
}
|
|
19160
19191
|
}
|
|
19161
19192
|
__decorate([
|
|
@@ -19325,9 +19356,12 @@ class Tabs extends FoundationElement {
|
|
|
19325
19356
|
tab.style[gridHorizontalProperty] = "";
|
|
19326
19357
|
tab.style[gridVerticalProperty] = "";
|
|
19327
19358
|
tab.style[gridProperty] = `${index + 1}`;
|
|
19328
|
-
!this.isHorizontal()
|
|
19329
|
-
|
|
19330
|
-
|
|
19359
|
+
if (!this.isHorizontal()) {
|
|
19360
|
+
tab.classList.add("vertical");
|
|
19361
|
+
}
|
|
19362
|
+
else {
|
|
19363
|
+
tab.classList.remove("vertical");
|
|
19364
|
+
}
|
|
19331
19365
|
});
|
|
19332
19366
|
};
|
|
19333
19367
|
this.setTabPanels = () => {
|
|
@@ -19336,9 +19370,12 @@ class Tabs extends FoundationElement {
|
|
|
19336
19370
|
const tabpanelId = this.tabpanelIds[index];
|
|
19337
19371
|
tabpanel.setAttribute("id", tabpanelId);
|
|
19338
19372
|
tabpanel.setAttribute("aria-labelledby", tabId);
|
|
19339
|
-
this.activeTabIndex !== index
|
|
19340
|
-
|
|
19341
|
-
|
|
19373
|
+
if (this.activeTabIndex !== index) {
|
|
19374
|
+
tabpanel.setAttribute("hidden", "");
|
|
19375
|
+
}
|
|
19376
|
+
else {
|
|
19377
|
+
tabpanel.removeAttribute("hidden");
|
|
19378
|
+
}
|
|
19342
19379
|
});
|
|
19343
19380
|
};
|
|
19344
19381
|
this.handleTabClick = (event) => {
|
|
@@ -85,7 +85,7 @@ const t=function(){if("undefined"!=typeof globalThis)return globalThis;if("undef
|
|
|
85
85
|
<slot ${Xt({property:"accordionItems",filter:Wt()})}></slot>
|
|
86
86
|
<slot name="item" part="item" ${Xt("accordionItems")}></slot>
|
|
87
87
|
</template>
|
|
88
|
-
`,ai="horizontal",li="vertical";function hi(...t){return t.every((t=>t instanceof HTMLElement))}let di;const ci="focus",ui="focusin",pi="focusout",mi="keydown",vi="resize",fi="scroll";var gi;!function(t){t[t.alt=18]="alt",t[t.arrowDown=40]="arrowDown",t[t.arrowLeft=37]="arrowLeft",t[t.arrowRight=39]="arrowRight",t[t.arrowUp=38]="arrowUp",t[t.back=8]="back",t[t.backSlash=220]="backSlash",t[t.break=19]="break",t[t.capsLock=20]="capsLock",t[t.closeBracket=221]="closeBracket",t[t.colon=186]="colon",t[t.colon2=59]="colon2",t[t.comma=188]="comma",t[t.ctrl=17]="ctrl",t[t.delete=46]="delete",t[t.end=35]="end",t[t.enter=13]="enter",t[t.equals=187]="equals",t[t.equals2=61]="equals2",t[t.equals3=107]="equals3",t[t.escape=27]="escape",t[t.forwardSlash=191]="forwardSlash",t[t.function1=112]="function1",t[t.function10=121]="function10",t[t.function11=122]="function11",t[t.function12=123]="function12",t[t.function2=113]="function2",t[t.function3=114]="function3",t[t.function4=115]="function4",t[t.function5=116]="function5",t[t.function6=117]="function6",t[t.function7=118]="function7",t[t.function8=119]="function8",t[t.function9=120]="function9",t[t.home=36]="home",t[t.insert=45]="insert",t[t.menu=93]="menu",t[t.minus=189]="minus",t[t.minus2=109]="minus2",t[t.numLock=144]="numLock",t[t.numPad0=96]="numPad0",t[t.numPad1=97]="numPad1",t[t.numPad2=98]="numPad2",t[t.numPad3=99]="numPad3",t[t.numPad4=100]="numPad4",t[t.numPad5=101]="numPad5",t[t.numPad6=102]="numPad6",t[t.numPad7=103]="numPad7",t[t.numPad8=104]="numPad8",t[t.numPad9=105]="numPad9",t[t.numPadDivide=111]="numPadDivide",t[t.numPadDot=110]="numPadDot",t[t.numPadMinus=109]="numPadMinus",t[t.numPadMultiply=106]="numPadMultiply",t[t.numPadPlus=107]="numPadPlus",t[t.openBracket=219]="openBracket",t[t.pageDown=34]="pageDown",t[t.pageUp=33]="pageUp",t[t.period=190]="period",t[t.print=44]="print",t[t.quote=222]="quote",t[t.scrollLock=145]="scrollLock",t[t.shift=16]="shift",t[t.space=32]="space",t[t.tab=9]="tab",t[t.tilde=192]="tilde",t[t.windowsLeft=91]="windowsLeft",t[t.windowsOpera=219]="windowsOpera",t[t.windowsRight=92]="windowsRight"}(gi||(gi={}));const bi="ArrowDown",yi="ArrowLeft",Ci="ArrowRight",xi="ArrowUp",wi="Enter",$i="Escape",Ii="Home",ki="End",Ei=" ",Ti="Tab",Oi={ArrowDown:bi,ArrowLeft:yi,ArrowRight:Ci,ArrowUp:xi};var Si;function Ri(t,e,i){return Math.min(Math.max(i,t),e)}function Ai(t,e,i=0){return[e,i]=[e,i].sort(((t,e)=>t-e)),e<=t&&t<i}!function(t){t.ltr="ltr",t.rtl="rtl"}(Si||(Si={}));let Di=0;function Fi(t=""){return`${t}${Di++}`}const Li={single:"single",multi:"multi"};class Pi extends ei{constructor(){super(...arguments),this.expandmode=Li.multi,this.activeItemIndex=0,this.change=()=>{this.$emit("change",this.activeid)},this.setItems=()=>{var t;if(0!==this.accordionItems.length&&(this.accordionIds=this.getItemIds(),this.accordionItems.forEach(((t,e)=>{t instanceof ni&&(t.addEventListener("change",this.activeItemChange),this.isSingleExpandMode()&&(this.activeItemIndex
|
|
88
|
+
`,ai="horizontal",li="vertical";function hi(...t){return t.every((t=>t instanceof HTMLElement))}let di;const ci="focus",ui="focusin",pi="focusout",mi="keydown",vi="resize",fi="scroll";var gi;!function(t){t[t.alt=18]="alt",t[t.arrowDown=40]="arrowDown",t[t.arrowLeft=37]="arrowLeft",t[t.arrowRight=39]="arrowRight",t[t.arrowUp=38]="arrowUp",t[t.back=8]="back",t[t.backSlash=220]="backSlash",t[t.break=19]="break",t[t.capsLock=20]="capsLock",t[t.closeBracket=221]="closeBracket",t[t.colon=186]="colon",t[t.colon2=59]="colon2",t[t.comma=188]="comma",t[t.ctrl=17]="ctrl",t[t.delete=46]="delete",t[t.end=35]="end",t[t.enter=13]="enter",t[t.equals=187]="equals",t[t.equals2=61]="equals2",t[t.equals3=107]="equals3",t[t.escape=27]="escape",t[t.forwardSlash=191]="forwardSlash",t[t.function1=112]="function1",t[t.function10=121]="function10",t[t.function11=122]="function11",t[t.function12=123]="function12",t[t.function2=113]="function2",t[t.function3=114]="function3",t[t.function4=115]="function4",t[t.function5=116]="function5",t[t.function6=117]="function6",t[t.function7=118]="function7",t[t.function8=119]="function8",t[t.function9=120]="function9",t[t.home=36]="home",t[t.insert=45]="insert",t[t.menu=93]="menu",t[t.minus=189]="minus",t[t.minus2=109]="minus2",t[t.numLock=144]="numLock",t[t.numPad0=96]="numPad0",t[t.numPad1=97]="numPad1",t[t.numPad2=98]="numPad2",t[t.numPad3=99]="numPad3",t[t.numPad4=100]="numPad4",t[t.numPad5=101]="numPad5",t[t.numPad6=102]="numPad6",t[t.numPad7=103]="numPad7",t[t.numPad8=104]="numPad8",t[t.numPad9=105]="numPad9",t[t.numPadDivide=111]="numPadDivide",t[t.numPadDot=110]="numPadDot",t[t.numPadMinus=109]="numPadMinus",t[t.numPadMultiply=106]="numPadMultiply",t[t.numPadPlus=107]="numPadPlus",t[t.openBracket=219]="openBracket",t[t.pageDown=34]="pageDown",t[t.pageUp=33]="pageUp",t[t.period=190]="period",t[t.print=44]="print",t[t.quote=222]="quote",t[t.scrollLock=145]="scrollLock",t[t.shift=16]="shift",t[t.space=32]="space",t[t.tab=9]="tab",t[t.tilde=192]="tilde",t[t.windowsLeft=91]="windowsLeft",t[t.windowsOpera=219]="windowsOpera",t[t.windowsRight=92]="windowsRight"}(gi||(gi={}));const bi="ArrowDown",yi="ArrowLeft",Ci="ArrowRight",xi="ArrowUp",wi="Enter",$i="Escape",Ii="Home",ki="End",Ei=" ",Ti="Tab",Oi={ArrowDown:bi,ArrowLeft:yi,ArrowRight:Ci,ArrowUp:xi};var Si;function Ri(t,e,i){return Math.min(Math.max(i,t),e)}function Ai(t,e,i=0){return[e,i]=[e,i].sort(((t,e)=>t-e)),e<=t&&t<i}!function(t){t.ltr="ltr",t.rtl="rtl"}(Si||(Si={}));let Di=0;function Fi(t=""){return`${t}${Di++}`}const Li={single:"single",multi:"multi"};class Pi extends ei{constructor(){super(...arguments),this.expandmode=Li.multi,this.activeItemIndex=0,this.change=()=>{this.$emit("change",this.activeid)},this.setItems=()=>{var t;if(0!==this.accordionItems.length&&(this.accordionIds=this.getItemIds(),this.accordionItems.forEach(((t,e)=>{t instanceof ni&&(t.addEventListener("change",this.activeItemChange),this.isSingleExpandMode()&&(t.expanded=this.activeItemIndex===e));const i=this.accordionIds[e];t.setAttribute("id","string"!=typeof i?`accordion-${e+1}`:i),this.activeid=this.accordionIds[this.activeItemIndex],t.addEventListener("keydown",this.handleItemKeyDown),t.addEventListener("focus",this.handleItemFocus)})),this.isSingleExpandMode())){(null!==(t=this.findExpandedItem())&&void 0!==t?t:this.accordionItems[0]).setAttribute("aria-disabled","true")}},this.removeItemListeners=t=>{t.forEach(((t,e)=>{t.removeEventListener("change",this.activeItemChange),t.removeEventListener("keydown",this.handleItemKeyDown),t.removeEventListener("focus",this.handleItemFocus)}))},this.activeItemChange=t=>{if(t.defaultPrevented||t.target!==t.currentTarget)return;t.preventDefault();const e=t.target;this.activeid=e.getAttribute("id"),this.isSingleExpandMode()&&(this.resetItems(),e.expanded=!0,e.setAttribute("aria-disabled","true"),this.accordionItems.forEach((t=>{t.hasAttribute("disabled")||t.id===this.activeid||t.removeAttribute("aria-disabled")}))),this.activeItemIndex=Array.from(this.accordionItems).indexOf(e),this.change()},this.handleItemKeyDown=t=>{if(t.target===t.currentTarget)switch(this.accordionIds=this.getItemIds(),t.key){case xi:t.preventDefault(),this.adjust(-1);break;case bi:t.preventDefault(),this.adjust(1);break;case Ii:this.activeItemIndex=0,this.focusItem();break;case ki:this.activeItemIndex=this.accordionItems.length-1,this.focusItem()}},this.handleItemFocus=t=>{if(t.target===t.currentTarget){const e=t.target,i=this.activeItemIndex=Array.from(this.accordionItems).indexOf(e);this.activeItemIndex!==i&&-1!==i&&(this.activeItemIndex=i,this.activeid=this.accordionIds[this.activeItemIndex])}}}accordionItemsChanged(t,e){this.$fastController.isConnected&&(this.removeItemListeners(t),this.setItems())}findExpandedItem(){for(let t=0;t<this.accordionItems.length;t++)if("true"===this.accordionItems[t].getAttribute("expanded"))return this.accordionItems[t];return null}resetItems(){this.accordionItems.forEach(((t,e)=>{t.expanded=!1}))}getItemIds(){return this.accordionItems.map((t=>t.getAttribute("id")))}isSingleExpandMode(){return this.expandmode===Li.single}adjust(t){var e,i,s;this.activeItemIndex=(e=0,i=this.accordionItems.length-1,(s=this.activeItemIndex+t)<e?i:s>i?e:s),this.focusItem()}focusItem(){const t=this.accordionItems[this.activeItemIndex];t instanceof ni&&t.expandbutton.focus()}}oe([lt({attribute:"expand-mode"})],Pi.prototype,"expandmode",void 0),oe([v],Pi.prototype,"accordionItems",void 0);const Mi=(t,e)=>K`
|
|
89
89
|
<a
|
|
90
90
|
class="control"
|
|
91
91
|
part="control"
|
|
@@ -222,7 +222,7 @@ const t=function(){if("undefined"!=typeof globalThis)return globalThis;if("undef
|
|
|
222
222
|
</span>
|
|
223
223
|
${Jt(0,e)}
|
|
224
224
|
</button>
|
|
225
|
-
`,ns="form-associated-proxy",rs="ElementInternals",as=rs in window&&"setFormValue"in window[rs].prototype,ls=new WeakMap;function hs(t){const e=class extends t{static get formAssociated(){return as}get validity(){return this.elementInternals?this.elementInternals.validity:this.proxy.validity}get form(){return this.elementInternals?this.elementInternals.form:this.proxy.form}get validationMessage(){return this.elementInternals?this.elementInternals.validationMessage:this.proxy.validationMessage}get willValidate(){return this.elementInternals?this.elementInternals.willValidate:this.proxy.willValidate}get labels(){if(this.elementInternals)return Object.freeze(Array.from(this.elementInternals.labels));if(this.proxy instanceof HTMLElement&&this.proxy.ownerDocument&&this.id){const t=this.proxy.labels,e=Array.from(this.proxy.getRootNode().querySelectorAll(`[for='${this.id}']`)),i=t?e.concat(Array.from(t)):e;return Object.freeze(i)}return s}valueChanged(t,e){this.dirtyValue=!0,this.proxy instanceof HTMLElement&&(this.proxy.value=this.value),this.currentValue=this.value,this.setFormValue(this.value),this.validate()}currentValueChanged(){this.value=this.currentValue}initialValueChanged(t,e){this.dirtyValue||(this.value=this.initialValue,this.dirtyValue=!1)}disabledChanged(t,e){this.proxy instanceof HTMLElement&&(this.proxy.disabled=this.disabled),c.queueUpdate((()=>this.classList.toggle("disabled",this.disabled)))}nameChanged(t,e){this.proxy instanceof HTMLElement&&(this.proxy.name=this.name)}requiredChanged(t,e){this.proxy instanceof HTMLElement&&(this.proxy.required=this.required),c.queueUpdate((()=>this.classList.toggle("required",this.required))),this.validate()}get elementInternals(){if(!as)return null;let t=ls.get(this);return t||(t=this.attachInternals(),ls.set(this,t)),t}constructor(...t){super(...t),this.dirtyValue=!1,this.disabled=!1,this.proxyEventsToBlock=["change","click"],this.proxyInitialized=!1,this.required=!1,this.initialValue=this.initialValue||"",this.elementInternals||(this.formResetCallback=this.formResetCallback.bind(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("keypress",this._keypressHandler),this.value||(this.value=this.initialValue,this.dirtyValue=!1),this.elementInternals||(this.attachProxy(),this.form&&this.form.addEventListener("reset",this.formResetCallback))}disconnectedCallback(){super.disconnectedCallback(),this.proxyEventsToBlock.forEach((t=>this.proxy.removeEventListener(t,this.stopPropagation))),!this.elementInternals&&this.form&&this.form.removeEventListener("reset",this.formResetCallback)}checkValidity(){return this.elementInternals?this.elementInternals.checkValidity():this.proxy.checkValidity()}reportValidity(){return this.elementInternals?this.elementInternals.reportValidity():this.proxy.reportValidity()}setValidity(t,e,i){this.elementInternals?this.elementInternals.setValidity(t,e,i):"string"==typeof e&&this.proxy.setCustomValidity(e)}formDisabledCallback(t){this.disabled=t}formResetCallback(){this.value=this.initialValue,this.dirtyValue=!1}attachProxy(){var t;this.proxyInitialized||(this.proxyInitialized=!0,this.proxy.style.display="none",this.proxyEventsToBlock.forEach((t=>this.proxy.addEventListener(t,this.stopPropagation))),this.proxy.disabled=this.disabled,this.proxy.required=this.required,"string"==typeof this.name&&(this.proxy.name=this.name),"string"==typeof this.value&&(this.proxy.value=this.value),this.proxy.setAttribute("slot",ns),this.proxySlot=document.createElement("slot"),this.proxySlot.setAttribute("name",ns)),null===(t=this.shadowRoot)||void 0===t||t.appendChild(this.proxySlot),this.appendChild(this.proxy)}detachProxy(){var t;this.removeChild(this.proxy),null===(t=this.shadowRoot)||void 0===t||t.removeChild(this.proxySlot)}validate(t){this.proxy instanceof HTMLElement&&this.setValidity(this.proxy.validity,this.proxy.validationMessage,t)}setFormValue(t,e){this.elementInternals&&this.elementInternals.setFormValue(t,e||t)}_keypressHandler(t){if(t.key===wi)if(this.form instanceof HTMLFormElement){const t=this.form.querySelector("[type=submit]");null==t||t.click()}}stopPropagation(t){t.stopPropagation()}};return lt({mode:"boolean"})(e.prototype,"disabled"),lt({mode:"fromView",attribute:"value"})(e.prototype,"initialValue"),lt({attribute:"current-value"})(e.prototype,"currentValue"),lt(e.prototype,"name"),lt({mode:"boolean"})(e.prototype,"required"),v(e.prototype,"value"),e}function ds(t){class e extends(hs(t)){}class i extends e{checkedAttributeChanged(){this.defaultChecked=this.checkedAttribute}defaultCheckedChanged(){this.dirtyChecked||(this.checked=this.defaultChecked,this.dirtyChecked=!1)}checkedChanged(t,e){this.dirtyChecked||(this.dirtyChecked=!0),this.currentChecked=this.checked,this.updateForm(),this.proxy instanceof HTMLInputElement&&(this.proxy.checked=this.checked),void 0!==t&&this.$emit("change"),this.validate()}currentCheckedChanged(t,e){this.checked=this.currentChecked}constructor(...t){super(t),this.dirtyChecked=!1,this.checkedAttribute=!1,this.checked=!1,this.dirtyChecked=!1}updateForm(){const t=this.checked?this.value:null;this.setFormValue(t,t)}connectedCallback(){super.connectedCallback(),this.updateForm()}formResetCallback(){super.formResetCallback(),this.checked=!!this.checkedAttribute,this.dirtyChecked=!1}}return lt({attribute:"checked",mode:"boolean"})(i.prototype,"checkedAttribute"),lt({attribute:"current-checked",converter:nt})(i.prototype,"currentChecked"),v(i.prototype,"defaultChecked"),v(i.prototype,"checked"),i}class cs extends ei{}class us extends(hs(cs)){constructor(){super(...arguments),this.proxy=document.createElement("input")}}class ps extends us{constructor(){super(...arguments),this.handleClick=t=>{var e;this.disabled&&(null===(e=this.defaultSlottedContent)||void 0===e?void 0:e.length)<=1&&t.stopPropagation()},this.handleSubmission=()=>{if(!this.form)return;const t=this.proxy.isConnected;t||this.attachProxy(),"function"==typeof this.form.requestSubmit?this.form.requestSubmit(this.proxy):this.proxy.click(),t||this.detachProxy()},this.handleFormReset=()=>{var t;null===(t=this.form)||void 0===t||t.reset()},this.handleUnsupportedDelegatesFocus=()=>{var t;window.ShadowRoot&&!window.ShadowRoot.prototype.hasOwnProperty("delegatesFocus")&&(null===(t=this.$fastController.definition.shadowOptions)||void 0===t?void 0:t.delegatesFocus)&&(this.focus=()=>{this.control.focus()})}}formactionChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.formAction=this.formaction)}formenctypeChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.formEnctype=this.formenctype)}formmethodChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.formMethod=this.formmethod)}formnovalidateChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.formNoValidate=this.formnovalidate)}formtargetChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.formTarget=this.formtarget)}typeChanged(t,e){this.proxy instanceof HTMLInputElement&&(this.proxy.type=this.type),"submit"===e&&this.addEventListener("click",this.handleSubmission),"submit"===t&&this.removeEventListener("click",this.handleSubmission),"reset"===e&&this.addEventListener("click",this.handleFormReset),"reset"===t&&this.removeEventListener("click",this.handleFormReset)}validate(){super.validate(this.control)}connectedCallback(){var t;super.connectedCallback(),this.proxy.setAttribute("type",this.type),this.handleUnsupportedDelegatesFocus();const e=Array.from(null===(t=this.control)||void 0===t?void 0:t.children);e&&e.forEach((t=>{t.addEventListener("click",this.handleClick)}))}disconnectedCallback(){var t;super.disconnectedCallback();const e=Array.from(null===(t=this.control)||void 0===t?void 0:t.children);e&&e.forEach((t=>{t.removeEventListener("click",this.handleClick)}))}}oe([lt({mode:"boolean"})],ps.prototype,"autofocus",void 0),oe([lt({attribute:"form"})],ps.prototype,"formId",void 0),oe([lt],ps.prototype,"formaction",void 0),oe([lt],ps.prototype,"formenctype",void 0),oe([lt],ps.prototype,"formmethod",void 0),oe([lt({mode:"boolean"})],ps.prototype,"formnovalidate",void 0),oe([lt],ps.prototype,"formtarget",void 0),oe([lt],ps.prototype,"type",void 0),oe([v],ps.prototype,"defaultSlottedContent",void 0);class ms{}oe([lt({attribute:"aria-expanded"})],ms.prototype,"ariaExpanded",void 0),oe([lt({attribute:"aria-pressed"})],ms.prototype,"ariaPressed",void 0),oi(ms,Vi),oi(ps,Zt,ms);class vs{constructor(t){if(this.dayFormat="numeric",this.weekdayFormat="long",this.monthFormat="long",this.yearFormat="numeric",this.date=new Date,t)for(const e in t){const i=t[e];"date"===e?this.date=this.getDateObject(i):this[e]=i}}getDateObject(t){if("string"==typeof t){const e=t.split(/[/-]/);return e.length<3?new Date:new Date(parseInt(e[2],10),parseInt(e[0],10)-1,parseInt(e[1],10))}if("day"in t&&"month"in t&&"year"in t){const{day:e,month:i,year:s}=t;return new Date(s,i-1,e)}return t}getDate(t=this.date,e={weekday:this.weekdayFormat,month:this.monthFormat,day:this.dayFormat,year:this.yearFormat},i=this.locale){const s=this.getDateObject(t);if(!s.getTime())return"";const o=Object.assign({timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone},e);return new Intl.DateTimeFormat(i,o).format(s)}getDay(t=this.date.getDate(),e=this.dayFormat,i=this.locale){return this.getDate({month:1,day:t,year:2020},{day:e},i)}getMonth(t=this.date.getMonth()+1,e=this.monthFormat,i=this.locale){return this.getDate({month:t,day:2,year:2020},{month:e},i)}getYear(t=this.date.getFullYear(),e=this.yearFormat,i=this.locale){return this.getDate({month:2,day:2,year:t},{year:e},i)}getWeekday(t=0,e=this.weekdayFormat,i=this.locale){const s=`1-${t+1}-2017`;return this.getDate(s,{weekday:e},i)}getWeekdays(t=this.weekdayFormat,e=this.locale){return Array(7).fill(null).map(((i,s)=>this.getWeekday(s,t,e)))}}class fs extends ei{constructor(){super(...arguments),this.dateFormatter=new vs,this.readonly=!1,this.locale="en-US",this.month=(new Date).getMonth()+1,this.year=(new Date).getFullYear(),this.dayFormat="numeric",this.weekdayFormat="short",this.monthFormat="long",this.yearFormat="numeric",this.minWeeks=0,this.disabledDates="",this.selectedDates="",this.oneDayInMs=864e5}localeChanged(){this.dateFormatter.locale=this.locale}dayFormatChanged(){this.dateFormatter.dayFormat=this.dayFormat}weekdayFormatChanged(){this.dateFormatter.weekdayFormat=this.weekdayFormat}monthFormatChanged(){this.dateFormatter.monthFormat=this.monthFormat}yearFormatChanged(){this.dateFormatter.yearFormat=this.yearFormat}getMonthInfo(t=this.month,e=this.year){const i=t=>new Date(t.getFullYear(),t.getMonth(),1).getDay(),s=t=>{const e=new Date(t.getFullYear(),t.getMonth()+1,1);return new Date(e.getTime()-this.oneDayInMs).getDate()},o=new Date(e,t-1),n=new Date(e,t),r=new Date(e,t-2);return{length:s(o),month:t,start:i(o),year:e,previous:{length:s(r),month:r.getMonth()+1,start:i(r),year:r.getFullYear()},next:{length:s(n),month:n.getMonth()+1,start:i(n),year:n.getFullYear()}}}getDays(t=this.getMonthInfo(),e=this.minWeeks){e=e>10?10:e;const{start:i,length:s,previous:o,next:n}=t,r=[];let a=1-i;for(;a<s+1||r.length<e||r[r.length-1].length%7!=0;){const{month:e,year:i}=a<1?o:a>s?n:t,l=a<1?o.length+a:a>s?a-s:a,h=`${e}-${l}-${i}`,d={day:l,month:e,year:i,disabled:this.dateInString(h,this.disabledDates),selected:this.dateInString(h,this.selectedDates)},c=r[r.length-1];0===r.length||c.length%7==0?r.push([d]):c.push(d),a++}return r}dateInString(t,e){const i=e.split(",").map((t=>t.trim()));return t="string"==typeof t?t:`${t.getMonth()+1}-${t.getDate()}-${t.getFullYear()}`,i.some((e=>e===t))}getDayClassNames(t,e){const{day:i,month:s,year:o,disabled:n,selected:r}=t;return["day",e===`${s}-${i}-${o}`&&"today",this.month!==s&&"inactive",n&&"disabled",r&&"selected"].filter(Boolean).join(" ")}getWeekdayText(){const t=this.dateFormatter.getWeekdays().map((t=>({text:t})));if("long"!==this.weekdayFormat){const e=this.dateFormatter.getWeekdays("long");t.forEach(((t,i)=>{t.abbr=e[i]}))}return t}handleDateSelect(t,e){t.preventDefault,this.$emit("dateselected",e)}handleKeydown(t,e){return t.key===wi&&this.handleDateSelect(t,e),!0}}oe([lt({mode:"boolean"})],fs.prototype,"readonly",void 0),oe([lt],fs.prototype,"locale",void 0),oe([lt({converter:rt})],fs.prototype,"month",void 0),oe([lt({converter:rt})],fs.prototype,"year",void 0),oe([lt({attribute:"day-format",mode:"fromView"})],fs.prototype,"dayFormat",void 0),oe([lt({attribute:"weekday-format",mode:"fromView"})],fs.prototype,"weekdayFormat",void 0),oe([lt({attribute:"month-format",mode:"fromView"})],fs.prototype,"monthFormat",void 0),oe([lt({attribute:"year-format",mode:"fromView"})],fs.prototype,"yearFormat",void 0),oe([lt({attribute:"min-weeks",converter:rt})],fs.prototype,"minWeeks",void 0),oe([lt({attribute:"disabled-dates"})],fs.prototype,"disabledDates",void 0),oe([lt({attribute:"selected-dates"})],fs.prototype,"selectedDates",void 0);const gs={none:"none",default:"default",sticky:"sticky"},bs={default:"default",columnHeader:"columnheader",rowHeader:"rowheader"},ys={default:"default",header:"header",stickyHeader:"sticky-header"};class Cs extends ei{constructor(){super(...arguments),this.rowType=ys.default,this.rowData=null,this.columnDefinitions=null,this.isActiveRow=!1,this.cellsRepeatBehavior=null,this.cellsPlaceholder=null,this.focusColumnIndex=0,this.refocusOnLoad=!1,this.updateRowStyle=()=>{this.style.gridTemplateColumns=this.gridTemplateColumns}}gridTemplateColumnsChanged(){this.$fastController.isConnected&&this.updateRowStyle()}rowTypeChanged(){this.$fastController.isConnected&&this.updateItemTemplate()}rowDataChanged(){null!==this.rowData&&this.isActiveRow&&(this.refocusOnLoad=!0)}cellItemTemplateChanged(){this.updateItemTemplate()}headerCellItemTemplateChanged(){this.updateItemTemplate()}connectedCallback(){super.connectedCallback(),null===this.cellsRepeatBehavior&&(this.cellsPlaceholder=document.createComment(""),this.appendChild(this.cellsPlaceholder),this.updateItemTemplate(),this.cellsRepeatBehavior=new jt((t=>t.columnDefinitions),(t=>t.activeCellItemTemplate),{positioning:!0}).createBehavior(this.cellsPlaceholder),this.$fastController.addBehaviors([this.cellsRepeatBehavior])),this.addEventListener("cell-focused",this.handleCellFocus),this.addEventListener(pi,this.handleFocusout),this.addEventListener(mi,this.handleKeydown),this.updateRowStyle(),this.refocusOnLoad&&(this.refocusOnLoad=!1,this.cellElements.length>this.focusColumnIndex&&this.cellElements[this.focusColumnIndex].focus())}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("cell-focused",this.handleCellFocus),this.removeEventListener(pi,this.handleFocusout),this.removeEventListener(mi,this.handleKeydown)}handleFocusout(t){this.contains(t.target)||(this.isActiveRow=!1,this.focusColumnIndex=0)}handleCellFocus(t){this.isActiveRow=!0,this.focusColumnIndex=this.cellElements.indexOf(t.target),this.$emit("row-focused",this)}handleKeydown(t){if(t.defaultPrevented)return;let e=0;switch(t.key){case yi:e=Math.max(0,this.focusColumnIndex-1),this.cellElements[e].focus(),t.preventDefault();break;case Ci:e=Math.min(this.cellElements.length-1,this.focusColumnIndex+1),this.cellElements[e].focus(),t.preventDefault();break;case Ii:t.ctrlKey||(this.cellElements[0].focus(),t.preventDefault());break;case ki:t.ctrlKey||(this.cellElements[this.cellElements.length-1].focus(),t.preventDefault())}}updateItemTemplate(){this.activeCellItemTemplate=this.rowType===ys.default&&void 0!==this.cellItemTemplate?this.cellItemTemplate:this.rowType===ys.default&&void 0===this.cellItemTemplate?this.defaultCellItemTemplate:void 0!==this.headerCellItemTemplate?this.headerCellItemTemplate:this.defaultHeaderCellItemTemplate}}oe([lt({attribute:"grid-template-columns"})],Cs.prototype,"gridTemplateColumns",void 0),oe([lt({attribute:"row-type"})],Cs.prototype,"rowType",void 0),oe([v],Cs.prototype,"rowData",void 0),oe([v],Cs.prototype,"columnDefinitions",void 0),oe([v],Cs.prototype,"cellItemTemplate",void 0),oe([v],Cs.prototype,"headerCellItemTemplate",void 0),oe([v],Cs.prototype,"rowIndex",void 0),oe([v],Cs.prototype,"isActiveRow",void 0),oe([v],Cs.prototype,"activeCellItemTemplate",void 0),oe([v],Cs.prototype,"defaultCellItemTemplate",void 0),oe([v],Cs.prototype,"defaultHeaderCellItemTemplate",void 0),oe([v],Cs.prototype,"cellElements",void 0);const xs=(t,e)=>{const i=function(t){const e=t.tagFor(Cs);return K`
|
|
225
|
+
`,ns="form-associated-proxy",rs="ElementInternals",as=rs in window&&"setFormValue"in window[rs].prototype,ls=new WeakMap;function hs(t){const e=class extends t{static get formAssociated(){return as}get validity(){return this.elementInternals?this.elementInternals.validity:this.proxy.validity}get form(){return this.elementInternals?this.elementInternals.form:this.proxy.form}get validationMessage(){return this.elementInternals?this.elementInternals.validationMessage:this.proxy.validationMessage}get willValidate(){return this.elementInternals?this.elementInternals.willValidate:this.proxy.willValidate}get labels(){if(this.elementInternals)return Object.freeze(Array.from(this.elementInternals.labels));if(this.proxy instanceof HTMLElement&&this.proxy.ownerDocument&&this.id){const t=this.proxy.labels,e=Array.from(this.proxy.getRootNode().querySelectorAll(`[for='${this.id}']`)),i=t?e.concat(Array.from(t)):e;return Object.freeze(i)}return s}valueChanged(t,e){this.dirtyValue=!0,this.proxy instanceof HTMLElement&&(this.proxy.value=this.value),this.currentValue=this.value,this.setFormValue(this.value),this.validate()}currentValueChanged(){this.value=this.currentValue}initialValueChanged(t,e){this.dirtyValue||(this.value=this.initialValue,this.dirtyValue=!1)}disabledChanged(t,e){this.proxy instanceof HTMLElement&&(this.proxy.disabled=this.disabled),c.queueUpdate((()=>this.classList.toggle("disabled",this.disabled)))}nameChanged(t,e){this.proxy instanceof HTMLElement&&(this.proxy.name=this.name)}requiredChanged(t,e){this.proxy instanceof HTMLElement&&(this.proxy.required=this.required),c.queueUpdate((()=>this.classList.toggle("required",this.required))),this.validate()}get elementInternals(){if(!as)return null;let t=ls.get(this);return t||(t=this.attachInternals(),ls.set(this,t)),t}constructor(...t){super(...t),this.dirtyValue=!1,this.disabled=!1,this.proxyEventsToBlock=["change","click"],this.proxyInitialized=!1,this.required=!1,this.initialValue=this.initialValue||"",this.elementInternals||(this.formResetCallback=this.formResetCallback.bind(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("keypress",this._keypressHandler),this.value||(this.value=this.initialValue,this.dirtyValue=!1),this.elementInternals||(this.attachProxy(),this.form&&this.form.addEventListener("reset",this.formResetCallback))}disconnectedCallback(){super.disconnectedCallback(),this.proxyEventsToBlock.forEach((t=>this.proxy.removeEventListener(t,this.stopPropagation))),!this.elementInternals&&this.form&&this.form.removeEventListener("reset",this.formResetCallback)}checkValidity(){return this.elementInternals?this.elementInternals.checkValidity():this.proxy.checkValidity()}reportValidity(){return this.elementInternals?this.elementInternals.reportValidity():this.proxy.reportValidity()}setValidity(t,e,i){this.elementInternals?this.elementInternals.setValidity(t,e,i):"string"==typeof e&&this.proxy.setCustomValidity(e)}formDisabledCallback(t){this.disabled=t}formResetCallback(){this.value=this.initialValue,this.dirtyValue=!1}attachProxy(){var t;this.proxyInitialized||(this.proxyInitialized=!0,this.proxy.style.display="none",this.proxyEventsToBlock.forEach((t=>this.proxy.addEventListener(t,this.stopPropagation))),this.proxy.disabled=this.disabled,this.proxy.required=this.required,"string"==typeof this.name&&(this.proxy.name=this.name),"string"==typeof this.value&&(this.proxy.value=this.value),this.proxy.setAttribute("slot",ns),this.proxySlot=document.createElement("slot"),this.proxySlot.setAttribute("name",ns)),null===(t=this.shadowRoot)||void 0===t||t.appendChild(this.proxySlot),this.appendChild(this.proxy)}detachProxy(){var t;this.removeChild(this.proxy),null===(t=this.shadowRoot)||void 0===t||t.removeChild(this.proxySlot)}validate(t){this.proxy instanceof HTMLElement&&this.setValidity(this.proxy.validity,this.proxy.validationMessage,t)}setFormValue(t,e){this.elementInternals&&this.elementInternals.setFormValue(t,e||t)}_keypressHandler(t){if(t.key===wi)if(this.form instanceof HTMLFormElement){const t=this.form.querySelector("[type=submit]");null==t||t.click()}}stopPropagation(t){t.stopPropagation()}};return lt({mode:"boolean"})(e.prototype,"disabled"),lt({mode:"fromView",attribute:"value"})(e.prototype,"initialValue"),lt({attribute:"current-value"})(e.prototype,"currentValue"),lt(e.prototype,"name"),lt({mode:"boolean"})(e.prototype,"required"),v(e.prototype,"value"),e}function ds(t){class e extends(hs(t)){}class i extends e{checkedAttributeChanged(){this.defaultChecked=this.checkedAttribute}defaultCheckedChanged(){this.dirtyChecked||(this.checked=this.defaultChecked,this.dirtyChecked=!1)}checkedChanged(t,e){this.dirtyChecked||(this.dirtyChecked=!0),this.currentChecked=this.checked,this.updateForm(),this.proxy instanceof HTMLInputElement&&(this.proxy.checked=this.checked),void 0!==t&&this.$emit("change"),this.validate()}currentCheckedChanged(t,e){this.checked=this.currentChecked}constructor(...t){super(t),this.dirtyChecked=!1,this.checkedAttribute=!1,this.checked=!1,this.dirtyChecked=!1}updateForm(){const t=this.checked?this.value:null;this.setFormValue(t,t)}connectedCallback(){super.connectedCallback(),this.updateForm()}formResetCallback(){super.formResetCallback(),this.checked=!!this.checkedAttribute,this.dirtyChecked=!1}}return lt({attribute:"checked",mode:"boolean"})(i.prototype,"checkedAttribute"),lt({attribute:"current-checked",converter:nt})(i.prototype,"currentChecked"),v(i.prototype,"defaultChecked"),v(i.prototype,"checked"),i}class cs extends ei{}class us extends(hs(cs)){constructor(){super(...arguments),this.proxy=document.createElement("input")}}class ps extends us{constructor(){super(...arguments),this.handleClick=t=>{var e;this.disabled&&(null===(e=this.defaultSlottedContent)||void 0===e?void 0:e.length)<=1&&t.stopPropagation()},this.handleSubmission=()=>{if(!this.form)return;const t=this.proxy.isConnected;t||this.attachProxy(),"function"==typeof this.form.requestSubmit?this.form.requestSubmit(this.proxy):this.proxy.click(),t||this.detachProxy()},this.handleFormReset=()=>{var t;null===(t=this.form)||void 0===t||t.reset()},this.handleUnsupportedDelegatesFocus=()=>{var t;window.ShadowRoot&&!window.ShadowRoot.prototype.hasOwnProperty("delegatesFocus")&&(null===(t=this.$fastController.definition.shadowOptions)||void 0===t?void 0:t.delegatesFocus)&&(this.focus=()=>{this.control.focus()})}}formactionChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.formAction=this.formaction)}formenctypeChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.formEnctype=this.formenctype)}formmethodChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.formMethod=this.formmethod)}formnovalidateChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.formNoValidate=this.formnovalidate)}formtargetChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.formTarget=this.formtarget)}typeChanged(t,e){this.proxy instanceof HTMLInputElement&&(this.proxy.type=this.type),"submit"===e&&this.addEventListener("click",this.handleSubmission),"submit"===t&&this.removeEventListener("click",this.handleSubmission),"reset"===e&&this.addEventListener("click",this.handleFormReset),"reset"===t&&this.removeEventListener("click",this.handleFormReset)}validate(){super.validate(this.control)}connectedCallback(){var t;super.connectedCallback(),this.proxy.setAttribute("type",this.type),this.handleUnsupportedDelegatesFocus();const e=Array.from(null===(t=this.control)||void 0===t?void 0:t.children);e&&e.forEach((t=>{t.addEventListener("click",this.handleClick)}))}disconnectedCallback(){var t;super.disconnectedCallback();const e=Array.from(null===(t=this.control)||void 0===t?void 0:t.children);e&&e.forEach((t=>{t.removeEventListener("click",this.handleClick)}))}}oe([lt({mode:"boolean"})],ps.prototype,"autofocus",void 0),oe([lt({attribute:"form"})],ps.prototype,"formId",void 0),oe([lt],ps.prototype,"formaction",void 0),oe([lt],ps.prototype,"formenctype",void 0),oe([lt],ps.prototype,"formmethod",void 0),oe([lt({mode:"boolean"})],ps.prototype,"formnovalidate",void 0),oe([lt],ps.prototype,"formtarget",void 0),oe([lt],ps.prototype,"type",void 0),oe([v],ps.prototype,"defaultSlottedContent",void 0);class ms{}oe([lt({attribute:"aria-expanded"})],ms.prototype,"ariaExpanded",void 0),oe([lt({attribute:"aria-pressed"})],ms.prototype,"ariaPressed",void 0),oi(ms,Vi),oi(ps,Zt,ms);class vs{constructor(t){if(this.dayFormat="numeric",this.weekdayFormat="long",this.monthFormat="long",this.yearFormat="numeric",this.date=new Date,t)for(const e in t){const i=t[e];"date"===e?this.date=this.getDateObject(i):this[e]=i}}getDateObject(t){if("string"==typeof t){const e=t.split(/[/-]/);return e.length<3?new Date:new Date(parseInt(e[2],10),parseInt(e[0],10)-1,parseInt(e[1],10))}if("day"in t&&"month"in t&&"year"in t){const{day:e,month:i,year:s}=t;return new Date(s,i-1,e)}return t}getDate(t=this.date,e={weekday:this.weekdayFormat,month:this.monthFormat,day:this.dayFormat,year:this.yearFormat},i=this.locale){const s=this.getDateObject(t);if(!s.getTime())return"";const o=Object.assign({timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone},e);return new Intl.DateTimeFormat(i,o).format(s)}getDay(t=this.date.getDate(),e=this.dayFormat,i=this.locale){return this.getDate({month:1,day:t,year:2020},{day:e},i)}getMonth(t=this.date.getMonth()+1,e=this.monthFormat,i=this.locale){return this.getDate({month:t,day:2,year:2020},{month:e},i)}getYear(t=this.date.getFullYear(),e=this.yearFormat,i=this.locale){return this.getDate({month:2,day:2,year:t},{year:e},i)}getWeekday(t=0,e=this.weekdayFormat,i=this.locale){const s=`1-${t+1}-2017`;return this.getDate(s,{weekday:e},i)}getWeekdays(t=this.weekdayFormat,e=this.locale){return Array(7).fill(null).map(((i,s)=>this.getWeekday(s,t,e)))}}class fs extends ei{constructor(){super(...arguments),this.dateFormatter=new vs,this.readonly=!1,this.locale="en-US",this.month=(new Date).getMonth()+1,this.year=(new Date).getFullYear(),this.dayFormat="numeric",this.weekdayFormat="short",this.monthFormat="long",this.yearFormat="numeric",this.minWeeks=0,this.disabledDates="",this.selectedDates="",this.oneDayInMs=864e5}localeChanged(){this.dateFormatter.locale=this.locale}dayFormatChanged(){this.dateFormatter.dayFormat=this.dayFormat}weekdayFormatChanged(){this.dateFormatter.weekdayFormat=this.weekdayFormat}monthFormatChanged(){this.dateFormatter.monthFormat=this.monthFormat}yearFormatChanged(){this.dateFormatter.yearFormat=this.yearFormat}getMonthInfo(t=this.month,e=this.year){const i=t=>new Date(t.getFullYear(),t.getMonth(),1).getDay(),s=t=>{const e=new Date(t.getFullYear(),t.getMonth()+1,1);return new Date(e.getTime()-this.oneDayInMs).getDate()},o=new Date(e,t-1),n=new Date(e,t),r=new Date(e,t-2);return{length:s(o),month:t,start:i(o),year:e,previous:{length:s(r),month:r.getMonth()+1,start:i(r),year:r.getFullYear()},next:{length:s(n),month:n.getMonth()+1,start:i(n),year:n.getFullYear()}}}getDays(t=this.getMonthInfo(),e=this.minWeeks){e=e>10?10:e;const{start:i,length:s,previous:o,next:n}=t,r=[];let a=1-i;for(;a<s+1||r.length<e||r[r.length-1].length%7!=0;){const{month:e,year:i}=a<1?o:a>s?n:t,l=a<1?o.length+a:a>s?a-s:a,h=`${e}-${l}-${i}`,d={day:l,month:e,year:i,disabled:this.dateInString(h,this.disabledDates),selected:this.dateInString(h,this.selectedDates)},c=r[r.length-1];0===r.length||c.length%7==0?r.push([d]):c.push(d),a++}return r}dateInString(t,e){const i=e.split(",").map((t=>t.trim()));return t="string"==typeof t?t:`${t.getMonth()+1}-${t.getDate()}-${t.getFullYear()}`,i.some((e=>e===t))}getDayClassNames(t,e){const{day:i,month:s,year:o,disabled:n,selected:r}=t;return["day",e===`${s}-${i}-${o}`&&"today",this.month!==s&&"inactive",n&&"disabled",r&&"selected"].filter(Boolean).join(" ")}getWeekdayText(){const t=this.dateFormatter.getWeekdays().map((t=>({text:t})));if("long"!==this.weekdayFormat){const e=this.dateFormatter.getWeekdays("long");t.forEach(((t,i)=>{t.abbr=e[i]}))}return t}handleDateSelect(t,e){t.preventDefault(),this.$emit("dateselected",e)}handleKeydown(t,e){return t.key===wi&&this.handleDateSelect(t,e),!0}}oe([lt({mode:"boolean"})],fs.prototype,"readonly",void 0),oe([lt],fs.prototype,"locale",void 0),oe([lt({converter:rt})],fs.prototype,"month",void 0),oe([lt({converter:rt})],fs.prototype,"year",void 0),oe([lt({attribute:"day-format",mode:"fromView"})],fs.prototype,"dayFormat",void 0),oe([lt({attribute:"weekday-format",mode:"fromView"})],fs.prototype,"weekdayFormat",void 0),oe([lt({attribute:"month-format",mode:"fromView"})],fs.prototype,"monthFormat",void 0),oe([lt({attribute:"year-format",mode:"fromView"})],fs.prototype,"yearFormat",void 0),oe([lt({attribute:"min-weeks",converter:rt})],fs.prototype,"minWeeks",void 0),oe([lt({attribute:"disabled-dates"})],fs.prototype,"disabledDates",void 0),oe([lt({attribute:"selected-dates"})],fs.prototype,"selectedDates",void 0);const gs={none:"none",default:"default",sticky:"sticky"},bs={default:"default",columnHeader:"columnheader",rowHeader:"rowheader"},ys={default:"default",header:"header",stickyHeader:"sticky-header"};class Cs extends ei{constructor(){super(...arguments),this.rowType=ys.default,this.rowData=null,this.columnDefinitions=null,this.isActiveRow=!1,this.cellsRepeatBehavior=null,this.cellsPlaceholder=null,this.focusColumnIndex=0,this.refocusOnLoad=!1,this.updateRowStyle=()=>{this.style.gridTemplateColumns=this.gridTemplateColumns}}gridTemplateColumnsChanged(){this.$fastController.isConnected&&this.updateRowStyle()}rowTypeChanged(){this.$fastController.isConnected&&this.updateItemTemplate()}rowDataChanged(){null!==this.rowData&&this.isActiveRow&&(this.refocusOnLoad=!0)}cellItemTemplateChanged(){this.updateItemTemplate()}headerCellItemTemplateChanged(){this.updateItemTemplate()}connectedCallback(){super.connectedCallback(),null===this.cellsRepeatBehavior&&(this.cellsPlaceholder=document.createComment(""),this.appendChild(this.cellsPlaceholder),this.updateItemTemplate(),this.cellsRepeatBehavior=new jt((t=>t.columnDefinitions),(t=>t.activeCellItemTemplate),{positioning:!0}).createBehavior(this.cellsPlaceholder),this.$fastController.addBehaviors([this.cellsRepeatBehavior])),this.addEventListener("cell-focused",this.handleCellFocus),this.addEventListener(pi,this.handleFocusout),this.addEventListener(mi,this.handleKeydown),this.updateRowStyle(),this.refocusOnLoad&&(this.refocusOnLoad=!1,this.cellElements.length>this.focusColumnIndex&&this.cellElements[this.focusColumnIndex].focus())}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("cell-focused",this.handleCellFocus),this.removeEventListener(pi,this.handleFocusout),this.removeEventListener(mi,this.handleKeydown)}handleFocusout(t){this.contains(t.target)||(this.isActiveRow=!1,this.focusColumnIndex=0)}handleCellFocus(t){this.isActiveRow=!0,this.focusColumnIndex=this.cellElements.indexOf(t.target),this.$emit("row-focused",this)}handleKeydown(t){if(t.defaultPrevented)return;let e=0;switch(t.key){case yi:e=Math.max(0,this.focusColumnIndex-1),this.cellElements[e].focus(),t.preventDefault();break;case Ci:e=Math.min(this.cellElements.length-1,this.focusColumnIndex+1),this.cellElements[e].focus(),t.preventDefault();break;case Ii:t.ctrlKey||(this.cellElements[0].focus(),t.preventDefault());break;case ki:t.ctrlKey||(this.cellElements[this.cellElements.length-1].focus(),t.preventDefault())}}updateItemTemplate(){this.activeCellItemTemplate=this.rowType===ys.default&&void 0!==this.cellItemTemplate?this.cellItemTemplate:this.rowType===ys.default&&void 0===this.cellItemTemplate?this.defaultCellItemTemplate:void 0!==this.headerCellItemTemplate?this.headerCellItemTemplate:this.defaultHeaderCellItemTemplate}}oe([lt({attribute:"grid-template-columns"})],Cs.prototype,"gridTemplateColumns",void 0),oe([lt({attribute:"row-type"})],Cs.prototype,"rowType",void 0),oe([v],Cs.prototype,"rowData",void 0),oe([v],Cs.prototype,"columnDefinitions",void 0),oe([v],Cs.prototype,"cellItemTemplate",void 0),oe([v],Cs.prototype,"headerCellItemTemplate",void 0),oe([v],Cs.prototype,"rowIndex",void 0),oe([v],Cs.prototype,"isActiveRow",void 0),oe([v],Cs.prototype,"activeCellItemTemplate",void 0),oe([v],Cs.prototype,"defaultCellItemTemplate",void 0),oe([v],Cs.prototype,"defaultHeaderCellItemTemplate",void 0),oe([v],Cs.prototype,"cellElements",void 0);const xs=(t,e)=>{const i=function(t){const e=t.tagFor(Cs);return K`
|
|
226
226
|
<${e}
|
|
227
227
|
:rowData="${t=>t}"
|
|
228
228
|
:cellItemTemplate="${(t,e)=>e.parent.cellItemTemplate}"
|
|
@@ -848,7 +848,7 @@ const t=function(){if("undefined"!=typeof globalThis)return globalThis;if("undef
|
|
|
848
848
|
${Jt(0,e)}
|
|
849
849
|
</div>
|
|
850
850
|
</template>
|
|
851
|
-
`;class On extends ei{}class Sn extends(hs(On)){constructor(){super(...arguments),this.proxy=document.createElement("input")}}const Rn={email:"email",password:"password",tel:"tel",text:"text",url:"url"};class An extends Sn{constructor(){super(...arguments),this.type=Rn.text}readOnlyChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.readOnly=this.readOnly,this.validate())}autofocusChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.autofocus=this.autofocus,this.validate())}placeholderChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.placeholder=this.placeholder)}typeChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.type=this.type,this.validate())}listChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.setAttribute("list",this.list),this.validate())}maxlengthChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.maxLength=this.maxlength,this.validate())}minlengthChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.minLength=this.minlength,this.validate())}patternChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.pattern=this.pattern,this.validate())}sizeChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.size=this.size)}spellcheckChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.spellcheck=this.spellcheck)}connectedCallback(){super.connectedCallback(),this.proxy.setAttribute("type",this.type),this.validate(),this.autofocus&&c.queueUpdate((()=>{this.focus()}))}select(){this.control.select(),this.$emit("select")}handleTextInput(){this.value=this.control.value}handleChange(){this.$emit("change")}validate(){super.validate(this.control)}}oe([lt({attribute:"readonly",mode:"boolean"})],An.prototype,"readOnly",void 0),oe([lt({mode:"boolean"})],An.prototype,"autofocus",void 0),oe([lt],An.prototype,"placeholder",void 0),oe([lt],An.prototype,"type",void 0),oe([lt],An.prototype,"list",void 0),oe([lt({converter:rt})],An.prototype,"maxlength",void 0),oe([lt({converter:rt})],An.prototype,"minlength",void 0),oe([lt],An.prototype,"pattern",void 0),oe([lt({converter:rt})],An.prototype,"size",void 0),oe([lt({mode:"boolean"})],An.prototype,"spellcheck",void 0),oe([v],An.prototype,"defaultSlottedNodes",void 0);class Dn{}oi(Dn,Vi),oi(An,Zt,Dn);class Fn extends ei{}class Ln extends(hs(Fn)){constructor(){super(...arguments),this.proxy=document.createElement("input")}}class Pn extends Ln{constructor(){super(...arguments),this.hideStep=!1,this.step=1,this.isUserInput=!1}maxChanged(t,e){var i;this.max=Math.max(e,null!==(i=this.min)&&void 0!==i?i:e);const s=Math.min(this.min,this.max);void 0!==this.min&&this.min!==s&&(this.min=s),this.value=this.getValidValue(this.value)}minChanged(t,e){var i;this.min=Math.min(e,null!==(i=this.max)&&void 0!==i?i:e);const s=Math.max(this.min,this.max);void 0!==this.max&&this.max!==s&&(this.max=s),this.value=this.getValidValue(this.value)}get valueAsNumber(){return parseFloat(super.value)}set valueAsNumber(t){this.value=t.toString()}valueChanged(t,e){this.value=this.getValidValue(e),e===this.value&&(this.control&&!this.isUserInput&&this.syncValueToInnerControl(),super.valueChanged(t,this.value),void 0===t||this.isUserInput||(this.$emit("input"),this.$emit("change")),this.isUserInput=!1)}validate(){super.validate(this.control)}getValidValue(t){
|
|
851
|
+
`;class On extends ei{}class Sn extends(hs(On)){constructor(){super(...arguments),this.proxy=document.createElement("input")}}const Rn={email:"email",password:"password",tel:"tel",text:"text",url:"url"};class An extends Sn{constructor(){super(...arguments),this.type=Rn.text}readOnlyChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.readOnly=this.readOnly,this.validate())}autofocusChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.autofocus=this.autofocus,this.validate())}placeholderChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.placeholder=this.placeholder)}typeChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.type=this.type,this.validate())}listChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.setAttribute("list",this.list),this.validate())}maxlengthChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.maxLength=this.maxlength,this.validate())}minlengthChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.minLength=this.minlength,this.validate())}patternChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.pattern=this.pattern,this.validate())}sizeChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.size=this.size)}spellcheckChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.spellcheck=this.spellcheck)}connectedCallback(){super.connectedCallback(),this.proxy.setAttribute("type",this.type),this.validate(),this.autofocus&&c.queueUpdate((()=>{this.focus()}))}select(){this.control.select(),this.$emit("select")}handleTextInput(){this.value=this.control.value}handleChange(){this.$emit("change")}validate(){super.validate(this.control)}}oe([lt({attribute:"readonly",mode:"boolean"})],An.prototype,"readOnly",void 0),oe([lt({mode:"boolean"})],An.prototype,"autofocus",void 0),oe([lt],An.prototype,"placeholder",void 0),oe([lt],An.prototype,"type",void 0),oe([lt],An.prototype,"list",void 0),oe([lt({converter:rt})],An.prototype,"maxlength",void 0),oe([lt({converter:rt})],An.prototype,"minlength",void 0),oe([lt],An.prototype,"pattern",void 0),oe([lt({converter:rt})],An.prototype,"size",void 0),oe([lt({mode:"boolean"})],An.prototype,"spellcheck",void 0),oe([v],An.prototype,"defaultSlottedNodes",void 0);class Dn{}oi(Dn,Vi),oi(An,Zt,Dn);class Fn extends ei{}class Ln extends(hs(Fn)){constructor(){super(...arguments),this.proxy=document.createElement("input")}}class Pn extends Ln{constructor(){super(...arguments),this.hideStep=!1,this.step=1,this.isUserInput=!1}maxChanged(t,e){var i;this.max=Math.max(e,null!==(i=this.min)&&void 0!==i?i:e);const s=Math.min(this.min,this.max);void 0!==this.min&&this.min!==s&&(this.min=s),this.value=this.getValidValue(this.value)}minChanged(t,e){var i;this.min=Math.min(e,null!==(i=this.max)&&void 0!==i?i:e);const s=Math.max(this.min,this.max);void 0!==this.max&&this.max!==s&&(this.max=s),this.value=this.getValidValue(this.value)}get valueAsNumber(){return parseFloat(super.value)}set valueAsNumber(t){this.value=t.toString()}valueChanged(t,e){this.value=this.getValidValue(e),e===this.value&&(this.control&&!this.isUserInput&&this.syncValueToInnerControl(),super.valueChanged(t,this.value),void 0===t||this.isUserInput||(this.$emit("input"),this.$emit("change")),this.isUserInput=!1)}validate(){super.validate(this.control)}limitPrecision(t){return parseFloat(t.toPrecision(15))}getValidValue(t){let e=this.limitPrecision(parseFloat(t));return isNaN(e)?"":(void 0!==this.max&&(e=Math.min(e,this.limitPrecision(this.max))),void 0!==this.min&&(e=Math.max(e,this.limitPrecision(this.min))),e.toString())}stepUp(){const t=parseFloat(this.value),e=isNaN(t)?this.min>0?this.min:this.max<0?this.max:this.min?0:this.step:t+this.step;this.value=e.toString()}stepDown(){const t=parseFloat(this.value),e=isNaN(t)?this.min>0?this.min:this.max<0?this.max:this.min?0:0-this.step:t-this.step;this.value=e.toString()}connectedCallback(){super.connectedCallback(),this.proxy.setAttribute("type","number"),this.validate(),this.syncValueToInnerControl(),this.autofocus&&c.queueUpdate((()=>{this.focus()}))}select(){this.control.select(),this.$emit("select")}handleTextInput(){this.control.value=this.sanitizeInput(this.control.value),this.isUserInput=!0,this.syncValueFromInnerControl()}handleChange(){this.$emit("change")}handleKeyDown(t){switch(t.key){case xi:return this.stepUp(),!1;case bi:return this.stepDown(),!1}return!0}handleBlur(){this.syncValueToInnerControl()}sanitizeInput(t){return t.replace(/[^0-9\-+e.]/g,"")}syncValueFromInnerControl(){this.value=this.control.value}syncValueToInnerControl(){this.control.value=this.value}}oe([lt({attribute:"readonly",mode:"boolean"})],Pn.prototype,"readOnly",void 0),oe([lt({mode:"boolean"})],Pn.prototype,"autofocus",void 0),oe([lt({attribute:"hide-step",mode:"boolean"})],Pn.prototype,"hideStep",void 0),oe([lt],Pn.prototype,"placeholder",void 0),oe([lt],Pn.prototype,"list",void 0),oe([lt({converter:rt})],Pn.prototype,"maxlength",void 0),oe([lt({converter:rt})],Pn.prototype,"minlength",void 0),oe([lt({converter:rt})],Pn.prototype,"size",void 0),oe([lt({converter:rt})],Pn.prototype,"step",void 0),oe([lt({converter:rt})],Pn.prototype,"max",void 0),oe([lt({converter:rt})],Pn.prototype,"min",void 0),oe([v],Pn.prototype,"defaultSlottedNodes",void 0),oi(Pn,Zt,Dn);const Mn=(t,e)=>K`
|
|
852
852
|
<template
|
|
853
853
|
role="progressbar"
|
|
854
854
|
aria-valuenow="${t=>t.value}"
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@ni/fast-foundation",
|
|
3
3
|
"description": "A library of Web Component building blocks",
|
|
4
4
|
"sideEffects": false,
|
|
5
|
-
"version": "10.1.
|
|
5
|
+
"version": "10.1.3",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "National Instruments"
|
|
8
8
|
},
|
|
@@ -88,8 +88,8 @@
|
|
|
88
88
|
"webpack": "^5.97.1"
|
|
89
89
|
},
|
|
90
90
|
"dependencies": {
|
|
91
|
-
"@ni/fast-element": "^10.0.
|
|
92
|
-
"@ni/fast-web-utilities": "^10.0.
|
|
91
|
+
"@ni/fast-element": "^10.0.3",
|
|
92
|
+
"@ni/fast-web-utilities": "^10.0.3",
|
|
93
93
|
"tabbable": "^6.2.0",
|
|
94
94
|
"tslib": "^2.8.1"
|
|
95
95
|
},
|