jrs-react 1.2.39 → 1.2.41

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
@@ -4905,8 +4905,21 @@ function styleInject(css, ref) {
4905
4905
  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}";
4906
4906
  styleInject(css_248z);
4907
4907
 
4908
+ const StyledBackdrop = styled.div`
4909
+ ${({
4910
+ $zIndex
4911
+ }) => $zIndex != null ? `z-index:${$zIndex};` : null}
4912
+ background : #868686cc;
4913
+ height:100vh;
4914
+ width:100vw;
4915
+ position: fixed;
4916
+ top:0;
4917
+ left:0;
4918
+ `;
4908
4919
  const StyledJRWindow = styled.div`
4909
- z-index:1;
4920
+ ${({
4921
+ $zIndex
4922
+ }) => $zIndex != null ? `z-index:${$zIndex};` : null}
4910
4923
 
4911
4924
  --jr-window-radius:3px;
4912
4925
  --padding-child:8px;
@@ -4932,9 +4945,6 @@ const StyledJRWindow = styled.div`
4932
4945
  $yh
4933
4946
  }) => $yh.height}px;
4934
4947
 
4935
- xxxwidth: ${({
4936
- $width = 300
4937
- }) => typeof $width === 'string' ? '50%' : `${$width}px`};
4938
4948
  overflow: hidden;
4939
4949
 
4940
4950
  display: flex;
@@ -4957,6 +4967,27 @@ const StyledJRWindow = styled.div`
4957
4967
  }
4958
4968
  }
4959
4969
  `;
4970
+ class Backdrop extends JRHTML {
4971
+ backdropConfig = {
4972
+ yo: 'div',
4973
+ style: {
4974
+ background: '#ff000029',
4975
+ height: '100%',
4976
+ width: '100%',
4977
+ position: 'absolute',
4978
+ top: 0,
4979
+ left: 0
4980
+ }
4981
+ };
4982
+ show() {
4983
+ this.backdrop = this.agregarHijo(this.backdropConfig);
4984
+ po('this.hijos', this.hijos);
4985
+ }
4986
+ hide() {
4987
+ this.yo.removeChild(this.yo.children[this.yo.children.length - 1]);
4988
+ this.hijos = [];
4989
+ }
4990
+ }
4960
4991
  class JRWindow extends JRFrame {
4961
4992
  // x=0
4962
4993
  // y=0
@@ -4968,7 +4999,20 @@ class JRWindow extends JRFrame {
4968
4999
  super(props);
4969
5000
  this.ref = /*#__PURE__*/React__default.createRef();
4970
5001
  this.titleBarRef = /*#__PURE__*/React__default.createRef();
4971
- // this.init()
5002
+ }
5003
+ createBackdrop() {
5004
+ if (typeof this.props.backdrop === 'string') {
5005
+ po('find and create backdrop', this.props.backdrop);
5006
+ const target = document.getElementById(this.props.backdrop);
5007
+ if (target) {
5008
+ this.backdropTarget = new Backdrop({
5009
+ yo: target,
5010
+ style: {
5011
+ position: 'relative'
5012
+ }
5013
+ });
5014
+ }
5015
+ }
4972
5016
  }
4973
5017
  addMaskToTarget = target => {
4974
5018
  this.mask = document.createElement('div');
@@ -4986,24 +5030,34 @@ class JRWindow extends JRFrame {
4986
5030
  removeMaskFromTarget = () => {
4987
5031
  this.mask.remove();
4988
5032
  };
4989
- backdropOn(on) {
4990
- const target = typeof this.props.backdrop === 'object' ? this.props.backdrop : typeof this.props.backdrop === 'string' ? document.getElementById(this.props.backdrop) : document.body;
4991
- target?.classList[on ? 'add' : 'remove']('withMask');
4992
- }
5033
+
5034
+ // backdropOn(on){
5035
+ // const target=(typeof this.props.backdrop)==='object'
5036
+ // ?this.props.backdrop
5037
+ // :typeof this.props.backdrop ==='string'
5038
+ // ?document.getElementById(this.props.backdrop)
5039
+ // :document.body
5040
+ // target?.classList[on?'add':'remove']('withMask')
5041
+ // }
5042
+
4993
5043
  componentDidMount() {
4994
5044
  super.componentDidMount();
4995
- if (this.props.backdrop && this.props.open) {
4996
- this.backdropOn(this.props.open);
4997
- }
5045
+ po('-------------------------componentDidMount-------------------------');
5046
+ this.createBackdrop();
5047
+ // if(this.props.backdrop && this.props.open){
5048
+ // this.backdropTarget.show()
5049
+ // }
5050
+
4998
5051
  if (this.props.open) {
4999
5052
  this.open();
5000
5053
  }
5001
5054
  }
5002
5055
  open() {
5056
+ this.backdropTarget.show();
5003
5057
  this.props.onOpen?.bind(this)();
5004
5058
  }
5005
5059
  close() {
5006
- // this.init()
5060
+ this.backdropTarget.hide();
5007
5061
  this.props.onClose?.bind(this)();
5008
5062
  }
5009
5063
  componentDidUpdate(prevProps, prevState, snapshot) {
@@ -5013,27 +5067,11 @@ class JRWindow extends JRFrame {
5013
5067
  } else if (this.props.open === false && prevProps.open) {
5014
5068
  this.close();
5015
5069
  }
5016
- if (this.props.backdrop && this.props.open != prevProps.open) {
5017
- this.backdropOn(this.props.open);
5018
- }
5070
+ // if(this.props.backdrop && this.props.open!=prevProps.open){
5071
+ // this.backdropOn(this.props.open)
5072
+ // }
5019
5073
  }
5020
5074
  }
5021
- // init(){
5022
- // if(this.props.width?.indexOf?.('%')>-1){
5023
- // this.width=(this.props.width.split('%')[0]*window.innerWidth)/100
5024
- // }else{
5025
- // this.width=window.innerWidth>=(this.props.width??this.width)?(this.props.width??this.width):window.innerWidth
5026
- // }
5027
- // this.x=this.props.x??((window.innerWidth-(this.width))/2)
5028
-
5029
- // if(this.props.height?.indexOf?.('%')>-1){
5030
- // this.height=(this.props.height.split('%')[0]*window.innerHeight)/100
5031
- // }else{
5032
- // this.height=window.innerHeight>=(this.props.height??this.height)?(this.props.height??this.height):window.innerHeight
5033
- // }
5034
- // this.y=this.props.y??(window.innerHeight-(this.height))/2
5035
- // }
5036
-
5037
5075
  get xw() {
5038
5076
  let width;
5039
5077
  if (this.props.width?.indexOf?.('%') > -1) {
@@ -5059,28 +5097,33 @@ class JRWindow extends JRFrame {
5059
5097
  };
5060
5098
  }
5061
5099
  renderer() {
5062
- return this.props.popup === true ? this.props.open ? /*#__PURE__*/React__default.createElement(StyledJRWindow, {
5100
+ return this.props.popup === true ? this.props.open ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(StyledJRWindow, {
5101
+ $zIndex: this.props.zIndex,
5063
5102
  rule: 'dialog',
5064
5103
  ref: this.ref,
5065
5104
  className: `jr-window ${this.props.className ?? ''}`,
5066
5105
  $xw: this.xw,
5067
5106
  $yh: this.yh,
5068
5107
  $thick: this.thick
5069
- // $width={this.width}
5070
- // $height={this.height}
5071
- }, /*#__PURE__*/React__default.createElement("main", null, /*#__PURE__*/React__default.createElement(TitleBar, {
5108
+ }, /*#__PURE__*/React__default.createElement("main", {
5109
+ style: {
5110
+ zIndex: 1
5111
+ }
5112
+ }, /*#__PURE__*/React__default.createElement(TitleBar, {
5072
5113
  titleBarRef: this.titleBarRef,
5073
5114
  windowRef: this.ref,
5074
5115
  window: this,
5075
5116
  title: this.props.title,
5076
5117
  thick: this.thick,
5077
5118
  resizable: this.props.resizable
5078
- }), /*#__PURE__*/React__default.createElement("main", null, super.renderer())), this.props.resizable !== false && /*#__PURE__*/React__default.createElement(Sliders, {
5119
+ }), /*#__PURE__*/React__default.createElement("main", null, super.renderer()), this.props.resizable !== false && /*#__PURE__*/React__default.createElement(Sliders, {
5079
5120
  thick: this.thick,
5080
5121
  windowRef: this.ref,
5081
5122
  window: this,
5082
5123
  titleBarRef: this.titleBarRef
5083
- })) : '' : super.renderer();
5124
+ })), this.props.backdrop !== false && typeof this.props.backdrop !== 'string' && /*#__PURE__*/React__default.createElement(StyledBackdrop, {
5125
+ $zIndex: this.props.zIndex
5126
+ }))) : '' : super.renderer();
5084
5127
  }
5085
5128
  }
5086
5129
 
@@ -6140,7 +6183,8 @@ class JRFields extends JRWindow {
6140
6183
  style: {
6141
6184
  ...this.props.typeStyle,
6142
6185
  ...this.props.fieldsStyle
6143
- }
6186
+ },
6187
+ xxstyle: this.props.fieldsStyle
6144
6188
  }, /*#__PURE__*/React__default.createElement(StyledGrid, {
6145
6189
  cols: this.props.cols,
6146
6190
  style: this.props.gridStyle,
package/build/index.js CHANGED
@@ -4932,8 +4932,21 @@ function styleInject(css, ref) {
4932
4932
  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}";
4933
4933
  styleInject(css_248z);
4934
4934
 
4935
+ const StyledBackdrop = styled__default["default"].div`
4936
+ ${({
4937
+ $zIndex
4938
+ }) => $zIndex != null ? `z-index:${$zIndex};` : null}
4939
+ background : #868686cc;
4940
+ height:100vh;
4941
+ width:100vw;
4942
+ position: fixed;
4943
+ top:0;
4944
+ left:0;
4945
+ `;
4935
4946
  const StyledJRWindow = styled__default["default"].div`
4936
- z-index:1;
4947
+ ${({
4948
+ $zIndex
4949
+ }) => $zIndex != null ? `z-index:${$zIndex};` : null}
4937
4950
 
4938
4951
  --jr-window-radius:3px;
4939
4952
  --padding-child:8px;
@@ -4959,9 +4972,6 @@ const StyledJRWindow = styled__default["default"].div`
4959
4972
  $yh
4960
4973
  }) => $yh.height}px;
4961
4974
 
4962
- xxxwidth: ${({
4963
- $width = 300
4964
- }) => typeof $width === 'string' ? '50%' : `${$width}px`};
4965
4975
  overflow: hidden;
4966
4976
 
4967
4977
  display: flex;
@@ -4984,6 +4994,27 @@ const StyledJRWindow = styled__default["default"].div`
4984
4994
  }
4985
4995
  }
4986
4996
  `;
4997
+ class Backdrop extends JRHTML {
4998
+ backdropConfig = {
4999
+ yo: 'div',
5000
+ style: {
5001
+ background: '#ff000029',
5002
+ height: '100%',
5003
+ width: '100%',
5004
+ position: 'absolute',
5005
+ top: 0,
5006
+ left: 0
5007
+ }
5008
+ };
5009
+ show() {
5010
+ this.backdrop = this.agregarHijo(this.backdropConfig);
5011
+ po('this.hijos', this.hijos);
5012
+ }
5013
+ hide() {
5014
+ this.yo.removeChild(this.yo.children[this.yo.children.length - 1]);
5015
+ this.hijos = [];
5016
+ }
5017
+ }
4987
5018
  class JRWindow extends JRFrame {
4988
5019
  // x=0
4989
5020
  // y=0
@@ -4995,7 +5026,20 @@ class JRWindow extends JRFrame {
4995
5026
  super(props);
4996
5027
  this.ref = /*#__PURE__*/React__default["default"].createRef();
4997
5028
  this.titleBarRef = /*#__PURE__*/React__default["default"].createRef();
4998
- // this.init()
5029
+ }
5030
+ createBackdrop() {
5031
+ if (typeof this.props.backdrop === 'string') {
5032
+ po('find and create backdrop', this.props.backdrop);
5033
+ const target = document.getElementById(this.props.backdrop);
5034
+ if (target) {
5035
+ this.backdropTarget = new Backdrop({
5036
+ yo: target,
5037
+ style: {
5038
+ position: 'relative'
5039
+ }
5040
+ });
5041
+ }
5042
+ }
4999
5043
  }
5000
5044
  addMaskToTarget = target => {
5001
5045
  this.mask = document.createElement('div');
@@ -5013,24 +5057,34 @@ class JRWindow extends JRFrame {
5013
5057
  removeMaskFromTarget = () => {
5014
5058
  this.mask.remove();
5015
5059
  };
5016
- backdropOn(on) {
5017
- const target = typeof this.props.backdrop === 'object' ? this.props.backdrop : typeof this.props.backdrop === 'string' ? document.getElementById(this.props.backdrop) : document.body;
5018
- target?.classList[on ? 'add' : 'remove']('withMask');
5019
- }
5060
+
5061
+ // backdropOn(on){
5062
+ // const target=(typeof this.props.backdrop)==='object'
5063
+ // ?this.props.backdrop
5064
+ // :typeof this.props.backdrop ==='string'
5065
+ // ?document.getElementById(this.props.backdrop)
5066
+ // :document.body
5067
+ // target?.classList[on?'add':'remove']('withMask')
5068
+ // }
5069
+
5020
5070
  componentDidMount() {
5021
5071
  super.componentDidMount();
5022
- if (this.props.backdrop && this.props.open) {
5023
- this.backdropOn(this.props.open);
5024
- }
5072
+ po('-------------------------componentDidMount-------------------------');
5073
+ this.createBackdrop();
5074
+ // if(this.props.backdrop && this.props.open){
5075
+ // this.backdropTarget.show()
5076
+ // }
5077
+
5025
5078
  if (this.props.open) {
5026
5079
  this.open();
5027
5080
  }
5028
5081
  }
5029
5082
  open() {
5083
+ this.backdropTarget.show();
5030
5084
  this.props.onOpen?.bind(this)();
5031
5085
  }
5032
5086
  close() {
5033
- // this.init()
5087
+ this.backdropTarget.hide();
5034
5088
  this.props.onClose?.bind(this)();
5035
5089
  }
5036
5090
  componentDidUpdate(prevProps, prevState, snapshot) {
@@ -5040,27 +5094,11 @@ class JRWindow extends JRFrame {
5040
5094
  } else if (this.props.open === false && prevProps.open) {
5041
5095
  this.close();
5042
5096
  }
5043
- if (this.props.backdrop && this.props.open != prevProps.open) {
5044
- this.backdropOn(this.props.open);
5045
- }
5097
+ // if(this.props.backdrop && this.props.open!=prevProps.open){
5098
+ // this.backdropOn(this.props.open)
5099
+ // }
5046
5100
  }
5047
5101
  }
5048
- // init(){
5049
- // if(this.props.width?.indexOf?.('%')>-1){
5050
- // this.width=(this.props.width.split('%')[0]*window.innerWidth)/100
5051
- // }else{
5052
- // this.width=window.innerWidth>=(this.props.width??this.width)?(this.props.width??this.width):window.innerWidth
5053
- // }
5054
- // this.x=this.props.x??((window.innerWidth-(this.width))/2)
5055
-
5056
- // if(this.props.height?.indexOf?.('%')>-1){
5057
- // this.height=(this.props.height.split('%')[0]*window.innerHeight)/100
5058
- // }else{
5059
- // this.height=window.innerHeight>=(this.props.height??this.height)?(this.props.height??this.height):window.innerHeight
5060
- // }
5061
- // this.y=this.props.y??(window.innerHeight-(this.height))/2
5062
- // }
5063
-
5064
5102
  get xw() {
5065
5103
  let width;
5066
5104
  if (this.props.width?.indexOf?.('%') > -1) {
@@ -5086,28 +5124,33 @@ class JRWindow extends JRFrame {
5086
5124
  };
5087
5125
  }
5088
5126
  renderer() {
5089
- return this.props.popup === true ? this.props.open ? /*#__PURE__*/React__default["default"].createElement(StyledJRWindow, {
5127
+ return this.props.popup === true ? this.props.open ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(StyledJRWindow, {
5128
+ $zIndex: this.props.zIndex,
5090
5129
  rule: 'dialog',
5091
5130
  ref: this.ref,
5092
5131
  className: `jr-window ${this.props.className ?? ''}`,
5093
5132
  $xw: this.xw,
5094
5133
  $yh: this.yh,
5095
5134
  $thick: this.thick
5096
- // $width={this.width}
5097
- // $height={this.height}
5098
- }, /*#__PURE__*/React__default["default"].createElement("main", null, /*#__PURE__*/React__default["default"].createElement(TitleBar, {
5135
+ }, /*#__PURE__*/React__default["default"].createElement("main", {
5136
+ style: {
5137
+ zIndex: 1
5138
+ }
5139
+ }, /*#__PURE__*/React__default["default"].createElement(TitleBar, {
5099
5140
  titleBarRef: this.titleBarRef,
5100
5141
  windowRef: this.ref,
5101
5142
  window: this,
5102
5143
  title: this.props.title,
5103
5144
  thick: this.thick,
5104
5145
  resizable: this.props.resizable
5105
- }), /*#__PURE__*/React__default["default"].createElement("main", null, super.renderer())), this.props.resizable !== false && /*#__PURE__*/React__default["default"].createElement(Sliders, {
5146
+ }), /*#__PURE__*/React__default["default"].createElement("main", null, super.renderer()), this.props.resizable !== false && /*#__PURE__*/React__default["default"].createElement(Sliders, {
5106
5147
  thick: this.thick,
5107
5148
  windowRef: this.ref,
5108
5149
  window: this,
5109
5150
  titleBarRef: this.titleBarRef
5110
- })) : '' : super.renderer();
5151
+ })), this.props.backdrop !== false && typeof this.props.backdrop !== 'string' && /*#__PURE__*/React__default["default"].createElement(StyledBackdrop, {
5152
+ $zIndex: this.props.zIndex
5153
+ }))) : '' : super.renderer();
5111
5154
  }
5112
5155
  }
5113
5156
 
@@ -6167,7 +6210,8 @@ class JRFields extends JRWindow {
6167
6210
  style: {
6168
6211
  ...this.props.typeStyle,
6169
6212
  ...this.props.fieldsStyle
6170
- }
6213
+ },
6214
+ xxstyle: this.props.fieldsStyle
6171
6215
  }, /*#__PURE__*/React__default["default"].createElement(StyledGrid, {
6172
6216
  cols: this.props.cols,
6173
6217
  style: this.props.gridStyle,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jrs-react",
3
- "version": "1.2.39",
3
+ "version": "1.2.41",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "module": "build/index.es.js",
@@ -450,7 +450,10 @@ export default class JRFields extends JRWindow {
450
450
  }
451
451
 
452
452
  renderMe(){
453
- return <StyleJRFields className={`jr-fields`} style={{...this.props.typeStyle,...this.props.fieldsStyle}}>
453
+ return <StyleJRFields className={`jr-fields`}
454
+ style={{...this.props.typeStyle,...this.props.fieldsStyle}}
455
+ xxstyle={this.props.fieldsStyle}
456
+ >
454
457
  <StyledGrid cols={this.props.cols} style={this.props.gridStyle} className={'jr-grid'} $gap={this.props.gap}>
455
458
  {
456
459
  this.createColumns(
@@ -5,10 +5,21 @@ import TitleBar from "./TitleBar";
5
5
  import { po } from "../JRUtils";
6
6
  import Sliders from "./Slider";
7
7
  import style from './Style.module.css'
8
-
8
+ import { JRHTML } from "jrs-js";
9
+ import { background } from "storybook/internal/theming";
10
+
11
+ const StyledBackdrop=styled.div`
12
+ ${({$zIndex})=>$zIndex!=null?`z-index:${$zIndex};`:null}
13
+ background : #868686cc;
14
+ height:100vh;
15
+ width:100vw;
16
+ position: fixed;
17
+ top:0;
18
+ left:0;
19
+ `
9
20
 
10
21
  const StyledJRWindow=styled.div`
11
- z-index:1;
22
+ ${({$zIndex})=>$zIndex!=null?`z-index:${$zIndex};`:null}
12
23
 
13
24
  --jr-window-radius:3px;
14
25
  --padding-child:8px;
@@ -24,7 +35,6 @@ const StyledJRWindow=styled.div`
24
35
  top: ${({$yh})=>$yh.y}px;
25
36
  height: ${({$yh})=>$yh.height}px;
26
37
 
27
- xxxwidth: ${({$width=300})=>typeof $width === 'string'? '50%' : `${$width}px`};
28
38
  overflow: hidden;
29
39
 
30
40
  display: flex;
@@ -48,6 +58,29 @@ const StyledJRWindow=styled.div`
48
58
  }
49
59
  `
50
60
 
61
+ class Backdrop extends JRHTML{
62
+ backdropConfig={
63
+ yo:'div'
64
+ ,style:{
65
+ background:'#ff000029'
66
+ ,height: '100%'
67
+ ,width: '100%'
68
+ ,position: 'absolute'
69
+ ,top: 0
70
+ ,left: 0
71
+ }
72
+ }
73
+
74
+ show(){
75
+ this.backdrop=this.agregarHijo(this.backdropConfig)
76
+ po('this.hijos',this.hijos)
77
+ }
78
+ hide(){
79
+ this.yo.removeChild(this.yo.children[this.yo.children.length-1])
80
+ this.hijos=[]
81
+ }
82
+ }
83
+
51
84
  export default class JRWindow extends JRFrame {
52
85
  // x=0
53
86
  // y=0
@@ -60,7 +93,23 @@ export default class JRWindow extends JRFrame {
60
93
  super(props)
61
94
  this.ref=React.createRef()
62
95
  this.titleBarRef=React.createRef()
63
- // this.init()
96
+ }
97
+
98
+ createBackdrop(){
99
+ if(typeof this.props.backdrop === 'string'){
100
+ po('find and create backdrop',this.props.backdrop)
101
+ const target=document.getElementById(this.props.backdrop)
102
+ if(target){
103
+ this.backdropTarget=new Backdrop({
104
+ yo:target
105
+ ,style:{
106
+ position: 'relative'
107
+ }
108
+ })
109
+
110
+ }
111
+
112
+ }
64
113
  }
65
114
 
66
115
  addMaskToTarget=(target)=>{
@@ -80,20 +129,22 @@ export default class JRWindow extends JRFrame {
80
129
  this.mask.remove()
81
130
  }
82
131
 
83
- backdropOn(on){
84
- const target=(typeof this.props.backdrop)==='object'
85
- ?this.props.backdrop
86
- :typeof this.props.backdrop ==='string'
87
- ?document.getElementById(this.props.backdrop)
88
- :document.body
89
- target?.classList[on?'add':'remove']('withMask')
90
- }
132
+ // backdropOn(on){
133
+ // const target=(typeof this.props.backdrop)==='object'
134
+ // ?this.props.backdrop
135
+ // :typeof this.props.backdrop ==='string'
136
+ // ?document.getElementById(this.props.backdrop)
137
+ // :document.body
138
+ // target?.classList[on?'add':'remove']('withMask')
139
+ // }
91
140
 
92
141
  componentDidMount(){
93
142
  super.componentDidMount()
94
- if(this.props.backdrop && this.props.open){
95
- this.backdropOn(this.props.open)
96
- }
143
+ po('-------------------------componentDidMount-------------------------')
144
+ this.createBackdrop()
145
+ // if(this.props.backdrop && this.props.open){
146
+ // this.backdropTarget.show()
147
+ // }
97
148
 
98
149
  if(this.props.open){
99
150
  this.open()
@@ -101,10 +152,11 @@ export default class JRWindow extends JRFrame {
101
152
  }
102
153
 
103
154
  open(){
155
+ this.backdropTarget.show()
104
156
  this.props.onOpen?.bind(this)()
105
157
  }
106
158
  close(){
107
- // this.init()
159
+ this.backdropTarget.hide()
108
160
  this.props.onClose?.bind(this)()
109
161
  }
110
162
 
@@ -115,26 +167,11 @@ export default class JRWindow extends JRFrame {
115
167
  }else if(this.props.open===false && prevProps.open){
116
168
  this.close()
117
169
  }
118
- if(this.props.backdrop && this.props.open!=prevProps.open){
119
- this.backdropOn(this.props.open)
120
- }
170
+ // if(this.props.backdrop && this.props.open!=prevProps.open){
171
+ // this.backdropOn(this.props.open)
172
+ // }
121
173
  }
122
174
  }
123
- // init(){
124
- // if(this.props.width?.indexOf?.('%')>-1){
125
- // this.width=(this.props.width.split('%')[0]*window.innerWidth)/100
126
- // }else{
127
- // this.width=window.innerWidth>=(this.props.width??this.width)?(this.props.width??this.width):window.innerWidth
128
- // }
129
- // this.x=this.props.x??((window.innerWidth-(this.width))/2)
130
-
131
- // if(this.props.height?.indexOf?.('%')>-1){
132
- // this.height=(this.props.height.split('%')[0]*window.innerHeight)/100
133
- // }else{
134
- // this.height=window.innerHeight>=(this.props.height??this.height)?(this.props.height??this.height):window.innerHeight
135
- // }
136
- // this.y=this.props.y??(window.innerHeight-(this.height))/2
137
- // }
138
175
 
139
176
  get xw(){
140
177
  let width
@@ -165,38 +202,40 @@ export default class JRWindow extends JRFrame {
165
202
  renderer(){
166
203
  return this.props.popup===true
167
204
  ?this.props.open
168
- ?<StyledJRWindow
169
- rule={'dialog'}
170
- ref={this.ref}
171
- className={`jr-window ${this.props.className??''}`}
172
- $xw={this.xw}
173
- $yh={this.yh}
174
- $thick={this.thick}
175
- // $width={this.width}
176
- // $height={this.height}
177
- >
178
- <main>
179
- <TitleBar
180
- titleBarRef={this.titleBarRef}
181
- windowRef={this.ref}
182
- window={this}
183
- title={this.props.title}
184
- thick={this.thick}
185
- resizable={this.props.resizable}
186
- />
187
- <main>
188
- {super.renderer()}
205
+ ?<>
206
+ <StyledJRWindow
207
+ $zIndex={this.props.zIndex}
208
+ rule={'dialog'}
209
+ ref={this.ref}
210
+ className={`jr-window ${this.props.className??''}`}
211
+ $xw={this.xw}
212
+ $yh={this.yh}
213
+ $thick={this.thick}
214
+ >
215
+ <main style={{zIndex:1}}>
216
+ <TitleBar
217
+ titleBarRef={this.titleBarRef}
218
+ windowRef={this.ref}
219
+ window={this}
220
+ title={this.props.title}
221
+ thick={this.thick}
222
+ resizable={this.props.resizable}
223
+ />
224
+ <main>
225
+ {super.renderer()}
226
+ </main>
227
+ {this.props.resizable !== false
228
+ && <Sliders
229
+ thick={this.thick}
230
+ windowRef={this.ref}
231
+ window={this}
232
+ titleBarRef={this.titleBarRef}
233
+ />
234
+ }
189
235
  </main>
190
- </main>
191
- {this.props.resizable !== false
192
- && <Sliders
193
- thick={this.thick}
194
- windowRef={this.ref}
195
- window={this}
196
- titleBarRef={this.titleBarRef}
197
- />
198
- }
199
- </StyledJRWindow>
236
+ {this.props.backdrop!==false && typeof this.props.backdrop!=='string' && <StyledBackdrop $zIndex={this.props.zIndex}/>}
237
+ </StyledJRWindow>
238
+ </>
200
239
  :''
201
240
  :super.renderer()
202
241
  }