@cmstops/pro-compo 3.9.2-alpha.3 → 3.9.2-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.
@@ -1,5 +1,5 @@
1
- import { defineComponent, ref, computed, watch, nextTick, toRaw, openBlock, createElementBlock, Fragment, createElementVNode, withModifiers, createVNode, withCtx, renderList, createBlock, unref, normalizeStyle, createCommentVNode, renderSlot } from "vue";
2
- import { InputSearch, Select, Option, RangePicker } from "@arco-design/web-vue";
1
+ import { defineComponent, ref, computed, watch, nextTick, toRaw, openBlock, createElementBlock, Fragment, createElementVNode, withModifiers, createVNode, withCtx, renderList, createBlock, renderSlot, unref, normalizeStyle, createCommentVNode, createTextVNode, toDisplayString } from "vue";
2
+ import { InputSearch, Select, Option, RangePicker, RadioGroup, Radio } from "@arco-design/web-vue";
3
3
  import _sfc_main$2 from "./components/filterItem.js";
4
4
  import _sfc_main$1 from "./components/FilterGroup.js";
5
5
  const _sfc_main = defineComponent({
@@ -37,9 +37,11 @@ const _sfc_main = defineComponent({
37
37
  });
38
38
  return _columns;
39
39
  });
40
- const getOptions = (item) => {
41
- return item.options ? item.options : [];
42
- };
40
+ const getOptions = computed(() => {
41
+ return (item) => {
42
+ return item.options ? item.options : [];
43
+ };
44
+ });
43
45
  const hasValue = computed(() => {
44
46
  return (key) => {
45
47
  var _a, _b;
@@ -178,17 +180,17 @@ const _sfc_main = defineComponent({
178
180
  active: hasValue.value(item.key)
179
181
  }, {
180
182
  default: withCtx(() => [
181
- item.component === "input" ? (openBlock(), createBlock(unref(InputSearch), {
182
- key: 0,
183
+ item.slot ? renderSlot(_ctx.$slots, item.slot, { key: 0 }) : item.component === "input" ? (openBlock(), createBlock(unref(InputSearch), {
184
+ key: 1,
183
185
  modelValue: form.value[item.key],
184
186
  "onUpdate:modelValue": ($event) => form.value[item.key] = $event,
185
187
  style: normalizeStyle({ width: styleWidth(columnsMap.value[item.key]) }),
186
188
  "allow-clear": "",
187
189
  size: "medium",
188
- placeholder: `\u8BF7\u8F93\u5165${item.label}`
190
+ placeholder: item.placeholder ? item.placeholder : `\u8BF7\u8F93\u5165${item.label}`
189
191
  }, null, 8, ["modelValue", "onUpdate:modelValue", "style", "placeholder"])) : createCommentVNode("v-if", true),
190
192
  item.component === "select" ? (openBlock(), createBlock(unref(Select), {
191
- key: 1,
193
+ key: 2,
192
194
  modelValue: form.value[item.key],
193
195
  "onUpdate:modelValue": ($event) => form.value[item.key] = $event,
194
196
  "popup-container": "#base-filter-popup-container",
@@ -196,13 +198,13 @@ const _sfc_main = defineComponent({
196
198
  "allow-search": item.allowSearch,
197
199
  "default-active-first-option": false,
198
200
  style: normalizeStyle({ width: styleWidth(columnsMap.value[item.key]) }),
199
- placeholder: `\u8BF7\u9009\u62E9${item.label}`,
201
+ placeholder: item.placeholder ? item.placeholder : `\u8BF7\u9009\u62E9${item.label}`,
200
202
  onSearch: ($event) => handleSelectSearch($event, item),
201
203
  onPopupVisibleChange: ($event) => handleSelectPopupChange($event, item),
202
204
  onChange: ($event) => handleSelectChange($event, item)
203
205
  }, {
204
206
  default: withCtx(() => [
205
- (openBlock(true), createElementBlock(Fragment, null, renderList(getOptions(item), (opt) => {
207
+ (openBlock(true), createElementBlock(Fragment, null, renderList(getOptions.value(item), (opt) => {
206
208
  return openBlock(), createBlock(unref(Option), {
207
209
  key: opt.value,
208
210
  label: opt.label,
@@ -213,7 +215,7 @@ const _sfc_main = defineComponent({
213
215
  _: 2
214
216
  }, 1032, ["modelValue", "onUpdate:modelValue", "allow-search", "style", "placeholder", "onSearch", "onPopupVisibleChange", "onChange"])) : createCommentVNode("v-if", true),
215
217
  item.component === "range-picker" ? (openBlock(), createBlock(unref(RangePicker), {
216
- key: 2,
218
+ key: 3,
217
219
  modelValue: form.value[item.key].range,
218
220
  "onUpdate:modelValue": ($event) => form.value[item.key].range = $event,
219
221
  style: normalizeStyle({ width: styleWidth(form.value[item.key]) }),
@@ -224,7 +226,28 @@ const _sfc_main = defineComponent({
224
226
  "popup-container": "#base-filter-popup-container",
225
227
  onClick: _cache[1] || (_cache[1] = withModifiers(() => {
226
228
  }, ["stop"]))
227
- }, null, 8, ["modelValue", "onUpdate:modelValue", "style"])) : createCommentVNode("v-if", true)
229
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "style"])) : createCommentVNode("v-if", true),
230
+ item.component === "radio" ? (openBlock(), createBlock(unref(RadioGroup), {
231
+ key: 4,
232
+ modelValue: form.value[item.key],
233
+ "onUpdate:modelValue": ($event) => form.value[item.key] = $event,
234
+ type: "button"
235
+ }, {
236
+ default: withCtx(() => [
237
+ (openBlock(true), createElementBlock(Fragment, null, renderList(item.options || [], (option, idx) => {
238
+ return openBlock(), createBlock(unref(Radio), {
239
+ key: idx,
240
+ value: option.value
241
+ }, {
242
+ default: withCtx(() => [
243
+ createTextVNode(toDisplayString(option.label), 1)
244
+ ]),
245
+ _: 2
246
+ }, 1032, ["value"]);
247
+ }), 128))
248
+ ]),
249
+ _: 2
250
+ }, 1032, ["modelValue", "onUpdate:modelValue"])) : createCommentVNode("v-if", true)
228
251
  ]),
229
252
  _: 2
230
253
  }, 1032, ["active"]);
@@ -50,6 +50,7 @@ const _sfc_main = defineComponent({
50
50
  },
51
51
  emits: ["upload", "change"],
52
52
  setup(__props, { expose: __expose, emit: __emit }) {
53
+ var _a, _b, _c;
53
54
  const props = __props;
54
55
  const emits = __emit;
55
56
  const userInfo = inject("userInfo");
@@ -63,8 +64,7 @@ const _sfc_main = defineComponent({
63
64
  hiddenElementList,
64
65
  visible,
65
66
  show,
66
- hide,
67
- refreshLayout
67
+ hide
68
68
  } = useResponsiveFilter(filterItemsRef);
69
69
  const { options, loading, load, loadMore, handleSearch } = useSelection({
70
70
  labelStr: "alias",
@@ -99,7 +99,17 @@ const _sfc_main = defineComponent({
99
99
  sf: "",
100
100
  directory_id: void 0
101
101
  };
102
- const filter = ref(JSON.parse(JSON.stringify(originFilter)));
102
+ if ((_a = filterOptions == null ? void 0 : filterOptions.value) == null ? void 0 : _a.mediaTypeStrict) {
103
+ originFilter.catalog = filterOptions.value.mediaType.split(",");
104
+ }
105
+ const filter = ref(
106
+ JSON.parse(
107
+ JSON.stringify({
108
+ ...originFilter,
109
+ catalog: ((_c = (_b = filterOptions == null ? void 0 : filterOptions.value) == null ? void 0 : _b.mediaType) == null ? void 0 : _c.split(",")) || []
110
+ })
111
+ )
112
+ );
103
113
  const handleReset = () => {
104
114
  filter.value = JSON.parse(JSON.stringify(originFilter));
105
115
  };
@@ -182,22 +192,14 @@ const _sfc_main = defineComponent({
182
192
  { deep: true, immediate: true }
183
193
  );
184
194
  onMounted(() => {
185
- var _a;
186
195
  load();
187
- if ((_a = filterOptions == null ? void 0 : filterOptions.value) == null ? void 0 : _a.mediaType) {
188
- const initialCatalog = filterOptions.value.mediaType.split(",");
189
- filter.value.catalog = initialCatalog;
190
- if (filterOptions.value.mediaTypeStrict) {
191
- originFilter.catalog = initialCatalog;
192
- }
193
- }
194
196
  });
195
197
  __expose({
196
198
  filter,
197
199
  handleReset
198
200
  });
199
201
  return (_ctx, _cache) => {
200
- var _a;
202
+ var _a2;
201
203
  return openBlock(), createElementBlock("div", _hoisted_1, [
202
204
  createCommentVNode(" Use filterItemsRef's parentElement as the container for boundary checks "),
203
205
  createElementVNode("div", _hoisted_2, [
@@ -291,7 +293,8 @@ const _sfc_main = defineComponent({
291
293
  title: "alias",
292
294
  key: "id"
293
295
  },
294
- "allow-clear": ""
296
+ "allow-clear": "",
297
+ "allow-search": ""
295
298
  }, null, 8, ["modelValue", "data"])
296
299
  ]),
297
300
  createCommentVNode(" \u7D20\u6750\u7C7B\u578B "),
@@ -299,7 +302,7 @@ const _sfc_main = defineComponent({
299
302
  createVNode(unref(Select), {
300
303
  modelValue: filter.value.catalog,
301
304
  "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => filter.value.catalog = $event),
302
- disabled: (_a = unref(filterOptions)) == null ? void 0 : _a.mediaTypeStrict,
305
+ disabled: (_a2 = unref(filterOptions)) == null ? void 0 : _a2.mediaTypeStrict,
303
306
  "popup-container": "#resource-filter-pannel",
304
307
  "allow-clear": "",
305
308
  placeholder: "\u7C7B\u578B",
@@ -34,7 +34,6 @@ const _sfc_main = defineComponent({
34
34
  return (_a = listWrapper.value) == null ? void 0 : _a.offsetWidth;
35
35
  },
36
36
  (val) => {
37
- console.log(val);
38
37
  smallScreen.value = !!(val && val < 600);
39
38
  },
40
39
  { immediate: true }
@@ -67,7 +67,7 @@ function useResponsiveFilter(filterItemsRef) {
67
67
  if (!item || !item.classList || !item.classList.contains("filter-item"))
68
68
  continue;
69
69
  const itemRect = getRect(item);
70
- if (itemRect.right > containerRight - 300) {
70
+ if (itemRect.right > containerRight - 400) {
71
71
  hideElement(item);
72
72
  } else {
73
73
  currentRightmostBoundary = Math.max(
@@ -38,9 +38,11 @@ const _sfc_main = vue.defineComponent({
38
38
  });
39
39
  return _columns;
40
40
  });
41
- const getOptions = (item) => {
42
- return item.options ? item.options : [];
43
- };
41
+ const getOptions = vue.computed(() => {
42
+ return (item) => {
43
+ return item.options ? item.options : [];
44
+ };
45
+ });
44
46
  const hasValue = vue.computed(() => {
45
47
  return (key) => {
46
48
  var _a, _b;
@@ -179,17 +181,17 @@ const _sfc_main = vue.defineComponent({
179
181
  active: hasValue.value(item.key)
180
182
  }, {
181
183
  default: vue.withCtx(() => [
182
- item.component === "input" ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.InputSearch), {
183
- key: 0,
184
+ item.slot ? vue.renderSlot(_ctx.$slots, item.slot, { key: 0 }) : item.component === "input" ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.InputSearch), {
185
+ key: 1,
184
186
  modelValue: form.value[item.key],
185
187
  "onUpdate:modelValue": ($event) => form.value[item.key] = $event,
186
188
  style: vue.normalizeStyle({ width: styleWidth(columnsMap.value[item.key]) }),
187
189
  "allow-clear": "",
188
190
  size: "medium",
189
- placeholder: `\u8BF7\u8F93\u5165${item.label}`
191
+ placeholder: item.placeholder ? item.placeholder : `\u8BF7\u8F93\u5165${item.label}`
190
192
  }, null, 8, ["modelValue", "onUpdate:modelValue", "style", "placeholder"])) : vue.createCommentVNode("v-if", true),
191
193
  item.component === "select" ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.Select), {
192
- key: 1,
194
+ key: 2,
193
195
  modelValue: form.value[item.key],
194
196
  "onUpdate:modelValue": ($event) => form.value[item.key] = $event,
195
197
  "popup-container": "#base-filter-popup-container",
@@ -197,13 +199,13 @@ const _sfc_main = vue.defineComponent({
197
199
  "allow-search": item.allowSearch,
198
200
  "default-active-first-option": false,
199
201
  style: vue.normalizeStyle({ width: styleWidth(columnsMap.value[item.key]) }),
200
- placeholder: `\u8BF7\u9009\u62E9${item.label}`,
202
+ placeholder: item.placeholder ? item.placeholder : `\u8BF7\u9009\u62E9${item.label}`,
201
203
  onSearch: ($event) => handleSelectSearch($event, item),
202
204
  onPopupVisibleChange: ($event) => handleSelectPopupChange($event, item),
203
205
  onChange: ($event) => handleSelectChange($event, item)
204
206
  }, {
205
207
  default: vue.withCtx(() => [
206
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(getOptions(item), (opt) => {
208
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(getOptions.value(item), (opt) => {
207
209
  return vue.openBlock(), vue.createBlock(vue.unref(webVue.Option), {
208
210
  key: opt.value,
209
211
  label: opt.label,
@@ -214,7 +216,7 @@ const _sfc_main = vue.defineComponent({
214
216
  _: 2
215
217
  }, 1032, ["modelValue", "onUpdate:modelValue", "allow-search", "style", "placeholder", "onSearch", "onPopupVisibleChange", "onChange"])) : vue.createCommentVNode("v-if", true),
216
218
  item.component === "range-picker" ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.RangePicker), {
217
- key: 2,
219
+ key: 3,
218
220
  modelValue: form.value[item.key].range,
219
221
  "onUpdate:modelValue": ($event) => form.value[item.key].range = $event,
220
222
  style: vue.normalizeStyle({ width: styleWidth(form.value[item.key]) }),
@@ -225,7 +227,28 @@ const _sfc_main = vue.defineComponent({
225
227
  "popup-container": "#base-filter-popup-container",
226
228
  onClick: _cache[1] || (_cache[1] = vue.withModifiers(() => {
227
229
  }, ["stop"]))
228
- }, null, 8, ["modelValue", "onUpdate:modelValue", "style"])) : vue.createCommentVNode("v-if", true)
230
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "style"])) : vue.createCommentVNode("v-if", true),
231
+ item.component === "radio" ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.RadioGroup), {
232
+ key: 4,
233
+ modelValue: form.value[item.key],
234
+ "onUpdate:modelValue": ($event) => form.value[item.key] = $event,
235
+ type: "button"
236
+ }, {
237
+ default: vue.withCtx(() => [
238
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(item.options || [], (option, idx) => {
239
+ return vue.openBlock(), vue.createBlock(vue.unref(webVue.Radio), {
240
+ key: idx,
241
+ value: option.value
242
+ }, {
243
+ default: vue.withCtx(() => [
244
+ vue.createTextVNode(vue.toDisplayString(option.label), 1)
245
+ ]),
246
+ _: 2
247
+ }, 1032, ["value"]);
248
+ }), 128))
249
+ ]),
250
+ _: 2
251
+ }, 1032, ["modelValue", "onUpdate:modelValue"])) : vue.createCommentVNode("v-if", true)
229
252
  ]),
230
253
  _: 2
231
254
  }, 1032, ["active"]);
@@ -51,6 +51,7 @@ const _sfc_main = vue.defineComponent({
51
51
  },
52
52
  emits: ["upload", "change"],
53
53
  setup(__props, { expose: __expose, emit: __emit }) {
54
+ var _a, _b, _c;
54
55
  const props = __props;
55
56
  const emits = __emit;
56
57
  const userInfo = vue.inject("userInfo");
@@ -64,8 +65,7 @@ const _sfc_main = vue.defineComponent({
64
65
  hiddenElementList,
65
66
  visible,
66
67
  show,
67
- hide,
68
- refreshLayout
68
+ hide
69
69
  } = useResponsiveFilter.useResponsiveFilter(filterItemsRef);
70
70
  const { options, loading, load, loadMore, handleSearch } = useSelection({
71
71
  labelStr: "alias",
@@ -100,7 +100,17 @@ const _sfc_main = vue.defineComponent({
100
100
  sf: "",
101
101
  directory_id: void 0
102
102
  };
103
- const filter = vue.ref(JSON.parse(JSON.stringify(originFilter)));
103
+ if ((_a = filterOptions == null ? void 0 : filterOptions.value) == null ? void 0 : _a.mediaTypeStrict) {
104
+ originFilter.catalog = filterOptions.value.mediaType.split(",");
105
+ }
106
+ const filter = vue.ref(
107
+ JSON.parse(
108
+ JSON.stringify({
109
+ ...originFilter,
110
+ catalog: ((_c = (_b = filterOptions == null ? void 0 : filterOptions.value) == null ? void 0 : _b.mediaType) == null ? void 0 : _c.split(",")) || []
111
+ })
112
+ )
113
+ );
104
114
  const handleReset = () => {
105
115
  filter.value = JSON.parse(JSON.stringify(originFilter));
106
116
  };
@@ -183,22 +193,14 @@ const _sfc_main = vue.defineComponent({
183
193
  { deep: true, immediate: true }
184
194
  );
185
195
  vue.onMounted(() => {
186
- var _a;
187
196
  load();
188
- if ((_a = filterOptions == null ? void 0 : filterOptions.value) == null ? void 0 : _a.mediaType) {
189
- const initialCatalog = filterOptions.value.mediaType.split(",");
190
- filter.value.catalog = initialCatalog;
191
- if (filterOptions.value.mediaTypeStrict) {
192
- originFilter.catalog = initialCatalog;
193
- }
194
- }
195
197
  });
196
198
  __expose({
197
199
  filter,
198
200
  handleReset
199
201
  });
200
202
  return (_ctx, _cache) => {
201
- var _a;
203
+ var _a2;
202
204
  return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
203
205
  vue.createCommentVNode(" Use filterItemsRef's parentElement as the container for boundary checks "),
204
206
  vue.createElementVNode("div", _hoisted_2, [
@@ -292,7 +294,8 @@ const _sfc_main = vue.defineComponent({
292
294
  title: "alias",
293
295
  key: "id"
294
296
  },
295
- "allow-clear": ""
297
+ "allow-clear": "",
298
+ "allow-search": ""
296
299
  }, null, 8, ["modelValue", "data"])
297
300
  ]),
298
301
  vue.createCommentVNode(" \u7D20\u6750\u7C7B\u578B "),
@@ -300,7 +303,7 @@ const _sfc_main = vue.defineComponent({
300
303
  vue.createVNode(vue.unref(webVue.Select), {
301
304
  modelValue: filter.value.catalog,
302
305
  "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => filter.value.catalog = $event),
303
- disabled: (_a = vue.unref(filterOptions)) == null ? void 0 : _a.mediaTypeStrict,
306
+ disabled: (_a2 = vue.unref(filterOptions)) == null ? void 0 : _a2.mediaTypeStrict,
304
307
  "popup-container": "#resource-filter-pannel",
305
308
  "allow-clear": "",
306
309
  placeholder: "\u7C7B\u578B",
@@ -35,7 +35,6 @@ const _sfc_main = vue.defineComponent({
35
35
  return (_a = listWrapper.value) == null ? void 0 : _a.offsetWidth;
36
36
  },
37
37
  (val) => {
38
- console.log(val);
39
38
  smallScreen.value = !!(val && val < 600);
40
39
  },
41
40
  { immediate: true }
@@ -69,7 +69,7 @@ function useResponsiveFilter(filterItemsRef) {
69
69
  if (!item || !item.classList || !item.classList.contains("filter-item"))
70
70
  continue;
71
71
  const itemRect = getRect(item);
72
- if (itemRect.right > containerRight - 300) {
72
+ if (itemRect.right > containerRight - 400) {
73
73
  hideElement(item);
74
74
  } else {
75
75
  currentRightmostBoundary = Math.max(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmstops/pro-compo",
3
- "version": "3.9.2-alpha.3",
3
+ "version": "3.9.2-alpha.5",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "vue",