ct-component-plus 0.0.28 → 0.0.30
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
|
@@ -11,8 +11,7 @@
|
|
|
11
11
|
ns.is('text', isText),
|
|
12
12
|
]"
|
|
13
13
|
v-bind="$attrs"
|
|
14
|
-
@click="handleClick"
|
|
15
|
-
>
|
|
14
|
+
@click="handleClick">
|
|
16
15
|
<span v-if="$slots.default" :class="[ns.e('text')]">
|
|
17
16
|
<slot />
|
|
18
17
|
</span>
|
|
@@ -52,7 +51,7 @@ defineExpose({
|
|
|
52
51
|
ref: _ref,
|
|
53
52
|
});
|
|
54
53
|
</script>
|
|
55
|
-
<style lang=
|
|
54
|
+
<style lang="less">
|
|
56
55
|
.ct-button {
|
|
57
56
|
cursor: pointer;
|
|
58
57
|
box-sizing: border-box;
|
|
@@ -114,7 +113,7 @@ defineExpose({
|
|
|
114
113
|
}
|
|
115
114
|
}
|
|
116
115
|
&--text {
|
|
117
|
-
background-color:
|
|
116
|
+
background-color: transparent;
|
|
118
117
|
color: var(--ct-color-primary);
|
|
119
118
|
&:hover:not(.is-disabled) {
|
|
120
119
|
opacity: var(--button-hover-opacity);
|
|
@@ -124,7 +123,7 @@ defineExpose({
|
|
|
124
123
|
}
|
|
125
124
|
}
|
|
126
125
|
&--text-plain {
|
|
127
|
-
background-color:
|
|
126
|
+
background-color: transparent;
|
|
128
127
|
color: var(--ct-color-black);
|
|
129
128
|
&:hover:not(.is-disabled) {
|
|
130
129
|
color: var(--ct-color-primary);
|
|
@@ -169,4 +168,4 @@ defineExpose({
|
|
|
169
168
|
margin-left: 8px;
|
|
170
169
|
}
|
|
171
170
|
}
|
|
172
|
-
</style>
|
|
171
|
+
</style>
|
|
@@ -10,33 +10,28 @@
|
|
|
10
10
|
ns.is('outer-border', outerBorder),
|
|
11
11
|
]"
|
|
12
12
|
:key="item.param || index"
|
|
13
|
-
:style="{ ...getComponentStyle(item) }"
|
|
14
|
-
>
|
|
13
|
+
:style="{ ...getComponentStyle(item) }">
|
|
15
14
|
<slot v-bind="getComponentSlotScope(item)">
|
|
16
15
|
<slot
|
|
17
16
|
name="item-before"
|
|
18
|
-
v-bind="getComponentSlotScope(item)"
|
|
19
|
-
></slot>
|
|
17
|
+
v-bind="getComponentSlotScope(item)"></slot>
|
|
20
18
|
<span
|
|
21
19
|
:class="[
|
|
22
20
|
ns.e('item-label'),
|
|
23
21
|
ns.is('required', item.required),
|
|
24
22
|
ns.is('outer-border', outerBorder),
|
|
25
|
-
]"
|
|
26
|
-
>
|
|
23
|
+
]">
|
|
27
24
|
<span>{{ item.label }}</span>
|
|
28
25
|
<span :class="[ns.is('required')]" v-if="!outerBorder">:</span>
|
|
29
26
|
</span>
|
|
30
27
|
<div :class="[ns.e('item-component')]">
|
|
31
28
|
<slot
|
|
32
29
|
:name="item.componentName || item.param"
|
|
33
|
-
v-bind="getComponentSlotScope(item)"
|
|
34
|
-
>
|
|
30
|
+
v-bind="getComponentSlotScope(item)">
|
|
35
31
|
<component
|
|
36
32
|
:is="getComponent(item.type)"
|
|
37
33
|
v-model="searchParamsCurrent[item.param]"
|
|
38
|
-
v-bind="getComponentProps(item)"
|
|
39
|
-
>
|
|
34
|
+
v-bind="getComponentProps(item)">
|
|
40
35
|
</component>
|
|
41
36
|
</slot>
|
|
42
37
|
</div>
|
|
@@ -123,20 +118,26 @@ const handleBuriedParams = (params) => {
|
|
|
123
118
|
};
|
|
124
119
|
const getComponentProps = (item) => {
|
|
125
120
|
const bpKey = toFirstUpperCase(buriedParamsKey);
|
|
121
|
+
console.log(item);
|
|
122
|
+
const attrObj = {
|
|
123
|
+
...item,
|
|
124
|
+
};
|
|
125
|
+
delete attrObj.type;
|
|
126
126
|
// const
|
|
127
127
|
return {
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
...attrObj,
|
|
129
|
+
// param: item.param,
|
|
130
|
+
// label: item.label,
|
|
131
|
+
// multiple: item.multiple,
|
|
132
|
+
// api: item.api,
|
|
133
|
+
// placeholder: item.placeholder,
|
|
134
|
+
// clearable: item.clearable,
|
|
135
|
+
// disabled: item.disabled,
|
|
136
|
+
// range: item.range,
|
|
137
|
+
// mapObj: item.mapObj,
|
|
130
138
|
options: item.list,
|
|
131
|
-
multiple: item.multiple,
|
|
132
|
-
api: item.api,
|
|
133
|
-
placeholder: item.placeholder,
|
|
134
|
-
clearable: item.clearable,
|
|
135
|
-
disabled: item.disabled,
|
|
136
|
-
range: item.range,
|
|
137
|
-
mapObj: item.mapObj,
|
|
138
139
|
name: item.param, //用作插槽名
|
|
139
|
-
rawAttr: item.rawAttr,
|
|
140
|
+
// rawAttr: item.rawAttr,
|
|
140
141
|
|
|
141
142
|
["on" + bpKey]: handleBuriedParams,
|
|
142
143
|
};
|
|
@@ -173,7 +174,7 @@ defineExpose({
|
|
|
173
174
|
});
|
|
174
175
|
onMounted(() => {});
|
|
175
176
|
</script>
|
|
176
|
-
<style lang=
|
|
177
|
+
<style lang="less">
|
|
177
178
|
.ct-search-box {
|
|
178
179
|
--ct-search-box-item-margin-right: 16px;
|
|
179
180
|
--ct-search-box-item-margin-top: 14px;
|
|
@@ -201,6 +202,7 @@ onMounted(() => {});
|
|
|
201
202
|
--ct-search-box-item-component-width: 100%;
|
|
202
203
|
&.is-outer-border {
|
|
203
204
|
--ct-font-size: 13px;
|
|
205
|
+
--el-font-size-base: var(--ct-font-size, 13px);
|
|
204
206
|
--ct-search-box-border-color: var(--ct-border-color);
|
|
205
207
|
--ct-search-box-inner-border-color: transparent;
|
|
206
208
|
font-size: var(--ct-font-size);
|
|
@@ -246,4 +248,4 @@ onMounted(() => {});
|
|
|
246
248
|
}
|
|
247
249
|
}
|
|
248
250
|
}
|
|
249
|
-
</style>
|
|
251
|
+
</style>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
+
<!-- {{ rawAttr }}-- -->
|
|
2
3
|
<el-select
|
|
3
4
|
ref="selectRef"
|
|
4
5
|
:class="[ns.b(), ns.is('multiple', multiple)]"
|
|
@@ -11,15 +12,14 @@
|
|
|
11
12
|
:suffix-icon="suffixIcon"
|
|
12
13
|
:fit-input-width="fitInputWidth"
|
|
13
14
|
:select-text="selectText"
|
|
15
|
+
:data-va="rawAttr.clearable"
|
|
14
16
|
:popper-class="ns.e('popper')"
|
|
15
17
|
@focus="showSearchPrefix"
|
|
16
|
-
@blur="hideSearchPrefix"
|
|
17
|
-
>
|
|
18
|
+
@blur="hideSearchPrefix">
|
|
18
19
|
<template #prefix>
|
|
19
20
|
<div
|
|
20
21
|
:class="[ns.e('filterable-icon')]"
|
|
21
|
-
v-if="filterable && !valueModel && showSearch"
|
|
22
|
-
>
|
|
22
|
+
v-if="filterable && !valueModel && showSearch">
|
|
23
23
|
<ct-icon name="search_line"></ct-icon>
|
|
24
24
|
</div>
|
|
25
25
|
<slot name="prefix"></slot>
|
|
@@ -49,8 +49,7 @@
|
|
|
49
49
|
:key="item.value"
|
|
50
50
|
:label="item.label"
|
|
51
51
|
:value="item.value"
|
|
52
|
-
:disabled="item.disabled"
|
|
53
|
-
>
|
|
52
|
+
:disabled="item.disabled">
|
|
54
53
|
<slot name="option" :item="item" :index="index">
|
|
55
54
|
<span>{{ item.label }}</span>
|
|
56
55
|
</slot>
|
|
@@ -289,7 +288,7 @@ defineExpose({
|
|
|
289
288
|
checkedAll,
|
|
290
289
|
});
|
|
291
290
|
</script>
|
|
292
|
-
<style lang=
|
|
291
|
+
<style lang="less">
|
|
293
292
|
.ct-select {
|
|
294
293
|
width: 214px;
|
|
295
294
|
&__top {
|
|
@@ -366,4 +365,4 @@ defineExpose({
|
|
|
366
365
|
}
|
|
367
366
|
}
|
|
368
367
|
}
|
|
369
|
-
</style>
|
|
368
|
+
</style>
|