@willphan1712000/frontend 1.0.0 → 1.0.1
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.
- package/README.md +4 -25
- package/dist/index.js +322 -78
- package/dist/index.mjs +322 -78
- package/package.json +1 -1
- package/dist/index.css +0 -233
package/dist/index.mjs
CHANGED
|
@@ -7,6 +7,19 @@ function _array_like_to_array(arr, len) {
|
|
|
7
7
|
function _array_with_holes(arr) {
|
|
8
8
|
if (Array.isArray(arr)) return arr;
|
|
9
9
|
}
|
|
10
|
+
function _define_property(obj, key, value) {
|
|
11
|
+
if (key in obj) {
|
|
12
|
+
Object.defineProperty(obj, key, {
|
|
13
|
+
value: value,
|
|
14
|
+
enumerable: true,
|
|
15
|
+
configurable: true,
|
|
16
|
+
writable: true
|
|
17
|
+
});
|
|
18
|
+
} else {
|
|
19
|
+
obj[key] = value;
|
|
20
|
+
}
|
|
21
|
+
return obj;
|
|
22
|
+
}
|
|
10
23
|
function _iterable_to_array_limit(arr, i) {
|
|
11
24
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
12
25
|
if (_i == null) return;
|
|
@@ -34,6 +47,45 @@ function _iterable_to_array_limit(arr, i) {
|
|
|
34
47
|
function _non_iterable_rest() {
|
|
35
48
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
36
49
|
}
|
|
50
|
+
function _object_spread(target) {
|
|
51
|
+
for(var i = 1; i < arguments.length; i++){
|
|
52
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
53
|
+
var ownKeys = Object.keys(source);
|
|
54
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
55
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
56
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
57
|
+
}));
|
|
58
|
+
}
|
|
59
|
+
ownKeys.forEach(function(key) {
|
|
60
|
+
_define_property(target, key, source[key]);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
return target;
|
|
64
|
+
}
|
|
65
|
+
function ownKeys(object, enumerableOnly) {
|
|
66
|
+
var keys = Object.keys(object);
|
|
67
|
+
if (Object.getOwnPropertySymbols) {
|
|
68
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
69
|
+
if (enumerableOnly) {
|
|
70
|
+
symbols = symbols.filter(function(sym) {
|
|
71
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
keys.push.apply(keys, symbols);
|
|
75
|
+
}
|
|
76
|
+
return keys;
|
|
77
|
+
}
|
|
78
|
+
function _object_spread_props(target, source) {
|
|
79
|
+
source = source != null ? source : {};
|
|
80
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
81
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
82
|
+
} else {
|
|
83
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
84
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
return target;
|
|
88
|
+
}
|
|
37
89
|
function _sliced_to_array(arr, i) {
|
|
38
90
|
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
39
91
|
}
|
|
@@ -56,25 +108,80 @@ function useMyContext() {
|
|
|
56
108
|
}
|
|
57
109
|
// src/components/DropdownSelect/Dropdown.tsx
|
|
58
110
|
import { useEffect, useRef, useState } from "react";
|
|
59
|
-
//
|
|
60
|
-
var
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
111
|
+
// src/components/DropdownSelect/styles.ts
|
|
112
|
+
var styles = {
|
|
113
|
+
select_box: {
|
|
114
|
+
borderRadius: "10px",
|
|
115
|
+
border: "solid 1px #dadada",
|
|
116
|
+
padding: "5px 10px",
|
|
117
|
+
display: "flex",
|
|
118
|
+
justifyContent: "space-between",
|
|
119
|
+
alignItems: "center",
|
|
120
|
+
cursor: "pointer"
|
|
121
|
+
},
|
|
122
|
+
value: {
|
|
123
|
+
marginRight: "auto"
|
|
124
|
+
},
|
|
125
|
+
close: {
|
|
126
|
+
borderRadius: "50%",
|
|
127
|
+
width: "20px",
|
|
128
|
+
height: "20px",
|
|
129
|
+
display: "flex",
|
|
130
|
+
justifyContent: "center",
|
|
131
|
+
alignItems: "center"
|
|
132
|
+
},
|
|
133
|
+
element: {
|
|
134
|
+
display: "flex",
|
|
135
|
+
padding: "5px",
|
|
136
|
+
borderRadius: "10px",
|
|
137
|
+
justifyContent: "flex-start",
|
|
138
|
+
alignItems: "center",
|
|
139
|
+
cursor: "pointer"
|
|
140
|
+
},
|
|
141
|
+
dropdown: {
|
|
142
|
+
position: "absolute",
|
|
143
|
+
boxSizing: "border-box",
|
|
144
|
+
width: "100%",
|
|
145
|
+
left: "0",
|
|
146
|
+
display: "flex",
|
|
147
|
+
flexDirection: "column",
|
|
148
|
+
border: "solid 1px #dadada",
|
|
149
|
+
borderRadius: "10px",
|
|
150
|
+
padding: "5px",
|
|
151
|
+
maxHeight: "300px",
|
|
152
|
+
overflowY: "auto",
|
|
153
|
+
backgroundColor: "white"
|
|
154
|
+
},
|
|
155
|
+
search_border: {
|
|
156
|
+
position: "sticky",
|
|
157
|
+
top: 0,
|
|
158
|
+
left: 0,
|
|
159
|
+
boxSizing: "border-box",
|
|
160
|
+
width: "100%",
|
|
161
|
+
backgroundColor: "white",
|
|
162
|
+
marginBottom: "5px"
|
|
163
|
+
},
|
|
164
|
+
search: {
|
|
165
|
+
width: "100%",
|
|
166
|
+
borderRadius: "5px",
|
|
167
|
+
padding: "5px",
|
|
168
|
+
border: "solid 1px #dadada",
|
|
169
|
+
display: "flex",
|
|
170
|
+
justifyContent: "flex-start",
|
|
171
|
+
alignItems: "center",
|
|
172
|
+
boxSizing: "border-box"
|
|
173
|
+
}
|
|
68
174
|
};
|
|
175
|
+
var styles_default = styles;
|
|
69
176
|
// src/components/DropdownSelect/Search.tsx
|
|
70
177
|
import { jsx } from "react/jsx-runtime";
|
|
71
178
|
var Search = function(param) {
|
|
72
179
|
var options = param.options, onSearch = param.onSearch;
|
|
73
180
|
return /* @__PURE__ */ jsx("div", {
|
|
74
|
-
|
|
181
|
+
style: styles_default.search_border,
|
|
75
182
|
children: /* @__PURE__ */ jsx("input", {
|
|
76
183
|
placeholder: "Search",
|
|
77
|
-
|
|
184
|
+
style: styles_default.search,
|
|
78
185
|
id: "search",
|
|
79
186
|
name: "search",
|
|
80
187
|
onChange: function(e) {
|
|
@@ -91,7 +198,8 @@ import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
|
91
198
|
var Dropdown = function() {
|
|
92
199
|
var _useMyContext = useMyContext(), options = _useMyContext.options, onChange = _useMyContext.onChange, setOpen = _useMyContext.setOpen;
|
|
93
200
|
var _useState = _sliced_to_array(useState(true), 2), isVisible = _useState[0], setVisible = _useState[1];
|
|
94
|
-
var _useState1 = _sliced_to_array(useState(
|
|
201
|
+
var _useState1 = _sliced_to_array(useState(-1), 2), keyOnHover = _useState1[0], setKeyOnHover = _useState1[1];
|
|
202
|
+
var _useState2 = _sliced_to_array(useState(options), 2), optionsCopy = _useState2[0], setOption = _useState2[1];
|
|
95
203
|
var dropdownRef = useRef(null);
|
|
96
204
|
var handleResize = function() {
|
|
97
205
|
var dropdown = dropdownRef.current;
|
|
@@ -113,13 +221,12 @@ var Dropdown = function() {
|
|
|
113
221
|
};
|
|
114
222
|
}, []);
|
|
115
223
|
return /* @__PURE__ */ jsxs("div", {
|
|
116
|
-
className: dropdownSelect_module_default.dropdown,
|
|
117
224
|
ref: dropdownRef,
|
|
118
|
-
style: isVisible ? {
|
|
225
|
+
style: isVisible ? _object_spread_props(_object_spread({}, styles_default.dropdown), {
|
|
119
226
|
top: "calc(100% + 5px)"
|
|
120
|
-
} : {
|
|
227
|
+
}) : _object_spread_props(_object_spread({}, styles_default.dropdown), {
|
|
121
228
|
bottom: "calc(100% + 5px)"
|
|
122
|
-
},
|
|
229
|
+
}),
|
|
123
230
|
children: [
|
|
124
231
|
/* @__PURE__ */ jsx2(Search_default, {
|
|
125
232
|
options: options,
|
|
@@ -127,13 +234,21 @@ var Dropdown = function() {
|
|
|
127
234
|
}),
|
|
128
235
|
optionsCopy.map(function(option, key) {
|
|
129
236
|
return /* @__PURE__ */ jsx2("div", {
|
|
130
|
-
|
|
237
|
+
style: _object_spread_props(_object_spread({}, styles_default.element), {
|
|
238
|
+
backgroundColor: keyOnHover === key ? "#f0f0f0" : "#fff"
|
|
239
|
+
}),
|
|
131
240
|
onClick: function() {
|
|
132
241
|
onChange(option.value);
|
|
133
242
|
setOpen(function(prev) {
|
|
134
243
|
return !prev;
|
|
135
244
|
});
|
|
136
245
|
},
|
|
246
|
+
onMouseEnter: function() {
|
|
247
|
+
return setKeyOnHover(key);
|
|
248
|
+
},
|
|
249
|
+
onMouseLeave: function() {
|
|
250
|
+
return setKeyOnHover(-1);
|
|
251
|
+
},
|
|
137
252
|
children: option.label
|
|
138
253
|
}, key);
|
|
139
254
|
})
|
|
@@ -147,6 +262,7 @@ import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
|
147
262
|
var DropdownSelect = function(param) {
|
|
148
263
|
var options = param.options, value = param.value, onChange = param.onChange, _param_width = param.width, width = _param_width === void 0 ? "200" : _param_width;
|
|
149
264
|
var _useState2 = _sliced_to_array(useState2(false), 2), open = _useState2[0], setOpen = _useState2[1];
|
|
265
|
+
var _useState21 = _sliced_to_array(useState2(false), 2), isHoverClose = _useState21[0], setHoverClose = _useState21[1];
|
|
150
266
|
var selectRef = useRef2(null);
|
|
151
267
|
var clickHandler = function(e) {
|
|
152
268
|
var select = selectRef.current;
|
|
@@ -175,7 +291,7 @@ var DropdownSelect = function(param) {
|
|
|
175
291
|
ref: selectRef,
|
|
176
292
|
children: [
|
|
177
293
|
/* @__PURE__ */ jsxs2("div", {
|
|
178
|
-
|
|
294
|
+
style: styles_default.select_box,
|
|
179
295
|
onClick: function() {
|
|
180
296
|
return setOpen(function(prev) {
|
|
181
297
|
return !prev;
|
|
@@ -183,11 +299,13 @@ var DropdownSelect = function(param) {
|
|
|
183
299
|
},
|
|
184
300
|
children: [
|
|
185
301
|
/* @__PURE__ */ jsx3("div", {
|
|
186
|
-
|
|
302
|
+
style: styles_default.value,
|
|
187
303
|
children: value
|
|
188
304
|
}),
|
|
189
305
|
/* @__PURE__ */ jsx3("div", {
|
|
190
|
-
|
|
306
|
+
style: _object_spread_props(_object_spread({}, styles_default.close), {
|
|
307
|
+
backgroundColor: isHoverClose ? "#f0f0f0" : "#fff"
|
|
308
|
+
}),
|
|
191
309
|
title: "clear",
|
|
192
310
|
onClick: function() {
|
|
193
311
|
onChange("");
|
|
@@ -195,6 +313,12 @@ var DropdownSelect = function(param) {
|
|
|
195
313
|
return !prev;
|
|
196
314
|
});
|
|
197
315
|
},
|
|
316
|
+
onMouseEnter: function() {
|
|
317
|
+
return setHoverClose(true);
|
|
318
|
+
},
|
|
319
|
+
onMouseLeave: function() {
|
|
320
|
+
return setHoverClose(false);
|
|
321
|
+
},
|
|
198
322
|
children: /* @__PURE__ */ jsx3(IoMdClose, {})
|
|
199
323
|
})
|
|
200
324
|
]
|
|
@@ -207,15 +331,6 @@ var DropdownSelect = function(param) {
|
|
|
207
331
|
var DropdownSelect_default = DropdownSelect;
|
|
208
332
|
// src/components/RangeSlider/RangeSlider.tsx
|
|
209
333
|
import { useEffect as useEffect3, useRef as useRef3, useState as useState3 } from "react";
|
|
210
|
-
// scss-module:./rangeSlider.module.css#scss-module
|
|
211
|
-
var rangeSlider_module_default = {
|
|
212
|
-
"slider_border": "rangeSlider-module__slider_border___CoeFx",
|
|
213
|
-
"thumb": "rangeSlider-module__thumb___OnFSM",
|
|
214
|
-
"thumb_shadow": "rangeSlider-module__thumb_shadow___L16TY",
|
|
215
|
-
"fill": "rangeSlider-module__fill___urGCN",
|
|
216
|
-
"rest": "rangeSlider-module__rest___pO2pi",
|
|
217
|
-
"value": "rangeSlider-module__value___Evg0D"
|
|
218
|
-
};
|
|
219
334
|
// src/components/RangeSlider/functions.ts
|
|
220
335
|
function encode(value, min, max) {
|
|
221
336
|
return (parseInt(value) - parseInt(min)) * 100 / (parseInt(max) - parseInt(min));
|
|
@@ -223,6 +338,70 @@ function encode(value, min, max) {
|
|
|
223
338
|
function decode(percent, min, max) {
|
|
224
339
|
return Math.round(parseInt(min) + percent * (parseInt(max) - parseInt(min)));
|
|
225
340
|
}
|
|
341
|
+
// src/components/RangeSlider/styles.ts
|
|
342
|
+
var styles2 = {
|
|
343
|
+
slider_border: {
|
|
344
|
+
position: "relative",
|
|
345
|
+
display: "flex",
|
|
346
|
+
gap: "5px",
|
|
347
|
+
flexDirection: "column",
|
|
348
|
+
height: "10px"
|
|
349
|
+
},
|
|
350
|
+
thumb: {
|
|
351
|
+
width: "17px",
|
|
352
|
+
height: "17px",
|
|
353
|
+
cursor: "pointer",
|
|
354
|
+
position: "absolute",
|
|
355
|
+
borderRadius: "50%",
|
|
356
|
+
top: "50%",
|
|
357
|
+
transform: "translate(-50%, -50%)",
|
|
358
|
+
zIndex: 1
|
|
359
|
+
},
|
|
360
|
+
thumb_shadow: {
|
|
361
|
+
content: '""',
|
|
362
|
+
position: "absolute",
|
|
363
|
+
top: "-9px",
|
|
364
|
+
left: "-9px",
|
|
365
|
+
width: "35px",
|
|
366
|
+
height: "35px",
|
|
367
|
+
opacity: 0.2,
|
|
368
|
+
zIndex: -1,
|
|
369
|
+
borderRadius: "50%",
|
|
370
|
+
scale: "0",
|
|
371
|
+
transition: "scale .1s linear"
|
|
372
|
+
},
|
|
373
|
+
fill: {
|
|
374
|
+
position: "absolute",
|
|
375
|
+
left: 0,
|
|
376
|
+
top: 0,
|
|
377
|
+
height: "100%",
|
|
378
|
+
borderRadius: "5px",
|
|
379
|
+
cursor: "pointer"
|
|
380
|
+
},
|
|
381
|
+
rest: {
|
|
382
|
+
position: "absolute",
|
|
383
|
+
top: "50%",
|
|
384
|
+
transform: "translateY(-50%)",
|
|
385
|
+
opacity: 0.3,
|
|
386
|
+
width: "100%",
|
|
387
|
+
height: "70%",
|
|
388
|
+
borderRadius: "5px",
|
|
389
|
+
cursor: "pointer"
|
|
390
|
+
},
|
|
391
|
+
value: {
|
|
392
|
+
position: "absolute",
|
|
393
|
+
bottom: "30px",
|
|
394
|
+
left: "50%",
|
|
395
|
+
transform: "translateX(-50%)",
|
|
396
|
+
transformOrigin: "bottom left",
|
|
397
|
+
backgroundColor: "#f0f0f7",
|
|
398
|
+
borderRadius: "5px",
|
|
399
|
+
padding: "5px",
|
|
400
|
+
scale: "0",
|
|
401
|
+
transition: "scale .1s linear"
|
|
402
|
+
}
|
|
403
|
+
};
|
|
404
|
+
var styles_default2 = styles2;
|
|
226
405
|
// src/components/RangeSlider/RangeSlider.tsx
|
|
227
406
|
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
228
407
|
var RangeSlider = function(param) {
|
|
@@ -279,10 +458,9 @@ var RangeSlider = function(param) {
|
|
|
279
458
|
isMouseDown
|
|
280
459
|
]);
|
|
281
460
|
return /* @__PURE__ */ jsxs3("div", {
|
|
282
|
-
|
|
283
|
-
style: {
|
|
461
|
+
style: _object_spread_props(_object_spread({}, styles_default2.slider_border), {
|
|
284
462
|
width: "".concat(width, "px")
|
|
285
|
-
},
|
|
463
|
+
}),
|
|
286
464
|
onMouseDown: function(e) {
|
|
287
465
|
handleDrag(true, e);
|
|
288
466
|
setMouseDown(true);
|
|
@@ -294,18 +472,16 @@ var RangeSlider = function(param) {
|
|
|
294
472
|
ref: sliderBorderRef,
|
|
295
473
|
children: [
|
|
296
474
|
/* @__PURE__ */ jsx4("span", {
|
|
297
|
-
|
|
298
|
-
style: {
|
|
475
|
+
style: _object_spread_props(_object_spread({}, styles_default2.fill), {
|
|
299
476
|
background: color,
|
|
300
477
|
width: "".concat(percentage, "%")
|
|
301
|
-
}
|
|
478
|
+
})
|
|
302
479
|
}),
|
|
303
480
|
/* @__PURE__ */ jsxs3("span", {
|
|
304
|
-
|
|
305
|
-
style: {
|
|
481
|
+
style: _object_spread_props(_object_spread({}, styles_default2.thumb), {
|
|
306
482
|
background: color,
|
|
307
483
|
left: "".concat(percentage, "%")
|
|
308
|
-
},
|
|
484
|
+
}),
|
|
309
485
|
onMouseMove: function() {
|
|
310
486
|
return setHover(true);
|
|
311
487
|
},
|
|
@@ -314,63 +490,107 @@ var RangeSlider = function(param) {
|
|
|
314
490
|
},
|
|
315
491
|
children: [
|
|
316
492
|
/* @__PURE__ */ jsx4("span", {
|
|
317
|
-
|
|
318
|
-
style: {
|
|
493
|
+
style: _object_spread_props(_object_spread({}, styles_default2.value), {
|
|
319
494
|
scale: isMouseDown || isHover ? "1" : "0"
|
|
320
|
-
},
|
|
495
|
+
}),
|
|
321
496
|
children: value
|
|
322
497
|
}),
|
|
323
498
|
/* @__PURE__ */ jsx4("span", {
|
|
324
|
-
|
|
325
|
-
style: {
|
|
499
|
+
style: _object_spread_props(_object_spread({}, styles_default2.thumb_shadow), {
|
|
326
500
|
background: color,
|
|
327
501
|
scale: isMouseDown || isHover ? "1" : "0"
|
|
328
|
-
}
|
|
502
|
+
})
|
|
329
503
|
})
|
|
330
504
|
]
|
|
331
505
|
}),
|
|
332
506
|
/* @__PURE__ */ jsx4("span", {
|
|
333
|
-
|
|
334
|
-
style: {
|
|
507
|
+
style: _object_spread_props(_object_spread({}, styles_default2.rest), {
|
|
335
508
|
background: color
|
|
336
|
-
}
|
|
509
|
+
})
|
|
337
510
|
})
|
|
338
511
|
]
|
|
339
512
|
});
|
|
340
513
|
};
|
|
341
514
|
var RangeSlider_default = RangeSlider;
|
|
342
|
-
//
|
|
343
|
-
var
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
515
|
+
// src/components/OptionSlider/styles.ts
|
|
516
|
+
var styles3 = {
|
|
517
|
+
border: {
|
|
518
|
+
borderRadius: "10px",
|
|
519
|
+
overflow: "auto",
|
|
520
|
+
boxShadow: "rgba(0, 0, 0, 0.16) 0px 1px 4px",
|
|
521
|
+
aspectRatio: "4",
|
|
522
|
+
display: "flex",
|
|
523
|
+
flexDirection: "row",
|
|
524
|
+
position: "relative",
|
|
525
|
+
scrollbarWidth: "none",
|
|
526
|
+
msOverflowStyle: "none",
|
|
527
|
+
boxSizing: "border-box",
|
|
528
|
+
margin: 0,
|
|
529
|
+
padding: 0
|
|
530
|
+
},
|
|
531
|
+
background: {
|
|
532
|
+
position: "relative",
|
|
533
|
+
width: "100%",
|
|
534
|
+
height: "100%",
|
|
535
|
+
opacity: "0.3",
|
|
536
|
+
boxSizing: "border-box",
|
|
537
|
+
margin: 0,
|
|
538
|
+
padding: 0
|
|
539
|
+
},
|
|
540
|
+
options: {
|
|
541
|
+
height: "100%",
|
|
542
|
+
padding: "5px",
|
|
543
|
+
gap: "5px",
|
|
544
|
+
position: "absolute",
|
|
545
|
+
top: "50%",
|
|
546
|
+
transform: "translateY(-50%)",
|
|
547
|
+
left: 0,
|
|
548
|
+
display: "flex",
|
|
549
|
+
flexDirection: "row",
|
|
550
|
+
justifyContent: "center",
|
|
551
|
+
alignItems: "center",
|
|
552
|
+
boxSizing: "border-box",
|
|
553
|
+
margin: 0
|
|
554
|
+
},
|
|
555
|
+
element: {
|
|
556
|
+
display: "flex",
|
|
557
|
+
justifyContent: "center",
|
|
558
|
+
alignItems: "center",
|
|
559
|
+
cursor: "pointer",
|
|
560
|
+
width: "auto",
|
|
561
|
+
height: "100%",
|
|
562
|
+
aspectRatio: "1 / 1",
|
|
563
|
+
borderRadius: "50%",
|
|
564
|
+
overflow: "hidden",
|
|
565
|
+
border: "solid 1px #000",
|
|
566
|
+
boxSizing: "border-box",
|
|
567
|
+
margin: 0,
|
|
568
|
+
padding: 0
|
|
569
|
+
}
|
|
348
570
|
};
|
|
571
|
+
var styles_default3 = styles3;
|
|
349
572
|
// src/components/OptionSlider/OptionSlider.tsx
|
|
350
573
|
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
351
574
|
var OptionSlider = function(param) {
|
|
352
575
|
var value = param.value, onChange = param.onChange, _param_width = param.width, width = _param_width === void 0 ? "200" : _param_width, options = param.options, _param_color = param.color, color = _param_color === void 0 ? "#f0f0f7" : _param_color;
|
|
353
576
|
return /* @__PURE__ */ jsxs4("div", {
|
|
354
|
-
|
|
355
|
-
style: {
|
|
577
|
+
style: _object_spread_props(_object_spread({}, styles_default3.border), {
|
|
356
578
|
width: "".concat(width, "px")
|
|
357
|
-
},
|
|
579
|
+
}),
|
|
358
580
|
children: [
|
|
359
581
|
/* @__PURE__ */ jsx5("div", {
|
|
360
|
-
|
|
361
|
-
style: {
|
|
582
|
+
style: _object_spread_props(_object_spread({}, styles_default3.background), {
|
|
362
583
|
background: color
|
|
363
|
-
}
|
|
584
|
+
})
|
|
364
585
|
}),
|
|
365
586
|
/* @__PURE__ */ jsx5("div", {
|
|
366
|
-
|
|
587
|
+
style: styles_default3.options,
|
|
367
588
|
children: options.map(function(option, key) {
|
|
368
589
|
return /* @__PURE__ */ jsx5("div", {
|
|
369
|
-
style: {
|
|
590
|
+
style: _object_spread_props(_object_spread({}, styles_default3.element), {
|
|
370
591
|
background: color,
|
|
371
592
|
border: value === option.value ? "solid 2px #000" : "solid 1px #000"
|
|
372
|
-
},
|
|
373
|
-
className: optionSlider_module_default.element,
|
|
593
|
+
}),
|
|
374
594
|
onClick: function() {
|
|
375
595
|
return onChange(option.value);
|
|
376
596
|
},
|
|
@@ -385,12 +605,6 @@ var OptionSlider = function(param) {
|
|
|
385
605
|
var OptionSlider_default = OptionSlider;
|
|
386
606
|
// src/components/ColorPickerSlider/ColorPickerSlider.tsx
|
|
387
607
|
import { useEffect as useEffect4, useRef as useRef4, useState as useState4 } from "react";
|
|
388
|
-
// scss-module:./colorPickerSlider.module.css#scss-module
|
|
389
|
-
var colorPickerSlider_module_default = {
|
|
390
|
-
"border": "colorPickerSlider-module__border___-6cw8",
|
|
391
|
-
"thumb": "colorPickerSlider-module__thumb___p2fHW",
|
|
392
|
-
"label": "colorPickerSlider-module__label___Aa0AV"
|
|
393
|
-
};
|
|
394
608
|
// src/components/ColorPickerSlider/functions.ts
|
|
395
609
|
function encode2(color) {
|
|
396
610
|
var h = hexToHsl(color).h;
|
|
@@ -494,6 +708,39 @@ function hslToHex(h, s, l) {
|
|
|
494
708
|
};
|
|
495
709
|
return "#".concat(toHex(r)).concat(toHex(g)).concat(toHex(b));
|
|
496
710
|
}
|
|
711
|
+
// src/components/ColorPickerSlider/styles.ts
|
|
712
|
+
var styles4 = {
|
|
713
|
+
border: {
|
|
714
|
+
background: "linear-gradient(to right, hsl(0, 100%, 50%), hsl(60, 100%, 50%), hsl(120, 100%, 50%), hsl(180, 100%, 50%), hsl(240, 100%, 50%), hsl(300, 100%, 50%), hsl(0, 100%, 50%))",
|
|
715
|
+
borderRadius: "10px",
|
|
716
|
+
aspectRatio: 20,
|
|
717
|
+
cursor: "pointer",
|
|
718
|
+
appearance: "none",
|
|
719
|
+
outline: "none",
|
|
720
|
+
position: "relative"
|
|
721
|
+
},
|
|
722
|
+
thumb: {
|
|
723
|
+
borderRadius: "50%",
|
|
724
|
+
aspectRatio: 1,
|
|
725
|
+
position: "absolute",
|
|
726
|
+
top: "50%",
|
|
727
|
+
transform: "translate(-50%, -50%)",
|
|
728
|
+
boxShadow: "rgba(0, 0, 0, 0.24) 0px 3px 8px",
|
|
729
|
+
border: "solid 2px #fff"
|
|
730
|
+
},
|
|
731
|
+
label: {
|
|
732
|
+
position: "absolute",
|
|
733
|
+
bottom: "200%",
|
|
734
|
+
transform: "translateX(-50%)",
|
|
735
|
+
borderRadius: "5px",
|
|
736
|
+
padding: "5px",
|
|
737
|
+
fontSize: "15px",
|
|
738
|
+
background: "#f0f0f7",
|
|
739
|
+
transition: "scale .1s linear",
|
|
740
|
+
transformOrigin: "bottom left"
|
|
741
|
+
}
|
|
742
|
+
};
|
|
743
|
+
var styles_default4 = styles4;
|
|
497
744
|
// src/components/ColorPickerSlider/ColorPickerSlider.tsx
|
|
498
745
|
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
499
746
|
var ColorPickerSlider = function(param) {
|
|
@@ -545,10 +792,9 @@ var ColorPickerSlider = function(param) {
|
|
|
545
792
|
isMouseDown
|
|
546
793
|
]);
|
|
547
794
|
return /* @__PURE__ */ jsxs5("div", {
|
|
548
|
-
|
|
549
|
-
style: {
|
|
795
|
+
style: _object_spread_props(_object_spread({}, styles_default4.border), {
|
|
550
796
|
width: "".concat(width, "px")
|
|
551
|
-
},
|
|
797
|
+
}),
|
|
552
798
|
onMouseDown: function(e) {
|
|
553
799
|
handleDrag(true, e);
|
|
554
800
|
setMouseDown(true);
|
|
@@ -560,12 +806,11 @@ var ColorPickerSlider = function(param) {
|
|
|
560
806
|
ref: sliderBorderRef,
|
|
561
807
|
children: [
|
|
562
808
|
/* @__PURE__ */ jsx6("div", {
|
|
563
|
-
|
|
564
|
-
style: {
|
|
809
|
+
style: _object_spread_props(_object_spread({}, styles_default4.thumb), {
|
|
565
810
|
width: "".concat(parseInt(width) * 0.1, "px"),
|
|
566
811
|
background: value,
|
|
567
812
|
left: "".concat(percentage, "%")
|
|
568
|
-
},
|
|
813
|
+
}),
|
|
569
814
|
onMouseMove: function() {
|
|
570
815
|
return setHover(true);
|
|
571
816
|
},
|
|
@@ -574,11 +819,10 @@ var ColorPickerSlider = function(param) {
|
|
|
574
819
|
}
|
|
575
820
|
}),
|
|
576
821
|
/* @__PURE__ */ jsx6("div", {
|
|
577
|
-
|
|
578
|
-
style: {
|
|
822
|
+
style: _object_spread_props(_object_spread({}, styles_default4.label), {
|
|
579
823
|
left: "".concat(percentage, "%"),
|
|
580
824
|
scale: isHover || isMouseDown ? "1" : "0"
|
|
581
|
-
},
|
|
825
|
+
}),
|
|
582
826
|
children: value
|
|
583
827
|
})
|
|
584
828
|
]
|