@maxax/ui 1.1.31 → 1.1.32
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/components/basic-button-export-max/BasicButtonExportMax.vue.d.ts.map +1 -1
- package/dist/index.cjs +286 -271
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +286 -271
- package/dist/index.mjs.map +1 -1
- package/dist/locale/lang/en.d.ts.map +1 -1
- package/dist/locale/lang/zh-cn.d.ts.map +1 -1
- package/dist/locales.cjs +3 -2
- package/dist/locales.cjs.map +1 -1
- package/dist/locales.mjs +3 -2
- package/dist/locales.mjs.map +1 -1
- package/dist/theme-chalk/index.css +1 -1
- package/dist/theme-chalk/light.css +1 -1
- package/dist/{utils-BqJsjHj1.js → utils-D9CmPNRk.js} +3 -2
- package/dist/utils-D9CmPNRk.js.map +1 -0
- package/dist/{utils-o29LtjNO.cjs → utils-wq6KwECV.cjs} +3 -2
- package/dist/utils-wq6KwECV.cjs.map +1 -0
- package/package.json +3 -3
- package/dist/utils-BqJsjHj1.js.map +0 -1
- package/dist/utils-o29LtjNO.cjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { camelize, isNumber, isString, removeClass, addClass, pascalCase, isClie
|
|
|
2
2
|
import { shallowRef, shallowReadonly, onUnmounted, onMounted, nextTick, getCurrentScope, onScopeDispose, toValue, getCurrentInstance, watch, computed, unref, Fragment, isVNode, Comment, Text, watchEffect, onBeforeUnmount, inject, ref, isRef, toRaw, defineComponent, createElementBlock, openBlock, normalizeClass, createElementVNode, renderSlot, h, useAttrs, mergeProps, createBlock, createCommentVNode, withCtx, createTextVNode, toDisplayString, createVNode, useSlots, createSlots, provide, reactive, toRefs, resolveComponent, Transition, withDirectives, withModifiers, normalizeStyle, withKeys, resolveDynamicComponent, vShow, render as render$1, useTemplateRef, renderList, normalizeProps, guardReactiveProps, triggerRef, TransitionGroup, toRef, vModelText, createApp, toHandlers, mergeDefaults } from "vue";
|
|
3
3
|
import BScroll from "@better-scroll/core";
|
|
4
4
|
import { NTooltip, NButton, NInput, NButtonGroup, NDropdown, NModal, NProgress, NSwitch, NCard, NCascader, NDatePicker, NDrawer, NDrawerContent, NSelect, NInputNumber, NUpload, NAutoComplete, NDynamicTags, NTreeSelect, NTimePicker, NCheckbox, NCheckboxGroup, NRadio, NRadioButton, NRadioGroup, NSlider, NTransfer, NDivider, NColorPicker, NRate, NCol, NFormItem, NForm, NRow, NPopover, NTabs, NTabPane, NScrollbar, NEmpty, NPagination, NSpin } from "naive-ui";
|
|
5
|
-
import { b as buildLocaleContext, z as zhCN } from "./utils-
|
|
5
|
+
import { b as buildLocaleContext, z as zhCN } from "./utils-D9CmPNRk.js";
|
|
6
6
|
import { merge, cloneDeep as cloneDeep$1, uniqBy, isBoolean as isBoolean$1, isFunction as isFunction$1, isArray as isArray$1, isString as isString$1, isEqual, get, concat, partition, omit, has, set, unset, isNumber as isNumber$1, isPlainObject } from "lodash-es";
|
|
7
7
|
import { VxePager } from "vxe-pc-ui";
|
|
8
8
|
import { VxeUI, VxePager as VxePager2 } from "vxe-pc-ui";
|
|
@@ -4394,7 +4394,256 @@ const XBasicButtonImport = withInstall(_sfc_main$K);
|
|
|
4394
4394
|
const XBasicButtonPrint = withInstall(_sfc_main$J);
|
|
4395
4395
|
const XBasicButtonDrop = withInstall(_sfc_main$O);
|
|
4396
4396
|
const XBasicButtonExportDrop = withInstall(_sfc_main$L);
|
|
4397
|
+
const _hoisted_1$a = ["id"];
|
|
4398
|
+
const _hoisted_2$3 = ["textContent"];
|
|
4399
|
+
const _hoisted_3 = { key: 0 };
|
|
4400
|
+
const _hoisted_4 = ["innerHTML"];
|
|
4397
4401
|
const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
4402
|
+
__name: "BasicNotification",
|
|
4403
|
+
props: {
|
|
4404
|
+
customClass: { default: "" },
|
|
4405
|
+
dangerouslyUseHTMLString: { type: Boolean },
|
|
4406
|
+
duration: { default: 4500 },
|
|
4407
|
+
icon: {},
|
|
4408
|
+
id: { default: "" },
|
|
4409
|
+
message: {},
|
|
4410
|
+
offset: { default: 0 },
|
|
4411
|
+
onClick: { type: Function, default: () => void 0 },
|
|
4412
|
+
onClose: {},
|
|
4413
|
+
position: { default: "top-right" },
|
|
4414
|
+
showClose: { type: Boolean, default: true },
|
|
4415
|
+
title: { default: "" },
|
|
4416
|
+
type: { default: "" },
|
|
4417
|
+
zIndex: {}
|
|
4418
|
+
},
|
|
4419
|
+
emits: ["destroy"],
|
|
4420
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
4421
|
+
const props = __props;
|
|
4422
|
+
const emit = __emit;
|
|
4423
|
+
const { ns, zIndex: zIndex2 } = useConfigProvider("basic-notification");
|
|
4424
|
+
const { nextZIndex, currentZIndex } = zIndex2;
|
|
4425
|
+
const visible = ref(false);
|
|
4426
|
+
let timer;
|
|
4427
|
+
const iconMap = {
|
|
4428
|
+
success: "ri:checkbox-circle-line",
|
|
4429
|
+
error: "ri:close-circle-line",
|
|
4430
|
+
info: "ri:information-line",
|
|
4431
|
+
warning: "ri:error-warning-line"
|
|
4432
|
+
};
|
|
4433
|
+
const typeClass = computed(() => {
|
|
4434
|
+
const type = props.type;
|
|
4435
|
+
return type && iconMap[props.type] ? ns.m(type) : "";
|
|
4436
|
+
});
|
|
4437
|
+
const iconComponent = computed(() => {
|
|
4438
|
+
if (!props.type) return props.icon;
|
|
4439
|
+
return iconMap[props.type] || props.icon;
|
|
4440
|
+
});
|
|
4441
|
+
const horizontalClass = computed(() => props.position.endsWith("right") ? "right" : "left");
|
|
4442
|
+
const verticalProperty = computed(() => props.position.startsWith("top") ? "top" : "bottom");
|
|
4443
|
+
const positionStyle = computed(() => {
|
|
4444
|
+
var _a;
|
|
4445
|
+
return {
|
|
4446
|
+
[verticalProperty.value]: `${props.offset}px`,
|
|
4447
|
+
zIndex: (_a = props.zIndex) != null ? _a : currentZIndex.value
|
|
4448
|
+
};
|
|
4449
|
+
});
|
|
4450
|
+
function startTimer() {
|
|
4451
|
+
if (props.duration > 0) {
|
|
4452
|
+
({ stop: timer } = useTimeoutFn(() => {
|
|
4453
|
+
if (visible.value) close2();
|
|
4454
|
+
}, props.duration));
|
|
4455
|
+
}
|
|
4456
|
+
}
|
|
4457
|
+
function clearTimer() {
|
|
4458
|
+
timer == null ? void 0 : timer();
|
|
4459
|
+
}
|
|
4460
|
+
function close2() {
|
|
4461
|
+
visible.value = false;
|
|
4462
|
+
}
|
|
4463
|
+
function onKeydown({ code }) {
|
|
4464
|
+
if (code === EVENT_CODE.delete || code === EVENT_CODE.backspace) {
|
|
4465
|
+
clearTimer();
|
|
4466
|
+
} else if (code === EVENT_CODE.esc) {
|
|
4467
|
+
if (visible.value) {
|
|
4468
|
+
close2();
|
|
4469
|
+
}
|
|
4470
|
+
} else {
|
|
4471
|
+
startTimer();
|
|
4472
|
+
}
|
|
4473
|
+
}
|
|
4474
|
+
onMounted(() => {
|
|
4475
|
+
startTimer();
|
|
4476
|
+
nextZIndex();
|
|
4477
|
+
visible.value = true;
|
|
4478
|
+
});
|
|
4479
|
+
useEventListener(document, "keydown", onKeydown);
|
|
4480
|
+
__expose({
|
|
4481
|
+
visible,
|
|
4482
|
+
/** @description close notification */
|
|
4483
|
+
close: close2
|
|
4484
|
+
});
|
|
4485
|
+
return (_ctx, _cache) => {
|
|
4486
|
+
return openBlock(), createBlock(Transition, {
|
|
4487
|
+
name: "imax-notification-fade",
|
|
4488
|
+
onBeforeLeave: __props.onClose,
|
|
4489
|
+
onAfterLeave: _cache[1] || (_cache[1] = ($event) => emit("destroy"))
|
|
4490
|
+
}, {
|
|
4491
|
+
default: withCtx(() => [
|
|
4492
|
+
withDirectives(createElementVNode("div", {
|
|
4493
|
+
id: __props.id,
|
|
4494
|
+
class: normalizeClass([unref(ns).b(), __props.customClass, horizontalClass.value]),
|
|
4495
|
+
style: normalizeStyle(positionStyle.value),
|
|
4496
|
+
role: "alert",
|
|
4497
|
+
onMouseenter: clearTimer,
|
|
4498
|
+
onMouseleave: startTimer,
|
|
4499
|
+
onClick: _cache[0] || (_cache[0] = //@ts-ignore
|
|
4500
|
+
(...args) => __props.onClick && __props.onClick(...args))
|
|
4501
|
+
}, [
|
|
4502
|
+
iconComponent.value ? (openBlock(), createBlock(unref(XBasicSvgIcon), {
|
|
4503
|
+
key: 0,
|
|
4504
|
+
class: normalizeClass([unref(ns).e("icon"), typeClass.value]),
|
|
4505
|
+
icon: iconComponent.value
|
|
4506
|
+
}, null, 8, ["class", "icon"])) : createCommentVNode("", true),
|
|
4507
|
+
createElementVNode("div", {
|
|
4508
|
+
class: normalizeClass(unref(ns).e("group"))
|
|
4509
|
+
}, [
|
|
4510
|
+
createElementVNode("h2", {
|
|
4511
|
+
class: normalizeClass(unref(ns).e("title")),
|
|
4512
|
+
textContent: toDisplayString(__props.title)
|
|
4513
|
+
}, null, 10, _hoisted_2$3),
|
|
4514
|
+
withDirectives(createElementVNode("div", {
|
|
4515
|
+
class: normalizeClass(unref(ns).e("content")),
|
|
4516
|
+
style: normalizeStyle(!!__props.title ? void 0 : { margin: 0 })
|
|
4517
|
+
}, [
|
|
4518
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
4519
|
+
!__props.dangerouslyUseHTMLString ? (openBlock(), createElementBlock("p", _hoisted_3, toDisplayString(__props.message), 1)) : (openBlock(), createElementBlock("p", {
|
|
4520
|
+
key: 1,
|
|
4521
|
+
innerHTML: __props.message
|
|
4522
|
+
}, null, 8, _hoisted_4))
|
|
4523
|
+
])
|
|
4524
|
+
], 6), [
|
|
4525
|
+
[vShow, __props.message]
|
|
4526
|
+
]),
|
|
4527
|
+
createElementVNode("span", {
|
|
4528
|
+
onClick: withModifiers(close2, ["stop"])
|
|
4529
|
+
}, [
|
|
4530
|
+
__props.showClose ? (openBlock(), createBlock(unref(XBasicSvgIcon), {
|
|
4531
|
+
key: 0,
|
|
4532
|
+
class: normalizeClass(unref(ns).e("closeBtn")),
|
|
4533
|
+
icon: "ri:close-line"
|
|
4534
|
+
}, null, 8, ["class"])) : createCommentVNode("", true)
|
|
4535
|
+
])
|
|
4536
|
+
], 2)
|
|
4537
|
+
], 46, _hoisted_1$a), [
|
|
4538
|
+
[vShow, visible.value]
|
|
4539
|
+
])
|
|
4540
|
+
]),
|
|
4541
|
+
_: 3
|
|
4542
|
+
}, 8, ["onBeforeLeave"]);
|
|
4543
|
+
};
|
|
4544
|
+
}
|
|
4545
|
+
});
|
|
4546
|
+
const notificationTypes = ["success", "info", "warning", "error"];
|
|
4547
|
+
const notifications = {
|
|
4548
|
+
"top-left": [],
|
|
4549
|
+
"top-right": [],
|
|
4550
|
+
"bottom-left": [],
|
|
4551
|
+
"bottom-right": []
|
|
4552
|
+
};
|
|
4553
|
+
const GAP_SIZE = 16;
|
|
4554
|
+
let seed = 1;
|
|
4555
|
+
const notify = (options, context) => {
|
|
4556
|
+
if (!isClient$1) return { close: () => void 0 };
|
|
4557
|
+
if (isString(options) || isVNode(options)) {
|
|
4558
|
+
options = { message: options };
|
|
4559
|
+
}
|
|
4560
|
+
const position = (options == null ? void 0 : options.position) || "top-right";
|
|
4561
|
+
let verticalOffset = (options == null ? void 0 : options.offset) || 0;
|
|
4562
|
+
notifications[position].forEach(({ vm: vm2 }) => {
|
|
4563
|
+
var _a;
|
|
4564
|
+
verticalOffset += (((_a = vm2.el) == null ? void 0 : _a.offsetHeight) || 0) + GAP_SIZE;
|
|
4565
|
+
});
|
|
4566
|
+
verticalOffset += GAP_SIZE;
|
|
4567
|
+
const id = `notification_${seed++}`;
|
|
4568
|
+
const userOnClose = options == null ? void 0 : options.onClose;
|
|
4569
|
+
const props = {
|
|
4570
|
+
...options,
|
|
4571
|
+
offset: verticalOffset,
|
|
4572
|
+
id,
|
|
4573
|
+
onClose: () => {
|
|
4574
|
+
close(id, position, userOnClose);
|
|
4575
|
+
}
|
|
4576
|
+
};
|
|
4577
|
+
let appendTo = document.body;
|
|
4578
|
+
if (isElement(options == null ? void 0 : options.appendTo)) {
|
|
4579
|
+
appendTo = options == null ? void 0 : options.appendTo;
|
|
4580
|
+
} else if (isString(options == null ? void 0 : options.appendTo)) {
|
|
4581
|
+
appendTo = document.querySelector(options == null ? void 0 : options.appendTo);
|
|
4582
|
+
}
|
|
4583
|
+
if (!isElement(appendTo)) {
|
|
4584
|
+
console.warn("the appendTo option is not an HTMLElement. Falling back to document.body.");
|
|
4585
|
+
appendTo = document.body;
|
|
4586
|
+
}
|
|
4587
|
+
const container = document.createElement("div");
|
|
4588
|
+
const vm = createVNode(_sfc_main$I, props, isFunction(props.message) ? props.message : isVNode(props.message) ? () => props.message : null);
|
|
4589
|
+
vm.appContext = isUndefined(context) ? notify._context : context;
|
|
4590
|
+
vm.props.onDestroy = () => {
|
|
4591
|
+
render$1(null, container);
|
|
4592
|
+
};
|
|
4593
|
+
render$1(vm, container);
|
|
4594
|
+
notifications[position].push({ vm });
|
|
4595
|
+
appendTo.appendChild(container.firstElementChild);
|
|
4596
|
+
return {
|
|
4597
|
+
// instead of calling the onClose function directly, setting this value so that we can have the full lifecycle
|
|
4598
|
+
// for out component, so that all closing steps will not be skipped.
|
|
4599
|
+
close: () => {
|
|
4600
|
+
vm.component.exposed.visible.value = false;
|
|
4601
|
+
}
|
|
4602
|
+
};
|
|
4603
|
+
};
|
|
4604
|
+
notificationTypes.forEach((type) => {
|
|
4605
|
+
notify[type] = (options = {}, appContext) => {
|
|
4606
|
+
if (isString(options) || isVNode(options)) {
|
|
4607
|
+
options = {
|
|
4608
|
+
message: options
|
|
4609
|
+
};
|
|
4610
|
+
}
|
|
4611
|
+
return notify({ ...options, type }, appContext);
|
|
4612
|
+
};
|
|
4613
|
+
});
|
|
4614
|
+
function close(id, position, userOnClose) {
|
|
4615
|
+
const orientedNotifications = notifications[position];
|
|
4616
|
+
const idx = orientedNotifications.findIndex(({ vm: vm2 }) => {
|
|
4617
|
+
var _a;
|
|
4618
|
+
return ((_a = vm2.component) == null ? void 0 : _a.props.id) === id;
|
|
4619
|
+
});
|
|
4620
|
+
if (idx === -1) return;
|
|
4621
|
+
const { vm } = orientedNotifications[idx];
|
|
4622
|
+
if (!vm) return;
|
|
4623
|
+
userOnClose == null ? void 0 : userOnClose(vm);
|
|
4624
|
+
const removedHeight = vm.el.offsetHeight;
|
|
4625
|
+
const verticalPos = (position == null ? void 0 : position.split("-")[0]) || "top";
|
|
4626
|
+
orientedNotifications.splice(idx, 1);
|
|
4627
|
+
const len = orientedNotifications.length;
|
|
4628
|
+
if (len < 1) return;
|
|
4629
|
+
for (let i = idx; i < len; i++) {
|
|
4630
|
+
const { el, component } = orientedNotifications[i].vm;
|
|
4631
|
+
const pos = Number.parseInt(el.style[verticalPos], 10) - removedHeight - GAP_SIZE;
|
|
4632
|
+
component.props.offset = pos;
|
|
4633
|
+
}
|
|
4634
|
+
}
|
|
4635
|
+
function closeAll() {
|
|
4636
|
+
for (const orientedNotifications of Object.values(notifications)) {
|
|
4637
|
+
orientedNotifications.forEach(({ vm }) => {
|
|
4638
|
+
vm.component.exposed.visible.value = false;
|
|
4639
|
+
});
|
|
4640
|
+
}
|
|
4641
|
+
}
|
|
4642
|
+
notify.closeAll = closeAll;
|
|
4643
|
+
notify._context = null;
|
|
4644
|
+
const $Notification = notify;
|
|
4645
|
+
const XBasicNotification = $Notification;
|
|
4646
|
+
const _sfc_main$H = /* @__PURE__ */ defineComponent({
|
|
4398
4647
|
__name: "BasicButtonExportMax",
|
|
4399
4648
|
props: {
|
|
4400
4649
|
drop: { type: Boolean, default: true },
|
|
@@ -4414,7 +4663,7 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
|
4414
4663
|
const props = __props;
|
|
4415
4664
|
const emit = __emit;
|
|
4416
4665
|
const { b } = useNamespace("basic-button-export-max");
|
|
4417
|
-
const { b: bm, e: em } = useNamespace("basic-button-
|
|
4666
|
+
const { b: bm, e: em } = useNamespace("basic-button-em-modal");
|
|
4418
4667
|
const progressVisible = ref(false);
|
|
4419
4668
|
const progressPercent = ref(0);
|
|
4420
4669
|
const attrs = useAttrs();
|
|
@@ -4425,8 +4674,20 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
|
4425
4674
|
return option;
|
|
4426
4675
|
});
|
|
4427
4676
|
});
|
|
4428
|
-
function
|
|
4429
|
-
|
|
4677
|
+
async function runBeforeFetchGuard(key2) {
|
|
4678
|
+
if (!props.beforeFetch || !isFunction(props.beforeFetch)) return { pass: true, params: {} };
|
|
4679
|
+
try {
|
|
4680
|
+
const result = await props.beforeFetch(key2);
|
|
4681
|
+
if (result === false) return { pass: false, params: {} };
|
|
4682
|
+
if (isString(result) && result) {
|
|
4683
|
+
XBasicNotification.error(result);
|
|
4684
|
+
return { pass: false, params: {} };
|
|
4685
|
+
}
|
|
4686
|
+
return { pass: true, params: result || {} };
|
|
4687
|
+
} catch (error) {
|
|
4688
|
+
console.error(error);
|
|
4689
|
+
return { pass: false, params: {} };
|
|
4690
|
+
}
|
|
4430
4691
|
}
|
|
4431
4692
|
function getFetchApi(key2) {
|
|
4432
4693
|
var _a;
|
|
@@ -4442,8 +4703,9 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
|
4442
4703
|
}
|
|
4443
4704
|
async function trigger(key2) {
|
|
4444
4705
|
const api = getFetchApi(key2);
|
|
4445
|
-
const params = getFetchParams(key2);
|
|
4446
4706
|
if (!api) return;
|
|
4707
|
+
const { pass, params } = await runBeforeFetchGuard(key2);
|
|
4708
|
+
if (!pass) return;
|
|
4447
4709
|
if (props.showProgress) {
|
|
4448
4710
|
progressPercent.value = 0;
|
|
4449
4711
|
progressVisible.value = true;
|
|
@@ -4465,7 +4727,6 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
|
4465
4727
|
trigger("max");
|
|
4466
4728
|
}
|
|
4467
4729
|
return (_ctx, _cache) => {
|
|
4468
|
-
const _component_XBasicButton = resolveComponent("XBasicButton");
|
|
4469
4730
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
4470
4731
|
__props.drop ? (openBlock(), createBlock(_sfc_main$O, mergeProps({
|
|
4471
4732
|
key: 0,
|
|
@@ -4479,7 +4740,7 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
|
4479
4740
|
])
|
|
4480
4741
|
]),
|
|
4481
4742
|
_: 3
|
|
4482
|
-
}, 16, ["icon", "options", "class"])) : (openBlock(), createBlock(
|
|
4743
|
+
}, 16, ["icon", "options", "class"])) : (openBlock(), createBlock(unref(XBasicButton), mergeProps({
|
|
4483
4744
|
key: 1,
|
|
4484
4745
|
icon: __props.icon,
|
|
4485
4746
|
type: "primary"
|
|
@@ -4495,32 +4756,35 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
|
4495
4756
|
show: progressVisible.value,
|
|
4496
4757
|
"onUpdate:show": _cache[0] || (_cache[0] = ($event) => progressVisible.value = $event),
|
|
4497
4758
|
closable: false,
|
|
4498
|
-
|
|
4499
|
-
|
|
4759
|
+
"mask-closable": false,
|
|
4760
|
+
"show-mask": false
|
|
4500
4761
|
}, {
|
|
4501
4762
|
default: withCtx(() => [
|
|
4502
4763
|
createElementVNode("div", {
|
|
4503
|
-
class: normalizeClass(unref(
|
|
4764
|
+
class: normalizeClass(unref(bm)())
|
|
4504
4765
|
}, [
|
|
4505
|
-
|
|
4506
|
-
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
|
|
4510
|
-
|
|
4766
|
+
createElementVNode("div", {
|
|
4767
|
+
class: normalizeClass(unref(em)("content"))
|
|
4768
|
+
}, [
|
|
4769
|
+
createVNode(unref(NProgress), {
|
|
4770
|
+
type: "circle",
|
|
4771
|
+
percentage: progressPercent.value
|
|
4772
|
+
}, null, 8, ["percentage"]),
|
|
4773
|
+
createElementVNode("p", null, toDisplayString(unref(t)("max.basic.downloading")), 1)
|
|
4774
|
+
], 2)
|
|
4511
4775
|
], 2)
|
|
4512
4776
|
]),
|
|
4513
4777
|
_: 1
|
|
4514
|
-
}, 8, ["show"
|
|
4778
|
+
}, 8, ["show"])
|
|
4515
4779
|
], 64);
|
|
4516
4780
|
};
|
|
4517
4781
|
}
|
|
4518
4782
|
});
|
|
4519
|
-
const XBasicButtonExportMax = withInstall(_sfc_main$
|
|
4783
|
+
const XBasicButtonExportMax = withInstall(_sfc_main$H);
|
|
4520
4784
|
function _isSlot$3(s) {
|
|
4521
4785
|
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
4522
4786
|
}
|
|
4523
|
-
const _sfc_main$
|
|
4787
|
+
const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
4524
4788
|
name: "ButtonGroupItem",
|
|
4525
4789
|
props: {
|
|
4526
4790
|
schema: {
|
|
@@ -4873,7 +5137,7 @@ function useButtonGroupSchema({ getProps, schemaRef }) {
|
|
|
4873
5137
|
});
|
|
4874
5138
|
return { getSchema };
|
|
4875
5139
|
}
|
|
4876
|
-
const _sfc_main$
|
|
5140
|
+
const _sfc_main$F = /* @__PURE__ */ defineComponent({
|
|
4877
5141
|
__name: "BasicButtonGroup",
|
|
4878
5142
|
props: {
|
|
4879
5143
|
showReturnButton: { type: Boolean },
|
|
@@ -4954,7 +5218,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
4954
5218
|
return (_ctx, _cache) => {
|
|
4955
5219
|
return openBlock(), createElementBlock("div", mergeProps({ class: unref(getWrapperClass) }, getBindValue.value), [
|
|
4956
5220
|
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(getSchema), (schema) => {
|
|
4957
|
-
return openBlock(), createBlock(_sfc_main$
|
|
5221
|
+
return openBlock(), createBlock(_sfc_main$G, {
|
|
4958
5222
|
key: schema.field,
|
|
4959
5223
|
schema,
|
|
4960
5224
|
"button-group-action-type": buttonGroupActionType,
|
|
@@ -4975,256 +5239,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
4975
5239
|
};
|
|
4976
5240
|
}
|
|
4977
5241
|
});
|
|
4978
|
-
const XBasicButtonGroup = withInstall(_sfc_main$
|
|
4979
|
-
const _hoisted_1$a = ["id"];
|
|
4980
|
-
const _hoisted_2$3 = ["textContent"];
|
|
4981
|
-
const _hoisted_3 = { key: 0 };
|
|
4982
|
-
const _hoisted_4 = ["innerHTML"];
|
|
4983
|
-
const _sfc_main$F = /* @__PURE__ */ defineComponent({
|
|
4984
|
-
__name: "BasicNotification",
|
|
4985
|
-
props: {
|
|
4986
|
-
customClass: { default: "" },
|
|
4987
|
-
dangerouslyUseHTMLString: { type: Boolean },
|
|
4988
|
-
duration: { default: 4500 },
|
|
4989
|
-
icon: {},
|
|
4990
|
-
id: { default: "" },
|
|
4991
|
-
message: {},
|
|
4992
|
-
offset: { default: 0 },
|
|
4993
|
-
onClick: { type: Function, default: () => void 0 },
|
|
4994
|
-
onClose: {},
|
|
4995
|
-
position: { default: "top-right" },
|
|
4996
|
-
showClose: { type: Boolean, default: true },
|
|
4997
|
-
title: { default: "" },
|
|
4998
|
-
type: { default: "" },
|
|
4999
|
-
zIndex: {}
|
|
5000
|
-
},
|
|
5001
|
-
emits: ["destroy"],
|
|
5002
|
-
setup(__props, { expose: __expose, emit: __emit }) {
|
|
5003
|
-
const props = __props;
|
|
5004
|
-
const emit = __emit;
|
|
5005
|
-
const { ns, zIndex: zIndex2 } = useConfigProvider("basic-notification");
|
|
5006
|
-
const { nextZIndex, currentZIndex } = zIndex2;
|
|
5007
|
-
const visible = ref(false);
|
|
5008
|
-
let timer;
|
|
5009
|
-
const iconMap = {
|
|
5010
|
-
success: "ri:checkbox-circle-line",
|
|
5011
|
-
error: "ri:close-circle-line",
|
|
5012
|
-
info: "ri:information-line",
|
|
5013
|
-
warning: "ri:error-warning-line"
|
|
5014
|
-
};
|
|
5015
|
-
const typeClass = computed(() => {
|
|
5016
|
-
const type = props.type;
|
|
5017
|
-
return type && iconMap[props.type] ? ns.m(type) : "";
|
|
5018
|
-
});
|
|
5019
|
-
const iconComponent = computed(() => {
|
|
5020
|
-
if (!props.type) return props.icon;
|
|
5021
|
-
return iconMap[props.type] || props.icon;
|
|
5022
|
-
});
|
|
5023
|
-
const horizontalClass = computed(() => props.position.endsWith("right") ? "right" : "left");
|
|
5024
|
-
const verticalProperty = computed(() => props.position.startsWith("top") ? "top" : "bottom");
|
|
5025
|
-
const positionStyle = computed(() => {
|
|
5026
|
-
var _a;
|
|
5027
|
-
return {
|
|
5028
|
-
[verticalProperty.value]: `${props.offset}px`,
|
|
5029
|
-
zIndex: (_a = props.zIndex) != null ? _a : currentZIndex.value
|
|
5030
|
-
};
|
|
5031
|
-
});
|
|
5032
|
-
function startTimer() {
|
|
5033
|
-
if (props.duration > 0) {
|
|
5034
|
-
({ stop: timer } = useTimeoutFn(() => {
|
|
5035
|
-
if (visible.value) close2();
|
|
5036
|
-
}, props.duration));
|
|
5037
|
-
}
|
|
5038
|
-
}
|
|
5039
|
-
function clearTimer() {
|
|
5040
|
-
timer == null ? void 0 : timer();
|
|
5041
|
-
}
|
|
5042
|
-
function close2() {
|
|
5043
|
-
visible.value = false;
|
|
5044
|
-
}
|
|
5045
|
-
function onKeydown({ code }) {
|
|
5046
|
-
if (code === EVENT_CODE.delete || code === EVENT_CODE.backspace) {
|
|
5047
|
-
clearTimer();
|
|
5048
|
-
} else if (code === EVENT_CODE.esc) {
|
|
5049
|
-
if (visible.value) {
|
|
5050
|
-
close2();
|
|
5051
|
-
}
|
|
5052
|
-
} else {
|
|
5053
|
-
startTimer();
|
|
5054
|
-
}
|
|
5055
|
-
}
|
|
5056
|
-
onMounted(() => {
|
|
5057
|
-
startTimer();
|
|
5058
|
-
nextZIndex();
|
|
5059
|
-
visible.value = true;
|
|
5060
|
-
});
|
|
5061
|
-
useEventListener(document, "keydown", onKeydown);
|
|
5062
|
-
__expose({
|
|
5063
|
-
visible,
|
|
5064
|
-
/** @description close notification */
|
|
5065
|
-
close: close2
|
|
5066
|
-
});
|
|
5067
|
-
return (_ctx, _cache) => {
|
|
5068
|
-
return openBlock(), createBlock(Transition, {
|
|
5069
|
-
name: "imax-notification-fade",
|
|
5070
|
-
onBeforeLeave: __props.onClose,
|
|
5071
|
-
onAfterLeave: _cache[1] || (_cache[1] = ($event) => emit("destroy"))
|
|
5072
|
-
}, {
|
|
5073
|
-
default: withCtx(() => [
|
|
5074
|
-
withDirectives(createElementVNode("div", {
|
|
5075
|
-
id: __props.id,
|
|
5076
|
-
class: normalizeClass([unref(ns).b(), __props.customClass, horizontalClass.value]),
|
|
5077
|
-
style: normalizeStyle(positionStyle.value),
|
|
5078
|
-
role: "alert",
|
|
5079
|
-
onMouseenter: clearTimer,
|
|
5080
|
-
onMouseleave: startTimer,
|
|
5081
|
-
onClick: _cache[0] || (_cache[0] = //@ts-ignore
|
|
5082
|
-
(...args) => __props.onClick && __props.onClick(...args))
|
|
5083
|
-
}, [
|
|
5084
|
-
iconComponent.value ? (openBlock(), createBlock(unref(XBasicSvgIcon), {
|
|
5085
|
-
key: 0,
|
|
5086
|
-
class: normalizeClass([unref(ns).e("icon"), typeClass.value]),
|
|
5087
|
-
icon: iconComponent.value
|
|
5088
|
-
}, null, 8, ["class", "icon"])) : createCommentVNode("", true),
|
|
5089
|
-
createElementVNode("div", {
|
|
5090
|
-
class: normalizeClass(unref(ns).e("group"))
|
|
5091
|
-
}, [
|
|
5092
|
-
createElementVNode("h2", {
|
|
5093
|
-
class: normalizeClass(unref(ns).e("title")),
|
|
5094
|
-
textContent: toDisplayString(__props.title)
|
|
5095
|
-
}, null, 10, _hoisted_2$3),
|
|
5096
|
-
withDirectives(createElementVNode("div", {
|
|
5097
|
-
class: normalizeClass(unref(ns).e("content")),
|
|
5098
|
-
style: normalizeStyle(!!__props.title ? void 0 : { margin: 0 })
|
|
5099
|
-
}, [
|
|
5100
|
-
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
5101
|
-
!__props.dangerouslyUseHTMLString ? (openBlock(), createElementBlock("p", _hoisted_3, toDisplayString(__props.message), 1)) : (openBlock(), createElementBlock("p", {
|
|
5102
|
-
key: 1,
|
|
5103
|
-
innerHTML: __props.message
|
|
5104
|
-
}, null, 8, _hoisted_4))
|
|
5105
|
-
])
|
|
5106
|
-
], 6), [
|
|
5107
|
-
[vShow, __props.message]
|
|
5108
|
-
]),
|
|
5109
|
-
createElementVNode("span", {
|
|
5110
|
-
onClick: withModifiers(close2, ["stop"])
|
|
5111
|
-
}, [
|
|
5112
|
-
__props.showClose ? (openBlock(), createBlock(unref(XBasicSvgIcon), {
|
|
5113
|
-
key: 0,
|
|
5114
|
-
class: normalizeClass(unref(ns).e("closeBtn")),
|
|
5115
|
-
icon: "ri:close-line"
|
|
5116
|
-
}, null, 8, ["class"])) : createCommentVNode("", true)
|
|
5117
|
-
])
|
|
5118
|
-
], 2)
|
|
5119
|
-
], 46, _hoisted_1$a), [
|
|
5120
|
-
[vShow, visible.value]
|
|
5121
|
-
])
|
|
5122
|
-
]),
|
|
5123
|
-
_: 3
|
|
5124
|
-
}, 8, ["onBeforeLeave"]);
|
|
5125
|
-
};
|
|
5126
|
-
}
|
|
5127
|
-
});
|
|
5128
|
-
const notificationTypes = ["success", "info", "warning", "error"];
|
|
5129
|
-
const notifications = {
|
|
5130
|
-
"top-left": [],
|
|
5131
|
-
"top-right": [],
|
|
5132
|
-
"bottom-left": [],
|
|
5133
|
-
"bottom-right": []
|
|
5134
|
-
};
|
|
5135
|
-
const GAP_SIZE = 16;
|
|
5136
|
-
let seed = 1;
|
|
5137
|
-
const notify = (options, context) => {
|
|
5138
|
-
if (!isClient$1) return { close: () => void 0 };
|
|
5139
|
-
if (isString(options) || isVNode(options)) {
|
|
5140
|
-
options = { message: options };
|
|
5141
|
-
}
|
|
5142
|
-
const position = (options == null ? void 0 : options.position) || "top-right";
|
|
5143
|
-
let verticalOffset = (options == null ? void 0 : options.offset) || 0;
|
|
5144
|
-
notifications[position].forEach(({ vm: vm2 }) => {
|
|
5145
|
-
var _a;
|
|
5146
|
-
verticalOffset += (((_a = vm2.el) == null ? void 0 : _a.offsetHeight) || 0) + GAP_SIZE;
|
|
5147
|
-
});
|
|
5148
|
-
verticalOffset += GAP_SIZE;
|
|
5149
|
-
const id = `notification_${seed++}`;
|
|
5150
|
-
const userOnClose = options == null ? void 0 : options.onClose;
|
|
5151
|
-
const props = {
|
|
5152
|
-
...options,
|
|
5153
|
-
offset: verticalOffset,
|
|
5154
|
-
id,
|
|
5155
|
-
onClose: () => {
|
|
5156
|
-
close(id, position, userOnClose);
|
|
5157
|
-
}
|
|
5158
|
-
};
|
|
5159
|
-
let appendTo = document.body;
|
|
5160
|
-
if (isElement(options == null ? void 0 : options.appendTo)) {
|
|
5161
|
-
appendTo = options == null ? void 0 : options.appendTo;
|
|
5162
|
-
} else if (isString(options == null ? void 0 : options.appendTo)) {
|
|
5163
|
-
appendTo = document.querySelector(options == null ? void 0 : options.appendTo);
|
|
5164
|
-
}
|
|
5165
|
-
if (!isElement(appendTo)) {
|
|
5166
|
-
console.warn("the appendTo option is not an HTMLElement. Falling back to document.body.");
|
|
5167
|
-
appendTo = document.body;
|
|
5168
|
-
}
|
|
5169
|
-
const container = document.createElement("div");
|
|
5170
|
-
const vm = createVNode(_sfc_main$F, props, isFunction(props.message) ? props.message : isVNode(props.message) ? () => props.message : null);
|
|
5171
|
-
vm.appContext = isUndefined(context) ? notify._context : context;
|
|
5172
|
-
vm.props.onDestroy = () => {
|
|
5173
|
-
render$1(null, container);
|
|
5174
|
-
};
|
|
5175
|
-
render$1(vm, container);
|
|
5176
|
-
notifications[position].push({ vm });
|
|
5177
|
-
appendTo.appendChild(container.firstElementChild);
|
|
5178
|
-
return {
|
|
5179
|
-
// instead of calling the onClose function directly, setting this value so that we can have the full lifecycle
|
|
5180
|
-
// for out component, so that all closing steps will not be skipped.
|
|
5181
|
-
close: () => {
|
|
5182
|
-
vm.component.exposed.visible.value = false;
|
|
5183
|
-
}
|
|
5184
|
-
};
|
|
5185
|
-
};
|
|
5186
|
-
notificationTypes.forEach((type) => {
|
|
5187
|
-
notify[type] = (options = {}, appContext) => {
|
|
5188
|
-
if (isString(options) || isVNode(options)) {
|
|
5189
|
-
options = {
|
|
5190
|
-
message: options
|
|
5191
|
-
};
|
|
5192
|
-
}
|
|
5193
|
-
return notify({ ...options, type }, appContext);
|
|
5194
|
-
};
|
|
5195
|
-
});
|
|
5196
|
-
function close(id, position, userOnClose) {
|
|
5197
|
-
const orientedNotifications = notifications[position];
|
|
5198
|
-
const idx = orientedNotifications.findIndex(({ vm: vm2 }) => {
|
|
5199
|
-
var _a;
|
|
5200
|
-
return ((_a = vm2.component) == null ? void 0 : _a.props.id) === id;
|
|
5201
|
-
});
|
|
5202
|
-
if (idx === -1) return;
|
|
5203
|
-
const { vm } = orientedNotifications[idx];
|
|
5204
|
-
if (!vm) return;
|
|
5205
|
-
userOnClose == null ? void 0 : userOnClose(vm);
|
|
5206
|
-
const removedHeight = vm.el.offsetHeight;
|
|
5207
|
-
const verticalPos = (position == null ? void 0 : position.split("-")[0]) || "top";
|
|
5208
|
-
orientedNotifications.splice(idx, 1);
|
|
5209
|
-
const len = orientedNotifications.length;
|
|
5210
|
-
if (len < 1) return;
|
|
5211
|
-
for (let i = idx; i < len; i++) {
|
|
5212
|
-
const { el, component } = orientedNotifications[i].vm;
|
|
5213
|
-
const pos = Number.parseInt(el.style[verticalPos], 10) - removedHeight - GAP_SIZE;
|
|
5214
|
-
component.props.offset = pos;
|
|
5215
|
-
}
|
|
5216
|
-
}
|
|
5217
|
-
function closeAll() {
|
|
5218
|
-
for (const orientedNotifications of Object.values(notifications)) {
|
|
5219
|
-
orientedNotifications.forEach(({ vm }) => {
|
|
5220
|
-
vm.component.exposed.visible.value = false;
|
|
5221
|
-
});
|
|
5222
|
-
}
|
|
5223
|
-
}
|
|
5224
|
-
notify.closeAll = closeAll;
|
|
5225
|
-
notify._context = null;
|
|
5226
|
-
const $Notification = notify;
|
|
5227
|
-
const XBasicNotification = $Notification;
|
|
5242
|
+
const XBasicButtonGroup = withInstall(_sfc_main$F);
|
|
5228
5243
|
const ROW_KEY$1 = "_MAX_ROW_KEY";
|
|
5229
5244
|
const PAGE_SIZE_OPTIONS$1 = [10, 50, 80, 100];
|
|
5230
5245
|
const PAGE_SIZE$1 = 10;
|