amotify 0.1.31 → 0.1.32

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 (95) hide show
  1. package/dist/@declaration/_.js +1 -1
  2. package/dist/@styles/componentClasses/_.css +68 -65
  3. package/dist/@styles/componentClasses/_.js +39 -39
  4. package/dist/@styles/index.css +68 -65
  5. package/dist/@styles/index.js +39 -39
  6. package/dist/@styles/init.css +1 -1
  7. package/dist/@styles/style.css +68 -65
  8. package/dist/@styles/style.js +39 -39
  9. package/dist/@styles/var.css +1 -1
  10. package/dist/@utils/GenerateClassName.js +470 -1
  11. package/dist/@utils/LaunchReactApp.js +78 -1
  12. package/dist/@utils/_.js +12 -1
  13. package/dist/@utils/collectForm.js +96 -1
  14. package/dist/@utils/color.js +103 -1
  15. package/dist/@utils/config.js +101 -1
  16. package/dist/@utils/fin.js +39 -1
  17. package/dist/@utils/getElement.js +13 -1
  18. package/dist/@utils/jsminEx.js +172 -1
  19. package/dist/@utils/pageTransit.js +33 -1
  20. package/dist/@utils/useRecycle.js +44 -1
  21. package/dist/@utils/useStore.js +54 -1
  22. package/dist/atoms/Box.js +20 -1
  23. package/dist/atoms/FAI.js +148 -1
  24. package/dist/atoms/Flex.js +34 -1
  25. package/dist/atoms/Grid.js +17 -1
  26. package/dist/atoms/Img.js +65 -1
  27. package/dist/atoms/Logo.js +359 -51
  28. package/dist/atoms/P.js +20 -1
  29. package/dist/atoms/Placeholder.js +44 -1
  30. package/dist/atoms/Span.js +20 -1
  31. package/dist/atoms/_.js +9 -1
  32. package/dist/chunk-JJ3PEWPN.js +60 -0
  33. package/dist/fn/Button.js +316 -1
  34. package/dist/fn/Cropper.js +1009 -1
  35. package/dist/fn/Effect/Fade.js +88 -1
  36. package/dist/fn/Effect/Pudding.js +22 -1
  37. package/dist/fn/Effect/Ripple.js +117 -3
  38. package/dist/fn/Effect/_.js +14 -1
  39. package/dist/fn/Input/AutoHeightText.js +112 -1
  40. package/dist/fn/Input/Checker.js +36 -1
  41. package/dist/fn/Input/Chips/Selector.js +472 -1
  42. package/dist/fn/Input/Chips/_.js +349 -1
  43. package/dist/fn/Input/Contenteditable.js +160 -1
  44. package/dist/fn/Input/DigitCharacters.js +275 -1
  45. package/dist/fn/Input/Filer.js +619 -1
  46. package/dist/fn/Input/Hidden.js +48 -1
  47. package/dist/fn/Input/List.js +450 -1
  48. package/dist/fn/Input/Parts.js +121 -1
  49. package/dist/fn/Input/Plain.js +12 -1
  50. package/dist/fn/Input/RichSelect.js +279 -1
  51. package/dist/fn/Input/Search.js +53 -1
  52. package/dist/fn/Input/Segmented.js +245 -1
  53. package/dist/fn/Input/Select.js +278 -1
  54. package/dist/fn/Input/Slider.js +538 -1
  55. package/dist/fn/Input/Switch.js +221 -1
  56. package/dist/fn/Input/Text.js +626 -1
  57. package/dist/fn/Input/TextArea.js +151 -1
  58. package/dist/fn/Input/Time/Picker.js +1457 -1
  59. package/dist/fn/Input/Time/_.js +867 -1
  60. package/dist/fn/Input/_.js +48 -1
  61. package/dist/fn/Input/core.js +626 -1
  62. package/dist/fn/Layout/PageNotFound.js +90 -1
  63. package/dist/fn/Layout/PageRouter.js +87 -1
  64. package/dist/fn/Layout/PageViewController.js +29 -1
  65. package/dist/fn/Layout/Plate.js +37 -1
  66. package/dist/fn/Layout/RootViewController.js +315 -1
  67. package/dist/fn/Layout/SwipeView.js +348 -1
  68. package/dist/fn/Layout/TabBar.js +72 -1
  69. package/dist/fn/Layout/_.js +22 -1
  70. package/dist/fn/Loader/_.js +104 -1
  71. package/dist/fn/Loader/corner.js +85 -1
  72. package/dist/fn/Loader/mini.js +125 -1
  73. package/dist/fn/Loader/top.js +73 -1
  74. package/dist/fn/Sheet.js +1101 -1
  75. package/dist/fn/Snackbar.js +216 -1
  76. package/dist/fn/Table/Data.js +974 -1
  77. package/dist/fn/Table/Drag.js +435 -1
  78. package/dist/fn/Table/Normal.js +136 -1
  79. package/dist/fn/Table/Parts.js +41 -1
  80. package/dist/fn/Table/Wrapper.js +60 -1
  81. package/dist/fn/Table/_.js +16 -1
  82. package/dist/fn/Table/cellStyling.js +51 -1
  83. package/dist/fn/Tooltips.js +58 -1
  84. package/dist/fn/_.js +10 -1
  85. package/dist/index.js +20 -1
  86. package/dist/mols/Accordion.js +152 -1
  87. package/dist/mols/Column.js +16 -1
  88. package/dist/mols/LinkifyText.js +42 -1
  89. package/dist/mols/List.js +42 -1
  90. package/dist/mols/Row.js +47 -1
  91. package/dist/mols/Text.js +67 -1
  92. package/dist/mols/_.js +6 -1
  93. package/dist/temps/_.js +1 -1
  94. package/dist/temps/designBook.js +3639 -20
  95. package/package.json +1 -1
@@ -1 +1,538 @@
1
- import{b as I,c as T,d as B}from"../../chunk-VY3566IV.js";import{jsx as d,jsxs as M}from"react/jsx-runtime";import{useState as A,useEffect as P}from"react";import{$$ as c,$$fromRoot as L,useStore as E,GenerateClassName as q}from"../../@utils/_";import x from"../../atoms/Box";import F from"../../atoms/Flex";import O from"../../mols/Column";import G from"../Button";import{Wrapper as X,BoxWrapper as j,SubmitForm as J,CommonEffects as Q}from"./core";import Y from"./Hidden";import{InputSliderClasses as v}from"../../@styles/componentClasses/_";function Z(a){let{value:e,params:o}=a,{required:n}=o,s=[];return n&&!e&&s.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}),{ok:!s.filter(({type:i})=>i=="invalid").length,notice:s}}const N=a=>{let{value:e,val_status:o}=a,{min:n,max:s,step:i}=o;e=Math.max(e,n),e=Math.min(e,s);let t=e/s*s;return t=Math.round(t/i),{stepValue:t*i,stepIndex:t,positionLeft:t*i/s*100+"%"}},z={IndicatorLabels:a=>{let{componentID:e,min:o,max:n,step:s,customLegends:i}=a,r=[],t=Math.round(o/s),p=Math.round(n/s),f=p-t+1;for(var u=t;u<=p;u++){let l=u*s;l=Math.max(l,o),l=Math.min(l,n);let g=l/n*100+"%";r.push(d(x,{className:v("Label"),id:"Legend-"+e+"-"+u,display:u==t||u==p?"flex":"none",position:"absolute",top:0,unitHeight:1,unitWidth:1.5,transition:"middle",fontColor:"1.clear",freeCSS:{left:g,whiteSpace:"nowrap",textAlign:"center"},verticalAlign:"center",horizontalAlign:"center",children:i?i(l):l.rank()},l))}return P(()=>{const l=()=>{let g=L("#Labels-"+e),{width:S}=g.position(),C=Math.round(S/50)-1,y=Math.round(f/C);for(let m=t+1;m<p;m++)L("#Legend-"+e+"-"+m).css({display:m%y==0?"flex":"none"})};return c(window).addEvent({eventID:"SliderResizeCallback-"+e,eventType:"resize",callback:()=>{l()}}),l(),()=>{c(window).removeEvent("SliderResizeCallback-"+e)}},[]),d(F,{className:v("Labels"),verticalAlign:"center",horizontalAlign:"between",fontSize:"0.xs",position:"relative",unitHeight:1,id:"Labels-"+e,children:d(x,{position:"absolute",top:0,left:0,bottom:0,freeCSS:{right:12*1.5},children:r})})},Rail:a=>{let{val_status:e,set_status:o,DotData:n,form:s,enableFormSubmit:i}=a,{componentID:r}=e;return M(F,{className:v("Rail"),position:"relative",paddingLeft:"1/2",unitHeight:1.5,verticalAlign:"center",freeCSS:{minWidth:"10rem",zIndex:1,cursor:"pointer"},onMouseDown:t=>{t.stopPropagation(),b.Effects.Start(t,{val_status:e,set_status:o,DotData:n})},onTouchStart:t=>{t.stopPropagation(),b.Effects.Start(t,{val_status:e,set_status:o,DotData:n})},children:[d(x,{className:v("Bar"),backgroundColor:"4.layer.darken",position:"relative",borderRadius:"sphere",transition:"middle",flexSizing:"none",unitHeight:"2/3",width:1,id:r+"_Bar",children:d(x,{className:v("BarColor"),position:"relative",height:1,width:0,left:0,transition:"long",borderRadius:"inherit",backgroundColor:a.color,opacity:"middle",overflow:"hidden",freeCSS:{width:n.positionLeft},id:r+"_BarColor"})}),d(x,{className:v("BallWrap"),position:"absolute",top:0,left:0,bottom:0,freeCSS:{right:12*1.5},children:d(G.Button.Plain,{className:v("Ball"),position:"absolute",backgroundColor:a.color,top:0,left:0,ssSphere:1.5,freeCSS:{zIndex:2,left:n.positionLeft},"data-form-name":s,id:r+"_Ball",onKeyDown:t=>{b.KeyDownEvent({event:t,val_status:e,set_status:o,DotData:n}),i&&J(t)}})})]})}},b={Effects:{Start:(a,e)=>{c(document).addEvent({eventID:"SliderMouseMove",eventType:"mousemove",callback:o=>{b.Effects.Move(o,e)},options:{passive:!1}}).addEvent({eventID:"SliderTouchMove",eventType:"touchmove",callback:o=>{b.Effects.Move(o,e)},options:{passive:!1}}).addEvent({eventID:"SliderMouseUp",eventType:"mouseup",callback:()=>{b.Effects.End()}}).addEvent({eventID:"SliderTouchEnd",eventType:"touchend",callback:()=>{b.Effects.End()}})},Move:(a,e)=>{let o=c.getCursor(a).x,{val_status:n,set_status:s}=e,{componentID:i,min:r,max:t}=n,p=L("#"+i+"_Ball"),f=L("#"+i+"_Bar"),u=L("#"+i+"_BarColor"),{width:l,left:g}=f.position(),S=(o-g)/l;S=Math.max(S,0),S=Math.min(S,1);let C=S*t,y=N({value:C,val_status:n}),m=y.positionLeft,D=y.stepValue;p.css({left:m}),u.css({width:m});let{prevValue:_}=E.get(i);return D!=_&&(E.update({key:i,value:{prevValue:D}}),s(T(I({},n),{dataValue:D,eventType:"update",eventID:c.uuid.gen()}))),a.preventDefault(),a.stopPropagation(),!1},End:()=>{c(document).removeEvent(["SliderMouseMove","SliderTouchMove","SliderMouseUp","SliderTouchEnd"])}},KeyDownEvent:a=>{let{event:e,val_status:o,set_status:n}=a,{min:s,max:i,step:r}=o,{key:t,metaKey:p,ctrlKey:f}=e,u=f||p,l=o.dataValue;t.match(/Arrow/)&&(e.preventDefault(),t.match(/Left|Up/)?u?l=s:l-=r:t.match(/Right|Down/)&&(u?l=i:l+=r),l=Math.max(Math.min(l,i),s),E.update({key:o.componentID,value:{prevValue:l}}),n(T(I({},o),{dataValue:l,eventType:"update",eventID:c.uuid.gen()})))}},ee=a=>{let k=a,{color:e="theme",required:o,form:n="",legends:{enable:s=!0,custom:i,showAlways:r=!1}={},min:t,max:p,step:f,enableFormSubmit:u,checkValidationAtFirst:l,onChange:g,onKeyDown:S,onValidate:C,onUpdateValue:y,onUpdateValidValue:m,value:D="",className:_}=k,K=B(k,["color","required","form","legends","min","max","step","enableFormSubmit","checkValidationAtFirst","onChange","onKeyDown","onValidate","onUpdateValue","onUpdateValidValue","value","className"]),W={componentID:a.componentID||"",dataValue:D,min:t,max:p,step:f,eventType:"init",eventID:c.uuid.gen()},[h,V]=A(W),[w,U]=A({ok:!1,notice:[]});Q({params:a,val_status:h,set_status:V,val_validate:w,set_validate:U,onUpdateValue:y,onUpdateValidValue:m,DefaultValidation:Z,ExtraOverrideParams:{dataValue:D},ExtraStoreParams:{prevValue:h.dataValue,setValueByForeign:$=>{V(T(I({},h),{dataValue:$,eventType:"update",eventID:c.uuid.gen()}))}}});let R=N({value:h.dataValue,val_status:h});return M(j,{val_status:h,set_status:V,val_validate:w,params:a,children:[d(Y,I({value:R.stepValue,form:n,"data-value":R.stepValue,"data-validation":w.ok,"data-input-type":"slider"},K)),M(O,{gap:"1/2",flexSizing:"auto",className:[v("Wrap"),_,v("ShowLegendsAlways_"+r)].join(" "),children:[d(z.Rail,{color:e,val_status:h,set_status:V,DotData:R,form:n,enableFormSubmit:u}),s?d(z.IndicatorLabels,{componentID:h.componentID,min:t,max:p,step:f,customLegends:i}):null]})]})},H=a=>(a=I({},a),d(X,{componentID:a.componentID,children:ee,params:q(a)}));export{H as Slider,H as default};
1
+ import {
2
+ __objRest,
3
+ __spreadProps,
4
+ __spreadValues
5
+ } from "../../chunk-JJ3PEWPN.js";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ import {
8
+ useState,
9
+ useEffect
10
+ } from "react";
11
+ import {
12
+ $$,
13
+ $$fromRoot,
14
+ useStore,
15
+ GenerateClassName
16
+ } from "../../@utils/_";
17
+ import Box from "../../atoms/Box";
18
+ import Flex from "../../atoms/Flex";
19
+ import Column from "../../mols/Column";
20
+ import Button from "../Button";
21
+ import {
22
+ Wrapper,
23
+ BoxWrapper,
24
+ SubmitForm,
25
+ CommonEffects
26
+ } from "./core";
27
+ import Hidden from "./Hidden";
28
+ import { InputSliderClasses } from "../../@styles/componentClasses/_";
29
+ function DefaultValidation(props) {
30
+ let { value, params } = props;
31
+ let { required } = params;
32
+ let notice = [];
33
+ if (required && !value) {
34
+ notice.push({ type: "invalid", label: "\u5FC5\u9808\u9805\u76EE\u3067\u3059" });
35
+ }
36
+ return {
37
+ ok: !notice.filter(({ type }) => type == "invalid").length,
38
+ notice
39
+ };
40
+ }
41
+ const DataLeveling = (props) => {
42
+ let { value, val_status } = props;
43
+ let { min, max, step } = val_status;
44
+ value = Math.max(value, min);
45
+ value = Math.min(value, max);
46
+ let rawValue = value / max;
47
+ let stepValue = rawValue * max;
48
+ stepValue = Math.round(stepValue / step);
49
+ return {
50
+ stepValue: stepValue * step,
51
+ stepIndex: stepValue,
52
+ positionLeft: stepValue * step / max * 100 + "%"
53
+ };
54
+ };
55
+ const Comps = {
56
+ IndicatorLabels: (props) => {
57
+ let {
58
+ componentID,
59
+ min,
60
+ max,
61
+ step,
62
+ customLegends
63
+ } = props;
64
+ let Labels = [];
65
+ let minStep = Math.round(min / step);
66
+ let maxStep = Math.round(max / step);
67
+ let steps = maxStep - minStep + 1;
68
+ for (var index = minStep; index <= maxStep; index++) {
69
+ let value = index * step;
70
+ value = Math.max(value, min);
71
+ value = Math.min(value, max);
72
+ let left = value / max * 100 + "%";
73
+ Labels.push(/* @__PURE__ */ jsx(
74
+ Box,
75
+ {
76
+ className: InputSliderClasses("Label"),
77
+ id: "Legend-" + componentID + "-" + index,
78
+ display: index == minStep || index == maxStep ? "flex" : "none",
79
+ position: "absolute",
80
+ top: 0,
81
+ unitHeight: 1,
82
+ unitWidth: 1.5,
83
+ transition: "middle",
84
+ fontColor: "1.clear",
85
+ freeCSS: {
86
+ left,
87
+ whiteSpace: "nowrap",
88
+ textAlign: "center"
89
+ },
90
+ verticalAlign: "center",
91
+ horizontalAlign: "center",
92
+ children: customLegends ? customLegends(value) : value.rank()
93
+ },
94
+ value
95
+ ));
96
+ }
97
+ useEffect(() => {
98
+ const LabelLeveling = () => {
99
+ let Labels2 = $$fromRoot("#Labels-" + componentID);
100
+ let {
101
+ width
102
+ } = Labels2.position();
103
+ let maxLabelCount = Math.round(width / 50) - 1;
104
+ let labelStep = Math.round(steps / maxLabelCount);
105
+ for (let index2 = minStep + 1; index2 < maxStep; index2++) {
106
+ $$fromRoot("#Legend-" + componentID + "-" + index2).css({
107
+ display: index2 % labelStep == 0 ? "flex" : "none"
108
+ });
109
+ }
110
+ };
111
+ $$(window).addEvent({
112
+ eventID: "SliderResizeCallback-" + componentID,
113
+ eventType: "resize",
114
+ callback: () => {
115
+ LabelLeveling();
116
+ }
117
+ });
118
+ LabelLeveling();
119
+ return () => {
120
+ $$(window).removeEvent("SliderResizeCallback-" + componentID);
121
+ };
122
+ }, []);
123
+ return /* @__PURE__ */ jsx(
124
+ Flex,
125
+ {
126
+ className: InputSliderClasses("Labels"),
127
+ verticalAlign: "center",
128
+ horizontalAlign: "between",
129
+ fontSize: "0.xs",
130
+ position: "relative",
131
+ unitHeight: 1,
132
+ id: "Labels-" + componentID,
133
+ children: /* @__PURE__ */ jsx(
134
+ Box,
135
+ {
136
+ position: "absolute",
137
+ top: 0,
138
+ left: 0,
139
+ bottom: 0,
140
+ freeCSS: {
141
+ right: 12 * 1.5
142
+ },
143
+ children: Labels
144
+ }
145
+ )
146
+ }
147
+ );
148
+ },
149
+ Rail: (props) => {
150
+ let {
151
+ val_status,
152
+ set_status,
153
+ DotData,
154
+ form,
155
+ enableFormSubmit
156
+ } = props;
157
+ let {
158
+ componentID
159
+ } = val_status;
160
+ return /* @__PURE__ */ jsxs(
161
+ Flex,
162
+ {
163
+ className: InputSliderClasses("Rail"),
164
+ position: "relative",
165
+ paddingLeft: "1/2",
166
+ unitHeight: 1.5,
167
+ verticalAlign: "center",
168
+ freeCSS: {
169
+ minWidth: "10rem",
170
+ zIndex: 1,
171
+ cursor: "pointer"
172
+ },
173
+ onMouseDown: (event) => {
174
+ event.stopPropagation();
175
+ Hooks.Effects.Start(event, {
176
+ val_status,
177
+ set_status,
178
+ DotData
179
+ });
180
+ },
181
+ onTouchStart: (event) => {
182
+ event.stopPropagation();
183
+ Hooks.Effects.Start(event, {
184
+ val_status,
185
+ set_status,
186
+ DotData
187
+ });
188
+ },
189
+ children: [
190
+ /* @__PURE__ */ jsx(
191
+ Box,
192
+ {
193
+ className: InputSliderClasses("Bar"),
194
+ backgroundColor: "4.layer.darken",
195
+ position: "relative",
196
+ borderRadius: "sphere",
197
+ transition: "middle",
198
+ flexSizing: "none",
199
+ unitHeight: "2/3",
200
+ width: 1,
201
+ id: componentID + "_Bar",
202
+ children: /* @__PURE__ */ jsx(
203
+ Box,
204
+ {
205
+ className: InputSliderClasses("BarColor"),
206
+ position: "relative",
207
+ height: 1,
208
+ width: 0,
209
+ left: 0,
210
+ transition: "long",
211
+ borderRadius: "inherit",
212
+ backgroundColor: props.color,
213
+ opacity: "middle",
214
+ overflow: "hidden",
215
+ freeCSS: {
216
+ width: DotData.positionLeft
217
+ },
218
+ id: componentID + "_BarColor"
219
+ }
220
+ )
221
+ }
222
+ ),
223
+ /* @__PURE__ */ jsx(
224
+ Box,
225
+ {
226
+ className: InputSliderClasses("BallWrap"),
227
+ position: "absolute",
228
+ top: 0,
229
+ left: 0,
230
+ bottom: 0,
231
+ freeCSS: {
232
+ right: 12 * 1.5
233
+ },
234
+ children: /* @__PURE__ */ jsx(
235
+ Button.Button.Plain,
236
+ {
237
+ className: InputSliderClasses("Ball"),
238
+ position: "absolute",
239
+ backgroundColor: props.color,
240
+ top: 0,
241
+ left: 0,
242
+ ssSphere: 1.5,
243
+ freeCSS: {
244
+ zIndex: 2,
245
+ left: DotData.positionLeft
246
+ },
247
+ "data-form-name": form,
248
+ id: componentID + "_Ball",
249
+ onKeyDown: (event) => {
250
+ Hooks.KeyDownEvent({
251
+ event,
252
+ val_status,
253
+ set_status,
254
+ DotData
255
+ });
256
+ if (enableFormSubmit)
257
+ SubmitForm(event);
258
+ }
259
+ }
260
+ )
261
+ }
262
+ )
263
+ ]
264
+ }
265
+ );
266
+ }
267
+ };
268
+ const Hooks = {
269
+ Effects: {
270
+ Start: (event, info) => {
271
+ $$(document).addEvent({
272
+ eventID: "SliderMouseMove",
273
+ eventType: "mousemove",
274
+ callback: (event2) => {
275
+ Hooks.Effects.Move(event2, info);
276
+ },
277
+ options: { passive: false }
278
+ }).addEvent({
279
+ eventID: "SliderTouchMove",
280
+ eventType: "touchmove",
281
+ callback: (event2) => {
282
+ Hooks.Effects.Move(event2, info);
283
+ },
284
+ options: { passive: false }
285
+ }).addEvent({
286
+ eventID: "SliderMouseUp",
287
+ eventType: "mouseup",
288
+ callback: () => {
289
+ Hooks.Effects.End();
290
+ }
291
+ }).addEvent({
292
+ eventID: "SliderTouchEnd",
293
+ eventType: "touchend",
294
+ callback: () => {
295
+ Hooks.Effects.End();
296
+ }
297
+ });
298
+ },
299
+ Move: (event, info) => {
300
+ let mouseX = $$.getCursor(event).x;
301
+ let {
302
+ val_status,
303
+ set_status
304
+ } = info;
305
+ let {
306
+ componentID,
307
+ min,
308
+ max
309
+ } = val_status;
310
+ let Ball = $$fromRoot("#" + componentID + "_Ball");
311
+ let Bar = $$fromRoot("#" + componentID + "_Bar");
312
+ let BarColor = $$fromRoot("#" + componentID + "_BarColor");
313
+ let { width: barWidth, left: barLeft } = Bar.position();
314
+ let Left = (mouseX - barLeft) / barWidth;
315
+ Left = Math.max(Left, 0);
316
+ Left = Math.min(Left, 1);
317
+ let LeftRawValue = Left * max;
318
+ let resultValues = DataLeveling({
319
+ value: LeftRawValue,
320
+ val_status
321
+ });
322
+ let left = resultValues.positionLeft;
323
+ let stepValue = resultValues.stepValue;
324
+ Ball.css({ left });
325
+ BarColor.css({ width: left });
326
+ let { prevValue } = useStore.get(componentID);
327
+ if (stepValue != prevValue) {
328
+ useStore.update({
329
+ key: componentID,
330
+ value: {
331
+ prevValue: stepValue
332
+ }
333
+ });
334
+ set_status(__spreadProps(__spreadValues({}, val_status), {
335
+ dataValue: stepValue,
336
+ eventType: "update",
337
+ eventID: $$.uuid.gen()
338
+ }));
339
+ }
340
+ event.preventDefault();
341
+ event.stopPropagation();
342
+ return false;
343
+ },
344
+ End: () => {
345
+ $$(document).removeEvent(["SliderMouseMove", "SliderTouchMove", "SliderMouseUp", "SliderTouchEnd"]);
346
+ }
347
+ },
348
+ KeyDownEvent: (props) => {
349
+ let {
350
+ event,
351
+ val_status,
352
+ set_status
353
+ } = props;
354
+ let { min, max, step } = val_status;
355
+ let { key, metaKey, ctrlKey } = event;
356
+ let auxKey = ctrlKey || metaKey;
357
+ let nextValue = val_status.dataValue;
358
+ if (!key.match(/Arrow/))
359
+ return;
360
+ event.preventDefault();
361
+ if (key.match(/Left|Up/)) {
362
+ if (auxKey)
363
+ nextValue = min;
364
+ else
365
+ nextValue -= step;
366
+ } else if (key.match(/Right|Down/)) {
367
+ if (auxKey)
368
+ nextValue = max;
369
+ else
370
+ nextValue += step;
371
+ }
372
+ nextValue = Math.max(Math.min(nextValue, max), min);
373
+ useStore.update({
374
+ key: val_status.componentID,
375
+ value: {
376
+ prevValue: nextValue
377
+ }
378
+ });
379
+ set_status(__spreadProps(__spreadValues({}, val_status), {
380
+ dataValue: nextValue,
381
+ eventType: "update",
382
+ eventID: $$.uuid.gen()
383
+ }));
384
+ }
385
+ };
386
+ const SliderInput = (params) => {
387
+ let _a = params, {
388
+ color = "theme",
389
+ required,
390
+ form = "",
391
+ legends: {
392
+ enable: showLegends = true,
393
+ custom: customLegends,
394
+ showAlways: showLegendsAlways = false
395
+ } = {},
396
+ min,
397
+ max,
398
+ step,
399
+ enableFormSubmit,
400
+ checkValidationAtFirst,
401
+ onChange,
402
+ onKeyDown,
403
+ onValidate,
404
+ onUpdateValue,
405
+ onUpdateValidValue,
406
+ value = "",
407
+ className
408
+ } = _a, others = __objRest(_a, [
409
+ "color",
410
+ "required",
411
+ "form",
412
+ "legends",
413
+ "min",
414
+ "max",
415
+ "step",
416
+ "enableFormSubmit",
417
+ "checkValidationAtFirst",
418
+ "onChange",
419
+ "onKeyDown",
420
+ "onValidate",
421
+ "onUpdateValue",
422
+ "onUpdateValidValue",
423
+ "value",
424
+ "className"
425
+ ]);
426
+ let Default_Status = {
427
+ componentID: params.componentID || "",
428
+ dataValue: value,
429
+ min,
430
+ max,
431
+ step,
432
+ eventType: "init",
433
+ eventID: $$.uuid.gen()
434
+ };
435
+ let [val_status, set_status] = useState(Default_Status);
436
+ let [val_validate, set_validate] = useState({
437
+ ok: false,
438
+ notice: []
439
+ });
440
+ CommonEffects({
441
+ params,
442
+ val_status,
443
+ set_status,
444
+ val_validate,
445
+ set_validate,
446
+ onUpdateValue,
447
+ onUpdateValidValue,
448
+ DefaultValidation,
449
+ ExtraOverrideParams: {
450
+ dataValue: value
451
+ },
452
+ ExtraStoreParams: {
453
+ prevValue: val_status.dataValue,
454
+ setValueByForeign: (value2) => {
455
+ set_status(__spreadProps(__spreadValues({}, val_status), {
456
+ dataValue: value2,
457
+ eventType: "update",
458
+ eventID: $$.uuid.gen()
459
+ }));
460
+ }
461
+ }
462
+ });
463
+ let DotData = DataLeveling({
464
+ value: val_status.dataValue,
465
+ val_status
466
+ });
467
+ return /* @__PURE__ */ jsxs(
468
+ BoxWrapper,
469
+ {
470
+ val_status,
471
+ set_status,
472
+ val_validate,
473
+ params,
474
+ children: [
475
+ /* @__PURE__ */ jsx(
476
+ Hidden,
477
+ __spreadValues({
478
+ value: DotData.stepValue,
479
+ form,
480
+ "data-value": DotData.stepValue,
481
+ "data-validation": val_validate.ok,
482
+ "data-input-type": "slider"
483
+ }, others)
484
+ ),
485
+ /* @__PURE__ */ jsxs(
486
+ Column,
487
+ {
488
+ gap: "1/2",
489
+ flexSizing: "auto",
490
+ className: [
491
+ InputSliderClasses("Wrap"),
492
+ className,
493
+ InputSliderClasses("ShowLegendsAlways_" + showLegendsAlways)
494
+ ].join(" "),
495
+ children: [
496
+ /* @__PURE__ */ jsx(
497
+ Comps.Rail,
498
+ {
499
+ color,
500
+ val_status,
501
+ set_status,
502
+ DotData,
503
+ form,
504
+ enableFormSubmit
505
+ }
506
+ ),
507
+ !!showLegends && /* @__PURE__ */ jsx(
508
+ Comps.IndicatorLabels,
509
+ {
510
+ componentID: val_status.componentID,
511
+ min,
512
+ max,
513
+ step,
514
+ customLegends
515
+ }
516
+ )
517
+ ]
518
+ }
519
+ )
520
+ ]
521
+ }
522
+ );
523
+ };
524
+ const Slider = (rawParams) => {
525
+ rawParams = __spreadValues({}, rawParams);
526
+ return /* @__PURE__ */ jsx(
527
+ Wrapper,
528
+ {
529
+ componentID: rawParams.componentID,
530
+ children: SliderInput,
531
+ params: GenerateClassName(rawParams)
532
+ }
533
+ );
534
+ };
535
+ export {
536
+ Slider,
537
+ Slider as default
538
+ };