@eightshift/ui-components 8.1.0 → 8.2.0
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/dist/{Autocomplete-BUU44AuW.js → Autocomplete-CO9aIsTe.js} +29 -25
- package/dist/{Button-_E2Z5G2l.js → Button-DO3oQfCq.js} +15 -9
- package/dist/{Dialog-3XLIaepk.js → Dialog-Bdqjmtt2.js} +293 -160
- package/dist/{Disclosure-Dh0z_DEQ.js → Disclosure-BTSsPhG9.js} +33 -29
- package/dist/{FocusScope-BKGWN6UK.js → FocusScope-Cj6cUR6X.js} +8 -6
- package/dist/{Heading-BWTs9ckA.js → Heading-BQje2nS2.js} +1 -1
- package/dist/{I18nProvider-BskRMK8G.js → I18nProvider-R_4IDnf9.js} +1 -1
- package/dist/{Label-UpU4cKPh.js → Label-C4bJkVti.js} +1 -1
- package/dist/{ListBox-DepY-52g.js → ListBox-CBvtIFuB.js} +20 -16
- package/dist/{NumberFormatter-WKBRKiEA.js → NumberFormatter-Bwdv413k.js} +4 -2
- package/dist/{RadioGroup-Br9Mn9QJ.js → RadioGroup-Dxzko0ma.js} +35 -35
- package/dist/{SearchField-q2Fj0L9K.js → SearchField-zY9JqR1c.js} +29 -26
- package/dist/{Slider-B8icnyOo.js → Slider-BXc72kE0.js} +55 -44
- package/dist/{Text-D4y19vs8.js → Text-i-ZK4MiL.js} +1 -1
- package/dist/{VisuallyHidden-B_LZ_kn7.js → VisuallyHidden-CsM0VnV1.js} +2 -2
- package/dist/{animation-DpSgtWyu.js → animation-COc9P6ap.js} +2 -4
- package/dist/assets/{image-analysis-worker-BuHru-CI.js → image-analysis-worker-CBOB71mx.js} +1 -1
- package/dist/assets/style-admin.css +1 -1
- package/dist/assets/style-editor.css +1 -1
- package/dist/assets/style.css +1 -1
- package/dist/{button-XSk_8UW7.js → button-C7mc6eS1.js} +15 -12
- package/dist/{checkbox-BYaS9tQ5.js → checkbox-DlG5DILl.js} +8 -8
- package/dist/{color-swatch-6ZEIXej3.js → color-swatch-D6xMLGU-.js} +14 -15
- package/dist/components/animated-visibility/animated-visibility.js +5 -3
- package/dist/components/base-control/base-control.js +1 -1
- package/dist/components/base-control/container.d.ts +4 -30
- package/dist/components/base-control/container.js +5 -32
- package/dist/components/breakpoint-preview/breakpoint-preview.js +1 -1
- package/dist/components/button/button.js +1 -1
- package/dist/components/checkbox/checkbox.js +1 -1
- package/dist/components/color-pickers/color-picker.js +7 -7
- package/dist/components/color-pickers/color-swatch.js +1 -1
- package/dist/components/color-pickers/gradient-editor.js +1 -1
- package/dist/components/color-pickers/solid-color-picker.js +1 -1
- package/dist/components/component-toggle/component-toggle.js +3 -3
- package/dist/components/container-panel/container-panel.js +11 -11
- package/dist/components/contextual-help/contextual-help.js +2 -2
- package/dist/components/draggable/draggable.d.ts +3 -3
- package/dist/components/draggable/draggable.js +1 -1
- package/dist/components/draggable-list/draggable-list.d.ts +3 -3
- package/dist/components/draggable-list/draggable-list.js +8 -8
- package/dist/components/expandable/expandable.js +3 -3
- package/dist/components/index.js +16 -16
- package/dist/components/input-field/input-field.js +1 -1
- package/dist/components/item-collection/item-collection.d.ts +3 -28
- package/dist/components/item-collection/item-collection.js +6 -6
- package/dist/components/link-input/link-input.d.ts +0 -2
- package/dist/components/link-input/link-input.js +1 -1
- package/dist/components/matrix-align/matrix-align.js +4 -3
- package/dist/components/menu/menu.js +10 -7
- package/dist/components/modal/modal.js +1 -1
- package/dist/components/notice/notice.js +8 -8
- package/dist/components/number-picker/number-picker.js +1 -1
- package/dist/components/option-select/option-select.d.ts +1 -1
- package/dist/components/option-select/option-select.js +21 -15
- package/dist/components/options-panel/options-panel.js +4 -4
- package/dist/components/placeholders/file-picker-shell.js +4 -3
- package/dist/components/placeholders/file-placeholder.js +2 -1
- package/dist/components/popover/popover.js +3 -3
- package/dist/components/portal-provider/portal-provider.js +2 -1
- package/dist/components/radio/radio.js +2 -2
- package/dist/components/repeater/repeater-context.d.ts +0 -1
- package/dist/components/repeater/repeater-item.js +1 -1
- package/dist/components/repeater/repeater.d.ts +5 -38
- package/dist/components/repeater/repeater.js +7 -10
- package/dist/components/responsive/mini-responsive.d.ts +0 -1
- package/dist/components/responsive/mini-responsive.js +30 -30
- package/dist/components/responsive/responsive-legacy.d.ts +0 -1
- package/dist/components/responsive/responsive-legacy.js +12 -10
- package/dist/components/responsive/responsive.d.ts +0 -1
- package/dist/components/responsive/responsive.js +28 -28
- package/dist/components/responsive-preview/responsive-preview.js +3 -3
- package/dist/components/select/async-multi-select.d.ts +12 -13
- package/dist/components/select/async-multi-select.js +39 -20
- package/dist/components/select/async-select.d.ts +12 -13
- package/dist/components/select/async-select.js +38 -20
- package/dist/components/select/multi-select.d.ts +2 -8
- package/dist/components/select/multi-select.js +19 -19
- package/dist/components/select/shared.d.ts +5 -9
- package/dist/components/select/shared.js +2 -2
- package/dist/components/select/single-select.d.ts +2 -8
- package/dist/components/select/single-select.js +16 -16
- package/dist/components/slider/column-config-slider.js +7 -5
- package/dist/components/slider/slider.js +15 -11
- package/dist/components/smart-image/smart-image.d.ts +0 -1
- package/dist/components/smart-image/smart-image.js +52 -50
- package/dist/components/tabs/tabs.js +1 -1
- package/dist/components/toggle/switch.js +1 -1
- package/dist/components/toggle/toggle.js +2 -2
- package/dist/components/toggle-button/toggle-button.js +1 -1
- package/dist/components/tooltip/tooltip.js +1 -1
- package/dist/{draggable-9MfdTVWP.js → draggable-BUfOpGSZ.js} +129 -124
- package/dist/{es-dash-DunirOmV.js → es-dash-DPtJSRjw.js} +23 -52
- package/dist/{gradient-editor-yqSw0uPA.js → gradient-editor-_q3XF10i.js} +38 -29
- package/dist/icons/block-icon.js +1 -1
- package/dist/icons/icon.d.ts +3 -3
- package/dist/icons/icon.js +21 -9
- package/dist/icons/icons.d.ts +210 -1
- package/dist/icons/index.js +1 -1
- package/dist/icons/jsx-svg.d.ts +5 -4
- package/dist/icons/jsx-svg.js +1 -1
- package/dist/index.js +16 -16
- package/dist/{input-field-nN6BO0oz.js → input-field-QzBpjm-m.js} +8 -8
- package/dist/{jsx-svg-BjGQUBLh.js → jsx-svg-DRwJdRpA.js} +171 -129
- package/dist/{keyboard-g5Amam-c.js → keyboard-BxnnQA2Z.js} +1 -1
- package/dist/{link-input-BhlPElU8.js → link-input-CElQp3lP.js} +145 -87
- package/dist/{modal-B5axB0Fc.js → modal-BeacK9N_.js} +14 -13
- package/dist/{number-picker-nnOf0XnN.js → number-picker-CK_OHBXw.js} +9 -9
- package/dist/{react-y40Dt3ab.js → react-C6Y6cCOx.js} +194 -215
- package/dist/{shared-Ba_bt4s9.js → shared-DBCipn_m.js} +59 -43
- package/dist/{solid-color-picker-CsosgTVa.js → solid-color-picker-2-X3ridX.js} +58 -53
- package/dist/{switch-BJ4_OyUm.js → switch-B87lQ1V0.js} +6 -6
- package/dist/{tabs-wAe0AAyu.js → tabs-DgkJUkIX.js} +33 -28
- package/dist/{text-helpers-2j9DuxP1.js → text-helpers-QrwKKaOh.js} +3 -2
- package/dist/{textSelection-B_Nv6Jz3.js → textSelection-5Qk8tLtm.js} +3 -3
- package/dist/{toggle-button-BLJdEp8V.js → toggle-button-B2-f2rU6.js} +8 -7
- package/dist/{tooltip-BW9nj5-V.js → tooltip-AzOLps8g.js} +68 -62
- package/dist/{useAsyncList-B3-uyJgA.js → useAsyncList-CjKVLGN0.js} +8 -4
- package/dist/{useButton-CPMVLXoX.js → useButton-BIrfoiY8.js} +3 -3
- package/dist/{useCollection-PzY6FI39.js → useCollection-LQlZnc1u.js} +267 -180
- package/dist/{useEvent-CzuFZ2HT.js → useEvent-Bih8lvtM.js} +1 -1
- package/dist/{useField-DrfR8j9h.js → useField-B_ibsWst.js} +2 -2
- package/dist/{useFilter-CiCjo6Na.js → useFilter-BFaOw4yi.js} +1 -1
- package/dist/{useFocusRing-CrYHpV7C.js → useFocusRing-ZXFsftJJ.js} +1 -1
- package/dist/{useFormReset-U6c35PHq.js → useFormReset-DDJhIIfG.js} +1 -1
- package/dist/{useFormValidation-B2q2MGWN.js → useFormValidation-BfnJKcdX.js} +2 -2
- package/dist/{useHover-CNsbAR0V.js → useHover-CbyH227W.js} +216 -39
- package/dist/{useLabel-DuxAjaic.js → useLabel-gfFDE4bn.js} +2 -2
- package/dist/{useLabels-NUsp5IW3.js → useLabels-Dcg-cEyM.js} +1 -1
- package/dist/{useListState-FLxa7R_U.js → useListState-I22DfnmE.js} +4 -2
- package/dist/{useLocalizedStringFormatter-Ccm8EL_u.js → useLocalizedStringFormatter-CTCqjYu4.js} +6 -1
- package/dist/{useNumberFieldState-DWvm7CXu.js → useNumberFieldState-C1gD0RuW.js} +79 -62
- package/dist/{useNumberFormatter-B0_D7a_o.js → useNumberFormatter-DbAt_fC_.js} +2 -2
- package/dist/{useOverlayTriggerState-zZ7homyI.js → useOverlayTriggerState-Cpc_IbQf.js} +12 -9
- package/dist/{usePress-DRoujMNm.js → usePress-BF7otjax.js} +30 -19
- package/dist/{useSlot-pRz-v9kC.js → useSlot-CnQHcvd4.js} +1 -1
- package/dist/{useTextField-e8jIFT3s.js → useTextField-CnTuCBMs.js} +6 -6
- package/dist/{useToggle-CR_ZKvr_.js → useToggle-Cgv5UXaB.js} +6 -6
- package/dist/{useToggleState-ButQxGrJ.js → useToggleState-Cy1E36QZ.js} +1 -1
- package/dist/utilities/array-helpers.d.ts +1 -1
- package/dist/utilities/array-helpers.js +4 -3
- package/dist/utilities/debounce-throttle.d.ts +9 -2
- package/dist/utilities/es-dash.d.ts +11 -8
- package/dist/utilities/es-dash.js +1 -1
- package/dist/utilities/index.js +2 -2
- package/dist/utilities/text-helpers.js +1 -1
- package/dist/utilities/web-workers.d.ts +7 -7
- package/dist/utilities/web-workers.js +5 -5
- package/dist/{utils-Czi6q2Ub.js → utils-ClM91CuL.js} +30 -19
- package/package.json +21 -25
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { t as $600b3cf69ae46262$export$90fc3a17d93f704c } from "./useEvent-
|
|
4
|
-
import { t as $cf2482eff2eeeec2$export$f12b703ca79dfbb1 } from "./useLocalizedStringFormatter-
|
|
1
|
+
import { h as $c4867b2f328c2698$export$e5c5a5f917a5871c, p as $390e54f620492c70$export$f680877a34711e37, u as $bbaa08b3cd72f041$export$9d1611c77c2fe928 } from "./utils-ClM91CuL.js";
|
|
2
|
+
import { T as $2add3ce32c6007eb$export$186c6964ca17d99, U as $23f2114a1b82827e$export$e58f029f0fbfdb29, V as $23f2114a1b82827e$export$cd4e5573fbe2b576, c as $1e74c67db218ce67$export$f8168d8dd8fd66e6, d as $3e6197669829fe11$export$40bfa8c7b0832715, f as $fe16bffc7a557bf0$export$7f54fc3180508a52, j as $2add3ce32c6007eb$export$fedb369cb70207f1, k as $2add3ce32c6007eb$export$a11b0059900ceec8, n as $48a7d519b337145d$export$4eaf04e54aa8eed6, s as $8296dad1a4c5e0dc$export$8f71654801c2f7cd } from "./useHover-CbyH227W.js";
|
|
3
|
+
import { t as $600b3cf69ae46262$export$90fc3a17d93f704c } from "./useEvent-Bih8lvtM.js";
|
|
4
|
+
import { t as $cf2482eff2eeeec2$export$f12b703ca79dfbb1 } from "./useLocalizedStringFormatter-CTCqjYu4.js";
|
|
5
5
|
import { t as $8e9d2fae0ecb9001$export$457c3d6518dd4c6f } from "./filterDOMProps-CgeMQsGa.js";
|
|
6
|
-
import { n as $2c9edc598a03d523$export$420e68273165f4ec } from "./useFocusRing-
|
|
7
|
-
import { t as $1dfb119a85e764e5$export$cc77c4ff7e8673c5 } from "./NumberFormatter-
|
|
8
|
-
import { t as $bd90acf18e792be6$export$b7a616150fdb9f44 } from "./useNumberFormatter-
|
|
6
|
+
import { n as $2c9edc598a03d523$export$420e68273165f4ec } from "./useFocusRing-ZXFsftJJ.js";
|
|
7
|
+
import { t as $1dfb119a85e764e5$export$cc77c4ff7e8673c5 } from "./NumberFormatter-Bwdv413k.js";
|
|
8
|
+
import { t as $bd90acf18e792be6$export$b7a616150fdb9f44 } from "./useNumberFormatter-DbAt_fC_.js";
|
|
9
9
|
import { r as $240e9101ba2842f5$export$cb6e0bb50bc19463, t as $240e9101ba2842f5$export$7d15b64cf5a3a4c4 } from "./number-BeC0ySe4.js";
|
|
10
|
-
import { i as $a46cf152bb926da5$export$d10ae4f68404609a, r as $a46cf152bb926da5$export$a9b970dcc4ae71a9 } from "./Button-
|
|
11
|
-
import { i as $fd2148440a13ec26$export$fc1a364ae1f3ff10, n as $fd2148440a13ec26$export$a763b9476acd3eb } from "./useFormValidation-
|
|
12
|
-
import { t as $3274bf1495747a7b$export$5add1d006293d136 } from "./useFormReset-
|
|
13
|
-
import { t as $054f71d2330da2e3$export$712718f7aec83d5 } from "./useTextField-
|
|
10
|
+
import { i as $a46cf152bb926da5$export$d10ae4f68404609a, r as $a46cf152bb926da5$export$a9b970dcc4ae71a9 } from "./Button-DO3oQfCq.js";
|
|
11
|
+
import { i as $fd2148440a13ec26$export$fc1a364ae1f3ff10, n as $fd2148440a13ec26$export$a763b9476acd3eb } from "./useFormValidation-BfnJKcdX.js";
|
|
12
|
+
import { t as $3274bf1495747a7b$export$5add1d006293d136 } from "./useFormReset-DDJhIIfG.js";
|
|
13
|
+
import { t as $054f71d2330da2e3$export$712718f7aec83d5 } from "./useTextField-CnTuCBMs.js";
|
|
14
14
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
15
15
|
import { flushSync } from "react-dom";
|
|
16
16
|
//#region node_modules/@internationalized/number/dist/private/NumberParser.mjs
|
|
@@ -258,9 +258,7 @@ function $62888b2ec35be488$export$4f384c9210e583c3(props, state, inputRef) {
|
|
|
258
258
|
case "deleteHardLineBackward":
|
|
259
259
|
nextValue = input.value.slice(input.selectionStart);
|
|
260
260
|
break;
|
|
261
|
-
default:
|
|
262
|
-
if (e.data != null) nextValue = input.value.slice(0, input.selectionStart) + e.data + input.value.slice(input.selectionEnd);
|
|
263
|
-
break;
|
|
261
|
+
default: if (e.data != null) nextValue = input.value.slice(0, input.selectionStart) + e.data + input.value.slice(input.selectionEnd);
|
|
264
262
|
}
|
|
265
263
|
if (nextValue == null || !state.validate(nextValue)) e.preventDefault();
|
|
266
264
|
});
|
|
@@ -515,47 +513,62 @@ function $757ec6630f26125c$export$e908e06f4b8e3402(props) {
|
|
|
515
513
|
useEffect(() => {
|
|
516
514
|
return () => clearAsyncEvent();
|
|
517
515
|
}, []);
|
|
518
|
-
let
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
case "ArrowUp":
|
|
527
|
-
case "Up":
|
|
516
|
+
let { keyboardProps } = $8296dad1a4c5e0dc$export$8f71654801c2f7cd({
|
|
517
|
+
isDisabled: isDisabled || isReadOnly,
|
|
518
|
+
shortcuts: {
|
|
519
|
+
PageUp: () => {
|
|
520
|
+
if (onIncrementPage) {
|
|
521
|
+
onIncrementPage();
|
|
522
|
+
return;
|
|
523
|
+
}
|
|
528
524
|
if (onIncrement) {
|
|
529
|
-
|
|
530
|
-
|
|
525
|
+
onIncrement();
|
|
526
|
+
return;
|
|
527
|
+
}
|
|
528
|
+
return false;
|
|
529
|
+
},
|
|
530
|
+
ArrowUp: () => {
|
|
531
|
+
if (onIncrement) {
|
|
532
|
+
onIncrement();
|
|
533
|
+
return;
|
|
534
|
+
}
|
|
535
|
+
return false;
|
|
536
|
+
},
|
|
537
|
+
PageDown: () => {
|
|
538
|
+
if (onDecrementPage) {
|
|
539
|
+
onDecrementPage();
|
|
540
|
+
return;
|
|
531
541
|
}
|
|
532
|
-
break;
|
|
533
|
-
case "PageDown": if (onDecrementPage) {
|
|
534
|
-
e.preventDefault();
|
|
535
|
-
onDecrementPage?.();
|
|
536
|
-
break;
|
|
537
|
-
}
|
|
538
|
-
case "ArrowDown":
|
|
539
|
-
case "Down":
|
|
540
542
|
if (onDecrement) {
|
|
541
|
-
|
|
542
|
-
|
|
543
|
+
onDecrement();
|
|
544
|
+
return;
|
|
543
545
|
}
|
|
544
|
-
|
|
545
|
-
|
|
546
|
+
return false;
|
|
547
|
+
},
|
|
548
|
+
ArrowDown: () => {
|
|
549
|
+
if (onDecrement) {
|
|
550
|
+
onDecrement();
|
|
551
|
+
return;
|
|
552
|
+
}
|
|
553
|
+
return false;
|
|
554
|
+
},
|
|
555
|
+
Home: () => {
|
|
546
556
|
if (onDecrementToMin) {
|
|
547
|
-
|
|
548
|
-
|
|
557
|
+
onDecrementToMin();
|
|
558
|
+
return;
|
|
549
559
|
}
|
|
550
|
-
|
|
551
|
-
|
|
560
|
+
return false;
|
|
561
|
+
},
|
|
562
|
+
End: () => {
|
|
552
563
|
if (onIncrementToMax) {
|
|
553
|
-
|
|
554
|
-
|
|
564
|
+
onIncrementToMax();
|
|
565
|
+
return;
|
|
555
566
|
}
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
567
|
+
return false;
|
|
568
|
+
}
|
|
569
|
+
},
|
|
570
|
+
allowRepeats: true
|
|
571
|
+
});
|
|
559
572
|
let isFocused = useRef(false);
|
|
560
573
|
let onFocus = () => {
|
|
561
574
|
isFocused.current = true;
|
|
@@ -624,7 +637,7 @@ function $757ec6630f26125c$export$e908e06f4b8e3402(props) {
|
|
|
624
637
|
"aria-disabled": isDisabled || void 0,
|
|
625
638
|
"aria-readonly": isReadOnly || void 0,
|
|
626
639
|
"aria-required": isRequired || void 0,
|
|
627
|
-
|
|
640
|
+
...keyboardProps,
|
|
628
641
|
onFocus,
|
|
629
642
|
onBlur
|
|
630
643
|
},
|
|
@@ -1026,6 +1039,7 @@ function $cd2fa56213693c5e$export$23f548e970bdf099(props, state, inputRef) {
|
|
|
1026
1039
|
...formatOptions,
|
|
1027
1040
|
currencySign: void 0
|
|
1028
1041
|
});
|
|
1042
|
+
let textValue = useMemo(() => isNaN(numberValue) ? "" : textValueFormatter.format(numberValue), [textValueFormatter, numberValue]);
|
|
1029
1043
|
let { spinButtonProps, incrementButtonProps: incButtonProps, decrementButtonProps: decButtonProps } = $757ec6630f26125c$export$e908e06f4b8e3402({
|
|
1030
1044
|
isDisabled,
|
|
1031
1045
|
isReadOnly,
|
|
@@ -1037,19 +1051,20 @@ function $cd2fa56213693c5e$export$23f548e970bdf099(props, state, inputRef) {
|
|
|
1037
1051
|
onDecrement: decrement,
|
|
1038
1052
|
onDecrementToMin: decrementToMin,
|
|
1039
1053
|
value: numberValue,
|
|
1040
|
-
textValue
|
|
1054
|
+
textValue
|
|
1041
1055
|
});
|
|
1042
1056
|
let [focusWithin, setFocusWithin] = useState(false);
|
|
1043
1057
|
let { focusWithinProps } = $2c9edc598a03d523$export$420e68273165f4ec({
|
|
1044
1058
|
isDisabled,
|
|
1045
1059
|
onFocusWithinChange: setFocusWithin
|
|
1046
1060
|
});
|
|
1061
|
+
let onWheel = useCallback((e) => {
|
|
1062
|
+
if (Math.abs(e.deltaY) <= Math.abs(e.deltaX)) return;
|
|
1063
|
+
if (e.deltaY > 0) increment();
|
|
1064
|
+
else if (e.deltaY < 0) decrement();
|
|
1065
|
+
}, [decrement, increment]);
|
|
1047
1066
|
$14554ba6a2007b17$export$2123ff2b87c81ca({
|
|
1048
|
-
onScroll:
|
|
1049
|
-
if (Math.abs(e.deltaY) <= Math.abs(e.deltaX)) return;
|
|
1050
|
-
if (e.deltaY > 0) increment();
|
|
1051
|
-
else if (e.deltaY < 0) decrement();
|
|
1052
|
-
}, [decrement, increment]),
|
|
1067
|
+
onScroll: onWheel,
|
|
1053
1068
|
isDisabled: isWheelDisabled || isDisabled || isReadOnly || !focusWithin
|
|
1054
1069
|
}, inputRef);
|
|
1055
1070
|
let hasDecimals = (intlOptions.maximumFractionDigits ?? 0) > 0;
|
|
@@ -1074,17 +1089,20 @@ function $cd2fa56213693c5e$export$23f548e970bdf099(props, state, inputRef) {
|
|
|
1074
1089
|
}
|
|
1075
1090
|
};
|
|
1076
1091
|
let domProps = $8e9d2fae0ecb9001$export$457c3d6518dd4c6f(props);
|
|
1077
|
-
let
|
|
1078
|
-
|
|
1079
|
-
|
|
1092
|
+
let { keyboardProps } = $8296dad1a4c5e0dc$export$8f71654801c2f7cd({
|
|
1093
|
+
isDisabled: isDisabled || isReadOnly,
|
|
1094
|
+
shortcuts: { Enter: () => {
|
|
1080
1095
|
flushSync(() => {
|
|
1081
1096
|
commit();
|
|
1082
1097
|
});
|
|
1083
1098
|
commitValidation();
|
|
1084
|
-
|
|
1085
|
-
|
|
1099
|
+
return { shouldPreventDefault: false };
|
|
1100
|
+
} },
|
|
1101
|
+
onKeyDown,
|
|
1102
|
+
onKeyUp
|
|
1103
|
+
});
|
|
1086
1104
|
let { isInvalid, validationErrors, validationDetails } = state.displayValidation;
|
|
1087
|
-
let { labelProps, inputProps:
|
|
1105
|
+
let { labelProps, inputProps: textFieldPropsFromHook, descriptionProps, errorMessageProps } = $62888b2ec35be488$export$4f384c9210e583c3({
|
|
1088
1106
|
...otherProps,
|
|
1089
1107
|
...domProps,
|
|
1090
1108
|
name: void 0,
|
|
@@ -1108,12 +1126,11 @@ function $cd2fa56213693c5e$export$23f548e970bdf099(props, state, inputRef) {
|
|
|
1108
1126
|
onBlur,
|
|
1109
1127
|
onFocus,
|
|
1110
1128
|
onFocusChange,
|
|
1111
|
-
onKeyDown: useMemo(() => $a4e76a5424781910$export$e08e3b67e392101e(onKeyDownEnter, onKeyDown), [onKeyDownEnter, onKeyDown]),
|
|
1112
|
-
onKeyUp,
|
|
1113
1129
|
onPaste,
|
|
1114
1130
|
description,
|
|
1115
1131
|
errorMessage
|
|
1116
1132
|
}, state, inputRef);
|
|
1133
|
+
let textFieldProps = $bbaa08b3cd72f041$export$9d1611c77c2fe928(keyboardProps, textFieldPropsFromHook);
|
|
1117
1134
|
$3274bf1495747a7b$export$5add1d006293d136(inputRef, state.defaultNumberValue, state.setNumberValue);
|
|
1118
1135
|
$cd2fa56213693c5e$var$useNativeValidation(state, props.validationBehavior, props.commitBehavior, inputRef, state.minValue, state.maxValue, props.step, state.numberValue);
|
|
1119
1136
|
let inputProps = $bbaa08b3cd72f041$export$9d1611c77c2fe928(spinButtonProps, focusProps, textFieldProps, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as $2eb8e6d23f3d0cb0$export$43bb16f9c6d9e3f7 } from "./I18nProvider-
|
|
2
|
-
import { t as $1dfb119a85e764e5$export$cc77c4ff7e8673c5 } from "./NumberFormatter-
|
|
1
|
+
import { t as $2eb8e6d23f3d0cb0$export$43bb16f9c6d9e3f7 } from "./I18nProvider-R_4IDnf9.js";
|
|
2
|
+
import { t as $1dfb119a85e764e5$export$cc77c4ff7e8673c5 } from "./NumberFormatter-Bwdv413k.js";
|
|
3
3
|
import { useMemo } from "react";
|
|
4
4
|
//#region node_modules/react-aria/dist/private/i18n/useNumberFormatter.mjs
|
|
5
5
|
function $bd90acf18e792be6$export$b7a616150fdb9f44(options = {}) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { h as $c4867b2f328c2698$export$e5c5a5f917a5871c, n as $7230ffa83bc0c2cf$export$29f1550f4b0d4415, o as $7230ffa83bc0c2cf$export$df3a06d6289f983e, r as $7230ffa83bc0c2cf$export$4d86445c2cf5e3 } from "./utils-
|
|
2
|
-
import { B as $23f2114a1b82827e$export$b4f377a2b6254582, D as $2add3ce32c6007eb$export$78551043582a6a98, H as $23f2114a1b82827e$export$e58f029f0fbfdb29, V as $23f2114a1b82827e$export$cd4e5573fbe2b576, d as $3e6197669829fe11$export$40bfa8c7b0832715, f as $fe16bffc7a557bf0$export$7f54fc3180508a52, z as $23f2114a1b82827e$export$4282f70798064fe0 } from "./useHover-
|
|
3
|
-
import { t as $2eb8e6d23f3d0cb0$export$43bb16f9c6d9e3f7 } from "./I18nProvider-
|
|
1
|
+
import { h as $c4867b2f328c2698$export$e5c5a5f917a5871c, n as $7230ffa83bc0c2cf$export$29f1550f4b0d4415, o as $7230ffa83bc0c2cf$export$df3a06d6289f983e, r as $7230ffa83bc0c2cf$export$4d86445c2cf5e3 } from "./utils-ClM91CuL.js";
|
|
2
|
+
import { B as $23f2114a1b82827e$export$b4f377a2b6254582, D as $2add3ce32c6007eb$export$78551043582a6a98, H as $23f2114a1b82827e$export$da7af4355d792141, J as $d447af545b77c9f1$export$f531f92e2a15358f, U as $23f2114a1b82827e$export$e58f029f0fbfdb29, V as $23f2114a1b82827e$export$cd4e5573fbe2b576, d as $3e6197669829fe11$export$40bfa8c7b0832715, f as $fe16bffc7a557bf0$export$7f54fc3180508a52, z as $23f2114a1b82827e$export$4282f70798064fe0 } from "./useHover-CbyH227W.js";
|
|
3
|
+
import { t as $2eb8e6d23f3d0cb0$export$43bb16f9c6d9e3f7 } from "./I18nProvider-R_4IDnf9.js";
|
|
4
4
|
import { t as $8e9d2fae0ecb9001$export$457c3d6518dd4c6f } from "./filterDOMProps-CgeMQsGa.js";
|
|
5
5
|
import { t as $240e9101ba2842f5$export$7d15b64cf5a3a4c4 } from "./number-BeC0ySe4.js";
|
|
6
6
|
import $3ARPR$react, { createContext, forwardRef, useCallback, useEffect, useRef, useState } from "react";
|
|
@@ -212,7 +212,10 @@ function $954926fb6168ae2a$export$6839422d1f33cee9(placementInput, childOffset,
|
|
|
212
212
|
const arrowMinPosition = arrowSize / 2 + arrowBoundaryOffset;
|
|
213
213
|
const overlayMargin = $954926fb6168ae2a$var$AXIS[crossAxis] === "left" ? (margins.left ?? 0) + (margins.right ?? 0) : (margins.top ?? 0) + (margins.bottom ?? 0);
|
|
214
214
|
const arrowMaxPosition = overlaySize[crossSize] - overlayMargin - arrowSize / 2 - arrowBoundaryOffset;
|
|
215
|
-
|
|
215
|
+
const arrowOverlappingChildMinEdge = childOffset[crossAxis] + arrowSize / 2 - (position[crossAxis] + margins[$954926fb6168ae2a$var$AXIS[crossAxis]]);
|
|
216
|
+
const arrowOverlappingChildMaxEdge = childOffset[crossAxis] + childOffset[crossSize] - arrowSize / 2 - (position[crossAxis] + margins[$954926fb6168ae2a$var$AXIS[crossAxis]]);
|
|
217
|
+
const arrowPositionOverlappingChild = $240e9101ba2842f5$export$7d15b64cf5a3a4c4(preferredArrowPosition, arrowOverlappingChildMinEdge, arrowOverlappingChildMaxEdge);
|
|
218
|
+
arrowPosition[crossAxis] = $240e9101ba2842f5$export$7d15b64cf5a3a4c4(arrowPositionOverlappingChild, arrowMinPosition, arrowMaxPosition);
|
|
216
219
|
({placement: placement, crossPlacement: crossPlacement} = placementInfo);
|
|
217
220
|
if (arrowSize) origin = arrowPosition[crossAxis];
|
|
218
221
|
else if (crossPlacement === "right") origin += childOffset[crossSize];
|
|
@@ -337,10 +340,7 @@ function $22e2f5f6490788e8$export$18fc8428861184da(opts) {
|
|
|
337
340
|
let onCloseHandler = onClose || $22e2f5f6490788e8$export$f6211563215e3b37.get(triggerRef.current);
|
|
338
341
|
if (onCloseHandler) onCloseHandler();
|
|
339
342
|
};
|
|
340
|
-
|
|
341
|
-
return () => {
|
|
342
|
-
window.removeEventListener("scroll", onScroll, true);
|
|
343
|
-
};
|
|
343
|
+
return $d447af545b77c9f1$export$f531f92e2a15358f($23f2114a1b82827e$export$da7af4355d792141(triggerRef.current), "scroll", onScroll, true);
|
|
344
344
|
}, [
|
|
345
345
|
isOpen,
|
|
346
346
|
onClose,
|
|
@@ -534,6 +534,7 @@ function $b3526bc71400be8d$var$translateRTL(position, direction) {
|
|
|
534
534
|
//#region node_modules/react-stately/dist/private/overlays/useOverlayTriggerState.mjs
|
|
535
535
|
function $f11fb0bcf1b2687a$export$61c6a8c84e605fb6(props) {
|
|
536
536
|
let [isOpen, setOpen] = $3e6197669829fe11$export$40bfa8c7b0832715(props.isOpen, props.defaultOpen || false, props.onOpenChange);
|
|
537
|
+
let [point, setPoint] = useState(null);
|
|
537
538
|
return {
|
|
538
539
|
isOpen,
|
|
539
540
|
setOpen,
|
|
@@ -545,7 +546,9 @@ function $f11fb0bcf1b2687a$export$61c6a8c84e605fb6(props) {
|
|
|
545
546
|
}, [setOpen]),
|
|
546
547
|
toggle: useCallback(() => {
|
|
547
548
|
setOpen(!isOpen);
|
|
548
|
-
}, [setOpen, isOpen])
|
|
549
|
+
}, [setOpen, isOpen]),
|
|
550
|
+
point,
|
|
551
|
+
setPoint
|
|
549
552
|
};
|
|
550
553
|
}
|
|
551
554
|
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { g as $a4e76a5424781910$export$e08e3b67e392101e, u as $bbaa08b3cd72f041$export$9d1611c77c2fe928 } from "./utils-
|
|
2
|
-
import { C as $b5c62b033c25b96d$export$29bf1b5f2c56cf63, F as $a92dc41f639950be$export$cabe61c495ee3649,
|
|
3
|
-
import { n as $cbf007e418543821$export$b0d6fa1ab32e3295, t as $cbf007e418543821$export$16a4697467175487 } from "./textSelection-
|
|
1
|
+
import { g as $a4e76a5424781910$export$e08e3b67e392101e, u as $bbaa08b3cd72f041$export$9d1611c77c2fe928 } from "./utils-ClM91CuL.js";
|
|
2
|
+
import { C as $b5c62b033c25b96d$export$29bf1b5f2c56cf63, F as $a92dc41f639950be$export$cabe61c495ee3649, K as $d447af545b77c9f1$export$b204af158042fbac, M as $a92dc41f639950be$export$525bc4921d56d4a, O as $2add3ce32c6007eb$export$9ac100e40613ea10, P as $a92dc41f639950be$export$c2b7abe5d61ec696, R as $1969ac565cfec8d0$export$de79e2c695e052f3, U as $23f2114a1b82827e$export$e58f029f0fbfdb29, f as $fe16bffc7a557bf0$export$7f54fc3180508a52, n as $48a7d519b337145d$export$4eaf04e54aa8eed6, o as $b7115c395c64f7b5$export$4debdb1a3f0fa79e, q as $d447af545b77c9f1$export$f21a1ffae260145a, w as $b5c62b033c25b96d$export$60278871457622de, x as $caaf0dd3060ed57c$export$95185d699e05d4d7, z as $23f2114a1b82827e$export$4282f70798064fe0 } from "./useHover-CbyH227W.js";
|
|
3
|
+
import { n as $cbf007e418543821$export$b0d6fa1ab32e3295, t as $cbf007e418543821$export$16a4697467175487 } from "./textSelection-5Qk8tLtm.js";
|
|
4
4
|
import $3ARPR$react, { useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
5
5
|
import { flushSync } from "react-dom";
|
|
6
6
|
//#region node_modules/react-aria/dist/private/utils/getNonce.mjs
|
|
@@ -44,12 +44,14 @@ var $d27d541f9569d26d$var$PressEvent = class {
|
|
|
44
44
|
clientX = originalEvent.clientX;
|
|
45
45
|
clientY = originalEvent.clientY;
|
|
46
46
|
}
|
|
47
|
-
if (rect)
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
47
|
+
if (rect) {
|
|
48
|
+
if (clientX != null && clientY != null) {
|
|
49
|
+
x = clientX - rect.left;
|
|
50
|
+
y = clientY - rect.top;
|
|
51
|
+
} else {
|
|
52
|
+
x = rect.width / 2;
|
|
53
|
+
y = rect.height / 2;
|
|
54
|
+
}
|
|
53
55
|
}
|
|
54
56
|
this.type = type;
|
|
55
57
|
this.pointerType = pointerType;
|
|
@@ -134,7 +136,7 @@ function $d27d541f9569d26d$export$45712eceda6fad21(props) {
|
|
|
134
136
|
onPress
|
|
135
137
|
]);
|
|
136
138
|
let triggerPressEndEvent = $fe16bffc7a557bf0$export$7f54fc3180508a52(triggerPressEnd);
|
|
137
|
-
let
|
|
139
|
+
let triggerPressUp = useCallback((originalEvent, pointerType) => {
|
|
138
140
|
let state = ref.current;
|
|
139
141
|
if (isDisabled) return false;
|
|
140
142
|
if (onPressUp) {
|
|
@@ -145,7 +147,8 @@ function $d27d541f9569d26d$export$45712eceda6fad21(props) {
|
|
|
145
147
|
return event.shouldStopPropagation;
|
|
146
148
|
}
|
|
147
149
|
return true;
|
|
148
|
-
}, [isDisabled, onPressUp])
|
|
150
|
+
}, [isDisabled, onPressUp]);
|
|
151
|
+
let triggerPressUpEvent = $fe16bffc7a557bf0$export$7f54fc3180508a52(triggerPressUp);
|
|
149
152
|
let cancel = useCallback((e) => {
|
|
150
153
|
let state = ref.current;
|
|
151
154
|
if (state.isPressed && state.target) {
|
|
@@ -273,9 +276,11 @@ function $d27d541f9569d26d$export$45712eceda6fad21(props) {
|
|
|
273
276
|
if (!allowTextSelectionOnPress) $cbf007e418543821$export$16a4697467175487(state.target);
|
|
274
277
|
shouldStopPropagation = triggerPressStart(e, state.pointerType);
|
|
275
278
|
let target = $23f2114a1b82827e$export$e58f029f0fbfdb29(e);
|
|
276
|
-
if ("releasePointerCapture" in target)
|
|
277
|
-
if (
|
|
278
|
-
|
|
279
|
+
if ("releasePointerCapture" in target) {
|
|
280
|
+
if ("hasPointerCapture" in target) {
|
|
281
|
+
if (target.hasPointerCapture(e.pointerId)) target.releasePointerCapture(e.pointerId);
|
|
282
|
+
} else target.releasePointerCapture(e.pointerId);
|
|
283
|
+
}
|
|
279
284
|
addGlobalListener($d447af545b77c9f1$export$b204af158042fbac(e.currentTarget), "pointerup", onPointerUp, false);
|
|
280
285
|
addGlobalListener($d447af545b77c9f1$export$b204af158042fbac(e.currentTarget), "pointercancel", onPointerCancel, false);
|
|
281
286
|
}
|
|
@@ -313,10 +318,12 @@ function $d27d541f9569d26d$export$45712eceda6fad21(props) {
|
|
|
313
318
|
if ($23f2114a1b82827e$export$4282f70798064fe0(state.target, $23f2114a1b82827e$export$e58f029f0fbfdb29(e)) && state.pointerType != null) {
|
|
314
319
|
let clicked = false;
|
|
315
320
|
let timeout = setTimeout(() => {
|
|
316
|
-
if (state.isPressed && state.target instanceof HTMLElement)
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
321
|
+
if (state.isPressed && state.target instanceof HTMLElement) {
|
|
322
|
+
if (clicked) cancelEvent(e);
|
|
323
|
+
else {
|
|
324
|
+
$1969ac565cfec8d0$export$de79e2c695e052f3(state.target);
|
|
325
|
+
state.target.click();
|
|
326
|
+
}
|
|
320
327
|
}
|
|
321
328
|
}, 80);
|
|
322
329
|
addGlobalListener(e.currentTarget, "click", () => clicked = true, true);
|
|
@@ -581,7 +588,11 @@ function $d27d541f9569d26d$var$shouldPreventDefaultUp(target) {
|
|
|
581
588
|
return true;
|
|
582
589
|
}
|
|
583
590
|
function $d27d541f9569d26d$var$shouldPreventDefaultKeyboard(target, key) {
|
|
584
|
-
if (
|
|
591
|
+
if ($2add3ce32c6007eb$export$9ac100e40613ea10() && key === "Enter") return false;
|
|
592
|
+
if (target instanceof HTMLInputElement) {
|
|
593
|
+
if (key === "Enter" && (target.type === "checkbox" || target.type === "radio")) return false;
|
|
594
|
+
return !$d27d541f9569d26d$var$isValidInputKey(target, key);
|
|
595
|
+
}
|
|
585
596
|
return $d27d541f9569d26d$var$shouldPreventDefaultUp(target);
|
|
586
597
|
}
|
|
587
598
|
var $d27d541f9569d26d$var$nonTextInputTypes = new Set([
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h as $c4867b2f328c2698$export$e5c5a5f917a5871c, p as $390e54f620492c70$export$f680877a34711e37 } from "./utils-
|
|
1
|
+
import { h as $c4867b2f328c2698$export$e5c5a5f917a5871c, p as $390e54f620492c70$export$f680877a34711e37 } from "./utils-ClM91CuL.js";
|
|
2
2
|
import { useCallback, useRef, useState } from "react";
|
|
3
3
|
//#region node_modules/react-aria/dist/private/utils/useSlot.mjs
|
|
4
4
|
function $4c14b02d5228be26$export$9d4c57ee4c6ffdd8(initialState = true) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { n as $7230ffa83bc0c2cf$export$29f1550f4b0d4415, o as $7230ffa83bc0c2cf$export$df3a06d6289f983e, r as $7230ffa83bc0c2cf$export$4d86445c2cf5e3, u as $bbaa08b3cd72f041$export$9d1611c77c2fe928 } from "./utils-
|
|
2
|
-
import {
|
|
1
|
+
import { n as $7230ffa83bc0c2cf$export$29f1550f4b0d4415, o as $7230ffa83bc0c2cf$export$df3a06d6289f983e, r as $7230ffa83bc0c2cf$export$4d86445c2cf5e3, u as $bbaa08b3cd72f041$export$9d1611c77c2fe928 } from "./utils-ClM91CuL.js";
|
|
2
|
+
import { U as $23f2114a1b82827e$export$e58f029f0fbfdb29, d as $3e6197669829fe11$export$40bfa8c7b0832715, i as $d1116acdf220c2da$export$4c014de7c8940b4c, t as $e969f22b6713ca4a$export$ae780daf29e6d456 } from "./useHover-CbyH227W.js";
|
|
3
3
|
import { t as $d7f64c32b702fe2c$export$86427a43e3e48ebb } from "./Hidden-C4Saxkx9.js";
|
|
4
4
|
import { t as $8e9d2fae0ecb9001$export$457c3d6518dd4c6f } from "./filterDOMProps-CgeMQsGa.js";
|
|
5
|
-
import { t as $0c4a58759813079a$export$4e328f61c538687f } from "./useFocusRing-
|
|
6
|
-
import { t as $191c9b6d48a0a4e2$export$294aa081a6c6f55d } from "./useField-
|
|
7
|
-
import { i as $fd2148440a13ec26$export$fc1a364ae1f3ff10, t as $860f7da480e22816$export$b8473d3665f3a75a } from "./useFormValidation-
|
|
8
|
-
import { t as $3274bf1495747a7b$export$5add1d006293d136 } from "./useFormReset-
|
|
5
|
+
import { t as $0c4a58759813079a$export$4e328f61c538687f } from "./useFocusRing-ZXFsftJJ.js";
|
|
6
|
+
import { t as $191c9b6d48a0a4e2$export$294aa081a6c6f55d } from "./useField-B_ibsWst.js";
|
|
7
|
+
import { i as $fd2148440a13ec26$export$fc1a364ae1f3ff10, t as $860f7da480e22816$export$b8473d3665f3a75a } from "./useFormValidation-BfnJKcdX.js";
|
|
8
|
+
import { t as $3274bf1495747a7b$export$5add1d006293d136 } from "./useFormReset-DDJhIIfG.js";
|
|
9
9
|
import $3ARPR$react, { createContext, forwardRef, useState } from "react";
|
|
10
10
|
//#region node_modules/react-aria-components/dist/private/Group.mjs
|
|
11
11
|
var $3a442827418ebe87$export$f9c6924e160136d1 = createContext({});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { u as $bbaa08b3cd72f041$export$9d1611c77c2fe928 } from "./utils-
|
|
2
|
-
import {
|
|
1
|
+
import { u as $bbaa08b3cd72f041$export$9d1611c77c2fe928 } from "./utils-ClM91CuL.js";
|
|
2
|
+
import { U as $23f2114a1b82827e$export$e58f029f0fbfdb29, i as $d1116acdf220c2da$export$4c014de7c8940b4c } from "./useHover-CbyH227W.js";
|
|
3
3
|
import { t as $8e9d2fae0ecb9001$export$457c3d6518dd4c6f } from "./filterDOMProps-CgeMQsGa.js";
|
|
4
|
-
import { t as $d27d541f9569d26d$export$45712eceda6fad21 } from "./usePress-
|
|
5
|
-
import { i as $fd2148440a13ec26$export$fc1a364ae1f3ff10, n as $fd2148440a13ec26$export$a763b9476acd3eb, t as $860f7da480e22816$export$b8473d3665f3a75a } from "./useFormValidation-
|
|
6
|
-
import { t as $3274bf1495747a7b$export$5add1d006293d136 } from "./useFormReset-
|
|
7
|
-
import { t as $4c14b02d5228be26$export$ed2feabec4a533f4 } from "./useSlot-
|
|
4
|
+
import { t as $d27d541f9569d26d$export$45712eceda6fad21 } from "./usePress-BF7otjax.js";
|
|
5
|
+
import { i as $fd2148440a13ec26$export$fc1a364ae1f3ff10, n as $fd2148440a13ec26$export$a763b9476acd3eb, t as $860f7da480e22816$export$b8473d3665f3a75a } from "./useFormValidation-BfnJKcdX.js";
|
|
6
|
+
import { t as $3274bf1495747a7b$export$5add1d006293d136 } from "./useFormReset-DDJhIIfG.js";
|
|
7
|
+
import { t as $4c14b02d5228be26$export$ed2feabec4a533f4 } from "./useSlot-CnQHcvd4.js";
|
|
8
8
|
import { useState } from "react";
|
|
9
9
|
//#region node_modules/react-aria/dist/private/toggle/useToggle.mjs
|
|
10
10
|
function $876b6f32ca5a04c3$export$cbe85ee05b554577(props, state, ref) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as $3e6197669829fe11$export$40bfa8c7b0832715 } from "./useHover-
|
|
1
|
+
import { d as $3e6197669829fe11$export$40bfa8c7b0832715 } from "./useHover-CbyH227W.js";
|
|
2
2
|
import { useState } from "react";
|
|
3
3
|
//#region node_modules/react-stately/dist/private/toggle/useToggleState.mjs
|
|
4
4
|
function $fd3c5e01e837dc20$export$8042c6c013fd5226(props = {}) {
|
|
@@ -20,4 +20,4 @@ export declare const arrayMoveMultiple: <T>(array: T[], fromIndices: number[], t
|
|
|
20
20
|
* @param {(items: T[]) => void} onChange - The callback to update the items.
|
|
21
21
|
* @param {string} [idKey='id'] - The key to use for the IDs.
|
|
22
22
|
*/
|
|
23
|
-
export declare const fixIds: <T extends
|
|
23
|
+
export declare const fixIds: <T extends object>(items: T[], onChange: (items: T[]) => void, idKey?: string) => void;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
var arrayMoveMultiple = (array, fromIndices, to, direction = "before") => {
|
|
15
15
|
const newArray = array.slice();
|
|
16
16
|
fromIndices.sort((a, b) => b - a);
|
|
17
|
-
const itemsToMove = fromIndices.
|
|
17
|
+
const itemsToMove = fromIndices.flatMap((index) => newArray.splice(index, 1));
|
|
18
18
|
let insertAt = to;
|
|
19
19
|
if (direction === "after") {
|
|
20
20
|
insertAt += 1;
|
|
@@ -33,9 +33,10 @@ var arrayMoveMultiple = (array, fromIndices, to, direction = "before") => {
|
|
|
33
33
|
* @param {string} [idKey='id'] - The key to use for the IDs.
|
|
34
34
|
*/
|
|
35
35
|
var fixIds = (items, onChange, idKey = "id") => {
|
|
36
|
-
const
|
|
36
|
+
const itemIdKey = idKey;
|
|
37
|
+
const allIds = items?.map((item) => item[itemIdKey]) ?? [];
|
|
37
38
|
const hasDuplicates = (input) => new Set(input)?.size !== input?.length;
|
|
38
|
-
const hasMissingIds = items?.some((item) =>
|
|
39
|
+
const hasMissingIds = items?.some((item) => item[itemIdKey] === void 0 || item[itemIdKey] === null || item[itemIdKey] === "");
|
|
39
40
|
if (hasDuplicates(allIds) && items?.length > 0 || hasMissingIds) onChange([...items].map((item, index) => ({
|
|
40
41
|
...item,
|
|
41
42
|
[idKey]: index + 1
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
type CallbackValue = string | number | boolean | bigint | symbol | null | undefined | object;
|
|
2
|
+
interface DebounceControls {
|
|
3
|
+
cancel: () => void;
|
|
4
|
+
flush: () => void;
|
|
5
|
+
}
|
|
6
|
+
type DebouncedCallback<T extends (...args: never[]) => CallbackValue> = ((...args: Parameters<T>) => void) & DebounceControls;
|
|
1
7
|
/**
|
|
2
8
|
* Debounces the provided function.
|
|
3
9
|
* For more information, check [this blog post](https://davidwalsh.name/javascript-debounce-function).
|
|
@@ -15,7 +21,7 @@
|
|
|
15
21
|
* // callback function.
|
|
16
22
|
* }, 250);
|
|
17
23
|
*/
|
|
18
|
-
export declare const debounce: <T extends (...args:
|
|
24
|
+
export declare const debounce: <T extends (...args: never[]) => CallbackValue>(func: T, wait?: number) => DebouncedCallback<T>;
|
|
19
25
|
/**
|
|
20
26
|
* Separated implementation of throttle functionality due to additional parameter in implementation.
|
|
21
27
|
*
|
|
@@ -28,4 +34,5 @@ export declare const debounce: <T extends (...args: unknown[]) => unknown>(func:
|
|
|
28
34
|
*
|
|
29
35
|
* @returns {T} Throttled callback.
|
|
30
36
|
*/
|
|
31
|
-
export declare const throttle: <T extends (...args:
|
|
37
|
+
export declare const throttle: <T extends (...args: never[]) => CallbackValue>(func: T, wait?: number, after?: boolean) => T;
|
|
38
|
+
export {};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import justIsEmpty from 'just-is-empty';
|
|
2
|
+
type FirstCharacterInput = string | number | boolean | bigint | symbol | null | undefined;
|
|
1
3
|
/**
|
|
2
4
|
* Returns a camelCase-formatted string.
|
|
3
5
|
*
|
|
@@ -76,7 +78,7 @@ export declare const kebabCase: (input: string | null | undefined) => string;
|
|
|
76
78
|
* isEmpty([1, 2, 3]) // => false
|
|
77
79
|
* ```
|
|
78
80
|
*/
|
|
79
|
-
export declare const isEmpty: (input:
|
|
81
|
+
export declare const isEmpty: <T extends Parameters<typeof justIsEmpty>[0]>(input: T) => boolean;
|
|
80
82
|
/**
|
|
81
83
|
* Returns the string with its first character converted to uppercase.
|
|
82
84
|
*
|
|
@@ -87,7 +89,7 @@ export declare const isEmpty: (input: unknown) => boolean;
|
|
|
87
89
|
* @example
|
|
88
90
|
* upperFirst('new super Test-title') // => 'New super Test-title'
|
|
89
91
|
*/
|
|
90
|
-
export declare const upperFirst: (input:
|
|
92
|
+
export declare const upperFirst: (input: FirstCharacterInput) => string;
|
|
91
93
|
/**
|
|
92
94
|
* Returns the string with its first character converted to lowercase.
|
|
93
95
|
*
|
|
@@ -98,7 +100,7 @@ export declare const upperFirst: (input: unknown) => string;
|
|
|
98
100
|
* @example
|
|
99
101
|
* lowerFirst('New super Test-title') // => 'new super Test-title'
|
|
100
102
|
*/
|
|
101
|
-
export declare const lowerFirst: (input:
|
|
103
|
+
export declare const lowerFirst: (input: FirstCharacterInput) => string;
|
|
102
104
|
/**
|
|
103
105
|
* Checks if `key` is a direct property of `object`.
|
|
104
106
|
* Key may be a path of a value separated by `.`.
|
|
@@ -116,7 +118,7 @@ export declare const lowerFirst: (input: unknown) => string;
|
|
|
116
118
|
* has({ a: { b: 3 } }, 'a.c') // => false
|
|
117
119
|
* ```
|
|
118
120
|
*/
|
|
119
|
-
export declare const has: (obj:
|
|
121
|
+
export declare const has: <T extends object>(obj: T, key: string) => boolean;
|
|
120
122
|
/**
|
|
121
123
|
* Checks if value is a plain object, that is, an object created by the Object constructor or one with a `[[Prototype]]` of `null`.
|
|
122
124
|
*
|
|
@@ -131,7 +133,7 @@ export declare const has: (obj: object, key: string) => boolean;
|
|
|
131
133
|
* isPlainObject(new Boolean()) // => false
|
|
132
134
|
* ```
|
|
133
135
|
*/
|
|
134
|
-
export declare const isPlainObject: (value:
|
|
136
|
+
export declare const isPlainObject: <T>(value: T) => value is T & object;
|
|
135
137
|
/**
|
|
136
138
|
* Checks if value is the language type of `Object`.
|
|
137
139
|
* (e.g. arrays, functions, objects, regexes, new Number(0), and new String('')).
|
|
@@ -148,7 +150,7 @@ export declare const isPlainObject: (value: unknown) => value is Record<string,
|
|
|
148
150
|
* isObject(null) // => false
|
|
149
151
|
* ```
|
|
150
152
|
*/
|
|
151
|
-
export declare const isObject: (input:
|
|
153
|
+
export declare const isObject: <T>(input: T) => input is T & object;
|
|
152
154
|
/**
|
|
153
155
|
* Performs a deep comparison between two values to determine if they are equivalent.
|
|
154
156
|
*
|
|
@@ -166,7 +168,7 @@ export declare const isObject: (input: unknown) => input is object;
|
|
|
166
168
|
* isEqual({ a: 1 }, 'b') // => false
|
|
167
169
|
* ```
|
|
168
170
|
*/
|
|
169
|
-
export declare const isEqual: (first:
|
|
171
|
+
export declare const isEqual: <TFirst, TSecond>(first: TFirst, second: TSecond) => boolean;
|
|
170
172
|
/**
|
|
171
173
|
* Checks if value is the language type of `String`.
|
|
172
174
|
*
|
|
@@ -181,4 +183,5 @@ export declare const isEqual: (first: unknown, second: unknown) => boolean;
|
|
|
181
183
|
* isString(new String('Lorem')) // => false
|
|
182
184
|
* ```
|
|
183
185
|
*/
|
|
184
|
-
export declare const isString: (value:
|
|
186
|
+
export declare const isString: <T>(value: T) => value is T & string;
|
|
187
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as isObject, c as kebabCase, d as snakeCase, f as upperFirst, i as isEqual, l as lowerFirst, n as has, o as isPlainObject, r as isEmpty, s as isString, t as camelCase, u as pascalCase } from "../es-dash-
|
|
1
|
+
import { a as isObject, c as kebabCase, d as snakeCase, f as upperFirst, i as isEqual, l as lowerFirst, n as has, o as isPlainObject, r as isEmpty, s as isString, t as camelCase, u as pascalCase } from "../es-dash-DPtJSRjw.js";
|
|
2
2
|
export { camelCase, has, isEmpty, isEqual, isObject, isPlainObject, isString, kebabCase, lowerFirst, pascalCase, snakeCase, upperFirst };
|
package/dist/utilities/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as clsx$1 } from "../clsx-DQoRUQAf.js";
|
|
2
2
|
import { arrayMoveMultiple, fixIds } from "./array-helpers.js";
|
|
3
|
-
import { a as isObject, c as kebabCase, d as snakeCase, f as upperFirst, i as isEqual, l as lowerFirst, n as has, o as isPlainObject, r as isEmpty, s as isString, t as camelCase, u as pascalCase } from "../es-dash-
|
|
4
|
-
import { i as unescapeHTML, n as truncateEnd, r as truncateMiddle, t as truncate } from "../text-helpers-
|
|
3
|
+
import { a as isObject, c as kebabCase, d as snakeCase, f as upperFirst, i as isEqual, l as lowerFirst, n as has, o as isPlainObject, r as isEmpty, s as isString, t as camelCase, u as pascalCase } from "../es-dash-DPtJSRjw.js";
|
|
4
|
+
import { i as unescapeHTML, n as truncateEnd, r as truncateMiddle, t as truncate } from "../text-helpers-QrwKKaOh.js";
|
|
5
5
|
import { n as throttle, t as debounce } from "../debounce-throttle-DklGQQrz.js";
|
|
6
6
|
import { getFileExtension, isColorDark } from "./general.js";
|
|
7
7
|
import { t as clsx } from "../utilities-COki58KB.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as unescapeHTML, n as truncateEnd, r as truncateMiddle, t as truncate } from "../text-helpers-
|
|
1
|
+
import { i as unescapeHTML, n as truncateEnd, r as truncateMiddle, t as truncate } from "../text-helpers-QrwKKaOh.js";
|
|
2
2
|
export { truncate, truncateEnd, truncateMiddle, unescapeHTML };
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { MutableRefObject } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
type AnalysisSettingValue = string | number | boolean | null | undefined;
|
|
3
|
+
type AnalysisSettings = Readonly<Record<string, AnalysisSettingValue>>;
|
|
4
|
+
interface ImageAnalysisWorkerHelpers<TResult extends object> {
|
|
5
|
+
getOrCreateWorker: () => Worker | null;
|
|
6
|
+
analyzeWithWorkerCb: (imageBitmap: ImageBitmap, settings: AnalysisSettings) => Promise<TResult>;
|
|
4
7
|
}
|
|
5
8
|
export declare const isImageAnalysisWorkerSupported: () => boolean;
|
|
6
9
|
/**
|
|
@@ -11,10 +14,7 @@ export declare const isImageAnalysisWorkerSupported: () => boolean;
|
|
|
11
14
|
* @param {string} workerInline - Inlined worker code string.
|
|
12
15
|
* @returns {object} Worker helpers for creating and analyzing with the image analysis worker.
|
|
13
16
|
*/
|
|
14
|
-
export declare function useImageAnalysisWorker(workerRef: MutableRefObject<Worker | null>, workerInline: string):
|
|
15
|
-
getOrCreateWorker: () => Worker | null;
|
|
16
|
-
analyzeWithWorkerCb: (imageBitmap: ImageBitmap, settings: AnalysisSettings) => Promise<unknown>;
|
|
17
|
-
};
|
|
17
|
+
export declare function useImageAnalysisWorker<TResult extends object>(workerRef: MutableRefObject<Worker | null>, workerInline: string): ImageAnalysisWorkerHelpers<TResult>;
|
|
18
18
|
/**
|
|
19
19
|
* Create a new image analysis worker using the inlined worker code.
|
|
20
20
|
*
|
|
@@ -30,5 +30,5 @@ export declare function createImageAnalysisWorker(workerInline: string): Worker
|
|
|
30
30
|
* @param {AnalysisSettings} settings - Analysis settings.
|
|
31
31
|
* @returns {Promise<unknown>} Resolves with the analysis result.
|
|
32
32
|
*/
|
|
33
|
-
export declare function analyzeWithWorker(worker: Worker, imageBitmap: ImageBitmap, settings: AnalysisSettings): Promise<
|
|
33
|
+
export declare function analyzeWithWorker<TResult extends object>(worker: Worker, imageBitmap: ImageBitmap, settings: AnalysisSettings): Promise<TResult>;
|
|
34
34
|
export {};
|