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,524 +0,0 @@
1
- import {
2
- useStore,
3
- React
4
- } from '@global'
5
- import {
6
- Box,
7
- Flex,
8
- } from '@atoms'
9
- import {
10
- Column
11
- } from '@mols'
12
- import {
13
- Input,
14
- Buttons
15
- } from '@fn'
16
-
17
- import {
18
- BoxWrapper,
19
- SubmitForm,
20
- CommonEffects
21
- } from '../core'
22
- import style from './style.module.scss'
23
-
24
- function DefaultValidation( props: {
25
- value: any
26
- params: any
27
- } ): amotify.fn.Input.Validation.Result {
28
- let { value,params } = props
29
- let { required } = params as amotify.fn.Input.TextArea.PlainParams
30
- let notice: amotify.fn.Input.Validation.NoticeTypes[] = []
31
-
32
- if ( required && !value ) {
33
- notice.push( { type: 'invalid',label: '必須項目です' } )
34
- }
35
-
36
- return {
37
- ok: !notice.filter( ( { type } ) => type == 'invalid' ).length,
38
- notice: notice
39
- }
40
- }
41
-
42
- type DataLevelingResult = {
43
- stepValue: number
44
- stepIndex: number
45
- positionLeft: string
46
- }
47
- const DataLeveling: {
48
- ( props: {
49
- value: number
50
- val_status: amotify.fn.Input.Status.Slider
51
- } ): DataLevelingResult
52
- } = ( props ) => {
53
- let { value,val_status } = props
54
- let { min,max,step } = val_status
55
-
56
- value = Math.max( value,min )
57
- value = Math.min( value,max )
58
-
59
- let rawValue = value / max
60
- let stepValue = rawValue * max
61
-
62
- stepValue = Math.round( stepValue / step )
63
-
64
- return {
65
- stepValue: stepValue * step,
66
- stepIndex: stepValue,
67
- positionLeft: stepValue * step / max * 100 + '%'
68
- }
69
- }
70
-
71
- export const SliderInput: React.FC<amotify.fn.Input.Slider.PlainParams> = ( params ) => {
72
- let {
73
- color = 'theme',
74
- required,
75
- form = '',
76
-
77
- legends: {
78
- enable: showLegends = true,
79
- custom: customLegends,
80
- showAlways: showLegendsAlways = false
81
- } = {},
82
- min,max,step,
83
-
84
- enableFormSubmit,
85
-
86
- checkValidationAtFirst,
87
- onChange,onKeyDown,
88
- onValidate,
89
- onUpdateValue,onUpdateValidValue,
90
- value = '',
91
- className,
92
-
93
- ...others
94
- } = params
95
-
96
- let Default_Status: amotify.fn.Input.Status.Slider = {
97
- componentID: params.componentID || '',
98
- dataValue: value,
99
- min,max,step,
100
- eventType: 'init',
101
- eventID: $.uuidGen(),
102
- }
103
- let [ val_status,set_status ] = React.useState( Default_Status )
104
- let [ val_validate,set_validate ] = React.useState( {
105
- ok: false,
106
- notice: []
107
- } as amotify.fn.Input.Validation.Result )
108
-
109
- CommonEffects( {
110
- params,
111
- val_status,
112
- set_status,
113
- val_validate,
114
- set_validate,
115
- onUpdateValue,onUpdateValidValue,
116
- DefaultValidation,
117
- ExtraOverrideParams: {
118
- dataValue: value
119
- },
120
- ExtraStoreParams: {
121
- prevValue: val_status.dataValue,
122
- setValueByForeign: ( value: number ) => {
123
- set_status( {
124
- ...val_status,
125
- dataValue: value,
126
- eventType: 'update',
127
- eventID: $.uuidGen(),
128
- } )
129
- }
130
- }
131
- } )
132
-
133
- let DotData = DataLeveling( {
134
- value: val_status.dataValue,
135
- val_status
136
- } )
137
-
138
- return <BoxWrapper
139
- val_status={ val_status }
140
- set_status={ set_status }
141
- val_validate={ val_validate }
142
- params={ params }
143
- >
144
- <Input.Hidden
145
- value={ DotData.stepValue }
146
- form={ form }
147
- data-value={ DotData.stepValue }
148
- data-validation={ val_validate.ok }
149
- data-input-type={ 'slider' }
150
- { ...others }
151
- />
152
- <Column
153
- gap={ '1/2' }
154
- flexSizing={ 'auto' }
155
- className={ [
156
- style.Wrap,
157
- className,
158
- style[ 'ShowLegendsAlways_' + showLegendsAlways ]
159
- ].join( ' ' ) }
160
- >
161
- <Comps.Rail
162
- color={ color }
163
- val_status={ val_status }
164
- set_status={ set_status }
165
- DotData={ DotData }
166
- form={ form }
167
- enableFormSubmit={ enableFormSubmit! }
168
- />
169
- { showLegends ? <Comps.IndicatorLabels
170
- componentID={ val_status.componentID }
171
- min={ min }
172
- max={ max }
173
- step={ step }
174
- customLegends={ customLegends }
175
- /> : null }
176
- </Column>
177
- </BoxWrapper>
178
- }
179
-
180
- const Comps = {
181
- IndicatorLabels: ( props: {
182
- componentID: string
183
- min: number
184
- max: number
185
- step: number
186
- customLegends?: amotify.fn.Input.Slider.LegendsCallback
187
- } ) => {
188
- let {
189
- componentID,
190
- min,
191
- max,
192
- step,
193
- customLegends
194
- } = props
195
- let Labels = []
196
-
197
- let minStep = Math.round( min / step )
198
- let maxStep = Math.round( max / step )
199
- let steps = maxStep - minStep + 1
200
-
201
- for ( var index = minStep; index <= maxStep; index++ ) {
202
- let value = index * step
203
- value = Math.max( value,min )
204
- value = Math.min( value,max )
205
- let left = ( value / max * 100 ) + '%'
206
- Labels.push( <Box
207
- key={ value }
208
- className={ style.Label }
209
- id={ 'Legend-' + componentID + '-' + index }
210
- display={ index == minStep || index == maxStep ? 'flex' : 'none' }
211
- position='absolute'
212
- top={ 0 }
213
- unitHeight={ 1 }
214
- unitWidth={ 1.5 }
215
- transition='middle'
216
- fontColor={ '1.clear' }
217
- freeCSS={ {
218
- left: left,
219
- whiteSpace: 'nowrap',
220
- textAlign: 'center'
221
- } }
222
- verticalAlign='center'
223
- horizontalAlign='center'
224
- children={ customLegends ? customLegends( value ) : value.rank() }
225
- /> )
226
- }
227
-
228
- React.useEffect( () => {
229
- const LabelLeveling = () => {
230
- let Labels = $( '#Labels-' + componentID )
231
- let {
232
- width
233
- } = Labels.position()
234
-
235
- let maxLabelCount = Math.round( width / 50 ) - 1
236
- let labelStep = Math.round( steps / maxLabelCount )
237
-
238
- for ( let index = minStep + 1; index < maxStep; index++ ) {
239
- $( '#Legend-' + componentID + '-' + index ).css( {
240
- display: index % labelStep == 0 ? 'flex' : 'none'
241
- } )
242
- }
243
- }
244
-
245
- $( window ).addEvent( {
246
- eventID: 'SliderResizeCallback-' + componentID,
247
- eventType: 'resize',
248
- callback: () => {
249
- LabelLeveling()
250
- }
251
- } )
252
- LabelLeveling()
253
-
254
- return () => {
255
- $( window ).removeEvent( 'SliderResizeCallback-' + componentID )
256
- }
257
- },[] )
258
-
259
- return <Flex
260
- className={ style.Labels }
261
- verticalAlign='center'
262
- horizontalAlign='between'
263
- backgroundColor='posi'
264
- fontSize={ '0.xs' }
265
- position='relative'
266
- id={ 'Labels-' + componentID }
267
- >
268
- <Box
269
- position='absolute'
270
- top={ 0 }
271
- left={ 0 }
272
- bottom={ 0 }
273
- freeCSS={ {
274
- right: 12 * 1.5
275
- } }
276
- children={ Labels }
277
- />
278
- </Flex>
279
- },
280
- Rail: ( props: {
281
- color: amotify.fn.Input.Slider.ColorTypes
282
- val_status: amotify.fn.Input.Status.Slider
283
- set_status: React.Dispatch<React.SetStateAction<amotify.fn.Input.Status.Slider>>
284
- DotData: DataLevelingResult
285
- form: string
286
- enableFormSubmit: boolean
287
- } ) => {
288
- let {
289
- val_status,
290
- set_status,
291
- DotData,
292
- form,
293
- enableFormSubmit
294
- } = props
295
- let {
296
- componentID
297
- } = val_status
298
-
299
- return <Flex
300
- className={ style.Rail }
301
- position='relative'
302
- paddingLeft={ '1/2' }
303
- unitHeight={ 1.5 }
304
- verticalAlign='center'
305
- freeCSS={ {
306
- minWidth: '10rem',
307
- zIndex: 1,
308
- cursor: 'pointer'
309
- } }
310
- onMouseDown={ ( event ) => {
311
- event.stopPropagation()
312
- EffectStart( event,{
313
- val_status,
314
- set_status,
315
- DotData
316
- } )
317
- } }
318
- onTouchStart={ ( event ) => {
319
- event.stopPropagation()
320
- EffectStart( event,{
321
- val_status,
322
- set_status,
323
- DotData
324
- } )
325
- } }
326
- >
327
- <Box
328
- className={ style.Bar }
329
- backgroundColor={ '4.layer.darken' }
330
- position='relative'
331
- borderRadius={ 'sphere' }
332
- transition='middle'
333
- flexSizing={ 'none' }
334
- unitHeight={ '2/3' }
335
- width={ 1 }
336
- id={ componentID + '_Bar' }
337
- >
338
- <Box
339
- className={ style.BarColor }
340
- position='relative'
341
- height={ 1 }
342
- width={ 0 }
343
- left={ 0 }
344
- transition='long'
345
- borderRadius={ 'inherit' }
346
- backgroundColor={ props.color }
347
- opacity='middle'
348
- overflow='hidden'
349
- freeCSS={ {
350
- width: DotData.positionLeft
351
- } }
352
- id={ componentID + '_BarColor' }
353
- />
354
- </Box>
355
- <Box
356
- className={ style.BallWrap }
357
- position='absolute'
358
- top={ 0 }
359
- left={ 0 }
360
- bottom={ 0 }
361
- freeCSS={ {
362
- right: 12 * 1.5
363
- } }
364
- >
365
- <Buttons.Button.Plain
366
- className={ style.Ball }
367
- position='absolute'
368
- backgroundColor={ props.color }
369
- top={ 0 }
370
- left={ 0 }
371
- ssSphere={ 1.5 }
372
- freeCSS={ {
373
- zIndex: 2,
374
- left: DotData.positionLeft
375
- } }
376
- data-form-name={ form }
377
- id={ componentID + '_Ball' }
378
- onKeyDown={ ( event ) => {
379
- KeyDownEvent( {
380
- event,
381
- val_status,
382
- set_status,
383
- DotData
384
- } )
385
-
386
- if ( enableFormSubmit ) SubmitForm( event )
387
- } }
388
- />
389
- </Box>
390
- </Flex>
391
- }
392
- }
393
-
394
- const EffectStart = ( event: any,info: {
395
- val_status: amotify.fn.Input.Status.Slider
396
- set_status: React.Dispatch<React.SetStateAction<amotify.fn.Input.Status.Slider>>
397
- DotData: DataLevelingResult
398
- } ) => {
399
- $( document )
400
- .addEvent( {
401
- eventID: 'SliderMouseMove',
402
- eventType: 'mousemove',
403
- callback: ( event ) => { EffectMove( event,info ) },
404
- option: { passive: false }
405
- } )
406
- .addEvent( {
407
- eventID: 'SliderTouchMove',
408
- eventType: 'touchmove',
409
- callback: ( event ) => { EffectMove( event,info ) },
410
- option: { passive: false }
411
- } )
412
- .addEvent( {
413
- eventID: 'SliderMouseUp',
414
- eventType: 'mouseup',
415
- callback: () => { EffectEnd() }
416
- } )
417
- .addEvent( {
418
- eventID: 'SliderTouchEnd',
419
- eventType: 'touchend',
420
- callback: () => { EffectEnd() }
421
- } )
422
- }
423
- const EffectMove = ( event: any,info: {
424
- val_status: amotify.fn.Input.Status.Slider
425
- set_status: React.Dispatch<React.SetStateAction<amotify.fn.Input.Status.Slider>>
426
- } ) => {
427
- let mouseX = $.getCursor( event ).x
428
- let {
429
- val_status,
430
- set_status,
431
- } = info
432
- let {
433
- componentID,
434
- min,max
435
- } = val_status
436
-
437
- let Ball = $( '#' + componentID + '_Ball' )
438
- let Bar = $( '#' + componentID + '_Bar' )
439
- let BarColor = $( '#' + componentID + '_BarColor' )
440
-
441
- let { width: barWidth,left: barLeft } = Bar.position()
442
-
443
- let Left = ( mouseX - barLeft ) / barWidth
444
- Left = Math.max( Left,0 )
445
- Left = Math.min( Left,1 )
446
-
447
- let LeftRawValue = Left * max
448
- let resultValues = DataLeveling( {
449
- value: LeftRawValue,
450
- val_status
451
- } )
452
- let left = resultValues.positionLeft
453
- let stepValue = resultValues.stepValue
454
-
455
- Ball.css( { left: left } )
456
- BarColor.css( { width: left } )
457
-
458
- let { prevValue } = useStore.get( componentID )
459
- if ( stepValue != prevValue ) {
460
- useStore.update( {
461
- key: componentID,
462
- value: {
463
- prevValue: stepValue
464
- }
465
- } )
466
- set_status( {
467
- ...val_status,
468
- dataValue: stepValue,
469
- eventType: 'update',
470
- eventID: $.uuidGen(),
471
- } )
472
- }
473
- event.preventDefault()
474
- event.stopPropagation()
475
- return false
476
- }
477
- const EffectEnd = () => {
478
- $( document ).removeEvent( [ 'SliderMouseMove','SliderTouchMove','SliderMouseUp','SliderTouchEnd' ] )
479
- }
480
-
481
- const KeyDownEvent = (
482
- props: {
483
- event: React.KeyboardEvent<HTMLButtonElement>
484
- val_status: amotify.fn.Input.Status.Slider
485
- set_status: React.Dispatch<React.SetStateAction<amotify.fn.Input.Status.Slider>>
486
- DotData: DataLevelingResult
487
- }
488
- ) => {
489
- let {
490
- event,
491
- val_status,
492
- set_status
493
- } = props
494
- let { min,max,step } = val_status
495
- let { key,metaKey,ctrlKey } = event
496
- let auxKey = ctrlKey || metaKey
497
-
498
- let nextValue = val_status.dataValue
499
- if ( !key.match( /Arrow/ ) ) return
500
-
501
- event.preventDefault()
502
- if ( key.match( /Left|Up/ ) ) {
503
- if ( auxKey ) nextValue = min
504
- else nextValue -= step
505
- } else if ( key.match( /Right|Down/ ) ) {
506
- if ( auxKey ) nextValue = max
507
- else nextValue += step
508
- }
509
- nextValue = Math.max( Math.min( nextValue,max ),min )
510
-
511
- useStore.update( {
512
- key: val_status.componentID,
513
- value: {
514
- prevValue: nextValue
515
- }
516
- } )
517
-
518
- set_status( {
519
- ...val_status,
520
- dataValue: nextValue,
521
- eventType: 'update',
522
- eventID: $.uuidGen(),
523
- } )
524
- }
@@ -1,67 +0,0 @@
1
- @use '@props' as *;
2
- @use'@styleSet' as *;
3
- .Label {
4
- &:before {
5
- content: "";
6
- position: absolute;
7
- top: calc(-1 * $unit1-5 / 2);
8
- height: calc($unit1-5 / 2);
9
- left: 50%;
10
- width: 1px;
11
- transform: translateX(-50%);
12
- background-color: $font-color4;
13
- }
14
- &:not( :first-child):not( :last-child) {
15
- opacity: 0;
16
- }
17
- &:first-child, &:last-child {
18
- opacity: .6;
19
- }
20
- }
21
- .Wrap {
22
- &:hover {
23
- .Rail {
24
- .Bar {
25
- background-color: $color-layer5;
26
- .BarColor {
27
- opacity: 1 !important;
28
- }
29
- }
30
- + .Labels .Label {
31
- opacity: .75;
32
- }
33
- }
34
- }
35
- &.ShowLegendsAlways_true {
36
- .Label {
37
- opacity: 1;
38
- }
39
- }
40
- .Rail {
41
- user-select: none;
42
- -webkit-user-select: none;
43
- * {
44
- user-select: none;
45
- -webkit-user-select: none;
46
- }
47
- .Ball {
48
- transition: box-shadow $animation-time-middle, left .1s;
49
- &:focus {
50
- box-shadow: 0 0 0 $unit2_3 hsla(var(--color-layer5-hsl), .4);
51
- }
52
- &:before {
53
- @include absoluteCovered();
54
- border-radius: 100rem;
55
- box-shadow: $shadow1;
56
- }
57
- }
58
- &:active {
59
- .Ball {
60
- box-shadow: 0 0 0 $unit2_3 hsla(var(--color-layer5-hsl), .4);
61
- }
62
- + .Labels .Label {
63
- opacity: 1;
64
- }
65
- }
66
- }
67
- }