hamzus-ui 0.0.195 → 0.0.197
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/package.json
CHANGED
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
export let limit = 20;
|
|
18
18
|
export let offset = 0;
|
|
19
19
|
export let getRows = (filters) => {};
|
|
20
|
+
export let onChange = ()=>{};
|
|
20
21
|
export let onClick = undefined;
|
|
21
22
|
export let version = 1;
|
|
22
23
|
|
|
@@ -24,8 +25,8 @@
|
|
|
24
25
|
let mounted = false;
|
|
25
26
|
let loading = false;
|
|
26
27
|
let rows = [];
|
|
27
|
-
let defaultColumns =
|
|
28
|
-
let defaultFilters =
|
|
28
|
+
let defaultColumns = [...columns];
|
|
29
|
+
let defaultFilters = {...filters}
|
|
29
30
|
let selection = [];
|
|
30
31
|
|
|
31
32
|
const table = createTableContext({
|
|
@@ -45,7 +46,7 @@
|
|
|
45
46
|
|
|
46
47
|
setContext(TABLE_CTX, table);
|
|
47
48
|
|
|
48
|
-
|
|
49
|
+
$: onChange($table)
|
|
49
50
|
|
|
50
51
|
|
|
51
52
|
|
|
@@ -161,8 +162,8 @@
|
|
|
161
162
|
|
|
162
163
|
function handleResetSettings() {
|
|
163
164
|
table.update((actualValue) => {
|
|
164
|
-
actualValue.columns =
|
|
165
|
-
actualValue.filters =
|
|
165
|
+
actualValue.columns = JSON.parse(JSON.stringify(defaultColumns));
|
|
166
|
+
actualValue.filters = JSON.parse(JSON.stringify(defaultFilters))
|
|
166
167
|
return {
|
|
167
168
|
...actualValue
|
|
168
169
|
};
|