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.
- package/dist/src/@jsminAmotifyExtension/_.d.ts +4 -0
- package/dist/src/@jsminAmotifyExtension/fetch.d.ts +9 -0
- package/dist/src/@jsminAmotifyExtension/formCollect.d.ts +1 -0
- package/dist/src/@jsminAmotifyExtension/spreadSheet.d.ts +4 -0
- package/dist/src/@jsminAmotifyExtension/variables.d.ts +0 -0
- package/dist/src/@types/_.d.ts +6 -0
- package/dist/src/@types/amot.d.ts +260 -0
- package/dist/src/@types/fn.d.ts +1040 -0
- package/dist/src/@types/index.d.ts +62 -0
- package/dist/src/@types/jsminAmotifyExtension.d.ts +134 -0
- package/dist/src/@types/module.d.ts +2 -0
- package/dist/src/@types/state.d.ts +145 -0
- package/dist/src/Atoms/@export.d.ts +4 -0
- package/dist/src/Atoms/FAIcon/parts.d.ts +2 -0
- package/dist/src/Atoms/Logo/parts.d.ts +1 -0
- package/dist/src/Atoms/Various/parts.d.ts +9 -0
- package/dist/src/Functions/@export.d.ts +12 -0
- package/dist/src/Functions/Button/_.d.ts +1 -0
- package/dist/src/Functions/Cropper/parts.d.ts +1 -0
- package/dist/src/Functions/Effects/Fade.d.ts +1 -0
- package/dist/src/Functions/Effects/Ripple.d.ts +1 -0
- package/dist/src/Functions/Effects/_.d.ts +3 -0
- package/dist/src/Functions/Input/Chips/Selector.d.ts +1 -0
- package/dist/src/Functions/Input/Chips/_.d.ts +2 -0
- package/dist/src/Functions/Input/DigitCharacters.d.ts +1 -0
- package/dist/src/Functions/Input/File/_.d.ts +2 -0
- package/dist/src/Functions/Input/Hidden.d.ts +1 -0
- package/dist/src/Functions/Input/List/_.d.ts +1 -0
- package/dist/src/Functions/Input/Segmented/_.d.ts +1 -0
- package/dist/src/Functions/Input/Select/_.d.ts +1 -0
- package/dist/src/Functions/Input/Slider/_.d.ts +1 -0
- package/dist/src/Functions/Input/Switch/_.d.ts +1 -0
- package/dist/src/Functions/Input/Text.d.ts +5 -0
- package/dist/src/Functions/Input/TextArea.d.ts +1 -0
- package/dist/src/Functions/Input/Time/Picker.d.ts +1 -0
- package/dist/src/Functions/Input/Time/_.d.ts +2 -0
- package/dist/src/Functions/Input/_.d.ts +5 -0
- package/dist/src/Functions/Input/core.d.ts +34 -0
- package/dist/src/Functions/Inputs/_.d.ts +3 -0
- package/dist/src/Functions/Inputs/text.d.ts +12 -0
- package/dist/src/Functions/Layout/PageNotFound.d.ts +1 -0
- package/dist/src/Functions/Layout/PageRouter.d.ts +2 -0
- package/dist/src/Functions/Layout/PageViewController/parts.d.ts +1 -0
- package/dist/src/Functions/Layout/Plate.d.ts +1 -0
- package/dist/src/Functions/Layout/RootViewController/parts.d.ts +1 -0
- package/dist/src/Functions/Layout/SwipeView/parts.d.ts +2 -0
- package/dist/src/Functions/Layout/TabBar.d.ts +1 -0
- package/dist/src/Functions/Layout/_.d.ts +2 -0
- package/dist/src/Functions/Loader/corner.d.ts +1 -0
- package/dist/src/Functions/Loader/mini.d.ts +33 -0
- package/dist/src/Functions/Loader/parts.d.ts +3 -0
- package/dist/src/Functions/Loader/top.d.ts +1 -0
- package/dist/src/Functions/Sheet/parts.d.ts +2 -0
- package/dist/src/Functions/SnackBar/parts.d.ts +2 -0
- package/dist/src/Functions/Table/Data/parts.d.ts +3 -0
- package/dist/src/Functions/Table/Drag/parts.d.ts +1 -0
- package/dist/src/Functions/Table/Normal/parts.d.ts +1 -0
- package/dist/src/Functions/Table/_.d.ts +9 -0
- package/dist/src/Functions/Tooltips/parts.d.ts +2 -0
- package/dist/src/Global/@export.d.ts +12 -0
- package/dist/src/Global/LaunchReactApplication.d.ts +1 -0
- package/dist/src/Global/styleConverter.d.ts +2 -0
- package/dist/src/Molecules/@export.d.ts +21 -0
- package/dist/src/Molecules/Accordion/parts.d.ts +2 -0
- package/dist/src/Molecules/LinkifyText/parts.d.ts +1 -0
- package/dist/src/Molecules/List.d.ts +1 -0
- package/dist/src/Organisms/@export.d.ts +2 -0
- package/dist/src/Organisms/DisplayStyleInput/_.d.ts +1 -0
- package/dist/src/Organisms/DisplayStyleInput/darkmode.d.ts +1 -0
- package/dist/src/Organisms/DisplayStyleInput/themeColor.d.ts +27 -0
- package/dist/src/Templates/@export.d.ts +2 -0
- package/dist/src/Templates/PlayGround/parts.d.ts +1 -0
- package/dist/src/config.d.ts +16 -0
- package/dist/src/launch.d.ts +9 -0
- package/dist/src/preload.d.ts +1 -0
- package/package.json +2 -2
- package/src/@jsminAmotifyExtension/_.tsx +4 -0
- package/src/@jsminAmotifyExtension/fetch.tsx +107 -0
- package/src/@jsminAmotifyExtension/formCollect.tsx +89 -0
- package/src/@jsminAmotifyExtension/spreadSheet.tsx +159 -0
- package/src/@jsminAmotifyExtension/variables.tsx +130 -0
- package/src/@styles/@app.scss +4 -0
- package/src/@styles/@variables/customProps.scss +109 -0
- package/src/@styles/@variables/styleSet.scss +38 -0
- package/src/@styles/@variables/themeColor.scss +71 -0
- package/src/@styles/@variables/var.scss +171 -0
- package/src/@styles/UniStyling.scss +996 -0
- package/src/@styles/init.scss +154 -0
- package/src/@types/_.tsx +6 -0
- package/src/@types/amot.tsx +323 -0
- package/src/@types/fn.tsx +1210 -0
- package/src/@types/index.tsx +74 -0
- package/src/@types/jsminAmotifyExtension.tsx +143 -0
- package/src/@types/module.tsx +2 -0
- package/src/@types/state.tsx +199 -0
- package/src/Atoms/@export.tsx +32 -0
- package/src/Atoms/FAIcon/parts.tsx +117 -0
- package/src/Atoms/FAIcon/style.module.scss +9 -0
- package/src/Atoms/Logo/parts.tsx +335 -0
- package/src/Atoms/Logo/style.module.scss +96 -0
- package/src/Atoms/Various/parts.tsx +157 -0
- package/src/Atoms/Various/style.module.scss +40 -0
- package/src/Functions/@export.tsx +29 -0
- package/src/Functions/Button/_.tsx +305 -0
- package/src/Functions/Button/style.module.scss +183 -0
- package/src/Functions/Cropper/parts.tsx +1061 -0
- package/src/Functions/Cropper/style.module.scss +62 -0
- package/src/Functions/Effects/Fade.tsx +81 -0
- package/src/Functions/Effects/Ripple.tsx +141 -0
- package/src/Functions/Effects/_.tsx +33 -0
- package/src/Functions/Effects/style.module.scss +83 -0
- package/src/Functions/Input/Chips/Selector.tsx +451 -0
- package/src/Functions/Input/Chips/_.tsx +286 -0
- package/src/Functions/Input/Chips/style.module.scss +6 -0
- package/src/Functions/Input/DigitCharacters.tsx +241 -0
- package/src/Functions/Input/File/_.tsx +596 -0
- package/src/Functions/Input/File/style.module.scss +34 -0
- package/src/Functions/Input/Hidden.tsx +18 -0
- package/src/Functions/Input/List/_.tsx +383 -0
- package/src/Functions/Input/List/style.module.scss +84 -0
- package/src/Functions/Input/Segmented/_.tsx +238 -0
- package/src/Functions/Input/Segmented/style.module.scss +81 -0
- package/src/Functions/Input/Select/_.tsx +225 -0
- package/src/Functions/Input/Select/style.module.scss +10 -0
- package/src/Functions/Input/Slider/_.tsx +519 -0
- package/src/Functions/Input/Slider/style.module.scss +67 -0
- package/src/Functions/Input/Switch/_.tsx +177 -0
- package/src/Functions/Input/Switch/style.module.scss +18 -0
- package/src/Functions/Input/Text.tsx +437 -0
- package/src/Functions/Input/TextArea.tsx +115 -0
- package/src/Functions/Input/Time/Picker.tsx +950 -0
- package/src/Functions/Input/Time/_.tsx +736 -0
- package/src/Functions/Input/Time/style.module.scss +72 -0
- package/src/Functions/Input/_.tsx +793 -0
- package/src/Functions/Input/core.tsx +461 -0
- package/src/Functions/Input/style.module.scss +43 -0
- package/src/Functions/Inputs/_.tsx +5 -0
- package/src/Functions/Inputs/style.module.scss +15 -0
- package/src/Functions/Inputs/text.tsx +67 -0
- package/src/Functions/Inputs/types.d.ts +1 -0
- package/src/Functions/Layout/PageNotFound.tsx +81 -0
- package/src/Functions/Layout/PageRouter.tsx +107 -0
- package/src/Functions/Layout/PageViewController/parts.tsx +32 -0
- package/src/Functions/Layout/Plate.tsx +30 -0
- package/src/Functions/Layout/RootViewController/parts.tsx +290 -0
- package/src/Functions/Layout/RootViewController/style.module.scss +24 -0
- package/src/Functions/Layout/SwipeView/parts.tsx +380 -0
- package/src/Functions/Layout/SwipeView/style.module.scss +19 -0
- package/src/Functions/Layout/TabBar.tsx +64 -0
- package/src/Functions/Layout/_.tsx +20 -0
- package/src/Functions/Loader/corner.tsx +78 -0
- package/src/Functions/Loader/mini.tsx +117 -0
- package/src/Functions/Loader/parts.tsx +105 -0
- package/src/Functions/Loader/style.module.scss +222 -0
- package/src/Functions/Loader/top.tsx +90 -0
- package/src/Functions/Sheet/parts.tsx +972 -0
- package/src/Functions/Sheet/style.module.scss +235 -0
- package/src/Functions/SnackBar/parts.tsx +215 -0
- package/src/Functions/SnackBar/style.module.scss +25 -0
- package/src/Functions/Table/Data/parts.tsx +955 -0
- package/src/Functions/Table/Drag/parts.tsx +448 -0
- package/src/Functions/Table/Normal/parts.tsx +123 -0
- package/src/Functions/Table/_.tsx +170 -0
- package/src/Functions/Table/style.module.scss +92 -0
- package/src/Functions/Tooltips/parts.tsx +52 -0
- package/src/Global/@export.tsx +138 -0
- package/src/Global/LaunchReactApplication.tsx +30 -0
- package/src/Global/exe.tsx +0 -0
- package/src/Global/styleConverter.tsx +435 -0
- package/src/Molecules/@export.tsx +95 -0
- package/src/Molecules/Accordion/parts.tsx +146 -0
- package/src/Molecules/Accordion/style.module.scss +13 -0
- package/src/Molecules/LinkifyText/parts.tsx +54 -0
- package/src/Molecules/List.tsx +30 -0
- package/src/Organisms/@export.tsx +5 -0
- package/src/Organisms/DisplayStyleInput/_.tsx +18 -0
- package/src/Organisms/DisplayStyleInput/darkmode.tsx +112 -0
- package/src/Organisms/DisplayStyleInput/themeColor.tsx +210 -0
- package/src/Templates/@export.tsx +7 -0
- package/src/Templates/PlayGround/parts.tsx +115 -0
- package/src/Templates/PlayGround/style.module.scss +38 -0
- package/src/config.tsx +132 -0
- package/src/launch.tsx +100 -0
- package/src/preload.tsx +49 -0
- 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,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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
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.
|
|
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
|
|
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,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 );
|