@skeletonlabs/skeleton 1.12.0 → 2.0.0-dev.b15f66c2
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/Accordion/Accordion.svelte +15 -3
- package/dist/components/Accordion/Accordion.svelte.d.ts +17 -23
- package/dist/components/Accordion/AccordionItem.svelte +8 -3
- package/dist/components/Accordion/AccordionItem.svelte.d.ts +15 -25
- package/dist/components/AppRail/AppRailTile.svelte +1 -1
- package/dist/components/Autocomplete/Autocomplete.svelte +17 -7
- package/dist/components/Autocomplete/Autocomplete.svelte.d.ts +17 -27
- package/dist/components/Avatar/Avatar.svelte +1 -1
- package/dist/components/ConicGradient/ConicGradient.svelte +1 -1
- package/dist/components/FileButton/FileButton.svelte +2 -3
- package/dist/components/InputChip/InputChip.svelte +31 -4
- package/dist/components/InputChip/InputChip.svelte.d.ts +22 -27
- package/dist/components/Paginator/Paginator.svelte +17 -15
- package/dist/components/Paginator/Paginator.svelte.d.ts +2 -2
- package/dist/components/Paginator/types.d.ts +2 -2
- package/dist/components/Ratings/Ratings.svelte +1 -1
- package/dist/components/Stepper/Step.svelte +11 -2
- package/dist/components/Stepper/Step.svelte.d.ts +15 -12
- package/dist/components/Stepper/Stepper.svelte +21 -3
- package/dist/components/Stepper/Stepper.svelte.d.ts +17 -27
- package/dist/components/Tab/TabGroup.svelte +1 -1
- package/dist/components/Table/Table.svelte +1 -1
- package/dist/components/TreeView/TreeView.svelte +45 -2
- package/dist/components/TreeView/TreeView.svelte.d.ts +21 -0
- package/dist/components/TreeView/TreeViewDataDrivenItem.svelte +90 -0
- package/dist/components/TreeView/TreeViewDataDrivenItem.svelte.d.ts +27 -0
- package/dist/components/TreeView/TreeViewItem.svelte +220 -10
- package/dist/components/TreeView/TreeViewItem.svelte.d.ts +95 -2
- package/dist/components/TreeView/types.d.ts +18 -0
- package/dist/components/TreeView/types.js +1 -0
- package/dist/index.d.ts +15 -12
- package/dist/index.js +11 -12
- package/dist/internal/transitions.d.ts +10 -0
- package/dist/internal/transitions.js +11 -0
- package/dist/transitions/crossfade.d.ts +1 -0
- package/dist/transitions/crossfade.js +21 -0
- package/dist/types.d.ts +8 -0
- package/dist/types.js +1 -0
- package/dist/utilities/Drawer/Drawer.svelte +33 -12
- package/dist/utilities/Drawer/Drawer.svelte.d.ts +4 -2
- package/dist/utilities/Drawer/stores.d.ts +24 -1
- package/dist/utilities/Drawer/stores.js +31 -2
- package/dist/utilities/Drawer/types.d.ts +3 -0
- package/dist/utilities/Modal/Modal.svelte +21 -23
- package/dist/utilities/Modal/Modal.svelte.d.ts +17 -37
- package/dist/utilities/Modal/ModalTest.svelte +8 -0
- package/dist/utilities/Modal/ModalTest.svelte.d.ts +17 -0
- package/dist/utilities/Modal/stores.d.ts +24 -1
- package/dist/utilities/Modal/stores.js +31 -1
- package/dist/utilities/Modal/types.d.ts +1 -0
- package/dist/utilities/PrefersReducedMotion/PrefersReducedMotion.d.ts +7 -0
- package/dist/utilities/PrefersReducedMotion/PrefersReducedMotion.js +26 -0
- package/dist/utilities/TableOfContents/TableOfContents.svelte +56 -0
- package/dist/utilities/TableOfContents/TableOfContents.svelte.d.ts +34 -0
- package/dist/utilities/TableOfContents/crawler.d.ts +16 -0
- package/dist/utilities/TableOfContents/crawler.js +78 -0
- package/dist/utilities/TableOfContents/stores.d.ts +6 -0
- package/dist/utilities/TableOfContents/stores.js +5 -0
- package/dist/utilities/TableOfContents/types.d.ts +5 -0
- package/dist/utilities/TableOfContents/types.js +2 -0
- package/dist/utilities/Toast/Toast.svelte +24 -23
- package/dist/utilities/Toast/Toast.svelte.d.ts +17 -24
- package/dist/utilities/Toast/ToastTest.svelte +12 -0
- package/dist/utilities/Toast/ToastTest.svelte.d.ts +18 -0
- package/dist/utilities/Toast/stores.d.ts +27 -5
- package/dist/utilities/Toast/stores.js +60 -29
- package/dist/utilities/Toast/types.d.ts +1 -0
- package/dist/utilities/index.d.ts +18 -0
- package/dist/utilities/index.js +25 -0
- package/package.json +3 -16
- package/dist/components/TableOfContents/TableOfContents.svelte +0 -111
- package/dist/components/TableOfContents/TableOfContents.svelte.d.ts +0 -44
- package/dist/styles/all.css +0 -30
- package/dist/styles/elements/alerts.css +0 -17
- package/dist/styles/elements/badges.css +0 -31
- package/dist/styles/elements/breadcrumbs.css +0 -36
- package/dist/styles/elements/buttons.css +0 -109
- package/dist/styles/elements/cards.css +0 -32
- package/dist/styles/elements/chips.css +0 -22
- package/dist/styles/elements/codeblocks.css +0 -16
- package/dist/styles/elements/forms.css +0 -283
- package/dist/styles/elements/lists.css +0 -51
- package/dist/styles/elements/logo-clouds.css +0 -29
- package/dist/styles/elements/modals.css +0 -15
- package/dist/styles/elements/placeholders.css +0 -17
- package/dist/styles/elements/popups.css +0 -16
- package/dist/styles/elements/tables.css +0 -102
- package/dist/styles/partials/core.css +0 -66
- package/dist/styles/partials/elements.css +0 -20
- package/dist/styles/partials/tailwind.css +0 -16
- package/dist/styles/partials/typography-next.css +0 -99
- package/dist/styles/partials/typography-prose.css +0 -49
- package/dist/styles/partials/typography.css +0 -99
- package/dist/styles/partials/variants.css +0 -204
- package/dist/styles/skeleton-minimal.css +0 -30
- package/dist/styles/skeleton.css +0 -30
- package/dist/tailwind/core.cjs +0 -37
- package/dist/tailwind/core.d.cts +0 -5
- package/dist/tailwind/generated/intellisense-classes.cjs +0 -1
- package/dist/tailwind/generated/intellisense-classes.d.cts +0 -2729
- package/dist/tailwind/intellisense.cjs +0 -21
- package/dist/tailwind/intellisense.d.cts +0 -5
- package/dist/tailwind/settings.cjs +0 -20
- package/dist/tailwind/settings.d.cts +0 -6
- package/dist/tailwind/skeleton.cjs +0 -19
- package/dist/tailwind/skeleton.d.cts +0 -7
- package/dist/tailwind/theme/colors.cjs +0 -18
- package/dist/tailwind/theme/colors.d.cts +0 -2
- package/dist/tailwind/tokens/backgrounds.cjs +0 -39
- package/dist/tailwind/tokens/backgrounds.d.cts +0 -2
- package/dist/tailwind/tokens/border-radius.cjs +0 -21
- package/dist/tailwind/tokens/border-radius.d.cts +0 -33
- package/dist/tailwind/tokens/borders.cjs +0 -20
- package/dist/tailwind/tokens/borders.d.cts +0 -6
- package/dist/tailwind/tokens/fills.cjs +0 -20
- package/dist/tailwind/tokens/fills.d.cts +0 -15
- package/dist/tailwind/tokens/rings.cjs +0 -50
- package/dist/tailwind/tokens/rings.d.cts +0 -22
- package/dist/tailwind/tokens/text.cjs +0 -31
- package/dist/tailwind/tokens/text.d.cts +0 -21
- package/dist/themes/theme-crimson.css +0 -100
- package/dist/themes/theme-gold-nouveau.css +0 -143
- package/dist/themes/theme-hamlindigo.css +0 -109
- package/dist/themes/theme-modern.css +0 -134
- package/dist/themes/theme-rocket.css +0 -120
- package/dist/themes/theme-sahara.css +0 -133
- package/dist/themes/theme-seafoam.css +0 -128
- package/dist/themes/theme-seasonal.css +0 -114
- package/dist/themes/theme-skeleton.css +0 -119
- package/dist/themes/theme-test.css +0 -96
- package/dist/themes/theme-vintage.css +0 -131
- package/dist/utilities/DataTable/DataTable.d.ts +0 -19
- package/dist/utilities/DataTable/DataTable.js +0 -137
- package/dist/utilities/DataTable/types.d.ts +0 -33
- package/dist/utilities/DataTable/types.js +0 -2
- /package/dist/{utilities/DataTable → components/Table}/actions.d.ts +0 -0
- /package/dist/{utilities/DataTable → components/Table}/actions.js +0 -0
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
/* A New Years inspired theme. */
|
|
2
|
-
|
|
3
|
-
/* https://fonts.google.com/specimen/Quicksand?query=Quicksand */
|
|
4
|
-
|
|
5
|
-
:root {
|
|
6
|
-
/* =~= Theme Properties =~= */
|
|
7
|
-
--theme-font-family-base: system-ui;
|
|
8
|
-
--theme-font-family-heading: 'Quicksand', sans-serif;
|
|
9
|
-
--theme-font-color-base: var(--color-surface-500);
|
|
10
|
-
--theme-font-color-dark: var(--color-surface-200);
|
|
11
|
-
--theme-rounded-base: 12px;
|
|
12
|
-
--theme-rounded-container: 12px;
|
|
13
|
-
--theme-border-base: 0px;
|
|
14
|
-
/* =~= Theme On-X Colors =~= */
|
|
15
|
-
--on-primary: 0 0 0;
|
|
16
|
-
--on-secondary: 255 255 255;
|
|
17
|
-
--on-tertiary: 255 255 255;
|
|
18
|
-
--on-success: 0 0 0;
|
|
19
|
-
--on-warning: 0 0 0;
|
|
20
|
-
--on-error: 255 255 255;
|
|
21
|
-
--on-surface: 255 255 255;
|
|
22
|
-
/* =~= Theme Colors =~= */
|
|
23
|
-
/* primary | #40b09d */
|
|
24
|
-
--color-primary-50: 226 243 240; /* ⬅ #e2f3f0 */
|
|
25
|
-
--color-primary-100: 217 239 235; /* ⬅ #d9efeb */
|
|
26
|
-
--color-primary-200: 207 235 231; /* ⬅ #cfebe7 */
|
|
27
|
-
--color-primary-300: 179 223 216; /* ⬅ #b3dfd8 */
|
|
28
|
-
--color-primary-400: 121 200 186; /* ⬅ #79c8ba */
|
|
29
|
-
--color-primary-500: 64 176 157; /* ⬅ #40b09d */
|
|
30
|
-
--color-primary-600: 58 158 141; /* ⬅ #3a9e8d */
|
|
31
|
-
--color-primary-700: 48 132 118; /* ⬅ #308476 */
|
|
32
|
-
--color-primary-800: 38 106 94; /* ⬅ #266a5e */
|
|
33
|
-
--color-primary-900: 31 86 77; /* ⬅ #1f564d */
|
|
34
|
-
/* secondary | #d7a12d */
|
|
35
|
-
--color-secondary-50: 249 241 224; /* ⬅ #f9f1e0 */
|
|
36
|
-
--color-secondary-100: 247 236 213; /* ⬅ #f7ecd5 */
|
|
37
|
-
--color-secondary-200: 245 232 203; /* ⬅ #f5e8cb */
|
|
38
|
-
--color-secondary-300: 239 217 171; /* ⬅ #efd9ab */
|
|
39
|
-
--color-secondary-400: 227 189 108; /* ⬅ #e3bd6c */
|
|
40
|
-
--color-secondary-500: 215 161 45; /* ⬅ #d7a12d */
|
|
41
|
-
--color-secondary-600: 194 145 41; /* ⬅ #c29129 */
|
|
42
|
-
--color-secondary-700: 161 121 34; /* ⬅ #a17922 */
|
|
43
|
-
--color-secondary-800: 129 97 27; /* ⬅ #81611b */
|
|
44
|
-
--color-secondary-900: 105 79 22; /* ⬅ #694f16 */
|
|
45
|
-
/* tertiary | #411d96 */
|
|
46
|
-
--color-tertiary-50: 227 221 239; /* ⬅ #e3ddef */
|
|
47
|
-
--color-tertiary-100: 217 210 234; /* ⬅ #d9d2ea */
|
|
48
|
-
--color-tertiary-200: 208 199 229; /* ⬅ #d0c7e5 */
|
|
49
|
-
--color-tertiary-300: 179 165 213; /* ⬅ #b3a5d5 */
|
|
50
|
-
--color-tertiary-400: 122 97 182; /* ⬅ #7a61b6 */
|
|
51
|
-
--color-tertiary-500: 65 29 150; /* ⬅ #411d96 */
|
|
52
|
-
--color-tertiary-600: 59 26 135; /* ⬅ #3b1a87 */
|
|
53
|
-
--color-tertiary-700: 49 22 113; /* ⬅ #311671 */
|
|
54
|
-
--color-tertiary-800: 39 17 90; /* ⬅ #27115a */
|
|
55
|
-
--color-tertiary-900: 32 14 74; /* ⬅ #200e4a */
|
|
56
|
-
/* success | #aad765 */
|
|
57
|
-
--color-success-50: 242 249 232; /* ⬅ #f2f9e8 */
|
|
58
|
-
--color-success-100: 238 247 224; /* ⬅ #eef7e0 */
|
|
59
|
-
--color-success-200: 234 245 217; /* ⬅ #eaf5d9 */
|
|
60
|
-
--color-success-300: 221 239 193; /* ⬅ #ddefc1 */
|
|
61
|
-
--color-success-400: 196 227 147; /* ⬅ #c4e393 */
|
|
62
|
-
--color-success-500: 170 215 101; /* ⬅ #aad765 */
|
|
63
|
-
--color-success-600: 153 194 91; /* ⬅ #99c25b */
|
|
64
|
-
--color-success-700: 128 161 76; /* ⬅ #80a14c */
|
|
65
|
-
--color-success-800: 102 129 61; /* ⬅ #66813d */
|
|
66
|
-
--color-success-900: 83 105 49; /* ⬅ #536931 */
|
|
67
|
-
/* warning | #e1ca84 */
|
|
68
|
-
--color-warning-50: 251 247 237; /* ⬅ #fbf7ed */
|
|
69
|
-
--color-warning-100: 249 244 230; /* ⬅ #f9f4e6 */
|
|
70
|
-
--color-warning-200: 248 242 224; /* ⬅ #f8f2e0 */
|
|
71
|
-
--color-warning-300: 243 234 206; /* ⬅ #f3eace */
|
|
72
|
-
--color-warning-400: 234 218 169; /* ⬅ #eadaa9 */
|
|
73
|
-
--color-warning-500: 225 202 132; /* ⬅ #e1ca84 */
|
|
74
|
-
--color-warning-600: 203 182 119; /* ⬅ #cbb677 */
|
|
75
|
-
--color-warning-700: 169 152 99; /* ⬅ #a99863 */
|
|
76
|
-
--color-warning-800: 135 121 79; /* ⬅ #87794f */
|
|
77
|
-
--color-warning-900: 110 99 65; /* ⬅ #6e6341 */
|
|
78
|
-
/* error | #e1565d */
|
|
79
|
-
--color-error-50: 251 230 231; /* ⬅ #fbe6e7 */
|
|
80
|
-
--color-error-100: 249 221 223; /* ⬅ #f9dddf */
|
|
81
|
-
--color-error-200: 248 213 215; /* ⬅ #f8d5d7 */
|
|
82
|
-
--color-error-300: 243 187 190; /* ⬅ #f3bbbe */
|
|
83
|
-
--color-error-400: 234 137 142; /* ⬅ #ea898e */
|
|
84
|
-
--color-error-500: 225 86 93; /* ⬅ #e1565d */
|
|
85
|
-
--color-error-600: 203 77 84; /* ⬅ #cb4d54 */
|
|
86
|
-
--color-error-700: 169 65 70; /* ⬅ #a94146 */
|
|
87
|
-
--color-error-800: 135 52 56; /* ⬅ #873438 */
|
|
88
|
-
--color-error-900: 110 42 46; /* ⬅ #6e2a2e */
|
|
89
|
-
/* surface | #0f233e */
|
|
90
|
-
--color-surface-50: 219 222 226; /* ⬅ #dbdee2 */
|
|
91
|
-
--color-surface-100: 207 211 216; /* ⬅ #cfd3d8 */
|
|
92
|
-
--color-surface-200: 195 200 207; /* ⬅ #c3c8cf */
|
|
93
|
-
--color-surface-300: 159 167 178; /* ⬅ #9fa7b2 */
|
|
94
|
-
--color-surface-400: 87 101 120; /* ⬅ #576578 */
|
|
95
|
-
--color-surface-500: 15 35 62; /* ⬅ #0f233e */
|
|
96
|
-
--color-surface-600: 14 32 56; /* ⬅ #0e2038 */
|
|
97
|
-
--color-surface-700: 11 26 47; /* ⬅ #0b1a2f */
|
|
98
|
-
--color-surface-800: 9 21 37; /* ⬅ #091525 */
|
|
99
|
-
--color-surface-900: 7 17 30; /* ⬅ #07111e */
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
/* Applied to body with `<body data-theme="seasonal">` */
|
|
103
|
-
[data-theme='seasonal'] {
|
|
104
|
-
/* prettier-ignore */
|
|
105
|
-
background-image:
|
|
106
|
-
radial-gradient(at 22% 100%, hsla(39,68%,50%,0.23) 0px, transparent 50%),
|
|
107
|
-
radial-gradient(at 80% 100%, hsla(189,100%,56%,0.33) 0px, transparent 50%);
|
|
108
|
-
}
|
|
109
|
-
.dark [data-theme='seasonal'] {
|
|
110
|
-
/* prettier-ignore */
|
|
111
|
-
background-image:
|
|
112
|
-
radial-gradient(at 22% 0%, hsla(39,68%,50%,0.15) 0px, transparent 50%),
|
|
113
|
-
radial-gradient(at 80% 0%, hsla(189,100%,56%,0.15) 0px, transparent 50%);
|
|
114
|
-
}
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
:root {
|
|
2
|
-
/* =~= Theme Properties =~= */
|
|
3
|
-
--theme-font-family-base: system-ui;
|
|
4
|
-
--theme-font-family-heading: system-ui;
|
|
5
|
-
--theme-font-color-base: 0 0 0;
|
|
6
|
-
--theme-font-color-dark: 255 255 255;
|
|
7
|
-
--theme-rounded-base: 9999px;
|
|
8
|
-
--theme-rounded-container: 8px;
|
|
9
|
-
--theme-border-base: 1px;
|
|
10
|
-
/* =~= Theme On-X Colors =~= */
|
|
11
|
-
--on-primary: 0 0 0;
|
|
12
|
-
--on-secondary: 255 255 255;
|
|
13
|
-
--on-tertiary: 0 0 0;
|
|
14
|
-
--on-success: 0 0 0;
|
|
15
|
-
--on-warning: 0 0 0;
|
|
16
|
-
--on-error: 255 255 255;
|
|
17
|
-
--on-surface: 255 255 255;
|
|
18
|
-
/* =~= Theme Colors =~= */
|
|
19
|
-
/* primary | #0FBA81 */
|
|
20
|
-
--color-primary-50: 219 245 236; /* ⬅ #dbf5ec */
|
|
21
|
-
--color-primary-100: 207 241 230; /* ⬅ #cff1e6 */
|
|
22
|
-
--color-primary-200: 195 238 224; /* ⬅ #c3eee0 */
|
|
23
|
-
--color-primary-300: 159 227 205; /* ⬅ #9fe3cd */
|
|
24
|
-
--color-primary-400: 87 207 167; /* ⬅ #57cfa7 */
|
|
25
|
-
--color-primary-500: 15 186 129; /* ⬅ #0FBA81 */
|
|
26
|
-
--color-primary-600: 14 167 116; /* ⬅ #0ea774 */
|
|
27
|
-
--color-primary-700: 11 140 97; /* ⬅ #0b8c61 */
|
|
28
|
-
--color-primary-800: 9 112 77; /* ⬅ #09704d */
|
|
29
|
-
--color-primary-900: 7 91 63; /* ⬅ #075b3f */
|
|
30
|
-
/* secondary | #4F46E5 */
|
|
31
|
-
--color-secondary-50: 229 227 251; /* ⬅ #e5e3fb */
|
|
32
|
-
--color-secondary-100: 220 218 250; /* ⬅ #dcdafa */
|
|
33
|
-
--color-secondary-200: 211 209 249; /* ⬅ #d3d1f9 */
|
|
34
|
-
--color-secondary-300: 185 181 245; /* ⬅ #b9b5f5 */
|
|
35
|
-
--color-secondary-400: 132 126 237; /* ⬅ #847eed */
|
|
36
|
-
--color-secondary-500: 79 70 229; /* ⬅ #4F46E5 */
|
|
37
|
-
--color-secondary-600: 71 63 206; /* ⬅ #473fce */
|
|
38
|
-
--color-secondary-700: 59 53 172; /* ⬅ #3b35ac */
|
|
39
|
-
--color-secondary-800: 47 42 137; /* ⬅ #2f2a89 */
|
|
40
|
-
--color-secondary-900: 39 34 112; /* ⬅ #272270 */
|
|
41
|
-
/* tertiary | #0EA5E9 */
|
|
42
|
-
--color-tertiary-50: 219 242 252; /* ⬅ #dbf2fc */
|
|
43
|
-
--color-tertiary-100: 207 237 251; /* ⬅ #cfedfb */
|
|
44
|
-
--color-tertiary-200: 195 233 250; /* ⬅ #c3e9fa */
|
|
45
|
-
--color-tertiary-300: 159 219 246; /* ⬅ #9fdbf6 */
|
|
46
|
-
--color-tertiary-400: 86 192 240; /* ⬅ #56c0f0 */
|
|
47
|
-
--color-tertiary-500: 14 165 233; /* ⬅ #0EA5E9 */
|
|
48
|
-
--color-tertiary-600: 13 149 210; /* ⬅ #0d95d2 */
|
|
49
|
-
--color-tertiary-700: 11 124 175; /* ⬅ #0b7caf */
|
|
50
|
-
--color-tertiary-800: 8 99 140; /* ⬅ #08638c */
|
|
51
|
-
--color-tertiary-900: 7 81 114; /* ⬅ #075172 */
|
|
52
|
-
/* success | #84cc16 */
|
|
53
|
-
--color-success-50: 237 247 220; /* ⬅ #edf7dc */
|
|
54
|
-
--color-success-100: 230 245 208; /* ⬅ #e6f5d0 */
|
|
55
|
-
--color-success-200: 224 242 197; /* ⬅ #e0f2c5 */
|
|
56
|
-
--color-success-300: 206 235 162; /* ⬅ #ceeba2 */
|
|
57
|
-
--color-success-400: 169 219 92; /* ⬅ #a9db5c */
|
|
58
|
-
--color-success-500: 132 204 22; /* ⬅ #84cc16 */
|
|
59
|
-
--color-success-600: 119 184 20; /* ⬅ #77b814 */
|
|
60
|
-
--color-success-700: 99 153 17; /* ⬅ #639911 */
|
|
61
|
-
--color-success-800: 79 122 13; /* ⬅ #4f7a0d */
|
|
62
|
-
--color-success-900: 65 100 11; /* ⬅ #41640b */
|
|
63
|
-
/* warning | #EAB308 */
|
|
64
|
-
--color-warning-50: 252 244 218; /* ⬅ #fcf4da */
|
|
65
|
-
--color-warning-100: 251 240 206; /* ⬅ #fbf0ce */
|
|
66
|
-
--color-warning-200: 250 236 193; /* ⬅ #faecc1 */
|
|
67
|
-
--color-warning-300: 247 225 156; /* ⬅ #f7e19c */
|
|
68
|
-
--color-warning-400: 240 202 82; /* ⬅ #f0ca52 */
|
|
69
|
-
--color-warning-500: 234 179 8; /* ⬅ #EAB308 */
|
|
70
|
-
--color-warning-600: 211 161 7; /* ⬅ #d3a107 */
|
|
71
|
-
--color-warning-700: 176 134 6; /* ⬅ #b08606 */
|
|
72
|
-
--color-warning-800: 140 107 5; /* ⬅ #8c6b05 */
|
|
73
|
-
--color-warning-900: 115 88 4; /* ⬅ #735804 */
|
|
74
|
-
/* error | #D41976 */
|
|
75
|
-
--color-error-50: 249 221 234; /* ⬅ #f9ddea */
|
|
76
|
-
--color-error-100: 246 209 228; /* ⬅ #f6d1e4 */
|
|
77
|
-
--color-error-200: 244 198 221; /* ⬅ #f4c6dd */
|
|
78
|
-
--color-error-300: 238 163 200; /* ⬅ #eea3c8 */
|
|
79
|
-
--color-error-400: 225 94 159; /* ⬅ #e15e9f */
|
|
80
|
-
--color-error-500: 212 25 118; /* ⬅ #D41976 */
|
|
81
|
-
--color-error-600: 191 23 106; /* ⬅ #bf176a */
|
|
82
|
-
--color-error-700: 159 19 89; /* ⬅ #9f1359 */
|
|
83
|
-
--color-error-800: 127 15 71; /* ⬅ #7f0f47 */
|
|
84
|
-
--color-error-900: 104 12 58; /* ⬅ #680c3a */
|
|
85
|
-
/* surface | #495a8f */
|
|
86
|
-
--color-surface-50: 228 230 238; /* ⬅ #e4e6ee */
|
|
87
|
-
--color-surface-100: 219 222 233; /* ⬅ #dbdee9 */
|
|
88
|
-
--color-surface-200: 210 214 227; /* ⬅ #d2d6e3 */
|
|
89
|
-
--color-surface-300: 182 189 210; /* ⬅ #b6bdd2 */
|
|
90
|
-
--color-surface-400: 128 140 177; /* ⬅ #808cb1 */
|
|
91
|
-
--color-surface-500: 73 90 143; /* ⬅ #495a8f */
|
|
92
|
-
--color-surface-600: 66 81 129; /* ⬅ #425181 */
|
|
93
|
-
--color-surface-700: 55 68 107; /* ⬅ #37446b */
|
|
94
|
-
--color-surface-800: 44 54 86; /* ⬅ #2c3656 */
|
|
95
|
-
--color-surface-900: 36 44 70; /* ⬅ #242c46 */
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/* Headings */
|
|
99
|
-
[data-theme='skeleton'] h1,
|
|
100
|
-
[data-theme='skeleton'] h2,
|
|
101
|
-
[data-theme='skeleton'] h3,
|
|
102
|
-
[data-theme='skeleton'] h4,
|
|
103
|
-
[data-theme='skeleton'] h5,
|
|
104
|
-
[data-theme='skeleton'] h6 {
|
|
105
|
-
font-weight: bold;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
/* Applied to body with `<body data-theme="skeleton">` */
|
|
109
|
-
/* Created with: https://csshero.org/mesher/ */
|
|
110
|
-
/* prettier-ignore */
|
|
111
|
-
[data-theme='skeleton'] {
|
|
112
|
-
background-image:
|
|
113
|
-
radial-gradient(at 0% 0%, rgba(var(--color-secondary-500) / 0.33) 0px, transparent 50%),
|
|
114
|
-
radial-gradient(at 98% 1%, rgba(var(--color-error-500) / 0.33) 0px, transparent 50%);
|
|
115
|
-
background-attachment: fixed;
|
|
116
|
-
background-position: center;
|
|
117
|
-
background-repeat: no-repeat;
|
|
118
|
-
background-size: cover;
|
|
119
|
-
}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
:root {
|
|
2
|
-
/* =~= Theme Properties =~= */
|
|
3
|
-
--theme-font-family-base: system-ui;
|
|
4
|
-
--theme-font-family-heading: system-ui;
|
|
5
|
-
--theme-font-color-base: 0 0 0;
|
|
6
|
-
--theme-font-color-dark: 255 255 255;
|
|
7
|
-
--theme-rounded-base: 9999px;
|
|
8
|
-
--theme-rounded-container: 8px;
|
|
9
|
-
--theme-border-base: 1px;
|
|
10
|
-
/* =~= Theme On-X Colors =~= */
|
|
11
|
-
--on-primary: 0 0 0;
|
|
12
|
-
--on-secondary: 255 255 255;
|
|
13
|
-
--on-tertiary: 0 0 0;
|
|
14
|
-
--on-success: 0 0 0;
|
|
15
|
-
--on-warning: 0 0 0;
|
|
16
|
-
--on-error: 255 255 255;
|
|
17
|
-
--on-surface: 255 255 255;
|
|
18
|
-
/* =~= Theme Colors =~= */
|
|
19
|
-
/* primary | #0FBA81 */
|
|
20
|
-
--color-primary-50: 219 245 236; /* ⬅ #dbf5ec */
|
|
21
|
-
--color-primary-100: 207 241 230; /* ⬅ #cff1e6 */
|
|
22
|
-
--color-primary-200: 195 238 224; /* ⬅ #c3eee0 */
|
|
23
|
-
--color-primary-300: 159 227 205; /* ⬅ #9fe3cd */
|
|
24
|
-
--color-primary-400: 87 207 167; /* ⬅ #57cfa7 */
|
|
25
|
-
--color-primary-500: 15 186 129; /* ⬅ #0FBA81 */
|
|
26
|
-
--color-primary-600: 14 167 116; /* ⬅ #0ea774 */
|
|
27
|
-
--color-primary-700: 11 140 97; /* ⬅ #0b8c61 */
|
|
28
|
-
--color-primary-800: 9 112 77; /* ⬅ #09704d */
|
|
29
|
-
--color-primary-900: 7 91 63; /* ⬅ #075b3f */
|
|
30
|
-
/* secondary | #4F46E5 */
|
|
31
|
-
--color-secondary-50: 229 227 251; /* ⬅ #e5e3fb */
|
|
32
|
-
--color-secondary-100: 220 218 250; /* ⬅ #dcdafa */
|
|
33
|
-
--color-secondary-200: 211 209 249; /* ⬅ #d3d1f9 */
|
|
34
|
-
--color-secondary-300: 185 181 245; /* ⬅ #b9b5f5 */
|
|
35
|
-
--color-secondary-400: 132 126 237; /* ⬅ #847eed */
|
|
36
|
-
--color-secondary-500: 79 70 229; /* ⬅ #4F46E5 */
|
|
37
|
-
--color-secondary-600: 71 63 206; /* ⬅ #473fce */
|
|
38
|
-
--color-secondary-700: 59 53 172; /* ⬅ #3b35ac */
|
|
39
|
-
--color-secondary-800: 47 42 137; /* ⬅ #2f2a89 */
|
|
40
|
-
--color-secondary-900: 39 34 112; /* ⬅ #272270 */
|
|
41
|
-
/* tertiary | #0EA5E9 */
|
|
42
|
-
--color-tertiary-50: 219 242 252; /* ⬅ #dbf2fc */
|
|
43
|
-
--color-tertiary-100: 207 237 251; /* ⬅ #cfedfb */
|
|
44
|
-
--color-tertiary-200: 195 233 250; /* ⬅ #c3e9fa */
|
|
45
|
-
--color-tertiary-300: 159 219 246; /* ⬅ #9fdbf6 */
|
|
46
|
-
--color-tertiary-400: 86 192 240; /* ⬅ #56c0f0 */
|
|
47
|
-
--color-tertiary-500: 14 165 233; /* ⬅ #0EA5E9 */
|
|
48
|
-
--color-tertiary-600: 13 149 210; /* ⬅ #0d95d2 */
|
|
49
|
-
--color-tertiary-700: 11 124 175; /* ⬅ #0b7caf */
|
|
50
|
-
--color-tertiary-800: 8 99 140; /* ⬅ #08638c */
|
|
51
|
-
--color-tertiary-900: 7 81 114; /* ⬅ #075172 */
|
|
52
|
-
/* success | #84cc16 */
|
|
53
|
-
--color-success-50: 237 247 220; /* ⬅ #edf7dc */
|
|
54
|
-
--color-success-100: 230 245 208; /* ⬅ #e6f5d0 */
|
|
55
|
-
--color-success-200: 224 242 197; /* ⬅ #e0f2c5 */
|
|
56
|
-
--color-success-300: 206 235 162; /* ⬅ #ceeba2 */
|
|
57
|
-
--color-success-400: 169 219 92; /* ⬅ #a9db5c */
|
|
58
|
-
--color-success-500: 132 204 22; /* ⬅ #84cc16 */
|
|
59
|
-
--color-success-600: 119 184 20; /* ⬅ #77b814 */
|
|
60
|
-
--color-success-700: 99 153 17; /* ⬅ #639911 */
|
|
61
|
-
--color-success-800: 79 122 13; /* ⬅ #4f7a0d */
|
|
62
|
-
--color-success-900: 65 100 11; /* ⬅ #41640b */
|
|
63
|
-
/* warning | #EAB308 */
|
|
64
|
-
--color-warning-50: 252 244 218; /* ⬅ #fcf4da */
|
|
65
|
-
--color-warning-100: 251 240 206; /* ⬅ #fbf0ce */
|
|
66
|
-
--color-warning-200: 250 236 193; /* ⬅ #faecc1 */
|
|
67
|
-
--color-warning-300: 247 225 156; /* ⬅ #f7e19c */
|
|
68
|
-
--color-warning-400: 240 202 82; /* ⬅ #f0ca52 */
|
|
69
|
-
--color-warning-500: 234 179 8; /* ⬅ #EAB308 */
|
|
70
|
-
--color-warning-600: 211 161 7; /* ⬅ #d3a107 */
|
|
71
|
-
--color-warning-700: 176 134 6; /* ⬅ #b08606 */
|
|
72
|
-
--color-warning-800: 140 107 5; /* ⬅ #8c6b05 */
|
|
73
|
-
--color-warning-900: 115 88 4; /* ⬅ #735804 */
|
|
74
|
-
/* error | #D41976 */
|
|
75
|
-
--color-error-50: 249 221 234; /* ⬅ #f9ddea */
|
|
76
|
-
--color-error-100: 246 209 228; /* ⬅ #f6d1e4 */
|
|
77
|
-
--color-error-200: 244 198 221; /* ⬅ #f4c6dd */
|
|
78
|
-
--color-error-300: 238 163 200; /* ⬅ #eea3c8 */
|
|
79
|
-
--color-error-400: 225 94 159; /* ⬅ #e15e9f */
|
|
80
|
-
--color-error-500: 212 25 118; /* ⬅ #D41976 */
|
|
81
|
-
--color-error-600: 191 23 106; /* ⬅ #bf176a */
|
|
82
|
-
--color-error-700: 159 19 89; /* ⬅ #9f1359 */
|
|
83
|
-
--color-error-800: 127 15 71; /* ⬅ #7f0f47 */
|
|
84
|
-
--color-error-900: 104 12 58; /* ⬅ #680c3a */
|
|
85
|
-
/* surface | #495a8f */
|
|
86
|
-
--color-surface-50: 228 230 238; /* ⬅ #e4e6ee */
|
|
87
|
-
--color-surface-100: 219 222 233; /* ⬅ #dbdee9 */
|
|
88
|
-
--color-surface-200: 210 214 227; /* ⬅ #d2d6e3 */
|
|
89
|
-
--color-surface-300: 182 189 210; /* ⬅ #b6bdd2 */
|
|
90
|
-
--color-surface-400: 128 140 177; /* ⬅ #808cb1 */
|
|
91
|
-
--color-surface-500: 73 90 143; /* ⬅ #495a8f */
|
|
92
|
-
--color-surface-600: 66 81 129; /* ⬅ #425181 */
|
|
93
|
-
--color-surface-700: 55 68 107; /* ⬅ #37446b */
|
|
94
|
-
--color-surface-800: 44 54 86; /* ⬅ #2c3656 */
|
|
95
|
-
--color-surface-900: 36 44 70; /* ⬅ #242c46 */
|
|
96
|
-
}
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
/* https://fonts.google.com/specimen/Abril+Fatface?query=Abril+Fatface¬o.query=Abril */
|
|
2
|
-
|
|
3
|
-
:root {
|
|
4
|
-
/* =~= Theme Styles =~= */
|
|
5
|
-
--theme-font-family-base: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
|
|
6
|
-
'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
|
|
7
|
-
--theme-font-family-heading: 'Abril Fatface', cursive;
|
|
8
|
-
--theme-font-color-base: var(--color-primary-900);
|
|
9
|
-
--theme-font-color-dark: var(--color-primary-100);
|
|
10
|
-
--theme-rounded-base: 2px;
|
|
11
|
-
--theme-rounded-container: 4px;
|
|
12
|
-
--theme-border-base: 1px;
|
|
13
|
-
/* =~= Theme On-X Colors =~= */
|
|
14
|
-
--on-primary: 0 0 0;
|
|
15
|
-
--on-secondary: 0 0 0;
|
|
16
|
-
--on-tertiary: 0 0 0;
|
|
17
|
-
--on-success: 0 0 0;
|
|
18
|
-
--on-warning: 0 0 0;
|
|
19
|
-
--on-error: 0 0 0;
|
|
20
|
-
--on-surface: 255 255 255;
|
|
21
|
-
/* =~= Theme Colors =~= */
|
|
22
|
-
/* primary | #ea861a */
|
|
23
|
-
--color-primary-50: 252 237 221; /* ⬅ #fceddd */
|
|
24
|
-
--color-primary-100: 251 231 209; /* ⬅ #fbe7d1 */
|
|
25
|
-
--color-primary-200: 250 225 198; /* ⬅ #fae1c6 */
|
|
26
|
-
--color-primary-300: 247 207 163; /* ⬅ #f7cfa3 */
|
|
27
|
-
--color-primary-400: 240 170 95; /* ⬅ #f0aa5f */
|
|
28
|
-
--color-primary-500: 234 134 26; /* ⬅ #ea861a */
|
|
29
|
-
--color-primary-600: 211 121 23; /* ⬅ #d37917 */
|
|
30
|
-
--color-primary-700: 176 101 20; /* ⬅ #b06514 */
|
|
31
|
-
--color-primary-800: 140 80 16; /* ⬅ #8c5010 */
|
|
32
|
-
--color-primary-900: 115 66 13; /* ⬅ #73420d */
|
|
33
|
-
/* secondary | #97cea5 */
|
|
34
|
-
--color-secondary-50: 239 248 242; /* ⬅ #eff8f2 */
|
|
35
|
-
--color-secondary-100: 234 245 237; /* ⬅ #eaf5ed */
|
|
36
|
-
--color-secondary-200: 229 243 233; /* ⬅ #e5f3e9 */
|
|
37
|
-
--color-secondary-300: 213 235 219; /* ⬅ #d5ebdb */
|
|
38
|
-
--color-secondary-400: 182 221 192; /* ⬅ #b6ddc0 */
|
|
39
|
-
--color-secondary-500: 151 206 165; /* ⬅ #97cea5 */
|
|
40
|
-
--color-secondary-600: 136 185 149; /* ⬅ #88b995 */
|
|
41
|
-
--color-secondary-700: 113 155 124; /* ⬅ #719b7c */
|
|
42
|
-
--color-secondary-800: 91 124 99; /* ⬅ #5b7c63 */
|
|
43
|
-
--color-secondary-900: 74 101 81; /* ⬅ #4a6551 */
|
|
44
|
-
/* tertiary | #06b6d4 */
|
|
45
|
-
--color-tertiary-50: 218 244 249; /* ⬅ #daf4f9 */
|
|
46
|
-
--color-tertiary-100: 205 240 246; /* ⬅ #cdf0f6 */
|
|
47
|
-
--color-tertiary-200: 193 237 244; /* ⬅ #c1edf4 */
|
|
48
|
-
--color-tertiary-300: 155 226 238; /* ⬅ #9be2ee */
|
|
49
|
-
--color-tertiary-400: 81 204 225; /* ⬅ #51cce1 */
|
|
50
|
-
--color-tertiary-500: 6 182 212; /* ⬅ #06b6d4 */
|
|
51
|
-
--color-tertiary-600: 5 164 191; /* ⬅ #05a4bf */
|
|
52
|
-
--color-tertiary-700: 5 137 159; /* ⬅ #05899f */
|
|
53
|
-
--color-tertiary-800: 4 109 127; /* ⬅ #046d7f */
|
|
54
|
-
--color-tertiary-900: 3 89 104; /* ⬅ #035968 */
|
|
55
|
-
/* success | #84cb5d */
|
|
56
|
-
--color-success-50: 237 247 231; /* ⬅ #edf7e7 */
|
|
57
|
-
--color-success-100: 230 245 223; /* ⬅ #e6f5df */
|
|
58
|
-
--color-success-200: 224 242 215; /* ⬅ #e0f2d7 */
|
|
59
|
-
--color-success-300: 206 234 190; /* ⬅ #ceeabe */
|
|
60
|
-
--color-success-400: 169 219 142; /* ⬅ #a9db8e */
|
|
61
|
-
--color-success-500: 132 203 93; /* ⬅ #84cb5d */
|
|
62
|
-
--color-success-600: 119 183 84; /* ⬅ #77b754 */
|
|
63
|
-
--color-success-700: 99 152 70; /* ⬅ #639846 */
|
|
64
|
-
--color-success-800: 79 122 56; /* ⬅ #4f7a38 */
|
|
65
|
-
--color-success-900: 65 99 46; /* ⬅ #41632e */
|
|
66
|
-
/* warning | #f2ac23 */
|
|
67
|
-
--color-warning-50: 253 243 222; /* ⬅ #fdf3de */
|
|
68
|
-
--color-warning-100: 252 238 211; /* ⬅ #fceed3 */
|
|
69
|
-
--color-warning-200: 252 234 200; /* ⬅ #fceac8 */
|
|
70
|
-
--color-warning-300: 250 222 167; /* ⬅ #fadea7 */
|
|
71
|
-
--color-warning-400: 246 197 101; /* ⬅ #f6c565 */
|
|
72
|
-
--color-warning-500: 242 172 35; /* ⬅ #f2ac23 */
|
|
73
|
-
--color-warning-600: 218 155 32; /* ⬅ #da9b20 */
|
|
74
|
-
--color-warning-700: 182 129 26; /* ⬅ #b6811a */
|
|
75
|
-
--color-warning-800: 145 103 21; /* ⬅ #916715 */
|
|
76
|
-
--color-warning-900: 119 84 17; /* ⬅ #775411 */
|
|
77
|
-
/* error | #d57e78 */
|
|
78
|
-
--color-error-50: 249 236 235; /* ⬅ #f9eceb */
|
|
79
|
-
--color-error-100: 247 229 228; /* ⬅ #f7e5e4 */
|
|
80
|
-
--color-error-200: 245 223 221; /* ⬅ #f5dfdd */
|
|
81
|
-
--color-error-300: 238 203 201; /* ⬅ #eecbc9 */
|
|
82
|
-
--color-error-400: 226 165 161; /* ⬅ #e2a5a1 */
|
|
83
|
-
--color-error-500: 213 126 120; /* ⬅ #d57e78 */
|
|
84
|
-
--color-error-600: 192 113 108; /* ⬅ #c0716c */
|
|
85
|
-
--color-error-700: 160 95 90; /* ⬅ #a05f5a */
|
|
86
|
-
--color-error-800: 128 76 72; /* ⬅ #804c48 */
|
|
87
|
-
--color-error-900: 104 62 59; /* ⬅ #683e3b */
|
|
88
|
-
/* surface | #3f3731 */
|
|
89
|
-
--color-surface-50: 226 225 224; /* ⬅ #e2e1e0 */
|
|
90
|
-
--color-surface-100: 217 215 214; /* ⬅ #d9d7d6 */
|
|
91
|
-
--color-surface-200: 207 205 204; /* ⬅ #cfcdcc */
|
|
92
|
-
--color-surface-300: 178 175 173; /* ⬅ #b2afad */
|
|
93
|
-
--color-surface-400: 121 115 111; /* ⬅ #79736f */
|
|
94
|
-
--color-surface-500: 63 55 49; /* ⬅ #3f3731 */
|
|
95
|
-
--color-surface-600: 57 50 44; /* ⬅ #39322c */
|
|
96
|
-
--color-surface-700: 47 41 37; /* ⬅ #2f2925 */
|
|
97
|
-
--color-surface-800: 38 33 29; /* ⬅ #26211d */
|
|
98
|
-
--color-surface-900: 31 27 24; /* ⬅ #1f1b18 */
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
[data-theme='vintage'] h1,
|
|
102
|
-
[data-theme='vintage'] h2,
|
|
103
|
-
[data-theme='vintage'] h3,
|
|
104
|
-
[data-theme='vintage'] h4,
|
|
105
|
-
[data-theme='vintage'] h5,
|
|
106
|
-
[data-theme='vintage'] h6 {
|
|
107
|
-
letter-spacing: 1px;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
/* Applied to body with `<body data-theme="vintage">` */
|
|
111
|
-
/* Created with: https://csshero.org/mesher/ */
|
|
112
|
-
[data-theme='vintage'] {
|
|
113
|
-
/* prettier-ignore */
|
|
114
|
-
background-image:
|
|
115
|
-
radial-gradient(at 100% 0%, hsla(135,34%,70%,0.20) 0px, transparent 50%),
|
|
116
|
-
radial-gradient(at 85% 100%, hsla(31,83%,50%,0.20) 0px, transparent 50%);
|
|
117
|
-
background-attachment: fixed;
|
|
118
|
-
background-position: center;
|
|
119
|
-
background-repeat: no-repeat;
|
|
120
|
-
background-size: cover;
|
|
121
|
-
}
|
|
122
|
-
.dark [data-theme='vintage'] {
|
|
123
|
-
/* prettier-ignore */
|
|
124
|
-
background-image:
|
|
125
|
-
radial-gradient(at 100% 0%, hsla(135,34%,70%,0.14) 0px, transparent 50%),
|
|
126
|
-
radial-gradient(at 85% 100%, hsla(31,83%,50%,0.14) 0px, transparent 50%);
|
|
127
|
-
background-attachment: fixed;
|
|
128
|
-
background-position: center;
|
|
129
|
-
background-repeat: no-repeat;
|
|
130
|
-
background-size: cover;
|
|
131
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/// <reference types="svelte" />
|
|
2
|
-
import type { DataTableModel, DataTableOptions } from './types.js';
|
|
3
|
-
export * from './types.js';
|
|
4
|
-
export * from './actions.js';
|
|
5
|
-
/** Creates the writeable store for the data table */
|
|
6
|
-
export declare function createDataTableStore<T extends Record<PropertyKey, any>>(source: T[], options?: DataTableOptions<T>): {
|
|
7
|
-
subscribe: (this: void, run: import("svelte/store").Subscriber<DataTableModel<T>>, invalidate?: import("svelte/store").Invalidator<DataTableModel<T>> | undefined) => import("svelte/store").Unsubscriber;
|
|
8
|
-
set: (this: void, value: DataTableModel<T>) => void;
|
|
9
|
-
/** Sets a new data source while maintaining the state of the original source */
|
|
10
|
-
updateSource: (data: T[]) => void;
|
|
11
|
-
/** Triggered by the "select all" checkbox to toggle all row selection. */
|
|
12
|
-
selectAll: (checked: boolean) => void;
|
|
13
|
-
/** Allows you to dynamically pre-select rows on-demand. */
|
|
14
|
-
select: (key: keyof T, valuesArr: unknown[]) => void;
|
|
15
|
-
/** Listens for clicks to a table heading with `data-sort` attribute. Updates `$dataTableModel.sort`. */
|
|
16
|
-
sort: (event: Event) => void;
|
|
17
|
-
};
|
|
18
|
-
/** Listens for changes to `$dataTableModel` and triggers: search, selection, sort, and pagination. */
|
|
19
|
-
export declare function dataTableHandler<T extends Record<PropertyKey, any>>(model: DataTableModel<T>): void;
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
// Data Table Utilities
|
|
2
|
-
// A set of utility features for local template-driven data tables.
|
|
3
|
-
import { writable } from 'svelte/store';
|
|
4
|
-
// Exports
|
|
5
|
-
export * from './types.js';
|
|
6
|
-
export * from './actions.js';
|
|
7
|
-
/** Creates the writeable store for the data table */
|
|
8
|
-
export function createDataTableStore(source, options = {}) {
|
|
9
|
-
// Creates a new source that also adds the `dataTableChecked` property to each row object
|
|
10
|
-
const modifiedList = source.map((rowObj) => ({ ...rowObj, dataTableChecked: false }));
|
|
11
|
-
// Generate the writable
|
|
12
|
-
const { subscribe, set, update } = writable({
|
|
13
|
-
source,
|
|
14
|
-
base: modifiedList,
|
|
15
|
-
filtered: modifiedList,
|
|
16
|
-
sortState: { lastKey: '', asc: true },
|
|
17
|
-
selection: [],
|
|
18
|
-
search: options.search ?? '',
|
|
19
|
-
sort: options.sort ?? '',
|
|
20
|
-
pagination: options.pagination
|
|
21
|
-
});
|
|
22
|
-
return {
|
|
23
|
-
subscribe,
|
|
24
|
-
set,
|
|
25
|
-
/** Sets a new data source while maintaining the state of the original source */
|
|
26
|
-
updateSource: (data) => update((model) => {
|
|
27
|
-
model.source = data;
|
|
28
|
-
model.base = data.map((row, i) => {
|
|
29
|
-
return { ...row, dataTableChecked: model.base[i]?.dataTableChecked ?? false };
|
|
30
|
-
});
|
|
31
|
-
return { ...model, filtered: model.base };
|
|
32
|
-
}),
|
|
33
|
-
/** Triggered by the "select all" checkbox to toggle all row selection. */
|
|
34
|
-
selectAll: (checked) => {
|
|
35
|
-
update((model) => {
|
|
36
|
-
// checks/unchecks all of the rows
|
|
37
|
-
model.base.forEach((row) => {
|
|
38
|
-
row.dataTableChecked = checked;
|
|
39
|
-
return row;
|
|
40
|
-
});
|
|
41
|
-
return model;
|
|
42
|
-
});
|
|
43
|
-
},
|
|
44
|
-
/** Allows you to dynamically pre-select rows on-demand. */
|
|
45
|
-
select: (key, valuesArr) => {
|
|
46
|
-
update((model) => {
|
|
47
|
-
model.filtered.map((row) => {
|
|
48
|
-
if (valuesArr.includes(row[key]))
|
|
49
|
-
row.dataTableChecked = true;
|
|
50
|
-
return row;
|
|
51
|
-
});
|
|
52
|
-
return model;
|
|
53
|
-
});
|
|
54
|
-
},
|
|
55
|
-
/** Listens for clicks to a table heading with `data-sort` attribute. Updates `$dataTableModel.sort`. */
|
|
56
|
-
sort: (event) => {
|
|
57
|
-
update((model) => {
|
|
58
|
-
if (!(event.target instanceof Element))
|
|
59
|
-
return model;
|
|
60
|
-
const newSortKey = event.target.getAttribute('data-sort');
|
|
61
|
-
// If same key used repeated, toggle asc/dsc order
|
|
62
|
-
if (newSortKey !== '' && newSortKey === model.sortState.lastKey)
|
|
63
|
-
model.sortState.asc = !model.sortState.asc;
|
|
64
|
-
// Cache the last key used
|
|
65
|
-
model.sortState.lastKey = newSortKey;
|
|
66
|
-
// Update sort key
|
|
67
|
-
model.sort = newSortKey ?? '';
|
|
68
|
-
return model;
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
// Data Table Handler
|
|
74
|
-
/** Listens for changes to `$dataTableModel` and triggers: search, selection, sort, and pagination. */
|
|
75
|
-
export function dataTableHandler(model) {
|
|
76
|
-
searchHandler(model);
|
|
77
|
-
selectionHandler(model);
|
|
78
|
-
sortHandler(model);
|
|
79
|
-
paginationHandler(model);
|
|
80
|
-
}
|
|
81
|
-
// Search ---
|
|
82
|
-
function searchHandler(store) {
|
|
83
|
-
store.filtered = store.base.filter((rowObj) => {
|
|
84
|
-
const formattedSearchTerm = store.search?.toLowerCase() || '';
|
|
85
|
-
return Object.values(rowObj).join(' ').toLowerCase().includes(formattedSearchTerm);
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
// Selection ---
|
|
89
|
-
function selectionHandler(store) {
|
|
90
|
-
store.selection = store.base.filter((row) => row.dataTableChecked === true); // ? should this be filtered by source or filter?
|
|
91
|
-
}
|
|
92
|
-
// Sort ---
|
|
93
|
-
function sortHandler(store) {
|
|
94
|
-
if (!store.sort)
|
|
95
|
-
return;
|
|
96
|
-
// Sort order based on current sortState.asc value
|
|
97
|
-
store.sortState.asc ? sortOrder('asc', store) : sortOrder('dsc', store);
|
|
98
|
-
}
|
|
99
|
-
function sortOrder(order, store) {
|
|
100
|
-
const key = store.sort;
|
|
101
|
-
store.filtered = store.base.sort((x, y) => {
|
|
102
|
-
// If descending, swap x/y
|
|
103
|
-
if (order === 'dsc')
|
|
104
|
-
[x, y] = [y, x];
|
|
105
|
-
// Sort logic
|
|
106
|
-
if (typeof x[key] === 'string' && typeof y[key] === 'string') {
|
|
107
|
-
return String(x[key]).localeCompare(String(y[key]));
|
|
108
|
-
}
|
|
109
|
-
else {
|
|
110
|
-
const a = x[key];
|
|
111
|
-
const b = y[key];
|
|
112
|
-
return a < b ? -1 : a > b ? 1 : 0;
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
// Pagination ---
|
|
117
|
-
function paginationHandler(store) {
|
|
118
|
-
if (store.pagination) {
|
|
119
|
-
// Slice for Pagination
|
|
120
|
-
const filtered = store.base.slice(store.pagination.offset * store.pagination.limit, // start
|
|
121
|
-
store.pagination.offset * store.pagination.limit + store.pagination.limit // end
|
|
122
|
-
);
|
|
123
|
-
// filter by search if currently searching
|
|
124
|
-
if (store.search !== '') {
|
|
125
|
-
store.filtered = store.filtered.slice(0, store.pagination.limit);
|
|
126
|
-
// Set Current Size
|
|
127
|
-
store.pagination.size = store.filtered.length;
|
|
128
|
-
// Set the current page to the first page
|
|
129
|
-
store.pagination.offset = 0;
|
|
130
|
-
}
|
|
131
|
-
else {
|
|
132
|
-
store.filtered = filtered;
|
|
133
|
-
// Set Current Size
|
|
134
|
-
store.pagination.size = store.base.length;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { PaginationSettings } from '../../index.js';
|
|
2
|
-
export interface DataTableModel<T extends Record<PropertyKey, unknown>> {
|
|
3
|
-
/** The original source data. */
|
|
4
|
-
source: T[];
|
|
5
|
-
/** The unfiltered, modified source data */
|
|
6
|
-
base: Data<T>;
|
|
7
|
-
/** The filtered source data, shown in UI. */
|
|
8
|
-
filtered: Data<T>;
|
|
9
|
-
/** An array of selected row objects. */
|
|
10
|
-
selection: Data<T>;
|
|
11
|
-
/** The current search term. */
|
|
12
|
-
search: string;
|
|
13
|
-
/** The current sort key. */
|
|
14
|
-
sort: keyof T | '';
|
|
15
|
-
/** The current state of the sort key. */
|
|
16
|
-
sortState: {
|
|
17
|
-
lastKey: keyof T | '' | null;
|
|
18
|
-
asc: boolean;
|
|
19
|
-
};
|
|
20
|
-
/** The Paginator component settings. */
|
|
21
|
-
pagination?: PaginationSettings;
|
|
22
|
-
}
|
|
23
|
-
export interface DataTableOptions<T> {
|
|
24
|
-
/** The current search term. */
|
|
25
|
-
search?: string;
|
|
26
|
-
/** The current sort key. */
|
|
27
|
-
sort?: keyof T | '';
|
|
28
|
-
/** The Paginator component settings. */
|
|
29
|
-
pagination?: PaginationSettings;
|
|
30
|
-
}
|
|
31
|
-
export type Data<T> = (T & {
|
|
32
|
-
dataTableChecked: boolean;
|
|
33
|
-
})[];
|
|
File without changes
|
|
File without changes
|