@homebound/beam 2.380.0 → 2.381.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 +243 -72
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +74 -13
- package/dist/index.d.ts +74 -13
- package/dist/index.js +222 -69
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -49,6 +49,7 @@ __export(index_exports, {
|
|
|
49
49
|
BoundChipSelectField: () => BoundChipSelectField,
|
|
50
50
|
BoundDateField: () => BoundDateField,
|
|
51
51
|
BoundDateRangeField: () => BoundDateRangeField,
|
|
52
|
+
BoundForm: () => BoundForm,
|
|
52
53
|
BoundIconCardField: () => BoundIconCardField,
|
|
53
54
|
BoundIconCardGroupField: () => BoundIconCardGroupField,
|
|
54
55
|
BoundMultiLineSelectField: () => BoundMultiLineSelectField,
|
|
@@ -167,6 +168,23 @@ __export(index_exports, {
|
|
|
167
168
|
applyRowFn: () => applyRowFn,
|
|
168
169
|
assignDefaultColumnIds: () => assignDefaultColumnIds,
|
|
169
170
|
booleanFilter: () => booleanFilter,
|
|
171
|
+
boundCheckboxField: () => boundCheckboxField,
|
|
172
|
+
boundCheckboxGroupField: () => boundCheckboxGroupField,
|
|
173
|
+
boundDateField: () => boundDateField,
|
|
174
|
+
boundDateRangeField: () => boundDateRangeField,
|
|
175
|
+
boundIconCardField: () => boundIconCardField,
|
|
176
|
+
boundIconCardGroupField: () => boundIconCardGroupField,
|
|
177
|
+
boundMultiSelectField: () => boundMultiSelectField,
|
|
178
|
+
boundMultilineSelectField: () => boundMultilineSelectField,
|
|
179
|
+
boundNumberField: () => boundNumberField,
|
|
180
|
+
boundRadioGroupField: () => boundRadioGroupField,
|
|
181
|
+
boundRichTextField: () => boundRichTextField,
|
|
182
|
+
boundSelectField: () => boundSelectField,
|
|
183
|
+
boundSwitchField: () => boundSwitchField,
|
|
184
|
+
boundTextAreaField: () => boundTextAreaField,
|
|
185
|
+
boundTextField: () => boundTextField,
|
|
186
|
+
boundToggleChipGroupField: () => boundToggleChipGroupField,
|
|
187
|
+
boundTreeSelectField: () => boundTreeSelectField,
|
|
170
188
|
calcColumnSizes: () => calcColumnSizes,
|
|
171
189
|
cardStyle: () => cardStyle,
|
|
172
190
|
checkboxFilter: () => checkboxFilter,
|
|
@@ -8388,8 +8406,9 @@ var BorderHoverParent = "BorderHoverParent";
|
|
|
8388
8406
|
var BorderHoverChild = "BorderHoverChild";
|
|
8389
8407
|
|
|
8390
8408
|
// src/forms/labelUtils.ts
|
|
8391
|
-
function
|
|
8409
|
+
function useLabelSuffix(required, readOnly) {
|
|
8392
8410
|
const { fieldProps } = usePresentationContext();
|
|
8411
|
+
if (readOnly) return void 0;
|
|
8393
8412
|
if (required === true) {
|
|
8394
8413
|
return fieldProps?.labelSuffix?.required;
|
|
8395
8414
|
} else if (required === false) {
|
|
@@ -8459,7 +8478,7 @@ function TextFieldBase(props) {
|
|
|
8459
8478
|
const internalProps = props.internalProps || {};
|
|
8460
8479
|
const { compound = false, forceFocus = false, forceHover = false } = internalProps;
|
|
8461
8480
|
const errorMessageId = `${inputProps.id}-error`;
|
|
8462
|
-
const labelSuffix =
|
|
8481
|
+
const labelSuffix = useLabelSuffix(required, inputProps.readOnly);
|
|
8463
8482
|
const ElementType = multiline ? "textarea" : "input";
|
|
8464
8483
|
const tid = useTestIds(props, defaultTestId(label));
|
|
8465
8484
|
const [isFocused, setIsFocused] = (0, import_react30.useState)(false);
|
|
@@ -16815,6 +16834,9 @@ function BoundDateRangeField(props) {
|
|
|
16815
16834
|
) });
|
|
16816
16835
|
}
|
|
16817
16836
|
|
|
16837
|
+
// src/forms/BoundForm.tsx
|
|
16838
|
+
var import_react108 = require("react");
|
|
16839
|
+
|
|
16818
16840
|
// src/forms/BoundIconCardField.tsx
|
|
16819
16841
|
var import_mobx_react7 = require("mobx-react");
|
|
16820
16842
|
var import_jsx_runtime138 = require("@emotion/react/jsx-runtime");
|
|
@@ -17143,35 +17165,9 @@ function BoundRichTextField(props) {
|
|
|
17143
17165
|
) });
|
|
17144
17166
|
}
|
|
17145
17167
|
|
|
17146
|
-
// src/forms/BoundSelectAndTextField.tsx
|
|
17147
|
-
var import_jsx_runtime146 = require("@emotion/react/jsx-runtime");
|
|
17148
|
-
function BoundSelectAndTextField(props) {
|
|
17149
|
-
const { selectFieldProps, textFieldProps, compact = true } = props;
|
|
17150
|
-
const tid = useTestIds(props);
|
|
17151
|
-
return /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)(CompoundField, { children: [
|
|
17152
|
-
/* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
|
|
17153
|
-
BoundSelectField,
|
|
17154
|
-
{
|
|
17155
|
-
...tid[defaultTestId(selectFieldProps.label ?? selectFieldProps.field.key)],
|
|
17156
|
-
...selectFieldProps,
|
|
17157
|
-
sizeToContent: true,
|
|
17158
|
-
compact
|
|
17159
|
-
}
|
|
17160
|
-
),
|
|
17161
|
-
/* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
|
|
17162
|
-
BoundTextField,
|
|
17163
|
-
{
|
|
17164
|
-
...tid[defaultTestId(textFieldProps.label ?? textFieldProps.field.key)],
|
|
17165
|
-
...textFieldProps,
|
|
17166
|
-
compact
|
|
17167
|
-
}
|
|
17168
|
-
)
|
|
17169
|
-
] });
|
|
17170
|
-
}
|
|
17171
|
-
|
|
17172
17168
|
// src/forms/BoundSelectField.tsx
|
|
17173
17169
|
var import_mobx_react14 = require("mobx-react");
|
|
17174
|
-
var
|
|
17170
|
+
var import_jsx_runtime146 = require("@emotion/react/jsx-runtime");
|
|
17175
17171
|
function BoundSelectField(props) {
|
|
17176
17172
|
const {
|
|
17177
17173
|
field,
|
|
@@ -17186,7 +17182,7 @@ function BoundSelectField(props) {
|
|
|
17186
17182
|
...others
|
|
17187
17183
|
} = props;
|
|
17188
17184
|
const testId = useTestIds(props, field.key);
|
|
17189
|
-
return /* @__PURE__ */ (0,
|
|
17185
|
+
return /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(import_mobx_react14.Observer, { children: () => /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
|
|
17190
17186
|
SelectField,
|
|
17191
17187
|
{
|
|
17192
17188
|
label,
|
|
@@ -17217,7 +17213,7 @@ function BoundSelectField(props) {
|
|
|
17217
17213
|
|
|
17218
17214
|
// src/forms/BoundSwitchField.tsx
|
|
17219
17215
|
var import_mobx_react15 = require("mobx-react");
|
|
17220
|
-
var
|
|
17216
|
+
var import_jsx_runtime147 = require("@emotion/react/jsx-runtime");
|
|
17221
17217
|
function BoundSwitchField(props) {
|
|
17222
17218
|
const {
|
|
17223
17219
|
field,
|
|
@@ -17228,7 +17224,7 @@ function BoundSwitchField(props) {
|
|
|
17228
17224
|
...others
|
|
17229
17225
|
} = props;
|
|
17230
17226
|
const testId = useTestIds(props, field.key);
|
|
17231
|
-
return /* @__PURE__ */ (0,
|
|
17227
|
+
return /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(import_mobx_react15.Observer, { children: () => /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
|
|
17232
17228
|
Switch,
|
|
17233
17229
|
{
|
|
17234
17230
|
label,
|
|
@@ -17247,7 +17243,7 @@ function BoundSwitchField(props) {
|
|
|
17247
17243
|
|
|
17248
17244
|
// src/forms/BoundTextAreaField.tsx
|
|
17249
17245
|
var import_mobx_react16 = require("mobx-react");
|
|
17250
|
-
var
|
|
17246
|
+
var import_jsx_runtime148 = require("@emotion/react/jsx-runtime");
|
|
17251
17247
|
function BoundTextAreaField(props) {
|
|
17252
17248
|
const {
|
|
17253
17249
|
field,
|
|
@@ -17260,7 +17256,7 @@ function BoundTextAreaField(props) {
|
|
|
17260
17256
|
...others
|
|
17261
17257
|
} = props;
|
|
17262
17258
|
const testId = useTestIds(props, field.key);
|
|
17263
|
-
return /* @__PURE__ */ (0,
|
|
17259
|
+
return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(import_mobx_react16.Observer, { children: () => /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
|
|
17264
17260
|
TextAreaField,
|
|
17265
17261
|
{
|
|
17266
17262
|
label,
|
|
@@ -17289,7 +17285,7 @@ function BoundTextAreaField(props) {
|
|
|
17289
17285
|
|
|
17290
17286
|
// src/forms/BoundTextField.tsx
|
|
17291
17287
|
var import_mobx_react17 = require("mobx-react");
|
|
17292
|
-
var
|
|
17288
|
+
var import_jsx_runtime149 = require("@emotion/react/jsx-runtime");
|
|
17293
17289
|
function BoundTextField(props) {
|
|
17294
17290
|
const {
|
|
17295
17291
|
field,
|
|
@@ -17302,7 +17298,7 @@ function BoundTextField(props) {
|
|
|
17302
17298
|
...others
|
|
17303
17299
|
} = props;
|
|
17304
17300
|
const testId = useTestIds(props, field.key);
|
|
17305
|
-
return /* @__PURE__ */ (0,
|
|
17301
|
+
return /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(import_mobx_react17.Observer, { children: () => /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
|
|
17306
17302
|
TextField,
|
|
17307
17303
|
{
|
|
17308
17304
|
label,
|
|
@@ -17331,16 +17327,16 @@ function BoundTextField(props) {
|
|
|
17331
17327
|
|
|
17332
17328
|
// src/forms/BoundToggleChipGroupField.tsx
|
|
17333
17329
|
var import_mobx_react18 = require("mobx-react");
|
|
17334
|
-
var
|
|
17330
|
+
var import_jsx_runtime150 = require("@emotion/react/jsx-runtime");
|
|
17335
17331
|
function BoundToggleChipGroupField(props) {
|
|
17336
17332
|
const { field, onChange = (value) => field.set(value), label = defaultLabel(field.key), ...others } = props;
|
|
17337
17333
|
const testId = useTestIds(props, field.key);
|
|
17338
|
-
return /* @__PURE__ */ (0,
|
|
17334
|
+
return /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(import_mobx_react18.Observer, { children: () => /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(ToggleChipGroup, { label, values: field.value || [], onChange, ...testId, ...others }) });
|
|
17339
17335
|
}
|
|
17340
17336
|
|
|
17341
17337
|
// src/forms/BoundTreeSelectField.tsx
|
|
17342
17338
|
var import_mobx_react19 = require("mobx-react");
|
|
17343
|
-
var
|
|
17339
|
+
var import_jsx_runtime151 = require("@emotion/react/jsx-runtime");
|
|
17344
17340
|
function BoundTreeSelectField(props) {
|
|
17345
17341
|
const {
|
|
17346
17342
|
field,
|
|
@@ -17357,7 +17353,7 @@ function BoundTreeSelectField(props) {
|
|
|
17357
17353
|
...others
|
|
17358
17354
|
} = props;
|
|
17359
17355
|
const testId = useTestIds(props, field.key);
|
|
17360
|
-
return /* @__PURE__ */ (0,
|
|
17356
|
+
return /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(import_mobx_react19.Observer, { children: () => /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
|
|
17361
17357
|
TreeSelectField,
|
|
17362
17358
|
{
|
|
17363
17359
|
label,
|
|
@@ -17386,29 +17382,9 @@ function BoundTreeSelectField(props) {
|
|
|
17386
17382
|
) });
|
|
17387
17383
|
}
|
|
17388
17384
|
|
|
17389
|
-
// src/forms/FormHeading.tsx
|
|
17390
|
-
var import_jsx_runtime153 = require("@emotion/react/jsx-runtime");
|
|
17391
|
-
function FormHeading(props) {
|
|
17392
|
-
const { title, xss, isFirst = false, ...others } = props;
|
|
17393
|
-
return /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
|
|
17394
|
-
"h3",
|
|
17395
|
-
{
|
|
17396
|
-
css: {
|
|
17397
|
-
...Css.baseMd.$,
|
|
17398
|
-
// Add space before the heading, but only if it's not first.
|
|
17399
|
-
...!isFirst && Css.mt4.$,
|
|
17400
|
-
...xss
|
|
17401
|
-
},
|
|
17402
|
-
...others,
|
|
17403
|
-
children: title
|
|
17404
|
-
}
|
|
17405
|
-
);
|
|
17406
|
-
}
|
|
17407
|
-
FormHeading.isFormHeading = true;
|
|
17408
|
-
|
|
17409
17385
|
// src/forms/FormLines.tsx
|
|
17410
17386
|
var import_react107 = require("react");
|
|
17411
|
-
var
|
|
17387
|
+
var import_jsx_runtime152 = require("@emotion/react/jsx-runtime");
|
|
17412
17388
|
function FormLines(props) {
|
|
17413
17389
|
const { inModal } = useModal();
|
|
17414
17390
|
const {
|
|
@@ -17428,7 +17404,7 @@ function FormLines(props) {
|
|
|
17428
17404
|
..."labelLeftFieldWidth" in props ? { labelLeftFieldWidth } : {},
|
|
17429
17405
|
...width === "full" ? { fullWidth: true } : {}
|
|
17430
17406
|
};
|
|
17431
|
-
return /* @__PURE__ */ (0,
|
|
17407
|
+
return /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(PresentationProvider, { fieldProps: newFieldProps, children: /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(
|
|
17432
17408
|
"div",
|
|
17433
17409
|
{
|
|
17434
17410
|
css: {
|
|
@@ -17450,7 +17426,7 @@ function FormLines(props) {
|
|
|
17450
17426
|
) });
|
|
17451
17427
|
}
|
|
17452
17428
|
function FormDivider() {
|
|
17453
|
-
return /* @__PURE__ */ (0,
|
|
17429
|
+
return /* @__PURE__ */ (0, import_jsx_runtime152.jsx)("div", { css: Css.hPx(1).my2.bgGray200.$ });
|
|
17454
17430
|
}
|
|
17455
17431
|
function FieldGroup(props) {
|
|
17456
17432
|
const { title, children, widths: widths2 = [] } = props;
|
|
@@ -17458,7 +17434,7 @@ function FieldGroup(props) {
|
|
|
17458
17434
|
const width = widths2[i] || 1;
|
|
17459
17435
|
return typeof width === `number` ? `${width}fr` : width;
|
|
17460
17436
|
}).join(" ");
|
|
17461
|
-
return /* @__PURE__ */ (0,
|
|
17437
|
+
return /* @__PURE__ */ (0, import_jsx_runtime152.jsx)("div", { css: Css.dg.gap2.gtc(gtc).$, children });
|
|
17462
17438
|
}
|
|
17463
17439
|
var sizes = {
|
|
17464
17440
|
full: "100%",
|
|
@@ -17467,29 +17443,206 @@ var sizes = {
|
|
|
17467
17443
|
sm: "320px"
|
|
17468
17444
|
};
|
|
17469
17445
|
|
|
17470
|
-
// src/forms/
|
|
17471
|
-
var
|
|
17446
|
+
// src/forms/BoundForm.tsx
|
|
17447
|
+
var import_jsx_runtime153 = require("@emotion/react/jsx-runtime");
|
|
17448
|
+
var reactNodePrefix = "reactNode";
|
|
17449
|
+
function BoundForm(props) {
|
|
17450
|
+
const { rows, formState } = props;
|
|
17451
|
+
const tid = useTestIds({}, "boundForm");
|
|
17452
|
+
return /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("div", { ...tid, children: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(FormLines, { labelSuffix: { required: "*" }, width: "full", gap: 4, children: rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(FormRow, { row, formState }, `fieldGroup-${Object.keys(row).join("-")}`)) }) });
|
|
17453
|
+
}
|
|
17454
|
+
function FormRow({ row, formState }) {
|
|
17455
|
+
const tid = useTestIds({}, "boundFormRow");
|
|
17456
|
+
const componentsWithConfig = (0, import_react108.useMemo)(() => {
|
|
17457
|
+
return safeEntries(row).map(([key, fieldFnOrCustomNode]) => {
|
|
17458
|
+
if (typeof fieldFnOrCustomNode === "function" && !isCustomReactNodeKey(key)) {
|
|
17459
|
+
const field = formState[key] ?? fail(`Field ${key.toString()} not found in formState`);
|
|
17460
|
+
const fieldFn = fieldFnOrCustomNode ?? fail(`Field function not defined for key ${key.toLocaleString()}`);
|
|
17461
|
+
const { component, minWidth } = fieldFn(field);
|
|
17462
|
+
return { component, key, minWidth };
|
|
17463
|
+
}
|
|
17464
|
+
return { component: fieldFnOrCustomNode, key };
|
|
17465
|
+
});
|
|
17466
|
+
}, [row, formState]);
|
|
17467
|
+
const isLoading = useComputed(() => formState.loading, [formState]);
|
|
17468
|
+
const itemFlexBasis = 100 / componentsWithConfig.length - 3;
|
|
17469
|
+
return /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("div", { css: Css.df.fww.gap2.$, ...tid, children: componentsWithConfig.map(({ component, key, minWidth }) => /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("div", { css: Css.mw(minWidth).fb(`${itemFlexBasis}%`).fg1.$, children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(LoadingSkeleton, { size: "lg" }) : component }, key.toString())) });
|
|
17470
|
+
}
|
|
17471
|
+
function isCustomReactNodeKey(key) {
|
|
17472
|
+
return key.toString().startsWith(reactNodePrefix);
|
|
17473
|
+
}
|
|
17474
|
+
function boundSelectField(props) {
|
|
17475
|
+
return (field) => ({
|
|
17476
|
+
component: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(BoundSelectField, { field, ...props }),
|
|
17477
|
+
minWidth: "200px"
|
|
17478
|
+
});
|
|
17479
|
+
}
|
|
17480
|
+
function boundMultiSelectField(props) {
|
|
17481
|
+
return (field) => ({
|
|
17482
|
+
component: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(BoundMultiSelectField, { field, ...props }),
|
|
17483
|
+
minWidth: "200px"
|
|
17484
|
+
});
|
|
17485
|
+
}
|
|
17486
|
+
function boundMultilineSelectField(props) {
|
|
17487
|
+
return (field) => ({
|
|
17488
|
+
component: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(BoundMultiLineSelectField, { field, ...props }),
|
|
17489
|
+
minWidth: "200px"
|
|
17490
|
+
});
|
|
17491
|
+
}
|
|
17492
|
+
function boundTextField(props) {
|
|
17493
|
+
return (field) => ({
|
|
17494
|
+
component: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(BoundTextField, { field, ...props }),
|
|
17495
|
+
minWidth: "150px"
|
|
17496
|
+
});
|
|
17497
|
+
}
|
|
17498
|
+
function boundTextAreaField(props) {
|
|
17499
|
+
return (field) => ({
|
|
17500
|
+
component: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(BoundTextAreaField, { field, ...props }),
|
|
17501
|
+
minWidth: "200px"
|
|
17502
|
+
});
|
|
17503
|
+
}
|
|
17504
|
+
function boundNumberField(props) {
|
|
17505
|
+
return (field) => ({
|
|
17506
|
+
component: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(BoundNumberField, { field, ...props }),
|
|
17507
|
+
minWidth: "150px"
|
|
17508
|
+
});
|
|
17509
|
+
}
|
|
17510
|
+
function boundDateField(props) {
|
|
17511
|
+
return (field) => ({
|
|
17512
|
+
component: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(BoundDateField, { field, ...props }),
|
|
17513
|
+
minWidth: "150px"
|
|
17514
|
+
});
|
|
17515
|
+
}
|
|
17516
|
+
function boundDateRangeField(props) {
|
|
17517
|
+
return (field) => ({
|
|
17518
|
+
component: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(BoundDateRangeField, { field, ...props }),
|
|
17519
|
+
minWidth: "150px"
|
|
17520
|
+
});
|
|
17521
|
+
}
|
|
17522
|
+
function boundCheckboxField(props) {
|
|
17523
|
+
return (field) => ({
|
|
17524
|
+
component: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(BoundCheckboxField, { field, ...props }),
|
|
17525
|
+
minWidth: "min-content"
|
|
17526
|
+
});
|
|
17527
|
+
}
|
|
17528
|
+
function boundCheckboxGroupField(props) {
|
|
17529
|
+
return (field) => ({
|
|
17530
|
+
component: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(BoundCheckboxGroupField, { field, ...props }),
|
|
17531
|
+
minWidth: "200px"
|
|
17532
|
+
});
|
|
17533
|
+
}
|
|
17534
|
+
function boundIconCardField(props) {
|
|
17535
|
+
return (field) => ({
|
|
17536
|
+
component: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(BoundIconCardField, { field, ...props }),
|
|
17537
|
+
minWidth: "150px"
|
|
17538
|
+
});
|
|
17539
|
+
}
|
|
17540
|
+
function boundIconCardGroupField(props) {
|
|
17541
|
+
return (field) => ({
|
|
17542
|
+
component: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(BoundIconCardGroupField, { field, ...props }),
|
|
17543
|
+
minWidth: "100%"
|
|
17544
|
+
});
|
|
17545
|
+
}
|
|
17546
|
+
function boundRadioGroupField(props) {
|
|
17547
|
+
return (field) => ({
|
|
17548
|
+
component: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(BoundRadioGroupField, { field, ...props }),
|
|
17549
|
+
minWidth: "200px"
|
|
17550
|
+
});
|
|
17551
|
+
}
|
|
17552
|
+
function boundRichTextField(props) {
|
|
17553
|
+
return (field) => ({
|
|
17554
|
+
component: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(BoundRichTextField, { field, ...props }),
|
|
17555
|
+
minWidth: "200px"
|
|
17556
|
+
});
|
|
17557
|
+
}
|
|
17558
|
+
function boundSwitchField(props) {
|
|
17559
|
+
return (field) => ({
|
|
17560
|
+
component: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(BoundSwitchField, { field, labelStyle: "inline", ...props }),
|
|
17561
|
+
minWidth: "min-content"
|
|
17562
|
+
});
|
|
17563
|
+
}
|
|
17564
|
+
function boundToggleChipGroupField(props) {
|
|
17565
|
+
return (field) => ({
|
|
17566
|
+
component: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(BoundToggleChipGroupField, { field, ...props }),
|
|
17567
|
+
minWidth: "100%"
|
|
17568
|
+
});
|
|
17569
|
+
}
|
|
17570
|
+
function boundTreeSelectField(props) {
|
|
17571
|
+
return (field) => ({
|
|
17572
|
+
component: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(BoundTreeSelectField, { field, ...props }),
|
|
17573
|
+
minWidth: "200px"
|
|
17574
|
+
});
|
|
17575
|
+
}
|
|
17576
|
+
|
|
17577
|
+
// src/forms/BoundSelectAndTextField.tsx
|
|
17578
|
+
var import_jsx_runtime154 = require("@emotion/react/jsx-runtime");
|
|
17579
|
+
function BoundSelectAndTextField(props) {
|
|
17580
|
+
const { selectFieldProps, textFieldProps, compact = true } = props;
|
|
17581
|
+
const tid = useTestIds(props);
|
|
17582
|
+
return /* @__PURE__ */ (0, import_jsx_runtime154.jsxs)(CompoundField, { children: [
|
|
17583
|
+
/* @__PURE__ */ (0, import_jsx_runtime154.jsx)(
|
|
17584
|
+
BoundSelectField,
|
|
17585
|
+
{
|
|
17586
|
+
...tid[defaultTestId(selectFieldProps.label ?? selectFieldProps.field.key)],
|
|
17587
|
+
...selectFieldProps,
|
|
17588
|
+
sizeToContent: true,
|
|
17589
|
+
compact
|
|
17590
|
+
}
|
|
17591
|
+
),
|
|
17592
|
+
/* @__PURE__ */ (0, import_jsx_runtime154.jsx)(
|
|
17593
|
+
BoundTextField,
|
|
17594
|
+
{
|
|
17595
|
+
...tid[defaultTestId(textFieldProps.label ?? textFieldProps.field.key)],
|
|
17596
|
+
...textFieldProps,
|
|
17597
|
+
compact
|
|
17598
|
+
}
|
|
17599
|
+
)
|
|
17600
|
+
] });
|
|
17601
|
+
}
|
|
17602
|
+
|
|
17603
|
+
// src/forms/FormHeading.tsx
|
|
17472
17604
|
var import_jsx_runtime155 = require("@emotion/react/jsx-runtime");
|
|
17605
|
+
function FormHeading(props) {
|
|
17606
|
+
const { title, xss, isFirst = false, ...others } = props;
|
|
17607
|
+
return /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(
|
|
17608
|
+
"h3",
|
|
17609
|
+
{
|
|
17610
|
+
css: {
|
|
17611
|
+
...Css.baseMd.$,
|
|
17612
|
+
// Add space before the heading, but only if it's not first.
|
|
17613
|
+
...!isFirst && Css.mt4.$,
|
|
17614
|
+
...xss
|
|
17615
|
+
},
|
|
17616
|
+
...others,
|
|
17617
|
+
children: title
|
|
17618
|
+
}
|
|
17619
|
+
);
|
|
17620
|
+
}
|
|
17621
|
+
FormHeading.isFormHeading = true;
|
|
17622
|
+
|
|
17623
|
+
// src/forms/StaticField.tsx
|
|
17624
|
+
var import_utils120 = require("@react-aria/utils");
|
|
17625
|
+
var import_jsx_runtime156 = require("@emotion/react/jsx-runtime");
|
|
17473
17626
|
function StaticField(props) {
|
|
17474
17627
|
const { fieldProps } = usePresentationContext();
|
|
17475
17628
|
const { label, labelStyle = fieldProps?.labelStyle ?? "above", value, children } = props;
|
|
17476
17629
|
const tid = useTestIds(props, typeof label === "string" ? defaultTestId(label) : "staticField");
|
|
17477
|
-
const id = (0,
|
|
17478
|
-
return /* @__PURE__ */ (0,
|
|
17479
|
-
/* @__PURE__ */ (0,
|
|
17480
|
-
/* @__PURE__ */ (0,
|
|
17630
|
+
const id = (0, import_utils120.useId)();
|
|
17631
|
+
return /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { css: Css.if(labelStyle === "left").df.jcsb.maxw100.$, ...tid.container, children: [
|
|
17632
|
+
/* @__PURE__ */ (0, import_jsx_runtime156.jsx)("label", { css: Css.db.sm.gray700.mbPx(4).$, htmlFor: id, ...tid.label, children: label }),
|
|
17633
|
+
/* @__PURE__ */ (0, import_jsx_runtime156.jsx)("div", { id, css: Css.smMd.gray900.df.aic.if(labelStyle === "left").w50.$, ...tid, children: value || children })
|
|
17481
17634
|
] });
|
|
17482
17635
|
}
|
|
17483
17636
|
|
|
17484
17637
|
// src/forms/SubmitButton.tsx
|
|
17485
|
-
var
|
|
17638
|
+
var import_jsx_runtime157 = require("@emotion/react/jsx-runtime");
|
|
17486
17639
|
function SubmitButton(props) {
|
|
17487
17640
|
const { form, disabled, onClick, label = "Submit", ...others } = props;
|
|
17488
17641
|
if (typeof onClick === "string") {
|
|
17489
17642
|
throw new Error("SubmitButton.onClick doesn't support strings yet");
|
|
17490
17643
|
}
|
|
17491
17644
|
const dirty = useComputed(() => form.dirty, [form]);
|
|
17492
|
-
return /* @__PURE__ */ (0,
|
|
17645
|
+
return /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
|
|
17493
17646
|
Button,
|
|
17494
17647
|
{
|
|
17495
17648
|
label,
|
|
@@ -17524,6 +17677,7 @@ function SubmitButton(props) {
|
|
|
17524
17677
|
BoundChipSelectField,
|
|
17525
17678
|
BoundDateField,
|
|
17526
17679
|
BoundDateRangeField,
|
|
17680
|
+
BoundForm,
|
|
17527
17681
|
BoundIconCardField,
|
|
17528
17682
|
BoundIconCardGroupField,
|
|
17529
17683
|
BoundMultiLineSelectField,
|
|
@@ -17642,6 +17796,23 @@ function SubmitButton(props) {
|
|
|
17642
17796
|
applyRowFn,
|
|
17643
17797
|
assignDefaultColumnIds,
|
|
17644
17798
|
booleanFilter,
|
|
17799
|
+
boundCheckboxField,
|
|
17800
|
+
boundCheckboxGroupField,
|
|
17801
|
+
boundDateField,
|
|
17802
|
+
boundDateRangeField,
|
|
17803
|
+
boundIconCardField,
|
|
17804
|
+
boundIconCardGroupField,
|
|
17805
|
+
boundMultiSelectField,
|
|
17806
|
+
boundMultilineSelectField,
|
|
17807
|
+
boundNumberField,
|
|
17808
|
+
boundRadioGroupField,
|
|
17809
|
+
boundRichTextField,
|
|
17810
|
+
boundSelectField,
|
|
17811
|
+
boundSwitchField,
|
|
17812
|
+
boundTextAreaField,
|
|
17813
|
+
boundTextField,
|
|
17814
|
+
boundToggleChipGroupField,
|
|
17815
|
+
boundTreeSelectField,
|
|
17645
17816
|
calcColumnSizes,
|
|
17646
17817
|
cardStyle,
|
|
17647
17818
|
checkboxFilter,
|