jrs-react 1.2.5 → 1.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.html ADDED
@@ -0,0 +1,13 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>Vite + React</title>
8
+ </head>
9
+ <body style="background: black;color:gray;">
10
+ <div id="root"></div>
11
+ <script type="module" src="/src/main.jsx"></script>
12
+ </body>
13
+ </html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jrs-react",
3
- "version": "1.2.5",
3
+ "version": "1.2.7",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "module": "build/index.es.js",
@@ -8,19 +8,30 @@
8
8
  "test": "echo \"Error: no test specified\" && exit 1",
9
9
  "build": "rollup -c",
10
10
  "storybook": "storybook dev -p 6006",
11
- "build-storybook": "storybook build"
11
+ "build-storybook": "storybook build",
12
+ "vite": "vite"
12
13
  },
13
14
  "author": "JorenLai",
14
15
  "license": "MIT",
15
16
  "dependencies": {
17
+ "@eslint/js": "^9.21.0",
16
18
  "@rollup/plugin-commonjs": "^28.0.3",
17
19
  "@rollup/plugin-json": "^6.1.0",
20
+ "@types/react": "^19.0.10",
21
+ "@types/react-dom": "^19.0.4",
22
+ "@vitejs/plugin-react": "^4.3.4",
18
23
  "antd": "^5.12.5",
19
24
  "axios": "^1.6.2",
25
+ "eslint": "^9.21.0",
26
+ "eslint-plugin-react-hooks": "^5.1.0",
27
+ "eslint-plugin-react-refresh": "^0.4.19",
28
+ "globals": "^15.15.0",
20
29
  "react": "^18.2.0",
21
30
  "react-dom": "^18.2.0",
31
+ "react-router-dom": "^7.4.0",
22
32
  "rollup-plugin-node-resolve": "^5.2.0",
23
- "styled-components": "^6.1.15"
33
+ "styled-components": "^6.1.15",
34
+ "vite": "^6.2.0"
24
35
  },
25
36
  "devDependencies": {
26
37
  "@babel/core": "^7.26.10",
package/public/data.json CHANGED
@@ -1,7 +1,9 @@
1
1
  {
2
2
  "name":"Joren"
3
3
  ,"phone":[
4
- {"no":"0948272834","name":"中華電信"}
5
- ,{"no":"0987304555","name":"遠傳"}
4
+ {"phone":"0948272834","name":"中華電信"}
5
+ ,{"phone":"0987304555","name":"遠傳"}
6
6
  ]
7
+ ,"account":"jorenlai"
8
+ ,"email":"joren.lai@gmail.com"
7
9
  }
package/public/list.json CHANGED
@@ -1,6 +1,7 @@
1
1
  [
2
2
  {
3
3
  "name":"Joren"
4
+ ,"phone":"097459999"
4
5
  ,"address":{
5
6
  "no":"23"
6
7
  ,"street":"Jalan Indah"
@@ -9,6 +10,7 @@
9
10
  }
10
11
  ,{
11
12
  "name":"John"
13
+ ,"phone":"0124873737"
12
14
  ,"address":{
13
15
  "no":"36"
14
16
  ,"street":"景興路"
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
@@ -0,0 +1,8 @@
1
+ #root {
2
+
3
+ }
4
+
5
+ html,*,*:before,*:after {
6
+ box-sizing: border-box;
7
+ }
8
+
@@ -0,0 +1,17 @@
1
+ import { BrowserRouter, Route, Routes } from 'react-router-dom'
2
+ import './App.css'
3
+ import TableApp from './table/TableApp'
4
+ import FieldsApp from './fields/FieldsApp'
5
+ import WindowApp from './window/WindowApp'
6
+
7
+ function App() {
8
+ return <BrowserRouter>
9
+ <Routes>
10
+ <Route path="/table" element={<TableApp/>}/>
11
+ <Route path="/fields" element={<FieldsApp/>}/>
12
+ <Route path="/window" element={<WindowApp/>}/>
13
+ </Routes>
14
+ </BrowserRouter>
15
+ }
16
+
17
+ export default App
@@ -0,0 +1,12 @@
1
+
2
+ import JRFields from "../../components/JRFields/JRFields";
3
+ import JRText from "../../components/JRInput/JRText";
4
+ import JRTable from "../../components/JRTable/JRTable";
5
+ import { fieldsConfig } from "./fieldsConfig";
6
+
7
+
8
+ export default function FieldsApp() {
9
+ return <JRFields
10
+ {...fieldsConfig}
11
+ />
12
+ }
@@ -0,0 +1,137 @@
1
+ import { Input } from "antd";
2
+ import JRFields from "../../components/JRFields/JRFields";
3
+ import JRSelect from "../../components/JRInput/JRSelect";
4
+ import JRText from "../../components/JRInput/JRText";
5
+ import JRTable from "../../components/JRTable/JRTable";
6
+ import { po } from "../../components/JRUtils";
7
+
8
+ export const fieldsConfig={
9
+ popup:true
10
+ ,mask:true
11
+ ,width:'700px'
12
+ ,height:'500px'
13
+
14
+ ,get:{
15
+ url:'data.json'
16
+ ,autoRun:true
17
+ ,successMessage:'YES'
18
+ ,mask:'Loading'
19
+ }
20
+ ,style:{
21
+ padding:'18px'
22
+ ,background:'black'
23
+ ,gap:'20px'
24
+ }
25
+ ,typeStyle:{
26
+ padding:'8px'
27
+ ,background:'#eeeeee'
28
+ }
29
+ ,columns:[
30
+ {name:'name',label:'姓名',type:JRText}
31
+ ,{name:'birthday',label:'生日',type:Input}
32
+ ,{name:'phone',label:'電話號碼',type:JRTable
33
+ ,top({setStyle}){
34
+ return <>
35
+ <button
36
+ onClick={()=>{
37
+ this.get()
38
+ }}
39
+ >Get</button>
40
+ <button
41
+ onClick={()=>{
42
+ this.reset()
43
+ }}
44
+ >Reset</button>
45
+ </>
46
+ }
47
+ ,bottom({setStyle}){
48
+ setStyle({color:'green',border:'1px solid green',height:'140px',overflow: 'overlay'})
49
+ return<div style={{
50
+ display: 'flex'
51
+ ,justifyContent: 'space-around'
52
+ }}>
53
+ <pre style={{flex:1}}>
54
+ {JSON.stringify(this.getValue(),4,4)}
55
+ </pre>
56
+ <pre style={{flex:1}}>
57
+ {JSON.stringify(this.rawValue,4,4)}
58
+ </pre>
59
+ </div>
60
+ }
61
+ ,get:{
62
+ url:'list.json'
63
+ }
64
+ ,colSpan:2
65
+ ,resizableColumns:true
66
+ ,typeStyle:{
67
+ height:'300px'
68
+ }
69
+ ,columns:[
70
+ {name:'name',label:'電信公司'}
71
+ ,{name:'phone',label:'號碼',type:JRText}
72
+ ,{
73
+ name:'address'
74
+ ,label:'地址'
75
+ ,type:JRFields
76
+ ,labelProps:{
77
+ width:'min-content'
78
+ ,style:{
79
+ paddingLeft:'20px'
80
+ }
81
+ }
82
+ ,columns:[
83
+ {name:'no',label:'門牌',type:JRText}
84
+ ,{name:'street',label:'街',type:JRText}
85
+ ,{name:'country',label:'國家',type:JRSelect}
86
+ ,{name:'p',label:'郵區',type:JRText}
87
+ ]
88
+ ,cols:4
89
+ }
90
+ ]
91
+ }
92
+ // ,{
93
+ // name:'address'
94
+ // ,label:'地址'
95
+ // ,type:JRFields
96
+ // ,colSpan:2
97
+ // ,columns:[
98
+ // {name:'no',label:'號碼',type:JRText}
99
+ // ,{name:'street',label:'街',type:JRText}
100
+ // ,{name:'country',label:'國家',type:JRText}
101
+ // ]
102
+ // ,cols:1
103
+ // }
104
+ // ,{name:'email',label:'電子郵件',type:JRText}
105
+ // ,{name:'account',label:'帳號'}
106
+ ]
107
+ ,cols:2
108
+ ,right({setStyle}){
109
+ setStyle({color:'green',border:'1px solid green',width:'100px',whiteSpace:'pre',overflow: 'overlay'})
110
+ return <>
111
+ <button
112
+ onClick={()=>{
113
+ this.get()
114
+ }}
115
+ >Get</button>
116
+ <button
117
+ onClick={()=>{
118
+ this.reset()
119
+ }}
120
+ >Reset</button>
121
+ </>
122
+ }
123
+ ,bottom({setStyle}){
124
+ setStyle({color:'gray',border:'1px solid blue',whiteSpace:'pre',overflow: 'overlay'})
125
+ return <div style={{
126
+ display: 'flex'
127
+ ,justifyContent: 'space-around'
128
+ }}>
129
+ <pre>
130
+ {JSON.stringify(this.getValue(),4,4)}
131
+ </pre>
132
+ <pre>
133
+ {JSON.stringify(this.rawValue,4,4)}
134
+ </pre>
135
+ </div>
136
+ }
137
+ }
@@ -0,0 +1,42 @@
1
+ :root {
2
+
3
+ }
4
+
5
+ a {
6
+ font-weight: 500;
7
+ color: #646cff;
8
+ text-decoration: inherit;
9
+ }
10
+ a:hover {
11
+ color: #535bf2;
12
+ }
13
+
14
+ body {
15
+ }
16
+
17
+ h1 {
18
+ line-height: 1.1;
19
+ }
20
+
21
+ button {
22
+ }
23
+ button:hover {
24
+ border-color: #646cff;
25
+ }
26
+ button:focus,
27
+ button:focus-visible {
28
+ outline: 4px auto -webkit-focus-ring-color;
29
+ }
30
+
31
+ @media (prefers-color-scheme: light) {
32
+ :root {
33
+ color: #213547;
34
+ background-color: #ffffff;
35
+ }
36
+ a:hover {
37
+ color: #747bff;
38
+ }
39
+ button {
40
+ background-color: #f9f9f9;
41
+ }
42
+ }
@@ -0,0 +1,10 @@
1
+ import JRFields from "../../components/JRFields/JRFields";
2
+ import JRText from "../../components/JRInput/JRText";
3
+ import JRTable from "../../components/JRTable/JRTable";
4
+ import { tableConfig } from "./tableConfig";
5
+
6
+ export default function TableApp() {
7
+ return <JRTable
8
+ {...tableConfig}
9
+ />
10
+ }
@@ -0,0 +1,86 @@
1
+ import JRText from "../../components/JRInput/JRText";
2
+
3
+ export const tableConfig={
4
+ popup:true
5
+ ,height:500
6
+ ,width:600
7
+ ,get:{
8
+ url:'list.json'
9
+ ,autoRun:true
10
+ ,successMessage:'YES'
11
+ ,mask:'Loading'
12
+ }
13
+ ,columns:[
14
+ {name:'Test',label:'1'
15
+ ,rowSpan:4
16
+ ,columns:[
17
+ {name:'Test21',label:'1_1'
18
+ ,columns:[
19
+ {name:'Test21',label:'1_1_1',xdescribewidth:'20%'}
20
+ ,{name:'Test21',label:'1_1_2',xwidth:'20%'}
21
+ ,{name:'Test21',label:'1_1_3',xwidth:'20%'}
22
+ ]
23
+
24
+ }
25
+ ,{name:'Test22',label:'1_2',xwidth:'30%'}
26
+ ,{name:'Test22',label:'1_3',xwidth:'30%'}
27
+ ]
28
+ }
29
+
30
+ ,{name:'Test2',label:'2'
31
+ ,columns:[
32
+ {name:'Test21',label:'2_1'}
33
+ ,{name:'Test21',label:'2_2'
34
+ ,rowSpan:4
35
+ ,columns:[
36
+ {name:'Test21',label:'2_2_1'}
37
+ ,{name:'Test21',label:'2_2_2'}
38
+ ]
39
+ }
40
+ ]
41
+ }
42
+
43
+ ,{name:'Test',label:'3'
44
+ ,columns:[
45
+ {name:'Test21',label:'3_1'}
46
+ ,{name:'Test22',label:'3_2'}
47
+ ,{name:'Test22',label:'3_3'
48
+ ,columns:[
49
+ {name:'Test21',label:'3_3_1'}
50
+ ,{name:'Test21',label:'3_3_2'
51
+ ,columns:[
52
+ {name:'Test21',label:'3_3_2_1'}
53
+ ,{name:'Test21',label:'3_3_2_2'
54
+ ,columns:[
55
+ {name:'Test21',label:'3_3_2_2_1'
56
+ ,columns:[
57
+ {name:'Test21',label:'3_3_2_2_1_1'}
58
+ ]
59
+ }
60
+ ]
61
+ }
62
+ ]
63
+ }
64
+ ]
65
+
66
+ }
67
+ ]
68
+ }
69
+
70
+ ,{name:'Test2',label:'4'
71
+ ,columns:[
72
+ {name:'Test21',label:'4_1'}
73
+ ,{name:'Test21',label:'4_2'
74
+ ,columns:[
75
+ {name:'Test21',label:'4_2_1'}
76
+ ]
77
+ }
78
+ ]
79
+ }
80
+ ,{name:'Test2',label:'5'}
81
+ // ,{name:'Test2',label:'6'}
82
+ // ,{name:'Test2',label:'7'}
83
+ // ,{name:'Test2',label:'8'}
84
+ ]
85
+ ,resizableColumns:true
86
+ }
@@ -0,0 +1,84 @@
1
+ import JRWindow from "../../components/JRWindow/JRWindow";
2
+ import JRTable from "../../components/JRTable/JRTable";
3
+ import JRFields from "../../components/JRFields/JRFields";
4
+ import JRText from "../../components/JRInput/JRText";
5
+ import { po } from "../../components/JRUtils";
6
+
7
+ export default function WindowApp() {
8
+ return <>
9
+ <JRTable
10
+ title={function(){
11
+ return `共: ${this.getValue()?.length ??0 }筆`
12
+ }}
13
+ width={800}
14
+ // popup={true}
15
+ xxx={0}
16
+ xy={0}
17
+ get={{
18
+ url:'list.json'
19
+ ,autoRun:true
20
+ }}
21
+ columns={[
22
+ {name:'name',label:'姓名'}
23
+ ,{name:'birthday',label:'生日',type:JRText}
24
+ ]}
25
+ resizableColumns={true}
26
+ />
27
+ .<br/>.<br/>.<br/>.<br/>.<br/>.<br/>.<br/>.<br/>.<br/>.<br/>.<br/>.<br/>.<br/>.<br/>.<br/>.<br/>.<br/>.<br/>.<br/>.<br/>.<br/>.<br/>.<br/>.<br/>.<br/>.<br/>.<br/>.<br/>.<br/>.<br/>.<br/>.<br/>.<br/>.<br/>.<br/>.<br/>.<br/>.<br/>
28
+
29
+ <JRFields
30
+ title={function(){
31
+ return 'JRFields'//this.getValue()?.name
32
+ }}
33
+ width={480}
34
+ height={480}
35
+ popup={true}
36
+ get={{
37
+ url:'data.json'
38
+ ,mask:'Loading'
39
+ }}
40
+ columns={[
41
+ {name:'name',label:'姓名',type:JRText}
42
+ ,{name:'email',label:'E-mail',type:JRText}
43
+ ]}
44
+ bottom={function(){
45
+ return <>
46
+ <button
47
+ onClick={()=>{
48
+ this.get()
49
+ }}
50
+ >Get</button>
51
+ <button
52
+ onClick={()=>{
53
+ this.reset()
54
+ }}
55
+ >Reset</button>
56
+ <button
57
+ onClick={()=>{
58
+ this.setValue(null,true)
59
+ }}
60
+ >Clear</button>
61
+ </>
62
+ }}
63
+ />
64
+
65
+ {/* <JRWindow
66
+ title={'JRWindow'}
67
+ width={180}
68
+ height={180}
69
+ popup={true}
70
+ get={{
71
+ url:'data.json'
72
+ ,autoRun:true
73
+ }}
74
+ columns={[
75
+ {name:'name',label:'姓名'}
76
+ ]}
77
+ bottom={()=>{
78
+ return <button>Get</button>
79
+ }}
80
+ >
81
+ JRWindow
82
+ </JRWindow> */}
83
+ </>
84
+ }
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="35.93" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 228"><path fill="#00D8FF" d="M210.483 73.824a171.49 171.49 0 0 0-8.24-2.597c.465-1.9.893-3.777 1.273-5.621c6.238-30.281 2.16-54.676-11.769-62.708c-13.355-7.7-35.196.329-57.254 19.526a171.23 171.23 0 0 0-6.375 5.848a155.866 155.866 0 0 0-4.241-3.917C100.759 3.829 77.587-4.822 63.673 3.233C50.33 10.957 46.379 33.89 51.995 62.588a170.974 170.974 0 0 0 1.892 8.48c-3.28.932-6.445 1.924-9.474 2.98C17.309 83.498 0 98.307 0 113.668c0 15.865 18.582 31.778 46.812 41.427a145.52 145.52 0 0 0 6.921 2.165a167.467 167.467 0 0 0-2.01 9.138c-5.354 28.2-1.173 50.591 12.134 58.266c13.744 7.926 36.812-.22 59.273-19.855a145.567 145.567 0 0 0 5.342-4.923a168.064 168.064 0 0 0 6.92 6.314c21.758 18.722 43.246 26.282 56.54 18.586c13.731-7.949 18.194-32.003 12.4-61.268a145.016 145.016 0 0 0-1.535-6.842c1.62-.48 3.21-.974 4.76-1.488c29.348-9.723 48.443-25.443 48.443-41.52c0-15.417-17.868-30.326-45.517-39.844Zm-6.365 70.984c-1.4.463-2.836.91-4.3 1.345c-3.24-10.257-7.612-21.163-12.963-32.432c5.106-11 9.31-21.767 12.459-31.957c2.619.758 5.16 1.557 7.61 2.4c23.69 8.156 38.14 20.213 38.14 29.504c0 9.896-15.606 22.743-40.946 31.14Zm-10.514 20.834c2.562 12.94 2.927 24.64 1.23 33.787c-1.524 8.219-4.59 13.698-8.382 15.893c-8.067 4.67-25.32-1.4-43.927-17.412a156.726 156.726 0 0 1-6.437-5.87c7.214-7.889 14.423-17.06 21.459-27.246c12.376-1.098 24.068-2.894 34.671-5.345a134.17 134.17 0 0 1 1.386 6.193ZM87.276 214.515c-7.882 2.783-14.16 2.863-17.955.675c-8.075-4.657-11.432-22.636-6.853-46.752a156.923 156.923 0 0 1 1.869-8.499c10.486 2.32 22.093 3.988 34.498 4.994c7.084 9.967 14.501 19.128 21.976 27.15a134.668 134.668 0 0 1-4.877 4.492c-9.933 8.682-19.886 14.842-28.658 17.94ZM50.35 144.747c-12.483-4.267-22.792-9.812-29.858-15.863c-6.35-5.437-9.555-10.836-9.555-15.216c0-9.322 13.897-21.212 37.076-29.293c2.813-.98 5.757-1.905 8.812-2.773c3.204 10.42 7.406 21.315 12.477 32.332c-5.137 11.18-9.399 22.249-12.634 32.792a134.718 134.718 0 0 1-6.318-1.979Zm12.378-84.26c-4.811-24.587-1.616-43.134 6.425-47.789c8.564-4.958 27.502 2.111 47.463 19.835a144.318 144.318 0 0 1 3.841 3.545c-7.438 7.987-14.787 17.08-21.808 26.988c-12.04 1.116-23.565 2.908-34.161 5.309a160.342 160.342 0 0 1-1.76-7.887Zm110.427 27.268a347.8 347.8 0 0 0-7.785-12.803c8.168 1.033 15.994 2.404 23.343 4.08c-2.206 7.072-4.956 14.465-8.193 22.045a381.151 381.151 0 0 0-7.365-13.322Zm-45.032-43.861c5.044 5.465 10.096 11.566 15.065 18.186a322.04 322.04 0 0 0-30.257-.006c4.974-6.559 10.069-12.652 15.192-18.18ZM82.802 87.83a323.167 323.167 0 0 0-7.227 13.238c-3.184-7.553-5.909-14.98-8.134-22.152c7.304-1.634 15.093-2.97 23.209-3.984a321.524 321.524 0 0 0-7.848 12.897Zm8.081 65.352c-8.385-.936-16.291-2.203-23.593-3.793c2.26-7.3 5.045-14.885 8.298-22.6a321.187 321.187 0 0 0 7.257 13.246c2.594 4.48 5.28 8.868 8.038 13.147Zm37.542 31.03c-5.184-5.592-10.354-11.779-15.403-18.433c4.902.192 9.899.29 14.978.29c5.218 0 10.376-.117 15.453-.343c-4.985 6.774-10.018 12.97-15.028 18.486Zm52.198-57.817c3.422 7.8 6.306 15.345 8.596 22.52c-7.422 1.694-15.436 3.058-23.88 4.071a382.417 382.417 0 0 0 7.859-13.026a347.403 347.403 0 0 0 7.425-13.565Zm-16.898 8.101a358.557 358.557 0 0 1-12.281 19.815a329.4 329.4 0 0 1-23.444.823c-7.967 0-15.716-.248-23.178-.732a310.202 310.202 0 0 1-12.513-19.846h.001a307.41 307.41 0 0 1-10.923-20.627a310.278 310.278 0 0 1 10.89-20.637l-.001.001a307.318 307.318 0 0 1 12.413-19.761c7.613-.576 15.42-.876 23.31-.876H128c7.926 0 15.743.303 23.354.883a329.357 329.357 0 0 1 12.335 19.695a358.489 358.489 0 0 1 11.036 20.54a329.472 329.472 0 0 1-11 20.722Zm22.56-122.124c8.572 4.944 11.906 24.881 6.52 51.026c-.344 1.668-.73 3.367-1.15 5.09c-10.622-2.452-22.155-4.275-34.23-5.408c-7.034-10.017-14.323-19.124-21.64-27.008a160.789 160.789 0 0 1 5.888-5.4c18.9-16.447 36.564-22.941 44.612-18.3ZM128 90.808c12.625 0 22.86 10.235 22.86 22.86s-10.235 22.86-22.86 22.86s-22.86-10.235-22.86-22.86s10.235-22.86 22.86-22.86Z"></path></svg>
@@ -3,6 +3,7 @@ import React from "react";
3
3
  import { flexType, po } from "../JRUtils";
4
4
  import JRFrame from "../JRFrame/JRFrame";
5
5
  import {StyleJRFields} from "./StyleJRFields"
6
+ import JRWindow from "../JRWindow/JRWindow";
6
7
 
7
8
  function checkMap(_name,inputValue,mapValue,nameList){
8
9
  if(nameList.length) {
@@ -48,7 +49,7 @@ const StyledColumn=styled.div`
48
49
  }
49
50
  }}
50
51
  `
51
- const StyledColumnLabel=styled.label`
52
+ const StyledColumnLabel=styled.div`
52
53
  ${({$layout})=>{
53
54
  if($layout=='v'){
54
55
  return `text-align: start;`
@@ -157,7 +158,7 @@ const maxValidator=({value,max})=>{
157
158
 
158
159
 
159
160
 
160
- export default class JRFields extends JRFrame {
161
+ export default class JRFields extends JRWindow {
161
162
  UNSAFE_componentWillMount(){
162
163
  this.#initValidateValue()
163
164
 
@@ -275,18 +276,14 @@ export default class JRFields extends JRFrame {
275
276
  ,fullname
276
277
  ){
277
278
  const value=name?parentValue?.[name]:parentValue
278
-
279
279
  const gap=column.gap??this.props.gap
280
280
  const label=column.label
281
281
  const _style=flexType(style,this,{},{})
282
282
  if (colSpan) _style.gridColumn = `span ${colSpan}`
283
283
  if (rowSpan) _style.gridRow = `span ${rowSpan}`
284
284
 
285
-
286
285
  let content
287
-
288
286
  const validators=this.createValidator({required,column})
289
-
290
287
  const fn=fullname.join('.')
291
288
  const onChange=(inputValue)=>{
292
289
  const targetValue=inputValue?.target?.value ?? inputValue
@@ -349,6 +346,7 @@ export default class JRFields extends JRFrame {
349
346
  </StyledColumnValue>
350
347
  }
351
348
  const layout=column.labelProps?.layout===undefined ? this.props.labelProps?.layout: column.labelProps?.layout
349
+ const labelStyle=column.labelProps?.style ?? this.props.labelProps?.style ?? {}
352
350
  return <StyledColumn
353
351
  $layout={layout}
354
352
  $hasLabel={label!=null }
@@ -361,6 +359,7 @@ export default class JRFields extends JRFrame {
361
359
  {
362
360
  label!=null
363
361
  && <StyledColumnLabel
362
+ style={labelStyle}
364
363
  $required={required}
365
364
  className={'label'}
366
365
  $layout={layout}
@@ -8,7 +8,8 @@ export const StyleJRFields=styled.main`
8
8
  flex-direction: column;
9
9
  flex:1;
10
10
  overflow: overlay;
11
-
11
+ padding: 10px;
12
+
12
13
  color:#525252;
13
14
 
14
15
  >.jr-grid{
@@ -2,7 +2,7 @@ import React from "react";
2
2
  import styled from "styled-components";
3
3
  import JRSubmit from "../JRSubmit";
4
4
 
5
- const FreeType=({tag:Tag,config,me,className})=>{
5
+ export const FreeType=({tag:Tag,config,me,className})=>{
6
6
  if(typeof config==='function'){
7
7
  let style
8
8
  const setStyle=function(_style){
@@ -10,7 +10,10 @@ const FreeType=({tag:Tag,config,me,className})=>{
10
10
  }
11
11
  const content=config.bind(me)({setStyle})
12
12
  return <Tag className={className} style={style}>{content}</Tag>
13
+ }else if(typeof config==='string'){
14
+ return <Tag className={className}>{config}</Tag>
13
15
  }
16
+
14
17
  }
15
18
 
16
19
  const StyledJRFrame=styled.div`
@@ -28,7 +31,7 @@ const StyledJRFrame=styled.div`
28
31
  flex-direction: column;
29
32
  > *{
30
33
  XXborder:1px solid gray;
31
- min-height:30px;
34
+ XXmin-height:30px;
32
35
  }
33
36
 
34
37
  >header{
@@ -57,7 +60,7 @@ export default class JRFrame extends JRSubmit {
57
60
  <FreeType tag='header' config={this.props.top} me={this}/>
58
61
  <main>
59
62
  <FreeType tag='div' config={this.props.left} me={this} className={'left'}/>
60
- {this.renderMe()}
63
+ {this.renderMe?.() ?? this.props.children}
61
64
  <FreeType tag='div' config={this.props.right} me={this} className={'right'}/>
62
65
  </main>
63
66
  <FreeType tag='footer' config={this.props.bottom} me={this}/>
@@ -65,8 +68,8 @@ export default class JRFrame extends JRSubmit {
65
68
  <FreeType tag='div' config={this.props.end} me={this} className={'end'}/>
66
69
  </StyledJRFrame>
67
70
  }
68
- renderMe(){
69
- return <div style={{flex:1}}>Render me</div>
70
- }
71
+ // renderMe(){
72
+ // return <div style={{flex:1}}>Render me</div>
73
+ // }
71
74
  }
72
75
 
@@ -0,0 +1,19 @@
1
+ import React from "react";
2
+ import { po } from "../JRUtils";
3
+ import JRInput from "./JRInput";
4
+
5
+ export default class JRSelect extends JRInput{
6
+ input(){
7
+ return <select value={this.props.value}
8
+ style={{
9
+ height: '30px'
10
+ ,width: '100%'
11
+ }}
12
+ onChange={(e)=>{
13
+ this.setValue(e.target.value)
14
+ }}
15
+ >
16
+ <option value={1}>A</option>
17
+ </select>
18
+ }
19
+ }
@@ -1,10 +1,9 @@
1
1
  import React from "react";
2
- import { po } from "../JRUtils";
3
2
  import JRInput from "./JRInput";
4
3
 
5
4
  export default class JRText extends JRInput{
6
5
  input(){
7
- return <input value={this.props.value}
6
+ return <input value={this.props.value??''}
8
7
  style={{
9
8
  height: '24px'
10
9
  ,width: '100%'