wargerm 0.7.67 → 0.7.68

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.
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
- import { CheckboxProps, CheckboxGroupProps } from 'antd/lib/Checkbox';
2
+ import { CheckboxProps } from 'antd';
3
+ import { CheckboxGroupProps } from 'antd/es/checkbox';
3
4
  export interface ICheckbox extends CheckboxProps {
4
5
  }
5
6
  export type IndexComponent = React.FC<ICheckbox> & {
@@ -0,0 +1,10 @@
1
+ import { FC } from 'react';
2
+ import { CheckboxGroupProps } from 'antd/es/checkbox';
3
+ export interface ICheckboxGroup extends CheckboxGroupProps {
4
+ request?: () => Promise<any>;
5
+ valueEnum?: Record<string, any>;
6
+ params?: Record<string, any>;
7
+ onLoad?: (options: Record<string, any>[]) => void;
8
+ }
9
+ declare const WCheckboxGroup: FC<ICheckboxGroup>;
10
+ export default WCheckboxGroup;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { RadioProps, RadioGroupProps } from 'antd/lib/Radio';
2
+ import { RadioProps, RadioGroupProps } from 'antd';
3
3
  export interface IRadio extends RadioProps {
4
4
  sideButtonStyle?: string;
5
5
  }
@@ -0,0 +1,10 @@
1
+ import { FC } from 'react';
2
+ import { RadioGroupProps } from 'antd';
3
+ export interface IRadioGroup extends RadioGroupProps {
4
+ request?: () => Promise<any>;
5
+ valueEnum?: Record<string, any>;
6
+ params?: Record<string, any>;
7
+ onLoad?: (options: Record<string, any>[]) => void;
8
+ }
9
+ declare const WRadioGroup: FC<IRadioGroup>;
10
+ export default WRadioGroup;
@@ -1,5 +1,5 @@
1
1
  import React, { ReactNode } from 'react';
2
- import { SelectProps, OptionProps } from 'antd/lib/Select';
2
+ import { OptionProps, SelectProps } from 'antd/es/select';
3
3
  export interface IOptionProps extends OptionProps {
4
4
  }
5
5
  export interface ISelect extends SelectProps<any> {
package/dist/index.d.ts CHANGED
@@ -16,7 +16,9 @@ export { default as Upload } from './components/Upload';
16
16
  export { default as InputNumber } from './components/InputNumber';
17
17
  export { default as Table } from './components/Table';
18
18
  export { default as Checkbox } from './components/Checkbox';
19
+ export { default as CheckboxGroup } from './components/CheckboxGroup';
19
20
  export { default as Radio } from './components/Radio';
21
+ export { default as RadioGroup } from './components/RadioGroup';
20
22
  export { default as Select } from './components/Select';
21
23
  export { default as RequestRenderDom } from './components/RequestRenderDom';
22
24
  export { default as DatePicker } from './components/DatePicker';
package/dist/index.esm.js CHANGED
@@ -8,6 +8,7 @@ import classnames from 'classnames';
8
8
  import zhCN from 'antd/es/date-picker/locale/zh_CN';
9
9
  import dayjs, { extend, weekdaysMin } from 'dayjs';
10
10
  import 'dayjs/locale/zh-cn';
11
+ import { Checkbox as Checkbox$1 } from 'antd/lib';
11
12
  import CountUp from 'react-countup';
12
13
  import { Swiper, SwiperSlide } from 'swiper/react';
13
14
  import SwiperCore, { Pagination as Pagination$1, Navigation, Autoplay, Virtual } from 'swiper';
@@ -3299,7 +3300,145 @@ var WCascader = function WCascader(props) {
3299
3300
  }, extraProps));
3300
3301
  };
3301
3302
 
3302
- var _excluded$9 = ["columns", "extraColumns", "className", "style", "search", "disabled", "disabledHideInSearch", "disabledRuler", "onFormChange", "onSubmit", "onReset", "setForm", "deps"];
3303
+ var _excluded$9 = ["request", "valueEnum", "onLoad", "params"];
3304
+ var WRadioGroup = function WRadioGroup(props) {
3305
+ var request = props.request,
3306
+ valueEnum = props.valueEnum,
3307
+ onLoad = props.onLoad,
3308
+ params = props.params,
3309
+ extraProps = _objectWithoutProperties(props, _excluded$9);
3310
+ var _useState = useState([]),
3311
+ _useState2 = _slicedToArray(_useState, 2),
3312
+ options = _useState2[0],
3313
+ setOptions = _useState2[1];
3314
+ useEffect(function () {
3315
+ var isMounted = true;
3316
+ _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
3317
+ var res;
3318
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
3319
+ while (1) switch (_context.prev = _context.next) {
3320
+ case 0:
3321
+ if (!request) {
3322
+ _context.next = 8;
3323
+ break;
3324
+ }
3325
+ _context.next = 3;
3326
+ return request();
3327
+ case 3:
3328
+ res = _context.sent;
3329
+ if (isMounted) {
3330
+ _context.next = 6;
3331
+ break;
3332
+ }
3333
+ return _context.abrupt("return");
3334
+ case 6:
3335
+ setOptions(res);
3336
+ onLoad && onLoad(res);
3337
+ case 8:
3338
+ case "end":
3339
+ return _context.stop();
3340
+ }
3341
+ }, _callee);
3342
+ }))();
3343
+ var valueEnumOptions = [];
3344
+ if (valueEnum) {
3345
+ for (var key in valueEnum) {
3346
+ var text = '';
3347
+ if (typeof valueEnum[key] === 'string') {
3348
+ text = valueEnum[key];
3349
+ } else {
3350
+ var _valueEnum$key;
3351
+ text = (_valueEnum$key = valueEnum[key]) === null || _valueEnum$key === void 0 ? void 0 : _valueEnum$key.text;
3352
+ }
3353
+ valueEnumOptions.push({
3354
+ label: text,
3355
+ value: key
3356
+ });
3357
+ }
3358
+ }
3359
+ if (!isMounted) return;
3360
+ onLoad && onLoad(valueEnumOptions);
3361
+ setOptions(valueEnumOptions);
3362
+ return function () {
3363
+ isMounted = false;
3364
+ };
3365
+ }, [JSON.stringify(params || {})]);
3366
+ return /*#__PURE__*/React.createElement(Radio.Group, _objectSpread2({
3367
+ options: options
3368
+ }, extraProps));
3369
+ };
3370
+ WRadioGroup.defaultProps = {};
3371
+
3372
+ var _excluded$a = ["request", "valueEnum", "onLoad", "params"];
3373
+ var WCheckboxGroup = function WCheckboxGroup(props) {
3374
+ var request = props.request,
3375
+ valueEnum = props.valueEnum,
3376
+ onLoad = props.onLoad,
3377
+ params = props.params,
3378
+ extraProps = _objectWithoutProperties(props, _excluded$a);
3379
+ var _useState = useState([]),
3380
+ _useState2 = _slicedToArray(_useState, 2),
3381
+ options = _useState2[0],
3382
+ setOptions = _useState2[1];
3383
+ useEffect(function () {
3384
+ var isMounted = true;
3385
+ _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
3386
+ var res;
3387
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
3388
+ while (1) switch (_context.prev = _context.next) {
3389
+ case 0:
3390
+ if (!request) {
3391
+ _context.next = 8;
3392
+ break;
3393
+ }
3394
+ _context.next = 3;
3395
+ return request();
3396
+ case 3:
3397
+ res = _context.sent;
3398
+ if (isMounted) {
3399
+ _context.next = 6;
3400
+ break;
3401
+ }
3402
+ return _context.abrupt("return");
3403
+ case 6:
3404
+ setOptions(res);
3405
+ onLoad && onLoad(res);
3406
+ case 8:
3407
+ case "end":
3408
+ return _context.stop();
3409
+ }
3410
+ }, _callee);
3411
+ }))();
3412
+ var valueEnumOptions = [];
3413
+ if (valueEnum) {
3414
+ for (var key in valueEnum) {
3415
+ var text = '';
3416
+ if (typeof valueEnum[key] === 'string') {
3417
+ text = valueEnum[key];
3418
+ } else {
3419
+ var _valueEnum$key;
3420
+ text = (_valueEnum$key = valueEnum[key]) === null || _valueEnum$key === void 0 ? void 0 : _valueEnum$key.text;
3421
+ }
3422
+ valueEnumOptions.push({
3423
+ label: text,
3424
+ value: key
3425
+ });
3426
+ }
3427
+ }
3428
+ if (!isMounted) return;
3429
+ onLoad && onLoad(valueEnumOptions);
3430
+ setOptions(valueEnumOptions);
3431
+ return function () {
3432
+ isMounted = false;
3433
+ };
3434
+ }, [JSON.stringify(params || {})]);
3435
+ return /*#__PURE__*/React.createElement(Checkbox$1.Group, _objectSpread2({
3436
+ options: options
3437
+ }, extraProps));
3438
+ };
3439
+ WCheckboxGroup.defaultProps = {};
3440
+
3441
+ var _excluded$b = ["columns", "extraColumns", "className", "style", "search", "disabled", "disabledHideInSearch", "disabledRuler", "onFormChange", "onSubmit", "onReset", "setForm", "deps"];
3303
3442
  var RangePicker$2 = Index$6.RangePicker;
3304
3443
  var WForm = function WForm(props, ref) {
3305
3444
  var columns = props.columns,
@@ -3315,7 +3454,7 @@ var WForm = function WForm(props, ref) {
3315
3454
  onReset = props.onReset,
3316
3455
  setForm = props.setForm,
3317
3456
  deps = props.deps,
3318
- extraProps = _objectWithoutProperties(props, _excluded$9);
3457
+ extraProps = _objectWithoutProperties(props, _excluded$b);
3319
3458
  var _Form$useForm = Form.useForm(),
3320
3459
  _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
3321
3460
  form = _Form$useForm2[0];
@@ -3544,31 +3683,25 @@ var WForm = function WForm(props, ref) {
3544
3683
  disabled: disabled
3545
3684
  }, _showTime), c.fieldProps))));
3546
3685
  } else if (c.valueType === 'checkbox') {
3547
- var options = [];
3548
- if (c.valueEnum) {
3549
- for (var key in c.valueEnum) {
3550
- var text = c.valueEnum[key].text;
3551
- options.push({
3552
- label: text,
3553
- value: key
3554
- });
3555
- }
3556
- }
3557
- if (c.options) {
3558
- options = c.options;
3686
+ var _extraProps4 = {};
3687
+ if (c.request) {
3688
+ _extraProps4.request = c.request;
3689
+ } else if (c.valueEnum) {
3690
+ _extraProps4.valueEnum = c.valueEnum;
3691
+ } else {
3692
+ _extraProps4.options = c.options;
3559
3693
  }
3560
- // if (columnsFieldsRef.current) {
3561
- // columnsFieldsRef.current[c.dataIndex] = options;
3562
- // }
3563
- setColumnsFields(function (preColumnsFields) {
3564
- return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, options));
3565
- });
3566
3694
  var _labelCol6 = {};
3567
3695
  if (search && search.labelWidth) {
3568
3696
  _labelCol6.style = {
3569
3697
  width: search.labelWidth
3570
3698
  };
3571
3699
  }
3700
+ if (c.options) {
3701
+ setColumnsFields(function (preColumnsFields) {
3702
+ return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, c.options));
3703
+ });
3704
+ }
3572
3705
  return /*#__PURE__*/React.createElement(Col, _objectSpread2(_objectSpread2({
3573
3706
  className: "pl12 pr12"
3574
3707
  }, colProps), {}, {
@@ -3579,30 +3712,23 @@ var WForm = function WForm(props, ref) {
3579
3712
  name: c.dataIndex,
3580
3713
  label: c.title,
3581
3714
  labelCol: _labelCol6
3582
- }), /*#__PURE__*/React.createElement(Index$4.Group, _objectSpread2({
3583
- disabled: disabled,
3584
- options: options
3585
- }, c.fieldProps))));
3586
- } else if (c.valueType === 'radio' || c.valueType === 'radioButton') {
3587
- var _options = [];
3588
- if (c.options) {
3589
- _options = c.options;
3590
- }
3591
- if (c.valueEnum) {
3592
- for (var _key in c.valueEnum) {
3593
- var _text = c.valueEnum[_key].text;
3594
- _options.push({
3595
- label: _text,
3596
- value: _key
3715
+ }), /*#__PURE__*/React.createElement(WCheckboxGroup, _objectSpread2(_objectSpread2({
3716
+ onLoad: function onLoad(opt) {
3717
+ setColumnsFields(function (preColumnsFields) {
3718
+ return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, opt));
3597
3719
  });
3598
- }
3720
+ },
3721
+ disabled: disabled
3722
+ }, c.fieldProps), _extraProps4))));
3723
+ } else if (c.valueType === 'radio' || c.valueType === 'radioButton') {
3724
+ var _extraProps5 = {};
3725
+ if (c.request) {
3726
+ _extraProps5.request = c.request;
3727
+ } else if (c.valueEnum) {
3728
+ _extraProps5.valueEnum = c.valueEnum;
3729
+ } else {
3730
+ _extraProps5.options = c.options;
3599
3731
  }
3600
- // if (columnsFieldsRef.current) {
3601
- // columnsFieldsRef.current[c.dataIndex] = options;
3602
- // }
3603
- setColumnsFields(function (preColumnsFields) {
3604
- return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, _options));
3605
- });
3606
3732
  var _labelCol7 = {};
3607
3733
  if (search && search.labelWidth) {
3608
3734
  _labelCol7.style = {
@@ -3616,6 +3742,11 @@ var WForm = function WForm(props, ref) {
3616
3742
  buttonStyle: 'solid'
3617
3743
  };
3618
3744
  }
3745
+ if (c.options) {
3746
+ setColumnsFields(function (preColumnsFields) {
3747
+ return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, c.options));
3748
+ });
3749
+ }
3619
3750
  return /*#__PURE__*/React.createElement(Col, _objectSpread2(_objectSpread2({
3620
3751
  className: "pl12 pr12"
3621
3752
  }, colProps), {}, {
@@ -3626,19 +3757,22 @@ var WForm = function WForm(props, ref) {
3626
3757
  name: c.dataIndex,
3627
3758
  label: c.title,
3628
3759
  labelCol: _labelCol7
3629
- }), /*#__PURE__*/React.createElement(Index$3.Group, _objectSpread2(_objectSpread2({
3760
+ }), /*#__PURE__*/React.createElement(WRadioGroup, _objectSpread2(_objectSpread2(_objectSpread2({
3761
+ onLoad: function onLoad(opt) {
3762
+ setColumnsFields(function (preColumnsFields) {
3763
+ return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, opt));
3764
+ });
3765
+ },
3630
3766
  disabled: disabled
3631
- }, radioButtonProps), {}, {
3632
- options: _options
3633
- }, c.fieldProps))));
3767
+ }, radioButtonProps), c.fieldProps), _extraProps5))));
3634
3768
  } else if (c.valueType === 'switch') {
3635
- var _options2 = [];
3769
+ var options = [];
3636
3770
  if (c.valueEnum) {
3637
- for (var _key2 in c.valueEnum) {
3638
- var _text2 = c.valueEnum[_key2].text;
3639
- _options2.push({
3640
- label: _text2,
3641
- value: _key2
3771
+ for (var key in c.valueEnum) {
3772
+ var text = c.valueEnum[key].text;
3773
+ options.push({
3774
+ label: text,
3775
+ value: key
3642
3776
  });
3643
3777
  }
3644
3778
  }
@@ -3652,7 +3786,7 @@ var WForm = function WForm(props, ref) {
3652
3786
  // columnsFieldsRef.current[c.dataIndex] = options;
3653
3787
  // }
3654
3788
  setColumnsFields(function (preColumnsFields) {
3655
- return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, _options2));
3789
+ return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, options));
3656
3790
  });
3657
3791
  return /*#__PURE__*/React.createElement(Col, _objectSpread2(_objectSpread2({
3658
3792
  className: "pl12 pr12"
@@ -4011,7 +4145,7 @@ var WForm = function WForm(props, ref) {
4011
4145
  };
4012
4146
  var WForm$1 = /*#__PURE__*/React.forwardRef(WForm);
4013
4147
 
4014
- var _excluded$a = ["columns", "dataSource", "request", "onLoad", "params", "onSubmit", "rowKey", "onRow", "className", "rowClassName", "rowSelection", "style", "tbodyStyle", "thStyle", "border", "scroll", "pagination", "search", "frameBoxTable", "frameBoxDirection", "formRef", "none"];
4148
+ var _excluded$c = ["columns", "dataSource", "request", "onLoad", "params", "onSubmit", "rowKey", "onRow", "className", "rowClassName", "rowSelection", "style", "tbodyStyle", "thStyle", "border", "scroll", "pagination", "search", "frameBoxTable", "frameBoxDirection", "formRef", "none"];
4015
4149
  function Table(_ref) {
4016
4150
  var _formSearchRef$curren4, _columns$, _columns$2;
4017
4151
  var columns = _ref.columns,
@@ -4042,7 +4176,7 @@ function Table(_ref) {
4042
4176
  frameBoxDirection = _ref$frameBoxDirectio === void 0 ? 'out' : _ref$frameBoxDirectio,
4043
4177
  formRef = _ref.formRef,
4044
4178
  none = _ref.none,
4045
- props = _objectWithoutProperties(_ref, _excluded$a);
4179
+ props = _objectWithoutProperties(_ref, _excluded$c);
4046
4180
  var _useState = useState(_toConsumableArray((rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRowKeys) || [])),
4047
4181
  _useState2 = _slicedToArray(_useState, 2),
4048
4182
  selectedRowKeys = _useState2[0],
@@ -4529,7 +4663,7 @@ Table.defaultProps = {
4529
4663
  };
4530
4664
  var index = /*#__PURE__*/memo(Table);
4531
4665
 
4532
- var _excluded$b = ["value", "renderDom", "onLoad", "params", "onChange", "request"];
4666
+ var _excluded$d = ["value", "renderDom", "onLoad", "params", "onChange", "request"];
4533
4667
  function Index$8(props, ref) {
4534
4668
  var value = props.value,
4535
4669
  renderDom = props.renderDom,
@@ -4537,7 +4671,7 @@ function Index$8(props, ref) {
4537
4671
  params = props.params,
4538
4672
  onChange = props.onChange,
4539
4673
  request = props.request,
4540
- rest = _objectWithoutProperties(props, _excluded$b);
4674
+ rest = _objectWithoutProperties(props, _excluded$d);
4541
4675
  var _useState = useState(''),
4542
4676
  _useState2 = _slicedToArray(_useState, 2),
4543
4677
  areaValue = _useState2[0],
@@ -4592,7 +4726,7 @@ function Index$8(props, ref) {
4592
4726
  }
4593
4727
  var index$1 = /*#__PURE__*/React.forwardRef(Index$8);
4594
4728
 
4595
- var _excluded$c = ["height", "width", "count", "style", "numberStyle"],
4729
+ var _excluded$e = ["height", "width", "count", "style", "numberStyle"],
4596
4730
  _excluded2$2 = ["count", "numberCount", "width", "height", "marginRight"];
4597
4731
  var Number$1 = function Number(_ref) {
4598
4732
  var height = _ref.height,
@@ -4601,7 +4735,7 @@ var Number$1 = function Number(_ref) {
4601
4735
  count = _ref$count === void 0 ? 0 : _ref$count,
4602
4736
  style = _ref.style,
4603
4737
  numberStyle = _ref.numberStyle,
4604
- props = _objectWithoutProperties(_ref, _excluded$c);
4738
+ props = _objectWithoutProperties(_ref, _excluded$e);
4605
4739
  // 上次的值
4606
4740
  var _useState = useState(0),
4607
4741
  _useState2 = _slicedToArray(_useState, 2),
@@ -4751,12 +4885,12 @@ var Index$9 = function Index(props) {
4751
4885
  }));
4752
4886
  };
4753
4887
 
4754
- var _excluded$d = ["duration", "className"];
4888
+ var _excluded$f = ["duration", "className"];
4755
4889
  var Index$a = function Index(props) {
4756
4890
  var _props$duration = props.duration,
4757
4891
  duration = _props$duration === void 0 ? 2.75 : _props$duration,
4758
4892
  className = props.className,
4759
- extraProps = _objectWithoutProperties(props, _excluded$d);
4893
+ extraProps = _objectWithoutProperties(props, _excluded$f);
4760
4894
  return /*#__PURE__*/React.createElement(CountUp, _objectSpread2(_objectSpread2({
4761
4895
  duration: duration
4762
4896
  }, extraProps), {}, {
@@ -4765,7 +4899,7 @@ var Index$a = function Index(props) {
4765
4899
  };
4766
4900
  Index$a.defaultProps = {};
4767
4901
 
4768
- var _excluded$e = ["list", "render", "none", "partSize"];
4902
+ var _excluded$g = ["list", "render", "none", "partSize"];
4769
4903
  function AutoScroll(props) {
4770
4904
  var inner1 = useRef();
4771
4905
  var inner2 = useRef();
@@ -4842,7 +4976,7 @@ var Index$b = function Index(_ref) {
4842
4976
  none = _ref.none,
4843
4977
  _ref$partSize = _ref.partSize,
4844
4978
  partSize = _ref$partSize === void 0 ? 4 : _ref$partSize,
4845
- otherProps = _objectWithoutProperties(_ref, _excluded$e);
4979
+ otherProps = _objectWithoutProperties(_ref, _excluded$g);
4846
4980
  var _useState = useState([]),
4847
4981
  _useState2 = _slicedToArray(_useState, 2),
4848
4982
  partA = _useState2[0],
@@ -4916,7 +5050,7 @@ var Index$b = function Index(_ref) {
4916
5050
  }, none || '暂无数据'));
4917
5051
  };
4918
5052
 
4919
- var _excluded$f = ["data", "onClick", "slidesPerView", "rowKey", "onSwiperChange", "renderItem", "noMove"];
5053
+ var _excluded$h = ["data", "onClick", "slidesPerView", "rowKey", "onSwiperChange", "renderItem", "noMove"];
4920
5054
  // install Swiper modules
4921
5055
  SwiperCore.use([Pagination$1, Navigation, Autoplay, Virtual]);
4922
5056
  var Index$c = /*#__PURE__*/forwardRef(function (props, ref) {
@@ -4928,7 +5062,7 @@ var Index$c = /*#__PURE__*/forwardRef(function (props, ref) {
4928
5062
  onSwiperChange = props.onSwiperChange,
4929
5063
  renderItem = props.renderItem,
4930
5064
  noMove = props.noMove,
4931
- extraProps = _objectWithoutProperties(props, _excluded$f);
5065
+ extraProps = _objectWithoutProperties(props, _excluded$h);
4932
5066
  var _useState = useState(null),
4933
5067
  _useState2 = _slicedToArray(_useState, 2),
4934
5068
  controlledSwiper = _useState2[0],
@@ -5577,7 +5711,7 @@ function createBrowserHistory(props) {
5577
5711
  return history;
5578
5712
  }
5579
5713
 
5580
- var _excluded$g = ["routes", "className"];
5714
+ var _excluded$i = ["routes", "className"];
5581
5715
  var history = createBrowserHistory();
5582
5716
  function itemRender(route, params, routes, paths) {
5583
5717
  var last = routes.indexOf(route) === routes.length - 1;
@@ -5593,7 +5727,7 @@ function itemRender(route, params, routes, paths) {
5593
5727
  var Index$d = function Index(_ref) {
5594
5728
  var routes = _ref.routes,
5595
5729
  className = _ref.className,
5596
- props = _objectWithoutProperties(_ref, _excluded$g);
5730
+ props = _objectWithoutProperties(_ref, _excluded$i);
5597
5731
  return /*#__PURE__*/React.createElement(Breadcrumb, _objectSpread2({
5598
5732
  className: className || 'default',
5599
5733
  separator: ">>",
@@ -5602,7 +5736,7 @@ var Index$d = function Index(_ref) {
5602
5736
  }, props));
5603
5737
  };
5604
5738
 
5605
- var _excluded$h = ["title", "className", "headerTail", "headerCenter", "sliderTabs"];
5739
+ var _excluded$j = ["title", "className", "headerTail", "headerCenter", "sliderTabs"];
5606
5740
  var Index$e = function Index(_ref, ref) {
5607
5741
  var _sliderTabs$component, _sliderTabs$tabs;
5608
5742
  var title = _ref.title,
@@ -5611,7 +5745,7 @@ var Index$e = function Index(_ref, ref) {
5611
5745
  headerTail = _ref.headerTail,
5612
5746
  headerCenter = _ref.headerCenter,
5613
5747
  sliderTabs = _ref.sliderTabs,
5614
- props = _objectWithoutProperties(_ref, _excluded$h);
5748
+ props = _objectWithoutProperties(_ref, _excluded$j);
5615
5749
  useImperativeHandle(ref, function () {
5616
5750
  return {
5617
5751
  activeTab: activeTab
@@ -5827,7 +5961,7 @@ function DialogModel(props, ref) {
5827
5961
  }
5828
5962
  var Dialog = /*#__PURE__*/React.forwardRef(DialogModel);
5829
5963
 
5830
- var _excluded$i = ["open", "width", "closeCb", "onClose", "className", "style", "isDrag", "wrapClassName"],
5964
+ var _excluded$k = ["open", "width", "closeCb", "onClose", "className", "style", "isDrag", "wrapClassName"],
5831
5965
  _excluded2$3 = ["open"];
5832
5966
  var Modal = /*#__PURE__*/function (_React$PureComponent) {
5833
5967
  _inherits(Modal, _React$PureComponent);
@@ -5959,7 +6093,7 @@ var Modal = /*#__PURE__*/function (_React$PureComponent) {
5959
6093
  style = _this$props4.style,
5960
6094
  isDrag = _this$props4.isDrag,
5961
6095
  wrapClassName = _this$props4.wrapClassName,
5962
- other = _objectWithoutProperties(_this$props4, _excluded$i);
6096
+ other = _objectWithoutProperties(_this$props4, _excluded$k);
5963
6097
  return /*#__PURE__*/React.createElement(Dialog, _objectSpread2({
5964
6098
  ref: this.containerRef,
5965
6099
  closeCb: closeCb,
@@ -6124,7 +6258,7 @@ function DialogModel$1(props) {
6124
6258
  return renderChildren;
6125
6259
  }
6126
6260
 
6127
- var _excluded$j = ["open"];
6261
+ var _excluded$l = ["open"];
6128
6262
  var Modal$1 = /*#__PURE__*/function (_React$PureComponent) {
6129
6263
  _inherits(Modal, _React$PureComponent);
6130
6264
  var _super = _createSuper(Modal);
@@ -6246,7 +6380,7 @@ Modal$1.show = function (config) {
6246
6380
  setShow = _useState2[1];
6247
6381
  manager.setShow = setShow;
6248
6382
  var open = props.open,
6249
- trueProps = _objectWithoutProperties(props, _excluded$j);
6383
+ trueProps = _objectWithoutProperties(props, _excluded$l);
6250
6384
  useEffect(function () {
6251
6385
  manager.mounted = true;
6252
6386
  setShow(open);
@@ -6418,7 +6552,7 @@ function DragBox(_ref) {
6418
6552
  }, children))) : ( /*#__PURE__*/React.createElement(React.Fragment, null));
6419
6553
  }
6420
6554
 
6421
- var _excluded$k = ["columns", "extraColumns", "search", "open", "setOpen", "modalFormOpend", "disabled", "submitMethod", "onSubmitSuccess", "title", "record", "onFormChange", "formItemChild", "onCancel", "modalHeaderSlot", "modalFooterSlot", "formProps"];
6555
+ var _excluded$m = ["columns", "extraColumns", "search", "open", "setOpen", "modalFormOpend", "disabled", "submitMethod", "onSubmitSuccess", "title", "record", "onFormChange", "formItemChild", "onCancel", "modalHeaderSlot", "modalFooterSlot", "formProps"];
6422
6556
  var ModalForm = function ModalForm(props, ref) {
6423
6557
  var columns = props.columns,
6424
6558
  extraColumns = props.extraColumns,
@@ -6437,7 +6571,7 @@ var ModalForm = function ModalForm(props, ref) {
6437
6571
  modalHeaderSlot = props.modalHeaderSlot,
6438
6572
  modalFooterSlot = props.modalFooterSlot,
6439
6573
  formProps = props.formProps,
6440
- extraProps = _objectWithoutProperties(props, _excluded$k);
6574
+ extraProps = _objectWithoutProperties(props, _excluded$m);
6441
6575
  var formRef = useRef(null);
6442
6576
  var _useState = useState(false),
6443
6577
  _useState2 = _slicedToArray(_useState, 2),
@@ -6562,7 +6696,7 @@ var ModalForm = function ModalForm(props, ref) {
6562
6696
  };
6563
6697
  var ModalForm$1 = /*#__PURE__*/React.forwardRef(ModalForm);
6564
6698
 
6565
- var _excluded$l = ["columns", "extraColumns", "request", "modalFormSearch", "search", "tableAction", "filterAction", "renderTableBar", "renderTableBarDeps", "className", "style", "onFormChange", "modalConfig", "searchFormConfig", "optionColumnConfig", "pagination", "noBordered", "showIndex", "searchTableSlot"];
6699
+ var _excluded$n = ["columns", "extraColumns", "request", "modalFormSearch", "search", "tableAction", "filterAction", "renderTableBar", "renderTableBarDeps", "className", "style", "onFormChange", "modalConfig", "searchFormConfig", "optionColumnConfig", "pagination", "noBordered", "showIndex", "searchTableSlot"];
6566
6700
  var TabelCard = function TabelCard(props, ref) {
6567
6701
  var columns = props.columns,
6568
6702
  extraColumns = props.extraColumns,
@@ -6586,7 +6720,7 @@ var TabelCard = function TabelCard(props, ref) {
6586
6720
  noBordered = props.noBordered,
6587
6721
  showIndex = props.showIndex,
6588
6722
  searchTableSlot = props.searchTableSlot,
6589
- extraProps = _objectWithoutProperties(props, _excluded$l);
6723
+ extraProps = _objectWithoutProperties(props, _excluded$n);
6590
6724
  var actionRef = useRef();
6591
6725
  var modalFormRef = useRef(null);
6592
6726
  var searchFormRef = useRef(null);
@@ -10842,7 +10976,7 @@ function DhPlayer(_ref, ref) {
10842
10976
  }
10843
10977
  var index$6 = /*#__PURE__*/forwardRef(DhPlayer);
10844
10978
 
10845
- var _excluded$m = ["id", "videoUrls", "definitionList", "isLoop", "muted", "currentIndex", "setCurrentIndex", "className", "style", "open", "autoplay", "videoInit", "enableMemory", "lastPlayTimeHideDelay"];
10979
+ var _excluded$o = ["id", "videoUrls", "definitionList", "isLoop", "muted", "currentIndex", "setCurrentIndex", "className", "style", "open", "autoplay", "videoInit", "enableMemory", "lastPlayTimeHideDelay"];
10846
10980
  // 默认速度控制
10847
10981
  var DEFAULT_PLAY_BACK_RATE = [0.5, 0.75, 1, 1.5, 2];
10848
10982
  // 默认记忆提示文字展示时长(s)
@@ -10873,7 +11007,7 @@ var index$7 = (function (_ref) {
10873
11007
  enableMemory = _ref$enableMemory === void 0 ? false : _ref$enableMemory,
10874
11008
  _ref$lastPlayTimeHide = _ref.lastPlayTimeHideDelay,
10875
11009
  lastPlayTimeHideDelay = _ref$lastPlayTimeHide === void 0 ? DEFAULT_LAST_PLAY_TIME_DELAY : _ref$lastPlayTimeHide,
10876
- props = _objectWithoutProperties(_ref, _excluded$m);
11010
+ props = _objectWithoutProperties(_ref, _excluded$o);
10877
11011
  var player = useRef();
10878
11012
  var currentPlayerIndex = useRef(0);
10879
11013
  // 内置的 index 状态管理
@@ -11043,7 +11177,7 @@ var index$7 = (function (_ref) {
11043
11177
  });
11044
11178
  });
11045
11179
 
11046
- var _excluded$n = ["className", "frameStyle", "style", "direction", "children"];
11180
+ var _excluded$p = ["className", "frameStyle", "style", "direction", "children"];
11047
11181
  function FrameBox$1(_ref) {
11048
11182
  var className = _ref.className,
11049
11183
  frameStyle = _ref.frameStyle,
@@ -11051,7 +11185,7 @@ function FrameBox$1(_ref) {
11051
11185
  _ref$direction = _ref.direction,
11052
11186
  direction = _ref$direction === void 0 ? 'in' : _ref$direction,
11053
11187
  children = _ref.children,
11054
- props = _objectWithoutProperties(_ref, _excluded$n);
11188
+ props = _objectWithoutProperties(_ref, _excluded$p);
11055
11189
  return /*#__PURE__*/React.createElement("div", _objectSpread2({
11056
11190
  className: classnames(_defineProperty(_defineProperty({}, 'frame', true), className || '', true)),
11057
11191
  style: style
@@ -11078,7 +11212,7 @@ function FrameBox$1(_ref) {
11078
11212
  }), children);
11079
11213
  }
11080
11214
 
11081
- var _excluded$o = ["columns", "dataSource", "request", "onLoad", "params", "onSubmit", "rowKey", "onRow", "className", "rowClassName", "rowSelection", "style", "tbodyStyle", "thStyle", "border", "scroll", "pagination", "search", "frameBoxTable", "frameBoxDirection", "formRef", "none"];
11215
+ var _excluded$q = ["columns", "dataSource", "request", "onLoad", "params", "onSubmit", "rowKey", "onRow", "className", "rowClassName", "rowSelection", "style", "tbodyStyle", "thStyle", "border", "scroll", "pagination", "search", "frameBoxTable", "frameBoxDirection", "formRef", "none"];
11082
11216
  function NtTable(_ref, ref) {
11083
11217
  var _formSearchRef$curren4, _columns$, _columns$2;
11084
11218
  var columns = _ref.columns,
@@ -11109,7 +11243,7 @@ function NtTable(_ref, ref) {
11109
11243
  frameBoxDirection = _ref$frameBoxDirectio === void 0 ? 'out' : _ref$frameBoxDirectio,
11110
11244
  formRef = _ref.formRef,
11111
11245
  none = _ref.none,
11112
- props = _objectWithoutProperties(_ref, _excluded$o);
11246
+ props = _objectWithoutProperties(_ref, _excluded$q);
11113
11247
  var _useState = useState(_toConsumableArray((rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRowKeys) || [])),
11114
11248
  _useState2 = _slicedToArray(_useState, 2),
11115
11249
  selectedRowKeys = _useState2[0],
@@ -12365,7 +12499,7 @@ function WaterLevelCharts(config) {
12365
12499
  /*
12366
12500
  * @Author: lijin
12367
12501
  * @Date: 2021-09-09 11:02:54
12368
- * @LastEditTime: 2023-09-18 17:44:13
12502
+ * @LastEditTime: 2023-12-25 19:04:08
12369
12503
  * @LastEditors: lijin
12370
12504
  * @Description:
12371
12505
  * @FilePath: \wargerm\src\index.ts
@@ -12377,4 +12511,4 @@ if (REACT_APP_ENV == 'development') {
12377
12511
  document.documentElement.setAttribute(COLOR_ATTR_NAME, 'sd');
12378
12512
  }
12379
12513
 
12380
- export { Index$b as AutoScroll, Index$d as Breadcrumb, WButton as Button, index$4 as Calendar, index$2 as Card, WCascader as Cascader, Index$4 as Checkbox, Index$a as CountUp, Index$2 as DatePicker, index$6 as DhPlayer, DragBox, IconFont, Index as Input, WInputNumber as InputNumber, LineEcharts, Modal, ModalForm$1 as ModalForm, Modal$1 as ModalTips, index$8 as NtTable, Index$9 as Number, NumericInput, Index$3 as Radio, index$1 as RequestRenderDom, Index$5 as Select, Index$c as Swiper, WSwitch as Switch, index$3 as TabelCard, index as Table, TableEdit, Index$7 as TreeSelect, Upload, index$7 as Video, index$5 as VideoPlayer, Index$6 as WDatePicker, WForm$1 as WForm, WaterLevelCharts, WebsocketHeart, useEventEmitter, useStateWithCall, wTracing, create as whox, wmox };
12514
+ export { Index$b as AutoScroll, Index$d as Breadcrumb, WButton as Button, index$4 as Calendar, index$2 as Card, WCascader as Cascader, Index$4 as Checkbox, WCheckboxGroup as CheckboxGroup, Index$a as CountUp, Index$2 as DatePicker, index$6 as DhPlayer, DragBox, IconFont, Index as Input, WInputNumber as InputNumber, LineEcharts, Modal, ModalForm$1 as ModalForm, Modal$1 as ModalTips, index$8 as NtTable, Index$9 as Number, NumericInput, Index$3 as Radio, WRadioGroup as RadioGroup, index$1 as RequestRenderDom, Index$5 as Select, Index$c as Swiper, WSwitch as Switch, index$3 as TabelCard, index as Table, TableEdit, Index$7 as TreeSelect, Upload, index$7 as Video, index$5 as VideoPlayer, Index$6 as WDatePicker, WForm$1 as WForm, WaterLevelCharts, WebsocketHeart, useEventEmitter, useStateWithCall, wTracing, create as whox, wmox };
package/dist/index.js CHANGED
@@ -12,6 +12,7 @@ var classnames = require('classnames');
12
12
  var zhCN = require('antd/es/date-picker/locale/zh_CN');
13
13
  var dayjs = require('dayjs');
14
14
  require('dayjs/locale/zh-cn');
15
+ var lib = require('antd/lib');
15
16
  var CountUp = require('react-countup');
16
17
  var react = require('swiper/react');
17
18
  var SwiperCore = require('swiper');
@@ -3343,7 +3344,145 @@ var WCascader = function WCascader(props) {
3343
3344
  }, extraProps));
3344
3345
  };
3345
3346
 
3346
- var _excluded$9 = ["columns", "extraColumns", "className", "style", "search", "disabled", "disabledHideInSearch", "disabledRuler", "onFormChange", "onSubmit", "onReset", "setForm", "deps"];
3347
+ var _excluded$9 = ["request", "valueEnum", "onLoad", "params"];
3348
+ var WRadioGroup = function WRadioGroup(props) {
3349
+ var request = props.request,
3350
+ valueEnum = props.valueEnum,
3351
+ onLoad = props.onLoad,
3352
+ params = props.params,
3353
+ extraProps = _objectWithoutProperties(props, _excluded$9);
3354
+ var _useState = React.useState([]),
3355
+ _useState2 = _slicedToArray(_useState, 2),
3356
+ options = _useState2[0],
3357
+ setOptions = _useState2[1];
3358
+ React.useEffect(function () {
3359
+ var isMounted = true;
3360
+ _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
3361
+ var res;
3362
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
3363
+ while (1) switch (_context.prev = _context.next) {
3364
+ case 0:
3365
+ if (!request) {
3366
+ _context.next = 8;
3367
+ break;
3368
+ }
3369
+ _context.next = 3;
3370
+ return request();
3371
+ case 3:
3372
+ res = _context.sent;
3373
+ if (isMounted) {
3374
+ _context.next = 6;
3375
+ break;
3376
+ }
3377
+ return _context.abrupt("return");
3378
+ case 6:
3379
+ setOptions(res);
3380
+ onLoad && onLoad(res);
3381
+ case 8:
3382
+ case "end":
3383
+ return _context.stop();
3384
+ }
3385
+ }, _callee);
3386
+ }))();
3387
+ var valueEnumOptions = [];
3388
+ if (valueEnum) {
3389
+ for (var key in valueEnum) {
3390
+ var text = '';
3391
+ if (typeof valueEnum[key] === 'string') {
3392
+ text = valueEnum[key];
3393
+ } else {
3394
+ var _valueEnum$key;
3395
+ text = (_valueEnum$key = valueEnum[key]) === null || _valueEnum$key === void 0 ? void 0 : _valueEnum$key.text;
3396
+ }
3397
+ valueEnumOptions.push({
3398
+ label: text,
3399
+ value: key
3400
+ });
3401
+ }
3402
+ }
3403
+ if (!isMounted) return;
3404
+ onLoad && onLoad(valueEnumOptions);
3405
+ setOptions(valueEnumOptions);
3406
+ return function () {
3407
+ isMounted = false;
3408
+ };
3409
+ }, [JSON.stringify(params || {})]);
3410
+ return /*#__PURE__*/React__default['default'].createElement(antd.Radio.Group, _objectSpread2({
3411
+ options: options
3412
+ }, extraProps));
3413
+ };
3414
+ WRadioGroup.defaultProps = {};
3415
+
3416
+ var _excluded$a = ["request", "valueEnum", "onLoad", "params"];
3417
+ var WCheckboxGroup = function WCheckboxGroup(props) {
3418
+ var request = props.request,
3419
+ valueEnum = props.valueEnum,
3420
+ onLoad = props.onLoad,
3421
+ params = props.params,
3422
+ extraProps = _objectWithoutProperties(props, _excluded$a);
3423
+ var _useState = React.useState([]),
3424
+ _useState2 = _slicedToArray(_useState, 2),
3425
+ options = _useState2[0],
3426
+ setOptions = _useState2[1];
3427
+ React.useEffect(function () {
3428
+ var isMounted = true;
3429
+ _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
3430
+ var res;
3431
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
3432
+ while (1) switch (_context.prev = _context.next) {
3433
+ case 0:
3434
+ if (!request) {
3435
+ _context.next = 8;
3436
+ break;
3437
+ }
3438
+ _context.next = 3;
3439
+ return request();
3440
+ case 3:
3441
+ res = _context.sent;
3442
+ if (isMounted) {
3443
+ _context.next = 6;
3444
+ break;
3445
+ }
3446
+ return _context.abrupt("return");
3447
+ case 6:
3448
+ setOptions(res);
3449
+ onLoad && onLoad(res);
3450
+ case 8:
3451
+ case "end":
3452
+ return _context.stop();
3453
+ }
3454
+ }, _callee);
3455
+ }))();
3456
+ var valueEnumOptions = [];
3457
+ if (valueEnum) {
3458
+ for (var key in valueEnum) {
3459
+ var text = '';
3460
+ if (typeof valueEnum[key] === 'string') {
3461
+ text = valueEnum[key];
3462
+ } else {
3463
+ var _valueEnum$key;
3464
+ text = (_valueEnum$key = valueEnum[key]) === null || _valueEnum$key === void 0 ? void 0 : _valueEnum$key.text;
3465
+ }
3466
+ valueEnumOptions.push({
3467
+ label: text,
3468
+ value: key
3469
+ });
3470
+ }
3471
+ }
3472
+ if (!isMounted) return;
3473
+ onLoad && onLoad(valueEnumOptions);
3474
+ setOptions(valueEnumOptions);
3475
+ return function () {
3476
+ isMounted = false;
3477
+ };
3478
+ }, [JSON.stringify(params || {})]);
3479
+ return /*#__PURE__*/React__default['default'].createElement(lib.Checkbox.Group, _objectSpread2({
3480
+ options: options
3481
+ }, extraProps));
3482
+ };
3483
+ WCheckboxGroup.defaultProps = {};
3484
+
3485
+ var _excluded$b = ["columns", "extraColumns", "className", "style", "search", "disabled", "disabledHideInSearch", "disabledRuler", "onFormChange", "onSubmit", "onReset", "setForm", "deps"];
3347
3486
  var RangePicker$2 = Index$6.RangePicker;
3348
3487
  var WForm = function WForm(props, ref) {
3349
3488
  var columns = props.columns,
@@ -3359,7 +3498,7 @@ var WForm = function WForm(props, ref) {
3359
3498
  onReset = props.onReset,
3360
3499
  setForm = props.setForm,
3361
3500
  deps = props.deps,
3362
- extraProps = _objectWithoutProperties(props, _excluded$9);
3501
+ extraProps = _objectWithoutProperties(props, _excluded$b);
3363
3502
  var _Form$useForm = antd.Form.useForm(),
3364
3503
  _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
3365
3504
  form = _Form$useForm2[0];
@@ -3588,31 +3727,25 @@ var WForm = function WForm(props, ref) {
3588
3727
  disabled: disabled
3589
3728
  }, _showTime), c.fieldProps))));
3590
3729
  } else if (c.valueType === 'checkbox') {
3591
- var options = [];
3592
- if (c.valueEnum) {
3593
- for (var key in c.valueEnum) {
3594
- var text = c.valueEnum[key].text;
3595
- options.push({
3596
- label: text,
3597
- value: key
3598
- });
3599
- }
3600
- }
3601
- if (c.options) {
3602
- options = c.options;
3730
+ var _extraProps4 = {};
3731
+ if (c.request) {
3732
+ _extraProps4.request = c.request;
3733
+ } else if (c.valueEnum) {
3734
+ _extraProps4.valueEnum = c.valueEnum;
3735
+ } else {
3736
+ _extraProps4.options = c.options;
3603
3737
  }
3604
- // if (columnsFieldsRef.current) {
3605
- // columnsFieldsRef.current[c.dataIndex] = options;
3606
- // }
3607
- setColumnsFields(function (preColumnsFields) {
3608
- return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, options));
3609
- });
3610
3738
  var _labelCol6 = {};
3611
3739
  if (search && search.labelWidth) {
3612
3740
  _labelCol6.style = {
3613
3741
  width: search.labelWidth
3614
3742
  };
3615
3743
  }
3744
+ if (c.options) {
3745
+ setColumnsFields(function (preColumnsFields) {
3746
+ return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, c.options));
3747
+ });
3748
+ }
3616
3749
  return /*#__PURE__*/React__default['default'].createElement(antd.Col, _objectSpread2(_objectSpread2({
3617
3750
  className: "pl12 pr12"
3618
3751
  }, colProps), {}, {
@@ -3623,30 +3756,23 @@ var WForm = function WForm(props, ref) {
3623
3756
  name: c.dataIndex,
3624
3757
  label: c.title,
3625
3758
  labelCol: _labelCol6
3626
- }), /*#__PURE__*/React__default['default'].createElement(Index$4.Group, _objectSpread2({
3627
- disabled: disabled,
3628
- options: options
3629
- }, c.fieldProps))));
3630
- } else if (c.valueType === 'radio' || c.valueType === 'radioButton') {
3631
- var _options = [];
3632
- if (c.options) {
3633
- _options = c.options;
3634
- }
3635
- if (c.valueEnum) {
3636
- for (var _key in c.valueEnum) {
3637
- var _text = c.valueEnum[_key].text;
3638
- _options.push({
3639
- label: _text,
3640
- value: _key
3759
+ }), /*#__PURE__*/React__default['default'].createElement(WCheckboxGroup, _objectSpread2(_objectSpread2({
3760
+ onLoad: function onLoad(opt) {
3761
+ setColumnsFields(function (preColumnsFields) {
3762
+ return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, opt));
3641
3763
  });
3642
- }
3764
+ },
3765
+ disabled: disabled
3766
+ }, c.fieldProps), _extraProps4))));
3767
+ } else if (c.valueType === 'radio' || c.valueType === 'radioButton') {
3768
+ var _extraProps5 = {};
3769
+ if (c.request) {
3770
+ _extraProps5.request = c.request;
3771
+ } else if (c.valueEnum) {
3772
+ _extraProps5.valueEnum = c.valueEnum;
3773
+ } else {
3774
+ _extraProps5.options = c.options;
3643
3775
  }
3644
- // if (columnsFieldsRef.current) {
3645
- // columnsFieldsRef.current[c.dataIndex] = options;
3646
- // }
3647
- setColumnsFields(function (preColumnsFields) {
3648
- return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, _options));
3649
- });
3650
3776
  var _labelCol7 = {};
3651
3777
  if (search && search.labelWidth) {
3652
3778
  _labelCol7.style = {
@@ -3660,6 +3786,11 @@ var WForm = function WForm(props, ref) {
3660
3786
  buttonStyle: 'solid'
3661
3787
  };
3662
3788
  }
3789
+ if (c.options) {
3790
+ setColumnsFields(function (preColumnsFields) {
3791
+ return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, c.options));
3792
+ });
3793
+ }
3663
3794
  return /*#__PURE__*/React__default['default'].createElement(antd.Col, _objectSpread2(_objectSpread2({
3664
3795
  className: "pl12 pr12"
3665
3796
  }, colProps), {}, {
@@ -3670,19 +3801,22 @@ var WForm = function WForm(props, ref) {
3670
3801
  name: c.dataIndex,
3671
3802
  label: c.title,
3672
3803
  labelCol: _labelCol7
3673
- }), /*#__PURE__*/React__default['default'].createElement(Index$3.Group, _objectSpread2(_objectSpread2({
3804
+ }), /*#__PURE__*/React__default['default'].createElement(WRadioGroup, _objectSpread2(_objectSpread2(_objectSpread2({
3805
+ onLoad: function onLoad(opt) {
3806
+ setColumnsFields(function (preColumnsFields) {
3807
+ return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, opt));
3808
+ });
3809
+ },
3674
3810
  disabled: disabled
3675
- }, radioButtonProps), {}, {
3676
- options: _options
3677
- }, c.fieldProps))));
3811
+ }, radioButtonProps), c.fieldProps), _extraProps5))));
3678
3812
  } else if (c.valueType === 'switch') {
3679
- var _options2 = [];
3813
+ var options = [];
3680
3814
  if (c.valueEnum) {
3681
- for (var _key2 in c.valueEnum) {
3682
- var _text2 = c.valueEnum[_key2].text;
3683
- _options2.push({
3684
- label: _text2,
3685
- value: _key2
3815
+ for (var key in c.valueEnum) {
3816
+ var text = c.valueEnum[key].text;
3817
+ options.push({
3818
+ label: text,
3819
+ value: key
3686
3820
  });
3687
3821
  }
3688
3822
  }
@@ -3696,7 +3830,7 @@ var WForm = function WForm(props, ref) {
3696
3830
  // columnsFieldsRef.current[c.dataIndex] = options;
3697
3831
  // }
3698
3832
  setColumnsFields(function (preColumnsFields) {
3699
- return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, _options2));
3833
+ return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, options));
3700
3834
  });
3701
3835
  return /*#__PURE__*/React__default['default'].createElement(antd.Col, _objectSpread2(_objectSpread2({
3702
3836
  className: "pl12 pr12"
@@ -4055,7 +4189,7 @@ var WForm = function WForm(props, ref) {
4055
4189
  };
4056
4190
  var WForm$1 = /*#__PURE__*/React__default['default'].forwardRef(WForm);
4057
4191
 
4058
- var _excluded$a = ["columns", "dataSource", "request", "onLoad", "params", "onSubmit", "rowKey", "onRow", "className", "rowClassName", "rowSelection", "style", "tbodyStyle", "thStyle", "border", "scroll", "pagination", "search", "frameBoxTable", "frameBoxDirection", "formRef", "none"];
4192
+ var _excluded$c = ["columns", "dataSource", "request", "onLoad", "params", "onSubmit", "rowKey", "onRow", "className", "rowClassName", "rowSelection", "style", "tbodyStyle", "thStyle", "border", "scroll", "pagination", "search", "frameBoxTable", "frameBoxDirection", "formRef", "none"];
4059
4193
  function Table(_ref) {
4060
4194
  var _formSearchRef$curren4, _columns$, _columns$2;
4061
4195
  var columns = _ref.columns,
@@ -4086,7 +4220,7 @@ function Table(_ref) {
4086
4220
  frameBoxDirection = _ref$frameBoxDirectio === void 0 ? 'out' : _ref$frameBoxDirectio,
4087
4221
  formRef = _ref.formRef,
4088
4222
  none = _ref.none,
4089
- props = _objectWithoutProperties(_ref, _excluded$a);
4223
+ props = _objectWithoutProperties(_ref, _excluded$c);
4090
4224
  var _useState = React.useState(_toConsumableArray((rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRowKeys) || [])),
4091
4225
  _useState2 = _slicedToArray(_useState, 2),
4092
4226
  selectedRowKeys = _useState2[0],
@@ -4573,7 +4707,7 @@ Table.defaultProps = {
4573
4707
  };
4574
4708
  var index = /*#__PURE__*/React.memo(Table);
4575
4709
 
4576
- var _excluded$b = ["value", "renderDom", "onLoad", "params", "onChange", "request"];
4710
+ var _excluded$d = ["value", "renderDom", "onLoad", "params", "onChange", "request"];
4577
4711
  function Index$8(props, ref) {
4578
4712
  var value = props.value,
4579
4713
  renderDom = props.renderDom,
@@ -4581,7 +4715,7 @@ function Index$8(props, ref) {
4581
4715
  params = props.params,
4582
4716
  onChange = props.onChange,
4583
4717
  request = props.request,
4584
- rest = _objectWithoutProperties(props, _excluded$b);
4718
+ rest = _objectWithoutProperties(props, _excluded$d);
4585
4719
  var _useState = React.useState(''),
4586
4720
  _useState2 = _slicedToArray(_useState, 2),
4587
4721
  areaValue = _useState2[0],
@@ -4636,7 +4770,7 @@ function Index$8(props, ref) {
4636
4770
  }
4637
4771
  var index$1 = /*#__PURE__*/React__default['default'].forwardRef(Index$8);
4638
4772
 
4639
- var _excluded$c = ["height", "width", "count", "style", "numberStyle"],
4773
+ var _excluded$e = ["height", "width", "count", "style", "numberStyle"],
4640
4774
  _excluded2$2 = ["count", "numberCount", "width", "height", "marginRight"];
4641
4775
  var Number$1 = function Number(_ref) {
4642
4776
  var height = _ref.height,
@@ -4645,7 +4779,7 @@ var Number$1 = function Number(_ref) {
4645
4779
  count = _ref$count === void 0 ? 0 : _ref$count,
4646
4780
  style = _ref.style,
4647
4781
  numberStyle = _ref.numberStyle,
4648
- props = _objectWithoutProperties(_ref, _excluded$c);
4782
+ props = _objectWithoutProperties(_ref, _excluded$e);
4649
4783
  // 上次的值
4650
4784
  var _useState = React.useState(0),
4651
4785
  _useState2 = _slicedToArray(_useState, 2),
@@ -4795,12 +4929,12 @@ var Index$9 = function Index(props) {
4795
4929
  }));
4796
4930
  };
4797
4931
 
4798
- var _excluded$d = ["duration", "className"];
4932
+ var _excluded$f = ["duration", "className"];
4799
4933
  var Index$a = function Index(props) {
4800
4934
  var _props$duration = props.duration,
4801
4935
  duration = _props$duration === void 0 ? 2.75 : _props$duration,
4802
4936
  className = props.className,
4803
- extraProps = _objectWithoutProperties(props, _excluded$d);
4937
+ extraProps = _objectWithoutProperties(props, _excluded$f);
4804
4938
  return /*#__PURE__*/React__default['default'].createElement(CountUp__default['default'], _objectSpread2(_objectSpread2({
4805
4939
  duration: duration
4806
4940
  }, extraProps), {}, {
@@ -4809,7 +4943,7 @@ var Index$a = function Index(props) {
4809
4943
  };
4810
4944
  Index$a.defaultProps = {};
4811
4945
 
4812
- var _excluded$e = ["list", "render", "none", "partSize"];
4946
+ var _excluded$g = ["list", "render", "none", "partSize"];
4813
4947
  function AutoScroll(props) {
4814
4948
  var inner1 = React.useRef();
4815
4949
  var inner2 = React.useRef();
@@ -4886,7 +5020,7 @@ var Index$b = function Index(_ref) {
4886
5020
  none = _ref.none,
4887
5021
  _ref$partSize = _ref.partSize,
4888
5022
  partSize = _ref$partSize === void 0 ? 4 : _ref$partSize,
4889
- otherProps = _objectWithoutProperties(_ref, _excluded$e);
5023
+ otherProps = _objectWithoutProperties(_ref, _excluded$g);
4890
5024
  var _useState = React.useState([]),
4891
5025
  _useState2 = _slicedToArray(_useState, 2),
4892
5026
  partA = _useState2[0],
@@ -4960,7 +5094,7 @@ var Index$b = function Index(_ref) {
4960
5094
  }, none || '暂无数据'));
4961
5095
  };
4962
5096
 
4963
- var _excluded$f = ["data", "onClick", "slidesPerView", "rowKey", "onSwiperChange", "renderItem", "noMove"];
5097
+ var _excluded$h = ["data", "onClick", "slidesPerView", "rowKey", "onSwiperChange", "renderItem", "noMove"];
4964
5098
  // install Swiper modules
4965
5099
  SwiperCore__default['default'].use([SwiperCore.Pagination, SwiperCore.Navigation, SwiperCore.Autoplay, SwiperCore.Virtual]);
4966
5100
  var Index$c = /*#__PURE__*/React.forwardRef(function (props, ref) {
@@ -4972,7 +5106,7 @@ var Index$c = /*#__PURE__*/React.forwardRef(function (props, ref) {
4972
5106
  onSwiperChange = props.onSwiperChange,
4973
5107
  renderItem = props.renderItem,
4974
5108
  noMove = props.noMove,
4975
- extraProps = _objectWithoutProperties(props, _excluded$f);
5109
+ extraProps = _objectWithoutProperties(props, _excluded$h);
4976
5110
  var _useState = React.useState(null),
4977
5111
  _useState2 = _slicedToArray(_useState, 2),
4978
5112
  controlledSwiper = _useState2[0],
@@ -5621,7 +5755,7 @@ function createBrowserHistory(props) {
5621
5755
  return history;
5622
5756
  }
5623
5757
 
5624
- var _excluded$g = ["routes", "className"];
5758
+ var _excluded$i = ["routes", "className"];
5625
5759
  var history = createBrowserHistory();
5626
5760
  function itemRender(route, params, routes, paths) {
5627
5761
  var last = routes.indexOf(route) === routes.length - 1;
@@ -5637,7 +5771,7 @@ function itemRender(route, params, routes, paths) {
5637
5771
  var Index$d = function Index(_ref) {
5638
5772
  var routes = _ref.routes,
5639
5773
  className = _ref.className,
5640
- props = _objectWithoutProperties(_ref, _excluded$g);
5774
+ props = _objectWithoutProperties(_ref, _excluded$i);
5641
5775
  return /*#__PURE__*/React__default['default'].createElement(antd.Breadcrumb, _objectSpread2({
5642
5776
  className: className || 'default',
5643
5777
  separator: ">>",
@@ -5646,7 +5780,7 @@ var Index$d = function Index(_ref) {
5646
5780
  }, props));
5647
5781
  };
5648
5782
 
5649
- var _excluded$h = ["title", "className", "headerTail", "headerCenter", "sliderTabs"];
5783
+ var _excluded$j = ["title", "className", "headerTail", "headerCenter", "sliderTabs"];
5650
5784
  var Index$e = function Index(_ref, ref) {
5651
5785
  var _sliderTabs$component, _sliderTabs$tabs;
5652
5786
  var title = _ref.title,
@@ -5655,7 +5789,7 @@ var Index$e = function Index(_ref, ref) {
5655
5789
  headerTail = _ref.headerTail,
5656
5790
  headerCenter = _ref.headerCenter,
5657
5791
  sliderTabs = _ref.sliderTabs,
5658
- props = _objectWithoutProperties(_ref, _excluded$h);
5792
+ props = _objectWithoutProperties(_ref, _excluded$j);
5659
5793
  React.useImperativeHandle(ref, function () {
5660
5794
  return {
5661
5795
  activeTab: activeTab
@@ -5871,7 +6005,7 @@ function DialogModel(props, ref) {
5871
6005
  }
5872
6006
  var Dialog = /*#__PURE__*/React__default['default'].forwardRef(DialogModel);
5873
6007
 
5874
- var _excluded$i = ["open", "width", "closeCb", "onClose", "className", "style", "isDrag", "wrapClassName"],
6008
+ var _excluded$k = ["open", "width", "closeCb", "onClose", "className", "style", "isDrag", "wrapClassName"],
5875
6009
  _excluded2$3 = ["open"];
5876
6010
  var Modal = /*#__PURE__*/function (_React$PureComponent) {
5877
6011
  _inherits(Modal, _React$PureComponent);
@@ -6003,7 +6137,7 @@ var Modal = /*#__PURE__*/function (_React$PureComponent) {
6003
6137
  style = _this$props4.style,
6004
6138
  isDrag = _this$props4.isDrag,
6005
6139
  wrapClassName = _this$props4.wrapClassName,
6006
- other = _objectWithoutProperties(_this$props4, _excluded$i);
6140
+ other = _objectWithoutProperties(_this$props4, _excluded$k);
6007
6141
  return /*#__PURE__*/React__default['default'].createElement(Dialog, _objectSpread2({
6008
6142
  ref: this.containerRef,
6009
6143
  closeCb: closeCb,
@@ -6168,7 +6302,7 @@ function DialogModel$1(props) {
6168
6302
  return renderChildren;
6169
6303
  }
6170
6304
 
6171
- var _excluded$j = ["open"];
6305
+ var _excluded$l = ["open"];
6172
6306
  var Modal$1 = /*#__PURE__*/function (_React$PureComponent) {
6173
6307
  _inherits(Modal, _React$PureComponent);
6174
6308
  var _super = _createSuper(Modal);
@@ -6290,7 +6424,7 @@ Modal$1.show = function (config) {
6290
6424
  setShow = _useState2[1];
6291
6425
  manager.setShow = setShow;
6292
6426
  var open = props.open,
6293
- trueProps = _objectWithoutProperties(props, _excluded$j);
6427
+ trueProps = _objectWithoutProperties(props, _excluded$l);
6294
6428
  React.useEffect(function () {
6295
6429
  manager.mounted = true;
6296
6430
  setShow(open);
@@ -6462,7 +6596,7 @@ function DragBox(_ref) {
6462
6596
  }, children))) : ( /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null));
6463
6597
  }
6464
6598
 
6465
- var _excluded$k = ["columns", "extraColumns", "search", "open", "setOpen", "modalFormOpend", "disabled", "submitMethod", "onSubmitSuccess", "title", "record", "onFormChange", "formItemChild", "onCancel", "modalHeaderSlot", "modalFooterSlot", "formProps"];
6599
+ var _excluded$m = ["columns", "extraColumns", "search", "open", "setOpen", "modalFormOpend", "disabled", "submitMethod", "onSubmitSuccess", "title", "record", "onFormChange", "formItemChild", "onCancel", "modalHeaderSlot", "modalFooterSlot", "formProps"];
6466
6600
  var ModalForm = function ModalForm(props, ref) {
6467
6601
  var columns = props.columns,
6468
6602
  extraColumns = props.extraColumns,
@@ -6481,7 +6615,7 @@ var ModalForm = function ModalForm(props, ref) {
6481
6615
  modalHeaderSlot = props.modalHeaderSlot,
6482
6616
  modalFooterSlot = props.modalFooterSlot,
6483
6617
  formProps = props.formProps,
6484
- extraProps = _objectWithoutProperties(props, _excluded$k);
6618
+ extraProps = _objectWithoutProperties(props, _excluded$m);
6485
6619
  var formRef = React.useRef(null);
6486
6620
  var _useState = React.useState(false),
6487
6621
  _useState2 = _slicedToArray(_useState, 2),
@@ -6606,7 +6740,7 @@ var ModalForm = function ModalForm(props, ref) {
6606
6740
  };
6607
6741
  var ModalForm$1 = /*#__PURE__*/React__default['default'].forwardRef(ModalForm);
6608
6742
 
6609
- var _excluded$l = ["columns", "extraColumns", "request", "modalFormSearch", "search", "tableAction", "filterAction", "renderTableBar", "renderTableBarDeps", "className", "style", "onFormChange", "modalConfig", "searchFormConfig", "optionColumnConfig", "pagination", "noBordered", "showIndex", "searchTableSlot"];
6743
+ var _excluded$n = ["columns", "extraColumns", "request", "modalFormSearch", "search", "tableAction", "filterAction", "renderTableBar", "renderTableBarDeps", "className", "style", "onFormChange", "modalConfig", "searchFormConfig", "optionColumnConfig", "pagination", "noBordered", "showIndex", "searchTableSlot"];
6610
6744
  var TabelCard = function TabelCard(props, ref) {
6611
6745
  var columns = props.columns,
6612
6746
  extraColumns = props.extraColumns,
@@ -6630,7 +6764,7 @@ var TabelCard = function TabelCard(props, ref) {
6630
6764
  noBordered = props.noBordered,
6631
6765
  showIndex = props.showIndex,
6632
6766
  searchTableSlot = props.searchTableSlot,
6633
- extraProps = _objectWithoutProperties(props, _excluded$l);
6767
+ extraProps = _objectWithoutProperties(props, _excluded$n);
6634
6768
  var actionRef = React.useRef();
6635
6769
  var modalFormRef = React.useRef(null);
6636
6770
  var searchFormRef = React.useRef(null);
@@ -10886,7 +11020,7 @@ function DhPlayer(_ref, ref) {
10886
11020
  }
10887
11021
  var index$6 = /*#__PURE__*/React.forwardRef(DhPlayer);
10888
11022
 
10889
- var _excluded$m = ["id", "videoUrls", "definitionList", "isLoop", "muted", "currentIndex", "setCurrentIndex", "className", "style", "open", "autoplay", "videoInit", "enableMemory", "lastPlayTimeHideDelay"];
11023
+ var _excluded$o = ["id", "videoUrls", "definitionList", "isLoop", "muted", "currentIndex", "setCurrentIndex", "className", "style", "open", "autoplay", "videoInit", "enableMemory", "lastPlayTimeHideDelay"];
10890
11024
  // 默认速度控制
10891
11025
  var DEFAULT_PLAY_BACK_RATE = [0.5, 0.75, 1, 1.5, 2];
10892
11026
  // 默认记忆提示文字展示时长(s)
@@ -10917,7 +11051,7 @@ var index$7 = (function (_ref) {
10917
11051
  enableMemory = _ref$enableMemory === void 0 ? false : _ref$enableMemory,
10918
11052
  _ref$lastPlayTimeHide = _ref.lastPlayTimeHideDelay,
10919
11053
  lastPlayTimeHideDelay = _ref$lastPlayTimeHide === void 0 ? DEFAULT_LAST_PLAY_TIME_DELAY : _ref$lastPlayTimeHide,
10920
- props = _objectWithoutProperties(_ref, _excluded$m);
11054
+ props = _objectWithoutProperties(_ref, _excluded$o);
10921
11055
  var player = React.useRef();
10922
11056
  var currentPlayerIndex = React.useRef(0);
10923
11057
  // 内置的 index 状态管理
@@ -11087,7 +11221,7 @@ var index$7 = (function (_ref) {
11087
11221
  });
11088
11222
  });
11089
11223
 
11090
- var _excluded$n = ["className", "frameStyle", "style", "direction", "children"];
11224
+ var _excluded$p = ["className", "frameStyle", "style", "direction", "children"];
11091
11225
  function FrameBox$1(_ref) {
11092
11226
  var className = _ref.className,
11093
11227
  frameStyle = _ref.frameStyle,
@@ -11095,7 +11229,7 @@ function FrameBox$1(_ref) {
11095
11229
  _ref$direction = _ref.direction,
11096
11230
  direction = _ref$direction === void 0 ? 'in' : _ref$direction,
11097
11231
  children = _ref.children,
11098
- props = _objectWithoutProperties(_ref, _excluded$n);
11232
+ props = _objectWithoutProperties(_ref, _excluded$p);
11099
11233
  return /*#__PURE__*/React__default['default'].createElement("div", _objectSpread2({
11100
11234
  className: classnames__default['default'](_defineProperty(_defineProperty({}, 'frame', true), className || '', true)),
11101
11235
  style: style
@@ -11122,7 +11256,7 @@ function FrameBox$1(_ref) {
11122
11256
  }), children);
11123
11257
  }
11124
11258
 
11125
- var _excluded$o = ["columns", "dataSource", "request", "onLoad", "params", "onSubmit", "rowKey", "onRow", "className", "rowClassName", "rowSelection", "style", "tbodyStyle", "thStyle", "border", "scroll", "pagination", "search", "frameBoxTable", "frameBoxDirection", "formRef", "none"];
11259
+ var _excluded$q = ["columns", "dataSource", "request", "onLoad", "params", "onSubmit", "rowKey", "onRow", "className", "rowClassName", "rowSelection", "style", "tbodyStyle", "thStyle", "border", "scroll", "pagination", "search", "frameBoxTable", "frameBoxDirection", "formRef", "none"];
11126
11260
  function NtTable(_ref, ref) {
11127
11261
  var _formSearchRef$curren4, _columns$, _columns$2;
11128
11262
  var columns = _ref.columns,
@@ -11153,7 +11287,7 @@ function NtTable(_ref, ref) {
11153
11287
  frameBoxDirection = _ref$frameBoxDirectio === void 0 ? 'out' : _ref$frameBoxDirectio,
11154
11288
  formRef = _ref.formRef,
11155
11289
  none = _ref.none,
11156
- props = _objectWithoutProperties(_ref, _excluded$o);
11290
+ props = _objectWithoutProperties(_ref, _excluded$q);
11157
11291
  var _useState = React.useState(_toConsumableArray((rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRowKeys) || [])),
11158
11292
  _useState2 = _slicedToArray(_useState, 2),
11159
11293
  selectedRowKeys = _useState2[0],
@@ -12409,7 +12543,7 @@ function WaterLevelCharts(config) {
12409
12543
  /*
12410
12544
  * @Author: lijin
12411
12545
  * @Date: 2021-09-09 11:02:54
12412
- * @LastEditTime: 2023-09-18 17:44:13
12546
+ * @LastEditTime: 2023-12-25 19:04:08
12413
12547
  * @LastEditors: lijin
12414
12548
  * @Description:
12415
12549
  * @FilePath: \wargerm\src\index.ts
@@ -12428,6 +12562,7 @@ exports.Calendar = index$4;
12428
12562
  exports.Card = index$2;
12429
12563
  exports.Cascader = WCascader;
12430
12564
  exports.Checkbox = Index$4;
12565
+ exports.CheckboxGroup = WCheckboxGroup;
12431
12566
  exports.CountUp = Index$a;
12432
12567
  exports.DatePicker = Index$2;
12433
12568
  exports.DhPlayer = index$6;
@@ -12443,6 +12578,7 @@ exports.NtTable = index$8;
12443
12578
  exports.Number = Index$9;
12444
12579
  exports.NumericInput = NumericInput;
12445
12580
  exports.Radio = Index$3;
12581
+ exports.RadioGroup = WRadioGroup;
12446
12582
  exports.RequestRenderDom = index$1;
12447
12583
  exports.Select = Index$5;
12448
12584
  exports.Swiper = Index$c;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "wargerm",
4
- "version": "0.7.67",
4
+ "version": "0.7.68",
5
5
  "scripts": {
6
6
  "dev": "dumi dev",
7
7
  "docs:build": "dumi build",