@iankibetsh/shframework 4.7.3 → 4.7.5
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 +21 -1
- package/dist/library.mjs +21 -1
- package/package.json +1 -1
package/dist/library.js
CHANGED
|
@@ -239,6 +239,25 @@ async function runPlainRequest(url, message, title, data){
|
|
|
239
239
|
allowOutsideClick: () => !Swal__default["default"].isLoading()
|
|
240
240
|
})
|
|
241
241
|
}
|
|
242
|
+
async function confirmAction(callback,title,message){
|
|
243
|
+
if (typeof title === 'undefined') {
|
|
244
|
+
title = null;
|
|
245
|
+
}
|
|
246
|
+
return Swal__default["default"].fire({
|
|
247
|
+
title: title !== null ? title : 'Are you sure?',
|
|
248
|
+
html: message,
|
|
249
|
+
showCancelButton: true,
|
|
250
|
+
confirmButtonColor: '#32c787',
|
|
251
|
+
cancelButtonText: 'No, cancel',
|
|
252
|
+
confirmButtonText: 'Yes, Proceed!',
|
|
253
|
+
reverseButtons: true,
|
|
254
|
+
showLoaderOnConfirm: true,
|
|
255
|
+
preConfirm: () => {
|
|
256
|
+
return callback()
|
|
257
|
+
},
|
|
258
|
+
allowOutsideClick: () => !Swal__default["default"].isLoading()
|
|
259
|
+
})
|
|
260
|
+
}
|
|
242
261
|
|
|
243
262
|
function formatDate(date, format){
|
|
244
263
|
if (!format) {
|
|
@@ -282,6 +301,7 @@ var shRepo = {
|
|
|
282
301
|
swalSuccess,
|
|
283
302
|
swalError,
|
|
284
303
|
runPlainRequest,
|
|
304
|
+
confirmAction,
|
|
285
305
|
getMenuCount,
|
|
286
306
|
setTabCounts,
|
|
287
307
|
getShConfig,
|
|
@@ -6811,7 +6831,7 @@ return (_ctx, _cache) => {
|
|
|
6811
6831
|
"success-callback": "departmentAdded",
|
|
6812
6832
|
"current-data": department.value,
|
|
6813
6833
|
onDepartmentAdded: departmentAdded,
|
|
6814
|
-
action: "
|
|
6834
|
+
action: "sh-departments",
|
|
6815
6835
|
fields: ['name','description']
|
|
6816
6836
|
}, null, 8 /* PROPS */, ["current-data"])
|
|
6817
6837
|
]),
|
package/dist/library.mjs
CHANGED
|
@@ -227,6 +227,25 @@ async function runPlainRequest(url, message, title, data){
|
|
|
227
227
|
allowOutsideClick: () => !Swal.isLoading()
|
|
228
228
|
})
|
|
229
229
|
}
|
|
230
|
+
async function confirmAction(callback,title,message){
|
|
231
|
+
if (typeof title === 'undefined') {
|
|
232
|
+
title = null;
|
|
233
|
+
}
|
|
234
|
+
return Swal.fire({
|
|
235
|
+
title: title !== null ? title : 'Are you sure?',
|
|
236
|
+
html: message,
|
|
237
|
+
showCancelButton: true,
|
|
238
|
+
confirmButtonColor: '#32c787',
|
|
239
|
+
cancelButtonText: 'No, cancel',
|
|
240
|
+
confirmButtonText: 'Yes, Proceed!',
|
|
241
|
+
reverseButtons: true,
|
|
242
|
+
showLoaderOnConfirm: true,
|
|
243
|
+
preConfirm: () => {
|
|
244
|
+
return callback()
|
|
245
|
+
},
|
|
246
|
+
allowOutsideClick: () => !Swal.isLoading()
|
|
247
|
+
})
|
|
248
|
+
}
|
|
230
249
|
|
|
231
250
|
function formatDate(date, format){
|
|
232
251
|
if (!format) {
|
|
@@ -270,6 +289,7 @@ var shRepo = {
|
|
|
270
289
|
swalSuccess,
|
|
271
290
|
swalError,
|
|
272
291
|
runPlainRequest,
|
|
292
|
+
confirmAction,
|
|
273
293
|
getMenuCount,
|
|
274
294
|
setTabCounts,
|
|
275
295
|
getShConfig,
|
|
@@ -6799,7 +6819,7 @@ return (_ctx, _cache) => {
|
|
|
6799
6819
|
"success-callback": "departmentAdded",
|
|
6800
6820
|
"current-data": department.value,
|
|
6801
6821
|
onDepartmentAdded: departmentAdded,
|
|
6802
|
-
action: "
|
|
6822
|
+
action: "sh-departments",
|
|
6803
6823
|
fields: ['name','description']
|
|
6804
6824
|
}, null, 8 /* PROPS */, ["current-data"])
|
|
6805
6825
|
]),
|