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.
Files changed (44) hide show
  1. package/@types/state.tsx +9 -2
  2. package/dist/amotify.js +2 -2
  3. package/dist/amotify.min.css +3 -3
  4. package/dist/coreVender.js +2 -2
  5. package/package.json +2 -2
  6. package/src/atoms/FAI/parts.tsx +49 -49
  7. package/src/atoms/Logo/parts.tsx +14 -14
  8. package/src/atoms/Various/parts.tsx +6 -6
  9. package/src/functions/Button/_.tsx +23 -14
  10. package/src/functions/Button/style.module.scss +34 -60
  11. package/src/functions/Cropper/parts.tsx +119 -121
  12. package/src/functions/Effects/Fade.tsx +4 -4
  13. package/src/functions/Effects/style.module.scss +9 -1
  14. package/src/functions/Input/Chips/Selector.tsx +2 -2
  15. package/src/functions/Input/Chips/_.tsx +4 -4
  16. package/src/functions/Input/DigitCharacters.tsx +2 -2
  17. package/src/functions/Input/File/_.tsx +206 -213
  18. package/src/functions/Input/List/_.tsx +4 -4
  19. package/src/functions/Input/Segmented/_.tsx +12 -12
  20. package/src/functions/Input/Select/_.tsx +6 -7
  21. package/src/functions/Input/Slider/_.tsx +4 -4
  22. package/src/functions/Input/Text.tsx +104 -106
  23. package/src/functions/Input/TextArea.tsx +33 -35
  24. package/src/functions/Input/Time/Picker.tsx +14 -14
  25. package/src/functions/Input/Time/_.tsx +77 -79
  26. package/src/functions/Input/_.tsx +87 -93
  27. package/src/functions/Input/core.tsx +2 -2
  28. package/src/functions/Inputs/text.tsx +6 -8
  29. package/src/functions/Layout/PageNotFound.tsx +2 -2
  30. package/src/functions/Layout/PageViewController/parts.tsx +3 -5
  31. package/src/functions/Layout/Plate.tsx +2 -3
  32. package/src/functions/Layout/RootViewController/parts.tsx +4 -4
  33. package/src/functions/Layout/SwipeView/parts.tsx +4 -4
  34. package/src/functions/Layout/TabBar.tsx +2 -2
  35. package/src/functions/Sheet/parts.tsx +11 -11
  36. package/src/functions/SnackBar/parts.tsx +4 -3
  37. package/src/functions/Table/Data/parts.tsx +35 -37
  38. package/src/functions/Table/Drag/parts.tsx +6 -6
  39. package/src/functions/Table/Normal/parts.tsx +6 -6
  40. package/src/functions/Table/_.tsx +2 -2
  41. package/src/molecules/Accordion/parts.tsx +2 -2
  42. package/src/molecules/LinkifyText/parts.tsx +3 -5
  43. package/src/templates/PlayGround/parts.tsx +2 -2
  44. 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
- <BoxWrapper
321
- val_status={ val_status }
322
- set_status={ set_status }
323
- val_validate={ val_validate }
324
- params={ params }
325
- >
326
- <input
327
- type={ inputType }
328
- inputMode={ inputMode }
329
- data-form={ form }
330
- data-input-type={ 'text' }
331
- data-validation={ val_validate.ok }
332
- data-value={ val_status.dataValue }
333
- data-component-id={ val_status.componentID }
334
- value={ val_status.formatValue }
335
- autoComplete={ autoComplete }
336
- autoCapitalize={ autoCapitalize }
337
- onKeyDown={ ( event ) => {
338
- let { key,target } = event;
339
- {
340
- let input = target as HTMLInputElement;
341
- let { selectionStart,selectionEnd } = input;
342
- let caretFrom = Number( selectionStart );
343
- let caretTo = Number( selectionEnd )
344
-
345
- let _v = val_status.formatValue[ Number( caretFrom ) ];
346
- let v_ = val_status.formatValue[ Number( caretFrom ) - 1 ];
347
- if ( key == 'Delete' && (
348
- ( restrict == 'creditCard' && _v == ' ' ) ||
349
- ( restrict == 'postal' && _v == '-' ) ||
350
- ( restrict == 'digitNumber' && _v == ',' )
351
- ) ) {
352
- input.setSelectionRange( caretFrom + 1,caretTo + 1 );
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
- if ( [ 'number','digitNumber','creditCard' ].includes( restrict ) ) {
366
- if ( key == 'Clear' ) {
367
- set_status( {
368
- ...val_status,
369
- dataValue: '',
370
- formatValue: '',
371
- eventType: 'update',
372
- eventID: $.uuidGen(),
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
- if ( [ 'number','digitNumber' ].includes( restrict ) ) {
377
- if ( [ 'ArrowUp','ArrowDown' ].includes( key ) ) {
378
- let direction = Number( key == 'ArrowUp' ) * 2 - 1;
379
- let Value = String( Number( val_status.dataValue ) + direction );
380
- if ( val_validate.ok ) {
381
- set_validate( { ok: false,notice: [] } );
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
- if ( onKeyDown ) onKeyDown( event );
398
- if ( enableFormSubmit ) SubmitForm( event );
399
- } }
400
- onChange={ ( event ) => {
401
- let {
402
- value: rawValue,
403
- selectionStart,
404
- selectionEnd
405
- } = event.target;
406
-
407
- let value = DataLeveling( {
408
- min,max,
409
- restrict,
410
- value: rawValue
411
- } );
412
- if ( value.formatValue == val_status.formatValue ) return;
413
-
414
- if ( val_validate.ok ) set_validate( { ok: false,notice: [] } );
415
- set_status( {
416
- ...val_status,
417
- ...value,
418
- prevValue: val_status.formatValue,
419
- eventType: 'update',
420
- eventID: $.uuidGen(),
421
- caretFrom: Number( selectionStart ),
422
- caretTo: Number( selectionEnd )
423
- } );
424
-
425
- if ( onChange ) onChange( event );
426
- } }
427
- { ...others }
428
- />
429
- </BoxWrapper>
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
- <BoxWrapper
76
- val_status={ val_status }
77
- set_status={ set_status }
78
- val_validate={ val_validate }
79
- params={ params }
80
- >
81
- <textarea
82
- data-form={ form }
83
- data-input-type={ 'textarea' }
84
- data-validation={ val_validate.ok }
85
- data-value={ val_status.dataValue }
86
- data-component-id={ val_status.componentID }
87
- value={ val_status.dataValue }
88
- onKeyDown={ ( event ) => {
89
- if ( onKeyDown ) onKeyDown( event );
90
- if ( enableFormSubmit ) SubmitForm( event );
91
- } }
92
- onChange={ ( event ) => {
93
- let {
94
- value
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
- if ( val_validate.ok ) set_validate( { ok: false,notice: [] } );
98
- set_status( {
99
- ...val_status,
100
- dataValue: value,
101
- eventType: 'update',
102
- eventID: $.uuidGen(),
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
- if ( onChange ) onChange( event );
106
- } }
107
- { ...others }
108
- />
109
- </BoxWrapper>
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 ( <Box
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 ( <Column
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 ( <Grid gridCols={ 7 }
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 ( <Column
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 ( <Grid
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 ( <Column
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 ( <Flex
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
- <BoxWrapper
436
- val_status={ val_status }
437
- set_status={ set_status }
438
- val_validate={ val_validate }
439
- params={ params }
440
- >
441
- <Input.Hidden
442
- name={ name }
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
- data-validation={ val_validate.ok }
446
- componentID={ val_status.componentID }
447
- data-value={ JSON.stringify(
448
- [ 'dates','months' ].includes( restrict ) ?
449
- !val_status.dataValue[ 0 ] || !val_status.dataValue[ 1 ] ? null
450
- : val_status.dataValue
451
- : ( val_status.dataValue || null )
452
- ) }
453
- />
454
- { amotify.config.device.isTouchDevice ?
455
- <Buttons.Button.Plain
456
- className={ className }
457
- freeCSS={ {
458
- textAlign: 'left'
459
- } }
460
- children={ val_status.formatValue }
461
- onClick={ ( event ) => {
462
- let component = useStore.get( val_status.componentID );
463
- if ( component ) component.openPicker();
464
- event.stopPropagation();
465
- } }
466
- /> : <input
467
- type={ 'text' }
468
- inputMode={ 'numeric' }
469
- data-input-type={ 'time' }
470
- data-form-name={ form }
471
- value={ val_status.formatValue }
472
- className={ className }
473
- tabIndex={ amotify.config.device.isTouchDevice ? -1 : 0 }
474
- onKeyDown={ ( event ) => {
475
- KeyDownEvent( {
476
- restrict,
477
- event,
478
- val_era,
479
- val_status,set_status,
480
- val_focus,set_focus
481
- } );
482
-
483
- if ( onKeyDown ) onKeyDown( event );
484
- if ( enableFormSubmit ) SubmitForm( event );
485
- } }
486
- onKeyUp={ ( event ) => {
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: {