@kp-ui/lowcode 2.15.0-alpha.11 → 2.15.0-alpha.13

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kp-ui/lowcode",
3
- "version": "2.15.0-alpha.11",
3
+ "version": "2.15.0-alpha.13",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -1,29 +1,29 @@
1
- import { ref as b, computed as c, unref as z } from "vue";
2
- import { debounce as F, isArray as P } from "lodash-es";
3
- import { translateOptionItems as N } from "../../../../../utils/util.js";
4
- import { useExecFunction as R } from "tmgc2-share";
5
- function q(t, v) {
1
+ import { ref as m, computed as p, unref as F } from "vue";
2
+ import { debounce as N, isArray as O } from "lodash-es";
3
+ import { translateOptionItems as R } from "../../../../../utils/util.js";
4
+ import { useExecFunction as q } from "tmgc2-share";
5
+ function D(t, g) {
6
6
  if (!Array.isArray(t))
7
7
  return -1;
8
8
  let l = -1;
9
9
  return t.forEach((i, r) => {
10
- i === v && (l = r);
10
+ i === g && (l = r);
11
11
  }), l;
12
12
  }
13
- function J({ field: t, designState: v, fieldModel: l }) {
14
- const i = b({
13
+ function U({ field: t, designState: g, fieldModel: l }) {
14
+ const i = m({
15
15
  val: ""
16
- }), r = b(!1), a = b({
16
+ }), r = m(!1), s = m({
17
17
  page: 1,
18
18
  pageSize: 20,
19
19
  totalPage: 0,
20
20
  total: 0
21
- }), { execHttpFunction: S } = R(), g = async () => {
21
+ }), { execHttpFunction: P } = q(), h = async () => {
22
22
  var e;
23
- if (!r.value) {
23
+ if (console.log(32321321), !r.value) {
24
24
  if (r.value = !0, t.options.dsEnabled && ((e = t.options.http) != null && e.url))
25
25
  try {
26
- const { http: o, dataHandlerCode: n, dataReqHandlerCode: u } = t.options, s = await S(
26
+ const { http: o, dataHandlerCode: n, dataReqHandlerCode: u } = t.options, a = await P(
27
27
  {
28
28
  http: o,
29
29
  dataHandlerCode: n,
@@ -31,72 +31,72 @@ function J({ field: t, designState: v, fieldModel: l }) {
31
31
  },
32
32
  {}
33
33
  );
34
- if (!s) {
34
+ if (!a) {
35
35
  r.value = !1;
36
36
  return;
37
37
  }
38
- if (P(s)) {
39
- p(s);
38
+ if (O(a)) {
39
+ c(a);
40
40
  return;
41
41
  }
42
- P(s.list) && (t.options.loadingPage ? (a.value.total = s.total || 0, a.value.totalPage = s.totalPage || 0, p([...y(), ...s.list])) : p(s.list));
42
+ O(a.list) && (t.options.loadingPage ? (s.value.total = a.total || 0, s.value.totalPage = a.totalPage || 0, c([...v(), ...a.list])) : c(a.list));
43
43
  } catch (o) {
44
44
  console.error("err: ", o);
45
45
  }
46
46
  else
47
- p([...y()]);
47
+ c([...v()]);
48
48
  r.value = !1;
49
49
  }
50
- }, I = F(function() {
51
- a.value.page += 1, g();
52
- }, 500), w = (e) => {
50
+ }, w = N(function() {
51
+ s.value.page += 1, h();
52
+ }, 500), E = (e) => {
53
53
  if (!t.options.loadingPage) return;
54
- const { target: o } = e, { scrollTop: n, scrollHeight: u, clientHeight: s } = o;
55
- if (u - (n + s) <= 30 && a.value.totalPage > a.value.page) {
56
- if (a.value.totalPage === a.value.page)
54
+ const { target: o } = e, { scrollTop: n, scrollHeight: u, clientHeight: a } = o;
55
+ if (u - (n + a) <= 30 && s.value.totalPage > s.value.page) {
56
+ if (s.value.totalPage === s.value.page)
57
57
  return;
58
- I();
58
+ w();
59
59
  }
60
- }, E = c(() => (t == null ? void 0 : t.options.labelKey) || "label"), x = c(() => (t == null ? void 0 : t.options.valueKey) || "value"), H = c(() => (t == null ? void 0 : t.options.childrenKey) || "children"), h = c(() => ({
60
+ }, x = p(() => (t == null ? void 0 : t.options.labelKey) || "label"), b = p(() => (t == null ? void 0 : t.options.valueKey) || "value"), H = p(() => (t == null ? void 0 : t.options.childrenKey) || "children"), y = p(() => ({
61
61
  label: (t == null ? void 0 : t.options.labelKey) || "label",
62
62
  value: (t == null ? void 0 : t.options.valueKey) || "value",
63
63
  options: "options"
64
- })), m = (e, o) => o[h.value.label].toLowerCase().indexOf(e.toLowerCase()) >= 0, C = () => {
65
- a.value = { page: 1, pageSize: 20, total: 0, totalPage: 0 }, p([]);
64
+ })), K = (e, o) => o[y.value.label].toLowerCase().indexOf(e.toLowerCase()) >= 0, C = () => {
65
+ s.value = { page: 1, pageSize: 20, total: 0, totalPage: 0 }, c([]);
66
66
  }, L = (e) => {
67
- t.options.showSearch && (v || (C(), i.value.val = e, g()));
68
- }, A = c(() => {
67
+ t.options.showSearch && (g || (C(), i.value.val = e, h()));
68
+ }, A = p(() => {
69
69
  var n;
70
70
  const o = (n = t == null ? void 0 : t.options) == null ? void 0 : n.showSearch;
71
71
  return {
72
72
  loading: r.value,
73
- fieldNames: h.value,
73
+ fieldNames: y.value,
74
74
  showSearch: !0,
75
- onPopupScroll: w,
75
+ onPopupScroll: E,
76
76
  onSearch: L,
77
- filterOption: !o && m,
77
+ filterOption: !o && K,
78
78
  listHeight: 240
79
79
  };
80
- }), p = async (e) => {
81
- t.options.optionItems = N(
80
+ }), c = async (e) => {
81
+ t.options.optionItems = R(
82
82
  e,
83
83
  t.type,
84
84
  t.options.labelKey || "label",
85
85
  t.options.valueKey || "value"
86
86
  );
87
- }, y = () => a.value.page === 1 && t.options.dsEnabled ? [] : t.options.optionItems, k = c(() => {
87
+ }, v = () => t.options.optionItems, k = () => v().find((o) => o[b.value] === l.value), z = p(() => {
88
88
  if (l.value === null)
89
89
  return "";
90
90
  {
91
91
  let e = "";
92
92
  const { valueKey: o, labelKey: n } = t.options;
93
93
  return t.options.optionItems.forEach((u) => {
94
- (u[o] === l.value || q(l.value, u[o]) !== -1) && (e = e === "" ? u[n] : e + " " + u[n]);
94
+ (u[o] === l.value || D(l.value, u[o]) !== -1) && (e = e === "" ? u[n] : e + " " + u[n]);
95
95
  }), e;
96
96
  }
97
- }), K = () => {
97
+ }), S = () => {
98
98
  t.options.dsEnabled && t.options.optionItems.splice(0, t.options.optionItems.length);
99
- }, O = (e) => {
99
+ }, I = (e) => {
100
100
  const o = t.options.optionItems;
101
101
  o && o.length > 0 && o.forEach((n) => {
102
102
  n.value === e && (n.disabled = !0);
@@ -104,33 +104,35 @@ function J({ field: t, designState: v, fieldModel: l }) {
104
104
  };
105
105
  return {
106
106
  selectDefineExpose: {
107
- disableOption: O,
108
- clearOptionItems: K,
107
+ getSelectedItem: k,
108
+ disableOption: I,
109
+ clearOptionItems: S,
109
110
  enableOption: (e) => {
110
111
  const o = t.options.optionItems;
111
112
  o && o.length > 0 && o.forEach((n) => {
112
113
  n.value === e && (n.disabled = !1);
113
114
  });
114
115
  },
115
- keyword: z(i)
116
+ getOptionItems: v,
117
+ keyword: F(i)
116
118
  },
117
- disableOption: O,
118
- clearOptionItems: K,
119
+ disableOption: I,
120
+ clearOptionItems: S,
119
121
  childrenKey: H,
120
- valueKey: x,
121
- labelKey: E,
122
- optionLabel: k,
123
- loadOptions: p,
124
- filterOption: m,
122
+ valueKey: b,
123
+ labelKey: x,
124
+ optionLabel: z,
125
+ loadOptions: c,
126
+ filterOption: K,
125
127
  keyword: i,
126
- pager: a,
128
+ pager: s,
127
129
  loading: r,
128
- fieldNames: h,
130
+ fieldNames: y,
129
131
  selectOps: A,
130
- initOptionItems: g,
131
- getOptionItems: y
132
+ initOptionItems: h,
133
+ getOptionItems: v
132
134
  };
133
135
  }
134
136
  export {
135
- J as useSelect
137
+ U as useSelect
136
138
  };
@@ -41,7 +41,7 @@ const R = /* @__PURE__ */ S({
41
41
  F(() => {
42
42
  o();
43
43
  }), u({
44
- selectDefineExpose: s,
44
+ ...s,
45
45
  ...i
46
46
  });
47
47
  const d = { props: e, rules: p, i18nt: a, field: t, fieldModel: r, isReadMode: m, size: f, designState: n, fieldEditor: c, handleHidden: b, handleDisabled: y, handleClickIcon: g, handleFocusCustomEvent: _, handleBlurCustomEvent: q, defineExposed: i, selectOps: I, optionLabel: x, initOptionItems: o, selectDefineExpose: s, FormItemWrapper: h, get SvgIcon() {
@@ -3,13 +3,13 @@ import { useEmitter as q } from "../../../../utils/useEmitter.js";
3
3
  import F from "./form-item-wrapper.vue.js";
4
4
  import { useField as x } from "./useField.js";
5
5
  import { ComponentNameEnum as N, WidgetTypeEnum as h } from "../../../../constants/WidgetTypeEnum.js";
6
- const j = /* @__PURE__ */ _({
6
+ const I = /* @__PURE__ */ _({
7
7
  name: h.textarea,
8
8
  componentName: N.FieldWidget,
9
9
  __name: "textarea-widget",
10
10
  props: {
11
- widget: { type: Object, required: !0 },
12
- field: { type: Object, required: !0 },
11
+ widget: { type: null, required: !0 },
12
+ field: { type: null, required: !0 },
13
13
  designer: { type: null, required: !1 },
14
14
  parentWidget: { type: [Object, null], required: !1 },
15
15
  parentList: { type: [Array, null], required: !1 },
@@ -19,32 +19,32 @@ const j = /* @__PURE__ */ _({
19
19
  subFormColIndex: { type: Number, required: !1 }
20
20
  },
21
21
  setup(u, { expose: s }) {
22
- const { dispatch: a } = q(), e = u, {
23
- rules: m,
22
+ const { dispatch: l } = q(), e = u, {
23
+ rules: a,
24
24
  i18nt: r,
25
25
  field: t,
26
26
  fieldModel: i,
27
- isReadMode: p,
28
- size: l,
27
+ isReadMode: m,
28
+ size: p,
29
29
  handleHidden: f,
30
30
  handleDisabled: c,
31
- handleFocusCustomEvent: b,
32
- handleBlurCustomEvent: y,
33
- getWidgetRef: d,
34
- getFormRef: n,
35
- getPropName: g
31
+ handleFocusCustomEvent: y,
32
+ handleBlurCustomEvent: g,
33
+ getWidgetRef: n,
34
+ getFormRef: d,
35
+ getPropName: b
36
36
  } = x(e);
37
37
  s({
38
38
  i18nt: r,
39
39
  field: t,
40
40
  fieldModel: i,
41
- getFormRef: n,
42
- getWidgetRef: d
41
+ getFormRef: d,
42
+ getWidgetRef: n
43
43
  });
44
- const o = { dispatch: a, props: e, rules: m, i18nt: r, field: t, fieldModel: i, isReadMode: p, size: l, handleHidden: f, handleDisabled: c, handleFocusCustomEvent: b, handleBlurCustomEvent: y, getWidgetRef: d, getFormRef: n, getPropName: g, FormItemWrapper: F };
44
+ const o = { dispatch: l, props: e, rules: a, i18nt: r, field: t, fieldModel: i, isReadMode: m, size: p, handleHidden: f, handleDisabled: c, handleFocusCustomEvent: y, handleBlurCustomEvent: g, getWidgetRef: n, getFormRef: d, getPropName: b, FormItemWrapper: F };
45
45
  return Object.defineProperty(o, "__isScriptSetup", { enumerable: !1, value: !0 }), o;
46
46
  }
47
47
  });
48
48
  export {
49
- j as default
49
+ I as default
50
50
  };
@@ -1,14 +1,14 @@
1
1
  import { defineComponent as g, computed as q } from "vue";
2
2
  import F from "./form-item-wrapper.vue.js";
3
3
  import { useField as x } from "./useField.js";
4
- import { ComponentNameEnum as E, WidgetTypeEnum as j } from "../../../../constants/WidgetTypeEnum.js";
5
- const R = /* @__PURE__ */ g({
6
- name: j.timeRange,
4
+ import { ComponentNameEnum as E, WidgetTypeEnum as v } from "../../../../constants/WidgetTypeEnum.js";
5
+ const w = /* @__PURE__ */ g({
6
+ name: v.timeRange,
7
7
  componentName: E.FieldWidget,
8
8
  __name: "time-range-widget",
9
9
  props: {
10
- widget: { type: Object, required: !0 },
11
- field: { type: Object, required: !0 },
10
+ widget: { type: null, required: !0 },
11
+ field: { type: null, required: !0 },
12
12
  designer: { type: null, required: !1 },
13
13
  parentWidget: { type: [Object, null], required: !1 },
14
14
  parentList: { type: [Array, null], required: !1 },
@@ -20,16 +20,16 @@ const R = /* @__PURE__ */ g({
20
20
  setup(i, { expose: o }) {
21
21
  const r = i, {
22
22
  rules: u,
23
- i18nt: s,
24
- fieldEditor: l,
23
+ i18nt: l,
24
+ fieldEditor: s,
25
25
  field: a,
26
26
  fieldModel: e,
27
27
  isReadMode: p,
28
28
  size: m,
29
29
  handleHidden: f,
30
30
  handleDisabled: c,
31
- handleFocusCustomEvent: b,
32
- handleBlurCustomEvent: y,
31
+ handleFocusCustomEvent: y,
32
+ handleBlurCustomEvent: b,
33
33
  defineExposed: t
34
34
  } = x(r), _ = q(() => {
35
35
  var d;
@@ -38,10 +38,10 @@ const R = /* @__PURE__ */ g({
38
38
  o({
39
39
  ...t
40
40
  });
41
- const n = { props: r, rules: u, i18nt: s, fieldEditor: l, field: a, fieldModel: e, isReadMode: p, size: m, handleHidden: f, handleDisabled: c, handleFocusCustomEvent: b, handleBlurCustomEvent: y, defineExposed: t, contentForReadMode: _, FormItemWrapper: F };
41
+ const n = { props: r, rules: u, i18nt: l, fieldEditor: s, field: a, fieldModel: e, isReadMode: p, size: m, handleHidden: f, handleDisabled: c, handleFocusCustomEvent: y, handleBlurCustomEvent: b, defineExposed: t, contentForReadMode: _, FormItemWrapper: F };
42
42
  return Object.defineProperty(n, "__isScriptSetup", { enumerable: !1, value: !0 }), n;
43
43
  }
44
44
  });
45
45
  export {
46
- R as default
46
+ w as default
47
47
  };
@@ -1,15 +1,15 @@
1
1
  import { defineComponent as p, computed as a } from "vue";
2
2
  import m from "../RenderWigetList.vue.js";
3
- import u from "./container-wrapper.vue.js";
4
- import { ComponentNameEnum as g, ContainerTypeEnum as s } from "../../../constants/WidgetTypeEnum.js";
5
- const y = /* @__PURE__ */ p({
3
+ import g from "./container-wrapper.vue.js";
4
+ import { ComponentNameEnum as u, ContainerTypeEnum as s } from "../../../constants/WidgetTypeEnum.js";
5
+ const c = /* @__PURE__ */ p({
6
6
  name: s.VfBoxWidget,
7
- componentName: g.VfBoxWidget,
7
+ componentName: u.VfBoxWidget,
8
8
  __name: "vf-box-widget",
9
9
  props: {
10
- widget: { type: null, required: !0 },
11
- field: { type: null, required: !0 },
12
- parentWidget: { type: null, required: !0 },
10
+ widget: { type: Object, required: !0 },
11
+ field: { type: Object, required: !0 },
12
+ parentWidget: { type: [Object, null], required: !0 },
13
13
  parentList: { type: Array, required: !0 },
14
14
  indexOfParentList: { type: Number, required: !1 },
15
15
  subFormRowIndex: { type: Number, required: !1 },
@@ -20,10 +20,10 @@ const y = /* @__PURE__ */ p({
20
20
  const t = i, n = a(() => {
21
21
  const e = t.widget.options.boxModel || {}, r = {};
22
22
  return e.borderShow && (r.borderRadius = `${e.borderRadius}px`, r.border = `${e.borderStyle} ${e.borderWidth}px ${e.borderColor}`), (e.paddingTop !== void 0 || e.paddingRight !== void 0 || e.paddingBottom !== void 0 || e.paddingLeft !== void 0) && (r.padding = `${e.paddingTop || 0}px ${e.paddingRight || 0}px ${e.paddingBottom || 0}px ${e.paddingLeft || 0}px`), (e.marginTop !== void 0 || e.marginRight !== void 0 || e.marginBottom !== void 0 || e.marginLeft !== void 0) && (r.margin = `${e.marginTop || 0}px ${e.marginRight || 0}px ${e.marginBottom || 0}px ${e.marginLeft || 0}px`), r;
23
- }), o = { props: t, boxStyle: n, RenderWigetList: m, ContainerWrapper: u };
23
+ }), o = { props: t, boxStyle: n, RenderWigetList: m, ContainerWrapper: g };
24
24
  return Object.defineProperty(o, "__isScriptSetup", { enumerable: !1, value: !0 }), o;
25
25
  }
26
26
  });
27
27
  export {
28
- y as default
28
+ c as default
29
29
  };
@@ -1,23 +1,23 @@
1
- import { defineAsyncComponent as l, createApp as a, createVNode as C, mergeProps as i } from "vue";
2
- const y = (n, t) => {
1
+ import { defineAsyncComponent as l, createApp as i, createVNode as a, mergeProps as C } from "vue";
2
+ const g = (t, n) => {
3
3
  const {
4
4
  type: c,
5
5
  formCode: m,
6
- ...d
7
- } = n, o = document.createElement("div");
8
- document.body.appendChild(o);
9
- const p = l(() => import("./CustomerModal.vue.js")), r = (s) => {
10
- s.unmount(), o.remove();
11
- }, e = a(C(p, i({
6
+ ...r
7
+ } = t, e = document.createElement("div");
8
+ document.body.appendChild(e);
9
+ const s = l(() => import("./CustomerModal.vue.js")), d = (p) => {
10
+ p.unmount(), e.remove();
11
+ }, o = i(a(s, C({
12
12
  type: c,
13
13
  formCode: m
14
14
  }, {
15
15
  onCancel: () => {
16
- console.log("cancel"), r(e);
16
+ d(o);
17
17
  }
18
- }, d), null));
19
- e._context.components = t._context.components, e.mount(o);
18
+ }, r), null));
19
+ o._context.components = n._context.components, o._context.config.globalProperties = n._context.config.globalProperties, o.mount(e);
20
20
  };
21
21
  export {
22
- y as openCustomerModal
22
+ g as openCustomerModal
23
23
  };