amotify 0.0.59 → 0.0.62
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/@types/_.tsx +5 -5
- package/@types/amot.tsx +11 -11
- package/@types/fn.tsx +14 -1
- package/@types/module.tsx +1 -1
- package/dist/amotify.js +1 -1
- package/dist/amotify.min.css +3 -3
- package/package.json +1 -1
- package/src/@atoms.tsx +3 -3
- package/src/@functions.tsx +11 -11
- package/src/@global.tsx +40 -40
- package/src/@jsminAmotifyExtension/_.tsx +4 -4
- package/src/@jsminAmotifyExtension/fetch.tsx +30 -30
- package/src/@jsminAmotifyExtension/formCollect.tsx +32 -32
- package/src/@jsminAmotifyExtension/spreadSheet.tsx +71 -71
- package/src/@jsminAmotifyExtension/variables.tsx +38 -38
- package/src/@molecules.tsx +6 -6
- package/src/@styles/props.scss +1 -1
- package/src/@styles/var.scss +0 -1
- package/src/@templates.tsx +1 -1
- package/src/@variables.tsx +2 -2
- package/src/atoms/FAI/parts.tsx +105 -105
- package/src/atoms/Logo/parts.tsx +19 -19
- package/src/atoms/Various/parts.tsx +26 -26
- package/src/config.tsx +62 -59
- package/src/functions/Button/_.tsx +49 -49
- package/src/functions/Cropper/parts.tsx +249 -249
- package/src/functions/Effects/Fade.tsx +18 -18
- package/src/functions/Effects/Ripple.tsx +24 -24
- package/src/functions/Effects/_.tsx +5 -5
- package/src/functions/Input/Chips/Selector.tsx +107 -107
- package/src/functions/Input/Chips/_.tsx +66 -66
- package/src/functions/Input/Contenteditable.tsx +18 -18
- package/src/functions/Input/DigitCharacters.tsx +48 -48
- package/src/functions/Input/File/_.tsx +114 -114
- package/src/functions/Input/Hidden.tsx +3 -3
- package/src/functions/Input/List/_.tsx +61 -61
- package/src/functions/Input/RichSelect/_.tsx +38 -38
- package/src/functions/Input/Segmented/_.tsx +30 -30
- package/src/functions/Input/Select/_.tsx +42 -42
- package/src/functions/Input/Slider/_.tsx +93 -93
- package/src/functions/Input/Switch/_.tsx +21 -21
- package/src/functions/Input/Text.tsx +99 -97
- package/src/functions/Input/TextArea.tsx +17 -17
- package/src/functions/Input/Time/Picker.tsx +199 -199
- package/src/functions/Input/Time/_.tsx +173 -173
- package/src/functions/Input/_.tsx +135 -135
- package/src/functions/Input/core.tsx +96 -96
- package/src/functions/Inputs/_.tsx +1 -1
- package/src/functions/Inputs/text.tsx +5 -5
- package/src/functions/Layout/PageNotFound.tsx +6 -6
- package/src/functions/Layout/PageRouter.tsx +28 -44
- package/src/functions/Layout/PageViewController/parts.tsx +7 -7
- package/src/functions/Layout/Plate.tsx +5 -5
- package/src/functions/Layout/RootViewController/parts.tsx +94 -71
- package/src/functions/Layout/RootViewController/style.module.scss +0 -1
- package/src/functions/Layout/SwipeView/parts.tsx +90 -90
- package/src/functions/Layout/TabBar.tsx +10 -10
- package/src/functions/Layout/_.tsx +7 -7
- package/src/functions/Loader/corner.tsx +10 -10
- package/src/functions/Loader/mini.tsx +25 -25
- package/src/functions/Loader/parts.tsx +31 -31
- package/src/functions/Loader/top.tsx +10 -10
- package/src/functions/Sheet/parts.tsx +219 -219
- package/src/functions/Sheet/style.module.scss +0 -20
- package/src/functions/SnackBar/parts.tsx +50 -50
- package/src/functions/Table/Data/parts.tsx +202 -202
- package/src/functions/Table/Drag/parts.tsx +76 -76
- package/src/functions/Table/Normal/parts.tsx +23 -23
- package/src/functions/Table/_.tsx +33 -33
- package/src/functions/Tooltips/parts.tsx +7 -7
- package/src/global/LaunchReactApplication.tsx +28 -28
- package/src/global/styleConverter.tsx +133 -133
- package/src/launch.tsx +27 -27
- package/src/molecules/Accordion/parts.tsx +41 -41
- package/src/molecules/LinkifyText/parts.tsx +18 -18
- package/src/molecules/List.tsx +6 -6
- package/src/preload.tsx +5 -45
- package/src/templates/PlayGround/parts.tsx +8 -8
- package/webpack.config.js +9 -9
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useStore,
|
|
3
3
|
React
|
|
4
|
-
} from '@global'
|
|
4
|
+
} from '@global'
|
|
5
5
|
import {
|
|
6
6
|
FAI
|
|
7
|
-
} from '@atoms'
|
|
7
|
+
} from '@atoms'
|
|
8
8
|
import {
|
|
9
9
|
Buttons,
|
|
10
10
|
Tooltips,
|
|
11
|
-
} from '@fn'
|
|
11
|
+
} from '@fn'
|
|
12
12
|
|
|
13
13
|
import {
|
|
14
14
|
Comps,
|
|
15
15
|
DefaultCellSystemStyles
|
|
16
|
-
} from '../_'
|
|
16
|
+
} from '../_'
|
|
17
17
|
|
|
18
|
-
import { faGripVertical } from '@fortawesome/free-solid-svg-icons/faGripVertical'
|
|
18
|
+
import { faGripVertical } from '@fortawesome/free-solid-svg-icons/faGripVertical'
|
|
19
19
|
|
|
20
|
-
import style from '../style.module.scss'
|
|
20
|
+
import style from '../style.module.scss'
|
|
21
21
|
|
|
22
22
|
const HeadRow: React.FC<amotify.fn.Tables.Drag.Params> = ( props ) => {
|
|
23
23
|
let {
|
|
@@ -27,16 +27,16 @@ const HeadRow: React.FC<amotify.fn.Tables.Drag.Params> = ( props ) => {
|
|
|
27
27
|
colLength,
|
|
28
28
|
head,
|
|
29
29
|
rows
|
|
30
|
-
} = props
|
|
30
|
+
} = props
|
|
31
31
|
|
|
32
|
-
if ( !head ) return null
|
|
32
|
+
if ( !head ) return null
|
|
33
33
|
|
|
34
|
-
let Cols = []
|
|
34
|
+
let Cols = []
|
|
35
35
|
|
|
36
36
|
for ( let colIndex = 0; colIndex < colLength; colIndex++ ) {
|
|
37
|
-
let col = head[ colIndex ]
|
|
37
|
+
let col = head[ colIndex ]
|
|
38
38
|
|
|
39
|
-
let Cell = Comps[ col.type == 'th' ? 'TH' : 'TD' ]
|
|
39
|
+
let Cell = Comps[ col.type == 'th' ? 'TH' : 'TD' ]
|
|
40
40
|
Cols.push( <Cell
|
|
41
41
|
{ ...cellStyles }
|
|
42
42
|
{ ...DefaultCellSystemStyles( {
|
|
@@ -61,13 +61,13 @@ const HeadRow: React.FC<amotify.fn.Tables.Drag.Params> = ( props ) => {
|
|
|
61
61
|
col.className,
|
|
62
62
|
].join( ' ' ) }
|
|
63
63
|
{ ...col }
|
|
64
|
-
/> )
|
|
64
|
+
/> )
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
return <Comps.Row
|
|
68
68
|
className={ [ style.Row,style.HeadRow ].join( ' ' ) }
|
|
69
69
|
children={ Cols }
|
|
70
|
-
|
|
70
|
+
/>
|
|
71
71
|
}
|
|
72
72
|
const BodyRows: React.FC<amotify.fn.Tables.Drag.Params> = ( props ) => {
|
|
73
73
|
let {
|
|
@@ -78,19 +78,19 @@ const BodyRows: React.FC<amotify.fn.Tables.Drag.Params> = ( props ) => {
|
|
|
78
78
|
rows,
|
|
79
79
|
colLength,
|
|
80
80
|
onOrderChanged
|
|
81
|
-
} = props
|
|
81
|
+
} = props
|
|
82
82
|
|
|
83
|
-
let [ val_componentID ] = React.useState( $.uuidGen() )
|
|
83
|
+
let [ val_componentID ] = React.useState( $.uuidGen() )
|
|
84
84
|
let [ val_info,set_info ] = React.useState( {
|
|
85
85
|
rows: rows,
|
|
86
86
|
origin: 0,
|
|
87
87
|
to: NaN
|
|
88
|
-
} )
|
|
88
|
+
} )
|
|
89
89
|
|
|
90
|
-
let BodyRows: ReactElement[] = []
|
|
90
|
+
let BodyRows: ReactElement[] = []
|
|
91
91
|
|
|
92
92
|
val_info.rows.forEach( ( cols,rowIndex ) => {
|
|
93
|
-
let Cols: ReactElement[] = []
|
|
93
|
+
let Cols: ReactElement[] = []
|
|
94
94
|
{
|
|
95
95
|
Cols.push( <Comps.TH
|
|
96
96
|
key={ 'DragOrigin' }
|
|
@@ -132,7 +132,7 @@ const BodyRows: React.FC<amotify.fn.Tables.Drag.Params> = ( props ) => {
|
|
|
132
132
|
index: rowIndex,
|
|
133
133
|
rows: val_info.rows,
|
|
134
134
|
maxLength: rows.length
|
|
135
|
-
} )
|
|
135
|
+
} )
|
|
136
136
|
} }
|
|
137
137
|
onTouchStart={ ( event ) => {
|
|
138
138
|
EffectStart( event,{
|
|
@@ -140,18 +140,18 @@ const BodyRows: React.FC<amotify.fn.Tables.Drag.Params> = ( props ) => {
|
|
|
140
140
|
index: rowIndex,
|
|
141
141
|
rows: val_info.rows,
|
|
142
142
|
maxLength: rows.length
|
|
143
|
-
} )
|
|
143
|
+
} )
|
|
144
144
|
} }
|
|
145
145
|
>
|
|
146
146
|
<FAI icon={ faGripVertical } />
|
|
147
147
|
</Buttons.Button.Clear.R>
|
|
148
|
-
</Comps.TH> )
|
|
148
|
+
</Comps.TH> )
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
cols.forEach( ( col,colIndex ) => {
|
|
152
152
|
col = { ...col as any }
|
|
153
153
|
|
|
154
|
-
let Cell = Comps[ col.type == 'th' ? 'TH' : 'TD' ]
|
|
154
|
+
let Cell = Comps[ col.type == 'th' ? 'TH' : 'TD' ]
|
|
155
155
|
Cols.push( <Cell
|
|
156
156
|
{ ...cellStyles }
|
|
157
157
|
{ ...DefaultCellSystemStyles( {
|
|
@@ -176,8 +176,8 @@ const BodyRows: React.FC<amotify.fn.Tables.Drag.Params> = ( props ) => {
|
|
|
176
176
|
col.className,
|
|
177
177
|
].join( ' ' ) }
|
|
178
178
|
{ ...col }
|
|
179
|
-
/> )
|
|
180
|
-
} )
|
|
179
|
+
/> )
|
|
180
|
+
} )
|
|
181
181
|
|
|
182
182
|
BodyRows.push( <Comps.Row
|
|
183
183
|
key={ rowIndex }
|
|
@@ -185,15 +185,15 @@ const BodyRows: React.FC<amotify.fn.Tables.Drag.Params> = ( props ) => {
|
|
|
185
185
|
data-rowId={ rowIndex }
|
|
186
186
|
className={ [ style.Row,style.BodyRow ].join( ' ' ) }
|
|
187
187
|
children={ Cols }
|
|
188
|
-
/> )
|
|
189
|
-
} )
|
|
188
|
+
/> )
|
|
189
|
+
} )
|
|
190
190
|
|
|
191
191
|
if ( !isNaN( val_info.to ) ) {
|
|
192
192
|
let {
|
|
193
193
|
origin,
|
|
194
194
|
to
|
|
195
|
-
} = val_info
|
|
196
|
-
let Cols = []
|
|
195
|
+
} = val_info
|
|
196
|
+
let Cols = []
|
|
197
197
|
Cols.push( <Comps.TH
|
|
198
198
|
key={ 'dragButton' }
|
|
199
199
|
backgroundColor='tcOpLow'
|
|
@@ -208,13 +208,13 @@ const BodyRows: React.FC<amotify.fn.Tables.Drag.Params> = ( props ) => {
|
|
|
208
208
|
<FAI.ArrowRight
|
|
209
209
|
fontColor='theme'
|
|
210
210
|
/>
|
|
211
|
-
</Comps.TH> )
|
|
211
|
+
</Comps.TH> )
|
|
212
212
|
|
|
213
|
-
let cols = val_info.rows[ origin ]
|
|
213
|
+
let cols = val_info.rows[ origin ]
|
|
214
214
|
cols.forEach( ( col,colIndex ) => {
|
|
215
215
|
col = { ...col as any }
|
|
216
216
|
|
|
217
|
-
let Cell = Comps[ col.type == 'th' ? 'TH' : 'TD' ]
|
|
217
|
+
let Cell = Comps[ col.type == 'th' ? 'TH' : 'TD' ]
|
|
218
218
|
Cols.push( <Cell
|
|
219
219
|
{ ...cellStyles }
|
|
220
220
|
{ ...DefaultCellSystemStyles( {
|
|
@@ -240,8 +240,8 @@ const BodyRows: React.FC<amotify.fn.Tables.Drag.Params> = ( props ) => {
|
|
|
240
240
|
].join( ' ' ) }
|
|
241
241
|
backgroundColor='tcOpLow'
|
|
242
242
|
{ ...col }
|
|
243
|
-
/> )
|
|
244
|
-
} )
|
|
243
|
+
/> )
|
|
244
|
+
} )
|
|
245
245
|
|
|
246
246
|
BodyRows.splice( to,0,<Comps.Row
|
|
247
247
|
key={ 'preSet' }
|
|
@@ -256,19 +256,19 @@ const BodyRows: React.FC<amotify.fn.Tables.Drag.Params> = ( props ) => {
|
|
|
256
256
|
value: {
|
|
257
257
|
swap: ( rowIndex: number,insertIndex: number ) => {
|
|
258
258
|
if ( insertIndex || insertIndex == 0 ) {
|
|
259
|
-
let targetRow = val_info.rows[ rowIndex ]
|
|
259
|
+
let targetRow = val_info.rows[ rowIndex ]
|
|
260
260
|
|
|
261
|
-
let newRows = [ ...val_info.rows ]
|
|
262
|
-
newRows.splice( rowIndex,1 )
|
|
263
|
-
newRows.splice( insertIndex - ( rowIndex < insertIndex ? 1 : 0 ),0,targetRow )
|
|
261
|
+
let newRows = [ ...val_info.rows ]
|
|
262
|
+
newRows.splice( rowIndex,1 )
|
|
263
|
+
newRows.splice( insertIndex - ( rowIndex < insertIndex ? 1 : 0 ),0,targetRow )
|
|
264
264
|
|
|
265
265
|
set_info( {
|
|
266
266
|
rows: newRows,
|
|
267
267
|
origin: 0,
|
|
268
268
|
to: NaN
|
|
269
|
-
} )
|
|
269
|
+
} )
|
|
270
270
|
|
|
271
|
-
onOrderChanged( newRows.map( ( row ) => JSON.parse( row.rowID ) ) )
|
|
271
|
+
onOrderChanged( newRows.map( ( row ) => JSON.parse( row.rowID ) ) )
|
|
272
272
|
}
|
|
273
273
|
},
|
|
274
274
|
preSet: ( props: {
|
|
@@ -277,31 +277,31 @@ const BodyRows: React.FC<amotify.fn.Tables.Drag.Params> = ( props ) => {
|
|
|
277
277
|
} ) => {
|
|
278
278
|
let {
|
|
279
279
|
origin,index
|
|
280
|
-
} = props
|
|
280
|
+
} = props
|
|
281
281
|
|
|
282
282
|
set_info( {
|
|
283
283
|
rows: val_info.rows,
|
|
284
284
|
origin: origin,
|
|
285
285
|
to: index
|
|
286
|
-
} )
|
|
286
|
+
} )
|
|
287
287
|
}
|
|
288
288
|
}
|
|
289
289
|
} )
|
|
290
|
-
} )
|
|
290
|
+
} )
|
|
291
291
|
React.useEffect( () => {
|
|
292
292
|
return () => {
|
|
293
|
-
useStore.delete( val_componentID )
|
|
293
|
+
useStore.delete( val_componentID )
|
|
294
294
|
}
|
|
295
|
-
},[] )
|
|
295
|
+
},[] )
|
|
296
296
|
|
|
297
297
|
return <>
|
|
298
298
|
{ BodyRows }
|
|
299
|
-
|
|
299
|
+
</>
|
|
300
300
|
}
|
|
301
301
|
|
|
302
302
|
export const DragTable: React.FC<amotify.fn.Tables.Drag.Params> = ( params ) => {
|
|
303
|
-
params = { ...params }
|
|
304
|
-
params.colLength = params.colLength + 1
|
|
303
|
+
params = { ...params }
|
|
304
|
+
params.colLength = params.colLength + 1
|
|
305
305
|
|
|
306
306
|
if ( params.head ) {
|
|
307
307
|
params.head = [
|
|
@@ -317,7 +317,7 @@ export const DragTable: React.FC<amotify.fn.Tables.Drag.Params> = ( params ) =>
|
|
|
317
317
|
<FAI icon={ faGripVertical } />
|
|
318
318
|
ボタンをドラッグして順序を変更
|
|
319
319
|
</Tooltips.Comps.Body>
|
|
320
|
-
} )
|
|
320
|
+
} )
|
|
321
321
|
} }
|
|
322
322
|
>
|
|
323
323
|
<FAI.QuestionCircle />
|
|
@@ -326,17 +326,17 @@ export const DragTable: React.FC<amotify.fn.Tables.Drag.Params> = ( params ) =>
|
|
|
326
326
|
unitWidth: 4
|
|
327
327
|
},
|
|
328
328
|
...params.head
|
|
329
|
-
]
|
|
329
|
+
]
|
|
330
330
|
}
|
|
331
331
|
params.rows = params.rows.map( ( row,rowIndex ) => {
|
|
332
|
-
row.rowID = JSON.stringify( row.rowID || rowIndex )
|
|
333
|
-
return row
|
|
334
|
-
} )
|
|
332
|
+
row.rowID = JSON.stringify( row.rowID || rowIndex )
|
|
333
|
+
return row
|
|
334
|
+
} )
|
|
335
335
|
|
|
336
336
|
return <Comps.Table className={ style.Table }>
|
|
337
337
|
<HeadRow { ...params } />
|
|
338
338
|
<BodyRows { ...params } />
|
|
339
|
-
</Comps.Table
|
|
339
|
+
</Comps.Table>
|
|
340
340
|
}
|
|
341
341
|
|
|
342
342
|
type InfoParams = {
|
|
@@ -348,17 +348,17 @@ type InfoParams = {
|
|
|
348
348
|
}
|
|
349
349
|
|
|
350
350
|
const EffectStart = async function ( event: any,info: InfoParams ) {
|
|
351
|
-
event.stopPropagation()
|
|
352
|
-
event.preventDefault()
|
|
351
|
+
event.stopPropagation()
|
|
352
|
+
event.preventDefault()
|
|
353
353
|
|
|
354
354
|
let {
|
|
355
355
|
id,
|
|
356
356
|
index,
|
|
357
357
|
rows,
|
|
358
358
|
maxLength
|
|
359
|
-
} = info
|
|
359
|
+
} = info
|
|
360
360
|
|
|
361
|
-
$( '#TableRow-' + id + '-' + index ).addClass( style.DraggerOrigin )
|
|
361
|
+
$( '#TableRow-' + id + '-' + index ).addClass( style.DraggerOrigin )
|
|
362
362
|
|
|
363
363
|
$( document )
|
|
364
364
|
.addEvent( {
|
|
@@ -382,30 +382,30 @@ const EffectStart = async function ( event: any,info: InfoParams ) {
|
|
|
382
382
|
eventID: 'DragTouchEnd',
|
|
383
383
|
eventType: 'touchend',
|
|
384
384
|
callback: ( event ) => { EffectEnd( event,info ) }
|
|
385
|
-
} )
|
|
385
|
+
} )
|
|
386
386
|
}
|
|
387
387
|
const EffectMove = function ( event: any,info: InfoParams ) {
|
|
388
388
|
let {
|
|
389
389
|
id,
|
|
390
390
|
maxLength
|
|
391
|
-
} = info
|
|
391
|
+
} = info
|
|
392
392
|
|
|
393
|
-
let Y = $.getCursor( event ).y - $.getScreenSize().scrollY
|
|
393
|
+
let Y = $.getCursor( event ).y - $.getScreenSize().scrollY
|
|
394
394
|
|
|
395
395
|
for ( let rowIndex = 0; rowIndex < maxLength; rowIndex++ ) {
|
|
396
|
-
let Row = $( '#TableRow-' + id + '-' + rowIndex )
|
|
396
|
+
let Row = $( '#TableRow-' + id + '-' + rowIndex )
|
|
397
397
|
let {
|
|
398
398
|
top: rT,
|
|
399
399
|
bottom: rB,
|
|
400
400
|
height: rH
|
|
401
|
-
} = Row.position()
|
|
401
|
+
} = Row.position()
|
|
402
402
|
|
|
403
403
|
if ( rowIndex == 0 && Y < rT ) {
|
|
404
|
-
info.insertIndex = 0
|
|
404
|
+
info.insertIndex = 0
|
|
405
405
|
} else if ( rowIndex === maxLength - 1 && rB <= Y ) {
|
|
406
|
-
info.insertIndex = maxLength
|
|
406
|
+
info.insertIndex = maxLength
|
|
407
407
|
} else if ( Y >= rT && Y < rB ) {
|
|
408
|
-
info.insertIndex = rowIndex + 1
|
|
408
|
+
info.insertIndex = rowIndex + 1
|
|
409
409
|
}
|
|
410
410
|
}
|
|
411
411
|
|
|
@@ -413,30 +413,30 @@ const EffectMove = function ( event: any,info: InfoParams ) {
|
|
|
413
413
|
let {
|
|
414
414
|
index,
|
|
415
415
|
insertIndex
|
|
416
|
-
} = info
|
|
416
|
+
} = info
|
|
417
417
|
|
|
418
|
-
let component = useStore.get( id )
|
|
418
|
+
let component = useStore.get( id )
|
|
419
419
|
if ( component && component.preSet ) component.preSet( {
|
|
420
420
|
origin: index,
|
|
421
421
|
index: insertIndex
|
|
422
|
-
} )
|
|
422
|
+
} )
|
|
423
423
|
}
|
|
424
424
|
|
|
425
|
-
event.stopPropagation()
|
|
426
|
-
event.preventDefault()
|
|
427
|
-
return false
|
|
425
|
+
event.stopPropagation()
|
|
426
|
+
event.preventDefault()
|
|
427
|
+
return false
|
|
428
428
|
}
|
|
429
429
|
const EffectEnd = function ( event: any,info: InfoParams ) {
|
|
430
430
|
let {
|
|
431
431
|
id,
|
|
432
432
|
index,
|
|
433
433
|
insertIndex
|
|
434
|
-
} = info
|
|
434
|
+
} = info
|
|
435
435
|
|
|
436
|
-
let component = useStore.get( id )
|
|
437
|
-
if ( component && component.swap ) component.swap( index,insertIndex )
|
|
436
|
+
let component = useStore.get( id )
|
|
437
|
+
if ( component && component.swap ) component.swap( index,insertIndex )
|
|
438
438
|
|
|
439
|
-
$( '#TableRow-' + id + '-' + index ).removeClass( style.DraggerOrigin )
|
|
439
|
+
$( '#TableRow-' + id + '-' + index ).removeClass( style.DraggerOrigin )
|
|
440
440
|
|
|
441
|
-
$( document ).removeEvent( [ 'DragMouseMove','DragTouchMove','DragMouseUp','DragTouchEnd' ] )
|
|
441
|
+
$( document ).removeEvent( [ 'DragMouseMove','DragTouchMove','DragMouseUp','DragTouchEnd' ] )
|
|
442
442
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import React from 'react'
|
|
1
|
+
import React from 'react'
|
|
2
2
|
import {
|
|
3
3
|
Comps,
|
|
4
4
|
DefaultCellSystemStyles
|
|
5
|
-
} from '../_'
|
|
6
|
-
import style from '../style.module.scss'
|
|
5
|
+
} from '../_'
|
|
6
|
+
import style from '../style.module.scss'
|
|
7
7
|
|
|
8
8
|
const HeadRow: React.FC<amotify.fn.Tables.Normal.Params> = ( params ) => {
|
|
9
9
|
let {
|
|
@@ -13,13 +13,13 @@ const HeadRow: React.FC<amotify.fn.Tables.Normal.Params> = ( params ) => {
|
|
|
13
13
|
colLength,
|
|
14
14
|
head,
|
|
15
15
|
rows
|
|
16
|
-
} = params
|
|
16
|
+
} = params
|
|
17
17
|
|
|
18
|
-
if ( !head ) return null
|
|
18
|
+
if ( !head ) return null
|
|
19
19
|
|
|
20
|
-
let Cols: ReactElement[] = []
|
|
20
|
+
let Cols: ReactElement[] = []
|
|
21
21
|
head.forEach( ( col,colIndex ) => {
|
|
22
|
-
let Cell = Comps[ col.type == 'th' ? 'TH' : 'TD' ]
|
|
22
|
+
let Cell = Comps[ col.type == 'th' ? 'TH' : 'TD' ]
|
|
23
23
|
Cols.push( <Cell
|
|
24
24
|
{ ...cellStyles }
|
|
25
25
|
{ ...DefaultCellSystemStyles( {
|
|
@@ -44,13 +44,13 @@ const HeadRow: React.FC<amotify.fn.Tables.Normal.Params> = ( params ) => {
|
|
|
44
44
|
col.className,
|
|
45
45
|
].join( ' ' ) }
|
|
46
46
|
{ ...col }
|
|
47
|
-
/> )
|
|
47
|
+
/> )
|
|
48
48
|
} )
|
|
49
49
|
|
|
50
50
|
return <Comps.Row
|
|
51
51
|
className={ [ style.Row,style.HeadRow ].join( ' ' ) }
|
|
52
52
|
children={ Cols }
|
|
53
|
-
|
|
53
|
+
/>
|
|
54
54
|
}
|
|
55
55
|
const BodyRows: React.FC<amotify.fn.Tables.Normal.Params> = ( params ) => {
|
|
56
56
|
let {
|
|
@@ -61,13 +61,13 @@ const BodyRows: React.FC<amotify.fn.Tables.Normal.Params> = ( params ) => {
|
|
|
61
61
|
rows,
|
|
62
62
|
colLength,
|
|
63
63
|
onRowClick,
|
|
64
|
-
} = params
|
|
64
|
+
} = params
|
|
65
65
|
|
|
66
|
-
let BodyRows: ReactElement[] = []
|
|
66
|
+
let BodyRows: ReactElement[] = []
|
|
67
67
|
rows.forEach( ( cols,rowIndex ) => {
|
|
68
|
-
let Cols: ReactElement[] = []
|
|
68
|
+
let Cols: ReactElement[] = []
|
|
69
69
|
cols.forEach( ( col,colIndex ) => {
|
|
70
|
-
let Cell = Comps[ col.type == 'th' ? 'TH' : 'TD' ]
|
|
70
|
+
let Cell = Comps[ col.type == 'th' ? 'TH' : 'TD' ]
|
|
71
71
|
Cols.push( <Cell
|
|
72
72
|
{ ...cellStyles }
|
|
73
73
|
{ ...DefaultCellSystemStyles( {
|
|
@@ -92,33 +92,33 @@ const BodyRows: React.FC<amotify.fn.Tables.Normal.Params> = ( params ) => {
|
|
|
92
92
|
col.className,
|
|
93
93
|
].join( ' ' ) }
|
|
94
94
|
{ ...col }
|
|
95
|
-
/> )
|
|
96
|
-
} )
|
|
95
|
+
/> )
|
|
96
|
+
} )
|
|
97
97
|
|
|
98
98
|
BodyRows.push( <Comps.Row
|
|
99
99
|
key={ rowIndex }
|
|
100
100
|
className={ [ style.Row,style.BodyRow ].join( ' ' ) }
|
|
101
101
|
children={ Cols }
|
|
102
102
|
onClick={ ( event ) => {
|
|
103
|
-
if ( onRowClick ) onRowClick( cols.rowID as any,event )
|
|
103
|
+
if ( onRowClick ) onRowClick( cols.rowID as any,event )
|
|
104
104
|
} }
|
|
105
|
-
/> )
|
|
106
|
-
} )
|
|
105
|
+
/> )
|
|
106
|
+
} )
|
|
107
107
|
|
|
108
108
|
return <>
|
|
109
109
|
{ BodyRows }
|
|
110
|
-
|
|
110
|
+
</>
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
export const NormalTable: React.FC<amotify.fn.Tables.Normal.Params> = ( params ) => {
|
|
114
114
|
params = { ...params }
|
|
115
115
|
params.rows = params.rows.map( ( row,rowIndex ) => {
|
|
116
|
-
row.rowID = row.rowID || rowIndex
|
|
117
|
-
return row
|
|
118
|
-
} )
|
|
116
|
+
row.rowID = row.rowID || rowIndex
|
|
117
|
+
return row
|
|
118
|
+
} )
|
|
119
119
|
|
|
120
120
|
return <Comps.Table className={ style.Table }>
|
|
121
121
|
<HeadRow { ...params } />
|
|
122
122
|
<BodyRows { ...params } />
|
|
123
|
-
</Comps.Table
|
|
123
|
+
</Comps.Table>
|
|
124
124
|
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
StyleConverter,
|
|
3
3
|
React
|
|
4
|
-
} from '@global'
|
|
4
|
+
} from '@global'
|
|
5
5
|
|
|
6
6
|
import {
|
|
7
7
|
Box,
|
|
8
8
|
FAI
|
|
9
|
-
} from '@atoms'
|
|
9
|
+
} from '@atoms'
|
|
10
10
|
|
|
11
11
|
export const Comps: amotify.fn.Tables.CompsMethods = {
|
|
12
12
|
Table: ( params ) => {
|
|
13
|
-
let Params = StyleConverter.ToClassName( params )
|
|
13
|
+
let Params = StyleConverter.ToClassName( params )
|
|
14
14
|
return <table
|
|
15
15
|
{ ...Params }
|
|
16
16
|
border={ Params.border as any }
|
|
17
|
-
|
|
17
|
+
/>
|
|
18
18
|
},
|
|
19
19
|
Head: ( params ) => ( <thead { ...StyleConverter.ToClassName( params ) } /> ),
|
|
20
20
|
Body: ( params ) => ( <tbody { ...StyleConverter.ToClassName( params ) } /> ),
|
|
@@ -34,15 +34,15 @@ export const Comps: amotify.fn.Tables.CompsMethods = {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
import { NormalTable } from './Normal/parts'
|
|
37
|
+
import { NormalTable } from './Normal/parts'
|
|
38
38
|
import {
|
|
39
39
|
DataTable,
|
|
40
40
|
DataFNs,
|
|
41
41
|
DataComps
|
|
42
|
-
} from './Data/parts'
|
|
43
|
-
import { DragTable } from './Drag/parts'
|
|
42
|
+
} from './Data/parts'
|
|
43
|
+
import { DragTable } from './Drag/parts'
|
|
44
44
|
|
|
45
|
-
import style from './style.module.scss'
|
|
45
|
+
import style from './style.module.scss'
|
|
46
46
|
|
|
47
47
|
const Wrapper: React.FC<amotify.fn.Tables.Uni.Params & {
|
|
48
48
|
type: amotify.fn.Tables.Types
|
|
@@ -50,16 +50,16 @@ const Wrapper: React.FC<amotify.fn.Tables.Uni.Params & {
|
|
|
50
50
|
let {
|
|
51
51
|
tone,
|
|
52
52
|
type,
|
|
53
|
-
} = params
|
|
53
|
+
} = params
|
|
54
54
|
params = { ...params }
|
|
55
|
-
params.tableID = params.tableID || $.uuidGen()
|
|
56
|
-
tone = tone || 'auto'
|
|
55
|
+
params.tableID = params.tableID || $.uuidGen()
|
|
56
|
+
tone = tone || 'auto'
|
|
57
57
|
|
|
58
58
|
if ( tone == 'auto' ) {
|
|
59
59
|
if ( type == 'drag' ) {
|
|
60
|
-
tone = 'rowBorder'
|
|
60
|
+
tone = 'rowBorder'
|
|
61
61
|
} else {
|
|
62
|
-
tone = 'border'
|
|
62
|
+
tone = 'border'
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
|
|
@@ -84,37 +84,37 @@ const Wrapper: React.FC<amotify.fn.Tables.Uni.Params & {
|
|
|
84
84
|
className,
|
|
85
85
|
style: freeCSS,
|
|
86
86
|
...others
|
|
87
|
-
} = StyleConverter.ToClassName( Params as any )
|
|
87
|
+
} = StyleConverter.ToClassName( Params as any )
|
|
88
88
|
|
|
89
89
|
let ClassName = [
|
|
90
90
|
className,
|
|
91
91
|
style.Wrap,
|
|
92
92
|
style[ 'TableType_' + type ],
|
|
93
93
|
style[ 'RowClickable_' + !!( params as any ).onRowClick ]
|
|
94
|
-
].join( ' ' )
|
|
94
|
+
].join( ' ' )
|
|
95
95
|
|
|
96
96
|
let TableComponent = {
|
|
97
97
|
'normal': NormalTable,
|
|
98
98
|
'data': DataTable,
|
|
99
99
|
'drag': DragTable,
|
|
100
100
|
'spread': ''
|
|
101
|
-
}[ type ]
|
|
101
|
+
}[ type ]
|
|
102
102
|
|
|
103
103
|
return <Box
|
|
104
104
|
className={ ClassName }
|
|
105
105
|
style={ freeCSS }
|
|
106
106
|
>
|
|
107
107
|
<TableComponent { ...others as any } />
|
|
108
|
-
</Box
|
|
108
|
+
</Box>
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
-
let DataComponent: any = ( props: any ) => ( <Wrapper type='data' { ...props } /> )
|
|
111
|
+
let DataComponent: any = ( props: any ) => ( <Wrapper type='data' { ...props } /> )
|
|
112
112
|
Object.entries( DataFNs ).forEach( ( [ key,value ] ) => {
|
|
113
|
-
DataComponent[ key ] = value
|
|
114
|
-
} )
|
|
113
|
+
DataComponent[ key ] = value
|
|
114
|
+
} )
|
|
115
115
|
Object.entries( DataComps ).forEach( ( [ key,value ] ) => {
|
|
116
|
-
DataComponent[ key ] = value
|
|
117
|
-
} )
|
|
116
|
+
DataComponent[ key ] = value
|
|
117
|
+
} )
|
|
118
118
|
|
|
119
119
|
export const Table: amotify.fn.Tables.Methods = {
|
|
120
120
|
Normal: ( props ) => ( <Wrapper type='normal' { ...props } /> ),
|
|
@@ -130,18 +130,18 @@ export const DefaultCellStyles = ( type: amotify.fn.Tables.Types,tone: amotify.f
|
|
|
130
130
|
|
|
131
131
|
let Styles: amotifyUniStyleParams = {}
|
|
132
132
|
if ( type == 'drag' ) {
|
|
133
|
-
Styles.padding = 1
|
|
133
|
+
Styles.padding = 1
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
if ( [ 'border','rowBorder','cellBorder' ].includes( tone ) ) {
|
|
137
|
-
Styles.borderBottom = '2.normal'
|
|
137
|
+
Styles.borderBottom = '2.normal'
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
if ( [ 'border','cellBorder' ].includes( tone ) ) {
|
|
141
|
-
Styles.borderRight = '2.normal'
|
|
141
|
+
Styles.borderRight = '2.normal'
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
return Styles
|
|
144
|
+
return Styles
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
export const DefaultCellSystemStyles = ( args: {
|
|
@@ -152,26 +152,26 @@ export const DefaultCellSystemStyles = ( args: {
|
|
|
152
152
|
} ) => {
|
|
153
153
|
let Styles: amotifyUniStyleParams = {}
|
|
154
154
|
if ( args.right ) {
|
|
155
|
-
Styles.borderRight = 'unset'
|
|
155
|
+
Styles.borderRight = 'unset'
|
|
156
156
|
}
|
|
157
157
|
|
|
158
158
|
if ( args.top ) {
|
|
159
159
|
if ( args.left ) {
|
|
160
|
-
Styles.borderTopLeftRadius = 'inherit'
|
|
160
|
+
Styles.borderTopLeftRadius = 'inherit'
|
|
161
161
|
}
|
|
162
162
|
if ( args.right ) {
|
|
163
|
-
Styles.borderTopRightRadius = 'inherit'
|
|
163
|
+
Styles.borderTopRightRadius = 'inherit'
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
166
|
if ( args.bottom ) {
|
|
167
|
-
Styles.borderBottom = 'unset'
|
|
167
|
+
Styles.borderBottom = 'unset'
|
|
168
168
|
if ( args.left ) {
|
|
169
|
-
Styles.borderBottomLeftRadius = 'inherit'
|
|
169
|
+
Styles.borderBottomLeftRadius = 'inherit'
|
|
170
170
|
}
|
|
171
171
|
if ( args.right ) {
|
|
172
|
-
Styles.borderBottomRightRadius = 'inherit'
|
|
172
|
+
Styles.borderBottomRightRadius = 'inherit'
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
-
return Styles
|
|
176
|
+
return Styles
|
|
177
177
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React from 'react'
|
|
1
|
+
import React from 'react'
|
|
2
2
|
import {
|
|
3
3
|
Box
|
|
4
|
-
} from '@atoms'
|
|
4
|
+
} from '@atoms'
|
|
5
5
|
import {
|
|
6
6
|
Sheet
|
|
7
|
-
} from '@fn'
|
|
7
|
+
} from '@fn'
|
|
8
8
|
|
|
9
9
|
const Tooltips: amotify.fn.Tooltips.Methods = {
|
|
10
10
|
__memoryID: $.uuidGen(),
|
|
@@ -13,7 +13,7 @@ const Tooltips: amotify.fn.Tooltips.Methods = {
|
|
|
13
13
|
tipsID = $.uuidGen(),
|
|
14
14
|
tipsGroups = [],
|
|
15
15
|
...sheetParams
|
|
16
|
-
} = params
|
|
16
|
+
} = params
|
|
17
17
|
|
|
18
18
|
Sheet.open( {
|
|
19
19
|
sheetID: tipsID!,
|
|
@@ -30,13 +30,13 @@ const Tooltips: amotify.fn.Tooltips.Methods = {
|
|
|
30
30
|
},
|
|
31
31
|
type: 'custom',
|
|
32
32
|
...sheetParams
|
|
33
|
-
} )
|
|
33
|
+
} )
|
|
34
34
|
},
|
|
35
35
|
close: ( tipsID ) => {
|
|
36
|
-
Sheet.close( tipsID )
|
|
36
|
+
Sheet.close( tipsID )
|
|
37
37
|
},
|
|
38
38
|
closeALL: () => {
|
|
39
|
-
Sheet.closeGroup( 'tooltips' )
|
|
39
|
+
Sheet.closeGroup( 'tooltips' )
|
|
40
40
|
},
|
|
41
41
|
Comps: {
|
|
42
42
|
Body: ( params ) => ( <Box
|