@farris/ui-vue 1.2.5 → 1.2.7
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 +147 -139
- package/components/accordion/index.umd.cjs +1 -1
- package/components/accordion/package.json +1 -1
- package/components/avatar/index.esm.js +122 -131
- 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/package.json +1 -1
- package/components/checkbox/index.esm.js +216 -223
- 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 +201 -181
- 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/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 +341 -338
- 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 +3415 -3295
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-grid/package.json +1 -1
- package/components/data-view/index.esm.js +2719 -2717
- package/components/data-view/index.umd.cjs +1 -1
- package/components/data-view/package.json +1 -1
- package/components/date-picker/index.esm.js +31 -40
- package/components/date-picker/index.umd.cjs +1 -1
- package/components/date-picker/package.json +1 -1
- package/components/designer-canvas/index.esm.js +23 -20
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/designer-canvas/package.json +1 -1
- package/components/designer-outline/package.json +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 +578 -584
- 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 +287 -278
- 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 +1923 -1908
- 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 +3719 -3604
- 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 +483 -470
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/filter-bar/package.json +1 -1
- package/components/flow-canvas/index.esm.js +37 -34
- 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 +258 -267
- 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 +1452 -1450
- 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 +4860 -4657
- 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 +4411 -4259
- 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/package.json +1 -1
- package/components/notify/package.json +1 -1
- package/components/order/index.esm.js +763 -741
- 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 +948 -945
- package/components/page-header/index.umd.cjs +1 -1
- package/components/page-header/package.json +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 +485 -466
- package/components/property-editor/index.umd.cjs +2 -2
- package/components/property-editor/package.json +1 -1
- package/components/property-panel/index.esm.js +437 -426
- 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 +98 -107
- 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 +840 -800
- 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 +757 -760
- 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 +3659 -3432
- 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 +126 -135
- 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 +1400 -1379
- 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 +97 -106
- 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 +393 -402
- 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 +124 -122
- 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 +3531 -3412
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-grid/package.json +1 -1
- package/components/tree-view/index.esm.js +2046 -2044
- 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 +12370 -11917
- package/farris.all.umd.cjs +9 -9
- package/index.css +1 -0
- package/package.json +2 -2
- package/types/combo-list/src/components/list-container.component.d.ts +6 -0
- package/types/combo-list/src/components/list-container.props.d.ts +9 -1
- 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/data-grid/index.d.ts +5 -5
- package/types/data-grid/src/data-grid.component.d.ts +2 -2
- package/types/data-grid/src/data-grid.props.d.ts +1 -0
- 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/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/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/lookup/src/designer/use-lookup-rules.d.ts +3 -0
- package/types/lookup/src/property-config/converters/lookup-property.converter.d.ts +7 -3
- package/types/lookup/src/property-config/lookup.property-config.d.ts +31 -27
- package/types/mapping-editor/src/mapping-editor.props.d.ts +8 -0
- package/types/modal/src/modal.component.d.ts +3 -3
- package/types/modal/src/modal.props.d.ts +3 -5
- 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 -16
- package/types/property-panel/src/composition/entity/input-base-property.d.ts +21 -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/components/button-edit/style.css +0 -1
- package/components/external-container/style.css +0 -1
- package/components/field-selector/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-canvas/{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/flow-canvas/{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,8 +1,8 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { ref as s, createVNode as
|
|
5
|
-
const
|
|
1
|
+
var ge = Object.defineProperty;
|
|
2
|
+
var ye = (t, e, l) => e in t ? ge(t, e, { enumerable: !0, configurable: !0, writable: !0, value: l }) : t[e] = l;
|
|
3
|
+
var D = (t, e, l) => ye(t, typeof e != "symbol" ? e + "" : e, l);
|
|
4
|
+
import { ref as s, createVNode as h, Fragment as we, defineComponent as be, computed as k, watch as Y, onMounted as Q, onUnmounted as Z, Teleport as xe, shallowRef as pe, createApp as Ce, nextTick as Me, render as G, h as ze, cloneVNode as Ee, mergeProps as Be } from "vue";
|
|
5
|
+
const He = {
|
|
6
6
|
/**
|
|
7
7
|
* 自定义类
|
|
8
8
|
*/
|
|
@@ -54,7 +54,7 @@ const Be = {
|
|
|
54
54
|
containment: { type: HTMLElement, default: null },
|
|
55
55
|
reiszeable: { type: Boolean, default: !1 },
|
|
56
56
|
draggable: { type: Boolean, default: !1 },
|
|
57
|
-
dragHandle: { type:
|
|
57
|
+
dragHandle: { type: Object, default: null },
|
|
58
58
|
closedCallback: { type: Function, default: null },
|
|
59
59
|
resizeHandle: { type: Function, default: null },
|
|
60
60
|
render: { type: Function, default: null },
|
|
@@ -62,26 +62,26 @@ const Be = {
|
|
|
62
62
|
rejectCallback: { type: Function, default: null },
|
|
63
63
|
enableEsc: { type: Boolean, default: !0 }
|
|
64
64
|
};
|
|
65
|
-
class
|
|
65
|
+
class M {
|
|
66
66
|
constructor(e, l) {
|
|
67
67
|
this.x = e, this.y = l;
|
|
68
68
|
}
|
|
69
69
|
static getTransformInfo(e) {
|
|
70
|
-
const
|
|
71
|
-
if (
|
|
72
|
-
const x = parseInt(
|
|
73
|
-
return { x, y:
|
|
70
|
+
const u = window.getComputedStyle(e).getPropertyValue("transform").replace(/[^-\d,]/g, "").split(",");
|
|
71
|
+
if (u.length >= 6) {
|
|
72
|
+
const x = parseInt(u[4], 10), r = parseInt(u[5], 10);
|
|
73
|
+
return { x, y: r };
|
|
74
74
|
}
|
|
75
75
|
return { x: 0, y: 0 };
|
|
76
76
|
}
|
|
77
77
|
static fromEvent(e, l = null) {
|
|
78
78
|
if (this.isMouseEvent(e))
|
|
79
|
-
return new
|
|
79
|
+
return new M(e.clientX, e.clientY);
|
|
80
80
|
if (l === null || e.changedTouches.length === 1)
|
|
81
|
-
return new
|
|
82
|
-
for (let
|
|
83
|
-
if (e.changedTouches[
|
|
84
|
-
return new
|
|
81
|
+
return new M(e.changedTouches[0].clientX, e.changedTouches[0].clientY);
|
|
82
|
+
for (let u = 0; u < e.changedTouches.length; u++)
|
|
83
|
+
if (e.changedTouches[u].target === l)
|
|
84
|
+
return new M(e.changedTouches[u].clientX, e.changedTouches[u].clientY);
|
|
85
85
|
}
|
|
86
86
|
static isMouseEvent(e) {
|
|
87
87
|
return Object.prototype.toString.apply(e).indexOf("MouseEvent") === 8;
|
|
@@ -90,19 +90,19 @@ class E {
|
|
|
90
90
|
return !!e && "x" in e && "y" in e;
|
|
91
91
|
}
|
|
92
92
|
static getCurrent(e) {
|
|
93
|
-
const l = new
|
|
93
|
+
const l = new M(0, 0);
|
|
94
94
|
if (window) {
|
|
95
|
-
const
|
|
96
|
-
if (
|
|
97
|
-
const x = parseInt(
|
|
98
|
-
l.x = isNaN(x) ? 0 : x, l.y = isNaN(
|
|
95
|
+
const u = window.getComputedStyle(e);
|
|
96
|
+
if (u) {
|
|
97
|
+
const x = parseInt(u.getPropertyValue("left"), 10), r = parseInt(u.getPropertyValue("top"), 10);
|
|
98
|
+
l.x = isNaN(x) ? 0 : x, l.y = isNaN(r) ? 0 : r;
|
|
99
99
|
}
|
|
100
100
|
return l;
|
|
101
101
|
}
|
|
102
102
|
return null;
|
|
103
103
|
}
|
|
104
104
|
static copy(e) {
|
|
105
|
-
return new
|
|
105
|
+
return new M(0, 0).set(e);
|
|
106
106
|
}
|
|
107
107
|
get value() {
|
|
108
108
|
return { x: this.x, y: this.y };
|
|
@@ -126,39 +126,39 @@ class E {
|
|
|
126
126
|
return this.x = e.x, this.y = e.y, this;
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
|
-
class
|
|
129
|
+
class N {
|
|
130
130
|
constructor(e, l) {
|
|
131
131
|
this.width = e, this.height = l;
|
|
132
132
|
}
|
|
133
133
|
static getCurrent(e) {
|
|
134
|
-
const l = new
|
|
134
|
+
const l = new N(0, 0);
|
|
135
135
|
if (window) {
|
|
136
|
-
const
|
|
137
|
-
return
|
|
136
|
+
const u = window.getComputedStyle(e);
|
|
137
|
+
return u && (l.width = parseInt(u.getPropertyValue("width"), 10), l.height = parseInt(u.getPropertyValue("height"), 10)), l;
|
|
138
138
|
}
|
|
139
139
|
return null;
|
|
140
140
|
}
|
|
141
141
|
static copy(e) {
|
|
142
|
-
return new
|
|
142
|
+
return new N(0, 0).set(e);
|
|
143
143
|
}
|
|
144
144
|
set(e) {
|
|
145
145
|
return this.width = e.width, this.height = e.height, this;
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
function Re(t, e) {
|
|
149
|
-
const l = s(),
|
|
149
|
+
const l = s(), u = s(), x = s(), r = s(), g = s(), i = s(), d = s(), v = s(), p = s(), T = s(), H = s(), B = s(), I = s(t.draggable), O = s(!1);
|
|
150
150
|
function S() {
|
|
151
|
-
const n =
|
|
151
|
+
const n = u.value || document.body, o = window.getComputedStyle(n);
|
|
152
152
|
if (!o || !l.value)
|
|
153
153
|
return;
|
|
154
|
-
const w =
|
|
155
|
-
|
|
154
|
+
const w = M.getTransformInfo(l.value), m = {};
|
|
155
|
+
d.value && (m.deltaL = l.value.offsetLeft - d.value.x, m.deltaT = l.value.offsetTop - d.value.y);
|
|
156
156
|
const z = o.getPropertyValue("position");
|
|
157
|
-
|
|
157
|
+
m.width = n.clientWidth, m.height = n.clientHeight, m.pr = parseInt(o.getPropertyValue("padding-right"), 10), m.pb = parseInt(o.getPropertyValue("padding-bottom"), 10), m.position = o.getPropertyValue("position"), z === "static" && (n.style.position = "relative"), m.translateX = w.x, m.translateY = w.y, T.value = m;
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function y(n) {
|
|
160
160
|
if (l.value) {
|
|
161
|
-
|
|
161
|
+
r.value = N.getCurrent(l.value), g.value = M.getCurrent(l.value), i.value = r.value ? N.copy(r.value) : null, d.value = g.value ? M.copy(g.value) : null, S();
|
|
162
162
|
const o = n.target.getAttribute("type") || "";
|
|
163
163
|
v.value = {
|
|
164
164
|
n: !!o.match(/n/),
|
|
@@ -169,46 +169,46 @@ function Re(t, e) {
|
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
function C() {
|
|
172
|
-
var n, o, w,
|
|
172
|
+
var n, o, w, m;
|
|
173
173
|
if (l.value) {
|
|
174
174
|
const z = l.value;
|
|
175
|
-
v.value && ((v.value.n || v.value.s) && ((n =
|
|
175
|
+
v.value && ((v.value.n || v.value.s) && ((n = i.value) != null && n.height) && (z.style.height = i.value.height + "px"), (v.value.w || v.value.e) && ((o = i.value) != null && o.width) && (z.style.width = i.value.width + "px"), d.value && ((w = d.value) != null && w.x && (z.style.left = d.value.x + "px"), (m = d.value) != null && m.y && (z.style.top = d.value.y + "px")));
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
178
|
function L() {
|
|
179
179
|
const n = t.minHeight ? t.minHeight : 1, o = t.minWidth ? t.minWidth : 1;
|
|
180
|
-
|
|
180
|
+
i.value && d.value && v.value && r.value && (i.value.height < n && (i.value.height = n, v.value.n && g.value && (d.value.y = g.value.y + (r.value.height - n))), i.value.width < o && (i.value.width = o, v.value.w && g.value && (d.value.x = g.value.x + (r.value.width - o))), t.maxHeight && i.value.height > t.maxHeight && (i.value.height = t.maxHeight, g.value && v.value.n && (d.value.y = g.value.y + (r.value.height - t.maxHeight))), t.maxWidth && i.value.width > t.maxWidth && (i.value.width = t.maxWidth, v.value.w && g.value && (d.value.x = g.value.x + (r.value.width - t.maxWidth))));
|
|
181
181
|
}
|
|
182
|
-
function
|
|
183
|
-
if (
|
|
182
|
+
function F() {
|
|
183
|
+
if (u.value) {
|
|
184
184
|
const n = T.value;
|
|
185
|
-
if (
|
|
186
|
-
const o = n.width - n.pr - n.deltaL - n.translateX -
|
|
187
|
-
v.value.n &&
|
|
185
|
+
if (d.value && i.value && v.value && r.value) {
|
|
186
|
+
const o = n.width - n.pr - n.deltaL - n.translateX - d.value.x, w = n.height - n.pb - n.deltaT - n.translateY - d.value.y;
|
|
187
|
+
v.value.n && d.value.y + n.translateY < 0 && g.value && (d.value.y = -n.translateY, i.value.height = r.value.height + g.value.y + n.translateY), v.value.w && d.value.x + n.translateX < 0 && g.value && (d.value.x = -n.translateX, i.value.width = r.value.width + g.value.x + n.translateX), i.value.width > o && (i.value.width = o), i.value.height > w && (i.value.height = w);
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
|
-
function
|
|
192
|
-
if (!x.value || !
|
|
191
|
+
function V(n) {
|
|
192
|
+
if (!x.value || !r.value || !g.value || !v.value)
|
|
193
193
|
return;
|
|
194
194
|
n.subtract(x.value);
|
|
195
195
|
const o = n.x, w = n.y;
|
|
196
|
-
v.value.n ? (
|
|
196
|
+
v.value.n ? (d.value.y = g.value.y + w, i.value.height = r.value.height - w) : v.value.s && (i.value.height = r.value.height + w), v.value.e ? i.value.width = r.value.width + o : v.value.w && (i.value.width = r.value.width - o, d.value.x = g.value.x + o), F(), L(), C();
|
|
197
197
|
}
|
|
198
|
-
function
|
|
198
|
+
function c(n) {
|
|
199
199
|
if (!p.value)
|
|
200
200
|
return;
|
|
201
|
-
const o =
|
|
202
|
-
o &&
|
|
201
|
+
const o = M.fromEvent(n);
|
|
202
|
+
o && V(o);
|
|
203
203
|
}
|
|
204
|
-
function
|
|
204
|
+
function f() {
|
|
205
205
|
if (l.value) {
|
|
206
206
|
const {
|
|
207
207
|
width: n,
|
|
208
208
|
height: o,
|
|
209
209
|
x: w,
|
|
210
|
-
y:
|
|
211
|
-
} = l.value.getBoundingClientRect(), z =
|
|
210
|
+
y: m
|
|
211
|
+
} = l.value.getBoundingClientRect(), z = M.getTransformInfo(l.value);
|
|
212
212
|
return {
|
|
213
213
|
size: {
|
|
214
214
|
width: n,
|
|
@@ -216,91 +216,91 @@ function Re(t, e) {
|
|
|
216
216
|
},
|
|
217
217
|
position: {
|
|
218
218
|
x: w - z.x,
|
|
219
|
-
y:
|
|
219
|
+
y: m - z.y
|
|
220
220
|
}
|
|
221
221
|
};
|
|
222
222
|
}
|
|
223
223
|
return null;
|
|
224
224
|
}
|
|
225
|
-
function
|
|
225
|
+
function E(n) {
|
|
226
226
|
if (l.value) {
|
|
227
|
-
const o =
|
|
227
|
+
const o = f();
|
|
228
228
|
H.value = o;
|
|
229
229
|
}
|
|
230
|
-
x.value = void 0,
|
|
230
|
+
x.value = void 0, r.value = null, g.value = null, i.value = null, d.value = null, v.value = null, p.value = null, document.removeEventListener("mousemove", c), document.removeEventListener("mouseup", E);
|
|
231
231
|
}
|
|
232
|
-
function
|
|
233
|
-
document.addEventListener("mousemove",
|
|
232
|
+
function P() {
|
|
233
|
+
document.addEventListener("mousemove", c), document.addEventListener("mouseup", E);
|
|
234
234
|
}
|
|
235
|
-
function
|
|
236
|
-
n instanceof MouseEvent && n.button === 2 || I.value && (n.stopPropagation(), n.preventDefault(), x.value =
|
|
235
|
+
function R(n) {
|
|
236
|
+
n instanceof MouseEvent && n.button === 2 || I.value && (n.stopPropagation(), n.preventDefault(), x.value = M.fromEvent(n), p.value = n.target, y(n), P());
|
|
237
237
|
}
|
|
238
|
-
function
|
|
239
|
-
return l.value = n,
|
|
238
|
+
function j(n) {
|
|
239
|
+
return l.value = n, h(we, null, [h("div", {
|
|
240
240
|
class: "ng-resizable-handle ng-resizable-n",
|
|
241
241
|
type: "n",
|
|
242
|
-
onMousedown: (o) =>
|
|
243
|
-
}, null),
|
|
242
|
+
onMousedown: (o) => R(o)
|
|
243
|
+
}, null), h("div", {
|
|
244
244
|
class: "ng-resizable-handle ng-resizable-e",
|
|
245
245
|
type: "e",
|
|
246
|
-
onMousedown: (o) =>
|
|
247
|
-
}, null),
|
|
246
|
+
onMousedown: (o) => R(o)
|
|
247
|
+
}, null), h("div", {
|
|
248
248
|
class: "ng-resizable-handle ng-resizable-s",
|
|
249
249
|
type: "s",
|
|
250
|
-
onMousedown: (o) =>
|
|
251
|
-
}, null),
|
|
250
|
+
onMousedown: (o) => R(o)
|
|
251
|
+
}, null), h("div", {
|
|
252
252
|
class: "ng-resizable-handle ng-resizable-w",
|
|
253
253
|
type: "w",
|
|
254
|
-
onMousedown: (o) =>
|
|
255
|
-
}, null),
|
|
254
|
+
onMousedown: (o) => R(o)
|
|
255
|
+
}, null), h("div", {
|
|
256
256
|
class: "ng-resizable-handle ng-resizable-ne",
|
|
257
257
|
type: "ne",
|
|
258
|
-
onMousedown: (o) =>
|
|
259
|
-
}, null),
|
|
258
|
+
onMousedown: (o) => R(o)
|
|
259
|
+
}, null), h("div", {
|
|
260
260
|
class: "ng-resizable-handle ng-resizable-se ng-resizable-diagonal",
|
|
261
261
|
type: "se",
|
|
262
|
-
onMousedown: (o) =>
|
|
263
|
-
}, null),
|
|
262
|
+
onMousedown: (o) => R(o)
|
|
263
|
+
}, null), h("div", {
|
|
264
264
|
class: "ng-resizable-handle ng-resizable-sw",
|
|
265
265
|
type: "sw",
|
|
266
|
-
onMousedown: (o) =>
|
|
267
|
-
}, null),
|
|
266
|
+
onMousedown: (o) => R(o)
|
|
267
|
+
}, null), h("div", {
|
|
268
268
|
class: "ng-resizable-handle ng-resizable-nw",
|
|
269
269
|
type: "nw",
|
|
270
|
-
onMousedown: (o) =>
|
|
270
|
+
onMousedown: (o) => R(o)
|
|
271
271
|
}, null)]);
|
|
272
272
|
}
|
|
273
|
-
function
|
|
274
|
-
const o =
|
|
275
|
-
n && (
|
|
276
|
-
size:
|
|
273
|
+
function W(n = !0) {
|
|
274
|
+
const o = u.value || document.body, w = N.getCurrent(o), m = l.value;
|
|
275
|
+
n && (B.value = f(), B.value.transform = m.style.transform), w && m && (i.value = w, m.style.height = i.value.height - 14 + "px", m.style.width = i.value.width - 14 + "px", m.style.left = "7px", m.style.top = "7px", m.style.transform = "", H.value = {
|
|
276
|
+
size: i.value,
|
|
277
277
|
position: {
|
|
278
278
|
x: 0,
|
|
279
279
|
y: 0
|
|
280
280
|
}
|
|
281
281
|
}, I.value = !1, O.value = !0);
|
|
282
282
|
}
|
|
283
|
-
function
|
|
283
|
+
function q() {
|
|
284
284
|
var n, o;
|
|
285
|
-
if (
|
|
285
|
+
if (B.value) {
|
|
286
286
|
const w = {
|
|
287
|
-
width:
|
|
288
|
-
height:
|
|
289
|
-
},
|
|
287
|
+
width: B.value.size.width || 0,
|
|
288
|
+
height: B.value.size.height || 0
|
|
289
|
+
}, m = {
|
|
290
290
|
x: (window.innerWidth - w.width) / 2,
|
|
291
291
|
y: (window.innerHeight - w.height) / 2
|
|
292
292
|
};
|
|
293
|
-
(n =
|
|
293
|
+
(n = i.value) == null || n.set(w), (o = d.value) == null || o.set(m);
|
|
294
294
|
const z = l.value;
|
|
295
|
-
z.style.height = w.height + "px", z.style.width = w.width + "px", z.style.left = `${
|
|
295
|
+
z.style.height = w.height + "px", z.style.width = w.width + "px", z.style.left = `${m.x}px`, z.style.top = `${m.y}px`, z.style.transform = "", H.value = {
|
|
296
296
|
size: w,
|
|
297
|
-
position:
|
|
297
|
+
position: m
|
|
298
298
|
}, I.value = t.draggable, O.value = !1;
|
|
299
299
|
}
|
|
300
300
|
}
|
|
301
|
-
function
|
|
301
|
+
function J() {
|
|
302
302
|
if (l.value) {
|
|
303
|
-
const n =
|
|
303
|
+
const n = N.getCurrent(l.value);
|
|
304
304
|
if (n) {
|
|
305
305
|
const {
|
|
306
306
|
width: o,
|
|
@@ -310,334 +310,345 @@ function Re(t, e) {
|
|
|
310
310
|
}
|
|
311
311
|
}
|
|
312
312
|
}
|
|
313
|
-
function
|
|
313
|
+
function K() {
|
|
314
314
|
const n = () => {
|
|
315
|
-
O.value ?
|
|
315
|
+
O.value ? W(!1) : J();
|
|
316
316
|
};
|
|
317
317
|
return window.addEventListener("resize", n), () => {
|
|
318
318
|
window.removeEventListener("resize", n);
|
|
319
319
|
};
|
|
320
320
|
}
|
|
321
|
-
const
|
|
321
|
+
const A = K();
|
|
322
322
|
return {
|
|
323
|
-
renderResizeBar:
|
|
324
|
-
boundingElement:
|
|
323
|
+
renderResizeBar: j,
|
|
324
|
+
boundingElement: u,
|
|
325
325
|
resizedEventParam: H,
|
|
326
|
-
maximize:
|
|
327
|
-
restore:
|
|
326
|
+
maximize: W,
|
|
327
|
+
restore: q,
|
|
328
328
|
allowDrag: I,
|
|
329
329
|
isMaximized: O,
|
|
330
|
-
unWindowResizeHandle:
|
|
330
|
+
unWindowResizeHandle: A
|
|
331
331
|
};
|
|
332
332
|
}
|
|
333
|
-
function
|
|
334
|
-
const l = s(),
|
|
335
|
-
function H(
|
|
336
|
-
if (
|
|
333
|
+
function Ie(t, e) {
|
|
334
|
+
const l = s(), u = s(t.draggable), x = s(t.lockAxis), r = s(), g = s(), i = s(!1), d = s(new M(0, 0)), v = s(new M(0, 0)), p = s(new M(0, 0)), T = s(new M(0, 0));
|
|
335
|
+
function H(c, f) {
|
|
336
|
+
if (f.tagName === "BUTTON")
|
|
337
337
|
return !1;
|
|
338
|
-
if (
|
|
338
|
+
if (f === c)
|
|
339
339
|
return !0;
|
|
340
|
-
for (const
|
|
341
|
-
if (
|
|
340
|
+
for (const E in f.children)
|
|
341
|
+
if (f.children.hasOwnProperty(E) && H(c, f.children[E]))
|
|
342
342
|
return !0;
|
|
343
343
|
return !1;
|
|
344
344
|
}
|
|
345
|
-
function
|
|
346
|
-
var
|
|
347
|
-
let
|
|
348
|
-
x.value === "x" ? (
|
|
349
|
-
const
|
|
350
|
-
l.value && (l.value.style.transform =
|
|
345
|
+
function B() {
|
|
346
|
+
var P, R;
|
|
347
|
+
let c = p.value.x + v.value.x, f = p.value.y + v.value.y;
|
|
348
|
+
x.value === "x" ? (c = ((P = d.value) == null ? void 0 : P.x) || 0, p.value.x = 0) : x.value === "y" && (f = ((R = d.value) == null ? void 0 : R.y) || 0, p.value.y = 0);
|
|
349
|
+
const E = `translate3d(${Math.round(c)}px, ${Math.round(f)}px, 0px)`;
|
|
350
|
+
l.value && (l.value.style.transform = E), T.value.x = c, T.value.y = f;
|
|
351
351
|
}
|
|
352
352
|
function I() {
|
|
353
|
-
if (!
|
|
353
|
+
if (!g.value || !l.value)
|
|
354
354
|
return null;
|
|
355
|
-
const
|
|
356
|
-
top:
|
|
357
|
-
right:
|
|
358
|
-
bottom:
|
|
359
|
-
left:
|
|
355
|
+
const c = g.value.getBoundingClientRect(), f = l.value.getBoundingClientRect(), E = {
|
|
356
|
+
top: c.top < f.top,
|
|
357
|
+
right: c.right > f.right,
|
|
358
|
+
bottom: c.bottom > f.bottom,
|
|
359
|
+
left: c.left < f.left
|
|
360
360
|
};
|
|
361
|
-
return
|
|
361
|
+
return E.top || (p.value.y -= f.top - c.top), E.bottom || (p.value.y -= f.bottom - c.bottom), E.right || (p.value.x -= f.right - c.right), E.left || (p.value.x -= f.left - c.left), B(), E;
|
|
362
362
|
}
|
|
363
|
-
function O(
|
|
364
|
-
|
|
363
|
+
function O(c) {
|
|
364
|
+
c && (d.value && c.subtract(d.value), p.value.set(c), B(), I());
|
|
365
365
|
}
|
|
366
|
-
function S(
|
|
367
|
-
|
|
366
|
+
function S(c) {
|
|
367
|
+
i.value && u.value && (c.stopPropagation(), c.preventDefault(), O(M.fromEvent(c, r.value)));
|
|
368
368
|
}
|
|
369
|
-
function
|
|
370
|
-
var
|
|
371
|
-
|
|
369
|
+
function y() {
|
|
370
|
+
var c;
|
|
371
|
+
i.value && (i.value = !1, v.value.add(p.value), p.value.reset(), (c = l.value) == null || c.classList.remove("ng-dragging"), document.removeEventListener("mousemove", S), document.removeEventListener("mouseup", y));
|
|
372
372
|
}
|
|
373
373
|
function C() {
|
|
374
|
-
!
|
|
374
|
+
!i.value && r.value && (i.value = !0, r.value.classList.add("ng-dragging"), document.addEventListener("mousemove", S), document.addEventListener("mouseup", y));
|
|
375
375
|
}
|
|
376
376
|
function L() {
|
|
377
377
|
if (l.value) {
|
|
378
|
-
const
|
|
379
|
-
v.value.set(
|
|
378
|
+
const c = M.getTransformInfo(l.value);
|
|
379
|
+
v.value.set(c);
|
|
380
380
|
return;
|
|
381
381
|
}
|
|
382
382
|
v.value.reset();
|
|
383
383
|
}
|
|
384
|
-
function
|
|
385
|
-
if (
|
|
384
|
+
function F(c) {
|
|
385
|
+
if (c instanceof MouseEvent && c.button === 2)
|
|
386
386
|
return;
|
|
387
|
-
const
|
|
388
|
-
|
|
389
|
-
}
|
|
390
|
-
function
|
|
391
|
-
|
|
387
|
+
const f = c.target || c.srcElement;
|
|
388
|
+
r.value !== void 0 && f && !H(f, r.value) || u.value !== !1 && (c.stopPropagation(), c.preventDefault(), d.value = M.fromEvent(c, l.value), L(), C());
|
|
389
|
+
}
|
|
390
|
+
function V(c, f, E) {
|
|
391
|
+
if (c && u.value && f) {
|
|
392
|
+
if (t.dragHandle) {
|
|
393
|
+
if (t.dragHandle instanceof HTMLElement)
|
|
394
|
+
r.value = t.dragHandle;
|
|
395
|
+
else if (typeof t.dragHandle == "string") {
|
|
396
|
+
const P = f.querySelector(t.dragHandle);
|
|
397
|
+
P && (r.value = P);
|
|
398
|
+
}
|
|
399
|
+
} else
|
|
400
|
+
r.value = c;
|
|
401
|
+
l.value = f, g.value = E, r.value.classList.add("ng-draggable"), r.value.addEventListener("mousedown", F);
|
|
402
|
+
}
|
|
392
403
|
}
|
|
393
404
|
return {
|
|
394
|
-
registerDraggle:
|
|
405
|
+
registerDraggle: V,
|
|
395
406
|
resetTranslate: L
|
|
396
407
|
};
|
|
397
408
|
}
|
|
398
|
-
function
|
|
409
|
+
function ke(t, e) {
|
|
399
410
|
const l = s(t.enableEsc);
|
|
400
|
-
function
|
|
411
|
+
function u(x) {
|
|
401
412
|
x.key === "Escape" && t.enableEsc && e.emit("esc", { event: x, type: "esc" });
|
|
402
413
|
}
|
|
403
|
-
l.value && document.addEventListener("keydown",
|
|
414
|
+
l.value && document.addEventListener("keydown", u);
|
|
404
415
|
}
|
|
405
|
-
const $ = /* @__PURE__ */
|
|
416
|
+
const $ = /* @__PURE__ */ be({
|
|
406
417
|
name: "FModal",
|
|
407
|
-
props:
|
|
418
|
+
props: He,
|
|
408
419
|
emits: ["update:modelValue", "accept", "cancel", "closed", "resize", "esc"],
|
|
409
420
|
setup(t, e) {
|
|
410
|
-
const l = s(t.width || 300),
|
|
411
|
-
function
|
|
421
|
+
const l = s(t.width || 300), u = s(t.height || 200), x = s(t.modelValue), r = s(""), g = s(t.class), i = s(t.fitContent), d = s(t.showHeader), v = s(""), p = s(t.showCloseButton), T = s(t.showMaxButton), H = s(!1), B = s(""), I = s(""), O = s(""), S = s(t.showButtons), y = s(t.title), C = s(t.reiszeable), L = s(t.containment || null), F = s();
|
|
422
|
+
function V(a, b) {
|
|
412
423
|
x.value = !1, e.emit("update:modelValue", !1), b != null && e.emit(b ? "accept" : "cancel"), e.emit("closed", a);
|
|
413
424
|
}
|
|
414
|
-
const
|
|
425
|
+
const c = [{
|
|
415
426
|
name: "cancel",
|
|
416
427
|
text: "取消",
|
|
417
428
|
class: "btn btn-light",
|
|
418
429
|
handle: (a) => {
|
|
419
|
-
|
|
430
|
+
V(a, !1);
|
|
420
431
|
}
|
|
421
432
|
}, {
|
|
422
433
|
name: "accept",
|
|
423
434
|
text: "确定",
|
|
424
435
|
class: "btn btn-primary",
|
|
425
436
|
handle: (a) => {
|
|
426
|
-
|
|
437
|
+
V(a, !0);
|
|
427
438
|
}
|
|
428
|
-
}],
|
|
429
|
-
renderResizeBar:
|
|
439
|
+
}], f = s(t.buttons && t.buttons.length ? t.buttons : c), E = k(() => !!v.value), P = k(() => !!S.value && !!f.value), R = s(), j = s(), W = s(!1), {
|
|
440
|
+
renderResizeBar: q,
|
|
430
441
|
maximize: J,
|
|
431
442
|
restore: K,
|
|
432
443
|
boundingElement: A,
|
|
433
|
-
resizedEventParam:
|
|
434
|
-
allowDrag:
|
|
435
|
-
unWindowResizeHandle:
|
|
444
|
+
resizedEventParam: n,
|
|
445
|
+
allowDrag: o,
|
|
446
|
+
unWindowResizeHandle: w
|
|
436
447
|
} = Re(t), {
|
|
437
|
-
registerDraggle:
|
|
438
|
-
} =
|
|
439
|
-
|
|
440
|
-
a !== b && (
|
|
441
|
-
}),
|
|
448
|
+
registerDraggle: m
|
|
449
|
+
} = Ie(t);
|
|
450
|
+
Y(() => t.title, (a, b) => {
|
|
451
|
+
a !== b && (y.value = a);
|
|
452
|
+
}), Y(() => t.modelValue, (a, b) => {
|
|
442
453
|
a !== b && (x.value = a);
|
|
443
|
-
}),
|
|
444
|
-
a !== b && (
|
|
445
|
-
}),
|
|
454
|
+
}), Y(() => t.showHeader, (a, b) => {
|
|
455
|
+
a !== b && (d.value = a);
|
|
456
|
+
}), Y(() => t.showButtons, (a, b) => {
|
|
446
457
|
a !== b && (S.value = a);
|
|
447
|
-
}),
|
|
448
|
-
const
|
|
449
|
-
JSON.stringify(
|
|
458
|
+
}), Y(() => n.value, (a, b) => {
|
|
459
|
+
const X = a || {}, U = b || {};
|
|
460
|
+
JSON.stringify(X) !== JSON.stringify(U) && e.emit("resize", {
|
|
450
461
|
newSize: a,
|
|
451
462
|
oldSize: b
|
|
452
463
|
});
|
|
453
464
|
});
|
|
454
|
-
function
|
|
465
|
+
function z() {
|
|
455
466
|
const a = document.querySelectorAll(".farris-modal").length;
|
|
456
|
-
(!a || a - 1 <= 0) && document.body.classList.remove("modal-open");
|
|
467
|
+
(!a || a - 1 <= 0) && document.body.classList.remove("modal-open"), F.value && F.value.classList.remove("show");
|
|
457
468
|
}
|
|
458
|
-
const
|
|
469
|
+
const _ = k(() => (x.value ? document.body.classList.add("modal-open") : z(), x.value)), te = k(() => {
|
|
459
470
|
const a = {
|
|
460
471
|
modal: !0,
|
|
461
472
|
"farris-modal": !0,
|
|
462
|
-
fade: !0
|
|
463
|
-
show: z.value
|
|
473
|
+
fade: !0
|
|
464
474
|
};
|
|
465
|
-
return a["f-modal-fitContent"] = !!
|
|
466
|
-
}),
|
|
467
|
-
var
|
|
475
|
+
return a["f-modal-fitContent"] = !!i.value, a.show = !!_.value, a;
|
|
476
|
+
}), le = k(() => {
|
|
477
|
+
var X;
|
|
468
478
|
const a = {
|
|
469
479
|
"modal-dialog": !0
|
|
470
|
-
}, b = (
|
|
471
|
-
return b == null || b.reduce((U,
|
|
472
|
-
}),
|
|
480
|
+
}, b = (X = g.value) == null ? void 0 : X.split(" ");
|
|
481
|
+
return b == null || b.reduce((U, me) => (U[me] = !0, U), a), a;
|
|
482
|
+
}), ae = k(() => ({
|
|
473
483
|
position: "absolute",
|
|
474
|
-
top: `${(window.innerHeight -
|
|
484
|
+
top: `${(window.innerHeight - u.value) / 2}px`,
|
|
475
485
|
left: `${(window.innerWidth - l.value) / 2}px`,
|
|
476
486
|
width: `${l.value}px`,
|
|
477
|
-
height:
|
|
478
|
-
})),
|
|
487
|
+
height: i.value ? "auto" : `${u.value}px`
|
|
488
|
+
})), ne = k(() => ({
|
|
479
489
|
"modal-content": !0,
|
|
480
|
-
"modal-content-has-header":
|
|
481
|
-
})),
|
|
490
|
+
"modal-content-has-header": d.value
|
|
491
|
+
})), se = k(() => {
|
|
482
492
|
const a = {
|
|
483
|
-
display:
|
|
493
|
+
display: d.value ? "" : "none"
|
|
484
494
|
};
|
|
485
|
-
return a["pointer-events"] =
|
|
486
|
-
}),
|
|
495
|
+
return a["pointer-events"] = o.value ? "auto" : "none", a;
|
|
496
|
+
}), oe = k(() => ({
|
|
487
497
|
"f-icon": !0,
|
|
488
498
|
modal_maximize: !0,
|
|
489
499
|
modalrevert: W.value
|
|
490
|
-
})),
|
|
500
|
+
})), ue = k(() => ({
|
|
491
501
|
"modal-body": !0,
|
|
492
|
-
"f-utils-flex-column":
|
|
502
|
+
"f-utils-flex-column": B.value === "iframe"
|
|
493
503
|
}));
|
|
494
|
-
function
|
|
504
|
+
function ie() {
|
|
495
505
|
return {};
|
|
496
506
|
}
|
|
497
|
-
const
|
|
507
|
+
const ce = k(() => {
|
|
498
508
|
const a = {
|
|
499
509
|
textAlgin: O.value
|
|
500
|
-
}, b =
|
|
510
|
+
}, b = ie();
|
|
501
511
|
return Object.assign(a, b);
|
|
502
512
|
});
|
|
503
|
-
function
|
|
513
|
+
function re(a) {
|
|
504
514
|
if (a.stopPropagation(), W.value) {
|
|
505
515
|
W.value = !1, K();
|
|
506
516
|
return;
|
|
507
517
|
}
|
|
508
518
|
J(), W.value = !0;
|
|
509
519
|
}
|
|
510
|
-
async function
|
|
520
|
+
async function de(a, b) {
|
|
511
521
|
a.handle && await a.handle(b, a) && e.emit("closed", b);
|
|
512
522
|
}
|
|
513
|
-
function
|
|
514
|
-
a.width && (l.value = a.width), a.height && (
|
|
523
|
+
function ve(a) {
|
|
524
|
+
a.width && (l.value = a.width), a.height && (u.value = a.height), a.buttons && (f.value = a.buttons), a.title && (y.value = a.title);
|
|
515
525
|
}
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
}),
|
|
519
|
-
|
|
526
|
+
Q(() => {
|
|
527
|
+
j.value && !L.value && (L.value = j.value.parentElement, A.value = L.value, m(R.value, j.value, A.value)), _.value && document.body.classList.add("modal-open"), ke(t, e);
|
|
528
|
+
}), Z(() => {
|
|
529
|
+
z(), w && w();
|
|
520
530
|
}), e.expose({
|
|
521
|
-
modalElementRef:
|
|
522
|
-
updateModalOptions:
|
|
523
|
-
close:
|
|
531
|
+
modalElementRef: j,
|
|
532
|
+
updateModalOptions: ve,
|
|
533
|
+
close: V
|
|
524
534
|
});
|
|
525
|
-
function
|
|
526
|
-
return
|
|
535
|
+
function fe() {
|
|
536
|
+
return h("ul", null, [H.value && h("li", {
|
|
527
537
|
class: "f-btn-icon f-bare"
|
|
528
|
-
}, [
|
|
538
|
+
}, [h("span", {
|
|
529
539
|
class: "f-icon modal_minimize"
|
|
530
|
-
}, null)]), T.value &&
|
|
531
|
-
onClick:
|
|
540
|
+
}, null)]), T.value && h("li", {
|
|
541
|
+
onClick: re,
|
|
532
542
|
class: "f-btn-icon f-bare",
|
|
533
543
|
style: "pointer-events: auto;"
|
|
534
|
-
}, [
|
|
535
|
-
class:
|
|
536
|
-
}, null)]), p.value &&
|
|
544
|
+
}, [h("span", {
|
|
545
|
+
class: oe.value
|
|
546
|
+
}, null)]), p.value && h("li", {
|
|
537
547
|
class: "f-btn-icon f-bare",
|
|
538
|
-
onClick: (a) =>
|
|
548
|
+
onClick: (a) => V(a, !1),
|
|
539
549
|
style: "pointer-events: auto;"
|
|
540
|
-
}, [
|
|
550
|
+
}, [h("span", {
|
|
541
551
|
class: "f-icon modal_close"
|
|
542
552
|
}, null)])]);
|
|
543
553
|
}
|
|
544
|
-
function
|
|
545
|
-
return
|
|
554
|
+
function he() {
|
|
555
|
+
return h("div", {
|
|
546
556
|
class: "modal-footer",
|
|
547
|
-
style:
|
|
548
|
-
}, [
|
|
557
|
+
style: ce.value
|
|
558
|
+
}, [f.value && f.value.map((a) => h("button", {
|
|
549
559
|
name: a.name,
|
|
550
560
|
type: "button",
|
|
551
561
|
class: a.class + (a.iconClass ? " btn-icontext" : ""),
|
|
552
562
|
onClick: (b) => {
|
|
553
|
-
|
|
563
|
+
de(a, b);
|
|
554
564
|
}
|
|
555
|
-
}, [!!a.iconClass &&
|
|
565
|
+
}, [!!a.iconClass && h("i", {
|
|
556
566
|
class: a.iconClass
|
|
557
567
|
}, null), a.text]))]);
|
|
558
568
|
}
|
|
559
|
-
return () =>
|
|
569
|
+
return () => h(xe, {
|
|
560
570
|
to: "body"
|
|
561
571
|
}, {
|
|
562
572
|
default: () => {
|
|
563
573
|
var a, b;
|
|
564
|
-
return [
|
|
565
|
-
class: ee.value,
|
|
566
|
-
style: "display: block"
|
|
567
|
-
}, [f("div", {
|
|
568
|
-
id: d.value,
|
|
574
|
+
return [_.value && h("div", {
|
|
569
575
|
class: te.value,
|
|
570
|
-
style:
|
|
571
|
-
ref:
|
|
572
|
-
}, [
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
+
style: "display: block",
|
|
577
|
+
ref: F
|
|
578
|
+
}, [h("div", {
|
|
579
|
+
id: r.value,
|
|
580
|
+
class: le.value,
|
|
581
|
+
style: ae.value,
|
|
582
|
+
ref: j
|
|
583
|
+
}, [h("div", {
|
|
584
|
+
class: ne.value
|
|
585
|
+
}, [h("div", {
|
|
586
|
+
ref: R,
|
|
576
587
|
class: "modal-header",
|
|
577
|
-
style:
|
|
578
|
-
}, [
|
|
588
|
+
style: se.value
|
|
589
|
+
}, [h("div", {
|
|
579
590
|
class: "modal-title"
|
|
580
|
-
}, [
|
|
591
|
+
}, [E.value && h("span", {
|
|
581
592
|
class: v.value,
|
|
582
593
|
style: "margin-right: 8px"
|
|
583
|
-
}, null),
|
|
594
|
+
}, null), h("span", {
|
|
584
595
|
class: "modal-title-label"
|
|
585
|
-
}, [
|
|
596
|
+
}, [y.value])]), h("div", {
|
|
586
597
|
class: "actions"
|
|
587
|
-
}, [
|
|
588
|
-
class:
|
|
589
|
-
}, [(b = (a = e.slots).default) == null ? void 0 : b.call(a),
|
|
590
|
-
title:
|
|
598
|
+
}, [fe()])]), h("div", {
|
|
599
|
+
class: ue.value
|
|
600
|
+
}, [(b = (a = e.slots).default) == null ? void 0 : b.call(a), B.value === "iframe" && h("iframe", {
|
|
601
|
+
title: r.value,
|
|
591
602
|
class: "f-utils-fill",
|
|
592
603
|
width: "100%",
|
|
593
604
|
frameborder: "0",
|
|
594
605
|
src: I.value
|
|
595
|
-
}, null)]),
|
|
606
|
+
}, null)]), P.value && he()]), !i.value && C.value && j.value && q(j.value)])])];
|
|
596
607
|
}
|
|
597
608
|
});
|
|
598
609
|
}
|
|
599
610
|
});
|
|
600
|
-
function
|
|
611
|
+
function ee(t) {
|
|
601
612
|
if (t.content && t.content.render)
|
|
602
613
|
return t.content.render;
|
|
603
614
|
if (t.render && typeof t.render == "function")
|
|
604
615
|
return t.render;
|
|
605
616
|
}
|
|
606
|
-
function
|
|
617
|
+
function Te(t) {
|
|
607
618
|
const e = document.createElement("div");
|
|
608
619
|
e.style.display = "contents";
|
|
609
|
-
const l =
|
|
610
|
-
setup(
|
|
611
|
-
|
|
620
|
+
const l = Ce({
|
|
621
|
+
setup(u, x) {
|
|
622
|
+
Z(() => {
|
|
612
623
|
document.body.removeChild(e);
|
|
613
624
|
});
|
|
614
|
-
const
|
|
615
|
-
}),
|
|
625
|
+
const r = s(), g = s(t.class || ""), i = s(!!t.showButtons), d = s(!!t.showHeader), v = s(t.showCloseButton == null ? !0 : t.showCloseButton), p = s(!0), T = s(t.title || ""), H = t.acceptCallback || (() => {
|
|
626
|
+
}), B = t.rejectCallback || (() => {
|
|
616
627
|
}), I = t.closedCallback || ((C) => {
|
|
617
628
|
}), O = t.resizeHandle || ((C) => {
|
|
618
|
-
}), S =
|
|
629
|
+
}), S = ee(t), y = (C) => {
|
|
619
630
|
p.value = !1, l.unmount(), I(C);
|
|
620
631
|
};
|
|
621
|
-
return
|
|
632
|
+
return Q(() => {
|
|
622
633
|
}), x.expose({
|
|
623
|
-
modalRef:
|
|
624
|
-
}), () =>
|
|
625
|
-
ref:
|
|
626
|
-
class:
|
|
634
|
+
modalRef: r
|
|
635
|
+
}), () => h($, {
|
|
636
|
+
ref: r,
|
|
637
|
+
class: g.value,
|
|
627
638
|
modelValue: p.value,
|
|
628
639
|
"onUpdate:modelValue": (C) => p.value = C,
|
|
629
640
|
title: T.value,
|
|
630
641
|
width: t.width,
|
|
631
642
|
height: t.height,
|
|
632
643
|
buttons: t.buttons,
|
|
633
|
-
"show-header":
|
|
634
|
-
"show-buttons":
|
|
644
|
+
"show-header": d.value,
|
|
645
|
+
"show-buttons": i.value,
|
|
635
646
|
"show-close-button": v.value,
|
|
636
647
|
"show-max-button": !1,
|
|
637
648
|
onAccept: H,
|
|
638
|
-
onCancel:
|
|
649
|
+
onCancel: B,
|
|
639
650
|
fitContent: t.fitContent == null ? !0 : t.fitContent,
|
|
640
|
-
onClosed:
|
|
651
|
+
onClosed: y,
|
|
641
652
|
onResize: O
|
|
642
653
|
}, {
|
|
643
654
|
default: () => [S && S(l)]
|
|
@@ -646,14 +657,14 @@ function ke(t) {
|
|
|
646
657
|
});
|
|
647
658
|
return document.body.appendChild(e), l.mount(e), l;
|
|
648
659
|
}
|
|
649
|
-
class
|
|
660
|
+
class Oe {
|
|
650
661
|
constructor(e) {
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
662
|
+
D(this, "appContext", null);
|
|
663
|
+
D(this, "modalRef", s());
|
|
664
|
+
D(this, "activeModalIndex", s(0));
|
|
665
|
+
D(this, "modalRefs", {});
|
|
666
|
+
D(this, "isUseEscCloseModal", s(!1));
|
|
667
|
+
D(this, "activeModalInstance", k(() => this.modalRefs[this.activeModalIndex.value]));
|
|
657
668
|
this.appContext = e ? e._context : null;
|
|
658
669
|
}
|
|
659
670
|
getCurrentModal() {
|
|
@@ -665,63 +676,63 @@ class Te {
|
|
|
665
676
|
showButtons: !0,
|
|
666
677
|
showHeader: !0
|
|
667
678
|
}, e);
|
|
668
|
-
return
|
|
679
|
+
return Te(l);
|
|
669
680
|
}
|
|
670
681
|
open(e) {
|
|
671
682
|
const l = document.createDocumentFragment();
|
|
672
683
|
e.showMaxButton && e.fitContent && (e.showMaxButton = !1);
|
|
673
|
-
const
|
|
684
|
+
const u = pe(Object.assign({
|
|
674
685
|
title: "",
|
|
675
686
|
showButtons: !0,
|
|
676
687
|
showHeader: !0
|
|
677
|
-
}, e)), x = s(!0),
|
|
678
|
-
}),
|
|
679
|
-
}),
|
|
680
|
-
}),
|
|
688
|
+
}, e)), x = s(!0), r = u.value.acceptCallback || (() => {
|
|
689
|
+
}), g = u.value.rejectCallback || (() => {
|
|
690
|
+
}), i = u.value.closedCallback || ((y, C) => {
|
|
691
|
+
}), d = u.value.resizeHandle || ((y) => {
|
|
681
692
|
});
|
|
682
693
|
let v;
|
|
683
|
-
const p =
|
|
694
|
+
const p = ee(u.value), T = (y) => {
|
|
684
695
|
var L;
|
|
685
696
|
x.value = !1;
|
|
686
|
-
const C = (L =
|
|
687
|
-
|
|
688
|
-
}, H = (
|
|
689
|
-
T(
|
|
690
|
-
if (this.modalRefs[this.activeModalIndex.value] && delete this.modalRefs[this.activeModalIndex.value],
|
|
697
|
+
const C = (L = y == null ? void 0 : y.target) == null ? void 0 : L.classList.contains("modal_close");
|
|
698
|
+
i(y, this.isUseEscCloseModal.value ? "esc" : C ? "icon" : "button");
|
|
699
|
+
}, H = (y) => {
|
|
700
|
+
T(y), v && Me(() => {
|
|
701
|
+
if (this.modalRefs[this.activeModalIndex.value] && delete this.modalRefs[this.activeModalIndex.value], G(null, l), v = null, this.modalRef.value = null, this.modalRefs) {
|
|
691
702
|
const C = Object.keys(this.modalRefs);
|
|
692
703
|
C.length > 0 ? this.activeModalIndex.value = Math.max(...C) : this.activeModalIndex.value = 0;
|
|
693
704
|
}
|
|
694
705
|
this.isUseEscCloseModal.value = !1;
|
|
695
706
|
});
|
|
696
|
-
},
|
|
707
|
+
}, B = (y) => {
|
|
697
708
|
var C;
|
|
698
|
-
this.isUseEscCloseModal.value = !0, this.activeModalInstance && ((C = this.activeModalInstance.value) == null || C.close(
|
|
699
|
-
}, I = () =>
|
|
709
|
+
this.isUseEscCloseModal.value = !0, this.activeModalInstance && ((C = this.activeModalInstance.value) == null || C.close(y == null ? void 0 : y.event));
|
|
710
|
+
}, I = () => h($, Be({
|
|
700
711
|
ref: this.modalRef,
|
|
701
712
|
modelValue: x.value,
|
|
702
|
-
"onUpdate:modelValue": (
|
|
703
|
-
},
|
|
704
|
-
onAccept:
|
|
705
|
-
onCancel:
|
|
713
|
+
"onUpdate:modelValue": (y) => x.value = y
|
|
714
|
+
}, u.value, {
|
|
715
|
+
onAccept: r,
|
|
716
|
+
onCancel: g,
|
|
706
717
|
onClosed: H,
|
|
707
|
-
onResize:
|
|
708
|
-
onEsc:
|
|
718
|
+
onResize: d,
|
|
719
|
+
onEsc: B
|
|
709
720
|
}), {
|
|
710
721
|
default: () => [p && p()]
|
|
711
722
|
});
|
|
712
|
-
return v = ((
|
|
713
|
-
const C =
|
|
714
|
-
return C.appContext = this.appContext,
|
|
723
|
+
return v = ((y) => {
|
|
724
|
+
const C = ze(I, y);
|
|
725
|
+
return C.appContext = this.appContext, G(C, l), C;
|
|
715
726
|
})({
|
|
716
|
-
...
|
|
727
|
+
...u.value
|
|
717
728
|
// 'onUpdate:modelValue': onUpdateModelValue,
|
|
718
729
|
}), this.activeModalIndex.value++, this.modalRefs[this.activeModalIndex.value] = this.modalRef.value, {
|
|
719
|
-
update: (
|
|
720
|
-
|
|
721
|
-
...
|
|
722
|
-
...
|
|
723
|
-
}, v &&
|
|
724
|
-
...
|
|
730
|
+
update: (y) => {
|
|
731
|
+
u.value = {
|
|
732
|
+
...u.value,
|
|
733
|
+
...y
|
|
734
|
+
}, v && G(Ee(v, {
|
|
735
|
+
...u
|
|
725
736
|
}), l);
|
|
726
737
|
},
|
|
727
738
|
destroy: H,
|
|
@@ -729,17 +740,17 @@ class Te {
|
|
|
729
740
|
};
|
|
730
741
|
}
|
|
731
742
|
}
|
|
732
|
-
const
|
|
743
|
+
const Se = Symbol("FModalService"), je = {
|
|
733
744
|
install(t) {
|
|
734
745
|
t.component($.name, $);
|
|
735
|
-
const e = new
|
|
736
|
-
t.provide(
|
|
746
|
+
const e = new Oe(t);
|
|
747
|
+
t.provide(Se, e), t.provide("FModalService", e);
|
|
737
748
|
}
|
|
738
749
|
};
|
|
739
750
|
export {
|
|
740
751
|
$ as FModal,
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
752
|
+
Oe as FModalService,
|
|
753
|
+
Se as F_MODAL_SERVICE_TOKEN,
|
|
754
|
+
je as default,
|
|
755
|
+
He as modalProps
|
|
745
756
|
};
|