@ohu-mobile/core
Version:
237 lines (236 loc) • 9.01 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.UseAsComponent = exports.Slots = exports.Basic = void 0;
var _CheckboxCircleFilled2 = _interopRequireDefault(require("@ohu-mobile/icons/lib/CheckboxCircleFilled"));
var _vue = _interopRequireDefault(require("vue"));
var _Card = _interopRequireDefault(require("../Card"));
require("../Card/style");
var _Button = _interopRequireDefault(require("../Button"));
require("../Button/style");
var _index = _interopRequireDefault(require("./index"));
require("./style");
var _Tag = _interopRequireDefault(require("../Tag"));
require("../Tag/style");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var _default = exports.default = {
title: 'Components/FeedBack/Dialog',
parameters: {
component: _index.default,
options: {
showPanel: true
}
}
};
var Basic = exports.Basic = function Basic() {
return _vue.default.extend({
render: function render() {
var _this = this;
var h = arguments[0];
return h("div", {
"style": "padding: 10px; background: #F5F5F5;"
}, [h(_Card.default, [h(_Button.default, {
"attrs": {
"inline": true,
"type": "primary",
"size": "md"
},
"on": {
"click": function click() {
return _index.default.alert({
title: 'Make sure you known it.',
parent: _this,
okBtn: 'yes',
onOk: function onOk() {
console.log('yes, i known.');
}
});
}
}
}, ["alert"])]), h(_Card.default, [h(_Button.default, {
"attrs": {
"inline": true,
"type": "primary",
"size": "md"
},
"on": {
"click": function click() {
return _index.default.confirm({
title: 'Do you known it?',
okBtn: 'yes',
cancelBtn: 'no',
onOk: function onOk() {
console.log('yes, i known.');
},
onCancel: function onCancel() {
console.log("no, i don't known.");
},
parent: _this
});
}
}
}, ["confirm"])]), h(_Card.default, [h(_Button.default, {
"attrs": {
"inline": true,
"type": "primary",
"size": "md"
},
"on": {
"click": function click() {
return _index.default.confirm({
title: 'Do you known it?',
scrollBody: true,
targetStyle: {
width: '80%'
},
content: 'I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!',
okBtn: {
text: 'yes',
handle: function handle() {
var a = _index.default.alert({
parent: _this,
title: 'Really?',
okBtn: {
text: 'Yes!',
handle: function handle() {
return a.close();
}
}
});
return false;
}
},
cancelBtn: 'no',
onCancel: function onCancel() {
console.log("no, i don't known.");
},
parent: _this
});
}
}
}, ["instance close"])]), h(_Card.default, [h(_Button.default, {
"attrs": {
"inline": true,
"type": "primary",
"size": "md"
},
"on": {
"click": function click() {
return _index.default.confirm({
title: 'Do you known it?',
content: 'I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!I love you three thousand times!',
okBtn: {
text: 'yes',
handle: function handle() {
_index.default.alert({
parent: _this,
title: 'Really?',
okBtn: 'Yes',
onOk: function onOk() {
_index.default.closeAll();
}
});
return false;
}
},
cancelBtn: 'no',
onCancel: function onCancel() {
console.log("no, i don't known.");
},
parent: _this
});
}
}
}, ["closeAll"])])]);
}
});
};
var Slots = exports.Slots = function Slots() {
return _vue.default.extend({
render: function render() {
var h = arguments[0];
return h("div", [h(_Card.default, [h(_Button.default, {
"attrs": {
"type": "primary"
},
"on": {
"click": function click() {
_index.default.alert({
render: function render() {
return h("div", ["\u8FD9\u662F\u4E2A\u5947\u602A\u7684\u5185\u5BB9"]);
}
});
}
}
}, ["render"])]), h(_Card.default, [h(_Button.default, {
"attrs": {
"type": "primary"
},
"on": {
"click": function click() {
_index.default.open({
renderTitle: function renderTitle() {
return h("div", ["\u8FD9\u662F\u4E2A\u7279\u6B8A\u7684\u6807\u9898", h(_Tag.default, ["tech"])]);
}
});
}
}
}, ["renderTitle"])])]);
}
});
};
var UseAsComponent = exports.UseAsComponent = function UseAsComponent() {
return _vue.default.extend({
data: function data() {
return {
visible: false
};
},
render: function render() {
var _this2 = this;
var h = arguments[0];
return h(_Card.default, [h(_index.default, {
"attrs": {
"closeAfterAsyncTaskCompleted": true,
"okBtn": {
text: '确定',
handle: function handle() {
return new Promise(function (resolve) {
setTimeout(function () {
resolve(true);
}, 5000);
});
}
},
"image": {
height: '180px',
src: 'http://via.placeholder.com/375X275/EEEEEE/FFFFFF'
},
"cancelBtn": "取消",
"title": "恭喜你",
"icon": {
type: _CheckboxCircleFilled2.default,
color: '#36b365'
},
"content": "您真是幸运观众啊,您获得了三等奖。最终解释权归我所有。"
},
"model": {
value: _this2.visible,
callback: function callback($$v) {
_this2.visible = $$v;
}
}
}), h(_Button.default, {
"attrs": {
"type": "primary"
},
"on": {
"click": function click() {
return _this2.visible = true;
}
}
}, ["\u6253\u5F00"])]);
}
});
};