amotify 0.0.12 → 0.0.13

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.12",
3
+ "version": "0.0.13",
4
4
  "description": "UI Component for React",
5
5
  "main": "dist/launch.js",
6
6
  "types": "dist/@types.d.ts",
@@ -41,8 +41,6 @@
41
41
  "@types/google.maps": "^3.50.0",
42
42
  "@types/react": "^18.2.37",
43
43
  "@types/react-dom": "^18.2.15",
44
- "@types/react-router": "^5.1.20",
45
- "@types/react-router-dom": "^5.3.3",
46
44
  "babel-loader": "^8.2.3",
47
45
  "babel-preset-preact": "^2.0.0",
48
46
  "browser-sync-webpack-plugin": "^2.3.0",
@@ -62,4 +60,4 @@
62
60
  "webpack-cli": "^4.9.2",
63
61
  "webpack-remove-empty-scripts": "^0.7.3"
64
62
  }
65
- }
63
+ }
package/src/@global.tsx CHANGED
@@ -102,7 +102,8 @@ const pageTransit: amotify.global.PageTransitParams = {
102
102
  pageTransit.pushSync( url );
103
103
  return;
104
104
  }
105
- useStore.get( 'history' ).push( url );
105
+ let navigate = useStore.get( 'navigate' );
106
+ navigate( url );
106
107
  },
107
108
  push: ( url,newTab ) => {
108
109
  if ( newTab ) {
@@ -112,7 +113,8 @@ const pageTransit: amotify.global.PageTransitParams = {
112
113
  pageTransit.pushAsync( url );
113
114
  },
114
115
  back: () => {
115
- useStore.get( 'history' ).goBack();
116
+ let navigate = useStore.get( 'navigate' );
117
+ navigate( -1 );
116
118
  },
117
119
  }
118
120
 
@@ -86,9 +86,11 @@ const Core: React.FC<amotify.fn.Input.List.OriginParams> = ( params ) => {
86
86
  override,
87
87
  statusID,
88
88
  freeCSS,
89
+ icon,
90
+ iconType,
89
91
 
90
92
  enable_form_submit,
91
-
93
+ defaultActiveStyling,
92
94
  checkValidationAtFirst,
93
95
  onValidate,
94
96
  onUpdateValue,onUpdateValidValue,
@@ -245,6 +247,7 @@ const CellList: React.FC<{
245
247
  ].join( ' ' ) }
246
248
  name={ 'RadioCheckbox-' + name }
247
249
  data-list-index={ componentID + '-' + index }
250
+ key={ CellID }
248
251
  id={ CellID }
249
252
  value={ String( value ) }
250
253
  data-form-name={ form }
@@ -312,6 +315,7 @@ const CellList: React.FC<{
312
315
  tabIndex={ tabIndex }
313
316
  />,
314
317
  <Buttons.Label.Plain
318
+ key={ 'Button-' + CellID }
315
319
  htmlFor={ CellID }
316
320
  className={ ClassName.join( ' ' ) }
317
321
  tabIndex={ -1 }
@@ -17,10 +17,10 @@ import {
17
17
  const userEffect = ( beforeCallback?: Function,afterCallback?: Function,afterFirstCallback?: Function ) => {
18
18
  const mounted = React.useRef( false );
19
19
  let location = useLocation();
20
- let history = useNavigate();
20
+ let navigate = useNavigate();
21
21
  useStore.set( {
22
- key: 'history',
23
- value: history
22
+ key: 'navigate',
23
+ value: navigate
24
24
  } );
25
25
 
26
26
  amotify.fn.Sheet.closeAll( true );
@@ -63,6 +63,7 @@ const Switcher: React.FC<amotify.fn.Layout.PageRouter.RoutesSwitchProps> = ( pro
63
63
  let { path,content } = page;
64
64
  path = '/' + path.replace( /^\//,'' );
65
65
 
66
+
66
67
  return <Route
67
68
  key={ path }
68
69
  path={ path }
@@ -87,12 +88,10 @@ export const PageRouter: React.FC<amotify.fn.Layout.PageRouter.RouterProps> = (
87
88
  afterFirstCallBack
88
89
  } = props;
89
90
 
90
- return (
91
- <Switcher
92
- routes={ pages }
93
- beforeCallBack={ beforeCallBack }
94
- afterCallBack={ afterCallBack }
95
- afterFirstCallBack={ afterFirstCallBack }
96
- />
97
- );
91
+ return <Switcher
92
+ routes={ pages }
93
+ beforeCallBack={ beforeCallBack }
94
+ afterCallBack={ afterCallBack }
95
+ afterFirstCallBack={ afterFirstCallBack }
96
+ />;
98
97
  }
@@ -210,7 +210,7 @@ export const RootViewController: amotify.fn.Layout.RootViewController.Methods =
210
210
 
211
211
  let groups = $.flatArray( uriGroup );
212
212
 
213
- let currentURL = location.pathname + location.search;
213
+ let currentURL = location.pathname;
214
214
 
215
215
  {
216
216
  let isCurrentURL = false;
@@ -219,7 +219,6 @@ export const RootViewController: amotify.fn.Layout.RootViewController.Methods =
219
219
  location.origin,
220
220
  uri.replace( /\//,'' )
221
221
  ].join( '/' );
222
-
223
222
  isCurrentURL = currentURL == new URL( url ).pathname;
224
223
  }
225
224
 
@@ -299,8 +299,8 @@ const BodyRows: React.FC<amotify.fn.Tables.Drag.Params> = ( props ) => {
299
299
  </> );
300
300
  }
301
301
 
302
-
303
302
  export const DragTable: React.FC<amotify.fn.Tables.Drag.Params> = ( params ) => {
303
+ params = { ...params };
304
304
  params.colLength = params.colLength + 1;
305
305
 
306
306
  if ( params.head ) {
@@ -26,5 +26,6 @@ export const LaunchReactApplication: amotify.global.LaunchReactApplicationParams
26
26
  }
27
27
 
28
28
  let reactDom = nonRouter ? reactElement : <ReactRouterDom.BrowserRouter children={ reactElement } />;
29
- ReactDOMCLient.createRoot( Base ).render( <React.StrictMode children={ reactDom } /> );
29
+ // ReactDOMCLient.createRoot( Base ).render( <React.StrictMode children={ reactDom } /> );
30
+ ReactDOMCLient.createRoot( Base ).render( <>{ reactDom }</> );
30
31
  }
@@ -9,18 +9,19 @@ import {
9
9
  import style from './style.module.scss';
10
10
 
11
11
  const Component: React.FC<amotify.mols.Accordion.Params> = ( params ) => {
12
+ params = { ...params }
12
13
  let {
13
14
  accordionID = '',
14
15
  slideAnimation = 'fast',
15
- open = false,
16
+ defaultOpen = false,
16
17
  ...others
17
18
  } = params;
18
19
 
19
20
  let [ val_wrapID ] = React.useState( $.uuidGen() );
20
21
  let [ val_contentID ] = React.useState( $.uuidGen() );
21
- let [ val_open,set_open ] = React.useState( open );
22
+ let [ val_open,set_open ] = React.useState( defaultOpen );
22
23
 
23
- if ( val_open != open ) set_open( open );
24
+ if ( val_open != defaultOpen ) set_open( defaultOpen );
24
25
 
25
26
  let Query = '[data-accordion-content-id="' + val_contentID + '"]';
26
27
 
@@ -95,15 +96,15 @@ const Component: React.FC<amotify.mols.Accordion.Params> = ( params ) => {
95
96
  value: {
96
97
  open: () => {
97
98
  set_open( true );
98
- params.open = true;
99
+ // params.open = true;
99
100
  },
100
101
  close: () => {
101
102
  set_open( false );
102
- params.open = false;
103
+ // params.open = false;
103
104
  },
104
105
  toggle: () => {
105
106
  set_open( !val_open );
106
- params.open = !val_open;
107
+ // params.open = !val_open;
107
108
  }
108
109
  }
109
110
  } );