react-proportion-slider 0.9.4 → 0.9.5
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.
@@ -1,847 +1,219 @@
|
|
1
|
-
import
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
* This source code is licensed under the MIT license found in the
|
10
|
-
* LICENSE file in the root directory of this source tree.
|
11
|
-
*/
|
12
|
-
var Ne;
|
13
|
-
function wr() {
|
14
|
-
if (Ne) return ee;
|
15
|
-
Ne = 1;
|
16
|
-
var i = He, _ = Symbol.for("react.element"), l = Symbol.for("react.fragment"), S = Object.prototype.hasOwnProperty, x = i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, O = { key: !0, ref: !0, __self: !0, __source: !0 };
|
17
|
-
function k(j, p, F) {
|
18
|
-
var f, h = {}, g = null, E = null;
|
19
|
-
F !== void 0 && (g = "" + F), p.key !== void 0 && (g = "" + p.key), p.ref !== void 0 && (E = p.ref);
|
20
|
-
for (f in p) S.call(p, f) && !O.hasOwnProperty(f) && (h[f] = p[f]);
|
21
|
-
if (j && j.defaultProps) for (f in p = j.defaultProps, p) h[f] === void 0 && (h[f] = p[f]);
|
22
|
-
return { $$typeof: _, type: j, key: g, ref: E, props: h, _owner: x.current };
|
23
|
-
}
|
24
|
-
return ee.Fragment = l, ee.jsx = k, ee.jsxs = k, ee;
|
25
|
-
}
|
26
|
-
var re = {};
|
27
|
-
/**
|
28
|
-
* @license React
|
29
|
-
* react-jsx-runtime.development.js
|
30
|
-
*
|
31
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
32
|
-
*
|
33
|
-
* This source code is licensed under the MIT license found in the
|
34
|
-
* LICENSE file in the root directory of this source tree.
|
35
|
-
*/
|
36
|
-
var Ve;
|
37
|
-
function Tr() {
|
38
|
-
return Ve || (Ve = 1, process.env.NODE_ENV !== "production" && function() {
|
39
|
-
var i = He, _ = Symbol.for("react.element"), l = Symbol.for("react.portal"), S = Symbol.for("react.fragment"), x = Symbol.for("react.strict_mode"), O = Symbol.for("react.profiler"), k = Symbol.for("react.provider"), j = Symbol.for("react.context"), p = Symbol.for("react.forward_ref"), F = Symbol.for("react.suspense"), f = Symbol.for("react.suspense_list"), h = Symbol.for("react.memo"), g = Symbol.for("react.lazy"), E = Symbol.for("react.offscreen"), M = Symbol.iterator, K = "@@iterator";
|
40
|
-
function A(e) {
|
41
|
-
if (e === null || typeof e != "object")
|
42
|
-
return null;
|
43
|
-
var r = M && e[M] || e[K];
|
44
|
-
return typeof r == "function" ? r : null;
|
45
|
-
}
|
46
|
-
var m = i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
47
|
-
function c(e) {
|
48
|
-
{
|
49
|
-
for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
|
50
|
-
t[n - 1] = arguments[n];
|
51
|
-
D("error", e, t);
|
52
|
-
}
|
53
|
-
}
|
54
|
-
function D(e, r, t) {
|
55
|
-
{
|
56
|
-
var n = m.ReactDebugCurrentFrame, s = n.getStackAddendum();
|
57
|
-
s !== "" && (r += "%s", t = t.concat([s]));
|
58
|
-
var u = t.map(function(o) {
|
59
|
-
return String(o);
|
60
|
-
});
|
61
|
-
u.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, u);
|
62
|
-
}
|
63
|
-
}
|
64
|
-
var L = !1, y = !1, C = !1, b = !1, I = !1, B;
|
65
|
-
B = Symbol.for("react.module.reference");
|
66
|
-
function z(e) {
|
67
|
-
return !!(typeof e == "string" || typeof e == "function" || e === S || e === O || I || e === x || e === F || e === f || b || e === E || L || y || C || typeof e == "object" && e !== null && (e.$$typeof === g || e.$$typeof === h || e.$$typeof === k || e.$$typeof === j || e.$$typeof === p || // This needs to include all possible module reference object
|
68
|
-
// types supported by any Flight configuration anywhere since
|
69
|
-
// we don't know which Flight build this will end up being used
|
70
|
-
// with.
|
71
|
-
e.$$typeof === B || e.getModuleId !== void 0));
|
72
|
-
}
|
73
|
-
function N(e, r, t) {
|
74
|
-
var n = e.displayName;
|
75
|
-
if (n)
|
76
|
-
return n;
|
77
|
-
var s = r.displayName || r.name || "";
|
78
|
-
return s !== "" ? t + "(" + s + ")" : t;
|
79
|
-
}
|
80
|
-
function H(e) {
|
81
|
-
return e.displayName || "Context";
|
82
|
-
}
|
83
|
-
function W(e) {
|
84
|
-
if (e == null)
|
85
|
-
return null;
|
86
|
-
if (typeof e.tag == "number" && c("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
87
|
-
return e.displayName || e.name || null;
|
88
|
-
if (typeof e == "string")
|
89
|
-
return e;
|
90
|
-
switch (e) {
|
91
|
-
case S:
|
92
|
-
return "Fragment";
|
93
|
-
case l:
|
94
|
-
return "Portal";
|
95
|
-
case O:
|
96
|
-
return "Profiler";
|
97
|
-
case x:
|
98
|
-
return "StrictMode";
|
99
|
-
case F:
|
100
|
-
return "Suspense";
|
101
|
-
case f:
|
102
|
-
return "SuspenseList";
|
103
|
-
}
|
104
|
-
if (typeof e == "object")
|
105
|
-
switch (e.$$typeof) {
|
106
|
-
case j:
|
107
|
-
var r = e;
|
108
|
-
return H(r) + ".Consumer";
|
109
|
-
case k:
|
110
|
-
var t = e;
|
111
|
-
return H(t._context) + ".Provider";
|
112
|
-
case p:
|
113
|
-
return N(e, e.render, "ForwardRef");
|
114
|
-
case h:
|
115
|
-
var n = e.displayName || null;
|
116
|
-
return n !== null ? n : W(e.type) || "Memo";
|
117
|
-
case g: {
|
118
|
-
var s = e, u = s._payload, o = s._init;
|
119
|
-
try {
|
120
|
-
return W(o(u));
|
121
|
-
} catch {
|
122
|
-
return null;
|
123
|
-
}
|
124
|
-
}
|
125
|
-
}
|
126
|
-
return null;
|
127
|
-
}
|
128
|
-
var V = Object.assign, Z = 0, Ee, be, ye, Re, _e, we, Te;
|
129
|
-
function Se() {
|
130
|
-
}
|
131
|
-
Se.__reactDisabledLog = !0;
|
132
|
-
function qe() {
|
133
|
-
{
|
134
|
-
if (Z === 0) {
|
135
|
-
Ee = console.log, be = console.info, ye = console.warn, Re = console.error, _e = console.group, we = console.groupCollapsed, Te = console.groupEnd;
|
136
|
-
var e = {
|
137
|
-
configurable: !0,
|
138
|
-
enumerable: !0,
|
139
|
-
value: Se,
|
140
|
-
writable: !0
|
141
|
-
};
|
142
|
-
Object.defineProperties(console, {
|
143
|
-
info: e,
|
144
|
-
log: e,
|
145
|
-
warn: e,
|
146
|
-
error: e,
|
147
|
-
group: e,
|
148
|
-
groupCollapsed: e,
|
149
|
-
groupEnd: e
|
150
|
-
});
|
151
|
-
}
|
152
|
-
Z++;
|
153
|
-
}
|
154
|
-
}
|
155
|
-
function Xe() {
|
156
|
-
{
|
157
|
-
if (Z--, Z === 0) {
|
158
|
-
var e = {
|
159
|
-
configurable: !0,
|
160
|
-
enumerable: !0,
|
161
|
-
writable: !0
|
162
|
-
};
|
163
|
-
Object.defineProperties(console, {
|
164
|
-
log: V({}, e, {
|
165
|
-
value: Ee
|
166
|
-
}),
|
167
|
-
info: V({}, e, {
|
168
|
-
value: be
|
169
|
-
}),
|
170
|
-
warn: V({}, e, {
|
171
|
-
value: ye
|
172
|
-
}),
|
173
|
-
error: V({}, e, {
|
174
|
-
value: Re
|
175
|
-
}),
|
176
|
-
group: V({}, e, {
|
177
|
-
value: _e
|
178
|
-
}),
|
179
|
-
groupCollapsed: V({}, e, {
|
180
|
-
value: we
|
181
|
-
}),
|
182
|
-
groupEnd: V({}, e, {
|
183
|
-
value: Te
|
184
|
-
})
|
185
|
-
});
|
186
|
-
}
|
187
|
-
Z < 0 && c("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
188
|
-
}
|
189
|
-
}
|
190
|
-
var le = m.ReactCurrentDispatcher, ce;
|
191
|
-
function ne(e, r, t) {
|
192
|
-
{
|
193
|
-
if (ce === void 0)
|
194
|
-
try {
|
195
|
-
throw Error();
|
196
|
-
} catch (s) {
|
197
|
-
var n = s.stack.trim().match(/\n( *(at )?)/);
|
198
|
-
ce = n && n[1] || "";
|
199
|
-
}
|
200
|
-
return `
|
201
|
-
` + ce + e;
|
202
|
-
}
|
203
|
-
}
|
204
|
-
var fe = !1, ae;
|
205
|
-
{
|
206
|
-
var ze = typeof WeakMap == "function" ? WeakMap : Map;
|
207
|
-
ae = new ze();
|
208
|
-
}
|
209
|
-
function xe(e, r) {
|
210
|
-
if (!e || fe)
|
211
|
-
return "";
|
212
|
-
{
|
213
|
-
var t = ae.get(e);
|
214
|
-
if (t !== void 0)
|
215
|
-
return t;
|
216
|
-
}
|
217
|
-
var n;
|
218
|
-
fe = !0;
|
219
|
-
var s = Error.prepareStackTrace;
|
220
|
-
Error.prepareStackTrace = void 0;
|
221
|
-
var u;
|
222
|
-
u = le.current, le.current = null, qe();
|
223
|
-
try {
|
224
|
-
if (r) {
|
225
|
-
var o = function() {
|
226
|
-
throw Error();
|
227
|
-
};
|
228
|
-
if (Object.defineProperty(o.prototype, "props", {
|
229
|
-
set: function() {
|
230
|
-
throw Error();
|
231
|
-
}
|
232
|
-
}), typeof Reflect == "object" && Reflect.construct) {
|
233
|
-
try {
|
234
|
-
Reflect.construct(o, []);
|
235
|
-
} catch (w) {
|
236
|
-
n = w;
|
237
|
-
}
|
238
|
-
Reflect.construct(e, [], o);
|
239
|
-
} else {
|
240
|
-
try {
|
241
|
-
o.call();
|
242
|
-
} catch (w) {
|
243
|
-
n = w;
|
244
|
-
}
|
245
|
-
e.call(o.prototype);
|
246
|
-
}
|
247
|
-
} else {
|
248
|
-
try {
|
249
|
-
throw Error();
|
250
|
-
} catch (w) {
|
251
|
-
n = w;
|
252
|
-
}
|
253
|
-
e();
|
254
|
-
}
|
255
|
-
} catch (w) {
|
256
|
-
if (w && n && typeof w.stack == "string") {
|
257
|
-
for (var a = w.stack.split(`
|
258
|
-
`), R = n.stack.split(`
|
259
|
-
`), d = a.length - 1, v = R.length - 1; d >= 1 && v >= 0 && a[d] !== R[v]; )
|
260
|
-
v--;
|
261
|
-
for (; d >= 1 && v >= 0; d--, v--)
|
262
|
-
if (a[d] !== R[v]) {
|
263
|
-
if (d !== 1 || v !== 1)
|
264
|
-
do
|
265
|
-
if (d--, v--, v < 0 || a[d] !== R[v]) {
|
266
|
-
var P = `
|
267
|
-
` + a[d].replace(" at new ", " at ");
|
268
|
-
return e.displayName && P.includes("<anonymous>") && (P = P.replace("<anonymous>", e.displayName)), typeof e == "function" && ae.set(e, P), P;
|
269
|
-
}
|
270
|
-
while (d >= 1 && v >= 0);
|
271
|
-
break;
|
272
|
-
}
|
273
|
-
}
|
274
|
-
} finally {
|
275
|
-
fe = !1, le.current = u, Xe(), Error.prepareStackTrace = s;
|
276
|
-
}
|
277
|
-
var q = e ? e.displayName || e.name : "", U = q ? ne(q) : "";
|
278
|
-
return typeof e == "function" && ae.set(e, U), U;
|
279
|
-
}
|
280
|
-
function Ze(e, r, t) {
|
281
|
-
return xe(e, !1);
|
282
|
-
}
|
283
|
-
function Qe(e) {
|
284
|
-
var r = e.prototype;
|
285
|
-
return !!(r && r.isReactComponent);
|
286
|
-
}
|
287
|
-
function oe(e, r, t) {
|
288
|
-
if (e == null)
|
289
|
-
return "";
|
290
|
-
if (typeof e == "function")
|
291
|
-
return xe(e, Qe(e));
|
292
|
-
if (typeof e == "string")
|
293
|
-
return ne(e);
|
294
|
-
switch (e) {
|
295
|
-
case F:
|
296
|
-
return ne("Suspense");
|
297
|
-
case f:
|
298
|
-
return ne("SuspenseList");
|
299
|
-
}
|
300
|
-
if (typeof e == "object")
|
301
|
-
switch (e.$$typeof) {
|
302
|
-
case p:
|
303
|
-
return Ze(e.render);
|
304
|
-
case h:
|
305
|
-
return oe(e.type, r, t);
|
306
|
-
case g: {
|
307
|
-
var n = e, s = n._payload, u = n._init;
|
308
|
-
try {
|
309
|
-
return oe(u(s), r, t);
|
310
|
-
} catch {
|
311
|
-
}
|
312
|
-
}
|
313
|
-
}
|
314
|
-
return "";
|
315
|
-
}
|
316
|
-
var Q = Object.prototype.hasOwnProperty, Oe = {}, Ce = m.ReactDebugCurrentFrame;
|
317
|
-
function ie(e) {
|
318
|
-
if (e) {
|
319
|
-
var r = e._owner, t = oe(e.type, e._source, r ? r.type : null);
|
320
|
-
Ce.setExtraStackFrame(t);
|
321
|
-
} else
|
322
|
-
Ce.setExtraStackFrame(null);
|
323
|
-
}
|
324
|
-
function er(e, r, t, n, s) {
|
325
|
-
{
|
326
|
-
var u = Function.call.bind(Q);
|
327
|
-
for (var o in e)
|
328
|
-
if (u(e, o)) {
|
329
|
-
var a = void 0;
|
330
|
-
try {
|
331
|
-
if (typeof e[o] != "function") {
|
332
|
-
var R = Error((n || "React class") + ": " + t + " type `" + o + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[o] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
333
|
-
throw R.name = "Invariant Violation", R;
|
334
|
-
}
|
335
|
-
a = e[o](r, o, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
336
|
-
} catch (d) {
|
337
|
-
a = d;
|
338
|
-
}
|
339
|
-
a && !(a instanceof Error) && (ie(s), c("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, o, typeof a), ie(null)), a instanceof Error && !(a.message in Oe) && (Oe[a.message] = !0, ie(s), c("Failed %s type: %s", t, a.message), ie(null));
|
340
|
-
}
|
341
|
-
}
|
342
|
-
}
|
343
|
-
var rr = Array.isArray;
|
344
|
-
function de(e) {
|
345
|
-
return rr(e);
|
346
|
-
}
|
347
|
-
function tr(e) {
|
348
|
-
{
|
349
|
-
var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
350
|
-
return t;
|
351
|
-
}
|
352
|
-
}
|
353
|
-
function nr(e) {
|
354
|
-
try {
|
355
|
-
return Pe(e), !1;
|
356
|
-
} catch {
|
357
|
-
return !0;
|
358
|
-
}
|
359
|
-
}
|
360
|
-
function Pe(e) {
|
361
|
-
return "" + e;
|
362
|
-
}
|
363
|
-
function je(e) {
|
364
|
-
if (nr(e))
|
365
|
-
return c("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", tr(e)), Pe(e);
|
366
|
-
}
|
367
|
-
var ke = m.ReactCurrentOwner, ar = {
|
368
|
-
key: !0,
|
369
|
-
ref: !0,
|
370
|
-
__self: !0,
|
371
|
-
__source: !0
|
372
|
-
}, Fe, De;
|
373
|
-
function or(e) {
|
374
|
-
if (Q.call(e, "ref")) {
|
375
|
-
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
|
376
|
-
if (r && r.isReactWarning)
|
377
|
-
return !1;
|
378
|
-
}
|
379
|
-
return e.ref !== void 0;
|
380
|
-
}
|
381
|
-
function ir(e) {
|
382
|
-
if (Q.call(e, "key")) {
|
383
|
-
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
384
|
-
if (r && r.isReactWarning)
|
385
|
-
return !1;
|
386
|
-
}
|
387
|
-
return e.key !== void 0;
|
388
|
-
}
|
389
|
-
function sr(e, r) {
|
390
|
-
typeof e.ref == "string" && ke.current;
|
391
|
-
}
|
392
|
-
function ur(e, r) {
|
393
|
-
{
|
394
|
-
var t = function() {
|
395
|
-
Fe || (Fe = !0, c("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
396
|
-
};
|
397
|
-
t.isReactWarning = !0, Object.defineProperty(e, "key", {
|
398
|
-
get: t,
|
399
|
-
configurable: !0
|
400
|
-
});
|
401
|
-
}
|
402
|
-
}
|
403
|
-
function lr(e, r) {
|
404
|
-
{
|
405
|
-
var t = function() {
|
406
|
-
De || (De = !0, c("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
407
|
-
};
|
408
|
-
t.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
409
|
-
get: t,
|
410
|
-
configurable: !0
|
411
|
-
});
|
412
|
-
}
|
413
|
-
}
|
414
|
-
var cr = function(e, r, t, n, s, u, o) {
|
415
|
-
var a = {
|
416
|
-
// This tag allows us to uniquely identify this as a React Element
|
417
|
-
$$typeof: _,
|
418
|
-
// Built-in properties that belong on the element
|
419
|
-
type: e,
|
420
|
-
key: r,
|
421
|
-
ref: t,
|
422
|
-
props: o,
|
423
|
-
// Record the component responsible for creating this element.
|
424
|
-
_owner: u
|
425
|
-
};
|
426
|
-
return a._store = {}, Object.defineProperty(a._store, "validated", {
|
427
|
-
configurable: !1,
|
428
|
-
enumerable: !1,
|
429
|
-
writable: !0,
|
430
|
-
value: !1
|
431
|
-
}), Object.defineProperty(a, "_self", {
|
432
|
-
configurable: !1,
|
433
|
-
enumerable: !1,
|
434
|
-
writable: !1,
|
435
|
-
value: n
|
436
|
-
}), Object.defineProperty(a, "_source", {
|
437
|
-
configurable: !1,
|
438
|
-
enumerable: !1,
|
439
|
-
writable: !1,
|
440
|
-
value: s
|
441
|
-
}), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
|
442
|
-
};
|
443
|
-
function fr(e, r, t, n, s) {
|
444
|
-
{
|
445
|
-
var u, o = {}, a = null, R = null;
|
446
|
-
t !== void 0 && (je(t), a = "" + t), ir(r) && (je(r.key), a = "" + r.key), or(r) && (R = r.ref, sr(r, s));
|
447
|
-
for (u in r)
|
448
|
-
Q.call(r, u) && !ar.hasOwnProperty(u) && (o[u] = r[u]);
|
449
|
-
if (e && e.defaultProps) {
|
450
|
-
var d = e.defaultProps;
|
451
|
-
for (u in d)
|
452
|
-
o[u] === void 0 && (o[u] = d[u]);
|
453
|
-
}
|
454
|
-
if (a || R) {
|
455
|
-
var v = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
456
|
-
a && ur(o, v), R && lr(o, v);
|
457
|
-
}
|
458
|
-
return cr(e, a, R, s, n, ke.current, o);
|
459
|
-
}
|
460
|
-
}
|
461
|
-
var ve = m.ReactCurrentOwner, Le = m.ReactDebugCurrentFrame;
|
462
|
-
function J(e) {
|
463
|
-
if (e) {
|
464
|
-
var r = e._owner, t = oe(e.type, e._source, r ? r.type : null);
|
465
|
-
Le.setExtraStackFrame(t);
|
466
|
-
} else
|
467
|
-
Le.setExtraStackFrame(null);
|
468
|
-
}
|
469
|
-
var pe;
|
470
|
-
pe = !1;
|
471
|
-
function he(e) {
|
472
|
-
return typeof e == "object" && e !== null && e.$$typeof === _;
|
473
|
-
}
|
474
|
-
function Ie() {
|
475
|
-
{
|
476
|
-
if (ve.current) {
|
477
|
-
var e = W(ve.current.type);
|
478
|
-
if (e)
|
479
|
-
return `
|
480
|
-
|
481
|
-
Check the render method of \`` + e + "`.";
|
482
|
-
}
|
483
|
-
return "";
|
484
|
-
}
|
485
|
-
}
|
486
|
-
function dr(e) {
|
487
|
-
return "";
|
488
|
-
}
|
489
|
-
var Ae = {};
|
490
|
-
function vr(e) {
|
491
|
-
{
|
492
|
-
var r = Ie();
|
493
|
-
if (!r) {
|
494
|
-
var t = typeof e == "string" ? e : e.displayName || e.name;
|
495
|
-
t && (r = `
|
496
|
-
|
497
|
-
Check the top-level render call using <` + t + ">.");
|
498
|
-
}
|
499
|
-
return r;
|
500
|
-
}
|
501
|
-
}
|
502
|
-
function We(e, r) {
|
503
|
-
{
|
504
|
-
if (!e._store || e._store.validated || e.key != null)
|
505
|
-
return;
|
506
|
-
e._store.validated = !0;
|
507
|
-
var t = vr(r);
|
508
|
-
if (Ae[t])
|
509
|
-
return;
|
510
|
-
Ae[t] = !0;
|
511
|
-
var n = "";
|
512
|
-
e && e._owner && e._owner !== ve.current && (n = " It was passed a child from " + W(e._owner.type) + "."), J(e), c('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), J(null);
|
513
|
-
}
|
514
|
-
}
|
515
|
-
function $e(e, r) {
|
516
|
-
{
|
517
|
-
if (typeof e != "object")
|
518
|
-
return;
|
519
|
-
if (de(e))
|
520
|
-
for (var t = 0; t < e.length; t++) {
|
521
|
-
var n = e[t];
|
522
|
-
he(n) && We(n, r);
|
523
|
-
}
|
524
|
-
else if (he(e))
|
525
|
-
e._store && (e._store.validated = !0);
|
526
|
-
else if (e) {
|
527
|
-
var s = A(e);
|
528
|
-
if (typeof s == "function" && s !== e.entries)
|
529
|
-
for (var u = s.call(e), o; !(o = u.next()).done; )
|
530
|
-
he(o.value) && We(o.value, r);
|
531
|
-
}
|
532
|
-
}
|
533
|
-
}
|
534
|
-
function pr(e) {
|
535
|
-
{
|
536
|
-
var r = e.type;
|
537
|
-
if (r == null || typeof r == "string")
|
538
|
-
return;
|
539
|
-
var t;
|
540
|
-
if (typeof r == "function")
|
541
|
-
t = r.propTypes;
|
542
|
-
else if (typeof r == "object" && (r.$$typeof === p || // Note: Memo only checks outer props here.
|
543
|
-
// Inner props are checked in the reconciler.
|
544
|
-
r.$$typeof === h))
|
545
|
-
t = r.propTypes;
|
546
|
-
else
|
547
|
-
return;
|
548
|
-
if (t) {
|
549
|
-
var n = W(r);
|
550
|
-
er(t, e.props, "prop", n, e);
|
551
|
-
} else if (r.PropTypes !== void 0 && !pe) {
|
552
|
-
pe = !0;
|
553
|
-
var s = W(r);
|
554
|
-
c("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", s || "Unknown");
|
555
|
-
}
|
556
|
-
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && c("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
557
|
-
}
|
558
|
-
}
|
559
|
-
function hr(e) {
|
560
|
-
{
|
561
|
-
for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
|
562
|
-
var n = r[t];
|
563
|
-
if (n !== "children" && n !== "key") {
|
564
|
-
J(e), c("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), J(null);
|
565
|
-
break;
|
566
|
-
}
|
567
|
-
}
|
568
|
-
e.ref !== null && (J(e), c("Invalid attribute `ref` supplied to `React.Fragment`."), J(null));
|
569
|
-
}
|
570
|
-
}
|
571
|
-
var Ye = {};
|
572
|
-
function Me(e, r, t, n, s, u) {
|
573
|
-
{
|
574
|
-
var o = z(e);
|
575
|
-
if (!o) {
|
576
|
-
var a = "";
|
577
|
-
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
578
|
-
var R = dr();
|
579
|
-
R ? a += R : a += Ie();
|
580
|
-
var d;
|
581
|
-
e === null ? d = "null" : de(e) ? d = "array" : e !== void 0 && e.$$typeof === _ ? (d = "<" + (W(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : d = typeof e, c("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", d, a);
|
582
|
-
}
|
583
|
-
var v = fr(e, r, t, s, u);
|
584
|
-
if (v == null)
|
585
|
-
return v;
|
586
|
-
if (o) {
|
587
|
-
var P = r.children;
|
588
|
-
if (P !== void 0)
|
589
|
-
if (n)
|
590
|
-
if (de(P)) {
|
591
|
-
for (var q = 0; q < P.length; q++)
|
592
|
-
$e(P[q], e);
|
593
|
-
Object.freeze && Object.freeze(P);
|
594
|
-
} else
|
595
|
-
c("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
596
|
-
else
|
597
|
-
$e(P, e);
|
598
|
-
}
|
599
|
-
if (Q.call(r, "key")) {
|
600
|
-
var U = W(e), w = Object.keys(r).filter(function(Rr) {
|
601
|
-
return Rr !== "key";
|
602
|
-
}), ge = w.length > 0 ? "{key: someKey, " + w.join(": ..., ") + ": ...}" : "{key: someKey}";
|
603
|
-
if (!Ye[U + ge]) {
|
604
|
-
var yr = w.length > 0 ? "{" + w.join(": ..., ") + ": ...}" : "{}";
|
605
|
-
c(`A props object containing a "key" prop is being spread into JSX:
|
606
|
-
let props = %s;
|
607
|
-
<%s {...props} />
|
608
|
-
React keys must be passed directly to JSX without using spread:
|
609
|
-
let props = %s;
|
610
|
-
<%s key={someKey} {...props} />`, ge, U, yr, U), Ye[U + ge] = !0;
|
611
|
-
}
|
612
|
-
}
|
613
|
-
return e === S ? hr(v) : pr(v), v;
|
614
|
-
}
|
615
|
-
}
|
616
|
-
function gr(e, r, t) {
|
617
|
-
return Me(e, r, t, !0);
|
618
|
-
}
|
619
|
-
function mr(e, r, t) {
|
620
|
-
return Me(e, r, t, !1);
|
621
|
-
}
|
622
|
-
var Er = mr, br = gr;
|
623
|
-
re.Fragment = S, re.jsx = Er, re.jsxs = br;
|
624
|
-
}()), re;
|
625
|
-
}
|
626
|
-
var Ue;
|
627
|
-
function Sr() {
|
628
|
-
return Ue || (Ue = 1, process.env.NODE_ENV === "production" ? ue.exports = wr() : ue.exports = Tr()), ue.exports;
|
629
|
-
}
|
630
|
-
var T = Sr();
|
631
|
-
const Ge = ({ children: i }) => /* @__PURE__ */ T.jsx("span", { "aria-hidden": "true", style: { visibility: "hidden" }, children: i }), Ke = ({
|
632
|
-
detail: i,
|
633
|
-
valueLabel: _,
|
634
|
-
primaryNode: l,
|
635
|
-
width: S,
|
636
|
-
ariaLabel: x
|
1
|
+
import { jsx as i, jsxs as H } from "react/jsx-runtime";
|
2
|
+
import { useRef as b, useState as N, useMemo as $, useEffect as k, useCallback as W } from "react";
|
3
|
+
const D = ({ children: t }) => /* @__PURE__ */ i("span", { "aria-hidden": "true", style: { visibility: "hidden" }, children: t }), G = ({
|
4
|
+
detail: t,
|
5
|
+
valueLabel: d,
|
6
|
+
primaryNode: e,
|
7
|
+
width: y,
|
8
|
+
ariaLabel: m
|
637
9
|
}) => {
|
638
|
-
const
|
10
|
+
const v = /* @__PURE__ */ i("div", { style: Y, children: t.label }), x = /* @__PURE__ */ i("div", { style: Y, children: d }), F = /* @__PURE__ */ i("div", { style: Y, children: "100%" }), I = e === "right" ? v : x, _ = e === "left" ? v : x, p = b(null), a = b(null), s = b(null), [c, M] = N(
|
639
11
|
"both"
|
640
|
-
),
|
641
|
-
const
|
642
|
-
return
|
643
|
-
}, [
|
644
|
-
const
|
645
|
-
return
|
646
|
-
}, [
|
647
|
-
return
|
648
|
-
const
|
649
|
-
const
|
650
|
-
if (!
|
12
|
+
), C = $(() => {
|
13
|
+
const o = c === "none" || c === "primary" && e === "left";
|
14
|
+
return e === "right" ? o ? w.BOTTOM_RIGHT : w.RIGHT : o ? w.TOP_LEFT : w.RIGHT;
|
15
|
+
}, [c, e]), E = $(() => {
|
16
|
+
const o = c === "none" || c === "primary" && e === "right";
|
17
|
+
return e === "left" ? o ? w.BOTTOM_LEFT : w.LEFT : o ? w.TOP_RIGHT : w.LEFT;
|
18
|
+
}, [c, e]);
|
19
|
+
return k(() => {
|
20
|
+
const o = setInterval(() => {
|
21
|
+
const u = a.current, h = s.current, f = p.current;
|
22
|
+
if (!f || !u || !h)
|
651
23
|
return;
|
652
|
-
const
|
653
|
-
M(
|
24
|
+
const r = f.getBoundingClientRect().width, l = u.getBoundingClientRect().width, n = h.getBoundingClientRect().width, { primaryWidth: T, secondaryWidth: O } = e === "left" ? { primaryWidth: n, secondaryWidth: l } : { primaryWidth: l, secondaryWidth: n }, B = T + 2 * g <= r, S = O + T + 3 * g <= r;
|
25
|
+
M(B ? S ? "both" : "primary" : "none");
|
654
26
|
}, 33.333333333333336);
|
655
|
-
return () => clearInterval(
|
656
|
-
}, [
|
27
|
+
return () => clearInterval(o);
|
28
|
+
}, [p, a, s, e]), /* @__PURE__ */ H(
|
657
29
|
"div",
|
658
30
|
{
|
659
|
-
ref:
|
660
|
-
"aria-label":
|
31
|
+
ref: p,
|
32
|
+
"aria-label": m,
|
661
33
|
style: {
|
662
34
|
position: "relative",
|
663
|
-
width:
|
664
|
-
backgroundColor:
|
35
|
+
width: y,
|
36
|
+
backgroundColor: t.backgroundColor,
|
665
37
|
borderRadius: "5px",
|
666
38
|
color: "white"
|
667
39
|
},
|
668
40
|
children: [
|
669
|
-
/* @__PURE__ */
|
670
|
-
/* @__PURE__ */
|
671
|
-
/* @__PURE__ */
|
672
|
-
/* @__PURE__ */
|
41
|
+
/* @__PURE__ */ i("div", { ref: s, style: E, children: _ }),
|
42
|
+
/* @__PURE__ */ i("div", { ref: a, style: C, children: I }),
|
43
|
+
/* @__PURE__ */ i(D, { children: F }),
|
44
|
+
/* @__PURE__ */ i(D, { children: v })
|
673
45
|
]
|
674
46
|
}
|
675
47
|
);
|
676
|
-
},
|
48
|
+
}, g = 5, L = {
|
677
49
|
position: "absolute",
|
678
50
|
transition: "all 200ms cubic-bezier(.47,1.64,.41,.8)",
|
679
51
|
transitionProperty: "transform, top, left, bottom, right"
|
680
|
-
},
|
52
|
+
}, w = {
|
681
53
|
TOP_LEFT: {
|
682
|
-
...
|
683
|
-
left:
|
54
|
+
...L,
|
55
|
+
left: g,
|
684
56
|
top: -5,
|
685
57
|
transform: "translateY(-100%)"
|
686
58
|
},
|
687
59
|
LEFT: {
|
688
|
-
...
|
689
|
-
left:
|
60
|
+
...L,
|
61
|
+
left: g,
|
690
62
|
top: "50%",
|
691
63
|
transform: "translateY(-50%)"
|
692
64
|
},
|
693
65
|
BOTTOM_LEFT: {
|
694
|
-
...
|
695
|
-
left:
|
66
|
+
...L,
|
67
|
+
left: g,
|
696
68
|
bottom: -5,
|
697
69
|
transform: "translateY(100%)"
|
698
70
|
},
|
699
71
|
TOP_RIGHT: {
|
700
|
-
...
|
701
|
-
right:
|
72
|
+
...L,
|
73
|
+
right: g,
|
702
74
|
top: -5,
|
703
75
|
transform: "translateY(-100%)"
|
704
76
|
},
|
705
77
|
RIGHT: {
|
706
|
-
...
|
707
|
-
right:
|
78
|
+
...L,
|
79
|
+
right: g,
|
708
80
|
top: "50%",
|
709
81
|
transform: "translateY(-50%)"
|
710
82
|
},
|
711
83
|
BOTTOM_RIGHT: {
|
712
|
-
...
|
713
|
-
right:
|
84
|
+
...L,
|
85
|
+
right: g,
|
714
86
|
bottom: -5,
|
715
87
|
transform: "translateY(100%)"
|
716
88
|
}
|
717
|
-
},
|
89
|
+
}, Y = {
|
718
90
|
whiteSpace: "nowrap",
|
719
91
|
userSelect: "none"
|
720
|
-
},
|
721
|
-
className:
|
722
|
-
width:
|
723
|
-
gap:
|
724
|
-
backgroundColor:
|
725
|
-
style:
|
726
|
-
disabled:
|
727
|
-
}) => /* @__PURE__ */
|
92
|
+
}, K = ({
|
93
|
+
className: t,
|
94
|
+
width: d,
|
95
|
+
gap: e,
|
96
|
+
backgroundColor: y = "red",
|
97
|
+
style: m,
|
98
|
+
disabled: v
|
99
|
+
}) => /* @__PURE__ */ i(
|
728
100
|
"div",
|
729
101
|
{
|
730
102
|
role: "button",
|
731
|
-
className:
|
103
|
+
className: t,
|
732
104
|
style: {
|
733
105
|
alignSelf: "stretch",
|
734
106
|
borderRadius: "2px",
|
735
|
-
cursor:
|
736
|
-
...
|
737
|
-
width: `${
|
738
|
-
margin: `${
|
739
|
-
background:
|
107
|
+
cursor: v ? "not-allowed" : "ew-resize",
|
108
|
+
...m,
|
109
|
+
width: `${d}px`,
|
110
|
+
margin: `${e}px ${e}px`,
|
111
|
+
background: y
|
740
112
|
}
|
741
113
|
}
|
742
114
|
);
|
743
|
-
function
|
744
|
-
return "touches" in
|
115
|
+
function X(t) {
|
116
|
+
return "touches" in t;
|
745
117
|
}
|
746
|
-
const
|
747
|
-
value:
|
748
|
-
proportions:
|
749
|
-
onChange:
|
750
|
-
knobOptions:
|
751
|
-
disabled:
|
752
|
-
height:
|
753
|
-
ariaLabel:
|
754
|
-
className:
|
755
|
-
style:
|
756
|
-
width:
|
118
|
+
const j = (t) => X(t) ? t.touches[0].clientX : t.clientX, z = (t, d, e) => Math.min(Math.max(t, d), e), q = ({
|
119
|
+
value: t,
|
120
|
+
proportions: d,
|
121
|
+
onChange: e,
|
122
|
+
knobOptions: y,
|
123
|
+
disabled: m,
|
124
|
+
height: v,
|
125
|
+
ariaLabel: x,
|
126
|
+
className: F,
|
127
|
+
style: I,
|
128
|
+
width: _
|
757
129
|
}) => {
|
758
|
-
const
|
759
|
-
M.current =
|
760
|
-
const
|
761
|
-
(
|
762
|
-
const
|
763
|
-
|
130
|
+
const p = A(y), a = b(null), s = t[0] + t[1], c = p.width + p.gap * 2, M = b(s), C = b(c);
|
131
|
+
M.current = s, C.current = c;
|
132
|
+
const E = b(!1), o = W(
|
133
|
+
(r, { width: l, left: n }) => {
|
134
|
+
const T = j(r), O = C.current, B = (T - n - O / 2) / (l - O), S = M.current, P = z(S * B, 0, S);
|
135
|
+
e == null || e([P, S - P]);
|
764
136
|
},
|
765
|
-
[
|
766
|
-
),
|
767
|
-
(
|
768
|
-
var
|
769
|
-
const
|
770
|
-
if (
|
771
|
-
console.log("returning because of rect width",
|
137
|
+
[e]
|
138
|
+
), u = W(
|
139
|
+
(r) => {
|
140
|
+
var T;
|
141
|
+
const l = r.target, n = (T = a.current) == null ? void 0 : T.getBoundingClientRect();
|
142
|
+
if (a.current && !a.current.contains(l) || !n || n.width === 0) {
|
143
|
+
console.log("returning because of rect width", n == null ? void 0 : n.width);
|
772
144
|
return;
|
773
145
|
}
|
774
|
-
return
|
146
|
+
return r.preventDefault(), E.current = !0, o(r, n), !0;
|
775
147
|
},
|
776
|
-
[
|
777
|
-
),
|
778
|
-
(
|
779
|
-
var
|
780
|
-
const
|
781
|
-
return !
|
148
|
+
[o]
|
149
|
+
), h = W(
|
150
|
+
(r) => {
|
151
|
+
var n;
|
152
|
+
const l = (n = a.current) == null ? void 0 : n.getBoundingClientRect();
|
153
|
+
return !E.current || !l || l.width === 0 ? !1 : (r.preventDefault(), o(r, l), !0);
|
782
154
|
},
|
783
|
-
[
|
784
|
-
),
|
785
|
-
return
|
786
|
-
window.removeEventListener("mousedown",
|
787
|
-
}), [
|
155
|
+
[o]
|
156
|
+
), f = W((r) => E.current ? (E.current = !1, r.preventDefault(), !0) : !1, []);
|
157
|
+
return k(() => (window.addEventListener("mousedown", u), window.addEventListener("mousemove", h), window.addEventListener("mouseup", f), window.addEventListener("touchstart", u), window.addEventListener("touchmove", h), window.addEventListener("touchend", f), () => {
|
158
|
+
window.removeEventListener("mousedown", u), window.removeEventListener("mousemove", h), window.removeEventListener("mouseup", f), window.removeEventListener("touchstart", u), window.removeEventListener("touchmove", h), window.removeEventListener("touchend", f);
|
159
|
+
}), [u, h, f]), /* @__PURE__ */ H(
|
788
160
|
"div",
|
789
161
|
{
|
790
|
-
ref:
|
162
|
+
ref: a,
|
791
163
|
role: "slider",
|
792
|
-
"aria-label":
|
793
|
-
"aria-valuenow": Math.round(
|
164
|
+
"aria-label": x,
|
165
|
+
"aria-valuenow": Math.round(t[0] / s * 100),
|
794
166
|
style: {
|
795
167
|
display: "flex",
|
796
168
|
flexDirection: "row",
|
797
|
-
height:
|
798
|
-
width:
|
799
|
-
opacity:
|
800
|
-
cursor:
|
801
|
-
...
|
169
|
+
height: v,
|
170
|
+
width: _,
|
171
|
+
opacity: m ? 0.6 : 1,
|
172
|
+
cursor: m ? "not-allowed" : "pointer",
|
173
|
+
...I
|
802
174
|
},
|
803
|
-
className:
|
175
|
+
className: F,
|
804
176
|
children: [
|
805
|
-
/* @__PURE__ */
|
806
|
-
|
177
|
+
/* @__PURE__ */ i(
|
178
|
+
G,
|
807
179
|
{
|
808
|
-
detail:
|
809
|
-
valueLabel: `${Math.round(
|
810
|
-
width: `calc(${
|
180
|
+
detail: d[0],
|
181
|
+
valueLabel: `${Math.round(t[0] * 100 / s)}%`,
|
182
|
+
width: `calc(${t[0] * 100 / s}% - ${c / 2}px)`,
|
811
183
|
primaryNode: "left"
|
812
184
|
}
|
813
185
|
),
|
814
|
-
/* @__PURE__ */
|
815
|
-
/* @__PURE__ */
|
816
|
-
|
186
|
+
/* @__PURE__ */ i(K, { disabled: m, ...p }),
|
187
|
+
/* @__PURE__ */ i(
|
188
|
+
G,
|
817
189
|
{
|
818
|
-
detail:
|
819
|
-
valueLabel: `${Math.round(
|
820
|
-
width: `calc(${
|
190
|
+
detail: d[1],
|
191
|
+
valueLabel: `${Math.round(t[1] * 100 / s)}%`,
|
192
|
+
width: `calc(${t[1] * 100 / s}% - ${c / 2}px)`,
|
821
193
|
primaryNode: "right"
|
822
194
|
}
|
823
195
|
)
|
824
196
|
]
|
825
197
|
}
|
826
198
|
);
|
827
|
-
},
|
199
|
+
}, R = {
|
828
200
|
width: 5,
|
829
201
|
gap: 2,
|
830
202
|
backgroundColor: "red",
|
831
203
|
className: "slider-knob",
|
832
204
|
style: {}
|
833
205
|
};
|
834
|
-
function
|
206
|
+
function A(t = {}) {
|
835
207
|
return {
|
836
|
-
width:
|
837
|
-
gap:
|
838
|
-
backgroundColor:
|
839
|
-
className:
|
840
|
-
style:
|
208
|
+
width: t.width ?? R.width,
|
209
|
+
gap: t.gap ?? R.gap,
|
210
|
+
backgroundColor: t.backgroundColor ?? R.backgroundColor,
|
211
|
+
className: t.className ?? R.className,
|
212
|
+
style: t.style ?? R.style
|
841
213
|
};
|
842
214
|
}
|
843
215
|
export {
|
844
|
-
|
845
|
-
|
216
|
+
q as ProportionSlider,
|
217
|
+
q as default
|
846
218
|
};
|
847
219
|
//# sourceMappingURL=react-proportion-slider.es.js.map
|