@orangelogic/design-system 2.77.0 → 2.78.0-ci.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/library/chunks/{button.csCRiZzY.js → button.DS64Tr8Z.js} +2 -4
- package/library/chunks/{color-swatch-group.CKdXj10T.js → color-swatch-group.DLXAJdU4.js} +1 -1
- package/library/chunks/{confirm-popover.Kx6YyQwp.js → confirm-popover.BNjRvnN0.js} +1 -1
- package/library/chunks/{file-on-demand.BJZ5E8XT.js → file-on-demand.BTTdth3o.js} +4 -4
- package/library/chunks/{folder-select.BqLmIlj6.js → folder-select.B2qxSKA5.js} +1 -1
- package/library/chunks/{index.VbMreXxL.js → index.Bx0otwQo.js} +1 -1
- package/library/chunks/{list-editor.BzzQoZe1.js → list-editor.C2ZRwPIG.js} +2 -2
- package/library/chunks/{pagination.BXCr_5om.js → pagination.DZq0IZjI.js} +83 -73
- package/library/chunks/{tab-group.G24wrely.js → tab-group.Dg6a82ei.js} +1 -1
- package/library/chunks/{table.34yySlt-.js → table.COCT3Fsb.js} +664 -516
- package/library/chunks/url.Cj9cIQXJ.js +27 -0
- package/library/components/asset-link-format.js +1 -1
- package/library/components/atoms.js +4 -4
- package/library/components/button.js +1 -1
- package/library/components/color-picker.js +1 -1
- package/library/components/color-swatch-group.js +2 -2
- package/library/components/confirm-popover.js +2 -2
- package/library/components/dynamic-select.js +1 -1
- package/library/components/element-clamp.js +1 -1
- package/library/components/file-on-demand.js +5 -5
- package/library/components/folder-select.js +1 -1
- package/library/components/line-clamp.js +1 -1
- package/library/components/list-editor.js +3 -3
- package/library/components/molecules.js +3 -3
- package/library/components/organisms.js +2 -2
- package/library/components/pagination.js +2 -2
- package/library/components/select.js +156 -127
- package/library/components/tab-group.js +2 -2
- package/library/components/table.js +3 -3
- package/library/components/textarea.js +200 -174
- package/library/components/types.js +10217 -10205
- package/library/components/video.js +3521 -3499
- package/library/package.json +4 -1
- package/library/packages/atoms/src/components/pagination/pagination.d.ts +2 -1
- package/library/packages/atoms/src/components/select/select.d.ts +11 -0
- package/library/packages/atoms/src/components/table/tabulator-tables/modules/Ajax/Ajax.d.ts +1 -1
- package/library/packages/atoms/src/components/table/tabulator-tables/modules/Edit/Edit.d.ts +1 -0
- package/library/packages/atoms/src/components/table/tabulator-tables/modules/Edit/List.d.ts +32 -1
- package/library/packages/atoms/src/components/textarea/textarea.d.ts +19 -4
- package/library/packages/organisms/src/carousel/carousel.d.ts +2 -0
- package/library/packages/types/src/table.d.ts +2 -0
- package/library/packages/types/src/textarea.d.ts +4 -0
- package/library/packages/utils/src/url/url.d.ts +9 -0
- package/library/react-web-component.d.ts +10 -6
- package/library/utils.js +34 -33
- package/package.json +4 -1
- package/library/chunks/url.LjsR2sB5.js +0 -15
package/library/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orangelogic/design-system",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.78.0-ci.3",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"types": "library/types.d.ts",
|
|
7
7
|
"scripts": {
|
|
@@ -45,5 +45,8 @@
|
|
|
45
45
|
},
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public"
|
|
48
|
+
},
|
|
49
|
+
"nx": {
|
|
50
|
+
"projectType": "application"
|
|
48
51
|
}
|
|
49
52
|
}
|
|
@@ -13,7 +13,7 @@ import { default as CxTypography } from '../typography/typography';
|
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* @summary Pagination component displays the current page and allows the user to navigate through pages.
|
|
16
|
-
* @description Set `show-pagination-input` to render an editable page input in page counters. Leave it unset to keep the original plain-text counters. Use `back-icon-name` and `next-icon-name` to override the previous/next icon-button glyphs (see the icon component for available names). Use `icon-button-size` for all navigation icon buttons (`small`, `medium`, `large`, `x-large`).
|
|
16
|
+
* @description Set `show-pagination-input` to render an editable page input in page counters. Leave it unset to keep the original plain-text counters. When only one page is available, navigation buttons are hidden and page counters remain plain text. Use `back-icon-name` and `next-icon-name` to override the previous/next icon-button glyphs (see the icon component for available names). Use `icon-button-size` for all navigation icon buttons (`small`, `medium`, `large`, `x-large`).
|
|
17
17
|
*
|
|
18
18
|
* @cssproperty --width - The width of the select
|
|
19
19
|
*
|
|
@@ -95,6 +95,7 @@ export default class CxPagination extends CortexElement {
|
|
|
95
95
|
get pageEnd(): number;
|
|
96
96
|
get prevDisabled(): boolean;
|
|
97
97
|
get nextDisabled(): boolean;
|
|
98
|
+
private get hasMultiplePages();
|
|
98
99
|
private updatePageCount;
|
|
99
100
|
private handlePageSizeSelectChange;
|
|
100
101
|
private handleFirst;
|
|
@@ -86,6 +86,12 @@ export default class CxSelect extends CortexElement implements CortexFormControl
|
|
|
86
86
|
* be an array. **For this reason, values must not contain spaces.**
|
|
87
87
|
*/
|
|
88
88
|
value: string | string[];
|
|
89
|
+
/**
|
|
90
|
+
* The fallback option value used when the select value does not match
|
|
91
|
+
* any explicitly declared option.
|
|
92
|
+
* The original unmatched value is preserved for form submission.
|
|
93
|
+
*/
|
|
94
|
+
fallbackOptionValue: string;
|
|
89
95
|
/**
|
|
90
96
|
* The default value of the form control. Primarily used for resetting the form control.
|
|
91
97
|
*/
|
|
@@ -321,6 +327,11 @@ export default class CxSelect extends CortexElement implements CortexFormControl
|
|
|
321
327
|
* Gets an array of all visible <cx-option> elements
|
|
322
328
|
*/
|
|
323
329
|
private getVisibleOptions;
|
|
330
|
+
/**
|
|
331
|
+
* Resolves selected options for the current value and applies fallback selection
|
|
332
|
+
* when unmatched values exist and `fallbackOptionValue` is configured.
|
|
333
|
+
*/
|
|
334
|
+
private getOptionsForValue;
|
|
324
335
|
/**
|
|
325
336
|
* Sets the current option, which is the option the user is currently interacting with (e.g. via keyboard). Only one
|
|
326
337
|
* option may be "current" at a time.
|
|
@@ -15,7 +15,7 @@ export default class Ajax extends Module {
|
|
|
15
15
|
params: Record<string, unknown> | false;
|
|
16
16
|
loaderPromise: LoaderPromise | false;
|
|
17
17
|
contentTypeFormatters: Record<string, AjaxContentType>;
|
|
18
|
-
private fetchApi;
|
|
18
|
+
private readonly fetchApi;
|
|
19
19
|
static defaultLoaderPromise: LoaderPromise;
|
|
20
20
|
constructor(table: Tabulator);
|
|
21
21
|
initialize(): void;
|
|
@@ -43,6 +43,7 @@ export default class Edit extends Module {
|
|
|
43
43
|
clearEditor(cancel: boolean): void;
|
|
44
44
|
cancelEdit(): void;
|
|
45
45
|
bindEditor(cell: Cell): void;
|
|
46
|
+
addListEditorTrigger(cell: Cell): void;
|
|
46
47
|
focusCellNoEvent(cell: Cell, block?: boolean): void;
|
|
47
48
|
editCell(cell: ICellComponent | null, forceEdit?: boolean): void;
|
|
48
49
|
focusScrollAdjust(cell: Cell): void;
|
|
@@ -40,6 +40,7 @@ export default class List {
|
|
|
40
40
|
currentItems: ListItem[];
|
|
41
41
|
focusedItem: ListItem | null;
|
|
42
42
|
input: CxSelect;
|
|
43
|
+
initialValue: any;
|
|
43
44
|
initialValues: string[];
|
|
44
45
|
/**
|
|
45
46
|
* Whether the cell is a header cell, used for header filter of type list
|
|
@@ -52,7 +53,7 @@ export default class List {
|
|
|
52
53
|
cancel: CancelCallback;
|
|
53
54
|
success: SuccessCallback;
|
|
54
55
|
};
|
|
55
|
-
private fetchApi;
|
|
56
|
+
private readonly fetchApi;
|
|
56
57
|
constructor(editor: Edit, cell: Cell, onRendered: OnRenderedCallback, success: SuccessCallback, cancel: CancelCallback, editorParams: ListEditorParams);
|
|
57
58
|
/**
|
|
58
59
|
* cx-select only accepts string values without spaces
|
|
@@ -60,6 +61,7 @@ export default class List {
|
|
|
60
61
|
*/
|
|
61
62
|
sanitizeValue(value: any): string;
|
|
62
63
|
_initializeValue(): Promise<void>;
|
|
64
|
+
_getSanitizedInitialValues(initialValue: any): string[];
|
|
63
65
|
_onRendered(): Promise<void>;
|
|
64
66
|
clickStop(e: MouseEvent): void;
|
|
65
67
|
/**
|
|
@@ -83,6 +85,16 @@ export default class List {
|
|
|
83
85
|
_uniqueColumnValues(field?: string): string[];
|
|
84
86
|
_emptyValueCheck(value: any): boolean;
|
|
85
87
|
_parseList(inputValues: ListInputValues | Record<string, any>): ListItem[];
|
|
88
|
+
/**
|
|
89
|
+
* Appends a fallback option when `fallbackOptionValue` is configured
|
|
90
|
+
* and not explicitly declared in the list values.
|
|
91
|
+
*/
|
|
92
|
+
_appendFallbackOptionItem(data: ListItem[]): void;
|
|
93
|
+
/**
|
|
94
|
+
* Checks recursively whether grouped/flat list items already contain
|
|
95
|
+
* a given sanitized option value.
|
|
96
|
+
*/
|
|
97
|
+
_hasListItemValue(items: ListItem[], sanitizedValue: string): boolean;
|
|
86
98
|
_parseListItem(option: any, level: number): ListItem;
|
|
87
99
|
_parseListGroup(option: any, level: number): ListItem;
|
|
88
100
|
_sortOptions(options: ListItem[]): ListItem[];
|
|
@@ -102,6 +114,25 @@ export default class List {
|
|
|
102
114
|
_cancel(): void;
|
|
103
115
|
_chooseItem(item: ListItem, silent?: boolean): void;
|
|
104
116
|
_getCommittedOutput(): any;
|
|
117
|
+
/**
|
|
118
|
+
* Resolves the selected values once so preserved fallback arrays are not
|
|
119
|
+
* inserted into a single selected-option slot.
|
|
120
|
+
*/
|
|
121
|
+
_getCommittedMultipleOutput(options: HTMLElement[]): any[];
|
|
122
|
+
_getMappedOptionOutput(sanitized: string): any;
|
|
123
|
+
_getPreservedInputValueOutput(value: any): any;
|
|
124
|
+
_getPreservedFallbackMultipleOutput(sanitizedOptions: string[]): {
|
|
125
|
+
hasValue: false;
|
|
126
|
+
} | {
|
|
127
|
+
hasValue: true;
|
|
128
|
+
value: any[];
|
|
129
|
+
};
|
|
130
|
+
/**
|
|
131
|
+
* Checks for a preserved unmatched editor value when the selected option is
|
|
132
|
+
* the configured fallback option used for undeclared values.
|
|
133
|
+
*/
|
|
134
|
+
_hasPreservedFallbackOptionOutput(sanitized: string): boolean;
|
|
135
|
+
_hasPreservedUnmatchedInputValue(inputValues: any[], sanitizedFallbackOptionValue: string): boolean;
|
|
105
136
|
_resolveValue(commitItem?: ListItem): void;
|
|
106
137
|
}
|
|
107
138
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CortexFormControl, default as CortexElement } from '../../../../base/src/cortex-element.ts';
|
|
2
|
+
import { TextareaRows } from '../../../../types/src/textarea';
|
|
2
3
|
import { CSSResultGroup } from 'lit';
|
|
3
4
|
|
|
4
5
|
/**
|
|
@@ -20,6 +21,8 @@ import { CSSResultGroup } from 'lit';
|
|
|
20
21
|
* @csspart base - The component's base wrapper.
|
|
21
22
|
* @csspart textarea - The internal `<textarea>` control.
|
|
22
23
|
* @csspart character-count - The container that wraps the character count.
|
|
24
|
+
*
|
|
25
|
+
* @typedef {number | 'max'} TextareaRows - Use a number for a fixed row count. Use `'max'` to fill the parent container height (parent must have a definite height). With `'max'`, `resize="vertical"` and `resize="none"` work; `resize="auto"` does not (it is disabled).
|
|
23
26
|
*/
|
|
24
27
|
export default class CxTextarea extends CortexElement implements CortexFormControl {
|
|
25
28
|
static styles: CSSResultGroup;
|
|
@@ -27,6 +30,7 @@ export default class CxTextarea extends CortexElement implements CortexFormContr
|
|
|
27
30
|
private readonly hasSlotController;
|
|
28
31
|
private resizeObserver;
|
|
29
32
|
input: HTMLTextAreaElement;
|
|
33
|
+
private formControlRoot;
|
|
30
34
|
private hasFocus;
|
|
31
35
|
title: string;
|
|
32
36
|
/** The name of the textarea, submitted as a name/value pair with form data. */
|
|
@@ -43,9 +47,17 @@ export default class CxTextarea extends CortexElement implements CortexFormContr
|
|
|
43
47
|
helpText: string;
|
|
44
48
|
/** Placeholder text to show as a hint when the input is empty. */
|
|
45
49
|
placeholder: string;
|
|
46
|
-
/**
|
|
47
|
-
|
|
48
|
-
|
|
50
|
+
/**
|
|
51
|
+
* The number of rows to display by default.
|
|
52
|
+
* Set to `"max"` (or `TextareaRows.Max`) to make the textarea fill its parent container height.
|
|
53
|
+
* The parent element must have a definite height (e.g. via flex, grid, or an explicit `height`) for `"max"` to take effect.
|
|
54
|
+
* With `"max"`, `resize="vertical"` (default) and `resize="none"` are supported; `resize="auto"` is not (fill height and auto-grow conflict, so auto resize is disabled).
|
|
55
|
+
*/
|
|
56
|
+
rows: number | TextareaRows;
|
|
57
|
+
/**
|
|
58
|
+
* Controls how the textarea can be resized.
|
|
59
|
+
* When `rows` is `"max"`, `auto` is ignored; use `vertical` or `none`.
|
|
60
|
+
*/
|
|
49
61
|
resize: 'none' | 'vertical' | 'auto';
|
|
50
62
|
/** Disables the textarea. */
|
|
51
63
|
disabled: boolean;
|
|
@@ -87,13 +99,16 @@ export default class CxTextarea extends CortexElement implements CortexFormContr
|
|
|
87
99
|
inputMode: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';
|
|
88
100
|
/** The default value of the form control. Primarily used for resetting the form control. */
|
|
89
101
|
defaultValue: string;
|
|
102
|
+
/** Tracks the px height applied by fill-mode so we can distinguish a host resize (recalculate) from a user drag (preserve). */
|
|
103
|
+
private _fillHeightPx;
|
|
90
104
|
/** Gets the validity state object */
|
|
91
105
|
get validity(): ValidityState;
|
|
92
106
|
/** Gets the validation message */
|
|
93
107
|
get validationMessage(): string;
|
|
94
|
-
|
|
108
|
+
connectedUpdatedCallback(): void;
|
|
95
109
|
runFirstUpdated(): void;
|
|
96
110
|
disconnectedCallback(): void;
|
|
111
|
+
private updateResizeObserver;
|
|
97
112
|
private handleBlur;
|
|
98
113
|
private handleChange;
|
|
99
114
|
private handleFocus;
|
|
@@ -205,6 +205,7 @@ export default class CxCarousel extends CortexElement {
|
|
|
205
205
|
* The timeout for the fade transition. (Only for programmatically scroll by gsap)
|
|
206
206
|
*/
|
|
207
207
|
fadeTimeout: ReturnType<typeof setTimeout> | null;
|
|
208
|
+
private fadeTransitionToken;
|
|
208
209
|
/**
|
|
209
210
|
* The range of the carousel. Presenting current visible slides index range.
|
|
210
211
|
*/
|
|
@@ -339,6 +340,7 @@ export default class CxCarousel extends CortexElement {
|
|
|
339
340
|
*/
|
|
340
341
|
goToSlide(index: number, behavior?: ScrollBehavior): void;
|
|
341
342
|
private removeCloneContainer;
|
|
343
|
+
private finishFadeTransition;
|
|
342
344
|
/**
|
|
343
345
|
* Scrolls to the given slide, allowing an optional duration (in ms) for the scroll animation.
|
|
344
346
|
* If duration is provided and behavior is 'smooth', a custom smooth scroll is performed.
|
|
@@ -2441,6 +2441,8 @@ export interface ListEditorParams extends SharedEditorParams, SharedSelectAutoCo
|
|
|
2441
2441
|
valuesURL?: string;
|
|
2442
2442
|
valuesLookup?: ListEditorValuesLookup;
|
|
2443
2443
|
valuesLookupField?: string;
|
|
2444
|
+
fallbackOptionLabel?: string;
|
|
2445
|
+
fallbackOptionValue?: string | number | boolean;
|
|
2444
2446
|
clearable?: boolean;
|
|
2445
2447
|
getItemLabel?: (label: string, value: string, item: any, element: HTMLElement) => string;
|
|
2446
2448
|
sort?: SortDirection;
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the relative portion of a URL when it shares the same origin as the
|
|
3
|
+
* current page (or the provided `origin`). Returns the original value unchanged
|
|
4
|
+
* when the URL is cross-origin, already relative, or falsy.
|
|
5
|
+
*
|
|
6
|
+
* @param url - The URL to normalise.
|
|
7
|
+
* @param origin - Origin to compare against (defaults to `window.location.origin`).
|
|
8
|
+
*/
|
|
9
|
+
export declare function toRelativeUrl(url: string | null | undefined, origin?: string): string | undefined;
|
|
1
10
|
export declare const appendProtocol: (inputUrl: string, defaultProtocol?: string, ignoreRelativeUrl?: boolean) => string;
|
|
2
11
|
export declare const isValidUrl: (urlString: string) => boolean;
|
|
3
12
|
export declare const RELATIVE_URL_REGEX: string;
|