jrs-react 1.2.37 → 1.2.38
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 +56 -28
- package/build/index.js +56 -28
- package/package.json +1 -1
- package/src/components/JRWindow/JRWindow.jsx +50 -24
package/build/index.es.js
CHANGED
|
@@ -4906,7 +4906,7 @@ var css_248z = ".Style-module_test__LrdEc{border:1px solid red;color:red}.Style-
|
|
|
4906
4906
|
styleInject(css_248z);
|
|
4907
4907
|
|
|
4908
4908
|
const StyledJRWindow = styled.div`
|
|
4909
|
-
z-index:1;
|
|
4909
|
+
z-index:1;
|
|
4910
4910
|
|
|
4911
4911
|
--jr-window-radius:3px;
|
|
4912
4912
|
--padding-child:8px;
|
|
@@ -4919,18 +4919,22 @@ z-index:1;
|
|
|
4919
4919
|
border-radius: var(--jr-window-radius);
|
|
4920
4920
|
user-select: text;
|
|
4921
4921
|
|
|
4922
|
-
top: ${({
|
|
4923
|
-
$y
|
|
4924
|
-
}) => $y}px;
|
|
4925
4922
|
left: ${({
|
|
4926
|
-
$
|
|
4927
|
-
}) => $x}px;
|
|
4923
|
+
$xw
|
|
4924
|
+
}) => $xw.x}px;
|
|
4928
4925
|
width: ${({
|
|
4926
|
+
$xw
|
|
4927
|
+
}) => $xw.width}px;
|
|
4928
|
+
top: ${({
|
|
4929
|
+
$yh
|
|
4930
|
+
}) => $yh.y}px;
|
|
4931
|
+
height: ${({
|
|
4932
|
+
$yh
|
|
4933
|
+
}) => $yh.height}px;
|
|
4934
|
+
|
|
4935
|
+
xxxwidth: ${({
|
|
4929
4936
|
$width = 300
|
|
4930
4937
|
}) => typeof $width === 'string' ? '50%' : `${$width}px`};
|
|
4931
|
-
height: ${({
|
|
4932
|
-
$height = 300
|
|
4933
|
-
}) => `${$height}px`};
|
|
4934
4938
|
overflow: hidden;
|
|
4935
4939
|
|
|
4936
4940
|
display: flex;
|
|
@@ -4954,17 +4958,17 @@ z-index:1;
|
|
|
4954
4958
|
}
|
|
4955
4959
|
`;
|
|
4956
4960
|
class JRWindow extends JRFrame {
|
|
4957
|
-
x
|
|
4958
|
-
y
|
|
4959
|
-
width
|
|
4960
|
-
height
|
|
4961
|
+
// x=0
|
|
4962
|
+
// y=0
|
|
4963
|
+
// width=300
|
|
4964
|
+
// height=300
|
|
4961
4965
|
padding = 1;
|
|
4962
4966
|
thick = 5;
|
|
4963
4967
|
constructor(props) {
|
|
4964
4968
|
super(props);
|
|
4965
4969
|
this.ref = /*#__PURE__*/React__default.createRef();
|
|
4966
4970
|
this.titleBarRef = /*#__PURE__*/React__default.createRef();
|
|
4967
|
-
this.init()
|
|
4971
|
+
// this.init()
|
|
4968
4972
|
}
|
|
4969
4973
|
addMaskToTarget = target => {
|
|
4970
4974
|
this.mask = document.createElement('div');
|
|
@@ -4984,8 +4988,6 @@ class JRWindow extends JRFrame {
|
|
|
4984
4988
|
};
|
|
4985
4989
|
backdropOn(on) {
|
|
4986
4990
|
const target = typeof this.props.backdrop === 'object' ? this.props.backdrop : typeof this.props.backdrop === 'string' ? document.getElementById(this.props.backdrop) : document.body;
|
|
4987
|
-
|
|
4988
|
-
// this[on?'addMaskToTarget':'removeMaskFromTarget'](target)
|
|
4989
4991
|
target?.classList[on ? 'add' : 'remove']('withMask');
|
|
4990
4992
|
}
|
|
4991
4993
|
componentDidMount() {
|
|
@@ -5001,6 +5003,7 @@ class JRWindow extends JRFrame {
|
|
|
5001
5003
|
this.props.onOpen?.bind(this)();
|
|
5002
5004
|
}
|
|
5003
5005
|
close() {
|
|
5006
|
+
// this.init()
|
|
5004
5007
|
this.props.onClose?.bind(this)();
|
|
5005
5008
|
}
|
|
5006
5009
|
componentDidUpdate(prevProps, prevState, snapshot) {
|
|
@@ -5015,31 +5018,56 @@ class JRWindow extends JRFrame {
|
|
|
5015
5018
|
}
|
|
5016
5019
|
}
|
|
5017
5020
|
}
|
|
5018
|
-
init()
|
|
5019
|
-
|
|
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
|
+
get xw() {
|
|
5038
|
+
let width;
|
|
5020
5039
|
if (this.props.width?.indexOf?.('%') > -1) {
|
|
5021
|
-
|
|
5040
|
+
width = this.props.width.split('%')[0] * window.innerWidth / 100;
|
|
5022
5041
|
} else {
|
|
5023
|
-
|
|
5042
|
+
width = window.innerWidth >= (this.props.width ?? width) ? this.props.width ?? width : window.innerWidth;
|
|
5024
5043
|
}
|
|
5025
|
-
|
|
5044
|
+
return {
|
|
5045
|
+
x: this.props.x ?? (window.innerWidth - width) / 2,
|
|
5046
|
+
width
|
|
5047
|
+
};
|
|
5048
|
+
}
|
|
5049
|
+
get yh() {
|
|
5050
|
+
let height;
|
|
5026
5051
|
if (this.props.height?.indexOf?.('%') > -1) {
|
|
5027
|
-
|
|
5052
|
+
height = this.props.height.split('%')[0] * window.innerHeight / 100;
|
|
5028
5053
|
} else {
|
|
5029
|
-
|
|
5054
|
+
height = window.innerHeight >= (this.props.height ?? height) ? this.props.height ?? height : window.innerHeight;
|
|
5030
5055
|
}
|
|
5031
|
-
|
|
5056
|
+
return {
|
|
5057
|
+
y: this.props.y ?? (window.innerHeight - height) / 2,
|
|
5058
|
+
height
|
|
5059
|
+
};
|
|
5032
5060
|
}
|
|
5033
5061
|
renderer() {
|
|
5034
5062
|
return this.props.popup === true ? this.props.open ? /*#__PURE__*/React__default.createElement(StyledJRWindow, {
|
|
5035
5063
|
rule: 'dialog',
|
|
5036
5064
|
ref: this.ref,
|
|
5037
5065
|
className: `jr-window ${this.props.className ?? ''}`,
|
|
5038
|
-
$
|
|
5039
|
-
$
|
|
5040
|
-
$width: this.width,
|
|
5041
|
-
$height: this.height,
|
|
5066
|
+
$xw: this.xw,
|
|
5067
|
+
$yh: this.yh,
|
|
5042
5068
|
$thick: this.thick
|
|
5069
|
+
// $width={this.width}
|
|
5070
|
+
// $height={this.height}
|
|
5043
5071
|
}, /*#__PURE__*/React__default.createElement("main", null, /*#__PURE__*/React__default.createElement(TitleBar, {
|
|
5044
5072
|
titleBarRef: this.titleBarRef,
|
|
5045
5073
|
windowRef: this.ref,
|
package/build/index.js
CHANGED
|
@@ -4933,7 +4933,7 @@ var css_248z = ".Style-module_test__LrdEc{border:1px solid red;color:red}.Style-
|
|
|
4933
4933
|
styleInject(css_248z);
|
|
4934
4934
|
|
|
4935
4935
|
const StyledJRWindow = styled__default["default"].div`
|
|
4936
|
-
z-index:1;
|
|
4936
|
+
z-index:1;
|
|
4937
4937
|
|
|
4938
4938
|
--jr-window-radius:3px;
|
|
4939
4939
|
--padding-child:8px;
|
|
@@ -4946,18 +4946,22 @@ z-index:1;
|
|
|
4946
4946
|
border-radius: var(--jr-window-radius);
|
|
4947
4947
|
user-select: text;
|
|
4948
4948
|
|
|
4949
|
-
top: ${({
|
|
4950
|
-
$y
|
|
4951
|
-
}) => $y}px;
|
|
4952
4949
|
left: ${({
|
|
4953
|
-
$
|
|
4954
|
-
}) => $x}px;
|
|
4950
|
+
$xw
|
|
4951
|
+
}) => $xw.x}px;
|
|
4955
4952
|
width: ${({
|
|
4953
|
+
$xw
|
|
4954
|
+
}) => $xw.width}px;
|
|
4955
|
+
top: ${({
|
|
4956
|
+
$yh
|
|
4957
|
+
}) => $yh.y}px;
|
|
4958
|
+
height: ${({
|
|
4959
|
+
$yh
|
|
4960
|
+
}) => $yh.height}px;
|
|
4961
|
+
|
|
4962
|
+
xxxwidth: ${({
|
|
4956
4963
|
$width = 300
|
|
4957
4964
|
}) => typeof $width === 'string' ? '50%' : `${$width}px`};
|
|
4958
|
-
height: ${({
|
|
4959
|
-
$height = 300
|
|
4960
|
-
}) => `${$height}px`};
|
|
4961
4965
|
overflow: hidden;
|
|
4962
4966
|
|
|
4963
4967
|
display: flex;
|
|
@@ -4981,17 +4985,17 @@ z-index:1;
|
|
|
4981
4985
|
}
|
|
4982
4986
|
`;
|
|
4983
4987
|
class JRWindow extends JRFrame {
|
|
4984
|
-
x
|
|
4985
|
-
y
|
|
4986
|
-
width
|
|
4987
|
-
height
|
|
4988
|
+
// x=0
|
|
4989
|
+
// y=0
|
|
4990
|
+
// width=300
|
|
4991
|
+
// height=300
|
|
4988
4992
|
padding = 1;
|
|
4989
4993
|
thick = 5;
|
|
4990
4994
|
constructor(props) {
|
|
4991
4995
|
super(props);
|
|
4992
4996
|
this.ref = /*#__PURE__*/React__default["default"].createRef();
|
|
4993
4997
|
this.titleBarRef = /*#__PURE__*/React__default["default"].createRef();
|
|
4994
|
-
this.init()
|
|
4998
|
+
// this.init()
|
|
4995
4999
|
}
|
|
4996
5000
|
addMaskToTarget = target => {
|
|
4997
5001
|
this.mask = document.createElement('div');
|
|
@@ -5011,8 +5015,6 @@ class JRWindow extends JRFrame {
|
|
|
5011
5015
|
};
|
|
5012
5016
|
backdropOn(on) {
|
|
5013
5017
|
const target = typeof this.props.backdrop === 'object' ? this.props.backdrop : typeof this.props.backdrop === 'string' ? document.getElementById(this.props.backdrop) : document.body;
|
|
5014
|
-
|
|
5015
|
-
// this[on?'addMaskToTarget':'removeMaskFromTarget'](target)
|
|
5016
5018
|
target?.classList[on ? 'add' : 'remove']('withMask');
|
|
5017
5019
|
}
|
|
5018
5020
|
componentDidMount() {
|
|
@@ -5028,6 +5030,7 @@ class JRWindow extends JRFrame {
|
|
|
5028
5030
|
this.props.onOpen?.bind(this)();
|
|
5029
5031
|
}
|
|
5030
5032
|
close() {
|
|
5033
|
+
// this.init()
|
|
5031
5034
|
this.props.onClose?.bind(this)();
|
|
5032
5035
|
}
|
|
5033
5036
|
componentDidUpdate(prevProps, prevState, snapshot) {
|
|
@@ -5042,31 +5045,56 @@ class JRWindow extends JRFrame {
|
|
|
5042
5045
|
}
|
|
5043
5046
|
}
|
|
5044
5047
|
}
|
|
5045
|
-
init()
|
|
5046
|
-
|
|
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
|
+
get xw() {
|
|
5065
|
+
let width;
|
|
5047
5066
|
if (this.props.width?.indexOf?.('%') > -1) {
|
|
5048
|
-
|
|
5067
|
+
width = this.props.width.split('%')[0] * window.innerWidth / 100;
|
|
5049
5068
|
} else {
|
|
5050
|
-
|
|
5069
|
+
width = window.innerWidth >= (this.props.width ?? width) ? this.props.width ?? width : window.innerWidth;
|
|
5051
5070
|
}
|
|
5052
|
-
|
|
5071
|
+
return {
|
|
5072
|
+
x: this.props.x ?? (window.innerWidth - width) / 2,
|
|
5073
|
+
width
|
|
5074
|
+
};
|
|
5075
|
+
}
|
|
5076
|
+
get yh() {
|
|
5077
|
+
let height;
|
|
5053
5078
|
if (this.props.height?.indexOf?.('%') > -1) {
|
|
5054
|
-
|
|
5079
|
+
height = this.props.height.split('%')[0] * window.innerHeight / 100;
|
|
5055
5080
|
} else {
|
|
5056
|
-
|
|
5081
|
+
height = window.innerHeight >= (this.props.height ?? height) ? this.props.height ?? height : window.innerHeight;
|
|
5057
5082
|
}
|
|
5058
|
-
|
|
5083
|
+
return {
|
|
5084
|
+
y: this.props.y ?? (window.innerHeight - height) / 2,
|
|
5085
|
+
height
|
|
5086
|
+
};
|
|
5059
5087
|
}
|
|
5060
5088
|
renderer() {
|
|
5061
5089
|
return this.props.popup === true ? this.props.open ? /*#__PURE__*/React__default["default"].createElement(StyledJRWindow, {
|
|
5062
5090
|
rule: 'dialog',
|
|
5063
5091
|
ref: this.ref,
|
|
5064
5092
|
className: `jr-window ${this.props.className ?? ''}`,
|
|
5065
|
-
$
|
|
5066
|
-
$
|
|
5067
|
-
$width: this.width,
|
|
5068
|
-
$height: this.height,
|
|
5093
|
+
$xw: this.xw,
|
|
5094
|
+
$yh: this.yh,
|
|
5069
5095
|
$thick: this.thick
|
|
5096
|
+
// $width={this.width}
|
|
5097
|
+
// $height={this.height}
|
|
5070
5098
|
}, /*#__PURE__*/React__default["default"].createElement("main", null, /*#__PURE__*/React__default["default"].createElement(TitleBar, {
|
|
5071
5099
|
titleBarRef: this.titleBarRef,
|
|
5072
5100
|
windowRef: this.ref,
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@ import style from './Style.module.css'
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
const StyledJRWindow=styled.div`
|
|
11
|
-
z-index:1;
|
|
11
|
+
z-index:1;
|
|
12
12
|
|
|
13
13
|
--jr-window-radius:3px;
|
|
14
14
|
--padding-child:8px;
|
|
@@ -19,10 +19,12 @@ z-index:1;
|
|
|
19
19
|
border-radius: var(--jr-window-radius);
|
|
20
20
|
user-select: text;
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
height: ${({$
|
|
22
|
+
left: ${({$xw})=>$xw.x}px;
|
|
23
|
+
width: ${({$xw})=>$xw.width}px;
|
|
24
|
+
top: ${({$yh})=>$yh.y}px;
|
|
25
|
+
height: ${({$yh})=>$yh.height}px;
|
|
26
|
+
|
|
27
|
+
xxxwidth: ${({$width=300})=>typeof $width === 'string'? '50%' : `${$width}px`};
|
|
26
28
|
overflow: hidden;
|
|
27
29
|
|
|
28
30
|
display: flex;
|
|
@@ -47,10 +49,10 @@ z-index:1;
|
|
|
47
49
|
`
|
|
48
50
|
|
|
49
51
|
export default class JRWindow extends JRFrame {
|
|
50
|
-
x=0
|
|
51
|
-
y=0
|
|
52
|
-
width=300
|
|
53
|
-
height=300
|
|
52
|
+
// x=0
|
|
53
|
+
// y=0
|
|
54
|
+
// width=300
|
|
55
|
+
// height=300
|
|
54
56
|
padding=1
|
|
55
57
|
thick=5
|
|
56
58
|
|
|
@@ -58,7 +60,7 @@ export default class JRWindow extends JRFrame {
|
|
|
58
60
|
super(props)
|
|
59
61
|
this.ref=React.createRef()
|
|
60
62
|
this.titleBarRef=React.createRef()
|
|
61
|
-
this.init()
|
|
63
|
+
// this.init()
|
|
62
64
|
}
|
|
63
65
|
|
|
64
66
|
addMaskToTarget=(target)=>{
|
|
@@ -84,8 +86,6 @@ export default class JRWindow extends JRFrame {
|
|
|
84
86
|
:typeof this.props.backdrop ==='string'
|
|
85
87
|
?document.getElementById(this.props.backdrop)
|
|
86
88
|
:document.body
|
|
87
|
-
|
|
88
|
-
// this[on?'addMaskToTarget':'removeMaskFromTarget'](target)
|
|
89
89
|
target?.classList[on?'add':'remove']('withMask')
|
|
90
90
|
}
|
|
91
91
|
|
|
@@ -104,6 +104,7 @@ export default class JRWindow extends JRFrame {
|
|
|
104
104
|
this.props.onOpen?.bind(this)()
|
|
105
105
|
}
|
|
106
106
|
close(){
|
|
107
|
+
// this.init()
|
|
107
108
|
this.props.onClose?.bind(this)()
|
|
108
109
|
}
|
|
109
110
|
|
|
@@ -119,21 +120,46 @@ export default class JRWindow extends JRFrame {
|
|
|
119
120
|
}
|
|
120
121
|
}
|
|
121
122
|
}
|
|
122
|
-
init(){
|
|
123
|
-
|
|
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
|
+
|
|
139
|
+
get xw(){
|
|
140
|
+
let width
|
|
124
141
|
if(this.props.width?.indexOf?.('%')>-1){
|
|
125
|
-
|
|
142
|
+
width=(this.props.width.split('%')[0]*window.innerWidth)/100
|
|
126
143
|
}else{
|
|
127
|
-
|
|
144
|
+
width=window.innerWidth>=(this.props.width??width)?(this.props.width??width):window.innerWidth
|
|
145
|
+
}
|
|
146
|
+
return {
|
|
147
|
+
x:this.props.x??((window.innerWidth-(width))/2)
|
|
148
|
+
,width
|
|
128
149
|
}
|
|
129
|
-
|
|
150
|
+
}
|
|
130
151
|
|
|
152
|
+
get yh(){
|
|
153
|
+
let height
|
|
131
154
|
if(this.props.height?.indexOf?.('%')>-1){
|
|
132
|
-
|
|
155
|
+
height=(this.props.height.split('%')[0]*window.innerHeight)/100
|
|
133
156
|
}else{
|
|
134
|
-
|
|
157
|
+
height=window.innerHeight>=(this.props.height??height)?(this.props.height??height):window.innerHeight
|
|
158
|
+
}
|
|
159
|
+
return {
|
|
160
|
+
y:this.props.y??(window.innerHeight-(height))/2
|
|
161
|
+
,height
|
|
135
162
|
}
|
|
136
|
-
this.y=this.props.y??(window.innerHeight-(this.height))/2
|
|
137
163
|
}
|
|
138
164
|
|
|
139
165
|
renderer(){
|
|
@@ -143,11 +169,11 @@ export default class JRWindow extends JRFrame {
|
|
|
143
169
|
rule={'dialog'}
|
|
144
170
|
ref={this.ref}
|
|
145
171
|
className={`jr-window ${this.props.className??''}`}
|
|
146
|
-
$
|
|
147
|
-
$
|
|
148
|
-
$width={this.width}
|
|
149
|
-
$height={this.height}
|
|
172
|
+
$xw={this.xw}
|
|
173
|
+
$yh={this.yh}
|
|
150
174
|
$thick={this.thick}
|
|
175
|
+
// $width={this.width}
|
|
176
|
+
// $height={this.height}
|
|
151
177
|
>
|
|
152
178
|
<main>
|
|
153
179
|
<TitleBar
|