@zat-design/sisyphus-react 3.3.3-beta.3 → 3.3.3-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.
- package/dist/index.esm.css +25 -0
- package/es/ProForm/utils/index.d.ts +4 -0
- package/es/ProForm/utils/index.js +13 -0
- package/es/ProForm/utils/useShouldUpdate.js +4 -3
- package/es/style/theme/antd.less +46 -5
- package/lib/ProForm/utils/index.d.ts +4 -0
- package/lib/ProForm/utils/index.js +14 -1
- package/lib/ProForm/utils/useShouldUpdate.js +3 -2
- package/lib/style/theme/antd.less +46 -5
- package/package.json +1 -1
package/dist/index.esm.css
CHANGED
|
@@ -5505,3 +5505,28 @@ input[type='button'] {
|
|
|
5505
5505
|
width: -moz-max-content;
|
|
5506
5506
|
width: max-content;
|
|
5507
5507
|
}
|
|
5508
|
+
.ant-tooltip > .ant-tooltip-content > .ant-tooltip-inner {
|
|
5509
|
+
color: #1d2129;
|
|
5510
|
+
background-color: #fff;
|
|
5511
|
+
-webkit-box-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
|
|
5512
|
+
box-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
|
|
5513
|
+
}
|
|
5514
|
+
.ant-tooltip > .ant-tooltip-content > .ant-tooltip-inner::-moz-selection {
|
|
5515
|
+
color: inherit !important;
|
|
5516
|
+
background: rgba(24, 144, 255, 0.3) !important;
|
|
5517
|
+
}
|
|
5518
|
+
.ant-tooltip > .ant-tooltip-content > .ant-tooltip-inner::selection {
|
|
5519
|
+
color: inherit !important;
|
|
5520
|
+
background: rgba(24, 144, 255, 0.3) !important;
|
|
5521
|
+
}
|
|
5522
|
+
.ant-tooltip > .ant-tooltip-content > .ant-tooltip-inner > div::-moz-selection {
|
|
5523
|
+
color: inherit !important;
|
|
5524
|
+
background: rgba(24, 144, 255, 0.3) !important;
|
|
5525
|
+
}
|
|
5526
|
+
.ant-tooltip > .ant-tooltip-content > .ant-tooltip-inner > div::selection {
|
|
5527
|
+
color: inherit !important;
|
|
5528
|
+
background: rgba(24, 144, 255, 0.3) !important;
|
|
5529
|
+
}
|
|
5530
|
+
.ant-tooltip > .ant-tooltip-content > .ant-tooltip-arrow > .ant-tooltip-arrow-content {
|
|
5531
|
+
--antd-arrow-background-color: linear-gradient(to right bottom, rgba(255, 255, 255, 0.95), #ffffff);
|
|
5532
|
+
}
|
|
@@ -84,4 +84,8 @@ export declare const deleteForPath: (values: any, namePath: string | number | (s
|
|
|
84
84
|
* @returns {}
|
|
85
85
|
*/
|
|
86
86
|
export declare const findOptionByValue: (treeData: any[], value: string | number) => any;
|
|
87
|
+
/**
|
|
88
|
+
* 对比依赖列表中的 值是否变更
|
|
89
|
+
*/
|
|
90
|
+
export declare const equalDependencies: (dependencies: any, prevValues: any, currentValues: any) => any;
|
|
87
91
|
export {};
|
|
@@ -407,4 +407,17 @@ export var findOptionByValue = function findOptionByValue(treeData, value) {
|
|
|
407
407
|
}
|
|
408
408
|
}
|
|
409
409
|
}
|
|
410
|
+
};
|
|
411
|
+
/**
|
|
412
|
+
* 对比依赖列表中的 值是否变更
|
|
413
|
+
*/
|
|
414
|
+
export var equalDependencies = function equalDependencies(dependencies, prevValues, currentValues) {
|
|
415
|
+
if (dependencies === null || dependencies === void 0 ? void 0 : dependencies.length) {
|
|
416
|
+
return dependencies.some(function (namePath) {
|
|
417
|
+
var prevValue = get(prevValues, namePath);
|
|
418
|
+
var currentValue = get(currentValues, namePath);
|
|
419
|
+
return prevValue !== currentValue;
|
|
420
|
+
});
|
|
421
|
+
}
|
|
422
|
+
return false;
|
|
410
423
|
};
|
|
@@ -2,7 +2,7 @@ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
3
|
import { useRef, useState } from 'react';
|
|
4
4
|
import { isFunction, isEqualWith } from 'lodash';
|
|
5
|
-
import { customEqualForFun } from './index';
|
|
5
|
+
import { customEqualForFun, equalDependencies } from './index';
|
|
6
6
|
// 代理shouldUpdate事件, 执行函数值的[show, disabled], 当[show, disabled]与上一次值不相同时更新状态
|
|
7
7
|
var useShouldUpdate = function useShouldUpdate(props) {
|
|
8
8
|
var show = props.show,
|
|
@@ -20,7 +20,8 @@ var useShouldUpdate = function useShouldUpdate(props) {
|
|
|
20
20
|
clearNotShow = formItemProps.clearNotShow,
|
|
21
21
|
index = formItemProps.index,
|
|
22
22
|
namePath = formItemProps.namePath,
|
|
23
|
-
names = formItemProps.names
|
|
23
|
+
names = formItemProps.names,
|
|
24
|
+
dependencies = formItemProps.dependencies;
|
|
24
25
|
var timerRef = useRef();
|
|
25
26
|
var showRef = useRef();
|
|
26
27
|
var disabledRef = useRef();
|
|
@@ -171,7 +172,7 @@ var useShouldUpdate = function useShouldUpdate(props) {
|
|
|
171
172
|
if (_required !== requiredRef.current || !isEqualWith(rulesRef.current, _rules, customEqualForFun)) {
|
|
172
173
|
form.validateFields([name]);
|
|
173
174
|
}
|
|
174
|
-
if (_show !== showRef.current || _disabled !== disabledRef.current || _required !== requiredRef.current || !isEqualWith(rulesRef.current, _rules, customEqualForFun) || !isEqualWith(fieldPropsRef.current, _fieldProps, customEqualForFun) || !isEqualWith(originComponentRef.current, _component, customEqualForFun)) {
|
|
175
|
+
if (_show !== showRef.current || _disabled !== disabledRef.current || _required !== requiredRef.current || !isEqualWith(rulesRef.current, _rules, customEqualForFun) || !isEqualWith(fieldPropsRef.current, _fieldProps, customEqualForFun) || !isEqualWith(originComponentRef.current, _component, customEqualForFun) || equalDependencies(dependencies, prevValues, _currentValues)) {
|
|
175
176
|
showRef.current = _show;
|
|
176
177
|
disabledRef.current = _disabled;
|
|
177
178
|
requiredRef.current = _required;
|
package/es/style/theme/antd.less
CHANGED
|
@@ -93,7 +93,8 @@
|
|
|
93
93
|
|
|
94
94
|
.@{ant-prefix}-input[disabled],
|
|
95
95
|
.@{ant-prefix}-select-disabled,
|
|
96
|
-
.@{ant-prefix}-select-disabled.@{ant-prefix}-select:not(.@{ant-prefix}-select-customize-input)
|
|
96
|
+
.@{ant-prefix}-select-disabled.@{ant-prefix}-select:not(.@{ant-prefix}-select-customize-input)
|
|
97
|
+
.@{ant-prefix}-select-selector,
|
|
97
98
|
.@{ant-prefix}-input-number-disabled,
|
|
98
99
|
.@{ant-prefix}-picker-input > input[disabled],
|
|
99
100
|
.@{ant-prefix}-select-disabled.@{ant-prefix}-select-multiple .@{ant-prefix}-select-selection-item {
|
|
@@ -218,7 +219,11 @@
|
|
|
218
219
|
.@{ant-prefix}-table tfoot > tr > td {
|
|
219
220
|
padding: calc(4px + var(--zaui-size) * 8px);
|
|
220
221
|
}
|
|
221
|
-
.@{ant-prefix}-table-tbody
|
|
222
|
+
.@{ant-prefix}-table-tbody
|
|
223
|
+
> tr
|
|
224
|
+
> td
|
|
225
|
+
> .@{ant-prefix}-table-wrapper:only-child
|
|
226
|
+
.@{ant-prefix}-table,
|
|
222
227
|
.@{ant-prefix}-table-tbody
|
|
223
228
|
> tr
|
|
224
229
|
> td
|
|
@@ -508,7 +513,8 @@
|
|
|
508
513
|
border-radius: @zaui-border-radius;
|
|
509
514
|
}
|
|
510
515
|
|
|
511
|
-
.@{ant-prefix}-select-single:not(.@{ant-prefix}-select-customize-input)
|
|
516
|
+
.@{ant-prefix}-select-single:not(.@{ant-prefix}-select-customize-input)
|
|
517
|
+
.@{ant-prefix}-select-selector {
|
|
512
518
|
.set-text-color();
|
|
513
519
|
.set-text-size();
|
|
514
520
|
width: 100%;
|
|
@@ -523,8 +529,12 @@
|
|
|
523
529
|
border-radius: @zaui-border-radius;
|
|
524
530
|
}
|
|
525
531
|
|
|
526
|
-
.@{ant-prefix}-pagination-jump-prev
|
|
527
|
-
|
|
532
|
+
.@{ant-prefix}-pagination-jump-prev
|
|
533
|
+
.@{ant-prefix}-pagination-item-container
|
|
534
|
+
.@{ant-prefix}-pagination-item-link-icon,
|
|
535
|
+
.@{ant-prefix}-pagination-jump-next
|
|
536
|
+
.@{ant-prefix}-pagination-item-container
|
|
537
|
+
.@{ant-prefix}-pagination-item-link-icon {
|
|
528
538
|
color: @zaui-brand;
|
|
529
539
|
}
|
|
530
540
|
}
|
|
@@ -705,3 +715,34 @@
|
|
|
705
715
|
.@{ant-prefix}-popover {
|
|
706
716
|
width: max-content;
|
|
707
717
|
}
|
|
718
|
+
|
|
719
|
+
// tooltip样式重载
|
|
720
|
+
.@{ant-prefix}-tooltip {
|
|
721
|
+
> .ant-tooltip-content {
|
|
722
|
+
> .ant-tooltip-inner {
|
|
723
|
+
color: rgb(29, 33, 41);
|
|
724
|
+
background-color: #fff;
|
|
725
|
+
box-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08),
|
|
726
|
+
0 9px 28px 8px rgba(0, 0, 0, 0.05);
|
|
727
|
+
&::selection {
|
|
728
|
+
color: inherit !important;
|
|
729
|
+
background: rgba(@primary-color, 0.3) !important;
|
|
730
|
+
}
|
|
731
|
+
> div {
|
|
732
|
+
&::selection {
|
|
733
|
+
color: inherit !important;
|
|
734
|
+
background: rgba(@primary-color, 0.3) !important;
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
> .ant-tooltip-arrow {
|
|
739
|
+
> .ant-tooltip-arrow-content {
|
|
740
|
+
--antd-arrow-background-color: linear-gradient(
|
|
741
|
+
to right bottom,
|
|
742
|
+
rgba(255, 255, 255, 0.95),
|
|
743
|
+
rgba(255, 255, 255, 1)
|
|
744
|
+
);
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
}
|
|
@@ -84,4 +84,8 @@ export declare const deleteForPath: (values: any, namePath: string | number | (s
|
|
|
84
84
|
* @returns {}
|
|
85
85
|
*/
|
|
86
86
|
export declare const findOptionByValue: (treeData: any[], value: string | number) => any;
|
|
87
|
+
/**
|
|
88
|
+
* 对比依赖列表中的 值是否变更
|
|
89
|
+
*/
|
|
90
|
+
export declare const equalDependencies: (dependencies: any, prevValues: any, currentValues: any) => any;
|
|
87
91
|
export {};
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.getAllNamePath = exports.findOptionByValue = exports.filterInternalFields = exports.deleteForPath = exports.customEqualForFun = exports.contrast = void 0;
|
|
8
|
+
exports.getAllNamePath = exports.findOptionByValue = exports.filterInternalFields = exports.equalDependencies = exports.deleteForPath = exports.customEqualForFun = exports.contrast = void 0;
|
|
9
9
|
exports.getArrayBeforeNumber = getArrayBeforeNumber;
|
|
10
10
|
exports.hasRowKey = exports.getLayout = exports.getDecimalDigits = void 0;
|
|
11
11
|
exports.initialValuesToNames = initialValuesToNames;
|
|
@@ -423,4 +423,17 @@ var findOptionByValue = exports.findOptionByValue = function findOptionByValue(t
|
|
|
423
423
|
}
|
|
424
424
|
}
|
|
425
425
|
}
|
|
426
|
+
};
|
|
427
|
+
/**
|
|
428
|
+
* 对比依赖列表中的 值是否变更
|
|
429
|
+
*/
|
|
430
|
+
var equalDependencies = exports.equalDependencies = function equalDependencies(dependencies, prevValues, currentValues) {
|
|
431
|
+
if (dependencies === null || dependencies === void 0 ? void 0 : dependencies.length) {
|
|
432
|
+
return dependencies.some(function (namePath) {
|
|
433
|
+
var prevValue = (0, _lodash.get)(prevValues, namePath);
|
|
434
|
+
var currentValue = (0, _lodash.get)(currentValues, namePath);
|
|
435
|
+
return prevValue !== currentValue;
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
return false;
|
|
426
439
|
};
|
|
@@ -27,7 +27,8 @@ var useShouldUpdate = function useShouldUpdate(props) {
|
|
|
27
27
|
clearNotShow = formItemProps.clearNotShow,
|
|
28
28
|
index = formItemProps.index,
|
|
29
29
|
namePath = formItemProps.namePath,
|
|
30
|
-
names = formItemProps.names
|
|
30
|
+
names = formItemProps.names,
|
|
31
|
+
dependencies = formItemProps.dependencies;
|
|
31
32
|
var timerRef = (0, _react.useRef)();
|
|
32
33
|
var showRef = (0, _react.useRef)();
|
|
33
34
|
var disabledRef = (0, _react.useRef)();
|
|
@@ -178,7 +179,7 @@ var useShouldUpdate = function useShouldUpdate(props) {
|
|
|
178
179
|
if (_required !== requiredRef.current || !(0, _lodash.isEqualWith)(rulesRef.current, _rules, _index.customEqualForFun)) {
|
|
179
180
|
form.validateFields([name]);
|
|
180
181
|
}
|
|
181
|
-
if (_show !== showRef.current || _disabled !== disabledRef.current || _required !== requiredRef.current || !(0, _lodash.isEqualWith)(rulesRef.current, _rules, _index.customEqualForFun) || !(0, _lodash.isEqualWith)(fieldPropsRef.current, _fieldProps, _index.customEqualForFun) || !(0, _lodash.isEqualWith)(originComponentRef.current, _component, _index.customEqualForFun)) {
|
|
182
|
+
if (_show !== showRef.current || _disabled !== disabledRef.current || _required !== requiredRef.current || !(0, _lodash.isEqualWith)(rulesRef.current, _rules, _index.customEqualForFun) || !(0, _lodash.isEqualWith)(fieldPropsRef.current, _fieldProps, _index.customEqualForFun) || !(0, _lodash.isEqualWith)(originComponentRef.current, _component, _index.customEqualForFun) || (0, _index.equalDependencies)(dependencies, prevValues, _currentValues)) {
|
|
182
183
|
showRef.current = _show;
|
|
183
184
|
disabledRef.current = _disabled;
|
|
184
185
|
requiredRef.current = _required;
|
|
@@ -93,7 +93,8 @@
|
|
|
93
93
|
|
|
94
94
|
.@{ant-prefix}-input[disabled],
|
|
95
95
|
.@{ant-prefix}-select-disabled,
|
|
96
|
-
.@{ant-prefix}-select-disabled.@{ant-prefix}-select:not(.@{ant-prefix}-select-customize-input)
|
|
96
|
+
.@{ant-prefix}-select-disabled.@{ant-prefix}-select:not(.@{ant-prefix}-select-customize-input)
|
|
97
|
+
.@{ant-prefix}-select-selector,
|
|
97
98
|
.@{ant-prefix}-input-number-disabled,
|
|
98
99
|
.@{ant-prefix}-picker-input > input[disabled],
|
|
99
100
|
.@{ant-prefix}-select-disabled.@{ant-prefix}-select-multiple .@{ant-prefix}-select-selection-item {
|
|
@@ -218,7 +219,11 @@
|
|
|
218
219
|
.@{ant-prefix}-table tfoot > tr > td {
|
|
219
220
|
padding: calc(4px + var(--zaui-size) * 8px);
|
|
220
221
|
}
|
|
221
|
-
.@{ant-prefix}-table-tbody
|
|
222
|
+
.@{ant-prefix}-table-tbody
|
|
223
|
+
> tr
|
|
224
|
+
> td
|
|
225
|
+
> .@{ant-prefix}-table-wrapper:only-child
|
|
226
|
+
.@{ant-prefix}-table,
|
|
222
227
|
.@{ant-prefix}-table-tbody
|
|
223
228
|
> tr
|
|
224
229
|
> td
|
|
@@ -508,7 +513,8 @@
|
|
|
508
513
|
border-radius: @zaui-border-radius;
|
|
509
514
|
}
|
|
510
515
|
|
|
511
|
-
.@{ant-prefix}-select-single:not(.@{ant-prefix}-select-customize-input)
|
|
516
|
+
.@{ant-prefix}-select-single:not(.@{ant-prefix}-select-customize-input)
|
|
517
|
+
.@{ant-prefix}-select-selector {
|
|
512
518
|
.set-text-color();
|
|
513
519
|
.set-text-size();
|
|
514
520
|
width: 100%;
|
|
@@ -523,8 +529,12 @@
|
|
|
523
529
|
border-radius: @zaui-border-radius;
|
|
524
530
|
}
|
|
525
531
|
|
|
526
|
-
.@{ant-prefix}-pagination-jump-prev
|
|
527
|
-
|
|
532
|
+
.@{ant-prefix}-pagination-jump-prev
|
|
533
|
+
.@{ant-prefix}-pagination-item-container
|
|
534
|
+
.@{ant-prefix}-pagination-item-link-icon,
|
|
535
|
+
.@{ant-prefix}-pagination-jump-next
|
|
536
|
+
.@{ant-prefix}-pagination-item-container
|
|
537
|
+
.@{ant-prefix}-pagination-item-link-icon {
|
|
528
538
|
color: @zaui-brand;
|
|
529
539
|
}
|
|
530
540
|
}
|
|
@@ -705,3 +715,34 @@
|
|
|
705
715
|
.@{ant-prefix}-popover {
|
|
706
716
|
width: max-content;
|
|
707
717
|
}
|
|
718
|
+
|
|
719
|
+
// tooltip样式重载
|
|
720
|
+
.@{ant-prefix}-tooltip {
|
|
721
|
+
> .ant-tooltip-content {
|
|
722
|
+
> .ant-tooltip-inner {
|
|
723
|
+
color: rgb(29, 33, 41);
|
|
724
|
+
background-color: #fff;
|
|
725
|
+
box-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08),
|
|
726
|
+
0 9px 28px 8px rgba(0, 0, 0, 0.05);
|
|
727
|
+
&::selection {
|
|
728
|
+
color: inherit !important;
|
|
729
|
+
background: rgba(@primary-color, 0.3) !important;
|
|
730
|
+
}
|
|
731
|
+
> div {
|
|
732
|
+
&::selection {
|
|
733
|
+
color: inherit !important;
|
|
734
|
+
background: rgba(@primary-color, 0.3) !important;
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
> .ant-tooltip-arrow {
|
|
739
|
+
> .ant-tooltip-arrow-content {
|
|
740
|
+
--antd-arrow-background-color: linear-gradient(
|
|
741
|
+
to right bottom,
|
|
742
|
+
rgba(255, 255, 255, 0.95),
|
|
743
|
+
rgba(255, 255, 255, 1)
|
|
744
|
+
);
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
}
|