@bexis2/bexis2-core-ui 0.2.30 → 0.2.32
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 +10 -1
- package/dist/TableView.svelte +1 -1
- package/dist/components/CodeEditor/CodeEditor.svelte +32 -8
- package/dist/components/CodeEditor/CodeEditor.svelte.d.ts +1 -0
- package/dist/components/File/FileIcon.svelte +45 -45
- package/dist/components/File/FileInfo.svelte +13 -13
- package/dist/components/ListView.svelte +5 -5
- package/dist/components/Table/Table.svelte +87 -25
- package/dist/components/Table/TableFilter.svelte +1 -1
- package/dist/components/form/Checkbox.svelte +13 -13
- package/dist/components/form/CheckboxKvPList.svelte +16 -16
- package/dist/components/form/CheckboxList.svelte +10 -10
- package/dist/components/form/DateInput.svelte +14 -14
- package/dist/components/form/DropdownKvP.svelte +54 -54
- package/dist/components/form/MultiSelect.svelte +181 -181
- package/dist/components/form/NumberInput.svelte +15 -15
- package/dist/components/form/TextArea.svelte +14 -14
- package/dist/components/form/TextInput.svelte +15 -15
- package/dist/components/page/Alert.svelte +28 -28
- package/dist/components/page/BackToTop.svelte +30 -30
- package/dist/components/page/Docs.svelte +22 -22
- package/dist/components/page/ErrorMessage.svelte +8 -8
- package/dist/components/page/Footer.svelte +5 -5
- package/dist/components/page/Header.svelte +5 -5
- package/dist/components/page/HelpPopUp.svelte +30 -30
- package/dist/components/page/PageCaller.js +19 -19
- package/dist/components/page/Spinner.svelte +14 -14
- package/dist/components/page/breadcrumb/Breadcrumb.svelte +19 -19
- package/dist/components/page/menu/MenuDataCaller.js +10 -10
- package/dist/css/core.ui.postcss +17 -17
- package/dist/css/themes/theme-bexis2.css +96 -96
- package/dist/css/themes/theme-crimson.css +101 -101
- package/dist/css/themes/theme-gold-nouveau.css +140 -140
- package/dist/css/themes/theme-hamlindigo.css +112 -112
- package/dist/css/themes/theme-modern.css +127 -127
- package/dist/css/themes/theme-rocket.css +119 -119
- package/dist/css/themes/theme-sahara.css +128 -128
- package/dist/css/themes/theme-seafoam.css +122 -122
- package/dist/css/themes/theme-seasonal.css +115 -115
- package/dist/css/themes/theme-skeleton.css +118 -118
- package/dist/css/themes/theme-vintage.css +125 -125
- package/dist/models/Models.d.ts +3 -0
- package/dist/services/BaseCaller.js +16 -16
- package/package.json +3 -1
- package/src/lib/TableView.svelte +1 -1
- package/src/lib/components/CodeEditor/CodeEditor.svelte +43 -9
- package/src/lib/components/ListView.svelte +11 -11
- package/src/lib/components/Table/Table.svelte +107 -26
- package/src/lib/components/Table/TableFilter.svelte +2 -1
- package/src/lib/components/Table/filter.ts +141 -141
- package/src/lib/components/{File → file}/FileIcon.svelte +45 -45
- package/src/lib/components/{File → file}/FileInfo.svelte +13 -13
- package/src/lib/components/form/Checkbox.svelte +24 -24
- package/src/lib/components/form/CheckboxKvPList.svelte +29 -29
- package/src/lib/components/form/CheckboxList.svelte +21 -21
- package/src/lib/components/form/DateInput.svelte +27 -27
- package/src/lib/components/form/DropdownKvP.svelte +54 -54
- package/src/lib/components/form/MultiSelect.svelte +181 -181
- package/src/lib/components/form/NumberInput.svelte +30 -30
- package/src/lib/components/form/TextArea.svelte +28 -28
- package/src/lib/components/form/TextInput.svelte +28 -28
- package/src/lib/components/page/Alert.svelte +41 -41
- package/src/lib/components/page/BackToTop.svelte +30 -30
- package/src/lib/components/page/Docs.svelte +46 -46
- package/src/lib/components/page/ErrorMessage.svelte +10 -10
- package/src/lib/components/page/Footer.svelte +18 -18
- package/src/lib/components/page/Header.svelte +18 -18
- package/src/lib/components/page/HelpPopUp.svelte +72 -72
- package/src/lib/components/page/PageCaller.js +19 -19
- package/src/lib/components/page/Spinner.svelte +20 -20
- package/src/lib/components/page/breadcrumb/Breadcrumb.svelte +39 -39
- package/src/lib/components/page/menu/MenuDataCaller.js +10 -10
- package/src/lib/css/core.ui.postcss +17 -17
- package/src/lib/css/themes/theme-bexis2.css +96 -96
- package/src/lib/css/themes/theme-crimson.css +101 -101
- package/src/lib/css/themes/theme-gold-nouveau.css +140 -140
- package/src/lib/css/themes/theme-hamlindigo.css +112 -112
- package/src/lib/css/themes/theme-modern.css +127 -127
- package/src/lib/css/themes/theme-rocket.css +119 -119
- package/src/lib/css/themes/theme-sahara.css +128 -128
- package/src/lib/css/themes/theme-seafoam.css +122 -122
- package/src/lib/css/themes/theme-seasonal.css +115 -115
- package/src/lib/css/themes/theme-skeleton.css +118 -118
- package/src/lib/css/themes/theme-vintage.css +125 -125
- package/src/lib/models/Models.ts +10 -7
- package/src/lib/models/Page.ts +40 -40
- package/src/lib/services/Api.ts +55 -55
- package/src/lib/services/BaseCaller.js +16 -16
- package/src/lib/stores/apiStores.ts +31 -31
- /package/src/lib/components/{File → file}/FileUploader.svelte +0 -0
package/README.md
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
# bexis-core-ui
|
|
2
2
|
|
|
3
|
+
## 0.2.32
|
|
4
|
+
|
|
5
|
+
- resizability for Table rows and columns
|
|
6
|
+
- **fixedWidth** and **minWidth** options for columns
|
|
7
|
+
|
|
8
|
+
## 0.2.31
|
|
9
|
+
|
|
10
|
+
- validation and syntax check for code editor component
|
|
11
|
+
|
|
3
12
|
## 0.2.30
|
|
4
13
|
|
|
5
14
|
- fix routes for 'file' components ('.../file/...' -> '.../File/...')
|
|
6
|
-
- 'Table'
|
|
15
|
+
- 'Table' component is able to display heterogeneous data, that means data items/rows might have a different number of properties/columns.
|
|
7
16
|
|
|
8
17
|
## 0.2.29
|
|
9
18
|
|
package/dist/TableView.svelte
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<h1>table</h1>
|
|
1
|
+
<h1>table</h1>
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
<script>import { createEventDispatcher } from "svelte";
|
|
2
2
|
import CodeMirror from "svelte-codemirror-editor";
|
|
3
3
|
import Fa from "svelte-fa/src/fa.svelte";
|
|
4
|
+
import Linter from "eslint4b-prebuilt";
|
|
4
5
|
import { html } from "@codemirror/lang-html";
|
|
5
|
-
import { javascript } from "@codemirror/lang-javascript";
|
|
6
|
-
import {
|
|
6
|
+
import { javascript, esLint } from "@codemirror/lang-javascript";
|
|
7
|
+
import { lintGutter, linter } from "@codemirror/lint";
|
|
8
|
+
import { json, jsonParseLinter } from "@codemirror/lang-json";
|
|
7
9
|
import { oneDark } from "@codemirror/theme-one-dark";
|
|
8
10
|
import { Modal, modalStore } from "@skeletonlabs/skeleton";
|
|
9
11
|
import { faMoon, faSave, faSun } from "@fortawesome/free-regular-svg-icons";
|
|
@@ -16,6 +18,7 @@ export let language = "html";
|
|
|
16
18
|
export let dark = true;
|
|
17
19
|
export let toggle = true;
|
|
18
20
|
export let actions = true;
|
|
21
|
+
export let isValid = false;
|
|
19
22
|
export let styles = {
|
|
20
23
|
"&": {
|
|
21
24
|
borderRadius: "0.5rem",
|
|
@@ -32,14 +35,34 @@ const modal = {
|
|
|
32
35
|
body: "Unsaved changes will be lost. Are you sure you want to continue?",
|
|
33
36
|
response: (r) => r ? value = initialValue : null
|
|
34
37
|
};
|
|
38
|
+
const extensions = language === "js" ? [linter(esLint(new Linter())), lintGutter()] : language === "json" ? [linter(jsonParseLinter()), lintGutter()] : [];
|
|
39
|
+
const isValidJSON = (str) => {
|
|
40
|
+
try {
|
|
41
|
+
JSON.parse(str);
|
|
42
|
+
} catch (e) {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
return true;
|
|
46
|
+
};
|
|
47
|
+
const isValidJS = (str) => {
|
|
48
|
+
try {
|
|
49
|
+
new Function(str);
|
|
50
|
+
} catch (e) {
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
return true;
|
|
54
|
+
};
|
|
55
|
+
$:
|
|
56
|
+
isValid = language === "json" ? isValidJSON(value) : language === "js" ? isValidJS(value) : true;
|
|
35
57
|
</script>
|
|
36
58
|
|
|
37
|
-
<div class="items-
|
|
38
|
-
|
|
39
|
-
|
|
59
|
+
<div class="grid items-stretch justify-stretch gap-1">
|
|
60
|
+
<label class="label" for="{id}-editor" id="{id}-title">
|
|
61
|
+
<span>{title}</span>
|
|
62
|
+
</label>
|
|
40
63
|
<slot id="{id}-description" />
|
|
41
|
-
<div class="grid gap-1 w-full h-full
|
|
42
|
-
<div class="rounded-lg shadow-lg w-full" id="{id}-editor">
|
|
64
|
+
<div class="grid gap-1 w-full h-full">
|
|
65
|
+
<div class="rounded-lg shadow-lg w-full overflow-auto" id="{id}-editor">
|
|
43
66
|
<CodeMirror
|
|
44
67
|
bind:value
|
|
45
68
|
lang={language === 'html'
|
|
@@ -50,11 +73,11 @@ const modal = {
|
|
|
50
73
|
theme={dark ? oneDark : null}
|
|
51
74
|
class="flex w-full"
|
|
52
75
|
{styles}
|
|
76
|
+
{extensions}
|
|
53
77
|
/>
|
|
54
78
|
</div>
|
|
55
79
|
</div>
|
|
56
80
|
|
|
57
|
-
|
|
58
81
|
<div class="flex justify-between gap-2 items-center mt-3" id="{id}-footer">
|
|
59
82
|
<div class="flex gap-2">
|
|
60
83
|
<button
|
|
@@ -89,6 +112,7 @@ const modal = {
|
|
|
89
112
|
<button
|
|
90
113
|
class="btn variant-filled-primary"
|
|
91
114
|
id="{id}-save"
|
|
115
|
+
disabled={!isValid}
|
|
92
116
|
on:click|preventDefault={() => dispatch('save')}><Fa icon={faSave} /></button
|
|
93
117
|
>
|
|
94
118
|
</div>
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import Fa from 'svelte-fa';
|
|
3
|
-
import { faFileAudio } from '@fortawesome/free-regular-svg-icons';
|
|
4
|
-
import { faFileVideo } from '@fortawesome/free-regular-svg-icons';
|
|
5
|
-
import { faFileWord } from '@fortawesome/free-regular-svg-icons';
|
|
6
|
-
import { faFilePdf } from '@fortawesome/free-regular-svg-icons';
|
|
7
|
-
import { faFileExcel } from '@fortawesome/free-regular-svg-icons';
|
|
8
|
-
import { faFileAlt } from '@fortawesome/free-regular-svg-icons';
|
|
9
|
-
import { faFileImage } from '@fortawesome/free-regular-svg-icons';
|
|
10
|
-
import { faFileArchive } from '@fortawesome/free-regular-svg-icons';
|
|
11
|
-
|
|
12
|
-
export let type = '';
|
|
13
|
-
</script>
|
|
14
|
-
|
|
15
|
-
{#if type.includes('excel') || type.includes('spreadsheetml')}
|
|
16
|
-
<Fa icon={faFileExcel} />
|
|
17
|
-
{/if}
|
|
18
|
-
|
|
19
|
-
{#if type.includes('text')}
|
|
20
|
-
<Fa icon={faFileAlt} />
|
|
21
|
-
{/if}
|
|
22
|
-
|
|
23
|
-
{#if type.includes('image')}
|
|
24
|
-
<Fa icon={faFileImage} />
|
|
25
|
-
{/if}
|
|
26
|
-
|
|
27
|
-
{#if type.includes('audio')}
|
|
28
|
-
<Fa icon={faFileAudio} />
|
|
29
|
-
{/if}
|
|
30
|
-
|
|
31
|
-
{#if type.includes('video')}
|
|
32
|
-
<Fa icon={faFileVideo} />
|
|
33
|
-
{/if}
|
|
34
|
-
|
|
35
|
-
{#if type.includes('word')}
|
|
36
|
-
<Fa icon={faFileWord} />
|
|
37
|
-
{/if}
|
|
38
|
-
|
|
39
|
-
{#if type.includes('pdf')}
|
|
40
|
-
<Fa icon={faFilePdf} />
|
|
41
|
-
{/if}
|
|
42
|
-
|
|
43
|
-
{#if type.includes('zip')}
|
|
44
|
-
<Fa icon={faFileArchive} />
|
|
45
|
-
{/if}
|
|
1
|
+
<script>
|
|
2
|
+
import Fa from 'svelte-fa';
|
|
3
|
+
import { faFileAudio } from '@fortawesome/free-regular-svg-icons';
|
|
4
|
+
import { faFileVideo } from '@fortawesome/free-regular-svg-icons';
|
|
5
|
+
import { faFileWord } from '@fortawesome/free-regular-svg-icons';
|
|
6
|
+
import { faFilePdf } from '@fortawesome/free-regular-svg-icons';
|
|
7
|
+
import { faFileExcel } from '@fortawesome/free-regular-svg-icons';
|
|
8
|
+
import { faFileAlt } from '@fortawesome/free-regular-svg-icons';
|
|
9
|
+
import { faFileImage } from '@fortawesome/free-regular-svg-icons';
|
|
10
|
+
import { faFileArchive } from '@fortawesome/free-regular-svg-icons';
|
|
11
|
+
|
|
12
|
+
export let type = '';
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
{#if type.includes('excel') || type.includes('spreadsheetml')}
|
|
16
|
+
<Fa icon={faFileExcel} />
|
|
17
|
+
{/if}
|
|
18
|
+
|
|
19
|
+
{#if type.includes('text')}
|
|
20
|
+
<Fa icon={faFileAlt} />
|
|
21
|
+
{/if}
|
|
22
|
+
|
|
23
|
+
{#if type.includes('image')}
|
|
24
|
+
<Fa icon={faFileImage} />
|
|
25
|
+
{/if}
|
|
26
|
+
|
|
27
|
+
{#if type.includes('audio')}
|
|
28
|
+
<Fa icon={faFileAudio} />
|
|
29
|
+
{/if}
|
|
30
|
+
|
|
31
|
+
{#if type.includes('video')}
|
|
32
|
+
<Fa icon={faFileVideo} />
|
|
33
|
+
{/if}
|
|
34
|
+
|
|
35
|
+
{#if type.includes('word')}
|
|
36
|
+
<Fa icon={faFileWord} />
|
|
37
|
+
{/if}
|
|
38
|
+
|
|
39
|
+
{#if type.includes('pdf')}
|
|
40
|
+
<Fa icon={faFilePdf} />
|
|
41
|
+
{/if}
|
|
42
|
+
|
|
43
|
+
{#if type.includes('zip')}
|
|
44
|
+
<Fa icon={faFileArchive} />
|
|
45
|
+
{/if}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import FileIcon from './FileIcon.svelte';
|
|
3
|
-
|
|
4
|
-
export let name = '';
|
|
5
|
-
export let type = '';
|
|
6
|
-
// export let description;
|
|
7
|
-
export let size = '';
|
|
8
|
-
</script>
|
|
9
|
-
|
|
10
|
-
<div style="font-size:{size}">
|
|
11
|
-
<FileIcon {type} />
|
|
12
|
-
{name}
|
|
13
|
-
</div>
|
|
1
|
+
<script>
|
|
2
|
+
import FileIcon from './FileIcon.svelte';
|
|
3
|
+
|
|
4
|
+
export let name = '';
|
|
5
|
+
export let type = '';
|
|
6
|
+
// export let description;
|
|
7
|
+
export let size = '';
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<div style="font-size:{size}">
|
|
11
|
+
<FileIcon {type} />
|
|
12
|
+
{name}
|
|
13
|
+
</div>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script>let result = { name: "david" };
|
|
2
|
-
</script>
|
|
3
|
-
|
|
4
|
-
<h1>MyList</h1>
|
|
5
|
-
{result.name}
|
|
6
|
-
<b>from bexis-lib</b>
|
|
2
|
+
</script>
|
|
3
|
+
|
|
4
|
+
<h1>MyList</h1>
|
|
5
|
+
{result.name}
|
|
6
|
+
<b>from bexis-lib</b>
|
|
@@ -18,6 +18,7 @@ let {
|
|
|
18
18
|
id: tableId,
|
|
19
19
|
data,
|
|
20
20
|
columns,
|
|
21
|
+
resizable = "none",
|
|
21
22
|
height = null,
|
|
22
23
|
optionsComponent,
|
|
23
24
|
defaultPageSize = 10,
|
|
@@ -105,7 +106,7 @@ const tableColumns = [
|
|
|
105
106
|
header: key,
|
|
106
107
|
accessor,
|
|
107
108
|
cell: ({ value }) => {
|
|
108
|
-
return value
|
|
109
|
+
return value ? value : "";
|
|
109
110
|
},
|
|
110
111
|
plugins: {
|
|
111
112
|
sort: {
|
|
@@ -128,7 +129,7 @@ const tableColumns = [
|
|
|
128
129
|
if (optionsComponent !== void 0) {
|
|
129
130
|
tableColumns.push(
|
|
130
131
|
table.display({
|
|
131
|
-
id: "
|
|
132
|
+
id: "optionsColumn",
|
|
132
133
|
header: "",
|
|
133
134
|
cell: ({ row }, _) => {
|
|
134
135
|
return createRender(optionsComponent, {
|
|
@@ -142,13 +143,53 @@ if (optionsComponent !== void 0) {
|
|
|
142
143
|
const createdTableColumns = table.createColumns(tableColumns);
|
|
143
144
|
const { headerRows, pageRows, tableAttrs, tableBodyAttrs, pluginStates } = table.createViewModel(createdTableColumns);
|
|
144
145
|
const { filterValue } = pluginStates.tableFilter;
|
|
146
|
+
const minWidth = (id) => {
|
|
147
|
+
if (columns && id in columns) {
|
|
148
|
+
return columns[id].minWidth ?? 0;
|
|
149
|
+
}
|
|
150
|
+
return 0;
|
|
151
|
+
};
|
|
152
|
+
const fixedWidth = (id) => {
|
|
153
|
+
if (columns && id in columns) {
|
|
154
|
+
return columns[id].fixedWidth ?? 0;
|
|
155
|
+
}
|
|
156
|
+
return 0;
|
|
157
|
+
};
|
|
158
|
+
const cellStyle = (id) => {
|
|
159
|
+
const minW = minWidth(id);
|
|
160
|
+
const fixedW = fixedWidth(id);
|
|
161
|
+
const styles = [];
|
|
162
|
+
minW && styles.push(`min-width: ${minW}px`);
|
|
163
|
+
fixedW && styles.push(`width: ${fixedW}px`);
|
|
164
|
+
return styles.join(";");
|
|
165
|
+
};
|
|
166
|
+
const resetResize = () => {
|
|
167
|
+
if (resizable === "columns" || resizable === "both") {
|
|
168
|
+
$headerRows.forEach((row) => {
|
|
169
|
+
row.cells.forEach((cell) => {
|
|
170
|
+
const minW = minWidth(cell.id);
|
|
171
|
+
const fixedW = fixedWidth(cell.id);
|
|
172
|
+
fixedW && document.getElementById(`th-${tableId}-${cell.id}`)?.style.setProperty("width", `${fixedW}px`);
|
|
173
|
+
minW && document.getElementById(`th-${tableId}-${cell.id}`)?.style.setProperty("min-width", `${minW}px`);
|
|
174
|
+
!minW && !fixedW && document.getElementById(`th-${tableId}-${cell.id}`)?.style.setProperty("width", "auto");
|
|
175
|
+
});
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
if (resizable === "rows" || resizable === "both") {
|
|
179
|
+
$pageRows.forEach((row) => {
|
|
180
|
+
row.cells.forEach((cell) => {
|
|
181
|
+
document.getElementById(`${tableId}-${cell.id}-${row.id}`)?.style.setProperty("height", "auto");
|
|
182
|
+
});
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
};
|
|
145
186
|
</script>
|
|
146
187
|
|
|
147
188
|
<div class="grid gap-2 overflow-auto" class:w-fit={!fitToScreen} class:w-full={fitToScreen}>
|
|
148
189
|
<div class="table-container">
|
|
149
190
|
{#if $data.length > 0}
|
|
150
191
|
<input
|
|
151
|
-
class="input p-2
|
|
192
|
+
class="input p-2 border border-primary-500"
|
|
152
193
|
type="text"
|
|
153
194
|
bind:value={$filterValue}
|
|
154
195
|
placeholder="Search rows..."
|
|
@@ -156,24 +197,37 @@ const { filterValue } = pluginStates.tableFilter;
|
|
|
156
197
|
/>
|
|
157
198
|
{/if}
|
|
158
199
|
|
|
159
|
-
|
|
160
|
-
<
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
200
|
+
<div class="flex justify-between items-center py-2 w-full">
|
|
201
|
+
<div>
|
|
202
|
+
{#if toggle}
|
|
203
|
+
<SlideToggle
|
|
204
|
+
name="slider-label"
|
|
205
|
+
active="bg-primary-500"
|
|
206
|
+
size="sm"
|
|
207
|
+
checked={fitToScreen}
|
|
208
|
+
id="{tableId}-toggle"
|
|
209
|
+
on:change={() => (fitToScreen = !fitToScreen)}>Fit to screen</SlideToggle
|
|
210
|
+
>
|
|
211
|
+
{/if}
|
|
212
|
+
</div>
|
|
213
|
+
<div>
|
|
214
|
+
{#if resizable !== 'none'}
|
|
215
|
+
<button
|
|
216
|
+
type="button"
|
|
217
|
+
class="btn btn-sm variant-filled-primary rounded-full order-last"
|
|
218
|
+
on:click|preventDefault={resetResize}>Reset sizing</button
|
|
219
|
+
>
|
|
220
|
+
{/if}
|
|
221
|
+
</div>
|
|
222
|
+
</div>
|
|
169
223
|
|
|
170
224
|
<div class="overflow-auto" style="height: {height}px">
|
|
171
225
|
<table
|
|
172
226
|
{...$tableAttrs}
|
|
173
|
-
class="table table-compact bg-tertiary-
|
|
227
|
+
class="table table-auto table-compact bg-tertiary-500/30 overflow-clip"
|
|
174
228
|
id="{tableId}-table"
|
|
175
229
|
>
|
|
176
|
-
<thead class={height != null ? `sticky top-0` : ''}>
|
|
230
|
+
<thead class=" {height != null ? `sticky top-0` : ''}">
|
|
177
231
|
{#each $headerRows as headerRow (headerRow.id)}
|
|
178
232
|
<Subscribe
|
|
179
233
|
rowAttrs={headerRow.attrs()}
|
|
@@ -181,11 +235,19 @@ const { filterValue } = pluginStates.tableFilter;
|
|
|
181
235
|
rowProps={headerRow.props()}
|
|
182
236
|
let:rowProps
|
|
183
237
|
>
|
|
184
|
-
<tr {...rowAttrs} class="bg-primary-300">
|
|
238
|
+
<tr {...rowAttrs} class="bg-primary-300 items-stretch">
|
|
185
239
|
{#each headerRow.cells as cell (cell.id)}
|
|
186
240
|
<Subscribe attrs={cell.attrs()} props={cell.props()} let:props let:attrs>
|
|
187
|
-
<th
|
|
188
|
-
|
|
241
|
+
<th
|
|
242
|
+
scope="col"
|
|
243
|
+
class="!p-2 overflow-auto"
|
|
244
|
+
class:resize-x={(resizable === 'columns' || resizable === 'both') &&
|
|
245
|
+
!fixedWidth(cell.id)}
|
|
246
|
+
{...attrs}
|
|
247
|
+
id="th-{tableId}-{cell.id}"
|
|
248
|
+
style={cellStyle(cell.id)}
|
|
249
|
+
>
|
|
250
|
+
<div class="flex justify-between items-center">
|
|
189
251
|
<div class="flex gap-1 whitespace-pre-wrap">
|
|
190
252
|
<span
|
|
191
253
|
class:underline={props.sort.order}
|
|
@@ -225,18 +287,18 @@ const { filterValue } = pluginStates.tableFilter;
|
|
|
225
287
|
<tbody class="overflow-auto" {...$tableBodyAttrs}>
|
|
226
288
|
{#each $pageRows as row (row.id)}
|
|
227
289
|
<Subscribe rowAttrs={row.attrs()} let:rowAttrs>
|
|
228
|
-
<tr {...rowAttrs} id="{tableId}-row-{row.id}">
|
|
229
|
-
{#each row.cells as cell (cell?.id)}
|
|
290
|
+
<tr {...rowAttrs} id="{tableId}-row-{row.id}" class="">
|
|
291
|
+
{#each row.cells as cell, index (cell?.id)}
|
|
230
292
|
<Subscribe attrs={cell.attrs()} let:attrs>
|
|
231
293
|
<td
|
|
232
294
|
{...attrs}
|
|
233
|
-
class="!p-2
|
|
295
|
+
class="!p-2 overflow-auto {index === 0 &&
|
|
296
|
+
(resizable === 'rows' || resizable === 'both')
|
|
297
|
+
? 'resize-y'
|
|
298
|
+
: ''}"
|
|
234
299
|
id="{tableId}-{cell.id}-{row.id}"
|
|
235
300
|
>
|
|
236
|
-
<div
|
|
237
|
-
class="flex items-center h-max overflow-x-auto resize-none hover:resize"
|
|
238
|
-
class:max-w-md={!fitToScreen}
|
|
239
|
-
>
|
|
301
|
+
<div class="flex items-center h-max overflow-x-auto">
|
|
240
302
|
<Render of={cell.render()} />
|
|
241
303
|
</div>
|
|
242
304
|
</td>
|
|
@@ -6,16 +6,16 @@ export let valid;
|
|
|
6
6
|
export let invalid;
|
|
7
7
|
export let required;
|
|
8
8
|
export let feedback;
|
|
9
|
-
</script>
|
|
10
|
-
|
|
11
|
-
<InputContainer {label} {feedback} {required}>
|
|
12
|
-
<input
|
|
13
|
-
{id}
|
|
14
|
-
class="input variant-form-material"
|
|
15
|
-
type="checkbox"
|
|
16
|
-
class:input-success={valid}
|
|
17
|
-
class:input-error={invalid}
|
|
18
|
-
bind:checked
|
|
19
|
-
on:input
|
|
20
|
-
/>
|
|
21
|
-
</InputContainer>
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<InputContainer {label} {feedback} {required}>
|
|
12
|
+
<input
|
|
13
|
+
{id}
|
|
14
|
+
class="input variant-form-material"
|
|
15
|
+
type="checkbox"
|
|
16
|
+
class:input-success={valid}
|
|
17
|
+
class:input-error={invalid}
|
|
18
|
+
bind:checked
|
|
19
|
+
on:input
|
|
20
|
+
/>
|
|
21
|
+
</InputContainer>
|
|
@@ -8,19 +8,19 @@ export let key;
|
|
|
8
8
|
export let help = false;
|
|
9
9
|
let required = false;
|
|
10
10
|
let feedback;
|
|
11
|
-
</script>
|
|
12
|
-
|
|
13
|
-
<InputContainer {id} label={title} {feedback} {required} {help}>
|
|
14
|
-
{#each source as item}
|
|
15
|
-
<label class="flex items-center space-x-2" for={key}>
|
|
16
|
-
<input
|
|
17
|
-
class="checkbox"
|
|
18
|
-
type="checkbox"
|
|
19
|
-
bind:group={target}
|
|
20
|
-
checked={item.key}
|
|
21
|
-
value={item.key}
|
|
22
|
-
/>
|
|
23
|
-
<p>{item.value}</p>
|
|
24
|
-
</label>
|
|
25
|
-
{/each}
|
|
26
|
-
</InputContainer>
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<InputContainer {id} label={title} {feedback} {required} {help}>
|
|
14
|
+
{#each source as item}
|
|
15
|
+
<label class="flex items-center space-x-2" for={key}>
|
|
16
|
+
<input
|
|
17
|
+
class="checkbox"
|
|
18
|
+
type="checkbox"
|
|
19
|
+
bind:group={target}
|
|
20
|
+
checked={item.key}
|
|
21
|
+
value={item.key}
|
|
22
|
+
/>
|
|
23
|
+
<p>{item.value}</p>
|
|
24
|
+
</label>
|
|
25
|
+
{/each}
|
|
26
|
+
</InputContainer>
|
|
@@ -6,13 +6,13 @@ export let description = "";
|
|
|
6
6
|
export let key;
|
|
7
7
|
let required = false;
|
|
8
8
|
let feedback;
|
|
9
|
-
</script>
|
|
10
|
-
|
|
11
|
-
<InputContainer label={title} {feedback} {required}>
|
|
12
|
-
{#each source as item}
|
|
13
|
-
<label class="flex items-center space-x-2" for={key}>
|
|
14
|
-
<input class="checkbox" type="checkbox" bind:group={target} value={item} />
|
|
15
|
-
<p>{item}</p>
|
|
16
|
-
</label>
|
|
17
|
-
{/each}
|
|
18
|
-
</InputContainer>
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<InputContainer label={title} {feedback} {required}>
|
|
12
|
+
{#each source as item}
|
|
13
|
+
<label class="flex items-center space-x-2" for={key}>
|
|
14
|
+
<input class="checkbox" type="checkbox" bind:group={target} value={item} />
|
|
15
|
+
<p>{item}</p>
|
|
16
|
+
</label>
|
|
17
|
+
{/each}
|
|
18
|
+
</InputContainer>
|
|
@@ -8,17 +8,17 @@ export let required = false;
|
|
|
8
8
|
export let feedback = [""];
|
|
9
9
|
export let help = false;
|
|
10
10
|
export let disabled = false;
|
|
11
|
-
</script>
|
|
12
|
-
|
|
13
|
-
<InputContainer {id} {label} {feedback} {required} {help}>
|
|
14
|
-
<input
|
|
15
|
-
{id}
|
|
16
|
-
class="input variant-form-material"
|
|
17
|
-
type="date"
|
|
18
|
-
class:input-success={valid}
|
|
19
|
-
class:input-error={invalid}
|
|
20
|
-
bind:value
|
|
21
|
-
on:input
|
|
22
|
-
{disabled}
|
|
23
|
-
/>
|
|
24
|
-
</InputContainer>
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<InputContainer {id} {label} {feedback} {required} {help}>
|
|
14
|
+
<input
|
|
15
|
+
{id}
|
|
16
|
+
class="input variant-form-material"
|
|
17
|
+
type="date"
|
|
18
|
+
class:input-success={valid}
|
|
19
|
+
class:input-error={invalid}
|
|
20
|
+
bind:value
|
|
21
|
+
on:input
|
|
22
|
+
{disabled}
|
|
23
|
+
/>
|
|
24
|
+
</InputContainer>
|
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import InputContainer from './InputContainer.svelte';
|
|
3
|
-
|
|
4
|
-
export let id;
|
|
5
|
-
export let source;
|
|
6
|
-
export let target;
|
|
7
|
-
export let title;
|
|
8
|
-
export let valid = false;
|
|
9
|
-
export let invalid = false;
|
|
10
|
-
export let feedback = [''];
|
|
11
|
-
export let required = false;
|
|
12
|
-
export let complexTarget = false;
|
|
13
|
-
export let help = false;
|
|
14
|
-
|
|
15
|
-
$: selected = null;
|
|
16
|
-
|
|
17
|
-
$: updatedSelectedValue(target);
|
|
18
|
-
$: updatedTarget(selected);
|
|
19
|
-
|
|
20
|
-
function updatedSelectedValue(selection) {
|
|
21
|
-
if (selection != null) {
|
|
22
|
-
if (complexTarget) {
|
|
23
|
-
selected = selection.id;
|
|
24
|
-
} else {
|
|
25
|
-
selected = selection;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function updatedTarget(id) {
|
|
31
|
-
if (complexTarget) {
|
|
32
|
-
target = source.find((opt) => opt.id === id);
|
|
33
|
-
} else {
|
|
34
|
-
target = id;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
</script>
|
|
38
|
-
|
|
39
|
-
<InputContainer {id} label={title} {feedback} {required} {help}>
|
|
40
|
-
<select
|
|
41
|
-
{id}
|
|
42
|
-
class="select variant-form-material"
|
|
43
|
-
class:input-success={valid}
|
|
44
|
-
class:input-error={invalid}
|
|
45
|
-
bind:value={selected}
|
|
46
|
-
on:change
|
|
47
|
-
on:select
|
|
48
|
-
>
|
|
49
|
-
<option value={null}>-- Please select --</option>
|
|
50
|
-
{#each source as e}
|
|
51
|
-
<option value={e.id}>{e.text}</option>
|
|
52
|
-
{/each}
|
|
53
|
-
</select>
|
|
54
|
-
</InputContainer>
|
|
1
|
+
<script>
|
|
2
|
+
import InputContainer from './InputContainer.svelte';
|
|
3
|
+
|
|
4
|
+
export let id;
|
|
5
|
+
export let source;
|
|
6
|
+
export let target;
|
|
7
|
+
export let title;
|
|
8
|
+
export let valid = false;
|
|
9
|
+
export let invalid = false;
|
|
10
|
+
export let feedback = [''];
|
|
11
|
+
export let required = false;
|
|
12
|
+
export let complexTarget = false;
|
|
13
|
+
export let help = false;
|
|
14
|
+
|
|
15
|
+
$: selected = null;
|
|
16
|
+
|
|
17
|
+
$: updatedSelectedValue(target);
|
|
18
|
+
$: updatedTarget(selected);
|
|
19
|
+
|
|
20
|
+
function updatedSelectedValue(selection) {
|
|
21
|
+
if (selection != null) {
|
|
22
|
+
if (complexTarget) {
|
|
23
|
+
selected = selection.id;
|
|
24
|
+
} else {
|
|
25
|
+
selected = selection;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function updatedTarget(id) {
|
|
31
|
+
if (complexTarget) {
|
|
32
|
+
target = source.find((opt) => opt.id === id);
|
|
33
|
+
} else {
|
|
34
|
+
target = id;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<InputContainer {id} label={title} {feedback} {required} {help}>
|
|
40
|
+
<select
|
|
41
|
+
{id}
|
|
42
|
+
class="select variant-form-material"
|
|
43
|
+
class:input-success={valid}
|
|
44
|
+
class:input-error={invalid}
|
|
45
|
+
bind:value={selected}
|
|
46
|
+
on:change
|
|
47
|
+
on:select
|
|
48
|
+
>
|
|
49
|
+
<option value={null}>-- Please select --</option>
|
|
50
|
+
{#each source as e}
|
|
51
|
+
<option value={e.id}>{e.text}</option>
|
|
52
|
+
{/each}
|
|
53
|
+
</select>
|
|
54
|
+
</InputContainer>
|