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,553 +0,0 @@
1
- import {
2
- useStore,
3
- React
4
- } from '@global'
5
- import {
6
- Box,
7
- Flex,
8
- FAI
9
- } from '@atoms'
10
- import {
11
- Column,
12
- Row,
13
- Text
14
- } from '@mols'
15
- import {
16
- Input,
17
- Buttons,
18
- SnackBar
19
- } from '@fn'
20
-
21
- import {
22
- BoxWrapper,
23
- SubmitForm,
24
- ValidationCheck,
25
- CommonEffects
26
- } from '../core'
27
- import style from './style.module.scss'
28
-
29
- import { faCloudArrowUp } from '@fortawesome/free-solid-svg-icons/faCloudArrowUp'
30
-
31
- function DefaultValidation( props: {
32
- value: any
33
- params: any
34
- } ): amotify.fn.Input.Validation.Result {
35
- let { value,params } = props
36
- let { required } = params as amotify.fn.Input.Filer.PlainParams
37
- let notice: amotify.fn.Input.Validation.NoticeTypes[] = []
38
-
39
- if ( required && !value.length ) {
40
- notice.push( { type: 'invalid',label: '必須項目です' } )
41
- }
42
-
43
- return {
44
- ok: !notice.filter( ( { type } ) => type == 'invalid' ).length,
45
- notice: notice
46
- }
47
- }
48
-
49
- const FileComponent: React.FC<amotify.fn.Input.Filer.PlainParams> = ( params ) => {
50
- let {
51
- tone,
52
- required,
53
- form,
54
-
55
- fileNameEdit = true,
56
- systemOnly = false,
57
- accept = '*',
58
- limit = 1,
59
-
60
- checkValidationAtFirst,
61
- onChange,
62
- onValidate,
63
- onUpdateValue,onUpdateValidValue,
64
- value = [],
65
- className,
66
-
67
- cellStyles,cellClassName,
68
-
69
- componentID,status_id,
70
- enableFormSubmit,
71
-
72
- ...others
73
- } = params
74
-
75
- let Default_Status: amotify.fn.Input.Status.Plain = {
76
- componentID: params.componentID || '',
77
- dataValue: value,
78
- eventType: 'init',
79
- eventID: $.uuidGen()
80
- }
81
- let [ val_status,set_status ] = React.useState( Default_Status )
82
- let [ val_validate,set_validate ] = React.useState( {
83
- ok: false,
84
- notice: []
85
- } as amotify.fn.Input.Validation.Result )
86
-
87
- CommonEffects( {
88
- type: 'file',
89
- params,
90
- val_status,
91
- set_status,
92
- val_validate,
93
- set_validate,
94
- DefaultValidation,
95
- onUpdateValue,onUpdateValidValue,
96
- ExtraOverrideParams: {
97
- dataValue: value,
98
- formatValue: value,
99
- },
100
- ExtraStoreParams: {
101
- AddFiles: async ( files: any[] ) => {
102
- let currentFiles = useStore.get( val_status.componentID ).Files
103
- let newFiles = []
104
- for ( var i = 0; i < files?.length; i++ ) {
105
- let file = files[ i ]
106
- let { type,name } = file
107
-
108
- if ( i + 1 + currentFiles.length > limit ) {
109
- SnackBar.add( {
110
- componentID: name,
111
- secondsToClose: 12000,
112
- children: `ファイル選択上限を超えたため、${ name }}は追加できません。`,
113
- backgroundColor: 'nega'
114
- } )
115
- continue
116
- }
117
-
118
- if ( accept ) {
119
- if ( accept == 'image' ) {
120
- if ( !type.match( /image/ ) ) {
121
- SnackBar.add( {
122
- componentID: name,
123
- secondsToClose: 12000,
124
- children: `ファイル形式が異なるため、${ name } は追加できません。`,
125
- backgroundColor: 'nega'
126
- } )
127
- continue
128
- }
129
- }
130
- }
131
- newFiles.push( file )
132
- }
133
- set_status( {
134
- ...val_status,
135
- dataValue: [ ...currentFiles,...newFiles ],
136
- eventType: 'update',
137
- eventID: $.uuidGen(),
138
- } )
139
- }
140
- }
141
- } )
142
-
143
- let Accept = ''
144
- if ( accept ) {
145
- if ( accept == 'image' ) Accept = 'image/png,image/jpeg'
146
- else Accept = accept
147
- }
148
-
149
- return <BoxWrapper
150
- val_status={ val_status }
151
- set_status={ set_status }
152
- val_validate={ val_validate }
153
- params={ params }
154
- >
155
- <input
156
- type='file'
157
- className={ style.Input }
158
- data-form={ form }
159
- data-input-type={ 'file' }
160
- data-component-id={ val_status.componentID }
161
- data-validation={ val_validate.ok }
162
- accept={ Accept }
163
- multiple={ limit == 1 ? false : true }
164
- onChange={ async ( event ) => {
165
- let Input = event.target
166
- let files = Input.files as any
167
- let newFiles = []
168
- for ( var i = 0; i < files?.length; i++ ) {
169
- let file = files[ i ]
170
- let fileName = file.name
171
- file.id = $.uuidGen()
172
-
173
- if ( i + 1 + val_status.dataValue.length > limit ) {
174
- SnackBar.add( {
175
- componentID: fileName,
176
- secondsToClose: 12000,
177
- children: `ファイル登録数を超えたため、${ fileName }}は追加できませんでした。`,
178
- backgroundColor: 'nega'
179
- } )
180
- continue
181
- }
182
- newFiles.push( file )
183
- }
184
- set_status( {
185
- ...val_status,
186
- dataValue: [ ...val_status.dataValue,...newFiles ],
187
- eventType: 'update',
188
- eventID: $.uuidGen(),
189
- } )
190
- Input.value = ''
191
- } }
192
- { ...others }
193
- tabIndex={ -1 }
194
- value={ '' }
195
- />
196
- { !systemOnly ? <FileList
197
- files={ val_status.dataValue }
198
- params={ params }
199
- val_status={ val_status }
200
- set_status={ set_status }
201
- /> : null }
202
- </BoxWrapper>
203
- }
204
-
205
- const FileList: React.FC<{
206
- files: File[]
207
- params: amotify.fn.Input.Filer.PlainParams
208
- val_status: amotify.fn.Input.Status.Plain
209
- set_status: React.Dispatch<React.SetStateAction<amotify.fn.Input.Status.Plain>>
210
- }> = ( props ) => {
211
- let {
212
- files,
213
- params,
214
- val_status,
215
- set_status
216
- } = props
217
- let Left = ( params.limit || 1 ) - val_status.dataValue.length
218
-
219
- let Files = files.map( ( file,index ) => {
220
- return <FileCell
221
- key={ file.name }
222
- index={ index }
223
- file={ file }
224
- className={ params.cellClassName }
225
- val_status={ val_status }
226
- set_status={ set_status }
227
- fileNameEdit={ params.fileNameEdit }
228
- />
229
- } )
230
-
231
- if ( Left > 0 ) {
232
- Files.push( <label
233
- key={ 'AddButton' }
234
- className={ [ params.cellClassName,style.AddButton ].join( ' ' ) }
235
- data-component-id={ val_status.componentID }
236
- htmlFor={ params.id }
237
- tabIndex={ params.tabIndex }
238
- onKeyDown={ ( event ) => {
239
- let { key } = event
240
- if ( params.tabIndex != -1 ) {
241
- if ( [ ' ','Enter' ].includes( key ) ) {
242
- $( '#' + params.id ).click()
243
- }
244
- }
245
- } }
246
- >
247
- <Row.Center
248
- padding={ [ '1/3',0 ] }
249
- >
250
- <Box
251
- isRounded
252
- className={ style.AddIcon }
253
- >
254
- <FAI
255
- icon={ faCloudArrowUp }
256
- className={ style.Icon }
257
- fontColor={ 'theme' }
258
- fontSize='4.thirdTitle'
259
- backgroundColor={ 'tcOpLow' }
260
- ssSphere={ 4 }
261
- />
262
- </Box>
263
- <Box>
264
- <Box
265
- children={ 'ファイルを選択' + `(${ Left })` }
266
- fontColor={ 'theme' }
267
- fontSize={ '2.normal' }
268
- isSemiBoldFont
269
- />
270
- <Box
271
- isSemiBoldFont
272
- fontColor={ '4.thin' }
273
- fontSize={ '0.xs' }
274
- >
275
- ファイルをドロップ
276
- </Box>
277
- </Box>
278
- </Row.Center>
279
- </label> )
280
- }
281
-
282
- return <Column
283
- flexSizing={ 'auto' }
284
- className={ params.className }
285
- children={ Files }
286
- />
287
- }
288
-
289
- const FileCell: React.FC<{
290
- index: number
291
- file: File
292
- className?: string
293
- val_status: amotify.fn.Input.Status.Plain
294
- set_status: React.Dispatch<React.SetStateAction<amotify.fn.Input.Status.Plain>>
295
- fileNameEdit?: boolean
296
- }> = ( props ) => {
297
- let {
298
- index,
299
- file,
300
- className,
301
- val_status,
302
- set_status,
303
- fileNameEdit = true
304
- } = props
305
- let {
306
- name: fileName,
307
- size,
308
- type,
309
- } = file
310
-
311
- let [ val_edit,set_edit ] = React.useState( false )
312
- let FileID = $.uuidGen()
313
- let Size = size.rank()
314
- let [ name,extension ] = fileName
315
- .replace( /\s/,'' )
316
- .replace( /(.*)\.(.*)$/,'$1 $2' ).split( ' ' )
317
-
318
- let FileName = 'ファイル'
319
- if ( type.match( /image/ ) ) {
320
- FileName = type.replace( /image\//,'' )
321
- } else if ( type.match( /pdf/ ) ) {
322
- FileName = 'PDF'
323
- } else if ( type.match( /csv/ ) ) {
324
- FileName = 'CSV'
325
- } else if ( type.match( /spreadsheet/ ) ) {
326
- FileName = 'SpreadSheet'
327
- } else if ( type.match( /presentation/ ) ) {
328
- FileName = 'PowerPoint'
329
- } else if ( type.match( /word/ ) ) {
330
- FileName = 'Word'
331
- } else if ( type.match( /zip/ ) ) {
332
- FileName = 'Zip'
333
- } else if ( type.match( /powerpoint/ ) ) {
334
- FileName = 'PowerPoint'
335
- } else if ( type.match( /html/ ) ) {
336
- FileName = 'HTML'
337
- } else if ( type.match( /js/ ) ) {
338
- FileName = 'JavaScript'
339
- } else if ( type.match( /css/ ) ) {
340
- FileName = 'CSS'
341
- } else if ( type.match( /text\/plain/ ) ) {
342
- FileName = 'テキスト'
343
- }
344
-
345
- React.useEffect( () => {
346
- if ( val_edit ) {
347
- setTimeout( () => {
348
- $( '#' + FileID )[ 0 ].focus()
349
- },100 )
350
- }
351
- },[ val_edit ] )
352
-
353
- return <Flex
354
- verticalAlign='center'
355
- flexWrap={ false }
356
- gap={ 1 }
357
- className={ className }
358
- >
359
- <FAI.File
360
- fontSize={ '4.thirdTitle' }
361
- fontColor={ '4.thin' }
362
- />
363
- <Box flexSizing={ 0 }>
364
- <Box>
365
- <Flex
366
- verticalAlign='center'
367
- gap={ '2/3' }
368
- flexWrap={ false }
369
- className={ style.FileName }
370
- children={ !val_edit ? <>
371
- { fileName }
372
- { fileNameEdit ?
373
- <Buttons.Button.Clear.R
374
- ssSphere={ 2.5 }
375
- flexSizing={ 'none' }
376
- color='cloud'
377
- fontColor='4.thin'
378
- padding={ '1/3' }
379
- ssEffectsOnActive={ 'expand' }
380
- onClick={ () => {
381
- set_edit( true )
382
- } }
383
- >
384
- <FAI.Pen />
385
- </Buttons.Button.Clear.R> : null
386
- }
387
- </> : <>
388
- <Column
389
- gap={ '1/2' }
390
- flexSizing={ 0 }
391
- >
392
- <Flex
393
- gap={ '2/3' }
394
- verticalAlign='center'
395
- >
396
- <Input.Text.Normal
397
- tone='border'
398
- wrapStyles={ {
399
- flexSizing: 'auto'
400
- } }
401
- restrict='fileName'
402
- name='name'
403
- required
404
- id={ FileID }
405
- form={ 'form-' + FileID }
406
- enableFormSubmit
407
- value={ name }
408
- onKeyDown={ ( event ) => {
409
- let { key } = event
410
- if ( key == 'Escape' ) set_edit( false )
411
- } }
412
- />
413
- <Box>
414
- . { extension }
415
- </Box>
416
- </Flex>
417
- <Flex
418
- gap={ '2/3' }
419
- horizontalAlign='right'
420
- flexWrap={ false }
421
- >
422
- <Buttons.Button.Sub.R
423
- padding={ [ '2/3',1 ] }
424
- children={ '閉じる' }
425
- onClick={ () => {
426
- set_edit( false )
427
- } }
428
- />
429
- <Buttons.Button.Prime.R
430
- padding={ [ '2/3',1 ] }
431
- submitOption={ {
432
- formName: 'form-' + FileID,
433
- callback: async ( form ) => {
434
- let { name } = form
435
- let nextFiles = [ ...val_status.dataValue ]
436
- let prevFile = nextFiles[ index ]
437
- let id = prevFile.id
438
- if ( !prevFile ) return
439
-
440
- let { target } = await prevFile.read()
441
- if ( !target ) return
442
- let dataUrl = String( target.result )
443
-
444
- let newBlob = await dataUrl.toBlob( file.type )
445
- if ( !newBlob ) return
446
- let newFile: any = new File( [ newBlob ],name + '.' + extension,{ type: prevFile.type } )
447
- newFile.id = id
448
-
449
- nextFiles[ index ] = newFile
450
-
451
- set_status( {
452
- ...val_status,
453
- dataValue: nextFiles,
454
- eventType: 'update',
455
- eventID: $.uuidGen(),
456
- } )
457
- set_edit( false )
458
- }
459
- } }
460
- >
461
- 決定
462
- </Buttons.Button.Prime.R>
463
- </Flex>
464
- </Column>
465
- </>
466
- }
467
- />
468
- </Box>
469
- { !val_edit ? <>
470
- <Box
471
- fontSize={ '1.mini' }
472
- fontColor={ '4.thin' }
473
- flexSizing={ 0 }
474
- children={ FileName + 'ファイル / ' + Size + 'B' }
475
- />
476
- </> : null }
477
- </Box>
478
- <Buttons.Button.Sub.R
479
- color='cloud'
480
- fontColor='4.thin'
481
- ssSphere={ 3 }
482
- onClick={ () => {
483
- let nextFiles = [ ...val_status.dataValue ]
484
- let prevFile = nextFiles[ index ]
485
- if ( !prevFile ) return
486
-
487
- nextFiles.splice( index,1 )
488
- set_status( {
489
- ...val_status,
490
- dataValue: nextFiles,
491
- eventType: 'update',
492
- eventID: $.uuidGen(),
493
- } )
494
- } }
495
- >
496
- <FAI.Times />
497
- </Buttons.Button.Sub.R>
498
- </Flex>
499
- }
500
-
501
- $.fnScope( async () => {
502
- $( document ).addEvent( {
503
- eventType: 'dragover',
504
- callback: ( event ) => {
505
- event.preventDefault()
506
- $( '.' + style.AddButton ).addClass( style.Draggable )
507
- },
508
- option: {
509
- passive: false
510
- }
511
- } ).addEvent( {
512
- eventType: 'drop',
513
- callback: ( event: any ) => {
514
- event.preventDefault()
515
- $( '.' + style.AddButton ).removeClass( style.Draggable )
516
- let Files = event.dataTransfer.files
517
- if ( Files.length ) {
518
- let Target = event.target as HTMLElement
519
- if ( $( Target ).hasClass( style.AddButton ) ) {
520
- let { componentId } = Target.dataset
521
- let component = useStore.get( componentId! )
522
- if ( component && component.AddFiles ) component.AddFiles( Files )
523
- }
524
- }
525
- },
526
- option: { passive: false }
527
- } )
528
- } )
529
-
530
- const FileInput: amotify.fn.Input.Filer.Methods = FileComponent as any
531
- FileInput.fn = {
532
- openDialog: ( params ) => {
533
- let {
534
- multiple,
535
- accept
536
- } = params
537
-
538
- return new Promise( resolve => {
539
- const input = document.createElement( 'input' )
540
- input.type = 'file'
541
- input.multiple = multiple ?? true
542
- if ( accept ) {
543
- if ( accept == 'image' ) input.accept = 'image/png,image/jpeg'
544
- else input.accept = accept
545
- }
546
- input.onchange = ( event: any ) => {
547
- resolve( event.target.files )
548
- }
549
- input.click()
550
- } )
551
- }
552
- }
553
- export { FileInput }
@@ -1,34 +0,0 @@
1
- @use '@props' as *;
2
-
3
- .Input:focus {
4
- + .List .AddButton {
5
- background-color: $color-layer3;
6
- }
7
- }
8
- .FileName {
9
- word-break: break-all;
10
- }
11
- .AddButton {
12
- transition: $animation-time-middle;
13
- > * {
14
- pointer-events: none;
15
- }
16
- &:hover {
17
- background-color: $color-layer3;
18
- }
19
- &.Draggable {
20
- background-color: $color-layer3;
21
- .AddIcon {
22
- animation: 1s infinite IconAnimation;
23
- }
24
- }
25
- }
26
-
27
- @keyframes IconAnimation {
28
- 0% {
29
- box-shadow: 0 0 0 0 $color-theme;
30
- }
31
- 100% {
32
- box-shadow: 0 0 0 1rem cAlfa( 0 );
33
- }
34
- }
@@ -1,21 +0,0 @@
1
- import React from 'react'
2
- export const HiddenInput: React.FC<amotify.fn.Input.Hidden.PlainParams> = ( params ) => {
3
- let {
4
- componentID = '',
5
- enableFormSubmit,
6
-
7
- form,
8
- value = '',
9
- ...others
10
- } = params
11
-
12
- return <input
13
- value={ JSON.stringify( value ) }
14
- data-input-type={ 'hidden' }
15
- data-form={ form }
16
- data-component-id={ componentID }
17
- data-value={ JSON.stringify( value ) }
18
- { ...others }
19
- type='hidden'
20
- />
21
- }