amotify 0.0.4 → 0.0.6
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/dist/@jsminAmotifyExtension/formCollect.js +1 -1
- package/dist/Atoms/Logo/parts.js +1 -1
- package/dist/Atoms/Various/parts.js +1 -1
- package/dist/Functions/Button/_.js +1 -1
- package/dist/Functions/Cropper/parts.js +4 -4
- package/dist/Functions/Effects/Fade.js +2 -2
- package/dist/Functions/Input/Chips/Selector.js +4 -4
- package/dist/Functions/Input/Chips/_.js +3 -3
- package/dist/Functions/Input/DigitCharacters.js +3 -3
- package/dist/Functions/Input/File/_.js +4 -4
- package/dist/Functions/Input/List/_.js +3 -3
- package/dist/Functions/Input/Segmented/_.js +1 -1
- package/dist/Functions/Input/Select/_.js +2 -2
- package/dist/Functions/Input/Slider/_.js +3 -3
- package/dist/Functions/Input/Switch/_.js +4 -4
- package/dist/Functions/Input/Text.js +2 -2
- package/dist/Functions/Input/TextArea.js +1 -1
- package/dist/Functions/Input/Time/Picker.js +4 -4
- package/dist/Functions/Input/Time/_.js +3 -3
- package/dist/Functions/Input/_.js +4 -4
- package/dist/Functions/Input/core.js +4 -4
- package/dist/Functions/Inputs/text.js +1 -1
- package/dist/Functions/Layout/PageNotFound.js +3 -3
- package/dist/Functions/Layout/PageRouter.js +2 -2
- package/dist/Functions/Layout/PageViewController/parts.js +2 -2
- package/dist/Functions/Layout/Plate.js +1 -1
- package/dist/Functions/Layout/RootViewController/parts.js +4 -4
- package/dist/Functions/Layout/SwipeView/parts.js +2 -2
- package/dist/Functions/Layout/TabBar.js +3 -3
- package/dist/Functions/Loader/corner.js +2 -2
- package/dist/Functions/Loader/mini.js +2 -2
- package/dist/Functions/Loader/parts.js +1 -1
- package/dist/Functions/Loader/top.js +2 -2
- package/dist/Functions/Sheet/parts.js +4 -4
- package/dist/Functions/SnackBar/parts.js +4 -4
- package/dist/Functions/Table/Data/parts.js +4 -4
- package/dist/Functions/Table/Drag/parts.js +3 -3
- package/dist/Functions/Table/_.js +2 -2
- package/dist/Functions/Tooltips/parts.js +2 -2
- package/dist/Molecules/@export.js +1 -1
- package/dist/Molecules/Accordion/parts.js +2 -2
- package/dist/Molecules/LinkifyText/parts.js +2 -2
- package/dist/Molecules/List.js +1 -1
- package/dist/Organisms/DisplayStyleInput/darkmode.js +4 -4
- package/dist/Organisms/DisplayStyleInput/themeColor.js +4 -4
- package/dist/Templates/PlayGround/parts.js +5 -5
- package/dist/launch.js +6 -6
- package/package.json +6 -5
- package/public/amotify.js +310 -0
- package/public/amotify.min.css +12724 -0
- package/dist/src/@jsminAmotifyExtension/_.d.ts +0 -4
- package/dist/src/@jsminAmotifyExtension/fetch.d.ts +0 -9
- package/dist/src/@jsminAmotifyExtension/formCollect.d.ts +0 -1
- package/dist/src/@jsminAmotifyExtension/spreadSheet.d.ts +0 -4
- package/dist/src/@jsminAmotifyExtension/variables.d.ts +0 -0
- package/dist/src/@types/_.d.ts +0 -6
- package/dist/src/@types/amot.d.ts +0 -260
- package/dist/src/@types/fn.d.ts +0 -1040
- package/dist/src/@types/index.d.ts +0 -62
- package/dist/src/@types/jsminAmotifyExtension.d.ts +0 -134
- package/dist/src/@types/module.d.ts +0 -2
- package/dist/src/@types/state.d.ts +0 -145
- package/dist/src/Atoms/@export.d.ts +0 -4
- package/dist/src/Atoms/FAIcon/parts.d.ts +0 -2
- package/dist/src/Atoms/Logo/parts.d.ts +0 -1
- package/dist/src/Atoms/Various/parts.d.ts +0 -9
- package/dist/src/Functions/@export.d.ts +0 -12
- package/dist/src/Functions/Button/_.d.ts +0 -1
- package/dist/src/Functions/Cropper/parts.d.ts +0 -1
- package/dist/src/Functions/Effects/Fade.d.ts +0 -1
- package/dist/src/Functions/Effects/Ripple.d.ts +0 -1
- package/dist/src/Functions/Effects/_.d.ts +0 -3
- package/dist/src/Functions/Input/Chips/Selector.d.ts +0 -1
- package/dist/src/Functions/Input/Chips/_.d.ts +0 -2
- package/dist/src/Functions/Input/DigitCharacters.d.ts +0 -1
- package/dist/src/Functions/Input/File/_.d.ts +0 -2
- package/dist/src/Functions/Input/Hidden.d.ts +0 -1
- package/dist/src/Functions/Input/List/_.d.ts +0 -1
- package/dist/src/Functions/Input/Segmented/_.d.ts +0 -1
- package/dist/src/Functions/Input/Select/_.d.ts +0 -1
- package/dist/src/Functions/Input/Slider/_.d.ts +0 -1
- package/dist/src/Functions/Input/Switch/_.d.ts +0 -1
- package/dist/src/Functions/Input/Text.d.ts +0 -5
- package/dist/src/Functions/Input/TextArea.d.ts +0 -1
- package/dist/src/Functions/Input/Time/Picker.d.ts +0 -1
- package/dist/src/Functions/Input/Time/_.d.ts +0 -2
- package/dist/src/Functions/Input/_.d.ts +0 -5
- package/dist/src/Functions/Input/core.d.ts +0 -34
- package/dist/src/Functions/Inputs/_.d.ts +0 -3
- package/dist/src/Functions/Inputs/text.d.ts +0 -12
- package/dist/src/Functions/Layout/PageNotFound.d.ts +0 -1
- package/dist/src/Functions/Layout/PageRouter.d.ts +0 -2
- package/dist/src/Functions/Layout/PageViewController/parts.d.ts +0 -1
- package/dist/src/Functions/Layout/Plate.d.ts +0 -1
- package/dist/src/Functions/Layout/RootViewController/parts.d.ts +0 -1
- package/dist/src/Functions/Layout/SwipeView/parts.d.ts +0 -2
- package/dist/src/Functions/Layout/TabBar.d.ts +0 -1
- package/dist/src/Functions/Layout/_.d.ts +0 -2
- package/dist/src/Functions/Loader/corner.d.ts +0 -1
- package/dist/src/Functions/Loader/mini.d.ts +0 -33
- package/dist/src/Functions/Loader/parts.d.ts +0 -3
- package/dist/src/Functions/Loader/top.d.ts +0 -1
- package/dist/src/Functions/Sheet/parts.d.ts +0 -2
- package/dist/src/Functions/SnackBar/parts.d.ts +0 -2
- package/dist/src/Functions/Table/Data/parts.d.ts +0 -3
- package/dist/src/Functions/Table/Drag/parts.d.ts +0 -1
- package/dist/src/Functions/Table/Normal/parts.d.ts +0 -1
- package/dist/src/Functions/Table/_.d.ts +0 -9
- package/dist/src/Functions/Tooltips/parts.d.ts +0 -2
- package/dist/src/Global/@export.d.ts +0 -12
- package/dist/src/Global/LaunchReactApplication.d.ts +0 -1
- package/dist/src/Global/styleConverter.d.ts +0 -2
- package/dist/src/Molecules/@export.d.ts +0 -21
- package/dist/src/Molecules/Accordion/parts.d.ts +0 -2
- package/dist/src/Molecules/LinkifyText/parts.d.ts +0 -1
- package/dist/src/Molecules/List.d.ts +0 -1
- package/dist/src/Organisms/@export.d.ts +0 -2
- package/dist/src/Organisms/DisplayStyleInput/_.d.ts +0 -1
- package/dist/src/Organisms/DisplayStyleInput/darkmode.d.ts +0 -1
- package/dist/src/Organisms/DisplayStyleInput/themeColor.d.ts +0 -27
- package/dist/src/Templates/@export.d.ts +0 -2
- package/dist/src/Templates/PlayGround/parts.d.ts +0 -1
- package/dist/src/config.d.ts +0 -16
- package/dist/src/launch.d.ts +0 -9
- package/dist/src/preload.d.ts +0 -1
- package/src/@jsminAmotifyExtension/_.tsx +0 -4
- package/src/@jsminAmotifyExtension/fetch.tsx +0 -107
- package/src/@jsminAmotifyExtension/formCollect.tsx +0 -89
- package/src/@jsminAmotifyExtension/spreadSheet.tsx +0 -159
- package/src/@jsminAmotifyExtension/variables.tsx +0 -130
- package/src/@styles/@app.scss +0 -4
- package/src/@styles/@variables/customProps.scss +0 -109
- package/src/@styles/@variables/styleSet.scss +0 -38
- package/src/@styles/@variables/themeColor.scss +0 -71
- package/src/@styles/@variables/var.scss +0 -171
- package/src/@styles/UniStyling.scss +0 -996
- package/src/@styles/init.scss +0 -154
- package/src/@types/_.tsx +0 -6
- package/src/@types/amot.tsx +0 -323
- package/src/@types/fn.tsx +0 -1210
- package/src/@types/index.tsx +0 -74
- package/src/@types/jsminAmotifyExtension.tsx +0 -143
- package/src/@types/module.tsx +0 -2
- package/src/@types/state.tsx +0 -199
- package/src/Atoms/@export.tsx +0 -32
- package/src/Atoms/FAIcon/parts.tsx +0 -117
- package/src/Atoms/FAIcon/style.module.scss +0 -9
- package/src/Atoms/Logo/parts.tsx +0 -335
- package/src/Atoms/Logo/style.module.scss +0 -96
- package/src/Atoms/Various/parts.tsx +0 -157
- package/src/Atoms/Various/style.module.scss +0 -40
- package/src/Functions/@export.tsx +0 -29
- package/src/Functions/Button/_.tsx +0 -305
- package/src/Functions/Button/style.module.scss +0 -183
- package/src/Functions/Cropper/parts.tsx +0 -1061
- package/src/Functions/Cropper/style.module.scss +0 -62
- package/src/Functions/Effects/Fade.tsx +0 -81
- package/src/Functions/Effects/Ripple.tsx +0 -141
- package/src/Functions/Effects/_.tsx +0 -33
- package/src/Functions/Effects/style.module.scss +0 -83
- package/src/Functions/Input/Chips/Selector.tsx +0 -451
- package/src/Functions/Input/Chips/_.tsx +0 -286
- package/src/Functions/Input/Chips/style.module.scss +0 -6
- package/src/Functions/Input/DigitCharacters.tsx +0 -241
- package/src/Functions/Input/File/_.tsx +0 -596
- package/src/Functions/Input/File/style.module.scss +0 -34
- package/src/Functions/Input/Hidden.tsx +0 -18
- package/src/Functions/Input/List/_.tsx +0 -383
- package/src/Functions/Input/List/style.module.scss +0 -84
- package/src/Functions/Input/Segmented/_.tsx +0 -238
- package/src/Functions/Input/Segmented/style.module.scss +0 -81
- package/src/Functions/Input/Select/_.tsx +0 -225
- package/src/Functions/Input/Select/style.module.scss +0 -10
- package/src/Functions/Input/Slider/_.tsx +0 -519
- package/src/Functions/Input/Slider/style.module.scss +0 -67
- package/src/Functions/Input/Switch/_.tsx +0 -177
- package/src/Functions/Input/Switch/style.module.scss +0 -18
- package/src/Functions/Input/Text.tsx +0 -437
- package/src/Functions/Input/TextArea.tsx +0 -115
- package/src/Functions/Input/Time/Picker.tsx +0 -950
- package/src/Functions/Input/Time/_.tsx +0 -736
- package/src/Functions/Input/Time/style.module.scss +0 -72
- package/src/Functions/Input/_.tsx +0 -793
- package/src/Functions/Input/core.tsx +0 -461
- package/src/Functions/Input/style.module.scss +0 -43
- package/src/Functions/Inputs/_.tsx +0 -5
- package/src/Functions/Inputs/style.module.scss +0 -15
- package/src/Functions/Inputs/text.tsx +0 -67
- package/src/Functions/Inputs/types.d.ts +0 -1
- package/src/Functions/Layout/PageNotFound.tsx +0 -81
- package/src/Functions/Layout/PageRouter.tsx +0 -107
- package/src/Functions/Layout/PageViewController/parts.tsx +0 -32
- package/src/Functions/Layout/Plate.tsx +0 -30
- package/src/Functions/Layout/RootViewController/parts.tsx +0 -290
- package/src/Functions/Layout/RootViewController/style.module.scss +0 -24
- package/src/Functions/Layout/SwipeView/parts.tsx +0 -380
- package/src/Functions/Layout/SwipeView/style.module.scss +0 -19
- package/src/Functions/Layout/TabBar.tsx +0 -64
- package/src/Functions/Layout/_.tsx +0 -20
- package/src/Functions/Loader/corner.tsx +0 -78
- package/src/Functions/Loader/mini.tsx +0 -117
- package/src/Functions/Loader/parts.tsx +0 -105
- package/src/Functions/Loader/style.module.scss +0 -222
- package/src/Functions/Loader/top.tsx +0 -90
- package/src/Functions/Sheet/parts.tsx +0 -972
- package/src/Functions/Sheet/style.module.scss +0 -235
- package/src/Functions/SnackBar/parts.tsx +0 -215
- package/src/Functions/SnackBar/style.module.scss +0 -25
- package/src/Functions/Table/Data/parts.tsx +0 -955
- package/src/Functions/Table/Drag/parts.tsx +0 -448
- package/src/Functions/Table/Normal/parts.tsx +0 -123
- package/src/Functions/Table/_.tsx +0 -170
- package/src/Functions/Table/style.module.scss +0 -92
- package/src/Functions/Tooltips/parts.tsx +0 -52
- package/src/Global/@export.tsx +0 -138
- package/src/Global/LaunchReactApplication.tsx +0 -30
- package/src/Global/exe.tsx +0 -0
- package/src/Global/styleConverter.tsx +0 -435
- package/src/Molecules/@export.tsx +0 -95
- package/src/Molecules/Accordion/parts.tsx +0 -146
- package/src/Molecules/Accordion/style.module.scss +0 -13
- package/src/Molecules/LinkifyText/parts.tsx +0 -54
- package/src/Molecules/List.tsx +0 -30
- package/src/Organisms/@export.tsx +0 -5
- package/src/Organisms/DisplayStyleInput/_.tsx +0 -18
- package/src/Organisms/DisplayStyleInput/darkmode.tsx +0 -112
- package/src/Organisms/DisplayStyleInput/themeColor.tsx +0 -210
- package/src/Templates/@export.tsx +0 -7
- package/src/Templates/PlayGround/parts.tsx +0 -115
- package/src/Templates/PlayGround/style.module.scss +0 -38
- package/src/config.tsx +0 -132
- package/src/launch.tsx +0 -100
- package/src/preload.tsx +0 -49
|
@@ -1,448 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useStore
|
|
3
|
-
} from '@global';
|
|
4
|
-
import {
|
|
5
|
-
FAIcon
|
|
6
|
-
} from '@atoms';
|
|
7
|
-
import {
|
|
8
|
-
Buttons,
|
|
9
|
-
Tooltips,
|
|
10
|
-
} from '@functions';
|
|
11
|
-
const {
|
|
12
|
-
useState,
|
|
13
|
-
useEffect,
|
|
14
|
-
} = React;
|
|
15
|
-
|
|
16
|
-
import {
|
|
17
|
-
Comps,
|
|
18
|
-
DefaultCellSystemStyles
|
|
19
|
-
} from '../_';
|
|
20
|
-
|
|
21
|
-
import style from '../style.module.scss';
|
|
22
|
-
|
|
23
|
-
const HeadRow: FNC<amotify.fn.Tables.Drag.Params> = ( props ) => {
|
|
24
|
-
let {
|
|
25
|
-
cellStyles = {},
|
|
26
|
-
cellClassName = '',
|
|
27
|
-
cellStylesCallback,
|
|
28
|
-
colLength,
|
|
29
|
-
head,
|
|
30
|
-
rows
|
|
31
|
-
} = props;
|
|
32
|
-
|
|
33
|
-
if ( !head ) return null;
|
|
34
|
-
|
|
35
|
-
let Cols = [];
|
|
36
|
-
|
|
37
|
-
for ( let colIndex = 0; colIndex < colLength; colIndex++ ) {
|
|
38
|
-
let col = head[ colIndex ];
|
|
39
|
-
|
|
40
|
-
let Cell = Comps[ col.type == 'th' ? 'TH' : 'TD' ];
|
|
41
|
-
Cols.push( <Cell
|
|
42
|
-
{ ...cellStyles }
|
|
43
|
-
{ ...DefaultCellSystemStyles( {
|
|
44
|
-
top: true,
|
|
45
|
-
bottom: !rows.length,
|
|
46
|
-
left: colIndex == 0,
|
|
47
|
-
right: colIndex == colLength - 1
|
|
48
|
-
} ) }
|
|
49
|
-
{ ...cellStylesCallback ? cellStylesCallback( {
|
|
50
|
-
top: true,
|
|
51
|
-
bottom: !rows.length,
|
|
52
|
-
left: colIndex == 0,
|
|
53
|
-
right: colIndex == colLength - 1,
|
|
54
|
-
rowIndex: 0,
|
|
55
|
-
colIndex,
|
|
56
|
-
isBody: false,
|
|
57
|
-
isHeader: true,
|
|
58
|
-
} ) : {} }
|
|
59
|
-
className={ [
|
|
60
|
-
style.Cell,
|
|
61
|
-
cellClassName,
|
|
62
|
-
col.className,
|
|
63
|
-
].join( ' ' ) }
|
|
64
|
-
{ ...col }
|
|
65
|
-
/> );
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
return ( <Comps.Row
|
|
69
|
-
className={ [ style.Row,style.HeadRow ].join( ' ' ) }
|
|
70
|
-
children={ Cols }
|
|
71
|
-
/> );
|
|
72
|
-
}
|
|
73
|
-
const BodyRows: FNC<amotify.fn.Tables.Drag.Params> = ( props ) => {
|
|
74
|
-
let {
|
|
75
|
-
cellStyles = {},
|
|
76
|
-
cellClassName = '',
|
|
77
|
-
cellStylesCallback,
|
|
78
|
-
head,
|
|
79
|
-
rows,
|
|
80
|
-
colLength,
|
|
81
|
-
onOrderChanged
|
|
82
|
-
} = props;
|
|
83
|
-
|
|
84
|
-
let [ val_componentID ] = useState( $.uuidGen() );
|
|
85
|
-
let [ val_info,set_info ] = useState( {
|
|
86
|
-
rows: rows,
|
|
87
|
-
origin: 0,
|
|
88
|
-
to: NaN
|
|
89
|
-
} );
|
|
90
|
-
|
|
91
|
-
let BodyRows: ReactElement[] = [];
|
|
92
|
-
|
|
93
|
-
val_info.rows.forEach( ( cols,rowIndex ) => {
|
|
94
|
-
let Cols: ReactElement[] = [];
|
|
95
|
-
{
|
|
96
|
-
Cols.push( <Comps.TH
|
|
97
|
-
key={ 'DragOrigin' }
|
|
98
|
-
{ ...cellStyles }
|
|
99
|
-
{ ...DefaultCellSystemStyles( {
|
|
100
|
-
top: rowIndex == 0 && !head,
|
|
101
|
-
bottom: rowIndex == rows.length - 1,
|
|
102
|
-
left: true,
|
|
103
|
-
right: false
|
|
104
|
-
} ) }
|
|
105
|
-
{ ...cellStylesCallback ? cellStylesCallback( {
|
|
106
|
-
top: rowIndex == 0 && !head,
|
|
107
|
-
bottom: rowIndex == rows.length - 1,
|
|
108
|
-
left: true,
|
|
109
|
-
right: false,
|
|
110
|
-
rowIndex,
|
|
111
|
-
colIndex: 0,
|
|
112
|
-
isBody: true,
|
|
113
|
-
isHeader: false,
|
|
114
|
-
} ) : {} }
|
|
115
|
-
padding={ 0 }
|
|
116
|
-
borderRight
|
|
117
|
-
className={ [
|
|
118
|
-
style.Cell,
|
|
119
|
-
style.Draggable,
|
|
120
|
-
cellClassName
|
|
121
|
-
].join( ' ' ) }
|
|
122
|
-
>
|
|
123
|
-
<Buttons.Button.Clear.R
|
|
124
|
-
className={ style.DragableButton }
|
|
125
|
-
fontColor={ '5.translucent' }
|
|
126
|
-
fontSize={ '3.paragraph' }
|
|
127
|
-
margin={ 'auto' }
|
|
128
|
-
tabIndex={ -1 }
|
|
129
|
-
ssSphere={ 3 }
|
|
130
|
-
onMouseDown={ ( event ) => {
|
|
131
|
-
EffectStart( event,{
|
|
132
|
-
id: val_componentID,
|
|
133
|
-
index: rowIndex,
|
|
134
|
-
rows: val_info.rows,
|
|
135
|
-
maxLength: rows.length
|
|
136
|
-
} );
|
|
137
|
-
} }
|
|
138
|
-
onTouchStart={ ( event ) => {
|
|
139
|
-
EffectStart( event,{
|
|
140
|
-
id: val_componentID,
|
|
141
|
-
index: rowIndex,
|
|
142
|
-
rows: val_info.rows,
|
|
143
|
-
maxLength: rows.length
|
|
144
|
-
} );
|
|
145
|
-
} }
|
|
146
|
-
>
|
|
147
|
-
<FAIcon
|
|
148
|
-
d='grip-dots-vertical'
|
|
149
|
-
/>
|
|
150
|
-
</Buttons.Button.Clear.R>
|
|
151
|
-
</Comps.TH> );
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
cols.forEach( ( col,colIndex ) => {
|
|
155
|
-
col = { ...col as any }
|
|
156
|
-
|
|
157
|
-
let Cell = Comps[ col.type == 'th' ? 'TH' : 'TD' ];
|
|
158
|
-
Cols.push( <Cell
|
|
159
|
-
{ ...cellStyles }
|
|
160
|
-
{ ...DefaultCellSystemStyles( {
|
|
161
|
-
top: !!head && !head.length,
|
|
162
|
-
bottom: rowIndex == rows.length - 1,
|
|
163
|
-
left: false,
|
|
164
|
-
right: colIndex == colLength - 2
|
|
165
|
-
} ) }
|
|
166
|
-
{ ...cellStylesCallback ? cellStylesCallback( {
|
|
167
|
-
top: !!head && !head.length,
|
|
168
|
-
bottom: rowIndex == rows.length - 1,
|
|
169
|
-
left: false,
|
|
170
|
-
right: colIndex == colLength - 2,
|
|
171
|
-
rowIndex,
|
|
172
|
-
colIndex,
|
|
173
|
-
isBody: true,
|
|
174
|
-
isHeader: false,
|
|
175
|
-
} ) : {} }
|
|
176
|
-
className={ [
|
|
177
|
-
style.Cell,
|
|
178
|
-
cellClassName,
|
|
179
|
-
col.className,
|
|
180
|
-
].join( ' ' ) }
|
|
181
|
-
{ ...col }
|
|
182
|
-
/> );
|
|
183
|
-
} );
|
|
184
|
-
|
|
185
|
-
BodyRows.push( <Comps.Row
|
|
186
|
-
key={ rowIndex }
|
|
187
|
-
id={ 'TableRow-' + val_componentID + '-' + rowIndex }
|
|
188
|
-
data-rowId={ rowIndex }
|
|
189
|
-
className={ [ style.Row,style.BodyRow ].join( ' ' ) }
|
|
190
|
-
children={ Cols }
|
|
191
|
-
/> );
|
|
192
|
-
} );
|
|
193
|
-
|
|
194
|
-
if ( !isNaN( val_info.to ) ) {
|
|
195
|
-
let {
|
|
196
|
-
origin,
|
|
197
|
-
to
|
|
198
|
-
} = val_info;
|
|
199
|
-
let Cols = [];
|
|
200
|
-
Cols.push( <Comps.TH
|
|
201
|
-
key={ 'dragButton' }
|
|
202
|
-
backgroundColor='tcOpLow'
|
|
203
|
-
padding={ 0 }
|
|
204
|
-
borderRight={ '2.normal' }
|
|
205
|
-
className={ [
|
|
206
|
-
style.Cell,
|
|
207
|
-
style.Draggable,
|
|
208
|
-
cellClassName
|
|
209
|
-
].join( ' ' ) }
|
|
210
|
-
>
|
|
211
|
-
<FAIcon.ArrowRight
|
|
212
|
-
fontColor='theme'
|
|
213
|
-
/>
|
|
214
|
-
</Comps.TH> );
|
|
215
|
-
|
|
216
|
-
let cols = val_info.rows[ origin ];
|
|
217
|
-
cols.forEach( ( col,colIndex ) => {
|
|
218
|
-
col = { ...col as any }
|
|
219
|
-
|
|
220
|
-
let Cell = Comps[ col.type == 'th' ? 'TH' : 'TD' ];
|
|
221
|
-
Cols.push( <Cell
|
|
222
|
-
{ ...cellStyles }
|
|
223
|
-
{ ...DefaultCellSystemStyles( {
|
|
224
|
-
top: false,
|
|
225
|
-
bottom: false,
|
|
226
|
-
left: false,
|
|
227
|
-
right: false
|
|
228
|
-
} ) }
|
|
229
|
-
{ ...cellStylesCallback ? cellStylesCallback( {
|
|
230
|
-
top: false,
|
|
231
|
-
bottom: false,
|
|
232
|
-
left: false,
|
|
233
|
-
right: false,
|
|
234
|
-
rowIndex: -1,
|
|
235
|
-
colIndex: -1,
|
|
236
|
-
isBody: true,
|
|
237
|
-
isHeader: false,
|
|
238
|
-
} ) : {} }
|
|
239
|
-
className={ [
|
|
240
|
-
style.Cell,
|
|
241
|
-
cellClassName,
|
|
242
|
-
col.className,
|
|
243
|
-
].join( ' ' ) }
|
|
244
|
-
backgroundColor='tcOpLow'
|
|
245
|
-
{ ...col }
|
|
246
|
-
/> );
|
|
247
|
-
} );
|
|
248
|
-
|
|
249
|
-
BodyRows.splice( to,0,<Comps.Row
|
|
250
|
-
key={ 'preSet' }
|
|
251
|
-
className={ [ style.Row,style.Pre ].join( ' ' ) }
|
|
252
|
-
children={ Cols }
|
|
253
|
-
/> )
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
useEffect( () => {
|
|
257
|
-
useStore.set( {
|
|
258
|
-
key: val_componentID,
|
|
259
|
-
value: {
|
|
260
|
-
swap: ( rowIndex: number,insertIndex: number ) => {
|
|
261
|
-
if ( insertIndex || insertIndex == 0 ) {
|
|
262
|
-
let targetRow = val_info.rows[ rowIndex ];
|
|
263
|
-
|
|
264
|
-
let newRows = [ ...val_info.rows ];
|
|
265
|
-
newRows.splice( rowIndex,1 );
|
|
266
|
-
newRows.splice( insertIndex - ( rowIndex < insertIndex ? 1 : 0 ),0,targetRow );
|
|
267
|
-
|
|
268
|
-
set_info( {
|
|
269
|
-
rows: newRows,
|
|
270
|
-
origin: 0,
|
|
271
|
-
to: NaN
|
|
272
|
-
} );
|
|
273
|
-
|
|
274
|
-
onOrderChanged( newRows.map( ( row ) => JSON.parse( row.rowID ) ) );
|
|
275
|
-
}
|
|
276
|
-
},
|
|
277
|
-
preSet: ( props: {
|
|
278
|
-
origin: number,
|
|
279
|
-
index: number
|
|
280
|
-
} ) => {
|
|
281
|
-
let {
|
|
282
|
-
origin,index
|
|
283
|
-
} = props;
|
|
284
|
-
|
|
285
|
-
set_info( {
|
|
286
|
-
rows: val_info.rows,
|
|
287
|
-
origin: origin,
|
|
288
|
-
to: index
|
|
289
|
-
} );
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
} )
|
|
293
|
-
} );
|
|
294
|
-
useEffect( () => {
|
|
295
|
-
return () => {
|
|
296
|
-
useStore.delete( val_componentID );
|
|
297
|
-
}
|
|
298
|
-
},[] );
|
|
299
|
-
|
|
300
|
-
return ( <>
|
|
301
|
-
{ BodyRows }
|
|
302
|
-
</> );
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
export const DragTable: FNC<amotify.fn.Tables.Drag.Params> = ( params ) => {
|
|
307
|
-
params.colLength = params.colLength + 1;
|
|
308
|
-
|
|
309
|
-
if ( params.head ) {
|
|
310
|
-
params.head = [
|
|
311
|
-
{
|
|
312
|
-
children: <Buttons.Button.Plain
|
|
313
|
-
ssSphere={ 3 }
|
|
314
|
-
fontSize={ '3.paragraph' }
|
|
315
|
-
fontColor={ 'theme' }
|
|
316
|
-
onMouseOver={ ( event ) => {
|
|
317
|
-
Tooltips.open( {
|
|
318
|
-
parent: event.currentTarget,
|
|
319
|
-
padding: [ 0,1 ],
|
|
320
|
-
content: <Tooltips.Comps.Body>
|
|
321
|
-
<FAIcon
|
|
322
|
-
d='grip-dots-vertical'
|
|
323
|
-
/>
|
|
324
|
-
ボタンをドラッグして順序を変更
|
|
325
|
-
</Tooltips.Comps.Body>
|
|
326
|
-
} );
|
|
327
|
-
} }
|
|
328
|
-
>
|
|
329
|
-
<FAIcon.QuestionCircle />
|
|
330
|
-
</Buttons.Button.Plain>,
|
|
331
|
-
padding: [ 0,1 ],
|
|
332
|
-
unitWidth: 4
|
|
333
|
-
},
|
|
334
|
-
...params.head
|
|
335
|
-
];
|
|
336
|
-
}
|
|
337
|
-
params.rows = params.rows.map( ( row,rowIndex ) => {
|
|
338
|
-
row.rowID = JSON.stringify( row.rowID || rowIndex );
|
|
339
|
-
return row;
|
|
340
|
-
} );
|
|
341
|
-
|
|
342
|
-
return ( <Comps.Table className={ style.Table }>
|
|
343
|
-
<HeadRow { ...params } />
|
|
344
|
-
<BodyRows { ...params } />
|
|
345
|
-
</Comps.Table> );
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
type InfoParams = {
|
|
349
|
-
id: string
|
|
350
|
-
index: number
|
|
351
|
-
maxLength: number
|
|
352
|
-
rows: amotify.fn.Tables.Drag.BodyRowParams[]
|
|
353
|
-
insertIndex?: number
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
const EffectStart = async function ( event: any,info: InfoParams ) {
|
|
357
|
-
event.stopPropagation();
|
|
358
|
-
event.preventDefault();
|
|
359
|
-
|
|
360
|
-
let {
|
|
361
|
-
id,
|
|
362
|
-
index,
|
|
363
|
-
rows,
|
|
364
|
-
maxLength
|
|
365
|
-
} = info;
|
|
366
|
-
|
|
367
|
-
$( '#TableRow-' + id + '-' + index ).addClass( style.DraggerOrigin );
|
|
368
|
-
|
|
369
|
-
$( document )
|
|
370
|
-
.addEvent( {
|
|
371
|
-
eventID: 'DragMouseMove',
|
|
372
|
-
eventType: 'mousemove',
|
|
373
|
-
callback: ( event ) => { EffectMove( event,info ) },
|
|
374
|
-
option: { passive: false }
|
|
375
|
-
} )
|
|
376
|
-
.addEvent( {
|
|
377
|
-
eventID: 'DragTouchMove',
|
|
378
|
-
eventType: 'touchmove',
|
|
379
|
-
callback: ( event ) => { EffectMove( event,info ) },
|
|
380
|
-
option: { passive: false }
|
|
381
|
-
} )
|
|
382
|
-
.addEvent( {
|
|
383
|
-
eventID: 'DragMouseUp',
|
|
384
|
-
eventType: 'mouseup',
|
|
385
|
-
callback: ( event ) => { EffectEnd( event,info ) }
|
|
386
|
-
} )
|
|
387
|
-
.addEvent( {
|
|
388
|
-
eventID: 'DragTouchEnd',
|
|
389
|
-
eventType: 'touchend',
|
|
390
|
-
callback: ( event ) => { EffectEnd( event,info ) }
|
|
391
|
-
} );
|
|
392
|
-
}
|
|
393
|
-
const EffectMove = function ( event: any,info: InfoParams ) {
|
|
394
|
-
let {
|
|
395
|
-
id,
|
|
396
|
-
maxLength
|
|
397
|
-
} = info;
|
|
398
|
-
|
|
399
|
-
let Y = $.getCursor( event ).y - $.getScreenSize().scrollY;
|
|
400
|
-
|
|
401
|
-
for ( let rowIndex = 0; rowIndex < maxLength; rowIndex++ ) {
|
|
402
|
-
let Row = $( '#TableRow-' + id + '-' + rowIndex );
|
|
403
|
-
let {
|
|
404
|
-
top: rT,
|
|
405
|
-
bottom: rB,
|
|
406
|
-
height: rH
|
|
407
|
-
} = Row.position();
|
|
408
|
-
|
|
409
|
-
if ( rowIndex == 0 && Y < rT ) {
|
|
410
|
-
info.insertIndex = 0;
|
|
411
|
-
} else if ( rowIndex === maxLength - 1 && rB <= Y ) {
|
|
412
|
-
info.insertIndex = maxLength;
|
|
413
|
-
} else if ( Y >= rT && Y < rB ) {
|
|
414
|
-
info.insertIndex = rowIndex + 1;
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
{
|
|
419
|
-
let {
|
|
420
|
-
index,
|
|
421
|
-
insertIndex
|
|
422
|
-
} = info;
|
|
423
|
-
|
|
424
|
-
let component = useStore.get( id );
|
|
425
|
-
if ( component && component.preSet ) component.preSet( {
|
|
426
|
-
origin: index,
|
|
427
|
-
index: insertIndex
|
|
428
|
-
} );
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
event.stopPropagation();
|
|
432
|
-
event.preventDefault();
|
|
433
|
-
return false;
|
|
434
|
-
}
|
|
435
|
-
const EffectEnd = function ( event: any,info: InfoParams ) {
|
|
436
|
-
let {
|
|
437
|
-
id,
|
|
438
|
-
index,
|
|
439
|
-
insertIndex
|
|
440
|
-
} = info;
|
|
441
|
-
|
|
442
|
-
let component = useStore.get( id );
|
|
443
|
-
if ( component && component.swap ) component.swap( index,insertIndex );
|
|
444
|
-
|
|
445
|
-
$( '#TableRow-' + id + '-' + index ).removeClass( style.DraggerOrigin );
|
|
446
|
-
|
|
447
|
-
$( document ).removeEvent( [ 'DragMouseMove','DragTouchMove','DragMouseUp','DragTouchEnd' ] );
|
|
448
|
-
}
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import style from '../style.module.scss';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
Comps,
|
|
5
|
-
DefaultCellSystemStyles
|
|
6
|
-
} from '../_';
|
|
7
|
-
|
|
8
|
-
const HeadRow: FNC<amotify.fn.Tables.Normal.Params> = ( params ) => {
|
|
9
|
-
let {
|
|
10
|
-
cellStyles = {},
|
|
11
|
-
cellClassName = '',
|
|
12
|
-
cellStylesCallback,
|
|
13
|
-
colLength,
|
|
14
|
-
head,
|
|
15
|
-
rows
|
|
16
|
-
} = params;
|
|
17
|
-
|
|
18
|
-
if ( !head ) return null;
|
|
19
|
-
|
|
20
|
-
let Cols: ReactElement[] = [];
|
|
21
|
-
head.forEach( ( col,colIndex ) => {
|
|
22
|
-
let Cell = Comps[ col.type == 'th' ? 'TH' : 'TD' ];
|
|
23
|
-
Cols.push( <Cell
|
|
24
|
-
{ ...cellStyles }
|
|
25
|
-
{ ...DefaultCellSystemStyles( {
|
|
26
|
-
top: true,
|
|
27
|
-
bottom: !rows.length,
|
|
28
|
-
left: colIndex == 0,
|
|
29
|
-
right: colIndex == colLength - 1
|
|
30
|
-
} ) }
|
|
31
|
-
{ ...cellStylesCallback ? cellStylesCallback( {
|
|
32
|
-
top: true,
|
|
33
|
-
bottom: !rows.length,
|
|
34
|
-
left: colIndex == 0,
|
|
35
|
-
right: colIndex == colLength - 1,
|
|
36
|
-
rowIndex: 0,
|
|
37
|
-
colIndex,
|
|
38
|
-
isBody: false,
|
|
39
|
-
isHeader: true,
|
|
40
|
-
} ) : {} }
|
|
41
|
-
className={ [
|
|
42
|
-
style.Cell,
|
|
43
|
-
cellClassName,
|
|
44
|
-
col.className,
|
|
45
|
-
].join( ' ' ) }
|
|
46
|
-
{ ...col }
|
|
47
|
-
/> );
|
|
48
|
-
} )
|
|
49
|
-
|
|
50
|
-
return ( <Comps.Row
|
|
51
|
-
className={ [ style.Row,style.HeadRow ].join( ' ' ) }
|
|
52
|
-
children={ Cols }
|
|
53
|
-
/> );
|
|
54
|
-
}
|
|
55
|
-
const BodyRows: FNC<amotify.fn.Tables.Normal.Params> = ( params ) => {
|
|
56
|
-
let {
|
|
57
|
-
cellStyles = {},
|
|
58
|
-
cellClassName = '',
|
|
59
|
-
cellStylesCallback,
|
|
60
|
-
head,
|
|
61
|
-
rows,
|
|
62
|
-
colLength,
|
|
63
|
-
onRowClick,
|
|
64
|
-
} = params;
|
|
65
|
-
|
|
66
|
-
let BodyRows: ReactElement[] = [];
|
|
67
|
-
rows.forEach( ( cols,rowIndex ) => {
|
|
68
|
-
let Cols: ReactElement[] = [];
|
|
69
|
-
cols.forEach( ( col,colIndex ) => {
|
|
70
|
-
let Cell = Comps[ col.type == 'th' ? 'TH' : 'TD' ];
|
|
71
|
-
Cols.push( <Cell
|
|
72
|
-
{ ...cellStyles }
|
|
73
|
-
{ ...DefaultCellSystemStyles( {
|
|
74
|
-
top: rowIndex == 0 && !head,
|
|
75
|
-
bottom: rowIndex == rows.length - 1,
|
|
76
|
-
left: colIndex == 0,
|
|
77
|
-
right: colIndex == colLength - 1
|
|
78
|
-
} ) }
|
|
79
|
-
{ ...cellStylesCallback ? cellStylesCallback( {
|
|
80
|
-
top: rowIndex == 0 && !head,
|
|
81
|
-
bottom: rowIndex == rows.length - 1,
|
|
82
|
-
left: colIndex == 0,
|
|
83
|
-
right: colIndex == colLength - 1,
|
|
84
|
-
rowIndex,
|
|
85
|
-
colIndex,
|
|
86
|
-
isBody: true,
|
|
87
|
-
isHeader: false,
|
|
88
|
-
} ) : {} }
|
|
89
|
-
className={ [
|
|
90
|
-
style.Cell,
|
|
91
|
-
cellClassName,
|
|
92
|
-
col.className,
|
|
93
|
-
].join( ' ' ) }
|
|
94
|
-
{ ...col }
|
|
95
|
-
/> );
|
|
96
|
-
} );
|
|
97
|
-
|
|
98
|
-
BodyRows.push( <Comps.Row
|
|
99
|
-
key={ rowIndex }
|
|
100
|
-
className={ [ style.Row,style.BodyRow ].join( ' ' ) }
|
|
101
|
-
children={ Cols }
|
|
102
|
-
onClick={ ( event ) => {
|
|
103
|
-
if ( onRowClick ) onRowClick( cols.rowID as any,event );
|
|
104
|
-
} }
|
|
105
|
-
/> );
|
|
106
|
-
} );
|
|
107
|
-
|
|
108
|
-
return ( <>
|
|
109
|
-
{ BodyRows }
|
|
110
|
-
</> );
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
export const NormalTable: FNC<amotify.fn.Tables.Normal.Params> = ( params ) => {
|
|
114
|
-
params.rows = params.rows.map( ( row,rowIndex ) => {
|
|
115
|
-
row.rowID = row.rowID || rowIndex;
|
|
116
|
-
return row;
|
|
117
|
-
} );
|
|
118
|
-
|
|
119
|
-
return ( <Comps.Table className={ style.Table }>
|
|
120
|
-
<HeadRow { ...params } />
|
|
121
|
-
<BodyRows { ...params } />
|
|
122
|
-
</Comps.Table> );
|
|
123
|
-
}
|