jrs-react 1.2.14 → 1.2.16

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
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
- import React__default from 'react';
2
+ import React__default, { useState } from 'react';
3
3
  import styled from 'styled-components';
4
+ import { createRoot } from 'react-dom/client';
4
5
 
5
6
  function bind(fn, thisArg) {
6
7
  return function wrap() {
@@ -3516,6 +3517,8 @@ class JRSubmit extends React__default.Component {
3516
3517
  const fullnamList = fullname.split('.');
3517
3518
  return this.#getValueByName(fullnamList, this[this.from]?.value);
3518
3519
  } else {
3520
+ // po('ssssssssssssssssssssssssssssssssssssssssss')
3521
+ // 忘記為甚麼這樣寫了 XDD
3519
3522
  return flexType(this[this.from]?.value, this, null, null);
3520
3523
  }
3521
3524
  }
@@ -3671,7 +3674,7 @@ class JRSubmit extends React__default.Component {
3671
3674
  }
3672
3675
  }
3673
3676
 
3674
- const FreeType$1 = ({
3677
+ const FreeType = ({
3675
3678
  tag: Tag,
3676
3679
  config,
3677
3680
  me,
@@ -3695,7 +3698,7 @@ const FreeType$1 = ({
3695
3698
  }, config);
3696
3699
  }
3697
3700
  };
3698
- const StyledJRFrame$1 = styled.div`
3701
+ const StyledJRFrame = styled.div`
3699
3702
  display:flex;
3700
3703
  flex:1;
3701
3704
  overflow:hidden;
@@ -3738,36 +3741,36 @@ const StyledJRFrame$1 = styled.div`
3738
3741
  `;
3739
3742
  class JRFrame extends JRSubmit {
3740
3743
  renderer() {
3741
- return /*#__PURE__*/React__default.createElement(StyledJRFrame$1, {
3744
+ return /*#__PURE__*/React__default.createElement(StyledJRFrame, {
3742
3745
  id: this.props.id,
3743
3746
  style: this.props.style,
3744
3747
  className: `${this.props.className} jr-frame`
3745
- }, /*#__PURE__*/React__default.createElement(FreeType$1, {
3748
+ }, /*#__PURE__*/React__default.createElement(FreeType, {
3746
3749
  tag: "div",
3747
3750
  config: this.props.start,
3748
3751
  me: this,
3749
3752
  className: 'start'
3750
- }), /*#__PURE__*/React__default.createElement("main", null, /*#__PURE__*/React__default.createElement(FreeType$1, {
3753
+ }), /*#__PURE__*/React__default.createElement("main", null, /*#__PURE__*/React__default.createElement(FreeType, {
3751
3754
  tag: "header",
3752
3755
  config: this.props.top,
3753
3756
  me: this
3754
- }), /*#__PURE__*/React__default.createElement("main", null, /*#__PURE__*/React__default.createElement(FreeType$1, {
3757
+ }), /*#__PURE__*/React__default.createElement("main", null, /*#__PURE__*/React__default.createElement(FreeType, {
3755
3758
  tag: "div",
3756
3759
  config: this.props.left,
3757
3760
  me: this,
3758
3761
  className: 'left'
3759
3762
  }), /*#__PURE__*/React__default.createElement("main", {
3760
3763
  className: 'body'
3761
- }, this.renderMe?.() ?? this.props.children), /*#__PURE__*/React__default.createElement(FreeType$1, {
3764
+ }, this.renderMe?.() ?? this.props.children), /*#__PURE__*/React__default.createElement(FreeType, {
3762
3765
  tag: "div",
3763
3766
  config: this.props.right,
3764
3767
  me: this,
3765
3768
  className: 'right'
3766
- })), /*#__PURE__*/React__default.createElement(FreeType$1, {
3769
+ })), /*#__PURE__*/React__default.createElement(FreeType, {
3767
3770
  tag: "footer",
3768
3771
  config: this.props.bottom,
3769
3772
  me: this
3770
- })), /*#__PURE__*/React__default.createElement(FreeType$1, {
3773
+ })), /*#__PURE__*/React__default.createElement(FreeType, {
3771
3774
  tag: "div",
3772
3775
  config: this.props.end,
3773
3776
  me: this,
@@ -3776,1291 +3779,1502 @@ class JRFrame extends JRSubmit {
3776
3779
  }
3777
3780
  }
3778
3781
 
3779
- const StyledSlider$1 = styled.div`
3780
- position: absolute;
3781
- top: 0;
3782
- right: 0;
3783
- height:100%;
3784
- width:6px;
3782
+ var _path;
3783
+ function _extends$1() { return _extends$1 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$1.apply(null, arguments); }
3784
+ var SvgX = function SvgX(props) {
3785
+ return /*#__PURE__*/React.createElement("svg", _extends$1({
3786
+ xmlns: "http://www.w3.org/2000/svg",
3787
+ width: 24,
3788
+ height: 24,
3789
+ fill: "none",
3790
+ stroke: "currentColor",
3791
+ strokeLinecap: "round",
3792
+ strokeLinejoin: "round",
3793
+ strokeWidth: 2,
3794
+ viewBox: "0 0 24 24"
3795
+ }, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
3796
+ d: "M18 6 6 18M6 6l12 12"
3797
+ })));
3798
+ };
3799
+
3800
+ function JRButton({
3801
+ icon,
3802
+ children,
3803
+ ...props
3804
+ }) {
3805
+ return /*#__PURE__*/React__default.createElement("button", props, icon, children);
3806
+ }
3807
+
3808
+ const StyledTitle = styled.div`
3809
+ overflow: hidden;
3810
+ display: flex;
3811
+ border-radius: var(--jr-window-radius) var(--jr-window-radius) 0 0;
3812
+ background:#464646;
3813
+ color: white;
3814
+ display: flex;
3815
+ align-items: center;
3816
+ min-height: min-content;
3817
+ XX&:active{
3818
+ cursor: grabbing;
3819
+ }
3820
+
3821
+ -webkit-user-select: none;
3822
+ -khtml-user-select: none;
3823
+ -moz-user-select: none;
3824
+ -o-user-select: none;
3785
3825
  user-select: none;
3786
- &.resizing:hover,&.resizing{
3787
- border-right:1px dashed black;
3826
+
3827
+ > .title{
3828
+
3829
+ flex: 1;
3830
+ padding:2px 0 2px 8px;
3831
+ text-overflow: ellipsis;
3832
+ overflow: hidden;
3833
+ white-space: nowrap;
3788
3834
  }
3789
- &:hover{
3790
- cursor: col-resize;
3791
- border-right:1px dashed gray;
3835
+ > nav{
3836
+ display: flex;
3837
+ align-items: anchor-center;
3838
+
3839
+
3840
+ >button{
3841
+ outline: unset;
3842
+ display:flex;
3843
+ align-items: center;
3844
+ justify-content: center;
3845
+ border: unset;
3846
+ background: unset;
3847
+ cursor: pointer;
3848
+ width:32px;
3849
+ height:32px;
3850
+ xborder:1px solid green;
3851
+ padding: 0;
3852
+ margin: 0;
3853
+ &:hover{
3854
+ background: #bbbbbb;
3855
+ color:white;
3856
+ }
3857
+ >svg{
3858
+ color:#bababa;
3859
+ width:14px;
3860
+ height:14px;
3861
+ cursor: pointer;
3862
+ stroke-width: 3;
3863
+ }
3864
+ }
3865
+ >button.danger:hover{
3866
+ background: red;
3867
+ >svg{
3868
+ color:white;
3869
+ }
3870
+ }
3792
3871
  }
3793
3872
  `;
3794
- class Slider$1 extends React__default.Component {
3795
- constructor() {
3796
- super();
3797
- this.sliderRef = /*#__PURE__*/React__default.createRef();
3798
- }
3873
+ class TitleBar extends React__default.Component {
3874
+ pos1 = 0;
3875
+ pos2 = 0;
3876
+ pos3 = 0;
3877
+ pos4 = 0;
3878
+ x = 0;
3879
+ y = 0;
3880
+ remember = e => {
3881
+ po('remember');
3882
+ const {
3883
+ clientX,
3884
+ clientY
3885
+ } = e;
3886
+ const {
3887
+ x,
3888
+ y,
3889
+ width,
3890
+ height
3891
+ } = this.props.windowRef.current.getBoundingClientRect();
3892
+ this.props.window.orgHeight = height;
3893
+ this.props.window.orgWidth = width;
3894
+ this.props.window.orgTop = y;
3895
+ this.props.window.orgLeft = x;
3896
+ this.props.window.orgXd = clientX - x;
3897
+ this.props.window.orgBodyOverflow = document.body.style.overflow;
3898
+ };
3899
+ adjustScreen = e => {
3900
+ po('double click adjustScreen');
3901
+ e.preventDefault();
3902
+ const {
3903
+ x,
3904
+ y,
3905
+ width,
3906
+ height
3907
+ } = this.props.windowRef.current.getBoundingClientRect();
3908
+ if (y > 1 - this.props.thick) {
3909
+ this.remember(e);
3910
+ this.fullScreen(e);
3911
+ } else {
3912
+ this.floatScreen(e);
3913
+ }
3914
+ };
3915
+ floatScreen = e => {
3916
+ po('floatScreen');
3917
+ this.props.windowRef.current;
3918
+ this.props.windowRef.current.style.transition = 'var(--transition-x-y), left .05s ease-in';
3919
+ this.props.windowRef.current.style.left = `${this.props.window.orgLeft}px`;
3920
+ this.props.windowRef.current.style.top = `${this.props.window.orgTop}px`;
3921
+ this.props.windowRef.current.style.width = `${this.props.window.orgWidth}px`;
3922
+ this.props.windowRef.current.style.height = `${this.props.window.orgHeight}px`;
3923
+ document.body.style.overflow = this.props.window.orgBodyOverflow;
3924
+ };
3925
+ fullScreen = e => {
3926
+ po('fullScreen', this.props.thick);
3927
+ this.props.windowRef.current.style.transition = 'var(--transition-x-y), left .05s ease-in';
3928
+ this.props.windowRef.current.style.left = `${-this.props.thick}px`;
3929
+ this.props.windowRef.current.style.top = `${-this.props.thick}px`;
3930
+ this.props.windowRef.current.style.width = `calc(100vw + ${this.props.thick * 2}px)`; //`${window.innerWidth+(this.props.thick*2)}px`
3931
+ this.props.windowRef.current.style.height = `calc(100vh + ${this.props.thick * 2}px)`; //`${window.innerHeight+(this.props.thick*2)}px`
3932
+
3933
+ setTimeout(() => {
3934
+ document.body.style.overflow = 'hidden';
3935
+ this.props.windowRef.current.style.transition = 'unset';
3936
+ }, 50);
3937
+ };
3799
3938
  stop = e => {
3800
- this.sliderRef.current.classList.remove('resizing');
3939
+ po('stop');
3940
+ e.preventDefault();
3941
+ if (this.moved) {
3942
+ const {
3943
+ height: titleBarHeight
3944
+ } = this.props.titleBarRef.current.getBoundingClientRect();
3945
+ const {
3946
+ x,
3947
+ y,
3948
+ width,
3949
+ height
3950
+ } = this.props.windowRef.current.getBoundingClientRect();
3951
+ if (y < 1 - this.props.thick) this.fullScreen(e);
3952
+ if (y > window.innerHeight - titleBarHeight) this.props.windowRef.current.style.top = `${window.innerHeight - titleBarHeight}px`;
3953
+ if (x + width - this.props.thick < 0) this.props.windowRef.current.style.left = 0;
3954
+ if (x > window.innerWidth) this.props.windowRef.current.style.left = `${window.innerWidth - width}px`;
3955
+ }
3801
3956
  document.body.style.cursor = 'default';
3802
3957
  window.removeEventListener('mousemove', this.move);
3803
3958
  window.removeEventListener('mouseup', this.stop);
3959
+ window.removeEventListener('mousemove', this.preMove);
3804
3960
  };
3805
- move = ({
3806
- clientX
3807
- }) => {
3808
- const {
3809
- th,
3810
- selectedCols,
3811
- widthRates
3812
- } = this.data;
3961
+ move = e => {
3962
+ po('move');
3963
+ e.preventDefault();
3964
+ this.moved = true;
3813
3965
  const {
3814
- left
3815
- } = th.getBoundingClientRect();
3816
- const min = left + 10;
3817
- const x = clientX >= min ? clientX : min;
3818
- const width = x - left;
3819
- selectedCols.forEach((col, index) => {
3820
- const _width = Math.round(width / 100 * widthRates[index]);
3821
- col.style.width = _width + 'px';
3822
- });
3823
- };
3824
- start(thPRef, column) {
3825
- const selectedCols = [...this.props.table.colGroupRef.current.children].slice(column.columnNo, column.columnNo + (column.colSpan ?? 1));
3826
- const totalWidth = selectedCols.reduce((aco, {
3827
- offsetWidth
3828
- }) => aco + offsetWidth, 0);
3829
- const widthRates = selectedCols.map(({
3830
- offsetWidth
3831
- }) => {
3832
- return 100 * (offsetWidth / totalWidth);
3833
- });
3834
- this.data = {
3835
- selectedCols,
3836
- th: thPRef.current,
3837
- widthRates
3838
- };
3839
- this.sliderRef.current.classList.add('resizing');
3840
- document.body.style.cursor = 'col-resize';
3841
- window.addEventListener('mousemove', this.move);
3842
- window.addEventListener('mouseup', this.stop);
3843
- }
3844
- render() {
3845
- const column = this.props.column;
3846
- return /*#__PURE__*/React__default.createElement(StyledSlider$1, {
3847
- ref: this.sliderRef,
3848
- onMouseDown: e => {
3849
- this.start(this.props.thRef, column);
3850
- }
3851
- });
3852
- }
3853
- }
3966
+ clientX,
3967
+ clientY
3968
+ } = e;
3969
+ const y = clientY < 1 ? 0 : clientY;
3970
+ this.pos1 = this.pos3 - clientX;
3971
+ this.pos2 = this.pos4 - y;
3972
+ this.pos3 = clientX;
3973
+ this.pos4 = y;
3974
+ const w = this.props.windowRef.current;
3975
+ this.y = w.offsetTop - this.pos2;
3976
+ this.x = w.offsetLeft - this.pos1;
3854
3977
 
3855
- const Colgroup = ({
3856
- leafColumns,
3857
- colGroupRef
3858
- }) => {
3859
- return /*#__PURE__*/React__default.createElement("colgroup", {
3860
- ref: colGroupRef
3861
- }, leafColumns?.map((_column, index) => {
3862
- const {
3863
- width,
3864
- ...column
3865
- } = _column;
3866
- const style = {
3867
- width
3868
- };
3869
- return /*#__PURE__*/React__default.createElement("col", {
3870
- style: style,
3871
- key: index
3872
- });
3873
- }));
3874
- };
3875
- const Ths$1 = ({
3876
- deep,
3877
- rowColumn,
3878
- rowIndex,
3879
- table
3880
- }) => {
3881
- return rowColumn?.map((column, colIndex) => {
3882
- const thRef = /*#__PURE__*/React__default.createRef();
3883
- return /*#__PURE__*/React__default.createElement("th", {
3884
- key: colIndex,
3885
- ref: thRef,
3886
- colSpan: column.colSpan,
3887
- rowSpan: column.rowSpan ?? (column.isLeaf && deep > rowIndex ? deep - rowIndex + 1 : null)
3888
- }, flexType(column.label, table), (table.props.resizableColumns === undefined || table.props.resizableColumns) && /*#__PURE__*/React__default.createElement(Slider$1, {
3889
- table: table,
3890
- thRef: thRef,
3891
- column: column
3892
- }));
3893
- });
3894
- };
3895
- const HeadTrs = ({
3896
- columns: _columns,
3897
- trClassName,
3898
- table
3899
- }) => {
3900
- const columns = Array.isArray(_columns?.[0]) ? _columns : [_columns];
3901
- return columns?.map((rowColumn, rowIndex) => {
3902
- return /*#__PURE__*/React__default.createElement("tr", {
3903
- className: trClassName,
3904
- key: rowIndex
3905
- }, /*#__PURE__*/React__default.createElement(Ths$1, {
3906
- deep: columns.length - 1,
3907
- rowColumn: rowColumn,
3908
- rowIndex: rowIndex,
3909
- table: table
3910
- }));
3911
- });
3912
- };
3913
- const THead = ({
3914
- columns,
3915
- leafColumns,
3916
- table
3917
- }) => {
3918
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("thead", null, /*#__PURE__*/React__default.createElement(HeadTrs, {
3919
- columns: columns,
3920
- table: table
3921
- })), /*#__PURE__*/React__default.createElement(Colgroup, {
3922
- leafColumns: leafColumns,
3923
- colGroupRef: table.colGroupRef
3924
- }));
3925
- };
3926
- const FootThs = ({
3927
- table,
3928
- groupData,
3929
- groupIndex,
3930
- deep,
3931
- columns,
3932
- rowIndex
3933
- }) => {
3934
- return columns?.map((column, colIndex) => {
3935
- // let content
3936
- // if(type){
3937
- // content='type'
3938
- // }else if(render){
3939
-
3940
- // content=render?.bind(table)({groupData,groupIndex,ths:111})
3941
- // }else{
3942
- // content=column.label
3978
+ // if(this.props.window.orgWidth){
3979
+ // w.style.width=`${this.props.window.orgWidth}px`
3980
+ // this.props.window.orgWidth=null
3943
3981
  // }
3944
- let style = flexType(column.style, table, {}, {});
3945
- const content = whatType(column, table, column.label);
3946
- return /*#__PURE__*/React__default.createElement("th", {
3947
- style: style,
3948
- colSpan: column.colSpan,
3949
- rowSpan: column.rowSpan
3950
- }, content);
3951
- });
3952
- };
3953
- const TFoot = ({
3954
- table,
3955
- columns
3956
- }) => {
3957
- const trs = columns?.map((rowColumn, rowIndex) => {
3958
- return /*#__PURE__*/React__default.createElement("tr", {
3959
- key: rowIndex
3960
- }, /*#__PURE__*/React__default.createElement(FootThs, {
3961
- columns: rowColumn,
3962
- table: table
3963
- }));
3964
- });
3965
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("tfoot", null, trs));
3966
- };
3967
-
3968
- function _extends$1() {
3969
- return _extends$1 = Object.assign ? Object.assign.bind() : function (n) {
3970
- for (var e = 1; e < arguments.length; e++) {
3971
- var t = arguments[e];
3972
- for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
3973
- }
3974
- return n;
3975
- }, _extends$1.apply(null, arguments);
3976
- }
3977
-
3978
- styled.tbody`
3979
- th{
3980
- height:4px;
3981
- background:#c6c6c6;
3982
- }
3983
- `;
3984
-
3985
- ////////////////////////////////////////////////////////////////////////////
3986
3982
 
3987
- const Ths = ({
3988
- table,
3989
- groupData,
3990
- groupIndex,
3991
- deep,
3992
- rowColumn,
3993
- rowIndex
3994
- }) => {
3995
- return rowColumn?.map(({
3996
- style: _style,
3997
- align,
3998
- type,
3999
- render,
4000
- ...column
4001
- }, colIndex) => {
4002
- const style = flexType(_style, table, {}, {});
4003
- let content;
4004
- if (type) {
4005
- content = 'type';
4006
- } else if (render) {
4007
- content = render?.bind(table)({
4008
- groupData,
4009
- groupIndex,
4010
- ths: 111
4011
- });
3983
+ this.y = this.y < -this.props.thick ? -this.props.thick : this.y;
3984
+ w.style.transition = 'unset';
3985
+ w.style.top = `${this.y}px`;
3986
+ w.style.left = `${this.x}px`;
3987
+ };
3988
+ preMove = e => {
3989
+ console.clear();
3990
+ po('preMove');
3991
+ const w = this.props.windowRef.current;
3992
+ const {
3993
+ clientX,
3994
+ clientY,
3995
+ ...oe
3996
+ } = e;
3997
+ po('e', e);
3998
+ const {
3999
+ x,
4000
+ y,
4001
+ width,
4002
+ height
4003
+ } = w.getBoundingClientRect();
4004
+ po('width', width);
4005
+ if (y <= -this.props.thick) ;
4006
+ w.style.transition = 'left .05s ease-in, height .05s ease-in';
4007
+ if (y <= 0) {
4008
+ // contt browserWidth=
4009
+ const w1 = window.innerWidth - this.props.thick * 2;
4010
+ const x1 = clientX;
4011
+ const w2 = this.props.window.orgWidth - 32;
4012
+ const x2 = x1 / w1 * w2;
4013
+ // po('xp' , x2)
4014
+ w.style.left = `${clientX - x2}px`;
4015
+ w.style.width = `${this.props.window.orgWidth}px`;
4016
+ w.style.height = `${this.props.window.orgHeight}px`;
4012
4017
  } else {
4013
- content = column.label;
4018
+ this.remember(e);
4014
4019
  }
4015
- // style.textAlign=align
4016
- return /*#__PURE__*/React__default.createElement("th", {
4017
- key: colIndex,
4018
- style: {
4019
- textAlign: align,
4020
- ...style
4020
+ document.body.style.cursor = 'grabbing';
4021
+ document.body.style.overflow = this.props.window.orgBodyOverflow;
4022
+ setTimeout(() => {
4023
+ window.addEventListener('mousemove', this.move);
4024
+ }, 50);
4025
+ window.removeEventListener('mousemove', this.preMove);
4026
+ };
4027
+ start(e) {
4028
+ po('start');
4029
+ e.preventDefault();
4030
+ this.moved = false;
4031
+ this.pos3 = e.clientX;
4032
+ this.pos4 = e.clientY;
4033
+ this.props.windowRef.current.style.transition = 'var(--transition-x-y)';
4034
+ window.addEventListener('mousemove', this.preMove);
4035
+ window.addEventListener('mouseup', this.stop);
4036
+ }
4037
+ onDoubleClick() {
4038
+ po('onDoubleClick');
4039
+ }
4040
+ render() {
4041
+ return /*#__PURE__*/React__default.createElement(StyledTitle, {
4042
+ ref: this.props.titleBarRef,
4043
+ draggable: "false",
4044
+ onMouseDown: e => {
4045
+ this.start(e);
4021
4046
  },
4022
- colSpan: column.colSpan,
4023
- rowSpan: column.isLeaf && deep > rowIndex ? deep - rowIndex + 1 : null
4024
- }, content);
4025
- });
4026
- };
4027
- const GroupColumns = ({
4028
- table,
4029
- columns: _columns,
4030
- trClassName,
4031
- groupData,
4032
- tbodyIndex
4033
- }) => {
4034
- const columns = Array.isArray(_columns?.[0]) ? _columns : [_columns];
4035
- return columns?.map((rowColumn, rowIndex) => {
4036
- return /*#__PURE__*/React__default.createElement("tr", {
4037
- className: trClassName,
4038
- key: rowIndex
4039
- }, /*#__PURE__*/React__default.createElement(Ths, {
4040
- table: table,
4041
- groupData: groupData,
4042
- groupIndex: tbodyIndex,
4043
- deep: columns.length - 1,
4044
- rowColumn: rowColumn,
4045
- rowIndex: rowIndex
4046
- }));
4047
- });
4048
- };
4049
- styled.tr`
4050
- z-index: 1;
4051
- XXposition: sticky;
4052
- XXtop: 50px;
4053
- th{
4054
- text-align: left;
4055
- border:1px solid #222222;
4056
- }
4057
- `;
4058
- const GroupHeader = props => {
4059
- return /*#__PURE__*/React__default.createElement(GroupColumns, _extends$1({
4060
- trClassName: 'jr-group-header'
4061
- }, props));
4062
- };
4063
- styled.tr`
4064
- th{
4065
- border:1px solid #222222;
4066
- text-align: left;
4067
- }
4068
- `;
4069
- const GroupFooter = props => {
4070
- return /*#__PURE__*/React__default.createElement(GroupColumns, _extends$1({
4071
- trClassName: 'jr-group-footer'
4072
- }, props));
4073
- };
4047
+ onDoubleClick: this.adjustScreen
4048
+ }, /*#__PURE__*/React__default.createElement(FreeType, {
4049
+ tag: "div",
4050
+ config: this.props.title ?? '',
4051
+ me: this.props.window,
4052
+ className: 'title'
4053
+ }), /*#__PURE__*/React__default.createElement("nav", null, this.props.window.props.setOpen ? /*#__PURE__*/React__default.createElement(JRButton, {
4054
+ icon: /*#__PURE__*/React__default.createElement(SvgX, null),
4055
+ className: 'danger',
4056
+ onClick: e => {
4057
+ e.stopPropagation();
4058
+ if (this.props.window.orgBodyOverflow != null) {
4059
+ document.body.style.overflow = this.props.window.orgBodyOverflow;
4060
+ }
4061
+ this.props.window.props.setOpen(false);
4062
+ },
4063
+ onMouseDown: e => {
4064
+ e.stopPropagation();
4065
+ }
4066
+ }) : null));
4067
+ }
4068
+ }
4074
4069
 
4075
- ////////////////////////////////////////////////////////////////////////////
4076
- const Td = ({
4077
- column: _column,
4078
- record,
4079
- tbodyIndex,
4080
- trIndex,
4081
- tdIndex,
4082
- table
4083
- }) => {
4084
- let content;
4085
- const {
4086
- style: _style,
4087
- align,
4088
- vAlign = 'baseline',
4089
- type,
4090
- typeStyle: _typeStyle,
4091
- render,
4092
- setValue,
4093
- getValue,
4094
- onChange: _onChange,
4095
- funcProps,
4096
- ...column
4097
- } = _column;
4098
- const onChange = inputValue => {
4099
- const targetValue = inputValue?.target?.value ?? inputValue;
4100
- setValue(record, targetValue);
4101
- table.setValue(table.getValue());
4102
- };
4103
- const value = getValue(record);
4104
- let style = render ? {} : flexType(_style, table, {
4105
- value,
4106
- record
4107
- }, {});
4108
- const setStyle = _style => {
4109
- style = _style;
4110
- };
4111
- setStyle.bind(table);
4112
- render?.bind(table);
4113
- if (type) {
4114
- const typeStyle = flexType(_typeStyle, table, {
4115
- record
4116
- }, {});
4117
- content = /*#__PURE__*/React__default.createElement(type, {
4118
- onChange: _onChange ? e => {
4119
- _onChange?.bind(table)(e, {
4120
- value,
4121
- onChange,
4122
- me: content
4123
- });
4124
- } : onChange,
4125
- value,
4126
- style: typeStyle,
4127
- render,
4128
- ...column,
4129
- ...funcProps?.bind(table)({
4130
- value
4131
- })
4132
- });
4133
- } else if (render) {
4134
- content = render({
4135
- index: trIndex,
4136
- groupIndex: tbodyIndex,
4137
- value,
4138
- record,
4139
- onChange,
4140
- setStyle
4141
- });
4142
- } else {
4143
- content = value;
4070
+ const directions = ['n', 'e', 's', 'w', 'nww', 'nnw', 'nne', 'nee', 'sse', 'see', 'sww', 'ssw'];
4071
+ class Sliders extends React__default.Component {
4072
+ render() {
4073
+ return directions.map((direction, index) => /*#__PURE__*/React__default.createElement(Slider$1, {
4074
+ direction: direction,
4075
+ thick: this.props.thick,
4076
+ windowRef: this.props.windowRef,
4077
+ window: this.props.window,
4078
+ titleBarRef: this.props.titleBarRef,
4079
+ key: index
4080
+ }));
4144
4081
  }
4145
- return /*#__PURE__*/React__default.createElement("td", {
4146
- colSpan: style.colSpan,
4147
- rowSpan: style.rowSpan,
4148
- style: {
4149
- textAlign: align,
4150
- verticalAlign: vAlign,
4151
- ...style
4152
- },
4153
- key: tdIndex
4154
- }, content);
4155
- };
4156
- const Tds = ({
4157
- leafColumns,
4158
- record,
4159
- table,
4160
- tbodyIndex,
4161
- trIndex
4162
- }) => {
4163
- return leafColumns?.map((column, tdIndex) => {
4164
- return /*#__PURE__*/React__default.createElement(Td, {
4165
- column: column,
4166
- key: tdIndex,
4167
- record: record,
4168
- table: table,
4169
- tbodyIndex: tbodyIndex,
4170
- trIndex: trIndex,
4171
- tdIndex: tdIndex
4172
- });
4173
- });
4174
- };
4175
- ////////////////////////////////////////////////////////////////////////////
4082
+ }
4083
+ const StyledSlider$1 = styled.div`
4084
+ Xborder:1px solid ${({
4085
+ $direction: {
4086
+ color
4087
+ }
4088
+ }) => color};
4089
+ Xbackground:${({
4090
+ $direction: {
4091
+ color
4092
+ }
4093
+ }) => color};
4094
+ position: absolute;
4095
+ top: ${({
4096
+ $direction: {
4097
+ top
4098
+ }
4099
+ }) => top};
4100
+ bottom: ${({
4101
+ $direction: {
4102
+ bottom
4103
+ }
4104
+ }) => bottom};
4105
+ right: ${({
4106
+ $direction: {
4107
+ right
4108
+ }
4109
+ }) => right};
4110
+ left: ${({
4111
+ $direction: {
4112
+ left
4113
+ }
4114
+ }) => left};
4115
+ height: ${({
4116
+ $direction: {
4117
+ height
4118
+ }
4119
+ }) => height};
4120
+ width: ${({
4121
+ $direction: {
4122
+ width
4123
+ }
4124
+ }) => width};
4125
+ cursor: ${({
4126
+ $direction: {
4127
+ cursor
4128
+ }
4129
+ }) => cursor};
4176
4130
 
4177
- const TBody = ({
4178
- groupData,
4179
- groupHeader,
4180
- leafColumns,
4181
- groupFooter,
4182
- table,
4183
- tbodyIndex
4184
- }) => {
4185
- const neededProps = {
4186
- table,
4187
- tbodyIndex
4188
- };
4189
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("tbody", {
4190
- key: `tbody${tbodyIndex}`
4191
- }, groupData?.length > 0 && /*#__PURE__*/React__default.createElement(GroupHeader, _extends$1({
4192
- groupData: groupData,
4193
- columns: groupHeader
4194
- }, neededProps)), groupData?.map?.((record, trIndex) => {
4195
- const onRowClick = table.props.onRowClick?.bind(table);
4196
- return /*#__PURE__*/React__default.createElement("tr", {
4197
- key: trIndex,
4198
- onClick: () => {
4199
- onRowClick?.({
4200
- record,
4201
- index: trIndex,
4202
- groupIndex: tbodyIndex
4203
- });
4204
- }
4205
- }, /*#__PURE__*/React__default.createElement(Tds, _extends$1({
4206
- record: record,
4207
- trIndex: trIndex
4208
- }, neededProps, {
4209
- leafColumns: leafColumns
4210
- })));
4211
- }), groupData?.length > 0 && /*#__PURE__*/React__default.createElement(GroupFooter, _extends$1({
4212
- groupData: groupData,
4213
- columns: groupFooter
4214
- }, neededProps))));
4215
- };
4216
- const TBodies = ({
4217
- groupHeader,
4218
- leafColumns,
4219
- groupFooter,
4220
- dataSource: _dataSource,
4221
- table
4222
- }) => {
4223
- // po('--TBodies--')
4224
- const isGroupDataType = Array.isArray(_dataSource?.[0]);
4225
- const dataSource = isGroupDataType ? _dataSource : [_dataSource];
4131
+ -webkit-user-select: none;
4132
+ -khtml-user-select: none;
4133
+ -moz-user-select: none;
4134
+ -o-user-select: none;
4135
+ user-select: none;
4226
4136
 
4227
- // po('dataSource',dataSource)
4228
- return dataSource?.map((groupData, tbodyIndex, c) => {
4229
- return /*#__PURE__*/React__default.createElement(TBody, {
4230
- key: `tbody${tbodyIndex}`,
4231
- table: table
4232
- // dataSource={dataSource}
4233
- // dataGroup={groupData}
4234
- ,
4235
- groupData: groupData,
4236
- tbodyIndex: tbodyIndex,
4237
- groupHeader: groupHeader,
4238
- leafColumns: leafColumns,
4239
- groupFooter: groupFooter
4240
- });
4241
- });
4242
- };
4243
-
4244
- const StyledJRTable = styled.div`
4245
- --column-bd-color:#cccccc;
4246
- --column-b-color:#eeeeee;
4247
- --column-b-hover-color:#ffffff;
4248
-
4249
- position: relative;
4250
- background: var(--column-b-color);
4251
- border:1px solid var(--column-bd-color);
4252
-
4253
- display:flex;
4254
- flex-direction: column;
4255
- flex:1;
4256
- overflow: overlay;
4257
-
4258
-
4259
-
4260
-
4261
- &.row-highlightable{
4262
- tbody{
4263
- tr:not(.jr-group-header,.jr-group-footer):hover{
4264
- background:var(--column-b-hover-color);
4265
- cursor: pointer;
4266
- transition: background-color .8s;
4267
- td{
4268
- color:black;
4269
- transition:color .8s;
4270
- }
4271
-
4272
- }
4273
- }
4274
- }
4275
-
4276
- table{
4277
- Xheight: 100%;
4278
- min-width:100%;
4279
- width: max-content;
4280
- border-spacing: 0;
4281
-
4282
- thead{
4283
- position: sticky;
4284
- top: 0;
4285
-
4286
- th{
4287
- position: relative;
4288
- padding: 2px 6px;
4289
- background: linear-gradient(180deg, rgba(227, 227, 226, 1) 0%, rgba(255, 255, 255, 1) 25%, rgba(210, 210, 210, 1) 100%);
4290
- box-shadow: 2px 2px 2px 0 #ffffffd6 inset, -1px -1px 2px 0px #8a847dbf inset;
4291
- color: #525252;
4292
- white-space: nowrap;
4293
- }
4294
- }
4295
-
4296
- tfoot{
4297
- position: sticky;
4298
- bottom: -1px;
4299
-
4300
- Xtr:nth-child(1){
4301
- th{
4302
- Xborder-top:1px solid var(--column-bd-color);
4303
- }
4304
- }
4305
- Xth:nth-child(1){
4306
- Xborder-left:1px solid var(--column-bd-color);
4307
- }
4308
-
4309
- th{
4310
- height:32px;
4311
- padding: 4px;
4312
- background: #e4e4e4;
4313
- xbackground: linear-gradient(180deg, rgba(227, 227, 226, 1) 0%, rgba(255, 255, 255, 1) 25%, rgba(210, 210, 210, 1) 100%);
4314
- xbox-shadow: 2px 2px 2px 0 #ffffffd6 inset, -1px -1px 2px 0px #8a847dbf inset;
4315
- color: #525252;
4316
- white-space: nowrap;
4317
-
4318
- border-left:2px solid #f4f4f4;
4319
- border-top:2px solid #f4f4f4;
4320
- border-right:2px solid var(--column-bd-color);
4321
- border-bottom:2px solid var(--column-bd-color);
4322
- }
4323
- }
4324
-
4325
- tbody{
4326
- tr{
4327
- transition: background .3s linear;
4328
- background:var(--column-b-color);
4329
- a:#ededed;
4330
- th{
4331
- color:#444444;
4332
- }
4333
- td{
4334
- border-bottom: 1px solid var(--column-bd-color);
4335
- color:#2e2e2e;
4336
- padding: 4px;
4337
- }
4338
- }
4339
- tr:hover{
4340
- background:var(--column-b-hover-color);
4341
-
4342
- }
4343
-
4344
- tr.jr-group-header
4345
- ,tr.jr-group-footer{
4346
- text-align:left;
4347
- background:#dddbdb;
4348
-
4349
- th{
4350
- border-bottom: 1px solid var(--column-bd-color);
4351
- border-right: 1px solid var(--column-bd-color);
4352
- padding: 4px 8px;
4353
- }
4354
- }
4355
- }
4356
- tbody.empty-tbody{
4357
- td{
4358
- border:10px solid red;
4359
- }
4360
- }
4361
- }
4362
-
4363
-
4364
-
4365
-
4366
- > .empty{
4367
- user-select: none;
4368
- color:#848484;
4369
- height:100%;
4370
- flex:1;
4371
- display:flex;
4372
- justify-content: center;
4373
- align-items: center;
4374
-
4375
-
4376
- }
4377
-
4378
- > .empty::after{
4379
- content:'無資料';
4380
- position: block;
4137
+ `;
4138
+ class Slider$1 extends React__default.Component {
4139
+ width = '3px';
4140
+ borderWidth = 'px';
4141
+ borderLong = 5;
4142
+ constructor(props) {
4143
+ super(props);
4144
+ this.sliderRef = /*#__PURE__*/React__default.createRef();
4145
+ }
4146
+ directions = {
4147
+ n: {
4148
+ top: 0,
4149
+ color: 'red',
4150
+ width: '100%',
4151
+ height: `${this.props.thick}px`,
4152
+ cursor: 'n-resize',
4153
+ resize: props => {
4154
+ this.resizeN(props);
4155
+ }
4156
+ },
4157
+ e: {
4158
+ color: 'yellow',
4159
+ right: 0,
4160
+ width: `${this.props.thick}px`,
4161
+ height: '100%',
4162
+ cursor: 'e-resize',
4163
+ resize: props => {
4164
+ this.resizeE(props);
4165
+ }
4166
+ },
4167
+ s: {
4168
+ color: 'blue',
4169
+ bottom: 0,
4170
+ width: '100%',
4171
+ height: `${this.props.thick}px`,
4172
+ cursor: 's-resize',
4173
+ resize: props => {
4174
+ this.resizeS(props);
4175
+ }
4176
+ },
4177
+ w: {
4178
+ color: 'green',
4179
+ left: 0,
4180
+ width: `${this.props.thick}px`,
4181
+ height: '100%',
4182
+ cursor: 'w-resize',
4183
+ resize: props => {
4184
+ this.resizeW(props);
4185
+ }
4186
+ },
4187
+ nw: {
4188
+ top: 0,
4189
+ left: 0,
4190
+ color: 'blue',
4191
+ width: `${this.borderLong}px`,
4192
+ height: `${this.borderLong}px`,
4193
+ cursor: 'nw-resize',
4194
+ resize: props => {
4195
+ this.resizeN(props);
4196
+ this.resizeW(props);
4197
+ }
4198
+ },
4199
+ nww: {
4200
+ top: 0,
4201
+ left: 0,
4202
+ color: 'blue',
4203
+ width: `${this.props.thick + this.borderLong}px`,
4204
+ height: `${this.props.thick}px`,
4205
+ cursor: 'nw-resize',
4206
+ resize: props => {
4207
+ this.resizeN(props);
4208
+ this.resizeW(props);
4209
+ }
4210
+ },
4211
+ nnw: {
4212
+ top: 0,
4213
+ left: 0,
4214
+ color: 'blue',
4215
+ width: `${this.props.thick}px`,
4216
+ height: `${this.props.thick + this.borderLong}px`,
4217
+ cursor: 'nw-resize',
4218
+ resize: props => {
4219
+ this.resizeN(props);
4220
+ this.resizeW(props);
4221
+ }
4222
+ },
4223
+ nne: {
4224
+ top: 0,
4225
+ right: 0,
4226
+ color: 'green',
4227
+ width: `${this.props.thick + this.borderLong}px`,
4228
+ height: `${this.props.thick}px`,
4229
+ cursor: 'ne-resize',
4230
+ resize: props => {
4231
+ this.resizeN(props);
4232
+ this.resizeE(props);
4233
+ }
4234
+ },
4235
+ nee: {
4236
+ top: 0,
4237
+ right: 0,
4238
+ color: 'green',
4239
+ width: `${this.props.thick}px`,
4240
+ height: `${this.props.thick + this.borderLong}px`,
4241
+ cursor: 'ne-resize',
4242
+ resize: props => {
4243
+ this.resizeN(props);
4244
+ this.resizeE(props);
4245
+ }
4246
+ },
4247
+ sse: {
4248
+ color: 'red',
4249
+ right: 0,
4250
+ bottom: 0,
4251
+ width: `${this.props.thick + this.borderLong}px`,
4252
+ height: `${this.props.thick}px`,
4253
+ cursor: 'se-resize',
4254
+ resize: props => {
4255
+ this.resizeS(props);
4256
+ this.resizeE(props);
4257
+ }
4258
+ },
4259
+ see: {
4260
+ color: 'red',
4261
+ right: 0,
4262
+ bottom: 0,
4263
+ width: `${this.props.thick}px`,
4264
+ height: `${this.props.thick + this.borderLong}px`,
4265
+ cursor: 'se-resize',
4266
+ resize: props => {
4267
+ this.resizeS(props);
4268
+ this.resizeE(props);
4269
+ }
4270
+ },
4271
+ ssw: {
4272
+ color: 'yellow',
4273
+ bottom: 0,
4274
+ left: 0,
4275
+ width: `${this.props.thick + this.borderLong}px`,
4276
+ height: `${this.props.thick}px`,
4277
+ cursor: 'sw-resize',
4278
+ resize: props => {
4279
+ this.resizeS(props);
4280
+ this.resizeW(props);
4281
+ }
4282
+ },
4283
+ sww: {
4284
+ color: 'yellow',
4285
+ bottom: 0,
4286
+ left: 0,
4287
+ width: `${this.props.thick}px`,
4288
+ height: `${this.props.thick + this.borderLong}px`,
4289
+ cursor: 'sw-resize',
4290
+ resize: props => {
4291
+ this.resizeS(props);
4292
+ this.resizeW(props);
4293
+ }
4381
4294
  }
4382
-
4383
- `;
4384
-
4385
- var _path;
4386
- function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
4387
- var SvgX = function SvgX(props) {
4388
- return /*#__PURE__*/React.createElement("svg", _extends({
4389
- xmlns: "http://www.w3.org/2000/svg",
4390
- width: 24,
4391
- height: 24,
4392
- fill: "none",
4393
- stroke: "currentColor",
4394
- strokeLinecap: "round",
4395
- strokeLinejoin: "round",
4396
- strokeWidth: 2,
4397
- viewBox: "0 0 24 24"
4398
- }, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
4399
- d: "M18 6 6 18M6 6l12 12"
4400
- })));
4401
- };
4402
-
4403
- function JRButton({
4404
- icon,
4405
- children,
4406
- ...props
4407
- }) {
4408
- return /*#__PURE__*/React__default.createElement("button", props, icon, children);
4409
- }
4410
-
4411
- const StyledTitle = styled.div`
4412
- overflow: hidden;
4413
- display: flex;
4414
- border-radius: var(--jr-window-radius) var(--jr-window-radius) 0 0;
4415
- background:#464646;
4416
- color: white;
4417
- display: flex;
4418
- align-items: center;
4419
- min-height: min-content;
4420
- XX&:active{
4421
- cursor: grabbing;
4295
+ };
4296
+ resizeN = ({
4297
+ window,
4298
+ cursorY,
4299
+ startY,
4300
+ startHeight,
4301
+ titleBarHeight
4302
+ }) => {
4303
+ let y = cursorY - this.props.thick;
4304
+ if (y < 0) y = 0;
4305
+ let height = startHeight + (startY - y);
4306
+ if (height < titleBarHeight + this.props.thick * 2) {
4307
+ height = titleBarHeight + this.props.thick * 2;
4308
+ y = startY + startHeight - titleBarHeight - this.props.thick * 2;
4422
4309
  }
4423
-
4424
- -webkit-user-select: none;
4425
- -khtml-user-select: none;
4426
- -moz-user-select: none;
4427
- -o-user-select: none;
4428
- user-select: none;
4429
-
4430
- > .title{
4431
-
4432
- flex: 1;
4433
- padding:2px 0 2px 8px;
4434
- text-overflow: ellipsis;
4435
- overflow: hidden;
4436
- white-space: nowrap;
4310
+ window.style.top = `${y}px`;
4311
+ window.style.height = `${height}px`;
4312
+ };
4313
+ resizeE = ({
4314
+ window,
4315
+ clientX,
4316
+ left,
4317
+ titleBarHeight
4318
+ }) => {
4319
+ let width = clientX - left - this.props.thick;
4320
+ if (width < titleBarHeight) width = titleBarHeight;
4321
+ window.style.width = `${width + this.props.thick * 2}px`;
4322
+ };
4323
+ resizeS = ({
4324
+ window,
4325
+ clientY,
4326
+ top,
4327
+ titleBarHeight
4328
+ }) => {
4329
+ let height = clientY - top - this.props.thick;
4330
+ if (height < titleBarHeight) height = titleBarHeight;
4331
+ window.style.height = `${height + this.props.thick * 2}px`;
4332
+ };
4333
+ resizeW = ({
4334
+ window,
4335
+ cursorX,
4336
+ startX,
4337
+ startWidth,
4338
+ titleBarHeight
4339
+ }) => {
4340
+ let x = cursorX - this.props.thick;
4341
+ if (x < 0) x = 0;
4342
+ let width = startWidth + (startX - x);
4343
+ if (width < titleBarHeight + this.props.thick * 2) {
4344
+ width = titleBarHeight + this.props.thick * 2;
4345
+ x = startX + startWidth - titleBarHeight - this.props.thick * 2;
4437
4346
  }
4438
- > nav{
4439
- display: flex;
4440
- align-items: anchor-center;
4441
-
4442
-
4443
- >button{
4444
- outline: unset;
4445
- display:flex;
4446
- align-items: center;
4447
- justify-content: center;
4448
- border: unset;
4449
- background: unset;
4450
- cursor: pointer;
4451
- width:32px;
4452
- height:32px;
4453
- xborder:1px solid green;
4454
- padding: 0;
4455
- margin: 0;
4456
- &:hover{
4457
- background: #bbbbbb;
4458
- color:white;
4459
- }
4460
- >svg{
4461
- color:#bababa;
4462
- width:14px;
4463
- height:14px;
4464
- cursor: pointer;
4465
- stroke-width: 3;
4466
- }
4467
- }
4468
- >button.danger:hover{
4469
- background: red;
4470
- >svg{
4471
- color:white;
4472
- }
4473
- }
4347
+ window.style.left = `${x}px`;
4348
+ window.style.width = `${width}px`;
4349
+ };
4350
+ stop = e => {
4351
+ e.preventDefault();
4352
+ const {
4353
+ height: titleBarHeight
4354
+ } = this.props.titleBarRef.current.getBoundingClientRect();
4355
+ const {
4356
+ x,
4357
+ y,
4358
+ width,
4359
+ height
4360
+ } = this.props.windowRef.current.getBoundingClientRect();
4361
+ this.props.windowRef.current.style.transition = 'var(--transition-x-y)';
4362
+ if (y == 0 && this.data.direction.indexOf('n') > -1) {
4363
+ this.props.window.orgHeight = height;
4364
+ this.props.windowRef.current.style.height = `${window.innerHeight}px`;
4474
4365
  }
4475
- `;
4476
- class TitleBar extends React__default.Component {
4477
- pos1 = 0;
4478
- pos2 = 0;
4479
- pos3 = 0;
4480
- pos4 = 0;
4481
- x = 0;
4482
- y = 0;
4483
- remember = e => {
4484
- po('remember');
4366
+ if (y > window.innerHeight) this.props.windowRef.current.style.top = `${window.innerHeight - titleBarHeight}px`;
4367
+ if (x + width - this.props.thick < 0) this.props.windowRef.current.style.left = 0;
4368
+ if (x > window.innerWidth) this.props.windowRef.current.style.left = `${window.innerWidth - width}px`;
4369
+ document.body.style.cursor = 'default';
4370
+ window.removeEventListener('mousemove', this.move);
4371
+ window.removeEventListener('mousemove', this.preMove);
4372
+ window.removeEventListener('mouseup', this.stop);
4373
+ };
4374
+ move = e => {
4375
+ e.preventDefault();
4376
+ this.props.windowRef.current.style.transition = 'unset';
4485
4377
  const {
4486
4378
  clientX,
4487
- clientY
4379
+ clientY,
4380
+ x: cursorX,
4381
+ y: cursorY
4488
4382
  } = e;
4383
+ const window = this.props.windowRef.current;
4384
+ const {
4385
+ left,
4386
+ top
4387
+ } = window.getBoundingClientRect();
4388
+ let {
4389
+ x: startX,
4390
+ width: startWidth,
4391
+ y: startY,
4392
+ height: startHeight,
4393
+ titleBarHeight
4394
+ } = this.data;
4395
+ this.directions[this.props.direction].resize({
4396
+ window,
4397
+ titleBarHeight,
4398
+ clientX,
4399
+ cursorX,
4400
+ startX,
4401
+ startWidth,
4402
+ left,
4403
+ clientY,
4404
+ cursorY,
4405
+ startY,
4406
+ startHeight,
4407
+ top
4408
+ });
4409
+ };
4410
+ preMove = () => {
4411
+ if (this.props.direction.indexOf('n') > -1) {
4412
+ this.props.windowRef.current.style.height = `${this.props.window.orgHeight}px`;
4413
+ this.data.height = this.props.window.orgHeight;
4414
+ this.props.window.orgHeight = null;
4415
+ }
4416
+ window.removeEventListener('mousemove', this.preMove);
4417
+ setTimeout(() => {
4418
+ window.addEventListener('mousemove', this.move);
4419
+ }, 100);
4420
+ };
4421
+ start = (e, direction) => {
4422
+ e.preventDefault();
4489
4423
  const {
4424
+ height: titleBarHeight
4425
+ } = this.props.titleBarRef.current.getBoundingClientRect();
4426
+ let {
4490
4427
  x,
4491
4428
  y,
4492
4429
  width,
4493
4430
  height
4494
4431
  } = this.props.windowRef.current.getBoundingClientRect();
4495
- this.props.window.orgHeight = height;
4496
- this.props.window.orgWidth = width;
4497
- this.props.window.orgTop = y;
4498
- this.props.window.orgLeft = x;
4499
- this.props.window.orgXd = clientX - x;
4500
- this.props.window.orgBodyOverflow = document.body.style.overflow;
4501
- };
4502
- adjustScreen = e => {
4503
- po('double click adjustScreen');
4504
- e.preventDefault();
4505
- const {
4432
+ if (this.props.direction.indexOf('s') > -1) {
4433
+ this.props.window.orgHeight = null;
4434
+ }
4435
+ this.data = {
4506
4436
  x,
4507
4437
  y,
4508
4438
  width,
4509
- height
4510
- } = this.props.windowRef.current.getBoundingClientRect();
4511
- if (y > 1 - this.props.thick) {
4512
- this.remember(e);
4513
- this.fullScreen(e);
4439
+ height,
4440
+ titleBarHeight,
4441
+ direction
4442
+ };
4443
+ document.body.style.cursor = this.directions[this.props.direction].cursor;
4444
+ if (this.props.window.orgHeight) {
4445
+ window.addEventListener('mousemove', this.preMove);
4514
4446
  } else {
4515
- this.floatScreen(e);
4447
+ window.addEventListener('mousemove', this.move);
4516
4448
  }
4449
+ window.addEventListener('mouseup', this.stop);
4517
4450
  };
4518
- floatScreen = e => {
4519
- po('floatScreen');
4520
- this.props.windowRef.current;
4521
- this.props.windowRef.current.style.transition = 'var(--transition-x-y), left .05s ease-in';
4522
- this.props.windowRef.current.style.left = `${this.props.window.orgLeft}px`;
4523
- this.props.windowRef.current.style.top = `${this.props.window.orgTop}px`;
4524
- this.props.windowRef.current.style.width = `${this.props.window.orgWidth}px`;
4525
- this.props.windowRef.current.style.height = `${this.props.window.orgHeight}px`;
4526
- document.body.style.overflow = this.props.window.orgBodyOverflow;
4527
- };
4528
- fullScreen = e => {
4529
- po('fullScreen', this.props.thick);
4530
- this.props.windowRef.current.style.transition = 'var(--transition-x-y), left .05s ease-in';
4531
- this.props.windowRef.current.style.left = `${-this.props.thick}px`;
4532
- this.props.windowRef.current.style.top = `${-this.props.thick}px`;
4533
- this.props.windowRef.current.style.width = `calc(100vw + ${this.props.thick * 2}px)`; //`${window.innerWidth+(this.props.thick*2)}px`
4534
- this.props.windowRef.current.style.height = `calc(100vh + ${this.props.thick * 2}px)`; //`${window.innerHeight+(this.props.thick*2)}px`
4451
+ render() {
4452
+ return /*#__PURE__*/React__default.createElement(StyledSlider$1, {
4453
+ $direction: this.directions[this.props.direction],
4454
+ $padding: this.props.padding,
4455
+ onMouseDown: e => {
4456
+ this.start(e, this.props.direction);
4457
+ }
4458
+ });
4459
+ }
4460
+ }
4535
4461
 
4536
- setTimeout(() => {
4537
- document.body.style.overflow = 'hidden';
4538
- this.props.windowRef.current.style.transition = 'unset';
4539
- }, 50);
4462
+ function styleInject(css, ref) {
4463
+ if ( ref === void 0 ) ref = {};
4464
+ var insertAt = ref.insertAt;
4465
+
4466
+ if (!css || typeof document === 'undefined') { return; }
4467
+
4468
+ var head = document.head || document.getElementsByTagName('head')[0];
4469
+ var style = document.createElement('style');
4470
+ style.type = 'text/css';
4471
+
4472
+ if (insertAt === 'top') {
4473
+ if (head.firstChild) {
4474
+ head.insertBefore(style, head.firstChild);
4475
+ } else {
4476
+ head.appendChild(style);
4477
+ }
4478
+ } else {
4479
+ head.appendChild(style);
4480
+ }
4481
+
4482
+ if (style.styleSheet) {
4483
+ style.styleSheet.cssText = css;
4484
+ } else {
4485
+ style.appendChild(document.createTextNode(css));
4486
+ }
4487
+ }
4488
+
4489
+ 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}";
4490
+ var style = {"test":"Style-module_test__LrdEc","withMask":"Style-module_withMask__LPcai"};
4491
+ styleInject(css_248z);
4492
+
4493
+ const StyledJRWindow = styled.div`
4494
+ --jr-window-radius:3px;
4495
+ --padding-child:8px;
4496
+ --transition-x-y:height .05s ease-in, width .05s ease-in;
4497
+ xborder:1px solid gray;
4498
+ position: fixed;
4499
+ padding: ${({
4500
+ $thick
4501
+ }) => $thick}px;
4502
+ border-radius: var(--jr-window-radius);
4503
+ user-select: text;
4504
+
4505
+ top: ${({
4506
+ $y
4507
+ }) => $y}px;
4508
+ left: ${({
4509
+ $x
4510
+ }) => $x}px;
4511
+ width: ${({
4512
+ $width = 300
4513
+ }) => `${$width}px`};
4514
+ height: ${({
4515
+ $height = 300
4516
+ }) => `${$height}px`};
4517
+ overflow: hidden;
4518
+ z-index: 2;
4519
+
4520
+ display: flex;
4521
+ flex-direction: column;
4522
+ overflow: hidden;
4523
+
4524
+ > main{
4525
+ border-radius: var(--jr-window-radius);
4526
+ box-shadow: 0px 0px 5px 1px gray;
4527
+ display: flex;
4528
+ flex-direction: column;
4529
+ overflow: hidden;
4530
+ flex:1;
4531
+ > main {
4532
+ Xpadding:var(--padding-child);
4533
+ overflow: overlay;
4534
+ flex:1;
4535
+ display: flex;
4536
+ min-height:32px;
4537
+ }
4538
+ }
4539
+
4540
+ `;
4541
+ class JRWindow extends JRFrame {
4542
+ x = 0;
4543
+ y = 0;
4544
+ width = 300;
4545
+ height = 300;
4546
+ padding = 1;
4547
+ thick = 5;
4548
+ constructor(props) {
4549
+ super(props);
4550
+ this.ref = /*#__PURE__*/React__default.createRef();
4551
+ this.titleBarRef = /*#__PURE__*/React__default.createRef();
4552
+ this.init();
4553
+ }
4554
+ addMaskToTarget = target => {
4555
+ this.mask = document.createElement('div');
4556
+ this.mask.style.background = '#868686cc';
4557
+ this.mask.style.position = 'absolute';
4558
+ this.mask.style.top = '0';
4559
+ this.mask.style.left = '0';
4560
+ this.mask.style.right = '0';
4561
+ this.mask.style.bottom = '0';
4562
+ this.mask.style.borderRadius = 'inherit';
4563
+ this.mask.style.height = '10000px';
4564
+ this.mask.style.width = '10000px';
4565
+ target.appendChild(this.mask);
4566
+ po('style.mask', style.mask);
4567
+ po('addMask+++++++++++++++++++++++++++');
4540
4568
  };
4541
- stop = e => {
4542
- po('stop');
4543
- e.preventDefault();
4544
- if (this.moved) {
4545
- const {
4546
- height: titleBarHeight
4547
- } = this.props.titleBarRef.current.getBoundingClientRect();
4548
- const {
4549
- x,
4550
- y,
4551
- width,
4552
- height
4553
- } = this.props.windowRef.current.getBoundingClientRect();
4554
- if (y < 1 - this.props.thick) this.fullScreen(e);
4555
- if (y > window.innerHeight - titleBarHeight) this.props.windowRef.current.style.top = `${window.innerHeight - titleBarHeight}px`;
4556
- if (x + width - this.props.thick < 0) this.props.windowRef.current.style.left = 0;
4557
- if (x > window.innerWidth) this.props.windowRef.current.style.left = `${window.innerWidth - width}px`;
4569
+ removeMaskFromTarget = () => {
4570
+ po('removeMask-----------------------');
4571
+ this.mask.remove();
4572
+ };
4573
+ maskOnTarget(on) {
4574
+ po('typeof this.props.maskOn', typeof this.props.maskOn);
4575
+ const target = typeof this.props.maskOn === 'object' ? this.props.maskOn : typeof this.props.maskOn === 'string' ? document.getElementById(this.props.maskOn) : document.body;
4576
+
4577
+ // this[on?'addMaskToTarget':'removeMaskFromTarget'](target)
4578
+ target?.classList[on ? 'add' : 'remove']('withMask');
4579
+ }
4580
+ componentDidMount() {
4581
+ super.componentDidMount();
4582
+ if (this.props.maskOn && this.props.open) {
4583
+ this.maskOnTarget(this.props.open);
4584
+ }
4585
+ if (this.props.open) {
4586
+ this.open();
4587
+ }
4588
+ }
4589
+ open() {
4590
+ this.props.onOpen?.bind(this)();
4591
+ }
4592
+ close() {
4593
+ this.props.onClose?.bind(this)();
4594
+ }
4595
+ componentDidUpdate(prevProps, prevState, snapshot) {
4596
+ if (this.props.popup === true) {
4597
+ if (this.props.open && prevProps.open === false) {
4598
+ this.open();
4599
+ } else if (this.props.open === false && prevProps.open) {
4600
+ this.close();
4601
+ }
4602
+ if (this.props.maskOn && this.props.open != prevProps.open) {
4603
+ this.maskOnTarget(this.props.open);
4604
+ }
4605
+ }
4606
+ }
4607
+ init() {
4608
+ this.height = window.innerHeight >= (this.props.height ?? this.height) ? this.props.height ?? this.height : window.innerHeight;
4609
+ this.width = window.innerWidth >= (this.props.width ?? this.width) ? this.props.width ?? this.width : window.innerWidth;
4610
+ this.x = this.props.x ?? (window.innerWidth - (this.width ?? 300)) / 2;
4611
+ this.y = this.props.y ?? (window.innerHeight - (this.height ?? 300)) / 2;
4612
+ }
4613
+ renderer() {
4614
+ return this.props.popup === true ? this.props.open ? /*#__PURE__*/React__default.createElement(StyledJRWindow, {
4615
+ ref: this.ref,
4616
+ className: `jr-window ${this.props.className ?? ''}`,
4617
+ $x: this.x,
4618
+ $y: this.y,
4619
+ $width: this.width,
4620
+ $height: this.height,
4621
+ $thick: this.thick
4622
+ }, /*#__PURE__*/React__default.createElement("main", null, /*#__PURE__*/React__default.createElement(TitleBar, {
4623
+ titleBarRef: this.titleBarRef,
4624
+ windowRef: this.ref,
4625
+ window: this,
4626
+ title: this.props.title,
4627
+ thick: this.thick
4628
+ }), /*#__PURE__*/React__default.createElement("main", null, super.renderer())), /*#__PURE__*/React__default.createElement(Sliders, {
4629
+ thick: this.thick,
4630
+ windowRef: this.ref,
4631
+ window: this,
4632
+ titleBarRef: this.titleBarRef
4633
+ })) : '' : super.renderer();
4634
+ }
4635
+ }
4636
+
4637
+ const StyledSlider = styled.div`
4638
+ position: absolute;
4639
+ top: 0;
4640
+ right: 0;
4641
+ height:100%;
4642
+ width:6px;
4643
+ user-select: none;
4644
+ &.resizing:hover,&.resizing{
4645
+ border-right:1px dashed black;
4646
+ }
4647
+ &:hover{
4648
+ cursor: col-resize;
4649
+ border-right:1px dashed gray;
4558
4650
  }
4651
+ `;
4652
+ class Slider extends React__default.Component {
4653
+ constructor() {
4654
+ super();
4655
+ this.sliderRef = /*#__PURE__*/React__default.createRef();
4656
+ }
4657
+ stop = e => {
4658
+ this.sliderRef.current.classList.remove('resizing');
4559
4659
  document.body.style.cursor = 'default';
4560
4660
  window.removeEventListener('mousemove', this.move);
4561
4661
  window.removeEventListener('mouseup', this.stop);
4562
- window.removeEventListener('mousemove', this.preMove);
4563
- };
4564
- move = e => {
4565
- po('move');
4566
- e.preventDefault();
4567
- this.moved = true;
4568
- const {
4569
- clientX,
4570
- clientY
4571
- } = e;
4572
- const y = clientY < 1 ? 0 : clientY;
4573
- this.pos1 = this.pos3 - clientX;
4574
- this.pos2 = this.pos4 - y;
4575
- this.pos3 = clientX;
4576
- this.pos4 = y;
4577
- const w = this.props.windowRef.current;
4578
- this.y = w.offsetTop - this.pos2;
4579
- this.x = w.offsetLeft - this.pos1;
4580
-
4581
- // if(this.props.window.orgWidth){
4582
- // w.style.width=`${this.props.window.orgWidth}px`
4583
- // this.props.window.orgWidth=null
4584
- // }
4585
-
4586
- this.y = this.y < -this.props.thick ? -this.props.thick : this.y;
4587
- w.style.transition = 'unset';
4588
- w.style.top = `${this.y}px`;
4589
- w.style.left = `${this.x}px`;
4590
4662
  };
4591
- preMove = e => {
4592
- console.clear();
4593
- po('preMove');
4594
- const w = this.props.windowRef.current;
4663
+ move = ({
4664
+ clientX
4665
+ }) => {
4595
4666
  const {
4596
- clientX,
4597
- clientY,
4598
- ...oe
4599
- } = e;
4600
- po('e', e);
4667
+ th,
4668
+ selectedCols,
4669
+ widthRates
4670
+ } = this.data;
4601
4671
  const {
4602
- x,
4603
- y,
4604
- width,
4605
- height
4606
- } = w.getBoundingClientRect();
4607
- po('width', width);
4608
- if (y <= -this.props.thick) ;
4609
- w.style.transition = 'left .05s ease-in, height .05s ease-in';
4610
- if (y <= 0) {
4611
- // contt browserWidth=
4612
- const w1 = window.innerWidth - this.props.thick * 2;
4613
- const x1 = clientX;
4614
- const w2 = this.props.window.orgWidth - 32;
4615
- const x2 = x1 / w1 * w2;
4616
- // po('xp' , x2)
4617
- w.style.left = `${clientX - x2}px`;
4618
- w.style.width = `${this.props.window.orgWidth}px`;
4619
- w.style.height = `${this.props.window.orgHeight}px`;
4620
- } else {
4621
- this.remember(e);
4622
- }
4623
- document.body.style.cursor = 'grabbing';
4624
- document.body.style.overflow = this.props.window.orgBodyOverflow;
4625
- setTimeout(() => {
4626
- window.addEventListener('mousemove', this.move);
4627
- }, 50);
4628
- window.removeEventListener('mousemove', this.preMove);
4672
+ left
4673
+ } = th.getBoundingClientRect();
4674
+ const min = left + 10;
4675
+ const x = clientX >= min ? clientX : min;
4676
+ const width = x - left;
4677
+ selectedCols.forEach((col, index) => {
4678
+ const _width = Math.round(width / 100 * widthRates[index]);
4679
+ col.style.width = _width + 'px';
4680
+ });
4629
4681
  };
4630
- start(e) {
4631
- po('start');
4632
- e.preventDefault();
4633
- this.moved = false;
4634
- this.pos3 = e.clientX;
4635
- this.pos4 = e.clientY;
4636
- this.props.windowRef.current.style.transition = 'var(--transition-x-y)';
4637
- window.addEventListener('mousemove', this.preMove);
4682
+ start(thPRef, column) {
4683
+ const selectedCols = [...this.props.table.colGroupRef.current.children].slice(column.columnNo, column.columnNo + (column.colSpan ?? 1));
4684
+ const totalWidth = selectedCols.reduce((aco, {
4685
+ offsetWidth
4686
+ }) => aco + offsetWidth, 0);
4687
+ const widthRates = selectedCols.map(({
4688
+ offsetWidth
4689
+ }) => {
4690
+ return 100 * (offsetWidth / totalWidth);
4691
+ });
4692
+ this.data = {
4693
+ selectedCols,
4694
+ th: thPRef.current,
4695
+ widthRates
4696
+ };
4697
+ this.sliderRef.current.classList.add('resizing');
4698
+ document.body.style.cursor = 'col-resize';
4699
+ window.addEventListener('mousemove', this.move);
4638
4700
  window.addEventListener('mouseup', this.stop);
4639
4701
  }
4640
- onDoubleClick() {
4641
- po('onDoubleClick');
4642
- }
4643
4702
  render() {
4644
- return /*#__PURE__*/React__default.createElement(StyledTitle, {
4645
- ref: this.props.titleBarRef,
4646
- draggable: "false",
4647
- onMouseDown: e => {
4648
- this.start(e);
4649
- },
4650
- onDoubleClick: this.adjustScreen
4651
- }, /*#__PURE__*/React__default.createElement(FreeType$1, {
4652
- tag: "div",
4653
- config: this.props.title ?? '',
4654
- me: this.props.window,
4655
- className: 'title'
4656
- }), /*#__PURE__*/React__default.createElement("nav", null, this.props.window.props.setOpen ? /*#__PURE__*/React__default.createElement(JRButton, {
4657
- icon: /*#__PURE__*/React__default.createElement(SvgX, null),
4658
- className: 'danger',
4659
- onClick: e => {
4660
- e.stopPropagation();
4661
- if (this.props.window.orgBodyOverflow != null) {
4662
- document.body.style.overflow = this.props.window.orgBodyOverflow;
4663
- }
4664
- this.props.window.props.setOpen(false);
4665
- },
4703
+ const column = this.props.column;
4704
+ return /*#__PURE__*/React__default.createElement(StyledSlider, {
4705
+ ref: this.sliderRef,
4666
4706
  onMouseDown: e => {
4667
- e.stopPropagation();
4707
+ this.start(this.props.thRef, column);
4668
4708
  }
4669
- }) : null));
4709
+ });
4670
4710
  }
4671
4711
  }
4672
4712
 
4673
- const directions = ['n', 'e', 's', 'w', 'nww', 'nnw', 'nne', 'nee', 'sse', 'see', 'sww', 'ssw'];
4674
- class Sliders extends React__default.Component {
4675
- render() {
4676
- return directions.map((direction, index) => /*#__PURE__*/React__default.createElement(Slider, {
4677
- direction: direction,
4678
- thick: this.props.thick,
4679
- windowRef: this.props.windowRef,
4680
- window: this.props.window,
4681
- titleBarRef: this.props.titleBarRef,
4713
+ const Colgroup = ({
4714
+ leafColumns,
4715
+ colGroupRef
4716
+ }) => {
4717
+ return /*#__PURE__*/React__default.createElement("colgroup", {
4718
+ ref: colGroupRef
4719
+ }, leafColumns?.map((_column, index) => {
4720
+ const {
4721
+ width,
4722
+ ...column
4723
+ } = _column;
4724
+ const style = {
4725
+ width
4726
+ };
4727
+ return /*#__PURE__*/React__default.createElement("col", {
4728
+ style: style,
4682
4729
  key: index
4730
+ });
4731
+ }));
4732
+ };
4733
+ const Ths$1 = ({
4734
+ deep,
4735
+ rowColumn,
4736
+ rowIndex,
4737
+ table
4738
+ }) => {
4739
+ return rowColumn?.map((column, colIndex) => {
4740
+ const thRef = /*#__PURE__*/React__default.createRef();
4741
+ return /*#__PURE__*/React__default.createElement("th", {
4742
+ key: colIndex,
4743
+ ref: thRef,
4744
+ colSpan: column.colSpan,
4745
+ rowSpan: column.rowSpan ?? (column.isLeaf && deep > rowIndex ? deep - rowIndex + 1 : null)
4746
+ }, flexType(column.label, table), (table.props.resizableColumns === undefined || table.props.resizableColumns) && /*#__PURE__*/React__default.createElement(Slider, {
4747
+ table: table,
4748
+ thRef: thRef,
4749
+ column: column
4750
+ }));
4751
+ });
4752
+ };
4753
+ const HeadTrs = ({
4754
+ columns: _columns,
4755
+ trClassName,
4756
+ table
4757
+ }) => {
4758
+ const columns = Array.isArray(_columns?.[0]) ? _columns : [_columns];
4759
+ return columns?.map((rowColumn, rowIndex) => {
4760
+ return /*#__PURE__*/React__default.createElement("tr", {
4761
+ className: trClassName,
4762
+ key: rowIndex
4763
+ }, /*#__PURE__*/React__default.createElement(Ths$1, {
4764
+ deep: columns.length - 1,
4765
+ rowColumn: rowColumn,
4766
+ rowIndex: rowIndex,
4767
+ table: table
4768
+ }));
4769
+ });
4770
+ };
4771
+ const THead = ({
4772
+ columns,
4773
+ leafColumns,
4774
+ table
4775
+ }) => {
4776
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("thead", null, /*#__PURE__*/React__default.createElement(HeadTrs, {
4777
+ columns: columns,
4778
+ table: table
4779
+ })), /*#__PURE__*/React__default.createElement(Colgroup, {
4780
+ leafColumns: leafColumns,
4781
+ colGroupRef: table.colGroupRef
4782
+ }));
4783
+ };
4784
+ const FootThs = ({
4785
+ table,
4786
+ groupData,
4787
+ groupIndex,
4788
+ deep,
4789
+ columns,
4790
+ rowIndex
4791
+ }) => {
4792
+ return columns?.map((column, colIndex) => {
4793
+ // let content
4794
+ // if(type){
4795
+ // content='type'
4796
+ // }else if(render){
4797
+
4798
+ // content=render?.bind(table)({groupData,groupIndex,ths:111})
4799
+ // }else{
4800
+ // content=column.label
4801
+ // }
4802
+ let style = flexType(column.style, table, {}, {});
4803
+ const content = whatType(column, table, column.label);
4804
+ return /*#__PURE__*/React__default.createElement("th", {
4805
+ style: style,
4806
+ colSpan: column.colSpan,
4807
+ rowSpan: column.rowSpan
4808
+ }, content);
4809
+ });
4810
+ };
4811
+ const TFoot = ({
4812
+ table,
4813
+ columns
4814
+ }) => {
4815
+ const trs = columns?.map((rowColumn, rowIndex) => {
4816
+ return /*#__PURE__*/React__default.createElement("tr", {
4817
+ key: rowIndex
4818
+ }, /*#__PURE__*/React__default.createElement(FootThs, {
4819
+ columns: rowColumn,
4820
+ table: table
4683
4821
  }));
4684
- }
4685
- }
4686
- const StyledSlider = styled.div`
4687
- Xborder:1px solid ${({
4688
- $direction: {
4689
- color
4690
- }
4691
- }) => color};
4692
- Xbackground:${({
4693
- $direction: {
4694
- color
4695
- }
4696
- }) => color};
4697
- position: absolute;
4698
- top: ${({
4699
- $direction: {
4700
- top
4701
- }
4702
- }) => top};
4703
- bottom: ${({
4704
- $direction: {
4705
- bottom
4706
- }
4707
- }) => bottom};
4708
- right: ${({
4709
- $direction: {
4710
- right
4711
- }
4712
- }) => right};
4713
- left: ${({
4714
- $direction: {
4715
- left
4716
- }
4717
- }) => left};
4718
- height: ${({
4719
- $direction: {
4720
- height
4721
- }
4722
- }) => height};
4723
- width: ${({
4724
- $direction: {
4725
- width
4726
- }
4727
- }) => width};
4728
- cursor: ${({
4729
- $direction: {
4730
- cursor
4731
- }
4732
- }) => cursor};
4822
+ });
4823
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("tfoot", null, trs));
4824
+ };
4733
4825
 
4734
- -webkit-user-select: none;
4735
- -khtml-user-select: none;
4736
- -moz-user-select: none;
4737
- -o-user-select: none;
4738
- user-select: none;
4826
+ function _extends() {
4827
+ return _extends = Object.assign ? Object.assign.bind() : function (n) {
4828
+ for (var e = 1; e < arguments.length; e++) {
4829
+ var t = arguments[e];
4830
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
4831
+ }
4832
+ return n;
4833
+ }, _extends.apply(null, arguments);
4834
+ }
4739
4835
 
4836
+ styled.tbody`
4837
+ th{
4838
+ height:4px;
4839
+ background:#c6c6c6;
4840
+ }
4740
4841
  `;
4741
- class Slider extends React__default.Component {
4742
- width = '3px';
4743
- borderWidth = 'px';
4744
- borderLong = 5;
4745
- constructor(props) {
4746
- super(props);
4747
- this.sliderRef = /*#__PURE__*/React__default.createRef();
4748
- }
4749
- directions = {
4750
- n: {
4751
- top: 0,
4752
- color: 'red',
4753
- width: '100%',
4754
- height: `${this.props.thick}px`,
4755
- cursor: 'n-resize',
4756
- resize: props => {
4757
- this.resizeN(props);
4758
- }
4759
- },
4760
- e: {
4761
- color: 'yellow',
4762
- right: 0,
4763
- width: `${this.props.thick}px`,
4764
- height: '100%',
4765
- cursor: 'e-resize',
4766
- resize: props => {
4767
- this.resizeE(props);
4768
- }
4769
- },
4770
- s: {
4771
- color: 'blue',
4772
- bottom: 0,
4773
- width: '100%',
4774
- height: `${this.props.thick}px`,
4775
- cursor: 's-resize',
4776
- resize: props => {
4777
- this.resizeS(props);
4778
- }
4779
- },
4780
- w: {
4781
- color: 'green',
4782
- left: 0,
4783
- width: `${this.props.thick}px`,
4784
- height: '100%',
4785
- cursor: 'w-resize',
4786
- resize: props => {
4787
- this.resizeW(props);
4788
- }
4789
- },
4790
- nw: {
4791
- top: 0,
4792
- left: 0,
4793
- color: 'blue',
4794
- width: `${this.borderLong}px`,
4795
- height: `${this.borderLong}px`,
4796
- cursor: 'nw-resize',
4797
- resize: props => {
4798
- this.resizeN(props);
4799
- this.resizeW(props);
4800
- }
4801
- },
4802
- nww: {
4803
- top: 0,
4804
- left: 0,
4805
- color: 'blue',
4806
- width: `${this.props.thick + this.borderLong}px`,
4807
- height: `${this.props.thick}px`,
4808
- cursor: 'nw-resize',
4809
- resize: props => {
4810
- this.resizeN(props);
4811
- this.resizeW(props);
4812
- }
4813
- },
4814
- nnw: {
4815
- top: 0,
4816
- left: 0,
4817
- color: 'blue',
4818
- width: `${this.props.thick}px`,
4819
- height: `${this.props.thick + this.borderLong}px`,
4820
- cursor: 'nw-resize',
4821
- resize: props => {
4822
- this.resizeN(props);
4823
- this.resizeW(props);
4824
- }
4825
- },
4826
- nne: {
4827
- top: 0,
4828
- right: 0,
4829
- color: 'green',
4830
- width: `${this.props.thick + this.borderLong}px`,
4831
- height: `${this.props.thick}px`,
4832
- cursor: 'ne-resize',
4833
- resize: props => {
4834
- this.resizeN(props);
4835
- this.resizeE(props);
4836
- }
4837
- },
4838
- nee: {
4839
- top: 0,
4840
- right: 0,
4841
- color: 'green',
4842
- width: `${this.props.thick}px`,
4843
- height: `${this.props.thick + this.borderLong}px`,
4844
- cursor: 'ne-resize',
4845
- resize: props => {
4846
- this.resizeN(props);
4847
- this.resizeE(props);
4848
- }
4849
- },
4850
- sse: {
4851
- color: 'red',
4852
- right: 0,
4853
- bottom: 0,
4854
- width: `${this.props.thick + this.borderLong}px`,
4855
- height: `${this.props.thick}px`,
4856
- cursor: 'se-resize',
4857
- resize: props => {
4858
- this.resizeS(props);
4859
- this.resizeE(props);
4860
- }
4861
- },
4862
- see: {
4863
- color: 'red',
4864
- right: 0,
4865
- bottom: 0,
4866
- width: `${this.props.thick}px`,
4867
- height: `${this.props.thick + this.borderLong}px`,
4868
- cursor: 'se-resize',
4869
- resize: props => {
4870
- this.resizeS(props);
4871
- this.resizeE(props);
4872
- }
4873
- },
4874
- ssw: {
4875
- color: 'yellow',
4876
- bottom: 0,
4877
- left: 0,
4878
- width: `${this.props.thick + this.borderLong}px`,
4879
- height: `${this.props.thick}px`,
4880
- cursor: 'sw-resize',
4881
- resize: props => {
4882
- this.resizeS(props);
4883
- this.resizeW(props);
4884
- }
4885
- },
4886
- sww: {
4887
- color: 'yellow',
4888
- bottom: 0,
4889
- left: 0,
4890
- width: `${this.props.thick}px`,
4891
- height: `${this.props.thick + this.borderLong}px`,
4892
- cursor: 'sw-resize',
4893
- resize: props => {
4894
- this.resizeS(props);
4895
- this.resizeW(props);
4896
- }
4842
+
4843
+ ////////////////////////////////////////////////////////////////////////////
4844
+
4845
+ const Ths = ({
4846
+ table,
4847
+ groupData,
4848
+ groupIndex,
4849
+ deep,
4850
+ rowColumn,
4851
+ rowIndex
4852
+ }) => {
4853
+ return rowColumn?.map(({
4854
+ style: _style,
4855
+ align,
4856
+ type,
4857
+ render,
4858
+ ...column
4859
+ }, colIndex) => {
4860
+ const style = flexType(_style, table, {}, {});
4861
+ let content;
4862
+ if (type) {
4863
+ content = 'type';
4864
+ } else if (render) {
4865
+ content = render?.bind(table)({
4866
+ groupData,
4867
+ groupIndex,
4868
+ ths: 111
4869
+ });
4870
+ } else {
4871
+ content = column.label;
4897
4872
  }
4898
- };
4899
- resizeN = ({
4900
- window,
4901
- cursorY,
4902
- startY,
4903
- startHeight,
4904
- titleBarHeight
4905
- }) => {
4906
- let y = cursorY - this.props.thick;
4907
- if (y < 0) y = 0;
4908
- let height = startHeight + (startY - y);
4909
- if (height < titleBarHeight + this.props.thick * 2) {
4910
- height = titleBarHeight + this.props.thick * 2;
4911
- y = startY + startHeight - titleBarHeight - this.props.thick * 2;
4873
+ // style.textAlign=align
4874
+ return /*#__PURE__*/React__default.createElement("th", {
4875
+ key: colIndex,
4876
+ style: {
4877
+ textAlign: align,
4878
+ ...style
4879
+ },
4880
+ colSpan: column.colSpan,
4881
+ rowSpan: column.isLeaf && deep > rowIndex ? deep - rowIndex + 1 : null
4882
+ }, content);
4883
+ });
4884
+ };
4885
+ const GroupColumns = ({
4886
+ table,
4887
+ columns: _columns,
4888
+ trClassName,
4889
+ groupData,
4890
+ tbodyIndex
4891
+ }) => {
4892
+ const columns = Array.isArray(_columns?.[0]) ? _columns : [_columns];
4893
+ return columns?.map((rowColumn, rowIndex) => {
4894
+ return /*#__PURE__*/React__default.createElement("tr", {
4895
+ className: trClassName,
4896
+ key: rowIndex
4897
+ }, /*#__PURE__*/React__default.createElement(Ths, {
4898
+ table: table,
4899
+ groupData: groupData,
4900
+ groupIndex: tbodyIndex,
4901
+ deep: columns.length - 1,
4902
+ rowColumn: rowColumn,
4903
+ rowIndex: rowIndex
4904
+ }));
4905
+ });
4906
+ };
4907
+ styled.tr`
4908
+ z-index: 1;
4909
+ XXposition: sticky;
4910
+ XXtop: 50px;
4911
+ th{
4912
+ text-align: left;
4913
+ border:1px solid #222222;
4912
4914
  }
4913
- window.style.top = `${y}px`;
4914
- window.style.height = `${height}px`;
4915
- };
4916
- resizeE = ({
4917
- window,
4918
- clientX,
4919
- left,
4920
- titleBarHeight
4921
- }) => {
4922
- let width = clientX - left - this.props.thick;
4923
- if (width < titleBarHeight) width = titleBarHeight;
4924
- window.style.width = `${width + this.props.thick * 2}px`;
4925
- };
4926
- resizeS = ({
4927
- window,
4928
- clientY,
4929
- top,
4930
- titleBarHeight
4931
- }) => {
4932
- let height = clientY - top - this.props.thick;
4933
- if (height < titleBarHeight) height = titleBarHeight;
4934
- window.style.height = `${height + this.props.thick * 2}px`;
4935
- };
4936
- resizeW = ({
4937
- window,
4938
- cursorX,
4939
- startX,
4940
- startWidth,
4941
- titleBarHeight
4942
- }) => {
4943
- let x = cursorX - this.props.thick;
4944
- if (x < 0) x = 0;
4945
- let width = startWidth + (startX - x);
4946
- if (width < titleBarHeight + this.props.thick * 2) {
4947
- width = titleBarHeight + this.props.thick * 2;
4948
- x = startX + startWidth - titleBarHeight - this.props.thick * 2;
4915
+ `;
4916
+ const GroupHeader = props => {
4917
+ return /*#__PURE__*/React__default.createElement(GroupColumns, _extends({
4918
+ trClassName: 'jr-group-header'
4919
+ }, props));
4920
+ };
4921
+ styled.tr`
4922
+ th{
4923
+ border:1px solid #222222;
4924
+ text-align: left;
4949
4925
  }
4950
- window.style.left = `${x}px`;
4951
- window.style.width = `${width}px`;
4926
+ `;
4927
+ const GroupFooter = props => {
4928
+ return /*#__PURE__*/React__default.createElement(GroupColumns, _extends({
4929
+ trClassName: 'jr-group-footer'
4930
+ }, props));
4931
+ };
4932
+
4933
+ ////////////////////////////////////////////////////////////////////////////
4934
+ const Td = ({
4935
+ column: _column,
4936
+ record,
4937
+ tbodyIndex,
4938
+ trIndex,
4939
+ tdIndex,
4940
+ table
4941
+ }) => {
4942
+ let content;
4943
+ const {
4944
+ style: _style,
4945
+ align,
4946
+ vAlign = 'baseline',
4947
+ type,
4948
+ typeStyle: _typeStyle,
4949
+ render,
4950
+ setValue,
4951
+ getValue,
4952
+ onChange: _onChange,
4953
+ funcProps,
4954
+ ...column
4955
+ } = _column;
4956
+ const onChange = inputValue => {
4957
+ const targetValue = inputValue?.target?.value ?? inputValue;
4958
+ setValue(record, targetValue);
4959
+ table.setValue(table.getValue());
4952
4960
  };
4953
- stop = e => {
4954
- e.preventDefault();
4955
- const {
4956
- height: titleBarHeight
4957
- } = this.props.titleBarRef.current.getBoundingClientRect();
4958
- const {
4959
- x,
4960
- y,
4961
- width,
4962
- height
4963
- } = this.props.windowRef.current.getBoundingClientRect();
4964
- this.props.windowRef.current.style.transition = 'var(--transition-x-y)';
4965
- if (y == 0 && this.data.direction.indexOf('n') > -1) {
4966
- this.props.window.orgHeight = height;
4967
- this.props.windowRef.current.style.height = `${window.innerHeight}px`;
4968
- }
4969
- if (y > window.innerHeight) this.props.windowRef.current.style.top = `${window.innerHeight - titleBarHeight}px`;
4970
- if (x + width - this.props.thick < 0) this.props.windowRef.current.style.left = 0;
4971
- if (x > window.innerWidth) this.props.windowRef.current.style.left = `${window.innerWidth - width}px`;
4972
- document.body.style.cursor = 'default';
4973
- window.removeEventListener('mousemove', this.move);
4974
- window.removeEventListener('mousemove', this.preMove);
4975
- window.removeEventListener('mouseup', this.stop);
4961
+ const value = getValue(record);
4962
+ let style = render ? {} : flexType(_style, table, {
4963
+ value,
4964
+ record
4965
+ }, {});
4966
+ const setStyle = _style => {
4967
+ style = _style;
4976
4968
  };
4977
- move = e => {
4978
- e.preventDefault();
4979
- this.props.windowRef.current.style.transition = 'unset';
4980
- const {
4981
- clientX,
4982
- clientY,
4983
- x: cursorX,
4984
- y: cursorY
4985
- } = e;
4986
- const window = this.props.windowRef.current;
4987
- const {
4988
- left,
4989
- top
4990
- } = window.getBoundingClientRect();
4991
- let {
4992
- x: startX,
4993
- width: startWidth,
4994
- y: startY,
4995
- height: startHeight,
4996
- titleBarHeight
4997
- } = this.data;
4998
- this.directions[this.props.direction].resize({
4999
- window,
5000
- titleBarHeight,
5001
- clientX,
5002
- cursorX,
5003
- startX,
5004
- startWidth,
5005
- left,
5006
- clientY,
5007
- cursorY,
5008
- startY,
5009
- startHeight,
5010
- top
4969
+ setStyle.bind(table);
4970
+ render?.bind(table);
4971
+ if (type) {
4972
+ const typeStyle = flexType(_typeStyle, table, {
4973
+ record
4974
+ }, {});
4975
+ content = /*#__PURE__*/React__default.createElement(type, {
4976
+ onChange: _onChange ? e => {
4977
+ _onChange?.bind(table)(e, {
4978
+ value,
4979
+ onChange,
4980
+ me: content
4981
+ });
4982
+ } : onChange,
4983
+ value,
4984
+ style: typeStyle,
4985
+ render,
4986
+ ...column,
4987
+ ...funcProps?.bind(table)({
4988
+ value
4989
+ })
4990
+ });
4991
+ } else if (render) {
4992
+ content = render({
4993
+ index: trIndex,
4994
+ groupIndex: tbodyIndex,
4995
+ value,
4996
+ record,
4997
+ onChange,
4998
+ setStyle
4999
+ });
5000
+ } else {
5001
+ content = value;
5002
+ }
5003
+ return /*#__PURE__*/React__default.createElement("td", {
5004
+ colSpan: style.colSpan,
5005
+ rowSpan: style.rowSpan,
5006
+ style: {
5007
+ textAlign: align,
5008
+ verticalAlign: vAlign,
5009
+ ...style
5010
+ },
5011
+ key: tdIndex
5012
+ }, content);
5013
+ };
5014
+ const Tds = ({
5015
+ leafColumns,
5016
+ record,
5017
+ table,
5018
+ tbodyIndex,
5019
+ trIndex
5020
+ }) => {
5021
+ return leafColumns?.map((column, tdIndex) => {
5022
+ return /*#__PURE__*/React__default.createElement(Td, {
5023
+ column: column,
5024
+ key: tdIndex,
5025
+ record: record,
5026
+ table: table,
5027
+ tbodyIndex: tbodyIndex,
5028
+ trIndex: trIndex,
5029
+ tdIndex: tdIndex
5011
5030
  });
5031
+ });
5032
+ };
5033
+ ////////////////////////////////////////////////////////////////////////////
5034
+
5035
+ const TBody = ({
5036
+ groupData,
5037
+ groupHeader,
5038
+ leafColumns,
5039
+ groupFooter,
5040
+ table,
5041
+ tbodyIndex
5042
+ }) => {
5043
+ const neededProps = {
5044
+ table,
5045
+ tbodyIndex
5012
5046
  };
5013
- preMove = () => {
5014
- if (this.props.direction.indexOf('n') > -1) {
5015
- this.props.windowRef.current.style.height = `${this.props.window.orgHeight}px`;
5016
- this.data.height = this.props.window.orgHeight;
5017
- this.props.window.orgHeight = null;
5047
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("tbody", {
5048
+ key: `tbody${tbodyIndex}`
5049
+ }, groupData?.length > 0 && /*#__PURE__*/React__default.createElement(GroupHeader, _extends({
5050
+ groupData: groupData,
5051
+ columns: groupHeader
5052
+ }, neededProps)), groupData?.map?.((record, trIndex) => {
5053
+ const onRowClick = table.props.onRowClick?.bind(table);
5054
+ return /*#__PURE__*/React__default.createElement("tr", {
5055
+ key: trIndex,
5056
+ onClick: () => {
5057
+ onRowClick?.({
5058
+ record,
5059
+ index: trIndex,
5060
+ groupIndex: tbodyIndex
5061
+ });
5062
+ }
5063
+ }, /*#__PURE__*/React__default.createElement(Tds, _extends({
5064
+ record: record,
5065
+ trIndex: trIndex
5066
+ }, neededProps, {
5067
+ leafColumns: leafColumns
5068
+ })));
5069
+ }), groupData?.length > 0 && /*#__PURE__*/React__default.createElement(GroupFooter, _extends({
5070
+ groupData: groupData,
5071
+ columns: groupFooter
5072
+ }, neededProps))));
5073
+ };
5074
+ const TBodies = ({
5075
+ groupHeader,
5076
+ leafColumns,
5077
+ groupFooter,
5078
+ dataSource: _dataSource,
5079
+ table
5080
+ }) => {
5081
+ // po('--TBodies--')
5082
+ const isGroupDataType = Array.isArray(_dataSource?.[0]);
5083
+ const dataSource = isGroupDataType ? _dataSource : [_dataSource];
5084
+
5085
+ // po('dataSource',dataSource)
5086
+ return dataSource?.map((groupData, tbodyIndex, c) => {
5087
+ return /*#__PURE__*/React__default.createElement(TBody, {
5088
+ key: `tbody${tbodyIndex}`,
5089
+ table: table
5090
+ // dataSource={dataSource}
5091
+ // dataGroup={groupData}
5092
+ ,
5093
+ groupData: groupData,
5094
+ tbodyIndex: tbodyIndex,
5095
+ groupHeader: groupHeader,
5096
+ leafColumns: leafColumns,
5097
+ groupFooter: groupFooter
5098
+ });
5099
+ });
5100
+ };
5101
+
5102
+ const StyledJRTable = styled.div`
5103
+ --column-bd-color:#cccccc;
5104
+ --column-b-color:#eeeeee;
5105
+ --column-b-hover-color:#ffffff;
5106
+
5107
+ position: relative;
5108
+ background: var(--column-b-color);
5109
+ border:1px solid var(--column-bd-color);
5110
+
5111
+ display:flex;
5112
+ flex-direction: column;
5113
+ flex:1;
5114
+ overflow: overlay;
5115
+
5116
+
5117
+
5118
+
5119
+ &.row-highlightable{
5120
+ tbody{
5121
+ tr:not(.jr-group-header,.jr-group-footer):hover{
5122
+ background:var(--column-b-hover-color);
5123
+ cursor: pointer;
5124
+ transition: background-color .8s;
5125
+ td{
5126
+ color:black;
5127
+ transition:color .8s;
5128
+ }
5129
+
5130
+ }
5131
+ }
5018
5132
  }
5019
- window.removeEventListener('mousemove', this.preMove);
5020
- setTimeout(() => {
5021
- window.addEventListener('mousemove', this.move);
5022
- }, 100);
5023
- };
5024
- start = (e, direction) => {
5025
- e.preventDefault();
5026
- const {
5027
- height: titleBarHeight
5028
- } = this.props.titleBarRef.current.getBoundingClientRect();
5029
- let {
5030
- x,
5031
- y,
5032
- width,
5033
- height
5034
- } = this.props.windowRef.current.getBoundingClientRect();
5035
- if (this.props.direction.indexOf('s') > -1) {
5036
- this.props.window.orgHeight = null;
5133
+
5134
+ table{
5135
+ Xheight: 100%;
5136
+ min-width:100%;
5137
+ width: max-content;
5138
+ border-spacing: 0;
5139
+
5140
+ thead{
5141
+ position: sticky;
5142
+ top: 0;
5143
+
5144
+ th{
5145
+ position: relative;
5146
+ padding: 2px 6px;
5147
+ background: linear-gradient(180deg, rgba(227, 227, 226, 1) 0%, rgba(255, 255, 255, 1) 25%, rgba(210, 210, 210, 1) 100%);
5148
+ box-shadow: 2px 2px 2px 0 #ffffffd6 inset, -1px -1px 2px 0px #8a847dbf inset;
5149
+ color: #525252;
5150
+ white-space: nowrap;
5151
+ }
5152
+ }
5153
+
5154
+ tfoot{
5155
+ position: sticky;
5156
+ bottom: -1px;
5157
+
5158
+ Xtr:nth-child(1){
5159
+ th{
5160
+ Xborder-top:1px solid var(--column-bd-color);
5161
+ }
5162
+ }
5163
+ Xth:nth-child(1){
5164
+ Xborder-left:1px solid var(--column-bd-color);
5165
+ }
5166
+
5167
+ th{
5168
+ height:32px;
5169
+ padding: 4px;
5170
+ background: #e4e4e4;
5171
+ xbackground: linear-gradient(180deg, rgba(227, 227, 226, 1) 0%, rgba(255, 255, 255, 1) 25%, rgba(210, 210, 210, 1) 100%);
5172
+ xbox-shadow: 2px 2px 2px 0 #ffffffd6 inset, -1px -1px 2px 0px #8a847dbf inset;
5173
+ color: #525252;
5174
+ white-space: nowrap;
5175
+
5176
+ border-left:2px solid #f4f4f4;
5177
+ border-top:2px solid #f4f4f4;
5178
+ border-right:2px solid var(--column-bd-color);
5179
+ border-bottom:2px solid var(--column-bd-color);
5180
+ }
5181
+ }
5182
+
5183
+ tbody{
5184
+ tr{
5185
+ transition: background .3s linear;
5186
+ background:var(--column-b-color);
5187
+ a:#ededed;
5188
+ th{
5189
+ color:#444444;
5190
+ }
5191
+ td{
5192
+ border-bottom: 1px solid var(--column-bd-color);
5193
+ color:#2e2e2e;
5194
+ padding: 4px;
5195
+ }
5196
+ }
5197
+ tr:hover{
5198
+ background:var(--column-b-hover-color);
5199
+
5200
+ }
5201
+
5202
+ tr.jr-group-header
5203
+ ,tr.jr-group-footer{
5204
+ text-align:left;
5205
+ background:#dddbdb;
5206
+
5207
+ th{
5208
+ border-bottom: 1px solid var(--column-bd-color);
5209
+ border-right: 1px solid var(--column-bd-color);
5210
+ padding: 4px 8px;
5211
+ }
5212
+ }
5213
+ }
5214
+ tbody.empty-tbody{
5215
+ td{
5216
+ border:10px solid red;
5217
+ }
5218
+ }
5219
+ }
5220
+
5221
+
5222
+
5223
+
5224
+ > .empty{
5225
+ user-select: none;
5226
+ color:#848484;
5227
+ height:100%;
5228
+ flex:1;
5229
+ display:flex;
5230
+ justify-content: center;
5231
+ align-items: center;
5232
+
5233
+
5234
+ }
5235
+
5236
+ > .empty::after{
5237
+ content:'無資料';
5238
+ position: block;
5239
+ }
5240
+
5241
+ `;
5242
+
5243
+ styled.div`
5244
+ display:flex;
5245
+ flex:1;
5246
+ overflow:hidden;
5247
+
5248
+ > *{
5249
+ Xborder:1px solid gray;
5037
5250
  }
5038
- this.data = {
5039
- x,
5040
- y,
5041
- width,
5042
- height,
5043
- titleBarHeight,
5044
- direction
5045
- };
5046
- document.body.style.cursor = this.directions[this.props.direction].cursor;
5047
- if (this.props.window.orgHeight) {
5048
- window.addEventListener('mousemove', this.preMove);
5049
- } else {
5050
- window.addEventListener('mousemove', this.move);
5251
+ >main{
5252
+ display:flex;
5253
+ flex:1;
5254
+ overflow:overlay;
5255
+ flex-direction: column;
5256
+ > *{
5257
+ XXborder:1px solid gray;
5258
+ XXmin-height:30px;
5259
+ }
5260
+
5261
+ >header{
5262
+ XXborder:1px solid red;
5263
+ XXoverflow: overlay;
5264
+ }
5265
+ >main{
5266
+ display:flex;
5267
+ flex:1;
5268
+ overflow:hidden;
5269
+ }
5270
+ >footer{
5271
+ XXborder:1px solid blue;
5272
+ overflow: overlay;
5273
+ }
5274
+
5051
5275
  }
5052
- window.addEventListener('mouseup', this.stop);
5053
- };
5054
- render() {
5055
- return /*#__PURE__*/React__default.createElement(StyledSlider, {
5056
- $direction: this.directions[this.props.direction],
5057
- $padding: this.props.padding,
5058
- onMouseDown: e => {
5059
- this.start(e, this.props.direction);
5060
- }
5061
- });
5062
- }
5063
- }
5276
+
5277
+ `;
5064
5278
 
5065
5279
  const StyleJRFields = styled.main`
5066
5280
  --column-bd-color:#cccccc;
@@ -5464,270 +5678,44 @@ class JRFields extends JRWindow {
5464
5678
  key: `f${index}`,
5465
5679
  style: _style,
5466
5680
  className: 'jr-column',
5467
- $labelWidth: column.labelProps?.width ?? this.props.labelProps?.width ?? '120px',
5468
- $valueWidth: column.valueProps?.width ?? this.props.valueProps?.width ?? '1fr'
5469
- }, label != null && /*#__PURE__*/React__default.createElement(StyledColumnLabel, {
5470
- style: labelStyle,
5471
- $required: column.required,
5472
- className: 'label',
5473
- $layout: layout,
5474
- $colon: colon
5475
- }, label), content, /*#__PURE__*/React__default.createElement(StyledColumnFooter, {
5476
- $layout: layout
5477
- }, /*#__PURE__*/React__default.createElement("div", {
5478
- className: "left"
5479
- }, this.getTestValue(_parentName.join('.'))?.msg?.map(msg => {
5480
- return msg;
5481
- })), /*#__PURE__*/React__default.createElement("div", {
5482
- className: "right"
5483
- })));
5484
- }
5485
- createColumns(parentValue, columns, parentName, fullname, labelProps) {
5486
- return columns?.map((column, index) => {
5487
- return this.createColumn(parentValue, column, index, parentName, column.name ? [...fullname, column.name] : fullname, labelProps);
5488
- });
5489
- }
5490
- renderMe() {
5491
- return /*#__PURE__*/React__default.createElement(StyleJRFields, {
5492
- className: 'jr-fields',
5493
- style: this.props.typeStyle
5494
- }, /*#__PURE__*/React__default.createElement(StyledGrid, {
5495
- cols: this.props.cols,
5496
- style: this.props.gridStyle,
5497
- className: 'jr-grid',
5498
- $gap: this.props.gap
5499
- }, this.createColumns(this.props.dataSourceName ? this.getValue()?.[this.props.dataSourceName] : this.getValue(), this.props.columns, this.props.dataSourceName ? [this.props.dataSourceName] : [], this.props.dataSourceName ? [this.props.dataSourceName] : [], this.props.labelProps)));
5500
- }
5501
- }
5502
-
5503
- // export const FFields=JRFrameHOC(JRFields)
5504
- // export const WFields=JRWindowHOC(FFields)
5505
-
5506
- const StyledInput = styled.div`
5507
- display:flex;
5508
- input:focus{
5509
- outline: none;
5510
- }
5511
- `;
5512
- class JRInput extends React__default.Component {
5513
- setValue(value) {
5514
- this.props?.onChange?.(value);
5515
- }
5516
- render() {
5517
- return /*#__PURE__*/React__default.createElement(StyledInput, null, this.input());
5518
- }
5519
- }
5520
-
5521
- function styleInject(css, ref) {
5522
- if ( ref === void 0 ) ref = {};
5523
- var insertAt = ref.insertAt;
5524
-
5525
- if (!css || typeof document === 'undefined') { return; }
5526
-
5527
- var head = document.head || document.getElementsByTagName('head')[0];
5528
- var style = document.createElement('style');
5529
- style.type = 'text/css';
5530
-
5531
- if (insertAt === 'top') {
5532
- if (head.firstChild) {
5533
- head.insertBefore(style, head.firstChild);
5534
- } else {
5535
- head.appendChild(style);
5536
- }
5537
- } else {
5538
- head.appendChild(style);
5539
- }
5540
-
5541
- if (style.styleSheet) {
5542
- style.styleSheet.cssText = css;
5543
- } else {
5544
- style.appendChild(document.createTextNode(css));
5545
- }
5546
- }
5547
-
5548
- 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}";
5549
- var style = {"test":"Style-module_test__LrdEc","withMask":"Style-module_withMask__LPcai"};
5550
- styleInject(css_248z);
5551
-
5552
- const StyledJRWindow = styled.div`
5553
- --jr-window-radius:3px;
5554
- --padding-child:8px;
5555
- --transition-x-y:height .05s ease-in, width .05s ease-in;
5556
- xborder:1px solid gray;
5557
- position: fixed;
5558
- padding: ${({
5559
- $thick
5560
- }) => $thick}px;
5561
- border-radius: var(--jr-window-radius);
5562
- user-select: text;
5563
-
5564
- top: ${({
5565
- $y
5566
- }) => $y}px;
5567
- left: ${({
5568
- $x
5569
- }) => $x}px;
5570
- width: ${({
5571
- $width = 300
5572
- }) => `${$width}px`};
5573
- height: ${({
5574
- $height = 300
5575
- }) => `${$height}px`};
5576
- overflow: hidden;
5577
- z-index: 2;
5578
-
5579
- display: flex;
5580
- flex-direction: column;
5581
- overflow: hidden;
5582
-
5583
- > main{
5584
- border-radius: var(--jr-window-radius);
5585
- box-shadow: 0px 0px 5px 1px gray;
5586
- display: flex;
5587
- flex-direction: column;
5588
- overflow: hidden;
5589
- flex:1;
5590
- > main {
5591
- Xpadding:var(--padding-child);
5592
- overflow: overlay;
5593
- flex:1;
5594
- display: flex;
5595
- min-height:32px;
5596
- }
5597
- }
5598
-
5599
- `;
5600
- class JRWindow extends JRFrame {
5601
- x = 0;
5602
- y = 0;
5603
- width = 300;
5604
- height = 300;
5605
- padding = 1;
5606
- thick = 5;
5607
- constructor(props) {
5608
- super(props);
5609
- this.ref = /*#__PURE__*/React__default.createRef();
5610
- this.titleBarRef = /*#__PURE__*/React__default.createRef();
5611
- this.init();
5612
- }
5613
- addMaskToTarget = target => {
5614
- this.mask = document.createElement('div');
5615
- this.mask.style.background = '#868686cc';
5616
- this.mask.style.position = 'absolute';
5617
- this.mask.style.top = '0';
5618
- this.mask.style.left = '0';
5619
- this.mask.style.right = '0';
5620
- this.mask.style.bottom = '0';
5621
- this.mask.style.borderRadius = 'inherit';
5622
- this.mask.style.height = '10000px';
5623
- this.mask.style.width = '10000px';
5624
- target.appendChild(this.mask);
5625
- po('style.mask', style.mask);
5626
- po('addMask+++++++++++++++++++++++++++');
5627
- };
5628
- removeMaskFromTarget = () => {
5629
- po('removeMask-----------------------');
5630
- this.mask.remove();
5631
- };
5632
- maskOnTarget(on) {
5633
- po('typeof this.props.maskOn', typeof this.props.maskOn);
5634
- const target = typeof this.props.maskOn === 'object' ? this.props.maskOn : typeof this.props.maskOn === 'string' ? document.getElementById(this.props.maskOn) : document.body;
5635
-
5636
- // this[on?'addMaskToTarget':'removeMaskFromTarget'](target)
5637
- target?.classList[on ? 'add' : 'remove']('withMask');
5638
- }
5639
- componentDidMount() {
5640
- super.componentDidMount();
5641
- if (this.props.maskOn && this.props.open) {
5642
- this.maskOnTarget(this.props.open);
5643
- }
5644
- if (this.props.open) {
5645
- this.open();
5646
- }
5647
- }
5648
- open() {
5649
- this.props.onOpen?.bind(this)();
5650
- }
5651
- close() {
5652
- this.props.onClose?.bind(this)();
5653
- }
5654
- componentDidUpdate(prevProps, prevState, snapshot) {
5655
- if (this.props.popup === true) {
5656
- if (this.props.open && prevProps.open === false) {
5657
- this.open();
5658
- } else if (this.props.open === false && prevProps.open) {
5659
- this.close();
5660
- }
5661
- if (this.props.maskOn && this.props.open != prevProps.open) {
5662
- this.maskOnTarget(this.props.open);
5663
- }
5664
- }
5681
+ $labelWidth: column.labelProps?.width ?? this.props.labelProps?.width ?? '120px',
5682
+ $valueWidth: column.valueProps?.width ?? this.props.valueProps?.width ?? '1fr'
5683
+ }, label != null && /*#__PURE__*/React__default.createElement(StyledColumnLabel, {
5684
+ style: labelStyle,
5685
+ $required: column.required,
5686
+ className: 'label',
5687
+ $layout: layout,
5688
+ $colon: colon
5689
+ }, label), content, /*#__PURE__*/React__default.createElement(StyledColumnFooter, {
5690
+ $layout: layout
5691
+ }, /*#__PURE__*/React__default.createElement("div", {
5692
+ className: "left"
5693
+ }, this.getTestValue(_parentName.join('.'))?.msg?.map(msg => {
5694
+ return msg;
5695
+ })), /*#__PURE__*/React__default.createElement("div", {
5696
+ className: "right"
5697
+ })));
5665
5698
  }
5666
- init() {
5667
- this.height = window.innerHeight >= (this.props.height ?? this.height) ? this.props.height ?? this.height : window.innerHeight;
5668
- this.width = window.innerWidth >= (this.props.width ?? this.width) ? this.props.width ?? this.width : window.innerWidth;
5669
- this.x = this.props.x ?? (window.innerWidth - (this.width ?? 300)) / 2;
5670
- this.y = this.props.y ?? (window.innerHeight - (this.height ?? 300)) / 2;
5699
+ createColumns(parentValue, columns, parentName, fullname, labelProps) {
5700
+ return columns?.map((column, index) => {
5701
+ return this.createColumn(parentValue, column, index, parentName, column.name ? [...fullname, column.name] : fullname, labelProps);
5702
+ });
5671
5703
  }
5672
- renderer() {
5673
- return this.props.popup === true ? this.props.open ? /*#__PURE__*/React__default.createElement(StyledJRWindow, {
5674
- ref: this.ref,
5675
- className: `jr-window ${this.props.className ?? ''}`,
5676
- $x: this.x,
5677
- $y: this.y,
5678
- $width: this.width,
5679
- $height: this.height,
5680
- $thick: this.thick
5681
- }, /*#__PURE__*/React__default.createElement("main", null, /*#__PURE__*/React__default.createElement(TitleBar, {
5682
- titleBarRef: this.titleBarRef,
5683
- windowRef: this.ref,
5684
- window: this,
5685
- title: this.props.title,
5686
- thick: this.thick
5687
- }), /*#__PURE__*/React__default.createElement("main", null, super.renderer())), /*#__PURE__*/React__default.createElement(Sliders, {
5688
- thick: this.thick,
5689
- windowRef: this.ref,
5690
- window: this,
5691
- titleBarRef: this.titleBarRef
5692
- })) : '' : super.renderer();
5704
+ renderMe() {
5705
+ return /*#__PURE__*/React__default.createElement(StyleJRFields, {
5706
+ className: 'jr-fields',
5707
+ style: this.props.typeStyle
5708
+ }, /*#__PURE__*/React__default.createElement(StyledGrid, {
5709
+ cols: this.props.cols,
5710
+ style: this.props.gridStyle,
5711
+ className: 'jr-grid',
5712
+ $gap: this.props.gap
5713
+ }, this.createColumns(this.props.dataSourceName ? this.getValue()?.[this.props.dataSourceName] : this.getValue(), this.props.columns, this.props.dataSourceName ? [this.props.dataSourceName] : [], this.props.dataSourceName ? [this.props.dataSourceName] : [], this.props.labelProps)));
5693
5714
  }
5694
5715
  }
5695
5716
 
5696
- styled.div`
5697
- display:flex;
5698
- flex:1;
5699
- overflow:hidden;
5700
-
5701
- > *{
5702
- Xborder:1px solid gray;
5703
- }
5704
- >main{
5705
- display:flex;
5706
- flex:1;
5707
- overflow:overlay;
5708
- flex-direction: column;
5709
- > *{
5710
- XXborder:1px solid gray;
5711
- XXmin-height:30px;
5712
- }
5713
-
5714
- >header{
5715
- XXborder:1px solid red;
5716
- XXoverflow: overlay;
5717
- }
5718
- >main{
5719
- display:flex;
5720
- flex:1;
5721
- overflow:hidden;
5722
- }
5723
- >footer{
5724
- XXborder:1px solid blue;
5725
- overflow: overlay;
5726
- }
5727
-
5728
- }
5729
-
5730
- `;
5717
+ // export const FFields=JRFrameHOC(JRFields)
5718
+ // export const WFields=JRWindowHOC(FFields)
5731
5719
 
5732
5720
  styled.div`
5733
5721
  --jr-window-radius:3px;
@@ -6016,95 +6004,15 @@ class JRTable extends JRWindow {
6016
6004
  // export const FTable=JRFrameHOC(JRTable)
6017
6005
  // export const WTable=JRWindowHOC(JRTable)
6018
6006
 
6019
- const StyledJRFrame = styled.div`
6020
- display:flex;
6021
- flex:1;
6022
- overflow:hidden;
6023
-
6024
- > *{
6025
- Xborder:1px solid gray;
6026
- }
6027
- >main{
6028
- display:flex;
6029
- flex:1;
6030
- overflow:overlay;
6031
- flex-direction: column;
6032
- > *{
6033
- XXborder:1px solid gray;
6034
- min-height:30px;
6035
- }
6036
-
6037
- >header{
6038
- XXborder:1px solid red;
6039
- XXoverflow: overlay;
6040
- }
6041
- >main{
6042
- display:flex;
6043
- flex:1;
6044
- overflow:hidden;
6045
- }
6046
- >footer{
6047
- XXborder:1px solid blue;
6048
- overflow: overlay;
6049
- }
6050
-
6051
- }
6052
-
6007
+ const StyledJRTest = styled.div`
6008
+
6053
6009
  `;
6054
- const FreeType = ({
6055
- tag: Tag,
6056
- config,
6057
- me,
6058
- className
6059
- }) => {
6060
- if (typeof config === 'function') {
6061
- let style;
6062
- const setStyle = function (_style) {
6063
- style = _style;
6064
- };
6065
- const content = config.bind(me)({
6066
- setStyle
6067
- });
6068
- return /*#__PURE__*/React__default.createElement(Tag, {
6069
- className: className,
6070
- style: style
6071
- }, content);
6072
- }
6073
- };
6074
6010
  class JRTestReact extends JRSubmit {
6075
6011
  renderer() {
6076
- return /*#__PURE__*/React__default.createElement(StyledJRFrame, {
6012
+ return /*#__PURE__*/React__default.createElement(StyledJRTest, {
6077
6013
  style: this.props.style,
6078
6014
  className: `${this.props.className} jr-frame`
6079
- }, /*#__PURE__*/React__default.createElement(FreeType, {
6080
- tag: "div",
6081
- config: this.props.start,
6082
- me: this,
6083
- className: 'start'
6084
- }), /*#__PURE__*/React__default.createElement("main", null, /*#__PURE__*/React__default.createElement(FreeType, {
6085
- tag: "header",
6086
- config: this.props.top,
6087
- me: this
6088
- }), /*#__PURE__*/React__default.createElement("main", null, /*#__PURE__*/React__default.createElement(FreeType, {
6089
- tag: "div",
6090
- config: this.props.left,
6091
- me: this,
6092
- className: 'left'
6093
- }), this.renderMe(), /*#__PURE__*/React__default.createElement(FreeType, {
6094
- tag: "div",
6095
- config: this.props.right,
6096
- me: this,
6097
- className: 'right'
6098
- })), /*#__PURE__*/React__default.createElement(FreeType, {
6099
- tag: "footer",
6100
- config: this.props.bottom,
6101
- me: this
6102
- })), /*#__PURE__*/React__default.createElement(FreeType, {
6103
- tag: "div",
6104
- config: this.props.end,
6105
- me: this,
6106
- className: 'end'
6107
- }));
6015
+ });
6108
6016
  }
6109
6017
  renderMe() {
6110
6018
  return /*#__PURE__*/React__default.createElement("div", {
@@ -6115,4 +6023,220 @@ class JRTestReact extends JRSubmit {
6115
6023
  }
6116
6024
  }
6117
6025
 
6118
- export { JRButton, JRFields, JRFrame, JRSubmit, JRTable, JRTestReact, JRWindow };
6026
+ class AlertWindow extends JRWindow {
6027
+ renderMe() {
6028
+ return this.getValue()?.message;
6029
+ }
6030
+ }
6031
+ const StyledAlert = styled(AlertWindow)`
6032
+ .body{
6033
+ display: flex;
6034
+ align-items: center;
6035
+ padding: 20px;
6036
+ }
6037
+
6038
+ footer{
6039
+ display: flex;
6040
+ justify-content: end;
6041
+ padding: 8px;
6042
+ }
6043
+ `;
6044
+ function JRAlertWindow({
6045
+ title,
6046
+ message,
6047
+ container,
6048
+ ...props
6049
+ }) {
6050
+ const [open, setOpen] = useState(true);
6051
+ return /*#__PURE__*/React__default.createElement(StyledAlert, _extends({
6052
+ initValue: {
6053
+ message
6054
+ },
6055
+ width: 440,
6056
+ height: 180,
6057
+ maskOn: 'play'
6058
+ }, props, {
6059
+ open: open,
6060
+ setOpen: setOpen,
6061
+ popup: true,
6062
+ title: title ?? ''
6063
+ // onOpen={()=>{
6064
+ // po('Open+++++++++++++++++')
6065
+ // }}
6066
+ ,
6067
+ onClose: () => {
6068
+ container.remove();
6069
+ },
6070
+ bottom: function () {
6071
+ return /*#__PURE__*/React__default.createElement("button", {
6072
+ onClick: () => {
6073
+ setOpen(false);
6074
+ }
6075
+ }, "OK");
6076
+ }
6077
+ }), message);
6078
+ }
6079
+ function JRAlert(props) {
6080
+ const body = document.body;
6081
+ const containerId = 'jr-alert-div';
6082
+ let container = document.getElementById(containerId);
6083
+ if (container == null) {
6084
+ container = document.createElement('div');
6085
+ container.id = containerId;
6086
+ body.appendChild(container);
6087
+ }
6088
+ const jrAlerDiv = document.createElement('div');
6089
+ container.appendChild(jrAlerDiv);
6090
+ createRoot(jrAlerDiv).render(/*#__PURE__*/React__default.createElement(JRAlertWindow, _extends({}, props, {
6091
+ container: jrAlerDiv
6092
+ })));
6093
+ }
6094
+
6095
+ const StyledInput = styled.div`
6096
+ display:flex;
6097
+ input:focus{
6098
+ outline: none;
6099
+ }
6100
+ `;
6101
+ class JRInput extends React__default.Component {
6102
+ setValue(value) {
6103
+ this.props?.onChange?.(value);
6104
+ }
6105
+ render() {
6106
+ return /*#__PURE__*/React__default.createElement(StyledInput, null, this.input());
6107
+ }
6108
+ }
6109
+
6110
+ class JROptions extends JRSubmit {
6111
+ get optionsFrom() {
6112
+ return this.props.options === undefined ? 'state' : 'props';
6113
+ }
6114
+ setOptions(options) {
6115
+ if (this.props.setOptions) {
6116
+ this.props.setOptions(options);
6117
+ } else {
6118
+ this.setState({
6119
+ options: options
6120
+ });
6121
+ }
6122
+ }
6123
+ getOptions() {
6124
+ return this[this.optionsFrom]?.options;
6125
+ }
6126
+ setRes(isSuccess, response, config) {
6127
+ if (isSuccess) {
6128
+ const options = config.formatValue?.bind(this)(response.data) ?? response.data;
6129
+ response.data = options;
6130
+ this.setOptions(options);
6131
+ }
6132
+ }
6133
+ }
6134
+
6135
+ const StyledOption = styled.option`
6136
+ `;
6137
+ const StyledSelect = styled.select`
6138
+ ${({
6139
+ size,
6140
+ multiple
6141
+ }) => `${size == 1 || size == undefined && multiple != true ? 'height:30px;' : ''}`}
6142
+ width: 100%;
6143
+
6144
+ option{
6145
+ padding: 4px;
6146
+ height: 25px;
6147
+ display: flex;
6148
+ align-items: center;
6149
+ }
6150
+ `;
6151
+ class JRSelect extends JROptions {
6152
+ renderer() {
6153
+ const {
6154
+ showBlank,
6155
+ valueName = 'id',
6156
+ labelName = 'name',
6157
+ multiple,
6158
+ size
6159
+ } = this.props;
6160
+ const options = [...(this.getOptions() ?? [])];
6161
+ if (multiple != true && showBlank != false) options.unshift({
6162
+ [valueName]: '',
6163
+ [labelName]: ''
6164
+ });
6165
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(StyledSelect, {
6166
+ value: this.getValue() ?? (multiple ? [] : ''),
6167
+ className: 'jr-select',
6168
+ onChange: e => {
6169
+ if (multiple) {
6170
+ const selectedIndex = [...e.target.selectedOptions].map(option => option.index);
6171
+ this.setValue(selectedIndex.length ? selectedIndex.map(index => options[index][valueName]) : null);
6172
+ } else {
6173
+ const selectedIndex = e.target.selectedOptions[0].index;
6174
+ this.setValue(selectedIndex ? options[selectedIndex][valueName] : null);
6175
+ }
6176
+ },
6177
+ size: size,
6178
+ multiple: multiple
6179
+ }, options.map((record, key) => {
6180
+ const props = {
6181
+ value: record[valueName],
6182
+ key: key
6183
+ };
6184
+ if (multiple && this.getValue()?.indexOf(record[valueName]) > -1 || this.getValue() == record[valueName]) {
6185
+ props.className = 'selected';
6186
+ }
6187
+ return /*#__PURE__*/React__default.createElement(StyledOption, props, record[labelName]);
6188
+ })));
6189
+ }
6190
+ }
6191
+
6192
+ const StyledPick = styled.div`
6193
+ >label{
6194
+ white-space: nowrap;
6195
+ display: inline-flex;
6196
+ align-items: center;
6197
+ height: 30px;
6198
+ padding-right: 12px;
6199
+ }
6200
+ `;
6201
+
6202
+ class JRCheckbox extends JROptions {
6203
+ renderer() {
6204
+ const {
6205
+ valueName = 'value',
6206
+ labelName = 'label'
6207
+ } = this.props;
6208
+ const multiple = Array.isArray(this.getOptions() ?? []);
6209
+ const options = multiple ? this.getOptions() : [this.getOptions()];
6210
+ const value = multiple ? [...(this.getValue() ?? [])] : this.getValue();
6211
+ const checked = multiple ? checkValue => {
6212
+ return value.indexOf(checkValue) > -1;
6213
+ } : checkValue => {
6214
+ return checkValue == value;
6215
+ };
6216
+ return /*#__PURE__*/React__default.createElement(StyledPick, {
6217
+ className: 'jr-checkbox'
6218
+ }, options?.map((record, key) => {
6219
+ const recordValue = record[valueName];
6220
+ return /*#__PURE__*/React__default.createElement("label", {
6221
+ key: key
6222
+ }, /*#__PURE__*/React__default.createElement("input", {
6223
+ type: 'checkbox',
6224
+ multiple: multiple,
6225
+ value: recordValue,
6226
+ checked: checked(recordValue),
6227
+ onChange: multiple ? e => {
6228
+ if (e.target.checked) {
6229
+ value.push(recordValue);
6230
+ } else {
6231
+ value.splice(value.indexOf(recordValue), 1);
6232
+ }
6233
+ this.setValue(value.length ? value : null);
6234
+ } : e => {
6235
+ this.setValue(e.target.checked ? recordValue : null);
6236
+ }
6237
+ }), record[labelName]);
6238
+ }));
6239
+ }
6240
+ }
6241
+
6242
+ export { JRAlert, JRButton, JRCheckbox, JRFields, JRFrame, JRSelect, JRSubmit, JRTable, JRTestReact, JRWindow };