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.
Files changed (260) hide show
  1. package/{dist/@types/_.d.ts → @types/_.tsx} +3 -3
  2. package/{src/@types → @types}/amot.tsx +0 -1
  3. package/{src/@types → @types}/fn.tsx +1 -2
  4. package/{src/@types → @types}/index.tsx +1 -5
  5. package/{src/@types → @types}/jsminAmotifyExtension.tsx +1 -2
  6. package/dist/amotify.js +1 -0
  7. package/{public → dist}/amotify.min.css +22 -22
  8. package/package.json +4 -9
  9. package/src/{Atoms/@export.tsx → @atoms.tsx} +3 -3
  10. package/src/@functions.tsx +29 -0
  11. package/src/{Global/@export.tsx → @global.tsx} +2 -2
  12. package/src/{Molecules/@export.tsx → @molecules.tsx} +3 -3
  13. package/src/@organisms.tsx +5 -0
  14. package/src/@styles/@app.scss +2 -2
  15. package/src/@styles/UniStyling.scss +3 -3
  16. package/src/@styles/init.scss +1 -1
  17. package/src/@styles/{@variables/styleSet.scss → styleSet.scss} +1 -1
  18. package/src/{Templates/@export.tsx → @templates.tsx} +1 -1
  19. package/src/{Atoms → atoms}/FAIcon/style.module.scss +1 -2
  20. package/src/{Atoms → atoms}/Logo/parts.tsx +0 -1
  21. package/src/{Atoms → atoms}/Logo/style.module.scss +1 -2
  22. package/src/{Atoms → atoms}/Various/style.module.scss +2 -1
  23. package/src/{Functions → functions}/Button/style.module.scss +2 -1
  24. package/src/{Functions → functions}/Cropper/parts.tsx +1 -1
  25. package/src/{Functions → functions}/Cropper/style.module.scss +1 -1
  26. package/src/{Functions → functions}/Effects/style.module.scss +1 -1
  27. package/src/{Functions → functions}/Input/Chips/Selector.tsx +1 -2
  28. package/src/{Functions → functions}/Input/Chips/_.tsx +1 -5
  29. package/src/{Functions → functions}/Input/Chips/style.module.scss +1 -1
  30. package/src/{Functions → functions}/Input/DigitCharacters.tsx +1 -1
  31. package/src/{Functions → functions}/Input/File/_.tsx +1 -1
  32. package/src/{Functions → functions}/Input/File/style.module.scss +1 -1
  33. package/src/{Functions → functions}/Input/List/_.tsx +1 -1
  34. package/src/{Functions → functions}/Input/List/style.module.scss +1 -1
  35. package/src/{Functions → functions}/Input/Segmented/style.module.scss +1 -1
  36. package/src/{Functions → functions}/Input/Select/_.tsx +1 -1
  37. package/src/{Functions → functions}/Input/Select/style.module.scss +1 -1
  38. package/src/{Functions → functions}/Input/Slider/_.tsx +1 -1
  39. package/src/{Functions → functions}/Input/Slider/style.module.scss +1 -1
  40. package/src/{Functions → functions}/Input/Switch/_.tsx +1 -1
  41. package/src/{Functions → functions}/Input/Switch/style.module.scss +1 -1
  42. package/src/{Functions → functions}/Input/Time/Picker.tsx +1 -1
  43. package/src/{Functions → functions}/Input/Time/_.tsx +2 -2
  44. package/src/{Functions → functions}/Input/Time/style.module.scss +1 -1
  45. package/src/{Functions → functions}/Input/_.tsx +1 -1
  46. package/src/{Functions → functions}/Input/core.tsx +1 -1
  47. package/src/{Functions → functions}/Input/style.module.scss +1 -1
  48. package/src/{Functions → functions}/Inputs/style.module.scss +1 -1
  49. package/src/{Functions → functions}/Inputs/text.tsx +3 -16
  50. package/src/functions/Inputs/types.d.ts +13 -0
  51. package/src/{Functions → functions}/Layout/PageNotFound.tsx +2 -4
  52. package/src/{Functions → functions}/Layout/PageRouter.tsx +1 -1
  53. package/src/{Functions → functions}/Layout/PageViewController/parts.tsx +3 -1
  54. package/src/{Functions → functions}/Layout/RootViewController/parts.tsx +3 -5
  55. package/src/{Functions → functions}/Layout/RootViewController/style.module.scss +1 -1
  56. package/src/{Functions → functions}/Layout/SwipeView/parts.tsx +0 -1
  57. package/src/{Functions → functions}/Layout/SwipeView/style.module.scss +1 -1
  58. package/src/{Functions → functions}/Layout/TabBar.tsx +1 -1
  59. package/src/{Functions → functions}/Loader/style.module.scss +1 -1
  60. package/src/{Functions → functions}/Sheet/parts.tsx +1 -1
  61. package/src/{Functions → functions}/Sheet/style.module.scss +1 -1
  62. package/src/{Functions → functions}/SnackBar/parts.tsx +1 -1
  63. package/src/{Functions → functions}/SnackBar/style.module.scss +1 -1
  64. package/src/{Functions → functions}/Table/Data/parts.tsx +1 -1
  65. package/src/{Functions → functions}/Table/Drag/parts.tsx +1 -1
  66. package/src/{Functions → functions}/Table/Normal/parts.tsx +1 -2
  67. package/src/{Functions → functions}/Table/_.tsx +1 -2
  68. package/src/{Functions → functions}/Table/style.module.scss +2 -1
  69. package/src/{Functions → functions}/Tooltips/parts.tsx +1 -1
  70. package/src/{Global → global}/styleConverter.tsx +1 -5
  71. package/src/launch.tsx +5 -5
  72. package/src/{Molecules → molecules}/Accordion/style.module.scss +1 -1
  73. package/src/{Molecules → molecules}/LinkifyText/parts.tsx +1 -1
  74. package/src/{Organisms → organisms}/DisplayStyleInput/darkmode.tsx +1 -1
  75. package/src/{Organisms → organisms}/DisplayStyleInput/themeColor.tsx +1 -1
  76. package/src/{Templates → templates}/PlayGround/parts.tsx +26 -39
  77. package/src/{Templates → templates}/PlayGround/style.module.scss +1 -1
  78. package/tsconfig.json +20 -24
  79. package/webpack.config.js +11 -9
  80. package/dist/@jsminAmotifyExtension/_.d.ts +0 -4
  81. package/dist/@jsminAmotifyExtension/_.js +0 -6
  82. package/dist/@jsminAmotifyExtension/fetch.d.ts +0 -9
  83. package/dist/@jsminAmotifyExtension/fetch.js +0 -199
  84. package/dist/@jsminAmotifyExtension/formCollect.d.ts +0 -1
  85. package/dist/@jsminAmotifyExtension/formCollect.js +0 -137
  86. package/dist/@jsminAmotifyExtension/spreadSheet.d.ts +0 -4
  87. package/dist/@jsminAmotifyExtension/spreadSheet.js +0 -314
  88. package/dist/@jsminAmotifyExtension/variables.d.ts +0 -0
  89. package/dist/@jsminAmotifyExtension/variables.js +0 -186
  90. package/dist/@types/_.js +0 -8
  91. package/dist/@types/amot.d.ts +0 -260
  92. package/dist/@types/amot.js +0 -2
  93. package/dist/@types/fn.d.ts +0 -1040
  94. package/dist/@types/fn.js +0 -2
  95. package/dist/@types/index.d.ts +0 -62
  96. package/dist/@types/index.js +0 -2
  97. package/dist/@types/jsminAmotifyExtension.d.ts +0 -134
  98. package/dist/@types/jsminAmotifyExtension.js +0 -2
  99. package/dist/@types/module.d.ts +0 -2
  100. package/dist/@types/module.js +0 -1
  101. package/dist/@types/state.d.ts +0 -145
  102. package/dist/@types/state.js +0 -2
  103. package/dist/Atoms/@export.d.ts +0 -4
  104. package/dist/Atoms/@export.js +0 -16
  105. package/dist/Atoms/FAIcon/parts.d.ts +0 -2
  106. package/dist/Atoms/FAIcon/parts.js +0 -152
  107. package/dist/Atoms/Logo/parts.d.ts +0 -1
  108. package/dist/Atoms/Logo/parts.js +0 -154
  109. package/dist/Atoms/Various/parts.d.ts +0 -9
  110. package/dist/Atoms/Various/parts.js +0 -113
  111. package/dist/Functions/@export.d.ts +0 -12
  112. package/dist/Functions/@export.js +0 -25
  113. package/dist/Functions/Button/_.d.ts +0 -1
  114. package/dist/Functions/Button/_.js +0 -270
  115. package/dist/Functions/Cropper/parts.d.ts +0 -1
  116. package/dist/Functions/Cropper/parts.js +0 -783
  117. package/dist/Functions/Effects/Fade.d.ts +0 -1
  118. package/dist/Functions/Effects/Fade.js +0 -82
  119. package/dist/Functions/Effects/Ripple.d.ts +0 -1
  120. package/dist/Functions/Effects/Ripple.js +0 -107
  121. package/dist/Functions/Effects/_.d.ts +0 -3
  122. package/dist/Functions/Effects/_.js +0 -43
  123. package/dist/Functions/Input/Chips/Selector.d.ts +0 -1
  124. package/dist/Functions/Input/Chips/Selector.js +0 -356
  125. package/dist/Functions/Input/Chips/_.d.ts +0 -2
  126. package/dist/Functions/Input/Chips/_.js +0 -218
  127. package/dist/Functions/Input/DigitCharacters.d.ts +0 -1
  128. package/dist/Functions/Input/DigitCharacters.js +0 -178
  129. package/dist/Functions/Input/File/_.d.ts +0 -2
  130. package/dist/Functions/Input/File/_.js +0 -458
  131. package/dist/Functions/Input/Hidden.d.ts +0 -1
  132. package/dist/Functions/Input/Hidden.js +0 -30
  133. package/dist/Functions/Input/List/_.d.ts +0 -1
  134. package/dist/Functions/Input/List/_.js +0 -232
  135. package/dist/Functions/Input/Segmented/_.d.ts +0 -1
  136. package/dist/Functions/Input/Segmented/_.js +0 -111
  137. package/dist/Functions/Input/Select/_.d.ts +0 -1
  138. package/dist/Functions/Input/Select/_.js +0 -154
  139. package/dist/Functions/Input/Slider/_.d.ts +0 -1
  140. package/dist/Functions/Input/Slider/_.js +0 -308
  141. package/dist/Functions/Input/Switch/_.d.ts +0 -1
  142. package/dist/Functions/Input/Switch/_.js +0 -120
  143. package/dist/Functions/Input/Text.d.ts +0 -5
  144. package/dist/Functions/Input/Text.js +0 -340
  145. package/dist/Functions/Input/TextArea.d.ts +0 -1
  146. package/dist/Functions/Input/TextArea.js +0 -98
  147. package/dist/Functions/Input/Time/Picker.d.ts +0 -1
  148. package/dist/Functions/Input/Time/Picker.js +0 -581
  149. package/dist/Functions/Input/Time/_.d.ts +0 -2
  150. package/dist/Functions/Input/Time/_.js +0 -567
  151. package/dist/Functions/Input/_.d.ts +0 -5
  152. package/dist/Functions/Input/_.js +0 -446
  153. package/dist/Functions/Input/core.d.ts +0 -34
  154. package/dist/Functions/Input/core.js +0 -324
  155. package/dist/Functions/Inputs/_.d.ts +0 -3
  156. package/dist/Functions/Inputs/_.js +0 -7
  157. package/dist/Functions/Inputs/text.d.ts +0 -12
  158. package/dist/Functions/Inputs/text.js +0 -46
  159. package/dist/Functions/Layout/PageNotFound.d.ts +0 -1
  160. package/dist/Functions/Layout/PageNotFound.js +0 -30
  161. package/dist/Functions/Layout/PageRouter.d.ts +0 -2
  162. package/dist/Functions/Layout/PageRouter.js +0 -65
  163. package/dist/Functions/Layout/PageViewController/parts.d.ts +0 -1
  164. package/dist/Functions/Layout/PageViewController/parts.js +0 -31
  165. package/dist/Functions/Layout/Plate.d.ts +0 -1
  166. package/dist/Functions/Layout/Plate.js +0 -39
  167. package/dist/Functions/Layout/RootViewController/parts.d.ts +0 -1
  168. package/dist/Functions/Layout/RootViewController/parts.js +0 -202
  169. package/dist/Functions/Layout/SwipeView/parts.d.ts +0 -2
  170. package/dist/Functions/Layout/SwipeView/parts.js +0 -319
  171. package/dist/Functions/Layout/TabBar.d.ts +0 -1
  172. package/dist/Functions/Layout/TabBar.js +0 -49
  173. package/dist/Functions/Layout/_.d.ts +0 -2
  174. package/dist/Functions/Layout/_.js +0 -20
  175. package/dist/Functions/Loader/corner.d.ts +0 -1
  176. package/dist/Functions/Loader/corner.js +0 -59
  177. package/dist/Functions/Loader/mini.d.ts +0 -33
  178. package/dist/Functions/Loader/mini.js +0 -126
  179. package/dist/Functions/Loader/parts.d.ts +0 -3
  180. package/dist/Functions/Loader/parts.js +0 -108
  181. package/dist/Functions/Loader/top.d.ts +0 -1
  182. package/dist/Functions/Loader/top.js +0 -69
  183. package/dist/Functions/Sheet/parts.d.ts +0 -2
  184. package/dist/Functions/Sheet/parts.js +0 -724
  185. package/dist/Functions/SnackBar/parts.d.ts +0 -2
  186. package/dist/Functions/SnackBar/parts.js +0 -171
  187. package/dist/Functions/Table/Data/parts.d.ts +0 -3
  188. package/dist/Functions/Table/Data/parts.js +0 -629
  189. package/dist/Functions/Table/Drag/parts.d.ts +0 -1
  190. package/dist/Functions/Table/Drag/parts.js +0 -359
  191. package/dist/Functions/Table/Normal/parts.d.ts +0 -1
  192. package/dist/Functions/Table/Normal/parts.js +0 -92
  193. package/dist/Functions/Table/_.d.ts +0 -9
  194. package/dist/Functions/Table/_.js +0 -153
  195. package/dist/Functions/Tooltips/parts.d.ts +0 -2
  196. package/dist/Functions/Tooltips/parts.js +0 -71
  197. package/dist/Global/@export.d.ts +0 -12
  198. package/dist/Global/@export.js +0 -198
  199. package/dist/Global/LaunchReactApplication.d.ts +0 -1
  200. package/dist/Global/LaunchReactApplication.js +0 -48
  201. package/dist/Global/styleConverter.d.ts +0 -2
  202. package/dist/Global/styleConverter.js +0 -349
  203. package/dist/Molecules/@export.d.ts +0 -21
  204. package/dist/Molecules/@export.js +0 -41
  205. package/dist/Molecules/Accordion/parts.d.ts +0 -2
  206. package/dist/Molecules/Accordion/parts.js +0 -165
  207. package/dist/Molecules/LinkifyText/parts.d.ts +0 -1
  208. package/dist/Molecules/LinkifyText/parts.js +0 -39
  209. package/dist/Molecules/List.d.ts +0 -1
  210. package/dist/Molecules/List.js +0 -35
  211. package/dist/Organisms/@export.d.ts +0 -2
  212. package/dist/Organisms/@export.js +0 -5
  213. package/dist/Organisms/DisplayStyleInput/_.d.ts +0 -1
  214. package/dist/Organisms/DisplayStyleInput/_.js +0 -15
  215. package/dist/Organisms/DisplayStyleInput/darkmode.d.ts +0 -1
  216. package/dist/Organisms/DisplayStyleInput/darkmode.js +0 -77
  217. package/dist/Organisms/DisplayStyleInput/themeColor.d.ts +0 -27
  218. package/dist/Organisms/DisplayStyleInput/themeColor.js +0 -185
  219. package/dist/Templates/@export.d.ts +0 -2
  220. package/dist/Templates/@export.js +0 -5
  221. package/dist/Templates/PlayGround/parts.d.ts +0 -1
  222. package/dist/Templates/PlayGround/parts.js +0 -55
  223. package/dist/config.d.ts +0 -16
  224. package/dist/config.js +0 -171
  225. package/dist/launch.d.ts +0 -9
  226. package/dist/launch.js +0 -46
  227. package/dist/preload.d.ts +0 -1
  228. package/dist/preload.js +0 -73
  229. package/public/amotify.js +0 -1
  230. package/src/@types/_.tsx +0 -6
  231. package/src/Functions/@export.tsx +0 -29
  232. package/src/Functions/Inputs/types.d.ts +0 -1
  233. package/src/Global/exe.tsx +0 -0
  234. package/src/Organisms/@export.tsx +0 -5
  235. /package/{src/@types → @types}/module.tsx +0 -0
  236. /package/{src/@types → @types}/state.tsx +0 -0
  237. /package/src/@styles/{@variables/customProps.scss → props.scss} +0 -0
  238. /package/src/@styles/{@variables/themeColor.scss → themeColor.scss} +0 -0
  239. /package/src/@styles/{@variables/var.scss → var.scss} +0 -0
  240. /package/src/{Atoms → atoms}/FAIcon/parts.tsx +0 -0
  241. /package/src/{Atoms → atoms}/Various/parts.tsx +0 -0
  242. /package/src/{Functions → functions}/Button/_.tsx +0 -0
  243. /package/src/{Functions → functions}/Effects/Fade.tsx +0 -0
  244. /package/src/{Functions → functions}/Effects/Ripple.tsx +0 -0
  245. /package/src/{Functions → functions}/Effects/_.tsx +0 -0
  246. /package/src/{Functions → functions}/Input/Hidden.tsx +0 -0
  247. /package/src/{Functions → functions}/Input/Segmented/_.tsx +0 -0
  248. /package/src/{Functions → functions}/Input/Text.tsx +0 -0
  249. /package/src/{Functions → functions}/Input/TextArea.tsx +0 -0
  250. /package/src/{Functions → functions}/Inputs/_.tsx +0 -0
  251. /package/src/{Functions → functions}/Layout/Plate.tsx +0 -0
  252. /package/src/{Functions → functions}/Layout/_.tsx +0 -0
  253. /package/src/{Functions → functions}/Loader/corner.tsx +0 -0
  254. /package/src/{Functions → functions}/Loader/mini.tsx +0 -0
  255. /package/src/{Functions → functions}/Loader/parts.tsx +0 -0
  256. /package/src/{Functions → functions}/Loader/top.tsx +0 -0
  257. /package/src/{Global → global}/LaunchReactApplication.tsx +0 -0
  258. /package/src/{Molecules → molecules}/Accordion/parts.tsx +0 -0
  259. /package/src/{Molecules → molecules}/List.tsx +0 -0
  260. /package/src/{Organisms → organisms}/DisplayStyleInput/_.tsx +0 -0
@@ -1,567 +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
- Object.defineProperty(exports, "__esModule", { value: true });
41
- exports.TimeFNs = exports.TimeInput = void 0;
42
- var _global_1 = require("../../../Global/@export");
43
- var _atoms_1 = require("../../../Atoms/@export");
44
- var _functions_1 = require("../../@export");
45
- var core_1 = require("../core");
46
- var Picker_1 = require("./Picker");
47
- var useEffect = React.useEffect, useState = React.useState, useRef = React.useRef;
48
- var PeriodMargin = ' ~ ';
49
- var TimeFormatDatas = {
50
- clock: {
51
- defaultValue: '--:--', format: /^\d{2}\D\d{2}$/, ranges: [
52
- { type: 'hour', from: 0, length: 2 },
53
- { type: 'minute', from: 3, length: 2 }
54
- ], sets: 1
55
- },
56
- date: {
57
- defaultValue: '----/--/--', format: /^\d{4}\D\d{2}\D\d{2}$/, ranges: [
58
- { type: 'year', from: 0, length: 4 },
59
- { type: 'month', from: 5, length: 2 },
60
- { type: 'date', from: 8, length: 2 }
61
- ], sets: 1
62
- },
63
- week: {
64
- defaultValue: '----年第--週', format: /^\d{4}\D\d{2}$/, ranges: [
65
- { type: 'year', from: 0, length: 4, region: 6 },
66
- { type: 'week', from: 6, length: 2, region: 3 }
67
- ], sets: 1
68
- },
69
- month: {
70
- defaultValue: '----年--月', format: /^\d{4}\D\d{2}$/, ranges: [
71
- { type: 'year', from: 0, length: 4 },
72
- { type: 'month', from: 5, length: 2, region: 3 }
73
- ], sets: 1
74
- },
75
- year: {
76
- defaultValue: '----年', format: /^\d{4}$/, ranges: [
77
- { type: 'year', from: 0, length: 4, region: 5 }
78
- ], sets: 1
79
- },
80
- dates: {
81
- defaultValue: '----/--/--', format: /^\d{4}\D\d{2}\D\d{2}$/, ranges: [
82
- { type: 'year', from: 0, length: 4 },
83
- { type: 'month', from: 5, length: 2 },
84
- { type: 'date', from: 8, length: 2, region: 5 },
85
- { type: 'year', from: 10 + PeriodMargin.length, length: 4 },
86
- { type: 'month', from: 15 + PeriodMargin.length, length: 2 },
87
- { type: 'date', from: 18 + PeriodMargin.length, length: 2 }
88
- ], sets: 2
89
- },
90
- months: {
91
- defaultValue: '----年--月', format: /^\d{4}\D\d{2}$/, ranges: [
92
- { type: 'year', from: 0, length: 4 },
93
- { type: 'month', from: 5, length: 2, region: 6 },
94
- { type: 'year', from: 8 + PeriodMargin.length, length: 4 },
95
- { type: 'month', from: 13 + PeriodMargin.length, length: 2, region: 3 }
96
- ], sets: 2
97
- },
98
- dateWareki: {
99
- defaultValue: '----年--月--日', format: /^\d{4}\D\d{2}\D\d{2}$/, ranges: [
100
- { type: 'dateWareki', from: 0, length: 4, region: 5 },
101
- { type: 'month', from: 5, length: 2, region: 3 },
102
- { type: 'date', from: 8, length: 2, region: 3 }
103
- ], sets: 1
104
- }
105
- };
106
- var DataLeveling = function (params) {
107
- var restrict = params.restrict, value = params.value, era = params.era;
108
- var dataValue = $.flatArray(value || '');
109
- var _a = TimeFormatDatas[restrict], defaultValue = _a.defaultValue, format = _a.format, ranges = _a.ranges, sets = _a.sets;
110
- var formatValues = [];
111
- var separateStr = restrict == 'clock' ? ':' : '/';
112
- for (var index = 0; index < dataValue.length; index++) {
113
- dataValue[index] = String(dataValue[index]).replace(/\D/ig, separateStr);
114
- }
115
- var _loop_1 = function (index) {
116
- var val = dataValue[index] || '';
117
- if (!val.match(format)) {
118
- dataValue[index] = '';
119
- formatValues.push(defaultValue);
120
- }
121
- else {
122
- var _value_1 = defaultValue;
123
- val.split(/\D/).forEach(function (v, i) {
124
- if (i == 0 && restrict == 'dateWareki') {
125
- var Year = Number(v);
126
- if (era != 'year') {
127
- if (Year >= 2019)
128
- Year -= 2019;
129
- else if (Year >= 1989)
130
- Year -= 1989;
131
- else if (Year >= 1926)
132
- Year -= 1926;
133
- else if (Year >= 1912)
134
- Year -= 1912;
135
- else if (Year >= 1868)
136
- Year -= 1868;
137
- Year += 1;
138
- }
139
- v = Year.zeroEmbed(4);
140
- }
141
- _value_1 = _value_1.replace(new RegExp('------------------'.slice(0, v.length)), v);
142
- });
143
- formatValues.push(_value_1);
144
- }
145
- };
146
- for (var index = 0; index < sets; index++) {
147
- _loop_1(index);
148
- }
149
- return {
150
- formatValue: formatValues.join(PeriodMargin),
151
- dataValue: ['dates', 'months'].includes(restrict) ? dataValue : dataValue[0],
152
- ranges: ranges
153
- };
154
- };
155
- function DefaultValidation(props) {
156
- var params = props.params;
157
- var _a = params, restrict = _a.restrict, min = _a.min, max = _a.max, required = _a.required;
158
- var notice = [];
159
- var values = $.flatArray(props.value);
160
- var validate = {
161
- empty: false,
162
- escalated: 1,
163
- filled: true,
164
- correct: true,
165
- prohibited: false
166
- };
167
- (function () {
168
- var separateStr = restrict == 'clock' ? ':' : '/';
169
- for (var index = 0; index < values.length; index++) {
170
- values[index] = String(values[index]).replace(/\D/ig, separateStr);
171
- }
172
- for (var index = 0; index < values.length; index++) {
173
- var value = values[index];
174
- var prevValue = values[index - 1];
175
- if (!value.removeLetters())
176
- validate.empty = true;
177
- if (index > 0)
178
- validate.escalated &= Number(value >= prevValue);
179
- }
180
- if (!validate.escalated)
181
- return;
182
- if (validate.empty)
183
- return;
184
- if (restrict.match(/clock/)) {
185
- values.forEach(function (value) {
186
- var _a = __read(value.split(/\D+/), 2), hour = _a[0], minute = _a[1];
187
- if (!hour || !minute) {
188
- validate.filled = false;
189
- }
190
- else if (Number(hour) > 23 || Number(minute) > 59) {
191
- validate.correct = false;
192
- }
193
- });
194
- }
195
- else if (restrict.match(/date/)) {
196
- values.forEach(function (value) {
197
- var _a = __read(value.split(/\D+/), 3), year = _a[0], month = _a[1], day = _a[2];
198
- if (!year || !month || !day) {
199
- validate.filled = false;
200
- }
201
- else {
202
- var Time = $.Time(value);
203
- if (!Time.validate || value != Time.toFormatYMD()) {
204
- validate.correct = false;
205
- }
206
- }
207
- });
208
- }
209
- else if (restrict.match(/week/)) {
210
- values.forEach(function (value) {
211
- var _a = __read(value.split(/\D+/), 2), year = _a[0], week = _a[1];
212
- if (!year || !week) {
213
- validate.filled = false;
214
- }
215
- else {
216
- var yearFirstDay = $.Time(year + '/01/01').weekday;
217
- var yearFirstWeek0Day = $.Time(year + '/01/0' + (7 - yearFirstDay + 1));
218
- var yearValueWeek0Day = yearFirstWeek0Day.addWeek(Number(week) - 1);
219
- if (year != String(yearValueWeek0Day.year)) {
220
- validate.correct = false;
221
- }
222
- }
223
- });
224
- }
225
- else if (restrict.match(/month/)) {
226
- values.forEach(function (value) {
227
- var _a = __read(value.split(/\D+/), 2), year = _a[0], month = _a[1];
228
- if (!year || !month) {
229
- validate.filled = false;
230
- }
231
- else {
232
- var date = $.Time([year, month, '01'].join('/'));
233
- if (!date.validate)
234
- validate.correct = false;
235
- }
236
- });
237
- }
238
- else if (restrict.match(/year/)) {
239
- }
240
- if (validate.filled && validate.correct) {
241
- values.forEach(function (value) {
242
- {
243
- var VAL = Number(String(value).replace(/\D/ig, ''));
244
- if (min) {
245
- var MIN = Number(String(min).replace(/\D/ig, ''));
246
- if (MIN > VAL)
247
- validate.prohibited = true;
248
- }
249
- if (max) {
250
- var MAX = Number(String(max).replace(/\D/ig, ''));
251
- if (VAL > MAX)
252
- validate.prohibited = true;
253
- }
254
- }
255
- });
256
- }
257
- })();
258
- {
259
- var empty = validate.empty, escalated = validate.escalated, filled = validate.filled, correct = validate.correct, prohibited = validate.prohibited;
260
- if (empty && required) {
261
- notice = [
262
- { type: 'invalid', label: '必須項目です' }
263
- ];
264
- }
265
- if (!escalated) {
266
- notice.push({ type: 'invalid', label: '時系列を正しく入力してください' });
267
- }
268
- if (!correct) {
269
- notice.push({ type: 'invalid', label: '無効な値が入力されています' });
270
- }
271
- if (!filled) {
272
- notice.push({ type: 'invalid', label: '最後まで値を埋めてください' });
273
- }
274
- if (prohibited) {
275
- notice.push({
276
- type: 'invalid', label: React.createElement(React.Fragment, null,
277
- React.createElement(_atoms_1.Box, null, "\u5165\u529B\u7BC4\u56F2\u304C\u5236\u9650\u3055\u308C\u3066\u3044\u307E\u3059"),
278
- "[",
279
- min || '下限無し',
280
- "] ~ [",
281
- max || '上限無し',
282
- "]")
283
- });
284
- }
285
- }
286
- return {
287
- ok: !notice.filter(function (_a) {
288
- var type = _a.type;
289
- return type == 'invalid';
290
- }).length,
291
- notice: notice
292
- };
293
- }
294
- var TimeInput = function (params) {
295
- var tone = params.tone, required = params.required, _a = params.restrict, restrict = _a === void 0 ? 'clock' : _a, componentID = params.componentID, era = params.era, form = params.form, name = params.name, min = params.min, max = params.max, className = params.className, enableFormSubmit = params.enableFormSubmit, checkValidationAtFirst = params.checkValidationAtFirst, onKeyDown = params.onKeyDown, onValidate = params.onValidate, onUpdateValue = params.onUpdateValue, onUpdateValidValue = params.onUpdateValidValue, _b = params.value, value = _b === void 0 ? '' : _b, leftIndicator = params.leftIndicator, rightIndicator = params.rightIndicator, others = __rest(params, ["tone", "required", "restrict", "componentID", "era", "form", "name", "min", "max", "className", "enableFormSubmit", "checkValidationAtFirst", "onKeyDown", "onValidate", "onUpdateValue", "onUpdateValidValue", "value", "leftIndicator", "rightIndicator"]);
296
- var _c = __read(useState(era), 2), val_era = _c[0], set_era = _c[1];
297
- var _d = __read(useState(__assign(__assign({ componentID: params.componentID || '' }, DataLeveling({
298
- restrict: restrict,
299
- value: value,
300
- era: val_era
301
- })), { eventType: 'init', eventID: $.uuidGen() })), 2), val_status = _d[0], set_status = _d[1];
302
- var _e = __read(useState({
303
- ok: false,
304
- notice: []
305
- }), 2), val_validate = _e[0], set_validate = _e[1];
306
- var _f = __read(useState({
307
- active: false,
308
- index: 0,
309
- prevIndex: -1
310
- }), 2), val_focus = _f[0], set_focus = _f[1];
311
- (0, core_1.CommonEffects)({
312
- type: 'time',
313
- params: params,
314
- val_status: val_status,
315
- set_status: set_status,
316
- val_validate: val_validate,
317
- set_validate: set_validate,
318
- DefaultValidation: DefaultValidation,
319
- onUpdateValue: onUpdateValue,
320
- onUpdateValidValue: onUpdateValidValue,
321
- ExtraOverrideParams: __assign({}, DataLeveling({
322
- restrict: restrict,
323
- value: value,
324
- era: val_era
325
- }))
326
- });
327
- var mounted = useRef(false);
328
- useEffect(function () {
329
- if (mounted.current) {
330
- set_status(__assign(__assign({}, val_status), DataLeveling({
331
- restrict: restrict,
332
- value: val_status.dataValue,
333
- era: val_era
334
- })));
335
- }
336
- else {
337
- mounted.current = true;
338
- }
339
- }, [val_era]);
340
- _global_1.useStore.update({
341
- key: val_status.componentID,
342
- value: {
343
- openPicker: function () {
344
- if (params.disabled)
345
- return;
346
- exports.TimeFNs.picker.launch({
347
- parent: '#Picker-' + val_status.componentID,
348
- tipsID: 'PickerTips-' + val_status.componentID,
349
- restrict: restrict,
350
- min: min,
351
- max: max,
352
- defaultValue: val_status.dataValue,
353
- onValueUpdate: function (value) {
354
- set_status(__assign(__assign(__assign({}, val_status), DataLeveling({
355
- restrict: restrict,
356
- value: value,
357
- era: val_era
358
- })), { eventType: 'update', eventID: $.uuidGen() }));
359
- }
360
- });
361
- },
362
- resetEra: function (era) {
363
- set_era(era);
364
- set_status(__assign(__assign(__assign({}, val_status), DataLeveling({
365
- restrict: restrict,
366
- value: '',
367
- era: val_era
368
- })), { eventType: 'update', eventID: $.uuidGen() }));
369
- }
370
- }
371
- });
372
- useEffect(function () {
373
- var index = val_focus.index, active = val_focus.active;
374
- if (active) {
375
- index = Math.max(index, 0);
376
- index = Math.min(index, val_status.ranges.length - 1);
377
- var _a = val_status.ranges[index], from = _a.from, length_1 = _a.length;
378
- var input = $('#' + params.id)[0];
379
- if (input)
380
- input.setSelectionRange(from, (from + length_1));
381
- }
382
- }, [val_focus]);
383
- return (React.createElement(core_1.BoxWrapper, { val_status: val_status, set_status: set_status, val_validate: val_validate, params: params },
384
- React.createElement(_functions_1.Input.Hidden, { name: name, "data-input-type": 'time', "data-form": form, "data-validation": val_validate.ok, componentID: val_status.componentID, "data-value": JSON.stringify(['dates', 'months'].includes(restrict) ?
385
- !val_status.dataValue[0] || !val_status.dataValue[1] ? null
386
- : val_status.dataValue
387
- : (val_status.dataValue || null)) }),
388
- amotify.config.device.isTouchDevice ?
389
- React.createElement(_functions_1.Buttons.Button.Plain, { className: className, freeCSS: {
390
- textAlign: 'left'
391
- }, children: val_status.formatValue, onClick: function (event) {
392
- var component = _global_1.useStore.get(val_status.componentID);
393
- if (component)
394
- component.openPicker();
395
- event.stopPropagation();
396
- } }) : React.createElement("input", __assign({ type: 'text', inputMode: 'numeric', "data-input-type": 'time', "data-form-name": form, value: val_status.formatValue, className: className, tabIndex: amotify.config.device.isTouchDevice ? -1 : 0, onKeyDown: function (event) {
397
- KeyDownEvent({
398
- restrict: restrict,
399
- event: event,
400
- val_era: val_era,
401
- val_status: val_status,
402
- set_status: set_status,
403
- val_focus: val_focus,
404
- set_focus: set_focus
405
- });
406
- if (onKeyDown)
407
- onKeyDown(event);
408
- if (enableFormSubmit)
409
- (0, core_1.SubmitForm)(event);
410
- }, onKeyUp: function (event) {
411
- if (event.key == 'Tab')
412
- set_focus(__assign(__assign({}, val_focus), { active: true }));
413
- }, onClick: function (event) {
414
- var caretTo = event.target.selectionEnd;
415
- var Index = 0;
416
- val_status.ranges.forEach(function (range, index) {
417
- var from = range.from, length = range.length, region = range.region;
418
- if (from <= caretTo && caretTo <= (from + (region || length))) {
419
- Index = index;
420
- }
421
- });
422
- set_focus(__assign(__assign({}, val_focus), { active: true, index: Index }));
423
- event.preventDefault();
424
- } }, others))));
425
- };
426
- exports.TimeInput = TimeInput;
427
- var KeyDownEvent = function (props) {
428
- var val_era = props.val_era, restrict = props.restrict, event = props.event, val_status = props.val_status, set_status = props.set_status, val_focus = props.val_focus, set_focus = props.set_focus;
429
- var key = event.key, shiftKey = event.shiftKey, ctrlKey = event.ctrlKey, metaKey = event.metaKey;
430
- var auxKey = ctrlKey || metaKey;
431
- var _a = event.target, caretFrom = _a.selectionStart, caretTo = _a.selectionEnd;
432
- var currentFocusIndex = val_focus.index, prevFocusIndex = val_focus.prevIndex;
433
- var ranges = val_status.ranges, formatValue = val_status.formatValue;
434
- var maxFocusIndex = ranges.length - 1;
435
- if (['Tab', 'ArrowLeft', 'ArrowRight'].includes(key)) {
436
- var nextFocusIndex = 0;
437
- if (key == 'Tab') {
438
- var direction = Number(!shiftKey) * 2 - 1;
439
- nextFocusIndex = val_focus.index + direction;
440
- if (nextFocusIndex < 0 || nextFocusIndex > maxFocusIndex)
441
- return;
442
- }
443
- else {
444
- var direction = key == 'ArrowLeft' ? -1 : key == 'ArrowRight' ? 1 : 0;
445
- if (auxKey) {
446
- nextFocusIndex = direction == 1 ? maxFocusIndex : 0;
447
- }
448
- else {
449
- if (caretFrom == 0 && caretTo == String(val_status.formatValue).length) {
450
- nextFocusIndex = direction == 1 ? maxFocusIndex : 0;
451
- }
452
- else {
453
- nextFocusIndex = Math.max(0, Math.min(currentFocusIndex + direction, maxFocusIndex));
454
- }
455
- }
456
- }
457
- set_focus(__assign(__assign({}, val_focus), { index: nextFocusIndex, prevIndex: currentFocusIndex }));
458
- event.preventDefault();
459
- }
460
- if (['Backspace', 'ArrowUp', 'ArrowDown', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'].includes(key)) {
461
- event.preventDefault();
462
- var nextFocusIndex = currentFocusIndex;
463
- nextFocusIndex = Math.max(nextFocusIndex, 0);
464
- nextFocusIndex = Math.min(nextFocusIndex, maxFocusIndex);
465
- var _b = ranges[nextFocusIndex], type = _b.type, from = _b.from, length_2 = _b.length;
466
- var prevValue = formatValue.slice(from, (from + length_2));
467
- var partsValue = void 0;
468
- if (key == 'Backspace') {
469
- partsValue = '------'.slice(0, length_2);
470
- }
471
- else if (['ArrowUp', 'ArrowDown'].includes(key)) {
472
- var direction = key == 'ArrowUp' ? 1 : -1;
473
- prevValue = prevValue | 0;
474
- partsValue = prevValue + direction;
475
- var _c = __read(type == 'dateWareki' ?
476
- val_era == 'year' ? [0, 2999, 4]
477
- : val_era == 'reiwa' ? [1, 2999, 4]
478
- : val_era == 'heisei' ? [1, 31, 4]
479
- : val_era == 'shouwa' ? [1, 64, 4]
480
- : val_era == 'taisho' ? [1, 15, 4]
481
- : val_era == 'meiji' ? [1, 45, 4] : [0, 0, 0]
482
- : type == 'minute' ? [0, 59, 2]
483
- : type == 'hour' ? [0, 23, 2]
484
- : type == 'date' ? [1, 31, 2]
485
- : type == 'week' ? [1, 53, 2]
486
- : type == 'month' ? [1, 12, 2]
487
- : type == 'year' ? [0, 2999, 4] : [0, 0, 0], 3), min = _c[0], max = _c[1], range = _c[2];
488
- if (partsValue > max)
489
- partsValue = min;
490
- else if (partsValue < min)
491
- partsValue = max;
492
- partsValue = (Number(partsValue)).zeroEmbed(range);
493
- }
494
- else if (['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'].includes(key)) {
495
- var prev = prevValue | 0;
496
- var add = key;
497
- var compound = "".concat(prev).concat(add);
498
- if (prevFocusIndex != currentFocusIndex && prevFocusIndex >= 0) {
499
- prev = 0, compound = '0' + add;
500
- }
501
- if (type == 'year' || (type == 'dateWareki' && val_era == 'year')) {
502
- if (Number(compound) > 10000)
503
- partsValue = add;
504
- else
505
- partsValue = compound;
506
- if ((partsValue | 0) > 1000)
507
- nextFocusIndex++;
508
- }
509
- else if (['hour', 'minute', 'date', 'week', 'month'].includes(type) ||
510
- (type == 'dateWareki' && val_era != 'year')) {
511
- var base = type == 'dateWareki' ?
512
- val_era == 'reiwa' ? 100
513
- : val_era == 'heisei' ? 31
514
- : val_era == 'shouwa' ? 64
515
- : val_era == 'taisho' ? 15
516
- : val_era == 'meiji' ? 45 : 0
517
- : type == 'minute' ? 59
518
- : type == 'hour' ? 23
519
- : type == 'date' ? 31
520
- : type == 'week' ? 53
521
- : type == 'month' ? 12 : 0;
522
- partsValue = (compound | 0) > base ? add : compound;
523
- if (Number(add) > Number(String(base)[0]) ||
524
- (prevValue == '0000'.slice(0, String(base).length) && (compound != '0000'.slice(0, String(base).length) ||
525
- (['minute', 'hour'].includes(type) && prevFocusIndex == currentFocusIndex))) || (compound | 0) >= (Math.pow(10, (String(base).length - 1))))
526
- nextFocusIndex++;
527
- }
528
- if (type == 'year' || type == 'dateWareki')
529
- partsValue = (partsValue | 0).zeroEmbed(4);
530
- else
531
- partsValue = (partsValue | 0).zeroEmbed(2);
532
- }
533
- {
534
- var nextFormatValue = String(formatValue).partReplace(from, String(partsValue));
535
- var nextDataValue = nextFormatValue.split(PeriodMargin).map(function (value) {
536
- return value.replace(/(^\D|\D$)/, '').split(/\D+/).join(restrict == 'clock' ? ':' : '/');
537
- });
538
- if (restrict == 'dateWareki') {
539
- var v = nextDataValue[0].split(/\D/);
540
- var _d = __read(v, 3), year = _d[0], month = _d[1], day = _d[2];
541
- if (v.length == 3 && year) {
542
- var yearYear = Number(year) - 1 + Number({
543
- year: 1, reiwa: 2019, heisei: 1989, shouwa: 1926, taisho: 1912, meiji: 1868
544
- }[val_era]);
545
- nextDataValue = [[yearYear, month, day].join('/')];
546
- }
547
- }
548
- nextFocusIndex = Math.max(nextFocusIndex, 0);
549
- nextFocusIndex = Math.min(nextFocusIndex, maxFocusIndex);
550
- set_status(__assign(__assign({}, val_status), { dataValue: ['dates', 'months'].includes(restrict) ? nextDataValue : nextDataValue[0], formatValue: nextFormatValue, eventType: 'update', eventID: $.uuidGen() }));
551
- set_focus(__assign(__assign({}, val_focus), { index: nextFocusIndex, prevIndex: val_focus.index }));
552
- }
553
- }
554
- };
555
- exports.TimeFNs = {
556
- picker: {
557
- launch: function (params) {
558
- var tipsID = params.tipsID || $.uuidGen();
559
- _functions_1.Tooltips.open(__assign(__assign({ gravityPoint: params.gravityPoint || 24, padding: [1, 0], tipsID: tipsID }, params), { closeOption: __assign({ aroundClick: true, elementBlur: false }, params.closeOption), content: React.createElement(Picker_1.Picker, { restrict: params.restrict, min: params.min, max: params.max, defaultValue: params.defaultValue, tipsID: tipsID, onValueUpdate: function (value) {
560
- params.onValueUpdate(value);
561
- } }) }));
562
- },
563
- remove: function (tipsID) {
564
- _functions_1.Tooltips.close(tipsID);
565
- }
566
- }
567
- };
@@ -1,5 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const ListInputs: amotify.fn.Input.List.Methods & {
3
- Origin: (props: amotify.fn.Input.List.OriginParams) => JSX.Element;
4
- };
5
- export declare const Input: amotify.fn.Input.Methods;