@iankibetsh/shframework 5.0.7 → 5.0.9

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.
@@ -31,22 +31,6 @@
31
31
  opacity: 0.5;
32
32
  }
33
33
 
34
- .sh-selected-item{
35
- line-height: unset!important;
36
- }
37
- .sh-suggestion-input{
38
- padding: 0.375rem 0.75rem;
39
- }
40
- .sh-suggest{
41
- margin-bottom: 1rem;
42
- padding: 0rem 0rem;
43
- }
44
- .sh-suggest-control::after{
45
- margin-top: auto;
46
- margin-bottom: auto;
47
- margin-right: 0.255em;
48
- }
49
-
50
34
  .colored-toast.swal2-icon-success {
51
35
  background-color: #a5dc86 !important;
52
36
  }
@@ -111,6 +95,22 @@
111
95
  flex-grow: 1;
112
96
  }
113
97
 
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
@@ -166,6 +166,9 @@ function getShConfig(key = null, def = ''){
166
166
  }
167
167
 
168
168
  function showToast(message, toastType, config){
169
+ if(!message){
170
+ return
171
+ }
169
172
  const mixinConfig = {
170
173
  toast: true,
171
174
  position: 'top-end',
@@ -222,22 +225,41 @@ async function runPlainRequest(url, message, title, data){
222
225
  reverseButtons: true,
223
226
  showLoaderOnConfirm: true,
224
227
  preConfirm: () => {
225
- return shApis.doPost(url, data).then(function (response){
226
- return {
227
- response: response.data,
228
- success: true
229
- }
230
- })
228
+ return shApis.doPost(url, data)
229
+ .then(response => {
230
+ return {
231
+ response: response.data,
232
+ success: true
233
+ };
234
+ })
231
235
  .catch(error => {
232
236
  return {
233
237
  success: false,
234
238
  error: error,
235
239
  message: error.message
236
- }
237
- })
240
+ };
241
+ });
238
242
  },
239
243
  allowOutsideClick: () => !Swal__default["default"].isLoading()
240
- })
244
+ }).then((result) => {
245
+ if (result.isDismissed) {
246
+ // Handle the cancel action
247
+ throw new Error();
248
+ }
249
+
250
+ // Continue processing on confirm
251
+ if (result.isConfirmed) {
252
+ const { success, response, error } = result.value;
253
+ if (!success) {
254
+ // Handle the API error
255
+ console.error('API error:', error);
256
+ throw new Error('API request failed: ' + error.message);
257
+ }
258
+ // Handle the successful response
259
+ return response;
260
+ }
261
+ });
262
+
241
263
  }
242
264
  async function confirmAction(title,message){
243
265
  if (typeof title === 'undefined') {
@@ -5974,6 +5996,14 @@ vue.watch(()=>props.tabCounts, () => {
5974
5996
  resetTabCounts();
5975
5997
  });
5976
5998
 
5999
+ vue.watch(()=>route.path,()=>{
6000
+ route.fullPath.split('/');
6001
+ if (!tabExistsInUrl()) {
6002
+ resetTabCounts();
6003
+ }
6004
+
6005
+ });
6006
+
5977
6007
  vue.watch(()=>route.path,(newPath)=>{
5978
6008
  path.value = newPath;
5979
6009
  });
package/dist/library.mjs CHANGED
@@ -154,6 +154,9 @@ function getShConfig(key = null, def = ''){
154
154
  }
155
155
 
156
156
  function showToast(message, toastType, config){
157
+ if(!message){
158
+ return
159
+ }
157
160
  const mixinConfig = {
158
161
  toast: true,
159
162
  position: 'top-end',
@@ -210,22 +213,41 @@ async function runPlainRequest(url, message, title, data){
210
213
  reverseButtons: true,
211
214
  showLoaderOnConfirm: true,
212
215
  preConfirm: () => {
213
- return shApis.doPost(url, data).then(function (response){
214
- return {
215
- response: response.data,
216
- success: true
217
- }
218
- })
216
+ return shApis.doPost(url, data)
217
+ .then(response => {
218
+ return {
219
+ response: response.data,
220
+ success: true
221
+ };
222
+ })
219
223
  .catch(error => {
220
224
  return {
221
225
  success: false,
222
226
  error: error,
223
227
  message: error.message
224
- }
225
- })
228
+ };
229
+ });
226
230
  },
227
231
  allowOutsideClick: () => !Swal.isLoading()
228
- })
232
+ }).then((result) => {
233
+ if (result.isDismissed) {
234
+ // Handle the cancel action
235
+ throw new Error();
236
+ }
237
+
238
+ // Continue processing on confirm
239
+ if (result.isConfirmed) {
240
+ const { success, response, error } = result.value;
241
+ if (!success) {
242
+ // Handle the API error
243
+ console.error('API error:', error);
244
+ throw new Error('API request failed: ' + error.message);
245
+ }
246
+ // Handle the successful response
247
+ return response;
248
+ }
249
+ });
250
+
229
251
  }
230
252
  async function confirmAction(title,message){
231
253
  if (typeof title === 'undefined') {
@@ -5962,6 +5984,14 @@ watch(()=>props.tabCounts, () => {
5962
5984
  resetTabCounts();
5963
5985
  });
5964
5986
 
5987
+ watch(()=>route.path,()=>{
5988
+ route.fullPath.split('/');
5989
+ if (!tabExistsInUrl()) {
5990
+ resetTabCounts();
5991
+ }
5992
+
5993
+ });
5994
+
5965
5995
  watch(()=>route.path,(newPath)=>{
5966
5996
  path.value = newPath;
5967
5997
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iankibetsh/shframework",
3
- "version": "5.0.7",
3
+ "version": "5.0.9",
4
4
  "description": "Vue library for handling laravel backend",
5
5
  "main": "dist/library.js",
6
6
  "module": "dist/library.mjs",