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.
Files changed (33) hide show
  1. package/dist/plain-design.commonjs.min.js +2 -2
  2. package/dist/plain-design.min.css +4 -4
  3. package/dist/plain-design.min.js +2 -2
  4. package/dist/report.html +2 -2
  5. package/package.json +2 -1
  6. package/src/packages/PlAddress/index.tsx +1 -0
  7. package/src/packages/PlColorButton/color-button.scss +22 -21
  8. package/src/packages/PlFormItem/index.tsx +1 -1
  9. package/src/packages/PlIcon/index.tsx +2 -1
  10. package/src/packages/PlInputGroup/index.tsx +2 -1
  11. package/src/packages/PlLoading/index.tsx +2 -1
  12. package/src/packages/PlObject/index.tsx +1 -0
  13. package/src/packages/PlOv/index.tsx +1 -0
  14. package/src/packages/PlSelect/index.tsx +1 -1
  15. package/src/packages/PlTab/index.tsx +1 -0
  16. package/src/packages/PlTable/plc/standard/plc-expand.tsx +2 -1
  17. package/src/packages/PlTable/table.scss +4 -0
  18. package/src/packages/PlTablePro/index.tsx +1 -0
  19. package/src/packages/PlTabs/index.tsx +1 -0
  20. package/src/packages/PlTree/tree.scss +3 -1
  21. package/src/packages/PlcAddress/index.tsx +1 -0
  22. package/src/packages/PlcImage/index.tsx +2 -1
  23. package/src/packages/PlcObject/index.tsx +1 -0
  24. package/src/packages/PlcOperator/index.tsx +2 -1
  25. package/src/packages/PlcOv/index.tsx +1 -0
  26. package/src/packages/createUseTableOption/index.tsx +3 -0
  27. package/src/packages/createUseTableOption/use/filter/useDistinctFilter.tsx +2 -2
  28. package/src/packages/createUseTableOption/use/use.base-table.tsx +0 -1
  29. package/src/packages/createUseTableOption/use/use.methods.tsx +4 -0
  30. package/src/packages/createUseTableOption/use/use.paginaiton.tsx +3 -2
  31. package/src/packages/useMessage/PlMessage.scss +1 -1
  32. package/src/styles/data/scan.scss.json +16 -16
  33. package/src/utils/findReactElement.tsx +4 -4
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "plain-design",
3
- "version": "0.0.68",
3
+ "version": "0.0.72",
4
4
  "description": "",
5
5
  "main": "dist/plain-design.min.js",
6
+ "module": "dist/plain-design.commonjs.min.js",
6
7
  "typings": "src/index.ts",
7
8
  "files": [
8
9
  "dist",
@@ -16,6 +16,7 @@ import PlSelectOption from "../PlSelectOption";
16
16
  let watchParentChange = false
17
17
 
18
18
  export const PlAddress = designComponent({
19
+ name: 'pl-address',
19
20
  props: {
20
21
  ...EditProps,
21
22
  ...StyleProps,
@@ -1,25 +1,26 @@
1
1
  @include theme {
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;
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
- .pl-color-button-background {
13
- background-size: 7px 7px;
14
- border-radius: 2px;
15
- box-sizing: border-box;
16
- height: 100%;
17
- width: 100%;
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
- .pl-color-button-color {
20
- height: 100%;
21
- width: 100%;
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-error" status="error"/>
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
@@ -17,6 +17,7 @@ export const PlObjectPropsOption = {
17
17
  }
18
18
 
19
19
  export const PlObject = designComponent({
20
+ name: 'pl-object',
20
21
  props: {
21
22
  ...EditProps,
22
23
  ...StyleProps,
@@ -8,6 +8,7 @@ import useOv from "../useOv";
8
8
  import PlSelectOption from "../PlSelectOption";
9
9
 
10
10
  export const PlOv = designComponent({
11
+ name: 'pl-ov',
11
12
  props: {
12
13
  ...EditProps,
13
14
  ...StyleProps,
@@ -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
  )}
@@ -4,6 +4,7 @@ import {TabCollector} from "../PlTabs";
4
4
  import React from 'react';
5
5
 
6
6
  export const PlTab = designComponent({
7
+ name: 'pl-tab',
7
8
  inheritAttrs: false,
8
9
  props: {
9
10
  title: {type: String}, // 页签标题
@@ -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
+ })
@@ -383,6 +383,10 @@
383
383
  .plt-cell {
384
384
  & > * {
385
385
  vertical-align: middle;
386
+
387
+ &.pl-icon {
388
+ vertical-align: middle;
389
+ }
386
390
  }
387
391
 
388
392
  & > .pl-input {
@@ -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事件
@@ -52,6 +52,8 @@
52
52
  }
53
53
 
54
54
  & > * {
55
+ display: flex;
56
+ align-items: center;
55
57
  margin-right: 8px;
56
58
  color: $colorPrimary;
57
59
  user-select: none;
@@ -98,4 +100,4 @@
98
100
  }
99
101
  }
100
102
  }
101
- }
103
+ }
@@ -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
@@ -6,6 +6,7 @@ import {useExternalPlc} from "../PlTable/plc/core/useExternalPlc";
6
6
  import React from "react";
7
7
 
8
8
  export const PlcObject = designComponent({
9
+ name: 'plc-object',
9
10
  props: {
10
11
  ...PlcPropsOptions,
11
12
  ...PlObjectPropsOption,
@@ -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
@@ -10,6 +10,7 @@ import {tDefaultFilterConfigParam} from "../PlFilter/FilterConfig";
10
10
  import {iOvService} from "../useOv/useOv.utils";
11
11
 
12
12
  export const PlcOv = designComponent({
13
+ name: 'plc-ov',
13
14
  props: {
14
15
  ...PlcPropsOptions,
15
16
  ...PlObjectPropsOption,
@@ -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 {findRreactElement} from "../../../../utils/findReactElement";
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 = findRreactElement(tableSlots, ({props: {title, field}}) => title === plc.props.title && field === plc.props.field)
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(() => {
@@ -56,7 +56,6 @@ export function useTableOptionBaseTable(
56
56
  sort={sortState.sortQueryData.value}
57
57
  onCollectPlcData={hooks.onCollectPlcData.exec}
58
58
  >
59
- <PlcIndex start={pagination.pageState.page * pagination.pageState.size}/>
60
59
  {hooks.onColumns.exec([])}
61
60
  </PlTable>
62
61
  )
@@ -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
- resolve(baseTable.refs.el!.offsetHeight)
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 #0000001f, 0 6px 16px #00000014, 0 9px 28px 8px #0000000d;
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 {