@cmstops/pro-compo 3.9.2-alpha.2 → 3.9.2-alpha.4

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,6 +1,6 @@
1
1
  import { defineComponent, inject, computed, ref, watch, onMounted, openBlock, createElementBlock, createCommentVNode, createElementVNode, withDirectives, createVNode, unref, withModifiers, withCtx, createTextVNode, vShow, toDisplayString, Fragment, renderList, createBlock, normalizeClass } from "vue";
2
2
  import { Button, Input, Dropdown, Doption, TreeSelect, Select, Option, RangePicker } from "@arco-design/web-vue";
3
- import { IconCaretDown, IconUpload } from "@arco-design/web-vue/es/icon";
3
+ import { IconCaretDown, IconRefresh, IconUpload } from "@arco-design/web-vue/es/icon";
4
4
  import useSelection from "../../../../hooks/useSelection.js";
5
5
  import { useDirectory } from "../../../../hooks/useAttachement.js";
6
6
  import { RESOURCE_SOURCE_OPTIONS, RESOURCE_CATALOG_OPTIONS } from "../../../../utils/typeMap.js";
@@ -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",
@@ -377,7 +380,17 @@ const _sfc_main = defineComponent({
377
380
  createElementVNode("div", _hoisted_11, [
378
381
  createCommentVNode(" \u91CD\u7F6E\u6309\u94AE - Wrap in filter-item to be managed by the hook "),
379
382
  withDirectives(createElementVNode("div", _hoisted_12, [
380
- createVNode(unref(Button), {
383
+ _ctx.smallScreen ? (openBlock(), createBlock(unref(Button), {
384
+ key: 0,
385
+ type: "text",
386
+ onClick: handleReset
387
+ }, {
388
+ icon: withCtx(() => [
389
+ createVNode(unref(IconRefresh))
390
+ ]),
391
+ _: 1
392
+ })) : (openBlock(), createBlock(unref(Button), {
393
+ key: 1,
381
394
  type: "text",
382
395
  onClick: handleReset
383
396
  }, {
@@ -385,7 +398,7 @@ const _sfc_main = defineComponent({
385
398
  createTextVNode(" \u91CD\u7F6E ")
386
399
  ])),
387
400
  _: 1
388
- })
401
+ }))
389
402
  ], 512), [
390
403
  [vShow, !isEmpty.value]
391
404
  ]),
@@ -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(
@@ -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",
@@ -378,7 +381,17 @@ const _sfc_main = vue.defineComponent({
378
381
  vue.createElementVNode("div", _hoisted_11, [
379
382
  vue.createCommentVNode(" \u91CD\u7F6E\u6309\u94AE - Wrap in filter-item to be managed by the hook "),
380
383
  vue.withDirectives(vue.createElementVNode("div", _hoisted_12, [
381
- vue.createVNode(vue.unref(webVue.Button), {
384
+ _ctx.smallScreen ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.Button), {
385
+ key: 0,
386
+ type: "text",
387
+ onClick: handleReset
388
+ }, {
389
+ icon: vue.withCtx(() => [
390
+ vue.createVNode(vue.unref(icon.IconRefresh))
391
+ ]),
392
+ _: 1
393
+ })) : (vue.openBlock(), vue.createBlock(vue.unref(webVue.Button), {
394
+ key: 1,
382
395
  type: "text",
383
396
  onClick: handleReset
384
397
  }, {
@@ -386,7 +399,7 @@ const _sfc_main = vue.defineComponent({
386
399
  vue.createTextVNode(" \u91CD\u7F6E ")
387
400
  ])),
388
401
  _: 1
389
- })
402
+ }))
390
403
  ], 512), [
391
404
  [vue.vShow, !isEmpty.value]
392
405
  ]),
@@ -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.2",
3
+ "version": "3.9.2-alpha.4",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "vue",