@bit-sun/business-component 2.2.5 → 2.2.7

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.
package/dist/index.esm.js CHANGED
@@ -17052,8 +17052,10 @@ var SearchItemTable = /*#__PURE__*/function (_React$Component) {
17052
17052
  };
17053
17053
  _this.setInitValue = function () {
17054
17054
  var _this$props = _this.props,
17055
- datasource = _this$props.datasource,
17056
- showSearchFields = _this$props.showSearchFields;
17055
+ _this$props$datasourc = _this$props.datasource,
17056
+ datasource = _this$props$datasourc === void 0 ? [] : _this$props$datasourc,
17057
+ _this$props$showSearc = _this$props.showSearchFields,
17058
+ showSearchFields = _this$props$showSearc === void 0 ? [] : _this$props$showSearc;
17057
17059
  var config = _this.getConfigFromlocalstorage();
17058
17060
  _this.setState({
17059
17061
  isDefaultValue: true,
@@ -17480,7 +17482,7 @@ var BsSulaQueryTable = (function (props) {
17480
17482
  _useState12 = _slicedToArray(_useState11, 2),
17481
17483
  showColumn = _useState12[0],
17482
17484
  setShowColumns = _useState12[1]; // 列字段
17483
- var _useState13 = useState([]),
17485
+ var _useState13 = useState(props.fields || []),
17484
17486
  _useState14 = _slicedToArray(_useState13, 2),
17485
17487
  showSearchFields = _useState14[0],
17486
17488
  setShowSearchFields = _useState14[1]; //搜索项字段
@@ -17593,7 +17595,8 @@ var BsSulaQueryTable = (function (props) {
17593
17595
  };
17594
17596
  var setInitialSearchFieldsInfo = function setInitialSearchFieldsInfo() {
17595
17597
  //获取搜索字段的缓存配置
17596
- var fields = props.fields;
17598
+ var _props$fields = props.fields,
17599
+ fields = _props$fields === void 0 ? [] : _props$fields;
17597
17600
  var searchFieldsConfig = getConfigFromlocalstorage(ENUM.BROWSER_CACHE.SEARCH_FIELDS_CONDITION);
17598
17601
  var showSearchFields = searchFieldsConfig.length ? searchFieldsConfig.map(function (item) {
17599
17602
  var inner = fields.filter(function (inneritem) {
package/dist/index.js CHANGED
@@ -17070,8 +17070,10 @@ var SearchItemTable = /*#__PURE__*/function (_React$Component) {
17070
17070
  };
17071
17071
  _this.setInitValue = function () {
17072
17072
  var _this$props = _this.props,
17073
- datasource = _this$props.datasource,
17074
- showSearchFields = _this$props.showSearchFields;
17073
+ _this$props$datasourc = _this$props.datasource,
17074
+ datasource = _this$props$datasourc === void 0 ? [] : _this$props$datasourc,
17075
+ _this$props$showSearc = _this$props.showSearchFields,
17076
+ showSearchFields = _this$props$showSearc === void 0 ? [] : _this$props$showSearc;
17075
17077
  var config = _this.getConfigFromlocalstorage();
17076
17078
  _this.setState({
17077
17079
  isDefaultValue: true,
@@ -17498,7 +17500,7 @@ var BsSulaQueryTable = (function (props) {
17498
17500
  _useState12 = _slicedToArray(_useState11, 2),
17499
17501
  showColumn = _useState12[0],
17500
17502
  setShowColumns = _useState12[1]; // 列字段
17501
- var _useState13 = React.useState([]),
17503
+ var _useState13 = React.useState(props.fields || []),
17502
17504
  _useState14 = _slicedToArray(_useState13, 2),
17503
17505
  showSearchFields = _useState14[0],
17504
17506
  setShowSearchFields = _useState14[1]; //搜索项字段
@@ -17611,7 +17613,8 @@ var BsSulaQueryTable = (function (props) {
17611
17613
  };
17612
17614
  var setInitialSearchFieldsInfo = function setInitialSearchFieldsInfo() {
17613
17615
  //获取搜索字段的缓存配置
17614
- var fields = props.fields;
17616
+ var _props$fields = props.fields,
17617
+ fields = _props$fields === void 0 ? [] : _props$fields;
17615
17618
  var searchFieldsConfig = getConfigFromlocalstorage(ENUM.BROWSER_CACHE.SEARCH_FIELDS_CONDITION);
17616
17619
  var showSearchFields = searchFieldsConfig.length ? searchFieldsConfig.map(function (item) {
17617
17620
  var inner = fields.filter(function (inneritem) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bit-sun/business-component",
3
- "version": "2.2.5",
3
+ "version": "2.2.7",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -101,7 +101,7 @@ class SearchItemTable extends React.Component {
101
101
  };
102
102
 
103
103
  setInitValue = (isClick = false) => {
104
- const { datasource, showSearchFields }: any =
104
+ const { datasource = [], showSearchFields =[] }: any =
105
105
  this.props;
106
106
  let config = this.getConfigFromlocalstorage();
107
107
  this.setState({
@@ -55,7 +55,7 @@ export default (props: any) => {
55
55
  // @ts-nocheck
56
56
  const [value, setValue]: any = useState(props);
57
57
  const [showColumn, setShowColumns] = useState([]); // 列字段
58
- const [showSearchFields, setShowSearchFields] = useState([]); //搜索项字段
58
+ const [showSearchFields, setShowSearchFields] = useState(props.fields || []); //搜索项字段
59
59
  const { isPage = true, pagination, tableCode } = props;
60
60
 
61
61
  const [height, setHeight]: any = useState('100vh');
@@ -195,7 +195,7 @@ export default (props: any) => {
195
195
 
196
196
  const setInitialSearchFieldsInfo = () =>{
197
197
  //获取搜索字段的缓存配置
198
- const { fields } = props;
198
+ const { fields = [] } = props;
199
199
  let searchFieldsConfig = getConfigFromlocalstorage(ENUM.BROWSER_CACHE.SEARCH_FIELDS_CONDITION);
200
200
  let showSearchFields = searchFieldsConfig.length ? searchFieldsConfig.map((item) => {
201
201
  let inner = fields.filter(