sprintify-ui 0.8.60 → 0.8.62
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/sprintify-ui.es.js +2521 -2510
- package/dist/types/components/BaseDataTable.vue.d.ts +17 -0
- package/dist/types/utils/storage.d.ts +2 -0
- package/package.json +1 -1
- package/src/components/BaseDataIteratorSectionColumns.vue +3 -2
- package/src/components/BaseDataTable.vue +16 -4
- package/src/utils/storage.ts +3 -0
|
@@ -1101,6 +1101,14 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
1101
1101
|
default: boolean;
|
|
1102
1102
|
type: BooleanConstructor;
|
|
1103
1103
|
};
|
|
1104
|
+
/**
|
|
1105
|
+
* Storage key to save visible columns and order settings.
|
|
1106
|
+
* By default, it uses the current URL path, without query params.
|
|
1107
|
+
*/
|
|
1108
|
+
storageKey: {
|
|
1109
|
+
type: StringConstructor;
|
|
1110
|
+
default(): string;
|
|
1111
|
+
};
|
|
1104
1112
|
}>, {
|
|
1105
1113
|
fetch: typeof fetch;
|
|
1106
1114
|
fetchWithoutLoading: typeof fetchWithoutLoading;
|
|
@@ -1349,6 +1357,14 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
1349
1357
|
default: boolean;
|
|
1350
1358
|
type: BooleanConstructor;
|
|
1351
1359
|
};
|
|
1360
|
+
/**
|
|
1361
|
+
* Storage key to save visible columns and order settings.
|
|
1362
|
+
* By default, it uses the current URL path, without query params.
|
|
1363
|
+
*/
|
|
1364
|
+
storageKey: {
|
|
1365
|
+
type: StringConstructor;
|
|
1366
|
+
default(): string;
|
|
1367
|
+
};
|
|
1352
1368
|
}>> & Readonly<{
|
|
1353
1369
|
onDelete?: ((...args: any[]) => any) | undefined;
|
|
1354
1370
|
"onUpdate:checked-rows"?: ((...args: any[]) => any) | undefined;
|
|
@@ -1389,6 +1405,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
1389
1405
|
toggleable: boolean;
|
|
1390
1406
|
rowActions: RowAction[];
|
|
1391
1407
|
numberOfVisibleRowActions: number;
|
|
1408
|
+
storageKey: string;
|
|
1392
1409
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
1393
1410
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
1394
1411
|
export default _default;
|
package/package.json
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
<BaseInput
|
|
6
6
|
v-model="search"
|
|
7
7
|
size="sm"
|
|
8
|
-
|
|
8
|
+
icon-left="heroicons:magnifying-glass"
|
|
9
|
+
class="w-full mb-3"
|
|
9
10
|
:placeholder="t('sui.search')"
|
|
10
11
|
/>
|
|
11
12
|
</div>
|
|
@@ -18,7 +19,7 @@
|
|
|
18
19
|
@update:model-value="onDragUpdate"
|
|
19
20
|
>
|
|
20
21
|
<template #item="{ element }">
|
|
21
|
-
<div class="flex items-center border-
|
|
22
|
+
<div class="flex items-center border-t">
|
|
22
23
|
|
|
23
24
|
<div
|
|
24
25
|
class="handle shrink-0 relative py-1 pl-4 pr-1 -left-1"
|
|
@@ -256,6 +256,7 @@ import { useInputSize } from '@/composables/inputSize';
|
|
|
256
256
|
import BaseButton from './BaseButton.vue';
|
|
257
257
|
import BaseDataTableTemplate from './BaseDataTableTemplate.vue';
|
|
258
258
|
import { customKeyActions } from '@/services/table/customKeyActions';
|
|
259
|
+
import { storageKeyPrefix } from '@/utils/storage';
|
|
259
260
|
|
|
260
261
|
const http = config.http;
|
|
261
262
|
|
|
@@ -555,6 +556,17 @@ const props = defineProps({
|
|
|
555
556
|
default: false,
|
|
556
557
|
type: Boolean,
|
|
557
558
|
},
|
|
559
|
+
|
|
560
|
+
/**
|
|
561
|
+
* Storage key to save visible columns and order settings.
|
|
562
|
+
* By default, it uses the current URL path, without query params.
|
|
563
|
+
*/
|
|
564
|
+
storageKey: {
|
|
565
|
+
type: String,
|
|
566
|
+
default() {
|
|
567
|
+
return window.location.pathname;
|
|
568
|
+
},
|
|
569
|
+
},
|
|
558
570
|
});
|
|
559
571
|
|
|
560
572
|
const sizeInternal = useInputSize(props.size);
|
|
@@ -647,6 +659,8 @@ const onDelete = (row: CollectionItem) => {
|
|
|
647
659
|
});
|
|
648
660
|
};
|
|
649
661
|
|
|
662
|
+
const componentStorageKey = 'base_data_table.';
|
|
663
|
+
|
|
650
664
|
/*
|
|
651
665
|
|--------------------------------------------------------------------------
|
|
652
666
|
| Toggle columns
|
|
@@ -656,8 +670,7 @@ const onDelete = (row: CollectionItem) => {
|
|
|
656
670
|
const visibleColumns = ref<string[]>([]);
|
|
657
671
|
|
|
658
672
|
// Find visible columns in local storage
|
|
659
|
-
const
|
|
660
|
-
const VISIBLE_COLUMNS_LOCAL_STORAGE_KEY = VISIBLE_COLUMNS_LOCAL_STORAGE + window.location.pathname;
|
|
673
|
+
const VISIBLE_COLUMNS_LOCAL_STORAGE_KEY = storageKeyPrefix + componentStorageKey + props.storageKey + '.visible_columns';
|
|
661
674
|
|
|
662
675
|
const visibleColumnsFromStorage = JSON.parse(
|
|
663
676
|
localStorage.getItem(VISIBLE_COLUMNS_LOCAL_STORAGE_KEY) + ''
|
|
@@ -712,8 +725,7 @@ function onUpdateVisibleColumn(columns: string[]) {
|
|
|
712
725
|
|
|
713
726
|
const columnOrder = ref<string[]>([]);
|
|
714
727
|
|
|
715
|
-
const
|
|
716
|
-
const COLUMN_ORDER_LOCAL_STORAGE_KEY = COLUMN_ORDER_LOCAL_STORAGE + window.location.pathname;
|
|
728
|
+
const COLUMN_ORDER_LOCAL_STORAGE_KEY = storageKeyPrefix + componentStorageKey + props.storageKey + '.column_order';
|
|
717
729
|
|
|
718
730
|
onMounted(() => {
|
|
719
731
|
const columnOrderFromStorage = JSON.parse(
|