amotify 0.0.59 → 0.0.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/@types/_.tsx +5 -5
- package/@types/amot.tsx +11 -11
- package/@types/fn.tsx +14 -1
- package/@types/module.tsx +1 -1
- package/dist/amotify.js +1 -1
- package/dist/amotify.min.css +3 -3
- package/package.json +1 -1
- package/src/@atoms.tsx +3 -3
- package/src/@functions.tsx +11 -11
- package/src/@global.tsx +40 -40
- package/src/@jsminAmotifyExtension/_.tsx +4 -4
- package/src/@jsminAmotifyExtension/fetch.tsx +30 -30
- package/src/@jsminAmotifyExtension/formCollect.tsx +32 -32
- package/src/@jsminAmotifyExtension/spreadSheet.tsx +71 -71
- package/src/@jsminAmotifyExtension/variables.tsx +38 -38
- package/src/@molecules.tsx +6 -6
- package/src/@styles/props.scss +1 -1
- package/src/@styles/var.scss +0 -1
- package/src/@templates.tsx +1 -1
- package/src/@variables.tsx +2 -2
- package/src/atoms/FAI/parts.tsx +105 -105
- package/src/atoms/Logo/parts.tsx +19 -19
- package/src/atoms/Various/parts.tsx +26 -26
- package/src/config.tsx +62 -59
- package/src/functions/Button/_.tsx +49 -49
- package/src/functions/Cropper/parts.tsx +249 -249
- package/src/functions/Effects/Fade.tsx +18 -18
- package/src/functions/Effects/Ripple.tsx +24 -24
- package/src/functions/Effects/_.tsx +5 -5
- package/src/functions/Input/Chips/Selector.tsx +107 -107
- package/src/functions/Input/Chips/_.tsx +66 -66
- package/src/functions/Input/Contenteditable.tsx +18 -18
- package/src/functions/Input/DigitCharacters.tsx +48 -48
- package/src/functions/Input/File/_.tsx +114 -114
- package/src/functions/Input/Hidden.tsx +3 -3
- package/src/functions/Input/List/_.tsx +61 -61
- package/src/functions/Input/RichSelect/_.tsx +38 -38
- package/src/functions/Input/Segmented/_.tsx +30 -30
- package/src/functions/Input/Select/_.tsx +42 -42
- package/src/functions/Input/Slider/_.tsx +93 -93
- package/src/functions/Input/Switch/_.tsx +21 -21
- package/src/functions/Input/Text.tsx +99 -97
- package/src/functions/Input/TextArea.tsx +17 -17
- package/src/functions/Input/Time/Picker.tsx +199 -199
- package/src/functions/Input/Time/_.tsx +173 -173
- package/src/functions/Input/_.tsx +135 -135
- package/src/functions/Input/core.tsx +96 -96
- package/src/functions/Inputs/_.tsx +1 -1
- package/src/functions/Inputs/text.tsx +5 -5
- package/src/functions/Layout/PageNotFound.tsx +6 -6
- package/src/functions/Layout/PageRouter.tsx +28 -44
- package/src/functions/Layout/PageViewController/parts.tsx +7 -7
- package/src/functions/Layout/Plate.tsx +5 -5
- package/src/functions/Layout/RootViewController/parts.tsx +94 -71
- package/src/functions/Layout/RootViewController/style.module.scss +0 -1
- package/src/functions/Layout/SwipeView/parts.tsx +90 -90
- package/src/functions/Layout/TabBar.tsx +10 -10
- package/src/functions/Layout/_.tsx +7 -7
- package/src/functions/Loader/corner.tsx +10 -10
- package/src/functions/Loader/mini.tsx +25 -25
- package/src/functions/Loader/parts.tsx +31 -31
- package/src/functions/Loader/top.tsx +10 -10
- package/src/functions/Sheet/parts.tsx +219 -219
- package/src/functions/Sheet/style.module.scss +0 -20
- package/src/functions/SnackBar/parts.tsx +50 -50
- package/src/functions/Table/Data/parts.tsx +202 -202
- package/src/functions/Table/Drag/parts.tsx +76 -76
- package/src/functions/Table/Normal/parts.tsx +23 -23
- package/src/functions/Table/_.tsx +33 -33
- package/src/functions/Tooltips/parts.tsx +7 -7
- package/src/global/LaunchReactApplication.tsx +28 -28
- package/src/global/styleConverter.tsx +133 -133
- package/src/launch.tsx +27 -27
- package/src/molecules/Accordion/parts.tsx +41 -41
- package/src/molecules/LinkifyText/parts.tsx +18 -18
- package/src/molecules/List.tsx +6 -6
- package/src/preload.tsx +5 -45
- package/src/templates/PlayGround/parts.tsx +8 -8
- package/webpack.config.js +9 -9
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useStore,
|
|
3
3
|
React
|
|
4
|
-
} from '@global'
|
|
4
|
+
} from '@global'
|
|
5
5
|
import {
|
|
6
6
|
Box,
|
|
7
7
|
Flex,
|
|
8
8
|
FAI
|
|
9
|
-
} from '@atoms'
|
|
9
|
+
} from '@atoms'
|
|
10
10
|
import {
|
|
11
11
|
Column,
|
|
12
12
|
Row,
|
|
13
13
|
Text
|
|
14
|
-
} from '@mols'
|
|
14
|
+
} from '@mols'
|
|
15
15
|
import {
|
|
16
16
|
Input,
|
|
17
17
|
Buttons,
|
|
18
18
|
SnackBar
|
|
19
|
-
} from '@fn'
|
|
19
|
+
} from '@fn'
|
|
20
20
|
|
|
21
21
|
import {
|
|
22
22
|
BoxWrapper,
|
|
23
23
|
SubmitForm,
|
|
24
24
|
ValidationCheck,
|
|
25
25
|
CommonEffects
|
|
26
|
-
} from '../core'
|
|
27
|
-
import style from './style.module.scss'
|
|
26
|
+
} from '../core'
|
|
27
|
+
import style from './style.module.scss'
|
|
28
28
|
|
|
29
|
-
import { faCloudArrowUp } from '@fortawesome/free-solid-svg-icons/faCloudArrowUp'
|
|
29
|
+
import { faCloudArrowUp } from '@fortawesome/free-solid-svg-icons/faCloudArrowUp'
|
|
30
30
|
|
|
31
31
|
function DefaultValidation( props: {
|
|
32
32
|
value: any
|
|
33
33
|
params: any
|
|
34
34
|
} ): amotify.fn.Input.Validation.Result {
|
|
35
|
-
let { value,params } = props
|
|
36
|
-
let { required } = params as amotify.fn.Input.Filer.PlainParams
|
|
37
|
-
let notice: amotify.fn.Input.Validation.NoticeTypes[] = []
|
|
35
|
+
let { value,params } = props
|
|
36
|
+
let { required } = params as amotify.fn.Input.Filer.PlainParams
|
|
37
|
+
let notice: amotify.fn.Input.Validation.NoticeTypes[] = []
|
|
38
38
|
|
|
39
39
|
if ( required && !value.length ) {
|
|
40
|
-
notice.push( { type: 'invalid',label: '必須項目です' } )
|
|
40
|
+
notice.push( { type: 'invalid',label: '必須項目です' } )
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
return {
|
|
@@ -70,7 +70,7 @@ const FileComponent: React.FC<amotify.fn.Input.Filer.PlainParams> = ( params ) =
|
|
|
70
70
|
enableFormSubmit,
|
|
71
71
|
|
|
72
72
|
...others
|
|
73
|
-
} = params
|
|
73
|
+
} = params
|
|
74
74
|
|
|
75
75
|
let Default_Status: amotify.fn.Input.Status.Plain = {
|
|
76
76
|
componentID: params.componentID || '',
|
|
@@ -78,11 +78,11 @@ const FileComponent: React.FC<amotify.fn.Input.Filer.PlainParams> = ( params ) =
|
|
|
78
78
|
eventType: 'init',
|
|
79
79
|
eventID: $.uuidGen()
|
|
80
80
|
}
|
|
81
|
-
let [ val_status,set_status ] = React.useState( Default_Status )
|
|
81
|
+
let [ val_status,set_status ] = React.useState( Default_Status )
|
|
82
82
|
let [ val_validate,set_validate ] = React.useState( {
|
|
83
83
|
ok: false,
|
|
84
84
|
notice: []
|
|
85
|
-
} as amotify.fn.Input.Validation.Result )
|
|
85
|
+
} as amotify.fn.Input.Validation.Result )
|
|
86
86
|
|
|
87
87
|
CommonEffects( {
|
|
88
88
|
type: 'file',
|
|
@@ -99,11 +99,11 @@ const FileComponent: React.FC<amotify.fn.Input.Filer.PlainParams> = ( params ) =
|
|
|
99
99
|
},
|
|
100
100
|
ExtraStoreParams: {
|
|
101
101
|
AddFiles: async ( files: any[] ) => {
|
|
102
|
-
let currentFiles = useStore.get( val_status.componentID ).Files
|
|
103
|
-
let newFiles = []
|
|
102
|
+
let currentFiles = useStore.get( val_status.componentID ).Files
|
|
103
|
+
let newFiles = []
|
|
104
104
|
for ( var i = 0; i < files?.length; i++ ) {
|
|
105
|
-
let file = files[ i ]
|
|
106
|
-
let { type,name } = file
|
|
105
|
+
let file = files[ i ]
|
|
106
|
+
let { type,name } = file
|
|
107
107
|
|
|
108
108
|
if ( i + 1 + currentFiles.length > limit ) {
|
|
109
109
|
SnackBar.add( {
|
|
@@ -111,8 +111,8 @@ const FileComponent: React.FC<amotify.fn.Input.Filer.PlainParams> = ( params ) =
|
|
|
111
111
|
secondsToClose: 12000,
|
|
112
112
|
children: `ファイル選択上限を超えたため、${ name }}は追加できません。`,
|
|
113
113
|
backgroundColor: 'nega'
|
|
114
|
-
} )
|
|
115
|
-
continue
|
|
114
|
+
} )
|
|
115
|
+
continue
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
if ( accept ) {
|
|
@@ -123,27 +123,27 @@ const FileComponent: React.FC<amotify.fn.Input.Filer.PlainParams> = ( params ) =
|
|
|
123
123
|
secondsToClose: 12000,
|
|
124
124
|
children: `ファイル形式が異なるため、${ name } は追加できません。`,
|
|
125
125
|
backgroundColor: 'nega'
|
|
126
|
-
} )
|
|
127
|
-
continue
|
|
126
|
+
} )
|
|
127
|
+
continue
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
|
-
newFiles.push( file )
|
|
131
|
+
newFiles.push( file )
|
|
132
132
|
}
|
|
133
133
|
set_status( {
|
|
134
134
|
...val_status,
|
|
135
135
|
dataValue: [ ...currentFiles,...newFiles ],
|
|
136
136
|
eventType: 'update',
|
|
137
137
|
eventID: $.uuidGen(),
|
|
138
|
-
} )
|
|
138
|
+
} )
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
|
-
} )
|
|
141
|
+
} )
|
|
142
142
|
|
|
143
|
-
let Accept = ''
|
|
143
|
+
let Accept = ''
|
|
144
144
|
if ( accept ) {
|
|
145
|
-
if ( accept == 'image' ) Accept = 'image/png,image/jpeg'
|
|
146
|
-
else Accept = accept
|
|
145
|
+
if ( accept == 'image' ) Accept = 'image/png,image/jpeg'
|
|
146
|
+
else Accept = accept
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
return <BoxWrapper
|
|
@@ -162,13 +162,13 @@ const FileComponent: React.FC<amotify.fn.Input.Filer.PlainParams> = ( params ) =
|
|
|
162
162
|
accept={ Accept }
|
|
163
163
|
multiple={ limit == 1 ? false : true }
|
|
164
164
|
onChange={ async ( event ) => {
|
|
165
|
-
let Input = event.target
|
|
166
|
-
let files = Input.files as any
|
|
167
|
-
let newFiles = []
|
|
165
|
+
let Input = event.target
|
|
166
|
+
let files = Input.files as any
|
|
167
|
+
let newFiles = []
|
|
168
168
|
for ( var i = 0; i < files?.length; i++ ) {
|
|
169
|
-
let file = files[ i ]
|
|
170
|
-
let fileName = file.name
|
|
171
|
-
file.id = $.uuidGen()
|
|
169
|
+
let file = files[ i ]
|
|
170
|
+
let fileName = file.name
|
|
171
|
+
file.id = $.uuidGen()
|
|
172
172
|
|
|
173
173
|
if ( i + 1 + val_status.dataValue.length > limit ) {
|
|
174
174
|
SnackBar.add( {
|
|
@@ -176,18 +176,18 @@ const FileComponent: React.FC<amotify.fn.Input.Filer.PlainParams> = ( params ) =
|
|
|
176
176
|
secondsToClose: 12000,
|
|
177
177
|
children: `ファイル登録数を超えたため、${ fileName }}は追加できませんでした。`,
|
|
178
178
|
backgroundColor: 'nega'
|
|
179
|
-
} )
|
|
180
|
-
continue
|
|
179
|
+
} )
|
|
180
|
+
continue
|
|
181
181
|
}
|
|
182
|
-
newFiles.push( file )
|
|
182
|
+
newFiles.push( file )
|
|
183
183
|
}
|
|
184
184
|
set_status( {
|
|
185
185
|
...val_status,
|
|
186
186
|
dataValue: [ ...val_status.dataValue,...newFiles ],
|
|
187
187
|
eventType: 'update',
|
|
188
188
|
eventID: $.uuidGen(),
|
|
189
|
-
} )
|
|
190
|
-
Input.value = ''
|
|
189
|
+
} )
|
|
190
|
+
Input.value = ''
|
|
191
191
|
} }
|
|
192
192
|
{ ...others }
|
|
193
193
|
tabIndex={ -1 }
|
|
@@ -199,7 +199,7 @@ const FileComponent: React.FC<amotify.fn.Input.Filer.PlainParams> = ( params ) =
|
|
|
199
199
|
val_status={ val_status }
|
|
200
200
|
set_status={ set_status }
|
|
201
201
|
/> : null }
|
|
202
|
-
</BoxWrapper
|
|
202
|
+
</BoxWrapper>
|
|
203
203
|
}
|
|
204
204
|
|
|
205
205
|
const FileList: React.FC<{
|
|
@@ -213,8 +213,8 @@ const FileList: React.FC<{
|
|
|
213
213
|
params,
|
|
214
214
|
val_status,
|
|
215
215
|
set_status
|
|
216
|
-
} = props
|
|
217
|
-
let Left = ( params.limit || 1 ) - val_status.dataValue.length
|
|
216
|
+
} = props
|
|
217
|
+
let Left = ( params.limit || 1 ) - val_status.dataValue.length
|
|
218
218
|
|
|
219
219
|
let Files = files.map( ( file,index ) => {
|
|
220
220
|
return <FileCell
|
|
@@ -225,8 +225,8 @@ const FileList: React.FC<{
|
|
|
225
225
|
val_status={ val_status }
|
|
226
226
|
set_status={ set_status }
|
|
227
227
|
fileNameEdit={ params.fileNameEdit }
|
|
228
|
-
|
|
229
|
-
} )
|
|
228
|
+
/>
|
|
229
|
+
} )
|
|
230
230
|
|
|
231
231
|
if ( Left > 0 ) {
|
|
232
232
|
Files.push( <label
|
|
@@ -236,10 +236,10 @@ const FileList: React.FC<{
|
|
|
236
236
|
htmlFor={ params.id }
|
|
237
237
|
tabIndex={ params.tabIndex }
|
|
238
238
|
onKeyDown={ ( event ) => {
|
|
239
|
-
let { key } = event
|
|
239
|
+
let { key } = event
|
|
240
240
|
if ( params.tabIndex != -1 ) {
|
|
241
241
|
if ( [ ' ','Enter' ].includes( key ) ) {
|
|
242
|
-
$( '#' + params.id ).click()
|
|
242
|
+
$( '#' + params.id ).click()
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
245
|
} }
|
|
@@ -276,14 +276,14 @@ const FileList: React.FC<{
|
|
|
276
276
|
</Box>
|
|
277
277
|
</Box>
|
|
278
278
|
</Row.Center>
|
|
279
|
-
</label> )
|
|
279
|
+
</label> )
|
|
280
280
|
}
|
|
281
281
|
|
|
282
282
|
return <Column
|
|
283
283
|
flexSizing={ 'auto' }
|
|
284
284
|
className={ params.className }
|
|
285
285
|
children={ Files }
|
|
286
|
-
|
|
286
|
+
/>
|
|
287
287
|
}
|
|
288
288
|
|
|
289
289
|
const FileCell: React.FC<{
|
|
@@ -301,54 +301,54 @@ const FileCell: React.FC<{
|
|
|
301
301
|
val_status,
|
|
302
302
|
set_status,
|
|
303
303
|
fileNameEdit = true
|
|
304
|
-
} = props
|
|
304
|
+
} = props
|
|
305
305
|
let {
|
|
306
306
|
name: fileName,
|
|
307
307
|
size,
|
|
308
308
|
type,
|
|
309
|
-
} = file
|
|
309
|
+
} = file
|
|
310
310
|
|
|
311
|
-
let [ val_edit,set_edit ] = React.useState( false )
|
|
312
|
-
let FileID = $.uuidGen()
|
|
313
|
-
let Size = size.rank()
|
|
311
|
+
let [ val_edit,set_edit ] = React.useState( false )
|
|
312
|
+
let FileID = $.uuidGen()
|
|
313
|
+
let Size = size.rank()
|
|
314
314
|
let [ name,extension ] = fileName
|
|
315
315
|
.replace( /\s/,'' )
|
|
316
|
-
.replace( /(.*)\.(.*)$/,'$1 $2' ).split( ' ' )
|
|
316
|
+
.replace( /(.*)\.(.*)$/,'$1 $2' ).split( ' ' )
|
|
317
317
|
|
|
318
|
-
let FileName = 'ファイル'
|
|
318
|
+
let FileName = 'ファイル'
|
|
319
319
|
if ( type.match( /image/ ) ) {
|
|
320
|
-
FileName = type.replace( /image\//,'' )
|
|
320
|
+
FileName = type.replace( /image\//,'' )
|
|
321
321
|
} else if ( type.match( /pdf/ ) ) {
|
|
322
|
-
FileName = 'PDF'
|
|
322
|
+
FileName = 'PDF'
|
|
323
323
|
} else if ( type.match( /csv/ ) ) {
|
|
324
|
-
FileName = 'CSV'
|
|
324
|
+
FileName = 'CSV'
|
|
325
325
|
} else if ( type.match( /spreadsheet/ ) ) {
|
|
326
|
-
FileName = 'SpreadSheet'
|
|
326
|
+
FileName = 'SpreadSheet'
|
|
327
327
|
} else if ( type.match( /presentation/ ) ) {
|
|
328
|
-
FileName = 'PowerPoint'
|
|
328
|
+
FileName = 'PowerPoint'
|
|
329
329
|
} else if ( type.match( /word/ ) ) {
|
|
330
|
-
FileName = 'Word'
|
|
330
|
+
FileName = 'Word'
|
|
331
331
|
} else if ( type.match( /zip/ ) ) {
|
|
332
|
-
FileName = 'Zip'
|
|
332
|
+
FileName = 'Zip'
|
|
333
333
|
} else if ( type.match( /powerpoint/ ) ) {
|
|
334
|
-
FileName = 'PowerPoint'
|
|
334
|
+
FileName = 'PowerPoint'
|
|
335
335
|
} else if ( type.match( /html/ ) ) {
|
|
336
|
-
FileName = 'HTML'
|
|
336
|
+
FileName = 'HTML'
|
|
337
337
|
} else if ( type.match( /js/ ) ) {
|
|
338
|
-
FileName = 'JavaScript'
|
|
338
|
+
FileName = 'JavaScript'
|
|
339
339
|
} else if ( type.match( /css/ ) ) {
|
|
340
|
-
FileName = 'CSS'
|
|
340
|
+
FileName = 'CSS'
|
|
341
341
|
} else if ( type.match( /text\/plain/ ) ) {
|
|
342
|
-
FileName = 'テキスト'
|
|
342
|
+
FileName = 'テキスト'
|
|
343
343
|
}
|
|
344
344
|
|
|
345
345
|
React.useEffect( () => {
|
|
346
346
|
if ( val_edit ) {
|
|
347
347
|
setTimeout( () => {
|
|
348
|
-
$( '#' + FileID )[ 0 ].focus()
|
|
349
|
-
},100 )
|
|
348
|
+
$( '#' + FileID )[ 0 ].focus()
|
|
349
|
+
},100 )
|
|
350
350
|
}
|
|
351
|
-
},[ val_edit ] )
|
|
351
|
+
},[ val_edit ] )
|
|
352
352
|
|
|
353
353
|
return <Flex
|
|
354
354
|
verticalAlign='center'
|
|
@@ -378,7 +378,7 @@ const FileCell: React.FC<{
|
|
|
378
378
|
padding={ '1/3' }
|
|
379
379
|
ssEffectsOnActive={ 'expand' }
|
|
380
380
|
onClick={ () => {
|
|
381
|
-
set_edit( true )
|
|
381
|
+
set_edit( true )
|
|
382
382
|
} }
|
|
383
383
|
>
|
|
384
384
|
<FAI.Pen />
|
|
@@ -406,8 +406,8 @@ const FileCell: React.FC<{
|
|
|
406
406
|
enableFormSubmit
|
|
407
407
|
value={ name }
|
|
408
408
|
onKeyDown={ ( event ) => {
|
|
409
|
-
let { key } = event
|
|
410
|
-
if ( key == 'Escape' ) set_edit( false )
|
|
409
|
+
let { key } = event
|
|
410
|
+
if ( key == 'Escape' ) set_edit( false )
|
|
411
411
|
} }
|
|
412
412
|
/>
|
|
413
413
|
<Box>
|
|
@@ -423,7 +423,7 @@ const FileCell: React.FC<{
|
|
|
423
423
|
padding={ [ '2/3',1 ] }
|
|
424
424
|
children={ '閉じる' }
|
|
425
425
|
onClick={ () => {
|
|
426
|
-
set_edit( false )
|
|
426
|
+
set_edit( false )
|
|
427
427
|
} }
|
|
428
428
|
/>
|
|
429
429
|
<Buttons.Button.Prime.R
|
|
@@ -431,30 +431,30 @@ const FileCell: React.FC<{
|
|
|
431
431
|
submitOption={ {
|
|
432
432
|
formName: 'form-' + FileID,
|
|
433
433
|
callback: async ( form ) => {
|
|
434
|
-
let { name } = form
|
|
435
|
-
let nextFiles = [ ...val_status.dataValue ]
|
|
436
|
-
let prevFile = nextFiles[ index ]
|
|
437
|
-
let id = prevFile.id
|
|
438
|
-
if ( !prevFile ) return
|
|
434
|
+
let { name } = form
|
|
435
|
+
let nextFiles = [ ...val_status.dataValue ]
|
|
436
|
+
let prevFile = nextFiles[ index ]
|
|
437
|
+
let id = prevFile.id
|
|
438
|
+
if ( !prevFile ) return
|
|
439
439
|
|
|
440
|
-
let { target } = await prevFile.read()
|
|
441
|
-
if ( !target ) return
|
|
442
|
-
let dataUrl = String( target.result )
|
|
440
|
+
let { target } = await prevFile.read()
|
|
441
|
+
if ( !target ) return
|
|
442
|
+
let dataUrl = String( target.result )
|
|
443
443
|
|
|
444
444
|
let newBlob = await dataUrl.toBlob( file.type )
|
|
445
|
-
if ( !newBlob ) return
|
|
446
|
-
let newFile: any = new File( [ newBlob ],name + '.' + extension,{ type: prevFile.type } )
|
|
447
|
-
newFile.id = id
|
|
445
|
+
if ( !newBlob ) return
|
|
446
|
+
let newFile: any = new File( [ newBlob ],name + '.' + extension,{ type: prevFile.type } )
|
|
447
|
+
newFile.id = id
|
|
448
448
|
|
|
449
|
-
nextFiles[ index ] = newFile
|
|
449
|
+
nextFiles[ index ] = newFile
|
|
450
450
|
|
|
451
451
|
set_status( {
|
|
452
452
|
...val_status,
|
|
453
453
|
dataValue: nextFiles,
|
|
454
454
|
eventType: 'update',
|
|
455
455
|
eventID: $.uuidGen(),
|
|
456
|
-
} )
|
|
457
|
-
set_edit( false )
|
|
456
|
+
} )
|
|
457
|
+
set_edit( false )
|
|
458
458
|
}
|
|
459
459
|
} }
|
|
460
460
|
>
|
|
@@ -480,11 +480,11 @@ const FileCell: React.FC<{
|
|
|
480
480
|
fontColor='4.thin'
|
|
481
481
|
ssSphere={ 3 }
|
|
482
482
|
onClick={ () => {
|
|
483
|
-
let nextFiles = [ ...val_status.dataValue ]
|
|
484
|
-
let prevFile = nextFiles[ index ]
|
|
485
|
-
if ( !prevFile ) return
|
|
483
|
+
let nextFiles = [ ...val_status.dataValue ]
|
|
484
|
+
let prevFile = nextFiles[ index ]
|
|
485
|
+
if ( !prevFile ) return
|
|
486
486
|
|
|
487
|
-
nextFiles.splice( index,1 )
|
|
487
|
+
nextFiles.splice( index,1 )
|
|
488
488
|
set_status( {
|
|
489
489
|
...val_status,
|
|
490
490
|
dataValue: nextFiles,
|
|
@@ -495,15 +495,15 @@ const FileCell: React.FC<{
|
|
|
495
495
|
>
|
|
496
496
|
<FAI.Times />
|
|
497
497
|
</Buttons.Button.Sub.R>
|
|
498
|
-
</Flex
|
|
498
|
+
</Flex>
|
|
499
499
|
}
|
|
500
500
|
|
|
501
501
|
$.fnScope( async () => {
|
|
502
502
|
$( document ).addEvent( {
|
|
503
503
|
eventType: 'dragover',
|
|
504
504
|
callback: ( event ) => {
|
|
505
|
-
event.preventDefault()
|
|
506
|
-
$( '.' + style.AddButton ).addClass( style.Draggable )
|
|
505
|
+
event.preventDefault()
|
|
506
|
+
$( '.' + style.AddButton ).addClass( style.Draggable )
|
|
507
507
|
},
|
|
508
508
|
option: {
|
|
509
509
|
passive: false
|
|
@@ -511,21 +511,21 @@ $.fnScope( async () => {
|
|
|
511
511
|
} ).addEvent( {
|
|
512
512
|
eventType: 'drop',
|
|
513
513
|
callback: ( event: any ) => {
|
|
514
|
-
event.preventDefault()
|
|
515
|
-
$( '.' + style.AddButton ).removeClass( style.Draggable )
|
|
516
|
-
let Files = event.dataTransfer.files
|
|
514
|
+
event.preventDefault()
|
|
515
|
+
$( '.' + style.AddButton ).removeClass( style.Draggable )
|
|
516
|
+
let Files = event.dataTransfer.files
|
|
517
517
|
if ( Files.length ) {
|
|
518
|
-
let Target = event.target as HTMLElement
|
|
518
|
+
let Target = event.target as HTMLElement
|
|
519
519
|
if ( $( Target ).hasClass( style.AddButton ) ) {
|
|
520
|
-
let { componentId } = Target.dataset
|
|
521
|
-
let component = useStore.get( componentId! )
|
|
522
|
-
if ( component && component.AddFiles ) component.AddFiles( Files )
|
|
520
|
+
let { componentId } = Target.dataset
|
|
521
|
+
let component = useStore.get( componentId! )
|
|
522
|
+
if ( component && component.AddFiles ) component.AddFiles( Files )
|
|
523
523
|
}
|
|
524
524
|
}
|
|
525
525
|
},
|
|
526
526
|
option: { passive: false }
|
|
527
|
-
} )
|
|
528
|
-
} )
|
|
527
|
+
} )
|
|
528
|
+
} )
|
|
529
529
|
|
|
530
530
|
const FileInput: amotify.fn.Input.Filer.Methods = FileComponent as any
|
|
531
531
|
FileInput.fn = {
|
|
@@ -533,21 +533,21 @@ FileInput.fn = {
|
|
|
533
533
|
let {
|
|
534
534
|
multiple,
|
|
535
535
|
accept
|
|
536
|
-
} = params
|
|
536
|
+
} = params
|
|
537
537
|
|
|
538
538
|
return new Promise( resolve => {
|
|
539
|
-
const input = document.createElement( 'input' )
|
|
540
|
-
input.type = 'file'
|
|
541
|
-
input.multiple = multiple ?? true
|
|
539
|
+
const input = document.createElement( 'input' )
|
|
540
|
+
input.type = 'file'
|
|
541
|
+
input.multiple = multiple ?? true
|
|
542
542
|
if ( accept ) {
|
|
543
|
-
if ( accept == 'image' ) input.accept = 'image/png,image/jpeg'
|
|
544
|
-
else input.accept = accept
|
|
543
|
+
if ( accept == 'image' ) input.accept = 'image/png,image/jpeg'
|
|
544
|
+
else input.accept = accept
|
|
545
545
|
}
|
|
546
546
|
input.onchange = ( event: any ) => {
|
|
547
|
-
resolve( event.target.files )
|
|
548
|
-
}
|
|
549
|
-
input.click()
|
|
550
|
-
} )
|
|
547
|
+
resolve( event.target.files )
|
|
548
|
+
}
|
|
549
|
+
input.click()
|
|
550
|
+
} )
|
|
551
551
|
}
|
|
552
552
|
}
|
|
553
553
|
export { FileInput }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react'
|
|
1
|
+
import React from 'react'
|
|
2
2
|
export const HiddenInput: React.FC<amotify.fn.Input.Hidden.PlainParams> = ( params ) => {
|
|
3
3
|
let {
|
|
4
4
|
componentID = '',
|
|
@@ -7,7 +7,7 @@ export const HiddenInput: React.FC<amotify.fn.Input.Hidden.PlainParams> = ( para
|
|
|
7
7
|
form,
|
|
8
8
|
value = '',
|
|
9
9
|
...others
|
|
10
|
-
} = params
|
|
10
|
+
} = params
|
|
11
11
|
|
|
12
12
|
return <input
|
|
13
13
|
value={ JSON.stringify( value ) }
|
|
@@ -17,5 +17,5 @@ export const HiddenInput: React.FC<amotify.fn.Input.Hidden.PlainParams> = ( para
|
|
|
17
17
|
data-value={ JSON.stringify( value ) }
|
|
18
18
|
{ ...others }
|
|
19
19
|
type='hidden'
|
|
20
|
-
|
|
20
|
+
/>
|
|
21
21
|
}
|