@kdcloudjs/kdesign 1.7.53 → 1.7.55

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.
@@ -250,7 +250,6 @@
250
250
  }
251
251
  .kd-city-picker-dropdown {
252
252
  display: block;
253
- left: 0;
254
253
  z-index: var(--kd-c-city-picker-z-index, var(--kd-g-z-index-popper, 1050));
255
254
  -webkit-box-sizing: border-box;
256
255
  box-sizing: border-box;
@@ -142,7 +142,6 @@
142
142
 
143
143
  &-dropdown {
144
144
  display: block;
145
- left: 0;
146
145
  z-index: @city-picker-z-index;
147
146
  box-sizing: border-box;
148
147
  margin: 0;
package/es/grid/col.js CHANGED
@@ -41,12 +41,23 @@ var Col = function Col(props) {
41
41
  var rowGroup = useContext(GapContext);
42
42
  var mergedWinWidth = rowGroup.winWidth;
43
43
  var gap = rowGroup.gap;
44
- // 浏览器名称
45
- var isSogouOrIE = testBrowserType(/^sogou/i, 0) || /Trident|MSIE/.test(navigator.userAgent);
44
+ // 判断当前浏览器是否支持row-gap,如果不支持则使用margin负值模拟
45
+ var notSupportRowGap = function notSupportRowGap() {
46
+ // 判断是否是搜狗浏览器
47
+ if (testBrowserType(/^sogou/i, 0)) return true;
48
+ // 判断是否是IE浏览器
49
+ if (/Trident|MSIE/.test(navigator.userAgent)) return true;
50
+ // 判断是否是chrome浏览器,chrome浏览器版本号小于69
51
+ if (/Chrome/.test(navigator.userAgent) && !/Chromium/.test(navigator.userAgent)) {
52
+ var version = navigator.userAgent.split('Chrome/')[1].split('.');
53
+ if (version[0] && parseInt(version[0]) <= 69) return true;
54
+ }
55
+ return false;
56
+ };
46
57
  var colGapStyle = {
47
58
  padding: "0 ".concat(gap.h / 2, "px")
48
59
  };
49
- if (isSogouOrIE && gap.v) colGapStyle.marginBottom = gap.v;
60
+ if (notSupportRowGap() && gap.v) colGapStyle.marginBottom = gap.v;
50
61
  // className前缀
51
62
  var prefixCls = getPrefixCls(pkgPrefixCls, 'col', customPrefixcls);
52
63
  var columns = 24;
package/es/grid/row.js CHANGED
@@ -42,8 +42,19 @@ var Row = function Row(props) {
42
42
  align = _getCompProps.align,
43
43
  justify = _getCompProps.justify,
44
44
  customPrefixcls = _getCompProps.prefixCls;
45
- // 浏览器名称
46
- var isSogouOrIe = testBrowserType(/^sogou/i, 0) || /Trident|MSIE/.test(navigator.userAgent);
45
+ // 判断当前浏览器是否支持row-gap,如果不支持则使用margin负值模拟
46
+ var notSupportRowGap = function notSupportRowGap() {
47
+ // 判断是否是搜狗浏览器
48
+ if (testBrowserType(/^sogou/i, 0)) return true;
49
+ // 判断是否是IE浏览器
50
+ if (/Trident|MSIE/.test(navigator.userAgent)) return true;
51
+ // 判断是否是chrome浏览器,chrome浏览器版本号小于69
52
+ if (/Chrome/.test(navigator.userAgent) && !/Chromium/.test(navigator.userAgent)) {
53
+ var version = navigator.userAgent.split('Chrome/')[1].split('.');
54
+ if (version[0] && parseInt(version[0]) <= 69) return true;
55
+ }
56
+ return false;
57
+ };
47
58
  // className前缀
48
59
  var prefixCls = getPrefixCls(pkgPrefixCls, 'row', customPrefixcls);
49
60
  var _React$useState = React.useState(window.innerWidth),
@@ -78,7 +89,7 @@ var Row = function Row(props) {
78
89
  rowGap: "".concat(gap.v, "px"),
79
90
  margin: "0 ".concat(-1 * gap.h / 2, "px")
80
91
  };
81
- if (gap.v && isSogouOrIe) rowStyle.marginBottom = "".concat(-1 * gap.v, "px");
92
+ if (gap.v && notSupportRowGap()) rowStyle.marginBottom = "".concat(-1 * gap.v, "px");
82
93
  var toalign = {
83
94
  top: 'flex-start',
84
95
  middle: 'center',
@@ -56,11 +56,11 @@ var ClearableInput = function ClearableInput(props) {
56
56
  return null;
57
57
  }
58
58
  var needClear = !disabled && value && isMouseEnter;
59
- var clearIconclasses = classNames((_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-textarea-clear-icon"), inputType === ClearableInputType[1]), _defineProperty(_classNames, "".concat(prefixCls, "-clear-icon"), inputType === ClearableInputType[0]), _defineProperty(_classNames, "".concat(prefixCls, "-clear-icon-hidden"), !needClear), _defineProperty(_classNames, "".concat(prefixCls, "-clear-icon-rightSpace"), suffix), _classNames));
59
+ var clearIconCls = classNames((_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-textarea-clear-icon"), inputType === ClearableInputType[1]), _defineProperty(_classNames, "".concat(prefixCls, "-clear-icon"), inputType === ClearableInputType[0]), _defineProperty(_classNames, "".concat(prefixCls, "-clear-icon-hidden"), !needClear), _defineProperty(_classNames, "".concat(prefixCls, "-clear-icon-rightSpace"), suffix), _classNames));
60
60
  return /*#__PURE__*/React.createElement("span", {
61
61
  onMouseDown: mouseDownHandle,
62
62
  onClick: handleReset,
63
- className: clearIconclasses
63
+ className: clearIconCls
64
64
  }, typeof allowClear === 'boolean' ? /*#__PURE__*/React.createElement(Icon, {
65
65
  type: "close-solid"
66
66
  }) : allowClear);
@@ -9,6 +9,7 @@ import classNames from 'classnames';
9
9
  import { getCompProps } from '../_utils';
10
10
  import { tuple } from '../_utils/type';
11
11
  import devWarning from '../_utils/devwarning';
12
+ import ResizeObserver from 'resize-observer-polyfill';
12
13
  export var SplitPanelModes = tuple('horizontal', 'vertical');
13
14
  function pxToScale(numerator, denominator) {
14
15
  var percent = parseFloat(numerator) / parseFloat(denominator);
@@ -118,6 +119,21 @@ var SplitPanel = function SplitPanel(props) {
118
119
  }, [min, max, defaultSplit, getComputedThresholdValue, getComputeOffset]);
119
120
  useEffect(function () {
120
121
  initPanel();
122
+ var element = outerWrapper.current;
123
+ if (!element) {
124
+ devWarning(!element && element !== null, 'useResizeMeasure', 'useResizeMeasure指定的元素不存在');
125
+ return;
126
+ }
127
+ var resizeObserver = new ResizeObserver(function (entries) {
128
+ var entry = entries[0];
129
+ if (entry.contentRect) {
130
+ initPanel();
131
+ }
132
+ });
133
+ resizeObserver.observe(element);
134
+ return function () {
135
+ resizeObserver.disconnect();
136
+ };
121
137
  }, [initPanel]);
122
138
  var handleMove = useCallback(function (e) {
123
139
  // 将鼠标移动距离与offset进行处理
@@ -250,7 +250,6 @@
250
250
  }
251
251
  .kd-city-picker-dropdown {
252
252
  display: block;
253
- left: 0;
254
253
  z-index: var(--kd-c-city-picker-z-index, var(--kd-g-z-index-popper, 1050));
255
254
  -webkit-box-sizing: border-box;
256
255
  box-sizing: border-box;
@@ -142,7 +142,6 @@
142
142
 
143
143
  &-dropdown {
144
144
  display: block;
145
- left: 0;
146
145
  z-index: @city-picker-z-index;
147
146
  box-sizing: border-box;
148
147
  margin: 0;
package/lib/grid/col.js CHANGED
@@ -53,12 +53,23 @@ var Col = function Col(props) {
53
53
  var rowGroup = (0, _react.useContext)(_row.GapContext);
54
54
  var mergedWinWidth = rowGroup.winWidth;
55
55
  var gap = rowGroup.gap;
56
- // 浏览器名称
57
- var isSogouOrIE = (0, _testBrowserType.testBrowserType)(/^sogou/i, 0) || /Trident|MSIE/.test(navigator.userAgent);
56
+ // 判断当前浏览器是否支持row-gap,如果不支持则使用margin负值模拟
57
+ var notSupportRowGap = function notSupportRowGap() {
58
+ // 判断是否是搜狗浏览器
59
+ if ((0, _testBrowserType.testBrowserType)(/^sogou/i, 0)) return true;
60
+ // 判断是否是IE浏览器
61
+ if (/Trident|MSIE/.test(navigator.userAgent)) return true;
62
+ // 判断是否是chrome浏览器,chrome浏览器版本号小于69
63
+ if (/Chrome/.test(navigator.userAgent) && !/Chromium/.test(navigator.userAgent)) {
64
+ var version = navigator.userAgent.split('Chrome/')[1].split('.');
65
+ if (version[0] && parseInt(version[0]) <= 69) return true;
66
+ }
67
+ return false;
68
+ };
58
69
  var colGapStyle = {
59
70
  padding: "0 ".concat(gap.h / 2, "px")
60
71
  };
61
- if (isSogouOrIE && gap.v) colGapStyle.marginBottom = gap.v;
72
+ if (notSupportRowGap() && gap.v) colGapStyle.marginBottom = gap.v;
62
73
  // className前缀
63
74
  var prefixCls = getPrefixCls(pkgPrefixCls, 'col', customPrefixcls);
64
75
  var columns = 24;
package/lib/grid/row.js CHANGED
@@ -55,8 +55,19 @@ var Row = function Row(props) {
55
55
  align = _getCompProps.align,
56
56
  justify = _getCompProps.justify,
57
57
  customPrefixcls = _getCompProps.prefixCls;
58
- // 浏览器名称
59
- var isSogouOrIe = (0, _testBrowserType.testBrowserType)(/^sogou/i, 0) || /Trident|MSIE/.test(navigator.userAgent);
58
+ // 判断当前浏览器是否支持row-gap,如果不支持则使用margin负值模拟
59
+ var notSupportRowGap = function notSupportRowGap() {
60
+ // 判断是否是搜狗浏览器
61
+ if ((0, _testBrowserType.testBrowserType)(/^sogou/i, 0)) return true;
62
+ // 判断是否是IE浏览器
63
+ if (/Trident|MSIE/.test(navigator.userAgent)) return true;
64
+ // 判断是否是chrome浏览器,chrome浏览器版本号小于69
65
+ if (/Chrome/.test(navigator.userAgent) && !/Chromium/.test(navigator.userAgent)) {
66
+ var version = navigator.userAgent.split('Chrome/')[1].split('.');
67
+ if (version[0] && parseInt(version[0]) <= 69) return true;
68
+ }
69
+ return false;
70
+ };
60
71
  // className前缀
61
72
  var prefixCls = getPrefixCls(pkgPrefixCls, 'row', customPrefixcls);
62
73
  var _React$useState = _react.default.useState(window.innerWidth),
@@ -91,7 +102,7 @@ var Row = function Row(props) {
91
102
  rowGap: "".concat(gap.v, "px"),
92
103
  margin: "0 ".concat(-1 * gap.h / 2, "px")
93
104
  };
94
- if (gap.v && isSogouOrIe) rowStyle.marginBottom = "".concat(-1 * gap.v, "px");
105
+ if (gap.v && notSupportRowGap()) rowStyle.marginBottom = "".concat(-1 * gap.v, "px");
95
106
  var toalign = {
96
107
  top: 'flex-start',
97
108
  middle: 'center',
@@ -69,11 +69,11 @@ var ClearableInput = function ClearableInput(props) {
69
69
  return null;
70
70
  }
71
71
  var needClear = !disabled && value && isMouseEnter;
72
- var clearIconclasses = (0, _classnames.default)((_classNames = {}, (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-textarea-clear-icon"), inputType === ClearableInputType[1]), (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-clear-icon"), inputType === ClearableInputType[0]), (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-clear-icon-hidden"), !needClear), (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-clear-icon-rightSpace"), suffix), _classNames));
72
+ var clearIconCls = (0, _classnames.default)((_classNames = {}, (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-textarea-clear-icon"), inputType === ClearableInputType[1]), (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-clear-icon"), inputType === ClearableInputType[0]), (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-clear-icon-hidden"), !needClear), (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-clear-icon-rightSpace"), suffix), _classNames));
73
73
  return /*#__PURE__*/_react.default.createElement("span", {
74
74
  onMouseDown: mouseDownHandle,
75
75
  onClick: handleReset,
76
- className: clearIconclasses
76
+ className: clearIconCls
77
77
  }, typeof allowClear === 'boolean' ? /*#__PURE__*/_react.default.createElement(_index.Icon, {
78
78
  type: "close-solid"
79
79
  }) : allowClear);
@@ -19,6 +19,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
19
19
  var _utils = require("../_utils");
20
20
  var _type = require("../_utils/type");
21
21
  var _devwarning = _interopRequireDefault(require("../_utils/devwarning"));
22
+ var _resizeObserverPolyfill = _interopRequireDefault(require("resize-observer-polyfill"));
22
23
  function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
23
24
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
24
25
  var SplitPanelModes = (0, _type.tuple)('horizontal', 'vertical');
@@ -131,6 +132,21 @@ var SplitPanel = function SplitPanel(props) {
131
132
  }, [min, max, defaultSplit, getComputedThresholdValue, getComputeOffset]);
132
133
  (0, _react.useEffect)(function () {
133
134
  initPanel();
135
+ var element = outerWrapper.current;
136
+ if (!element) {
137
+ (0, _devwarning.default)(!element && element !== null, 'useResizeMeasure', 'useResizeMeasure指定的元素不存在');
138
+ return;
139
+ }
140
+ var resizeObserver = new _resizeObserverPolyfill.default(function (entries) {
141
+ var entry = entries[0];
142
+ if (entry.contentRect) {
143
+ initPanel();
144
+ }
145
+ });
146
+ resizeObserver.observe(element);
147
+ return function () {
148
+ resizeObserver.disconnect();
149
+ };
134
150
  }, [initPanel]);
135
151
  var handleMove = (0, _react.useCallback)(function (e) {
136
152
  // 将鼠标移动距离与offset进行处理
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kdcloudjs/kdesign",
3
- "version": "1.7.53",
3
+ "version": "1.7.55",
4
4
  "description": "KDesign 金蝶前端react 组件库",
5
5
  "title": "kdesign",
6
6
  "keywords": [