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.
Files changed (233) hide show
  1. package/dist/@jsminAmotifyExtension/formCollect.js +1 -1
  2. package/dist/Atoms/Logo/parts.js +1 -1
  3. package/dist/Atoms/Various/parts.js +1 -1
  4. package/dist/Functions/Button/_.js +1 -1
  5. package/dist/Functions/Cropper/parts.js +4 -4
  6. package/dist/Functions/Effects/Fade.js +2 -2
  7. package/dist/Functions/Input/Chips/Selector.js +4 -4
  8. package/dist/Functions/Input/Chips/_.js +3 -3
  9. package/dist/Functions/Input/DigitCharacters.js +3 -3
  10. package/dist/Functions/Input/File/_.js +4 -4
  11. package/dist/Functions/Input/List/_.js +3 -3
  12. package/dist/Functions/Input/Segmented/_.js +1 -1
  13. package/dist/Functions/Input/Select/_.js +2 -2
  14. package/dist/Functions/Input/Slider/_.js +3 -3
  15. package/dist/Functions/Input/Switch/_.js +4 -4
  16. package/dist/Functions/Input/Text.js +2 -2
  17. package/dist/Functions/Input/TextArea.js +1 -1
  18. package/dist/Functions/Input/Time/Picker.js +4 -4
  19. package/dist/Functions/Input/Time/_.js +3 -3
  20. package/dist/Functions/Input/_.js +4 -4
  21. package/dist/Functions/Input/core.js +4 -4
  22. package/dist/Functions/Inputs/text.js +1 -1
  23. package/dist/Functions/Layout/PageNotFound.js +3 -3
  24. package/dist/Functions/Layout/PageRouter.js +2 -2
  25. package/dist/Functions/Layout/PageViewController/parts.js +2 -2
  26. package/dist/Functions/Layout/Plate.js +1 -1
  27. package/dist/Functions/Layout/RootViewController/parts.js +4 -4
  28. package/dist/Functions/Layout/SwipeView/parts.js +2 -2
  29. package/dist/Functions/Layout/TabBar.js +3 -3
  30. package/dist/Functions/Loader/corner.js +2 -2
  31. package/dist/Functions/Loader/mini.js +2 -2
  32. package/dist/Functions/Loader/parts.js +1 -1
  33. package/dist/Functions/Loader/top.js +2 -2
  34. package/dist/Functions/Sheet/parts.js +4 -4
  35. package/dist/Functions/SnackBar/parts.js +4 -4
  36. package/dist/Functions/Table/Data/parts.js +4 -4
  37. package/dist/Functions/Table/Drag/parts.js +3 -3
  38. package/dist/Functions/Table/_.js +2 -2
  39. package/dist/Functions/Tooltips/parts.js +2 -2
  40. package/dist/Molecules/@export.js +1 -1
  41. package/dist/Molecules/Accordion/parts.js +2 -2
  42. package/dist/Molecules/LinkifyText/parts.js +2 -2
  43. package/dist/Molecules/List.js +1 -1
  44. package/dist/Organisms/DisplayStyleInput/darkmode.js +4 -4
  45. package/dist/Organisms/DisplayStyleInput/themeColor.js +4 -4
  46. package/dist/Templates/PlayGround/parts.js +5 -5
  47. package/dist/launch.js +6 -6
  48. package/package.json +6 -5
  49. package/public/amotify.js +310 -0
  50. package/public/amotify.min.css +12724 -0
  51. package/dist/src/@jsminAmotifyExtension/_.d.ts +0 -4
  52. package/dist/src/@jsminAmotifyExtension/fetch.d.ts +0 -9
  53. package/dist/src/@jsminAmotifyExtension/formCollect.d.ts +0 -1
  54. package/dist/src/@jsminAmotifyExtension/spreadSheet.d.ts +0 -4
  55. package/dist/src/@jsminAmotifyExtension/variables.d.ts +0 -0
  56. package/dist/src/@types/_.d.ts +0 -6
  57. package/dist/src/@types/amot.d.ts +0 -260
  58. package/dist/src/@types/fn.d.ts +0 -1040
  59. package/dist/src/@types/index.d.ts +0 -62
  60. package/dist/src/@types/jsminAmotifyExtension.d.ts +0 -134
  61. package/dist/src/@types/module.d.ts +0 -2
  62. package/dist/src/@types/state.d.ts +0 -145
  63. package/dist/src/Atoms/@export.d.ts +0 -4
  64. package/dist/src/Atoms/FAIcon/parts.d.ts +0 -2
  65. package/dist/src/Atoms/Logo/parts.d.ts +0 -1
  66. package/dist/src/Atoms/Various/parts.d.ts +0 -9
  67. package/dist/src/Functions/@export.d.ts +0 -12
  68. package/dist/src/Functions/Button/_.d.ts +0 -1
  69. package/dist/src/Functions/Cropper/parts.d.ts +0 -1
  70. package/dist/src/Functions/Effects/Fade.d.ts +0 -1
  71. package/dist/src/Functions/Effects/Ripple.d.ts +0 -1
  72. package/dist/src/Functions/Effects/_.d.ts +0 -3
  73. package/dist/src/Functions/Input/Chips/Selector.d.ts +0 -1
  74. package/dist/src/Functions/Input/Chips/_.d.ts +0 -2
  75. package/dist/src/Functions/Input/DigitCharacters.d.ts +0 -1
  76. package/dist/src/Functions/Input/File/_.d.ts +0 -2
  77. package/dist/src/Functions/Input/Hidden.d.ts +0 -1
  78. package/dist/src/Functions/Input/List/_.d.ts +0 -1
  79. package/dist/src/Functions/Input/Segmented/_.d.ts +0 -1
  80. package/dist/src/Functions/Input/Select/_.d.ts +0 -1
  81. package/dist/src/Functions/Input/Slider/_.d.ts +0 -1
  82. package/dist/src/Functions/Input/Switch/_.d.ts +0 -1
  83. package/dist/src/Functions/Input/Text.d.ts +0 -5
  84. package/dist/src/Functions/Input/TextArea.d.ts +0 -1
  85. package/dist/src/Functions/Input/Time/Picker.d.ts +0 -1
  86. package/dist/src/Functions/Input/Time/_.d.ts +0 -2
  87. package/dist/src/Functions/Input/_.d.ts +0 -5
  88. package/dist/src/Functions/Input/core.d.ts +0 -34
  89. package/dist/src/Functions/Inputs/_.d.ts +0 -3
  90. package/dist/src/Functions/Inputs/text.d.ts +0 -12
  91. package/dist/src/Functions/Layout/PageNotFound.d.ts +0 -1
  92. package/dist/src/Functions/Layout/PageRouter.d.ts +0 -2
  93. package/dist/src/Functions/Layout/PageViewController/parts.d.ts +0 -1
  94. package/dist/src/Functions/Layout/Plate.d.ts +0 -1
  95. package/dist/src/Functions/Layout/RootViewController/parts.d.ts +0 -1
  96. package/dist/src/Functions/Layout/SwipeView/parts.d.ts +0 -2
  97. package/dist/src/Functions/Layout/TabBar.d.ts +0 -1
  98. package/dist/src/Functions/Layout/_.d.ts +0 -2
  99. package/dist/src/Functions/Loader/corner.d.ts +0 -1
  100. package/dist/src/Functions/Loader/mini.d.ts +0 -33
  101. package/dist/src/Functions/Loader/parts.d.ts +0 -3
  102. package/dist/src/Functions/Loader/top.d.ts +0 -1
  103. package/dist/src/Functions/Sheet/parts.d.ts +0 -2
  104. package/dist/src/Functions/SnackBar/parts.d.ts +0 -2
  105. package/dist/src/Functions/Table/Data/parts.d.ts +0 -3
  106. package/dist/src/Functions/Table/Drag/parts.d.ts +0 -1
  107. package/dist/src/Functions/Table/Normal/parts.d.ts +0 -1
  108. package/dist/src/Functions/Table/_.d.ts +0 -9
  109. package/dist/src/Functions/Tooltips/parts.d.ts +0 -2
  110. package/dist/src/Global/@export.d.ts +0 -12
  111. package/dist/src/Global/LaunchReactApplication.d.ts +0 -1
  112. package/dist/src/Global/styleConverter.d.ts +0 -2
  113. package/dist/src/Molecules/@export.d.ts +0 -21
  114. package/dist/src/Molecules/Accordion/parts.d.ts +0 -2
  115. package/dist/src/Molecules/LinkifyText/parts.d.ts +0 -1
  116. package/dist/src/Molecules/List.d.ts +0 -1
  117. package/dist/src/Organisms/@export.d.ts +0 -2
  118. package/dist/src/Organisms/DisplayStyleInput/_.d.ts +0 -1
  119. package/dist/src/Organisms/DisplayStyleInput/darkmode.d.ts +0 -1
  120. package/dist/src/Organisms/DisplayStyleInput/themeColor.d.ts +0 -27
  121. package/dist/src/Templates/@export.d.ts +0 -2
  122. package/dist/src/Templates/PlayGround/parts.d.ts +0 -1
  123. package/dist/src/config.d.ts +0 -16
  124. package/dist/src/launch.d.ts +0 -9
  125. package/dist/src/preload.d.ts +0 -1
  126. package/src/@jsminAmotifyExtension/_.tsx +0 -4
  127. package/src/@jsminAmotifyExtension/fetch.tsx +0 -107
  128. package/src/@jsminAmotifyExtension/formCollect.tsx +0 -89
  129. package/src/@jsminAmotifyExtension/spreadSheet.tsx +0 -159
  130. package/src/@jsminAmotifyExtension/variables.tsx +0 -130
  131. package/src/@styles/@app.scss +0 -4
  132. package/src/@styles/@variables/customProps.scss +0 -109
  133. package/src/@styles/@variables/styleSet.scss +0 -38
  134. package/src/@styles/@variables/themeColor.scss +0 -71
  135. package/src/@styles/@variables/var.scss +0 -171
  136. package/src/@styles/UniStyling.scss +0 -996
  137. package/src/@styles/init.scss +0 -154
  138. package/src/@types/_.tsx +0 -6
  139. package/src/@types/amot.tsx +0 -323
  140. package/src/@types/fn.tsx +0 -1210
  141. package/src/@types/index.tsx +0 -74
  142. package/src/@types/jsminAmotifyExtension.tsx +0 -143
  143. package/src/@types/module.tsx +0 -2
  144. package/src/@types/state.tsx +0 -199
  145. package/src/Atoms/@export.tsx +0 -32
  146. package/src/Atoms/FAIcon/parts.tsx +0 -117
  147. package/src/Atoms/FAIcon/style.module.scss +0 -9
  148. package/src/Atoms/Logo/parts.tsx +0 -335
  149. package/src/Atoms/Logo/style.module.scss +0 -96
  150. package/src/Atoms/Various/parts.tsx +0 -157
  151. package/src/Atoms/Various/style.module.scss +0 -40
  152. package/src/Functions/@export.tsx +0 -29
  153. package/src/Functions/Button/_.tsx +0 -305
  154. package/src/Functions/Button/style.module.scss +0 -183
  155. package/src/Functions/Cropper/parts.tsx +0 -1061
  156. package/src/Functions/Cropper/style.module.scss +0 -62
  157. package/src/Functions/Effects/Fade.tsx +0 -81
  158. package/src/Functions/Effects/Ripple.tsx +0 -141
  159. package/src/Functions/Effects/_.tsx +0 -33
  160. package/src/Functions/Effects/style.module.scss +0 -83
  161. package/src/Functions/Input/Chips/Selector.tsx +0 -451
  162. package/src/Functions/Input/Chips/_.tsx +0 -286
  163. package/src/Functions/Input/Chips/style.module.scss +0 -6
  164. package/src/Functions/Input/DigitCharacters.tsx +0 -241
  165. package/src/Functions/Input/File/_.tsx +0 -596
  166. package/src/Functions/Input/File/style.module.scss +0 -34
  167. package/src/Functions/Input/Hidden.tsx +0 -18
  168. package/src/Functions/Input/List/_.tsx +0 -383
  169. package/src/Functions/Input/List/style.module.scss +0 -84
  170. package/src/Functions/Input/Segmented/_.tsx +0 -238
  171. package/src/Functions/Input/Segmented/style.module.scss +0 -81
  172. package/src/Functions/Input/Select/_.tsx +0 -225
  173. package/src/Functions/Input/Select/style.module.scss +0 -10
  174. package/src/Functions/Input/Slider/_.tsx +0 -519
  175. package/src/Functions/Input/Slider/style.module.scss +0 -67
  176. package/src/Functions/Input/Switch/_.tsx +0 -177
  177. package/src/Functions/Input/Switch/style.module.scss +0 -18
  178. package/src/Functions/Input/Text.tsx +0 -437
  179. package/src/Functions/Input/TextArea.tsx +0 -115
  180. package/src/Functions/Input/Time/Picker.tsx +0 -950
  181. package/src/Functions/Input/Time/_.tsx +0 -736
  182. package/src/Functions/Input/Time/style.module.scss +0 -72
  183. package/src/Functions/Input/_.tsx +0 -793
  184. package/src/Functions/Input/core.tsx +0 -461
  185. package/src/Functions/Input/style.module.scss +0 -43
  186. package/src/Functions/Inputs/_.tsx +0 -5
  187. package/src/Functions/Inputs/style.module.scss +0 -15
  188. package/src/Functions/Inputs/text.tsx +0 -67
  189. package/src/Functions/Inputs/types.d.ts +0 -1
  190. package/src/Functions/Layout/PageNotFound.tsx +0 -81
  191. package/src/Functions/Layout/PageRouter.tsx +0 -107
  192. package/src/Functions/Layout/PageViewController/parts.tsx +0 -32
  193. package/src/Functions/Layout/Plate.tsx +0 -30
  194. package/src/Functions/Layout/RootViewController/parts.tsx +0 -290
  195. package/src/Functions/Layout/RootViewController/style.module.scss +0 -24
  196. package/src/Functions/Layout/SwipeView/parts.tsx +0 -380
  197. package/src/Functions/Layout/SwipeView/style.module.scss +0 -19
  198. package/src/Functions/Layout/TabBar.tsx +0 -64
  199. package/src/Functions/Layout/_.tsx +0 -20
  200. package/src/Functions/Loader/corner.tsx +0 -78
  201. package/src/Functions/Loader/mini.tsx +0 -117
  202. package/src/Functions/Loader/parts.tsx +0 -105
  203. package/src/Functions/Loader/style.module.scss +0 -222
  204. package/src/Functions/Loader/top.tsx +0 -90
  205. package/src/Functions/Sheet/parts.tsx +0 -972
  206. package/src/Functions/Sheet/style.module.scss +0 -235
  207. package/src/Functions/SnackBar/parts.tsx +0 -215
  208. package/src/Functions/SnackBar/style.module.scss +0 -25
  209. package/src/Functions/Table/Data/parts.tsx +0 -955
  210. package/src/Functions/Table/Drag/parts.tsx +0 -448
  211. package/src/Functions/Table/Normal/parts.tsx +0 -123
  212. package/src/Functions/Table/_.tsx +0 -170
  213. package/src/Functions/Table/style.module.scss +0 -92
  214. package/src/Functions/Tooltips/parts.tsx +0 -52
  215. package/src/Global/@export.tsx +0 -138
  216. package/src/Global/LaunchReactApplication.tsx +0 -30
  217. package/src/Global/exe.tsx +0 -0
  218. package/src/Global/styleConverter.tsx +0 -435
  219. package/src/Molecules/@export.tsx +0 -95
  220. package/src/Molecules/Accordion/parts.tsx +0 -146
  221. package/src/Molecules/Accordion/style.module.scss +0 -13
  222. package/src/Molecules/LinkifyText/parts.tsx +0 -54
  223. package/src/Molecules/List.tsx +0 -30
  224. package/src/Organisms/@export.tsx +0 -5
  225. package/src/Organisms/DisplayStyleInput/_.tsx +0 -18
  226. package/src/Organisms/DisplayStyleInput/darkmode.tsx +0 -112
  227. package/src/Organisms/DisplayStyleInput/themeColor.tsx +0 -210
  228. package/src/Templates/@export.tsx +0 -7
  229. package/src/Templates/PlayGround/parts.tsx +0 -115
  230. package/src/Templates/PlayGround/style.module.scss +0 -38
  231. package/src/config.tsx +0 -132
  232. package/src/launch.tsx +0 -100
  233. 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
- }