@farris/ui-vue 1.6.5-beta.7 → 1.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/accordion/index.esm.js +65 -65
- package/components/accordion/index.umd.cjs +1 -1
- package/components/avatar/index.esm.js +360 -361
- package/components/avatar/index.umd.cjs +1 -1
- package/components/button-edit/index.esm.js +524 -520
- package/components/button-edit/index.umd.cjs +1 -1
- package/components/calendar/index.esm.js +134 -134
- package/components/calendar/index.umd.cjs +1 -1
- package/components/capsule/index.esm.js +192 -192
- package/components/capsule/index.umd.cjs +1 -1
- package/components/code-editor/index.esm.js +8 -8
- package/components/code-editor/index.umd.cjs +3 -3
- package/components/collection-property-editor/index.esm.js +72 -72
- package/components/collection-property-editor/index.umd.cjs +1 -1
- package/components/color-picker/index.esm.js +291 -289
- package/components/color-picker/index.umd.cjs +1 -1
- package/components/combo-list/index.esm.js +190 -181
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/combo-tree/index.esm.js +113 -112
- package/components/combo-tree/index.umd.cjs +1 -1
- package/components/common/index.esm.js +3 -1
- package/components/common/index.umd.cjs +1 -1
- package/components/component/index.esm.js +309 -309
- package/components/component/index.umd.cjs +1 -1
- package/components/condition/index.esm.js +1125 -1124
- package/components/condition/index.umd.cjs +1 -1
- package/components/content-container/index.esm.js +472 -472
- 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 +3387 -3321
- package/components/data-view/index.umd.cjs +1 -1
- package/components/date-picker/index.esm.js +1604 -1601
- package/components/date-picker/index.umd.cjs +1 -1
- package/components/designer-canvas/index.esm.js +1082 -1079
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/discussion-editor/index.esm.js +973 -1040
- package/components/discussion-editor/index.umd.cjs +6 -6
- package/components/dropdown/index.esm.js +335 -330
- package/components/dropdown/index.umd.cjs +2 -2
- package/components/dynamic-form/index.esm.js +177 -177
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-resolver/index.esm.js +6 -6
- package/components/dynamic-resolver/index.umd.cjs +1 -1
- package/components/dynamic-view/index.esm.js +344 -344
- package/components/dynamic-view/index.umd.cjs +1 -1
- package/components/events-editor/index.esm.js +644 -644
- package/components/events-editor/index.umd.cjs +3 -3
- package/components/expression-editor/index.esm.js +1773 -1760
- package/components/expression-editor/index.umd.cjs +4 -4
- package/components/fieldset/index.esm.js +55 -55
- package/components/fieldset/index.umd.cjs +1 -1
- package/components/filter-bar/index.esm.js +879 -869
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/filter-condition-editor/index.esm.js +1091 -1077
- package/components/filter-condition-editor/index.umd.cjs +3 -3
- package/components/flow-canvas/index.esm.js +215 -215
- package/components/flow-canvas/index.umd.cjs +1 -1
- package/components/html-template/index.esm.js +164 -164
- package/components/html-template/index.umd.cjs +1 -1
- package/components/image-cropper/index.esm.js +198 -198
- package/components/image-cropper/index.umd.cjs +1 -1
- package/components/json-editor/index.esm.js +64 -64
- package/components/json-editor/index.umd.cjs +1 -1
- package/components/language-textbox/index.esm.js +140 -140
- package/components/language-textbox/index.umd.cjs +1 -1
- package/components/layout/index.esm.js +111 -111
- package/components/layout/index.umd.cjs +1 -1
- package/components/list-nav/index.esm.js +90 -90
- package/components/list-nav/index.umd.cjs +1 -1
- package/components/list-view/index.esm.js +139 -141
- package/components/list-view/index.umd.cjs +3 -3
- package/components/locale/index.esm.js +833 -901
- package/components/locale/index.umd.cjs +6 -6
- package/components/lookup/index.esm.js +1352 -1351
- package/components/lookup/index.umd.cjs +1 -1
- package/components/mapping-editor/index.esm.js +1387 -1383
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/menu-lookup/index.esm.js +1059 -1127
- package/components/menu-lookup/index.umd.cjs +6 -6
- package/components/message-box/index.esm.js +217 -217
- package/components/message-box/index.umd.cjs +1 -1
- package/components/modal/index.esm.js +283 -283
- package/components/modal/index.umd.cjs +1 -1
- package/components/nav/index.esm.js +106 -106
- package/components/nav/index.umd.cjs +1 -1
- package/components/number-range/index.esm.js +194 -194
- package/components/number-range/index.umd.cjs +1 -1
- package/components/number-spinner/index.esm.js +463 -462
- package/components/number-spinner/index.umd.cjs +1 -1
- package/components/order/index.esm.js +883 -876
- package/components/order/index.umd.cjs +4 -4
- package/components/page-footer/index.esm.js +94 -94
- package/components/page-footer/index.umd.cjs +1 -1
- package/components/page-header/index.esm.js +942 -939
- package/components/page-header/index.umd.cjs +1 -1
- package/components/pagination/index.esm.js +82 -82
- package/components/pagination/index.umd.cjs +1 -1
- package/components/popover/index.esm.js +59 -57
- package/components/popover/index.umd.cjs +1 -1
- package/components/progress/index.esm.js +113 -113
- package/components/progress/index.umd.cjs +2 -2
- package/components/property-editor/index.esm.js +151 -150
- package/components/property-editor/index.umd.cjs +1 -1
- package/components/property-panel/index.esm.js +739 -739
- package/components/property-panel/index.umd.cjs +2 -2
- package/components/query-solution/index.esm.js +4142 -4190
- package/components/query-solution/index.umd.cjs +6 -6
- package/components/radio-button/index.esm.js +182 -182
- package/components/radio-button/index.umd.cjs +1 -1
- package/components/rate/index.esm.js +106 -106
- package/components/rate/index.umd.cjs +1 -1
- package/components/response-layout/index.esm.js +535 -535
- package/components/response-layout/index.umd.cjs +1 -1
- package/components/response-layout-editor/index.esm.js +1456 -1443
- package/components/response-layout-editor/index.umd.cjs +1 -1
- package/components/response-toolbar/index.esm.js +779 -776
- package/components/response-toolbar/index.umd.cjs +1 -1
- package/components/schema-selector/index.esm.js +1875 -1866
- package/components/schema-selector/index.umd.cjs +7 -7
- package/components/search-box/index.esm.js +151 -147
- package/components/search-box/index.umd.cjs +1 -1
- package/components/section/index.esm.js +1236 -1233
- package/components/section/index.umd.cjs +1 -1
- package/components/smoke-detector/index.esm.js +163 -163
- package/components/smoke-detector/index.umd.cjs +1 -1
- package/components/sort-condition-editor/index.esm.js +1097 -1083
- package/components/sort-condition-editor/index.umd.cjs +3 -3
- package/components/splitter/index.esm.js +3 -3
- package/components/splitter/index.umd.cjs +1 -1
- package/components/step/index.esm.js +133 -133
- package/components/step/index.umd.cjs +1 -1
- package/components/switch/index.esm.js +103 -98
- package/components/switch/index.umd.cjs +1 -1
- package/components/tabs/index.esm.js +1596 -1593
- package/components/tabs/index.umd.cjs +2 -2
- package/components/tags/index.esm.js +93 -93
- package/components/tags/index.umd.cjs +1 -1
- package/components/text/index.esm.js +138 -138
- package/components/text/index.umd.cjs +1 -1
- package/components/textarea/index.esm.js +684 -684
- package/components/textarea/index.umd.cjs +2 -2
- package/components/time-picker/index.esm.js +935 -929
- package/components/time-picker/index.umd.cjs +1 -1
- package/components/tooltip/index.esm.js +173 -171
- package/components/tooltip/index.umd.cjs +1 -1
- package/components/transfer/index.esm.js +190 -192
- package/components/transfer/index.umd.cjs +4 -4
- package/components/tree-grid/index.esm.js +124 -124
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-view/index.esm.js +2363 -2278
- package/components/tree-view/index.umd.cjs +1 -1
- package/components/uploader/index.esm.js +170 -170
- package/components/uploader/index.umd.cjs +2 -2
- package/components/verify-detail/index.esm.js +196 -196
- package/components/verify-detail/index.umd.cjs +1 -1
- package/components/video/index.esm.js +227 -227
- package/components/video/index.umd.cjs +1 -1
- package/components/weather/index.esm.js +9 -9
- package/components/weather/index.umd.cjs +2 -2
- package/designer/button-edit/index.esm.js +353 -353
- package/designer/button-edit/index.umd.cjs +1 -1
- package/designer/checkbox/index.esm.js +7 -3
- package/designer/checkbox/index.umd.cjs +1 -1
- package/designer/checkbox-group/index.esm.js +38 -33
- package/designer/checkbox-group/index.umd.cjs +1 -1
- package/designer/data-grid/index.esm.js +3562 -3536
- package/designer/data-grid/index.umd.cjs +6 -6
- package/designer/data-view/index.esm.js +3 -3
- package/designer/data-view/index.umd.cjs +3 -3
- package/designer/farris-designer.all.esm.js +4203 -4193
- package/designer/farris-designer.all.umd.cjs +9 -9
- package/designer/input-group/index.esm.js +97 -97
- package/designer/input-group/index.umd.cjs +1 -1
- package/designer/list-view/index.esm.js +1868 -1854
- package/designer/list-view/index.umd.cjs +8 -8
- package/designer/radio-group/index.esm.js +954 -949
- package/designer/radio-group/index.umd.cjs +1 -1
- package/farris.all.esm.js +16195 -16126
- package/farris.all.umd.cjs +30 -30
- package/locales/data-grid/ui/en.json +2 -2
- package/locales/designer/en.json +7 -6
- package/locales/designer/zh-CHS.json +2 -1
- package/locales/designer/zh-CHT.json +2 -1
- package/locales/ui/en.json +7 -6
- package/locales/ui/zh-CHS.json +2 -1
- package/locales/ui/zh-CHT.json +2 -1
- 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
- package/types/lookup/src/composition/use-dialog.d.ts +2 -0
- package/types/lookup/src/composition/use-input-change.d.ts +1 -0
|
@@ -1,16 +1,16 @@
|
|
|
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
|
-
import
|
|
4
|
-
import { resolveAppearance as
|
|
5
|
-
import { isUndefined as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { useDesignerComponent as
|
|
9
|
-
import { FormSchemaEntityFieldType$Type as
|
|
10
|
-
import { InputBaseProperty as
|
|
11
|
-
const
|
|
12
|
-
["appearance",
|
|
13
|
-
]),
|
|
3
|
+
import z from "../button-edit/index.esm.js";
|
|
4
|
+
import { resolveAppearance as K, createPropsResolver as Q } from "../dynamic-resolver/index.esm.js";
|
|
5
|
+
import { isUndefined as X } from "lodash-es";
|
|
6
|
+
import Y from "../list-view/index.esm.js";
|
|
7
|
+
import Z from "../../designer/button-edit/index.esm.js";
|
|
8
|
+
import { useDesignerComponent as _ } from "../designer-canvas/index.esm.js";
|
|
9
|
+
import { FormSchemaEntityFieldType$Type as D, withInstall as ee } from "../common/index.esm.js";
|
|
10
|
+
import { InputBaseProperty as te } from "../property-panel/index.esm.js";
|
|
11
|
+
const ie = /* @__PURE__ */ new Map([
|
|
12
|
+
["appearance", K]
|
|
13
|
+
]), le = "https://json-schema.org/draft/2020-12/schema", ne = "https://farris-design.gitee.io/combo-list.schema.json", ae = "combo-list", oe = "A Farris Input Component", de = "object", ue = {
|
|
14
14
|
id: {
|
|
15
15
|
description: "The unique identifier for a combo list",
|
|
16
16
|
type: "string"
|
|
@@ -189,28 +189,32 @@ const ee = /* @__PURE__ */ new Map([
|
|
|
189
189
|
description: "启用高亮搜索",
|
|
190
190
|
type: "boolean",
|
|
191
191
|
default: !1
|
|
192
|
+
},
|
|
193
|
+
onChange: {
|
|
194
|
+
description: "",
|
|
195
|
+
type: "string"
|
|
192
196
|
}
|
|
193
|
-
},
|
|
197
|
+
}, re = [
|
|
194
198
|
"type"
|
|
195
|
-
],
|
|
199
|
+
], ce = [
|
|
196
200
|
"id",
|
|
197
201
|
"appearance",
|
|
198
202
|
"binding",
|
|
199
203
|
"visible"
|
|
200
|
-
],
|
|
201
|
-
$schema:
|
|
202
|
-
$id:
|
|
203
|
-
title:
|
|
204
|
-
description:
|
|
205
|
-
type:
|
|
206
|
-
properties:
|
|
207
|
-
required:
|
|
208
|
-
ignore:
|
|
204
|
+
], se = {
|
|
205
|
+
$schema: le,
|
|
206
|
+
$id: ne,
|
|
207
|
+
title: ae,
|
|
208
|
+
description: oe,
|
|
209
|
+
type: de,
|
|
210
|
+
properties: ue,
|
|
211
|
+
required: re,
|
|
212
|
+
ignore: ce
|
|
209
213
|
};
|
|
210
|
-
function
|
|
214
|
+
function fe(e, t, i) {
|
|
211
215
|
return t;
|
|
212
216
|
}
|
|
213
|
-
var
|
|
217
|
+
var me = /* @__PURE__ */ ((e) => (e.top = "top", e.bottom = "bottom", e.auto = "auto", e))(me || {});
|
|
214
218
|
const H = {
|
|
215
219
|
/**
|
|
216
220
|
* 组件标识
|
|
@@ -379,9 +383,9 @@ const H = {
|
|
|
379
383
|
enableHighlightSearch: { type: Boolean, default: !0 },
|
|
380
384
|
minPanelWidth: { type: Number, default: 160 },
|
|
381
385
|
popupOnClick: { type: Boolean, default: !0 }
|
|
382
|
-
},
|
|
386
|
+
}, he = Object.assign({}, H, {
|
|
383
387
|
readonly: {}
|
|
384
|
-
}), $ =
|
|
388
|
+
}), $ = Q(H, se, ie, fe), ye = {
|
|
385
389
|
dataSource: { type: Array, default: [] },
|
|
386
390
|
enableSearch: { type: Boolean, default: !1 },
|
|
387
391
|
idField: { type: String, default: "id" },
|
|
@@ -402,12 +406,12 @@ const H = {
|
|
|
402
406
|
},
|
|
403
407
|
// 搜索启用高亮
|
|
404
408
|
enableHighlightSearch: { type: Boolean, default: !0 }
|
|
405
|
-
},
|
|
409
|
+
}, ge = /* @__PURE__ */ E({
|
|
406
410
|
name: "FComboListContainer",
|
|
407
|
-
props:
|
|
411
|
+
props: ye,
|
|
408
412
|
emits: ["selectionChange"],
|
|
409
413
|
setup(e, t) {
|
|
410
|
-
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(() => ({
|
|
411
415
|
enableSelectRow: !0,
|
|
412
416
|
multiSelect: e.multiSelect,
|
|
413
417
|
multiSelectMode: "OnCheckAndClick",
|
|
@@ -419,38 +423,38 @@ const H = {
|
|
|
419
423
|
a.value = e.dataSource;
|
|
420
424
|
}), V(() => e.enableSearch ? "SearchBar" : "ContentHeader");
|
|
421
425
|
const p = V(() => {
|
|
422
|
-
const
|
|
423
|
-
return
|
|
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;
|
|
424
428
|
});
|
|
425
|
-
function l(
|
|
426
|
-
i.value.search(
|
|
429
|
+
function l(u) {
|
|
430
|
+
i.value.search(u);
|
|
427
431
|
}
|
|
428
|
-
function o(
|
|
429
|
-
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);
|
|
430
434
|
}
|
|
431
|
-
function
|
|
435
|
+
function b(u) {
|
|
432
436
|
if (e.enableHighlightSearch)
|
|
433
437
|
return;
|
|
434
|
-
let
|
|
438
|
+
let s = [];
|
|
435
439
|
const {
|
|
436
|
-
searchOption:
|
|
440
|
+
searchOption: r
|
|
437
441
|
} = e;
|
|
438
|
-
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);
|
|
439
443
|
}
|
|
440
|
-
B([() => e.selectedValues], ([
|
|
441
|
-
e.multiSelect ?
|
|
444
|
+
B([() => e.selectedValues], ([u]) => {
|
|
445
|
+
e.multiSelect ? d.value = u.split(m.value) : d.value = [u];
|
|
442
446
|
});
|
|
443
|
-
function F(
|
|
444
|
-
i.value.activeRowById(
|
|
447
|
+
function F(u) {
|
|
448
|
+
i.value.activeRowById(u);
|
|
445
449
|
}
|
|
446
450
|
return O(() => {
|
|
447
|
-
var
|
|
451
|
+
var u, s;
|
|
448
452
|
if (!e.multiSelect) {
|
|
449
|
-
const
|
|
450
|
-
let S =
|
|
451
|
-
if (!
|
|
452
|
-
const x = typeof
|
|
453
|
-
w === "number" && x !== w && (S = Number(
|
|
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);
|
|
454
458
|
}
|
|
455
459
|
}
|
|
456
460
|
}), t.expose({
|
|
@@ -459,7 +463,7 @@ const H = {
|
|
|
459
463
|
}), () => I("div", {
|
|
460
464
|
class: "f-combo-list-container",
|
|
461
465
|
style: p.value
|
|
462
|
-
}, [I(
|
|
466
|
+
}, [I(Y, {
|
|
463
467
|
ref: i,
|
|
464
468
|
size: "small",
|
|
465
469
|
itemClass: "f-combo-list-item",
|
|
@@ -471,31 +475,31 @@ const H = {
|
|
|
471
475
|
textField: e.textField,
|
|
472
476
|
titleField: e.titleField,
|
|
473
477
|
multiSelect: e.multiSelect,
|
|
474
|
-
selection:
|
|
478
|
+
selection: h.value,
|
|
475
479
|
enableHighlightSearch: e.enableHighlightSearch,
|
|
476
|
-
selectionValues:
|
|
480
|
+
selectionValues: d.value,
|
|
477
481
|
onSelectionUpdate: o,
|
|
478
|
-
onAfterSearch:
|
|
482
|
+
onAfterSearch: b
|
|
479
483
|
}, null)]);
|
|
480
484
|
}
|
|
481
485
|
});
|
|
482
|
-
function
|
|
483
|
-
const { t } = M(), i =
|
|
484
|
-
function
|
|
485
|
-
const o = e.multiSelect ? String(l).split(e.separator) : [String(l)],
|
|
486
|
-
return n.value.filter((
|
|
487
|
-
const S = o.indexOf(
|
|
486
|
+
function ve(e) {
|
|
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]);
|
|
488
492
|
return S - x;
|
|
489
493
|
});
|
|
490
494
|
}
|
|
491
|
-
function
|
|
492
|
-
const o =
|
|
493
|
-
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;
|
|
494
498
|
}
|
|
495
|
-
function
|
|
499
|
+
function d(l) {
|
|
496
500
|
if (e.multiSelect) {
|
|
497
|
-
const o = l.split(e.separator).map((F) => [F, !0]),
|
|
498
|
-
return n.value.filter((F) =>
|
|
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]));
|
|
499
503
|
}
|
|
500
504
|
return n.value.filter((o) => "" + o[e.textField] === l);
|
|
501
505
|
}
|
|
@@ -503,35 +507,35 @@ function ye(e) {
|
|
|
503
507
|
const o = {};
|
|
504
508
|
return o[e.idField] = l, o[e.textField] = l, [o];
|
|
505
509
|
}
|
|
506
|
-
function
|
|
507
|
-
let o =
|
|
508
|
-
const
|
|
509
|
-
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;
|
|
510
514
|
}
|
|
511
515
|
function p() {
|
|
512
|
-
const { url: l, method: o = "GET", headers:
|
|
513
|
-
let
|
|
514
|
-
fetch(new Request(l,
|
|
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) => {
|
|
515
519
|
var x, w;
|
|
516
|
-
if (
|
|
517
|
-
return
|
|
518
|
-
throw
|
|
519
|
-
}).then((
|
|
520
|
-
|
|
521
|
-
}).catch((
|
|
522
|
-
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);
|
|
523
527
|
});
|
|
524
528
|
}
|
|
525
529
|
return e.remote && p(), B(() => e.data, () => {
|
|
526
530
|
n.value = e.data;
|
|
527
531
|
}), B([n], ([l]) => {
|
|
528
532
|
if (e.modelValue != null) {
|
|
529
|
-
const o = l.find((
|
|
533
|
+
const o = l.find((b) => b[e.valueField] === e.modelValue);
|
|
530
534
|
o && (i.value = o[e.textField]);
|
|
531
535
|
}
|
|
532
536
|
}), B(() => e.modelValue, (l) => {
|
|
533
|
-
a.value = l,
|
|
534
|
-
}),
|
|
537
|
+
a.value = l, c(l);
|
|
538
|
+
}), c(e.modelValue), { dataSource: n, displayText: i, editable: m, modelValue: a, getItemsByDisplayText: d, getItemsByValue: g, getSelectedItemsByDisplayText: h };
|
|
535
539
|
}
|
|
536
540
|
const L = /* @__PURE__ */ E({
|
|
537
541
|
name: "FComboList",
|
|
@@ -540,85 +544,89 @@ const L = /* @__PURE__ */ E({
|
|
|
540
544
|
setup(e, t) {
|
|
541
545
|
const {
|
|
542
546
|
t: i
|
|
543
|
-
} = 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), {
|
|
544
548
|
dataSource: C,
|
|
545
|
-
displayText:
|
|
549
|
+
displayText: h,
|
|
546
550
|
editable: p,
|
|
547
551
|
modelValue: l,
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
552
|
+
getSelectedItemsByDisplayText: o,
|
|
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();
|
|
554
560
|
}
|
|
555
|
-
function
|
|
556
|
-
|
|
557
|
-
let
|
|
558
|
-
|
|
561
|
+
function x(f) {
|
|
562
|
+
h.value = f.map((T) => T[e.textField]).join(e.separator);
|
|
563
|
+
let v = "";
|
|
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));
|
|
559
565
|
}
|
|
560
|
-
function
|
|
561
|
-
const
|
|
562
|
-
|
|
566
|
+
function w() {
|
|
567
|
+
const f = F(l.value);
|
|
568
|
+
x(f);
|
|
563
569
|
}
|
|
564
|
-
function
|
|
565
|
-
|
|
570
|
+
function N() {
|
|
571
|
+
d.value || h.value;
|
|
566
572
|
}
|
|
567
|
-
function
|
|
568
|
-
var
|
|
569
|
-
l.value = "", (
|
|
573
|
+
function j(f) {
|
|
574
|
+
var v;
|
|
575
|
+
l.value = "", (v = a.value) == null || v.activeRowById(""), t.emit("update:modelValue", ""), t.emit("change", [], ""), t.emit("clear");
|
|
570
576
|
}
|
|
571
|
-
function
|
|
572
|
-
var
|
|
573
|
-
e.enableSearch && e.enableHighlightSearch && ((
|
|
577
|
+
function q(f) {
|
|
578
|
+
var v, T;
|
|
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);
|
|
574
580
|
}
|
|
575
|
-
function
|
|
581
|
+
function G(f) {
|
|
576
582
|
if (e.multiSelect) {
|
|
577
|
-
const
|
|
578
|
-
|
|
583
|
+
const v = b(f);
|
|
584
|
+
e.viewType;
|
|
585
|
+
const P = v.map((R) => R[e.idField || e.valueField]).join(e.separator);
|
|
586
|
+
l.value !== P && (l.value = P, t.emit("update:modelValue", l.value), t.emit("change", v, l.value));
|
|
579
587
|
}
|
|
580
588
|
}
|
|
581
|
-
function
|
|
582
|
-
return
|
|
589
|
+
function W() {
|
|
590
|
+
return h.value;
|
|
583
591
|
}
|
|
584
|
-
function
|
|
592
|
+
function U(f) {
|
|
585
593
|
const {
|
|
586
|
-
value:
|
|
587
|
-
} =
|
|
588
|
-
|
|
594
|
+
value: v
|
|
595
|
+
} = f.target;
|
|
596
|
+
q(v), t.emit("input", v);
|
|
589
597
|
}
|
|
590
|
-
function
|
|
598
|
+
function J() {
|
|
591
599
|
n.value.hidePopup();
|
|
592
600
|
}
|
|
593
601
|
return t.expose({
|
|
594
|
-
getDisplayText:
|
|
595
|
-
hidePopup:
|
|
596
|
-
}), B([() => e.disabled, () => e.editable, () => e.enableClear, () => e.enableSearch, () => e.readonly], ([
|
|
597
|
-
|
|
598
|
-
}), () => I(
|
|
602
|
+
getDisplayText: W,
|
|
603
|
+
hidePopup: J
|
|
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;
|
|
606
|
+
}), () => I(z, {
|
|
599
607
|
ref: n,
|
|
600
608
|
id: e.id,
|
|
601
|
-
disable:
|
|
602
|
-
readonly:
|
|
609
|
+
disable: m.value,
|
|
610
|
+
readonly: d.value,
|
|
603
611
|
forcePlaceholder: e.forcePlaceholder,
|
|
604
612
|
editable: p.value,
|
|
605
|
-
buttonContent:
|
|
613
|
+
buttonContent: u.value,
|
|
606
614
|
placeholder: e.placeholder === "请选择" ? i("comboList.placeholder") : e.placeholder,
|
|
607
|
-
enableClear:
|
|
615
|
+
enableClear: g.value,
|
|
608
616
|
maxLength: e.maxLength,
|
|
609
617
|
tabIndex: e.tabIndex,
|
|
610
618
|
enableTitle: e.enableTitle,
|
|
611
619
|
multiSelect: e.multiSelect,
|
|
612
620
|
inputType: e.multiSelect ? e.viewType : "text",
|
|
613
|
-
modelValue:
|
|
614
|
-
"onUpdate:modelValue": (
|
|
621
|
+
modelValue: h.value,
|
|
622
|
+
"onUpdate:modelValue": (f) => h.value = f,
|
|
615
623
|
focusOnCreated: e.focusOnCreated,
|
|
616
624
|
selectOnCreated: e.selectOnCreated,
|
|
617
|
-
onClear:
|
|
618
|
-
onClick:
|
|
619
|
-
onChange:
|
|
620
|
-
onBlur:
|
|
621
|
-
onInput:
|
|
625
|
+
onClear: j,
|
|
626
|
+
onClick: N,
|
|
627
|
+
onChange: G,
|
|
628
|
+
onBlur: w,
|
|
629
|
+
onInput: U,
|
|
622
630
|
beforeOpen: e.beforeOpen,
|
|
623
631
|
placement: e.placement,
|
|
624
632
|
popupMinWidth: e.minPanelWidth,
|
|
@@ -626,7 +634,7 @@ const L = /* @__PURE__ */ E({
|
|
|
626
634
|
popupOnClick: e.popupOnClick,
|
|
627
635
|
limitContentBySpace: !0
|
|
628
636
|
}, {
|
|
629
|
-
default: () => [I(
|
|
637
|
+
default: () => [I(ge, {
|
|
630
638
|
ref: a,
|
|
631
639
|
idField: e.idField,
|
|
632
640
|
valueField: e.valueField,
|
|
@@ -636,12 +644,12 @@ const L = /* @__PURE__ */ E({
|
|
|
636
644
|
selectedValues: l.value,
|
|
637
645
|
separator: e.separator,
|
|
638
646
|
multiSelect: e.multiSelect,
|
|
639
|
-
enableSearch:
|
|
647
|
+
enableSearch: c.value,
|
|
640
648
|
maxHeight: e.maxHeight,
|
|
641
649
|
enableHighlightSearch: e.enableHighlightSearch,
|
|
642
|
-
width: e.fitEditor ?
|
|
643
|
-
onSelectionChange: (
|
|
644
|
-
|
|
650
|
+
width: e.fitEditor ? r.value : void 0,
|
|
651
|
+
onSelectionChange: (f) => {
|
|
652
|
+
x(f), S();
|
|
645
653
|
}
|
|
646
654
|
}, null)]
|
|
647
655
|
});
|
|
@@ -652,12 +660,12 @@ const L = /* @__PURE__ */ E({
|
|
|
652
660
|
e.editor.remote = e.editor.remote || {}, e.editor.remote[t] = i;
|
|
653
661
|
}
|
|
654
662
|
};
|
|
655
|
-
class
|
|
663
|
+
class be extends te {
|
|
656
664
|
constructor(t, i) {
|
|
657
665
|
super(t, i);
|
|
658
666
|
}
|
|
659
667
|
getCommonEditorProperties(t) {
|
|
660
|
-
var i, a, n
|
|
668
|
+
var i, a, n;
|
|
661
669
|
return {
|
|
662
670
|
viewType: {
|
|
663
671
|
visible: !!((i = t.editor) != null && i.multiSelect),
|
|
@@ -691,23 +699,24 @@ class ge extends D {
|
|
|
691
699
|
title: "允许编辑",
|
|
692
700
|
type: "boolean",
|
|
693
701
|
refreshPanelAfterChanged: !0,
|
|
694
|
-
readonly:
|
|
695
|
-
|
|
696
|
-
enableHighlightSearch: {
|
|
697
|
-
visible: !!((u = t.editor) != null && u.editable),
|
|
698
|
-
description: "编辑状态下启用高亮搜索",
|
|
699
|
-
title: "启用高亮搜索",
|
|
700
|
-
type: "boolean"
|
|
702
|
+
readonly: !0
|
|
703
|
+
// readonly: !!propertyData.editor?.multiSelect && (propertyData.editor?.viewType === 'tag' || !propertyData.editor!.viewType)
|
|
701
704
|
}
|
|
705
|
+
// enableHighlightSearch: {
|
|
706
|
+
// visible: !!propertyData.editor?.editable,
|
|
707
|
+
// description: "编辑状态下启用高亮搜索",
|
|
708
|
+
// title: "启用高亮搜索",
|
|
709
|
+
// type: "boolean"
|
|
710
|
+
// },
|
|
702
711
|
};
|
|
703
712
|
}
|
|
704
713
|
getEditorProperties(t) {
|
|
705
|
-
var
|
|
714
|
+
var m, g;
|
|
706
715
|
const i = this;
|
|
707
716
|
let a = "";
|
|
708
|
-
if (((
|
|
709
|
-
const
|
|
710
|
-
(
|
|
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);
|
|
711
720
|
}
|
|
712
721
|
return i.getComponentConfig(t, { type: "combo-list" }, {
|
|
713
722
|
// enableSearch: {
|
|
@@ -801,31 +810,31 @@ class ge extends D {
|
|
|
801
810
|
}
|
|
802
811
|
},
|
|
803
812
|
...this.getCommonEditorProperties(t)
|
|
804
|
-
}, (
|
|
805
|
-
if (!
|
|
813
|
+
}, (c, d) => {
|
|
814
|
+
if (!c || !d.editor)
|
|
806
815
|
return;
|
|
807
816
|
const C = this;
|
|
808
|
-
switch (
|
|
817
|
+
switch (c.propertyID) {
|
|
809
818
|
case "dataSourceType": {
|
|
810
|
-
|
|
819
|
+
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");
|
|
811
820
|
break;
|
|
812
821
|
}
|
|
813
822
|
case "data": {
|
|
814
|
-
!C.checkEnumDataReadonly(
|
|
823
|
+
!C.checkEnumDataReadonly(d) && d.formatter && (d.formatter.data = [...c.propertyValue]);
|
|
815
824
|
break;
|
|
816
825
|
}
|
|
817
826
|
case "viewType":
|
|
818
|
-
|
|
827
|
+
c.propertyValue === "tag" && (d.editor.editable = !1);
|
|
819
828
|
}
|
|
820
829
|
});
|
|
821
830
|
}
|
|
822
831
|
getGridFieldEdtiorProperties(t, i) {
|
|
823
|
-
var
|
|
832
|
+
var g, c, d, C;
|
|
824
833
|
const a = this;
|
|
825
834
|
let n = "";
|
|
826
|
-
if (((
|
|
827
|
-
const
|
|
828
|
-
(
|
|
835
|
+
if (((g = t == null ? void 0 : t.binding) == null ? void 0 : g.type) === "Form") {
|
|
836
|
+
const h = this.schemaService.getFieldByIDAndVMID(t.binding.field, this.viewModelId);
|
|
837
|
+
(c = h == null ? void 0 : h.schemaField) != null && c.type && (n = h.schemaField.type.$type);
|
|
829
838
|
}
|
|
830
839
|
return a.getComponentConfig(t, { type: "combo-list" }, {
|
|
831
840
|
// editable: {
|
|
@@ -844,7 +853,7 @@ class ge extends D {
|
|
|
844
853
|
title: "数据",
|
|
845
854
|
type: "array",
|
|
846
855
|
visible: !0,
|
|
847
|
-
...a.getItemCollectionEditor(t, (
|
|
856
|
+
...a.getItemCollectionEditor(t, (d = t.editor) == null ? void 0 : d.valueField, (C = t.editor) == null ? void 0 : C.textField),
|
|
848
857
|
// 这个属性,标记当属性变更得时候触发重新更新属性
|
|
849
858
|
refreshPanelAfterChanged: !0
|
|
850
859
|
},
|
|
@@ -878,17 +887,17 @@ class ge extends D {
|
|
|
878
887
|
}
|
|
879
888
|
},
|
|
880
889
|
...this.getCommonEditorProperties(t)
|
|
881
|
-
}, (
|
|
882
|
-
if (!
|
|
890
|
+
}, (h, p) => {
|
|
891
|
+
if (!h || !p.editor)
|
|
883
892
|
return;
|
|
884
893
|
const l = this;
|
|
885
|
-
switch (
|
|
894
|
+
switch (h.propertyID) {
|
|
886
895
|
case "dataSourceType": {
|
|
887
|
-
|
|
896
|
+
h.propertyValue === "static" ? (p.editor.valueField = "value", p.editor.textField = "name", p.editor.remote = null) : h.propertyValue === "dynamic" && (p.editor.remote = { method: "GET" });
|
|
888
897
|
break;
|
|
889
898
|
}
|
|
890
899
|
case "data": {
|
|
891
|
-
!l.checkEnumDataReadonly(p) && p.formatter && (p.formatter.data = [...
|
|
900
|
+
!l.checkEnumDataReadonly(p) && p.formatter && (p.formatter.data = [...h.propertyValue]);
|
|
892
901
|
break;
|
|
893
902
|
}
|
|
894
903
|
}
|
|
@@ -913,30 +922,30 @@ class ge extends D {
|
|
|
913
922
|
* 切换绑定属性
|
|
914
923
|
*/
|
|
915
924
|
changeBindingField(t, i, a) {
|
|
916
|
-
var
|
|
925
|
+
var m;
|
|
917
926
|
super.changeBindingField(t, i);
|
|
918
927
|
const n = a;
|
|
919
|
-
t.editor && ((
|
|
928
|
+
t.editor && ((m = n == null ? void 0 : n.type) == null ? void 0 : m.$type) === D.EnumType && (t.editor.data = n.type.enumValues || []);
|
|
920
929
|
}
|
|
921
930
|
}
|
|
922
|
-
function
|
|
931
|
+
function pe(e, t) {
|
|
923
932
|
const i = e.schema;
|
|
924
|
-
function a(n,
|
|
925
|
-
return new
|
|
933
|
+
function a(n, m) {
|
|
934
|
+
return new be(n, t).getPropertyConfig(i, m);
|
|
926
935
|
}
|
|
927
936
|
return {
|
|
928
937
|
getPropsConfig: a
|
|
929
938
|
};
|
|
930
939
|
}
|
|
931
|
-
const
|
|
940
|
+
const Se = /* @__PURE__ */ E({
|
|
932
941
|
name: "FComboListDesign",
|
|
933
|
-
props:
|
|
942
|
+
props: he,
|
|
934
943
|
emits: ["clear", "update:modelValue", "change"],
|
|
935
944
|
setup(e, t) {
|
|
936
|
-
const i =
|
|
945
|
+
const i = y(), a = k("designer-host-service"), n = k("design-item-context"), m = pe(n, a), g = _(i, n, m);
|
|
937
946
|
return O(() => {
|
|
938
|
-
i.value.componentInstance =
|
|
939
|
-
}), t.expose(
|
|
947
|
+
i.value.componentInstance = g;
|
|
948
|
+
}), t.expose(g.value), () => I(Z, {
|
|
940
949
|
ref: i,
|
|
941
950
|
buttonContent: e.dropDownIcon,
|
|
942
951
|
readonly: !0,
|
|
@@ -951,14 +960,14 @@ L.register = (e, t, i, a) => {
|
|
|
951
960
|
e["combo-list"] = L, t["combo-list"] = $;
|
|
952
961
|
};
|
|
953
962
|
L.registerDesigner = (e, t, i) => {
|
|
954
|
-
e["combo-list"] =
|
|
963
|
+
e["combo-list"] = Se, t["combo-list"] = $;
|
|
955
964
|
};
|
|
956
|
-
const
|
|
965
|
+
const Re = ee(L);
|
|
957
966
|
export {
|
|
958
967
|
L as FComboList,
|
|
959
|
-
|
|
960
|
-
|
|
968
|
+
me as Placement,
|
|
969
|
+
he as comboListDesignProps,
|
|
961
970
|
H as comboListProps,
|
|
962
|
-
|
|
971
|
+
Re as default,
|
|
963
972
|
$ as propsResolver
|
|
964
973
|
};
|