@vonage/vivid 4.14.2 → 4.14.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/custom-elements.json +371 -27
- package/index.cjs +1 -0
- package/index.js +1 -1
- package/lib/accordion/definition.d.ts +5 -1
- package/lib/combobox/combobox.d.ts +5 -1
- package/lib/file-picker/file-picker.d.ts +1 -0
- package/lib/menu-item/definition.d.ts +1 -1
- package/lib/menu-item/menu-item-role.d.ts +7 -0
- package/lib/menu-item/menu-item.d.ts +1 -7
- package/lib/number-field/number-field.d.ts +1 -1
- package/lib/radio/radio.d.ts +2 -2
- package/lib/searchable-select/option-tag.d.ts +2 -2
- package/lib/select/select.form-associated.d.ts +1 -1
- package/lib/switch/switch.d.ts +1 -0
- package/lib/tabs/tabs.d.ts +5 -1
- package/lib/text-anchor/text-anchor.d.ts +1 -1
- package/lib/tree-item/tree-item.d.ts +1 -1
- package/lib/tree-view/tree-view.d.ts +1 -1
- package/package.json +1 -1
- package/shared/applyMixinsWithObservables.cjs +1 -1
- package/shared/applyMixinsWithObservables.js +1 -1
- package/shared/definition11.cjs +1 -1
- package/shared/definition11.js +1 -1
- package/shared/definition16.cjs +63 -30
- package/shared/definition16.js +61 -28
- package/shared/definition2.cjs +9 -4
- package/shared/definition2.js +9 -5
- package/shared/definition25.cjs +25 -18
- package/shared/definition25.js +26 -19
- package/shared/definition29.cjs +12 -30
- package/shared/definition29.js +12 -30
- package/shared/definition33.cjs +1 -1
- package/shared/definition33.js +1 -1
- package/shared/definition34.cjs +4 -294
- package/shared/definition34.js +4 -294
- package/shared/definition41.cjs +1 -1
- package/shared/definition41.js +1 -1
- package/shared/definition42.cjs +1 -2
- package/shared/definition42.js +1 -2
- package/shared/definition43.cjs +1 -2
- package/shared/definition43.js +1 -2
- package/shared/definition46.cjs +2 -2
- package/shared/definition46.js +3 -3
- package/shared/definition48.cjs +22 -15
- package/shared/definition48.js +22 -15
- package/shared/definition5.cjs +3 -2
- package/shared/definition5.js +3 -2
- package/shared/definition51.cjs +11 -402
- package/shared/definition51.js +17 -408
- package/shared/definition54.js +1 -1
- package/shared/definition56.js +1 -1
- package/shared/direction.cjs +2 -16
- package/shared/direction.js +3 -17
- package/shared/foundation/utilities/direction.d.ts +2 -0
- package/shared/listbox.cjs +22 -3
- package/shared/listbox.js +21 -2
- package/shared/text-anchor.cjs +1 -1
- package/shared/text-anchor.js +1 -1
- package/shared/text-field2.js +1 -1
- package/shared/vivid-element.cjs +0 -2
- package/shared/vivid-element.js +1 -1
- package/styles/core/all.css +1 -1
- package/styles/core/theme.css +1 -1
- package/styles/core/typography.css +1 -1
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/styles/tokens/vivid-2-compat.css +1 -1
- package/vivid.api.json +70 -3
- package/shared/apply-mixins2.cjs +0 -25
- package/shared/apply-mixins2.js +0 -23
- package/shared/form-associated2.cjs +0 -383
- package/shared/form-associated2.js +0 -381
- package/shared/foundation-element.cjs +0 -1417
- package/shared/foundation-element.js +0 -1414
- package/shared/key-codes2.cjs +0 -96
- package/shared/key-codes2.js +0 -88
- package/shared/start-end.cjs +0 -52
- package/shared/start-end.js +0 -50
package/lib/switch/switch.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { Connotation } from '../enums';
|
|
|
2
2
|
import { FormAssociatedSwitch } from './switch.form-associated';
|
|
3
3
|
export type SwitchConnotation = Connotation.Accent | Connotation.Alert | Connotation.Announcement | Connotation.Success | Connotation.CTA;
|
|
4
4
|
export declare class Switch extends FormAssociatedSwitch {
|
|
5
|
+
ariaLabel: string | null;
|
|
5
6
|
label?: string;
|
|
6
7
|
connotation?: SwitchConnotation;
|
|
7
8
|
readOnly: boolean;
|
package/lib/tabs/tabs.d.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { TabsOrientation } from '@microsoft/fast-foundation';
|
|
2
1
|
import type { Connotation, TabsGutters } from '../enums.js';
|
|
3
2
|
import { VividElement } from '../../shared/foundation/vivid-element/vivid-element';
|
|
4
3
|
export declare const ACTIVE_TAB_WIDTH = "--_tabs-active-tab-inline-size";
|
|
5
4
|
export declare const TABLIST_COLUMN = "--_tabs-tablist-column";
|
|
6
5
|
export type TabsConnotation = Extract<Connotation, Connotation.Accent | Connotation.CTA>;
|
|
6
|
+
export declare const TabsOrientation: {
|
|
7
|
+
readonly vertical: "vertical";
|
|
8
|
+
readonly horizontal: "horizontal";
|
|
9
|
+
};
|
|
10
|
+
export type TabsOrientation = typeof TabsOrientation[keyof typeof TabsOrientation];
|
|
7
11
|
export declare class Tabs extends VividElement {
|
|
8
12
|
#private;
|
|
9
13
|
orientation: TabsOrientation;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { VividElement } from '../../shared/foundation/vivid-element/vivid-element';
|
|
1
2
|
import { Appearance, Connotation } from '../enums';
|
|
2
3
|
import { AffixIcon } from '../../shared/patterns/affix';
|
|
3
4
|
import { Anchor } from '../../shared/foundation/anchor/anchor';
|
|
4
|
-
import { VividElement } from '../../shared/foundation/vivid-element/vivid-element';
|
|
5
5
|
export type TextAnchorConnotation = Extract<Connotation, Connotation.Accent | Connotation.CTA>;
|
|
6
6
|
export type TextAnchorAppearance = Extract<Appearance, Appearance.Ghost | Appearance.GhostLight>;
|
|
7
7
|
export declare class TextAnchor extends VividElement {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AffixIcon } from '../../shared/patterns/affix';
|
|
2
1
|
import { VividElement } from '../../shared/foundation/vivid-element/vivid-element';
|
|
2
|
+
import { AffixIcon } from '../../shared/patterns/affix';
|
|
3
3
|
export declare function isTreeItemElement(el: Element): el is HTMLElement;
|
|
4
4
|
export declare class TreeItem extends VividElement {
|
|
5
5
|
text?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { VividElement } from '../../shared/foundation/vivid-element/vivid-element.js';
|
|
1
2
|
import { TreeItem } from '../tree-item/tree-item.js';
|
|
2
|
-
import { VividElement } from '../../shared/foundation/vivid-element/vivid-element';
|
|
3
3
|
export declare function getDisplayedNodes(rootNode: HTMLElement, selector: string): HTMLElement[];
|
|
4
4
|
export declare class TreeView extends VividElement {
|
|
5
5
|
renderCollapsedNodes: boolean;
|
package/package.json
CHANGED
package/shared/definition11.cjs
CHANGED
|
@@ -180,7 +180,7 @@ function renderButtonContent(context) {
|
|
|
180
180
|
formnovalidate="${(x) => x.formnovalidate}"
|
|
181
181
|
formtarget="${(x) => x.formtarget}"
|
|
182
182
|
name="${(x) => x.name}"
|
|
183
|
-
type="${(x) => x.type}"
|
|
183
|
+
type="${(x) => x.type ?? "submit"}"
|
|
184
184
|
value="${(x) => x.value}"
|
|
185
185
|
aria-atomic="${(x) => x.ariaAtomic}"
|
|
186
186
|
aria-busy="${(x) => x.ariaBusy}"
|
package/shared/definition11.js
CHANGED
|
@@ -178,7 +178,7 @@ function renderButtonContent(context) {
|
|
|
178
178
|
formnovalidate="${(x) => x.formnovalidate}"
|
|
179
179
|
formtarget="${(x) => x.formtarget}"
|
|
180
180
|
name="${(x) => x.name}"
|
|
181
|
-
type="${(x) => x.type}"
|
|
181
|
+
type="${(x) => x.type ?? "submit"}"
|
|
182
182
|
value="${(x) => x.value}"
|
|
183
183
|
aria-atomic="${(x) => x.ariaAtomic}"
|
|
184
184
|
aria-busy="${(x) => x.ariaBusy}"
|
package/shared/definition16.cjs
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const definition$
|
|
3
|
+
const definition$2 = require('./definition27.cjs');
|
|
4
4
|
const definition = require('./definition63.cjs');
|
|
5
|
-
const definition$
|
|
5
|
+
const definition$3 = require('./definition35.cjs');
|
|
6
6
|
const textField = require('./text-field.cjs');
|
|
7
7
|
const vividElement = require('./vivid-element.cjs');
|
|
8
|
+
const applyMixins = require('./apply-mixins.cjs');
|
|
8
9
|
const listbox = require('./listbox.cjs');
|
|
9
10
|
const formAssociated = require('./form-associated.cjs');
|
|
10
11
|
const affix = require('./affix.cjs');
|
|
11
12
|
const strings = require('./strings.cjs');
|
|
12
13
|
const numbers = require('./numbers.cjs');
|
|
13
|
-
const applyMixins = require('./apply-mixins2.cjs');
|
|
14
14
|
const formElements = require('./form-elements.cjs');
|
|
15
15
|
const index = require('./index.cjs');
|
|
16
|
+
const definition$1 = require('./definition11.cjs');
|
|
16
17
|
const ref = require('./ref.cjs');
|
|
17
18
|
const slotted = require('./slotted.cjs');
|
|
18
19
|
const when = require('./when.cjs');
|
|
19
20
|
const classNames = require('./class-names.cjs');
|
|
20
21
|
|
|
21
|
-
const styles = ":host{position:relative}.base{--_text-field-gutter-end:
|
|
22
|
+
const styles = ".chevron{display:flex;flex-shrink:0;font:var(--vvd-typography-base-extended);transform:rotate(0);transition:transform .2s}:host([aria-expanded=true]) .chevron,:host([open]) .chevron{transform:rotate(180deg)}:host{position:relative}.base{--_text-field-gutter-end: 8px}.base{--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--_connotation-color-intermediate)}.base.appearance-ghost{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.base:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--_connotation-color-fierce)}.base:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)).appearance-ghost{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}.base:where(.disabled,:disabled){--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-100);--_appearance-color-outline: var(--vvd-color-neutral-300)}.base:where(.disabled,:disabled).appearance-ghost{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.base:where(.readonly):where(:not(.disabled,:disabled)){--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-neutral-200);--_appearance-color-outline: var(--vvd-color-neutral-400)}.base:where(.readonly):where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: var(--vvd-color-neutral-600);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.base:where(.error):where(:not(.disabled,:disabled)){--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-alert-50);--_appearance-color-outline: var(--vvd-color-alert-500)}.base:where(.error):where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-alert-50);--_appearance-color-outline: transparent}.base:where(.success):where(:not(.disabled,:disabled)){--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-success-50);--_appearance-color-outline: var(--vvd-color-success-500)}.base:where(.success):where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-success-50);--_appearance-color-outline: transparent}.base:not(.shape-pill) .base{border-radius:var(--_text-field-border-radius)}.base.shape-pill .base{border-radius:var(--_text-field-pill-border-radius)}.base slot[name=icon]{position:absolute;z-index:1;display:inline-block;color:var(--_low-ink-color);font-size:var(--_text-field-icon-size);inset-block-start:50%;inset-inline-start:var(--_text-field-gutter-start);line-height:1;pointer-events:none;transform:translateY(-50%)}.base.has-meta{padding-inline-end:16px}.control{text-overflow:ellipsis;white-space:nowrap}.fieldset .leading-items-wrapper{position:relative;display:flex;flex-shrink:0;align-items:center;gap:8px;padding-inline-end:16px}:not(.disabled) .chevron{cursor:pointer}.disabled .chevron{color:var(--_low-ink-color);cursor:not-allowed}.listbox{display:flex;max-height:var(--combobox-height, 408px);flex-direction:column;padding:4px;border-radius:8px;contain:paint;gap:2px;overflow-y:auto}::part(popup-base){inline-size:max-content;min-inline-size:var(--_combobox-fixed-width, 100%)}@supports selector(:has(*)){.fieldset:has(.control:focus-within):after{--focus-stroke-gap-color: transparent;box-shadow:inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));outline-offset:calc(-2px - var(--focus-inset, 0px))}}@supports not selector(:has(*)){.fieldset:focus-within:after{box-shadow:inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));outline-offset:calc(-2px - var(--focus-inset, 0px));--focus-stroke-gap-color: transparent;position:absolute;z-index:1;display:block;border-radius:inherit;content:\"\";inset:0;pointer-events:none}}";
|
|
22
23
|
|
|
23
24
|
class _Combobox extends listbox.Listbox {
|
|
24
25
|
}
|
|
@@ -477,6 +478,13 @@ let Combobox = class extends FormAssociatedCombobox {
|
|
|
477
478
|
slottedOptionsChanged(prev, next) {
|
|
478
479
|
super.slottedOptionsChanged(prev, next);
|
|
479
480
|
this.updateValue();
|
|
481
|
+
const scale = this.getAttribute("scale") || this.scale;
|
|
482
|
+
next.forEach((element) => {
|
|
483
|
+
if (scale) {
|
|
484
|
+
element.setAttribute("scale", scale);
|
|
485
|
+
element.scale = scale;
|
|
486
|
+
}
|
|
487
|
+
});
|
|
480
488
|
}
|
|
481
489
|
/**
|
|
482
490
|
* Sets the value and to match the first selected option.
|
|
@@ -508,12 +516,21 @@ __decorateClass([
|
|
|
508
516
|
__decorateClass([
|
|
509
517
|
vividElement.attr
|
|
510
518
|
], Combobox.prototype, "appearance", 2);
|
|
519
|
+
__decorateClass([
|
|
520
|
+
vividElement.attr
|
|
521
|
+
], Combobox.prototype, "shape", 2);
|
|
522
|
+
__decorateClass([
|
|
523
|
+
vividElement.attr()
|
|
524
|
+
], Combobox.prototype, "scale", 2);
|
|
511
525
|
__decorateClass([
|
|
512
526
|
vividElement.attr
|
|
513
527
|
], Combobox.prototype, "placement", 2);
|
|
514
528
|
__decorateClass([
|
|
515
529
|
vividElement.attr({ mode: "boolean", attribute: "fixed-dropdown" })
|
|
516
530
|
], Combobox.prototype, "fixedDropdown", 2);
|
|
531
|
+
__decorateClass([
|
|
532
|
+
vividElement.observable
|
|
533
|
+
], Combobox.prototype, "metaSlottedContent", 2);
|
|
517
534
|
__decorateClass([
|
|
518
535
|
vividElement.observable
|
|
519
536
|
], Combobox.prototype, "maxHeight", 2);
|
|
@@ -529,12 +546,12 @@ Combobox = __decorateClass([
|
|
|
529
546
|
], Combobox);
|
|
530
547
|
applyMixins.applyMixins(Combobox, affix.AffixIcon);
|
|
531
548
|
|
|
532
|
-
function renderLabel() {
|
|
533
|
-
return vividElement.html` <label for="control" class="label">
|
|
534
|
-
${(x) => x.label}
|
|
535
|
-
</label>`;
|
|
536
|
-
}
|
|
537
549
|
const getStateClasses = ({
|
|
550
|
+
icon,
|
|
551
|
+
iconSlottedContent,
|
|
552
|
+
metaSlottedContent,
|
|
553
|
+
shape,
|
|
554
|
+
scale,
|
|
538
555
|
disabled,
|
|
539
556
|
placeholder,
|
|
540
557
|
label,
|
|
@@ -542,10 +559,19 @@ const getStateClasses = ({
|
|
|
542
559
|
}) => classNames.classNames(
|
|
543
560
|
"base",
|
|
544
561
|
["disabled", disabled],
|
|
562
|
+
[`shape-${shape}`, Boolean(shape)],
|
|
563
|
+
[`size-${scale}`, Boolean(scale)],
|
|
545
564
|
["placeholder", Boolean(placeholder)],
|
|
546
565
|
[`appearance-${appearance}`, Boolean(appearance)],
|
|
547
|
-
["no-label", !label]
|
|
566
|
+
["no-label", !label],
|
|
567
|
+
["has-icon", !!icon || Boolean(iconSlottedContent?.length)],
|
|
568
|
+
["has-meta", Boolean(metaSlottedContent?.length)]
|
|
548
569
|
);
|
|
570
|
+
function renderLabel() {
|
|
571
|
+
return vividElement.html` <label for="control" class="label">
|
|
572
|
+
${(x) => x.label}
|
|
573
|
+
</label>`;
|
|
574
|
+
}
|
|
549
575
|
function setFixedDropdownVarWidth(x) {
|
|
550
576
|
return x.open && x.fixedDropdown ? `--_combobox-fixed-width: ${Math.round(
|
|
551
577
|
x.getBoundingClientRect().width
|
|
@@ -553,28 +579,35 @@ function setFixedDropdownVarWidth(x) {
|
|
|
553
579
|
}
|
|
554
580
|
function renderInput(context) {
|
|
555
581
|
const affixIconTemplate = affix.affixIconTemplateFactory(context);
|
|
582
|
+
const chevronTemplate = definition$1.chevronTemplateFactory(context);
|
|
556
583
|
return vividElement.html` <div class="${getStateClasses}" ${ref.ref("_anchor")}>
|
|
557
584
|
${when.when((x) => x.label, renderLabel())}
|
|
558
585
|
<div class="fieldset">
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
586
|
+
${(x) => affixIconTemplate(x.icon, affix.IconWrapper.Slot)}
|
|
587
|
+
<div class="wrapper">
|
|
588
|
+
<input
|
|
589
|
+
id="control"
|
|
590
|
+
autocomplete="off"
|
|
591
|
+
class="control"
|
|
592
|
+
aria-activedescendant="${(x) => x.open ? x.ariaActiveDescendant : null}"
|
|
593
|
+
aria-autocomplete="${(x) => x.autocomplete}"
|
|
594
|
+
aria-controls="${(x) => x.listboxId}"
|
|
595
|
+
aria-disabled="${(x) => x.ariaDisabled}"
|
|
596
|
+
aria-expanded="${(x) => x.open}"
|
|
597
|
+
aria-haspopup="listbox"
|
|
598
|
+
placeholder="${(x) => x.placeholder}"
|
|
599
|
+
role="combobox"
|
|
600
|
+
type="text"
|
|
601
|
+
?disabled="${(x) => x.disabled}"
|
|
602
|
+
:value="${(x) => x.value}"
|
|
603
|
+
@input="${(x, c) => x.inputHandler(c.event)}"
|
|
604
|
+
${ref.ref("control")}
|
|
605
|
+
/>
|
|
606
|
+
</div>
|
|
607
|
+
<div class="leading-items-wrapper">
|
|
608
|
+
<slot name="meta" ${slotted.slotted("metaSlottedContent")}></slot>
|
|
609
|
+
${chevronTemplate}
|
|
610
|
+
</div>
|
|
578
611
|
</div>
|
|
579
612
|
</div>`;
|
|
580
613
|
}
|
|
@@ -620,7 +653,7 @@ const comboboxDefinition = vividElement.defineVividComponent(
|
|
|
620
653
|
"combobox",
|
|
621
654
|
Combobox,
|
|
622
655
|
comboboxTemplate,
|
|
623
|
-
[definition$
|
|
656
|
+
[definition$2.iconDefinition, definition.popupDefinition, definition$3.listboxOptionDefinition],
|
|
624
657
|
{
|
|
625
658
|
styles: [textField.styles, styles],
|
|
626
659
|
shadowOptions: {
|
package/shared/definition16.js
CHANGED
|
@@ -3,20 +3,21 @@ import { P as Popup, p as popupDefinition } from './definition63.js';
|
|
|
3
3
|
import { l as listboxOptionDefinition } from './definition35.js';
|
|
4
4
|
import { s as styles$1 } from './text-field.js';
|
|
5
5
|
import { D as DOM, O as Observable, a as attr, o as observable, h as html, d as defineVividComponent, f as createRegisterFunction } from './vivid-element.js';
|
|
6
|
+
import { a as applyMixins } from './apply-mixins.js';
|
|
6
7
|
import { L as Listbox } from './listbox.js';
|
|
7
8
|
import { F as FormAssociated } from './form-associated.js';
|
|
8
|
-
import { b as AffixIcon, a as affixIconTemplateFactory } from './affix.js';
|
|
9
|
+
import { b as AffixIcon, a as affixIconTemplateFactory, I as IconWrapper } from './affix.js';
|
|
9
10
|
import { u as uniqueId } from './strings.js';
|
|
10
11
|
import { l as limit } from './numbers.js';
|
|
11
|
-
import { a as applyMixins } from './apply-mixins2.js';
|
|
12
12
|
import { f as formElements } from './form-elements.js';
|
|
13
13
|
import { h as handleEscapeKeyAndStopPropogation } from './index.js';
|
|
14
|
+
import { c as chevronTemplateFactory } from './definition11.js';
|
|
14
15
|
import { r as ref } from './ref.js';
|
|
15
16
|
import { s as slotted } from './slotted.js';
|
|
16
17
|
import { w as when } from './when.js';
|
|
17
18
|
import { c as classNames } from './class-names.js';
|
|
18
19
|
|
|
19
|
-
const styles = ":host{position:relative}.base{--_text-field-gutter-end:
|
|
20
|
+
const styles = ".chevron{display:flex;flex-shrink:0;font:var(--vvd-typography-base-extended);transform:rotate(0);transition:transform .2s}:host([aria-expanded=true]) .chevron,:host([open]) .chevron{transform:rotate(180deg)}:host{position:relative}.base{--_text-field-gutter-end: 8px}.base{--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--_connotation-color-intermediate)}.base.appearance-ghost{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.base:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--_connotation-color-fierce)}.base:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)).appearance-ghost{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}.base:where(.disabled,:disabled){--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-100);--_appearance-color-outline: var(--vvd-color-neutral-300)}.base:where(.disabled,:disabled).appearance-ghost{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.base:where(.readonly):where(:not(.disabled,:disabled)){--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-neutral-200);--_appearance-color-outline: var(--vvd-color-neutral-400)}.base:where(.readonly):where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: var(--vvd-color-neutral-600);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.base:where(.error):where(:not(.disabled,:disabled)){--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-alert-50);--_appearance-color-outline: var(--vvd-color-alert-500)}.base:where(.error):where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-alert-50);--_appearance-color-outline: transparent}.base:where(.success):where(:not(.disabled,:disabled)){--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-success-50);--_appearance-color-outline: var(--vvd-color-success-500)}.base:where(.success):where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-success-50);--_appearance-color-outline: transparent}.base:not(.shape-pill) .base{border-radius:var(--_text-field-border-radius)}.base.shape-pill .base{border-radius:var(--_text-field-pill-border-radius)}.base slot[name=icon]{position:absolute;z-index:1;display:inline-block;color:var(--_low-ink-color);font-size:var(--_text-field-icon-size);inset-block-start:50%;inset-inline-start:var(--_text-field-gutter-start);line-height:1;pointer-events:none;transform:translateY(-50%)}.base.has-meta{padding-inline-end:16px}.control{text-overflow:ellipsis;white-space:nowrap}.fieldset .leading-items-wrapper{position:relative;display:flex;flex-shrink:0;align-items:center;gap:8px;padding-inline-end:16px}:not(.disabled) .chevron{cursor:pointer}.disabled .chevron{color:var(--_low-ink-color);cursor:not-allowed}.listbox{display:flex;max-height:var(--combobox-height, 408px);flex-direction:column;padding:4px;border-radius:8px;contain:paint;gap:2px;overflow-y:auto}::part(popup-base){inline-size:max-content;min-inline-size:var(--_combobox-fixed-width, 100%)}@supports selector(:has(*)){.fieldset:has(.control:focus-within):after{--focus-stroke-gap-color: transparent;box-shadow:inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));outline-offset:calc(-2px - var(--focus-inset, 0px))}}@supports not selector(:has(*)){.fieldset:focus-within:after{box-shadow:inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));outline-offset:calc(-2px - var(--focus-inset, 0px));--focus-stroke-gap-color: transparent;position:absolute;z-index:1;display:block;border-radius:inherit;content:\"\";inset:0;pointer-events:none}}";
|
|
20
21
|
|
|
21
22
|
class _Combobox extends Listbox {
|
|
22
23
|
}
|
|
@@ -475,6 +476,13 @@ let Combobox = class extends FormAssociatedCombobox {
|
|
|
475
476
|
slottedOptionsChanged(prev, next) {
|
|
476
477
|
super.slottedOptionsChanged(prev, next);
|
|
477
478
|
this.updateValue();
|
|
479
|
+
const scale = this.getAttribute("scale") || this.scale;
|
|
480
|
+
next.forEach((element) => {
|
|
481
|
+
if (scale) {
|
|
482
|
+
element.setAttribute("scale", scale);
|
|
483
|
+
element.scale = scale;
|
|
484
|
+
}
|
|
485
|
+
});
|
|
478
486
|
}
|
|
479
487
|
/**
|
|
480
488
|
* Sets the value and to match the first selected option.
|
|
@@ -506,12 +514,21 @@ __decorateClass([
|
|
|
506
514
|
__decorateClass([
|
|
507
515
|
attr
|
|
508
516
|
], Combobox.prototype, "appearance", 2);
|
|
517
|
+
__decorateClass([
|
|
518
|
+
attr
|
|
519
|
+
], Combobox.prototype, "shape", 2);
|
|
520
|
+
__decorateClass([
|
|
521
|
+
attr()
|
|
522
|
+
], Combobox.prototype, "scale", 2);
|
|
509
523
|
__decorateClass([
|
|
510
524
|
attr
|
|
511
525
|
], Combobox.prototype, "placement", 2);
|
|
512
526
|
__decorateClass([
|
|
513
527
|
attr({ mode: "boolean", attribute: "fixed-dropdown" })
|
|
514
528
|
], Combobox.prototype, "fixedDropdown", 2);
|
|
529
|
+
__decorateClass([
|
|
530
|
+
observable
|
|
531
|
+
], Combobox.prototype, "metaSlottedContent", 2);
|
|
515
532
|
__decorateClass([
|
|
516
533
|
observable
|
|
517
534
|
], Combobox.prototype, "maxHeight", 2);
|
|
@@ -527,12 +544,12 @@ Combobox = __decorateClass([
|
|
|
527
544
|
], Combobox);
|
|
528
545
|
applyMixins(Combobox, AffixIcon);
|
|
529
546
|
|
|
530
|
-
function renderLabel() {
|
|
531
|
-
return html` <label for="control" class="label">
|
|
532
|
-
${(x) => x.label}
|
|
533
|
-
</label>`;
|
|
534
|
-
}
|
|
535
547
|
const getStateClasses = ({
|
|
548
|
+
icon,
|
|
549
|
+
iconSlottedContent,
|
|
550
|
+
metaSlottedContent,
|
|
551
|
+
shape,
|
|
552
|
+
scale,
|
|
536
553
|
disabled,
|
|
537
554
|
placeholder,
|
|
538
555
|
label,
|
|
@@ -540,10 +557,19 @@ const getStateClasses = ({
|
|
|
540
557
|
}) => classNames(
|
|
541
558
|
"base",
|
|
542
559
|
["disabled", disabled],
|
|
560
|
+
[`shape-${shape}`, Boolean(shape)],
|
|
561
|
+
[`size-${scale}`, Boolean(scale)],
|
|
543
562
|
["placeholder", Boolean(placeholder)],
|
|
544
563
|
[`appearance-${appearance}`, Boolean(appearance)],
|
|
545
|
-
["no-label", !label]
|
|
564
|
+
["no-label", !label],
|
|
565
|
+
["has-icon", !!icon || Boolean(iconSlottedContent?.length)],
|
|
566
|
+
["has-meta", Boolean(metaSlottedContent?.length)]
|
|
546
567
|
);
|
|
568
|
+
function renderLabel() {
|
|
569
|
+
return html` <label for="control" class="label">
|
|
570
|
+
${(x) => x.label}
|
|
571
|
+
</label>`;
|
|
572
|
+
}
|
|
547
573
|
function setFixedDropdownVarWidth(x) {
|
|
548
574
|
return x.open && x.fixedDropdown ? `--_combobox-fixed-width: ${Math.round(
|
|
549
575
|
x.getBoundingClientRect().width
|
|
@@ -551,28 +577,35 @@ function setFixedDropdownVarWidth(x) {
|
|
|
551
577
|
}
|
|
552
578
|
function renderInput(context) {
|
|
553
579
|
const affixIconTemplate = affixIconTemplateFactory(context);
|
|
580
|
+
const chevronTemplate = chevronTemplateFactory(context);
|
|
554
581
|
return html` <div class="${getStateClasses}" ${ref("_anchor")}>
|
|
555
582
|
${when((x) => x.label, renderLabel())}
|
|
556
583
|
<div class="fieldset">
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
584
|
+
${(x) => affixIconTemplate(x.icon, IconWrapper.Slot)}
|
|
585
|
+
<div class="wrapper">
|
|
586
|
+
<input
|
|
587
|
+
id="control"
|
|
588
|
+
autocomplete="off"
|
|
589
|
+
class="control"
|
|
590
|
+
aria-activedescendant="${(x) => x.open ? x.ariaActiveDescendant : null}"
|
|
591
|
+
aria-autocomplete="${(x) => x.autocomplete}"
|
|
592
|
+
aria-controls="${(x) => x.listboxId}"
|
|
593
|
+
aria-disabled="${(x) => x.ariaDisabled}"
|
|
594
|
+
aria-expanded="${(x) => x.open}"
|
|
595
|
+
aria-haspopup="listbox"
|
|
596
|
+
placeholder="${(x) => x.placeholder}"
|
|
597
|
+
role="combobox"
|
|
598
|
+
type="text"
|
|
599
|
+
?disabled="${(x) => x.disabled}"
|
|
600
|
+
:value="${(x) => x.value}"
|
|
601
|
+
@input="${(x, c) => x.inputHandler(c.event)}"
|
|
602
|
+
${ref("control")}
|
|
603
|
+
/>
|
|
604
|
+
</div>
|
|
605
|
+
<div class="leading-items-wrapper">
|
|
606
|
+
<slot name="meta" ${slotted("metaSlottedContent")}></slot>
|
|
607
|
+
${chevronTemplate}
|
|
608
|
+
</div>
|
|
576
609
|
</div>
|
|
577
610
|
</div>`;
|
|
578
611
|
}
|
package/shared/definition2.cjs
CHANGED
|
@@ -18,7 +18,7 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
18
18
|
if (result) __defProp(target, key, result);
|
|
19
19
|
return result;
|
|
20
20
|
};
|
|
21
|
-
const AccordionExpandMode = {
|
|
21
|
+
const AccordionExpandMode$1 = {
|
|
22
22
|
/**
|
|
23
23
|
* Designates only a single {@link @microsoft/fast-foundation#(AccordionItem:class) } can be open a time.
|
|
24
24
|
*/
|
|
@@ -32,7 +32,7 @@ class Accordion extends vividElement.VividElement {
|
|
|
32
32
|
constructor() {
|
|
33
33
|
super(...arguments);
|
|
34
34
|
/* eslint-disable-next-line @nrwl/nx/workspace/no-attribute-default-value */
|
|
35
|
-
this.expandmode = AccordionExpandMode.single;
|
|
35
|
+
this.expandmode = AccordionExpandMode$1.single;
|
|
36
36
|
this.activeItemIndex = 0;
|
|
37
37
|
this.change = () => {
|
|
38
38
|
this.$emit("change", this.activeid);
|
|
@@ -146,7 +146,7 @@ class Accordion extends vividElement.VividElement {
|
|
|
146
146
|
});
|
|
147
147
|
}
|
|
148
148
|
isSingleExpandMode() {
|
|
149
|
-
return this.expandmode !== AccordionExpandMode.multi;
|
|
149
|
+
return this.expandmode !== AccordionExpandMode$1.multi;
|
|
150
150
|
}
|
|
151
151
|
adjust(item, adjustment) {
|
|
152
152
|
this.focusItem(
|
|
@@ -164,7 +164,7 @@ class Accordion extends vividElement.VividElement {
|
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
166
|
closeAll() {
|
|
167
|
-
if (this.expandmode === AccordionExpandMode.multi) {
|
|
167
|
+
if (this.expandmode === AccordionExpandMode$1.multi) {
|
|
168
168
|
this.accordionItems.forEach((item) => {
|
|
169
169
|
item.expanded = false;
|
|
170
170
|
});
|
|
@@ -186,6 +186,10 @@ const AccordionTemplate = vividElement.html`
|
|
|
186
186
|
</div>
|
|
187
187
|
`;
|
|
188
188
|
|
|
189
|
+
const AccordionExpandMode = {
|
|
190
|
+
single: "single",
|
|
191
|
+
multi: "multi"
|
|
192
|
+
};
|
|
189
193
|
const accordionDefinition = vividElement.defineVividComponent(
|
|
190
194
|
"accordion",
|
|
191
195
|
Accordion,
|
|
@@ -197,5 +201,6 @@ const accordionDefinition = vividElement.defineVividComponent(
|
|
|
197
201
|
);
|
|
198
202
|
const registerAccordion = vividElement.createRegisterFunction(accordionDefinition);
|
|
199
203
|
|
|
204
|
+
exports.AccordionExpandMode = AccordionExpandMode;
|
|
200
205
|
exports.accordionDefinition = accordionDefinition;
|
|
201
206
|
exports.registerAccordion = registerAccordion;
|
package/shared/definition2.js
CHANGED
|
@@ -16,7 +16,7 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
16
16
|
if (result) __defProp(target, key, result);
|
|
17
17
|
return result;
|
|
18
18
|
};
|
|
19
|
-
const AccordionExpandMode = {
|
|
19
|
+
const AccordionExpandMode$1 = {
|
|
20
20
|
/**
|
|
21
21
|
* Designates only a single {@link @microsoft/fast-foundation#(AccordionItem:class) } can be open a time.
|
|
22
22
|
*/
|
|
@@ -30,7 +30,7 @@ class Accordion extends VividElement {
|
|
|
30
30
|
constructor() {
|
|
31
31
|
super(...arguments);
|
|
32
32
|
/* eslint-disable-next-line @nrwl/nx/workspace/no-attribute-default-value */
|
|
33
|
-
this.expandmode = AccordionExpandMode.single;
|
|
33
|
+
this.expandmode = AccordionExpandMode$1.single;
|
|
34
34
|
this.activeItemIndex = 0;
|
|
35
35
|
this.change = () => {
|
|
36
36
|
this.$emit("change", this.activeid);
|
|
@@ -144,7 +144,7 @@ class Accordion extends VividElement {
|
|
|
144
144
|
});
|
|
145
145
|
}
|
|
146
146
|
isSingleExpandMode() {
|
|
147
|
-
return this.expandmode !== AccordionExpandMode.multi;
|
|
147
|
+
return this.expandmode !== AccordionExpandMode$1.multi;
|
|
148
148
|
}
|
|
149
149
|
adjust(item, adjustment) {
|
|
150
150
|
this.focusItem(
|
|
@@ -162,7 +162,7 @@ class Accordion extends VividElement {
|
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
164
|
closeAll() {
|
|
165
|
-
if (this.expandmode === AccordionExpandMode.multi) {
|
|
165
|
+
if (this.expandmode === AccordionExpandMode$1.multi) {
|
|
166
166
|
this.accordionItems.forEach((item) => {
|
|
167
167
|
item.expanded = false;
|
|
168
168
|
});
|
|
@@ -184,6 +184,10 @@ const AccordionTemplate = html`
|
|
|
184
184
|
</div>
|
|
185
185
|
`;
|
|
186
186
|
|
|
187
|
+
const AccordionExpandMode = {
|
|
188
|
+
single: "single",
|
|
189
|
+
multi: "multi"
|
|
190
|
+
};
|
|
187
191
|
const accordionDefinition = defineVividComponent(
|
|
188
192
|
"accordion",
|
|
189
193
|
Accordion,
|
|
@@ -195,4 +199,4 @@ const accordionDefinition = defineVividComponent(
|
|
|
195
199
|
);
|
|
196
200
|
const registerAccordion = createRegisterFunction(accordionDefinition);
|
|
197
201
|
|
|
198
|
-
export { accordionDefinition as a, registerAccordion as r };
|
|
202
|
+
export { AccordionExpandMode as A, accordionDefinition as a, registerAccordion as r };
|