@homebound/beam 2.337.1 → 2.339.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/Css.d.ts
CHANGED
|
@@ -1092,6 +1092,10 @@ declare class CssBuilder<T extends Properties> {
|
|
|
1092
1092
|
flexWrap(value: Properties["flexWrap"]): CssBuilder<T & {
|
|
1093
1093
|
flexWrap: import("csstype").Property.FlexWrap | undefined;
|
|
1094
1094
|
}>;
|
|
1095
|
+
/** Sets `order: value`. */
|
|
1096
|
+
order(value: Properties["order"]): CssBuilder<T & {
|
|
1097
|
+
order: import("csstype").Property.Order | undefined;
|
|
1098
|
+
}>;
|
|
1095
1099
|
/** Sets `float: "left"`. */
|
|
1096
1100
|
get fl(): CssBuilder<T & {
|
|
1097
1101
|
float: import("csstype").Property.Float | undefined;
|
|
@@ -1566,6 +1570,30 @@ declare class CssBuilder<T extends Properties> {
|
|
|
1566
1570
|
objectFit(value: Properties["objectFit"]): CssBuilder<T & {
|
|
1567
1571
|
objectFit: import("csstype").Property.ObjectFit | undefined;
|
|
1568
1572
|
}>;
|
|
1573
|
+
/** Sets `opacity: "0"`. */
|
|
1574
|
+
get o0(): CssBuilder<T & {
|
|
1575
|
+
opacity: import("csstype").Property.Opacity | undefined;
|
|
1576
|
+
}>;
|
|
1577
|
+
/** Sets `opacity: "0.25"`. */
|
|
1578
|
+
get o25(): CssBuilder<T & {
|
|
1579
|
+
opacity: import("csstype").Property.Opacity | undefined;
|
|
1580
|
+
}>;
|
|
1581
|
+
/** Sets `opacity: "0.5"`. */
|
|
1582
|
+
get o50(): CssBuilder<T & {
|
|
1583
|
+
opacity: import("csstype").Property.Opacity | undefined;
|
|
1584
|
+
}>;
|
|
1585
|
+
/** Sets `opacity: "0.75"`. */
|
|
1586
|
+
get o75(): CssBuilder<T & {
|
|
1587
|
+
opacity: import("csstype").Property.Opacity | undefined;
|
|
1588
|
+
}>;
|
|
1589
|
+
/** Sets `opacity: "1"`. */
|
|
1590
|
+
get o100(): CssBuilder<T & {
|
|
1591
|
+
opacity: import("csstype").Property.Opacity | undefined;
|
|
1592
|
+
}>;
|
|
1593
|
+
/** Sets `opacity: value`. */
|
|
1594
|
+
o(value: Properties["opacity"]): CssBuilder<T & {
|
|
1595
|
+
opacity: import("csstype").Property.Opacity | undefined;
|
|
1596
|
+
}>;
|
|
1569
1597
|
/** Sets `outline: "1px solid"`. */
|
|
1570
1598
|
get outline1(): CssBuilder<T & {
|
|
1571
1599
|
outline: import("csstype").Property.Outline<string | 0> | undefined;
|
package/dist/Css.js
CHANGED
|
@@ -1088,6 +1088,10 @@ class CssBuilder {
|
|
|
1088
1088
|
flexWrap(value) {
|
|
1089
1089
|
return this.add("flexWrap", value);
|
|
1090
1090
|
}
|
|
1091
|
+
/** Sets `order: value`. */
|
|
1092
|
+
order(value) {
|
|
1093
|
+
return this.add("order", value);
|
|
1094
|
+
}
|
|
1091
1095
|
// float
|
|
1092
1096
|
/** Sets `float: "left"`. */
|
|
1093
1097
|
get fl() {
|
|
@@ -1518,6 +1522,31 @@ class CssBuilder {
|
|
|
1518
1522
|
objectFit(value) {
|
|
1519
1523
|
return this.add("objectFit", value);
|
|
1520
1524
|
}
|
|
1525
|
+
// opacity
|
|
1526
|
+
/** Sets `opacity: "0"`. */
|
|
1527
|
+
get o0() {
|
|
1528
|
+
return this.add("opacity", "0");
|
|
1529
|
+
}
|
|
1530
|
+
/** Sets `opacity: "0.25"`. */
|
|
1531
|
+
get o25() {
|
|
1532
|
+
return this.add("opacity", "0.25");
|
|
1533
|
+
}
|
|
1534
|
+
/** Sets `opacity: "0.5"`. */
|
|
1535
|
+
get o50() {
|
|
1536
|
+
return this.add("opacity", "0.5");
|
|
1537
|
+
}
|
|
1538
|
+
/** Sets `opacity: "0.75"`. */
|
|
1539
|
+
get o75() {
|
|
1540
|
+
return this.add("opacity", "0.75");
|
|
1541
|
+
}
|
|
1542
|
+
/** Sets `opacity: "1"`. */
|
|
1543
|
+
get o100() {
|
|
1544
|
+
return this.add("opacity", "1");
|
|
1545
|
+
}
|
|
1546
|
+
/** Sets `opacity: value`. */
|
|
1547
|
+
o(value) {
|
|
1548
|
+
return this.add("opacity", value);
|
|
1549
|
+
}
|
|
1521
1550
|
// outline
|
|
1522
1551
|
/** Sets `outline: "1px solid"`. */
|
|
1523
1552
|
get outline1() {
|
|
@@ -52,6 +52,7 @@ export interface ComboBoxBaseProps<O, V extends Value> extends BeamFocusableProp
|
|
|
52
52
|
unsetLabel?: string;
|
|
53
53
|
hideErrorMessage?: boolean;
|
|
54
54
|
multiline?: boolean;
|
|
55
|
+
onSearch?: (search: string) => void;
|
|
55
56
|
}
|
|
56
57
|
/**
|
|
57
58
|
* Provides a non-native select/dropdown widget that allows the user to type to filter the options.
|
|
@@ -13,6 +13,7 @@ const ComboBoxInput_1 = require("./ComboBoxInput");
|
|
|
13
13
|
const ListBox_1 = require("./ListBox");
|
|
14
14
|
const Value_1 = require("../Value");
|
|
15
15
|
const utils_1 = require("../utils");
|
|
16
|
+
const use_debounce_1 = require("use-debounce");
|
|
16
17
|
/**
|
|
17
18
|
* Provides a non-native select/dropdown widget that allows the user to type to filter the options.
|
|
18
19
|
*
|
|
@@ -25,7 +26,7 @@ const utils_1 = require("../utils");
|
|
|
25
26
|
function ComboBoxBase(props) {
|
|
26
27
|
var _a, _b, _c, _d, _e;
|
|
27
28
|
const { fieldProps } = (0, PresentationContext_1.usePresentationContext)();
|
|
28
|
-
const { disabled, readOnly, onSelect, options: propOptions, multiselect = false, values: propValues, nothingSelectedText = "", contrast, disabledOptions, borderless, unsetLabel, getOptionLabel: propOptionLabel, getOptionValue: propOptionValue, getOptionMenuLabel: propOptionMenuLabel, fullWidth = (_a = fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.fullWidth) !== null && _a !== void 0 ? _a : false, ...otherProps } = props;
|
|
29
|
+
const { disabled, readOnly, onSelect, options: propOptions, multiselect = false, values: propValues, nothingSelectedText = "", contrast, disabledOptions, borderless, unsetLabel, getOptionLabel: propOptionLabel, getOptionValue: propOptionValue, getOptionMenuLabel: propOptionMenuLabel, fullWidth = (_a = fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.fullWidth) !== null && _a !== void 0 ? _a : false, onSearch, ...otherProps } = props;
|
|
29
30
|
const labelStyle = (_c = (_b = otherProps.labelStyle) !== null && _b !== void 0 ? _b : fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.labelStyle) !== null && _c !== void 0 ? _c : "above";
|
|
30
31
|
// Memoize the callback functions and handle the `unset` option if provided.
|
|
31
32
|
const getOptionLabel = (0, react_1.useCallback)((o) => (unsetLabel && o === exports.unsetOption ? unsetLabel : propOptionLabel(o)),
|
|
@@ -166,8 +167,11 @@ function ComboBoxBase(props) {
|
|
|
166
167
|
selectedKeys,
|
|
167
168
|
onSelectionChange,
|
|
168
169
|
});
|
|
170
|
+
const [debouncedSearch] = (0, use_debounce_1.useDebounce)(searchValue, 300);
|
|
169
171
|
// Reset inputValue when closed or selected changes
|
|
170
172
|
(0, react_1.useEffect)(() => {
|
|
173
|
+
if (debouncedSearch)
|
|
174
|
+
return;
|
|
171
175
|
if (state.isOpen && multiselect) {
|
|
172
176
|
// While the multiselect is open, let the user keep typing
|
|
173
177
|
setFieldState((prevState) => ({
|
|
@@ -183,7 +187,11 @@ function ComboBoxBase(props) {
|
|
|
183
187
|
inputValue: getInputValue(selectedOptions, getOptionLabel, multiselect, nothingSelectedText, isReadOnly),
|
|
184
188
|
}));
|
|
185
189
|
}
|
|
186
|
-
}, [state.isOpen, selectedOptions, getOptionLabel, multiselect, nothingSelectedText, isReadOnly]);
|
|
190
|
+
}, [state.isOpen, selectedOptions, getOptionLabel, multiselect, nothingSelectedText, isReadOnly, debouncedSearch]);
|
|
191
|
+
// Call on search callback when the user types in the input field
|
|
192
|
+
(0, react_1.useEffect)(() => {
|
|
193
|
+
onSearch === null || onSearch === void 0 ? void 0 : onSearch(debouncedSearch !== null && debouncedSearch !== void 0 ? debouncedSearch : "");
|
|
194
|
+
}, [onSearch, debouncedSearch]);
|
|
187
195
|
// For the most part, the returned props contain `aria-*` and `id` attributes for accessibility purposes.
|
|
188
196
|
const { buttonProps: triggerProps, inputProps, listBoxProps, labelProps, } = (0, react_aria_1.useComboBox)({
|
|
189
197
|
...comboBoxProps,
|