@zat-design/sisyphus-react 3.4.12-beta.11 → 3.4.12-beta.12

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.
@@ -62,7 +62,7 @@ export var ProSelect = function ProSelect(props, ref) {
62
62
  _useState2 = _slicedToArray(_useState, 2),
63
63
  viewFlag = _useState2[0],
64
64
  setViewFlag = _useState2[1];
65
- var refSelect = useRef(null);
65
+ var refSelect = useRef();
66
66
  var _useInViewport = useInViewport(refSelect),
67
67
  _useInViewport2 = _slicedToArray(_useInViewport, 1),
68
68
  inViewport = _useInViewport2[0];
@@ -299,48 +299,45 @@ export var ProSelect = function ProSelect(props, ref) {
299
299
  fieldNames: fieldNames
300
300
  });
301
301
  }
302
- return _jsx("div", {
303
- ref: refSelect,
304
- children: _jsx(_Select, _objectSpread(_objectSpread({
305
- placeholder: locale === null || locale === void 0 ? void 0 : (_locale$ProSelect = locale.ProSelect) === null || _locale$ProSelect === void 0 ? void 0 : _locale$ProSelect.select,
306
- allowClear: true,
307
- showArrow: true,
308
- loading: fetchFunction === null || fetchFunction === void 0 ? void 0 : fetchFunction.loading,
309
- onChange: handleChange,
310
- optionLabelProp: "children" // 解决warning报错,添加默认值
311
- ,
312
- showSearch: true,
313
- filterOption: isFunction(_onSearch) ? false : function (input, option) {
314
- var _option$children, _option$children$prop;
315
- var value = isString(option === null || option === void 0 ? void 0 : option.children) ? option === null || option === void 0 ? void 0 : option.children : option === null || option === void 0 ? void 0 : (_option$children = option.children) === null || _option$children === void 0 ? void 0 : (_option$children$prop = _option$children.props) === null || _option$children$prop === void 0 ? void 0 : _option$children$prop.title;
316
- return value.toLowerCase().includes(input.toLowerCase());
317
- },
318
- onSearch: function onSearch(value) {
319
- _onSearch && _onSearch(value, _objectSpread({}, fetchFunction));
320
- },
321
- getPopupContainer: function getPopupContainer(trigger) {
322
- return scrollFollowParent ? trigger.parentElement : document.body;
323
- }
324
- }, omit(cloneDeep(selectProps), ['isView', 'showCodeName', 'form', 'name'])), {}, {
325
- value: transformValue(),
326
- children: Array.isArray(newSelectList) && newSelectList.map(function (item) {
327
- return _jsx(Option, {
328
- value: item[code],
329
- record: item,
330
- disabled: !!item.disabled,
331
- children: _jsx(TooltipOption, {
332
- title: OptionRender ? OptionRender(item) : selectProps.showCodeName ? "".concat(item[code], "-").concat(item[label]) : item[label],
333
- children: OptionRender ? _jsx("span", {
334
- title: OptionRender(item),
335
- children: OptionRender(item)
336
- }) : _jsx("span", {
337
- title: "".concat(item[code], "-").concat(item[label]),
338
- children: selectProps.showCodeName ? "".concat(item[code], "-").concat(item[label]) : item[label]
339
- })
340
- }, item[code])
341
- }, item[code]);
342
- })
343
- }))
344
- });
302
+ return _jsx(_Select, _objectSpread(_objectSpread({
303
+ placeholder: locale === null || locale === void 0 ? void 0 : (_locale$ProSelect = locale.ProSelect) === null || _locale$ProSelect === void 0 ? void 0 : _locale$ProSelect.select,
304
+ allowClear: true,
305
+ showArrow: true,
306
+ loading: fetchFunction === null || fetchFunction === void 0 ? void 0 : fetchFunction.loading,
307
+ onChange: handleChange,
308
+ optionLabelProp: "children" // 解决warning报错,添加默认值
309
+ ,
310
+ showSearch: true,
311
+ filterOption: isFunction(_onSearch) ? false : function (input, option) {
312
+ var _option$children, _option$children$prop;
313
+ var value = isString(option === null || option === void 0 ? void 0 : option.children) ? option === null || option === void 0 ? void 0 : option.children : option === null || option === void 0 ? void 0 : (_option$children = option.children) === null || _option$children === void 0 ? void 0 : (_option$children$prop = _option$children.props) === null || _option$children$prop === void 0 ? void 0 : _option$children$prop.title;
314
+ return value.toLowerCase().includes(input.toLowerCase());
315
+ },
316
+ onSearch: function onSearch(value) {
317
+ _onSearch && _onSearch(value, _objectSpread({}, fetchFunction));
318
+ },
319
+ getPopupContainer: function getPopupContainer(trigger) {
320
+ return scrollFollowParent ? trigger.parentElement : document.body;
321
+ }
322
+ }, omit(cloneDeep(selectProps), ['isView', 'showCodeName', 'form', 'name'])), {}, {
323
+ value: transformValue(),
324
+ children: Array.isArray(newSelectList) && newSelectList.map(function (item) {
325
+ return _jsx(Option, {
326
+ value: item[code],
327
+ record: item,
328
+ disabled: !!item.disabled,
329
+ children: _jsx(TooltipOption, {
330
+ title: OptionRender ? OptionRender(item) : selectProps.showCodeName ? "".concat(item[code], "-").concat(item[label]) : item[label],
331
+ children: OptionRender ? _jsx("span", {
332
+ title: OptionRender(item),
333
+ children: OptionRender(item)
334
+ }) : _jsx("span", {
335
+ title: "".concat(item[code], "-").concat(item[label]),
336
+ children: selectProps.showCodeName ? "".concat(item[code], "-").concat(item[label]) : item[label]
337
+ })
338
+ }, item[code])
339
+ }, item[code]);
340
+ })
341
+ }));
345
342
  };
346
343
  export default /*#__PURE__*/forwardRef(ProSelect);
@@ -63,7 +63,7 @@ var ProSelect = exports.ProSelect = function ProSelect(props, ref) {
63
63
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
64
64
  viewFlag = _useState2[0],
65
65
  setViewFlag = _useState2[1];
66
- var refSelect = (0, _react.useRef)(null);
66
+ var refSelect = (0, _react.useRef)();
67
67
  var _useInViewport = (0, _ahooks.useInViewport)(refSelect),
68
68
  _useInViewport2 = (0, _slicedToArray2.default)(_useInViewport, 1),
69
69
  inViewport = _useInViewport2[0];
@@ -300,48 +300,45 @@ var ProSelect = exports.ProSelect = function ProSelect(props, ref) {
300
300
  fieldNames: fieldNames
301
301
  });
302
302
  }
303
- return (0, _jsxRuntime.jsx)("div", {
304
- ref: refSelect,
305
- children: (0, _jsxRuntime.jsx)(_antd.Select, (0, _objectSpread2.default)((0, _objectSpread2.default)({
306
- placeholder: _locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProSelect = _locale.default.ProSelect) === null || _locale$ProSelect === void 0 ? void 0 : _locale$ProSelect.select,
307
- allowClear: true,
308
- showArrow: true,
309
- loading: fetchFunction === null || fetchFunction === void 0 ? void 0 : fetchFunction.loading,
310
- onChange: handleChange,
311
- optionLabelProp: "children" // 解决warning报错,添加默认值
312
- ,
313
- showSearch: true,
314
- filterOption: (0, _lodash.isFunction)(_onSearch) ? false : function (input, option) {
315
- var _option$children, _option$children$prop;
316
- var value = (0, _lodash.isString)(option === null || option === void 0 ? void 0 : option.children) ? option === null || option === void 0 ? void 0 : option.children : option === null || option === void 0 ? void 0 : (_option$children = option.children) === null || _option$children === void 0 ? void 0 : (_option$children$prop = _option$children.props) === null || _option$children$prop === void 0 ? void 0 : _option$children$prop.title;
317
- return value.toLowerCase().includes(input.toLowerCase());
318
- },
319
- onSearch: function onSearch(value) {
320
- _onSearch && _onSearch(value, (0, _objectSpread2.default)({}, fetchFunction));
321
- },
322
- getPopupContainer: function getPopupContainer(trigger) {
323
- return scrollFollowParent ? trigger.parentElement : document.body;
324
- }
325
- }, (0, _lodash.omit)((0, _lodash.cloneDeep)(selectProps), ['isView', 'showCodeName', 'form', 'name'])), {}, {
326
- value: transformValue(),
327
- children: Array.isArray(newSelectList) && newSelectList.map(function (item) {
328
- return (0, _jsxRuntime.jsx)(Option, {
329
- value: item[code],
330
- record: item,
331
- disabled: !!item.disabled,
332
- children: (0, _jsxRuntime.jsx)(TooltipOption, {
333
- title: OptionRender ? OptionRender(item) : selectProps.showCodeName ? "".concat(item[code], "-").concat(item[label]) : item[label],
334
- children: OptionRender ? (0, _jsxRuntime.jsx)("span", {
335
- title: OptionRender(item),
336
- children: OptionRender(item)
337
- }) : (0, _jsxRuntime.jsx)("span", {
338
- title: "".concat(item[code], "-").concat(item[label]),
339
- children: selectProps.showCodeName ? "".concat(item[code], "-").concat(item[label]) : item[label]
340
- })
341
- }, item[code])
342
- }, item[code]);
343
- })
344
- }))
345
- });
303
+ return (0, _jsxRuntime.jsx)(_antd.Select, (0, _objectSpread2.default)((0, _objectSpread2.default)({
304
+ placeholder: _locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProSelect = _locale.default.ProSelect) === null || _locale$ProSelect === void 0 ? void 0 : _locale$ProSelect.select,
305
+ allowClear: true,
306
+ showArrow: true,
307
+ loading: fetchFunction === null || fetchFunction === void 0 ? void 0 : fetchFunction.loading,
308
+ onChange: handleChange,
309
+ optionLabelProp: "children" // 解决warning报错,添加默认值
310
+ ,
311
+ showSearch: true,
312
+ filterOption: (0, _lodash.isFunction)(_onSearch) ? false : function (input, option) {
313
+ var _option$children, _option$children$prop;
314
+ var value = (0, _lodash.isString)(option === null || option === void 0 ? void 0 : option.children) ? option === null || option === void 0 ? void 0 : option.children : option === null || option === void 0 ? void 0 : (_option$children = option.children) === null || _option$children === void 0 ? void 0 : (_option$children$prop = _option$children.props) === null || _option$children$prop === void 0 ? void 0 : _option$children$prop.title;
315
+ return value.toLowerCase().includes(input.toLowerCase());
316
+ },
317
+ onSearch: function onSearch(value) {
318
+ _onSearch && _onSearch(value, (0, _objectSpread2.default)({}, fetchFunction));
319
+ },
320
+ getPopupContainer: function getPopupContainer(trigger) {
321
+ return scrollFollowParent ? trigger.parentElement : document.body;
322
+ }
323
+ }, (0, _lodash.omit)((0, _lodash.cloneDeep)(selectProps), ['isView', 'showCodeName', 'form', 'name'])), {}, {
324
+ value: transformValue(),
325
+ children: Array.isArray(newSelectList) && newSelectList.map(function (item) {
326
+ return (0, _jsxRuntime.jsx)(Option, {
327
+ value: item[code],
328
+ record: item,
329
+ disabled: !!item.disabled,
330
+ children: (0, _jsxRuntime.jsx)(TooltipOption, {
331
+ title: OptionRender ? OptionRender(item) : selectProps.showCodeName ? "".concat(item[code], "-").concat(item[label]) : item[label],
332
+ children: OptionRender ? (0, _jsxRuntime.jsx)("span", {
333
+ title: OptionRender(item),
334
+ children: OptionRender(item)
335
+ }) : (0, _jsxRuntime.jsx)("span", {
336
+ title: "".concat(item[code], "-").concat(item[label]),
337
+ children: selectProps.showCodeName ? "".concat(item[code], "-").concat(item[label]) : item[label]
338
+ })
339
+ }, item[code])
340
+ }, item[code]);
341
+ })
342
+ }));
346
343
  };
347
344
  var _default = exports.default = /*#__PURE__*/(0, _react.forwardRef)(ProSelect);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zat-design/sisyphus-react",
3
- "version": "3.4.12-beta.11",
3
+ "version": "3.4.12-beta.12",
4
4
  "license": "Apache-2.0",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",