yc-pro-components 0.0.85 → 1.0.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 (156) hide show
  1. package/es/components/index.d.ts +1 -0
  2. package/es/components/index.mjs +1 -0
  3. package/es/components/page/src/index.vue2.mjs +31 -13
  4. package/es/components/search/src/index.vue2.mjs +1 -0
  5. package/es/components/yc-plus-page/src/index.vue.mjs +1 -1
  6. package/es/components/yc-plus-page/src/index.vue2.mjs +24 -13
  7. package/es/components/yc-plus-page/src/type.d.ts +5 -0
  8. package/es/components/yc-query-filter/index.d.ts +7 -0
  9. package/es/components/yc-query-filter/index.mjs +6 -0
  10. package/es/components/yc-query-filter/src/index.vue.d.ts +32 -0
  11. package/es/components/yc-query-filter/src/index.vue.mjs +6 -0
  12. package/es/components/yc-query-filter/src/index.vue2.mjs +662 -0
  13. package/es/components/yc-query-filter/src/serialize.d.ts +4 -0
  14. package/es/components/yc-query-filter/src/serialize.mjs +17 -0
  15. package/es/constants/index.d.ts +1 -0
  16. package/es/constants/index.mjs +1 -0
  17. package/es/constants/query-filter.d.ts +69 -0
  18. package/es/constants/query-filter.mjs +3 -0
  19. package/es/hooks/index.d.ts +1 -0
  20. package/es/hooks/index.mjs +1 -0
  21. package/es/hooks/useQueryFilterConfig.d.ts +11 -0
  22. package/es/hooks/useQueryFilterConfig.mjs +38 -0
  23. package/es/index.css +12 -12
  24. package/es/index.d.ts +1 -1
  25. package/es/index.mjs +3 -0
  26. package/es/locale/lang/en.d.ts +33 -0
  27. package/es/locale/lang/en.mjs +33 -0
  28. package/es/locale/lang/ja.d.ts +33 -0
  29. package/es/locale/lang/ja.mjs +33 -0
  30. package/es/locale/lang/ko.d.ts +33 -0
  31. package/es/locale/lang/ko.mjs +33 -0
  32. package/es/locale/lang/zh-cn.d.ts +33 -0
  33. package/es/locale/lang/zh-cn.mjs +33 -0
  34. package/es/locale/lang/zh-tw.d.ts +33 -0
  35. package/es/locale/lang/zh-tw.mjs +33 -0
  36. package/es/version.d.ts +1 -1
  37. package/es/version.mjs +1 -1
  38. package/es/yc-components/index.d.ts +1 -1
  39. package/es/yc-components/version.d.ts +1 -1
  40. package/index.css +1 -1
  41. package/index.js +1069 -213
  42. package/index.min.css +1 -1
  43. package/index.min.js +16 -12
  44. package/index.min.mjs +16 -12
  45. package/index.mjs +1065 -215
  46. package/lib/components/index.d.ts +1 -0
  47. package/lib/components/index.js +3 -0
  48. package/lib/components/page/src/index.vue2.js +31 -13
  49. package/lib/components/search/src/index.vue2.js +1 -0
  50. package/lib/components/yc-plus-page/src/index.vue.js +1 -1
  51. package/lib/components/yc-plus-page/src/index.vue2.js +26 -15
  52. package/lib/components/yc-plus-page/src/type.d.ts +5 -0
  53. package/lib/components/yc-query-filter/index.d.ts +7 -0
  54. package/lib/components/yc-query-filter/index.js +9 -0
  55. package/lib/components/yc-query-filter/src/index.vue.d.ts +32 -0
  56. package/lib/components/yc-query-filter/src/index.vue.js +10 -0
  57. package/lib/components/yc-query-filter/src/index.vue2.js +666 -0
  58. package/lib/components/yc-query-filter/src/serialize.d.ts +4 -0
  59. package/lib/components/yc-query-filter/src/serialize.js +20 -0
  60. package/lib/constants/index.d.ts +1 -0
  61. package/lib/constants/index.js +2 -0
  62. package/lib/constants/query-filter.d.ts +69 -0
  63. package/lib/constants/query-filter.js +5 -0
  64. package/lib/hooks/index.d.ts +1 -0
  65. package/lib/hooks/index.js +4 -0
  66. package/lib/hooks/useQueryFilterConfig.d.ts +11 -0
  67. package/lib/hooks/useQueryFilterConfig.js +42 -0
  68. package/lib/index.css +9 -9
  69. package/lib/index.d.ts +1 -1
  70. package/lib/index.js +9 -0
  71. package/lib/locale/lang/en.d.ts +33 -0
  72. package/lib/locale/lang/en.js +33 -0
  73. package/lib/locale/lang/ja.d.ts +33 -0
  74. package/lib/locale/lang/ja.js +33 -0
  75. package/lib/locale/lang/ko.d.ts +33 -0
  76. package/lib/locale/lang/ko.js +33 -0
  77. package/lib/locale/lang/zh-cn.d.ts +33 -0
  78. package/lib/locale/lang/zh-cn.js +33 -0
  79. package/lib/locale/lang/zh-tw.d.ts +33 -0
  80. package/lib/locale/lang/zh-tw.js +33 -0
  81. package/lib/version.d.ts +1 -1
  82. package/lib/version.js +1 -1
  83. package/lib/yc-components/index.d.ts +1 -1
  84. package/lib/yc-components/version.d.ts +1 -1
  85. package/locale/en.d.ts +33 -0
  86. package/locale/en.js +34 -1
  87. package/locale/en.min.js +1 -1
  88. package/locale/en.min.mjs +1 -1
  89. package/locale/en.mjs +34 -1
  90. package/locale/ja.d.ts +33 -0
  91. package/locale/ja.js +34 -1
  92. package/locale/ja.min.js +1 -1
  93. package/locale/ja.min.mjs +1 -1
  94. package/locale/ja.mjs +34 -1
  95. package/locale/ko.d.ts +33 -0
  96. package/locale/ko.js +34 -1
  97. package/locale/ko.min.js +1 -1
  98. package/locale/ko.min.mjs +1 -1
  99. package/locale/ko.mjs +34 -1
  100. package/locale/zh-cn.d.ts +33 -0
  101. package/locale/zh-cn.js +34 -1
  102. package/locale/zh-cn.min.js +1 -1
  103. package/locale/zh-cn.min.mjs +1 -1
  104. package/locale/zh-cn.mjs +34 -1
  105. package/locale/zh-tw.d.ts +33 -0
  106. package/locale/zh-tw.js +34 -1
  107. package/locale/zh-tw.min.js +1 -1
  108. package/locale/zh-tw.min.mjs +1 -1
  109. package/locale/zh-tw.mjs +34 -1
  110. package/package.json +1 -1
  111. package/theme-chalk/index.css +1 -1
  112. package/theme-chalk/plus-yc-query-filter.css +1 -0
  113. package/theme-chalk/src/index.scss +1 -0
  114. package/theme-chalk/src/yc-query-filter.scss +163 -0
  115. package/es/components/breadcrumb/index.d.ts +0 -6985
  116. package/es/components/breadcrumb/src/index.vue.d.ts +0 -6947
  117. package/es/components/dialog-form/index.d.ts +0 -314
  118. package/es/components/dialog-form/src/index.vue.d.ts +0 -214
  119. package/es/components/display-item/index.d.ts +0 -580
  120. package/es/components/display-item/src/index.vue.d.ts +0 -446
  121. package/es/components/drawer-form/index.d.ts +0 -1592
  122. package/es/components/drawer-form/src/index.vue.d.ts +0 -630
  123. package/es/components/form/index.d.ts +0 -870
  124. package/es/components/form/src/form-content.vue.d.ts +0 -598
  125. package/es/components/form/src/index.vue.d.ts +0 -382
  126. package/es/components/form-item/index.d.ts +0 -1492
  127. package/es/components/form-item/src/index.vue.d.ts +0 -550
  128. package/es/components/page/index.d.ts +0 -10746
  129. package/es/components/page/src/index.vue.d.ts +0 -3775
  130. package/es/components/search/index.d.ts +0 -2977
  131. package/es/components/search/src/index.vue.d.ts +0 -1021
  132. package/es/components/table/src/table-column.vue.d.ts +0 -624
  133. package/es/components/yc-drawer/store.d.ts +0 -2359
  134. package/es/components/yc-plus-page/src/index.vue.d.ts +0 -8250
  135. package/es/hooks/usePlusFormReset.d.ts +0 -4501
  136. package/lib/components/breadcrumb/index.d.ts +0 -6985
  137. package/lib/components/breadcrumb/src/index.vue.d.ts +0 -6947
  138. package/lib/components/dialog-form/index.d.ts +0 -314
  139. package/lib/components/dialog-form/src/index.vue.d.ts +0 -214
  140. package/lib/components/display-item/index.d.ts +0 -580
  141. package/lib/components/display-item/src/index.vue.d.ts +0 -446
  142. package/lib/components/drawer-form/index.d.ts +0 -1592
  143. package/lib/components/drawer-form/src/index.vue.d.ts +0 -630
  144. package/lib/components/form/index.d.ts +0 -870
  145. package/lib/components/form/src/form-content.vue.d.ts +0 -598
  146. package/lib/components/form/src/index.vue.d.ts +0 -382
  147. package/lib/components/form-item/index.d.ts +0 -1492
  148. package/lib/components/form-item/src/index.vue.d.ts +0 -550
  149. package/lib/components/page/index.d.ts +0 -10746
  150. package/lib/components/page/src/index.vue.d.ts +0 -3775
  151. package/lib/components/search/index.d.ts +0 -2977
  152. package/lib/components/search/src/index.vue.d.ts +0 -1021
  153. package/lib/components/table/src/table-column.vue.d.ts +0 -624
  154. package/lib/components/yc-drawer/store.d.ts +0 -2359
  155. package/lib/components/yc-plus-page/src/index.vue.d.ts +0 -8250
  156. package/lib/hooks/usePlusFormReset.d.ts +0 -4501
@@ -0,0 +1,666 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var vue = require('vue');
6
+ var vueRouter = require('vue-router');
7
+ var elementPlus = require('element-plus');
8
+ var ElementPlusIconsVue = require('@element-plus/icons-vue');
9
+ var useLocale = require('../../../hooks/useLocale.js');
10
+ require('sortablejs');
11
+ var useQueryFilterConfig = require('../../../hooks/useQueryFilterConfig.js');
12
+ var serialize = require('./serialize.js');
13
+
14
+ const _hoisted_1 = {
15
+ key: 0,
16
+ class: "yc-query-filter"
17
+ };
18
+ const _hoisted_2 = { class: "yc-query-filter__panel" };
19
+ const _hoisted_3 = {
20
+ key: 0,
21
+ class: "yc-query-filter__loading"
22
+ };
23
+ const _hoisted_4 = { class: "yc-query-filter__col" };
24
+ const _hoisted_5 = { class: "yc-query-filter__title" };
25
+ const _hoisted_6 = {
26
+ key: 0,
27
+ class: "yc-query-filter__empty"
28
+ };
29
+ const _hoisted_7 = {
30
+ key: 1,
31
+ class: "yc-query-filter__list"
32
+ };
33
+ const _hoisted_8 = ["onClick"];
34
+ const _hoisted_9 = { class: "yc-query-filter__ops" };
35
+ const _hoisted_10 = { class: "yc-query-filter__col yc-query-filter__col--right" };
36
+ const _hoisted_11 = { class: "yc-query-filter__title" };
37
+ const _hoisted_12 = { class: "yc-query-filter__tabs" };
38
+ const _hoisted_13 = {
39
+ key: 1,
40
+ class: "yc-query-filter__list"
41
+ };
42
+ const _hoisted_14 = ["onClick"];
43
+ const _hoisted_15 = { class: "yc-query-filter__meta" };
44
+ const _hoisted_16 = { class: "yc-query-filter__highlight" };
45
+ const _hoisted_17 = { class: "yc-query-filter__ops" };
46
+ const _hoisted_18 = {
47
+ key: 1,
48
+ class: "yc-query-filter__list"
49
+ };
50
+ const _hoisted_19 = ["onClick"];
51
+ const _hoisted_20 = { class: "yc-query-filter__meta" };
52
+ const _hoisted_21 = { class: "yc-query-filter__highlight" };
53
+ const _hoisted_22 = { class: "yc-query-filter__ops" };
54
+ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
55
+ ...{
56
+ name: "YcQueryFilterManager"
57
+ },
58
+ __name: "index",
59
+ props: {
60
+ pageInstance: {},
61
+ queryFilterKey: { default: "main" }
62
+ },
63
+ setup(__props) {
64
+ const props = __props;
65
+ const { t } = useLocale.useLocale();
66
+ const config = useQueryFilterConfig.useQueryFilterConfig();
67
+ const enabled = vue.computed(
68
+ () => !!((config == null ? void 0 : config.enabled) && config.api && config.appCode && pageEnabled.value)
69
+ );
70
+ const route = vue.inject(vueRouter.routeLocationKey, null);
71
+ const pageCode = vue.computed(() => {
72
+ const custom = config == null ? void 0 : config.pageCode;
73
+ if (typeof custom === "function") return custom();
74
+ if (custom) return custom;
75
+ const routeName = String((route == null ? void 0 : route.name) || (route == null ? void 0 : route.path) || "unnamed");
76
+ return `${config == null ? void 0 : config.appCode}:${routeName}:${props.queryFilterKey}`;
77
+ });
78
+ const schemaVersion = vue.ref(1);
79
+ const pageEnabled = vue.ref(true);
80
+ const mine = vue.ref([]);
81
+ const received = vue.ref([]);
82
+ const shared = vue.ref([]);
83
+ const rightTab = vue.ref("received");
84
+ const panelVisible = vue.ref(false);
85
+ const loading = vue.ref(false);
86
+ const saveVisible = vue.ref(false);
87
+ const saveName = vue.ref("");
88
+ const editingId = vue.ref(null);
89
+ const editingItem = vue.ref(null);
90
+ const saving = vue.ref(false);
91
+ const shareVisible = vue.ref(false);
92
+ const sharingId = vue.ref(null);
93
+ const shareUserIds = vue.ref([]);
94
+ const userOptions = vue.ref([]);
95
+ function getPage() {
96
+ return vue.unref(props.pageInstance);
97
+ }
98
+ function getFormValues() {
99
+ var _a;
100
+ const page = getPage();
101
+ const values = (_a = page == null ? void 0 : page.getSearchFieldsValue) == null ? void 0 : _a.call(page);
102
+ return values && typeof values === "object" ? { ...values } : {};
103
+ }
104
+ function displayTime(value) {
105
+ if (!value) return "";
106
+ const matched = value.match(/^(\d{4}-\d{2}-\d{2} \d{2}:\d{2})/);
107
+ return matched ? matched[1] : value;
108
+ }
109
+ function applyItem(item) {
110
+ var _a, _b;
111
+ const fields = serialize.extractQueryFilterFields(item.conditions);
112
+ const page = getPage();
113
+ if (page == null ? void 0 : page.replaceSearchFormValues) {
114
+ page.replaceSearchFormValues(fields);
115
+ } else {
116
+ (_a = page == null ? void 0 : page.clearSearchFieldsValue) == null ? void 0 : _a.call(page);
117
+ (_b = page == null ? void 0 : page.setSearchFieldsValue) == null ? void 0 : _b.call(page, fields);
118
+ }
119
+ if (schemaVersion.value && item.schemaVersion && item.schemaVersion !== schemaVersion.value) {
120
+ elementPlus.ElMessage.warning(t("plus.queryFilter.schemaMismatch"));
121
+ } else {
122
+ elementPlus.ElMessage.success(t("plus.queryFilter.applied"));
123
+ }
124
+ panelVisible.value = false;
125
+ }
126
+ async function refreshList() {
127
+ if (!(config == null ? void 0 : config.api)) return;
128
+ loading.value = true;
129
+ try {
130
+ const data = await config.api.list({
131
+ appCode: config.appCode,
132
+ pageCode: pageCode.value
133
+ });
134
+ schemaVersion.value = (data == null ? void 0 : data.schemaVersion) || 1;
135
+ pageEnabled.value = (data == null ? void 0 : data.enabled) !== false;
136
+ mine.value = (data == null ? void 0 : data.mine) || [];
137
+ received.value = (data == null ? void 0 : data.received) || [];
138
+ shared.value = (data == null ? void 0 : data.shared) || [];
139
+ } finally {
140
+ loading.value = false;
141
+ }
142
+ }
143
+ function openSaveAs() {
144
+ editingId.value = null;
145
+ editingItem.value = null;
146
+ saveName.value = "";
147
+ saveVisible.value = true;
148
+ }
149
+ function openEdit(item) {
150
+ editingId.value = item.id;
151
+ editingItem.value = item;
152
+ saveName.value = item.name;
153
+ saveVisible.value = true;
154
+ }
155
+ async function confirmSave() {
156
+ const name = saveName.value.trim();
157
+ if (!name) {
158
+ elementPlus.ElMessage.warning(t("plus.queryFilter.namePlaceholder"));
159
+ return;
160
+ }
161
+ if (!(config == null ? void 0 : config.api)) return;
162
+ saving.value = true;
163
+ try {
164
+ const owned = mine.value.some((item) => item.id === editingId.value);
165
+ if (editingId.value && owned) {
166
+ await config.api.update({ id: editingId.value, name });
167
+ } else {
168
+ const fields = editingItem.value ? serialize.extractQueryFilterFields(editingItem.value.conditions) : getFormValues();
169
+ await config.api.saveAs({
170
+ appCode: config.appCode,
171
+ pageCode: pageCode.value,
172
+ name,
173
+ conditions: serialize.serializeQueryFilter(fields, schemaVersion.value)
174
+ });
175
+ }
176
+ elementPlus.ElMessage.success(t("plus.queryFilter.saveSuccess"));
177
+ saveVisible.value = false;
178
+ await refreshList();
179
+ } catch (error) {
180
+ elementPlus.ElMessage.error(error instanceof Error ? error.message : t("plus.queryFilter.saveSuccess"));
181
+ } finally {
182
+ saving.value = false;
183
+ }
184
+ }
185
+ function confirmOptions() {
186
+ return {
187
+ type: "warning",
188
+ confirmButtonText: t("plus.dialog.confirmText"),
189
+ cancelButtonText: t("plus.dialog.cancelText")
190
+ };
191
+ }
192
+ async function removeItem(item) {
193
+ if (!(config == null ? void 0 : config.api)) return;
194
+ try {
195
+ await elementPlus.ElMessageBox.confirm(
196
+ t("plus.queryFilter.confirmDelete"),
197
+ t("plus.table.prompt"),
198
+ confirmOptions()
199
+ );
200
+ await config.api.delete({ id: item.id });
201
+ elementPlus.ElMessage.success(t("plus.queryFilter.deleteSuccess"));
202
+ await refreshList();
203
+ } catch (e) {
204
+ }
205
+ }
206
+ async function openShare(item) {
207
+ sharingId.value = item.id;
208
+ shareUserIds.value = [...item.recipientUserIds || []];
209
+ if (config == null ? void 0 : config.openUserSelector) {
210
+ try {
211
+ const ids = await config.openUserSelector();
212
+ if (ids == null ? void 0 : ids.length) {
213
+ await config.api.share({ id: item.id, recipientUserIds: ids });
214
+ elementPlus.ElMessage.success(t("plus.queryFilter.shareSuccess"));
215
+ await refreshList();
216
+ }
217
+ } catch (error) {
218
+ if (error instanceof Error && error.message) elementPlus.ElMessage.error(error.message);
219
+ }
220
+ return;
221
+ }
222
+ if (!(config == null ? void 0 : config.searchUsers)) {
223
+ elementPlus.ElMessage.warning(t("plus.queryFilter.noSelector"));
224
+ return;
225
+ }
226
+ userOptions.value = await config.searchUsers("");
227
+ shareVisible.value = true;
228
+ }
229
+ async function remoteSearchUsers(keyword) {
230
+ if (!(config == null ? void 0 : config.searchUsers)) return;
231
+ userOptions.value = await config.searchUsers(keyword);
232
+ }
233
+ async function confirmShare() {
234
+ if (!(config == null ? void 0 : config.api) || !sharingId.value) return;
235
+ if (!shareUserIds.value.length) {
236
+ elementPlus.ElMessage.warning(t("plus.queryFilter.sharePlaceholder"));
237
+ return;
238
+ }
239
+ try {
240
+ await config.api.share({ id: sharingId.value, recipientUserIds: shareUserIds.value });
241
+ elementPlus.ElMessage.success(t("plus.queryFilter.shareSuccess"));
242
+ shareVisible.value = false;
243
+ await refreshList();
244
+ } catch (error) {
245
+ elementPlus.ElMessage.error(error instanceof Error ? error.message : t("plus.queryFilter.shareSuccess"));
246
+ }
247
+ }
248
+ async function revokeShare(item, recipientUserIds) {
249
+ if (!(config == null ? void 0 : config.api)) return;
250
+ try {
251
+ await elementPlus.ElMessageBox.confirm(
252
+ t("plus.queryFilter.confirmRevoke"),
253
+ t("plus.table.prompt"),
254
+ confirmOptions()
255
+ );
256
+ await config.api.revoke({ id: item.id, recipientUserIds });
257
+ elementPlus.ElMessage.success(t("plus.queryFilter.revokeSuccess"));
258
+ await refreshList();
259
+ } catch (e) {
260
+ }
261
+ }
262
+ function receivedPrefix(item) {
263
+ return t("plus.queryFilter.sharedByPrefix", {
264
+ time: displayTime(item.sharedTime || item.createdTime),
265
+ sender: item.ownerUserName || item.ownerUserId
266
+ });
267
+ }
268
+ function sharedPrefix(item) {
269
+ var _a, _b;
270
+ const recipient = ((_a = item.recipientNames) == null ? void 0 : _a[0]) || (((_b = item.recipientUserIds) == null ? void 0 : _b.length) ? `${item.recipientUserIds.length}` : "");
271
+ return t("plus.queryFilter.sharedToPrefix", {
272
+ time: displayTime(item.sharedTime || item.updatedTime || item.createdTime),
273
+ recipient
274
+ });
275
+ }
276
+ return (_ctx, _cache) => {
277
+ return enabled.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1, [
278
+ vue.createVNode(vue.unref(elementPlus.ElButton), { onClick: openSaveAs }, {
279
+ default: vue.withCtx(() => [
280
+ vue.createTextVNode(
281
+ vue.toDisplayString(vue.unref(t)("plus.queryFilter.saveAs")),
282
+ 1
283
+ /* TEXT */
284
+ )
285
+ ]),
286
+ _: 1
287
+ /* STABLE */
288
+ }),
289
+ vue.createVNode(vue.unref(elementPlus.ElPopover), {
290
+ visible: panelVisible.value,
291
+ "onUpdate:visible": _cache[2] || (_cache[2] = ($event) => panelVisible.value = $event),
292
+ placement: "bottom-end",
293
+ width: 720,
294
+ trigger: "click",
295
+ teleported: "",
296
+ onShow: refreshList
297
+ }, {
298
+ reference: vue.withCtx(() => [
299
+ vue.createVNode(vue.unref(elementPlus.ElButton), null, {
300
+ default: vue.withCtx(() => [
301
+ vue.createTextVNode(
302
+ vue.toDisplayString(vue.unref(t)("plus.queryFilter.saved")),
303
+ 1
304
+ /* TEXT */
305
+ )
306
+ ]),
307
+ _: 1
308
+ /* STABLE */
309
+ })
310
+ ]),
311
+ default: vue.withCtx(() => [
312
+ vue.createElementVNode("div", _hoisted_2, [
313
+ loading.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3, "...")) : vue.createCommentVNode("v-if", true),
314
+ vue.createElementVNode("div", _hoisted_4, [
315
+ vue.createElementVNode(
316
+ "div",
317
+ _hoisted_5,
318
+ vue.toDisplayString(vue.unref(t)("plus.queryFilter.savedTitle")),
319
+ 1
320
+ /* TEXT */
321
+ ),
322
+ !mine.value.length ? (vue.openBlock(), vue.createElementBlock(
323
+ "div",
324
+ _hoisted_6,
325
+ vue.toDisplayString(vue.unref(t)("plus.queryFilter.emptyMine")),
326
+ 1
327
+ /* TEXT */
328
+ )) : (vue.openBlock(), vue.createElementBlock("ul", _hoisted_7, [
329
+ (vue.openBlock(true), vue.createElementBlock(
330
+ vue.Fragment,
331
+ null,
332
+ vue.renderList(mine.value, (item) => {
333
+ return vue.openBlock(), vue.createElementBlock("li", {
334
+ key: item.id,
335
+ class: "yc-query-filter__item"
336
+ }, [
337
+ vue.createElementVNode("button", {
338
+ type: "button",
339
+ class: "yc-query-filter__name",
340
+ onClick: ($event) => applyItem(item)
341
+ }, vue.toDisplayString(item.name), 9, _hoisted_8),
342
+ vue.createElementVNode("span", _hoisted_9, [
343
+ vue.createVNode(vue.unref(elementPlus.ElButton), {
344
+ link: "",
345
+ type: "danger",
346
+ icon: vue.unref(ElementPlusIconsVue.Delete),
347
+ title: vue.unref(t)("plus.queryFilter.remove"),
348
+ onClick: vue.withModifiers(($event) => removeItem(item), ["stop"])
349
+ }, null, 8, ["icon", "title", "onClick"]),
350
+ vue.createVNode(vue.unref(elementPlus.ElButton), {
351
+ link: "",
352
+ icon: vue.unref(ElementPlusIconsVue.EditPen),
353
+ title: vue.unref(t)("plus.queryFilter.edit"),
354
+ onClick: vue.withModifiers(($event) => openEdit(item), ["stop"])
355
+ }, null, 8, ["icon", "title", "onClick"]),
356
+ vue.createVNode(vue.unref(elementPlus.ElButton), {
357
+ link: "",
358
+ icon: vue.unref(ElementPlusIconsVue.Share),
359
+ title: vue.unref(t)("plus.queryFilter.share"),
360
+ onClick: vue.withModifiers(($event) => openShare(item), ["stop"])
361
+ }, null, 8, ["icon", "title", "onClick"])
362
+ ])
363
+ ]);
364
+ }),
365
+ 128
366
+ /* KEYED_FRAGMENT */
367
+ ))
368
+ ]))
369
+ ]),
370
+ vue.createElementVNode("div", _hoisted_10, [
371
+ vue.createElementVNode(
372
+ "div",
373
+ _hoisted_11,
374
+ vue.toDisplayString(vue.unref(t)("plus.queryFilter.panelTitle")),
375
+ 1
376
+ /* TEXT */
377
+ ),
378
+ vue.createElementVNode("div", _hoisted_12, [
379
+ vue.createElementVNode(
380
+ "button",
381
+ {
382
+ type: "button",
383
+ class: vue.normalizeClass({ "is-active": rightTab.value === "received" }),
384
+ onClick: _cache[0] || (_cache[0] = ($event) => rightTab.value = "received")
385
+ },
386
+ vue.toDisplayString(vue.unref(t)("plus.queryFilter.received")),
387
+ 3
388
+ /* TEXT, CLASS */
389
+ ),
390
+ vue.createElementVNode(
391
+ "button",
392
+ {
393
+ type: "button",
394
+ class: vue.normalizeClass({ "is-active": rightTab.value === "shared" }),
395
+ onClick: _cache[1] || (_cache[1] = ($event) => rightTab.value = "shared")
396
+ },
397
+ vue.toDisplayString(vue.unref(t)("plus.queryFilter.shared")),
398
+ 3
399
+ /* TEXT, CLASS */
400
+ )
401
+ ]),
402
+ rightTab.value === "received" ? (vue.openBlock(), vue.createElementBlock(
403
+ vue.Fragment,
404
+ { key: 0 },
405
+ [
406
+ !received.value.length ? (vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElEmpty), {
407
+ key: 0,
408
+ description: vue.unref(t)("plus.queryFilter.emptyReceived"),
409
+ "image-size": 48
410
+ }, null, 8, ["description"])) : (vue.openBlock(), vue.createElementBlock("ul", _hoisted_13, [
411
+ (vue.openBlock(true), vue.createElementBlock(
412
+ vue.Fragment,
413
+ null,
414
+ vue.renderList(received.value, (item) => {
415
+ return vue.openBlock(), vue.createElementBlock("li", {
416
+ key: item.id,
417
+ class: "yc-query-filter__item"
418
+ }, [
419
+ vue.createElementVNode("button", {
420
+ type: "button",
421
+ class: "yc-query-filter__line",
422
+ onClick: ($event) => applyItem(item)
423
+ }, [
424
+ vue.createElementVNode(
425
+ "span",
426
+ _hoisted_15,
427
+ vue.toDisplayString(receivedPrefix(item)),
428
+ 1
429
+ /* TEXT */
430
+ ),
431
+ vue.createElementVNode(
432
+ "span",
433
+ _hoisted_16,
434
+ "\u3010" + vue.toDisplayString(item.name) + "\u3011",
435
+ 1
436
+ /* TEXT */
437
+ )
438
+ ], 8, _hoisted_14),
439
+ vue.createElementVNode("span", _hoisted_17, [
440
+ vue.createVNode(vue.unref(elementPlus.ElButton), {
441
+ link: "",
442
+ type: "danger",
443
+ icon: vue.unref(ElementPlusIconsVue.Delete),
444
+ title: vue.unref(t)("plus.queryFilter.remove"),
445
+ onClick: vue.withModifiers(($event) => removeItem(item), ["stop"])
446
+ }, null, 8, ["icon", "title", "onClick"]),
447
+ vue.createVNode(vue.unref(elementPlus.ElButton), {
448
+ link: "",
449
+ icon: vue.unref(ElementPlusIconsVue.EditPen),
450
+ title: vue.unref(t)("plus.queryFilter.edit"),
451
+ onClick: vue.withModifiers(($event) => openEdit(item), ["stop"])
452
+ }, null, 8, ["icon", "title", "onClick"])
453
+ ])
454
+ ]);
455
+ }),
456
+ 128
457
+ /* KEYED_FRAGMENT */
458
+ ))
459
+ ]))
460
+ ],
461
+ 64
462
+ /* STABLE_FRAGMENT */
463
+ )) : (vue.openBlock(), vue.createElementBlock(
464
+ vue.Fragment,
465
+ { key: 1 },
466
+ [
467
+ !shared.value.length ? (vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElEmpty), {
468
+ key: 0,
469
+ description: vue.unref(t)("plus.queryFilter.emptyShared"),
470
+ "image-size": 48
471
+ }, null, 8, ["description"])) : (vue.openBlock(), vue.createElementBlock("ul", _hoisted_18, [
472
+ (vue.openBlock(true), vue.createElementBlock(
473
+ vue.Fragment,
474
+ null,
475
+ vue.renderList(shared.value, (item) => {
476
+ return vue.openBlock(), vue.createElementBlock("li", {
477
+ key: item.id,
478
+ class: "yc-query-filter__item"
479
+ }, [
480
+ vue.createElementVNode("button", {
481
+ type: "button",
482
+ class: "yc-query-filter__line",
483
+ onClick: ($event) => applyItem(item)
484
+ }, [
485
+ vue.createElementVNode(
486
+ "span",
487
+ _hoisted_20,
488
+ vue.toDisplayString(sharedPrefix(item)),
489
+ 1
490
+ /* TEXT */
491
+ ),
492
+ vue.createElementVNode(
493
+ "span",
494
+ _hoisted_21,
495
+ "\u3010" + vue.toDisplayString(item.name) + "\u3011",
496
+ 1
497
+ /* TEXT */
498
+ )
499
+ ], 8, _hoisted_19),
500
+ vue.createElementVNode("span", _hoisted_22, [
501
+ vue.createVNode(vue.unref(elementPlus.ElButton), {
502
+ link: "",
503
+ type: "danger",
504
+ icon: vue.unref(ElementPlusIconsVue.RefreshLeft),
505
+ title: vue.unref(t)("plus.queryFilter.revoke"),
506
+ onClick: vue.withModifiers(($event) => revokeShare(item), ["stop"])
507
+ }, null, 8, ["icon", "title", "onClick"])
508
+ ])
509
+ ]);
510
+ }),
511
+ 128
512
+ /* KEYED_FRAGMENT */
513
+ ))
514
+ ]))
515
+ ],
516
+ 64
517
+ /* STABLE_FRAGMENT */
518
+ ))
519
+ ])
520
+ ])
521
+ ]),
522
+ _: 1
523
+ /* STABLE */
524
+ }, 8, ["visible"]),
525
+ vue.createVNode(vue.unref(elementPlus.ElDialog), {
526
+ modelValue: saveVisible.value,
527
+ "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => saveVisible.value = $event),
528
+ title: vue.unref(t)("plus.queryFilter.nameTitle"),
529
+ width: "420px",
530
+ "append-to-body": "",
531
+ "append-to": "body"
532
+ }, {
533
+ footer: vue.withCtx(() => [
534
+ vue.createVNode(vue.unref(elementPlus.ElButton), {
535
+ type: "primary",
536
+ loading: saving.value,
537
+ onClick: confirmSave
538
+ }, {
539
+ default: vue.withCtx(() => [
540
+ vue.createTextVNode(
541
+ vue.toDisplayString(vue.unref(t)("plus.dialog.confirmText")),
542
+ 1
543
+ /* TEXT */
544
+ )
545
+ ]),
546
+ _: 1
547
+ /* STABLE */
548
+ }, 8, ["loading"]),
549
+ vue.createVNode(vue.unref(elementPlus.ElButton), {
550
+ onClick: _cache[4] || (_cache[4] = ($event) => saveVisible.value = false)
551
+ }, {
552
+ default: vue.withCtx(() => [
553
+ vue.createTextVNode(
554
+ vue.toDisplayString(vue.unref(t)("plus.dialog.cancelText")),
555
+ 1
556
+ /* TEXT */
557
+ )
558
+ ]),
559
+ _: 1
560
+ /* STABLE */
561
+ })
562
+ ]),
563
+ default: vue.withCtx(() => [
564
+ vue.createVNode(vue.unref(elementPlus.ElForm), {
565
+ onSubmit: vue.withModifiers(confirmSave, ["prevent"])
566
+ }, {
567
+ default: vue.withCtx(() => [
568
+ vue.createVNode(vue.unref(elementPlus.ElFormItem), {
569
+ label: vue.unref(t)("plus.queryFilter.nameTitle"),
570
+ required: ""
571
+ }, {
572
+ default: vue.withCtx(() => [
573
+ vue.createVNode(vue.unref(elementPlus.ElInput), {
574
+ modelValue: saveName.value,
575
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => saveName.value = $event),
576
+ maxlength: "30",
577
+ placeholder: vue.unref(t)("plus.queryFilter.namePlaceholder")
578
+ }, null, 8, ["modelValue", "placeholder"])
579
+ ]),
580
+ _: 1
581
+ /* STABLE */
582
+ }, 8, ["label"])
583
+ ]),
584
+ _: 1
585
+ /* STABLE */
586
+ })
587
+ ]),
588
+ _: 1
589
+ /* STABLE */
590
+ }, 8, ["modelValue", "title"]),
591
+ vue.createVNode(vue.unref(elementPlus.ElDialog), {
592
+ modelValue: shareVisible.value,
593
+ "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => shareVisible.value = $event),
594
+ title: vue.unref(t)("plus.queryFilter.shareTitle"),
595
+ width: "480px",
596
+ "append-to-body": "",
597
+ "append-to": "body"
598
+ }, {
599
+ footer: vue.withCtx(() => [
600
+ vue.createVNode(vue.unref(elementPlus.ElButton), {
601
+ onClick: _cache[7] || (_cache[7] = ($event) => shareVisible.value = false)
602
+ }, {
603
+ default: vue.withCtx(() => [
604
+ vue.createTextVNode(
605
+ vue.toDisplayString(vue.unref(t)("plus.dialog.cancelText")),
606
+ 1
607
+ /* TEXT */
608
+ )
609
+ ]),
610
+ _: 1
611
+ /* STABLE */
612
+ }),
613
+ vue.createVNode(vue.unref(elementPlus.ElButton), {
614
+ type: "primary",
615
+ onClick: confirmShare
616
+ }, {
617
+ default: vue.withCtx(() => [
618
+ vue.createTextVNode(
619
+ vue.toDisplayString(vue.unref(t)("plus.dialog.confirmText")),
620
+ 1
621
+ /* TEXT */
622
+ )
623
+ ]),
624
+ _: 1
625
+ /* STABLE */
626
+ })
627
+ ]),
628
+ default: vue.withCtx(() => [
629
+ vue.createVNode(vue.unref(elementPlus.ElSelect), {
630
+ modelValue: shareUserIds.value,
631
+ "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => shareUserIds.value = $event),
632
+ multiple: "",
633
+ filterable: "",
634
+ remote: "",
635
+ "remote-method": remoteSearchUsers,
636
+ placeholder: vue.unref(t)("plus.queryFilter.sharePlaceholder"),
637
+ style: { "width": "100%" }
638
+ }, {
639
+ default: vue.withCtx(() => [
640
+ (vue.openBlock(true), vue.createElementBlock(
641
+ vue.Fragment,
642
+ null,
643
+ vue.renderList(userOptions.value, (user) => {
644
+ return vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElOption), {
645
+ key: user.userId,
646
+ label: user.name,
647
+ value: user.userId
648
+ }, null, 8, ["label", "value"]);
649
+ }),
650
+ 128
651
+ /* KEYED_FRAGMENT */
652
+ ))
653
+ ]),
654
+ _: 1
655
+ /* STABLE */
656
+ }, 8, ["modelValue", "placeholder"])
657
+ ]),
658
+ _: 1
659
+ /* STABLE */
660
+ }, 8, ["modelValue", "title"])
661
+ ])) : vue.createCommentVNode("v-if", true);
662
+ };
663
+ }
664
+ });
665
+
666
+ exports.default = _sfc_main;
@@ -0,0 +1,4 @@
1
+ import { QueryFilterConditions } from 'yc-pro-components/es/constants';
2
+
3
+ export declare function serializeQueryFilter(fields: Record<string, unknown>, schemaVersion: number): QueryFilterConditions;
4
+ export declare function extractQueryFilterFields(conditions?: QueryFilterConditions | null): Record<string, unknown>;
@@ -0,0 +1,20 @@
1
+ 'use strict';
2
+
3
+ function serializeQueryFilter(fields, schemaVersion) {
4
+ return {
5
+ schemaVersion,
6
+ fields: { ...fields || {} }
7
+ };
8
+ }
9
+ function extractQueryFilterFields(conditions) {
10
+ if (!conditions || typeof conditions !== "object") return {};
11
+ if (conditions.fields && typeof conditions.fields === "object") {
12
+ return { ...conditions.fields };
13
+ }
14
+ const rest = { ...conditions };
15
+ delete rest.schemaVersion;
16
+ return rest;
17
+ }
18
+
19
+ exports.extractQueryFilterFields = extractQueryFilterFields;
20
+ exports.serializeQueryFilter = serializeQueryFilter;