@farris/ui-vue 1.8.5-beta.3 → 1.8.5-beta.4
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/batch-editor/index.esm.js +6850 -6840
- package/components/batch-editor/index.umd.cjs +20 -20
- package/components/button/index.esm.js +6852 -6842
- package/components/button/index.umd.cjs +20 -20
- package/components/button-edit/index.esm.js +140 -140
- package/components/button-edit/index.umd.cjs +1 -1
- package/components/button-group/index.esm.js +46 -45
- package/components/button-group/index.umd.cjs +1 -1
- package/components/common/index.esm.js +16 -12
- package/components/common/index.umd.cjs +1 -1
- package/components/component/index.esm.js +411 -411
- package/components/component/index.umd.cjs +2 -2
- package/components/data-view/index.esm.js +6500 -6487
- package/components/data-view/index.umd.cjs +21 -21
- package/components/designer-canvas/index.esm.js +269 -269
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/expression-editor/index.esm.js +458 -458
- package/components/expression-editor/index.umd.cjs +2 -2
- package/components/filter-condition-editor/index.esm.js +386 -386
- package/components/filter-condition-editor/index.umd.cjs +1 -1
- package/components/flow-canvas/index.esm.js +1100 -1100
- package/components/flow-canvas/index.umd.cjs +7 -7
- package/components/mapping-editor/index.esm.js +243 -243
- package/components/mapping-editor/index.umd.cjs +2 -2
- package/components/message-box/index.esm.js +82 -82
- package/components/message-box/index.umd.cjs +1 -1
- package/components/modal/index.esm.js +76 -76
- package/components/modal/index.umd.cjs +1 -1
- package/components/order/index.esm.js +139 -138
- package/components/order/index.umd.cjs +1 -1
- package/components/query-solution/index.esm.js +891 -891
- package/components/query-solution/index.umd.cjs +1 -1
- package/components/response-toolbar/index.esm.js +151 -149
- package/components/response-toolbar/index.umd.cjs +1 -1
- package/components/schema-selector/index.esm.js +947 -941
- package/components/schema-selector/index.umd.cjs +6 -6
- package/components/section/index.esm.js +121 -121
- package/components/section/index.umd.cjs +2 -2
- package/components/sort-condition-editor/index.esm.js +539 -539
- package/components/sort-condition-editor/index.umd.cjs +1 -1
- package/components/tabs/index.esm.js +448 -442
- package/components/tabs/index.umd.cjs +1 -1
- package/designer/button-edit/index.esm.js +97 -97
- package/designer/button-edit/index.umd.cjs +1 -1
- package/designer/data-grid/index.esm.js +6483 -6470
- package/designer/data-grid/index.umd.cjs +21 -21
- package/designer/farris-designer.all.esm.js +1891 -1885
- package/designer/farris-designer.all.umd.cjs +14 -14
- package/designer/radio-group/index.esm.js +183 -183
- package/designer/radio-group/index.umd.cjs +2 -2
- package/designer/response-toolbar/index.esm.js +558 -556
- package/designer/response-toolbar/index.umd.cjs +1 -1
- package/designer/tabs/index.esm.js +416 -416
- package/designer/tabs/index.umd.cjs +2 -2
- package/farris.all.esm.js +9133 -9119
- package/farris.all.umd.cjs +35 -35
- package/package.json +1 -1
- package/types/common/index.d.ts +1 -0
- package/types/common/utils/attrs.d.ts +26 -0
- package/types/modal/src/composition/type.d.ts +2 -0
- package/types/tabs/src/composition/types.d.ts +2 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { FNotifyService as
|
|
3
|
-
import { getCustomClass as
|
|
4
|
-
import
|
|
5
|
-
import { LocaleService as
|
|
6
|
-
import
|
|
1
|
+
import { ref as x, computed as T, watch as k, nextTick as F, reactive as pe, createVNode as v, mergeProps as W, withDirectives as te, resolveDirective as he, onMounted as U, vModelText as me, Fragment as ge, defineComponent as ne, shallowRef as q, provide as ye, inject as Te, onUnmounted as we, isVNode as Ce } from "vue";
|
|
2
|
+
import { FNotifyService as Se } from "../notify/index.esm.js";
|
|
3
|
+
import { getCustomClass as Be, extractDataAttrs as Ie, isMobilePhone as xe, EVENT_PROPERTY_TAB_IDS as Oe } from "../common/index.esm.js";
|
|
4
|
+
import Pe from "../capsule/index.esm.js";
|
|
5
|
+
import { LocaleService as _ } from "../locale/index.esm.js";
|
|
6
|
+
import He from "../response-toolbar/index.esm.js";
|
|
7
7
|
import "bignumber.js";
|
|
8
8
|
import "lodash-es";
|
|
9
|
-
import
|
|
10
|
-
import { BaseControlProperty as
|
|
11
|
-
const
|
|
9
|
+
import J from "../section/index.esm.js";
|
|
10
|
+
import { BaseControlProperty as je } from "../property-panel/index.esm.js";
|
|
11
|
+
const Me = {
|
|
12
12
|
/**
|
|
13
13
|
* 标签页显示样式
|
|
14
14
|
* @default 'default'
|
|
@@ -86,161 +86,161 @@ const Pe = {
|
|
|
86
86
|
*/
|
|
87
87
|
beforeTabSelect: { type: Function, default: null }
|
|
88
88
|
};
|
|
89
|
-
function
|
|
90
|
-
function e(t,
|
|
91
|
-
const
|
|
92
|
-
return
|
|
89
|
+
function nt() {
|
|
90
|
+
function e(t, n, c) {
|
|
91
|
+
const a = {};
|
|
92
|
+
return a.beforeTabSelect = (o) => n.call("beforeTabSelect", t, [o, t], c), a;
|
|
93
93
|
}
|
|
94
94
|
return {
|
|
95
95
|
resolve: e
|
|
96
96
|
};
|
|
97
97
|
}
|
|
98
|
-
function
|
|
99
|
-
const c = new
|
|
98
|
+
function Ae(e, t, n) {
|
|
99
|
+
const c = new Se(), a = x([]), o = x(e.activeId || "");
|
|
100
100
|
let f = "";
|
|
101
|
-
const
|
|
102
|
-
const
|
|
103
|
-
return (
|
|
101
|
+
const h = x(!0), d = x([]), p = x(!0), b = x(0), w = T(() => {
|
|
102
|
+
const l = a.value.find((r) => r.props.id === o.value);
|
|
103
|
+
return (l == null ? void 0 : l.props.toolbarPosition) === "inHead";
|
|
104
104
|
});
|
|
105
|
-
let
|
|
106
|
-
function
|
|
107
|
-
|
|
105
|
+
let S;
|
|
106
|
+
function H(l) {
|
|
107
|
+
S = l;
|
|
108
108
|
}
|
|
109
|
-
function
|
|
110
|
-
const r =
|
|
109
|
+
function O(l, u = !0) {
|
|
110
|
+
const r = l.findIndex((m) => m.props.show !== !1 && !m.props.disabled);
|
|
111
111
|
if (r !== -1) {
|
|
112
|
-
if (o.value =
|
|
112
|
+
if (o.value = l[r].props.id, !u)
|
|
113
113
|
return;
|
|
114
114
|
d.value = [];
|
|
115
|
-
const
|
|
116
|
-
|
|
115
|
+
const m = l[r];
|
|
116
|
+
m && m.props.toolbar && m.props.toolbar.buttons && m.props.toolbar.buttons.length && (d.value = [...m.props.toolbar.buttons], p.value = m.props.toolbarVisible);
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
|
-
function
|
|
120
|
-
o.value =
|
|
121
|
-
const u =
|
|
122
|
-
d.value = [], u && u.props.toolbar && u.props.toolbar.buttons && u.props.toolbar.buttons.length && (d.value = [...u.props.toolbar.buttons],
|
|
119
|
+
function i(l) {
|
|
120
|
+
o.value = l;
|
|
121
|
+
const u = a.value.find((r) => r.props.id === l);
|
|
122
|
+
d.value = [], u && u.props.toolbar && u.props.toolbar.buttons && u.props.toolbar.buttons.length && (d.value = [...u.props.toolbar.buttons], p.value = u.props.toolbarVisible), t.emit("update:activeId", l), t.emit("tabChange", {
|
|
123
123
|
prevId: f,
|
|
124
124
|
nextId: o.value
|
|
125
125
|
});
|
|
126
126
|
}
|
|
127
|
-
async function
|
|
128
|
-
var
|
|
129
|
-
const
|
|
130
|
-
prevId:
|
|
127
|
+
async function g(l, u, r, m) {
|
|
128
|
+
var L;
|
|
129
|
+
const P = await ((L = e.beforeTabSelect) == null ? void 0 : L.call(e, {
|
|
130
|
+
prevId: l,
|
|
131
131
|
nextId: u
|
|
132
132
|
}));
|
|
133
|
-
(typeof
|
|
133
|
+
(typeof P == "boolean" ? P : (P == null ? void 0 : P.canSelect) ?? !0) ? r && r() : (m && m(), typeof P != "boolean" && P.message && (c == null || c.warning({ message: P.message, position: "top-center" })));
|
|
134
134
|
}
|
|
135
|
-
function B(
|
|
135
|
+
function B(l) {
|
|
136
136
|
let u = -1;
|
|
137
137
|
if (!o.value) {
|
|
138
|
-
if (u =
|
|
138
|
+
if (u = l.findIndex((r) => o.value === r.props.id && r.props.show !== !1 && !r.props.disabled), u > -1)
|
|
139
139
|
return;
|
|
140
140
|
f = o.value;
|
|
141
141
|
}
|
|
142
|
-
|
|
143
|
-
|
|
142
|
+
O(l, !1), g(f, o.value, () => {
|
|
143
|
+
i(o.value), S && S();
|
|
144
144
|
}, () => {
|
|
145
145
|
o.value = f;
|
|
146
146
|
});
|
|
147
147
|
}
|
|
148
|
-
function
|
|
148
|
+
function y(l) {
|
|
149
149
|
let u = !1;
|
|
150
|
-
if (
|
|
151
|
-
const r =
|
|
150
|
+
if (l) {
|
|
151
|
+
const r = a.value.find((m) => m.props.id === l);
|
|
152
152
|
u = !r || r.props.show === !1 || r.props.disabled === !0;
|
|
153
153
|
}
|
|
154
154
|
if (u)
|
|
155
|
-
B(
|
|
156
|
-
else if (o.value !==
|
|
155
|
+
B(a.value);
|
|
156
|
+
else if (o.value !== l) {
|
|
157
157
|
const r = o.value;
|
|
158
|
-
|
|
159
|
-
f = r, o.value =
|
|
158
|
+
g(r, l, () => {
|
|
159
|
+
f = r, o.value = l, i(o.value), S && S();
|
|
160
160
|
}, () => {
|
|
161
161
|
o.value = r, t.emit("update:activeId", r);
|
|
162
162
|
});
|
|
163
163
|
} else
|
|
164
|
-
|
|
164
|
+
i(o.value);
|
|
165
165
|
}
|
|
166
|
-
|
|
167
|
-
|
|
166
|
+
k(() => e.activeId, (l, u) => {
|
|
167
|
+
l !== u && e.activeId !== o.value && y(l);
|
|
168
168
|
});
|
|
169
|
-
function
|
|
169
|
+
function C(l) {
|
|
170
170
|
var r;
|
|
171
171
|
if (e.autoTitleWidth)
|
|
172
172
|
return;
|
|
173
|
-
const u = (r =
|
|
173
|
+
const u = (r = l.value) == null ? void 0 : r.querySelectorAll(".st-tab-text");
|
|
174
174
|
if (!(!u || e.tabType === "pill"))
|
|
175
|
-
for (let
|
|
176
|
-
const
|
|
177
|
-
u[
|
|
175
|
+
for (let m = 0; m < u.length; m++) {
|
|
176
|
+
const P = u[m].parentNode;
|
|
177
|
+
u[m].scrollWidth > P.offsetWidth ? u[m].classList.contains("farris-title-text-custom") || u[m].classList.add("farris-title-text-custom") : u[m].classList.remove("farris-title-text-custom");
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
|
-
const
|
|
181
|
-
|
|
180
|
+
const j = (l) => {
|
|
181
|
+
l.preventDefault(), l.stopPropagation();
|
|
182
182
|
};
|
|
183
|
-
function
|
|
184
|
-
const
|
|
185
|
-
|
|
186
|
-
b.value++,
|
|
187
|
-
removeIndex:
|
|
183
|
+
function A(l, u, r = !1) {
|
|
184
|
+
const m = a.value.findIndex((P) => P.props.id === u);
|
|
185
|
+
a.value = a.value.filter((P) => P.props.id !== u), o.value === u && (f = u, o.value = "", O(a.value)), j(l), F(() => {
|
|
186
|
+
b.value++, C(n), r && (h.value = !0), t.emit("tabRemove", {
|
|
187
|
+
removeIndex: m,
|
|
188
188
|
removeId: u,
|
|
189
189
|
activeId: o.value
|
|
190
190
|
});
|
|
191
191
|
});
|
|
192
192
|
}
|
|
193
|
-
function
|
|
194
|
-
const r =
|
|
195
|
-
r && (r.props.show === !1 && o.value ===
|
|
196
|
-
b.value++, u && (
|
|
193
|
+
function D(l, u = !0) {
|
|
194
|
+
const r = a.value.find((m) => m.props.id === l);
|
|
195
|
+
r && (r.props.show === !1 && o.value === l ? (o.value = "", f = l, y("")) : r.props.show === !0 && !o.value && B(a.value), F(() => {
|
|
196
|
+
b.value++, u && (h.value = !0);
|
|
197
197
|
}));
|
|
198
198
|
}
|
|
199
|
-
function R(
|
|
200
|
-
o.value !==
|
|
201
|
-
f = o.value,
|
|
199
|
+
function R(l) {
|
|
200
|
+
o.value !== l && g(f, l, () => {
|
|
201
|
+
f = o.value, i(l), S && S();
|
|
202
202
|
}, null);
|
|
203
203
|
}
|
|
204
|
-
function
|
|
205
|
-
|
|
204
|
+
function V(l) {
|
|
205
|
+
a.value.findIndex((r) => r.props.id === l.props.id) === -1 && a.value.push(l), b.value++;
|
|
206
206
|
}
|
|
207
|
-
function
|
|
208
|
-
|
|
209
|
-
r.props.id ===
|
|
210
|
-
}),
|
|
211
|
-
b.value++,
|
|
207
|
+
function s(l) {
|
|
208
|
+
a.value.findIndex((r) => r.props.id === l.props.id) !== -1 && (a.value.forEach((r) => {
|
|
209
|
+
r.props.id === l.props.id && (r = l);
|
|
210
|
+
}), l.props.id === o.value && w.value, F(() => {
|
|
211
|
+
b.value++, C(n);
|
|
212
212
|
}));
|
|
213
213
|
}
|
|
214
214
|
return {
|
|
215
215
|
activeId: o,
|
|
216
|
-
addTab:
|
|
217
|
-
changeTitleStyle:
|
|
218
|
-
removeTab:
|
|
216
|
+
addTab: V,
|
|
217
|
+
changeTitleStyle: C,
|
|
218
|
+
removeTab: A,
|
|
219
219
|
selectTab: R,
|
|
220
|
-
tabPages:
|
|
221
|
-
updateTab:
|
|
220
|
+
tabPages: a,
|
|
221
|
+
updateTab: s,
|
|
222
222
|
toolbarItems: d,
|
|
223
223
|
needUpdateNavigationLayout: b,
|
|
224
|
-
checkActiveIdAndSelect:
|
|
225
|
-
toggleShowTab:
|
|
224
|
+
checkActiveIdAndSelect: y,
|
|
225
|
+
toggleShowTab: D,
|
|
226
226
|
hasInHeadClass: w,
|
|
227
|
-
setScrollToSelectedTabFunction:
|
|
228
|
-
toolbarVisible:
|
|
227
|
+
setScrollToSelectedTabFunction: H,
|
|
228
|
+
toolbarVisible: p
|
|
229
229
|
};
|
|
230
230
|
}
|
|
231
|
-
function
|
|
231
|
+
function Re(e, t, n, c, a) {
|
|
232
232
|
const {
|
|
233
233
|
activeId: o,
|
|
234
234
|
removeTab: f,
|
|
235
|
-
selectTab:
|
|
236
|
-
} =
|
|
237
|
-
const
|
|
235
|
+
selectTab: h
|
|
236
|
+
} = a, d = T(() => {
|
|
237
|
+
const C = {
|
|
238
238
|
"st-tab-text": !0,
|
|
239
239
|
"text-truncate": e.tabType === "pill" && !e.autoTitleWidth,
|
|
240
240
|
"farris-title-auto": e.autoTitleWidth
|
|
241
241
|
};
|
|
242
|
-
return
|
|
243
|
-
}),
|
|
242
|
+
return Be(C, t.customTitleClass);
|
|
243
|
+
}), p = T(() => ({
|
|
244
244
|
"nav-item": !0,
|
|
245
245
|
"d-none": t.show !== void 0 ? !t.show : !1,
|
|
246
246
|
"f-state-active": t.id === o.value,
|
|
@@ -252,65 +252,66 @@ function Me(e, t, l, c, i) {
|
|
|
252
252
|
"tabs-text-truncate": !0,
|
|
253
253
|
active: t.id === o.value,
|
|
254
254
|
disabled: t.disabled
|
|
255
|
-
})),
|
|
255
|
+
})), S = pe({
|
|
256
256
|
content: t.title,
|
|
257
257
|
overflowShown: !0
|
|
258
258
|
});
|
|
259
|
-
function
|
|
260
|
-
return e.tabType !== "pill" && !e.autoTitleWidth ?
|
|
259
|
+
function H() {
|
|
260
|
+
return e.tabType !== "pill" && !e.autoTitleWidth ? te(v("span", {
|
|
261
261
|
class: d.value,
|
|
262
262
|
"data-tabid": t.id
|
|
263
|
-
}, [t.title]), [[
|
|
263
|
+
}, [t.title]), [[he("tooltip"), S]]) : v("span", {
|
|
264
264
|
class: d.value,
|
|
265
265
|
"data-tabid": t.id,
|
|
266
266
|
title: t.title
|
|
267
267
|
}, [t.title]);
|
|
268
268
|
}
|
|
269
|
-
const
|
|
270
|
-
function
|
|
271
|
-
return
|
|
269
|
+
const O = x(t.removeable);
|
|
270
|
+
function i() {
|
|
271
|
+
return O.value ? v("span", {
|
|
272
272
|
class: "st-drop-close",
|
|
273
|
-
onClick: (
|
|
273
|
+
onClick: (C) => f(C, t.id)
|
|
274
274
|
}, [v("i", {
|
|
275
275
|
class: "f-icon f-icon-close"
|
|
276
276
|
}, null)]) : "";
|
|
277
277
|
}
|
|
278
|
-
function
|
|
279
|
-
|
|
278
|
+
function g(C) {
|
|
279
|
+
h(t.id), e.tabType === "one-page" && c.scrollToByPaggId(t.id);
|
|
280
280
|
}
|
|
281
|
-
|
|
282
|
-
|
|
281
|
+
const B = Ie(n.attrs);
|
|
282
|
+
function y() {
|
|
283
|
+
return n.slots.title ? v("a", W(B, {
|
|
283
284
|
class: w.value,
|
|
284
|
-
onClick:
|
|
285
|
+
onClick: g,
|
|
285
286
|
id: `${t.id}-tab-title`
|
|
286
|
-
}, [
|
|
287
|
+
}), [n.slots.title(n), i()]) : t.titleRenderFunction ? v("a", W(B, {
|
|
287
288
|
class: w.value,
|
|
288
|
-
onClick:
|
|
289
|
+
onClick: g,
|
|
289
290
|
id: `${t.id}-tab-title`
|
|
290
|
-
}, [t.titleRenderFunction(),
|
|
291
|
+
}), [t.titleRenderFunction(), i()]) : v("a", W(B, {
|
|
291
292
|
class: w.value,
|
|
292
|
-
onClick:
|
|
293
|
+
onClick: g,
|
|
293
294
|
id: `${t.id}-tab-title`
|
|
294
|
-
}, [
|
|
295
|
+
}), [H(), i()]);
|
|
295
296
|
}
|
|
296
297
|
return v("li", {
|
|
297
|
-
class:
|
|
298
|
+
class: p.value,
|
|
298
299
|
style: b.value
|
|
299
|
-
}, [
|
|
300
|
+
}, [y()]);
|
|
300
301
|
}
|
|
301
|
-
function
|
|
302
|
+
function ke(e, t, n, c, a) {
|
|
302
303
|
const {
|
|
303
304
|
shouldShowNavigationButtons: o
|
|
304
|
-
} =
|
|
305
|
+
} = n, {
|
|
305
306
|
tabPages: f
|
|
306
|
-
} =
|
|
307
|
+
} = a, h = T(() => ({
|
|
307
308
|
spacer: !0,
|
|
308
309
|
"f-utils-fill": !0,
|
|
309
310
|
"spacer-sides-dropdown": o.value
|
|
310
311
|
})), d = T(() => ({
|
|
311
312
|
width: "100%",
|
|
312
313
|
"justify-content": e.justifyContent
|
|
313
|
-
})),
|
|
314
|
+
})), p = T(() => ({
|
|
314
315
|
nav: !0,
|
|
315
316
|
"farris-nav-tabs": !0,
|
|
316
317
|
"flex-nowrap": !0,
|
|
@@ -320,180 +321,180 @@ function je(e, t, l, c, i) {
|
|
|
320
321
|
"flex-column": e.position === "left" || e.position === "right"
|
|
321
322
|
}));
|
|
322
323
|
return () => v("div", {
|
|
323
|
-
class:
|
|
324
|
+
class: h.value,
|
|
324
325
|
style: d.value
|
|
325
326
|
}, [v("ul", {
|
|
326
|
-
class:
|
|
327
|
+
class: p.value,
|
|
327
328
|
ref: t
|
|
328
|
-
}, [f.value.map((b) =>
|
|
329
|
+
}, [f.value.map((b) => Re(e, b.props, b, c, a))])]);
|
|
329
330
|
}
|
|
330
|
-
function
|
|
331
|
-
const o =
|
|
331
|
+
function De(e, t, n, c, a) {
|
|
332
|
+
const o = x(), {
|
|
332
333
|
shouldShowNavigationButtons: f
|
|
333
|
-
} =
|
|
334
|
-
activeId:
|
|
334
|
+
} = n, {
|
|
335
|
+
activeId: h,
|
|
335
336
|
tabPages: d,
|
|
336
|
-
selectTab:
|
|
337
|
-
} =
|
|
338
|
-
name:
|
|
339
|
-
value:
|
|
340
|
-
show:
|
|
341
|
-
disabled:
|
|
342
|
-
}))),
|
|
337
|
+
selectTab: p
|
|
338
|
+
} = a, b = x(h.value), w = T(() => d.value.map((i) => ({
|
|
339
|
+
name: i.props.title,
|
|
340
|
+
value: i.props.id,
|
|
341
|
+
show: i.props.show,
|
|
342
|
+
disabled: i.props.disabled
|
|
343
|
+
}))), S = T(() => ({
|
|
343
344
|
spacer: !0,
|
|
344
345
|
"f-utils-fill": !0,
|
|
345
346
|
"spacer-sides-dropdown": f.value
|
|
346
|
-
})),
|
|
347
|
+
})), H = T(() => ({
|
|
347
348
|
width: "100%",
|
|
348
349
|
display: "flex",
|
|
349
350
|
"justify-content": e.justifyContent
|
|
350
351
|
}));
|
|
351
|
-
|
|
352
|
+
U(() => {
|
|
352
353
|
o.value && (t.value = o.value.$el);
|
|
353
354
|
});
|
|
354
|
-
function
|
|
355
|
-
|
|
355
|
+
function O(i) {
|
|
356
|
+
p(i);
|
|
356
357
|
}
|
|
357
|
-
return
|
|
358
|
-
|
|
358
|
+
return k(() => h.value, (i) => {
|
|
359
|
+
i !== b.value && (b.value = i);
|
|
359
360
|
}, {
|
|
360
361
|
immediate: !0
|
|
361
362
|
}), () => v("div", {
|
|
362
|
-
class:
|
|
363
|
-
style:
|
|
364
|
-
}, [v(
|
|
363
|
+
class: S.value,
|
|
364
|
+
style: H.value
|
|
365
|
+
}, [v(Pe, {
|
|
365
366
|
items: w.value,
|
|
366
367
|
modelValue: b.value,
|
|
367
|
-
"onUpdate:modelValue": (
|
|
368
|
-
onChange:
|
|
368
|
+
"onUpdate:modelValue": (i) => b.value = i,
|
|
369
|
+
onChange: O,
|
|
369
370
|
ref: o
|
|
370
371
|
}, null)]);
|
|
371
372
|
}
|
|
372
|
-
function
|
|
373
|
-
const
|
|
373
|
+
function Ve(e, t, n, c) {
|
|
374
|
+
const a = x(), {
|
|
374
375
|
activeId: o,
|
|
375
376
|
removeTab: f,
|
|
376
|
-
tabPages:
|
|
377
|
+
tabPages: h,
|
|
377
378
|
selectTab: d
|
|
378
379
|
} = c, {
|
|
379
|
-
hideDropDown:
|
|
380
|
+
hideDropDown: p,
|
|
380
381
|
searchTabText: b
|
|
381
382
|
} = t, w = 600;
|
|
382
|
-
let
|
|
383
|
-
const
|
|
384
|
-
var
|
|
385
|
-
let
|
|
386
|
-
return e.searchBoxVisible ?
|
|
387
|
-
}),
|
|
383
|
+
let S = null;
|
|
384
|
+
const H = T(() => {
|
|
385
|
+
var l, u;
|
|
386
|
+
let s = [];
|
|
387
|
+
return e.searchBoxVisible ? s = (l = h.value) == null ? void 0 : l.filter((r) => r.props.title.includes(b.value)) : s = (u = h.value) == null ? void 0 : u.slice(), s;
|
|
388
|
+
}), O = T(() => ({
|
|
388
389
|
"dropdown-menu": !0,
|
|
389
390
|
"tabs-pt28": e.searchBoxVisible,
|
|
390
391
|
// 未看到样式定义
|
|
391
|
-
show: !
|
|
392
|
-
"d-none":
|
|
392
|
+
show: !p.value,
|
|
393
|
+
"d-none": p.value
|
|
393
394
|
}));
|
|
394
|
-
let
|
|
395
|
-
function
|
|
396
|
-
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
if (
|
|
400
|
-
if (
|
|
401
|
-
|
|
395
|
+
let i;
|
|
396
|
+
function g(s) {
|
|
397
|
+
i = s;
|
|
398
|
+
}
|
|
399
|
+
k(p, (s) => {
|
|
400
|
+
if (i.value)
|
|
401
|
+
if (s)
|
|
402
|
+
a.value.style.width = null;
|
|
402
403
|
else {
|
|
403
|
-
const
|
|
404
|
-
|
|
404
|
+
const l = i.value.querySelector(".farris-tabs-header"), u = i.value.clientHeight - l.clientHeight - 20, m = l.querySelector(".farris-tabs-title").clientWidth - 20;
|
|
405
|
+
a.value.style.maxWidth = m + "px", a.value.style.maxHeight = u + "px", F(() => {
|
|
405
406
|
const {
|
|
406
|
-
width:
|
|
407
|
-
} =
|
|
408
|
-
|
|
407
|
+
width: P
|
|
408
|
+
} = a.value.getClientRects()[0];
|
|
409
|
+
a.value.style.width = P ? P + "px" : null;
|
|
409
410
|
});
|
|
410
411
|
}
|
|
411
412
|
});
|
|
412
|
-
function B(
|
|
413
|
+
function B(s) {
|
|
413
414
|
return {
|
|
414
415
|
"dropdown-item": !0,
|
|
415
416
|
"text-truncate": !0,
|
|
416
417
|
"px-2": !0,
|
|
417
|
-
disabled:
|
|
418
|
-
active:
|
|
419
|
-
"d-none":
|
|
418
|
+
disabled: s.props.disabled,
|
|
419
|
+
active: s.props.id === o.value,
|
|
420
|
+
"d-none": s.props.show !== !0
|
|
420
421
|
};
|
|
421
422
|
}
|
|
422
|
-
function
|
|
423
|
-
|
|
423
|
+
function y(s) {
|
|
424
|
+
s.preventDefault(), s.stopPropagation();
|
|
424
425
|
}
|
|
425
|
-
function
|
|
426
|
-
|
|
426
|
+
function C() {
|
|
427
|
+
S && clearTimeout(S);
|
|
427
428
|
}
|
|
428
|
-
function
|
|
429
|
-
|
|
430
|
-
|
|
429
|
+
function j() {
|
|
430
|
+
p.value || (S = setTimeout(() => {
|
|
431
|
+
p.value = !0;
|
|
431
432
|
}, w));
|
|
432
433
|
}
|
|
433
|
-
function
|
|
434
|
-
|
|
434
|
+
function A(s, l) {
|
|
435
|
+
s.stopPropagation(), l.disabled || d(l.id), p.value = !0;
|
|
435
436
|
}
|
|
436
|
-
function
|
|
437
|
-
|
|
437
|
+
function D(s, l) {
|
|
438
|
+
s.stopPropagation(), f(s, l, !0);
|
|
438
439
|
}
|
|
439
|
-
function R(
|
|
440
|
-
return
|
|
440
|
+
function R(s) {
|
|
441
|
+
return s.slots.title ? v("a", {
|
|
441
442
|
class: "dropdown-title",
|
|
442
|
-
id: `${
|
|
443
|
-
}, [
|
|
443
|
+
id: `${s.props.id}-dropdown-item`
|
|
444
|
+
}, [s.slots.title(s)]) : s.props.titleRenderFunction ? v("a", {
|
|
444
445
|
class: "dropdown-title",
|
|
445
|
-
id: `${
|
|
446
|
-
}, [
|
|
446
|
+
id: `${s.props.id}-dropdown-item`
|
|
447
|
+
}, [s.props.titleRenderFunction()]) : v("a", {
|
|
447
448
|
class: "dropdown-title",
|
|
448
|
-
id: `${
|
|
449
|
-
}, [
|
|
449
|
+
id: `${s.props.id}-dropdown-item`
|
|
450
|
+
}, [s.props.title]);
|
|
450
451
|
}
|
|
451
|
-
function
|
|
452
|
+
function V() {
|
|
452
453
|
return v("div", {
|
|
453
|
-
ref:
|
|
454
|
-
class:
|
|
455
|
-
onMouseenter: () =>
|
|
456
|
-
onMouseleave: () =>
|
|
454
|
+
ref: a,
|
|
455
|
+
class: O.value,
|
|
456
|
+
onMouseenter: () => C(),
|
|
457
|
+
onMouseleave: () => j()
|
|
457
458
|
}, [e.searchBoxVisible && v("div", {
|
|
458
|
-
onClick: (
|
|
459
|
+
onClick: (s) => y(s),
|
|
459
460
|
class: "pb-1 tabs-li-absolute"
|
|
460
|
-
}, [
|
|
461
|
+
}, [te(v("input", {
|
|
461
462
|
type: "text",
|
|
462
463
|
class: "form-control",
|
|
463
|
-
"onUpdate:modelValue": (
|
|
464
|
-
}, null), [[
|
|
464
|
+
"onUpdate:modelValue": (s) => b.value = s
|
|
465
|
+
}, null), [[me, b.value]]), v("span", {
|
|
465
466
|
class: "f-icon f-icon-page-title-query tabs-icon-search"
|
|
466
|
-
}, null)]),
|
|
467
|
+
}, null)]), H.value.length ? v("ul", {
|
|
467
468
|
class: "tab-dropdown-menu--items flex-fill"
|
|
468
|
-
}, [
|
|
469
|
-
class: B(
|
|
470
|
-
onClick: (
|
|
471
|
-
}, [
|
|
469
|
+
}, [H.value.map((s) => v("li", {
|
|
470
|
+
class: B(s),
|
|
471
|
+
onClick: (l) => A(l, s.props)
|
|
472
|
+
}, [s.props.removeable && s.props.disabled !== !0 && v("span", {
|
|
472
473
|
class: "float-right st-drop-close",
|
|
473
|
-
onClick: (
|
|
474
|
+
onClick: (l) => D(l, s.props.id)
|
|
474
475
|
}, [v("i", {
|
|
475
476
|
class: "f-icon f-icon-close"
|
|
476
|
-
}, null)]), R(
|
|
477
|
+
}, null)]), R(s)]))]) : v("div", {
|
|
477
478
|
class: "dropdown-no-data"
|
|
478
|
-
}, [
|
|
479
|
+
}, [_.getLocaleValue("tabs.noData")])]);
|
|
479
480
|
}
|
|
480
481
|
return {
|
|
481
|
-
renderDropdownMenu:
|
|
482
|
-
setTabsRef:
|
|
482
|
+
renderDropdownMenu: V,
|
|
483
|
+
setTabsRef: g
|
|
483
484
|
};
|
|
484
485
|
}
|
|
485
|
-
function
|
|
486
|
+
function Fe(e, t, n, c) {
|
|
486
487
|
const {
|
|
487
|
-
hideDropDown:
|
|
488
|
+
hideDropDown: a
|
|
488
489
|
} = t, {
|
|
489
490
|
renderDropdownMenu: o,
|
|
490
491
|
setTabsRef: f
|
|
491
|
-
} =
|
|
492
|
+
} = Ve(e, t, n, c), h = x(e.showDropdown);
|
|
492
493
|
function d() {
|
|
493
|
-
return
|
|
494
|
+
return h.value && v(ge, null, [v("button", {
|
|
494
495
|
class: "btn dropdown-toggle-split dropdown-toggle",
|
|
495
496
|
onClick: () => {
|
|
496
|
-
|
|
497
|
+
a.value = !1;
|
|
497
498
|
}
|
|
498
499
|
}, null), o()]);
|
|
499
500
|
}
|
|
@@ -502,135 +503,135 @@ function Ae(e, t, l, c) {
|
|
|
502
503
|
setTabsRef: f
|
|
503
504
|
};
|
|
504
505
|
}
|
|
505
|
-
function
|
|
506
|
-
const
|
|
506
|
+
function Le(e, t, n, c) {
|
|
507
|
+
const a = x(!1), { selectTab: o, tabPages: f, needUpdateNavigationLayout: h, activeId: d } = c, p = 4, b = T(() => ({
|
|
507
508
|
btn: !0,
|
|
508
509
|
"sc-nav-btn": !0,
|
|
509
510
|
"px-1": !0,
|
|
510
511
|
"sc-nav-lr": !0,
|
|
511
|
-
"d-none": !
|
|
512
|
+
"d-none": !a.value
|
|
512
513
|
})), w = T(() => ({
|
|
513
514
|
"btn-group": !0,
|
|
514
515
|
"sc-nav-btn": !0,
|
|
515
516
|
dropdown: !0,
|
|
516
|
-
"d-none": !
|
|
517
|
-
})),
|
|
517
|
+
"d-none": !a.value
|
|
518
|
+
})), S = T(() => ({
|
|
518
519
|
btn: !0,
|
|
519
520
|
"sc-nav-rg": !0,
|
|
520
|
-
"d-none": !
|
|
521
|
+
"d-none": !a.value
|
|
521
522
|
}));
|
|
522
|
-
function
|
|
523
|
+
function H(y, C) {
|
|
523
524
|
if (!t.value)
|
|
524
525
|
return;
|
|
525
|
-
const
|
|
526
|
-
if (
|
|
527
|
-
if (t.value.scrollLeft >=
|
|
526
|
+
const j = t.value.scrollLeft, A = t.value.scrollWidth - t.value.offsetWidth;
|
|
527
|
+
if (C > 0) {
|
|
528
|
+
if (t.value.scrollLeft >= A)
|
|
528
529
|
return;
|
|
529
|
-
t.value.scrollLeft =
|
|
530
|
-
} else if (
|
|
530
|
+
t.value.scrollLeft = j + e.scrollStep + y;
|
|
531
|
+
} else if (C < 0) {
|
|
531
532
|
if (t.value.scrollLeft <= 0)
|
|
532
533
|
return;
|
|
533
|
-
t.value.scrollLeft =
|
|
534
|
+
t.value.scrollLeft = j - e.scrollStep - y;
|
|
534
535
|
}
|
|
535
536
|
}
|
|
536
|
-
function
|
|
537
|
-
if (!
|
|
537
|
+
function O(y = -1) {
|
|
538
|
+
if (!a.value || !t.value)
|
|
538
539
|
return;
|
|
539
|
-
|
|
540
|
-
const
|
|
541
|
-
if (
|
|
542
|
-
const R =
|
|
543
|
-
|
|
540
|
+
y < 0 && (y = f.value.findIndex((R) => R.props.id === d.value));
|
|
541
|
+
const C = e.tabType === "pills" ? ".f-capsule-item" : ".nav-item", j = t.value.querySelectorAll(C), { parentElement: A } = t.value, D = j[y];
|
|
542
|
+
if (D && A) {
|
|
543
|
+
const R = A.getBoundingClientRect().left, V = A.getBoundingClientRect().right, s = D.getBoundingClientRect().left, l = D.getBoundingClientRect().right;
|
|
544
|
+
s < R ? H(R - s, -1) : V < l && H(l - V, 1), e.tabType === "one-page" && n.scrollTo(y);
|
|
544
545
|
}
|
|
545
546
|
}
|
|
546
|
-
function
|
|
547
|
-
var
|
|
547
|
+
function i() {
|
|
548
|
+
var j;
|
|
548
549
|
if (!t.value)
|
|
549
550
|
return;
|
|
550
|
-
const
|
|
551
|
-
|
|
552
|
-
|
|
551
|
+
const y = t.value, C = (j = t.value) == null ? void 0 : j.parentElement;
|
|
552
|
+
a.value = C && y && C.offsetWidth < y.scrollWidth - p, a.value && F(() => {
|
|
553
|
+
O();
|
|
553
554
|
});
|
|
554
555
|
}
|
|
555
|
-
function y
|
|
556
|
-
|
|
556
|
+
function g(y) {
|
|
557
|
+
y.disabled || o(y.id);
|
|
557
558
|
}
|
|
558
559
|
function B() {
|
|
559
|
-
["default", "one-page"].indexOf(e.tabType) > -1 &&
|
|
560
|
-
|
|
560
|
+
["default", "one-page"].indexOf(e.tabType) > -1 && F(() => {
|
|
561
|
+
O();
|
|
561
562
|
});
|
|
562
563
|
}
|
|
563
|
-
return
|
|
564
|
-
|
|
564
|
+
return k(h, () => {
|
|
565
|
+
i();
|
|
565
566
|
}), {
|
|
566
567
|
previousButtonClass: b,
|
|
567
568
|
nextButtonGroupClass: w,
|
|
568
|
-
nextButtonClass:
|
|
569
|
-
scrollTab:
|
|
570
|
-
selectAndScrollToTab:
|
|
571
|
-
shouldShowNavigationButtons:
|
|
572
|
-
updateNavigationLayout:
|
|
569
|
+
nextButtonClass: S,
|
|
570
|
+
scrollTab: H,
|
|
571
|
+
selectAndScrollToTab: g,
|
|
572
|
+
shouldShowNavigationButtons: a,
|
|
573
|
+
updateNavigationLayout: i,
|
|
573
574
|
scrollToSelectedTab: B
|
|
574
575
|
};
|
|
575
576
|
}
|
|
576
|
-
function
|
|
577
|
-
const { tabPages:
|
|
578
|
-
return
|
|
579
|
-
|
|
577
|
+
function We(e, t) {
|
|
578
|
+
const { tabPages: n } = t, c = x(""), a = x(!0), o = T(() => e.searchBoxVisible), f = T(() => o.value ? n.value.filter((d) => d.props.title.includes(c.value)) : n.value.slice());
|
|
579
|
+
return k(a, (h) => {
|
|
580
|
+
h || (c.value = "");
|
|
580
581
|
}), {
|
|
581
582
|
searchTabText: c,
|
|
582
|
-
hideDropDown:
|
|
583
|
+
hideDropDown: a,
|
|
583
584
|
shouldShowSearchBox: o,
|
|
584
585
|
tabsInDropdownMenu: f
|
|
585
586
|
};
|
|
586
587
|
}
|
|
587
|
-
function
|
|
588
|
-
const c = ".farris-tab-page", { tabPages:
|
|
588
|
+
function Ee(e, t, n) {
|
|
589
|
+
const c = ".farris-tab-page", { tabPages: a } = n;
|
|
589
590
|
let o = -1;
|
|
590
591
|
function f() {
|
|
591
592
|
if (o < 0) {
|
|
592
|
-
const
|
|
593
|
-
|
|
593
|
+
const p = document.querySelector(".farris-tabs-header");
|
|
594
|
+
p && (o = p.clientHeight);
|
|
594
595
|
}
|
|
595
596
|
return o;
|
|
596
597
|
}
|
|
597
|
-
function
|
|
598
|
+
function h(p) {
|
|
598
599
|
const b = t.value;
|
|
599
600
|
if (b) {
|
|
600
601
|
const w = t.value.querySelectorAll(c);
|
|
601
602
|
if (w.length > 0) {
|
|
602
|
-
const
|
|
603
|
-
b.scrollTop =
|
|
603
|
+
const S = w[p], { offsetTop: H } = S, O = H - f();
|
|
604
|
+
b.scrollTop = O > 0 ? O : 0;
|
|
604
605
|
}
|
|
605
606
|
}
|
|
606
607
|
}
|
|
607
|
-
function d(
|
|
608
|
-
const b =
|
|
609
|
-
b > -1 &&
|
|
608
|
+
function d(p) {
|
|
609
|
+
const b = a.value.findIndex((w) => w.props.id === p);
|
|
610
|
+
b > -1 && h(b);
|
|
610
611
|
}
|
|
611
|
-
return { scrollTo:
|
|
612
|
+
return { scrollTo: h, scrollToByPaggId: d };
|
|
612
613
|
}
|
|
613
|
-
const
|
|
614
|
-
function
|
|
614
|
+
const Ne = ["moz", "ms", "webkit"];
|
|
615
|
+
function qe() {
|
|
615
616
|
let e = 0;
|
|
616
617
|
return (t) => {
|
|
617
|
-
const
|
|
618
|
-
t(
|
|
618
|
+
const n = (/* @__PURE__ */ new Date()).getTime(), c = Math.max(0, 16 - (n - e)), a = setTimeout(() => {
|
|
619
|
+
t(n + c);
|
|
619
620
|
}, c);
|
|
620
|
-
return e =
|
|
621
|
+
return e = n + c, a;
|
|
621
622
|
};
|
|
622
623
|
}
|
|
623
|
-
function
|
|
624
|
+
function $e() {
|
|
624
625
|
if (typeof window > "u")
|
|
625
626
|
return () => 0;
|
|
626
627
|
if (window.requestAnimationFrame)
|
|
627
628
|
return window.requestAnimationFrame.bind(window);
|
|
628
|
-
const e =
|
|
629
|
-
return e ? window[`${e}RequestAnimationFrame`] :
|
|
629
|
+
const e = Ne.filter((t) => `${t}RequestAnimationFrame` in window)[0];
|
|
630
|
+
return e ? window[`${e}RequestAnimationFrame`] : qe();
|
|
630
631
|
}
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
function
|
|
632
|
+
$e();
|
|
633
|
+
x("");
|
|
634
|
+
function le() {
|
|
634
635
|
if (typeof window > "u" || typeof navigator > "u")
|
|
635
636
|
return !1;
|
|
636
637
|
const e = navigator.userAgent || navigator.vendor || window.opera, t = [
|
|
@@ -643,7 +644,7 @@ function te() {
|
|
|
643
644
|
/IEMobile/i,
|
|
644
645
|
/Opera Mini/i,
|
|
645
646
|
/Harmony/i
|
|
646
|
-
],
|
|
647
|
+
], n = [
|
|
647
648
|
/iPad/i,
|
|
648
649
|
/Android(?!.*Mobile)/i,
|
|
649
650
|
// Android 平板通常不含 "Mobile"
|
|
@@ -652,7 +653,7 @@ function te() {
|
|
|
652
653
|
/Kindle/i,
|
|
653
654
|
/Silk/i
|
|
654
655
|
];
|
|
655
|
-
for (const d of
|
|
656
|
+
for (const d of n)
|
|
656
657
|
if (d.test(e))
|
|
657
658
|
return !1;
|
|
658
659
|
for (const d of t)
|
|
@@ -660,177 +661,180 @@ function te() {
|
|
|
660
661
|
return !0;
|
|
661
662
|
if (typeof screen > "u")
|
|
662
663
|
return !1;
|
|
663
|
-
const c = "ontouchstart" in window || navigator.maxTouchPoints > 0,
|
|
664
|
+
const c = "ontouchstart" in window || navigator.maxTouchPoints > 0, a = screen.width, o = screen.height, f = Math.min(a, o);
|
|
664
665
|
return !!(c && f <= 768);
|
|
665
666
|
}
|
|
666
|
-
function
|
|
667
|
-
const e =
|
|
667
|
+
function _e() {
|
|
668
|
+
const e = le();
|
|
668
669
|
return e && document.body.classList.add("f-mobile"), e;
|
|
669
670
|
}
|
|
670
|
-
typeof document < "u" &&
|
|
671
|
-
|
|
671
|
+
typeof document < "u" && _e();
|
|
672
|
+
function Q(e) {
|
|
673
|
+
return e ? Object.keys(e).reduce((t, n) => (n.startsWith("data-") && (t[n] = e[n]), t), {}) : {};
|
|
674
|
+
}
|
|
675
|
+
const $ = /* @__PURE__ */ ne({
|
|
672
676
|
name: "FTabs",
|
|
673
|
-
props:
|
|
677
|
+
props: Me,
|
|
674
678
|
emits: ["tabChange", "tabRemove", "update:activeId", "Click"],
|
|
675
679
|
setup(e, t) {
|
|
676
|
-
const
|
|
677
|
-
|
|
678
|
-
const
|
|
679
|
-
activeId:
|
|
680
|
+
const n = x(e.tabType), c = q(), a = le(), o = x(e.customClass), f = q();
|
|
681
|
+
q();
|
|
682
|
+
const h = x(), d = Ae(e, t, f), {
|
|
683
|
+
activeId: p,
|
|
680
684
|
changeTitleStyle: b,
|
|
681
685
|
tabPages: w,
|
|
682
|
-
addTab:
|
|
683
|
-
updateTab:
|
|
684
|
-
toolbarItems:
|
|
685
|
-
checkActiveIdAndSelect:
|
|
686
|
-
toggleShowTab:
|
|
686
|
+
addTab: S,
|
|
687
|
+
updateTab: H,
|
|
688
|
+
toolbarItems: O,
|
|
689
|
+
checkActiveIdAndSelect: i,
|
|
690
|
+
toggleShowTab: g,
|
|
687
691
|
hasInHeadClass: B,
|
|
688
|
-
toolbarVisible:
|
|
689
|
-
} = d,
|
|
690
|
-
previousButtonClass:
|
|
691
|
-
nextButtonClass:
|
|
692
|
+
toolbarVisible: y
|
|
693
|
+
} = d, C = Ee(e, c, d), j = Le(e, f, C, d), {
|
|
694
|
+
previousButtonClass: A,
|
|
695
|
+
nextButtonClass: D,
|
|
692
696
|
nextButtonGroupClass: R,
|
|
693
|
-
scrollTab:
|
|
694
|
-
updateNavigationLayout:
|
|
695
|
-
scrollToSelectedTab:
|
|
696
|
-
} =
|
|
697
|
-
d.setScrollToSelectedTabFunction(
|
|
698
|
-
const u =
|
|
697
|
+
scrollTab: V,
|
|
698
|
+
updateNavigationLayout: s,
|
|
699
|
+
scrollToSelectedTab: l
|
|
700
|
+
} = j;
|
|
701
|
+
d.setScrollToSelectedTabFunction(l);
|
|
702
|
+
const u = We(e, d), r = ke(e, f, j, C, d), m = r, P = De(e, f, j, C, d), N = /* @__PURE__ */ new Map([["default", r], ["one-page", m], ["pills", P]]);
|
|
699
703
|
T(() => {
|
|
700
|
-
const
|
|
701
|
-
return
|
|
704
|
+
const I = w.value.find((M) => M.props.id === p.value);
|
|
705
|
+
return I == null ? void 0 : I.slots;
|
|
702
706
|
});
|
|
703
|
-
const
|
|
704
|
-
t.emit("Click",
|
|
707
|
+
const L = T(() => e.fill), z = (I, M) => {
|
|
708
|
+
t.emit("Click", I, M, p.value);
|
|
705
709
|
};
|
|
706
|
-
|
|
707
|
-
activeId:
|
|
708
|
-
addTab:
|
|
709
|
-
updateTab:
|
|
710
|
+
ye("tabs", {
|
|
711
|
+
activeId: p,
|
|
712
|
+
addTab: S,
|
|
713
|
+
updateTab: H,
|
|
710
714
|
tabPages: w,
|
|
711
|
-
tabType:
|
|
712
|
-
shouldFillParentContaner:
|
|
713
|
-
toggleShowTab:
|
|
714
|
-
toolbarVisible:
|
|
715
|
-
clickToolbarItemHandler:
|
|
715
|
+
tabType: n,
|
|
716
|
+
shouldFillParentContaner: L,
|
|
717
|
+
toggleShowTab: g,
|
|
718
|
+
toolbarVisible: y,
|
|
719
|
+
clickToolbarItemHandler: z
|
|
716
720
|
});
|
|
717
|
-
let
|
|
718
|
-
const
|
|
721
|
+
let G = !1;
|
|
722
|
+
const oe = T(() => ({
|
|
719
723
|
"farris-tabs-header": !0,
|
|
720
724
|
"farris-tabs-inHead": B.value,
|
|
721
725
|
"farris-tabs-inContent": !B.value,
|
|
722
726
|
"farris-tabs-nav-fill": e.tabType === "fill",
|
|
723
727
|
"farris-tabs-nav-pills": e.tabType === "pills",
|
|
724
728
|
"d-none": e.showHeader === !1
|
|
725
|
-
})),
|
|
726
|
-
const
|
|
729
|
+
})), ae = T(() => {
|
|
730
|
+
const I = {
|
|
727
731
|
width: B.value && e.titleWidth ? `${e.titleWidth}%` : ""
|
|
728
732
|
};
|
|
729
|
-
return
|
|
730
|
-
}),
|
|
731
|
-
const
|
|
733
|
+
return I.width && (I.flex = "unset"), I;
|
|
734
|
+
}), ie = T(() => {
|
|
735
|
+
const I = {
|
|
732
736
|
"farris-tabs": !0,
|
|
733
|
-
"f-tabs-content-fill":
|
|
737
|
+
"f-tabs-content-fill": L.value,
|
|
734
738
|
"flex-column": e.position === "top",
|
|
735
739
|
"flex-column-reverse": e.position === "bottom",
|
|
736
740
|
"flex-row": e.position === "left",
|
|
737
741
|
"flex-row-reverse": e.position === "right",
|
|
738
742
|
"one-page": e.tabType === "one-page"
|
|
739
743
|
};
|
|
740
|
-
return o.value && o.value.split(" ").reduce((
|
|
741
|
-
}),
|
|
742
|
-
|
|
744
|
+
return o.value && o.value.split(" ").reduce((M, E) => (M[E] = !0, M), I), I;
|
|
745
|
+
}), se = new ResizeObserver((I) => {
|
|
746
|
+
I.length && s();
|
|
743
747
|
});
|
|
744
|
-
function
|
|
745
|
-
|
|
748
|
+
function X() {
|
|
749
|
+
h.value && !G && (se.observe(h.value), G = !0);
|
|
746
750
|
}
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
w.value.length &&
|
|
751
|
+
k(() => e.visible, (I) => {
|
|
752
|
+
F(() => {
|
|
753
|
+
w.value.length && i(e.activeId || w.value[0].props.id), s(), b(f), X();
|
|
750
754
|
});
|
|
751
|
-
}),
|
|
752
|
-
|
|
753
|
-
|
|
755
|
+
}), k(() => e.autoTitleWidth, (I) => {
|
|
756
|
+
F(() => {
|
|
757
|
+
s(), b(f);
|
|
754
758
|
});
|
|
755
|
-
}),
|
|
756
|
-
e.visible && (w.value.length &&
|
|
757
|
-
|
|
758
|
-
}),
|
|
759
|
+
}), U(() => {
|
|
760
|
+
e.visible && (w.value.length && i(e.activeId || w.value[0].props.id), F(() => {
|
|
761
|
+
s(), b(f);
|
|
762
|
+
}), X());
|
|
759
763
|
});
|
|
760
|
-
function
|
|
764
|
+
function re() {
|
|
761
765
|
return v("button", {
|
|
762
|
-
title:
|
|
766
|
+
title: _.getLocaleValue("tabs.leftButton"),
|
|
763
767
|
type: "button",
|
|
764
|
-
class:
|
|
768
|
+
class: A.value,
|
|
765
769
|
onClick: () => {
|
|
766
|
-
|
|
770
|
+
V(0, -1);
|
|
767
771
|
}
|
|
768
772
|
}, null);
|
|
769
773
|
}
|
|
770
|
-
function
|
|
774
|
+
function ue() {
|
|
771
775
|
return v("button", {
|
|
772
|
-
title:
|
|
776
|
+
title: _.getLocaleValue("tabs.rightButton"),
|
|
773
777
|
type: "button",
|
|
774
|
-
class:
|
|
778
|
+
class: D.value,
|
|
775
779
|
onClick: () => {
|
|
776
|
-
|
|
780
|
+
V(0, 1);
|
|
777
781
|
}
|
|
778
782
|
}, null);
|
|
779
783
|
}
|
|
780
784
|
const {
|
|
781
|
-
renderMorePagesButtton:
|
|
782
|
-
setTabsRef:
|
|
783
|
-
} =
|
|
784
|
-
|
|
785
|
-
function
|
|
786
|
-
return
|
|
785
|
+
renderMorePagesButtton: ce,
|
|
786
|
+
setTabsRef: de
|
|
787
|
+
} = Fe(e, u, j, d);
|
|
788
|
+
de(c);
|
|
789
|
+
function fe() {
|
|
790
|
+
return O.value.length ? v("div", {
|
|
787
791
|
class: {
|
|
788
792
|
"farris-tabs-toolbar": !0,
|
|
789
|
-
"d-none": !
|
|
793
|
+
"d-none": !y.value
|
|
790
794
|
}
|
|
791
|
-
}, [v(
|
|
795
|
+
}, [v(He, W(Q(t.attrs), {
|
|
792
796
|
class: "f-utils-fill",
|
|
793
797
|
alignment: B.value ? "right" : "left",
|
|
794
|
-
items:
|
|
795
|
-
visible:
|
|
796
|
-
onClick:
|
|
797
|
-
}, null)]) : null;
|
|
798
|
+
items: O.value,
|
|
799
|
+
visible: y.value,
|
|
800
|
+
onClick: z
|
|
801
|
+
}), null)]) : null;
|
|
798
802
|
}
|
|
799
|
-
const
|
|
800
|
-
function
|
|
801
|
-
var
|
|
803
|
+
const K = N.get(e.tabType) || N.get("default");
|
|
804
|
+
function ve() {
|
|
805
|
+
var I, M, E, Y;
|
|
802
806
|
return v("div", {
|
|
803
|
-
class:
|
|
807
|
+
class: oe.value
|
|
804
808
|
}, [v("div", {
|
|
805
809
|
class: "farris-tabs-header-pre"
|
|
806
|
-
}, [(
|
|
810
|
+
}, [(M = (I = t.slots).headerPrefix) == null ? void 0 : M.call(I)]), v("div", {
|
|
807
811
|
class: "farris-tabs-title scroll-tabs",
|
|
808
|
-
style:
|
|
809
|
-
ref:
|
|
810
|
-
}, [!
|
|
811
|
-
hidden:
|
|
812
|
+
style: ae.value,
|
|
813
|
+
ref: h
|
|
814
|
+
}, [!a && re(), K && K(), v("div", {
|
|
815
|
+
hidden: a,
|
|
812
816
|
class: R.value
|
|
813
|
-
}, [
|
|
817
|
+
}, [ue(), ce()])]), fe(), v("div", {
|
|
814
818
|
class: "farris-tabs-header-post"
|
|
815
|
-
}, [(
|
|
819
|
+
}, [(Y = (E = t.slots).headerSuffix) == null ? void 0 : Y.call(E)])]);
|
|
816
820
|
}
|
|
817
821
|
T(() => ({
|
|
818
822
|
"farris-tabs-content": !0,
|
|
819
|
-
"f-utils-fill-flex-column":
|
|
823
|
+
"f-utils-fill-flex-column": L.value
|
|
820
824
|
}));
|
|
821
|
-
function
|
|
822
|
-
var
|
|
825
|
+
function be() {
|
|
826
|
+
var I, M;
|
|
823
827
|
return (
|
|
824
828
|
// <div class={tabsContentClass.value} ref={tabContentElementRef}>
|
|
825
|
-
(
|
|
829
|
+
(M = (I = t.slots).default) == null ? void 0 : M.call(I)
|
|
826
830
|
);
|
|
827
831
|
}
|
|
828
|
-
return () => e.visible ? v("div", {
|
|
829
|
-
class:
|
|
832
|
+
return () => e.visible ? v("div", W(Q(t.attrs), {
|
|
833
|
+
class: ie.value,
|
|
830
834
|
ref: c
|
|
831
|
-
}, [
|
|
835
|
+
}), [ve(), be()]) : null;
|
|
832
836
|
}
|
|
833
|
-
}),
|
|
837
|
+
}), Ue = {
|
|
834
838
|
tabWidth: { type: Number },
|
|
835
839
|
id: { type: String, default: "" },
|
|
836
840
|
customTitleClass: { type: String, default: "" },
|
|
@@ -853,109 +857,111 @@ const q = /* @__PURE__ */ ee({
|
|
|
853
857
|
/** 标题 */
|
|
854
858
|
titleRenderFunction: { type: Function }
|
|
855
859
|
};
|
|
856
|
-
function
|
|
857
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !
|
|
860
|
+
function Z(e) {
|
|
861
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !Ce(e);
|
|
858
862
|
}
|
|
859
|
-
const
|
|
863
|
+
const ee = /* @__PURE__ */ ne({
|
|
860
864
|
name: "FTabPage",
|
|
861
|
-
props:
|
|
865
|
+
props: Ue,
|
|
862
866
|
emits: [],
|
|
863
867
|
setup(e, t) {
|
|
864
|
-
const
|
|
865
|
-
|
|
866
|
-
const c =
|
|
868
|
+
const n = Te("tabs");
|
|
869
|
+
xe();
|
|
870
|
+
const c = x(e.show), a = {
|
|
867
871
|
slots: t.slots,
|
|
868
|
-
props: e
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
872
|
+
props: e,
|
|
873
|
+
attrs: t.attrs
|
|
874
|
+
}, o = x((n == null ? void 0 : n.tabType.value) || "default");
|
|
875
|
+
U(() => {
|
|
876
|
+
const i = n == null ? void 0 : n.tabPages.value.findIndex((g) => g.props.id === e.id);
|
|
877
|
+
(!i || i === -1) && (n == null || n.addTab(a));
|
|
878
|
+
}), we(() => {
|
|
874
879
|
});
|
|
875
|
-
const f = T(() => (e == null ? void 0 : e.id) === (
|
|
880
|
+
const f = T(() => (e == null ? void 0 : e.id) === (n == null ? void 0 : n.activeId.value)), h = T(() => ({
|
|
876
881
|
display: f.value ? "" : "none"
|
|
877
882
|
}));
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
props:
|
|
881
|
-
slots: t.slots
|
|
883
|
+
k(() => e, (i) => {
|
|
884
|
+
n == null || n.updateTab({
|
|
885
|
+
props: i,
|
|
886
|
+
slots: t.slots,
|
|
887
|
+
attrs: t.attrs
|
|
882
888
|
});
|
|
883
889
|
}, {
|
|
884
890
|
immediate: !0,
|
|
885
891
|
deep: !0
|
|
886
|
-
}),
|
|
887
|
-
c.value =
|
|
888
|
-
}),
|
|
889
|
-
f.value &&
|
|
892
|
+
}), k(() => e.show, (i) => {
|
|
893
|
+
c.value = i, n == null || n.toggleShowTab(e.id);
|
|
894
|
+
}), k(() => e.toolbarVisible, (i) => {
|
|
895
|
+
f.value && n && (n.toolbarVisible.value = i);
|
|
890
896
|
});
|
|
891
897
|
function d() {
|
|
892
|
-
var
|
|
893
|
-
const
|
|
894
|
-
return v(
|
|
898
|
+
var g, B;
|
|
899
|
+
const i = (B = (g = t.slots).default) == null ? void 0 : B.call(g);
|
|
900
|
+
return v(J, {
|
|
895
901
|
"main-title": e.title,
|
|
896
902
|
class: ["farris-tab-page", c.value ? "" : "f-tab-d-none"]
|
|
897
|
-
},
|
|
898
|
-
default: () => [
|
|
903
|
+
}, Z(i) ? i : {
|
|
904
|
+
default: () => [i]
|
|
899
905
|
});
|
|
900
906
|
}
|
|
901
|
-
function
|
|
902
|
-
|
|
907
|
+
function p(i, g) {
|
|
908
|
+
n && (n.activeId.value = e.id, n.clickToolbarItemHandler && n.clickToolbarItemHandler(i, g));
|
|
903
909
|
}
|
|
904
910
|
function b() {
|
|
905
|
-
var
|
|
906
|
-
const
|
|
907
|
-
return v(
|
|
911
|
+
var g, B;
|
|
912
|
+
const i = (B = (g = t.slots).default) == null ? void 0 : B.call(g);
|
|
913
|
+
return v(J, {
|
|
908
914
|
customClass: "section-in-tab is-mobile",
|
|
909
|
-
onClick:
|
|
915
|
+
onClick: p,
|
|
910
916
|
visible: e.show,
|
|
911
917
|
"main-title": e.title,
|
|
912
918
|
buttons: e.toolbar.buttons,
|
|
913
919
|
"button-position": e.toolbar.position || e.toolbarPosition,
|
|
914
920
|
"buttons-visible": e.toolbarVisible
|
|
915
|
-
},
|
|
916
|
-
default: () => [
|
|
921
|
+
}, Z(i) ? i : {
|
|
922
|
+
default: () => [i]
|
|
917
923
|
});
|
|
918
924
|
}
|
|
919
925
|
const w = T(() => {
|
|
920
|
-
var
|
|
926
|
+
var g;
|
|
921
927
|
return {
|
|
922
928
|
"farris-tab-page": !0,
|
|
923
929
|
"f-tab-d-none": !c.value,
|
|
924
|
-
"f-tab-active": f.value &&
|
|
930
|
+
"f-tab-active": f.value && n && ((g = n.shouldFillParentContaner) == null ? void 0 : g.value)
|
|
925
931
|
};
|
|
926
932
|
});
|
|
927
|
-
function
|
|
928
|
-
var
|
|
929
|
-
const
|
|
933
|
+
function S() {
|
|
934
|
+
var g, B;
|
|
935
|
+
const i = (B = (g = t.slots).default) == null ? void 0 : B.call(g);
|
|
930
936
|
return v("div", {
|
|
931
937
|
class: w.value,
|
|
932
|
-
style:
|
|
933
|
-
}, [
|
|
938
|
+
style: h.value
|
|
939
|
+
}, [i]);
|
|
934
940
|
}
|
|
935
|
-
const
|
|
936
|
-
return () =>
|
|
941
|
+
const O = (/* @__PURE__ */ new Map([["default", S], ["one-page", d], ["mobile", b]])).get(o.value) || S;
|
|
942
|
+
return () => O();
|
|
937
943
|
}
|
|
938
944
|
});
|
|
939
|
-
class
|
|
940
|
-
constructor(t,
|
|
941
|
-
super(t,
|
|
945
|
+
class lt extends je {
|
|
946
|
+
constructor(t, n) {
|
|
947
|
+
super(t, n);
|
|
942
948
|
}
|
|
943
|
-
getPropertyConfig(t,
|
|
949
|
+
getPropertyConfig(t, n = !1) {
|
|
944
950
|
return this.propertyConfig.categories.basic = this.getBasicPropConfig(t), this.propertyConfig.categories.basic.properties.text = {
|
|
945
951
|
title: "文本",
|
|
946
952
|
type: "string",
|
|
947
953
|
description: "",
|
|
948
954
|
refreshPanelAfterChanged: !0
|
|
949
|
-
}, this.getAppearanceProperties(t,
|
|
955
|
+
}, this.getAppearanceProperties(t, n), this.getbBehaviorConfig(t), this.getEventPropConfig(t), this.propertyConfig;
|
|
950
956
|
}
|
|
951
|
-
getAppearanceProperties(t,
|
|
957
|
+
getAppearanceProperties(t, n = !1) {
|
|
952
958
|
this.propertyConfig.categories.appearance = {
|
|
953
959
|
title: "外观",
|
|
954
960
|
properties: {
|
|
955
961
|
class: {
|
|
956
962
|
description: "组件的CSS样式",
|
|
957
963
|
title: "class样式",
|
|
958
|
-
visible: !
|
|
964
|
+
visible: !n
|
|
959
965
|
},
|
|
960
966
|
icon: {
|
|
961
967
|
title: "图标",
|
|
@@ -972,48 +978,48 @@ class et extends Oe {
|
|
|
972
978
|
};
|
|
973
979
|
}
|
|
974
980
|
getbBehaviorConfig(t) {
|
|
975
|
-
const
|
|
981
|
+
const n = this.getPropertyEditorParams(t, ["Const", "Variable", "StateMachine", "Custom", "Expression"], "disabled");
|
|
976
982
|
this.propertyConfig.categories.behavior = this.getBehaviorConfig(t, "", {
|
|
977
983
|
disabled: {
|
|
978
984
|
title: "禁用",
|
|
979
985
|
type: "boolean",
|
|
980
986
|
description: "按钮禁用状态",
|
|
981
987
|
refreshPanelAfterChanged: !0,
|
|
982
|
-
editor:
|
|
988
|
+
editor: n
|
|
983
989
|
}
|
|
984
990
|
});
|
|
985
991
|
}
|
|
986
992
|
getEventPropConfig(t) {
|
|
987
|
-
const
|
|
993
|
+
const n = [
|
|
988
994
|
{
|
|
989
995
|
label: "onClick",
|
|
990
996
|
name: "点击事件"
|
|
991
997
|
}
|
|
992
|
-
], c = this,
|
|
998
|
+
], c = this, a = c.eventsEditorUtils.formProperties(t, c.viewModelId, n), o = c.createBaseEventProperty(a);
|
|
993
999
|
this.propertyConfig.categories.eventsEditor = {
|
|
994
1000
|
title: "事件",
|
|
995
1001
|
hideTitle: !0,
|
|
996
1002
|
properties: o,
|
|
997
1003
|
// 这个属性,标记当属性变更得时候触发重新更新属性
|
|
998
1004
|
refreshPanelAfterChanged: !0,
|
|
999
|
-
tabId:
|
|
1005
|
+
tabId: Oe,
|
|
1000
1006
|
tabName: "交互",
|
|
1001
|
-
setPropertyRelates(f,
|
|
1007
|
+
setPropertyRelates(f, h) {
|
|
1002
1008
|
const d = f.propertyValue;
|
|
1003
1009
|
delete t[c.viewModelId], d && (d.setPropertyRelates = this.setPropertyRelates, c.eventsEditorUtils.saveRelatedParameters(t, c.viewModelId, d.events, d));
|
|
1004
1010
|
}
|
|
1005
1011
|
};
|
|
1006
1012
|
}
|
|
1007
1013
|
}
|
|
1008
|
-
|
|
1009
|
-
e.component(
|
|
1014
|
+
$.install = (e) => {
|
|
1015
|
+
e.component($.name, $), e.component(ee.name, ee);
|
|
1010
1016
|
};
|
|
1011
1017
|
export {
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1018
|
+
ee as FTabPage,
|
|
1019
|
+
$ as FTabs,
|
|
1020
|
+
lt as TabToolbarItemProperty,
|
|
1021
|
+
nt as createTabsCallbackResolver,
|
|
1022
|
+
$ as default,
|
|
1023
|
+
Ue as tabPageProps,
|
|
1024
|
+
Me as tabsProps
|
|
1019
1025
|
};
|