@iankibetsh/shframework 4.7.4 → 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 +20 -0
- package/dist/library.mjs +20 -0
- 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,
|
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,
|