@homebound/beam 2.356.0 → 2.357.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.
|
@@ -14,7 +14,10 @@ exports.multiFilter = multiFilter;
|
|
|
14
14
|
class MultiFilter extends BaseFilter_1.BaseFilter {
|
|
15
15
|
render(value, setValue, tid, inModal, vertical) {
|
|
16
16
|
var _a;
|
|
17
|
-
if (inModal &&
|
|
17
|
+
if (inModal &&
|
|
18
|
+
Array.isArray(this.props.options) &&
|
|
19
|
+
this.props.options.length > 0 &&
|
|
20
|
+
this.props.options.length <= 8) {
|
|
18
21
|
const { disabledOptions } = this.props;
|
|
19
22
|
const disabledOptionsWithReasons = Object.fromEntries((_a = disabledOptions === null || disabledOptions === void 0 ? void 0 : disabledOptions.map(ComboBoxBase_1.disabledOptionToKeyedTuple)) !== null && _a !== void 0 ? _a : []);
|
|
20
23
|
const disabledKeys = Object.keys(disabledOptionsWithReasons);
|
|
@@ -326,6 +326,7 @@ function renderDiv(style, id, columns, visibleDataRows, keptSelectedRows, firstR
|
|
|
326
326
|
function renderTable(style, id, columns, visibleDataRows, keptSelectedRows, firstRowMessage, stickyHeader, xss, _virtuosoRef, tableHeadRows, stickyOffset, _infiniteScroll) {
|
|
327
327
|
return ((0, jsx_runtime_1.jsxs)("table", { css: {
|
|
328
328
|
...Css_1.Css.w100.add("borderCollapse", "separate").add("borderSpacing", "0").$,
|
|
329
|
+
...Css_1.Css.addIn("& tr ", { pageBreakAfter: "auto", pageBreakInside: "avoid" }).$,
|
|
329
330
|
...Css_1.Css.addIn("& > tbody > tr > * ", style.betweenRowsCss || {})
|
|
330
331
|
// removes border between header and second row
|
|
331
332
|
.addIn("& > tbody > tr:first-of-type", style.firstNonHeaderRowCss || {}).$,
|
|
@@ -9,7 +9,6 @@ export interface MultiSelectFieldProps<O, V extends Value> extends Exclude<Combo
|
|
|
9
9
|
getOptionLabel: (opt: O) => string;
|
|
10
10
|
values: V[];
|
|
11
11
|
onSelect: (values: V[], opts: O[]) => void;
|
|
12
|
-
options: O[];
|
|
13
12
|
}
|
|
14
13
|
/**
|
|
15
14
|
* Provides a non-native multiselect/dropdown widget.
|
|
@@ -66,8 +66,8 @@ export interface ComboBoxBaseProps<O, V extends Value> extends BeamFocusableProp
|
|
|
66
66
|
export declare function ComboBoxBase<O, V extends Value>(props: ComboBoxBaseProps<O, V>): JSX.Element;
|
|
67
67
|
/** Allows lazy-loading select fields, which is useful for pages w/lots of fields the user may not actually use. */
|
|
68
68
|
export type OptionsOrLoad<O> = O[] | {
|
|
69
|
-
/** The initial option to show before the user interacts with the dropdown. */
|
|
70
|
-
current: O | undefined;
|
|
69
|
+
/** The initial option(s) to show before the user interacts with the dropdown. */
|
|
70
|
+
current: O | O[] | undefined;
|
|
71
71
|
/** Fired when the user interacts with the dropdown, to load the real options. */
|
|
72
72
|
load: () => Promise<unknown>;
|
|
73
73
|
/** The full list of options, after load() has been fired. */
|
|
@@ -256,13 +256,16 @@ function initializeOptions(optionsOrLoad, getOptionValue, unsetLabel) {
|
|
|
256
256
|
if (options) {
|
|
257
257
|
opts.push(...options);
|
|
258
258
|
}
|
|
259
|
-
//
|
|
259
|
+
// Add the `current` to the list of options in the event it is not already there.
|
|
260
260
|
if (current) {
|
|
261
|
-
const
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
261
|
+
const toCheck = Array.isArray(current) ? current : [current];
|
|
262
|
+
toCheck.forEach((current) => {
|
|
263
|
+
const value = getOptionValue(current);
|
|
264
|
+
const found = options && options.find((o) => getOptionValue(o) === value);
|
|
265
|
+
if (!found) {
|
|
266
|
+
opts.push(current);
|
|
267
|
+
}
|
|
268
|
+
});
|
|
266
269
|
}
|
|
267
270
|
}
|
|
268
271
|
return opts;
|