@ibobbyts/svelte-ui-utils 0.4.3 → 0.4.5
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/README.md +119 -14
- package/dist/data-table/FilterControl.svelte +30 -4
- package/dist/data-table/FilterControl.svelte.d.ts.map +1 -1
- package/dist/data-table/filter.d.ts +3 -1
- package/dist/data-table/filter.d.ts.map +1 -1
- package/dist/data-table/filter.js +4 -0
- package/dist/data-table/index.d.ts +1 -1
- package/dist/data-table/index.d.ts.map +1 -1
- package/dist/data-table/types.d.ts +41 -11
- package/dist/data-table/types.d.ts.map +1 -1
- package/dist/dialog/ConfirmDialog.svelte +2 -0
- package/dist/dialog/ConfirmDialog.svelte.d.ts +1 -0
- package/dist/dialog/ConfirmDialog.svelte.d.ts.map +1 -1
- package/dist/dialog/Dialog.svelte +164 -71
- package/dist/dialog/Dialog.svelte.d.ts +1 -0
- package/dist/dialog/Dialog.svelte.d.ts.map +1 -1
- package/dist/dropdown/Dropdown.svelte +470 -43
- package/dist/dropdown/Dropdown.svelte.d.ts +18 -1
- package/dist/dropdown/Dropdown.svelte.d.ts.map +1 -1
- package/dist/dropdown/DropdownMultiSelect.svelte +2 -0
- package/dist/dropdown/DropdownMultiSelect.svelte.d.ts +1 -0
- package/dist/dropdown/DropdownMultiSelect.svelte.d.ts.map +1 -1
- package/dist/dropdown/index.d.ts +1 -1
- package/dist/dropdown/index.d.ts.map +1 -1
- package/dist/dropdown/types.d.ts +24 -2
- package/dist/dropdown/types.d.ts.map +1 -1
- package/dist/dropdown-search/DropdownSearch.svelte +12 -10
- package/dist/dropdown-search/DropdownSearch.svelte.d.ts +2 -2
- package/dist/dropdown-search/DropdownSearch.svelte.d.ts.map +1 -1
- package/dist/dropdown-search/DropdownSearchMultiSelect.svelte +3 -3
- package/dist/dropdown-search/DropdownSearchMultiSelect.svelte.d.ts +2 -2
- package/dist/dropdown-search/index.d.ts +1 -1
- package/dist/dropdown-search/types.d.ts +10 -3
- package/dist/dropdown-search/types.d.ts.map +1 -1
- package/dist/pagination/Pagination.svelte +5 -4
- package/dist/pagination/Pagination.svelte.d.ts.map +1 -1
- package/dist/style.css +119 -0
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type UiLanguage } from '../i18n.js';
|
|
2
|
+
import type { DropdownInputStyle, DropdownItemLabelGetter, DropdownLoadOptions, DropdownMenuAlign, DropdownOption, DropdownOptionGroup, DropdownPlacement, DropdownSelectionChangeHandler, DropdownSearchChangeHandler, DropdownSelection, DropdownTriggerClickHandler } from './types.js';
|
|
2
3
|
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
4
|
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
5
|
$$bindings?: Bindings;
|
|
@@ -18,7 +19,20 @@ declare const Dropdown: $$__sveltets_2_IsomorphicComponent<{
|
|
|
18
19
|
multiselect?: boolean;
|
|
19
20
|
options?: DropdownOption[];
|
|
20
21
|
optionGroups?: DropdownOptionGroup[] | undefined;
|
|
22
|
+
/** Labels for controlled values that are not present in the current search result. */ selectedOptions?: DropdownOption[];
|
|
21
23
|
groupsCollapsedByDefault?: "true" | "false" | "auto";
|
|
24
|
+
search?: boolean;
|
|
25
|
+
input_style?: DropdownInputStyle;
|
|
26
|
+
getItemLabel?: DropdownItemLabelGetter;
|
|
27
|
+
loadOptions?: DropdownLoadOptions | undefined;
|
|
28
|
+
searchDebounceMs?: number;
|
|
29
|
+
searchLimit?: number;
|
|
30
|
+
searchPlaceholder?: string | undefined;
|
|
31
|
+
placeholder?: string | undefined;
|
|
32
|
+
language?: UiLanguage;
|
|
33
|
+
loadingText?: string | undefined;
|
|
34
|
+
noResultsText?: string | undefined;
|
|
35
|
+
errorText?: string | undefined;
|
|
22
36
|
ariaLabel?: string | undefined;
|
|
23
37
|
placement?: DropdownPlacement;
|
|
24
38
|
menuAlign?: DropdownMenuAlign;
|
|
@@ -33,8 +47,11 @@ declare const Dropdown: $$__sveltets_2_IsomorphicComponent<{
|
|
|
33
47
|
className?: string | undefined;
|
|
34
48
|
portal?: boolean;
|
|
35
49
|
onChange?: DropdownSelectionChangeHandler | undefined;
|
|
50
|
+
onSearchChange?: DropdownSearchChangeHandler | undefined;
|
|
36
51
|
onTriggerClick?: DropdownTriggerClickHandler | undefined;
|
|
37
52
|
}, {
|
|
53
|
+
mousedown: MouseEvent;
|
|
54
|
+
} & {
|
|
38
55
|
[evt: string]: CustomEvent<any>;
|
|
39
56
|
}, {}, {}, string>;
|
|
40
57
|
type Dropdown = InstanceType<typeof Dropdown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dropdown.svelte.d.ts","sourceRoot":"","sources":["../../src/lib/dropdown/Dropdown.svelte.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Dropdown.svelte.d.ts","sourceRoot":"","sources":["../../src/lib/dropdown/Dropdown.svelte.ts"],"names":[],"mappings":"AAOA,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,KAAK,EAER,kBAAkB,EAClB,uBAAuB,EACvB,mBAAmB,EAGnB,iBAAiB,EAGjB,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EACjB,8BAA8B,EAC9B,2BAA2B,EAC3B,iBAAiB,EACjB,2BAA2B,EAE5B,MAAM,YAAY,CAAC;AAq6BtB,UAAU,kCAAkC,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,OAAO,GAAG,EAAE,EAAE,QAAQ,GAAG,MA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AC,OAAO,QAAQ,CAAC,CAAC;AAChD,eAAe,QAAQ,CAAC"}
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
export let value: DropdownMultiValue = [];
|
|
17
17
|
export let options: DropdownOption[] = [];
|
|
18
18
|
export let optionGroups: DropdownOptionGroup[] | undefined = undefined;
|
|
19
|
+
export let selectedOptions: DropdownOption[] = [];
|
|
19
20
|
export let groupsCollapsedByDefault: 'true' | 'false' | 'auto' = 'false';
|
|
20
21
|
export let ariaLabel: string | undefined = undefined;
|
|
21
22
|
export let placement: DropdownPlacement = 'auto';
|
|
@@ -38,6 +39,7 @@
|
|
|
38
39
|
multiselect={true}
|
|
39
40
|
{options}
|
|
40
41
|
{optionGroups}
|
|
42
|
+
{selectedOptions}
|
|
41
43
|
{groupsCollapsedByDefault}
|
|
42
44
|
{ariaLabel}
|
|
43
45
|
{placement}
|
|
@@ -17,6 +17,7 @@ declare const DropdownMultiSelect: $$__sveltets_2_IsomorphicComponent<{
|
|
|
17
17
|
value?: DropdownMultiValue;
|
|
18
18
|
options?: DropdownOption[];
|
|
19
19
|
optionGroups?: DropdownOptionGroup[] | undefined;
|
|
20
|
+
selectedOptions?: DropdownOption[];
|
|
20
21
|
groupsCollapsedByDefault?: "true" | "false" | "auto";
|
|
21
22
|
ariaLabel?: string | undefined;
|
|
22
23
|
placement?: DropdownPlacement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMultiSelect.svelte.d.ts","sourceRoot":"","sources":["../../src/lib/dropdown/DropdownMultiSelect.svelte.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACR,iBAAiB,EACjB,0BAA0B,EAC1B,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EACjB,2BAA2B,EAC5B,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"DropdownMultiSelect.svelte.d.ts","sourceRoot":"","sources":["../../src/lib/dropdown/DropdownMultiSelect.svelte.ts"],"names":[],"mapp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,MAAM,GAAG,SAAS;;eAAqC,0BAA0B,GAAG,SAAS;qBAAmB,2BAA2B,GAAG,SAAS;;;kBAUvgC,CAAC;AACvF,KAAK,mBAAmB,GAAG,YAAY,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACtE,eAAe,mBAAmB,CAAC"}
|
package/dist/dropdown/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { default as Dropdown } from './Dropdown.svelte';
|
|
2
2
|
export { default as DropdownMultiSelect } from './DropdownMultiSelect.svelte';
|
|
3
|
-
export type { DropdownChangeHandler, DropdownMenuAlign, DropdownMultiChangeHandler, DropdownMultiValue, DropdownOption, DropdownOptionGroup, DropdownPlacement, DropdownSelectionChangeHandler, DropdownSelection, DropdownTriggerClickHandler, DropdownValue } from './types.js';
|
|
3
|
+
export type { DropdownChangeHandler, DropdownInputStyle, DropdownItemLabelGetter, DropdownLoadContext, DropdownLoadOptions, DropdownLoadOptionsResult, DropdownLoadStatus, DropdownMenuAlign, DropdownMultiChangeHandler, DropdownMultiValue, DropdownOption, DropdownOptionGroup, DropdownPlacement, DropdownSelectionChangeHandler, DropdownSearchChangeHandler, DropdownSelection, DropdownTriggerClickHandler, DropdownValue } from './types.js';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/dropdown/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAC9E,YAAY,EACV,qBAAqB,EACrB,iBAAiB,EACjB,0BAA0B,EAC1B,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EACjB,8BAA8B,EAC9B,iBAAiB,EACjB,2BAA2B,EAC3B,aAAa,EACd,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/dropdown/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAC9E,YAAY,EACV,qBAAqB,EACrB,kBAAkB,EAClB,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACnB,yBAAyB,EACzB,kBAAkB,EAClB,iBAAiB,EACjB,0BAA0B,EAC1B,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EACjB,8BAA8B,EAC9B,2BAA2B,EAC3B,iBAAiB,EACjB,2BAA2B,EAC3B,aAAa,EACd,MAAM,YAAY,CAAC"}
|
package/dist/dropdown/types.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Every dropdown submits string values. Callers that keep numeric domain
|
|
3
|
+
* state (e.g. a numeric page size) convert with String/Number at the
|
|
4
|
+
* component boundary so the submitted business value stays unchanged.
|
|
5
|
+
*/
|
|
6
|
+
export type DropdownValue = string;
|
|
7
|
+
export type DropdownMultiValue = string[];
|
|
3
8
|
export type DropdownSelection = DropdownValue | DropdownMultiValue;
|
|
4
9
|
export type DropdownPlacement = 'auto' | 'up' | 'down';
|
|
5
10
|
export type DropdownMenuAlign = 'left' | 'right';
|
|
@@ -20,4 +25,21 @@ export type DropdownSelectionChangeHandler = {
|
|
|
20
25
|
bivarianceHack(value: DropdownSelection): void | Promise<void>;
|
|
21
26
|
}['bivarianceHack'];
|
|
22
27
|
export type DropdownTriggerClickHandler = (event: MouseEvent) => void;
|
|
28
|
+
export type DropdownSearchChangeHandler = (query: string) => void | Promise<void>;
|
|
29
|
+
export type DropdownInputStyle = 'dropdown' | 'input';
|
|
30
|
+
export type DropdownItemLabelGetter = (option: DropdownOption) => string;
|
|
31
|
+
export type DropdownLoadStatus = 'idle' | 'loading' | 'success' | 'error';
|
|
32
|
+
export interface DropdownLoadContext {
|
|
33
|
+
limit: number;
|
|
34
|
+
signal: AbortSignal;
|
|
35
|
+
}
|
|
36
|
+
export interface DropdownLoadOptionsResult {
|
|
37
|
+
/**
|
|
38
|
+
* Flat options. Ignored whenever `optionGroups` is present on the same
|
|
39
|
+
* result — groups are then the sole render source.
|
|
40
|
+
*/
|
|
41
|
+
options?: DropdownOption[];
|
|
42
|
+
optionGroups?: DropdownOptionGroup[];
|
|
43
|
+
}
|
|
44
|
+
export type DropdownLoadOptions = (query: string, context: DropdownLoadContext) => Promise<DropdownLoadOptionsResult> | DropdownLoadOptionsResult;
|
|
23
45
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/lib/dropdown/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/lib/dropdown/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC;AAEnC,MAAM,MAAM,kBAAkB,GAAG,MAAM,EAAE,CAAC;AAE1C,MAAM,MAAM,iBAAiB,GAAG,aAAa,GAAG,kBAAkB,CAAC;AAEnE,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,IAAI,GAAG,MAAM,CAAC;AAEvD,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,OAAO,CAAC;AAEjD,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,mGAAmG;IACnG,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,aAAa,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE,MAAM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
13
13
|
DropdownSearchEnterDetail,
|
|
14
14
|
DropdownSearchItem,
|
|
15
|
-
|
|
15
|
+
DropdownSearchItemLabelGetter,
|
|
16
16
|
DropdownSearchLoadOptions,
|
|
17
17
|
DropdownSearchSelectedItemLabelGetter,
|
|
18
18
|
DropdownSearchSelectedItemsChangeHandler,
|
|
@@ -51,7 +51,9 @@
|
|
|
51
51
|
export let removeSelectedItemLabel:
|
|
52
52
|
| DropdownSearchSelectedItemLabelGetter
|
|
53
53
|
| undefined = undefined;
|
|
54
|
-
|
|
54
|
+
// The input text for a selected item defaults to its display label, never to
|
|
55
|
+
// the submitted `value`.
|
|
56
|
+
export let getItemLabel: DropdownSearchItemLabelGetter = (item) => item.label;
|
|
55
57
|
export let onChange:
|
|
56
58
|
| ((detail: DropdownSearchChangeDetail) => void)
|
|
57
59
|
| undefined = undefined;
|
|
@@ -377,7 +379,7 @@
|
|
|
377
379
|
showingFocusOptions = false;
|
|
378
380
|
selectedItem = item;
|
|
379
381
|
exactMatch = validate ? item : null;
|
|
380
|
-
value =
|
|
382
|
+
value = getItemLabel(item);
|
|
381
383
|
inputValue = value;
|
|
382
384
|
lastHandledValue = value;
|
|
383
385
|
setStatus(validate ? 'valid' : 'empty');
|
|
@@ -387,7 +389,7 @@
|
|
|
387
389
|
}
|
|
388
390
|
|
|
389
391
|
function selectedItemKey(item: DropdownSearchItem): string {
|
|
390
|
-
return
|
|
392
|
+
return item.value;
|
|
391
393
|
}
|
|
392
394
|
|
|
393
395
|
function isSelectedItem(item: DropdownSearchItem): boolean {
|
|
@@ -396,7 +398,7 @@
|
|
|
396
398
|
}
|
|
397
399
|
|
|
398
400
|
function resolveRemoveSelectedItemLabel(item: DropdownSearchItem): string {
|
|
399
|
-
return removeSelectedItemLabel?.(item) ?? `Remove ${item.
|
|
401
|
+
return removeSelectedItemLabel?.(item) ?? `Remove ${item.label}`;
|
|
400
402
|
}
|
|
401
403
|
|
|
402
404
|
function setSelectedItems(nextItems: DropdownSearchItem[]) {
|
|
@@ -597,9 +599,9 @@
|
|
|
597
599
|
class="suu-dropdown-search__selected-items"
|
|
598
600
|
aria-label={selectedItemsLabel}
|
|
599
601
|
>
|
|
600
|
-
{#each selectedItems as item (item.
|
|
602
|
+
{#each selectedItems as item (item.value)}
|
|
601
603
|
<span class="suu-dropdown-search__selected-item">
|
|
602
|
-
<span class="suu-dropdown-search__selected-title">{item.
|
|
604
|
+
<span class="suu-dropdown-search__selected-title">{item.label}</span>
|
|
603
605
|
{#if !disabled}
|
|
604
606
|
<button
|
|
605
607
|
type="button"
|
|
@@ -682,7 +684,7 @@
|
|
|
682
684
|
<span>{resolvedLoadingText}</span>
|
|
683
685
|
</div>
|
|
684
686
|
{:else if options.length > 0}
|
|
685
|
-
{#each options as option (option.
|
|
687
|
+
{#each options as option (option.value)}
|
|
686
688
|
<button
|
|
687
689
|
type="button"
|
|
688
690
|
class="suu-dropdown-search__option"
|
|
@@ -692,7 +694,7 @@
|
|
|
692
694
|
role="option"
|
|
693
695
|
aria-selected={multiselect
|
|
694
696
|
? isSelectedItem(option)
|
|
695
|
-
: selectedItem?.
|
|
697
|
+
: selectedItem?.value === option.value}
|
|
696
698
|
disabled={option.disabled}
|
|
697
699
|
on:mousedown|preventDefault={() => selectItem(option)}
|
|
698
700
|
>
|
|
@@ -703,7 +705,7 @@
|
|
|
703
705
|
</svg>
|
|
704
706
|
</span>
|
|
705
707
|
{/if}
|
|
706
|
-
<span class="suu-dropdown-search__title">{option.
|
|
708
|
+
<span class="suu-dropdown-search__title">{option.label}</span>
|
|
707
709
|
{#if formatParamDict(option.param_dict).length > 0}
|
|
708
710
|
<span class="suu-dropdown-search__meta"
|
|
709
711
|
>{formatParamDict(option.param_dict).join(' · ')}</span
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type UiLanguage } from '../i18n.js';
|
|
2
|
-
import type { DropdownSearchChangeDetail, DropdownSearchEnterDetail, DropdownSearchItem,
|
|
2
|
+
import type { DropdownSearchChangeDetail, DropdownSearchEnterDetail, DropdownSearchItem, DropdownSearchItemLabelGetter, DropdownSearchLoadOptions, DropdownSearchSelectedItemLabelGetter, DropdownSearchSelectedItemsChangeHandler, DropdownSearchStatus } from './types.js';
|
|
3
3
|
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
4
4
|
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
5
5
|
$$bindings?: Bindings;
|
|
@@ -44,7 +44,7 @@ declare const DropdownSearch: $$__sveltets_2_IsomorphicComponent<{
|
|
|
44
44
|
maxWidth?: string | undefined;
|
|
45
45
|
selectedItemsLabel?: string;
|
|
46
46
|
removeSelectedItemLabel?: DropdownSearchSelectedItemLabelGetter | undefined;
|
|
47
|
-
|
|
47
|
+
getItemLabel?: DropdownSearchItemLabelGetter;
|
|
48
48
|
onChange?: ((detail: DropdownSearchChangeDetail) => void) | undefined;
|
|
49
49
|
onSelect?: ((item: DropdownSearchItem) => void) | undefined;
|
|
50
50
|
onDeselect?: ((item: DropdownSearchItem) => void) | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownSearch.svelte.d.ts","sourceRoot":"","sources":["../../src/lib/dropdown-search/DropdownSearch.svelte.ts"],"names":[],"mappings":"AAIA,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAM5D,OAAO,KAAK,EACR,0BAA0B,EAC1B,yBAAyB,EACzB,kBAAkB,EAClB,6BAA6B,EAC7B,yBAAyB,EACzB,qCAAqC,EACrC,wCAAwC,EACxC,oBAAoB,EACrB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"DropdownSearch.svelte.d.ts","sourceRoot":"","sources":["../../src/lib/dropdown-search/DropdownSearch.svelte.ts"],"names":[],"mappings":"AAIA,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,YA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,GAAG,SAAS;kBAAgB,MAAM,GAAG,SAAS;iBAAe,MAAM,GAAG,SAAS;;YAA4E,MAAM,GAAG,SAAS;eAAa,MAAM,GAAG,SAAS;eAAa,MAAM,GAAG,SAAS;;8BAA8E,qCAAqC,GAChhE,SAAS;mBAAiB,6BAA6B;eAAe,CAAC,CAAC,MAAM,EAAE,0BAA0B,KAAK,IAAI,CAAC,GACpH,SAAS;eAAa,CAAC,CAAC,IAAI,EAAE,kBAAkB,KAAK,IAAI,CAAC,GAAG,SAAS;iBAAe,CAAC,CAAC,IAAI,EAAE,kBAAkB,KAAK,IAAI,CAAC,GAAG,SAAS;4BAA4B,wCAAwC,GACzM,SAAS;qBAAqB,CAAC,CAAC,MAAM,EAAE,oBAAoB,KAAK,IAAI,CAAC,GACtE,SAAS;kBAAgB,CAAC,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC,GAAG,SAAS;cAAY,CAAC,CAAC,MAAM,EAAE,yBAAyB,KAAK,IAAI,CAAC,GAAG,SAAS;;;;;kBAU1C,CAAC;AAClF,KAAK,cAAc,GAAG,YAAY,CAAC,OAAO,cAAc,CAAC,CAAC;AAC5D,eAAe,cAAc,CAAC"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import type {
|
|
7
7
|
DropdownSearchChangeDetail,
|
|
8
8
|
DropdownSearchItem,
|
|
9
|
-
|
|
9
|
+
DropdownSearchItemLabelGetter,
|
|
10
10
|
DropdownSearchLoadOptions,
|
|
11
11
|
DropdownSearchSelectedItemLabelGetter,
|
|
12
12
|
DropdownSearchSelectedItemsChangeHandler,
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
export let removeSelectedItemLabel:
|
|
41
41
|
| DropdownSearchSelectedItemLabelGetter
|
|
42
42
|
| undefined = undefined;
|
|
43
|
-
export let
|
|
43
|
+
export let getItemLabel: DropdownSearchItemLabelGetter = (item) => item.label;
|
|
44
44
|
export let onChange:
|
|
45
45
|
| ((detail: DropdownSearchChangeDetail) => void)
|
|
46
46
|
| undefined = undefined;
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
{maxWidth}
|
|
85
85
|
{selectedItemsLabel}
|
|
86
86
|
{removeSelectedItemLabel}
|
|
87
|
-
{
|
|
87
|
+
{getItemLabel}
|
|
88
88
|
{onChange}
|
|
89
89
|
{onSelect}
|
|
90
90
|
{onDeselect}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { UiLanguage } from '../i18n.js';
|
|
2
|
-
import type { DropdownSearchChangeDetail, DropdownSearchItem,
|
|
2
|
+
import type { DropdownSearchChangeDetail, DropdownSearchItem, DropdownSearchItemLabelGetter, DropdownSearchLoadOptions, DropdownSearchSelectedItemLabelGetter, DropdownSearchSelectedItemsChangeHandler, DropdownSearchStatus } from './types.js';
|
|
3
3
|
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
4
4
|
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
5
5
|
$$bindings?: Bindings;
|
|
@@ -39,7 +39,7 @@ declare const DropdownSearchMultiSelect: $$__sveltets_2_IsomorphicComponent<{
|
|
|
39
39
|
maxWidth?: string | undefined;
|
|
40
40
|
selectedItemsLabel?: string;
|
|
41
41
|
removeSelectedItemLabel?: DropdownSearchSelectedItemLabelGetter | undefined;
|
|
42
|
-
|
|
42
|
+
getItemLabel?: DropdownSearchItemLabelGetter;
|
|
43
43
|
onChange?: ((detail: DropdownSearchChangeDetail) => void) | undefined;
|
|
44
44
|
onSelect?: ((item: DropdownSearchItem) => void) | undefined;
|
|
45
45
|
onDeselect?: ((item: DropdownSearchItem) => void) | undefined;
|
|
@@ -3,5 +3,5 @@ export { default as DropdownSearchMultiSelect } from './DropdownSearchMultiSelec
|
|
|
3
3
|
export { getUiMessages, resolveUiLanguage, uiLanguages } from '../i18n.js';
|
|
4
4
|
export { clampDropdownSearchLimit, formatParamDict, isUsableExactMatch, normalizeDropdownSearchValue, resolveDropdownSearchStatus, } from './state.js';
|
|
5
5
|
export type { UiLanguage, UiMessages } from '../i18n.js';
|
|
6
|
-
export type { DropdownSearchChangeDetail, DropdownSearchEnterDetail, DropdownSearchItem,
|
|
6
|
+
export type { DropdownSearchChangeDetail, DropdownSearchEnterDetail, DropdownSearchItem, DropdownSearchItemLabelGetter, DropdownSearchLoadContext, DropdownSearchLoadOptions, DropdownSearchSelectedItemLabelGetter, DropdownSearchSelectedItemsChangeHandler, DropdownSearchResult, DropdownSearchStatus, } from './types.js';
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
export type DropdownSearchStatus = 'empty' | 'loading' | 'valid' | 'invalid' | 'error';
|
|
2
|
+
/**
|
|
3
|
+
* Search options and selected chips use the unified label/value contract:
|
|
4
|
+
* `label` is the display text, `value` is the submitted string identifier.
|
|
5
|
+
* Extra business fields (e.g. `param_dict`) are preserved as metadata.
|
|
6
|
+
*/
|
|
2
7
|
export interface DropdownSearchItem {
|
|
3
|
-
|
|
4
|
-
|
|
8
|
+
label: string;
|
|
9
|
+
value: string;
|
|
5
10
|
param_dict?: Record<string, string | number | null>;
|
|
6
11
|
disabled?: boolean;
|
|
7
12
|
[key: string]: unknown;
|
|
@@ -16,6 +21,7 @@ export interface DropdownSearchResult {
|
|
|
16
21
|
}
|
|
17
22
|
export type DropdownSearchLoadOptions = (query: string, context: DropdownSearchLoadContext) => Promise<DropdownSearchResult> | DropdownSearchResult;
|
|
18
23
|
export interface DropdownSearchChangeDetail {
|
|
24
|
+
/** Free-text input content; distinct from the submitted `DropdownSearchItem.value`. */
|
|
19
25
|
value: string;
|
|
20
26
|
selectedItem: DropdownSearchItem | null;
|
|
21
27
|
selectedItems: DropdownSearchItem[];
|
|
@@ -26,7 +32,8 @@ export interface DropdownSearchEnterDetail extends DropdownSearchChangeDetail {
|
|
|
26
32
|
exactMatch: DropdownSearchItem | null;
|
|
27
33
|
options: DropdownSearchItem[];
|
|
28
34
|
}
|
|
29
|
-
|
|
35
|
+
/** Returns the input text shown for a selected item; defaults to the item label. */
|
|
36
|
+
export type DropdownSearchItemLabelGetter = (item: DropdownSearchItem) => string;
|
|
30
37
|
export type DropdownSearchSelectedItemsChangeHandler = (items: DropdownSearchItem[]) => void | Promise<void>;
|
|
31
38
|
export type DropdownSearchSelectedItemLabelGetter = (item: DropdownSearchItem) => string;
|
|
32
39
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/lib/dropdown-search/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,oBAAoB,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;AAEvF,MAAM,WAAW,kBAAkB;IACjC,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/lib/dropdown-search/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,oBAAoB,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;AAEvF;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC,CAAC;IACpD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,yBAAyB;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,WAAW,CAAC;CACrB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAC9B,UAAU,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAC;CACxC;AAED,MAAM,MAAM,yBAAyB,GAAG,CACtC,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,yBAAyB,KAC/B,OAAO,CAAC,oBAAoB,CAAC,GAAG,oBAAoB,CAAC;AAE1D,MAAM,WAAW,0BAA0B;IACzC,uFAAuF;IACvF,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACxC,aAAa,EAAE,kBAAkB,EAAE,CAAC;IACpC,MAAM,EAAE,oBAAoB,CAAC;CAC9B;AAED,MAAM,WAAW,yBAA0B,SAAQ,0BAA0B;IAC3E,KAAK,EAAE,aAAa,CAAC;IACrB,UAAU,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACtC,OAAO,EAAE,kBAAkB,EAAE,CAAC;CAC/B;AAED,oFAAoF;AACpF,MAAM,MAAM,6BAA6B,GAAG,CAAC,IAAI,EAAE,kBAAkB,KAAK,MAAM,CAAC;AACjF,MAAM,MAAM,wCAAwC,GAAG,CAAC,KAAK,EAAE,kBAAkB,EAAE,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAC7G,MAAM,MAAM,qCAAqC,GAAG,CAAC,IAAI,EAAE,kBAAkB,KAAK,MAAM,CAAC"}
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
$: normalized = normalizePagination(pagination, totalRows);
|
|
25
25
|
$: pageCount = getPageCount(totalRows, normalized.pageSize);
|
|
26
26
|
$: pageItems = buildPaginationItems(normalized.page, pageCount, maxPageButtons);
|
|
27
|
-
$: pageSizeDropdownOptions = pageSizeOptions.map((option) => ({ label: String(option), value: option }));
|
|
27
|
+
$: pageSizeDropdownOptions = pageSizeOptions.map((option) => ({ label: String(option), value: String(option) }));
|
|
28
28
|
|
|
29
29
|
function buildPaginationItems(currentPage: number, totalPages: number, maxButtons: number): PaginationItem[] {
|
|
30
30
|
if (totalPages < 1) {
|
|
@@ -81,12 +81,13 @@
|
|
|
81
81
|
void onPaginationChange?.(normalizePagination({ ...normalized, page }, totalRows));
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
+
// The dropdown submits string page sizes; the pagination state itself keeps numbers.
|
|
84
85
|
function setPageSize(nextValue: DropdownValue) {
|
|
85
86
|
if (disabled) {
|
|
86
87
|
return;
|
|
87
88
|
}
|
|
88
|
-
const pageSize =
|
|
89
|
-
if (!Number.
|
|
89
|
+
const pageSize = Number(nextValue);
|
|
90
|
+
if (!Number.isInteger(pageSize) || pageSize <= 0) {
|
|
90
91
|
return;
|
|
91
92
|
}
|
|
92
93
|
void onPaginationChange?.(normalizePagination({ page: 1, pageSize }, totalRows));
|
|
@@ -115,7 +116,7 @@
|
|
|
115
116
|
<div class="suu-pagination__size">
|
|
116
117
|
<span>{resolvedPageSizeLabel}</span>
|
|
117
118
|
<Dropdown
|
|
118
|
-
value={normalized.pageSize}
|
|
119
|
+
value={String(normalized.pageSize)}
|
|
119
120
|
options={pageSizeDropdownOptions}
|
|
120
121
|
ariaLabel={resolvedPageSizeLabel}
|
|
121
122
|
placement={pageSizeDropdownPlacement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.svelte.d.ts","sourceRoot":"","sources":["../../src/lib/pagination/Pagination.svelte.ts"],"names":[],"mappings":"AAKA,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAE5D,OAAO,KAAK,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"Pagination.svelte.d.ts","sourceRoot":"","sources":["../../src/lib/pagination/Pagination.svelte.ts"],"names":[],"mappings":"AAKA,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAE5D,OAAO,KAAK,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAsHpH,UAAU,kCAAkC,CAAC,KAAK,SAAS,MAAM,CAAC,M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|
+
min-height: 42px;
|
|
1220
|
+
box-sizing: border-box;
|
|
1221
|
+
border: 1px solid var(--suu-color-border);
|
|
1222
|
+
border-radius: var(--suu-radius);
|
|
1223
|
+
background: var(--suu-color-bg);
|
|
1224
|
+
color: var(--suu-color-text);
|
|
1225
|
+
padding: 9px 14px;
|
|
1226
|
+
font: inherit;
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
.suu-dropdown__input:focus {
|
|
1230
|
+
border-color: var(--suu-color-accent);
|
|
1231
|
+
outline: 2px solid color-mix(in srgb, var(--suu-color-accent) 22%, transparent);
|
|
1232
|
+
outline-offset: 1px;
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1235
|
+
.suu-dropdown__selected-items {
|
|
1236
|
+
display: flex;
|
|
1237
|
+
flex-wrap: wrap;
|
|
1238
|
+
gap: 6px;
|
|
1239
|
+
margin-bottom: 6px;
|
|
1240
|
+
}
|
|
1241
|
+
|
|
1242
|
+
.suu-dropdown__selected-item {
|
|
1243
|
+
display: inline-flex;
|
|
1244
|
+
align-items: center;
|
|
1245
|
+
gap: 4px;
|
|
1246
|
+
max-width: 100%;
|
|
1247
|
+
padding: 3px 6px 3px 9px;
|
|
1248
|
+
border: 1px solid color-mix(in srgb, var(--suu-color-accent) 34%, var(--suu-color-border));
|
|
1249
|
+
border-radius: var(--suu-radius-pill);
|
|
1250
|
+
background: color-mix(in srgb, var(--suu-color-accent) 9%, var(--suu-color-bg));
|
|
1251
|
+
color: var(--suu-color-text);
|
|
1252
|
+
font-size: 0.875rem;
|
|
1253
|
+
}
|
|
1254
|
+
|
|
1255
|
+
.suu-dropdown__selected-remove {
|
|
1256
|
+
border: 0;
|
|
1257
|
+
padding: 0 2px;
|
|
1258
|
+
background: transparent;
|
|
1259
|
+
color: var(--suu-color-muted);
|
|
1260
|
+
cursor: pointer;
|
|
1261
|
+
font: inherit;
|
|
1262
|
+
line-height: 1;
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1212
1265
|
.suu-dropdown__chevron {
|
|
1213
1266
|
flex: 0 0 auto;
|
|
1214
1267
|
width: 0.58em;
|
|
@@ -1394,6 +1447,72 @@
|
|
|
1394
1447
|
opacity: 0.55;
|
|
1395
1448
|
}
|
|
1396
1449
|
|
|
1450
|
+
.suu-dropdown__search {
|
|
1451
|
+
display: flex;
|
|
1452
|
+
flex: 0 0 auto;
|
|
1453
|
+
gap: 8px;
|
|
1454
|
+
align-items: center;
|
|
1455
|
+
padding: 8px 14px;
|
|
1456
|
+
border-bottom: 1px solid var(--suu-color-border);
|
|
1457
|
+
background: var(--suu-color-bg);
|
|
1458
|
+
}
|
|
1459
|
+
|
|
1460
|
+
.suu-dropdown__search-icon {
|
|
1461
|
+
flex: 0 0 auto;
|
|
1462
|
+
width: 14px;
|
|
1463
|
+
height: 14px;
|
|
1464
|
+
fill: none;
|
|
1465
|
+
stroke: var(--suu-color-muted);
|
|
1466
|
+
stroke-width: 2;
|
|
1467
|
+
stroke-linecap: round;
|
|
1468
|
+
}
|
|
1469
|
+
|
|
1470
|
+
.suu-dropdown__search-input {
|
|
1471
|
+
flex: 1 1 auto;
|
|
1472
|
+
min-width: 0;
|
|
1473
|
+
border: 0;
|
|
1474
|
+
padding: 2px 0;
|
|
1475
|
+
background: transparent;
|
|
1476
|
+
color: var(--suu-color-text);
|
|
1477
|
+
font: inherit;
|
|
1478
|
+
line-height: 1.2;
|
|
1479
|
+
}
|
|
1480
|
+
|
|
1481
|
+
.suu-dropdown__search-input:focus {
|
|
1482
|
+
outline: none;
|
|
1483
|
+
}
|
|
1484
|
+
|
|
1485
|
+
.suu-dropdown__search-input::placeholder {
|
|
1486
|
+
color: var(--suu-color-muted);
|
|
1487
|
+
}
|
|
1488
|
+
|
|
1489
|
+
.suu-dropdown__status {
|
|
1490
|
+
padding: 12px 14px;
|
|
1491
|
+
color: var(--suu-color-muted);
|
|
1492
|
+
font-size: 0.9em;
|
|
1493
|
+
line-height: 1.4;
|
|
1494
|
+
}
|
|
1495
|
+
|
|
1496
|
+
.suu-dropdown__status--loading {
|
|
1497
|
+
display: flex;
|
|
1498
|
+
gap: 10px;
|
|
1499
|
+
align-items: center;
|
|
1500
|
+
}
|
|
1501
|
+
|
|
1502
|
+
.suu-dropdown__status--error {
|
|
1503
|
+
color: var(--suu-color-error);
|
|
1504
|
+
}
|
|
1505
|
+
|
|
1506
|
+
.suu-dropdown__spinner {
|
|
1507
|
+
flex: 0 0 auto;
|
|
1508
|
+
width: 14px;
|
|
1509
|
+
height: 14px;
|
|
1510
|
+
border: 2px solid var(--suu-color-border);
|
|
1511
|
+
border-top-color: var(--suu-color-accent);
|
|
1512
|
+
border-radius: var(--suu-radius-pill);
|
|
1513
|
+
animation: suu-dropdown-spinner 700ms linear infinite;
|
|
1514
|
+
}
|
|
1515
|
+
|
|
1397
1516
|
.suu-dialog-backdrop {
|
|
1398
1517
|
position: fixed;
|
|
1399
1518
|
inset: 0;
|
package/package.json
CHANGED