@ibobbyts/svelte-ui-utils 0.1.2 → 0.2.1
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 +112 -15
- package/dist/data-table/BaseDataTable.svelte +70 -41
- package/dist/data-table/BaseDataTable.svelte.d.ts +1 -0
- package/dist/data-table/BaseDataTable.svelte.d.ts.map +1 -1
- package/dist/data-table/DataTable.svelte +4 -0
- package/dist/data-table/DataTable.svelte.d.ts +1 -0
- package/dist/data-table/DataTable.svelte.d.ts.map +1 -1
- package/dist/data-table/DateRangeFilter.svelte +27 -0
- package/dist/data-table/DateRangeFilter.svelte.d.ts +1 -0
- package/dist/data-table/DateRangeFilter.svelte.d.ts.map +1 -1
- package/dist/data-table/FilterControl.svelte +3 -0
- package/dist/data-table/FilterControl.svelte.d.ts.map +1 -1
- package/dist/data-table/FilterTable.svelte +2 -0
- package/dist/data-table/FilterTable.svelte.d.ts.map +1 -1
- package/dist/data-table/NumberRangeFilter.svelte +2 -0
- package/dist/data-table/NumberRangeFilter.svelte.d.ts.map +1 -1
- 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 +8 -2
- package/dist/data-table/types.d.ts.map +1 -1
- package/dist/dropdown/Dropdown.svelte +2 -0
- package/dist/dropdown/Dropdown.svelte.d.ts.map +1 -1
- package/dist/dropdown-search/DropdownSearch.svelte +358 -38
- package/dist/dropdown-search/DropdownSearch.svelte.d.ts +8 -1
- package/dist/dropdown-search/DropdownSearch.svelte.d.ts.map +1 -1
- package/dist/dropdown-search/DropdownSearchMultiSelect.svelte +92 -0
- package/dist/dropdown-search/DropdownSearchMultiSelect.svelte.d.ts +53 -0
- package/dist/dropdown-search/DropdownSearchMultiSelect.svelte.d.ts.map +1 -0
- package/dist/dropdown-search/index.d.ts +3 -2
- package/dist/dropdown-search/index.d.ts.map +1 -1
- package/dist/dropdown-search/index.js +2 -1
- package/dist/dropdown-search/state.d.ts +2 -0
- package/dist/dropdown-search/state.d.ts.map +1 -1
- package/dist/dropdown-search/state.js +7 -0
- package/dist/dropdown-search/types.d.ts +8 -0
- package/dist/dropdown-search/types.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/modal/ConfirmDialog.svelte +69 -0
- package/dist/modal/ConfirmDialog.svelte.d.ts +44 -0
- package/dist/modal/ConfirmDialog.svelte.d.ts.map +1 -0
- package/dist/modal/Modal.svelte +131 -0
- package/dist/modal/Modal.svelte.d.ts +43 -0
- package/dist/modal/Modal.svelte.d.ts.map +1 -0
- package/dist/modal/index.d.ts +4 -0
- package/dist/modal/index.d.ts.map +1 -0
- package/dist/modal/index.js +2 -0
- package/dist/modal/types.d.ts +3 -0
- package/dist/modal/types.d.ts.map +1 -0
- package/dist/modal/types.js +1 -0
- package/dist/pagination/Pagination.svelte +2 -0
- package/dist/pagination/Pagination.svelte.d.ts.map +1 -1
- package/dist/style.css +295 -4
- package/dist/toast/Toast.svelte +2 -0
- package/dist/toast/Toast.svelte.d.ts.map +1 -1
- package/dist/toast/ToastManager.svelte +2 -0
- package/dist/toast/ToastManager.svelte.d.ts.map +1 -1
- package/package.json +6 -1
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
<svelte:options runes={false} />
|
|
2
|
+
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import DropdownSearch from './DropdownSearch.svelte';
|
|
5
|
+
import type { UiLanguage } from '../i18n.js';
|
|
6
|
+
import type {
|
|
7
|
+
DropdownSearchChangeDetail,
|
|
8
|
+
DropdownSearchItem,
|
|
9
|
+
DropdownSearchItemValueGetter,
|
|
10
|
+
DropdownSearchLoadOptions,
|
|
11
|
+
DropdownSearchSelectedItemLabelGetter,
|
|
12
|
+
DropdownSearchSelectedItemsChangeHandler,
|
|
13
|
+
DropdownSearchStatus,
|
|
14
|
+
} from './types.js';
|
|
15
|
+
|
|
16
|
+
export let value = '';
|
|
17
|
+
export let selectedItems: DropdownSearchItem[] = [];
|
|
18
|
+
export let status: DropdownSearchStatus = 'empty';
|
|
19
|
+
export let placeholder = '';
|
|
20
|
+
export let debounceMs = 500;
|
|
21
|
+
export let limit = 10;
|
|
22
|
+
export let minLength = 1;
|
|
23
|
+
export let validate = true;
|
|
24
|
+
export let loadOptions: DropdownSearchLoadOptions;
|
|
25
|
+
export let id: string | undefined = undefined;
|
|
26
|
+
export let name: string | undefined = undefined;
|
|
27
|
+
export let ariaLabel: string | undefined = undefined;
|
|
28
|
+
export let listboxId: string | undefined = undefined;
|
|
29
|
+
export let disabled = false;
|
|
30
|
+
export let language: UiLanguage = 'en_us';
|
|
31
|
+
export let noResultsText: string | undefined = undefined;
|
|
32
|
+
export let loadingText: string | undefined = undefined;
|
|
33
|
+
export let clearLabel: string | undefined = undefined;
|
|
34
|
+
export let searchOnExternalValueChange = false;
|
|
35
|
+
export let width: string | undefined = undefined;
|
|
36
|
+
export let minWidth: string | undefined = undefined;
|
|
37
|
+
export let maxWidth: string | undefined = undefined;
|
|
38
|
+
export let selectedItemsLabel = 'Selected items';
|
|
39
|
+
export let removeSelectedItemLabel:
|
|
40
|
+
| DropdownSearchSelectedItemLabelGetter
|
|
41
|
+
| undefined = undefined;
|
|
42
|
+
export let getItemValue: DropdownSearchItemValueGetter = (item) => item.title;
|
|
43
|
+
export let onChange:
|
|
44
|
+
| ((detail: DropdownSearchChangeDetail) => void)
|
|
45
|
+
| undefined = undefined;
|
|
46
|
+
export let onSelect: ((item: DropdownSearchItem) => void) | undefined =
|
|
47
|
+
undefined;
|
|
48
|
+
export let onDeselect: ((item: DropdownSearchItem) => void) | undefined =
|
|
49
|
+
undefined;
|
|
50
|
+
export let onSelectedItemsChange:
|
|
51
|
+
| DropdownSearchSelectedItemsChangeHandler
|
|
52
|
+
| undefined = undefined;
|
|
53
|
+
export let onStatusChange:
|
|
54
|
+
| ((status: DropdownSearchStatus) => void)
|
|
55
|
+
| undefined = undefined;
|
|
56
|
+
export let onInputBlur: ((event: FocusEvent) => void) | undefined = undefined;
|
|
57
|
+
</script>
|
|
58
|
+
|
|
59
|
+
<DropdownSearch
|
|
60
|
+
{value}
|
|
61
|
+
{selectedItems}
|
|
62
|
+
{status}
|
|
63
|
+
multiselect={true}
|
|
64
|
+
{placeholder}
|
|
65
|
+
{debounceMs}
|
|
66
|
+
{limit}
|
|
67
|
+
{minLength}
|
|
68
|
+
{validate}
|
|
69
|
+
{loadOptions}
|
|
70
|
+
{id}
|
|
71
|
+
{name}
|
|
72
|
+
{ariaLabel}
|
|
73
|
+
{listboxId}
|
|
74
|
+
{disabled}
|
|
75
|
+
{language}
|
|
76
|
+
{noResultsText}
|
|
77
|
+
{loadingText}
|
|
78
|
+
{clearLabel}
|
|
79
|
+
{searchOnExternalValueChange}
|
|
80
|
+
{width}
|
|
81
|
+
{minWidth}
|
|
82
|
+
{maxWidth}
|
|
83
|
+
{selectedItemsLabel}
|
|
84
|
+
{removeSelectedItemLabel}
|
|
85
|
+
{getItemValue}
|
|
86
|
+
{onChange}
|
|
87
|
+
{onSelect}
|
|
88
|
+
{onDeselect}
|
|
89
|
+
{onSelectedItemsChange}
|
|
90
|
+
{onStatusChange}
|
|
91
|
+
{onInputBlur}
|
|
92
|
+
/>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { UiLanguage } from '../i18n.js';
|
|
2
|
+
import type { DropdownSearchChangeDetail, DropdownSearchItem, DropdownSearchItemValueGetter, DropdownSearchLoadOptions, DropdownSearchSelectedItemLabelGetter, DropdownSearchSelectedItemsChangeHandler, DropdownSearchStatus } from './types.js';
|
|
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
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
5
|
+
$$bindings?: Bindings;
|
|
6
|
+
} & Exports;
|
|
7
|
+
(internal: unknown, props: Props & {
|
|
8
|
+
$$events?: Events;
|
|
9
|
+
$$slots?: Slots;
|
|
10
|
+
}): Exports & {
|
|
11
|
+
$set?: any;
|
|
12
|
+
$on?: any;
|
|
13
|
+
};
|
|
14
|
+
z_$$bindings?: Bindings;
|
|
15
|
+
}
|
|
16
|
+
declare const DropdownSearchMultiSelect: $$__sveltets_2_IsomorphicComponent<{
|
|
17
|
+
value?: string;
|
|
18
|
+
selectedItems?: DropdownSearchItem[];
|
|
19
|
+
status?: DropdownSearchStatus;
|
|
20
|
+
placeholder?: string;
|
|
21
|
+
debounceMs?: number;
|
|
22
|
+
limit?: number;
|
|
23
|
+
minLength?: number;
|
|
24
|
+
validate?: boolean;
|
|
25
|
+
loadOptions: DropdownSearchLoadOptions;
|
|
26
|
+
id?: string | undefined;
|
|
27
|
+
name?: string | undefined;
|
|
28
|
+
ariaLabel?: string | undefined;
|
|
29
|
+
listboxId?: string | undefined;
|
|
30
|
+
disabled?: boolean;
|
|
31
|
+
language?: UiLanguage;
|
|
32
|
+
noResultsText?: string | undefined;
|
|
33
|
+
loadingText?: string | undefined;
|
|
34
|
+
clearLabel?: string | undefined;
|
|
35
|
+
searchOnExternalValueChange?: boolean;
|
|
36
|
+
width?: string | undefined;
|
|
37
|
+
minWidth?: string | undefined;
|
|
38
|
+
maxWidth?: string | undefined;
|
|
39
|
+
selectedItemsLabel?: string;
|
|
40
|
+
removeSelectedItemLabel?: DropdownSearchSelectedItemLabelGetter | undefined;
|
|
41
|
+
getItemValue?: DropdownSearchItemValueGetter;
|
|
42
|
+
onChange?: ((detail: DropdownSearchChangeDetail) => void) | undefined;
|
|
43
|
+
onSelect?: ((item: DropdownSearchItem) => void) | undefined;
|
|
44
|
+
onDeselect?: ((item: DropdownSearchItem) => void) | undefined;
|
|
45
|
+
onSelectedItemsChange?: DropdownSearchSelectedItemsChangeHandler | undefined;
|
|
46
|
+
onStatusChange?: ((status: DropdownSearchStatus) => void) | undefined;
|
|
47
|
+
onInputBlur?: ((event: FocusEvent) => void) | undefined;
|
|
48
|
+
}, {
|
|
49
|
+
[evt: string]: CustomEvent<any>;
|
|
50
|
+
}, {}, {}, string>;
|
|
51
|
+
type DropdownSearchMultiSelect = InstanceType<typeof DropdownSearchMultiSelect>;
|
|
52
|
+
export default DropdownSearchMultiSelect;
|
|
53
|
+
//# sourceMappingURL=DropdownSearchMultiSelect.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropdownSearchMultiSelect.svelte.d.ts","sourceRoot":"","sources":["../../src/lib/dropdown-search/DropdownSearchMultiSelect.svelte.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EACR,0BAA0B,EAC1B,kBAAkB,EAClB,6BAA6B,EAC7B,yBAAyB,EACzB,qCAAqC,EACrC,wCAAwC,EACxC,oBAAoB,EACrB,MAAM,YAAY,CAAC;AA4DtB,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,MAAM;IACpM,KAAK,OAAO,EAAE,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IAC9G,YAAY,CAAC,EAAE,QAAQ,CAAC;CAC3B;AAKD,QAAA,MAAM,yBAAyB;;oBAdg0B,kBAAkB,EAAE;aAAW,oBAAoB;;;;;;iBAAiK,yBAAyB;SAAO,MAAM,GAAG,SAAS;WAAS,MAAM,GAAG,SAAS;gBAAc,MAAM,GAAG,SAAS;gBAAc,MAAM,GAAG,SAAS;;eAAyC,UAAU;oBAAkB,MAAM,GAAG,SAAS;kBAAgB,MAAM,GAAG,SAAS;iBAAe,MAAM,GAAG,SAAS;;YAA4E,MAAM,GAAG,SAAS;eAAa,MAAM,GAAG,SAAS;eAAa,MAAM,GAAG,SAAS;;8BAA8E,qCAAqC,GACnmD,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;;;kBAUsC,CAAC;AAC7F,KAAK,yBAAyB,GAAG,YAAY,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAClF,eAAe,yBAAyB,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { default as DropdownSearch } from './DropdownSearch.svelte';
|
|
2
|
+
export { default as DropdownSearchMultiSelect } from './DropdownSearchMultiSelect.svelte';
|
|
2
3
|
export { getUiMessages, resolveUiLanguage, uiLanguages } from '../i18n.js';
|
|
3
|
-
export { clampDropdownSearchLimit, formatParamDict, isUsableExactMatch, normalizeDropdownSearchValue, resolveDropdownSearchStatus } from './state.js';
|
|
4
|
+
export { clampDropdownSearchLimit, formatParamDict, isUsableExactMatch, normalizeDropdownSearchValue, resolveDropdownSearchStatus, } from './state.js';
|
|
4
5
|
export type { UiLanguage, UiMessages } from '../i18n.js';
|
|
5
|
-
export type { DropdownSearchChangeDetail, DropdownSearchItem, DropdownSearchItemValueGetter, DropdownSearchLoadContext, DropdownSearchLoadOptions, DropdownSearchResult, DropdownSearchStatus } from './types.js';
|
|
6
|
+
export type { DropdownSearchChangeDetail, DropdownSearchEnterDetail, DropdownSearchItem, DropdownSearchItemValueGetter, DropdownSearchLoadContext, DropdownSearchLoadOptions, DropdownSearchSelectedItemLabelGetter, DropdownSearchSelectedItemsChangeHandler, DropdownSearchResult, DropdownSearchStatus, } from './types.js';
|
|
6
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/dropdown-search/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC3E,OAAO,EACL,wBAAwB,EACxB,eAAe,EACf,kBAAkB,EAClB,4BAA4B,EAC5B,2BAA2B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/dropdown-search/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AAC1F,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC3E,OAAO,EACL,wBAAwB,EACxB,eAAe,EACf,kBAAkB,EAClB,4BAA4B,EAC5B,2BAA2B,GAC5B,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACzD,YAAY,EACV,0BAA0B,EAC1B,yBAAyB,EACzB,kBAAkB,EAClB,6BAA6B,EAC7B,yBAAyB,EACzB,yBAAyB,EACzB,qCAAqC,EACrC,wCAAwC,EACxC,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,YAAY,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { default as DropdownSearch } from './DropdownSearch.svelte';
|
|
2
|
+
export { default as DropdownSearchMultiSelect } from './DropdownSearchMultiSelect.svelte';
|
|
2
3
|
export { getUiMessages, resolveUiLanguage, uiLanguages } from '../i18n.js';
|
|
3
|
-
export { clampDropdownSearchLimit, formatParamDict, isUsableExactMatch, normalizeDropdownSearchValue, resolveDropdownSearchStatus } from './state.js';
|
|
4
|
+
export { clampDropdownSearchLimit, formatParamDict, isUsableExactMatch, normalizeDropdownSearchValue, resolveDropdownSearchStatus, } from './state.js';
|
|
@@ -5,11 +5,13 @@ export declare function isUsableExactMatch(item: DropdownSearchItem | null | und
|
|
|
5
5
|
export declare function resolveDropdownSearchStatus(params: {
|
|
6
6
|
value: string;
|
|
7
7
|
selectedItem?: DropdownSearchItem | null;
|
|
8
|
+
selectedItems?: DropdownSearchItem[];
|
|
8
9
|
exactMatch?: DropdownSearchItem | null;
|
|
9
10
|
loading?: boolean;
|
|
10
11
|
errored?: boolean;
|
|
11
12
|
minLength?: number;
|
|
12
13
|
validate?: boolean;
|
|
14
|
+
multiselect?: boolean;
|
|
13
15
|
}): DropdownSearchStatus;
|
|
14
16
|
export declare function formatParamDict(paramDict: DropdownSearchItem['param_dict']): string[];
|
|
15
17
|
//# sourceMappingURL=state.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/lib/dropdown-search/state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAE3E,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAElE;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAM9D;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,kBAAkB,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,IAAI,kBAAkB,CAE1G;AAED,wBAAgB,2BAA2B,CAAC,MAAM,EAAE;IAClD,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACzC,UAAU,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACvC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/lib/dropdown-search/state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAE3E,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAElE;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAM9D;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,kBAAkB,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,IAAI,kBAAkB,CAE1G;AAED,wBAAgB,2BAA2B,CAAC,MAAM,EAAE;IAClD,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACzC,aAAa,CAAC,EAAE,kBAAkB,EAAE,CAAC;IACrC,UAAU,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACvC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,GAAG,oBAAoB,CAuCvB;AAED,wBAAgB,eAAe,CAAC,SAAS,EAAE,kBAAkB,CAAC,YAAY,CAAC,GAAG,MAAM,EAAE,CAQrF"}
|
|
@@ -14,7 +14,11 @@ export function resolveDropdownSearchStatus(params) {
|
|
|
14
14
|
const trimmed = normalizeDropdownSearchValue(params.value);
|
|
15
15
|
const minLength = params.minLength ?? 1;
|
|
16
16
|
const validate = params.validate ?? true;
|
|
17
|
+
const hasSelectedItems = Boolean(params.selectedItems?.some((item) => !item.disabled));
|
|
17
18
|
if (!trimmed) {
|
|
19
|
+
if (params.multiselect && validate && hasSelectedItems) {
|
|
20
|
+
return 'valid';
|
|
21
|
+
}
|
|
18
22
|
return 'empty';
|
|
19
23
|
}
|
|
20
24
|
if (params.loading) {
|
|
@@ -23,6 +27,9 @@ export function resolveDropdownSearchStatus(params) {
|
|
|
23
27
|
if (!validate) {
|
|
24
28
|
return 'empty';
|
|
25
29
|
}
|
|
30
|
+
if (params.multiselect && hasSelectedItems) {
|
|
31
|
+
return 'valid';
|
|
32
|
+
}
|
|
26
33
|
if (params.errored) {
|
|
27
34
|
return 'error';
|
|
28
35
|
}
|
|
@@ -18,7 +18,15 @@ export type DropdownSearchLoadOptions = (query: string, context: DropdownSearchL
|
|
|
18
18
|
export interface DropdownSearchChangeDetail {
|
|
19
19
|
value: string;
|
|
20
20
|
selectedItem: DropdownSearchItem | null;
|
|
21
|
+
selectedItems: DropdownSearchItem[];
|
|
21
22
|
status: DropdownSearchStatus;
|
|
22
23
|
}
|
|
24
|
+
export interface DropdownSearchEnterDetail extends DropdownSearchChangeDetail {
|
|
25
|
+
event: KeyboardEvent;
|
|
26
|
+
exactMatch: DropdownSearchItem | null;
|
|
27
|
+
options: DropdownSearchItem[];
|
|
28
|
+
}
|
|
23
29
|
export type DropdownSearchItemValueGetter = (item: DropdownSearchItem) => string;
|
|
30
|
+
export type DropdownSearchSelectedItemsChangeHandler = (items: DropdownSearchItem[]) => void | Promise<void>;
|
|
31
|
+
export type DropdownSearchSelectedItemLabelGetter = (item: DropdownSearchItem) => string;
|
|
24
32
|
//# 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,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,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,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACxC,MAAM,EAAE,oBAAoB,CAAC;CAC9B;AAED,MAAM,MAAM,6BAA6B,GAAG,CAAC,IAAI,EAAE,kBAAkB,KAAK,MAAM,CAAC"}
|
|
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,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,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,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,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"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './toast/index.js';
|
|
2
2
|
export * from './dropdown/index.js';
|
|
3
3
|
export * from './dropdown-search/index.js';
|
|
4
|
+
export * from './modal/index.js';
|
|
4
5
|
export * from './data-table/index.js';
|
|
5
6
|
export { getUiMessages, resolveUiLanguage, uiLanguages } from './i18n.js';
|
|
6
7
|
export type { UiLanguage, UiMessages } from './i18n.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC1E,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC1E,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './toast/index.js';
|
|
2
2
|
export * from './dropdown/index.js';
|
|
3
3
|
export * from './dropdown-search/index.js';
|
|
4
|
+
export * from './modal/index.js';
|
|
4
5
|
export * from './data-table/index.js';
|
|
5
6
|
export { getUiMessages, resolveUiLanguage, uiLanguages } from './i18n.js';
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
<svelte:options runes={false} />
|
|
2
|
+
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import Modal from './Modal.svelte';
|
|
5
|
+
import type { ConfirmDialogIntent, ModalSize } from './types.js';
|
|
6
|
+
|
|
7
|
+
export let open = false;
|
|
8
|
+
export let title = 'Confirm';
|
|
9
|
+
export let message = '';
|
|
10
|
+
export let confirmLabel = 'Confirm';
|
|
11
|
+
export let cancelLabel = 'Cancel';
|
|
12
|
+
export let closeLabel = 'Close dialog';
|
|
13
|
+
export let intent: ConfirmDialogIntent = 'default';
|
|
14
|
+
export let size: ModalSize = 'sm';
|
|
15
|
+
export let confirmDisabled = false;
|
|
16
|
+
export let cancelDisabled = false;
|
|
17
|
+
export let dismissible = true;
|
|
18
|
+
export let onConfirm: (() => void | Promise<void>) | undefined = undefined;
|
|
19
|
+
export let onCancel: (() => void) | undefined = undefined;
|
|
20
|
+
export let onClose: (() => void) | undefined = undefined;
|
|
21
|
+
|
|
22
|
+
function handleClose() {
|
|
23
|
+
onClose?.();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function handleCancel() {
|
|
27
|
+
onCancel?.();
|
|
28
|
+
onClose?.();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function handleConfirm() {
|
|
32
|
+
void onConfirm?.();
|
|
33
|
+
}
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<Modal
|
|
37
|
+
{open}
|
|
38
|
+
{title}
|
|
39
|
+
{closeLabel}
|
|
40
|
+
{size}
|
|
41
|
+
{dismissible}
|
|
42
|
+
description={message}
|
|
43
|
+
onClose={handleClose}
|
|
44
|
+
>
|
|
45
|
+
<slot>
|
|
46
|
+
{#if message}
|
|
47
|
+
<p class="suu-confirm-dialog__message">{message}</p>
|
|
48
|
+
{/if}
|
|
49
|
+
</slot>
|
|
50
|
+
|
|
51
|
+
<svelte:fragment slot="footer">
|
|
52
|
+
<button
|
|
53
|
+
type="button"
|
|
54
|
+
class="suu-modal__button"
|
|
55
|
+
disabled={cancelDisabled}
|
|
56
|
+
on:click={handleCancel}
|
|
57
|
+
>
|
|
58
|
+
{cancelLabel}
|
|
59
|
+
</button>
|
|
60
|
+
<button
|
|
61
|
+
type="button"
|
|
62
|
+
class={`suu-modal__button suu-modal__button--primary suu-modal__button--${intent}`}
|
|
63
|
+
disabled={confirmDisabled}
|
|
64
|
+
on:click={handleConfirm}
|
|
65
|
+
>
|
|
66
|
+
{confirmLabel}
|
|
67
|
+
</button>
|
|
68
|
+
</svelte:fragment>
|
|
69
|
+
</Modal>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { ConfirmDialogIntent, ModalSize } from './types.js';
|
|
2
|
+
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
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: Props & {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
12
|
+
};
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
14
|
+
}
|
|
15
|
+
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
16
|
+
default: any;
|
|
17
|
+
} ? Props extends Record<string, never> ? any : {
|
|
18
|
+
children?: any;
|
|
19
|
+
} : {});
|
|
20
|
+
declare const ConfirmDialog: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
21
|
+
open?: boolean;
|
|
22
|
+
title?: string;
|
|
23
|
+
message?: string;
|
|
24
|
+
confirmLabel?: string;
|
|
25
|
+
cancelLabel?: string;
|
|
26
|
+
closeLabel?: string;
|
|
27
|
+
intent?: ConfirmDialogIntent;
|
|
28
|
+
size?: ModalSize;
|
|
29
|
+
confirmDisabled?: boolean;
|
|
30
|
+
cancelDisabled?: boolean;
|
|
31
|
+
dismissible?: boolean;
|
|
32
|
+
onConfirm?: (() => void | Promise<void>) | undefined;
|
|
33
|
+
onCancel?: (() => void) | undefined;
|
|
34
|
+
onClose?: (() => void) | undefined;
|
|
35
|
+
}, {
|
|
36
|
+
default: {};
|
|
37
|
+
}>, {
|
|
38
|
+
[evt: string]: CustomEvent<any>;
|
|
39
|
+
}, {
|
|
40
|
+
default: {};
|
|
41
|
+
}, {}, string>;
|
|
42
|
+
type ConfirmDialog = InstanceType<typeof ConfirmDialog>;
|
|
43
|
+
export default ConfirmDialog;
|
|
44
|
+
//# sourceMappingURL=ConfirmDialog.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfirmDialog.svelte.d.ts","sourceRoot":"","sources":["../../src/lib/modal/ConfirmDialog.svelte.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAwDjE,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,MAAM;IACpM,KAAK,OAAO,EAAE,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IAC9G,YAAY,CAAC,EAAE,QAAQ,CAAC;CAC3B;AACD,KAAK,gCAAgC,CAAC,KAAK,EAAE,KAAK,IAAI,KAAK,GACvD,CAAC,KAAK,SAAS;IAAE,OAAO,EAAE,GAAG,CAAA;CAAE,GACzB,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,GACnC,GAAG,GACH;IAAE,QAAQ,CAAC,EAAE,GAAG,CAAA;CAAE,GAClB,EAAE,CAAC,CAAC;AAId,QAAA,MAAM,aAAa;;;;;;;aAfgf,mBAAmB;WAAS,SAAS;;;;gBAAkI,CAAC,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,SAAS;eAAa,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS;cAAY,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS;;;;;;;cAenrB,CAAC;AACvF,KAAK,aAAa,GAAG,YAAY,CAAC,OAAO,aAAa,CAAC,CAAC;AAC1D,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
<svelte:options runes={false} />
|
|
2
|
+
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import { tick } from 'svelte';
|
|
5
|
+
import type { ModalSize } from './types.js';
|
|
6
|
+
|
|
7
|
+
export let open = false;
|
|
8
|
+
export let title = '';
|
|
9
|
+
export let description = '';
|
|
10
|
+
export let closeLabel = 'Close dialog';
|
|
11
|
+
export let size: ModalSize = 'md';
|
|
12
|
+
export let dismissible = true;
|
|
13
|
+
export let closeOnBackdrop = true;
|
|
14
|
+
export let closeOnEscape = true;
|
|
15
|
+
export let labelledBy: string | undefined = undefined;
|
|
16
|
+
export let describedBy: string | undefined = undefined;
|
|
17
|
+
export let onClose: (() => void) | undefined = undefined;
|
|
18
|
+
|
|
19
|
+
let dialogElement: HTMLElement | undefined;
|
|
20
|
+
let titleId = `suu-modal-title-${Math.random().toString(36).slice(2)}`;
|
|
21
|
+
let descriptionId = `suu-modal-description-${Math.random().toString(36).slice(2)}`;
|
|
22
|
+
let wasOpen = false;
|
|
23
|
+
let previouslyFocusedElement: HTMLElement | null = null;
|
|
24
|
+
|
|
25
|
+
$: resolvedLabelledBy = labelledBy ?? (title ? titleId : undefined);
|
|
26
|
+
$: resolvedDescribedBy =
|
|
27
|
+
describedBy ?? (description ? descriptionId : undefined);
|
|
28
|
+
$: if (open && !wasOpen) {
|
|
29
|
+
wasOpen = true;
|
|
30
|
+
void focusDialog();
|
|
31
|
+
} else if (!open && wasOpen) {
|
|
32
|
+
wasOpen = false;
|
|
33
|
+
restoreFocus();
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
async function focusDialog() {
|
|
37
|
+
if (typeof document !== 'undefined') {
|
|
38
|
+
previouslyFocusedElement =
|
|
39
|
+
document.activeElement instanceof HTMLElement
|
|
40
|
+
? document.activeElement
|
|
41
|
+
: null;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
await tick();
|
|
45
|
+
dialogElement?.focus();
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function restoreFocus() {
|
|
49
|
+
previouslyFocusedElement?.focus();
|
|
50
|
+
previouslyFocusedElement = null;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function requestClose() {
|
|
54
|
+
if (!dismissible) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
onClose?.();
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function handleBackdropMouseDown(event: MouseEvent) {
|
|
62
|
+
if (!closeOnBackdrop || event.target !== event.currentTarget) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
requestClose();
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function handleKeydown(event: KeyboardEvent) {
|
|
70
|
+
if (event.key === 'Escape' && closeOnEscape) {
|
|
71
|
+
event.preventDefault();
|
|
72
|
+
requestClose();
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
</script>
|
|
76
|
+
|
|
77
|
+
<svelte:window on:keydown={handleKeydown} />
|
|
78
|
+
|
|
79
|
+
{#if open}
|
|
80
|
+
<div
|
|
81
|
+
class="suu-modal-backdrop"
|
|
82
|
+
role="presentation"
|
|
83
|
+
on:mousedown={handleBackdropMouseDown}
|
|
84
|
+
>
|
|
85
|
+
<div
|
|
86
|
+
bind:this={dialogElement}
|
|
87
|
+
class={`suu-modal suu-modal--${size}`}
|
|
88
|
+
role="dialog"
|
|
89
|
+
aria-modal="true"
|
|
90
|
+
aria-labelledby={resolvedLabelledBy}
|
|
91
|
+
aria-describedby={resolvedDescribedBy}
|
|
92
|
+
tabindex="-1"
|
|
93
|
+
>
|
|
94
|
+
<header class="suu-modal__header">
|
|
95
|
+
<div class="suu-modal__heading">
|
|
96
|
+
{#if title}
|
|
97
|
+
<h2 class="suu-modal__title" id={titleId}>{title}</h2>
|
|
98
|
+
{/if}
|
|
99
|
+
{#if description}
|
|
100
|
+
<p class="suu-modal__description" id={descriptionId}>
|
|
101
|
+
{description}
|
|
102
|
+
</p>
|
|
103
|
+
{/if}
|
|
104
|
+
</div>
|
|
105
|
+
{#if dismissible}
|
|
106
|
+
<button
|
|
107
|
+
type="button"
|
|
108
|
+
class="suu-modal__close"
|
|
109
|
+
aria-label={closeLabel}
|
|
110
|
+
title={closeLabel}
|
|
111
|
+
on:click={requestClose}
|
|
112
|
+
>
|
|
113
|
+
<svg viewBox="0 0 20 20" aria-hidden="true">
|
|
114
|
+
<path d="m6 6 8 8M14 6l-8 8"></path>
|
|
115
|
+
</svg>
|
|
116
|
+
</button>
|
|
117
|
+
{/if}
|
|
118
|
+
</header>
|
|
119
|
+
|
|
120
|
+
<div class="suu-modal__body">
|
|
121
|
+
<slot />
|
|
122
|
+
</div>
|
|
123
|
+
|
|
124
|
+
{#if $$slots.footer}
|
|
125
|
+
<footer class="suu-modal__footer">
|
|
126
|
+
<slot name="footer" />
|
|
127
|
+
</footer>
|
|
128
|
+
{/if}
|
|
129
|
+
</div>
|
|
130
|
+
</div>
|
|
131
|
+
{/if}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ModalSize } from './types.js';
|
|
2
|
+
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
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: Props & {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
12
|
+
};
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
14
|
+
}
|
|
15
|
+
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
16
|
+
default: any;
|
|
17
|
+
} ? Props extends Record<string, never> ? any : {
|
|
18
|
+
children?: any;
|
|
19
|
+
} : {});
|
|
20
|
+
declare const Modal: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
21
|
+
open?: boolean;
|
|
22
|
+
title?: string;
|
|
23
|
+
description?: string;
|
|
24
|
+
closeLabel?: string;
|
|
25
|
+
size?: ModalSize;
|
|
26
|
+
dismissible?: boolean;
|
|
27
|
+
closeOnBackdrop?: boolean;
|
|
28
|
+
closeOnEscape?: boolean;
|
|
29
|
+
labelledBy?: string | undefined;
|
|
30
|
+
describedBy?: string | undefined;
|
|
31
|
+
onClose?: (() => void) | undefined;
|
|
32
|
+
}, {
|
|
33
|
+
default: {};
|
|
34
|
+
footer: {};
|
|
35
|
+
}>, {
|
|
36
|
+
[evt: string]: CustomEvent<any>;
|
|
37
|
+
}, {
|
|
38
|
+
default: {};
|
|
39
|
+
footer: {};
|
|
40
|
+
}, {}, string>;
|
|
41
|
+
type Modal = InstanceType<typeof Modal>;
|
|
42
|
+
export default Modal;
|
|
43
|
+
//# sourceMappingURL=Modal.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Modal.svelte.d.ts","sourceRoot":"","sources":["../../src/lib/modal/Modal.svelte.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAsH5C,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,MAAM;IACpM,KAAK,OAAO,EAAE,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IAC9G,YAAY,CAAC,EAAE,QAAQ,CAAC;CAC3B;AACD,KAAK,gCAAgC,CAAC,KAAK,EAAE,KAAK,IAAI,KAAK,GACvD,CAAC,KAAK,SAAS;IAAE,OAAO,EAAE,GAAG,CAAA;CAAE,GACzB,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,GACnC,GAAG,GACH;IAAE,QAAQ,CAAC,EAAE,GAAG,CAAA;CAAE,GAClB,EAAE,CAAC,CAAC;AAId,QAAA,MAAM,KAAK;;;;;WAf6X,SAAS;;;;iBAAiI,MAAM,GAAG,SAAS;kBAAgB,MAAM,GAAG,SAAS;cAAY,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS;;;;;;;;;cAe1gB,CAAC;AAC/E,KAAK,KAAK,GAAG,YAAY,CAAC,OAAO,KAAK,CAAC,CAAC;AAC1C,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/modal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAClE,YAAY,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/lib/modal/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAC3C,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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;AA2GpH,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,MAAM;IACpM,KAAK,OAAO,EAAE,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IAC9G,YAAY,CAAC,EAAE,QAAQ,CAAC;CAC3B;AAKD,QAAA,MAAM,UAAU;iBAVyR,eAAe;;sBAAkD,MAAM,EAAE;eAAa,UAAU;oBAAkB,MAAM,GAAG,SAAS;;gCAAsE,2BAA2B;yBAAuB,uBAAuB,GAAG,SAAS;;;kBAUze,CAAC;AAC9E,KAAK,UAAU,GAAG,YAAY,CAAC,OAAO,UAAU,CAAC,CAAC;AACpD,eAAe,UAAU,CAAC"}
|