amotify 0.0.4 → 0.0.5

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 (186) hide show
  1. package/package.json +1 -1
  2. package/public/amotify.js +1 -0
  3. package/public/amotify.min.css +24 -0
  4. package/dist/src/@jsminAmotifyExtension/_.d.ts +0 -4
  5. package/dist/src/@jsminAmotifyExtension/fetch.d.ts +0 -9
  6. package/dist/src/@jsminAmotifyExtension/formCollect.d.ts +0 -1
  7. package/dist/src/@jsminAmotifyExtension/spreadSheet.d.ts +0 -4
  8. package/dist/src/@jsminAmotifyExtension/variables.d.ts +0 -0
  9. package/dist/src/@types/_.d.ts +0 -6
  10. package/dist/src/@types/amot.d.ts +0 -260
  11. package/dist/src/@types/fn.d.ts +0 -1040
  12. package/dist/src/@types/index.d.ts +0 -62
  13. package/dist/src/@types/jsminAmotifyExtension.d.ts +0 -134
  14. package/dist/src/@types/module.d.ts +0 -2
  15. package/dist/src/@types/state.d.ts +0 -145
  16. package/dist/src/Atoms/@export.d.ts +0 -4
  17. package/dist/src/Atoms/FAIcon/parts.d.ts +0 -2
  18. package/dist/src/Atoms/Logo/parts.d.ts +0 -1
  19. package/dist/src/Atoms/Various/parts.d.ts +0 -9
  20. package/dist/src/Functions/@export.d.ts +0 -12
  21. package/dist/src/Functions/Button/_.d.ts +0 -1
  22. package/dist/src/Functions/Cropper/parts.d.ts +0 -1
  23. package/dist/src/Functions/Effects/Fade.d.ts +0 -1
  24. package/dist/src/Functions/Effects/Ripple.d.ts +0 -1
  25. package/dist/src/Functions/Effects/_.d.ts +0 -3
  26. package/dist/src/Functions/Input/Chips/Selector.d.ts +0 -1
  27. package/dist/src/Functions/Input/Chips/_.d.ts +0 -2
  28. package/dist/src/Functions/Input/DigitCharacters.d.ts +0 -1
  29. package/dist/src/Functions/Input/File/_.d.ts +0 -2
  30. package/dist/src/Functions/Input/Hidden.d.ts +0 -1
  31. package/dist/src/Functions/Input/List/_.d.ts +0 -1
  32. package/dist/src/Functions/Input/Segmented/_.d.ts +0 -1
  33. package/dist/src/Functions/Input/Select/_.d.ts +0 -1
  34. package/dist/src/Functions/Input/Slider/_.d.ts +0 -1
  35. package/dist/src/Functions/Input/Switch/_.d.ts +0 -1
  36. package/dist/src/Functions/Input/Text.d.ts +0 -5
  37. package/dist/src/Functions/Input/TextArea.d.ts +0 -1
  38. package/dist/src/Functions/Input/Time/Picker.d.ts +0 -1
  39. package/dist/src/Functions/Input/Time/_.d.ts +0 -2
  40. package/dist/src/Functions/Input/_.d.ts +0 -5
  41. package/dist/src/Functions/Input/core.d.ts +0 -34
  42. package/dist/src/Functions/Inputs/_.d.ts +0 -3
  43. package/dist/src/Functions/Inputs/text.d.ts +0 -12
  44. package/dist/src/Functions/Layout/PageNotFound.d.ts +0 -1
  45. package/dist/src/Functions/Layout/PageRouter.d.ts +0 -2
  46. package/dist/src/Functions/Layout/PageViewController/parts.d.ts +0 -1
  47. package/dist/src/Functions/Layout/Plate.d.ts +0 -1
  48. package/dist/src/Functions/Layout/RootViewController/parts.d.ts +0 -1
  49. package/dist/src/Functions/Layout/SwipeView/parts.d.ts +0 -2
  50. package/dist/src/Functions/Layout/TabBar.d.ts +0 -1
  51. package/dist/src/Functions/Layout/_.d.ts +0 -2
  52. package/dist/src/Functions/Loader/corner.d.ts +0 -1
  53. package/dist/src/Functions/Loader/mini.d.ts +0 -33
  54. package/dist/src/Functions/Loader/parts.d.ts +0 -3
  55. package/dist/src/Functions/Loader/top.d.ts +0 -1
  56. package/dist/src/Functions/Sheet/parts.d.ts +0 -2
  57. package/dist/src/Functions/SnackBar/parts.d.ts +0 -2
  58. package/dist/src/Functions/Table/Data/parts.d.ts +0 -3
  59. package/dist/src/Functions/Table/Drag/parts.d.ts +0 -1
  60. package/dist/src/Functions/Table/Normal/parts.d.ts +0 -1
  61. package/dist/src/Functions/Table/_.d.ts +0 -9
  62. package/dist/src/Functions/Tooltips/parts.d.ts +0 -2
  63. package/dist/src/Global/@export.d.ts +0 -12
  64. package/dist/src/Global/LaunchReactApplication.d.ts +0 -1
  65. package/dist/src/Global/styleConverter.d.ts +0 -2
  66. package/dist/src/Molecules/@export.d.ts +0 -21
  67. package/dist/src/Molecules/Accordion/parts.d.ts +0 -2
  68. package/dist/src/Molecules/LinkifyText/parts.d.ts +0 -1
  69. package/dist/src/Molecules/List.d.ts +0 -1
  70. package/dist/src/Organisms/@export.d.ts +0 -2
  71. package/dist/src/Organisms/DisplayStyleInput/_.d.ts +0 -1
  72. package/dist/src/Organisms/DisplayStyleInput/darkmode.d.ts +0 -1
  73. package/dist/src/Organisms/DisplayStyleInput/themeColor.d.ts +0 -27
  74. package/dist/src/Templates/@export.d.ts +0 -2
  75. package/dist/src/Templates/PlayGround/parts.d.ts +0 -1
  76. package/dist/src/config.d.ts +0 -16
  77. package/dist/src/launch.d.ts +0 -9
  78. package/dist/src/preload.d.ts +0 -1
  79. package/src/@jsminAmotifyExtension/_.tsx +0 -4
  80. package/src/@jsminAmotifyExtension/fetch.tsx +0 -107
  81. package/src/@jsminAmotifyExtension/formCollect.tsx +0 -89
  82. package/src/@jsminAmotifyExtension/spreadSheet.tsx +0 -159
  83. package/src/@jsminAmotifyExtension/variables.tsx +0 -130
  84. package/src/@styles/@app.scss +0 -4
  85. package/src/@styles/@variables/customProps.scss +0 -109
  86. package/src/@styles/@variables/styleSet.scss +0 -38
  87. package/src/@styles/@variables/themeColor.scss +0 -71
  88. package/src/@styles/@variables/var.scss +0 -171
  89. package/src/@styles/UniStyling.scss +0 -996
  90. package/src/@styles/init.scss +0 -154
  91. package/src/@types/_.tsx +0 -6
  92. package/src/@types/amot.tsx +0 -323
  93. package/src/@types/fn.tsx +0 -1210
  94. package/src/@types/index.tsx +0 -74
  95. package/src/@types/jsminAmotifyExtension.tsx +0 -143
  96. package/src/@types/module.tsx +0 -2
  97. package/src/@types/state.tsx +0 -199
  98. package/src/Atoms/@export.tsx +0 -32
  99. package/src/Atoms/FAIcon/parts.tsx +0 -117
  100. package/src/Atoms/FAIcon/style.module.scss +0 -9
  101. package/src/Atoms/Logo/parts.tsx +0 -335
  102. package/src/Atoms/Logo/style.module.scss +0 -96
  103. package/src/Atoms/Various/parts.tsx +0 -157
  104. package/src/Atoms/Various/style.module.scss +0 -40
  105. package/src/Functions/@export.tsx +0 -29
  106. package/src/Functions/Button/_.tsx +0 -305
  107. package/src/Functions/Button/style.module.scss +0 -183
  108. package/src/Functions/Cropper/parts.tsx +0 -1061
  109. package/src/Functions/Cropper/style.module.scss +0 -62
  110. package/src/Functions/Effects/Fade.tsx +0 -81
  111. package/src/Functions/Effects/Ripple.tsx +0 -141
  112. package/src/Functions/Effects/_.tsx +0 -33
  113. package/src/Functions/Effects/style.module.scss +0 -83
  114. package/src/Functions/Input/Chips/Selector.tsx +0 -451
  115. package/src/Functions/Input/Chips/_.tsx +0 -286
  116. package/src/Functions/Input/Chips/style.module.scss +0 -6
  117. package/src/Functions/Input/DigitCharacters.tsx +0 -241
  118. package/src/Functions/Input/File/_.tsx +0 -596
  119. package/src/Functions/Input/File/style.module.scss +0 -34
  120. package/src/Functions/Input/Hidden.tsx +0 -18
  121. package/src/Functions/Input/List/_.tsx +0 -383
  122. package/src/Functions/Input/List/style.module.scss +0 -84
  123. package/src/Functions/Input/Segmented/_.tsx +0 -238
  124. package/src/Functions/Input/Segmented/style.module.scss +0 -81
  125. package/src/Functions/Input/Select/_.tsx +0 -225
  126. package/src/Functions/Input/Select/style.module.scss +0 -10
  127. package/src/Functions/Input/Slider/_.tsx +0 -519
  128. package/src/Functions/Input/Slider/style.module.scss +0 -67
  129. package/src/Functions/Input/Switch/_.tsx +0 -177
  130. package/src/Functions/Input/Switch/style.module.scss +0 -18
  131. package/src/Functions/Input/Text.tsx +0 -437
  132. package/src/Functions/Input/TextArea.tsx +0 -115
  133. package/src/Functions/Input/Time/Picker.tsx +0 -950
  134. package/src/Functions/Input/Time/_.tsx +0 -736
  135. package/src/Functions/Input/Time/style.module.scss +0 -72
  136. package/src/Functions/Input/_.tsx +0 -793
  137. package/src/Functions/Input/core.tsx +0 -461
  138. package/src/Functions/Input/style.module.scss +0 -43
  139. package/src/Functions/Inputs/_.tsx +0 -5
  140. package/src/Functions/Inputs/style.module.scss +0 -15
  141. package/src/Functions/Inputs/text.tsx +0 -67
  142. package/src/Functions/Inputs/types.d.ts +0 -1
  143. package/src/Functions/Layout/PageNotFound.tsx +0 -81
  144. package/src/Functions/Layout/PageRouter.tsx +0 -107
  145. package/src/Functions/Layout/PageViewController/parts.tsx +0 -32
  146. package/src/Functions/Layout/Plate.tsx +0 -30
  147. package/src/Functions/Layout/RootViewController/parts.tsx +0 -290
  148. package/src/Functions/Layout/RootViewController/style.module.scss +0 -24
  149. package/src/Functions/Layout/SwipeView/parts.tsx +0 -380
  150. package/src/Functions/Layout/SwipeView/style.module.scss +0 -19
  151. package/src/Functions/Layout/TabBar.tsx +0 -64
  152. package/src/Functions/Layout/_.tsx +0 -20
  153. package/src/Functions/Loader/corner.tsx +0 -78
  154. package/src/Functions/Loader/mini.tsx +0 -117
  155. package/src/Functions/Loader/parts.tsx +0 -105
  156. package/src/Functions/Loader/style.module.scss +0 -222
  157. package/src/Functions/Loader/top.tsx +0 -90
  158. package/src/Functions/Sheet/parts.tsx +0 -972
  159. package/src/Functions/Sheet/style.module.scss +0 -235
  160. package/src/Functions/SnackBar/parts.tsx +0 -215
  161. package/src/Functions/SnackBar/style.module.scss +0 -25
  162. package/src/Functions/Table/Data/parts.tsx +0 -955
  163. package/src/Functions/Table/Drag/parts.tsx +0 -448
  164. package/src/Functions/Table/Normal/parts.tsx +0 -123
  165. package/src/Functions/Table/_.tsx +0 -170
  166. package/src/Functions/Table/style.module.scss +0 -92
  167. package/src/Functions/Tooltips/parts.tsx +0 -52
  168. package/src/Global/@export.tsx +0 -138
  169. package/src/Global/LaunchReactApplication.tsx +0 -30
  170. package/src/Global/exe.tsx +0 -0
  171. package/src/Global/styleConverter.tsx +0 -435
  172. package/src/Molecules/@export.tsx +0 -95
  173. package/src/Molecules/Accordion/parts.tsx +0 -146
  174. package/src/Molecules/Accordion/style.module.scss +0 -13
  175. package/src/Molecules/LinkifyText/parts.tsx +0 -54
  176. package/src/Molecules/List.tsx +0 -30
  177. package/src/Organisms/@export.tsx +0 -5
  178. package/src/Organisms/DisplayStyleInput/_.tsx +0 -18
  179. package/src/Organisms/DisplayStyleInput/darkmode.tsx +0 -112
  180. package/src/Organisms/DisplayStyleInput/themeColor.tsx +0 -210
  181. package/src/Templates/@export.tsx +0 -7
  182. package/src/Templates/PlayGround/parts.tsx +0 -115
  183. package/src/Templates/PlayGround/style.module.scss +0 -38
  184. package/src/config.tsx +0 -132
  185. package/src/launch.tsx +0 -100
  186. package/src/preload.tsx +0 -49
@@ -1,793 +0,0 @@
1
- import {
2
- StyleConverter,
3
- useStore,
4
- } from '@global';
5
- const {
6
- useState,
7
- useEffect,
8
- useRef
9
- } = React;
10
-
11
- import {
12
- Box,
13
- Flex,
14
- FAIcon,
15
- Span
16
- } from '@atoms';
17
- import {
18
- Row,
19
- Text,
20
- Column
21
- } from '@mols';
22
- import {
23
- Buttons,
24
- Tooltips
25
- } from '@functions';
26
-
27
- import style from './style.module.scss';
28
-
29
- import { HiddenInput } from './Hidden';
30
- import {
31
- TextInput,
32
- TextValidate
33
- } from './Text';
34
- import { TextAreaInput } from './TextArea';
35
- import { DigitCharactersInput } from './DigitCharacters'
36
- import {
37
- TimeInput,
38
- TimeFNs
39
- } from './Time/_';
40
- import { SelectInput } from './Select/_';
41
- import { ListInput } from './List/_';
42
- import { ChipsInput } from './Chips/_';
43
- import { SwitchInput } from './Switch/_';
44
- import { FileInput } from './File/_';
45
- import { SliderInput } from './Slider/_';
46
- import { Segmented } from './Segmented/_';
47
-
48
- const UniComponent: FNC<{
49
- componentID?: string
50
- children: FNC<any>
51
- params: any
52
- }> = ( props ) => {
53
- let [ val_componentID ] = useState( props.componentID || $.uuidGen() );
54
-
55
- props.params = {
56
- enableFormSubmit: true,
57
- // override: 'beforeModified',
58
- override: 'never',
59
- name: $.uuidGen(),
60
- id: $.uuidGen(),
61
- statusID: $.uuidGen(),
62
- 'aria-label': 'Input-' + val_componentID,
63
- ...props.params,
64
- componentID: val_componentID,
65
- }
66
-
67
- let {
68
- children: Children
69
- } = props;
70
-
71
- return ( <Children { ...props.params } /> );
72
- }
73
-
74
- const TextInputs: amotify.fn.Input.Text.Methods = {
75
- Validate: TextValidate,
76
- Normal: ( rawParams ) => {
77
- if ( rawParams.rightIcon ) rawParams.paddingRight = rawParams.paddingRight ?? 3;
78
- if ( rawParams.leftIcon ) rawParams.paddingLeft = rawParams.paddingLeft ?? 3;
79
-
80
- return ( <UniComponent
81
- componentID={ rawParams.componentID }
82
- children={ TextInput }
83
- params={ DefaultStyles.Boxish( rawParams ) }
84
- /> );
85
- },
86
- CreditCard: ( props ) => ( <TextInputs.Normal
87
- restrict='creditCard'
88
- { ...props }
89
- /> ),
90
- Tel: ( props ) => ( <TextInputs.Normal
91
- restrict='tel'
92
- placeholder='xxx-xxxx-xxxx'
93
- { ...props }
94
- /> ),
95
- Number: ( props ) => ( <TextInputs.Normal restrict='number' { ...props } /> ),
96
- DigitNumber: ( props ) => ( <TextInputs.Normal restrict='digitNumber' { ...props } /> ),
97
- Email: ( props ) => ( <TextInputs.Normal restrict='email' { ...props } /> ),
98
- Url: ( props ) => ( <TextInputs.Normal
99
- restrict='url'
100
- placeholder='https://example.com'
101
- { ...props }
102
- /> ),
103
- Postal: ( params ) => {
104
- let [ val_postalEventID ] = useState( $.uuidGen() );
105
- useEffect( () => {
106
- return () => {
107
- useStore.delete( val_postalEventID );
108
- }
109
- },[] );
110
-
111
- return ( <TextInputs.Normal
112
- restrict='postal'
113
- placeholder='郵便番号'
114
- leftIndicator={ <Input.Comps.LeftIndicator children={ '〒' } /> }
115
- { ...params }
116
- /> );
117
- },
118
- Password: ( props ) => {
119
- return (
120
- <TextInputs.Normal
121
- restrict='password'
122
- placeholder='パスワードを入力'
123
- rightIndicator={
124
- <Input.Comps.RightIndicator
125
- padding={ 0 }
126
- >
127
- <Buttons.Button.Normal.R
128
- padding={ '3/4' }
129
- fontColor='theme'
130
- borderTopLeftRadius={ 0 }
131
- borderBottomLeftRadius={ 0 }
132
- backgroundColor='inherit'
133
- height={ 1 }
134
- ssEffectsOnActive={ [ 'expand' ] }
135
- onMouseOver={ ( event ) => {
136
- Tooltips.open( {
137
- parent: event.currentTarget,
138
- gravityPoint: 24,
139
- padding: [ 1,0 ],
140
- content: <Tooltips.Comps.Body>
141
- パスワードを表示
142
- </Tooltips.Comps.Body>
143
- } );
144
- } }
145
- tabIndex={ -1 }
146
- onClick={ ( event ) => {
147
- $( event.target )
148
- .parent().parent().parent()
149
- .find( 'input' )
150
- .callback( ( input ) => {
151
- let Input = input[ 0 ];
152
- Input.type = Input.type === 'password' ? 'text' : 'password';
153
- } );
154
- } }
155
- >
156
- <FAIcon
157
- d='eye'
158
- freeCSS={ {
159
- pointerEvents: 'none'
160
- } }
161
- />
162
- </Buttons.Button.Normal.R>
163
- </Input.Comps.RightIndicator>
164
- }
165
- { ...props }
166
- />
167
- );
168
- },
169
- Money: {
170
- JPY: ( props ) => ( <TextInputs.DigitNumber
171
- placeholder="金額を入力"
172
- rightIndicator={ <Input.Comps.RightIndicator
173
- children={ '円' }
174
- /> }
175
- { ...props }
176
- /> )
177
- }
178
- }
179
-
180
- const TimeInputs: amotify.fn.Input.Time.Methods & {
181
- Origin: ( props: amotify.fn.Input.Time.OriginParams ) => JSX.Element
182
- } = {
183
- Origin: ( rawParams ) => {
184
- let [ val_componentID ] = useState( rawParams.componentID || $.uuidGen() );
185
- rawParams.componentID = val_componentID;
186
-
187
- if ( $.is.nullish( rawParams.rightIndicator ) ) {
188
- let icon = ( rawParams.restrict || '' ).match( /clock/ ) ? 'clock' : 'calendar-lines';
189
-
190
- rawParams.rightIndicator = <Input.Comps.RightIndicator
191
- padding={ 0 }
192
- >
193
- <Buttons.Button.Sub.R
194
- color='cloud'
195
- border='unset'
196
- padding={ '3/4' }
197
- fontColor='theme'
198
- borderTopLeftRadius={ 0 }
199
- borderBottomLeftRadius={ 0 }
200
- backgroundColor='inherit'
201
- height={ 1 }
202
- ssEffectsOnActive={ [ 'ripple.theme' ] }
203
- tabIndex={ -1 }
204
- id={ 'Picker-' + rawParams.componentID }
205
- onClick={ () => {
206
- let component = useStore.get( rawParams.componentID! );
207
- if ( component ) component.openPicker();
208
- } }
209
- >
210
- <FAIcon d={ icon } />
211
- </Buttons.Button.Sub.R>
212
- </Input.Comps.RightIndicator>
213
- }
214
-
215
- return ( <UniComponent
216
- componentID={ rawParams.componentID! }
217
- children={ TimeInput }
218
- params={ DefaultStyles.Boxish( rawParams ) }
219
- /> );
220
- },
221
- Clock: ( props ) => ( <TimeInputs.Origin restrict='clock' era='clock' { ...props } /> ),
222
- Date: ( props ) => ( <TimeInputs.Origin restrict='date' { ...props } /> ),
223
- Week: ( props ) => ( <TimeInputs.Origin restrict='week' { ...props } /> ),
224
- Month: ( props ) => ( <TimeInputs.Origin restrict='month' { ...props } /> ),
225
- Year: ( props ) => ( <TimeInputs.Origin restrict='year' { ...props } /> ),
226
- DateWareki: ( params ) => {
227
- let [ val_componentID ] = useState( params.componentID || $.uuidGen() );
228
- params.componentID = val_componentID;
229
- let {
230
- defaultEra = 'wareki',
231
- } = params;
232
-
233
- let era = 'year' as amotify.fn.Input.Time.EraTypes;
234
-
235
- if ( defaultEra == 'wareki' ) {
236
- era = 'reiwa';
237
- if ( params.value ) {
238
- let [ year,month,date ] = params.value.split( /\D/ );
239
- if ( year && month && date ) {
240
- let Year = Number( year );
241
- if ( Year >= 2019 ) {
242
- Year -= 2019,era = 'reiwa';
243
- } else if ( Year >= 1989 ) {
244
- Year -= 1989,era = 'heisei';
245
- } else if ( Year >= 1926 ) {
246
- Year -= 1926,era = 'shouwa';
247
- } else if ( Year >= 1912 ) {
248
- Year -= 1912,era = 'taisho';
249
- } else if ( Year >= 1868 ) {
250
- Year -= 1868,era = 'meiji';
251
- }
252
- Year += 1;
253
- }
254
- }
255
- }
256
-
257
- return ( <TimeInputs.Origin
258
- restrict='dateWareki'
259
- leftIndicator={ <Input.Select
260
- enableUnSelected={ false }
261
- value={ era }
262
- tone={ params.tone }
263
- flexCenter
264
- borderTopRightRadius={ 0 }
265
- borderBottomRightRadius={ 0 }
266
- freeCSS={ {
267
- whiteSpace: 'nowrap',
268
- marginRight: -1
269
- } }
270
- options={ [
271
- { value: 'year',label: '西暦' },
272
- { value: 'reiwa',label: '令和' },
273
- { value: 'heisei',label: '平成' },
274
- { value: 'shouwa',label: '昭和' },
275
- { value: 'taisho',label: '大正' },
276
- { value: 'meiji',label: '明治' }
277
- ] }
278
- onUpdateValidValue={ ( { value,eventType } ) => {
279
- let component = useStore.get( params.componentID! );
280
-
281
- if ( component && component.resetEra ) component.resetEra( value );
282
- } }
283
- rightIcon={ false }
284
- /> }
285
- { ...params }
286
- era={ era }
287
- /> );
288
- },
289
- Periods: {
290
- Date: ( props ) => ( <TimeInputs.Origin restrict='dates' { ...props } /> ),
291
- Month: ( props ) => ( <TimeInputs.Origin restrict='months' { ...props } /> ),
292
- },
293
- fn: TimeFNs
294
- }
295
-
296
- const ChipsInputs = ( rawParams: amotify.fn.Input.Chips.PlainParams ) => {
297
- rawParams = {
298
- gap: 1,
299
- display: 'flex',
300
- horizontalAlign: 'left',
301
- verticalAlign: 'center',
302
- flexWrap: true,
303
- ...rawParams
304
- }
305
- let params = DefaultStyles.Boxish( rawParams ) as amotify.fn.Input.Chips.PlainParams;
306
-
307
- return ( <UniComponent
308
- componentID={ rawParams.componentID }
309
- children={ ChipsInput }
310
- params={ params }
311
- /> );
312
- };
313
- ChipsInputs.fn = ChipsInput.fn;
314
-
315
- const FileInputs = ( rawParams: amotify.fn.Input.Filer.PlainParams ) => {
316
- rawParams.override = 'force';
317
- let params = StyleConverter.ToClassName( rawParams );
318
- params.cellClassName = [
319
- params.cellClassName,
320
- DefaultStyles.Boxish( {
321
- ...params.cellStyles,
322
- tone: params.tone
323
- } ).className,
324
- ].join( ' ' );
325
-
326
- return ( <UniComponent
327
- componentID={ rawParams.componentID }
328
- children={ FileInput }
329
- params={ params }
330
- /> );
331
- }
332
- FileInputs.fn = FileInput.fn;
333
-
334
- export const ListInputs: amotify.fn.Input.List.Methods & {
335
- Origin: ( props: amotify.fn.Input.List.OriginParams ) => JSX.Element
336
- } = {
337
- Origin: ( rawParams ) => {
338
-
339
- let params = DefaultStyles.ListCell( rawParams );
340
- return ( <UniComponent
341
- componentID={ rawParams.componentID }
342
- children={ ListInput }
343
- params={ params }
344
- /> );
345
- },
346
- Radio: ( params ) => ( <ListInputs.Origin
347
- iconType='radio'
348
- tone={ params.tone as any }
349
- { ...params }
350
- type='radio'
351
- /> ),
352
- Checkbox: ( params ) => ( <ListInputs.Origin
353
- iconType='checkbox'
354
- tone={ params.tone as any }
355
- { ...params }
356
- type='checkbox'
357
- /> )
358
- }
359
- export const Input: amotify.fn.Input.Methods = {
360
- Plain: ( params ) => ( <input { ...StyleConverter.ToClassName( params ) } /> ),
361
- Hidden: ( rawParams ) => {
362
- return ( <UniComponent
363
- componentID={ rawParams.componentID }
364
- children={ HiddenInput }
365
- params={ rawParams }
366
- /> );
367
- },
368
- Text: TextInputs,
369
- TextArea: ( rawParams ) => {
370
- if ( rawParams.rightIcon ) rawParams.paddingRight = rawParams.paddingRight ?? 3;
371
- if ( rawParams.leftIcon ) rawParams.paddingLeft = rawParams.paddingLeft ?? 3;
372
-
373
- let params = DefaultStyles.Boxish( rawParams );
374
- params.rows = params.rows || 5;
375
- return ( <UniComponent
376
- componentID={ rawParams.componentID }
377
- children={ TextAreaInput }
378
- params={ params }
379
- /> );
380
- },
381
- DigitCharacters: ( rawParams ) => {
382
- rawParams = {
383
- textAlign: 'center',
384
- width: 0,
385
- ...rawParams
386
- }
387
- if ( rawParams.combineInput ) {
388
- rawParams = $.deepMerge(
389
- rawParams,{
390
- digits: rawParams.digits,
391
- textAlign: 'center',
392
- width: 0,
393
- borderRadius: 0,
394
- freeCSS: {
395
- minWidth: 12 * 2,
396
- marginRight: -1
397
- },
398
- listStyles: {
399
- borderRadius: '2.tone.secondary',
400
- border: 'unset',
401
- gap: 0
402
- },
403
- }
404
- );
405
- }
406
- let params = DefaultStyles.Boxish( rawParams ) as amotify.fn.Input.DigitCharacters.PlainParams;
407
-
408
- return (
409
- <UniComponent
410
- componentID={ rawParams.componentID }
411
- children={ DigitCharactersInput }
412
- params={ params }
413
- />
414
- );
415
- },
416
- Time: TimeInputs,
417
- Select: ( rawParams ) => {
418
- if ( $.is.nullish( rawParams.rightIcon ) ) {
419
- rawParams.rightIcon = <Input.Comps.RightIcon
420
- flexType='col'
421
- className={ style.IndicatorIcon }
422
- { ...rawParams.rightIconStyles }
423
- >
424
- <FAIcon.AngleDown />
425
- </Input.Comps.RightIcon>
426
- }
427
- if ( rawParams.rightIcon ) rawParams.paddingRight = rawParams.paddingRight ?? 3;
428
- if ( rawParams.leftIcon ) rawParams.paddingLeft = rawParams.paddingLeft ?? 3;
429
-
430
- let params = DefaultStyles.Boxish( rawParams ) as amotify.fn.Input.Select.PlainParams;
431
- delete params.rightIconStyles;
432
- return (
433
- <UniComponent
434
- componentID={ rawParams.componentID }
435
- children={ SelectInput }
436
- params={ params }
437
- />
438
- );
439
- },
440
- Radio: ListInputs.Radio,
441
- Checkbox: ListInputs.Checkbox,
442
- Chips: ChipsInputs,
443
- Search: ( params: amotify.fn.Input.Search.PlainParams ) => {
444
- return <ChipsInputs
445
- AddButtonComponent={ ( props ) => {
446
- if ( props.selected.length ) return null;
447
- return <Box>
448
- 選択してください
449
- </Box>
450
- } }
451
- SelectedCellComponent={ ( props ) => {
452
- return <Box
453
- width={ 1 }
454
- textAlign='left'
455
- >
456
- <Row.Separate>
457
- { props.label }
458
- { props.defaultRemoveButton }
459
- </Row.Separate>
460
- </Box>;
461
- } }
462
- paddingLeft={ 3 }
463
- rightIcon={ <Input.Comps.LeftIcon>
464
- <Column gap={ 0 }>
465
- <FAIcon.AngleUp />
466
- <FAIcon.AngleDown />
467
- </Column>
468
- </Input.Comps.LeftIcon> }
469
- limit={ 1 }
470
- { ...params }
471
- />
472
- },
473
- File: FileInputs,
474
- Switch: ( rawParams ) => {
475
- rawParams.color = rawParams.color || 'theme';
476
- return ( <UniComponent
477
- componentID={ rawParams.componentID }
478
- children={ SwitchInput }
479
- params={ rawParams }
480
- /> );
481
- },
482
- Slider: ( rawParams ) => {
483
- return ( <UniComponent
484
- componentID={ rawParams.componentID }
485
- children={ SliderInput }
486
- params={ StyleConverter.ToClassName( rawParams ) }
487
- /> );
488
- },
489
- Checker: ( rawParams ) => {
490
- return ( <ListInputs.Origin
491
- { ...rawParams }
492
- tone='plain'
493
- icon
494
- type='checker'
495
- iconType='checkbox'
496
- value={ rawParams.value ? true : null }
497
- cellStyles={ {
498
- padding: 0,
499
- ...rawParams.cellStyles
500
- } }
501
- options={ [
502
- { value: true,label: rawParams.label }
503
- ] }
504
- onUpdateValidValue={ ( args ) => {
505
- let Value = !!args.value[ 0 ];
506
- if ( rawParams.onUpdateValidValue )
507
- rawParams.onUpdateValidValue( {
508
- ...args,
509
- value: Value
510
- } );
511
- } }
512
- /> );
513
- },
514
-
515
- Segmented: Segmented,
516
-
517
- Comps: {
518
- RequiredSign: ( params ) => {
519
- return ( <Span
520
- fontColor='white'
521
- fontSize={ '0.xs' }
522
- padding={ [ '1/4','1/3' ] }
523
- backgroundColor='nega'
524
- borderRadius={ '3.tone.tertiary' }
525
- children={ '必須' }
526
- { ...params }
527
- /> );
528
- },
529
- OmitSign: ( params ) => {
530
- return ( <Span
531
- fontColor='white'
532
- fontSize={ '0.xs' }
533
- padding={ [ '1/4','1/3' ] }
534
- borderRadius={ '3.tone.tertiary' }
535
- backgroundColor='6.layer.darkest'
536
- children={ '省略可' }
537
- { ...params }
538
- /> );
539
- },
540
- LeftIndicator: ( params ) => {
541
- let {
542
- tone,
543
- ...others
544
- } = params;
545
-
546
- return ( <Box
547
- { ...DefaultStyles.Indicator( tone! ) }
548
- borderRight='unset'
549
- borderTopRightRadius={ 0 }
550
- borderBottomRightRadius={ 0 }
551
- { ...others }
552
- /> );
553
- },
554
- RightIndicator: ( params ) => {
555
- let {
556
- tone,
557
- ...others
558
- } = params;
559
-
560
- return ( <Box
561
- { ...DefaultStyles.Indicator( tone! ) }
562
- borderLeft='unset'
563
- borderTopLeftRadius={ 0 }
564
- borderBottomLeftRadius={ 0 }
565
- { ...others }
566
- /> );
567
- },
568
- RightIcon: ( params ) => {
569
- let {
570
- tone = 'border',
571
- ...others
572
- } = params;
573
-
574
- return ( <Box
575
- { ...DefaultStyles.IndicatorIcon }
576
- right={ '3/4' }
577
- className={ style.IndicatorIcon }
578
- { ...others }
579
- freeCSS={ {
580
- zIndex: 6,
581
- pointerEvents: 'none',
582
- ...others.freeCSS
583
- } }
584
- /> );
585
- },
586
- LeftIcon: ( params ) => {
587
- let {
588
- tone = 'border',
589
- ...others
590
- } = params;
591
-
592
- return ( <Box
593
- { ...DefaultStyles.IndicatorIcon }
594
- left={ '3/4' }
595
- className={ style.IndicatorIcon }
596
- { ...others }
597
- freeCSS={ {
598
- zIndex: 6,
599
- pointerEvents: 'none',
600
- ...others.freeCSS
601
- } }
602
- /> );
603
- },
604
- }
605
- }
606
-
607
- const DefaultStyles = {
608
- Input: ( type: amotify.fn.Input.BoxToneTypes ) => {
609
- if ( type == 'plain' ) return {};
610
- let Styles: amotifyUniStyleParams = {
611
- padding: '3/4',
612
- transition: 'middle',
613
- flexSizing: 'auto',
614
- boxShadow: 0
615
- }
616
- if ( type == 'border' ) {
617
- Styles = {
618
- ...Styles,
619
- border: true,
620
- borderRadius: '2.tone.secondary',
621
- backgroundColor: '1.layer.base'
622
- }
623
- } else if ( type == 'cloud' ) {
624
- Styles = {
625
- ...Styles,
626
- border: '1.thin',
627
- borderRadius: '2.tone.secondary',
628
- backgroundColor: 'cloud'
629
- }
630
- } else if ( type == 'bottomBorder' ) {
631
- Styles = {
632
- ...Styles,
633
- borderRadius: 0,
634
- borderBottom: true,
635
- backgroundColor: 'cloud'
636
- }
637
- }
638
- return Styles;
639
- },
640
- ListCell: ( params: amotify.fn.Input.List.OriginParams ) => {
641
- if ( !params.tone ) {
642
- params.tone = 'border';
643
-
644
- if ( amotify.config.tone == 'flat' ) params.tone = 'cloud';
645
- }
646
-
647
- let { tone } = params;
648
-
649
- if ( tone == 'plain' ) {
650
-
651
- } else {
652
- params = {
653
- ...params,
654
- cellStyles: {
655
- position: 'relative',
656
- padding: [ '3/4',1 ],
657
- borderRadius: '2.tone.secondary',
658
- transition: 'middle',
659
- ...params.cellStyles,
660
- }
661
- }
662
-
663
- if ( tone == 'normal' ) {
664
- params = {
665
- gap: '1/2',
666
- ...params,
667
- cellStyles: {
668
- isBoldFont: true,
669
- ...params.cellStyles,
670
- },
671
- cellCheckedStyles: {
672
- backgroundColor: 'cloud'
673
- }
674
- }
675
- }
676
- else {
677
- params = {
678
- gap: '3/4',
679
- ...params,
680
- cellStyles: {
681
- boxShadow: 0,
682
- ...params.cellStyles
683
- }
684
- }
685
-
686
- if ( tone == 'cloud' || tone == 'vivid' ) {
687
- params.cellStyles = {
688
- border: '1.thin',
689
- backgroundColor: '2.layer.cloud',
690
- ...params.cellStyles,
691
- }
692
- }
693
-
694
- if ( tone == 'border' ) {
695
- params.cellStyles = {
696
- border: true,
697
- backgroundColor: '1.layer.base',
698
- ...params.cellStyles,
699
- }
700
- params.cellCheckedStyles = {
701
- borderColor: 'theme',
702
- fontColor: 'theme',
703
- ...params.cellCheckedStyles
704
- }
705
- } else if ( tone == 'cloud' ) {
706
- params.cellCheckedStyles = {
707
- backgroundColor: 'tcOpFew',
708
- fontColor: 'theme',
709
- borderColor: 'theme',
710
- ...params.cellCheckedStyles
711
- }
712
- } else if ( tone == 'vivid' ) {
713
- params.cellCheckedStyles = {
714
- backgroundColor: 'theme',
715
- fontColor: 'white',
716
- borderColor: 'theme',
717
- ...params.cellCheckedStyles
718
- }
719
- }
720
- }
721
- }
722
- return StyleConverter.ToClassName( params );
723
- },
724
- Boxish: ( params: any ) => {
725
- if ( !params.tone ) {
726
- params.tone = 'border';
727
- if ( amotify.config.tone == 'sharp' ) params.tone = 'bottomBorder';
728
- else if ( amotify.config.tone == 'flat' ) params.tone = 'cloud';
729
- }
730
-
731
- let Styles: amotifyUniStyleParams = {
732
- ...DefaultStyles.Input( params.tone ),
733
- ...params,
734
- ...params.leftIndicator ? {
735
- borderTopLeftRadius: 0,
736
- borderBottomLeftRadius: 0
737
- } : null,
738
- ...params.rightIndicator ? {
739
- borderTopRightRadius: 0,
740
- borderBottomRightRadius: 0,
741
- } : null,
742
- className: [
743
- style.Input,
744
- params.className
745
- ].join( ' ' ),
746
- }
747
-
748
- return StyleConverter.ToClassName( Styles ) as any;
749
- },
750
- Indicator: ( type: amotify.fn.Input.BoxToneTypes ) => {
751
- if ( !type ) {
752
- type = 'border';
753
- if ( amotify.config.tone == 'sharp' ) type = 'bottomBorder';
754
- }
755
- if ( type == 'plain' ) return {};
756
- let styles: amotifyUniStyleParams = {
757
- flexSizing: 'none',
758
- flexCenter: true,
759
- padding: [ 0,1 ],
760
- borderRadius: '2.tone.secondary',
761
- backgroundColor: 'cloud'
762
- }
763
-
764
- if ( type == 'border' ) {
765
- styles = {
766
- ...styles,
767
- border: true
768
- }
769
- } else if ( type == 'cloud' ) {
770
- styles = {
771
- ...styles,
772
- border: '1.thin'
773
- }
774
- } else if ( type == 'bottomBorder' ) {
775
- styles = {
776
- ...styles,
777
- borderRadius: 0,
778
- borderBottom: true
779
- }
780
- }
781
- return styles;
782
- },
783
- IndicatorIcon: {
784
- position: 'absolute',
785
- unitWidth: 2,
786
- unitHeight: 2,
787
- top: '50%',
788
- flexCenter: true,
789
- fontColor: 'theme',
790
- fontSize: '1.mini',
791
- backgroundColor: 'inherit',
792
- } as amotifyUniStyleParams
793
- };