@iankibetsh/shframework 4.6.8 → 4.7.0

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.
@@ -63,6 +63,22 @@
63
63
  opacity: 0.5;
64
64
  }
65
65
 
66
+ .sh-selected-item{
67
+ line-height: unset!important;
68
+ }
69
+ .sh-suggestion-input{
70
+ padding: 0.375rem 0.75rem;
71
+ }
72
+ .sh-suggest{
73
+ margin-bottom: 1rem;
74
+ padding: 0rem 0rem;
75
+ }
76
+ .sh-suggest-control::after{
77
+ margin-top: auto;
78
+ margin-bottom: auto;
79
+ margin-right: 0.255em;
80
+ }
81
+
66
82
  .permissions-main {
67
83
  background: #edeff2;
68
84
  }
@@ -95,22 +111,6 @@
95
111
  flex-grow: 1;
96
112
  }
97
113
 
98
- .sh-selected-item{
99
- line-height: unset!important;
100
- }
101
- .sh-suggestion-input{
102
- padding: 0.375rem 0.75rem;
103
- }
104
- .sh-suggest{
105
- margin-bottom: 1rem;
106
- padding: 0rem 0rem;
107
- }
108
- .sh-suggest-control::after{
109
- margin-top: auto;
110
- margin-bottom: auto;
111
- margin-right: 0.255em;
112
- }
113
-
114
114
  .callout{
115
115
  --bs-link-color-rgb: 110,168,254;
116
116
  --bs-code-color: #e685b5;
package/dist/library.js CHANGED
@@ -6266,13 +6266,15 @@ const useAppStore = pinia.defineStore('sh-app',{
6266
6266
  }
6267
6267
  },
6268
6268
  actions: {
6269
- refreshPage () {
6270
- this.refreshKey++;
6269
+ refreshPage (timeout=0) {
6270
+ setTimeout(()=>{
6271
+ this.refreshKey++;
6272
+ },timeout);
6273
+
6271
6274
  return true
6272
6275
  },
6273
- refresh () {
6274
- this.refreshKey++;
6275
- return true
6276
+ refresh (timeout=0) {
6277
+ this.refreshPage(timeout);
6276
6278
  },
6277
6279
  reload () {
6278
6280
  this.refreshKey++;
@@ -7354,32 +7356,29 @@ const useShFetch = (url, path, cacheKey) => {
7354
7356
  status.value = 'loading';
7355
7357
  if (cacheKey && shStorage.getItem(cacheKey)) {
7356
7358
  data.value = shStorage.getItem(cacheKey);
7359
+ }
7360
+ shApis.doGet(dataUrl ?? url).then(response => {
7357
7361
  status.value = 'success';
7358
- loading.value = false;
7359
- } else {
7360
- shApis.doGet(dataUrl ?? url).then(response => {
7361
- status.value = 'success';
7362
- let res = response.data;
7363
- if (path) {
7364
- let pathArr = path.split('.');
7365
- for (let i = 0; i < pathArr.length; i++) {
7366
- res = res[pathArr[i]];
7367
- }
7368
- }
7369
- data.value = res;
7370
- if (cacheKey) {
7371
- shStorage.setItem(cacheKey, res);
7362
+ let res = response.data;
7363
+ if (path) {
7364
+ let pathArr = path.split('.');
7365
+ for (let i = 0; i < pathArr.length; i++) {
7366
+ res = res[pathArr[i]];
7372
7367
  }
7368
+ }
7369
+ data.value = res;
7370
+ if (cacheKey) {
7371
+ shStorage.setItem(cacheKey, res);
7372
+ }
7373
+ })
7374
+ .catch(res => {
7375
+ status.value = 'error';
7376
+ error.value = res.message ? res.message : (res.error ? res.error : 'An unexpected error occurred');
7377
+ shRepo.showToast(error.value, 'error');
7373
7378
  })
7374
- .catch(res => {
7375
- status.value = 'error';
7376
- error.value = res.message ? res.message : (res.error ? res.error : 'An unexpected error occurred');
7377
- shRepo.showToast(error.value, 'error');
7378
- })
7379
- .finally(() => {
7380
- loading.value = false;
7381
- });
7382
- }
7379
+ .finally(() => {
7380
+ loading.value = false;
7381
+ });
7383
7382
  };
7384
7383
 
7385
7384
  return {
package/dist/library.mjs CHANGED
@@ -6254,13 +6254,15 @@ const useAppStore = defineStore('sh-app',{
6254
6254
  }
6255
6255
  },
6256
6256
  actions: {
6257
- refreshPage () {
6258
- this.refreshKey++;
6257
+ refreshPage (timeout=0) {
6258
+ setTimeout(()=>{
6259
+ this.refreshKey++;
6260
+ },timeout);
6261
+
6259
6262
  return true
6260
6263
  },
6261
- refresh () {
6262
- this.refreshKey++;
6263
- return true
6264
+ refresh (timeout=0) {
6265
+ this.refreshPage(timeout);
6264
6266
  },
6265
6267
  reload () {
6266
6268
  this.refreshKey++;
@@ -7342,32 +7344,29 @@ const useShFetch = (url, path, cacheKey) => {
7342
7344
  status.value = 'loading';
7343
7345
  if (cacheKey && shStorage.getItem(cacheKey)) {
7344
7346
  data.value = shStorage.getItem(cacheKey);
7347
+ }
7348
+ shApis.doGet(dataUrl ?? url).then(response => {
7345
7349
  status.value = 'success';
7346
- loading.value = false;
7347
- } else {
7348
- shApis.doGet(dataUrl ?? url).then(response => {
7349
- status.value = 'success';
7350
- let res = response.data;
7351
- if (path) {
7352
- let pathArr = path.split('.');
7353
- for (let i = 0; i < pathArr.length; i++) {
7354
- res = res[pathArr[i]];
7355
- }
7356
- }
7357
- data.value = res;
7358
- if (cacheKey) {
7359
- shStorage.setItem(cacheKey, res);
7350
+ let res = response.data;
7351
+ if (path) {
7352
+ let pathArr = path.split('.');
7353
+ for (let i = 0; i < pathArr.length; i++) {
7354
+ res = res[pathArr[i]];
7360
7355
  }
7356
+ }
7357
+ data.value = res;
7358
+ if (cacheKey) {
7359
+ shStorage.setItem(cacheKey, res);
7360
+ }
7361
+ })
7362
+ .catch(res => {
7363
+ status.value = 'error';
7364
+ error.value = res.message ? res.message : (res.error ? res.error : 'An unexpected error occurred');
7365
+ shRepo.showToast(error.value, 'error');
7361
7366
  })
7362
- .catch(res => {
7363
- status.value = 'error';
7364
- error.value = res.message ? res.message : (res.error ? res.error : 'An unexpected error occurred');
7365
- shRepo.showToast(error.value, 'error');
7366
- })
7367
- .finally(() => {
7368
- loading.value = false;
7369
- });
7370
- }
7367
+ .finally(() => {
7368
+ loading.value = false;
7369
+ });
7371
7370
  };
7372
7371
 
7373
7372
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iankibetsh/shframework",
3
- "version": "4.6.8",
3
+ "version": "4.7.0",
4
4
  "description": "Vue library for handling laravel backend",
5
5
  "main": "dist/library.js",
6
6
  "module": "dist/library.mjs",
@@ -22,7 +22,6 @@
22
22
  "author": "",
23
23
  "license": "ISC",
24
24
  "peerDependencies": {
25
- "axios": "^0.27.2",
26
25
  "bootstrap": "^5.3.0-alpha1",
27
26
  "bootstrap-icons": "^1.9.1",
28
27
  "lodash": "^4.17.21",