@kp-ui/lowcode 2.15.0-alpha.12 → 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.12",
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
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() {
@@ -1,14 +1,14 @@
1
- import { defineComponent as b } from "vue";
2
- import c from "./form-item-wrapper.vue.js";
1
+ import { defineComponent as c } from "vue";
2
+ import y from "./form-item-wrapper.vue.js";
3
3
  import { useField as _ } from "./useField.js";
4
4
  import { ComponentNameEnum as q, WidgetTypeEnum as g } from "../../../../constants/WidgetTypeEnum.js";
5
- const N = /* @__PURE__ */ b({
5
+ const N = /* @__PURE__ */ c({
6
6
  name: g.time,
7
7
  componentName: q.FieldWidget,
8
8
  __name: "time-widget",
9
9
  props: {
10
- widget: { type: null, required: !0 },
11
- field: { type: null, required: !0 },
10
+ widget: { type: Object, required: !0 },
11
+ field: { type: Object, 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 },
@@ -17,24 +17,24 @@ const N = /* @__PURE__ */ b({
17
17
  subFormRowId: { type: String, required: !1 },
18
18
  subFormColIndex: { type: Number, required: !1 }
19
19
  },
20
- setup(n, { expose: i }) {
21
- const e = n, {
22
- rules: d,
23
- i18nt: u,
24
- field: o,
25
- fieldModel: l,
26
- isReadMode: s,
27
- size: p,
20
+ setup(i, { expose: d }) {
21
+ const e = i, {
22
+ rules: n,
23
+ i18nt: o,
24
+ field: u,
25
+ fieldModel: s,
26
+ isReadMode: p,
27
+ size: l,
28
28
  handleHidden: m,
29
29
  handleDisabled: a,
30
30
  handleFocusCustomEvent: f,
31
- handleBlurCustomEvent: y,
31
+ handleBlurCustomEvent: b,
32
32
  defineExposed: r
33
33
  } = _(e);
34
- i({
34
+ d({
35
35
  ...r
36
36
  });
37
- const t = { props: e, rules: d, i18nt: u, field: o, fieldModel: l, isReadMode: s, size: p, handleHidden: m, handleDisabled: a, handleFocusCustomEvent: f, handleBlurCustomEvent: y, defineExposed: r, FormItemWrapper: c };
37
+ const t = { props: e, rules: n, i18nt: o, field: u, fieldModel: s, isReadMode: p, size: l, handleHidden: m, handleDisabled: a, handleFocusCustomEvent: f, handleBlurCustomEvent: b, defineExposed: r, FormItemWrapper: y };
38
38
  return Object.defineProperty(t, "__isScriptSetup", { enumerable: !1, value: !0 }), t;
39
39
  }
40
40
  });