amotify 0.0.65 → 0.0.67

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 (275) hide show
  1. package/dist/amotify.js +3 -2
  2. package/dist/amotify.min.css +2 -2
  3. package/dist/coreVender.js +14 -2
  4. package/dist/node_modules/@fortawesome/free-regular-svg-icons/faCalendarAlt.d.ts +7 -0
  5. package/dist/node_modules/@fortawesome/free-regular-svg-icons/faCalendarDays.d.ts +14 -0
  6. package/dist/node_modules/@fortawesome/free-regular-svg-icons/faClock.d.ts +14 -0
  7. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faAngleDown.d.ts +14 -0
  8. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faAngleLeft.d.ts +14 -0
  9. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faAngleRight.d.ts +14 -0
  10. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faAngleUp.d.ts +14 -0
  11. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faArrowDown.d.ts +14 -0
  12. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faArrowLeft.d.ts +14 -0
  13. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faArrowRight.d.ts +14 -0
  14. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faArrowRotateRight.d.ts +14 -0
  15. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faArrowUp.d.ts +14 -0
  16. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faBars.d.ts +14 -0
  17. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faBarsStaggered.d.ts +14 -0
  18. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faCaretDown.d.ts +14 -0
  19. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faCaretLeft.d.ts +14 -0
  20. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faCaretRight.d.ts +14 -0
  21. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faCaretUp.d.ts +14 -0
  22. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faCheck.d.ts +14 -0
  23. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faCheckCircle.d.ts +7 -0
  24. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faChevronDown.d.ts +14 -0
  25. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faChevronLeft.d.ts +14 -0
  26. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faChevronRight.d.ts +14 -0
  27. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faChevronUp.d.ts +14 -0
  28. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faCircleCheck.d.ts +14 -0
  29. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faCircleQuestion.d.ts +14 -0
  30. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faCloudArrowUp.d.ts +14 -0
  31. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faCopy.d.ts +14 -0
  32. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faDownload.d.ts +14 -0
  33. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faEdit.d.ts +7 -0
  34. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faEllipsis.d.ts +14 -0
  35. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faEllipsisH.d.ts +7 -0
  36. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faEllipsisV.d.ts +7 -0
  37. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faEllipsisVertical.d.ts +14 -0
  38. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faExclamation.d.ts +14 -0
  39. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faExclamationTriangle.d.ts +7 -0
  40. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faExternalLinkAlt.d.ts +7 -0
  41. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faEye.d.ts +14 -0
  42. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faFile.d.ts +14 -0
  43. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faFilter.d.ts +14 -0
  44. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faGear.d.ts +14 -0
  45. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faGripVertical.d.ts +14 -0
  46. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faHeart.d.ts +14 -0
  47. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faHome.d.ts +7 -0
  48. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faHouse.d.ts +14 -0
  49. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faImage.d.ts +14 -0
  50. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faLink.d.ts +14 -0
  51. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faLinkSlash.d.ts +14 -0
  52. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faMagnifyingGlass.d.ts +14 -0
  53. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faMinus.d.ts +14 -0
  54. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faPalette.d.ts +14 -0
  55. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faPaperPlane.d.ts +14 -0
  56. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faPen.d.ts +14 -0
  57. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faPenToSquare.d.ts +14 -0
  58. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faPlus.d.ts +14 -0
  59. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faQuestion.d.ts +14 -0
  60. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faQuestionCircle.d.ts +7 -0
  61. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faRedo.d.ts +7 -0
  62. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faRotate.d.ts +14 -0
  63. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faRotateLeft.d.ts +14 -0
  64. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faRotateRight.d.ts +14 -0
  65. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faSearch.d.ts +7 -0
  66. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faShare.d.ts +14 -0
  67. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faStar.d.ts +14 -0
  68. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faTimes.d.ts +7 -0
  69. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faTrashAlt.d.ts +7 -0
  70. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faTrashCan.d.ts +14 -0
  71. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faTriangleExclamation.d.ts +14 -0
  72. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faUpRightFromSquare.d.ts +14 -0
  73. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faUser.d.ts +14 -0
  74. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faXmark.d.ts +14 -0
  75. package/dist/node_modules/@fortawesome/free-solid-svg-icons/faYenSign.d.ts +14 -0
  76. package/dist/node_modules/@fortawesome/react-fontawesome/index.es.d.ts +2 -0
  77. package/dist/node_modules/@remix-run/router/dist/router.d.ts +317 -0
  78. package/dist/node_modules/css-loader/dist/runtime/api.d.ts +2 -0
  79. package/dist/node_modules/css-loader/dist/runtime/noSourceMaps.d.ts +2 -0
  80. package/dist/node_modules/jsmin-front/dist/jsmin.d.ts +3 -0
  81. package/dist/node_modules/prop-types/factoryWithThrowingShims.d.ts +86 -0
  82. package/dist/node_modules/prop-types/index.d.ts +2 -0
  83. package/dist/node_modules/prop-types/lib/ReactPropTypesSecret.d.ts +2 -0
  84. package/dist/node_modules/react/cjs/react.production.min.d.ts +116 -0
  85. package/dist/node_modules/react/index.d.ts +2 -0
  86. package/dist/node_modules/react-dom/cjs/react-dom.production.min.d.ts +37 -0
  87. package/dist/node_modules/react-dom/client.d.ts +2 -0
  88. package/dist/node_modules/react-dom/index.d.ts +2 -0
  89. package/dist/node_modules/react-router/dist/index.d.ts +241 -0
  90. package/dist/node_modules/react-router-dom/dist/index.d.ts +139 -0
  91. package/dist/node_modules/scheduler/cjs/scheduler.production.min.d.ts +20 -0
  92. package/dist/node_modules/scheduler/index.d.ts +2 -0
  93. package/dist/src/@atoms.d.ts +4 -0
  94. package/dist/src/@declations/_.d.ts +23 -0
  95. package/dist/src/@declations/amotify.d.ts +1358 -0
  96. package/dist/src/@declations/jsminAmotifyExtension.d.ts +132 -0
  97. package/dist/src/@declations/module.d.ts +1 -0
  98. package/dist/src/@declations/styles.d.ts +145 -0
  99. package/dist/src/@functions.d.ts +12 -0
  100. package/dist/src/@global.d.ts +23 -0
  101. package/dist/src/@jsminAmotifyExtension/_.d.ts +4 -0
  102. package/dist/src/@jsminAmotifyExtension/fetch.d.ts +1 -0
  103. package/dist/src/@jsminAmotifyExtension/formCollect.d.ts +1 -0
  104. package/dist/src/@jsminAmotifyExtension/spreadSheet.d.ts +4 -0
  105. package/dist/src/@jsminAmotifyExtension/variables.d.ts +1 -0
  106. package/dist/src/@molecules.d.ts +23 -0
  107. package/dist/src/@organisms.d.ts +1 -0
  108. package/dist/src/@templates.d.ts +2 -0
  109. package/dist/src/@variables.d.ts +8 -0
  110. package/dist/src/atoms/FAI/parts.d.ts +3 -0
  111. package/dist/src/atoms/Logo/parts.d.ts +2 -0
  112. package/dist/src/atoms/Various/parts.d.ts +11 -0
  113. package/dist/src/config.d.ts +19 -0
  114. package/dist/src/functions/Button/_.d.ts +2 -0
  115. package/dist/src/functions/Cropper/parts.d.ts +2 -0
  116. package/dist/src/functions/Effects/Fade.d.ts +2 -0
  117. package/dist/src/functions/Effects/Ripple.d.ts +1 -0
  118. package/dist/src/functions/Effects/_.d.ts +4 -0
  119. package/dist/src/functions/Input/Chips/Selector.d.ts +2 -0
  120. package/dist/src/functions/Input/Chips/_.d.ts +3 -0
  121. package/dist/src/functions/Input/Contenteditable.d.ts +4 -0
  122. package/dist/src/functions/Input/DigitCharacters.d.ts +4 -0
  123. package/dist/src/functions/Input/File/_.d.ts +3 -0
  124. package/dist/src/functions/Input/Hidden.d.ts +3 -0
  125. package/dist/src/functions/Input/List/_.d.ts +4 -0
  126. package/dist/src/functions/Input/RichSelect/_.d.ts +4 -0
  127. package/dist/src/functions/Input/Segmented/_.d.ts +2 -0
  128. package/dist/src/functions/Input/Select/_.d.ts +4 -0
  129. package/dist/src/functions/Input/Slider/_.d.ts +4 -0
  130. package/dist/src/functions/Input/Switch/_.d.ts +4 -0
  131. package/dist/src/functions/Input/Text.d.ts +8 -0
  132. package/dist/src/functions/Input/TextArea.d.ts +4 -0
  133. package/dist/src/functions/Input/Time/Picker.d.ts +4 -0
  134. package/dist/src/functions/Input/Time/_.d.ts +5 -0
  135. package/dist/src/functions/Input/_.d.ts +6 -0
  136. package/dist/src/functions/Input/core.d.ts +36 -0
  137. package/dist/src/functions/Inputs/_.d.ts +4 -0
  138. package/dist/src/functions/Inputs/text.d.ts +3 -0
  139. package/dist/src/functions/Layout/PageNotFound.d.ts +2 -0
  140. package/dist/src/functions/Layout/PageRouter.d.ts +4 -0
  141. package/dist/src/functions/Layout/PageViewController/parts.d.ts +4 -0
  142. package/dist/src/functions/Layout/Plate.d.ts +3 -0
  143. package/dist/src/functions/Layout/RootViewController/parts.d.ts +2 -0
  144. package/dist/src/functions/Layout/SwipeView/parts.d.ts +5 -0
  145. package/dist/src/functions/Layout/TabBar.d.ts +4 -0
  146. package/dist/src/functions/Layout/_.d.ts +3 -0
  147. package/dist/src/functions/Loader/corner.d.ts +3 -0
  148. package/dist/src/functions/Loader/mini.d.ts +7 -0
  149. package/dist/src/functions/Loader/parts.d.ts +4 -0
  150. package/dist/src/functions/Loader/top.d.ts +3 -0
  151. package/dist/src/functions/Sheet/parts.d.ts +3 -0
  152. package/dist/src/functions/SnackBar/parts.d.ts +3 -0
  153. package/dist/src/functions/Table/Data/parts.d.ts +6 -0
  154. package/dist/src/functions/Table/Drag/parts.d.ts +4 -0
  155. package/dist/src/functions/Table/Normal/parts.d.ts +3 -0
  156. package/dist/src/functions/Table/_.d.ts +10 -0
  157. package/dist/src/functions/Tooltips/parts.d.ts +3 -0
  158. package/dist/src/global/LaunchReactApplication.d.ts +3 -0
  159. package/dist/src/global/styleConverter.d.ts +3 -0
  160. package/dist/src/launch.d.ts +10 -0
  161. package/dist/src/molecules/Accordion/parts.d.ts +3 -0
  162. package/dist/src/molecules/LinkifyText/parts.d.ts +3 -0
  163. package/dist/src/molecules/List.d.ts +3 -0
  164. package/dist/src/templates/PlayGround/parts.d.ts +2 -0
  165. package/package.json +10 -10
  166. package/tsconfig.json +14 -7
  167. package/@types/_.tsx +0 -7
  168. package/@types/amot.tsx +0 -355
  169. package/@types/fn.tsx +0 -1280
  170. package/@types/jsminAmotifyExtension.tsx +0 -137
  171. package/@types/module.tsx +0 -1
  172. package/@types/state.tsx +0 -231
  173. package/src/@atoms.tsx +0 -34
  174. package/src/@functions.tsx +0 -29
  175. package/src/@global.tsx +0 -145
  176. package/src/@jsminAmotifyExtension/_.tsx +0 -4
  177. package/src/@jsminAmotifyExtension/fetch.tsx +0 -110
  178. package/src/@jsminAmotifyExtension/formCollect.tsx +0 -94
  179. package/src/@jsminAmotifyExtension/spreadSheet.tsx +0 -165
  180. package/src/@jsminAmotifyExtension/variables.tsx +0 -137
  181. package/src/@molecules.tsx +0 -96
  182. package/src/@organisms.tsx +0 -1
  183. package/src/@reactPacks/reactProduction@18.2.0.js +0 -79
  184. package/src/@reactPacks/reactRouterDomProduction@18.2.0.js +0 -31
  185. package/src/@styles/@app.scss +0 -4
  186. package/src/@styles/UniStyling.scss +0 -1028
  187. package/src/@styles/init.scss +0 -94
  188. package/src/@styles/props.scss +0 -109
  189. package/src/@styles/styleSet.scss +0 -38
  190. package/src/@styles/themeColor.scss +0 -71
  191. package/src/@styles/var.scss +0 -182
  192. package/src/@templates.tsx +0 -7
  193. package/src/@variables.tsx +0 -74
  194. package/src/atoms/FAI/parts.tsx +0 -139
  195. package/src/atoms/Logo/parts.tsx +0 -335
  196. package/src/atoms/Logo/style.module.scss +0 -96
  197. package/src/atoms/Various/parts.tsx +0 -159
  198. package/src/atoms/Various/style.module.scss +0 -46
  199. package/src/config.tsx +0 -191
  200. package/src/functions/Button/_.tsx +0 -331
  201. package/src/functions/Button/style.module.scss +0 -157
  202. package/src/functions/Cropper/parts.tsx +0 -1084
  203. package/src/functions/Cropper/style.module.scss +0 -64
  204. package/src/functions/Effects/Fade.tsx +0 -76
  205. package/src/functions/Effects/Ripple.tsx +0 -141
  206. package/src/functions/Effects/_.tsx +0 -33
  207. package/src/functions/Effects/style.module.scss +0 -91
  208. package/src/functions/Input/Chips/Selector.tsx +0 -445
  209. package/src/functions/Input/Chips/_.tsx +0 -289
  210. package/src/functions/Input/Chips/style.module.scss +0 -6
  211. package/src/functions/Input/Contenteditable.tsx +0 -114
  212. package/src/functions/Input/DigitCharacters.tsx +0 -235
  213. package/src/functions/Input/File/_.tsx +0 -553
  214. package/src/functions/Input/File/style.module.scss +0 -34
  215. package/src/functions/Input/Hidden.tsx +0 -21
  216. package/src/functions/Input/List/_.tsx +0 -383
  217. package/src/functions/Input/List/style.module.scss +0 -84
  218. package/src/functions/Input/RichSelect/_.tsx +0 -230
  219. package/src/functions/Input/RichSelect/style.module.scss +0 -11
  220. package/src/functions/Input/Segmented/_.tsx +0 -246
  221. package/src/functions/Input/Segmented/style.module.scss +0 -81
  222. package/src/functions/Input/Select/_.tsx +0 -218
  223. package/src/functions/Input/Select/style.module.scss +0 -11
  224. package/src/functions/Input/Slider/_.tsx +0 -524
  225. package/src/functions/Input/Slider/style.module.scss +0 -67
  226. package/src/functions/Input/Switch/_.tsx +0 -176
  227. package/src/functions/Input/Switch/style.module.scss +0 -18
  228. package/src/functions/Input/Text.tsx +0 -487
  229. package/src/functions/Input/TextArea.tsx +0 -109
  230. package/src/functions/Input/Time/Picker.tsx +0 -1361
  231. package/src/functions/Input/Time/_.tsx +0 -749
  232. package/src/functions/Input/Time/style.module.scss +0 -79
  233. package/src/functions/Input/_.tsx +0 -881
  234. package/src/functions/Input/core.tsx +0 -473
  235. package/src/functions/Input/style.module.scss +0 -102
  236. package/src/functions/Inputs/_.tsx +0 -5
  237. package/src/functions/Inputs/style.module.scss +0 -15
  238. package/src/functions/Inputs/text.tsx +0 -53
  239. package/src/functions/Inputs/types.d.ts +0 -13
  240. package/src/functions/Layout/PageNotFound.tsx +0 -78
  241. package/src/functions/Layout/PageRouter.tsx +0 -89
  242. package/src/functions/Layout/PageViewController/parts.tsx +0 -27
  243. package/src/functions/Layout/Plate.tsx +0 -30
  244. package/src/functions/Layout/RootViewController/parts.tsx +0 -300
  245. package/src/functions/Layout/RootViewController/style.module.scss +0 -23
  246. package/src/functions/Layout/SwipeView/parts.tsx +0 -375
  247. package/src/functions/Layout/SwipeView/style.module.scss +0 -20
  248. package/src/functions/Layout/TabBar.tsx +0 -60
  249. package/src/functions/Layout/_.tsx +0 -20
  250. package/src/functions/Loader/corner.tsx +0 -74
  251. package/src/functions/Loader/mini.tsx +0 -114
  252. package/src/functions/Loader/parts.tsx +0 -103
  253. package/src/functions/Loader/style.module.scss +0 -223
  254. package/src/functions/Loader/top.tsx +0 -84
  255. package/src/functions/Sheet/parts.tsx +0 -994
  256. package/src/functions/Sheet/style.module.scss +0 -208
  257. package/src/functions/SnackBar/parts.tsx +0 -215
  258. package/src/functions/SnackBar/style.module.scss +0 -25
  259. package/src/functions/Table/Data/parts.tsx +0 -965
  260. package/src/functions/Table/Drag/parts.tsx +0 -442
  261. package/src/functions/Table/Normal/parts.tsx +0 -124
  262. package/src/functions/Table/_.tsx +0 -177
  263. package/src/functions/Table/style.module.scss +0 -93
  264. package/src/functions/Tooltips/parts.tsx +0 -53
  265. package/src/global/LaunchReactApplication.tsx +0 -40
  266. package/src/global/styleConverter.tsx +0 -465
  267. package/src/launch.tsx +0 -117
  268. package/src/molecules/Accordion/parts.tsx +0 -146
  269. package/src/molecules/Accordion/style.module.scss +0 -13
  270. package/src/molecules/LinkifyText/parts.tsx +0 -52
  271. package/src/molecules/List.tsx +0 -31
  272. package/src/preload.tsx +0 -31
  273. package/src/templates/PlayGround/parts.tsx +0 -96
  274. package/src/templates/PlayGround/style.module.scss +0 -38
  275. package/webpack.config.js +0 -146
@@ -1,749 +0,0 @@
1
- import {
2
- useStore,
3
- React
4
- } from '@global'
5
- import {
6
- Box
7
- } from '@atoms'
8
- import {
9
- Input,
10
- Buttons,
11
- Tooltips
12
- } from '@fn'
13
-
14
- import {
15
- BoxWrapper,
16
- SubmitForm,
17
- ValidationCheck,
18
- CommonEffects
19
- } from '../core'
20
- import { Picker } from './Picker'
21
-
22
- const PeriodMargin = ' ~ '
23
-
24
- const TimeFormatDatas: {
25
- [ key: string ]: {
26
- defaultValue: string
27
- format: RegExp
28
- ranges: amotify.fn.Input.Time.RangeProps[]
29
- sets: number
30
- }
31
- } = {
32
- clock: {
33
- defaultValue: '--:--',format: /^\d{2}\D\d{2}$/,ranges: [
34
- { type: 'hour',from: 0,length: 2 },
35
- { type: 'minute',from: 3,length: 2 }
36
- ],sets: 1
37
- },
38
- date: {
39
- defaultValue: '----/--/--',format: /^\d{4}\D\d{2}\D\d{2}$/,ranges: [
40
- { type: 'year',from: 0,length: 4 },
41
- { type: 'month',from: 5,length: 2 },
42
- { type: 'date',from: 8,length: 2 }
43
- ],sets: 1
44
- },
45
- week: {
46
- defaultValue: '----年第--週',format: /^\d{4}\D\d{2}$/,ranges: [
47
- { type: 'year',from: 0,length: 4,region: 6 },
48
- { type: 'week',from: 6,length: 2,region: 3 }
49
- ],sets: 1
50
- },
51
- month: {
52
- defaultValue: '----年--月',format: /^\d{4}\D\d{2}$/,ranges: [
53
- { type: 'year',from: 0,length: 4 },
54
- { type: 'month',from: 5,length: 2,region: 3 }
55
- ],sets: 1
56
- },
57
- year: {
58
- defaultValue: '----年',format: /^\d{4}$/,ranges: [
59
- { type: 'year',from: 0,length: 4,region: 5 }
60
- ],sets: 1
61
- },
62
- dates: {
63
- defaultValue: '----/--/--',format: /^\d{4}\D\d{2}\D\d{2}$/,ranges: [
64
- { type: 'year',from: 0,length: 4 },
65
- { type: 'month',from: 5,length: 2 },
66
- { type: 'date',from: 8,length: 2,region: 5 },
67
- { type: 'year',from: 10 + PeriodMargin.length,length: 4 },
68
- { type: 'month',from: 15 + PeriodMargin.length,length: 2 },
69
- { type: 'date',from: 18 + PeriodMargin.length,length: 2 }
70
- ],sets: 2
71
- },
72
- months: {
73
- defaultValue: '----年--月',format: /^\d{4}\D\d{2}$/,ranges: [
74
- { type: 'year',from: 0,length: 4 },
75
- { type: 'month',from: 5,length: 2,region: 6 },
76
- { type: 'year',from: 8 + PeriodMargin.length,length: 4 },
77
- { type: 'month',from: 13 + PeriodMargin.length,length: 2,region: 3 }
78
- ],sets: 2
79
- },
80
- dateWareki: {
81
- defaultValue: '----年--月--日',format: /^\d{4}\D\d{2}\D\d{2}$/,ranges: [
82
- { type: 'dateWareki',from: 0,length: 4,region: 5 },
83
- { type: 'month',from: 5,length: 2,region: 3 },
84
- { type: 'date',from: 8,length: 2,region: 3 }
85
- ],sets: 1
86
- }
87
- }
88
-
89
- const DataLeveling = ( params: {
90
- restrict: amotify.fn.Input.Time.RestrictTypes
91
- value: any
92
- era: amotify.fn.Input.Time.EraTypes
93
- } ) => {
94
- let {
95
- restrict,
96
- value,
97
- era
98
- } = params
99
-
100
- let dataValue = $.flatArray( value || '' )
101
-
102
- let {
103
- defaultValue,
104
- format,
105
- ranges,
106
- sets
107
- } = TimeFormatDatas[ restrict ]
108
- let formatValues: string[] = []
109
-
110
- let separateStr = restrict == 'clock' ? ':' : '/'
111
- for ( let index = 0; index < dataValue.length; index++ ) {
112
- dataValue[ index ] = String( dataValue[ index ] ).replace( /\D/ig,separateStr )
113
- }
114
- for ( let index = 0; index < sets; index++ ) {
115
- let val = dataValue[ index ] || ''
116
- if ( !val.match( format ) ) {
117
- dataValue[ index ] = ''
118
- formatValues.push( defaultValue )
119
- } else {
120
- let _value = defaultValue
121
- val.split( /\D/ ).forEach( ( v: string,i: number ) => {
122
- if ( i == 0 && restrict == 'dateWareki' ) {
123
- let Year = Number( v )
124
- if ( era != 'year' ) {
125
- if ( Year >= 2019 ) {
126
- if ( era == 'reiwa' ) Year -= ( 2019 - 1 )
127
- else if ( era == 'heisei' ) Year = 31
128
- } else if ( Year >= 1989 ) {
129
- if ( era == 'heisei' ) Year -= ( 1989 - 1 )
130
- else if ( era == 'shouwa' ) Year = 64
131
- } else if ( Year >= 1926 ) {
132
- if ( era == 'shouwa' ) Year -= ( 1926 - 1 )
133
- else if ( era == 'taisho' ) Year = 15
134
- } else if ( Year >= 1912 ) {
135
- if ( era == 'taisho' ) Year -= ( 1912 - 1 )
136
- else if ( era == 'meiji' ) Year = 45
137
- } else if ( Year >= 1868 ) Year -= ( 1868 - 1 )
138
- }
139
- v = Year.zeroEmbed( 4 )
140
- }
141
- _value = _value.replace( new RegExp( '------------------'.slice( 0,v.length ) ),v )
142
- } )
143
- formatValues.push( _value )
144
- }
145
- }
146
-
147
- return {
148
- formatValue: formatValues.join( PeriodMargin ),
149
- dataValue: [ 'dates','months' ].includes( restrict ) ? dataValue : dataValue[ 0 ],
150
- ranges
151
- }
152
- }
153
-
154
- function DefaultValidation( props: {
155
- value: any
156
- params: any
157
- } ): amotify.fn.Input.Validation.Result {
158
- let {
159
- params
160
- } = props
161
- let {
162
- restrict,
163
- min,max,
164
- required
165
- } = params as amotify.fn.Input.Time.OriginParams
166
- let notice: amotify.fn.Input.Validation.NoticeTypes[] = []
167
- let values: string[] = $.flatArray( props.value )
168
-
169
- let validate = {
170
- empty: false,
171
- escalated: 1,
172
- filled: true,
173
- correct: true,
174
- prohibited: false
175
- };
176
-
177
- ( () => {
178
- let separateStr = restrict == 'clock' ? ':' : '/'
179
- for ( let index = 0; index < values.length; index++ ) {
180
- values[ index ] = String( values[ index ] ).replace( /\D/ig,separateStr )
181
- }
182
- for ( let index = 0; index < values.length; index++ ) {
183
- let value = values[ index ]
184
- let prevValue = values[ index - 1 ]
185
- if ( !value.removeLetters() ) validate.empty = true
186
- if ( index > 0 ) validate.escalated &= Number( value >= prevValue )
187
- }
188
- if ( !validate.escalated ) return
189
- if ( validate.empty ) return
190
-
191
- if ( restrict.match( /clock/ ) ) {
192
- values.forEach( value => {
193
- let [ hour,minute ] = value.split( /\D+/ )
194
-
195
- if ( !hour || !minute ) {
196
- validate.filled = false
197
- } else if ( Number( hour ) > 23 || Number( minute ) > 59 ) {
198
- validate.correct = false
199
- }
200
- } )
201
- } else if ( restrict.match( /date/ ) ) {
202
- values.forEach( value => {
203
- let [ year,month,day ] = value.split( /\D+/ )
204
- if ( !year || !month || !day ) {
205
- validate.filled = false
206
- } else {
207
- let Time = $.Time( value )
208
- if ( !Time.validate || value != Time.toFormatYMD() ) {
209
- validate.correct = false
210
- }
211
- }
212
- } )
213
- } else if ( restrict.match( /week/ ) ) {
214
- values.forEach( value => {
215
- let [ year,week ] = value.split( /\D+/ )
216
- if ( !year || !week ) {
217
- validate.filled = false
218
- } else {
219
- let yearFirstDay = $.Time( year + '/01/01' ).weekday
220
- let yearFirstWeek0Day = $.Time( year + '/01/0' + ( 7 - yearFirstDay + 1 ) )
221
- let yearValueWeek0Day = yearFirstWeek0Day.addWeek( Number( week ) - 1 )
222
- if ( year != String( yearValueWeek0Day.year ) ) {
223
- validate.correct = false
224
- }
225
- }
226
- } )
227
- } else if ( restrict.match( /month/ ) ) {
228
- values.forEach( value => {
229
- let [ year,month ] = value.split( /\D+/ )
230
- if ( !year || !month ) {
231
- validate.filled = false
232
- } else {
233
- let date = $.Time( [ year,month,'01' ].join( '/' ) )
234
- if ( !date.validate ) validate.correct = false
235
- }
236
- } )
237
- } else if ( restrict.match( /year/ ) ) {
238
-
239
- }
240
-
241
- if ( validate.filled && validate.correct ) {
242
- values.forEach( value => {
243
- {
244
- let VAL = Number( String( value ).replace( /\D/ig,'' ) )
245
- if ( min ) {
246
- let MIN = Number( String( min ).replace( /\D/ig,'' ) )
247
- if ( MIN > VAL ) validate.prohibited = true
248
- }
249
- if ( max ) {
250
- let MAX = Number( String( max ).replace( /\D/ig,'' ) )
251
- if ( VAL > MAX ) validate.prohibited = true
252
- }
253
- }
254
- } )
255
- }
256
- } )()
257
-
258
- {
259
- let {
260
- empty,
261
- escalated,
262
- filled,
263
- correct,
264
- prohibited
265
- } = validate
266
- if ( empty && required ) {
267
- notice = [
268
- { type: 'invalid',label: '必須項目です' }
269
- ]
270
- }
271
- if ( !escalated ) {
272
- notice.push( { type: 'invalid',label: '時系列を正しく入力してください' } )
273
- }
274
- if ( !correct ) {
275
- notice.push( { type: 'invalid',label: '無効な値が入力されています' } )
276
- }
277
- if ( !filled ) {
278
- notice.push( { type: 'invalid',label: '最後まで値を埋めてください' } )
279
- }
280
- if ( prohibited ) {
281
- notice.push( {
282
- type: 'invalid',label: <>
283
- <Box>
284
- 入力範囲が制限されています
285
- </Box>
286
- [{ min || '下限無し' }] ~ [{ max || '上限無し' }]
287
- </>
288
- } )
289
- }
290
- }
291
-
292
- return {
293
- ok: !notice.filter( ( { type } ) => type == 'invalid' ).length,
294
- notice: notice
295
- }
296
- }
297
-
298
- type FocusProps = {
299
- active: boolean
300
- index: number
301
- prevIndex: number
302
- }
303
-
304
- export const TimeInput: React.FC<amotify.fn.Input.Time.OriginParams> = ( params ) => {
305
- let {
306
- tone,
307
- required,
308
- restrict = 'clock',
309
- componentID,
310
- era,
311
- form,
312
- name,
313
- min,max,
314
- className,
315
-
316
- enableFormSubmit,
317
-
318
- checkValidationAtFirst,
319
- onKeyDown,
320
- onValidate,
321
- onUpdateValue,
322
- onUpdateValidValue,
323
- value = '',
324
- leftIndicator,rightIndicator,
325
-
326
- ...others
327
- } = params
328
-
329
- let [ val_era,set_era ] = React.useState( era! )
330
-
331
- let [ val_status,set_status ] = React.useState( {
332
- componentID: params.componentID || '',
333
- ...DataLeveling( {
334
- restrict,
335
- value,
336
- era: val_era
337
- } ),
338
- eventType: 'init',
339
- eventID: $.uuidGen(),
340
- } as amotify.fn.Input.Status.Time )
341
-
342
- let [ val_validate,set_validate ] = React.useState( {
343
- ok: false,
344
- notice: []
345
- } as amotify.fn.Input.Validation.Result )
346
- let [ val_focus,set_focus ] = React.useState( {
347
- active: false,
348
- index: 0,
349
- prevIndex: -1
350
- } as FocusProps )
351
-
352
- CommonEffects( {
353
- type: 'time',
354
- params,
355
- val_status,
356
- set_status,
357
- val_validate,
358
- set_validate,
359
- DefaultValidation,
360
- onUpdateValue,
361
- onUpdateValidValue,
362
- ExtraOverrideParams: {
363
- ...DataLeveling( {
364
- restrict,
365
- value,
366
- era: val_era!
367
- } )
368
- }
369
- } )
370
-
371
- const mounted = React.useRef( false )
372
- React.useEffect( () => {
373
- if ( mounted.current ) {
374
- set_status( {
375
- ...val_status,
376
- ...DataLeveling( {
377
- restrict,
378
- value: val_status.dataValue,
379
- era: val_era
380
- } )
381
- } )
382
-
383
- let ParentComponent = useStore.get( 'refreshEra_' + val_status.componentID )
384
- ParentComponent && ParentComponent.refreshEra( val_era )
385
- } else {
386
- mounted.current = true
387
- }
388
- },[ val_era ] )
389
-
390
- useStore.update( {
391
- key: val_status.componentID,
392
- value: {
393
- openPicker: () => {
394
- if ( params.disabled ) return
395
-
396
- TimeFNs.picker.launch( {
397
- parent: '#Picker-' + val_status.componentID,
398
- tipsID: 'PickerTips-' + val_status.componentID,
399
- restrict,
400
- min,max,
401
- defaultValue: val_status.dataValue,
402
- era: val_era,
403
- onValueUpdate: ( value,era ) => {
404
- set_status( {
405
- ...val_status,
406
- ...DataLeveling( {
407
- restrict,
408
- value,
409
- era
410
- } ),
411
- eventType: 'update',
412
- eventID: $.uuidGen()
413
- } )
414
- set_era( era )
415
- }
416
- } )
417
- },
418
- resetEra: ( era: amotify.fn.Input.Time.EraTypes ) => {
419
- set_era( era )
420
- set_status( {
421
- ...val_status,
422
- ...DataLeveling( {
423
- restrict,
424
- value: '',
425
- era: val_era!
426
- } ),
427
- eventType: 'update',
428
- eventID: $.uuidGen()
429
- } )
430
- }
431
- }
432
- } )
433
-
434
- React.useEffect( () => {
435
- let { index,active } = val_focus
436
- if ( active ) {
437
- index = Math.max( index,0 )
438
- index = Math.min( index,val_status.ranges.length - 1 )
439
-
440
- let { from,length } = val_status.ranges[ index ]
441
- let input = $( '#' + params.id )[ 0 ] as HTMLInputElement
442
- if ( input ) input.setSelectionRange( from,( from + length ) )
443
- }
444
- },[ val_focus ] )
445
-
446
- return <BoxWrapper
447
- val_status={ val_status }
448
- set_status={ set_status }
449
- val_validate={ val_validate }
450
- params={ params }
451
- >
452
- <Input.Hidden
453
- name={ name }
454
- data-input-type={ 'time' }
455
- data-form={ form }
456
- data-validation={ val_validate.ok }
457
- componentID={ val_status.componentID }
458
- data-value={ JSON.stringify(
459
- [ 'dates','months' ].includes( restrict ) ?
460
- !val_status.dataValue[ 0 ] || !val_status.dataValue[ 1 ] ? null
461
- : val_status.dataValue
462
- : ( val_status.dataValue || null )
463
- ) }
464
- />
465
- { amotify.config.device.isTouchDevice ?
466
- <Buttons.Button.Plain
467
- className={ className }
468
- freeCSS={ {
469
- textAlign: 'left'
470
- } }
471
- children={ val_status.formatValue }
472
- onClick={ ( event ) => {
473
- let component = useStore.get( val_status.componentID )
474
- if ( component ) component.openPicker()
475
- event.stopPropagation()
476
- } }
477
- /> : <input
478
- type={ 'text' }
479
- inputMode={ 'numeric' }
480
- data-input-type={ 'time' }
481
- data-form-name={ form }
482
- value={ val_status.formatValue }
483
- className={ className }
484
- tabIndex={ amotify.config.device.isTouchDevice ? -1 : 0 }
485
- onKeyDown={ ( event ) => {
486
- KeyDownEvent( {
487
- restrict,
488
- event,
489
- val_era,
490
- val_status,set_status,
491
- val_focus,set_focus
492
- } )
493
-
494
- if ( onKeyDown ) onKeyDown( event )
495
- if ( enableFormSubmit ) SubmitForm( event )
496
- } }
497
- onKeyUp={ ( event ) => {
498
- if ( event.key == 'Tab' ) set_focus( {
499
- ...val_focus,
500
- active: true
501
- } )
502
- } }
503
- onClick={ ( event ) => {
504
- let caretTo = ( event.target as HTMLInputElement ).selectionEnd as number
505
- let Index = 0
506
-
507
- val_status.ranges.forEach( ( range,index ) => {
508
- let { from,length,region } = range
509
- if ( from <= caretTo && caretTo <= ( from + ( region || length ) ) ) {
510
- Index = index
511
- }
512
- } )
513
- set_focus( {
514
- ...val_focus,
515
- active: true,
516
- index: Index
517
- } )
518
- event.preventDefault()
519
- } }
520
- onChange={ () => { } }
521
- { ...others }
522
- /> }
523
- </BoxWrapper>
524
- }
525
-
526
- const KeyDownEvent = ( props: {
527
- restrict: amotify.fn.Input.Time.RestrictTypes
528
- event: React.KeyboardEvent<HTMLInputElement>
529
- val_era: amotify.fn.Input.Time.EraTypes
530
- val_status: amotify.fn.Input.Status.Time
531
- set_status: React.Dispatch<React.SetStateAction<amotify.fn.Input.Status.Time>>
532
- val_focus: FocusProps
533
- set_focus: React.Dispatch<React.SetStateAction<FocusProps>>
534
- } ) => {
535
- let {
536
- val_era,
537
- restrict,
538
- event,
539
- val_status,set_status,
540
- val_focus,set_focus
541
- } = props
542
-
543
- let { key,shiftKey,ctrlKey,metaKey } = event
544
- let auxKey = ctrlKey || metaKey
545
- let {
546
- selectionStart: caretFrom,
547
- selectionEnd: caretTo
548
- } = event.target as HTMLInputElement
549
-
550
- let {
551
- index: currentFocusIndex,
552
- prevIndex: prevFocusIndex
553
- } = val_focus
554
- let {
555
- ranges,
556
- formatValue
557
- } = val_status
558
- let maxFocusIndex = ranges.length - 1
559
-
560
- if ( [ 'Tab','ArrowLeft','ArrowRight' ].includes( key ) ) {
561
- let nextFocusIndex = 0
562
- if ( key == 'Tab' ) {
563
- let direction = Number( !shiftKey ) * 2 - 1
564
- nextFocusIndex = val_focus.index + direction
565
- if ( nextFocusIndex < 0 || nextFocusIndex > maxFocusIndex ) return
566
- } else {
567
- let direction = key == 'ArrowLeft' ? -1 : key == 'ArrowRight' ? 1 : 0
568
-
569
- if ( auxKey ) {
570
- nextFocusIndex = direction == 1 ? maxFocusIndex : 0
571
- } else {
572
- if ( caretFrom == 0 && caretTo == String( val_status.formatValue ).length ) {
573
- nextFocusIndex = direction == 1 ? maxFocusIndex : 0
574
- } else {
575
- nextFocusIndex = Math.max( 0,Math.min( currentFocusIndex + direction,maxFocusIndex ) )
576
- }
577
- }
578
- }
579
- set_focus( {
580
- ...val_focus,
581
- index: nextFocusIndex,
582
- prevIndex: currentFocusIndex
583
- } )
584
- event.preventDefault()
585
- }
586
-
587
- if ( [ 'Backspace','ArrowUp','ArrowDown','0','1','2','3','4','5','6','7','8','9' ].includes( key ) ) {
588
- event.preventDefault()
589
-
590
- let nextFocusIndex = currentFocusIndex
591
- nextFocusIndex = Math.max( nextFocusIndex,0 )
592
- nextFocusIndex = Math.min( nextFocusIndex,maxFocusIndex )
593
- let {
594
- type,
595
- from,
596
- length
597
- } = ranges[ nextFocusIndex ]
598
-
599
- let prevValue: any = formatValue.slice( from,( from + length ) )
600
- let partsValue: any
601
-
602
- if ( key == 'Backspace' ) {
603
- partsValue = '------'.slice( 0,length )
604
- } else if ( [ 'ArrowUp','ArrowDown' ].includes( key ) ) {
605
- let direction = key == 'ArrowUp' ? 1 : -1
606
-
607
- prevValue = prevValue | 0
608
- partsValue = prevValue + direction
609
-
610
- let [ min,max,range ] =
611
- type == 'dateWareki' ?
612
- val_era == 'year' ? [ 0,2999,4 ]
613
- : val_era == 'reiwa' ? [ 1,2999,4 ]
614
- : val_era == 'heisei' ? [ 1,31,4 ]
615
- : val_era == 'shouwa' ? [ 1,64,4 ]
616
- : val_era == 'taisho' ? [ 1,15,4 ]
617
- : val_era == 'meiji' ? [ 1,45,4 ] : [ 0,0,0 ]
618
- : type == 'minute' ? [ 0,59,2 ]
619
- : type == 'hour' ? [ 0,23,2 ]
620
- : type == 'date' ? [ 1,31,2 ]
621
- : type == 'week' ? [ 1,53,2 ]
622
- : type == 'month' ? [ 1,12,2 ]
623
- : type == 'year' ? [ 0,2999,4 ] : [ 0,0,0 ]
624
-
625
- if ( partsValue > max ) partsValue = min
626
- else if ( partsValue < min ) partsValue = max
627
- partsValue = ( Number( partsValue ) ).zeroEmbed( range )
628
- } else if ( [ '0','1','2','3','4','5','6','7','8','9' ].includes( key ) ) {
629
- let prev = prevValue | 0
630
- let add = key
631
- let compound: any = `${ prev }${ add }`
632
-
633
- if ( prevFocusIndex != currentFocusIndex && prevFocusIndex >= 0 ) {
634
- prev = 0,compound = '0' + add
635
- }
636
-
637
- if ( type == 'year' || ( type == 'dateWareki' && val_era == 'year' ) ) {
638
- if ( Number( compound ) > 10000 ) partsValue = add
639
- else partsValue = compound
640
-
641
- if ( ( partsValue | 0 ) > 1000 ) nextFocusIndex++
642
- } else if (
643
- [ 'hour','minute','date','week','month' ].includes( type ) ||
644
- ( type == 'dateWareki' && val_era != 'year' )
645
- ) {
646
- let base =
647
- type == 'dateWareki' ?
648
- val_era == 'reiwa' ? 100
649
- : val_era == 'heisei' ? 31
650
- : val_era == 'shouwa' ? 64
651
- : val_era == 'taisho' ? 15
652
- : val_era == 'meiji' ? 45 : 0
653
- : type == 'minute' ? 59
654
- : type == 'hour' ? 23
655
- : type == 'date' ? 31
656
- : type == 'week' ? 53
657
- : type == 'month' ? 12 : 0
658
-
659
- partsValue = ( compound | 0 ) > base ? add : compound
660
-
661
- if ( Number( add ) > Number( String( base )[ 0 ] ) ||
662
- (
663
- prevValue == '0000'.slice( 0,String( base ).length ) && (
664
- compound != '0000'.slice( 0,String( base ).length ) ||
665
- ( [ 'minute','hour' ].includes( type ) && prevFocusIndex == currentFocusIndex )
666
- )
667
- ) || ( compound | 0 ) >= ( 10 ** ( String( base ).length - 1 ) )
668
- ) nextFocusIndex++
669
- }
670
-
671
- if ( type == 'year' || type == 'dateWareki' ) partsValue = ( partsValue | 0 ).zeroEmbed( 4 )
672
- else partsValue = ( partsValue | 0 ).zeroEmbed( 2 )
673
- }
674
-
675
- {
676
- let nextFormatValue = String( formatValue ).partReplace( from,String( partsValue ) )
677
- let nextDataValue = nextFormatValue.split( PeriodMargin ).map( ( value ) => {
678
- return value
679
- .replace( /(^\D|\D$)/,'' )
680
- .split( /\D+/ )
681
- .join( restrict == 'clock' ? ':' : '/' )
682
- .replace( /(^\D|\D$)/,'' )
683
- } )
684
- if ( restrict == 'dateWareki' ) {
685
- let v = nextDataValue[ 0 ].split( /\D/ )
686
- let [ year,month,day ] = v
687
- if ( v.length == 3 && year ) {
688
- let yearYear: any = Number( year ) - 1 + Number(
689
- {
690
- year: 1,reiwa: 2019,heisei: 1989,shouwa: 1926,taisho: 1912,meiji: 1868
691
- }[ val_era as string ]
692
- )
693
- nextDataValue = [ [ yearYear,month,day ].join( '/' ) ]
694
- }
695
- }
696
-
697
- nextFocusIndex = Math.max( nextFocusIndex,0 )
698
- nextFocusIndex = Math.min( nextFocusIndex,maxFocusIndex )
699
-
700
- set_status( {
701
- ...val_status,
702
- dataValue: [ 'dates','months' ].includes( restrict ) ? nextDataValue : nextDataValue[ 0 ],
703
- formatValue: nextFormatValue,
704
- eventType: 'update',
705
- eventID: $.uuidGen(),
706
- } )
707
- set_focus( {
708
- ...val_focus,
709
- index: nextFocusIndex,
710
- prevIndex: val_focus.index
711
- } )
712
- }
713
- }
714
- }
715
-
716
-
717
- export const TimeFNs: amotify.fn.Input.Time.FNTypes = {
718
- picker: {
719
- launch: ( params ) => {
720
- let tipsID = params.tipsID || $.uuidGen()
721
-
722
- Tooltips.open( {
723
- gravityPoint: params.gravityPoint || 24,
724
- padding: '1/2',
725
- tipsID,
726
- ...params,
727
- close_option: {
728
- aroundClick: true,
729
- elementBlur: false,
730
- ...params.close_option
731
- },
732
- content: <Picker
733
- restrict={ params.restrict }
734
- min={ params.min }
735
- max={ params.max }
736
- era={ params.era }
737
- defaultValue={ params.defaultValue }
738
- tipsID={ tipsID }
739
- onValueUpdate={ ( value,era ) => {
740
- params.onValueUpdate( value,era )
741
- } }
742
- />
743
- } )
744
- },
745
- remove: ( tipsID ) => {
746
- Tooltips.close( tipsID )
747
- }
748
- }
749
- }