amotify 0.0.4 → 0.0.6

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