fix: props losing in m-dialog

This commit is contained in:
dntzhang 2020-04-28 16:40:49 +08:00
parent db25e06062
commit d11fafa5d0
4 changed files with 10 additions and 10 deletions

View File

@ -4866,7 +4866,7 @@ Dialog.confirm = function (options) {
if (dom) {
document.body.removeChild(dom);
}
dom = omi_1.render(omi_1.h("m-dialog", { "cancel-button": { text: options.cancelText || 'Cancel' }, "confirm-button": { text: options.confirmText || 'Confirm' }, onCancel: function (_) { return onConfirm(options.cancel); }, onConfirm: function (_) { return onConfirm(options.confirm); }, show: true },
dom = omi_1.render(omi_1.h("m-dialog", { cancelButton: { text: options.cancelText || 'Cancel' }, confirmButton: { text: options.confirmText || 'Confirm' }, onCancel: function (_) { return onConfirm(options.cancel); }, onConfirm: function (_) { return onConfirm(options.confirm); }, show: true },
omi_1.h("p", { style: 'margin:0' }, options.msg)), 'body');
};
function onConfirm(callback) {
@ -4880,7 +4880,7 @@ Dialog.alert = function (options) {
if (dom) {
document.body.removeChild(dom);
}
dom = omi_1.render(omi_1.h("m-dialog", { "confirm-button": { text: options.confirmText || 'Confirm' }, onConfirm: function (_) { return onConfirm(options.confirm); }, show: true },
dom = omi_1.render(omi_1.h("m-dialog", { confirmButton: { text: options.confirmText || 'Confirm' }, onConfirm: function (_) { return onConfirm(options.confirm); }, show: true },
omi_1.h("p", { style: 'margin:0' }, options.msg)), 'body');
};
Dialog.prompt = function (options) {
@ -4888,7 +4888,7 @@ Dialog.prompt = function (options) {
document.body.removeChild(dom);
}
var ele;
dom = omi_1.render(omi_1.h("m-dialog", { "cancel-button": { text: options.cancelText || 'Cancel' }, "confirm-button": { text: options.confirmText || 'Confirm' }, onCancel: function (_) { return onConfirm(options.cancel); }, onConfirm: function (_) { return promptCallback(options.confirm, dom); }, show: true, title: options.title },
dom = omi_1.render(omi_1.h("m-dialog", { cancelButton: { text: options.cancelText || 'Cancel' }, confirmButton: { text: options.confirmText || 'Confirm' }, onCancel: function (_) { return onConfirm(options.cancel); }, onConfirm: function (_) { return promptCallback(options.confirm, dom); }, show: true, title: options.title },
omi_1.h("style", null, "\n input {\n transition: all .3s;\n }\n input:focus {\n border-bottom:1px solid " + (document.body.style.getPropertyValue('--mdc-theme-primary') || '#0072d9 ') + "!important;\n }\n "),
omi_1.h("p", { style: 'margin:10px 0 0;' }, options.subtitle),
omi_1.h("input", { style: 'width:100%;height: 30px;\n border: none;font-size:14px;\n border-bottom: 1px solid #ccc; outline: none;', ref: function (_) { return ele = _; }, type: 'text' })), 'body');

File diff suppressed because one or more lines are too long

View File

@ -91,8 +91,8 @@ Dialog.confirm = function (options) {
document.body.removeChild(dom)
}
dom = render(<m-dialog
cancel-button={{text: options.cancelText||'Cancel'}}
confirm-button={{text: options.confirmText||'Confirm'}}
cancelButton={{text: options.cancelText||'Cancel'}}
confirmButton={{text: options.confirmText||'Confirm'}}
onCancel={_=>onConfirm(options.cancel)}
onConfirm={_=>onConfirm(options.confirm)}
show={true} ><p style='margin:0'>{options.msg}</p></m-dialog>, 'body')
@ -111,7 +111,7 @@ Dialog.alert = function (options) {
document.body.removeChild(dom)
}
dom = render(<m-dialog
confirm-button={{text: options.confirmText||'Confirm'}}
confirmButton={{text: options.confirmText||'Confirm'}}
onConfirm={_=>onConfirm(options.confirm)}
show={true} ><p style='margin:0'>{options.msg}</p></m-dialog>, 'body')
}
@ -123,8 +123,8 @@ Dialog.prompt = function (options) {
}
let ele
dom = render(<m-dialog
cancel-button={{text: options.cancelText||'Cancel'}}
confirm-button={{text: options.confirmText||'Confirm'}}
cancelButton={{text: options.cancelText||'Cancel'}}
confirmButton={{text: options.confirmText||'Confirm'}}
onCancel={_=>onConfirm(options.cancel)}
onConfirm={_=>promptCallback(options.confirm,dom)}
show={true}

View File

@ -1,6 +1,6 @@
{
"name": "omim",
"version": "0.2.2",
"version": "0.2.3",
"description": "Material Design for Omi.",
"main": "index.js",
"scripts": {