jrs-react 1.2.29 → 1.2.31

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/build/index.es.js CHANGED
@@ -3576,7 +3576,6 @@ function JRDialogMask({
3576
3576
  function JRDivMask({
3577
3577
  id = 'jr-mask'
3578
3578
  }) {
3579
- // po(`create JRDivMask id=${id}`)
3580
3579
  return /*#__PURE__*/React__default.createElement(StyledDivMask, {
3581
3580
  id: id
3582
3581
  }, /*#__PURE__*/React__default.createElement("div", {
@@ -3631,8 +3630,6 @@ class Mask extends JRHTML {
3631
3630
  }
3632
3631
  function showMask(msg, maskId = 'jr-mask') {
3633
3632
  const jrMask = document.getElementById(maskId);
3634
- // po(`showMask find id=${maskId}`)
3635
- // po('jrMask',jrMask)
3636
3633
  if (jrMask) {
3637
3634
  const jrMaskMsg = document.getElementById(`${maskId}-msg`);
3638
3635
  if (!jrMask.maskDiv) {
@@ -3885,15 +3882,13 @@ class JRSubmit extends React__default.Component {
3885
3882
  return axiosSubmit[method](url, params1, params2);
3886
3883
  }
3887
3884
  })().then(res => {
3888
- // setTimeout(()=>{
3889
3885
  this.handleResponse(res, _payload, config);
3890
- // config.removeMaskFunction?.()
3891
- // },random(2000,1000))
3892
3886
  }).catch(res => {
3893
3887
  this.handleResponse(res, _payload, config);
3894
- }).finally(() => {
3895
- config.removeMaskFunction?.();
3896
3888
  });
3889
+ // .finally(()=> {
3890
+ // config.removeMaskFunction?.()
3891
+ // })
3897
3892
  }
3898
3893
  handleResponse = (response, payload, config) => {
3899
3894
  if (Array.isArray(response)) {
@@ -3911,12 +3906,23 @@ class JRSubmit extends React__default.Component {
3911
3906
  response = config?.response?.bind(this)(response, payload) ?? response;
3912
3907
  const isSuccess = response.status >= 200 && response.status <= 299;
3913
3908
  this.setRes(isSuccess, response, config);
3914
- this.showMessage(isSuccess, isSuccess ? config.successMessage : config.failedMessage);
3915
- config.callback?.bind(this)(isSuccess, response, payload);
3909
+ if (config.delay != null) {
3910
+ setTimeout(() => {
3911
+ this.showMessage(isSuccess, isSuccess ? config.successMessage : config.failedMessage);
3912
+ config.callback?.bind(this)(isSuccess, response, payload);
3913
+ config.removeMaskFunction?.();
3914
+ }, config.delay);
3915
+ } else {
3916
+ this.showMessage(isSuccess, isSuccess ? config.successMessage : config.failedMessage);
3917
+ config.callback?.bind(this)(isSuccess, response, payload);
3918
+ config.removeMaskFunction?.();
3919
+ }
3916
3920
  };
3917
3921
  showMessage(success, message) {
3918
- // po('success',success)
3919
- // po('message',message)
3922
+ if (message) {
3923
+ po('success', success);
3924
+ po('message', message);
3925
+ }
3920
3926
  }
3921
3927
  renderer() {
3922
3928
  return;
@@ -3951,27 +3957,23 @@ const FreeType = ({
3951
3957
  }
3952
3958
  };
3953
3959
  const StyledJRFrame = styled.div`
3960
+ color:#525252;
3961
+ background:white;
3962
+
3954
3963
  position:relative;
3955
3964
  display:flex;
3956
3965
  flex:1;
3957
3966
  overflow:hidden;
3958
3967
 
3959
- > *{
3960
- Xborder:1px solid gray;
3961
- }
3962
3968
  >main{
3963
3969
  display:flex;
3964
3970
  flex:1;
3965
3971
  overflow:hidden;
3966
3972
  flex-direction: column;
3967
3973
  > *{
3968
- XXborder:1px solid gray;
3969
- XXmin-height:30px;
3970
3974
  }
3971
3975
 
3972
3976
  >header{
3973
- XXborder:1px solid red;
3974
- XXoverflow: overlay;
3975
3977
  }
3976
3978
  >main{
3977
3979
  display:flex;
@@ -3981,13 +3983,12 @@ const StyledJRFrame = styled.div`
3981
3983
  >main{
3982
3984
  width:100%;
3983
3985
  xdisplay:flex;
3984
- xflex:1;
3986
+ flex:1;
3985
3987
  overflow: overlay;
3986
3988
  }
3987
3989
 
3988
3990
  }
3989
3991
  >footer{
3990
- XXborder:1px solid blue;
3991
3992
  overflow: overlay;
3992
3993
  }
3993
3994
 
@@ -4000,7 +4001,7 @@ class JRFrame extends JRSubmit {
4000
4001
  type,
4001
4002
  props
4002
4003
  } = this.props.mask;
4003
- this.maskId = `mask-${this.rid}`;
4004
+ this.maskId = `mask-${props.id ?? this.rid}`;
4004
4005
  return /*#__PURE__*/React__default.createElement(type, {
4005
4006
  ...props,
4006
4007
  id: this.maskId
@@ -4010,7 +4011,7 @@ class JRFrame extends JRSubmit {
4010
4011
  return /*#__PURE__*/React__default.createElement(StyledJRFrame, {
4011
4012
  id: this.props.id,
4012
4013
  style: this.props.style,
4013
- className: `jr-frame`
4014
+ className: `jr-frame ${this.props.popup !== true ? this.props.className : ''}`
4014
4015
  }, /*#__PURE__*/React__default.createElement(FreeType, {
4015
4016
  tag: "div",
4016
4017
  config: this.props.start,
@@ -4739,7 +4740,6 @@ function styleInject(css, ref) {
4739
4740
  }
4740
4741
 
4741
4742
  var css_248z = ".Style-module_test__LrdEc{border:1px solid red;color:red}.Style-module_withMask__LPcai{overflow:hidden!important;position:relative;user-select:none;&:after{a:#868686cc;background:#868686cc;border-radius:inherit;bottom:0;content:\"\";height:10000px;left:0;position:absolute;right:0;top:0;width:10000px}}mask{background:#868686cc;border-radius:inherit;bottom:0;height:10000px;left:0;position:absolute;right:0;top:0;width:10000px}";
4742
- var style = {"test":"Style-module_test__LrdEc","withMask":"Style-module_withMask__LPcai"};
4743
4743
  styleInject(css_248z);
4744
4744
 
4745
4745
  const StyledJRWindow = styled.div`
@@ -4815,11 +4815,8 @@ class JRWindow extends JRFrame {
4815
4815
  this.mask.style.height = '10000px';
4816
4816
  this.mask.style.width = '10000px';
4817
4817
  target.appendChild(this.mask);
4818
- po('style.mask', style.mask);
4819
- po('addMask+++++++++++++++++++++++++++');
4820
4818
  };
4821
4819
  removeMaskFromTarget = () => {
4822
- po('removeMask-----------------------');
4823
4820
  this.mask.remove();
4824
4821
  };
4825
4822
  backdropOn(on) {
@@ -5127,7 +5124,6 @@ const Ths = ({
5127
5124
  } else {
5128
5125
  content = column.label;
5129
5126
  }
5130
- // style.textAlign=align
5131
5127
  return /*#__PURE__*/React__default.createElement("th", {
5132
5128
  key: colIndex,
5133
5129
  style: {
@@ -5220,11 +5216,6 @@ const Td = ({
5220
5216
  value,
5221
5217
  record
5222
5218
  }, {});
5223
- const setStyle = _style => {
5224
- style = _style;
5225
- };
5226
- setStyle.bind(table);
5227
- render?.bind(table);
5228
5219
  if (type) {
5229
5220
  const typeStyle = flexType(_typeStyle, table, {
5230
5221
  record
@@ -5239,14 +5230,17 @@ const Td = ({
5239
5230
  } : onChange,
5240
5231
  value,
5241
5232
  style: typeStyle,
5242
- render,
5233
+ render: render?.bind(table),
5243
5234
  ...column,
5244
5235
  ...funcProps?.bind(table)({
5245
5236
  value
5246
5237
  })
5247
5238
  });
5248
5239
  } else if (render) {
5249
- content = render({
5240
+ const setStyle = _style => {
5241
+ style = _style;
5242
+ };
5243
+ content = render.bind(table)({
5250
5244
  index: trIndex,
5251
5245
  groupIndex: tbodyIndex,
5252
5246
  value,
@@ -5301,7 +5295,7 @@ const TBody = ({
5301
5295
  table,
5302
5296
  tbodyIndex
5303
5297
  };
5304
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("tbody", {
5298
+ return /*#__PURE__*/React__default.createElement("tbody", {
5305
5299
  key: `tbody${tbodyIndex}`
5306
5300
  }, groupData?.length > 0 && /*#__PURE__*/React__default.createElement(GroupHeader, _extends({
5307
5301
  groupData: groupData,
@@ -5326,7 +5320,7 @@ const TBody = ({
5326
5320
  }), groupData?.length > 0 && /*#__PURE__*/React__default.createElement(GroupFooter, _extends({
5327
5321
  groupData: groupData,
5328
5322
  columns: groupFooter
5329
- }, neededProps))));
5323
+ }, neededProps)));
5330
5324
  };
5331
5325
  const TBodies = ({
5332
5326
  groupHeader,
@@ -5335,18 +5329,12 @@ const TBodies = ({
5335
5329
  dataSource: _dataSource,
5336
5330
  table
5337
5331
  }) => {
5338
- // po('--TBodies--')
5339
5332
  const isGroupDataType = Array.isArray(_dataSource?.[0]);
5340
5333
  const dataSource = isGroupDataType ? _dataSource : [_dataSource];
5341
-
5342
- // po('dataSource',dataSource)
5343
5334
  return dataSource?.map((groupData, tbodyIndex, c) => {
5344
5335
  return /*#__PURE__*/React__default.createElement(TBody, {
5345
5336
  key: `tbody${tbodyIndex}`,
5346
- table: table
5347
- // dataSource={dataSource}
5348
- // dataGroup={groupData}
5349
- ,
5337
+ table: table,
5350
5338
  groupData: groupData,
5351
5339
  tbodyIndex: tbodyIndex,
5352
5340
  groupHeader: groupHeader,
@@ -5362,8 +5350,6 @@ const StyledJRTable = styled.div`
5362
5350
  --column-b-hover-color:#eeeeee;
5363
5351
 
5364
5352
  position: relative;
5365
- background: var(--column-b-color);
5366
- border:1px solid var(--column-bd-color);
5367
5353
 
5368
5354
  display:flex;
5369
5355
  flex-direction: column;
@@ -5403,7 +5389,6 @@ const StyledJRTable = styled.div`
5403
5389
  padding: 2px 6px;
5404
5390
  background: linear-gradient(180deg, rgba(227, 227, 226, 1) 0%, rgba(255, 255, 255, 1) 25%, rgba(210, 210, 210, 1) 100%);
5405
5391
  box-shadow: 2px 2px 2px 0 #ffffffd6 inset, -1px -1px 2px 0px #8a847dbf inset;
5406
- color: #525252;
5407
5392
  white-space: nowrap;
5408
5393
  }
5409
5394
  }
@@ -5412,21 +5397,10 @@ const StyledJRTable = styled.div`
5412
5397
  position: sticky;
5413
5398
  bottom: -1px;
5414
5399
 
5415
- Xtr:nth-child(1){
5416
- th{
5417
- Xborder-top:1px solid var(--column-bd-color);
5418
- }
5419
- }
5420
- Xth:nth-child(1){
5421
- Xborder-left:1px solid var(--column-bd-color);
5422
- }
5423
-
5424
5400
  th{
5425
5401
  height:32px;
5426
5402
  padding: 4px;
5427
5403
  background: #e4e4e4;
5428
- xbackground: linear-gradient(180deg, rgba(227, 227, 226, 1) 0%, rgba(255, 255, 255, 1) 25%, rgba(210, 210, 210, 1) 100%);
5429
- xbox-shadow: 2px 2px 2px 0 #ffffffd6 inset, -1px -1px 2px 0px #8a847dbf inset;
5430
5404
  color: #525252;
5431
5405
  white-space: nowrap;
5432
5406
 
@@ -5440,7 +5414,6 @@ const StyledJRTable = styled.div`
5440
5414
  tbody{
5441
5415
  tr{
5442
5416
  transition: background .3s linear;
5443
- background:var(--column-b-color);
5444
5417
  a:#ededed;
5445
5418
  th{
5446
5419
  color:#444444;
@@ -5453,7 +5426,6 @@ const StyledJRTable = styled.div`
5453
5426
  }
5454
5427
  tr:hover{
5455
5428
  background:var(--column-b-hover-color);
5456
-
5457
5429
  }
5458
5430
 
5459
5431
  tr.jr-group-header
@@ -6549,4 +6521,4 @@ class JRText extends JRInput {
6549
6521
  }
6550
6522
  }
6551
6523
 
6552
- export { JRAlert, JRButton, JRCheckbox, JRDivMask, JRFields, JRFrame, JRDialogMask as JRMask, JRRadio, JRSelect, JRSubmit, JRTable, JRTestReact, JRText, JRWindow, random, showMask };
6524
+ export { JRAlert, JRButton, JRCheckbox, JRDivMask, JRFields, JRFrame, JRDialogMask as JRMask, JRRadio, JRSelect, JRSubmit, JRTable, JRTestReact, JRText, JRWindow, po, random, showMask };
package/build/index.js CHANGED
@@ -3603,7 +3603,6 @@ function JRDialogMask({
3603
3603
  function JRDivMask({
3604
3604
  id = 'jr-mask'
3605
3605
  }) {
3606
- // po(`create JRDivMask id=${id}`)
3607
3606
  return /*#__PURE__*/React__default["default"].createElement(StyledDivMask, {
3608
3607
  id: id
3609
3608
  }, /*#__PURE__*/React__default["default"].createElement("div", {
@@ -3658,8 +3657,6 @@ class Mask extends JRHTML {
3658
3657
  }
3659
3658
  function showMask(msg, maskId = 'jr-mask') {
3660
3659
  const jrMask = document.getElementById(maskId);
3661
- // po(`showMask find id=${maskId}`)
3662
- // po('jrMask',jrMask)
3663
3660
  if (jrMask) {
3664
3661
  const jrMaskMsg = document.getElementById(`${maskId}-msg`);
3665
3662
  if (!jrMask.maskDiv) {
@@ -3912,15 +3909,13 @@ class JRSubmit extends React__default["default"].Component {
3912
3909
  return axiosSubmit[method](url, params1, params2);
3913
3910
  }
3914
3911
  })().then(res => {
3915
- // setTimeout(()=>{
3916
3912
  this.handleResponse(res, _payload, config);
3917
- // config.removeMaskFunction?.()
3918
- // },random(2000,1000))
3919
3913
  }).catch(res => {
3920
3914
  this.handleResponse(res, _payload, config);
3921
- }).finally(() => {
3922
- config.removeMaskFunction?.();
3923
3915
  });
3916
+ // .finally(()=> {
3917
+ // config.removeMaskFunction?.()
3918
+ // })
3924
3919
  }
3925
3920
  handleResponse = (response, payload, config) => {
3926
3921
  if (Array.isArray(response)) {
@@ -3938,12 +3933,23 @@ class JRSubmit extends React__default["default"].Component {
3938
3933
  response = config?.response?.bind(this)(response, payload) ?? response;
3939
3934
  const isSuccess = response.status >= 200 && response.status <= 299;
3940
3935
  this.setRes(isSuccess, response, config);
3941
- this.showMessage(isSuccess, isSuccess ? config.successMessage : config.failedMessage);
3942
- config.callback?.bind(this)(isSuccess, response, payload);
3936
+ if (config.delay != null) {
3937
+ setTimeout(() => {
3938
+ this.showMessage(isSuccess, isSuccess ? config.successMessage : config.failedMessage);
3939
+ config.callback?.bind(this)(isSuccess, response, payload);
3940
+ config.removeMaskFunction?.();
3941
+ }, config.delay);
3942
+ } else {
3943
+ this.showMessage(isSuccess, isSuccess ? config.successMessage : config.failedMessage);
3944
+ config.callback?.bind(this)(isSuccess, response, payload);
3945
+ config.removeMaskFunction?.();
3946
+ }
3943
3947
  };
3944
3948
  showMessage(success, message) {
3945
- // po('success',success)
3946
- // po('message',message)
3949
+ if (message) {
3950
+ po('success', success);
3951
+ po('message', message);
3952
+ }
3947
3953
  }
3948
3954
  renderer() {
3949
3955
  return;
@@ -3978,27 +3984,23 @@ const FreeType = ({
3978
3984
  }
3979
3985
  };
3980
3986
  const StyledJRFrame = styled__default["default"].div`
3987
+ color:#525252;
3988
+ background:white;
3989
+
3981
3990
  position:relative;
3982
3991
  display:flex;
3983
3992
  flex:1;
3984
3993
  overflow:hidden;
3985
3994
 
3986
- > *{
3987
- Xborder:1px solid gray;
3988
- }
3989
3995
  >main{
3990
3996
  display:flex;
3991
3997
  flex:1;
3992
3998
  overflow:hidden;
3993
3999
  flex-direction: column;
3994
4000
  > *{
3995
- XXborder:1px solid gray;
3996
- XXmin-height:30px;
3997
4001
  }
3998
4002
 
3999
4003
  >header{
4000
- XXborder:1px solid red;
4001
- XXoverflow: overlay;
4002
4004
  }
4003
4005
  >main{
4004
4006
  display:flex;
@@ -4008,13 +4010,12 @@ const StyledJRFrame = styled__default["default"].div`
4008
4010
  >main{
4009
4011
  width:100%;
4010
4012
  xdisplay:flex;
4011
- xflex:1;
4013
+ flex:1;
4012
4014
  overflow: overlay;
4013
4015
  }
4014
4016
 
4015
4017
  }
4016
4018
  >footer{
4017
- XXborder:1px solid blue;
4018
4019
  overflow: overlay;
4019
4020
  }
4020
4021
 
@@ -4027,7 +4028,7 @@ class JRFrame extends JRSubmit {
4027
4028
  type,
4028
4029
  props
4029
4030
  } = this.props.mask;
4030
- this.maskId = `mask-${this.rid}`;
4031
+ this.maskId = `mask-${props.id ?? this.rid}`;
4031
4032
  return /*#__PURE__*/React__default["default"].createElement(type, {
4032
4033
  ...props,
4033
4034
  id: this.maskId
@@ -4037,7 +4038,7 @@ class JRFrame extends JRSubmit {
4037
4038
  return /*#__PURE__*/React__default["default"].createElement(StyledJRFrame, {
4038
4039
  id: this.props.id,
4039
4040
  style: this.props.style,
4040
- className: `jr-frame`
4041
+ className: `jr-frame ${this.props.popup !== true ? this.props.className : ''}`
4041
4042
  }, /*#__PURE__*/React__default["default"].createElement(FreeType, {
4042
4043
  tag: "div",
4043
4044
  config: this.props.start,
@@ -4766,7 +4767,6 @@ function styleInject(css, ref) {
4766
4767
  }
4767
4768
 
4768
4769
  var css_248z = ".Style-module_test__LrdEc{border:1px solid red;color:red}.Style-module_withMask__LPcai{overflow:hidden!important;position:relative;user-select:none;&:after{a:#868686cc;background:#868686cc;border-radius:inherit;bottom:0;content:\"\";height:10000px;left:0;position:absolute;right:0;top:0;width:10000px}}mask{background:#868686cc;border-radius:inherit;bottom:0;height:10000px;left:0;position:absolute;right:0;top:0;width:10000px}";
4769
- var style = {"test":"Style-module_test__LrdEc","withMask":"Style-module_withMask__LPcai"};
4770
4770
  styleInject(css_248z);
4771
4771
 
4772
4772
  const StyledJRWindow = styled__default["default"].div`
@@ -4842,11 +4842,8 @@ class JRWindow extends JRFrame {
4842
4842
  this.mask.style.height = '10000px';
4843
4843
  this.mask.style.width = '10000px';
4844
4844
  target.appendChild(this.mask);
4845
- po('style.mask', style.mask);
4846
- po('addMask+++++++++++++++++++++++++++');
4847
4845
  };
4848
4846
  removeMaskFromTarget = () => {
4849
- po('removeMask-----------------------');
4850
4847
  this.mask.remove();
4851
4848
  };
4852
4849
  backdropOn(on) {
@@ -5154,7 +5151,6 @@ const Ths = ({
5154
5151
  } else {
5155
5152
  content = column.label;
5156
5153
  }
5157
- // style.textAlign=align
5158
5154
  return /*#__PURE__*/React__default["default"].createElement("th", {
5159
5155
  key: colIndex,
5160
5156
  style: {
@@ -5247,11 +5243,6 @@ const Td = ({
5247
5243
  value,
5248
5244
  record
5249
5245
  }, {});
5250
- const setStyle = _style => {
5251
- style = _style;
5252
- };
5253
- setStyle.bind(table);
5254
- render?.bind(table);
5255
5246
  if (type) {
5256
5247
  const typeStyle = flexType(_typeStyle, table, {
5257
5248
  record
@@ -5266,14 +5257,17 @@ const Td = ({
5266
5257
  } : onChange,
5267
5258
  value,
5268
5259
  style: typeStyle,
5269
- render,
5260
+ render: render?.bind(table),
5270
5261
  ...column,
5271
5262
  ...funcProps?.bind(table)({
5272
5263
  value
5273
5264
  })
5274
5265
  });
5275
5266
  } else if (render) {
5276
- content = render({
5267
+ const setStyle = _style => {
5268
+ style = _style;
5269
+ };
5270
+ content = render.bind(table)({
5277
5271
  index: trIndex,
5278
5272
  groupIndex: tbodyIndex,
5279
5273
  value,
@@ -5328,7 +5322,7 @@ const TBody = ({
5328
5322
  table,
5329
5323
  tbodyIndex
5330
5324
  };
5331
- return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("tbody", {
5325
+ return /*#__PURE__*/React__default["default"].createElement("tbody", {
5332
5326
  key: `tbody${tbodyIndex}`
5333
5327
  }, groupData?.length > 0 && /*#__PURE__*/React__default["default"].createElement(GroupHeader, _extends({
5334
5328
  groupData: groupData,
@@ -5353,7 +5347,7 @@ const TBody = ({
5353
5347
  }), groupData?.length > 0 && /*#__PURE__*/React__default["default"].createElement(GroupFooter, _extends({
5354
5348
  groupData: groupData,
5355
5349
  columns: groupFooter
5356
- }, neededProps))));
5350
+ }, neededProps)));
5357
5351
  };
5358
5352
  const TBodies = ({
5359
5353
  groupHeader,
@@ -5362,18 +5356,12 @@ const TBodies = ({
5362
5356
  dataSource: _dataSource,
5363
5357
  table
5364
5358
  }) => {
5365
- // po('--TBodies--')
5366
5359
  const isGroupDataType = Array.isArray(_dataSource?.[0]);
5367
5360
  const dataSource = isGroupDataType ? _dataSource : [_dataSource];
5368
-
5369
- // po('dataSource',dataSource)
5370
5361
  return dataSource?.map((groupData, tbodyIndex, c) => {
5371
5362
  return /*#__PURE__*/React__default["default"].createElement(TBody, {
5372
5363
  key: `tbody${tbodyIndex}`,
5373
- table: table
5374
- // dataSource={dataSource}
5375
- // dataGroup={groupData}
5376
- ,
5364
+ table: table,
5377
5365
  groupData: groupData,
5378
5366
  tbodyIndex: tbodyIndex,
5379
5367
  groupHeader: groupHeader,
@@ -5389,8 +5377,6 @@ const StyledJRTable = styled__default["default"].div`
5389
5377
  --column-b-hover-color:#eeeeee;
5390
5378
 
5391
5379
  position: relative;
5392
- background: var(--column-b-color);
5393
- border:1px solid var(--column-bd-color);
5394
5380
 
5395
5381
  display:flex;
5396
5382
  flex-direction: column;
@@ -5430,7 +5416,6 @@ const StyledJRTable = styled__default["default"].div`
5430
5416
  padding: 2px 6px;
5431
5417
  background: linear-gradient(180deg, rgba(227, 227, 226, 1) 0%, rgba(255, 255, 255, 1) 25%, rgba(210, 210, 210, 1) 100%);
5432
5418
  box-shadow: 2px 2px 2px 0 #ffffffd6 inset, -1px -1px 2px 0px #8a847dbf inset;
5433
- color: #525252;
5434
5419
  white-space: nowrap;
5435
5420
  }
5436
5421
  }
@@ -5439,21 +5424,10 @@ const StyledJRTable = styled__default["default"].div`
5439
5424
  position: sticky;
5440
5425
  bottom: -1px;
5441
5426
 
5442
- Xtr:nth-child(1){
5443
- th{
5444
- Xborder-top:1px solid var(--column-bd-color);
5445
- }
5446
- }
5447
- Xth:nth-child(1){
5448
- Xborder-left:1px solid var(--column-bd-color);
5449
- }
5450
-
5451
5427
  th{
5452
5428
  height:32px;
5453
5429
  padding: 4px;
5454
5430
  background: #e4e4e4;
5455
- xbackground: linear-gradient(180deg, rgba(227, 227, 226, 1) 0%, rgba(255, 255, 255, 1) 25%, rgba(210, 210, 210, 1) 100%);
5456
- xbox-shadow: 2px 2px 2px 0 #ffffffd6 inset, -1px -1px 2px 0px #8a847dbf inset;
5457
5431
  color: #525252;
5458
5432
  white-space: nowrap;
5459
5433
 
@@ -5467,7 +5441,6 @@ const StyledJRTable = styled__default["default"].div`
5467
5441
  tbody{
5468
5442
  tr{
5469
5443
  transition: background .3s linear;
5470
- background:var(--column-b-color);
5471
5444
  a:#ededed;
5472
5445
  th{
5473
5446
  color:#444444;
@@ -5480,7 +5453,6 @@ const StyledJRTable = styled__default["default"].div`
5480
5453
  }
5481
5454
  tr:hover{
5482
5455
  background:var(--column-b-hover-color);
5483
-
5484
5456
  }
5485
5457
 
5486
5458
  tr.jr-group-header
@@ -6590,5 +6562,6 @@ exports.JRTable = JRTable;
6590
6562
  exports.JRTestReact = JRTestReact;
6591
6563
  exports.JRText = JRText;
6592
6564
  exports.JRWindow = JRWindow;
6565
+ exports.po = po;
6593
6566
  exports.random = random;
6594
6567
  exports.showMask = showMask;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jrs-react",
3
- "version": "1.2.29",
3
+ "version": "1.2.31",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "module": "build/index.es.js",
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import styled from "styled-components";
3
3
  import JRSubmit from "../JRSubmit";
4
- import { po, random } from "../JRUtils";
4
+ import { random } from "../JRUtils";
5
5
 
6
6
  export const FreeType=({tag:Tag,config,me,className})=>{
7
7
  if(typeof config==='function'){
@@ -18,27 +18,23 @@ export const FreeType=({tag:Tag,config,me,className})=>{
18
18
  }
19
19
 
20
20
  const StyledJRFrame=styled.div`
21
+ color:#525252;
22
+ background:white;
23
+
21
24
  position:relative;
22
25
  display:flex;
23
26
  flex:1;
24
27
  overflow:hidden;
25
28
 
26
- > *{
27
- Xborder:1px solid gray;
28
- }
29
29
  >main{
30
30
  display:flex;
31
31
  flex:1;
32
32
  overflow:hidden;
33
33
  flex-direction: column;
34
34
  > *{
35
- XXborder:1px solid gray;
36
- XXmin-height:30px;
37
35
  }
38
36
 
39
37
  >header{
40
- XXborder:1px solid red;
41
- XXoverflow: overlay;
42
38
  }
43
39
  >main{
44
40
  display:flex;
@@ -48,13 +44,12 @@ const StyledJRFrame=styled.div`
48
44
  >main{
49
45
  width:100%;
50
46
  xdisplay:flex;
51
- xflex:1;
47
+ flex:1;
52
48
  overflow: overlay;
53
49
  }
54
50
 
55
51
  }
56
52
  >footer{
57
- XXborder:1px solid blue;
58
53
  overflow: overlay;
59
54
  }
60
55
 
@@ -65,7 +60,7 @@ export default class JRFrame extends JRSubmit {
65
60
  mask=this.props.mask
66
61
  ?()=>{
67
62
  const {type,props}=this.props.mask
68
- this.maskId=`mask-${this.rid}`
63
+ this.maskId=`mask-${props.id??this.rid}`
69
64
  return React.createElement(
70
65
  type
71
66
  ,{
@@ -76,8 +71,9 @@ export default class JRFrame extends JRSubmit {
76
71
  }
77
72
  :null
78
73
  renderer(){
79
- return <StyledJRFrame id={this.props.id} style={this.props.style} className={`jr-frame`} >
80
-
74
+ return <StyledJRFrame id={this.props.id} style={this.props.style}
75
+ className={`jr-frame ${(this.props.popup!==true )? this.props.className:''}`}
76
+ >
81
77
  <FreeType tag='div' config={this.props.start} me={this} className={'start'}/>
82
78
  <main>
83
79
  <FreeType tag='header' config={this.props.top} me={this}/>
@@ -0,0 +1,30 @@
1
+ import styled from "styled-components"
2
+
3
+ const StyleJValue=styled.div`
4
+ background: #efefef;
5
+ border-width: 1px;
6
+ border-style: solid;
7
+ border-color: #d9d9d9;
8
+
9
+ box-sizing: border-box;
10
+ margin: 0;
11
+ padding: 3px 11px;
12
+ color: rgba(0, 0, 0, 0.88);
13
+ font-size: 14px;
14
+ line-height: 1.5714285714285714;
15
+ list-style: none;
16
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
17
+ position: relative;
18
+ display: inline-block;
19
+ width: 100%;
20
+ min-width: 0;
21
+ border-radius: 6px;
22
+ transition: all 0.2s;
23
+ min-height:30px;
24
+ `
25
+ export default function JValue({value,record,menu,render,style,align='align',...param}){
26
+ const _value=render?.({value,record}) ?? value
27
+ return <StyleJValue style={{textAlign:align,...style}}>
28
+ {_value}
29
+ </StyleJValue>
30
+ }
@@ -154,7 +154,6 @@ export default function JRDialogMask({id='jr-mask'}){
154
154
  }
155
155
 
156
156
  export function JRDivMask({id='jr-mask'}){
157
- // po(`create JRDivMask id=${id}`)
158
157
  return <StyledDivMask id={id}>
159
158
  <div id={`${id}-msg`} >MSG</div>
160
159
  <div className="cs-loader-inner">
@@ -216,8 +215,6 @@ class Mask extends JRHTML{
216
215
 
217
216
  export function showMask(msg,maskId='jr-mask'){
218
217
  const jrMask=document.getElementById(maskId)
219
- // po(`showMask find id=${maskId}`)
220
- // po('jrMask',jrMask)
221
218
  if((jrMask)){
222
219
  const jrMaskMsg=document.getElementById(`${maskId}-msg`)
223
220
  if(!jrMask.maskDiv){
@@ -32,7 +32,7 @@ export default class JRSubmit extends React.Component {
32
32
  }
33
33
  }
34
34
  }
35
- componentDidMount() {
35
+ componentDidMount(){
36
36
  this.#methods
37
37
  .filter((method) => this[method] && this.props[method] && this.props[method].autoRun)
38
38
  .forEach((method) => {
@@ -249,17 +249,14 @@ export default class JRSubmit extends React.Component {
249
249
  }
250
250
  })()
251
251
  .then((res)=>{
252
- // setTimeout(()=>{
253
- this.handleResponse(res,_payload,config)
254
- // config.removeMaskFunction?.()
255
- // },random(2000,1000))
252
+ this.handleResponse(res,_payload,config)
256
253
  })
257
254
  .catch((res)=>{
258
255
  this.handleResponse(res,_payload,config)
259
256
  })
260
- .finally(()=> {
261
- config.removeMaskFunction?.()
262
- })
257
+ // .finally(()=> {
258
+ // config.removeMaskFunction?.()
259
+ // })
263
260
  }
264
261
 
265
262
  handleResponse=(response,payload,config)=>{
@@ -280,14 +277,27 @@ export default class JRSubmit extends React.Component {
280
277
  const isSuccess = response.status >= 200 && response.status <= 299
281
278
 
282
279
  this.setRes(isSuccess,response,config)
283
- this.showMessage(isSuccess,isSuccess?config.successMessage:config.failedMessage)
284
-
285
- config.callback?.bind(this)(isSuccess,response,payload)
280
+
281
+ if(config.delay!=null){
282
+ setTimeout(()=>{
283
+ this.showMessage(isSuccess,isSuccess?config.successMessage:config.failedMessage)
284
+ config.callback?.bind(this)(isSuccess,response,payload)
285
+ config.removeMaskFunction?.()
286
+ },config.delay)
287
+ }else{
288
+ this.showMessage(isSuccess,isSuccess?config.successMessage:config.failedMessage)
289
+ config.callback?.bind(this)(isSuccess,response,payload)
290
+ config.removeMaskFunction?.()
291
+ }
292
+
293
+
286
294
  }
287
295
 
288
296
  showMessage(success,message){
289
- // po('success',success)
290
- // po('message',message)
297
+ if(message){
298
+ po('success',success)
299
+ po('message',message)
300
+ }
291
301
  }
292
302
 
293
303
  renderer(){
@@ -6,8 +6,6 @@ export const StyledJRTable=styled.div`
6
6
  --column-b-hover-color:#eeeeee;
7
7
 
8
8
  position: relative;
9
- background: var(--column-b-color);
10
- border:1px solid var(--column-bd-color);
11
9
 
12
10
  display:flex;
13
11
  flex-direction: column;
@@ -47,7 +45,6 @@ export const StyledJRTable=styled.div`
47
45
  padding: 2px 6px;
48
46
  background: linear-gradient(180deg, rgba(227, 227, 226, 1) 0%, rgba(255, 255, 255, 1) 25%, rgba(210, 210, 210, 1) 100%);
49
47
  box-shadow: 2px 2px 2px 0 #ffffffd6 inset, -1px -1px 2px 0px #8a847dbf inset;
50
- color: #525252;
51
48
  white-space: nowrap;
52
49
  }
53
50
  }
@@ -56,21 +53,10 @@ export const StyledJRTable=styled.div`
56
53
  position: sticky;
57
54
  bottom: -1px;
58
55
 
59
- Xtr:nth-child(1){
60
- th{
61
- Xborder-top:1px solid var(--column-bd-color);
62
- }
63
- }
64
- Xth:nth-child(1){
65
- Xborder-left:1px solid var(--column-bd-color);
66
- }
67
-
68
56
  th{
69
57
  height:32px;
70
58
  padding: 4px;
71
59
  background: #e4e4e4;
72
- xbackground: linear-gradient(180deg, rgba(227, 227, 226, 1) 0%, rgba(255, 255, 255, 1) 25%, rgba(210, 210, 210, 1) 100%);
73
- xbox-shadow: 2px 2px 2px 0 #ffffffd6 inset, -1px -1px 2px 0px #8a847dbf inset;
74
60
  color: #525252;
75
61
  white-space: nowrap;
76
62
 
@@ -84,7 +70,6 @@ export const StyledJRTable=styled.div`
84
70
  tbody{
85
71
  tr{
86
72
  transition: background .3s linear;
87
- background:var(--column-b-color);
88
73
  a:#ededed;
89
74
  th{
90
75
  color:#444444;
@@ -97,7 +82,6 @@ export const StyledJRTable=styled.div`
97
82
  }
98
83
  tr:hover{
99
84
  background:var(--column-b-hover-color);
100
-
101
85
  }
102
86
 
103
87
  tr.jr-group-header
@@ -1,5 +1,5 @@
1
1
  import React from "react"
2
- import { flexType, po } from "../JRUtils"
2
+ import { flexType } from "../JRUtils"
3
3
  import styled from "styled-components"
4
4
 
5
5
  const StyledSeparator=styled.tbody`
@@ -31,7 +31,6 @@ const Ths=({table,groupData,groupIndex,deep,rowColumn,rowIndex})=>{
31
31
  }else{
32
32
  content=column.label
33
33
  }
34
- // style.textAlign=align
35
34
  return <th key={colIndex}
36
35
 
37
36
  style={{textAlign:align,...style}}
@@ -101,15 +100,10 @@ const Td=({column:_column,record,tbodyIndex,trIndex,tdIndex,table})=>{
101
100
  setValue(record,targetValue)
102
101
  table.setValue(table.getValue())
103
102
  }
104
-
105
103
 
106
104
  const value=getValue(record)
107
105
  let style=render?{}:flexType(_style,table,{value,record},{})
108
- const setStyle=(_style)=>{
109
- style=_style
110
- }
111
- setStyle.bind(table)
112
- render?.bind(table)
106
+
113
107
  if(type){
114
108
  const typeStyle=flexType(_typeStyle,table,{record},{})
115
109
 
@@ -121,13 +115,16 @@ const Td=({column:_column,record,tbodyIndex,trIndex,tdIndex,table})=>{
121
115
  :onChange
122
116
  ,value
123
117
  ,style:typeStyle
124
- ,render
118
+ ,render:render?.bind(table)
125
119
  ,...column
126
120
  ,...funcProps?.bind(table)({value})
127
121
 
128
122
  })
129
123
  }else if(render){
130
- content=render({index:trIndex,groupIndex:tbodyIndex,value,record,onChange,setStyle})
124
+ const setStyle=(_style)=>{
125
+ style=_style
126
+ }
127
+ content=render.bind(table)({index:trIndex,groupIndex:tbodyIndex,value,record,onChange,setStyle})
131
128
  }else{
132
129
  content=value
133
130
  }
@@ -146,7 +143,6 @@ const Td=({column:_column,record,tbodyIndex,trIndex,tdIndex,table})=>{
146
143
  }
147
144
  const Tds=({leafColumns,record,table,tbodyIndex,trIndex})=>{
148
145
  return leafColumns?.map((column,tdIndex)=>{
149
-
150
146
  return <Td
151
147
  column={column}
152
148
  key={tdIndex}
@@ -162,59 +158,51 @@ const Tds=({leafColumns,record,table,tbodyIndex,trIndex})=>{
162
158
 
163
159
 
164
160
  const TBody=({groupData,groupHeader,leafColumns,groupFooter,table,tbodyIndex})=>{
165
-
166
161
  const neededProps={table,tbodyIndex}
167
- return <>
168
- <tbody key={`tbody${tbodyIndex}`}>
169
- {(groupData?.length >0 ) && <GroupHeader
170
- groupData={groupData}
171
- columns={groupHeader}
172
- {...neededProps}
173
- />}
174
- {
175
- groupData?.map?.((record,trIndex)=>{
176
- const onRowClick=table.props.onRowClick?.bind(table)
177
- return <tr key={trIndex}
178
- onClick={()=>{
179
- onRowClick?.({record,index:trIndex,groupIndex:tbodyIndex})
180
- }}
181
- >
182
- <Tds
183
- record={record}
184
- trIndex={trIndex}
185
-
186
- {...neededProps}
187
- leafColumns={leafColumns}
188
- />
189
- </tr>
190
- })
191
- }
192
- {(groupData?.length > 0) && <GroupFooter
193
- groupData={groupData}
194
- columns={groupFooter}
195
- {...neededProps}
196
- />}
162
+ return <tbody key={`tbody${tbodyIndex}`}>
163
+ {(groupData?.length >0 ) && <GroupHeader
164
+ groupData={groupData}
165
+ columns={groupHeader}
166
+ {...neededProps}
167
+ />}
168
+ {
169
+ groupData?.map?.((record,trIndex)=>{
170
+ const onRowClick=table.props.onRowClick?.bind(table)
171
+ return <tr key={trIndex}
172
+ onClick={()=>{
173
+ onRowClick?.({record,index:trIndex,groupIndex:tbodyIndex})
174
+ }}
175
+ >
176
+ <Tds
177
+ record={record}
178
+ trIndex={trIndex}
179
+
180
+ {...neededProps}
181
+ leafColumns={leafColumns}
182
+ />
183
+ </tr>
184
+ })
185
+ }
186
+ {(groupData?.length > 0) && <GroupFooter
187
+ groupData={groupData}
188
+ columns={groupFooter}
189
+ {...neededProps}
190
+ />}
197
191
 
198
- </tbody>
199
- {/* {(dataSource.length > (tbodyIndex+1)) && <Separator length={leafColumns.length} key={`sp-${tbodyIndex}`}></Separator>} */}
200
- </>
192
+ </tbody>
201
193
  }
202
194
 
203
195
  export const TBodies=({groupHeader,leafColumns,groupFooter,dataSource:_dataSource,table})=>{
204
- // po('--TBodies--')
205
196
  const isGroupDataType=Array.isArray(_dataSource?.[0])
206
197
 
207
198
  const dataSource=isGroupDataType
208
199
  ?_dataSource
209
200
  :[_dataSource]
210
201
 
211
- // po('dataSource',dataSource)
212
202
  return dataSource?.map((groupData,tbodyIndex,c)=>{
213
203
  return <TBody
214
204
  key={`tbody${tbodyIndex}`}
215
205
  table={table}
216
- // dataSource={dataSource}
217
- // dataGroup={groupData}
218
206
  groupData={groupData}
219
207
  tbodyIndex={tbodyIndex}
220
208
 
@@ -73,11 +73,8 @@ export default class JRWindow extends JRFrame {
73
73
  this.mask.style.height='10000px'
74
74
  this.mask.style.width='10000px'
75
75
  target.appendChild(this.mask)
76
- po('style.mask',style.mask)
77
- po('addMask+++++++++++++++++++++++++++')
78
76
  }
79
77
  removeMaskFromTarget=()=>{
80
- po('removeMask-----------------------')
81
78
  this.mask.remove()
82
79
  }
83
80
 
package/src/index.js CHANGED
@@ -11,13 +11,12 @@ import JRCheckbox from './components/JRInput/JRCheckbox'
11
11
  import JRRadio from './components/JRInput/JRRadio'
12
12
  import JRText from './components/JRInput/JRText'
13
13
  import JRMask,{JRDivMask,showMask} from './components/JRMask/JRMask'
14
- import {random} from './components/JRUtils'
14
+ import {random,po} from './components/JRUtils'
15
15
  export {
16
16
  JRTestReact
17
17
  ,JRSubmit,JRFrame,JRWindow,JRTable,JRFields,JRAlert
18
18
  ,JRButton
19
19
  ,JRText,JRSelect,JRCheckbox,JRRadio
20
20
  ,JRMask,JRDivMask,showMask
21
- ,random
22
-
21
+ ,random,po
23
22
  }