@bexis2/bexis2-core-ui 0.3.14 → 0.4.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 +13 -1
- package/dist/TableView.svelte.d.ts +2 -2
- package/dist/components/CodeEditor/CodeEditor.svelte +1 -1
- package/dist/components/CodeEditor/CodeEditor.svelte.d.ts +3 -4
- package/dist/components/File/FileIcon.svelte.d.ts +2 -2
- package/dist/components/File/FileInfo.svelte.d.ts +2 -2
- package/dist/components/File/FileUploader.svelte +1 -1
- package/dist/components/File/FileUploader.svelte.d.ts +2 -2
- package/dist/components/ListView.svelte.d.ts +2 -2
- package/dist/components/Table/Table.svelte.d.ts +2 -2
- package/dist/components/Table/TableContent.svelte +39 -13
- package/dist/components/Table/TableContent.svelte.d.ts +2 -2
- package/dist/components/Table/TableFilter.svelte +51 -25
- package/dist/components/Table/TableFilter.svelte.d.ts +4 -2
- package/dist/components/Table/TableFilterServer.svelte +1 -1
- package/dist/components/Table/TableFilterServer.svelte.d.ts +2 -2
- package/dist/components/Table/TablePagination.svelte +1 -1
- package/dist/components/Table/TablePagination.svelte.d.ts +2 -2
- package/dist/components/Table/TablePaginationServer.svelte +1 -1
- package/dist/components/Table/TablePaginationServer.svelte.d.ts +2 -2
- package/dist/components/Table/shared.js +8 -8
- package/dist/components/form/Checkbox.svelte.d.ts +2 -2
- package/dist/components/form/CheckboxKvPList.svelte.d.ts +2 -2
- package/dist/components/form/CheckboxList.svelte.d.ts +2 -2
- package/dist/components/form/DateInput.svelte.d.ts +2 -2
- package/dist/components/form/DropdownKvP.svelte.d.ts +8 -8
- package/dist/components/form/InputContainer.svelte.d.ts +2 -2
- package/dist/components/form/MultiSelect.svelte.d.ts +6 -6
- package/dist/components/form/NumberInput.svelte.d.ts +2 -2
- package/dist/components/form/TextArea.svelte.d.ts +2 -2
- package/dist/components/form/TextInput.svelte.d.ts +2 -2
- package/dist/components/page/Alert.svelte.d.ts +2 -2
- package/dist/components/page/BackToTop.svelte.d.ts +2 -2
- package/dist/components/page/Docs.svelte +1 -1
- package/dist/components/page/Docs.svelte.d.ts +2 -2
- package/dist/components/page/ErrorMessage.svelte.d.ts +2 -2
- package/dist/components/page/Footer.svelte.d.ts +2 -2
- package/dist/components/page/GoToTop.svelte +1 -1
- package/dist/components/page/GoToTop.svelte.d.ts +2 -2
- package/dist/components/page/Header.svelte.d.ts +2 -2
- package/dist/components/page/HelpPopUp.svelte +1 -1
- package/dist/components/page/HelpPopUp.svelte.d.ts +2 -2
- package/dist/components/page/Notification.svelte.d.ts +2 -2
- package/dist/components/page/Page.svelte.d.ts +2 -2
- package/dist/components/page/Spinner.svelte.d.ts +2 -2
- package/dist/components/page/TablePlaceholder.svelte.d.ts +2 -2
- package/dist/components/page/breadcrumb/Breadcrumb.svelte.d.ts +2 -2
- package/dist/components/page/menu/Menu.svelte +1 -1
- package/dist/components/page/menu/Menu.svelte.d.ts +2 -2
- package/dist/components/page/menu/MenuBar.svelte.d.ts +2 -2
- package/dist/components/page/menu/MenuItem.svelte.d.ts +2 -2
- package/dist/components/page/menu/MenuSublist.svelte.d.ts +2 -2
- package/dist/components/page/menu/SettingsBar.svelte +1 -1
- package/dist/components/page/menu/SettingsBar.svelte.d.ts +2 -2
- package/dist/components/toggle/Toggle.svelte +1 -1
- package/dist/components/toggle/Toggle.svelte.d.ts +2 -2
- package/dist/models/Enums.d.ts +15 -15
- package/dist/models/Models.d.ts +1 -0
- package/dist/models/Models.js +2 -0
- package/dist/stores/pageStores.d.ts +4 -3
- package/dist/themes/theme-bexis2.js +78 -78
- package/package.json +44 -41
- package/src/lib/components/CodeEditor/CodeEditor.svelte +1 -1
- package/src/lib/components/Table/TableContent.svelte +41 -14
- package/src/lib/components/Table/TableFilter.svelte +62 -36
- package/src/lib/components/Table/TableFilterServer.svelte +1 -1
- package/src/lib/components/Table/TablePagination.svelte +1 -1
- package/src/lib/components/Table/TablePaginationServer.svelte +1 -1
- package/src/lib/components/Table/shared.ts +9 -8
- package/src/lib/components/file/FileUploader.svelte +1 -1
- package/src/lib/components/page/Docs.svelte +1 -1
- package/src/lib/components/page/GoToTop.svelte +1 -1
- package/src/lib/components/page/HelpPopUp.svelte +1 -1
- package/src/lib/components/page/menu/Menu.svelte +1 -1
- package/src/lib/components/page/menu/SettingsBar.svelte +1 -1
- package/src/lib/components/toggle/Toggle.svelte +1 -1
- package/src/lib/models/Models.ts +2 -0
|
@@ -19,94 +19,94 @@ export const bexis2theme = {
|
|
|
19
19
|
'--on-surface': '255 255 255',
|
|
20
20
|
// =~= Theme Colors =~=
|
|
21
21
|
// primary | #45b2a1
|
|
22
|
-
'--color-primary-50': '227 243 241',
|
|
23
|
-
'--color-primary-100': '218 240 236',
|
|
24
|
-
'--color-primary-200': '209 236 232',
|
|
25
|
-
'--color-primary-300': '181 224 217',
|
|
26
|
-
'--color-primary-400': '125 201 189',
|
|
27
|
-
'--color-primary-500': '69 178 161',
|
|
28
|
-
'--color-primary-600': '62 160 145',
|
|
29
|
-
'--color-primary-700': '52 134 121',
|
|
30
|
-
'--color-primary-800': '41 107 97',
|
|
31
|
-
'--color-primary-900': '34 87 79',
|
|
22
|
+
'--color-primary-50': '227 243 241', // #e3f3f1
|
|
23
|
+
'--color-primary-100': '218 240 236', // #daf0ec
|
|
24
|
+
'--color-primary-200': '209 236 232', // #d1ece8
|
|
25
|
+
'--color-primary-300': '181 224 217', // #b5e0d9
|
|
26
|
+
'--color-primary-400': '125 201 189', // #7dc9bd
|
|
27
|
+
'--color-primary-500': '69 178 161', // #45b2a1
|
|
28
|
+
'--color-primary-600': '62 160 145', // #3ea091
|
|
29
|
+
'--color-primary-700': '52 134 121', // #348679
|
|
30
|
+
'--color-primary-800': '41 107 97', // #296b61
|
|
31
|
+
'--color-primary-900': '34 87 79', // #22574f
|
|
32
32
|
// secondary | #ff9700
|
|
33
|
-
'--color-secondary-50': '255 239 217',
|
|
34
|
-
'--color-secondary-100': '255 234 204',
|
|
35
|
-
'--color-secondary-200': '255 229 191',
|
|
36
|
-
'--color-secondary-300': '255 213 153',
|
|
37
|
-
'--color-secondary-400': '255 182 77',
|
|
38
|
-
'--color-secondary-500': '255 151 0',
|
|
39
|
-
'--color-secondary-600': '230 136 0',
|
|
40
|
-
'--color-secondary-700': '191 113 0',
|
|
41
|
-
'--color-secondary-800': '153 91 0',
|
|
42
|
-
'--color-secondary-900': '125 74 0',
|
|
33
|
+
'--color-secondary-50': '255 239 217', // #ffefd9
|
|
34
|
+
'--color-secondary-100': '255 234 204', // #ffeacc
|
|
35
|
+
'--color-secondary-200': '255 229 191', // #ffe5bf
|
|
36
|
+
'--color-secondary-300': '255 213 153', // #ffd599
|
|
37
|
+
'--color-secondary-400': '255 182 77', // #ffb64d
|
|
38
|
+
'--color-secondary-500': '255 151 0', // #ff9700
|
|
39
|
+
'--color-secondary-600': '230 136 0', // #e68800
|
|
40
|
+
'--color-secondary-700': '191 113 0', // #bf7100
|
|
41
|
+
'--color-secondary-800': '153 91 0', // #995b00
|
|
42
|
+
'--color-secondary-900': '125 74 0', // #7d4a00
|
|
43
43
|
// tertiary | #bee1da
|
|
44
|
-
'--color-tertiary-50': '245 251 249',
|
|
45
|
-
'--color-tertiary-100': '242 249 248',
|
|
46
|
-
'--color-tertiary-200': '239 248 246',
|
|
47
|
-
'--color-tertiary-300': '229 243 240',
|
|
48
|
-
'--color-tertiary-400': '210 234 229',
|
|
49
|
-
'--color-tertiary-500': '190 225 218',
|
|
50
|
-
'--color-tertiary-600': '171 203 196',
|
|
51
|
-
'--color-tertiary-700': '143 169 164',
|
|
52
|
-
'--color-tertiary-800': '114 135 131',
|
|
53
|
-
'--color-tertiary-900': '93 110 107',
|
|
44
|
+
'--color-tertiary-50': '245 251 249', // #f5fbf9
|
|
45
|
+
'--color-tertiary-100': '242 249 248', // #f2f9f8
|
|
46
|
+
'--color-tertiary-200': '239 248 246', // #eff8f6
|
|
47
|
+
'--color-tertiary-300': '229 243 240', // #e5f3f0
|
|
48
|
+
'--color-tertiary-400': '210 234 229', // #d2eae5
|
|
49
|
+
'--color-tertiary-500': '190 225 218', // #bee1da
|
|
50
|
+
'--color-tertiary-600': '171 203 196', // #abcbc4
|
|
51
|
+
'--color-tertiary-700': '143 169 164', // #8fa9a4
|
|
52
|
+
'--color-tertiary-800': '114 135 131', // #728783
|
|
53
|
+
'--color-tertiary-900': '93 110 107', // #5d6e6b
|
|
54
54
|
// success | #4BB543
|
|
55
|
-
'--color-success-50': '228 244 227',
|
|
56
|
-
'--color-success-100': '219 240 217',
|
|
57
|
-
'--color-success-200': '210 237 208',
|
|
58
|
-
'--color-success-300': '183 225 180',
|
|
59
|
-
'--color-success-400': '129 203 123',
|
|
60
|
-
'--color-success-500': '75 181 67',
|
|
61
|
-
'--color-success-600': '68 163 60',
|
|
62
|
-
'--color-success-700': '56 136 50',
|
|
63
|
-
'--color-success-800': '45 109 40',
|
|
64
|
-
'--color-success-900': '37 89 33',
|
|
55
|
+
'--color-success-50': '228 244 227', // #e4f4e3
|
|
56
|
+
'--color-success-100': '219 240 217', // #dbf0d9
|
|
57
|
+
'--color-success-200': '210 237 208', // #d2edd0
|
|
58
|
+
'--color-success-300': '183 225 180', // #b7e1b4
|
|
59
|
+
'--color-success-400': '129 203 123', // #81cb7b
|
|
60
|
+
'--color-success-500': '75 181 67', // #4BB543
|
|
61
|
+
'--color-success-600': '68 163 60', // #44a33c
|
|
62
|
+
'--color-success-700': '56 136 50', // #388832
|
|
63
|
+
'--color-success-800': '45 109 40', // #2d6d28
|
|
64
|
+
'--color-success-900': '37 89 33', // #255921
|
|
65
65
|
// warning | #EAB308
|
|
66
|
-
'--color-warning-50': '252 244 218',
|
|
67
|
-
'--color-warning-100': '251 240 206',
|
|
68
|
-
'--color-warning-200': '250 236 193',
|
|
69
|
-
'--color-warning-300': '247 225 156',
|
|
70
|
-
'--color-warning-400': '240 202 82',
|
|
71
|
-
'--color-warning-500': '234 179 8',
|
|
72
|
-
'--color-warning-600': '211 161 7',
|
|
73
|
-
'--color-warning-700': '176 134 6',
|
|
74
|
-
'--color-warning-800': '140 107 5',
|
|
75
|
-
'--color-warning-900': '115 88 4',
|
|
66
|
+
'--color-warning-50': '252 244 218', // #fcf4da
|
|
67
|
+
'--color-warning-100': '251 240 206', // #fbf0ce
|
|
68
|
+
'--color-warning-200': '250 236 193', // #faecc1
|
|
69
|
+
'--color-warning-300': '247 225 156', // #f7e19c
|
|
70
|
+
'--color-warning-400': '240 202 82', // #f0ca52
|
|
71
|
+
'--color-warning-500': '234 179 8', // #EAB308
|
|
72
|
+
'--color-warning-600': '211 161 7', // #d3a107
|
|
73
|
+
'--color-warning-700': '176 134 6', // #b08606
|
|
74
|
+
'--color-warning-800': '140 107 5', // #8c6b05
|
|
75
|
+
'--color-warning-900': '115 88 4', // #735804
|
|
76
76
|
// error | #FF0000
|
|
77
|
-
'--color-error-50': '255 217 217',
|
|
78
|
-
'--color-error-100': '255 204 204',
|
|
79
|
-
'--color-error-200': '255 191 191',
|
|
80
|
-
'--color-error-300': '255 153 153',
|
|
81
|
-
'--color-error-400': '255 77 77',
|
|
82
|
-
'--color-error-500': '255 0 0',
|
|
83
|
-
'--color-error-600': '230 0 0',
|
|
84
|
-
'--color-error-700': '191 0 0',
|
|
85
|
-
'--color-error-800': '153 0 0',
|
|
86
|
-
'--color-error-900': '125 0 0',
|
|
77
|
+
'--color-error-50': '255 217 217', // #ffd9d9
|
|
78
|
+
'--color-error-100': '255 204 204', // #ffcccc
|
|
79
|
+
'--color-error-200': '255 191 191', // #ffbfbf
|
|
80
|
+
'--color-error-300': '255 153 153', // #ff9999
|
|
81
|
+
'--color-error-400': '255 77 77', // #ff4d4d
|
|
82
|
+
'--color-error-500': '255 0 0', // #FF0000
|
|
83
|
+
'--color-error-600': '230 0 0', // #e60000
|
|
84
|
+
'--color-error-700': '191 0 0', // #bf0000
|
|
85
|
+
'--color-error-800': '153 0 0', // #990000
|
|
86
|
+
'--color-error-900': '125 0 0', // #7d0000
|
|
87
87
|
// surface | #c7c7c7
|
|
88
|
-
'--color-surface-50': '247 247 247',
|
|
89
|
-
'--color-surface-100': '244 244 244',
|
|
90
|
-
'--color-surface-200': '241 241 241',
|
|
91
|
-
'--color-surface-300': '233 233 233',
|
|
92
|
-
'--color-surface-400': '216 216 216',
|
|
93
|
-
'--color-surface-500': '199 199 199',
|
|
94
|
-
'--color-surface-600': '179 179 179',
|
|
95
|
-
'--color-surface-700': '149 149 149',
|
|
96
|
-
'--color-surface-800': '119 119 119',
|
|
88
|
+
'--color-surface-50': '247 247 247', // #f7f7f7
|
|
89
|
+
'--color-surface-100': '244 244 244', // #f4f4f4
|
|
90
|
+
'--color-surface-200': '241 241 241', // #f1f1f1
|
|
91
|
+
'--color-surface-300': '233 233 233', // #e9e9e9
|
|
92
|
+
'--color-surface-400': '216 216 216', // #d8d8d8
|
|
93
|
+
'--color-surface-500': '199 199 199', // #c7c7c7
|
|
94
|
+
'--color-surface-600': '179 179 179', // #b3b3b3
|
|
95
|
+
'--color-surface-700': '149 149 149', // #959595
|
|
96
|
+
'--color-surface-800': '119 119 119', // #777777
|
|
97
97
|
'--color-surface-900': '98 98 98' // #626262
|
|
98
98
|
},
|
|
99
99
|
properties_dark: {
|
|
100
100
|
// surface | #2e2e2e
|
|
101
|
-
'--color-surface-50': '224 224 224',
|
|
102
|
-
'--color-surface-100': '213 213 213',
|
|
103
|
-
'--color-surface-200': '203 203 203',
|
|
104
|
-
'--color-surface-300': '171 171 171',
|
|
105
|
-
'--color-surface-400': '109 109 109',
|
|
106
|
-
'--color-surface-500': '46 46 46',
|
|
107
|
-
'--color-surface-600': '41 41 41',
|
|
108
|
-
'--color-surface-700': '35 35 35',
|
|
109
|
-
'--color-surface-800': '28 28 28',
|
|
101
|
+
'--color-surface-50': '224 224 224', // #e0e0e0
|
|
102
|
+
'--color-surface-100': '213 213 213', // #d5d5d5
|
|
103
|
+
'--color-surface-200': '203 203 203', // #cbcbcb
|
|
104
|
+
'--color-surface-300': '171 171 171', // #ababab
|
|
105
|
+
'--color-surface-400': '109 109 109', // #6d6d6d
|
|
106
|
+
'--color-surface-500': '46 46 46', // #2e2e2e
|
|
107
|
+
'--color-surface-600': '41 41 41', // #292929
|
|
108
|
+
'--color-surface-700': '35 35 35', // #232323
|
|
109
|
+
'--color-surface-800': '28 28 28', // #1c1c1c
|
|
110
110
|
'--color-surface-900': '23 23 23' // #171717
|
|
111
111
|
}
|
|
112
112
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bexis2/bexis2-core-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "vite dev",
|
|
@@ -13,38 +13,40 @@
|
|
|
13
13
|
"test:unit": "vitest",
|
|
14
14
|
"lint": "prettier --plugin-search-dir . --check . && eslint .",
|
|
15
15
|
"format": "prettier --plugin-search-dir . --write .",
|
|
16
|
+
"check outdated": "npm outdated",
|
|
17
|
+
"upgrade all": "ncu --upgrade",
|
|
16
18
|
"1.npm - update package infos": "npm init --scope bexis2",
|
|
17
19
|
"2.npm - package": "svelte-package",
|
|
18
20
|
"3.npm - publish": "npm publish --access public"
|
|
19
21
|
},
|
|
20
22
|
"devDependencies": {
|
|
21
|
-
"@playwright/test": "^1.
|
|
22
|
-
"@skeletonlabs/skeleton": "^2.
|
|
23
|
-
"@skeletonlabs/tw-plugin": "^0.
|
|
24
|
-
"@sveltejs/adapter-auto": "^
|
|
25
|
-
"@sveltejs/adapter-static": "^
|
|
26
|
-
"@sveltejs/kit": "^
|
|
27
|
-
"@sveltejs/package": "^2.0
|
|
28
|
-
"@tailwindcss/forms": "^0.5.
|
|
29
|
-
"@tailwindcss/typography": "^0.5.
|
|
30
|
-
"@types/node": "^20.
|
|
31
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
32
|
-
"@typescript-eslint/parser": "^
|
|
33
|
-
"autoprefixer": "^10.4.
|
|
34
|
-
"eslint": "^8.
|
|
35
|
-
"eslint-config-prettier": "^
|
|
23
|
+
"@playwright/test": "^1.42.1",
|
|
24
|
+
"@skeletonlabs/skeleton": "^2.9.0",
|
|
25
|
+
"@skeletonlabs/tw-plugin": "^0.3.1",
|
|
26
|
+
"@sveltejs/adapter-auto": "^3.1.1",
|
|
27
|
+
"@sveltejs/adapter-static": "^3.0.1",
|
|
28
|
+
"@sveltejs/kit": "^2.5.3",
|
|
29
|
+
"@sveltejs/package": "^2.3.0",
|
|
30
|
+
"@tailwindcss/forms": "^0.5.7",
|
|
31
|
+
"@tailwindcss/typography": "^0.5.10",
|
|
32
|
+
"@types/node": "^20.11.26",
|
|
33
|
+
"@typescript-eslint/eslint-plugin": "^7.2.0",
|
|
34
|
+
"@typescript-eslint/parser": "^7.2.0",
|
|
35
|
+
"autoprefixer": "^10.4.18",
|
|
36
|
+
"eslint": "^8.57.0",
|
|
37
|
+
"eslint-config-prettier": "^9.1.0",
|
|
36
38
|
"eslint-plugin-svelte3": "^4.0.0",
|
|
37
|
-
"postcss": "^8.4.
|
|
38
|
-
"prettier": "^2.
|
|
39
|
-
"prettier-plugin-svelte": "^2.
|
|
39
|
+
"postcss": "^8.4.35",
|
|
40
|
+
"prettier": "^3.2.5",
|
|
41
|
+
"prettier-plugin-svelte": "^3.2.2",
|
|
40
42
|
"raw-loader": "^4.0.2",
|
|
41
|
-
"svelte": "^
|
|
42
|
-
"svelte-check": "^3.
|
|
43
|
-
"tailwindcss": "^3.
|
|
44
|
-
"tslib": "^2.
|
|
45
|
-
"typescript": "^5.
|
|
46
|
-
"vite": "^
|
|
47
|
-
"vitest": "^
|
|
43
|
+
"svelte": "^4.2.12",
|
|
44
|
+
"svelte-check": "^3.6.7",
|
|
45
|
+
"tailwindcss": "^3.4.1",
|
|
46
|
+
"tslib": "^2.6.2",
|
|
47
|
+
"typescript": "^5.4.2",
|
|
48
|
+
"vite": "^5.1.6",
|
|
49
|
+
"vitest": "^1.3.1"
|
|
48
50
|
},
|
|
49
51
|
"type": "module",
|
|
50
52
|
"module": "./src/lib/index.ts",
|
|
@@ -59,30 +61,31 @@
|
|
|
59
61
|
"src/lib"
|
|
60
62
|
],
|
|
61
63
|
"dependencies": {
|
|
62
|
-
"@codemirror/lang-html": "^6.4.
|
|
63
|
-
"@codemirror/lang-javascript": "^6.
|
|
64
|
+
"@codemirror/lang-html": "^6.4.8",
|
|
65
|
+
"@codemirror/lang-javascript": "^6.2.2",
|
|
64
66
|
"@codemirror/lang-json": "^6.0.1",
|
|
65
|
-
"@codemirror/lint": "^6.
|
|
67
|
+
"@codemirror/lint": "^6.5.0",
|
|
66
68
|
"@codemirror/theme-one-dark": "^6.1.2",
|
|
67
|
-
"@floating-ui/dom": "^1.
|
|
68
|
-
"@fortawesome/fontawesome-free": "^6.
|
|
69
|
-
"@fortawesome/fontawesome-svg-core": "^6.
|
|
70
|
-
"@fortawesome/free-regular-svg-icons": "^6.
|
|
71
|
-
"@fortawesome/free-solid-svg-icons": "^6.
|
|
72
|
-
"axios": "^1.
|
|
69
|
+
"@floating-ui/dom": "^1.6.3",
|
|
70
|
+
"@fortawesome/fontawesome-free": "^6.5.1",
|
|
71
|
+
"@fortawesome/fontawesome-svg-core": "^6.5.1",
|
|
72
|
+
"@fortawesome/free-regular-svg-icons": "^6.5.1",
|
|
73
|
+
"@fortawesome/free-solid-svg-icons": "^6.5.1",
|
|
74
|
+
"axios": "^1.6.7",
|
|
73
75
|
"codemirror": "^6.0.1",
|
|
76
|
+
"dateformat": "^5.0.3",
|
|
74
77
|
"delay": "^6.0.0",
|
|
75
|
-
"dotenv": "^16.
|
|
78
|
+
"dotenv": "^16.4.5",
|
|
76
79
|
"eslint4b-prebuilt": "^6.7.2",
|
|
77
80
|
"highlight.js": "^11.9.0",
|
|
78
81
|
"highlightjs-svelte": "^1.0.6",
|
|
79
|
-
"svelte": "^
|
|
80
|
-
"svelte-codemirror-editor": "^1.
|
|
81
|
-
"svelte-fa": "^
|
|
82
|
+
"svelte": "^4.2.12",
|
|
83
|
+
"svelte-codemirror-editor": "^1.3.0",
|
|
84
|
+
"svelte-fa": "^4.0.2",
|
|
82
85
|
"svelte-file-dropzone": "^2.0.4",
|
|
83
|
-
"svelte-headless-table": "^0.
|
|
86
|
+
"svelte-headless-table": "^0.18.2",
|
|
84
87
|
"svelte-select": "5.8.3",
|
|
85
|
-
"vest": "^
|
|
88
|
+
"vest": "^5.2.10"
|
|
86
89
|
},
|
|
87
90
|
"author": "David Schöne",
|
|
88
91
|
"license": "ISC",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { createEventDispatcher } from 'svelte';
|
|
3
3
|
|
|
4
4
|
import CodeMirror from 'svelte-codemirror-editor';
|
|
5
|
-
import Fa from 'svelte-fa
|
|
5
|
+
import Fa from 'svelte-fa';
|
|
6
6
|
import Linter from 'eslint4b-prebuilt';
|
|
7
7
|
import { html } from '@codemirror/lang-html';
|
|
8
8
|
import { javascript, esLint } from '@codemirror/lang-javascript';
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
|
|
20
20
|
storePopup.set({ computePosition, autoUpdate, offset, shift, flip, arrow });
|
|
21
21
|
|
|
22
|
+
import Spinner from '../page/Spinner.svelte';
|
|
22
23
|
import TableFilter from './TableFilter.svelte';
|
|
23
24
|
import TableFilterServer from './TableFilterServer.svelte';
|
|
24
25
|
import TablePagination from './TablePagination.svelte';
|
|
@@ -61,6 +62,7 @@
|
|
|
61
62
|
} = config;
|
|
62
63
|
|
|
63
64
|
let searchValue = '';
|
|
65
|
+
let isFetching = false;
|
|
64
66
|
|
|
65
67
|
const filters = writable<{
|
|
66
68
|
[key: string]: { [key in FilterOptionsEnum]?: number | string | Date };
|
|
@@ -194,7 +196,9 @@
|
|
|
194
196
|
tableId,
|
|
195
197
|
values,
|
|
196
198
|
toFilterableValueFn,
|
|
197
|
-
filters
|
|
199
|
+
filters,
|
|
200
|
+
toStringFn,
|
|
201
|
+
pageIndex
|
|
198
202
|
});
|
|
199
203
|
}
|
|
200
204
|
}
|
|
@@ -237,7 +241,8 @@
|
|
|
237
241
|
id,
|
|
238
242
|
tableId,
|
|
239
243
|
values,
|
|
240
|
-
filters
|
|
244
|
+
filters,
|
|
245
|
+
pageIndex
|
|
241
246
|
});
|
|
242
247
|
}
|
|
243
248
|
}
|
|
@@ -280,7 +285,6 @@
|
|
|
280
285
|
// Page configuration
|
|
281
286
|
const { pageIndex, pageSize } = pluginStates.page;
|
|
282
287
|
|
|
283
|
-
// TODO: Add loading animation for server-side fetch requests
|
|
284
288
|
const updateTable = async () => {
|
|
285
289
|
sendModel.limit = $pageSize;
|
|
286
290
|
sendModel.offset = $pageSize * $pageIndex;
|
|
@@ -288,14 +292,27 @@
|
|
|
288
292
|
sendModel.id = entityId;
|
|
289
293
|
sendModel.filter = normalizeFilters($filters);
|
|
290
294
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
295
|
+
let fetchData;
|
|
296
|
+
|
|
297
|
+
try {
|
|
298
|
+
isFetching = true;
|
|
299
|
+
fetchData = await fetch(URL, {
|
|
300
|
+
headers: {
|
|
301
|
+
'Content-Type': 'application/json',
|
|
302
|
+
Authorization: `Bearer ${token}`
|
|
303
|
+
},
|
|
304
|
+
method: 'POST',
|
|
305
|
+
body: JSON.stringify(sendModel)
|
|
306
|
+
});
|
|
307
|
+
} catch (error) {
|
|
308
|
+
throw new Error(`Network error: ${(error as Error).message}`);
|
|
309
|
+
} finally {
|
|
310
|
+
isFetching = false;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
if (!fetchData.ok) {
|
|
314
|
+
throw new Error('Failed to fetch data');
|
|
315
|
+
}
|
|
299
316
|
|
|
300
317
|
const response: Receive = await fetchData.json();
|
|
301
318
|
|
|
@@ -335,7 +352,13 @@
|
|
|
335
352
|
<!-- Enable the search filter if table is not empty -->
|
|
336
353
|
{#if $data.length > 0}
|
|
337
354
|
{#if !serverSide}
|
|
338
|
-
<
|
|
355
|
+
<form
|
|
356
|
+
class="flex gap-2"
|
|
357
|
+
on:submit|preventDefault={() => {
|
|
358
|
+
sendModel.q = searchValue;
|
|
359
|
+
$filterValue = searchValue;
|
|
360
|
+
}}
|
|
361
|
+
>
|
|
339
362
|
<div class="relative w-full flex items-center">
|
|
340
363
|
<input
|
|
341
364
|
class="input p-2 border border-primary-500"
|
|
@@ -348,18 +371,20 @@
|
|
|
348
371
|
class="absolute right-3 items-center"
|
|
349
372
|
on:click|preventDefault={() => {
|
|
350
373
|
searchValue = '';
|
|
374
|
+
sendModel.q = '';
|
|
351
375
|
$filterValue = '';
|
|
352
376
|
}}><Fa icon={faXmark} /></button
|
|
353
377
|
>
|
|
354
378
|
</div>
|
|
355
379
|
<button
|
|
356
|
-
type="
|
|
380
|
+
type="submit"
|
|
357
381
|
class="btn variant-filled-primary"
|
|
358
382
|
on:click|preventDefault={() => {
|
|
359
383
|
$filterValue = searchValue;
|
|
384
|
+
sendModel.q = searchValue;
|
|
360
385
|
}}>Search</button
|
|
361
386
|
>
|
|
362
|
-
</
|
|
387
|
+
</form>
|
|
363
388
|
{/if}
|
|
364
389
|
<div class="flex justify-between items-center py-2 w-full">
|
|
365
390
|
<div>
|
|
@@ -460,6 +485,8 @@
|
|
|
460
485
|
</tr>
|
|
461
486
|
</Subscribe>
|
|
462
487
|
{/each}
|
|
488
|
+
{:else if isFetching}
|
|
489
|
+
<div class="p-10"><Spinner /></div>
|
|
463
490
|
{:else}
|
|
464
491
|
<!-- Table is empty -->
|
|
465
492
|
<p class="items-center justify-center flex w-full p-10 italic">Nothing to show here.</p>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import Fa from 'svelte-fa
|
|
2
|
+
import Fa from 'svelte-fa';
|
|
3
3
|
import { faFilter, faPlus, faXmark } from '@fortawesome/free-solid-svg-icons';
|
|
4
4
|
import { popup } from '@skeletonlabs/skeleton';
|
|
5
5
|
import type { PopupSettings } from '@skeletonlabs/skeleton';
|
|
@@ -10,13 +10,33 @@
|
|
|
10
10
|
export let id;
|
|
11
11
|
export let tableId;
|
|
12
12
|
export let toFilterableValueFn: undefined | ((value: any) => any) = undefined;
|
|
13
|
+
export let toStringFn: undefined | ((value: any) => string) = undefined;
|
|
13
14
|
export let filterValue;
|
|
14
15
|
export let filters;
|
|
16
|
+
export let pageIndex;
|
|
15
17
|
|
|
16
18
|
// If the filter is applied and the displayed values are filtered
|
|
17
19
|
let active = false;
|
|
20
|
+
let type: string = 'string';
|
|
21
|
+
let isDate = false; // Options for different types of values
|
|
22
|
+
let dropdowns: {
|
|
23
|
+
option: FilterOptionsEnum;
|
|
24
|
+
value: string | number | Date | undefined;
|
|
25
|
+
}[] = [];
|
|
26
|
+
|
|
27
|
+
// Check the type of the column
|
|
28
|
+
$values.forEach((item) => {
|
|
29
|
+
if (item) {
|
|
30
|
+
type = typeof (toFilterableValueFn ? toFilterableValueFn(item) : item);
|
|
31
|
+
|
|
32
|
+
if (type === 'object') {
|
|
33
|
+
if (item instanceof Date) {
|
|
34
|
+
isDate = true;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
});
|
|
18
39
|
|
|
19
|
-
// Options for different types of values
|
|
20
40
|
const options = {
|
|
21
41
|
number: [
|
|
22
42
|
{
|
|
@@ -98,11 +118,6 @@
|
|
|
98
118
|
]
|
|
99
119
|
};
|
|
100
120
|
|
|
101
|
-
let dropdowns: {
|
|
102
|
-
option: FilterOptionsEnum;
|
|
103
|
-
value: string | number | Date | undefined;
|
|
104
|
-
}[] = [];
|
|
105
|
-
|
|
106
121
|
// Unique ID for the column filter popup
|
|
107
122
|
const popupId = `${tableId}-${id}`;
|
|
108
123
|
// Popup config
|
|
@@ -112,24 +127,39 @@
|
|
|
112
127
|
placement: 'bottom-start'
|
|
113
128
|
};
|
|
114
129
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
type = typeof (toFilterableValueFn ? toFilterableValueFn(item) : item);
|
|
130
|
+
// Converted string values and missingValues mapping
|
|
131
|
+
const stringValues =
|
|
132
|
+
// type === 'number' ?
|
|
133
|
+
$values.map((item) => (toStringFn ? toStringFn(item) : item));
|
|
134
|
+
// : [];
|
|
121
135
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}
|
|
128
|
-
}
|
|
136
|
+
const missingValues =
|
|
137
|
+
// type === 'number' ?
|
|
138
|
+
stringValues.reduce((acc, item, index) => {
|
|
139
|
+
acc[typeof item === 'string' ? item.toLowerCase() : item] = $values[index];
|
|
140
|
+
return acc;
|
|
141
|
+
}, {});
|
|
142
|
+
// : {};
|
|
143
|
+
|
|
144
|
+
const getMissingValue = (value: string) => {
|
|
145
|
+
// if (type === 'number' ||) {
|
|
146
|
+
return Object.keys(missingValues).includes(value.toLowerCase())
|
|
147
|
+
? missingValues[value.toLowerCase()]
|
|
148
|
+
: value;
|
|
149
|
+
// }
|
|
150
|
+
// return value;
|
|
151
|
+
};
|
|
129
152
|
|
|
130
153
|
const optionChangeHandler = (e, index) => {
|
|
131
154
|
delete $filters[id][dropdowns[index].option];
|
|
132
|
-
$filters[id] = {
|
|
155
|
+
$filters[id] = {
|
|
156
|
+
...$filters[id],
|
|
157
|
+
[e.target.value]:
|
|
158
|
+
// type === 'number'
|
|
159
|
+
// ?
|
|
160
|
+
getMissingValue(dropdowns[index].value as string)
|
|
161
|
+
// : dropdowns[index].value
|
|
162
|
+
};
|
|
133
163
|
$filters = $filters;
|
|
134
164
|
|
|
135
165
|
dropdowns[index] = {
|
|
@@ -141,17 +171,18 @@
|
|
|
141
171
|
const valueChangeHandler = (e, index) => {
|
|
142
172
|
dropdowns[index] = {
|
|
143
173
|
...dropdowns[index],
|
|
144
|
-
value:
|
|
145
|
-
type === 'number'
|
|
146
|
-
? +e.target.value
|
|
147
|
-
: type === 'date'
|
|
148
|
-
? new Date(e.target.value)
|
|
149
|
-
: e.target.value
|
|
174
|
+
value: type === 'date' ? new Date(e.target.value) : e.target.value
|
|
150
175
|
};
|
|
151
176
|
|
|
152
177
|
$filters = {
|
|
153
178
|
...$filters,
|
|
154
|
-
[id]: {
|
|
179
|
+
[id]: {
|
|
180
|
+
...$filters[id],
|
|
181
|
+
[dropdowns[index].option]:
|
|
182
|
+
// type === 'number' ?
|
|
183
|
+
getMissingValue(e.target.value)
|
|
184
|
+
// : dropdowns[index].value
|
|
185
|
+
}
|
|
155
186
|
};
|
|
156
187
|
};
|
|
157
188
|
|
|
@@ -212,6 +243,7 @@
|
|
|
212
243
|
addFilter(options[type][0].value, undefined);
|
|
213
244
|
$filterValue = $filters[id];
|
|
214
245
|
active = false;
|
|
246
|
+
$pageIndex = 0;
|
|
215
247
|
}}>Clear Filters</button
|
|
216
248
|
>
|
|
217
249
|
|
|
@@ -246,14 +278,7 @@
|
|
|
246
278
|
{/if}
|
|
247
279
|
</div>
|
|
248
280
|
|
|
249
|
-
{#if type === 'number'}
|
|
250
|
-
<input
|
|
251
|
-
type="number"
|
|
252
|
-
class="input p-1 border border-primary-500"
|
|
253
|
-
on:input={(e) => valueChangeHandler(e, index)}
|
|
254
|
-
bind:value={dropdown.value}
|
|
255
|
-
/>
|
|
256
|
-
{:else if type === 'string'}
|
|
281
|
+
{#if type === 'number' || type === 'string'}
|
|
257
282
|
<input
|
|
258
283
|
type="text"
|
|
259
284
|
class="input p-1 border border-primary-500"
|
|
@@ -292,6 +317,7 @@
|
|
|
292
317
|
class="btn variant-filled-primary btn-sm"
|
|
293
318
|
type="button"
|
|
294
319
|
on:click|preventDefault={() => {
|
|
320
|
+
$pageIndex = 0;
|
|
295
321
|
$filterValue = $filters[id];
|
|
296
322
|
active = true;
|
|
297
323
|
}}>Apply</button
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import Fa from 'svelte-fa
|
|
2
|
+
import Fa from 'svelte-fa';
|
|
3
3
|
import { faFilter, faPlus, faXmark } from '@fortawesome/free-solid-svg-icons';
|
|
4
4
|
import { popup } from '@skeletonlabs/skeleton';
|
|
5
5
|
import type { PopupSettings } from '@skeletonlabs/skeleton';
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import dateFormat from 'dateformat';
|
|
2
|
+
|
|
1
3
|
import type { FilterOptionsEnum } from '$models/Enums';
|
|
2
4
|
import type { Columns, Filter, ServerColumn } from '$models/Models';
|
|
3
5
|
|
|
@@ -115,14 +117,13 @@ export const convertServerColumns = (columns: ServerColumn[]) => {
|
|
|
115
117
|
columns.forEach((col) => {
|
|
116
118
|
let instructions = {};
|
|
117
119
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
// }
|
|
120
|
+
if (col.instructions?.displayPattern) {
|
|
121
|
+
instructions = {
|
|
122
|
+
toStringFn: (date: Date) => dateFormat(date, col.instructions?.displayPattern || ''),
|
|
123
|
+
toSortableValueFn: (date: Date) => date.getTime(),
|
|
124
|
+
toFilterableValueFn: (date: Date) => date
|
|
125
|
+
};
|
|
126
|
+
}
|
|
126
127
|
|
|
127
128
|
if (col.instructions?.missingValues) {
|
|
128
129
|
instructions = {
|