@bexis2/bexis2-core-ui 0.4.19 → 0.4.20
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 +15 -8
- package/dist/components/CodeEditor/CodeEditor.svelte +4 -0
- package/dist/components/Facets/Facets.svelte +23 -10
- package/dist/components/Facets/ShowMore.svelte +30 -17
- package/dist/components/Facets/ShowMore.svelte.d.ts +1 -1
- package/dist/components/File/FileUploader.svelte +1 -1
- package/dist/components/Table/ColumnsMenu.svelte +5 -0
- package/dist/components/Table/TableContent.svelte +13 -3
- package/dist/components/Table/TableFilter.svelte +12 -0
- package/dist/components/Table/TableFilterServer.svelte +13 -1
- package/dist/components/Table/TablePagination.svelte +10 -1
- package/dist/components/Table/TablePaginationServer.svelte +8 -0
- package/dist/components/form/Checkbox.svelte +1 -1
- package/dist/components/form/CheckboxKvPList.svelte +2 -1
- package/dist/components/form/CheckboxList.svelte +2 -2
- package/dist/components/form/DateInput.svelte +1 -1
- package/dist/components/form/DropdownKvP.svelte +1 -1
- package/dist/components/form/InputContainer.svelte +7 -1
- package/dist/components/form/MultiSelect.svelte +100 -106
- package/dist/components/form/NumberInput.svelte +1 -1
- package/dist/components/form/TextArea.svelte +1 -1
- package/dist/components/form/TextInput.svelte +1 -1
- package/dist/components/page/Alert.svelte +1 -1
- package/dist/components/page/BackToTop.svelte +1 -1
- package/dist/components/page/Docs.svelte +1 -1
- package/dist/components/page/GoToTop.svelte +1 -0
- package/dist/components/page/HelpPopUp.svelte +1 -0
- package/dist/components/page/Page.svelte +14 -19
- package/dist/components/page/menu/MenuSublist.svelte +7 -5
- package/package.json +114 -114
- package/src/lib/components/CodeEditor/CodeEditor.svelte +4 -0
- package/src/lib/components/Facets/Facets.svelte +28 -12
- package/src/lib/components/Facets/ShowMore.svelte +31 -17
- package/src/lib/components/File/FileUploader.svelte +1 -1
- package/src/lib/components/Table/ColumnsMenu.svelte +5 -0
- package/src/lib/components/Table/TableContent.svelte +13 -3
- package/src/lib/components/Table/TableFilter.svelte +12 -0
- package/src/lib/components/Table/TableFilterServer.svelte +13 -1
- package/src/lib/components/Table/TablePagination.svelte +10 -1
- package/src/lib/components/Table/TablePaginationServer.svelte +8 -0
- package/src/lib/components/form/Checkbox.svelte +1 -1
- package/src/lib/components/form/CheckboxKvPList.svelte +2 -1
- package/src/lib/components/form/CheckboxList.svelte +2 -2
- package/src/lib/components/form/DateInput.svelte +1 -1
- package/src/lib/components/form/DropdownKvP.svelte +1 -1
- package/src/lib/components/form/InputContainer.svelte +7 -1
- package/src/lib/components/form/MultiSelect.svelte +100 -106
- package/src/lib/components/form/NumberInput.svelte +1 -1
- package/src/lib/components/form/TextArea.svelte +1 -1
- package/src/lib/components/form/TextInput.svelte +1 -1
- package/src/lib/components/page/Alert.svelte +1 -1
- package/src/lib/components/page/BackToTop.svelte +1 -1
- package/src/lib/components/page/Docs.svelte +1 -1
- package/src/lib/components/page/GoToTop.svelte +1 -0
- package/src/lib/components/page/HelpPopUp.svelte +1 -0
- package/src/lib/components/page/Page.svelte +15 -20
- package/src/lib/components/page/menu/MenuSublist.svelte +11 -8
package/package.json
CHANGED
|
@@ -1,114 +1,114 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@bexis2/bexis2-core-ui",
|
|
3
|
-
"version": "0.4.
|
|
4
|
-
"private": false,
|
|
5
|
-
"scripts": {
|
|
6
|
-
"dev": "vite dev",
|
|
7
|
-
"build": "vite build",
|
|
8
|
-
"build package": "svelte-kit sync && svelte-package --watch",
|
|
9
|
-
"preview": "vite preview",
|
|
10
|
-
"test": "playwright test",
|
|
11
|
-
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
12
|
-
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
|
13
|
-
"test:unit": "vitest",
|
|
14
|
-
"lint": "prettier --plugin-search-dir . --check . && eslint .",
|
|
15
|
-
"format": "prettier --plugin-search-dir . --write .",
|
|
16
|
-
"check outdated": "npm outdated",
|
|
17
|
-
"upgrade all": "ncu --upgrade",
|
|
18
|
-
"1.npm - update package infos": "npm init --scope bexis2",
|
|
19
|
-
"2.npm - package": "svelte-package",
|
|
20
|
-
"3.npm - publish": "npm publish --access public"
|
|
21
|
-
},
|
|
22
|
-
"devDependencies": {
|
|
23
|
-
"@playwright/test": "^1.45.3",
|
|
24
|
-
"@skeletonlabs/skeleton": "^2.10.2",
|
|
25
|
-
"@skeletonlabs/tw-plugin": "^0.4.0",
|
|
26
|
-
"@sveltejs/adapter-auto": "^3.2.2",
|
|
27
|
-
"@sveltejs/adapter-static": "^3.0.2",
|
|
28
|
-
"@sveltejs/package": "^2.3.2",
|
|
29
|
-
"@tailwindcss/forms": "^0.5.7",
|
|
30
|
-
"@tailwindcss/typography": "^0.5.13",
|
|
31
|
-
"@types/node": "^22.0.2",
|
|
32
|
-
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
33
|
-
"@typescript-eslint/parser": "^8.0.0",
|
|
34
|
-
"autoprefixer": "^10.4.19",
|
|
35
|
-
"eslint": "^9.8.0",
|
|
36
|
-
"eslint-config-prettier": "^9.1.0",
|
|
37
|
-
"postcss": "^8.4.40",
|
|
38
|
-
"prettier": "^3.3.3",
|
|
39
|
-
"prettier-plugin-svelte": "^3.2.6",
|
|
40
|
-
"raw-loader": "^4.0.2",
|
|
41
|
-
"svelte": "^4.2.18",
|
|
42
|
-
"svelte-check": "^3.8.5",
|
|
43
|
-
"tailwindcss": "^3.4.7",
|
|
44
|
-
"tslib": "^2.6.3",
|
|
45
|
-
"typescript": "^5.5.4",
|
|
46
|
-
"vite": "^5.3.5",
|
|
47
|
-
"vitest": "^2.0.5"
|
|
48
|
-
},
|
|
49
|
-
"type": "module",
|
|
50
|
-
"module": "./src/lib/index.ts",
|
|
51
|
-
"types": "./src/lib/index.d.ts",
|
|
52
|
-
"description": "Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte).",
|
|
53
|
-
"main": "./src/lib/index.d.ts",
|
|
54
|
-
"directories": {
|
|
55
|
-
"test": "tests"
|
|
56
|
-
},
|
|
57
|
-
"files": [
|
|
58
|
-
"dist",
|
|
59
|
-
"src/lib"
|
|
60
|
-
],
|
|
61
|
-
"dependencies": {
|
|
62
|
-
"@codemirror/lang-html": "^6.4.9",
|
|
63
|
-
"@codemirror/lang-javascript": "^6.2.2",
|
|
64
|
-
"@codemirror/lang-json": "^6.0.1",
|
|
65
|
-
"@codemirror/lint": "^6.8.1",
|
|
66
|
-
"@codemirror/theme-one-dark": "^6.1.2",
|
|
67
|
-
"@floating-ui/dom": "^1.6.8",
|
|
68
|
-
"@fortawesome/fontawesome-free": "^6.6.0",
|
|
69
|
-
"@fortawesome/fontawesome-svg-core": "^6.6.0",
|
|
70
|
-
"@fortawesome/free-regular-svg-icons": "^6.6.0",
|
|
71
|
-
"@fortawesome/free-solid-svg-icons": "^6.6.0",
|
|
72
|
-
"@sveltejs/kit": "^2.5.19",
|
|
73
|
-
"@sveltejs/vite-plugin-svelte": "^3.1.1",
|
|
74
|
-
"axios": "^1.7.3",
|
|
75
|
-
"codemirror": "^6.0.1",
|
|
76
|
-
"dateformat": "^5.0.3",
|
|
77
|
-
"delay": "^6.0.0",
|
|
78
|
-
"dotenv": "^16.4.5",
|
|
79
|
-
"eslint4b-prebuilt": "^6.7.2",
|
|
80
|
-
"highlight.js": "^11.10.0",
|
|
81
|
-
"highlightjs-svelte": "^1.0.6",
|
|
82
|
-
"svelte": "^4.2.18",
|
|
83
|
-
"svelte-codemirror-editor": "^1.4.0",
|
|
84
|
-
"svelte-fa": "^4.0.2",
|
|
85
|
-
"svelte-file-dropzone": "^2.0.7",
|
|
86
|
-
"svelte-headless-table": "^0.18.2",
|
|
87
|
-
"svelte-select": "5.8.3",
|
|
88
|
-
"vest": "^5.4.0"
|
|
89
|
-
},
|
|
90
|
-
"author": "David Schöne",
|
|
91
|
-
"license": "ISC",
|
|
92
|
-
"repository": {
|
|
93
|
-
"type": "git",
|
|
94
|
-
"url": "git+https://github.com/BEXIS2/bexis2-core-ui.git"
|
|
95
|
-
},
|
|
96
|
-
"bugs": {
|
|
97
|
-
"url": "https://github.com/BEXIS2/bexis2-core-ui/issues"
|
|
98
|
-
},
|
|
99
|
-
"homepage": "https://github.com/BEXIS2/bexis2-core-ui#readme",
|
|
100
|
-
"keywords": [
|
|
101
|
-
"bexis2",
|
|
102
|
-
"libary"
|
|
103
|
-
],
|
|
104
|
-
"exports": {
|
|
105
|
-
".": {
|
|
106
|
-
"types": "./dist/index.d.ts",
|
|
107
|
-
"svelte": "./dist/index.js"
|
|
108
|
-
},
|
|
109
|
-
"./dist/index.css": {
|
|
110
|
-
"import": "./dist/index.css",
|
|
111
|
-
"require": "./dist/index.css"
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@bexis2/bexis2-core-ui",
|
|
3
|
+
"version": "0.4.20",
|
|
4
|
+
"private": false,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "vite dev",
|
|
7
|
+
"build": "vite build",
|
|
8
|
+
"build package": "svelte-kit sync && svelte-package --watch",
|
|
9
|
+
"preview": "vite preview",
|
|
10
|
+
"test": "playwright test",
|
|
11
|
+
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
12
|
+
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
|
13
|
+
"test:unit": "vitest",
|
|
14
|
+
"lint": "prettier --plugin-search-dir . --check . && eslint .",
|
|
15
|
+
"format": "prettier --plugin-search-dir . --write .",
|
|
16
|
+
"check outdated": "npm outdated",
|
|
17
|
+
"upgrade all": "ncu --upgrade",
|
|
18
|
+
"1.npm - update package infos": "npm init --scope bexis2",
|
|
19
|
+
"2.npm - package": "svelte-package",
|
|
20
|
+
"3.npm - publish": "npm publish --access public"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@playwright/test": "^1.45.3",
|
|
24
|
+
"@skeletonlabs/skeleton": "^2.10.2",
|
|
25
|
+
"@skeletonlabs/tw-plugin": "^0.4.0",
|
|
26
|
+
"@sveltejs/adapter-auto": "^3.2.2",
|
|
27
|
+
"@sveltejs/adapter-static": "^3.0.2",
|
|
28
|
+
"@sveltejs/package": "^2.3.2",
|
|
29
|
+
"@tailwindcss/forms": "^0.5.7",
|
|
30
|
+
"@tailwindcss/typography": "^0.5.13",
|
|
31
|
+
"@types/node": "^22.0.2",
|
|
32
|
+
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
33
|
+
"@typescript-eslint/parser": "^8.0.0",
|
|
34
|
+
"autoprefixer": "^10.4.19",
|
|
35
|
+
"eslint": "^9.8.0",
|
|
36
|
+
"eslint-config-prettier": "^9.1.0",
|
|
37
|
+
"postcss": "^8.4.40",
|
|
38
|
+
"prettier": "^3.3.3",
|
|
39
|
+
"prettier-plugin-svelte": "^3.2.6",
|
|
40
|
+
"raw-loader": "^4.0.2",
|
|
41
|
+
"svelte": "^4.2.18",
|
|
42
|
+
"svelte-check": "^3.8.5",
|
|
43
|
+
"tailwindcss": "^3.4.7",
|
|
44
|
+
"tslib": "^2.6.3",
|
|
45
|
+
"typescript": "^5.5.4",
|
|
46
|
+
"vite": "^5.3.5",
|
|
47
|
+
"vitest": "^2.0.5"
|
|
48
|
+
},
|
|
49
|
+
"type": "module",
|
|
50
|
+
"module": "./src/lib/index.ts",
|
|
51
|
+
"types": "./src/lib/index.d.ts",
|
|
52
|
+
"description": "Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte).",
|
|
53
|
+
"main": "./src/lib/index.d.ts",
|
|
54
|
+
"directories": {
|
|
55
|
+
"test": "tests"
|
|
56
|
+
},
|
|
57
|
+
"files": [
|
|
58
|
+
"dist",
|
|
59
|
+
"src/lib"
|
|
60
|
+
],
|
|
61
|
+
"dependencies": {
|
|
62
|
+
"@codemirror/lang-html": "^6.4.9",
|
|
63
|
+
"@codemirror/lang-javascript": "^6.2.2",
|
|
64
|
+
"@codemirror/lang-json": "^6.0.1",
|
|
65
|
+
"@codemirror/lint": "^6.8.1",
|
|
66
|
+
"@codemirror/theme-one-dark": "^6.1.2",
|
|
67
|
+
"@floating-ui/dom": "^1.6.8",
|
|
68
|
+
"@fortawesome/fontawesome-free": "^6.6.0",
|
|
69
|
+
"@fortawesome/fontawesome-svg-core": "^6.6.0",
|
|
70
|
+
"@fortawesome/free-regular-svg-icons": "^6.6.0",
|
|
71
|
+
"@fortawesome/free-solid-svg-icons": "^6.6.0",
|
|
72
|
+
"@sveltejs/kit": "^2.5.19",
|
|
73
|
+
"@sveltejs/vite-plugin-svelte": "^3.1.1",
|
|
74
|
+
"axios": "^1.7.3",
|
|
75
|
+
"codemirror": "^6.0.1",
|
|
76
|
+
"dateformat": "^5.0.3",
|
|
77
|
+
"delay": "^6.0.0",
|
|
78
|
+
"dotenv": "^16.4.5",
|
|
79
|
+
"eslint4b-prebuilt": "^6.7.2",
|
|
80
|
+
"highlight.js": "^11.10.0",
|
|
81
|
+
"highlightjs-svelte": "^1.0.6",
|
|
82
|
+
"svelte": "^4.2.18",
|
|
83
|
+
"svelte-codemirror-editor": "^1.4.0",
|
|
84
|
+
"svelte-fa": "^4.0.2",
|
|
85
|
+
"svelte-file-dropzone": "^2.0.7",
|
|
86
|
+
"svelte-headless-table": "^0.18.2",
|
|
87
|
+
"svelte-select": "5.8.3",
|
|
88
|
+
"vest": "^5.4.0"
|
|
89
|
+
},
|
|
90
|
+
"author": "David Schöne",
|
|
91
|
+
"license": "ISC",
|
|
92
|
+
"repository": {
|
|
93
|
+
"type": "git",
|
|
94
|
+
"url": "git+https://github.com/BEXIS2/bexis2-core-ui.git"
|
|
95
|
+
},
|
|
96
|
+
"bugs": {
|
|
97
|
+
"url": "https://github.com/BEXIS2/bexis2-core-ui/issues"
|
|
98
|
+
},
|
|
99
|
+
"homepage": "https://github.com/BEXIS2/bexis2-core-ui#readme",
|
|
100
|
+
"keywords": [
|
|
101
|
+
"bexis2",
|
|
102
|
+
"libary"
|
|
103
|
+
],
|
|
104
|
+
"exports": {
|
|
105
|
+
".": {
|
|
106
|
+
"types": "./dist/index.d.ts",
|
|
107
|
+
"svelte": "./dist/index.js"
|
|
108
|
+
},
|
|
109
|
+
"./dist/index.css": {
|
|
110
|
+
"import": "./dist/index.css",
|
|
111
|
+
"require": "./dist/index.css"
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
@@ -100,6 +100,7 @@
|
|
|
100
100
|
<div class="flex gap-2">
|
|
101
101
|
<button
|
|
102
102
|
class="btn variant-filled-warning"
|
|
103
|
+
title="Reset"
|
|
103
104
|
id="{id}-reset"
|
|
104
105
|
on:click|preventDefault={() => modalStore.trigger(modal)}
|
|
105
106
|
><Fa icon={faArrowRotateLeft} /></button
|
|
@@ -108,6 +109,7 @@
|
|
|
108
109
|
class="btn border"
|
|
109
110
|
class:bg-slate-700={dark}
|
|
110
111
|
class:bg-white={!dark}
|
|
112
|
+
title="Toggle dark mode"
|
|
111
113
|
id="{id}-toggle"
|
|
112
114
|
on:click|preventDefault={() => (dark = !dark)}
|
|
113
115
|
>
|
|
@@ -124,11 +126,13 @@
|
|
|
124
126
|
<div class="flex gap-2">
|
|
125
127
|
<button
|
|
126
128
|
class="btn variant-filled-warning"
|
|
129
|
+
title="Cancel"
|
|
127
130
|
id="{id}-cancel"
|
|
128
131
|
on:click|preventDefault={() => dispatch('cancel')}><Fa icon={faXmark} /></button
|
|
129
132
|
>
|
|
130
133
|
<button
|
|
131
134
|
class="btn variant-filled-primary"
|
|
135
|
+
title="Save"
|
|
132
136
|
id="{id}-save"
|
|
133
137
|
disabled={!isValid}
|
|
134
138
|
on:click|preventDefault={() => dispatch('save')}><Fa icon={faSave} /></button
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
ref: ShowMore,
|
|
27
27
|
props: {
|
|
28
28
|
group,
|
|
29
|
-
|
|
29
|
+
handleApply,
|
|
30
30
|
handleCancel
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
|
|
46
46
|
const modalStore = getModalStore();
|
|
47
47
|
|
|
48
|
-
const
|
|
48
|
+
const handleApply = (group: SelectedFacetGroup) => {
|
|
49
49
|
const { name: groupName, children } = group;
|
|
50
50
|
|
|
51
51
|
dispatch('showMoreOpenChange', {
|
|
@@ -110,9 +110,8 @@
|
|
|
110
110
|
changed.length && dispatch('facetSelect', changed);
|
|
111
111
|
};
|
|
112
112
|
|
|
113
|
-
// Keeping the sorting function, but stays unused for now
|
|
114
113
|
const sortOptions = () => {
|
|
115
|
-
// Sort facets in a descending order if count exits
|
|
114
|
+
// Sort facets in a descending order if count exits
|
|
116
115
|
Object.keys(selected).forEach((group) => {
|
|
117
116
|
const checked = Object.keys(selected[group].children)
|
|
118
117
|
.filter((item) => selected[group].children[item].selected)
|
|
@@ -121,13 +120,20 @@
|
|
|
121
120
|
if (a.count != undefined && b.count != undefined) {
|
|
122
121
|
return b.count - a.count;
|
|
123
122
|
}
|
|
124
|
-
return
|
|
123
|
+
return 0;
|
|
125
124
|
})
|
|
126
125
|
.map((item) => item.name);
|
|
127
126
|
|
|
128
|
-
const unchecked = Object.keys(selected[group].children)
|
|
129
|
-
(item) => !checked.includes(item)
|
|
130
|
-
|
|
127
|
+
const unchecked = Object.keys(selected[group].children)
|
|
128
|
+
.filter((item) => !checked.includes(item))
|
|
129
|
+
.map((item) => selected[group].children[item])
|
|
130
|
+
.sort((a, b) => {
|
|
131
|
+
if (a.count != undefined && b.count != undefined) {
|
|
132
|
+
return b.count - a.count;
|
|
133
|
+
}
|
|
134
|
+
return 0;
|
|
135
|
+
})
|
|
136
|
+
.map((item) => item.name);
|
|
131
137
|
|
|
132
138
|
const groupIndex = displayedGroups.findIndex((g) => g.name === group);
|
|
133
139
|
|
|
@@ -172,7 +178,7 @@
|
|
|
172
178
|
});
|
|
173
179
|
|
|
174
180
|
$: displayedGroups = structuredClone($groups);
|
|
175
|
-
$: selectedItems, mapSelected('items')
|
|
181
|
+
$: selectedItems, mapSelected('items'), sortOptions();
|
|
176
182
|
$: selectedGroups, mapSelected('groups');
|
|
177
183
|
</script>
|
|
178
184
|
|
|
@@ -186,7 +192,7 @@
|
|
|
186
192
|
bind:checked={selectedGroups[group.name]}
|
|
187
193
|
bind:group={selectedGroups}
|
|
188
194
|
>
|
|
189
|
-
<p class="font-semibold">
|
|
195
|
+
<p class="font-semibold whitespace-nowrap">
|
|
190
196
|
{group.displayName}{group.count !== undefined ? ` (${group.count})` : ''}
|
|
191
197
|
</p>
|
|
192
198
|
|
|
@@ -204,7 +210,12 @@
|
|
|
204
210
|
selection
|
|
205
211
|
multiple
|
|
206
212
|
>
|
|
207
|
-
<
|
|
213
|
+
<div class="flex gap-2">
|
|
214
|
+
<p class="w-max grow truncate">
|
|
215
|
+
<span title={item.displayName}>{item.displayName}</span>
|
|
216
|
+
</p>
|
|
217
|
+
<span>({item.count})</span>
|
|
218
|
+
</div>
|
|
208
219
|
</TreeViewItem>
|
|
209
220
|
{/each}
|
|
210
221
|
<!-- Trigger for the Modal to view all options -->
|
|
@@ -226,7 +237,12 @@
|
|
|
226
237
|
selection
|
|
227
238
|
multiple
|
|
228
239
|
>
|
|
229
|
-
<
|
|
240
|
+
<div class="flex gap-2">
|
|
241
|
+
<p class="w-max grow truncate">
|
|
242
|
+
<span title={item.displayName}>{item.displayName}</span>
|
|
243
|
+
</p>
|
|
244
|
+
<span>({item.count})</span>
|
|
245
|
+
</div>
|
|
230
246
|
</TreeViewItem>
|
|
231
247
|
{/each}
|
|
232
248
|
{/if}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type { SelectedFacetGroup } from '$models/Models';
|
|
3
3
|
|
|
4
4
|
export let group: SelectedFacetGroup;
|
|
5
|
-
export let
|
|
5
|
+
export let handleApply: (group: SelectedFacetGroup) => {};
|
|
6
6
|
export let handleCancel: (groupName: string) => {};
|
|
7
7
|
|
|
8
8
|
let selected = structuredClone(group.children);
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
Object.keys(selected).forEach((key) => (selected[key].selected = false));
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
-
const
|
|
19
|
-
|
|
18
|
+
const onApply = () => {
|
|
19
|
+
handleApply({
|
|
20
20
|
...group,
|
|
21
21
|
children: selected
|
|
22
22
|
});
|
|
@@ -29,32 +29,46 @@
|
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
const gridClass = (items: any[]) => {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
} else if (items.length >= 30) {
|
|
35
|
-
return 'grid-cols-4';
|
|
36
|
-
} else if (items.length >= 20) {
|
|
37
|
-
return 'grid-cols-3';
|
|
38
|
-
}
|
|
32
|
+
const ceil = Math.ceil(Math.sqrt(items.length));
|
|
33
|
+
const max = Math.max(ceil, Math.floor(items.length / 3));
|
|
39
34
|
|
|
40
|
-
|
|
35
|
+
const classes = [
|
|
36
|
+
'grid-rows-1',
|
|
37
|
+
'grid-rows-2',
|
|
38
|
+
'grid-rows-3',
|
|
39
|
+
'grid-rows-4',
|
|
40
|
+
'grid-rows-5',
|
|
41
|
+
'grid-rows-6',
|
|
42
|
+
'grid-rows-7',
|
|
43
|
+
'grid-rows-8',
|
|
44
|
+
'grid-rows-9',
|
|
45
|
+
'grid-rows-10',
|
|
46
|
+
'grid-rows-11',
|
|
47
|
+
'grid-rows-12'
|
|
48
|
+
];
|
|
49
|
+
|
|
50
|
+
if (max > 12) {
|
|
51
|
+
return 'grid-rows-12';
|
|
52
|
+
} else return classes[max - 1 || 1];
|
|
41
53
|
};
|
|
42
54
|
</script>
|
|
43
55
|
|
|
44
|
-
<div class="p-5 rounded-md bg-surface-50 dark:bg-surface-800 border-primary-500 border-2">
|
|
56
|
+
<div class="p-5 rounded-md max-w-6xl bg-surface-50 dark:bg-surface-800 border-primary-500 border-2">
|
|
45
57
|
<!-- Header -->
|
|
46
58
|
<h2 class="text-xl font-semibold">{group.displayName}</h2>
|
|
47
59
|
|
|
48
60
|
<!-- Items -->
|
|
49
61
|
<div
|
|
50
|
-
class="
|
|
62
|
+
class="{gridClass(
|
|
51
63
|
Object.keys(selected)
|
|
52
|
-
)}
|
|
64
|
+
)} grid grid-flow-col gap-x-10 gap-y-2 py-10 px-2 h-full overflow-x-auto"
|
|
53
65
|
>
|
|
54
66
|
{#each Object.keys(selected) as key}
|
|
55
|
-
<label class="flex gap-3 items-center">
|
|
67
|
+
<label class="flex gap-3 items-center w-48">
|
|
56
68
|
<input type="checkbox" class="checkbox" bind:checked={selected[key].selected} />
|
|
57
|
-
<span
|
|
69
|
+
<span
|
|
70
|
+
title={selected[key].displayName}
|
|
71
|
+
class="whitespace-nowrap break-before-avoid break-after-avoid truncate"
|
|
58
72
|
>{selected[key].displayName}</span
|
|
59
73
|
>
|
|
60
74
|
</label>
|
|
@@ -68,7 +82,7 @@
|
|
|
68
82
|
<button class="btn btn-sm variant-filled-tertiary" on:click={selectAll}>All</button>
|
|
69
83
|
</div>
|
|
70
84
|
<div class="flex gap-3">
|
|
71
|
-
<button class="btn btn-sm variant-filled-primary" on:click={
|
|
85
|
+
<button class="btn btn-sm variant-filled-primary" on:click={onApply}>Apply</button>
|
|
72
86
|
<button class="btn btn-sm variant-filled-secondary" on:click={onCancel}>Cancel</button>
|
|
73
87
|
</div>
|
|
74
88
|
</div>
|
|
@@ -193,7 +193,7 @@
|
|
|
193
193
|
{/if}
|
|
194
194
|
</div>
|
|
195
195
|
|
|
196
|
-
<button id={submitBt} color="primary" style="display:none"><Fa icon={faSave} /></button>
|
|
196
|
+
<button title="Submit" id={submitBt} color="primary" style="display:none"><Fa icon={faSave} /></button>
|
|
197
197
|
{:else}
|
|
198
198
|
<!-- while data is not loaded show a loading information -->
|
|
199
199
|
|
|
@@ -14,7 +14,9 @@
|
|
|
14
14
|
|
|
15
15
|
<button
|
|
16
16
|
type="button"
|
|
17
|
+
title="Hide or show columns"
|
|
17
18
|
class="btn btn-sm variant-filled-primary rounded-full order-last"
|
|
19
|
+
aria-label="Open menu to hide/show columns"
|
|
18
20
|
use:popup={popupCombobox}>Columns</button
|
|
19
21
|
>
|
|
20
22
|
|
|
@@ -24,8 +26,11 @@
|
|
|
24
26
|
>
|
|
25
27
|
{#each columns as column}
|
|
26
28
|
<div class="flex gap-3 items-center">
|
|
29
|
+
<label for={column.id} class="cursor-pointer" title={column.label}></label>
|
|
27
30
|
<input
|
|
31
|
+
aria-label="Toggle column visibility for column {column.label}"
|
|
28
32
|
type="checkbox"
|
|
33
|
+
id = {column.id}
|
|
29
34
|
bind:checked={column.visible}
|
|
30
35
|
disabled={columns.filter((c) => c.visible).length === 1 && column.visible}
|
|
31
36
|
/>
|
|
@@ -165,9 +165,9 @@
|
|
|
165
165
|
header: header ?? key,
|
|
166
166
|
accessor: accessor,
|
|
167
167
|
// Render the cell with the provided component, or use the toStringFn if provided, or just use the value
|
|
168
|
-
cell: ({ value, row }) => {
|
|
168
|
+
cell: ({ value, row, column }) => {
|
|
169
169
|
return renderComponent
|
|
170
|
-
? createRender(renderComponent, { value, row, dispatchFn: actionDispatcher })
|
|
170
|
+
? createRender(renderComponent, { value, row, column, dispatchFn: actionDispatcher })
|
|
171
171
|
: toStringFn
|
|
172
172
|
? toStringFn(value)
|
|
173
173
|
: value;
|
|
@@ -394,7 +394,7 @@
|
|
|
394
394
|
} else {
|
|
395
395
|
sendModel.q = searchValue;
|
|
396
396
|
}
|
|
397
|
-
|
|
397
|
+
|
|
398
398
|
$filterValue = searchValue;
|
|
399
399
|
}}
|
|
400
400
|
>
|
|
@@ -402,13 +402,16 @@
|
|
|
402
402
|
<input
|
|
403
403
|
class="input p-2 border border-primary-500"
|
|
404
404
|
type="text"
|
|
405
|
+
title="Search within all table rows"
|
|
405
406
|
bind:value={searchValue}
|
|
406
407
|
placeholder="Search rows..."
|
|
407
408
|
id="{tableId}-search"
|
|
408
409
|
/><button
|
|
409
410
|
type="reset"
|
|
411
|
+
title="Clear search"
|
|
410
412
|
id="{tableId}-searchReset"
|
|
411
413
|
class="absolute right-3 items-center"
|
|
414
|
+
aria-label="Clear search"
|
|
412
415
|
on:click|preventDefault={() => {
|
|
413
416
|
if (serverSide && !sendModel) {
|
|
414
417
|
throw new Error('Server-side configuration is missing');
|
|
@@ -423,6 +426,7 @@
|
|
|
423
426
|
</div>
|
|
424
427
|
<button
|
|
425
428
|
type="submit"
|
|
429
|
+
title="Search"
|
|
426
430
|
id="{tableId}-searchSubmit"
|
|
427
431
|
class="btn variant-filled-primary"
|
|
428
432
|
on:click|preventDefault={() => {
|
|
@@ -448,6 +452,7 @@
|
|
|
448
452
|
{#if toggle}
|
|
449
453
|
<SlideToggle
|
|
450
454
|
name="slider-label"
|
|
455
|
+
label="Fit to screen"
|
|
451
456
|
active="bg-primary-500"
|
|
452
457
|
size="sm"
|
|
453
458
|
checked={fitToScreen}
|
|
@@ -461,6 +466,7 @@
|
|
|
461
466
|
{#if resizable !== 'none'}
|
|
462
467
|
<button
|
|
463
468
|
type="button"
|
|
469
|
+
title="Reset column and row sizing"
|
|
464
470
|
class="btn btn-sm variant-filled-primary rounded-full order-last"
|
|
465
471
|
on:click|preventDefault={() =>
|
|
466
472
|
resetResize($headerRows, $pageRows, tableId, columns, resizable)}
|
|
@@ -470,6 +476,7 @@
|
|
|
470
476
|
{#if exportable}
|
|
471
477
|
<button
|
|
472
478
|
type="button"
|
|
479
|
+
title="Export table data as CSV"
|
|
473
480
|
class="btn btn-sm variant-filled-primary rounded-full order-last"
|
|
474
481
|
on:click|preventDefault={() => exportAsCsv(tableId, $exportedData)}
|
|
475
482
|
>Export as CSV</button
|
|
@@ -486,6 +493,7 @@
|
|
|
486
493
|
{...$tableAttrs}
|
|
487
494
|
class="table table-auto table-compact bg-tertiary-500/30 dark:bg-tertiary-900/10 overflow-clip"
|
|
488
495
|
id="{tableId}-table"
|
|
496
|
+
title="Table"
|
|
489
497
|
>
|
|
490
498
|
<!-- If table height is provided, making the top row sticky -->
|
|
491
499
|
<thead class={height != null && $pageRows.length > 0 ? `sticky top-0` : ''}>
|
|
@@ -511,6 +519,8 @@
|
|
|
511
519
|
<div class="flex gap-1 whitespace-pre-wrap">
|
|
512
520
|
<!-- Adding sorting config and styling -->
|
|
513
521
|
<span
|
|
522
|
+
role="button"
|
|
523
|
+
tabindex="0"
|
|
514
524
|
class:underline={props.sort.order}
|
|
515
525
|
class:normal-case={cell.id !== cell.label}
|
|
516
526
|
class:cursor-pointer={!props.sort.disabled}
|
|
@@ -240,6 +240,7 @@
|
|
|
240
240
|
type="button"
|
|
241
241
|
use:popup={popupFeatured}
|
|
242
242
|
id="{popupId}-button"
|
|
243
|
+
aria-label="Open filter menu for column {id}"
|
|
243
244
|
>
|
|
244
245
|
<Fa icon={faFilter} size="12" />
|
|
245
246
|
</button>
|
|
@@ -249,6 +250,7 @@
|
|
|
249
250
|
<button
|
|
250
251
|
class="btn variant-filled-primary btn-sm"
|
|
251
252
|
type="button"
|
|
253
|
+
aria-label="Clear Filters"
|
|
252
254
|
on:click|preventDefault={() => {
|
|
253
255
|
// Set the defaults when cleared
|
|
254
256
|
clearFilters();
|
|
@@ -273,6 +275,7 @@
|
|
|
273
275
|
{#each options[type] as option (option)}
|
|
274
276
|
<option
|
|
275
277
|
value={option.value}
|
|
278
|
+
aria-label={option.label}
|
|
276
279
|
selected={dropdown.option === option.value}
|
|
277
280
|
disabled={Object.keys($filters[id]).includes(option.value) &&
|
|
278
281
|
dropdown.option !== option.value}>{option.label}</option
|
|
@@ -281,7 +284,10 @@
|
|
|
281
284
|
</select>
|
|
282
285
|
{#if dropdowns.length > 1}
|
|
283
286
|
<div
|
|
287
|
+
role="button"
|
|
288
|
+
tabindex="0"
|
|
284
289
|
class="btn variant-filled-warning btn-sm h-full"
|
|
290
|
+
aria-label="Remove filter"
|
|
285
291
|
on:click|preventDefault={() => removeFilter(dropdown.option)}
|
|
286
292
|
on:keydown|preventDefault={() => removeFilter(dropdown.option)}
|
|
287
293
|
>
|
|
@@ -296,6 +302,7 @@
|
|
|
296
302
|
class="input p-1 border border-primary-500"
|
|
297
303
|
on:input={(e) => valueChangeHandler(e, index)}
|
|
298
304
|
bind:value={dropdown.value}
|
|
305
|
+
aria-label="Filter value"
|
|
299
306
|
/>
|
|
300
307
|
{:else}
|
|
301
308
|
<input
|
|
@@ -303,6 +310,7 @@
|
|
|
303
310
|
class="input p-1 border border-primary-500"
|
|
304
311
|
on:input={(e) => valueChangeHandler(e, index)}
|
|
305
312
|
bind:value={dropdown.formValue}
|
|
313
|
+
aria-label="Filter value"
|
|
306
314
|
/>
|
|
307
315
|
{/if}
|
|
308
316
|
</div>
|
|
@@ -315,12 +323,15 @@
|
|
|
315
323
|
{#if remainingFilters.length}
|
|
316
324
|
<div
|
|
317
325
|
class="btn variant-filled-secondary btn-sm cursor-pointer"
|
|
326
|
+
role="button"
|
|
327
|
+
tabindex="0"
|
|
318
328
|
on:click|stopPropagation={() => {
|
|
319
329
|
addFilter(remainingFilters[0].value, undefined);
|
|
320
330
|
}}
|
|
321
331
|
on:keydown|stopPropagation={() => {
|
|
322
332
|
addFilter(remainingFilters[0].value, undefined);
|
|
323
333
|
}}
|
|
334
|
+
aria-label="Add filter"
|
|
324
335
|
>
|
|
325
336
|
<div class="flex gap-1 items-center"><Fa icon={faPlus} />Add Filter</div>
|
|
326
337
|
</div>
|
|
@@ -328,6 +339,7 @@
|
|
|
328
339
|
<button
|
|
329
340
|
class="btn variant-filled-primary btn-sm"
|
|
330
341
|
type="button"
|
|
342
|
+
aria-label="Apply filters"
|
|
331
343
|
on:click|preventDefault={() => {
|
|
332
344
|
$pageIndex = 0;
|
|
333
345
|
$filterValue = $filters[id];
|