build-dxf 0.1.20 → 0.1.21
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/package.json +1 -1
- package/src/build.js +16 -1
- package/src/index.css +23 -1
- package/src/index3.js +1427 -374
- package/src/utils/CommandManager/CommandFlow.d.ts +4 -1
- package/src/utils/CommandManager/CommandManager.d.ts +5 -0
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/CommandFlowComponent.d.ts +1 -0
- package/src/utils/DxfSystem/plugin/Editor/pages/EditorTool.vue.d.ts +1 -1
package/src/index3.js
CHANGED
|
@@ -4,7 +4,7 @@ import "clipper-lib";
|
|
|
4
4
|
import "dxf-writer";
|
|
5
5
|
import { D as DomEventRegister } from "./DomEventRegister.js";
|
|
6
6
|
import "three/addons/controls/OrbitControls.js";
|
|
7
|
-
import { getCurrentInstance, inject, ref, computed, unref, shallowRef, watchEffect, readonly, getCurrentScope, onScopeDispose, onMounted, nextTick, watch, isRef, warn, provide, defineComponent, createElementBlock, openBlock, mergeProps, renderSlot, createElementVNode, toRef, onUnmounted, useAttrs as useAttrs$1, useSlots, normalizeStyle, normalizeClass, createCommentVNode, Fragment, createBlock, withCtx, resolveDynamicComponent, withModifiers, createVNode, toDisplayString, onBeforeUnmount, Transition, withDirectives, vShow, reactive, onActivated, onUpdated, cloneVNode, Text, Comment, Teleport as Teleport$1, onBeforeMount, onDeactivated, createTextVNode, toRaw, vModelCheckbox, toRefs, resolveComponent, normalizeProps, guardReactiveProps, createSlots, shallowReactive, isVNode, render, createStaticVNode, renderList, TransitionGroup, createApp } from "vue";
|
|
7
|
+
import { getCurrentInstance, inject, ref, computed, unref, shallowRef, watchEffect, readonly, getCurrentScope, onScopeDispose, onMounted, nextTick, watch, isRef, warn, provide, defineComponent, createElementBlock, openBlock, mergeProps, renderSlot, createElementVNode, toRef, onUnmounted, useAttrs as useAttrs$1, useSlots, normalizeStyle, normalizeClass, createCommentVNode, Fragment, createBlock, withCtx, resolveDynamicComponent, withModifiers, createVNode, toDisplayString, onBeforeUnmount, Transition, withDirectives, vShow, reactive, onActivated, onUpdated, cloneVNode, Text, Comment, Teleport as Teleport$1, onBeforeMount, onDeactivated, createTextVNode, toRaw, vModelCheckbox, toRefs, h, resolveComponent, normalizeProps, guardReactiveProps, createSlots, shallowReactive, isVNode, render, withKeys, markRaw, createStaticVNode, renderList, TransitionGroup, createApp } from "vue";
|
|
8
8
|
const VerticalCorr$1 = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='10587'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M64.21%20703.88h888.34M64.21%20667.88h888.34v72H64.21z'%3e%3c/path%3e%3cpath%20d='M509.58%20102.72v566.13M473.58%20102.72h72v566.14h-72z'%3e%3c/path%3e%3c/svg%3e";
|
|
9
9
|
const __vite_glob_0_0 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
10
10
|
__proto__: null,
|
|
@@ -183,6 +183,19 @@ const isArray$1 = Array.isArray;
|
|
|
183
183
|
const isFunction$1 = (val) => typeof val === "function";
|
|
184
184
|
const isString$1 = (val) => typeof val === "string";
|
|
185
185
|
const isObject$1 = (val) => val !== null && typeof val === "object";
|
|
186
|
+
const cacheStringFunction = (fn2) => {
|
|
187
|
+
const cache = /* @__PURE__ */ Object.create(null);
|
|
188
|
+
return (str) => {
|
|
189
|
+
const hit = cache[str];
|
|
190
|
+
return hit || (cache[str] = fn2(str));
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
const camelizeRE = /-(\w)/g;
|
|
194
|
+
const camelize = cacheStringFunction(
|
|
195
|
+
(str) => {
|
|
196
|
+
return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
|
|
197
|
+
}
|
|
198
|
+
);
|
|
186
199
|
var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
|
|
187
200
|
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
|
|
188
201
|
var root = freeGlobal || freeSelf || Function("return this")();
|
|
@@ -1884,6 +1897,41 @@ var _export_sfc$1 = (sfc, props) => {
|
|
|
1884
1897
|
}
|
|
1885
1898
|
return target;
|
|
1886
1899
|
};
|
|
1900
|
+
const classNameToArray = (cls = "") => cls.split(" ").filter((item) => !!item.trim());
|
|
1901
|
+
const hasClass = (el, cls) => {
|
|
1902
|
+
if (!el || !cls)
|
|
1903
|
+
return false;
|
|
1904
|
+
if (cls.includes(" "))
|
|
1905
|
+
throw new Error("className should not contain space.");
|
|
1906
|
+
return el.classList.contains(cls);
|
|
1907
|
+
};
|
|
1908
|
+
const addClass = (el, cls) => {
|
|
1909
|
+
if (!el || !cls.trim())
|
|
1910
|
+
return;
|
|
1911
|
+
el.classList.add(...classNameToArray(cls));
|
|
1912
|
+
};
|
|
1913
|
+
const removeClass = (el, cls) => {
|
|
1914
|
+
if (!el || !cls.trim())
|
|
1915
|
+
return;
|
|
1916
|
+
el.classList.remove(...classNameToArray(cls));
|
|
1917
|
+
};
|
|
1918
|
+
const getStyle = (element, styleName) => {
|
|
1919
|
+
var _a2;
|
|
1920
|
+
if (!isClient || !element || !styleName)
|
|
1921
|
+
return "";
|
|
1922
|
+
let key = camelize(styleName);
|
|
1923
|
+
if (key === "float")
|
|
1924
|
+
key = "cssFloat";
|
|
1925
|
+
try {
|
|
1926
|
+
const style = element.style[key];
|
|
1927
|
+
if (style)
|
|
1928
|
+
return style;
|
|
1929
|
+
const computed2 = (_a2 = document.defaultView) == null ? void 0 : _a2.getComputedStyle(element, "");
|
|
1930
|
+
return computed2 ? computed2[key] : "";
|
|
1931
|
+
} catch (e) {
|
|
1932
|
+
return element.style[key];
|
|
1933
|
+
}
|
|
1934
|
+
};
|
|
1887
1935
|
function addUnit(value, defaultUnit = "px") {
|
|
1888
1936
|
if (!value)
|
|
1889
1937
|
return "";
|
|
@@ -1893,6 +1941,30 @@ function addUnit(value, defaultUnit = "px") {
|
|
|
1893
1941
|
return value;
|
|
1894
1942
|
}
|
|
1895
1943
|
}
|
|
1944
|
+
let scrollBarWidth;
|
|
1945
|
+
const getScrollBarWidth = (namespace) => {
|
|
1946
|
+
var _a2;
|
|
1947
|
+
if (!isClient)
|
|
1948
|
+
return 0;
|
|
1949
|
+
if (scrollBarWidth !== void 0)
|
|
1950
|
+
return scrollBarWidth;
|
|
1951
|
+
const outer = document.createElement("div");
|
|
1952
|
+
outer.className = `${namespace}-scrollbar__wrap`;
|
|
1953
|
+
outer.style.visibility = "hidden";
|
|
1954
|
+
outer.style.width = "100px";
|
|
1955
|
+
outer.style.position = "absolute";
|
|
1956
|
+
outer.style.top = "-9999px";
|
|
1957
|
+
document.body.appendChild(outer);
|
|
1958
|
+
const widthNoScroll = outer.offsetWidth;
|
|
1959
|
+
outer.style.overflow = "scroll";
|
|
1960
|
+
const inner = document.createElement("div");
|
|
1961
|
+
inner.style.width = "100%";
|
|
1962
|
+
outer.appendChild(inner);
|
|
1963
|
+
const widthWithScroll = inner.offsetWidth;
|
|
1964
|
+
(_a2 = outer.parentNode) == null ? void 0 : _a2.removeChild(outer);
|
|
1965
|
+
scrollBarWidth = widthNoScroll - widthWithScroll;
|
|
1966
|
+
return scrollBarWidth;
|
|
1967
|
+
};
|
|
1896
1968
|
class ElementPlusError extends Error {
|
|
1897
1969
|
constructor(m) {
|
|
1898
1970
|
super(m);
|
|
@@ -1940,7 +2012,7 @@ const __default__$g = defineComponent({
|
|
|
1940
2012
|
name: "ElIcon",
|
|
1941
2013
|
inheritAttrs: false
|
|
1942
2014
|
});
|
|
1943
|
-
const _sfc_main$
|
|
2015
|
+
const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
1944
2016
|
...__default__$g,
|
|
1945
2017
|
props: iconProps,
|
|
1946
2018
|
setup(__props) {
|
|
@@ -1965,7 +2037,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
1965
2037
|
};
|
|
1966
2038
|
}
|
|
1967
2039
|
});
|
|
1968
|
-
var Icon = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
2040
|
+
var Icon = /* @__PURE__ */ _export_sfc$1(_sfc_main$v, [["__file", "icon.vue"]]);
|
|
1969
2041
|
const ElIcon = withInstall(Icon);
|
|
1970
2042
|
function useTimeout() {
|
|
1971
2043
|
let timeoutHandle;
|
|
@@ -2212,7 +2284,11 @@ const iconPropType = definePropType([
|
|
|
2212
2284
|
Function
|
|
2213
2285
|
]);
|
|
2214
2286
|
const TypeComponents = {
|
|
2215
|
-
Close: close_default
|
|
2287
|
+
Close: close_default,
|
|
2288
|
+
SuccessFilled: success_filled_default,
|
|
2289
|
+
InfoFilled: info_filled_default,
|
|
2290
|
+
WarningFilled: warning_filled_default,
|
|
2291
|
+
CircleCloseFilled: circle_close_filled_default
|
|
2216
2292
|
};
|
|
2217
2293
|
const TypeComponentsMap = {
|
|
2218
2294
|
primary: info_filled_default,
|
|
@@ -2533,6 +2609,14 @@ const useFormDisabled = (fallback) => {
|
|
|
2533
2609
|
const form = inject(formContextKey, void 0);
|
|
2534
2610
|
return computed(() => disabled.value || unref(fallback) || (form == null ? void 0 : form.disabled) || false);
|
|
2535
2611
|
};
|
|
2612
|
+
const FOCUSABLE_ELEMENT_SELECTORS = `a[href],button:not([disabled]),button:not([hidden]),:not([tabindex="-1"]),input:not([disabled]),input:not([type="hidden"]),select:not([disabled]),textarea:not([disabled])`;
|
|
2613
|
+
const isVisible = (element) => {
|
|
2614
|
+
const computed2 = getComputedStyle(element);
|
|
2615
|
+
return computed2.position === "fixed" ? false : element.offsetParent !== null;
|
|
2616
|
+
};
|
|
2617
|
+
const obtainAllFocusableElements$1 = (element) => {
|
|
2618
|
+
return Array.from(element.querySelectorAll(FOCUSABLE_ELEMENT_SELECTORS)).filter((item) => isFocusable(item) && isVisible(item));
|
|
2619
|
+
};
|
|
2536
2620
|
const isFocusable = (element) => {
|
|
2537
2621
|
if (element.tabIndex > 0 || element.tabIndex === 0 && element.getAttribute("tabIndex") !== null) {
|
|
2538
2622
|
return true;
|
|
@@ -2691,7 +2775,7 @@ const __default__$f = defineComponent({
|
|
|
2691
2775
|
name: COMPONENT_NAME$2,
|
|
2692
2776
|
inheritAttrs: false
|
|
2693
2777
|
});
|
|
2694
|
-
const _sfc_main$
|
|
2778
|
+
const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
2695
2779
|
...__default__$f,
|
|
2696
2780
|
props: inputProps,
|
|
2697
2781
|
emits: inputEmits,
|
|
@@ -3101,7 +3185,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
3101
3185
|
};
|
|
3102
3186
|
}
|
|
3103
3187
|
});
|
|
3104
|
-
var Input = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
3188
|
+
var Input = /* @__PURE__ */ _export_sfc$1(_sfc_main$u, [["__file", "input.vue"]]);
|
|
3105
3189
|
const ElInput = withInstall(Input);
|
|
3106
3190
|
const GAP = 4;
|
|
3107
3191
|
const BAR_MAP = {
|
|
@@ -3146,7 +3230,7 @@ const thumbProps = buildProps({
|
|
|
3146
3230
|
always: Boolean
|
|
3147
3231
|
});
|
|
3148
3232
|
const COMPONENT_NAME$1 = "Thumb";
|
|
3149
|
-
const _sfc_main$
|
|
3233
|
+
const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
3150
3234
|
__name: "thumb",
|
|
3151
3235
|
props: thumbProps,
|
|
3152
3236
|
setup(__props) {
|
|
@@ -3275,7 +3359,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
3275
3359
|
};
|
|
3276
3360
|
}
|
|
3277
3361
|
});
|
|
3278
|
-
var Thumb = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
3362
|
+
var Thumb = /* @__PURE__ */ _export_sfc$1(_sfc_main$t, [["__file", "thumb.vue"]]);
|
|
3279
3363
|
const barProps = buildProps({
|
|
3280
3364
|
always: {
|
|
3281
3365
|
type: Boolean,
|
|
@@ -3286,7 +3370,7 @@ const barProps = buildProps({
|
|
|
3286
3370
|
required: true
|
|
3287
3371
|
}
|
|
3288
3372
|
});
|
|
3289
|
-
const _sfc_main$
|
|
3373
|
+
const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
3290
3374
|
__name: "bar",
|
|
3291
3375
|
props: barProps,
|
|
3292
3376
|
setup(__props, { expose }) {
|
|
@@ -3344,7 +3428,7 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
3344
3428
|
};
|
|
3345
3429
|
}
|
|
3346
3430
|
});
|
|
3347
|
-
var Bar = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
3431
|
+
var Bar = /* @__PURE__ */ _export_sfc$1(_sfc_main$s, [["__file", "bar.vue"]]);
|
|
3348
3432
|
const scrollbarProps = buildProps({
|
|
3349
3433
|
distance: {
|
|
3350
3434
|
type: Number,
|
|
@@ -3404,7 +3488,7 @@ const COMPONENT_NAME = "ElScrollbar";
|
|
|
3404
3488
|
const __default__$e = defineComponent({
|
|
3405
3489
|
name: COMPONENT_NAME
|
|
3406
3490
|
});
|
|
3407
|
-
const _sfc_main$
|
|
3491
|
+
const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
3408
3492
|
...__default__$e,
|
|
3409
3493
|
props: scrollbarProps,
|
|
3410
3494
|
emits: scrollbarEmits,
|
|
@@ -3613,7 +3697,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
3613
3697
|
};
|
|
3614
3698
|
}
|
|
3615
3699
|
});
|
|
3616
|
-
var Scrollbar = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
3700
|
+
var Scrollbar = /* @__PURE__ */ _export_sfc$1(_sfc_main$r, [["__file", "scrollbar.vue"]]);
|
|
3617
3701
|
const ElScrollbar = withInstall(Scrollbar);
|
|
3618
3702
|
const POPPER_INJECTION_KEY = Symbol("popper");
|
|
3619
3703
|
const POPPER_CONTENT_INJECTION_KEY = Symbol("popperContent");
|
|
@@ -3638,7 +3722,7 @@ const __default__$d = defineComponent({
|
|
|
3638
3722
|
name: "ElPopper",
|
|
3639
3723
|
inheritAttrs: false
|
|
3640
3724
|
});
|
|
3641
|
-
const _sfc_main$
|
|
3725
|
+
const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
3642
3726
|
...__default__$d,
|
|
3643
3727
|
props: popperProps,
|
|
3644
3728
|
setup(__props, { expose }) {
|
|
@@ -3662,12 +3746,12 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
3662
3746
|
};
|
|
3663
3747
|
}
|
|
3664
3748
|
});
|
|
3665
|
-
var Popper = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
3749
|
+
var Popper = /* @__PURE__ */ _export_sfc$1(_sfc_main$q, [["__file", "popper.vue"]]);
|
|
3666
3750
|
const __default__$c = defineComponent({
|
|
3667
3751
|
name: "ElPopperArrow",
|
|
3668
3752
|
inheritAttrs: false
|
|
3669
3753
|
});
|
|
3670
|
-
const _sfc_main$
|
|
3754
|
+
const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
3671
3755
|
...__default__$c,
|
|
3672
3756
|
setup(__props, { expose }) {
|
|
3673
3757
|
const ns = useNamespace("popper");
|
|
@@ -3689,7 +3773,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
3689
3773
|
};
|
|
3690
3774
|
}
|
|
3691
3775
|
});
|
|
3692
|
-
var ElPopperArrow = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
3776
|
+
var ElPopperArrow = /* @__PURE__ */ _export_sfc$1(_sfc_main$p, [["__file", "arrow.vue"]]);
|
|
3693
3777
|
const popperTriggerProps = buildProps({
|
|
3694
3778
|
virtualRef: {
|
|
3695
3779
|
type: definePropType(Object)
|
|
@@ -3799,7 +3883,7 @@ const __default__$b = defineComponent({
|
|
|
3799
3883
|
name: "ElPopperTrigger",
|
|
3800
3884
|
inheritAttrs: false
|
|
3801
3885
|
});
|
|
3802
|
-
const _sfc_main$
|
|
3886
|
+
const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
3803
3887
|
...__default__$b,
|
|
3804
3888
|
props: popperTriggerProps,
|
|
3805
3889
|
setup(__props, { expose }) {
|
|
@@ -3911,7 +3995,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
3911
3995
|
};
|
|
3912
3996
|
}
|
|
3913
3997
|
});
|
|
3914
|
-
var ElPopperTrigger = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
3998
|
+
var ElPopperTrigger = /* @__PURE__ */ _export_sfc$1(_sfc_main$o, [["__file", "trigger.vue"]]);
|
|
3915
3999
|
const FOCUS_AFTER_TRAPPED = "focus-trap.focus-after-trapped";
|
|
3916
4000
|
const FOCUS_AFTER_RELEASED = "focus-trap.focus-after-released";
|
|
3917
4001
|
const FOCUSOUT_PREVENTED = "focus-trap.focusout-prevented";
|
|
@@ -4101,7 +4185,7 @@ const useEscapeKeydown = (handler) => {
|
|
|
4101
4185
|
}
|
|
4102
4186
|
});
|
|
4103
4187
|
};
|
|
4104
|
-
const _sfc_main$
|
|
4188
|
+
const _sfc_main$n = defineComponent({
|
|
4105
4189
|
name: "ElFocusTrap",
|
|
4106
4190
|
inheritAttrs: false,
|
|
4107
4191
|
props: {
|
|
@@ -4343,10 +4427,10 @@ const _sfc_main$m = defineComponent({
|
|
|
4343
4427
|
};
|
|
4344
4428
|
}
|
|
4345
4429
|
});
|
|
4346
|
-
function _sfc_render$
|
|
4430
|
+
function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
|
|
4347
4431
|
return renderSlot(_ctx.$slots, "default", { handleKeydown: _ctx.onKeydown });
|
|
4348
4432
|
}
|
|
4349
|
-
var ElFocusTrap = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
4433
|
+
var ElFocusTrap = /* @__PURE__ */ _export_sfc$1(_sfc_main$n, [["render", _sfc_render$a], ["__file", "focus-trap.vue"]]);
|
|
4350
4434
|
var E = "top", R = "bottom", W = "right", P = "left", me = "auto", G = [E, R, W, P], U = "start", J = "end", Xe = "clippingParents", je = "viewport", K = "popper", Ye = "reference", De = G.reduce(function(t, e) {
|
|
4351
4435
|
return t.concat([e + "-" + U, e + "-" + J]);
|
|
4352
4436
|
}, []), Ee = [].concat(G, [me]).reduce(function(t, e) {
|
|
@@ -4489,7 +4573,7 @@ var Tt = function(t, e) {
|
|
|
4489
4573
|
function Ht(t) {
|
|
4490
4574
|
var e, n = t.state, r = t.name, o = t.options, i = n.elements.arrow, a = n.modifiersData.popperOffsets, s = q(n.placement), f = Le(s), c = [P, W].indexOf(s) >= 0, u = c ? "height" : "width";
|
|
4491
4575
|
if (!(!i || !a)) {
|
|
4492
|
-
var m = Tt(o.padding, n), v = ke(i), l = f === "y" ? E : P,
|
|
4576
|
+
var m = Tt(o.padding, n), v = ke(i), l = f === "y" ? E : P, h2 = f === "y" ? R : W, p = n.rects.reference[u] + n.rects.reference[f] - a[f] - n.rects.popper[u], g = a[f] - n.rects.reference[f], x = se(i), y = x ? f === "y" ? x.clientHeight || 0 : x.clientWidth || 0 : 0, $ = p / 2 - g / 2, d = m[l], b = y - v[u] - m[h2], w = y / 2 - v[u] / 2 + $, O = fe(d, w, b), j = f;
|
|
4493
4577
|
n.modifiersData[r] = (e = {}, e[j] = O, e.centerOffset = O - w, e);
|
|
4494
4578
|
}
|
|
4495
4579
|
}
|
|
@@ -4507,7 +4591,7 @@ function Vt(t) {
|
|
|
4507
4591
|
return { x: Z(e * o) / o || 0, y: Z(n * o) / o || 0 };
|
|
4508
4592
|
}
|
|
4509
4593
|
function ut(t) {
|
|
4510
|
-
var e, n = t.popper, r = t.popperRect, o = t.placement, i = t.variation, a = t.offsets, s = t.position, f = t.gpuAcceleration, c = t.adaptive, u = t.roundOffsets, m = t.isFixed, v = a.x, l = v === void 0 ? 0 : v,
|
|
4594
|
+
var e, n = t.popper, r = t.popperRect, o = t.placement, i = t.variation, a = t.offsets, s = t.position, f = t.gpuAcceleration, c = t.adaptive, u = t.roundOffsets, m = t.isFixed, v = a.x, l = v === void 0 ? 0 : v, h2 = a.y, p = h2 === void 0 ? 0 : h2, g = typeof u == "function" ? u({ x: l, y: p }) : { x: l, y: p };
|
|
4511
4595
|
l = g.x, p = g.y;
|
|
4512
4596
|
var x = a.hasOwnProperty("x"), y = a.hasOwnProperty("y"), $ = P, d = E, b = window;
|
|
4513
4597
|
if (c) {
|
|
@@ -4643,7 +4727,7 @@ function mt(t) {
|
|
|
4643
4727
|
}
|
|
4644
4728
|
function ne(t, e) {
|
|
4645
4729
|
e === void 0 && (e = {});
|
|
4646
|
-
var n = e, r = n.placement, o = r === void 0 ? t.placement : r, i = n.boundary, a = i === void 0 ? Xe : i, s = n.rootBoundary, f = s === void 0 ? je : s, c = n.elementContext, u = c === void 0 ? K : c, m = n.altBoundary, v = m === void 0 ? false : m, l = n.padding,
|
|
4730
|
+
var n = e, r = n.placement, o = r === void 0 ? t.placement : r, i = n.boundary, a = i === void 0 ? Xe : i, s = n.rootBoundary, f = s === void 0 ? je : s, c = n.elementContext, u = c === void 0 ? K : c, m = n.altBoundary, v = m === void 0 ? false : m, l = n.padding, h2 = l === void 0 ? 0 : l, p = ft(typeof h2 != "number" ? h2 : ct(h2, G)), g = u === K ? Ye : K, x = t.rects.popper, y = t.elements[v ? g : u], $ = Gt(Q(y) ? y : y.contextElement || I(t.elements.popper), a, f), d = ee(t.elements.reference), b = mt({ reference: d, element: x, placement: o }), w = Te(Object.assign({}, x, b)), O = u === K ? w : d, j = { top: $.top - O.top + p.top, bottom: O.bottom - $.bottom + p.bottom, left: $.left - O.left + p.left, right: O.right - $.right + p.right }, A = t.modifiersData.offset;
|
|
4647
4731
|
if (u === K && A) {
|
|
4648
4732
|
var k = A[o];
|
|
4649
4733
|
Object.keys(j).forEach(function(D) {
|
|
@@ -4655,17 +4739,17 @@ function ne(t, e) {
|
|
|
4655
4739
|
}
|
|
4656
4740
|
function Jt(t, e) {
|
|
4657
4741
|
e === void 0 && (e = {});
|
|
4658
|
-
var n = e, r = n.placement, o = n.boundary, i = n.rootBoundary, a = n.padding, s = n.flipVariations, f = n.allowedAutoPlacements, c = f === void 0 ? Ee : f, u = te(r), m = u ? s ? De : De.filter(function(
|
|
4659
|
-
return te(
|
|
4660
|
-
}) : G, v = m.filter(function(
|
|
4661
|
-
return c.indexOf(
|
|
4742
|
+
var n = e, r = n.placement, o = n.boundary, i = n.rootBoundary, a = n.padding, s = n.flipVariations, f = n.allowedAutoPlacements, c = f === void 0 ? Ee : f, u = te(r), m = u ? s ? De : De.filter(function(h2) {
|
|
4743
|
+
return te(h2) === u;
|
|
4744
|
+
}) : G, v = m.filter(function(h2) {
|
|
4745
|
+
return c.indexOf(h2) >= 0;
|
|
4662
4746
|
});
|
|
4663
4747
|
v.length === 0 && (v = m);
|
|
4664
|
-
var l = v.reduce(function(
|
|
4665
|
-
return
|
|
4748
|
+
var l = v.reduce(function(h2, p) {
|
|
4749
|
+
return h2[p] = ne(t, { placement: p, boundary: o, rootBoundary: i, padding: a })[q(p)], h2;
|
|
4666
4750
|
}, {});
|
|
4667
|
-
return Object.keys(l).sort(function(
|
|
4668
|
-
return l[
|
|
4751
|
+
return Object.keys(l).sort(function(h2, p) {
|
|
4752
|
+
return l[h2] - l[p];
|
|
4669
4753
|
});
|
|
4670
4754
|
}
|
|
4671
4755
|
function Kt(t) {
|
|
@@ -4676,8 +4760,8 @@ function Kt(t) {
|
|
|
4676
4760
|
function Qt(t) {
|
|
4677
4761
|
var e = t.state, n = t.options, r = t.name;
|
|
4678
4762
|
if (!e.modifiersData[r]._skip) {
|
|
4679
|
-
for (var o = n.mainAxis, i = o === void 0 ? true : o, a = n.altAxis, s = a === void 0 ? true : a, f = n.fallbackPlacements, c = n.padding, u = n.boundary, m = n.rootBoundary, v = n.altBoundary, l = n.flipVariations,
|
|
4680
|
-
return z.concat(q(V) === me ? Jt(e, { placement: V, boundary: u, rootBoundary: m, padding: c, flipVariations:
|
|
4763
|
+
for (var o = n.mainAxis, i = o === void 0 ? true : o, a = n.altAxis, s = a === void 0 ? true : a, f = n.fallbackPlacements, c = n.padding, u = n.boundary, m = n.rootBoundary, v = n.altBoundary, l = n.flipVariations, h2 = l === void 0 ? true : l, p = n.allowedAutoPlacements, g = e.options.placement, x = q(g), y = x === g, $ = f || (y || !h2 ? [be(g)] : Kt(g)), d = [g].concat($).reduce(function(z, V) {
|
|
4764
|
+
return z.concat(q(V) === me ? Jt(e, { placement: V, boundary: u, rootBoundary: m, padding: c, flipVariations: h2, allowedAutoPlacements: p }) : V);
|
|
4681
4765
|
}, []), b = e.rects.reference, w = e.rects.popper, O = /* @__PURE__ */ new Map(), j = true, A = d[0], k = 0; k < d.length; k++) {
|
|
4682
4766
|
var D = d[k], S = q(D), L = te(D) === U, re = [E, R].indexOf(S) >= 0, oe = re ? "width" : "height", M = ne(e, { placement: D, boundary: u, rootBoundary: m, altBoundary: v, padding: c }), T = re ? L ? W : P : L ? R : E;
|
|
4683
4767
|
b[oe] > w[oe] && (T = be(T));
|
|
@@ -4690,7 +4774,7 @@ function Qt(t) {
|
|
|
4690
4774
|
}
|
|
4691
4775
|
O.set(D, _);
|
|
4692
4776
|
}
|
|
4693
|
-
if (j) for (var ue =
|
|
4777
|
+
if (j) for (var ue = h2 ? 3 : 1, xe = function(z) {
|
|
4694
4778
|
var V = d.find(function(de) {
|
|
4695
4779
|
var ae = O.get(de);
|
|
4696
4780
|
if (ae) return ae.slice(0, z).every(function(Y) {
|
|
@@ -4739,7 +4823,7 @@ function rn(t) {
|
|
|
4739
4823
|
return t === "x" ? "y" : "x";
|
|
4740
4824
|
}
|
|
4741
4825
|
function on(t) {
|
|
4742
|
-
var e = t.state, n = t.options, r = t.name, o = n.mainAxis, i = o === void 0 ? true : o, a = n.altAxis, s = a === void 0 ? false : a, f = n.boundary, c = n.rootBoundary, u = n.altBoundary, m = n.padding, v = n.tether, l = v === void 0 ? true : v,
|
|
4826
|
+
var e = t.state, n = t.options, r = t.name, o = n.mainAxis, i = o === void 0 ? true : o, a = n.altAxis, s = a === void 0 ? false : a, f = n.boundary, c = n.rootBoundary, u = n.altBoundary, m = n.padding, v = n.tether, l = v === void 0 ? true : v, h2 = n.tetherOffset, p = h2 === void 0 ? 0 : h2, g = ne(e, { boundary: f, rootBoundary: c, padding: m, altBoundary: u }), x = q(e.placement), y = te(e.placement), $ = !y, d = Le(x), b = rn(d), w = e.modifiersData.popperOffsets, O = e.rects.reference, j = e.rects.popper, A = typeof p == "function" ? p(Object.assign({}, e.rects, { placement: e.placement })) : p, k = typeof A == "number" ? { mainAxis: A, altAxis: A } : Object.assign({ mainAxis: 0, altAxis: 0 }, A), D = e.modifiersData.offset ? e.modifiersData.offset[e.placement] : null, S = { x: 0, y: 0 };
|
|
4743
4827
|
if (w) {
|
|
4744
4828
|
if (i) {
|
|
4745
4829
|
var L, re = d === "y" ? E : P, oe = d === "y" ? R : W, M = d === "y" ? "height" : "width", T = w[d], pe = T + g[re], _ = T - g[oe], ue = l ? -j[M] / 2 : 0, xe = y === U ? O[M] : j[M], ie = y === U ? -j[M] : -O[M], le = e.elements.arrow, z = l && le ? ke(le) : { width: 0, height: 0 }, V = e.modifiersData["arrow#persistent"] ? e.modifiersData["arrow#persistent"].padding : st(), de = V[re], ae = V[oe], Y = fe(0, O[M], z[M]), jt = $ ? O[M] / 2 - ue - Y - de - k.mainAxis : xe - Y - de - k.mainAxis, Dt = $ ? -O[M] / 2 + ue + Y + ae + k.mainAxis : ie + Y + ae + k.mainAxis, Oe = e.elements.arrow && se(e.elements.arrow), Et = Oe ? d === "y" ? Oe.clientTop || 0 : Oe.clientLeft || 0 : 0, Ce = (L = D == null ? void 0 : D[d]) != null ? L : 0, Pt = T + jt - Ce - Et, At = T + Dt - Ce, qe = fe(l ? ve(pe, Pt) : pe, T, l ? X(_, At) : _);
|
|
@@ -4828,7 +4912,7 @@ function we(t) {
|
|
|
4828
4912
|
f === void 0 && (f = i);
|
|
4829
4913
|
var c = { placement: "bottom", orderedModifiers: [], options: Object.assign({}, Ot, i), modifiersData: {}, elements: { reference: a, popper: s }, attributes: {}, styles: {} }, u = [], m = false, v = { state: c, setOptions: function(p) {
|
|
4830
4914
|
var g = typeof p == "function" ? p(c.options) : p;
|
|
4831
|
-
|
|
4915
|
+
h2(), c.options = Object.assign({}, i, c.options, g), c.scrollParents = { reference: Q(a) ? ce(a) : a.contextElement ? ce(a.contextElement) : [], popper: ce(s) };
|
|
4832
4916
|
var x = un(dn([].concat(r, c.options.modifiers)));
|
|
4833
4917
|
return c.orderedModifiers = x.filter(function(y) {
|
|
4834
4918
|
return y.enabled;
|
|
@@ -4855,7 +4939,7 @@ function we(t) {
|
|
|
4855
4939
|
v.forceUpdate(), p(c);
|
|
4856
4940
|
});
|
|
4857
4941
|
}), destroy: function() {
|
|
4858
|
-
|
|
4942
|
+
h2(), m = true;
|
|
4859
4943
|
} };
|
|
4860
4944
|
if (!$t(a, s)) return v;
|
|
4861
4945
|
v.setOptions(f).then(function(p) {
|
|
@@ -4871,7 +4955,7 @@ function we(t) {
|
|
|
4871
4955
|
}
|
|
4872
4956
|
});
|
|
4873
4957
|
}
|
|
4874
|
-
function
|
|
4958
|
+
function h2() {
|
|
4875
4959
|
u.forEach(function(p) {
|
|
4876
4960
|
return p();
|
|
4877
4961
|
}), u = [];
|
|
@@ -5258,7 +5342,7 @@ const usePopperContentDOM = (props, {
|
|
|
5258
5342
|
const __default__$a = defineComponent({
|
|
5259
5343
|
name: "ElPopperContent"
|
|
5260
5344
|
});
|
|
5261
|
-
const _sfc_main$
|
|
5345
|
+
const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
5262
5346
|
...__default__$a,
|
|
5263
5347
|
props: popperContentProps,
|
|
5264
5348
|
emits: popperContentEmits,
|
|
@@ -5373,7 +5457,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
5373
5457
|
};
|
|
5374
5458
|
}
|
|
5375
5459
|
});
|
|
5376
|
-
var ElPopperContent = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
5460
|
+
var ElPopperContent = /* @__PURE__ */ _export_sfc$1(_sfc_main$m, [["__file", "content.vue"]]);
|
|
5377
5461
|
const ElPopper = withInstall(Popper);
|
|
5378
5462
|
const TOOLTIP_INJECTION_KEY = Symbol("elTooltip");
|
|
5379
5463
|
const teleportProps = buildProps({
|
|
@@ -5592,7 +5676,7 @@ const whenMouse = (handler) => {
|
|
|
5592
5676
|
const __default__$9 = defineComponent({
|
|
5593
5677
|
name: "ElTooltipTrigger"
|
|
5594
5678
|
});
|
|
5595
|
-
const _sfc_main$
|
|
5679
|
+
const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
5596
5680
|
...__default__$9,
|
|
5597
5681
|
props: useTooltipTriggerProps,
|
|
5598
5682
|
setup(__props, { expose }) {
|
|
@@ -5652,8 +5736,8 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
5652
5736
|
};
|
|
5653
5737
|
}
|
|
5654
5738
|
});
|
|
5655
|
-
var ElTooltipTrigger = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
5656
|
-
const _sfc_main$
|
|
5739
|
+
var ElTooltipTrigger = /* @__PURE__ */ _export_sfc$1(_sfc_main$l, [["__file", "trigger.vue"]]);
|
|
5740
|
+
const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
5657
5741
|
__name: "teleport",
|
|
5658
5742
|
props: teleportProps,
|
|
5659
5743
|
setup(__props) {
|
|
@@ -5667,7 +5751,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
5667
5751
|
};
|
|
5668
5752
|
}
|
|
5669
5753
|
});
|
|
5670
|
-
var Teleport = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
5754
|
+
var Teleport = /* @__PURE__ */ _export_sfc$1(_sfc_main$k, [["__file", "teleport.vue"]]);
|
|
5671
5755
|
const ElTeleport = withInstall(Teleport);
|
|
5672
5756
|
const usePopperContainerId = () => {
|
|
5673
5757
|
const namespace = useGetDerivedNamespace();
|
|
@@ -5705,7 +5789,7 @@ const __default__$8 = defineComponent({
|
|
|
5705
5789
|
name: "ElTooltipContent",
|
|
5706
5790
|
inheritAttrs: false
|
|
5707
5791
|
});
|
|
5708
|
-
const _sfc_main$
|
|
5792
|
+
const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
5709
5793
|
...__default__$8,
|
|
5710
5794
|
props: useTooltipContentProps,
|
|
5711
5795
|
setup(__props, { expose }) {
|
|
@@ -5881,11 +5965,11 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
5881
5965
|
};
|
|
5882
5966
|
}
|
|
5883
5967
|
});
|
|
5884
|
-
var ElTooltipContent = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
5968
|
+
var ElTooltipContent = /* @__PURE__ */ _export_sfc$1(_sfc_main$j, [["__file", "content.vue"]]);
|
|
5885
5969
|
const __default__$7 = defineComponent({
|
|
5886
5970
|
name: "ElTooltip"
|
|
5887
5971
|
});
|
|
5888
|
-
const _sfc_main$
|
|
5972
|
+
const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
5889
5973
|
...__default__$7,
|
|
5890
5974
|
props: useTooltipProps,
|
|
5891
5975
|
emits: tooltipEmits,
|
|
@@ -6034,7 +6118,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
6034
6118
|
};
|
|
6035
6119
|
}
|
|
6036
6120
|
});
|
|
6037
|
-
var Tooltip = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
6121
|
+
var Tooltip = /* @__PURE__ */ _export_sfc$1(_sfc_main$i, [["__file", "tooltip.vue"]]);
|
|
6038
6122
|
const ElTooltip = withInstall(Tooltip);
|
|
6039
6123
|
const badgeProps = buildProps({
|
|
6040
6124
|
value: {
|
|
@@ -6071,7 +6155,7 @@ const badgeProps = buildProps({
|
|
|
6071
6155
|
const __default__$6 = defineComponent({
|
|
6072
6156
|
name: "ElBadge"
|
|
6073
6157
|
});
|
|
6074
|
-
const _sfc_main$
|
|
6158
|
+
const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
6075
6159
|
...__default__$6,
|
|
6076
6160
|
props: badgeProps,
|
|
6077
6161
|
setup(__props, { expose }) {
|
|
@@ -6133,7 +6217,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
6133
6217
|
};
|
|
6134
6218
|
}
|
|
6135
6219
|
});
|
|
6136
|
-
var Badge = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
6220
|
+
var Badge = /* @__PURE__ */ _export_sfc$1(_sfc_main$h, [["__file", "badge.vue"]]);
|
|
6137
6221
|
const ElBadge = withInstall(Badge);
|
|
6138
6222
|
const buttonGroupContextKey = Symbol("buttonGroupContextKey");
|
|
6139
6223
|
const useDeprecated = ({ from, replacement, scope, version, ref: ref2, type = "API" }, condition) => {
|
|
@@ -6334,29 +6418,29 @@ function rgbToHsl(r, g, b) {
|
|
|
6334
6418
|
b = bound01(b, 255);
|
|
6335
6419
|
var max = Math.max(r, g, b);
|
|
6336
6420
|
var min = Math.min(r, g, b);
|
|
6337
|
-
var
|
|
6421
|
+
var h2 = 0;
|
|
6338
6422
|
var s = 0;
|
|
6339
6423
|
var l = (max + min) / 2;
|
|
6340
6424
|
if (max === min) {
|
|
6341
6425
|
s = 0;
|
|
6342
|
-
|
|
6426
|
+
h2 = 0;
|
|
6343
6427
|
} else {
|
|
6344
6428
|
var d = max - min;
|
|
6345
6429
|
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
|
|
6346
6430
|
switch (max) {
|
|
6347
6431
|
case r:
|
|
6348
|
-
|
|
6432
|
+
h2 = (g - b) / d + (g < b ? 6 : 0);
|
|
6349
6433
|
break;
|
|
6350
6434
|
case g:
|
|
6351
|
-
|
|
6435
|
+
h2 = (b - r) / d + 2;
|
|
6352
6436
|
break;
|
|
6353
6437
|
case b:
|
|
6354
|
-
|
|
6438
|
+
h2 = (r - g) / d + 4;
|
|
6355
6439
|
break;
|
|
6356
6440
|
}
|
|
6357
|
-
|
|
6441
|
+
h2 /= 6;
|
|
6358
6442
|
}
|
|
6359
|
-
return { h, s, l };
|
|
6443
|
+
return { h: h2, s, l };
|
|
6360
6444
|
}
|
|
6361
6445
|
function hue2rgb(p, q2, t) {
|
|
6362
6446
|
if (t < 0) {
|
|
@@ -6376,11 +6460,11 @@ function hue2rgb(p, q2, t) {
|
|
|
6376
6460
|
}
|
|
6377
6461
|
return p;
|
|
6378
6462
|
}
|
|
6379
|
-
function hslToRgb(
|
|
6463
|
+
function hslToRgb(h2, s, l) {
|
|
6380
6464
|
var r;
|
|
6381
6465
|
var g;
|
|
6382
6466
|
var b;
|
|
6383
|
-
|
|
6467
|
+
h2 = bound01(h2, 360);
|
|
6384
6468
|
s = bound01(s, 100);
|
|
6385
6469
|
l = bound01(l, 100);
|
|
6386
6470
|
if (s === 0) {
|
|
@@ -6390,9 +6474,9 @@ function hslToRgb(h, s, l) {
|
|
|
6390
6474
|
} else {
|
|
6391
6475
|
var q2 = l < 0.5 ? l * (1 + s) : l + s - l * s;
|
|
6392
6476
|
var p = 2 * l - q2;
|
|
6393
|
-
r = hue2rgb(p, q2,
|
|
6394
|
-
g = hue2rgb(p, q2,
|
|
6395
|
-
b = hue2rgb(p, q2,
|
|
6477
|
+
r = hue2rgb(p, q2, h2 + 1 / 3);
|
|
6478
|
+
g = hue2rgb(p, q2, h2);
|
|
6479
|
+
b = hue2rgb(p, q2, h2 - 1 / 3);
|
|
6396
6480
|
}
|
|
6397
6481
|
return { r: r * 255, g: g * 255, b: b * 255 };
|
|
6398
6482
|
}
|
|
@@ -6402,34 +6486,34 @@ function rgbToHsv(r, g, b) {
|
|
|
6402
6486
|
b = bound01(b, 255);
|
|
6403
6487
|
var max = Math.max(r, g, b);
|
|
6404
6488
|
var min = Math.min(r, g, b);
|
|
6405
|
-
var
|
|
6489
|
+
var h2 = 0;
|
|
6406
6490
|
var v = max;
|
|
6407
6491
|
var d = max - min;
|
|
6408
6492
|
var s = max === 0 ? 0 : d / max;
|
|
6409
6493
|
if (max === min) {
|
|
6410
|
-
|
|
6494
|
+
h2 = 0;
|
|
6411
6495
|
} else {
|
|
6412
6496
|
switch (max) {
|
|
6413
6497
|
case r:
|
|
6414
|
-
|
|
6498
|
+
h2 = (g - b) / d + (g < b ? 6 : 0);
|
|
6415
6499
|
break;
|
|
6416
6500
|
case g:
|
|
6417
|
-
|
|
6501
|
+
h2 = (b - r) / d + 2;
|
|
6418
6502
|
break;
|
|
6419
6503
|
case b:
|
|
6420
|
-
|
|
6504
|
+
h2 = (r - g) / d + 4;
|
|
6421
6505
|
break;
|
|
6422
6506
|
}
|
|
6423
|
-
|
|
6507
|
+
h2 /= 6;
|
|
6424
6508
|
}
|
|
6425
|
-
return { h, s, v };
|
|
6509
|
+
return { h: h2, s, v };
|
|
6426
6510
|
}
|
|
6427
|
-
function hsvToRgb(
|
|
6428
|
-
|
|
6511
|
+
function hsvToRgb(h2, s, v) {
|
|
6512
|
+
h2 = bound01(h2, 360) * 6;
|
|
6429
6513
|
s = bound01(s, 100);
|
|
6430
6514
|
v = bound01(v, 100);
|
|
6431
|
-
var i = Math.floor(
|
|
6432
|
-
var f =
|
|
6515
|
+
var i = Math.floor(h2);
|
|
6516
|
+
var f = h2 - i;
|
|
6433
6517
|
var p = v * (1 - s);
|
|
6434
6518
|
var q2 = v * (1 - f * s);
|
|
6435
6519
|
var t = v * (1 - (1 - f) * s);
|
|
@@ -6465,8 +6549,8 @@ function rgbaToHex(r, g, b, a, allow4Char) {
|
|
|
6465
6549
|
function convertDecimalToHex(d) {
|
|
6466
6550
|
return Math.round(parseFloat(d) * 255).toString(16);
|
|
6467
6551
|
}
|
|
6468
|
-
function convertHexToDecimal(
|
|
6469
|
-
return parseIntFromHex(
|
|
6552
|
+
function convertHexToDecimal(h2) {
|
|
6553
|
+
return parseIntFromHex(h2) / 255;
|
|
6470
6554
|
}
|
|
6471
6555
|
function parseIntFromHex(val) {
|
|
6472
6556
|
return parseInt(val, 16);
|
|
@@ -6859,10 +6943,10 @@ var TinyColor = (
|
|
|
6859
6943
|
};
|
|
6860
6944
|
TinyColor2.prototype.toHsvString = function() {
|
|
6861
6945
|
var hsv = rgbToHsv(this.r, this.g, this.b);
|
|
6862
|
-
var
|
|
6946
|
+
var h2 = Math.round(hsv.h * 360);
|
|
6863
6947
|
var s = Math.round(hsv.s * 100);
|
|
6864
6948
|
var v = Math.round(hsv.v * 100);
|
|
6865
|
-
return this.a === 1 ? "hsv(".concat(
|
|
6949
|
+
return this.a === 1 ? "hsv(".concat(h2, ", ").concat(s, "%, ").concat(v, "%)") : "hsva(".concat(h2, ", ").concat(s, "%, ").concat(v, "%, ").concat(this.roundA, ")");
|
|
6866
6950
|
};
|
|
6867
6951
|
TinyColor2.prototype.toHsl = function() {
|
|
6868
6952
|
var hsl = rgbToHsl(this.r, this.g, this.b);
|
|
@@ -6870,10 +6954,10 @@ var TinyColor = (
|
|
|
6870
6954
|
};
|
|
6871
6955
|
TinyColor2.prototype.toHslString = function() {
|
|
6872
6956
|
var hsl = rgbToHsl(this.r, this.g, this.b);
|
|
6873
|
-
var
|
|
6957
|
+
var h2 = Math.round(hsl.h * 360);
|
|
6874
6958
|
var s = Math.round(hsl.s * 100);
|
|
6875
6959
|
var l = Math.round(hsl.l * 100);
|
|
6876
|
-
return this.a === 1 ? "hsl(".concat(
|
|
6960
|
+
return this.a === 1 ? "hsl(".concat(h2, ", ").concat(s, "%, ").concat(l, "%)") : "hsla(".concat(h2, ", ").concat(s, "%, ").concat(l, "%, ").concat(this.roundA, ")");
|
|
6877
6961
|
};
|
|
6878
6962
|
TinyColor2.prototype.toHex = function(allow3Char) {
|
|
6879
6963
|
if (allow3Char === void 0) {
|
|
@@ -7107,24 +7191,24 @@ var TinyColor = (
|
|
|
7107
7191
|
results = 6;
|
|
7108
7192
|
}
|
|
7109
7193
|
var hsv = this.toHsv();
|
|
7110
|
-
var
|
|
7194
|
+
var h2 = hsv.h;
|
|
7111
7195
|
var s = hsv.s;
|
|
7112
7196
|
var v = hsv.v;
|
|
7113
7197
|
var res = [];
|
|
7114
7198
|
var modification = 1 / results;
|
|
7115
7199
|
while (results--) {
|
|
7116
|
-
res.push(new TinyColor2({ h, s, v }));
|
|
7200
|
+
res.push(new TinyColor2({ h: h2, s, v }));
|
|
7117
7201
|
v = (v + modification) % 1;
|
|
7118
7202
|
}
|
|
7119
7203
|
return res;
|
|
7120
7204
|
};
|
|
7121
7205
|
TinyColor2.prototype.splitcomplement = function() {
|
|
7122
7206
|
var hsl = this.toHsl();
|
|
7123
|
-
var
|
|
7207
|
+
var h2 = hsl.h;
|
|
7124
7208
|
return [
|
|
7125
7209
|
this,
|
|
7126
|
-
new TinyColor2({ h: (
|
|
7127
|
-
new TinyColor2({ h: (
|
|
7210
|
+
new TinyColor2({ h: (h2 + 72) % 360, s: hsl.s, l: hsl.l }),
|
|
7211
|
+
new TinyColor2({ h: (h2 + 216) % 360, s: hsl.s, l: hsl.l })
|
|
7128
7212
|
];
|
|
7129
7213
|
};
|
|
7130
7214
|
TinyColor2.prototype.onBackground = function(background) {
|
|
@@ -7146,11 +7230,11 @@ var TinyColor = (
|
|
|
7146
7230
|
};
|
|
7147
7231
|
TinyColor2.prototype.polyad = function(n) {
|
|
7148
7232
|
var hsl = this.toHsl();
|
|
7149
|
-
var
|
|
7233
|
+
var h2 = hsl.h;
|
|
7150
7234
|
var result = [this];
|
|
7151
7235
|
var increment = 360 / n;
|
|
7152
7236
|
for (var i = 1; i < n; i++) {
|
|
7153
|
-
result.push(new TinyColor2({ h: (
|
|
7237
|
+
result.push(new TinyColor2({ h: (h2 + i * increment) % 360, s: hsl.s, l: hsl.l }));
|
|
7154
7238
|
}
|
|
7155
7239
|
return result;
|
|
7156
7240
|
};
|
|
@@ -7220,7 +7304,7 @@ function useButtonCustomStyle(props) {
|
|
|
7220
7304
|
const __default__$5 = defineComponent({
|
|
7221
7305
|
name: "ElButton"
|
|
7222
7306
|
});
|
|
7223
|
-
const _sfc_main$
|
|
7307
|
+
const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
7224
7308
|
...__default__$5,
|
|
7225
7309
|
props: buttonProps,
|
|
7226
7310
|
emits: buttonEmits,
|
|
@@ -7297,7 +7381,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
7297
7381
|
};
|
|
7298
7382
|
}
|
|
7299
7383
|
});
|
|
7300
|
-
var Button = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
7384
|
+
var Button = /* @__PURE__ */ _export_sfc$1(_sfc_main$g, [["__file", "button.vue"]]);
|
|
7301
7385
|
const buttonGroupProps = {
|
|
7302
7386
|
size: buttonProps.size,
|
|
7303
7387
|
type: buttonProps.type
|
|
@@ -7305,7 +7389,7 @@ const buttonGroupProps = {
|
|
|
7305
7389
|
const __default__$4 = defineComponent({
|
|
7306
7390
|
name: "ElButtonGroup"
|
|
7307
7391
|
});
|
|
7308
|
-
const _sfc_main$
|
|
7392
|
+
const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
7309
7393
|
...__default__$4,
|
|
7310
7394
|
props: buttonGroupProps,
|
|
7311
7395
|
setup(__props) {
|
|
@@ -7324,11 +7408,27 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
7324
7408
|
};
|
|
7325
7409
|
}
|
|
7326
7410
|
});
|
|
7327
|
-
var ButtonGroup = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
7411
|
+
var ButtonGroup = /* @__PURE__ */ _export_sfc$1(_sfc_main$f, [["__file", "button-group.vue"]]);
|
|
7328
7412
|
const ElButton = withInstall(Button, {
|
|
7329
7413
|
ButtonGroup
|
|
7330
7414
|
});
|
|
7331
7415
|
withNoopInstall(ButtonGroup);
|
|
7416
|
+
var PatchFlags = /* @__PURE__ */ ((PatchFlags2) => {
|
|
7417
|
+
PatchFlags2[PatchFlags2["TEXT"] = 1] = "TEXT";
|
|
7418
|
+
PatchFlags2[PatchFlags2["CLASS"] = 2] = "CLASS";
|
|
7419
|
+
PatchFlags2[PatchFlags2["STYLE"] = 4] = "STYLE";
|
|
7420
|
+
PatchFlags2[PatchFlags2["PROPS"] = 8] = "PROPS";
|
|
7421
|
+
PatchFlags2[PatchFlags2["FULL_PROPS"] = 16] = "FULL_PROPS";
|
|
7422
|
+
PatchFlags2[PatchFlags2["HYDRATE_EVENTS"] = 32] = "HYDRATE_EVENTS";
|
|
7423
|
+
PatchFlags2[PatchFlags2["STABLE_FRAGMENT"] = 64] = "STABLE_FRAGMENT";
|
|
7424
|
+
PatchFlags2[PatchFlags2["KEYED_FRAGMENT"] = 128] = "KEYED_FRAGMENT";
|
|
7425
|
+
PatchFlags2[PatchFlags2["UNKEYED_FRAGMENT"] = 256] = "UNKEYED_FRAGMENT";
|
|
7426
|
+
PatchFlags2[PatchFlags2["NEED_PATCH"] = 512] = "NEED_PATCH";
|
|
7427
|
+
PatchFlags2[PatchFlags2["DYNAMIC_SLOTS"] = 1024] = "DYNAMIC_SLOTS";
|
|
7428
|
+
PatchFlags2[PatchFlags2["HOISTED"] = -1] = "HOISTED";
|
|
7429
|
+
PatchFlags2[PatchFlags2["BAIL"] = -2] = "BAIL";
|
|
7430
|
+
return PatchFlags2;
|
|
7431
|
+
})(PatchFlags || {});
|
|
7332
7432
|
const checkboxProps = {
|
|
7333
7433
|
modelValue: {
|
|
7334
7434
|
type: [Number, String, Boolean],
|
|
@@ -7597,7 +7697,7 @@ const useCheckbox = (props, slots) => {
|
|
|
7597
7697
|
const __default__$3 = defineComponent({
|
|
7598
7698
|
name: "ElCheckbox"
|
|
7599
7699
|
});
|
|
7600
|
-
const _sfc_main$
|
|
7700
|
+
const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
7601
7701
|
...__default__$3,
|
|
7602
7702
|
props: checkboxProps,
|
|
7603
7703
|
emits: checkboxEmits,
|
|
@@ -7706,11 +7806,11 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
7706
7806
|
};
|
|
7707
7807
|
}
|
|
7708
7808
|
});
|
|
7709
|
-
var Checkbox = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
7809
|
+
var Checkbox = /* @__PURE__ */ _export_sfc$1(_sfc_main$e, [["__file", "checkbox.vue"]]);
|
|
7710
7810
|
const __default__$2 = defineComponent({
|
|
7711
7811
|
name: "ElCheckboxButton"
|
|
7712
7812
|
});
|
|
7713
|
-
const _sfc_main$
|
|
7813
|
+
const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
7714
7814
|
...__default__$2,
|
|
7715
7815
|
props: checkboxProps,
|
|
7716
7816
|
emits: checkboxEmits,
|
|
@@ -7799,7 +7899,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
7799
7899
|
};
|
|
7800
7900
|
}
|
|
7801
7901
|
});
|
|
7802
|
-
var CheckboxButton = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
7902
|
+
var CheckboxButton = /* @__PURE__ */ _export_sfc$1(_sfc_main$d, [["__file", "checkbox-button.vue"]]);
|
|
7803
7903
|
const checkboxGroupProps = buildProps({
|
|
7804
7904
|
modelValue: {
|
|
7805
7905
|
type: definePropType(Array),
|
|
@@ -7828,7 +7928,7 @@ const checkboxGroupEmits = {
|
|
|
7828
7928
|
const __default__$1 = defineComponent({
|
|
7829
7929
|
name: "ElCheckboxGroup"
|
|
7830
7930
|
});
|
|
7831
|
-
const _sfc_main$
|
|
7931
|
+
const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
7832
7932
|
...__default__$1,
|
|
7833
7933
|
props: checkboxGroupProps,
|
|
7834
7934
|
emits: checkboxGroupEmits,
|
|
@@ -7887,7 +7987,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
7887
7987
|
};
|
|
7888
7988
|
}
|
|
7889
7989
|
});
|
|
7890
|
-
var CheckboxGroup = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
7990
|
+
var CheckboxGroup = /* @__PURE__ */ _export_sfc$1(_sfc_main$c, [["__file", "checkbox-group.vue"]]);
|
|
7891
7991
|
const ElCheckbox = withInstall(Checkbox, {
|
|
7892
7992
|
CheckboxButton,
|
|
7893
7993
|
CheckboxGroup
|
|
@@ -7945,6 +8045,165 @@ defineComponent({
|
|
|
7945
8045
|
return () => renderSlot(slots, "default", { config: config == null ? void 0 : config.value });
|
|
7946
8046
|
}
|
|
7947
8047
|
});
|
|
8048
|
+
const useSameTarget = (handleClick) => {
|
|
8049
|
+
if (!handleClick) {
|
|
8050
|
+
return { onClick: NOOP, onMousedown: NOOP, onMouseup: NOOP };
|
|
8051
|
+
}
|
|
8052
|
+
let mousedownTarget = false;
|
|
8053
|
+
let mouseupTarget = false;
|
|
8054
|
+
const onClick = (e) => {
|
|
8055
|
+
if (mousedownTarget && mouseupTarget) {
|
|
8056
|
+
handleClick(e);
|
|
8057
|
+
}
|
|
8058
|
+
mousedownTarget = mouseupTarget = false;
|
|
8059
|
+
};
|
|
8060
|
+
const onMousedown = (e) => {
|
|
8061
|
+
mousedownTarget = e.target === e.currentTarget;
|
|
8062
|
+
};
|
|
8063
|
+
const onMouseup = (e) => {
|
|
8064
|
+
mouseupTarget = e.target === e.currentTarget;
|
|
8065
|
+
};
|
|
8066
|
+
return { onClick, onMousedown, onMouseup };
|
|
8067
|
+
};
|
|
8068
|
+
const overlayProps = buildProps({
|
|
8069
|
+
mask: {
|
|
8070
|
+
type: Boolean,
|
|
8071
|
+
default: true
|
|
8072
|
+
},
|
|
8073
|
+
customMaskEvent: Boolean,
|
|
8074
|
+
overlayClass: {
|
|
8075
|
+
type: definePropType([
|
|
8076
|
+
String,
|
|
8077
|
+
Array,
|
|
8078
|
+
Object
|
|
8079
|
+
])
|
|
8080
|
+
},
|
|
8081
|
+
zIndex: {
|
|
8082
|
+
type: definePropType([String, Number])
|
|
8083
|
+
}
|
|
8084
|
+
});
|
|
8085
|
+
const overlayEmits = {
|
|
8086
|
+
click: (evt) => evt instanceof MouseEvent
|
|
8087
|
+
};
|
|
8088
|
+
const BLOCK = "overlay";
|
|
8089
|
+
var Overlay = defineComponent({
|
|
8090
|
+
name: "ElOverlay",
|
|
8091
|
+
props: overlayProps,
|
|
8092
|
+
emits: overlayEmits,
|
|
8093
|
+
setup(props, { slots, emit }) {
|
|
8094
|
+
const ns = useNamespace(BLOCK);
|
|
8095
|
+
const onMaskClick = (e) => {
|
|
8096
|
+
emit("click", e);
|
|
8097
|
+
};
|
|
8098
|
+
const { onClick, onMousedown, onMouseup } = useSameTarget(props.customMaskEvent ? void 0 : onMaskClick);
|
|
8099
|
+
return () => {
|
|
8100
|
+
return props.mask ? createVNode("div", {
|
|
8101
|
+
class: [ns.b(), props.overlayClass],
|
|
8102
|
+
style: {
|
|
8103
|
+
zIndex: props.zIndex
|
|
8104
|
+
},
|
|
8105
|
+
onClick,
|
|
8106
|
+
onMousedown,
|
|
8107
|
+
onMouseup
|
|
8108
|
+
}, [renderSlot(slots, "default")], PatchFlags.STYLE | PatchFlags.CLASS | PatchFlags.PROPS, ["onClick", "onMouseup", "onMousedown"]) : h("div", {
|
|
8109
|
+
class: props.overlayClass,
|
|
8110
|
+
style: {
|
|
8111
|
+
zIndex: props.zIndex,
|
|
8112
|
+
position: "fixed",
|
|
8113
|
+
top: "0px",
|
|
8114
|
+
right: "0px",
|
|
8115
|
+
bottom: "0px",
|
|
8116
|
+
left: "0px"
|
|
8117
|
+
}
|
|
8118
|
+
}, [renderSlot(slots, "default")]);
|
|
8119
|
+
};
|
|
8120
|
+
}
|
|
8121
|
+
});
|
|
8122
|
+
const ElOverlay = Overlay;
|
|
8123
|
+
const useDraggable = (targetRef, dragRef, draggable, overflow) => {
|
|
8124
|
+
const transform = {
|
|
8125
|
+
offsetX: 0,
|
|
8126
|
+
offsetY: 0
|
|
8127
|
+
};
|
|
8128
|
+
const adjustPosition = (moveX, moveY) => {
|
|
8129
|
+
if (targetRef.value) {
|
|
8130
|
+
const { offsetX, offsetY } = transform;
|
|
8131
|
+
const targetRect = targetRef.value.getBoundingClientRect();
|
|
8132
|
+
const targetLeft = targetRect.left;
|
|
8133
|
+
const targetTop = targetRect.top;
|
|
8134
|
+
const targetWidth = targetRect.width;
|
|
8135
|
+
const targetHeight = targetRect.height;
|
|
8136
|
+
const clientWidth = document.documentElement.clientWidth;
|
|
8137
|
+
const clientHeight = document.documentElement.clientHeight;
|
|
8138
|
+
const minLeft = -targetLeft + offsetX;
|
|
8139
|
+
const minTop = -targetTop + offsetY;
|
|
8140
|
+
const maxLeft = clientWidth - targetLeft - targetWidth + offsetX;
|
|
8141
|
+
const maxTop = clientHeight - targetTop - (targetHeight < clientHeight ? targetHeight : 0) + offsetY;
|
|
8142
|
+
if (!(overflow == null ? void 0 : overflow.value)) {
|
|
8143
|
+
moveX = Math.min(Math.max(moveX, minLeft), maxLeft);
|
|
8144
|
+
moveY = Math.min(Math.max(moveY, minTop), maxTop);
|
|
8145
|
+
}
|
|
8146
|
+
transform.offsetX = moveX;
|
|
8147
|
+
transform.offsetY = moveY;
|
|
8148
|
+
targetRef.value.style.transform = `translate(${addUnit(moveX)}, ${addUnit(moveY)})`;
|
|
8149
|
+
}
|
|
8150
|
+
};
|
|
8151
|
+
const onMousedown = (e) => {
|
|
8152
|
+
const downX = e.clientX;
|
|
8153
|
+
const downY = e.clientY;
|
|
8154
|
+
const { offsetX, offsetY } = transform;
|
|
8155
|
+
const onMousemove = (e2) => {
|
|
8156
|
+
const moveX = offsetX + e2.clientX - downX;
|
|
8157
|
+
const moveY = offsetY + e2.clientY - downY;
|
|
8158
|
+
adjustPosition(moveX, moveY);
|
|
8159
|
+
};
|
|
8160
|
+
const onMouseup = () => {
|
|
8161
|
+
document.removeEventListener("mousemove", onMousemove);
|
|
8162
|
+
document.removeEventListener("mouseup", onMouseup);
|
|
8163
|
+
};
|
|
8164
|
+
document.addEventListener("mousemove", onMousemove);
|
|
8165
|
+
document.addEventListener("mouseup", onMouseup);
|
|
8166
|
+
};
|
|
8167
|
+
const onDraggable = () => {
|
|
8168
|
+
if (dragRef.value && targetRef.value) {
|
|
8169
|
+
dragRef.value.addEventListener("mousedown", onMousedown);
|
|
8170
|
+
window.addEventListener("resize", updatePosition);
|
|
8171
|
+
}
|
|
8172
|
+
};
|
|
8173
|
+
const offDraggable = () => {
|
|
8174
|
+
if (dragRef.value && targetRef.value) {
|
|
8175
|
+
dragRef.value.removeEventListener("mousedown", onMousedown);
|
|
8176
|
+
window.removeEventListener("resize", updatePosition);
|
|
8177
|
+
}
|
|
8178
|
+
};
|
|
8179
|
+
const resetPosition = () => {
|
|
8180
|
+
transform.offsetX = 0;
|
|
8181
|
+
transform.offsetY = 0;
|
|
8182
|
+
if (targetRef.value) {
|
|
8183
|
+
targetRef.value.style.transform = "";
|
|
8184
|
+
}
|
|
8185
|
+
};
|
|
8186
|
+
const updatePosition = () => {
|
|
8187
|
+
const { offsetX, offsetY } = transform;
|
|
8188
|
+
adjustPosition(offsetX, offsetY);
|
|
8189
|
+
};
|
|
8190
|
+
onMounted(() => {
|
|
8191
|
+
watchEffect(() => {
|
|
8192
|
+
if (draggable.value) {
|
|
8193
|
+
onDraggable();
|
|
8194
|
+
} else {
|
|
8195
|
+
offDraggable();
|
|
8196
|
+
}
|
|
8197
|
+
});
|
|
8198
|
+
});
|
|
8199
|
+
onBeforeUnmount(() => {
|
|
8200
|
+
offDraggable();
|
|
8201
|
+
});
|
|
8202
|
+
return {
|
|
8203
|
+
resetPosition,
|
|
8204
|
+
updatePosition
|
|
8205
|
+
};
|
|
8206
|
+
};
|
|
7948
8207
|
const composeRefs = (...refs) => {
|
|
7949
8208
|
return (el) => {
|
|
7950
8209
|
refs.forEach((ref2) => {
|
|
@@ -7956,21 +8215,62 @@ const composeRefs = (...refs) => {
|
|
|
7956
8215
|
});
|
|
7957
8216
|
};
|
|
7958
8217
|
};
|
|
7959
|
-
const
|
|
8218
|
+
const useLockscreen = (trigger, options = {}) => {
|
|
8219
|
+
if (!isRef(trigger)) {
|
|
8220
|
+
throwError("[useLockscreen]", "You need to pass a ref param to this function");
|
|
8221
|
+
}
|
|
8222
|
+
const ns = options.ns || useNamespace("popup");
|
|
8223
|
+
const hiddenCls = computed(() => ns.bm("parent", "hidden"));
|
|
8224
|
+
if (!isClient || hasClass(document.body, hiddenCls.value)) {
|
|
8225
|
+
return;
|
|
8226
|
+
}
|
|
8227
|
+
let scrollBarWidth2 = 0;
|
|
8228
|
+
let withoutHiddenClass = false;
|
|
8229
|
+
let bodyWidth = "0";
|
|
8230
|
+
const cleanup = () => {
|
|
8231
|
+
setTimeout(() => {
|
|
8232
|
+
if (typeof document === "undefined")
|
|
8233
|
+
return;
|
|
8234
|
+
if (withoutHiddenClass && document) {
|
|
8235
|
+
document.body.style.width = bodyWidth;
|
|
8236
|
+
removeClass(document.body, hiddenCls.value);
|
|
8237
|
+
}
|
|
8238
|
+
}, 200);
|
|
8239
|
+
};
|
|
8240
|
+
watch(trigger, (val) => {
|
|
8241
|
+
if (!val) {
|
|
8242
|
+
cleanup();
|
|
8243
|
+
return;
|
|
8244
|
+
}
|
|
8245
|
+
withoutHiddenClass = !hasClass(document.body, hiddenCls.value);
|
|
8246
|
+
if (withoutHiddenClass) {
|
|
8247
|
+
bodyWidth = document.body.style.width;
|
|
8248
|
+
addClass(document.body, hiddenCls.value);
|
|
8249
|
+
}
|
|
8250
|
+
scrollBarWidth2 = getScrollBarWidth(ns.namespace.value);
|
|
8251
|
+
const bodyHasOverflow = document.documentElement.clientHeight < document.body.scrollHeight;
|
|
8252
|
+
const bodyOverflowY = getStyle(document.body, "overflowY");
|
|
8253
|
+
if (scrollBarWidth2 > 0 && (bodyHasOverflow || bodyOverflowY === "scroll") && withoutHiddenClass) {
|
|
8254
|
+
document.body.style.width = `calc(100% - ${scrollBarWidth2}px)`;
|
|
8255
|
+
}
|
|
8256
|
+
});
|
|
8257
|
+
onScopeDispose(() => cleanup());
|
|
8258
|
+
};
|
|
8259
|
+
const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
7960
8260
|
inheritAttrs: false
|
|
7961
8261
|
});
|
|
7962
|
-
function _sfc_render$
|
|
8262
|
+
function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
|
|
7963
8263
|
return renderSlot(_ctx.$slots, "default");
|
|
7964
8264
|
}
|
|
7965
|
-
var Collection = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
7966
|
-
const _sfc_main$
|
|
8265
|
+
var Collection = /* @__PURE__ */ _export_sfc$1(_sfc_main$b, [["render", _sfc_render$9], ["__file", "collection.vue"]]);
|
|
8266
|
+
const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
7967
8267
|
name: "ElCollectionItem",
|
|
7968
8268
|
inheritAttrs: false
|
|
7969
8269
|
});
|
|
7970
|
-
function _sfc_render$
|
|
8270
|
+
function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
7971
8271
|
return renderSlot(_ctx.$slots, "default");
|
|
7972
8272
|
}
|
|
7973
|
-
var CollectionItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
8273
|
+
var CollectionItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$a, [["render", _sfc_render$8], ["__file", "collection-item.vue"]]);
|
|
7974
8274
|
const COLLECTION_ITEM_SIGN = `data-el-collection-item`;
|
|
7975
8275
|
const createCollectionWithScope = (name) => {
|
|
7976
8276
|
const COLLECTION_NAME = `El${name}Collection`;
|
|
@@ -8089,7 +8389,7 @@ const focusFirst = (elements) => {
|
|
|
8089
8389
|
const CURRENT_TAB_ID_CHANGE_EVT = "currentTabIdChange";
|
|
8090
8390
|
const ENTRY_FOCUS_EVT = "rovingFocusGroup.entryFocus";
|
|
8091
8391
|
const EVT_OPTS = { bubbles: false, cancelable: true };
|
|
8092
|
-
const _sfc_main$
|
|
8392
|
+
const _sfc_main$9 = defineComponent({
|
|
8093
8393
|
name: "ElRovingFocusGroupImpl",
|
|
8094
8394
|
inheritAttrs: false,
|
|
8095
8395
|
props: rovingFocusGroupProps,
|
|
@@ -8172,18 +8472,18 @@ const _sfc_main$8 = defineComponent({
|
|
|
8172
8472
|
useEventListener(rovingFocusGroupRef, ENTRY_FOCUS_EVT, handleEntryFocus);
|
|
8173
8473
|
}
|
|
8174
8474
|
});
|
|
8175
|
-
function _sfc_render$
|
|
8475
|
+
function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
8176
8476
|
return renderSlot(_ctx.$slots, "default");
|
|
8177
8477
|
}
|
|
8178
|
-
var ElRovingFocusGroupImpl = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
8179
|
-
const _sfc_main$
|
|
8478
|
+
var ElRovingFocusGroupImpl = /* @__PURE__ */ _export_sfc$1(_sfc_main$9, [["render", _sfc_render$7], ["__file", "roving-focus-group-impl.vue"]]);
|
|
8479
|
+
const _sfc_main$8 = defineComponent({
|
|
8180
8480
|
name: "ElRovingFocusGroup",
|
|
8181
8481
|
components: {
|
|
8182
8482
|
ElFocusGroupCollection: ElCollection$1,
|
|
8183
8483
|
ElRovingFocusGroupImpl
|
|
8184
8484
|
}
|
|
8185
8485
|
});
|
|
8186
|
-
function _sfc_render$
|
|
8486
|
+
function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
8187
8487
|
const _component_el_roving_focus_group_impl = resolveComponent("el-roving-focus-group-impl");
|
|
8188
8488
|
const _component_el_focus_group_collection = resolveComponent("el-focus-group-collection");
|
|
8189
8489
|
return openBlock(), createBlock(_component_el_focus_group_collection, null, {
|
|
@@ -8198,7 +8498,7 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
8198
8498
|
_: 3
|
|
8199
8499
|
});
|
|
8200
8500
|
}
|
|
8201
|
-
var ElRovingFocusGroup = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
8501
|
+
var ElRovingFocusGroup = /* @__PURE__ */ _export_sfc$1(_sfc_main$8, [["render", _sfc_render$6], ["__file", "roving-focus-group.vue"]]);
|
|
8202
8502
|
const dropdownProps = buildProps({
|
|
8203
8503
|
trigger: useTooltipTriggerProps.trigger,
|
|
8204
8504
|
triggerKeys: {
|
|
@@ -8305,7 +8605,7 @@ const {
|
|
|
8305
8605
|
const DROPDOWN_INJECTION_KEY = Symbol("elDropdown");
|
|
8306
8606
|
const DROPDOWN_INSTANCE_INJECTION_KEY = "elDropdown";
|
|
8307
8607
|
const { ButtonGroup: ElButtonGroup } = ElButton;
|
|
8308
|
-
const _sfc_main$
|
|
8608
|
+
const _sfc_main$7 = defineComponent({
|
|
8309
8609
|
name: "ElDropdown",
|
|
8310
8610
|
components: {
|
|
8311
8611
|
ElButton,
|
|
@@ -8458,7 +8758,7 @@ const _sfc_main$6 = defineComponent({
|
|
|
8458
8758
|
};
|
|
8459
8759
|
}
|
|
8460
8760
|
});
|
|
8461
|
-
function _sfc_render$
|
|
8761
|
+
function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
8462
8762
|
var _a2;
|
|
8463
8763
|
const _component_el_dropdown_collection = resolveComponent("el-dropdown-collection");
|
|
8464
8764
|
const _component_el_roving_focus_group = resolveComponent("el-roving-focus-group");
|
|
@@ -8591,8 +8891,8 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
8591
8891
|
})) : createCommentVNode("v-if", true)
|
|
8592
8892
|
], 2);
|
|
8593
8893
|
}
|
|
8594
|
-
var Dropdown = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
8595
|
-
const _sfc_main$
|
|
8894
|
+
var Dropdown = /* @__PURE__ */ _export_sfc$1(_sfc_main$7, [["render", _sfc_render$5], ["__file", "dropdown.vue"]]);
|
|
8895
|
+
const _sfc_main$6 = defineComponent({
|
|
8596
8896
|
components: {
|
|
8597
8897
|
ElRovingFocusCollectionItem: ElCollectionItem$1
|
|
8598
8898
|
},
|
|
@@ -8674,7 +8974,7 @@ const _sfc_main$5 = defineComponent({
|
|
|
8674
8974
|
};
|
|
8675
8975
|
}
|
|
8676
8976
|
});
|
|
8677
|
-
function _sfc_render$
|
|
8977
|
+
function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
8678
8978
|
const _component_el_roving_focus_collection_item = resolveComponent("el-roving-focus-collection-item");
|
|
8679
8979
|
return openBlock(), createBlock(_component_el_roving_focus_collection_item, {
|
|
8680
8980
|
id: _ctx.id,
|
|
@@ -8687,8 +8987,8 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
8687
8987
|
_: 3
|
|
8688
8988
|
}, 8, ["id", "focusable", "active"]);
|
|
8689
8989
|
}
|
|
8690
|
-
var ElRovingFocusItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
8691
|
-
const _sfc_main$
|
|
8990
|
+
var ElRovingFocusItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$6, [["render", _sfc_render$4], ["__file", "roving-focus-item.vue"]]);
|
|
8991
|
+
const _sfc_main$5 = defineComponent({
|
|
8692
8992
|
name: "DropdownItemImpl",
|
|
8693
8993
|
components: {
|
|
8694
8994
|
ElIcon
|
|
@@ -8738,7 +9038,7 @@ const _sfc_main$4 = defineComponent({
|
|
|
8738
9038
|
};
|
|
8739
9039
|
}
|
|
8740
9040
|
});
|
|
8741
|
-
function _sfc_render$
|
|
9041
|
+
function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
8742
9042
|
const _component_el_icon = resolveComponent("el-icon");
|
|
8743
9043
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
8744
9044
|
_ctx.divided ? (openBlock(), createElementBlock("li", {
|
|
@@ -8768,7 +9068,7 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
8768
9068
|
], 16, ["aria-disabled", "tabindex", "role", "onClick", "onFocus", "onKeydown", "onMousedown", "onPointermove", "onPointerleave"])
|
|
8769
9069
|
], 64);
|
|
8770
9070
|
}
|
|
8771
|
-
var ElDropdownItemImpl = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
9071
|
+
var ElDropdownItemImpl = /* @__PURE__ */ _export_sfc$1(_sfc_main$5, [["render", _sfc_render$3], ["__file", "dropdown-item-impl.vue"]]);
|
|
8772
9072
|
const useDropdown = () => {
|
|
8773
9073
|
const elDropdown = inject(DROPDOWN_INSTANCE_INJECTION_KEY, {});
|
|
8774
9074
|
const _elDropdownSize = computed(() => elDropdown == null ? void 0 : elDropdown.dropdownSize);
|
|
@@ -8777,7 +9077,7 @@ const useDropdown = () => {
|
|
|
8777
9077
|
_elDropdownSize
|
|
8778
9078
|
};
|
|
8779
9079
|
};
|
|
8780
|
-
const _sfc_main$
|
|
9080
|
+
const _sfc_main$4 = defineComponent({
|
|
8781
9081
|
name: "ElDropdownItem",
|
|
8782
9082
|
components: {
|
|
8783
9083
|
ElDropdownCollectionItem: ElCollectionItem,
|
|
@@ -8846,7 +9146,7 @@ const _sfc_main$3 = defineComponent({
|
|
|
8846
9146
|
};
|
|
8847
9147
|
}
|
|
8848
9148
|
});
|
|
8849
|
-
function _sfc_render$
|
|
9149
|
+
function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
8850
9150
|
var _a2;
|
|
8851
9151
|
const _component_el_dropdown_item_impl = resolveComponent("el-dropdown-item-impl");
|
|
8852
9152
|
const _component_el_roving_focus_item = resolveComponent("el-roving-focus-item");
|
|
@@ -8877,8 +9177,8 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
8877
9177
|
_: 3
|
|
8878
9178
|
}, 8, ["disabled", "text-value"]);
|
|
8879
9179
|
}
|
|
8880
|
-
var DropdownItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
8881
|
-
const _sfc_main$
|
|
9180
|
+
var DropdownItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$4, [["render", _sfc_render$2], ["__file", "dropdown-item.vue"]]);
|
|
9181
|
+
const _sfc_main$3 = defineComponent({
|
|
8882
9182
|
name: "ElDropdownMenu",
|
|
8883
9183
|
props: dropdownMenuProps,
|
|
8884
9184
|
setup(props) {
|
|
@@ -8939,7 +9239,7 @@ const _sfc_main$2 = defineComponent({
|
|
|
8939
9239
|
};
|
|
8940
9240
|
}
|
|
8941
9241
|
});
|
|
8942
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
9242
|
+
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
8943
9243
|
return openBlock(), createElementBlock("ul", {
|
|
8944
9244
|
ref: _ctx.dropdownListWrapperRef,
|
|
8945
9245
|
class: normalizeClass(_ctx.dropdownKls),
|
|
@@ -8955,13 +9255,14 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
8955
9255
|
renderSlot(_ctx.$slots, "default")
|
|
8956
9256
|
], 46, ["role", "aria-labelledby", "onBlur", "onFocus", "onKeydown", "onMousedown"]);
|
|
8957
9257
|
}
|
|
8958
|
-
var DropdownMenu = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
9258
|
+
var DropdownMenu = /* @__PURE__ */ _export_sfc$1(_sfc_main$3, [["render", _sfc_render$1], ["__file", "dropdown-menu.vue"]]);
|
|
8959
9259
|
const ElDropdown = withInstall(Dropdown, {
|
|
8960
9260
|
DropdownItem,
|
|
8961
9261
|
DropdownMenu
|
|
8962
9262
|
});
|
|
8963
9263
|
withNoopInstall(DropdownItem);
|
|
8964
9264
|
withNoopInstall(DropdownMenu);
|
|
9265
|
+
const isValidComponentSize = (val) => ["", ...componentSizes].includes(val);
|
|
8965
9266
|
const messageTypes = [
|
|
8966
9267
|
"primary",
|
|
8967
9268
|
"success",
|
|
@@ -9075,7 +9376,7 @@ const getOffsetOrSpace = (id, offset) => {
|
|
|
9075
9376
|
const __default__ = defineComponent({
|
|
9076
9377
|
name: "ElMessage"
|
|
9077
9378
|
});
|
|
9078
|
-
const _sfc_main$
|
|
9379
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
9079
9380
|
...__default__,
|
|
9080
9381
|
props: messageProps,
|
|
9081
9382
|
emits: messageEmits,
|
|
@@ -9216,7 +9517,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
9216
9517
|
};
|
|
9217
9518
|
}
|
|
9218
9519
|
});
|
|
9219
|
-
var MessageConstructor = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
9520
|
+
var MessageConstructor = /* @__PURE__ */ _export_sfc$1(_sfc_main$2, [["__file", "message.vue"]]);
|
|
9220
9521
|
let seed = 1;
|
|
9221
9522
|
const normalizeOptions = (params) => {
|
|
9222
9523
|
const options = !params || isString$1(params) || isVNode(params) || isFunction$1(params) ? { message: params } : params;
|
|
@@ -9333,6 +9634,662 @@ function closeAll(type) {
|
|
|
9333
9634
|
message.closeAll = closeAll;
|
|
9334
9635
|
message._context = null;
|
|
9335
9636
|
const ElMessage = withInstallFunction(message, "$message");
|
|
9637
|
+
const FOCUSABLE_CHILDREN = "_trap-focus-children";
|
|
9638
|
+
const FOCUS_STACK = [];
|
|
9639
|
+
const FOCUS_HANDLER = (e) => {
|
|
9640
|
+
if (FOCUS_STACK.length === 0)
|
|
9641
|
+
return;
|
|
9642
|
+
const focusableElement = FOCUS_STACK[FOCUS_STACK.length - 1][FOCUSABLE_CHILDREN];
|
|
9643
|
+
if (focusableElement.length > 0 && e.code === EVENT_CODE.tab) {
|
|
9644
|
+
if (focusableElement.length === 1) {
|
|
9645
|
+
e.preventDefault();
|
|
9646
|
+
if (document.activeElement !== focusableElement[0]) {
|
|
9647
|
+
focusableElement[0].focus();
|
|
9648
|
+
}
|
|
9649
|
+
return;
|
|
9650
|
+
}
|
|
9651
|
+
const goingBackward = e.shiftKey;
|
|
9652
|
+
const isFirst = e.target === focusableElement[0];
|
|
9653
|
+
const isLast = e.target === focusableElement[focusableElement.length - 1];
|
|
9654
|
+
if (isFirst && goingBackward) {
|
|
9655
|
+
e.preventDefault();
|
|
9656
|
+
focusableElement[focusableElement.length - 1].focus();
|
|
9657
|
+
}
|
|
9658
|
+
if (isLast && !goingBackward) {
|
|
9659
|
+
e.preventDefault();
|
|
9660
|
+
focusableElement[0].focus();
|
|
9661
|
+
}
|
|
9662
|
+
}
|
|
9663
|
+
};
|
|
9664
|
+
const TrapFocus = {
|
|
9665
|
+
beforeMount(el) {
|
|
9666
|
+
el[FOCUSABLE_CHILDREN] = obtainAllFocusableElements$1(el);
|
|
9667
|
+
FOCUS_STACK.push(el);
|
|
9668
|
+
if (FOCUS_STACK.length <= 1) {
|
|
9669
|
+
document.addEventListener("keydown", FOCUS_HANDLER);
|
|
9670
|
+
}
|
|
9671
|
+
},
|
|
9672
|
+
updated(el) {
|
|
9673
|
+
nextTick(() => {
|
|
9674
|
+
el[FOCUSABLE_CHILDREN] = obtainAllFocusableElements$1(el);
|
|
9675
|
+
});
|
|
9676
|
+
},
|
|
9677
|
+
unmounted() {
|
|
9678
|
+
FOCUS_STACK.shift();
|
|
9679
|
+
if (FOCUS_STACK.length === 0) {
|
|
9680
|
+
document.removeEventListener("keydown", FOCUS_HANDLER);
|
|
9681
|
+
}
|
|
9682
|
+
}
|
|
9683
|
+
};
|
|
9684
|
+
const _sfc_main$1 = defineComponent({
|
|
9685
|
+
name: "ElMessageBox",
|
|
9686
|
+
directives: {
|
|
9687
|
+
TrapFocus
|
|
9688
|
+
},
|
|
9689
|
+
components: {
|
|
9690
|
+
ElButton,
|
|
9691
|
+
ElFocusTrap,
|
|
9692
|
+
ElInput,
|
|
9693
|
+
ElOverlay,
|
|
9694
|
+
ElIcon,
|
|
9695
|
+
...TypeComponents
|
|
9696
|
+
},
|
|
9697
|
+
inheritAttrs: false,
|
|
9698
|
+
props: {
|
|
9699
|
+
buttonSize: {
|
|
9700
|
+
type: String,
|
|
9701
|
+
validator: isValidComponentSize
|
|
9702
|
+
},
|
|
9703
|
+
modal: {
|
|
9704
|
+
type: Boolean,
|
|
9705
|
+
default: true
|
|
9706
|
+
},
|
|
9707
|
+
lockScroll: {
|
|
9708
|
+
type: Boolean,
|
|
9709
|
+
default: true
|
|
9710
|
+
},
|
|
9711
|
+
showClose: {
|
|
9712
|
+
type: Boolean,
|
|
9713
|
+
default: true
|
|
9714
|
+
},
|
|
9715
|
+
closeOnClickModal: {
|
|
9716
|
+
type: Boolean,
|
|
9717
|
+
default: true
|
|
9718
|
+
},
|
|
9719
|
+
closeOnPressEscape: {
|
|
9720
|
+
type: Boolean,
|
|
9721
|
+
default: true
|
|
9722
|
+
},
|
|
9723
|
+
closeOnHashChange: {
|
|
9724
|
+
type: Boolean,
|
|
9725
|
+
default: true
|
|
9726
|
+
},
|
|
9727
|
+
center: Boolean,
|
|
9728
|
+
draggable: Boolean,
|
|
9729
|
+
overflow: Boolean,
|
|
9730
|
+
roundButton: Boolean,
|
|
9731
|
+
container: {
|
|
9732
|
+
type: String,
|
|
9733
|
+
default: "body"
|
|
9734
|
+
},
|
|
9735
|
+
boxType: {
|
|
9736
|
+
type: String,
|
|
9737
|
+
default: ""
|
|
9738
|
+
}
|
|
9739
|
+
},
|
|
9740
|
+
emits: ["vanish", "action"],
|
|
9741
|
+
setup(props, { emit }) {
|
|
9742
|
+
const {
|
|
9743
|
+
locale,
|
|
9744
|
+
zIndex: zIndex2,
|
|
9745
|
+
ns,
|
|
9746
|
+
size: btnSize
|
|
9747
|
+
} = useGlobalComponentSettings("message-box", computed(() => props.buttonSize));
|
|
9748
|
+
const { t } = locale;
|
|
9749
|
+
const { nextZIndex } = zIndex2;
|
|
9750
|
+
const visible = ref(false);
|
|
9751
|
+
const state = reactive({
|
|
9752
|
+
autofocus: true,
|
|
9753
|
+
beforeClose: null,
|
|
9754
|
+
callback: null,
|
|
9755
|
+
cancelButtonText: "",
|
|
9756
|
+
cancelButtonClass: "",
|
|
9757
|
+
confirmButtonText: "",
|
|
9758
|
+
confirmButtonClass: "",
|
|
9759
|
+
customClass: "",
|
|
9760
|
+
customStyle: {},
|
|
9761
|
+
dangerouslyUseHTMLString: false,
|
|
9762
|
+
distinguishCancelAndClose: false,
|
|
9763
|
+
icon: "",
|
|
9764
|
+
closeIcon: "",
|
|
9765
|
+
inputPattern: null,
|
|
9766
|
+
inputPlaceholder: "",
|
|
9767
|
+
inputType: "text",
|
|
9768
|
+
inputValue: "",
|
|
9769
|
+
inputValidator: void 0,
|
|
9770
|
+
inputErrorMessage: "",
|
|
9771
|
+
message: "",
|
|
9772
|
+
modalFade: true,
|
|
9773
|
+
modalClass: "",
|
|
9774
|
+
showCancelButton: false,
|
|
9775
|
+
showConfirmButton: true,
|
|
9776
|
+
type: "",
|
|
9777
|
+
title: void 0,
|
|
9778
|
+
showInput: false,
|
|
9779
|
+
action: "",
|
|
9780
|
+
confirmButtonLoading: false,
|
|
9781
|
+
cancelButtonLoading: false,
|
|
9782
|
+
confirmButtonLoadingIcon: markRaw(loading_default),
|
|
9783
|
+
cancelButtonLoadingIcon: markRaw(loading_default),
|
|
9784
|
+
confirmButtonDisabled: false,
|
|
9785
|
+
editorErrorMessage: "",
|
|
9786
|
+
validateError: false,
|
|
9787
|
+
zIndex: nextZIndex()
|
|
9788
|
+
});
|
|
9789
|
+
const typeClass = computed(() => {
|
|
9790
|
+
const type = state.type;
|
|
9791
|
+
return { [ns.bm("icon", type)]: type && TypeComponentsMap[type] };
|
|
9792
|
+
});
|
|
9793
|
+
const contentId = useId();
|
|
9794
|
+
const inputId = useId();
|
|
9795
|
+
const iconComponent = computed(() => {
|
|
9796
|
+
const type = state.type;
|
|
9797
|
+
return state.icon || type && TypeComponentsMap[type] || "";
|
|
9798
|
+
});
|
|
9799
|
+
const hasMessage = computed(() => !!state.message);
|
|
9800
|
+
const rootRef = ref();
|
|
9801
|
+
const headerRef = ref();
|
|
9802
|
+
const focusStartRef = ref();
|
|
9803
|
+
const inputRef = ref();
|
|
9804
|
+
const confirmRef = ref();
|
|
9805
|
+
const confirmButtonClasses = computed(() => state.confirmButtonClass);
|
|
9806
|
+
watch(() => state.inputValue, async (val) => {
|
|
9807
|
+
await nextTick();
|
|
9808
|
+
if (props.boxType === "prompt" && val) {
|
|
9809
|
+
validate();
|
|
9810
|
+
}
|
|
9811
|
+
}, { immediate: true });
|
|
9812
|
+
watch(() => visible.value, (val) => {
|
|
9813
|
+
var _a2, _b;
|
|
9814
|
+
if (val) {
|
|
9815
|
+
if (props.boxType !== "prompt") {
|
|
9816
|
+
if (state.autofocus) {
|
|
9817
|
+
focusStartRef.value = (_b = (_a2 = confirmRef.value) == null ? void 0 : _a2.$el) != null ? _b : rootRef.value;
|
|
9818
|
+
} else {
|
|
9819
|
+
focusStartRef.value = rootRef.value;
|
|
9820
|
+
}
|
|
9821
|
+
}
|
|
9822
|
+
state.zIndex = nextZIndex();
|
|
9823
|
+
}
|
|
9824
|
+
if (props.boxType !== "prompt")
|
|
9825
|
+
return;
|
|
9826
|
+
if (val) {
|
|
9827
|
+
nextTick().then(() => {
|
|
9828
|
+
var _a22;
|
|
9829
|
+
if (inputRef.value && inputRef.value.$el) {
|
|
9830
|
+
if (state.autofocus) {
|
|
9831
|
+
focusStartRef.value = (_a22 = getInputElement()) != null ? _a22 : rootRef.value;
|
|
9832
|
+
} else {
|
|
9833
|
+
focusStartRef.value = rootRef.value;
|
|
9834
|
+
}
|
|
9835
|
+
}
|
|
9836
|
+
});
|
|
9837
|
+
} else {
|
|
9838
|
+
state.editorErrorMessage = "";
|
|
9839
|
+
state.validateError = false;
|
|
9840
|
+
}
|
|
9841
|
+
});
|
|
9842
|
+
const draggable = computed(() => props.draggable);
|
|
9843
|
+
const overflow = computed(() => props.overflow);
|
|
9844
|
+
useDraggable(rootRef, headerRef, draggable, overflow);
|
|
9845
|
+
onMounted(async () => {
|
|
9846
|
+
await nextTick();
|
|
9847
|
+
if (props.closeOnHashChange) {
|
|
9848
|
+
window.addEventListener("hashchange", doClose);
|
|
9849
|
+
}
|
|
9850
|
+
});
|
|
9851
|
+
onBeforeUnmount(() => {
|
|
9852
|
+
if (props.closeOnHashChange) {
|
|
9853
|
+
window.removeEventListener("hashchange", doClose);
|
|
9854
|
+
}
|
|
9855
|
+
});
|
|
9856
|
+
function doClose() {
|
|
9857
|
+
if (!visible.value)
|
|
9858
|
+
return;
|
|
9859
|
+
visible.value = false;
|
|
9860
|
+
nextTick(() => {
|
|
9861
|
+
if (state.action)
|
|
9862
|
+
emit("action", state.action);
|
|
9863
|
+
});
|
|
9864
|
+
}
|
|
9865
|
+
const handleWrapperClick = () => {
|
|
9866
|
+
if (props.closeOnClickModal) {
|
|
9867
|
+
handleAction(state.distinguishCancelAndClose ? "close" : "cancel");
|
|
9868
|
+
}
|
|
9869
|
+
};
|
|
9870
|
+
const overlayEvent = useSameTarget(handleWrapperClick);
|
|
9871
|
+
const handleInputEnter = (e) => {
|
|
9872
|
+
if (state.inputType !== "textarea") {
|
|
9873
|
+
e.preventDefault();
|
|
9874
|
+
return handleAction("confirm");
|
|
9875
|
+
}
|
|
9876
|
+
};
|
|
9877
|
+
const handleAction = (action) => {
|
|
9878
|
+
var _a2;
|
|
9879
|
+
if (props.boxType === "prompt" && action === "confirm" && !validate()) {
|
|
9880
|
+
return;
|
|
9881
|
+
}
|
|
9882
|
+
state.action = action;
|
|
9883
|
+
if (state.beforeClose) {
|
|
9884
|
+
(_a2 = state.beforeClose) == null ? void 0 : _a2.call(state, action, state, doClose);
|
|
9885
|
+
} else {
|
|
9886
|
+
doClose();
|
|
9887
|
+
}
|
|
9888
|
+
};
|
|
9889
|
+
const validate = () => {
|
|
9890
|
+
if (props.boxType === "prompt") {
|
|
9891
|
+
const inputPattern = state.inputPattern;
|
|
9892
|
+
if (inputPattern && !inputPattern.test(state.inputValue || "")) {
|
|
9893
|
+
state.editorErrorMessage = state.inputErrorMessage || t("el.messagebox.error");
|
|
9894
|
+
state.validateError = true;
|
|
9895
|
+
return false;
|
|
9896
|
+
}
|
|
9897
|
+
const inputValidator = state.inputValidator;
|
|
9898
|
+
if (isFunction$1(inputValidator)) {
|
|
9899
|
+
const validateResult = inputValidator(state.inputValue);
|
|
9900
|
+
if (validateResult === false) {
|
|
9901
|
+
state.editorErrorMessage = state.inputErrorMessage || t("el.messagebox.error");
|
|
9902
|
+
state.validateError = true;
|
|
9903
|
+
return false;
|
|
9904
|
+
}
|
|
9905
|
+
if (isString$1(validateResult)) {
|
|
9906
|
+
state.editorErrorMessage = validateResult;
|
|
9907
|
+
state.validateError = true;
|
|
9908
|
+
return false;
|
|
9909
|
+
}
|
|
9910
|
+
}
|
|
9911
|
+
}
|
|
9912
|
+
state.editorErrorMessage = "";
|
|
9913
|
+
state.validateError = false;
|
|
9914
|
+
return true;
|
|
9915
|
+
};
|
|
9916
|
+
const getInputElement = () => {
|
|
9917
|
+
var _a2, _b;
|
|
9918
|
+
const inputRefs = (_a2 = inputRef.value) == null ? void 0 : _a2.$refs;
|
|
9919
|
+
return (_b = inputRefs == null ? void 0 : inputRefs.input) != null ? _b : inputRefs == null ? void 0 : inputRefs.textarea;
|
|
9920
|
+
};
|
|
9921
|
+
const handleClose = () => {
|
|
9922
|
+
handleAction("close");
|
|
9923
|
+
};
|
|
9924
|
+
const onCloseRequested = () => {
|
|
9925
|
+
if (props.closeOnPressEscape) {
|
|
9926
|
+
handleClose();
|
|
9927
|
+
}
|
|
9928
|
+
};
|
|
9929
|
+
if (props.lockScroll) {
|
|
9930
|
+
useLockscreen(visible);
|
|
9931
|
+
}
|
|
9932
|
+
return {
|
|
9933
|
+
...toRefs(state),
|
|
9934
|
+
ns,
|
|
9935
|
+
overlayEvent,
|
|
9936
|
+
visible,
|
|
9937
|
+
hasMessage,
|
|
9938
|
+
typeClass,
|
|
9939
|
+
contentId,
|
|
9940
|
+
inputId,
|
|
9941
|
+
btnSize,
|
|
9942
|
+
iconComponent,
|
|
9943
|
+
confirmButtonClasses,
|
|
9944
|
+
rootRef,
|
|
9945
|
+
focusStartRef,
|
|
9946
|
+
headerRef,
|
|
9947
|
+
inputRef,
|
|
9948
|
+
confirmRef,
|
|
9949
|
+
doClose,
|
|
9950
|
+
handleClose,
|
|
9951
|
+
onCloseRequested,
|
|
9952
|
+
handleWrapperClick,
|
|
9953
|
+
handleInputEnter,
|
|
9954
|
+
handleAction,
|
|
9955
|
+
t
|
|
9956
|
+
};
|
|
9957
|
+
}
|
|
9958
|
+
});
|
|
9959
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
9960
|
+
const _component_el_icon = resolveComponent("el-icon");
|
|
9961
|
+
const _component_el_input = resolveComponent("el-input");
|
|
9962
|
+
const _component_el_button = resolveComponent("el-button");
|
|
9963
|
+
const _component_el_focus_trap = resolveComponent("el-focus-trap");
|
|
9964
|
+
const _component_el_overlay = resolveComponent("el-overlay");
|
|
9965
|
+
return openBlock(), createBlock(Transition, {
|
|
9966
|
+
name: "fade-in-linear",
|
|
9967
|
+
onAfterLeave: ($event) => _ctx.$emit("vanish"),
|
|
9968
|
+
persisted: ""
|
|
9969
|
+
}, {
|
|
9970
|
+
default: withCtx(() => [
|
|
9971
|
+
withDirectives(createVNode(_component_el_overlay, {
|
|
9972
|
+
"z-index": _ctx.zIndex,
|
|
9973
|
+
"overlay-class": [_ctx.ns.is("message-box"), _ctx.modalClass],
|
|
9974
|
+
mask: _ctx.modal
|
|
9975
|
+
}, {
|
|
9976
|
+
default: withCtx(() => [
|
|
9977
|
+
createElementVNode("div", {
|
|
9978
|
+
role: "dialog",
|
|
9979
|
+
"aria-label": _ctx.title,
|
|
9980
|
+
"aria-modal": "true",
|
|
9981
|
+
"aria-describedby": !_ctx.showInput ? _ctx.contentId : void 0,
|
|
9982
|
+
class: normalizeClass(`${_ctx.ns.namespace.value}-overlay-message-box`),
|
|
9983
|
+
onClick: _ctx.overlayEvent.onClick,
|
|
9984
|
+
onMousedown: _ctx.overlayEvent.onMousedown,
|
|
9985
|
+
onMouseup: _ctx.overlayEvent.onMouseup
|
|
9986
|
+
}, [
|
|
9987
|
+
createVNode(_component_el_focus_trap, {
|
|
9988
|
+
loop: "",
|
|
9989
|
+
trapped: _ctx.visible,
|
|
9990
|
+
"focus-trap-el": _ctx.rootRef,
|
|
9991
|
+
"focus-start-el": _ctx.focusStartRef,
|
|
9992
|
+
onReleaseRequested: _ctx.onCloseRequested
|
|
9993
|
+
}, {
|
|
9994
|
+
default: withCtx(() => [
|
|
9995
|
+
createElementVNode("div", {
|
|
9996
|
+
ref: "rootRef",
|
|
9997
|
+
class: normalizeClass([
|
|
9998
|
+
_ctx.ns.b(),
|
|
9999
|
+
_ctx.customClass,
|
|
10000
|
+
_ctx.ns.is("draggable", _ctx.draggable),
|
|
10001
|
+
{ [_ctx.ns.m("center")]: _ctx.center }
|
|
10002
|
+
]),
|
|
10003
|
+
style: normalizeStyle(_ctx.customStyle),
|
|
10004
|
+
tabindex: "-1",
|
|
10005
|
+
onClick: withModifiers(() => {
|
|
10006
|
+
}, ["stop"])
|
|
10007
|
+
}, [
|
|
10008
|
+
_ctx.title !== null && _ctx.title !== void 0 ? (openBlock(), createElementBlock("div", {
|
|
10009
|
+
key: 0,
|
|
10010
|
+
ref: "headerRef",
|
|
10011
|
+
class: normalizeClass([_ctx.ns.e("header"), { "show-close": _ctx.showClose }])
|
|
10012
|
+
}, [
|
|
10013
|
+
createElementVNode("div", {
|
|
10014
|
+
class: normalizeClass(_ctx.ns.e("title"))
|
|
10015
|
+
}, [
|
|
10016
|
+
_ctx.iconComponent && _ctx.center ? (openBlock(), createBlock(_component_el_icon, {
|
|
10017
|
+
key: 0,
|
|
10018
|
+
class: normalizeClass([_ctx.ns.e("status"), _ctx.typeClass])
|
|
10019
|
+
}, {
|
|
10020
|
+
default: withCtx(() => [
|
|
10021
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.iconComponent)))
|
|
10022
|
+
]),
|
|
10023
|
+
_: 1
|
|
10024
|
+
}, 8, ["class"])) : createCommentVNode("v-if", true),
|
|
10025
|
+
createElementVNode("span", null, toDisplayString(_ctx.title), 1)
|
|
10026
|
+
], 2),
|
|
10027
|
+
_ctx.showClose ? (openBlock(), createElementBlock("button", {
|
|
10028
|
+
key: 0,
|
|
10029
|
+
type: "button",
|
|
10030
|
+
class: normalizeClass(_ctx.ns.e("headerbtn")),
|
|
10031
|
+
"aria-label": _ctx.t("el.messagebox.close"),
|
|
10032
|
+
onClick: ($event) => _ctx.handleAction(_ctx.distinguishCancelAndClose ? "close" : "cancel"),
|
|
10033
|
+
onKeydown: withKeys(withModifiers(($event) => _ctx.handleAction(_ctx.distinguishCancelAndClose ? "close" : "cancel"), ["prevent"]), ["enter"])
|
|
10034
|
+
}, [
|
|
10035
|
+
createVNode(_component_el_icon, {
|
|
10036
|
+
class: normalizeClass(_ctx.ns.e("close"))
|
|
10037
|
+
}, {
|
|
10038
|
+
default: withCtx(() => [
|
|
10039
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.closeIcon || "close")))
|
|
10040
|
+
]),
|
|
10041
|
+
_: 1
|
|
10042
|
+
}, 8, ["class"])
|
|
10043
|
+
], 42, ["aria-label", "onClick", "onKeydown"])) : createCommentVNode("v-if", true)
|
|
10044
|
+
], 2)) : createCommentVNode("v-if", true),
|
|
10045
|
+
createElementVNode("div", {
|
|
10046
|
+
id: _ctx.contentId,
|
|
10047
|
+
class: normalizeClass(_ctx.ns.e("content"))
|
|
10048
|
+
}, [
|
|
10049
|
+
createElementVNode("div", {
|
|
10050
|
+
class: normalizeClass(_ctx.ns.e("container"))
|
|
10051
|
+
}, [
|
|
10052
|
+
_ctx.iconComponent && !_ctx.center && _ctx.hasMessage ? (openBlock(), createBlock(_component_el_icon, {
|
|
10053
|
+
key: 0,
|
|
10054
|
+
class: normalizeClass([_ctx.ns.e("status"), _ctx.typeClass])
|
|
10055
|
+
}, {
|
|
10056
|
+
default: withCtx(() => [
|
|
10057
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.iconComponent)))
|
|
10058
|
+
]),
|
|
10059
|
+
_: 1
|
|
10060
|
+
}, 8, ["class"])) : createCommentVNode("v-if", true),
|
|
10061
|
+
_ctx.hasMessage ? (openBlock(), createElementBlock("div", {
|
|
10062
|
+
key: 1,
|
|
10063
|
+
class: normalizeClass(_ctx.ns.e("message"))
|
|
10064
|
+
}, [
|
|
10065
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
10066
|
+
!_ctx.dangerouslyUseHTMLString ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.showInput ? "label" : "p"), {
|
|
10067
|
+
key: 0,
|
|
10068
|
+
for: _ctx.showInput ? _ctx.inputId : void 0,
|
|
10069
|
+
textContent: toDisplayString(_ctx.message)
|
|
10070
|
+
}, null, 8, ["for", "textContent"])) : (openBlock(), createBlock(resolveDynamicComponent(_ctx.showInput ? "label" : "p"), {
|
|
10071
|
+
key: 1,
|
|
10072
|
+
for: _ctx.showInput ? _ctx.inputId : void 0,
|
|
10073
|
+
innerHTML: _ctx.message
|
|
10074
|
+
}, null, 8, ["for", "innerHTML"]))
|
|
10075
|
+
])
|
|
10076
|
+
], 2)) : createCommentVNode("v-if", true)
|
|
10077
|
+
], 2),
|
|
10078
|
+
withDirectives(createElementVNode("div", {
|
|
10079
|
+
class: normalizeClass(_ctx.ns.e("input"))
|
|
10080
|
+
}, [
|
|
10081
|
+
createVNode(_component_el_input, {
|
|
10082
|
+
id: _ctx.inputId,
|
|
10083
|
+
ref: "inputRef",
|
|
10084
|
+
modelValue: _ctx.inputValue,
|
|
10085
|
+
"onUpdate:modelValue": ($event) => _ctx.inputValue = $event,
|
|
10086
|
+
type: _ctx.inputType,
|
|
10087
|
+
placeholder: _ctx.inputPlaceholder,
|
|
10088
|
+
"aria-invalid": _ctx.validateError,
|
|
10089
|
+
class: normalizeClass({ invalid: _ctx.validateError }),
|
|
10090
|
+
onKeydown: withKeys(_ctx.handleInputEnter, ["enter"])
|
|
10091
|
+
}, null, 8, ["id", "modelValue", "onUpdate:modelValue", "type", "placeholder", "aria-invalid", "class", "onKeydown"]),
|
|
10092
|
+
createElementVNode("div", {
|
|
10093
|
+
class: normalizeClass(_ctx.ns.e("errormsg")),
|
|
10094
|
+
style: normalizeStyle({
|
|
10095
|
+
visibility: !!_ctx.editorErrorMessage ? "visible" : "hidden"
|
|
10096
|
+
})
|
|
10097
|
+
}, toDisplayString(_ctx.editorErrorMessage), 7)
|
|
10098
|
+
], 2), [
|
|
10099
|
+
[vShow, _ctx.showInput]
|
|
10100
|
+
])
|
|
10101
|
+
], 10, ["id"]),
|
|
10102
|
+
createElementVNode("div", {
|
|
10103
|
+
class: normalizeClass(_ctx.ns.e("btns"))
|
|
10104
|
+
}, [
|
|
10105
|
+
_ctx.showCancelButton ? (openBlock(), createBlock(_component_el_button, {
|
|
10106
|
+
key: 0,
|
|
10107
|
+
loading: _ctx.cancelButtonLoading,
|
|
10108
|
+
"loading-icon": _ctx.cancelButtonLoadingIcon,
|
|
10109
|
+
class: normalizeClass([_ctx.cancelButtonClass]),
|
|
10110
|
+
round: _ctx.roundButton,
|
|
10111
|
+
size: _ctx.btnSize,
|
|
10112
|
+
onClick: ($event) => _ctx.handleAction("cancel"),
|
|
10113
|
+
onKeydown: withKeys(withModifiers(($event) => _ctx.handleAction("cancel"), ["prevent"]), ["enter"])
|
|
10114
|
+
}, {
|
|
10115
|
+
default: withCtx(() => [
|
|
10116
|
+
createTextVNode(toDisplayString(_ctx.cancelButtonText || _ctx.t("el.messagebox.cancel")), 1)
|
|
10117
|
+
]),
|
|
10118
|
+
_: 1
|
|
10119
|
+
}, 8, ["loading", "loading-icon", "class", "round", "size", "onClick", "onKeydown"])) : createCommentVNode("v-if", true),
|
|
10120
|
+
withDirectives(createVNode(_component_el_button, {
|
|
10121
|
+
ref: "confirmRef",
|
|
10122
|
+
type: "primary",
|
|
10123
|
+
loading: _ctx.confirmButtonLoading,
|
|
10124
|
+
"loading-icon": _ctx.confirmButtonLoadingIcon,
|
|
10125
|
+
class: normalizeClass([_ctx.confirmButtonClasses]),
|
|
10126
|
+
round: _ctx.roundButton,
|
|
10127
|
+
disabled: _ctx.confirmButtonDisabled,
|
|
10128
|
+
size: _ctx.btnSize,
|
|
10129
|
+
onClick: ($event) => _ctx.handleAction("confirm"),
|
|
10130
|
+
onKeydown: withKeys(withModifiers(($event) => _ctx.handleAction("confirm"), ["prevent"]), ["enter"])
|
|
10131
|
+
}, {
|
|
10132
|
+
default: withCtx(() => [
|
|
10133
|
+
createTextVNode(toDisplayString(_ctx.confirmButtonText || _ctx.t("el.messagebox.confirm")), 1)
|
|
10134
|
+
]),
|
|
10135
|
+
_: 1
|
|
10136
|
+
}, 8, ["loading", "loading-icon", "class", "round", "disabled", "size", "onClick", "onKeydown"]), [
|
|
10137
|
+
[vShow, _ctx.showConfirmButton]
|
|
10138
|
+
])
|
|
10139
|
+
], 2)
|
|
10140
|
+
], 14, ["onClick"])
|
|
10141
|
+
]),
|
|
10142
|
+
_: 3
|
|
10143
|
+
}, 8, ["trapped", "focus-trap-el", "focus-start-el", "onReleaseRequested"])
|
|
10144
|
+
], 42, ["aria-label", "aria-describedby", "onClick", "onMousedown", "onMouseup"])
|
|
10145
|
+
]),
|
|
10146
|
+
_: 3
|
|
10147
|
+
}, 8, ["z-index", "overlay-class", "mask"]), [
|
|
10148
|
+
[vShow, _ctx.visible]
|
|
10149
|
+
])
|
|
10150
|
+
]),
|
|
10151
|
+
_: 3
|
|
10152
|
+
}, 8, ["onAfterLeave"]);
|
|
10153
|
+
}
|
|
10154
|
+
var MessageBoxConstructor = /* @__PURE__ */ _export_sfc$1(_sfc_main$1, [["render", _sfc_render], ["__file", "index.vue"]]);
|
|
10155
|
+
const messageInstance = /* @__PURE__ */ new Map();
|
|
10156
|
+
const getAppendToElement = (props) => {
|
|
10157
|
+
let appendTo = document.body;
|
|
10158
|
+
if (props.appendTo) {
|
|
10159
|
+
if (isString$1(props.appendTo)) {
|
|
10160
|
+
appendTo = document.querySelector(props.appendTo);
|
|
10161
|
+
}
|
|
10162
|
+
if (isElement(props.appendTo)) {
|
|
10163
|
+
appendTo = props.appendTo;
|
|
10164
|
+
}
|
|
10165
|
+
if (!isElement(appendTo)) {
|
|
10166
|
+
appendTo = document.body;
|
|
10167
|
+
}
|
|
10168
|
+
}
|
|
10169
|
+
return appendTo;
|
|
10170
|
+
};
|
|
10171
|
+
const initInstance = (props, container, appContext = null) => {
|
|
10172
|
+
const vnode = createVNode(MessageBoxConstructor, props, isFunction$1(props.message) || isVNode(props.message) ? {
|
|
10173
|
+
default: isFunction$1(props.message) ? props.message : () => props.message
|
|
10174
|
+
} : null);
|
|
10175
|
+
vnode.appContext = appContext;
|
|
10176
|
+
render(vnode, container);
|
|
10177
|
+
getAppendToElement(props).appendChild(container.firstElementChild);
|
|
10178
|
+
return vnode.component;
|
|
10179
|
+
};
|
|
10180
|
+
const genContainer = () => {
|
|
10181
|
+
return document.createElement("div");
|
|
10182
|
+
};
|
|
10183
|
+
const showMessage = (options, appContext) => {
|
|
10184
|
+
const container = genContainer();
|
|
10185
|
+
options.onVanish = () => {
|
|
10186
|
+
render(null, container);
|
|
10187
|
+
messageInstance.delete(vm);
|
|
10188
|
+
};
|
|
10189
|
+
options.onAction = (action) => {
|
|
10190
|
+
const currentMsg = messageInstance.get(vm);
|
|
10191
|
+
let resolve;
|
|
10192
|
+
if (options.showInput) {
|
|
10193
|
+
resolve = { value: vm.inputValue, action };
|
|
10194
|
+
} else {
|
|
10195
|
+
resolve = action;
|
|
10196
|
+
}
|
|
10197
|
+
if (options.callback) {
|
|
10198
|
+
options.callback(resolve, instance.proxy);
|
|
10199
|
+
} else {
|
|
10200
|
+
if (action === "cancel" || action === "close") {
|
|
10201
|
+
if (options.distinguishCancelAndClose && action !== "cancel") {
|
|
10202
|
+
currentMsg.reject("close");
|
|
10203
|
+
} else {
|
|
10204
|
+
currentMsg.reject("cancel");
|
|
10205
|
+
}
|
|
10206
|
+
} else {
|
|
10207
|
+
currentMsg.resolve(resolve);
|
|
10208
|
+
}
|
|
10209
|
+
}
|
|
10210
|
+
};
|
|
10211
|
+
const instance = initInstance(options, container, appContext);
|
|
10212
|
+
const vm = instance.proxy;
|
|
10213
|
+
for (const prop in options) {
|
|
10214
|
+
if (hasOwn(options, prop) && !hasOwn(vm.$props, prop)) {
|
|
10215
|
+
if (prop === "closeIcon" && isObject$1(options[prop])) {
|
|
10216
|
+
vm[prop] = markRaw(options[prop]);
|
|
10217
|
+
} else {
|
|
10218
|
+
vm[prop] = options[prop];
|
|
10219
|
+
}
|
|
10220
|
+
}
|
|
10221
|
+
}
|
|
10222
|
+
vm.visible = true;
|
|
10223
|
+
return vm;
|
|
10224
|
+
};
|
|
10225
|
+
function MessageBox(options, appContext = null) {
|
|
10226
|
+
if (!isClient)
|
|
10227
|
+
return Promise.reject();
|
|
10228
|
+
let callback;
|
|
10229
|
+
if (isString$1(options) || isVNode(options)) {
|
|
10230
|
+
options = {
|
|
10231
|
+
message: options
|
|
10232
|
+
};
|
|
10233
|
+
} else {
|
|
10234
|
+
callback = options.callback;
|
|
10235
|
+
}
|
|
10236
|
+
return new Promise((resolve, reject) => {
|
|
10237
|
+
const vm = showMessage(options, appContext != null ? appContext : MessageBox._context);
|
|
10238
|
+
messageInstance.set(vm, {
|
|
10239
|
+
options,
|
|
10240
|
+
callback,
|
|
10241
|
+
resolve,
|
|
10242
|
+
reject
|
|
10243
|
+
});
|
|
10244
|
+
});
|
|
10245
|
+
}
|
|
10246
|
+
const MESSAGE_BOX_VARIANTS = ["alert", "confirm", "prompt"];
|
|
10247
|
+
const MESSAGE_BOX_DEFAULT_OPTS = {
|
|
10248
|
+
alert: { closeOnPressEscape: false, closeOnClickModal: false },
|
|
10249
|
+
confirm: { showCancelButton: true },
|
|
10250
|
+
prompt: { showCancelButton: true, showInput: true }
|
|
10251
|
+
};
|
|
10252
|
+
MESSAGE_BOX_VARIANTS.forEach((boxType) => {
|
|
10253
|
+
MessageBox[boxType] = messageBoxFactory(boxType);
|
|
10254
|
+
});
|
|
10255
|
+
function messageBoxFactory(boxType) {
|
|
10256
|
+
return (message2, title, options, appContext) => {
|
|
10257
|
+
let titleOrOpts = "";
|
|
10258
|
+
if (isObject$1(title)) {
|
|
10259
|
+
options = title;
|
|
10260
|
+
titleOrOpts = "";
|
|
10261
|
+
} else if (isUndefined(title)) {
|
|
10262
|
+
titleOrOpts = "";
|
|
10263
|
+
} else {
|
|
10264
|
+
titleOrOpts = title;
|
|
10265
|
+
}
|
|
10266
|
+
return MessageBox(Object.assign({
|
|
10267
|
+
title: titleOrOpts,
|
|
10268
|
+
message: message2,
|
|
10269
|
+
type: "",
|
|
10270
|
+
...MESSAGE_BOX_DEFAULT_OPTS[boxType]
|
|
10271
|
+
}, options, {
|
|
10272
|
+
boxType
|
|
10273
|
+
}), appContext);
|
|
10274
|
+
};
|
|
10275
|
+
}
|
|
10276
|
+
MessageBox.close = () => {
|
|
10277
|
+
messageInstance.forEach((_, vm) => {
|
|
10278
|
+
vm.doClose();
|
|
10279
|
+
});
|
|
10280
|
+
messageInstance.clear();
|
|
10281
|
+
};
|
|
10282
|
+
MessageBox._context = null;
|
|
10283
|
+
const _MessageBox = MessageBox;
|
|
10284
|
+
_MessageBox.install = (app) => {
|
|
10285
|
+
_MessageBox._context = app._context;
|
|
10286
|
+
app.config.globalProperties.$msgbox = _MessageBox;
|
|
10287
|
+
app.config.globalProperties.$messageBox = _MessageBox;
|
|
10288
|
+
app.config.globalProperties.$alert = _MessageBox.alert;
|
|
10289
|
+
app.config.globalProperties.$confirm = _MessageBox.confirm;
|
|
10290
|
+
app.config.globalProperties.$prompt = _MessageBox.prompt;
|
|
10291
|
+
};
|
|
10292
|
+
const ElMessageBox = _MessageBox;
|
|
9336
10293
|
const textureUrl = "data:image/png;base64,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";
|
|
9337
10294
|
const searchTextureUrl = "data:image/png;base64,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";
|
|
9338
10295
|
class Debouncing {
|
|
@@ -9785,6 +10742,9 @@ class CommandFlowComponent extends Component {
|
|
|
9785
10742
|
}
|
|
9786
10743
|
};
|
|
9787
10744
|
}
|
|
10745
|
+
formatText(text, color = "var(--primary-color)", style = "") {
|
|
10746
|
+
return `<span style="color: ${color};${style}">${text}</span>`;
|
|
10747
|
+
}
|
|
9788
10748
|
}
|
|
9789
10749
|
class Default extends CommandFlowComponent {
|
|
9790
10750
|
static name = "Default";
|
|
@@ -10037,7 +10997,7 @@ class DrawDoorLine extends CommandFlowComponent {
|
|
|
10037
10997
|
super.onAddFromParent(parent);
|
|
10038
10998
|
const editor = parent.findComponentByName("Editor"), eventInput = editor.eventInput, commandManager = editor.commandManager;
|
|
10039
10999
|
this.editor.container.add(this.container);
|
|
10040
|
-
const commandFlow = this.commandManager.addCommandFlow("draw-door-line").add(this.createInterrupt()).add(this.createCursor("no-drop")).add(this.selectPoint.bind(this)).add(this.end.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this))
|
|
11000
|
+
const commandFlow = this.commandManager.addCommandFlow("draw-door-line").add(this.createInterrupt()).add(this.createCursor("no-drop")).add(this.selectPoint.bind(this), { prompt: `请选择线段作为门的依附墙体, ${this.formatText("ESC")} 取消命令` }).add(this.end.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
|
|
10041
11001
|
eventInput.addKeyCombination(this.commandName, this.shortcutKeys);
|
|
10042
11002
|
commandFlow.addEventListener("finally", this.createFinally());
|
|
10043
11003
|
commandFlow.addEventListener("completed", (e) => this.completed(e.data));
|
|
@@ -10131,6 +11091,10 @@ class DrawDoorLine extends CommandFlowComponent {
|
|
|
10131
11091
|
option
|
|
10132
11092
|
});
|
|
10133
11093
|
}
|
|
11094
|
+
ElMessage({
|
|
11095
|
+
message: "绘制完成",
|
|
11096
|
+
type: "success"
|
|
11097
|
+
});
|
|
10134
11098
|
next(data);
|
|
10135
11099
|
}
|
|
10136
11100
|
/** 执行完成
|
|
@@ -10176,7 +11140,7 @@ class DrawLine extends CommandFlowComponent {
|
|
|
10176
11140
|
onAddFromParent(parent) {
|
|
10177
11141
|
super.onAddFromParent(parent);
|
|
10178
11142
|
this.editor.container.add(this.container);
|
|
10179
|
-
const commandFlow = this.commandManager.addCommandFlow(this.commandName).add(this.createInterrupt()).add(this.createCursor("crosshair")).add(this.selectPoint.bind(this)).add(this.end.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this)).setLoop(true);
|
|
11143
|
+
const commandFlow = this.commandManager.addCommandFlow(this.commandName).add(this.createInterrupt()).add(this.createCursor("crosshair")).add(this.selectPoint.bind(this), { prompt: `两个点绘制一条线段,可连续绘制多条线段, ${this.formatText("ESC")} 取消命令` }).add(this.end.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this)).setLoop(true);
|
|
10180
11144
|
commandFlow.addEventListener("finally", this.createFinally());
|
|
10181
11145
|
commandFlow.addEventListener("completed", (e) => this.completed(e.data));
|
|
10182
11146
|
this.eventInput.addKeyCombination(this.commandName, this.shortcutKeys);
|
|
@@ -10280,6 +11244,10 @@ class DrawLine extends CommandFlowComponent {
|
|
|
10280
11244
|
line2.userData.rooftopPz = rooftopPz;
|
|
10281
11245
|
}
|
|
10282
11246
|
});
|
|
11247
|
+
ElMessage({
|
|
11248
|
+
message: "绘制完成",
|
|
11249
|
+
type: "success"
|
|
11250
|
+
});
|
|
10283
11251
|
next(lines);
|
|
10284
11252
|
}
|
|
10285
11253
|
/** 执行完成
|
|
@@ -10313,7 +11281,7 @@ class DrawWindow extends CommandFlowComponent {
|
|
|
10313
11281
|
onAddFromParent(parent) {
|
|
10314
11282
|
super.onAddFromParent(parent);
|
|
10315
11283
|
this.editor.container.add(this.container);
|
|
10316
|
-
const commandFlow = this.commandManager.addCommandFlow(this.commandName).add(this.createInterrupt()).add(this.createCursor("no-drop")).add(this.selectPointStart.bind(this)).add(this.selectPointEnd.bind(this)).add(this.end.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this))
|
|
11284
|
+
const commandFlow = this.commandManager.addCommandFlow(this.commandName).add(this.createInterrupt()).add(this.createCursor("no-drop")).add(this.selectPointStart.bind(this), { prompt: `请选择一条线段作为窗户依附墙体, ${this.formatText("ESC")} 取消命令` }).add(this.selectPointEnd.bind(this), { prompt: `请在上一步选择的线段上再选择一个点,闭合窗户` }).add(this.end.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
|
|
10317
11285
|
commandFlow.addEventListener("finally", this.createFinally(["selectPointStart"]));
|
|
10318
11286
|
commandFlow.addEventListener("completed", (e) => this.completed(e.data));
|
|
10319
11287
|
this.eventInput.addKeyCombination(this.commandName, this.shortcutKeys);
|
|
@@ -10381,6 +11349,10 @@ class DrawWindow extends CommandFlowComponent {
|
|
|
10381
11349
|
width: len,
|
|
10382
11350
|
full: Math.abs(len - line2.length()) < 0.01
|
|
10383
11351
|
};
|
|
11352
|
+
ElMessage({
|
|
11353
|
+
message: "绘制完成",
|
|
11354
|
+
type: "success"
|
|
11355
|
+
});
|
|
10384
11356
|
next({ line: line2, doorDataItem });
|
|
10385
11357
|
}
|
|
10386
11358
|
/** 执行完成
|
|
@@ -10926,9 +11898,10 @@ class TwoLineConnectionLine extends CommandFlowComponent {
|
|
|
10926
11898
|
} else if (selectLines.length !== 2) {
|
|
10927
11899
|
ElMessage({ message: "请选择2条线段", type: "warning" });
|
|
10928
11900
|
this.cancel();
|
|
10929
|
-
} else {
|
|
10930
|
-
|
|
10931
|
-
|
|
11901
|
+
} else if (selectLines[0].parallel(selectLines[1]), 45) {
|
|
11902
|
+
ElMessage({ message: "两条线段角度需要小于135度", type: "warning" });
|
|
11903
|
+
this.cancel();
|
|
11904
|
+
} else ;
|
|
10932
11905
|
}
|
|
10933
11906
|
/** 开始
|
|
10934
11907
|
* @param next
|
|
@@ -11279,6 +12252,30 @@ class VerticalReferenceLine extends CommandFlowComponent {
|
|
|
11279
12252
|
this.renderManager.draw();
|
|
11280
12253
|
}
|
|
11281
12254
|
}
|
|
12255
|
+
async function promptNumber(inputValue = 0) {
|
|
12256
|
+
try {
|
|
12257
|
+
inputValue = Number(inputValue.toFixed(2));
|
|
12258
|
+
const promise = ElMessageBox.prompt("请输入需要锁定的长度", void 0, {
|
|
12259
|
+
confirmButtonText: "确认",
|
|
12260
|
+
cancelButtonText: "取消锁定",
|
|
12261
|
+
// showCancelButton: isLock,
|
|
12262
|
+
inputValue: inputValue + "",
|
|
12263
|
+
inputPattern: /^(?:[1-9]\d*(?:\.\d+)?|0\.\d*[1-9]\d*)$/,
|
|
12264
|
+
inputErrorMessage: "请输入长度",
|
|
12265
|
+
showClose: false,
|
|
12266
|
+
closeOnClickModal: false
|
|
12267
|
+
});
|
|
12268
|
+
await nextTick();
|
|
12269
|
+
const list = document.querySelectorAll("div[role='dialog']");
|
|
12270
|
+
const stopPropagation = (e) => e.stopPropagation();
|
|
12271
|
+
list.forEach((el) => ["mousedown", "mousemove"].forEach((k) => el.addEventListener(k, stopPropagation)));
|
|
12272
|
+
const value = await promise;
|
|
12273
|
+
list.forEach((el) => ["mousedown", "mousemove"].forEach((k) => el.removeEventListener(k, stopPropagation)));
|
|
12274
|
+
return Number(value.value);
|
|
12275
|
+
} catch (error) {
|
|
12276
|
+
return null;
|
|
12277
|
+
}
|
|
12278
|
+
}
|
|
11282
12279
|
class PointDrag extends CommandFlowComponent {
|
|
11283
12280
|
static name = "PointDrag";
|
|
11284
12281
|
container = new THREE.Group();
|
|
@@ -11288,7 +12285,7 @@ class PointDrag extends CommandFlowComponent {
|
|
|
11288
12285
|
super.onAddFromParent(parent);
|
|
11289
12286
|
this.editor.container.add(this.container);
|
|
11290
12287
|
this.container.position.z = 1e-3;
|
|
11291
|
-
const commandFlow = this.commandManager.addCommandFlow(this.commandName).add(this.createInterrupt()).add(this.createCursor("crosshair")).add(this.selectPoint.bind(this)).add(this.drag.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this))
|
|
12288
|
+
const commandFlow = this.commandManager.addCommandFlow(this.commandName).add(this.createInterrupt()).add(this.createCursor("crosshair")).add(this.selectPoint.bind(this), { prompt: `请选择需要修改线段的 ${this.formatText("端点")}, ${this.formatText("ESC")} 取消命令` }).add(this.drag.bind(this), { prompt: `${this.formatText("Shift")} 键锁定线段移动方向,${this.formatText("L")} 键输入线段长度` }).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
|
|
11292
12289
|
commandFlow.addEventListener("finally", this.createFinally());
|
|
11293
12290
|
commandFlow.addEventListener("completed", (e) => this.completed(e.data));
|
|
11294
12291
|
this.eventInput.addKeyCombination(this.commandName, this.shortcutKeys);
|
|
@@ -11299,7 +12296,10 @@ class PointDrag extends CommandFlowComponent {
|
|
|
11299
12296
|
* @param next
|
|
11300
12297
|
*/
|
|
11301
12298
|
selectPoint(next) {
|
|
11302
|
-
let currentPoint = null, circle = this.renderer.createCircle(Point.zero(), { color: 16711935 }), currentLine = null;
|
|
12299
|
+
let currentPoint = null, circle = this.renderer.createCircle(Point.zero(), { color: 16711935 }), currentLine = null, lineObj = new Lines([], 15658734);
|
|
12300
|
+
this.container.add(lineObj);
|
|
12301
|
+
lineObj.visible = false;
|
|
12302
|
+
lineObj.position.z = -1e-3;
|
|
11303
12303
|
const eventChange = this.editor.addEventListener("pointerPositionChange", () => {
|
|
11304
12304
|
const { point, line: line2, find, mode } = this.editor.renderManager.adsorption();
|
|
11305
12305
|
this.dispatchEvent({ type: "pointerMove", point });
|
|
@@ -11309,13 +12309,17 @@ class PointDrag extends CommandFlowComponent {
|
|
|
11309
12309
|
currentLine = line2;
|
|
11310
12310
|
currentPoint = point.clone();
|
|
11311
12311
|
this.container.add(circle);
|
|
12312
|
+
lineObj.visible = true;
|
|
12313
|
+
const points = line2.expandToRectangle(0.02, "bothSides").points.map((p) => new THREE.Vector3(p.x, p.y, 0));
|
|
12314
|
+
lineObj.setPoint(...points);
|
|
11312
12315
|
} else {
|
|
11313
12316
|
this.domElement.style.cursor = "no-drop";
|
|
11314
12317
|
currentPoint = null;
|
|
12318
|
+
lineObj.visible = false;
|
|
11315
12319
|
circle.removeFromParent();
|
|
11316
12320
|
}
|
|
11317
12321
|
});
|
|
11318
|
-
this.addEventRecord("selectPointStart").add(eventChange).add(this.eventInput.addEventListener("codeChange", () => {
|
|
12322
|
+
this.addEventRecord("selectPointStart").add(eventChange).add(() => lineObj.removeFromParent()).add(this.eventInput.addEventListener("codeChange", () => {
|
|
11319
12323
|
if (this.eventInput.isKeyDown("mouse_0") && currentPoint) {
|
|
11320
12324
|
this.canceEventRecord("selectPointStart");
|
|
11321
12325
|
circle.material.color.set(65280);
|
|
@@ -11325,6 +12329,7 @@ class PointDrag extends CommandFlowComponent {
|
|
|
11325
12329
|
this.addEventRecord("clear").add(() => {
|
|
11326
12330
|
circle.removeFromParent();
|
|
11327
12331
|
eventChange();
|
|
12332
|
+
lineObj.removeFromParent();
|
|
11328
12333
|
});
|
|
11329
12334
|
}
|
|
11330
12335
|
/** 拖拽点
|
|
@@ -11334,10 +12339,33 @@ class PointDrag extends CommandFlowComponent {
|
|
|
11334
12339
|
*/
|
|
11335
12340
|
drag(next, { point, line: line2 }) {
|
|
11336
12341
|
this.domElement.style.cursor = "crosshair";
|
|
11337
|
-
const mode = line2.start.equal(Point.from(point)) ? "start" : "end", start = mode == "start" ? new THREE.Vector3(line2.end.x, line2.end.y, 0) : new THREE.Vector3(line2.start.x, line2.start.y, 0), end = point.clone(), lines = new Lines([start, end], 16711935), circle = this.renderer.createCircle(Point.zero(), { color: 16711935, size: 10 })
|
|
12342
|
+
const mode = line2.start.equal(Point.from(point)) ? "start" : "end", start = mode == "start" ? new THREE.Vector3(line2.end.x, line2.end.y, 0) : new THREE.Vector3(line2.start.x, line2.start.y, 0), end = point.clone(), lines = new Lines([start, end], 16711935), circle = this.renderer.createCircle(Point.zero(), { color: 16711935, size: 10 }), textObj3D = this.renderer.createText("", new THREE.Vector3(0, 0, 0), {
|
|
12343
|
+
// background: 'rgba(0,0,0,0.5)',
|
|
12344
|
+
padding: "2px",
|
|
12345
|
+
borderRadius: "2px"
|
|
12346
|
+
}, this.container);
|
|
12347
|
+
textObj3D.visible = false;
|
|
12348
|
+
let isLock = false;
|
|
12349
|
+
let lockLen = 0;
|
|
12350
|
+
const setLock = async () => {
|
|
12351
|
+
const value = await promptNumber(start.distanceTo(end));
|
|
12352
|
+
if (value === null) {
|
|
12353
|
+
isLock = false;
|
|
12354
|
+
textObj3D.visible = false;
|
|
12355
|
+
return;
|
|
12356
|
+
}
|
|
12357
|
+
isLock = true;
|
|
12358
|
+
lockLen = value ?? 0;
|
|
12359
|
+
const direct = end.clone().sub(start).normalize();
|
|
12360
|
+
end.copy(start.clone().add(direct.multiplyScalar(lockLen)));
|
|
12361
|
+
lines.setPoint(start, end);
|
|
12362
|
+
textObj3D.visible = true;
|
|
12363
|
+
textObj3D.element.innerHTML = `🔒 ${value?.toFixed(2)} m`;
|
|
12364
|
+
textObj3D.position.copy(start.clone().add(end).multiplyScalar(0.5));
|
|
12365
|
+
};
|
|
11338
12366
|
this.container.add(lines);
|
|
11339
12367
|
this.addEventRecord("clear").add(this.editor.addEventListener("pointerPositionChange", () => {
|
|
11340
|
-
let { point: point2, find } = this.editor.renderManager.adsorption(), cursor = "none";
|
|
12368
|
+
let { point: point2, find } = this.editor.renderManager.adsorption(isLock ? 0 : void 0), cursor = "none";
|
|
11341
12369
|
if (point2) {
|
|
11342
12370
|
this.dispatchEvent({ type: "pointerMove", point: point2 });
|
|
11343
12371
|
if (this.eventInput.isKeyDown("shift")) {
|
|
@@ -11354,15 +12382,25 @@ class PointDrag extends CommandFlowComponent {
|
|
|
11354
12382
|
cursor = "crosshair";
|
|
11355
12383
|
}
|
|
11356
12384
|
end.copy(point2);
|
|
12385
|
+
if (isLock) {
|
|
12386
|
+
const direct = end.clone().sub(start).normalize();
|
|
12387
|
+
end.copy(start.clone().add(direct.multiplyScalar(lockLen)));
|
|
12388
|
+
textObj3D.position.copy(start.clone().add(end).multiplyScalar(0.5));
|
|
12389
|
+
}
|
|
11357
12390
|
lines.setPoint(start, end);
|
|
11358
12391
|
this.domElement.style.cursor = cursor;
|
|
11359
12392
|
}
|
|
11360
12393
|
})).add(this.eventInput.addEventListener("codeChange", () => {
|
|
11361
|
-
if (this.eventInput.
|
|
12394
|
+
if (this.eventInput.isOnlyKeyDown("l")) setLock();
|
|
12395
|
+
else if (this.eventInput.isKeyDown("mouse_0")) {
|
|
11362
12396
|
this.canceEventRecord("selectPointStart");
|
|
11363
12397
|
next({ point: end, oldPoint: mode === "end" ? line2.end.clone() : line2.start.clone(), line: line2, mode });
|
|
12398
|
+
ElMessage({
|
|
12399
|
+
message: "修改完成",
|
|
12400
|
+
type: "success"
|
|
12401
|
+
});
|
|
11364
12402
|
}
|
|
11365
|
-
})).add(() => circle.removeFromParent()).add(() => lines.removeFromParent());
|
|
12403
|
+
})).add(() => circle.removeFromParent()).add(() => lines.removeFromParent()).add(() => textObj3D.removeFromParent());
|
|
11366
12404
|
}
|
|
11367
12405
|
/** 执行完成
|
|
11368
12406
|
*/
|
|
@@ -11371,6 +12409,7 @@ class PointDrag extends CommandFlowComponent {
|
|
|
11371
12409
|
this.renderManager.removeLine(line2);
|
|
11372
12410
|
if (mode === "end") line2.end.set(point.x, point.y);
|
|
11373
12411
|
else if (mode === "start") line2.start.set(point.x, point.y);
|
|
12412
|
+
recomputedWindow(line2);
|
|
11374
12413
|
this.renderManager.addLine(line2);
|
|
11375
12414
|
this.renderManager.draw();
|
|
11376
12415
|
}
|
|
@@ -11381,6 +12420,7 @@ class PointDrag extends CommandFlowComponent {
|
|
|
11381
12420
|
const { line: line2, oldPoint, mode } = data;
|
|
11382
12421
|
if (mode === "end") line2.end.set(oldPoint.x, oldPoint.y);
|
|
11383
12422
|
else if (mode === "start") line2.start.set(oldPoint.x, oldPoint.y);
|
|
12423
|
+
recomputedWindow(line2);
|
|
11384
12424
|
this.renderManager.addLine(line2);
|
|
11385
12425
|
this.renderManager.draw();
|
|
11386
12426
|
return data;
|
|
@@ -11489,6 +12529,7 @@ const _hoisted_11 = {
|
|
|
11489
12529
|
const _hoisted_12 = { class: "flex-wrap border-t-1 border-t-[#eee] mt-[5px] pt-[5px] flex items-center gap-[10px]" };
|
|
11490
12530
|
const _hoisted_13 = ["onClick", "title"];
|
|
11491
12531
|
const _hoisted_14 = ["src"];
|
|
12532
|
+
const _hoisted_15 = ["innerHTML"];
|
|
11492
12533
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
11493
12534
|
__name: "EditorTool",
|
|
11494
12535
|
props: {
|
|
@@ -11584,7 +12625,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
11584
12625
|
},
|
|
11585
12626
|
{
|
|
11586
12627
|
command: "point",
|
|
11587
|
-
name: "
|
|
12628
|
+
name: "线段端点修改",
|
|
11588
12629
|
show: true,
|
|
11589
12630
|
src: images["./assets/images/selectPoint.svg"].default,
|
|
11590
12631
|
shortcut: PointDrag.shortcutKeys.join(" + ")
|
|
@@ -11686,7 +12727,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
11686
12727
|
editor.commandManager.start(DeleteSelectLine.commandName, defaultComponent.getSelectData());
|
|
11687
12728
|
}
|
|
11688
12729
|
}
|
|
11689
|
-
], z = ref(0);
|
|
12730
|
+
], z = ref(0), promptMessage = ref();
|
|
11690
12731
|
watch(toolBarPosition, () => localStorage.setItem("editorToolPosition", JSON.stringify(toolBarPosition.value)));
|
|
11691
12732
|
watch(toolBarExpand, () => {
|
|
11692
12733
|
localStorage.setItem("toolBarExpand", toolBarExpand.value + "");
|
|
@@ -11746,6 +12787,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
11746
12787
|
});
|
|
11747
12788
|
});
|
|
11748
12789
|
});
|
|
12790
|
+
editor.commandManager.addEventListener("executing", (e) => {
|
|
12791
|
+
const commandFlow = editor.commandManager.getCommandFlow(e.name);
|
|
12792
|
+
const data = commandFlow.getData(commandFlow.currentIndex);
|
|
12793
|
+
promptMessage.value = data.prompt;
|
|
12794
|
+
});
|
|
11749
12795
|
if (localStorage.getItem("dxfVisible")) {
|
|
11750
12796
|
dxfVisible.value = localStorage.getItem("dxfVisible") == "true";
|
|
11751
12797
|
}
|
|
@@ -11756,251 +12802,258 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
11756
12802
|
resizeObserver.disconnect();
|
|
11757
12803
|
});
|
|
11758
12804
|
return (_ctx, _cache) => {
|
|
11759
|
-
return openBlock(), createElementBlock(
|
|
11760
|
-
ref_key: "elRef",
|
|
11761
|
-
ref: elRef,
|
|
11762
|
-
class: "editorTool pointer-events-none overflow-hidden absolute left-0 top-0 w-full h-full z-[20] flex flex-row justify-between p-[5px] box-border select-none pointer-events-[all]"
|
|
11763
|
-
}, [
|
|
12805
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
11764
12806
|
createElementVNode("div", {
|
|
11765
|
-
ref_key: "
|
|
11766
|
-
ref:
|
|
11767
|
-
|
|
11768
|
-
class: normalizeClass(["overflow-hidden pointer-events-auto w-fit max-w-[260px] transition-[border-radius] text-[#333] absolute z-[11] bg-white select-none", { "rounded-[8px] ": toolBarExpand.value }]),
|
|
11769
|
-
onMousedown: _cache[10] || (_cache[10] = (e) => e.stopPropagation())
|
|
12807
|
+
ref_key: "elRef",
|
|
12808
|
+
ref: elRef,
|
|
12809
|
+
class: "editorTool pointer-events-none overflow-hidden absolute left-0 top-0 w-full h-full z-[20] flex flex-row justify-between p-[5px] box-border select-none pointer-events-[all]"
|
|
11770
12810
|
}, [
|
|
11771
12811
|
createElementVNode("div", {
|
|
11772
|
-
|
|
11773
|
-
|
|
12812
|
+
ref_key: "toolBarRef",
|
|
12813
|
+
ref: toolBarRef,
|
|
12814
|
+
style: normalizeStyle({ left: toolBarPosition.value.left + "px", top: toolBarPosition.value.top + "px" }),
|
|
12815
|
+
class: normalizeClass(["overflow-hidden pointer-events-auto w-fit max-w-[260px] transition-[border-radius] text-[#333] absolute z-[11] bg-white select-none", { "rounded-[8px] ": toolBarExpand.value }]),
|
|
12816
|
+
onMousedown: _cache[10] || (_cache[10] = (e) => e.stopPropagation())
|
|
11774
12817
|
}, [
|
|
11775
|
-
_cache[12] || (_cache[12] = createStaticVNode('<div class="flex flex-row" data-v-adaee1e3><div class="p-[2px_5px] flex items-center pointer-events-none" data-v-adaee1e3><svg fill="#aaa" width="20" height="20" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" data-v-adaee1e3><path d="M341.333333 298.666667a85.333333 85.333333 0 1 0 0-170.666667 85.333333 85.333333 0 0 0 0 170.666667z m0 298.666666a85.333333 85.333333 0 1 0 0-170.666666 85.333333 85.333333 0 0 0 0 170.666666z m85.333334 213.333334a85.333333 85.333333 0 1 1-170.666667 0 85.333333 85.333333 0 0 1 170.666667 0z m256-512a85.333333 85.333333 0 1 0 0-170.666667 85.333333 85.333333 0 0 0 0 170.666667z m85.333333 213.333333a85.333333 85.333333 0 1 1-170.666667 0 85.333333 85.333333 0 0 1 170.666667 0z m-85.333333 384a85.333333 85.333333 0 1 0 0-170.666667 85.333333 85.333333 0 0 0 0 170.666667z" data-v-adaee1e3></path></svg></div><h5 class="flex text-nowrap text-[12px] items-center pointer-events-none" data-v-adaee1e3>绘制工具</h5></div>', 1)),
|
|
11776
12818
|
createElementVNode("div", {
|
|
11777
|
-
onMousedown:
|
|
11778
|
-
|
|
11779
|
-
class: "cursor-pointer flex items-center p-[0px_5px]"
|
|
12819
|
+
onMousedown: dragMoveHelper,
|
|
12820
|
+
class: normalizeClass([{ "border-b-[#eee] border-b-1": toolBarExpand.value }, "flex flex-row justify-between header text-[14px] font-bold p-[10px 0px]"])
|
|
11780
12821
|
}, [
|
|
11781
|
-
(
|
|
11782
|
-
|
|
11783
|
-
|
|
11784
|
-
|
|
11785
|
-
|
|
11786
|
-
|
|
11787
|
-
|
|
11788
|
-
|
|
11789
|
-
|
|
11790
|
-
|
|
11791
|
-
|
|
11792
|
-
|
|
11793
|
-
|
|
11794
|
-
|
|
11795
|
-
|
|
11796
|
-
|
|
11797
|
-
|
|
11798
|
-
|
|
11799
|
-
|
|
11800
|
-
|
|
11801
|
-
|
|
11802
|
-
|
|
11803
|
-
|
|
11804
|
-
|
|
11805
|
-
// '!cursor-no-drop': currentCommand !== item.command && currentCommand !== 'default',
|
|
11806
|
-
}, "gap-[10px] text-[12px] hover:bg-[#ddd] transition-all rounded-[6px] p-[5px] flex flex-row items-center justify-between cursor-pointer"])
|
|
12822
|
+
_cache[12] || (_cache[12] = createStaticVNode('<div class="flex flex-row" data-v-492c138f><div class="p-[2px_5px] flex items-center pointer-events-none" data-v-492c138f><svg fill="#aaa" width="20" height="20" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" data-v-492c138f><path d="M341.333333 298.666667a85.333333 85.333333 0 1 0 0-170.666667 85.333333 85.333333 0 0 0 0 170.666667z m0 298.666666a85.333333 85.333333 0 1 0 0-170.666666 85.333333 85.333333 0 0 0 0 170.666666z m85.333334 213.333334a85.333333 85.333333 0 1 1-170.666667 0 85.333333 85.333333 0 0 1 170.666667 0z m256-512a85.333333 85.333333 0 1 0 0-170.666667 85.333333 85.333333 0 0 0 0 170.666667z m85.333333 213.333333a85.333333 85.333333 0 1 1-170.666667 0 85.333333 85.333333 0 0 1 170.666667 0z m-85.333333 384a85.333333 85.333333 0 1 0 0-170.666667 85.333333 85.333333 0 0 0 0 170.666667z" data-v-492c138f></path></svg></div><h5 class="flex text-nowrap text-[12px] items-center pointer-events-none" data-v-492c138f>绘制工具</h5></div>', 1)),
|
|
12823
|
+
createElementVNode("div", {
|
|
12824
|
+
onMousedown: _cache[0] || (_cache[0] = (e) => e.stopPropagation()),
|
|
12825
|
+
onClick: _cache[1] || (_cache[1] = ($event) => toolBarExpand.value = !toolBarExpand.value),
|
|
12826
|
+
class: "cursor-pointer flex items-center p-[0px_5px]"
|
|
12827
|
+
}, [
|
|
12828
|
+
(openBlock(), createElementBlock("svg", {
|
|
12829
|
+
fill: "#666",
|
|
12830
|
+
class: normalizeClass([{ "rotate-90": toolBarExpand.value }, "transition-all"]),
|
|
12831
|
+
viewBox: "0 0 1024 1024",
|
|
12832
|
+
version: "1.1",
|
|
12833
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
12834
|
+
width: "12",
|
|
12835
|
+
height: "12"
|
|
12836
|
+
}, _cache[11] || (_cache[11] = [
|
|
12837
|
+
createElementVNode("path", { d: "M315.050667 938.666667a60.757333 60.757333 0 0 0 41.813333-16.298667L750.933333 551.338667a53.418667 53.418667 0 0 0 0-78.677334L356.864 101.632a61.696 61.696 0 0 0-83.541333 0 53.418667 53.418667 0 0 0-0.256 78.677333L625.408 512 273.066667 843.690667a53.418667 53.418667 0 0 0 0 78.677333 60.757333 60.757333 0 0 0 41.984 16.298667z" }, null, -1)
|
|
12838
|
+
]), 2))
|
|
12839
|
+
], 32)
|
|
12840
|
+
], 34),
|
|
12841
|
+
toolBarExpand.value ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
12842
|
+
createElementVNode("ul", _hoisted_2, [
|
|
12843
|
+
(openBlock(), createElementBlock(Fragment, null, renderList(commandList, (item) => {
|
|
12844
|
+
return openBlock(), createElementBlock(Fragment, {
|
|
12845
|
+
key: item.command
|
|
11807
12846
|
}, [
|
|
11808
|
-
|
|
11809
|
-
|
|
11810
|
-
|
|
11811
|
-
|
|
11812
|
-
|
|
11813
|
-
|
|
11814
|
-
|
|
11815
|
-
|
|
12847
|
+
item.show ? (openBlock(), createElementBlock("li", {
|
|
12848
|
+
key: 0,
|
|
12849
|
+
onClick: ($event) => startCurrentCommandItem(item),
|
|
12850
|
+
class: normalizeClass([{
|
|
12851
|
+
"!bg-[var(--primary-color)] text-[#fff]": currentCommand.value === item.command
|
|
12852
|
+
// '!cursor-no-drop': currentCommand !== item.command && currentCommand !== 'default',
|
|
12853
|
+
}, "gap-[10px] text-[12px] hover:bg-[#ddd] transition-all rounded-[6px] p-[5px] flex flex-row items-center justify-between cursor-pointer"])
|
|
12854
|
+
}, [
|
|
12855
|
+
createElementVNode("div", _hoisted_4, [
|
|
12856
|
+
createElementVNode("div", _hoisted_5, [
|
|
12857
|
+
createElementVNode("img", {
|
|
12858
|
+
class: "size-[14px]",
|
|
12859
|
+
src: item.src,
|
|
12860
|
+
alt: "",
|
|
12861
|
+
srcset: ""
|
|
12862
|
+
}, null, 8, _hoisted_6)
|
|
12863
|
+
]),
|
|
12864
|
+
createElementVNode("span", _hoisted_7, toDisplayString(item.name), 1)
|
|
11816
12865
|
]),
|
|
11817
|
-
|
|
11818
|
-
|
|
11819
|
-
|
|
11820
|
-
|
|
11821
|
-
|
|
11822
|
-
|
|
11823
|
-
|
|
11824
|
-
|
|
11825
|
-
|
|
11826
|
-
|
|
11827
|
-
|
|
11828
|
-
|
|
11829
|
-
|
|
11830
|
-
|
|
11831
|
-
|
|
11832
|
-
|
|
11833
|
-
|
|
11834
|
-
|
|
11835
|
-
|
|
12866
|
+
currentCommand.value === item.command ? (openBlock(), createElementBlock("div", _hoisted_8, [
|
|
12867
|
+
createElementVNode("div", {
|
|
12868
|
+
title: "取消命令(Esc)",
|
|
12869
|
+
class: "active:scale-[0.7] transition-all flex items-center justify-center",
|
|
12870
|
+
onClick: _cache[2] || (_cache[2] = (e) => (unref(editor).cancelCommand(), e.stopPropagation()))
|
|
12871
|
+
}, _cache[13] || (_cache[13] = [
|
|
12872
|
+
createElementVNode("svg", {
|
|
12873
|
+
fill: "#fff",
|
|
12874
|
+
width: "16",
|
|
12875
|
+
height: "16",
|
|
12876
|
+
viewBox: "0 0 1024 1024",
|
|
12877
|
+
version: "1.1",
|
|
12878
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
12879
|
+
}, [
|
|
12880
|
+
createElementVNode("path", { d: "M511.104 0C228.821333 0 0 228.821333 0 511.104c0 282.282667 228.821333 511.104 511.104 511.104 282.282667 0 511.104-228.842667 511.104-511.104C1022.208 228.821333 793.386667 0 511.104 0zM511.104 898.496c-213.973333 0-387.434667-173.44-387.434667-387.413333 0-213.952 173.44-387.413333 387.434667-387.413333 213.952 0 387.392 173.44 387.392 387.413333C898.496 725.056 725.056 898.496 511.104 898.496z" }),
|
|
12881
|
+
createElementVNode("path", { d: "M236.437333 463.914667l549.333333 0 0 96.874667-549.333333 0 0-96.874667Z" })
|
|
12882
|
+
], -1)
|
|
12883
|
+
])),
|
|
12884
|
+
item.confirm?.value ? (openBlock(), createElementBlock("div", {
|
|
12885
|
+
key: 0,
|
|
12886
|
+
onClick: commandConfirm,
|
|
12887
|
+
title: "确认命令(Enter)",
|
|
12888
|
+
class: "active:scale-[0.7] transition-all flex items-center justify-center"
|
|
12889
|
+
}, _cache[14] || (_cache[14] = [
|
|
12890
|
+
createElementVNode("svg", {
|
|
12891
|
+
fill: "#fff",
|
|
12892
|
+
width: "16",
|
|
12893
|
+
height: "16",
|
|
12894
|
+
viewBox: "0 0 1024 1024",
|
|
12895
|
+
version: "1.1",
|
|
12896
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
12897
|
+
}, [
|
|
12898
|
+
createElementVNode("path", { d: "M512 1024c-281.6 0-512-230.4-512-512s230.4-512 512-512 512 230.4 512 512-230.4 512-512 512zM512 128C300.8 128 128 300.8 128 512s172.8 384 384 384 384-172.8 384-384-172.8-384-384-384z m-12.8 556.8c-12.8 12.8-32 19.2-51.2 19.2-19.2 0-38.4-6.4-51.2-19.2L275.2 569.6c-25.6-25.6-25.6-70.4 0-96 25.6-25.6 70.4-25.6 96 0L448 544l198.4-204.8c25.6-25.6 70.4-25.6 96 0 25.6 25.6 25.6 70.4 0 96l-243.2 249.6z" })
|
|
12899
|
+
], -1)
|
|
12900
|
+
]))) : createCommentVNode("", true)
|
|
12901
|
+
])) : item.shortcut ? (openBlock(), createElementBlock("div", _hoisted_9, toDisplayString(item.shortcut), 1)) : createCommentVNode("", true)
|
|
12902
|
+
], 10, _hoisted_3)) : createCommentVNode("", true)
|
|
12903
|
+
], 64);
|
|
12904
|
+
}), 64))
|
|
12905
|
+
]),
|
|
12906
|
+
createElementVNode("div", _hoisted_10, [
|
|
12907
|
+
createVNode(unref(ElCheckbox), {
|
|
12908
|
+
size: "small",
|
|
12909
|
+
modelValue: dxfVisible.value,
|
|
12910
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => dxfVisible.value = $event)
|
|
12911
|
+
}, {
|
|
12912
|
+
default: withCtx(() => _cache[15] || (_cache[15] = [
|
|
12913
|
+
createTextVNode("Dxf", -1)
|
|
12914
|
+
])),
|
|
12915
|
+
_: 1,
|
|
12916
|
+
__: [15]
|
|
12917
|
+
}, 8, ["modelValue"])
|
|
12918
|
+
]),
|
|
12919
|
+
_ctx.permission === "admin" ? (openBlock(), createElementBlock("div", _hoisted_11, [
|
|
12920
|
+
createVNode(unref(ElButton), {
|
|
12921
|
+
style: { "padding": "5px", "font-size": "10px" },
|
|
12922
|
+
size: "small",
|
|
12923
|
+
type: "success",
|
|
12924
|
+
onClick: selectLocalFile
|
|
12925
|
+
}, {
|
|
12926
|
+
default: withCtx(() => _cache[16] || (_cache[16] = [
|
|
12927
|
+
createTextVNode(" 选择文件 ", -1)
|
|
12928
|
+
])),
|
|
12929
|
+
_: 1,
|
|
12930
|
+
__: [16]
|
|
12931
|
+
}),
|
|
12932
|
+
createVNode(unref(ElButton), {
|
|
12933
|
+
style: { "padding": "5px", "font-size": "10px" },
|
|
12934
|
+
size: "small",
|
|
12935
|
+
type: "primary",
|
|
12936
|
+
onClick: _cache[4] || (_cache[4] = ($event) => unref(dxfSystem).CorrectionDxf.downloadOriginalData("json.json"))
|
|
12937
|
+
}, {
|
|
12938
|
+
default: withCtx(() => _cache[17] || (_cache[17] = [
|
|
12939
|
+
createTextVNode(" 下载Json ", -1)
|
|
12940
|
+
])),
|
|
12941
|
+
_: 1,
|
|
12942
|
+
__: [17]
|
|
12943
|
+
}),
|
|
12944
|
+
createVNode(unref(ElButton), {
|
|
12945
|
+
style: { "padding": "5px", "font-size": "10px" },
|
|
12946
|
+
size: "small",
|
|
12947
|
+
type: "primary",
|
|
12948
|
+
onClick: _cache[5] || (_cache[5] = ($event) => unref(dxfSystem).CorrectionDxf.downloadDxf("test.dxf"))
|
|
12949
|
+
}, {
|
|
12950
|
+
default: withCtx(() => _cache[18] || (_cache[18] = [
|
|
12951
|
+
createTextVNode(" 下载DXF ", -1)
|
|
12952
|
+
])),
|
|
12953
|
+
_: 1,
|
|
12954
|
+
__: [18]
|
|
12955
|
+
}),
|
|
12956
|
+
createVNode(unref(ElButton), {
|
|
12957
|
+
style: { "padding": "5px", "font-size": "10px" },
|
|
12958
|
+
size: "small",
|
|
12959
|
+
type: "primary",
|
|
12960
|
+
onClick: _cache[6] || (_cache[6] = ($event) => unref(dxfSystem).CorrectionDxf.downloadDxfImage("dxf.jpg"))
|
|
12961
|
+
}, {
|
|
12962
|
+
default: withCtx(() => _cache[19] || (_cache[19] = [
|
|
12963
|
+
createTextVNode(" 下载JPG ", -1)
|
|
12964
|
+
])),
|
|
12965
|
+
_: 1,
|
|
12966
|
+
__: [19]
|
|
12967
|
+
}),
|
|
12968
|
+
createVNode(unref(ElButton), {
|
|
12969
|
+
style: { "padding": "5px", "font-size": "10px" },
|
|
12970
|
+
size: "small",
|
|
12971
|
+
type: "primary",
|
|
12972
|
+
onClick: _cache[7] || (_cache[7] = ($event) => unref(whiteModel).downloadGltf("test.glb", true))
|
|
12973
|
+
}, {
|
|
12974
|
+
default: withCtx(() => _cache[20] || (_cache[20] = [
|
|
12975
|
+
createTextVNode(" 下载白膜 ", -1)
|
|
12976
|
+
])),
|
|
12977
|
+
_: 1,
|
|
12978
|
+
__: [20]
|
|
12979
|
+
}),
|
|
12980
|
+
createVNode(unref(ElButton), {
|
|
12981
|
+
style: { "padding": "5px", "font-size": "10px" },
|
|
12982
|
+
size: "small",
|
|
12983
|
+
type: "primary",
|
|
12984
|
+
onClick: _cache[8] || (_cache[8] = ($event) => unref(threeVJia).download())
|
|
12985
|
+
}, {
|
|
12986
|
+
default: withCtx(() => _cache[21] || (_cache[21] = [
|
|
12987
|
+
createTextVNode(" 下载三维家JSON ", -1)
|
|
12988
|
+
])),
|
|
12989
|
+
_: 1,
|
|
12990
|
+
__: [21]
|
|
12991
|
+
}),
|
|
12992
|
+
createVNode(unref(ElDropdown), {
|
|
12993
|
+
class: "ml-[5px]",
|
|
12994
|
+
trigger: "click"
|
|
12995
|
+
}, {
|
|
12996
|
+
dropdown: withCtx(() => [
|
|
12997
|
+
createVNode(unref(ElInput), {
|
|
12998
|
+
modelValue: z.value,
|
|
12999
|
+
"onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => z.value = $event),
|
|
13000
|
+
placeholder: "z",
|
|
13001
|
+
type: "number"
|
|
13002
|
+
}, null, 8, ["modelValue"])
|
|
13003
|
+
]),
|
|
13004
|
+
default: withCtx(() => [
|
|
13005
|
+
createVNode(unref(ElButton), {
|
|
13006
|
+
style: { "padding": "5px", "font-size": "10px" },
|
|
13007
|
+
size: "small",
|
|
13008
|
+
type: "primary"
|
|
13009
|
+
}, {
|
|
13010
|
+
default: withCtx(() => _cache[22] || (_cache[22] = [
|
|
13011
|
+
createTextVNode(" z值调整 ", -1)
|
|
11836
13012
|
])),
|
|
11837
|
-
|
|
11838
|
-
|
|
11839
|
-
|
|
11840
|
-
|
|
11841
|
-
|
|
11842
|
-
|
|
11843
|
-
|
|
11844
|
-
|
|
11845
|
-
width: "16",
|
|
11846
|
-
height: "16",
|
|
11847
|
-
viewBox: "0 0 1024 1024",
|
|
11848
|
-
version: "1.1",
|
|
11849
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
11850
|
-
}, [
|
|
11851
|
-
createElementVNode("path", { d: "M512 1024c-281.6 0-512-230.4-512-512s230.4-512 512-512 512 230.4 512 512-230.4 512-512 512zM512 128C300.8 128 128 300.8 128 512s172.8 384 384 384 384-172.8 384-384-172.8-384-384-384z m-12.8 556.8c-12.8 12.8-32 19.2-51.2 19.2-19.2 0-38.4-6.4-51.2-19.2L275.2 569.6c-25.6-25.6-25.6-70.4 0-96 25.6-25.6 70.4-25.6 96 0L448 544l198.4-204.8c25.6-25.6 70.4-25.6 96 0 25.6 25.6 25.6 70.4 0 96l-243.2 249.6z" })
|
|
11852
|
-
], -1)
|
|
11853
|
-
]))) : createCommentVNode("", true)
|
|
11854
|
-
])) : item.shortcut ? (openBlock(), createElementBlock("div", _hoisted_9, toDisplayString(item.shortcut), 1)) : createCommentVNode("", true)
|
|
11855
|
-
], 10, _hoisted_3)) : createCommentVNode("", true)
|
|
11856
|
-
], 64);
|
|
11857
|
-
}), 64))
|
|
11858
|
-
]),
|
|
11859
|
-
createElementVNode("div", _hoisted_10, [
|
|
11860
|
-
createVNode(unref(ElCheckbox), {
|
|
11861
|
-
size: "small",
|
|
11862
|
-
modelValue: dxfVisible.value,
|
|
11863
|
-
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => dxfVisible.value = $event)
|
|
11864
|
-
}, {
|
|
11865
|
-
default: withCtx(() => _cache[15] || (_cache[15] = [
|
|
11866
|
-
createTextVNode("Dxf", -1)
|
|
11867
|
-
])),
|
|
11868
|
-
_: 1,
|
|
11869
|
-
__: [15]
|
|
11870
|
-
}, 8, ["modelValue"])
|
|
11871
|
-
]),
|
|
11872
|
-
_ctx.permission === "admin" ? (openBlock(), createElementBlock("div", _hoisted_11, [
|
|
11873
|
-
createVNode(unref(ElButton), {
|
|
11874
|
-
style: { "padding": "5px", "font-size": "10px" },
|
|
11875
|
-
size: "small",
|
|
11876
|
-
type: "success",
|
|
11877
|
-
onClick: selectLocalFile
|
|
11878
|
-
}, {
|
|
11879
|
-
default: withCtx(() => _cache[16] || (_cache[16] = [
|
|
11880
|
-
createTextVNode(" 选择文件 ", -1)
|
|
11881
|
-
])),
|
|
11882
|
-
_: 1,
|
|
11883
|
-
__: [16]
|
|
11884
|
-
}),
|
|
11885
|
-
createVNode(unref(ElButton), {
|
|
11886
|
-
style: { "padding": "5px", "font-size": "10px" },
|
|
11887
|
-
size: "small",
|
|
11888
|
-
type: "primary",
|
|
11889
|
-
onClick: _cache[4] || (_cache[4] = ($event) => unref(dxfSystem).CorrectionDxf.downloadOriginalData("json.json"))
|
|
11890
|
-
}, {
|
|
11891
|
-
default: withCtx(() => _cache[17] || (_cache[17] = [
|
|
11892
|
-
createTextVNode(" 下载Json ", -1)
|
|
11893
|
-
])),
|
|
11894
|
-
_: 1,
|
|
11895
|
-
__: [17]
|
|
11896
|
-
}),
|
|
11897
|
-
createVNode(unref(ElButton), {
|
|
11898
|
-
style: { "padding": "5px", "font-size": "10px" },
|
|
11899
|
-
size: "small",
|
|
11900
|
-
type: "primary",
|
|
11901
|
-
onClick: _cache[5] || (_cache[5] = ($event) => unref(dxfSystem).CorrectionDxf.downloadDxf("test.dxf"))
|
|
11902
|
-
}, {
|
|
11903
|
-
default: withCtx(() => _cache[18] || (_cache[18] = [
|
|
11904
|
-
createTextVNode(" 下载DXF ", -1)
|
|
11905
|
-
])),
|
|
11906
|
-
_: 1,
|
|
11907
|
-
__: [18]
|
|
11908
|
-
}),
|
|
11909
|
-
createVNode(unref(ElButton), {
|
|
11910
|
-
style: { "padding": "5px", "font-size": "10px" },
|
|
11911
|
-
size: "small",
|
|
11912
|
-
type: "primary",
|
|
11913
|
-
onClick: _cache[6] || (_cache[6] = ($event) => unref(dxfSystem).CorrectionDxf.downloadDxfImage("dxf.jpg"))
|
|
11914
|
-
}, {
|
|
11915
|
-
default: withCtx(() => _cache[19] || (_cache[19] = [
|
|
11916
|
-
createTextVNode(" 下载JPG ", -1)
|
|
11917
|
-
])),
|
|
11918
|
-
_: 1,
|
|
11919
|
-
__: [19]
|
|
11920
|
-
}),
|
|
11921
|
-
createVNode(unref(ElButton), {
|
|
11922
|
-
style: { "padding": "5px", "font-size": "10px" },
|
|
11923
|
-
size: "small",
|
|
11924
|
-
type: "primary",
|
|
11925
|
-
onClick: _cache[7] || (_cache[7] = ($event) => unref(whiteModel).downloadGltf("test.glb", true))
|
|
11926
|
-
}, {
|
|
11927
|
-
default: withCtx(() => _cache[20] || (_cache[20] = [
|
|
11928
|
-
createTextVNode(" 下载白膜 ", -1)
|
|
11929
|
-
])),
|
|
11930
|
-
_: 1,
|
|
11931
|
-
__: [20]
|
|
11932
|
-
}),
|
|
11933
|
-
createVNode(unref(ElButton), {
|
|
11934
|
-
style: { "padding": "5px", "font-size": "10px" },
|
|
11935
|
-
size: "small",
|
|
11936
|
-
type: "primary",
|
|
11937
|
-
onClick: _cache[8] || (_cache[8] = ($event) => unref(threeVJia).download())
|
|
11938
|
-
}, {
|
|
11939
|
-
default: withCtx(() => _cache[21] || (_cache[21] = [
|
|
11940
|
-
createTextVNode(" 下载三维家JSON ", -1)
|
|
11941
|
-
])),
|
|
11942
|
-
_: 1,
|
|
11943
|
-
__: [21]
|
|
11944
|
-
}),
|
|
11945
|
-
createVNode(unref(ElDropdown), {
|
|
11946
|
-
class: "ml-[5px]",
|
|
11947
|
-
trigger: "click"
|
|
11948
|
-
}, {
|
|
11949
|
-
dropdown: withCtx(() => [
|
|
11950
|
-
createVNode(unref(ElInput), {
|
|
11951
|
-
modelValue: z.value,
|
|
11952
|
-
"onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => z.value = $event),
|
|
11953
|
-
placeholder: "z",
|
|
11954
|
-
type: "number"
|
|
11955
|
-
}, null, 8, ["modelValue"])
|
|
11956
|
-
]),
|
|
13013
|
+
_: 1,
|
|
13014
|
+
__: [22]
|
|
13015
|
+
})
|
|
13016
|
+
]),
|
|
13017
|
+
_: 1
|
|
13018
|
+
})
|
|
13019
|
+
])) : createCommentVNode("", true),
|
|
13020
|
+
createVNode(Transition, null, {
|
|
11957
13021
|
default: withCtx(() => [
|
|
11958
|
-
|
|
11959
|
-
|
|
11960
|
-
|
|
11961
|
-
|
|
11962
|
-
|
|
11963
|
-
|
|
11964
|
-
|
|
11965
|
-
|
|
11966
|
-
|
|
11967
|
-
|
|
11968
|
-
|
|
13022
|
+
createElementVNode("div", _hoisted_12, [
|
|
13023
|
+
createVNode(TransitionGroup, null, {
|
|
13024
|
+
default: withCtx(() => [
|
|
13025
|
+
(openBlock(), createElementBlock(Fragment, null, renderList(otherCommandList, (item) => {
|
|
13026
|
+
return createElementVNode("div", {
|
|
13027
|
+
onClick: ($event) => item.show.value && currentCommand.value === "default" && (item.action ? item.action() : unref(editor).commandManager.start(item.command, [...unref(defaultComponent).selectLines])),
|
|
13028
|
+
title: `${item.name}(${item.shortcut})`,
|
|
13029
|
+
class: normalizeClass(["size-[20px] flex justify-center items-center relative overflow-hidden active:scale-[0.8] border-1 border-[#ccc] rounded-[4px] transition-all cursor-pointer", {
|
|
13030
|
+
"opacity-30 bg-[#ccc] !cursor-no-drop active:!scale-[1]": !item.show.value || currentCommand.value !== "default",
|
|
13031
|
+
[item.class ?? ""]: true
|
|
13032
|
+
}]),
|
|
13033
|
+
key: item.command
|
|
13034
|
+
}, [
|
|
13035
|
+
createElementVNode("img", {
|
|
13036
|
+
class: "size-[14px]",
|
|
13037
|
+
src: item.src
|
|
13038
|
+
}, null, 8, _hoisted_14)
|
|
13039
|
+
], 10, _hoisted_13);
|
|
13040
|
+
}), 64))
|
|
13041
|
+
]),
|
|
13042
|
+
_: 1
|
|
13043
|
+
})
|
|
13044
|
+
])
|
|
11969
13045
|
]),
|
|
11970
13046
|
_: 1
|
|
11971
13047
|
})
|
|
11972
|
-
])) : createCommentVNode("", true)
|
|
11973
|
-
|
|
11974
|
-
|
|
11975
|
-
|
|
11976
|
-
|
|
11977
|
-
|
|
11978
|
-
|
|
11979
|
-
|
|
11980
|
-
|
|
11981
|
-
title: `${item.name}(${item.shortcut})`,
|
|
11982
|
-
class: normalizeClass(["size-[20px] flex justify-center items-center relative overflow-hidden active:scale-[0.8] border-1 border-[#ccc] rounded-[4px] transition-all cursor-pointer", {
|
|
11983
|
-
"opacity-30 bg-[#ccc] !cursor-no-drop active:!scale-[1]": !item.show.value || currentCommand.value !== "default",
|
|
11984
|
-
[item.class ?? ""]: true
|
|
11985
|
-
}]),
|
|
11986
|
-
key: item.command
|
|
11987
|
-
}, [
|
|
11988
|
-
createElementVNode("img", {
|
|
11989
|
-
class: "size-[14px]",
|
|
11990
|
-
src: item.src
|
|
11991
|
-
}, null, 8, _hoisted_14)
|
|
11992
|
-
], 10, _hoisted_13);
|
|
11993
|
-
}), 64))
|
|
11994
|
-
]),
|
|
11995
|
-
_: 1
|
|
11996
|
-
})
|
|
11997
|
-
])
|
|
11998
|
-
]),
|
|
11999
|
-
_: 1
|
|
12000
|
-
})
|
|
12001
|
-
])) : createCommentVNode("", true)
|
|
12002
|
-
], 38)
|
|
12003
|
-
], 512);
|
|
13048
|
+
])) : createCommentVNode("", true)
|
|
13049
|
+
], 38)
|
|
13050
|
+
], 512),
|
|
13051
|
+
promptMessage.value ? (openBlock(), createElementBlock("div", {
|
|
13052
|
+
key: 0,
|
|
13053
|
+
innerHTML: promptMessage.value,
|
|
13054
|
+
class: "text-[#fff] pointer-events-none z-100 text-[12px] absolute left-[20px] bottom-[20px] rounded-[8px] min-w-[150px] bg-white/15 p-[10px]"
|
|
13055
|
+
}, null, 8, _hoisted_15)) : createCommentVNode("", true)
|
|
13056
|
+
], 64);
|
|
12004
13057
|
};
|
|
12005
13058
|
}
|
|
12006
13059
|
});
|
|
@@ -12011,7 +13064,7 @@ const _export_sfc = (sfc, props) => {
|
|
|
12011
13064
|
}
|
|
12012
13065
|
return target;
|
|
12013
13066
|
};
|
|
12014
|
-
const EditorTool = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
13067
|
+
const EditorTool = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-492c138f"]]);
|
|
12015
13068
|
class Editor extends Component {
|
|
12016
13069
|
static name = "Editor";
|
|
12017
13070
|
container = new THREE.Group();
|