@bexis2/bexis2-core-ui 0.1.3 → 0.1.4
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/Table/Table.svelte +5 -3
- package/dist/components/Table/TableFilter.svelte +2 -1
- package/dist/components/Table/TableFilter.svelte.d.ts +1 -0
- package/dist/stores/apistore.js +1 -0
- package/package.json +1 -1
- package/src/lib/components/Table/Table.svelte +5 -3
- package/src/lib/components/Table/TableFilter.svelte +2 -1
- package/src/lib/components/page/menu/Menu.svelte +1 -4
- package/src/lib/stores/apistore.ts +3 -0
|
@@ -77,7 +77,8 @@ const tableColumns = [
|
|
|
77
77
|
filterValue: filterValue2,
|
|
78
78
|
id,
|
|
79
79
|
tableId,
|
|
80
|
-
values
|
|
80
|
+
values,
|
|
81
|
+
toFilterableValueFn
|
|
81
82
|
});
|
|
82
83
|
}
|
|
83
84
|
} : void 0,
|
|
@@ -149,12 +150,13 @@ const { filterValue } = pluginStates.tableFilter;
|
|
|
149
150
|
<tr {...rowAttrs} class="bg-primary-300">
|
|
150
151
|
{#each headerRow.cells as cell (cell.id)}
|
|
151
152
|
<Subscribe attrs={cell.attrs()} props={cell.props()} let:props let:attrs>
|
|
152
|
-
<th scope="col" class="!p-2" {...attrs}>
|
|
153
|
+
<th scope="col" class="!p-2 w-min" {...attrs}>
|
|
153
154
|
<div class="flex w-full justify-between items-center">
|
|
154
155
|
<div class="flex gap-1">
|
|
155
156
|
<span
|
|
156
157
|
class:underline={props.sort.order}
|
|
157
158
|
class:normal-case={cell.id !== cell.label}
|
|
159
|
+
class:cursor-pointer={!props.sort.disabled}
|
|
158
160
|
on:click={props.sort.toggle}
|
|
159
161
|
on:keydown={props.sort.toggle}
|
|
160
162
|
>
|
|
@@ -190,7 +192,7 @@ const { filterValue } = pluginStates.tableFilter;
|
|
|
190
192
|
<tr {...rowAttrs}>
|
|
191
193
|
{#each row.cells as cell (cell?.id)}
|
|
192
194
|
<Subscribe attrs={cell.attrs()} let:attrs>
|
|
193
|
-
<td {...attrs} class="!p-2">
|
|
195
|
+
<td {...attrs} class="!p-2 w-min">
|
|
194
196
|
<div class="flex items-center w-full h-full table-cell-fit">
|
|
195
197
|
<Render of={cell.render()} />
|
|
196
198
|
</div>
|
|
@@ -5,6 +5,7 @@ export let filterValue;
|
|
|
5
5
|
export let values;
|
|
6
6
|
export let id;
|
|
7
7
|
export let tableId;
|
|
8
|
+
export let toFilterableValueFn = void 0;
|
|
8
9
|
let firstOption;
|
|
9
10
|
let firstValue;
|
|
10
11
|
let secondOption;
|
|
@@ -96,7 +97,7 @@ const popupFeatured = {
|
|
|
96
97
|
target: popupId,
|
|
97
98
|
placement: "bottom-start"
|
|
98
99
|
};
|
|
99
|
-
let type = typeof $values[0];
|
|
100
|
+
let type = typeof (toFilterableValueFn ? toFilterableValueFn($values[0]) : $values[0]);
|
|
100
101
|
if (type === "object") {
|
|
101
102
|
if ($values[0] instanceof Date) {
|
|
102
103
|
type = "date";
|
package/dist/stores/apistore.js
CHANGED
package/package.json
CHANGED
|
@@ -97,7 +97,8 @@
|
|
|
97
97
|
filterValue,
|
|
98
98
|
id,
|
|
99
99
|
tableId,
|
|
100
|
-
values
|
|
100
|
+
values,
|
|
101
|
+
toFilterableValueFn
|
|
101
102
|
});
|
|
102
103
|
}
|
|
103
104
|
}
|
|
@@ -175,12 +176,13 @@
|
|
|
175
176
|
<tr {...rowAttrs} class="bg-primary-300">
|
|
176
177
|
{#each headerRow.cells as cell (cell.id)}
|
|
177
178
|
<Subscribe attrs={cell.attrs()} props={cell.props()} let:props let:attrs>
|
|
178
|
-
<th scope="col" class="!p-2" {...attrs}>
|
|
179
|
+
<th scope="col" class="!p-2 w-min" {...attrs}>
|
|
179
180
|
<div class="flex w-full justify-between items-center">
|
|
180
181
|
<div class="flex gap-1">
|
|
181
182
|
<span
|
|
182
183
|
class:underline={props.sort.order}
|
|
183
184
|
class:normal-case={cell.id !== cell.label}
|
|
185
|
+
class:cursor-pointer={!props.sort.disabled}
|
|
184
186
|
on:click={props.sort.toggle}
|
|
185
187
|
on:keydown={props.sort.toggle}
|
|
186
188
|
>
|
|
@@ -216,7 +218,7 @@
|
|
|
216
218
|
<tr {...rowAttrs}>
|
|
217
219
|
{#each row.cells as cell (cell?.id)}
|
|
218
220
|
<Subscribe attrs={cell.attrs()} let:attrs>
|
|
219
|
-
<td {...attrs} class="!p-2">
|
|
221
|
+
<td {...attrs} class="!p-2 w-min">
|
|
220
222
|
<div class="flex items-center w-full h-full table-cell-fit">
|
|
221
223
|
<Render of={cell.render()} />
|
|
222
224
|
</div>
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
export let values;
|
|
9
9
|
export let id;
|
|
10
10
|
export let tableId;
|
|
11
|
+
export let toFilterableValueFn: undefined | ((value: any) => any) = undefined;
|
|
11
12
|
|
|
12
13
|
let firstOption;
|
|
13
14
|
let firstValue;
|
|
@@ -104,7 +105,7 @@
|
|
|
104
105
|
placement: 'bottom-start'
|
|
105
106
|
};
|
|
106
107
|
|
|
107
|
-
let type: string = typeof $values[0];
|
|
108
|
+
let type: string = typeof (toFilterableValueFn ? toFilterableValueFn($values[0]) : $values[0]);
|
|
108
109
|
if (type === 'object') {
|
|
109
110
|
if ($values[0] instanceof Date) {
|
|
110
111
|
type = 'date';
|
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
import { faCog } from '@fortawesome/free-solid-svg-icons'
|
|
5
5
|
|
|
6
6
|
import { onMount } from 'svelte';
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
|
|
9
8
|
import { getMenuItems} from './MenuDataCaller';
|
|
10
9
|
|
|
11
10
|
import type { Menu } from "./menu";
|
|
@@ -16,9 +15,7 @@
|
|
|
16
15
|
let menu:Menu;
|
|
17
16
|
|
|
18
17
|
onMount(async () => {
|
|
19
|
-
|
|
20
18
|
|
|
21
|
-
|
|
22
19
|
menu = await getMenuItems();
|
|
23
20
|
|
|
24
21
|
})
|
|
@@ -22,7 +22,10 @@ passwordStore.subscribe((value) => {
|
|
|
22
22
|
|
|
23
23
|
export function setApiConfig(_host: string, _user: string, _pw: string) {
|
|
24
24
|
console.log('overwrite settings');
|
|
25
|
+
|
|
25
26
|
hostStore.update((h) => (h = _host));
|
|
26
27
|
usernameStore.update((u) => (u = _user));
|
|
27
28
|
passwordStore.update((p) => (p = _pw));
|
|
29
|
+
|
|
30
|
+
console.log('overwrite host',_host);
|
|
28
31
|
}
|