@ibiz-template/vue3-components 0.7.30 → 0.7.31-alpha.0

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 (122) hide show
  1. package/dist/chart-0UV2FAN6.js +1 -0
  2. package/dist/index-maJGu4b8.js +4 -0
  3. package/dist/index.min.css +1 -1
  4. package/dist/index.system.min.js +1 -1
  5. package/dist/{xlsx-util-sKVlHqdj.js → xlsx-util-OUxT4A8O.js} +1 -1
  6. package/es/common/index.mjs +2 -0
  7. package/es/common/pql-editor/components/index.d.ts +1 -0
  8. package/es/common/pql-editor/components/index.mjs +3 -0
  9. package/es/common/pql-editor/components/pql-editor-suggestion/pql-editor-suggestion.css +1 -0
  10. package/es/common/pql-editor/components/pql-editor-suggestion/pql-editor-suggestion.d.ts +28 -0
  11. package/es/common/pql-editor/components/pql-editor-suggestion/pql-editor-suggestion.mjs +49 -0
  12. package/es/common/pql-editor/pql-editor.css +1 -0
  13. package/es/common/pql-editor/pql-editor.d.ts +68 -0
  14. package/es/common/pql-editor/pql-editor.mjs +606 -0
  15. package/es/common/pql-editor/pql-editor.module.d.ts +47 -0
  16. package/es/common/pql-editor/pql-editor.module.mjs +176 -0
  17. package/es/common/pql-editor/utils/index.d.ts +15 -0
  18. package/es/common/pql-editor/utils/index.mjs +270 -0
  19. package/es/control/chart/chart.mjs +32 -19
  20. package/es/control/dashboard/portlet/portlet-layout/portlet-layout.css +1 -1
  21. package/es/control/dashboard/portlet/portlet-layout/portlet-layout.d.ts +8 -0
  22. package/es/control/dashboard/portlet/portlet-layout/portlet-layout.mjs +12 -2
  23. package/es/control/dashboard/portlet/report-portlet/index.d.ts +1 -0
  24. package/es/control/dashboard/portlet/report-portlet/report-portlet.d.ts +1 -0
  25. package/es/control/dashboard/portlet/report-portlet/report-portlet.mjs +10 -2
  26. package/es/control/grid/grid/grid.mjs +2 -2
  27. package/es/control/grid/grid-column/grid-field-column/grid-field-column.d.ts +4 -2
  28. package/es/control/grid/grid-column/grid-field-column/grid-field-column.mjs +32 -2
  29. package/es/control/grid/grid-column/grid-field-column/index.d.ts +4 -0
  30. package/es/control/search-bar/filter-tree/filter-tree.css +1 -1
  31. package/es/control/search-bar/filter-tree/filter-tree.d.ts +30 -3
  32. package/es/control/search-bar/filter-tree/filter-tree.mjs +83 -9
  33. package/es/control/search-bar/search-bar.mjs +10 -1
  34. package/es/editor/array/ibiz-array/ibiz-array.d.ts +1 -1
  35. package/es/editor/autocomplete/ibiz-autocomplete/ibiz-autocomplete.d.ts +1 -1
  36. package/es/editor/carousel/ibiz-carousel/ibiz-carousel.d.ts +1 -1
  37. package/es/editor/cascader/ibiz-cascader/ibiz-cascader.d.ts +1 -1
  38. package/es/editor/check-box/ibiz-checkbox/ibiz-checkbox.d.ts +1 -1
  39. package/es/editor/check-box-list/checkbox-list-editor.controller.d.ts +7 -0
  40. package/es/editor/check-box-list/checkbox-list-editor.controller.mjs +11 -0
  41. package/es/editor/check-box-list/ibiz-checkbox-list/ibiz-checkbox-list.css +1 -1
  42. package/es/editor/check-box-list/ibiz-checkbox-list/ibiz-checkbox-list.d.ts +1 -1
  43. package/es/editor/check-box-list/ibiz-checkbox-list/ibiz-checkbox-list.mjs +2 -1
  44. package/es/editor/code/monaco-editor/monaco-editor.d.ts +1 -1
  45. package/es/editor/color-picker/ibiz-color-picker/ibiz-color-picker.d.ts +1 -1
  46. package/es/editor/data-picker/ibiz-mpicker/ibiz-mpicker.d.ts +1 -1
  47. package/es/editor/data-picker/ibiz-picker/ibiz-picker.d.ts +1 -1
  48. package/es/editor/data-picker/ibiz-picker-dropdown/ibiz-picker-dropdown.d.ts +1 -1
  49. package/es/editor/data-picker/ibiz-picker-embed-view/ibiz-picker-embed-view.d.ts +1 -1
  50. package/es/editor/data-picker/ibiz-picker-link/ibiz-picker-link.d.ts +1 -1
  51. package/es/editor/data-picker/ibiz-picker-select-view/ibiz-picker-select-view.d.ts +1 -1
  52. package/es/editor/date-picker/ibiz-date-picker/ibiz-date-picker.d.ts +1 -1
  53. package/es/editor/date-range/ibiz-date-range-picker/ibiz-date-range-picker.d.ts +1 -1
  54. package/es/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.d.ts +1 -1
  55. package/es/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.mjs +1 -1
  56. package/es/editor/dropdown-list/ibiz-emoji-picker/ibiz-emoji-picker.d.ts +1 -1
  57. package/es/editor/html/wang-editor/wang-editor.d.ts +1 -1
  58. package/es/editor/list-box/ibiz-list-box/ibiz-list-box.d.ts +1 -1
  59. package/es/editor/number-range/ibiz-number-range-picker/ibiz-number-range-picker.d.ts +1 -1
  60. package/es/editor/preset/preset-rawitem/ibiz-preset-rawitem/ibiz-preset-rawitem.d.ts +1 -1
  61. package/es/editor/radio-button-list/ibiz-radio/ibiz-radio.css +1 -1
  62. package/es/editor/radio-button-list/ibiz-radio/ibiz-radio.d.ts +1 -1
  63. package/es/editor/radio-button-list/ibiz-radio/ibiz-radio.mjs +2 -1
  64. package/es/editor/radio-button-list/radio-button-list.controller.d.ts +8 -0
  65. package/es/editor/radio-button-list/radio-button-list.controller.mjs +23 -0
  66. package/es/editor/rate/ibiz-rate/ibiz-rate.d.ts +1 -1
  67. package/es/editor/raw/ibiz-raw/ibiz-raw.d.ts +1 -1
  68. package/es/editor/slider/ibiz-slider/ibiz-slider.d.ts +1 -1
  69. package/es/editor/span/span/span.css +1 -1
  70. package/es/editor/span/span/span.d.ts +1 -1
  71. package/es/editor/span/span/span.mjs +2 -1
  72. package/es/editor/span/span-link/span-link.d.ts +1 -1
  73. package/es/editor/stepper/ibiz-stepper/ibiz-stepper.d.ts +1 -1
  74. package/es/editor/switch/ibiz-switch/ibiz-switch.d.ts +1 -1
  75. package/es/editor/text-box/ibiz-input-ip/ibiz-input-ip.d.ts +1 -1
  76. package/es/editor/text-box/ibiz-input-number/ibiz-input-number.d.ts +1 -1
  77. package/es/editor/text-box/input/input.d.ts +1 -1
  78. package/es/editor/upload/ibiz-file-upload/ibiz-file-upload.d.ts +1 -1
  79. package/es/editor/upload/ibiz-image-preview/ibiz-image-preview.d.ts +1 -1
  80. package/es/editor/upload/ibiz-image-upload/ibiz-image-upload.d.ts +1 -1
  81. package/es/editor/user/ibiz-searchcond-edit/ibiz-searchcond-edit.d.ts +1 -1
  82. package/es/interface/i-pql-item.d.ts +52 -0
  83. package/es/interface/i-pql-item.mjs +1 -0
  84. package/es/interface/i-pql-node.d.ts +37 -0
  85. package/es/interface/i-pql-node.mjs +1 -0
  86. package/es/interface/i-schema-field.d.ts +51 -0
  87. package/es/interface/i-schema-field.mjs +1 -0
  88. package/es/interface/index.d.ts +3 -0
  89. package/es/interface/index.mjs +5 -0
  90. package/lib/common/index.cjs +2 -0
  91. package/lib/common/pql-editor/components/index.cjs +7 -0
  92. package/lib/common/pql-editor/components/pql-editor-suggestion/pql-editor-suggestion.cjs +51 -0
  93. package/lib/common/pql-editor/components/pql-editor-suggestion/pql-editor-suggestion.css +1 -0
  94. package/lib/common/pql-editor/pql-editor.cjs +608 -0
  95. package/lib/common/pql-editor/pql-editor.css +1 -0
  96. package/lib/common/pql-editor/pql-editor.module.cjs +182 -0
  97. package/lib/common/pql-editor/utils/index.cjs +280 -0
  98. package/lib/control/chart/chart.cjs +31 -18
  99. package/lib/control/dashboard/portlet/portlet-layout/portlet-layout.cjs +12 -2
  100. package/lib/control/dashboard/portlet/portlet-layout/portlet-layout.css +1 -1
  101. package/lib/control/dashboard/portlet/report-portlet/report-portlet.cjs +9 -1
  102. package/lib/control/grid/grid/grid.cjs +2 -2
  103. package/lib/control/grid/grid-column/grid-field-column/grid-field-column.cjs +32 -2
  104. package/lib/control/search-bar/filter-tree/filter-tree.cjs +82 -8
  105. package/lib/control/search-bar/filter-tree/filter-tree.css +1 -1
  106. package/lib/control/search-bar/search-bar.cjs +10 -1
  107. package/lib/editor/check-box-list/checkbox-list-editor.controller.cjs +11 -0
  108. package/lib/editor/check-box-list/ibiz-checkbox-list/ibiz-checkbox-list.cjs +2 -1
  109. package/lib/editor/check-box-list/ibiz-checkbox-list/ibiz-checkbox-list.css +1 -1
  110. package/lib/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.cjs +1 -1
  111. package/lib/editor/radio-button-list/ibiz-radio/ibiz-radio.cjs +2 -1
  112. package/lib/editor/radio-button-list/ibiz-radio/ibiz-radio.css +1 -1
  113. package/lib/editor/radio-button-list/radio-button-list.controller.cjs +23 -0
  114. package/lib/editor/span/span/span.cjs +2 -1
  115. package/lib/editor/span/span/span.css +1 -1
  116. package/lib/interface/i-pql-item.cjs +3 -0
  117. package/lib/interface/i-pql-node.cjs +3 -0
  118. package/lib/interface/i-schema-field.cjs +3 -0
  119. package/lib/interface/index.cjs +7 -0
  120. package/package.json +6 -6
  121. package/dist/chart-J-0VPQfg.js +0 -1
  122. package/dist/index-5Hb8nfPm.js +0 -4
@@ -0,0 +1,176 @@
1
+ import { SlateEditor, DomEditor } from '@wangeditor/editor';
2
+ import '../../node_modules/.pnpm/snabbdom@3.5.1/node_modules/snabbdom/build/index.mjs';
3
+ import { isMove } from './utils/index.mjs';
4
+ import { h } from '../../node_modules/.pnpm/snabbdom@3.5.1/node_modules/snabbdom/build/h.mjs';
5
+
6
+ "use strict";
7
+ const pqlType = [
8
+ "pql-field",
9
+ "pql-field-value",
10
+ "pql-field-operator",
11
+ "pql-field-connection"
12
+ ];
13
+ function withPqlPlugin(editor) {
14
+ var _a;
15
+ const { isVoid, isInline, deleteBackward, deleteFragment, insertText } = editor;
16
+ const newEditor = editor;
17
+ const config = newEditor.getConfig();
18
+ const pql = (_a = config.EXTEND_CONF) == null ? void 0 : _a.pql;
19
+ let timer;
20
+ const updateCursor = () => {
21
+ var _a2;
22
+ const { selection } = editor;
23
+ if (selection && ((_a2 = selection.focus) == null ? void 0 : _a2.offset) === 0) {
24
+ const node = SlateEditor.node(editor, selection)[0];
25
+ if (node) {
26
+ const el = editor.toDOMNode(node);
27
+ if (isMove(el)) {
28
+ editor.move(1);
29
+ }
30
+ }
31
+ }
32
+ };
33
+ newEditor.isVoid = (el) => {
34
+ const type = DomEditor.getNodeType(el);
35
+ if (pqlType.includes(type)) {
36
+ return true;
37
+ }
38
+ return isVoid(el);
39
+ };
40
+ newEditor.isInline = (el) => {
41
+ const type = DomEditor.getNodeType(el);
42
+ if (pqlType.includes(type)) {
43
+ return true;
44
+ }
45
+ return isInline(el);
46
+ };
47
+ newEditor.deleteBackward = (unit) => {
48
+ deleteBackward(unit);
49
+ if (pql && pql.showSuggestion) {
50
+ window.clearTimeout(timer);
51
+ timer = window.setTimeout(() => {
52
+ updateCursor();
53
+ pql.showSuggestion();
54
+ }, 10);
55
+ }
56
+ };
57
+ newEditor.deleteFragment = (direction) => {
58
+ deleteFragment(direction);
59
+ if (pql && pql.showSuggestion) {
60
+ window.clearTimeout(timer);
61
+ timer = window.setTimeout(() => {
62
+ updateCursor();
63
+ pql.showSuggestion();
64
+ }, 10);
65
+ }
66
+ };
67
+ newEditor.insertText = (text) => {
68
+ insertText(text);
69
+ if (pql && pql.showSuggestion) {
70
+ window.clearTimeout(timer);
71
+ timer = window.setTimeout(() => {
72
+ pql.showSuggestion();
73
+ }, 10);
74
+ }
75
+ };
76
+ return newEditor;
77
+ }
78
+ function renderPqlElement(el) {
79
+ const { type, label = "" } = el;
80
+ if (type === "pql-field-operator" || type === "pql-field-connection") {
81
+ return h(
82
+ "span",
83
+ {
84
+ props: {
85
+ contentEditable: false
86
+ },
87
+ style: {
88
+ display: "inline-block",
89
+ lineHeight: "22px"
90
+ }
91
+ },
92
+ [label]
93
+ );
94
+ }
95
+ if (type === "pql-field-value") {
96
+ return h(
97
+ "span",
98
+ {
99
+ props: {
100
+ contentEditable: false
101
+ },
102
+ style: {
103
+ display: "inline-block",
104
+ lineHeight: "22px",
105
+ color: "#5dcfff"
106
+ }
107
+ },
108
+ [label]
109
+ );
110
+ }
111
+ const vNode = h(
112
+ "span",
113
+ {
114
+ props: {
115
+ contentEditable: false
116
+ },
117
+ style: {
118
+ color: "#6698ff",
119
+ backgroundColor: "#edf2fd",
120
+ display: "inline-block",
121
+ padding: "0 5px",
122
+ borderRadius: "3px",
123
+ lineHeight: "22px"
124
+ }
125
+ },
126
+ [label]
127
+ );
128
+ return vNode;
129
+ }
130
+ function pqlToHtml(el) {
131
+ const type = el.type || "";
132
+ if (!type) {
133
+ return el.text || "";
134
+ }
135
+ const html = '<span\n data-pql="true"\n data-w-e-type="'.concat(type, '"\n data-w-e-is-void\n data-w-e-is-inline\n data-label="').concat(el.label || "", '"\n data-value="').concat(el.value || "", '"\n ></span>');
136
+ return html;
137
+ }
138
+ function parsePqlHtml(domElem) {
139
+ const type = domElem.getAttribute("data-w-e-type") || "";
140
+ const label = domElem.getAttribute("data-label") || "";
141
+ const value = domElem.getAttribute("data-value") || "";
142
+ if (type) {
143
+ return {
144
+ type,
145
+ label,
146
+ value,
147
+ children: [{ text: "" }]
148
+ };
149
+ }
150
+ return {
151
+ children: [{ text: "" }]
152
+ };
153
+ }
154
+ const PqlModule = {
155
+ editorPlugin: withPqlPlugin,
156
+ renderElems: pqlType.map((type) => {
157
+ return {
158
+ type,
159
+ renderElem: renderPqlElement
160
+ };
161
+ }),
162
+ elemsToHtml: pqlType.map((type) => {
163
+ return {
164
+ type,
165
+ elemToHtml: pqlToHtml
166
+ };
167
+ }),
168
+ parseElemsHtml: [
169
+ {
170
+ selector: 'span[data-pql="true"]',
171
+ parseElemHtml: parsePqlHtml
172
+ }
173
+ ]
174
+ };
175
+
176
+ export { PqlModule, parsePqlHtml, pqlToHtml, renderPqlElement, withPqlPlugin };
@@ -0,0 +1,15 @@
1
+ import { CodeListItem, ValueOP } from '@ibiz-template/runtime';
2
+ import { IPqlItem, IPqlNode, ISchemaField } from '../../../interface';
3
+ export declare const FilterModes: {
4
+ valueOP: ValueOP;
5
+ label: string;
6
+ sqlOP: string;
7
+ }[];
8
+ export declare const ExcludeOPs: string[];
9
+ export declare const generateItems: (children: IData[]) => IPqlItem[];
10
+ export declare const generateCustomCond: (items: IPqlItem[], fields: ISchemaField[]) => string;
11
+ export declare const parseCustomCond: (cond: string) => IData[] | undefined;
12
+ export declare const pqlItemsToPqlNodes: (items: IPqlItem[], fields: ISchemaField[], getCodeListItems: (_id: string) => Promise<readonly CodeListItem[]>) => Promise<IPqlNode[]>;
13
+ export declare const pqlNodeToHtml: (node: IPqlNode) => string;
14
+ export declare const pqlNodesToHtml: (nodes: IPqlNode[]) => string;
15
+ export declare function isMove(el?: HTMLElement | null): boolean;
@@ -0,0 +1,270 @@
1
+ import { RuntimeError } from '@ibiz-template/core';
2
+ import { ValueOP } from '@ibiz-template/runtime';
3
+
4
+ "use strict";
5
+ const FilterModes = [
6
+ { valueOP: ValueOP.EQ, label: "\u7B49\u4E8E", sqlOP: "=" },
7
+ { valueOP: ValueOP.NOT_EQ, label: "\u4E0D\u7B49\u4E8E", sqlOP: "<>" },
8
+ { valueOP: ValueOP.GT, label: "\u5927\u4E8E", sqlOP: ">" },
9
+ { valueOP: ValueOP.GT_AND_EQ, label: "\u5927\u4E8E\u7B49\u4E8E", sqlOP: ">=" },
10
+ { valueOP: ValueOP.LT, label: "\u5C0F\u4E8E", sqlOP: "<" },
11
+ { valueOP: ValueOP.LT_AND_EQ, label: "\u5C0F\u4E8E\u7B49\u4E8E", sqlOP: "<=" },
12
+ { valueOP: ValueOP.IS_NULL, label: "\u4E3A\u7A7A", sqlOP: "Nil" },
13
+ { valueOP: ValueOP.IS_NOT_NULL, label: "\u975E\u7A7A", sqlOP: "NotNil" },
14
+ { valueOP: ValueOP.IN, label: "\u5C5E\u4E8E", sqlOP: "In" },
15
+ { valueOP: ValueOP.NOT_IN, label: "\u4E0D\u5C5E\u4E8E", sqlOP: "NotIn" },
16
+ { valueOP: ValueOP.LIKE, label: "\u6587\u672C\u5305\u542B", sqlOP: "%" },
17
+ { valueOP: ValueOP.LIFT_LIKE, label: "\u6587\u672C\u5DE6\u5305\u542B", sqlOP: "%#" },
18
+ { valueOP: ValueOP.RIGHT_LIKE, label: "\u6587\u672C\u53F3\u5305\u542B", sqlOP: "#%" },
19
+ { valueOP: ValueOP.EXISTS, label: "\u5B58\u5728", sqlOP: "EXISTS" },
20
+ { valueOP: ValueOP.NOT_EXISTS, label: "\u4E0D\u5B58\u5728", sqlOP: "NOTEXISTS" }
21
+ ];
22
+ const ExcludeOPs = [
23
+ ValueOP.IS_NULL,
24
+ ValueOP.IS_NOT_NULL,
25
+ ValueOP.EXISTS,
26
+ ValueOP.NOT_EXISTS
27
+ ];
28
+ const filterModeMap = /* @__PURE__ */ new Map();
29
+ FilterModes.forEach((mode) => {
30
+ filterModeMap.set(mode.valueOP, mode);
31
+ });
32
+ const symbolMap = /* @__PURE__ */ new Map();
33
+ FilterModes.forEach((mode) => {
34
+ symbolMap.set(mode.sqlOP, mode.valueOP);
35
+ });
36
+ const generateItems = (children) => {
37
+ if (!children.length) {
38
+ return [];
39
+ }
40
+ const items = [];
41
+ for (let i = 0; i < children.length; i++) {
42
+ if (i !== 0) {
43
+ const connection = children[i];
44
+ if (connection && connection.type === "pql-field-connection") {
45
+ if (i === children.length - 1) {
46
+ throw new RuntimeError("pql\u8282\u70B9\u89E3\u6790\u9519\u8BEF");
47
+ }
48
+ items.push({
49
+ type: "connection",
50
+ value: {
51
+ label: connection.label,
52
+ value: connection.value
53
+ }
54
+ });
55
+ } else {
56
+ throw new RuntimeError("pql\u8282\u70B9\u89E3\u6790\u9519\u8BEF");
57
+ }
58
+ }
59
+ const key = children[i !== 0 ? ++i : i];
60
+ const operator = children[++i];
61
+ if (key && operator && key.type === "pql-field" && operator.type === "pql-field-operator") {
62
+ if (operator.value && ExcludeOPs.includes(operator.value)) {
63
+ items.push({
64
+ type: "condition",
65
+ key: {
66
+ label: key.label,
67
+ value: key.value
68
+ },
69
+ operator: {
70
+ label: operator.label,
71
+ value: operator.value
72
+ }
73
+ });
74
+ continue;
75
+ } else {
76
+ const value = children[++i];
77
+ if (value && (value.type === "pql-field-value" || value.text)) {
78
+ items.push({
79
+ type: "condition",
80
+ key: {
81
+ label: key.label,
82
+ value: key.value
83
+ },
84
+ operator: {
85
+ label: operator.label,
86
+ value: operator.value
87
+ },
88
+ value: {
89
+ label: value.type === "pql-field-value" ? value.label : value.text,
90
+ value: value.type === "pql-field-value" ? value.value : value.text
91
+ }
92
+ });
93
+ continue;
94
+ }
95
+ }
96
+ }
97
+ throw new RuntimeError("pql\u8282\u70B9\u89E3\u6790\u9519\u8BEF");
98
+ }
99
+ return items;
100
+ };
101
+ const generateCustomCond = (items, fields) => {
102
+ const map = /* @__PURE__ */ new Map();
103
+ fields.forEach((item) => {
104
+ map.set(item.appDEFieldId, item);
105
+ });
106
+ let cond = "";
107
+ items.forEach((item) => {
108
+ var _a, _b, _c;
109
+ if (item.type === "condition") {
110
+ const { key, operator, value } = item;
111
+ const symbol = (_a = filterModeMap.get(operator == null ? void 0 : operator.value)) == null ? void 0 : _a.sqlOP;
112
+ cond += "$".concat(JSON.stringify({
113
+ name: (key == null ? void 0 : key.value) || "",
114
+ caption: (key == null ? void 0 : key.label) || ""
115
+ }), " ").concat(symbol, " $").concat(JSON.stringify({
116
+ value: (value == null ? void 0 : value.value) || "",
117
+ caption: (value == null ? void 0 : value.label) || "",
118
+ field: "".concat(((_b = map.get((key == null ? void 0 : key.value) || "")) == null ? void 0 : _b.appDataEntityFullTag) || "", ".").concat((key == null ? void 0 : key.value) || "")
119
+ }));
120
+ }
121
+ if (item.type === "connection") {
122
+ cond += " ".concat((_c = item.value) == null ? void 0 : _c.value, " ");
123
+ }
124
+ });
125
+ return cond;
126
+ };
127
+ const parseCustomCond = (cond) => {
128
+ var _a;
129
+ try {
130
+ const items = cond.split(" ");
131
+ const pqlItems = [];
132
+ for (let i = 0; i < items.length; i++) {
133
+ if (i !== 0) {
134
+ const connection = items[i];
135
+ if (connection === "and" || connection === "or") {
136
+ if (i === items.length - 1) {
137
+ throw new RuntimeError("pql\u81EA\u5B9A\u4E49\u6761\u4EF6\u89E3\u6790\u9519\u8BEF");
138
+ }
139
+ pqlItems.push({
140
+ type: "connection",
141
+ value: {
142
+ label: connection,
143
+ value: connection
144
+ }
145
+ });
146
+ } else {
147
+ throw new RuntimeError("pql\u81EA\u5B9A\u4E49\u6761\u4EF6\u89E3\u6790\u9519\u8BEF");
148
+ }
149
+ }
150
+ const key = items[i !== 0 ? ++i : i];
151
+ const operator = items[++i];
152
+ const value = items[++i];
153
+ if (key && /^\$/.test(key) && operator && value && /^\$/.test(value)) {
154
+ const keyObj = JSON.parse(key.slice(1));
155
+ const valueObj = JSON.parse(value.slice(1));
156
+ pqlItems.push({
157
+ type: "condition",
158
+ key: {
159
+ label: keyObj.caption,
160
+ value: keyObj.name
161
+ },
162
+ operator: {
163
+ label: ((_a = filterModeMap.get(symbolMap.get(operator))) == null ? void 0 : _a.label) || "",
164
+ value: symbolMap.get(operator)
165
+ },
166
+ value: {
167
+ label: valueObj.caption,
168
+ value: valueObj.value
169
+ }
170
+ });
171
+ continue;
172
+ }
173
+ throw new RuntimeError("pql\u81EA\u5B9A\u4E49\u6761\u4EF6\u89E3\u6790\u9519\u8BEF");
174
+ }
175
+ return pqlItems;
176
+ } catch (err) {
177
+ ibiz.log.error(err == null ? void 0 : err.message);
178
+ }
179
+ };
180
+ const pqlItemsToPqlNodes = async (items, fields, getCodeListItems) => {
181
+ const nodes = [];
182
+ const codeListMap = /* @__PURE__ */ new Map();
183
+ const fieldList = fields.filter(
184
+ (child) => items.some((item) => {
185
+ var _a;
186
+ return ((_a = item.key) == null ? void 0 : _a.value) === child.appDEFieldId;
187
+ })
188
+ );
189
+ await Promise.all(
190
+ fieldList.map(async (item) => {
191
+ if (item.appCodeListId) {
192
+ const codeItems = await getCodeListItems(item.appCodeListId);
193
+ if (codeItems) {
194
+ codeListMap.set(item.appDEFieldId, codeItems);
195
+ }
196
+ }
197
+ })
198
+ );
199
+ items.forEach((item) => {
200
+ var _a, _b;
201
+ if (item.type === "condition") {
202
+ const { key, operator, value } = item;
203
+ nodes.push({
204
+ type: "pql-field",
205
+ label: key == null ? void 0 : key.label,
206
+ value: key == null ? void 0 : key.value
207
+ });
208
+ nodes.push({
209
+ type: "pql-field-operator",
210
+ label: operator == null ? void 0 : operator.label,
211
+ value: operator == null ? void 0 : operator.value
212
+ });
213
+ const field = fields.find((child) => child.appDEFieldId === (key == null ? void 0 : key.value));
214
+ if (field && field.appCodeListId) {
215
+ const codeItems = codeListMap.get(field.appDEFieldId);
216
+ const codeItem = codeItems == null ? void 0 : codeItems.find((child) => child.value === (value == null ? void 0 : value.value));
217
+ if (codeItem) {
218
+ nodes.push({
219
+ type: "pql-field-value",
220
+ label: value == null ? void 0 : value.label,
221
+ value: value == null ? void 0 : value.value
222
+ });
223
+ } else {
224
+ nodes.push({
225
+ text: value == null ? void 0 : value.value
226
+ });
227
+ }
228
+ } else {
229
+ nodes.push({
230
+ text: value == null ? void 0 : value.value
231
+ });
232
+ }
233
+ }
234
+ if (item.type === "connection") {
235
+ nodes.push({
236
+ type: "pql-field-connection",
237
+ label: (_a = item.value) == null ? void 0 : _a.label,
238
+ value: (_b = item.value) == null ? void 0 : _b.value
239
+ });
240
+ }
241
+ });
242
+ return nodes;
243
+ };
244
+ const pqlNodeToHtml = (node) => {
245
+ const type = node.type || "";
246
+ if (!type) {
247
+ return node.text || "";
248
+ }
249
+ const html = '<span\n data-pql="true"\n data-w-e-type="'.concat(type, '"\n data-w-e-is-void\n data-w-e-is-inline\n data-label="').concat(node.label || "", '"\n data-value="').concat(node.value || "", '"\n ></span>');
250
+ return html;
251
+ };
252
+ const pqlNodesToHtml = (nodes) => {
253
+ let html = "<p>";
254
+ nodes.forEach((node) => {
255
+ html += pqlNodeToHtml(node);
256
+ });
257
+ html += "</p>";
258
+ return html;
259
+ };
260
+ function isMove(el) {
261
+ if (!el) {
262
+ return false;
263
+ }
264
+ if (el.getAttribute("data-slate-node") === "element" && el.getAttribute("data-slate-inline") && el.getAttribute("data-slate-void")) {
265
+ return true;
266
+ }
267
+ return isMove(el.parentElement);
268
+ }
269
+
270
+ export { ExcludeOPs, FilterModes, generateCustomCond, generateItems, isMove, parseCustomCond, pqlItemsToPqlNodes, pqlNodeToHtml, pqlNodesToHtml };
@@ -1,5 +1,5 @@
1
1
  import { isVNode, ref, watch, nextTick, onMounted, resolveComponent, createVNode, onBeforeUnmount, defineComponent } from 'vue';
2
- import { useControlController, useNamespace, useClickOutside } from '@ibiz-template/vue3-util';
2
+ import { useControlController, useNamespace } from '@ibiz-template/vue3-util';
3
3
  import { init } from 'echarts';
4
4
  import { createUUID } from 'qx-util';
5
5
  import { ChartController } from '@ibiz-template/runtime';
@@ -56,7 +56,6 @@ const ChartControl = /* @__PURE__ */ defineComponent({
56
56
  const showCheck = ref(false);
57
57
  const drillDetailPos = ref({});
58
58
  const drillDetailRef = ref();
59
- let func;
60
59
  let tempParams;
61
60
  const initSimpleData = () => {
62
61
  if (!props.data) {
@@ -96,16 +95,32 @@ const ChartControl = /* @__PURE__ */ defineComponent({
96
95
  const computedDrillDetailPos = (params) => {
97
96
  if (params.event) {
98
97
  const event = params.event.event;
99
- event.stopPropagation();
100
- event.preventDefault();
101
98
  const {
102
99
  offsetX,
103
100
  offsetY
104
101
  } = params.event;
105
- drillDetailPos.value = {
106
- top: "".concat(offsetY, "px"),
107
- left: "".concat(offsetX + 16, "px")
108
- };
102
+ const {
103
+ clientWidth
104
+ } = event.target;
105
+ if (offsetX + 160 > clientWidth) {
106
+ drillDetailPos.value = {
107
+ top: "".concat(offsetY - 20, "px"),
108
+ left: "".concat(offsetX - 160, "px")
109
+ };
110
+ } else {
111
+ drillDetailPos.value = {
112
+ top: "".concat(offsetY, "px"),
113
+ left: "".concat(offsetX + 16, "px")
114
+ };
115
+ }
116
+ }
117
+ };
118
+ const setDrillState = () => {
119
+ showCheck.value = false;
120
+ };
121
+ const setTipState = () => {
122
+ if (!showCheck.value) {
123
+ c.changeTooltipState(true);
109
124
  }
110
125
  };
111
126
  let resizeObserver;
@@ -114,6 +129,8 @@ const ChartControl = /* @__PURE__ */ defineComponent({
114
129
  const chart = init(chartRef.value);
115
130
  c.initChart(chart);
116
131
  window.addEventListener("resize", setHeight);
132
+ window.addEventListener("pointerdown", setDrillState);
133
+ window.addEventListener("click", setTipState);
117
134
  if (chartRef.value && ResizeObserver) {
118
135
  resizeObserver = new ResizeObserver(() => {
119
136
  c.resizeChart();
@@ -135,25 +152,19 @@ const ChartControl = /* @__PURE__ */ defineComponent({
135
152
  return;
136
153
  }
137
154
  tempParams = params;
155
+ computedDrillDetailPos(params);
138
156
  chart.dispatchAction({
139
157
  type: "hideTip"
140
158
  });
141
- showCheck.value = true;
142
159
  c.changeTooltipState(false);
143
- func = useClickOutside(drillDetailRef, () => {
144
- showCheck.value = false;
145
- c.changeTooltipState(true);
146
- func.stop();
147
- });
148
- computedDrillDetailPos(params);
160
+ showCheck.value = true;
149
161
  });
150
162
  }
151
163
  });
152
164
  const openDrillDetail = (_event) => {
165
+ _event.stopPropagation();
166
+ _event.preventDefault();
153
167
  showCheck.value = false;
154
- if (func) {
155
- func.stop();
156
- }
157
168
  c.changeTooltipState(true);
158
169
  const param = c.computedDrillDetailParam(tempParams);
159
170
  emit("drillDetail", param);
@@ -186,6 +197,8 @@ const ChartControl = /* @__PURE__ */ defineComponent({
186
197
  };
187
198
  onBeforeUnmount(() => {
188
199
  window.removeEventListener("resize", setHeight);
200
+ window.removeEventListener("pointerdown", setDrillState);
201
+ window.removeEventListener("click", setTipState);
189
202
  resizeObserver == null ? void 0 : resizeObserver.disconnect();
190
203
  });
191
204
  return {
@@ -223,7 +236,7 @@ const ChartControl = /* @__PURE__ */ defineComponent({
223
236
  "ref": "drillDetailRef",
224
237
  "class": this.ns.e("drill-detail"),
225
238
  "style": this.drillDetailPos,
226
- "onClick": this.openDrillDetail
239
+ "onPointerdown": this.openDrillDetail
227
240
  }, [createVNode("div", {
228
241
  "class": this.ns.em("drill-detail", "item")
229
242
  }, [createVNode("svg", {
@@ -1 +1 @@
1
- .ibiz-portlet-layout{--ibiz-portlet-layout-bg-color:transparent;--ibiz-portlet-layout-header-height:50px;--ibiz-portlet-layout-header-padding:calc(var(--ibiz-spacing-base-tight) + 2px) var(--ibiz-spacing-base);--ibiz-portlet-layout-header-margin:var(--ibiz-spacing-none);--ibiz-portlet-layout-header-bg-color:var(--ibiz-color-bg-1);--ibiz-portlet-layout-header-border-bottom:var(--ibiz-border);--ibiz-portlet-layout-caption-max-width:300px;--ibiz-portlet-layout-caption-font-weight:var(--ibiz-font-weight-regular);--ibiz-portlet-layout-caption-font-size:var(--ibiz-font-size-header-5);--ibiz-portlet-layout-caption-color:var(--ibiz-text-color-primary);--ibiz-portlet-layout-content-bg-color:var(--ibiz-color-bg-1);--ibiz-portlet-layout-content-padding:var(--ibiz-spacing-none);--ibiz-portlet-layout-content-margin:var(--ibiz-spacing-none);--ibiz-portlet-layout-padding:var(--ibiz-spacing-tight);width:100%;height:100%;padding:var(--ibiz-portlet-layout-padding);background-color:var(--ibiz-portlet-layout-bg-color)}.ibiz-portlet-layout__caption{max-width:var(--ibiz-portlet-layout-caption-max-width);height:100%;padding:var(--ibiz-spacing-none) var(--ibiz-spacing-none) var(--ibiz-spacing-none) var(--ibiz-spacing-base)}.ibiz-portlet-layout__caption-text{font-size:var(--ibiz-portlet-layout-caption-font-size);font-weight:var(--ibiz-portlet-layout-caption-font-weight);line-height:var(--ibiz-portlet-layout-caption-font-size);color:var(--ibiz-portlet-layout-caption-color)}.ibiz-portlet-layout__caption::before{position:absolute;top:50%;left:0;width:4px;height:var(--ibiz-width-icon-large);content:"";background-color:var(--ibiz-color-primary);border-radius:var(--ibiz-border-radius-extra-small);transform:translateY(-50%)}.ibiz-portlet-layout.is-no-header>.ibiz-portlet-layout-content{height:100%}.ibiz-portlet-layout-header{display:flex;justify-content:space-between;height:var(--ibiz-portlet-layout-header-height);padding:var(--ibiz-portlet-layout-header-padding);margin:var(--ibiz-portlet-layout-header-margin);background-color:var(--ibiz-portlet-layout-header-bg-color);border-bottom:var(--ibiz-portlet-layout-header-border-bottom)}.ibiz-portlet-layout-header__left{position:relative}.ibiz-portlet-layout-content{height:calc(100% - var(--ibiz-portlet-layout-header-height));padding:var(--ibiz-portlet-layout-content-padding);margin:var(--ibiz-portlet-layout-content-margin);overflow-y:scroll;background-color:var(--ibiz-portlet-layout-content-bg-color)}
1
+ .ibiz-portlet-layout{--ibiz-portlet-layout-bg-color:transparent;--ibiz-portlet-layout-header-height:50px;--ibiz-portlet-layout-header-padding:calc(var(--ibiz-spacing-base-tight) + 2px) var(--ibiz-spacing-base);--ibiz-portlet-layout-header-margin:var(--ibiz-spacing-none);--ibiz-portlet-layout-header-bg-color:var(--ibiz-color-bg-1);--ibiz-portlet-layout-header-border-bottom:var(--ibiz-border);--ibiz-portlet-layout-caption-max-width:300px;--ibiz-portlet-layout-caption-font-weight:var(--ibiz-font-weight-regular);--ibiz-portlet-layout-caption-font-size:var(--ibiz-font-size-header-5);--ibiz-portlet-layout-caption-color:var(--ibiz-text-color-primary);--ibiz-portlet-layout-content-bg-color:var(--ibiz-color-bg-1);--ibiz-portlet-layout-content-padding:var(--ibiz-spacing-none);--ibiz-portlet-layout-content-margin:var(--ibiz-spacing-none);--ibiz-portlet-layout-padding:var(--ibiz-spacing-tight);width:100%;height:100%;padding:var(--ibiz-portlet-layout-padding);background-color:var(--ibiz-portlet-layout-bg-color)}.ibiz-portlet-layout__caption{max-width:var(--ibiz-portlet-layout-caption-max-width);height:100%;padding:var(--ibiz-spacing-none) var(--ibiz-spacing-none) var(--ibiz-spacing-none) var(--ibiz-spacing-base)}.ibiz-portlet-layout__caption-text{font-size:var(--ibiz-portlet-layout-caption-font-size);font-weight:var(--ibiz-portlet-layout-caption-font-weight);line-height:var(--ibiz-portlet-layout-caption-font-size);color:var(--ibiz-portlet-layout-caption-color)}.ibiz-portlet-layout__caption::before{position:absolute;top:50%;left:0;width:4px;height:var(--ibiz-width-icon-large);content:"";background-color:var(--ibiz-color-primary);border-radius:var(--ibiz-border-radius-extra-small);transform:translateY(-50%)}.ibiz-portlet-layout__caption.is-link{cursor:pointer}.ibiz-portlet-layout__caption.is-link:hover{color:var(--ibiz-color-link)}.ibiz-portlet-layout.is-no-header>.ibiz-portlet-layout-content{height:100%}.ibiz-portlet-layout-header{display:flex;justify-content:space-between;height:var(--ibiz-portlet-layout-header-height);padding:var(--ibiz-portlet-layout-header-padding);margin:var(--ibiz-portlet-layout-header-margin);background-color:var(--ibiz-portlet-layout-header-bg-color);border-bottom:var(--ibiz-portlet-layout-header-border-bottom)}.ibiz-portlet-layout-header__left{position:relative}.ibiz-portlet-layout-content{height:calc(100% - var(--ibiz-portlet-layout-header-height));padding:var(--ibiz-portlet-layout-content-padding);margin:var(--ibiz-portlet-layout-content-margin);overflow-y:scroll;background-color:var(--ibiz-portlet-layout-content-bg-color)}
@@ -1,3 +1,4 @@
1
+ import { PropType } from 'vue';
1
2
  import { IUIActionGroupDetail } from '@ibiz/model-core';
2
3
  import './portlet-layout.scss';
3
4
  import { PortletPartController } from '@ibiz-template/runtime';
@@ -9,6 +10,9 @@ export declare const PortletLayout: import("vue").DefineComponent<{
9
10
  type: typeof PortletPartController;
10
11
  required: true;
11
12
  };
13
+ linkAction: {
14
+ type: PropType<IUIActionGroupDetail>;
15
+ };
12
16
  }, {
13
17
  c: PortletPartController<import("@ibiz/model-core").IDBPortletPart>;
14
18
  ns: import("@ibiz-template/core").Namespace;
@@ -16,9 +20,13 @@ export declare const PortletLayout: import("vue").DefineComponent<{
16
20
  portletType: string;
17
21
  isShowHeader: import("vue").ComputedRef<string | import("@ibiz/model-core").ISysImage | import("@ibiz/model-core").IUIActionGroup | undefined>;
18
22
  onActionClick: (detail: IUIActionGroupDetail, event: MouseEvent) => Promise<void>;
23
+ openLink: (event: MouseEvent) => void;
19
24
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
20
25
  controller: {
21
26
  type: typeof PortletPartController;
22
27
  required: true;
23
28
  };
29
+ linkAction: {
30
+ type: PropType<IUIActionGroupDetail>;
31
+ };
24
32
  }>>, {}, {}>;
@@ -11,6 +11,9 @@ const PortletLayout = /* @__PURE__ */ defineComponent({
11
11
  controller: {
12
12
  type: PortletPartController,
13
13
  required: true
14
+ },
15
+ linkAction: {
16
+ type: Object
14
17
  }
15
18
  },
16
19
  setup(props) {
@@ -32,13 +35,19 @@ const PortletLayout = /* @__PURE__ */ defineComponent({
32
35
  const onActionClick = async (detail, event) => {
33
36
  await props.controller.onActionClick(detail, event);
34
37
  };
38
+ const openLink = (event) => {
39
+ if (props.linkAction) {
40
+ props.controller.onActionClick(props.linkAction, event);
41
+ }
42
+ };
35
43
  return {
36
44
  c,
37
45
  ns,
38
46
  popperClass,
39
47
  portletType,
40
48
  isShowHeader,
41
- onActionClick
49
+ onActionClick,
50
+ openLink
42
51
  };
43
52
  },
44
53
  render() {
@@ -55,7 +64,8 @@ const PortletLayout = /* @__PURE__ */ defineComponent({
55
64
  }, [createVNode("div", {
56
65
  "class": this.ns.be("header", "left")
57
66
  }, [model.showTitleBar && createVNode("div", {
58
- "class": this.ns.e("caption")
67
+ "class": [this.ns.e("caption"), this.ns.is("link", !!this.linkAction)],
68
+ "onClick": this.openLink
59
69
  }, [createVNode(resolveComponent("iBizIcon"), {
60
70
  "class": this.ns.e("caption-icon"),
61
71
  "icon": model.sysImage
@@ -11,6 +11,7 @@ export declare const IBizReportPortlet: import("@ibiz-template/vue3-util").TypeW
11
11
  }, {
12
12
  ns: import("@ibiz-template/core").Namespace;
13
13
  report: import("@ibiz/model-core").IControl | undefined;
14
+ linkAction: import("vue").ComputedRef<import("@ibiz/model-core").IUIActionGroupDetail | undefined>;
14
15
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
15
16
  modelData: {
16
17
  type: import("vue").PropType<import("@ibiz/model-core").IDBSysPortletPart>;
@@ -12,6 +12,7 @@ export declare const ReportPortlet: import("vue").DefineComponent<{
12
12
  }, {
13
13
  ns: import("@ibiz-template/core").Namespace;
14
14
  report: import("@ibiz/model-core").IControl | undefined;
15
+ linkAction: import("vue").ComputedRef<import("@ibiz/model-core").IUIActionGroupDetail | undefined>;
15
16
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
16
17
  modelData: {
17
18
  type: PropType<import("@ibiz/model-core").IDBSysPortletPart>;