@iankibetsh/shframework 5.5.1 → 5.5.3

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/library.js CHANGED
@@ -280,13 +280,16 @@ const showModal = modalId => {
280
280
  };
281
281
 
282
282
  const hideModal = modalId => {
283
- const modalElement = document.getElementById(modalId);
284
- const button = modalElement.querySelector('.sh-modal-close');
285
- if(button){
286
- button.click();
287
- } else {
288
- const modal = new bootstrap.Modal(modalElement);
289
- modal.hide();
283
+ const cleanedId = modalId.replace('#','');
284
+ const modalElement = document.getElementById(cleanedId);
285
+ if(modalElement){
286
+ const button = modalElement.querySelector('.sh-modal-close');
287
+ if(button){
288
+ button.click();
289
+ } else {
290
+ const modal = new bootstrap.Modal(modalElement);
291
+ modal.hide();
292
+ }
290
293
  }
291
294
  };
292
295
 
@@ -3476,6 +3479,10 @@ shFormElementClasses.value = vue.inject('shFormElementClasses');
3476
3479
  const shAutoForm = vue.ref(null);
3477
3480
  const closeModal = e => {
3478
3481
  setTimeout(() => {
3482
+ if(!shAutoForm.value){
3483
+ // when form not available, most probably after redirection
3484
+ return
3485
+ }
3479
3486
  const modal = shAutoForm.value.closest('.modal-dialog');
3480
3487
  if (modal) {
3481
3488
  const closeBtn = modal.querySelector('[data-bs-dismiss="modal"]');
@@ -3837,7 +3844,7 @@ var script$o = {
3837
3844
  'country_code',
3838
3845
  'submitBtnClass',
3839
3846
  'fields',
3840
- 'columns', 'placeholders', 'field_permissions', 'retainDataAfterSubmission',
3847
+ 'columns', 'placeholders', 'field_permissions', 'retainDataAfterSubmission','retainModal',
3841
3848
  'currentData', 'actionLabel', 'fillSelects', 'phones', 'successCallback',
3842
3849
  'failedCallback', 'labels', 'editors',
3843
3850
  'datePickers',
package/dist/library.mjs CHANGED
@@ -268,13 +268,16 @@ const showModal = modalId => {
268
268
  };
269
269
 
270
270
  const hideModal = modalId => {
271
- const modalElement = document.getElementById(modalId);
272
- const button = modalElement.querySelector('.sh-modal-close');
273
- if(button){
274
- button.click();
275
- } else {
276
- const modal = new Modal(modalElement);
277
- modal.hide();
271
+ const cleanedId = modalId.replace('#','');
272
+ const modalElement = document.getElementById(cleanedId);
273
+ if(modalElement){
274
+ const button = modalElement.querySelector('.sh-modal-close');
275
+ if(button){
276
+ button.click();
277
+ } else {
278
+ const modal = new Modal(modalElement);
279
+ modal.hide();
280
+ }
278
281
  }
279
282
  };
280
283
 
@@ -3464,6 +3467,10 @@ shFormElementClasses.value = inject('shFormElementClasses');
3464
3467
  const shAutoForm = ref(null);
3465
3468
  const closeModal = e => {
3466
3469
  setTimeout(() => {
3470
+ if(!shAutoForm.value){
3471
+ // when form not available, most probably after redirection
3472
+ return
3473
+ }
3467
3474
  const modal = shAutoForm.value.closest('.modal-dialog');
3468
3475
  if (modal) {
3469
3476
  const closeBtn = modal.querySelector('[data-bs-dismiss="modal"]');
@@ -3825,7 +3832,7 @@ var script$o = {
3825
3832
  'country_code',
3826
3833
  'submitBtnClass',
3827
3834
  'fields',
3828
- 'columns', 'placeholders', 'field_permissions', 'retainDataAfterSubmission',
3835
+ 'columns', 'placeholders', 'field_permissions', 'retainDataAfterSubmission','retainModal',
3829
3836
  'currentData', 'actionLabel', 'fillSelects', 'phones', 'successCallback',
3830
3837
  'failedCallback', 'labels', 'editors',
3831
3838
  'datePickers',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iankibetsh/shframework",
3
- "version": "5.5.1",
3
+ "version": "5.5.3",
4
4
  "description": "Vue library for handling laravel backend",
5
5
  "main": "dist/library.js",
6
6
  "module": "dist/library.mjs",