sprintify-ui 0.8.63 → 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.
@@ -252,3 +252,4 @@ export { useSnackbarsStore };
252
252
  export { useSystemAlertStore };
253
253
  export { useClickOutside };
254
254
  export { useField };
255
+ export { SettingsStorage };
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sprintify-ui",
3
- "version": "0.8.63",
3
+ "version": "0.8.65",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "build": "rimraf dist && vue-tsc && vite build",
@@ -674,7 +674,23 @@ onMounted(async () => {
674
674
 
675
675
  const value = await settingsStorage.get(visibleColumnsKey);
676
676
 
677
- const visibleColumnsFromStorage = JSON.parse(value + '') as string[];
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
- const columnOrderFromStorage = JSON.parse(value + '') as string[];
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/index.ts CHANGED
@@ -135,3 +135,4 @@ export { useSnackbarsStore };
135
135
  export { useSystemAlertStore };
136
136
  export { useClickOutside };
137
137
  export { useField };
138
+ export { SettingsStorage };
@@ -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