plain-design 0.0.68 → 0.0.72
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/plain-design.commonjs.min.js +2 -2
- package/dist/plain-design.min.css +4 -4
- package/dist/plain-design.min.js +2 -2
- package/dist/report.html +2 -2
- package/package.json +2 -1
- package/src/packages/PlAddress/index.tsx +1 -0
- package/src/packages/PlColorButton/color-button.scss +22 -21
- package/src/packages/PlFormItem/index.tsx +1 -1
- package/src/packages/PlIcon/index.tsx +2 -1
- package/src/packages/PlInputGroup/index.tsx +2 -1
- package/src/packages/PlLoading/index.tsx +2 -1
- package/src/packages/PlObject/index.tsx +1 -0
- package/src/packages/PlOv/index.tsx +1 -0
- package/src/packages/PlSelect/index.tsx +1 -1
- package/src/packages/PlTab/index.tsx +1 -0
- package/src/packages/PlTable/plc/standard/plc-expand.tsx +2 -1
- package/src/packages/PlTable/table.scss +4 -0
- package/src/packages/PlTablePro/index.tsx +1 -0
- package/src/packages/PlTabs/index.tsx +1 -0
- package/src/packages/PlTree/tree.scss +3 -1
- package/src/packages/PlcAddress/index.tsx +1 -0
- package/src/packages/PlcImage/index.tsx +2 -1
- package/src/packages/PlcObject/index.tsx +1 -0
- package/src/packages/PlcOperator/index.tsx +2 -1
- package/src/packages/PlcOv/index.tsx +1 -0
- package/src/packages/createUseTableOption/index.tsx +3 -0
- package/src/packages/createUseTableOption/use/filter/useDistinctFilter.tsx +2 -2
- package/src/packages/createUseTableOption/use/use.base-table.tsx +0 -1
- package/src/packages/createUseTableOption/use/use.methods.tsx +4 -0
- package/src/packages/createUseTableOption/use/use.paginaiton.tsx +3 -2
- package/src/packages/useMessage/PlMessage.scss +1 -1
- package/src/styles/data/scan.scss.json +16 -16
- package/src/utils/findReactElement.tsx +4 -4
package/package.json
CHANGED
@@ -1,25 +1,26 @@
|
|
1
1
|
@include theme {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
2
|
+
.pl-color-button {
|
3
|
+
border-radius: 2px;
|
4
|
+
height: 24px;
|
5
|
+
width: 24px;
|
6
|
+
border: solid 1px $ibc;
|
7
|
+
padding: 2px;
|
8
|
+
box-sizing: border-box;
|
9
|
+
display: inline-block;
|
10
|
+
cursor: pointer;
|
11
|
+
vertical-align: middle;
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
13
|
+
.pl-color-button-background {
|
14
|
+
background-size: 7px 7px;
|
15
|
+
border-radius: 2px;
|
16
|
+
box-sizing: border-box;
|
17
|
+
height: 100%;
|
18
|
+
width: 100%;
|
18
19
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
}
|
20
|
+
.pl-color-button-color {
|
21
|
+
height: 100%;
|
22
|
+
width: 100%;
|
23
|
+
}
|
24
24
|
}
|
25
|
-
}
|
25
|
+
}
|
26
|
+
}
|
@@ -191,7 +191,7 @@ export const PlFormItem = designComponent({
|
|
191
191
|
)}
|
192
192
|
{!!invalidate.value && !form.props.hideValidateMessage && (
|
193
193
|
<div className="pl-form-item-message">
|
194
|
-
<PlIcon icon="el-icon-
|
194
|
+
<PlIcon icon="el-icon-warning" status="error"/>
|
195
195
|
<span>{invalidate.value.message}</span>
|
196
196
|
</div>
|
197
197
|
)}
|
@@ -42,6 +42,7 @@ registry('el-icon-', async (icon) => {
|
|
42
42
|
})
|
43
43
|
|
44
44
|
export const PlIcon = designComponent({
|
45
|
+
name: 'pl-icon',
|
45
46
|
props: {
|
46
47
|
icon: {type: String}, // 图标名称
|
47
48
|
status: {type: String}, // 图标状态
|
@@ -91,4 +92,4 @@ export const PlIcon = designComponent({
|
|
91
92
|
},
|
92
93
|
})
|
93
94
|
|
94
|
-
export default PlIcon
|
95
|
+
export default PlIcon
|
@@ -3,6 +3,7 @@ import React from "react";
|
|
3
3
|
import './input-group.scss'
|
4
4
|
|
5
5
|
export const PlInputGroup = designComponent({
|
6
|
+
name: 'pl-input-group',
|
6
7
|
props: {
|
7
8
|
block: {type: Boolean}
|
8
9
|
},
|
@@ -22,4 +23,4 @@ export const PlInputGroup = designComponent({
|
|
22
23
|
},
|
23
24
|
})
|
24
25
|
|
25
|
-
export default PlInputGroup
|
26
|
+
export default PlInputGroup
|
@@ -6,6 +6,7 @@ import {useClasses} from "plain-design-composition";
|
|
6
6
|
import './loading.scss'
|
7
7
|
|
8
8
|
export const PlLoading = designComponent({
|
9
|
+
name: 'pl-loading',
|
9
10
|
props: {
|
10
11
|
type: {type: String, default: 'alpha'},
|
11
12
|
status: {type: String, default: null},
|
@@ -42,4 +43,4 @@ export const PlLoading = designComponent({
|
|
42
43
|
},
|
43
44
|
})
|
44
45
|
|
45
|
-
export default PlLoading
|
46
|
+
export default PlLoading
|
@@ -298,7 +298,7 @@ export const PlSelect = designComponent({
|
|
298
298
|
placeholder={inputBinding.value.placeholder!}
|
299
299
|
default={({item, index}: { item: SelectOption, index: number }) => (
|
300
300
|
<React.Fragment key={index}>
|
301
|
-
<span>{item.props.label}</span
|
301
|
+
<span>{item.props.label}</span>
|
302
302
|
<PlIcon icon="el-icon-close" {...createEventListener({onClick: () => handler.onClickItemCloseIcon(item, index)})}/>
|
303
303
|
</React.Fragment>
|
304
304
|
)}
|
@@ -12,6 +12,7 @@ import {PlcScopeSlotsOptions} from "../utils/plc.scope-slots";
|
|
12
12
|
import {useExternalPlc} from "../core/useExternalPlc";
|
13
13
|
|
14
14
|
export default designComponent({
|
15
|
+
name: 'plc-expand',
|
15
16
|
props: {
|
16
17
|
...createPlcPropOptions({
|
17
18
|
autoFixedLeft: true,
|
@@ -109,4 +110,4 @@ export default designComponent({
|
|
109
110
|
render,
|
110
111
|
}
|
111
112
|
},
|
112
|
-
})
|
113
|
+
})
|
@@ -6,6 +6,7 @@ import {iTableProRenderConfig} from "../createUseTableOption/use/use.hooks";
|
|
6
6
|
import PlLoadingMask from "../PlLoadingMask";
|
7
7
|
|
8
8
|
export const PlTablePro = designComponent({
|
9
|
+
name: 'pl-table-pro',
|
9
10
|
props: {
|
10
11
|
option: {type: Object as PropType<tTableOption>, required: true},
|
11
12
|
loading: {type: Boolean},
|
@@ -10,6 +10,7 @@ import {PlTabsHeaderVertical} from "./header/vertical/TabsHeaderVertical";
|
|
10
10
|
import PlIcon from "../PlIcon";
|
11
11
|
|
12
12
|
export const PlTabs = designComponent({
|
13
|
+
name: 'pl-tabs',
|
13
14
|
props: {
|
14
15
|
modelValue: {type: [String, Number]}, // 双向绑定值,控制当前显示的tab
|
15
16
|
closeable: {type: Boolean}, // 是否显示关闭按钮,会派发onClose事件
|
@@ -9,6 +9,7 @@ import {tDefaultFilterConfigParam} from "../PlFilter/FilterConfig";
|
|
9
9
|
import {iAddressService} from "../useAddress/useAddress.utils";
|
10
10
|
|
11
11
|
export const PlcAddress = designComponent({
|
12
|
+
name: 'plc-address',
|
12
13
|
props: {
|
13
14
|
...PlcPropsOptions,
|
14
15
|
filterName: {type: String, default: 'address'},
|
@@ -10,6 +10,7 @@ import PlImageUploader from "../PlImageUploader";
|
|
10
10
|
import {$$image} from "../../index";
|
11
11
|
|
12
12
|
export const PlcImage = designComponent({
|
13
|
+
name: 'plc-image',
|
13
14
|
props: {
|
14
15
|
...PlcPropsOptions,
|
15
16
|
...PlObjectPropsOption,
|
@@ -86,4 +87,4 @@ export const PlcImage = designComponent({
|
|
86
87
|
},
|
87
88
|
})
|
88
89
|
|
89
|
-
export default PlcImage
|
90
|
+
export default PlcImage
|
@@ -10,6 +10,7 @@ import React from "react";
|
|
10
10
|
* @date 2021/7/15 21:56
|
11
11
|
*/
|
12
12
|
export const PlcOperator = designComponent({
|
13
|
+
name: 'plc-operator',
|
13
14
|
props: {
|
14
15
|
...createPlcPropOptions({
|
15
16
|
fixed: 'right',
|
@@ -41,4 +42,4 @@ export const PlcOperator = designComponent({
|
|
41
42
|
},
|
42
43
|
})
|
43
44
|
|
44
|
-
export default PlcOperator
|
45
|
+
export default PlcOperator
|
@@ -17,6 +17,7 @@ import {iFilterData} from "../PlFilter/FilterConfig";
|
|
17
17
|
import {useTableOptionSortState} from "./use/use.sort.state";
|
18
18
|
import {useTableOptionFilterState} from "./use/use.filter.state";
|
19
19
|
import {useTableOptionCache} from "./use/use.cache";
|
20
|
+
import {PlcIndex} from "../PlcIndex";
|
20
21
|
|
21
22
|
export function createUseTableOption<D = any>(defaultConfig: iTableProDefaultConfig) {
|
22
23
|
return (customConfig: iTableProConfig<D>) => {
|
@@ -134,6 +135,8 @@ export function createUseTableOption<D = any>(defaultConfig: iTableProDefaultCon
|
|
134
135
|
/*收集config.render中的列信息*/
|
135
136
|
hooks.onColumns.use((prev) => {
|
136
137
|
return <>
|
138
|
+
{/*适配 plain-ui 本来是放use.base-table里边的*/}
|
139
|
+
<PlcIndex start={pagination.pageState.page * pagination.pageState.size}/>
|
137
140
|
{prev}
|
138
141
|
{!!config.render && config.render()}
|
139
142
|
</>
|
@@ -12,7 +12,7 @@ import {tTableOptionHooks} from "../use.hooks";
|
|
12
12
|
import {toArray} from "../../../../utils/toArray";
|
13
13
|
import {tTableOptionMethods} from "../use.methods";
|
14
14
|
import {tPlTable} from "../../../PlTable";
|
15
|
-
import {
|
15
|
+
import {findReactElement} from "../../../../utils/findReactElement";
|
16
16
|
import {tTableOptionFilter} from "../use.filter.state";
|
17
17
|
import PlButton from "../../../PlButton";
|
18
18
|
import {TableNode} from "../../../PlTable/table/use/useTableNode";
|
@@ -179,7 +179,7 @@ export function useTableOptionDistinctFilter({hooks, methods, customConfig, filt
|
|
179
179
|
const sortData = await hooks.onCollectSortData.exec([])
|
180
180
|
|
181
181
|
const tableSlots = freezeState.baseTableRef()!.slots.default()
|
182
|
-
const findReactNode =
|
182
|
+
const findReactNode = findReactElement(tableSlots, ({props: {title, field}}) => title === plc.props.title && field === plc.props.field)
|
183
183
|
// console.log({tableSlots, findReactNode,})
|
184
184
|
|
185
185
|
const Content = designPage(() => {
|
@@ -205,6 +205,8 @@ export function useTableOptionMethods({tableState, config, pagination, hooks, cu
|
|
205
205
|
|
206
206
|
const editInline = async () => {
|
207
207
|
tableState.editingWhenAddRow = true
|
208
|
+
/*适配 plain-ui*/
|
209
|
+
await nextTick()
|
208
210
|
tableState.list.unshift(newRowData)
|
209
211
|
await nextTick()
|
210
212
|
const newNode = freezeState.table.flatNodes.value[0]
|
@@ -271,6 +273,8 @@ export function useTableOptionMethods({tableState, config, pagination, hooks, cu
|
|
271
273
|
newRows = await Promise.all(newRows.map((item) => hooks.onHandleNewRow.exec(item)))
|
272
274
|
|
273
275
|
tableState.editingWhenAddRow = true
|
276
|
+
/*适配 plain-ui*/
|
277
|
+
await nextTick()
|
274
278
|
tableState.list.unshift(...newRows)
|
275
279
|
await nextTick()
|
276
280
|
const newNodes = freezeState.table.flatNodes.value.slice(0, newRows.length)
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {computed, reactive} from "plain-design-composition";
|
1
|
+
import {computed, nextTick, reactive} from "plain-design-composition";
|
2
2
|
import {tTableOptionConfig} from "../createUseTableOption.utils";
|
3
3
|
import PlPagination from "../../PlPagination";
|
4
4
|
import React from "react";
|
@@ -68,7 +68,8 @@ export function useTableOptionPagination({tableState, config, hooks, onPrev, onN
|
|
68
68
|
}),
|
69
69
|
new Promise<number>((resolve) => {
|
70
70
|
const eject = hooks.onRefTable.use((baseTable) => {
|
71
|
-
|
71
|
+
/*nextTick 为适配plain-ui,否则此时 el.offsetHeight 高度为0*/
|
72
|
+
nextTick().then(() => resolve(baseTable.refs.el!.offsetHeight))
|
72
73
|
eject()
|
73
74
|
})
|
74
75
|
})
|
@@ -54,7 +54,7 @@
|
|
54
54
|
justify-content: space-between;
|
55
55
|
align-items: center;
|
56
56
|
font-size: 14px;
|
57
|
-
box-shadow: 0 3px 6px -4px
|
57
|
+
box-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px rgba(0, 0, 0, 0.08), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
|
58
58
|
position: relative;
|
59
59
|
|
60
60
|
.pl-icon {
|