sprintify-ui 0.8.64 → 0.8.65
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 +717 -703
- package/dist/types/utils/storage.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/BaseDataTable.vue +34 -2
- package/src/utils/storage.ts +1 -1
|
@@ -4,7 +4,7 @@ declare class SettingsStorage {
|
|
|
4
4
|
private getFunction;
|
|
5
5
|
private setFunction;
|
|
6
6
|
constructor(getFunction?: SettingsStorageGetFunction, setFunction?: SettingsStorageSetFunction);
|
|
7
|
-
get(key: string): Promise<string | null>;
|
|
7
|
+
get(key: string): Promise<Record<string, any> | string[] | number[] | number | string | boolean | null | undefined>;
|
|
8
8
|
set(key: string, value: string): Promise<void>;
|
|
9
9
|
}
|
|
10
10
|
export { SettingsStorage };
|
package/package.json
CHANGED
|
@@ -674,7 +674,23 @@ onMounted(async () => {
|
|
|
674
674
|
|
|
675
675
|
const value = await settingsStorage.get(visibleColumnsKey);
|
|
676
676
|
|
|
677
|
-
|
|
677
|
+
let visibleColumnsFromStorage = [];
|
|
678
|
+
|
|
679
|
+
if (typeof value === 'string') {
|
|
680
|
+
try {
|
|
681
|
+
visibleColumnsFromStorage.push(...JSON.parse(value));
|
|
682
|
+
} catch (e) {
|
|
683
|
+
console.error('Error parsing visible columns from storage', e);
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
if (typeof value === 'object' && value !== null) {
|
|
688
|
+
visibleColumnsFromStorage.push(Object.values(value));
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
if (Array.isArray(value)) {
|
|
692
|
+
visibleColumnsFromStorage = value;
|
|
693
|
+
}
|
|
678
694
|
|
|
679
695
|
// If found, set visibleColumns
|
|
680
696
|
if (
|
|
@@ -732,7 +748,23 @@ onMounted(async () => {
|
|
|
732
748
|
|
|
733
749
|
const value = await settingsStorage.get(columnOrderKey);
|
|
734
750
|
|
|
735
|
-
|
|
751
|
+
let columnOrderFromStorage = [];
|
|
752
|
+
|
|
753
|
+
if (typeof value === 'string') {
|
|
754
|
+
try {
|
|
755
|
+
columnOrderFromStorage.push(...JSON.parse(value));
|
|
756
|
+
} catch (e) {
|
|
757
|
+
console.error('Error parsing visible columns from storage', e);
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
if (typeof value === 'object' && value !== null) {
|
|
762
|
+
columnOrderFromStorage.push(Object.values(value));
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
if (Array.isArray(value)) {
|
|
766
|
+
columnOrderFromStorage = value;
|
|
767
|
+
}
|
|
736
768
|
|
|
737
769
|
// If found, set columnOrder
|
|
738
770
|
if (
|
package/src/utils/storage.ts
CHANGED
|
@@ -24,7 +24,7 @@ class SettingsStorage {
|
|
|
24
24
|
this.setFunction = setFunction ? setFunction : localStorageSet;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
get(key: string): Promise<string | null> {
|
|
27
|
+
get(key: string): Promise<Record<string, any> | string[] | number[] | number | string | boolean | null | undefined> {
|
|
28
28
|
return this.getFunction(key);
|
|
29
29
|
}
|
|
30
30
|
|