@farris/ui-vue 1.7.0-beta.3 → 1.7.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/avatar/index.esm.js +10 -1
- package/components/avatar/index.umd.cjs +1 -1
- package/components/calendar/index.esm.js +178 -176
- package/components/calendar/index.umd.cjs +2 -2
- package/components/collection-property-editor/index.esm.js +48 -46
- package/components/collection-property-editor/index.umd.cjs +2 -2
- package/components/combo-list/index.esm.js +319 -300
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/comment/index.esm.js +2287 -1161
- package/components/comment/index.umd.cjs +7 -7
- package/components/component/index.esm.js +3 -1
- package/components/component/index.umd.cjs +2 -2
- package/components/condition/index.esm.js +926 -901
- package/components/condition/index.umd.cjs +2 -2
- package/components/data-view/index.esm.js +898 -899
- package/components/data-view/index.umd.cjs +1 -1
- package/components/drawer/index.esm.js +3 -1
- package/components/drawer/index.umd.cjs +2 -2
- package/components/dynamic-form/index.esm.js +239 -221
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-resolver/index.esm.js +11 -9
- package/components/dynamic-resolver/index.umd.cjs +2 -2
- package/components/expression-editor/index.esm.js +1299 -1279
- package/components/expression-editor/index.umd.cjs +4 -4
- package/components/filter-bar/index.esm.js +731 -678
- package/components/filter-bar/index.umd.cjs +2 -2
- package/components/filter-condition-editor/index.esm.js +1792 -1772
- package/components/filter-condition-editor/index.umd.cjs +4 -4
- package/components/image/index.esm.js +246 -240
- package/components/image/index.umd.cjs +2 -2
- package/components/language-textbox/index.esm.js +9 -7
- package/components/language-textbox/index.umd.cjs +2 -2
- package/components/list-view/index.esm.js +1 -1
- package/components/list-view/index.umd.cjs +1 -1
- package/components/locale/index.esm.js +2009 -886
- package/components/locale/index.umd.cjs +6 -6
- package/components/number-range/index.esm.js +190 -181
- package/components/number-range/index.umd.cjs +1 -1
- package/components/order/index.esm.js +734 -714
- package/components/order/index.umd.cjs +5 -5
- package/components/property-panel/index.esm.js +60 -49
- package/components/property-panel/index.umd.cjs +3 -3
- package/components/query-solution/index.esm.js +2461 -2500
- package/components/query-solution/index.umd.cjs +6 -6
- package/components/radio-group/index.esm.js +30 -30
- package/components/radio-group/index.umd.cjs +1 -1
- package/components/schema-selector/index.esm.js +238 -238
- package/components/schema-selector/index.umd.cjs +4 -4
- package/components/section/index.esm.js +217 -302
- package/components/section/index.umd.cjs +2 -2
- package/components/sort-condition-editor/index.esm.js +1793 -1773
- package/components/sort-condition-editor/index.umd.cjs +4 -4
- package/components/transfer/index.esm.js +155 -155
- package/components/transfer/index.umd.cjs +3 -3
- package/designer/data-grid/index.esm.js +895 -867
- package/designer/data-grid/index.umd.cjs +5 -5
- package/designer/data-view/index.esm.js +145 -144
- package/designer/data-view/index.umd.cjs +2 -2
- package/designer/drawer/index.esm.js +73 -71
- package/designer/drawer/index.umd.cjs +2 -2
- package/designer/dynamic-form/index.esm.js +87 -65
- package/designer/dynamic-form/index.umd.cjs +2 -2
- package/designer/farris-designer.all.esm.js +14 -3
- package/designer/farris-designer.all.umd.cjs +3 -3
- package/designer/input-group/index.esm.js +34 -14
- package/designer/input-group/index.umd.cjs +1 -1
- package/designer/list-view/index.esm.js +1 -1
- package/designer/list-view/index.umd.cjs +1 -1
- package/designer/radio-group/index.esm.js +15 -2
- package/designer/radio-group/index.umd.cjs +1 -1
- package/designer/section/index.esm.js +129 -119
- package/designer/section/index.umd.cjs +1 -1
- package/designer/time-picker/index.esm.js +140 -131
- package/designer/time-picker/index.umd.cjs +1 -1
- package/farris.all.esm.js +13578 -12394
- package/farris.all.umd.cjs +26 -26
- package/index.css +1 -1
- package/locales/data-grid/ui/en.json +2 -1
- 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 +12 -10
- package/locales/designer/zh-CHS.json +19 -17
- package/locales/designer/zh-CHT.json +19 -17
- package/locales/ui/en.json +4 -2
- package/locales/ui/zh-CHS.json +11 -9
- package/locales/ui/zh-CHT.json +11 -9
- package/package.json +1 -1
- package/package.zip +0 -0
- package/types/combo-list/src/composition/types.d.ts +1 -0
- package/types/condition/src/composition/condition-value/number-spinner-value.d.ts +1 -1
- package/types/condition/src/composition/use-field-config.d.ts +1 -1
- package/types/condition/src/condition.props.d.ts +1 -1
- package/types/data-view/designer/property-config/use-command-option.d.ts +12 -0
- package/types/image/src/property-config/image.property-config.d.ts +5 -5
- package/types/locale/src/lib/locale.service.d.ts +2 -2
- package/types/property-panel/src/composition/entity/input-base-property.d.ts +7 -0
- package/types/query-solution/src/designer/query-solution-config/composition/use-util.d.ts +0 -20
- package/types/section/src/designer/section.design.props.d.ts +17 -0
- package/types/section/src/section.props.d.ts +0 -25
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
var ie = Object.defineProperty;
|
|
2
|
-
var ne = (
|
|
3
|
-
var y = (
|
|
4
|
-
import { computed as M, ref as
|
|
5
|
-
import { resolveAppearance as
|
|
2
|
+
var ne = (s, n, e) => n in s ? ie(s, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[n] = e;
|
|
3
|
+
var y = (s, n, e) => ne(s, typeof n != "symbol" ? n + "" : n, e);
|
|
4
|
+
import { computed as M, ref as N, createVNode as E, defineComponent as _, onMounted as H, watch as G, createTextVNode as J, nextTick as re, inject as D } from "vue";
|
|
5
|
+
import { resolveAppearance as se, createPropsResolver as oe } from "../dynamic-resolver/index.esm.js";
|
|
6
6
|
import I from "bignumber.js";
|
|
7
7
|
import { useNumberLocales as le } from "../number-spinner/index.esm.js";
|
|
8
8
|
import { DgControl as p, canvasChanged as R, refreshCanvas as ae, useDesignerComponent as de } from "../designer-canvas/index.esm.js";
|
|
9
9
|
import { cloneDeep as ue } from "lodash-es";
|
|
10
10
|
import { FormSchemaEntityField$Type as K, FormSchemaEntityFieldType$Type as ce, withInstall as pe } from "../common/index.esm.js";
|
|
11
|
-
function ge(
|
|
11
|
+
function ge(s, n, e) {
|
|
12
12
|
return n;
|
|
13
13
|
}
|
|
14
14
|
const me = /* @__PURE__ */ new Map([
|
|
15
|
-
["appearance",
|
|
15
|
+
["appearance", se]
|
|
16
16
|
]), fe = "https://json-schema.org/draft/2020-12/schema", he = "https://farris-design.gitee.io/number-range.schema.json", ye = "number-range", be = "A Farris Component", ve = "object", Ce = {
|
|
17
17
|
id: {
|
|
18
18
|
description: "The unique identifier for a number-range",
|
|
@@ -242,16 +242,16 @@ const me = /* @__PURE__ */ new Map([
|
|
|
242
242
|
*/
|
|
243
243
|
useThousands: { type: Boolean, default: !0 }
|
|
244
244
|
}, Q = oe(W, xe, me, ge);
|
|
245
|
-
function Y(
|
|
246
|
-
const e = M(() => Number(
|
|
245
|
+
function Y(s, n) {
|
|
246
|
+
const e = M(() => Number(s.precision) || 0);
|
|
247
247
|
function t(l) {
|
|
248
248
|
return l.toFixed(e.value);
|
|
249
249
|
}
|
|
250
250
|
function i(l) {
|
|
251
251
|
return isNaN(l) || l === null || l === void 0 || l === "";
|
|
252
252
|
}
|
|
253
|
-
function
|
|
254
|
-
const d = i(
|
|
253
|
+
function r(l) {
|
|
254
|
+
const d = i(s.max) ? null : new I(String(s.max), 10), u = i(s.min) ? null : new I(String(s.min), 10);
|
|
255
255
|
return d && l.gt(d) ? d : u && l.lt(u) ? u : l;
|
|
256
256
|
}
|
|
257
257
|
function o(l, d, u, a) {
|
|
@@ -260,13 +260,13 @@ function Y(r, n) {
|
|
|
260
260
|
return a ? h = f && g.gt(f) ? f : g : h = m && g.lt(m) ? m : g, h.toString();
|
|
261
261
|
}
|
|
262
262
|
function c(l, d = !0) {
|
|
263
|
-
if (
|
|
264
|
-
return isNaN(Number(l)) ?
|
|
263
|
+
if (s.parser)
|
|
264
|
+
return isNaN(Number(l)) ? s.parser(l) : l;
|
|
265
265
|
let u = new I(l, 10);
|
|
266
|
-
if (d && (u =
|
|
267
|
-
if (
|
|
266
|
+
if (d && (u = r(u)), u.isNaN()) {
|
|
267
|
+
if (s.nullable)
|
|
268
268
|
return null;
|
|
269
|
-
const g = new I("" +
|
|
269
|
+
const g = new I("" + s.min, 10), f = new I("" + s.max, 10);
|
|
270
270
|
if (!g.isNaN())
|
|
271
271
|
u = g;
|
|
272
272
|
else if (!f.isNaN())
|
|
@@ -276,45 +276,45 @@ function Y(r, n) {
|
|
|
276
276
|
}
|
|
277
277
|
return t(u);
|
|
278
278
|
}
|
|
279
|
-
return { getRealValue: c, isEmpty: i, precision: e, getValidNumberObject:
|
|
279
|
+
return { getRealValue: c, isEmpty: i, precision: e, getValidNumberObject: r, getValidNumberInRange: o };
|
|
280
280
|
}
|
|
281
|
-
function ee(
|
|
281
|
+
function ee(s, n, e) {
|
|
282
282
|
const t = M(() => ({
|
|
283
|
-
prefix:
|
|
284
|
-
suffix:
|
|
285
|
-
decimalSeparator:
|
|
286
|
-
groupSeparator:
|
|
287
|
-
groupSize:
|
|
288
|
-
})), { getValidNumberObject: i, precision:
|
|
283
|
+
prefix: s.prefix,
|
|
284
|
+
suffix: s.suffix,
|
|
285
|
+
decimalSeparator: s.decimalSeparator,
|
|
286
|
+
groupSeparator: s.useThousands ? s.groupSeparator : "",
|
|
287
|
+
groupSize: s.groupSize
|
|
288
|
+
})), { getValidNumberObject: i, precision: r } = e;
|
|
289
289
|
function o(d) {
|
|
290
|
-
return d = d == null || d === "" ? "" : String(d), d = d.replace(new RegExp(
|
|
290
|
+
return d = d == null || d === "" ? "" : String(d), d = d.replace(new RegExp(s.prefix, "g"), "").replace(new RegExp(s.suffix, "g"), "").replace(/,/g, ""), s.groupSeparator && s.groupSeparator !== "," && (d = d.replace(new RegExp(`\\${s.groupSeparator}`, "g"), "")), s.decimalSeparator && s.decimalSeparator !== "." && (d = d.replace(new RegExp(`\\${s.decimalSeparator}`, "g"), ".")), d;
|
|
291
291
|
}
|
|
292
292
|
function c(d, u) {
|
|
293
|
-
return
|
|
293
|
+
return s.precision !== null && s.precision !== void 0 ? d.toFormat(r.value, u) : d.toFormat(u);
|
|
294
294
|
}
|
|
295
295
|
function l(d, u = !0) {
|
|
296
296
|
const a = o(d), g = new I(a, 10);
|
|
297
297
|
let f = g;
|
|
298
|
-
return u && (f = i(g)), f.valueOf() === "0" && !
|
|
298
|
+
return u && (f = i(g)), f.valueOf() === "0" && !s.showZero || f.isNaN() ? "" : s.formatter ? s.formatter(f.toNumber()) : c(f, t.value);
|
|
299
299
|
}
|
|
300
300
|
return { cleanFormat: o, format: l };
|
|
301
301
|
}
|
|
302
|
-
function A(
|
|
303
|
-
const { format: u } = i, { getRealValue: a, getValidNumberInRange: g } =
|
|
302
|
+
function A(s, n, e, t, i, r, o, c, l, d) {
|
|
303
|
+
const { format: u } = i, { getRealValue: a, getValidNumberInRange: g } = r;
|
|
304
304
|
function f() {
|
|
305
305
|
const v = new I(t.value || 0);
|
|
306
|
-
return !((
|
|
306
|
+
return !((s.max || s.max === 0) && !new I(s.max).isNaN() && v.gte(new I(s.max)) && (t.value || t.value === 0));
|
|
307
307
|
}
|
|
308
308
|
function m() {
|
|
309
309
|
const v = new I(t.value || 0);
|
|
310
|
-
return !((
|
|
310
|
+
return !((s.min || s.min === 0) && !new I(s.min).isNaN() && v.lte(new I(s.min)) && (t.value || t.value === 0));
|
|
311
311
|
}
|
|
312
312
|
function h(v) {
|
|
313
|
-
if (
|
|
313
|
+
if (s.readonly || s.disabled)
|
|
314
314
|
return;
|
|
315
315
|
const k = v === "up" ? f : m, F = v === "up" ? "plus" : "minus";
|
|
316
316
|
if (k()) {
|
|
317
|
-
let P = new I(t.value || 0)[F](Number(
|
|
317
|
+
let P = new I(t.value || 0)[F](Number(s.step)).toFixed();
|
|
318
318
|
P = g(P, c, l, d);
|
|
319
319
|
const T = a(P);
|
|
320
320
|
e.value = u(P), t.value !== T && (t.value = T, o(t.value));
|
|
@@ -334,28 +334,28 @@ function A(r, n, e, t, i, s, o, c, l, d) {
|
|
|
334
334
|
}
|
|
335
335
|
return { canDownward: m, canUpward: f, downward: C, onClickDownButton: V, onClickUpButton: w, upward: b };
|
|
336
336
|
}
|
|
337
|
-
function O(
|
|
338
|
-
const { cleanFormat: a, format: g } = i, { getRealValue: f, isEmpty: m, getValidNumberInRange: h } =
|
|
337
|
+
function O(s, n, e, t, i, r, o, c, l, d, u) {
|
|
338
|
+
const { cleanFormat: a, format: g } = i, { getRealValue: f, isEmpty: m, getValidNumberInRange: h } = r, { downward: b, upward: C } = o, w = M(() => e.value), V = N(!1);
|
|
339
339
|
function v(x) {
|
|
340
340
|
var z;
|
|
341
|
-
if (x.stopPropagation(),
|
|
341
|
+
if (x.stopPropagation(), s.readonly || s.disabled)
|
|
342
342
|
return;
|
|
343
343
|
V.value = !1;
|
|
344
344
|
let P = (z = x.target) == null ? void 0 : z.value;
|
|
345
|
-
|
|
345
|
+
s.nullable || (P = P || 0);
|
|
346
346
|
let T = a(P);
|
|
347
347
|
T = h(T, l, d, u);
|
|
348
348
|
const U = f(T);
|
|
349
349
|
e.value = g(T), t.value !== U && (t.value = U, c(t.value)), n.emit("blur", { event: x, formatted: e.value, value: t.value });
|
|
350
350
|
}
|
|
351
351
|
function k(x) {
|
|
352
|
-
x.stopPropagation(), !(
|
|
352
|
+
x.stopPropagation(), !(s.readonly || s.disabled) && (V.value = !0, e.value = m(t.value) || !s.showZero && t.value === "0" ? "" : String(t.value), n.emit("focus", { event: x, formatted: e.value, value: t.value }));
|
|
353
353
|
}
|
|
354
354
|
function F(x) {
|
|
355
355
|
var U;
|
|
356
356
|
x.stopPropagation();
|
|
357
357
|
let P = (U = x.target) == null ? void 0 : U.value;
|
|
358
|
-
|
|
358
|
+
s.nullable || (P = P || 0);
|
|
359
359
|
const T = a(P);
|
|
360
360
|
e.value = T, t.value = f(T), c(t.value);
|
|
361
361
|
}
|
|
@@ -364,18 +364,18 @@ function O(r, n, e, t, i, s, o, c, l, d, u) {
|
|
|
364
364
|
}
|
|
365
365
|
return { textBoxValue: w, onBlurTextBox: v, onFocusTextBox: k, onInput: F, onKeyDown: S, isTextBoxFocused: V };
|
|
366
366
|
}
|
|
367
|
-
function Z(
|
|
367
|
+
function Z(s, n, e, t, i) {
|
|
368
368
|
const {
|
|
369
|
-
onBlurTextBox:
|
|
369
|
+
onBlurTextBox: r,
|
|
370
370
|
onFocusTextBox: o,
|
|
371
371
|
onInput: c,
|
|
372
372
|
onKeyDown: l,
|
|
373
373
|
textBoxValue: d
|
|
374
|
-
} = e, u = M(() =>
|
|
374
|
+
} = e, u = M(() => s.disabled || s.readonly || !s.editable ? "" : t ? i.range.begin : i.range.end), a = M(() => ({
|
|
375
375
|
"form-control": !0,
|
|
376
376
|
"sub-input": !0
|
|
377
377
|
})), g = M(() => ({
|
|
378
|
-
"text-align":
|
|
378
|
+
"text-align": s.textAlign
|
|
379
379
|
}));
|
|
380
380
|
function f(m) {
|
|
381
381
|
m.stopPropagation();
|
|
@@ -385,21 +385,21 @@ function Z(r, n, e, t, i) {
|
|
|
385
385
|
style: g.value,
|
|
386
386
|
type: "text",
|
|
387
387
|
value: d.value,
|
|
388
|
-
disabled:
|
|
389
|
-
readonly:
|
|
388
|
+
disabled: s.disabled,
|
|
389
|
+
readonly: s.readonly || !s.editable,
|
|
390
390
|
placeholder: u.value,
|
|
391
|
-
onBlur:
|
|
391
|
+
onBlur: r,
|
|
392
392
|
onChange: f,
|
|
393
393
|
onFocus: o,
|
|
394
394
|
onInput: c,
|
|
395
395
|
onKeydown: l
|
|
396
396
|
}, null);
|
|
397
397
|
}
|
|
398
|
-
function q(
|
|
398
|
+
function q(s, n, e) {
|
|
399
399
|
const {
|
|
400
400
|
canDownward: t,
|
|
401
401
|
canUpward: i,
|
|
402
|
-
onClickDownButton:
|
|
402
|
+
onClickDownButton: r,
|
|
403
403
|
onClickUpButton: o
|
|
404
404
|
} = e, c = M(() => ({
|
|
405
405
|
"input-group-append": !0,
|
|
@@ -429,7 +429,7 @@ function q(r, n, e) {
|
|
|
429
429
|
}, null)]), E("button", {
|
|
430
430
|
class: l.value,
|
|
431
431
|
style: u.value,
|
|
432
|
-
onClick:
|
|
432
|
+
onClick: r,
|
|
433
433
|
disabled: !t()
|
|
434
434
|
}, [E("span", {
|
|
435
435
|
class: "f-icon f-icon-arrow-chevron-down number-arrow-chevron"
|
|
@@ -439,31 +439,31 @@ const $ = /* @__PURE__ */ _({
|
|
|
439
439
|
name: "FNumberRange",
|
|
440
440
|
props: W,
|
|
441
441
|
emits: ["valueChange", "blur", "focus", "click", "input", "beginValueChange", "endValueChange"],
|
|
442
|
-
setup(
|
|
443
|
-
const e =
|
|
442
|
+
setup(s, n) {
|
|
443
|
+
const e = N(s.beginValue), t = N(""), i = N(s.endValue), r = N(""), o = Y(s), c = ee(s, n, o), l = le(s), d = (F) => {
|
|
444
444
|
n.emit("beginValueChange", F);
|
|
445
|
-
}, u = A(
|
|
445
|
+
}, u = A(s, n, t, e, c, o, d, e, i, !0), a = O(s, n, t, e, c, o, u, d, e, i, !0), g = q(s, n, u), f = Z(s, n, a, !0, l), m = (F) => {
|
|
446
446
|
n.emit("endValueChange", F);
|
|
447
|
-
}, h = A(
|
|
447
|
+
}, h = A(s, n, r, i, c, o, m, e, i, !1), b = O(s, n, r, i, c, o, h, m, e, i, !1), C = q(s, n, h), w = Z(s, n, b, !1, l), {
|
|
448
448
|
getRealValue: V
|
|
449
449
|
} = o, {
|
|
450
450
|
format: v
|
|
451
|
-
} = c, k = M(() => !
|
|
451
|
+
} = c, k = M(() => !s.disabled && !s.readonly && s.showButton);
|
|
452
452
|
return H(() => {
|
|
453
|
-
const F = V(
|
|
454
|
-
t.value = v(F, !1),
|
|
455
|
-
}), G(() => [
|
|
453
|
+
const F = V(s.beginValue, !1), S = V(s.endValue, !1);
|
|
454
|
+
t.value = v(F, !1), r.value = v(S, !1);
|
|
455
|
+
}), G(() => [s.beginValue], ([F]) => {
|
|
456
456
|
if (!a.isTextBoxFocused.value) {
|
|
457
457
|
const S = V(F, !1);
|
|
458
458
|
e.value = S, t.value = v(S, !1);
|
|
459
459
|
}
|
|
460
|
-
}), G(() => [
|
|
460
|
+
}), G(() => [s.endValue], ([F]) => {
|
|
461
461
|
if (!b.isTextBoxFocused.value) {
|
|
462
462
|
const S = V(F, !1);
|
|
463
|
-
i.value = S,
|
|
463
|
+
i.value = S, r.value = v(S, !1);
|
|
464
464
|
}
|
|
465
|
-
}), G(() => [
|
|
466
|
-
t.value = v(e.value),
|
|
465
|
+
}), G(() => [s.precision, s.useThousands, s.prefix, s.suffix, s.showZero], () => {
|
|
466
|
+
t.value = v(e.value), r.value = v(i.value);
|
|
467
467
|
}), () => E("div", {
|
|
468
468
|
class: "input-group number-range f-cmp-number-spinner"
|
|
469
469
|
}, [E("div", {
|
|
@@ -477,18 +477,18 @@ const $ = /* @__PURE__ */ _({
|
|
|
477
477
|
}, [w(), k.value && C()])])]);
|
|
478
478
|
}
|
|
479
479
|
});
|
|
480
|
-
function X(
|
|
480
|
+
function X(s, n, e, t) {
|
|
481
481
|
const {
|
|
482
482
|
onBlurTextBox: i,
|
|
483
|
-
onFocusTextBox:
|
|
483
|
+
onFocusTextBox: r,
|
|
484
484
|
onInput: o,
|
|
485
485
|
onKeyDown: c,
|
|
486
486
|
textBoxValue: l
|
|
487
|
-
} = e, d = M(() => t ?
|
|
487
|
+
} = e, d = M(() => t ? s.beginPlaceholder : s.endPlaceholder), u = M(() => ({
|
|
488
488
|
"form-control": !0,
|
|
489
489
|
"sub-input": !0
|
|
490
490
|
})), a = M(() => ({
|
|
491
|
-
"text-align":
|
|
491
|
+
"text-align": s.textAlign
|
|
492
492
|
}));
|
|
493
493
|
function g(f) {
|
|
494
494
|
f.stopPropagation();
|
|
@@ -498,18 +498,18 @@ function X(r, n, e, t) {
|
|
|
498
498
|
style: a.value,
|
|
499
499
|
type: "text",
|
|
500
500
|
value: l.value,
|
|
501
|
-
disabled:
|
|
502
|
-
readonly:
|
|
501
|
+
disabled: s.disabled,
|
|
502
|
+
readonly: s.readonly || !s.editable,
|
|
503
503
|
placeholder: d.value,
|
|
504
504
|
onBlur: i,
|
|
505
505
|
onChange: g,
|
|
506
|
-
onFocus:
|
|
506
|
+
onFocus: r,
|
|
507
507
|
onInput: o,
|
|
508
508
|
onKeydown: c
|
|
509
509
|
}, null);
|
|
510
510
|
}
|
|
511
|
-
function Ve(
|
|
512
|
-
const { formSchemaUtils: n, formStateMachineUtils: e } =
|
|
511
|
+
function Ve(s) {
|
|
512
|
+
const { formSchemaUtils: n, formStateMachineUtils: e } = s;
|
|
513
513
|
function t(l, d = "") {
|
|
514
514
|
return {
|
|
515
515
|
path: d + l.code,
|
|
@@ -520,7 +520,7 @@ function Ve(r) {
|
|
|
520
520
|
function i(l, d = "") {
|
|
521
521
|
return n.getViewModelById(l).states.map((a) => t(a, d));
|
|
522
522
|
}
|
|
523
|
-
function
|
|
523
|
+
function r(l) {
|
|
524
524
|
const d = n.getRootViewModelId(), u = i(l);
|
|
525
525
|
if (l === d)
|
|
526
526
|
return u;
|
|
@@ -533,7 +533,7 @@ function Ve(r) {
|
|
|
533
533
|
function c() {
|
|
534
534
|
return e && e.getRenderStates() || [];
|
|
535
535
|
}
|
|
536
|
-
return { getVariables:
|
|
536
|
+
return { getVariables: r, getControlName: o, getStateMachines: c };
|
|
537
537
|
}
|
|
538
538
|
class te {
|
|
539
539
|
constructor(n) {
|
|
@@ -584,19 +584,19 @@ class te {
|
|
|
584
584
|
required: "必填表达式"
|
|
585
585
|
});
|
|
586
586
|
y(this, "getExpressionConverter", (n, e) => ({
|
|
587
|
-
convertFrom: (t, i,
|
|
588
|
-
const c =
|
|
587
|
+
convertFrom: (t, i, r, o) => {
|
|
588
|
+
const c = r.getExpressionRuleValue(n, e || i);
|
|
589
589
|
return c && c.value || "";
|
|
590
590
|
},
|
|
591
|
-
convertTo: (t, i,
|
|
591
|
+
convertTo: (t, i, r, o, c) => {
|
|
592
592
|
var l;
|
|
593
|
-
if (i === "dataPicking" && (
|
|
594
|
-
const d = `${
|
|
595
|
-
((l =
|
|
593
|
+
if (i === "dataPicking" && (r != null && r.target)) {
|
|
594
|
+
const d = `${r.target}_dataPicking`;
|
|
595
|
+
((l = r.rules) == null ? void 0 : l.some(
|
|
596
596
|
(a) => a.id === d && a.value
|
|
597
597
|
)) ? t.dictPickingExpressionId = d : delete t.dictPickingExpressionId;
|
|
598
598
|
}
|
|
599
|
-
o.updateExpression(
|
|
599
|
+
o.updateExpression(r);
|
|
600
600
|
}
|
|
601
601
|
}));
|
|
602
602
|
this.formSchemaService = n;
|
|
@@ -608,8 +608,8 @@ class te {
|
|
|
608
608
|
const i = t.find((o) => o.target === n);
|
|
609
609
|
if (!i)
|
|
610
610
|
return "";
|
|
611
|
-
const
|
|
612
|
-
return
|
|
611
|
+
const r = i.rules.find((o) => o.type === e);
|
|
612
|
+
return r || "";
|
|
613
613
|
}
|
|
614
614
|
// 获取上下文表单变量
|
|
615
615
|
getContextFormVariables() {
|
|
@@ -620,12 +620,12 @@ class te {
|
|
|
620
620
|
if (!t || !t.states || t.states.length === 0)
|
|
621
621
|
return [];
|
|
622
622
|
const i = [];
|
|
623
|
-
return t.states.filter((
|
|
623
|
+
return t.states.filter((r) => r.category === "remote").forEach((r) => {
|
|
624
624
|
i.push({
|
|
625
|
-
key:
|
|
626
|
-
name:
|
|
627
|
-
description:
|
|
628
|
-
category:
|
|
625
|
+
key: r.code,
|
|
626
|
+
name: r.name,
|
|
627
|
+
description: r.name,
|
|
628
|
+
category: r.category
|
|
629
629
|
});
|
|
630
630
|
}), i;
|
|
631
631
|
}
|
|
@@ -642,10 +642,10 @@ class te {
|
|
|
642
642
|
const t = [];
|
|
643
643
|
return n == null || n.forEach((i) => {
|
|
644
644
|
var c;
|
|
645
|
-
const
|
|
645
|
+
const r = this.createTreeNode(i, e);
|
|
646
646
|
let o = [];
|
|
647
647
|
(c = i.type) != null && c.fields && (o = this.buildEntityFieldsTreeData(i.type.fields, [...e, i.label])), t.push({
|
|
648
|
-
data:
|
|
648
|
+
data: r,
|
|
649
649
|
children: o,
|
|
650
650
|
expanded: !0
|
|
651
651
|
});
|
|
@@ -655,11 +655,11 @@ class te {
|
|
|
655
655
|
const t = [];
|
|
656
656
|
return n == null || n.forEach((i) => {
|
|
657
657
|
var l, d;
|
|
658
|
-
const
|
|
659
|
-
|
|
658
|
+
const r = this.createTreeNode(i, e);
|
|
659
|
+
r.type = "entity";
|
|
660
660
|
const o = this.buildEntityFieldsTreeData((l = i.type) == null ? void 0 : l.fields, [...e, i.label]), c = this.buildChildEntityTreeData((d = i.type) == null ? void 0 : d.entities, [...e, i.label]);
|
|
661
661
|
c != null && c.length && (o == null || o.push(...c)), t.push({
|
|
662
|
-
data:
|
|
662
|
+
data: r,
|
|
663
663
|
children: o || [],
|
|
664
664
|
// 空值回退
|
|
665
665
|
expanded: !0
|
|
@@ -700,17 +700,17 @@ class te {
|
|
|
700
700
|
};
|
|
701
701
|
}
|
|
702
702
|
onBeforeOpenExpression(n, e, t) {
|
|
703
|
-
const i = t === "Field" ? n.binding.field : n.id,
|
|
704
|
-
message: ["validate", "required", "dataPicking"].includes(e) &&
|
|
703
|
+
const i = t === "Field" ? n.binding.field : n.id, r = this.getExpressionRule(i, e), o = this.getEntitiesAndVariables(), c = {
|
|
704
|
+
message: ["validate", "required", "dataPicking"].includes(e) && r ? r.message : "",
|
|
705
705
|
...o
|
|
706
706
|
};
|
|
707
|
-
return
|
|
707
|
+
return r.messageType != null && (c.messageType = r.messageType), c;
|
|
708
708
|
}
|
|
709
709
|
buildRule(n, e, t, i) {
|
|
710
|
-
const { expression:
|
|
710
|
+
const { expression: r, message: o, messageType: c } = e, l = {
|
|
711
711
|
id: `${n}_${t}`,
|
|
712
712
|
type: t,
|
|
713
|
-
value:
|
|
713
|
+
value: r
|
|
714
714
|
};
|
|
715
715
|
return (t === "validate" || t === "dataPicking" || t === "required") && (l.message = o), t === "dataPicking" && (l.messageType = c), t === "validate" && i && (l.elementId = i), l;
|
|
716
716
|
}
|
|
@@ -719,8 +719,8 @@ class te {
|
|
|
719
719
|
return n || [];
|
|
720
720
|
}
|
|
721
721
|
updateExpression(n, e, t, i) {
|
|
722
|
-
const
|
|
723
|
-
let l = this.getExpressionData().find((u) => u.targetType === e && u.target ===
|
|
722
|
+
const r = e === "Field" ? n.binding.field : n.id, o = this.buildRule(r, t, i, n.type === "form-group" ? n.id : "");
|
|
723
|
+
let l = this.getExpressionData().find((u) => u.targetType === e && u.target === r);
|
|
724
724
|
const d = (u) => u.value.trim() === "";
|
|
725
725
|
if (l) {
|
|
726
726
|
const u = l.rules.find((a) => a.id === o.id);
|
|
@@ -735,7 +735,7 @@ class te {
|
|
|
735
735
|
if (d(o))
|
|
736
736
|
return null;
|
|
737
737
|
l = {
|
|
738
|
-
target: `${
|
|
738
|
+
target: `${r}`,
|
|
739
739
|
rules: [o],
|
|
740
740
|
targetType: e
|
|
741
741
|
};
|
|
@@ -743,10 +743,10 @@ class te {
|
|
|
743
743
|
return l;
|
|
744
744
|
}
|
|
745
745
|
getExpressionEditorOptions(n, e, t, i) {
|
|
746
|
-
return t.reduce((
|
|
746
|
+
return t.reduce((r, o) => {
|
|
747
747
|
var l, d;
|
|
748
748
|
const c = e === "Field" ? (l = n == null ? void 0 : n.binding) == null ? void 0 : l.field : n.id;
|
|
749
|
-
return
|
|
749
|
+
return r[o] = {
|
|
750
750
|
hide: e === "Field" ? !!((d = n == null ? void 0 : n.binding) != null && d.field) : !1,
|
|
751
751
|
description: "",
|
|
752
752
|
title: this.expressionNames[o],
|
|
@@ -769,17 +769,17 @@ class te {
|
|
|
769
769
|
return a;
|
|
770
770
|
}
|
|
771
771
|
}
|
|
772
|
-
},
|
|
772
|
+
}, r;
|
|
773
773
|
}, {});
|
|
774
774
|
}
|
|
775
775
|
getExpressionInfo(n, e, t) {
|
|
776
|
-
const i = e === "Field" ? n.binding.field : n.id,
|
|
777
|
-
value:
|
|
776
|
+
const i = e === "Field" ? n.binding.field : n.id, r = this.getExpressionRule(i, t), o = {
|
|
777
|
+
value: r && r.value,
|
|
778
778
|
targetId: i,
|
|
779
779
|
targetType: e,
|
|
780
780
|
expressionType: t
|
|
781
781
|
};
|
|
782
|
-
return
|
|
782
|
+
return r && r.message && (o.message = r.message), o;
|
|
783
783
|
}
|
|
784
784
|
getExpressionConfig(n, e, t = ["compute", "dependency", "validate"], i) {
|
|
785
785
|
return {
|
|
@@ -837,7 +837,7 @@ class Fe {
|
|
|
837
837
|
if (e) {
|
|
838
838
|
if (!this.designViewModelField) {
|
|
839
839
|
const i = this.designViewModelUtils.getDgViewModel(this.viewModelId);
|
|
840
|
-
this.designViewModelField = i.fields.find((
|
|
840
|
+
this.designViewModelField = i.fields.find((r) => r.id === e);
|
|
841
841
|
}
|
|
842
842
|
n.updateOn = (t = this.designViewModelField) == null ? void 0 : t.updateOn;
|
|
843
843
|
}
|
|
@@ -873,7 +873,7 @@ class Fe {
|
|
|
873
873
|
const i = {
|
|
874
874
|
title: "外观",
|
|
875
875
|
description: "Appearance"
|
|
876
|
-
},
|
|
876
|
+
}, r = {
|
|
877
877
|
class: {
|
|
878
878
|
title: "class样式",
|
|
879
879
|
type: "string",
|
|
@@ -890,10 +890,10 @@ class Fe {
|
|
|
890
890
|
}
|
|
891
891
|
};
|
|
892
892
|
for (const o in e)
|
|
893
|
-
|
|
893
|
+
r[o] = Object.assign(r[o] || {}, e[o]);
|
|
894
894
|
return {
|
|
895
895
|
...i,
|
|
896
|
-
properties: { ...
|
|
896
|
+
properties: { ...r },
|
|
897
897
|
setPropertyRelates(o, c) {
|
|
898
898
|
if (o) {
|
|
899
899
|
switch (o && o.propertyID) {
|
|
@@ -918,7 +918,7 @@ class Fe {
|
|
|
918
918
|
* @param expressionType 指定表达式类型,存在属性和表达式类型不一致的情况
|
|
919
919
|
* @returns
|
|
920
920
|
*/
|
|
921
|
-
getPropertyEditorParams(n, e = [], t = "visible", i = {},
|
|
921
|
+
getPropertyEditorParams(n, e = [], t = "visible", i = {}, r = {}, o = "") {
|
|
922
922
|
const { getVariables: c, getControlName: l, getStateMachines: d } = Ve(this.designerHostService), u = this.getRealTargetType(n), a = e && e.length > 0 ? e : ["Const", "Variable", "StateMachine", "Expression"], g = {
|
|
923
923
|
type: "property-editor",
|
|
924
924
|
propertyTypes: a
|
|
@@ -947,15 +947,15 @@ class Fe {
|
|
|
947
947
|
onBeforeOpenVariables: (m) => {
|
|
948
948
|
m.value = c(this.viewModelId);
|
|
949
949
|
}
|
|
950
|
-
},
|
|
950
|
+
}, r), this.designerContext.designerMode === "PC_RTC" && (g.newVariablePrefix = "ext_" + g.newVariablePrefix);
|
|
951
951
|
break;
|
|
952
952
|
}
|
|
953
953
|
}), g;
|
|
954
954
|
}
|
|
955
955
|
getVisibleProperty(n, e = "") {
|
|
956
|
-
var
|
|
956
|
+
var r;
|
|
957
957
|
let t = ["Const", "Variable", "StateMachine", "Expression"];
|
|
958
|
-
return e === "gridFieldEditor" ? t = ["Const", "Expression"] : e === "form-group" && !((
|
|
958
|
+
return e === "gridFieldEditor" ? t = ["Const", "Expression"] : e === "form-group" && !((r = n.binding) != null && r.field) && (t = ["Const", "Variable", "StateMachine"]), {
|
|
959
959
|
visible: {
|
|
960
960
|
title: "是否可见",
|
|
961
961
|
type: "boolean",
|
|
@@ -971,7 +971,7 @@ class Fe {
|
|
|
971
971
|
* @returns
|
|
972
972
|
*/
|
|
973
973
|
getBehaviorConfig(n, e = "", t = {}, i) {
|
|
974
|
-
const
|
|
974
|
+
const r = {
|
|
975
975
|
title: "行为",
|
|
976
976
|
description: ""
|
|
977
977
|
}, o = this.getVisibleProperty(n, e);
|
|
@@ -979,7 +979,7 @@ class Fe {
|
|
|
979
979
|
o[l] = Object.assign(o[l] || {}, t[l]);
|
|
980
980
|
const c = this;
|
|
981
981
|
return {
|
|
982
|
-
...
|
|
982
|
+
...r,
|
|
983
983
|
properties: { ...o },
|
|
984
984
|
setPropertyRelates(l, d) {
|
|
985
985
|
if (l) {
|
|
@@ -1013,8 +1013,8 @@ class Fe {
|
|
|
1013
1013
|
const t = e && e.parent && e.parent.schema;
|
|
1014
1014
|
if (!t)
|
|
1015
1015
|
return;
|
|
1016
|
-
const i = t.contents.findIndex((o) => o.id === n),
|
|
1017
|
-
t.contents.splice(i, 1), t.contents.splice(i, 0,
|
|
1016
|
+
const i = t.contents.findIndex((o) => o.id === n), r = ue(t.contents[i]);
|
|
1017
|
+
t.contents.splice(i, 1), t.contents.splice(i, 0, r), ae();
|
|
1018
1018
|
}
|
|
1019
1019
|
/**
|
|
1020
1020
|
* 属性编辑器,在编辑过程中会新增变量,此处需要将新增的变量追加到ViewModel中
|
|
@@ -1044,7 +1044,7 @@ class Fe {
|
|
|
1044
1044
|
const e = n.propertyValue;
|
|
1045
1045
|
if (!((e && e.type) === "Expression" && e.expressionInfo))
|
|
1046
1046
|
return;
|
|
1047
|
-
const { expressionId:
|
|
1047
|
+
const { expressionId: r, expressionInfo: o } = e, { targetId: c, targetType: l, expressionType: d, value: u, message: a } = o, g = this.formSchemaUtils.getModule();
|
|
1048
1048
|
g.expressions = g.expressions || [];
|
|
1049
1049
|
const { expressions: f } = g;
|
|
1050
1050
|
let m = f.find((b) => b.target === c);
|
|
@@ -1053,7 +1053,7 @@ class Fe {
|
|
|
1053
1053
|
if (h)
|
|
1054
1054
|
h.value = u, h.message = a;
|
|
1055
1055
|
else {
|
|
1056
|
-
const b = { id:
|
|
1056
|
+
const b = { id: r, type: d, value: u, message: a };
|
|
1057
1057
|
m.rules.push(b);
|
|
1058
1058
|
}
|
|
1059
1059
|
delete e.expressionInfo;
|
|
@@ -1068,8 +1068,8 @@ class Fe {
|
|
|
1068
1068
|
const t = n.propertyValue;
|
|
1069
1069
|
if (t && t.type === "Expression")
|
|
1070
1070
|
return;
|
|
1071
|
-
const
|
|
1072
|
-
!l || !l.rules || (l.rules = l.rules.filter((d) => d.type !==
|
|
1071
|
+
const r = n.propertyID, o = this.formSchemaUtils.getExpressions(), c = e.binding ? e.binding.field : e.id, l = o.find((d) => d.target === c);
|
|
1072
|
+
!l || !l.rules || (l.rules = l.rules.filter((d) => d.type !== r));
|
|
1073
1073
|
}
|
|
1074
1074
|
getExpressionOptions(n, e, t) {
|
|
1075
1075
|
return new te(this.formSchemaUtils).getExpressionOptions(n, e, t);
|
|
@@ -1091,17 +1091,17 @@ class Fe {
|
|
|
1091
1091
|
}, e;
|
|
1092
1092
|
}
|
|
1093
1093
|
}
|
|
1094
|
-
const
|
|
1094
|
+
const B = class B {
|
|
1095
1095
|
/**
|
|
1096
1096
|
* 根据绑定字段类型获取可用的输入类控件
|
|
1097
1097
|
*/
|
|
1098
1098
|
static getEditorTypesByMDataType(n, e = !1, t = "") {
|
|
1099
1099
|
if (e)
|
|
1100
1100
|
return [{ key: p["language-textbox"].type, value: p["language-textbox"].name }];
|
|
1101
|
-
let i =
|
|
1101
|
+
let i = B.fieldControlTypeMapping[n];
|
|
1102
1102
|
if (t === "data-grid-column" && (i != null && i.length)) {
|
|
1103
|
-
const
|
|
1104
|
-
i = i.filter((o) => !
|
|
1103
|
+
const r = [p["check-group"].type, p["radio-group"].type, p.image.type];
|
|
1104
|
+
i = i.filter((o) => !r.includes(o.key));
|
|
1105
1105
|
}
|
|
1106
1106
|
return i;
|
|
1107
1107
|
}
|
|
@@ -1110,8 +1110,8 @@ const N = class N {
|
|
|
1110
1110
|
*/
|
|
1111
1111
|
static getAllInputTypes() {
|
|
1112
1112
|
const n = [];
|
|
1113
|
-
for (const e in
|
|
1114
|
-
|
|
1113
|
+
for (const e in B.fieldControlTypeMapping)
|
|
1114
|
+
B.fieldControlTypeMapping[e].forEach((t) => {
|
|
1115
1115
|
n.find((i) => i.key === t.key && i.value === t.value) || n.push({ key: t.key, value: t.value });
|
|
1116
1116
|
});
|
|
1117
1117
|
return n;
|
|
@@ -1121,15 +1121,15 @@ const N = class N {
|
|
|
1121
1121
|
* @param control 控件元数据
|
|
1122
1122
|
*/
|
|
1123
1123
|
static mappingDomPropAndSchemaProp(n, e) {
|
|
1124
|
-
var
|
|
1125
|
-
const t = (
|
|
1124
|
+
var r;
|
|
1125
|
+
const t = (r = n.editor) == null ? void 0 : r.type, i = [];
|
|
1126
1126
|
return (n.type === p["data-grid-column"].type || n.type === p["tree-grid-column"].type) && e && e.categoryId && e.categoryId.indexOf("gridFieldEditor") < 0 && i.push({ domField: "title", schemaField: "name" }), i.push({ domField: "label", schemaField: "name" }), i.push({ domField: "editor.required", schemaField: "require" }), i.push({ domField: "editor.readonly", schemaField: "readonly" }), (t === p["input-group"].type || t === p.textarea.type || t === p["number-spinner"].type) && i.push({ domField: "editor.maxLength", schemaField: "type.length" }), t === p["number-spinner"].type && i.push({ domField: "editor.precision", schemaField: "type.precision" }), (n.type === p["data-grid-column"].type || n.type === p["tree-grid-column"].type) && i.push({ domField: "formatter.precision", schemaField: "type.precision" }), (t === p["combo-list"].type || t === p["radio-group"].type) && i.push({ domField: "editor.data", schemaField: "type.enumValues" }), (n.type === p["data-grid-column"].type || n.type === p["tree-grid-column"].type) && i.push({ domField: "formatter.data", schemaField: "type.enumValues" }), t === p["date-picker"].type && (i.push({ domField: "editor.displayFormat", schemaField: "editor.format" }), i.push({ domField: "editor.fieldType", schemaField: "type.name" })), t === p["number-spinner"].type && (i.push({ domField: "editor.max", schemaField: "editor.maxValue" }), i.push({ domField: "editor.min", schemaField: "editor.minValue" })), t === p.lookup.type && (i.push({ domField: "editor.dataSource", schemaField: "editor.dataSource" }), i.push({ domField: "editor.valueField", schemaField: "editor.valueField" }), i.push({ domField: "editor.textField", schemaField: "editor.textField" }), i.push({ domField: "editor.displayType", schemaField: "editor.displayType" }), i.push({ domField: "editor.mapFields", schemaField: "editor.mapFields" }), i.push({ domField: "editor.helpId", schemaField: "editor.helpId" })), i.push({ domField: "path", schemaField: "bindingPath" }), i.push({ domField: "binding.path", schemaField: "bindingField" }), i.push({ domField: "binding.fullPath", schemaField: "path" }), (n.type === p["data-grid-column"].type || n.type === p["tree-grid-column"].type) && i.push({ domField: "field", schemaField: "bindingPath" }), i;
|
|
1127
1127
|
}
|
|
1128
1128
|
};
|
|
1129
1129
|
/**
|
|
1130
1130
|
* <字段类型,可配置的控件类型列表>的映射
|
|
1131
1131
|
*/
|
|
1132
|
-
y(
|
|
1132
|
+
y(B, "fieldControlTypeMapping", {
|
|
1133
1133
|
String: [
|
|
1134
1134
|
{ key: p["input-group"].type, value: p["input-group"].name },
|
|
1135
1135
|
{ key: p.lookup.type, value: p.lookup.name },
|
|
@@ -1183,8 +1183,8 @@ y(N, "fieldControlTypeMapping", {
|
|
|
1183
1183
|
{ key: p["radio-group"].type, value: p["radio-group"].name }
|
|
1184
1184
|
]
|
|
1185
1185
|
});
|
|
1186
|
-
let j =
|
|
1187
|
-
var L = /* @__PURE__ */ ((
|
|
1186
|
+
let j = B;
|
|
1187
|
+
var L = /* @__PURE__ */ ((s) => (s.Form = "Form", s.Variable = "Variable", s))(L || {});
|
|
1188
1188
|
class Ee {
|
|
1189
1189
|
constructor() {
|
|
1190
1190
|
/** 控件标题 */
|
|
@@ -1215,11 +1215,11 @@ class Ee {
|
|
|
1215
1215
|
y(this, "fieldSetId", "");
|
|
1216
1216
|
}
|
|
1217
1217
|
}
|
|
1218
|
-
function Ie(
|
|
1218
|
+
function Ie(s) {
|
|
1219
1219
|
let n, e;
|
|
1220
1220
|
const t = /* @__PURE__ */ new Map();
|
|
1221
1221
|
let i = [];
|
|
1222
|
-
function
|
|
1222
|
+
function r(u, a) {
|
|
1223
1223
|
const f = u.split(" ").filter((w) => w.startsWith("col-"));
|
|
1224
1224
|
if (f.length === 0) {
|
|
1225
1225
|
a.isSupportedClass = !1;
|
|
@@ -1237,14 +1237,14 @@ function Ie(r) {
|
|
|
1237
1237
|
}
|
|
1238
1238
|
m && (g += 1, m = !1);
|
|
1239
1239
|
const b = h.appearance && h.appearance.class, C = new Ee();
|
|
1240
|
-
b ?
|
|
1240
|
+
b ? r(b, C) : C.isSupportedClass = !1, C.label = h.label || h.id, C.id = h.id, C.group = g, f && (C.fieldSetId = u.id), e === h.id && (n = g), t.set(h.id, h), a.push(C);
|
|
1241
1241
|
});
|
|
1242
1242
|
}
|
|
1243
1243
|
function c(u) {
|
|
1244
|
-
const a =
|
|
1244
|
+
const a = s.getComponentById(u);
|
|
1245
1245
|
if (!a || !a.componentType || !a.componentType.startsWith("form"))
|
|
1246
1246
|
return { result: !1, message: "只可以在响应式表单组件中调整响应式布局配置" };
|
|
1247
|
-
const g =
|
|
1247
|
+
const g = s.selectNode(a, (f) => f.type === p["response-form"].type);
|
|
1248
1248
|
return !g || !g.contents || g.contents.length === 0 ? { result: !1, message: "Form区域内没有控件,请先添加控件" } : { result: !0, message: "", formNode: g };
|
|
1249
1249
|
}
|
|
1250
1250
|
function l(u, a) {
|
|
@@ -1316,7 +1316,7 @@ class Se extends Fe {
|
|
|
1316
1316
|
}
|
|
1317
1317
|
getBasicProperties(e, t, i = "Card") {
|
|
1318
1318
|
var d;
|
|
1319
|
-
const
|
|
1319
|
+
const r = this;
|
|
1320
1320
|
this.setDesignViewModelField(e);
|
|
1321
1321
|
const { canChangeControlType: o, editorTypeList: c } = this.getAvailableEditorType(e), l = {
|
|
1322
1322
|
description: "Basic Information",
|
|
@@ -1381,7 +1381,7 @@ class Se extends Fe {
|
|
|
1381
1381
|
if (u)
|
|
1382
1382
|
switch (u && u.propertyID) {
|
|
1383
1383
|
case "type": {
|
|
1384
|
-
|
|
1384
|
+
r.changeControlType(e, u, t);
|
|
1385
1385
|
break;
|
|
1386
1386
|
}
|
|
1387
1387
|
case "label": {
|
|
@@ -1389,7 +1389,7 @@ class Se extends Fe {
|
|
|
1389
1389
|
break;
|
|
1390
1390
|
}
|
|
1391
1391
|
case "binding": {
|
|
1392
|
-
|
|
1392
|
+
r.changeBindingField(e, u, g);
|
|
1393
1393
|
break;
|
|
1394
1394
|
}
|
|
1395
1395
|
}
|
|
@@ -1415,14 +1415,14 @@ class Se extends Fe {
|
|
|
1415
1415
|
* 获取可选的编辑器类型
|
|
1416
1416
|
*/
|
|
1417
1417
|
getAvailableEditorType(e) {
|
|
1418
|
-
var
|
|
1418
|
+
var r;
|
|
1419
1419
|
const t = this.checkCanChangeControlType(e, this.viewModelId);
|
|
1420
1420
|
if (!t)
|
|
1421
1421
|
return {
|
|
1422
1422
|
canChangeControlType: !1,
|
|
1423
1423
|
editorTypeList: [{
|
|
1424
1424
|
key: e.editor.type,
|
|
1425
|
-
value: ((
|
|
1425
|
+
value: ((r = p[e.editor.type]) == null ? void 0 : r.name) || e.editor.type
|
|
1426
1426
|
}]
|
|
1427
1427
|
};
|
|
1428
1428
|
let i = [];
|
|
@@ -1470,14 +1470,14 @@ class Se extends Fe {
|
|
|
1470
1470
|
}
|
|
1471
1471
|
}
|
|
1472
1472
|
},
|
|
1473
|
-
setPropertyRelates(
|
|
1474
|
-
if (
|
|
1475
|
-
switch (
|
|
1473
|
+
setPropertyRelates(r, o) {
|
|
1474
|
+
if (r)
|
|
1475
|
+
switch (r && r.propertyID) {
|
|
1476
1476
|
case "responseLayout":
|
|
1477
|
-
i.responseLayoutEditorFunction.changeFormControlsByResponseLayoutConfig(
|
|
1477
|
+
i.responseLayoutEditorFunction.changeFormControlsByResponseLayoutConfig(r.propertyValue, i.componentId || e.id), i.updateUnifiedLayoutAfterResponseLayoutChanged(i.componentId), i.updateElementByParentContainer(e.id, t), delete e.responseLayout;
|
|
1478
1478
|
break;
|
|
1479
1479
|
case "class":
|
|
1480
|
-
i.updateUnifiedLayoutAfterControlChanged(
|
|
1480
|
+
i.updateUnifiedLayoutAfterControlChanged(r.propertyValue, e.id, this.componentId), R.value++;
|
|
1481
1481
|
break;
|
|
1482
1482
|
case "style": {
|
|
1483
1483
|
R.value++;
|
|
@@ -1496,7 +1496,7 @@ class Se extends Fe {
|
|
|
1496
1496
|
* @param newControlType 新控件类型
|
|
1497
1497
|
*/
|
|
1498
1498
|
changeControlType(e, t, i) {
|
|
1499
|
-
const
|
|
1499
|
+
const r = t.propertyValue, o = i && i.parent && i.parent.schema;
|
|
1500
1500
|
if (!o)
|
|
1501
1501
|
return;
|
|
1502
1502
|
const c = o.contents.findIndex((u) => u.id === e.id);
|
|
@@ -1506,9 +1506,9 @@ class Se extends Fe {
|
|
|
1506
1506
|
let d;
|
|
1507
1507
|
if (this.designViewModelField) {
|
|
1508
1508
|
const g = this.formSchemaUtils.getViewModelById(this.viewModelId).fields.find((m) => m.id === this.designViewModelField.id).fieldSchema || {};
|
|
1509
|
-
g.editor || (g.editor = {}), g.editor.$type =
|
|
1509
|
+
g.editor || (g.editor = {}), g.editor.$type = r, this.designViewModelUtils.getDgViewModel(this.viewModelId).changeField(this.designViewModelField.id, g, !1), d = this.controlCreatorUtils.setFormFieldProperty(this.designViewModelField, r);
|
|
1510
1510
|
}
|
|
1511
|
-
d || (d = this.controlCreatorUtils.createFormGroupWithoutField(
|
|
1511
|
+
d || (d = this.controlCreatorUtils.createFormGroupWithoutField(r)), Object.assign(d, {
|
|
1512
1512
|
id: l.id,
|
|
1513
1513
|
appearance: l.appearance,
|
|
1514
1514
|
size: l.size,
|
|
@@ -1520,11 +1520,11 @@ class Se extends Fe {
|
|
|
1520
1520
|
(u) => u.classList.remove("dgComponentSelected")
|
|
1521
1521
|
), Array.from(document.getElementsByClassName("dgComponentFocused")).forEach(
|
|
1522
1522
|
(u) => u.classList.remove("dgComponentFocused")
|
|
1523
|
-
), R.value++,
|
|
1523
|
+
), R.value++, re(() => {
|
|
1524
1524
|
this.getFormDesignerInstance().reloadPropertyPanel();
|
|
1525
1525
|
});
|
|
1526
1526
|
}
|
|
1527
|
-
getComponentConfig(e, t = {}, i = {},
|
|
1527
|
+
getComponentConfig(e, t = {}, i = {}, r) {
|
|
1528
1528
|
var g, f;
|
|
1529
1529
|
const o = Object.assign({
|
|
1530
1530
|
description: "编辑器",
|
|
@@ -1565,7 +1565,7 @@ class Se extends Fe {
|
|
|
1565
1565
|
a.afterMutilEditorChanged(e, m);
|
|
1566
1566
|
break;
|
|
1567
1567
|
}
|
|
1568
|
-
|
|
1568
|
+
r && r.bind(a)(m, e, h);
|
|
1569
1569
|
}
|
|
1570
1570
|
}
|
|
1571
1571
|
};
|
|
@@ -1577,8 +1577,8 @@ class Se extends Fe {
|
|
|
1577
1577
|
* @param componentId 控件所在组件id
|
|
1578
1578
|
*/
|
|
1579
1579
|
updateUnifiedLayoutAfterControlChanged(e, t, i) {
|
|
1580
|
-
const
|
|
1581
|
-
let o =
|
|
1580
|
+
const r = e.split(" ");
|
|
1581
|
+
let o = r.find((a) => /^col-([1-9]|10|11|12)$/.test(a)), c = r.find((a) => /^col-md-([1-9]|10|11|12)$/.test(a)), l = r.find((a) => /^col-xl-([1-9]|10|11|12)$/.test(a)), d = r.find((a) => /^col-el-([1-9]|10|11|12)$/.test(a));
|
|
1582
1582
|
o = o || "col-12", c = c || "col-md-" + o.replace("col-", ""), l = l || "col-xl-" + c.replace("col-md-", ""), d = d || "col-el-" + l.replace("col-xl-", "");
|
|
1583
1583
|
const u = {
|
|
1584
1584
|
id: t,
|
|
@@ -1598,12 +1598,12 @@ class Se extends Fe {
|
|
|
1598
1598
|
const { formNode: i } = this.responseLayoutEditorFunction.checkCanFindFormNode(e);
|
|
1599
1599
|
if (!i || !i.unifiedLayout)
|
|
1600
1600
|
return;
|
|
1601
|
-
const
|
|
1602
|
-
if (this.responseLayoutEditorFunction.getResonseFormLayoutConfig(i,
|
|
1603
|
-
const m =
|
|
1601
|
+
const r = [];
|
|
1602
|
+
if (this.responseLayoutEditorFunction.getResonseFormLayoutConfig(i, r, 1), t) {
|
|
1603
|
+
const m = r.find((h) => h.id === t.id);
|
|
1604
1604
|
Object.assign(m || {}, t);
|
|
1605
1605
|
}
|
|
1606
|
-
const o =
|
|
1606
|
+
const o = r.map((m) => m.columnInSM), c = r.map((m) => m.columnInMD), l = r.map((m) => m.columnInLG), d = r.map((m) => m.columnInEL), u = this.checkIsUniqueColumn(o) ? o[0] : null, a = this.checkIsUniqueColumn(c) ? c[0] : null, g = this.checkIsUniqueColumn(l) ? l[0] : null, f = this.checkIsUniqueColumn(d) ? d[0] : null;
|
|
1607
1607
|
Object.assign(i.unifiedLayout, {
|
|
1608
1608
|
uniqueColClassInSM: u,
|
|
1609
1609
|
uniqueColClassInMD: a,
|
|
@@ -1676,10 +1676,19 @@ class Se extends Fe {
|
|
|
1676
1676
|
* @param showPosition 面板展示位置
|
|
1677
1677
|
* @param customEvent 输入控件特有的事件配置
|
|
1678
1678
|
*/
|
|
1679
|
-
getEventPropertyConfig(e, t = "card", i,
|
|
1679
|
+
getEventPropertyConfig(e, t = "card", i, r) {
|
|
1680
1680
|
const o = this;
|
|
1681
1681
|
let c = [];
|
|
1682
|
-
i && (c = c.concat(i)),
|
|
1682
|
+
if (i && (c = c.concat(i)), c.length === 0)
|
|
1683
|
+
return {
|
|
1684
|
+
title: "事件",
|
|
1685
|
+
hideTitle: !0,
|
|
1686
|
+
properties: {},
|
|
1687
|
+
tabId: "commands",
|
|
1688
|
+
tabName: "交互",
|
|
1689
|
+
hide: !0
|
|
1690
|
+
};
|
|
1691
|
+
this.appendFieldValueChangeEvents(e, c);
|
|
1683
1692
|
const l = o.eventsEditorUtils.formProperties(e, o.viewModelId, c);
|
|
1684
1693
|
return {
|
|
1685
1694
|
title: "事件",
|
|
@@ -1689,18 +1698,18 @@ class Se extends Fe {
|
|
|
1689
1698
|
tabName: "交互",
|
|
1690
1699
|
setPropertyRelates(a, g) {
|
|
1691
1700
|
const f = a.propertyValue;
|
|
1692
|
-
delete e[o.viewModelId], f && (f.setPropertyRelates = this.setPropertyRelates, f.controlInfo = { type: o.getControlMethodType(e), name: e.title }, o.eventsEditorUtils.saveRelatedParameters(e, o.viewModelId, f.events, f)),
|
|
1701
|
+
delete e[o.viewModelId], f && (f.setPropertyRelates = this.setPropertyRelates, f.controlInfo = { type: o.getControlMethodType(e), name: e.title }, o.eventsEditorUtils.saveRelatedParameters(e, o.viewModelId, f.events, f)), r && r(a, g, f);
|
|
1693
1702
|
const m = o.designViewModelUtils.getDgViewModel(o.viewModelId);
|
|
1694
1703
|
m && o.designViewModelField && m.changeField(o.designViewModelField.id, { valueChanging: e.fieldValueChanging, valueChanged: e.fieldValueChanged });
|
|
1695
1704
|
}
|
|
1696
1705
|
};
|
|
1697
1706
|
}
|
|
1698
|
-
getExpressionConfig(e, t, i = ["compute", "dependency", "validate"],
|
|
1707
|
+
getExpressionConfig(e, t, i = ["compute", "dependency", "validate"], r) {
|
|
1699
1708
|
return new te(this.formSchemaUtils).getExpressionConfig(
|
|
1700
1709
|
e,
|
|
1701
1710
|
t,
|
|
1702
1711
|
i,
|
|
1703
|
-
|
|
1712
|
+
r
|
|
1704
1713
|
);
|
|
1705
1714
|
}
|
|
1706
1715
|
getBindingDataType() {
|
|
@@ -1710,14 +1719,14 @@ class Se extends Fe {
|
|
|
1710
1719
|
return this.getBindingDataType() === "number" ? this.numberEditorOptions : {};
|
|
1711
1720
|
}
|
|
1712
1721
|
updatePropertyValue(e, t, i) {
|
|
1713
|
-
var
|
|
1714
|
-
e.editor[t] !== i ? e.editor[t] = i : (
|
|
1722
|
+
var r;
|
|
1723
|
+
e.editor[t] !== i ? e.editor[t] = i : (r = this.getFormDesignerInstance()) == null || r.reloadPropertyPanel();
|
|
1715
1724
|
}
|
|
1716
1725
|
setBooleanValue(e, t, i) {
|
|
1717
|
-
let
|
|
1718
|
-
this.getBindingDataType() === "string" && (
|
|
1726
|
+
let r = i;
|
|
1727
|
+
this.getBindingDataType() === "string" && (r = (r || "").trim() || (t === "trueValue" ? "true" : "false"));
|
|
1719
1728
|
const c = t === "trueValue" ? "falseValue" : "trueValue";
|
|
1720
|
-
e.editor[c] ===
|
|
1729
|
+
e.editor[c] === r && (r = r + 1), this.updatePropertyValue(e, t, r);
|
|
1721
1730
|
}
|
|
1722
1731
|
getBooleanValueConverter() {
|
|
1723
1732
|
return {
|
|
@@ -1742,10 +1751,10 @@ class Me extends Se {
|
|
|
1742
1751
|
});
|
|
1743
1752
|
}
|
|
1744
1753
|
}
|
|
1745
|
-
function ke(
|
|
1746
|
-
const e =
|
|
1747
|
-
function t(i,
|
|
1748
|
-
return new Me(i, n).getPropertyConfig(e,
|
|
1754
|
+
function ke(s, n) {
|
|
1755
|
+
const e = s.schema;
|
|
1756
|
+
function t(i, r) {
|
|
1757
|
+
return new Me(i, n).getPropertyConfig(e, r);
|
|
1749
1758
|
}
|
|
1750
1759
|
return { getPropsConfig: t };
|
|
1751
1760
|
}
|
|
@@ -1753,16 +1762,16 @@ const Pe = /* @__PURE__ */ _({
|
|
|
1753
1762
|
name: "FNumberRangeDesign",
|
|
1754
1763
|
props: W,
|
|
1755
1764
|
emits: ["valueChange", "blur", "focus", "click", "input", "beginValueChange", "endValueChange"],
|
|
1756
|
-
setup(
|
|
1757
|
-
const e =
|
|
1765
|
+
setup(s, n) {
|
|
1766
|
+
const e = N(s.beginValue), t = N(""), i = N(s.endValue), r = N(""), o = Y(s), c = ee(s, n, o), l = (x) => {
|
|
1758
1767
|
n.emit("beginValueChange", x);
|
|
1759
|
-
}, d =
|
|
1768
|
+
}, d = N(), u = D("designer-host-service"), a = D("design-item-context"), g = ke(a, u), f = de(d, a, g);
|
|
1760
1769
|
H(() => {
|
|
1761
1770
|
d.value.componentInstance = f;
|
|
1762
1771
|
}), n.expose(f.value);
|
|
1763
|
-
const m = A(
|
|
1772
|
+
const m = A(s, n, t, e, c, o, l, e, i, !0), h = O(s, n, t, e, c, o, m, l, e, i, !0), b = q(s, n, m), C = X(s, n, h, !0), w = (x) => {
|
|
1764
1773
|
n.emit("endValueChange", x);
|
|
1765
|
-
}, V = A(
|
|
1774
|
+
}, V = A(s, n, r, i, c, o, w, e, i, !1), v = O(s, n, r, i, c, o, V, w, e, i, !1), k = q(s, n, V), F = X(s, n, v, !1), S = M(() => s.showButton);
|
|
1766
1775
|
return () => E("div", {
|
|
1767
1776
|
ref: d,
|
|
1768
1777
|
class: "input-group number-range f-cmp-number-spinner"
|
|
@@ -1777,11 +1786,11 @@ const Pe = /* @__PURE__ */ _({
|
|
|
1777
1786
|
}, [F(), S.value && k()])])]);
|
|
1778
1787
|
}
|
|
1779
1788
|
});
|
|
1780
|
-
$.register = (
|
|
1781
|
-
|
|
1789
|
+
$.register = (s, n, e, t) => {
|
|
1790
|
+
s["number-range"] = $, n["number-range"] = Q;
|
|
1782
1791
|
};
|
|
1783
|
-
$.registerDesigner = (
|
|
1784
|
-
|
|
1792
|
+
$.registerDesigner = (s, n, e) => {
|
|
1793
|
+
s["number-range"] = Pe, n["number-range"] = Q;
|
|
1785
1794
|
};
|
|
1786
1795
|
const qe = pe($);
|
|
1787
1796
|
export {
|