wt-enjoy-link-antd-repack 4.2.24 → 4.2.25

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.
@@ -0,0 +1,4 @@
1
+ /**
2
+ * @description: 为了统一样式,对antd的Select组件进行了封装
3
+ */
4
+ export declare const BiuAAutoComplete: any;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AA2BA;;GAEG;AACH,eAAO,MAAM,gBAAgB,KAAsC,CAAA"}
@@ -0,0 +1,13 @@
1
+ import { AutoComplete } from 'antd';
2
+ import React from 'react';
3
+ import { styled } from 'styled-components';
4
+ var StyledAutoSelect = styled(AutoComplete).withConfig({
5
+ displayName: "StyledAutoSelect",
6
+ componentId: "wt-enjoy-link-antd-repack__sc-1fel0eg-0"
7
+ })([".ant-select-auto-complete{height:28px !important;}.ant-select-selector,.ant-select-selection-search-input{height:28px !important;}.ant-select-selection-placeholder{line-height:28px !important;}.ant-select-selection-item{height:28px !important;line-height:28px !important;}.ant-select-selection-overflow-item{height:100% !important;}.ant-select-selection-search{height:100% !important;}"]);
8
+
9
+ /**
10
+ * @description: 为了统一样式,对antd的Select组件进行了封装
11
+ */
12
+ export var BiuAAutoComplete = /*#__PURE__*/React.memo(StyledAutoSelect);
13
+ BiuAAutoComplete.displayName = 'BiuAAutoComplete';
@@ -3,16 +3,16 @@ export declare const BiuAButton: React.MemoExoticComponent<import("styled-compon
3
3
  href: string;
4
4
  target?: string | undefined;
5
5
  onClick?: React.MouseEventHandler<HTMLElement> | undefined;
6
- } & import("antd/lib/button/button").BaseButtonProps & Omit<React.AnchorHTMLAttributes<any>, "type" | "onClick"> & {
6
+ } & import("antd/lib/button/button").BaseButtonProps & Omit<React.AnchorHTMLAttributes<any>, "onClick" | "type"> & {
7
7
  htmlType?: "button" | "submit" | "reset" | undefined;
8
8
  onClick?: React.MouseEventHandler<HTMLElement> | undefined;
9
- } & Omit<React.ButtonHTMLAttributes<any>, "type" | "onClick">> & React.RefAttributes<HTMLElement>, never>> & Omit<React.ForwardRefExoticComponent<Partial<{
9
+ } & Omit<React.ButtonHTMLAttributes<any>, "onClick" | "type">> & React.RefAttributes<HTMLElement>, never>> & Omit<React.ForwardRefExoticComponent<Partial<{
10
10
  href: string;
11
11
  target?: string | undefined;
12
12
  onClick?: React.MouseEventHandler<HTMLElement> | undefined;
13
- } & import("antd/lib/button/button").BaseButtonProps & Omit<React.AnchorHTMLAttributes<any>, "type" | "onClick"> & {
13
+ } & import("antd/lib/button/button").BaseButtonProps & Omit<React.AnchorHTMLAttributes<any>, "onClick" | "type"> & {
14
14
  htmlType?: "button" | "submit" | "reset" | undefined;
15
15
  onClick?: React.MouseEventHandler<HTMLElement> | undefined;
16
- } & Omit<React.ButtonHTMLAttributes<any>, "type" | "onClick">> & React.RefAttributes<HTMLElement>> & {
16
+ } & Omit<React.ButtonHTMLAttributes<any>, "onClick" | "type">> & React.RefAttributes<HTMLElement>> & {
17
17
  Group: React.FC<import("antd/lib/button").ButtonGroupProps>;
18
18
  }, keyof React.Component<any, {}, any>>>;
@@ -22,5 +22,6 @@ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponen
22
22
  isAutoGenerate?: string | undefined;
23
23
  filterInv?: boolean | undefined;
24
24
  isGoodType?: string | number | undefined;
25
+ isFirstLoad?: boolean | undefined;
25
26
  } & React.RefAttributes<unknown>>>;
26
27
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"locationSelect.d.ts","sourceRoot":"","sources":["locationSelect.tsx"],"names":[],"mappings":"AACA,OAAO,KAA+D,MAAM,OAAO,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;AA0CnF,wBAqIC"}
1
+ {"version":3,"file":"locationSelect.d.ts","sourceRoot":"","sources":["locationSelect.tsx"],"names":[],"mappings":"AACA,OAAO,KAA+D,MAAM,OAAO,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CnF,wBAyIC"}
@@ -1,5 +1,5 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- var _excluded = ["ownerId", "initialValue", "warehouseIds", "warehouseAreaId", "searchTimes", "rowLabel", "isDefWth", "goodsId", "batch", "isAutoGenerate", "filterInv", "isGoodType"];
2
+ var _excluded = ["ownerId", "initialValue", "warehouseIds", "warehouseAreaId", "searchTimes", "isFirstLoad", "rowLabel", "isDefWth", "goodsId", "batch", "isAutoGenerate", "filterInv", "isGoodType"];
3
3
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4
4
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5
5
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
@@ -13,7 +13,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
13
13
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
14
14
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
15
15
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
16
- import { isNil } from 'lodash';
16
+ import { debounce, isNil } from 'lodash';
17
17
  import React, { forwardRef, useCallback, useEffect, useRef, useState } from 'react';
18
18
  import TableSelectBase from "./base";
19
19
  import { GATEWAY_ROUTE_WMS } from "../../../../constant";
@@ -63,6 +63,8 @@ export default /*#__PURE__*/React.memo( /*#__PURE__*/forwardRef(function (props,
63
63
  warehouseAreaId = props.warehouseAreaId,
64
64
  _props$searchTimes = props.searchTimes,
65
65
  searchTimes = _props$searchTimes === void 0 ? 300 : _props$searchTimes,
66
+ _props$isFirstLoad = props.isFirstLoad,
67
+ isFirstLoad = _props$isFirstLoad === void 0 ? false : _props$isFirstLoad,
66
68
  _props$rowLabel = props.rowLabel,
67
69
  rowLabel = _props$rowLabel === void 0 ? 'locationCode' : _props$rowLabel,
68
70
  _props$isDefWth = props.isDefWth,
@@ -75,82 +77,76 @@ export default /*#__PURE__*/React.memo( /*#__PURE__*/forwardRef(function (props,
75
77
  filterInv = _props$filterInv === void 0 ? false : _props$filterInv,
76
78
  isGoodType = props.isGoodType,
77
79
  restProps = _objectWithoutProperties(props, _excluded);
78
- var _useState = useState(),
80
+ var _useState = useState(isFirstLoad),
79
81
  _useState2 = _slicedToArray(_useState, 2),
80
- locationList = _useState2[0],
81
- setLocationList = _useState2[1];
82
- var _useState3 = useState(false),
82
+ isFirstLoadSearch = _useState2[0],
83
+ setIsFirstLoadSearch = _useState2[1];
84
+ var _useState3 = useState(),
83
85
  _useState4 = _slicedToArray(_useState3, 2),
84
- loading = _useState4[0],
85
- setLoading = _useState4[1];
86
- var _useState5 = useState(),
86
+ locationList = _useState4[0],
87
+ setLocationList = _useState4[1];
88
+ var _useState5 = useState(false),
87
89
  _useState6 = _slicedToArray(_useState5, 2),
88
- initSelectValue = _useState6[0],
89
- setInitSelectValue = _useState6[1];
90
+ loading = _useState6[0],
91
+ setLoading = _useState6[1];
92
+ var _useState7 = useState(),
93
+ _useState8 = _slicedToArray(_useState7, 2),
94
+ initSelectValue = _useState8[0],
95
+ setInitSelectValue = _useState8[1];
90
96
  var timerRef = useRef();
91
97
  useEffect(function () {
92
98
  if (initialValue && !props.initSelectValue && (props.value === initialValue || props.value === undefined || props.value === null)) {
93
- setLoading(true);
94
- getWarehouseLoctionList({
95
- warehouseLocationIds: initialValue,
96
- warehouseIds: warehouseIds,
97
- warehouseAreaId: warehouseAreaId,
98
- goodsId: goodsId,
99
- ownerId: ownerId,
100
- defWth: isDefWth,
101
- batch: batch,
102
- page: 1,
103
- size: 20,
104
- isAutoGenerate: isAutoGenerate,
105
- filterInv: filterInv,
106
- isGoodType: isGoodType
107
- }).then(function (res) {
108
- if (res !== null && res !== void 0 && res.length && res[0].id) {
109
- setLocationList(res);
110
- setInitSelectValue(res[0][rowLabel]);
111
- if (props.onChange) {
112
- props.onChange(initialValue, res[0]);
113
- }
114
- if (props.onChangeData) {
115
- props.onChangeData(initialValue, res[0]);
116
- }
117
- } else {
118
- setLocationList([]);
119
- setInitSelectValue(undefined);
120
- if (props.onChange) {
121
- props.onChange(undefined, undefined);
122
- }
123
- if (props.onChangeData) {
124
- props.onChangeData(undefined, {});
125
- }
126
- }
127
- }).finally(function () {
128
- setLoading(false);
129
- });
99
+ debounceFetchData();
130
100
  }
131
- }, [initialValue, warehouseIds, goodsId, ownerId, isDefWth, batch, warehouseAreaId, props, isAutoGenerate, rowLabel, filterInv, isGoodType]);
132
- var onSearch = useCallback(function (sValue) {
133
- if (timerRef.current) clearTimeout(timerRef.current);
134
- timerRef.current = setTimeout(function () {
135
- setLoading(true);
136
- getWarehouseLoctionList({
137
- warehouseIds: warehouseIds,
138
- remoteSearchCValue: sValue,
139
- goodsId: goodsId,
140
- ownerId: ownerId,
141
- defWth: isDefWth,
142
- batch: batch,
143
- page: 1,
144
- size: 20,
145
- isAutoGenerate: isAutoGenerate,
146
- filterInv: filterInv,
147
- isGoodType: isGoodType
148
- }).then(function (res) {
101
+ }, [initialValue, props, warehouseIds, goodsId, ownerId, isDefWth, batch, warehouseAreaId, isAutoGenerate, rowLabel, filterInv, isGoodType]);
102
+ var fetchData = useCallback(function (sValue) {
103
+ setLoading(true);
104
+ getWarehouseLoctionList({
105
+ remoteSearchCValue: sValue,
106
+ warehouseLocationIds: initialValue,
107
+ warehouseIds: warehouseIds,
108
+ warehouseAreaId: warehouseAreaId,
109
+ goodsId: goodsId,
110
+ ownerId: ownerId,
111
+ defWth: isDefWth,
112
+ batch: batch,
113
+ page: 1,
114
+ size: 20,
115
+ isAutoGenerate: isAutoGenerate,
116
+ filterInv: filterInv,
117
+ isGoodType: isGoodType
118
+ }).then(function (res) {
119
+ if (res !== null && res !== void 0 && res.length && res[0].id) {
149
120
  setLocationList(res);
150
- }).finally(function () {
151
- setLoading(false);
152
- });
153
- }, searchTimes);
121
+ setInitSelectValue(res[0][rowLabel]);
122
+ if (props.onChange) {
123
+ props.onChange(initialValue, res[0]);
124
+ }
125
+ if (props.onChangeData) {
126
+ props.onChangeData(initialValue, res[0]);
127
+ }
128
+ } else {
129
+ setLocationList([]);
130
+ setInitSelectValue(undefined);
131
+ if (props.onChange) {
132
+ props.onChange(undefined, undefined);
133
+ }
134
+ if (props.onChangeData) {
135
+ props.onChangeData(undefined, {});
136
+ }
137
+ }
138
+ }).finally(function () {
139
+ setLoading(false);
140
+ });
141
+ }, [warehouseIds, goodsId, ownerId, isDefWth, batch, warehouseAreaId, isAutoGenerate, rowLabel, filterInv, isGoodType]);
142
+ var debounceFetchData = debounce(function (sValue) {
143
+ return fetchData(sValue);
144
+ }, searchTimes);
145
+ useEffect(function () {
146
+ if (isFirstLoadSearch) debounceFetchData();
147
+ }, [isFirstLoadSearch]);
148
+ var onSearch = useCallback(function (sValue) {
149
+ debounceFetchData(sValue);
154
150
  }, [searchTimes, warehouseIds, goodsId, ownerId, isDefWth, batch, isAutoGenerate, filterInv, isGoodType]);
155
151
  return /*#__PURE__*/_jsx(TableSelectBase, _objectSpread(_objectSpread({
156
152
  ref: ref
@@ -1 +1 @@
1
- {"version":3,"file":"lpnSelectNew.d.ts","sourceRoot":"","sources":["lpnSelectNew.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,MAAM,CAAA;AAEvC,OAAO,KAAuD,MAAM,OAAO,CAAA;;;;;;;;;;;;;;;AAgC3E,wBAsJC"}
1
+ {"version":3,"file":"lpnSelectNew.d.ts","sourceRoot":"","sources":["lpnSelectNew.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,MAAM,CAAA;AACvC,OAAO,KAAuD,MAAM,OAAO,CAAA;;;;;;;;;;;;;;;AAiC3E,wBAsJC"}
@@ -13,12 +13,12 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
13
13
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
14
14
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
15
15
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
16
- import { AutoComplete } from 'antd';
17
16
  import React, { forwardRef, useCallback, useEffect, useState } from 'react';
18
17
  import { BiuASelect, BiuASelectOption } from "../../BiuASelect";
19
18
  import { GATEWAY_ROUTE_WMS } from "../../../constant";
20
19
  import { request } from "../../../package";
21
20
  import { debounce } from 'lodash';
21
+ import { BiuAAutoComplete } from "../../BiuAAutoComplete";
22
22
  import { jsx as _jsx } from "react/jsx-runtime";
23
23
  import { Fragment as _Fragment } from "react/jsx-runtime";
24
24
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -137,7 +137,7 @@ export default /*#__PURE__*/React.memo( /*#__PURE__*/forwardRef(function (props,
137
137
  setLpnCode(value);
138
138
  }, []);
139
139
  return /*#__PURE__*/_jsxs(_Fragment, {
140
- children: [isAutoComplete && /*#__PURE__*/_jsx(AutoComplete, {
140
+ children: [isAutoComplete && /*#__PURE__*/_jsx(BiuAAutoComplete, {
141
141
  popupClassName: "certain-category-search-dropdown"
142
142
  // dropdownMatchSelectWidth={100}
143
143
  ,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wt-enjoy-link-antd-repack",
3
- "version": "4.2.24",
3
+ "version": "4.2.25",
4
4
  "description": "万通业务组件",
5
5
  "sideEffects": false,
6
6
  "main": "dist/esm/index.js",