@odx/foundation 1.0.0-beta.44 → 1.0.0-beta.46
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/components.js +30 -10
- package/dist/main.js +22 -39
- package/dist/styles.css +1 -1
- package/dist/types/components/combobox/autocomplete.d.ts +1 -1
- package/dist/types/components/stack/stack.d.ts +25 -2
- package/dist/types/lib/interactive/interactive-element.d.ts +1 -1
- package/dist/types/lib/interactive/interactive-link.d.ts +1 -1
- package/dist/types/lib/main.d.ts +1 -4
- package/dist/types/lib/mixins/can-be-selected.d.ts +1 -2
- package/dist/types/lib/popover/popover.utils.d.ts +1 -2
- package/dist/types/lib/utils/dom.d.ts +7 -0
- package/dist/types/lib/utils/types.d.ts +57 -0
- package/package.json +13 -5
- package/dist/types/components/stack/stack.models.d.ts +0 -26
- package/dist/types/lib/utils/a11y.d.ts +0 -58
- package/dist/types/lib/utils/date.d.ts +0 -2
- package/dist/types/lib/utils/query-assigned-element.d.ts +0 -16
package/dist/components.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CanBeExpanded, InteractiveElement, getUniqueId, toAriaBooleanAttribute, customElement, requestUpdateOnAriaChange, CustomElement, ExpandableItemManager, enumFrom, Size, Variant, optionalAttr, InteractiveLink, createIntersectionObserver, createMutationObserver, getElementFromEvent, Shape, CanBeDisabled, optionalSlot, CheckboxGroupFormControl, CheckboxFormControl, toggleAttribute, SharedResizeObserver, PopoverPlacement, PopoverHost, getKeyboardEventInfo, PopoverPlacementOptions, searchTextContent, FormControl, ActiveDescendantsController,
|
|
1
|
+
import { CanBeExpanded, InteractiveElement, getUniqueId, toAriaBooleanAttribute, customElement, requestUpdateOnAriaChange, CustomElement, ExpandableItemManager, enumFrom, Size, Variant, optionalAttr, InteractiveLink, createIntersectionObserver, createMutationObserver, getElementFromEvent, Shape, CanBeDisabled, optionalSlot, CheckboxGroupFormControl, CheckboxFormControl, toggleAttribute, SharedResizeObserver, PopoverPlacement, PopoverHost, getKeyboardEventInfo, PopoverPlacementOptions, searchTextContent, FormControl, ActiveDescendantsController, getAssignedElement, parseDate, waitForAnimations, forwardEvent, CanBeSelected, WithLoadingState, FocusTrapController, OptionControl, toPx, RadioGroupFormControl, ListboxFormControl, IsDraggable, NumberControl, IS_DRAG_ACTIVE_ATTRIBUTE, DragController } from '@odx/foundation';
|
|
2
2
|
import { html, isServer, css, nothing } from 'lit';
|
|
3
3
|
import { property, queryAssignedElements, state, queryAll, query } from 'lit/decorators.js';
|
|
4
4
|
import { when } from 'lit/directives/when.js';
|
|
@@ -45,7 +45,7 @@ let OdxAccordionHeader = class extends CanBeExpanded(InteractiveElement) {
|
|
|
45
45
|
renderContent() {
|
|
46
46
|
return html`
|
|
47
47
|
${super.renderContent()}
|
|
48
|
-
<odx-icon part="indicator" name="core::chevron-down"
|
|
48
|
+
<odx-icon part="indicator" name="core::chevron-down"></odx-icon>
|
|
49
49
|
`;
|
|
50
50
|
}
|
|
51
51
|
willUpdate(props) {
|
|
@@ -147,7 +147,7 @@ OdxAccordion = __decorateClass$1l([
|
|
|
147
147
|
customElement("odx-accordion", [styles$1b])
|
|
148
148
|
], OdxAccordion);
|
|
149
149
|
|
|
150
|
-
const styles$1a = "@layer base{:host{--_padding-inline: var(--odx-size-75);--_icon-margin: calc(-.5 * (var(--_icon-size) - var(--_padding-inline)) - var(--odx-size-px))}:host,[part=base]{place-content:center}[part~=base]{font-weight:var(--odx-typography-font-weight-medium);outline-offset:var(--odx-focus-ring-offset)
|
|
150
|
+
const styles$1a = "@layer base{:host{--_padding-inline: var(--odx-size-75);--_icon-margin: calc(-.5 * (var(--_icon-size) - var(--_padding-inline)) - var(--odx-size-px))}:host,[part=base]{place-content:center}[part~=base]{font-weight:var(--odx-typography-font-weight-medium);outline-offset:var(--odx-focus-ring-offset)}[part=label]{flex:initial}::slotted(odx-avatar){--_color-foreground: inherit}}@layer variant{:host([size=\"xs\"]){--odx-focus-ring-offset: 0;--_block-size: var(--odx-size-150);--_padding-inline: var(--odx-size-50);--_font-size: var(--odx-typography-font-size-1);--_icon-size: var(--odx-typography-font-size-4);::slotted(odx-avatar){--_size: var(--odx-size-125);--_font-size: var(--odx-typography-font-size-1);--_spacing: calc(var(--odx-size-37) + var(--odx-size-px))}}:host([size=\"sm\"]){--odx-focus-ring-offset: 0;--_block-size: var(--odx-size-200);--_icon-margin: calc(-1 * var(--odx-size-25) + var(--odx-size-px));--_padding-inline: var(--odx-size-37);--_font-size: var(--odx-typography-font-size-2);--_icon-size: var(--odx-size-150);::slotted(odx-avatar){--_size: var(--odx-size-175);--_font-size: var(--odx-typography-font-size-2);--_spacing: calc(var(--odx-size-25) + var(--odx-size-px))}}:host([size=\"lg\"]){--_block-size: var(--odx-size-300);--_padding-inline: var(--odx-size-100);--_font-size: var(--odx-typography-font-size-4);--_icon-size: var(--odx-typography-font-size-6);--_margin-block: 0;::slotted(odx-avatar){--_size: var(--odx-size-250);--_font-size: var(--odx-typography-font-size-3);--_spacing: calc(var(--odx-size-75) + var(--odx-size-px))}}:host,:host([variant=\"neutral\"]){--_color-background: var(--odx-experience-color-secondary-rest);--_color-background-hover: var(--odx-experience-color-secondary-hover);--_color-background-pressed: var(--odx-experience-color-secondary-pressed);--_color-foreground: var(--odx-experience-color-secondary-foreground)}:host([variant=\"primary\"]){--_color-background: var(--odx-color-primary-rest);--_color-background-hover: var(--odx-color-primary-hover);--_color-background-pressed: var(--odx-color-primary-pressed);--_color-foreground: var(--odx-color-foreground-inverse)}:host([variant=\"accent\"]){--_color-background: var(--odx-color-highlight-rest);--_color-background-hover: var(--odx-color-highlight-hover);--_color-background-pressed: var(--odx-color-highlight-pressed);--_color-foreground: var(--odx-color-foreground-inverse)}:host([variant=\"danger\"]){--_color-background: var(--odx-color-danger-rest);--_color-background-hover: var(--odx-color-danger-hover);--_color-background-pressed: var(--odx-color-danger-pressed);--_color-foreground: var(--odx-color-foreground-light)}:host([variant=\"ghost\"]){--_color-background: var(--odx-color-transparent);--_color-foreground: var(--odx-color-foreground-base);--_color-background-hover: var(--odx-color-transparent-hover);--_color-background-pressed: var(--odx-color-transparent-pressed)}}";
|
|
151
151
|
|
|
152
152
|
var __defProp$1k = Object.defineProperty;
|
|
153
153
|
var __getOwnPropDesc$1k = Object.getOwnPropertyDescriptor;
|
|
@@ -1411,6 +1411,9 @@ let OdxAutocomplete = class extends CanBeDisabled(FormControl(CustomElement)) {
|
|
|
1411
1411
|
}
|
|
1412
1412
|
});
|
|
1413
1413
|
}
|
|
1414
|
+
get control() {
|
|
1415
|
+
return getAssignedElement(this, { slot: "control" });
|
|
1416
|
+
}
|
|
1414
1417
|
get controlValue() {
|
|
1415
1418
|
return this.control?.value ?? "";
|
|
1416
1419
|
}
|
|
@@ -1441,7 +1444,7 @@ handleControlValueChange_fn = function(value) {
|
|
|
1441
1444
|
this.highlight.query = this.control.value;
|
|
1442
1445
|
let activeOptionIndex;
|
|
1443
1446
|
let selectedValue = "";
|
|
1444
|
-
const allOptionsHidden = this.options.reduce((
|
|
1447
|
+
const allOptionsHidden = this.options.reduce((state, option, index) => {
|
|
1445
1448
|
option.hidden = !this.searchFn(option, this.controlValue);
|
|
1446
1449
|
option.selected = option.label === this.controlValue;
|
|
1447
1450
|
if (!option.hidden && activeOptionIndex === void 0) {
|
|
@@ -1450,7 +1453,7 @@ handleControlValueChange_fn = function(value) {
|
|
|
1450
1453
|
if (option.selected) {
|
|
1451
1454
|
selectedValue = option.value;
|
|
1452
1455
|
}
|
|
1453
|
-
return
|
|
1456
|
+
return state && option.hidden;
|
|
1454
1457
|
}, true);
|
|
1455
1458
|
if (allOptionsHidden) {
|
|
1456
1459
|
this.dropdown.hidePopover();
|
|
@@ -1470,10 +1473,6 @@ _handleControlFocusOut = new WeakMap();
|
|
|
1470
1473
|
_handleControlClear = new WeakMap();
|
|
1471
1474
|
_handleControlInput = new WeakMap();
|
|
1472
1475
|
_handleControlKeyboardEvent = new WeakMap();
|
|
1473
|
-
__decorateClass$12([
|
|
1474
|
-
state(),
|
|
1475
|
-
queryAssignedElement({ slot: "control" })
|
|
1476
|
-
], OdxAutocomplete.prototype, "control", 2);
|
|
1477
1476
|
__decorateClass$12([
|
|
1478
1477
|
queryAssignedElements({ selector: '[role="option"]', flatten: true })
|
|
1479
1478
|
], OdxAutocomplete.prototype, "options", 2);
|
|
@@ -4370,6 +4369,27 @@ var __decorateClass$g = (decorators, target, key, kind) => {
|
|
|
4370
4369
|
if (kind && result) __defProp$g(target, key, result);
|
|
4371
4370
|
return result;
|
|
4372
4371
|
};
|
|
4372
|
+
const StackAlign = {
|
|
4373
|
+
START: "start",
|
|
4374
|
+
CENTER: "center",
|
|
4375
|
+
END: "end"
|
|
4376
|
+
};
|
|
4377
|
+
const StackGap = {
|
|
4378
|
+
NONE: "none",
|
|
4379
|
+
XS: "xs",
|
|
4380
|
+
SM: "sm",
|
|
4381
|
+
MD: "md",
|
|
4382
|
+
LG: "lg",
|
|
4383
|
+
XL: "xl"
|
|
4384
|
+
};
|
|
4385
|
+
const StackJustify = {
|
|
4386
|
+
START: "start",
|
|
4387
|
+
END: "end",
|
|
4388
|
+
CENTER: "center",
|
|
4389
|
+
SPACE_BETWEEN: "space-between",
|
|
4390
|
+
SPACE_AROUND: "space-around",
|
|
4391
|
+
SPACE_EVENLY: "space-evenly"
|
|
4392
|
+
};
|
|
4373
4393
|
let OdxStack = class extends CustomElement {
|
|
4374
4394
|
constructor() {
|
|
4375
4395
|
super(...arguments);
|
|
@@ -5233,4 +5253,4 @@ OdxVisuallyHidden = __decorateClass([
|
|
|
5233
5253
|
customElement("odx-visually-hidden", [styles])
|
|
5234
5254
|
], OdxVisuallyHidden);
|
|
5235
5255
|
|
|
5236
|
-
export { AnchorObserver, AreaHeaderSize, AvatarShape, AvatarSize, AvatarVariant, BadgeVariant, BaseFormat, ButtonBadgeAlign, ButtonSize, ButtonVariant, CheckboxGroupLayout, ChipVariant, CircularProgressBarSize, DropdownPlacement, HeadlineSize, InlineMessageVariant, KpiSize, KpiVariant, LOADING_OVERLAY_HOST_DIRECTIVE, LogoSize, ModalLayout, NavigationItemSize, OdxAccordion, OdxAccordionHeader, OdxAccordionPanel, OdxActionButton, OdxAnchorNavigation, OdxAreaHeader, OdxAutocomplete, OdxAvatar, OdxAvatarGroup, OdxBadge, OdxBreadcrumbs, OdxBreadcrumbsItem, OdxButton, OdxButtonGroup, OdxCard, OdxCheckbox, OdxCheckboxGroup, OdxChip, OdxCircularProgressBar, OdxContentBox, OdxDropdown, OdxFormField, OdxFormatBytes, OdxFormatDate, OdxFormatNumber, OdxHeader, OdxHeaderActions, OdxHeadline, OdxHighlight, OdxIconButton, OdxImage, OdxInlineMessage, OdxInput, OdxKpi, OdxLineClamp, OdxLink, OdxList, OdxListItem, OdxLoadingOverlay, OdxLoadingSpinner, OdxLogo, OdxMainMenu, OdxMainMenuButton, OdxMainMenuLink, OdxMainMenuSubtitle, OdxMainMenuTitle, OdxMenu, OdxMenuItem, OdxMenuLabel, OdxModal, OdxNavigationItem, OdxOption, OdxPage, OdxPageLayout, OdxPagination, OdxProgressBar, OdxRadioButton, OdxRadioGroup, OdxRailNavigation, OdxRelativeTime, OdxSearchBar, OdxSelect, OdxSeparator, OdxSkeleton, OdxSlider, OdxSliderHandle, OdxSliderMarks, OdxSpacer, OdxSpinbox, OdxStack, OdxStatus, OdxSwitch, OdxTable, OdxTableBody, OdxTableCell, OdxTableCheckboxCell, OdxTableHeader, OdxTableHeaderCell, OdxTableRow, OdxText, OdxTitle, OdxToast, OdxToggleButton, OdxToggleContent, OdxTooltip, OdxTranslate, OdxVisuallyHidden, PageAlignment, PageLayout, ProgressState, RadioGroupLayout, SearchBarBehavior, SearchEvent, SeparatorAlign, SkeletonShape, SkeletonSize, SliderLabelVisibility, SliderTrackVisibility, StatusVariant, TextSize, TextVariant, TitleSize, ToastVariant, TooltipPlacement, sliderContext, tableContext };
|
|
5256
|
+
export { AnchorObserver, AreaHeaderSize, AvatarShape, AvatarSize, AvatarVariant, BadgeVariant, BaseFormat, ButtonBadgeAlign, ButtonSize, ButtonVariant, CheckboxGroupLayout, ChipVariant, CircularProgressBarSize, DropdownPlacement, HeadlineSize, InlineMessageVariant, KpiSize, KpiVariant, LOADING_OVERLAY_HOST_DIRECTIVE, LogoSize, ModalLayout, NavigationItemSize, OdxAccordion, OdxAccordionHeader, OdxAccordionPanel, OdxActionButton, OdxAnchorNavigation, OdxAreaHeader, OdxAutocomplete, OdxAvatar, OdxAvatarGroup, OdxBadge, OdxBreadcrumbs, OdxBreadcrumbsItem, OdxButton, OdxButtonGroup, OdxCard, OdxCheckbox, OdxCheckboxGroup, OdxChip, OdxCircularProgressBar, OdxContentBox, OdxDropdown, OdxFormField, OdxFormatBytes, OdxFormatDate, OdxFormatNumber, OdxHeader, OdxHeaderActions, OdxHeadline, OdxHighlight, OdxIconButton, OdxImage, OdxInlineMessage, OdxInput, OdxKpi, OdxLineClamp, OdxLink, OdxList, OdxListItem, OdxLoadingOverlay, OdxLoadingSpinner, OdxLogo, OdxMainMenu, OdxMainMenuButton, OdxMainMenuLink, OdxMainMenuSubtitle, OdxMainMenuTitle, OdxMenu, OdxMenuItem, OdxMenuLabel, OdxModal, OdxNavigationItem, OdxOption, OdxPage, OdxPageLayout, OdxPagination, OdxProgressBar, OdxRadioButton, OdxRadioGroup, OdxRailNavigation, OdxRelativeTime, OdxSearchBar, OdxSelect, OdxSeparator, OdxSkeleton, OdxSlider, OdxSliderHandle, OdxSliderMarks, OdxSpacer, OdxSpinbox, OdxStack, OdxStatus, OdxSwitch, OdxTable, OdxTableBody, OdxTableCell, OdxTableCheckboxCell, OdxTableHeader, OdxTableHeaderCell, OdxTableRow, OdxText, OdxTitle, OdxToast, OdxToggleButton, OdxToggleContent, OdxTooltip, OdxTranslate, OdxVisuallyHidden, PageAlignment, PageLayout, ProgressState, RadioGroupLayout, SearchBarBehavior, SearchEvent, SeparatorAlign, SkeletonShape, SkeletonSize, SliderLabelVisibility, SliderTrackVisibility, StackAlign, StackGap, StackJustify, StatusVariant, TextSize, TextVariant, TitleSize, ToastVariant, TooltipPlacement, sliderContext, tableContext };
|
package/dist/main.js
CHANGED
|
@@ -6,7 +6,7 @@ import { createContext, ContextProvider, consume } from '@lit/context';
|
|
|
6
6
|
import { createFocusTrap } from 'focus-trap';
|
|
7
7
|
import { arrow, flip, computePosition, offset, shift, size, hide, autoUpdate } from '@floating-ui/dom';
|
|
8
8
|
import { when } from 'lit/directives/when.js';
|
|
9
|
-
export { effect } from '@lit-labs/preact-signals';
|
|
9
|
+
export { computed, effect } from '@lit-labs/preact-signals';
|
|
10
10
|
|
|
11
11
|
const Shape = {
|
|
12
12
|
CIRCLE: "circle",
|
|
@@ -38,7 +38,7 @@ const Variant = {
|
|
|
38
38
|
GHOST: "ghost"
|
|
39
39
|
};
|
|
40
40
|
|
|
41
|
-
const customElementStyles = "@layer reset,base,variant,state;@layer reset{:is(*){box-sizing:border-box;scrollbar-width:thin}:not(:defined){display:none}:before,:after{box-sizing:border-box}[popover]{border:none;outline:none}img,picture,video,canvas,svg{display:block;max-width:100%;margin:0}input,button,textarea,select{font:inherit;margin:0}p,h1,h2,h3,h4,h5,h6{overflow-wrap:break-word;margin:0}p{text-wrap:pretty}h1,h2,h3,h4,h5,h6{text-wrap:balance}}@layer base{odx-stack{display:block}.odx-stack{&.odx-stack-horizontal{flex-flow:row}&.odx-stack-wrap{flex-flow:column wrap}&.odx-stack-horizontal.odx-stack-wrap{flex-flow:row wrap}--flow: column;display:flex;flex-flow:var(--flow);max-inline-size:100%;align-items:stretch;justify-content:flex-start;gap:var(--odx-size-75);text-align:start}}@layer base{.odx-align-start{align-items:flex-start}.odx-align-center{align-items:center}.odx-align-end{align-items:end}.odx-justify-start{justify-content:flex-start}.odx-justify-end{justify-content:flex-end}.odx-justify-center{justify-content:center}.odx-justify-space-between{justify-content:space-between}.odx-justify-space-around{justify-content:space-around}.odx-justify-space-evenly{justify-content:space-evenly}}@layer base{.odx-gap-none{gap:0}.odx-gap-xs{gap:var(--odx-size-25)}.odx-gap-sm{gap:var(--odx-size-50)}.odx-gap-md{gap:var(--odx-size-75)}.odx-gap-lg{gap:var(--odx-size-150)}.odx-gap-xl{gap:var(--odx-size-225)}}@layer base{
|
|
41
|
+
const customElementStyles = "@layer reset,base,variant,state;@layer reset{:is(*){box-sizing:border-box;scrollbar-width:thin}:not(:defined){display:none}:before,:after{box-sizing:border-box}[popover]{border:none;outline:none}img,picture,video,canvas,svg{display:block;max-width:100%;margin:0}input,button,textarea,select{font:inherit;margin:0}p,h1,h2,h3,h4,h5,h6{overflow-wrap:break-word;margin:0}p{text-wrap:pretty}h1,h2,h3,h4,h5,h6{text-wrap:balance}}@layer base{odx-stack{display:block}.odx-stack{&.odx-stack-horizontal{flex-flow:row}&.odx-stack-wrap{flex-flow:column wrap}&.odx-stack-horizontal.odx-stack-wrap{flex-flow:row wrap}--flow: column;display:flex;flex-flow:var(--flow);max-inline-size:100%;align-items:stretch;justify-content:flex-start;gap:var(--odx-size-75);text-align:start}}@layer base{.odx-align-start{align-items:flex-start}.odx-align-center{align-items:center}.odx-align-end{align-items:end}.odx-justify-start{justify-content:flex-start}.odx-justify-end{justify-content:flex-end}.odx-justify-center{justify-content:center}.odx-justify-space-between{justify-content:space-between}.odx-justify-space-around{justify-content:space-around}.odx-justify-space-evenly{justify-content:space-evenly}}@layer base{.odx-gap-none{gap:0}.odx-gap-xs{gap:var(--odx-size-25)}.odx-gap-sm{gap:var(--odx-size-50)}.odx-gap-md{gap:var(--odx-size-75)}.odx-gap-lg{gap:var(--odx-size-150)}.odx-gap-xl{gap:var(--odx-size-225)}}@layer base{odx-icon{transition:var(--odx-transition-default);transition-property:transform}[odxPreventTextOverflow]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}odx-list-item:has(:is([odx-button],odx-list-item::part(control)):not([disabled]):active){--_color-background-pressed: var(--_color-background-hover)}[odx-button]:has(odx-icon:only-child),[odx-button]:has(odx-avatar:only-child){--_min-inline-size: 0}[indicator-position=start] odx-accordion-header::part(indicator){--rotate: -90deg;order:-1}[indicator-position=start] odx-accordion-header[expanded]::part(indicator){--rotate: 0}odx-input:has([slot=suffix])::part(base){padding-inline-end:var(--odx-size-px)}}@layer reset{:host{border:none;border-color:transparent;outline:none}}";
|
|
42
42
|
|
|
43
43
|
function mergeStyleSheets(...stylesheets) {
|
|
44
44
|
const mergedStyles = [];
|
|
@@ -92,6 +92,14 @@ function dedupeMixin(mixin) {
|
|
|
92
92
|
};
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
+
function parseDate(value) {
|
|
96
|
+
const date = new Date(value);
|
|
97
|
+
if (Number.isNaN(date.getTime()) && typeof value === "string") {
|
|
98
|
+
const timestamp = Number(value);
|
|
99
|
+
return Number.isNaN(timestamp) ? null : new Date(timestamp);
|
|
100
|
+
}
|
|
101
|
+
return Number.isNaN(date.getTime()) ? null : date;
|
|
102
|
+
}
|
|
95
103
|
function createMutationObserver(callback) {
|
|
96
104
|
try {
|
|
97
105
|
return new MutationObserver(callback);
|
|
@@ -153,6 +161,16 @@ function limit(fn, fpsLimit = 60) {
|
|
|
153
161
|
fn(...args);
|
|
154
162
|
};
|
|
155
163
|
}
|
|
164
|
+
function getAssignedElement(root, options) {
|
|
165
|
+
const { slot, selector } = options ?? {};
|
|
166
|
+
const slotSelector = `slot${slot ? `[name=${slot}]` : ":not([name])"}`;
|
|
167
|
+
const slotEl = root.querySelector(slotSelector);
|
|
168
|
+
const elements = slotEl?.assignedElements(options) ?? [];
|
|
169
|
+
if (selector == null) {
|
|
170
|
+
return elements[0];
|
|
171
|
+
}
|
|
172
|
+
return elements.find((node) => node.matches(selector));
|
|
173
|
+
}
|
|
156
174
|
|
|
157
175
|
var __defProp$f = Object.defineProperty;
|
|
158
176
|
var __getOwnPropDesc$f = Object.getOwnPropertyDescriptor;
|
|
@@ -1465,9 +1483,6 @@ const PopoverSide = {
|
|
|
1465
1483
|
LEFT: PopoverPlacement.LEFT
|
|
1466
1484
|
};
|
|
1467
1485
|
|
|
1468
|
-
function getPopoverSide(placement) {
|
|
1469
|
-
return placement.split("-")[0];
|
|
1470
|
-
}
|
|
1471
1486
|
async function computePopoverPlacement(referenceElement, floatingElement, options) {
|
|
1472
1487
|
const { arrowElement, placement, offset: offset$1, matchReferenceWidth, enableFallback, fallbackAxisSideDirection, minHeight, outerPadding } = options;
|
|
1473
1488
|
const arrowSize = arrowElement?.offsetWidth ?? 0;
|
|
@@ -1497,7 +1512,7 @@ async function computePopoverPlacement(referenceElement, floatingElement, option
|
|
|
1497
1512
|
let arrowPositionX = null;
|
|
1498
1513
|
let arrowPositionY = null;
|
|
1499
1514
|
if (arrowElement && result.middlewareData.arrow) {
|
|
1500
|
-
const popoverSide =
|
|
1515
|
+
const popoverSide = placement.split("-")[0];
|
|
1501
1516
|
const { arrow: arrow2 } = result.middlewareData;
|
|
1502
1517
|
const arrowOffsetX = popoverSide === PopoverSide.LEFT ? floatingElement.offsetWidth - outerPadding - 0.5 * arrowSize : outerPadding - 0.5 * arrowSize;
|
|
1503
1518
|
const arrowOffsetY = popoverSide === PopoverSide.TOP ? floatingElement.offsetHeight - outerPadding - 0.5 * arrowSize : outerPadding - 0.5 * arrowSize;
|
|
@@ -1673,38 +1688,6 @@ OdxPopover = __decorateClass([
|
|
|
1673
1688
|
customElement("odx-popover", [styles])
|
|
1674
1689
|
], OdxPopover);
|
|
1675
1690
|
|
|
1676
|
-
function parseDate(value) {
|
|
1677
|
-
const date = new Date(value);
|
|
1678
|
-
if (Number.isNaN(date.getTime()) && typeof value === "string") {
|
|
1679
|
-
const timestamp = Number(value);
|
|
1680
|
-
return Number.isNaN(timestamp) ? null : new Date(timestamp);
|
|
1681
|
-
}
|
|
1682
|
-
return Number.isNaN(date.getTime()) ? null : date;
|
|
1683
|
-
}
|
|
1684
|
-
|
|
1685
|
-
function queryAssignedElement(options) {
|
|
1686
|
-
return (obj, name) => {
|
|
1687
|
-
const { slot, selector } = options ?? {};
|
|
1688
|
-
const slotSelector = `slot${slot ? `[name=${slot}]` : ":not([name])"}`;
|
|
1689
|
-
const descriptor = {
|
|
1690
|
-
configurable: true,
|
|
1691
|
-
enumerable: true,
|
|
1692
|
-
get() {
|
|
1693
|
-
const slotEl = this.renderRoot?.querySelector(slotSelector);
|
|
1694
|
-
const elements = slotEl?.assignedElements(options) ?? [];
|
|
1695
|
-
if (selector == null) {
|
|
1696
|
-
return elements[0];
|
|
1697
|
-
}
|
|
1698
|
-
return elements.find((node) => node.matches(selector));
|
|
1699
|
-
}
|
|
1700
|
-
};
|
|
1701
|
-
if (Reflect.decorate && typeof name !== "object") {
|
|
1702
|
-
Object.defineProperty(obj, name, descriptor);
|
|
1703
|
-
}
|
|
1704
|
-
return descriptor;
|
|
1705
|
-
};
|
|
1706
|
-
}
|
|
1707
|
-
|
|
1708
1691
|
function search(value, searchString, callback) {
|
|
1709
1692
|
let index = 0;
|
|
1710
1693
|
while (index < value.length) {
|
|
@@ -1809,4 +1792,4 @@ class SharedResizeObserverInstance {
|
|
|
1809
1792
|
}
|
|
1810
1793
|
const SharedResizeObserver = new SharedResizeObserverInstance();
|
|
1811
1794
|
|
|
1812
|
-
export { ActiveDescendant, ActiveDescendantsController, ActiveDescendantsControllerOptions, CanBeDisabled, CanBeExpanded, CanBeSelected, CheckboxFormControl, CheckboxGroupFormControl, CustomElement, DisabledContext, DisabledContextProvider, DragController, DragControllerOptions, ExpandableItemManager, ExpandableItemManagerOptions, FocusTrapController, FocusTrapControllerOptions, FormControl, IS_DRAG_ACTIVE_ATTRIBUTE, InteractiveElement, InteractiveLink, IsDraggable, KeyboardKey, ListboxFormControl, NumberControl, OdxPopover, OptionControl, PopoverHost, PopoverPlacement, PopoverPlacementOptions, PopoverSide, RadioGroupFormControl, Shape, SharedIntersectionObserver, SharedResizeObserver, Size, State, Variant, WithLoadingState, clearUniqueIdCache, createIntersectionObserver, createMutationObserver, createResizeObserver, customElement, dedupeMixin, findClosestDocument, forwardEvent, fromAriaBooleanAttribute, getElementFromEvent, getKeyboardEventInfo, getUniqueId, isDraggableElement, limit, optionalAttr, optionalSlot, parseDate,
|
|
1795
|
+
export { ActiveDescendant, ActiveDescendantsController, ActiveDescendantsControllerOptions, CanBeDisabled, CanBeExpanded, CanBeSelected, CheckboxFormControl, CheckboxGroupFormControl, CustomElement, DisabledContext, DisabledContextProvider, DragController, DragControllerOptions, ExpandableItemManager, ExpandableItemManagerOptions, FocusTrapController, FocusTrapControllerOptions, FormControl, IS_DRAG_ACTIVE_ATTRIBUTE, InteractiveElement, InteractiveLink, IsDraggable, KeyboardKey, ListboxFormControl, NumberControl, OdxPopover, OptionControl, PopoverHost, PopoverPlacement, PopoverPlacementOptions, PopoverSide, RadioGroupFormControl, Shape, SharedIntersectionObserver, SharedResizeObserver, Size, State, Variant, WithLoadingState, clearUniqueIdCache, createIntersectionObserver, createMutationObserver, createResizeObserver, customElement, dedupeMixin, findClosestDocument, forwardEvent, fromAriaBooleanAttribute, getAssignedElement, getElementFromEvent, getKeyboardEventInfo, getUniqueId, isDraggableElement, limit, optionalAttr, optionalSlot, parseDate, requestUpdateOnAriaChange, searchTextContent, toAriaBooleanAttribute, toPx, toggleAttribute, waitForAnimations };
|
package/dist/styles.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer reset,base,variant,state,theme;@layer reset{:is(*){box-sizing:border-box;scrollbar-width:thin}:not(:defined){display:none}:before,:after{box-sizing:border-box}[popover]{border:none;outline:none}img,picture,video,canvas,svg{display:block;max-width:100%;margin:0}input,button,textarea,select{font:inherit;margin:0}p,h1,h2,h3,h4,h5,h6{overflow-wrap:break-word;margin:0}p{text-wrap:pretty}h1,h2,h3,h4,h5,h6{text-wrap:balance}}@layer base{odx-stack{display:block}.odx-stack{&.odx-stack-horizontal{flex-flow:row}&.odx-stack-wrap{flex-flow:column wrap}&.odx-stack-horizontal.odx-stack-wrap{flex-flow:row wrap}--flow: column;display:flex;flex-flow:var(--flow);max-inline-size:100%;align-items:stretch;justify-content:flex-start;gap:var(--odx-size-75);text-align:start}}@layer base{.odx-align-start{align-items:flex-start}.odx-align-center{align-items:center}.odx-align-end{align-items:end}.odx-justify-start{justify-content:flex-start}.odx-justify-end{justify-content:flex-end}.odx-justify-center{justify-content:center}.odx-justify-space-between{justify-content:space-between}.odx-justify-space-around{justify-content:space-around}.odx-justify-space-evenly{justify-content:space-evenly}}@layer base{.odx-gap-none{gap:0}.odx-gap-xs{gap:var(--odx-size-25)}.odx-gap-sm{gap:var(--odx-size-50)}.odx-gap-md{gap:var(--odx-size-75)}.odx-gap-lg{gap:var(--odx-size-150)}.odx-gap-xl{gap:var(--odx-size-225)}}@layer base{h1,h2,h3,h4,h5,h6{display:block;font-family:var(--odx-typography-font-family-brand);font-size:var(--_font-size);font-weight:var(--odx-typography-font-weight-semibold);line-height:var(--_line-height)}h6{--_font-size: var(--odx-breakpoint-font-size-heading-6);--_line-height: var(--odx-breakpoint-line-height-heading-6)}h5{--_font-size: var(--odx-breakpoint-font-size-heading-5);--_line-height: var(--odx-breakpoint-line-height-heading-5)}h4{--_font-size: var(--odx-breakpoint-font-size-heading-4);--_line-height: var(--odx-breakpoint-line-height-heading-4)}h3{--_font-size: var(--odx-breakpoint-font-size-heading-3);--_line-height: var(--odx-breakpoint-line-height-heading-3)}h2{--_font-size: var(--odx-breakpoint-font-size-heading-2);--_line-height: var(--odx-breakpoint-line-height-heading-2)}h1{--_font-size: var(--odx-breakpoint-font-size-heading-1);--_line-height: var(--odx-breakpoint-line-height-heading-1)}
|
|
1
|
+
@layer reset,base,variant,state,theme;@layer reset{:is(*){box-sizing:border-box;scrollbar-width:thin}:not(:defined){display:none}:before,:after{box-sizing:border-box}[popover]{border:none;outline:none}img,picture,video,canvas,svg{display:block;max-width:100%;margin:0}input,button,textarea,select{font:inherit;margin:0}p,h1,h2,h3,h4,h5,h6{overflow-wrap:break-word;margin:0}p{text-wrap:pretty}h1,h2,h3,h4,h5,h6{text-wrap:balance}}@layer base{odx-stack{display:block}.odx-stack{&.odx-stack-horizontal{flex-flow:row}&.odx-stack-wrap{flex-flow:column wrap}&.odx-stack-horizontal.odx-stack-wrap{flex-flow:row wrap}--flow: column;display:flex;flex-flow:var(--flow);max-inline-size:100%;align-items:stretch;justify-content:flex-start;gap:var(--odx-size-75);text-align:start}}@layer base{.odx-align-start{align-items:flex-start}.odx-align-center{align-items:center}.odx-align-end{align-items:end}.odx-justify-start{justify-content:flex-start}.odx-justify-end{justify-content:flex-end}.odx-justify-center{justify-content:center}.odx-justify-space-between{justify-content:space-between}.odx-justify-space-around{justify-content:space-around}.odx-justify-space-evenly{justify-content:space-evenly}}@layer base{.odx-gap-none{gap:0}.odx-gap-xs{gap:var(--odx-size-25)}.odx-gap-sm{gap:var(--odx-size-50)}.odx-gap-md{gap:var(--odx-size-75)}.odx-gap-lg{gap:var(--odx-size-150)}.odx-gap-xl{gap:var(--odx-size-225)}}@layer base{odx-icon{transition:var(--odx-transition-default);transition-property:transform}[odxPreventTextOverflow]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}odx-list-item:has(:is([odx-button],odx-list-item::part(control)):not([disabled]):active){--_color-background-pressed: var(--_color-background-hover)}[odx-button]:has(odx-icon:only-child),[odx-button]:has(odx-avatar:only-child){--_min-inline-size: 0}[indicator-position=start] odx-accordion-header::part(indicator){--rotate: -90deg;order:-1}[indicator-position=start] odx-accordion-header[expanded]::part(indicator){--rotate: 0}odx-input:has([slot=suffix])::part(base){padding-inline-end:var(--odx-size-px)}}@layer base{h1,h2,h3,h4,h5,h6{display:block;font-family:var(--odx-typography-font-family-brand);font-size:var(--_font-size);font-weight:var(--odx-typography-font-weight-semibold);line-height:var(--_line-height)}h6{--_font-size: var(--odx-breakpoint-font-size-heading-6);--_line-height: var(--odx-breakpoint-line-height-heading-6)}h5{--_font-size: var(--odx-breakpoint-font-size-heading-5);--_line-height: var(--odx-breakpoint-line-height-heading-5)}h4{--_font-size: var(--odx-breakpoint-font-size-heading-4);--_line-height: var(--odx-breakpoint-line-height-heading-4)}h3{--_font-size: var(--odx-breakpoint-font-size-heading-3);--_line-height: var(--odx-breakpoint-line-height-heading-3)}h2{--_font-size: var(--odx-breakpoint-font-size-heading-2);--_line-height: var(--odx-breakpoint-line-height-heading-2)}h1{--_font-size: var(--odx-breakpoint-font-size-heading-1);--_line-height: var(--odx-breakpoint-line-height-heading-1)}}@layer base{:root{--odx-transition-default: all var(--odx-motion-duration-default) var(--odx-motion-easing-default);--odx-transition-slow: all var(--odx-motion-duration-slow) var(--odx-motion-easing-default);--odx-transition-reduced: all var(--odx-motion-duration-fast) var(--odx-motion-easing-reduced);--odx-page-max-inline-size: 1600px;--odx-page-max-inline-size-narrow: 1200px;--odx-page-max-inline-size-wide: 2400px;scrollbar-color:var(--odx-color-primary-rest) var(--odx-palette-transparent)}html,body{margin:0;padding:0}html{scroll-behavior:smooth}body{color:var(--odx-color-foreground-base);background-color:var(--odx-color-background-cool);font-family:var(--odx-typography-font-family-base),"Noto Sans","Kanit",sans-serif;font-size:var(--odx-typography-font-size-base);line-height:var(--odx-typography-line-height-base)}}
|
|
@@ -11,12 +11,12 @@ declare const OdxAutocomplete_base: import('../../lib/main.js').Constructor<CanB
|
|
|
11
11
|
export declare class OdxAutocomplete extends OdxAutocomplete_base {
|
|
12
12
|
#private;
|
|
13
13
|
protected readonly activeDescendants: ActiveDescendantsController<OptionControl>;
|
|
14
|
-
protected control?: HTMLInputElement | HTMLButtonElement;
|
|
15
14
|
protected options: OptionControl[];
|
|
16
15
|
protected readonly highlight: OdxHighlight;
|
|
17
16
|
protected readonly dropdown: OdxDropdown;
|
|
18
17
|
minQueryLength: number;
|
|
19
18
|
searchFn: (option: OptionControl, query?: string) => boolean;
|
|
19
|
+
get control(): HTMLInputElement | undefined;
|
|
20
20
|
get controlValue(): string;
|
|
21
21
|
firstUpdated(props: PropertyValues<this>): void;
|
|
22
22
|
protected render(): TemplateResult;
|
|
@@ -1,11 +1,34 @@
|
|
|
1
|
-
import { CustomElement } from '../../lib/main.js';
|
|
1
|
+
import { CustomElement, EnumString } from '../../lib/main.js';
|
|
2
2
|
import { PropertyValues } from 'lit';
|
|
3
|
-
import { StackAlign, StackGap, StackJustify } from './stack.models.js';
|
|
4
3
|
declare global {
|
|
5
4
|
interface HTMLElementTagNameMap {
|
|
6
5
|
'odx-stack': OdxStack;
|
|
7
6
|
}
|
|
8
7
|
}
|
|
8
|
+
export type StackAlign = EnumString<typeof StackAlign>;
|
|
9
|
+
export declare const StackAlign: {
|
|
10
|
+
readonly START: "start";
|
|
11
|
+
readonly CENTER: "center";
|
|
12
|
+
readonly END: "end";
|
|
13
|
+
};
|
|
14
|
+
export type StackGap = EnumString<typeof StackGap>;
|
|
15
|
+
export declare const StackGap: {
|
|
16
|
+
readonly NONE: "none";
|
|
17
|
+
readonly XS: "xs";
|
|
18
|
+
readonly SM: "sm";
|
|
19
|
+
readonly MD: "md";
|
|
20
|
+
readonly LG: "lg";
|
|
21
|
+
readonly XL: "xl";
|
|
22
|
+
};
|
|
23
|
+
export type StackJustify = EnumString<typeof StackJustify>;
|
|
24
|
+
export declare const StackJustify: {
|
|
25
|
+
readonly START: "start";
|
|
26
|
+
readonly END: "end";
|
|
27
|
+
readonly CENTER: "center";
|
|
28
|
+
readonly SPACE_BETWEEN: "space-between";
|
|
29
|
+
readonly SPACE_AROUND: "space-around";
|
|
30
|
+
readonly SPACE_EVENLY: "space-evenly";
|
|
31
|
+
};
|
|
9
32
|
export declare class OdxStack extends CustomElement {
|
|
10
33
|
align?: StackAlign;
|
|
11
34
|
justify?: StackJustify;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TemplateResult } from 'lit';
|
|
2
2
|
import { InteractiveLink } from './interactive-link.js';
|
|
3
|
-
declare const InteractiveElement_base: import('../
|
|
3
|
+
declare const InteractiveElement_base: import('../utils/types.js').Constructor<import('../mixins/with-loading-state.js').HasLoadingState> & typeof InteractiveLink;
|
|
4
4
|
/**
|
|
5
5
|
* A button is clickable text or an icon that triggers an action on the page or in the background.
|
|
6
6
|
* Depending on the action, content, and hierarchy, a button can be used on its own or grouped with
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TemplateResult } from 'lit';
|
|
2
2
|
import { CustomElement } from '../custom-element.js';
|
|
3
3
|
import { CanBeDisabled } from '../mixins/can-be-disabled.js';
|
|
4
|
-
declare const InteractiveLink_base: import('../
|
|
4
|
+
declare const InteractiveLink_base: import('../utils/types.js').Constructor<CanBeDisabled> & typeof CustomElement;
|
|
5
5
|
export declare class InteractiveLink extends InteractiveLink_base {
|
|
6
6
|
static shadowRootOptions: ShadowRootInit;
|
|
7
7
|
readonly nativeElement: HTMLElement;
|
package/dist/types/lib/main.d.ts
CHANGED
|
@@ -26,19 +26,16 @@ export * from './popover/popover-host.js';
|
|
|
26
26
|
export * from './popover/popover.js';
|
|
27
27
|
export * from './popover/popover.models.js';
|
|
28
28
|
export * from './custom-element.js';
|
|
29
|
-
export * from './utils/a11y.js';
|
|
30
|
-
export * from './utils/date.js';
|
|
31
29
|
export * from './utils/dedupe-mixin.js';
|
|
32
30
|
export * from './utils/dom.js';
|
|
33
31
|
export * from './utils/get-unique-id.js';
|
|
34
32
|
export * from './utils/keyboard-events.js';
|
|
35
33
|
export * from './utils/lit.js';
|
|
36
|
-
export * from './utils/query-assigned-element.js';
|
|
37
34
|
export * from './utils/search-text-content.js';
|
|
38
35
|
export * from './utils/shared-intersection-observer.js';
|
|
39
36
|
export * from './utils/shared-resize-observer.js';
|
|
40
37
|
export * from './utils/types.js';
|
|
41
|
-
export { effect } from '@lit-labs/preact-signals';
|
|
38
|
+
export { computed, effect } from '@lit-labs/preact-signals';
|
|
42
39
|
export { pick as enumFrom } from 'es-toolkit/object';
|
|
43
40
|
declare global {
|
|
44
41
|
export interface HighlightRegistry {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { CustomElement } from '../custom-element.js';
|
|
2
|
-
import { ARIAMixinStrict } from '../utils/
|
|
3
|
-
import { Constructor } from '../utils/types.js';
|
|
2
|
+
import { ARIAMixinStrict, Constructor } from '../utils/types.js';
|
|
4
3
|
export interface CanBeSelected {
|
|
5
4
|
selected: boolean;
|
|
6
5
|
ariaSelectedValue: ARIAMixinStrict['ariaCurrent'];
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { FloatingElement, ReferenceElement } from '@floating-ui/dom';
|
|
2
|
-
import {
|
|
3
|
-
export declare function getPopoverSide(placement: PopoverPlacement): PopoverSide;
|
|
2
|
+
import { PopoverPlacementOptions } from './popover.models.js';
|
|
4
3
|
export declare function computePopoverPlacement(referenceElement: ReferenceElement, floatingElement: FloatingElement, options: PopoverPlacementOptions): Promise<void>;
|
|
5
4
|
//# sourceMappingURL=popover.utils.d.ts.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export declare function parseDate(value: number | string | Date): Date | null;
|
|
1
2
|
/**
|
|
2
3
|
* Creates a new MutationObserver instance.
|
|
3
4
|
*
|
|
@@ -14,4 +15,10 @@ export declare function toAriaBooleanAttribute(value: boolean, removeOnFalse?: b
|
|
|
14
15
|
export declare function fromAriaBooleanAttribute(value?: string | null): boolean;
|
|
15
16
|
export declare function toPx(value?: string | number | null): string | null;
|
|
16
17
|
export declare function limit<T extends CallableFunction = () => void>(fn: T, fpsLimit?: number): T;
|
|
18
|
+
export interface GetAssignedElementOptions {
|
|
19
|
+
slot?: string;
|
|
20
|
+
selector?: string;
|
|
21
|
+
flatten?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export declare function getAssignedElement<T = HTMLElement>(root: Element, options?: GetAssignedElementOptions): T | undefined;
|
|
17
24
|
//# sourceMappingURL=dom.d.ts.map
|
|
@@ -1,3 +1,60 @@
|
|
|
1
1
|
export declare type Constructor<T = any> = new (...args: any[]) => T;
|
|
2
2
|
export type EnumString<T extends object> = T[keyof T];
|
|
3
|
+
export type ARIARole = 'alert' | 'alertdialog' | 'button' | 'checkbox' | 'dialog' | 'gridcell' | 'link' | 'log' | 'marquee' | 'menuitem' | 'menuitemcheckbox' | 'menuitemradio' | 'option' | 'progressbar' | 'radio' | 'scrollbar' | 'searchbox' | 'slider' | 'spinbutton' | 'status' | 'switch' | 'tab' | 'tabpanel' | 'textbox' | 'timer' | 'tooltip' | 'treeitem' | 'combobox' | 'grid' | 'listbox' | 'menu' | 'menubar' | 'radiogroup' | 'tablist' | 'tree' | 'treegrid' | 'application' | 'article' | 'cell' | 'columnheader' | 'definition' | 'directory' | 'document' | 'feed' | 'figure' | 'group' | 'heading' | 'img' | 'list' | 'listitem' | 'math' | 'none' | 'note' | 'presentation' | 'region' | 'row' | 'rowgroup' | 'rowheader' | 'separator' | 'table' | 'term' | 'text' | 'toolbar' | 'banner' | 'complementary' | 'contentinfo' | 'form' | 'main' | 'navigation' | 'region' | 'search' | 'doc-abstract' | 'doc-acknowledgments' | 'doc-afterword' | 'doc-appendix' | 'doc-backlink' | 'doc-biblioentry' | 'doc-bibliography' | 'doc-biblioref' | 'doc-chapter' | 'doc-colophon' | 'doc-conclusion' | 'doc-cover' | 'doc-credit' | 'doc-credits' | 'doc-dedication' | 'doc-endnote' | 'doc-endnotes' | 'doc-epigraph' | 'doc-epilogue' | 'doc-errata' | 'doc-example' | 'doc-footnote' | 'doc-foreword' | 'doc-glossary' | 'doc-glossref' | 'doc-index' | 'doc-introduction' | 'doc-noteref' | 'doc-notice' | 'doc-pagebreak' | 'doc-pagelist' | 'doc-part' | 'doc-preface' | 'doc-prologue' | 'doc-pullquote' | 'doc-qna' | 'doc-subtitle' | 'doc-tip' | 'doc-toc';
|
|
4
|
+
/**
|
|
5
|
+
* An extension of `ARIAMixin` that enforces strict value types for aria
|
|
6
|
+
* properties.
|
|
7
|
+
*
|
|
8
|
+
* This is needed for correct typing in render functions with lit analyzer.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* render() {
|
|
12
|
+
* const {ariaLabel} = this as ARIAMixinStrict;
|
|
13
|
+
* return html`
|
|
14
|
+
* <button aria-label=${ariaLabel || nothing}>
|
|
15
|
+
* <slot></slot>
|
|
16
|
+
* </button>
|
|
17
|
+
* `;
|
|
18
|
+
* }
|
|
19
|
+
*/
|
|
20
|
+
export interface ARIAMixinStrict extends ARIAMixin {
|
|
21
|
+
ariaAtomic: 'true' | 'false' | null;
|
|
22
|
+
ariaAutoComplete: 'none' | 'inline' | 'list' | 'both' | null;
|
|
23
|
+
ariaBusy: 'true' | 'false' | null;
|
|
24
|
+
ariaChecked: 'true' | 'false' | null;
|
|
25
|
+
ariaColCount: `${number}` | null;
|
|
26
|
+
ariaColIndex: `${number}` | null;
|
|
27
|
+
ariaColSpan: `${number}` | null;
|
|
28
|
+
ariaCurrent: 'page' | 'step' | 'location' | 'date' | 'time' | 'true' | 'false' | null;
|
|
29
|
+
ariaDisabled: 'true' | 'false' | null;
|
|
30
|
+
ariaExpanded: 'true' | 'false' | null;
|
|
31
|
+
ariaHasPopup: 'false' | 'true' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog' | null;
|
|
32
|
+
ariaHidden: 'true' | 'false' | null;
|
|
33
|
+
ariaInvalid: 'true' | 'false' | null;
|
|
34
|
+
ariaKeyShortcuts: string | null;
|
|
35
|
+
ariaLabel: string | null;
|
|
36
|
+
ariaLevel: `${number}` | null;
|
|
37
|
+
ariaLive: 'assertive' | 'off' | 'polite' | null;
|
|
38
|
+
ariaModal: 'true' | 'false' | null;
|
|
39
|
+
ariaMultiLine: 'true' | 'false' | null;
|
|
40
|
+
ariaMultiSelectable: 'true' | 'false' | null;
|
|
41
|
+
ariaOrientation: 'horizontal' | 'vertical' | 'undefined' | null;
|
|
42
|
+
ariaPlaceholder: string | null;
|
|
43
|
+
ariaPosInSet: `${number}` | null;
|
|
44
|
+
ariaPressed: 'true' | 'false' | null;
|
|
45
|
+
ariaReadOnly: 'true' | 'false' | null;
|
|
46
|
+
ariaRequired: 'true' | 'false' | null;
|
|
47
|
+
ariaRoleDescription: string | null;
|
|
48
|
+
ariaRowCount: `${number}` | null;
|
|
49
|
+
ariaRowIndex: `${number}` | null;
|
|
50
|
+
ariaRowSpan: `${number}` | null;
|
|
51
|
+
ariaSelected: 'true' | 'false' | null;
|
|
52
|
+
ariaSetSize: `${number}` | null;
|
|
53
|
+
ariaSort: 'ascending' | 'descending' | 'none' | 'other' | null;
|
|
54
|
+
ariaValueMax: `${number}` | null;
|
|
55
|
+
ariaValueMin: `${number}` | null;
|
|
56
|
+
ariaValueNow: `${number}` | null;
|
|
57
|
+
ariaValueText: string | null;
|
|
58
|
+
role: ARIARole | null;
|
|
59
|
+
}
|
|
3
60
|
//# sourceMappingURL=types.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@odx/foundation",
|
|
3
3
|
"description": "A library of Web Component building blocks for ODX",
|
|
4
|
-
"version": "1.0.0-beta.
|
|
4
|
+
"version": "1.0.0-beta.46",
|
|
5
5
|
"author": "Drägerwerk AG & Co.KGaA",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
7
7
|
"homepage": "https://odx.draeger.com",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"lit": "~3.3.0"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
|
-
"@odx/icons": "^4.0.0-rc.
|
|
24
|
+
"@odx/icons": "^4.0.0-rc.22"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@odx/storybook-utils": "*",
|
|
@@ -39,9 +39,17 @@
|
|
|
39
39
|
"import": "./dist/main.js",
|
|
40
40
|
"types": "./dist/types/lib/main.d.ts"
|
|
41
41
|
},
|
|
42
|
-
"
|
|
43
|
-
"import": "./dist
|
|
44
|
-
"types": "./dist/types
|
|
42
|
+
"./components": {
|
|
43
|
+
"import": "./dist/components.js",
|
|
44
|
+
"types": "./dist/types/components/main.d.ts"
|
|
45
|
+
},
|
|
46
|
+
"./i18n": {
|
|
47
|
+
"import": "./dist/i18n.js",
|
|
48
|
+
"types": "./dist/types/i18n/main.d.ts"
|
|
49
|
+
},
|
|
50
|
+
"./loader": {
|
|
51
|
+
"import": "./dist/loader.js",
|
|
52
|
+
"types": "./dist/types/loader/main.d.ts"
|
|
45
53
|
},
|
|
46
54
|
"./styles": "./dist/styles.css"
|
|
47
55
|
},
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { EnumString } from '../../lib/main.js';
|
|
2
|
-
export type StackAlign = EnumString<typeof StackAlign>;
|
|
3
|
-
export declare const StackAlign: {
|
|
4
|
-
readonly START: "start";
|
|
5
|
-
readonly CENTER: "center";
|
|
6
|
-
readonly END: "end";
|
|
7
|
-
};
|
|
8
|
-
export type StackGap = EnumString<typeof StackGap>;
|
|
9
|
-
export declare const StackGap: {
|
|
10
|
-
readonly NONE: "none";
|
|
11
|
-
readonly XS: "xs";
|
|
12
|
-
readonly SM: "sm";
|
|
13
|
-
readonly MD: "md";
|
|
14
|
-
readonly LG: "lg";
|
|
15
|
-
readonly XL: "xl";
|
|
16
|
-
};
|
|
17
|
-
export type StackJustify = EnumString<typeof StackJustify>;
|
|
18
|
-
export declare const StackJustify: {
|
|
19
|
-
readonly START: "start";
|
|
20
|
-
readonly END: "end";
|
|
21
|
-
readonly CENTER: "center";
|
|
22
|
-
readonly SPACE_BETWEEN: "space-between";
|
|
23
|
-
readonly SPACE_AROUND: "space-around";
|
|
24
|
-
readonly SPACE_EVENLY: "space-evenly";
|
|
25
|
-
};
|
|
26
|
-
//# sourceMappingURL=stack.models.d.ts.map
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
export type ARIARole = 'alert' | 'alertdialog' | 'button' | 'checkbox' | 'dialog' | 'gridcell' | 'link' | 'log' | 'marquee' | 'menuitem' | 'menuitemcheckbox' | 'menuitemradio' | 'option' | 'progressbar' | 'radio' | 'scrollbar' | 'searchbox' | 'slider' | 'spinbutton' | 'status' | 'switch' | 'tab' | 'tabpanel' | 'textbox' | 'timer' | 'tooltip' | 'treeitem' | 'combobox' | 'grid' | 'listbox' | 'menu' | 'menubar' | 'radiogroup' | 'tablist' | 'tree' | 'treegrid' | 'application' | 'article' | 'cell' | 'columnheader' | 'definition' | 'directory' | 'document' | 'feed' | 'figure' | 'group' | 'heading' | 'img' | 'list' | 'listitem' | 'math' | 'none' | 'note' | 'presentation' | 'region' | 'row' | 'rowgroup' | 'rowheader' | 'separator' | 'table' | 'term' | 'text' | 'toolbar' | 'banner' | 'complementary' | 'contentinfo' | 'form' | 'main' | 'navigation' | 'region' | 'search' | 'doc-abstract' | 'doc-acknowledgments' | 'doc-afterword' | 'doc-appendix' | 'doc-backlink' | 'doc-biblioentry' | 'doc-bibliography' | 'doc-biblioref' | 'doc-chapter' | 'doc-colophon' | 'doc-conclusion' | 'doc-cover' | 'doc-credit' | 'doc-credits' | 'doc-dedication' | 'doc-endnote' | 'doc-endnotes' | 'doc-epigraph' | 'doc-epilogue' | 'doc-errata' | 'doc-example' | 'doc-footnote' | 'doc-foreword' | 'doc-glossary' | 'doc-glossref' | 'doc-index' | 'doc-introduction' | 'doc-noteref' | 'doc-notice' | 'doc-pagebreak' | 'doc-pagelist' | 'doc-part' | 'doc-preface' | 'doc-prologue' | 'doc-pullquote' | 'doc-qna' | 'doc-subtitle' | 'doc-tip' | 'doc-toc';
|
|
2
|
-
/**
|
|
3
|
-
* An extension of `ARIAMixin` that enforces strict value types for aria
|
|
4
|
-
* properties.
|
|
5
|
-
*
|
|
6
|
-
* This is needed for correct typing in render functions with lit analyzer.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* render() {
|
|
10
|
-
* const {ariaLabel} = this as ARIAMixinStrict;
|
|
11
|
-
* return html`
|
|
12
|
-
* <button aria-label=${ariaLabel || nothing}>
|
|
13
|
-
* <slot></slot>
|
|
14
|
-
* </button>
|
|
15
|
-
* `;
|
|
16
|
-
* }
|
|
17
|
-
*/
|
|
18
|
-
export interface ARIAMixinStrict extends ARIAMixin {
|
|
19
|
-
ariaAtomic: 'true' | 'false' | null;
|
|
20
|
-
ariaAutoComplete: 'none' | 'inline' | 'list' | 'both' | null;
|
|
21
|
-
ariaBusy: 'true' | 'false' | null;
|
|
22
|
-
ariaChecked: 'true' | 'false' | null;
|
|
23
|
-
ariaColCount: `${number}` | null;
|
|
24
|
-
ariaColIndex: `${number}` | null;
|
|
25
|
-
ariaColSpan: `${number}` | null;
|
|
26
|
-
ariaCurrent: 'page' | 'step' | 'location' | 'date' | 'time' | 'true' | 'false' | null;
|
|
27
|
-
ariaDisabled: 'true' | 'false' | null;
|
|
28
|
-
ariaExpanded: 'true' | 'false' | null;
|
|
29
|
-
ariaHasPopup: 'false' | 'true' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog' | null;
|
|
30
|
-
ariaHidden: 'true' | 'false' | null;
|
|
31
|
-
ariaInvalid: 'true' | 'false' | null;
|
|
32
|
-
ariaKeyShortcuts: string | null;
|
|
33
|
-
ariaLabel: string | null;
|
|
34
|
-
ariaLevel: `${number}` | null;
|
|
35
|
-
ariaLive: 'assertive' | 'off' | 'polite' | null;
|
|
36
|
-
ariaModal: 'true' | 'false' | null;
|
|
37
|
-
ariaMultiLine: 'true' | 'false' | null;
|
|
38
|
-
ariaMultiSelectable: 'true' | 'false' | null;
|
|
39
|
-
ariaOrientation: 'horizontal' | 'vertical' | 'undefined' | null;
|
|
40
|
-
ariaPlaceholder: string | null;
|
|
41
|
-
ariaPosInSet: `${number}` | null;
|
|
42
|
-
ariaPressed: 'true' | 'false' | null;
|
|
43
|
-
ariaReadOnly: 'true' | 'false' | null;
|
|
44
|
-
ariaRequired: 'true' | 'false' | null;
|
|
45
|
-
ariaRoleDescription: string | null;
|
|
46
|
-
ariaRowCount: `${number}` | null;
|
|
47
|
-
ariaRowIndex: `${number}` | null;
|
|
48
|
-
ariaRowSpan: `${number}` | null;
|
|
49
|
-
ariaSelected: 'true' | 'false' | null;
|
|
50
|
-
ariaSetSize: `${number}` | null;
|
|
51
|
-
ariaSort: 'ascending' | 'descending' | 'none' | 'other' | null;
|
|
52
|
-
ariaValueMax: `${number}` | null;
|
|
53
|
-
ariaValueMin: `${number}` | null;
|
|
54
|
-
ariaValueNow: `${number}` | null;
|
|
55
|
-
ariaValueText: string | null;
|
|
56
|
-
role: ARIARole | null;
|
|
57
|
-
}
|
|
58
|
-
//# sourceMappingURL=a11y.d.ts.map
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ReactiveElement } from 'lit';
|
|
2
|
-
type Interface<T> = {
|
|
3
|
-
[K in keyof T]: T[K];
|
|
4
|
-
};
|
|
5
|
-
export type QueryAssignedElementDecorator = {
|
|
6
|
-
(proto: Interface<ReactiveElement>, name: PropertyKey, descriptor?: PropertyDescriptor): void | any;
|
|
7
|
-
<C extends Interface<ReactiveElement>, V extends Element | undefined>(value: ClassAccessorDecoratorTarget<C, V>, context: ClassAccessorDecoratorContext<C, V>): ClassAccessorDecoratorResult<C, V>;
|
|
8
|
-
};
|
|
9
|
-
export interface QueryAssignedElementOptions {
|
|
10
|
-
slot?: string;
|
|
11
|
-
selector?: string;
|
|
12
|
-
flatten?: boolean;
|
|
13
|
-
}
|
|
14
|
-
export declare function queryAssignedElement(options?: QueryAssignedElementOptions): QueryAssignedElementDecorator;
|
|
15
|
-
export {};
|
|
16
|
-
//# sourceMappingURL=query-assigned-element.d.ts.map
|