@odx/foundation 1.0.0-beta.99 → 1.0.0-rc.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.
Files changed (170) hide show
  1. package/CHANGELOG.md +335 -0
  2. package/README.md +61 -29
  3. package/dist/lib/breakpoints.d.ts +61 -0
  4. package/dist/lib/breakpoints.js +139 -0
  5. package/dist/lib/format.d.ts +58 -0
  6. package/dist/lib/format.js +63 -0
  7. package/dist/lib/localization.d.ts +12 -0
  8. package/dist/lib/localization.js +28 -0
  9. package/dist/lib/models.d.ts +39 -0
  10. package/dist/lib/models.js +34 -0
  11. package/dist/lib/signals.d.ts +20 -0
  12. package/dist/lib/signals.js +47 -0
  13. package/dist/lib/theming.d.ts +18 -0
  14. package/dist/lib/theming.js +38 -0
  15. package/dist/lib/utils/breakpoint.d.ts +38 -0
  16. package/dist/lib/utils/breakpoint.js +103 -0
  17. package/dist/lib/utils/shared-media-observer.d.ts +4 -0
  18. package/dist/lib/utils/shared-media-observer.js +43 -0
  19. package/dist/main.d.ts +7 -0
  20. package/dist/main.js +5 -1227
  21. package/dist/oss-licenses.json +1 -0
  22. package/dist/styles.css +1 -1
  23. package/package.json +27 -50
  24. package/dist/_virtual_class-decorator-runtime.js +0 -13
  25. package/dist/components/accordion/accordion.d.ts +0 -25
  26. package/dist/components/accordion-item/accordion-item.d.ts +0 -26
  27. package/dist/components/accordion-panel/accordion-panel.d.ts +0 -13
  28. package/dist/components/action-button/action-button.d.ts +0 -27
  29. package/dist/components/anchor-navigation/anchor-navigation.d.ts +0 -21
  30. package/dist/components/anchor-navigation/anchor-observer.d.ts +0 -11
  31. package/dist/components/anchor-navigation/index.d.ts +0 -3
  32. package/dist/components/area-header/area-header.d.ts +0 -21
  33. package/dist/components/avatar/avatar.d.ts +0 -36
  34. package/dist/components/avatar-group/avatar-group.d.ts +0 -15
  35. package/dist/components/badge/badge.d.ts +0 -24
  36. package/dist/components/breadcrumbs/breadcrumbs-item.d.ts +0 -17
  37. package/dist/components/breadcrumbs/breadcrumbs.d.ts +0 -21
  38. package/dist/components/breadcrumbs/index.d.ts +0 -3
  39. package/dist/components/button/button.d.ts +0 -54
  40. package/dist/components/button-group/button-group.d.ts +0 -20
  41. package/dist/components/card/card.d.ts +0 -15
  42. package/dist/components/checkbox/checkbox.d.ts +0 -14
  43. package/dist/components/checkbox-group/checkbox-group.d.ts +0 -19
  44. package/dist/components/chip/chip.d.ts +0 -31
  45. package/dist/components/circular-progress-bar/circular-progress-bar.d.ts +0 -49
  46. package/dist/components/combobox/autocomplete.d.ts +0 -23
  47. package/dist/components/content-box/content-box.d.ts +0 -11
  48. package/dist/components/dropdown/dropdown.d.ts +0 -25
  49. package/dist/components/form-field/form-field.d.ts +0 -16
  50. package/dist/components/format/base-format.d.ts +0 -13
  51. package/dist/components/format/format-bytes.d.ts +0 -13
  52. package/dist/components/format/format-date.d.ts +0 -14
  53. package/dist/components/format/format-number.d.ts +0 -20
  54. package/dist/components/format/index.d.ts +0 -6
  55. package/dist/components/format/relative-time.d.ts +0 -21
  56. package/dist/components/header/header-actions.d.ts +0 -10
  57. package/dist/components/header/header.d.ts +0 -14
  58. package/dist/components/header/index.d.ts +0 -3
  59. package/dist/components/headline/headline.d.ts +0 -22
  60. package/dist/components/highlight/highlight.d.ts +0 -23
  61. package/dist/components/icon-button/icon-button.d.ts +0 -14
  62. package/dist/components/image/image.d.ts +0 -34
  63. package/dist/components/inline-message/inline-message.d.ts +0 -28
  64. package/dist/components/input/input.d.ts +0 -27
  65. package/dist/components/kpi/kpi.d.ts +0 -36
  66. package/dist/components/line-clamp/line-clamp.d.ts +0 -12
  67. package/dist/components/link/link.d.ts +0 -11
  68. package/dist/components/list/list.d.ts +0 -15
  69. package/dist/components/list-item/list-item.d.ts +0 -26
  70. package/dist/components/loader.d.ts +0 -2
  71. package/dist/components/loading-overlay/loading-overlay.d.ts +0 -20
  72. package/dist/components/loading-spinner/loading-spinner.d.ts +0 -12
  73. package/dist/components/logo/logo.d.ts +0 -21
  74. package/dist/components/main-menu/index.d.ts +0 -6
  75. package/dist/components/main-menu/main-menu-button.d.ts +0 -12
  76. package/dist/components/main-menu/main-menu-link.d.ts +0 -9
  77. package/dist/components/main-menu/main-menu-subtitle.d.ts +0 -12
  78. package/dist/components/main-menu/main-menu-title.d.ts +0 -12
  79. package/dist/components/main-menu/main-menu.d.ts +0 -17
  80. package/dist/components/main.d.ts +0 -72
  81. package/dist/components/menu/index.d.ts +0 -3
  82. package/dist/components/menu/menu-label.d.ts +0 -9
  83. package/dist/components/menu/menu.d.ts +0 -21
  84. package/dist/components/menu-item/menu-item.d.ts +0 -14
  85. package/dist/components/modal/modal.d.ts +0 -37
  86. package/dist/components/navigation-item/navigation-item.d.ts +0 -22
  87. package/dist/components/option/option.d.ts +0 -11
  88. package/dist/components/page/page.d.ts +0 -27
  89. package/dist/components/page-layout/page-layout.d.ts +0 -11
  90. package/dist/components/pagination/pagination.d.ts +0 -32
  91. package/dist/components/popover/popover-host.d.ts +0 -35
  92. package/dist/components/popover/popover-observer.d.ts +0 -11
  93. package/dist/components/popover/popover.d.ts +0 -13
  94. package/dist/components/progress-bar/progress-bar.d.ts +0 -30
  95. package/dist/components/radio-button/radio-button.d.ts +0 -13
  96. package/dist/components/radio-group/radio-group.d.ts +0 -16
  97. package/dist/components/rail-navigation/rail-navigation.d.ts +0 -19
  98. package/dist/components/search-bar/index.d.ts +0 -3
  99. package/dist/components/search-bar/search-bar.d.ts +0 -33
  100. package/dist/components/search-bar/search-bar.events.d.ts +0 -7
  101. package/dist/components/select/select.d.ts +0 -26
  102. package/dist/components/separator/separator.d.ts +0 -21
  103. package/dist/components/skeleton/skeleton.d.ts +0 -31
  104. package/dist/components/slider/index.d.ts +0 -5
  105. package/dist/components/slider/slider-handle.d.ts +0 -28
  106. package/dist/components/slider/slider-marks.d.ts +0 -16
  107. package/dist/components/slider/slider.d.ts +0 -26
  108. package/dist/components/slider/slider.models.d.ts +0 -29
  109. package/dist/components/spacer/spacer.d.ts +0 -13
  110. package/dist/components/spinbox/spinbox.d.ts +0 -23
  111. package/dist/components/stack/stack.d.ts +0 -38
  112. package/dist/components/status/status.d.ts +0 -23
  113. package/dist/components/switch/switch.d.ts +0 -12
  114. package/dist/components/table/index.d.ts +0 -9
  115. package/dist/components/table/table-body.d.ts +0 -12
  116. package/dist/components/table/table-cell.d.ts +0 -12
  117. package/dist/components/table/table-checkbox-cell.d.ts +0 -19
  118. package/dist/components/table/table-header-cell.d.ts +0 -13
  119. package/dist/components/table/table-header.d.ts +0 -14
  120. package/dist/components/table/table-row.d.ts +0 -20
  121. package/dist/components/table/table.d.ts +0 -20
  122. package/dist/components/table/table.models.d.ts +0 -10
  123. package/dist/components/text/text.d.ts +0 -33
  124. package/dist/components/title/title.d.ts +0 -22
  125. package/dist/components/toast/toast.d.ts +0 -24
  126. package/dist/components/toggle-button/toggle-button.d.ts +0 -13
  127. package/dist/components/toggle-button-group/toggle-button-group.d.ts +0 -10
  128. package/dist/components/toggle-content/toggle-content.d.ts +0 -12
  129. package/dist/components/tooltip/tooltip.d.ts +0 -37
  130. package/dist/components/translate/translate.d.ts +0 -16
  131. package/dist/components/visually-hidden/visually-hidden.d.ts +0 -11
  132. package/dist/components.js +0 -4493
  133. package/dist/i18n/config.d.ts +0 -32
  134. package/dist/i18n/format.d.ts +0 -6
  135. package/dist/i18n/is-localized.d.ts +0 -15
  136. package/dist/i18n/localization.d.ts +0 -5
  137. package/dist/i18n/main.d.ts +0 -7
  138. package/dist/i18n/models.d.ts +0 -7
  139. package/dist/i18n/translate.d.ts +0 -11
  140. package/dist/i18n.js +0 -145
  141. package/dist/lib/control/checkbox-form-control.d.ts +0 -16
  142. package/dist/lib/control/checkbox-group-form-control.d.ts +0 -23
  143. package/dist/lib/control/form-control.d.ts +0 -30
  144. package/dist/lib/control/listbox-form-control.d.ts +0 -26
  145. package/dist/lib/control/number-form-control.d.ts +0 -13
  146. package/dist/lib/control/option-control.d.ts +0 -24
  147. package/dist/lib/control/radio-group-form-control.d.ts +0 -22
  148. package/dist/lib/controllers/active-descendants-controller.d.ts +0 -29
  149. package/dist/lib/controllers/drag.controller.d.ts +0 -19
  150. package/dist/lib/controllers/expandable-controller.d.ts +0 -17
  151. package/dist/lib/custom-element.d.ts +0 -16
  152. package/dist/lib/interactive/interactive-element.d.ts +0 -23
  153. package/dist/lib/interactive/interactive-link.d.ts +0 -21
  154. package/dist/lib/main.d.ts +0 -28
  155. package/dist/lib/mixins/can-be-disabled.d.ts +0 -7
  156. package/dist/lib/mixins/can-be-expanded.d.ts +0 -10
  157. package/dist/lib/mixins/is-draggable.d.ts +0 -16
  158. package/dist/lib/models/drag-event.d.ts +0 -9
  159. package/dist/lib/models/placement.d.ts +0 -17
  160. package/dist/lib/models/shape.d.ts +0 -7
  161. package/dist/lib/models/size.d.ts +0 -11
  162. package/dist/lib/models/variant.d.ts +0 -12
  163. package/dist/lib/utils/compute-popover-placement.d.ts +0 -14
  164. package/dist/lib/utils/dom.d.ts +0 -27
  165. package/dist/lib/utils/get-unique-id.d.ts +0 -19
  166. package/dist/lib/utils/lit.d.ts +0 -4
  167. package/dist/lib/utils/shared-resize-observer.d.ts +0 -11
  168. package/dist/lib/utils/types.d.ts +0 -60
  169. package/dist/loader.js +0 -7
  170. package/dist/vendor.js +0 -1982
@@ -1,32 +0,0 @@
1
- import { LocaleInput, SingleUnitIdentifier } from './models.js';
2
- export interface DateTimeFormatOptions extends Omit<Intl.DateTimeFormatOptions, 'dateStyle'> {
3
- locale?: LocaleInput;
4
- dateStyle?: 'iso8601' | Intl.DateTimeFormatOptions['dateStyle'];
5
- }
6
- export interface NumberFormatOptions extends Intl.NumberFormatOptions {
7
- locale?: LocaleInput;
8
- unit?: SingleUnitIdentifier;
9
- }
10
- export interface ListFormatOptions extends Intl.ListFormatOptions {
11
- locale?: LocaleInput;
12
- }
13
- export interface RelativeTimeFormatOptions extends Intl.RelativeTimeFormatOptions {
14
- locale?: LocaleInput;
15
- minUnit?: Intl.RelativeTimeFormatUnit;
16
- }
17
- export interface FormatOptions {
18
- dateTimeFormatOptions?: DateTimeFormatOptions;
19
- numberFormatOptions?: NumberFormatOptions;
20
- listFormatOptions?: ListFormatOptions;
21
- relativeTimeFormatOptions?: RelativeTimeFormatOptions;
22
- }
23
- export interface LocalizationOptions {
24
- defaultLocale: () => LocaleInput;
25
- fallbackLanguage: () => Intl.UnicodeBCP47LocaleIdentifier;
26
- fallbackTranslation: (key: string) => string;
27
- }
28
- export type I18nConfig = LocalizationOptions & FormatOptions;
29
- export declare const I18nConfig: (config?: Partial<I18nConfig>) => I18nConfig;
30
- export declare function setI18nOptions(options?: Partial<I18nConfig> | null): void;
31
- export declare function getI18nOptions(options?: Partial<I18nConfig> | null): I18nConfig;
32
- //# sourceMappingURL=config.d.ts.map
@@ -1,6 +0,0 @@
1
- import { DateTimeFormatOptions, ListFormatOptions, NumberFormatOptions, RelativeTimeFormatOptions } from './config.js';
2
- export declare function formatDate(input: number | string | Date, options?: DateTimeFormatOptions): string;
3
- export declare function formatNumber(input: number | string, options?: NumberFormatOptions): string;
4
- export declare function formatList(input: string[], options?: ListFormatOptions): string;
5
- export declare function formatRelativeTime(input: number | string | Date, options?: RelativeTimeFormatOptions): string;
6
- //# sourceMappingURL=format.d.ts.map
@@ -1,15 +0,0 @@
1
- import { Constructor, CustomElement } from '../lib/main.js';
2
- import { ReadonlySignal } from '@preact/signals-core';
3
- import { formatDate, formatList, formatNumber, formatRelativeTime } from './format.js';
4
- import { getLocale } from './localization.js';
5
- import { translate } from './translate.js';
6
- export interface IsLocalized {
7
- readonly locale: ReadonlySignal<ReturnType<typeof getLocale>>;
8
- t: (...args: Parameters<typeof translate>) => string;
9
- formatDate: typeof formatDate;
10
- formatNumber: typeof formatNumber;
11
- formatList: typeof formatList;
12
- formatRelativeTime: typeof formatRelativeTime;
13
- }
14
- export declare const IsLocalized: <T extends Constructor<CustomElement>>(superClass: T) => Constructor<IsLocalized> & T;
15
- //# sourceMappingURL=is-localized.d.ts.map
@@ -1,5 +0,0 @@
1
- import { LocaleInput } from './models.js';
2
- export declare function getLocale(localeInput?: LocaleInput | null): Intl.Locale;
3
- export declare function setLocale(localeInput?: LocaleInput | null): void;
4
- export declare function syncDocumentLanguage(root?: HTMLElement): void;
5
- //# sourceMappingURL=localization.d.ts.map
@@ -1,7 +0,0 @@
1
- export * from './config.js';
2
- export * from './format.js';
3
- export * from './is-localized.js';
4
- export * from './localization.js';
5
- export * from './models.js';
6
- export * from './translate.js';
7
- //# sourceMappingURL=main.d.ts.map
@@ -1,7 +0,0 @@
1
- export type LocaleInput = Intl.UnicodeBCP47LocaleIdentifier | Intl.Locale;
2
- /**
3
- * Single units sanctioned for use in ECMAScript.
4
- * See: https://tc39.es/ecma402/#table-sanctioned-single-unit-identifiers
5
- */
6
- export type SingleUnitIdentifier = 'acre' | 'bit' | 'byte' | 'celsius' | 'centimeter' | 'day' | 'degree' | 'fahrenheit' | 'fluid-ounce' | 'foot' | 'gallon' | 'gigabit' | 'gigabyte' | 'gram' | 'hectare' | 'hour' | 'inch' | 'kilobit' | 'kilobyte' | 'kilogram' | 'kilometer' | 'liter' | 'megabit' | 'megabyte' | 'meter' | 'microsecond' | 'mile' | 'mile-scandinavian' | 'milliliter' | 'millimeter' | 'millisecond' | 'minute' | 'month' | 'nanosecond' | 'ounce' | 'percent' | 'petabyte' | 'pound' | 'second' | 'stone' | 'terabit' | 'terabyte' | 'week' | 'yard' | 'year';
7
- //# sourceMappingURL=models.d.ts.map
@@ -1,11 +0,0 @@
1
- import { ReadonlySignal } from '@preact/signals-core';
2
- import { LocaleInput } from './models.js';
3
- type Translation = {
4
- [key: string]: Translation | string;
5
- };
6
- export type TranslateContext = Record<string, string | number | boolean> | string | number | boolean | null;
7
- export declare function interpolate(value: string, context: Record<string, string | number>): string;
8
- export declare function setTranslation(locale: LocaleInput, translation: Translation): void;
9
- export declare function translate(key: string, contextInput?: TranslateContext, locale?: LocaleInput | null): ReadonlySignal<string>;
10
- export {};
11
- //# sourceMappingURL=translate.d.ts.map
package/dist/i18n.js DELETED
@@ -1,145 +0,0 @@
1
- import { signal, effect, computed } from '@preact/signals-core';
2
- import { parseDate } from '@odx/foundation';
3
- import { _ as __decorateClass } from './_virtual_class-decorator-runtime.js';
4
- import { k as flattenObject, e } from './vendor.js';
5
- import 'lit/html.js';
6
- import { property } from 'lit/decorators.js';
7
-
8
- const I18nConfig = (config) => ({
9
- defaultLocale: () => navigator.language,
10
- fallbackLanguage: () => "en",
11
- fallbackTranslation: (key) => key,
12
- ...config,
13
- relativeTimeFormatOptions: {
14
- minUnit: "minute",
15
- ...config?.relativeTimeFormatOptions
16
- }
17
- });
18
- const i18nConfig = signal(null);
19
- function setI18nOptions(options) {
20
- i18nConfig.value = getI18nOptions(options);
21
- }
22
- function getI18nOptions(options) {
23
- return I18nConfig(options ?? i18nConfig.value ?? {});
24
- }
25
-
26
- function formatDate(input, options) {
27
- const value = parseDate(input);
28
- if (!value) return "";
29
- const { dateTimeFormatOptions } = getI18nOptions({ dateTimeFormatOptions: options });
30
- if (dateTimeFormatOptions?.dateStyle === "iso8601") {
31
- return new Intl.DateTimeFormat("sv-SE", { dateStyle: "short" }).format(value);
32
- }
33
- return new Intl.DateTimeFormat(options?.locale, dateTimeFormatOptions).format(value);
34
- }
35
- function formatNumber(input, options) {
36
- const value = Number(input);
37
- if (Number.isNaN(value)) return "";
38
- const { numberFormatOptions } = getI18nOptions({ numberFormatOptions: options });
39
- if (numberFormatOptions?.currency) {
40
- numberFormatOptions.style = "currency";
41
- }
42
- return new Intl.NumberFormat(numberFormatOptions?.locale, numberFormatOptions).format(value);
43
- }
44
- function formatList(input, options) {
45
- if (input.length === 0) return "";
46
- const { listFormatOptions } = getI18nOptions({ listFormatOptions: options });
47
- return new Intl.ListFormat(options?.locale, listFormatOptions).format(input);
48
- }
49
- const TIME_UNITS = [
50
- { max: 59e3, value: 1e3, unit: "second" },
51
- // max 59 seconds
52
- { max: 276e4, value: 6e4, unit: "minute" },
53
- // max 46 minutes
54
- { max: 72e6, value: 36e5, unit: "hour" },
55
- // max 20 hours
56
- { max: 5184e5, value: 864e5, unit: "day" },
57
- // max 6 days
58
- { max: 24192e5, value: 6048e5, unit: "week" },
59
- // max 28 days
60
- { max: 28512e6, value: 2592e6, unit: "month" },
61
- // max 11 months
62
- { max: Number.POSITIVE_INFINITY, value: 31536e6, unit: "year" }
63
- ];
64
- function findTimeUnit(value, minUnit) {
65
- const minTimeUnit = TIME_UNITS.find(({ unit }) => unit === minUnit) ?? TIME_UNITS[0];
66
- return TIME_UNITS.find((config) => value < config.max && config.value >= minTimeUnit.value);
67
- }
68
- function formatRelativeTime(input, options) {
69
- const value = parseDate(input);
70
- if (!value) return "";
71
- const { relativeTimeFormatOptions } = getI18nOptions({ relativeTimeFormatOptions: options });
72
- const relativeTime = value.getTime() - Date.now();
73
- const timeUnit = findTimeUnit(Math.abs(relativeTime), relativeTimeFormatOptions?.minUnit);
74
- return new Intl.RelativeTimeFormat(options?.locale, relativeTimeFormatOptions).format(Math.round(relativeTime / timeUnit.value), timeUnit.unit);
75
- }
76
-
77
- const activeLocale = signal(null);
78
- function getLocale(localeInput) {
79
- return new Intl.Locale(localeInput || activeLocale.value || getI18nOptions().defaultLocale());
80
- }
81
- function setLocale(localeInput) {
82
- activeLocale.value = localeInput ? getLocale(localeInput) : null;
83
- }
84
- function syncDocumentLanguage(root = document.documentElement) {
85
- const cleanup = effect(() => {
86
- root.lang = getLocale().toString();
87
- });
88
- window.addEventListener("unload", cleanup);
89
- }
90
-
91
- const translations = signal({});
92
- function interpolate(value, context) {
93
- return value.replaceAll(/\{\{\s*([^}\s]+)\s*}}/g, (match, variableName) => {
94
- return context[variableName] != null ? interpolate(context[variableName].toString(), context) : match;
95
- });
96
- }
97
- function setTranslation(locale, translation) {
98
- const { language } = getLocale(locale);
99
- translations.value = { ...translations.value, [language]: { ...translations.value[language], ...flattenObject(translation) } };
100
- }
101
- function translate(key, contextInput, locale) {
102
- return computed(() => {
103
- const translation = getTranslationRecord(locale);
104
- if (!translation) return key;
105
- const { fallbackLanguage, fallbackTranslation: fallbackTranslateKey } = getI18nOptions();
106
- const fallbackTranslation = getTranslationRecord(fallbackLanguage());
107
- const value = translation?.[key] ?? fallbackTranslation?.[key] ?? fallbackTranslateKey(key);
108
- const context = typeof contextInput === "object" || contextInput === void 0 ? flattenObject(contextInput ?? {}) : { $implicit: contextInput.toString() };
109
- return interpolate(value, { ...fallbackTranslation, ...translation, ...context });
110
- });
111
- }
112
- function getTranslationRecord(localeInput) {
113
- const locale = getLocale(localeInput);
114
- return translations.value[locale.toString()] ?? translations.value[locale.language] ?? null;
115
- }
116
-
117
- const IsLocalized = (superClass) => {
118
- class IsLocalizedElement extends e(superClass) {
119
- constructor() {
120
- super(...arguments);
121
- this.locale = computed(() => getLocale(this.lang));
122
- }
123
- formatDate(...[input, options]) {
124
- return formatDate(input, { ...options, locale: options?.locale ?? this.locale.value });
125
- }
126
- formatNumber(...[input, options]) {
127
- return formatNumber(input, { ...options, locale: options?.locale ?? this.locale.value });
128
- }
129
- formatList(...[input, options]) {
130
- return formatList(input, { ...options, locale: options?.locale ?? this.locale.value });
131
- }
132
- formatRelativeTime(...[input, options]) {
133
- return formatRelativeTime(input, { ...options, locale: options?.locale ?? this.locale.value });
134
- }
135
- t(...[key, context, locale]) {
136
- return translate(key, context, locale ?? this.locale.value).value;
137
- }
138
- }
139
- __decorateClass([
140
- property()
141
- ], IsLocalizedElement.prototype, "lang", 2);
142
- return IsLocalizedElement;
143
- };
144
-
145
- export { I18nConfig, IsLocalized, formatDate, formatList, formatNumber, formatRelativeTime, getI18nOptions, getLocale, interpolate, setI18nOptions, setLocale, setTranslation, syncDocumentLanguage, translate };
@@ -1,16 +0,0 @@
1
- import { FormControl } from './form-control.js';
2
- export declare abstract class CheckboxFormControl extends FormControl<string> {
3
- #private;
4
- /** @internal */
5
- static shadowRootOptions: ShadowRootInit;
6
- role: 'checkbox' | 'menuitemcheckbox' | 'menuitemradio' | 'option' | 'radio' | 'switch' | null;
7
- checked: boolean;
8
- value: string;
9
- constructor();
10
- toFormValue(): string | File | FormData | null;
11
- clear(): void;
12
- toggle(state?: boolean, emitEvent?: boolean): void;
13
- connectedCallback(): void;
14
- updateAriaAttributes(): void;
15
- }
16
- //# sourceMappingURL=checkbox-form-control.d.ts.map
@@ -1,23 +0,0 @@
1
- import { PropertyValues } from 'lit';
2
- import { CheckboxFormControl } from './checkbox-form-control.js';
3
- import { FormControl } from './form-control.js';
4
- export declare abstract class CheckboxGroupFormControl extends FormControl<string[]> {
5
- #private;
6
- private elements;
7
- protected get childGroups(): CheckboxGroupFormControl[];
8
- get controls(): CheckboxFormControl[];
9
- get selectedControls(): CheckboxFormControl[];
10
- get groupControl(): CheckboxFormControl | null;
11
- value: string[];
12
- constructor();
13
- clear(): void;
14
- toFormValue(): FormData;
15
- protected isControl(element: unknown): element is CheckboxFormControl;
16
- protected isGroupControl(element: unknown): element is CheckboxFormControl;
17
- protected isControlChecked(control: CheckboxFormControl): boolean;
18
- protected firstUpdated(_changedProperties: PropertyValues): Promise<void>;
19
- protected updated(props: PropertyValues<this>): void;
20
- protected updateControls(updateFn: (control: CheckboxFormControl, index: number) => void): void;
21
- protected updateValue(value: string[], dispatchEvent?: boolean): void;
22
- }
23
- //# sourceMappingURL=checkbox-group-form-control.d.ts.map
@@ -1,30 +0,0 @@
1
- import { PropertyValues } from 'lit';
2
- import { CustomElement } from '../custom-element.js';
3
- import { CanBeDisabled } from '../mixins/can-be-disabled.js';
4
- declare const FormControl_base: import('../main.js').Constructor<CanBeDisabled> & typeof CustomElement;
5
- export declare abstract class FormControl<V extends string | number | string[] = string> extends FormControl_base {
6
- /** @internal */
7
- static readonly formAssociated = true;
8
- /** @internal */
9
- static shadowRootOptions: ShadowRootInit;
10
- /** @internal */
11
- readonly internals: ElementInternals;
12
- name: string;
13
- value: V;
14
- readonly: boolean;
15
- required: boolean;
16
- get form(): HTMLFormElement | null;
17
- get validity(): ValidityState;
18
- get validationMessage(): string;
19
- get willValidate(): boolean;
20
- constructor();
21
- updateAriaAttributes?(): void;
22
- toFormValue(): string | File | FormData | null;
23
- checkValidity(): boolean;
24
- setValidity(flags?: ValidityStateFlags, target?: HTMLElement): void;
25
- reportValidity(): void;
26
- clear(): void;
27
- protected willUpdate(props: PropertyValues<this>): void;
28
- }
29
- export {};
30
- //# sourceMappingURL=form-control.d.ts.map
@@ -1,26 +0,0 @@
1
- import { PropertyValues } from 'lit';
2
- import { ActiveDescendantsController } from '../controllers/active-descendants-controller.js';
3
- import { FormControl } from './form-control.js';
4
- import { OptionControl } from './option-control.js';
5
- export declare abstract class ListboxFormControl<Option extends OptionControl> extends FormControl<string | string[]> {
6
- #private;
7
- protected readonly activeDescendants: ActiveDescendantsController<Option>;
8
- protected abstract options: Option[];
9
- autoSelect: boolean;
10
- multiple: boolean;
11
- placeholder: string;
12
- value: string[] | string;
13
- get selectedOptions(): Option[];
14
- get selectedIndices(): number[];
15
- constructor();
16
- protected canAutoSelect(option: Option): boolean;
17
- protected canSelect(option: Option): boolean;
18
- toggleOption(option: Option, state?: boolean): void;
19
- clear(): void;
20
- connectedCallback(): void;
21
- protected handleSlotChange(): void;
22
- protected updateValue(option?: Option): void;
23
- protected willUpdate(props: PropertyValues<this>): void;
24
- protected updateOptions(updateFn: (option: Option) => void): void;
25
- }
26
- //# sourceMappingURL=listbox-form-control.d.ts.map
@@ -1,13 +0,0 @@
1
- import { PropertyValues } from 'lit';
2
- import { FormControl } from './form-control.js';
3
- export declare class NumberFormControl extends FormControl<number> {
4
- min: number;
5
- max: number;
6
- step: number;
7
- value: number;
8
- clear(): void;
9
- getValueText(): string;
10
- protected willUpdate(props: PropertyValues<this>): void;
11
- toFormValue(): string;
12
- }
13
- //# sourceMappingURL=number-form-control.d.ts.map
@@ -1,24 +0,0 @@
1
- import { PropertyValues } from 'lit';
2
- import { ActiveDescendant } from '../controllers/active-descendants-controller.js';
3
- import { CustomElement } from '../custom-element.js';
4
- import { CanBeDisabled } from '../mixins/can-be-disabled.js';
5
- declare const OptionControl_base: import('../main.js').Constructor<CanBeDisabled> & typeof CustomElement;
6
- export declare abstract class OptionControl extends OptionControl_base implements ActiveDescendant {
7
- #private;
8
- role: 'option' | 'gridcell' | 'row' | 'tab' | null;
9
- set label(value: string);
10
- get label(): string;
11
- value: string;
12
- selected: boolean;
13
- readonly: boolean;
14
- type?: 'checkbox' | null;
15
- canActivate(): boolean;
16
- canSelect(): boolean;
17
- isActive(): boolean;
18
- activate(): void;
19
- deactivate(): void;
20
- connectedCallback(): void;
21
- protected willUpdate(props: PropertyValues<this>): void;
22
- }
23
- export {};
24
- //# sourceMappingURL=option-control.d.ts.map
@@ -1,22 +0,0 @@
1
- import { PropertyValues } from 'lit';
2
- import { CheckboxFormControl } from './checkbox-form-control.js';
3
- import { FormControl } from './form-control.js';
4
- export declare abstract class RadioGroupFormControl extends FormControl<string> {
5
- #private;
6
- static shadowRootOptions: {
7
- delegatesFocus: boolean;
8
- mode: ShadowRootMode;
9
- serializable?: boolean;
10
- slotAssignment?: SlotAssignmentMode;
11
- };
12
- private elements;
13
- value: string;
14
- constructor();
15
- getControls(): CheckboxFormControl[];
16
- connectedCallback(): void;
17
- protected isControl(element: unknown): element is CheckboxFormControl;
18
- protected isControlChecked(control: CheckboxFormControl): boolean;
19
- protected willUpdate(changes: PropertyValues<this>): void;
20
- protected updateControls(updateFn: (control: CheckboxFormControl, index: number) => void): void;
21
- }
22
- //# sourceMappingURL=radio-group-form-control.d.ts.map
@@ -1,29 +0,0 @@
1
- import { ReactiveController, ReactiveElement } from 'lit';
2
- export interface ActiveDescendant {
3
- canActivate(): boolean;
4
- isActive(): boolean;
5
- activate(): void;
6
- deactivate(): void;
7
- }
8
- export interface ActiveDescendantsControllerOptions<T extends ActiveDescendant & Element> {
9
- getItems: () => T[];
10
- onChange?: (previousActiveDescendant: T | undefined, activeDescendant: T | undefined, firstChange: boolean) => void;
11
- }
12
- export declare const ActiveDescendantsControllerOptions: <T extends ActiveDescendant & Element>(options?: Partial<ActiveDescendantsControllerOptions<T>>) => ActiveDescendantsControllerOptions<T>;
13
- export declare class ActiveDescendantsController<T extends ActiveDescendant & Element> implements ReactiveController {
14
- #private;
15
- get activeIndex(): number;
16
- get activeItem(): T | undefined;
17
- get items(): T[];
18
- constructor(host: ReactiveElement, options?: Partial<ActiveDescendantsControllerOptions<T>>);
19
- hostConnected?(): void;
20
- activate(initialActiveIndex?: number): void;
21
- deactivate(): void;
22
- previous(): void;
23
- next(): void;
24
- first(): void;
25
- last(): void;
26
- select(item: T): void;
27
- update(index?: number, force?: boolean): void;
28
- }
29
- //# sourceMappingURL=active-descendants-controller.d.ts.map
@@ -1,19 +0,0 @@
1
- import { ReactiveController, ReactiveElement } from 'lit';
2
- import { IsDraggable } from '../mixins/is-draggable.js';
3
- export type DraggableElement = IsDraggable & HTMLElement;
4
- export interface DragControllerOptions<T extends DraggableElement = DraggableElement> {
5
- getDraggableElements: () => T[];
6
- getContainer?: () => HTMLElement;
7
- }
8
- export declare const DragControllerOptions: <T extends DraggableElement = DraggableElement>(config?: Partial<DragControllerOptions<T>>) => DragControllerOptions<T>;
9
- export declare class DragController<T extends DraggableElement = DraggableElement> implements ReactiveController {
10
- #private;
11
- get draggableElements(): T[];
12
- get container(): HTMLElement;
13
- constructor(host: ReactiveElement, options: DragControllerOptions);
14
- hostConnected(): void;
15
- hostDisconnected(): void;
16
- hostUpdated(): void;
17
- isDraggable(element?: unknown): element is DraggableElement;
18
- }
19
- //# sourceMappingURL=drag.controller.d.ts.map
@@ -1,17 +0,0 @@
1
- import { ReactiveController, ReactiveElement } from 'lit';
2
- import { CanBeExpanded } from '../mixins/can-be-expanded.js';
3
- export type ExpandableItem = CanBeExpanded & HTMLElement;
4
- export interface ExpandableItemManagerHost extends ReactiveElement {
5
- multiple?: boolean;
6
- }
7
- export interface ExpandableItemManagerOptions<T extends ExpandableItem = ExpandableItem> {
8
- getItems?: () => T[];
9
- }
10
- export declare const ExpandableItemManagerOptions: (options?: Partial<ExpandableItemManagerOptions>) => ExpandableItemManagerOptions;
11
- export declare class ExpandableItemManager<T extends ExpandableItem> implements ReactiveController {
12
- #private;
13
- get items(): T[];
14
- constructor(host: ExpandableItemManagerHost, options?: ExpandableItemManagerOptions);
15
- hostConnected?(): void;
16
- }
17
- //# sourceMappingURL=expandable-controller.d.ts.map
@@ -1,16 +0,0 @@
1
- import { LitElement, TemplateResult } from 'lit';
2
- type CustomElementTag = keyof HTMLElementTagNameMap & `odx-${string}`;
3
- /** @internal */
4
- export declare function customElement(tagName: CustomElementTag, ...styles: string[]): (target: typeof CustomElement) => void;
5
- /** @internal */
6
- export declare class CustomElement extends LitElement {
7
- /** @internal */
8
- static tagName: string;
9
- /** @internal */
10
- static define?: () => void;
11
- protected render(): TemplateResult | string;
12
- /** @internal */
13
- emit(event: string | Event, eventInit?: CustomEventInit): boolean;
14
- }
15
- export {};
16
- //# sourceMappingURL=custom-element.d.ts.map
@@ -1,23 +0,0 @@
1
- import { TemplateResult } from 'lit';
2
- import { InteractiveLink } from './interactive-link.js';
3
- /**
4
- * @csspart base
5
- * @csspart loader
6
- * @csspart label
7
- *
8
- * @slot prefix - Prefix slot
9
- * @slot suffix - Suffix slot
10
- * @slot - Default slot
11
- */
12
- export declare class InteractiveElement extends InteractiveLink {
13
- #private;
14
- static readonly styles: import('lit').CSSResult;
15
- /** @internal */
16
- protected loaderSlot?: 'prefix' | 'suffix' | 'default';
17
- loading: boolean;
18
- lineClamp: number;
19
- protected render(): TemplateResult;
20
- protected renderContent(withSpinner?: boolean): TemplateResult;
21
- protected renderLoader(): TemplateResult;
22
- }
23
- //# sourceMappingURL=interactive-element.d.ts.map
@@ -1,21 +0,0 @@
1
- import { TemplateResult } from 'lit';
2
- import { CustomElement } from '../custom-element.js';
3
- import { CanBeDisabled } from '../mixins/can-be-disabled.js';
4
- declare const InteractiveLink_base: import('../utils/types.js').Constructor<CanBeDisabled> & typeof CustomElement;
5
- /**
6
- * @attr {boolean} disabled
7
- */
8
- export declare class InteractiveLink extends InteractiveLink_base {
9
- /** @internal */
10
- static shadowRootOptions: ShadowRootInit;
11
- /** @internal */
12
- readonly nativeElement: HTMLLinkElement | HTMLButtonElement;
13
- href: string;
14
- target: '_blank' | '_parent' | '_self' | '_top' | '';
15
- rel: string;
16
- download?: string;
17
- protected render(): TemplateResult;
18
- protected renderContent(): TemplateResult;
19
- }
20
- export {};
21
- //# sourceMappingURL=interactive-link.d.ts.map
@@ -1,28 +0,0 @@
1
- export * from './control/checkbox-form-control.js';
2
- export * from './control/checkbox-group-form-control.js';
3
- export * from './control/form-control.js';
4
- export * from './control/listbox-form-control.js';
5
- export * from './control/number-form-control.js';
6
- export * from './control/option-control.js';
7
- export * from './control/radio-group-form-control.js';
8
- export * from './controllers/active-descendants-controller.js';
9
- export * from './controllers/drag.controller.js';
10
- export * from './controllers/expandable-controller.js';
11
- export * from './custom-element.js';
12
- export * from './interactive/interactive-element.js';
13
- export * from './interactive/interactive-link.js';
14
- export * from './mixins/can-be-disabled.js';
15
- export * from './mixins/can-be-expanded.js';
16
- export * from './mixins/is-draggable.js';
17
- export * from './models/drag-event.js';
18
- export * from './models/placement.js';
19
- export * from './models/shape.js';
20
- export * from './models/size.js';
21
- export * from './models/variant.js';
22
- export * from './utils/compute-popover-placement.js';
23
- export * from './utils/dom.js';
24
- export * from './utils/get-unique-id.js';
25
- export * from './utils/lit.js';
26
- export * from './utils/shared-resize-observer.js';
27
- export * from './utils/types.js';
28
- //# sourceMappingURL=main.d.ts.map
@@ -1,7 +0,0 @@
1
- import { CustomElement } from '../custom-element.js';
2
- import { Constructor } from '../utils/types.js';
3
- export interface CanBeDisabled {
4
- disabled: boolean;
5
- }
6
- export declare const CanBeDisabled: <T extends Constructor<CustomElement>>(superClass: T) => Constructor<CanBeDisabled> & T;
7
- //# sourceMappingURL=can-be-disabled.d.ts.map
@@ -1,10 +0,0 @@
1
- import { CustomElement } from '../custom-element.js';
2
- import { Constructor } from '../utils/types.js';
3
- import { CanBeDisabled } from './can-be-disabled.js';
4
- export interface CanBeExpanded {
5
- expanded: boolean;
6
- toggle(state?: boolean, emitEvent?: boolean): void;
7
- getExpandControl(): HTMLElement | null;
8
- }
9
- export declare const CanBeExpanded: <T extends Constructor<CustomElement & CanBeDisabled>>(superClass: T) => Constructor<CanBeExpanded> & T;
10
- //# sourceMappingURL=can-be-expanded.d.ts.map
@@ -1,16 +0,0 @@
1
- import { CustomElement } from '../custom-element.js';
2
- import { DragEvent, Position } from '../models/drag-event.js';
3
- import { Constructor } from '../utils/types.js';
4
- export declare const IS_DRAG_ACTIVE_ATTRIBUTE = "odx-drag-active";
5
- export interface IsDraggable {
6
- dragDisabled: boolean;
7
- get isDragActive(): boolean;
8
- beforeDragStart?(event: DragEvent): void;
9
- dragStart?(event: DragEvent): void;
10
- dragMove?(event: DragEvent): void;
11
- dragEnd?(event: DragEvent): void;
12
- afterDragEnd?(event: DragEvent): void;
13
- getDistance?(container: HTMLElement, position: Position): number;
14
- }
15
- export declare const IsDraggable: <T extends Constructor<CustomElement>>(superClass: T) => Constructor<IsDraggable & HTMLElement> & T;
16
- //# sourceMappingURL=is-draggable.d.ts.map
@@ -1,9 +0,0 @@
1
- export type Position = {
2
- x: number;
3
- y: number;
4
- };
5
- export interface DragEvent {
6
- event: PointerEvent;
7
- position: Position;
8
- }
9
- //# sourceMappingURL=drag-event.d.ts.map
@@ -1,17 +0,0 @@
1
- import { ValuesOf } from '../utils/types.js';
2
- export type Placement = ValuesOf<typeof Placement>;
3
- export declare const Placement: {
4
- readonly TOP: "top";
5
- readonly TOP_START: "top-start";
6
- readonly TOP_END: "top-end";
7
- readonly RIGHT: "right";
8
- readonly RIGHT_START: "right-start";
9
- readonly RIGHT_END: "right-end";
10
- readonly BOTTOM: "bottom";
11
- readonly BOTTOM_START: "bottom-start";
12
- readonly BOTTOM_END: "bottom-end";
13
- readonly LEFT: "left";
14
- readonly LEFT_START: "left-start";
15
- readonly LEFT_END: "left-end";
16
- };
17
- //# sourceMappingURL=placement.d.ts.map
@@ -1,7 +0,0 @@
1
- import { ValuesOf } from '../utils/types.js';
2
- export type Shape = ValuesOf<typeof Shape>;
3
- export declare const Shape: {
4
- readonly CIRCLE: "circle";
5
- readonly RECTANGLE: "rectangle";
6
- };
7
- //# sourceMappingURL=shape.d.ts.map