@odx/foundation 1.0.0-beta.13 → 1.0.0-beta.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdk/control/listbox-form-control.d.ts +1 -1
- package/dist/cdk.js +8 -6
- package/dist/components/accordion/accordion.d.ts +4 -0
- package/dist/components/button/button.d.ts +1 -3
- package/dist/components/button/button.models.d.ts +1 -0
- package/dist/components/input/input.d.ts +3 -0
- package/dist/components/select/select.d.ts +3 -0
- package/dist/components.js +164 -113
- package/dist/lib/controllers/expandable-controller.d.ts +0 -1
- package/dist/lib/main.d.ts +1 -1
- package/dist/lib/mixins/can-be-expanded.d.ts +0 -2
- package/dist/lib/mixins/can-be-selected.d.ts +1 -1
- package/dist/lib/{utils → types}/a11y.d.ts +0 -5
- package/dist/lib/utils/dom.d.ts +0 -2
- package/dist/lib/utils/lit.d.ts +1 -2
- package/dist/main.js +5 -11
- package/dist/styles.css +1 -1
- package/package.json +2 -2
|
@@ -14,7 +14,7 @@ export declare abstract class ListboxFormControl<Option extends OptionControl> e
|
|
|
14
14
|
canSelect(option: Option): boolean;
|
|
15
15
|
toggleOption(option: Option, state?: boolean): void;
|
|
16
16
|
connectedCallback(): void;
|
|
17
|
-
protected updateValue(option
|
|
17
|
+
protected updateValue(option?: Option): void;
|
|
18
18
|
protected willUpdate(props: PropertyValues<this>): void;
|
|
19
19
|
protected updateSelection(): void;
|
|
20
20
|
}
|
package/dist/cdk.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FormControl, CustomElement, getKeyboardEventInfo, toAriaBooleanAttribute, CanBeHighlighted, CanBeDisabled,
|
|
1
|
+
import { FormControl, CustomElement, getKeyboardEventInfo, toAriaBooleanAttribute, CanBeHighlighted, CanBeDisabled, getUniqueId, getElementFromEvent, ActiveDescendantsController, dedupeMixin, optionalAttr, requestUpdateOnAriaChange, WithLoadingState, getAssignedElements, toPx, waitForAnimations, findClosestDocument, createMutationObserver, customElement } from '@odx/foundation';
|
|
2
2
|
import { isServer, html, unsafeCSS } from 'lit';
|
|
3
3
|
import { property, queryAssignedElements, query, state } from 'lit/decorators.js';
|
|
4
4
|
import { R as RovingTabindexController, m as minBy } from './vendor-dJxQG085.js';
|
|
@@ -207,7 +207,7 @@ class OptionControl extends CanBeHighlighted(CanBeDisabled(CustomElement)) {
|
|
|
207
207
|
return this.textContent?.trim() ?? "";
|
|
208
208
|
}
|
|
209
209
|
toggle(force) {
|
|
210
|
-
toggleAttribute(
|
|
210
|
+
this.toggleAttribute("odx-active", force ?? !this.hasAttribute("odx-active"));
|
|
211
211
|
}
|
|
212
212
|
connectedCallback() {
|
|
213
213
|
super.connectedCallback();
|
|
@@ -319,11 +319,13 @@ class ListboxFormControl extends FormControl(CustomElement) {
|
|
|
319
319
|
updateValue(option) {
|
|
320
320
|
if (this.multiple) {
|
|
321
321
|
const value = typeof this.value === "string" ? [this.value].filter(Boolean) : this.value;
|
|
322
|
-
this.value = option
|
|
322
|
+
this.value = option?.selected ? [...value, option.value] : value.filter((value2) => value2 !== option?.value);
|
|
323
323
|
} else {
|
|
324
|
-
this.value = option
|
|
324
|
+
this.value = option?.selected ? option.value : "";
|
|
325
|
+
}
|
|
326
|
+
if (option) {
|
|
327
|
+
this.#activeDecendants.select(option);
|
|
325
328
|
}
|
|
326
|
-
this.#activeDecendants.select(option);
|
|
327
329
|
this.updateSelection();
|
|
328
330
|
this.emit("change");
|
|
329
331
|
}
|
|
@@ -912,7 +914,7 @@ __decorateClass$1([
|
|
|
912
914
|
property({ reflect: true })
|
|
913
915
|
], PopoverHost.prototype, "placement", 2);
|
|
914
916
|
|
|
915
|
-
const styles = ":host{--_arrow-size: var(--odx-size-50);--_outer-padding: var(--odx-size-75);--_border-radius: var(--odx-popover-border-radius, var(--odx-border-radius-controls));display:flex;background-color:
|
|
917
|
+
const styles = ":host{--_arrow-size: var(--odx-size-50);--_outer-padding: var(--odx-size-75);--_border-radius: var(--odx-popover-border-radius, var(--odx-border-radius-controls));display:flex;background-color:var(--_popover-color-background);border-radius:var(--_border-radius);padding-block:var(--_outer-padding);box-shadow:var(--_popover-shadow)}[part~=content]{display:flex;flex-direction:column;position:relative;inset-block-start:0!important;inset-inline-start:0!important;block-size:fit-content;min-block-size:var(--_popover-min-block-size);max-block-size:100%;min-inline-size:var(--_popover-min-inline-size);max-inline-size:100%;color:var(--_popover-color-foreground);padding-inline:var(--_outer-padding);border-radius:inherit;z-index:2;overflow:auto;scrollbar-width:thin;scroll-behavior:smooth;scroll-padding-block:calc(var(--odx-size-150) + var(--_outer-padding))}[part~=arrow]{background-color:inherit;border-radius:var(--odx-border-radius-sm);position:absolute;inline-size:var(--_arrow-size);block-size:var(--_arrow-size);z-index:3;inset:0;transform:translate3d(var(--_popover-arrow-position-x),var(--_popover-arrow-position-y),0) rotate(45deg)}";
|
|
916
918
|
|
|
917
919
|
var __defProp = Object.defineProperty;
|
|
918
920
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { CustomElement } from '../../lib/main.js';
|
|
2
|
+
import { OdxAccordionHeader } from './accordion-header.js';
|
|
2
3
|
declare global {
|
|
3
4
|
interface HTMLElementTagNameMap {
|
|
4
5
|
'odx-accordion': OdxAccordion;
|
|
5
6
|
}
|
|
6
7
|
}
|
|
7
8
|
export declare class OdxAccordion extends CustomElement {
|
|
9
|
+
items: OdxAccordionHeader[];
|
|
10
|
+
controlPosition?: 'start';
|
|
8
11
|
multiple: boolean;
|
|
9
12
|
constructor();
|
|
13
|
+
toggleAll(force?: boolean, emitEvent?: boolean): void;
|
|
10
14
|
}
|
|
11
15
|
//# sourceMappingURL=accordion.d.ts.map
|
|
@@ -6,7 +6,6 @@ declare global {
|
|
|
6
6
|
'odx-button': OdxButton;
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
|
-
declare const OdxButton_base: import('../../lib/main.js').Constructor<import('../../lib/main.js').HasLoadingState> & typeof InteractiveElement;
|
|
10
9
|
/**
|
|
11
10
|
* A button is clickable text or an icon that triggers an action on the page or in the background.
|
|
12
11
|
* Depending on the action, content, and hierarchy, a button can be used on its own or grouped with
|
|
@@ -19,7 +18,7 @@ declare const OdxButton_base: import('../../lib/main.js').Constructor<import('..
|
|
|
19
18
|
* @slot suffix - Contains the button's icon or state indicator, e.g. a spinner.
|
|
20
19
|
* @slot - Contains button text
|
|
21
20
|
*/
|
|
22
|
-
export declare class OdxButton extends
|
|
21
|
+
export declare class OdxButton extends InteractiveElement {
|
|
23
22
|
#private;
|
|
24
23
|
static readonly formAssociated = true;
|
|
25
24
|
alignBadge?: ButtonBadgeAlign;
|
|
@@ -39,5 +38,4 @@ export declare class OdxButton extends OdxButton_base {
|
|
|
39
38
|
constructor();
|
|
40
39
|
protected render(): TemplateResult;
|
|
41
40
|
}
|
|
42
|
-
export {};
|
|
43
41
|
//# sourceMappingURL=button.d.ts.map
|
|
@@ -10,11 +10,14 @@ declare const OdxInput_base: import('../../lib/main.js').Constructor<import('../
|
|
|
10
10
|
export declare class OdxInput extends OdxInput_base {
|
|
11
11
|
#private;
|
|
12
12
|
static readonly formAssociated = true;
|
|
13
|
+
private focusableElement;
|
|
14
|
+
block: boolean;
|
|
13
15
|
clearable: boolean;
|
|
14
16
|
placeholder: string;
|
|
15
17
|
type: HTMLInputElement['type'];
|
|
16
18
|
variant?: InputVariant | null;
|
|
17
19
|
clear(): void;
|
|
20
|
+
focus(): void;
|
|
18
21
|
protected render(): TemplateResult;
|
|
19
22
|
}
|
|
20
23
|
export {};
|
|
@@ -9,10 +9,13 @@ declare global {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class OdxSelect extends ListboxFormControl<OptionControl> {
|
|
11
11
|
#private;
|
|
12
|
+
private focusableElement;
|
|
12
13
|
protected options: OdxOption[];
|
|
13
14
|
protected readonly dropdown: OdxDropdown;
|
|
14
15
|
maxVisibleSelectedOptions: number;
|
|
15
16
|
constructor();
|
|
17
|
+
clear(): void;
|
|
18
|
+
focus(): void;
|
|
16
19
|
protected render(): TemplateResult;
|
|
17
20
|
protected renderSelectedOptions(): TemplateResult;
|
|
18
21
|
}
|