amotify 0.0.2 → 0.0.4

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 (185) hide show
  1. package/dist/src/@jsminAmotifyExtension/_.d.ts +4 -0
  2. package/dist/src/@jsminAmotifyExtension/fetch.d.ts +9 -0
  3. package/dist/src/@jsminAmotifyExtension/formCollect.d.ts +1 -0
  4. package/dist/src/@jsminAmotifyExtension/spreadSheet.d.ts +4 -0
  5. package/dist/src/@jsminAmotifyExtension/variables.d.ts +0 -0
  6. package/dist/src/@types/_.d.ts +6 -0
  7. package/dist/src/@types/amot.d.ts +260 -0
  8. package/dist/src/@types/fn.d.ts +1040 -0
  9. package/dist/src/@types/index.d.ts +62 -0
  10. package/dist/src/@types/jsminAmotifyExtension.d.ts +134 -0
  11. package/dist/src/@types/module.d.ts +2 -0
  12. package/dist/src/@types/state.d.ts +145 -0
  13. package/dist/src/Atoms/@export.d.ts +4 -0
  14. package/dist/src/Atoms/FAIcon/parts.d.ts +2 -0
  15. package/dist/src/Atoms/Logo/parts.d.ts +1 -0
  16. package/dist/src/Atoms/Various/parts.d.ts +9 -0
  17. package/dist/src/Functions/@export.d.ts +12 -0
  18. package/dist/src/Functions/Button/_.d.ts +1 -0
  19. package/dist/src/Functions/Cropper/parts.d.ts +1 -0
  20. package/dist/src/Functions/Effects/Fade.d.ts +1 -0
  21. package/dist/src/Functions/Effects/Ripple.d.ts +1 -0
  22. package/dist/src/Functions/Effects/_.d.ts +3 -0
  23. package/dist/src/Functions/Input/Chips/Selector.d.ts +1 -0
  24. package/dist/src/Functions/Input/Chips/_.d.ts +2 -0
  25. package/dist/src/Functions/Input/DigitCharacters.d.ts +1 -0
  26. package/dist/src/Functions/Input/File/_.d.ts +2 -0
  27. package/dist/src/Functions/Input/Hidden.d.ts +1 -0
  28. package/dist/src/Functions/Input/List/_.d.ts +1 -0
  29. package/dist/src/Functions/Input/Segmented/_.d.ts +1 -0
  30. package/dist/src/Functions/Input/Select/_.d.ts +1 -0
  31. package/dist/src/Functions/Input/Slider/_.d.ts +1 -0
  32. package/dist/src/Functions/Input/Switch/_.d.ts +1 -0
  33. package/dist/src/Functions/Input/Text.d.ts +5 -0
  34. package/dist/src/Functions/Input/TextArea.d.ts +1 -0
  35. package/dist/src/Functions/Input/Time/Picker.d.ts +1 -0
  36. package/dist/src/Functions/Input/Time/_.d.ts +2 -0
  37. package/dist/src/Functions/Input/_.d.ts +5 -0
  38. package/dist/src/Functions/Input/core.d.ts +34 -0
  39. package/dist/src/Functions/Inputs/_.d.ts +3 -0
  40. package/dist/src/Functions/Inputs/text.d.ts +12 -0
  41. package/dist/src/Functions/Layout/PageNotFound.d.ts +1 -0
  42. package/dist/src/Functions/Layout/PageRouter.d.ts +2 -0
  43. package/dist/src/Functions/Layout/PageViewController/parts.d.ts +1 -0
  44. package/dist/src/Functions/Layout/Plate.d.ts +1 -0
  45. package/dist/src/Functions/Layout/RootViewController/parts.d.ts +1 -0
  46. package/dist/src/Functions/Layout/SwipeView/parts.d.ts +2 -0
  47. package/dist/src/Functions/Layout/TabBar.d.ts +1 -0
  48. package/dist/src/Functions/Layout/_.d.ts +2 -0
  49. package/dist/src/Functions/Loader/corner.d.ts +1 -0
  50. package/dist/src/Functions/Loader/mini.d.ts +33 -0
  51. package/dist/src/Functions/Loader/parts.d.ts +3 -0
  52. package/dist/src/Functions/Loader/top.d.ts +1 -0
  53. package/dist/src/Functions/Sheet/parts.d.ts +2 -0
  54. package/dist/src/Functions/SnackBar/parts.d.ts +2 -0
  55. package/dist/src/Functions/Table/Data/parts.d.ts +3 -0
  56. package/dist/src/Functions/Table/Drag/parts.d.ts +1 -0
  57. package/dist/src/Functions/Table/Normal/parts.d.ts +1 -0
  58. package/dist/src/Functions/Table/_.d.ts +9 -0
  59. package/dist/src/Functions/Tooltips/parts.d.ts +2 -0
  60. package/dist/src/Global/@export.d.ts +12 -0
  61. package/dist/src/Global/LaunchReactApplication.d.ts +1 -0
  62. package/dist/src/Global/styleConverter.d.ts +2 -0
  63. package/dist/src/Molecules/@export.d.ts +21 -0
  64. package/dist/src/Molecules/Accordion/parts.d.ts +2 -0
  65. package/dist/src/Molecules/LinkifyText/parts.d.ts +1 -0
  66. package/dist/src/Molecules/List.d.ts +1 -0
  67. package/dist/src/Organisms/@export.d.ts +2 -0
  68. package/dist/src/Organisms/DisplayStyleInput/_.d.ts +1 -0
  69. package/dist/src/Organisms/DisplayStyleInput/darkmode.d.ts +1 -0
  70. package/dist/src/Organisms/DisplayStyleInput/themeColor.d.ts +27 -0
  71. package/dist/src/Templates/@export.d.ts +2 -0
  72. package/dist/src/Templates/PlayGround/parts.d.ts +1 -0
  73. package/dist/src/config.d.ts +16 -0
  74. package/dist/src/launch.d.ts +9 -0
  75. package/dist/src/preload.d.ts +1 -0
  76. package/package.json +2 -2
  77. package/src/@jsminAmotifyExtension/_.tsx +4 -0
  78. package/src/@jsminAmotifyExtension/fetch.tsx +107 -0
  79. package/src/@jsminAmotifyExtension/formCollect.tsx +89 -0
  80. package/src/@jsminAmotifyExtension/spreadSheet.tsx +159 -0
  81. package/src/@jsminAmotifyExtension/variables.tsx +130 -0
  82. package/src/@styles/@app.scss +4 -0
  83. package/src/@styles/@variables/customProps.scss +109 -0
  84. package/src/@styles/@variables/styleSet.scss +38 -0
  85. package/src/@styles/@variables/themeColor.scss +71 -0
  86. package/src/@styles/@variables/var.scss +171 -0
  87. package/src/@styles/UniStyling.scss +996 -0
  88. package/src/@styles/init.scss +154 -0
  89. package/src/@types/_.tsx +6 -0
  90. package/src/@types/amot.tsx +323 -0
  91. package/src/@types/fn.tsx +1210 -0
  92. package/src/@types/index.tsx +74 -0
  93. package/src/@types/jsminAmotifyExtension.tsx +143 -0
  94. package/src/@types/module.tsx +2 -0
  95. package/src/@types/state.tsx +199 -0
  96. package/src/Atoms/@export.tsx +32 -0
  97. package/src/Atoms/FAIcon/parts.tsx +117 -0
  98. package/src/Atoms/FAIcon/style.module.scss +9 -0
  99. package/src/Atoms/Logo/parts.tsx +335 -0
  100. package/src/Atoms/Logo/style.module.scss +96 -0
  101. package/src/Atoms/Various/parts.tsx +157 -0
  102. package/src/Atoms/Various/style.module.scss +40 -0
  103. package/src/Functions/@export.tsx +29 -0
  104. package/src/Functions/Button/_.tsx +305 -0
  105. package/src/Functions/Button/style.module.scss +183 -0
  106. package/src/Functions/Cropper/parts.tsx +1061 -0
  107. package/src/Functions/Cropper/style.module.scss +62 -0
  108. package/src/Functions/Effects/Fade.tsx +81 -0
  109. package/src/Functions/Effects/Ripple.tsx +141 -0
  110. package/src/Functions/Effects/_.tsx +33 -0
  111. package/src/Functions/Effects/style.module.scss +83 -0
  112. package/src/Functions/Input/Chips/Selector.tsx +451 -0
  113. package/src/Functions/Input/Chips/_.tsx +286 -0
  114. package/src/Functions/Input/Chips/style.module.scss +6 -0
  115. package/src/Functions/Input/DigitCharacters.tsx +241 -0
  116. package/src/Functions/Input/File/_.tsx +596 -0
  117. package/src/Functions/Input/File/style.module.scss +34 -0
  118. package/src/Functions/Input/Hidden.tsx +18 -0
  119. package/src/Functions/Input/List/_.tsx +383 -0
  120. package/src/Functions/Input/List/style.module.scss +84 -0
  121. package/src/Functions/Input/Segmented/_.tsx +238 -0
  122. package/src/Functions/Input/Segmented/style.module.scss +81 -0
  123. package/src/Functions/Input/Select/_.tsx +225 -0
  124. package/src/Functions/Input/Select/style.module.scss +10 -0
  125. package/src/Functions/Input/Slider/_.tsx +519 -0
  126. package/src/Functions/Input/Slider/style.module.scss +67 -0
  127. package/src/Functions/Input/Switch/_.tsx +177 -0
  128. package/src/Functions/Input/Switch/style.module.scss +18 -0
  129. package/src/Functions/Input/Text.tsx +437 -0
  130. package/src/Functions/Input/TextArea.tsx +115 -0
  131. package/src/Functions/Input/Time/Picker.tsx +950 -0
  132. package/src/Functions/Input/Time/_.tsx +736 -0
  133. package/src/Functions/Input/Time/style.module.scss +72 -0
  134. package/src/Functions/Input/_.tsx +793 -0
  135. package/src/Functions/Input/core.tsx +461 -0
  136. package/src/Functions/Input/style.module.scss +43 -0
  137. package/src/Functions/Inputs/_.tsx +5 -0
  138. package/src/Functions/Inputs/style.module.scss +15 -0
  139. package/src/Functions/Inputs/text.tsx +67 -0
  140. package/src/Functions/Inputs/types.d.ts +1 -0
  141. package/src/Functions/Layout/PageNotFound.tsx +81 -0
  142. package/src/Functions/Layout/PageRouter.tsx +107 -0
  143. package/src/Functions/Layout/PageViewController/parts.tsx +32 -0
  144. package/src/Functions/Layout/Plate.tsx +30 -0
  145. package/src/Functions/Layout/RootViewController/parts.tsx +290 -0
  146. package/src/Functions/Layout/RootViewController/style.module.scss +24 -0
  147. package/src/Functions/Layout/SwipeView/parts.tsx +380 -0
  148. package/src/Functions/Layout/SwipeView/style.module.scss +19 -0
  149. package/src/Functions/Layout/TabBar.tsx +64 -0
  150. package/src/Functions/Layout/_.tsx +20 -0
  151. package/src/Functions/Loader/corner.tsx +78 -0
  152. package/src/Functions/Loader/mini.tsx +117 -0
  153. package/src/Functions/Loader/parts.tsx +105 -0
  154. package/src/Functions/Loader/style.module.scss +222 -0
  155. package/src/Functions/Loader/top.tsx +90 -0
  156. package/src/Functions/Sheet/parts.tsx +972 -0
  157. package/src/Functions/Sheet/style.module.scss +235 -0
  158. package/src/Functions/SnackBar/parts.tsx +215 -0
  159. package/src/Functions/SnackBar/style.module.scss +25 -0
  160. package/src/Functions/Table/Data/parts.tsx +955 -0
  161. package/src/Functions/Table/Drag/parts.tsx +448 -0
  162. package/src/Functions/Table/Normal/parts.tsx +123 -0
  163. package/src/Functions/Table/_.tsx +170 -0
  164. package/src/Functions/Table/style.module.scss +92 -0
  165. package/src/Functions/Tooltips/parts.tsx +52 -0
  166. package/src/Global/@export.tsx +138 -0
  167. package/src/Global/LaunchReactApplication.tsx +30 -0
  168. package/src/Global/exe.tsx +0 -0
  169. package/src/Global/styleConverter.tsx +435 -0
  170. package/src/Molecules/@export.tsx +95 -0
  171. package/src/Molecules/Accordion/parts.tsx +146 -0
  172. package/src/Molecules/Accordion/style.module.scss +13 -0
  173. package/src/Molecules/LinkifyText/parts.tsx +54 -0
  174. package/src/Molecules/List.tsx +30 -0
  175. package/src/Organisms/@export.tsx +5 -0
  176. package/src/Organisms/DisplayStyleInput/_.tsx +18 -0
  177. package/src/Organisms/DisplayStyleInput/darkmode.tsx +112 -0
  178. package/src/Organisms/DisplayStyleInput/themeColor.tsx +210 -0
  179. package/src/Templates/@export.tsx +7 -0
  180. package/src/Templates/PlayGround/parts.tsx +115 -0
  181. package/src/Templates/PlayGround/style.module.scss +38 -0
  182. package/src/config.tsx +132 -0
  183. package/src/launch.tsx +100 -0
  184. package/src/preload.tsx +49 -0
  185. package/tsconfig.json +27 -14
@@ -0,0 +1,950 @@
1
+ import {
2
+ React
3
+ } from '@global';
4
+ import {
5
+ Grid,
6
+ Box,
7
+ Flex,
8
+ FAIcon
9
+ } from '@atoms';
10
+ import {
11
+ Column,
12
+ Row,
13
+ Text
14
+ } from '@mols';
15
+ import {
16
+ Buttons,
17
+ Input,
18
+ Tooltips
19
+ } from '@functions';
20
+ const {
21
+ useEffect,
22
+ useRef,
23
+ useState
24
+ } = React;
25
+
26
+ import style from './style.module.scss';
27
+
28
+ let YearOptions: {
29
+ ( params?: {
30
+ min?: string
31
+ max?: string
32
+ } ): amotify.fn.Input.Select.OptionProps[]
33
+ } = ( params ) => {
34
+ let Years: amotify.fn.Input.Select.OptionProps[] = [];
35
+ let minYear = Number( params?.min ?? 1900 );
36
+ let maxYear = Number( params?.max ?? $.Time().addYear( 10 ).year );
37
+
38
+ for ( let year = minYear; year <= maxYear; year++ ) {
39
+ Years.push( {
40
+ value: year,
41
+ label: [ year,...$.transformer.wareki( year ).value ].join( ' - ' ),
42
+ // displayLabel: year + '年'
43
+ } );
44
+ }
45
+ return Years;
46
+ }
47
+
48
+ type ClockValueTypes = {
49
+ modifiedType: 'init' | 'override' | 'update'
50
+ hour: number
51
+ minutes: number
52
+ }
53
+ type DateValueTypes = {
54
+ modifiedType: 'init' | 'override' | 'update'
55
+ year: number
56
+ month: number
57
+ date: number
58
+ }
59
+ type MonthValueTypes = {
60
+ modifiedType: 'init' | 'override' | 'update'
61
+ year: number
62
+ month: number
63
+ }
64
+ type YearValueTypes = {
65
+ modifiedType: 'init' | 'override' | 'update'
66
+ year: number
67
+ }
68
+ type SendParams<T> = amotify.fn.Input.Time.PickerParams & {
69
+ val_value: T
70
+ set_value: React.Dispatch<React.SetStateAction<T>>
71
+ }
72
+
73
+ export const Picker: FNC<amotify.fn.Input.Time.PickerParams> = ( params ) => {
74
+ let {
75
+ restrict,
76
+ defaultValue = ''
77
+ } = params;
78
+
79
+ params.tipsID = params.tipsID || $.uuidGen();
80
+
81
+ const mounted = useRef( false );
82
+
83
+ let [ val_value,set_value ] = useState( ( () => {
84
+ if ( restrict == 'clock' ) {
85
+ let partValues: any = String( defaultValue ).split( /[^\d]/ );
86
+
87
+ if ( !partValues[ 0 ] ) partValues = [ 0,0 ];
88
+
89
+ let hour = Number( partValues[ 0 ] );
90
+ let minutes = Number( partValues[ 1 ] );
91
+
92
+ return {
93
+ modifiedType: 'init',
94
+ hour: hour,
95
+ minutes: minutes
96
+ } as ClockValueTypes;
97
+ } else if ( restrict == 'date' ) {
98
+ let [ year,month,date ] = String( defaultValue )?.split( /\D/ );
99
+ if ( $.is.nullish( year ) || $.is.nullish( month ) || $.is.nullish( date ) ) {
100
+ [ year,month,date ] = $.Time().toFormat( '%Y-%M-%D' ).split( '-' );
101
+ }
102
+
103
+ return {
104
+ modifiedType: 'init',
105
+ year: Number( year ),
106
+ month: Number( month ),
107
+ date: Number( date )
108
+ } as DateValueTypes;
109
+ } else if ( restrict == 'week' ) {
110
+ } else if ( restrict == 'month' ) {
111
+ let [ year,month ] = String( defaultValue ).split( /\D/ );
112
+ if ( $.is.nullish( year ) || $.is.nullish( month ) ) {
113
+ [ year,month ] = $.Time().toFormat( '%Y-%M' ).split( '-' );
114
+ }
115
+
116
+ return {
117
+ modifiedType: 'init',
118
+ year: Number( year ),
119
+ month: Number( month )
120
+ } as MonthValueTypes;
121
+ } else if ( restrict == 'year' ) {
122
+ let [ year ] = String( defaultValue ).split( /\D/ );
123
+ if ( $.is.nullish( year ) ) {
124
+ [ year ] = $.Time().toFormat( '%Y' ).split( '-' );
125
+ }
126
+
127
+ return {
128
+ modifiedType: 'init',
129
+ year: Number( year )
130
+ } as YearValueTypes;
131
+ }
132
+
133
+ return {}
134
+ } )() as any );
135
+
136
+ useEffect( () => {
137
+ if ( mounted.current ) {
138
+ if ( val_value.modifiedType == 'update' ) {
139
+ let sendValue = '';
140
+
141
+ if ( restrict == 'clock' ) {
142
+ let { hour,minutes } = val_value as ClockValueTypes;
143
+ sendValue = [
144
+ hour.zeroEmbed( 2 ),
145
+ minutes.zeroEmbed( 2 )
146
+ ].join( '/' );
147
+ } else if ( restrict == 'date' ) {
148
+ let { year,month,date } = val_value as DateValueTypes;
149
+ sendValue = [
150
+ year,
151
+ month.zeroEmbed( 2 ),
152
+ date.zeroEmbed( 2 )
153
+ ].join( '/' );
154
+ } else if ( restrict == 'week' ) {
155
+ } else if ( restrict == 'month' ) {
156
+ let { year,month } = val_value as MonthValueTypes;
157
+ sendValue = [
158
+ year,
159
+ month.zeroEmbed( 2 )
160
+ ].join( '/' );
161
+ } else if ( restrict == 'year' ) {
162
+ let { year } = val_value as YearValueTypes;
163
+ sendValue = String( year );
164
+ }
165
+ params.onValueUpdate( sendValue );
166
+ }
167
+ } else {
168
+ mounted.current = true;
169
+ }
170
+ },[ val_value ] );
171
+
172
+ let Params = {
173
+ ...params,
174
+ val_value,
175
+ set_value
176
+ }
177
+
178
+ return ( <Box
179
+ backgroundColor={ '1.layer.base' }
180
+ borderRadius={ '2.tone.secondary' }
181
+ boxShadow={ 3 }
182
+ border
183
+ overflow='hidden'
184
+ >
185
+ <Box
186
+ overflow={ 'auto' }
187
+ className={ style[ restrict.toCapital() + 'Base' ] }
188
+ children={ restrict == 'clock' ? <Comps.Clock._ { ...Params } />
189
+ : restrict == 'date' ? <Comps.Date._ { ...Params } />
190
+ : restrict == 'week' ? ''
191
+ : restrict == 'month' ? <Comps.Month._ { ...Params } />
192
+ : restrict == 'year' ? <Comps.Year._ { ...Params } />
193
+ : restrict == 'dates' ? ''
194
+ : restrict == 'months' ? ''
195
+ : restrict == 'dateWareki' ? ''
196
+ : <></> }
197
+ />
198
+ </Box> );
199
+ }
200
+
201
+ const Comps = {
202
+ Clock: {
203
+ _: ( params: SendParams<ClockValueTypes> ) => {
204
+ let {
205
+ min,max,
206
+ onValueUpdate,
207
+ tipsID,
208
+ val_value,
209
+ set_value
210
+ } = params;
211
+
212
+ let [ val_ampm,set_ampm ] = useState( val_value.hour > 12 ? 2 : 1 );
213
+ let [ val_unit,set_unit ] = useState( Number( localStorage.getItem( 'timePickerUnit' ) || 5 ) );
214
+
215
+ useEffect( () => {
216
+ localStorage.setItem( 'timePickerUnit',String( val_unit ) );
217
+ },[ val_unit ] );
218
+
219
+ let { hour,minutes } = val_value;
220
+
221
+ return ( <Column
222
+ padding={ 1 }
223
+ >
224
+ <Flex
225
+ flexType='row'
226
+ flexWrap={ false }
227
+ gap={ 1 }
228
+ className={ style.Body }
229
+ >
230
+ <Column
231
+ className={ style.DesignSide }
232
+ flexSizing={ 0 }
233
+ >
234
+ <Box
235
+ className={ style.ClockUiBase }
236
+ padding={ [ 1,'2/3' ] }
237
+ flexCenter
238
+ >
239
+ <Box
240
+ className={ style.ClockUi }
241
+ backgroundColor={ 'tcOpLow' }
242
+ isRounded
243
+ position='relative'
244
+ >
245
+ <Box
246
+ position='absolute'
247
+ backgroundColor='theme'
248
+ unitWidth={ '1/12' }
249
+ className={ [
250
+ style.Needle,
251
+ style.hour
252
+ ].join( ' ' ) }
253
+ freeCSS={ {
254
+ transform: `rotate(${ hour * 30 + minutes / 2 }deg)`
255
+ } }
256
+ />
257
+ <Box
258
+ position='absolute'
259
+ backgroundColor='theme'
260
+ unitWidth={ '1/12' }
261
+ className={ [
262
+ style.Needle,
263
+ style.minute
264
+ ].join( ' ' ) }
265
+ freeCSS={ {
266
+ transform: `rotate(${ minutes * 6 }deg)`
267
+ } }
268
+ />
269
+ </Box>
270
+ </Box>
271
+
272
+ <Input.Radio
273
+ tone='plain'
274
+ icon
275
+ value={ [ val_ampm ] }
276
+ options={ [
277
+ { value: 1,label: 'AM' },
278
+ { value: 2,label: 'PM' }
279
+ ] }
280
+ flexType={ 'col' }
281
+ gap={ 0 }
282
+ cellStyles={ {
283
+ padding: '1/2',
284
+ horizontalAlign: 'between',
285
+ gap: '1/3'
286
+ } }
287
+ tabIndex={ -1 }
288
+ onUpdateValidValue={ ( { value } ) => {
289
+ let prevHour = val_value.hour % 12;
290
+ let Hour = prevHour + ( value == 2 ? 12 : 0 );
291
+
292
+ set_ampm( value );
293
+ set_value( {
294
+ modifiedType: 'update',
295
+ hour: Hour,
296
+ minutes: val_value.minutes
297
+ } );
298
+ } }
299
+ />
300
+
301
+ <Box borderTop margin={ [ 0,1 ] } />
302
+ <Input.Radio
303
+ tone='plain'
304
+ icon
305
+ value={ [ val_unit ] }
306
+ options={ [
307
+ { value: 1,label: '/ 1分' },
308
+ { value: 2,label: '/ 2分' },
309
+ { value: 5,label: '/ 5分' }
310
+ ] }
311
+ flexType={ 'col' }
312
+ gap={ 0 }
313
+ cellStyles={ {
314
+ padding: '1/2',
315
+ horizontalAlign: 'between',
316
+ gap: '1/3'
317
+ } }
318
+ tabIndex={ -1 }
319
+ onUpdateValidValue={ ( { value } ) => {
320
+ set_unit( value );
321
+ } }
322
+ />
323
+ </Column>
324
+ <Column>
325
+ <Box
326
+ flexCenter
327
+ fontSize='3.paragraph'
328
+ isBoldFont
329
+ >
330
+ { val_value.hour.zeroEmbed( 2 ) } : { val_value.minutes.zeroEmbed( 2 ) }
331
+ </Box>
332
+ <Flex
333
+ flexWrap={ false }
334
+ borderRadius={ '1.tone.primary' }
335
+ boxShadow={ -1 }
336
+ flexChilds='even'
337
+ freeCSS={ {
338
+ minWidth: 12 * 12
339
+ } }
340
+ padding={ [ '1/3',0 ] }
341
+ >
342
+ <Column
343
+ gap={ 0 }
344
+ overflow={ 'auto' }
345
+ padding={ '2/3' }
346
+ borderRight
347
+ freeCSS={ {
348
+ maxHeight: 12 * 22
349
+ } }
350
+ children={ Comps.Clock.Hours( {
351
+ onClick: ( index ) => {
352
+ let Hour = index + ( val_ampm == 2 ? 12 : 0 );
353
+ set_value( {
354
+ modifiedType: 'update',
355
+ hour: Hour,
356
+ minutes: val_value.minutes
357
+ } );
358
+ },
359
+ min,max,
360
+ ampm: val_ampm
361
+ } ) }
362
+ />
363
+ <Column
364
+ gap={ 0 }
365
+ overflow={ 'auto' }
366
+ padding={ '2/3' }
367
+ freeCSS={ {
368
+ maxHeight: 12 * 22
369
+ } }
370
+ children={ Comps.Clock.Minutes( {
371
+ onClick: ( index ) => {
372
+ set_value( {
373
+ modifiedType: 'update',
374
+ hour: val_value.hour,
375
+ minutes: index
376
+ } );
377
+ },
378
+ min,max,
379
+ unit: val_unit
380
+ } ) }
381
+ />
382
+ </Flex>
383
+ </Column>
384
+ </Flex>
385
+ <Comps.Variables.Footer
386
+ tipsID={ tipsID! }
387
+ onValueUpdate={ onValueUpdate }
388
+ />
389
+ </Column>
390
+ )
391
+ },
392
+ Hours: ( params: {
393
+ min?: string
394
+ max?: string
395
+ ampm: number
396
+ onClick( index: number ): void
397
+ } ) => {
398
+ let list: ReactElement[] = [];
399
+
400
+ for ( let index = 0; index < 12; index++ ) {
401
+ let labelIndex = params.ampm == 2 ? index + 12 : index;
402
+ let Disabled = false;
403
+
404
+ {
405
+ let VAL = Number( String( labelIndex * 100 ).replace( /\D/ig,'' ) );
406
+ if ( params.min ) {
407
+ let MIN = Number( String( params.min ).replace( /\D/ig,'' ) );
408
+ if ( MIN > VAL ) Disabled = true;
409
+ }
410
+ if ( params.max ) {
411
+ let MAX = Number( String( params.max ).replace( /\D/ig,'' ) );
412
+ if ( VAL > MAX ) Disabled = true;
413
+ }
414
+ }
415
+
416
+ list.push( <Buttons.Button.Normal.R
417
+ key={ index }
418
+ isLocked={ Disabled }
419
+ borderBottom borderRadius={ 0 }
420
+ padding={ [ '1/2',1 ] }
421
+ freeCSS={ { whiteSpace: 'nowrap' } }
422
+ tabIndex={ -1 }
423
+ onClick={ () => {
424
+ params.onClick( index );
425
+ } }
426
+ children={ labelIndex.zeroEmbed( 2 ) }
427
+ /> );
428
+ }
429
+ return list;
430
+ },
431
+ Minutes: ( params: {
432
+ min?: string
433
+ max?: string
434
+ unit: number
435
+ onClick( index: number ): void
436
+ } ) => {
437
+ let list: ReactElement[] = [];
438
+
439
+ for ( let index = 0; index < 60 / params.unit; index++ ) {
440
+ let Value = index * params.unit;
441
+
442
+ list.push( <Buttons.Button.Normal.R
443
+ key={ Value }
444
+ borderBottom borderRadius={ 0 }
445
+ padding={ [ '1/2',1 ] }
446
+ freeCSS={ { whiteSpace: 'nowrap' } }
447
+ tabIndex={ -1 }
448
+ onClick={ () => {
449
+ params.onClick( Value );
450
+ } }
451
+ children={ Value.zeroEmbed( 2 ) }
452
+ /> );
453
+ }
454
+ return list;
455
+ }
456
+ },
457
+ Date: {
458
+ _: ( params: SendParams<DateValueTypes> ) => {
459
+ let {
460
+ min,max,
461
+ onValueUpdate,
462
+ tipsID,
463
+ val_value,
464
+ set_value
465
+ } = params;
466
+
467
+ let { year,month,date } = val_value;
468
+
469
+ return ( <Column
470
+ padding={ 1 }
471
+ >
472
+ <Flex
473
+ horizontalAlign='between'
474
+ verticalAlign='center'
475
+ flexWrap={ false }
476
+ >
477
+ <Flex
478
+ verticalAlign='bottom'
479
+ horizontalAlign='left'
480
+ gap={ '2/3' }
481
+ flexWrap={ false }
482
+ >
483
+ <Input.Select
484
+ override='force'
485
+ enableUnSelected={ false }
486
+ value={ year }
487
+ options={ YearOptions() }
488
+
489
+ border='1.thin'
490
+ padding={ [ '1/3','2/3' ] }
491
+ paddingRight={ 2 }
492
+
493
+ rightIconStyles={ {
494
+ right: '1/3'
495
+ } }
496
+ onUpdateValidValue={ ( { value } ) => {
497
+ set_value( {
498
+ modifiedType: 'update',
499
+ year: Number( value ),
500
+ month: month,
501
+ date: date
502
+ } );
503
+ } }
504
+ />
505
+ <Input.Select
506
+ override='force'
507
+ enableUnSelected={ false }
508
+ value={ month }
509
+ options={ ( () => {
510
+ let options = [];
511
+ for ( let i = 1; i <= 12; i++ ) {
512
+ options.push( {
513
+ value: i,
514
+ label: String( i ),
515
+ displayLabel: String( i ) + '月'
516
+ } );
517
+ }
518
+ return options;
519
+ } )() }
520
+ placeholder=''
521
+
522
+ border='1.thin'
523
+ padding={ [ '1/3','2/3' ] }
524
+ paddingRight={ 2 }
525
+
526
+ rightIconStyles={ {
527
+ right: '1/3'
528
+ } }
529
+ onUpdateValidValue={ ( { value } ) => {
530
+ set_value( {
531
+ modifiedType: 'update',
532
+ year: year,
533
+ month: Number( value ),
534
+ date: date
535
+ } );
536
+ } }
537
+ />
538
+ </Flex>
539
+ <Comps.Variables.ShiftButtons
540
+ callback={ ( dir ) => {
541
+ let newMonth = month + dir;
542
+ let newYear = year;
543
+
544
+ if ( dir == -1 ) {
545
+ if ( newMonth <= 0 ) newYear--;
546
+ newMonth = newMonth || 12;
547
+ } else {
548
+ if ( month == 12 ) newYear++;
549
+ }
550
+
551
+ set_value( {
552
+ modifiedType: 'update',
553
+ year: newYear,
554
+ month: newMonth,
555
+ date: val_value.date
556
+ } );
557
+ } }
558
+ />
559
+ </Flex>
560
+ <Box borderTop />
561
+ <Box
562
+ children={ Comps.Date.MonthCalendar( {
563
+ min,max,
564
+ year: val_value.year,
565
+ month: val_value.month,
566
+ current: [ val_value.year,val_value.month,val_value.date ],
567
+ callback: ( ( val: [ number,number,number ] ) => {
568
+ let [ year,month,date ] = val;
569
+ set_value( {
570
+ modifiedType: 'update',
571
+ year: year,
572
+ month: month,
573
+ date: date
574
+ } );
575
+ } )
576
+ } ) }
577
+ />
578
+ <Comps.Variables.Footer
579
+ tipsID={ tipsID! }
580
+ onValueUpdate={ onValueUpdate }
581
+ />
582
+ </Column> );
583
+ },
584
+ MonthCalendar: ( params: {
585
+ min?: string
586
+ max?: string
587
+ year: number
588
+ month: number
589
+ current: [ number,number,number ]
590
+ callback: any
591
+ } ) => {
592
+ let {
593
+ min,max,
594
+ year,
595
+ month,
596
+ current,
597
+ callback
598
+ } = params;
599
+ let today = $.Time();
600
+
601
+ let firstDate = $.Time( [ year,month.zeroEmbed( 2 ),'01' ].join( '/' ) );
602
+ let lastDate = firstDate.getLastDayOfTheMonth();
603
+ let lastMonthLastDay = $.Time( firstDate ).addMonth( -1 ).getLastDayOfTheMonth().date;
604
+
605
+ let legends = [],
606
+ lastMonthLastishDates = [],
607
+ thisMonthDates = [],
608
+ nextMonthFirstishDates = [];
609
+
610
+ let commonStyle: amotifyUniStyleParams = {
611
+ padding: 0,
612
+ unitWidth: 3,
613
+ unitHeight: 3,
614
+ flexCenter: true,
615
+ borderRadius: '3.tone.tertiary'
616
+ }
617
+
618
+ for ( var i = 0; i < 7; i++ ) {
619
+ legends.push( <Box
620
+ className={ [
621
+ style.CalendarDay,
622
+ style.Legend
623
+ ].join( ' ' ) }
624
+ { ...commonStyle }
625
+ key={ i }
626
+ >
627
+ { [ '日','月','火','水','木','金','土' ][ i ] }
628
+ </Box> );
629
+ }
630
+
631
+ for ( var i = 0; i < firstDate.weekday; i++ ) {
632
+ lastMonthLastishDates.unshift( <Box
633
+ className={ [
634
+ style.CalendarDay,
635
+ style.Dummy
636
+ ].join( ' ' ) }
637
+ fontColor='4.thin'
638
+ { ...commonStyle }
639
+ key={ i }
640
+ >
641
+ { lastMonthLastDay - i }
642
+ </Box> );
643
+ }
644
+ for ( var i = 1; i <= lastDate.date; i++ ) {
645
+ let idx = i;
646
+ let isToday = year == today.year && month == today.month && i == today.date;
647
+
648
+ let isLocked = false;
649
+
650
+ {
651
+ let VAL = Number( String( [ year,month.zeroEmbed( 2 ),i.zeroEmbed( 2 ) ].join( '/' ) ).replace( /\D/ig,'' ) );
652
+ if ( params.min ) {
653
+ let MIN = Number( String( params.min ).replace( /\D/ig,'' ) );
654
+ if ( MIN > VAL ) isLocked = true;
655
+ }
656
+ if ( params.max ) {
657
+ let MAX = Number( String( params.max ).replace( /\D/ig,'' ) );
658
+ if ( VAL > MAX ) isLocked = true;
659
+ }
660
+ }
661
+
662
+ thisMonthDates.push( <Buttons.Button.Clear.R
663
+ className={ [
664
+ style.CalendarDay,
665
+ ].join( ' ' ) }
666
+ { ...commonStyle }
667
+ onClick={ () => {
668
+ callback( [ year,month,idx ] );
669
+ } }
670
+ tabIndex={ -1 }
671
+ key={ idx }
672
+ isLocked={ isLocked }
673
+
674
+ fontColor={ '1.clear' }
675
+ ssEffectsOnActive={ 'shrink' }
676
+ padding={ 0 }
677
+ flexCenter
678
+ borderRadius={ 'sphere' }
679
+ { ...isToday ? {
680
+ backgroundColor: 'warn',
681
+ fontColor: 'white'
682
+ } : null }
683
+ children={ i }
684
+ /> );
685
+ }
686
+ for ( var i = 1; i < 7 - lastDate.weekday; i++ ) {
687
+ nextMonthFirstishDates.push( <Box
688
+ className={ [
689
+ style.CalendarDay,
690
+ style.Dummy
691
+ ].join( ' ' ) }
692
+ fontColor='4.thin'
693
+ { ...commonStyle } key={ i }
694
+ >
695
+ { i }
696
+ </Box> );
697
+ }
698
+
699
+ return ( <Grid gridCols={ 7 }
700
+ gap={ '1/3' }
701
+ >
702
+ { legends }
703
+ { lastMonthLastishDates }
704
+ { thisMonthDates }
705
+ { nextMonthFirstishDates }
706
+ </Grid> );
707
+ }
708
+ },
709
+ Month: {
710
+ _: ( params: SendParams<MonthValueTypes> ) => {
711
+ let {
712
+ min,max,
713
+ onValueUpdate,
714
+ tipsID,
715
+ val_value,
716
+ set_value
717
+ } = params;
718
+
719
+ let { year,month } = val_value;
720
+
721
+ return ( <Column
722
+ padding={ 1 }
723
+ >
724
+ <Row.Separate gap={ 0 }>
725
+ <Row.Center
726
+ verticalAlign='bottom'
727
+ gap={ '2/3' }
728
+ >
729
+ <Input.Select
730
+ enableUnSelected={ false }
731
+ value={ year }
732
+ options={ YearOptions() }
733
+ override='force'
734
+
735
+ border='1.thin'
736
+ padding={ [ '1/3','2/3' ] }
737
+ paddingRight={ 2 }
738
+
739
+ rightIconStyles={ {
740
+ right: '1/3'
741
+ } }
742
+ onUpdateValidValue={ ( { value } ) => {
743
+ set_value( {
744
+ modifiedType: 'update',
745
+ year: Number( value ),
746
+ month: month
747
+ } );
748
+ } }
749
+ />
750
+ </Row.Center>
751
+
752
+ <Comps.Variables.ShiftButtons
753
+ callback={ ( dir ) => {
754
+ let newYear = Math.min( Math.max( year + dir,1900 ),2100 );
755
+ set_value( {
756
+ modifiedType: 'update',
757
+ year: newYear,
758
+ month: month
759
+ } );
760
+ } }
761
+ />
762
+ </Row.Separate>
763
+ <Box borderTop />
764
+ { Comps.Month.Months( {
765
+ min,max,
766
+ year: val_value.year,
767
+ current: [ val_value.year,val_value.month ],
768
+ callback: ( ( val: [ number,number,number ] ) => {
769
+ let [ year,month ] = val;
770
+ set_value( {
771
+ modifiedType: 'update',
772
+ year: year,
773
+ month: month
774
+ } );
775
+ } )
776
+ } ) }
777
+ <Comps.Variables.Footer
778
+ tipsID={ tipsID! }
779
+ onValueUpdate={ onValueUpdate }
780
+ />
781
+ </Column> );
782
+ },
783
+ Months: ( params: {
784
+ min?: string
785
+ max?: string
786
+ year: number
787
+ current: [ number,number ]
788
+ callback: any
789
+ } ) => {
790
+ let {
791
+ year,
792
+ current,
793
+ callback
794
+ } = params;
795
+ let [ currentYear,currentMonth ] = current;
796
+
797
+ let Months = [];
798
+
799
+ for ( let index = 1; index <= 12; index++ ) {
800
+ let Checked = year == currentYear && index == currentMonth;
801
+ let isLocked = false;
802
+
803
+ {
804
+ let VAL = Number( String( [ year,index.zeroEmbed( 2 ) ].join( '/' ) ).replace( /\D/ig,'' ) );
805
+ if ( params.min ) {
806
+ let MIN = Number( String( params.min ).replace( /\D/ig,'' ) );
807
+ if ( MIN > VAL ) isLocked = true;
808
+ }
809
+ if ( params.max ) {
810
+ let MAX = Number( String( params.max ).replace( /\D/ig,'' ) );
811
+ if ( VAL > MAX ) isLocked = true;
812
+ }
813
+ }
814
+
815
+ let ClassName = [
816
+ style.Cell,
817
+ Checked ? style.Checked : ''
818
+ ].join( ' ' );
819
+
820
+ Months.push( <Buttons.Button.Clear.R
821
+ key={ year + '-' + index }
822
+ className={ ClassName }
823
+ isLocked={ isLocked }
824
+ fontColor={ '2.normal' }
825
+ padding={ [ '2/3',1 ] }
826
+ ssEffectsOnActive={ 'shrink' }
827
+ onClick={ () => {
828
+ callback( [ year,index ] );
829
+ } }
830
+ >
831
+ { index } 月
832
+ </Buttons.Button.Clear.R> );
833
+ }
834
+
835
+ return ( <Grid
836
+ gridCols={ 4 }
837
+ gap={ '2/3' }
838
+ children={ Months }
839
+ /> );
840
+ }
841
+ },
842
+ Year: {
843
+ _: ( params: SendParams<YearValueTypes> ) => {
844
+ let {
845
+ min,max,
846
+ onValueUpdate,
847
+ tipsID,
848
+ val_value,
849
+ set_value
850
+ } = params;
851
+
852
+ let { year } = val_value;
853
+
854
+ return ( <Column
855
+ padding={ 1 }
856
+ >
857
+ <Input.Select
858
+ enableUnSelected={ false }
859
+ value={ year }
860
+ override='force'
861
+ options={ YearOptions( { min,max } ) }
862
+ onUpdateValidValue={ ( { value } ) => {
863
+ set_value( {
864
+ modifiedType: 'update',
865
+ year: Number( value )
866
+ } );
867
+ } }
868
+ />
869
+ <Comps.Variables.Footer
870
+ tipsID={ tipsID! }
871
+ onValueUpdate={ onValueUpdate }
872
+ />
873
+ </Column> );
874
+ }
875
+ },
876
+ Variables: {
877
+ Footer: ( params: {
878
+ tipsID: string
879
+ onValueUpdate: any
880
+ } ) => {
881
+ return ( <Flex
882
+ flexWrap={ false }
883
+ gap={ 1 }
884
+ flexChilds='even'
885
+ freeCSS={ {
886
+ whiteSpace: 'nowrap'
887
+ } }
888
+ >
889
+ <Buttons.Button.Border.R
890
+ onClick={ () => {
891
+ params.onValueUpdate( '' );
892
+ } }
893
+ tabIndex={ -1 }
894
+ flexSizing={ 'none' }
895
+ padding={ [ '2/3',1 ] }
896
+ >
897
+ <FAIcon.Times /> 削除
898
+ </Buttons.Button.Border.R>
899
+ <Buttons.Button.Prime.R
900
+ flexSizing={ 'auto' }
901
+ onClick={ () => {
902
+ Tooltips.close( params.tipsID );
903
+ } }
904
+ tabIndex={ -1 }
905
+ children={ '決定' }
906
+ padding={ [ '2/3',1 ] }
907
+ />
908
+ </Flex> );
909
+ },
910
+ ShiftButtons: ( params: {
911
+ callback( dir: -1 | 1 ): void
912
+ } ) => {
913
+ return <Flex
914
+ flexWrap={ false }
915
+ gap={ '1/3' }
916
+ >
917
+ <Buttons.Button.Clear.R
918
+ className={ style.LeftButton }
919
+ tabIndex={ -1 }
920
+ right={ 0 }
921
+ { ...Comps.Variables.ShiftButtonStyles }
922
+ onClick={ () => {
923
+ params.callback( -1 );
924
+ } }
925
+ >
926
+ <FAIcon.ChevronLeft />
927
+ </Buttons.Button.Clear.R>
928
+ <Buttons.Button.Clear.R
929
+ className={ style.RightButton }
930
+ tabIndex={ -1 }
931
+ left={ 0 }
932
+ { ...Comps.Variables.ShiftButtonStyles }
933
+ onClick={ () => {
934
+ params.callback( 1 );
935
+ } }
936
+ >
937
+ <FAIcon.ChevronRight />
938
+ </Buttons.Button.Clear.R>
939
+ </Flex >;
940
+ },
941
+ ShiftButtonStyles: {
942
+ flexCenter: true,
943
+ padding: 0,
944
+ unitWidth: 3,
945
+ unitHeight: 3,
946
+ borderRadius: 'sphere',
947
+ position: 'relative'
948
+ } as amotifyUniStyleParams
949
+ }
950
+ }