innerken-js-utils
Advanced tools
Comparing version 1.0.14 to 1.0.15
@@ -6,2 +6,3 @@ "use strict"; | ||
}); | ||
exports.showInput = showInput; | ||
exports.showConfirm = showConfirm; | ||
@@ -48,2 +49,6 @@ exports.showConfirmAsyn = showConfirmAsyn; | ||
}); | ||
function showInput() { | ||
return _showInput.apply(this, arguments); | ||
} | ||
/** | ||
@@ -57,2 +62,26 @@ * @param {string|HTMLElement|JQuery} title | ||
function _showInput() { | ||
_showInput = _asyncToGenerator(function* () { | ||
var title = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'Please Input ...'; | ||
var inputType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'number'; | ||
var text = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; | ||
var res = yield _sweetalert.default.fire({ | ||
input: inputType, | ||
title: title, | ||
text: text, | ||
icon: 'warning', | ||
showCancelButton: true, | ||
cancelButtonText: _i18n.default.t('Zurück'), | ||
confirmButtonText: _i18n.default.t('OK') | ||
}); | ||
if (res.isConfirmed) { | ||
return res.value; | ||
} else { | ||
return null; | ||
} | ||
}); | ||
return _showInput.apply(this, arguments); | ||
} | ||
function showConfirm() { | ||
@@ -59,0 +88,0 @@ var title = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'Bist du sicher?'; |
@@ -0,1 +1,5 @@ | ||
export type SweetAlertInput = | ||
'text' | 'email' | 'password' | 'number' | 'tel' | 'range' | 'textarea' | 'select' | 'radio' | 'checkbox' | | ||
'file' | 'url'; | ||
export interface IKUtils { | ||
@@ -26,2 +30,4 @@ ValidateRules, | ||
showInput(title?: string, inputType?: SweetAlertInput, text?: string): Promise<string> | ||
checkKeyExist(item, key: string): boolean, | ||
@@ -28,0 +34,0 @@ |
{ | ||
"name": "innerken-js-utils", | ||
"version": "1.0.14", | ||
"version": "1.0.15", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -16,2 +16,19 @@ import Swal from 'sweetalert2' | ||
export async function showInput (title = 'Please Input ...', inputType = 'number', text = '') { | ||
const res = (await Swal.fire({ | ||
input: inputType, | ||
title: title, | ||
text: text, | ||
icon: 'warning', | ||
showCancelButton: true, | ||
cancelButtonText: i18n.t('Zurück'), | ||
confirmButtonText: i18n.t('OK') | ||
})) | ||
if (res.isConfirmed) { | ||
return res.value | ||
} else { | ||
return null | ||
} | ||
} | ||
/** | ||
@@ -18,0 +35,0 @@ * @param {string|HTMLElement|JQuery} title |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21706
678