@cmstops/pro-compo 3.9.2-alpha.4 → 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"]);
@@ -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"]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmstops/pro-compo",
3
- "version": "3.9.2-alpha.4",
3
+ "version": "3.9.2-alpha.5",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "vue",