@vuu-ui/vuu-ui-controls 4.0.0-alpha.2 → 4.0.0-alpha.21
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/package.json +15 -14
- package/src/drag-drop/Draggable.css.js +2 -2
- package/src/expando-input/ExpandoInput.css.js +1 -1
- package/src/icon-button/ToggleIconButton.css.js +1 -1
- package/src/index.js +1 -1
- package/src/item-picker/ItemPicker.css.js +1 -5
- package/src/item-picker/ItemPicker.js +69 -60
- package/src/item-picker/useItemPicker.js +2 -5
- package/src/price-ticker/PriceTicker.css.js +4 -4
- package/src/split-pane/SplitPane.css.js +82 -0
- package/src/split-pane/SplitPane.js +60 -0
- package/src/split-pane/Splitter.js +82 -0
- package/src/split-pane/index.js +1 -0
- package/src/split-pane/useSplitPane.js +101 -0
- package/src/tabstrip/Tab.css.js +3 -3
- package/src/tabstrip/Tabstrip.css.js +2 -2
- package/src/time-input/MaskedInput.js +176 -156
- package/src/time-input/TimeInput.css.js +41 -18
- package/src/time-input/TimeInput.js +25 -14
- package/src/time-input/useTimeInput.js +57 -47
- package/src/toolbar/Toolbar.css.js +1 -1
- package/src/vuu-date-picker/VuuDatePicker.js +46 -52
- package/src/vuu-time-picker/VuuTimePicker.js +6 -5
- package/types/context-panel-provider/ContextPanelProvider.d.ts +1 -1
- package/types/drag-drop/DragDropProvider.d.ts +1 -1
- package/types/hover-overlay/HoverOverlay.d.ts +1 -1
- package/types/icon-button/Icon.d.ts +1 -1
- package/types/icon-button/ToggleIconButton.d.ts +1 -1
- package/types/index.d.ts +4 -4
- package/types/instrument-picker/SearchCell.d.ts +1 -1
- package/types/instrument-picker/TablePicker.d.ts +1 -1
- package/types/item-picker/ItemPicker.d.ts +25 -7
- package/types/item-picker/useItemPicker.d.ts +3 -6
- package/types/modal-provider/ModalProvider.d.ts +1 -1
- package/types/price-ticker/PriceTicker.d.ts +1 -1
- package/types/prompt/Prompt.d.ts +1 -1
- package/types/sortable-list/SortableList.d.ts +2 -2
- package/types/split-button/useSplitButton.d.ts +12 -12
- package/types/split-pane/SplitPane.d.ts +44 -0
- package/types/split-pane/Splitter.d.ts +10 -0
- package/types/split-pane/index.d.ts +2 -0
- package/types/split-pane/useSplitPane.d.ts +18 -0
- package/types/table-search/SearchCell.d.ts +1 -1
- package/types/table-search/TableSearch.d.ts +1 -1
- package/types/tabstrip/TabMenu.d.ts +1 -1
- package/types/tabstrip/Tabstrip.d.ts +1 -2
- package/types/time-input/MaskedInput.d.ts +60 -10
- package/types/time-input/TimeInput.d.ts +4 -3
- package/types/time-input/useTimeInput.d.ts +24 -5
- package/types/toolbar/Toolbar.d.ts +1 -2
- package/types/vuu-date-picker/VuuDatePicker.d.ts +19 -3
- package/types/vuu-time-picker/VuuTimePicker.d.ts +8 -6
- package/types/vuu-typeahead-input/VuuTypeaheadInput.d.ts +1 -1
- package/src/modal-provider/ModalProvider.js +0 -147
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useForkRef } from "@salt-ds/core";
|
|
3
3
|
import { useComponentCssInjection } from "@salt-ds/styles";
|
|
4
4
|
import { useWindow } from "@salt-ds/window";
|
|
5
|
+
import { normaliseTimeString } from "@vuu-ui/vuu-utils";
|
|
5
6
|
import clsx from "clsx";
|
|
7
|
+
import { forwardRef } from "react";
|
|
6
8
|
import { useTimeInput } from "./useTimeInput.js";
|
|
7
9
|
import TimeInput_0 from "./TimeInput.css";
|
|
8
10
|
const classBase = "vuuTimeInput";
|
|
9
|
-
const TimeInput_TimeInput = /*#__PURE__*/ forwardRef(function({ className, date, defaultValue, onChange, onCommit, placeholder = "hh:mm:ss", value, ...htmlAttributes }, ref) {
|
|
11
|
+
const TimeInput_TimeInput = /*#__PURE__*/ forwardRef(function({ className, date, defaultValue, milliseconds = false, onChange, onCommit, placeholder = milliseconds ? "hh:mm:ss.sss" : "hh:mm:ss", value, ...htmlAttributes }, ref) {
|
|
10
12
|
const targetWindow = useWindow();
|
|
11
13
|
useComponentCssInjection({
|
|
12
14
|
testId: "vuu-time-input",
|
|
@@ -16,22 +18,31 @@ const TimeInput_TimeInput = /*#__PURE__*/ forwardRef(function({ className, date,
|
|
|
16
18
|
const { inputRef, eventHandlers } = useTimeInput({
|
|
17
19
|
date,
|
|
18
20
|
defaultValue,
|
|
21
|
+
milliseconds,
|
|
19
22
|
onChange,
|
|
20
23
|
onCommit,
|
|
21
24
|
value
|
|
22
25
|
});
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
26
|
+
const displayValue = void 0 === value ? void 0 : normaliseTimeString(value, milliseconds) ?? value;
|
|
27
|
+
const displayDefaultValue = void 0 === value && void 0 !== defaultValue ? normaliseTimeString(defaultValue, milliseconds) ?? defaultValue : void 0;
|
|
28
|
+
return /*#__PURE__*/ jsx("span", {
|
|
29
|
+
className: `${classBase}-container`,
|
|
30
|
+
"data-placeholder": placeholder,
|
|
31
|
+
"data-sample-value": milliseconds ? "00:00:00.000" : "00:00:00",
|
|
32
|
+
children: /*#__PURE__*/ jsx("input", {
|
|
33
|
+
...htmlAttributes,
|
|
34
|
+
...eventHandlers,
|
|
35
|
+
"aria-placeholder": placeholder,
|
|
36
|
+
className: clsx(classBase, className, {
|
|
37
|
+
[`${classBase}-milliseconds`]: milliseconds
|
|
38
|
+
}),
|
|
39
|
+
defaultValue: displayDefaultValue,
|
|
40
|
+
placeholder: placeholder,
|
|
41
|
+
readOnly: true,
|
|
42
|
+
ref: useForkRef(ref, inputRef),
|
|
43
|
+
spellCheck: "false",
|
|
44
|
+
value: displayValue
|
|
45
|
+
})
|
|
35
46
|
});
|
|
36
47
|
});
|
|
37
48
|
export { TimeInput_TimeInput as TimeInput };
|
|
@@ -1,75 +1,85 @@
|
|
|
1
|
-
import { isValidTimeString } from "@vuu-ui/vuu-utils";
|
|
2
|
-
import { useCallback,
|
|
1
|
+
import { isValidTimeString, isValidTimeStringMillis } from "@vuu-ui/vuu-utils";
|
|
2
|
+
import { useCallback, useRef } from "react";
|
|
3
3
|
import { MaskedInput } from "./MaskedInput.js";
|
|
4
4
|
const isDigit = (char)=>1 === char.length && /[0-9]/.test(char);
|
|
5
|
-
const useTimeInput = ({ defaultValue, onChange, onCommit, value })=>{
|
|
5
|
+
const useTimeInput = ({ defaultValue, milliseconds = false, onChange, onCommit: onCommitProp, value })=>{
|
|
6
|
+
const onCommit = onCommitProp;
|
|
6
7
|
const mousedDownRef = useRef(false);
|
|
8
|
+
const onChangeRef = useRef(onChange);
|
|
9
|
+
onChangeRef.current = onChange;
|
|
7
10
|
const maskedInputRef = useRef(void 0);
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
11
|
+
if (void 0 === maskedInputRef.current || maskedInputRef.current.milliseconds !== milliseconds) {
|
|
12
|
+
maskedInputRef.current = new MaskedInput(value ?? maskedInputRef.current?.value ?? defaultValue, null, {
|
|
13
|
+
milliseconds
|
|
14
|
+
});
|
|
15
|
+
maskedInputRef.current.on("change", (e)=>{
|
|
16
|
+
onChangeRef.current?.(e);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
const maskedInput = maskedInputRef.current;
|
|
20
|
+
if (void 0 !== value) maskedInput.value = value;
|
|
21
|
+
const setInputEl = useCallback((el)=>{
|
|
22
|
+
maskedInput.input = el;
|
|
16
23
|
}, [
|
|
17
|
-
|
|
18
|
-
onChange,
|
|
19
|
-
value
|
|
24
|
+
maskedInput
|
|
20
25
|
]);
|
|
21
|
-
const
|
|
22
|
-
if (
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
if (isValidTimeString(value)) onCommit(evt, value, "text-input");
|
|
27
|
-
else if ("hh:mm:ss" === value) console.log("no value set");
|
|
28
|
-
else console.log("value is not valid");
|
|
26
|
+
const commitValue = useCallback((evt)=>{
|
|
27
|
+
if ("" !== evt.currentTarget.value) {
|
|
28
|
+
const { value } = maskedInput;
|
|
29
|
+
if (milliseconds ? isValidTimeStringMillis(value) : isValidTimeString(value)) onCommit(evt, value, "text-input");
|
|
30
|
+
}
|
|
29
31
|
}, [
|
|
32
|
+
maskedInput,
|
|
33
|
+
milliseconds,
|
|
30
34
|
onCommit
|
|
31
35
|
]);
|
|
32
36
|
const handleKeyDown = useCallback((e)=>{
|
|
33
|
-
|
|
34
|
-
if (maskedInput)
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
else if ("Tab" === e.key) return;
|
|
45
|
-
else if ("Enter" === e.key) commitValue(e, maskedInput.value);
|
|
46
|
-
}
|
|
37
|
+
if (e.ctrlKey || e.metaKey || e.altKey || "Tab" === e.key) return;
|
|
38
|
+
if ("Backspace" === e.key) maskedInput.backspace();
|
|
39
|
+
else if (isDigit(e.key)) maskedInput.update(e.key);
|
|
40
|
+
else if ("ArrowLeft" === e.key) maskedInput.moveFocus("left");
|
|
41
|
+
else if ("ArrowRight" === e.key) maskedInput.moveFocus("right");
|
|
42
|
+
else if ("ArrowUp" === e.key) maskedInput.incrementValue();
|
|
43
|
+
else if ("ArrowDown" === e.key) maskedInput.decrementValue();
|
|
44
|
+
else if ("Home" === e.key) maskedInput.selectFirst();
|
|
45
|
+
else if ("End" === e.key) maskedInput.selectLast();
|
|
46
|
+
else if ("Enter" === e.key) commitValue(e);
|
|
47
|
+
else if ("Escape" === e.key) return;
|
|
47
48
|
e.preventDefault();
|
|
48
49
|
}, [
|
|
49
|
-
commitValue
|
|
50
|
+
commitValue,
|
|
51
|
+
maskedInput
|
|
50
52
|
]);
|
|
51
53
|
const handleDoubleClick = useCallback(()=>{
|
|
52
|
-
|
|
53
|
-
}, [
|
|
54
|
+
maskedInput.doubleClick();
|
|
55
|
+
}, [
|
|
56
|
+
maskedInput
|
|
57
|
+
]);
|
|
54
58
|
const handlePaste = useCallback((e)=>{
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}, [
|
|
59
|
+
e.preventDefault();
|
|
60
|
+
maskedInput.pasteValue(e.clipboardData.getData("text"));
|
|
61
|
+
}, [
|
|
62
|
+
maskedInput
|
|
63
|
+
]);
|
|
58
64
|
const handleFocus = useCallback(()=>{
|
|
59
65
|
if (mousedDownRef.current) mousedDownRef.current = false;
|
|
60
|
-
else
|
|
61
|
-
}, [
|
|
66
|
+
else maskedInput.focus();
|
|
67
|
+
}, [
|
|
68
|
+
maskedInput
|
|
69
|
+
]);
|
|
62
70
|
const handleMouseDown = useCallback(()=>{
|
|
63
71
|
mousedDownRef.current = true;
|
|
64
72
|
}, []);
|
|
65
73
|
const handleMouseUp = useCallback((e)=>{
|
|
66
74
|
e.preventDefault();
|
|
67
|
-
|
|
68
|
-
}, [
|
|
75
|
+
maskedInput.click();
|
|
76
|
+
}, [
|
|
77
|
+
maskedInput
|
|
78
|
+
]);
|
|
69
79
|
return {
|
|
70
80
|
inputRef: setInputEl,
|
|
71
81
|
eventHandlers: {
|
|
72
|
-
onBlur:
|
|
82
|
+
onBlur: maskedInput.blur,
|
|
73
83
|
onDoubleClick: handleDoubleClick,
|
|
74
84
|
onFocus: handleFocus,
|
|
75
85
|
onKeyDown: handleKeyDown,
|
|
@@ -35,7 +35,7 @@ const css = `
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
.vuuToolbarItem:focus, .vuuToolbarItem:focus-visible {
|
|
38
|
-
outline-color: var(--vuuToolbarItem-outlineColor, var(--vuu-color-purple
|
|
38
|
+
outline-color: var(--vuuToolbarItem-outlineColor, var(--vuu-color-purple));
|
|
39
39
|
outline-offset: 0px;
|
|
40
40
|
outline-width: 1px;
|
|
41
41
|
outline-style: dashed;
|
|
@@ -1,84 +1,78 @@
|
|
|
1
|
-
import { createElement, useCallback, useRef, useState } from "react";
|
|
2
|
-
import {
|
|
1
|
+
import { createElement, useCallback, useMemo, useRef, useState } from "react";
|
|
2
|
+
import { EpochTimestamp, fromDateTimeFields } from "@vuu-ui/vuu-utils";
|
|
3
|
+
import { CalendarDate } from "@internationalized/date";
|
|
3
4
|
import clsx from "clsx";
|
|
4
5
|
import { DatePicker } from "../date-picker/index.js";
|
|
5
6
|
const classBase = "VuuDatePicker";
|
|
6
|
-
const isSameDate = (d1, d2)=>void 0 !== d2 && isSameDay(d1, d2) && isSameMonth(d1, d2) && isSameYear(d1, d2);
|
|
7
7
|
const datePattern = /^\d{1,2} [a-z]{3} \d{4}$/i;
|
|
8
|
-
const isValidDate = (value)=>void 0 !== value && value
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
if (
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
};
|
|
17
|
-
return {
|
|
18
|
-
datePickerKey: "uncontrolled",
|
|
19
|
-
defaultDate: void 0,
|
|
20
|
-
selectedDate
|
|
21
|
-
};
|
|
8
|
+
const isValidDate = (value)=>void 0 !== value && null !== value.match(datePattern) && !Number.isNaN(new Date(value).getDay());
|
|
9
|
+
const isSameDate = (d1, d2)=>void 0 !== d2 && 0 === d1.compare(d2);
|
|
10
|
+
const toCalendarDateInTimeZone = (value, timeZone)=>{
|
|
11
|
+
const timestamp = value instanceof EpochTimestamp ? value : EpochTimestamp.fromWire(value, "epochMillis");
|
|
12
|
+
if (timestamp) {
|
|
13
|
+
const { year, month, day } = timestamp.getFields(timeZone);
|
|
14
|
+
return new CalendarDate(year, month, day);
|
|
15
|
+
}
|
|
22
16
|
};
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
17
|
+
const startOfDateInTimeZone = (date, timeZone)=>fromDateTimeFields({
|
|
18
|
+
year: date.year,
|
|
19
|
+
month: date.month,
|
|
20
|
+
day: date.day,
|
|
21
|
+
hour: 0,
|
|
22
|
+
minute: 0,
|
|
23
|
+
second: 0,
|
|
24
|
+
millisecond: 0
|
|
25
|
+
}, timeZone);
|
|
26
|
+
const VuuDatePicker = ({ className, onSelectionChange, onCommit, preserveFocusOnSelect, selectedDate: selectedDateProp, timeZone, value, ...props })=>{
|
|
27
|
+
const [open, setOpen] = useState(false);
|
|
28
|
+
const inputValueRef = useRef("");
|
|
26
29
|
const datePickerRef = useRef(null);
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
const controlledDate = useMemo(()=>selectedDateProp ?? toCalendarDateInTimeZone(value, timeZone), [
|
|
31
|
+
selectedDateProp,
|
|
32
|
+
timeZone,
|
|
33
|
+
value
|
|
34
|
+
]);
|
|
35
|
+
const [selectedDate, setSelectedDate] = useState(controlledDate);
|
|
36
|
+
const controlledDateRef = useRef(controlledDate);
|
|
37
|
+
if (void 0 !== controlledDate && (void 0 === controlledDateRef.current || 0 !== controlledDate.compare(controlledDateRef.current))) {
|
|
38
|
+
controlledDateRef.current = controlledDate;
|
|
39
|
+
if (!isSameDate(controlledDate, selectedDate)) setSelectedDate(controlledDate);
|
|
40
|
+
}
|
|
32
41
|
const commitDateChange = useCallback((e, date)=>{
|
|
33
42
|
onSelectionChange?.(e, date);
|
|
34
43
|
setOpen(false);
|
|
35
|
-
onCommit?.(e,
|
|
44
|
+
onCommit?.(e, startOfDateInTimeZone(date, timeZone));
|
|
36
45
|
if (preserveFocusOnSelect) requestAnimationFrame(()=>{
|
|
37
46
|
datePickerRef.current?.querySelector("input")?.focus();
|
|
38
47
|
});
|
|
39
48
|
}, [
|
|
40
49
|
onCommit,
|
|
41
50
|
onSelectionChange,
|
|
42
|
-
preserveFocusOnSelect
|
|
51
|
+
preserveFocusOnSelect,
|
|
52
|
+
timeZone
|
|
43
53
|
]);
|
|
44
54
|
const handleSelectionChange = useCallback((e, date)=>{
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
dateState.current = getDates(date);
|
|
49
|
-
commitDateChange(e, date);
|
|
50
|
-
} else if (!isSameDate(date, selectedDate)) {
|
|
51
|
-
dateState.current.selectedDate = date;
|
|
52
|
-
commitDateChange(e, date);
|
|
53
|
-
}
|
|
55
|
+
if (date && !isSameDate(date, selectedDate)) {
|
|
56
|
+
setSelectedDate(date);
|
|
57
|
+
commitDateChange(e, date);
|
|
54
58
|
}
|
|
55
59
|
}, [
|
|
56
|
-
commitDateChange
|
|
60
|
+
commitDateChange,
|
|
61
|
+
selectedDate
|
|
57
62
|
]);
|
|
58
|
-
const handleChange = (
|
|
59
|
-
|
|
60
|
-
evt,
|
|
61
|
-
value
|
|
62
|
-
});
|
|
63
|
-
valueRef.current = value;
|
|
64
|
-
console.log(`is '${value}' a valid date ? ${isValidDate(value)}`);
|
|
63
|
+
const handleChange = (_evt, value = "")=>{
|
|
64
|
+
inputValueRef.current = value;
|
|
65
65
|
};
|
|
66
66
|
const handleKeyDown = (e)=>{
|
|
67
67
|
if ("ArrowDown" === e.key) setOpen(true);
|
|
68
68
|
};
|
|
69
69
|
const handleKeyDownCapture = (e)=>{
|
|
70
|
-
if ("Enter" === e.key
|
|
71
|
-
else {
|
|
72
|
-
console.log(`nice try cowboy, but '${valueRef.current}' is nota valid date`);
|
|
73
|
-
e.stopPropagation();
|
|
74
|
-
}
|
|
70
|
+
if ("Enter" === e.key && "" !== inputValueRef.current && !isValidDate(inputValueRef.current)) e.stopPropagation();
|
|
75
71
|
};
|
|
76
|
-
const { datePickerKey, defaultDate, selectedDate } = dateState.current;
|
|
77
72
|
return /*#__PURE__*/ createElement(DatePicker, {
|
|
78
73
|
...props,
|
|
79
74
|
className: clsx(classBase, className),
|
|
80
|
-
|
|
81
|
-
key: datePickerKey,
|
|
75
|
+
key: selectedDate ? "controlled" : "uncontrolled",
|
|
82
76
|
open: open,
|
|
83
77
|
onChange: handleChange,
|
|
84
78
|
onKeyDown: handleKeyDown,
|
|
@@ -5,7 +5,7 @@ import clsx from "clsx";
|
|
|
5
5
|
import { TimeInput } from "../time-input/TimeInput.js";
|
|
6
6
|
import VuuTimePicker from "./VuuTimePicker.css";
|
|
7
7
|
const classBase = "vuuTimePicker";
|
|
8
|
-
const VuuTimePicker_VuuTimePicker = ({ className, defaultValue, onChange, onCommit, value, ...htmlAttributes })=>{
|
|
8
|
+
const VuuTimePicker_VuuTimePicker = ({ className, defaultValue, milliseconds, onChange, onCommit, value, ...htmlAttributes })=>{
|
|
9
9
|
const targetWindow = useWindow();
|
|
10
10
|
useComponentCssInjection({
|
|
11
11
|
testId: "vuu-time-picker",
|
|
@@ -16,10 +16,11 @@ const VuuTimePicker_VuuTimePicker = ({ className, defaultValue, onChange, onComm
|
|
|
16
16
|
...htmlAttributes,
|
|
17
17
|
className: clsx(classBase, className),
|
|
18
18
|
children: /*#__PURE__*/ jsx(TimeInput, {
|
|
19
|
-
defaultValue
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
defaultValue,
|
|
20
|
+
milliseconds,
|
|
21
|
+
onChange,
|
|
22
|
+
onCommit,
|
|
23
|
+
value
|
|
23
24
|
})
|
|
24
25
|
});
|
|
25
26
|
};
|
|
@@ -9,6 +9,6 @@ export declare const ContextPanelContext: import("react").Context<ContextPanelPr
|
|
|
9
9
|
export declare const ContextPanelProvider: ({ children, hideContextPanel: hideContextPanelProp, resolveComponent, showContextPanel: showContextPanelProp, }: Partial<ContextPanelProps> & {
|
|
10
10
|
children: ReactNode;
|
|
11
11
|
resolveComponent?: ResolveContextPanelComponent;
|
|
12
|
-
}) => import("react").JSX.Element;
|
|
12
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
export declare function useContextPanel(): ShowContextPanel;
|
|
14
14
|
export declare function useHideContextPanel(): (() => void) | undefined;
|
|
@@ -27,7 +27,7 @@ export type MeasuredTarget = {
|
|
|
27
27
|
right: number;
|
|
28
28
|
top: number;
|
|
29
29
|
};
|
|
30
|
-
export declare const DragDropProvider: ({ children, dragSources: dragSourcesProp, }: DragDropProviderProps) => import("react").JSX.Element;
|
|
30
|
+
export declare const DragDropProvider: ({ children, dragSources: dragSourcesProp, }: DragDropProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
31
31
|
export interface DragDropProviderResult {
|
|
32
32
|
isDragSource?: boolean;
|
|
33
33
|
isDropTarget?: boolean;
|
|
@@ -5,4 +5,4 @@ export interface HoverOverlayProps extends Pick<OverlayProps, "placement" | "onO
|
|
|
5
5
|
open?: boolean;
|
|
6
6
|
trigger: ReactNode;
|
|
7
7
|
}
|
|
8
|
-
export declare const HoverOverlay: ({ children, open: openProp, onOpenChange, placement, trigger, }: HoverOverlayProps) => import("react").JSX.Element;
|
|
8
|
+
export declare const HoverOverlay: ({ children, open: openProp, onOpenChange, placement, trigger, }: HoverOverlayProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,4 +3,4 @@ export interface IconProps extends HTMLAttributes<HTMLSpanElement> {
|
|
|
3
3
|
name: string;
|
|
4
4
|
size?: number;
|
|
5
5
|
}
|
|
6
|
-
export declare const Icon: ({ className, name, size, style: styleProp, ...htmlAttributes }: IconProps) => import("react").JSX.Element;
|
|
6
|
+
export declare const Icon: ({ className, name, size, style: styleProp, ...htmlAttributes }: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,4 +2,4 @@ import { IconButtonProps } from "./IconButton";
|
|
|
2
2
|
export interface ToggleIconButtonProps extends Omit<IconButtonProps, "icon"> {
|
|
3
3
|
isExpanded: boolean;
|
|
4
4
|
}
|
|
5
|
-
export declare const ToggleIconButton: ({ className, isExpanded, size, ...props }: ToggleIconButtonProps) => import("react").JSX.Element;
|
|
5
|
+
export declare const ToggleIconButton: ({ className, isExpanded, size, ...props }: ToggleIconButtonProps) => import("react/jsx-runtime").JSX.Element;
|
package/types/index.d.ts
CHANGED
|
@@ -13,21 +13,21 @@ export { HoverOverlay } from "./hover-overlay/HoverOverlay";
|
|
|
13
13
|
export * from "./icon-button";
|
|
14
14
|
export * from "./instrument-picker";
|
|
15
15
|
export { ItemPicker, type ItemPickerProps } from "./item-picker/ItemPicker";
|
|
16
|
-
export {
|
|
16
|
+
export type { ItemDescriptor, SelectedItemsChangeHandler as SelectedItemChangeHandler } from "./item-picker/useItemPicker";
|
|
17
17
|
export * from "./measured-container";
|
|
18
|
-
export { ModalProvider, useModal } from "./modal-provider/ModalProvider";
|
|
19
18
|
export * from "./overflow-container";
|
|
20
19
|
export * from "./price-ticker";
|
|
21
20
|
export { Prompt, type PromptProps } from "./prompt/Prompt";
|
|
22
21
|
export { SortableList, SortableOption } from "./sortable-list/SortableList";
|
|
23
22
|
export * from "./split-button";
|
|
23
|
+
export * from "./split-pane";
|
|
24
24
|
export * from "./table-search";
|
|
25
25
|
export * from "./tabs-next";
|
|
26
26
|
export * from "./tabstrip";
|
|
27
|
-
export { TimeInput, type TimeInputProps } from "./time-input/TimeInput";
|
|
27
|
+
export { TimeInput, type TimeInputMillisecondsProps, type TimeInputProps, type TimeInputSecondsProps, } from "./time-input/TimeInput";
|
|
28
28
|
export * from "./toolbar";
|
|
29
29
|
export * from "./utils";
|
|
30
30
|
export * from "./vuu-date-picker";
|
|
31
31
|
export * from "./vuu-input";
|
|
32
|
-
export { VuuTimePicker, type VuuTimePickerProps, } from "./vuu-time-picker/VuuTimePicker";
|
|
32
|
+
export { VuuTimePicker, type VuuTimePickerMillisecondsProps, type VuuTimePickerProps, type VuuTimePickerSecondsProps, } from "./vuu-time-picker/VuuTimePicker";
|
|
33
33
|
export * from "./vuu-typeahead-input";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { TableCellRendererProps } from "@vuu-ui/vuu-table-types";
|
|
2
|
-
export declare const SearchCell: ({ column, dataRow }: TableCellRendererProps) => import("react").JSX.Element;
|
|
2
|
+
export declare const SearchCell: ({ column, dataRow }: TableCellRendererProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -8,4 +8,4 @@ export interface TablePickerProps extends Omit<HTMLAttributes<HTMLElement>, "onS
|
|
|
8
8
|
schema: TableSchema;
|
|
9
9
|
searchColumns?: string[];
|
|
10
10
|
}
|
|
11
|
-
export declare const TablePicker: ({ TableProps, onSelect, rowToString, schema, searchColumns, ...htmlAttributes }: TablePickerProps) => import("react").JSX.Element;
|
|
11
|
+
export declare const TablePicker: ({ TableProps, onSelect, rowToString, schema, searchColumns, ...htmlAttributes }: TablePickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,16 +1,34 @@
|
|
|
1
|
-
import { ListBoxProps } from "@salt-ds/core";
|
|
2
|
-
import { ItemTypeName } from "@vuu-ui/vuu-utils";
|
|
3
|
-
import { HTMLAttributes } from "react";
|
|
4
|
-
import {
|
|
1
|
+
import { type ListBoxProps, type OptionProps } from "@salt-ds/core";
|
|
2
|
+
import { type ItemTypeName } from "@vuu-ui/vuu-utils";
|
|
3
|
+
import { type ComponentType, type HTMLAttributes, type MouseEventHandler } from "react";
|
|
4
|
+
import { type ItemDescriptor, type ItemPickerHookProps } from "./useItemPicker";
|
|
5
5
|
export declare const classBaseListItem = "vuuItemPickerListItem";
|
|
6
|
+
export type ItemPickerLayout = 'v-available-selected' | 'v-selected-available';
|
|
6
7
|
export interface ItemPickerProps extends ItemPickerHookProps, HTMLAttributes<HTMLDivElement>, Pick<ListBoxProps<ItemDescriptor>, "selected" | "onSelectionChange"> {
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
AvailableListItem?: ComponentType<AvailableListItemProps>;
|
|
9
|
+
SelectedListItem?: ComponentType<SelectedListItemProps>;
|
|
10
|
+
itemTypeName?: ItemTypeName;
|
|
11
|
+
/**
|
|
12
|
+
* Display order of SelectedItems List / AvailableItems List
|
|
13
|
+
*/
|
|
14
|
+
layout?: ItemPickerLayout;
|
|
9
15
|
searchForm?: boolean;
|
|
10
|
-
|
|
16
|
+
}
|
|
17
|
+
interface SelectedListItemProps extends OptionProps {
|
|
18
|
+
index: number;
|
|
19
|
+
item: ItemDescriptor;
|
|
20
|
+
onRemove: MouseEventHandler<HTMLButtonElement>;
|
|
21
|
+
searchPattern?: Lowercase<string>;
|
|
22
|
+
}
|
|
23
|
+
interface AvailableListItemProps extends OptionProps {
|
|
24
|
+
index: number;
|
|
25
|
+
item: ItemDescriptor;
|
|
26
|
+
onAdd: MouseEventHandler<HTMLButtonElement>;
|
|
27
|
+
searchPattern?: Lowercase<string>;
|
|
11
28
|
}
|
|
12
29
|
/** Generic controlled component that displays items in a 'picker' that are available to search, select, reorder or deselect.
|
|
13
30
|
* As input props, all available items, currently selected items, search text and callback functions for changes in selected items and search text
|
|
14
31
|
* must be supplied by the client.
|
|
15
32
|
*/
|
|
16
33
|
export declare const ItemPicker: import("react").ForwardRefExoticComponent<ItemPickerProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
34
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { FormEventHandler, MouseEventHandler } from "react";
|
|
1
|
+
import { type FormEventHandler, type MouseEventHandler } from "react";
|
|
2
|
+
export type SelectedItemsChangeHandler = (newSelectedItems: readonly ItemDescriptor[]) => void;
|
|
2
3
|
/** This is a public description of an Item that can be displayed in the ItemPicker component, defining all the
|
|
3
4
|
* mandatory and option attributes that can be defined by the client. */
|
|
4
5
|
export interface ItemDescriptor {
|
|
@@ -11,15 +12,11 @@ export interface ItemDescriptor {
|
|
|
11
12
|
/** Optional string to define groups of items for client reference, not currently used for rendering */
|
|
12
13
|
group?: string;
|
|
13
14
|
}
|
|
14
|
-
export interface CreateCustomItemProps {
|
|
15
|
-
buttonLabel: string;
|
|
16
|
-
onClickCreateCustomItem: MouseEventHandler<HTMLButtonElement>;
|
|
17
|
-
}
|
|
18
15
|
export interface ItemPickerHookProps {
|
|
19
16
|
allItems: ItemDescriptor[];
|
|
20
17
|
selectedItems: ItemDescriptor[];
|
|
21
18
|
maxSelections?: number;
|
|
22
|
-
onSelectedItemsChange:
|
|
19
|
+
onSelectedItemsChange: SelectedItemsChangeHandler;
|
|
23
20
|
}
|
|
24
21
|
export declare const getItemLabel: (item: ItemDescriptor) => string;
|
|
25
22
|
export declare const useItemPicker: ({ allItems, selectedItems, maxSelections, onSelectedItemsChange, }: ItemPickerHookProps) => {
|
|
@@ -4,7 +4,7 @@ export type ShowDialog = (dialogContent: ReactElement, title: string, dialogActi
|
|
|
4
4
|
export type ShowPrompt = (promptContent: ReactElement, promptProps: PromptProps) => void;
|
|
5
5
|
export declare const ModalProvider: ({ children }: {
|
|
6
6
|
children: ReactNode;
|
|
7
|
-
}) => import("react").JSX.Element;
|
|
7
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export declare const useModal: () => {
|
|
9
9
|
showDialog: ShowDialog;
|
|
10
10
|
closeDialog: () => void;
|
|
@@ -4,4 +4,4 @@ export interface PriceTickerProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
4
4
|
price?: number;
|
|
5
5
|
showArrow?: boolean;
|
|
6
6
|
}
|
|
7
|
-
export declare const PriceTicker: import("react").MemoExoticComponent<({ className, decimals, price, showArrow, ...htmlAttributes }: PriceTickerProps) => import("react").JSX.Element>;
|
|
7
|
+
export declare const PriceTicker: import("react").MemoExoticComponent<({ className, decimals, price, showArrow, ...htmlAttributes }: PriceTickerProps) => import("react/jsx-runtime").JSX.Element>;
|
package/types/prompt/Prompt.d.ts
CHANGED
|
@@ -50,4 +50,4 @@ export interface PromptProps extends Pick<DialogProps, "disableDismiss" | "onOpe
|
|
|
50
50
|
showConfirmButton?: boolean;
|
|
51
51
|
title: string;
|
|
52
52
|
}
|
|
53
|
-
export declare const Prompt: ({ children, className, cancelButtonLabel, cancelButtonProps, confirmButtonLabel, confirmButtonProps, customAction, disableDismiss, disableAccent, headerTag, icon, initialFocusedItem, onCancel, onClose, onConfirm, onOpenChange, open, showCancelButton, showCloseButton, showConfirmButton, status, title, ...htmlAttributes }: PromptProps) => import("react").JSX.Element;
|
|
53
|
+
export declare const Prompt: ({ children, className, cancelButtonLabel, cancelButtonProps, confirmButtonLabel, confirmButtonProps, customAction, disableDismiss, disableAccent, headerTag, icon, initialFocusedItem, onCancel, onClose, onConfirm, onOpenChange, open, showCancelButton, showCloseButton, showConfirmButton, status, title, ...htmlAttributes }: PromptProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,7 +2,7 @@ import { ListBoxProps, OptionProps } from "@salt-ds/core";
|
|
|
2
2
|
export declare const SortableOption: ({ id, index, value, ...optionProps }: OptionProps & {
|
|
3
3
|
id: string;
|
|
4
4
|
index: number;
|
|
5
|
-
}) => import("react").JSX.Element;
|
|
5
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export declare const SortableList: ({ children, onReorderListItems, ...listBoxProps }: ListBoxProps & {
|
|
7
7
|
onReorderListItems?: (listItems: unknown[]) => void;
|
|
8
|
-
}) => import("react").JSX.Element;
|
|
8
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -27,18 +27,18 @@ export declare const useSplitButton: ({ ButtonProps: ButtonPropsProp, PopupMenuP
|
|
|
27
27
|
onFocusCapture?: FocusEventHandler<HTMLButtonElement> | undefined;
|
|
28
28
|
onBlur?: FocusEventHandler<HTMLButtonElement> | undefined;
|
|
29
29
|
onBlurCapture?: FocusEventHandler<HTMLButtonElement> | undefined;
|
|
30
|
-
onChange?: import("react").
|
|
31
|
-
onChangeCapture?: import("react").
|
|
30
|
+
onChange?: import("react").FormEventHandler<HTMLButtonElement> | undefined;
|
|
31
|
+
onChangeCapture?: import("react").FormEventHandler<HTMLButtonElement> | undefined;
|
|
32
32
|
onBeforeInput?: import("react").InputEventHandler<HTMLButtonElement> | undefined;
|
|
33
|
-
onBeforeInputCapture?: import("react").
|
|
34
|
-
onInput?: import("react").
|
|
35
|
-
onInputCapture?: import("react").
|
|
36
|
-
onReset?: import("react").
|
|
37
|
-
onResetCapture?: import("react").
|
|
38
|
-
onSubmit?: import("react").
|
|
39
|
-
onSubmitCapture?: import("react").
|
|
40
|
-
onInvalid?: import("react").
|
|
41
|
-
onInvalidCapture?: import("react").
|
|
33
|
+
onBeforeInputCapture?: import("react").FormEventHandler<HTMLButtonElement> | undefined;
|
|
34
|
+
onInput?: import("react").FormEventHandler<HTMLButtonElement> | undefined;
|
|
35
|
+
onInputCapture?: import("react").FormEventHandler<HTMLButtonElement> | undefined;
|
|
36
|
+
onReset?: import("react").FormEventHandler<HTMLButtonElement> | undefined;
|
|
37
|
+
onResetCapture?: import("react").FormEventHandler<HTMLButtonElement> | undefined;
|
|
38
|
+
onSubmit?: import("react").FormEventHandler<HTMLButtonElement> | undefined;
|
|
39
|
+
onSubmitCapture?: import("react").FormEventHandler<HTMLButtonElement> | undefined;
|
|
40
|
+
onInvalid?: import("react").FormEventHandler<HTMLButtonElement> | undefined;
|
|
41
|
+
onInvalidCapture?: import("react").FormEventHandler<HTMLButtonElement> | undefined;
|
|
42
42
|
onLoad?: import("react").ReactEventHandler<HTMLButtonElement> | undefined;
|
|
43
43
|
onLoadCapture?: import("react").ReactEventHandler<HTMLButtonElement> | undefined;
|
|
44
44
|
onError?: import("react").ReactEventHandler<HTMLButtonElement> | undefined;
|
|
@@ -277,7 +277,7 @@ export declare const useSplitButton: ({ ButtonProps: ButtonPropsProp, PopupMenuP
|
|
|
277
277
|
results?: number | undefined;
|
|
278
278
|
security?: string | undefined;
|
|
279
279
|
unselectable?: "on" | "off" | undefined;
|
|
280
|
-
popover?: "" | "auto" | "manual" |
|
|
280
|
+
popover?: "" | "auto" | "manual" | undefined;
|
|
281
281
|
popoverTargetAction?: "toggle" | "show" | "hide" | undefined;
|
|
282
282
|
popoverTarget?: string | undefined;
|
|
283
283
|
inert?: boolean | undefined;
|