@zat-design/sisyphus-react 3.4.0-beta.2 → 3.4.0-beta.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.
Files changed (60) hide show
  1. package/dist/index.esm.css +43 -61
  2. package/es/ProEditTable/components/DndWrapper/index.d.ts +1 -1
  3. package/es/ProEditTable/components/DndWrapper/index.js +5 -5
  4. package/es/ProEditTable/index.js +15 -9
  5. package/es/ProEditTable/style/index.less +36 -55
  6. package/es/ProEditTable/utils/index.js +2 -2
  7. package/es/ProEnum/components/Group.d.ts +7 -0
  8. package/es/ProEnum/components/Group.js +42 -0
  9. package/es/ProEnum/index.js +9 -0
  10. package/es/ProEnum/propsType.d.ts +2 -2
  11. package/es/ProEnum/style/index.less +49 -0
  12. package/es/ProForm/components/base/InputNumber/index.js +2 -2
  13. package/es/ProForm/components/combination/FormList/components/LineFields.js +1 -0
  14. package/es/ProForm/components/render/ConfirmWrapper.d.ts +10 -0
  15. package/es/ProForm/components/render/ConfirmWrapper.js +53 -0
  16. package/es/ProForm/components/render/Render.js +10 -1
  17. package/es/ProForm/components/render/RenderFields.js +3 -1
  18. package/es/ProForm/components/render/propsType.d.ts +6 -2
  19. package/es/ProForm/utils/valueType.js +37 -3
  20. package/es/ProIcon/index.d.ts +0 -1
  21. package/es/ProIcon/index.js +6 -4
  22. package/es/ProIcon/style/index.less +4 -6
  23. package/es/ProIcon/symbolIcon.js +20 -20
  24. package/es/ProTable/components/RenderColumn/index.js +1 -2
  25. package/es/ProTable/propsType.d.ts +1 -1
  26. package/es/ProTable/style/index.less +196 -99
  27. package/es/ProTable/utils.js +1 -1
  28. package/es/ProTreeModal/components/SortableItem.js +5 -7
  29. package/es/ProTreeModal/style/index.less +0 -6
  30. package/es/style/core/mixins.less +12 -5
  31. package/lib/ProEditTable/components/DndWrapper/index.d.ts +1 -1
  32. package/lib/ProEditTable/components/DndWrapper/index.js +5 -5
  33. package/lib/ProEditTable/index.js +13 -7
  34. package/lib/ProEditTable/style/index.less +36 -55
  35. package/lib/ProEditTable/utils/index.js +2 -2
  36. package/lib/ProEnum/components/Group.d.ts +7 -0
  37. package/lib/ProEnum/components/Group.js +49 -0
  38. package/lib/ProEnum/index.js +9 -0
  39. package/lib/ProEnum/propsType.d.ts +2 -2
  40. package/lib/ProEnum/style/index.less +49 -0
  41. package/lib/ProForm/components/base/InputNumber/index.js +2 -2
  42. package/lib/ProForm/components/combination/FormList/components/LineFields.js +1 -0
  43. package/lib/ProForm/components/render/ConfirmWrapper.d.ts +10 -0
  44. package/lib/ProForm/components/render/ConfirmWrapper.js +59 -0
  45. package/lib/ProForm/components/render/Render.js +10 -1
  46. package/lib/ProForm/components/render/RenderFields.js +3 -1
  47. package/lib/ProForm/components/render/propsType.d.ts +6 -2
  48. package/lib/ProForm/utils/valueType.js +37 -3
  49. package/lib/ProIcon/index.d.ts +0 -1
  50. package/lib/ProIcon/index.js +6 -4
  51. package/lib/ProIcon/style/index.less +4 -6
  52. package/lib/ProIcon/symbolIcon.js +20 -20
  53. package/lib/ProTable/components/RenderColumn/index.js +1 -2
  54. package/lib/ProTable/propsType.d.ts +1 -1
  55. package/lib/ProTable/style/index.less +196 -99
  56. package/lib/ProTable/utils.js +1 -1
  57. package/lib/ProTreeModal/components/SortableItem.js +5 -7
  58. package/lib/ProTreeModal/style/index.less +0 -6
  59. package/lib/style/core/mixins.less +12 -5
  60. package/package.json +1 -1
@@ -1630,8 +1630,8 @@
1630
1630
  .pro-table .custom-column-btn:visited,
1631
1631
  .pro-table .custom-column-btn:focus {
1632
1632
  color: unset;
1633
- border: 1px solid #d9d9d9;
1634
1633
  background: unset;
1634
+ border: 1px solid #d9d9d9;
1635
1635
  }
1636
1636
  .pro-table .custom-column-btn .anticon {
1637
1637
  height: 16px;
@@ -1649,15 +1649,14 @@
1649
1649
  }
1650
1650
  .pro-table .ant-table-body .ant-table-cell .varied-cell {
1651
1651
  margin-left: -8px;
1652
- background: var(--zaui-contract-bg, #fffaa1);
1653
1652
  padding: var(--zaui-space-size-xs, 4px) var(--zaui-space-size-sm, 8px);
1653
+ background: var(--zaui-contract-bg, #fffaa1);
1654
1654
  border-radius: var(--zaui-border-radius, 4px);
1655
1655
  }
1656
1656
  .pro-table .ant-table-body .varied-cell.empty-cell {
1657
1657
  width: 24.5px;
1658
1658
  }
1659
1659
  .pro-table .copyable-table-cell .ant-typography {
1660
- margin-bottom: 0;
1661
1660
  display: -webkit-box;
1662
1661
  display: -webkit-flex;
1663
1662
  display: -ms-flexbox;
@@ -1666,6 +1665,7 @@
1666
1665
  -webkit-align-items: center;
1667
1666
  -ms-flex-align: center;
1668
1667
  align-items: center;
1668
+ margin-bottom: 0;
1669
1669
  }
1670
1670
  .pro-table .copyable-table-cell .drag-icon > div {
1671
1671
  display: -webkit-box;
@@ -1681,32 +1681,32 @@
1681
1681
  fill: var(--zaui-success, #00ae4d);
1682
1682
  }
1683
1683
  .pro-table .copyable-table-cell svg {
1684
- width: 14px;
1685
- height: 14px;
1686
- fill: #3f3f3f;
1687
1684
  display: inline-block;
1685
+ width: 16px;
1686
+ height: 16px;
1687
+ fill: var(--zaui-brand, #006aff);
1688
1688
  }
1689
1689
  .pro-table.pro-table-no-stripe .ant-table.ant-table-scroll-horizontal .ant-table-tbody .ant-table-row:nth-child(n) > td {
1690
1690
  background: var(--zaui-base-bg, #ffffff);
1691
1691
  }
1692
1692
  .pro-table .ant-table-thead .ant-dropdown-trigger.ant-dropdown-open .anticon-down {
1693
+ -webkit-transform: rotateZ(180deg);
1694
+ transform: rotateZ(180deg);
1693
1695
  -webkit-transition: -webkit-transform 0.3s;
1694
1696
  transition: -webkit-transform 0.3s;
1695
1697
  transition: transform 0.3s;
1696
1698
  transition: transform 0.3s, -webkit-transform 0.3s;
1697
- -webkit-transform: rotateZ(180deg);
1698
- transform: rotateZ(180deg);
1699
1699
  }
1700
1700
  .pro-table .pro-table-container {
1701
1701
  position: relative;
1702
1702
  }
1703
1703
  .pro-table .pro-table-container .pro-table-resizable-line {
1704
1704
  position: absolute;
1705
- width: 0;
1706
1705
  top: 0;
1707
- border-left: 1px solid var(--zaui-brand, #006aff);
1708
- height: 100%;
1709
1706
  left: 100px;
1707
+ width: 0;
1708
+ height: 100%;
1709
+ border-left: 1px solid var(--zaui-brand, #006aff);
1710
1710
  }
1711
1711
  .pro-table .ant-table-thead tr th:last-child .react-resizable-handle {
1712
1712
  display: none;
@@ -1745,8 +1745,8 @@
1745
1745
  .pro-table .column-config .right-actions > .ant-btn:visited,
1746
1746
  .pro-table .column-config .right-actions > .ant-btn:focus {
1747
1747
  color: unset;
1748
- border: 1px solid #d9d9d9;
1749
1748
  background: unset;
1749
+ border: 1px solid #d9d9d9;
1750
1750
  }
1751
1751
  .pro-table .column-config .right-actions .custom-column-btn {
1752
1752
  margin-left: var(--zaui-space-size-sm, 8px);
@@ -1764,9 +1764,9 @@
1764
1764
  height: 100%;
1765
1765
  }
1766
1766
  .pro-table .ant-table .ant-table-thead > tr > th {
1767
- border-bottom: 0;
1768
1767
  white-space: nowrap;
1769
1768
  background: var(--zaui-table-header-bg, #f2f3f5);
1769
+ border-bottom: 0;
1770
1770
  }
1771
1771
  .pro-table .ant-table .ant-table-thead > tr > th .pro-table-th-cell {
1772
1772
  width: 100%;
@@ -1795,9 +1795,9 @@
1795
1795
  height: 14px;
1796
1796
  }
1797
1797
  .pro-table .ant-table .ant-table-thead > tr > th .pro-table-tooltip .icon-tip div svg {
1798
- margin-left: 8px;
1799
1798
  width: 14px;
1800
1799
  height: 14px;
1800
+ margin-left: 8px;
1801
1801
  fill: #909090;
1802
1802
  }
1803
1803
  .pro-table .ant-table.ant-table-bordered .ant-table-thead > tr > th {
@@ -1835,35 +1835,35 @@
1835
1835
  cursor: col-resize;
1836
1836
  }
1837
1837
  .pro-table .react-resizable-handle::before {
1838
- content: '';
1839
1838
  position: absolute;
1840
- left: 50%;
1841
1839
  top: 50%;
1840
+ left: 50%;
1842
1841
  width: 1px;
1843
1842
  height: 18px;
1844
- background: #DCDCDC;
1843
+ background: #dcdcdc;
1845
1844
  -webkit-transform: translateY(-50%);
1846
1845
  transform: translateY(-50%);
1846
+ content: '';
1847
1847
  }
1848
1848
  .pro-table .react-resizable-handle.active::before,
1849
1849
  .pro-table .react-resizable-handle:hover::before {
1850
- content: '';
1851
1850
  position: absolute;
1851
+ bottom: 0;
1852
1852
  left: 50%;
1853
1853
  height: 100%;
1854
- bottom: 0;
1855
1854
  border-left: 5px solid var(--zaui-brand, #006aff);
1855
+ content: '';
1856
1856
  }
1857
1857
  .pro-table .ant-table-tbody tr td .ant-checkbox-wrapper-checked.checkbox-disabled {
1858
- pointer-events: none;
1859
1858
  cursor: not-allowed;
1860
1859
  opacity: 0.5;
1860
+ pointer-events: none;
1861
1861
  }
1862
1862
  .pro-table .ant-pagination-options-quick-jumper input {
1863
- border: unset;
1864
- background: #FAFAFA;
1865
1863
  min-width: 32px;
1866
1864
  height: 32px;
1865
+ background: #fafafa;
1866
+ border: unset;
1867
1867
  }
1868
1868
  .pro-table .ant-pagination .ant-pagination-item-active a {
1869
1869
  color: #ffffff;
@@ -3468,11 +3468,6 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
3468
3468
  border: none;
3469
3469
  border-radius: var(--zaui-border-radius, 4px);
3470
3470
  }
3471
- .pro-transfer-right .checked-item .ant-tag .drag-icon {
3472
- height: 20px;
3473
- margin-right: var(--zaui-space-size-xs, 4px);
3474
- cursor: move;
3475
- }
3476
3471
  .pro-transfer-right .checked-item .ant-tag .pro-tooltip {
3477
3472
  -webkit-box-flex: 1;
3478
3473
  -webkit-flex: 1;
@@ -4067,7 +4062,8 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
4067
4062
  display: flex;
4068
4063
  }
4069
4064
  .pro-edit-table .drag-wrapper .drag-icon {
4070
- margin-right: var(--zaui-space-size-xs, 4px);
4065
+ margin-right: var(--zaui-space-size-md, 16px);
4066
+ margin-left: var(--zaui-space-size-xs, 4px);
4071
4067
  cursor: pointer;
4072
4068
  }
4073
4069
  .pro-edit-table.pro-table-no-stripe .ant-table-tbody tr:nth-child(n) > td {
@@ -4086,33 +4082,24 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
4086
4082
  padding-left: var(--zaui-space-size-md, 16px);
4087
4083
  padding-right: var(--zaui-space-size-md, 16px);
4088
4084
  }
4089
- .pro-edit-table .ant-table-header > table .ant-table-thead > tr > th:not(.ant-table-selection-column):not(.ant-table-row-expand-icon-cell):not([colspan]).is-required::after {
4090
- content: "";
4091
- }
4092
- .pro-edit-table .ant-table-header > table .ant-table-thead > tr > th:not(.ant-table-selection-column):not(.ant-table-row-expand-icon-cell):not([colspan]).is-required.is-required-left::before {
4093
- content: "";
4094
- }
4095
- .pro-edit-table .ant-table-header > table .ant-table-thead > tr > th:not(.ant-table-selection-column):not(.ant-table-row-expand-icon-cell):not([colspan]).is-required .pro-edit-table-title::after {
4096
- width: auto;
4085
+ .pro-edit-table .ant-table-header > table .ant-table-thead > tr > th:not(.ant-table-selection-column):not(.ant-table-row-expand-icon-cell):not([colspan]).is-required.is-required-right .pro-edit-table-title::before {
4097
4086
  position: static;
4098
4087
  top: 0;
4099
4088
  display: inline-block;
4100
- margin-left: var(--zaui-space-size-xs, 4px);
4089
+ text-indent: -8px;
4101
4090
  color: #ff5050;
4102
- font-size: 14px;
4091
+ font-size: var(--zaui-font-size-md, 14px);
4103
4092
  line-height: 1;
4104
4093
  content: "*";
4105
4094
  }
4106
- .pro-edit-table .ant-table-header > table .ant-table-thead > tr > th:not(.ant-table-selection-column):not(.ant-table-row-expand-icon-cell):not([colspan]).is-required .pro-edit-table-title.is-required-left::after {
4107
- display: none;
4108
- }
4109
- .pro-edit-table .ant-table-header > table .ant-table-thead > tr > th:not(.ant-table-selection-column):not(.ant-table-row-expand-icon-cell):not([colspan]).is-required .pro-edit-table-title.is-required-left::before {
4095
+ .pro-edit-table .ant-table-header > table .ant-table-thead > tr > th:not(.ant-table-selection-column):not(.ant-table-row-expand-icon-cell):not([colspan]).is-required.is-required-left .pro-edit-table-title::after {
4096
+ width: auto;
4110
4097
  position: static;
4111
4098
  top: 0;
4112
4099
  display: inline-block;
4113
- text-indent: -8px;
4100
+ margin-left: var(--zaui-space-size-xs, 4px);
4114
4101
  color: #ff5050;
4115
- font-size: var(--zaui-font-size-md, 14px);
4102
+ font-size: 14px;
4116
4103
  line-height: 1;
4117
4104
  content: "*";
4118
4105
  }
@@ -4135,33 +4122,24 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
4135
4122
  .pro-edit-table .ant-table-content > table td .pro-form-view-container_nowrap {
4136
4123
  white-space: normal;
4137
4124
  }
4138
- .pro-edit-table .ant-table-content > table .ant-table-thead > tr > th:not(.ant-table-selection-column):not(.ant-table-row-expand-icon-cell):not([colspan]).is-required::after {
4139
- content: "";
4140
- }
4141
- .pro-edit-table .ant-table-content > table .ant-table-thead > tr > th:not(.ant-table-selection-column):not(.ant-table-row-expand-icon-cell):not([colspan]).is-required.is-required-left::before {
4142
- content: "";
4143
- }
4144
- .pro-edit-table .ant-table-content > table .ant-table-thead > tr > th:not(.ant-table-selection-column):not(.ant-table-row-expand-icon-cell):not([colspan]).is-required .pro-edit-table-title::after {
4145
- width: auto;
4125
+ .pro-edit-table .ant-table-content > table .ant-table-thead > tr > th:not(.ant-table-selection-column):not(.ant-table-row-expand-icon-cell):not([colspan]).is-required.is-required-right .pro-edit-table-title::before {
4146
4126
  position: static;
4147
4127
  top: 0;
4148
4128
  display: inline-block;
4149
- margin-left: var(--zaui-space-size-xs, 4px);
4129
+ text-indent: -8px;
4150
4130
  color: #ff5050;
4151
4131
  font-size: var(--zaui-font-size-md, 14px);
4152
4132
  line-height: 1;
4153
4133
  content: "*";
4154
4134
  }
4155
- .pro-edit-table .ant-table-content > table .ant-table-thead > tr > th:not(.ant-table-selection-column):not(.ant-table-row-expand-icon-cell):not([colspan]).is-required .pro-edit-table-title.is-required-left::after {
4156
- display: none;
4157
- }
4158
- .pro-edit-table .ant-table-content > table .ant-table-thead > tr > th:not(.ant-table-selection-column):not(.ant-table-row-expand-icon-cell):not([colspan]).is-required .pro-edit-table-title.is-required-left::before {
4135
+ .pro-edit-table .ant-table-content > table .ant-table-thead > tr > th:not(.ant-table-selection-column):not(.ant-table-row-expand-icon-cell):not([colspan]).is-required.is-required-left .pro-edit-table-title::after {
4136
+ width: auto;
4159
4137
  position: static;
4160
4138
  top: 0;
4161
4139
  display: inline-block;
4162
- text-indent: -8px;
4140
+ margin-left: var(--zaui-space-size-xs, 4px);
4163
4141
  color: #ff5050;
4164
- font-size: var(--zaui-font-size-md, 14px);
4142
+ font-size: 14px;
4165
4143
  line-height: 1;
4166
4144
  content: "*";
4167
4145
  }
@@ -4362,7 +4340,7 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
4362
4340
  cursor: pointer;
4363
4341
  }
4364
4342
  .pro-icon.pro-icon-with-theme {
4365
- fill: var(--zaui-brand, #006Aff);
4343
+ fill: var(--zaui-brand, #006aff);
4366
4344
  }
4367
4345
  .pro-icon.pro-icon-spin {
4368
4346
  -webkit-animation: loadingCircle 1s infinite linear;
@@ -4375,8 +4353,8 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
4375
4353
  width: auto;
4376
4354
  height: auto;
4377
4355
  padding: 0;
4378
- border: 0;
4379
4356
  vertical-align: 0;
4357
+ border: 0;
4380
4358
  }
4381
4359
  .pro-theme-prd-tools-drawer .ant-drawer-header {
4382
4360
  border-bottom: none;
@@ -4897,6 +4875,10 @@ input[type='button'] {
4897
4875
  }
4898
4876
  }
4899
4877
  /* IE兼容 */
4878
+ .pro-icon.drag-icon {
4879
+ margin-right: var(--zaui-space-size-xs, 4px);
4880
+ cursor: move;
4881
+ }
4900
4882
  /* 兼容IE11 默认会生成2个值,默认值,var值。IE11下读取默认值 */
4901
4883
  :root {
4902
4884
  --zaui-global-bg: #ffffff;
@@ -4,7 +4,7 @@ interface RowProps extends React.HTMLAttributes<HTMLTableRowElement> {
4
4
  disabled?: boolean;
5
5
  }
6
6
  export declare const Row: FC<RowProps>;
7
- declare const DndWrapper: ({ draggable, value, onChange, disabled, children, }: {
7
+ declare const DndWrapper: ({ draggable, value, onChange, disabled, children }: {
8
8
  draggable: any;
9
9
  value: any;
10
10
  onChange: any;
@@ -6,8 +6,7 @@ import React from 'react';
6
6
  import { DndContext } from '@dnd-kit/core';
7
7
  import { arrayMove, useSortable, SortableContext, verticalListSortingStrategy } from '@dnd-kit/sortable';
8
8
  import { CSS } from '@dnd-kit/utilities';
9
- import { ReactSVG } from 'react-svg';
10
- import DragSvg from '../../../assets/drag.svg';
9
+ import ProIcon from '../../../ProIcon';
11
10
  export var Row = function Row(props) {
12
11
  var disabled = props.disabled,
13
12
  children = props.children,
@@ -44,13 +43,14 @@ export var Row = function Row(props) {
44
43
  return /*#__PURE__*/React.cloneElement(child, {
45
44
  children: _jsxs("span", {
46
45
  className: "drag-wrapper",
47
- children: [_jsx(ReactSVG, _objectSpread({
46
+ children: [_jsx(ProIcon, _objectSpread({
47
+ className: "drag-icon",
48
48
  style: {
49
49
  touchAction: 'none',
50
50
  cursor: disabled ? 'no-drop' : 'move'
51
51
  },
52
- className: "drag-handle",
53
- src: DragSvg
52
+ type: "drag",
53
+ size: 20
54
54
  }, listeners)), render === null || render === void 0 ? void 0 : render(null, record, renderIndex)]
55
55
  })
56
56
  });
@@ -12,9 +12,9 @@ import _Form from "antd/es/form";
12
12
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
13
13
  var _excluded = ["value", "onChange", "className", "columns", "type", "mode", "stripe", "draggable", "disabled", "insertType", "emptyBtnText", "actionWidth", "actionProps", "toolbarProps", "rowSelection", "onlyOneLineMsg", "deletePoConfirmMsg", "mulDeletePoConfirmMsg", "otherProps", "requiredAlign", "summary", "max", "headerRender", "pagination", "originalValues", "originalTip", "rowKey"];
14
14
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
15
- import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useRef } from 'react';
15
+ import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef } from 'react';
16
16
  import { get, isArray } from 'lodash';
17
- import { useDebounceEffect, useSetState } from 'ahooks';
17
+ import { useDebounceEffect, useLocalStorageState, useSetState } from 'ahooks';
18
18
  import classnames from 'classnames';
19
19
  import { transformColumns } from './utils';
20
20
  import { getRandom, getNamePath } from './utils/tools';
@@ -22,7 +22,7 @@ import { DndWrapper, Row, Validator, Summary, RenderToolbar } from './components
22
22
  import Empty from '../assets/empty.png';
23
23
  import locale, { formatMessage } from '../locale';
24
24
  var ProEditTable = function ProEditTable(_ref, ref) {
25
- var _resetProps$id, _resetProps$id$split, _value$2;
25
+ var _resetProps$id, _resetProps$id$split, _themeConfig$data2, _value$2;
26
26
  var value = _ref.value,
27
27
  onChange = _ref.onChange,
28
28
  className = _ref.className,
@@ -43,7 +43,7 @@ var ProEditTable = function ProEditTable(_ref, ref) {
43
43
  mulDeletePoConfirmMsg = _ref.mulDeletePoConfirmMsg,
44
44
  _ref$otherProps = _ref.otherProps,
45
45
  otherProps = _ref$otherProps === void 0 ? {} : _ref$otherProps,
46
- requiredAlign = _ref.requiredAlign,
46
+ configRequiredAlign = _ref.requiredAlign,
47
47
  summary = _ref.summary,
48
48
  max = _ref.max,
49
49
  headerRender = _ref.headerRender,
@@ -65,6 +65,13 @@ var ProEditTable = function ProEditTable(_ref, ref) {
65
65
  getPrefixCls = _React$useContext.getPrefixCls;
66
66
  var prefixCls = getPrefixCls();
67
67
  disabled = (otherProps === null || otherProps === void 0 ? void 0 : otherProps.disabled) || disabled;
68
+ var _useLocalStorageState = useLocalStorageState('themeConfig'),
69
+ _useLocalStorageState2 = _slicedToArray(_useLocalStorageState, 1),
70
+ themeConfig = _useLocalStorageState2[0];
71
+ var requiredAlign = useMemo(function () {
72
+ var _ref2, _themeConfig$data$zau, _themeConfig$data;
73
+ return (_ref2 = (_themeConfig$data$zau = themeConfig === null || themeConfig === void 0 ? void 0 : (_themeConfig$data = themeConfig.data) === null || _themeConfig$data === void 0 ? void 0 : _themeConfig$data.zauiFormAlign) !== null && _themeConfig$data$zau !== void 0 ? _themeConfig$data$zau : configRequiredAlign) !== null && _ref2 !== void 0 ? _ref2 : 'left';
74
+ }, [themeConfig === null || themeConfig === void 0 ? void 0 : (_themeConfig$data2 = themeConfig.data) === null || _themeConfig$data2 === void 0 ? void 0 : _themeConfig$data2.zauiFormAlign]);
68
75
  var _useSetState = useSetState({
69
76
  _columns: columns,
70
77
  cellNamePath: [],
@@ -101,8 +108,8 @@ var ProEditTable = function ProEditTable(_ref, ref) {
101
108
  var getRowKey = function getRowKey(record) {
102
109
  var key = record.rowKey || getRandom();
103
110
  if (rowKey) {
104
- var _ref2;
105
- key = (_ref2 = typeof rowKey === 'function' ? rowKey(record) : record[rowKey]) !== null && _ref2 !== void 0 ? _ref2 : key;
111
+ var _ref3;
112
+ key = (_ref3 = typeof rowKey === 'function' ? rowKey(record) : record[rowKey]) !== null && _ref3 !== void 0 ? _ref3 : key;
106
113
  }
107
114
  return key;
108
115
  };
@@ -226,7 +233,7 @@ var ProEditTable = function ProEditTable(_ref, ref) {
226
233
  return isForbiddenBtn('mulDelete') ? rowSelection : _rowSelection;
227
234
  };
228
235
  var setColumns = /*#__PURE__*/function () {
229
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
236
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
230
237
  var nextColumns;
231
238
  return _regeneratorRuntime().wrap(function _callee$(_context) {
232
239
  while (1) switch (_context.prev = _context.next) {
@@ -245,7 +252,7 @@ var ProEditTable = function ProEditTable(_ref, ref) {
245
252
  }, _callee);
246
253
  }));
247
254
  return function setColumns() {
248
- return _ref3.apply(this, arguments);
255
+ return _ref4.apply(this, arguments);
249
256
  };
250
257
  }();
251
258
  useDebounceEffect(function () {
@@ -355,7 +362,6 @@ ForwardProEditTable.defaultProps = {
355
362
  type: 'multiple',
356
363
  mode: 'multiple',
357
364
  insertType: 'after',
358
- requiredAlign: 'right',
359
365
  value: [],
360
366
  actionProps: [],
361
367
  toolbarProps: [],
@@ -63,7 +63,8 @@
63
63
  .drag-wrapper {
64
64
  display: flex;
65
65
  .drag-icon {
66
- margin-right: var(--zaui-space-size-xs, 4px);
66
+ margin-right: var(--zaui-space-size-md, 16px);
67
+ margin-left: var(--zaui-space-size-xs, 4px);
67
68
  cursor: pointer;
68
69
  }
69
70
  }
@@ -92,33 +93,8 @@
92
93
  }
93
94
 
94
95
  .@{ant-prefix}-table-header>table .@{ant-prefix}-table-thead>tr>th:not(.@{ant-prefix}-table-selection-column):not(.@{ant-prefix}-table-row-expand-icon-cell):not([colspan]).is-required {
95
- &::after {
96
- content: "";
97
- }
98
-
99
- &.is-required-left {
100
- &::before {
101
- content: "";
102
- }
103
- }
104
- .pro-edit-table-title {
105
- &::after {
106
- width: auto;
107
- position : static;
108
- top : 0;
109
- display : inline-block;
110
- margin-left: var(--zaui-space-size-xs, 4px);
111
- color : #ff5050;
112
- font-size : 14px;
113
- line-height: 1;
114
- content : "*";
115
- }
116
-
117
- &.is-required-left {
118
- &::after {
119
- display: none;
120
- }
121
-
96
+ &.is-required-right {
97
+ .pro-edit-table-title {
122
98
  &::before {
123
99
  position : static;
124
100
  top : 0;
@@ -131,6 +107,21 @@
131
107
  }
132
108
  }
133
109
  }
110
+ &.is-required-left {
111
+ .pro-edit-table-title {
112
+ &::after {
113
+ width: auto;
114
+ position : static;
115
+ top : 0;
116
+ display : inline-block;
117
+ margin-left: var(--zaui-space-size-xs, 4px);
118
+ color : #ff5050;
119
+ font-size : 14px;
120
+ line-height: 1;
121
+ content : "*";
122
+ }
123
+ }
124
+ }
134
125
  }
135
126
 
136
127
  .@{ant-prefix}-table-scroll-horizontal {
@@ -166,33 +157,8 @@
166
157
  }
167
158
 
168
159
  .@{ant-prefix}-table-thead>tr>th:not(.@{ant-prefix}-table-selection-column):not(.@{ant-prefix}-table-row-expand-icon-cell):not([colspan]).is-required {
169
- &::after {
170
- content: "";
171
- }
172
-
173
- &.is-required-left {
174
- &::before {
175
- content: "";
176
- }
177
- }
178
- .pro-edit-table-title {
179
- &::after {
180
- width: auto;
181
- position : static;
182
- top : 0;
183
- display : inline-block;
184
- margin-left: var(--zaui-space-size-xs, 4px);
185
- color : #ff5050;
186
- font-size : var(--zaui-font-size-md, 14px);
187
- line-height: 1;
188
- content : "*";
189
- }
190
-
191
- &.is-required-left {
192
- &::after {
193
- display: none;
194
- }
195
-
160
+ &.is-required-right {
161
+ .pro-edit-table-title {
196
162
  &::before {
197
163
  position : static;
198
164
  top : 0;
@@ -205,6 +171,21 @@
205
171
  }
206
172
  }
207
173
  }
174
+ &.is-required-left {
175
+ .pro-edit-table-title {
176
+ &::after {
177
+ width: auto;
178
+ position : static;
179
+ top : 0;
180
+ display : inline-block;
181
+ margin-left: var(--zaui-space-size-xs, 4px);
182
+ color : #ff5050;
183
+ font-size : 14px;
184
+ line-height: 1;
185
+ content : "*";
186
+ }
187
+ }
188
+ }
208
189
  }
209
190
  }
210
191
  }
@@ -250,8 +250,8 @@ export var transformColumns = function transformColumns() {
250
250
  item.className = classnames(_defineProperty({
251
251
  'is-hidden': hidden,
252
252
  'is-required': required || labelRequired,
253
- 'is-required-right': requiredAlign === 'right',
254
- 'is-required-left': requiredAlign === 'left'
253
+ 'is-required-left': requiredAlign === 'left',
254
+ 'is-required-right': requiredAlign === 'right'
255
255
  }, className, className));
256
256
  // 防止重复渲染导致className重复添加
257
257
  if (item.className) {
@@ -0,0 +1,7 @@
1
+ import { ProEnum } from '../propsType';
2
+ interface Props extends Pick<ProEnum, 'value' | 'onChange' | 'dataSource'> {
3
+ fieldValue: string;
4
+ fieldLabel: string;
5
+ }
6
+ declare const Group: (props: Props) => JSX.Element;
7
+ export default Group;
@@ -0,0 +1,42 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import classNames from 'classnames';
4
+ import { useEffect, useState } from 'react';
5
+ var Group = function Group(props) {
6
+ var value = props.value,
7
+ onChange = props.onChange,
8
+ dataSource = props.dataSource,
9
+ fieldValue = props.fieldValue,
10
+ fieldLabel = props.fieldLabel;
11
+ var _useState = useState(),
12
+ _useState2 = _slicedToArray(_useState, 2),
13
+ checked = _useState2[0],
14
+ setValue = _useState2[1];
15
+ useEffect(function () {
16
+ setValue(value);
17
+ }, [value]);
18
+ var handleClick = function handleClick(val) {
19
+ setValue(val);
20
+ onChange === null || onChange === void 0 ? void 0 : onChange(val);
21
+ };
22
+ if (dataSource.length === 0) {
23
+ return _jsx("span", {
24
+ children: "-"
25
+ });
26
+ }
27
+ return _jsx("div", {
28
+ className: "pro-enum-group-root",
29
+ children: dataSource.map(function (item) {
30
+ return _jsxs("div", {
31
+ onClick: function onClick() {
32
+ return handleClick(item[fieldValue]);
33
+ },
34
+ className: classNames('pro-enum-group-item', checked === item[fieldValue] ? 'pro-enum-group-item-selected' : ''),
35
+ children: [_jsx("div", {
36
+ className: "pro-enum-group-item-after"
37
+ }), item[fieldLabel]]
38
+ }, item[fieldValue]);
39
+ })
40
+ });
41
+ };
42
+ export default Group;
@@ -20,6 +20,7 @@ import { cloneDeep, isFunction, isString, isArray, omit } from 'lodash';
20
20
  import ProSelect from '../ProSelect';
21
21
  import { useProConfig } from '../ProConfigProvider';
22
22
  import ProEnumTag from './components/Tag';
23
+ import ProEnumGroup from './components/Group';
23
24
  import Container from '../ProForm/components/Container';
24
25
  import { isObject } from './utils';
25
26
  import getEnumLabel from './utils/getEnumLabel';
@@ -205,6 +206,14 @@ var ProEnum = function ProEnum(props) {
205
206
  fieldValue: fieldValue,
206
207
  dataSource: list
207
208
  });
209
+ case 'Group':
210
+ return _jsx(ProEnumGroup, {
211
+ value: value,
212
+ onChange: onChange,
213
+ fieldLabel: label,
214
+ fieldValue: fieldValue,
215
+ dataSource: list
216
+ });
208
217
  default:
209
218
  return null;
210
219
  }
@@ -42,7 +42,7 @@ export interface ProEnumConfig {
42
42
  };
43
43
  dics: Record<string, DataOption[]>;
44
44
  }
45
- type ProEnumType = 'ProSelect' | 'Radio' | 'Checkbox' | 'Tag';
45
+ type ProEnumType = 'ProSelect' | 'Radio' | 'Checkbox' | 'Tag' | 'Group';
46
46
  export interface ProEnum {
47
47
  /** 组件展示类型、默认 ProSelect */
48
48
  type?: ProEnumType;
@@ -86,7 +86,7 @@ export type CheckboxPropsMap = {
86
86
  type?: 'Checkbox';
87
87
  } & CheckboxProps;
88
88
  export interface TagPropsMap {
89
- type?: 'Tag';
89
+ type?: 'Tag' | 'Group';
90
90
  }
91
91
  export type ProEnumProps = Omit<ProEnum, 'type'> & (PropProSelectsMap | PropRadioPropsMap | CheckboxPropsMap | TagPropsMap);
92
92
  export {};
@@ -27,4 +27,53 @@
27
27
  background-color: #f5f5f5;
28
28
  pointer-events: none;
29
29
  }
30
+
31
+ &-group-root {
32
+ display: flex;
33
+ flex-direction: row;
34
+ flex-wrap: wrap;
35
+
36
+ .pro-enum-group-item {
37
+ position: relative;
38
+ display: flex;
39
+ align-items: center;
40
+ justify-content: center;
41
+ // margin-right: var(--zaui-space-size-sm);
42
+ margin-bottom: calc(var(--zaui-space-size-sm; 8px) * var(--zaui-size; 1));
43
+ padding: var(--zaui-space-size-xs) 10px;
44
+ background-color: #f5f5f5;
45
+ cursor: pointer;
46
+
47
+ .pro-enum-group-item-after {
48
+ position: absolute;
49
+ top: var(--zaui-space-size-xs);
50
+ right: 0;
51
+ bottom: var(--zaui-space-size-xs);
52
+ width: 1px;
53
+ // height: ;
54
+ background: var(--zaui-brand);
55
+ opacity: 0.7;
56
+ }
57
+
58
+ &:first-child {
59
+ border-top-left-radius: var(--zaui-space-size-xs);
60
+ border-bottom-left-radius: var(--zaui-space-size-xs);
61
+ }
62
+ &:last-child {
63
+ border-top-right-radius: var(--zaui-space-size-xs);
64
+ border-bottom-right-radius: var(--zaui-space-size-xs);
65
+ .pro-enum-group-item-after {
66
+ width: 0;
67
+ }
68
+ }
69
+ }
70
+
71
+ .pro-enum-group-item-selected {
72
+ color: var(--zaui-brand);
73
+ border: 1px solid var(--zaui-brand);
74
+ .pro-enum-group-item-after {
75
+ width: 0;
76
+ }
77
+ }
78
+ }
30
79
  }