@kmkf-fe-packages/basic-components 0.7.15-alpha.71 → 0.7.15-alpha.74

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
@@ -10166,7 +10166,6 @@ var BsGoods = function BsGoods(props) {
10166
10166
  useEffect(function () {
10167
10167
  valueRef.current = value;
10168
10168
  pubsub.subscribe('type', function (type, data) {
10169
- console.log(type, data);
10170
10169
  if (disabled) return;
10171
10170
  withInfo.current = {
10172
10171
  type: type,
@@ -10192,23 +10191,18 @@ var BsGoods = function BsGoods(props) {
10192
10191
  if (['1', '3'].includes(data.val)) {
10193
10192
  var _valueRef$current2;
10194
10193
  pubsub.publish('reissueSelectListReturn', {
10195
- list: cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current2 = valueRef.current) === null || _valueRef$current2 === void 0 ? void 0 : _valueRef$current2.bsGoods) || [])
10194
+ list: cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current2 = valueRef.current) === null || _valueRef$current2 === void 0 ? void 0 : _valueRef$current2.bsGoods) || []),
10195
+ newValue: data === null || data === void 0 ? void 0 : data.newValue
10196
10196
  });
10197
10197
  }
10198
10198
  });
10199
10199
  }, [disabled, value]);
10200
- // useEffect(() => {
10201
- // if (!disabled) {
10202
- // pubsub.publish('goodList', {
10203
- // list: cloneDeep(value?.bsGoods || []),
10204
- // });
10205
- // }
10206
- // }, [value, disabled]);
10207
10200
  var _onSelect = function onSelect(list) {
10208
10201
  var _withInfo$current, _withInfo$current2;
10209
10202
  if (disabled) return;
10210
10203
  var newList = cloneDeep(list);
10211
10204
  var type = ((_withInfo$current = withInfo.current) === null || _withInfo$current === void 0 ? void 0 : _withInfo$current.type) === 'reissueType' ? 'reissueSelectList' : 'selectList';
10205
+ console.log('onSelect', type, withInfo.current);
10212
10206
  pubsub.publish(type, {
10213
10207
  type: (_withInfo$current2 = withInfo.current) === null || _withInfo$current2 === void 0 ? void 0 : _withInfo$current2.val,
10214
10208
  list: newList.map(function (item) {
@@ -10256,16 +10250,7 @@ var BsExchange = function BsExchange(props) {
10256
10250
  reasonList = _props$reasonList === void 0 ? [] : _props$reasonList,
10257
10251
  disabled = props.disabled,
10258
10252
  other = _objectWithoutProperties(props, _excluded$b);
10259
- var _useState = useState([]),
10260
- _useState2 = _slicedToArray(_useState, 2),
10261
- bsGoods = _useState2[0],
10262
- setBsGoods = _useState2[1];
10263
10253
  var valueRef = useRef({});
10264
- // useEffect(() => {
10265
- // pubsub.subscribe('goodList', (_: any, data: any) => {
10266
- // setBsGoods(data.list);
10267
- // });
10268
- // }, []);
10269
10254
  useEffect(function () {
10270
10255
  valueRef.current = value;
10271
10256
  pubsub.subscribeOnce('deleteGood', function (_, data) {
@@ -10288,21 +10273,11 @@ var BsExchange = function BsExchange(props) {
10288
10273
  onChange(newValue);
10289
10274
  }
10290
10275
  });
10291
- // pubsub.subscribeOnce('selectList', (_: any, data: any) => {
10292
- // if (disabled) return;
10293
- // if (value) {
10294
- // const newData = cloneDeep(data);
10295
- // onChange({
10296
- // ...value,
10297
- // bsExchangeReturnGoods: getListHandle([...newData.list], value),
10298
- // });
10299
- // }
10300
- // });
10301
10276
  }, [value]);
10302
10277
  useEffect(function () {
10303
10278
  pubsub.subscribe('selectList', function (_, data) {
10279
+ // console.log('selectList', data, valueRef.current);
10304
10280
  if (disabled) return;
10305
- console.log('selectList', valueRef.current, data);
10306
10281
  if (valueRef.current) {
10307
10282
  var newDataList = cloneDeep((data === null || data === void 0 ? void 0 : data.list) || []);
10308
10283
  onChange(_objectSpread2(_objectSpread2({}, valueRef.current), {}, {
@@ -10374,9 +10349,6 @@ var BsExchange = function BsExchange(props) {
10374
10349
  newValue.bsExchangeType = val;
10375
10350
  newValue.bsExchangeReturnGoods = [];
10376
10351
  newValue.bsExchangeGiftGoods = [];
10377
- // if (['1', '3'].includes(val[0])) {
10378
- // newValue.bsExchangeReturnGoods = getListHandle(bsGoods, newValue);
10379
- // }
10380
10352
  if (['2', '4'].includes(val[0])) {
10381
10353
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
10382
10354
  }
@@ -10396,12 +10368,10 @@ var BsExchange = function BsExchange(props) {
10396
10368
  newValue[key] = val;
10397
10369
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
10398
10370
  if (key === 'bsExchangeType') {
10399
- console.log(val);
10400
10371
  pubsub.publish('type', val[0]);
10401
10372
  }
10402
10373
  };
10403
10374
  var changeReturnHandle = function changeReturnHandle(val, index, key) {
10404
- console.log('changeReturnHandle', val, index, key);
10405
10375
  var newValue = _objectSpread2({}, value);
10406
10376
  newValue.bsExchangeReturnGoods[index][key] = (val || []).map(function (t) {
10407
10377
  t.index = index;
@@ -10503,16 +10473,7 @@ var BsReissue = function BsReissue(props) {
10503
10473
  reasonList = _props$reasonList === void 0 ? [] : _props$reasonList,
10504
10474
  disabled = props.disabled,
10505
10475
  other = _objectWithoutProperties(props, _excluded$c);
10506
- var _useState = useState([]),
10507
- _useState2 = _slicedToArray(_useState, 2),
10508
- bsGoods = _useState2[0],
10509
- setBsGoods = _useState2[1];
10510
10476
  var valueRef = useRef({});
10511
- // useEffect(() => {
10512
- // pubsub.subscribe('goodList', (_: any, data: any) => {
10513
- // setBsGoods(data.list);
10514
- // });
10515
- // }, []);
10516
10477
  useEffect(function () {
10517
10478
  pubsub.subscribe('reissueSelectList', function (_, data) {
10518
10479
  if (disabled) return;
@@ -10553,19 +10514,6 @@ var BsReissue = function BsReissue(props) {
10553
10514
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
10554
10515
  }
10555
10516
  });
10556
- // pubsub.subscribeOnce('reissueSelectList', (_: any, data: any) => {
10557
- // if (disabled) return;
10558
- // if (value) {
10559
- // const newValue = { ...value };
10560
- // newValue.bsReissueGoods = data?.list.map((item: any) => {
10561
- // item.money = 0;
10562
- // item.share = 0;
10563
- // item.canUpdateNumber = true;
10564
- // return item;
10565
- // });
10566
- // onChange?.(newValue);
10567
- // }
10568
- // });
10569
10517
  }, [value, disabled]);
10570
10518
  var changeHandle = function changeHandle(val, key) {
10571
10519
  var newValue = _objectSpread2({}, value);
package/dist/index.js CHANGED
@@ -10177,7 +10177,6 @@ var BsGoods = function BsGoods(props) {
10177
10177
  React.useEffect(function () {
10178
10178
  valueRef.current = value;
10179
10179
  pubsub__default['default'].subscribe('type', function (type, data) {
10180
- console.log(type, data);
10181
10180
  if (disabled) return;
10182
10181
  withInfo.current = {
10183
10182
  type: type,
@@ -10203,23 +10202,18 @@ var BsGoods = function BsGoods(props) {
10203
10202
  if (['1', '3'].includes(data.val)) {
10204
10203
  var _valueRef$current2;
10205
10204
  pubsub__default['default'].publish('reissueSelectListReturn', {
10206
- list: lodash.cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current2 = valueRef.current) === null || _valueRef$current2 === void 0 ? void 0 : _valueRef$current2.bsGoods) || [])
10205
+ list: lodash.cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current2 = valueRef.current) === null || _valueRef$current2 === void 0 ? void 0 : _valueRef$current2.bsGoods) || []),
10206
+ newValue: data === null || data === void 0 ? void 0 : data.newValue
10207
10207
  });
10208
10208
  }
10209
10209
  });
10210
10210
  }, [disabled, value]);
10211
- // useEffect(() => {
10212
- // if (!disabled) {
10213
- // pubsub.publish('goodList', {
10214
- // list: cloneDeep(value?.bsGoods || []),
10215
- // });
10216
- // }
10217
- // }, [value, disabled]);
10218
10211
  var _onSelect = function onSelect(list) {
10219
10212
  var _withInfo$current, _withInfo$current2;
10220
10213
  if (disabled) return;
10221
10214
  var newList = lodash.cloneDeep(list);
10222
10215
  var type = ((_withInfo$current = withInfo.current) === null || _withInfo$current === void 0 ? void 0 : _withInfo$current.type) === 'reissueType' ? 'reissueSelectList' : 'selectList';
10216
+ console.log('onSelect', type, withInfo.current);
10223
10217
  pubsub__default['default'].publish(type, {
10224
10218
  type: (_withInfo$current2 = withInfo.current) === null || _withInfo$current2 === void 0 ? void 0 : _withInfo$current2.val,
10225
10219
  list: newList.map(function (item) {
@@ -10267,16 +10261,7 @@ var BsExchange = function BsExchange(props) {
10267
10261
  reasonList = _props$reasonList === void 0 ? [] : _props$reasonList,
10268
10262
  disabled = props.disabled,
10269
10263
  other = _objectWithoutProperties(props, _excluded$b);
10270
- var _useState = React.useState([]),
10271
- _useState2 = _slicedToArray(_useState, 2),
10272
- bsGoods = _useState2[0],
10273
- setBsGoods = _useState2[1];
10274
10264
  var valueRef = React.useRef({});
10275
- // useEffect(() => {
10276
- // pubsub.subscribe('goodList', (_: any, data: any) => {
10277
- // setBsGoods(data.list);
10278
- // });
10279
- // }, []);
10280
10265
  React.useEffect(function () {
10281
10266
  valueRef.current = value;
10282
10267
  pubsub__default['default'].subscribeOnce('deleteGood', function (_, data) {
@@ -10299,21 +10284,11 @@ var BsExchange = function BsExchange(props) {
10299
10284
  onChange(newValue);
10300
10285
  }
10301
10286
  });
10302
- // pubsub.subscribeOnce('selectList', (_: any, data: any) => {
10303
- // if (disabled) return;
10304
- // if (value) {
10305
- // const newData = cloneDeep(data);
10306
- // onChange({
10307
- // ...value,
10308
- // bsExchangeReturnGoods: getListHandle([...newData.list], value),
10309
- // });
10310
- // }
10311
- // });
10312
10287
  }, [value]);
10313
10288
  React.useEffect(function () {
10314
10289
  pubsub__default['default'].subscribe('selectList', function (_, data) {
10290
+ // console.log('selectList', data, valueRef.current);
10315
10291
  if (disabled) return;
10316
- console.log('selectList', valueRef.current, data);
10317
10292
  if (valueRef.current) {
10318
10293
  var newDataList = lodash.cloneDeep((data === null || data === void 0 ? void 0 : data.list) || []);
10319
10294
  onChange(_objectSpread2(_objectSpread2({}, valueRef.current), {}, {
@@ -10385,9 +10360,6 @@ var BsExchange = function BsExchange(props) {
10385
10360
  newValue.bsExchangeType = val;
10386
10361
  newValue.bsExchangeReturnGoods = [];
10387
10362
  newValue.bsExchangeGiftGoods = [];
10388
- // if (['1', '3'].includes(val[0])) {
10389
- // newValue.bsExchangeReturnGoods = getListHandle(bsGoods, newValue);
10390
- // }
10391
10363
  if (['2', '4'].includes(val[0])) {
10392
10364
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
10393
10365
  }
@@ -10407,12 +10379,10 @@ var BsExchange = function BsExchange(props) {
10407
10379
  newValue[key] = val;
10408
10380
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
10409
10381
  if (key === 'bsExchangeType') {
10410
- console.log(val);
10411
10382
  pubsub__default['default'].publish('type', val[0]);
10412
10383
  }
10413
10384
  };
10414
10385
  var changeReturnHandle = function changeReturnHandle(val, index, key) {
10415
- console.log('changeReturnHandle', val, index, key);
10416
10386
  var newValue = _objectSpread2({}, value);
10417
10387
  newValue.bsExchangeReturnGoods[index][key] = (val || []).map(function (t) {
10418
10388
  t.index = index;
@@ -10514,16 +10484,7 @@ var BsReissue = function BsReissue(props) {
10514
10484
  reasonList = _props$reasonList === void 0 ? [] : _props$reasonList,
10515
10485
  disabled = props.disabled,
10516
10486
  other = _objectWithoutProperties(props, _excluded$c);
10517
- var _useState = React.useState([]),
10518
- _useState2 = _slicedToArray(_useState, 2),
10519
- bsGoods = _useState2[0],
10520
- setBsGoods = _useState2[1];
10521
10487
  var valueRef = React.useRef({});
10522
- // useEffect(() => {
10523
- // pubsub.subscribe('goodList', (_: any, data: any) => {
10524
- // setBsGoods(data.list);
10525
- // });
10526
- // }, []);
10527
10488
  React.useEffect(function () {
10528
10489
  pubsub__default['default'].subscribe('reissueSelectList', function (_, data) {
10529
10490
  if (disabled) return;
@@ -10564,19 +10525,6 @@ var BsReissue = function BsReissue(props) {
10564
10525
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
10565
10526
  }
10566
10527
  });
10567
- // pubsub.subscribeOnce('reissueSelectList', (_: any, data: any) => {
10568
- // if (disabled) return;
10569
- // if (value) {
10570
- // const newValue = { ...value };
10571
- // newValue.bsReissueGoods = data?.list.map((item: any) => {
10572
- // item.money = 0;
10573
- // item.share = 0;
10574
- // item.canUpdateNumber = true;
10575
- // return item;
10576
- // });
10577
- // onChange?.(newValue);
10578
- // }
10579
- // });
10580
10528
  }, [value, disabled]);
10581
10529
  var changeHandle = function changeHandle(val, key) {
10582
10530
  var newValue = _objectSpread2({}, value);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/basic-components",
3
- "version": "0.7.15-alpha.71",
3
+ "version": "0.7.15-alpha.74",
4
4
  "description": "> TODO: description",
5
5
  "homepage": "",
6
6
  "license": "ISC",
@@ -58,5 +58,5 @@
58
58
  "publishConfig": {
59
59
  "access": "public"
60
60
  },
61
- "gitHead": "ab3d66cffd03fd0bfe02dfc8bf60212faca21fd5"
61
+ "gitHead": "aa4a53b173174e0d3b5c0fc90abfc54def9a4642"
62
62
  }