@randstad-uca/design-system 1.0.116 → 1.0.117
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/Select.d.ts +34 -9
- package/dist/index.js +93 -86
- package/dist/index.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/stories/Select.stories.d.ts +17 -0
- package/package.json +1 -1
|
@@ -6,6 +6,9 @@ type SelectOption = string | {
|
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
icon?: string;
|
|
8
8
|
};
|
|
9
|
+
type FetchFn = (term: string, opts: {
|
|
10
|
+
signal: AbortSignal;
|
|
11
|
+
}) => Promise<SelectOption[]>;
|
|
9
12
|
export declare class FilterableSelect extends BaseControl {
|
|
10
13
|
value: string | object;
|
|
11
14
|
defaultValue: string;
|
|
@@ -13,32 +16,43 @@ export declare class FilterableSelect extends BaseControl {
|
|
|
13
16
|
filterable: boolean | undefined;
|
|
14
17
|
private get _effectiveFilterable();
|
|
15
18
|
maxLength?: number;
|
|
19
|
+
keydownRegex?: string;
|
|
16
20
|
textLabelFilterNotResult: string;
|
|
17
21
|
textLabelMobileSearch: string;
|
|
18
22
|
isRenderClearButton: boolean;
|
|
19
23
|
sortable: boolean;
|
|
24
|
+
fetcher?: FetchFn;
|
|
25
|
+
minSearch: number;
|
|
26
|
+
textLabelLoading: string;
|
|
27
|
+
debounceMs: number;
|
|
20
28
|
private isMobile;
|
|
21
29
|
private highlightedIndex;
|
|
22
30
|
private _isCleared;
|
|
23
|
-
private
|
|
24
|
-
private
|
|
31
|
+
private static _scrollLockCount;
|
|
32
|
+
private static _scrollLockStylesheet;
|
|
25
33
|
filteredOptions: SelectOption[];
|
|
26
34
|
filterValue: string;
|
|
27
35
|
isOpen: boolean;
|
|
28
36
|
mobileFilterValue: string;
|
|
29
37
|
private showNoResults;
|
|
38
|
+
private _isLoading;
|
|
30
39
|
lastElement: boolean;
|
|
40
|
+
private _prevIsMobile;
|
|
41
|
+
private _lastFetchTerm;
|
|
42
|
+
private _fetchedOptions;
|
|
31
43
|
mobileInputRef: HTMLInputElement;
|
|
44
|
+
private _desktopInput;
|
|
45
|
+
private _desktopFake;
|
|
46
|
+
private _iconButton;
|
|
47
|
+
private _optionsList;
|
|
32
48
|
private debounceTimeout;
|
|
49
|
+
private _abortController;
|
|
50
|
+
private _boundHandleClickOutside;
|
|
33
51
|
static styles: import("lit").CSSResult[];
|
|
34
52
|
/**
|
|
35
53
|
* Función auxiliar para aplicar/limpiar los estilos de bloqueo.
|
|
36
54
|
*/
|
|
37
|
-
private
|
|
38
|
-
/**
|
|
39
|
-
* Bloquea/Desbloquea el scroll manipulando directamente <html> y guardando el estado.
|
|
40
|
-
* @param block Si es true, bloquea; si es false, limpia.
|
|
41
|
-
*/
|
|
55
|
+
private static _ensureScrollLockStyles;
|
|
42
56
|
private toggleDynamicScrollLock;
|
|
43
57
|
private getOptionLabel;
|
|
44
58
|
/**
|
|
@@ -48,8 +62,6 @@ export declare class FilterableSelect extends BaseControl {
|
|
|
48
62
|
private normalizeText;
|
|
49
63
|
private sortOptions;
|
|
50
64
|
private _computeFilteredOptions;
|
|
51
|
-
filterAndSortOptions(): void;
|
|
52
|
-
private _sortedOptionsCopy;
|
|
53
65
|
private handleOptionHover;
|
|
54
66
|
update(changedProperties: Map<string, any>): void;
|
|
55
67
|
protected willUpdate(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
@@ -70,6 +82,13 @@ export declare class FilterableSelect extends BaseControl {
|
|
|
70
82
|
* Previene que el primer carácter ingresado sea un espacio o carácter especial.
|
|
71
83
|
*/
|
|
72
84
|
private preventInvalidStart;
|
|
85
|
+
/**
|
|
86
|
+
* Aplica una expresión regex personalizada para limitar caracteres permitidos en el input.
|
|
87
|
+
* Replica la lógica de Form.ts: extrae grupos de corchetes y valida carácter por carácter.
|
|
88
|
+
* Si hay 2+ grupos, el primero valida el primer carácter y el segundo el resto.
|
|
89
|
+
* Si hay 1 grupo, se aplica a todos los caracteres.
|
|
90
|
+
*/
|
|
91
|
+
private onlyRegex;
|
|
73
92
|
/**
|
|
74
93
|
* Previene que el texto pegado comience con un espacio o carácter especial si el cursor está al inicio.
|
|
75
94
|
*/
|
|
@@ -92,7 +111,13 @@ export declare class FilterableSelect extends BaseControl {
|
|
|
92
111
|
*/
|
|
93
112
|
handleBlur(): void;
|
|
94
113
|
private scrollHighlightedIntoView;
|
|
114
|
+
private _emitEmptySelection;
|
|
115
|
+
private _fetchAsyncResults;
|
|
116
|
+
private _sanitize;
|
|
117
|
+
private _firstCharRegex;
|
|
118
|
+
private _sanitizeInputValue;
|
|
95
119
|
private renderOptionIcon;
|
|
120
|
+
private _renderOptionItem;
|
|
96
121
|
private validateAndCleanOnBlur;
|
|
97
122
|
render(): TemplateResult<1>;
|
|
98
123
|
}
|