fantasia-ui 0.2.48 → 0.2.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fantasia-ui.css +161 -161
- package/dist/fantasia-ui.es.js +266 -260
- package/dist/fantasia-ui.umd.js +265 -259
- package/dist/types/global.d.ts +4 -1
- package/dist/types/packages/components/index.d.ts +4 -0
- package/dist/types/volar.d.ts +4 -1
- package/package.json +5 -2
package/dist/fantasia-ui.es.js
CHANGED
|
@@ -38,7 +38,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
38
38
|
});
|
|
39
39
|
};
|
|
40
40
|
import { defineComponent, computed, createElementBlock, openBlock, normalizeStyle, unref, renderSlot, normalizeClass, createCommentVNode, Fragment, renderList, createElementVNode, toDisplayString, ref, watch, createVNode, withDirectives, Transition, withCtx, vShow, mergeModels, useModel, inject, createBlock, resolveDynamicComponent, nextTick, onUnmounted, Teleport, withModifiers, withKeys, isRef, vModelText, createTextVNode, TransitionGroup, useSlots, provide, onMounted, readonly, onBeforeUnmount, reactive, toRefs, createStaticVNode, render, h } from "vue";
|
|
41
|
-
import { CloseCircleOutline, EyeOutline, EyeOffOutline, StarOutline, StarHalf, Star, ChevronDownOutline, ChevronBackOutline, EllipsisHorizontal, ChevronForwardOutline, CloseCircle, Close, Person, InformationCircleOutline, WarningOutline, AlertCircleOutline, CheckmarkCircleOutline, CloudUpload, DocumentOutline, RemoveOutline, AddOutline, ChevronUpOutline, InformationCircle, AlertCircle, CheckmarkCircle,
|
|
41
|
+
import { CloseCircleOutline, EyeOutline, EyeOffOutline, StarOutline, StarHalf, Star, ChevronDownOutline, ChevronBackOutline, EllipsisHorizontal, ChevronForwardOutline, CloseCircle, Close, Person, InformationCircleOutline, WarningOutline, AlertCircleOutline, CheckmarkCircleOutline, CloudUpload, DocumentOutline, RemoveOutline, AddOutline, ChevronUpOutline, InformationCircle, AlertCircle, CheckmarkCircle, CloseOutline, Warning } from "@vicons/ionicons5";
|
|
42
42
|
import { useEventListener } from "@vueuse/core";
|
|
43
43
|
const _sfc_main$Q = /* @__PURE__ */ defineComponent({
|
|
44
44
|
__name: "FIcon",
|
|
@@ -4435,8 +4435,184 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
4435
4435
|
}
|
|
4436
4436
|
});
|
|
4437
4437
|
const FSteps = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-a97e1683"]]);
|
|
4438
|
-
const _hoisted_1$2 = {
|
|
4438
|
+
const _hoisted_1$2 = {
|
|
4439
|
+
key: 0,
|
|
4440
|
+
class: "f-dialog__icon"
|
|
4441
|
+
};
|
|
4442
|
+
const _hoisted_2$1 = { class: "f-dialog__title" };
|
|
4443
|
+
const _hoisted_3$1 = { class: "f-dialog__body" };
|
|
4444
|
+
const _hoisted_4 = { key: 0 };
|
|
4445
|
+
const _hoisted_5 = {
|
|
4446
|
+
key: 2,
|
|
4447
|
+
class: "f-dialog__footer"
|
|
4448
|
+
};
|
|
4439
4449
|
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
4450
|
+
__name: "FDialog",
|
|
4451
|
+
props: /* @__PURE__ */ mergeModels({
|
|
4452
|
+
title: { default: "提示" },
|
|
4453
|
+
content: {},
|
|
4454
|
+
width: { default: "500px" },
|
|
4455
|
+
type: { default: "default" },
|
|
4456
|
+
confirmText: { default: "确定" },
|
|
4457
|
+
cancelText: { default: "取消" },
|
|
4458
|
+
showCancel: { type: Boolean, default: true },
|
|
4459
|
+
showClose: { type: Boolean, default: true },
|
|
4460
|
+
closeOnClickModal: { type: Boolean, default: true },
|
|
4461
|
+
closeOnEsc: { type: Boolean, default: true },
|
|
4462
|
+
center: { type: Boolean, default: false },
|
|
4463
|
+
fullscreen: { type: Boolean, default: false },
|
|
4464
|
+
destroyOnClose: { type: Boolean, default: false },
|
|
4465
|
+
beforeClose: {}
|
|
4466
|
+
}, {
|
|
4467
|
+
"modelValue": __spreadValues({ type: Boolean }, { required: true }),
|
|
4468
|
+
"modelModifiers": {}
|
|
4469
|
+
}),
|
|
4470
|
+
emits: /* @__PURE__ */ mergeModels(["open", "close", "confirm", "cancel"], ["update:modelValue"]),
|
|
4471
|
+
setup(__props, { emit: __emit }) {
|
|
4472
|
+
const props = __props;
|
|
4473
|
+
const emit = __emit;
|
|
4474
|
+
const visible = useModel(__props, "modelValue");
|
|
4475
|
+
const handleClose = () => {
|
|
4476
|
+
visible.value = false;
|
|
4477
|
+
emit("close");
|
|
4478
|
+
};
|
|
4479
|
+
const handleConfirm = () => {
|
|
4480
|
+
emit("confirm");
|
|
4481
|
+
if (props.beforeClose) {
|
|
4482
|
+
props.beforeClose(() => {
|
|
4483
|
+
visible.value = false;
|
|
4484
|
+
});
|
|
4485
|
+
} else {
|
|
4486
|
+
visible.value = false;
|
|
4487
|
+
}
|
|
4488
|
+
};
|
|
4489
|
+
const handleCancel = () => {
|
|
4490
|
+
emit("cancel");
|
|
4491
|
+
handleClose();
|
|
4492
|
+
};
|
|
4493
|
+
const handleOverlayClick = (e) => {
|
|
4494
|
+
if (props.closeOnClickModal && e.target === e.currentTarget) {
|
|
4495
|
+
handleClose();
|
|
4496
|
+
}
|
|
4497
|
+
};
|
|
4498
|
+
const handleKeydown = (e) => {
|
|
4499
|
+
if (props.closeOnEsc && e.key === "Escape") {
|
|
4500
|
+
handleClose();
|
|
4501
|
+
}
|
|
4502
|
+
};
|
|
4503
|
+
onMounted(() => {
|
|
4504
|
+
if (props.closeOnEsc) {
|
|
4505
|
+
window.addEventListener("keydown", handleKeydown);
|
|
4506
|
+
}
|
|
4507
|
+
emit("open");
|
|
4508
|
+
});
|
|
4509
|
+
onBeforeUnmount(() => {
|
|
4510
|
+
if (props.closeOnEsc) {
|
|
4511
|
+
window.removeEventListener("keydown", handleKeydown);
|
|
4512
|
+
}
|
|
4513
|
+
});
|
|
4514
|
+
const iconMap = {
|
|
4515
|
+
info: InformationCircleOutline,
|
|
4516
|
+
success: CheckmarkCircleOutline,
|
|
4517
|
+
warning: WarningOutline,
|
|
4518
|
+
failed: AlertCircleOutline,
|
|
4519
|
+
primary: InformationCircleOutline,
|
|
4520
|
+
default: InformationCircleOutline
|
|
4521
|
+
};
|
|
4522
|
+
const hasIcon = computed(() => props.type && props.type !== "default");
|
|
4523
|
+
return (_ctx, _cache) => {
|
|
4524
|
+
return openBlock(), createBlock(Teleport, { to: "body" }, [
|
|
4525
|
+
createVNode(Transition, { name: "f-dialog-fade" }, {
|
|
4526
|
+
default: withCtx(() => [
|
|
4527
|
+
visible.value ? (openBlock(), createElementBlock("div", {
|
|
4528
|
+
key: 0,
|
|
4529
|
+
class: "f-dialog-overlay",
|
|
4530
|
+
onClick: handleOverlayClick
|
|
4531
|
+
}, [
|
|
4532
|
+
createVNode(Transition, { name: "f-dialog-zoom" }, {
|
|
4533
|
+
default: withCtx(() => [
|
|
4534
|
+
visible.value ? (openBlock(), createElementBlock("div", {
|
|
4535
|
+
key: 0,
|
|
4536
|
+
class: normalizeClass(["f-dialog", [
|
|
4537
|
+
`f-dialog--${_ctx.type}`,
|
|
4538
|
+
{
|
|
4539
|
+
"is-center": _ctx.center,
|
|
4540
|
+
"is-fullscreen": _ctx.fullscreen
|
|
4541
|
+
}
|
|
4542
|
+
]]),
|
|
4543
|
+
style: normalizeStyle({ width: _ctx.fullscreen ? "100%" : _ctx.width })
|
|
4544
|
+
}, [
|
|
4545
|
+
_ctx.showClose ? (openBlock(), createElementBlock("button", {
|
|
4546
|
+
key: 0,
|
|
4547
|
+
type: "button",
|
|
4548
|
+
class: "f-dialog__close",
|
|
4549
|
+
onClick: handleClose
|
|
4550
|
+
}, [
|
|
4551
|
+
createVNode(FIcon, null, {
|
|
4552
|
+
default: withCtx(() => [
|
|
4553
|
+
createVNode(unref(CloseOutline))
|
|
4554
|
+
]),
|
|
4555
|
+
_: 1
|
|
4556
|
+
})
|
|
4557
|
+
])) : createCommentVNode("", true),
|
|
4558
|
+
_ctx.$slots.header || _ctx.title ? (openBlock(), createElementBlock("div", {
|
|
4559
|
+
key: 1,
|
|
4560
|
+
class: normalizeClass(["f-dialog__header", { "has-icon": unref(hasIcon) }])
|
|
4561
|
+
}, [
|
|
4562
|
+
renderSlot(_ctx.$slots, "header", {}, () => [
|
|
4563
|
+
unref(hasIcon) ? (openBlock(), createElementBlock("div", _hoisted_1$2, [
|
|
4564
|
+
createVNode(FIcon, null, {
|
|
4565
|
+
default: withCtx(() => [
|
|
4566
|
+
(openBlock(), createBlock(resolveDynamicComponent(iconMap[_ctx.type])))
|
|
4567
|
+
]),
|
|
4568
|
+
_: 1
|
|
4569
|
+
})
|
|
4570
|
+
])) : createCommentVNode("", true),
|
|
4571
|
+
createElementVNode("h3", _hoisted_2$1, toDisplayString(_ctx.title), 1)
|
|
4572
|
+
], true)
|
|
4573
|
+
], 2)) : createCommentVNode("", true),
|
|
4574
|
+
createElementVNode("div", _hoisted_3$1, [
|
|
4575
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
4576
|
+
_ctx.content ? (openBlock(), createElementBlock("p", _hoisted_4, toDisplayString(_ctx.content), 1)) : createCommentVNode("", true)
|
|
4577
|
+
], true)
|
|
4578
|
+
]),
|
|
4579
|
+
_ctx.$slots.footer || _ctx.showCancel ? (openBlock(), createElementBlock("div", _hoisted_5, [
|
|
4580
|
+
renderSlot(_ctx.$slots, "footer", {}, () => [
|
|
4581
|
+
_ctx.showCancel ? (openBlock(), createBlock(FButton, {
|
|
4582
|
+
key: 0,
|
|
4583
|
+
onClick: handleCancel
|
|
4584
|
+
}, {
|
|
4585
|
+
default: withCtx(() => [
|
|
4586
|
+
createTextVNode(toDisplayString(_ctx.cancelText), 1)
|
|
4587
|
+
]),
|
|
4588
|
+
_: 1
|
|
4589
|
+
})) : createCommentVNode("", true),
|
|
4590
|
+
createVNode(FButton, {
|
|
4591
|
+
type: "primary",
|
|
4592
|
+
onClick: handleConfirm
|
|
4593
|
+
}, {
|
|
4594
|
+
default: withCtx(() => [
|
|
4595
|
+
createTextVNode(toDisplayString(_ctx.confirmText), 1)
|
|
4596
|
+
]),
|
|
4597
|
+
_: 1
|
|
4598
|
+
})
|
|
4599
|
+
], true)
|
|
4600
|
+
])) : createCommentVNode("", true)
|
|
4601
|
+
], 6)) : createCommentVNode("", true)
|
|
4602
|
+
]),
|
|
4603
|
+
_: 3
|
|
4604
|
+
})
|
|
4605
|
+
])) : createCommentVNode("", true)
|
|
4606
|
+
]),
|
|
4607
|
+
_: 3
|
|
4608
|
+
})
|
|
4609
|
+
]);
|
|
4610
|
+
};
|
|
4611
|
+
}
|
|
4612
|
+
});
|
|
4613
|
+
const FDialogComp = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-b88b4e96"]]);
|
|
4614
|
+
const _hoisted_1$1 = { class: "f-message__content" };
|
|
4615
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
4440
4616
|
__name: "FMessage",
|
|
4441
4617
|
props: {
|
|
4442
4618
|
type: { default: "info" },
|
|
@@ -4515,7 +4691,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
4515
4691
|
]),
|
|
4516
4692
|
_: 1
|
|
4517
4693
|
})) : createCommentVNode("", true),
|
|
4518
|
-
createElementVNode("span", _hoisted_1$
|
|
4694
|
+
createElementVNode("span", _hoisted_1$1, toDisplayString(_ctx.message), 1),
|
|
4519
4695
|
_ctx.closable ? (openBlock(), createElementBlock("button", {
|
|
4520
4696
|
key: 1,
|
|
4521
4697
|
type: "button",
|
|
@@ -4537,86 +4713,14 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
4537
4713
|
};
|
|
4538
4714
|
}
|
|
4539
4715
|
});
|
|
4540
|
-
const FMessageComp = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
4541
|
-
const
|
|
4542
|
-
const
|
|
4543
|
-
let seed$1 = 0;
|
|
4544
|
-
const instances = [];
|
|
4545
|
-
const normalizeOptions$1 = (options) => {
|
|
4546
|
-
return typeof options === "string" ? { message: options } : options;
|
|
4547
|
-
};
|
|
4548
|
-
const repositionAll = () => {
|
|
4549
|
-
let offset = BASE_OFFSET$1;
|
|
4550
|
-
instances.forEach((item) => {
|
|
4551
|
-
const vm = item.vnode.component;
|
|
4552
|
-
if (vm) {
|
|
4553
|
-
vm.props.offset = offset;
|
|
4554
|
-
}
|
|
4555
|
-
offset += item.height + GAP$1;
|
|
4556
|
-
});
|
|
4557
|
-
};
|
|
4558
|
-
const removeInstance$1 = (id) => {
|
|
4559
|
-
const index = instances.findIndex((item) => item.id === id);
|
|
4560
|
-
if (index === -1) return;
|
|
4561
|
-
const { container } = instances[index];
|
|
4562
|
-
render(null, container);
|
|
4563
|
-
container.remove();
|
|
4564
|
-
instances.splice(index, 1);
|
|
4565
|
-
repositionAll();
|
|
4566
|
-
};
|
|
4567
|
-
const createInstance$1 = (options) => {
|
|
4568
|
-
var _a;
|
|
4569
|
-
const id = seed$1++;
|
|
4570
|
-
const container = document.createElement("div");
|
|
4571
|
-
const offset = instances.length === 0 ? BASE_OFFSET$1 : (() => {
|
|
4572
|
-
var _a2;
|
|
4573
|
-
const last = instances[instances.length - 1];
|
|
4574
|
-
return ((_a2 = last.vnode.component) == null ? void 0 : _a2.props.offset) + last.height + GAP$1;
|
|
4575
|
-
})();
|
|
4576
|
-
const vnode = createVNode(FMessageComp, __spreadProps(__spreadValues({}, options), {
|
|
4577
|
-
offset,
|
|
4578
|
-
onClose: () => {
|
|
4579
|
-
var _a2;
|
|
4580
|
-
(_a2 = options.onClose) == null ? void 0 : _a2.call(options);
|
|
4581
|
-
},
|
|
4582
|
-
onDestroy: () => {
|
|
4583
|
-
removeInstance$1(id);
|
|
4584
|
-
}
|
|
4585
|
-
}));
|
|
4586
|
-
render(vnode, container);
|
|
4587
|
-
document.body.appendChild(container);
|
|
4588
|
-
const el = vnode.el;
|
|
4589
|
-
const height = (_a = el == null ? void 0 : el.offsetHeight) != null ? _a : 44;
|
|
4590
|
-
instances.push({ id, vnode, container, height });
|
|
4591
|
-
return {
|
|
4592
|
-
id,
|
|
4593
|
-
close: () => {
|
|
4594
|
-
var _a2, _b, _c;
|
|
4595
|
-
(_c = (_b = (_a2 = vnode.component) == null ? void 0 : _a2.exposed) == null ? void 0 : _b.close) == null ? void 0 : _c.call(_b);
|
|
4596
|
-
}
|
|
4597
|
-
};
|
|
4598
|
-
};
|
|
4599
|
-
const FMessage = (options) => {
|
|
4600
|
-
return createInstance$1(normalizeOptions$1(options));
|
|
4601
|
-
};
|
|
4602
|
-
const withType$1 = (type) => (options) => createInstance$1(__spreadProps(__spreadValues({}, normalizeOptions$1(options)), { type }));
|
|
4603
|
-
FMessage.info = withType$1("info");
|
|
4604
|
-
FMessage.success = withType$1("success");
|
|
4605
|
-
FMessage.warning = withType$1("warning");
|
|
4606
|
-
FMessage.failed = withType$1("failed");
|
|
4607
|
-
FMessage.closeAll = () => {
|
|
4608
|
-
[...instances].forEach((item) => {
|
|
4609
|
-
var _a, _b, _c;
|
|
4610
|
-
(_c = (_b = (_a = item.vnode.component) == null ? void 0 : _a.exposed) == null ? void 0 : _b.close) == null ? void 0 : _c.call(_b);
|
|
4611
|
-
});
|
|
4612
|
-
};
|
|
4613
|
-
const _hoisted_1$1 = { class: "f-notification__body" };
|
|
4614
|
-
const _hoisted_2$1 = {
|
|
4716
|
+
const FMessageComp = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-97556afa"]]);
|
|
4717
|
+
const _hoisted_1 = { class: "f-notification__body" };
|
|
4718
|
+
const _hoisted_2 = {
|
|
4615
4719
|
key: 0,
|
|
4616
4720
|
class: "f-notification__title"
|
|
4617
4721
|
};
|
|
4618
|
-
const _hoisted_3
|
|
4619
|
-
const _sfc_main
|
|
4722
|
+
const _hoisted_3 = { class: "f-notification__content" };
|
|
4723
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
4620
4724
|
__name: "FNotification",
|
|
4621
4725
|
props: {
|
|
4622
4726
|
type: { default: "info" },
|
|
@@ -4702,9 +4806,9 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
4702
4806
|
]),
|
|
4703
4807
|
_: 1
|
|
4704
4808
|
})) : createCommentVNode("", true),
|
|
4705
|
-
createElementVNode("div", _hoisted_1
|
|
4706
|
-
_ctx.title ? (openBlock(), createElementBlock("p", _hoisted_2
|
|
4707
|
-
createElementVNode("p", _hoisted_3
|
|
4809
|
+
createElementVNode("div", _hoisted_1, [
|
|
4810
|
+
_ctx.title ? (openBlock(), createElementBlock("p", _hoisted_2, toDisplayString(_ctx.title), 1)) : createCommentVNode("", true),
|
|
4811
|
+
createElementVNode("p", _hoisted_3, toDisplayString(_ctx.message), 1)
|
|
4708
4812
|
]),
|
|
4709
4813
|
_ctx.closable ? (openBlock(), createElementBlock("button", {
|
|
4710
4814
|
key: 1,
|
|
@@ -4727,7 +4831,79 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
4727
4831
|
};
|
|
4728
4832
|
}
|
|
4729
4833
|
});
|
|
4730
|
-
const FNotificationComp = /* @__PURE__ */ _export_sfc(_sfc_main
|
|
4834
|
+
const FNotificationComp = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-0a7315d6"]]);
|
|
4835
|
+
const GAP$1 = 16;
|
|
4836
|
+
const BASE_OFFSET$1 = 20;
|
|
4837
|
+
let seed$1 = 0;
|
|
4838
|
+
const instances = [];
|
|
4839
|
+
const normalizeOptions$1 = (options) => {
|
|
4840
|
+
return typeof options === "string" ? { message: options } : options;
|
|
4841
|
+
};
|
|
4842
|
+
const repositionAll = () => {
|
|
4843
|
+
let offset = BASE_OFFSET$1;
|
|
4844
|
+
instances.forEach((item) => {
|
|
4845
|
+
const vm = item.vnode.component;
|
|
4846
|
+
if (vm) {
|
|
4847
|
+
vm.props.offset = offset;
|
|
4848
|
+
}
|
|
4849
|
+
offset += item.height + GAP$1;
|
|
4850
|
+
});
|
|
4851
|
+
};
|
|
4852
|
+
const removeInstance$1 = (id) => {
|
|
4853
|
+
const index = instances.findIndex((item) => item.id === id);
|
|
4854
|
+
if (index === -1) return;
|
|
4855
|
+
const { container } = instances[index];
|
|
4856
|
+
render(null, container);
|
|
4857
|
+
container.remove();
|
|
4858
|
+
instances.splice(index, 1);
|
|
4859
|
+
repositionAll();
|
|
4860
|
+
};
|
|
4861
|
+
const createInstance$1 = (options) => {
|
|
4862
|
+
var _a;
|
|
4863
|
+
const id = seed$1++;
|
|
4864
|
+
const container = document.createElement("div");
|
|
4865
|
+
const offset = instances.length === 0 ? BASE_OFFSET$1 : (() => {
|
|
4866
|
+
var _a2;
|
|
4867
|
+
const last = instances[instances.length - 1];
|
|
4868
|
+
return ((_a2 = last.vnode.component) == null ? void 0 : _a2.props.offset) + last.height + GAP$1;
|
|
4869
|
+
})();
|
|
4870
|
+
const vnode = createVNode(FMessageComp, __spreadProps(__spreadValues({}, options), {
|
|
4871
|
+
offset,
|
|
4872
|
+
onClose: () => {
|
|
4873
|
+
var _a2;
|
|
4874
|
+
(_a2 = options.onClose) == null ? void 0 : _a2.call(options);
|
|
4875
|
+
},
|
|
4876
|
+
onDestroy: () => {
|
|
4877
|
+
removeInstance$1(id);
|
|
4878
|
+
}
|
|
4879
|
+
}));
|
|
4880
|
+
render(vnode, container);
|
|
4881
|
+
document.body.appendChild(container);
|
|
4882
|
+
const el = vnode.el;
|
|
4883
|
+
const height = (_a = el == null ? void 0 : el.offsetHeight) != null ? _a : 44;
|
|
4884
|
+
instances.push({ id, vnode, container, height });
|
|
4885
|
+
return {
|
|
4886
|
+
id,
|
|
4887
|
+
close: () => {
|
|
4888
|
+
var _a2, _b, _c;
|
|
4889
|
+
(_c = (_b = (_a2 = vnode.component) == null ? void 0 : _a2.exposed) == null ? void 0 : _b.close) == null ? void 0 : _c.call(_b);
|
|
4890
|
+
}
|
|
4891
|
+
};
|
|
4892
|
+
};
|
|
4893
|
+
const FMessage = (options) => {
|
|
4894
|
+
return createInstance$1(normalizeOptions$1(options));
|
|
4895
|
+
};
|
|
4896
|
+
const withType$1 = (type) => (options) => createInstance$1(__spreadProps(__spreadValues({}, normalizeOptions$1(options)), { type }));
|
|
4897
|
+
FMessage.info = withType$1("info");
|
|
4898
|
+
FMessage.success = withType$1("success");
|
|
4899
|
+
FMessage.warning = withType$1("warning");
|
|
4900
|
+
FMessage.failed = withType$1("failed");
|
|
4901
|
+
FMessage.closeAll = () => {
|
|
4902
|
+
[...instances].forEach((item) => {
|
|
4903
|
+
var _a, _b, _c;
|
|
4904
|
+
(_c = (_b = (_a = item.vnode.component) == null ? void 0 : _a.exposed) == null ? void 0 : _b.close) == null ? void 0 : _c.call(_b);
|
|
4905
|
+
});
|
|
4906
|
+
};
|
|
4731
4907
|
const GAP = 16;
|
|
4732
4908
|
const BASE_OFFSET = 20;
|
|
4733
4909
|
let seed = 0;
|
|
@@ -4816,182 +4992,6 @@ FNotification.closeAll = (position) => {
|
|
|
4816
4992
|
});
|
|
4817
4993
|
});
|
|
4818
4994
|
};
|
|
4819
|
-
const _hoisted_1 = {
|
|
4820
|
-
key: 0,
|
|
4821
|
-
class: "f-dialog__icon"
|
|
4822
|
-
};
|
|
4823
|
-
const _hoisted_2 = { class: "f-dialog__title" };
|
|
4824
|
-
const _hoisted_3 = { class: "f-dialog__body" };
|
|
4825
|
-
const _hoisted_4 = { key: 0 };
|
|
4826
|
-
const _hoisted_5 = {
|
|
4827
|
-
key: 2,
|
|
4828
|
-
class: "f-dialog__footer"
|
|
4829
|
-
};
|
|
4830
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
4831
|
-
__name: "FDialog",
|
|
4832
|
-
props: /* @__PURE__ */ mergeModels({
|
|
4833
|
-
title: { default: "提示" },
|
|
4834
|
-
content: {},
|
|
4835
|
-
width: { default: "500px" },
|
|
4836
|
-
type: { default: "default" },
|
|
4837
|
-
confirmText: { default: "确定" },
|
|
4838
|
-
cancelText: { default: "取消" },
|
|
4839
|
-
showCancel: { type: Boolean, default: true },
|
|
4840
|
-
showClose: { type: Boolean, default: true },
|
|
4841
|
-
closeOnClickModal: { type: Boolean, default: true },
|
|
4842
|
-
closeOnEsc: { type: Boolean, default: true },
|
|
4843
|
-
center: { type: Boolean, default: false },
|
|
4844
|
-
fullscreen: { type: Boolean, default: false },
|
|
4845
|
-
destroyOnClose: { type: Boolean, default: false },
|
|
4846
|
-
beforeClose: {}
|
|
4847
|
-
}, {
|
|
4848
|
-
"modelValue": __spreadValues({ type: Boolean }, { required: true }),
|
|
4849
|
-
"modelModifiers": {}
|
|
4850
|
-
}),
|
|
4851
|
-
emits: /* @__PURE__ */ mergeModels(["open", "close", "confirm", "cancel"], ["update:modelValue"]),
|
|
4852
|
-
setup(__props, { emit: __emit }) {
|
|
4853
|
-
const props = __props;
|
|
4854
|
-
const emit = __emit;
|
|
4855
|
-
const visible = useModel(__props, "modelValue");
|
|
4856
|
-
const handleClose = () => {
|
|
4857
|
-
visible.value = false;
|
|
4858
|
-
emit("close");
|
|
4859
|
-
};
|
|
4860
|
-
const handleConfirm = () => {
|
|
4861
|
-
emit("confirm");
|
|
4862
|
-
if (props.beforeClose) {
|
|
4863
|
-
props.beforeClose(() => {
|
|
4864
|
-
visible.value = false;
|
|
4865
|
-
});
|
|
4866
|
-
} else {
|
|
4867
|
-
visible.value = false;
|
|
4868
|
-
}
|
|
4869
|
-
};
|
|
4870
|
-
const handleCancel = () => {
|
|
4871
|
-
emit("cancel");
|
|
4872
|
-
handleClose();
|
|
4873
|
-
};
|
|
4874
|
-
const handleOverlayClick = (e) => {
|
|
4875
|
-
if (props.closeOnClickModal && e.target === e.currentTarget) {
|
|
4876
|
-
handleClose();
|
|
4877
|
-
}
|
|
4878
|
-
};
|
|
4879
|
-
const handleKeydown = (e) => {
|
|
4880
|
-
if (props.closeOnEsc && e.key === "Escape") {
|
|
4881
|
-
handleClose();
|
|
4882
|
-
}
|
|
4883
|
-
};
|
|
4884
|
-
onMounted(() => {
|
|
4885
|
-
if (props.closeOnEsc) {
|
|
4886
|
-
window.addEventListener("keydown", handleKeydown);
|
|
4887
|
-
}
|
|
4888
|
-
emit("open");
|
|
4889
|
-
});
|
|
4890
|
-
onBeforeUnmount(() => {
|
|
4891
|
-
if (props.closeOnEsc) {
|
|
4892
|
-
window.removeEventListener("keydown", handleKeydown);
|
|
4893
|
-
}
|
|
4894
|
-
});
|
|
4895
|
-
const iconMap = {
|
|
4896
|
-
info: InformationCircleOutline,
|
|
4897
|
-
success: CheckmarkCircleOutline,
|
|
4898
|
-
warning: WarningOutline,
|
|
4899
|
-
failed: AlertCircleOutline,
|
|
4900
|
-
primary: InformationCircleOutline,
|
|
4901
|
-
default: InformationCircleOutline
|
|
4902
|
-
};
|
|
4903
|
-
const hasIcon = computed(() => props.type && props.type !== "default");
|
|
4904
|
-
return (_ctx, _cache) => {
|
|
4905
|
-
return openBlock(), createBlock(Teleport, { to: "body" }, [
|
|
4906
|
-
createVNode(Transition, { name: "f-dialog-fade" }, {
|
|
4907
|
-
default: withCtx(() => [
|
|
4908
|
-
visible.value ? (openBlock(), createElementBlock("div", {
|
|
4909
|
-
key: 0,
|
|
4910
|
-
class: "f-dialog-overlay",
|
|
4911
|
-
onClick: handleOverlayClick
|
|
4912
|
-
}, [
|
|
4913
|
-
createVNode(Transition, { name: "f-dialog-zoom" }, {
|
|
4914
|
-
default: withCtx(() => [
|
|
4915
|
-
visible.value ? (openBlock(), createElementBlock("div", {
|
|
4916
|
-
key: 0,
|
|
4917
|
-
class: normalizeClass(["f-dialog", [
|
|
4918
|
-
`f-dialog--${_ctx.type}`,
|
|
4919
|
-
{
|
|
4920
|
-
"is-center": _ctx.center,
|
|
4921
|
-
"is-fullscreen": _ctx.fullscreen
|
|
4922
|
-
}
|
|
4923
|
-
]]),
|
|
4924
|
-
style: normalizeStyle({ width: _ctx.fullscreen ? "100%" : _ctx.width })
|
|
4925
|
-
}, [
|
|
4926
|
-
_ctx.showClose ? (openBlock(), createElementBlock("button", {
|
|
4927
|
-
key: 0,
|
|
4928
|
-
type: "button",
|
|
4929
|
-
class: "f-dialog__close",
|
|
4930
|
-
onClick: handleClose
|
|
4931
|
-
}, [
|
|
4932
|
-
createVNode(FIcon, null, {
|
|
4933
|
-
default: withCtx(() => [
|
|
4934
|
-
createVNode(unref(CloseOutline))
|
|
4935
|
-
]),
|
|
4936
|
-
_: 1
|
|
4937
|
-
})
|
|
4938
|
-
])) : createCommentVNode("", true),
|
|
4939
|
-
_ctx.$slots.header || _ctx.title ? (openBlock(), createElementBlock("div", {
|
|
4940
|
-
key: 1,
|
|
4941
|
-
class: normalizeClass(["f-dialog__header", { "has-icon": unref(hasIcon) }])
|
|
4942
|
-
}, [
|
|
4943
|
-
renderSlot(_ctx.$slots, "header", {}, () => [
|
|
4944
|
-
unref(hasIcon) ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
4945
|
-
createVNode(FIcon, null, {
|
|
4946
|
-
default: withCtx(() => [
|
|
4947
|
-
(openBlock(), createBlock(resolveDynamicComponent(iconMap[_ctx.type])))
|
|
4948
|
-
]),
|
|
4949
|
-
_: 1
|
|
4950
|
-
})
|
|
4951
|
-
])) : createCommentVNode("", true),
|
|
4952
|
-
createElementVNode("h3", _hoisted_2, toDisplayString(_ctx.title), 1)
|
|
4953
|
-
], true)
|
|
4954
|
-
], 2)) : createCommentVNode("", true),
|
|
4955
|
-
createElementVNode("div", _hoisted_3, [
|
|
4956
|
-
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
4957
|
-
_ctx.content ? (openBlock(), createElementBlock("p", _hoisted_4, toDisplayString(_ctx.content), 1)) : createCommentVNode("", true)
|
|
4958
|
-
], true)
|
|
4959
|
-
]),
|
|
4960
|
-
_ctx.$slots.footer || _ctx.showCancel ? (openBlock(), createElementBlock("div", _hoisted_5, [
|
|
4961
|
-
renderSlot(_ctx.$slots, "footer", {}, () => [
|
|
4962
|
-
_ctx.showCancel ? (openBlock(), createBlock(FButton, {
|
|
4963
|
-
key: 0,
|
|
4964
|
-
onClick: handleCancel
|
|
4965
|
-
}, {
|
|
4966
|
-
default: withCtx(() => [
|
|
4967
|
-
createTextVNode(toDisplayString(_ctx.cancelText), 1)
|
|
4968
|
-
]),
|
|
4969
|
-
_: 1
|
|
4970
|
-
})) : createCommentVNode("", true),
|
|
4971
|
-
createVNode(FButton, {
|
|
4972
|
-
type: "primary",
|
|
4973
|
-
onClick: handleConfirm
|
|
4974
|
-
}, {
|
|
4975
|
-
default: withCtx(() => [
|
|
4976
|
-
createTextVNode(toDisplayString(_ctx.confirmText), 1)
|
|
4977
|
-
]),
|
|
4978
|
-
_: 1
|
|
4979
|
-
})
|
|
4980
|
-
], true)
|
|
4981
|
-
])) : createCommentVNode("", true)
|
|
4982
|
-
], 6)) : createCommentVNode("", true)
|
|
4983
|
-
]),
|
|
4984
|
-
_: 3
|
|
4985
|
-
})
|
|
4986
|
-
])) : createCommentVNode("", true)
|
|
4987
|
-
]),
|
|
4988
|
-
_: 3
|
|
4989
|
-
})
|
|
4990
|
-
]);
|
|
4991
|
-
};
|
|
4992
|
-
}
|
|
4993
|
-
});
|
|
4994
|
-
const FDialogComp = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-b88b4e96"]]);
|
|
4995
4995
|
const showDialog = (options) => {
|
|
4996
4996
|
return new Promise((resolve) => {
|
|
4997
4997
|
const container = document.createElement("div");
|
|
@@ -5089,6 +5089,7 @@ const components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePr
|
|
|
5089
5089
|
FColorPicker: _sfc_main$b,
|
|
5090
5090
|
FContainer,
|
|
5091
5091
|
FDialog,
|
|
5092
|
+
FDialogComponent: FDialogComp,
|
|
5092
5093
|
FDivider,
|
|
5093
5094
|
FDropdown,
|
|
5094
5095
|
FEditor,
|
|
@@ -5104,7 +5105,9 @@ const components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePr
|
|
|
5104
5105
|
FMarquee,
|
|
5105
5106
|
FMask,
|
|
5106
5107
|
FMessage,
|
|
5108
|
+
FMessageComponent: FMessageComp,
|
|
5107
5109
|
FNotification,
|
|
5110
|
+
FNotificationComponent: FNotificationComp,
|
|
5108
5111
|
FPagination,
|
|
5109
5112
|
FProgress,
|
|
5110
5113
|
FRadio,
|
|
@@ -5149,6 +5152,7 @@ export {
|
|
|
5149
5152
|
_sfc_main$b as FColorPicker,
|
|
5150
5153
|
FContainer,
|
|
5151
5154
|
FDialog,
|
|
5155
|
+
FDialogComp as FDialogComponent,
|
|
5152
5156
|
FDivider,
|
|
5153
5157
|
FDropdown,
|
|
5154
5158
|
FEditor,
|
|
@@ -5164,7 +5168,9 @@ export {
|
|
|
5164
5168
|
FMarquee,
|
|
5165
5169
|
FMask,
|
|
5166
5170
|
FMessage,
|
|
5171
|
+
FMessageComp as FMessageComponent,
|
|
5167
5172
|
FNotification,
|
|
5173
|
+
FNotificationComp as FNotificationComponent,
|
|
5168
5174
|
FPagination,
|
|
5169
5175
|
FProgress,
|
|
5170
5176
|
FRadio,
|