@vonage/vivid 4.14.0 → 4.14.2
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 +152 -197
- package/lib/divider/divider.d.ts +1 -1
- package/lib/divider/divider.template.d.ts +1 -1
- package/lib/elevation/elevation.d.ts +1 -0
- package/lib/radio/radio.form-associated.d.ts +2 -0
- package/lib/tabs/tabs.d.ts +0 -5
- package/lib/text-anchor/text-anchor.d.ts +2 -2
- package/lib/tree-item/tree-item.d.ts +2 -2
- package/lib/tree-view/tree-view.d.ts +2 -2
- package/package.json +1 -1
- package/shared/affix.cjs +8 -8
- package/shared/affix.js +2 -2
- package/shared/anchor.cjs +10 -10
- package/shared/anchor.js +1 -1
- package/shared/anchored.cjs +6 -6
- package/shared/anchored.js +1 -1
- package/shared/apply-mixins.cjs +3 -3
- package/shared/apply-mixins.js +1 -1
- package/shared/apply-mixins2.cjs +3 -3
- package/shared/apply-mixins2.js +1 -1
- package/shared/applyMixinsWithObservables.cjs +3 -3
- package/shared/applyMixinsWithObservables.js +1 -1
- package/shared/aria-global.cjs +20 -20
- package/shared/aria-global.js +1 -1
- package/shared/base-progress.cjs +7 -8
- package/shared/base-progress.js +2 -3
- package/shared/breadcrumb-item.cjs +2 -3
- package/shared/breadcrumb-item.js +1 -2
- package/shared/button.cjs +10 -11
- package/shared/button.js +1 -2
- package/shared/calendar-event.cjs +7 -8
- package/shared/calendar-event.js +1 -2
- package/shared/children.cjs +2 -2
- package/shared/children.js +1 -1
- package/shared/definition.cjs +14 -15
- package/shared/definition.js +2 -3
- package/shared/definition10.cjs +5 -6
- package/shared/definition10.js +1 -2
- package/shared/definition11.cjs +29 -29
- package/shared/definition11.js +2 -2
- package/shared/definition12.cjs +6 -6
- package/shared/definition12.js +1 -1
- package/shared/definition13.cjs +13 -14
- package/shared/definition13.js +1 -2
- package/shared/definition14.cjs +23 -24
- package/shared/definition14.js +1 -2
- package/shared/definition15.cjs +15 -16
- package/shared/definition15.js +1 -2
- package/shared/definition16.cjs +21 -21
- package/shared/definition16.js +5 -5
- package/shared/definition17.cjs +62 -61
- package/shared/definition17.js +10 -9
- package/shared/definition18.cjs +4 -4
- package/shared/definition18.js +1 -1
- package/shared/definition19.cjs +12 -12
- package/shared/definition19.js +1 -1
- package/shared/definition2.cjs +6 -7
- package/shared/definition2.js +1 -2
- package/shared/definition20.cjs +20 -21
- package/shared/definition20.js +1 -2
- package/shared/definition21.cjs +27 -28
- package/shared/definition21.js +3 -4
- package/shared/definition22.cjs +7 -7
- package/shared/definition22.js +3 -3
- package/shared/definition23.cjs +10 -11
- package/shared/definition23.js +1 -2
- package/shared/definition24.cjs +8 -8
- package/shared/definition24.js +3 -3
- package/shared/definition25.cjs +13 -14
- package/shared/definition25.js +1 -2
- package/shared/definition26.cjs +5 -6
- package/shared/definition26.js +1 -2
- package/shared/definition27.cjs +12 -13
- package/shared/definition27.js +2 -3
- package/shared/definition28.cjs +9 -10
- package/shared/definition28.js +2 -3
- package/shared/definition29.cjs +44 -45
- package/shared/definition29.js +3 -4
- package/shared/definition3.cjs +8 -9
- package/shared/definition3.js +1 -2
- package/shared/definition30.cjs +9 -10
- package/shared/definition30.js +2 -3
- package/shared/definition31.cjs +5 -5
- package/shared/definition31.js +2 -2
- package/shared/definition32.cjs +3 -4
- package/shared/definition32.js +1 -2
- package/shared/definition33.cjs +6 -7
- package/shared/definition33.js +2 -3
- package/shared/definition34.cjs +112 -45
- package/shared/definition34.js +73 -6
- package/shared/definition35.cjs +9 -209
- package/shared/definition35.js +4 -202
- package/shared/definition36.cjs +15 -16
- package/shared/definition36.js +1 -2
- package/shared/definition37.cjs +9 -9
- package/shared/definition37.js +1 -1
- package/shared/definition38.cjs +10 -10
- package/shared/definition38.js +1 -1
- package/shared/definition39.cjs +12 -13
- package/shared/definition39.js +1 -2
- package/shared/definition4.cjs +19 -20
- package/shared/definition4.js +2 -3
- package/shared/definition40.cjs +61 -13
- package/shared/definition40.js +52 -4
- package/shared/definition41.cjs +29 -30
- package/shared/definition41.js +1 -2
- package/shared/definition42.cjs +52 -53
- package/shared/definition42.js +3 -4
- package/shared/definition43.cjs +40 -40
- package/shared/definition43.js +6 -6
- package/shared/definition44.cjs +14 -15
- package/shared/definition44.js +1 -2
- package/shared/definition45.cjs +9 -10
- package/shared/definition45.js +1 -2
- package/shared/definition46.cjs +26 -27
- package/shared/definition46.js +1 -2
- package/shared/definition47.cjs +17 -18
- package/shared/definition47.js +2 -3
- package/shared/definition48.cjs +9 -10
- package/shared/definition48.js +1 -2
- package/shared/definition49.cjs +3 -4
- package/shared/definition49.js +1 -2
- package/shared/definition5.cjs +30 -31
- package/shared/definition5.js +1 -2
- package/shared/definition50.cjs +12 -13
- package/shared/definition50.js +2 -3
- package/shared/definition51.cjs +109 -72
- package/shared/definition51.js +78 -41
- package/shared/definition52.cjs +4 -5
- package/shared/definition52.js +1 -2
- package/shared/definition53.cjs +15 -16
- package/shared/definition53.js +2 -3
- package/shared/definition54.cjs +20 -21
- package/shared/definition54.js +1 -2
- package/shared/definition55.cjs +5 -5
- package/shared/definition55.js +1 -1
- package/shared/definition56.cjs +18 -19
- package/shared/definition56.js +1 -2
- package/shared/definition57.cjs +10 -11
- package/shared/definition57.js +1 -2
- package/shared/definition58.cjs +7 -8
- package/shared/definition58.js +1 -2
- package/shared/definition59.cjs +16 -17
- package/shared/definition59.js +3 -4
- package/shared/definition6.cjs +11 -12
- package/shared/definition6.js +1 -2
- package/shared/definition60.cjs +9 -10
- package/shared/definition60.js +2 -3
- package/shared/definition61.cjs +27 -30
- package/shared/definition61.js +17 -20
- package/shared/definition62.cjs +12 -9
- package/shared/definition62.js +8 -5
- package/shared/definition63.cjs +13 -14
- package/shared/definition63.js +1 -2
- package/shared/definition7.cjs +9 -10
- package/shared/definition7.js +2 -3
- package/shared/definition8.cjs +14 -15
- package/shared/definition8.js +2 -3
- package/shared/definition9.cjs +7 -7
- package/shared/definition9.js +1 -1
- package/shared/form-associated.cjs +14 -14
- package/shared/form-associated.js +1 -1
- package/shared/form-associated2.cjs +10 -10
- package/shared/form-associated2.js +1 -1
- package/shared/form-elements.cjs +13 -13
- package/shared/form-elements.js +1 -1
- package/shared/foundation/progress/base-progress.d.ts +2 -2
- package/shared/foundation-element.cjs +11 -11
- package/shared/foundation-element.js +1 -1
- package/shared/key-codes2.cjs +0 -56
- package/shared/key-codes2.js +1 -53
- package/shared/listbox.cjs +15 -16
- package/shared/listbox.js +2 -3
- package/shared/localized.cjs +2 -2
- package/shared/localized.js +1 -1
- package/shared/option.cjs +205 -0
- package/shared/option.js +202 -0
- package/shared/presentationDate.cjs +42 -43
- package/shared/presentationDate.js +1 -2
- package/shared/ref.cjs +2 -2
- package/shared/ref.js +1 -1
- package/shared/repeat.cjs +15 -15
- package/shared/repeat.js +1 -1
- package/shared/slider.template.cjs +4 -4
- package/shared/slider.template.js +1 -1
- package/shared/slotted.cjs +4 -4
- package/shared/slotted.js +1 -1
- package/shared/start-end.cjs +52 -0
- package/shared/start-end.js +50 -0
- package/shared/text-anchor.cjs +5 -6
- package/shared/text-anchor.js +3 -4
- package/shared/text-anchor.template.cjs +2 -2
- package/shared/text-anchor.template.js +1 -1
- package/shared/text-field2.cjs +23 -24
- package/shared/text-field2.js +2 -3
- package/shared/vivid-element.cjs +2610 -2
- package/shared/vivid-element.js +2591 -2
- package/styles/core/all.css +40 -1
- package/styles/core/theme.css +40 -1
- package/styles/core/typography.css +1 -1
- package/styles/tokens/theme-dark.css +25 -4
- package/styles/tokens/theme-light.css +25 -4
- package/styles/tokens/vivid-2-compat.css +1 -1
- package/text-anchor/index.cjs +3 -3
- package/text-anchor/index.js +1 -1
- package/lib/listbox/definition.d.ts +0 -2
- package/lib/listbox/listbox.d.ts +0 -14
- package/lib/listbox/listbox.template.d.ts +0 -2
- package/listbox/index.cjs +0 -54
- package/listbox/index.js +0 -52
- package/shared/aria-global2.cjs +0 -75
- package/shared/aria-global2.js +0 -73
- package/shared/defineVividComponent.cjs +0 -2612
- package/shared/defineVividComponent.js +0 -2592
- package/shared/listbox2.cjs +0 -1268
- package/shared/listbox2.js +0 -1265
- package/shared/strings2.cjs +0 -37
- package/shared/strings2.js +0 -33
package/shared/definition38.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const vividElement = require('./vivid-element.cjs');
|
|
4
4
|
const baseProgress = require('./base-progress.cjs');
|
|
5
5
|
const when = require('./when.cjs');
|
|
6
6
|
const classNames = require('./class-names.cjs');
|
|
@@ -24,16 +24,16 @@ class Progress extends baseProgress.BaseProgress {
|
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
__decorateClass([
|
|
27
|
-
|
|
27
|
+
vividElement.attr({ attribute: "aria-label" })
|
|
28
28
|
], Progress.prototype, "ariaLabel");
|
|
29
29
|
__decorateClass([
|
|
30
|
-
|
|
30
|
+
vividElement.attr()
|
|
31
31
|
], Progress.prototype, "shape");
|
|
32
32
|
__decorateClass([
|
|
33
|
-
|
|
33
|
+
vividElement.attr()
|
|
34
34
|
], Progress.prototype, "connotation");
|
|
35
35
|
__decorateClass([
|
|
36
|
-
|
|
36
|
+
vividElement.attr({ mode: "boolean" })
|
|
37
37
|
], Progress.prototype, "reverse");
|
|
38
38
|
|
|
39
39
|
const getClasses = ({ connotation, shape, reverse, paused }) => classNames.classNames(
|
|
@@ -44,18 +44,18 @@ const getClasses = ({ connotation, shape, reverse, paused }) => classNames.class
|
|
|
44
44
|
["paused", Boolean(paused)]
|
|
45
45
|
);
|
|
46
46
|
function determinate() {
|
|
47
|
-
return
|
|
47
|
+
return vividElement.html` <span
|
|
48
48
|
class="determinate"
|
|
49
49
|
style="width: ${(x) => x.percentComplete}%"
|
|
50
50
|
></span>`;
|
|
51
51
|
}
|
|
52
52
|
function indeterminate() {
|
|
53
|
-
return
|
|
53
|
+
return vividElement.html` <span class="indeterminate" name="indeterminate">
|
|
54
54
|
<span class="indicator-1"></span>
|
|
55
55
|
<span class="indicator-2"></span>
|
|
56
56
|
</span>`;
|
|
57
57
|
}
|
|
58
|
-
const ProgressTemplate =
|
|
58
|
+
const ProgressTemplate = vividElement.html`<template
|
|
59
59
|
role="${(x) => x.ariaLabel ? "presentation" : null}"
|
|
60
60
|
>
|
|
61
61
|
<div
|
|
@@ -73,7 +73,7 @@ const ProgressTemplate = defineVividComponent.html`<template
|
|
|
73
73
|
</div>
|
|
74
74
|
</template>`;
|
|
75
75
|
|
|
76
|
-
const progressDefinition =
|
|
76
|
+
const progressDefinition = vividElement.defineVividComponent(
|
|
77
77
|
"progress",
|
|
78
78
|
Progress,
|
|
79
79
|
ProgressTemplate,
|
|
@@ -82,7 +82,7 @@ const progressDefinition = defineVividComponent.defineVividComponent(
|
|
|
82
82
|
styles
|
|
83
83
|
}
|
|
84
84
|
);
|
|
85
|
-
const registerProgress =
|
|
85
|
+
const registerProgress = vividElement.createRegisterFunction(progressDefinition);
|
|
86
86
|
|
|
87
87
|
exports.progressDefinition = progressDefinition;
|
|
88
88
|
exports.registerProgress = registerProgress;
|
package/shared/definition38.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as attr, h as html, d as defineVividComponent, f as createRegisterFunction } from './
|
|
1
|
+
import { a as attr, h as html, d as defineVividComponent, f as createRegisterFunction } from './vivid-element.js';
|
|
2
2
|
import { B as BaseProgress } from './base-progress.js';
|
|
3
3
|
import { w as when } from './when.js';
|
|
4
4
|
import { c as classNames } from './class-names.js';
|
package/shared/definition39.cjs
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const vividElement = require('./vivid-element.cjs');
|
|
4
4
|
const definition = require('./definition40.cjs');
|
|
5
5
|
const keyCodes = require('./key-codes.cjs');
|
|
6
|
-
const vividElement = require('./vivid-element.cjs');
|
|
7
6
|
const aria = require('./aria.cjs');
|
|
8
7
|
const slotted = require('./slotted.cjs');
|
|
9
8
|
const when = require('./when.cjs');
|
|
@@ -227,29 +226,29 @@ class RadioGroup extends vividElement.VividElement {
|
|
|
227
226
|
}
|
|
228
227
|
}
|
|
229
228
|
__decorateClass([
|
|
230
|
-
|
|
229
|
+
vividElement.attr
|
|
231
230
|
], RadioGroup.prototype, "label");
|
|
232
231
|
__decorateClass([
|
|
233
|
-
|
|
232
|
+
vividElement.attr({ attribute: "readonly", mode: "boolean" })
|
|
234
233
|
], RadioGroup.prototype, "readOnly");
|
|
235
234
|
__decorateClass([
|
|
236
|
-
|
|
235
|
+
vividElement.attr({ attribute: "disabled", mode: "boolean" })
|
|
237
236
|
], RadioGroup.prototype, "disabled");
|
|
238
237
|
__decorateClass([
|
|
239
|
-
|
|
238
|
+
vividElement.attr
|
|
240
239
|
], RadioGroup.prototype, "name");
|
|
241
240
|
__decorateClass([
|
|
242
|
-
|
|
241
|
+
vividElement.attr
|
|
243
242
|
], RadioGroup.prototype, "value");
|
|
244
243
|
__decorateClass([
|
|
245
|
-
|
|
244
|
+
vividElement.attr
|
|
246
245
|
], RadioGroup.prototype, "orientation");
|
|
247
246
|
__decorateClass([
|
|
248
|
-
|
|
247
|
+
vividElement.observable
|
|
249
248
|
], RadioGroup.prototype, "slottedRadioButtons");
|
|
250
249
|
|
|
251
250
|
const RadioGroupTemplate = (context) => {
|
|
252
|
-
return
|
|
251
|
+
return vividElement.html`
|
|
253
252
|
<template
|
|
254
253
|
role="radiogroup"
|
|
255
254
|
aria-disabled="${(x) => x.disabled}"
|
|
@@ -260,7 +259,7 @@ const RadioGroupTemplate = (context) => {
|
|
|
260
259
|
>
|
|
261
260
|
${when.when(
|
|
262
261
|
(x) => x.label,
|
|
263
|
-
|
|
262
|
+
vividElement.html`<label>${(x) => x.label}</label>`
|
|
264
263
|
)}
|
|
265
264
|
|
|
266
265
|
<div
|
|
@@ -277,7 +276,7 @@ const RadioGroupTemplate = (context) => {
|
|
|
277
276
|
`;
|
|
278
277
|
};
|
|
279
278
|
|
|
280
|
-
const radioGroupDefinition =
|
|
279
|
+
const radioGroupDefinition = vividElement.defineVividComponent(
|
|
281
280
|
"radio-group",
|
|
282
281
|
RadioGroup,
|
|
283
282
|
RadioGroupTemplate,
|
|
@@ -286,7 +285,7 @@ const radioGroupDefinition = defineVividComponent.defineVividComponent(
|
|
|
286
285
|
styles
|
|
287
286
|
}
|
|
288
287
|
);
|
|
289
|
-
const registerRadioGroup =
|
|
288
|
+
const registerRadioGroup = vividElement.createRegisterFunction(radioGroupDefinition);
|
|
290
289
|
|
|
291
290
|
exports.radioGroupDefinition = radioGroupDefinition;
|
|
292
291
|
exports.registerRadioGroup = registerRadioGroup;
|
package/shared/definition39.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { a as attr, o as observable, h as html, d as defineVividComponent, f as createRegisterFunction } from './
|
|
1
|
+
import { V as VividElement, a as attr, o as observable, h as html, d as defineVividComponent, f as createRegisterFunction } from './vivid-element.js';
|
|
2
2
|
import { R as Radio, r as radioDefinition } from './definition40.js';
|
|
3
3
|
import { i as keyArrowRight, h as keyArrowLeft, e as keyArrowUp, f as keyArrowDown, k as keyEnter } from './key-codes.js';
|
|
4
|
-
import { V as VividElement } from './vivid-element.js';
|
|
5
4
|
import { O as Orientation } from './aria.js';
|
|
6
5
|
import { s as slotted, e as elements } from './slotted.js';
|
|
7
6
|
import { w as when } from './when.js';
|
package/shared/definition4.cjs
CHANGED
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
const definition$1 = require('./definition11.cjs');
|
|
4
4
|
const definition = require('./definition62.cjs');
|
|
5
|
-
const
|
|
5
|
+
const vividElement = require('./vivid-element.cjs');
|
|
6
6
|
const definition$2 = require('./definition27.cjs');
|
|
7
7
|
const enums = require('./enums.cjs');
|
|
8
8
|
const affix = require('./affix.cjs');
|
|
9
9
|
const applyMixins = require('./apply-mixins.cjs');
|
|
10
10
|
const index = require('./index.cjs');
|
|
11
|
-
const vividElement = require('./vivid-element.cjs');
|
|
12
11
|
const localized = require('./localized.cjs');
|
|
13
12
|
const when = require('./when.cjs');
|
|
14
13
|
const classNames = require('./class-names.cjs');
|
|
@@ -106,37 +105,37 @@ class Alert extends vividElement.VividElement {
|
|
|
106
105
|
#onTransitionEnd;
|
|
107
106
|
}
|
|
108
107
|
__decorateClass([
|
|
109
|
-
|
|
108
|
+
vividElement.attr({ attribute: "dismiss-button-aria-label" })
|
|
110
109
|
], Alert.prototype, "dismissButtonAriaLabel");
|
|
111
110
|
__decorateClass([
|
|
112
|
-
|
|
111
|
+
vividElement.attr({ mode: "boolean" })
|
|
113
112
|
], Alert.prototype, "removable");
|
|
114
113
|
__decorateClass([
|
|
115
|
-
|
|
114
|
+
vividElement.attr({ mode: "fromView" })
|
|
116
115
|
], Alert.prototype, "placement");
|
|
117
116
|
__decorateClass([
|
|
118
|
-
|
|
117
|
+
vividElement.attr
|
|
119
118
|
], Alert.prototype, "headline");
|
|
120
119
|
__decorateClass([
|
|
121
|
-
|
|
120
|
+
vividElement.attr
|
|
122
121
|
], Alert.prototype, "text");
|
|
123
122
|
__decorateClass([
|
|
124
|
-
|
|
123
|
+
vividElement.attr
|
|
125
124
|
], Alert.prototype, "icon");
|
|
126
125
|
__decorateClass([
|
|
127
|
-
|
|
126
|
+
vividElement.attr({
|
|
128
127
|
mode: "fromView",
|
|
129
|
-
converter:
|
|
128
|
+
converter: vividElement.nullableNumberConverter
|
|
130
129
|
})
|
|
131
130
|
], Alert.prototype, "timeoutms");
|
|
132
131
|
__decorateClass([
|
|
133
|
-
|
|
132
|
+
vividElement.attr
|
|
134
133
|
], Alert.prototype, "connotation");
|
|
135
134
|
__decorateClass([
|
|
136
|
-
|
|
135
|
+
vividElement.attr
|
|
137
136
|
], Alert.prototype, "strategy");
|
|
138
137
|
__decorateClass([
|
|
139
|
-
|
|
138
|
+
vividElement.attr({ mode: "boolean" })
|
|
140
139
|
], Alert.prototype, "open");
|
|
141
140
|
applyMixins.applyMixins(Alert, affix.AffixIcon);
|
|
142
141
|
applyMixins.applyMixins(Alert, localized.Localized);
|
|
@@ -150,10 +149,10 @@ const getControlClasses = ({ open, placement, strategy }) => classNames.classNam
|
|
|
150
149
|
);
|
|
151
150
|
function renderIcon(context) {
|
|
152
151
|
const affixIconTemplate = affix.affixIconTemplateFactory(context);
|
|
153
|
-
return
|
|
152
|
+
return vividElement.html`${(x) => affixIconTemplate(x.conditionedIcon, affix.IconWrapper.Slot)}`;
|
|
154
153
|
}
|
|
155
154
|
function renderDismissButton(buttonTag) {
|
|
156
|
-
return
|
|
155
|
+
return vividElement.html`
|
|
157
156
|
<${buttonTag}
|
|
158
157
|
aria-label="${(x) => x.dismissButtonAriaLabel || x.locale.alert.dismissButtonLabel}"
|
|
159
158
|
size="condensed"
|
|
@@ -165,7 +164,7 @@ function renderDismissButton(buttonTag) {
|
|
|
165
164
|
const AlertTemplate = (context) => {
|
|
166
165
|
const elevationTag = context.tagFor(definition.Elevation);
|
|
167
166
|
const buttonTag = context.tagFor(definition$1.Button);
|
|
168
|
-
return
|
|
167
|
+
return vividElement.html`
|
|
169
168
|
<${elevationTag} class="elevation" dp='8' exportparts="vvd-theme-alternate">
|
|
170
169
|
<div
|
|
171
170
|
class="${getControlClasses}"
|
|
@@ -177,9 +176,9 @@ const AlertTemplate = (context) => {
|
|
|
177
176
|
<div class="alert-text">
|
|
178
177
|
${when.when(
|
|
179
178
|
(x) => x.headline,
|
|
180
|
-
|
|
179
|
+
vividElement.html`<header class="headline">${(x) => x.headline}</header>`
|
|
181
180
|
)}
|
|
182
|
-
${when.when((x) => x.text,
|
|
181
|
+
${when.when((x) => x.text, vividElement.html`<div class="main-text">${(x) => x.text}</div>`)}
|
|
183
182
|
<slot name="main"></slot>
|
|
184
183
|
</div>
|
|
185
184
|
<slot class="action-items" name="action-items"></slot>
|
|
@@ -190,7 +189,7 @@ const AlertTemplate = (context) => {
|
|
|
190
189
|
`;
|
|
191
190
|
};
|
|
192
191
|
|
|
193
|
-
const alertDefinition =
|
|
192
|
+
const alertDefinition = vividElement.defineVividComponent(
|
|
194
193
|
"alert",
|
|
195
194
|
Alert,
|
|
196
195
|
AlertTemplate,
|
|
@@ -199,7 +198,7 @@ const alertDefinition = defineVividComponent.defineVividComponent(
|
|
|
199
198
|
styles
|
|
200
199
|
}
|
|
201
200
|
);
|
|
202
|
-
const registerAlert =
|
|
201
|
+
const registerAlert = vividElement.createRegisterFunction(alertDefinition);
|
|
203
202
|
|
|
204
203
|
exports.alertDefinition = alertDefinition;
|
|
205
204
|
exports.registerAlert = registerAlert;
|
package/shared/definition4.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { B as Button, b as buttonDefinition } from './definition11.js';
|
|
2
2
|
import { E as Elevation, e as elevationDefinition } from './definition62.js';
|
|
3
|
-
import { a as attr, n as nullableNumberConverter, h as html, d as defineVividComponent, f as createRegisterFunction } from './
|
|
3
|
+
import { V as VividElement, a as attr, n as nullableNumberConverter, h as html, d as defineVividComponent, f as createRegisterFunction } from './vivid-element.js';
|
|
4
4
|
import { i as iconDefinition } from './definition27.js';
|
|
5
5
|
import { C as Connotation } from './enums.js';
|
|
6
|
-
import {
|
|
6
|
+
import { b as AffixIcon, a as affixIconTemplateFactory, I as IconWrapper } from './affix.js';
|
|
7
7
|
import { a as applyMixins } from './apply-mixins.js';
|
|
8
8
|
import { h as handleEscapeKeyAndStopPropogation } from './index.js';
|
|
9
|
-
import { V as VividElement } from './vivid-element.js';
|
|
10
9
|
import { L as Localized } from './localized.js';
|
|
11
10
|
import { w as when } from './when.js';
|
|
12
11
|
import { c as classNames } from './class-names.js';
|
package/shared/definition40.cjs
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const defineVividComponent = require('./defineVividComponent.cjs');
|
|
4
|
-
const formAssociated = require('./form-associated.cjs');
|
|
5
3
|
const vividElement = require('./vivid-element.cjs');
|
|
4
|
+
const formAssociated = require('./form-associated.cjs');
|
|
6
5
|
const keyCodes = require('./key-codes.cjs');
|
|
7
6
|
const when = require('./when.cjs');
|
|
8
7
|
const classNames = require('./class-names.cjs');
|
|
@@ -15,7 +14,45 @@ class FormAssociatedRadio extends formAssociated.CheckableFormAssociated(_Radio)
|
|
|
15
14
|
constructor() {
|
|
16
15
|
super(...arguments);
|
|
17
16
|
this.proxy = document.createElement("input");
|
|
17
|
+
this.#validateValueMissingWithSiblings = () => {
|
|
18
|
+
const siblings = this.#radioSiblings;
|
|
19
|
+
if (siblings && siblings.length > 1) {
|
|
20
|
+
const isSiblingChecked = siblings.some((x) => x.checked);
|
|
21
|
+
if (isSiblingChecked) {
|
|
22
|
+
this.setValidity({ valueMissing: false });
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
this.#syncSiblingsRequiredValidationStatus = () => {
|
|
27
|
+
if (this.elementInternals && !this.validity.valueMissing) {
|
|
28
|
+
const siblings = this.#radioSiblings;
|
|
29
|
+
if (siblings && siblings.length > 1) {
|
|
30
|
+
siblings.forEach((x) => {
|
|
31
|
+
x.elementInternals.setValidity({ valueMissing: false });
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
this.validate = (anchor) => {
|
|
37
|
+
super.validate(anchor);
|
|
38
|
+
if (this.validity.valueMissing) {
|
|
39
|
+
this.#validateValueMissingWithSiblings();
|
|
40
|
+
} else {
|
|
41
|
+
this.#syncSiblingsRequiredValidationStatus();
|
|
42
|
+
}
|
|
43
|
+
};
|
|
18
44
|
}
|
|
45
|
+
get #radioSiblings() {
|
|
46
|
+
const siblings = this.parentElement?.querySelectorAll(
|
|
47
|
+
`${this.tagName.toLocaleLowerCase()}[name="${this.name}"]`
|
|
48
|
+
);
|
|
49
|
+
if (siblings) {
|
|
50
|
+
return Array.from(siblings);
|
|
51
|
+
}
|
|
52
|
+
return [];
|
|
53
|
+
}
|
|
54
|
+
#validateValueMissingWithSiblings;
|
|
55
|
+
#syncSiblingsRequiredValidationStatus;
|
|
19
56
|
}
|
|
20
57
|
|
|
21
58
|
var __defProp = Object.defineProperty;
|
|
@@ -53,6 +90,7 @@ class Radio extends FormAssociatedRadio {
|
|
|
53
90
|
return true;
|
|
54
91
|
};
|
|
55
92
|
this.proxy.setAttribute("type", "radio");
|
|
93
|
+
this.proxy.setAttribute("name", this.name);
|
|
56
94
|
}
|
|
57
95
|
// Map to proxy element
|
|
58
96
|
/**
|
|
@@ -74,12 +112,22 @@ class Radio extends FormAssociatedRadio {
|
|
|
74
112
|
}
|
|
75
113
|
}
|
|
76
114
|
}
|
|
115
|
+
/**
|
|
116
|
+
* @internal
|
|
117
|
+
*/
|
|
118
|
+
nameChanged(previous, next) {
|
|
119
|
+
if (super.nameChanged) {
|
|
120
|
+
super.nameChanged(previous, next);
|
|
121
|
+
}
|
|
122
|
+
next !== null ? this.proxy.setAttribute("name", this.name) : this.proxy.removeAttribute("name");
|
|
123
|
+
vividElement.DOM.queueUpdate(this.validate);
|
|
124
|
+
}
|
|
77
125
|
/**
|
|
78
126
|
* @internal
|
|
79
127
|
*/
|
|
80
128
|
connectedCallback() {
|
|
81
129
|
super.connectedCallback();
|
|
82
|
-
this.validate
|
|
130
|
+
vividElement.DOM.queueUpdate(this.validate);
|
|
83
131
|
if (this.parentElement.getAttribute("role") !== "radiogroup" && this.getAttribute("tabindex") === null) {
|
|
84
132
|
if (!this.disabled) {
|
|
85
133
|
this.setAttribute("tabindex", "0");
|
|
@@ -110,22 +158,22 @@ class Radio extends FormAssociatedRadio {
|
|
|
110
158
|
}
|
|
111
159
|
}
|
|
112
160
|
__decorateClass([
|
|
113
|
-
|
|
161
|
+
vividElement.attr({ attribute: "aria-label" })
|
|
114
162
|
], Radio.prototype, "ariaLabel");
|
|
115
163
|
__decorateClass([
|
|
116
|
-
|
|
164
|
+
vividElement.attr
|
|
117
165
|
], Radio.prototype, "label");
|
|
118
166
|
__decorateClass([
|
|
119
|
-
|
|
167
|
+
vividElement.attr
|
|
120
168
|
], Radio.prototype, "connotation");
|
|
121
169
|
__decorateClass([
|
|
122
|
-
|
|
170
|
+
vividElement.attr({ attribute: "readonly", mode: "boolean" })
|
|
123
171
|
], Radio.prototype, "readOnly");
|
|
124
172
|
__decorateClass([
|
|
125
|
-
|
|
173
|
+
vividElement.attr
|
|
126
174
|
], Radio.prototype, "name");
|
|
127
175
|
__decorateClass([
|
|
128
|
-
|
|
176
|
+
vividElement.observable
|
|
129
177
|
], Radio.prototype, "defaultSlottedNodes");
|
|
130
178
|
|
|
131
179
|
const getClasses = ({ connotation, checked, readOnly, disabled }) => classNames.classNames(
|
|
@@ -135,7 +183,7 @@ const getClasses = ({ connotation, checked, readOnly, disabled }) => classNames.
|
|
|
135
183
|
["readonly", Boolean(readOnly)],
|
|
136
184
|
["disabled", Boolean(disabled)]
|
|
137
185
|
);
|
|
138
|
-
const RadioTemplate =
|
|
186
|
+
const RadioTemplate = vividElement.html`<template
|
|
139
187
|
role="${(x) => x.ariaLabel ? "presentation" : null}"
|
|
140
188
|
>
|
|
141
189
|
<div
|
|
@@ -151,12 +199,12 @@ const RadioTemplate = defineVividComponent.html`<template
|
|
|
151
199
|
<div class="control"></div>
|
|
152
200
|
${when.when(
|
|
153
201
|
(x) => x.label,
|
|
154
|
-
|
|
202
|
+
vividElement.html`<label class="label">${(x) => x.label}</label>`
|
|
155
203
|
)}
|
|
156
204
|
</div>
|
|
157
205
|
</template>`;
|
|
158
206
|
|
|
159
|
-
const radioDefinition =
|
|
207
|
+
const radioDefinition = vividElement.defineVividComponent(
|
|
160
208
|
"radio",
|
|
161
209
|
Radio,
|
|
162
210
|
RadioTemplate,
|
|
@@ -165,7 +213,7 @@ const radioDefinition = defineVividComponent.defineVividComponent(
|
|
|
165
213
|
styles
|
|
166
214
|
}
|
|
167
215
|
);
|
|
168
|
-
const registerRadio =
|
|
216
|
+
const registerRadio = vividElement.createRegisterFunction(radioDefinition);
|
|
169
217
|
|
|
170
218
|
exports.Radio = Radio;
|
|
171
219
|
exports.radioDefinition = radioDefinition;
|
package/shared/definition40.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { a as attr, o as observable, h as html, d as defineVividComponent, f as createRegisterFunction } from './
|
|
1
|
+
import { V as VividElement, D as DOM, a as attr, o as observable, h as html, d as defineVividComponent, f as createRegisterFunction } from './vivid-element.js';
|
|
2
2
|
import { C as CheckableFormAssociated } from './form-associated.js';
|
|
3
|
-
import { V as VividElement } from './vivid-element.js';
|
|
4
3
|
import { a as keySpace } from './key-codes.js';
|
|
5
4
|
import { w as when } from './when.js';
|
|
6
5
|
import { c as classNames } from './class-names.js';
|
|
@@ -13,7 +12,45 @@ class FormAssociatedRadio extends CheckableFormAssociated(_Radio) {
|
|
|
13
12
|
constructor() {
|
|
14
13
|
super(...arguments);
|
|
15
14
|
this.proxy = document.createElement("input");
|
|
15
|
+
this.#validateValueMissingWithSiblings = () => {
|
|
16
|
+
const siblings = this.#radioSiblings;
|
|
17
|
+
if (siblings && siblings.length > 1) {
|
|
18
|
+
const isSiblingChecked = siblings.some((x) => x.checked);
|
|
19
|
+
if (isSiblingChecked) {
|
|
20
|
+
this.setValidity({ valueMissing: false });
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
this.#syncSiblingsRequiredValidationStatus = () => {
|
|
25
|
+
if (this.elementInternals && !this.validity.valueMissing) {
|
|
26
|
+
const siblings = this.#radioSiblings;
|
|
27
|
+
if (siblings && siblings.length > 1) {
|
|
28
|
+
siblings.forEach((x) => {
|
|
29
|
+
x.elementInternals.setValidity({ valueMissing: false });
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
this.validate = (anchor) => {
|
|
35
|
+
super.validate(anchor);
|
|
36
|
+
if (this.validity.valueMissing) {
|
|
37
|
+
this.#validateValueMissingWithSiblings();
|
|
38
|
+
} else {
|
|
39
|
+
this.#syncSiblingsRequiredValidationStatus();
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
get #radioSiblings() {
|
|
44
|
+
const siblings = this.parentElement?.querySelectorAll(
|
|
45
|
+
`${this.tagName.toLocaleLowerCase()}[name="${this.name}"]`
|
|
46
|
+
);
|
|
47
|
+
if (siblings) {
|
|
48
|
+
return Array.from(siblings);
|
|
49
|
+
}
|
|
50
|
+
return [];
|
|
16
51
|
}
|
|
52
|
+
#validateValueMissingWithSiblings;
|
|
53
|
+
#syncSiblingsRequiredValidationStatus;
|
|
17
54
|
}
|
|
18
55
|
|
|
19
56
|
var __defProp = Object.defineProperty;
|
|
@@ -51,6 +88,7 @@ class Radio extends FormAssociatedRadio {
|
|
|
51
88
|
return true;
|
|
52
89
|
};
|
|
53
90
|
this.proxy.setAttribute("type", "radio");
|
|
91
|
+
this.proxy.setAttribute("name", this.name);
|
|
54
92
|
}
|
|
55
93
|
// Map to proxy element
|
|
56
94
|
/**
|
|
@@ -72,12 +110,22 @@ class Radio extends FormAssociatedRadio {
|
|
|
72
110
|
}
|
|
73
111
|
}
|
|
74
112
|
}
|
|
113
|
+
/**
|
|
114
|
+
* @internal
|
|
115
|
+
*/
|
|
116
|
+
nameChanged(previous, next) {
|
|
117
|
+
if (super.nameChanged) {
|
|
118
|
+
super.nameChanged(previous, next);
|
|
119
|
+
}
|
|
120
|
+
next !== null ? this.proxy.setAttribute("name", this.name) : this.proxy.removeAttribute("name");
|
|
121
|
+
DOM.queueUpdate(this.validate);
|
|
122
|
+
}
|
|
75
123
|
/**
|
|
76
124
|
* @internal
|
|
77
125
|
*/
|
|
78
126
|
connectedCallback() {
|
|
79
127
|
super.connectedCallback();
|
|
80
|
-
this.validate
|
|
128
|
+
DOM.queueUpdate(this.validate);
|
|
81
129
|
if (this.parentElement.getAttribute("role") !== "radiogroup" && this.getAttribute("tabindex") === null) {
|
|
82
130
|
if (!this.disabled) {
|
|
83
131
|
this.setAttribute("tabindex", "0");
|
|
@@ -120,7 +168,7 @@ __decorateClass([
|
|
|
120
168
|
attr({ attribute: "readonly", mode: "boolean" })
|
|
121
169
|
], Radio.prototype, "readOnly");
|
|
122
170
|
__decorateClass([
|
|
123
|
-
|
|
171
|
+
attr
|
|
124
172
|
], Radio.prototype, "name");
|
|
125
173
|
__decorateClass([
|
|
126
174
|
observable
|