@homebound/beam 2.121.0 → 2.122.1
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/components/Modal/TestModalContent.js +1 -1
- package/dist/components/PresentationContext.d.ts +1 -0
- package/dist/components/Table/GridTable.d.ts +2 -1
- package/dist/components/Table/GridTable.js +3 -7
- package/dist/components/Table/columns.js +2 -2
- package/dist/components/Table/index.d.ts +2 -2
- package/dist/components/Table/index.js +1 -2
- package/dist/components/Table/simpleHelpers.d.ts +4 -12
- package/dist/components/Table/simpleHelpers.js +3 -8
- package/dist/components/Table/styles.js +1 -1
- package/dist/components/internal/OverlayTrigger.d.ts +1 -1
- package/dist/forms/formStateDomain.d.ts +2 -0
- package/dist/forms/formStateDomain.js +2 -1
- package/dist/inputs/TextFieldBase.js +14 -11
- package/dist/interfaces.d.ts +4 -0
- package/package.json +1 -1
|
@@ -42,7 +42,7 @@ const users = [
|
|
|
42
42
|
{ id: "9", name: "Captain Marvel", role: "Does it all" },
|
|
43
43
|
{ id: "10", name: "Doctor Strange", role: "Doctor" },
|
|
44
44
|
];
|
|
45
|
-
const rows = [Table_1.simpleHeader, ...users.map((u) => ({ kind: "data",
|
|
45
|
+
const rows = [Table_1.simpleHeader, ...users.map((u) => ({ kind: "data", id: u.id, data: u }))];
|
|
46
46
|
const columns = [
|
|
47
47
|
{ header: () => "Name", data: ({ name }) => name },
|
|
48
48
|
{ header: () => "Role", data: ({ role }) => role },
|
|
@@ -232,7 +232,7 @@ declare type GridRowKind<R extends Kinded, P extends R["kind"]> = DiscriminateUn
|
|
|
232
232
|
export declare type GridColumn<R extends Kinded, S = {}> = {
|
|
233
233
|
[K in R["kind"]]: string | GridCellContent | (DiscriminateUnion<R, "kind", K> extends {
|
|
234
234
|
data: infer D;
|
|
235
|
-
} ? (data: D, row: GridRowKind<R, K>, api: GridTableApi<R>) => ReactNode | GridCellContent : (row: GridRowKind<R, K>, api: GridTableApi<R>) => ReactNode | GridCellContent);
|
|
235
|
+
} ? (data: D, row: GridRowKind<R, K>, api: GridTableApi<R>) => ReactNode | GridCellContent : (data: undefined, row: GridRowKind<R, K>, api: GridTableApi<R>) => ReactNode | GridCellContent);
|
|
236
236
|
} & {
|
|
237
237
|
/**
|
|
238
238
|
* The column's width.
|
|
@@ -313,6 +313,7 @@ export declare type GridDataRow<R extends Kinded> = {
|
|
|
313
313
|
children?: GridDataRow<R>[];
|
|
314
314
|
/** Whether to pin this sort to the first/last of its parent's children. */
|
|
315
315
|
pin?: "first" | "last";
|
|
316
|
+
data: unknown;
|
|
316
317
|
} & IfAny<R, {}, DiscriminateUnion<R, "kind", R["kind"]>>;
|
|
317
318
|
declare type IfAny<T, Y, N> = 0 extends 1 & T ? Y : N;
|
|
318
319
|
/** Return the content for a given column def applied to a given row. */
|
|
@@ -237,6 +237,7 @@ function GridTable(props) {
|
|
|
237
237
|
hideLabel: true,
|
|
238
238
|
numberAlignment: "right",
|
|
239
239
|
compact: true,
|
|
240
|
+
errorInTooltip: true,
|
|
240
241
|
// Avoid passing `undefined` as it will unset existing PresentationContext settings
|
|
241
242
|
...(borderless !== undefined ? { borderless } : {}),
|
|
242
243
|
...(typeScale !== undefined ? { typeScale } : {}),
|
|
@@ -641,13 +642,8 @@ function applyRowFn(column, row, api) {
|
|
|
641
642
|
// Usually this is a function to apply against the row, but sometimes it's a hard-coded value, i.e. for headers
|
|
642
643
|
const maybeContent = column[row.kind];
|
|
643
644
|
if (typeof maybeContent === "function") {
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
return maybeContent(row["data"], row["id"], api);
|
|
647
|
-
}
|
|
648
|
-
else {
|
|
649
|
-
return maybeContent(row, api);
|
|
650
|
-
}
|
|
645
|
+
// Auto-destructure data
|
|
646
|
+
return maybeContent(row["data"], row, api);
|
|
651
647
|
}
|
|
652
648
|
else {
|
|
653
649
|
return maybeContent;
|
|
@@ -46,7 +46,7 @@ function selectColumn(columnDef) {
|
|
|
46
46
|
...columnDef,
|
|
47
47
|
};
|
|
48
48
|
return (0, index_1.newMethodMissingProxy)(base, (key) => {
|
|
49
|
-
return (row) => ({ content: (0, jsx_runtime_1.jsx)(SelectToggle_1.SelectToggle, { id: row.id }, void 0) });
|
|
49
|
+
return (data, row) => ({ content: (0, jsx_runtime_1.jsx)(SelectToggle_1.SelectToggle, { id: row.id }, void 0) });
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
52
|
exports.selectColumn = selectColumn;
|
|
@@ -68,7 +68,7 @@ function collapseColumn(columnDef) {
|
|
|
68
68
|
...columnDef,
|
|
69
69
|
};
|
|
70
70
|
return (0, index_1.newMethodMissingProxy)(base, (key) => {
|
|
71
|
-
return (row) => ({ content: (0, jsx_runtime_1.jsx)(CollapseToggle_1.CollapseToggle, { row: row }, void 0) });
|
|
71
|
+
return (data, row) => ({ content: (0, jsx_runtime_1.jsx)(CollapseToggle_1.CollapseToggle, { row: row }, void 0) });
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
74
|
exports.collapseColumn = collapseColumn;
|
|
@@ -8,7 +8,7 @@ export { useGridTableApi } from "./GridTableApi";
|
|
|
8
8
|
export type { GridTableApi } from "./GridTableApi";
|
|
9
9
|
export { RowState, RowStateContext } from "./RowState";
|
|
10
10
|
export * from "./SelectToggle";
|
|
11
|
-
export { simpleDataRows, simpleHeader
|
|
12
|
-
export type {
|
|
11
|
+
export { simpleDataRows, simpleHeader } from "./simpleHelpers";
|
|
12
|
+
export type { SimpleHeaderAndData } from "./simpleHelpers";
|
|
13
13
|
export { SortHeader } from "./SortHeader";
|
|
14
14
|
export { beamFixedStyle, beamFlexibleStyle, beamNestedFixedStyle, beamNestedFlexibleStyle, beamTotalsFixedStyle, beamTotalsFlexibleStyle, cardStyle, condensedStyle, defaultStyle, } from "./styles";
|
|
@@ -10,7 +10,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
10
10
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.defaultStyle = exports.condensedStyle = exports.cardStyle = exports.beamTotalsFlexibleStyle = exports.beamTotalsFixedStyle = exports.beamNestedFlexibleStyle = exports.beamNestedFixedStyle = exports.beamFlexibleStyle = exports.beamFixedStyle = exports.SortHeader = exports.
|
|
13
|
+
exports.defaultStyle = exports.condensedStyle = exports.cardStyle = exports.beamTotalsFlexibleStyle = exports.beamTotalsFixedStyle = exports.beamNestedFlexibleStyle = exports.beamNestedFixedStyle = exports.beamFlexibleStyle = exports.beamFixedStyle = exports.SortHeader = exports.simpleHeader = exports.simpleDataRows = exports.RowStateContext = exports.RowState = exports.useGridTableApi = exports.setGridTableDefaults = exports.setDefaultStyle = exports.GridTable = exports.DESC = exports.ASC = exports.GridSortContext = void 0;
|
|
14
14
|
__exportStar(require("./CollapseToggle"), exports);
|
|
15
15
|
__exportStar(require("./columns"), exports);
|
|
16
16
|
var GridSortContext_1 = require("./GridSortContext");
|
|
@@ -30,7 +30,6 @@ __exportStar(require("./SelectToggle"), exports);
|
|
|
30
30
|
var simpleHelpers_1 = require("./simpleHelpers");
|
|
31
31
|
Object.defineProperty(exports, "simpleDataRows", { enumerable: true, get: function () { return simpleHelpers_1.simpleDataRows; } });
|
|
32
32
|
Object.defineProperty(exports, "simpleHeader", { enumerable: true, get: function () { return simpleHelpers_1.simpleHeader; } });
|
|
33
|
-
Object.defineProperty(exports, "simpleRows", { enumerable: true, get: function () { return simpleHelpers_1.simpleRows; } });
|
|
34
33
|
var SortHeader_1 = require("./SortHeader");
|
|
35
34
|
Object.defineProperty(exports, "SortHeader", { enumerable: true, get: function () { return SortHeader_1.SortHeader; } });
|
|
36
35
|
var styles_1 = require("./styles");
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
import { GridDataRow } from "./GridTable";
|
|
2
|
-
/** A helper for making `Row` type aliases of simple/flat tables that are just header + data. */
|
|
3
|
-
export declare type SimpleHeaderAndDataOf<T> = {
|
|
4
|
-
kind: "header";
|
|
5
|
-
} | ({
|
|
6
|
-
kind: "data";
|
|
7
|
-
} & T);
|
|
8
2
|
/**
|
|
9
3
|
* A helper for making `Row` type aliases of simple/flat tables that are just header + data.
|
|
10
4
|
*
|
|
@@ -12,7 +6,7 @@ export declare type SimpleHeaderAndDataOf<T> = {
|
|
|
12
6
|
* when rows are mobx proxies and we need proxy accesses to happen within the column
|
|
13
7
|
* rendering.
|
|
14
8
|
*/
|
|
15
|
-
export declare type
|
|
9
|
+
export declare type SimpleHeaderAndData<T> = {
|
|
16
10
|
kind: "header";
|
|
17
11
|
} | {
|
|
18
12
|
kind: "data";
|
|
@@ -23,11 +17,9 @@ export declare type SimpleHeaderAndDataWith<T> = {
|
|
|
23
17
|
export declare const simpleHeader: {
|
|
24
18
|
kind: "header";
|
|
25
19
|
id: string;
|
|
20
|
+
data: {};
|
|
26
21
|
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}> | undefined): GridDataRow<R>[];
|
|
30
|
-
/** Like `simpleRows` but for `SimpleHeaderAndDataWith`. */
|
|
31
|
-
export declare function simpleDataRows<R extends SimpleHeaderAndDataWith<D>, D>(data?: Array<D & {
|
|
22
|
+
/** Like `simpleRows` but for `SimpleHeaderAndData`. */
|
|
23
|
+
export declare function simpleDataRows<R extends SimpleHeaderAndData<D>, D>(data?: Array<D & {
|
|
32
24
|
id: string;
|
|
33
25
|
}> | undefined): GridDataRow<R>[];
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.simpleDataRows = exports.
|
|
3
|
+
exports.simpleDataRows = exports.simpleHeader = void 0;
|
|
4
4
|
/** A const for a marker header row. */
|
|
5
|
-
exports.simpleHeader = { kind: "header", id: "header" };
|
|
6
|
-
|
|
7
|
-
// @ts-ignore
|
|
8
|
-
return [exports.simpleHeader, ...data.map((c) => ({ kind: "data", ...c }))];
|
|
9
|
-
}
|
|
10
|
-
exports.simpleRows = simpleRows;
|
|
11
|
-
/** Like `simpleRows` but for `SimpleHeaderAndDataWith`. */
|
|
5
|
+
exports.simpleHeader = { kind: "header", id: "header", data: {} };
|
|
6
|
+
/** Like `simpleRows` but for `SimpleHeaderAndData`. */
|
|
12
7
|
function simpleDataRows(data = []) {
|
|
13
8
|
// @ts-ignore Not sure why this doesn't type-check, something esoteric with the DiscriminateUnion type
|
|
14
9
|
return [exports.simpleHeader, ...data.map((data) => ({ kind: "data", data, id: data.id }))];
|
|
@@ -66,7 +66,7 @@ exports.beamTotalsFixedStyle = {
|
|
|
66
66
|
exports.beamFlexibleStyle = {
|
|
67
67
|
...exports.beamFixedStyle,
|
|
68
68
|
cellCss: Css_1.Css.xs.bgWhite.aic.p2.boxShadow(`inset 0 -1px 0 ${Css_1.Palette.Gray100}`).$,
|
|
69
|
-
presentationSettings: { borderless:
|
|
69
|
+
presentationSettings: { borderless: true, typeScale: "xs", wrap: true },
|
|
70
70
|
};
|
|
71
71
|
exports.beamNestedFlexibleStyle = {
|
|
72
72
|
...exports.beamFlexibleStyle,
|
|
@@ -5,7 +5,7 @@ import { ButtonProps } from "../Button";
|
|
|
5
5
|
import { IconButtonProps } from "../IconButton";
|
|
6
6
|
interface TextButtonTriggerProps extends Pick<ButtonProps, "label" | "variant" | "size" | "icon"> {
|
|
7
7
|
}
|
|
8
|
-
interface IconButtonTriggerProps extends Pick<IconButtonProps, "icon" | "color"> {
|
|
8
|
+
interface IconButtonTriggerProps extends Pick<IconButtonProps, "icon" | "color" | "compact" | "contrast"> {
|
|
9
9
|
}
|
|
10
10
|
export interface OverlayTriggerProps {
|
|
11
11
|
trigger: TextButtonTriggerProps | IconButtonTriggerProps;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare const jan1: Date;
|
|
2
2
|
export declare const jan2: Date;
|
|
3
3
|
export declare const jan10: Date;
|
|
4
|
+
export declare const jan29: Date;
|
|
4
5
|
export declare const dd100: DeweyDecimalClassification;
|
|
5
6
|
export declare const dd200: DeweyDecimalClassification;
|
|
6
7
|
export interface AuthorInput {
|
|
@@ -18,6 +19,7 @@ export interface AuthorInput {
|
|
|
18
19
|
favoriteShapes?: string[] | null;
|
|
19
20
|
isAvailable?: boolean | null;
|
|
20
21
|
animals?: string[] | null;
|
|
22
|
+
bio?: string | null;
|
|
21
23
|
}
|
|
22
24
|
export interface AuthorAddress {
|
|
23
25
|
street?: string | null;
|
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
// by a GraphQL schema for a `saveAuthor` mutation that takes an author
|
|
4
4
|
// plus the author's books.
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.DateOnly = exports.dd200 = exports.dd100 = exports.jan10 = exports.jan2 = exports.jan1 = void 0;
|
|
6
|
+
exports.DateOnly = exports.dd200 = exports.dd100 = exports.jan29 = exports.jan10 = exports.jan2 = exports.jan1 = void 0;
|
|
7
7
|
exports.jan1 = new Date(2020, 0, 1);
|
|
8
8
|
exports.jan2 = new Date(2020, 0, 2);
|
|
9
9
|
exports.jan10 = new Date(2020, 0, 10);
|
|
10
|
+
exports.jan29 = new Date(2020, 0, 29);
|
|
10
11
|
exports.dd100 = { number: "100", category: "Philosophy" };
|
|
11
12
|
exports.dd200 = { number: "200", category: "Religion" };
|
|
12
13
|
class DateOnly {
|
|
@@ -15,12 +15,13 @@ const defaultTestId_1 = require("../utils/defaultTestId");
|
|
|
15
15
|
const useTestIds_1 = require("../utils/useTestIds");
|
|
16
16
|
// Used by both TextField and TextArea
|
|
17
17
|
function TextFieldBase(props) {
|
|
18
|
-
var _a, _b, _c, _d, _e, _f;
|
|
18
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
19
19
|
const { fieldProps } = (0, PresentationContext_1.usePresentationContext)();
|
|
20
20
|
const { label, required, labelProps, hideLabel = (_a = fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.hideLabel) !== null && _a !== void 0 ? _a : false, inputProps, inputRef, inputWrapRef, groupProps, compact = (_b = fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.compact) !== null && _b !== void 0 ? _b : false, errorMsg, helperText, multiline = false, onChange, onBlur, onFocus, xss, endAdornment, startAdornment, inlineLabel, contrast = false, borderless = (_c = fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.borderless) !== null && _c !== void 0 ? _c : false, textAreaMinHeight = 96, clearable = false, tooltip, visuallyDisabled = (_d = fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.visuallyDisabled) !== null && _d !== void 0 ? _d : true, } = props;
|
|
21
21
|
const typeScale = (_e = fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.typeScale) !== null && _e !== void 0 ? _e : "sm";
|
|
22
|
+
const errorInTooltip = (_f = fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.errorInTooltip) !== null && _f !== void 0 ? _f : false;
|
|
22
23
|
const internalProps = props.internalProps || {};
|
|
23
|
-
const { compound = false } = internalProps;
|
|
24
|
+
const { compound = false, forceFocus = false, forceHover = false } = internalProps;
|
|
24
25
|
const errorMessageId = `${inputProps.id}-error`;
|
|
25
26
|
const labelSuffix = (0, labelUtils_1.getLabelSuffix)(required);
|
|
26
27
|
const ElementType = multiline ? "textarea" : "input";
|
|
@@ -51,12 +52,12 @@ function TextFieldBase(props) {
|
|
|
51
52
|
...Css_1.Css.gray900.if(contrast).white.$,
|
|
52
53
|
},
|
|
53
54
|
input: {
|
|
54
|
-
...Css_1.Css.w100.mw0.outline0.br4
|
|
55
|
+
...Css_1.Css.w100.mw0.outline0.fg1.if(multiline).br4.$,
|
|
55
56
|
// Not using Truss's inline `if` statement here because `addIn` properties do not respect the if statement.
|
|
56
57
|
...(!contrast ? Css_1.Css.bgWhite.$ : Css_1.Css.bgGray700.addIn("&::selection", Css_1.Css.bgGray800.$).$),
|
|
57
58
|
},
|
|
58
59
|
hover: Css_1.Css.bgGray100.if(contrast).bgGray600.bGray600.$,
|
|
59
|
-
focus:
|
|
60
|
+
focus: Css_1.Css.bLightBlue700.if(contrast).bLightBlue500.$,
|
|
60
61
|
disabled: visuallyDisabled
|
|
61
62
|
? Css_1.Css.cursorNotAllowed.gray400.bgGray100.if(contrast).gray500.bgGray700.$
|
|
62
63
|
: Css_1.Css.cursorNotAllowed.$,
|
|
@@ -75,10 +76,12 @@ function TextFieldBase(props) {
|
|
|
75
76
|
const onFocusChained = (0, react_aria_1.chain)((e) => {
|
|
76
77
|
e.target.select();
|
|
77
78
|
}, onFocus);
|
|
79
|
+
const showFocus = (isFocused && !inputProps.readOnly) || forceFocus;
|
|
80
|
+
const showHover = (isHovered && !inputProps.disabled && !inputProps.readOnly && !isFocused) || forceHover;
|
|
78
81
|
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ css: fieldStyles.container }, groupProps, focusWithinProps, { children: [label && !inlineLabel && (
|
|
79
82
|
// set `hidden` if being rendered as a compound field
|
|
80
83
|
(0, jsx_runtime_1.jsx)(Label_1.Label, Object.assign({ labelProps: labelProps, hidden: hideLabel || compound, label: label, suffix: labelSuffix, contrast: contrast }, tid.label), void 0)), (0, components_1.maybeTooltip)({
|
|
81
|
-
title: tooltip,
|
|
84
|
+
title: (errorInTooltip && errorMsg) || tooltip,
|
|
82
85
|
placement: "top",
|
|
83
86
|
children: inputProps.readOnly ? ((0, jsx_runtime_1.jsxs)("div", Object.assign({ css: {
|
|
84
87
|
// Use input wrapper to get common styles, but then we need to override some
|
|
@@ -86,19 +89,19 @@ function TextFieldBase(props) {
|
|
|
86
89
|
...(multiline ? Css_1.Css.fdc.aifs.childGap2.$ : Css_1.Css.truncate.$),
|
|
87
90
|
...xss,
|
|
88
91
|
}, "data-readonly": "true" }, tid, { children: [!multiline && inlineLabel && label && !hideLabel && ((0, jsx_runtime_1.jsx)(Label_1.InlineLabel, Object.assign({ labelProps: labelProps, label: label }, tid.label), void 0)), multiline
|
|
89
|
-
? (
|
|
92
|
+
? (_g = inputProps.value) === null || _g === void 0 ? void 0 : _g.split("\n\n").map((p, i) => ((0, jsx_runtime_1.jsx)("p", Object.assign({ css: Css_1.Css.my1.$ }, { children: p.split("\n").map((sentence, j) => ((0, jsx_runtime_1.jsxs)("span", { children: [sentence, (0, jsx_runtime_1.jsx)("br", {}, void 0)] }, j))) }), i)))
|
|
90
93
|
: inputProps.value] }), void 0)) : ((0, jsx_runtime_1.jsxs)("div", Object.assign({ css: {
|
|
91
94
|
...fieldStyles.inputWrapper,
|
|
92
95
|
...(inputProps.disabled ? fieldStyles.disabled : {}),
|
|
93
|
-
...(
|
|
94
|
-
...(
|
|
96
|
+
...(showFocus ? fieldStyles.focus : {}),
|
|
97
|
+
...(showHover ? fieldStyles.hover : {}),
|
|
95
98
|
...(errorMsg ? fieldStyles.error : {}),
|
|
96
99
|
...Css_1.Css.if(multiline).aifs.px0.mhPx(textAreaMinHeight).$,
|
|
97
100
|
} }, hoverProps, { ref: inputWrapRef }, { children: [!multiline && inlineLabel && label && !hideLabel && ((0, jsx_runtime_1.jsx)(Label_1.InlineLabel, Object.assign({ labelProps: labelProps, label: label }, tid.label), void 0)), !multiline && startAdornment && (0, jsx_runtime_1.jsx)("span", Object.assign({ css: Css_1.Css.df.aic.fs0.br4.pr1.$ }, { children: startAdornment }), void 0), (0, jsx_runtime_1.jsx)(ElementType, Object.assign({}, (0, react_aria_1.mergeProps)(inputProps, { onBlur, onFocus: onFocusChained, onChange: onDomChange }, { "aria-invalid": Boolean(errorMsg), ...(hideLabel ? { "aria-label": label } : {}) }), (errorMsg ? { "aria-errormessage": errorMessageId } : {}), { ref: fieldRef, rows: multiline ? 1 : undefined, css: {
|
|
98
101
|
...fieldStyles.input,
|
|
99
102
|
...(inputProps.disabled ? fieldStyles.disabled : {}),
|
|
100
|
-
...(
|
|
101
|
-
...(multiline ? Css_1.Css.h100.p1.add("resize", "none")
|
|
103
|
+
...(showHover ? fieldStyles.hover : {}),
|
|
104
|
+
...(multiline ? Css_1.Css.h100.p1.add("resize", "none").$ : Css_1.Css.truncate.$),
|
|
102
105
|
...xss,
|
|
103
106
|
} }, tid), void 0), isFocused && clearable && onChange && inputProps.value && ((0, jsx_runtime_1.jsx)(components_1.IconButton, { icon: "xCircle", color: Css_1.Palette.Gray700, onClick: () => {
|
|
104
107
|
var _a;
|
|
@@ -106,6 +109,6 @@ function TextFieldBase(props) {
|
|
|
106
109
|
// Reset focus to input element
|
|
107
110
|
(_a = fieldRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
108
111
|
} }, void 0)), !multiline && endAdornment && (0, jsx_runtime_1.jsx)("span", Object.assign({ css: Css_1.Css.df.aic.pl1.fs0.$ }, { children: endAdornment }), void 0)] }), void 0)),
|
|
109
|
-
}), errorMsg && !compound && (0, jsx_runtime_1.jsx)(ErrorMessage_1.ErrorMessage, Object.assign({ id: errorMessageId, errorMsg: errorMsg }, tid.errorMsg), void 0), helperText && !compound && (0, jsx_runtime_1.jsx)(HelperText_1.HelperText, Object.assign({ helperText: helperText }, tid.helperText), void 0)] }), void 0));
|
|
112
|
+
}), errorMsg && !compound && !errorInTooltip && ((0, jsx_runtime_1.jsx)(ErrorMessage_1.ErrorMessage, Object.assign({ id: errorMessageId, errorMsg: errorMsg }, tid.errorMsg), void 0)), helperText && !compound && (0, jsx_runtime_1.jsx)(HelperText_1.HelperText, Object.assign({ helperText: helperText }, tid.helperText), void 0)] }), void 0));
|
|
110
113
|
}
|
|
111
114
|
exports.TextFieldBase = TextFieldBase;
|
package/dist/interfaces.d.ts
CHANGED
|
@@ -52,4 +52,8 @@ export interface TextFieldInternalProps {
|
|
|
52
52
|
* This is explicitly an internal property that is not exposed to any field's API.
|
|
53
53
|
*/
|
|
54
54
|
compound?: boolean;
|
|
55
|
+
/** Forces focus styles for storybook purposes */
|
|
56
|
+
forceFocus?: true;
|
|
57
|
+
/** Forces hover styles for storybook purposes */
|
|
58
|
+
forceHover?: boolean;
|
|
55
59
|
}
|