amotify 0.0.5 → 0.0.7

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 (157) hide show
  1. package/dist/@jsminAmotifyExtension/formCollect.js +1 -1
  2. package/dist/Atoms/Logo/parts.js +1 -1
  3. package/dist/Atoms/Various/parts.js +1 -1
  4. package/dist/Functions/Button/_.js +1 -1
  5. package/dist/Functions/Cropper/parts.js +4 -4
  6. package/dist/Functions/Effects/Fade.js +2 -2
  7. package/dist/Functions/Input/Chips/Selector.js +4 -4
  8. package/dist/Functions/Input/Chips/_.js +3 -3
  9. package/dist/Functions/Input/DigitCharacters.js +3 -3
  10. package/dist/Functions/Input/File/_.js +4 -4
  11. package/dist/Functions/Input/List/_.js +3 -3
  12. package/dist/Functions/Input/Segmented/_.js +1 -1
  13. package/dist/Functions/Input/Select/_.js +2 -2
  14. package/dist/Functions/Input/Slider/_.js +3 -3
  15. package/dist/Functions/Input/Switch/_.js +4 -4
  16. package/dist/Functions/Input/Text.js +2 -2
  17. package/dist/Functions/Input/TextArea.js +1 -1
  18. package/dist/Functions/Input/Time/Picker.js +4 -4
  19. package/dist/Functions/Input/Time/_.js +3 -3
  20. package/dist/Functions/Input/_.js +4 -4
  21. package/dist/Functions/Input/core.js +4 -4
  22. package/dist/Functions/Inputs/text.js +1 -1
  23. package/dist/Functions/Layout/PageNotFound.js +3 -3
  24. package/dist/Functions/Layout/PageRouter.js +2 -2
  25. package/dist/Functions/Layout/PageViewController/parts.js +2 -2
  26. package/dist/Functions/Layout/Plate.js +1 -1
  27. package/dist/Functions/Layout/RootViewController/parts.js +4 -4
  28. package/dist/Functions/Layout/SwipeView/parts.js +2 -2
  29. package/dist/Functions/Layout/TabBar.js +3 -3
  30. package/dist/Functions/Loader/corner.js +2 -2
  31. package/dist/Functions/Loader/mini.js +2 -2
  32. package/dist/Functions/Loader/parts.js +1 -1
  33. package/dist/Functions/Loader/top.js +2 -2
  34. package/dist/Functions/Sheet/parts.js +4 -4
  35. package/dist/Functions/SnackBar/parts.js +4 -4
  36. package/dist/Functions/Table/Data/parts.js +4 -4
  37. package/dist/Functions/Table/Drag/parts.js +3 -3
  38. package/dist/Functions/Table/_.js +2 -2
  39. package/dist/Functions/Tooltips/parts.js +2 -2
  40. package/dist/Molecules/@export.js +1 -1
  41. package/dist/Molecules/Accordion/parts.js +2 -2
  42. package/dist/Molecules/LinkifyText/parts.js +2 -2
  43. package/dist/Molecules/List.js +1 -1
  44. package/dist/Organisms/DisplayStyleInput/darkmode.js +4 -4
  45. package/dist/Organisms/DisplayStyleInput/themeColor.js +4 -4
  46. package/dist/Templates/PlayGround/parts.js +5 -5
  47. package/dist/launch.js +6 -6
  48. package/package.json +6 -5
  49. package/src/@jsminAmotifyExtension/_.tsx +4 -0
  50. package/src/@jsminAmotifyExtension/fetch.tsx +107 -0
  51. package/src/@jsminAmotifyExtension/formCollect.tsx +89 -0
  52. package/src/@jsminAmotifyExtension/spreadSheet.tsx +159 -0
  53. package/src/@jsminAmotifyExtension/variables.tsx +130 -0
  54. package/src/@styles/@app.scss +4 -0
  55. package/src/@styles/@variables/customProps.scss +109 -0
  56. package/src/@styles/@variables/styleSet.scss +38 -0
  57. package/src/@styles/@variables/themeColor.scss +71 -0
  58. package/src/@styles/@variables/var.scss +171 -0
  59. package/src/@styles/UniStyling.scss +996 -0
  60. package/src/@styles/init.scss +154 -0
  61. package/src/@types/_.tsx +6 -0
  62. package/src/@types/amot.tsx +323 -0
  63. package/src/@types/fn.tsx +1210 -0
  64. package/src/@types/index.tsx +74 -0
  65. package/src/@types/jsminAmotifyExtension.tsx +143 -0
  66. package/src/@types/module.tsx +2 -0
  67. package/src/@types/state.tsx +199 -0
  68. package/src/Atoms/@export.tsx +32 -0
  69. package/src/Atoms/FAIcon/parts.tsx +117 -0
  70. package/src/Atoms/FAIcon/style.module.scss +9 -0
  71. package/src/Atoms/Logo/parts.tsx +335 -0
  72. package/src/Atoms/Logo/style.module.scss +96 -0
  73. package/src/Atoms/Various/parts.tsx +157 -0
  74. package/src/Atoms/Various/style.module.scss +40 -0
  75. package/src/Functions/@export.tsx +29 -0
  76. package/src/Functions/Button/_.tsx +305 -0
  77. package/src/Functions/Button/style.module.scss +183 -0
  78. package/src/Functions/Cropper/parts.tsx +1061 -0
  79. package/src/Functions/Cropper/style.module.scss +62 -0
  80. package/src/Functions/Effects/Fade.tsx +81 -0
  81. package/src/Functions/Effects/Ripple.tsx +141 -0
  82. package/src/Functions/Effects/_.tsx +33 -0
  83. package/src/Functions/Effects/style.module.scss +83 -0
  84. package/src/Functions/Input/Chips/Selector.tsx +451 -0
  85. package/src/Functions/Input/Chips/_.tsx +286 -0
  86. package/src/Functions/Input/Chips/style.module.scss +6 -0
  87. package/src/Functions/Input/DigitCharacters.tsx +241 -0
  88. package/src/Functions/Input/File/_.tsx +596 -0
  89. package/src/Functions/Input/File/style.module.scss +34 -0
  90. package/src/Functions/Input/Hidden.tsx +18 -0
  91. package/src/Functions/Input/List/_.tsx +383 -0
  92. package/src/Functions/Input/List/style.module.scss +84 -0
  93. package/src/Functions/Input/Segmented/_.tsx +238 -0
  94. package/src/Functions/Input/Segmented/style.module.scss +81 -0
  95. package/src/Functions/Input/Select/_.tsx +225 -0
  96. package/src/Functions/Input/Select/style.module.scss +10 -0
  97. package/src/Functions/Input/Slider/_.tsx +519 -0
  98. package/src/Functions/Input/Slider/style.module.scss +67 -0
  99. package/src/Functions/Input/Switch/_.tsx +177 -0
  100. package/src/Functions/Input/Switch/style.module.scss +18 -0
  101. package/src/Functions/Input/Text.tsx +437 -0
  102. package/src/Functions/Input/TextArea.tsx +115 -0
  103. package/src/Functions/Input/Time/Picker.tsx +950 -0
  104. package/src/Functions/Input/Time/_.tsx +736 -0
  105. package/src/Functions/Input/Time/style.module.scss +72 -0
  106. package/src/Functions/Input/_.tsx +793 -0
  107. package/src/Functions/Input/core.tsx +461 -0
  108. package/src/Functions/Input/style.module.scss +43 -0
  109. package/src/Functions/Inputs/_.tsx +5 -0
  110. package/src/Functions/Inputs/style.module.scss +15 -0
  111. package/src/Functions/Inputs/text.tsx +67 -0
  112. package/src/Functions/Inputs/types.d.ts +1 -0
  113. package/src/Functions/Layout/PageNotFound.tsx +81 -0
  114. package/src/Functions/Layout/PageRouter.tsx +107 -0
  115. package/src/Functions/Layout/PageViewController/parts.tsx +32 -0
  116. package/src/Functions/Layout/Plate.tsx +30 -0
  117. package/src/Functions/Layout/RootViewController/parts.tsx +290 -0
  118. package/src/Functions/Layout/RootViewController/style.module.scss +24 -0
  119. package/src/Functions/Layout/SwipeView/parts.tsx +380 -0
  120. package/src/Functions/Layout/SwipeView/style.module.scss +19 -0
  121. package/src/Functions/Layout/TabBar.tsx +64 -0
  122. package/src/Functions/Layout/_.tsx +20 -0
  123. package/src/Functions/Loader/corner.tsx +78 -0
  124. package/src/Functions/Loader/mini.tsx +117 -0
  125. package/src/Functions/Loader/parts.tsx +105 -0
  126. package/src/Functions/Loader/style.module.scss +222 -0
  127. package/src/Functions/Loader/top.tsx +90 -0
  128. package/src/Functions/Sheet/parts.tsx +972 -0
  129. package/src/Functions/Sheet/style.module.scss +235 -0
  130. package/src/Functions/SnackBar/parts.tsx +215 -0
  131. package/src/Functions/SnackBar/style.module.scss +25 -0
  132. package/src/Functions/Table/Data/parts.tsx +955 -0
  133. package/src/Functions/Table/Drag/parts.tsx +448 -0
  134. package/src/Functions/Table/Normal/parts.tsx +123 -0
  135. package/src/Functions/Table/_.tsx +170 -0
  136. package/src/Functions/Table/style.module.scss +92 -0
  137. package/src/Functions/Tooltips/parts.tsx +52 -0
  138. package/src/Global/@export.tsx +138 -0
  139. package/src/Global/LaunchReactApplication.tsx +30 -0
  140. package/src/Global/exe.tsx +0 -0
  141. package/src/Global/styleConverter.tsx +435 -0
  142. package/src/Molecules/@export.tsx +95 -0
  143. package/src/Molecules/Accordion/parts.tsx +146 -0
  144. package/src/Molecules/Accordion/style.module.scss +13 -0
  145. package/src/Molecules/LinkifyText/parts.tsx +54 -0
  146. package/src/Molecules/List.tsx +30 -0
  147. package/src/Organisms/@export.tsx +5 -0
  148. package/src/Organisms/DisplayStyleInput/_.tsx +18 -0
  149. package/src/Organisms/DisplayStyleInput/darkmode.tsx +112 -0
  150. package/src/Organisms/DisplayStyleInput/themeColor.tsx +210 -0
  151. package/src/Templates/@export.tsx +7 -0
  152. package/src/Templates/PlayGround/parts.tsx +115 -0
  153. package/src/Templates/PlayGround/style.module.scss +38 -0
  154. package/src/config.tsx +132 -0
  155. package/src/launch.tsx +100 -0
  156. package/src/preload.tsx +49 -0
  157. package/webpack.config.js +114 -0
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PlayGround = void 0;
4
- var _global_1 = require("@global");
4
+ var _global_1 = require("../../Global/@export");
5
5
  var useEffect = _global_1.React.useEffect, useState = _global_1.React.useState;
6
- var _atoms_1 = require("@atoms");
7
- var _mols_1 = require("@mols");
8
- var _orgs_1 = require("@orgs");
9
- var _functions_1 = require("@functions");
6
+ var _atoms_1 = require("../../Atoms/@export");
7
+ var _mols_1 = require("../../Molecules/@export");
8
+ var _orgs_1 = require("../../Organisms/@export");
9
+ var _functions_1 = require("../../Functions/@export");
10
10
  var PlayGround = function () {
11
11
  return (_global_1.React.createElement(_global_1.React.Fragment, null,
12
12
  _global_1.React.createElement(_mols_1.Column, { gap: 2 },
package/dist/launch.js CHANGED
@@ -8,12 +8,12 @@ require("./@types/_");
8
8
  var publicURI = 'https://public.comun.jp/';
9
9
  exports.publicURI = publicURI;
10
10
  require("./@jsminAmotifyExtension/_");
11
- var _global_1 = require("@global");
12
- var _atoms_1 = require("@atoms");
13
- var _mols_1 = require("@mols");
14
- var _orgs_1 = require("@orgs");
15
- var _temps_1 = require("@temps");
16
- var _functions_1 = require("@functions");
11
+ var _global_1 = require("./Global/@export");
12
+ var _atoms_1 = require("./Atoms/@export");
13
+ var _mols_1 = require("./Molecules/@export");
14
+ var _orgs_1 = require("./Organisms/@export");
15
+ var _temps_1 = require("./Templates/@export");
16
+ var _functions_1 = require("./Functions/@export");
17
17
  var config_1 = require("./config");
18
18
  var amotify = {
19
19
  config: config_1.defaultConfig,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "amotify",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "description": "UI Component for React",
5
5
  "main": "dist/launch.js",
6
6
  "types": "dist/@types.d.ts",
@@ -41,6 +41,7 @@
41
41
  "@types/google.maps": "^3.50.0",
42
42
  "@types/react": "^18.0.5",
43
43
  "@types/react-dom": "^18.0.5",
44
+ "@types/react-router": "^5.1.20",
44
45
  "@types/react-router-dom": "^5.3.3",
45
46
  "babel-loader": "^8.2.3",
46
47
  "babel-preset-preact": "^2.0.0",
@@ -49,17 +50,17 @@
49
50
  "dotenv": "^16.0.3",
50
51
  "express": "^4.17.2",
51
52
  "jsmin-front": "^0.0.5",
53
+ "mini-css-extract-plugin": "^2.7.6",
52
54
  "npm-run-all": "^4.1.5",
53
55
  "prop-types": "^15.8.1",
54
56
  "sass": "^1.49.8",
55
57
  "sass-loader": "^12.6.0",
56
58
  "terser-webpack-plugin": "^5.3.1",
57
59
  "ts-loader": "^9.2.8",
60
+ "tsc-alias": "^1.8.8",
58
61
  "webpack": "^5.69.1",
59
62
  "webpack-bundle-analyzer": "^4.5.0",
60
63
  "webpack-cli": "^4.9.2",
61
- "webpack-remove-empty-scripts": "^0.7.3",
62
- "@types/react-router": "^5.1.20",
63
- "mini-css-extract-plugin": "^2.7.6"
64
+ "webpack-remove-empty-scripts": "^0.7.3"
64
65
  }
65
- }
66
+ }
@@ -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';
@@ -0,0 +1,109 @@
1
+ $color-theme: hsl(var(--color-theme-hsl));
2
+ $color-theme-opacity-high : hsla(var(--color-theme-hsl), var(--color-theme-opacity-high));
3
+ $color-theme-opacity-middle : hsla(var(--color-theme-hsl), var(--color-theme-opacity-middle));
4
+ $color-theme-opacity-low : hsla(var(--color-theme-hsl), var(--color-theme-opacity-low));
5
+ $color-theme-opacity-few : hsla(var(--color-theme-hsl), var(--color-theme-opacity-few));
6
+ @function cAlfa($a) {
7
+ @return hsla(var(--color-theme-hsl), $a );
8
+ }
9
+ $color-theme-lightest : hsl(var(--cH), calc(var(--cS)*1.3), calc(var(--cL) * 1.4));
10
+ $color-theme-lighter : hsl(var(--cH), calc(var(--cS)*1.2), calc(var(--cL) * 1.25));
11
+ $color-theme-lighten : hsl(var(--cH), calc(var(--cS)*1.1), calc(var(--cL) * 1.1));
12
+ $color-theme-darken : hsl(var(--cH), calc(var(--cS)*.9), calc(var(--cL) * 0.9));
13
+ $color-theme-darker : hsl(var(--cH), calc(var(--cS)*.8), calc(var(--cL) * 0.75));
14
+ $color-theme-darkest : hsl(var(--cH), calc(var(--cS)*.7), calc(var(--cL) * 0.6));
15
+ //
16
+ $color-positive : rgba(var(--color-positive-rgb), 1);
17
+ $color-negative : rgba(var(--color-negative-rgb), 1);
18
+ $color-warning : rgba(var(--color-warning-rgb), 1);
19
+ $color-dark : rgba(var(--color-dark-rgb), 1);
20
+ $color-base: rgba(var(--color-base-rgb), 1);
21
+ $color-cloud : rgba(var(--color-cloud-rgb), 1);
22
+ $color-monoPrime : rgba(var(--color-monoPrime-rgb));
23
+ $color-monoSecond : rgba(var(--color-monoSecond-rgb));
24
+ //
25
+ $color-layer1: hsl(var(--color-layer1-hsl));
26
+ $color-layer2: hsl(var(--color-layer2-hsl));
27
+ $color-layer3: hsl(var(--color-layer3-hsl));
28
+ $color-layer4: hsl(var(--color-layer4-hsl));
29
+ $color-layer5: hsl(var(--color-layer5-hsl));
30
+ $color-layer6: hsl(var(--color-layer6-hsl));
31
+ //
32
+ $color-layer-opacity-high : hsla(var(--color-layer4-hsl), .6);
33
+ $color-layer-opacity-middle : hsla(var(--color-layer4-hsl), .4);
34
+ $color-layer-opacity-low : hsla(var(--color-layer4-hsl), .3);
35
+ $color-layer-opacity-few : hsla(var(--color-layer4-hsl), .15);
36
+ // border ish
37
+ $border-thin : 1px solid var(--border-color-thin);
38
+ $border-normal : 1px solid var(--border-color-normal);
39
+ // borderRadius
40
+ $border-radius1 : var(--border-radius1);
41
+ $border-radius1_6 : calc($border-radius1 * 1 / 6);
42
+ $border-radius1_3 : calc($border-radius1 * 1 / 3);
43
+ $border-radius2_3 : calc($border-radius1 * 2 / 3);
44
+ $border-radius2 : var(--border-radius2);
45
+ $border-radius3 : var(--border-radius3);
46
+ $border-radius4 : var(--border-radius4);
47
+ $border-radius5 : var(--border-radius5);
48
+ $border-radius6 : var(--border-radius6);
49
+ $border-radius7 : var(--border-radius7);
50
+ // fontColor
51
+ $font-color1 : rgb(var(--font-color1-rgb));
52
+ $font-color2 : rgb(var(--font-color2-rgb));
53
+ $font-color3 : rgb(var(--font-color3-rgb));
54
+ $font-color4 : rgb(var(--font-color4-rgb));
55
+ $font-color5 : rgb(var(--font-color5-rgb));
56
+ $font-color6 : rgb(var(--font-color6-rgb));
57
+ $font-color-logoTitle : var(--font-color-logoTitle);
58
+ // fontSize
59
+ $font-size0 : var(--font-size0);
60
+ $font-size1 : var(--font-size1);
61
+ $font-size2 : var(--font-size2);
62
+ $font-size3 : var(--font-size3);
63
+ $font-size4 : var(--font-size4);
64
+ $font-size5 : var(--font-size5);
65
+ $font-size6 : var(--font-size6);
66
+ $font-size7 : var(--font-size7);
67
+ $font-size8 : var(--font-size8);
68
+ //
69
+ $shadow-color : var(--sc);
70
+ $shadow0 : 0px 1px 2px 0px rgba(var(--sc), .05);
71
+ $shadow1 : 0px 1px 2px 0px rgba(var(--sc), .3);
72
+ $shadow2 : 0px 2px 4px 0px rgba(var(--sc), .25);
73
+ $shadow3 : 1px 6px 12px rgba(var(--sc), .2);
74
+ $shadow4 : 1rem 1.5rem 3rem rgba(var(--sc), .21);
75
+ $animation-time-short : var(--animation-time1);
76
+ $animation-time-middle : var(--animation-time2);
77
+ $animation-time-long : var(--animation-time3);
78
+ $animation-time-veryLong : var(--animation-time4);
79
+ $animation-style1 : var(--animation-style1);
80
+ $animation-style2 : var(--animation-style2);
81
+ //
82
+ $unit1 : var(--grid-unit);
83
+ $unit1_12 : calc($unit1 * 1 / 12);
84
+ $unit1_6 : calc($unit1 * 1 / 6);
85
+ $unit1_4 : calc($unit1 * 1 / 4);
86
+ $unit1_3 : calc($unit1 * 1 / 3);
87
+ $unit1_2 : calc($unit1 * 1 / 2);
88
+ $unit2_3 : calc($unit1 * 2 / 3);
89
+ $unit3_4 : calc($unit1 * 3 / 4);
90
+ $unit1-5 : calc($unit1 * 3 / 2);
91
+ $unit2 : calc($unit1 * 2);
92
+ $unit2-5 : calc($unit1 * 2.5);
93
+ $unit3 : calc($unit1 * 3);
94
+ $unit3-5 : calc($unit1 * 3.5);
95
+ $unit4 : calc($unit1 * 4);
96
+ $unit6 : calc($unit1 * 6);
97
+ $unit8 : calc($unit1 * 8);
98
+ $unit10 : calc($unit1 * 10);
99
+ $unit12 : calc($unit1 * 12);
100
+ //
101
+ $safe-area-top : var(--safe-area-top);
102
+ $safe-area-bottom : var(--safe-area-bottom);
103
+ $viewHeight : var(--viewHeight);
104
+ $topNavigationHeight : var(--topNavHeight);
105
+ $sideNavigationHeight : var(--sideNavHeight);
106
+ $footerNavigationHeight: var(--footerNavHeight);
107
+ $topBase: var(--topBase);
108
+ $contentHeight : var(--contentHeight);
109
+ $breakPoint : 834px;