@zat-design/sisyphus-react 4.6.1-beta.2 → 4.6.1-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.
@@ -138,7 +138,8 @@ const RenderField = ({ text: value, record, index, column, config }) => {
138
138
  lastFieldProps = dynamicProps.fieldProps ?? fieldProps(rowData, reactiveParams);
139
139
  }
140
140
  if (isFunction(rules)) {
141
- lastRules = dynamicProps.rules ?? rules(rowData, reactiveParams);
141
+ const canReuseDynamicRules = isRecordShallowEqual(dynamicProps.rowSnapshot, rowData);
142
+ lastRules = canReuseDynamicRules ? dynamicProps.rules ?? rules(rowData, reactiveParams) : rules(rowData, reactiveParams);
142
143
  }
143
144
  if (isFunction(valueType)) {
144
145
  lastValueType = dynamicProps.valueType ?? valueType(currentValue, rowData, {
@@ -43,8 +43,9 @@ const useShouldUpdateForTable = (props) => {
43
43
  }
44
44
  if (isFunction(column.rules)) {
45
45
  const newRules = column.rules(values, reactiveParams);
46
- if (!isEqualWith(rulesRef.current, newRules, customEqualForFunction)) {
47
- rulesRef.current = newRules;
46
+ const rulesChanged = !isEqualWith(rulesRef.current, newRules, customEqualForFunction);
47
+ rulesRef.current = newRules;
48
+ if (rulesChanged) {
48
49
  hasChange = true;
49
50
  }
50
51
  } else {
@@ -30,7 +30,8 @@ const LineFields = (props) => {
30
30
  className,
31
31
  id,
32
32
  diffConfig,
33
- hideStartEndActionProps
33
+ hideStartEndActionProps,
34
+ actionAlign
34
35
  } = props;
35
36
  const isLess = mode === "less";
36
37
  const {
@@ -48,6 +49,7 @@ const LineFields = (props) => {
48
49
  const classnames = classNames({
49
50
  "pro-form-list": true,
50
51
  "pro-form-list-line": mode === "line",
52
+ [`pro-form-list-action-${actionAlign}`]: !!actionAlign,
51
53
  [className]: !!className
52
54
  });
53
55
  const style = {
@@ -66,7 +68,7 @@ const LineFields = (props) => {
66
68
  children: /* @__PURE__ */ jsx(ProIcon, { component: dragSvg, size: 20, color: "#949599" })
67
69
  }
68
70
  ),
69
- /* @__PURE__ */ jsx(Row, { gutter: isLess ? 0 : 24, children: /* @__PURE__ */ jsx(
71
+ /* @__PURE__ */ jsx(Row, { className: "pro-form-list-fields", gutter: isLess ? 0 : 24, children: /* @__PURE__ */ jsx(
70
72
  MemoRenderFields,
71
73
  {
72
74
  columns,
@@ -62,6 +62,7 @@ export interface FormListType {
62
62
  emptyBtnText?: string;
63
63
  hideStartEndActionProps?: [boolean, boolean];
64
64
  titlePosition?: 'top' | 'left';
65
+ actionAlign?: 'top' | 'center' | 'bottom';
65
66
  className?: string;
66
67
  }
67
68
  export type TypeWithRef = FormListType & React.RefAttributes<FormListRefType>;
@@ -52,6 +52,11 @@
52
52
  padding-right: @zaui-space-size-sm;
53
53
  border: none;
54
54
  }
55
+
56
+ > .pro-form-list-fields {
57
+ flex: 1;
58
+ min-width: 0;
59
+ }
55
60
  }
56
61
 
57
62
  .pro-form-list-line {
@@ -63,6 +68,18 @@
63
68
  }
64
69
  }
65
70
 
71
+ .pro-form-list-action-top > .pro-form-list-action {
72
+ align-self: flex-start;
73
+ }
74
+
75
+ .pro-form-list-action-center > .pro-form-list-action {
76
+ align-self: center;
77
+ }
78
+
79
+ .pro-form-list-action-bottom > .pro-form-list-action {
80
+ align-self: flex-end;
81
+ }
82
+
66
83
  .pro-form-list-toolbar,
67
84
  .pro-form-list-action {
68
85
  .@{ant-prefix}-btn-link {
@@ -11,6 +11,18 @@
11
11
  @import '../components/combination/Container/style/index.less';
12
12
 
13
13
  .pro-form {
14
+ // 跟随表单父节点渲染的浮层会受祖先堆叠上下文限制;仅在浮层打开时提升相关层级。
15
+ .@{ant-prefix}-form-item,
16
+ .@{ant-prefix}-space-compact-item,
17
+ .pro-group {
18
+ &:has(.pro-select-popup-open),
19
+ &:has(.@{ant-prefix}-select-open),
20
+ &:has(.@{ant-prefix}-picker-focused) {
21
+ position: relative;
22
+ z-index: 4 !important;
23
+ }
24
+ }
25
+
14
26
  .pro-container {
15
27
  .pro-collapse {
16
28
  .pro-collapse-panel {
@@ -36,6 +36,14 @@
36
36
  border-radius: 8px !important;
37
37
  }
38
38
 
39
+ .@{ant-prefix}-collapse-item-active {
40
+ &.pro-collapse-panel {
41
+ & > .@{ant-prefix}-collapse-header {
42
+ border-radius: var(--zaui-border-radius, 8px) var(--zaui-border-radius, 8px) 0 0 !important;
43
+ }
44
+ }
45
+ }
46
+
39
47
  .@{ant-prefix}-collapse-title {
40
48
  color: var(--zaui-text, #343434);
41
49
  font-weight: 500;
@@ -62,6 +70,7 @@
62
70
  padding-bottom: 0;
63
71
  background: var(--zaui-base-bg, #ffffff);
64
72
  border: 1px solid #ebecee;
73
+ border-radius: 0 0 var(--zaui-border-radius, 8px) var(--zaui-border-radius, 8px);
65
74
  }
66
75
  }
67
76
 
@@ -9,10 +9,10 @@
9
9
  .pro-select {
10
10
  width: 100%;
11
11
 
12
- // Ant Design Compact 控件的交互层级为 2;弹层打开时临时提升当前选择框。
12
+ // 高于 Ant Design Table 固定列的 z-index: 3,且仅在弹层打开时生效。
13
13
  &.pro-select-popup-open {
14
14
  position: relative;
15
- z-index: 3;
15
+ z-index: 4;
16
16
  }
17
17
 
18
18
  > .ant-select {
@@ -29,5 +29,5 @@
29
29
  // scrollFollowParent 会让弹层受祖先堆叠上下文约束,需要同步提升嵌套 Form.Item。
30
30
  .ant-form-item:has(.pro-select-popup-open) {
31
31
  position: relative;
32
- z-index: 3 !important;
32
+ z-index: 4 !important;
33
33
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zat-design/sisyphus-react",
3
- "version": "4.6.1-beta.2",
3
+ "version": "4.6.1-beta.4",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public",