innerken-js-utils
Advanced tools
Comparing version 1.0.17 to 1.0.18
@@ -14,2 +14,3 @@ "use strict"; | ||
exports.hideLoading = hideLoading; | ||
exports.init = init; | ||
exports.play = play; | ||
@@ -29,3 +30,2 @@ exports.removeElement = removeElement; | ||
var _sweetalert = _interopRequireDefault(require("sweetalert2")); | ||
var _i18n = _interopRequireDefault(require("@/i18n")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -45,2 +45,6 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } | ||
}); | ||
var i18n = key => key; | ||
function init(i) { | ||
i18n = i; | ||
} | ||
function showInput() { | ||
@@ -66,4 +70,4 @@ return _showInput.apply(this, arguments); | ||
showCancelButton: true, | ||
cancelButtonText: _i18n.default.t('Zurück'), | ||
confirmButtonText: _i18n.default.t('OK') | ||
cancelButtonText: i18n.t('Zurück'), | ||
confirmButtonText: i18n.t('OK') | ||
}); | ||
@@ -90,4 +94,4 @@ if (res.isConfirmed) { | ||
cancelButtonColor: '#d33', | ||
cancelButtonText: _i18n.default.t('Zurück'), | ||
confirmButtonText: _i18n.default.t('OK') | ||
cancelButtonText: i18n.t('Zurück'), | ||
confirmButtonText: i18n.t('OK') | ||
}).then(result => { | ||
@@ -114,4 +118,4 @@ if (result.value) { | ||
cancelButtonColor: '#d33', | ||
cancelButtonText: _i18n.default.t('Zurück'), | ||
confirmButtonText: _i18n.default.t('OK') | ||
cancelButtonText: i18n.t('Zurück'), | ||
confirmButtonText: i18n.t('OK') | ||
}); | ||
@@ -149,3 +153,3 @@ } | ||
_sweetalert.default.fire({ | ||
title: _i18n.default.t('Geladen'), | ||
title: i18n.t('Geladen'), | ||
allowOutsideClick: () => canCancel, | ||
@@ -355,4 +359,5 @@ allowEscapeKey: canCancel | ||
showConfirmAsyn, | ||
showInput | ||
showInput, | ||
init | ||
}; | ||
exports.default = _default; |
@@ -45,2 +45,3 @@ export type SweetAlertInput = | ||
wait(time): Promise<any> //not sure | ||
init(i18n) | ||
} | ||
@@ -47,0 +48,0 @@ |
{ | ||
"name": "innerken-js-utils", | ||
"version": "1.0.17", | ||
"version": "1.0.18", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
import Swal from 'sweetalert2' | ||
import i18n from '@/i18n' | ||
@@ -16,2 +15,8 @@ const Toast = Swal.mixin({ | ||
let i18n = (key) => key | ||
export function init (i) { | ||
i18n = i | ||
} | ||
export async function showInput (title = 'Please Input ...', inputType = 'number', text = '') { | ||
@@ -313,2 +318,3 @@ const res = (await Swal.fire({ | ||
showInput, | ||
init, | ||
} |
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
22665
697