@homebound/beam 2.409.0 → 2.410.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/index.cjs +247 -244
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.js +176 -173
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -14071,8 +14071,8 @@ var variantStyles2 = {
|
|
|
14071
14071
|
};
|
|
14072
14072
|
|
|
14073
14073
|
// src/components/BeamContext.tsx
|
|
14074
|
-
var
|
|
14075
|
-
var
|
|
14074
|
+
var import_react100 = require("react");
|
|
14075
|
+
var import_react_aria46 = require("react-aria");
|
|
14076
14076
|
|
|
14077
14077
|
// src/components/Modal/Modal.tsx
|
|
14078
14078
|
var import_utils71 = require("@react-aria/utils");
|
|
@@ -15977,19 +15977,68 @@ function FullBleed({ children, omitPadding = false }) {
|
|
|
15977
15977
|
}
|
|
15978
15978
|
|
|
15979
15979
|
// src/components/Layout/GridTableLayout/GridTableLayout.tsx
|
|
15980
|
-
var
|
|
15980
|
+
var import_react97 = __toESM(require("react"), 1);
|
|
15981
15981
|
|
|
15982
|
-
// src/components/
|
|
15983
|
-
var
|
|
15982
|
+
// src/components/ButtonMenu.tsx
|
|
15983
|
+
var import_react90 = require("react");
|
|
15984
15984
|
var import_react_aria44 = require("react-aria");
|
|
15985
|
+
var import_react_stately17 = require("react-stately");
|
|
15986
|
+
var import_jsx_runtime125 = require("@emotion/react/jsx-runtime");
|
|
15987
|
+
function ButtonMenu(props) {
|
|
15988
|
+
const { defaultOpen, disabled, items, persistentItems, trigger, searchable, contrast = false } = props;
|
|
15989
|
+
let selectedItem, onChange;
|
|
15990
|
+
if (isSelectionButtonMenuProps(props)) {
|
|
15991
|
+
selectedItem = props.selectedItem;
|
|
15992
|
+
onChange = props.onChange;
|
|
15993
|
+
}
|
|
15994
|
+
const state = (0, import_react_stately17.useMenuTriggerState)({ isOpen: defaultOpen });
|
|
15995
|
+
const buttonRef = (0, import_react90.useRef)(null);
|
|
15996
|
+
const { menuTriggerProps, menuProps } = (0, import_react_aria44.useMenuTrigger)({ isDisabled: !!disabled }, state, buttonRef);
|
|
15997
|
+
const tid = useTestIds(
|
|
15998
|
+
props,
|
|
15999
|
+
isTextButton(trigger) ? labelOr(trigger, "buttonMenu") : isNavLinkButton(trigger) ? defaultTestId(trigger.navLabel) : isIconButton(trigger) ? trigger.icon : trigger.name
|
|
16000
|
+
);
|
|
16001
|
+
return /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
16002
|
+
OverlayTrigger,
|
|
16003
|
+
{
|
|
16004
|
+
...props,
|
|
16005
|
+
menuTriggerProps,
|
|
16006
|
+
state,
|
|
16007
|
+
buttonRef,
|
|
16008
|
+
...tid,
|
|
16009
|
+
contrast,
|
|
16010
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
16011
|
+
Menu,
|
|
16012
|
+
{
|
|
16013
|
+
ariaMenuProps: menuProps,
|
|
16014
|
+
onClose: () => state.close(),
|
|
16015
|
+
items,
|
|
16016
|
+
persistentItems,
|
|
16017
|
+
searchable,
|
|
16018
|
+
contrast,
|
|
16019
|
+
selectedItem,
|
|
16020
|
+
onChange,
|
|
16021
|
+
...tid
|
|
16022
|
+
}
|
|
16023
|
+
)
|
|
16024
|
+
}
|
|
16025
|
+
);
|
|
16026
|
+
}
|
|
16027
|
+
function isSelectionButtonMenuProps(props) {
|
|
16028
|
+
return typeof props === "object" && "selectedItem" in props && "onChange" in props;
|
|
16029
|
+
}
|
|
16030
|
+
|
|
16031
|
+
// src/components/Filters/FilterDropdownMenu.tsx
|
|
16032
|
+
var import_react94 = require("react");
|
|
16033
|
+
var import_react_aria45 = require("react-aria");
|
|
15985
16034
|
|
|
15986
16035
|
// src/components/CountBadge.tsx
|
|
15987
|
-
var
|
|
16036
|
+
var import_jsx_runtime126 = require("@emotion/react/jsx-runtime");
|
|
15988
16037
|
function CountBadge(props) {
|
|
15989
16038
|
const { count, bgColor = "rgba(29, 78, 216, 1)" /* Blue700 */, color = "rgba(255,255,255,1)" /* White */, hideIfZero = false, ...otherProps } = props;
|
|
15990
16039
|
const tid = useTestIds(otherProps, "countBadge");
|
|
15991
16040
|
if (hideIfZero && count === 0) return null;
|
|
15992
|
-
return /* @__PURE__ */ (0,
|
|
16041
|
+
return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
15993
16042
|
"span",
|
|
15994
16043
|
{
|
|
15995
16044
|
...tid,
|
|
@@ -16022,7 +16071,7 @@ var BaseFilter = class {
|
|
|
16022
16071
|
};
|
|
16023
16072
|
|
|
16024
16073
|
// src/components/Filters/DateFilter.tsx
|
|
16025
|
-
var
|
|
16074
|
+
var import_jsx_runtime127 = require("@emotion/react/jsx-runtime");
|
|
16026
16075
|
function dateFilter(props) {
|
|
16027
16076
|
return (key) => new DateFilter(key, props);
|
|
16028
16077
|
}
|
|
@@ -16030,10 +16079,10 @@ var anyOption = {};
|
|
|
16030
16079
|
var DateFilter = class extends BaseFilter {
|
|
16031
16080
|
render(value, setValue, tid, inModal, vertical) {
|
|
16032
16081
|
const { label, operations, getOperationValue, getOperationLabel } = this.props;
|
|
16033
|
-
return /* @__PURE__ */ (0,
|
|
16034
|
-
vertical && /* @__PURE__ */ (0,
|
|
16035
|
-
/* @__PURE__ */ (0,
|
|
16036
|
-
/* @__PURE__ */ (0,
|
|
16082
|
+
return /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(import_jsx_runtime127.Fragment, { children: [
|
|
16083
|
+
vertical && /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(Label, { label }),
|
|
16084
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(CompoundField, { children: [
|
|
16085
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
16037
16086
|
SelectField,
|
|
16038
16087
|
{
|
|
16039
16088
|
compact: true,
|
|
@@ -16056,7 +16105,7 @@ var DateFilter = class extends BaseFilter {
|
|
|
16056
16105
|
...tid[`${defaultTestId(this.label)}_dateOperation`]
|
|
16057
16106
|
}
|
|
16058
16107
|
),
|
|
16059
|
-
/* @__PURE__ */ (0,
|
|
16108
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
16060
16109
|
DateField,
|
|
16061
16110
|
{
|
|
16062
16111
|
compact: true,
|
|
@@ -16074,16 +16123,16 @@ var DateFilter = class extends BaseFilter {
|
|
|
16074
16123
|
};
|
|
16075
16124
|
|
|
16076
16125
|
// src/components/Filters/DateRangeFilter.tsx
|
|
16077
|
-
var
|
|
16126
|
+
var import_jsx_runtime128 = require("@emotion/react/jsx-runtime");
|
|
16078
16127
|
function dateRangeFilter(props) {
|
|
16079
16128
|
return (key) => new DateRangeFilter(key, props);
|
|
16080
16129
|
}
|
|
16081
16130
|
var DateRangeFilter = class extends BaseFilter {
|
|
16082
16131
|
render(value, setValue, tid, inModal, vertical) {
|
|
16083
16132
|
const { label, placeholderText, disabledDays, testFieldLabel, defaultValue } = this.props;
|
|
16084
|
-
return /* @__PURE__ */ (0,
|
|
16085
|
-
vertical && /* @__PURE__ */ (0,
|
|
16086
|
-
/* @__PURE__ */ (0,
|
|
16133
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(import_jsx_runtime128.Fragment, { children: [
|
|
16134
|
+
vertical && /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(Label, { label }),
|
|
16135
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
16087
16136
|
DateRangeField,
|
|
16088
16137
|
{
|
|
16089
16138
|
compact: true,
|
|
@@ -16102,7 +16151,7 @@ var DateRangeFilter = class extends BaseFilter {
|
|
|
16102
16151
|
};
|
|
16103
16152
|
|
|
16104
16153
|
// src/components/Filters/MultiFilter.tsx
|
|
16105
|
-
var
|
|
16154
|
+
var import_jsx_runtime129 = require("@emotion/react/jsx-runtime");
|
|
16106
16155
|
function multiFilter(props) {
|
|
16107
16156
|
return (key) => new MultiFilter(key, props);
|
|
16108
16157
|
}
|
|
@@ -16112,7 +16161,7 @@ var MultiFilter = class extends BaseFilter {
|
|
|
16112
16161
|
const { disabledOptions } = this.props;
|
|
16113
16162
|
const disabledOptionsWithReasons = Object.fromEntries(disabledOptions?.map(disabledOptionToKeyedTuple) ?? []);
|
|
16114
16163
|
const disabledKeys = Object.keys(disabledOptionsWithReasons);
|
|
16115
|
-
return /* @__PURE__ */ (0,
|
|
16164
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
16116
16165
|
ToggleChipGroup,
|
|
16117
16166
|
{
|
|
16118
16167
|
label: this.label,
|
|
@@ -16136,7 +16185,7 @@ var MultiFilter = class extends BaseFilter {
|
|
|
16136
16185
|
);
|
|
16137
16186
|
}
|
|
16138
16187
|
const { defaultValue, nothingSelectedText, ...props } = this.props;
|
|
16139
|
-
return /* @__PURE__ */ (0,
|
|
16188
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
16140
16189
|
MultiSelectField,
|
|
16141
16190
|
{
|
|
16142
16191
|
...props,
|
|
@@ -16156,7 +16205,7 @@ var MultiFilter = class extends BaseFilter {
|
|
|
16156
16205
|
};
|
|
16157
16206
|
|
|
16158
16207
|
// src/components/Filters/NumberRangeFilter.tsx
|
|
16159
|
-
var
|
|
16208
|
+
var import_jsx_runtime130 = require("@emotion/react/jsx-runtime");
|
|
16160
16209
|
function numberRangeFilter(props) {
|
|
16161
16210
|
return (key) => new NumberRangeFilter(key, props);
|
|
16162
16211
|
}
|
|
@@ -16165,10 +16214,10 @@ var NumberRangeFilter = class extends BaseFilter {
|
|
|
16165
16214
|
const { label, numberFieldType, numberFormatOptions } = this.props;
|
|
16166
16215
|
const min = value?.min ?? void 0;
|
|
16167
16216
|
const max = value?.max ?? void 0;
|
|
16168
|
-
return /* @__PURE__ */ (0,
|
|
16169
|
-
vertical && /* @__PURE__ */ (0,
|
|
16170
|
-
/* @__PURE__ */ (0,
|
|
16171
|
-
/* @__PURE__ */ (0,
|
|
16217
|
+
return /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(import_jsx_runtime130.Fragment, { children: [
|
|
16218
|
+
vertical && /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { ...tid, children: [
|
|
16219
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(Label, { label }),
|
|
16220
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { css: Css.pb1.$, children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
16172
16221
|
NumberField,
|
|
16173
16222
|
{
|
|
16174
16223
|
labelStyle: "inline",
|
|
@@ -16184,7 +16233,7 @@ var NumberRangeFilter = class extends BaseFilter {
|
|
|
16184
16233
|
...tid[`${defaultTestId(label)}_min_vertical`]
|
|
16185
16234
|
}
|
|
16186
16235
|
) }),
|
|
16187
|
-
/* @__PURE__ */ (0,
|
|
16236
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
16188
16237
|
NumberField,
|
|
16189
16238
|
{
|
|
16190
16239
|
labelStyle: "inline",
|
|
@@ -16201,8 +16250,8 @@ var NumberRangeFilter = class extends BaseFilter {
|
|
|
16201
16250
|
}
|
|
16202
16251
|
)
|
|
16203
16252
|
] }),
|
|
16204
|
-
!vertical && /* @__PURE__ */ (0,
|
|
16205
|
-
/* @__PURE__ */ (0,
|
|
16253
|
+
!vertical && /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(CompoundField, { ...tid, children: [
|
|
16254
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
16206
16255
|
NumberField,
|
|
16207
16256
|
{
|
|
16208
16257
|
compact: true,
|
|
@@ -16220,7 +16269,7 @@ var NumberRangeFilter = class extends BaseFilter {
|
|
|
16220
16269
|
...tid[`${defaultTestId(label)}_min`]
|
|
16221
16270
|
}
|
|
16222
16271
|
),
|
|
16223
|
-
/* @__PURE__ */ (0,
|
|
16272
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
16224
16273
|
NumberField,
|
|
16225
16274
|
{
|
|
16226
16275
|
compact: true,
|
|
@@ -16244,7 +16293,7 @@ var NumberRangeFilter = class extends BaseFilter {
|
|
|
16244
16293
|
};
|
|
16245
16294
|
|
|
16246
16295
|
// src/components/Filters/SingleFilter.tsx
|
|
16247
|
-
var
|
|
16296
|
+
var import_jsx_runtime131 = require("@emotion/react/jsx-runtime");
|
|
16248
16297
|
function singleFilter(props) {
|
|
16249
16298
|
return (key) => new SingleFilter(key, props);
|
|
16250
16299
|
}
|
|
@@ -16261,7 +16310,7 @@ var SingleFilter = class extends BaseFilter {
|
|
|
16261
16310
|
...props
|
|
16262
16311
|
} = this.props;
|
|
16263
16312
|
const options = Array.isArray(maybeOptions) ? [allOption, ...maybeOptions] : { ...maybeOptions, current: maybeOptions.current };
|
|
16264
|
-
return /* @__PURE__ */ (0,
|
|
16313
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
16265
16314
|
SelectField,
|
|
16266
16315
|
{
|
|
16267
16316
|
...props,
|
|
@@ -16282,14 +16331,14 @@ var SingleFilter = class extends BaseFilter {
|
|
|
16282
16331
|
};
|
|
16283
16332
|
|
|
16284
16333
|
// src/components/Filters/TreeFilter.tsx
|
|
16285
|
-
var
|
|
16334
|
+
var import_jsx_runtime132 = require("@emotion/react/jsx-runtime");
|
|
16286
16335
|
function treeFilter(props) {
|
|
16287
16336
|
return (key) => new TreeFilter(key, props);
|
|
16288
16337
|
}
|
|
16289
16338
|
var TreeFilter = class extends BaseFilter {
|
|
16290
16339
|
render(value, setValue, tid, inModal, vertical) {
|
|
16291
16340
|
const { defaultValue, nothingSelectedText, filterBy = "root", ...props } = this.props;
|
|
16292
|
-
return /* @__PURE__ */ (0,
|
|
16341
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
16293
16342
|
TreeSelectField,
|
|
16294
16343
|
{
|
|
16295
16344
|
...props,
|
|
@@ -16310,14 +16359,14 @@ var TreeFilter = class extends BaseFilter {
|
|
|
16310
16359
|
};
|
|
16311
16360
|
|
|
16312
16361
|
// src/components/Filters/BooleanFilter.tsx
|
|
16313
|
-
var
|
|
16362
|
+
var import_jsx_runtime133 = require("@emotion/react/jsx-runtime");
|
|
16314
16363
|
function booleanFilter(props) {
|
|
16315
16364
|
return (key) => new BooleanFilter(key, props);
|
|
16316
16365
|
}
|
|
16317
16366
|
var BooleanFilter = class extends BaseFilter {
|
|
16318
16367
|
render(value, setValue, tid, inModal, vertical) {
|
|
16319
16368
|
const { options = defaultBooleanOptions, label, defaultValue, ...props } = this.props;
|
|
16320
|
-
return /* @__PURE__ */ (0,
|
|
16369
|
+
return /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
16321
16370
|
SelectField,
|
|
16322
16371
|
{
|
|
16323
16372
|
...props,
|
|
@@ -16345,7 +16394,7 @@ var defaultBooleanOptions = [
|
|
|
16345
16394
|
];
|
|
16346
16395
|
|
|
16347
16396
|
// src/components/Filters/CheckboxFilter.tsx
|
|
16348
|
-
var
|
|
16397
|
+
var import_jsx_runtime134 = require("@emotion/react/jsx-runtime");
|
|
16349
16398
|
function checkboxFilter(props) {
|
|
16350
16399
|
return (key) => new CheckboxFilter(key, {
|
|
16351
16400
|
// If the user has set the offValue, that should be the default b/c we're only a two-state
|
|
@@ -16356,7 +16405,7 @@ function checkboxFilter(props) {
|
|
|
16356
16405
|
var CheckboxFilter = class extends BaseFilter {
|
|
16357
16406
|
render(value, setValue, tid, inModal, vertical) {
|
|
16358
16407
|
const { defaultValue, onValue = true, offValue = void 0, ...props } = this.props;
|
|
16359
|
-
return /* @__PURE__ */ (0,
|
|
16408
|
+
return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
16360
16409
|
Checkbox,
|
|
16361
16410
|
{
|
|
16362
16411
|
...props,
|
|
@@ -16375,44 +16424,44 @@ var CheckboxFilter = class extends BaseFilter {
|
|
|
16375
16424
|
};
|
|
16376
16425
|
|
|
16377
16426
|
// src/components/Filters/FilterModal.tsx
|
|
16378
|
-
var
|
|
16427
|
+
var import_react92 = require("react");
|
|
16379
16428
|
|
|
16380
16429
|
// src/components/Modal/OpenModal.tsx
|
|
16381
|
-
var
|
|
16382
|
-
var
|
|
16430
|
+
var import_react91 = require("react");
|
|
16431
|
+
var import_jsx_runtime135 = require("@emotion/react/jsx-runtime");
|
|
16383
16432
|
function OpenModal(props) {
|
|
16384
16433
|
const { openModal } = useModal();
|
|
16385
16434
|
const { size, children, keepOpen } = props;
|
|
16386
|
-
(0,
|
|
16435
|
+
(0, import_react91.useEffect)(() => {
|
|
16387
16436
|
if (!keepOpen) {
|
|
16388
16437
|
openModal({ size, content: children });
|
|
16389
16438
|
}
|
|
16390
16439
|
}, [keepOpen, openModal, size, children]);
|
|
16391
16440
|
if (keepOpen) {
|
|
16392
|
-
return /* @__PURE__ */ (0,
|
|
16441
|
+
return /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(Modal, { size, content: children });
|
|
16393
16442
|
} else {
|
|
16394
|
-
return /* @__PURE__ */ (0,
|
|
16443
|
+
return /* @__PURE__ */ (0, import_jsx_runtime135.jsx)("div", { children: "dummy content" });
|
|
16395
16444
|
}
|
|
16396
16445
|
}
|
|
16397
16446
|
|
|
16398
16447
|
// src/components/Filters/FilterModal.tsx
|
|
16399
|
-
var
|
|
16448
|
+
var import_jsx_runtime136 = require("@emotion/react/jsx-runtime");
|
|
16400
16449
|
function FilterModal(props) {
|
|
16401
16450
|
const { filter, filters, onApply } = props;
|
|
16402
16451
|
const testId = useTestIds(props, filterTestIdPrefix);
|
|
16403
16452
|
const { closeModal } = useModal();
|
|
16404
|
-
const [modalFilter, setModalFilter] = (0,
|
|
16405
|
-
return /* @__PURE__ */ (0,
|
|
16406
|
-
/* @__PURE__ */ (0,
|
|
16407
|
-
/* @__PURE__ */ (0,
|
|
16453
|
+
const [modalFilter, setModalFilter] = (0, import_react92.useState)(filter);
|
|
16454
|
+
return /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(import_jsx_runtime136.Fragment, { children: [
|
|
16455
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(ModalHeader, { children: "More Filters" }),
|
|
16456
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(ModalBody, { children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("div", { css: Css.df.fdc.$, children: safeEntries(filters).map(([key, f]) => /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(ModalFilterItem, { label: f.hideLabelInModal ? void 0 : f.label, children: f.render(
|
|
16408
16457
|
modalFilter[key],
|
|
16409
16458
|
(value) => setModalFilter(updateFilter(modalFilter, key, value)),
|
|
16410
16459
|
testId,
|
|
16411
16460
|
true,
|
|
16412
16461
|
false
|
|
16413
16462
|
) }, key)) }) }),
|
|
16414
|
-
/* @__PURE__ */ (0,
|
|
16415
|
-
/* @__PURE__ */ (0,
|
|
16463
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(ModalFooter, { xss: Css.jcsb.$, children: [
|
|
16464
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
16416
16465
|
Button,
|
|
16417
16466
|
{
|
|
16418
16467
|
label: "Clear",
|
|
@@ -16425,9 +16474,9 @@ function FilterModal(props) {
|
|
|
16425
16474
|
...testId.modalClear
|
|
16426
16475
|
}
|
|
16427
16476
|
),
|
|
16428
|
-
/* @__PURE__ */ (0,
|
|
16429
|
-
/* @__PURE__ */ (0,
|
|
16430
|
-
/* @__PURE__ */ (0,
|
|
16477
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsxs)("div", { css: Css.df.gap1.$, children: [
|
|
16478
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(Button, { label: "Cancel", variant: "quaternary", onClick: closeModal, ...testId.modalClose }),
|
|
16479
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
16431
16480
|
Button,
|
|
16432
16481
|
{
|
|
16433
16482
|
label: "Apply",
|
|
@@ -16443,20 +16492,20 @@ function FilterModal(props) {
|
|
|
16443
16492
|
] });
|
|
16444
16493
|
}
|
|
16445
16494
|
function ModalFilterItem({ label, children }) {
|
|
16446
|
-
return /* @__PURE__ */ (0,
|
|
16447
|
-
label && /* @__PURE__ */ (0,
|
|
16448
|
-
/* @__PURE__ */ (0,
|
|
16495
|
+
return /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)("div", { css: Css.mb4.if(!label).bt.bcGray200.$, children: [
|
|
16496
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("h2", { css: Css.md.mb2.$, children: label }),
|
|
16497
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)("div", { css: Css.if(!label).pt3.$, children })
|
|
16449
16498
|
] });
|
|
16450
16499
|
}
|
|
16451
16500
|
|
|
16452
16501
|
// src/components/Filters/Filters.tsx
|
|
16453
|
-
var
|
|
16454
|
-
var
|
|
16502
|
+
var import_react93 = require("react");
|
|
16503
|
+
var import_jsx_runtime137 = require("@emotion/react/jsx-runtime");
|
|
16455
16504
|
function Filters(props) {
|
|
16456
16505
|
const { filter, onChange, filterDefs, groupBy, vertical = false, numberOfInlineFilters = groupBy ? 3 : 4 } = props;
|
|
16457
16506
|
const testId = useTestIds(props, filterTestIdPrefix);
|
|
16458
16507
|
const { openModal } = useModal();
|
|
16459
|
-
const [pageFilters, modalFilters] = (0,
|
|
16508
|
+
const [pageFilters, modalFilters] = (0, import_react93.useMemo)(() => {
|
|
16460
16509
|
const impls = safeEntries(filterDefs).map(([key, fn]) => [key, fn(key)]);
|
|
16461
16510
|
if (!vertical && impls.length > numberOfInlineFilters) {
|
|
16462
16511
|
return [
|
|
@@ -16467,7 +16516,7 @@ function Filters(props) {
|
|
|
16467
16516
|
return [Object.fromEntries(impls), {}];
|
|
16468
16517
|
}, [numberOfInlineFilters, vertical, filterDefs]);
|
|
16469
16518
|
const numModalFilters = safeKeys(modalFilters).filter((fk) => filter[fk] !== void 0).length;
|
|
16470
|
-
const maybeGroupByField = groupBy ? /* @__PURE__ */ (0,
|
|
16519
|
+
const maybeGroupByField = groupBy ? /* @__PURE__ */ (0, import_jsx_runtime137.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(
|
|
16471
16520
|
SelectField,
|
|
16472
16521
|
{
|
|
16473
16522
|
label: "Group by",
|
|
@@ -16481,7 +16530,7 @@ function Filters(props) {
|
|
|
16481
16530
|
onSelect: (g) => g && groupBy.setValue(g)
|
|
16482
16531
|
}
|
|
16483
16532
|
) }) : null;
|
|
16484
|
-
return /* @__PURE__ */ (0,
|
|
16533
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(
|
|
16485
16534
|
"div",
|
|
16486
16535
|
{
|
|
16487
16536
|
css: {
|
|
@@ -16490,29 +16539,29 @@ function Filters(props) {
|
|
|
16490
16539
|
...testId,
|
|
16491
16540
|
children: [
|
|
16492
16541
|
maybeGroupByField,
|
|
16493
|
-
safeEntries(pageFilters).map(([key, f]) => /* @__PURE__ */ (0,
|
|
16494
|
-
Object.keys(modalFilters).length > 0 && /* @__PURE__ */ (0,
|
|
16542
|
+
safeEntries(pageFilters).map(([key, f]) => /* @__PURE__ */ (0, import_jsx_runtime137.jsx)("div", { children: f.render(filter[key], (value) => onChange(updateFilter(filter, key, value)), testId, false, vertical) }, key)),
|
|
16543
|
+
Object.keys(modalFilters).length > 0 && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(
|
|
16495
16544
|
Button,
|
|
16496
16545
|
{
|
|
16497
16546
|
label: "More Filters",
|
|
16498
|
-
endAdornment: /* @__PURE__ */ (0,
|
|
16547
|
+
endAdornment: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(CountBadge, { count: numModalFilters, hideIfZero: true }),
|
|
16499
16548
|
variant: "secondary",
|
|
16500
16549
|
onClick: () => openModal({
|
|
16501
16550
|
// Spreading `props` to pass along `data-testid`
|
|
16502
|
-
content: /* @__PURE__ */ (0,
|
|
16551
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(FilterModal, { ...props, filter, onApply: onChange, filters: modalFilters })
|
|
16503
16552
|
}),
|
|
16504
16553
|
...testId.moreFiltersBtn
|
|
16505
16554
|
}
|
|
16506
16555
|
),
|
|
16507
|
-
Object.keys(filter).length > 0 && /* @__PURE__ */ (0,
|
|
16556
|
+
Object.keys(filter).length > 0 && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(Button, { label: "Clear", variant: "tertiary", onClick: () => onChange({}), ...testId.clearBtn }) })
|
|
16508
16557
|
]
|
|
16509
16558
|
}
|
|
16510
16559
|
);
|
|
16511
16560
|
}
|
|
16512
|
-
var _Filters = (0,
|
|
16561
|
+
var _Filters = (0, import_react93.memo)(Filters);
|
|
16513
16562
|
|
|
16514
16563
|
// src/components/Filters/ToggleFilter.tsx
|
|
16515
|
-
var
|
|
16564
|
+
var import_jsx_runtime138 = require("@emotion/react/jsx-runtime");
|
|
16516
16565
|
function toggleFilter(props) {
|
|
16517
16566
|
return (key) => new ToggleFilter(key, {
|
|
16518
16567
|
// If the user has set the offValue, that should be the default b/c we're only a two-state
|
|
@@ -16523,7 +16572,7 @@ function toggleFilter(props) {
|
|
|
16523
16572
|
var ToggleFilter = class extends BaseFilter {
|
|
16524
16573
|
render(value, setValue, tid, inModal, vertical) {
|
|
16525
16574
|
const { defaultValue, onValue = true, offValue = void 0, ...props } = this.props;
|
|
16526
|
-
return /* @__PURE__ */ (0,
|
|
16575
|
+
return /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(
|
|
16527
16576
|
Switch,
|
|
16528
16577
|
{
|
|
16529
16578
|
...props,
|
|
@@ -16553,14 +16602,14 @@ function updateFilter(currentFilter, key, value) {
|
|
|
16553
16602
|
var filterTestIdPrefix = "filter";
|
|
16554
16603
|
|
|
16555
16604
|
// src/components/Filters/FilterDropdownMenu.tsx
|
|
16556
|
-
var
|
|
16605
|
+
var import_jsx_runtime139 = require("@emotion/react/jsx-runtime");
|
|
16557
16606
|
function FilterDropdownMenu(props) {
|
|
16558
16607
|
const { filter, onChange, filterDefs, groupBy } = props;
|
|
16559
16608
|
const testId = useTestIds(props, filterTestIdPrefix);
|
|
16560
|
-
const [isOpen, setIsOpen] = (0,
|
|
16561
|
-
const buttonRef = (0,
|
|
16562
|
-
const filterContentRef = (0,
|
|
16563
|
-
const { overlayProps } = (0,
|
|
16609
|
+
const [isOpen, setIsOpen] = (0, import_react94.useState)(false);
|
|
16610
|
+
const buttonRef = (0, import_react94.useRef)(null);
|
|
16611
|
+
const filterContentRef = (0, import_react94.useRef)(null);
|
|
16612
|
+
const { overlayProps } = (0, import_react_aria45.useOverlay)(
|
|
16564
16613
|
{
|
|
16565
16614
|
isOpen,
|
|
16566
16615
|
onClose: () => setIsOpen(false),
|
|
@@ -16572,32 +16621,32 @@ function FilterDropdownMenu(props) {
|
|
|
16572
16621
|
},
|
|
16573
16622
|
filterContentRef
|
|
16574
16623
|
);
|
|
16575
|
-
const activeFilterCount = (0,
|
|
16576
|
-
const filterImpls = (0,
|
|
16624
|
+
const activeFilterCount = (0, import_react94.useMemo)(() => getActiveFilterCount(filter), [filter]);
|
|
16625
|
+
const filterImpls = (0, import_react94.useMemo)(() => buildFilterImpls(filterDefs), [filterDefs]);
|
|
16577
16626
|
const renderFilters = () => {
|
|
16578
16627
|
const entries = safeEntries(filterImpls);
|
|
16579
16628
|
const nonCheckbox = entries.filter(([_, f]) => !f.hideLabelInModal);
|
|
16580
16629
|
const checkbox = entries.filter(([_, f]) => f.hideLabelInModal);
|
|
16581
|
-
return [...nonCheckbox, ...checkbox].map(([key, f]) => /* @__PURE__ */ (0,
|
|
16630
|
+
return [...nonCheckbox, ...checkbox].map(([key, f]) => /* @__PURE__ */ (0, import_jsx_runtime139.jsx)("div", { children: f.render(filter[key], (value) => onChange(updateFilter(filter, key, value)), testId, false, false) }, key));
|
|
16582
16631
|
};
|
|
16583
|
-
return /* @__PURE__ */ (0,
|
|
16584
|
-
/* @__PURE__ */ (0,
|
|
16632
|
+
return /* @__PURE__ */ (0, import_jsx_runtime139.jsxs)(import_jsx_runtime139.Fragment, { children: [
|
|
16633
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)("div", { ref: buttonRef, children: /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
16585
16634
|
Button,
|
|
16586
16635
|
{
|
|
16587
16636
|
label: "Filter",
|
|
16588
16637
|
icon: "filter",
|
|
16589
16638
|
size: "md",
|
|
16590
|
-
endAdornment: /* @__PURE__ */ (0,
|
|
16591
|
-
activeFilterCount > 0 && /* @__PURE__ */ (0,
|
|
16592
|
-
/* @__PURE__ */ (0,
|
|
16639
|
+
endAdornment: /* @__PURE__ */ (0, import_jsx_runtime139.jsxs)("div", { css: Css.df.aic.gap1.$, children: [
|
|
16640
|
+
activeFilterCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(CountBadge, { count: activeFilterCount }),
|
|
16641
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(Icon, { icon: isOpen ? "chevronUp" : "chevronDown" })
|
|
16593
16642
|
] }),
|
|
16594
16643
|
variant: "secondaryBlack",
|
|
16595
16644
|
onClick: () => setIsOpen(!isOpen),
|
|
16596
16645
|
...testId.button
|
|
16597
16646
|
}
|
|
16598
16647
|
) }),
|
|
16599
|
-
isOpen && /* @__PURE__ */ (0,
|
|
16600
|
-
groupBy && /* @__PURE__ */ (0,
|
|
16648
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime139.jsxs)("div", { ref: filterContentRef, ...overlayProps, css: Css.df.aic.fww.gap1.order(1).$, children: [
|
|
16649
|
+
groupBy && /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
16601
16650
|
SelectField,
|
|
16602
16651
|
{
|
|
16603
16652
|
label: "Group by",
|
|
@@ -16612,9 +16661,9 @@ function FilterDropdownMenu(props) {
|
|
|
16612
16661
|
}
|
|
16613
16662
|
),
|
|
16614
16663
|
renderFilters(),
|
|
16615
|
-
activeFilterCount > 0 && /* @__PURE__ */ (0,
|
|
16664
|
+
activeFilterCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(Button, { label: "Clear", variant: "tertiary", onClick: () => onChange({}), ...testId.clearBtn })
|
|
16616
16665
|
] }),
|
|
16617
|
-
!isOpen && /* @__PURE__ */ (0,
|
|
16666
|
+
!isOpen && /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
16618
16667
|
FilterChips,
|
|
16619
16668
|
{
|
|
16620
16669
|
filter,
|
|
@@ -16640,7 +16689,7 @@ function FilterChips({
|
|
|
16640
16689
|
return value.map((item) => {
|
|
16641
16690
|
const chipKey = `${String(key)}_${item}`;
|
|
16642
16691
|
const newArray = value.filter((v) => v !== item);
|
|
16643
|
-
return /* @__PURE__ */ (0,
|
|
16692
|
+
return /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
16644
16693
|
ToggleChip,
|
|
16645
16694
|
{
|
|
16646
16695
|
text: titleCase(String(item)),
|
|
@@ -16651,7 +16700,7 @@ function FilterChips({
|
|
|
16651
16700
|
);
|
|
16652
16701
|
});
|
|
16653
16702
|
}
|
|
16654
|
-
return /* @__PURE__ */ (0,
|
|
16703
|
+
return /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
16655
16704
|
ToggleChip,
|
|
16656
16705
|
{
|
|
16657
16706
|
text: titleCase(String(value)),
|
|
@@ -16662,9 +16711,9 @@ function FilterChips({
|
|
|
16662
16711
|
);
|
|
16663
16712
|
});
|
|
16664
16713
|
if (chips.length === 0) return null;
|
|
16665
|
-
return /* @__PURE__ */ (0,
|
|
16714
|
+
return /* @__PURE__ */ (0, import_jsx_runtime139.jsxs)("div", { css: Css.df.gap1.fww.aic.order(1).$, children: [
|
|
16666
16715
|
chips,
|
|
16667
|
-
/* @__PURE__ */ (0,
|
|
16716
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(Button, { label: "Clear", variant: "tertiary", onClick: onClear, ...testId.clearBtn })
|
|
16668
16717
|
] });
|
|
16669
16718
|
}
|
|
16670
16719
|
function buildFilterImpls(filterDefs) {
|
|
@@ -16676,14 +16725,14 @@ function titleCase(str) {
|
|
|
16676
16725
|
function getActiveFilterCount(filter) {
|
|
16677
16726
|
return safeKeys(filter).filter((key) => filter[key] !== void 0).length;
|
|
16678
16727
|
}
|
|
16679
|
-
var _FilterDropdownMenu = (0,
|
|
16728
|
+
var _FilterDropdownMenu = (0, import_react94.memo)(FilterDropdownMenu);
|
|
16680
16729
|
|
|
16681
16730
|
// src/components/Table/TableActions.tsx
|
|
16682
|
-
var
|
|
16731
|
+
var import_jsx_runtime140 = require("@emotion/react/jsx-runtime");
|
|
16683
16732
|
function TableActions(props) {
|
|
16684
16733
|
const { xss, children, right } = props;
|
|
16685
|
-
return /* @__PURE__ */ (0,
|
|
16686
|
-
/* @__PURE__ */ (0,
|
|
16734
|
+
return /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("div", { css: { ...Css.df.gap1.aic.jcsb.aifs.pb2.$, ...xss }, children: [
|
|
16735
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsx)("div", { css: Css.df.gap1.aic.fww.$, children }),
|
|
16687
16736
|
right
|
|
16688
16737
|
] });
|
|
16689
16738
|
}
|
|
@@ -16693,21 +16742,21 @@ var import_use_debounce6 = require("use-debounce");
|
|
|
16693
16742
|
var import_use_query_params3 = require("use-query-params");
|
|
16694
16743
|
|
|
16695
16744
|
// src/components/Layout/ScrollableContent.tsx
|
|
16696
|
-
var
|
|
16745
|
+
var import_react95 = require("react");
|
|
16697
16746
|
var import_react_dom4 = require("react-dom");
|
|
16698
|
-
var
|
|
16747
|
+
var import_jsx_runtime141 = require("@emotion/react/jsx-runtime");
|
|
16699
16748
|
function ScrollableContent(props) {
|
|
16700
16749
|
const { children, virtualized = false, omitBottomPadding, bgColor } = props;
|
|
16701
16750
|
const { scrollableEl, setPortalTick, pl, pr } = useScrollableParent();
|
|
16702
|
-
(0,
|
|
16751
|
+
(0, import_react95.useEffect)(() => {
|
|
16703
16752
|
setPortalTick((prev) => prev + 1);
|
|
16704
16753
|
return () => setPortalTick((prev) => prev + 1);
|
|
16705
16754
|
}, [setPortalTick]);
|
|
16706
16755
|
if (!scrollableEl) {
|
|
16707
|
-
return /* @__PURE__ */ (0,
|
|
16756
|
+
return /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(import_jsx_runtime141.Fragment, { children });
|
|
16708
16757
|
}
|
|
16709
16758
|
return (0, import_react_dom4.createPortal)(
|
|
16710
|
-
/* @__PURE__ */ (0,
|
|
16759
|
+
/* @__PURE__ */ (0, import_jsx_runtime141.jsx)(
|
|
16711
16760
|
"div",
|
|
16712
16761
|
{
|
|
16713
16762
|
css: {
|
|
@@ -16723,10 +16772,10 @@ function ScrollableContent(props) {
|
|
|
16723
16772
|
}
|
|
16724
16773
|
|
|
16725
16774
|
// src/components/Layout/GridTableLayout/QueryTable.tsx
|
|
16726
|
-
var
|
|
16775
|
+
var import_react96 = require("react");
|
|
16727
16776
|
|
|
16728
16777
|
// src/components/LoadingSkeleton.tsx
|
|
16729
|
-
var
|
|
16778
|
+
var import_jsx_runtime142 = require("@emotion/react/jsx-runtime");
|
|
16730
16779
|
function LoadingSkeleton({
|
|
16731
16780
|
rows = 1,
|
|
16732
16781
|
columns = 1,
|
|
@@ -16739,7 +16788,7 @@ function LoadingSkeleton({
|
|
|
16739
16788
|
const rowHeight = sizeToPixels2[size];
|
|
16740
16789
|
const rowCells = (rowNumber) => {
|
|
16741
16790
|
const flexGrowForCell = randomizeWidths ? getRandomizedFlexBasisByRowIndex(rowNumber) : 1;
|
|
16742
|
-
return cellArray.map((_, i) => /* @__PURE__ */ (0,
|
|
16791
|
+
return cellArray.map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
|
|
16743
16792
|
"div",
|
|
16744
16793
|
{
|
|
16745
16794
|
css: Css.br4.add("animation", "pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite").add("flexGrow", flexGrowForCell).bgGray300.if(contrast).bgGray700.$
|
|
@@ -16747,7 +16796,7 @@ function LoadingSkeleton({
|
|
|
16747
16796
|
`row-${rowNumber}-cell-${i}`
|
|
16748
16797
|
));
|
|
16749
16798
|
};
|
|
16750
|
-
return /* @__PURE__ */ (0,
|
|
16799
|
+
return /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("div", { "aria-label": "Loading", children: rowArray.map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("div", { css: Css.df.gap1.mb1.hPx(rowHeight).$, children: rowCells(i) }, `row-${i}`)) });
|
|
16751
16800
|
}
|
|
16752
16801
|
function getRandomizedFlexBasisByRowIndex(rowIndex) {
|
|
16753
16802
|
const randomizedFlexBasisValues = [0.65, 0.8, 0.75, 0.9, 0.8, 0.85, 0.8, 0.95];
|
|
@@ -16761,27 +16810,27 @@ var sizeToPixels2 = {
|
|
|
16761
16810
|
};
|
|
16762
16811
|
|
|
16763
16812
|
// src/components/Layout/GridTableLayout/QueryTable.tsx
|
|
16764
|
-
var
|
|
16813
|
+
var import_jsx_runtime143 = require("@emotion/react/jsx-runtime");
|
|
16765
16814
|
function QueryTable(props) {
|
|
16766
16815
|
const { emptyFallback, query, createRows, getPageInfo, columns, keepHeaderWhenLoading, ...others } = props;
|
|
16767
16816
|
const data = query.loading || query.error ? void 0 : query.data;
|
|
16768
|
-
const rows = (0,
|
|
16817
|
+
const rows = (0, import_react96.useMemo)(() => createRows(data), [createRows, data]);
|
|
16769
16818
|
const hasNextPage = data && getPageInfo && getPageInfo(data).hasNextPage;
|
|
16770
16819
|
const infoMessage = hasNextPage ? "Too many rows" : void 0;
|
|
16771
16820
|
const fallbackMessage = query.loading ? "Loading\u2026" : query.error ? `Error: ${query.error.message}` : emptyFallback;
|
|
16772
16821
|
const headers = rows.filter((row) => row.kind === "header");
|
|
16773
|
-
return query.loading ? /* @__PURE__ */ (0,
|
|
16822
|
+
return query.loading ? /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("div", { children: keepHeaderWhenLoading ? /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(GridTable, { ...{ columns, ...others }, rows: headers, fallbackMessage }) : /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(LoadingTable, { columns: columns.length }) }) : /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(GridTable, { ...{ rows, columns, fallbackMessage, infoMessage, ...others } });
|
|
16774
16823
|
}
|
|
16775
16824
|
function LoadingTable(props) {
|
|
16776
16825
|
const { columns } = props;
|
|
16777
|
-
return /* @__PURE__ */ (0,
|
|
16778
|
-
/* @__PURE__ */ (0,
|
|
16779
|
-
/* @__PURE__ */ (0,
|
|
16826
|
+
return /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)(import_jsx_runtime143.Fragment, { children: [
|
|
16827
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)(LoadingSkeleton, { rows: 1, columns: 1 }),
|
|
16828
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)(LoadingSkeleton, { rows: 5, columns: columns ?? 5 })
|
|
16780
16829
|
] });
|
|
16781
16830
|
}
|
|
16782
16831
|
|
|
16783
16832
|
// src/components/Layout/GridTableLayout/GridTableLayout.tsx
|
|
16784
|
-
var
|
|
16833
|
+
var import_jsx_runtime144 = require("@emotion/react/jsx-runtime");
|
|
16785
16834
|
function isGridTableProps(props) {
|
|
16786
16835
|
return "rows" in props;
|
|
16787
16836
|
}
|
|
@@ -16794,16 +16843,17 @@ function GridTableLayoutComponent(props) {
|
|
|
16794
16843
|
primaryAction,
|
|
16795
16844
|
secondaryAction,
|
|
16796
16845
|
tertiaryAction,
|
|
16846
|
+
actionMenu,
|
|
16797
16847
|
hideEditColumns = false
|
|
16798
16848
|
} = props;
|
|
16799
16849
|
const tid = useTestIds(props);
|
|
16800
16850
|
const columns = tableProps.columns;
|
|
16801
|
-
const hasHideableColumns = (0,
|
|
16851
|
+
const hasHideableColumns = (0, import_react97.useMemo)(() => {
|
|
16802
16852
|
if (hideEditColumns) return false;
|
|
16803
16853
|
validateColumns(columns);
|
|
16804
16854
|
return columns.some((c) => c.canHide);
|
|
16805
16855
|
}, [columns, hideEditColumns]);
|
|
16806
|
-
const api = (0,
|
|
16856
|
+
const api = (0, import_react97.useMemo)(
|
|
16807
16857
|
() => tableProps.api ?? new GridTableApiImpl(),
|
|
16808
16858
|
[tableProps.api]
|
|
16809
16859
|
);
|
|
@@ -16811,27 +16861,28 @@ function GridTableLayoutComponent(props) {
|
|
|
16811
16861
|
const showTableActions = layoutState?.filterDefs || layoutState?.search || hasHideableColumns;
|
|
16812
16862
|
const isVirtualized = tableProps.as === "virtual";
|
|
16813
16863
|
const visibleColumnIds = useComputed(() => api.getVisibleColumnIds(), [api]);
|
|
16814
|
-
(0,
|
|
16864
|
+
(0, import_react97.useEffect)(() => {
|
|
16815
16865
|
if (layoutState?.setVisibleColumnIds) {
|
|
16816
16866
|
layoutState.setVisibleColumnIds(visibleColumnIds);
|
|
16817
16867
|
}
|
|
16818
16868
|
}, [visibleColumnIds, layoutState]);
|
|
16819
16869
|
const visibleColumnsStorageKey = layoutState?.persistedColumnsStorageKey;
|
|
16820
|
-
return /* @__PURE__ */ (0,
|
|
16821
|
-
/* @__PURE__ */ (0,
|
|
16870
|
+
return /* @__PURE__ */ (0, import_jsx_runtime144.jsxs)(import_jsx_runtime144.Fragment, { children: [
|
|
16871
|
+
/* @__PURE__ */ (0, import_jsx_runtime144.jsx)(
|
|
16822
16872
|
Header2,
|
|
16823
16873
|
{
|
|
16824
16874
|
pageTitle,
|
|
16825
16875
|
breadcrumb,
|
|
16826
16876
|
primaryAction,
|
|
16827
16877
|
secondaryAction,
|
|
16828
|
-
tertiaryAction
|
|
16878
|
+
tertiaryAction,
|
|
16879
|
+
actionMenu
|
|
16829
16880
|
}
|
|
16830
16881
|
),
|
|
16831
|
-
showTableActions && /* @__PURE__ */ (0,
|
|
16882
|
+
showTableActions && /* @__PURE__ */ (0, import_jsx_runtime144.jsxs)(
|
|
16832
16883
|
TableActions,
|
|
16833
16884
|
{
|
|
16834
|
-
right: hasHideableColumns && /* @__PURE__ */ (0,
|
|
16885
|
+
right: hasHideableColumns && /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(
|
|
16835
16886
|
EditColumnsButton,
|
|
16836
16887
|
{
|
|
16837
16888
|
columns,
|
|
@@ -16842,8 +16893,8 @@ function GridTableLayoutComponent(props) {
|
|
|
16842
16893
|
}
|
|
16843
16894
|
),
|
|
16844
16895
|
children: [
|
|
16845
|
-
layoutState?.search && /* @__PURE__ */ (0,
|
|
16846
|
-
layoutState?.filterDefs && /* @__PURE__ */ (0,
|
|
16896
|
+
layoutState?.search && /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(SearchBox, { onSearch: layoutState.setSearchString }),
|
|
16897
|
+
layoutState?.filterDefs && /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(
|
|
16847
16898
|
_FilterDropdownMenu,
|
|
16848
16899
|
{
|
|
16849
16900
|
filterDefs: layoutState.filterDefs,
|
|
@@ -16855,7 +16906,7 @@ function GridTableLayoutComponent(props) {
|
|
|
16855
16906
|
]
|
|
16856
16907
|
}
|
|
16857
16908
|
),
|
|
16858
|
-
/* @__PURE__ */ (0,
|
|
16909
|
+
/* @__PURE__ */ (0, import_jsx_runtime144.jsx)(ScrollableContent, { virtualized: isVirtualized, children: isGridTableProps(tableProps) ? /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(
|
|
16859
16910
|
GridTable,
|
|
16860
16911
|
{
|
|
16861
16912
|
...tableProps,
|
|
@@ -16865,7 +16916,7 @@ function GridTableLayoutComponent(props) {
|
|
|
16865
16916
|
stickyHeader: true,
|
|
16866
16917
|
visibleColumnsStorageKey
|
|
16867
16918
|
}
|
|
16868
|
-
) : /* @__PURE__ */ (0,
|
|
16919
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(
|
|
16869
16920
|
QueryTable,
|
|
16870
16921
|
{
|
|
16871
16922
|
...tableProps,
|
|
@@ -16878,7 +16929,7 @@ function GridTableLayoutComponent(props) {
|
|
|
16878
16929
|
) })
|
|
16879
16930
|
] });
|
|
16880
16931
|
}
|
|
16881
|
-
var GridTableLayout =
|
|
16932
|
+
var GridTableLayout = import_react97.default.memo(GridTableLayoutComponent);
|
|
16882
16933
|
function validateColumns(columns) {
|
|
16883
16934
|
for (const col of columns) {
|
|
16884
16935
|
if (!col.id || !col.name) {
|
|
@@ -16895,7 +16946,7 @@ function useGridTableLayoutState({
|
|
|
16895
16946
|
const filterFallback = { filterDefs: {}, storageKey: "unset-filter" };
|
|
16896
16947
|
const { filter, setFilter } = usePersistedFilter(persistedFilter ?? filterFallback);
|
|
16897
16948
|
const groupBy = useGroupBy(maybeGroupBy ?? { none: "none" });
|
|
16898
|
-
const [searchString, setSearchString] = (0,
|
|
16949
|
+
const [searchString, setSearchString] = (0, import_react97.useState)("");
|
|
16899
16950
|
const columnsFallback = "unset-columns";
|
|
16900
16951
|
const [visibleColumnIds, setVisibleColumnIds] = useSessionStorage(
|
|
16901
16952
|
persistedColumns?.storageKey ?? columnsFallback,
|
|
@@ -16915,29 +16966,30 @@ function useGridTableLayoutState({
|
|
|
16915
16966
|
};
|
|
16916
16967
|
}
|
|
16917
16968
|
function Header2(props) {
|
|
16918
|
-
const { pageTitle, breadcrumb, primaryAction, secondaryAction, tertiaryAction } = props;
|
|
16969
|
+
const { pageTitle, breadcrumb, primaryAction, secondaryAction, tertiaryAction, actionMenu } = props;
|
|
16919
16970
|
const tids = useTestIds(props);
|
|
16920
|
-
return /* @__PURE__ */ (0,
|
|
16921
|
-
/* @__PURE__ */ (0,
|
|
16922
|
-
breadcrumb && /* @__PURE__ */ (0,
|
|
16923
|
-
/* @__PURE__ */ (0,
|
|
16971
|
+
return /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(FullBleed, { children: /* @__PURE__ */ (0, import_jsx_runtime144.jsxs)("header", { css: { ...Css.p3.mb3.mhPx(50).bgWhite.df.jcsb.aic.$ }, ...tids.header, children: [
|
|
16972
|
+
/* @__PURE__ */ (0, import_jsx_runtime144.jsxs)("div", { children: [
|
|
16973
|
+
breadcrumb && /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(PageHeaderBreadcrumbs, { breadcrumb }),
|
|
16974
|
+
/* @__PURE__ */ (0, import_jsx_runtime144.jsx)("h1", { css: Css.xl2.mt1.$, ...tids.pageTitle, children: pageTitle })
|
|
16924
16975
|
] }),
|
|
16925
|
-
/* @__PURE__ */ (0,
|
|
16926
|
-
tertiaryAction && /* @__PURE__ */ (0,
|
|
16927
|
-
secondaryAction && /* @__PURE__ */ (0,
|
|
16928
|
-
primaryAction && /* @__PURE__ */ (0,
|
|
16976
|
+
/* @__PURE__ */ (0, import_jsx_runtime144.jsxs)("div", { css: Css.df.fwr.jcfe.gap1.aic.$, children: [
|
|
16977
|
+
tertiaryAction && /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(Button, { ...tertiaryAction, variant: "tertiary" }),
|
|
16978
|
+
secondaryAction && /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(Button, { ...secondaryAction, variant: "secondary" }),
|
|
16979
|
+
primaryAction && /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(Button, { ...primaryAction }),
|
|
16980
|
+
actionMenu && /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(ButtonMenu, { ...actionMenu, trigger: { icon: "verticalDots" } })
|
|
16929
16981
|
] })
|
|
16930
16982
|
] }) });
|
|
16931
16983
|
}
|
|
16932
16984
|
function SearchBox({ onSearch }) {
|
|
16933
16985
|
const [{ search: initialValue }, setQueryParams] = (0, import_use_query_params3.useQueryParams)({ search: import_use_query_params3.StringParam });
|
|
16934
|
-
const [value, setValue] = (0,
|
|
16986
|
+
const [value, setValue] = (0, import_react97.useState)(initialValue || "");
|
|
16935
16987
|
const [debouncedSearch] = (0, import_use_debounce6.useDebounce)(value, 300);
|
|
16936
|
-
(0,
|
|
16988
|
+
(0, import_react97.useEffect)(() => {
|
|
16937
16989
|
onSearch(debouncedSearch);
|
|
16938
16990
|
setQueryParams({ search: debouncedSearch || void 0 }, "replaceIn");
|
|
16939
16991
|
}, [debouncedSearch, onSearch, setQueryParams]);
|
|
16940
|
-
return /* @__PURE__ */ (0,
|
|
16992
|
+
return /* @__PURE__ */ (0, import_jsx_runtime144.jsx)("div", { css: Css.wPx(244).$, children: /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(
|
|
16941
16993
|
TextField,
|
|
16942
16994
|
{
|
|
16943
16995
|
label: "Search",
|
|
@@ -16946,26 +16998,26 @@ function SearchBox({ onSearch }) {
|
|
|
16946
16998
|
onChange: (v) => setValue(v ?? ""),
|
|
16947
16999
|
placeholder: "Search",
|
|
16948
17000
|
clearable: true,
|
|
16949
|
-
startAdornment: /* @__PURE__ */ (0,
|
|
17001
|
+
startAdornment: /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(Icon, { icon: "search", color: "rgba(100, 100, 100, 1)" /* Gray700 */ })
|
|
16950
17002
|
}
|
|
16951
17003
|
) });
|
|
16952
17004
|
}
|
|
16953
17005
|
|
|
16954
17006
|
// src/components/Layout/PreventBrowserScroll.tsx
|
|
16955
|
-
var
|
|
17007
|
+
var import_jsx_runtime145 = require("@emotion/react/jsx-runtime");
|
|
16956
17008
|
function PreventBrowserScroll({ children }) {
|
|
16957
17009
|
return (
|
|
16958
17010
|
// Take over the full viewport and hide any overflown content.
|
|
16959
17011
|
// Using `-webkit-fill-available`, otherwise `height: 100vh` includes the app bars in mobile Safari. See https://allthingssmitty.com/2020/05/11/css-fix-for-100vh-in-mobile-webkit/
|
|
16960
17012
|
// Setting the multiple "(min|max-)height" properties is necessary, as Truss will turn this into an object and there can only be one `height` property.
|
|
16961
|
-
/* @__PURE__ */ (0,
|
|
17013
|
+
/* @__PURE__ */ (0, import_jsx_runtime145.jsx)("div", { css: Css.oh.vh100.mh("-webkit-fill-available").maxh("-webkit-fill-available").$, children: /* @__PURE__ */ (0, import_jsx_runtime145.jsx)("div", { css: Css.h100.df.fdc.mh0.oa.$, children }) })
|
|
16962
17014
|
);
|
|
16963
17015
|
}
|
|
16964
17016
|
|
|
16965
17017
|
// src/components/Layout/RightPaneLayout/RightPaneContext.tsx
|
|
16966
|
-
var
|
|
16967
|
-
var
|
|
16968
|
-
var RightPaneContext =
|
|
17018
|
+
var import_react98 = __toESM(require("react"), 1);
|
|
17019
|
+
var import_jsx_runtime146 = require("@emotion/react/jsx-runtime");
|
|
17020
|
+
var RightPaneContext = import_react98.default.createContext({
|
|
16969
17021
|
openInPane: () => {
|
|
16970
17022
|
},
|
|
16971
17023
|
closePane: () => {
|
|
@@ -16976,37 +17028,37 @@ var RightPaneContext = import_react97.default.createContext({
|
|
|
16976
17028
|
rightPaneContent: null
|
|
16977
17029
|
});
|
|
16978
17030
|
function RightPaneProvider({ children }) {
|
|
16979
|
-
const [rightPaneContent, setRightPaneContent] = (0,
|
|
16980
|
-
const [isRightPaneOpen, setIsRightPaneOpen] = (0,
|
|
16981
|
-
const openInPane = (0,
|
|
17031
|
+
const [rightPaneContent, setRightPaneContent] = (0, import_react98.useState)(void 0);
|
|
17032
|
+
const [isRightPaneOpen, setIsRightPaneOpen] = (0, import_react98.useState)(false);
|
|
17033
|
+
const openInPane = (0, import_react98.useCallback)(
|
|
16982
17034
|
(opts) => {
|
|
16983
17035
|
setRightPaneContent(opts?.content);
|
|
16984
17036
|
setIsRightPaneOpen(true);
|
|
16985
17037
|
},
|
|
16986
17038
|
[setRightPaneContent]
|
|
16987
17039
|
);
|
|
16988
|
-
const closePane = (0,
|
|
16989
|
-
const clearPane = (0,
|
|
16990
|
-
const context = (0,
|
|
17040
|
+
const closePane = (0, import_react98.useCallback)(() => setIsRightPaneOpen(false), []);
|
|
17041
|
+
const clearPane = (0, import_react98.useCallback)(() => setRightPaneContent(void 0), [setRightPaneContent]);
|
|
17042
|
+
const context = (0, import_react98.useMemo)(
|
|
16991
17043
|
() => ({ openInPane, closePane, clearPane, rightPaneContent, isRightPaneOpen }),
|
|
16992
17044
|
[openInPane, closePane, rightPaneContent, clearPane, isRightPaneOpen]
|
|
16993
17045
|
);
|
|
16994
|
-
return /* @__PURE__ */ (0,
|
|
17046
|
+
return /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(RightPaneContext.Provider, { value: context, children });
|
|
16995
17047
|
}
|
|
16996
17048
|
function useRightPaneContext() {
|
|
16997
|
-
return (0,
|
|
17049
|
+
return (0, import_react98.useContext)(RightPaneContext);
|
|
16998
17050
|
}
|
|
16999
17051
|
|
|
17000
17052
|
// src/components/Layout/RightPaneLayout/RightPaneLayout.tsx
|
|
17001
17053
|
var import_framer_motion3 = require("framer-motion");
|
|
17002
|
-
var
|
|
17003
|
-
var
|
|
17054
|
+
var import_react99 = require("react");
|
|
17055
|
+
var import_jsx_runtime147 = require("@emotion/react/jsx-runtime");
|
|
17004
17056
|
function RightPaneLayout(props) {
|
|
17005
17057
|
const { children, paneBgColor = "rgba(255,255,255,1)" /* White */, paneWidth = 450, defaultPaneContent } = props;
|
|
17006
17058
|
const { isRightPaneOpen, rightPaneContent, clearPane, closePane } = useRightPaneContext();
|
|
17007
|
-
(0,
|
|
17008
|
-
return /* @__PURE__ */ (0,
|
|
17009
|
-
/* @__PURE__ */ (0,
|
|
17059
|
+
(0, import_react99.useEffect)(() => closePane, [closePane]);
|
|
17060
|
+
return /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { css: Css.h100.df.oxh.$, children: /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)(import_jsx_runtime147.Fragment, { children: [
|
|
17061
|
+
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
|
|
17010
17062
|
"div",
|
|
17011
17063
|
{
|
|
17012
17064
|
css: {
|
|
@@ -17017,15 +17069,15 @@ function RightPaneLayout(props) {
|
|
|
17017
17069
|
children
|
|
17018
17070
|
}
|
|
17019
17071
|
),
|
|
17020
|
-
/* @__PURE__ */ (0,
|
|
17021
|
-
defaultPaneContent && /* @__PURE__ */ (0,
|
|
17072
|
+
/* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { css: Css.relative.if(!!defaultPaneContent).wPx(paneWidth).$, children: [
|
|
17073
|
+
defaultPaneContent && /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
|
|
17022
17074
|
"div",
|
|
17023
17075
|
{
|
|
17024
17076
|
css: Css.h100.wPx(paneWidth).left(0).absolute.add("transition", "all .3s ease-in-out").if(isRightPaneOpen).add("opacity", 0).left(100).$,
|
|
17025
17077
|
children: defaultPaneContent
|
|
17026
17078
|
}
|
|
17027
17079
|
),
|
|
17028
|
-
/* @__PURE__ */ (0,
|
|
17080
|
+
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)(import_framer_motion3.AnimatePresence, { children: isRightPaneOpen && /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
|
|
17029
17081
|
import_framer_motion3.motion.div,
|
|
17030
17082
|
{
|
|
17031
17083
|
layout: "position",
|
|
@@ -17054,8 +17106,8 @@ function useRightPane() {
|
|
|
17054
17106
|
}
|
|
17055
17107
|
|
|
17056
17108
|
// src/components/BeamContext.tsx
|
|
17057
|
-
var
|
|
17058
|
-
var BeamContext = (0,
|
|
17109
|
+
var import_jsx_runtime148 = require("@emotion/react/jsx-runtime");
|
|
17110
|
+
var BeamContext = (0, import_react100.createContext)({
|
|
17059
17111
|
modalState: new EmptyRef(),
|
|
17060
17112
|
modalCanCloseChecks: new EmptyRef(),
|
|
17061
17113
|
modalHeaderDiv: void 0,
|
|
@@ -17067,21 +17119,21 @@ var BeamContext = (0, import_react99.createContext)({
|
|
|
17067
17119
|
sdHeaderDiv: void 0
|
|
17068
17120
|
});
|
|
17069
17121
|
function BeamProvider({ children, ...presentationProps }) {
|
|
17070
|
-
const [, tick] = (0,
|
|
17071
|
-
const modalRef = (0,
|
|
17072
|
-
const modalHeaderDiv = (0,
|
|
17073
|
-
const modalBodyDiv = (0,
|
|
17122
|
+
const [, tick] = (0, import_react100.useReducer)((prev) => prev + 1, 0);
|
|
17123
|
+
const modalRef = (0, import_react100.useRef)();
|
|
17124
|
+
const modalHeaderDiv = (0, import_react100.useMemo)(() => document.createElement("div"), []);
|
|
17125
|
+
const modalBodyDiv = (0, import_react100.useMemo)(() => {
|
|
17074
17126
|
const el = document.createElement("div");
|
|
17075
17127
|
el.style.height = "100%";
|
|
17076
17128
|
return el;
|
|
17077
17129
|
}, []);
|
|
17078
|
-
const modalCanCloseChecksRef = (0,
|
|
17079
|
-
const modalFooterDiv = (0,
|
|
17080
|
-
const drawerContentStackRef = (0,
|
|
17081
|
-
const drawerCanCloseChecks = (0,
|
|
17082
|
-
const drawerCanCloseDetailsChecks = (0,
|
|
17083
|
-
const sdHeaderDiv = (0,
|
|
17084
|
-
const context = (0,
|
|
17130
|
+
const modalCanCloseChecksRef = (0, import_react100.useRef)([]);
|
|
17131
|
+
const modalFooterDiv = (0, import_react100.useMemo)(() => document.createElement("div"), []);
|
|
17132
|
+
const drawerContentStackRef = (0, import_react100.useRef)([]);
|
|
17133
|
+
const drawerCanCloseChecks = (0, import_react100.useRef)([]);
|
|
17134
|
+
const drawerCanCloseDetailsChecks = (0, import_react100.useRef)([]);
|
|
17135
|
+
const sdHeaderDiv = (0, import_react100.useMemo)(() => document.createElement("div"), []);
|
|
17136
|
+
const context = (0, import_react100.useMemo)(() => {
|
|
17085
17137
|
return {
|
|
17086
17138
|
// These two keys need to trigger re-renders on change
|
|
17087
17139
|
modalState: new PretendRefThatTicks(modalRef, tick),
|
|
@@ -17096,12 +17148,12 @@ function BeamProvider({ children, ...presentationProps }) {
|
|
|
17096
17148
|
sdHeaderDiv
|
|
17097
17149
|
};
|
|
17098
17150
|
}, [modalBodyDiv, modalFooterDiv, modalHeaderDiv, sdHeaderDiv]);
|
|
17099
|
-
return /* @__PURE__ */ (0,
|
|
17100
|
-
/* @__PURE__ */ (0,
|
|
17151
|
+
return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(BeamContext.Provider, { value: { ...context }, children: /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(PresentationProvider, { ...presentationProps, children: /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(RightPaneProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(AutoSaveStatusProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(SnackbarProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime148.jsxs)(ToastProvider, { children: [
|
|
17152
|
+
/* @__PURE__ */ (0, import_jsx_runtime148.jsxs)(import_react_aria46.OverlayProvider, { children: [
|
|
17101
17153
|
children,
|
|
17102
|
-
modalRef.current && /* @__PURE__ */ (0,
|
|
17154
|
+
modalRef.current && /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(Modal, { ...modalRef.current })
|
|
17103
17155
|
] }),
|
|
17104
|
-
/* @__PURE__ */ (0,
|
|
17156
|
+
/* @__PURE__ */ (0, import_jsx_runtime148.jsx)(SuperDrawer, {})
|
|
17105
17157
|
] }) }) }) }) }) });
|
|
17106
17158
|
}
|
|
17107
17159
|
var PretendRefThatTicks = class {
|
|
@@ -17118,24 +17170,24 @@ var PretendRefThatTicks = class {
|
|
|
17118
17170
|
}
|
|
17119
17171
|
};
|
|
17120
17172
|
function useBeamContext() {
|
|
17121
|
-
return (0,
|
|
17173
|
+
return (0, import_react100.useContext)(BeamContext);
|
|
17122
17174
|
}
|
|
17123
17175
|
|
|
17124
17176
|
// src/components/ButtonDatePicker.tsx
|
|
17125
|
-
var
|
|
17126
|
-
var
|
|
17127
|
-
var
|
|
17128
|
-
var
|
|
17177
|
+
var import_react101 = require("react");
|
|
17178
|
+
var import_react_aria47 = require("react-aria");
|
|
17179
|
+
var import_react_stately18 = require("react-stately");
|
|
17180
|
+
var import_jsx_runtime149 = require("@emotion/react/jsx-runtime");
|
|
17129
17181
|
function ButtonDatePicker(props) {
|
|
17130
17182
|
const { defaultOpen, disabled, trigger, onSelect, ...datePickerProps } = props;
|
|
17131
|
-
const state = (0,
|
|
17132
|
-
const buttonRef = (0,
|
|
17133
|
-
const { menuTriggerProps, menuProps } = (0,
|
|
17183
|
+
const state = (0, import_react_stately18.useMenuTriggerState)({ isOpen: defaultOpen });
|
|
17184
|
+
const buttonRef = (0, import_react101.useRef)(null);
|
|
17185
|
+
const { menuTriggerProps, menuProps } = (0, import_react_aria47.useMenuTrigger)({ isDisabled: !!disabled }, state, buttonRef);
|
|
17134
17186
|
const tid = useTestIds(
|
|
17135
17187
|
props,
|
|
17136
17188
|
isTextButton(trigger) ? defaultTestId(labelOr(trigger, "buttonDatePicker")) : isNavLinkButton(trigger) ? defaultTestId(trigger.navLabel) : isIconButton(trigger) ? trigger.icon : trigger.name
|
|
17137
17189
|
);
|
|
17138
|
-
return /* @__PURE__ */ (0,
|
|
17190
|
+
return /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(OverlayTrigger, { ...props, menuTriggerProps, state, buttonRef, ...tid, children: /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(DatePickerOverlay, { overlayProps: menuProps, children: /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
|
|
17139
17191
|
DatePicker,
|
|
17140
17192
|
{
|
|
17141
17193
|
...datePickerProps,
|
|
@@ -17149,9 +17201,9 @@ function ButtonDatePicker(props) {
|
|
|
17149
17201
|
}
|
|
17150
17202
|
|
|
17151
17203
|
// src/components/ButtonGroup.tsx
|
|
17152
|
-
var
|
|
17153
|
-
var
|
|
17154
|
-
var
|
|
17204
|
+
var import_react102 = require("react");
|
|
17205
|
+
var import_react_aria48 = require("react-aria");
|
|
17206
|
+
var import_jsx_runtime150 = (
|
|
17155
17207
|
// Disable the button if the ButtonGroup is disabled or if the current button is disabled.
|
|
17156
17208
|
require("@emotion/react/jsx-runtime")
|
|
17157
17209
|
);
|
|
@@ -17160,21 +17212,21 @@ function ButtonGroup(props) {
|
|
|
17160
17212
|
const tid = useTestIds(props, "buttonGroup");
|
|
17161
17213
|
return (
|
|
17162
17214
|
// Adding `line-height: 0` prevent inheriting line-heights that might throw off sizing within the button group.
|
|
17163
|
-
/* @__PURE__ */ (0,
|
|
17215
|
+
/* @__PURE__ */ (0, import_jsx_runtime150.jsx)("div", { ...tid, css: Css.df.lh(0).add({ ...sizeStyles2[size] }).$, children: buttons.map(({ disabled: buttonDisabled, ...buttonProps }, i) => /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(GroupButton, { ...buttonProps, disabled: disabled || buttonDisabled, size, ...tid }, i)) })
|
|
17164
17216
|
);
|
|
17165
17217
|
}
|
|
17166
17218
|
function GroupButton(props) {
|
|
17167
17219
|
const { icon, iconInc, iconColor, text, active, onClick: onPress, disabled, size, tooltip, ...otherProps } = props;
|
|
17168
17220
|
const ariaProps = { onPress, isDisabled: !!disabled, ...otherProps };
|
|
17169
|
-
const ref = (0,
|
|
17170
|
-
const { buttonProps, isPressed } = (0,
|
|
17171
|
-
const { isFocusVisible, focusProps } = (0,
|
|
17172
|
-
const { hoverProps, isHovered } = (0,
|
|
17221
|
+
const ref = (0, import_react102.useRef)(null);
|
|
17222
|
+
const { buttonProps, isPressed } = (0, import_react_aria48.useButton)(ariaProps, ref);
|
|
17223
|
+
const { isFocusVisible, focusProps } = (0, import_react_aria48.useFocusRing)();
|
|
17224
|
+
const { hoverProps, isHovered } = (0, import_react_aria48.useHover)(ariaProps);
|
|
17173
17225
|
const tid = useTestIds(props);
|
|
17174
|
-
return /* @__PURE__ */ (0,
|
|
17226
|
+
return /* @__PURE__ */ (0, import_jsx_runtime150.jsx)("span", { css: getButtonStyles2(), children: maybeTooltip({
|
|
17175
17227
|
title: resolveTooltip(disabled, tooltip),
|
|
17176
17228
|
placement: "top",
|
|
17177
|
-
children: /* @__PURE__ */ (0,
|
|
17229
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)(
|
|
17178
17230
|
"button",
|
|
17179
17231
|
{
|
|
17180
17232
|
ref,
|
|
@@ -17191,7 +17243,7 @@ function GroupButton(props) {
|
|
|
17191
17243
|
},
|
|
17192
17244
|
...tid[defaultTestId(typeof text === "string" && text || icon || "button")],
|
|
17193
17245
|
children: [
|
|
17194
|
-
icon && /* @__PURE__ */ (0,
|
|
17246
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(Icon, { xss: Css.if(!!text).mrPx(4).$, icon, color: disabled ? void 0 : iconColor, inc: iconInc }),
|
|
17195
17247
|
text
|
|
17196
17248
|
]
|
|
17197
17249
|
}
|
|
@@ -17224,55 +17276,6 @@ var iconStyles2 = {
|
|
|
17224
17276
|
md: Css.px1.$
|
|
17225
17277
|
};
|
|
17226
17278
|
|
|
17227
|
-
// src/components/ButtonMenu.tsx
|
|
17228
|
-
var import_react102 = require("react");
|
|
17229
|
-
var import_react_aria48 = require("react-aria");
|
|
17230
|
-
var import_react_stately18 = require("react-stately");
|
|
17231
|
-
var import_jsx_runtime150 = require("@emotion/react/jsx-runtime");
|
|
17232
|
-
function ButtonMenu(props) {
|
|
17233
|
-
const { defaultOpen, disabled, items, persistentItems, trigger, searchable, contrast = false } = props;
|
|
17234
|
-
let selectedItem, onChange;
|
|
17235
|
-
if (isSelectionButtonMenuProps(props)) {
|
|
17236
|
-
selectedItem = props.selectedItem;
|
|
17237
|
-
onChange = props.onChange;
|
|
17238
|
-
}
|
|
17239
|
-
const state = (0, import_react_stately18.useMenuTriggerState)({ isOpen: defaultOpen });
|
|
17240
|
-
const buttonRef = (0, import_react102.useRef)(null);
|
|
17241
|
-
const { menuTriggerProps, menuProps } = (0, import_react_aria48.useMenuTrigger)({ isDisabled: !!disabled }, state, buttonRef);
|
|
17242
|
-
const tid = useTestIds(
|
|
17243
|
-
props,
|
|
17244
|
-
isTextButton(trigger) ? labelOr(trigger, "buttonMenu") : isNavLinkButton(trigger) ? defaultTestId(trigger.navLabel) : isIconButton(trigger) ? trigger.icon : trigger.name
|
|
17245
|
-
);
|
|
17246
|
-
return /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
17247
|
-
OverlayTrigger,
|
|
17248
|
-
{
|
|
17249
|
-
...props,
|
|
17250
|
-
menuTriggerProps,
|
|
17251
|
-
state,
|
|
17252
|
-
buttonRef,
|
|
17253
|
-
...tid,
|
|
17254
|
-
contrast,
|
|
17255
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
17256
|
-
Menu,
|
|
17257
|
-
{
|
|
17258
|
-
ariaMenuProps: menuProps,
|
|
17259
|
-
onClose: () => state.close(),
|
|
17260
|
-
items,
|
|
17261
|
-
persistentItems,
|
|
17262
|
-
searchable,
|
|
17263
|
-
contrast,
|
|
17264
|
-
selectedItem,
|
|
17265
|
-
onChange,
|
|
17266
|
-
...tid
|
|
17267
|
-
}
|
|
17268
|
-
)
|
|
17269
|
-
}
|
|
17270
|
-
);
|
|
17271
|
-
}
|
|
17272
|
-
function isSelectionButtonMenuProps(props) {
|
|
17273
|
-
return typeof props === "object" && "selectedItem" in props && "onChange" in props;
|
|
17274
|
-
}
|
|
17275
|
-
|
|
17276
17279
|
// src/components/Card.tsx
|
|
17277
17280
|
var import_react104 = require("react");
|
|
17278
17281
|
var import_react_aria49 = require("react-aria");
|