@ibiz-template/vue3-components 0.7.24-alpha.2 → 0.7.24

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.
Files changed (46) hide show
  1. package/dist/{index-UoIBnm4j.js → index-XTX4vyZZ.js} +3 -3
  2. package/dist/index.min.css +1 -1
  3. package/dist/index.system.min.js +1 -1
  4. package/dist/{xlsx-util-mYK_A5hQ.js → xlsx-util-aO-rYvlt.js} +1 -1
  5. package/es/common/grid-setting/grid-setting.d.ts +1 -0
  6. package/es/control/tree/el-tree-util.d.ts +0 -16
  7. package/es/control/tree/index.d.ts +0 -16
  8. package/es/control/tree/tree.d.ts +0 -16
  9. package/es/editor/check-box/check-box-editor.provider.mjs +1 -1
  10. package/es/editor/check-box/ibiz-checkbox/ibiz-checkbox.mjs +7 -2
  11. package/es/editor/check-box-list/ibiz-checkbox-list/ibiz-checkbox-list.mjs +7 -2
  12. package/es/editor/data-picker/ibiz-picker-link/ibiz-picker-link.mjs +7 -2
  13. package/es/editor/list-box/ibiz-list-box/ibiz-list-box.mjs +7 -2
  14. package/es/editor/number-range/ibiz-number-range-picker/ibiz-number-range-picker.mjs +12 -10
  15. package/es/editor/radio-button-list/ibiz-radio/ibiz-radio.mjs +7 -2
  16. package/es/editor/rate/ibiz-rate/ibiz-rate.mjs +7 -2
  17. package/es/editor/slider/ibiz-slider/ibiz-slider.mjs +7 -2
  18. package/es/editor/span/span/span.d.ts +6 -0
  19. package/es/editor/span/span/span.mjs +11 -6
  20. package/es/editor/text-box/input/input.d.ts +35 -0
  21. package/es/editor/text-box/input/input.mjs +30 -3
  22. package/es/editor/text-box/text-box-editor.controller.d.ts +10 -3
  23. package/es/editor/text-box/text-box-editor.controller.mjs +13 -2
  24. package/es/editor/upload/ibiz-file-upload/ibiz-file-upload.mjs +7 -2
  25. package/es/editor/upload/ibiz-image-upload/ibiz-image-upload.mjs +7 -2
  26. package/es/locale/en/index.d.ts +1 -0
  27. package/es/locale/zh-CN/index.d.ts +1 -0
  28. package/es/node_modules/.pnpm/{element-plus@2.7.5_vue@3.3.8 → element-plus@2.4.4_vue@3.3.8}/node_modules/element-plus/dist/locale/zh-cn.mjs +1 -14
  29. package/es/web-app/create-vue-app.mjs +1 -1
  30. package/lib/editor/check-box/check-box-editor.provider.cjs +1 -1
  31. package/lib/editor/check-box/ibiz-checkbox/ibiz-checkbox.cjs +6 -1
  32. package/lib/editor/check-box-list/ibiz-checkbox-list/ibiz-checkbox-list.cjs +6 -1
  33. package/lib/editor/data-picker/ibiz-picker-link/ibiz-picker-link.cjs +6 -1
  34. package/lib/editor/list-box/ibiz-list-box/ibiz-list-box.cjs +6 -1
  35. package/lib/editor/number-range/ibiz-number-range-picker/ibiz-number-range-picker.cjs +11 -9
  36. package/lib/editor/radio-button-list/ibiz-radio/ibiz-radio.cjs +6 -1
  37. package/lib/editor/rate/ibiz-rate/ibiz-rate.cjs +6 -1
  38. package/lib/editor/slider/ibiz-slider/ibiz-slider.cjs +6 -1
  39. package/lib/editor/span/span/span.cjs +11 -6
  40. package/lib/editor/text-box/input/input.cjs +28 -1
  41. package/lib/editor/text-box/text-box-editor.controller.cjs +12 -1
  42. package/lib/editor/upload/ibiz-file-upload/ibiz-file-upload.cjs +6 -1
  43. package/lib/editor/upload/ibiz-image-upload/ibiz-image-upload.cjs +6 -1
  44. package/lib/node_modules/.pnpm/{element-plus@2.7.5_vue@3.3.8 → element-plus@2.4.4_vue@3.3.8}/node_modules/element-plus/dist/locale/zh-cn.cjs +1 -14
  45. package/lib/web-app/create-vue-app.cjs +1 -1
  46. package/package.json +8 -8
@@ -1,5 +1,5 @@
1
- import { isVNode, ref, computed, watch, onUnmounted, createVNode, resolveComponent, mergeProps, defineComponent } from 'vue';
2
- import { getInputProps, getEditorEmits, useNamespace } from '@ibiz-template/vue3-util';
1
+ import { isVNode, ref, computed, watch, onUnmounted, resolveComponent, createVNode, mergeProps, defineComponent } from 'vue';
2
+ import { getInputProps, getEditorEmits, useNamespace, useCodeListListen } from '@ibiz-template/vue3-util';
3
3
  import { createUUID } from 'qx-util';
4
4
  import './input.css';
5
5
 
@@ -208,11 +208,29 @@ const IBizInput = /* @__PURE__ */ defineComponent({
208
208
  const shouldAutoComplete = computed(() => {
209
209
  return c.model.editorParams && c.model.editorParams.autocomplete && c.toBoolean(c.model.editorParams.autocomplete) ? "on" : "new-password";
210
210
  });
211
+ const items = ref([]);
212
+ if (c.codeList) {
213
+ watch(() => props.data, (newVal) => {
214
+ c.loadCodeList(newVal).then((_codeList) => {
215
+ items.value = _codeList;
216
+ });
217
+ }, {
218
+ immediate: true,
219
+ deep: true
220
+ });
221
+ }
222
+ const fn = (data) => {
223
+ if (data) {
224
+ items.value = data;
225
+ }
226
+ };
227
+ useCodeListListen(c.model.appCodeListId, c.context.srfappid, fn);
211
228
  return {
212
229
  c,
213
230
  ns,
214
231
  rows,
215
232
  type,
233
+ items,
216
234
  currentVal,
217
235
  readonlyText,
218
236
  handleChange,
@@ -241,7 +259,16 @@ const IBizInput = /* @__PURE__ */ defineComponent({
241
259
  } = this.c.model;
242
260
  let content = null;
243
261
  if (this.readonly) {
244
- content = this.readonlyText;
262
+ if (this.c.codeList) {
263
+ content = createVNode(resolveComponent("iBizCodeList"), {
264
+ "codeListItems": this.items,
265
+ "codeList": this.c.codeList,
266
+ "value": this.currentVal,
267
+ "convertToCodeItemText": this.c.convertToCodeItemText
268
+ }, null);
269
+ } else {
270
+ content = this.readonlyText;
271
+ }
245
272
  } else {
246
273
  const slots = {};
247
274
  if (unitName) {
@@ -1,5 +1,5 @@
1
- import { EditorController, IAppDEService } from '@ibiz-template/runtime';
2
- import { IAppDEACMode, IDEACModeDataItem, ITextBox } from '@ibiz/model-core';
1
+ import { CodeListEditorController, IAppDEService } from '@ibiz-template/runtime';
2
+ import { IAppCodeList, IAppDEACMode, IDEACModeDataItem, ITextBox } from '@ibiz/model-core';
3
3
  /**
4
4
  * 输入框编辑器控制器
5
5
  *
@@ -9,7 +9,7 @@ import { IAppDEACMode, IDEACModeDataItem, ITextBox } from '@ibiz/model-core';
9
9
  * @class TextBoxEditorController
10
10
  * @extends {EditorController}
11
11
  */
12
- export declare class TextBoxEditorController extends EditorController<ITextBox> {
12
+ export declare class TextBoxEditorController extends CodeListEditorController<ITextBox> {
13
13
  /**
14
14
  * 精度
15
15
  * @author lxm
@@ -73,5 +73,12 @@ export declare class TextBoxEditorController extends EditorController<ITextBox>
73
73
  * @type {boolean}
74
74
  */
75
75
  chatCompletion: boolean;
76
+ /**
77
+ * 代码表模型
78
+ * @return {*}
79
+ * @author: zhujiamin
80
+ * @Date: 2023-05-24 10:55:50
81
+ */
82
+ codeList: IAppCodeList | undefined;
76
83
  protected onInit(): Promise<void>;
77
84
  }
@@ -1,4 +1,4 @@
1
- import { EditorController, getDeACMode } from '@ibiz-template/runtime';
1
+ import { CodeListEditorController, getDeACMode } from '@ibiz-template/runtime';
2
2
  import { toNumber } from 'lodash-es';
3
3
 
4
4
  "use strict";
@@ -8,7 +8,7 @@ var __publicField = (obj, key, value) => {
8
8
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
9
9
  return value;
10
10
  };
11
- class TextBoxEditorController extends EditorController {
11
+ class TextBoxEditorController extends CodeListEditorController {
12
12
  constructor() {
13
13
  super(...arguments);
14
14
  /**
@@ -74,6 +74,13 @@ class TextBoxEditorController extends EditorController {
74
74
  * @type {boolean}
75
75
  */
76
76
  __publicField(this, "chatCompletion", false);
77
+ /**
78
+ * 代码表模型
79
+ * @return {*}
80
+ * @author: zhujiamin
81
+ * @Date: 2023-05-24 10:55:50
82
+ */
83
+ __publicField(this, "codeList");
77
84
  }
78
85
  async onInit() {
79
86
  await super.onInit();
@@ -121,6 +128,10 @@ class TextBoxEditorController extends EditorController {
121
128
  } else if (this.model.predefinedType === "AUTH_PASSWORD" && !this.placeHolder) {
122
129
  this.placeHolder = ibiz.i18n.t("app.pleaseEnterPassword");
123
130
  }
131
+ if (this.model.appCodeListId) {
132
+ const app = await ibiz.hub.getApp(this.context.srfappid);
133
+ this.codeList = app.codeList.getCodeList(this.model.appCodeListId);
134
+ }
124
135
  }
125
136
  }
126
137
 
@@ -1,5 +1,5 @@
1
1
  import { isVNode, computed, resolveComponent, mergeProps, createVNode, defineComponent } from 'vue';
2
- import { getUploadProps, getEditorEmits, useNamespace, useFocusAndBlur } from '@ibiz-template/vue3-util';
2
+ import { getUploadProps, getEditorEmits, useNamespace, useAutoFocusBlur, useFocusAndBlur } from '@ibiz-template/vue3-util';
3
3
  import './ibiz-file-upload.css';
4
4
  import { useIViewUpload } from '../use/use-iview-upload.mjs';
5
5
 
@@ -16,6 +16,10 @@ const IBizFileUpload = /* @__PURE__ */ defineComponent({
16
16
  }) {
17
17
  const ns = useNamespace("file-upload");
18
18
  const c = props.controller;
19
+ const {
20
+ useInFocusAndBlur,
21
+ useInValueChange
22
+ } = useAutoFocusBlur(props, emit);
19
23
  const {
20
24
  uploadUrl,
21
25
  headers,
@@ -28,6 +32,7 @@ const IBizFileUpload = /* @__PURE__ */ defineComponent({
28
32
  beforeUpload
29
33
  } = useIViewUpload(props, (value) => {
30
34
  emit("change", value);
35
+ useInValueChange();
31
36
  }, c);
32
37
  const noUploadIcon = computed(() => {
33
38
  var _a;
@@ -44,7 +49,7 @@ const IBizFileUpload = /* @__PURE__ */ defineComponent({
44
49
  });
45
50
  const {
46
51
  componentRef
47
- } = useFocusAndBlur(() => emit("focus"), () => emit("blur"));
52
+ } = useFocusAndBlur(() => emit("focus"), () => useInFocusAndBlur());
48
53
  return {
49
54
  ns,
50
55
  c,
@@ -1,5 +1,5 @@
1
1
  import { ref, computed, createVNode, resolveComponent, mergeProps, defineComponent } from 'vue';
2
- import { getUploadProps, getEditorEmits, useNamespace, useFocusAndBlur } from '@ibiz-template/vue3-util';
2
+ import { getUploadProps, getEditorEmits, useNamespace, useAutoFocusBlur, useFocusAndBlur } from '@ibiz-template/vue3-util';
3
3
  import './ibiz-image-upload.css';
4
4
  import { useIViewUpload } from '../use/use-iview-upload.mjs';
5
5
 
@@ -13,6 +13,10 @@ const IBizImageUpload = /* @__PURE__ */ defineComponent({
13
13
  }) {
14
14
  const ns = useNamespace("image-upload");
15
15
  const c = props.controller;
16
+ const {
17
+ useInFocusAndBlur,
18
+ useInValueChange
19
+ } = useAutoFocusBlur(props, emit);
16
20
  const {
17
21
  uploadUrl,
18
22
  headers,
@@ -25,6 +29,7 @@ const IBizImageUpload = /* @__PURE__ */ defineComponent({
25
29
  beforeUpload
26
30
  } = useIViewUpload(props, (value) => {
27
31
  emit("change", value);
32
+ useInValueChange();
28
33
  }, c);
29
34
  const dialogImageUrl = ref("");
30
35
  const dialogVisible = ref(false);
@@ -46,7 +51,7 @@ const IBizImageUpload = /* @__PURE__ */ defineComponent({
46
51
  });
47
52
  const {
48
53
  componentRef
49
- } = useFocusAndBlur(() => emit("focus"), () => emit("blur"));
54
+ } = useFocusAndBlur(() => emit("focus"), () => useInFocusAndBlur());
50
55
  return {
51
56
  ns,
52
57
  c,
@@ -51,6 +51,7 @@ declare const _default: {
51
51
  noConfiguredEntity: string;
52
52
  noReturnValue: string;
53
53
  noAttribute: string;
54
+ noConfiguredScript: string;
54
55
  noConfiguerdEntityBehanior: string;
55
56
  sessionView: string;
56
57
  viewStateAttribute: string;
@@ -51,6 +51,7 @@ declare const _default: {
51
51
  noConfiguredEntity: string;
52
52
  noReturnValue: string;
53
53
  noAttribute: string;
54
+ noConfiguredScript: string;
54
55
  noConfiguerdEntityBehanior: string;
55
56
  sessionView: string;
56
57
  viewStateAttribute: string;
@@ -1,11 +1,8 @@
1
- /*! Element Plus v2.7.5 */
1
+ /*! Element Plus v2.4.4 */
2
2
 
3
3
  var zhCn = {
4
4
  name: "zh-cn",
5
5
  el: {
6
- breadcrumb: {
7
- label: "\u9762\u5305\u5C51"
8
- },
9
6
  colorpicker: {
10
7
  confirm: "\u786E\u5B9A",
11
8
  clear: "\u6E05\u7A7A"
@@ -107,11 +104,6 @@ var zhCn = {
107
104
  clearFilter: "\u5168\u90E8",
108
105
  sumText: "\u5408\u8BA1"
109
106
  },
110
- tour: {
111
- next: "\u4E0B\u4E00\u6B65",
112
- previous: "\u4E0A\u4E00\u6B65",
113
- finish: "\u7ED3\u675F\u5BFC\u89C8"
114
- },
115
107
  tree: {
116
108
  emptyText: "\u6682\u65E0\u6570\u636E"
117
109
  },
@@ -132,11 +124,6 @@ var zhCn = {
132
124
  popconfirm: {
133
125
  confirmButtonText: "\u786E\u5B9A",
134
126
  cancelButtonText: "\u53D6\u6D88"
135
- },
136
- carousel: {
137
- leftArrow: "\u4E0A\u4E00\u5F20\u5E7B\u706F\u7247",
138
- rightArrow: "\u4E0B\u4E00\u5F20\u5E7B\u706F\u7247",
139
- indicator: "\u5E7B\u706F\u7247\u5207\u6362\u81F3\u7D22\u5F15 {index}"
140
127
  }
141
128
  }
142
129
  };
@@ -1,6 +1,6 @@
1
1
  import { createApp, KeepAlive } from 'vue';
2
2
  import ElementPlus from 'element-plus';
3
- import zhCn from '../node_modules/.pnpm/element-plus@2.7.5_vue@3.3.8/node_modules/element-plus/dist/locale/zh-cn.mjs';
3
+ import zhCn from '../node_modules/.pnpm/element-plus@2.4.4_vue@3.3.8/node_modules/element-plus/dist/locale/zh-cn.mjs';
4
4
  import { AppHooks, piniaInstance } from '@ibiz-template/vue3-util';
5
5
  import IBizVue3 from '../ibiz-vue3.mjs';
6
6
  import { i18n } from '../locale/index.mjs';
@@ -12,7 +12,7 @@ var __publicField = (obj, key, value) => {
12
12
  class CheckBoxEditorProvider {
13
13
  constructor() {
14
14
  __publicField(this, "formEditor", "IBizCheckbox");
15
- __publicField(this, "gridEditor", "IBizGridCheckbox");
15
+ __publicField(this, "gridEditor", "IBizCheckbox");
16
16
  }
17
17
  async createController(editorModel, parentController) {
18
18
  const c = new checkBoxEditor_controller.CheckBoxEditorController(editorModel, parentController);
@@ -30,6 +30,10 @@ const IBizCheckbox = /* @__PURE__ */ vue.defineComponent({
30
30
  }
31
31
  return false;
32
32
  });
33
+ const {
34
+ useInFocusAndBlur,
35
+ useInValueChange
36
+ } = vue3Util.useAutoFocusBlur(props, emit);
33
37
  const currentVal = vue.computed({
34
38
  get() {
35
39
  if (props.value == selectValue) {
@@ -45,11 +49,12 @@ const IBizCheckbox = /* @__PURE__ */ vue.defineComponent({
45
49
  value = nullValue;
46
50
  }
47
51
  emit("change", value);
52
+ useInValueChange();
48
53
  }
49
54
  });
50
55
  const {
51
56
  componentRef: editorRef
52
- } = vue3Util.useFocusAndBlur(() => emit("focus"), () => emit("blur"));
57
+ } = vue3Util.useFocusAndBlur(() => emit("focus"), () => useInFocusAndBlur());
53
58
  return {
54
59
  ns,
55
60
  editorModel,
@@ -50,6 +50,10 @@ const IBizCheckboxList = /* @__PURE__ */ vue.defineComponent({
50
50
  if (codeList && codeList.valueSeparator) {
51
51
  valueSeparator = codeList.valueSeparator;
52
52
  }
53
+ const {
54
+ useInFocusAndBlur,
55
+ useInValueChange
56
+ } = vue3Util.useAutoFocusBlur(props, emit);
53
57
  const selectArray = vue.computed({
54
58
  get() {
55
59
  if (!ramda.isNil(props.value)) {
@@ -112,6 +116,7 @@ const IBizCheckboxList = /* @__PURE__ */ vue.defineComponent({
112
116
  }
113
117
  }
114
118
  emit("change", value);
119
+ useInValueChange();
115
120
  }
116
121
  });
117
122
  const onSelectArrayChange = (value) => {
@@ -138,7 +143,7 @@ const IBizCheckboxList = /* @__PURE__ */ vue.defineComponent({
138
143
  });
139
144
  const {
140
145
  componentRef: editorRef
141
- } = vue3Util.useFocusAndBlur(() => emit("focus"), () => emit("blur"));
146
+ } = vue3Util.useFocusAndBlur(() => emit("focus"), () => useInFocusAndBlur());
142
147
  return {
143
148
  ns,
144
149
  items,
@@ -15,6 +15,10 @@ const IBizPickerLink = /* @__PURE__ */ vue.defineComponent({
15
15
  const ns = vue3Util.useNamespace("picker-link");
16
16
  const c = props.controller;
17
17
  const curValue = vue.ref("");
18
+ const {
19
+ useInFocusAndBlur,
20
+ useInValueChange
21
+ } = vue3Util.useAutoFocusBlur(props, emit);
18
22
  const showFormDefaultContent = vue.computed(() => {
19
23
  if (props.controlParams && props.controlParams.editmode === "hover" && !props.readonly) {
20
24
  return true;
@@ -47,6 +51,7 @@ const IBizPickerLink = /* @__PURE__ */ vue.defineComponent({
47
51
  } else {
48
52
  emit("change", data[c.textName]);
49
53
  }
54
+ useInValueChange();
50
55
  };
51
56
  const openLinkView = async () => {
52
57
  const res = await c.openLinkView(props.data);
@@ -56,7 +61,7 @@ const IBizPickerLink = /* @__PURE__ */ vue.defineComponent({
56
61
  };
57
62
  const {
58
63
  componentRef: editorRef
59
- } = vue3Util.useFocusAndBlur(() => emit("focus"), () => emit("blur"));
64
+ } = vue3Util.useFocusAndBlur(() => emit("focus"), () => useInFocusAndBlur());
60
65
  const valueText = vue.computed(() => {
61
66
  return vue3Util.renderString(curValue.value);
62
67
  });
@@ -25,6 +25,10 @@ const IBizListBox = /* @__PURE__ */ vue.defineComponent({
25
25
  multiple = c.toBoolean(editorModel.editorParams.multiple);
26
26
  }
27
27
  }
28
+ const {
29
+ useInFocusAndBlur,
30
+ useInValueChange
31
+ } = vue3Util.useAutoFocusBlur(props, emit);
28
32
  const showFormDefaultContent = vue.computed(() => {
29
33
  if (props.controlParams && props.controlParams.editmode === "hover" && !props.readonly) {
30
34
  return true;
@@ -140,10 +144,11 @@ const IBizListBox = /* @__PURE__ */ vue.defineComponent({
140
144
  _value = value;
141
145
  }
142
146
  emit("change", _value);
147
+ useInValueChange();
143
148
  };
144
149
  const {
145
150
  componentRef: editorRef
146
- } = vue3Util.useFocusAndBlur(() => emit("focus"), () => emit("blur"));
151
+ } = vue3Util.useFocusAndBlur(() => emit("focus"), () => useInFocusAndBlur());
147
152
  return {
148
153
  ns,
149
154
  items,
@@ -16,6 +16,10 @@ const IBizNumberRangePicker = /* @__PURE__ */ vue.defineComponent({
16
16
  const ns = vue3Util.useNamespace("number-range-picker");
17
17
  const c = props.controller;
18
18
  const editorModel = c.model;
19
+ const {
20
+ useInFocusAndBlur,
21
+ useInValueChange
22
+ } = vue3Util.useAutoFocusBlur(props, emit);
19
23
  let max = Infinity;
20
24
  let min = -Infinity;
21
25
  let precision = 0;
@@ -64,12 +68,6 @@ const IBizNumberRangePicker = /* @__PURE__ */ vue.defineComponent({
64
68
  }, {
65
69
  immediate: true
66
70
  });
67
- vue.watch(editorRef, (newVal) => {
68
- if (props.autoFocus && newVal) {
69
- const input = newVal.$el.getElementsByTagName("input")[0];
70
- input.focus();
71
- }
72
- });
73
71
  const setEditable = (flag) => {
74
72
  if (flag) {
75
73
  isEditable.value = flag;
@@ -88,22 +86,26 @@ const IBizNumberRangePicker = /* @__PURE__ */ vue.defineComponent({
88
86
  if (minValue.value !== null && maxValue.value !== null) {
89
87
  emit("change", [minValue.value, maxValue.value].join(valueSeparator));
90
88
  setEditable(false);
89
+ useInValueChange();
91
90
  }
92
91
  if (refFormItem.value) {
93
92
  const valueName = refFormItem.value[index];
94
93
  emit("change", value, valueName);
94
+ useInValueChange();
95
95
  }
96
96
  };
97
97
  const {
98
98
  componentRef
99
- } = vue3Util.useFocusAndBlur(() => emit("focus"), () => emit("blur"));
99
+ } = vue3Util.useFocusAndBlur(() => emit("focus"), () => useInFocusAndBlur());
100
100
  const onFocus = (e) => {
101
101
  emit("focus", e);
102
102
  setEditable(true);
103
103
  };
104
104
  const onBlur = (e) => {
105
- emit("blur", e);
106
- setEditable(false);
105
+ if (minValue.value !== null && maxValue.value !== null) {
106
+ emit("blur", e);
107
+ setEditable(false);
108
+ }
107
109
  };
108
110
  const handleKeyUp = (e) => {
109
111
  if (e && e.code === "Enter") {
@@ -29,8 +29,13 @@ const IBizRadio = /* @__PURE__ */ vue.defineComponent({
29
29
  isBtnRoundCorner = c.toBoolean(editorModel.editorParams.isBtnRoundCorner);
30
30
  }
31
31
  }
32
+ const {
33
+ useInFocusAndBlur,
34
+ useInValueChange
35
+ } = vue3Util.useAutoFocusBlur(props, emit);
32
36
  const onSelectValueChange = (value) => {
33
37
  emit("change", value);
38
+ useInValueChange();
34
39
  };
35
40
  const items = vue.ref([]);
36
41
  vue.watch(() => props.data, (newVal) => {
@@ -66,7 +71,7 @@ const IBizRadio = /* @__PURE__ */ vue.defineComponent({
66
71
  });
67
72
  const {
68
73
  componentRef: editorRef
69
- } = vue3Util.useFocusAndBlur(() => emit("focus"), () => emit("blur"));
74
+ } = vue3Util.useFocusAndBlur(() => emit("focus"), () => useInFocusAndBlur());
70
75
  return {
71
76
  ns,
72
77
  editorModel,
@@ -17,6 +17,10 @@ const IBizRate = /* @__PURE__ */ vue.defineComponent({
17
17
  const currentVal = vue.ref();
18
18
  const c = props.controller;
19
19
  const editorModel = c.model;
20
+ const {
21
+ useInFocusAndBlur,
22
+ useInValueChange
23
+ } = vue3Util.useAutoFocusBlur(props, emit);
20
24
  let colors = [];
21
25
  let showText = false;
22
26
  let max = 5;
@@ -54,10 +58,11 @@ const IBizRate = /* @__PURE__ */ vue.defineComponent({
54
58
  });
55
59
  const handleChange = (currentValue) => {
56
60
  emit("change", currentValue);
61
+ useInValueChange();
57
62
  };
58
63
  const {
59
64
  componentRef: editorRef
60
- } = vue3Util.useFocusAndBlur(() => emit("focus"), () => emit("blur"));
65
+ } = vue3Util.useFocusAndBlur(() => emit("focus"), () => useInFocusAndBlur());
61
66
  return {
62
67
  ns,
63
68
  currentVal,
@@ -16,6 +16,10 @@ const IBizSlider = /* @__PURE__ */ vue.defineComponent({
16
16
  const ns = vue3Util.useNamespace("slider");
17
17
  const c = props.controller;
18
18
  const editorModel = c.model;
19
+ const {
20
+ useInFocusAndBlur,
21
+ useInValueChange
22
+ } = vue3Util.useAutoFocusBlur(props, emit);
19
23
  let step = 1;
20
24
  let max = 100;
21
25
  let min = 0;
@@ -88,10 +92,11 @@ const IBizSlider = /* @__PURE__ */ vue.defineComponent({
88
92
  } else {
89
93
  emit("change", currentValue);
90
94
  }
95
+ useInValueChange();
91
96
  };
92
97
  const {
93
98
  componentRef: editorRef
94
- } = vue3Util.useFocusAndBlur(() => emit("focus"), () => emit("blur"));
99
+ } = vue3Util.useFocusAndBlur(() => emit("focus"), () => useInFocusAndBlur());
95
100
  return {
96
101
  ns,
97
102
  currentVal,
@@ -27,6 +27,11 @@ const IBizSpan = /* @__PURE__ */ vue.defineComponent({
27
27
  const c = props.controller;
28
28
  const text = vue.ref("");
29
29
  const codeList = c.codeList;
30
+ const {
31
+ valueFormat,
32
+ dataType,
33
+ unitName
34
+ } = c.parent;
30
35
  const textSeparator = c.model.textSeparator || ((_a = c.editorParams) == null ? void 0 : _a.TEXTSEPARATOR) || ",";
31
36
  vue.watch(() => props.value, (newVal, oldVal) => {
32
37
  if (newVal !== oldVal) {
@@ -34,11 +39,6 @@ const IBizSpan = /* @__PURE__ */ vue.defineComponent({
34
39
  text.value = "";
35
40
  return;
36
41
  }
37
- const {
38
- valueFormat,
39
- dataType,
40
- unitName
41
- } = c.parent;
42
42
  if (c.model.valueType === "SIMPLES") {
43
43
  text.value = newVal.join(textSeparator);
44
44
  } else if (c.model.valueType === "OBJECT") {
@@ -118,6 +118,8 @@ const IBizSpan = /* @__PURE__ */ vue.defineComponent({
118
118
  text,
119
119
  editorRef,
120
120
  items,
121
+ valueFormat,
122
+ unitName,
121
123
  showFormDefaultContent
122
124
  };
123
125
  },
@@ -128,7 +130,10 @@ const IBizSpan = /* @__PURE__ */ vue.defineComponent({
128
130
  "class": this.ns.e("code-list"),
129
131
  "codeListItems": this.items,
130
132
  "codeList": this.c.codeList,
131
- "value": this.text
133
+ "value": this.value,
134
+ "valueFormat": this.valueFormat,
135
+ "unitName": this.unitName,
136
+ "convertToCodeItemText": this.c.convertToCodeItemText
132
137
  }, null);
133
138
  } else if (this.text) {
134
139
  content = this.text;
@@ -210,11 +210,29 @@ const IBizInput = /* @__PURE__ */ vue.defineComponent({
210
210
  const shouldAutoComplete = vue.computed(() => {
211
211
  return c.model.editorParams && c.model.editorParams.autocomplete && c.toBoolean(c.model.editorParams.autocomplete) ? "on" : "new-password";
212
212
  });
213
+ const items = vue.ref([]);
214
+ if (c.codeList) {
215
+ vue.watch(() => props.data, (newVal) => {
216
+ c.loadCodeList(newVal).then((_codeList) => {
217
+ items.value = _codeList;
218
+ });
219
+ }, {
220
+ immediate: true,
221
+ deep: true
222
+ });
223
+ }
224
+ const fn = (data) => {
225
+ if (data) {
226
+ items.value = data;
227
+ }
228
+ };
229
+ vue3Util.useCodeListListen(c.model.appCodeListId, c.context.srfappid, fn);
213
230
  return {
214
231
  c,
215
232
  ns,
216
233
  rows,
217
234
  type,
235
+ items,
218
236
  currentVal,
219
237
  readonlyText,
220
238
  handleChange,
@@ -243,7 +261,16 @@ const IBizInput = /* @__PURE__ */ vue.defineComponent({
243
261
  } = this.c.model;
244
262
  let content = null;
245
263
  if (this.readonly) {
246
- content = this.readonlyText;
264
+ if (this.c.codeList) {
265
+ content = vue.createVNode(vue.resolveComponent("iBizCodeList"), {
266
+ "codeListItems": this.items,
267
+ "codeList": this.c.codeList,
268
+ "value": this.currentVal,
269
+ "convertToCodeItemText": this.c.convertToCodeItemText
270
+ }, null);
271
+ } else {
272
+ content = this.readonlyText;
273
+ }
247
274
  } else {
248
275
  const slots = {};
249
276
  if (unitName) {
@@ -10,7 +10,7 @@ var __publicField = (obj, key, value) => {
10
10
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
11
11
  return value;
12
12
  };
13
- class TextBoxEditorController extends runtime.EditorController {
13
+ class TextBoxEditorController extends runtime.CodeListEditorController {
14
14
  constructor() {
15
15
  super(...arguments);
16
16
  /**
@@ -76,6 +76,13 @@ class TextBoxEditorController extends runtime.EditorController {
76
76
  * @type {boolean}
77
77
  */
78
78
  __publicField(this, "chatCompletion", false);
79
+ /**
80
+ * 代码表模型
81
+ * @return {*}
82
+ * @author: zhujiamin
83
+ * @Date: 2023-05-24 10:55:50
84
+ */
85
+ __publicField(this, "codeList");
79
86
  }
80
87
  async onInit() {
81
88
  await super.onInit();
@@ -123,6 +130,10 @@ class TextBoxEditorController extends runtime.EditorController {
123
130
  } else if (this.model.predefinedType === "AUTH_PASSWORD" && !this.placeHolder) {
124
131
  this.placeHolder = ibiz.i18n.t("app.pleaseEnterPassword");
125
132
  }
133
+ if (this.model.appCodeListId) {
134
+ const app = await ibiz.hub.getApp(this.context.srfappid);
135
+ this.codeList = app.codeList.getCodeList(this.model.appCodeListId);
136
+ }
126
137
  }
127
138
  }
128
139
 
@@ -18,6 +18,10 @@ const IBizFileUpload = /* @__PURE__ */ vue.defineComponent({
18
18
  }) {
19
19
  const ns = vue3Util.useNamespace("file-upload");
20
20
  const c = props.controller;
21
+ const {
22
+ useInFocusAndBlur,
23
+ useInValueChange
24
+ } = vue3Util.useAutoFocusBlur(props, emit);
21
25
  const {
22
26
  uploadUrl,
23
27
  headers,
@@ -30,6 +34,7 @@ const IBizFileUpload = /* @__PURE__ */ vue.defineComponent({
30
34
  beforeUpload
31
35
  } = useIviewUpload.useIViewUpload(props, (value) => {
32
36
  emit("change", value);
37
+ useInValueChange();
33
38
  }, c);
34
39
  const noUploadIcon = vue.computed(() => {
35
40
  var _a;
@@ -46,7 +51,7 @@ const IBizFileUpload = /* @__PURE__ */ vue.defineComponent({
46
51
  });
47
52
  const {
48
53
  componentRef
49
- } = vue3Util.useFocusAndBlur(() => emit("focus"), () => emit("blur"));
54
+ } = vue3Util.useFocusAndBlur(() => emit("focus"), () => useInFocusAndBlur());
50
55
  return {
51
56
  ns,
52
57
  c,