@fangzhongya/fang-ui 0.1.55 → 0.1.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/audios/src/index2.cjs +16 -10
- package/dist/components/audios/src/index2.js +16 -10
- package/dist/components/box-adjust/src/index2.cjs +6 -4
- package/dist/components/box-adjust/src/index2.js +6 -4
- package/dist/components/box-title/src/index2.cjs +3 -2
- package/dist/components/box-title/src/index2.js +3 -2
- package/dist/components/buttons/src/data.d.ts +5 -5
- package/dist/components/buttons/src/index2.cjs +2 -2
- package/dist/components/buttons/src/index2.js +2 -2
- package/dist/components/cascaders/src/data.d.ts +5 -5
- package/dist/components/checks/src/data.d.ts +5 -5
- package/dist/components/common/list.d.ts +1 -1
- package/dist/components/common/use.cjs +1 -1
- package/dist/components/common/use.js +1 -1
- package/dist/components/dates/src/data.d.ts +5 -5
- package/dist/components/dates2/src/data.d.ts +5 -5
- package/dist/components/double/src/index2.cjs +3 -2
- package/dist/components/double/src/index2.js +3 -2
- package/dist/components/edit/index.css +5 -5
- package/dist/components/edit/index.scss +5 -5
- package/dist/components/edit/src/data.cjs +3 -2
- package/dist/components/edit/src/data.d.ts +5 -1
- package/dist/components/edit/src/data.js +3 -2
- package/dist/components/edit/src/index2.cjs +32 -23
- package/dist/components/edit/src/index2.js +32 -23
- package/dist/components/edit-data/src/area/array-json2.cjs +8 -4
- package/dist/components/edit-data/src/area/array-json2.js +8 -4
- package/dist/components/edit-data/src/area/array2.cjs +46 -8
- package/dist/components/edit-data/src/area/array2.js +47 -9
- package/dist/components/edit-data/src/area/editor2.cjs +22 -4
- package/dist/components/edit-data/src/area/editor2.js +22 -4
- package/dist/components/edit-data/src/area/general2.cjs +8 -1
- package/dist/components/edit-data/src/area/general2.js +8 -1
- package/dist/components/edit-data/src/area/object-json2.cjs +5 -1
- package/dist/components/edit-data/src/area/object-json2.js +5 -1
- package/dist/components/edit-data/src/area/object2.cjs +48 -11
- package/dist/components/edit-data/src/area/object2.js +49 -12
- package/dist/components/edit-data/src/data/array2.cjs +9 -5
- package/dist/components/edit-data/src/data/array2.js +9 -5
- package/dist/components/edit-data/src/data/bigint2.cjs +7 -3
- package/dist/components/edit-data/src/data/bigint2.js +7 -3
- package/dist/components/edit-data/src/data/boolean2.cjs +7 -3
- package/dist/components/edit-data/src/data/boolean2.js +7 -3
- package/dist/components/edit-data/src/data/date.cjs +4 -0
- package/dist/components/edit-data/src/data/date.js +4 -0
- package/dist/components/edit-data/src/data/date2.cjs +48 -0
- package/dist/components/edit-data/src/data/date2.js +48 -0
- package/dist/components/edit-data/src/data/function2.cjs +16 -7
- package/dist/components/edit-data/src/data/function2.js +17 -8
- package/dist/components/edit-data/src/data/null2.cjs +3 -1
- package/dist/components/edit-data/src/data/null2.js +4 -2
- package/dist/components/edit-data/src/data/number2.cjs +7 -3
- package/dist/components/edit-data/src/data/number2.js +7 -3
- package/dist/components/edit-data/src/data/object2.cjs +9 -5
- package/dist/components/edit-data/src/data/object2.js +9 -5
- package/dist/components/edit-data/src/data/other2.cjs +13 -5
- package/dist/components/edit-data/src/data/other2.js +14 -6
- package/dist/components/edit-data/src/data/string2.cjs +7 -3
- package/dist/components/edit-data/src/data/string2.js +7 -3
- package/dist/components/edit-data/src/data/symbol2.cjs +7 -3
- package/dist/components/edit-data/src/data/symbol2.js +7 -3
- package/dist/components/edit-data/src/data/undefined2.cjs +3 -1
- package/dist/components/edit-data/src/data/undefined2.js +4 -2
- package/dist/components/edit-data/src/data.cjs +10 -0
- package/dist/components/edit-data/src/data.d.ts +20 -0
- package/dist/components/edit-data/src/data.js +10 -0
- package/dist/components/edit-data/src/index2.cjs +31 -2
- package/dist/components/edit-data/src/index2.js +45 -16
- package/dist/components/edit-data-add/src/index2.cjs +2 -0
- package/dist/components/edit-data-add/src/index2.js +2 -0
- package/dist/components/edit-float/src/index2.cjs +3 -2
- package/dist/components/edit-float/src/index2.js +3 -2
- package/dist/components/history/src/index2.cjs +6 -4
- package/dist/components/history/src/index2.js +6 -4
- package/dist/components/input-array/src/index2.cjs +3 -2
- package/dist/components/input-array/src/index2.js +3 -2
- package/dist/components/input-history/src/index2.cjs +3 -2
- package/dist/components/input-history/src/index2.js +3 -2
- package/dist/components/input-select/src/index2.cjs +6 -4
- package/dist/components/input-select/src/index2.js +6 -4
- package/dist/components/labels/src/data.d.ts +5 -5
- package/dist/components/message/index.d.ts +11 -4
- package/dist/components/message/src/function.d.ts +11 -4
- package/dist/components/message-box/index.d.ts +2 -3
- package/dist/components/message-box/src/function.d.ts +2 -3
- package/dist/components/retract/index.css +23 -20
- package/dist/components/retract/index.scss +39 -20
- package/dist/components/retract/src/data.cjs +4 -1
- package/dist/components/retract/src/data.d.ts +4 -1
- package/dist/components/retract/src/data.js +4 -1
- package/dist/components/retract/src/index2.cjs +12 -10
- package/dist/components/retract/src/index2.js +9 -7
- package/dist/components/right-key/index.css +2 -1
- package/dist/components/right-key/index.scss +2 -1
- package/dist/components/right-key/src/data.cjs +7 -2
- package/dist/components/right-key/src/data.d.ts +5 -0
- package/dist/components/right-key/src/data.js +7 -2
- package/dist/components/right-key/src/index2.cjs +134 -60
- package/dist/components/right-key/src/index2.js +135 -61
- package/dist/components/selects/src/data.d.ts +5 -5
- package/dist/components/stick-window/src/index2.cjs +3 -2
- package/dist/components/stick-window/src/index2.js +3 -2
- package/dist/components/switchs/src/data.d.ts +5 -4
- package/dist/components/uploads/src/data.d.ts +5 -5
- package/dist/components/uploads/src/index2.cjs +26 -21
- package/dist/components/uploads/src/index2.js +15 -10
- package/dist/components/videos/src/index2.cjs +30 -19
- package/dist/components/videos/src/index2.js +30 -19
- package/dist/components/window/src/index2.cjs +9 -6
- package/dist/components/window/src/index2.js +9 -6
- package/dist/css/edit.css +5 -5
- package/dist/css/index.css +30 -26
- package/dist/css/retract.css +23 -20
- package/dist/css/right-key.css +2 -1
- package/dist/hooks/model/index.cjs +25 -0
- package/dist/hooks/model/index.d.ts +2 -0
- package/dist/hooks/model/index.js +25 -0
- package/dist/icons/index.json +1 -1
- package/dist/icons/vue/bar.cjs +2 -18
- package/dist/icons/vue/bar.js +1 -17
- package/dist/icons/vue/bar2.cjs +21 -2
- package/dist/icons/vue/bar2.js +21 -2
- package/dist/icons/vue/below.cjs +2 -18
- package/dist/icons/vue/below.js +1 -17
- package/dist/icons/vue/below2.cjs +21 -2
- package/dist/icons/vue/below2.js +21 -2
- package/dist/icons/vue/bicycle.cjs +2 -15
- package/dist/icons/vue/bicycle.js +1 -14
- package/dist/icons/vue/bicycle2.cjs +18 -2
- package/dist/icons/vue/bicycle2.js +18 -2
- package/dist/icons/vue/bottom-left.cjs +2 -22
- package/dist/icons/vue/bottom-left.js +1 -21
- package/dist/icons/vue/bottom-left2.cjs +25 -2
- package/dist/icons/vue/bottom-left2.js +25 -2
- package/dist/icons/vue/bottom-right.cjs +2 -22
- package/dist/icons/vue/bottom-right.js +1 -21
- package/dist/icons/vue/bottom-right2.cjs +25 -2
- package/dist/icons/vue/bottom-right2.js +25 -2
- package/dist/icons/vue/bottom.cjs +2 -18
- package/dist/icons/vue/bottom.js +1 -17
- package/dist/icons/vue/bottom2.cjs +21 -2
- package/dist/icons/vue/bottom2.js +21 -2
- package/dist/icons/vue/catalogue.cjs +2 -23
- package/dist/icons/vue/catalogue.js +1 -22
- package/dist/icons/vue/catalogue2.cjs +26 -2
- package/dist/icons/vue/catalogue2.js +26 -2
- package/dist/icons/vue/clear.cjs +2 -23
- package/dist/icons/vue/clear.js +1 -22
- package/dist/icons/vue/clear2.cjs +26 -2
- package/dist/icons/vue/clear2.js +26 -2
- package/dist/icons/vue/close.cjs +2 -18
- package/dist/icons/vue/close.js +1 -17
- package/dist/icons/vue/close2.cjs +21 -2
- package/dist/icons/vue/close2.js +21 -2
- package/dist/icons/vue/delete.cjs +2 -18
- package/dist/icons/vue/delete.js +1 -17
- package/dist/icons/vue/delete2.cjs +21 -2
- package/dist/icons/vue/delete2.js +21 -2
- package/dist/icons/vue/document.cjs +2 -23
- package/dist/icons/vue/document.js +1 -22
- package/dist/icons/vue/document2.cjs +26 -2
- package/dist/icons/vue/document2.js +26 -2
- package/dist/icons/vue/down.cjs +2 -18
- package/dist/icons/vue/down.js +1 -17
- package/dist/icons/vue/down2.cjs +21 -2
- package/dist/icons/vue/down2.js +21 -2
- package/dist/icons/vue/download.cjs +2 -18
- package/dist/icons/vue/download.js +1 -17
- package/dist/icons/vue/download2.cjs +21 -2
- package/dist/icons/vue/download2.js +21 -2
- package/dist/icons/vue/edit.cjs +2 -23
- package/dist/icons/vue/edit.js +1 -22
- package/dist/icons/vue/edit2.cjs +26 -2
- package/dist/icons/vue/edit2.js +26 -2
- package/dist/icons/vue/enter.cjs +2 -19
- package/dist/icons/vue/enter.js +1 -18
- package/dist/icons/vue/enter2.cjs +22 -2
- package/dist/icons/vue/enter2.js +22 -2
- package/dist/icons/vue/frame.cjs +2 -15
- package/dist/icons/vue/frame.js +1 -14
- package/dist/icons/vue/frame2.cjs +18 -2
- package/dist/icons/vue/frame2.js +18 -2
- package/dist/icons/vue/index.cjs +81 -54
- package/dist/icons/vue/index.js +54 -27
- package/dist/icons/vue/left.cjs +2 -18
- package/dist/icons/vue/left.js +1 -17
- package/dist/icons/vue/left2.cjs +21 -2
- package/dist/icons/vue/left2.js +21 -2
- package/dist/icons/vue/mute.cjs +2 -18
- package/dist/icons/vue/mute.js +1 -17
- package/dist/icons/vue/mute2.cjs +21 -2
- package/dist/icons/vue/mute2.js +21 -2
- package/dist/icons/vue/pause.cjs +2 -24
- package/dist/icons/vue/pause.js +1 -23
- package/dist/icons/vue/pause2.cjs +27 -2
- package/dist/icons/vue/pause2.js +27 -2
- package/dist/icons/vue/play.cjs +2 -19
- package/dist/icons/vue/play.js +1 -18
- package/dist/icons/vue/play2.cjs +22 -2
- package/dist/icons/vue/play2.js +22 -2
- package/dist/icons/vue/plus.cjs +2 -18
- package/dist/icons/vue/plus.js +1 -17
- package/dist/icons/vue/plus2.cjs +21 -2
- package/dist/icons/vue/plus2.js +21 -2
- package/dist/icons/vue/retreat.cjs +2 -19
- package/dist/icons/vue/retreat.js +1 -18
- package/dist/icons/vue/retreat2.cjs +22 -2
- package/dist/icons/vue/retreat2.js +22 -2
- package/dist/icons/vue/right.cjs +2 -18
- package/dist/icons/vue/right.js +1 -17
- package/dist/icons/vue/right2.cjs +21 -2
- package/dist/icons/vue/right2.js +21 -2
- package/dist/icons/vue/sound.cjs +2 -22
- package/dist/icons/vue/sound.js +1 -21
- package/dist/icons/vue/sound2.cjs +25 -2
- package/dist/icons/vue/sound2.js +25 -2
- package/dist/icons/vue/star.cjs +2 -22
- package/dist/icons/vue/star.js +1 -21
- package/dist/icons/vue/star2.cjs +25 -2
- package/dist/icons/vue/star2.js +25 -2
- package/dist/icons/vue/up.cjs +2 -18
- package/dist/icons/vue/up.js +1 -17
- package/dist/icons/vue/up2.cjs +21 -2
- package/dist/icons/vue/up2.js +21 -2
- package/dist/icons/vue/views.cjs +2 -18
- package/dist/icons/vue/views.js +1 -17
- package/dist/icons/vue/views2.cjs +21 -2
- package/dist/icons/vue/views2.js +21 -2
- package/dist/index.css +30 -26
- package/dist/utils/vues/index.d.ts +1 -0
- package/dist/utils/vues/shared.cjs +19 -0
- package/dist/utils/vues/shared.d.ts +5 -0
- package/dist/utils/vues/shared.js +19 -0
- package/package.json +10 -11
- package/dist/_virtual/_plugin-vue_export-helper.cjs +0 -10
- package/dist/_virtual/_plugin-vue_export-helper.js +0 -10
- /package/dist/components/{keep-com → global-config}/index.css +0 -0
- /package/dist/css/{keep-com.css → global-config.css} +0 -0
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
3
|
const vue = require("vue");
|
|
4
|
-
const index$
|
|
5
|
-
|
|
6
|
-
const index$
|
|
4
|
+
const index$5 = require("../../icon/index.cjs");
|
|
5
|
+
require("../../../icons/vue/right.cjs");
|
|
6
|
+
const index$4 = require("../../../directives/adjustment/index.cjs");
|
|
7
7
|
const data = require("./data.cjs");
|
|
8
8
|
const index$1 = require("../../../hooks/cssname/index.cjs");
|
|
9
9
|
const index = require("../../../hooks/locale/index.cjs");
|
|
10
10
|
const index$2 = require("../../../hooks/props-default/index.cjs");
|
|
11
|
+
const index$3 = require("../../../hooks/model/index.cjs");
|
|
12
|
+
const right_vue_vue_type_script_setup_true_lang = require("../../../icons/vue/right2.cjs");
|
|
11
13
|
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
12
14
|
__name: "index",
|
|
13
15
|
props: index$2.getProps(data.dataProps),
|
|
@@ -18,7 +20,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
18
20
|
const prs = __props;
|
|
19
21
|
const props = index$2.usePropsDefault(data.name, prs, data.dataProps);
|
|
20
22
|
const emit = __emit;
|
|
21
|
-
const visible =
|
|
23
|
+
const visible = index$3.useModel(props, emit);
|
|
22
24
|
function onClick() {
|
|
23
25
|
visible.value = !visible.value;
|
|
24
26
|
}
|
|
@@ -34,13 +36,13 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
34
36
|
}, [
|
|
35
37
|
vue.renderSlot(_ctx.$slots, vue.unref(data.dataSlot).default)
|
|
36
38
|
], 2)), [
|
|
37
|
-
[vue.vShow, !visible
|
|
38
|
-
[vue.unref(index$
|
|
39
|
+
[vue.vShow, !vue.unref(visible)],
|
|
40
|
+
[vue.unref(index$4.default), {
|
|
39
41
|
is: vue.unref(props).isAdjust,
|
|
40
42
|
often: vue.unref(props).often,
|
|
41
43
|
dom: "div",
|
|
42
44
|
[vue.unref(props).direction]: {
|
|
43
|
-
interval:
|
|
45
|
+
interval: 8
|
|
44
46
|
// adjoin: 'div',
|
|
45
47
|
}
|
|
46
48
|
}]
|
|
@@ -53,12 +55,12 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
53
55
|
vue.unref(cs).is(vue.unref(props).direction, true)
|
|
54
56
|
])
|
|
55
57
|
}, [
|
|
56
|
-
vue.createVNode(vue.unref(index$
|
|
57
|
-
class: vue.normalizeClass([vue.unref(cs).z("icon"), vue.unref(cs).is("reverse", visible
|
|
58
|
+
vue.createVNode(vue.unref(index$5.Icon), {
|
|
59
|
+
class: vue.normalizeClass([vue.unref(cs).z("icon"), vue.unref(cs).is("reverse", vue.unref(visible))])
|
|
58
60
|
}, {
|
|
59
61
|
default: vue.withCtx(() => [
|
|
60
62
|
vue.renderSlot(_ctx.$slots, vue.unref(data.dataSlot).icon, {}, () => [
|
|
61
|
-
vue.createVNode(
|
|
63
|
+
vue.createVNode(right_vue_vue_type_script_setup_true_lang.default)
|
|
62
64
|
])
|
|
63
65
|
]),
|
|
64
66
|
_: 3
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { defineComponent,
|
|
1
|
+
import { defineComponent, createElementBlock, openBlock, normalizeClass, unref, withDirectives, createElementVNode, renderSlot, vShow, withModifiers, createVNode, withCtx } from "vue";
|
|
2
2
|
import { Icon } from "../../icon/index.js";
|
|
3
|
-
import
|
|
3
|
+
import "../../../icons/vue/right.js";
|
|
4
4
|
import vAdjustment from "../../../directives/adjustment/index.js";
|
|
5
5
|
import { name, dataProps, dataExpose, dataSlot, dataEmits } from "./data.js";
|
|
6
6
|
import { useCssName } from "../../../hooks/cssname/index.js";
|
|
7
7
|
import { useLocale } from "../../../hooks/locale/index.js";
|
|
8
8
|
import { usePropsDefault, getProps } from "../../../hooks/props-default/index.js";
|
|
9
|
+
import { useModel } from "../../../hooks/model/index.js";
|
|
10
|
+
import _sfc_main$1 from "../../../icons/vue/right2.js";
|
|
9
11
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
10
12
|
__name: "index",
|
|
11
13
|
props: getProps(dataProps),
|
|
@@ -16,7 +18,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
16
18
|
const prs = __props;
|
|
17
19
|
const props = usePropsDefault(name, prs, dataProps);
|
|
18
20
|
const emit = __emit;
|
|
19
|
-
const visible =
|
|
21
|
+
const visible = useModel(props, emit);
|
|
20
22
|
function onClick() {
|
|
21
23
|
visible.value = !visible.value;
|
|
22
24
|
}
|
|
@@ -32,13 +34,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
32
34
|
}, [
|
|
33
35
|
renderSlot(_ctx.$slots, unref(dataSlot).default)
|
|
34
36
|
], 2)), [
|
|
35
|
-
[vShow, !visible
|
|
37
|
+
[vShow, !unref(visible)],
|
|
36
38
|
[unref(vAdjustment), {
|
|
37
39
|
is: unref(props).isAdjust,
|
|
38
40
|
often: unref(props).often,
|
|
39
41
|
dom: "div",
|
|
40
42
|
[unref(props).direction]: {
|
|
41
|
-
interval:
|
|
43
|
+
interval: 8
|
|
42
44
|
// adjoin: 'div',
|
|
43
45
|
}
|
|
44
46
|
}]
|
|
@@ -52,11 +54,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
52
54
|
])
|
|
53
55
|
}, [
|
|
54
56
|
createVNode(unref(Icon), {
|
|
55
|
-
class: normalizeClass([unref(cs).z("icon"), unref(cs).is("reverse", visible
|
|
57
|
+
class: normalizeClass([unref(cs).z("icon"), unref(cs).is("reverse", unref(visible))])
|
|
56
58
|
}, {
|
|
57
59
|
default: withCtx(() => [
|
|
58
60
|
renderSlot(_ctx.$slots, unref(dataSlot).icon, {}, () => [
|
|
59
|
-
createVNode(
|
|
61
|
+
createVNode(_sfc_main$1)
|
|
60
62
|
])
|
|
61
63
|
]),
|
|
62
64
|
_: 3
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
.right-key-box {
|
|
26
26
|
width: 140px;
|
|
27
|
-
position:
|
|
27
|
+
position: fixed;
|
|
28
28
|
padding: 10px;
|
|
29
29
|
z-index: 9999;
|
|
30
30
|
background: #ffffff;
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
white-space: nowrap;
|
|
41
41
|
display: flex;
|
|
42
42
|
align-items: center;
|
|
43
|
+
box-sizing: border-box;
|
|
43
44
|
height: 40px;
|
|
44
45
|
padding: 8px 14px 8px 10px;
|
|
45
46
|
border-radius: 4px;
|
|
@@ -4,7 +4,7 @@ $right-key: 'right-key';
|
|
|
4
4
|
@include b($right-key) {
|
|
5
5
|
&-box {
|
|
6
6
|
width: 140px;
|
|
7
|
-
position:
|
|
7
|
+
position: fixed;
|
|
8
8
|
padding: 10px;
|
|
9
9
|
z-index: 9999;
|
|
10
10
|
background: #ffffff;
|
|
@@ -20,6 +20,7 @@ $right-key: 'right-key';
|
|
|
20
20
|
white-space: nowrap;
|
|
21
21
|
display: flex;
|
|
22
22
|
align-items: center;
|
|
23
|
+
box-sizing: border-box;
|
|
23
24
|
height: 40px;
|
|
24
25
|
padding: 8px 14px 8px 10px;
|
|
25
26
|
border-radius: 4px;
|
|
@@ -45,7 +45,7 @@ const dataProps = buildProps.buildProps({
|
|
|
45
45
|
*/
|
|
46
46
|
boxClass: {
|
|
47
47
|
type: [String]
|
|
48
|
-
}
|
|
48
|
+
},
|
|
49
49
|
// /**
|
|
50
50
|
// * @props { String, Function } prop=value 列表中对比的内容
|
|
51
51
|
// */
|
|
@@ -53,10 +53,15 @@ const dataProps = buildProps.buildProps({
|
|
|
53
53
|
// type: [String, Function],
|
|
54
54
|
// default: 'value',
|
|
55
55
|
// },
|
|
56
|
+
isSingle: {
|
|
57
|
+
type: Boolean,
|
|
58
|
+
default: false
|
|
59
|
+
}
|
|
56
60
|
});
|
|
57
61
|
const dataEmits = ["click-key", "click-right"];
|
|
58
62
|
const dataSlot = {
|
|
59
|
-
default: "default"
|
|
63
|
+
default: "default",
|
|
64
|
+
list: "list"
|
|
60
65
|
};
|
|
61
66
|
const dataExpose = {};
|
|
62
67
|
exports.dataEmits = dataEmits;
|
|
@@ -60,6 +60,10 @@ export declare const dataProps: {
|
|
|
60
60
|
boxClass: {
|
|
61
61
|
type: StringConstructor[];
|
|
62
62
|
};
|
|
63
|
+
isSingle: {
|
|
64
|
+
type: BooleanConstructor;
|
|
65
|
+
default: boolean;
|
|
66
|
+
};
|
|
63
67
|
to: {
|
|
64
68
|
type: StringConstructor;
|
|
65
69
|
default: FunctConfig;
|
|
@@ -84,6 +88,7 @@ export type DataEmits = typeof dataEmits;
|
|
|
84
88
|
*/
|
|
85
89
|
export declare const dataSlot: {
|
|
86
90
|
default: string;
|
|
91
|
+
list: string;
|
|
87
92
|
};
|
|
88
93
|
/**
|
|
89
94
|
*/
|
|
@@ -43,7 +43,7 @@ const dataProps = buildProps({
|
|
|
43
43
|
*/
|
|
44
44
|
boxClass: {
|
|
45
45
|
type: [String]
|
|
46
|
-
}
|
|
46
|
+
},
|
|
47
47
|
// /**
|
|
48
48
|
// * @props { String, Function } prop=value 列表中对比的内容
|
|
49
49
|
// */
|
|
@@ -51,10 +51,15 @@ const dataProps = buildProps({
|
|
|
51
51
|
// type: [String, Function],
|
|
52
52
|
// default: 'value',
|
|
53
53
|
// },
|
|
54
|
+
isSingle: {
|
|
55
|
+
type: Boolean,
|
|
56
|
+
default: false
|
|
57
|
+
}
|
|
54
58
|
});
|
|
55
59
|
const dataEmits = ["click-key", "click-right"];
|
|
56
60
|
const dataSlot = {
|
|
57
|
-
default: "default"
|
|
61
|
+
default: "default",
|
|
62
|
+
list: "list"
|
|
58
63
|
};
|
|
59
64
|
const dataExpose = {};
|
|
60
65
|
export {
|
|
@@ -8,6 +8,7 @@ const index$3 = require("../../box-teleport/index.cjs");
|
|
|
8
8
|
const data = require("./data.cjs");
|
|
9
9
|
const index$1 = require("../../../hooks/cssname/index.cjs");
|
|
10
10
|
const index = require("../../../hooks/locale/index.cjs");
|
|
11
|
+
const getBoxDom = require("../../../utils/vues/getBoxDom.cjs");
|
|
11
12
|
const index$2 = require("../../../hooks/props-default/index.cjs");
|
|
12
13
|
const _hoisted_1 = ["onClick"];
|
|
13
14
|
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
@@ -23,73 +24,145 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
23
24
|
const flag = vue.ref(false);
|
|
24
25
|
const refRightKey = vue.ref();
|
|
25
26
|
const refRightKeyBox = vue.ref();
|
|
26
|
-
const
|
|
27
|
-
const lefty = vue.ref("");
|
|
27
|
+
const position = vue.ref({ x: 0, y: 0 });
|
|
28
28
|
const dom = vue.ref();
|
|
29
|
-
vue.
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
const boxStyle = vue.computed(() => {
|
|
30
|
+
if (!refRightKeyBox.value) return {};
|
|
31
|
+
const rect = refRightKeyBox.value.getBoundingClientRect();
|
|
32
|
+
const { innerWidth, innerHeight } = window;
|
|
33
|
+
let x = position.value.x;
|
|
34
|
+
let y = position.value.y;
|
|
35
|
+
if (x + rect.width > innerWidth) {
|
|
36
|
+
x = x - rect.width;
|
|
37
|
+
}
|
|
38
|
+
if (y + rect.height > innerHeight) {
|
|
39
|
+
y = y - rect.height;
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
top: `${y}px`,
|
|
43
|
+
left: `${x}px`
|
|
44
|
+
};
|
|
34
45
|
});
|
|
35
|
-
function
|
|
36
|
-
|
|
46
|
+
function handleGlobalMousedown(event) {
|
|
47
|
+
var _a;
|
|
48
|
+
if ((_a = refRightKeyBox.value) == null ? void 0 : _a.contains(event.target)) {
|
|
37
49
|
return;
|
|
38
50
|
}
|
|
39
|
-
|
|
51
|
+
flag.value = false;
|
|
52
|
+
}
|
|
53
|
+
function handleGlobalClick(event) {
|
|
54
|
+
var _a;
|
|
55
|
+
if (event.button === 2) return;
|
|
56
|
+
if (!((_a = refRightKeyBox.value) == null ? void 0 : _a.contains(event.target))) {
|
|
57
|
+
flag.value = false;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function handleKeydown(event) {
|
|
61
|
+
if (event.key === "Escape" && flag.value) {
|
|
40
62
|
flag.value = false;
|
|
41
63
|
}
|
|
42
64
|
}
|
|
43
65
|
function isDomClass(dom2) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
} else {
|
|
55
|
-
return dom2;
|
|
66
|
+
var _a, _b;
|
|
67
|
+
if (!dom2) return null;
|
|
68
|
+
if (props.domClass) {
|
|
69
|
+
const element = getPrentClass.getPrentClass(
|
|
70
|
+
dom2,
|
|
71
|
+
props.domClass,
|
|
72
|
+
props.level
|
|
73
|
+
);
|
|
74
|
+
if (element && ((_a = refRightKey.value) == null ? void 0 : _a.contains(element))) {
|
|
75
|
+
return element;
|
|
56
76
|
}
|
|
77
|
+
} else if ((_b = refRightKey.value) == null ? void 0 : _b.contains(dom2)) {
|
|
78
|
+
return dom2;
|
|
57
79
|
}
|
|
80
|
+
return null;
|
|
58
81
|
}
|
|
59
82
|
function handleContextmenu(event) {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
if (target) {
|
|
63
|
-
dom.value = target;
|
|
64
|
-
let x = 0, y = 0;
|
|
65
|
-
if (event.x || event.y) {
|
|
66
|
-
x = event.x;
|
|
67
|
-
y = event.y;
|
|
68
|
-
} else if (event.pageX || event.pageY) {
|
|
69
|
-
x = event.pageX - 1;
|
|
70
|
-
y = event.pageY - 1;
|
|
71
|
-
}
|
|
72
|
-
let ww = globalThis ? globalThis.innerWidth : 0;
|
|
73
|
-
let kw = 0;
|
|
74
|
-
if (ww != 0 && x + 120 > ww) {
|
|
75
|
-
kw = 0 - (x + 120 - ww);
|
|
76
|
-
}
|
|
77
|
-
topx.value = x + kw + "px";
|
|
78
|
-
lefty.value = y + "px";
|
|
79
|
-
flag.value = true;
|
|
80
|
-
event.preventDefault();
|
|
81
|
-
event.stopPropagation();
|
|
82
|
-
emit("click-right", target);
|
|
83
|
-
} else {
|
|
83
|
+
const target = isDomClass(event.target);
|
|
84
|
+
if (!target) {
|
|
84
85
|
flag.value = false;
|
|
86
|
+
return;
|
|
85
87
|
}
|
|
88
|
+
dom.value = target;
|
|
89
|
+
let x = event.clientX;
|
|
90
|
+
let y = event.clientY;
|
|
91
|
+
flag.value = true;
|
|
92
|
+
event.preventDefault();
|
|
93
|
+
event.stopPropagation();
|
|
94
|
+
emit("click-right", target);
|
|
95
|
+
vue.nextTick(() => {
|
|
96
|
+
position.value = { x, y };
|
|
97
|
+
});
|
|
86
98
|
}
|
|
87
99
|
function onClick(v) {
|
|
88
100
|
flag.value = false;
|
|
89
101
|
emit("click-key", v, dom.value);
|
|
90
102
|
}
|
|
103
|
+
const toDom = vue.ref();
|
|
104
|
+
vue.watch(
|
|
105
|
+
() => flag.value,
|
|
106
|
+
() => {
|
|
107
|
+
if (props.isSingle) {
|
|
108
|
+
if (flag.value) {
|
|
109
|
+
if (toDom.value) {
|
|
110
|
+
toDom.value.querySelectorAll("." + cs.z("box")).forEach((v) => {
|
|
111
|
+
v.style.display = "none";
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
vue.nextTick(() => {
|
|
115
|
+
refRightKeyBox.value.style.display = "block";
|
|
116
|
+
});
|
|
117
|
+
} else {
|
|
118
|
+
refRightKeyBox.value.style.display = "none";
|
|
119
|
+
}
|
|
120
|
+
} else {
|
|
121
|
+
refRightKeyBox.value.style.display = flag.value ? "block" : "none";
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
);
|
|
125
|
+
vue.onMounted(() => {
|
|
126
|
+
toDom.value = getBoxDom.getBoxDom();
|
|
127
|
+
document.addEventListener("mousedown", handleGlobalMousedown, true);
|
|
128
|
+
document.addEventListener("click", handleGlobalClick, true);
|
|
129
|
+
document.addEventListener("keydown", handleKeydown);
|
|
130
|
+
window.addEventListener("resize", () => {
|
|
131
|
+
if (flag.value) {
|
|
132
|
+
flag.value = false;
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
window.addEventListener(
|
|
136
|
+
"scroll",
|
|
137
|
+
() => {
|
|
138
|
+
if (flag.value) {
|
|
139
|
+
flag.value = false;
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
true
|
|
143
|
+
);
|
|
144
|
+
});
|
|
145
|
+
vue.onUnmounted(() => {
|
|
146
|
+
document.removeEventListener("mousedown", handleGlobalMousedown, true);
|
|
147
|
+
document.removeEventListener("click", handleGlobalClick, true);
|
|
148
|
+
document.removeEventListener("keydown", handleKeydown);
|
|
149
|
+
window.removeEventListener("resize", () => {
|
|
150
|
+
});
|
|
151
|
+
window.removeEventListener("scroll", () => {
|
|
152
|
+
}, true);
|
|
153
|
+
});
|
|
91
154
|
__expose({
|
|
92
|
-
...data.dataExpose
|
|
155
|
+
...data.dataExpose,
|
|
156
|
+
// 提供关闭菜单的方法
|
|
157
|
+
close: () => {
|
|
158
|
+
flag.value = false;
|
|
159
|
+
},
|
|
160
|
+
// 提供打开菜单的方法
|
|
161
|
+
open: (x, y, target) => {
|
|
162
|
+
position.value = { x, y };
|
|
163
|
+
dom.value = target;
|
|
164
|
+
flag.value = true;
|
|
165
|
+
}
|
|
93
166
|
});
|
|
94
167
|
return (_ctx, _cache) => {
|
|
95
168
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
@@ -108,11 +181,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
108
181
|
class: vue.normalizeClass([vue.unref(cs).z("box"), vue.unref(props).boxClass]),
|
|
109
182
|
ref_key: "refRightKeyBox",
|
|
110
183
|
ref: refRightKeyBox,
|
|
111
|
-
style: vue.normalizeStyle(
|
|
112
|
-
position: "fixed",
|
|
113
|
-
top: lefty.value,
|
|
114
|
-
left: topx.value
|
|
115
|
-
})
|
|
184
|
+
style: vue.normalizeStyle(boxStyle.value)
|
|
116
185
|
}, [
|
|
117
186
|
vue.createElementVNode("div", {
|
|
118
187
|
class: vue.normalizeClass(vue.unref(cs).z("box-list"))
|
|
@@ -123,13 +192,18 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
123
192
|
onClick: vue.withModifiers(($event) => onClick(v), ["stop"]),
|
|
124
193
|
class: vue.normalizeClass(vue.unref(cs).z("box-list-li"))
|
|
125
194
|
}, [
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
195
|
+
vue.renderSlot(_ctx.$slots, vue.unref(data.dataSlot).list, {
|
|
196
|
+
value: v,
|
|
197
|
+
index: k
|
|
198
|
+
}, () => [
|
|
199
|
+
v.icon ? (vue.openBlock(), vue.createBlock(vue.unref(index$4.Icon), { key: 0 }, {
|
|
200
|
+
default: vue.withCtx(() => [
|
|
201
|
+
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(v.icon)))
|
|
202
|
+
]),
|
|
203
|
+
_: 2
|
|
204
|
+
}, 1024)) : vue.createCommentVNode("", true),
|
|
205
|
+
vue.createElementVNode("span", null, vue.toDisplayString(vue.unref(use.useVueValue)(v, vue.unref(props).label)), 1)
|
|
206
|
+
])
|
|
133
207
|
], 10, _hoisted_1);
|
|
134
208
|
}), 128))
|
|
135
209
|
], 2)
|
|
@@ -137,7 +211,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
137
211
|
[vue.vShow, flag.value]
|
|
138
212
|
])
|
|
139
213
|
]),
|
|
140
|
-
_:
|
|
214
|
+
_: 3
|
|
141
215
|
}, 8, ["disabled", "to"])
|
|
142
216
|
], 34);
|
|
143
217
|
};
|