comfy-tool 1.0.4 → 1.0.5
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/@types/components/index.d.ts +1 -1
- package/@types/components/layout/Column/Column.d.ts +1 -1
- package/@types/components/layout/Column/index.d.ts +1 -1
- package/@types/components/layout/{Expended → Expanded}/index.d.ts +4 -4
- package/@types/components/utils/layer/Component.d.ts +15 -5
- package/@types/components/utils/layer/layer.d.ts +1 -1
- package/@types/demo/hooks/use-layer.d.ts +19 -0
- package/@types/demo/hooks/use-test-layer.d.ts +6 -0
- package/@types/globals.d.ts +10 -24
- package/@types/plugins/PopupCreator.d.ts +2 -1
- package/@types/utils/app/component.d.ts +1 -1
- package/@types/utils/tools.d.ts +1 -1
- package/@types/utils/util/array.d.ts +1 -0
- package/@types/utils/util/{formate.d.ts → format.d.ts} +1 -0
- package/@types/utils/util/function.d.ts +1 -1
- package/README.md +87 -36
- package/dist/index.min.js +1 -1
- package/es/index.mjs +234 -219
- package/lib/index.js +1 -1
- package/package.json +1 -1
- package/web-types.json +1 -1
- /package/@types/components/layout/{Expended/Expended.d.ts → Expanded/Expanded.d.ts} +0 -0
package/es/index.mjs
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var ae = Object.defineProperty, le = Object.defineProperties;
|
|
2
|
+
var ce = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var R = Object.getOwnPropertySymbols;
|
|
4
|
-
var ue = Object.prototype.hasOwnProperty,
|
|
5
|
-
var W = (e, t, n) => t in e ?
|
|
4
|
+
var ue = Object.prototype.hasOwnProperty, fe = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var W = (e, t, n) => t in e ? ae(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, f = (e, t) => {
|
|
6
6
|
for (var n in t || (t = {}))
|
|
7
7
|
ue.call(t, n) && W(e, n, t[n]);
|
|
8
8
|
if (R)
|
|
9
9
|
for (var n of R(t))
|
|
10
|
-
|
|
10
|
+
fe.call(t, n) && W(e, n, t[n]);
|
|
11
11
|
return e;
|
|
12
|
-
}, _ = (e, t) =>
|
|
13
|
-
import { camelize as
|
|
14
|
-
import { h as N, reactive as ut, unref as
|
|
12
|
+
}, _ = (e, t) => le(e, ce(t));
|
|
13
|
+
import { camelize as q, pick as z, keysOf as G, merge as X, pickEx as b, Fn as se, addUnit as p, arrayToGroup as de, base64ToBlob as me, cloneJSON as he, dateGo as pe, dealTime as ye, debounce as ve, decodeURIComponentSafe as ge, decodeURISafe as be, deepClone as Ce, deleteItemForArr as xe, emptyArray as we, entriesOf as J, extend as P, formatDate as Se, formatSelectedData as Ee, formatToSelectData as Te, getArrayDataIndex as Le, getDateConfig as Ae, getFuzzyMatchRegExp as De, getPercentage as Oe, getProperty as _e, getRandomElements as Ie, getUniqueParam as Pe, getWeek as Ne, getWeekByNo as ke, hasSameItem as $e, isArrayString as He, isFullUrl as Me, isNumber as Re, isObjectString as We, isRegExpString as Ve, isWebUrl as je, kebabCase as Fe, methodApply as Z, padZero as Ue, parseArray as Ye, parseDate as Be, parseObject as Ke, parseRegExp as qe, parseUrl as ze, queryParse as Ge, queryStringify as Xe, removeEmptyForArr as Je, removeFalseForArr as Ze, removeItemForArr as Qe, selectDataToObj as et, shuffleArray as tt, throttle as nt, throttleAsync as ot, toFormData as rt, toSelectData as it, typeOf as at, urlAddParams as lt, valuesOf as ct } from "./utils.mjs";
|
|
14
|
+
import { h as N, reactive as ut, unref as ft, defineComponent as L, createVNode as h, mergeProps as T, render as V, shallowRef as j, ref as st, shallowReactive as dt, watch as mt, provide as ht, Fragment as pt, nextTick as yt } from "vue";
|
|
15
15
|
function $(e) {
|
|
16
16
|
return e.install = (t) => {
|
|
17
17
|
let { name: n } = e;
|
|
18
|
-
t.component(n, e), t.component(
|
|
18
|
+
t.component(n, e), t.component(q("-" + n), e);
|
|
19
19
|
}, e;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function vt(e, t = N("div"), n) {
|
|
22
22
|
return e ? typeof e == "function" ? e() || t : N(e, n && ut(n)) : t;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function gt(e) {
|
|
25
25
|
return !!(e && e.$el && e.$props && e.$options && e.$emit);
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
let t =
|
|
27
|
+
function bt(e) {
|
|
28
|
+
let t = Q(e);
|
|
29
29
|
t && (t.scrollTop = 0);
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function Q(e) {
|
|
32
32
|
return document.getElementById(e);
|
|
33
33
|
}
|
|
34
|
-
function
|
|
35
|
-
let t =
|
|
36
|
-
return
|
|
34
|
+
function ee(e) {
|
|
35
|
+
let t = ft(e);
|
|
36
|
+
return gt(t) ? t.$el : t instanceof HTMLElement ? t : null;
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function Ct(e, t) {
|
|
39
39
|
return getComputedStyle(e).getPropertyValue(t);
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function xt(e, t, n = !0) {
|
|
42
42
|
e.classList.remove(...t.split(" ")), n && e.classList.add(t);
|
|
43
43
|
}
|
|
44
44
|
const m = {
|
|
45
45
|
rootId: "app",
|
|
46
46
|
app: void 0
|
|
47
47
|
};
|
|
48
|
-
function
|
|
48
|
+
function wt(e = {}) {
|
|
49
49
|
e.rootId && (m.rootId = e.rootId), e.app && (m.app = e.app);
|
|
50
50
|
}
|
|
51
|
-
const
|
|
51
|
+
const C = {
|
|
52
52
|
toast(e) {
|
|
53
53
|
},
|
|
54
54
|
alert(e) {
|
|
@@ -59,32 +59,32 @@ const b = {
|
|
|
59
59
|
hideLoading() {
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
|
-
function
|
|
63
|
-
let t =
|
|
64
|
-
|
|
62
|
+
function St(e) {
|
|
63
|
+
let t = G(m);
|
|
64
|
+
wt(z(e, t)), X(C, b(e, t), {
|
|
65
65
|
deepMerge: !0,
|
|
66
66
|
arrayMergeStrategy: "concat"
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
|
-
function
|
|
70
|
-
}
|
|
71
|
-
function Et(e) {
|
|
69
|
+
function Et() {
|
|
72
70
|
}
|
|
73
71
|
function Tt(e) {
|
|
72
|
+
}
|
|
73
|
+
function Lt(e) {
|
|
74
74
|
H(e);
|
|
75
75
|
}
|
|
76
76
|
function H(e) {
|
|
77
|
-
|
|
77
|
+
C.toast(e);
|
|
78
78
|
}
|
|
79
|
-
function
|
|
80
|
-
|
|
79
|
+
function At(e) {
|
|
80
|
+
C.alert(e);
|
|
81
81
|
}
|
|
82
|
-
const
|
|
82
|
+
const E = {
|
|
83
83
|
show(e = "") {
|
|
84
|
-
|
|
84
|
+
C.showLoading(e);
|
|
85
85
|
},
|
|
86
86
|
hide() {
|
|
87
|
-
|
|
87
|
+
C.hideLoading();
|
|
88
88
|
}
|
|
89
89
|
};
|
|
90
90
|
let k;
|
|
@@ -92,138 +92,138 @@ try {
|
|
|
92
92
|
k = document.createElement("a");
|
|
93
93
|
} catch (e) {
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function Dt(e, t = "未获取到联系电话") {
|
|
96
96
|
if (!e) return H(t);
|
|
97
97
|
e = typeof e == "number" ? e.toString() : e, k.href = /^tel:.*/.test(e) ? e : "tel:" + e, k.click();
|
|
98
98
|
}
|
|
99
|
-
const
|
|
99
|
+
const Ot = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
100
100
|
__proto__: null,
|
|
101
|
-
$:
|
|
102
|
-
$alert:
|
|
103
|
-
$loading:
|
|
104
|
-
$refDOM:
|
|
101
|
+
$: Q,
|
|
102
|
+
$alert: At,
|
|
103
|
+
$loading: E,
|
|
104
|
+
$refDOM: ee,
|
|
105
105
|
$toast: H,
|
|
106
|
-
Fn:
|
|
107
|
-
addUnit:
|
|
108
|
-
arrayToGroup:
|
|
109
|
-
base64ToBlob:
|
|
110
|
-
camelize:
|
|
111
|
-
cloneJSON:
|
|
112
|
-
dateGo:
|
|
113
|
-
dealTime:
|
|
114
|
-
debounce:
|
|
115
|
-
decodeURIComponentSafe:
|
|
116
|
-
decodeURISafe:
|
|
117
|
-
deepClone:
|
|
118
|
-
deleteItemForArr:
|
|
119
|
-
emptyArray:
|
|
120
|
-
entriesOf:
|
|
121
|
-
errorCatch:
|
|
106
|
+
Fn: se,
|
|
107
|
+
addUnit: p,
|
|
108
|
+
arrayToGroup: de,
|
|
109
|
+
base64ToBlob: me,
|
|
110
|
+
camelize: q,
|
|
111
|
+
cloneJSON: he,
|
|
112
|
+
dateGo: pe,
|
|
113
|
+
dealTime: ye,
|
|
114
|
+
debounce: ve,
|
|
115
|
+
decodeURIComponentSafe: ge,
|
|
116
|
+
decodeURISafe: be,
|
|
117
|
+
deepClone: Ce,
|
|
118
|
+
deleteItemForArr: xe,
|
|
119
|
+
emptyArray: we,
|
|
120
|
+
entriesOf: J,
|
|
121
|
+
errorCatch: Lt,
|
|
122
122
|
extend: P,
|
|
123
|
-
formatDate:
|
|
124
|
-
formatSelectedData:
|
|
125
|
-
formatToSelectData:
|
|
126
|
-
getArrayDataIndex:
|
|
127
|
-
getDateConfig:
|
|
128
|
-
getElementPropertyValue:
|
|
129
|
-
getFuzzyMatchRegExp:
|
|
130
|
-
getPercentage:
|
|
131
|
-
getProperty:
|
|
132
|
-
getRandomElements:
|
|
133
|
-
getUniqueParam:
|
|
134
|
-
getWeek:
|
|
135
|
-
getWeekByNo:
|
|
136
|
-
hasSameItem:
|
|
137
|
-
isArrayString:
|
|
138
|
-
isFullUrl:
|
|
139
|
-
isNumber:
|
|
140
|
-
isObjectString:
|
|
141
|
-
isRegExpString:
|
|
142
|
-
isWebUrl:
|
|
143
|
-
kebabCase:
|
|
144
|
-
keysOf:
|
|
145
|
-
merge:
|
|
146
|
-
methodApply:
|
|
147
|
-
noop:
|
|
148
|
-
noopCatch:
|
|
149
|
-
padZero:
|
|
150
|
-
parseArray:
|
|
151
|
-
parseDate:
|
|
152
|
-
parseObject:
|
|
153
|
-
parseRegExp:
|
|
154
|
-
parseUrl:
|
|
155
|
-
pick:
|
|
156
|
-
pickEx:
|
|
157
|
-
queryParse:
|
|
158
|
-
queryStringify:
|
|
159
|
-
removeEmptyForArr:
|
|
160
|
-
removeFalseForArr:
|
|
161
|
-
removeItemForArr:
|
|
162
|
-
scrollToTop:
|
|
163
|
-
selectDataToObj:
|
|
164
|
-
shuffleArray:
|
|
165
|
-
telephoneCall:
|
|
166
|
-
throttle:
|
|
167
|
-
throttleAsync:
|
|
168
|
-
toFormData:
|
|
169
|
-
toSelectData:
|
|
170
|
-
toggleClass:
|
|
171
|
-
typeOf:
|
|
172
|
-
urlAddParams:
|
|
173
|
-
valuesOf:
|
|
123
|
+
formatDate: Se,
|
|
124
|
+
formatSelectedData: Ee,
|
|
125
|
+
formatToSelectData: Te,
|
|
126
|
+
getArrayDataIndex: Le,
|
|
127
|
+
getDateConfig: Ae,
|
|
128
|
+
getElementPropertyValue: Ct,
|
|
129
|
+
getFuzzyMatchRegExp: De,
|
|
130
|
+
getPercentage: Oe,
|
|
131
|
+
getProperty: _e,
|
|
132
|
+
getRandomElements: Ie,
|
|
133
|
+
getUniqueParam: Pe,
|
|
134
|
+
getWeek: Ne,
|
|
135
|
+
getWeekByNo: ke,
|
|
136
|
+
hasSameItem: $e,
|
|
137
|
+
isArrayString: He,
|
|
138
|
+
isFullUrl: Me,
|
|
139
|
+
isNumber: Re,
|
|
140
|
+
isObjectString: We,
|
|
141
|
+
isRegExpString: Ve,
|
|
142
|
+
isWebUrl: je,
|
|
143
|
+
kebabCase: Fe,
|
|
144
|
+
keysOf: G,
|
|
145
|
+
merge: X,
|
|
146
|
+
methodApply: Z,
|
|
147
|
+
noop: Et,
|
|
148
|
+
noopCatch: Tt,
|
|
149
|
+
padZero: Ue,
|
|
150
|
+
parseArray: Ye,
|
|
151
|
+
parseDate: Be,
|
|
152
|
+
parseObject: Ke,
|
|
153
|
+
parseRegExp: qe,
|
|
154
|
+
parseUrl: ze,
|
|
155
|
+
pick: z,
|
|
156
|
+
pickEx: b,
|
|
157
|
+
queryParse: Ge,
|
|
158
|
+
queryStringify: Xe,
|
|
159
|
+
removeEmptyForArr: Je,
|
|
160
|
+
removeFalseForArr: Ze,
|
|
161
|
+
removeItemForArr: Qe,
|
|
162
|
+
scrollToTop: bt,
|
|
163
|
+
selectDataToObj: et,
|
|
164
|
+
shuffleArray: tt,
|
|
165
|
+
telephoneCall: Dt,
|
|
166
|
+
throttle: nt,
|
|
167
|
+
throttleAsync: ot,
|
|
168
|
+
toFormData: rt,
|
|
169
|
+
toSelectData: it,
|
|
170
|
+
toggleClass: xt,
|
|
171
|
+
typeOf: at,
|
|
172
|
+
urlAddParams: lt,
|
|
173
|
+
valuesOf: ct
|
|
174
174
|
}, Symbol.toStringTag, { value: "Module" })), s = {};
|
|
175
|
-
function
|
|
175
|
+
function F(e) {
|
|
176
176
|
return s[e.url] && s[e.url].status === 1 ? Promise.resolve("The resource is already loaded!") : s[e.url] && s[e.url].status === 2 ? new Promise((t, n) => {
|
|
177
177
|
s[e.url].waiters.push(t);
|
|
178
|
-
}) : e.production ? Promise.resolve("Ignored in development environment!") : (
|
|
178
|
+
}) : e.production ? Promise.resolve("Ignored in development environment!") : (E.show("资源加载中"), s[e.url] ? s[e.url].status = 2 : s[e.url] = {
|
|
179
179
|
status: 2,
|
|
180
180
|
waiters: []
|
|
181
181
|
}, new Promise((t, n) => {
|
|
182
182
|
const r = () => {
|
|
183
|
-
c(), d();
|
|
184
|
-
}, o = () => {
|
|
185
183
|
u(), d();
|
|
184
|
+
}, o = () => {
|
|
185
|
+
c(), d();
|
|
186
186
|
};
|
|
187
187
|
let i = null;
|
|
188
188
|
e.type === "js" ? (i = document.createElement("script"), i.src = e.url, i.onload = r, i.onerror = o) : e.type === "css" && (i = document.createElement("link"), i.rel = "stylesheet", i.href = e.url, i.onload = r, i.onerror = o), i && document.head.appendChild(i);
|
|
189
|
-
function c() {
|
|
190
|
-
s[e.url].status = 1, S.hide(), t(e.url), J(s[e.url].waiters, [e.url]);
|
|
191
|
-
}
|
|
192
189
|
function u() {
|
|
193
|
-
s[e.url].status =
|
|
190
|
+
s[e.url].status = 1, E.hide(), t(e.url), Z(s[e.url].waiters, [e.url]);
|
|
191
|
+
}
|
|
192
|
+
function c() {
|
|
193
|
+
s[e.url].status = 0, E.hide(), n(new Error("Failed to load " + e.url));
|
|
194
194
|
}
|
|
195
195
|
function d() {
|
|
196
196
|
i && (i.onload = null, i.onerror = null);
|
|
197
197
|
}
|
|
198
198
|
}));
|
|
199
199
|
}
|
|
200
|
-
function
|
|
201
|
-
return Array.isArray(e) ? Promise.all(e.map((t) =>
|
|
200
|
+
function Zt(e) {
|
|
201
|
+
return Array.isArray(e) ? Promise.all(e.map((t) => F(t))) : F(e);
|
|
202
202
|
}
|
|
203
|
-
const
|
|
203
|
+
const U = Symbol("INSTALLED_KEY"), Y = Symbol("COMPONENT_INSTALLED_KEY"), B = Symbol("DIRECTIVES_INSTALLED_KEY"), _t = {
|
|
204
204
|
mounted(e, t, n, r) {
|
|
205
205
|
typeof t.value == "function" && t.value(e);
|
|
206
206
|
},
|
|
207
207
|
unmounted(e, t, n, r) {
|
|
208
208
|
typeof t.value == "function" && t.value(null);
|
|
209
209
|
}
|
|
210
|
-
},
|
|
210
|
+
}, It = {
|
|
211
211
|
mounted(e, t, n, r) {
|
|
212
212
|
e.focus();
|
|
213
213
|
},
|
|
214
214
|
updated(e, t, n, r) {
|
|
215
215
|
}
|
|
216
|
-
},
|
|
216
|
+
}, Pt = function(t, n, r, o) {
|
|
217
217
|
t.style.height = t.parentElement.offsetHeight + "px", t.style.minHeight = "100%";
|
|
218
218
|
};
|
|
219
|
-
function
|
|
219
|
+
function Nt(e, t, n, r) {
|
|
220
220
|
if (t.value.__used) return;
|
|
221
221
|
let o = f({}, t.value);
|
|
222
222
|
if (o.behavior = o.behavior || "smooth", typeof o.right == "number" && (o.left = e.scrollWidth - o.right), typeof o.bottom == "number" && (o.top = e.scrollHeight - o.bottom), o.target) {
|
|
223
|
-
let i =
|
|
223
|
+
let i = ee(o.target);
|
|
224
224
|
if (i) {
|
|
225
|
-
let { offsetTop:
|
|
226
|
-
o.left = i.offsetLeft - e.offsetLeft +
|
|
225
|
+
let { offsetTop: u, offsetLeft: c } = i.offsetParent || { offsetTop: 0, offsetLeft: 0 };
|
|
226
|
+
o.left = i.offsetLeft - e.offsetLeft + c, o.top = i.offsetTop - e.offsetTop + u;
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
229
|
o.left && typeof o.offsetX == "number" && (o.left += o.offsetX), o.top && typeof o.offsetY == "number" && (o.top += o.offsetY), Object.defineProperty(t.value, "__used", {
|
|
@@ -235,61 +235,63 @@ function Pt(e, t, n, r) {
|
|
|
235
235
|
}, o, e) : e.scrollTo(o);
|
|
236
236
|
}
|
|
237
237
|
const I = {
|
|
238
|
-
dom:
|
|
239
|
-
focus:
|
|
240
|
-
maxHeight:
|
|
241
|
-
scroll:
|
|
238
|
+
dom: _t,
|
|
239
|
+
focus: It,
|
|
240
|
+
maxHeight: Pt,
|
|
241
|
+
scroll: Nt
|
|
242
242
|
};
|
|
243
|
-
function
|
|
244
|
-
if (!e[
|
|
245
|
-
e[
|
|
243
|
+
function kt(e) {
|
|
244
|
+
if (!e[B]) {
|
|
245
|
+
e[B] = !0;
|
|
246
246
|
for (const t of Object.keys(I))
|
|
247
247
|
e.directive(I[t].name || t, I[t]);
|
|
248
248
|
}
|
|
249
249
|
}
|
|
250
|
-
const
|
|
250
|
+
const $t = {
|
|
251
251
|
reverse: Boolean
|
|
252
|
-
},
|
|
252
|
+
}, Ht = /* @__PURE__ */ L({
|
|
253
253
|
name: "column",
|
|
254
254
|
inheritAttrs: !1,
|
|
255
|
-
props:
|
|
255
|
+
props: $t,
|
|
256
256
|
setup(e, {
|
|
257
257
|
attrs: t,
|
|
258
258
|
slots: n
|
|
259
259
|
}) {
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
260
|
+
return () => {
|
|
261
|
+
var r, o, i, u, c;
|
|
262
|
+
return h("div", T({
|
|
263
|
+
class: {
|
|
264
|
+
"comfy-tool--column": !0,
|
|
265
|
+
reverse: e.reverse
|
|
266
|
+
}
|
|
267
|
+
}, t), [((r = n.before) == null ? void 0 : r.call(n)) || "", ((o = n["before-content"]) == null ? void 0 : o.call(n)) || "", h("div", {
|
|
268
|
+
class: "main-content"
|
|
269
|
+
}, [((i = n.default) == null ? void 0 : i.call(n)) || ""]), ((u = n["after-content"]) == null ? void 0 : u.call(n)) || "", ((c = n.after) == null ? void 0 : c.call(n)) || ""]);
|
|
270
|
+
};
|
|
269
271
|
}
|
|
270
|
-
}),
|
|
272
|
+
}), Mt = $(Ht), Rt = {
|
|
271
273
|
reverse: Boolean
|
|
272
|
-
},
|
|
274
|
+
}, Wt = /* @__PURE__ */ L({
|
|
273
275
|
name: "row",
|
|
274
276
|
inheritAttrs: !1,
|
|
275
|
-
props:
|
|
277
|
+
props: Rt,
|
|
276
278
|
setup(e, {
|
|
277
279
|
attrs: t,
|
|
278
280
|
slots: n
|
|
279
281
|
}) {
|
|
280
282
|
return () => {
|
|
281
|
-
var r, o, i,
|
|
282
|
-
return
|
|
283
|
+
var r, o, i, u, c;
|
|
284
|
+
return h("div", T({
|
|
283
285
|
class: {
|
|
284
286
|
"comfy-tool--row": !0,
|
|
285
287
|
reverse: e.reverse
|
|
286
288
|
}
|
|
287
|
-
}, t), [((r = n.before) == null ? void 0 : r.call(n)) || "", ((o = n["before-content"]) == null ? void 0 : o.call(n)) || "",
|
|
289
|
+
}, t), [((r = n.before) == null ? void 0 : r.call(n)) || "", ((o = n["before-content"]) == null ? void 0 : o.call(n)) || "", h("div", {
|
|
288
290
|
class: "main-content"
|
|
289
|
-
}, [((i = n.default) == null ? void 0 : i.call(n)) || ""]), ((
|
|
291
|
+
}, [((i = n.default) == null ? void 0 : i.call(n)) || ""]), ((u = n["after-content"]) == null ? void 0 : u.call(n)) || "", ((c = n.after) == null ? void 0 : c.call(n)) || ""]);
|
|
290
292
|
};
|
|
291
293
|
}
|
|
292
|
-
}),
|
|
294
|
+
}), Vt = $(Wt), jt = {
|
|
293
295
|
/** 当需要设定宽高时可能需要设置为 `-`;需要撑满容器时设置为 `100%` */
|
|
294
296
|
flex: {
|
|
295
297
|
type: [Number, String],
|
|
@@ -309,10 +311,10 @@ const kt = {
|
|
|
309
311
|
row: Boolean,
|
|
310
312
|
/** 启用flexbox纵向布局 */
|
|
311
313
|
column: Boolean
|
|
312
|
-
},
|
|
314
|
+
}, Ft = /* @__PURE__ */ L({
|
|
313
315
|
name: "expended",
|
|
314
316
|
inheritAttrs: !1,
|
|
315
|
-
props:
|
|
317
|
+
props: jt,
|
|
316
318
|
setup(e, {
|
|
317
319
|
attrs: t,
|
|
318
320
|
slots: n
|
|
@@ -332,9 +334,9 @@ const kt = {
|
|
|
332
334
|
r.flex = e.flex;
|
|
333
335
|
break;
|
|
334
336
|
}
|
|
335
|
-
return e.minWidth && (r.minWidth =
|
|
337
|
+
return e.minWidth && (r.minWidth = p(e.minWidth, "px")), e.minHeight && (r.minHeight = p(e.minHeight, "px")), e.maxWidth && (r.maxWidth = p(e.maxWidth, "px")), e.maxHeight && (r.maxHeight = p(e.maxHeight, "px")), e.width && (r.width = p(e.width, "px")), e.height && (r.height = p(e.height, "px")), e.column ? o.push("u-flex-nowrap u-box-flex-col") : e.row && o.push("u-flex-wrap"), () => {
|
|
336
338
|
var i;
|
|
337
|
-
return
|
|
339
|
+
return h("div", T({
|
|
338
340
|
style: r,
|
|
339
341
|
class: T({
|
|
340
342
|
class: ["comfy-tool--expended", ...o]
|
|
@@ -342,34 +344,40 @@ const kt = {
|
|
|
342
344
|
}, t), [((i = n.default) == null ? void 0 : i.call(n)) || ""]);
|
|
343
345
|
};
|
|
344
346
|
}
|
|
345
|
-
}),
|
|
346
|
-
Column:
|
|
347
|
-
Row:
|
|
348
|
-
|
|
347
|
+
}), Ut = $(Ft), Yt = {
|
|
348
|
+
Column: Mt,
|
|
349
|
+
Row: Vt,
|
|
350
|
+
Expanded: Ut
|
|
349
351
|
};
|
|
350
|
-
function
|
|
351
|
-
e[
|
|
352
|
+
function Bt(e) {
|
|
353
|
+
e[Y] || (e[Y] = !0, J(Yt).forEach(([t, n]) => {
|
|
352
354
|
e.component(t, n);
|
|
353
355
|
}));
|
|
354
356
|
}
|
|
355
|
-
function
|
|
356
|
-
|
|
357
|
+
function Kt(e) {
|
|
358
|
+
St({ app: e }), kt(e), Bt(e);
|
|
357
359
|
}
|
|
358
|
-
class
|
|
360
|
+
class qt {
|
|
359
361
|
constructor(t, n) {
|
|
360
362
|
this.properties = n, this.component = t, this.container = document.createElement("div");
|
|
361
|
-
const r =
|
|
362
|
-
m.app && (r.appContext = m.app._context),
|
|
363
|
+
const r = h(t, this.properties);
|
|
364
|
+
m.app && (r.appContext = m.app._context), V(r, this.container), this.instance = r.component, this.appDOM = this.container, this.init();
|
|
363
365
|
}
|
|
364
366
|
init() {
|
|
365
|
-
this.
|
|
367
|
+
this.mount();
|
|
366
368
|
}
|
|
367
369
|
// 声明静态方法
|
|
368
370
|
static use(t) {
|
|
369
371
|
Object.assign(m, t);
|
|
370
372
|
}
|
|
373
|
+
mount() {
|
|
374
|
+
if (this.properties.teleport ? this.properties.teleport : m.rootId, this.appDOM && !this.appDOM.isConnected)
|
|
375
|
+
for (const t of Array.from(this.appDOM.childNodes))
|
|
376
|
+
document.body.appendChild(t);
|
|
377
|
+
}
|
|
371
378
|
unmount() {
|
|
372
|
-
|
|
379
|
+
var t;
|
|
380
|
+
this.properties.teleport ? this.properties.teleport : m.rootId, V(null, this.container), (t = this.appDOM.parentNode) == null || t.removeChild(this.appDOM);
|
|
373
381
|
}
|
|
374
382
|
close() {
|
|
375
383
|
this.toggle(!1);
|
|
@@ -378,13 +386,20 @@ class Kt {
|
|
|
378
386
|
t ? this.instance.open(n) : this.instance.close(n);
|
|
379
387
|
}
|
|
380
388
|
}
|
|
381
|
-
const
|
|
389
|
+
const K = {
|
|
382
390
|
show: !1,
|
|
383
391
|
// 扩展
|
|
384
392
|
keepAlive: !1
|
|
385
|
-
},
|
|
393
|
+
}, zt = /* @__PURE__ */ L({
|
|
386
394
|
name: "comfy-tool-layer",
|
|
395
|
+
inheritAttrs: !1,
|
|
387
396
|
components: {},
|
|
397
|
+
props: {
|
|
398
|
+
baseContent: {
|
|
399
|
+
type: Object,
|
|
400
|
+
default: null
|
|
401
|
+
}
|
|
402
|
+
},
|
|
388
403
|
emits: ["confirm", "close", "cancel"],
|
|
389
404
|
setup(e, {
|
|
390
405
|
attrs: t,
|
|
@@ -392,34 +407,34 @@ const B = {
|
|
|
392
407
|
slots: r,
|
|
393
408
|
expose: o
|
|
394
409
|
}) {
|
|
395
|
-
const i =
|
|
410
|
+
const i = j(e.baseContent), u = j(null), c = st(!0);
|
|
396
411
|
let d;
|
|
397
|
-
const l = dt(f(f(f({},
|
|
412
|
+
const l = dt(f(f(f({}, K), t), e)), x = {
|
|
398
413
|
onConfirm() {
|
|
399
414
|
},
|
|
400
415
|
onClose() {
|
|
401
416
|
}
|
|
402
|
-
}, M =
|
|
417
|
+
}, M = h("div", {
|
|
403
418
|
style: {
|
|
404
419
|
height: "150px"
|
|
405
420
|
}
|
|
406
421
|
}, null);
|
|
407
|
-
function
|
|
422
|
+
function ne(a) {
|
|
408
423
|
l.show = a;
|
|
409
424
|
}
|
|
410
|
-
function
|
|
411
|
-
return d =
|
|
425
|
+
function oe() {
|
|
426
|
+
return d = vt(u.value, M, _(f({}, l.contentProps), {
|
|
412
427
|
LAYERSHOW: l.show
|
|
413
428
|
})), d;
|
|
414
429
|
}
|
|
415
|
-
function
|
|
430
|
+
function re() {
|
|
416
431
|
let a;
|
|
417
|
-
return !l.keepAlive && !l.show && !
|
|
432
|
+
return !l.keepAlive && !l.show && !c.value ? a = () => M : a = r.default ? r.default : oe, () => a();
|
|
418
433
|
}
|
|
419
|
-
function
|
|
434
|
+
function ie() {
|
|
420
435
|
v.cancel();
|
|
421
436
|
}
|
|
422
|
-
function
|
|
437
|
+
function w(a) {
|
|
423
438
|
if (d && d.component) {
|
|
424
439
|
let {
|
|
425
440
|
ctx: g,
|
|
@@ -428,67 +443,67 @@ const B = {
|
|
|
428
443
|
O && O[a] ? O[a]() : g && g[a] && g[a]();
|
|
429
444
|
}
|
|
430
445
|
}
|
|
431
|
-
let
|
|
446
|
+
let S;
|
|
432
447
|
function D(a) {
|
|
433
|
-
l.show = a, l.show || l.keepAlive ? (
|
|
434
|
-
|
|
435
|
-
}, 500),
|
|
436
|
-
l.show && (
|
|
448
|
+
l.show = a, l.show || l.keepAlive ? (c.value = !0, S && clearTimeout(S), S = null) : S = setTimeout(() => {
|
|
449
|
+
c.value = !1;
|
|
450
|
+
}, 500), yt(() => {
|
|
451
|
+
l.show && (w("onLayerShow"), w("queryData"));
|
|
437
452
|
});
|
|
438
453
|
}
|
|
439
454
|
const v = {
|
|
440
|
-
init(a = {}, g =
|
|
441
|
-
P(l, g, a &&
|
|
455
|
+
init(a = {}, g = K) {
|
|
456
|
+
P(l, g, a && b(a, ["content", "baseContent"])), a.onConfirm && (x.onConfirm = a.onConfirm), a.onClose && (x.onClose = a.onClose), a.baseContent && (i.value = a.baseContent), u.value = a.content;
|
|
442
457
|
},
|
|
443
458
|
open(a) {
|
|
444
459
|
v.init(a, {}), D(!0);
|
|
445
460
|
},
|
|
446
461
|
confirm(a) {
|
|
447
|
-
n("confirm"), D(!!
|
|
462
|
+
n("confirm"), D(!!x.onConfirm(a, v.close));
|
|
448
463
|
},
|
|
449
464
|
close(a = "complete") {
|
|
450
|
-
|
|
465
|
+
x.onClose(a), n("close"), D(!1), w("onClose");
|
|
451
466
|
},
|
|
452
467
|
cancel() {
|
|
453
|
-
v.close("cancel"), n("cancel"),
|
|
468
|
+
v.close("cancel"), n("cancel"), w("onCancel");
|
|
454
469
|
}
|
|
455
470
|
};
|
|
456
471
|
return mt(() => t, (a) => {
|
|
457
472
|
P(l, {}, a);
|
|
458
473
|
}), o(v), ht("Layer", v), () => {
|
|
459
474
|
var a;
|
|
460
|
-
return i.value ? N(i.value, _(f(f(f({
|
|
475
|
+
return h(pt, null, [i.value ? N(i.value, _(f(f(f({
|
|
461
476
|
class: ["comfy-tool--layer", (a = l.class) != null ? a : ""],
|
|
462
477
|
style: f({}, l.style)
|
|
463
|
-
}, t), l.baseContentProps),
|
|
464
|
-
"onUpdate:show":
|
|
465
|
-
onClose:
|
|
478
|
+
}, b(t, ["content", "contentProps", "baseContent", "baseContentProps"])), l.baseContentProps), b(l, ["content", "contentProps", "onClose", "width", "height", "class", "style", "baseContent", "baseContentProps"])), {
|
|
479
|
+
"onUpdate:show": ne,
|
|
480
|
+
onClose: ie
|
|
466
481
|
}), {
|
|
467
|
-
default:
|
|
482
|
+
default: re(),
|
|
468
483
|
overlayContent: r.overlayContent
|
|
469
|
-
}) : "";
|
|
484
|
+
}) : ""]);
|
|
470
485
|
};
|
|
471
486
|
}
|
|
472
487
|
});
|
|
473
|
-
var
|
|
474
|
-
class A extends
|
|
488
|
+
var y;
|
|
489
|
+
class A extends qt {
|
|
475
490
|
constructor(t, n) {
|
|
476
491
|
super(t, n);
|
|
477
492
|
}
|
|
478
493
|
open(t) {
|
|
479
|
-
return
|
|
494
|
+
return super.mount(), this.instance.exposed.open(t);
|
|
480
495
|
}
|
|
481
496
|
static create(t = {}, n = !0) {
|
|
482
|
-
if (!
|
|
483
|
-
let r = new A(
|
|
497
|
+
if (!y || n) {
|
|
498
|
+
let r = new A(zt, t);
|
|
484
499
|
if (n) return r;
|
|
485
|
-
|
|
500
|
+
y || (y = r);
|
|
486
501
|
} else
|
|
487
|
-
|
|
488
|
-
return
|
|
502
|
+
y.instance.exposed.init(t);
|
|
503
|
+
return y;
|
|
489
504
|
}
|
|
490
505
|
}
|
|
491
|
-
function
|
|
506
|
+
function te(e, t = !1) {
|
|
492
507
|
return new Promise((n, r) => {
|
|
493
508
|
A.create({}, t).open(f({
|
|
494
509
|
onConfirm(o, i) {
|
|
@@ -500,24 +515,24 @@ function ee(e, t = !1) {
|
|
|
500
515
|
}, e));
|
|
501
516
|
});
|
|
502
517
|
}
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
518
|
+
te.create = A.create;
|
|
519
|
+
te.close = () => {
|
|
520
|
+
y && y.close();
|
|
506
521
|
};
|
|
507
|
-
const
|
|
522
|
+
const Qt = "1.0.5", en = Ot, tn = {
|
|
508
523
|
install(e) {
|
|
509
|
-
e[
|
|
524
|
+
e[U] || (e[U] = !0, Kt(e));
|
|
510
525
|
}
|
|
511
526
|
};
|
|
512
527
|
export {
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
528
|
+
Mt as Column,
|
|
529
|
+
en as ComfyTool,
|
|
530
|
+
Ut as Expanded,
|
|
531
|
+
te as Layer,
|
|
532
|
+
Vt as Row,
|
|
533
|
+
St as configComfyTool,
|
|
534
|
+
tn as default,
|
|
535
|
+
Zt as resourceLoader,
|
|
536
|
+
Kt as useComfyTool,
|
|
537
|
+
Qt as version
|
|
523
538
|
};
|