amotify 0.0.7 → 0.0.9
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/@types/_.d.ts → @types/_.tsx} +3 -3
- package/{src/@types → @types}/amot.tsx +0 -1
- package/{src/@types → @types}/fn.tsx +1 -2
- package/{src/@types → @types}/index.tsx +1 -5
- package/{src/@types → @types}/jsminAmotifyExtension.tsx +1 -2
- package/dist/amotify.js +1 -0
- package/{public → dist}/amotify.min.css +22 -22
- package/package.json +4 -9
- package/src/{Atoms/@export.tsx → @atoms.tsx} +3 -3
- package/src/@functions.tsx +29 -0
- package/src/{Global/@export.tsx → @global.tsx} +2 -2
- package/src/{Molecules/@export.tsx → @molecules.tsx} +3 -3
- package/src/@organisms.tsx +5 -0
- package/src/@styles/@app.scss +2 -2
- package/src/@styles/UniStyling.scss +3 -3
- package/src/@styles/init.scss +1 -1
- package/src/@styles/{@variables/styleSet.scss → styleSet.scss} +1 -1
- package/src/{Templates/@export.tsx → @templates.tsx} +1 -1
- package/src/{Atoms → atoms}/FAIcon/style.module.scss +1 -2
- package/src/{Atoms → atoms}/Logo/parts.tsx +0 -1
- package/src/{Atoms → atoms}/Logo/style.module.scss +1 -2
- package/src/{Atoms → atoms}/Various/style.module.scss +2 -1
- package/src/{Functions → functions}/Button/style.module.scss +2 -1
- package/src/{Functions → functions}/Cropper/parts.tsx +1 -1
- package/src/{Functions → functions}/Cropper/style.module.scss +1 -1
- package/src/{Functions → functions}/Effects/style.module.scss +1 -1
- package/src/{Functions → functions}/Input/Chips/Selector.tsx +1 -2
- package/src/{Functions → functions}/Input/Chips/_.tsx +1 -5
- package/src/{Functions → functions}/Input/Chips/style.module.scss +1 -1
- package/src/{Functions → functions}/Input/DigitCharacters.tsx +1 -1
- package/src/{Functions → functions}/Input/File/_.tsx +1 -1
- package/src/{Functions → functions}/Input/File/style.module.scss +1 -1
- package/src/{Functions → functions}/Input/List/_.tsx +1 -1
- package/src/{Functions → functions}/Input/List/style.module.scss +1 -1
- package/src/{Functions → functions}/Input/Segmented/style.module.scss +1 -1
- package/src/{Functions → functions}/Input/Select/_.tsx +1 -1
- package/src/{Functions → functions}/Input/Select/style.module.scss +1 -1
- package/src/{Functions → functions}/Input/Slider/_.tsx +1 -1
- package/src/{Functions → functions}/Input/Slider/style.module.scss +1 -1
- package/src/{Functions → functions}/Input/Switch/_.tsx +1 -1
- package/src/{Functions → functions}/Input/Switch/style.module.scss +1 -1
- package/src/{Functions → functions}/Input/Time/Picker.tsx +1 -1
- package/src/{Functions → functions}/Input/Time/_.tsx +2 -2
- package/src/{Functions → functions}/Input/Time/style.module.scss +1 -1
- package/src/{Functions → functions}/Input/_.tsx +1 -1
- package/src/{Functions → functions}/Input/core.tsx +1 -1
- package/src/{Functions → functions}/Input/style.module.scss +1 -1
- package/src/{Functions → functions}/Inputs/style.module.scss +1 -1
- package/src/{Functions → functions}/Inputs/text.tsx +3 -16
- package/src/functions/Inputs/types.d.ts +13 -0
- package/src/{Functions → functions}/Layout/PageNotFound.tsx +2 -4
- package/src/{Functions → functions}/Layout/PageRouter.tsx +1 -1
- package/src/{Functions → functions}/Layout/PageViewController/parts.tsx +3 -1
- package/src/{Functions → functions}/Layout/RootViewController/parts.tsx +3 -5
- package/src/{Functions → functions}/Layout/RootViewController/style.module.scss +1 -1
- package/src/{Functions → functions}/Layout/SwipeView/parts.tsx +0 -1
- package/src/{Functions → functions}/Layout/SwipeView/style.module.scss +1 -1
- package/src/{Functions → functions}/Layout/TabBar.tsx +1 -1
- package/src/{Functions → functions}/Loader/style.module.scss +1 -1
- package/src/{Functions → functions}/Sheet/parts.tsx +1 -1
- package/src/{Functions → functions}/Sheet/style.module.scss +1 -1
- package/src/{Functions → functions}/SnackBar/parts.tsx +1 -1
- package/src/{Functions → functions}/SnackBar/style.module.scss +1 -1
- package/src/{Functions → functions}/Table/Data/parts.tsx +1 -1
- package/src/{Functions → functions}/Table/Drag/parts.tsx +1 -1
- package/src/{Functions → functions}/Table/Normal/parts.tsx +1 -2
- package/src/{Functions → functions}/Table/_.tsx +1 -2
- package/src/{Functions → functions}/Table/style.module.scss +2 -1
- package/src/{Functions → functions}/Tooltips/parts.tsx +1 -1
- package/src/{Global → global}/styleConverter.tsx +1 -5
- package/src/launch.tsx +5 -5
- package/src/{Molecules → molecules}/Accordion/style.module.scss +1 -1
- package/src/{Molecules → molecules}/LinkifyText/parts.tsx +1 -1
- package/src/{Organisms → organisms}/DisplayStyleInput/darkmode.tsx +1 -1
- package/src/{Organisms → organisms}/DisplayStyleInput/themeColor.tsx +1 -1
- package/src/{Templates → templates}/PlayGround/parts.tsx +26 -39
- package/src/{Templates → templates}/PlayGround/style.module.scss +1 -1
- package/tsconfig.json +20 -24
- package/webpack.config.js +11 -9
- package/dist/@jsminAmotifyExtension/_.d.ts +0 -4
- package/dist/@jsminAmotifyExtension/_.js +0 -6
- package/dist/@jsminAmotifyExtension/fetch.d.ts +0 -9
- package/dist/@jsminAmotifyExtension/fetch.js +0 -199
- package/dist/@jsminAmotifyExtension/formCollect.d.ts +0 -1
- package/dist/@jsminAmotifyExtension/formCollect.js +0 -137
- package/dist/@jsminAmotifyExtension/spreadSheet.d.ts +0 -4
- package/dist/@jsminAmotifyExtension/spreadSheet.js +0 -314
- package/dist/@jsminAmotifyExtension/variables.d.ts +0 -0
- package/dist/@jsminAmotifyExtension/variables.js +0 -186
- package/dist/@types/_.js +0 -8
- package/dist/@types/amot.d.ts +0 -260
- package/dist/@types/amot.js +0 -2
- package/dist/@types/fn.d.ts +0 -1040
- package/dist/@types/fn.js +0 -2
- package/dist/@types/index.d.ts +0 -62
- package/dist/@types/index.js +0 -2
- package/dist/@types/jsminAmotifyExtension.d.ts +0 -134
- package/dist/@types/jsminAmotifyExtension.js +0 -2
- package/dist/@types/module.d.ts +0 -2
- package/dist/@types/module.js +0 -1
- package/dist/@types/state.d.ts +0 -145
- package/dist/@types/state.js +0 -2
- package/dist/Atoms/@export.d.ts +0 -4
- package/dist/Atoms/@export.js +0 -16
- package/dist/Atoms/FAIcon/parts.d.ts +0 -2
- package/dist/Atoms/FAIcon/parts.js +0 -152
- package/dist/Atoms/Logo/parts.d.ts +0 -1
- package/dist/Atoms/Logo/parts.js +0 -154
- package/dist/Atoms/Various/parts.d.ts +0 -9
- package/dist/Atoms/Various/parts.js +0 -113
- package/dist/Functions/@export.d.ts +0 -12
- package/dist/Functions/@export.js +0 -25
- package/dist/Functions/Button/_.d.ts +0 -1
- package/dist/Functions/Button/_.js +0 -270
- package/dist/Functions/Cropper/parts.d.ts +0 -1
- package/dist/Functions/Cropper/parts.js +0 -783
- package/dist/Functions/Effects/Fade.d.ts +0 -1
- package/dist/Functions/Effects/Fade.js +0 -82
- package/dist/Functions/Effects/Ripple.d.ts +0 -1
- package/dist/Functions/Effects/Ripple.js +0 -107
- package/dist/Functions/Effects/_.d.ts +0 -3
- package/dist/Functions/Effects/_.js +0 -43
- package/dist/Functions/Input/Chips/Selector.d.ts +0 -1
- package/dist/Functions/Input/Chips/Selector.js +0 -356
- package/dist/Functions/Input/Chips/_.d.ts +0 -2
- package/dist/Functions/Input/Chips/_.js +0 -218
- package/dist/Functions/Input/DigitCharacters.d.ts +0 -1
- package/dist/Functions/Input/DigitCharacters.js +0 -178
- package/dist/Functions/Input/File/_.d.ts +0 -2
- package/dist/Functions/Input/File/_.js +0 -458
- package/dist/Functions/Input/Hidden.d.ts +0 -1
- package/dist/Functions/Input/Hidden.js +0 -30
- package/dist/Functions/Input/List/_.d.ts +0 -1
- package/dist/Functions/Input/List/_.js +0 -232
- package/dist/Functions/Input/Segmented/_.d.ts +0 -1
- package/dist/Functions/Input/Segmented/_.js +0 -111
- package/dist/Functions/Input/Select/_.d.ts +0 -1
- package/dist/Functions/Input/Select/_.js +0 -154
- package/dist/Functions/Input/Slider/_.d.ts +0 -1
- package/dist/Functions/Input/Slider/_.js +0 -308
- package/dist/Functions/Input/Switch/_.d.ts +0 -1
- package/dist/Functions/Input/Switch/_.js +0 -120
- package/dist/Functions/Input/Text.d.ts +0 -5
- package/dist/Functions/Input/Text.js +0 -340
- package/dist/Functions/Input/TextArea.d.ts +0 -1
- package/dist/Functions/Input/TextArea.js +0 -98
- package/dist/Functions/Input/Time/Picker.d.ts +0 -1
- package/dist/Functions/Input/Time/Picker.js +0 -581
- package/dist/Functions/Input/Time/_.d.ts +0 -2
- package/dist/Functions/Input/Time/_.js +0 -567
- package/dist/Functions/Input/_.d.ts +0 -5
- package/dist/Functions/Input/_.js +0 -446
- package/dist/Functions/Input/core.d.ts +0 -34
- package/dist/Functions/Input/core.js +0 -324
- package/dist/Functions/Inputs/_.d.ts +0 -3
- package/dist/Functions/Inputs/_.js +0 -7
- package/dist/Functions/Inputs/text.d.ts +0 -12
- package/dist/Functions/Inputs/text.js +0 -46
- package/dist/Functions/Layout/PageNotFound.d.ts +0 -1
- package/dist/Functions/Layout/PageNotFound.js +0 -30
- package/dist/Functions/Layout/PageRouter.d.ts +0 -2
- package/dist/Functions/Layout/PageRouter.js +0 -65
- package/dist/Functions/Layout/PageViewController/parts.d.ts +0 -1
- package/dist/Functions/Layout/PageViewController/parts.js +0 -31
- package/dist/Functions/Layout/Plate.d.ts +0 -1
- package/dist/Functions/Layout/Plate.js +0 -39
- package/dist/Functions/Layout/RootViewController/parts.d.ts +0 -1
- package/dist/Functions/Layout/RootViewController/parts.js +0 -202
- package/dist/Functions/Layout/SwipeView/parts.d.ts +0 -2
- package/dist/Functions/Layout/SwipeView/parts.js +0 -319
- package/dist/Functions/Layout/TabBar.d.ts +0 -1
- package/dist/Functions/Layout/TabBar.js +0 -49
- package/dist/Functions/Layout/_.d.ts +0 -2
- package/dist/Functions/Layout/_.js +0 -20
- package/dist/Functions/Loader/corner.d.ts +0 -1
- package/dist/Functions/Loader/corner.js +0 -59
- package/dist/Functions/Loader/mini.d.ts +0 -33
- package/dist/Functions/Loader/mini.js +0 -126
- package/dist/Functions/Loader/parts.d.ts +0 -3
- package/dist/Functions/Loader/parts.js +0 -108
- package/dist/Functions/Loader/top.d.ts +0 -1
- package/dist/Functions/Loader/top.js +0 -69
- package/dist/Functions/Sheet/parts.d.ts +0 -2
- package/dist/Functions/Sheet/parts.js +0 -724
- package/dist/Functions/SnackBar/parts.d.ts +0 -2
- package/dist/Functions/SnackBar/parts.js +0 -171
- package/dist/Functions/Table/Data/parts.d.ts +0 -3
- package/dist/Functions/Table/Data/parts.js +0 -629
- package/dist/Functions/Table/Drag/parts.d.ts +0 -1
- package/dist/Functions/Table/Drag/parts.js +0 -359
- package/dist/Functions/Table/Normal/parts.d.ts +0 -1
- package/dist/Functions/Table/Normal/parts.js +0 -92
- package/dist/Functions/Table/_.d.ts +0 -9
- package/dist/Functions/Table/_.js +0 -153
- package/dist/Functions/Tooltips/parts.d.ts +0 -2
- package/dist/Functions/Tooltips/parts.js +0 -71
- package/dist/Global/@export.d.ts +0 -12
- package/dist/Global/@export.js +0 -198
- package/dist/Global/LaunchReactApplication.d.ts +0 -1
- package/dist/Global/LaunchReactApplication.js +0 -48
- package/dist/Global/styleConverter.d.ts +0 -2
- package/dist/Global/styleConverter.js +0 -349
- package/dist/Molecules/@export.d.ts +0 -21
- package/dist/Molecules/@export.js +0 -41
- package/dist/Molecules/Accordion/parts.d.ts +0 -2
- package/dist/Molecules/Accordion/parts.js +0 -165
- package/dist/Molecules/LinkifyText/parts.d.ts +0 -1
- package/dist/Molecules/LinkifyText/parts.js +0 -39
- package/dist/Molecules/List.d.ts +0 -1
- package/dist/Molecules/List.js +0 -35
- package/dist/Organisms/@export.d.ts +0 -2
- package/dist/Organisms/@export.js +0 -5
- package/dist/Organisms/DisplayStyleInput/_.d.ts +0 -1
- package/dist/Organisms/DisplayStyleInput/_.js +0 -15
- package/dist/Organisms/DisplayStyleInput/darkmode.d.ts +0 -1
- package/dist/Organisms/DisplayStyleInput/darkmode.js +0 -77
- package/dist/Organisms/DisplayStyleInput/themeColor.d.ts +0 -27
- package/dist/Organisms/DisplayStyleInput/themeColor.js +0 -185
- package/dist/Templates/@export.d.ts +0 -2
- package/dist/Templates/@export.js +0 -5
- package/dist/Templates/PlayGround/parts.d.ts +0 -1
- package/dist/Templates/PlayGround/parts.js +0 -55
- package/dist/config.d.ts +0 -16
- package/dist/config.js +0 -171
- package/dist/launch.d.ts +0 -9
- package/dist/launch.js +0 -46
- package/dist/preload.d.ts +0 -1
- package/dist/preload.js +0 -73
- package/public/amotify.js +0 -1
- package/src/@types/_.tsx +0 -6
- package/src/Functions/@export.tsx +0 -29
- package/src/Functions/Inputs/types.d.ts +0 -1
- package/src/Global/exe.tsx +0 -0
- package/src/Organisms/@export.tsx +0 -5
- /package/{src/@types → @types}/module.tsx +0 -0
- /package/{src/@types → @types}/state.tsx +0 -0
- /package/src/@styles/{@variables/customProps.scss → props.scss} +0 -0
- /package/src/@styles/{@variables/themeColor.scss → themeColor.scss} +0 -0
- /package/src/@styles/{@variables/var.scss → var.scss} +0 -0
- /package/src/{Atoms → atoms}/FAIcon/parts.tsx +0 -0
- /package/src/{Atoms → atoms}/Various/parts.tsx +0 -0
- /package/src/{Functions → functions}/Button/_.tsx +0 -0
- /package/src/{Functions → functions}/Effects/Fade.tsx +0 -0
- /package/src/{Functions → functions}/Effects/Ripple.tsx +0 -0
- /package/src/{Functions → functions}/Effects/_.tsx +0 -0
- /package/src/{Functions → functions}/Input/Hidden.tsx +0 -0
- /package/src/{Functions → functions}/Input/Segmented/_.tsx +0 -0
- /package/src/{Functions → functions}/Input/Text.tsx +0 -0
- /package/src/{Functions → functions}/Input/TextArea.tsx +0 -0
- /package/src/{Functions → functions}/Inputs/_.tsx +0 -0
- /package/src/{Functions → functions}/Layout/Plate.tsx +0 -0
- /package/src/{Functions → functions}/Layout/_.tsx +0 -0
- /package/src/{Functions → functions}/Loader/corner.tsx +0 -0
- /package/src/{Functions → functions}/Loader/mini.tsx +0 -0
- /package/src/{Functions → functions}/Loader/parts.tsx +0 -0
- /package/src/{Functions → functions}/Loader/top.tsx +0 -0
- /package/src/{Global → global}/LaunchReactApplication.tsx +0 -0
- /package/src/{Molecules → molecules}/Accordion/parts.tsx +0 -0
- /package/src/{Molecules → molecules}/List.tsx +0 -0
- /package/src/{Organisms → organisms}/DisplayStyleInput/_.tsx +0 -0
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
var _global_1 = require("../Global/@export");
|
|
40
|
-
var formProcess = false;
|
|
41
|
-
$.formCollect = function (form) { return __awaiter(void 0, void 0, void 0, function () {
|
|
42
|
-
var focusElement, Inputs, totalValid, Values, index, Input, _a, componentId, componentData, _b, displayValue, name_1, checked, _c, value, _d, inputType, validation, Value, files, valid;
|
|
43
|
-
return __generator(this, function (_e) {
|
|
44
|
-
switch (_e.label) {
|
|
45
|
-
case 0:
|
|
46
|
-
if (formProcess)
|
|
47
|
-
return [2 /*return*/, {
|
|
48
|
-
valid: false,
|
|
49
|
-
data: {}
|
|
50
|
-
}];
|
|
51
|
-
focusElement = document.activeElement;
|
|
52
|
-
if (focusElement)
|
|
53
|
-
focusElement.blur();
|
|
54
|
-
formProcess = true;
|
|
55
|
-
Inputs = $("[data-form=\"".concat(form, "\"]")), totalValid = 1, Values = {};
|
|
56
|
-
index = 0;
|
|
57
|
-
_e.label = 1;
|
|
58
|
-
case 1:
|
|
59
|
-
if (!(index < Inputs.length)) return [3 /*break*/, 5];
|
|
60
|
-
Input = Inputs[index];
|
|
61
|
-
_a = Input.dataset.componentId, componentId = _a === void 0 ? '' : _a;
|
|
62
|
-
componentData = _global_1.useStore.get(componentId);
|
|
63
|
-
if (!(componentData && componentData.Refresh)) return [3 /*break*/, 3];
|
|
64
|
-
return [4 /*yield*/, componentData.Refresh()];
|
|
65
|
-
case 2:
|
|
66
|
-
_e.sent();
|
|
67
|
-
_e.label = 3;
|
|
68
|
-
case 3:
|
|
69
|
-
_b = Inputs[index], displayValue = _b.value, name_1 = _b.name, checked = _b.checked, _c = _b.dataset, value = _c.value, _d = _c.inputType, inputType = _d === void 0 ? '' : _d, validation = _c.validation;
|
|
70
|
-
Value = value;
|
|
71
|
-
validation = Number((validation !== null && validation !== void 0 ? validation : 'true') == 'true');
|
|
72
|
-
if (inputType == 'hidden') {
|
|
73
|
-
if (Value)
|
|
74
|
-
Value = JSON.parse(Value);
|
|
75
|
-
}
|
|
76
|
-
else if (['radio', 'checkbox', 'checker'].includes(inputType)) {
|
|
77
|
-
if (Value) {
|
|
78
|
-
Value = JSON.parse(Value);
|
|
79
|
-
if ($.is.array(Value)) {
|
|
80
|
-
Value = Value.map(function (v) { return JSON.parse(v); });
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
Value = JSON.parse(Value);
|
|
84
|
-
}
|
|
85
|
-
if (inputType == 'radio') {
|
|
86
|
-
Value = Value[0];
|
|
87
|
-
}
|
|
88
|
-
if (inputType == 'checker') {
|
|
89
|
-
Value = Boolean(Value[0]);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
else if (['chips-single', 'chips-multi'].includes(inputType)) {
|
|
94
|
-
Value = JSON.parse(Value);
|
|
95
|
-
if (Value.length) {
|
|
96
|
-
if (inputType == 'chips-single')
|
|
97
|
-
Value = Value[0];
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
else if (inputType == 'time') {
|
|
101
|
-
if (Value)
|
|
102
|
-
Value = JSON.parse(Value);
|
|
103
|
-
}
|
|
104
|
-
else if (inputType == 'select') {
|
|
105
|
-
if (Value)
|
|
106
|
-
Value = JSON.parse(Value);
|
|
107
|
-
}
|
|
108
|
-
else if (inputType == 'file') {
|
|
109
|
-
if (componentData) {
|
|
110
|
-
files = componentData.Files;
|
|
111
|
-
Value = files;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
else if (inputType == 'slider') {
|
|
115
|
-
if (Value)
|
|
116
|
-
Value = JSON.parse(Value);
|
|
117
|
-
}
|
|
118
|
-
else if (inputType == 'switch') {
|
|
119
|
-
Value = checked | 0;
|
|
120
|
-
}
|
|
121
|
-
valid = (validation !== null && validation !== void 0 ? validation : 1) | 0;
|
|
122
|
-
totalValid &= valid;
|
|
123
|
-
if (validation)
|
|
124
|
-
Values[name_1] = Value;
|
|
125
|
-
_e.label = 4;
|
|
126
|
-
case 4:
|
|
127
|
-
index++;
|
|
128
|
-
return [3 /*break*/, 1];
|
|
129
|
-
case 5:
|
|
130
|
-
formProcess = false;
|
|
131
|
-
return [2 /*return*/, {
|
|
132
|
-
valid: Boolean(totalValid),
|
|
133
|
-
data: Values
|
|
134
|
-
}];
|
|
135
|
-
}
|
|
136
|
-
});
|
|
137
|
-
}); };
|
|
@@ -1,314 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
var __values = (this && this.__values) || function(o) {
|
|
39
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
40
|
-
if (m) return m.call(o);
|
|
41
|
-
if (o && typeof o.length === "number") return {
|
|
42
|
-
next: function () {
|
|
43
|
-
if (o && i >= o.length) o = void 0;
|
|
44
|
-
return { value: o && o[i++], done: !o };
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
48
|
-
};
|
|
49
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
50
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
51
|
-
if (!m) return o;
|
|
52
|
-
var i = m.call(o), r, ar = [], e;
|
|
53
|
-
try {
|
|
54
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
55
|
-
}
|
|
56
|
-
catch (error) { e = { error: error }; }
|
|
57
|
-
finally {
|
|
58
|
-
try {
|
|
59
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
60
|
-
}
|
|
61
|
-
finally { if (e) throw e.error; }
|
|
62
|
-
}
|
|
63
|
-
return ar;
|
|
64
|
-
};
|
|
65
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
66
|
-
var launch_1 = require("../launch");
|
|
67
|
-
{
|
|
68
|
-
var D_1 = function (wb, fn) {
|
|
69
|
-
return new D_1.fn.SpreadSheet(wb, fn);
|
|
70
|
-
};
|
|
71
|
-
D_1.fn = D_1.prototype = {};
|
|
72
|
-
$.extend({
|
|
73
|
-
SpreadSheet: function (workbook, fileName) {
|
|
74
|
-
this.workbook = workbook;
|
|
75
|
-
this.fileName = fileName;
|
|
76
|
-
return this;
|
|
77
|
-
},
|
|
78
|
-
getWorkbook: function () {
|
|
79
|
-
return this.workbook;
|
|
80
|
-
},
|
|
81
|
-
updateFileName: function (fileName) {
|
|
82
|
-
this.fileName = fileName;
|
|
83
|
-
return this;
|
|
84
|
-
},
|
|
85
|
-
updateMerges: function (merges) {
|
|
86
|
-
var _this = this;
|
|
87
|
-
var json = this.toJson();
|
|
88
|
-
json.sheets.forEach(function (sheet, index) {
|
|
89
|
-
var e_1, _a;
|
|
90
|
-
var sheetMerges = merges[index];
|
|
91
|
-
var worksheet = _this.workbook.getWorksheet(sheet.sheetName);
|
|
92
|
-
try {
|
|
93
|
-
for (var sheetMerges_1 = __values(sheetMerges), sheetMerges_1_1 = sheetMerges_1.next(); !sheetMerges_1_1.done; sheetMerges_1_1 = sheetMerges_1.next()) {
|
|
94
|
-
var _b = __read(sheetMerges_1_1.value, 2), from = _b[0], to = _b[1];
|
|
95
|
-
if (from && to)
|
|
96
|
-
worksheet.mergeCells(from + ':' + to);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
100
|
-
finally {
|
|
101
|
-
try {
|
|
102
|
-
if (sheetMerges_1_1 && !sheetMerges_1_1.done && (_a = sheetMerges_1.return)) _a.call(sheetMerges_1);
|
|
103
|
-
}
|
|
104
|
-
finally { if (e_1) throw e_1.error; }
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
},
|
|
108
|
-
updateStyles: function (styles) {
|
|
109
|
-
var _this = this;
|
|
110
|
-
var json = this.toJson();
|
|
111
|
-
json.sheets.forEach(function (sheet, index) {
|
|
112
|
-
var e_2, _a, e_3, _b, e_4, _c;
|
|
113
|
-
var sheetStyles = styles[index];
|
|
114
|
-
var worksheet = _this.workbook.getWorksheet(sheet.sheetName);
|
|
115
|
-
try {
|
|
116
|
-
for (var sheetStyles_1 = __values(sheetStyles), sheetStyles_1_1 = sheetStyles_1.next(); !sheetStyles_1_1.done; sheetStyles_1_1 = sheetStyles_1.next()) {
|
|
117
|
-
var style = sheetStyles_1_1.value;
|
|
118
|
-
var type = style.type, target = style.target, values = style.values;
|
|
119
|
-
var Targets = $.flatArray(target);
|
|
120
|
-
try {
|
|
121
|
-
for (var _d = (e_3 = void 0, __values(Object.entries(values))), _e = _d.next(); !_e.done; _e = _d.next()) {
|
|
122
|
-
var _f = __read(_e.value, 2), key = _f[0], value = _f[1];
|
|
123
|
-
try {
|
|
124
|
-
for (var Targets_1 = (e_4 = void 0, __values(Targets)), Targets_1_1 = Targets_1.next(); !Targets_1_1.done; Targets_1_1 = Targets_1.next()) {
|
|
125
|
-
var Target = Targets_1_1.value;
|
|
126
|
-
worksheet['get' + type.toCapital()](Target)[key] = value;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
130
|
-
finally {
|
|
131
|
-
try {
|
|
132
|
-
if (Targets_1_1 && !Targets_1_1.done && (_c = Targets_1.return)) _c.call(Targets_1);
|
|
133
|
-
}
|
|
134
|
-
finally { if (e_4) throw e_4.error; }
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
139
|
-
finally {
|
|
140
|
-
try {
|
|
141
|
-
if (_e && !_e.done && (_b = _d.return)) _b.call(_d);
|
|
142
|
-
}
|
|
143
|
-
finally { if (e_3) throw e_3.error; }
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
148
|
-
finally {
|
|
149
|
-
try {
|
|
150
|
-
if (sheetStyles_1_1 && !sheetStyles_1_1.done && (_a = sheetStyles_1.return)) _a.call(sheetStyles_1);
|
|
151
|
-
}
|
|
152
|
-
finally { if (e_2) throw e_2.error; }
|
|
153
|
-
}
|
|
154
|
-
});
|
|
155
|
-
},
|
|
156
|
-
toJson: function () {
|
|
157
|
-
var json = {
|
|
158
|
-
fileName: this.fileName,
|
|
159
|
-
sheets: []
|
|
160
|
-
};
|
|
161
|
-
this.workbook.eachSheet(function (sheet, id) {
|
|
162
|
-
var sheetJson = {
|
|
163
|
-
sheetName: sheet.name,
|
|
164
|
-
rows: []
|
|
165
|
-
};
|
|
166
|
-
sheet.eachRow(function (row, rowIndex) {
|
|
167
|
-
var _a = __read(row.values), emp = _a[0], values = _a.slice(1);
|
|
168
|
-
sheetJson.rows.push(values);
|
|
169
|
-
});
|
|
170
|
-
json.sheets.push(sheetJson);
|
|
171
|
-
});
|
|
172
|
-
return json;
|
|
173
|
-
},
|
|
174
|
-
export: function (fileType) {
|
|
175
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
176
|
-
var uint8Array, blob, dummyAnchor;
|
|
177
|
-
return __generator(this, function (_a) {
|
|
178
|
-
switch (_a.label) {
|
|
179
|
-
case 0:
|
|
180
|
-
fileType = fileType || 'xlsx';
|
|
181
|
-
return [4 /*yield*/, this.workbook[fileType].writeBuffer()];
|
|
182
|
-
case 1:
|
|
183
|
-
uint8Array = _a.sent();
|
|
184
|
-
blob = new Blob([uint8Array], { type: 'application/octet-binary' });
|
|
185
|
-
dummyAnchor = document.createElement('a');
|
|
186
|
-
dummyAnchor.href = (window.URL || window.webkitURL).createObjectURL(blob);
|
|
187
|
-
dummyAnchor.download = this.fileName + '.' + fileType;
|
|
188
|
-
dummyAnchor.click();
|
|
189
|
-
dummyAnchor.remove();
|
|
190
|
-
return [2 /*return*/];
|
|
191
|
-
}
|
|
192
|
-
});
|
|
193
|
-
});
|
|
194
|
-
},
|
|
195
|
-
}, D_1);
|
|
196
|
-
D_1.fn.SpreadSheet.prototype = D_1.fn;
|
|
197
|
-
D_1.fn.SpreadSheet.prototype.constructor = D_1;
|
|
198
|
-
$.spreadSheet = {
|
|
199
|
-
readFromFile: function (file) { return __awaiter(void 0, void 0, void 0, function () {
|
|
200
|
-
var workbook, readFile, buffer, fileName, _a;
|
|
201
|
-
return __generator(this, function (_b) {
|
|
202
|
-
switch (_b.label) {
|
|
203
|
-
case 0:
|
|
204
|
-
if (!!window.ExcelJS) return [3 /*break*/, 2];
|
|
205
|
-
return [4 /*yield*/, amotify.config.readExtraCDN(launch_1.publicURI + '@env/@foreign/exceljs.min.js')];
|
|
206
|
-
case 1:
|
|
207
|
-
_b.sent();
|
|
208
|
-
_b.label = 2;
|
|
209
|
-
case 2:
|
|
210
|
-
if (!window.ExcelJS)
|
|
211
|
-
return [2 /*return*/];
|
|
212
|
-
workbook = new ExcelJS.Workbook();
|
|
213
|
-
return [4 /*yield*/, file.read('binaryString')];
|
|
214
|
-
case 3:
|
|
215
|
-
readFile = _b.sent();
|
|
216
|
-
buffer = readFile.target.result;
|
|
217
|
-
fileName = file.name.replace(/\.[^/.]+$/, '');
|
|
218
|
-
_a = D_1;
|
|
219
|
-
return [4 /*yield*/, workbook.xlsx.load(buffer)];
|
|
220
|
-
case 4: return [2 /*return*/, _a.apply(void 0, [_b.sent(), fileName])];
|
|
221
|
-
}
|
|
222
|
-
});
|
|
223
|
-
}); },
|
|
224
|
-
readFromJson: function (params) { return __awaiter(void 0, void 0, void 0, function () {
|
|
225
|
-
var sheets, _a, fileName, workbook;
|
|
226
|
-
return __generator(this, function (_b) {
|
|
227
|
-
switch (_b.label) {
|
|
228
|
-
case 0:
|
|
229
|
-
if (!!window.ExcelJS) return [3 /*break*/, 2];
|
|
230
|
-
return [4 /*yield*/, amotify.config.readExtraCDN(launch_1.publicURI + '@env/@foreign/exceljs.min.js')];
|
|
231
|
-
case 1:
|
|
232
|
-
_b.sent();
|
|
233
|
-
_b.label = 2;
|
|
234
|
-
case 2:
|
|
235
|
-
if (!window.ExcelJS)
|
|
236
|
-
return [2 /*return*/];
|
|
237
|
-
sheets = params.sheets, _a = params.fileName, fileName = _a === void 0 ? '' : _a;
|
|
238
|
-
fileName = fileName || $.uuidGen();
|
|
239
|
-
workbook = new ExcelJS.Workbook();
|
|
240
|
-
sheets.forEach(function (sheet, index) {
|
|
241
|
-
var e_5, _a, e_6, _b, e_7, _c, e_8, _d;
|
|
242
|
-
var sheetName = sheet.sheetName, _e = sheet.headers, headers = _e === void 0 ? [] : _e, rows = sheet.rows, _f = sheet.merges, merges = _f === void 0 ? [] : _f, _g = sheet.styles, styles = _g === void 0 ? [] : _g;
|
|
243
|
-
sheetName = sheetName || 'シート' + (index + 1);
|
|
244
|
-
workbook.addWorksheet(sheetName);
|
|
245
|
-
var worksheet = workbook.getWorksheet(sheetName);
|
|
246
|
-
var Headers = headers.map(function (header, index) {
|
|
247
|
-
var key = header.key, value = header.value;
|
|
248
|
-
return {
|
|
249
|
-
key: key,
|
|
250
|
-
header: value
|
|
251
|
-
};
|
|
252
|
-
});
|
|
253
|
-
worksheet.columns = Headers;
|
|
254
|
-
worksheet.addRows(rows);
|
|
255
|
-
try {
|
|
256
|
-
for (var merges_1 = __values(merges), merges_1_1 = merges_1.next(); !merges_1_1.done; merges_1_1 = merges_1.next()) {
|
|
257
|
-
var _h = __read(merges_1_1.value, 2), from = _h[0], to = _h[1];
|
|
258
|
-
if (from && to)
|
|
259
|
-
worksheet.mergeCells(from + ':' + to);
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
263
|
-
finally {
|
|
264
|
-
try {
|
|
265
|
-
if (merges_1_1 && !merges_1_1.done && (_a = merges_1.return)) _a.call(merges_1);
|
|
266
|
-
}
|
|
267
|
-
finally { if (e_5) throw e_5.error; }
|
|
268
|
-
}
|
|
269
|
-
try {
|
|
270
|
-
for (var styles_1 = __values(styles), styles_1_1 = styles_1.next(); !styles_1_1.done; styles_1_1 = styles_1.next()) {
|
|
271
|
-
var style = styles_1_1.value;
|
|
272
|
-
var type = style.type, target = style.target, values = style.values;
|
|
273
|
-
var Targets = $.flatArray(target);
|
|
274
|
-
try {
|
|
275
|
-
for (var _j = (e_7 = void 0, __values(Object.entries(values))), _k = _j.next(); !_k.done; _k = _j.next()) {
|
|
276
|
-
var _l = __read(_k.value, 2), key = _l[0], value = _l[1];
|
|
277
|
-
try {
|
|
278
|
-
for (var Targets_2 = (e_8 = void 0, __values(Targets)), Targets_2_1 = Targets_2.next(); !Targets_2_1.done; Targets_2_1 = Targets_2.next()) {
|
|
279
|
-
var Target = Targets_2_1.value;
|
|
280
|
-
worksheet['get' + type.toCapital()](Target)[key] = value;
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
catch (e_8_1) { e_8 = { error: e_8_1 }; }
|
|
284
|
-
finally {
|
|
285
|
-
try {
|
|
286
|
-
if (Targets_2_1 && !Targets_2_1.done && (_d = Targets_2.return)) _d.call(Targets_2);
|
|
287
|
-
}
|
|
288
|
-
finally { if (e_8) throw e_8.error; }
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
catch (e_7_1) { e_7 = { error: e_7_1 }; }
|
|
293
|
-
finally {
|
|
294
|
-
try {
|
|
295
|
-
if (_k && !_k.done && (_c = _j.return)) _c.call(_j);
|
|
296
|
-
}
|
|
297
|
-
finally { if (e_7) throw e_7.error; }
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
|
302
|
-
finally {
|
|
303
|
-
try {
|
|
304
|
-
if (styles_1_1 && !styles_1_1.done && (_b = styles_1.return)) _b.call(styles_1);
|
|
305
|
-
}
|
|
306
|
-
finally { if (e_6) throw e_6.error; }
|
|
307
|
-
}
|
|
308
|
-
});
|
|
309
|
-
return [2 /*return*/, D_1(workbook, fileName)];
|
|
310
|
-
}
|
|
311
|
-
});
|
|
312
|
-
}); }
|
|
313
|
-
};
|
|
314
|
-
}
|
|
File without changes
|
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
-
function step(op) {
|
|
27
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
-
while (_) try {
|
|
29
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
-
switch (op[0]) {
|
|
32
|
-
case 0: case 1: t = op; break;
|
|
33
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
-
default:
|
|
37
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
-
if (t[2]) _.ops.pop();
|
|
42
|
-
_.trys.pop(); continue;
|
|
43
|
-
}
|
|
44
|
-
op = body.call(thisArg, _);
|
|
45
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
50
|
-
var t = {};
|
|
51
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
52
|
-
t[p] = s[p];
|
|
53
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
54
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
55
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
56
|
-
t[p[i]] = s[p[i]];
|
|
57
|
-
}
|
|
58
|
-
return t;
|
|
59
|
-
};
|
|
60
|
-
$.NoticeHttpStatus = function (params) {
|
|
61
|
-
var status = params.status, statusText = params.statusText, label = params.label, others = __rest(params, ["status", "statusText", "label"]);
|
|
62
|
-
if (status >= 400) {
|
|
63
|
-
others = __assign({ backgroundColor: 'nega' }, others);
|
|
64
|
-
}
|
|
65
|
-
amotify.fn.SnackBar.add(__assign({ children: React.createElement(amotify.atoms.Box, null,
|
|
66
|
-
React.createElement(amotify.mols.Text.Paragraph, null,
|
|
67
|
-
"\u901A\u4FE1\u30B9\u30C6\u30FC\u30BF\u30B9 : ",
|
|
68
|
-
status,
|
|
69
|
-
" ",
|
|
70
|
-
statusText),
|
|
71
|
-
React.createElement(amotify.mols.Text.Normal, null, label)) }, others));
|
|
72
|
-
};
|
|
73
|
-
$.copyToClipboard = function (rawData) { return __awaiter(void 0, void 0, void 0, function () {
|
|
74
|
-
var data, response;
|
|
75
|
-
return __generator(this, function (_a) {
|
|
76
|
-
switch (_a.label) {
|
|
77
|
-
case 0:
|
|
78
|
-
data = '';
|
|
79
|
-
if ($.is.string(rawData))
|
|
80
|
-
data = rawData;
|
|
81
|
-
else if ($.is.function(rawData))
|
|
82
|
-
data = rawData();
|
|
83
|
-
response = {
|
|
84
|
-
ok: false,
|
|
85
|
-
body: 'NotSupported'
|
|
86
|
-
};
|
|
87
|
-
return [4 /*yield*/, (function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
88
|
-
var result, input;
|
|
89
|
-
return __generator(this, function (_a) {
|
|
90
|
-
switch (_a.label) {
|
|
91
|
-
case 0:
|
|
92
|
-
if (!navigator.clipboard) return [3 /*break*/, 2];
|
|
93
|
-
return [4 /*yield*/, navigator
|
|
94
|
-
.clipboard
|
|
95
|
-
.writeText(data)
|
|
96
|
-
.then(function () { return true; }, function () { return false; })];
|
|
97
|
-
case 1:
|
|
98
|
-
result = _a.sent();
|
|
99
|
-
if (!result)
|
|
100
|
-
return [2 /*return*/];
|
|
101
|
-
return [3 /*break*/, 3];
|
|
102
|
-
case 2:
|
|
103
|
-
input = document.createElement('input');
|
|
104
|
-
$(document.body).append(input);
|
|
105
|
-
input.value = data;
|
|
106
|
-
input.select();
|
|
107
|
-
result = document.execCommand('copy');
|
|
108
|
-
document.body.removeChild(input);
|
|
109
|
-
if (!result)
|
|
110
|
-
return [2 /*return*/];
|
|
111
|
-
_a.label = 3;
|
|
112
|
-
case 3:
|
|
113
|
-
amotify.fn.SnackBar.add({
|
|
114
|
-
children: 'クリップボードにコピーしました'
|
|
115
|
-
});
|
|
116
|
-
response = {
|
|
117
|
-
ok: true,
|
|
118
|
-
body: ''
|
|
119
|
-
};
|
|
120
|
-
return [2 /*return*/];
|
|
121
|
-
}
|
|
122
|
-
});
|
|
123
|
-
}); })()];
|
|
124
|
-
case 1:
|
|
125
|
-
_a.sent();
|
|
126
|
-
return [2 /*return*/, response];
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
}); };
|
|
130
|
-
$.isJSXElement = function (v) {
|
|
131
|
-
return v.$$typeof === Symbol.for('react.element');
|
|
132
|
-
};
|
|
133
|
-
$.getCurrentLocation = function () {
|
|
134
|
-
return new Promise(function (resolve, reject) {
|
|
135
|
-
navigator.geolocation.getCurrentPosition(function (position) {
|
|
136
|
-
var _a = position.coords, latitude = _a.latitude, longitude = _a.longitude;
|
|
137
|
-
resolve({
|
|
138
|
-
ok: true,
|
|
139
|
-
status: 200,
|
|
140
|
-
body: {
|
|
141
|
-
lat: latitude,
|
|
142
|
-
lng: longitude
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
}, function (error) {
|
|
146
|
-
resolve({
|
|
147
|
-
ok: false,
|
|
148
|
-
status: 500,
|
|
149
|
-
body: {
|
|
150
|
-
reason: error
|
|
151
|
-
}
|
|
152
|
-
});
|
|
153
|
-
});
|
|
154
|
-
});
|
|
155
|
-
};
|
|
156
|
-
$.CDNReader = function (url) {
|
|
157
|
-
return new Promise(function (resolve, reject) {
|
|
158
|
-
var tag = document.createElement('script');
|
|
159
|
-
tag.src = url;
|
|
160
|
-
tag.addEventListener('load', function () {
|
|
161
|
-
resolve('OK');
|
|
162
|
-
});
|
|
163
|
-
$(document.body).append(tag);
|
|
164
|
-
});
|
|
165
|
-
};
|
|
166
|
-
$.ImageLoader = function (dataUrl, img) {
|
|
167
|
-
return new Promise(function (resolve, reject) {
|
|
168
|
-
var Img = img ? img : new Image();
|
|
169
|
-
Img.onload = function () { return resolve(Img); };
|
|
170
|
-
Img.onerror = function (e) { return reject(e); };
|
|
171
|
-
Img.src = dataUrl;
|
|
172
|
-
});
|
|
173
|
-
};
|
|
174
|
-
$.extend({
|
|
175
|
-
zen2hanNumber: function () {
|
|
176
|
-
return this.replace(/[0-9]/g, function (s) {
|
|
177
|
-
return String.fromCharCode(s.charCodeAt(0) - 0xFEE0);
|
|
178
|
-
})
|
|
179
|
-
.replace(/[--﹣−‐⁃‑‒–—﹘―⎯⏤ーー─━]/g, '-')
|
|
180
|
-
.replace(/¥/, '¥')
|
|
181
|
-
.replace(/、/, ',')
|
|
182
|
-
.replace(/(/, '(')
|
|
183
|
-
.replace(/)/, ')')
|
|
184
|
-
.replace(/+/, '+');
|
|
185
|
-
}
|
|
186
|
-
}, String);
|