@choice-ui/react 1.9.7 → 1.9.8
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/components/button/dist/index.d.ts +9 -2
- package/dist/components/button/dist/index.js +19 -45
- package/dist/components/checkbox/dist/index.d.ts +1 -10
- package/dist/components/checkbox/dist/index.js +5 -49
- package/dist/components/code-block/dist/index.d.ts +14 -11
- package/dist/components/code-block/dist/index.js +93 -120
- package/dist/components/colors/dist/index.d.ts +6 -39
- package/dist/components/colors/src/color-image-paint/color-image-paint.js +2 -2
- package/dist/components/dropdown/dist/index.d.ts +0 -6
- package/dist/components/dropdown/dist/index.js +10 -20
- package/dist/components/emoji-picker/dist/index.d.ts +1 -30
- package/dist/components/emoji-picker/dist/index.js +44 -148
- package/dist/components/form/src/adapters/range-adapter.js +2 -2
- package/dist/components/icon-button/dist/index.d.ts +1 -1
- package/dist/components/icon-button/dist/index.js +0 -39
- package/dist/components/list/dist/index.d.ts +1 -1
- package/dist/components/md-render/dist/index.d.ts +1 -2
- package/dist/components/md-render/dist/index.js +9 -5
- package/dist/components/menus/dist/index.d.ts +0 -5
- package/dist/components/menus/dist/index.js +3 -32
- package/dist/components/modal/dist/index.js +2 -2
- package/dist/components/notifications/dist/index.d.ts +5 -1
- package/dist/components/numeric-input/dist/index.d.ts +10 -27
- package/dist/components/numeric-input/dist/index.js +23 -108
- package/dist/components/panel/dist/index.d.ts +16 -16
- package/dist/components/picture-preview/dist/index.d.ts +0 -5
- package/dist/components/picture-preview/dist/index.js +140 -287
- package/dist/components/popover/dist/index.d.ts +0 -5
- package/dist/components/popover/dist/index.js +2 -21
- package/dist/components/radio/dist/index.d.ts +1 -9
- package/dist/components/radio/dist/index.js +6 -50
- package/dist/components/range/dist/index.d.ts +20 -276
- package/dist/components/range/dist/index.js +616 -1044
- package/dist/components/scroll-area/dist/index.d.ts +27 -4
- package/dist/components/scroll-area/dist/index.js +123 -96
- package/dist/components/separator/dist/index.d.ts +8 -1
- package/dist/components/splitter/dist/index.d.ts +1 -1
- package/dist/components/text-field/dist/index.d.ts +3 -2
- package/dist/components/text-field/dist/index.js +19 -4
- package/dist/components/textarea/dist/index.js +1 -3
- package/dist/components/tooltip/dist/index.d.ts +0 -2
- package/dist/components/tooltip/dist/index.js +5 -23
- package/package.json +1 -1
- package/dist/components/toast/dist/index.d.ts +0 -274
- package/dist/components/virtual-select/dist/index.d.ts +0 -48
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { TooltipProps } from '../../tooltip/src';
|
|
2
|
-
import { default as
|
|
2
|
+
import { default as react__default, ReactNode, HTMLProps } from 'react';
|
|
3
3
|
import { IconButtonProps } from '../../icon-button/src';
|
|
4
4
|
import { PressMoveProps } from '../../../../../shared/src';
|
|
5
|
-
import * as
|
|
5
|
+
import * as react from 'react';
|
|
6
6
|
|
|
7
7
|
type ElementType = "action" | "handler" | "menu";
|
|
8
8
|
interface NumericInputElementProps {
|
|
@@ -11,18 +11,18 @@ interface NumericInputElementProps {
|
|
|
11
11
|
position?: "prefix" | "suffix";
|
|
12
12
|
type?: ElementType;
|
|
13
13
|
}
|
|
14
|
-
declare const NumericInputElement:
|
|
14
|
+
declare const NumericInputElement: react.MemoExoticComponent<react.ForwardRefExoticComponent<NumericInputElementProps & react.RefAttributes<HTMLDivElement>>>;
|
|
15
15
|
|
|
16
16
|
interface NumericInputMenuTriggerProps extends IconButtonProps {
|
|
17
17
|
className?: string;
|
|
18
18
|
type?: "menu" | "action";
|
|
19
19
|
}
|
|
20
|
-
declare const NumericInputMenuTrigger:
|
|
20
|
+
declare const NumericInputMenuTrigger: react.ForwardRefExoticComponent<Omit<NumericInputMenuTriggerProps, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
|
21
21
|
interface NumericInputMenuActionPromptProps extends HTMLProps<HTMLDivElement> {
|
|
22
22
|
children?: React.ReactNode;
|
|
23
23
|
className?: string;
|
|
24
24
|
}
|
|
25
|
-
declare const NumericInputMenuActionPrompt:
|
|
25
|
+
declare const NumericInputMenuActionPrompt: react.ForwardRefExoticComponent<Omit<NumericInputMenuActionPromptProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
26
26
|
|
|
27
27
|
interface NumericInputVariableProps {
|
|
28
28
|
className?: string;
|
|
@@ -30,7 +30,7 @@ interface NumericInputVariableProps {
|
|
|
30
30
|
onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
31
31
|
value?: number | null;
|
|
32
32
|
}
|
|
33
|
-
declare const NumericInputVariable:
|
|
33
|
+
declare const NumericInputVariable: react.ForwardRefExoticComponent<NumericInputVariableProps & react.RefAttributes<HTMLDivElement>>;
|
|
34
34
|
|
|
35
35
|
type NumericInputValue = string | number | (string | number | undefined)[] | Record<string, number>;
|
|
36
36
|
type NumberResult = {
|
|
@@ -51,7 +51,6 @@ interface NumericInputContextValue {
|
|
|
51
51
|
max?: number;
|
|
52
52
|
min?: number;
|
|
53
53
|
onChange?: (value: NumericInputValue, detail: NumericChangeDetail) => void;
|
|
54
|
-
onChangeEnd?: (value: NumericInputValue, detail: NumericChangeDetail) => void;
|
|
55
54
|
onEmpty?: () => void;
|
|
56
55
|
onIsEditingChange?: (isEditing: boolean) => void;
|
|
57
56
|
onPressEnd?: PressMoveProps["onPressEnd"];
|
|
@@ -59,13 +58,12 @@ interface NumericInputContextValue {
|
|
|
59
58
|
readOnly?: boolean;
|
|
60
59
|
selected?: boolean;
|
|
61
60
|
shiftStep?: number;
|
|
62
|
-
size?: "default" | "large";
|
|
63
61
|
step?: number;
|
|
64
62
|
value?: NumericInputValue;
|
|
65
63
|
variant?: "default" | "light" | "dark" | "reset";
|
|
66
64
|
}
|
|
67
65
|
|
|
68
|
-
interface NumericInputProps extends NumericInputContextValue, Omit<HTMLProps<HTMLInputElement>, "value" | "defaultValue" | "onChange" | "children" | "max" | "min" | "step" | "disabled" | "id"
|
|
66
|
+
interface NumericInputProps extends NumericInputContextValue, Omit<HTMLProps<HTMLInputElement>, "value" | "defaultValue" | "onChange" | "children" | "max" | "min" | "step" | "disabled" | "id"> {
|
|
69
67
|
children?: ReactNode;
|
|
70
68
|
className?: string;
|
|
71
69
|
classNames?: {
|
|
@@ -75,11 +73,10 @@ interface NumericInputProps extends NumericInputContextValue, Omit<HTMLProps<HTM
|
|
|
75
73
|
disabled?: boolean;
|
|
76
74
|
id?: string;
|
|
77
75
|
onChange?: (value: NumericInputValue, detail: NumericChangeDetail) => void;
|
|
78
|
-
onChangeEnd?: (value: NumericInputValue, detail: NumericChangeDetail) => void;
|
|
79
76
|
tooltip?: TooltipProps;
|
|
80
|
-
triggerRef?:
|
|
77
|
+
triggerRef?: react__default.RefObject<HTMLDivElement> | ((el: HTMLDivElement | null) => void);
|
|
81
78
|
}
|
|
82
|
-
interface NumericInputComponent extends
|
|
79
|
+
interface NumericInputComponent extends react__default.ForwardRefExoticComponent<NumericInputProps & react__default.RefAttributes<HTMLInputElement>> {
|
|
83
80
|
ActionPrompt: typeof NumericInputMenuActionPrompt;
|
|
84
81
|
MenuTrigger: typeof NumericInputMenuTrigger;
|
|
85
82
|
Prefix: typeof NumericInputElement;
|
|
@@ -88,18 +85,4 @@ interface NumericInputComponent extends React__default.ForwardRefExoticComponent
|
|
|
88
85
|
}
|
|
89
86
|
declare const NumericInput: NumericInputComponent;
|
|
90
87
|
|
|
91
|
-
|
|
92
|
-
* Hook for handling long press on numeric input increment/decrement buttons.
|
|
93
|
-
* Triggers the callback immediately on press, then repeatedly after a delay.
|
|
94
|
-
*
|
|
95
|
-
* @param callback - Function to call on press and during long press
|
|
96
|
-
* @param delay - Interval between repeated calls (default: 150ms)
|
|
97
|
-
* @param initialDelay - Delay before starting repeated calls (default: 400ms)
|
|
98
|
-
*/
|
|
99
|
-
declare function useNumericLongPress(callback: () => void, delay?: number, initialDelay?: number): {
|
|
100
|
-
onMouseDown: () => void;
|
|
101
|
-
onMouseUp: () => void;
|
|
102
|
-
onMouseLeave: () => void;
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
export { type NumberResult, type NumericChangeDetail, NumericInput, NumericInputElement, type NumericInputElementProps, NumericInputMenuTrigger, type NumericInputMenuTriggerProps, type NumericInputProps, type NumericInputValue, NumericInputVariable, type NumericInputVariableProps, useNumericLongPress };
|
|
88
|
+
export { type NumberResult, type NumericChangeDetail, NumericInput, NumericInputElement, type NumericInputElementProps, NumericInputMenuTrigger, type NumericInputMenuTriggerProps, type NumericInputProps, type NumericInputValue, NumericInputVariable, type NumericInputVariableProps };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Tooltip } from "../../tooltip/dist/index.js";
|
|
2
|
-
import { forwardRef, useRef, useState, useMemo, createContext, cloneElement, memo,
|
|
2
|
+
import { forwardRef, useRef, useState, useMemo, createContext, cloneElement, memo, useEffect, useCallback, Children, isValidElement, useContext } from "react";
|
|
3
3
|
import { useEventCallback } from "usehooks-ts";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { IconButton } from "../../icon-button/dist/index.js";
|
|
@@ -22,9 +22,9 @@ function useNumericInputContext() {
|
|
|
22
22
|
}
|
|
23
23
|
var NumericInputTv = tcv({
|
|
24
24
|
slots: {
|
|
25
|
-
container: ["group/input grid before:border-transparent", "input__number"],
|
|
26
|
-
input: ["peer", "w-full", "cursor-default appearance-none truncate"],
|
|
27
|
-
tooltip: "col-span-3 col-start-1 row-start-1"
|
|
25
|
+
container: ["group/input grid h-6 before:border-transparent", "input__number"],
|
|
26
|
+
input: ["peer", "h-6 w-full", "cursor-default appearance-none truncate"],
|
|
27
|
+
tooltip: "col-span-3 col-start-1 row-start-1 h-6"
|
|
28
28
|
},
|
|
29
29
|
variants: {
|
|
30
30
|
variant: {
|
|
@@ -39,18 +39,6 @@ var NumericInputTv = tcv({
|
|
|
39
39
|
},
|
|
40
40
|
reset: {}
|
|
41
41
|
},
|
|
42
|
-
size: {
|
|
43
|
-
default: {
|
|
44
|
-
container: ["h-6", "input__number--default"],
|
|
45
|
-
input: "h-6",
|
|
46
|
-
tooltip: "h-6"
|
|
47
|
-
},
|
|
48
|
-
large: {
|
|
49
|
-
container: ["h-8", "input__number--large"],
|
|
50
|
-
input: "h-8",
|
|
51
|
-
tooltip: "h-8"
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
42
|
prefixElement: {
|
|
55
43
|
true: {},
|
|
56
44
|
false: {}
|
|
@@ -173,7 +161,6 @@ var NumericInputTv = tcv({
|
|
|
173
161
|
],
|
|
174
162
|
defaultVariants: {
|
|
175
163
|
variant: "default",
|
|
176
|
-
size: "default",
|
|
177
164
|
selected: false,
|
|
178
165
|
disabled: false,
|
|
179
166
|
focused: false
|
|
@@ -185,10 +172,6 @@ var NumericInputMenuTriggerTv = tcv({
|
|
|
185
172
|
disabled: {
|
|
186
173
|
true: ""
|
|
187
174
|
},
|
|
188
|
-
size: {
|
|
189
|
-
default: "",
|
|
190
|
-
large: ""
|
|
191
|
-
},
|
|
192
175
|
type: {
|
|
193
176
|
menu: "",
|
|
194
177
|
action: ""
|
|
@@ -236,7 +219,6 @@ var NumericInputMenuTriggerTv = tcv({
|
|
|
236
219
|
],
|
|
237
220
|
defaultVariants: {
|
|
238
221
|
disabled: false,
|
|
239
|
-
size: "default",
|
|
240
222
|
type: "menu",
|
|
241
223
|
variant: "default"
|
|
242
224
|
}
|
|
@@ -341,21 +323,17 @@ var NumericInputVariableTv = tcv({
|
|
|
341
323
|
}
|
|
342
324
|
});
|
|
343
325
|
var NumericInputElementTv = tcv({
|
|
344
|
-
base: ["select-none", "z-2", "flex flex-none items-center justify-center"],
|
|
326
|
+
base: ["select-none", "z-2 h-6 w-6", "flex flex-none items-center justify-center"],
|
|
345
327
|
variants: {
|
|
346
328
|
type: {
|
|
347
329
|
handler: "select-none",
|
|
348
|
-
action: "",
|
|
349
|
-
menu: ""
|
|
330
|
+
action: "[grid-area:action]",
|
|
331
|
+
menu: "ml-px [grid-area:action]"
|
|
350
332
|
},
|
|
351
333
|
position: {
|
|
352
334
|
prefix: "rounded-l-md",
|
|
353
335
|
suffix: "rounded-r-md"
|
|
354
336
|
},
|
|
355
|
-
size: {
|
|
356
|
-
default: "h-6 w-6",
|
|
357
|
-
large: "h-8 w-8"
|
|
358
|
-
},
|
|
359
337
|
disabled: {
|
|
360
338
|
true: "text-disabled-foreground",
|
|
361
339
|
false: "text-secondary-foreground"
|
|
@@ -378,26 +356,6 @@ var NumericInputElementTv = tcv({
|
|
|
378
356
|
position: "suffix",
|
|
379
357
|
class: "[grid-area:suffix-handler]"
|
|
380
358
|
},
|
|
381
|
-
{
|
|
382
|
-
type: "action",
|
|
383
|
-
position: "prefix",
|
|
384
|
-
class: "[grid-area:prefix-handler]"
|
|
385
|
-
},
|
|
386
|
-
{
|
|
387
|
-
type: "action",
|
|
388
|
-
position: "suffix",
|
|
389
|
-
class: "[grid-area:action]"
|
|
390
|
-
},
|
|
391
|
-
{
|
|
392
|
-
type: "menu",
|
|
393
|
-
position: "prefix",
|
|
394
|
-
class: "[grid-area:prefix-handler]"
|
|
395
|
-
},
|
|
396
|
-
{
|
|
397
|
-
type: "menu",
|
|
398
|
-
position: "suffix",
|
|
399
|
-
class: "ml-px [grid-area:action]"
|
|
400
|
-
},
|
|
401
359
|
{
|
|
402
360
|
type: "handler",
|
|
403
361
|
disabled: false,
|
|
@@ -436,31 +394,25 @@ var NumericInputElementTv = tcv({
|
|
|
436
394
|
],
|
|
437
395
|
defaultVariants: {
|
|
438
396
|
disabled: false,
|
|
439
|
-
variant: "default"
|
|
440
|
-
size: "default"
|
|
397
|
+
variant: "default"
|
|
441
398
|
}
|
|
442
399
|
});
|
|
443
400
|
var NumericInputMenuActionPromptTv = tcv({
|
|
444
401
|
base: [
|
|
445
402
|
"[grid-area:action]",
|
|
446
|
-
"pr-2",
|
|
403
|
+
"w-6 pr-2",
|
|
447
404
|
"flex items-center justify-center",
|
|
448
405
|
"rounded-r-md",
|
|
449
406
|
"pointer-events-none z-3"
|
|
450
407
|
],
|
|
451
408
|
variants: {
|
|
452
|
-
size: {
|
|
453
|
-
default: "w-6",
|
|
454
|
-
large: "w-8"
|
|
455
|
-
},
|
|
456
409
|
disabled: {
|
|
457
410
|
true: "text-secondary-foreground bg-default-background",
|
|
458
411
|
false: "bg-secondary-background group-focus-within/input:hidden group-hover/input:hidden"
|
|
459
412
|
}
|
|
460
413
|
},
|
|
461
414
|
defaultVariants: {
|
|
462
|
-
disabled: false
|
|
463
|
-
size: "default"
|
|
415
|
+
disabled: false
|
|
464
416
|
}
|
|
465
417
|
});
|
|
466
418
|
var NumericInputElement = memo(
|
|
@@ -471,7 +423,6 @@ var NumericInputElement = memo(
|
|
|
471
423
|
const tv = NumericInputElementTv({
|
|
472
424
|
type,
|
|
473
425
|
position,
|
|
474
|
-
size: context.size,
|
|
475
426
|
disabled: context.disabled,
|
|
476
427
|
variant: context.variant
|
|
477
428
|
});
|
|
@@ -499,7 +450,6 @@ var NumericInputMenuTrigger = forwardRef(
|
|
|
499
450
|
const context = useNumericInputContext();
|
|
500
451
|
const tv = NumericInputMenuTriggerTv({
|
|
501
452
|
type,
|
|
502
|
-
size: context.size,
|
|
503
453
|
disabled: context.disabled,
|
|
504
454
|
variant: context.variant
|
|
505
455
|
});
|
|
@@ -507,7 +457,6 @@ var NumericInputMenuTrigger = forwardRef(
|
|
|
507
457
|
IconButton,
|
|
508
458
|
{
|
|
509
459
|
ref,
|
|
510
|
-
size: context.size,
|
|
511
460
|
variant: type === "menu" ? context.disabled ? "ghost" : "solid" : void 0,
|
|
512
461
|
className: tcx(tv, className),
|
|
513
462
|
disabled: context.disabled,
|
|
@@ -525,10 +474,7 @@ var NumericInputMenuActionPrompt = forwardRef((props, ref) => {
|
|
|
525
474
|
"div",
|
|
526
475
|
{
|
|
527
476
|
ref,
|
|
528
|
-
className: tcx(
|
|
529
|
-
NumericInputMenuActionPromptTv({ size: context.size, disabled: context.disabled }),
|
|
530
|
-
className
|
|
531
|
-
),
|
|
477
|
+
className: tcx(NumericInputMenuActionPromptTv({ disabled: context.disabled }), className),
|
|
532
478
|
...rest,
|
|
533
479
|
children
|
|
534
480
|
}
|
|
@@ -919,15 +865,11 @@ function useNumericInput(props) {
|
|
|
919
865
|
step = 1,
|
|
920
866
|
value,
|
|
921
867
|
onChange,
|
|
922
|
-
onChangeEnd,
|
|
923
868
|
onEmpty,
|
|
924
869
|
onPressEnd,
|
|
925
870
|
onPressStart
|
|
926
871
|
} = props;
|
|
927
872
|
const innerRef = useRef(null);
|
|
928
|
-
const dragHasChangedRef = useRef(false);
|
|
929
|
-
const dragEndValueRef = useRef(void 0);
|
|
930
|
-
const dragEndDetailRef = useRef(void 0);
|
|
931
873
|
const [isFocused, setIsFocused] = useState(false);
|
|
932
874
|
const [displayValue, setDisplayValue] = useState("");
|
|
933
875
|
const { shiftPressed, metaPressed } = useModifierKeys(disabled);
|
|
@@ -945,10 +887,6 @@ function useNumericInput(props) {
|
|
|
945
887
|
defaultValue: defaultValuePre,
|
|
946
888
|
allowEmpty: true
|
|
947
889
|
});
|
|
948
|
-
const mapResultToOutputValue = useCallback(
|
|
949
|
-
(result) => typeof value === "string" ? result.string : typeof value === "number" ? result.array[0] : Array.isArray(value) ? result.array : result.object,
|
|
950
|
-
[value]
|
|
951
|
-
);
|
|
952
890
|
useEffect(() => {
|
|
953
891
|
if (!innerValue) {
|
|
954
892
|
setDisplayValue("");
|
|
@@ -967,7 +905,7 @@ function useNumericInput(props) {
|
|
|
967
905
|
setDisplayValue(valuePre2.string);
|
|
968
906
|
}, [innerValue, expression, max, min, decimal, setValue]);
|
|
969
907
|
const updateValue = useCallback(
|
|
970
|
-
(updateFn
|
|
908
|
+
(updateFn) => {
|
|
971
909
|
if (disabled || readOnly) return;
|
|
972
910
|
setValue((prev) => {
|
|
973
911
|
if (!prev) {
|
|
@@ -979,13 +917,10 @@ function useNumericInput(props) {
|
|
|
979
917
|
min,
|
|
980
918
|
decimal
|
|
981
919
|
});
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
dragEndValueRef.current = nextValue;
|
|
987
|
-
dragEndDetailRef.current = initialValue;
|
|
988
|
-
}
|
|
920
|
+
onChange == null ? void 0 : onChange(
|
|
921
|
+
typeof value === "string" ? initialValue.string : typeof value === "number" ? initialValue.array[0] : Array.isArray(value) ? initialValue.array : initialValue.object,
|
|
922
|
+
initialValue
|
|
923
|
+
);
|
|
989
924
|
return initialValue;
|
|
990
925
|
}
|
|
991
926
|
const valuePre2 = dealWithNumericInputValue({
|
|
@@ -1009,18 +944,15 @@ function useNumericInput(props) {
|
|
|
1009
944
|
return true;
|
|
1010
945
|
})();
|
|
1011
946
|
if (hasChanged) {
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
dragEndValueRef.current = nextValue;
|
|
1017
|
-
dragEndDetailRef.current = valuePre2;
|
|
1018
|
-
}
|
|
947
|
+
onChange == null ? void 0 : onChange(
|
|
948
|
+
typeof value === "string" ? valuePre2.string : typeof value === "number" ? valuePre2.array[0] : Array.isArray(value) ? valuePre2.array : valuePre2.object,
|
|
949
|
+
valuePre2
|
|
950
|
+
);
|
|
1019
951
|
}
|
|
1020
952
|
return valuePre2;
|
|
1021
953
|
});
|
|
1022
954
|
},
|
|
1023
|
-
[disabled, readOnly, setValue, max, min, decimal, onChange,
|
|
955
|
+
[disabled, readOnly, setValue, max, min, decimal, onChange, value]
|
|
1024
956
|
);
|
|
1025
957
|
const { inputHandlers } = useInputInteractions({
|
|
1026
958
|
inputRef: innerRef,
|
|
@@ -1045,9 +977,6 @@ function useNumericInput(props) {
|
|
|
1045
977
|
const { isPressed: handlerPressed, pressMoveProps } = usePressMove({
|
|
1046
978
|
disabled,
|
|
1047
979
|
onPressStart: (e) => {
|
|
1048
|
-
dragHasChangedRef.current = false;
|
|
1049
|
-
dragEndValueRef.current = void 0;
|
|
1050
|
-
dragEndDetailRef.current = void 0;
|
|
1051
980
|
const wasFocused = isFocused;
|
|
1052
981
|
if (onPressStart && "nativeEvent" in e) {
|
|
1053
982
|
onPressStart(e.nativeEvent);
|
|
@@ -1073,18 +1002,12 @@ function useNumericInput(props) {
|
|
|
1073
1002
|
onPressEnd(e.nativeEvent);
|
|
1074
1003
|
}
|
|
1075
1004
|
onPressEnd == null ? void 0 : onPressEnd(e);
|
|
1076
|
-
if (dragHasChangedRef.current && dragEndValueRef.current !== void 0 && dragEndDetailRef.current !== void 0) {
|
|
1077
|
-
onChangeEnd == null ? void 0 : onChangeEnd(dragEndValueRef.current, dragEndDetailRef.current);
|
|
1078
|
-
}
|
|
1079
|
-
dragHasChangedRef.current = false;
|
|
1080
|
-
dragEndValueRef.current = void 0;
|
|
1081
|
-
dragEndDetailRef.current = void 0;
|
|
1082
1005
|
},
|
|
1083
1006
|
onPressMoveLeft: (delta) => {
|
|
1084
|
-
updateValue((value2) => value2 - delta * getCurrentStep()
|
|
1007
|
+
updateValue((value2) => value2 - delta * getCurrentStep());
|
|
1085
1008
|
},
|
|
1086
1009
|
onPressMoveRight: (delta) => {
|
|
1087
|
-
updateValue((value2) => value2 + delta * getCurrentStep()
|
|
1010
|
+
updateValue((value2) => value2 + delta * getCurrentStep());
|
|
1088
1011
|
}
|
|
1089
1012
|
});
|
|
1090
1013
|
const inputProps = {
|
|
@@ -1119,7 +1042,6 @@ var NumericInputBase = forwardRef((props, ref) => {
|
|
|
1119
1042
|
readOnly,
|
|
1120
1043
|
required,
|
|
1121
1044
|
shiftStep = 10,
|
|
1122
|
-
size = "default",
|
|
1123
1045
|
step = 1,
|
|
1124
1046
|
value,
|
|
1125
1047
|
variant = "default",
|
|
@@ -1127,7 +1049,6 @@ var NumericInputBase = forwardRef((props, ref) => {
|
|
|
1127
1049
|
selected = false,
|
|
1128
1050
|
tooltip,
|
|
1129
1051
|
onChange,
|
|
1130
|
-
onChangeEnd,
|
|
1131
1052
|
onEmpty,
|
|
1132
1053
|
onPressEnd,
|
|
1133
1054
|
onPressStart,
|
|
@@ -1151,7 +1072,6 @@ var NumericInputBase = forwardRef((props, ref) => {
|
|
|
1151
1072
|
step,
|
|
1152
1073
|
value,
|
|
1153
1074
|
onChange,
|
|
1154
|
-
onChangeEnd,
|
|
1155
1075
|
onEmpty,
|
|
1156
1076
|
onPressEnd,
|
|
1157
1077
|
onPressStart,
|
|
@@ -1174,7 +1094,6 @@ var NumericInputBase = forwardRef((props, ref) => {
|
|
|
1174
1094
|
const contextValue = useMemo(
|
|
1175
1095
|
() => ({
|
|
1176
1096
|
variant,
|
|
1177
|
-
size,
|
|
1178
1097
|
// State
|
|
1179
1098
|
value,
|
|
1180
1099
|
defaultValue,
|
|
@@ -1192,7 +1111,6 @@ var NumericInputBase = forwardRef((props, ref) => {
|
|
|
1192
1111
|
expression,
|
|
1193
1112
|
// Event handling methods
|
|
1194
1113
|
onChange,
|
|
1195
|
-
onChangeEnd,
|
|
1196
1114
|
onEmpty,
|
|
1197
1115
|
onPressStart,
|
|
1198
1116
|
onPressEnd,
|
|
@@ -1202,7 +1120,6 @@ var NumericInputBase = forwardRef((props, ref) => {
|
|
|
1202
1120
|
}),
|
|
1203
1121
|
[
|
|
1204
1122
|
variant,
|
|
1205
|
-
size,
|
|
1206
1123
|
value,
|
|
1207
1124
|
defaultValue,
|
|
1208
1125
|
disabled,
|
|
@@ -1217,7 +1134,6 @@ var NumericInputBase = forwardRef((props, ref) => {
|
|
|
1217
1134
|
decimal,
|
|
1218
1135
|
expression,
|
|
1219
1136
|
onChange,
|
|
1220
|
-
onChangeEnd,
|
|
1221
1137
|
onEmpty,
|
|
1222
1138
|
onPressStart,
|
|
1223
1139
|
onPressEnd,
|
|
@@ -1259,7 +1175,6 @@ var NumericInputBase = forwardRef((props, ref) => {
|
|
|
1259
1175
|
const actionPromptNode = actionPrompt[0] || null;
|
|
1260
1176
|
const tv = NumericInputTv({
|
|
1261
1177
|
variant,
|
|
1262
|
-
size,
|
|
1263
1178
|
selected: selected || handlerPressed,
|
|
1264
1179
|
focused,
|
|
1265
1180
|
disabled,
|
|
@@ -11,20 +11,20 @@ interface PanelRowProps extends Omit<HTMLProps<HTMLFieldSetElement>, "title"> {
|
|
|
11
11
|
* @default "single"
|
|
12
12
|
* @description
|
|
13
13
|
* - `single`: `columns`: 1fr | `areas`: "label" "input" | `rows`: auto minmax(2rem, auto)
|
|
14
|
-
* - `two-columns`: `columns`: 1fr 1fr | `areas`: "label
|
|
14
|
+
* - `two-columns`: `columns`: 1fr 1fr | `areas`: "label label" "left right" | `rows`: auto minmax(2rem, auto)
|
|
15
15
|
* - `one-label-one-input`: `columns`: 8fr 20fr | `areas`: "label input" | `rows`: 2rem
|
|
16
|
-
* - `one-label-one-input-one-icon`: `columns`: 8fr 20fr
|
|
17
|
-
* - `one-label-two-input`: `columns`: 8fr
|
|
18
|
-
* - `one-icon-one-input`: `columns`:
|
|
19
|
-
* - `one-input-one-icon`: `columns`: 1fr
|
|
20
|
-
* - `one-input-two-icon`: `columns`: 1fr
|
|
21
|
-
* - `two-input-two-icon`: `columns`:
|
|
22
|
-
* - `two-input-one-icon`: `columns`: 1fr 1fr
|
|
23
|
-
* - `one-icon-one-input-
|
|
24
|
-
* - `
|
|
25
|
-
* - `
|
|
16
|
+
* - `one-label-one-input-one-icon`: `columns`: 8fr 20fr 2rem | `areas`: "label input icon" | `rows`: 2rem
|
|
17
|
+
* - `one-label-two-input`: `columns`: 8fr 1fr 1fr | `areas`: "label left right" | `rows`: 2rem
|
|
18
|
+
* - `one-icon-one-input`: `columns`: 2rem 1fr | `areas`: "icon input" | `rows`: 2rem
|
|
19
|
+
* - `one-input-one-icon`: `columns`: 1fr 2rem | `areas`: "input icon" | `rows`: 2rem
|
|
20
|
+
* - `one-input-two-icon`: `columns`: 1fr 1fr 2rem | `areas`: "input left icon" "input right icon" | `rows`: 2rem
|
|
21
|
+
* - `two-input-two-icon`: `columns`: 1fr 1fr 2rem | `areas`: "left icon right icon" | `rows`: 2rem
|
|
22
|
+
* - `two-input-one-icon`: `columns`: 2rem 1fr 1fr | `areas`: "icon left right" | `rows`: 2rem
|
|
23
|
+
* - `one-icon-one-input-two-icon`: `columns`: 2rem 1fr 2rem | `areas`: "icon input icon" | `rows`: 2rem
|
|
24
|
+
* - `two-input-one-icon-double-row`: `columns`: 1fr 1fr 2rem | `areas`: "left icon right icon" | `rows`: 2rem 2rem
|
|
25
|
+
* - `one-icon-one-input-two-icon-double-row`: `columns`: 2rem 1fr 2rem | `areas`: "icon input icon" | `rows`: 2rem 2rem
|
|
26
26
|
*/
|
|
27
|
-
type?: "single" | "two-columns" | "one-label-one-input" | "one-label-one-input-one-icon" | "one-label-two-input" | "one-icon-one-input" | "one-input-one-icon" | "one-input-two-icon" | "two-input-two-icon" | "two-input-one-icon" | "one-icon-one-input-
|
|
27
|
+
type?: "single" | "two-columns" | "one-label-one-input" | "one-label-one-input-one-icon" | "one-label-two-input" | "one-icon-one-input" | "one-input-one-icon" | "one-input-two-icon" | "two-input-two-icon" | "two-input-one-icon" | "one-icon-one-input-two-icon" | "two-input-one-icon-double-row";
|
|
28
28
|
}
|
|
29
29
|
declare const PanelRow: react.ForwardRefExoticComponent<Omit<PanelRowProps, "ref"> & react.RefAttributes<HTMLFieldSetElement>>;
|
|
30
30
|
|
|
@@ -83,8 +83,8 @@ declare const SortablePaneContext: react__default.Context<SortablePaneContextVal
|
|
|
83
83
|
declare const useSortablePane: () => SortablePaneContextValue;
|
|
84
84
|
|
|
85
85
|
interface PanelSortableProps<T extends SortableItem> {
|
|
86
|
-
className?: string;
|
|
87
86
|
children: react__default.ReactNode;
|
|
87
|
+
className?: string;
|
|
88
88
|
data: T[];
|
|
89
89
|
onDrop: (position: "top" | "bottom" | null, id: string, newIndex: number) => void;
|
|
90
90
|
onSelectedIdChange: (id: string | null) => void;
|
|
@@ -129,12 +129,12 @@ interface PanelProps extends Omit<HTMLProps<HTMLDivElement>, "title"> {
|
|
|
129
129
|
showLabels?: boolean;
|
|
130
130
|
triggerRef?: React.RefObject<HTMLDivElement>;
|
|
131
131
|
}
|
|
132
|
-
declare const PanelContent:
|
|
132
|
+
declare const PanelContent: ({ children, collapsible, title, otherChildren, }: {
|
|
133
133
|
children: React.ReactNode;
|
|
134
134
|
collapsible?: boolean;
|
|
135
135
|
otherChildren: React.ReactNode[];
|
|
136
136
|
title: React.ReactNode;
|
|
137
|
-
}
|
|
137
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
138
138
|
interface PanelComponentProps extends React.ForwardRefExoticComponent<PanelProps & React.RefAttributes<HTMLDivElement>> {
|
|
139
139
|
Content: typeof PanelContent;
|
|
140
140
|
Label: typeof PanelLabel;
|
|
@@ -149,4 +149,4 @@ interface PanelComponentProps extends React.ForwardRefExoticComponent<PanelProps
|
|
|
149
149
|
declare const PanelBase: react.ForwardRefExoticComponent<Omit<PanelProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
150
150
|
declare const Panel: PanelComponentProps;
|
|
151
151
|
|
|
152
|
-
export { Panel, PanelBase, PanelContext,
|
|
152
|
+
export { Panel, PanelBase, PanelContext, PanelLabel, PanelPreviewer, PanelRow, PanelRowLabel, PanelRowManyIcon, type PanelRowManyIconItem, type PanelRowManyIconProps, type PanelRowProps, PanelSortable, PanelSortableRow, PanelTitle, type SortableItem, SortablePaneContext, type SortablePaneContextValue, SortableRowDataContext, type SortableRowDataContextValue, usePanelContext, useSortablePane, useSortableRowItem };
|
|
@@ -14,11 +14,6 @@ interface PicturePreviewProps extends HTMLProps<HTMLDivElement> {
|
|
|
14
14
|
fileName?: string;
|
|
15
15
|
onClose?: () => void;
|
|
16
16
|
src: string;
|
|
17
|
-
control?: {
|
|
18
|
-
enable?: boolean;
|
|
19
|
-
position?: "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
20
|
-
show?: "always" | "hover";
|
|
21
|
-
};
|
|
22
17
|
}
|
|
23
18
|
declare const PicturePreview: react.ForwardRefExoticComponent<Omit<PicturePreviewProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
24
19
|
|