@vonage/vivid 4.22.0 → 4.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +1658 -370
- package/lib/accordion-item/accordion-item.d.ts +11 -5
- package/lib/action-group/action-group.d.ts +8 -6
- package/lib/alert/alert.d.ts +21 -9
- package/lib/audio-player/audio-player.d.ts +11 -5
- package/lib/badge/badge.d.ts +11 -5
- package/lib/banner/banner.d.ts +26 -12
- package/lib/breadcrumb/breadcrumb.d.ts +333 -1
- package/lib/breadcrumb/breadcrumb.template.d.ts +2 -3
- package/lib/breadcrumb-item/breadcrumb-item.d.ts +8 -6
- package/lib/button/button.d.ts +11 -5
- package/lib/calendar-event/calendar-event.d.ts +333 -1
- package/lib/checkbox/checkbox.d.ts +8 -6
- package/lib/combobox/combobox.d.ts +11 -5
- package/lib/date-picker/date-picker.d.ts +74 -50
- package/lib/date-range-picker/date-range-picker.d.ts +38 -26
- package/lib/date-time-picker/date-time-picker.d.ts +76 -52
- package/lib/dial-pad/dial-pad.d.ts +11 -5
- package/lib/dialog/dialog.d.ts +16 -8
- package/lib/divider/divider.d.ts +8 -6
- package/lib/fab/fab.d.ts +11 -5
- package/lib/file-picker/file-picker.d.ts +337 -1
- package/lib/file-picker/locale.d.ts +1 -0
- package/lib/header/header.d.ts +333 -1
- package/lib/menu/menu.d.ts +16 -8
- package/lib/menu-item/menu-item.d.ts +338 -2
- package/lib/nav/nav.d.ts +333 -1
- package/lib/nav-disclosure/nav-disclosure.d.ts +16 -8
- package/lib/nav-item/nav-item.d.ts +11 -5
- package/lib/note/note.d.ts +11 -5
- package/lib/number-field/number-field.d.ts +26 -12
- package/lib/option/option.d.ts +339 -3
- package/lib/progress/progress.d.ts +8 -6
- package/lib/progress-ring/progress-ring.d.ts +8 -6
- package/lib/radio-group/radio-group.d.ts +333 -1
- package/lib/range-slider/range-slider.d.ts +11 -5
- package/lib/rich-text-editor/facades/prose-mirror-vivid.schema.d.ts +1 -1
- package/lib/rich-text-editor/facades/vivid-prose-mirror.facade.d.ts +7 -1
- package/lib/rich-text-editor/locale.d.ts +9 -0
- package/lib/rich-text-editor/menubar/consts.d.ts +18 -0
- package/lib/rich-text-editor/menubar/menubar.d.ts +337 -1
- package/lib/rich-text-editor/rich-text-editor.d.ts +10 -0
- package/lib/searchable-select/locale.d.ts +1 -0
- package/lib/searchable-select/option-tag.d.ts +11 -5
- package/lib/searchable-select/searchable-select.d.ts +350 -7
- package/lib/select/select.d.ts +339 -3
- package/lib/selectable-box/selectable-box.d.ts +8 -6
- package/lib/slider/slider.d.ts +16 -8
- package/lib/split-button/split-button.d.ts +26 -12
- package/lib/switch/switch.d.ts +8 -6
- package/lib/tab/tab.d.ts +349 -7
- package/lib/tab-panel/tab-panel.d.ts +333 -1
- package/lib/tabs/tabs.d.ts +5 -21
- package/lib/tag/tag.d.ts +338 -2
- package/lib/tag-group/tag-group.d.ts +8 -6
- package/lib/text-anchor/text-anchor.d.ts +16 -8
- package/lib/text-area/text-area.d.ts +8 -6
- package/lib/text-field/text-field.d.ts +16 -8
- package/lib/time-picker/time-picker.d.ts +38 -26
- package/lib/toggletip/toggletip.d.ts +9 -3
- package/lib/tooltip/tooltip.d.ts +9 -3
- package/lib/tree-item/tree-item.d.ts +338 -2
- package/lib/tree-view/tree-view.d.ts +333 -1
- package/lib/video-player/video-player.d.ts +11 -5
- package/locales/de-DE.cjs +15 -1
- package/locales/de-DE.js +15 -1
- package/locales/en-GB.cjs +15 -1
- package/locales/en-GB.js +15 -1
- package/locales/en-US.cjs +15 -1
- package/locales/en-US.js +15 -1
- package/locales/ja-JP.cjs +15 -1
- package/locales/ja-JP.js +15 -1
- package/locales/zh-CN.cjs +15 -1
- package/locales/zh-CN.js +15 -1
- package/package.json +1 -1
- package/shared/affix.js +1 -1
- package/shared/aria/aria-change-subscription.d.ts +6 -0
- package/shared/aria/aria-mixin.d.ts +338 -0
- package/shared/aria/delegate-aria-behavior.d.ts +31 -0
- package/shared/aria/delegates-aria.d.ts +14 -9
- package/shared/aria/host-semantics-behavior.d.ts +22 -0
- package/shared/aria/host-semantics.d.ts +337 -0
- package/shared/attribute-binding-behaviour.cjs +41 -0
- package/shared/attribute-binding-behaviour.js +39 -0
- package/shared/button.cjs +6 -3
- package/shared/button.js +6 -3
- package/shared/calendar-event.cjs +2 -1
- package/shared/calendar-event.js +2 -1
- package/shared/definition.js +1 -1
- package/shared/definition10.cjs +8 -2
- package/shared/definition10.js +9 -3
- package/shared/definition11.cjs +4 -28
- package/shared/definition11.js +5 -29
- package/shared/definition12.cjs +5 -2
- package/shared/definition12.js +6 -3
- package/shared/definition13.js +1 -1
- package/shared/definition14.js +1 -1
- package/shared/definition15.cjs +8 -7
- package/shared/definition15.js +10 -9
- package/shared/definition16.js +1 -1
- package/shared/definition17.cjs +4 -1
- package/shared/definition17.js +5 -2
- package/shared/definition18.js +1 -1
- package/shared/definition19.js +1 -1
- package/shared/definition2.js +1 -1
- package/shared/definition20.js +1 -1
- package/shared/definition21.js +1 -1
- package/shared/definition22.cjs +11 -4
- package/shared/definition22.js +13 -6
- package/shared/definition23.cjs +4 -2
- package/shared/definition23.js +6 -4
- package/shared/definition24.js +1 -1
- package/shared/definition25.cjs +2 -14
- package/shared/definition25.js +3 -15
- package/shared/definition26.cjs +19 -3
- package/shared/definition26.js +20 -4
- package/shared/definition27.cjs +3 -2
- package/shared/definition27.js +4 -3
- package/shared/definition28.js +1 -1
- package/shared/definition29.js +1 -1
- package/shared/definition3.cjs +3 -2
- package/shared/definition3.js +5 -4
- package/shared/definition30.cjs +33 -34
- package/shared/definition30.js +35 -36
- package/shared/definition31.cjs +6 -4
- package/shared/definition31.js +8 -6
- package/shared/definition32.js +1 -1
- package/shared/definition33.cjs +7 -2
- package/shared/definition33.js +8 -3
- package/shared/definition34.js +1 -1
- package/shared/definition35.cjs +2 -13
- package/shared/definition35.js +4 -15
- package/shared/definition36.cjs +8 -5
- package/shared/definition36.js +9 -6
- package/shared/definition37.js +1 -1
- package/shared/definition38.cjs +7 -8
- package/shared/definition38.js +9 -10
- package/shared/definition39.cjs +7 -8
- package/shared/definition39.js +9 -10
- package/shared/definition4.js +1 -1
- package/shared/definition40.cjs +8 -5
- package/shared/definition40.js +9 -6
- package/shared/definition41.js +1 -1
- package/shared/definition42.js +1 -1
- package/shared/definition43.cjs +558 -134
- package/shared/definition43.js +550 -126
- package/shared/definition44.cjs +83 -10
- package/shared/definition44.js +84 -11
- package/shared/definition45.cjs +20 -8
- package/shared/definition45.js +21 -9
- package/shared/definition46.cjs +18 -6
- package/shared/definition46.js +20 -8
- package/shared/definition47.js +1 -1
- package/shared/definition48.js +1 -1
- package/shared/definition49.cjs +10 -3
- package/shared/definition49.js +12 -5
- package/shared/definition5.cjs +7 -2
- package/shared/definition5.js +8 -3
- package/shared/definition50.cjs +8 -7
- package/shared/definition50.js +10 -9
- package/shared/definition51.cjs +3 -2
- package/shared/definition51.js +4 -3
- package/shared/definition52.cjs +8 -4
- package/shared/definition52.js +9 -5
- package/shared/definition53.cjs +219 -297
- package/shared/definition53.js +221 -299
- package/shared/definition54.cjs +4 -3
- package/shared/definition54.js +6 -5
- package/shared/definition55.cjs +7 -4
- package/shared/definition55.js +8 -5
- package/shared/definition56.cjs +68 -14
- package/shared/definition56.js +69 -15
- package/shared/definition57.cjs +163 -112
- package/shared/definition57.js +165 -114
- package/shared/definition58.js +1 -1
- package/shared/definition59.js +1 -1
- package/shared/definition6.js +1 -1
- package/shared/definition60.js +1 -1
- package/shared/definition61.cjs +8 -5
- package/shared/definition61.js +9 -6
- package/shared/definition62.cjs +5 -2
- package/shared/definition62.js +6 -3
- package/shared/definition63.js +1 -1
- package/shared/definition64.js +1 -1
- package/shared/definition65.js +1 -1
- package/shared/definition7.js +1 -1
- package/shared/definition8.cjs +4 -2
- package/shared/definition8.js +6 -4
- package/shared/definition9.js +1 -1
- package/shared/delegates-aria.cjs +106 -56
- package/shared/delegates-aria.js +107 -58
- package/shared/foundation/button/button.d.ts +8 -6
- package/shared/foundation/vivid-element/vivid-element.d.ts +339 -1
- package/shared/host-semantics.cjs +65 -0
- package/shared/host-semantics.js +62 -0
- package/shared/localization/Locale.d.ts +2 -0
- package/shared/option.cjs +4 -1
- package/shared/option.js +4 -1
- package/shared/patterns/affix.d.ts +22 -10
- package/shared/patterns/anchored.d.ts +18 -6
- package/shared/patterns/localized.d.ts +11 -5
- package/shared/patterns/trapped-focus.d.ts +11 -5
- package/shared/picker-field/mixins/calendar-picker.d.ts +19 -13
- package/shared/picker-field/mixins/calendar-picker.template.d.ts +19 -13
- package/shared/picker-field/mixins/inline-time-picker/inline-time-picker.d.ts +11 -5
- package/shared/picker-field/mixins/min-max-calendar-picker.d.ts +38 -26
- package/shared/picker-field/mixins/single-date-picker.d.ts +55 -37
- package/shared/picker-field/mixins/single-value-picker.d.ts +17 -11
- package/shared/picker-field/mixins/time-selection-picker.d.ts +38 -26
- package/shared/picker-field/mixins/time-selection-picker.template.d.ts +38 -26
- package/shared/picker-field/picker-field.d.ts +21 -9
- package/shared/picker-field.template.js +1 -1
- package/shared/repeat.js +1 -1
- package/shared/slider.template.cjs +10 -9
- package/shared/slider.template.js +10 -9
- package/shared/templating/attribute-binding-behaviour.d.ts +15 -0
- package/shared/templating/render-in-light-dom.d.ts +22 -0
- package/shared/text-anchor.template.cjs +2 -13
- package/shared/text-anchor.template.js +2 -13
- package/shared/time-selection-picker.template.js +1 -1
- package/shared/vivid-element.cjs +96 -2
- package/shared/vivid-element.js +93 -3
- package/styles/core/all.css +1 -1
- package/styles/core/theme.css +1 -1
- package/styles/core/typography.css +1 -1
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/styles/tokens/vivid-2-compat.css +1 -1
- package/text-anchor/index.js +1 -1
- package/vivid.api.json +188 -17
- package/shared/Reflector.cjs +0 -71
- package/shared/Reflector.js +0 -69
package/shared/definition26.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { I as Icon, i as iconDefinition } from './definition28.js';
|
|
2
2
|
import { B as Button, b as buttonDefinition } from './definition11.js';
|
|
3
|
-
import { V as VividElement, a as attr, h as html,
|
|
3
|
+
import { V as VividElement, a as attr, h as html, g as createRegisterFunction, i as defineVividComponent } from './vivid-element.js';
|
|
4
|
+
import { D as DelegatesAria, d as delegateAria } from './delegates-aria.js';
|
|
4
5
|
import { a as applyMixinsWithObservables } from './applyMixinsWithObservables.js';
|
|
5
6
|
import { F as FormAssociated } from './form-associated.js';
|
|
6
7
|
import { L as Localized } from './localized.js';
|
|
@@ -2164,7 +2165,7 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
|
|
|
2164
2165
|
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
2165
2166
|
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value);
|
|
2166
2167
|
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
2167
|
-
var _dropzone, _FilePicker_instances, syncSingleFileState_fn, _localizeErrorMessage, _localizeFileSizeNumberAndUnits, addRemoveButtonToFilesPreview_fn, chooseFile_fn, updateHiddenFileInput_fn, keepOnlyNewestFile_fn, handleFilesChanged_fn, updateFormValue_fn, setValueToAFakePathLikeNativeInput_fn, formatNumbersInMessage_fn;
|
|
2168
|
+
var _dropzone, _FilePicker_instances, syncSingleFileState_fn, _localizeErrorMessage, _localizeFileSizeNumberAndUnits, addRemoveButtonToFilesPreview_fn, chooseFile_fn, updateHiddenFileInput_fn, keepOnlyNewestFile_fn, handleFilesChanged_fn, updateFormValue_fn, setValueToAFakePathLikeNativeInput_fn, getCustomValidationError_fn, formatNumbersInMessage_fn;
|
|
2168
2169
|
const isFormAssociatedTryingToSetFormValueToFakePath = (value) => typeof value === "string";
|
|
2169
2170
|
const generateFilePreviewTemplate = (buttonTag, iconTag, locale) => {
|
|
2170
2171
|
return `<div class="dz-preview dz-file-preview">
|
|
@@ -2179,7 +2180,9 @@ const generateFilePreviewTemplate = (buttonTag, iconTag, locale) => {
|
|
|
2179
2180
|
<${buttonTag} class="remove-btn" icon="delete-line" appearance="ghost-light" size="condensed" aria-label="${locale.filePicker.removeFileLabel}"></${buttonTag}>
|
|
2180
2181
|
</div>`;
|
|
2181
2182
|
};
|
|
2182
|
-
let FilePicker = class extends
|
|
2183
|
+
let FilePicker = class extends DelegatesAria(
|
|
2184
|
+
Localized(FormAssociatedFilePicker)
|
|
2185
|
+
) {
|
|
2183
2186
|
constructor() {
|
|
2184
2187
|
super();
|
|
2185
2188
|
__privateAdd(this, _FilePicker_instances);
|
|
@@ -2345,7 +2348,11 @@ let FilePicker = class extends Localized(FormAssociatedFilePicker) {
|
|
|
2345
2348
|
}
|
|
2346
2349
|
return true;
|
|
2347
2350
|
}
|
|
2351
|
+
/** {@inheritDoc (FormAssociated:interface).validate} */
|
|
2348
2352
|
validate() {
|
|
2353
|
+
if (this.proxy) {
|
|
2354
|
+
this.proxy.setCustomValidity(__privateMethod(this, _FilePicker_instances, getCustomValidationError_fn).call(this) ?? "");
|
|
2355
|
+
}
|
|
2349
2356
|
super.validate(this.control);
|
|
2350
2357
|
}
|
|
2351
2358
|
formResetCallback() {
|
|
@@ -2408,6 +2415,7 @@ handleFilesChanged_fn = function() {
|
|
|
2408
2415
|
}
|
|
2409
2416
|
this.$emit("change");
|
|
2410
2417
|
__privateMethod(this, _FilePicker_instances, updateFormValue_fn).call(this);
|
|
2418
|
+
this.validate();
|
|
2411
2419
|
requestAnimationFrame(() => __privateMethod(this, _FilePicker_instances, syncSingleFileState_fn).call(this));
|
|
2412
2420
|
};
|
|
2413
2421
|
updateFormValue_fn = function() {
|
|
@@ -2426,6 +2434,12 @@ updateFormValue_fn = function() {
|
|
|
2426
2434
|
setValueToAFakePathLikeNativeInput_fn = function() {
|
|
2427
2435
|
this.value = this.files.length > 0 ? `C:\\fakepath\\${this.files[0].name}` : "";
|
|
2428
2436
|
};
|
|
2437
|
+
getCustomValidationError_fn = function() {
|
|
2438
|
+
if (this.rejectedFiles.length > 0) {
|
|
2439
|
+
return this.locale.filePicker.invalidFilesError;
|
|
2440
|
+
}
|
|
2441
|
+
return null;
|
|
2442
|
+
};
|
|
2429
2443
|
formatNumbersInMessage_fn = function(message) {
|
|
2430
2444
|
if (this.locale.common.useCommaAsDecimalSeparator) {
|
|
2431
2445
|
return message.replace(/(\d+)\.(\d+)/g, "$1,$2");
|
|
@@ -2481,8 +2495,10 @@ const FilePickerTemplate = (context) => {
|
|
|
2481
2495
|
${ref("control")}
|
|
2482
2496
|
class="${getClasses}"
|
|
2483
2497
|
tabindex="0"
|
|
2484
|
-
role="button"
|
|
2485
2498
|
@keydown="${(x, c) => x.handleKeydown(c.event)}"
|
|
2499
|
+
${delegateAria({
|
|
2500
|
+
role: "button"
|
|
2501
|
+
})}
|
|
2486
2502
|
>
|
|
2487
2503
|
<slot class="main"></slot>
|
|
2488
2504
|
</div>
|
package/shared/definition27.cjs
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const definition = require('./definition64.cjs');
|
|
4
4
|
const vividElement = require('./vivid-element.cjs');
|
|
5
|
+
const delegatesAria = require('./delegates-aria.cjs');
|
|
5
6
|
const classNames = require('./class-names.cjs');
|
|
6
7
|
|
|
7
8
|
const styles = ".base{z-index:1;block-size:calc(1px*(40 + 4*clamp(-1,var(--vvd-size-density, 0),2)) + 1px*(24 + 4*clamp(-1,var(--vvd-size-density, 0),2)));font:var(--vvd-typography-heading-4);inline-size:100%}.base .header-content{display:inline-flex;align-items:center;column-gap:4px}.container{display:flex;box-sizing:border-box;justify-content:space-between;background-color:var(--header-bg-color, var(--vvd-color-canvas));block-size:inherit;color:var(--vvd-color-canvas-text);column-gap:12px;padding-block:8px;padding-inline:16px}.container[part~=vvd-theme-alternate]{color-scheme:var(--vvd-color-scheme)}.app-content{--vvd-header-block-size: calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2)) + 1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }";
|
|
@@ -15,7 +16,7 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
15
16
|
if (result) __defProp(target, key, result);
|
|
16
17
|
return result;
|
|
17
18
|
};
|
|
18
|
-
class Header extends vividElement.VividElement {
|
|
19
|
+
class Header extends delegatesAria.DelegatesAria(vividElement.VividElement) {
|
|
19
20
|
constructor() {
|
|
20
21
|
super(...arguments);
|
|
21
22
|
this.elevationShadow = false;
|
|
@@ -39,7 +40,7 @@ const headerTemplate = (context) => {
|
|
|
39
40
|
const elevationTag = context.tagFor(definition.Elevation);
|
|
40
41
|
return vividElement.html`
|
|
41
42
|
<${elevationTag} dp="4" ?no-shadow=${(x) => !x.elevationShadow}>
|
|
42
|
-
<header class="base" part="base">
|
|
43
|
+
<header class="base" part="base" ${delegatesAria.delegateAria()}>
|
|
43
44
|
<!-- a container is needed to distinguish the surface background color of the
|
|
44
45
|
element from its shadow when applying elevation with alternate -->
|
|
45
46
|
<div class="container" part="${getPartAlternate}">
|
package/shared/definition27.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { E as Elevation, e as elevationDefinition } from './definition64.js';
|
|
2
|
-
import { V as VividElement, a as attr, h as html,
|
|
2
|
+
import { V as VividElement, a as attr, h as html, g as createRegisterFunction, i as defineVividComponent } from './vivid-element.js';
|
|
3
|
+
import { D as DelegatesAria, d as delegateAria } from './delegates-aria.js';
|
|
3
4
|
import { c as classNames } from './class-names.js';
|
|
4
5
|
|
|
5
6
|
const styles = ".base{z-index:1;block-size:calc(1px*(40 + 4*clamp(-1,var(--vvd-size-density, 0),2)) + 1px*(24 + 4*clamp(-1,var(--vvd-size-density, 0),2)));font:var(--vvd-typography-heading-4);inline-size:100%}.base .header-content{display:inline-flex;align-items:center;column-gap:4px}.container{display:flex;box-sizing:border-box;justify-content:space-between;background-color:var(--header-bg-color, var(--vvd-color-canvas));block-size:inherit;color:var(--vvd-color-canvas-text);column-gap:12px;padding-block:8px;padding-inline:16px}.container[part~=vvd-theme-alternate]{color-scheme:var(--vvd-color-scheme)}.app-content{--vvd-header-block-size: calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2)) + 1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }";
|
|
@@ -13,7 +14,7 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
13
14
|
if (result) __defProp(target, key, result);
|
|
14
15
|
return result;
|
|
15
16
|
};
|
|
16
|
-
class Header extends VividElement {
|
|
17
|
+
class Header extends DelegatesAria(VividElement) {
|
|
17
18
|
constructor() {
|
|
18
19
|
super(...arguments);
|
|
19
20
|
this.elevationShadow = false;
|
|
@@ -37,7 +38,7 @@ const headerTemplate = (context) => {
|
|
|
37
38
|
const elevationTag = context.tagFor(Elevation);
|
|
38
39
|
return html`
|
|
39
40
|
<${elevationTag} dp="4" ?no-shadow=${(x) => !x.elevationShadow}>
|
|
40
|
-
<header class="base" part="base">
|
|
41
|
+
<header class="base" part="base" ${delegateAria()}>
|
|
41
42
|
<!-- a container is needed to distinguish the surface background color of the
|
|
42
43
|
element from its shadow when applying elevation with alternate -->
|
|
43
44
|
<div class="container" part="${getPartAlternate}">
|
package/shared/definition28.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { V as VividElement, a as attr, o as observable, v as volatile, h as html,
|
|
1
|
+
import { V as VividElement, a as attr, o as observable, v as volatile, h as html, g as createRegisterFunction, i as defineVividComponent } from './vivid-element.js';
|
|
2
2
|
import { _ as _curry1, a as _curry2, b as _has } from './_has.js';
|
|
3
3
|
import { c as classNames } from './class-names.js';
|
|
4
4
|
import { w as when } from './when.js';
|
package/shared/definition29.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { V as VividElement, a as attr, h as html,
|
|
1
|
+
import { V as VividElement, a as attr, h as html, g as createRegisterFunction, i as defineVividComponent } from './vivid-element.js';
|
|
2
2
|
import { c as classNames } from './class-names.js';
|
|
3
3
|
|
|
4
4
|
var __defProp = Object.defineProperty;
|
package/shared/definition3.cjs
CHANGED
|
@@ -41,8 +41,9 @@ const getClasses = ({ appearance, shape, tight }) => classNames.classNames(
|
|
|
41
41
|
);
|
|
42
42
|
const ActionGroupTemplate = vividElement.html`<div
|
|
43
43
|
class="${getClasses}"
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
${delegatesAria.delegateAria({
|
|
45
|
+
role: (x) => x.role ? x.role : "group"
|
|
46
|
+
})}
|
|
46
47
|
>
|
|
47
48
|
<slot></slot>
|
|
48
49
|
</div>`;
|
package/shared/definition3.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { V as VividElement, a as attr, h as html,
|
|
2
|
-
import { D as DelegatesAria } from './delegates-aria.js';
|
|
1
|
+
import { V as VividElement, a as attr, h as html, g as createRegisterFunction, i as defineVividComponent } from './vivid-element.js';
|
|
2
|
+
import { D as DelegatesAria, d as delegateAria } from './delegates-aria.js';
|
|
3
3
|
import { c as classNames } from './class-names.js';
|
|
4
4
|
|
|
5
5
|
const styles = ":host{display:inline-block}.base{--_connotation-color-primary: var(--vvd-action-group-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-intermediate: var(--vvd-action-group-accent-intermediate, var(--vvd-color-neutral-500));--_connotation-color-faint: var(--vvd-action-group-accent-faint, var(--vvd-color-neutral-50))}.base{--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--vvd-color-neutral-500)}.base.appearance-ghost{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.base{position:relative;display:flex;box-sizing:border-box;align-items:center;background-color:var(--_appearance-color-fill);inline-size:inherit;vertical-align:middle}.base:before{position:absolute;z-index:1;border-radius:inherit;box-shadow:inset 0 0 0 1px var(--_appearance-color-outline);content:\"\";inset:0;pointer-events:none}.base:not(.tight){padding:4px;column-gap:4px}.base:not(.shape-pill){border-radius:8px}.base.shape-pill{border-radius:24px}::slotted([role=separator]){align-self:stretch;margin-block:4px}";
|
|
@@ -39,8 +39,9 @@ const getClasses = ({ appearance, shape, tight }) => classNames(
|
|
|
39
39
|
);
|
|
40
40
|
const ActionGroupTemplate = html`<div
|
|
41
41
|
class="${getClasses}"
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
${delegateAria({
|
|
43
|
+
role: (x) => x.role ? x.role : "group"
|
|
44
|
+
})}
|
|
44
45
|
>
|
|
45
46
|
<slot></slot>
|
|
46
47
|
</div>`;
|
package/shared/definition30.cjs
CHANGED
|
@@ -6,6 +6,7 @@ const vividElement = require('./vivid-element.cjs');
|
|
|
6
6
|
const keyCodes = require('./key-codes.cjs');
|
|
7
7
|
const affix = require('./affix.cjs');
|
|
8
8
|
const direction = require('./direction.cjs');
|
|
9
|
+
const hostSemantics = require('./host-semantics.cjs');
|
|
9
10
|
const anchored = require('./anchored.cjs');
|
|
10
11
|
const delegatesAria = require('./delegates-aria.cjs');
|
|
11
12
|
const dom = require('./dom.cjs');
|
|
@@ -94,12 +95,11 @@ const _Menu = class _Menu extends anchored.Anchored(delegatesAria.DelegatesAria(
|
|
|
94
95
|
this.setItems = () => {
|
|
95
96
|
const newItems = this.domChildren();
|
|
96
97
|
this.removeItemListeners();
|
|
97
|
-
this.menuItems = newItems;
|
|
98
|
-
|
|
99
|
-
if (menuItems.length) {
|
|
98
|
+
this.menuItems = newItems.filter(this.isMenuItemElement);
|
|
99
|
+
if (this.menuItems.length) {
|
|
100
100
|
this.focusIndex = 0;
|
|
101
101
|
}
|
|
102
|
-
menuItems.forEach((item, index) => {
|
|
102
|
+
this.menuItems.forEach((item, index) => {
|
|
103
103
|
item.setAttribute("tabindex", index === 0 ? "0" : "-1");
|
|
104
104
|
item.addEventListener("expanded-change", this.handleExpandedChanged);
|
|
105
105
|
item.addEventListener("focus", this.handleItemFocus);
|
|
@@ -183,7 +183,7 @@ const _Menu = class _Menu extends anchored.Anchored(delegatesAria.DelegatesAria(
|
|
|
183
183
|
if (autoFocusElement instanceof HTMLElement) {
|
|
184
184
|
autoFocusElement.focus();
|
|
185
185
|
} else {
|
|
186
|
-
this.setFocus(0
|
|
186
|
+
this.setFocus(0);
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
/**
|
|
@@ -206,16 +206,16 @@ const _Menu = class _Menu extends anchored.Anchored(delegatesAria.DelegatesAria(
|
|
|
206
206
|
}
|
|
207
207
|
switch (e.key) {
|
|
208
208
|
case keyCodes.keyArrowDown:
|
|
209
|
-
this.setFocus(this.focusIndex + 1
|
|
209
|
+
this.setFocus(this.focusIndex + 1);
|
|
210
210
|
return;
|
|
211
211
|
case keyCodes.keyArrowUp:
|
|
212
|
-
this.setFocus(this.focusIndex - 1
|
|
212
|
+
this.setFocus(this.focusIndex - 1);
|
|
213
213
|
return;
|
|
214
214
|
case keyCodes.keyEnd:
|
|
215
|
-
this.setFocus(this.menuItems.length - 1
|
|
215
|
+
this.setFocus(this.menuItems.length - 1);
|
|
216
216
|
return;
|
|
217
217
|
case keyCodes.keyHome:
|
|
218
|
-
this.setFocus(0
|
|
218
|
+
this.setFocus(0);
|
|
219
219
|
return;
|
|
220
220
|
default:
|
|
221
221
|
return true;
|
|
@@ -227,22 +227,18 @@ const _Menu = class _Menu extends anchored.Anchored(delegatesAria.DelegatesAria(
|
|
|
227
227
|
domChildren() {
|
|
228
228
|
return Array.from(this.children).filter((child) => !child.hasAttribute("hidden")).filter((child) => !child.hasAttribute("slot"));
|
|
229
229
|
}
|
|
230
|
-
setFocus(focusIndex
|
|
230
|
+
setFocus(focusIndex) {
|
|
231
231
|
if (this.menuItems === void 0) {
|
|
232
232
|
return;
|
|
233
233
|
}
|
|
234
|
-
|
|
234
|
+
if (focusIndex >= 0 && focusIndex < this.menuItems.length) {
|
|
235
235
|
const child = this.menuItems[focusIndex];
|
|
236
|
-
if (this.
|
|
237
|
-
|
|
238
|
-
this.menuItems[this.focusIndex].setAttribute("tabindex", "-1");
|
|
239
|
-
}
|
|
240
|
-
this.focusIndex = focusIndex;
|
|
241
|
-
child.setAttribute("tabindex", "0");
|
|
242
|
-
child.focus();
|
|
243
|
-
break;
|
|
236
|
+
if (this.focusIndex > -1 && this.menuItems.length >= this.focusIndex - 1) {
|
|
237
|
+
this.menuItems[this.focusIndex].setAttribute("tabindex", "-1");
|
|
244
238
|
}
|
|
245
|
-
focusIndex
|
|
239
|
+
this.focusIndex = focusIndex;
|
|
240
|
+
child.setAttribute("tabindex", "0");
|
|
241
|
+
child.focus();
|
|
246
242
|
}
|
|
247
243
|
}
|
|
248
244
|
get #triggerBehaviour() {
|
|
@@ -291,14 +287,15 @@ const _Menu = class _Menu extends anchored.Anchored(delegatesAria.DelegatesAria(
|
|
|
291
287
|
if (this.#triggerBehaviour === "auto" && clickedOnNonCheckboxMenuItem) {
|
|
292
288
|
this.open = false;
|
|
293
289
|
}
|
|
290
|
+
const domChildren = this.domChildren();
|
|
294
291
|
const changedMenuItem = e.target;
|
|
295
|
-
const changeItemIndex =
|
|
292
|
+
const changeItemIndex = domChildren.indexOf(changedMenuItem);
|
|
296
293
|
if (changeItemIndex === -1) {
|
|
297
294
|
return;
|
|
298
295
|
}
|
|
299
296
|
if (changedMenuItem.role === "menuitemradio" && changedMenuItem.checked) {
|
|
300
297
|
for (let i = changeItemIndex - 1; i >= 0; --i) {
|
|
301
|
-
const item =
|
|
298
|
+
const item = domChildren[i];
|
|
302
299
|
const role = item.getAttribute("role");
|
|
303
300
|
if (role === MenuItemRole.menuitemradio) {
|
|
304
301
|
item.checked = false;
|
|
@@ -307,9 +304,9 @@ const _Menu = class _Menu extends anchored.Anchored(delegatesAria.DelegatesAria(
|
|
|
307
304
|
break;
|
|
308
305
|
}
|
|
309
306
|
}
|
|
310
|
-
const maxIndex =
|
|
307
|
+
const maxIndex = domChildren.length - 1;
|
|
311
308
|
for (let i = changeItemIndex + 1; i <= maxIndex; ++i) {
|
|
312
|
-
const item =
|
|
309
|
+
const item = domChildren[i];
|
|
313
310
|
const role = item.getAttribute("role");
|
|
314
311
|
if (role === MenuItemRole.menuitemradio) {
|
|
315
312
|
item.checked = false;
|
|
@@ -357,7 +354,7 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
357
354
|
if (result) __defProp(target, key, result);
|
|
358
355
|
return result;
|
|
359
356
|
};
|
|
360
|
-
class MenuItem extends affix.AffixIcon(vividElement.VividElement) {
|
|
357
|
+
class MenuItem extends hostSemantics.HostSemantics(affix.AffixIcon(vividElement.VividElement)) {
|
|
361
358
|
constructor() {
|
|
362
359
|
super();
|
|
363
360
|
// eslint-disable-next-line @nrwl/nx/workspace/no-attribute-default-value
|
|
@@ -653,11 +650,13 @@ const MenuItemTemplate = (context) => {
|
|
|
653
650
|
const iconTag = context.tagFor(definition.Icon);
|
|
654
651
|
return vividElement.html`
|
|
655
652
|
<template
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
653
|
+
${hostSemantics.applyHostSemantics({
|
|
654
|
+
role: MenuItemRole.menuitem,
|
|
655
|
+
ariaHasPopup: (x) => x.hasSubmenu ? "menu" : void 0,
|
|
656
|
+
ariaChecked: (x) => x.role !== MenuItemRole.menuitem ? x.checked : void 0,
|
|
657
|
+
ariaDisabled: (x) => x.disabled,
|
|
658
|
+
ariaExpanded: (x) => x.expanded
|
|
659
|
+
})}
|
|
661
660
|
@keydown="${(x, c) => x.handleMenuItemKeyDown(c.event)}"
|
|
662
661
|
@click="${handleClick}"
|
|
663
662
|
@mouseover="${(x, c) => x.handleMouseOver(c.event)}"
|
|
@@ -730,8 +729,7 @@ const MenuTemplate = (context) => {
|
|
|
730
729
|
x.open = state;
|
|
731
730
|
}
|
|
732
731
|
return vividElement.html`
|
|
733
|
-
<template
|
|
734
|
-
@change="${(x, c) => x._onChange(c.event)}"
|
|
732
|
+
<template @change="${(x, c) => x._onChange(c.event)}"
|
|
735
733
|
@focusout="${(x, c) => x._onFocusout(c.event)}">
|
|
736
734
|
${anchorSlotTemplate}
|
|
737
735
|
<${popupTag}
|
|
@@ -750,8 +748,9 @@ const MenuTemplate = (context) => {
|
|
|
750
748
|
</div>
|
|
751
749
|
<div
|
|
752
750
|
class="body"
|
|
753
|
-
|
|
754
|
-
|
|
751
|
+
${delegatesAria.delegateAria({
|
|
752
|
+
role: "menu"
|
|
753
|
+
})}
|
|
755
754
|
@keydown="${(x, c) => x.handleMenuKeyDown(c.event)}"
|
|
756
755
|
@focusout="${(x, c) => x.handleFocusOut(c.event)}"
|
|
757
756
|
>
|
package/shared/definition30.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { P as Popup, p as popupDefinition } from './definition65.js';
|
|
2
2
|
import { I as Icon, i as iconDefinition } from './definition28.js';
|
|
3
|
-
import { D as DOM, V as VividElement, o as observable, a as attr, h as html,
|
|
3
|
+
import { D as DOM, V as VividElement, o as observable, a as attr, h as html, g as createRegisterFunction, i as defineVividComponent } from './vivid-element.js';
|
|
4
4
|
import { g as keyHome, d as keyEnd, e as keyArrowUp, f as keyArrowDown, h as keyArrowLeft, i as keyArrowRight, a as keySpace, k as keyEnter } from './key-codes.js';
|
|
5
5
|
import { b as AffixIcon, a as affixIconTemplateFactory } from './affix.js';
|
|
6
6
|
import { D as Direction, g as getDirection } from './direction.js';
|
|
7
|
+
import { H as HostSemantics, a as applyHostSemantics } from './host-semantics.js';
|
|
7
8
|
import { A as Anchored, a as anchorSlotTemplateFactory } from './anchored.js';
|
|
8
|
-
import { D as DelegatesAria } from './delegates-aria.js';
|
|
9
|
+
import { D as DelegatesAria, d as delegateAria } from './delegates-aria.js';
|
|
9
10
|
import { i as isHTMLElement } from './dom.js';
|
|
10
11
|
import { h as handleEscapeKeyAndStopPropogation } from './index.js';
|
|
11
12
|
import { r as ref } from './ref.js';
|
|
@@ -92,12 +93,11 @@ const _Menu = class _Menu extends Anchored(DelegatesAria(VividElement)) {
|
|
|
92
93
|
this.setItems = () => {
|
|
93
94
|
const newItems = this.domChildren();
|
|
94
95
|
this.removeItemListeners();
|
|
95
|
-
this.menuItems = newItems;
|
|
96
|
-
|
|
97
|
-
if (menuItems.length) {
|
|
96
|
+
this.menuItems = newItems.filter(this.isMenuItemElement);
|
|
97
|
+
if (this.menuItems.length) {
|
|
98
98
|
this.focusIndex = 0;
|
|
99
99
|
}
|
|
100
|
-
menuItems.forEach((item, index) => {
|
|
100
|
+
this.menuItems.forEach((item, index) => {
|
|
101
101
|
item.setAttribute("tabindex", index === 0 ? "0" : "-1");
|
|
102
102
|
item.addEventListener("expanded-change", this.handleExpandedChanged);
|
|
103
103
|
item.addEventListener("focus", this.handleItemFocus);
|
|
@@ -181,7 +181,7 @@ const _Menu = class _Menu extends Anchored(DelegatesAria(VividElement)) {
|
|
|
181
181
|
if (autoFocusElement instanceof HTMLElement) {
|
|
182
182
|
autoFocusElement.focus();
|
|
183
183
|
} else {
|
|
184
|
-
this.setFocus(0
|
|
184
|
+
this.setFocus(0);
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
187
|
/**
|
|
@@ -204,16 +204,16 @@ const _Menu = class _Menu extends Anchored(DelegatesAria(VividElement)) {
|
|
|
204
204
|
}
|
|
205
205
|
switch (e.key) {
|
|
206
206
|
case keyArrowDown:
|
|
207
|
-
this.setFocus(this.focusIndex + 1
|
|
207
|
+
this.setFocus(this.focusIndex + 1);
|
|
208
208
|
return;
|
|
209
209
|
case keyArrowUp:
|
|
210
|
-
this.setFocus(this.focusIndex - 1
|
|
210
|
+
this.setFocus(this.focusIndex - 1);
|
|
211
211
|
return;
|
|
212
212
|
case keyEnd:
|
|
213
|
-
this.setFocus(this.menuItems.length - 1
|
|
213
|
+
this.setFocus(this.menuItems.length - 1);
|
|
214
214
|
return;
|
|
215
215
|
case keyHome:
|
|
216
|
-
this.setFocus(0
|
|
216
|
+
this.setFocus(0);
|
|
217
217
|
return;
|
|
218
218
|
default:
|
|
219
219
|
return true;
|
|
@@ -225,22 +225,18 @@ const _Menu = class _Menu extends Anchored(DelegatesAria(VividElement)) {
|
|
|
225
225
|
domChildren() {
|
|
226
226
|
return Array.from(this.children).filter((child) => !child.hasAttribute("hidden")).filter((child) => !child.hasAttribute("slot"));
|
|
227
227
|
}
|
|
228
|
-
setFocus(focusIndex
|
|
228
|
+
setFocus(focusIndex) {
|
|
229
229
|
if (this.menuItems === void 0) {
|
|
230
230
|
return;
|
|
231
231
|
}
|
|
232
|
-
|
|
232
|
+
if (focusIndex >= 0 && focusIndex < this.menuItems.length) {
|
|
233
233
|
const child = this.menuItems[focusIndex];
|
|
234
|
-
if (this.
|
|
235
|
-
|
|
236
|
-
this.menuItems[this.focusIndex].setAttribute("tabindex", "-1");
|
|
237
|
-
}
|
|
238
|
-
this.focusIndex = focusIndex;
|
|
239
|
-
child.setAttribute("tabindex", "0");
|
|
240
|
-
child.focus();
|
|
241
|
-
break;
|
|
234
|
+
if (this.focusIndex > -1 && this.menuItems.length >= this.focusIndex - 1) {
|
|
235
|
+
this.menuItems[this.focusIndex].setAttribute("tabindex", "-1");
|
|
242
236
|
}
|
|
243
|
-
focusIndex
|
|
237
|
+
this.focusIndex = focusIndex;
|
|
238
|
+
child.setAttribute("tabindex", "0");
|
|
239
|
+
child.focus();
|
|
244
240
|
}
|
|
245
241
|
}
|
|
246
242
|
get #triggerBehaviour() {
|
|
@@ -289,14 +285,15 @@ const _Menu = class _Menu extends Anchored(DelegatesAria(VividElement)) {
|
|
|
289
285
|
if (this.#triggerBehaviour === "auto" && clickedOnNonCheckboxMenuItem) {
|
|
290
286
|
this.open = false;
|
|
291
287
|
}
|
|
288
|
+
const domChildren = this.domChildren();
|
|
292
289
|
const changedMenuItem = e.target;
|
|
293
|
-
const changeItemIndex =
|
|
290
|
+
const changeItemIndex = domChildren.indexOf(changedMenuItem);
|
|
294
291
|
if (changeItemIndex === -1) {
|
|
295
292
|
return;
|
|
296
293
|
}
|
|
297
294
|
if (changedMenuItem.role === "menuitemradio" && changedMenuItem.checked) {
|
|
298
295
|
for (let i = changeItemIndex - 1; i >= 0; --i) {
|
|
299
|
-
const item =
|
|
296
|
+
const item = domChildren[i];
|
|
300
297
|
const role = item.getAttribute("role");
|
|
301
298
|
if (role === MenuItemRole.menuitemradio) {
|
|
302
299
|
item.checked = false;
|
|
@@ -305,9 +302,9 @@ const _Menu = class _Menu extends Anchored(DelegatesAria(VividElement)) {
|
|
|
305
302
|
break;
|
|
306
303
|
}
|
|
307
304
|
}
|
|
308
|
-
const maxIndex =
|
|
305
|
+
const maxIndex = domChildren.length - 1;
|
|
309
306
|
for (let i = changeItemIndex + 1; i <= maxIndex; ++i) {
|
|
310
|
-
const item =
|
|
307
|
+
const item = domChildren[i];
|
|
311
308
|
const role = item.getAttribute("role");
|
|
312
309
|
if (role === MenuItemRole.menuitemradio) {
|
|
313
310
|
item.checked = false;
|
|
@@ -355,7 +352,7 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
355
352
|
if (result) __defProp(target, key, result);
|
|
356
353
|
return result;
|
|
357
354
|
};
|
|
358
|
-
class MenuItem extends AffixIcon(VividElement) {
|
|
355
|
+
class MenuItem extends HostSemantics(AffixIcon(VividElement)) {
|
|
359
356
|
constructor() {
|
|
360
357
|
super();
|
|
361
358
|
// eslint-disable-next-line @nrwl/nx/workspace/no-attribute-default-value
|
|
@@ -651,11 +648,13 @@ const MenuItemTemplate = (context) => {
|
|
|
651
648
|
const iconTag = context.tagFor(Icon);
|
|
652
649
|
return html`
|
|
653
650
|
<template
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
651
|
+
${applyHostSemantics({
|
|
652
|
+
role: MenuItemRole.menuitem,
|
|
653
|
+
ariaHasPopup: (x) => x.hasSubmenu ? "menu" : void 0,
|
|
654
|
+
ariaChecked: (x) => x.role !== MenuItemRole.menuitem ? x.checked : void 0,
|
|
655
|
+
ariaDisabled: (x) => x.disabled,
|
|
656
|
+
ariaExpanded: (x) => x.expanded
|
|
657
|
+
})}
|
|
659
658
|
@keydown="${(x, c) => x.handleMenuItemKeyDown(c.event)}"
|
|
660
659
|
@click="${handleClick}"
|
|
661
660
|
@mouseover="${(x, c) => x.handleMouseOver(c.event)}"
|
|
@@ -728,8 +727,7 @@ const MenuTemplate = (context) => {
|
|
|
728
727
|
x.open = state;
|
|
729
728
|
}
|
|
730
729
|
return html`
|
|
731
|
-
<template
|
|
732
|
-
@change="${(x, c) => x._onChange(c.event)}"
|
|
730
|
+
<template @change="${(x, c) => x._onChange(c.event)}"
|
|
733
731
|
@focusout="${(x, c) => x._onFocusout(c.event)}">
|
|
734
732
|
${anchorSlotTemplate}
|
|
735
733
|
<${popupTag}
|
|
@@ -748,8 +746,9 @@ const MenuTemplate = (context) => {
|
|
|
748
746
|
</div>
|
|
749
747
|
<div
|
|
750
748
|
class="body"
|
|
751
|
-
|
|
752
|
-
|
|
749
|
+
${delegateAria({
|
|
750
|
+
role: "menu"
|
|
751
|
+
})}
|
|
753
752
|
@keydown="${(x, c) => x.handleMenuKeyDown(c.event)}"
|
|
754
753
|
@focusout="${(x, c) => x.handleFocusOut(c.event)}"
|
|
755
754
|
>
|
package/shared/definition31.cjs
CHANGED
|
@@ -70,11 +70,13 @@ const NavDisclosureTemplate = (context) => {
|
|
|
70
70
|
const iconTag = context.tagFor(definition.Icon);
|
|
71
71
|
return vividElement.html`<details class="base" ${ref.ref("details")} ?open=${(x) => x.open}>
|
|
72
72
|
<summary class="${getClasses}"
|
|
73
|
-
role="button"
|
|
74
73
|
aria-controls="disclosure-content"
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
${delegatesAria.delegateAria({
|
|
75
|
+
role: "button",
|
|
76
|
+
ariaExpanded: (x) => x.open,
|
|
77
|
+
ariaCurrent: (x) => getAriaCurrent(x.ariaCurrent, x.open)
|
|
78
|
+
})}
|
|
79
|
+
>
|
|
78
80
|
${(x) => affixIconTemplate(x.icon, affix.IconWrapper.Slot)}
|
|
79
81
|
${(x) => x.label}
|
|
80
82
|
<slot name="meta"></slot>
|
package/shared/definition31.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { I as Icon, i as iconDefinition } from './definition28.js';
|
|
2
|
-
import { V as VividElement, a as attr, h as html,
|
|
2
|
+
import { V as VividElement, a as attr, h as html, g as createRegisterFunction, i as defineVividComponent } from './vivid-element.js';
|
|
3
3
|
import { b as AffixIcon, a as affixIconTemplateFactory, I as IconWrapper } from './affix.js';
|
|
4
|
-
import { D as DelegatesAria } from './delegates-aria.js';
|
|
4
|
+
import { D as DelegatesAria, d as delegateAria } from './delegates-aria.js';
|
|
5
5
|
import { r as ref } from './ref.js';
|
|
6
6
|
import { c as classNames } from './class-names.js';
|
|
7
7
|
|
|
@@ -68,11 +68,13 @@ const NavDisclosureTemplate = (context) => {
|
|
|
68
68
|
const iconTag = context.tagFor(Icon);
|
|
69
69
|
return html`<details class="base" ${ref("details")} ?open=${(x) => x.open}>
|
|
70
70
|
<summary class="${getClasses}"
|
|
71
|
-
role="button"
|
|
72
71
|
aria-controls="disclosure-content"
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
72
|
+
${delegateAria({
|
|
73
|
+
role: "button",
|
|
74
|
+
ariaExpanded: (x) => x.open,
|
|
75
|
+
ariaCurrent: (x) => getAriaCurrent(x.ariaCurrent, x.open)
|
|
76
|
+
})}
|
|
77
|
+
>
|
|
76
78
|
${(x) => affixIconTemplate(x.icon, IconWrapper.Slot)}
|
|
77
79
|
${(x) => x.label}
|
|
78
80
|
<slot name="meta"></slot>
|
package/shared/definition32.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as iconDefinition } from './definition28.js';
|
|
2
|
-
import { h as html,
|
|
2
|
+
import { h as html, g as createRegisterFunction, i as defineVividComponent } from './vivid-element.js';
|
|
3
3
|
import { b as AffixIcon } from './affix.js';
|
|
4
4
|
import { T as TextAnchor } from './text-anchor.js';
|
|
5
5
|
import { t as textAnchorTemplate } from './text-anchor.template.js';
|
package/shared/definition33.cjs
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const vividElement = require('./vivid-element.cjs');
|
|
4
|
+
const delegatesAria = require('./delegates-aria.cjs');
|
|
4
5
|
|
|
5
6
|
const styles = "nav{display:flex;flex-direction:column;gap:4px}";
|
|
6
7
|
|
|
7
|
-
class Nav extends vividElement.VividElement {
|
|
8
|
+
class Nav extends delegatesAria.DelegatesAria(vividElement.VividElement) {
|
|
8
9
|
}
|
|
9
10
|
|
|
10
|
-
const NavTemplate = vividElement.html`
|
|
11
|
+
const NavTemplate = vividElement.html`
|
|
12
|
+
<nav ${delegatesAria.delegateAria()}>
|
|
13
|
+
<slot></slot>
|
|
14
|
+
</nav>
|
|
15
|
+
`;
|
|
11
16
|
|
|
12
17
|
const navDefinition = vividElement.defineVividComponent("nav", Nav, NavTemplate, [], {
|
|
13
18
|
styles
|
package/shared/definition33.js
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import { V as VividElement, h as html,
|
|
1
|
+
import { V as VividElement, h as html, g as createRegisterFunction, i as defineVividComponent } from './vivid-element.js';
|
|
2
|
+
import { D as DelegatesAria, d as delegateAria } from './delegates-aria.js';
|
|
2
3
|
|
|
3
4
|
const styles = "nav{display:flex;flex-direction:column;gap:4px}";
|
|
4
5
|
|
|
5
|
-
class Nav extends VividElement {
|
|
6
|
+
class Nav extends DelegatesAria(VividElement) {
|
|
6
7
|
}
|
|
7
8
|
|
|
8
|
-
const NavTemplate = html`
|
|
9
|
+
const NavTemplate = html`
|
|
10
|
+
<nav ${delegateAria()}>
|
|
11
|
+
<slot></slot>
|
|
12
|
+
</nav>
|
|
13
|
+
`;
|
|
9
14
|
|
|
10
15
|
const navDefinition = defineVividComponent("nav", Nav, NavTemplate, [], {
|
|
11
16
|
styles
|
package/shared/definition34.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as iconDefinition } from './definition28.js';
|
|
2
|
-
import { V as VividElement, a as attr, h as html,
|
|
2
|
+
import { V as VividElement, a as attr, h as html, g as createRegisterFunction, i as defineVividComponent } from './vivid-element.js';
|
|
3
3
|
import { b as AffixIcon, a as affixIconTemplateFactory, I as IconWrapper } from './affix.js';
|
|
4
4
|
import { c as classNames } from './class-names.js';
|
|
5
5
|
import { w as when } from './when.js';
|
package/shared/definition35.cjs
CHANGED
|
@@ -8,8 +8,8 @@ const applyMixinsWithObservables = require('./applyMixinsWithObservables.cjs');
|
|
|
8
8
|
const delegatesAria = require('./delegates-aria.cjs');
|
|
9
9
|
const formAssociated = require('./form-associated.cjs');
|
|
10
10
|
const affix = require('./affix.cjs');
|
|
11
|
-
const localized = require('./localized.cjs');
|
|
12
11
|
const keyCodes = require('./key-codes.cjs');
|
|
12
|
+
const localized = require('./localized.cjs');
|
|
13
13
|
const formElements = require('./form-elements.cjs');
|
|
14
14
|
const enums = require('./enums.cjs');
|
|
15
15
|
const classNames = require('./class-names.cjs');
|
|
@@ -397,18 +397,7 @@ const NumberFieldTemplate = (context) => {
|
|
|
397
397
|
?spellcheck="${(x) => x.spellcheck}"
|
|
398
398
|
:value="${(x) => x._presentationValue}"
|
|
399
399
|
type="text"
|
|
400
|
-
|
|
401
|
-
aria-busy="${(x) => x.ariaBusy}"
|
|
402
|
-
aria-current="${(x) => x.ariaCurrent}"
|
|
403
|
-
aria-disabled="${(x) => x.ariaDisabled}"
|
|
404
|
-
aria-haspopup="${(x) => x.ariaHasPopup}"
|
|
405
|
-
aria-hidden="${(x) => x.ariaHidden}"
|
|
406
|
-
aria-invalid="${(x) => x.ariaInvalid}"
|
|
407
|
-
aria-keyshortcuts="${(x) => x.ariaKeyShortcuts}"
|
|
408
|
-
aria-label="${(x) => x.ariaLabel}"
|
|
409
|
-
aria-live="${(x) => x.ariaLive}"
|
|
410
|
-
aria-relevant="${(x) => x.ariaRelevant}"
|
|
411
|
-
aria-roledescription="${(x) => x.ariaRoleDescription}"
|
|
400
|
+
${delegatesAria.delegateAria()}
|
|
412
401
|
${ref.ref("control")}
|
|
413
402
|
/>
|
|
414
403
|
</div>
|