@homebound/beam 2.380.1 → 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 +240 -70
- 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 +219 -67
- 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,
|
|
@@ -16816,6 +16834,9 @@ function BoundDateRangeField(props) {
|
|
|
16816
16834
|
) });
|
|
16817
16835
|
}
|
|
16818
16836
|
|
|
16837
|
+
// src/forms/BoundForm.tsx
|
|
16838
|
+
var import_react108 = require("react");
|
|
16839
|
+
|
|
16819
16840
|
// src/forms/BoundIconCardField.tsx
|
|
16820
16841
|
var import_mobx_react7 = require("mobx-react");
|
|
16821
16842
|
var import_jsx_runtime138 = require("@emotion/react/jsx-runtime");
|
|
@@ -17144,35 +17165,9 @@ function BoundRichTextField(props) {
|
|
|
17144
17165
|
) });
|
|
17145
17166
|
}
|
|
17146
17167
|
|
|
17147
|
-
// src/forms/BoundSelectAndTextField.tsx
|
|
17148
|
-
var import_jsx_runtime146 = require("@emotion/react/jsx-runtime");
|
|
17149
|
-
function BoundSelectAndTextField(props) {
|
|
17150
|
-
const { selectFieldProps, textFieldProps, compact = true } = props;
|
|
17151
|
-
const tid = useTestIds(props);
|
|
17152
|
-
return /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)(CompoundField, { children: [
|
|
17153
|
-
/* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
|
|
17154
|
-
BoundSelectField,
|
|
17155
|
-
{
|
|
17156
|
-
...tid[defaultTestId(selectFieldProps.label ?? selectFieldProps.field.key)],
|
|
17157
|
-
...selectFieldProps,
|
|
17158
|
-
sizeToContent: true,
|
|
17159
|
-
compact
|
|
17160
|
-
}
|
|
17161
|
-
),
|
|
17162
|
-
/* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
|
|
17163
|
-
BoundTextField,
|
|
17164
|
-
{
|
|
17165
|
-
...tid[defaultTestId(textFieldProps.label ?? textFieldProps.field.key)],
|
|
17166
|
-
...textFieldProps,
|
|
17167
|
-
compact
|
|
17168
|
-
}
|
|
17169
|
-
)
|
|
17170
|
-
] });
|
|
17171
|
-
}
|
|
17172
|
-
|
|
17173
17168
|
// src/forms/BoundSelectField.tsx
|
|
17174
17169
|
var import_mobx_react14 = require("mobx-react");
|
|
17175
|
-
var
|
|
17170
|
+
var import_jsx_runtime146 = require("@emotion/react/jsx-runtime");
|
|
17176
17171
|
function BoundSelectField(props) {
|
|
17177
17172
|
const {
|
|
17178
17173
|
field,
|
|
@@ -17187,7 +17182,7 @@ function BoundSelectField(props) {
|
|
|
17187
17182
|
...others
|
|
17188
17183
|
} = props;
|
|
17189
17184
|
const testId = useTestIds(props, field.key);
|
|
17190
|
-
return /* @__PURE__ */ (0,
|
|
17185
|
+
return /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(import_mobx_react14.Observer, { children: () => /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
|
|
17191
17186
|
SelectField,
|
|
17192
17187
|
{
|
|
17193
17188
|
label,
|
|
@@ -17218,7 +17213,7 @@ function BoundSelectField(props) {
|
|
|
17218
17213
|
|
|
17219
17214
|
// src/forms/BoundSwitchField.tsx
|
|
17220
17215
|
var import_mobx_react15 = require("mobx-react");
|
|
17221
|
-
var
|
|
17216
|
+
var import_jsx_runtime147 = require("@emotion/react/jsx-runtime");
|
|
17222
17217
|
function BoundSwitchField(props) {
|
|
17223
17218
|
const {
|
|
17224
17219
|
field,
|
|
@@ -17229,7 +17224,7 @@ function BoundSwitchField(props) {
|
|
|
17229
17224
|
...others
|
|
17230
17225
|
} = props;
|
|
17231
17226
|
const testId = useTestIds(props, field.key);
|
|
17232
|
-
return /* @__PURE__ */ (0,
|
|
17227
|
+
return /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(import_mobx_react15.Observer, { children: () => /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
|
|
17233
17228
|
Switch,
|
|
17234
17229
|
{
|
|
17235
17230
|
label,
|
|
@@ -17248,7 +17243,7 @@ function BoundSwitchField(props) {
|
|
|
17248
17243
|
|
|
17249
17244
|
// src/forms/BoundTextAreaField.tsx
|
|
17250
17245
|
var import_mobx_react16 = require("mobx-react");
|
|
17251
|
-
var
|
|
17246
|
+
var import_jsx_runtime148 = require("@emotion/react/jsx-runtime");
|
|
17252
17247
|
function BoundTextAreaField(props) {
|
|
17253
17248
|
const {
|
|
17254
17249
|
field,
|
|
@@ -17261,7 +17256,7 @@ function BoundTextAreaField(props) {
|
|
|
17261
17256
|
...others
|
|
17262
17257
|
} = props;
|
|
17263
17258
|
const testId = useTestIds(props, field.key);
|
|
17264
|
-
return /* @__PURE__ */ (0,
|
|
17259
|
+
return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(import_mobx_react16.Observer, { children: () => /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
|
|
17265
17260
|
TextAreaField,
|
|
17266
17261
|
{
|
|
17267
17262
|
label,
|
|
@@ -17290,7 +17285,7 @@ function BoundTextAreaField(props) {
|
|
|
17290
17285
|
|
|
17291
17286
|
// src/forms/BoundTextField.tsx
|
|
17292
17287
|
var import_mobx_react17 = require("mobx-react");
|
|
17293
|
-
var
|
|
17288
|
+
var import_jsx_runtime149 = require("@emotion/react/jsx-runtime");
|
|
17294
17289
|
function BoundTextField(props) {
|
|
17295
17290
|
const {
|
|
17296
17291
|
field,
|
|
@@ -17303,7 +17298,7 @@ function BoundTextField(props) {
|
|
|
17303
17298
|
...others
|
|
17304
17299
|
} = props;
|
|
17305
17300
|
const testId = useTestIds(props, field.key);
|
|
17306
|
-
return /* @__PURE__ */ (0,
|
|
17301
|
+
return /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(import_mobx_react17.Observer, { children: () => /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
|
|
17307
17302
|
TextField,
|
|
17308
17303
|
{
|
|
17309
17304
|
label,
|
|
@@ -17332,16 +17327,16 @@ function BoundTextField(props) {
|
|
|
17332
17327
|
|
|
17333
17328
|
// src/forms/BoundToggleChipGroupField.tsx
|
|
17334
17329
|
var import_mobx_react18 = require("mobx-react");
|
|
17335
|
-
var
|
|
17330
|
+
var import_jsx_runtime150 = require("@emotion/react/jsx-runtime");
|
|
17336
17331
|
function BoundToggleChipGroupField(props) {
|
|
17337
17332
|
const { field, onChange = (value) => field.set(value), label = defaultLabel(field.key), ...others } = props;
|
|
17338
17333
|
const testId = useTestIds(props, field.key);
|
|
17339
|
-
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 }) });
|
|
17340
17335
|
}
|
|
17341
17336
|
|
|
17342
17337
|
// src/forms/BoundTreeSelectField.tsx
|
|
17343
17338
|
var import_mobx_react19 = require("mobx-react");
|
|
17344
|
-
var
|
|
17339
|
+
var import_jsx_runtime151 = require("@emotion/react/jsx-runtime");
|
|
17345
17340
|
function BoundTreeSelectField(props) {
|
|
17346
17341
|
const {
|
|
17347
17342
|
field,
|
|
@@ -17358,7 +17353,7 @@ function BoundTreeSelectField(props) {
|
|
|
17358
17353
|
...others
|
|
17359
17354
|
} = props;
|
|
17360
17355
|
const testId = useTestIds(props, field.key);
|
|
17361
|
-
return /* @__PURE__ */ (0,
|
|
17356
|
+
return /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(import_mobx_react19.Observer, { children: () => /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
|
|
17362
17357
|
TreeSelectField,
|
|
17363
17358
|
{
|
|
17364
17359
|
label,
|
|
@@ -17387,29 +17382,9 @@ function BoundTreeSelectField(props) {
|
|
|
17387
17382
|
) });
|
|
17388
17383
|
}
|
|
17389
17384
|
|
|
17390
|
-
// src/forms/FormHeading.tsx
|
|
17391
|
-
var import_jsx_runtime153 = require("@emotion/react/jsx-runtime");
|
|
17392
|
-
function FormHeading(props) {
|
|
17393
|
-
const { title, xss, isFirst = false, ...others } = props;
|
|
17394
|
-
return /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
|
|
17395
|
-
"h3",
|
|
17396
|
-
{
|
|
17397
|
-
css: {
|
|
17398
|
-
...Css.baseMd.$,
|
|
17399
|
-
// Add space before the heading, but only if it's not first.
|
|
17400
|
-
...!isFirst && Css.mt4.$,
|
|
17401
|
-
...xss
|
|
17402
|
-
},
|
|
17403
|
-
...others,
|
|
17404
|
-
children: title
|
|
17405
|
-
}
|
|
17406
|
-
);
|
|
17407
|
-
}
|
|
17408
|
-
FormHeading.isFormHeading = true;
|
|
17409
|
-
|
|
17410
17385
|
// src/forms/FormLines.tsx
|
|
17411
17386
|
var import_react107 = require("react");
|
|
17412
|
-
var
|
|
17387
|
+
var import_jsx_runtime152 = require("@emotion/react/jsx-runtime");
|
|
17413
17388
|
function FormLines(props) {
|
|
17414
17389
|
const { inModal } = useModal();
|
|
17415
17390
|
const {
|
|
@@ -17429,7 +17404,7 @@ function FormLines(props) {
|
|
|
17429
17404
|
..."labelLeftFieldWidth" in props ? { labelLeftFieldWidth } : {},
|
|
17430
17405
|
...width === "full" ? { fullWidth: true } : {}
|
|
17431
17406
|
};
|
|
17432
|
-
return /* @__PURE__ */ (0,
|
|
17407
|
+
return /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(PresentationProvider, { fieldProps: newFieldProps, children: /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(
|
|
17433
17408
|
"div",
|
|
17434
17409
|
{
|
|
17435
17410
|
css: {
|
|
@@ -17451,7 +17426,7 @@ function FormLines(props) {
|
|
|
17451
17426
|
) });
|
|
17452
17427
|
}
|
|
17453
17428
|
function FormDivider() {
|
|
17454
|
-
return /* @__PURE__ */ (0,
|
|
17429
|
+
return /* @__PURE__ */ (0, import_jsx_runtime152.jsx)("div", { css: Css.hPx(1).my2.bgGray200.$ });
|
|
17455
17430
|
}
|
|
17456
17431
|
function FieldGroup(props) {
|
|
17457
17432
|
const { title, children, widths: widths2 = [] } = props;
|
|
@@ -17459,7 +17434,7 @@ function FieldGroup(props) {
|
|
|
17459
17434
|
const width = widths2[i] || 1;
|
|
17460
17435
|
return typeof width === `number` ? `${width}fr` : width;
|
|
17461
17436
|
}).join(" ");
|
|
17462
|
-
return /* @__PURE__ */ (0,
|
|
17437
|
+
return /* @__PURE__ */ (0, import_jsx_runtime152.jsx)("div", { css: Css.dg.gap2.gtc(gtc).$, children });
|
|
17463
17438
|
}
|
|
17464
17439
|
var sizes = {
|
|
17465
17440
|
full: "100%",
|
|
@@ -17468,29 +17443,206 @@ var sizes = {
|
|
|
17468
17443
|
sm: "320px"
|
|
17469
17444
|
};
|
|
17470
17445
|
|
|
17471
|
-
// src/forms/
|
|
17472
|
-
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
|
|
17473
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");
|
|
17474
17626
|
function StaticField(props) {
|
|
17475
17627
|
const { fieldProps } = usePresentationContext();
|
|
17476
17628
|
const { label, labelStyle = fieldProps?.labelStyle ?? "above", value, children } = props;
|
|
17477
17629
|
const tid = useTestIds(props, typeof label === "string" ? defaultTestId(label) : "staticField");
|
|
17478
|
-
const id = (0,
|
|
17479
|
-
return /* @__PURE__ */ (0,
|
|
17480
|
-
/* @__PURE__ */ (0,
|
|
17481
|
-
/* @__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 })
|
|
17482
17634
|
] });
|
|
17483
17635
|
}
|
|
17484
17636
|
|
|
17485
17637
|
// src/forms/SubmitButton.tsx
|
|
17486
|
-
var
|
|
17638
|
+
var import_jsx_runtime157 = require("@emotion/react/jsx-runtime");
|
|
17487
17639
|
function SubmitButton(props) {
|
|
17488
17640
|
const { form, disabled, onClick, label = "Submit", ...others } = props;
|
|
17489
17641
|
if (typeof onClick === "string") {
|
|
17490
17642
|
throw new Error("SubmitButton.onClick doesn't support strings yet");
|
|
17491
17643
|
}
|
|
17492
17644
|
const dirty = useComputed(() => form.dirty, [form]);
|
|
17493
|
-
return /* @__PURE__ */ (0,
|
|
17645
|
+
return /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
|
|
17494
17646
|
Button,
|
|
17495
17647
|
{
|
|
17496
17648
|
label,
|
|
@@ -17525,6 +17677,7 @@ function SubmitButton(props) {
|
|
|
17525
17677
|
BoundChipSelectField,
|
|
17526
17678
|
BoundDateField,
|
|
17527
17679
|
BoundDateRangeField,
|
|
17680
|
+
BoundForm,
|
|
17528
17681
|
BoundIconCardField,
|
|
17529
17682
|
BoundIconCardGroupField,
|
|
17530
17683
|
BoundMultiLineSelectField,
|
|
@@ -17643,6 +17796,23 @@ function SubmitButton(props) {
|
|
|
17643
17796
|
applyRowFn,
|
|
17644
17797
|
assignDefaultColumnIds,
|
|
17645
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,
|
|
17646
17816
|
calcColumnSizes,
|
|
17647
17817
|
cardStyle,
|
|
17648
17818
|
checkboxFilter,
|