@ibiz-template/vue3-components 0.5.7-alpha.4 → 0.5.7-alpha.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/index--KqYDzjn.js +2 -0
  2. package/dist/index.min.css +1 -1
  3. package/dist/index.system.min.js +1 -1
  4. package/dist/{xlsx-util-kzUgnbtt.js → xlsx-util-74o5wGKy.js} +1 -1
  5. package/es/control/dashboard/custom-dashboard-container/custom-dashboard-container.d.ts +236 -0
  6. package/es/control/dashboard/dashboard-design/dashboard-design.d.ts +2 -0
  7. package/es/control/form/form-detail/form-button/form-button.mjs +2 -1
  8. package/es/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-grid/repeater-grid.d.ts +2124 -0
  9. package/es/control/grid/grid/grid-control.util.mjs +4 -0
  10. package/es/control/search-bar/filter-tree/filter-tree.d.ts +45 -14
  11. package/es/control/search-bar/filter-tree/filter-tree.mjs +42 -21
  12. package/es/control/search-bar/search-bar.mjs +8 -2
  13. package/es/editor/index.mjs +8 -0
  14. package/es/editor/span/span/span.d.ts +2 -0
  15. package/es/editor/text-box/ibiz-input-number/ibiz-input-number.mjs +2 -2
  16. package/es/editor/user/ibiz-searchcond-edit/ibiz-searchcond-edit.controller.d.ts +46 -0
  17. package/es/editor/user/ibiz-searchcond-edit/ibiz-searchcond-edit.controller.mjs +93 -0
  18. package/es/editor/user/ibiz-searchcond-edit/ibiz-searchcond-edit.css +1 -0
  19. package/es/editor/user/ibiz-searchcond-edit/ibiz-searchcond-edit.d.ts +81 -0
  20. package/es/editor/user/ibiz-searchcond-edit/ibiz-searchcond-edit.mjs +187 -0
  21. package/es/editor/user/ibiz-searchcond-edit/ibiz-searchcond-edit.provider.d.ts +17 -0
  22. package/es/editor/user/ibiz-searchcond-edit/ibiz-searchcond-edit.provider.mjs +22 -0
  23. package/es/editor/user/ibiz-searchcond-edit/index.d.ts +3 -0
  24. package/es/editor/user/ibiz-searchcond-edit/index.mjs +5 -0
  25. package/es/editor/user/index.d.ts +1 -0
  26. package/es/editor/user/index.mjs +6 -0
  27. package/es/panel-component/user-message/internal-message/internal-message-default/internal-message-default.css +1 -1
  28. package/es/panel-component/user-message/internal-message/internal-message-json/internal-message-json.css +1 -1
  29. package/lib/control/form/form-detail/form-button/form-button.cjs +2 -1
  30. package/lib/control/grid/grid/grid-control.util.cjs +4 -0
  31. package/lib/control/search-bar/filter-tree/filter-tree.cjs +41 -20
  32. package/lib/control/search-bar/search-bar.cjs +8 -2
  33. package/lib/editor/index.cjs +8 -0
  34. package/lib/editor/text-box/ibiz-input-number/ibiz-input-number.cjs +2 -2
  35. package/lib/editor/user/ibiz-searchcond-edit/ibiz-searchcond-edit.cjs +189 -0
  36. package/lib/editor/user/ibiz-searchcond-edit/ibiz-searchcond-edit.controller.cjs +95 -0
  37. package/lib/editor/user/ibiz-searchcond-edit/ibiz-searchcond-edit.css +1 -0
  38. package/lib/editor/user/ibiz-searchcond-edit/ibiz-searchcond-edit.provider.cjs +24 -0
  39. package/lib/editor/user/ibiz-searchcond-edit/index.cjs +11 -0
  40. package/lib/editor/user/index.cjs +12 -0
  41. package/lib/panel-component/user-message/internal-message/internal-message-default/internal-message-default.css +1 -1
  42. package/lib/panel-component/user-message/internal-message/internal-message-json/internal-message-json.css +1 -1
  43. package/package.json +6 -6
  44. package/dist/index-knHzHtox.js +0 -2
@@ -0,0 +1,187 @@
1
+ import { ref, computed, watch, resolveComponent, createVNode, defineComponent } from 'vue';
2
+ import { getInputProps, getEditorEmits, useNamespace } from '@ibiz-template/vue3-util';
3
+ import './ibiz-searchcond-edit.css';
4
+ import { isNilOrEmpty } from 'qx-util';
5
+ import { getOriginFilterNodes, parseFilters, calcSearchConds } from '@ibiz-template/runtime';
6
+
7
+ "use strict";
8
+ const IBizSearchCondEdit = /* @__PURE__ */ defineComponent({
9
+ name: "IBizSearchCondEdit",
10
+ props: getInputProps(),
11
+ emits: getEditorEmits(),
12
+ setup(props, {
13
+ emit
14
+ }) {
15
+ const ns = useNamespace("searchcond-edit");
16
+ const c = props.controller;
17
+ const currentVal = ref(null);
18
+ const isEditable = ref(false);
19
+ const editorRef = ref();
20
+ const filterNodes = ref([]);
21
+ const filterButtonRef = ref();
22
+ let popover;
23
+ const showFormDefaultContent = computed(() => {
24
+ if (props.controlParams && props.controlParams.editmode === "hover") {
25
+ return true;
26
+ }
27
+ return false;
28
+ });
29
+ watch(() => props.value, (newVal, oldVal) => {
30
+ if (newVal !== oldVal) {
31
+ if (newVal == null) {
32
+ currentVal.value = "";
33
+ filterNodes.value = getOriginFilterNodes();
34
+ } else if (typeof newVal === "string") {
35
+ currentVal.value = newVal;
36
+ if (newVal) {
37
+ try {
38
+ const searchconds = JSON.parse(newVal);
39
+ filterNodes.value = searchconds.map((item) => parseFilters(item));
40
+ } catch (error) {
41
+ ibiz.log.error("".concat(newVal, "\u503C\u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u5FC5\u987B\u4E3Ajson\u5B57\u7B26\u4E32"));
42
+ }
43
+ }
44
+ }
45
+ }
46
+ }, {
47
+ immediate: true
48
+ });
49
+ const resetFilter = () => {
50
+ filterNodes.value = getOriginFilterNodes();
51
+ };
52
+ resetFilter();
53
+ const setEditable = (flag) => {
54
+ if (flag) {
55
+ isEditable.value = flag;
56
+ } else {
57
+ setTimeout(() => {
58
+ isEditable.value = flag;
59
+ }, 100);
60
+ }
61
+ };
62
+ const handleChange = (e) => {
63
+ emit("change", e);
64
+ };
65
+ if (props.autoFocus) {
66
+ watch(editorRef, (newVal) => {
67
+ if (newVal) {
68
+ const input = newVal.$el.getElementsByTagName("input")[0];
69
+ input.focus();
70
+ }
71
+ });
72
+ }
73
+ const onFocus = (e) => {
74
+ emit("focus", e);
75
+ setEditable(true);
76
+ };
77
+ const onBlur = (e) => {
78
+ emit("blur", e);
79
+ setEditable(false);
80
+ };
81
+ const handleKeyUp = (e) => {
82
+ if (e && e.code === "Enter") {
83
+ emit("enter", e);
84
+ }
85
+ };
86
+ const getCurrentValByFilterNodes = () => {
87
+ const searchconds = calcSearchConds(filterNodes.value);
88
+ if (searchconds) {
89
+ currentVal.value = JSON.stringify(searchconds, null, 2);
90
+ }
91
+ };
92
+ const onConfirm = () => {
93
+ getCurrentValByFilterNodes();
94
+ if (popover) {
95
+ popover.dismiss();
96
+ }
97
+ emit("change", currentVal.value);
98
+ };
99
+ const onCancel = () => {
100
+ resetFilter();
101
+ getCurrentValByFilterNodes();
102
+ emit("change", "");
103
+ };
104
+ const showFilter = async () => {
105
+ popover = ibiz.overlay.createPopover(() => {
106
+ return createVNode(resolveComponent("iBizFilterTreeControl"), {
107
+ "filterControllers": c.filterControllers,
108
+ "filterNodes": filterNodes.value,
109
+ "parent": "searchcond-edit",
110
+ "onConfirm": () => {
111
+ onConfirm();
112
+ },
113
+ "onCancel": () => {
114
+ onCancel();
115
+ }
116
+ }, null);
117
+ }, void 0, {
118
+ placement: "bottom-end",
119
+ autoClose: true
120
+ });
121
+ popover.present(filterButtonRef.value.$el);
122
+ await popover.onWillDismiss();
123
+ popover = void 0;
124
+ };
125
+ const triggerFilter = () => {
126
+ if (popover) {
127
+ popover.dismiss();
128
+ } else {
129
+ showFilter();
130
+ }
131
+ };
132
+ return {
133
+ ns,
134
+ c,
135
+ currentVal,
136
+ handleChange,
137
+ onFocus,
138
+ onBlur,
139
+ editorRef,
140
+ handleKeyUp,
141
+ isEditable,
142
+ setEditable,
143
+ showFormDefaultContent,
144
+ filterNodes,
145
+ triggerFilter,
146
+ filterButtonRef,
147
+ resetFilter
148
+ };
149
+ },
150
+ render() {
151
+ let content = null;
152
+ if (this.readonly) {
153
+ content = isNilOrEmpty(this.currentVal) ? "" : "".concat(this.currentVal);
154
+ } else {
155
+ content = [createVNode(resolveComponent("el-input"), {
156
+ "ref": "editorRef",
157
+ "class": [this.ns.b("input")],
158
+ "model-value": this.currentVal,
159
+ "type": "textarea",
160
+ "rows": 10,
161
+ "placeholder": this.c.placeHolder,
162
+ "disabled": this.disabled,
163
+ "controls": false,
164
+ "onFocus": this.onFocus,
165
+ "onBlur": this.onBlur,
166
+ "onKeyup": this.handleKeyUp
167
+ }, null), createVNode(resolveComponent("el-button"), {
168
+ "ref": "filterButtonRef",
169
+ "type": "primary",
170
+ "title": "\u7F16\u8F91",
171
+ "class": this.ns.b("filter"),
172
+ "onClick": () => this.triggerFilter()
173
+ }, {
174
+ default: () => [createVNode(resolveComponent("iBizIcon"), {
175
+ "icon": {
176
+ cssClass: "fa fa-edit"
177
+ }
178
+ }, null)]
179
+ })];
180
+ }
181
+ return createVNode("div", {
182
+ "class": [this.ns.b(), this.disabled ? this.ns.m("disabled") : "", this.readonly ? this.ns.m("readonly") : "", this.ns.is("editable", this.isEditable), this.ns.is("show-default", this.showFormDefaultContent)]
183
+ }, [content]);
184
+ }
185
+ });
186
+
187
+ export { IBizSearchCondEdit };
@@ -0,0 +1,17 @@
1
+ import { IEditorContainerController, IEditorProvider } from '@ibiz-template/runtime';
2
+ import { IPicker } from '@ibiz/model-core';
3
+ import { SearchCondEditEditorController } from './ibiz-searchcond-edit.controller';
4
+ /**
5
+ * 搜索过滤项编辑器适配器
6
+ *
7
+ * @author lxm
8
+ * @date 2022-09-19 22:09:03
9
+ * @export
10
+ * @class SearchCondEditEditorProvider
11
+ * @implements {EditorProvider}
12
+ */
13
+ export declare class SearchCondEditEditorProvider implements IEditorProvider {
14
+ formEditor: string;
15
+ gridEditor: string;
16
+ createController(editorModel: IPicker, parentController: IEditorContainerController): Promise<SearchCondEditEditorController>;
17
+ }
@@ -0,0 +1,22 @@
1
+ import { SearchCondEditEditorController } from './ibiz-searchcond-edit.controller.mjs';
2
+
3
+ "use strict";
4
+ var __defProp = Object.defineProperty;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __publicField = (obj, key, value) => {
7
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
8
+ return value;
9
+ };
10
+ class SearchCondEditEditorProvider {
11
+ constructor() {
12
+ __publicField(this, "formEditor", "IBizSearchCondEdit");
13
+ __publicField(this, "gridEditor", "IBizSearchCondEdit");
14
+ }
15
+ async createController(editorModel, parentController) {
16
+ const c = new SearchCondEditEditorController(editorModel, parentController);
17
+ await c.init();
18
+ return c;
19
+ }
20
+ }
21
+
22
+ export { SearchCondEditEditorProvider };
@@ -0,0 +1,3 @@
1
+ export * from './ibiz-searchcond-edit.controller';
2
+ export * from './ibiz-searchcond-edit.provider';
3
+ export { IBizSearchCondEdit } from './ibiz-searchcond-edit';
@@ -0,0 +1,5 @@
1
+ export { SearchCondEditEditorController } from './ibiz-searchcond-edit.controller.mjs';
2
+ export { SearchCondEditEditorProvider } from './ibiz-searchcond-edit.provider.mjs';
3
+ export { IBizSearchCondEdit } from './ibiz-searchcond-edit.mjs';
4
+
5
+ "use strict";
@@ -0,0 +1 @@
1
+ export * from './ibiz-searchcond-edit';
@@ -0,0 +1,6 @@
1
+ import './ibiz-searchcond-edit/index.mjs';
2
+ export { IBizSearchCondEdit } from './ibiz-searchcond-edit/ibiz-searchcond-edit.mjs';
3
+ export { SearchCondEditEditorController } from './ibiz-searchcond-edit/ibiz-searchcond-edit.controller.mjs';
4
+ export { SearchCondEditEditorProvider } from './ibiz-searchcond-edit/ibiz-searchcond-edit.provider.mjs';
5
+
6
+ "use strict";
@@ -1 +1 @@
1
- .ibiz-internal-message{--ibiz-internal-message-loading-warp-bg-color:linear-gradient(90deg, var(--ibiz-color-primary-light-hover), var(--ibiz-color-primary));display:flex;align-items:center;justify-content:space-between;position:relative}.ibiz-internal-message--clickable{cursor:pointer}.ibiz-internal-message__caption{margin-bottom:8px;font-weight:var(--ibiz-font-weight-bold)}.ibiz-internal-message__short-content{margin-bottom:8px}.ibiz-internal-message__status{margin-right:8px}.ibiz-internal-message:hover .ibiz-internal-message-toolbar{display:block}.ibiz-internal-message-left{flex-grow:0;flex-shrink:0;align-self:flex-start;width:50px;font-size:var(--ibiz-font-size-header-3);text-align:center}.ibiz-internal-message-center{flex-grow:1;width:342px}.ibiz-internal-message-toolbar{position:absolute;top:0;right:0;display:none;padding:8px}.ibiz-internal-message-toolbar__button{margin-left:10px;font-size:16px;cursor:pointer}.ibiz-internal-message-toolbar__button:hover{color:var(--ibiz-color-primary)}
1
+ .ibiz-internal-message{--ibiz-internal-message-loading-warp-bg-color:linear-gradient(90deg, var(--ibiz-color-primary-light-hover), var(--ibiz-color-primary));display:flex;align-items:center;justify-content:space-between;position:relative}.ibiz-internal-message--clickable{cursor:pointer}.ibiz-internal-message__caption{margin-bottom:8px;font-weight:var(--ibiz-font-weight-bold)}.ibiz-internal-message__short-content{margin-bottom:8px}.ibiz-internal-message__status{margin-right:8px}.ibiz-internal-message-left{flex-grow:0;flex-shrink:0;align-self:flex-start;width:50px;font-size:var(--ibiz-font-size-header-3);text-align:center}.ibiz-internal-message-center{flex-grow:1;width:342px}.ibiz-internal-message-toolbar{position:absolute;top:0;right:0;display:none;padding:8px}.ibiz-internal-message-toolbar__button{margin-left:10px;font-size:16px;cursor:pointer}.ibiz-internal-message-toolbar__button:hover{color:var(--ibiz-color-primary)}
@@ -1 +1 @@
1
- .ibiz-internal-message-json{display:flex;flex-flow:column nowrap;position:relative}.ibiz-internal-message-json--clickable{cursor:pointer}.ibiz-internal-message-json:hover .ibiz-internal-message-json-toolbar{display:block}.ibiz-internal-message-json__content{flex-grow:1}.ibiz-internal-message-json-toolbar{position:absolute;top:0;right:0;display:none;padding:8px}.ibiz-internal-message-json-toolbar__button{margin-left:10px;font-size:16px;cursor:pointer}.ibiz-internal-message-json-toolbar__button:hover{color:var(--ibiz-color-primary)}
1
+ .ibiz-internal-message-json{display:flex;flex-flow:column nowrap;position:relative}.ibiz-internal-message-json--clickable{cursor:pointer}.ibiz-internal-message-json__content{flex-grow:1}.ibiz-internal-message-json-toolbar{position:absolute;top:0;right:0;display:none;padding:8px}.ibiz-internal-message-json-toolbar__button{margin-left:10px;font-size:16px;cursor:pointer}.ibiz-internal-message-json-toolbar__button:hover{color:var(--ibiz-color-primary)}
@@ -47,7 +47,8 @@ const FormButton = /* @__PURE__ */ vue.defineComponent({
47
47
  "sime": "small",
48
48
  "onClick": this.controller.onClick.bind(this.controller),
49
49
  "loading": this.controller.state.loading,
50
- "disabled": this.controller.state.disabled
50
+ "disabled": this.controller.state.disabled,
51
+ "title": this.modelData.tooltip
51
52
  }, {
52
53
  default: () => [vue.createVNode("div", {
53
54
  "class": this.ns.b("content")
@@ -58,6 +58,10 @@ function useITableEvent(c) {
58
58
  } else if (order === "descending") {
59
59
  order1 = "desc";
60
60
  }
61
+ const sortQuery = "".concat(fieldName, ",").concat(order1);
62
+ if (sortQuery === c.state.sortQuery) {
63
+ return;
64
+ }
61
65
  c.setSort(fieldName, order1);
62
66
  c.load();
63
67
  }
@@ -52,23 +52,41 @@ const FilterModes = [{
52
52
  const FilterTreeControl = /* @__PURE__ */ vue.defineComponent({
53
53
  name: "IBizFilterTreeControl",
54
54
  props: {
55
- controller: {
56
- type: Object,
55
+ /**
56
+ * 过滤项控制器集合
57
+ */
58
+ filterControllers: {
59
+ type: Array,
57
60
  required: true
58
61
  },
59
- provider: {
60
- type: Object
62
+ /**
63
+ * 过滤项树节点数据集合
64
+ */
65
+ filterNodes: {
66
+ type: Array,
67
+ required: true
68
+ },
69
+ /**
70
+ * 父容器
71
+ */
72
+ parent: {
73
+ type: String,
74
+ required: true
61
75
  }
62
76
  },
63
- emits: {
64
- close: () => true
65
- },
77
+ emits: ["confirm", "cancel", "change"],
66
78
  setup(props, {
67
79
  emit
68
80
  }) {
69
81
  const ns = vue3Util.useNamespace("filter-tree");
82
+ const isInSearchBar = vue.computed(() => {
83
+ return props.parent === "search-bar";
84
+ });
85
+ const UiFilterNodes = vue.computed(() => {
86
+ return props.filterNodes;
87
+ });
70
88
  const findFilterController = (fieldName, valueOP) => {
71
- return props.controller.filterControllers.find((item) => {
89
+ return props.filterControllers.find((item) => {
72
90
  if (item.fieldName === fieldName) {
73
91
  return item.valueOP ? item.valueOP === valueOP : true;
74
92
  }
@@ -86,7 +104,7 @@ const FilterTreeControl = /* @__PURE__ */ vue.defineComponent({
86
104
  }
87
105
  return field.valueOPs;
88
106
  };
89
- props.controller.filterControllers.forEach((filterC) => {
107
+ props.filterControllers.forEach((filterC) => {
90
108
  let find = allFields.find((x) => x.name === filterC.fieldName);
91
109
  if (find === void 0) {
92
110
  find = {
@@ -141,6 +159,7 @@ const FilterTreeControl = /* @__PURE__ */ vue.defineComponent({
141
159
  editor = vue.h(component, {
142
160
  value: node.value,
143
161
  controller: filterC.editor,
162
+ data: {},
144
163
  onChange: (val) => {
145
164
  node.value = val;
146
165
  }
@@ -240,23 +259,26 @@ const FilterTreeControl = /* @__PURE__ */ vue.defineComponent({
240
259
  }, null)]);
241
260
  })])]);
242
261
  };
243
- const onClose = () => {
244
- emit("close");
262
+ const onConfirm = () => {
263
+ emit("confirm");
264
+ };
265
+ const onCancel = () => {
266
+ emit("cancel");
245
267
  };
246
268
  return {
247
269
  ns,
248
270
  renderFilterGroup,
249
271
  renderFilterItem,
250
- onClose
272
+ onConfirm,
273
+ onCancel,
274
+ isInSearchBar,
275
+ UiFilterNodes
251
276
  };
252
277
  },
253
278
  render() {
254
- const {
255
- state
256
- } = this.controller;
257
279
  return vue.createVNode("div", {
258
280
  "class": [this.ns.b()]
259
- }, [state.filterNodes.length > 0 && state.filterNodes.map((node) => {
281
+ }, [this.UiFilterNodes.length > 0 && this.UiFilterNodes.map((node) => {
260
282
  if (node.leaf) {
261
283
  return this.renderFilterItem(node);
262
284
  }
@@ -265,14 +287,13 @@ const FilterTreeControl = /* @__PURE__ */ vue.defineComponent({
265
287
  "class": this.ns.b("footer")
266
288
  }, [vue.createVNode(vue.resolveComponent("el-button"), {
267
289
  "onClick": () => {
268
- this.controller.onSearch();
269
- this.onClose();
290
+ this.onConfirm();
270
291
  }
271
292
  }, {
272
- default: () => [vue.createTextVNode("\u641C\u7D22")]
293
+ default: () => [this.isInSearchBar ? "\u641C\u7D22" : "\u786E\u5B9A"]
273
294
  }), vue.createVNode(vue.resolveComponent("el-button"), {
274
295
  "onClick": () => {
275
- this.controller.resetFilter();
296
+ this.onCancel();
276
297
  }
277
298
  }, {
278
299
  default: () => [vue.createTextVNode("\u91CD\u7F6E")]
@@ -57,12 +57,18 @@ const SearchBarControl = /* @__PURE__ */ vue.defineComponent({
57
57
  const showFilter = async () => {
58
58
  popover = ibiz.overlay.createPopover(() => {
59
59
  return vue.createVNode(vue.resolveComponent("iBizFilterTreeControl"), {
60
- "onClose": () => {
60
+ "filterControllers": c.filterControllers,
61
+ "filterNodes": c.state.filterNodes,
62
+ "parent": "search-bar",
63
+ "onConfirm": () => {
64
+ c.onSearch();
61
65
  if (popover) {
62
66
  popover.dismiss();
63
67
  }
64
68
  },
65
- "controller": c
69
+ "onCancel": () => {
70
+ c.resetFilter();
71
+ }
66
72
  }, null);
67
73
  }, void 0, {
68
74
  placement: "bottom-end",
@@ -30,6 +30,7 @@ require('./array/index.cjs');
30
30
  require('./cascader/index.cjs');
31
31
  require('./color-picker/index.cjs');
32
32
  require('./preset/index.cjs');
33
+ require('./user/ibiz-searchcond-edit/index.cjs');
33
34
  var span = require('./span/span/span.cjs');
34
35
  var spanLink = require('./span/span-link/span-link.cjs');
35
36
  var input = require('./text-box/input/input.cjs');
@@ -63,6 +64,7 @@ var ibizArray = require('./array/ibiz-array/ibiz-array.cjs');
63
64
  var ibizCascader = require('./cascader/ibiz-cascader/ibiz-cascader.cjs');
64
65
  var ibizColorPicker = require('./color-picker/ibiz-color-picker/ibiz-color-picker.cjs');
65
66
  var ibizPresetRawitem = require('./preset/preset-rawitem/ibiz-preset-rawitem/ibiz-preset-rawitem.cjs');
67
+ var ibizSearchcondEdit = require('./user/ibiz-searchcond-edit/ibiz-searchcond-edit.cjs');
66
68
  var spanEditor_provider = require('./span/span-editor.provider.cjs');
67
69
  var textBoxEditor_provider = require('./text-box/text-box-editor.provider.cjs');
68
70
  var dropdownListEditor_provider = require('./dropdown-list/dropdown-list-editor.provider.cjs');
@@ -87,6 +89,7 @@ var markdownEditor_provider = require('./markdown/markdown-editor.provider.cjs')
87
89
  var arrayEditor_provider = require('./array/array-editor.provider.cjs');
88
90
  var cascaderEditor_provider = require('./cascader/cascader-editor.provider.cjs');
89
91
  var colorPickerEditor_provider = require('./color-picker/color-picker-editor.provider.cjs');
92
+ var ibizSearchcondEdit_provider = require('./user/ibiz-searchcond-edit/ibiz-searchcond-edit.provider.cjs');
90
93
 
91
94
  "use strict";
92
95
  const IBizEditor = {
@@ -125,6 +128,7 @@ const IBizEditor = {
125
128
  v.component(ibizCascader.IBizCascader.name, ibizCascader.IBizCascader);
126
129
  v.component(ibizColorPicker.IBizColorPicker.name, ibizColorPicker.IBizColorPicker);
127
130
  v.component(ibizPresetRawitem.IBizPresetRawitem.name, ibizPresetRawitem.IBizPresetRawitem);
131
+ v.component(ibizSearchcondEdit.IBizSearchCondEdit.name, ibizSearchcondEdit.IBizSearchCondEdit);
128
132
  v.component(
129
133
  "IBizHtml",
130
134
  vue.defineAsyncComponent(() => Promise.resolve().then(function () { return require('./html/wang-editor/wang-editor.cjs'); }))
@@ -289,6 +293,10 @@ const IBizEditor = {
289
293
  "COLORPICKER",
290
294
  () => new colorPickerEditor_provider.ColorPickerEditorProvider()
291
295
  );
296
+ runtime.registerEditorProvider(
297
+ "PICKER_searchCondEdit",
298
+ () => new ibizSearchcondEdit_provider.SearchCondEditEditorProvider()
299
+ );
292
300
  runtime.registerEditorProvider(
293
301
  "FIELD_IMAGE_PICTURE_ONE",
294
302
  () => new uploadEditor_provider.FileUploaderEditorProvider("PICTURE_ONE")
@@ -38,8 +38,8 @@ const IBizInputNumber = /* @__PURE__ */ vue.defineComponent({
38
38
  });
39
39
  vue.watch(() => props.value, (newVal, oldVal) => {
40
40
  if (newVal !== oldVal) {
41
- const number = newVal != null && !Object.is(newVal, "") ? Number(newVal) : "";
42
- currentVal.value = Number.isNaN(number) ? "" : number;
41
+ const number = newVal != null && !Object.is(newVal, "") ? Number(newVal) : null;
42
+ currentVal.value = Number.isNaN(number) ? null : number;
43
43
  }
44
44
  }, {
45
45
  immediate: true
@@ -0,0 +1,189 @@
1
+ 'use strict';
2
+
3
+ var vue = require('vue');
4
+ var vue3Util = require('@ibiz-template/vue3-util');
5
+ require('./ibiz-searchcond-edit.css');
6
+ var qxUtil = require('qx-util');
7
+ var runtime = require('@ibiz-template/runtime');
8
+
9
+ "use strict";
10
+ const IBizSearchCondEdit = /* @__PURE__ */ vue.defineComponent({
11
+ name: "IBizSearchCondEdit",
12
+ props: vue3Util.getInputProps(),
13
+ emits: vue3Util.getEditorEmits(),
14
+ setup(props, {
15
+ emit
16
+ }) {
17
+ const ns = vue3Util.useNamespace("searchcond-edit");
18
+ const c = props.controller;
19
+ const currentVal = vue.ref(null);
20
+ const isEditable = vue.ref(false);
21
+ const editorRef = vue.ref();
22
+ const filterNodes = vue.ref([]);
23
+ const filterButtonRef = vue.ref();
24
+ let popover;
25
+ const showFormDefaultContent = vue.computed(() => {
26
+ if (props.controlParams && props.controlParams.editmode === "hover") {
27
+ return true;
28
+ }
29
+ return false;
30
+ });
31
+ vue.watch(() => props.value, (newVal, oldVal) => {
32
+ if (newVal !== oldVal) {
33
+ if (newVal == null) {
34
+ currentVal.value = "";
35
+ filterNodes.value = runtime.getOriginFilterNodes();
36
+ } else if (typeof newVal === "string") {
37
+ currentVal.value = newVal;
38
+ if (newVal) {
39
+ try {
40
+ const searchconds = JSON.parse(newVal);
41
+ filterNodes.value = searchconds.map((item) => runtime.parseFilters(item));
42
+ } catch (error) {
43
+ ibiz.log.error("".concat(newVal, "\u503C\u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u5FC5\u987B\u4E3Ajson\u5B57\u7B26\u4E32"));
44
+ }
45
+ }
46
+ }
47
+ }
48
+ }, {
49
+ immediate: true
50
+ });
51
+ const resetFilter = () => {
52
+ filterNodes.value = runtime.getOriginFilterNodes();
53
+ };
54
+ resetFilter();
55
+ const setEditable = (flag) => {
56
+ if (flag) {
57
+ isEditable.value = flag;
58
+ } else {
59
+ setTimeout(() => {
60
+ isEditable.value = flag;
61
+ }, 100);
62
+ }
63
+ };
64
+ const handleChange = (e) => {
65
+ emit("change", e);
66
+ };
67
+ if (props.autoFocus) {
68
+ vue.watch(editorRef, (newVal) => {
69
+ if (newVal) {
70
+ const input = newVal.$el.getElementsByTagName("input")[0];
71
+ input.focus();
72
+ }
73
+ });
74
+ }
75
+ const onFocus = (e) => {
76
+ emit("focus", e);
77
+ setEditable(true);
78
+ };
79
+ const onBlur = (e) => {
80
+ emit("blur", e);
81
+ setEditable(false);
82
+ };
83
+ const handleKeyUp = (e) => {
84
+ if (e && e.code === "Enter") {
85
+ emit("enter", e);
86
+ }
87
+ };
88
+ const getCurrentValByFilterNodes = () => {
89
+ const searchconds = runtime.calcSearchConds(filterNodes.value);
90
+ if (searchconds) {
91
+ currentVal.value = JSON.stringify(searchconds, null, 2);
92
+ }
93
+ };
94
+ const onConfirm = () => {
95
+ getCurrentValByFilterNodes();
96
+ if (popover) {
97
+ popover.dismiss();
98
+ }
99
+ emit("change", currentVal.value);
100
+ };
101
+ const onCancel = () => {
102
+ resetFilter();
103
+ getCurrentValByFilterNodes();
104
+ emit("change", "");
105
+ };
106
+ const showFilter = async () => {
107
+ popover = ibiz.overlay.createPopover(() => {
108
+ return vue.createVNode(vue.resolveComponent("iBizFilterTreeControl"), {
109
+ "filterControllers": c.filterControllers,
110
+ "filterNodes": filterNodes.value,
111
+ "parent": "searchcond-edit",
112
+ "onConfirm": () => {
113
+ onConfirm();
114
+ },
115
+ "onCancel": () => {
116
+ onCancel();
117
+ }
118
+ }, null);
119
+ }, void 0, {
120
+ placement: "bottom-end",
121
+ autoClose: true
122
+ });
123
+ popover.present(filterButtonRef.value.$el);
124
+ await popover.onWillDismiss();
125
+ popover = void 0;
126
+ };
127
+ const triggerFilter = () => {
128
+ if (popover) {
129
+ popover.dismiss();
130
+ } else {
131
+ showFilter();
132
+ }
133
+ };
134
+ return {
135
+ ns,
136
+ c,
137
+ currentVal,
138
+ handleChange,
139
+ onFocus,
140
+ onBlur,
141
+ editorRef,
142
+ handleKeyUp,
143
+ isEditable,
144
+ setEditable,
145
+ showFormDefaultContent,
146
+ filterNodes,
147
+ triggerFilter,
148
+ filterButtonRef,
149
+ resetFilter
150
+ };
151
+ },
152
+ render() {
153
+ let content = null;
154
+ if (this.readonly) {
155
+ content = qxUtil.isNilOrEmpty(this.currentVal) ? "" : "".concat(this.currentVal);
156
+ } else {
157
+ content = [vue.createVNode(vue.resolveComponent("el-input"), {
158
+ "ref": "editorRef",
159
+ "class": [this.ns.b("input")],
160
+ "model-value": this.currentVal,
161
+ "type": "textarea",
162
+ "rows": 10,
163
+ "placeholder": this.c.placeHolder,
164
+ "disabled": this.disabled,
165
+ "controls": false,
166
+ "onFocus": this.onFocus,
167
+ "onBlur": this.onBlur,
168
+ "onKeyup": this.handleKeyUp
169
+ }, null), vue.createVNode(vue.resolveComponent("el-button"), {
170
+ "ref": "filterButtonRef",
171
+ "type": "primary",
172
+ "title": "\u7F16\u8F91",
173
+ "class": this.ns.b("filter"),
174
+ "onClick": () => this.triggerFilter()
175
+ }, {
176
+ default: () => [vue.createVNode(vue.resolveComponent("iBizIcon"), {
177
+ "icon": {
178
+ cssClass: "fa fa-edit"
179
+ }
180
+ }, null)]
181
+ })];
182
+ }
183
+ return vue.createVNode("div", {
184
+ "class": [this.ns.b(), this.disabled ? this.ns.m("disabled") : "", this.readonly ? this.ns.m("readonly") : "", this.ns.is("editable", this.isEditable), this.ns.is("show-default", this.showFormDefaultContent)]
185
+ }, [content]);
186
+ }
187
+ });
188
+
189
+ exports.IBizSearchCondEdit = IBizSearchCondEdit;