amotify 0.0.17 → 0.0.19
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/state.tsx +9 -2
- package/dist/amotify.js +2 -2
- package/dist/amotify.min.css +3 -3
- package/dist/coreVender.js +2 -2
- package/package.json +2 -2
- package/src/atoms/FAI/parts.tsx +49 -49
- package/src/atoms/Logo/parts.tsx +14 -14
- package/src/atoms/Various/parts.tsx +6 -6
- package/src/functions/Button/_.tsx +23 -14
- package/src/functions/Button/style.module.scss +34 -60
- package/src/functions/Cropper/parts.tsx +119 -121
- package/src/functions/Effects/Fade.tsx +4 -4
- package/src/functions/Effects/style.module.scss +9 -1
- package/src/functions/Input/Chips/Selector.tsx +2 -2
- package/src/functions/Input/Chips/_.tsx +4 -4
- package/src/functions/Input/DigitCharacters.tsx +2 -2
- package/src/functions/Input/File/_.tsx +206 -213
- package/src/functions/Input/List/_.tsx +4 -4
- package/src/functions/Input/Segmented/_.tsx +12 -12
- package/src/functions/Input/Select/_.tsx +6 -7
- package/src/functions/Input/Slider/_.tsx +4 -4
- package/src/functions/Input/Text.tsx +104 -106
- package/src/functions/Input/TextArea.tsx +33 -35
- package/src/functions/Input/Time/Picker.tsx +14 -14
- package/src/functions/Input/Time/_.tsx +77 -79
- package/src/functions/Input/_.tsx +87 -93
- package/src/functions/Input/core.tsx +2 -2
- package/src/functions/Inputs/text.tsx +6 -8
- package/src/functions/Layout/PageNotFound.tsx +2 -2
- package/src/functions/Layout/PageViewController/parts.tsx +3 -5
- package/src/functions/Layout/Plate.tsx +2 -3
- package/src/functions/Layout/RootViewController/parts.tsx +4 -4
- package/src/functions/Layout/SwipeView/parts.tsx +4 -4
- package/src/functions/Layout/TabBar.tsx +2 -2
- package/src/functions/Sheet/parts.tsx +11 -11
- package/src/functions/SnackBar/parts.tsx +4 -3
- package/src/functions/Table/Data/parts.tsx +35 -37
- package/src/functions/Table/Drag/parts.tsx +6 -6
- package/src/functions/Table/Normal/parts.tsx +6 -6
- package/src/functions/Table/_.tsx +2 -2
- package/src/molecules/Accordion/parts.tsx +2 -2
- package/src/molecules/LinkifyText/parts.tsx +3 -5
- package/src/templates/PlayGround/parts.tsx +2 -2
- package/webpack.config.js +0 -6
|
@@ -316,116 +316,114 @@ export const TextInput: React.FC<amotify.fn.Input.Text.OriginParams> = ( params
|
|
|
316
316
|
setSelection( { id: params.id,restrict,val_status } );
|
|
317
317
|
},[ val_status ] );
|
|
318
318
|
|
|
319
|
-
return
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
event.preventDefault();
|
|
354
|
-
}
|
|
355
|
-
if ( key == 'Backspace' && (
|
|
356
|
-
( restrict == 'creditCard' && v_ == ' ' ) ||
|
|
357
|
-
( restrict == 'postal' && v_ == '-' ) ||
|
|
358
|
-
( restrict == 'digitNumber' && v_ == ',' )
|
|
359
|
-
) ) {
|
|
360
|
-
input.setSelectionRange( caretFrom - 1,caretTo - 1 );
|
|
361
|
-
event.preventDefault();
|
|
362
|
-
}
|
|
319
|
+
return <BoxWrapper
|
|
320
|
+
val_status={ val_status }
|
|
321
|
+
set_status={ set_status }
|
|
322
|
+
val_validate={ val_validate }
|
|
323
|
+
params={ params }
|
|
324
|
+
>
|
|
325
|
+
<input
|
|
326
|
+
type={ inputType }
|
|
327
|
+
inputMode={ inputMode }
|
|
328
|
+
data-form={ form }
|
|
329
|
+
data-input-type={ 'text' }
|
|
330
|
+
data-validation={ val_validate.ok }
|
|
331
|
+
data-value={ val_status.dataValue }
|
|
332
|
+
data-component-id={ val_status.componentID }
|
|
333
|
+
value={ val_status.formatValue }
|
|
334
|
+
autoComplete={ autoComplete }
|
|
335
|
+
autoCapitalize={ autoCapitalize }
|
|
336
|
+
onKeyDown={ ( event ) => {
|
|
337
|
+
let { key,target } = event;
|
|
338
|
+
{
|
|
339
|
+
let input = target as HTMLInputElement;
|
|
340
|
+
let { selectionStart,selectionEnd } = input;
|
|
341
|
+
let caretFrom = Number( selectionStart );
|
|
342
|
+
let caretTo = Number( selectionEnd )
|
|
343
|
+
|
|
344
|
+
let _v = val_status.formatValue[ Number( caretFrom ) ];
|
|
345
|
+
let v_ = val_status.formatValue[ Number( caretFrom ) - 1 ];
|
|
346
|
+
if ( key == 'Delete' && (
|
|
347
|
+
( restrict == 'creditCard' && _v == ' ' ) ||
|
|
348
|
+
( restrict == 'postal' && _v == '-' ) ||
|
|
349
|
+
( restrict == 'digitNumber' && _v == ',' )
|
|
350
|
+
) ) {
|
|
351
|
+
input.setSelectionRange( caretFrom + 1,caretTo + 1 );
|
|
352
|
+
event.preventDefault();
|
|
363
353
|
}
|
|
354
|
+
if ( key == 'Backspace' && (
|
|
355
|
+
( restrict == 'creditCard' && v_ == ' ' ) ||
|
|
356
|
+
( restrict == 'postal' && v_ == '-' ) ||
|
|
357
|
+
( restrict == 'digitNumber' && v_ == ',' )
|
|
358
|
+
) ) {
|
|
359
|
+
input.setSelectionRange( caretFrom - 1,caretTo - 1 );
|
|
360
|
+
event.preventDefault();
|
|
361
|
+
}
|
|
362
|
+
}
|
|
364
363
|
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
}
|
|
364
|
+
if ( [ 'number','digitNumber','creditCard' ].includes( restrict ) ) {
|
|
365
|
+
if ( key == 'Clear' ) {
|
|
366
|
+
set_status( {
|
|
367
|
+
...val_status,
|
|
368
|
+
dataValue: '',
|
|
369
|
+
formatValue: '',
|
|
370
|
+
eventType: 'update',
|
|
371
|
+
eventID: $.uuidGen(),
|
|
372
|
+
} )
|
|
375
373
|
}
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
}
|
|
383
|
-
set_status( {
|
|
384
|
-
...val_status,
|
|
385
|
-
...DataLeveling( {
|
|
386
|
-
min,max,
|
|
387
|
-
restrict,
|
|
388
|
-
value: Value
|
|
389
|
-
} ),
|
|
390
|
-
eventType: 'update',
|
|
391
|
-
eventID: $.uuidGen(),
|
|
392
|
-
} );
|
|
393
|
-
event.preventDefault();
|
|
374
|
+
}
|
|
375
|
+
if ( [ 'number','digitNumber' ].includes( restrict ) ) {
|
|
376
|
+
if ( [ 'ArrowUp','ArrowDown' ].includes( key ) ) {
|
|
377
|
+
let direction = Number( key == 'ArrowUp' ) * 2 - 1;
|
|
378
|
+
let Value = String( Number( val_status.dataValue ) + direction );
|
|
379
|
+
if ( val_validate.ok ) {
|
|
380
|
+
set_validate( { ok: false,notice: [] } );
|
|
394
381
|
}
|
|
382
|
+
set_status( {
|
|
383
|
+
...val_status,
|
|
384
|
+
...DataLeveling( {
|
|
385
|
+
min,max,
|
|
386
|
+
restrict,
|
|
387
|
+
value: Value
|
|
388
|
+
} ),
|
|
389
|
+
eventType: 'update',
|
|
390
|
+
eventID: $.uuidGen(),
|
|
391
|
+
} );
|
|
392
|
+
event.preventDefault();
|
|
395
393
|
}
|
|
394
|
+
}
|
|
396
395
|
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
);
|
|
396
|
+
if ( onKeyDown ) onKeyDown( event );
|
|
397
|
+
if ( enableFormSubmit ) SubmitForm( event );
|
|
398
|
+
} }
|
|
399
|
+
onChange={ ( event ) => {
|
|
400
|
+
let {
|
|
401
|
+
value: rawValue,
|
|
402
|
+
selectionStart,
|
|
403
|
+
selectionEnd
|
|
404
|
+
} = event.target;
|
|
405
|
+
|
|
406
|
+
let value = DataLeveling( {
|
|
407
|
+
min,max,
|
|
408
|
+
restrict,
|
|
409
|
+
value: rawValue
|
|
410
|
+
} );
|
|
411
|
+
if ( value.formatValue == val_status.formatValue ) return;
|
|
412
|
+
|
|
413
|
+
if ( val_validate.ok ) set_validate( { ok: false,notice: [] } );
|
|
414
|
+
set_status( {
|
|
415
|
+
...val_status,
|
|
416
|
+
...value,
|
|
417
|
+
prevValue: val_status.formatValue,
|
|
418
|
+
eventType: 'update',
|
|
419
|
+
eventID: $.uuidGen(),
|
|
420
|
+
caretFrom: Number( selectionStart ),
|
|
421
|
+
caretTo: Number( selectionEnd )
|
|
422
|
+
} );
|
|
423
|
+
|
|
424
|
+
if ( onChange ) onChange( event );
|
|
425
|
+
} }
|
|
426
|
+
{ ...others }
|
|
427
|
+
/>
|
|
428
|
+
</BoxWrapper>;
|
|
431
429
|
}
|
|
@@ -71,41 +71,39 @@ export const TextAreaInput: React.FC<amotify.fn.Input.TextArea.PlainParams> = (
|
|
|
71
71
|
DefaultValidation
|
|
72
72
|
} );
|
|
73
73
|
|
|
74
|
-
return
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
onKeyDown
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
} = event.target;
|
|
74
|
+
return <BoxWrapper
|
|
75
|
+
val_status={ val_status }
|
|
76
|
+
set_status={ set_status }
|
|
77
|
+
val_validate={ val_validate }
|
|
78
|
+
params={ params }
|
|
79
|
+
>
|
|
80
|
+
<textarea
|
|
81
|
+
data-form={ form }
|
|
82
|
+
data-input-type={ 'textarea' }
|
|
83
|
+
data-validation={ val_validate.ok }
|
|
84
|
+
data-value={ val_status.dataValue }
|
|
85
|
+
data-component-id={ val_status.componentID }
|
|
86
|
+
value={ val_status.dataValue }
|
|
87
|
+
onKeyDown={ ( event ) => {
|
|
88
|
+
if ( onKeyDown ) onKeyDown( event );
|
|
89
|
+
if ( enableFormSubmit ) SubmitForm( event );
|
|
90
|
+
} }
|
|
91
|
+
onChange={ ( event ) => {
|
|
92
|
+
let {
|
|
93
|
+
value
|
|
94
|
+
} = event.target;
|
|
96
95
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
96
|
+
if ( val_validate.ok ) set_validate( { ok: false,notice: [] } );
|
|
97
|
+
set_status( {
|
|
98
|
+
...val_status,
|
|
99
|
+
dataValue: value,
|
|
100
|
+
eventType: 'update',
|
|
101
|
+
eventID: $.uuidGen(),
|
|
102
|
+
} );
|
|
104
103
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
);
|
|
104
|
+
if ( onChange ) onChange( event );
|
|
105
|
+
} }
|
|
106
|
+
{ ...others }
|
|
107
|
+
/>
|
|
108
|
+
</BoxWrapper>;
|
|
111
109
|
}
|
|
@@ -170,7 +170,7 @@ export const Picker: React.FC<amotify.fn.Input.Time.PickerParams> = ( params ) =
|
|
|
170
170
|
set_value
|
|
171
171
|
}
|
|
172
172
|
|
|
173
|
-
return
|
|
173
|
+
return <Box
|
|
174
174
|
backgroundColor={ '1.layer.base' }
|
|
175
175
|
borderRadius={ '2.tone.secondary' }
|
|
176
176
|
boxShadow={ 3 }
|
|
@@ -190,7 +190,7 @@ export const Picker: React.FC<amotify.fn.Input.Time.PickerParams> = ( params ) =
|
|
|
190
190
|
: restrict == 'dateWareki' ? ''
|
|
191
191
|
: <></> }
|
|
192
192
|
/>
|
|
193
|
-
</Box
|
|
193
|
+
</Box>;
|
|
194
194
|
}
|
|
195
195
|
|
|
196
196
|
const Comps = {
|
|
@@ -460,7 +460,7 @@ const Comps = {
|
|
|
460
460
|
|
|
461
461
|
let { year,month,date } = val_value;
|
|
462
462
|
|
|
463
|
-
return
|
|
463
|
+
return <Column
|
|
464
464
|
padding={ 1 }
|
|
465
465
|
>
|
|
466
466
|
<Flex
|
|
@@ -573,7 +573,7 @@ const Comps = {
|
|
|
573
573
|
tipsID={ tipsID! }
|
|
574
574
|
onValueUpdate={ onValueUpdate }
|
|
575
575
|
/>
|
|
576
|
-
</Column
|
|
576
|
+
</Column>;
|
|
577
577
|
},
|
|
578
578
|
MonthCalendar: ( params: {
|
|
579
579
|
min?: string
|
|
@@ -687,14 +687,14 @@ const Comps = {
|
|
|
687
687
|
</Box> );
|
|
688
688
|
}
|
|
689
689
|
|
|
690
|
-
return
|
|
690
|
+
return <Grid gridCols={ 7 }
|
|
691
691
|
gap={ '1/3' }
|
|
692
692
|
>
|
|
693
693
|
{ legends }
|
|
694
694
|
{ lastMonthLastishDates }
|
|
695
695
|
{ thisMonthDates }
|
|
696
696
|
{ nextMonthFirstishDates }
|
|
697
|
-
</Grid
|
|
697
|
+
</Grid>;
|
|
698
698
|
}
|
|
699
699
|
},
|
|
700
700
|
Month: {
|
|
@@ -709,7 +709,7 @@ const Comps = {
|
|
|
709
709
|
|
|
710
710
|
let { year,month } = val_value;
|
|
711
711
|
|
|
712
|
-
return
|
|
712
|
+
return <Column
|
|
713
713
|
padding={ 1 }
|
|
714
714
|
>
|
|
715
715
|
<Row.Separate gap={ 0 }>
|
|
@@ -768,7 +768,7 @@ const Comps = {
|
|
|
768
768
|
tipsID={ tipsID! }
|
|
769
769
|
onValueUpdate={ onValueUpdate }
|
|
770
770
|
/>
|
|
771
|
-
</Column
|
|
771
|
+
</Column>;
|
|
772
772
|
},
|
|
773
773
|
Months: ( params: {
|
|
774
774
|
min?: string
|
|
@@ -820,11 +820,11 @@ const Comps = {
|
|
|
820
820
|
</Buttons.Button.Clear.R> );
|
|
821
821
|
}
|
|
822
822
|
|
|
823
|
-
return
|
|
823
|
+
return <Grid
|
|
824
824
|
gridCols={ 4 }
|
|
825
825
|
gap={ '2/3' }
|
|
826
826
|
children={ Months }
|
|
827
|
-
|
|
827
|
+
/>;
|
|
828
828
|
}
|
|
829
829
|
},
|
|
830
830
|
Year: {
|
|
@@ -839,7 +839,7 @@ const Comps = {
|
|
|
839
839
|
|
|
840
840
|
let { year } = val_value;
|
|
841
841
|
|
|
842
|
-
return
|
|
842
|
+
return <Column
|
|
843
843
|
padding={ 1 }
|
|
844
844
|
>
|
|
845
845
|
<Input.Select
|
|
@@ -858,7 +858,7 @@ const Comps = {
|
|
|
858
858
|
tipsID={ tipsID! }
|
|
859
859
|
onValueUpdate={ onValueUpdate }
|
|
860
860
|
/>
|
|
861
|
-
</Column
|
|
861
|
+
</Column>;
|
|
862
862
|
}
|
|
863
863
|
},
|
|
864
864
|
Variables: {
|
|
@@ -866,7 +866,7 @@ const Comps = {
|
|
|
866
866
|
tipsID: string
|
|
867
867
|
onValueUpdate: any
|
|
868
868
|
} ) => {
|
|
869
|
-
return
|
|
869
|
+
return <Flex
|
|
870
870
|
flexWrap={ false }
|
|
871
871
|
gap={ 1 }
|
|
872
872
|
flexChilds='even'
|
|
@@ -893,7 +893,7 @@ const Comps = {
|
|
|
893
893
|
children={ '決定' }
|
|
894
894
|
padding={ [ '2/3',1 ] }
|
|
895
895
|
/>
|
|
896
|
-
</Flex
|
|
896
|
+
</Flex>;
|
|
897
897
|
},
|
|
898
898
|
ShiftButtons: ( params: {
|
|
899
899
|
callback( dir: -1 | 1 ): void
|
|
@@ -431,86 +431,84 @@ export const TimeInput: React.FC<amotify.fn.Input.Time.OriginParams> = ( params
|
|
|
431
431
|
}
|
|
432
432
|
},[ val_focus ] );
|
|
433
433
|
|
|
434
|
-
return
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
434
|
+
return <BoxWrapper
|
|
435
|
+
val_status={ val_status }
|
|
436
|
+
set_status={ set_status }
|
|
437
|
+
val_validate={ val_validate }
|
|
438
|
+
params={ params }
|
|
439
|
+
>
|
|
440
|
+
<Input.Hidden
|
|
441
|
+
name={ name }
|
|
442
|
+
data-input-type={ 'time' }
|
|
443
|
+
data-form={ form }
|
|
444
|
+
data-validation={ val_validate.ok }
|
|
445
|
+
componentID={ val_status.componentID }
|
|
446
|
+
data-value={ JSON.stringify(
|
|
447
|
+
[ 'dates','months' ].includes( restrict ) ?
|
|
448
|
+
!val_status.dataValue[ 0 ] || !val_status.dataValue[ 1 ] ? null
|
|
449
|
+
: val_status.dataValue
|
|
450
|
+
: ( val_status.dataValue || null )
|
|
451
|
+
) }
|
|
452
|
+
/>
|
|
453
|
+
{ amotify.config.device.isTouchDevice ?
|
|
454
|
+
<Buttons.Button.Plain
|
|
455
|
+
className={ className }
|
|
456
|
+
freeCSS={ {
|
|
457
|
+
textAlign: 'left'
|
|
458
|
+
} }
|
|
459
|
+
children={ val_status.formatValue }
|
|
460
|
+
onClick={ ( event ) => {
|
|
461
|
+
let component = useStore.get( val_status.componentID );
|
|
462
|
+
if ( component ) component.openPicker();
|
|
463
|
+
event.stopPropagation();
|
|
464
|
+
} }
|
|
465
|
+
/> : <input
|
|
466
|
+
type={ 'text' }
|
|
467
|
+
inputMode={ 'numeric' }
|
|
443
468
|
data-input-type={ 'time' }
|
|
444
|
-
data-form={ form }
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
if ( event.key == 'Tab' ) set_focus( {
|
|
488
|
-
...val_focus,
|
|
489
|
-
active: true
|
|
490
|
-
} );
|
|
491
|
-
} }
|
|
492
|
-
onClick={ ( event ) => {
|
|
493
|
-
let caretTo = ( event.target as HTMLInputElement ).selectionEnd as number;
|
|
494
|
-
let Index = 0;
|
|
495
|
-
|
|
496
|
-
val_status.ranges.forEach( ( range,index ) => {
|
|
497
|
-
let { from,length,region } = range;
|
|
498
|
-
if ( from <= caretTo && caretTo <= ( from + ( region || length ) ) ) {
|
|
499
|
-
Index = index;
|
|
500
|
-
}
|
|
501
|
-
} );
|
|
502
|
-
set_focus( {
|
|
503
|
-
...val_focus,
|
|
504
|
-
active: true,
|
|
505
|
-
index: Index
|
|
506
|
-
} );
|
|
507
|
-
event.preventDefault();
|
|
508
|
-
} }
|
|
509
|
-
onChange={ () => { } }
|
|
510
|
-
{ ...others }
|
|
511
|
-
/> }
|
|
512
|
-
</BoxWrapper>
|
|
513
|
-
);
|
|
469
|
+
data-form-name={ form }
|
|
470
|
+
value={ val_status.formatValue }
|
|
471
|
+
className={ className }
|
|
472
|
+
tabIndex={ amotify.config.device.isTouchDevice ? -1 : 0 }
|
|
473
|
+
onKeyDown={ ( event ) => {
|
|
474
|
+
KeyDownEvent( {
|
|
475
|
+
restrict,
|
|
476
|
+
event,
|
|
477
|
+
val_era,
|
|
478
|
+
val_status,set_status,
|
|
479
|
+
val_focus,set_focus
|
|
480
|
+
} );
|
|
481
|
+
|
|
482
|
+
if ( onKeyDown ) onKeyDown( event );
|
|
483
|
+
if ( enableFormSubmit ) SubmitForm( event );
|
|
484
|
+
} }
|
|
485
|
+
onKeyUp={ ( event ) => {
|
|
486
|
+
if ( event.key == 'Tab' ) set_focus( {
|
|
487
|
+
...val_focus,
|
|
488
|
+
active: true
|
|
489
|
+
} );
|
|
490
|
+
} }
|
|
491
|
+
onClick={ ( event ) => {
|
|
492
|
+
let caretTo = ( event.target as HTMLInputElement ).selectionEnd as number;
|
|
493
|
+
let Index = 0;
|
|
494
|
+
|
|
495
|
+
val_status.ranges.forEach( ( range,index ) => {
|
|
496
|
+
let { from,length,region } = range;
|
|
497
|
+
if ( from <= caretTo && caretTo <= ( from + ( region || length ) ) ) {
|
|
498
|
+
Index = index;
|
|
499
|
+
}
|
|
500
|
+
} );
|
|
501
|
+
set_focus( {
|
|
502
|
+
...val_focus,
|
|
503
|
+
active: true,
|
|
504
|
+
index: Index
|
|
505
|
+
} );
|
|
506
|
+
event.preventDefault();
|
|
507
|
+
} }
|
|
508
|
+
onChange={ () => { } }
|
|
509
|
+
{ ...others }
|
|
510
|
+
/> }
|
|
511
|
+
</BoxWrapper>;
|
|
514
512
|
}
|
|
515
513
|
|
|
516
514
|
const KeyDownEvent = ( props: {
|