@arim-aisdc/public-components 0.0.64 → 0.0.66

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.
@@ -17,7 +17,7 @@ export declare const foramtBaseInfoField: (data: any, dataField: BaseInfoFieldTy
17
17
  value: any;
18
18
  field: string;
19
19
  label?: string;
20
- text: string | Element | JSX.Element;
20
+ text: string | JSX.Element | Element;
21
21
  units?: string;
22
22
  width?: string;
23
23
  labelWidth?: string;
@@ -16,6 +16,7 @@ export declare const typeList: {
16
16
  export declare function useDynamicSearchFiled(searchField: Array<any>, dynamicField: Array<{
17
17
  field: string;
18
18
  key?: string;
19
+ hiddenKey?: boolean;
19
20
  ApiFun: ({ key, isPage }: {
20
21
  key: string;
21
22
  isPage: boolean;
@@ -169,7 +169,7 @@ var QueryFilter = function QueryFilter(_ref) {
169
169
  }),
170
170
  run = _useDebounceFn.run;
171
171
  var getElement = function getElement(item) {
172
- var _item$setting, _item$inputTips, _item$inputTips2, _item$inputTips3, _item$inputTips4, _item$setting2, _item$setting3;
172
+ var _item$handleSearch, _item$setting, _item$inputTips, _item$inputTips2, _item$inputTips3, _item$inputTips4, _item$handleSearch5, _item$setting2, _item$handleSearch7, _item$setting3;
173
173
  var element = /*#__PURE__*/_jsx(_Input, {});
174
174
  switch (item.formType) {
175
175
  case FormItemType.Text:
@@ -225,9 +225,10 @@ var QueryFilter = function QueryFilter(_ref) {
225
225
  allowClear: item.allowClear === false ? false : true,
226
226
  disabled: item.disabled,
227
227
  defaultValue: item.defaultValue,
228
+ onFocus: item.isRemoteSetting ? (_item$handleSearch = item.handleSearch) === null || _item$handleSearch === void 0 ? void 0 : _item$handleSearch.call(item) : undefined,
228
229
  onSearch: item.showSearch ? debounce(function (value) {
229
- var _item$handleSearch;
230
- return (_item$handleSearch = item.handleSearch) === null || _item$handleSearch === void 0 ? void 0 : _item$handleSearch.call(item, value);
230
+ var _item$handleSearch2;
231
+ return (_item$handleSearch2 = item.handleSearch) === null || _item$handleSearch2 === void 0 ? void 0 : _item$handleSearch2.call(item, value);
231
232
  }, 500) : undefined,
232
233
  onChange: function onChange(e) {
233
234
  commonChange(e, item);
@@ -279,8 +280,8 @@ var QueryFilter = function QueryFilter(_ref) {
279
280
  allowClear: item.allowClear === false ? false : true,
280
281
  placeholder: item.inputTips,
281
282
  onSearch: debounce(function (value) {
282
- var _item$handleSearch2;
283
- return (_item$handleSearch2 = item.handleSearch) === null || _item$handleSearch2 === void 0 ? void 0 : _item$handleSearch2.call(item, value);
283
+ var _item$handleSearch3;
284
+ return (_item$handleSearch3 = item.handleSearch) === null || _item$handleSearch3 === void 0 ? void 0 : _item$handleSearch3.call(item, value);
284
285
  }, 500),
285
286
  onChange: function onChange(e) {
286
287
  run(e, item);
@@ -448,8 +449,8 @@ var QueryFilter = function QueryFilter(_ref) {
448
449
  disabled: item.disabled,
449
450
  defaultValue: item.defaultValue || null,
450
451
  onSearch: item.showSearch ? debounce(function (value) {
451
- var _item$handleSearch3;
452
- return (_item$handleSearch3 = item.handleSearch) === null || _item$handleSearch3 === void 0 ? void 0 : _item$handleSearch3.call(item, value);
452
+ var _item$handleSearch4;
453
+ return (_item$handleSearch4 = item.handleSearch) === null || _item$handleSearch4 === void 0 ? void 0 : _item$handleSearch4.call(item, value);
453
454
  }, 500) : undefined,
454
455
  onChange: function onChange(e) {
455
456
  run(e, item, typeList.start);
@@ -458,6 +459,7 @@ var QueryFilter = function QueryFilter(_ref) {
458
459
  var _option$label2;
459
460
  return ((_option$label2 = option === null || option === void 0 ? void 0 : option.label) !== null && _option$label2 !== void 0 ? _option$label2 : '').toLowerCase().includes(input.toLowerCase());
460
461
  } : false,
462
+ onFocus: item.isRemoteSetting ? (_item$handleSearch5 = item.handleSearch) === null || _item$handleSearch5 === void 0 ? void 0 : _item$handleSearch5.call(item) : undefined,
461
463
  onSelect: item.showSelect ? debounce(function (value) {
462
464
  var _item$handleSelect2;
463
465
  return (_item$handleSelect2 = item.handleSelect) === null || _item$handleSelect2 === void 0 ? void 0 : _item$handleSelect2.call(item, value);
@@ -494,9 +496,10 @@ var QueryFilter = function QueryFilter(_ref) {
494
496
  disabled: item.disabled,
495
497
  defaultValue: item.defaultValue,
496
498
  onSearch: item.showSearch ? debounce(function (value) {
497
- var _item$handleSearch4;
498
- return (_item$handleSearch4 = item.handleSearch) === null || _item$handleSearch4 === void 0 ? void 0 : _item$handleSearch4.call(item, value);
499
+ var _item$handleSearch6;
500
+ return (_item$handleSearch6 = item.handleSearch) === null || _item$handleSearch6 === void 0 ? void 0 : _item$handleSearch6.call(item, value);
499
501
  }, 500) : undefined,
502
+ onFocus: item.isRemoteSetting ? (_item$handleSearch7 = item.handleSearch) === null || _item$handleSearch7 === void 0 ? void 0 : _item$handleSearch7.call(item) : undefined,
500
503
  onChange: function onChange(e) {
501
504
  run(e, item, typeList.end);
502
505
  },
@@ -653,21 +656,26 @@ export function useDynamicSearchFiled(searchField, dynamicField) {
653
656
  var handleSearch = /*#__PURE__*/function () {
654
657
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(value) {
655
658
  var _this = this;
656
- var _settingList, _tartget$params, _tartget$key, queryData, _key, _yield$to, _yield$to2, err, data, _items;
659
+ var _settingList, params, hiddenKey, key, queryData, newKey, _yield$to, _yield$to2, err, data, _items;
657
660
  return _regeneratorRuntime().wrap(function _callee$(_context) {
658
661
  while (1) switch (_context.prev = _context.next) {
659
662
  case 0:
660
663
  _settingList = [];
661
- if (!value) {
662
- _context.next = 12;
664
+ params = tartget.params, hiddenKey = tartget.hiddenKey, key = tartget.key;
665
+ console.log(11111);
666
+ if (!(value || hiddenKey)) {
667
+ _context.next = 15;
663
668
  break;
664
669
  }
665
670
  // 接口查询参数
666
- queryData = (_tartget$params = tartget.params) !== null && _tartget$params !== void 0 ? _tartget$params : {};
667
- _key = (_tartget$key = tartget.key) !== null && _tartget$key !== void 0 ? _tartget$key : 'key';
668
- _context.next = 6;
669
- return to(tartget.ApiFun(_objectSpread(_defineProperty(_defineProperty({}, _key, value), "isPage", false), queryData)));
670
- case 6:
671
+ queryData = params !== null && params !== void 0 ? params : {};
672
+ newKey = key !== null && key !== void 0 ? key : 'key'; // eslint-disable-next-line @typescript-eslint/no-unused-expressions
673
+ !hiddenKey && (queryData[newKey] = value);
674
+ _context.next = 9;
675
+ return to(tartget.ApiFun(_objectSpread({
676
+ isPage: false
677
+ }, queryData)));
678
+ case 9:
671
679
  _yield$to = _context.sent;
672
680
  _yield$to2 = _slicedToArray(_yield$to, 2);
673
681
  err = _yield$to2[0];
@@ -682,7 +690,7 @@ export function useDynamicSearchFiled(searchField, dynamicField) {
682
690
  }
683
691
  return item;
684
692
  }));
685
- case 12:
693
+ case 15:
686
694
  case "end":
687
695
  return _context.stop();
688
696
  }
@@ -1,13 +1,13 @@
1
1
  import { TableMaxColumnType } from "../../type";
2
- export declare const numberSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
3
- export declare const stringSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
4
- export declare const numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
5
- export declare const timeSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
2
+ export declare const numberSortFn: (rowA: any, rowB: any, columnId: string) => 1 | 0 | -1;
3
+ export declare const stringSortFn: (rowA: any, rowB: any, columnId: string) => 1 | 0 | -1;
4
+ export declare const numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) => 1 | 0 | -1;
5
+ export declare const timeSortFn: (rowA: any, rowB: any, columnId: string) => 1 | 0 | -1;
6
6
  declare const customSortFns: {
7
- numberSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
8
- stringSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
9
- timeSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
10
- numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
7
+ numberSortFn: (rowA: any, rowB: any, columnId: string) => 1 | 0 | -1;
8
+ stringSortFn: (rowA: any, rowB: any, columnId: string) => 1 | 0 | -1;
9
+ timeSortFn: (rowA: any, rowB: any, columnId: string) => 1 | 0 | -1;
10
+ numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) => 1 | 0 | -1;
11
11
  };
12
12
  export default customSortFns;
13
13
  export type SortFnType = keyof typeof customSortFns | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arim-aisdc/public-components",
3
- "version": "0.0.64",
3
+ "version": "0.0.66",
4
4
  "description": "前端组件库",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",