jrs-react 1.2.48 → 1.2.49
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/Readme.txt +7 -0
- package/build/index.es.js +3183 -3176
- package/build/index.js +3183 -3176
- package/package.json +61 -61
- package/src/assets/icon/card.svg +14 -14
- package/src/assets/icon/copy.svg +14 -14
- package/src/assets/icon/minus.svg +13 -13
- package/src/assets/icon/square.svg +13 -13
- package/src/assets/icon/x.svg +14 -14
- package/src/components/JRSubmit.jsx +267 -269
- package/src/components/JRWindow/JRWindow.jsx +10 -3
- package/src/main.jsx +10 -10
|
@@ -5,307 +5,305 @@ import styled from 'styled-components'
|
|
|
5
5
|
import { showMask } from './JRMask/JRMask'
|
|
6
6
|
|
|
7
7
|
const axiosSubmit = axios.create({
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
authorization: `Bearer ${localStorage.getItem("accessToken")}`
|
|
9
|
+
,timeout: 120000
|
|
10
|
+
,maxBodyLength: 104857600 //100mb 104857600
|
|
11
|
+
,maxContentLength: 104857600 //100mb
|
|
12
12
|
})
|
|
13
13
|
|
|
14
|
-
const StyledCover
|
|
14
|
+
const StyledCover=styled.div`
|
|
15
15
|
border:2px solid red;
|
|
16
16
|
`
|
|
17
|
-
const Cover
|
|
18
|
-
|
|
17
|
+
const Cover=({children})=>{
|
|
18
|
+
return <StyledCover>{children}</StyledCover>
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
export default class JRSubmit extends React.Component {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
22
|
+
#methods = ['get', 'post', 'put','patch','delete','download']
|
|
23
|
+
constructor(props) {
|
|
24
|
+
super(props)
|
|
25
|
+
if(this.props.value===undefined && this.props.initValue!==undefined ){
|
|
26
|
+
if(this.props.onChange===undefined){
|
|
27
|
+
this.state={
|
|
28
|
+
value:props.initValue
|
|
29
|
+
,rawValue:JSON.parse(JSON.stringify(props.initValue))
|
|
30
|
+
}
|
|
31
|
+
}
|
|
31
32
|
}
|
|
32
|
-
}
|
|
33
33
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
})
|
|
47
|
-
}
|
|
48
|
-
get(_config = {}) {
|
|
49
|
-
const config = Object.assign(
|
|
50
|
-
{
|
|
51
|
-
method: 'get'
|
|
52
|
-
, updateValue: true
|
|
53
|
-
// ,updateRawValue:true
|
|
54
|
-
}
|
|
55
|
-
, this.props['get']
|
|
56
|
-
, _config
|
|
57
|
-
)
|
|
58
|
-
this.submit(config)
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
post(config = {}) {
|
|
62
|
-
config = Object.assign(
|
|
63
|
-
{
|
|
64
|
-
method: 'post'
|
|
65
|
-
, updateValue: false
|
|
66
|
-
}
|
|
67
|
-
, this.props['post']
|
|
68
|
-
, config
|
|
69
|
-
)
|
|
70
|
-
this.submit(config)
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
put(config = {}) {
|
|
74
|
-
config = Object.assign(
|
|
75
|
-
{
|
|
76
|
-
method: 'put'
|
|
77
|
-
, updateValue: false
|
|
78
|
-
}
|
|
79
|
-
, this.props['put']
|
|
80
|
-
, config
|
|
81
|
-
)
|
|
82
|
-
this.submit(config)
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
delete(config = {}) {
|
|
86
|
-
config = Object.assign(
|
|
87
|
-
{
|
|
88
|
-
method: 'delete'
|
|
89
|
-
, updateValue: false
|
|
90
|
-
}
|
|
91
|
-
, this.props['delete']
|
|
92
|
-
, config
|
|
93
|
-
)
|
|
94
|
-
this.submit(config)
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
get from() {
|
|
98
|
-
return this.props.value === undefined ? 'state' : 'props'
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
get isDirty() {
|
|
102
|
-
return this.state?.isDirty
|
|
103
|
-
}
|
|
104
|
-
set isDirty(isDirty) {
|
|
105
|
-
this.setState({ isDirty })
|
|
106
|
-
}
|
|
107
|
-
get rawValue() {
|
|
108
|
-
return this.state?.rawValue
|
|
109
|
-
}
|
|
110
|
-
setRawValue(rawValue) {
|
|
111
|
-
this.setState({ rawValue: rawValue != null ? JSON.parse(JSON.stringify(rawValue)) : null })
|
|
112
|
-
}
|
|
113
|
-
reset() {
|
|
114
|
-
this.setValue(this.rawValue, true)
|
|
115
|
-
}
|
|
116
|
-
setValue(value, reset = false) {
|
|
117
|
-
if (this.props.onChange) {
|
|
118
|
-
this.props.onChange(value)
|
|
119
|
-
} else {
|
|
120
|
-
this.setState({ value })
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
if (reset) {
|
|
124
|
-
this.setRawValue(value)
|
|
34
|
+
componentDidMount(){
|
|
35
|
+
this.#methods
|
|
36
|
+
.filter((method) => this[method] && this.props[method] && this.props[method].autoRun)
|
|
37
|
+
.forEach((method) => {
|
|
38
|
+
if(this.props[method].autoRun===true){
|
|
39
|
+
this[method]()
|
|
40
|
+
} else if(this.props[method].autoRun>-1){
|
|
41
|
+
setTimeout(()=>{
|
|
42
|
+
this[method]()
|
|
43
|
+
},this.props[method].autoRun)
|
|
44
|
+
}
|
|
45
|
+
})
|
|
125
46
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
47
|
+
get(_config = {}) {
|
|
48
|
+
const config = Object.assign(
|
|
49
|
+
{
|
|
50
|
+
method:'get'
|
|
51
|
+
,updateValue:true
|
|
52
|
+
// ,updateRawValue:true
|
|
53
|
+
}
|
|
54
|
+
,this.props['get']
|
|
55
|
+
,_config
|
|
56
|
+
)
|
|
57
|
+
this.submit(config)
|
|
135
58
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
59
|
+
|
|
60
|
+
post(config = {}) {
|
|
61
|
+
config = Object.assign(
|
|
62
|
+
{
|
|
63
|
+
method:'post'
|
|
64
|
+
,updateValue:false
|
|
65
|
+
}
|
|
66
|
+
,this.props['post']
|
|
67
|
+
,config
|
|
68
|
+
)
|
|
69
|
+
this.submit(config)
|
|
143
70
|
}
|
|
144
|
-
}
|
|
145
71
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
72
|
+
put(config = {}) {
|
|
73
|
+
config = Object.assign(
|
|
74
|
+
{
|
|
75
|
+
method:'put'
|
|
76
|
+
,updateValue:false
|
|
77
|
+
}
|
|
78
|
+
,this.props['put']
|
|
79
|
+
,config
|
|
80
|
+
)
|
|
81
|
+
this.submit(config)
|
|
153
82
|
}
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
getSubmitValue() {
|
|
157
|
-
return this.getValue()
|
|
158
|
-
}
|
|
159
83
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
// ,..._extraValue
|
|
172
|
-
// }
|
|
173
|
-
// :{
|
|
174
|
-
// ...value
|
|
175
|
-
// ,..._extraValue
|
|
176
|
-
// }
|
|
177
|
-
let payload = value?.bind?.(this)({
|
|
178
|
-
...this.getSubmitValue()
|
|
179
|
-
, ..._extraValue
|
|
180
|
-
})
|
|
181
|
-
?? value == null
|
|
182
|
-
? {
|
|
183
|
-
...this.getSubmitValue()
|
|
184
|
-
, ..._extraValue
|
|
185
|
-
}
|
|
186
|
-
: {
|
|
187
|
-
...value
|
|
188
|
-
, ..._extraValue
|
|
189
|
-
}
|
|
84
|
+
delete(config = {}) {
|
|
85
|
+
config = Object.assign(
|
|
86
|
+
{
|
|
87
|
+
method:'delete'
|
|
88
|
+
,updateValue:false
|
|
89
|
+
}
|
|
90
|
+
,this.props['delete']
|
|
91
|
+
,config
|
|
92
|
+
)
|
|
93
|
+
this.submit(config)
|
|
94
|
+
}
|
|
190
95
|
|
|
191
|
-
|
|
192
|
-
|
|
96
|
+
get from(){
|
|
97
|
+
return this.props.value===undefined?'state':'props'
|
|
193
98
|
}
|
|
194
|
-
|
|
195
|
-
|
|
99
|
+
|
|
100
|
+
get isDirty(){
|
|
101
|
+
return this.state?.isDirty
|
|
196
102
|
}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
if (method == 'get') {
|
|
200
|
-
if (sendValue == null || sendValue) params1.params = payload
|
|
201
|
-
params1.headers = headers
|
|
202
|
-
} else if (method == 'delete') {
|
|
203
|
-
if (sendValue == null || sendValue) params1.data = payload
|
|
204
|
-
params1.headers = headers
|
|
205
|
-
} else {
|
|
206
|
-
if (sendValue == null || sendValue) {
|
|
207
|
-
params1 = payload
|
|
208
|
-
} else {
|
|
209
|
-
params1 = null
|
|
210
|
-
}
|
|
211
|
-
params2.headers = headers
|
|
103
|
+
set isDirty(isDirty){
|
|
104
|
+
this.setState({isDirty})
|
|
212
105
|
}
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
, method
|
|
216
|
-
, params1
|
|
217
|
-
, params2
|
|
218
|
-
, payload
|
|
106
|
+
get rawValue(){
|
|
107
|
+
return this.state?.rawValue
|
|
219
108
|
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
reload() {
|
|
223
|
-
po('reload 還沒有做 ')
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
submit(config) {
|
|
227
|
-
if (config.mask) {
|
|
228
|
-
config.removeMaskFunction = showMask(config.mask, this.maskId ?? 'jr-mask')
|
|
109
|
+
setRawValue(rawValue){
|
|
110
|
+
this.setState({rawValue:rawValue!=null?JSON.parse(JSON.stringify(rawValue)):null})
|
|
229
111
|
}
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
? _url
|
|
239
|
-
: { url: _url }
|
|
240
|
-
const finalConfig = Object.assign(config, urlParams)
|
|
241
|
-
const { url, method, params1, params2, payload } = this.getAxiosParams(finalConfig)
|
|
242
|
-
_payload.push(payload)
|
|
243
|
-
return axiosSubmit[method](url, params1, params2)
|
|
244
|
-
})
|
|
245
|
-
)
|
|
246
|
-
} else {
|
|
247
|
-
const { url, method, params1, params2, payload } = this.getAxiosParams(config)
|
|
248
|
-
_payload = payload
|
|
249
|
-
return axiosSubmit[method](url, params1, params2)
|
|
112
|
+
reset(){
|
|
113
|
+
this.setValue(this.rawValue,true)
|
|
114
|
+
}
|
|
115
|
+
setValue(value,reset=false){
|
|
116
|
+
if(this.props.onChange){
|
|
117
|
+
this.props.onChange(value)
|
|
118
|
+
}else{
|
|
119
|
+
this.setState({value})
|
|
250
120
|
}
|
|
251
|
-
})()
|
|
252
|
-
.then((res) => {
|
|
253
|
-
this.handleResponse(res, _payload, config)
|
|
254
|
-
})
|
|
255
|
-
.catch((res) => {
|
|
256
|
-
this.handleResponse(res, _payload, config)
|
|
257
|
-
})
|
|
258
|
-
// .finally(()=> {
|
|
259
|
-
// config.removeMaskFunction?.()
|
|
260
|
-
// })
|
|
261
|
-
}
|
|
262
121
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
122
|
+
if(reset){
|
|
123
|
+
this.setRawValue(value)
|
|
124
|
+
}
|
|
125
|
+
this.isDirty=!reset
|
|
126
|
+
}
|
|
127
|
+
setRes(isSuccess,response,config){
|
|
128
|
+
if (isSuccess && config.updateValue) {
|
|
129
|
+
const value=config.formatValue?.bind(this)(response.data)??response.data
|
|
130
|
+
response.data=value
|
|
131
|
+
this.setValue(value,true)
|
|
132
|
+
} else if(config.updateValue){
|
|
133
|
+
this.setValue(null,true)
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
#getValueByName(fullnamList,record){
|
|
137
|
+
const name=fullnamList.shift()
|
|
138
|
+
if(fullnamList.length==0){
|
|
139
|
+
return record?.[name]
|
|
140
|
+
}else if(record?.[name]!=null){
|
|
141
|
+
return this.#getValueByName(fullnamList,record[name])
|
|
270
142
|
}
|
|
271
|
-
return re
|
|
272
|
-
})
|
|
273
|
-
} else {
|
|
274
|
-
response.payload = payload
|
|
275
143
|
}
|
|
276
144
|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
145
|
+
getValue(fullname){
|
|
146
|
+
if(fullname){
|
|
147
|
+
const fullnamList=fullname.split('.')
|
|
148
|
+
return this.#getValueByName(fullnamList,this[this.from]?.value)
|
|
149
|
+
}else{
|
|
150
|
+
// 忘記為甚麼這樣寫了 XDD
|
|
151
|
+
return flexType(this[this.from]?.value,this,null,null)
|
|
152
|
+
}
|
|
153
|
+
}
|
|
281
154
|
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
this.showMessage(isSuccess, isSuccess ? config.successMessage : config.failedMessage)
|
|
285
|
-
config.callback?.bind(this)(isSuccess, response, payload)
|
|
286
|
-
config.removeMaskFunction?.()
|
|
287
|
-
}, config.delay)
|
|
288
|
-
} else {
|
|
289
|
-
this.showMessage(isSuccess, isSuccess ? config.successMessage : config.failedMessage)
|
|
290
|
-
config.callback?.bind(this)(isSuccess, response, payload)
|
|
291
|
-
config.removeMaskFunction?.()
|
|
155
|
+
getSubmitValue(){
|
|
156
|
+
return this.getValue()
|
|
292
157
|
}
|
|
293
158
|
|
|
159
|
+
getAxiosParams({url,method,value,extraValue,sendValue,transformValue,paramsSerializer
|
|
160
|
+
,...params
|
|
161
|
+
}){
|
|
162
|
+
po('params',params)
|
|
163
|
+
const _extraValue=extraValue?.bind?.(this)() ?? extraValue
|
|
164
|
+
// let payload=typeof value === 'function'
|
|
165
|
+
// ?value.bind(this)({
|
|
166
|
+
// ...this.getSubmitValue()
|
|
167
|
+
// ,..._extraValue
|
|
168
|
+
// })
|
|
169
|
+
// :value==null
|
|
170
|
+
// ?{
|
|
171
|
+
// ...this.getSubmitValue()
|
|
172
|
+
// ,..._extraValue
|
|
173
|
+
// }
|
|
174
|
+
// :{
|
|
175
|
+
// ...value
|
|
176
|
+
// ,..._extraValue
|
|
177
|
+
// }
|
|
178
|
+
let payload=value?.bind?.(this)({
|
|
179
|
+
...this.getSubmitValue()
|
|
180
|
+
,..._extraValue
|
|
181
|
+
})
|
|
182
|
+
?? value==null
|
|
183
|
+
?{
|
|
184
|
+
...this.getSubmitValue()
|
|
185
|
+
,..._extraValue
|
|
186
|
+
}
|
|
187
|
+
:{
|
|
188
|
+
...value
|
|
189
|
+
,..._extraValue
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
if(transformValue){
|
|
193
|
+
payload=transformValue.bind(this)(payload)
|
|
194
|
+
}
|
|
195
|
+
const headers={
|
|
196
|
+
authorization: `Bearer ${localStorage.getItem("accessToken")}`
|
|
197
|
+
}
|
|
198
|
+
let params1={}
|
|
199
|
+
const params2={}
|
|
200
|
+
if(method=='get'){
|
|
201
|
+
if(sendValue==null || sendValue) params1.params=payload
|
|
202
|
+
params1.headers=headers
|
|
203
|
+
params1.paramsSerializer=paramsSerializer
|
|
204
|
+
}else if(method=='delete'){
|
|
205
|
+
if(sendValue==null || sendValue) params1.data=payload
|
|
206
|
+
params1.headers=headers
|
|
207
|
+
}else{
|
|
208
|
+
if(sendValue==null || sendValue){
|
|
209
|
+
params1=payload
|
|
210
|
+
}else{
|
|
211
|
+
params1=null
|
|
212
|
+
}
|
|
213
|
+
params2.headers=headers
|
|
214
|
+
}
|
|
215
|
+
return {
|
|
216
|
+
url:colonValueString(url,payload)
|
|
217
|
+
,method
|
|
218
|
+
,params1
|
|
219
|
+
,params2
|
|
220
|
+
,payload
|
|
221
|
+
}
|
|
222
|
+
}
|
|
294
223
|
|
|
295
|
-
|
|
224
|
+
reload(){
|
|
225
|
+
po('reload 還沒有做 ')
|
|
226
|
+
}
|
|
296
227
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
228
|
+
submit(config){
|
|
229
|
+
if(config.mask) {
|
|
230
|
+
config.removeMaskFunction=showMask(config.mask,this.maskId??'jr-mask')
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
let _payload
|
|
234
|
+
;(()=>{
|
|
235
|
+
if (Array.isArray(config.url)) {
|
|
236
|
+
_payload=[]
|
|
237
|
+
return Promise.allSettled(
|
|
238
|
+
config.url.map((_url) => {
|
|
239
|
+
const urlParams=typeof _url === 'object'
|
|
240
|
+
?_url
|
|
241
|
+
:{url: _url}
|
|
242
|
+
const finalConfig=Object.assign(config,urlParams)
|
|
243
|
+
const {url,method,params1,params2,payload}=this.getAxiosParams(finalConfig)
|
|
244
|
+
_payload.push(payload)
|
|
245
|
+
return axiosSubmit[method](url,params1,params2)
|
|
246
|
+
})
|
|
247
|
+
)
|
|
248
|
+
}else{
|
|
249
|
+
const {url,method,params1,params2,payload}=this.getAxiosParams(config)
|
|
250
|
+
_payload=payload
|
|
251
|
+
return axiosSubmit[method](url,params1,params2)
|
|
252
|
+
}
|
|
253
|
+
})()
|
|
254
|
+
.then((res)=>{
|
|
255
|
+
this.handleResponse(res,_payload,config)
|
|
256
|
+
})
|
|
257
|
+
.catch((res)=>{
|
|
258
|
+
this.handleResponse(res,_payload,config)
|
|
259
|
+
})
|
|
260
|
+
// .finally(()=> {
|
|
261
|
+
// config.removeMaskFunction?.()
|
|
262
|
+
// })
|
|
301
263
|
}
|
|
302
|
-
}
|
|
303
264
|
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
265
|
+
handleResponse=(response,payload,config)=>{
|
|
266
|
+
if(Array.isArray(response)){
|
|
267
|
+
response=response.map((re,index)=>{
|
|
268
|
+
if(re.value){
|
|
269
|
+
re.value.payload=payload[index]
|
|
270
|
+
}else if(re.reason){
|
|
271
|
+
re.reason.payload=payload[index]
|
|
272
|
+
}
|
|
273
|
+
return re
|
|
274
|
+
})
|
|
275
|
+
}else{
|
|
276
|
+
response.payload=payload
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
response = config?.response?.bind(this)(response,payload) ?? response
|
|
280
|
+
const isSuccess = response.status >= 200 && response.status <= 299
|
|
281
|
+
this.setRes(isSuccess,response,config)
|
|
282
|
+
if(config.delay!=null){
|
|
283
|
+
setTimeout(()=>{
|
|
284
|
+
this.showMessage(isSuccess,isSuccess?config.successMessage:config.failedMessage)
|
|
285
|
+
config.callback?.bind(this)(isSuccess,response,payload)
|
|
286
|
+
config.removeMaskFunction?.()
|
|
287
|
+
},config.delay)
|
|
288
|
+
}else{
|
|
289
|
+
this.showMessage(isSuccess,isSuccess?config.successMessage:config.failedMessage)
|
|
290
|
+
config.callback?.bind(this)(isSuccess,response,payload)
|
|
291
|
+
config.removeMaskFunction?.()
|
|
292
|
+
}
|
|
293
|
+
}
|
|
307
294
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
295
|
+
showMessage(success,message){
|
|
296
|
+
if(message){
|
|
297
|
+
po('success',success)
|
|
298
|
+
po('message',message)
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
renderer(){
|
|
303
|
+
return
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
render() {
|
|
307
|
+
return this.renderer()
|
|
308
|
+
}
|
|
311
309
|
}
|
|
@@ -74,13 +74,16 @@ class Backdrop extends JRHTML{
|
|
|
74
74
|
Object.assign(this.backdropConfig.style,params.backdropStyle)
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
|
|
78
77
|
show(){
|
|
79
78
|
this.backdrop=this.agregarHijo(this.backdropConfig)
|
|
79
|
+
this.on=true
|
|
80
80
|
}
|
|
81
81
|
hide(){
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
if(this.on){
|
|
83
|
+
this.yo.removeChild(this.yo.children[this.yo.children.length-1])
|
|
84
|
+
this.hijos=[]
|
|
85
|
+
this.on=false
|
|
86
|
+
}
|
|
84
87
|
}
|
|
85
88
|
}
|
|
86
89
|
|
|
@@ -147,6 +150,10 @@ export default class JRWindow extends JRFrame {
|
|
|
147
150
|
}
|
|
148
151
|
}
|
|
149
152
|
|
|
153
|
+
componentWillUnmount(){
|
|
154
|
+
this.backdropTarget?.hide()
|
|
155
|
+
}
|
|
156
|
+
|
|
150
157
|
open(){
|
|
151
158
|
this.backdropTarget?.show()
|
|
152
159
|
this.props.onOpen?.bind(this)()
|
package/src/main.jsx
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { StrictMode } from 'react'
|
|
2
|
-
import { createRoot } from 'react-dom/client'
|
|
3
|
-
import './app/index.css'
|
|
4
|
-
import App from './app/App.jsx'
|
|
5
|
-
import JRFields from './components/JRFields/JRFields.jsx'
|
|
6
|
-
import JRText from './components/JRInput/JRText.jsx'
|
|
7
|
-
|
|
8
|
-
const root = createRoot(document.getElementById('root'))
|
|
9
|
-
root.render(<App/>)
|
|
10
|
-
|
|
1
|
+
import { StrictMode } from 'react'
|
|
2
|
+
import { createRoot } from 'react-dom/client'
|
|
3
|
+
import './app/index.css'
|
|
4
|
+
import App from './app/App.jsx'
|
|
5
|
+
import JRFields from './components/JRFields/JRFields.jsx'
|
|
6
|
+
import JRText from './components/JRInput/JRText.jsx'
|
|
7
|
+
|
|
8
|
+
const root = createRoot(document.getElementById('root'))
|
|
9
|
+
root.render(<App/>)
|
|
10
|
+
|