amotify 0.0.8 → 0.0.10
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 -4
- package/{src/@types → @types}/amot.tsx +125 -85
- package/{src/@types → @types}/fn.tsx +52 -53
- package/{src/@types → @types}/jsminAmotifyExtension.tsx +1 -2
- package/@types/module.tsx +1 -0
- package/dist/amotify.js +328 -0
- package/{public → dist}/amotify.min.css +339 -339
- package/package.json +11 -12
- package/src/{Atoms/@export.tsx → @atoms.tsx} +3 -3
- package/src/@functions.tsx +29 -0
- package/src/{Global/@export.tsx → @global.tsx} +9 -9
- package/src/@jsminAmotifyExtension/formCollect.tsx +1 -1
- package/src/{Molecules/@export.tsx → @molecules.tsx} +5 -4
- package/src/@organisms.tsx +5 -0
- package/src/@styles/UniStyling.scss +1 -1
- package/src/@styles/init.scss +1 -1
- package/src/@styles/styleSet.scss +1 -1
- package/src/{Templates/@export.tsx → @templates.tsx} +1 -1
- package/src/{Atoms → atoms}/FAIcon/parts.tsx +4 -3
- package/src/{Atoms → atoms}/FAIcon/style.module.scss +1 -2
- package/src/{Atoms → atoms}/Logo/parts.tsx +2 -2
- package/src/{Atoms → atoms}/Logo/style.module.scss +1 -2
- package/src/{Atoms → atoms}/Various/parts.tsx +10 -9
- package/src/{Atoms → atoms}/Various/style.module.scss +3 -2
- package/src/config.tsx +4 -4
- package/src/{Functions → functions}/Button/_.tsx +2 -1
- package/src/{Functions → functions}/Button/style.module.scss +3 -2
- package/src/{Functions → functions}/Cropper/parts.tsx +16 -20
- package/src/{Functions → functions}/Cropper/style.module.scss +1 -1
- package/src/{Functions → functions}/Effects/Fade.tsx +6 -11
- package/src/{Functions → functions}/Effects/style.module.scss +1 -1
- package/src/{Functions → functions}/Input/Chips/Selector.tsx +17 -21
- package/src/{Functions → functions}/Input/Chips/_.tsx +12 -17
- package/src/functions/Input/Chips/style.module.scss +6 -0
- package/src/{Functions → functions}/Input/DigitCharacters.tsx +6 -10
- package/src/{Functions → functions}/Input/File/_.tsx +13 -16
- package/src/{Functions → functions}/Input/File/style.module.scss +1 -1
- package/src/{Functions → functions}/Input/Hidden.tsx +4 -3
- package/src/{Functions → functions}/Input/List/_.tsx +8 -12
- package/src/{Functions → functions}/Input/List/style.module.scss +1 -1
- package/src/{Functions → functions}/Input/Segmented/_.tsx +2 -2
- package/src/{Functions → functions}/Input/Segmented/style.module.scss +2 -2
- package/src/{Functions → functions}/Input/Select/_.tsx +8 -11
- package/src/{Functions → functions}/Input/Select/style.module.scss +1 -1
- package/src/{Functions → functions}/Input/Slider/_.tsx +9 -12
- package/src/{Functions → functions}/Input/Slider/style.module.scss +2 -2
- package/src/{Functions → functions}/Input/Switch/_.tsx +7 -11
- package/src/{Functions → functions}/Input/Switch/style.module.scss +1 -1
- package/src/{Functions → functions}/Input/Text.tsx +6 -11
- package/src/{Functions → functions}/Input/TextArea.tsx +4 -8
- package/src/{Functions → functions}/Input/Time/Picker.tsx +11 -16
- package/src/{Functions → functions}/Input/Time/_.tsx +13 -17
- package/src/{Functions → functions}/Input/Time/style.module.scss +1 -1
- package/src/{Functions → functions}/Input/_.tsx +12 -17
- package/src/{Functions → functions}/Input/core.tsx +14 -19
- 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 +5 -17
- package/src/functions/Inputs/types.d.ts +13 -0
- package/src/{Functions → functions}/Layout/PageNotFound.tsx +6 -7
- package/src/{Functions → functions}/Layout/PageRouter.tsx +25 -34
- package/src/{Functions → functions}/Layout/PageViewController/parts.tsx +6 -9
- package/src/{Functions → functions}/Layout/Plate.tsx +3 -2
- package/src/{Functions → functions}/Layout/RootViewController/parts.tsx +6 -8
- package/src/{Functions → functions}/Layout/RootViewController/style.module.scss +1 -1
- package/src/{Functions → functions}/Layout/SwipeView/parts.tsx +11 -16
- package/src/{Functions → functions}/Layout/SwipeView/style.module.scss +1 -1
- package/src/{Functions → functions}/Layout/TabBar.tsx +6 -10
- package/src/{Functions → functions}/Loader/corner.tsx +6 -12
- package/src/{Functions → functions}/Loader/mini.tsx +9 -12
- package/src/{Functions → functions}/Loader/parts.tsx +7 -10
- package/src/{Functions → functions}/Loader/style.module.scss +1 -1
- package/src/{Functions → functions}/Loader/top.tsx +6 -12
- package/src/{Functions → functions}/Sheet/parts.tsx +16 -19
- package/src/{Functions → functions}/Sheet/style.module.scss +1 -1
- package/src/{Functions → functions}/SnackBar/parts.tsx +14 -17
- package/src/{Functions → functions}/SnackBar/style.module.scss +1 -1
- package/src/{Functions → functions}/Table/Data/parts.tsx +4 -4
- package/src/{Functions → functions}/Table/Drag/parts.tsx +12 -15
- package/src/{Functions → functions}/Table/Normal/parts.tsx +5 -5
- package/src/{Functions → functions}/Table/_.tsx +4 -4
- package/src/{Functions → functions}/Table/style.module.scss +3 -2
- package/src/{Functions → functions}/Tooltips/parts.tsx +3 -2
- package/src/{Global → global}/LaunchReactApplication.tsx +4 -3
- package/src/{Global → global}/styleConverter.tsx +3 -7
- package/src/launch.tsx +16 -11
- package/src/{Molecules → molecules}/Accordion/parts.tsx +8 -12
- package/src/{Molecules → molecules}/Accordion/style.module.scss +1 -1
- package/src/{Molecules → molecules}/LinkifyText/parts.tsx +4 -3
- package/src/{Molecules → molecules}/List.tsx +3 -2
- package/src/{Organisms → organisms}/DisplayStyleInput/darkmode.tsx +6 -11
- package/src/{Organisms → organisms}/DisplayStyleInput/themeColor.tsx +7 -12
- package/src/{Templates → templates}/PlayGround/parts.tsx +12 -40
- package/src/{Templates → templates}/PlayGround/style.module.scss +1 -1
- package/tsconfig.json +19 -5
- package/webpack.config.js +18 -7
- 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 -310
- package/src/@types/_.tsx +0 -6
- package/src/@types/index.tsx +0 -74
- package/src/@types/module.tsx +0 -2
- package/src/Functions/@export.tsx +0 -29
- package/src/Functions/Input/Chips/style.module.scss +0 -6
- 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/index.js +0 -0
- /package/{src/@types → @types}/state.tsx +0 -0
- /package/src/{Functions → functions}/Effects/Ripple.tsx +0 -0
- /package/src/{Functions → functions}/Effects/_.tsx +0 -0
- /package/src/{Functions → functions}/Inputs/_.tsx +0 -0
- /package/src/{Functions → functions}/Layout/_.tsx +0 -0
- /package/src/{Organisms → organisms}/DisplayStyleInput/_.tsx +0 -0
|
@@ -1,308 +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 __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
-
var t = {};
|
|
15
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
-
t[p] = s[p];
|
|
17
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
-
t[p[i]] = s[p[i]];
|
|
21
|
-
}
|
|
22
|
-
return t;
|
|
23
|
-
};
|
|
24
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
25
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
26
|
-
if (!m) return o;
|
|
27
|
-
var i = m.call(o), r, ar = [], e;
|
|
28
|
-
try {
|
|
29
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
30
|
-
}
|
|
31
|
-
catch (error) { e = { error: error }; }
|
|
32
|
-
finally {
|
|
33
|
-
try {
|
|
34
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
35
|
-
}
|
|
36
|
-
finally { if (e) throw e.error; }
|
|
37
|
-
}
|
|
38
|
-
return ar;
|
|
39
|
-
};
|
|
40
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
41
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
42
|
-
};
|
|
43
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
-
exports.SliderInput = void 0;
|
|
45
|
-
var _export_1 = require("../../../Global/@export");
|
|
46
|
-
var _export_2 = require("../../../Atoms/@export");
|
|
47
|
-
var _export_3 = require("../../../Functions/@export");
|
|
48
|
-
var core_1 = require("../core");
|
|
49
|
-
var style_module_scss_1 = __importDefault(require("./style.module.scss"));
|
|
50
|
-
var useState = React.useState, useEffect = React.useEffect;
|
|
51
|
-
function DefaultValidation(props) {
|
|
52
|
-
var value = props.value, params = props.params;
|
|
53
|
-
var required = params.required;
|
|
54
|
-
var notice = [];
|
|
55
|
-
if (required && !value) {
|
|
56
|
-
notice.push({ type: 'invalid', label: '必須項目です' });
|
|
57
|
-
}
|
|
58
|
-
return {
|
|
59
|
-
ok: !notice.filter(function (_a) {
|
|
60
|
-
var type = _a.type;
|
|
61
|
-
return type == 'invalid';
|
|
62
|
-
}).length,
|
|
63
|
-
notice: notice
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
var DataLeveling = function (props) {
|
|
67
|
-
var value = props.value, val_status = props.val_status;
|
|
68
|
-
var min = val_status.min, max = val_status.max, step = val_status.step;
|
|
69
|
-
value = Math.max(value, min);
|
|
70
|
-
value = Math.min(value, max);
|
|
71
|
-
var rawValue = value / max;
|
|
72
|
-
var stepValue = rawValue * max;
|
|
73
|
-
stepValue = Math.round(stepValue / step);
|
|
74
|
-
return {
|
|
75
|
-
stepValue: stepValue * step,
|
|
76
|
-
stepIndex: stepValue,
|
|
77
|
-
positionLeft: stepValue * step / max * 100 + '%'
|
|
78
|
-
};
|
|
79
|
-
};
|
|
80
|
-
var SliderInput = function (params) {
|
|
81
|
-
var _a = params.color, color = _a === void 0 ? 'theme' : _a, required = params.required, _b = params.form, form = _b === void 0 ? '' : _b, _c = params.legends, _d = _c === void 0 ? {} : _c, _e = _d.enable, showLegends = _e === void 0 ? true : _e, customLegends = _d.custom, _f = _d.showAlways, showLegendsAlways = _f === void 0 ? false : _f, min = params.min, max = params.max, step = params.step, enableFormSubmit = params.enableFormSubmit, checkValidationAtFirst = params.checkValidationAtFirst, onChange = params.onChange, onKeyDown = params.onKeyDown, onValidate = params.onValidate, onUpdateValue = params.onUpdateValue, onUpdateValidValue = params.onUpdateValidValue, _g = params.value, value = _g === void 0 ? '' : _g, className = params.className, others = __rest(params, ["color", "required", "form", "legends", "min", "max", "step", "enableFormSubmit", "checkValidationAtFirst", "onChange", "onKeyDown", "onValidate", "onUpdateValue", "onUpdateValidValue", "value", "className"]);
|
|
82
|
-
var Default_Status = {
|
|
83
|
-
componentID: params.componentID || '',
|
|
84
|
-
dataValue: value,
|
|
85
|
-
min: min,
|
|
86
|
-
max: max,
|
|
87
|
-
step: step,
|
|
88
|
-
eventType: 'init',
|
|
89
|
-
eventID: $.uuidGen(),
|
|
90
|
-
};
|
|
91
|
-
var _h = __read(useState(Default_Status), 2), val_status = _h[0], set_status = _h[1];
|
|
92
|
-
var _j = __read(useState({
|
|
93
|
-
ok: false,
|
|
94
|
-
notice: []
|
|
95
|
-
}), 2), val_validate = _j[0], set_validate = _j[1];
|
|
96
|
-
(0, core_1.CommonEffects)({
|
|
97
|
-
params: params,
|
|
98
|
-
val_status: val_status,
|
|
99
|
-
set_status: set_status,
|
|
100
|
-
val_validate: val_validate,
|
|
101
|
-
set_validate: set_validate,
|
|
102
|
-
onUpdateValue: onUpdateValue,
|
|
103
|
-
onUpdateValidValue: onUpdateValidValue,
|
|
104
|
-
DefaultValidation: DefaultValidation,
|
|
105
|
-
ExtraOverrideParams: {
|
|
106
|
-
dataValue: value
|
|
107
|
-
},
|
|
108
|
-
ExtraStoreParams: {
|
|
109
|
-
prevValue: val_status.dataValue,
|
|
110
|
-
setValueByForeign: function (value) {
|
|
111
|
-
set_status(__assign(__assign({}, val_status), { dataValue: value, eventType: 'update', eventID: $.uuidGen() }));
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
var DotData = DataLeveling({
|
|
116
|
-
value: val_status.dataValue,
|
|
117
|
-
val_status: val_status
|
|
118
|
-
});
|
|
119
|
-
return React.createElement(core_1.BoxWrapper, { val_status: val_status, set_status: set_status, val_validate: val_validate, params: params },
|
|
120
|
-
React.createElement(_export_3.Input.Hidden, __assign({ value: DotData.stepValue, form: form, "data-value": DotData.stepValue, "data-validation": val_validate.ok, "data-input-type": 'slider' }, others)),
|
|
121
|
-
React.createElement(_export_2.Box, { flexSizing: 'auto', className: [
|
|
122
|
-
style_module_scss_1.default.Wrap,
|
|
123
|
-
className,
|
|
124
|
-
style_module_scss_1.default['ShowLegendsAlways_' + showLegendsAlways]
|
|
125
|
-
].join(' ') },
|
|
126
|
-
React.createElement(Comps.Rail, { color: color, val_status: val_status, set_status: set_status, DotData: DotData, form: form, enableFormSubmit: enableFormSubmit }),
|
|
127
|
-
showLegends ? React.createElement(Comps.IndicatorLabels, { componentID: val_status.componentID, min: min, max: max, step: step, customLegends: customLegends }) : null));
|
|
128
|
-
};
|
|
129
|
-
exports.SliderInput = SliderInput;
|
|
130
|
-
var Comps = {
|
|
131
|
-
IndicatorLabels: function (props) {
|
|
132
|
-
var componentID = props.componentID, min = props.min, max = props.max, step = props.step, customLegends = props.customLegends;
|
|
133
|
-
var Labels = [];
|
|
134
|
-
var minStep = Math.round(min / step);
|
|
135
|
-
var maxStep = Math.round(max / step);
|
|
136
|
-
var steps = maxStep - minStep + 1;
|
|
137
|
-
for (var index = minStep; index <= maxStep; index++) {
|
|
138
|
-
var value = index * step;
|
|
139
|
-
value = Math.max(value, min);
|
|
140
|
-
value = Math.min(value, max);
|
|
141
|
-
var left = (value / max * 100) + '%';
|
|
142
|
-
Labels.push(React.createElement(_export_2.Box, { key: value, className: style_module_scss_1.default.Label, id: 'Legend-' + componentID + '-' + index, display: index == minStep || index == maxStep ? 'flex' : 'none', position: 'absolute', top: 0, height: 1, unitWidth: 2, transition: 'middle', fontColor: '1.clear', freeCSS: {
|
|
143
|
-
left: left,
|
|
144
|
-
whiteSpace: 'nowrap',
|
|
145
|
-
textAlign: 'center'
|
|
146
|
-
}, verticalAlign: 'center', horizontalAlign: 'center', children: customLegends ? customLegends(value) : value.rank() }));
|
|
147
|
-
}
|
|
148
|
-
useEffect(function () {
|
|
149
|
-
var LabelLeveling = function () {
|
|
150
|
-
var Labels = $('#Labels-' + componentID);
|
|
151
|
-
var width = Labels.position().width;
|
|
152
|
-
var maxLabelCount = Math.round(width / 50) - 1;
|
|
153
|
-
var labelStep = Math.round(steps / maxLabelCount);
|
|
154
|
-
for (var index_1 = minStep + 1; index_1 < maxStep; index_1++) {
|
|
155
|
-
$('#Legend-' + componentID + '-' + index_1).css({
|
|
156
|
-
display: index_1 % labelStep == 0 ? 'flex' : 'none'
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
};
|
|
160
|
-
$(window).addEvent({
|
|
161
|
-
eventID: 'SliderResizeCallback-' + componentID,
|
|
162
|
-
eventType: 'resize',
|
|
163
|
-
callback: function () {
|
|
164
|
-
LabelLeveling();
|
|
165
|
-
}
|
|
166
|
-
});
|
|
167
|
-
LabelLeveling();
|
|
168
|
-
return function () {
|
|
169
|
-
$(window).removeEvent('SliderResizeCallback-' + componentID);
|
|
170
|
-
};
|
|
171
|
-
}, []);
|
|
172
|
-
return (React.createElement(_export_2.Flex, { className: style_module_scss_1.default.Labels, verticalAlign: 'center', horizontalAlign: 'between', unitHeight: 2, fontSize: '0.xs', position: 'relative', id: 'Labels-' + componentID },
|
|
173
|
-
React.createElement(_export_2.Box, { position: 'absolute', top: 0, left: 0, right: 2, bottom: 0, children: Labels })));
|
|
174
|
-
},
|
|
175
|
-
Rail: function (props) {
|
|
176
|
-
var val_status = props.val_status, set_status = props.set_status, DotData = props.DotData, form = props.form, enableFormSubmit = props.enableFormSubmit;
|
|
177
|
-
var componentID = val_status.componentID;
|
|
178
|
-
return (React.createElement(_export_2.Flex, { className: style_module_scss_1.default.Rail, position: 'relative', paddingLeft: '1/2', unitHeight: 2, verticalAlign: 'center', freeCSS: {
|
|
179
|
-
minWidth: '10rem',
|
|
180
|
-
zIndex: 1,
|
|
181
|
-
cursor: 'pointer'
|
|
182
|
-
}, onMouseDown: function (event) {
|
|
183
|
-
event.stopPropagation();
|
|
184
|
-
EffectStart(event, {
|
|
185
|
-
val_status: val_status,
|
|
186
|
-
set_status: set_status,
|
|
187
|
-
DotData: DotData
|
|
188
|
-
});
|
|
189
|
-
}, onTouchStart: function (event) {
|
|
190
|
-
event.stopPropagation();
|
|
191
|
-
EffectStart(event, {
|
|
192
|
-
val_status: val_status,
|
|
193
|
-
set_status: set_status,
|
|
194
|
-
DotData: DotData
|
|
195
|
-
});
|
|
196
|
-
} },
|
|
197
|
-
React.createElement(_export_2.Box, { className: style_module_scss_1.default.Bar, backgroundColor: '4.layer.darken', position: 'relative', borderRadius: 'sphere', transition: 'middle', flexSizing: 'none', unitHeight: '2/3', width: 1, id: componentID + '_Bar' },
|
|
198
|
-
React.createElement(_export_2.Box, { className: style_module_scss_1.default.BarColor, position: 'relative', height: 1, width: 0, left: 0, transition: 'long', borderRadius: 'inherit', backgroundColor: props.color, opacity: 'middle', overflow: 'hidden', freeCSS: {
|
|
199
|
-
width: DotData.positionLeft
|
|
200
|
-
}, id: componentID + '_BarColor' })),
|
|
201
|
-
React.createElement(_export_2.Box, { className: style_module_scss_1.default.BallWrap, position: 'absolute', top: 0, left: 0, right: 2, bottom: 0 },
|
|
202
|
-
React.createElement(_export_3.Buttons.Button.Plain, { className: style_module_scss_1.default.Ball, position: 'absolute', backgroundColor: props.color, top: 0, left: 0, ssSphere: 2, freeCSS: {
|
|
203
|
-
zIndex: 2,
|
|
204
|
-
left: DotData.positionLeft
|
|
205
|
-
}, "data-form-name": form, id: componentID + '_Ball', onKeyDown: function (event) {
|
|
206
|
-
KeyDownEvent({
|
|
207
|
-
event: event,
|
|
208
|
-
val_status: val_status,
|
|
209
|
-
set_status: set_status,
|
|
210
|
-
DotData: DotData
|
|
211
|
-
});
|
|
212
|
-
if (enableFormSubmit)
|
|
213
|
-
(0, core_1.SubmitForm)(event);
|
|
214
|
-
} }))));
|
|
215
|
-
}
|
|
216
|
-
};
|
|
217
|
-
var EffectStart = function (event, info) {
|
|
218
|
-
$(document)
|
|
219
|
-
.addEvent({
|
|
220
|
-
eventID: 'SliderMouseMove',
|
|
221
|
-
eventType: 'mousemove',
|
|
222
|
-
callback: function (event) { EffectMove(event, info); },
|
|
223
|
-
option: { passive: false }
|
|
224
|
-
})
|
|
225
|
-
.addEvent({
|
|
226
|
-
eventID: 'SliderTouchMove',
|
|
227
|
-
eventType: 'touchmove',
|
|
228
|
-
callback: function (event) { EffectMove(event, info); },
|
|
229
|
-
option: { passive: false }
|
|
230
|
-
})
|
|
231
|
-
.addEvent({
|
|
232
|
-
eventID: 'SliderMouseUp',
|
|
233
|
-
eventType: 'mouseup',
|
|
234
|
-
callback: function () { EffectEnd(); }
|
|
235
|
-
})
|
|
236
|
-
.addEvent({
|
|
237
|
-
eventID: 'SliderTouchEnd',
|
|
238
|
-
eventType: 'touchend',
|
|
239
|
-
callback: function () { EffectEnd(); }
|
|
240
|
-
});
|
|
241
|
-
};
|
|
242
|
-
var EffectMove = function (event, info) {
|
|
243
|
-
var mouseX = $.getCursor(event).x;
|
|
244
|
-
var val_status = info.val_status, set_status = info.set_status;
|
|
245
|
-
var componentID = val_status.componentID, min = val_status.min, max = val_status.max;
|
|
246
|
-
var Ball = $('#' + componentID + '_Ball');
|
|
247
|
-
var Bar = $('#' + componentID + '_Bar');
|
|
248
|
-
var BarColor = $('#' + componentID + '_BarColor');
|
|
249
|
-
var _a = Bar.position(), barWidth = _a.width, barLeft = _a.left;
|
|
250
|
-
var Left = (mouseX - barLeft) / barWidth;
|
|
251
|
-
Left = Math.max(Left, 0);
|
|
252
|
-
Left = Math.min(Left, 1);
|
|
253
|
-
var LeftRawValue = Left * max;
|
|
254
|
-
var resultValues = DataLeveling({
|
|
255
|
-
value: LeftRawValue,
|
|
256
|
-
val_status: val_status
|
|
257
|
-
});
|
|
258
|
-
var left = resultValues.positionLeft;
|
|
259
|
-
var stepValue = resultValues.stepValue;
|
|
260
|
-
Ball.css({ left: left });
|
|
261
|
-
BarColor.css({ width: left });
|
|
262
|
-
var prevValue = _export_1.useStore.get(componentID).prevValue;
|
|
263
|
-
if (stepValue != prevValue) {
|
|
264
|
-
_export_1.useStore.update({
|
|
265
|
-
key: componentID,
|
|
266
|
-
value: {
|
|
267
|
-
prevValue: stepValue
|
|
268
|
-
}
|
|
269
|
-
});
|
|
270
|
-
set_status(__assign(__assign({}, val_status), { dataValue: stepValue, eventType: 'update', eventID: $.uuidGen() }));
|
|
271
|
-
}
|
|
272
|
-
event.preventDefault();
|
|
273
|
-
event.stopPropagation();
|
|
274
|
-
return false;
|
|
275
|
-
};
|
|
276
|
-
var EffectEnd = function () {
|
|
277
|
-
$(document).removeEvent(['SliderMouseMove', 'SliderTouchMove', 'SliderMouseUp', 'SliderTouchEnd']);
|
|
278
|
-
};
|
|
279
|
-
var KeyDownEvent = function (props) {
|
|
280
|
-
var event = props.event, val_status = props.val_status, set_status = props.set_status;
|
|
281
|
-
var min = val_status.min, max = val_status.max, step = val_status.step;
|
|
282
|
-
var key = event.key, metaKey = event.metaKey, ctrlKey = event.ctrlKey;
|
|
283
|
-
var auxKey = ctrlKey || metaKey;
|
|
284
|
-
var nextValue = val_status.dataValue;
|
|
285
|
-
if (!key.match(/Arrow/))
|
|
286
|
-
return;
|
|
287
|
-
event.preventDefault();
|
|
288
|
-
if (key.match(/Left|Up/)) {
|
|
289
|
-
if (auxKey)
|
|
290
|
-
nextValue = min;
|
|
291
|
-
else
|
|
292
|
-
nextValue -= step;
|
|
293
|
-
}
|
|
294
|
-
else if (key.match(/Right|Down/)) {
|
|
295
|
-
if (auxKey)
|
|
296
|
-
nextValue = max;
|
|
297
|
-
else
|
|
298
|
-
nextValue += step;
|
|
299
|
-
}
|
|
300
|
-
nextValue = Math.max(Math.min(nextValue, max), min);
|
|
301
|
-
_export_1.useStore.update({
|
|
302
|
-
key: val_status.componentID,
|
|
303
|
-
value: {
|
|
304
|
-
prevValue: nextValue
|
|
305
|
-
}
|
|
306
|
-
});
|
|
307
|
-
set_status(__assign(__assign({}, val_status), { dataValue: nextValue, eventType: 'update', eventID: $.uuidGen() }));
|
|
308
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const SwitchInput: FNC<amotify.fn.Input.Switch.PlainParams>;
|
|
@@ -1,120 +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 __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
-
var t = {};
|
|
15
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
-
t[p] = s[p];
|
|
17
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
-
t[p[i]] = s[p[i]];
|
|
21
|
-
}
|
|
22
|
-
return t;
|
|
23
|
-
};
|
|
24
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
25
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
26
|
-
if (!m) return o;
|
|
27
|
-
var i = m.call(o), r, ar = [], e;
|
|
28
|
-
try {
|
|
29
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
30
|
-
}
|
|
31
|
-
catch (error) { e = { error: error }; }
|
|
32
|
-
finally {
|
|
33
|
-
try {
|
|
34
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
35
|
-
}
|
|
36
|
-
finally { if (e) throw e.error; }
|
|
37
|
-
}
|
|
38
|
-
return ar;
|
|
39
|
-
};
|
|
40
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
41
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
42
|
-
};
|
|
43
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
-
exports.SwitchInput = void 0;
|
|
45
|
-
var _export_1 = require("../../../Global/@export");
|
|
46
|
-
var _export_2 = require("../../../Atoms/@export");
|
|
47
|
-
var _export_3 = require("../../../Molecules/@export");
|
|
48
|
-
var _export_4 = require("../../../Functions/@export");
|
|
49
|
-
var core_1 = require("../core");
|
|
50
|
-
var style_module_scss_1 = __importDefault(require("./style.module.scss"));
|
|
51
|
-
var useState = _export_1.React.useState;
|
|
52
|
-
function DefaultValidation(props) {
|
|
53
|
-
var value = props.value, params = props.params;
|
|
54
|
-
var required = params.required;
|
|
55
|
-
var notice = [];
|
|
56
|
-
if (required && !value) {
|
|
57
|
-
notice.push({ type: 'invalid', label: 'ONになっていません' });
|
|
58
|
-
}
|
|
59
|
-
return {
|
|
60
|
-
ok: !notice.filter(function (_a) {
|
|
61
|
-
var type = _a.type;
|
|
62
|
-
return type == 'invalid';
|
|
63
|
-
}).length,
|
|
64
|
-
notice: notice
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
var SwitchInput = function (params) {
|
|
68
|
-
var componentID = params.componentID, _a = params.color, color = _a === void 0 ? 'posi' : _a, required = params.required, form = params.form, id = params.id, enableFormSubmit = params.enableFormSubmit, checkValidationAtFirst = params.checkValidationAtFirst, onChange = params.onChange, onKeyDown = params.onKeyDown, onValidate = params.onValidate, onUpdateValue = params.onUpdateValue, onUpdateValidValue = params.onUpdateValidValue, _b = params.value, value = _b === void 0 ? '' : _b, _c = params.icon, icon = _c === void 0 ? '' : _c, _d = params.appearance, appearance = _d === void 0 ? 'material' : _d, others = __rest(params, ["componentID", "color", "required", "form", "id", "enableFormSubmit", "checkValidationAtFirst", "onChange", "onKeyDown", "onValidate", "onUpdateValue", "onUpdateValidValue", "value", "icon", "appearance"]);
|
|
69
|
-
var Default_Status = {
|
|
70
|
-
componentID: params.componentID || '',
|
|
71
|
-
dataValue: value,
|
|
72
|
-
eventType: 'init',
|
|
73
|
-
eventID: $.uuidGen()
|
|
74
|
-
};
|
|
75
|
-
var _e = __read(useState(Default_Status), 2), val_status = _e[0], set_status = _e[1];
|
|
76
|
-
var _f = __read(useState({
|
|
77
|
-
ok: false,
|
|
78
|
-
notice: []
|
|
79
|
-
}), 2), val_validate = _f[0], set_validate = _f[1];
|
|
80
|
-
var isChecked = !!val_status.dataValue;
|
|
81
|
-
(0, core_1.CommonEffects)({
|
|
82
|
-
params: params,
|
|
83
|
-
val_status: val_status,
|
|
84
|
-
set_status: set_status,
|
|
85
|
-
val_validate: val_validate,
|
|
86
|
-
set_validate: set_validate,
|
|
87
|
-
DefaultValidation: DefaultValidation,
|
|
88
|
-
onUpdateValue: onUpdateValue,
|
|
89
|
-
onUpdateValidValue: onUpdateValidValue,
|
|
90
|
-
ExtraOverrideParams: {
|
|
91
|
-
dataValue: value,
|
|
92
|
-
formatValue: value
|
|
93
|
-
},
|
|
94
|
-
});
|
|
95
|
-
return (_export_1.React.createElement(core_1.BoxWrapper, { val_status: val_status, set_status: set_status, val_validate: val_validate, params: params },
|
|
96
|
-
_export_1.React.createElement("input", __assign({ type: 'checkbox', "data-form": form, "data-input-type": 'switch', "data-validation": val_validate.ok, "data-component-id": val_status.componentID, "data-value": val_status.dataValue, checked: val_status.dataValue, className: style_module_scss_1.default.Input, id: id, onKeyDown: function (event) {
|
|
97
|
-
if (onKeyDown)
|
|
98
|
-
onKeyDown(event);
|
|
99
|
-
if (enableFormSubmit)
|
|
100
|
-
(0, core_1.SubmitForm)(event);
|
|
101
|
-
}, onChange: function (event) {
|
|
102
|
-
if (val_validate.ok)
|
|
103
|
-
set_validate({ ok: false, notice: [] });
|
|
104
|
-
set_status(__assign(__assign({}, val_status), { dataValue: event.target.checked, eventType: 'update', eventID: $.uuidGen() }));
|
|
105
|
-
if (onChange)
|
|
106
|
-
onChange(event);
|
|
107
|
-
} }, others)),
|
|
108
|
-
_export_1.React.createElement(_export_4.Buttons.Label.Plain, { tabIndex: -1, htmlFor: id, padding: '1/3', transition: 'middle', borderRadius: '1.tone.primary', className: style_module_scss_1.default.Label },
|
|
109
|
-
_export_1.React.createElement(_export_2.Box, __assign({}, appearance == 'applely' ? {
|
|
110
|
-
padding: '1/4',
|
|
111
|
-
isRounded: true,
|
|
112
|
-
backgroundColor: isChecked ? color : '5.layer.darker'
|
|
113
|
-
} : {}),
|
|
114
|
-
_export_1.React.createElement(_export_3.Row.Center, { unitHeight: 2.5, position: 'relative', freeCSS: {
|
|
115
|
-
width: 12 * 4.5
|
|
116
|
-
} },
|
|
117
|
-
appearance == 'material' ? _export_1.React.createElement(_export_2.Box, { position: 'absolute', backgroundColor: isChecked ? color : '5.layer.darker', borderRadius: 'sphere', unitHeight: 1, transition: 'middle', width: 1, className: style_module_scss_1.default.Bar, opacity: 'middle' }) : null,
|
|
118
|
-
_export_1.React.createElement(_export_2.Box, { position: 'absolute', top: 0, left: 0, backgroundColor: appearance == 'material' && isChecked ? color : 'white', transition: 'middle', ssSphere: 2.5, boxShadow: 2, className: style_module_scss_1.default.Dot }, icon ? _export_1.React.createElement(_export_2.FAIcon, { transition: 'middle', fontColor: appearance == 'applely' && isChecked ? color : 'white', d: icon }) : null))))));
|
|
119
|
-
};
|
|
120
|
-
exports.SwitchInput = SwitchInput;
|