amotify 0.0.2 → 0.0.4

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 (185) hide show
  1. package/dist/src/@jsminAmotifyExtension/_.d.ts +4 -0
  2. package/dist/src/@jsminAmotifyExtension/fetch.d.ts +9 -0
  3. package/dist/src/@jsminAmotifyExtension/formCollect.d.ts +1 -0
  4. package/dist/src/@jsminAmotifyExtension/spreadSheet.d.ts +4 -0
  5. package/dist/src/@jsminAmotifyExtension/variables.d.ts +0 -0
  6. package/dist/src/@types/_.d.ts +6 -0
  7. package/dist/src/@types/amot.d.ts +260 -0
  8. package/dist/src/@types/fn.d.ts +1040 -0
  9. package/dist/src/@types/index.d.ts +62 -0
  10. package/dist/src/@types/jsminAmotifyExtension.d.ts +134 -0
  11. package/dist/src/@types/module.d.ts +2 -0
  12. package/dist/src/@types/state.d.ts +145 -0
  13. package/dist/src/Atoms/@export.d.ts +4 -0
  14. package/dist/src/Atoms/FAIcon/parts.d.ts +2 -0
  15. package/dist/src/Atoms/Logo/parts.d.ts +1 -0
  16. package/dist/src/Atoms/Various/parts.d.ts +9 -0
  17. package/dist/src/Functions/@export.d.ts +12 -0
  18. package/dist/src/Functions/Button/_.d.ts +1 -0
  19. package/dist/src/Functions/Cropper/parts.d.ts +1 -0
  20. package/dist/src/Functions/Effects/Fade.d.ts +1 -0
  21. package/dist/src/Functions/Effects/Ripple.d.ts +1 -0
  22. package/dist/src/Functions/Effects/_.d.ts +3 -0
  23. package/dist/src/Functions/Input/Chips/Selector.d.ts +1 -0
  24. package/dist/src/Functions/Input/Chips/_.d.ts +2 -0
  25. package/dist/src/Functions/Input/DigitCharacters.d.ts +1 -0
  26. package/dist/src/Functions/Input/File/_.d.ts +2 -0
  27. package/dist/src/Functions/Input/Hidden.d.ts +1 -0
  28. package/dist/src/Functions/Input/List/_.d.ts +1 -0
  29. package/dist/src/Functions/Input/Segmented/_.d.ts +1 -0
  30. package/dist/src/Functions/Input/Select/_.d.ts +1 -0
  31. package/dist/src/Functions/Input/Slider/_.d.ts +1 -0
  32. package/dist/src/Functions/Input/Switch/_.d.ts +1 -0
  33. package/dist/src/Functions/Input/Text.d.ts +5 -0
  34. package/dist/src/Functions/Input/TextArea.d.ts +1 -0
  35. package/dist/src/Functions/Input/Time/Picker.d.ts +1 -0
  36. package/dist/src/Functions/Input/Time/_.d.ts +2 -0
  37. package/dist/src/Functions/Input/_.d.ts +5 -0
  38. package/dist/src/Functions/Input/core.d.ts +34 -0
  39. package/dist/src/Functions/Inputs/_.d.ts +3 -0
  40. package/dist/src/Functions/Inputs/text.d.ts +12 -0
  41. package/dist/src/Functions/Layout/PageNotFound.d.ts +1 -0
  42. package/dist/src/Functions/Layout/PageRouter.d.ts +2 -0
  43. package/dist/src/Functions/Layout/PageViewController/parts.d.ts +1 -0
  44. package/dist/src/Functions/Layout/Plate.d.ts +1 -0
  45. package/dist/src/Functions/Layout/RootViewController/parts.d.ts +1 -0
  46. package/dist/src/Functions/Layout/SwipeView/parts.d.ts +2 -0
  47. package/dist/src/Functions/Layout/TabBar.d.ts +1 -0
  48. package/dist/src/Functions/Layout/_.d.ts +2 -0
  49. package/dist/src/Functions/Loader/corner.d.ts +1 -0
  50. package/dist/src/Functions/Loader/mini.d.ts +33 -0
  51. package/dist/src/Functions/Loader/parts.d.ts +3 -0
  52. package/dist/src/Functions/Loader/top.d.ts +1 -0
  53. package/dist/src/Functions/Sheet/parts.d.ts +2 -0
  54. package/dist/src/Functions/SnackBar/parts.d.ts +2 -0
  55. package/dist/src/Functions/Table/Data/parts.d.ts +3 -0
  56. package/dist/src/Functions/Table/Drag/parts.d.ts +1 -0
  57. package/dist/src/Functions/Table/Normal/parts.d.ts +1 -0
  58. package/dist/src/Functions/Table/_.d.ts +9 -0
  59. package/dist/src/Functions/Tooltips/parts.d.ts +2 -0
  60. package/dist/src/Global/@export.d.ts +12 -0
  61. package/dist/src/Global/LaunchReactApplication.d.ts +1 -0
  62. package/dist/src/Global/styleConverter.d.ts +2 -0
  63. package/dist/src/Molecules/@export.d.ts +21 -0
  64. package/dist/src/Molecules/Accordion/parts.d.ts +2 -0
  65. package/dist/src/Molecules/LinkifyText/parts.d.ts +1 -0
  66. package/dist/src/Molecules/List.d.ts +1 -0
  67. package/dist/src/Organisms/@export.d.ts +2 -0
  68. package/dist/src/Organisms/DisplayStyleInput/_.d.ts +1 -0
  69. package/dist/src/Organisms/DisplayStyleInput/darkmode.d.ts +1 -0
  70. package/dist/src/Organisms/DisplayStyleInput/themeColor.d.ts +27 -0
  71. package/dist/src/Templates/@export.d.ts +2 -0
  72. package/dist/src/Templates/PlayGround/parts.d.ts +1 -0
  73. package/dist/src/config.d.ts +16 -0
  74. package/dist/src/launch.d.ts +9 -0
  75. package/dist/src/preload.d.ts +1 -0
  76. package/package.json +2 -2
  77. package/src/@jsminAmotifyExtension/_.tsx +4 -0
  78. package/src/@jsminAmotifyExtension/fetch.tsx +107 -0
  79. package/src/@jsminAmotifyExtension/formCollect.tsx +89 -0
  80. package/src/@jsminAmotifyExtension/spreadSheet.tsx +159 -0
  81. package/src/@jsminAmotifyExtension/variables.tsx +130 -0
  82. package/src/@styles/@app.scss +4 -0
  83. package/src/@styles/@variables/customProps.scss +109 -0
  84. package/src/@styles/@variables/styleSet.scss +38 -0
  85. package/src/@styles/@variables/themeColor.scss +71 -0
  86. package/src/@styles/@variables/var.scss +171 -0
  87. package/src/@styles/UniStyling.scss +996 -0
  88. package/src/@styles/init.scss +154 -0
  89. package/src/@types/_.tsx +6 -0
  90. package/src/@types/amot.tsx +323 -0
  91. package/src/@types/fn.tsx +1210 -0
  92. package/src/@types/index.tsx +74 -0
  93. package/src/@types/jsminAmotifyExtension.tsx +143 -0
  94. package/src/@types/module.tsx +2 -0
  95. package/src/@types/state.tsx +199 -0
  96. package/src/Atoms/@export.tsx +32 -0
  97. package/src/Atoms/FAIcon/parts.tsx +117 -0
  98. package/src/Atoms/FAIcon/style.module.scss +9 -0
  99. package/src/Atoms/Logo/parts.tsx +335 -0
  100. package/src/Atoms/Logo/style.module.scss +96 -0
  101. package/src/Atoms/Various/parts.tsx +157 -0
  102. package/src/Atoms/Various/style.module.scss +40 -0
  103. package/src/Functions/@export.tsx +29 -0
  104. package/src/Functions/Button/_.tsx +305 -0
  105. package/src/Functions/Button/style.module.scss +183 -0
  106. package/src/Functions/Cropper/parts.tsx +1061 -0
  107. package/src/Functions/Cropper/style.module.scss +62 -0
  108. package/src/Functions/Effects/Fade.tsx +81 -0
  109. package/src/Functions/Effects/Ripple.tsx +141 -0
  110. package/src/Functions/Effects/_.tsx +33 -0
  111. package/src/Functions/Effects/style.module.scss +83 -0
  112. package/src/Functions/Input/Chips/Selector.tsx +451 -0
  113. package/src/Functions/Input/Chips/_.tsx +286 -0
  114. package/src/Functions/Input/Chips/style.module.scss +6 -0
  115. package/src/Functions/Input/DigitCharacters.tsx +241 -0
  116. package/src/Functions/Input/File/_.tsx +596 -0
  117. package/src/Functions/Input/File/style.module.scss +34 -0
  118. package/src/Functions/Input/Hidden.tsx +18 -0
  119. package/src/Functions/Input/List/_.tsx +383 -0
  120. package/src/Functions/Input/List/style.module.scss +84 -0
  121. package/src/Functions/Input/Segmented/_.tsx +238 -0
  122. package/src/Functions/Input/Segmented/style.module.scss +81 -0
  123. package/src/Functions/Input/Select/_.tsx +225 -0
  124. package/src/Functions/Input/Select/style.module.scss +10 -0
  125. package/src/Functions/Input/Slider/_.tsx +519 -0
  126. package/src/Functions/Input/Slider/style.module.scss +67 -0
  127. package/src/Functions/Input/Switch/_.tsx +177 -0
  128. package/src/Functions/Input/Switch/style.module.scss +18 -0
  129. package/src/Functions/Input/Text.tsx +437 -0
  130. package/src/Functions/Input/TextArea.tsx +115 -0
  131. package/src/Functions/Input/Time/Picker.tsx +950 -0
  132. package/src/Functions/Input/Time/_.tsx +736 -0
  133. package/src/Functions/Input/Time/style.module.scss +72 -0
  134. package/src/Functions/Input/_.tsx +793 -0
  135. package/src/Functions/Input/core.tsx +461 -0
  136. package/src/Functions/Input/style.module.scss +43 -0
  137. package/src/Functions/Inputs/_.tsx +5 -0
  138. package/src/Functions/Inputs/style.module.scss +15 -0
  139. package/src/Functions/Inputs/text.tsx +67 -0
  140. package/src/Functions/Inputs/types.d.ts +1 -0
  141. package/src/Functions/Layout/PageNotFound.tsx +81 -0
  142. package/src/Functions/Layout/PageRouter.tsx +107 -0
  143. package/src/Functions/Layout/PageViewController/parts.tsx +32 -0
  144. package/src/Functions/Layout/Plate.tsx +30 -0
  145. package/src/Functions/Layout/RootViewController/parts.tsx +290 -0
  146. package/src/Functions/Layout/RootViewController/style.module.scss +24 -0
  147. package/src/Functions/Layout/SwipeView/parts.tsx +380 -0
  148. package/src/Functions/Layout/SwipeView/style.module.scss +19 -0
  149. package/src/Functions/Layout/TabBar.tsx +64 -0
  150. package/src/Functions/Layout/_.tsx +20 -0
  151. package/src/Functions/Loader/corner.tsx +78 -0
  152. package/src/Functions/Loader/mini.tsx +117 -0
  153. package/src/Functions/Loader/parts.tsx +105 -0
  154. package/src/Functions/Loader/style.module.scss +222 -0
  155. package/src/Functions/Loader/top.tsx +90 -0
  156. package/src/Functions/Sheet/parts.tsx +972 -0
  157. package/src/Functions/Sheet/style.module.scss +235 -0
  158. package/src/Functions/SnackBar/parts.tsx +215 -0
  159. package/src/Functions/SnackBar/style.module.scss +25 -0
  160. package/src/Functions/Table/Data/parts.tsx +955 -0
  161. package/src/Functions/Table/Drag/parts.tsx +448 -0
  162. package/src/Functions/Table/Normal/parts.tsx +123 -0
  163. package/src/Functions/Table/_.tsx +170 -0
  164. package/src/Functions/Table/style.module.scss +92 -0
  165. package/src/Functions/Tooltips/parts.tsx +52 -0
  166. package/src/Global/@export.tsx +138 -0
  167. package/src/Global/LaunchReactApplication.tsx +30 -0
  168. package/src/Global/exe.tsx +0 -0
  169. package/src/Global/styleConverter.tsx +435 -0
  170. package/src/Molecules/@export.tsx +95 -0
  171. package/src/Molecules/Accordion/parts.tsx +146 -0
  172. package/src/Molecules/Accordion/style.module.scss +13 -0
  173. package/src/Molecules/LinkifyText/parts.tsx +54 -0
  174. package/src/Molecules/List.tsx +30 -0
  175. package/src/Organisms/@export.tsx +5 -0
  176. package/src/Organisms/DisplayStyleInput/_.tsx +18 -0
  177. package/src/Organisms/DisplayStyleInput/darkmode.tsx +112 -0
  178. package/src/Organisms/DisplayStyleInput/themeColor.tsx +210 -0
  179. package/src/Templates/@export.tsx +7 -0
  180. package/src/Templates/PlayGround/parts.tsx +115 -0
  181. package/src/Templates/PlayGround/style.module.scss +38 -0
  182. package/src/config.tsx +132 -0
  183. package/src/launch.tsx +100 -0
  184. package/src/preload.tsx +49 -0
  185. package/tsconfig.json +27 -14
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import * as ReactDom from 'react-dom';
3
+ import * as ReactRouterDom from 'react-router-dom';
4
+ import { LaunchReactApplication } from './LaunchReactApplication';
5
+ declare const useStore: amotify.glob.useStoreParams;
6
+ declare const useRecycle: amotify.glob.useRecycleParams;
7
+ declare const pageTransit: amotify.glob.PageTransitParams;
8
+ declare const StyleConverter: {
9
+ ReadStyleSet: amotify.glob.StyleConverter.ReadStyleSet;
10
+ ToClassName: amotify.glob.StyleConverter.ToClassName;
11
+ };
12
+ export { React, ReactDom, ReactRouterDom, pageTransit, useStore, useRecycle, StyleConverter, LaunchReactApplication };
@@ -0,0 +1 @@
1
+ export declare const LaunchReactApplication: amotify.glob.LaunchReactApplicationParams;
@@ -0,0 +1,2 @@
1
+ export declare const ReadStyleSet: amotify.glob.StyleConverter.ReadStyleSet;
2
+ export declare const ToClassName: amotify.glob.StyleConverter.ToClassName;
@@ -0,0 +1,21 @@
1
+ import { List } from './List';
2
+ import { Accordion } from './Accordion/parts';
3
+ import { LinkifyText } from './LinkifyText/parts';
4
+ declare const Text: {
5
+ Title: (params: amotify.atoms.BoxInput) => JSX.Element;
6
+ SubTitle: (params: amotify.atoms.BoxInput) => JSX.Element;
7
+ ThirdTitle: (params: amotify.atoms.BoxInput) => JSX.Element;
8
+ Paragraph: (params: amotify.atoms.BoxInput) => JSX.Element;
9
+ Normal: (params: amotify.atoms.BoxInput) => JSX.Element;
10
+ Description: (params: amotify.atoms.BoxInput) => JSX.Element;
11
+ Supplement: (params: amotify.atoms.BoxInput) => JSX.Element;
12
+ NowrapSpan: (params: amotify.atoms.SpanProps) => JSX.Element;
13
+ };
14
+ declare const Row: {
15
+ Center: (params: amotify.atoms.FlexProps) => JSX.Element;
16
+ Left: (params: amotify.atoms.FlexProps) => JSX.Element;
17
+ Right: (params: amotify.atoms.FlexProps) => JSX.Element;
18
+ Separate: (params: amotify.atoms.FlexProps) => JSX.Element;
19
+ };
20
+ declare const Column: (params: amotify.atoms.FlexProps) => JSX.Element;
21
+ export { List, Accordion, LinkifyText, Text, Column, Row };
@@ -0,0 +1,2 @@
1
+ declare const Accordion: amotify.mols.Accordion.SetParams;
2
+ export { Accordion };
@@ -0,0 +1 @@
1
+ export declare const LinkifyText: FNC<amotify.mols.LinkifyTextProps>;
@@ -0,0 +1 @@
1
+ export declare const List: FNC<amotify.mols.List.Params>;
@@ -0,0 +1,2 @@
1
+ import { DisplayStyleInput } from './DisplayStyleInput/_';
2
+ export { DisplayStyleInput };
@@ -0,0 +1 @@
1
+ export declare const DisplayStyleInput: amotify.orgs.DisplayStyleInput.Methods;
@@ -0,0 +1 @@
1
+ export declare const Darkmode: (params: amotify.orgs.DisplayStyleInput.DarkmodeInput) => JSX.Element;
@@ -0,0 +1,27 @@
1
+ export declare const Colors: {
2
+ Basics: ({
3
+ key: string;
4
+ icon: JSX.Element;
5
+ } | {
6
+ key: string;
7
+ icon: string;
8
+ })[];
9
+ Brands: {
10
+ key: string;
11
+ icon: JSX.Element;
12
+ label: string;
13
+ }[];
14
+ Originals: ({
15
+ key: string;
16
+ icon: string;
17
+ label?: undefined;
18
+ } | {
19
+ key: string;
20
+ icon: string;
21
+ label: string;
22
+ })[];
23
+ };
24
+ export declare const ThemeColorALL: FNC<amotify.orgs.DisplayStyleInput.ThemeColorInput>;
25
+ export declare const ThemeColorBasic: FNC<amotify.orgs.DisplayStyleInput.ThemeColorInput>;
26
+ export declare const ThemeColorOriginal: FNC<amotify.orgs.DisplayStyleInput.ThemeColorInput>;
27
+ export declare const ThemeColorBrands: FNC<amotify.orgs.DisplayStyleInput.ThemeColorInput>;
@@ -0,0 +1,2 @@
1
+ import { PlayGround } from './PlayGround/parts';
2
+ export { PlayGround };
@@ -0,0 +1 @@
1
+ export declare const PlayGround: FNC<{}>;
@@ -0,0 +1,16 @@
1
+ export declare const script: HTMLOrSVGScriptElement | null;
2
+ export declare const fileName: string | null | undefined;
3
+ export declare const Version: string;
4
+ export declare const userAgent: string;
5
+ export declare const deviceType: string;
6
+ export declare const deviceIdentifier: () => {
7
+ isWhat: "Windows";
8
+ isTouchDevice: boolean;
9
+ isPhone: boolean;
10
+ isIOS: boolean;
11
+ isSystemDarkmode: () => boolean;
12
+ isBreakpoint: () => boolean;
13
+ isPhonepoint: () => boolean;
14
+ };
15
+ export declare const SetThemeColorTag: () => void;
16
+ export declare const defaultConfig: amotify.config.Methods;
@@ -0,0 +1,9 @@
1
+ import 'jsmin-front/dist/@types';
2
+ import './@types/_';
3
+ declare let publicURI: string;
4
+ export { publicURI };
5
+ import './@jsminAmotifyExtension/_';
6
+ declare const amotify: amotify;
7
+ export { amotify };
8
+ import './@styles/@app.scss';
9
+ import './preload';
@@ -0,0 +1 @@
1
+ declare let tags: Jsmin.CreateElement.Args[];
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "amotify",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "UI Component for React",
5
5
  "main": "dist/launch.js",
6
6
  "types": "dist/@types.d.ts",
7
7
  "scripts": {
8
- "clean-cdn": "rimraf cdn",
8
+ "clean-cdn": "rimraf public",
9
9
  "clean-dist": "rimraf dist",
10
10
  "devCDN:webpack": "webpack --mode development --watch",
11
11
  "devCDN:server": "nodemon app.js --ignore public --ignore package.json --ignore src --ignore webpack.config.js --ignore tsconfig.json",
@@ -0,0 +1,4 @@
1
+ import './variables';
2
+ import './fetch';
3
+ import './formCollect';
4
+ import './spreadSheet';
@@ -0,0 +1,107 @@
1
+ const fetcher = async ( params: JsminExtension.Fetch.Input & {
2
+ method: string
3
+ },callback?: JsminExtension.Fetch.callback ) => {
4
+ let {
5
+ method,
6
+ key = $.uuidGen( 16 ),
7
+ url = '',
8
+ trafficControl = 500,
9
+ // trafficControl = 1000,
10
+ preventMultiRequest = true,
11
+ topLoader = false,
12
+ cornerLoader = true,
13
+ ...Params
14
+ } = params || {}
15
+
16
+ let result: Jsmin.Fetch.Output = await ( async () => {
17
+ let exist = $.fetch.waitList.includes( key );
18
+
19
+ if ( preventMultiRequest && exist ) {
20
+ return {
21
+ ok: false,
22
+ status: 405,
23
+ statusText: 'NoAcceptedMultiRequests',
24
+ body: 'NoAcceptedMultiRequests',
25
+ requestTime: 0,
26
+ rawData: null as any
27
+ }
28
+ }
29
+
30
+ $.fetch.waitList = [ ...$.fetch.waitList,key ];
31
+
32
+ if ( !url.match( /https?:/ ) ) {
33
+ url = '/' + url.replace( /^\//,"" );
34
+
35
+ Params.headers = {
36
+ ...$.fetch.defaultHeaders || {},
37
+ ...Params.headers || {}
38
+ }
39
+ }
40
+
41
+ amotify.fn.Loader.fn.mini.active( params.key || '' );
42
+ !topLoader || amotify.fn.Loader.fn.top.active();
43
+ !cornerLoader || amotify.fn.Loader.fn.corner.active();
44
+
45
+ let result = await $.ajax( {
46
+ method,
47
+ url,
48
+ ...Params
49
+ } );
50
+ if ( $.fetch.defaultResultCallback ) $.fetch.defaultResultCallback( result );
51
+
52
+ if ( trafficControl ) {
53
+ let { requestTime } = result;
54
+ if ( requestTime <= trafficControl ) {
55
+ let CoolDownTime = Number( trafficControl - requestTime );
56
+ await ( () => {
57
+ result.requestTime = trafficControl;
58
+ return new Promise( ( resolve,reject ) => {
59
+ setTimeout( () => {
60
+ resolve( void 0 );
61
+ },CoolDownTime );
62
+ } );
63
+ } )();
64
+ }
65
+ }
66
+
67
+ amotify.fn.Loader.fn.mini.stop( params.key || '' );
68
+ !topLoader || amotify.fn.Loader.fn.top.stop();
69
+ !cornerLoader || amotify.fn.Loader.fn.corner.stop();
70
+ $.fetch.waitList.splice( $.fetch.waitList.findIndex( ( a ) => a == key ),1 );
71
+ return result;
72
+ } )();
73
+
74
+ if ( callback ) callback( result );
75
+ return result;
76
+ }
77
+
78
+ $.fetch = {
79
+ get: async ( params,callback ) => {
80
+ return await fetcher( { ...params,method: 'get' },callback );
81
+ },
82
+ post: async ( params,callback ) => {
83
+ return await fetcher( { ...params,method: 'post' },callback );
84
+ },
85
+ options: async ( params,callback ) => {
86
+ return await fetcher( { ...params,method: 'options' },callback );
87
+ },
88
+ put: async ( params,callback ) => {
89
+ return await fetcher( { ...params,method: 'put' },callback );
90
+ },
91
+ waitList: [],
92
+ defaultHeaders: {},
93
+ defaultResultCallback: ( result ) => {
94
+ let {
95
+ status,
96
+ statusText
97
+ } = result;
98
+ if ( status == 500 ) {
99
+ $.NoticeHttpStatus( {
100
+ status,statusText,
101
+ label: <>
102
+ Internal Server Error
103
+ </>
104
+ } );
105
+ }
106
+ }
107
+ }
@@ -0,0 +1,89 @@
1
+ import {
2
+ useStore
3
+ } from '@global';
4
+
5
+ let formProcess = false;
6
+ $.formCollect = async ( form ) => {
7
+ if ( formProcess ) return {
8
+ valid: false,
9
+ data: {}
10
+ }
11
+
12
+ let focusElement: HTMLElement = document.activeElement as any;
13
+ if ( focusElement ) focusElement.blur();
14
+
15
+ formProcess = true;
16
+ let Inputs = $( `[data-form="${ form }"]` ),
17
+ totalValid = 1,
18
+ Values: plainObject = {}
19
+
20
+ for ( let index = 0; index < Inputs.length; index++ ) {
21
+ let Input = Inputs[ index ];
22
+
23
+ let { componentId = '' } = Input.dataset;
24
+ let componentData = useStore.get( componentId );
25
+
26
+ if ( componentData && componentData.Refresh ) await componentData.Refresh();
27
+
28
+ let {
29
+ value: displayValue,
30
+ name,
31
+ checked,
32
+ dataset: {
33
+ value,
34
+ inputType = '',
35
+ validation
36
+ }
37
+ } = Inputs[ index ] as any;
38
+ let Value: any = value;
39
+
40
+ validation = Number( ( validation ?? 'true' ) == 'true' );
41
+
42
+ if ( inputType == 'hidden' ) {
43
+ if ( Value ) Value = JSON.parse( Value );
44
+ } else if ( [ 'radio','checkbox','checker' ].includes( inputType ) ) {
45
+ if ( Value ) {
46
+ Value = JSON.parse( Value );
47
+ if ( $.is.array( Value ) ) {
48
+ Value = Value.map( ( v ) => JSON.parse( v ) )
49
+ } else {
50
+ Value = JSON.parse( Value );
51
+ }
52
+ if ( inputType == 'radio' ) {
53
+ Value = Value[ 0 ];
54
+ }
55
+ if ( inputType == 'checker' ) {
56
+ Value = Boolean( Value[ 0 ] );
57
+ }
58
+ }
59
+ } else if ( [ 'chips-single','chips-multi' ].includes( inputType ) ) {
60
+ Value = JSON.parse( Value );
61
+ if ( Value.length ) {
62
+ if ( inputType == 'chips-single' ) Value = Value[ 0 ];
63
+ }
64
+ } else if ( inputType == 'time' ) {
65
+ if ( Value ) Value = JSON.parse( Value );
66
+ } else if ( inputType == 'select' ) {
67
+ if ( Value ) Value = JSON.parse( Value );
68
+ } else if ( inputType == 'file' ) {
69
+ if ( componentData ) {
70
+ let files = componentData.Files;
71
+ Value = files;
72
+ }
73
+ } else if ( inputType == 'slider' ) {
74
+ if ( Value ) Value = JSON.parse( Value );
75
+ } else if ( inputType == 'switch' ) {
76
+ Value = checked | 0;
77
+ }
78
+ let valid = ( validation ?? 1 ) | 0;
79
+ totalValid &= valid;
80
+
81
+ if ( validation ) Values[ name ] = Value;
82
+ }
83
+
84
+ formProcess = false;
85
+ return {
86
+ valid: Boolean( totalValid ),
87
+ data: Values
88
+ };
89
+ }
@@ -0,0 +1,159 @@
1
+ export { }
2
+ import { publicURI } from '../launch';
3
+
4
+ declare global {
5
+ var ExcelJS: any;
6
+ }
7
+ {
8
+ const D: JsminExtension.SpreadSheet.Instance = ( wb,fn ) => {
9
+ return new ( D.fn as any ).SpreadSheet( wb,fn );
10
+ }
11
+ D.fn = D.prototype = {} as any
12
+ $.extend( {
13
+ SpreadSheet: function ( workbook: JsminExtension.SpreadSheet.Method,fileName: string ) {
14
+ this.workbook = workbook;
15
+ this.fileName = fileName;
16
+ return this;
17
+ },
18
+ getWorkbook: function () {
19
+ return this.workbook;
20
+ },
21
+ updateFileName: function ( fileName: string ) {
22
+ this.fileName = fileName;
23
+ return this;
24
+ },
25
+ updateMerges: function ( merges: JsminExtension.SpreadSheet.MergeTypes[][] ) {
26
+ let json = this.toJson() as JsminExtension.SpreadSheet.JsonTypes;
27
+ json.sheets.forEach( ( sheet,index ) => {
28
+ let sheetMerges = merges[ index ];
29
+ const worksheet = this.workbook.getWorksheet( sheet.sheetName );
30
+ for ( let [ from,to ] of sheetMerges ) {
31
+ if ( from && to ) worksheet.mergeCells( from + ':' + to );
32
+ }
33
+ } );
34
+ },
35
+ updateStyles: function ( styles: JsminExtension.SpreadSheet.StyleTypes[][] ) {
36
+ let json = this.toJson() as JsminExtension.SpreadSheet.JsonTypes;
37
+ json.sheets.forEach( ( sheet,index ) => {
38
+ let sheetStyles = styles[ index ];
39
+ const worksheet = this.workbook.getWorksheet( sheet.sheetName );
40
+ for ( let style of sheetStyles ) {
41
+ let {
42
+ type,
43
+ target,
44
+ values
45
+ } = style;
46
+ let Targets = $.flatArray( target );
47
+
48
+ for ( let [ key,value ] of Object.entries( values ) )
49
+ for ( let Target of Targets )
50
+ worksheet[ 'get' + type.toCapital() ]( Target )[ key ] = value;
51
+ }
52
+ } );
53
+ },
54
+ toJson: function () {
55
+ let json: any = {
56
+ fileName: this.fileName,
57
+ sheets: []
58
+ };
59
+ this.workbook.eachSheet( ( sheet: any,id: any ) => {
60
+ let sheetJson: any = {
61
+ sheetName: sheet.name,
62
+ rows: []
63
+ };
64
+ sheet.eachRow( ( row: any,rowIndex: any ) => {
65
+ let [ emp,...values ] = row.values;
66
+ sheetJson.rows.push( values );
67
+ } );
68
+ json.sheets.push( sheetJson );
69
+ } );
70
+ return json;
71
+ },
72
+ export: async function ( fileType?: 'xlsx' | 'csv' ) {
73
+ fileType = fileType || 'xlsx';
74
+
75
+ const uint8Array = await this.workbook[ fileType ].writeBuffer();
76
+ const blob = new Blob( [ uint8Array ],{ type: 'application/octet-binary' } );
77
+ const dummyAnchor = document.createElement( 'a' );
78
+ dummyAnchor.href = ( window.URL || window.webkitURL ).createObjectURL( blob );
79
+ dummyAnchor.download = this.fileName + '.' + fileType;
80
+ dummyAnchor.click();
81
+ dummyAnchor.remove();
82
+ },
83
+ },D );
84
+
85
+ ( D.fn as any ).SpreadSheet.prototype = D.fn;
86
+ ( D.fn as any ).SpreadSheet.prototype.constructor = D;
87
+
88
+ $.spreadSheet = {
89
+ readFromFile: async ( file ) => {
90
+ if ( !window.ExcelJS ) {
91
+ await amotify.config.readExtraCDN( publicURI + '@env/@foreign/exceljs.min.js' );
92
+ }
93
+ if ( !window.ExcelJS ) return;
94
+
95
+ const workbook = new ExcelJS.Workbook();
96
+ let readFile = await file.read( 'binaryString' );
97
+ const buffer = ( readFile as any ).target.result;
98
+ let fileName = file.name.replace( /\.[^/.]+$/,'' );
99
+ return D( await workbook.xlsx.load( buffer ),fileName );
100
+ },
101
+ readFromJson: async ( params ) => {
102
+ if ( !window.ExcelJS ) {
103
+ await amotify.config.readExtraCDN( publicURI + '@env/@foreign/exceljs.min.js' );
104
+ }
105
+ if ( !window.ExcelJS ) return;
106
+
107
+ let {
108
+ sheets,
109
+ fileName = ''
110
+ } = params;
111
+ fileName = fileName || $.uuidGen();
112
+
113
+ const workbook = new ExcelJS.Workbook();
114
+
115
+ sheets.forEach( ( sheet,index ) => {
116
+ let {
117
+ sheetName,
118
+ headers = [],
119
+ rows,
120
+ merges = [],
121
+ styles = []
122
+ } = sheet;
123
+ sheetName = sheetName || 'シート' + ( index + 1 );
124
+
125
+ workbook.addWorksheet( sheetName );
126
+ const worksheet = workbook.getWorksheet( sheetName );
127
+
128
+ let Headers = headers.map( ( header,index ) => {
129
+ let { key,value } = header;
130
+ return {
131
+ key: key,
132
+ header: value
133
+ }
134
+ } );
135
+
136
+ worksheet.columns = Headers;
137
+ worksheet.addRows( rows );
138
+
139
+ for ( let [ from,to ] of merges ) {
140
+ if ( from && to ) worksheet.mergeCells( from + ':' + to );
141
+ }
142
+ for ( let style of styles ) {
143
+ let {
144
+ type,
145
+ target,
146
+ values
147
+ } = style;
148
+ let Targets = $.flatArray( target );
149
+
150
+ for ( let [ key,value ] of Object.entries( values ) )
151
+ for ( let Target of Targets )
152
+ worksheet[ 'get' + type.toCapital() ]( Target )[ key ] = value;
153
+ }
154
+ } );
155
+
156
+ return D( workbook,fileName );
157
+ }
158
+ }
159
+ }
@@ -0,0 +1,130 @@
1
+ $.NoticeHttpStatus = ( params ) => {
2
+ let {
3
+ status,
4
+ statusText,
5
+ label,
6
+ ...others
7
+ } = params;
8
+
9
+ if ( status >= 400 ) {
10
+ others = {
11
+ backgroundColor: 'nega',
12
+ ...others,
13
+ }
14
+ }
15
+
16
+ amotify.fn.SnackBar.add( {
17
+ children: <amotify.atoms.Box>
18
+ <amotify.mols.Text.Paragraph>
19
+ 通信ステータス : { status } { statusText }
20
+ </amotify.mols.Text.Paragraph>
21
+ <amotify.mols.Text.Normal>
22
+ { label }
23
+ </amotify.mols.Text.Normal>
24
+ </amotify.atoms.Box>,
25
+ ...others
26
+ } );
27
+ }
28
+ $.copyToClipboard = async ( rawData ) => {
29
+ let data = '';
30
+ if ( $.is.string( rawData ) ) data = rawData
31
+ else if ( $.is.function( rawData ) ) data = rawData() as any;
32
+
33
+ let response = {
34
+ ok: false,
35
+ body: 'NotSupported'
36
+ }
37
+
38
+ await ( async () => {
39
+ let result;
40
+ if ( navigator.clipboard ) {
41
+ result = await navigator
42
+ .clipboard
43
+ .writeText( data )
44
+ .then(
45
+ () => true,
46
+ () => false
47
+ )
48
+ if ( !result ) return;
49
+ } else {
50
+ let input = document.createElement( 'input' );
51
+ $( document.body ).append( input );
52
+ input.value = data;
53
+ input.select();
54
+ result = document.execCommand( 'copy' );
55
+ document.body.removeChild( input );
56
+
57
+ if ( !result ) return;
58
+ }
59
+
60
+ amotify.fn.SnackBar.add( {
61
+ children: 'クリップボードにコピーしました'
62
+ } );
63
+ response = {
64
+ ok: true,
65
+ body: ''
66
+ };
67
+ } )();
68
+
69
+ return response;
70
+ }
71
+ $.isJSXElement = function ( v ): v is JSX.Element {
72
+ return v.$$typeof === Symbol.for( 'react.element' );
73
+ }
74
+ $.getCurrentLocation = () => {
75
+ return new Promise( ( resolve,reject ) => {
76
+ navigator.geolocation.getCurrentPosition( ( position ) => {
77
+ let {
78
+ latitude,
79
+ longitude
80
+ } = position.coords;
81
+ resolve( {
82
+ ok: true,
83
+ status: 200,
84
+ body: {
85
+ lat: latitude,
86
+ lng: longitude
87
+ }
88
+ } );
89
+ },( error ) => {
90
+ resolve( {
91
+ ok: false,
92
+ status: 500,
93
+ body: {
94
+ reason: error
95
+ }
96
+ } );
97
+ } );
98
+ } );
99
+ }
100
+ $.CDNReader = ( url ) => {
101
+ return new Promise( ( resolve,reject ) => {
102
+ let tag = document.createElement( 'script' );
103
+ tag.src = url;
104
+ tag.addEventListener( 'load',() => {
105
+ resolve( 'OK' );
106
+ } );
107
+ $( document.body ).append( tag );
108
+ } );
109
+ }
110
+ $.ImageLoader = ( dataUrl,img ) => {
111
+ return new Promise( ( resolve,reject ) => {
112
+ let Img = img ? img : new Image();
113
+ Img.onload = () => resolve( Img );
114
+ Img.onerror = ( e ) => reject( e );
115
+ Img.src = dataUrl;
116
+ } );
117
+ }
118
+ $.extend( {
119
+ zen2hanNumber: function ( this: string ) {
120
+ return this.replace( /[0-9]/g,function ( s: any ) {
121
+ return String.fromCharCode( s.charCodeAt( 0 ) - 0xFEE0 );
122
+ } )
123
+ .replace( /[--﹣−‐⁃‑‒–—﹘―⎯⏤ーー─━]/g,'-' )
124
+ .replace( /¥/,'¥' )
125
+ .replace( /、/,',' )
126
+ .replace( /(/,'(' )
127
+ .replace( /)/,')' )
128
+ .replace( /+/,'+' );
129
+ }
130
+ },String );
@@ -0,0 +1,4 @@
1
+ @use './@variables/customProps' as *;
2
+ @forward './@variables/var';
3
+ @forward './init';
4
+ @forward './UniStyling';