@zat-design/sisyphus-react 3.3.3-beta.2 → 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.
@@ -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 {};
@@ -139,17 +139,17 @@ export var filterInternalFields = function filterInternalFields(values) {
139
139
  return nextValues;
140
140
  }
141
141
  if (Array.isArray(nextValues)) {
142
- nextValues.forEach(function (item) {
143
- filterInternalFields(item);
142
+ return nextValues.map(function (item) {
143
+ return filterInternalFields(item);
144
144
  });
145
145
  }
146
146
  if (isObject(nextValues)) {
147
+ var result = {};
147
148
  Object.keys(nextValues).forEach(function (key) {
148
- if (key.includes('-')) {
149
- delete nextValues[key];
150
- }
151
- filterInternalFields(nextValues[key]);
149
+ if (key.includes('-')) return;
150
+ result[key] = filterInternalFields(nextValues[key]);
152
151
  });
152
+ return result;
153
153
  }
154
154
  return nextValues;
155
155
  };
@@ -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
  };
@@ -12,13 +12,12 @@ export var useForm = function useForm(originForm) {
12
12
  validateFields = form.validateFields;
13
13
  // @ts-ignore
14
14
  var _getFieldsValue = function _getFieldsValue(nameList, filterFunc) {
15
- var _nameList = Array.isArray(nameList) ? nameList : true;
16
15
  // 全部查询
17
- if (_nameList === true) {
16
+ if (nameList !== true) {
18
17
  var values = getFieldsValue(true, filterFunc);
19
18
  return filterInternalFields(values);
20
19
  }
21
- return getFieldsValue(_nameList, filterFunc);
20
+ return getFieldsValue(nameList, filterFunc);
22
21
  };
23
22
  var _validateFields = /*#__PURE__*/function () {
24
23
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(nameList) {
@@ -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;
@@ -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) .@{ant-prefix}-select-selector,
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 > tr > td > .@{ant-prefix}-table-wrapper:only-child .@{ant-prefix}-table,
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) .@{ant-prefix}-select-selector {
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 .@{ant-prefix}-pagination-item-container .@{ant-prefix}-pagination-item-link-icon,
527
- .@{ant-prefix}-pagination-jump-next .@{ant-prefix}-pagination-item-container .@{ant-prefix}-pagination-item-link-icon {
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;
@@ -155,17 +155,17 @@ var filterInternalFields = exports.filterInternalFields = function filterInterna
155
155
  return nextValues;
156
156
  }
157
157
  if (Array.isArray(nextValues)) {
158
- nextValues.forEach(function (item) {
159
- filterInternalFields(item);
158
+ return nextValues.map(function (item) {
159
+ return filterInternalFields(item);
160
160
  });
161
161
  }
162
162
  if ((0, _lodash.isObject)(nextValues)) {
163
+ var result = {};
163
164
  Object.keys(nextValues).forEach(function (key) {
164
- if (key.includes('-')) {
165
- delete nextValues[key];
166
- }
167
- filterInternalFields(nextValues[key]);
165
+ if (key.includes('-')) return;
166
+ result[key] = filterInternalFields(nextValues[key]);
168
167
  });
168
+ return result;
169
169
  }
170
170
  return nextValues;
171
171
  };
@@ -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
  };
@@ -18,13 +18,12 @@ var useForm = exports.useForm = function useForm(originForm) {
18
18
  validateFields = form.validateFields;
19
19
  // @ts-ignore
20
20
  var _getFieldsValue = function _getFieldsValue(nameList, filterFunc) {
21
- var _nameList = Array.isArray(nameList) ? nameList : true;
22
21
  // 全部查询
23
- if (_nameList === true) {
22
+ if (nameList !== true) {
24
23
  var values = getFieldsValue(true, filterFunc);
25
24
  return (0, _index.filterInternalFields)(values);
26
25
  }
27
- return getFieldsValue(_nameList, filterFunc);
26
+ return getFieldsValue(nameList, filterFunc);
28
27
  };
29
28
  var _validateFields = /*#__PURE__*/function () {
30
29
  var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(nameList) {
@@ -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) .@{ant-prefix}-select-selector,
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 > tr > td > .@{ant-prefix}-table-wrapper:only-child .@{ant-prefix}-table,
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) .@{ant-prefix}-select-selector {
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 .@{ant-prefix}-pagination-item-container .@{ant-prefix}-pagination-item-link-icon,
527
- .@{ant-prefix}-pagination-jump-next .@{ant-prefix}-pagination-item-container .@{ant-prefix}-pagination-item-link-icon {
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
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zat-design/sisyphus-react",
3
- "version": "3.3.3-beta.2",
3
+ "version": "3.3.3-beta.4",
4
4
  "license": "Apache-2.0",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",