wargerm 0.2.13 → 0.2.14

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
@@ -4,7 +4,7 @@ import 'antd/es/dropdown/style';
4
4
  import _Dropdown from 'antd/es/dropdown';
5
5
  import 'antd/es/menu/style';
6
6
  import _Menu from 'antd/es/menu';
7
- import React, { useState, useEffect, useMemo, useRef, useImperativeHandle } from 'react';
7
+ import React, { useState, useEffect, useMemo, useImperativeHandle, useRef } from 'react';
8
8
  import { createFromIconfontCN, SearchOutlined, ReloadOutlined, CloseCircleOutlined, PlusOutlined, EditOutlined, EyeOutlined, ExclamationCircleOutlined, DeleteOutlined } from '@ant-design/icons';
9
9
  import 'antd/es/input/style';
10
10
  import _Input from 'antd/es/input';
@@ -7550,9 +7550,8 @@ var WForm = function WForm(props, ref) {
7550
7550
 
7551
7551
  var _Form$useForm = _Form.useForm(),
7552
7552
  _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
7553
- form = _Form$useForm2[0];
7553
+ form = _Form$useForm2[0]; // const columnsFieldsRef = useRef<any>({});
7554
7554
 
7555
- var columnsFieldsRef = useRef({});
7556
7555
 
7557
7556
  var _useState = useState({}),
7558
7557
  _useState2 = _slicedToArray(_useState, 2),
@@ -7625,10 +7624,9 @@ var WForm = function WForm(props, ref) {
7625
7624
  placeholder: "\u8BF7\u9009\u62E9",
7626
7625
  disabled: disabled,
7627
7626
  onLoad: function onLoad(opt) {
7628
- if (columnsFieldsRef.current) {
7629
- columnsFieldsRef.current[c.dataIndex] = opt;
7630
- }
7631
-
7627
+ // if (columnsFieldsRef.current) {
7628
+ // columnsFieldsRef.current[c.dataIndex] = opt;
7629
+ // }
7632
7630
  setColumnsFields(function (preColumnsFields) {
7633
7631
  return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, opt));
7634
7632
  });
@@ -7766,11 +7764,10 @@ var WForm = function WForm(props, ref) {
7766
7764
 
7767
7765
  if (c.options) {
7768
7766
  options = c.options;
7769
- }
7767
+ } // if (columnsFieldsRef.current) {
7768
+ // columnsFieldsRef.current[c.dataIndex] = options;
7769
+ // }
7770
7770
 
7771
- if (columnsFieldsRef.current) {
7772
- columnsFieldsRef.current[c.dataIndex] = options;
7773
- }
7774
7771
 
7775
7772
  setColumnsFields(function (preColumnsFields) {
7776
7773
  return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, options));
@@ -7816,11 +7813,10 @@ var WForm = function WForm(props, ref) {
7816
7813
  value: _key
7817
7814
  });
7818
7815
  }
7819
- }
7816
+ } // if (columnsFieldsRef.current) {
7817
+ // columnsFieldsRef.current[c.dataIndex] = options;
7818
+ // }
7820
7819
 
7821
- if (columnsFieldsRef.current) {
7822
- columnsFieldsRef.current[c.dataIndex] = _options;
7823
- }
7824
7820
 
7825
7821
  setColumnsFields(function (preColumnsFields) {
7826
7822
  return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, _options));
@@ -7880,11 +7876,10 @@ var WForm = function WForm(props, ref) {
7880
7876
  _labelCol6.style = {
7881
7877
  width: search.labelWidth
7882
7878
  };
7883
- }
7879
+ } // if (columnsFieldsRef.current) {
7880
+ // columnsFieldsRef.current[c.dataIndex] = options;
7881
+ // }
7884
7882
 
7885
- if (columnsFieldsRef.current) {
7886
- columnsFieldsRef.current[c.dataIndex] = _options2;
7887
- }
7888
7883
 
7889
7884
  setColumnsFields(function (preColumnsFields) {
7890
7885
  return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, _options2));
@@ -7944,8 +7939,8 @@ var WForm = function WForm(props, ref) {
7944
7939
  var baseitem = c.renderFormItem(c, _objectSpread2(_objectSpread2({}, c), {}, {
7945
7940
  formItemProps: c.formItemProps,
7946
7941
  fieldProps: c.fieldProps,
7947
- columnsFields: columnsFields,
7948
- columnsFieldsRef: columnsFieldsRef
7942
+ columnsFields: columnsFields // columnsFieldsRef,
7943
+
7949
7944
  }), form);
7950
7945
  return baseitem ? /*#__PURE__*/React.createElement(_Col, _objectSpread2(_objectSpread2({
7951
7946
  style: {
@@ -8042,7 +8037,7 @@ var WForm = function WForm(props, ref) {
8042
8037
  }, c.fieldProps))));
8043
8038
  }
8044
8039
  });
8045
- }, [changedValues, columns, disabled, columnsFieldsRef, JSON.stringify(form.getFieldsValue())]);
8040
+ }, [changedValues, columns, disabled, JSON.stringify(columnsFields), JSON.stringify(form.getFieldsValue())]);
8046
8041
  var filterExtraColumnsForm = useMemo(function () {
8047
8042
  return filterExtraFormColumns.map(function (c) {
8048
8043
  var colProps = {};
@@ -8092,10 +8087,9 @@ var WForm = function WForm(props, ref) {
8092
8087
  placeholder: "\u8BF7\u9009\u62E9",
8093
8088
  disabled: disabled,
8094
8089
  onLoad: function onLoad(opt) {
8095
- if (columnsFieldsRef.current) {
8096
- columnsFieldsRef.current[c.dataIndex] = opt;
8097
- }
8098
-
8090
+ // if (columnsFieldsRef.current) {
8091
+ // columnsFieldsRef.current[c.dataIndex] = opt;
8092
+ // }
8099
8093
  setColumnsFields(function (preColumnsFields) {
8100
8094
  return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, opt));
8101
8095
  });
@@ -8233,11 +8227,10 @@ var WForm = function WForm(props, ref) {
8233
8227
 
8234
8228
  if (c.options) {
8235
8229
  options = c.options;
8236
- }
8230
+ } // if (columnsFieldsRef.current) {
8231
+ // columnsFieldsRef.current[c.dataIndex] = options;
8232
+ // }
8237
8233
 
8238
- if (columnsFieldsRef.current) {
8239
- columnsFieldsRef.current[c.dataIndex] = options;
8240
- }
8241
8234
 
8242
8235
  setColumnsFields(function (preColumnsFields) {
8243
8236
  return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, options));
@@ -8283,11 +8276,10 @@ var WForm = function WForm(props, ref) {
8283
8276
  value: _key3
8284
8277
  });
8285
8278
  }
8286
- }
8279
+ } // if (columnsFieldsRef.current) {
8280
+ // columnsFieldsRef.current[c.dataIndex] = options;
8281
+ // }
8287
8282
 
8288
- if (columnsFieldsRef.current) {
8289
- columnsFieldsRef.current[c.dataIndex] = _options3;
8290
- }
8291
8283
 
8292
8284
  setColumnsFields(function (preColumnsFields) {
8293
8285
  return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, _options3));
@@ -8347,11 +8339,10 @@ var WForm = function WForm(props, ref) {
8347
8339
  _labelCol17.style = {
8348
8340
  width: search.labelWidth
8349
8341
  };
8350
- }
8342
+ } // if (columnsFieldsRef.current) {
8343
+ // columnsFieldsRef.current[c.dataIndex] = options;
8344
+ // }
8351
8345
 
8352
- if (columnsFieldsRef.current) {
8353
- columnsFieldsRef.current[c.dataIndex] = _options4;
8354
- }
8355
8346
 
8356
8347
  setColumnsFields(function (preColumnsFields) {
8357
8348
  return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, _options4));
@@ -8411,8 +8402,8 @@ var WForm = function WForm(props, ref) {
8411
8402
  var baseitem = c.renderFormItem(c, _objectSpread2(_objectSpread2({}, c), {}, {
8412
8403
  formItemProps: c.formItemProps,
8413
8404
  fieldProps: c.fieldProps,
8414
- columnsFields: columnsFields,
8415
- columnsFieldsRef: columnsFieldsRef
8405
+ columnsFields: columnsFields // columnsFieldsRef,
8406
+
8416
8407
  }), form);
8417
8408
  return baseitem ? /*#__PURE__*/React.createElement(_Col, _objectSpread2(_objectSpread2({
8418
8409
  style: {
@@ -8509,7 +8500,7 @@ var WForm = function WForm(props, ref) {
8509
8500
  }, c.fieldProps))));
8510
8501
  }
8511
8502
  });
8512
- }, [changedValues, extraColumns, disabled, columnsFieldsRef, JSON.stringify(form.getFieldsValue())]);
8503
+ }, [changedValues, extraColumns, disabled, JSON.stringify(columnsFields), JSON.stringify(form.getFieldsValue())]);
8513
8504
 
8514
8505
  var handleSearch = function handleSearch(v) {
8515
8506
  var searchForm = form.getFieldsValue();
package/dist/index.js CHANGED
@@ -7583,9 +7583,8 @@ var WForm = function WForm(props, ref) {
7583
7583
 
7584
7584
  var _Form$useForm = _Form__default['default'].useForm(),
7585
7585
  _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
7586
- form = _Form$useForm2[0];
7586
+ form = _Form$useForm2[0]; // const columnsFieldsRef = useRef<any>({});
7587
7587
 
7588
- var columnsFieldsRef = React.useRef({});
7589
7588
 
7590
7589
  var _useState = React.useState({}),
7591
7590
  _useState2 = _slicedToArray(_useState, 2),
@@ -7658,10 +7657,9 @@ var WForm = function WForm(props, ref) {
7658
7657
  placeholder: "\u8BF7\u9009\u62E9",
7659
7658
  disabled: disabled,
7660
7659
  onLoad: function onLoad(opt) {
7661
- if (columnsFieldsRef.current) {
7662
- columnsFieldsRef.current[c.dataIndex] = opt;
7663
- }
7664
-
7660
+ // if (columnsFieldsRef.current) {
7661
+ // columnsFieldsRef.current[c.dataIndex] = opt;
7662
+ // }
7665
7663
  setColumnsFields(function (preColumnsFields) {
7666
7664
  return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, opt));
7667
7665
  });
@@ -7799,11 +7797,10 @@ var WForm = function WForm(props, ref) {
7799
7797
 
7800
7798
  if (c.options) {
7801
7799
  options = c.options;
7802
- }
7800
+ } // if (columnsFieldsRef.current) {
7801
+ // columnsFieldsRef.current[c.dataIndex] = options;
7802
+ // }
7803
7803
 
7804
- if (columnsFieldsRef.current) {
7805
- columnsFieldsRef.current[c.dataIndex] = options;
7806
- }
7807
7804
 
7808
7805
  setColumnsFields(function (preColumnsFields) {
7809
7806
  return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, options));
@@ -7849,11 +7846,10 @@ var WForm = function WForm(props, ref) {
7849
7846
  value: _key
7850
7847
  });
7851
7848
  }
7852
- }
7849
+ } // if (columnsFieldsRef.current) {
7850
+ // columnsFieldsRef.current[c.dataIndex] = options;
7851
+ // }
7853
7852
 
7854
- if (columnsFieldsRef.current) {
7855
- columnsFieldsRef.current[c.dataIndex] = _options;
7856
- }
7857
7853
 
7858
7854
  setColumnsFields(function (preColumnsFields) {
7859
7855
  return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, _options));
@@ -7913,11 +7909,10 @@ var WForm = function WForm(props, ref) {
7913
7909
  _labelCol6.style = {
7914
7910
  width: search.labelWidth
7915
7911
  };
7916
- }
7912
+ } // if (columnsFieldsRef.current) {
7913
+ // columnsFieldsRef.current[c.dataIndex] = options;
7914
+ // }
7917
7915
 
7918
- if (columnsFieldsRef.current) {
7919
- columnsFieldsRef.current[c.dataIndex] = _options2;
7920
- }
7921
7916
 
7922
7917
  setColumnsFields(function (preColumnsFields) {
7923
7918
  return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, _options2));
@@ -7977,8 +7972,8 @@ var WForm = function WForm(props, ref) {
7977
7972
  var baseitem = c.renderFormItem(c, _objectSpread2(_objectSpread2({}, c), {}, {
7978
7973
  formItemProps: c.formItemProps,
7979
7974
  fieldProps: c.fieldProps,
7980
- columnsFields: columnsFields,
7981
- columnsFieldsRef: columnsFieldsRef
7975
+ columnsFields: columnsFields // columnsFieldsRef,
7976
+
7982
7977
  }), form);
7983
7978
  return baseitem ? /*#__PURE__*/React__default['default'].createElement(_Col__default['default'], _objectSpread2(_objectSpread2({
7984
7979
  style: {
@@ -8075,7 +8070,7 @@ var WForm = function WForm(props, ref) {
8075
8070
  }, c.fieldProps))));
8076
8071
  }
8077
8072
  });
8078
- }, [changedValues, columns, disabled, columnsFieldsRef, JSON.stringify(form.getFieldsValue())]);
8073
+ }, [changedValues, columns, disabled, JSON.stringify(columnsFields), JSON.stringify(form.getFieldsValue())]);
8079
8074
  var filterExtraColumnsForm = React.useMemo(function () {
8080
8075
  return filterExtraFormColumns.map(function (c) {
8081
8076
  var colProps = {};
@@ -8125,10 +8120,9 @@ var WForm = function WForm(props, ref) {
8125
8120
  placeholder: "\u8BF7\u9009\u62E9",
8126
8121
  disabled: disabled,
8127
8122
  onLoad: function onLoad(opt) {
8128
- if (columnsFieldsRef.current) {
8129
- columnsFieldsRef.current[c.dataIndex] = opt;
8130
- }
8131
-
8123
+ // if (columnsFieldsRef.current) {
8124
+ // columnsFieldsRef.current[c.dataIndex] = opt;
8125
+ // }
8132
8126
  setColumnsFields(function (preColumnsFields) {
8133
8127
  return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, opt));
8134
8128
  });
@@ -8266,11 +8260,10 @@ var WForm = function WForm(props, ref) {
8266
8260
 
8267
8261
  if (c.options) {
8268
8262
  options = c.options;
8269
- }
8263
+ } // if (columnsFieldsRef.current) {
8264
+ // columnsFieldsRef.current[c.dataIndex] = options;
8265
+ // }
8270
8266
 
8271
- if (columnsFieldsRef.current) {
8272
- columnsFieldsRef.current[c.dataIndex] = options;
8273
- }
8274
8267
 
8275
8268
  setColumnsFields(function (preColumnsFields) {
8276
8269
  return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, options));
@@ -8316,11 +8309,10 @@ var WForm = function WForm(props, ref) {
8316
8309
  value: _key3
8317
8310
  });
8318
8311
  }
8319
- }
8312
+ } // if (columnsFieldsRef.current) {
8313
+ // columnsFieldsRef.current[c.dataIndex] = options;
8314
+ // }
8320
8315
 
8321
- if (columnsFieldsRef.current) {
8322
- columnsFieldsRef.current[c.dataIndex] = _options3;
8323
- }
8324
8316
 
8325
8317
  setColumnsFields(function (preColumnsFields) {
8326
8318
  return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, _options3));
@@ -8380,11 +8372,10 @@ var WForm = function WForm(props, ref) {
8380
8372
  _labelCol17.style = {
8381
8373
  width: search.labelWidth
8382
8374
  };
8383
- }
8375
+ } // if (columnsFieldsRef.current) {
8376
+ // columnsFieldsRef.current[c.dataIndex] = options;
8377
+ // }
8384
8378
 
8385
- if (columnsFieldsRef.current) {
8386
- columnsFieldsRef.current[c.dataIndex] = _options4;
8387
- }
8388
8379
 
8389
8380
  setColumnsFields(function (preColumnsFields) {
8390
8381
  return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, _options4));
@@ -8444,8 +8435,8 @@ var WForm = function WForm(props, ref) {
8444
8435
  var baseitem = c.renderFormItem(c, _objectSpread2(_objectSpread2({}, c), {}, {
8445
8436
  formItemProps: c.formItemProps,
8446
8437
  fieldProps: c.fieldProps,
8447
- columnsFields: columnsFields,
8448
- columnsFieldsRef: columnsFieldsRef
8438
+ columnsFields: columnsFields // columnsFieldsRef,
8439
+
8449
8440
  }), form);
8450
8441
  return baseitem ? /*#__PURE__*/React__default['default'].createElement(_Col__default['default'], _objectSpread2(_objectSpread2({
8451
8442
  style: {
@@ -8542,7 +8533,7 @@ var WForm = function WForm(props, ref) {
8542
8533
  }, c.fieldProps))));
8543
8534
  }
8544
8535
  });
8545
- }, [changedValues, extraColumns, disabled, columnsFieldsRef, JSON.stringify(form.getFieldsValue())]);
8536
+ }, [changedValues, extraColumns, disabled, JSON.stringify(columnsFields), JSON.stringify(form.getFieldsValue())]);
8546
8537
 
8547
8538
  var handleSearch = function handleSearch(v) {
8548
8539
  var searchForm = form.getFieldsValue();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "wargerm",
4
- "version": "0.2.13",
4
+ "version": "0.2.14",
5
5
  "scripts": {
6
6
  "dev": "dumi dev",
7
7
  "docs:build": "dumi build",