jrs-react 1.2.39 → 1.2.40

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;
@@ -4986,15 +4996,22 @@ class JRWindow extends JRFrame {
4986
4996
  removeMaskFromTarget = () => {
4987
4997
  this.mask.remove();
4988
4998
  };
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
- }
4999
+
5000
+ // backdropOn(on){
5001
+ // const target=(typeof this.props.backdrop)==='object'
5002
+ // ?this.props.backdrop
5003
+ // :typeof this.props.backdrop ==='string'
5004
+ // ?document.getElementById(this.props.backdrop)
5005
+ // :document.body
5006
+ // target?.classList[on?'add':'remove']('withMask')
5007
+ // }
5008
+
4993
5009
  componentDidMount() {
4994
5010
  super.componentDidMount();
4995
- if (this.props.backdrop && this.props.open) {
4996
- this.backdropOn(this.props.open);
4997
- }
5011
+ // if(this.props.backdrop && this.props.open){
5012
+ // this.backdropOn(this.props.open)
5013
+ // }
5014
+
4998
5015
  if (this.props.open) {
4999
5016
  this.open();
5000
5017
  }
@@ -5003,7 +5020,6 @@ class JRWindow extends JRFrame {
5003
5020
  this.props.onOpen?.bind(this)();
5004
5021
  }
5005
5022
  close() {
5006
- // this.init()
5007
5023
  this.props.onClose?.bind(this)();
5008
5024
  }
5009
5025
  componentDidUpdate(prevProps, prevState, snapshot) {
@@ -5013,27 +5029,11 @@ class JRWindow extends JRFrame {
5013
5029
  } else if (this.props.open === false && prevProps.open) {
5014
5030
  this.close();
5015
5031
  }
5016
- if (this.props.backdrop && this.props.open != prevProps.open) {
5017
- this.backdropOn(this.props.open);
5018
- }
5032
+ // if(this.props.backdrop && this.props.open!=prevProps.open){
5033
+ // this.backdropOn(this.props.open)
5034
+ // }
5019
5035
  }
5020
5036
  }
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
5037
  get xw() {
5038
5038
  let width;
5039
5039
  if (this.props.width?.indexOf?.('%') > -1) {
@@ -5059,28 +5059,33 @@ class JRWindow extends JRFrame {
5059
5059
  };
5060
5060
  }
5061
5061
  renderer() {
5062
- return this.props.popup === true ? this.props.open ? /*#__PURE__*/React__default.createElement(StyledJRWindow, {
5062
+ return this.props.popup === true ? this.props.open ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(StyledJRWindow, {
5063
+ $zIndex: this.props.zIndex,
5063
5064
  rule: 'dialog',
5064
5065
  ref: this.ref,
5065
5066
  className: `jr-window ${this.props.className ?? ''}`,
5066
5067
  $xw: this.xw,
5067
5068
  $yh: this.yh,
5068
5069
  $thick: this.thick
5069
- // $width={this.width}
5070
- // $height={this.height}
5071
- }, /*#__PURE__*/React__default.createElement("main", null, /*#__PURE__*/React__default.createElement(TitleBar, {
5070
+ }, /*#__PURE__*/React__default.createElement("main", {
5071
+ style: {
5072
+ zIndex: 1
5073
+ }
5074
+ }, /*#__PURE__*/React__default.createElement(TitleBar, {
5072
5075
  titleBarRef: this.titleBarRef,
5073
5076
  windowRef: this.ref,
5074
5077
  window: this,
5075
5078
  title: this.props.title,
5076
5079
  thick: this.thick,
5077
5080
  resizable: this.props.resizable
5078
- }), /*#__PURE__*/React__default.createElement("main", null, super.renderer())), this.props.resizable !== false && /*#__PURE__*/React__default.createElement(Sliders, {
5081
+ }), /*#__PURE__*/React__default.createElement("main", null, super.renderer()), this.props.resizable !== false && /*#__PURE__*/React__default.createElement(Sliders, {
5079
5082
  thick: this.thick,
5080
5083
  windowRef: this.ref,
5081
5084
  window: this,
5082
5085
  titleBarRef: this.titleBarRef
5083
- })) : '' : super.renderer();
5086
+ })), this.props.backdrop !== false && /*#__PURE__*/React__default.createElement(StyledBackdrop, {
5087
+ $zIndex: this.props.zIndex
5088
+ }))) : '' : super.renderer();
5084
5089
  }
5085
5090
  }
5086
5091
 
@@ -6140,7 +6145,8 @@ class JRFields extends JRWindow {
6140
6145
  style: {
6141
6146
  ...this.props.typeStyle,
6142
6147
  ...this.props.fieldsStyle
6143
- }
6148
+ },
6149
+ xxstyle: this.props.fieldsStyle
6144
6150
  }, /*#__PURE__*/React__default.createElement(StyledGrid, {
6145
6151
  cols: this.props.cols,
6146
6152
  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;
@@ -5013,15 +5023,22 @@ class JRWindow extends JRFrame {
5013
5023
  removeMaskFromTarget = () => {
5014
5024
  this.mask.remove();
5015
5025
  };
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
- }
5026
+
5027
+ // backdropOn(on){
5028
+ // const target=(typeof this.props.backdrop)==='object'
5029
+ // ?this.props.backdrop
5030
+ // :typeof this.props.backdrop ==='string'
5031
+ // ?document.getElementById(this.props.backdrop)
5032
+ // :document.body
5033
+ // target?.classList[on?'add':'remove']('withMask')
5034
+ // }
5035
+
5020
5036
  componentDidMount() {
5021
5037
  super.componentDidMount();
5022
- if (this.props.backdrop && this.props.open) {
5023
- this.backdropOn(this.props.open);
5024
- }
5038
+ // if(this.props.backdrop && this.props.open){
5039
+ // this.backdropOn(this.props.open)
5040
+ // }
5041
+
5025
5042
  if (this.props.open) {
5026
5043
  this.open();
5027
5044
  }
@@ -5030,7 +5047,6 @@ class JRWindow extends JRFrame {
5030
5047
  this.props.onOpen?.bind(this)();
5031
5048
  }
5032
5049
  close() {
5033
- // this.init()
5034
5050
  this.props.onClose?.bind(this)();
5035
5051
  }
5036
5052
  componentDidUpdate(prevProps, prevState, snapshot) {
@@ -5040,27 +5056,11 @@ class JRWindow extends JRFrame {
5040
5056
  } else if (this.props.open === false && prevProps.open) {
5041
5057
  this.close();
5042
5058
  }
5043
- if (this.props.backdrop && this.props.open != prevProps.open) {
5044
- this.backdropOn(this.props.open);
5045
- }
5059
+ // if(this.props.backdrop && this.props.open!=prevProps.open){
5060
+ // this.backdropOn(this.props.open)
5061
+ // }
5046
5062
  }
5047
5063
  }
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
5064
  get xw() {
5065
5065
  let width;
5066
5066
  if (this.props.width?.indexOf?.('%') > -1) {
@@ -5086,28 +5086,33 @@ class JRWindow extends JRFrame {
5086
5086
  };
5087
5087
  }
5088
5088
  renderer() {
5089
- return this.props.popup === true ? this.props.open ? /*#__PURE__*/React__default["default"].createElement(StyledJRWindow, {
5089
+ return this.props.popup === true ? this.props.open ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(StyledJRWindow, {
5090
+ $zIndex: this.props.zIndex,
5090
5091
  rule: 'dialog',
5091
5092
  ref: this.ref,
5092
5093
  className: `jr-window ${this.props.className ?? ''}`,
5093
5094
  $xw: this.xw,
5094
5095
  $yh: this.yh,
5095
5096
  $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, {
5097
+ }, /*#__PURE__*/React__default["default"].createElement("main", {
5098
+ style: {
5099
+ zIndex: 1
5100
+ }
5101
+ }, /*#__PURE__*/React__default["default"].createElement(TitleBar, {
5099
5102
  titleBarRef: this.titleBarRef,
5100
5103
  windowRef: this.ref,
5101
5104
  window: this,
5102
5105
  title: this.props.title,
5103
5106
  thick: this.thick,
5104
5107
  resizable: this.props.resizable
5105
- }), /*#__PURE__*/React__default["default"].createElement("main", null, super.renderer())), this.props.resizable !== false && /*#__PURE__*/React__default["default"].createElement(Sliders, {
5108
+ }), /*#__PURE__*/React__default["default"].createElement("main", null, super.renderer()), this.props.resizable !== false && /*#__PURE__*/React__default["default"].createElement(Sliders, {
5106
5109
  thick: this.thick,
5107
5110
  windowRef: this.ref,
5108
5111
  window: this,
5109
5112
  titleBarRef: this.titleBarRef
5110
- })) : '' : super.renderer();
5113
+ })), this.props.backdrop !== false && /*#__PURE__*/React__default["default"].createElement(StyledBackdrop, {
5114
+ $zIndex: this.props.zIndex
5115
+ }))) : '' : super.renderer();
5111
5116
  }
5112
5117
  }
5113
5118
 
@@ -6167,7 +6172,8 @@ class JRFields extends JRWindow {
6167
6172
  style: {
6168
6173
  ...this.props.typeStyle,
6169
6174
  ...this.props.fieldsStyle
6170
- }
6175
+ },
6176
+ xxstyle: this.props.fieldsStyle
6171
6177
  }, /*#__PURE__*/React__default["default"].createElement(StyledGrid, {
6172
6178
  cols: this.props.cols,
6173
6179
  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.40",
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(
@@ -6,9 +6,18 @@ import { po } from "../JRUtils";
6
6
  import Sliders from "./Slider";
7
7
  import style from './Style.module.css'
8
8
 
9
+ const StyledBackdrop=styled.div`
10
+ ${({$zIndex})=>$zIndex!=null?`z-index:${$zIndex};`:null}
11
+ background : #868686cc;
12
+ height:100vh;
13
+ width:100vw;
14
+ position: fixed;
15
+ top:0;
16
+ left:0;
17
+ `
9
18
 
10
19
  const StyledJRWindow=styled.div`
11
- z-index:1;
20
+ ${({$zIndex})=>$zIndex!=null?`z-index:${$zIndex};`:null}
12
21
 
13
22
  --jr-window-radius:3px;
14
23
  --padding-child:8px;
@@ -24,7 +33,6 @@ const StyledJRWindow=styled.div`
24
33
  top: ${({$yh})=>$yh.y}px;
25
34
  height: ${({$yh})=>$yh.height}px;
26
35
 
27
- xxxwidth: ${({$width=300})=>typeof $width === 'string'? '50%' : `${$width}px`};
28
36
  overflow: hidden;
29
37
 
30
38
  display: flex;
@@ -80,20 +88,20 @@ export default class JRWindow extends JRFrame {
80
88
  this.mask.remove()
81
89
  }
82
90
 
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
- }
91
+ // backdropOn(on){
92
+ // const target=(typeof this.props.backdrop)==='object'
93
+ // ?this.props.backdrop
94
+ // :typeof this.props.backdrop ==='string'
95
+ // ?document.getElementById(this.props.backdrop)
96
+ // :document.body
97
+ // target?.classList[on?'add':'remove']('withMask')
98
+ // }
91
99
 
92
100
  componentDidMount(){
93
101
  super.componentDidMount()
94
- if(this.props.backdrop && this.props.open){
95
- this.backdropOn(this.props.open)
96
- }
102
+ // if(this.props.backdrop && this.props.open){
103
+ // this.backdropOn(this.props.open)
104
+ // }
97
105
 
98
106
  if(this.props.open){
99
107
  this.open()
@@ -104,7 +112,6 @@ export default class JRWindow extends JRFrame {
104
112
  this.props.onOpen?.bind(this)()
105
113
  }
106
114
  close(){
107
- // this.init()
108
115
  this.props.onClose?.bind(this)()
109
116
  }
110
117
 
@@ -115,26 +122,11 @@ export default class JRWindow extends JRFrame {
115
122
  }else if(this.props.open===false && prevProps.open){
116
123
  this.close()
117
124
  }
118
- if(this.props.backdrop && this.props.open!=prevProps.open){
119
- this.backdropOn(this.props.open)
120
- }
125
+ // if(this.props.backdrop && this.props.open!=prevProps.open){
126
+ // this.backdropOn(this.props.open)
127
+ // }
121
128
  }
122
129
  }
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
130
 
139
131
  get xw(){
140
132
  let width
@@ -165,38 +157,40 @@ export default class JRWindow extends JRFrame {
165
157
  renderer(){
166
158
  return this.props.popup===true
167
159
  ?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()}
160
+ ?<>
161
+ <StyledJRWindow
162
+ $zIndex={this.props.zIndex}
163
+ rule={'dialog'}
164
+ ref={this.ref}
165
+ className={`jr-window ${this.props.className??''}`}
166
+ $xw={this.xw}
167
+ $yh={this.yh}
168
+ $thick={this.thick}
169
+ >
170
+ <main style={{zIndex:1}}>
171
+ <TitleBar
172
+ titleBarRef={this.titleBarRef}
173
+ windowRef={this.ref}
174
+ window={this}
175
+ title={this.props.title}
176
+ thick={this.thick}
177
+ resizable={this.props.resizable}
178
+ />
179
+ <main>
180
+ {super.renderer()}
181
+ </main>
182
+ {this.props.resizable !== false
183
+ && <Sliders
184
+ thick={this.thick}
185
+ windowRef={this.ref}
186
+ window={this}
187
+ titleBarRef={this.titleBarRef}
188
+ />
189
+ }
189
190
  </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>
191
+ {this.props.backdrop!==false && <StyledBackdrop $zIndex={this.props.zIndex}/>}
192
+ </StyledJRWindow>
193
+ </>
200
194
  :''
201
195
  :super.renderer()
202
196
  }