amotify 0.0.27 → 0.0.30

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "amotify",
3
- "version": "0.0.27",
3
+ "version": "0.0.30",
4
4
  "description": "UI Component for React",
5
5
  "main": "dist/launch.js",
6
6
  "types": "dist/@types.d.ts",
@@ -66,4 +66,4 @@
66
66
  "webpack-cli": "^5.1.4",
67
67
  "webpack-remove-empty-scripts": "^1.0.4"
68
68
  }
69
- }
69
+ }
@@ -49,7 +49,8 @@ const fetcher = async ( params: JsminExtension.Fetch.Input & {
49
49
  url,
50
50
  ...Params
51
51
  } );
52
- if ( $.fetch.defaultResultCallback ) $.fetch.defaultResultCallback( result );
52
+
53
+ $.fetch.defaultResultCallback && $.fetch.defaultResultCallback( result );
53
54
 
54
55
  if ( trafficControl ) {
55
56
  let { requestTime } = result;
@@ -277,7 +277,6 @@ const SeedWrapper = ( params: SeedWrapperInput ) => {
277
277
  } = Params as amotify.fn.Buttons.AnchorInput;
278
278
 
279
279
  return <button
280
- { ...Props as any }
281
280
  onClick={ ( event ) => {
282
281
  let aux = event.ctrlKey || event.metaKey;
283
282
 
@@ -292,6 +291,7 @@ const SeedWrapper = ( params: SeedWrapperInput ) => {
292
291
  pageTransit.push( URL,!!openNew );
293
292
  }
294
293
  } }
294
+ { ...Props as any }
295
295
  />;
296
296
  }
297
297
  return null;
@@ -229,55 +229,54 @@ const FileList: React.FC<{
229
229
  } );
230
230
 
231
231
  if ( Left > 0 ) {
232
- Files.push(
233
- <label
234
- key={ 'AddButton' }
235
- className={ [ params.cellClassName,style.AddButton ].join( ' ' ) }
236
- htmlFor={ params.id }
237
- tabIndex={ params.tabIndex }
238
- onKeyDown={ ( event ) => {
239
- let { key } = event;
240
- if ( params.tabIndex != -1 ) {
241
- if ( [ ' ','Enter' ].includes( key ) ) {
242
- $( '#' + params.id ).click();
243
- }
232
+ Files.push( <label
233
+ key={ 'AddButton' }
234
+ className={ [ params.cellClassName,style.AddButton ].join( ' ' ) }
235
+ data-component-id={ val_status.componentID }
236
+ htmlFor={ params.id }
237
+ tabIndex={ params.tabIndex }
238
+ onKeyDown={ ( event ) => {
239
+ let { key } = event;
240
+ if ( params.tabIndex != -1 ) {
241
+ if ( [ ' ','Enter' ].includes( key ) ) {
242
+ $( '#' + params.id ).click();
244
243
  }
245
- } }
244
+ }
245
+ } }
246
+ >
247
+ <Row.Center
248
+ padding={ [ '1/3',0 ] }
246
249
  >
247
- <Row.Center
248
- padding={ [ '1/3',0 ] }
250
+ <Box
251
+ isRounded
252
+ className={ style.AddIcon }
249
253
  >
254
+ <FAI
255
+ icon={ faCloudArrowUp }
256
+ className={ style.Icon }
257
+ fontColor={ 'theme' }
258
+ fontSize='4.thirdTitle'
259
+ backgroundColor={ 'tcOpLow' }
260
+ ssSphere={ 4 }
261
+ />
262
+ </Box>
263
+ <Box>
264
+ <Box
265
+ children={ 'ファイルを選択' + `(${ Left })` }
266
+ fontColor={ 'theme' }
267
+ fontSize={ '2.normal' }
268
+ isBoldFont
269
+ />
250
270
  <Box
251
- isRounded
252
- className={ style.AddIcon }
271
+ isBoldFont
272
+ fontColor={ '4.thin' }
273
+ fontSize={ '0.xs' }
253
274
  >
254
- <FAI
255
- icon={ faCloudArrowUp }
256
- className={ style.Icon }
257
- fontColor={ 'theme' }
258
- fontSize='4.thirdTitle'
259
- backgroundColor={ 'tcOpLow' }
260
- ssSphere={ 4 }
261
- />
275
+ ファイルをドロップ
262
276
  </Box>
263
- <Box>
264
- <Box
265
- children={ 'ファイルを選択' + `(${ Left })` }
266
- fontColor={ 'theme' }
267
- fontSize={ '2.normal' }
268
- isBoldFont
269
- />
270
- <Box
271
- isBoldFont
272
- fontColor={ '4.thin' }
273
- fontSize={ '0.xs' }
274
- >
275
- ファイルをドロップ
276
- </Box>
277
- </Box>
278
- </Row.Center>
279
- </label>
280
- )
277
+ </Box>
278
+ </Row.Center>
279
+ </label> );
281
280
  }
282
281
 
283
282
  return <Column
@@ -500,8 +499,7 @@ const FileCell: React.FC<{
500
499
  </Flex>;
501
500
  }
502
501
 
503
-
504
- ( async () => {
502
+ $.fnScope( async () => {
505
503
  $( document ).addEvent( {
506
504
  eventType: 'dragover',
507
505
  callback: ( event ) => {
@@ -520,17 +518,15 @@ const FileCell: React.FC<{
520
518
  if ( Files.length ) {
521
519
  let Target = event.target as HTMLElement;
522
520
  if ( $( Target ).hasClass( style.AddButton ) ) {
523
- let { inputComponentId } = Target.dataset;
524
- let component = useStore.get( inputComponentId! );
521
+ let { componentId } = Target.dataset;
522
+ let component = useStore.get( componentId! );
525
523
  if ( component && component.AddFiles ) component.AddFiles( Files );
526
524
  }
527
525
  }
528
526
  },
529
- option: {
530
- passive: false
531
- }
527
+ option: { passive: false }
532
528
  } );
533
- } )();
529
+ } );
534
530
 
535
531
  const FileInput: amotify.fn.Input.Filer.Methods = FileComponent as any
536
532
  FileInput.fn = {
@@ -340,7 +340,7 @@ export const CommonEffects: {
340
340
 
341
341
  $.fnScope( () => {
342
342
  if ( !val_validate.ok ) return;
343
- if ( $.is.nullish( Value ) ) return;
343
+ // if ( $.is.nullish( Value ) ) return;
344
344
  if ( !onUpdateValidValue ) return;
345
345
  onUpdateValidValue( {
346
346
  componentID,
@@ -47,7 +47,7 @@ const Comps = {
47
47
  close_option: {
48
48
  pageTransit: true,
49
49
  escapeKeyDown: true,
50
- aroundClick: false,
50
+ aroundClick: params.type == 'custom',
51
51
  ...params.close_option
52
52
  },
53
53
  }
@@ -626,8 +626,9 @@ const Comps = {
626
626
  flexSizing={ 0 }
627
627
  overflow={ 'auto' }
628
628
  { ...styles }
629
- children={ $.is.function( Content ) ? <Content /> : Content }
630
- />
629
+ >
630
+ { $.is.function( Content ) ? <Content /> : Content }
631
+ </Box>
631
632
  </Column>
632
633
  </Box>;
633
634
  },
@@ -683,27 +684,24 @@ const Comps = {
683
684
 
684
685
  let newStyles = { ...val_Styles }
685
686
  if ( ContentRect.top < 0 ) {
686
- if ( ContentRect.height < screen.height ) {
687
- newStyles.top = ContentRect.top - ContentRect.top;
688
- }
687
+ // if ( ContentRect.height < screen.height ) {}
688
+ newStyles.top = ContentRect.height + 2;
689
689
  }
690
690
  if ( ContentRect.left < 0 ) {
691
- if ( ContentRect.width < screen.width ) {
692
- newStyles.left = ContentRect.left - ContentRect.left;
693
- }
691
+ // if ( ContentRect.width < screen.width ) {}
692
+ newStyles.left = ContentRect.width + 2;
694
693
  }
695
694
  if ( ContentRect.right > screen.width ) {
696
- if ( ContentRect.width < screen.width ) {
697
- let shift = ContentRect.right - screen.width;
698
- newStyles.left = ContentRect.left - shift;
699
- }
695
+ // if ( ContentRect.width < screen.width ) {}
696
+ let shift = ContentRect.right - screen.width;
697
+ newStyles.left = ContentRect.left - shift - 2;
700
698
  }
701
699
  if ( ContentRect.bottom > screen.height ) {
702
- if ( ContentRect.height < screen.height ) {
703
- let shift = ContentRect.bottom - screen.height;
704
- newStyles.top = ContentRect.top - shift;
705
- }
700
+ // if ( ContentRect.height < screen.height ) {}
701
+ let shift = ContentRect.bottom - screen.height;
702
+ newStyles.top = ContentRect.top - shift - 2;
706
703
  }
704
+
707
705
  return newStyles;
708
706
  }
709
707
 
@@ -757,8 +755,13 @@ const Comps = {
757
755
  flexSizing={ 'none' }
758
756
  data-sheet-content={ val_componentID }
759
757
  { ...others }
760
- children={ $.is.function( Content ) ? <Content /> : Content }
761
- />
758
+ freeCSS={ {
759
+ maxWidth: '98vw',
760
+ ...others.freeCSS,
761
+ } }
762
+ >
763
+ { $.is.function( Content ) ? <Content /> : Content }
764
+ </Box>
762
765
  </Flex>
763
766
  </Box>;
764
767
  },