diff --git a/main.js b/main.js index e4142d1..2ad9bbf 100644 --- a/main.js +++ b/main.js @@ -66,7 +66,7 @@ eval("\nvar __assign = (this && this.__assign) || function () {\n __assign = \*****************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { -eval("\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nexports.__esModule = true;\n__exportStar(__webpack_require__(/*! ./fn */ \"../dist/data/fn.js\"), exports);\n__exportStar(__webpack_require__(/*! ./builder */ \"../dist/data/builder.js\"), exports);\n__exportStar(__webpack_require__(/*! ./lens */ \"../dist/data/lens.js\"), exports);\n\n\n//# sourceURL=webpack:///../dist/data/index.js?"); +eval("\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nexports.__esModule = true;\n__exportStar(__webpack_require__(/*! ./fn */ \"../dist/data/fn.js\"), exports);\n__exportStar(__webpack_require__(/*! ./builder */ \"../dist/data/builder.js\"), exports);\n__exportStar(__webpack_require__(/*! ./lens */ \"../dist/data/lens.js\"), exports);\n__exportStar(__webpack_require__(/*! ./form */ \"../dist/data/form.js\"), exports);\n__exportStar(__webpack_require__(/*! ./validate */ \"../dist/data/validate.js\"), exports);\n\n\n//# sourceURL=webpack:///../dist/data/index.js?"); /***/ }), @@ -366,7 +366,7 @@ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _argument \*******************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { -eval("\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nexports.__esModule = true;\nexports.ModalMask = exports.alertText = exports.alert = exports.confirmTextAsync = exports.confirmText = exports.confirmAsync = exports.confirm = exports.modal = void 0;\nvar m = __webpack_require__(/*! mithril */ \"../node_modules/mithril/index.js\");\nvar lens_1 = __webpack_require__(/*! ../data/lens */ \"../dist/data/lens.js\");\nvar purify_ts_1 = __webpack_require__(/*! purify-ts */ \"../node_modules/purify-ts/index.js\");\nvar Modal = __webpack_require__(/*! ../element/modal */ \"../dist/element/modal.js\");\nvar modalState = (0, lens_1.mutable)([]);\nvar modal = function (widget) {\n return new Promise(function (resolve) {\n var modalAttr = {\n connectResolve: resolve\n };\n var w = {\n widget: widget,\n attr: modalAttr\n };\n var s = modalState.get();\n modalState.set(__spreadArray([\n w\n ], s, true));\n m.redraw();\n });\n};\nexports.modal = modal;\nvar renderModal = function (state) {\n return purify_ts_1.List.uncons(state)\n .map(function (t) {\n var w = t.fst();\n var ws = t.snd();\n var attr = __assign(__assign({}, w.attr), { connectResolve: function (x) {\n w.attr.connectResolve(x);\n modalState.set(ws);\n } });\n return m(w.widget, attr);\n });\n};\nvar confirmState = (0, lens_1.mutable)([]);\nvar confirm = function (attr) {\n return new Promise(function (resolve) {\n var s = {\n attr: attr,\n resolve: resolve\n };\n var xs = confirmState.get();\n confirmState.set(__spreadArray([s], xs, true));\n m.redraw();\n });\n};\nexports.confirm = confirm;\nvar confirmAsync = function (attr) {\n return purify_ts_1.MaybeAsync.fromPromise(function () { return (0, exports.confirm)(attr); });\n};\nexports.confirmAsync = confirmAsync;\nvar confirmText = function (msg) {\n return (0, exports.confirm)({ content: msg });\n};\nexports.confirmText = confirmText;\nvar confirmTextAsync = function (msg) {\n return purify_ts_1.MaybeAsync.fromPromise(function () { return (0, exports.confirmText)(msg); });\n};\nexports.confirmTextAsync = confirmTextAsync;\nvar renderConfirm = function (state) {\n return purify_ts_1.List.uncons(state)\n .map(function (t) {\n var w = t.fst();\n var ws = t.snd();\n var confirmAttr = {\n size: w.attr.size,\n fullscreen: w.attr.fullscreen,\n isInvert: w.attr.isInvert,\n title: w.attr.title,\n positiveText: w.attr.positiveText,\n negativeText: w.attr.negativeText,\n connectResolve: function (value) {\n confirmState.set(ws);\n w.resolve(value);\n }\n };\n return m(Modal.Confirm, confirmAttr, w.attr.content);\n });\n};\n;\nvar alertState = (0, lens_1.mutable)([]);\nvar alert = function (attr) {\n return new Promise(function (resolve) {\n var s = {\n attr: attr,\n resolve: resolve\n };\n var xs = alertState.get();\n alertState.set(__spreadArray([s], xs, true));\n });\n};\nexports.alert = alert;\nvar alertText = function (msg) {\n return (0, exports.alert)({ content: msg });\n};\nexports.alertText = alertText;\nvar renderAlert = function (state) {\n return purify_ts_1.List.uncons(state)\n .map(function (t) {\n var w = t.fst();\n var ws = t.snd();\n var attr = {\n size: w.attr.size,\n fullscreen: w.attr.fullscreen,\n isInvert: w.attr.isInvert,\n title: w.attr.title,\n positiveText: w.attr.positiveText,\n connectResolve: function () {\n alertState.set(ws);\n w.resolve();\n }\n };\n return m(Modal.Alert, attr, w.attr.content);\n });\n};\nexports.ModalMask = {\n view: function () {\n var modalWidget = renderModal(modalState.get());\n var confirmWidget = renderConfirm(confirmState.get());\n var alertWidget = renderAlert(alertState.get());\n return alertWidget\n .alt(confirmWidget)\n .alt(modalWidget)\n .map(function (_) { return m(Modal.ModalDimmer, [\n modalWidget.extract(),\n confirmWidget.extract(),\n alertWidget.extract()\n ]); })\n .extract();\n }\n};\n\n\n//# sourceURL=webpack:///../dist/module/modal.js?"); +eval("\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nexports.__esModule = true;\nexports.ModalMask = exports.alertText = exports.alert = exports.confirmTextAsync = exports.confirmText = exports.confirmAsync = exports.confirm = exports.modal = void 0;\nvar m = __webpack_require__(/*! mithril */ \"../node_modules/mithril/index.js\");\nvar lens_1 = __webpack_require__(/*! ../data/lens */ \"../dist/data/lens.js\");\nvar purify_ts_1 = __webpack_require__(/*! purify-ts */ \"../node_modules/purify-ts/index.js\");\nvar Modal = __webpack_require__(/*! ../element/modal */ \"../dist/element/modal.js\");\nvar modalState = (0, lens_1.mutable)([]);\nvar modal = function (widget) {\n return new Promise(function (resolve) {\n var modalAttr = {\n connectResolve: resolve\n };\n var w = {\n widget: widget,\n attr: modalAttr\n };\n var s = modalState.get();\n modalState.set(__spreadArray([\n w\n ], s, true));\n m.redraw();\n });\n};\nexports.modal = modal;\nvar renderModal = function (state) {\n return purify_ts_1.List.uncons(state)\n .map(function (t) {\n var w = t.fst();\n var ws = t.snd();\n var attr = __assign(__assign({}, w.attr), { connectResolve: function (x) {\n w.attr.connectResolve(x);\n modalState.set(ws);\n } });\n return m(w.widget, attr);\n });\n};\nvar confirmState = (0, lens_1.mutable)([]);\nvar confirm = function (attr) {\n return new Promise(function (resolve) {\n var s = {\n attr: attr,\n resolve: resolve\n };\n var xs = confirmState.get();\n confirmState.set(__spreadArray([s], xs, true));\n m.redraw();\n });\n};\nexports.confirm = confirm;\nvar confirmAsync = function (attr) {\n return purify_ts_1.MaybeAsync.fromPromise(function () { return (0, exports.confirm)(attr); });\n};\nexports.confirmAsync = confirmAsync;\nvar confirmText = function (msg) {\n return (0, exports.confirm)({ content: msg });\n};\nexports.confirmText = confirmText;\nvar confirmTextAsync = function (msg) {\n return purify_ts_1.MaybeAsync.fromPromise(function () { return (0, exports.confirmText)(msg); });\n};\nexports.confirmTextAsync = confirmTextAsync;\nvar renderConfirm = function (state) {\n return purify_ts_1.List.uncons(state)\n .map(function (t) {\n var w = t.fst();\n var ws = t.snd();\n var confirmAttr = {\n size: w.attr.size,\n fullscreen: w.attr.fullscreen,\n isInvert: w.attr.isInvert,\n title: w.attr.title,\n positiveText: w.attr.positiveText,\n negativeText: w.attr.negativeText,\n connectResolve: function (value) {\n confirmState.set(ws);\n w.resolve(value);\n }\n };\n return m(Modal.Confirm, confirmAttr, w.attr.content);\n });\n};\n;\nvar alertState = (0, lens_1.mutable)([]);\nvar alert = function (attr) {\n return new Promise(function (resolve) {\n var s = {\n attr: attr,\n resolve: resolve\n };\n var xs = alertState.get();\n alertState.set(__spreadArray([s], xs, true));\n m.redraw();\n });\n};\nexports.alert = alert;\nvar alertText = function (msg) {\n return (0, exports.alert)({ content: msg });\n};\nexports.alertText = alertText;\nvar renderAlert = function (state) {\n return purify_ts_1.List.uncons(state)\n .map(function (t) {\n var w = t.fst();\n var ws = t.snd();\n var attr = {\n size: w.attr.size,\n fullscreen: w.attr.fullscreen,\n isInvert: w.attr.isInvert,\n title: w.attr.title,\n positiveText: w.attr.positiveText,\n connectResolve: function () {\n alertState.set(ws);\n w.resolve();\n }\n };\n return m(Modal.Alert, attr, w.attr.content);\n });\n};\nexports.ModalMask = {\n view: function () {\n var modalWidget = renderModal(modalState.get());\n var confirmWidget = renderConfirm(confirmState.get());\n var alertWidget = renderAlert(alertState.get());\n return alertWidget\n .alt(confirmWidget)\n .alt(modalWidget)\n .map(function (_) { return m(Modal.ModalDimmer, [\n modalWidget.extract(),\n confirmWidget.extract(),\n alertWidget.extract()\n ]); })\n .extract();\n }\n};\n\n\n//# sourceURL=webpack:///../dist/module/modal.js?"); /***/ }), @@ -896,7 +896,7 @@ eval("\nexports.__esModule = true;\nvar fn_1 = __webpack_require__(/*! drifloon/ \***************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { -eval("\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nexports.__esModule = true;\nvar m = __webpack_require__(/*! mithril */ \"../node_modules/mithril/index.js\");\nvar button_1 = __webpack_require__(/*! drifloon/element/button */ \"../dist/element/button.js\");\nvar header_1 = __webpack_require__(/*! drifloon/element/header */ \"../dist/element/header.js\");\nvar var_1 = __webpack_require__(/*! drifloon/data/var */ \"../dist/data/var.js\");\nvar modal_1 = __webpack_require__(/*! drifloon/module/modal */ \"../dist/module/modal.js\");\nvar modal_2 = __webpack_require__(/*! drifloon/widget/modal */ \"../dist/widget/modal.js\");\nvar ConfirmS = {\n view: function () {\n var attr1 = {\n title: \"新式标题\",\n content: m(\"div.label.ui.orange\", \"理论上,这里写上任何文本。\")\n };\n var onclick1 = function () {\n (0, modal_1.confirmAsync)(attr1)\n .caseOf({\n Just: function (_) { return (0, modal_1.alertText)(\"你点了确定!\"); },\n Nothing: function () { return (0, modal_1.alertText)(\"你点了取消!\"); }\n });\n };\n return m(button_1.Button, { color: var_1.Color.Green, connectClick: onclick1 }, \"提示\");\n }\n};\nvar AlertModalHere = {\n view: function (_a) {\n var attrs = _a.attrs;\n var modalAttr = __assign(__assign({}, attrs), { title: \"对话框演示\" });\n return m(modal_2.Modal, modalAttr, [\n m(button_1.Button, { connectClick: function () { return console.log(\"你看见我了\"); } }, \"alert\"),\n m(button_1.Button, { connectClick: function () { return console.info(\"你看见我了\"); } }, \"confirm\")\n ]);\n }\n};\nvar ModalS = {\n view: function () {\n var openModal = function () { return (0, modal_1.modal)(AlertModalHere); };\n return m(\"div\", [\n m(button_1.Button, { connectClick: openModal }, \"打开对话框\")\n ]);\n }\n};\nvar Main = {\n view: function (_) { return m(\"div.ui.teal.segment\", [\n m(header_1.Header, { isDivid: true, size: var_1.Size.Huge }, \"对话框\"),\n m(header_1.Header, { size: var_1.Size.Large }, \"提示\"),\n m(ConfirmS),\n m(header_1.Header, { size: var_1.Size.Large }, \"混合使用\"),\n m(ModalS)\n ]); }\n};\nexports[\"default\"] = Main;\n\n\n//# sourceURL=webpack:///./src/page/modal.ts?"); +eval("\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nexports.__esModule = true;\nvar m = __webpack_require__(/*! mithril */ \"../node_modules/mithril/index.js\");\nvar button_1 = __webpack_require__(/*! drifloon/element/button */ \"../dist/element/button.js\");\nvar header_1 = __webpack_require__(/*! drifloon/element/header */ \"../dist/element/header.js\");\nvar var_1 = __webpack_require__(/*! drifloon/data/var */ \"../dist/data/var.js\");\nvar modal_1 = __webpack_require__(/*! drifloon/module/modal */ \"../dist/module/modal.js\");\nvar modal_2 = __webpack_require__(/*! drifloon/widget/modal */ \"../dist/widget/modal.js\");\nvar ConfirmS = {\n view: function () {\n var attr1 = {\n title: \"新式标题\",\n content: m(\"div.label.ui.orange\", \"理论上,这里写上任何文本。\")\n };\n var onclick1 = function () {\n (0, modal_1.confirmAsync)(attr1)\n .caseOf({\n Just: function (_) { return (0, modal_1.alertText)(\"你点了确定!\"); },\n Nothing: function () { return (0, modal_1.alertText)(\"你点了取消!\"); }\n });\n };\n return m(button_1.Button, { color: var_1.Color.Green, connectClick: onclick1 }, \"提示\");\n }\n};\nvar AlertModalHere = {\n view: function (_a) {\n var attrs = _a.attrs;\n var modalAttr = __assign(__assign({}, attrs), { title: \"对话框演示\" });\n return m(modal_2.Modal, modalAttr, [\n m(button_1.Button, { connectClick: function () { return (0, modal_1.alertText)(\"你看见我了\"); } }, \"alert\"),\n m(button_1.Button, { connectClick: function () { return (0, modal_1.confirmText)(\"你看见我了\"); } }, \"confirm\")\n ]);\n }\n};\nvar ModalS = {\n view: function () {\n var openModal = function () { return (0, modal_1.modal)(AlertModalHere); };\n return m(\"div\", [\n m(button_1.Button, { connectClick: openModal }, \"打开对话框\")\n ]);\n }\n};\nvar Main = {\n view: function (_) { return m(\"div.ui.teal.segment\", [\n m(header_1.Header, { isDivid: true, size: var_1.Size.Huge }, \"对话框\"),\n m(header_1.Header, { size: var_1.Size.Large }, \"提示\"),\n m(ConfirmS),\n m(header_1.Header, { size: var_1.Size.Large }, \"混合使用\"),\n m(ModalS)\n ]); }\n};\nexports[\"default\"] = Main;\n\n\n//# sourceURL=webpack:///./src/page/modal.ts?"); /***/ }),