@farris/ui-vue 1.2.4 → 1.2.6
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/components/accordion/index.esm.js +58 -58
- package/components/accordion/index.umd.cjs +1 -1
- package/components/accordion/package.json +1 -1
- package/components/avatar/index.esm.js +124 -116
- package/components/avatar/index.umd.cjs +1 -1
- package/components/avatar/package.json +1 -1
- package/components/border-editor/package.json +1 -1
- package/components/button/package.json +1 -1
- package/components/button-edit/index.css +1 -0
- package/components/button-edit/package.json +1 -1
- package/components/button-group/package.json +1 -1
- package/components/calculator/package.json +1 -1
- package/components/calendar/package.json +1 -1
- package/components/capsule/index.esm.js +1 -1
- package/components/capsule/index.umd.cjs +1 -1
- package/components/capsule/package.json +1 -1
- package/components/checkbox/index.esm.js +219 -209
- package/components/checkbox/index.umd.cjs +1 -1
- package/components/checkbox/package.json +1 -1
- package/components/color-picker/package.json +1 -1
- package/components/combo-list/index.esm.js +36 -28
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/combo-list/package.json +1 -1
- package/components/combo-tree/index.esm.js +340 -107
- package/components/combo-tree/index.umd.cjs +1 -1
- package/components/combo-tree/package.json +1 -1
- package/components/common/index.esm.js +2 -2
- package/components/common/index.umd.cjs +1 -1
- package/components/common/package.json +1 -1
- package/components/component/index.esm.js +36 -29
- package/components/component/index.umd.cjs +1 -1
- package/components/component/package.json +1 -1
- package/components/condition/index.esm.js +406 -402
- package/components/condition/index.umd.cjs +1 -1
- package/components/condition/package.json +1 -1
- package/components/content-container/index.esm.js +9 -13
- package/components/content-container/index.umd.cjs +1 -1
- package/components/content-container/package.json +1 -1
- package/components/{tree-grid/style.css → data-grid/index.css} +1 -1
- package/components/data-grid/index.esm.js +4439 -4273
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-grid/package.json +1 -1
- package/components/data-view/index.esm.js +2904 -2892
- package/components/data-view/index.umd.cjs +1 -1
- package/components/data-view/package.json +1 -1
- package/components/date-picker/index.esm.js +250 -242
- package/components/date-picker/index.umd.cjs +1 -1
- package/components/date-picker/package.json +1 -1
- package/components/designer-canvas/index.css +1 -0
- package/components/designer-canvas/index.esm.js +24 -21
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/designer-canvas/package.json +1 -1
- package/components/designer-outline/index.esm.js +44 -42
- package/components/designer-outline/index.umd.cjs +1 -1
- package/components/designer-outline/package.json +1 -1
- package/components/designer-toolbox/index.esm.js +28 -467
- package/components/designer-toolbox/index.umd.cjs +1 -1
- package/components/designer-toolbox/package.json +1 -1
- package/components/discussion-editor/package.json +1 -1
- package/components/discussion-list/package.json +1 -1
- package/components/drawer/package.json +1 -1
- package/components/dropdown/index.esm.js +86 -86
- package/components/dropdown/index.umd.cjs +1 -1
- package/components/dropdown/package.json +1 -1
- package/components/dynamic-form/index.esm.js +984 -928
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-form/package.json +1 -1
- package/components/dynamic-resolver/index.esm.js +56 -47
- package/components/dynamic-resolver/index.umd.cjs +1 -1
- package/components/dynamic-resolver/package.json +1 -1
- package/components/dynamic-view/index.esm.js +281 -277
- package/components/dynamic-view/index.umd.cjs +1 -1
- package/components/dynamic-view/package.json +1 -1
- package/components/enum-editor/package.json +1 -1
- package/components/events-editor/package.json +1 -1
- package/components/expression-editor/package.json +1 -1
- package/components/external-container/index.css +1 -0
- package/components/external-container/index.esm.js +1917 -1901
- package/components/external-container/index.umd.cjs +1 -1
- package/components/external-container/package.json +1 -1
- package/components/field-selector/index.css +1 -0
- package/components/field-selector/index.esm.js +4185 -4023
- package/components/field-selector/index.umd.cjs +1 -1
- package/components/field-selector/package.json +1 -1
- package/components/filter-bar/{style.css → index.css} +1 -1
- package/components/filter-bar/index.esm.js +595 -581
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/filter-bar/package.json +1 -1
- package/components/flow-canvas/index.css +1 -0
- package/components/flow-canvas/index.esm.js +38 -35
- package/components/flow-canvas/index.umd.cjs +1 -1
- package/components/flow-canvas/package.json +1 -1
- package/components/image-cropper/package.json +1 -1
- package/components/input-group/index.esm.js +256 -248
- package/components/input-group/index.umd.cjs +1 -1
- package/components/input-group/package.json +1 -1
- package/components/layout/package.json +1 -1
- package/components/list-nav/package.json +1 -1
- package/components/list-view/index.esm.js +1522 -1519
- package/components/list-view/index.umd.cjs +1 -1
- package/components/list-view/package.json +1 -1
- package/components/loading/package.json +1 -1
- package/components/locale/package.json +1 -1
- package/components/lookup/index.css +1 -0
- package/components/lookup/index.esm.js +4629 -4410
- package/components/lookup/index.umd.cjs +1 -1
- package/components/lookup/package.json +1 -1
- package/components/mapping-editor/index.css +1 -0
- package/components/mapping-editor/index.esm.js +4454 -4255
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/mapping-editor/package.json +1 -1
- package/components/message-box/index.css +1 -0
- package/components/message-box/index.esm.js +397 -386
- package/components/message-box/index.umd.cjs +1 -1
- package/components/message-box/package.json +1 -1
- package/components/modal/index.css +1 -0
- package/components/modal/index.esm.js +308 -297
- package/components/modal/index.umd.cjs +1 -1
- package/components/modal/package.json +1 -1
- package/components/nav/index.esm.js +511 -469
- package/components/nav/index.umd.cjs +2 -2
- package/components/nav/package.json +1 -1
- package/components/notify/package.json +1 -1
- package/components/order/index.esm.js +972 -920
- package/components/order/index.umd.cjs +1 -1
- package/components/order/package.json +1 -1
- package/components/page-footer/package.json +1 -1
- package/components/page-header/index.esm.js +917 -893
- package/components/page-header/index.umd.cjs +1 -1
- package/components/page-header/package.json +1 -1
- package/components/pagination/index.esm.js +491 -449
- package/components/pagination/index.umd.cjs +1 -1
- package/components/pagination/package.json +1 -1
- package/components/popover/package.json +1 -1
- package/components/progress/package.json +1 -1
- package/components/property-editor/index.esm.js +108 -101
- package/components/property-editor/index.umd.cjs +2 -2
- package/components/property-editor/package.json +1 -1
- package/components/property-panel/index.esm.js +361 -349
- package/components/property-panel/index.umd.cjs +1 -1
- package/components/property-panel/package.json +1 -1
- package/components/radio-button/package.json +1 -1
- package/components/radio-group/index.esm.js +72 -64
- package/components/radio-group/index.umd.cjs +1 -1
- package/components/radio-group/package.json +1 -1
- package/components/rate/package.json +1 -1
- package/components/response-layout/package.json +1 -1
- package/components/response-layout-editor/{style.css → index.css} +1 -1
- package/components/response-layout-editor/index.esm.js +452 -439
- package/components/response-layout-editor/index.umd.cjs +1 -1
- package/components/response-layout-editor/package.json +1 -1
- package/components/response-toolbar/index.esm.js +610 -592
- package/components/response-toolbar/index.umd.cjs +1 -1
- package/components/response-toolbar/package.json +1 -1
- package/components/schema-selector/index.css +1 -0
- package/components/schema-selector/index.esm.js +4041 -3749
- package/components/schema-selector/index.umd.cjs +8 -1
- package/components/schema-selector/package.json +1 -1
- package/components/search-box/package.json +1 -1
- package/components/section/index.esm.js +21 -14
- package/components/section/index.umd.cjs +1 -1
- package/components/section/package.json +1 -1
- package/components/smoke-detector/package.json +1 -1
- package/components/spacing-editor/package.json +1 -1
- package/components/splitter/package.json +1 -1
- package/components/step/package.json +1 -1
- package/components/switch/index.esm.js +159 -178
- package/components/switch/index.umd.cjs +1 -1
- package/components/switch/package.json +1 -1
- package/components/tabs/index.css +1 -0
- package/components/tabs/index.esm.js +1450 -1408
- package/components/tabs/index.umd.cjs +1 -1
- package/components/tabs/package.json +1 -1
- package/components/tags/package.json +1 -1
- package/components/text/package.json +1 -1
- package/components/textarea/index.esm.js +86 -78
- package/components/textarea/index.umd.cjs +1 -1
- package/components/textarea/package.json +1 -1
- package/components/time-picker/index.css +1 -0
- package/components/time-picker/index.esm.js +387 -379
- package/components/time-picker/index.umd.cjs +1 -1
- package/components/time-picker/package.json +1 -1
- package/components/tooltip/package.json +1 -1
- package/components/transfer/index.esm.js +95 -93
- package/components/transfer/index.umd.cjs +1 -1
- package/components/transfer/package.json +1 -1
- package/components/{data-grid/style.css → tree-grid/index.css} +1 -1
- package/components/tree-grid/index.esm.js +4437 -4271
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-grid/package.json +1 -1
- package/components/tree-view/index.esm.js +1989 -1985
- package/components/tree-view/index.umd.cjs +1 -1
- package/components/tree-view/package.json +1 -1
- package/components/uploader/package.json +1 -1
- package/components/verify-detail/package.json +1 -1
- package/components/video/package.json +1 -1
- package/components/weather/package.json +1 -1
- package/farris.all.esm.js +12989 -12513
- package/farris.all.umd.cjs +9 -9
- package/index.css +1 -0
- package/package.json +2 -2
- package/types/combo-tree/src/combo-tree.props.d.ts +4 -0
- package/types/combo-tree/src/components/tree-container.component.d.ts +13 -3
- package/types/combo-tree/src/components/tree-container.props.d.ts +15 -1
- package/types/combo-tree/src/schema/schema-mapper.d.ts +2 -0
- package/types/combo-tree/src/schema/schema-resolver.d.ts +2 -0
- package/types/components.d.ts +1 -0
- package/types/condition/index.d.ts +60 -1
- package/types/data-grid/index.d.ts +5 -5
- package/types/data-grid/src/data-grid.component.d.ts +2 -2
- package/types/data-grid/src/designer/data-grid.design.component.d.ts +2 -2
- package/types/data-grid/src/property-config/data-grid.property-config.d.ts +1 -1
- package/types/data-view/components/column-setting/column-setting.component.d.ts +2 -1
- package/types/data-view/composition/types.d.ts +2 -0
- package/types/designer-canvas/src/composition/dg-control.d.ts +8 -8
- package/types/designer-canvas/src/composition/types.d.ts +1 -0
- package/types/dynamic-form/src/designer/use-designer-rules.d.ts +3 -3
- package/types/dynamic-form/src/types.d.ts +1 -1
- package/types/dynamic-resolver/index.d.ts +1 -0
- package/types/dynamic-resolver/src/converter/pagination.converter.d.ts +6 -0
- package/types/dynamic-resolver/src/visible-prop-resolver.d.ts +3 -0
- package/types/list-view/src/composition/types.d.ts +1 -1
- package/types/lookup/src/designer/use-lookup-rules.d.ts +3 -0
- package/types/lookup/src/property-config/converters/lookup-property.converter.d.ts +8 -0
- package/types/lookup/src/property-config/lookup.property-config.d.ts +29 -25
- package/types/mapping-editor/src/mapping-editor.props.d.ts +8 -0
- package/types/message-box/index.d.ts +84 -1
- package/types/modal/src/modal.component.d.ts +3 -3
- package/types/modal/src/modal.props.d.ts +3 -5
- package/types/notify/index.d.ts +84 -1
- package/types/page-header/src/page-header.props.d.ts +7 -0
- package/types/page-header/src/property-config/page-header.property-config.d.ts +1 -1
- package/types/property-panel/src/composition/entity/base-property.d.ts +2 -0
- package/types/response-toolbar/index.d.ts +9 -3
- package/types/response-toolbar/src/property-config/response-toolbar-item.property-config.d.ts +1 -1
- package/types/response-toolbar/src/property-config/response-toolbar.property-config.d.ts +1 -1
- package/types/response-toolbar/src/response-toolbar.component.d.ts +4 -2
- package/types/response-toolbar/src/response-toolbar.props.d.ts +9 -2
- package/types/schema-selector/src/composition/types.d.ts +3 -1
- package/types/schema-selector/src/schema-selector-editor.component.d.ts +5 -1
- package/types/tabs/src/designer/tab-toolbar.design.component.d.ts +1 -1
- package/types/tabs/src/tabs.props.d.ts +8 -0
- package/types/tree-grid/src/schema/column-resolver.d.ts +3 -0
- package/components/button-edit/style.css +0 -1
- package/components/designer-canvas/style.css +0 -1
- package/components/external-container/style.css +0 -1
- package/components/field-selector/style.css +0 -1
- package/components/flow-canvas/style.css +0 -1
- package/components/lookup/style.css +0 -1
- package/components/mapping-editor/style.css +0 -1
- package/components/message-box/style.css +0 -1
- package/components/modal/style.css +0 -1
- package/components/schema-selector/style.css +0 -1
- package/components/tabs/style.css +0 -1
- package/components/time-picker/style.css +0 -1
- package/style.css +0 -1
- package/types/tabs/src/designer/tab-toolbar-item.props.d.ts +0 -19
- /package/components/border-editor/{style.css → index.css} +0 -0
- /package/components/checkbox/{style.css → index.css} +0 -0
- /package/components/date-picker/{style.css → index.css} +0 -0
- /package/components/designer-outline/{style.css → index.css} +0 -0
- /package/components/designer-toolbox/{style.css → index.css} +0 -0
- /package/components/discussion-editor/{style.css → index.css} +0 -0
- /package/components/discussion-list/{style.css → index.css} +0 -0
- /package/components/drawer/{style.css → index.css} +0 -0
- /package/components/events-editor/{style.css → index.css} +0 -0
- /package/components/list-view/{style.css → index.css} +0 -0
- /package/components/order/{style.css → index.css} +0 -0
- /package/components/property-editor/{style.css → index.css} +0 -0
- /package/components/property-panel/{style.css → index.css} +0 -0
- /package/components/radio-button/{style.css → index.css} +0 -0
- /package/components/radio-group/{style.css → index.css} +0 -0
- /package/components/smoke-detector/{style.css → index.css} +0 -0
- /package/components/spacing-editor/{style.css → index.css} +0 -0
- /package/components/splitter/{style.css → index.css} +0 -0
- /package/components/switch/{style.css → index.css} +0 -0
- /package/components/transfer/{style.css → index.css} +0 -0
- /package/components/uploader/{style.css → index.css} +0 -0
- /package/components/weather/{style.css → index.css} +0 -0
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { ref as S, onMounted as _, defineComponent as W, createVNode as
|
|
1
|
+
import { ref as S, onMounted as _, defineComponent as W, createVNode as m, withDirectives as j, vShow as z, Teleport as Q, Fragment as Y, inject as U } from "vue";
|
|
2
2
|
import { cloneDeep as K } from "lodash-es";
|
|
3
3
|
const J = {}, Z = {};
|
|
4
4
|
function V(e) {
|
|
5
|
-
const { properties: t, title:
|
|
6
|
-
return o.id = `${
|
|
5
|
+
const { properties: t, title: a } = e, o = Object.keys(t).reduce((s, d) => (s[d] = t[d].type === "object" && t[d].properties ? V(t[d]) : K(t[d].default), s), {});
|
|
6
|
+
return o.id = `${a}-${Date.now()}`, o;
|
|
7
7
|
}
|
|
8
8
|
function M(e, t = {}) {
|
|
9
|
-
const
|
|
10
|
-
if (
|
|
11
|
-
let o = V(
|
|
9
|
+
const a = J[e];
|
|
10
|
+
if (a) {
|
|
11
|
+
let o = V(a);
|
|
12
12
|
const s = Z[e];
|
|
13
13
|
return o = s ? s({ getSchemaByType: M }, o, t) : o, o;
|
|
14
14
|
}
|
|
15
15
|
return null;
|
|
16
16
|
}
|
|
17
17
|
function P(e, t) {
|
|
18
|
-
const
|
|
19
|
-
return Object.keys(e).reduce((o, s) => (o[s] = e[s], o),
|
|
18
|
+
const a = V(t);
|
|
19
|
+
return Object.keys(e).reduce((o, s) => (o[s] = e[s], o), a), a;
|
|
20
20
|
}
|
|
21
21
|
function I(e, t) {
|
|
22
22
|
return Object.keys(e).filter((o) => e[o] != null).reduce((o, s) => {
|
|
@@ -33,40 +33,40 @@ function I(e, t) {
|
|
|
33
33
|
return o;
|
|
34
34
|
}, {});
|
|
35
35
|
}
|
|
36
|
-
function ee(e, t,
|
|
36
|
+
function ee(e, t, a = /* @__PURE__ */ new Map()) {
|
|
37
37
|
const o = P(e, t);
|
|
38
|
-
return I(o,
|
|
38
|
+
return I(o, a);
|
|
39
39
|
}
|
|
40
40
|
function te(e = {}) {
|
|
41
|
-
function t(r,
|
|
41
|
+
function t(r, l, i, u) {
|
|
42
42
|
if (typeof i == "number")
|
|
43
43
|
return u[r].length === i;
|
|
44
44
|
if (typeof i == "object") {
|
|
45
|
-
const b = Object.keys(i)[0],
|
|
45
|
+
const b = Object.keys(i)[0], y = i[b];
|
|
46
46
|
if (b === "not")
|
|
47
|
-
return Number(u[r].length) !== Number(
|
|
47
|
+
return Number(u[r].length) !== Number(y);
|
|
48
48
|
if (b === "moreThan")
|
|
49
|
-
return Number(u[r].length) >= Number(
|
|
49
|
+
return Number(u[r].length) >= Number(y);
|
|
50
50
|
if (b === "lessThan")
|
|
51
|
-
return Number(u[r].length) <= Number(
|
|
51
|
+
return Number(u[r].length) <= Number(y);
|
|
52
52
|
}
|
|
53
53
|
return !1;
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function a(r, l, i, u) {
|
|
56
56
|
return u[r] && u[r].propertyValue && String(u[r].propertyValue.value) === String(i);
|
|
57
57
|
}
|
|
58
58
|
const o = /* @__PURE__ */ new Map([
|
|
59
59
|
["length", t],
|
|
60
|
-
["getProperty",
|
|
60
|
+
["getProperty", a]
|
|
61
61
|
]);
|
|
62
|
-
Object.keys(e).reduce((r,
|
|
63
|
-
function s(r,
|
|
62
|
+
Object.keys(e).reduce((r, l) => (r.set(l, e[l]), r), o);
|
|
63
|
+
function s(r, l) {
|
|
64
64
|
const i = r;
|
|
65
|
-
return typeof
|
|
65
|
+
return typeof l == "number" ? [{ target: i, operator: "length", param: null, value: Number(l) }] : typeof l == "boolean" ? [{ target: i, operator: "getProperty", param: r, value: !!l }] : typeof l == "object" ? Object.keys(l).map((u) => {
|
|
66
66
|
if (u === "length")
|
|
67
|
-
return { target: i, operator: "length", param: null, value:
|
|
68
|
-
const b = u,
|
|
69
|
-
return { target: i, operator: "getProperty", param: b, value:
|
|
67
|
+
return { target: i, operator: "length", param: null, value: l[u] };
|
|
68
|
+
const b = u, y = l[u];
|
|
69
|
+
return { target: i, operator: "getProperty", param: b, value: y };
|
|
70
70
|
}) : [];
|
|
71
71
|
}
|
|
72
72
|
function d(r) {
|
|
@@ -75,39 +75,39 @@ function te(e = {}) {
|
|
|
75
75
|
return i.push(...b), i;
|
|
76
76
|
}, []);
|
|
77
77
|
}
|
|
78
|
-
function g(r,
|
|
78
|
+
function g(r, l) {
|
|
79
79
|
if (o.has(r.operator)) {
|
|
80
80
|
const i = o.get(r.operator);
|
|
81
|
-
return i && i(r.target, r.param, r.value,
|
|
81
|
+
return i && i(r.target, r.param, r.value, l) || !1;
|
|
82
82
|
}
|
|
83
83
|
return !1;
|
|
84
84
|
}
|
|
85
|
-
function p(r,
|
|
86
|
-
return d(r).reduce((b,
|
|
85
|
+
function p(r, l) {
|
|
86
|
+
return d(r).reduce((b, y) => b && g(y, l), !0);
|
|
87
87
|
}
|
|
88
|
-
function k(r,
|
|
89
|
-
const i = Object.keys(r), u = i.includes("allOf"), b = i.includes("anyOf"),
|
|
88
|
+
function k(r, l) {
|
|
89
|
+
const i = Object.keys(r), u = i.includes("allOf"), b = i.includes("anyOf"), y = u || b, c = (y ? r[y ? u ? "allOf" : "anyOf" : "allOf"] : [r]).map((B) => p(B, l));
|
|
90
90
|
return u ? !c.includes(!1) : c.includes(!0);
|
|
91
91
|
}
|
|
92
92
|
return { parseValueSchema: k };
|
|
93
93
|
}
|
|
94
94
|
const ne = {}, oe = {};
|
|
95
95
|
te();
|
|
96
|
-
function re(e, t,
|
|
96
|
+
function re(e, t, a = /* @__PURE__ */ new Map(), o = (g, p, k) => p, s = {}, d = (g) => g) {
|
|
97
97
|
return J[t.title] = t, Z[t.title] = o, ne[t.title] = s, oe[t.title] = d, (g = {}) => {
|
|
98
|
-
const p = ee(g, t,
|
|
98
|
+
const p = ee(g, t, a), k = Object.keys(e).reduce((r, l) => (r[l] = e[l].default, r), {});
|
|
99
99
|
return Object.assign(k, p);
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
102
|
function ie(e, t) {
|
|
103
103
|
return { customClass: t.class, customStyle: t.style };
|
|
104
104
|
}
|
|
105
|
-
function se(e, t,
|
|
105
|
+
function se(e, t, a) {
|
|
106
106
|
return t;
|
|
107
107
|
}
|
|
108
|
-
const
|
|
108
|
+
const ae = /* @__PURE__ */ new Map([
|
|
109
109
|
["appearance", ie]
|
|
110
|
-
]),
|
|
110
|
+
]), le = "https://json-schema.org/draft/2020-12/schema", ce = "https://farris-design.gitee.io/dropdown.schema.json", ue = "dropdown", de = "A Farris Component", fe = "object", pe = {
|
|
111
111
|
id: {
|
|
112
112
|
description: "The unique identifier for dropdown",
|
|
113
113
|
type: "string"
|
|
@@ -173,7 +173,7 @@ const le = /* @__PURE__ */ new Map([
|
|
|
173
173
|
"id",
|
|
174
174
|
"type"
|
|
175
175
|
], ye = {
|
|
176
|
-
$schema:
|
|
176
|
+
$schema: le,
|
|
177
177
|
$id: ce,
|
|
178
178
|
title: ue,
|
|
179
179
|
description: de,
|
|
@@ -268,12 +268,12 @@ const le = /* @__PURE__ */ new Map([
|
|
|
268
268
|
},
|
|
269
269
|
onSelect: { type: Function, default: () => {
|
|
270
270
|
} }
|
|
271
|
-
}, X = re(C, ye,
|
|
271
|
+
}, X = re(C, ye, ae, se, ve);
|
|
272
272
|
function x(e, t) {
|
|
273
|
-
let
|
|
273
|
+
let a;
|
|
274
274
|
const o = S(e.show), s = S(), d = S(), g = S(), p = 10;
|
|
275
275
|
_(() => {
|
|
276
|
-
|
|
276
|
+
a = d.value;
|
|
277
277
|
});
|
|
278
278
|
const k = (c = 1) => {
|
|
279
279
|
const n = [
|
|
@@ -319,10 +319,10 @@ function x(e, t) {
|
|
|
319
319
|
window.innerHeight - H - T < v && (H = h - v, H < 0 && (window.innerHeight - h - B > h ? (H = h + B, O = window.innerHeight - H - T - p) : (H = p, O = h - H - T))), window.innerWidth - D < w && window.innerWidth - D < D + f && (q = D - w + f), document.body.append(n), n.style.cssText = `position:fixed;bottom:unset;left:${q}px
|
|
320
320
|
!important;top:${H}px !important;right: unset;${O ? "max-height:" + O + "px;overflow-y:auto;" : ""}`, O && (n.className += " dropdown-menu-maxheight"), n.style.zIndex = k().toString();
|
|
321
321
|
}
|
|
322
|
-
},
|
|
322
|
+
}, l = () => {
|
|
323
323
|
r(s.value, d.value);
|
|
324
324
|
}, i = () => {
|
|
325
|
-
e.hover || (o.value = !1, document.removeEventListener("click", i),
|
|
325
|
+
e.hover || (o.value = !1, document.removeEventListener("click", i), a.removeEventListener("click", i), document.removeEventListener("scroll", i), a.removeEventListener("scroll", i));
|
|
326
326
|
};
|
|
327
327
|
return {
|
|
328
328
|
show: o,
|
|
@@ -331,10 +331,10 @@ function x(e, t) {
|
|
|
331
331
|
clickEventRef: g,
|
|
332
332
|
showDropMenu: (c) => {
|
|
333
333
|
e.hover || e.disabled || (c == null || c.stopPropagation(), o.value || setTimeout(() => {
|
|
334
|
-
|
|
335
|
-
}), o.value = !o.value, document.addEventListener("click", i), document.addEventListener("scroll", i), e.hideOnClick || (
|
|
334
|
+
l();
|
|
335
|
+
}), o.value = !o.value, document.addEventListener("click", i), document.addEventListener("scroll", i), e.hideOnClick || (a.addEventListener("click", (n) => {
|
|
336
336
|
n.stopPropagation();
|
|
337
|
-
}),
|
|
337
|
+
}), a.addEventListener("scroll", (n) => {
|
|
338
338
|
n.stopPropagation();
|
|
339
339
|
})));
|
|
340
340
|
},
|
|
@@ -370,15 +370,15 @@ const Se = {
|
|
|
370
370
|
props: Se,
|
|
371
371
|
emits: ["select"],
|
|
372
372
|
setup(e, t) {
|
|
373
|
-
const
|
|
373
|
+
const a = S(e.value), o = S(e.label), s = S(e.disabled), d = S(e.active), g = S(e.divide), p = () => {
|
|
374
374
|
s.value || t.emit("select", e);
|
|
375
375
|
};
|
|
376
|
-
return () =>
|
|
376
|
+
return () => m("div", null, [j(m("div", {
|
|
377
377
|
class: "dropdown-divider"
|
|
378
|
-
}, null), [[z, g.value]]),
|
|
378
|
+
}, null), [[z, g.value]]), m("li", {
|
|
379
379
|
class: `dropdown-item${d.value ? " active" : ""} ${s.value ? " disabled" : ""}`,
|
|
380
380
|
onClick: p,
|
|
381
|
-
title:
|
|
381
|
+
title: a.value.toString()
|
|
382
382
|
}, [o.value])]);
|
|
383
383
|
}
|
|
384
384
|
}), F = /* @__PURE__ */ W({
|
|
@@ -386,7 +386,7 @@ const Se = {
|
|
|
386
386
|
props: C,
|
|
387
387
|
emits: ["select"],
|
|
388
388
|
setup(e, t) {
|
|
389
|
-
const
|
|
389
|
+
const a = S(e.model), {
|
|
390
390
|
show: o,
|
|
391
391
|
dropdownMenuRef: s,
|
|
392
392
|
dropdownRef: d,
|
|
@@ -394,16 +394,16 @@ const Se = {
|
|
|
394
394
|
showDropMenu: p,
|
|
395
395
|
hoverDropdown: k,
|
|
396
396
|
leftButtonClick: r,
|
|
397
|
-
closeDropMenu:
|
|
397
|
+
closeDropMenu: l,
|
|
398
398
|
selectItem: i,
|
|
399
399
|
resolveSize: u
|
|
400
400
|
} = x(e, t);
|
|
401
|
-
function b(
|
|
402
|
-
t.emit("select",
|
|
401
|
+
function b(y) {
|
|
402
|
+
t.emit("select", y);
|
|
403
403
|
}
|
|
404
|
-
return () =>
|
|
404
|
+
return () => m("div", {
|
|
405
405
|
ref: d
|
|
406
|
-
}, [
|
|
406
|
+
}, [m("div", {
|
|
407
407
|
class: ["farris-dropdown", "btn-group", {
|
|
408
408
|
dropup: e.position === "top"
|
|
409
409
|
}, {
|
|
@@ -413,7 +413,7 @@ const Se = {
|
|
|
413
413
|
}, {
|
|
414
414
|
dropright: e.position === "right"
|
|
415
415
|
}]
|
|
416
|
-
}, [e.splitButton &&
|
|
416
|
+
}, [e.splitButton && m("span", {
|
|
417
417
|
class: ["btn", {
|
|
418
418
|
"dropdown-item": e.nest
|
|
419
419
|
}, {
|
|
@@ -433,7 +433,7 @@ const Se = {
|
|
|
433
433
|
}],
|
|
434
434
|
style: "width:100%",
|
|
435
435
|
onClick: r
|
|
436
|
-
}, [e.title]),
|
|
436
|
+
}, [e.title]), m("span", {
|
|
437
437
|
ref: g,
|
|
438
438
|
class: ["dropdown-toggle", {
|
|
439
439
|
btn: !e.nest
|
|
@@ -466,25 +466,25 @@ const Se = {
|
|
|
466
466
|
onClick: p,
|
|
467
467
|
onMouseenter: k,
|
|
468
468
|
onMouseleave: k
|
|
469
|
-
}, [j(
|
|
469
|
+
}, [j(m("span", {
|
|
470
470
|
class: "sr-only"
|
|
471
|
-
}, null), [[z, e.splitButton]]), e.splitButton ? "" : e.title, j(
|
|
471
|
+
}, null), [[z, e.splitButton]]), e.splitButton ? "" : e.title, j(m("span", {
|
|
472
472
|
class: `f-icon ${e.iconClass.toString()}`
|
|
473
|
-
}, null), [[z, e.iconClass]])]),
|
|
473
|
+
}, null), [[z, e.iconClass]])]), m(Q, {
|
|
474
474
|
to: "body"
|
|
475
475
|
}, {
|
|
476
|
-
default: () => [
|
|
476
|
+
default: () => [m("div", {
|
|
477
477
|
ref: s,
|
|
478
478
|
class: `dropdown-menu${o.value ? " show" : ""}`
|
|
479
|
-
}, [
|
|
480
|
-
label:
|
|
479
|
+
}, [m(Y, null, [a.value.map(({
|
|
480
|
+
label: y,
|
|
481
481
|
value: $,
|
|
482
482
|
disabled: R,
|
|
483
483
|
active: c,
|
|
484
484
|
divide: n
|
|
485
|
-
}) =>
|
|
485
|
+
}) => m(G, {
|
|
486
486
|
value: $.toString(),
|
|
487
|
-
label:
|
|
487
|
+
label: y,
|
|
488
488
|
disabled: R,
|
|
489
489
|
active: c,
|
|
490
490
|
divide: n,
|
|
@@ -493,7 +493,7 @@ const Se = {
|
|
|
493
493
|
})])]);
|
|
494
494
|
}
|
|
495
495
|
});
|
|
496
|
-
function De(e, t,
|
|
496
|
+
function De(e, t, a) {
|
|
497
497
|
var h;
|
|
498
498
|
function o() {
|
|
499
499
|
}
|
|
@@ -507,7 +507,7 @@ function De(e, t, l) {
|
|
|
507
507
|
function r() {
|
|
508
508
|
return (t == null ? void 0 : t.schema.componentType) !== "frame";
|
|
509
509
|
}
|
|
510
|
-
function
|
|
510
|
+
function l() {
|
|
511
511
|
return (t == null ? void 0 : t.schema.componentType) === "frame";
|
|
512
512
|
}
|
|
513
513
|
function i(f) {
|
|
@@ -523,9 +523,9 @@ function De(e, t, l) {
|
|
|
523
523
|
return !w || !w.value ? null : w.value.canMove ? v : u(f.parent);
|
|
524
524
|
}
|
|
525
525
|
function b(f) {
|
|
526
|
-
return !!
|
|
526
|
+
return !!a;
|
|
527
527
|
}
|
|
528
|
-
function
|
|
528
|
+
function y() {
|
|
529
529
|
return (t == null ? void 0 : t.schema.label) || (t == null ? void 0 : t.schema.title) || (t == null ? void 0 : t.schema.name);
|
|
530
530
|
}
|
|
531
531
|
function $() {
|
|
@@ -553,7 +553,7 @@ function De(e, t, l) {
|
|
|
553
553
|
canMove: p(),
|
|
554
554
|
canSelectParent: k(),
|
|
555
555
|
canDelete: r(),
|
|
556
|
-
canNested: !
|
|
556
|
+
canNested: !l(),
|
|
557
557
|
contents: t == null ? void 0 : t.schema.contents,
|
|
558
558
|
elementRef: e,
|
|
559
559
|
parent: (h = t == null ? void 0 : t.parent) == null ? void 0 : h.componentInstance,
|
|
@@ -563,7 +563,7 @@ function De(e, t, l) {
|
|
|
563
563
|
canAccepts: b,
|
|
564
564
|
getBelongedComponentInstance: i,
|
|
565
565
|
getDraggableDesignItemElement: u,
|
|
566
|
-
getDraggingDisplayText:
|
|
566
|
+
getDraggingDisplayText: y,
|
|
567
567
|
getPropConfig: D,
|
|
568
568
|
getDragScopeElement: $,
|
|
569
569
|
onAcceptMovedChildElement: R,
|
|
@@ -580,7 +580,7 @@ const Be = /* @__PURE__ */ W({
|
|
|
580
580
|
props: C,
|
|
581
581
|
emits: ["select"],
|
|
582
582
|
setup(e, t) {
|
|
583
|
-
const
|
|
583
|
+
const a = S(e.model), {
|
|
584
584
|
show: o,
|
|
585
585
|
showDropMenu: s,
|
|
586
586
|
hoverDropdown: d,
|
|
@@ -589,15 +589,15 @@ const Be = /* @__PURE__ */ W({
|
|
|
589
589
|
selectItem: k,
|
|
590
590
|
resolveSize: r
|
|
591
591
|
} = x(e, t);
|
|
592
|
-
function
|
|
593
|
-
|
|
592
|
+
function l(y) {
|
|
593
|
+
t.emit("select", y);
|
|
594
594
|
}
|
|
595
595
|
const i = S(), u = U("design-item-context"), b = De(i, u);
|
|
596
596
|
return _(() => {
|
|
597
597
|
i.value.componentInstance = b;
|
|
598
|
-
}), t.expose(b.value), () =>
|
|
598
|
+
}), t.expose(b.value), () => m("div", {
|
|
599
599
|
ref: i
|
|
600
|
-
}, [
|
|
600
|
+
}, [m("div", {
|
|
601
601
|
class: ["farris-dropdown", "btn-group", {
|
|
602
602
|
dropup: e.position === "top"
|
|
603
603
|
}, {
|
|
@@ -610,7 +610,7 @@ const Be = /* @__PURE__ */ W({
|
|
|
610
610
|
style: {
|
|
611
611
|
width: e.width
|
|
612
612
|
}
|
|
613
|
-
}, [e.splitButton &&
|
|
613
|
+
}, [e.splitButton && m("span", {
|
|
614
614
|
class: ["btn", {
|
|
615
615
|
"dropdown-item": e.nest
|
|
616
616
|
}, {
|
|
@@ -630,7 +630,7 @@ const Be = /* @__PURE__ */ W({
|
|
|
630
630
|
}],
|
|
631
631
|
style: "width:100%",
|
|
632
632
|
onClick: g
|
|
633
|
-
}, [e.title]),
|
|
633
|
+
}, [e.title]), m("span", {
|
|
634
634
|
class: ["dropdown-toggle", {
|
|
635
635
|
btn: !e.nest
|
|
636
636
|
}, {
|
|
@@ -662,35 +662,35 @@ const Be = /* @__PURE__ */ W({
|
|
|
662
662
|
onClick: s,
|
|
663
663
|
onMouseenter: d,
|
|
664
664
|
onMouseleave: d
|
|
665
|
-
}, [j(
|
|
665
|
+
}, [j(m("span", {
|
|
666
666
|
class: "sr-only"
|
|
667
|
-
}, null), [[z, e.splitButton]]), e.splitButton ? "" : e.title, j(
|
|
667
|
+
}, null), [[z, e.splitButton]]), e.splitButton ? "" : e.title, j(m("span", {
|
|
668
668
|
class: `f-icon ${e.iconClass.toString()}`
|
|
669
|
-
}, null), [[z, e.iconClass]])]),
|
|
669
|
+
}, null), [[z, e.iconClass]])]), m("div", {
|
|
670
670
|
class: `dropdown-menu${o.value ? " show" : ""}`
|
|
671
|
-
}, [
|
|
672
|
-
label:
|
|
671
|
+
}, [m(Y, null, [a.value.map(({
|
|
672
|
+
label: y,
|
|
673
673
|
value: $,
|
|
674
674
|
disabled: R,
|
|
675
675
|
active: c,
|
|
676
676
|
divide: n
|
|
677
|
-
}) =>
|
|
677
|
+
}) => m(G, {
|
|
678
678
|
value: $.toString(),
|
|
679
|
-
label:
|
|
679
|
+
label: y,
|
|
680
680
|
disabled: R,
|
|
681
681
|
active: c,
|
|
682
682
|
divide: n,
|
|
683
|
-
onSelect: (B) =>
|
|
683
|
+
onSelect: (B) => l(B)
|
|
684
684
|
}, null))])])])]);
|
|
685
685
|
}
|
|
686
686
|
}), $e = {
|
|
687
687
|
install(e) {
|
|
688
688
|
e.component(F.name, F);
|
|
689
689
|
},
|
|
690
|
-
register(e, t,
|
|
690
|
+
register(e, t, a, o) {
|
|
691
691
|
e.dropdown = F, t.dropdown = X;
|
|
692
692
|
},
|
|
693
|
-
registerDesigner(e, t,
|
|
693
|
+
registerDesigner(e, t, a) {
|
|
694
694
|
e.dropdown = Be, t.dropdown = X;
|
|
695
695
|
}
|
|
696
696
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
(function(B,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue"),require("lodash-es")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es"],n):(B=typeof globalThis<"u"?globalThis:B||self,n(B.dropdown={},B.Vue,B.LodashES))})(this,function(B,n,Y){"use strict";const W={},C={};function M(e){const{properties:t,title:l}=e,r=Object.keys(t).reduce((a,u)=>(a[u]=t[u].type==="object"&&t[u].properties?M(t[u]):Y.cloneDeep(t[u].default),a),{});return r.id=`${l}-${Date.now()}`,r}function F(e,t={}){const l=W[e];if(l){let r=M(l);const a=C[e];return r=a?a({getSchemaByType:F},r,t):r,r}return null}function J(e,t){const l=M(t);return Object.keys(e).reduce((r,a)=>(r[a]=e[a],r),l),l}function Z(e,t){return Object.keys(e).filter(r=>e[r]!=null).reduce((r,a)=>{if(t.has(a)){const u=t.get(a);if(typeof u=="string")r[u]=e[a];else{const g=u(a,e[a],e);Object.assign(r,g)}}else r[a]=e[a];return r},{})}function G(e,t,l=new Map){const r=J(e,t);return Z(r,l)}function Q(e={}){function t(i,c,s,f){if(typeof s=="number")return f[i].length===s;if(typeof s=="object"){const b=Object.keys(s)[0],y=s[b];if(b==="not")return Number(f[i].length)!==Number(y);if(b==="moreThan")return Number(f[i].length)>=Number(y);if(b==="lessThan")return Number(f[i].length)<=Number(y)}return!1}function l(i,c,s,f){return f[i]&&f[i].propertyValue&&String(f[i].propertyValue.value)===String(s)}const r=new Map([["length",t],["getProperty",l]]);Object.keys(e).reduce((i,c)=>(i.set(c,e[c]),i),r);function a(i,c){const s=i;return typeof c=="number"?[{target:s,operator:"length",param:null,value:Number(c)}]:typeof c=="boolean"?[{target:s,operator:"getProperty",param:i,value:!!c}]:typeof c=="object"?Object.keys(c).map(f=>{if(f==="length")return{target:s,operator:"length",param:null,value:c[f]};const b=f,y=c[f];return{target:s,operator:"getProperty",param:b,value:y}}):[]}function u(i){return Object.keys(i).reduce((s,f)=>{const b=a(f,i[f]);return s.push(...b),s},[])}function g(i,c){if(r.has(i.operator)){const s=r.get(i.operator);return s&&s(i.target,i.param,i.value,c)||!1}return!1}function m(i,c){return u(i).reduce((b,y)=>b&&g(y,c),!0)}function N(i,c){const s=Object.keys(i),f=s.includes("allOf"),b=s.includes("anyOf"),y=f||b,d=(y?i[y?f?"allOf":"anyOf":"allOf"]:[i]).map(D=>m(D,c));return f?!d.includes(!1):d.includes(!0)}return{parseValueSchema:N}}const U={},x={};Q();function P(e,t,l=new Map,r=(g,m,N)=>m,a={},u=g=>g){return W[t.title]=t,C[t.title]=r,U[t.title]=a,x[t.title]=u,(g={})=>{const m=G(g,t,l),N=Object.keys(e).reduce((i,c)=>(i[c]=e[c].default,i),{});return Object.assign(N,m)}}function K(e,t){return{customClass:t.class,customStyle:t.style}}function I(e,t,l){return t}const ee=new Map([["appearance",K]]),te={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/dropdown.schema.json",title:"dropdown",description:"A Farris Component",type:"object",properties:{id:{description:"The unique identifier for dropdown",type:"string"},type:{description:"The type string of dropdown",type:"string",default:"dropdown"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},disable:{type:"string",default:!1},editable:{description:"",type:"boolean",default:!0},placeholder:{description:"",type:"string",default:""},readonly:{description:"",type:"boolean",default:!1},require:{description:"",type:"boolean",default:!1},tabindex:{description:"",type:"number",default:-1},visible:{description:"",type:"boolean",default:!0}},required:["id","type"]},ne={title:"dropdown",description:"A Farris Component",type:"object",categories:{basic:{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"waiting for modification",enum:[]}}}},behavior:{description:"Basic Infomation",title:"行为",properties:{readonly:{description:"",title:"只读",type:"string"},required:{description:"",title:"必填",type:"boolean"},visible:{description:"",title:"可见",type:"boolean"},placeholder:{description:"",title:"提示文本",type:"string"},tabindex:{description:"",title:"tab索引",type:"number"}}}}},j={show:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},title:{type:String,default:"下拉示例"},size:{type:String,default:""},type:{type:String,default:"primary"},iconClass:{type:String,default:""},active:{type:Boolean,default:!1},splitButton:{type:Boolean,default:!1},position:{type:String,default:"bottom"},model:{type:Array,default:[{label:"项目一",value:"XM1"},{label:"项目二",value:"XM2"},{label:"项目三",value:"XM3"}]},onSelect:{type:Function,default:()=>{}}},z=P(j,te,ee,I,ne);function q(e,t){let l;const r=n.ref(e.show),a=n.ref(),u=n.ref(),g=n.ref(),m=10;n.onMounted(()=>{l=u.value});const N=(d=1)=>{const o=["body>.f-datagrid-settings-simple-host","body>div","body>farris-dialog>.farris-modal.show","body>.farris-modal.show","body>farris-filter-panel>.f-filter-panel-wrapper","body .f-sidebar-show>.f-sidebar-main","body>.popover.show","body>filter-row-panel>.f-datagrid-filter-panel","body>.f-section-maximize"],D=Array.from(document.body.querySelectorAll(o.join(","))).filter(w=>w).map(w=>{const{display:p,zIndex:h}=window.getComputedStyle(w);return p==="none"?0:parseInt(h,10)}).filter(w=>w);let S=Math.max(...D);return S<1040&&(S=1040),S+d},i=(d,o)=>{const{height:D,left:S,top:w,width:p}=d.getBoundingClientRect(),{width:h,height:v,top:O}=o.getBoundingClientRect();if(d.className.indexOf("dropdown-submenu")>-1||d.closest(".dropdown-submenu")||d.classList.contains("dropright")){const V=window.innerWidth-S-d.offsetWidth,R=window.innerHeight-w,{position:H}=getComputedStyle(o);if(H==="fixed"){let k=S+d.offsetWidth;o.offsetWidth>V&&S>V&&(k=S-h),o.style.left=k+"px",o.style.right="auto",window.innerHeight-2*m<o.offsetHeight?(o.style.top=m+"px",o.style.bottom=m+"px",o.style.maxHeight=window.innerHeight-2*m+"px",o.style.overflowY="auto",o.className+=" dropdown-menu-maxheight"):R<o.offsetHeight?(o.style.top="auto",o.style.bottom=m+"px"):(o.style.top=w+"px",o.style.bottom="auto")}else{if(o.offsetWidth>V){const k=-h;o.style.left=k+"px"}window.innerHeight-2*m<o.offsetHeight?(o.style.top=-1*(w-m)+"px",o.style.bottom="auto",o.style.maxHeight=window.innerHeight-2*m+"px",o.style.overflowY="auto",o.className+=" dropdown-menu-maxheight"):R<o.offsetHeight&&(o.style.top=R-o.offsetHeight-m+"px",o.style.bottom="auto")}}else{const{marginTop:V,marginBottom:R}=getComputedStyle(o);let H=0;const k=Math.ceil(parseFloat(V))+Math.ceil(parseFloat(R));let E=w+D,X=S;window.innerHeight-E-k<v&&(E=w-v,E<0&&(window.innerHeight-w-D>w?(E=w+D,H=window.innerHeight-E-k-m):(E=m,H=w-E-k))),window.innerWidth-S<h&&window.innerWidth-S<S+p&&(X=S-h+p),document.body.append(o),o.style.cssText=`position:fixed;bottom:unset;left:${X}px
|
|
2
|
-
!important;top:${E}px !important;right: unset;${H?"max-height:"+H+"px;overflow-y:auto;":""}`,H&&(o.className+=" dropdown-menu-maxheight"),o.style.zIndex=N().toString()}},c=()=>{i(a.value,u.value)},s=()=>{e.hover||(r.value=!1,document.removeEventListener("click",s),l.removeEventListener("click",s),document.removeEventListener("scroll",s),l.removeEventListener("scroll",s))};return{show:r,dropdownRef:a,dropdownMenuRef:u,clickEventRef:g,showDropMenu:d=>{e.hover||e.disabled||(d==null||d.stopPropagation(),r.value||setTimeout(()=>{c()}),r.value=!r.value,document.addEventListener("click",s),document.addEventListener("scroll",s),e.hideOnClick||(l.addEventListener("click",o=>{o.stopPropagation()}),l.addEventListener("scroll",o=>{o.stopPropagation()})))},hoverDropdown:d=>{e.hover&&(r.value||setTimeout(()=>{}),r.value=!r.value)},leftButtonClick:()=>{},closeDropMenu:s,selectItem:d=>{t.emit("select",d)},resolveSize:d=>{const o=/px|em|rem|pt|%/;return o.test(d)?`${parseInt(d,10)}${d.match(o)[0]}`:`${d}px`}}}const oe={label:{type:String,default:"XM1"},value:{type:String||Number,default:"项目一"},disabled:{type:Boolean,default:!1},active:{type:Boolean,default:!1},divide:{type:Boolean,default:!1},onSelect:{type:Function,default:()=>{}}},_=n.defineComponent({name:"FDropdownItem",props:oe,emits:["select"],setup(e,t){const l=n.ref(e.value),r=n.ref(e.label),a=n.ref(e.disabled),u=n.ref(e.active),g=n.ref(e.divide),m=()=>{a.value||t.emit("select",e)};return()=>n.createVNode("div",null,[n.withDirectives(n.createVNode("div",{class:"dropdown-divider"},null),[[n.vShow,g.value]]),n.createVNode("li",{class:`dropdown-item${u.value?" active":""} ${a.value?" disabled":""}`,onClick:m,title:l.value.toString()},[r.value])])}}),L=n.defineComponent({name:"FDropdown",props:j,emits:["select"],setup(e,t){const l=n.ref(e.model),{show:r,dropdownMenuRef:a,dropdownRef:u,clickEventRef:g,showDropMenu:m,hoverDropdown:N,leftButtonClick:i,closeDropMenu:c,selectItem:s,resolveSize:f}=q(e,t);function b(y){t.emit("select",y)}return()=>n.createVNode("div",{ref:u},[n.createVNode("div",{class:["farris-dropdown","btn-group",{dropup:e.position==="top"},{dropdown:e.position==="bottom"},{dropleft:e.position==="left"},{dropright:e.position==="right"}]},[e.splitButton&&n.createVNode("span",{class:["btn",{"dropdown-item":e.nest},{"btn-lg":e.size==="large"},{"btn-sm":e.size==="small"},{"btn-primary":e.type==="primary"},{"btn-success":e.type==="success"},{"btn-warning":e.type==="warning"},{"btn-danger":e.type==="danger"},{"btn-info":e.type==="info"}],style:"width:100%",onClick:i},[e.title]),n.createVNode("span",{ref:g,class:["dropdown-toggle",{btn:!e.nest},{"dropdown-item":e.nest},{"dropdown-toggle-split":e.splitButton},{"btn-lg":e.size==="large"},{"btn-sm":e.size==="small"},{"btn-primary":e.type==="primary"},{"btn-success":e.type==="success"},{"btn-warning":e.type==="warning"},{"btn-danger":e.type==="danger"},{"btn-info":e.type==="info"},{"btn-secondary":e.type==="secondary"},{"btn-link":e.type==="link"},{disabled:e.disabled}],style:"width:100%",onClick:m,onMouseenter:N,onMouseleave:N},[n.withDirectives(n.createVNode("span",{class:"sr-only"},null),[[n.vShow,e.splitButton]]),e.splitButton?"":e.title,n.withDirectives(n.createVNode("span",{class:`f-icon ${e.iconClass.toString()}`},null),[[n.vShow,e.iconClass]])]),n.createVNode(n.Teleport,{to:"body"},{default:()=>[n.createVNode("div",{ref:a,class:`dropdown-menu${r.value?" show":""}`},[n.createVNode(n.Fragment,null,[l.value.map(({label:y,value:$,disabled:T,active:d,divide:o})=>n.createVNode(_,{value:$.toString(),label:y,disabled:T,active:d,divide:o,onSelect:D=>b(D)},null))])])]})])])}});function re(e,t,l){var w;function r(){}const a="",u="",g=n.ref();function m(){return(t==null?void 0:t.schema.componentType)!=="frame"}function N(){return!1}function i(){return(t==null?void 0:t.schema.componentType)!=="frame"}function c(){return(t==null?void 0:t.schema.componentType)==="frame"}function s(p){if(!p||!p.value)return null;if(p.value.schema&&p.value.schema.type==="component")return p.value;const h=n.ref(p==null?void 0:p.value.parent),v=s(h);return v||null}function f(p=t){const{componentInstance:h,designerItemElementRef:v}=p;return!h||!h.value?null:h.value.canMove?v:f(p.parent)}function b(p){return!!l}function y(){return(t==null?void 0:t.schema.label)||(t==null?void 0:t.schema.title)||(t==null?void 0:t.schema.name)}function $(){}function T(p,h){}function d(p){const{componentType:h}=p;let v=F(h,p);const O=h.toLowerCase().replace("-","_");return v&&!v.id&&v.type===h&&(v.id=`${O}_${Math.random().toString().slice(2,6)}`),v}function o(p,h){const v=String(p.getAttribute("data-controltype")),O=p.getAttribute("data-feature"),A=O?JSON.parse(O):{};A.parentComponentInstance=g.value;let V=F(v,A);const R=v.toLowerCase().replace("-","_");return V&&!V.id&&V.type===v&&(V.id=`${R}_${Math.random().toString().slice(2,6)}`),V}function D(p){}function S(...p){}return g.value={canMove:m(),canSelectParent:N(),canDelete:i(),canNested:!c(),contents:t==null?void 0:t.schema.contents,elementRef:e,parent:(w=t==null?void 0:t.parent)==null?void 0:w.componentInstance,schema:t==null?void 0:t.schema,styles:a,designerClass:u,canAccepts:b,getBelongedComponentInstance:s,getDraggableDesignItemElement:f,getDraggingDisplayText:y,getPropConfig:S,getDragScopeElement:$,onAcceptMovedChildElement:T,onAcceptNewChildElement:o,onChildElementMovedOut:D,addNewChildComponentSchema:d,updateDragAndDropRules:r,triggerBelongedComponentToMoveWhenMoved:n.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:n.ref(!1)},g}const ie=n.defineComponent({name:"FDropdownDesign",props:j,emits:["select"],setup(e,t){const l=n.ref(e.model),{show:r,showDropMenu:a,hoverDropdown:u,leftButtonClick:g,closeDropMenu:m,selectItem:N,resolveSize:i}=q(e,t);function c(y){
|
|
2
|
+
!important;top:${E}px !important;right: unset;${H?"max-height:"+H+"px;overflow-y:auto;":""}`,H&&(o.className+=" dropdown-menu-maxheight"),o.style.zIndex=N().toString()}},c=()=>{i(a.value,u.value)},s=()=>{e.hover||(r.value=!1,document.removeEventListener("click",s),l.removeEventListener("click",s),document.removeEventListener("scroll",s),l.removeEventListener("scroll",s))};return{show:r,dropdownRef:a,dropdownMenuRef:u,clickEventRef:g,showDropMenu:d=>{e.hover||e.disabled||(d==null||d.stopPropagation(),r.value||setTimeout(()=>{c()}),r.value=!r.value,document.addEventListener("click",s),document.addEventListener("scroll",s),e.hideOnClick||(l.addEventListener("click",o=>{o.stopPropagation()}),l.addEventListener("scroll",o=>{o.stopPropagation()})))},hoverDropdown:d=>{e.hover&&(r.value||setTimeout(()=>{}),r.value=!r.value)},leftButtonClick:()=>{},closeDropMenu:s,selectItem:d=>{t.emit("select",d)},resolveSize:d=>{const o=/px|em|rem|pt|%/;return o.test(d)?`${parseInt(d,10)}${d.match(o)[0]}`:`${d}px`}}}const oe={label:{type:String,default:"XM1"},value:{type:String||Number,default:"项目一"},disabled:{type:Boolean,default:!1},active:{type:Boolean,default:!1},divide:{type:Boolean,default:!1},onSelect:{type:Function,default:()=>{}}},_=n.defineComponent({name:"FDropdownItem",props:oe,emits:["select"],setup(e,t){const l=n.ref(e.value),r=n.ref(e.label),a=n.ref(e.disabled),u=n.ref(e.active),g=n.ref(e.divide),m=()=>{a.value||t.emit("select",e)};return()=>n.createVNode("div",null,[n.withDirectives(n.createVNode("div",{class:"dropdown-divider"},null),[[n.vShow,g.value]]),n.createVNode("li",{class:`dropdown-item${u.value?" active":""} ${a.value?" disabled":""}`,onClick:m,title:l.value.toString()},[r.value])])}}),L=n.defineComponent({name:"FDropdown",props:j,emits:["select"],setup(e,t){const l=n.ref(e.model),{show:r,dropdownMenuRef:a,dropdownRef:u,clickEventRef:g,showDropMenu:m,hoverDropdown:N,leftButtonClick:i,closeDropMenu:c,selectItem:s,resolveSize:f}=q(e,t);function b(y){t.emit("select",y)}return()=>n.createVNode("div",{ref:u},[n.createVNode("div",{class:["farris-dropdown","btn-group",{dropup:e.position==="top"},{dropdown:e.position==="bottom"},{dropleft:e.position==="left"},{dropright:e.position==="right"}]},[e.splitButton&&n.createVNode("span",{class:["btn",{"dropdown-item":e.nest},{"btn-lg":e.size==="large"},{"btn-sm":e.size==="small"},{"btn-primary":e.type==="primary"},{"btn-success":e.type==="success"},{"btn-warning":e.type==="warning"},{"btn-danger":e.type==="danger"},{"btn-info":e.type==="info"}],style:"width:100%",onClick:i},[e.title]),n.createVNode("span",{ref:g,class:["dropdown-toggle",{btn:!e.nest},{"dropdown-item":e.nest},{"dropdown-toggle-split":e.splitButton},{"btn-lg":e.size==="large"},{"btn-sm":e.size==="small"},{"btn-primary":e.type==="primary"},{"btn-success":e.type==="success"},{"btn-warning":e.type==="warning"},{"btn-danger":e.type==="danger"},{"btn-info":e.type==="info"},{"btn-secondary":e.type==="secondary"},{"btn-link":e.type==="link"},{disabled:e.disabled}],style:"width:100%",onClick:m,onMouseenter:N,onMouseleave:N},[n.withDirectives(n.createVNode("span",{class:"sr-only"},null),[[n.vShow,e.splitButton]]),e.splitButton?"":e.title,n.withDirectives(n.createVNode("span",{class:`f-icon ${e.iconClass.toString()}`},null),[[n.vShow,e.iconClass]])]),n.createVNode(n.Teleport,{to:"body"},{default:()=>[n.createVNode("div",{ref:a,class:`dropdown-menu${r.value?" show":""}`},[n.createVNode(n.Fragment,null,[l.value.map(({label:y,value:$,disabled:T,active:d,divide:o})=>n.createVNode(_,{value:$.toString(),label:y,disabled:T,active:d,divide:o,onSelect:D=>b(D)},null))])])]})])])}});function re(e,t,l){var w;function r(){}const a="",u="",g=n.ref();function m(){return(t==null?void 0:t.schema.componentType)!=="frame"}function N(){return!1}function i(){return(t==null?void 0:t.schema.componentType)!=="frame"}function c(){return(t==null?void 0:t.schema.componentType)==="frame"}function s(p){if(!p||!p.value)return null;if(p.value.schema&&p.value.schema.type==="component")return p.value;const h=n.ref(p==null?void 0:p.value.parent),v=s(h);return v||null}function f(p=t){const{componentInstance:h,designerItemElementRef:v}=p;return!h||!h.value?null:h.value.canMove?v:f(p.parent)}function b(p){return!!l}function y(){return(t==null?void 0:t.schema.label)||(t==null?void 0:t.schema.title)||(t==null?void 0:t.schema.name)}function $(){}function T(p,h){}function d(p){const{componentType:h}=p;let v=F(h,p);const O=h.toLowerCase().replace("-","_");return v&&!v.id&&v.type===h&&(v.id=`${O}_${Math.random().toString().slice(2,6)}`),v}function o(p,h){const v=String(p.getAttribute("data-controltype")),O=p.getAttribute("data-feature"),A=O?JSON.parse(O):{};A.parentComponentInstance=g.value;let V=F(v,A);const R=v.toLowerCase().replace("-","_");return V&&!V.id&&V.type===v&&(V.id=`${R}_${Math.random().toString().slice(2,6)}`),V}function D(p){}function S(...p){}return g.value={canMove:m(),canSelectParent:N(),canDelete:i(),canNested:!c(),contents:t==null?void 0:t.schema.contents,elementRef:e,parent:(w=t==null?void 0:t.parent)==null?void 0:w.componentInstance,schema:t==null?void 0:t.schema,styles:a,designerClass:u,canAccepts:b,getBelongedComponentInstance:s,getDraggableDesignItemElement:f,getDraggingDisplayText:y,getPropConfig:S,getDragScopeElement:$,onAcceptMovedChildElement:T,onAcceptNewChildElement:o,onChildElementMovedOut:D,addNewChildComponentSchema:d,updateDragAndDropRules:r,triggerBelongedComponentToMoveWhenMoved:n.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:n.ref(!1)},g}const ie=n.defineComponent({name:"FDropdownDesign",props:j,emits:["select"],setup(e,t){const l=n.ref(e.model),{show:r,showDropMenu:a,hoverDropdown:u,leftButtonClick:g,closeDropMenu:m,selectItem:N,resolveSize:i}=q(e,t);function c(y){t.emit("select",y)}const s=n.ref(),f=n.inject("design-item-context"),b=re(s,f);return n.onMounted(()=>{s.value.componentInstance=b}),t.expose(b.value),()=>n.createVNode("div",{ref:s},[n.createVNode("div",{class:["farris-dropdown","btn-group",{dropup:e.position==="top"},{dropdown:e.position==="bottom"},{dropleft:e.position==="left"},{dropright:e.position==="right"}],style:{width:e.width}},[e.splitButton&&n.createVNode("span",{class:["btn",{"dropdown-item":e.nest},{"btn-lg":e.size==="large"},{"btn-sm":e.size==="small"},{"btn-primary":e.type==="primary"},{"btn-success":e.type==="success"},{"btn-warning":e.type==="warning"},{"btn-danger":e.type==="danger"},{"btn-info":e.type==="info"}],style:"width:100%",onClick:g},[e.title]),n.createVNode("span",{class:["dropdown-toggle",{btn:!e.nest},{"dropdown-item":e.nest},{"dropdown-toggle-split":e.splitButton},{"btn-lg":e.size==="large"},{"btn-sm":e.size==="small"},{"btn-primary":e.type==="primary"},{"btn-success":e.type==="success"},{"btn-warning":e.type==="warning"},{"btn-danger":e.type==="danger"},{"btn-info":e.type==="info"},{"btn-secondary":e.type==="secondary"},{"btn-link":e.type==="link"},{disabled:e.disabled}],style:"width:100%",onClick:a,onMouseenter:u,onMouseleave:u},[n.withDirectives(n.createVNode("span",{class:"sr-only"},null),[[n.vShow,e.splitButton]]),e.splitButton?"":e.title,n.withDirectives(n.createVNode("span",{class:`f-icon ${e.iconClass.toString()}`},null),[[n.vShow,e.iconClass]])]),n.createVNode("div",{class:`dropdown-menu${r.value?" show":""}`},[n.createVNode(n.Fragment,null,[l.value.map(({label:y,value:$,disabled:T,active:d,divide:o})=>n.createVNode(_,{value:$.toString(),label:y,disabled:T,active:d,divide:o,onSelect:D=>c(D)},null))])])])])}}),se={install(e){e.component(L.name,L)},register(e,t,l,r){e.dropdown=L,t.dropdown=z},registerDesigner(e,t,l){e.dropdown=ie,t.dropdown=z}};B.Dropdown=L,B.default=se,B.dropdownProps=j,B.propsResolver=z,Object.defineProperties(B,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|