ct-component-plus 2.2.2 → 2.2.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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ct-component-plus",
3
3
  "private": false,
4
- "version": "2.2.2",
4
+ "version": "2.2.4",
5
5
  "type": "module",
6
6
  "main": "packages/components/index.js",
7
7
  "files": [
@@ -75,19 +75,19 @@ watch(showValue, async (newValue) => {
75
75
  });
76
76
  props.cbs.change(dataList, cascaderRef.value);
77
77
  }
78
- if (propsShow.value.multiple && props.filterable) {
79
- await nextTick();
78
+ // if (propsShow.value.multiple && props.filterable) {
79
+ // await nextTick();
80
80
 
81
- // 如果组件内部没找到,尝试在文档中通过类名查找(作为最后的兜底,注意可能会影响页面上其他同类组件,所以最好通过el限制范围,如果el也拿不到才用document)
82
- const targetInput = document.querySelector(
83
- `.${componentId} .el-cascader__search-input`
84
- );
81
+ // // 如果组件内部没找到,尝试在文档中通过类名查找(作为最后的兜底,注意可能会影响页面上其他同类组件,所以最好通过el限制范围,如果el也拿不到才用document)
82
+ // const targetInput = document.querySelector(
83
+ // `.${componentId} .el-cascader__search-input`
84
+ // );
85
85
 
86
- if (targetInput) {
87
- targetInput.value = "";
88
- targetInput.dispatchEvent(new Event("input", { bubbles: true }));
89
- }
90
- }
86
+ // if (targetInput) {
87
+ // targetInput.value = "";
88
+ // targetInput.dispatchEvent(new Event("input", { bubbles: true }));
89
+ // }
90
+ // }
91
91
  });
92
92
  const popperClassShow = computed(() => {
93
93
  let popperClass = ns.e("dropdown");
@@ -6,6 +6,7 @@ import CtDatePicker from '../date-picker';
6
6
  import CtCascader from '../cascader';
7
7
  import CtYearSelect from '../year-select';
8
8
  import CtRadio from '../radio';
9
+ import CtPagingSelect from '../paging-select';
9
10
 
10
11
  export const searchComponents = {
11
12
  CtInput,
@@ -13,7 +14,8 @@ export const searchComponents = {
13
14
  CtDatePicker,
14
15
  CtCascader,
15
16
  CtYearSelect,
16
- CtRadio
17
+ CtRadio,
18
+ CtPagingSelect,
17
19
  }
18
20
 
19
21
  /* istanbul ignore next */
@@ -2,48 +2,29 @@
2
2
  <div :class="[ns.b()]">
3
3
  <div :class="[ns.e('container')]">
4
4
  <div :class="[ns.e('list')]">
5
- <div
6
- v-for="(item, index) in searchList"
7
- :class="[
8
- ns.e('item'),
9
- ...getComponentClass(item),
10
- ns.is('outer-border', outerBorder),
11
- ]"
12
- :key="item.param || index"
13
- :style="{ ...getComponentStyle(item) }"
14
- @click="clickItem(item)"
15
- >
5
+ <div v-for="(item, index) in searchList" :class="[
6
+ ns.e('item'),
7
+ ...getComponentClass(item),
8
+ ns.is('outer-border', outerBorder),
9
+ ]" :key="item.param || index" :style="{ ...getComponentStyle(item) }" @click="clickItem(item)">
16
10
  <slot v-bind="getComponentSlotScope(item)">
17
11
  <slot name="item-before" v-bind="getComponentSlotScope(item)">
18
12
  </slot>
19
- <span
20
- :class="[
21
- ns.e('item-label'),
22
- ns.is('required', item.required),
23
- ns.is('outer-border', outerBorder),
24
- ]"
25
- >
26
- <el-tooltip
27
- :disabled="judgeIsHideLabelTooltip(item)"
28
- class="box-item"
29
- effect="dark"
30
- :content="item.label"
31
- placement="bottom"
32
- >
13
+ <span :class="[
14
+ ns.e('item-label'),
15
+ ns.is('required', item.required),
16
+ ns.is('outer-border', outerBorder),
17
+ ]">
18
+ <el-tooltip :disabled="judgeIsHideLabelTooltip(item)" class="box-item" effect="dark" :content="item.label"
19
+ placement="bottom">
33
20
  <span>{{ item.label }}</span>
34
21
  </el-tooltip>
35
22
  <span :class="[ns.is('required')]" v-if="!outerBorder">:</span>
36
23
  </span>
37
24
  <div :class="[ns.e('item-component')]">
38
- <slot
39
- :name="item.componentName || item.param"
40
- v-bind="getComponentSlotScope(item)"
41
- >
42
- <component
43
- :is="getComponent(item.type)"
44
- v-model="searchParamsCurrent[item.param]"
45
- v-bind="getComponentProps(item)"
46
- >
25
+ <slot :name="item.componentName || item.param" v-bind="getComponentSlotScope(item)">
26
+ <component :is="getComponent(item.type)" v-model="searchParamsCurrent[item.param]"
27
+ v-bind="getComponentProps(item)">
47
28
  </component>
48
29
  </slot>
49
30
  </div>
@@ -52,9 +33,7 @@
52
33
  </div>
53
34
  <div :class="[ns.e('buttons')]">
54
35
  <slot name="solt-search">
55
- <ct-button type="border-plain" @click="resetData" v-if="haveReset"
56
- >重置</ct-button
57
- >
36
+ <ct-button type="border-plain" @click="resetData" v-if="haveReset">重置</ct-button>
58
37
  <ct-button type="border" @click="doSearch">{{
59
38
  searchBtnName
60
39
  }}</ct-button>
@@ -117,7 +96,15 @@ const getComponentStyle = (item) => {
117
96
  return style;
118
97
  };
119
98
  const componentAll = computed(() => {
120
- const { CtInput, CtSelect, CtDatePicker, CtCascader, CtYearSelect, CtRadio } =
99
+ const {
100
+ CtInput,
101
+ CtSelect,
102
+ CtDatePicker,
103
+ CtCascader,
104
+ CtYearSelect,
105
+ CtRadio,
106
+ CtPagingSelect,
107
+ } =
121
108
  searchComponents;
122
109
  const componentMap = {
123
110
  0: CtInput,
@@ -127,6 +114,7 @@ const componentAll = computed(() => {
127
114
  12: CtYearSelect,
128
115
  13: "div",
129
116
  20: CtRadio,
117
+ 22: CtPagingSelect,
130
118
  ...userDefinedSearchComponent,
131
119
  };
132
120
  return componentMap;
@@ -193,34 +181,36 @@ defineExpose({
193
181
  buriedParams,
194
182
  doSearch,
195
183
  });
196
- onMounted(() => {});
184
+ onMounted(() => { });
197
185
  </script>
198
186
  <style lang="less">
199
187
  .ct-search-box {
200
188
  --ct-search-box-item-margin-right: 16px;
201
189
  --ct-search-box-item-margin-top: 14px;
190
+
202
191
  .el-input {
203
192
  --ct-input-default-width: auto;
204
193
  }
194
+
205
195
  &__list {
206
196
  display: flex;
207
197
  align-items: center;
208
198
  flex-wrap: wrap;
209
199
  margin-right: calc(-1 * var(--ct-search-box-item-margin-right));
210
200
  margin-top: calc(-1 * var(--ct-search-box-item-margin-top));
211
- > * {
201
+
202
+ >* {
212
203
  margin-right: var(--ct-search-box-item-margin-right);
213
204
  margin-top: var(--ct-search-box-item-margin-top);
214
205
  }
215
206
  }
207
+
216
208
  &__item {
217
209
  display: flex;
218
210
  align-items: center;
219
- width: calc(
220
- (100% - v-bind(rowNumber) * var(--ct-search-box-item-margin-right)) /
221
- v-bind(rowNumber)
222
- );
211
+ width: calc((100% - v-bind(rowNumber) * var(--ct-search-box-item-margin-right)) / v-bind(rowNumber));
223
212
  --ct-search-box-item-component-width: 100%;
213
+
224
214
  &.is-outer-border {
225
215
  --ct-font-size: 13px;
226
216
  --el-font-size-base: var(--ct-font-size, 13px);
@@ -231,45 +221,55 @@ onMounted(() => {});
231
221
  padding-left: 14px;
232
222
  box-shadow: 0 0 0 1px var(--ct-search-box-border-color);
233
223
  border-radius: var(--ct-border-radius);
224
+
234
225
  &:hover {
235
226
  --ct-search-box-border-color: var(--ct-color-grey-sub);
236
227
  }
228
+
237
229
  &:focus-within {
238
230
  --ct-search-box-border-color: var(--ct-color-primary);
239
231
  }
232
+
240
233
  .el-input__wrapper,
241
234
  .el-select__wrapper,
242
235
  .ct-year-select__wrapper {
243
- --el-select-input-focus-border-color: var(
244
- --ct-search-box-inner-border-color
245
- );
236
+ --el-select-input-focus-border-color: var(--ct-search-box-inner-border-color);
246
237
  box-shadow: 0 0 0 1px var(--ct-search-box-inner-border-color) !important;
247
238
  }
248
239
  }
240
+
249
241
  .ct-radio {
250
242
  padding: 0 var(--ct-component-inner-padding);
243
+
251
244
  .el-radio {
252
245
  margin-right: 12px;
246
+
253
247
  &:last-child {
254
248
  margin-right: 0;
255
249
  }
256
250
  }
257
251
  }
252
+
258
253
  &-label {
259
254
  line-height: 1;
255
+
260
256
  &.is-outer-border {
261
257
  color: var(--ct-color-grey-sub);
262
258
  }
263
259
  }
260
+
264
261
  &-component {
265
262
  flex: 1;
266
- > * {
263
+
264
+ >* {
267
265
  width: var(--ct-search-box-item-component-width) !important;
268
266
  }
269
267
  }
270
268
  }
269
+
271
270
  &__buttons {
272
271
  margin-left: auto;
272
+
273
273
  button {
274
274
  width: 96px;
275
275
  padding: 0;