@farris/ui-vue 1.6.5-beta.8 → 1.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/avatar/index.esm.js +335 -335
- package/components/avatar/index.umd.cjs +1 -1
- package/components/button-edit/index.esm.js +6 -6
- package/components/button-edit/index.umd.cjs +1 -1
- package/components/combo-list/index.esm.js +139 -134
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/common/index.esm.js +1 -1
- package/components/common/index.umd.cjs +1 -1
- package/components/component/index.esm.js +300 -300
- package/components/component/index.umd.cjs +1 -1
- package/components/condition/index.esm.js +7 -6
- package/components/condition/index.umd.cjs +1 -1
- package/components/content-container/index.esm.js +295 -295
- package/components/content-container/index.umd.cjs +1 -1
- package/components/data-grid/index.esm.js +99 -99
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-view/index.esm.js +3407 -3338
- package/components/data-view/index.umd.cjs +1 -1
- package/components/date-picker/index.esm.js +833 -832
- package/components/date-picker/index.umd.cjs +1 -1
- package/components/designer-canvas/index.esm.js +5 -5
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/dynamic-form/index.esm.js +173 -172
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/events-editor/index.esm.js +637 -637
- package/components/events-editor/index.umd.cjs +3 -3
- package/components/expression-editor/index.esm.js +737 -732
- package/components/expression-editor/index.umd.cjs +4 -4
- package/components/filter-bar/index.esm.js +728 -706
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/filter-condition-editor/index.esm.js +670 -665
- package/components/filter-condition-editor/index.umd.cjs +2 -2
- package/components/flow-canvas/index.esm.js +205 -205
- package/components/flow-canvas/index.umd.cjs +1 -1
- package/components/language-textbox/index.esm.js +77 -76
- package/components/language-textbox/index.umd.cjs +1 -1
- package/components/list-nav/index.esm.js +4 -2
- package/components/list-nav/index.umd.cjs +1 -1
- package/components/list-view/index.esm.js +42 -40
- package/components/list-view/index.umd.cjs +2 -2
- package/components/lookup/index.esm.js +118 -118
- package/components/lookup/index.umd.cjs +1 -1
- package/components/mapping-editor/index.esm.js +482 -483
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/message-box/index.esm.js +424 -424
- package/components/message-box/index.umd.cjs +1 -1
- package/components/modal/index.esm.js +276 -276
- package/components/modal/index.umd.cjs +1 -1
- package/components/number-range/index.esm.js +161 -161
- package/components/number-range/index.umd.cjs +1 -1
- package/components/number-spinner/index.esm.js +322 -316
- package/components/number-spinner/index.umd.cjs +1 -1
- package/components/order/index.esm.js +541 -534
- package/components/order/index.umd.cjs +2 -2
- package/components/page-header/index.esm.js +1 -1
- package/components/page-header/index.umd.cjs +1 -1
- package/components/popover/index.esm.js +58 -56
- package/components/popover/index.umd.cjs +1 -1
- package/components/property-panel/index.esm.js +216 -216
- package/components/property-panel/index.umd.cjs +2 -2
- package/components/query-solution/index.esm.js +489 -467
- package/components/query-solution/index.umd.cjs +3 -3
- package/components/radio-group/index.esm.js +30 -30
- package/components/radio-group/index.umd.cjs +1 -1
- package/components/response-layout/index.esm.js +282 -282
- package/components/response-layout/index.umd.cjs +1 -1
- package/components/response-layout-editor/index.esm.js +875 -873
- package/components/response-layout-editor/index.umd.cjs +1 -1
- package/components/response-toolbar/index.esm.js +1 -1
- package/components/response-toolbar/index.umd.cjs +1 -1
- package/components/schema-selector/index.esm.js +504 -496
- package/components/schema-selector/index.umd.cjs +6 -6
- package/components/search-box/index.esm.js +76 -72
- package/components/search-box/index.umd.cjs +1 -1
- package/components/section/index.esm.js +212 -212
- package/components/section/index.umd.cjs +1 -1
- package/components/sort-condition-editor/index.esm.js +382 -377
- package/components/sort-condition-editor/index.umd.cjs +2 -2
- package/components/tabs/index.esm.js +584 -582
- package/components/tabs/index.umd.cjs +2 -2
- package/components/textarea/index.esm.js +362 -362
- package/components/textarea/index.umd.cjs +2 -2
- package/components/time-picker/index.css +1 -0
- package/components/time-picker/index.esm.js +9799 -0
- package/components/time-picker/index.umd.cjs +1 -0
- package/components/time-picker/package.json +8 -0
- package/components/time-picker/style.js +6 -0
- package/components/transfer/index.esm.js +81 -79
- package/components/transfer/index.umd.cjs +2 -2
- package/components/tree-grid/index.esm.js +100 -100
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-view/index.esm.js +2361 -2279
- package/components/tree-view/index.umd.cjs +1 -1
- package/components/video/index.esm.js +220 -220
- package/components/video/index.umd.cjs +1 -1
- package/designer/button-edit/index.css +1 -0
- package/designer/button-edit/index.esm.js +4856 -0
- package/designer/button-edit/index.umd.cjs +1 -0
- package/designer/checkbox/index.esm.js +254 -0
- package/designer/checkbox/index.umd.cjs +1 -0
- package/designer/checkbox-group/index.esm.js +381 -0
- package/designer/checkbox-group/index.umd.cjs +1 -0
- package/designer/data-grid/index.css +1 -0
- package/designer/data-grid/index.esm.js +15445 -0
- package/designer/data-grid/index.umd.cjs +23 -0
- package/designer/data-view/index.esm.js +854 -0
- package/designer/data-view/index.umd.cjs +38 -0
- package/designer/drawer/index.css +1 -0
- package/designer/drawer/index.esm.js +525 -0
- package/designer/drawer/index.umd.cjs +1 -0
- package/designer/farris-designer.all.esm.js +22331 -0
- package/designer/farris-designer.all.umd.cjs +34 -0
- package/designer/index.css +1 -0
- package/designer/input-group/index.esm.js +1099 -0
- package/designer/input-group/index.umd.cjs +1 -0
- package/designer/list-view/index.css +1 -0
- package/designer/list-view/index.esm.js +4685 -0
- package/designer/list-view/index.umd.cjs +40 -0
- package/designer/radio-group/index.css +1 -0
- package/designer/radio-group/index.esm.js +6989 -0
- package/designer/radio-group/index.umd.cjs +1 -0
- package/designer/tree-grid/index.esm.js +1099 -0
- package/designer/tree-grid/index.umd.cjs +1 -0
- package/farris.all.esm.js +13299 -13177
- package/farris.all.umd.cjs +25 -25
- package/locales/data-grid/ui/en.json +4 -3
- package/locales/data-grid/ui/zh-CHS.json +2 -1
- package/locales/data-grid/ui/zh-CHT.json +2 -1
- package/locales/designer/en.json +9 -7
- package/locales/designer/zh-CHS.json +4 -2
- package/locales/designer/zh-CHT.json +4 -2
- package/locales/ui/en.json +9 -7
- package/locales/ui/zh-CHS.json +4 -2
- package/locales/ui/zh-CHT.json +4 -2
- package/package.json +1 -1
- package/types/combo-list/src/property-config/combo-list.property-config.d.ts +0 -6
- package/types/data-view/composition/types.d.ts +10 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as E, ref as
|
|
1
|
+
import { defineComponent as E, ref as y, computed as V, watch as B, onMounted as O, createVNode as I, inject as k } from "vue";
|
|
2
2
|
import { useI18n as M } from "vue-i18n";
|
|
3
3
|
import z from "../button-edit/index.esm.js";
|
|
4
4
|
import { resolveAppearance as K, createPropsResolver as Q } from "../dynamic-resolver/index.esm.js";
|
|
@@ -411,7 +411,7 @@ const H = {
|
|
|
411
411
|
props: ye,
|
|
412
412
|
emits: ["selectionChange"],
|
|
413
413
|
setup(e, t) {
|
|
414
|
-
const i =
|
|
414
|
+
const i = y(), a = y(e.dataSource), n = y([]), m = y(e.separator), g = y(e.width), c = y(e.maxHeight), d = y(String(e.selectedValues).split(m.value)), C = V(() => e.multiSelect), h = V(() => ({
|
|
415
415
|
enableSelectRow: !0,
|
|
416
416
|
multiSelect: e.multiSelect,
|
|
417
417
|
multiSelectMode: "OnCheckAndClick",
|
|
@@ -422,47 +422,47 @@ const H = {
|
|
|
422
422
|
B(e.dataSource, () => {
|
|
423
423
|
a.value = e.dataSource;
|
|
424
424
|
}), V(() => e.enableSearch ? "SearchBar" : "ContentHeader");
|
|
425
|
-
const
|
|
426
|
-
const
|
|
427
|
-
return
|
|
425
|
+
const p = V(() => {
|
|
426
|
+
const u = {};
|
|
427
|
+
return g.value !== void 0 && (u.width = `${g.value}px`), c.value !== void 0 && c.value > 0 && (u.maxHeight = `${c.value}px`), u;
|
|
428
428
|
});
|
|
429
|
-
function l(
|
|
430
|
-
i.value.search(
|
|
429
|
+
function l(u) {
|
|
430
|
+
i.value.search(u);
|
|
431
431
|
}
|
|
432
|
-
function o(
|
|
433
|
-
n.value =
|
|
432
|
+
function o(u) {
|
|
433
|
+
n.value = u.map((s) => Object.assign({}, s)), d.value = u.map((s) => s[e.idField]), t.emit("selectionChange", n.value);
|
|
434
434
|
}
|
|
435
|
-
function
|
|
435
|
+
function b(u) {
|
|
436
436
|
if (e.enableHighlightSearch)
|
|
437
437
|
return;
|
|
438
|
-
let
|
|
438
|
+
let s = [];
|
|
439
439
|
const {
|
|
440
|
-
searchOption:
|
|
440
|
+
searchOption: r
|
|
441
441
|
} = e;
|
|
442
|
-
typeof
|
|
442
|
+
typeof r == "function" ? s = a.value.filter((S) => r(u, S)) : s = a.value.filter((S) => S[e.valueField].indexOf(u) > -1 || S[e.textField].indexOf(u) > -1), i.value.updateDataSource(s);
|
|
443
443
|
}
|
|
444
|
-
B([() => e.selectedValues], ([
|
|
445
|
-
e.multiSelect ?
|
|
444
|
+
B([() => e.selectedValues], ([u]) => {
|
|
445
|
+
e.multiSelect ? d.value = u.split(m.value) : d.value = [u];
|
|
446
446
|
});
|
|
447
|
-
function
|
|
448
|
-
i.value.activeRowById(
|
|
447
|
+
function F(u) {
|
|
448
|
+
i.value.activeRowById(u);
|
|
449
449
|
}
|
|
450
450
|
return O(() => {
|
|
451
|
-
var
|
|
451
|
+
var u, s;
|
|
452
452
|
if (!e.multiSelect) {
|
|
453
|
-
const
|
|
454
|
-
let
|
|
455
|
-
if (!X(
|
|
456
|
-
const x = typeof
|
|
457
|
-
w === "number" && x !== w && (
|
|
453
|
+
const r = (u = d.value) == null ? void 0 : u[0];
|
|
454
|
+
let S = r;
|
|
455
|
+
if (!X(r)) {
|
|
456
|
+
const x = typeof r, w = typeof ((s = a.value[0]) == null ? void 0 : s[e.valueField || e.idField]);
|
|
457
|
+
w === "number" && x !== w && (S = Number(r)), w === "boolean" && x !== w && (S = r === "true" ? !0 : r === "false" ? !1 : r), F(S);
|
|
458
458
|
}
|
|
459
459
|
}
|
|
460
460
|
}), t.expose({
|
|
461
461
|
search: l,
|
|
462
|
-
activeRowById:
|
|
462
|
+
activeRowById: F
|
|
463
463
|
}), () => I("div", {
|
|
464
464
|
class: "f-combo-list-container",
|
|
465
|
-
style:
|
|
465
|
+
style: p.value
|
|
466
466
|
}, [I(Y, {
|
|
467
467
|
ref: i,
|
|
468
468
|
size: "small",
|
|
@@ -475,31 +475,31 @@ const H = {
|
|
|
475
475
|
textField: e.textField,
|
|
476
476
|
titleField: e.titleField,
|
|
477
477
|
multiSelect: e.multiSelect,
|
|
478
|
-
selection:
|
|
478
|
+
selection: h.value,
|
|
479
479
|
enableHighlightSearch: e.enableHighlightSearch,
|
|
480
|
-
selectionValues:
|
|
480
|
+
selectionValues: d.value,
|
|
481
481
|
onSelectionUpdate: o,
|
|
482
|
-
onAfterSearch:
|
|
482
|
+
onAfterSearch: b
|
|
483
483
|
}, null)]);
|
|
484
484
|
}
|
|
485
485
|
});
|
|
486
486
|
function ve(e) {
|
|
487
|
-
const { t } = M(), i =
|
|
488
|
-
function
|
|
489
|
-
const o = e.multiSelect ? String(l).split(e.separator) : [String(l)],
|
|
490
|
-
return n.value.filter((
|
|
491
|
-
const
|
|
492
|
-
return
|
|
487
|
+
const { t } = M(), i = y(""), a = y(e.modelValue), n = y(e.data || []), m = y(e.editable);
|
|
488
|
+
function g(l) {
|
|
489
|
+
const o = e.multiSelect ? String(l).split(e.separator) : [String(l)], b = o.map((s) => [s, !0]), F = new Map(b);
|
|
490
|
+
return n.value.filter((s) => F.has(String(s[e.valueField]))).sort((s, r) => {
|
|
491
|
+
const S = o.indexOf(s[e.valueField]), x = o.indexOf(r[e.valueField]);
|
|
492
|
+
return S - x;
|
|
493
493
|
});
|
|
494
494
|
}
|
|
495
|
-
function
|
|
496
|
-
const o =
|
|
497
|
-
i.value =
|
|
495
|
+
function c(l) {
|
|
496
|
+
const o = g(l).map((b) => b[e.textField]).join(e.separator);
|
|
497
|
+
i.value = m.value ? o || l : o;
|
|
498
498
|
}
|
|
499
|
-
function
|
|
499
|
+
function d(l) {
|
|
500
500
|
if (e.multiSelect) {
|
|
501
|
-
const o = l.split(e.separator).map((
|
|
502
|
-
return n.value.filter((
|
|
501
|
+
const o = l.split(e.separator).map((F) => [F, !0]), b = new Map(o);
|
|
502
|
+
return n.value.filter((F) => b.has(F[e.textField]));
|
|
503
503
|
}
|
|
504
504
|
return n.value.filter((o) => "" + o[e.textField] === l);
|
|
505
505
|
}
|
|
@@ -507,35 +507,35 @@ function ve(e) {
|
|
|
507
507
|
const o = {};
|
|
508
508
|
return o[e.idField] = l, o[e.textField] = l, [o];
|
|
509
509
|
}
|
|
510
|
-
function
|
|
511
|
-
let o =
|
|
512
|
-
const
|
|
513
|
-
return
|
|
510
|
+
function h(l) {
|
|
511
|
+
let o = d(l);
|
|
512
|
+
const b = o && o.length > 0;
|
|
513
|
+
return m.value && !b && (o = C(l)), o;
|
|
514
514
|
}
|
|
515
|
-
function
|
|
516
|
-
const { url: l, method: o = "GET", headers:
|
|
517
|
-
let
|
|
518
|
-
fetch(new Request(l,
|
|
515
|
+
function p() {
|
|
516
|
+
const { url: l, method: o = "GET", headers: b = { "Content-Type": "application/json;charset=utf-8;" }, body: F = null } = e.remote, u = o.toLowerCase() === "get" ? { method: o, headers: b } : { method: o, headers: b, body: F };
|
|
517
|
+
let s = !1;
|
|
518
|
+
fetch(new Request(l, u)).then((r) => {
|
|
519
519
|
var x, w;
|
|
520
|
-
if (
|
|
521
|
-
return
|
|
522
|
-
throw
|
|
523
|
-
}).then((
|
|
524
|
-
|
|
525
|
-
}).catch((
|
|
526
|
-
console.warn(
|
|
520
|
+
if (r.status === 200)
|
|
521
|
+
return s = !!((w = (x = r.headers) == null ? void 0 : x.get("content-type")) != null && w.includes("application/json")), s ? r.text() : r.json();
|
|
522
|
+
throw r.status === 405 ? new Error(t("comboList.remoteError")) : new Error(r.statusText);
|
|
523
|
+
}).then((r) => {
|
|
524
|
+
r.length && (n.value = s ? JSON.parse(r) : r);
|
|
525
|
+
}).catch((r) => {
|
|
526
|
+
console.warn(r);
|
|
527
527
|
});
|
|
528
528
|
}
|
|
529
|
-
return e.remote &&
|
|
529
|
+
return e.remote && p(), B(() => e.data, () => {
|
|
530
530
|
n.value = e.data;
|
|
531
531
|
}), B([n], ([l]) => {
|
|
532
532
|
if (e.modelValue != null) {
|
|
533
|
-
const o = l.find((
|
|
533
|
+
const o = l.find((b) => b[e.valueField] === e.modelValue);
|
|
534
534
|
o && (i.value = o[e.textField]);
|
|
535
535
|
}
|
|
536
536
|
}), B(() => e.modelValue, (l) => {
|
|
537
|
-
a.value = l,
|
|
538
|
-
}),
|
|
537
|
+
a.value = l, c(l);
|
|
538
|
+
}), c(e.modelValue), { dataSource: n, displayText: i, editable: m, modelValue: a, getItemsByDisplayText: d, getItemsByValue: g, getSelectedItemsByDisplayText: h };
|
|
539
539
|
}
|
|
540
540
|
const L = /* @__PURE__ */ E({
|
|
541
541
|
name: "FComboList",
|
|
@@ -544,53 +544,55 @@ const L = /* @__PURE__ */ E({
|
|
|
544
544
|
setup(e, t) {
|
|
545
545
|
const {
|
|
546
546
|
t: i
|
|
547
|
-
} = M(), a =
|
|
547
|
+
} = M(), a = y(), n = y(), m = y(e.disabled || e.readonly), g = y(e.enableClear), c = y(e.enableSearch), d = y(e.readonly), {
|
|
548
548
|
dataSource: C,
|
|
549
|
-
displayText:
|
|
550
|
-
editable:
|
|
549
|
+
displayText: h,
|
|
550
|
+
editable: p,
|
|
551
551
|
modelValue: l,
|
|
552
552
|
getSelectedItemsByDisplayText: o,
|
|
553
|
-
getItemsByDisplayText:
|
|
554
|
-
getItemsByValue:
|
|
555
|
-
} = ve(e),
|
|
556
|
-
|
|
557
|
-
const
|
|
558
|
-
function
|
|
559
|
-
!
|
|
553
|
+
getItemsByDisplayText: b,
|
|
554
|
+
getItemsByValue: F
|
|
555
|
+
} = ve(e), u = y(e.dropDownIcon);
|
|
556
|
+
u.value === '<span class="f-icon f-icon-arrow-chevron-down"></span>' && (u.value = '<span id="' + e.id + '-icon-dropdown" class="f-icon f-icon-arrow-chevron-down"></span>');
|
|
557
|
+
const s = V(() => e.multiSelect), r = V(() => n.value ? n.value.elementRef.getBoundingClientRect().width : 0);
|
|
558
|
+
function S() {
|
|
559
|
+
!s.value && n.value && n.value.hidePopup();
|
|
560
560
|
}
|
|
561
|
-
function x(
|
|
562
|
-
|
|
561
|
+
function x(f) {
|
|
562
|
+
h.value = f.map((T) => T[e.textField]).join(e.separator);
|
|
563
563
|
let v = "";
|
|
564
|
-
|
|
564
|
+
f.length === 1 ? v = f[0][e.valueField] : v = f.map((T) => T[e.valueField]).join(e.separator), l.value !== v && (l.value = v, t.emit("update:modelValue", l.value), t.emit("change", f, l.value));
|
|
565
565
|
}
|
|
566
566
|
function w() {
|
|
567
|
-
const
|
|
568
|
-
x(
|
|
567
|
+
const f = F(l.value);
|
|
568
|
+
x(f);
|
|
569
569
|
}
|
|
570
570
|
function N() {
|
|
571
|
-
|
|
571
|
+
d.value || h.value;
|
|
572
572
|
}
|
|
573
|
-
function j(
|
|
573
|
+
function j(f) {
|
|
574
574
|
var v;
|
|
575
575
|
l.value = "", (v = a.value) == null || v.activeRowById(""), t.emit("update:modelValue", ""), t.emit("change", [], ""), t.emit("clear");
|
|
576
576
|
}
|
|
577
|
-
function q(
|
|
577
|
+
function q(f) {
|
|
578
578
|
var v, T;
|
|
579
|
-
e.enableSearch && e.enableHighlightSearch && ((v = a.value) == null || v.search(
|
|
579
|
+
e.enableSearch && e.enableHighlightSearch && ((v = a.value) == null || v.search(f)), (T = a.value) == null || T.activeRowById(f), t.emit("change", [l.value], l.value);
|
|
580
580
|
}
|
|
581
|
-
function G(
|
|
581
|
+
function G(f) {
|
|
582
582
|
if (e.multiSelect) {
|
|
583
|
-
const v =
|
|
583
|
+
const v = b(f);
|
|
584
|
+
e.viewType;
|
|
585
|
+
const P = v.map((R) => R[e.idField || e.valueField]).join(e.separator);
|
|
584
586
|
l.value !== P && (l.value = P, t.emit("update:modelValue", l.value), t.emit("change", v, l.value));
|
|
585
587
|
}
|
|
586
588
|
}
|
|
587
589
|
function W() {
|
|
588
|
-
return
|
|
590
|
+
return h.value;
|
|
589
591
|
}
|
|
590
|
-
function U(
|
|
592
|
+
function U(f) {
|
|
591
593
|
const {
|
|
592
594
|
value: v
|
|
593
|
-
} =
|
|
595
|
+
} = f.target;
|
|
594
596
|
q(v), t.emit("input", v);
|
|
595
597
|
}
|
|
596
598
|
function J() {
|
|
@@ -599,25 +601,25 @@ const L = /* @__PURE__ */ E({
|
|
|
599
601
|
return t.expose({
|
|
600
602
|
getDisplayText: W,
|
|
601
603
|
hidePopup: J
|
|
602
|
-
}), B([() => e.disabled, () => e.editable, () => e.enableClear, () => e.enableSearch, () => e.readonly], ([
|
|
603
|
-
|
|
604
|
+
}), B([() => e.disabled, () => e.editable, () => e.enableClear, () => e.enableSearch, () => e.readonly], ([f, v, T, P, R]) => {
|
|
605
|
+
m.value = f, p.value = v, g.value = T, c.value = P, d.value = R;
|
|
604
606
|
}), () => I(z, {
|
|
605
607
|
ref: n,
|
|
606
608
|
id: e.id,
|
|
607
|
-
disable:
|
|
608
|
-
readonly:
|
|
609
|
+
disable: m.value,
|
|
610
|
+
readonly: d.value,
|
|
609
611
|
forcePlaceholder: e.forcePlaceholder,
|
|
610
|
-
editable:
|
|
611
|
-
buttonContent:
|
|
612
|
+
editable: p.value,
|
|
613
|
+
buttonContent: u.value,
|
|
612
614
|
placeholder: e.placeholder === "请选择" ? i("comboList.placeholder") : e.placeholder,
|
|
613
|
-
enableClear:
|
|
615
|
+
enableClear: g.value,
|
|
614
616
|
maxLength: e.maxLength,
|
|
615
617
|
tabIndex: e.tabIndex,
|
|
616
618
|
enableTitle: e.enableTitle,
|
|
617
619
|
multiSelect: e.multiSelect,
|
|
618
620
|
inputType: e.multiSelect ? e.viewType : "text",
|
|
619
|
-
modelValue:
|
|
620
|
-
"onUpdate:modelValue": (
|
|
621
|
+
modelValue: h.value,
|
|
622
|
+
"onUpdate:modelValue": (f) => h.value = f,
|
|
621
623
|
focusOnCreated: e.focusOnCreated,
|
|
622
624
|
selectOnCreated: e.selectOnCreated,
|
|
623
625
|
onClear: j,
|
|
@@ -642,12 +644,12 @@ const L = /* @__PURE__ */ E({
|
|
|
642
644
|
selectedValues: l.value,
|
|
643
645
|
separator: e.separator,
|
|
644
646
|
multiSelect: e.multiSelect,
|
|
645
|
-
enableSearch:
|
|
647
|
+
enableSearch: c.value,
|
|
646
648
|
maxHeight: e.maxHeight,
|
|
647
649
|
enableHighlightSearch: e.enableHighlightSearch,
|
|
648
|
-
width: e.fitEditor ?
|
|
649
|
-
onSelectionChange: (
|
|
650
|
-
x(
|
|
650
|
+
width: e.fitEditor ? r.value : void 0,
|
|
651
|
+
onSelectionChange: (f) => {
|
|
652
|
+
x(f), S();
|
|
651
653
|
}
|
|
652
654
|
}, null)]
|
|
653
655
|
});
|
|
@@ -663,7 +665,7 @@ class be extends te {
|
|
|
663
665
|
super(t, i);
|
|
664
666
|
}
|
|
665
667
|
getCommonEditorProperties(t) {
|
|
666
|
-
var i, a, n
|
|
668
|
+
var i, a, n;
|
|
667
669
|
return {
|
|
668
670
|
viewType: {
|
|
669
671
|
visible: !!((i = t.editor) != null && i.multiSelect),
|
|
@@ -697,23 +699,24 @@ class be extends te {
|
|
|
697
699
|
title: "允许编辑",
|
|
698
700
|
type: "boolean",
|
|
699
701
|
refreshPanelAfterChanged: !0,
|
|
700
|
-
readonly:
|
|
701
|
-
|
|
702
|
-
enableHighlightSearch: {
|
|
703
|
-
visible: !!((d = t.editor) != null && d.editable),
|
|
704
|
-
description: "编辑状态下启用高亮搜索",
|
|
705
|
-
title: "启用高亮搜索",
|
|
706
|
-
type: "boolean"
|
|
702
|
+
readonly: !0
|
|
703
|
+
// readonly: !!propertyData.editor?.multiSelect && (propertyData.editor?.viewType === 'tag' || !propertyData.editor!.viewType)
|
|
707
704
|
}
|
|
705
|
+
// enableHighlightSearch: {
|
|
706
|
+
// visible: !!propertyData.editor?.editable,
|
|
707
|
+
// description: "编辑状态下启用高亮搜索",
|
|
708
|
+
// title: "启用高亮搜索",
|
|
709
|
+
// type: "boolean"
|
|
710
|
+
// },
|
|
708
711
|
};
|
|
709
712
|
}
|
|
710
713
|
getEditorProperties(t) {
|
|
711
|
-
var
|
|
714
|
+
var m, g;
|
|
712
715
|
const i = this;
|
|
713
716
|
let a = "";
|
|
714
|
-
if (((
|
|
715
|
-
const
|
|
716
|
-
(
|
|
717
|
+
if (((m = t == null ? void 0 : t.binding) == null ? void 0 : m.type) === "Form") {
|
|
718
|
+
const c = this.schemaService.getFieldByIDAndVMID(t.binding.field, this.viewModelId);
|
|
719
|
+
(g = c == null ? void 0 : c.schemaField) != null && g.type && (a = c.schemaField.type.$type);
|
|
717
720
|
}
|
|
718
721
|
return i.getComponentConfig(t, { type: "combo-list" }, {
|
|
719
722
|
// enableSearch: {
|
|
@@ -771,7 +774,7 @@ class be extends te {
|
|
|
771
774
|
// },
|
|
772
775
|
// },
|
|
773
776
|
body: {
|
|
774
|
-
visible:
|
|
777
|
+
visible: !1,
|
|
775
778
|
$converter: A,
|
|
776
779
|
description: "",
|
|
777
780
|
title: "服务端API参数",
|
|
@@ -803,35 +806,36 @@ class be extends te {
|
|
|
803
806
|
editor: {
|
|
804
807
|
nullable: !0,
|
|
805
808
|
min: 0,
|
|
806
|
-
useThousands: !1
|
|
809
|
+
useThousands: !1,
|
|
810
|
+
needValid: !0
|
|
807
811
|
}
|
|
808
812
|
},
|
|
809
813
|
...this.getCommonEditorProperties(t)
|
|
810
|
-
}, (
|
|
811
|
-
if (!
|
|
814
|
+
}, (c, d) => {
|
|
815
|
+
if (!c || !d.editor)
|
|
812
816
|
return;
|
|
813
817
|
const C = this;
|
|
814
|
-
switch (
|
|
818
|
+
switch (c.propertyID) {
|
|
815
819
|
case "dataSourceType": {
|
|
816
|
-
|
|
820
|
+
c.propertyValue === "static" ? (d.editor.valueField = "value", d.editor.textField = "name", d.editor.remote = null) : c.propertyValue === "dynamic" && (d.editor.remote = { method: "GET" }, d.editor.valueField = "value", d.editor.textField = "name");
|
|
817
821
|
break;
|
|
818
822
|
}
|
|
819
823
|
case "data": {
|
|
820
|
-
!C.checkEnumDataReadonly(
|
|
824
|
+
!C.checkEnumDataReadonly(d) && d.formatter && (d.formatter.data = [...c.propertyValue]);
|
|
821
825
|
break;
|
|
822
826
|
}
|
|
823
827
|
case "viewType":
|
|
824
|
-
|
|
828
|
+
c.propertyValue === "tag" && (d.editor.editable = !1);
|
|
825
829
|
}
|
|
826
830
|
});
|
|
827
831
|
}
|
|
828
832
|
getGridFieldEdtiorProperties(t, i) {
|
|
829
|
-
var
|
|
833
|
+
var g, c, d, C;
|
|
830
834
|
const a = this;
|
|
831
835
|
let n = "";
|
|
832
|
-
if (((
|
|
833
|
-
const
|
|
834
|
-
(
|
|
836
|
+
if (((g = t == null ? void 0 : t.binding) == null ? void 0 : g.type) === "Form") {
|
|
837
|
+
const h = this.schemaService.getFieldByIDAndVMID(t.binding.field, this.viewModelId);
|
|
838
|
+
(c = h == null ? void 0 : h.schemaField) != null && c.type && (n = h.schemaField.type.$type);
|
|
835
839
|
}
|
|
836
840
|
return a.getComponentConfig(t, { type: "combo-list" }, {
|
|
837
841
|
// editable: {
|
|
@@ -850,7 +854,7 @@ class be extends te {
|
|
|
850
854
|
title: "数据",
|
|
851
855
|
type: "array",
|
|
852
856
|
visible: !0,
|
|
853
|
-
...a.getItemCollectionEditor(t, (
|
|
857
|
+
...a.getItemCollectionEditor(t, (d = t.editor) == null ? void 0 : d.valueField, (C = t.editor) == null ? void 0 : C.textField),
|
|
854
858
|
// 这个属性,标记当属性变更得时候触发重新更新属性
|
|
855
859
|
refreshPanelAfterChanged: !0
|
|
856
860
|
},
|
|
@@ -880,21 +884,22 @@ class be extends te {
|
|
|
880
884
|
editor: {
|
|
881
885
|
nullable: !0,
|
|
882
886
|
min: 0,
|
|
883
|
-
useThousands: !1
|
|
887
|
+
useThousands: !1,
|
|
888
|
+
needValid: !0
|
|
884
889
|
}
|
|
885
890
|
},
|
|
886
891
|
...this.getCommonEditorProperties(t)
|
|
887
|
-
}, (
|
|
888
|
-
if (!
|
|
892
|
+
}, (h, p) => {
|
|
893
|
+
if (!h || !p.editor)
|
|
889
894
|
return;
|
|
890
895
|
const l = this;
|
|
891
|
-
switch (
|
|
896
|
+
switch (h.propertyID) {
|
|
892
897
|
case "dataSourceType": {
|
|
893
|
-
|
|
898
|
+
h.propertyValue === "static" ? (p.editor.valueField = "value", p.editor.textField = "name", p.editor.remote = null) : h.propertyValue === "dynamic" && (p.editor.remote = { method: "GET" });
|
|
894
899
|
break;
|
|
895
900
|
}
|
|
896
901
|
case "data": {
|
|
897
|
-
!l.checkEnumDataReadonly(
|
|
902
|
+
!l.checkEnumDataReadonly(p) && p.formatter && (p.formatter.data = [...h.propertyValue]);
|
|
898
903
|
break;
|
|
899
904
|
}
|
|
900
905
|
}
|
|
@@ -919,16 +924,16 @@ class be extends te {
|
|
|
919
924
|
* 切换绑定属性
|
|
920
925
|
*/
|
|
921
926
|
changeBindingField(t, i, a) {
|
|
922
|
-
var
|
|
927
|
+
var m;
|
|
923
928
|
super.changeBindingField(t, i);
|
|
924
929
|
const n = a;
|
|
925
|
-
t.editor && ((
|
|
930
|
+
t.editor && ((m = n == null ? void 0 : n.type) == null ? void 0 : m.$type) === D.EnumType && (t.editor.data = n.type.enumValues || []);
|
|
926
931
|
}
|
|
927
932
|
}
|
|
928
933
|
function pe(e, t) {
|
|
929
934
|
const i = e.schema;
|
|
930
|
-
function a(n,
|
|
931
|
-
return new be(n, t).getPropertyConfig(i,
|
|
935
|
+
function a(n, m) {
|
|
936
|
+
return new be(n, t).getPropertyConfig(i, m);
|
|
932
937
|
}
|
|
933
938
|
return {
|
|
934
939
|
getPropsConfig: a
|
|
@@ -939,10 +944,10 @@ const Se = /* @__PURE__ */ E({
|
|
|
939
944
|
props: he,
|
|
940
945
|
emits: ["clear", "update:modelValue", "change"],
|
|
941
946
|
setup(e, t) {
|
|
942
|
-
const i =
|
|
947
|
+
const i = y(), a = k("designer-host-service"), n = k("design-item-context"), m = pe(n, a), g = _(i, n, m);
|
|
943
948
|
return O(() => {
|
|
944
|
-
i.value.componentInstance =
|
|
945
|
-
}), t.expose(
|
|
949
|
+
i.value.componentInstance = g;
|
|
950
|
+
}), t.expose(g.value), () => I(Z, {
|
|
946
951
|
ref: i,
|
|
947
952
|
buttonContent: e.dropDownIcon,
|
|
948
953
|
readonly: !0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(h,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("vue"),require("vue-i18n"),require("../button-edit/index.umd.js"),require("../dynamic-resolver/index.umd.js"),require("lodash-es"),require("../list-view/index.umd.js"),require("../../designer/button-edit/index.umd.js"),require("../designer-canvas/index.umd.js"),require("../common/index.umd.js"),require("../property-panel/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","vue-i18n","../button-edit/index.umd.js","../dynamic-resolver/index.umd.js","lodash-es","../list-view/index.umd.js","../../designer/button-edit/index.umd.js","../designer-canvas/index.umd.js","../common/index.umd.js","../property-panel/index.umd.js"],i):(h=typeof globalThis<"u"?globalThis:h||self,i(h["combo-list"]={},h.Vue,h.vueI18n,h.FButtonEdit,h.dynamicResolver,h.LodashES,h.FListView,h.FButtonEditDesign,h.designerCanvas,h.common,h.propertyPanel))})(this,function(h,i,E,O,H,q,$,N,G,j,W){"use strict";const U=new Map([["appearance",H.resolveAppearance]]),J={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/combo-list.schema.json",title:"combo-list",description:"A Farris Input Component",type:"object",properties:{id:{description:"The unique identifier for a combo list",type:"string"},type:{description:"The type string of number combo list component",type:"string",default:"combo-list"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},disabled:{description:"",type:"boolean",default:!1},enableClear:{description:"",type:"boolean",default:!1},editable:{description:"",type:"boolean",default:!1},enableLinkLabel:{description:"",type:"boolean",default:!1},label:{description:"",type:"string",default:""},lableWidth:{description:"",type:"number"},placeholder:{description:"",type:"string",default:"请选择"},idField:{description:"",type:"string",default:"id"},valueField:{description:"",type:"string",default:"id"},titleField:{description:"",type:"string",default:"name"},textField:{description:"",type:"string",default:"name"},dataSourceType:{description:"",type:"string",default:"static"},data:{description:"",type:"array"},remote:{description:"",type:"string"},readonly:{description:"",type:"boolean",default:!1},required:{description:"",type:"boolean",default:!1},tabindex:{description:"",type:"number",default:-1},textAlign:{description:"",type:"string",enum:["left","middle","right"],default:"left"},multiSelect:{description:"",type:"boolean",default:!1},maxLength:{description:"",type:"number",default:null},visible:{description:"",type:"boolean",default:!0},onBlur:{description:"",type:"string",default:""},onClickLinkLabel:{description:"",type:"sting",default:""},maxHeight:{description:"",type:"number",default:350},minPanelWidth:{description:"",type:"number",default:160},popupOnClick:{description:"",type:"boolean",default:!0},separator:{description:"",type:"string",default:","},viewType:{description:"",type:"string",default:"tag"},enableSearch:{description:"启用搜索",type:"boolean",default:!0},enableHighlightSearch:{description:"启用高亮搜索",type:"boolean",default:!1},"onUpdate:modelValue":{description:"",type:"object"}},required:["type"],ignore:["id","appearance","binding","visible"]};function _(e,t,l){return t}var k=(e=>(e.top="top",e.bottom="bottom",e.auto="auto",e))(k||{});const B={id:{type:String},data:{type:Array,default:[]},disabled:{default:!1,type:Boolean},dropDownIcon:{type:String,default:'<span class="f-icon f-icon-arrow-chevron-down"></span>'},editable:{default:!1,type:Boolean},enableClear:{default:!0,type:Boolean},enableSearch:{type:Boolean,default:!1},enableTitle:{default:!0,type:Boolean},fitEditor:{default:!1,type:Boolean},forcePlaceholder:{default:!1,type:Boolean},hidePanelOnClear:{default:!0,type:Boolean},idField:{default:"id",type:String},mapFields:{type:Object},maxHeight:{default:350,type:Number},maxLength:{type:Number},multiSelect:{type:Boolean,default:!1},modelValue:{},placeholder:{type:String,default:"请选择"},placement:{type:String,default:"auto"},readonly:{default:!1,type:Boolean},remote:{default:null,type:Object},remoteSearch:{default:!1,type:Boolean},separator:{default:",",type:String},tabIndex:{type:Number,default:-1},textField:{default:"name",type:String},titleField:{default:"name",type:String},valueField:{default:"id",type:String},viewType:{default:"tag",type:String},change:{type:Function,default:()=>{}},focusOnCreated:{type:Boolean,default:!1},selectOnCreated:{type:Boolean,default:!1},autoHeight:{type:Boolean,default:!0},beforeOpen:{type:Function,default:null},searchOption:{type:[Boolean,Function],default:!1},enableHighlightSearch:{type:Boolean,default:!0},minPanelWidth:{type:Number,default:160},popupOnClick:{type:Boolean,default:!0}},A=Object.assign({},B,{readonly:{}}),L=H.createPropsResolver(B,J,U,_),z={dataSource:{type:Array,default:[]},enableSearch:{type:Boolean,default:!1},idField:{type:String,default:"id"},multiSelect:{type:Boolean,default:!1},selectedValues:{type:String,default:""},separator:{type:String,default:","},textField:{type:String,default:"name"},titleField:{type:String,default:"name"},width:{type:Number},maxHeight:{type:Number},valueField:{type:String,default:"id"},onSelectionChange:{type:Function,default:()=>{}},searchOption:{type:[Boolean,Function],default:!1},enableHighlightSearch:{type:Boolean,default:!0}},K=i.defineComponent({name:"FComboListContainer",props:z,emits:["selectionChange"],setup(e,t){const l=i.ref(),o=i.ref(e.dataSource),a=i.ref([]),f=i.ref(e.separator),y=i.ref(e.width),r=i.ref(e.maxHeight),u=i.ref(String(e.selectedValues).split(f.value)),x=i.computed(()=>e.multiSelect),b=i.computed(()=>({enableSelectRow:!0,multiSelect:e.multiSelect,multiSelectMode:"OnCheckAndClick",showCheckbox:x.value,showSelectAll:!1,showSelection:!0}));i.watch(e.dataSource,()=>{o.value=e.dataSource}),i.computed(()=>e.enableSearch?"SearchBar":"ContentHeader");const v=i.computed(()=>{const s={};return y.value!==void 0&&(s.width=`${y.value}px`),r.value!==void 0&&r.value>0&&(s.maxHeight=`${r.value}px`),s});function n(s){l.value.search(s)}function d(s){a.value=s.map(m=>Object.assign({},m)),u.value=s.map(m=>m[e.idField]),t.emit("selectionChange",a.value)}function S(s){if(e.enableHighlightSearch)return;let m=[];const{searchOption:c}=e;typeof c=="function"?m=o.value.filter(F=>c(s,F)):m=o.value.filter(F=>F[e.valueField].indexOf(s)>-1||F[e.textField].indexOf(s)>-1),l.value.updateDataSource(m)}i.watch([()=>e.selectedValues],([s])=>{e.multiSelect?u.value=s.split(f.value):u.value=[s]});function C(s){l.value.activeRowById(s)}return i.onMounted(()=>{var s,m;if(!e.multiSelect){const c=(s=u.value)==null?void 0:s[0];let F=c;if(!q.isUndefined(c)){const w=typeof c,T=typeof((m=o.value[0])==null?void 0:m[e.valueField||e.idField]);T==="number"&&w!==T&&(F=Number(c)),T==="boolean"&&w!==T&&(F=c==="true"?!0:c==="false"?!1:c),C(F)}}}),t.expose({search:n,activeRowById:C}),()=>i.createVNode("div",{class:"f-combo-list-container",style:v.value},[i.createVNode($,{ref:l,size:"small",itemClass:"f-combo-list-item",itemContentClass:"text-truncate",header:"ContentHeader",headerClass:"f-combo-list-search-box",data:o.value,idField:e.idField,textField:e.textField,titleField:e.titleField,multiSelect:e.multiSelect,selection:b.value,enableHighlightSearch:e.enableHighlightSearch,selectionValues:u.value,onSelectionUpdate:d,onAfterSearch:S},null)])}});function Q(e){const{t}=E.useI18n(),l=i.ref(""),o=i.ref(e.modelValue),a=i.ref(e.data||[]),f=i.ref(e.editable);function y(n){const d=e.multiSelect?String(n).split(e.separator):[String(n)],S=d.map(m=>[m,!0]),C=new Map(S);return a.value.filter(m=>C.has(String(m[e.valueField]))).sort((m,c)=>{const F=d.indexOf(m[e.valueField]),w=d.indexOf(c[e.valueField]);return F-w})}function r(n){const d=y(n).map(S=>S[e.textField]).join(e.separator);l.value=f.value?d||n:d}function u(n){if(e.multiSelect){const d=n.split(e.separator).map(C=>[C,!0]),S=new Map(d);return a.value.filter(C=>S.has(C[e.textField]))}return a.value.filter(d=>""+d[e.textField]===n)}function x(n){const d={};return d[e.idField]=n,d[e.textField]=n,[d]}function b(n){let d=u(n);const S=d&&d.length>0;return f.value&&!S&&(d=x(n)),d}function v(){const{url:n,method:d="GET",headers:S={"Content-Type":"application/json;charset=utf-8;"},body:C=null}=e.remote,s=d.toLowerCase()==="get"?{method:d,headers:S}:{method:d,headers:S,body:C};let m=!1;fetch(new Request(n,s)).then(c=>{var w,T;if(c.status===200)return m=!!((T=(w=c.headers)==null?void 0:w.get("content-type"))!=null&&T.includes("application/json")),m?c.text():c.json();throw c.status===405?new Error(t("comboList.remoteError")):new Error(c.statusText)}).then(c=>{c.length&&(a.value=m?JSON.parse(c):c)}).catch(c=>{console.warn(c)})}return e.remote&&v(),i.watch(()=>e.data,()=>{a.value=e.data}),i.watch([a],([n])=>{if(e.modelValue!=null){const d=n.find(S=>S[e.valueField]===e.modelValue);d&&(l.value=d[e.textField])}}),i.watch(()=>e.modelValue,n=>{o.value=n,r(n)}),r(e.modelValue),{dataSource:a,displayText:l,editable:f,modelValue:o,getItemsByDisplayText:u,getItemsByValue:y,getSelectedItemsByDisplayText:b}}const P=i.defineComponent({name:"FComboList",props:B,emits:["clear","update:modelValue","change","input"],setup(e,t){const{t:l}=E.useI18n(),o=i.ref(),a=i.ref(),f=i.ref(e.disabled||e.readonly),y=i.ref(e.enableClear),r=i.ref(e.enableSearch),u=i.ref(e.readonly),{dataSource:x,displayText:b,editable:v,modelValue:n,getSelectedItemsByDisplayText:d,getItemsByDisplayText:S,getItemsByValue:C}=Q(e),s=i.ref(e.dropDownIcon);s.value==='<span class="f-icon f-icon-arrow-chevron-down"></span>'&&(s.value='<span id="'+e.id+'-icon-dropdown" class="f-icon f-icon-arrow-chevron-down"></span>');const m=i.computed(()=>e.multiSelect),c=i.computed(()=>a.value?a.value.elementRef.getBoundingClientRect().width:0);function F(){!m.value&&a.value&&a.value.hidePopup()}function w(g){b.value=g.map(V=>V[e.textField]).join(e.separator);let p="";g.length===1?p=g[0][e.valueField]:p=g.map(V=>V[e.valueField]).join(e.separator),n.value!==p&&(n.value=p,t.emit("update:modelValue",n.value),t.emit("change",g,n.value))}function T(){const g=C(n.value);w(g)}function ee(){u.value||b.value}function te(g){var p;n.value="",(p=o.value)==null||p.activeRowById(""),t.emit("update:modelValue",""),t.emit("change",[],""),t.emit("clear")}function ie(g){var p,V;e.enableSearch&&e.enableHighlightSearch&&((p=o.value)==null||p.search(g)),(V=o.value)==null||V.activeRowById(g),t.emit("change",[n.value],n.value)}function le(g){if(e.multiSelect){const p=C(n.value),I=p.map(R=>R[e.idField||e.valueField]).join(e.separator);n.value!==I&&(n.value=I,t.emit("update:modelValue",n.value),t.emit("change",p,n.value))}}function ne(){return b.value}function ae(g){const{value:p}=g.target;ie(p),t.emit("input",p)}function oe(){a.value.hidePopup()}return t.expose({getDisplayText:ne,hidePopup:oe}),i.watch([()=>e.disabled,()=>e.editable,()=>e.enableClear,()=>e.enableSearch,()=>e.readonly],([g,p,V,I,R])=>{f.value=g,v.value=p,y.value=V,r.value=I,u.value=R}),()=>i.createVNode(O,{ref:a,id:e.id,disable:f.value,readonly:u.value,forcePlaceholder:e.forcePlaceholder,editable:v.value,buttonContent:s.value,placeholder:e.placeholder==="请选择"?l("comboList.placeholder"):e.placeholder,enableClear:y.value,maxLength:e.maxLength,tabIndex:e.tabIndex,enableTitle:e.enableTitle,multiSelect:e.multiSelect,inputType:e.multiSelect?e.viewType:"text",modelValue:b.value,"onUpdate:modelValue":g=>b.value=g,focusOnCreated:e.focusOnCreated,selectOnCreated:e.selectOnCreated,onClear:te,onClick:ee,onChange:le,onBlur:T,onInput:ae,beforeOpen:e.beforeOpen,placement:e.placement,popupMinWidth:e.minPanelWidth,popupClass:"f-combo-list-wrapper",popupOnClick:e.popupOnClick,limitContentBySpace:!0},{default:()=>[i.createVNode(K,{ref:o,idField:e.idField,valueField:e.valueField,textField:e.textField,titleField:e.titleField,dataSource:x.value,selectedValues:n.value,separator:e.separator,multiSelect:e.multiSelect,enableSearch:r.value,maxHeight:e.maxHeight,enableHighlightSearch:e.enableHighlightSearch,width:e.fitEditor?c.value:void 0,onSelectionChange:g=>{w(g),F()}},null)]})}}),M={convertFrom:(e,t)=>(e.editor.remote||{})[t],convertTo:(e,t,l)=>{e.editor.remote=e.editor.remote||{},e.editor.remote[t]=l}};class X extends W.InputBaseProperty{constructor(t,l){super(t,l)}getCommonEditorProperties(t){var l,o,a,f,y,r;return{viewType:{visible:!!((l=t.editor)!=null&&l.multiSelect),description:"数据展示类型,有标签和文本两种方式",title:"数据展示类型",type:"enum",editor:{data:[{id:"tag",name:"标签"},{id:"text",name:"文本"}]},refreshPanelAfterChanged:!0},separator:{visible:!!((o=t.editor)!=null&&o.multiSelect)&&((a=t.editor)==null?void 0:a.viewType)==="text",description:"下拉列表启用多选且数据展示类型为文本时的分隔符",title:"分隔符",type:"enum",editor:{data:[{id:",",name:"逗号(,)"},{id:"#",name:"井号(#)"},{id:".",name:"句号(.)"},{id:"|",name:"竖线(|)"}]}},editable:{description:"",title:"允许编辑",type:"boolean",refreshPanelAfterChanged:!0,readonly:!!((f=t.editor)!=null&&f.multiSelect)&&(((y=t.editor)==null?void 0:y.viewType)==="tag"||!t.editor.viewType)},enableHighlightSearch:{visible:!!((r=t.editor)!=null&&r.editable),description:"编辑状态下启用高亮搜索",title:"启用高亮搜索",type:"boolean"}}}getEditorProperties(t){var f,y;const l=this;let o="";if(((f=t==null?void 0:t.binding)==null?void 0:f.type)==="Form"){const r=this.schemaService.getFieldByIDAndVMID(t.binding.field,this.viewModelId);(y=r==null?void 0:r.schemaField)!=null&&y.type&&(o=r.schemaField.type.$type)}return l.getComponentConfig(t,{type:"combo-list"},{enableClear:{description:"",title:"启用清空",type:"boolean"},dataSourceType:{description:"",title:"数据源类型",type:"enum",editor:{default:"static",data:[{id:"static",name:"静态"},{id:"dynamic",name:"动态"}]},refreshPanelAfterChanged:!0},data:{description:"",title:"数据",type:"array",visible:!t.editor.dataSourceType||t.editor.dataSourceType==="static",...l.getItemCollectionEditor(t,t.editor.valueField,t.editor.textField),refreshPanelAfterChanged:!0},url:{visible:t.editor.dataSourceType==="dynamic",$converter:M,description:"",title:"服务端API",type:"string"},body:{visible:t.editor.dataSourceType==="dynamic",$converter:M,description:"",title:"服务端API参数",type:"string"},textField:{description:"",title:"数据源显示字段",type:"string",readonly:t.editor.dataSourceType!=="dynamic"},valueField:{description:"",title:"数据源值字段",type:"string",readonly:t.editor.dataSourceType!=="dynamic"},multiSelect:{description:"",title:"启用多选",visible:!o||o==="StringType",type:"boolean",refreshPanelAfterChanged:!0},maxLength:{description:"",title:"最大输入长度",type:"number",editor:{nullable:!0,min:0,useThousands:!1}},...this.getCommonEditorProperties(t)},(r,u)=>{if(!r||!u.editor)return;const x=this;switch(r.propertyID){case"dataSourceType":{r.propertyValue==="static"?(u.editor.valueField="value",u.editor.textField="name",u.editor.remote=null):r.propertyValue==="dynamic"&&(u.editor.remote={method:"GET"},u.editor.valueField="value",u.editor.textField="name");break}case"data":{!x.checkEnumDataReadonly(u)&&u.formatter&&(u.formatter.data=[...r.propertyValue]);break}case"viewType":r.propertyValue==="tag"&&(u.editor.editable=!1)}})}getGridFieldEdtiorProperties(t,l){var y,r,u,x;const o=this;let a="";if(((y=t==null?void 0:t.binding)==null?void 0:y.type)==="Form"){const b=this.schemaService.getFieldByIDAndVMID(t.binding.field,this.viewModelId);(r=b==null?void 0:b.schemaField)!=null&&r.type&&(a=b.schemaField.type.$type)}return o.getComponentConfig(t,{type:"combo-list"},{enableClear:{description:"",title:"启用清空",type:"boolean"},data:{description:"",title:"数据",type:"array",visible:!0,...o.getItemCollectionEditor(t,(u=t.editor)==null?void 0:u.valueField,(x=t.editor)==null?void 0:x.textField),refreshPanelAfterChanged:!0},textField:{description:"",title:"数据源显示字段",type:"string",readonly:!0},valueField:{description:"",title:"数据源值字段",type:"string",readonly:!0},multiSelect:{description:"",title:"启用多选",visible:a==="StringType",type:"boolean",refreshPanelAfterChanged:!0},maxLength:{description:"",title:"最大输入长度",type:"number",editor:{nullable:!0,min:0,useThousands:!1}},...this.getCommonEditorProperties(t)},(b,v)=>{if(!b||!v.editor)return;const n=this;switch(b.propertyID){case"dataSourceType":{b.propertyValue==="static"?(v.editor.valueField="value",v.editor.textField="name",v.editor.remote=null):b.propertyValue==="dynamic"&&(v.editor.remote={method:"GET"});break}case"data":{!n.checkEnumDataReadonly(v)&&v.formatter&&(v.formatter.data=[...b.propertyValue]);break}}})}setEditorPropertyRelates(t,l,o){if(!t||!l.editor)return;const a=this;switch(t.propertyID){case"dataSourceType":{t.propertyValue==="static"&&(l.editor.valueField="value",l.editor.textField="name",l.editor.remote={});break}case"data":{!a.checkEnumDataReadonly(l)&&l.formatter&&(l.formatter.data=[...t.propertyValue]);break}}}changeBindingField(t,l,o){var f;super.changeBindingField(t,l);const a=o;t.editor&&((f=a==null?void 0:a.type)==null?void 0:f.$type)===j.FormSchemaEntityFieldType$Type.EnumType&&(t.editor.data=a.type.enumValues||[])}}function Y(e,t){const l=e.schema;function o(a,f){return new X(a,t).getPropertyConfig(l,f)}return{getPropsConfig:o}}const Z=i.defineComponent({name:"FComboListDesign",props:A,emits:["clear","update:modelValue","change"],setup(e,t){const l=i.ref(),o=i.inject("designer-host-service"),a=i.inject("design-item-context"),f=Y(a,o),y=G.useDesignerComponent(l,a,f);return i.onMounted(()=>{l.value.componentInstance=y}),t.expose(y.value),()=>i.createVNode(N,{ref:l,buttonContent:e.dropDownIcon,readonly:!0,editable:!1,forcePlaceholder:!0,placeholder:e.placeholder,enableClear:!0},null)}});P.register=(e,t,l,o)=>{e["combo-list"]=P,t["combo-list"]=L},P.registerDesigner=(e,t,l)=>{e["combo-list"]=Z,t["combo-list"]=L};const D=j.withInstall(P);h.FComboList=P,h.Placement=k,h.comboListDesignProps=A,h.comboListProps=B,h.default=D,h.propsResolver=L,Object.defineProperties(h,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(h,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("vue"),require("vue-i18n"),require("../button-edit/index.umd.js"),require("../dynamic-resolver/index.umd.js"),require("lodash-es"),require("../list-view/index.umd.js"),require("../../designer/button-edit/index.umd.js"),require("../designer-canvas/index.umd.js"),require("../common/index.umd.js"),require("../property-panel/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","vue-i18n","../button-edit/index.umd.js","../dynamic-resolver/index.umd.js","lodash-es","../list-view/index.umd.js","../../designer/button-edit/index.umd.js","../designer-canvas/index.umd.js","../common/index.umd.js","../property-panel/index.umd.js"],i):(h=typeof globalThis<"u"?globalThis:h||self,i(h["combo-list"]={},h.Vue,h.vueI18n,h.FButtonEdit,h.dynamicResolver,h.LodashES,h.FListView,h.FButtonEditDesign,h.designerCanvas,h.common,h.propertyPanel))})(this,function(h,i,E,O,j,q,$,N,G,H,W){"use strict";const U=new Map([["appearance",j.resolveAppearance]]),J={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/combo-list.schema.json",title:"combo-list",description:"A Farris Input Component",type:"object",properties:{id:{description:"The unique identifier for a combo list",type:"string"},type:{description:"The type string of number combo list component",type:"string",default:"combo-list"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},disabled:{description:"",type:"boolean",default:!1},enableClear:{description:"",type:"boolean",default:!1},editable:{description:"",type:"boolean",default:!1},enableLinkLabel:{description:"",type:"boolean",default:!1},label:{description:"",type:"string",default:""},lableWidth:{description:"",type:"number"},placeholder:{description:"",type:"string",default:"请选择"},idField:{description:"",type:"string",default:"id"},valueField:{description:"",type:"string",default:"id"},titleField:{description:"",type:"string",default:"name"},textField:{description:"",type:"string",default:"name"},dataSourceType:{description:"",type:"string",default:"static"},data:{description:"",type:"array"},remote:{description:"",type:"string"},readonly:{description:"",type:"boolean",default:!1},required:{description:"",type:"boolean",default:!1},tabindex:{description:"",type:"number",default:-1},textAlign:{description:"",type:"string",enum:["left","middle","right"],default:"left"},multiSelect:{description:"",type:"boolean",default:!1},maxLength:{description:"",type:"number",default:null},visible:{description:"",type:"boolean",default:!0},onBlur:{description:"",type:"string",default:""},onClickLinkLabel:{description:"",type:"sting",default:""},maxHeight:{description:"",type:"number",default:350},minPanelWidth:{description:"",type:"number",default:160},popupOnClick:{description:"",type:"boolean",default:!0},separator:{description:"",type:"string",default:","},viewType:{description:"",type:"string",default:"tag"},enableSearch:{description:"启用搜索",type:"boolean",default:!0},enableHighlightSearch:{description:"启用高亮搜索",type:"boolean",default:!1},"onUpdate:modelValue":{description:"",type:"object"}},required:["type"],ignore:["id","appearance","binding","visible"]};function _(e,t,l){return t}var k=(e=>(e.top="top",e.bottom="bottom",e.auto="auto",e))(k||{});const B={id:{type:String},data:{type:Array,default:[]},disabled:{default:!1,type:Boolean},dropDownIcon:{type:String,default:'<span class="f-icon f-icon-arrow-chevron-down"></span>'},editable:{default:!1,type:Boolean},enableClear:{default:!0,type:Boolean},enableSearch:{type:Boolean,default:!1},enableTitle:{default:!0,type:Boolean},fitEditor:{default:!1,type:Boolean},forcePlaceholder:{default:!1,type:Boolean},hidePanelOnClear:{default:!0,type:Boolean},idField:{default:"id",type:String},mapFields:{type:Object},maxHeight:{default:350,type:Number},maxLength:{type:Number},multiSelect:{type:Boolean,default:!1},modelValue:{},placeholder:{type:String,default:"请选择"},placement:{type:String,default:"auto"},readonly:{default:!1,type:Boolean},remote:{default:null,type:Object},remoteSearch:{default:!1,type:Boolean},separator:{default:",",type:String},tabIndex:{type:Number,default:-1},textField:{default:"name",type:String},titleField:{default:"name",type:String},valueField:{default:"id",type:String},viewType:{default:"tag",type:String},change:{type:Function,default:()=>{}},focusOnCreated:{type:Boolean,default:!1},selectOnCreated:{type:Boolean,default:!1},autoHeight:{type:Boolean,default:!0},beforeOpen:{type:Function,default:null},searchOption:{type:[Boolean,Function],default:!1},enableHighlightSearch:{type:Boolean,default:!0},minPanelWidth:{type:Number,default:160},popupOnClick:{type:Boolean,default:!0}},A=Object.assign({},B,{readonly:{}}),L=j.createPropsResolver(B,J,U,_),z={dataSource:{type:Array,default:[]},enableSearch:{type:Boolean,default:!1},idField:{type:String,default:"id"},multiSelect:{type:Boolean,default:!1},selectedValues:{type:String,default:""},separator:{type:String,default:","},textField:{type:String,default:"name"},titleField:{type:String,default:"name"},width:{type:Number},maxHeight:{type:Number},valueField:{type:String,default:"id"},onSelectionChange:{type:Function,default:()=>{}},searchOption:{type:[Boolean,Function],default:!1},enableHighlightSearch:{type:Boolean,default:!0}},K=i.defineComponent({name:"FComboListContainer",props:z,emits:["selectionChange"],setup(e,t){const l=i.ref(),o=i.ref(e.dataSource),a=i.ref([]),y=i.ref(e.separator),b=i.ref(e.width),c=i.ref(e.maxHeight),r=i.ref(String(e.selectedValues).split(y.value)),x=i.computed(()=>e.multiSelect),g=i.computed(()=>({enableSelectRow:!0,multiSelect:e.multiSelect,multiSelectMode:"OnCheckAndClick",showCheckbox:x.value,showSelectAll:!1,showSelection:!0}));i.watch(e.dataSource,()=>{o.value=e.dataSource}),i.computed(()=>e.enableSearch?"SearchBar":"ContentHeader");const S=i.computed(()=>{const u={};return b.value!==void 0&&(u.width=`${b.value}px`),c.value!==void 0&&c.value>0&&(u.maxHeight=`${c.value}px`),u});function n(u){l.value.search(u)}function d(u){a.value=u.map(f=>Object.assign({},f)),r.value=u.map(f=>f[e.idField]),t.emit("selectionChange",a.value)}function v(u){if(e.enableHighlightSearch)return;let f=[];const{searchOption:s}=e;typeof s=="function"?f=o.value.filter(C=>s(u,C)):f=o.value.filter(C=>C[e.valueField].indexOf(u)>-1||C[e.textField].indexOf(u)>-1),l.value.updateDataSource(f)}i.watch([()=>e.selectedValues],([u])=>{e.multiSelect?r.value=u.split(y.value):r.value=[u]});function F(u){l.value.activeRowById(u)}return i.onMounted(()=>{var u,f;if(!e.multiSelect){const s=(u=r.value)==null?void 0:u[0];let C=s;if(!q.isUndefined(s)){const w=typeof s,T=typeof((f=o.value[0])==null?void 0:f[e.valueField||e.idField]);T==="number"&&w!==T&&(C=Number(s)),T==="boolean"&&w!==T&&(C=s==="true"?!0:s==="false"?!1:s),F(C)}}}),t.expose({search:n,activeRowById:F}),()=>i.createVNode("div",{class:"f-combo-list-container",style:S.value},[i.createVNode($,{ref:l,size:"small",itemClass:"f-combo-list-item",itemContentClass:"text-truncate",header:"ContentHeader",headerClass:"f-combo-list-search-box",data:o.value,idField:e.idField,textField:e.textField,titleField:e.titleField,multiSelect:e.multiSelect,selection:g.value,enableHighlightSearch:e.enableHighlightSearch,selectionValues:r.value,onSelectionUpdate:d,onAfterSearch:v},null)])}});function Q(e){const{t}=E.useI18n(),l=i.ref(""),o=i.ref(e.modelValue),a=i.ref(e.data||[]),y=i.ref(e.editable);function b(n){const d=e.multiSelect?String(n).split(e.separator):[String(n)],v=d.map(f=>[f,!0]),F=new Map(v);return a.value.filter(f=>F.has(String(f[e.valueField]))).sort((f,s)=>{const C=d.indexOf(f[e.valueField]),w=d.indexOf(s[e.valueField]);return C-w})}function c(n){const d=b(n).map(v=>v[e.textField]).join(e.separator);l.value=y.value?d||n:d}function r(n){if(e.multiSelect){const d=n.split(e.separator).map(F=>[F,!0]),v=new Map(d);return a.value.filter(F=>v.has(F[e.textField]))}return a.value.filter(d=>""+d[e.textField]===n)}function x(n){const d={};return d[e.idField]=n,d[e.textField]=n,[d]}function g(n){let d=r(n);const v=d&&d.length>0;return y.value&&!v&&(d=x(n)),d}function S(){const{url:n,method:d="GET",headers:v={"Content-Type":"application/json;charset=utf-8;"},body:F=null}=e.remote,u=d.toLowerCase()==="get"?{method:d,headers:v}:{method:d,headers:v,body:F};let f=!1;fetch(new Request(n,u)).then(s=>{var w,T;if(s.status===200)return f=!!((T=(w=s.headers)==null?void 0:w.get("content-type"))!=null&&T.includes("application/json")),f?s.text():s.json();throw s.status===405?new Error(t("comboList.remoteError")):new Error(s.statusText)}).then(s=>{s.length&&(a.value=f?JSON.parse(s):s)}).catch(s=>{console.warn(s)})}return e.remote&&S(),i.watch(()=>e.data,()=>{a.value=e.data}),i.watch([a],([n])=>{if(e.modelValue!=null){const d=n.find(v=>v[e.valueField]===e.modelValue);d&&(l.value=d[e.textField])}}),i.watch(()=>e.modelValue,n=>{o.value=n,c(n)}),c(e.modelValue),{dataSource:a,displayText:l,editable:y,modelValue:o,getItemsByDisplayText:r,getItemsByValue:b,getSelectedItemsByDisplayText:g}}const P=i.defineComponent({name:"FComboList",props:B,emits:["clear","update:modelValue","change","input"],setup(e,t){const{t:l}=E.useI18n(),o=i.ref(),a=i.ref(),y=i.ref(e.disabled||e.readonly),b=i.ref(e.enableClear),c=i.ref(e.enableSearch),r=i.ref(e.readonly),{dataSource:x,displayText:g,editable:S,modelValue:n,getSelectedItemsByDisplayText:d,getItemsByDisplayText:v,getItemsByValue:F}=Q(e),u=i.ref(e.dropDownIcon);u.value==='<span class="f-icon f-icon-arrow-chevron-down"></span>'&&(u.value='<span id="'+e.id+'-icon-dropdown" class="f-icon f-icon-arrow-chevron-down"></span>');const f=i.computed(()=>e.multiSelect),s=i.computed(()=>a.value?a.value.elementRef.getBoundingClientRect().width:0);function C(){!f.value&&a.value&&a.value.hidePopup()}function w(m){g.value=m.map(V=>V[e.textField]).join(e.separator);let p="";m.length===1?p=m[0][e.valueField]:p=m.map(V=>V[e.valueField]).join(e.separator),n.value!==p&&(n.value=p,t.emit("update:modelValue",n.value),t.emit("change",m,n.value))}function T(){const m=F(n.value);w(m)}function ee(){r.value||g.value}function te(m){var p;n.value="",(p=o.value)==null||p.activeRowById(""),t.emit("update:modelValue",""),t.emit("change",[],""),t.emit("clear")}function ie(m){var p,V;e.enableSearch&&e.enableHighlightSearch&&((p=o.value)==null||p.search(m)),(V=o.value)==null||V.activeRowById(m),t.emit("change",[n.value],n.value)}function le(m){if(e.multiSelect){const p=v(m);e.viewType;const I=p.map(R=>R[e.idField||e.valueField]).join(e.separator);n.value!==I&&(n.value=I,t.emit("update:modelValue",n.value),t.emit("change",p,n.value))}}function ne(){return g.value}function ae(m){const{value:p}=m.target;ie(p),t.emit("input",p)}function oe(){a.value.hidePopup()}return t.expose({getDisplayText:ne,hidePopup:oe}),i.watch([()=>e.disabled,()=>e.editable,()=>e.enableClear,()=>e.enableSearch,()=>e.readonly],([m,p,V,I,R])=>{y.value=m,S.value=p,b.value=V,c.value=I,r.value=R}),()=>i.createVNode(O,{ref:a,id:e.id,disable:y.value,readonly:r.value,forcePlaceholder:e.forcePlaceholder,editable:S.value,buttonContent:u.value,placeholder:e.placeholder==="请选择"?l("comboList.placeholder"):e.placeholder,enableClear:b.value,maxLength:e.maxLength,tabIndex:e.tabIndex,enableTitle:e.enableTitle,multiSelect:e.multiSelect,inputType:e.multiSelect?e.viewType:"text",modelValue:g.value,"onUpdate:modelValue":m=>g.value=m,focusOnCreated:e.focusOnCreated,selectOnCreated:e.selectOnCreated,onClear:te,onClick:ee,onChange:le,onBlur:T,onInput:ae,beforeOpen:e.beforeOpen,placement:e.placement,popupMinWidth:e.minPanelWidth,popupClass:"f-combo-list-wrapper",popupOnClick:e.popupOnClick,limitContentBySpace:!0},{default:()=>[i.createVNode(K,{ref:o,idField:e.idField,valueField:e.valueField,textField:e.textField,titleField:e.titleField,dataSource:x.value,selectedValues:n.value,separator:e.separator,multiSelect:e.multiSelect,enableSearch:c.value,maxHeight:e.maxHeight,enableHighlightSearch:e.enableHighlightSearch,width:e.fitEditor?s.value:void 0,onSelectionChange:m=>{w(m),C()}},null)]})}}),M={convertFrom:(e,t)=>(e.editor.remote||{})[t],convertTo:(e,t,l)=>{e.editor.remote=e.editor.remote||{},e.editor.remote[t]=l}};class X extends W.InputBaseProperty{constructor(t,l){super(t,l)}getCommonEditorProperties(t){var l,o,a;return{viewType:{visible:!!((l=t.editor)!=null&&l.multiSelect),description:"数据展示类型,有标签和文本两种方式",title:"数据展示类型",type:"enum",editor:{data:[{id:"tag",name:"标签"},{id:"text",name:"文本"}]},refreshPanelAfterChanged:!0},separator:{visible:!!((o=t.editor)!=null&&o.multiSelect)&&((a=t.editor)==null?void 0:a.viewType)==="text",description:"下拉列表启用多选且数据展示类型为文本时的分隔符",title:"分隔符",type:"enum",editor:{data:[{id:",",name:"逗号(,)"},{id:"#",name:"井号(#)"},{id:".",name:"句号(.)"},{id:"|",name:"竖线(|)"}]}},editable:{description:"",title:"允许编辑",type:"boolean",refreshPanelAfterChanged:!0,readonly:!0}}}getEditorProperties(t){var y,b;const l=this;let o="";if(((y=t==null?void 0:t.binding)==null?void 0:y.type)==="Form"){const c=this.schemaService.getFieldByIDAndVMID(t.binding.field,this.viewModelId);(b=c==null?void 0:c.schemaField)!=null&&b.type&&(o=c.schemaField.type.$type)}return l.getComponentConfig(t,{type:"combo-list"},{enableClear:{description:"",title:"启用清空",type:"boolean"},dataSourceType:{description:"",title:"数据源类型",type:"enum",editor:{default:"static",data:[{id:"static",name:"静态"},{id:"dynamic",name:"动态"}]},refreshPanelAfterChanged:!0},data:{description:"",title:"数据",type:"array",visible:!t.editor.dataSourceType||t.editor.dataSourceType==="static",...l.getItemCollectionEditor(t,t.editor.valueField,t.editor.textField),refreshPanelAfterChanged:!0},url:{visible:t.editor.dataSourceType==="dynamic",$converter:M,description:"",title:"服务端API",type:"string"},body:{visible:!1,$converter:M,description:"",title:"服务端API参数",type:"string"},textField:{description:"",title:"数据源显示字段",type:"string",readonly:t.editor.dataSourceType!=="dynamic"},valueField:{description:"",title:"数据源值字段",type:"string",readonly:t.editor.dataSourceType!=="dynamic"},multiSelect:{description:"",title:"启用多选",visible:!o||o==="StringType",type:"boolean",refreshPanelAfterChanged:!0},maxLength:{description:"",title:"最大输入长度",type:"number",editor:{nullable:!0,min:0,useThousands:!1,needValid:!0}},...this.getCommonEditorProperties(t)},(c,r)=>{if(!c||!r.editor)return;const x=this;switch(c.propertyID){case"dataSourceType":{c.propertyValue==="static"?(r.editor.valueField="value",r.editor.textField="name",r.editor.remote=null):c.propertyValue==="dynamic"&&(r.editor.remote={method:"GET"},r.editor.valueField="value",r.editor.textField="name");break}case"data":{!x.checkEnumDataReadonly(r)&&r.formatter&&(r.formatter.data=[...c.propertyValue]);break}case"viewType":c.propertyValue==="tag"&&(r.editor.editable=!1)}})}getGridFieldEdtiorProperties(t,l){var b,c,r,x;const o=this;let a="";if(((b=t==null?void 0:t.binding)==null?void 0:b.type)==="Form"){const g=this.schemaService.getFieldByIDAndVMID(t.binding.field,this.viewModelId);(c=g==null?void 0:g.schemaField)!=null&&c.type&&(a=g.schemaField.type.$type)}return o.getComponentConfig(t,{type:"combo-list"},{enableClear:{description:"",title:"启用清空",type:"boolean"},data:{description:"",title:"数据",type:"array",visible:!0,...o.getItemCollectionEditor(t,(r=t.editor)==null?void 0:r.valueField,(x=t.editor)==null?void 0:x.textField),refreshPanelAfterChanged:!0},textField:{description:"",title:"数据源显示字段",type:"string",readonly:!0},valueField:{description:"",title:"数据源值字段",type:"string",readonly:!0},multiSelect:{description:"",title:"启用多选",visible:a==="StringType",type:"boolean",refreshPanelAfterChanged:!0},maxLength:{description:"",title:"最大输入长度",type:"number",editor:{nullable:!0,min:0,useThousands:!1,needValid:!0}},...this.getCommonEditorProperties(t)},(g,S)=>{if(!g||!S.editor)return;const n=this;switch(g.propertyID){case"dataSourceType":{g.propertyValue==="static"?(S.editor.valueField="value",S.editor.textField="name",S.editor.remote=null):g.propertyValue==="dynamic"&&(S.editor.remote={method:"GET"});break}case"data":{!n.checkEnumDataReadonly(S)&&S.formatter&&(S.formatter.data=[...g.propertyValue]);break}}})}setEditorPropertyRelates(t,l,o){if(!t||!l.editor)return;const a=this;switch(t.propertyID){case"dataSourceType":{t.propertyValue==="static"&&(l.editor.valueField="value",l.editor.textField="name",l.editor.remote={});break}case"data":{!a.checkEnumDataReadonly(l)&&l.formatter&&(l.formatter.data=[...t.propertyValue]);break}}}changeBindingField(t,l,o){var y;super.changeBindingField(t,l);const a=o;t.editor&&((y=a==null?void 0:a.type)==null?void 0:y.$type)===H.FormSchemaEntityFieldType$Type.EnumType&&(t.editor.data=a.type.enumValues||[])}}function Y(e,t){const l=e.schema;function o(a,y){return new X(a,t).getPropertyConfig(l,y)}return{getPropsConfig:o}}const Z=i.defineComponent({name:"FComboListDesign",props:A,emits:["clear","update:modelValue","change"],setup(e,t){const l=i.ref(),o=i.inject("designer-host-service"),a=i.inject("design-item-context"),y=Y(a,o),b=G.useDesignerComponent(l,a,y);return i.onMounted(()=>{l.value.componentInstance=b}),t.expose(b.value),()=>i.createVNode(N,{ref:l,buttonContent:e.dropDownIcon,readonly:!0,editable:!1,forcePlaceholder:!0,placeholder:e.placeholder,enableClear:!0},null)}});P.register=(e,t,l,o)=>{e["combo-list"]=P,t["combo-list"]=L},P.registerDesigner=(e,t,l)=>{e["combo-list"]=Z,t["combo-list"]=L};const D=H.withInstall(P);h.FComboList=P,h.Placement=k,h.comboListDesignProps=A,h.comboListProps=B,h.default=D,h.propsResolver=L,Object.defineProperties(h,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -3285,7 +3285,7 @@ function Vr() {
|
|
|
3285
3285
|
if (isNaN(s.getTime())) {
|
|
3286
3286
|
let i = n;
|
|
3287
3287
|
if (n.indexOf("-") > -1 || n.indexOf("/") > -1) {
|
|
3288
|
-
n.indexOf("/") > -1 && (i = n.replace(
|
|
3288
|
+
n.indexOf("/") > -1 && (i = n.replace(/\//g, "-"));
|
|
3289
3289
|
const o = "-";
|
|
3290
3290
|
i = i.split(o).map((u) => u.length < 2 ? u.padStart(2, "0") : u).join(o);
|
|
3291
3291
|
}
|