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.
Files changed (79) hide show
  1. package/@types/_.tsx +5 -5
  2. package/@types/amot.tsx +11 -11
  3. package/@types/fn.tsx +14 -1
  4. package/@types/module.tsx +1 -1
  5. package/dist/amotify.js +1 -1
  6. package/dist/amotify.min.css +3 -3
  7. package/package.json +1 -1
  8. package/src/@atoms.tsx +3 -3
  9. package/src/@functions.tsx +11 -11
  10. package/src/@global.tsx +40 -40
  11. package/src/@jsminAmotifyExtension/_.tsx +4 -4
  12. package/src/@jsminAmotifyExtension/fetch.tsx +30 -30
  13. package/src/@jsminAmotifyExtension/formCollect.tsx +32 -32
  14. package/src/@jsminAmotifyExtension/spreadSheet.tsx +71 -71
  15. package/src/@jsminAmotifyExtension/variables.tsx +38 -38
  16. package/src/@molecules.tsx +6 -6
  17. package/src/@styles/props.scss +1 -1
  18. package/src/@styles/var.scss +0 -1
  19. package/src/@templates.tsx +1 -1
  20. package/src/@variables.tsx +2 -2
  21. package/src/atoms/FAI/parts.tsx +105 -105
  22. package/src/atoms/Logo/parts.tsx +19 -19
  23. package/src/atoms/Various/parts.tsx +26 -26
  24. package/src/config.tsx +62 -59
  25. package/src/functions/Button/_.tsx +49 -49
  26. package/src/functions/Cropper/parts.tsx +249 -249
  27. package/src/functions/Effects/Fade.tsx +18 -18
  28. package/src/functions/Effects/Ripple.tsx +24 -24
  29. package/src/functions/Effects/_.tsx +5 -5
  30. package/src/functions/Input/Chips/Selector.tsx +107 -107
  31. package/src/functions/Input/Chips/_.tsx +66 -66
  32. package/src/functions/Input/Contenteditable.tsx +18 -18
  33. package/src/functions/Input/DigitCharacters.tsx +48 -48
  34. package/src/functions/Input/File/_.tsx +114 -114
  35. package/src/functions/Input/Hidden.tsx +3 -3
  36. package/src/functions/Input/List/_.tsx +61 -61
  37. package/src/functions/Input/RichSelect/_.tsx +38 -38
  38. package/src/functions/Input/Segmented/_.tsx +30 -30
  39. package/src/functions/Input/Select/_.tsx +42 -42
  40. package/src/functions/Input/Slider/_.tsx +93 -93
  41. package/src/functions/Input/Switch/_.tsx +21 -21
  42. package/src/functions/Input/Text.tsx +99 -97
  43. package/src/functions/Input/TextArea.tsx +17 -17
  44. package/src/functions/Input/Time/Picker.tsx +199 -199
  45. package/src/functions/Input/Time/_.tsx +173 -173
  46. package/src/functions/Input/_.tsx +135 -135
  47. package/src/functions/Input/core.tsx +96 -96
  48. package/src/functions/Inputs/_.tsx +1 -1
  49. package/src/functions/Inputs/text.tsx +5 -5
  50. package/src/functions/Layout/PageNotFound.tsx +6 -6
  51. package/src/functions/Layout/PageRouter.tsx +28 -44
  52. package/src/functions/Layout/PageViewController/parts.tsx +7 -7
  53. package/src/functions/Layout/Plate.tsx +5 -5
  54. package/src/functions/Layout/RootViewController/parts.tsx +94 -71
  55. package/src/functions/Layout/RootViewController/style.module.scss +0 -1
  56. package/src/functions/Layout/SwipeView/parts.tsx +90 -90
  57. package/src/functions/Layout/TabBar.tsx +10 -10
  58. package/src/functions/Layout/_.tsx +7 -7
  59. package/src/functions/Loader/corner.tsx +10 -10
  60. package/src/functions/Loader/mini.tsx +25 -25
  61. package/src/functions/Loader/parts.tsx +31 -31
  62. package/src/functions/Loader/top.tsx +10 -10
  63. package/src/functions/Sheet/parts.tsx +219 -219
  64. package/src/functions/Sheet/style.module.scss +0 -20
  65. package/src/functions/SnackBar/parts.tsx +50 -50
  66. package/src/functions/Table/Data/parts.tsx +202 -202
  67. package/src/functions/Table/Drag/parts.tsx +76 -76
  68. package/src/functions/Table/Normal/parts.tsx +23 -23
  69. package/src/functions/Table/_.tsx +33 -33
  70. package/src/functions/Tooltips/parts.tsx +7 -7
  71. package/src/global/LaunchReactApplication.tsx +28 -28
  72. package/src/global/styleConverter.tsx +133 -133
  73. package/src/launch.tsx +27 -27
  74. package/src/molecules/Accordion/parts.tsx +41 -41
  75. package/src/molecules/LinkifyText/parts.tsx +18 -18
  76. package/src/molecules/List.tsx +6 -6
  77. package/src/preload.tsx +5 -45
  78. package/src/templates/PlayGround/parts.tsx +8 -8
  79. package/webpack.config.js +9 -9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "amotify",
3
- "version": "0.0.59",
3
+ "version": "0.0.62",
4
4
  "description": "UI Component for React",
5
5
  "main": "dist/launch.js",
6
6
  "types": "dist/@types.d.ts",
package/src/@atoms.tsx CHANGED
@@ -7,13 +7,13 @@ import {
7
7
  Grid,
8
8
  Paragraph,
9
9
  Placeholder
10
- } from './atoms/Various/parts';
10
+ } from './atoms/Various/parts'
11
11
 
12
12
  import {
13
13
  FAI
14
- } from './atoms/FAI/parts';
14
+ } from './atoms/FAI/parts'
15
15
 
16
- import { Logo } from './atoms/Logo/parts';
16
+ import { Logo } from './atoms/Logo/parts'
17
17
 
18
18
  export {
19
19
  Flex,
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  Effects
3
- } from './functions/Effects/_';
3
+ } from './functions/Effects/_'
4
4
 
5
- import { Buttons } from './functions/Button/_';
6
- import { Input } from './functions/Input/_';
7
- import { Inputs } from './functions/Inputs/_';
8
- import { Layout } from './functions/Layout/_';
9
- import { Table } from './functions/Table/_';
10
- import { Sheet } from './functions/Sheet/parts';
11
- import { SnackBar } from './functions/SnackBar/parts';
12
- import { Loader } from './functions/Loader/parts';
13
- import { Tooltips } from './functions/Tooltips/parts';
5
+ import { Buttons } from './functions/Button/_'
6
+ import { Input } from './functions/Input/_'
7
+ import { Inputs } from './functions/Inputs/_'
8
+ import { Layout } from './functions/Layout/_'
9
+ import { Table } from './functions/Table/_'
10
+ import { Sheet } from './functions/Sheet/parts'
11
+ import { SnackBar } from './functions/SnackBar/parts'
12
+ import { Loader } from './functions/Loader/parts'
13
+ import { Tooltips } from './functions/Tooltips/parts'
14
14
 
15
- import { Cropper } from './functions/Cropper/parts';
15
+ import { Cropper } from './functions/Cropper/parts'
16
16
 
17
17
  export {
18
18
  Buttons,
package/src/@global.tsx CHANGED
@@ -1,12 +1,12 @@
1
- import React from 'react';
2
- import ReactDOM from 'react-dom';
3
- import * as ReactRouterDOM from 'react-router-dom';
4
- import { launchID } from './@variables';
1
+ import React from 'react'
2
+ import ReactDOM from 'react-dom'
3
+ import * as ReactRouterDOM from 'react-router-dom'
4
+ import { launchID } from './@variables'
5
5
 
6
6
  import {
7
7
  LaunchReactApplication,
8
8
  LaunchSubApplication
9
- } from './global/LaunchReactApplication';
9
+ } from './global/LaunchReactApplication'
10
10
 
11
11
  export { launchID }
12
12
  const Inmemory: {
@@ -21,25 +21,25 @@ const useStore: amotify.global.useStoreParams = {
21
21
  key,
22
22
  value,
23
23
  privateKey
24
- } = params;
24
+ } = params
25
25
  let Prev = Inmemory[ key ] || {}
26
- if ( Prev && Prev.privateKey && Prev.privateKey != privateKey ) return false;
26
+ if ( Prev && Prev.privateKey && Prev.privateKey != privateKey ) return false
27
27
 
28
28
  Inmemory[ key ] = {
29
29
  privateKey,
30
30
  value
31
31
  }
32
- return true;
32
+ return true
33
33
  },
34
34
  update: ( params ) => {
35
35
  let {
36
36
  key,
37
37
  value,
38
38
  privateKey
39
- } = params;
39
+ } = params
40
40
 
41
41
  let Prev = Inmemory[ key ] || {}
42
- if ( Prev && Prev.privateKey && Prev.privateKey != privateKey ) return false;
42
+ if ( Prev && Prev.privateKey && Prev.privateKey != privateKey ) return false
43
43
 
44
44
  Inmemory[ key ] = {
45
45
  ...Inmemory[ key ],
@@ -48,29 +48,29 @@ const useStore: amotify.global.useStoreParams = {
48
48
  ...value
49
49
  }
50
50
  }
51
- return true;
51
+ return true
52
52
  },
53
53
  get: ( key,privateKey ) => {
54
- let Data = Inmemory[ key ];
55
- if ( Data && Data.privateKey && Data.privateKey != privateKey ) return void 0;
56
- return Data?.value;
54
+ let Data = Inmemory[ key ]
55
+ if ( Data && Data.privateKey && Data.privateKey != privateKey ) return void 0
56
+ return Data?.value
57
57
  },
58
58
  delete: ( key,privateKey ) => {
59
- let Data = Inmemory[ key ];
60
- if ( Data && Data.privateKey && Data.privateKey != privateKey ) return false;
61
- delete Inmemory[ key ];
62
- return true;
59
+ let Data = Inmemory[ key ]
60
+ if ( Data && Data.privateKey && Data.privateKey != privateKey ) return false
61
+ delete Inmemory[ key ]
62
+ return true
63
63
  }
64
64
  }
65
65
  const useRecycle: amotify.global.useRecycleParams = {
66
66
  set: ( key ) => {
67
- let [ val_recycleID ] = React.useState( $.uuidGen() );
68
- let [ val_refresh,set_refresh ] = React.useState( $.uuidGen() );
67
+ let [ val_recycleID ] = React.useState( $.uuidGen() )
68
+ let [ val_refresh,set_refresh ] = React.useState( $.uuidGen() )
69
69
 
70
70
  useStore.set( {
71
71
  key: 'RecycleKey_' + val_recycleID,
72
72
  value: () => {
73
- set_refresh( $.uuidGen() );
73
+ set_refresh( $.uuidGen() )
74
74
  }
75
75
  } )
76
76
  useStore.update( {
@@ -82,59 +82,59 @@ const useRecycle: amotify.global.useRecycleParams = {
82
82
  ]
83
83
  }
84
84
  } )
85
- return val_refresh;
85
+ return val_refresh
86
86
  },
87
87
  do: ( key ) => {
88
- let Keys = useStore.get( 'RecycleKeys_' + key )?.keys || [];
88
+ let Keys = useStore.get( 'RecycleKeys_' + key )?.keys || []
89
89
 
90
- if ( !Keys.length ) return;
90
+ if ( !Keys.length ) return
91
91
  for ( let key of Keys ) {
92
- let receiver = useStore.get( 'RecycleKey_' + key );
93
- if ( receiver ) receiver();
92
+ let receiver = useStore.get( 'RecycleKey_' + key )
93
+ if ( receiver ) receiver()
94
94
  }
95
95
  }
96
96
  }
97
97
 
98
98
  const pageTransit: amotify.global.PageTransitParams = {
99
99
  open: ( url ) => {
100
- window.open( url );
100
+ window.open( url )
101
101
  },
102
102
  pushSync: ( url ) => {
103
- window.location.href = url;
103
+ window.location.href = url
104
104
  },
105
105
  pushAsync: ( url ) => {
106
106
  if ( url.match( /https?:\/\// ) ) {
107
- pageTransit.pushSync( url );
108
- return;
107
+ pageTransit.pushSync( url )
108
+ return
109
109
  }
110
- let navigate = useStore.get( 'navigate' );
111
- navigate( url );
110
+ let navigate = useStore.get( 'navigate' )
111
+ navigate( url )
112
112
  },
113
113
  push: ( url,newTab ) => {
114
114
  if ( newTab ) {
115
- pageTransit.open( url );
116
- return;
115
+ pageTransit.open( url )
116
+ return
117
117
  }
118
- pageTransit.pushAsync( url );
118
+ pageTransit.pushAsync( url )
119
119
  },
120
120
  back: () => {
121
- let navigate = useStore.get( 'navigate' );
122
- navigate( -1 );
121
+ let navigate = useStore.get( 'navigate' )
122
+ navigate( -1 )
123
123
  },
124
124
  }
125
125
 
126
126
  import {
127
127
  ReadStyleSet,
128
128
  ToClassName
129
- } from './global/styleConverter';
129
+ } from './global/styleConverter'
130
130
 
131
131
  const StyleConverter = {
132
132
  ReadStyleSet,
133
133
  ToClassName
134
134
  }
135
135
 
136
- if ( !global.React ) global.React = React;
137
- if ( !global.ReactDOM ) global.ReactDOM = ReactDOM;
136
+ if ( !global.React ) global.React = React
137
+ if ( !global.ReactDOM ) global.ReactDOM = ReactDOM
138
138
 
139
139
  export {
140
140
  React,
@@ -1,4 +1,4 @@
1
- import './variables';
2
- import './fetch';
3
- import './formCollect';
4
- import './spreadSheet';
1
+ import './variables'
2
+ import './fetch'
3
+ import './formCollect'
4
+ import './spreadSheet'
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React from 'react'
2
2
 
3
3
  const fetcher = async ( params: JsminExtension.Fetch.Input & {
4
4
  method: string
@@ -16,7 +16,7 @@ const fetcher = async ( params: JsminExtension.Fetch.Input & {
16
16
  } = params || {}
17
17
 
18
18
  let result: Jsmin.Fetch.Output = await ( async () => {
19
- let exist = $.fetch.waitList.includes( key );
19
+ let exist = $.fetch.waitList.includes( key )
20
20
 
21
21
  if ( preventMultiRequest && exist ) {
22
22
  return {
@@ -29,10 +29,10 @@ const fetcher = async ( params: JsminExtension.Fetch.Input & {
29
29
  }
30
30
  }
31
31
 
32
- $.fetch.waitList = [ ...$.fetch.waitList,key ];
32
+ $.fetch.waitList = [ ...$.fetch.waitList,key ]
33
33
 
34
34
  if ( !url.match( /https?:/ ) ) {
35
- url = '/' + url.replace( /^\//,"" );
35
+ url = '/' + url.replace( /^\//,"" )
36
36
 
37
37
  Params.headers = {
38
38
  ...$.fetch.defaultHeaders || {},
@@ -40,56 +40,56 @@ const fetcher = async ( params: JsminExtension.Fetch.Input & {
40
40
  }
41
41
  }
42
42
 
43
- amotify.fn.Loader.fn.mini.active( params.key || '' );
44
- !topLoader || amotify.fn.Loader.fn.top.active();
45
- !cornerLoader || amotify.fn.Loader.fn.corner.active();
43
+ amotify.fn.Loader.fn.mini.active( params.key || '' )
44
+ !topLoader || amotify.fn.Loader.fn.top.active()
45
+ !cornerLoader || amotify.fn.Loader.fn.corner.active()
46
46
 
47
47
  let result = await $.ajax( {
48
48
  method,
49
49
  url,
50
50
  ...Params
51
- } );
51
+ } )
52
52
 
53
- $.fetch.defaultResultCallback && $.fetch.defaultResultCallback( result );
53
+ $.fetch.defaultResultCallback && $.fetch.defaultResultCallback( result )
54
54
 
55
55
  if ( trafficControl ) {
56
- let { requestTime } = result;
56
+ let { requestTime } = result
57
57
  if ( requestTime <= trafficControl ) {
58
- let CoolDownTime = Number( trafficControl - requestTime );
58
+ let CoolDownTime = Number( trafficControl - requestTime )
59
59
  await ( () => {
60
- result.requestTime = trafficControl;
60
+ result.requestTime = trafficControl
61
61
  return new Promise( ( resolve,reject ) => {
62
62
  setTimeout( () => {
63
- resolve( void 0 );
64
- },CoolDownTime );
65
- } );
66
- } )();
63
+ resolve( void 0 )
64
+ },CoolDownTime )
65
+ } )
66
+ } )()
67
67
  }
68
68
  }
69
69
 
70
- amotify.fn.Loader.fn.mini.stop( params.key || '' );
71
- !topLoader || amotify.fn.Loader.fn.top.stop();
72
- !cornerLoader || amotify.fn.Loader.fn.corner.stop();
73
- $.fetch.waitList.splice( $.fetch.waitList.findIndex( ( a ) => a == key ),1 );
74
- return result;
75
- } )();
70
+ amotify.fn.Loader.fn.mini.stop( params.key || '' )
71
+ !topLoader || amotify.fn.Loader.fn.top.stop()
72
+ !cornerLoader || amotify.fn.Loader.fn.corner.stop()
73
+ $.fetch.waitList.splice( $.fetch.waitList.findIndex( ( a ) => a == key ),1 )
74
+ return result
75
+ } )()
76
76
 
77
- if ( callback ) callback( result );
78
- return result;
77
+ if ( callback ) callback( result )
78
+ return result
79
79
  }
80
80
 
81
81
  $.fetch = {
82
82
  get: async ( params,callback ) => {
83
- return await fetcher( { ...params,method: 'get' },callback );
83
+ return await fetcher( { ...params,method: 'get' },callback )
84
84
  },
85
85
  post: async ( params,callback ) => {
86
- return await fetcher( { ...params,method: 'post' },callback );
86
+ return await fetcher( { ...params,method: 'post' },callback )
87
87
  },
88
88
  options: async ( params,callback ) => {
89
- return await fetcher( { ...params,method: 'options' },callback );
89
+ return await fetcher( { ...params,method: 'options' },callback )
90
90
  },
91
91
  put: async ( params,callback ) => {
92
- return await fetcher( { ...params,method: 'put' },callback );
92
+ return await fetcher( { ...params,method: 'put' },callback )
93
93
  },
94
94
  waitList: [],
95
95
  defaultHeaders: {},
@@ -97,14 +97,14 @@ $.fetch = {
97
97
  let {
98
98
  status,
99
99
  statusText
100
- } = result;
100
+ } = result
101
101
  if ( status == 500 ) {
102
102
  $.NoticeHttpStatus( {
103
103
  status,statusText,
104
104
  label: <>
105
105
  Internal Server Error
106
106
  </>
107
- } );
107
+ } )
108
108
  }
109
109
  }
110
110
  }
@@ -1,29 +1,29 @@
1
1
  import {
2
2
  useStore
3
- } from '@global';
3
+ } from '@global'
4
4
 
5
- let formProcess = false;
5
+ let formProcess = false
6
6
  $.formCollect = async ( form ) => {
7
7
  if ( formProcess ) return {
8
8
  valid: false,
9
9
  data: {}
10
10
  }
11
11
 
12
- let focusElement: HTMLElement = document.activeElement as any;
13
- if ( focusElement ) focusElement.blur();
12
+ let focusElement: HTMLElement = document.activeElement as any
13
+ if ( focusElement ) focusElement.blur()
14
14
 
15
- formProcess = true;
15
+ formProcess = true
16
16
  let Inputs = $( `[data-form="${ form }"]` ),
17
17
  totalValid = 1,
18
18
  Values: plainObject = {}
19
19
 
20
20
  for ( let index = 0; index < Inputs.length; index++ ) {
21
- let Input = Inputs[ index ];
21
+ let Input = Inputs[ index ]
22
22
 
23
- let { componentId = '' } = Input.dataset;
24
- let componentData = useStore.get( componentId );
23
+ let { componentId = '' } = Input.dataset
24
+ let componentData = useStore.get( componentId )
25
25
 
26
- if ( componentData && componentData.Refresh ) await componentData.Refresh();
26
+ if ( componentData && componentData.Refresh ) await componentData.Refresh()
27
27
 
28
28
  let {
29
29
  value: displayValue,
@@ -35,60 +35,60 @@ $.formCollect = async ( form ) => {
35
35
  inputType = '',
36
36
  validation
37
37
  }
38
- } = Inputs[ index ] as any;
39
- let Value: any = value;
38
+ } = Inputs[ index ] as any
39
+ let Value: any = value
40
40
 
41
- name = name || dataName;
41
+ name = name || dataName
42
42
 
43
- validation = Number( ( validation ?? 'true' ) == 'true' );
43
+ validation = Number( ( validation ?? 'true' ) == 'true' )
44
44
 
45
45
  if ( inputType == 'hidden' ) {
46
- if ( Value ) Value = JSON.parse( Value );
46
+ if ( Value ) Value = JSON.parse( Value )
47
47
  } else if ( [ 'radio','checkbox','checker' ].includes( inputType ) ) {
48
48
  if ( Value ) {
49
- Value = JSON.parse( Value );
49
+ Value = JSON.parse( Value )
50
50
  if ( $.is.array( Value ) ) {
51
51
  Value = Value.map( ( v ) => JSON.parse( v ) )
52
52
  } else {
53
- Value = JSON.parse( Value );
53
+ Value = JSON.parse( Value )
54
54
  }
55
55
  if ( inputType == 'radio' ) {
56
- Value = Value[ 0 ];
56
+ Value = Value[ 0 ]
57
57
  }
58
58
  if ( inputType == 'checker' ) {
59
- Value = Boolean( Value[ 0 ] );
59
+ Value = Boolean( Value[ 0 ] )
60
60
  }
61
61
  }
62
62
  } else if ( [ 'chips-single','chips-multi' ].includes( inputType ) ) {
63
- Value = JSON.parse( Value );
63
+ Value = JSON.parse( Value )
64
64
  if ( Value.length ) {
65
- if ( inputType == 'chips-single' ) Value = Value[ 0 ];
65
+ if ( inputType == 'chips-single' ) Value = Value[ 0 ]
66
66
  }
67
67
  } else if ( inputType == 'time' ) {
68
- if ( Value ) Value = JSON.parse( Value );
68
+ if ( Value ) Value = JSON.parse( Value )
69
69
  } else if ( inputType == 'select' ) {
70
- if ( Value ) Value = JSON.parse( Value );
70
+ if ( Value ) Value = JSON.parse( Value )
71
71
  } else if ( inputType == 'richSelect' ) {
72
- if ( Value ) Value = JSON.parse( Value );
72
+ if ( Value ) Value = JSON.parse( Value )
73
73
  } else if ( inputType == 'file' ) {
74
74
  if ( componentData ) {
75
- let files = componentData.Files;
76
- Value = files;
75
+ let files = componentData.Files
76
+ Value = files
77
77
  }
78
78
  } else if ( inputType == 'slider' ) {
79
- if ( Value ) Value = JSON.parse( Value );
79
+ if ( Value ) Value = JSON.parse( Value )
80
80
  } else if ( inputType == 'switch' ) {
81
- Value = checked | 0;
81
+ Value = checked | 0
82
82
  }
83
- let valid = ( validation ?? 1 ) | 0;
84
- totalValid &= valid;
83
+ let valid = ( validation ?? 1 ) | 0
84
+ totalValid &= valid
85
85
 
86
- if ( validation ) Values[ name ] = Value;
86
+ if ( validation ) Values[ name ] = Value
87
87
  }
88
88
 
89
- formProcess = false;
89
+ formProcess = false
90
90
  return {
91
91
  valid: Boolean( totalValid ),
92
92
  data: Values
93
- };
93
+ }
94
94
  }