jrs-react 1.2.5 → 1.2.7
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 +592 -23
- package/build/index.js +592 -23
- package/index.html +13 -0
- package/package.json +14 -3
- package/public/data.json +4 -2
- package/public/list.json +2 -0
- package/public/vite.svg +1 -0
- package/src/app/App.css +8 -0
- package/src/app/App.jsx +17 -0
- package/src/app/fields/FieldsApp.jsx +12 -0
- package/src/app/fields/fieldsConfig.jsx +137 -0
- package/src/app/index.css +42 -0
- package/src/app/table/TableApp.jsx +10 -0
- package/src/app/table/tableConfig.jsx +86 -0
- package/src/app/window/WindowApp.jsx +84 -0
- package/src/assets/react.svg +1 -0
- package/src/components/JRFields/JRFields.jsx +5 -6
- package/src/components/JRFields/StyleJRFields.jsx +2 -1
- package/src/components/JRFrame/JRFrame.jsx +9 -6
- package/src/components/JRInput/JRSelect.jsx +19 -0
- package/src/components/JRInput/JRText.jsx +1 -2
- package/src/components/JRSubmit.jsx +4 -3
- package/src/components/JRTable/JRTable.jsx +3 -2
- package/src/components/JRTable/Slider.jsx +1 -1
- package/src/components/JRTable/StyledJRTable.jsx +1 -2
- package/src/components/JRTable/TBodies.jsx +1 -1
- package/src/components/JRWindow/JRWindow.jsx +110 -0
- package/src/components/JRWindow/Slider.jsx +251 -0
- package/src/components/JRWindow/TitleBar.jsx +84 -0
- package/src/main.jsx +6 -0
- package/vite.config.js +7 -0
package/build/index.es.js
CHANGED
|
@@ -6290,6 +6290,8 @@ class JRSubmit extends React.Component {
|
|
|
6290
6290
|
}
|
|
6291
6291
|
setValue(value, reset = false) {
|
|
6292
6292
|
if (this.props.onChange) {
|
|
6293
|
+
po('name', this.props.name);
|
|
6294
|
+
po('onChange', value);
|
|
6293
6295
|
this.props.onChange(value);
|
|
6294
6296
|
} else {
|
|
6295
6297
|
this.setState({
|
|
@@ -6467,8 +6469,8 @@ class JRSubmit extends React.Component {
|
|
|
6467
6469
|
config.callback?.bind(this)(isSuccess, response, payload);
|
|
6468
6470
|
};
|
|
6469
6471
|
showMessage(success, message) {
|
|
6470
|
-
po('success',
|
|
6471
|
-
po('message',
|
|
6472
|
+
// po('success',success)
|
|
6473
|
+
// po('message',message)
|
|
6472
6474
|
}
|
|
6473
6475
|
renderer() {
|
|
6474
6476
|
return;
|
|
@@ -6496,6 +6498,10 @@ const FreeType$1 = ({
|
|
|
6496
6498
|
className: className,
|
|
6497
6499
|
style: style
|
|
6498
6500
|
}, content);
|
|
6501
|
+
} else if (typeof config === 'string') {
|
|
6502
|
+
return /*#__PURE__*/React.createElement(Tag, {
|
|
6503
|
+
className: className
|
|
6504
|
+
}, config);
|
|
6499
6505
|
}
|
|
6500
6506
|
};
|
|
6501
6507
|
const StyledJRFrame$1 = styled.div`
|
|
@@ -6513,7 +6519,7 @@ const StyledJRFrame$1 = styled.div`
|
|
|
6513
6519
|
flex-direction: column;
|
|
6514
6520
|
> *{
|
|
6515
6521
|
XXborder:1px solid gray;
|
|
6516
|
-
|
|
6522
|
+
XXmin-height:30px;
|
|
6517
6523
|
}
|
|
6518
6524
|
|
|
6519
6525
|
>header{
|
|
@@ -6552,7 +6558,7 @@ class JRFrame extends JRSubmit {
|
|
|
6552
6558
|
config: this.props.left,
|
|
6553
6559
|
me: this,
|
|
6554
6560
|
className: 'left'
|
|
6555
|
-
}), this.renderMe(), /*#__PURE__*/React.createElement(FreeType$1, {
|
|
6561
|
+
}), this.renderMe?.() ?? this.props.children, /*#__PURE__*/React.createElement(FreeType$1, {
|
|
6556
6562
|
tag: "div",
|
|
6557
6563
|
config: this.props.right,
|
|
6558
6564
|
me: this,
|
|
@@ -6568,16 +6574,12 @@ class JRFrame extends JRSubmit {
|
|
|
6568
6574
|
className: 'end'
|
|
6569
6575
|
}));
|
|
6570
6576
|
}
|
|
6571
|
-
renderMe()
|
|
6572
|
-
|
|
6573
|
-
|
|
6574
|
-
flex: 1
|
|
6575
|
-
}
|
|
6576
|
-
}, "Render me");
|
|
6577
|
-
}
|
|
6577
|
+
// renderMe(){
|
|
6578
|
+
// return <div style={{flex:1}}>Render me</div>
|
|
6579
|
+
// }
|
|
6578
6580
|
}
|
|
6579
6581
|
|
|
6580
|
-
const StyledSlider = styled.div`
|
|
6582
|
+
const StyledSlider$1 = styled.div`
|
|
6581
6583
|
position: absolute;
|
|
6582
6584
|
top: 0;
|
|
6583
6585
|
right: 0;
|
|
@@ -6592,7 +6594,7 @@ const StyledSlider = styled.div`
|
|
|
6592
6594
|
border-right:1px dashed gray;
|
|
6593
6595
|
}
|
|
6594
6596
|
`;
|
|
6595
|
-
class Slider extends React.Component {
|
|
6597
|
+
class Slider$1 extends React.Component {
|
|
6596
6598
|
constructor() {
|
|
6597
6599
|
super();
|
|
6598
6600
|
this.sliderRef = /*#__PURE__*/React.createRef();
|
|
@@ -6644,7 +6646,7 @@ class Slider extends React.Component {
|
|
|
6644
6646
|
}
|
|
6645
6647
|
render() {
|
|
6646
6648
|
const column = this.props.column;
|
|
6647
|
-
return /*#__PURE__*/React.createElement(StyledSlider, {
|
|
6649
|
+
return /*#__PURE__*/React.createElement(StyledSlider$1, {
|
|
6648
6650
|
ref: this.sliderRef,
|
|
6649
6651
|
onMouseDown: e => {
|
|
6650
6652
|
this.start(this.props.thRef, column);
|
|
@@ -6686,7 +6688,7 @@ const Ths$1 = ({
|
|
|
6686
6688
|
ref: thRef,
|
|
6687
6689
|
colSpan: column.colSpan,
|
|
6688
6690
|
rowSpan: column.rowSpan ?? (column.isLeaf && deep > rowIndex ? deep - rowIndex + 1 : null)
|
|
6689
|
-
}, flexType(column.label, table), table.props.resizableColumns === true && /*#__PURE__*/React.createElement(Slider, {
|
|
6691
|
+
}, flexType(column.label, table), table.props.resizableColumns === true && /*#__PURE__*/React.createElement(Slider$1, {
|
|
6690
6692
|
table: table,
|
|
6691
6693
|
thRef: thRef,
|
|
6692
6694
|
column: column
|
|
@@ -6992,7 +6994,7 @@ const TBody = ({
|
|
|
6992
6994
|
}, groupData?.length > 0 && /*#__PURE__*/React.createElement(GroupHeader, _extends({
|
|
6993
6995
|
groupData: groupData,
|
|
6994
6996
|
columns: groupHeader
|
|
6995
|
-
}, neededProps)), groupData?.map((record, trIndex) => {
|
|
6997
|
+
}, neededProps)), groupData?.map?.((record, trIndex) => {
|
|
6996
6998
|
const onRowClick = table.props.onRowClick?.bind(table);
|
|
6997
6999
|
return /*#__PURE__*/React.createElement("tr", {
|
|
6998
7000
|
key: trIndex,
|
|
@@ -7086,8 +7088,7 @@ const StyledJRTable = styled.div`
|
|
|
7086
7088
|
|
|
7087
7089
|
th{
|
|
7088
7090
|
position: relative;
|
|
7089
|
-
|
|
7090
|
-
padding: 4px;
|
|
7091
|
+
padding: 2px 6px;
|
|
7091
7092
|
background: linear-gradient(180deg, rgba(227, 227, 226, 1) 0%, rgba(255, 255, 255, 1) 25%, rgba(210, 210, 210, 1) 100%);
|
|
7092
7093
|
box-shadow: 2px 2px 2px 0 #ffffffd6 inset, -1px -1px 2px 0px #8a847dbf inset;
|
|
7093
7094
|
color: #525252;
|
|
@@ -7176,6 +7177,571 @@ const StyledJRTable = styled.div`
|
|
|
7176
7177
|
}
|
|
7177
7178
|
`;
|
|
7178
7179
|
|
|
7180
|
+
const StyledTitle = styled.div`
|
|
7181
|
+
overflow: hidden;
|
|
7182
|
+
display: flex;
|
|
7183
|
+
padding:2px 8px;
|
|
7184
|
+
border:1px solid black;
|
|
7185
|
+
background:rgb(214, 214, 214);
|
|
7186
|
+
color: black;
|
|
7187
|
+
&:active:hover{
|
|
7188
|
+
cursor: grabbing;
|
|
7189
|
+
}
|
|
7190
|
+
|
|
7191
|
+
-webkit-user-select: none;
|
|
7192
|
+
-khtml-user-select: none;
|
|
7193
|
+
-moz-user-select: none;
|
|
7194
|
+
-o-user-select: none;
|
|
7195
|
+
user-select: none;
|
|
7196
|
+
|
|
7197
|
+
> .title{
|
|
7198
|
+
flex: 1;
|
|
7199
|
+
}
|
|
7200
|
+
`;
|
|
7201
|
+
class TitleBar extends React.Component {
|
|
7202
|
+
pos1 = 0;
|
|
7203
|
+
pos2 = 0;
|
|
7204
|
+
pos3 = 0;
|
|
7205
|
+
pos4 = 0;
|
|
7206
|
+
x = 0;
|
|
7207
|
+
y = 0;
|
|
7208
|
+
move = e => {
|
|
7209
|
+
e.preventDefault();
|
|
7210
|
+
this.pos1 = this.pos3 - e.clientX;
|
|
7211
|
+
this.pos2 = this.pos4 - e.clientY;
|
|
7212
|
+
this.pos3 = e.clientX;
|
|
7213
|
+
this.pos4 = e.clientY;
|
|
7214
|
+
const w = this.props.windowRef.current;
|
|
7215
|
+
this.x = w.offsetLeft - this.pos1;
|
|
7216
|
+
this.y = w.offsetTop - this.pos2;
|
|
7217
|
+
w.style.top = this.y + 'px';
|
|
7218
|
+
w.style.left = this.x + 'px';
|
|
7219
|
+
};
|
|
7220
|
+
stop = e => {
|
|
7221
|
+
// const w= this.props.windowRef.current
|
|
7222
|
+
// if(this.y<1)this.props.windowRef.current.style.top = '1px'
|
|
7223
|
+
// if(this.y>window.innerHeight)this.props.windowRef.current.style.top = `${window.innerHeight-32}px`
|
|
7224
|
+
// if(this.x<1)this.props.windowRef.current.style.left = '1px'
|
|
7225
|
+
// if(this.x>window.innerWidth)this.props.windowRef.current.style.left = `${window.innerWidth-100}px`
|
|
7226
|
+
document.body.style.cursor = 'default';
|
|
7227
|
+
window.removeEventListener('mousemove', this.move);
|
|
7228
|
+
window.removeEventListener('mouseup', this.stop);
|
|
7229
|
+
};
|
|
7230
|
+
start(e) {
|
|
7231
|
+
e.preventDefault();
|
|
7232
|
+
this.pos3 = e.clientX;
|
|
7233
|
+
this.pos4 = e.clientY;
|
|
7234
|
+
document.body.style.cursor = 'grabbing';
|
|
7235
|
+
window.addEventListener('mousemove', this.move);
|
|
7236
|
+
window.addEventListener('mouseup', this.stop);
|
|
7237
|
+
}
|
|
7238
|
+
render() {
|
|
7239
|
+
return /*#__PURE__*/React.createElement(StyledTitle, {
|
|
7240
|
+
ref: this.props.titleBarRef,
|
|
7241
|
+
draggable: "false",
|
|
7242
|
+
onMouseDown: e => {
|
|
7243
|
+
this.start(e);
|
|
7244
|
+
}
|
|
7245
|
+
}, /*#__PURE__*/React.createElement(FreeType$1, {
|
|
7246
|
+
tag: "div",
|
|
7247
|
+
config: this.props.title ?? '',
|
|
7248
|
+
me: this.props.window,
|
|
7249
|
+
className: 'title'
|
|
7250
|
+
}), /*#__PURE__*/React.createElement("nav", null, /*#__PURE__*/React.createElement("button", null, "X")));
|
|
7251
|
+
}
|
|
7252
|
+
}
|
|
7253
|
+
|
|
7254
|
+
const StyledSlider = styled.div`
|
|
7255
|
+
Xborder:1px solid ${({
|
|
7256
|
+
$direction: {
|
|
7257
|
+
color
|
|
7258
|
+
}
|
|
7259
|
+
}) => color};
|
|
7260
|
+
xbackground:${({
|
|
7261
|
+
$direction: {
|
|
7262
|
+
color
|
|
7263
|
+
}
|
|
7264
|
+
}) => color};
|
|
7265
|
+
position: absolute;
|
|
7266
|
+
top: ${({
|
|
7267
|
+
$direction: {
|
|
7268
|
+
top
|
|
7269
|
+
}
|
|
7270
|
+
}) => top};
|
|
7271
|
+
bottom: ${({
|
|
7272
|
+
$direction: {
|
|
7273
|
+
bottom
|
|
7274
|
+
}
|
|
7275
|
+
}) => bottom};
|
|
7276
|
+
right: ${({
|
|
7277
|
+
$direction: {
|
|
7278
|
+
right
|
|
7279
|
+
}
|
|
7280
|
+
}) => right};
|
|
7281
|
+
left: ${({
|
|
7282
|
+
$direction: {
|
|
7283
|
+
left
|
|
7284
|
+
}
|
|
7285
|
+
}) => left};
|
|
7286
|
+
height: ${({
|
|
7287
|
+
$direction: {
|
|
7288
|
+
height
|
|
7289
|
+
}
|
|
7290
|
+
}) => height};
|
|
7291
|
+
width: ${({
|
|
7292
|
+
$direction: {
|
|
7293
|
+
width
|
|
7294
|
+
}
|
|
7295
|
+
}) => width};
|
|
7296
|
+
cursor: ${({
|
|
7297
|
+
$direction: {
|
|
7298
|
+
cursor
|
|
7299
|
+
}
|
|
7300
|
+
}) => cursor};
|
|
7301
|
+
|
|
7302
|
+
-webkit-user-select: none;
|
|
7303
|
+
-khtml-user-select: none;
|
|
7304
|
+
-moz-user-select: none;
|
|
7305
|
+
-o-user-select: none;
|
|
7306
|
+
user-select: none;
|
|
7307
|
+
|
|
7308
|
+
`;
|
|
7309
|
+
class Slider extends React.Component {
|
|
7310
|
+
width = '3px';
|
|
7311
|
+
borderWidth = 'px';
|
|
7312
|
+
borderLong = '10px';
|
|
7313
|
+
constructor(props) {
|
|
7314
|
+
super(props);
|
|
7315
|
+
this.sliderRef = /*#__PURE__*/React.createRef();
|
|
7316
|
+
}
|
|
7317
|
+
directions = {
|
|
7318
|
+
n: {
|
|
7319
|
+
top: 0,
|
|
7320
|
+
color: 'red',
|
|
7321
|
+
width: '100%',
|
|
7322
|
+
height: `${this.props.thick}px`,
|
|
7323
|
+
cursor: 'n-resize',
|
|
7324
|
+
resize: props => {
|
|
7325
|
+
this.resizeN(props);
|
|
7326
|
+
}
|
|
7327
|
+
},
|
|
7328
|
+
e: {
|
|
7329
|
+
color: 'yellow',
|
|
7330
|
+
right: 0,
|
|
7331
|
+
width: `${this.props.thick}px`,
|
|
7332
|
+
height: '100%',
|
|
7333
|
+
cursor: 'e-resize',
|
|
7334
|
+
resize: props => {
|
|
7335
|
+
this.resizeE(props);
|
|
7336
|
+
}
|
|
7337
|
+
},
|
|
7338
|
+
s: {
|
|
7339
|
+
color: 'blue',
|
|
7340
|
+
bottom: 0,
|
|
7341
|
+
width: '100%',
|
|
7342
|
+
height: `${this.props.thick}px`,
|
|
7343
|
+
cursor: 's-resize',
|
|
7344
|
+
resize: props => {
|
|
7345
|
+
this.resizeS(props);
|
|
7346
|
+
}
|
|
7347
|
+
},
|
|
7348
|
+
w: {
|
|
7349
|
+
color: 'green',
|
|
7350
|
+
left: 0,
|
|
7351
|
+
width: `${this.props.thick}px`,
|
|
7352
|
+
height: '100%',
|
|
7353
|
+
cursor: 'w-resize',
|
|
7354
|
+
resize: props => {
|
|
7355
|
+
this.resizeW(props);
|
|
7356
|
+
}
|
|
7357
|
+
},
|
|
7358
|
+
nww: {
|
|
7359
|
+
top: 0,
|
|
7360
|
+
left: 0,
|
|
7361
|
+
color: 'blue',
|
|
7362
|
+
width: `${this.props.thick}px`,
|
|
7363
|
+
height: this.borderLong,
|
|
7364
|
+
cursor: 'nw-resize',
|
|
7365
|
+
resize: props => {
|
|
7366
|
+
this.resizeN(props);
|
|
7367
|
+
this.resizeW(props);
|
|
7368
|
+
}
|
|
7369
|
+
},
|
|
7370
|
+
nnw: {
|
|
7371
|
+
top: 0,
|
|
7372
|
+
left: 0,
|
|
7373
|
+
color: 'blue',
|
|
7374
|
+
width: this.borderLong,
|
|
7375
|
+
height: `${this.props.thick}px`,
|
|
7376
|
+
cursor: 'nw-resize',
|
|
7377
|
+
resize: props => {
|
|
7378
|
+
this.resizeN(props);
|
|
7379
|
+
this.resizeW(props);
|
|
7380
|
+
}
|
|
7381
|
+
},
|
|
7382
|
+
nne: {
|
|
7383
|
+
top: 0,
|
|
7384
|
+
right: 0,
|
|
7385
|
+
color: 'green',
|
|
7386
|
+
width: this.borderLong,
|
|
7387
|
+
height: `${this.props.thick}px`,
|
|
7388
|
+
cursor: 'ne-resize',
|
|
7389
|
+
resize: props => {
|
|
7390
|
+
this.resizeN(props);
|
|
7391
|
+
this.resizeE(props);
|
|
7392
|
+
}
|
|
7393
|
+
},
|
|
7394
|
+
nee: {
|
|
7395
|
+
top: 0,
|
|
7396
|
+
right: 0,
|
|
7397
|
+
color: 'green',
|
|
7398
|
+
width: `${this.props.thick}px`,
|
|
7399
|
+
height: this.borderLong,
|
|
7400
|
+
cursor: 'ne-resize',
|
|
7401
|
+
resize: props => {
|
|
7402
|
+
this.resizeN(props);
|
|
7403
|
+
this.resizeE(props);
|
|
7404
|
+
}
|
|
7405
|
+
},
|
|
7406
|
+
sse: {
|
|
7407
|
+
color: 'red',
|
|
7408
|
+
right: 0,
|
|
7409
|
+
bottom: 0,
|
|
7410
|
+
width: this.borderLong,
|
|
7411
|
+
height: `${this.props.thick}px`,
|
|
7412
|
+
cursor: 'se-resize',
|
|
7413
|
+
resize: props => {
|
|
7414
|
+
this.resizeS(props);
|
|
7415
|
+
this.resizeE(props);
|
|
7416
|
+
}
|
|
7417
|
+
},
|
|
7418
|
+
see: {
|
|
7419
|
+
color: 'red',
|
|
7420
|
+
right: 0,
|
|
7421
|
+
bottom: 0,
|
|
7422
|
+
width: `${this.props.thick}px`,
|
|
7423
|
+
height: this.borderLong,
|
|
7424
|
+
cursor: 'se-resize',
|
|
7425
|
+
resize: props => {
|
|
7426
|
+
this.resizeS(props);
|
|
7427
|
+
this.resizeE(props);
|
|
7428
|
+
}
|
|
7429
|
+
},
|
|
7430
|
+
ssw: {
|
|
7431
|
+
color: 'yellow',
|
|
7432
|
+
bottom: 0,
|
|
7433
|
+
left: 0,
|
|
7434
|
+
width: this.borderLong,
|
|
7435
|
+
height: `${this.props.thick}px`,
|
|
7436
|
+
cursor: 'sw-resize',
|
|
7437
|
+
resize: props => {
|
|
7438
|
+
this.resizeS(props);
|
|
7439
|
+
this.resizeW(props);
|
|
7440
|
+
}
|
|
7441
|
+
},
|
|
7442
|
+
sww: {
|
|
7443
|
+
color: 'yellow',
|
|
7444
|
+
bottom: 0,
|
|
7445
|
+
left: 0,
|
|
7446
|
+
width: `${this.props.thick}px`,
|
|
7447
|
+
height: this.borderLong,
|
|
7448
|
+
cursor: 'sw-resize',
|
|
7449
|
+
resize: props => {
|
|
7450
|
+
this.resizeS(props);
|
|
7451
|
+
this.resizeW(props);
|
|
7452
|
+
}
|
|
7453
|
+
}
|
|
7454
|
+
};
|
|
7455
|
+
stop = e => {
|
|
7456
|
+
document.body.style.cursor = 'default';
|
|
7457
|
+
window.removeEventListener('mousemove', this.move);
|
|
7458
|
+
window.removeEventListener('mouseup', this.stop);
|
|
7459
|
+
};
|
|
7460
|
+
resizeN = ({
|
|
7461
|
+
window,
|
|
7462
|
+
cursorY,
|
|
7463
|
+
startY,
|
|
7464
|
+
startHeight,
|
|
7465
|
+
titleBarHeight
|
|
7466
|
+
}) => {
|
|
7467
|
+
let y = cursorY - this.props.thick;
|
|
7468
|
+
if (y < 0) y = 0;
|
|
7469
|
+
let height = startHeight + (startY - y);
|
|
7470
|
+
if (height < titleBarHeight + this.props.thick * 2) {
|
|
7471
|
+
height = titleBarHeight + this.props.thick * 2;
|
|
7472
|
+
y = startY + startHeight - titleBarHeight - this.props.thick * 2;
|
|
7473
|
+
}
|
|
7474
|
+
window.style.top = `${y}px`;
|
|
7475
|
+
window.style.height = `${height}px`;
|
|
7476
|
+
};
|
|
7477
|
+
resizeE = ({
|
|
7478
|
+
window,
|
|
7479
|
+
clientX,
|
|
7480
|
+
left,
|
|
7481
|
+
titleBarHeight
|
|
7482
|
+
}) => {
|
|
7483
|
+
let width = clientX - left - this.props.thick;
|
|
7484
|
+
if (width < titleBarHeight) width = titleBarHeight;
|
|
7485
|
+
window.style.width = `${width + this.props.thick * 2}px`;
|
|
7486
|
+
};
|
|
7487
|
+
resizeS = ({
|
|
7488
|
+
window,
|
|
7489
|
+
clientY,
|
|
7490
|
+
top,
|
|
7491
|
+
titleBarHeight
|
|
7492
|
+
}) => {
|
|
7493
|
+
let height = clientY - top - this.props.thick;
|
|
7494
|
+
if (height < titleBarHeight) height = titleBarHeight;
|
|
7495
|
+
window.style.height = `${height + this.props.thick * 2}px`;
|
|
7496
|
+
};
|
|
7497
|
+
resizeW = ({
|
|
7498
|
+
window,
|
|
7499
|
+
cursorX,
|
|
7500
|
+
startX,
|
|
7501
|
+
startWidth,
|
|
7502
|
+
titleBarHeight
|
|
7503
|
+
}) => {
|
|
7504
|
+
let x = cursorX;
|
|
7505
|
+
if (x <= 1) x = 1;
|
|
7506
|
+
let width = startWidth + (startX - x);
|
|
7507
|
+
if (width < titleBarHeight + this.props.thick * 2) {
|
|
7508
|
+
width = titleBarHeight + this.props.thick * 2;
|
|
7509
|
+
x = startX + startWidth - titleBarHeight - this.props.thick * 2;
|
|
7510
|
+
}
|
|
7511
|
+
window.style.left = `${x}px`;
|
|
7512
|
+
window.style.width = `${width}px`;
|
|
7513
|
+
};
|
|
7514
|
+
move = e => {
|
|
7515
|
+
const {
|
|
7516
|
+
clientX,
|
|
7517
|
+
clientY,
|
|
7518
|
+
x: cursorX,
|
|
7519
|
+
y: cursorY
|
|
7520
|
+
} = e;
|
|
7521
|
+
const window = this.props.windowRef.current;
|
|
7522
|
+
const {
|
|
7523
|
+
left,
|
|
7524
|
+
top
|
|
7525
|
+
} = window.getBoundingClientRect();
|
|
7526
|
+
const {
|
|
7527
|
+
x: startX,
|
|
7528
|
+
width: startWidth,
|
|
7529
|
+
y: startY,
|
|
7530
|
+
height: startHeight,
|
|
7531
|
+
titleBarHeight
|
|
7532
|
+
} = this.data;
|
|
7533
|
+
this.directions[this.props.direction].resize({
|
|
7534
|
+
window,
|
|
7535
|
+
titleBarHeight,
|
|
7536
|
+
clientX,
|
|
7537
|
+
cursorX,
|
|
7538
|
+
startX,
|
|
7539
|
+
startWidth,
|
|
7540
|
+
left,
|
|
7541
|
+
clientY,
|
|
7542
|
+
cursorY,
|
|
7543
|
+
startY,
|
|
7544
|
+
startHeight,
|
|
7545
|
+
top
|
|
7546
|
+
});
|
|
7547
|
+
/////////////////////////////////////////////////////////////
|
|
7548
|
+
|
|
7549
|
+
/////////////////////////////////////////////////////////////
|
|
7550
|
+
};
|
|
7551
|
+
start = () => {
|
|
7552
|
+
const {
|
|
7553
|
+
height: titleBarHeight
|
|
7554
|
+
} = this.props.titleBarRef.current.getBoundingClientRect();
|
|
7555
|
+
const {
|
|
7556
|
+
x,
|
|
7557
|
+
y,
|
|
7558
|
+
width,
|
|
7559
|
+
height
|
|
7560
|
+
} = this.props.windowRef.current.getBoundingClientRect();
|
|
7561
|
+
this.data = {
|
|
7562
|
+
x,
|
|
7563
|
+
y,
|
|
7564
|
+
width,
|
|
7565
|
+
height,
|
|
7566
|
+
titleBarHeight
|
|
7567
|
+
};
|
|
7568
|
+
document.body.style.cursor = this.directions[this.props.direction].cursor;
|
|
7569
|
+
window.addEventListener('mousemove', this.move);
|
|
7570
|
+
window.addEventListener('mouseup', this.stop);
|
|
7571
|
+
};
|
|
7572
|
+
render() {
|
|
7573
|
+
return /*#__PURE__*/React.createElement(StyledSlider, {
|
|
7574
|
+
$direction: this.directions[this.props.direction],
|
|
7575
|
+
$padding: this.props.padding,
|
|
7576
|
+
onMouseDown: this.start
|
|
7577
|
+
});
|
|
7578
|
+
}
|
|
7579
|
+
}
|
|
7580
|
+
|
|
7581
|
+
const StyledJRWindow = styled.div`
|
|
7582
|
+
--padding-child:8px;
|
|
7583
|
+
xborder:1px solid gray;
|
|
7584
|
+
position: absolute;
|
|
7585
|
+
padding: ${({
|
|
7586
|
+
$thick
|
|
7587
|
+
}) => $thick}px;
|
|
7588
|
+
|
|
7589
|
+
top: ${({
|
|
7590
|
+
$y
|
|
7591
|
+
}) => $y}px;
|
|
7592
|
+
left: ${({
|
|
7593
|
+
$x
|
|
7594
|
+
}) => $x}px;
|
|
7595
|
+
width: ${({
|
|
7596
|
+
$width = 300
|
|
7597
|
+
}) => `${$width}px`};
|
|
7598
|
+
height: ${({
|
|
7599
|
+
$height = 300
|
|
7600
|
+
}) => `${$height}px`};
|
|
7601
|
+
overflow: hidden;
|
|
7602
|
+
|
|
7603
|
+
display: flex;
|
|
7604
|
+
flex-direction: column;
|
|
7605
|
+
overflow: hidden;
|
|
7606
|
+
|
|
7607
|
+
> main{
|
|
7608
|
+
box-shadow: 0px 0px 5px 1px gray;
|
|
7609
|
+
Xbackground: white;
|
|
7610
|
+
display: flex;
|
|
7611
|
+
flex-direction: column;
|
|
7612
|
+
overflow: hidden;
|
|
7613
|
+
flex:1;
|
|
7614
|
+
> main {
|
|
7615
|
+
background: white;
|
|
7616
|
+
Xpadding:var(--padding-child);
|
|
7617
|
+
overflow: overlay;
|
|
7618
|
+
flex:1;
|
|
7619
|
+
display: flex;
|
|
7620
|
+
}
|
|
7621
|
+
}
|
|
7622
|
+
`;
|
|
7623
|
+
class JRWindow extends JRFrame {
|
|
7624
|
+
x = 0;
|
|
7625
|
+
y = 0;
|
|
7626
|
+
width = 300;
|
|
7627
|
+
height = 300;
|
|
7628
|
+
padding = 5;
|
|
7629
|
+
thick = 3;
|
|
7630
|
+
constructor(props) {
|
|
7631
|
+
super(props);
|
|
7632
|
+
this.ref = /*#__PURE__*/React.createRef();
|
|
7633
|
+
this.titleBarRef = /*#__PURE__*/React.createRef();
|
|
7634
|
+
if (this.props.popup === true) this.renderer = this.renderWindow;
|
|
7635
|
+
this.init();
|
|
7636
|
+
}
|
|
7637
|
+
init() {
|
|
7638
|
+
this.height = window.innerHeight >= this.props.height ? this.props.height : window.innerHeight;
|
|
7639
|
+
this.width = window.innerWidth >= this.props.width ? this.props.width : window.innerWidth;
|
|
7640
|
+
this.x = this.props.x ?? (window.innerWidth - (this.width ?? 300)) / 2;
|
|
7641
|
+
this.y = this.props.y ?? (window.innerHeight - (this.height ?? 300)) / 2;
|
|
7642
|
+
}
|
|
7643
|
+
componentWillMount() {}
|
|
7644
|
+
// renderer(){
|
|
7645
|
+
// return this.props.popup===true
|
|
7646
|
+
// ?<StyledJRWindow>
|
|
7647
|
+
// {super.renderer()}
|
|
7648
|
+
// </StyledJRWindow>
|
|
7649
|
+
// :super.renderer()
|
|
7650
|
+
// }
|
|
7651
|
+
renderWindow() {
|
|
7652
|
+
return /*#__PURE__*/React.createElement(StyledJRWindow, {
|
|
7653
|
+
ref: this.ref,
|
|
7654
|
+
className: `jr-window ${this.props.className ?? ''}`,
|
|
7655
|
+
$x: this.x,
|
|
7656
|
+
$y: this.y,
|
|
7657
|
+
$width: this.width,
|
|
7658
|
+
$height: this.height,
|
|
7659
|
+
$thick: this.thick
|
|
7660
|
+
// onMouseDown={()=>{
|
|
7661
|
+
// po('onFocus')
|
|
7662
|
+
// this.ref.current.style.zIndex=100
|
|
7663
|
+
// }}
|
|
7664
|
+
}, /*#__PURE__*/React.createElement("main", null, /*#__PURE__*/React.createElement(TitleBar, {
|
|
7665
|
+
titleBarRef: this.titleBarRef,
|
|
7666
|
+
windowRef: this.ref,
|
|
7667
|
+
window: this,
|
|
7668
|
+
title: this.props.title
|
|
7669
|
+
}), /*#__PURE__*/React.createElement("main", null, super.renderer())), /*#__PURE__*/React.createElement(Slider, {
|
|
7670
|
+
direction: 'n',
|
|
7671
|
+
thick: this.thick,
|
|
7672
|
+
windowRef: this.ref,
|
|
7673
|
+
window: this,
|
|
7674
|
+
titleBarRef: this.titleBarRef
|
|
7675
|
+
}), /*#__PURE__*/React.createElement(Slider, {
|
|
7676
|
+
direction: 'e',
|
|
7677
|
+
thick: this.thick,
|
|
7678
|
+
windowRef: this.ref,
|
|
7679
|
+
window: this,
|
|
7680
|
+
titleBarRef: this.titleBarRef
|
|
7681
|
+
}), /*#__PURE__*/React.createElement(Slider, {
|
|
7682
|
+
direction: 's',
|
|
7683
|
+
thick: this.thick,
|
|
7684
|
+
windowRef: this.ref,
|
|
7685
|
+
window: this,
|
|
7686
|
+
titleBarRef: this.titleBarRef
|
|
7687
|
+
}), /*#__PURE__*/React.createElement(Slider, {
|
|
7688
|
+
direction: 'w',
|
|
7689
|
+
thick: this.thick,
|
|
7690
|
+
windowRef: this.ref,
|
|
7691
|
+
window: this,
|
|
7692
|
+
titleBarRef: this.titleBarRef
|
|
7693
|
+
}), /*#__PURE__*/React.createElement(Slider, {
|
|
7694
|
+
direction: 'nww',
|
|
7695
|
+
thick: this.thick,
|
|
7696
|
+
windowRef: this.ref,
|
|
7697
|
+
window: this,
|
|
7698
|
+
titleBarRef: this.titleBarRef
|
|
7699
|
+
}), /*#__PURE__*/React.createElement(Slider, {
|
|
7700
|
+
direction: 'nnw',
|
|
7701
|
+
thick: this.thick,
|
|
7702
|
+
windowRef: this.ref,
|
|
7703
|
+
window: this,
|
|
7704
|
+
titleBarRef: this.titleBarRef
|
|
7705
|
+
}), /*#__PURE__*/React.createElement(Slider, {
|
|
7706
|
+
direction: 'nne',
|
|
7707
|
+
thick: this.thick,
|
|
7708
|
+
windowRef: this.ref,
|
|
7709
|
+
window: this,
|
|
7710
|
+
titleBarRef: this.titleBarRef
|
|
7711
|
+
}), /*#__PURE__*/React.createElement(Slider, {
|
|
7712
|
+
direction: 'nee',
|
|
7713
|
+
thick: this.thick,
|
|
7714
|
+
windowRef: this.ref,
|
|
7715
|
+
window: this,
|
|
7716
|
+
titleBarRef: this.titleBarRef
|
|
7717
|
+
}), /*#__PURE__*/React.createElement(Slider, {
|
|
7718
|
+
direction: 'sse',
|
|
7719
|
+
thick: this.thick,
|
|
7720
|
+
windowRef: this.ref,
|
|
7721
|
+
window: this,
|
|
7722
|
+
titleBarRef: this.titleBarRef
|
|
7723
|
+
}), /*#__PURE__*/React.createElement(Slider, {
|
|
7724
|
+
direction: 'see',
|
|
7725
|
+
thick: this.thick,
|
|
7726
|
+
windowRef: this.ref,
|
|
7727
|
+
window: this,
|
|
7728
|
+
titleBarRef: this.titleBarRef
|
|
7729
|
+
}), /*#__PURE__*/React.createElement(Slider, {
|
|
7730
|
+
direction: 'sww',
|
|
7731
|
+
thick: this.thick,
|
|
7732
|
+
windowRef: this.ref,
|
|
7733
|
+
window: this,
|
|
7734
|
+
titleBarRef: this.titleBarRef
|
|
7735
|
+
}), /*#__PURE__*/React.createElement(Slider, {
|
|
7736
|
+
direction: 'ssw',
|
|
7737
|
+
thick: this.thick,
|
|
7738
|
+
windowRef: this.ref,
|
|
7739
|
+
window: this,
|
|
7740
|
+
titleBarRef: this.titleBarRef
|
|
7741
|
+
}));
|
|
7742
|
+
}
|
|
7743
|
+
}
|
|
7744
|
+
|
|
7179
7745
|
const getMapObject = (map, names) => {
|
|
7180
7746
|
const name = names.shift(names);
|
|
7181
7747
|
if (names.length) {
|
|
@@ -7195,13 +7761,13 @@ const setMapObject = (map, names, value) => {
|
|
|
7195
7761
|
map[name] = value;
|
|
7196
7762
|
}
|
|
7197
7763
|
};
|
|
7198
|
-
class JRTable extends
|
|
7764
|
+
class JRTable extends JRWindow {
|
|
7199
7765
|
constructor(props) {
|
|
7200
7766
|
super(props);
|
|
7201
7767
|
this.colGroupRef = /*#__PURE__*/React.createRef();
|
|
7202
7768
|
}
|
|
7203
7769
|
UNSAFE_componentWillMount() {
|
|
7204
|
-
this.setColumns(this.props.columns);
|
|
7770
|
+
this.setColumns(this.props.columns ?? []);
|
|
7205
7771
|
}
|
|
7206
7772
|
|
|
7207
7773
|
//------------------------------------------------------------------------------------
|
|
@@ -7419,7 +7985,8 @@ const StyleJRFields = styled.main`
|
|
|
7419
7985
|
flex-direction: column;
|
|
7420
7986
|
flex:1;
|
|
7421
7987
|
overflow: overlay;
|
|
7422
|
-
|
|
7988
|
+
padding: 10px;
|
|
7989
|
+
|
|
7423
7990
|
color:#525252;
|
|
7424
7991
|
|
|
7425
7992
|
>.jr-grid{
|
|
@@ -7482,7 +8049,7 @@ const StyledColumn = styled.div`
|
|
|
7482
8049
|
}
|
|
7483
8050
|
}}
|
|
7484
8051
|
`;
|
|
7485
|
-
const StyledColumnLabel = styled.
|
|
8052
|
+
const StyledColumnLabel = styled.div`
|
|
7486
8053
|
${({
|
|
7487
8054
|
$layout
|
|
7488
8055
|
}) => {
|
|
@@ -7593,7 +8160,7 @@ function requiredValidator({
|
|
|
7593
8160
|
};
|
|
7594
8161
|
}
|
|
7595
8162
|
}
|
|
7596
|
-
class JRFields extends
|
|
8163
|
+
class JRFields extends JRWindow {
|
|
7597
8164
|
UNSAFE_componentWillMount() {
|
|
7598
8165
|
this.#initValidateValue();
|
|
7599
8166
|
}
|
|
@@ -7788,6 +8355,7 @@ class JRFields extends JRFrame {
|
|
|
7788
8355
|
}) : typeof value === 'object' ? JSON.stringify(value) : value);
|
|
7789
8356
|
}
|
|
7790
8357
|
const layout = column.labelProps?.layout === undefined ? this.props.labelProps?.layout : column.labelProps?.layout;
|
|
8358
|
+
const labelStyle = column.labelProps?.style ?? this.props.labelProps?.style ?? {};
|
|
7791
8359
|
return /*#__PURE__*/React.createElement(StyledColumn, {
|
|
7792
8360
|
$layout: layout,
|
|
7793
8361
|
$hasLabel: label != null,
|
|
@@ -7797,6 +8365,7 @@ class JRFields extends JRFrame {
|
|
|
7797
8365
|
$labelWidth: column.labelProps?.width ?? this.props.labelProps?.width ?? '120px',
|
|
7798
8366
|
$valueWidth: column.valueProps?.width ?? this.props.valueProps?.width ?? '1fr'
|
|
7799
8367
|
}, label != null && /*#__PURE__*/React.createElement(StyledColumnLabel, {
|
|
8368
|
+
style: labelStyle,
|
|
7800
8369
|
$required: required,
|
|
7801
8370
|
className: 'label',
|
|
7802
8371
|
$layout: layout,
|