@equinor/apollo-components 3.3.0-beta.0 → 3.3.0-beta.2
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.d.ts +19 -1
- package/dist/index.js +6 -9
- package/dist/index.mjs +4 -9
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { CellProps, TypographyProps as TypographyProps$1 } from '@equinor/eds-co
|
|
|
8
8
|
import { ColumnDef as ColumnDef$1 } from '@tanstack/table-core';
|
|
9
9
|
import { SetRequired } from 'type-fest';
|
|
10
10
|
import { TableOptions } from '@tanstack/table-core/build/lib/types';
|
|
11
|
+
import { Variants } from '@equinor/eds-core-react/dist/types/components/types';
|
|
11
12
|
import { FieldError } from 'react-hook-form';
|
|
12
13
|
|
|
13
14
|
interface AppShellProps {
|
|
@@ -245,6 +246,20 @@ declare function useSetFormMeta<T extends FormMeta>(): (newValues: Partial<T>) =
|
|
|
245
246
|
declare function removeFormMeta<T extends FormMeta>(withFormMeta: T): Omit<T, keyof FormMeta>;
|
|
246
247
|
declare function addFormMeta<T>(withoutFormMeta: T): T & FormMeta;
|
|
247
248
|
|
|
249
|
+
interface GetHelperTextPropsProps {
|
|
250
|
+
error?: {
|
|
251
|
+
message?: string;
|
|
252
|
+
};
|
|
253
|
+
warning?: {
|
|
254
|
+
message: string;
|
|
255
|
+
};
|
|
256
|
+
helperText?: string;
|
|
257
|
+
}
|
|
258
|
+
interface GetHelperTextProps {
|
|
259
|
+
variant?: Variants;
|
|
260
|
+
helperText?: string;
|
|
261
|
+
helperIcon: JSX.Element | null;
|
|
262
|
+
}
|
|
248
263
|
interface EditableCellBaseProps<T extends FormMeta, Value> extends CellContext<T, Value> {
|
|
249
264
|
/**
|
|
250
265
|
* FieldError object used to overwrite react-hook-form validation result. It is prioritized over
|
|
@@ -286,4 +301,7 @@ declare function EditableTextAreaCell<T extends FormMeta>({ title, error: errorF
|
|
|
286
301
|
|
|
287
302
|
declare function EditableTextFieldCell<T extends FormMeta>({ error: errorFromProps, ...context }: EditableCellBaseProps<T, string>): JSX.Element;
|
|
288
303
|
|
|
289
|
-
|
|
304
|
+
declare const WARNING_PREFIX = "WARNING";
|
|
305
|
+
declare function getHelperTextProps({ error, warning, helperText, }: GetHelperTextPropsProps): GetHelperTextProps;
|
|
306
|
+
|
|
307
|
+
export { AppShell, AppSidebar, CellConfig, CheckboxCell, ChipsCell, ColumnSelect, DataTable, DataTableProps, DynamicCell, EditableCellBaseProps, EditableCheckboxCell, EditableDateCell, EditableDateCellProps, EditableDropdownSingleCell, EditableDropdownSingleCellProps, EditableNumberCell, EditableTextAreaCell, EditableTextFieldCell, FormMeta, GetHelperTextProps, GetHelperTextPropsProps, HTMLPropsRef, HeaderCell, HierarchyCell, InfiniteScrollConfig, Option, PopoverCell, RowConfig, RowSelectionMode, SelectColumnDef, SortConfig, StickyCell, StickyHeaderCell, StyledStickyCell, TableHeader, TableLayout, TableRowWrapper, TableRowWrapperProps, TruncateMode, TypographyCustom, TypographyProps, WARNING_PREFIX, WithoutFormMeta, addFormMeta, capitalizeHeader, getHelperTextProps, leftCellShadow, prependSelectColumn, removeFormMeta, stopPropagation, stringToHslColor, useEditMode, useGetIsNew, useHasRemoteChange, useSetFormMeta };
|
package/dist/index.js
CHANGED
|
@@ -2394,8 +2394,10 @@ __export(src_exports, {
|
|
|
2394
2394
|
StyledStickyCell: () => StyledStickyCell,
|
|
2395
2395
|
TableHeader: () => TableHeader,
|
|
2396
2396
|
TypographyCustom: () => TypographyCustom,
|
|
2397
|
+
WARNING_PREFIX: () => WARNING_PREFIX,
|
|
2397
2398
|
addFormMeta: () => addFormMeta,
|
|
2398
2399
|
capitalizeHeader: () => capitalizeHeader,
|
|
2400
|
+
getHelperTextProps: () => getHelperTextProps,
|
|
2399
2401
|
leftCellShadow: () => leftCellShadow,
|
|
2400
2402
|
prependSelectColumn: () => prependSelectColumn,
|
|
2401
2403
|
removeFormMeta: () => removeFormMeta,
|
|
@@ -3047,7 +3049,6 @@ function TableRow(props) {
|
|
|
3047
3049
|
var _a;
|
|
3048
3050
|
const { row, rowConfig, cellConfig, measureElement, index } = props;
|
|
3049
3051
|
const rowWrapper = rowConfig == null ? void 0 : rowConfig.rowWrapper;
|
|
3050
|
-
console.log("Hello");
|
|
3051
3052
|
const tableRowContent = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3052
3053
|
StyledTableRow,
|
|
3053
3054
|
{
|
|
@@ -3605,7 +3606,7 @@ function getHelperTextProps({
|
|
|
3605
3606
|
if ((_a = error.message) == null ? void 0 : _a.startsWith(WARNING_PREFIX)) {
|
|
3606
3607
|
return {
|
|
3607
3608
|
variant: "warning",
|
|
3608
|
-
helperText: error.message.substring(WARNING_PREFIX.length
|
|
3609
|
+
helperText: error.message.substring(WARNING_PREFIX.length),
|
|
3609
3610
|
helperIcon: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_eds_core_react21.Icon, { data: import_eds_icons8.warning_filled, size: 16 })
|
|
3610
3611
|
};
|
|
3611
3612
|
}
|
|
@@ -3626,12 +3627,6 @@ function getHelperTextProps({
|
|
|
3626
3627
|
helperIcon: null
|
|
3627
3628
|
};
|
|
3628
3629
|
}
|
|
3629
|
-
function stopPropagation2(handler) {
|
|
3630
|
-
return (e) => {
|
|
3631
|
-
e.stopPropagation();
|
|
3632
|
-
handler(e);
|
|
3633
|
-
};
|
|
3634
|
-
}
|
|
3635
3630
|
|
|
3636
3631
|
// src/form-cells/EditableDateCell.tsx
|
|
3637
3632
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
@@ -3913,7 +3908,7 @@ function EditableTextAreaCell(_a) {
|
|
|
3913
3908
|
ref
|
|
3914
3909
|
}, field), getHelperTextProps({ error: errorFromProps != null ? errorFromProps : error }))
|
|
3915
3910
|
),
|
|
3916
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(IconButton, { variant: "ghost_icon", onClick:
|
|
3911
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(IconButton, { variant: "ghost_icon", onClick: stopPropagation(openDialog), children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_eds_core_react26.Icon, { data: import_eds_icons9.arrow_up, size: 24, style: { transform: "rotateZ(45deg)" } }) })
|
|
3917
3912
|
]
|
|
3918
3913
|
}
|
|
3919
3914
|
),
|
|
@@ -4073,8 +4068,10 @@ var InlineTextField3 = (0, import_styled_components20.default)(import_eds_core_r
|
|
|
4073
4068
|
StyledStickyCell,
|
|
4074
4069
|
TableHeader,
|
|
4075
4070
|
TypographyCustom,
|
|
4071
|
+
WARNING_PREFIX,
|
|
4076
4072
|
addFormMeta,
|
|
4077
4073
|
capitalizeHeader,
|
|
4074
|
+
getHelperTextProps,
|
|
4078
4075
|
leftCellShadow,
|
|
4079
4076
|
prependSelectColumn,
|
|
4080
4077
|
removeFormMeta,
|
package/dist/index.mjs
CHANGED
|
@@ -3010,7 +3010,6 @@ function TableRow(props) {
|
|
|
3010
3010
|
var _a;
|
|
3011
3011
|
const { row, rowConfig, cellConfig, measureElement, index } = props;
|
|
3012
3012
|
const rowWrapper = rowConfig == null ? void 0 : rowConfig.rowWrapper;
|
|
3013
|
-
console.log("Hello");
|
|
3014
3013
|
const tableRowContent = /* @__PURE__ */ jsx14(
|
|
3015
3014
|
StyledTableRow,
|
|
3016
3015
|
{
|
|
@@ -3568,7 +3567,7 @@ function getHelperTextProps({
|
|
|
3568
3567
|
if ((_a = error.message) == null ? void 0 : _a.startsWith(WARNING_PREFIX)) {
|
|
3569
3568
|
return {
|
|
3570
3569
|
variant: "warning",
|
|
3571
|
-
helperText: error.message.substring(WARNING_PREFIX.length
|
|
3570
|
+
helperText: error.message.substring(WARNING_PREFIX.length),
|
|
3572
3571
|
helperIcon: /* @__PURE__ */ jsx22(Icon7, { data: warning_filled, size: 16 })
|
|
3573
3572
|
};
|
|
3574
3573
|
}
|
|
@@ -3589,12 +3588,6 @@ function getHelperTextProps({
|
|
|
3589
3588
|
helperIcon: null
|
|
3590
3589
|
};
|
|
3591
3590
|
}
|
|
3592
|
-
function stopPropagation2(handler) {
|
|
3593
|
-
return (e) => {
|
|
3594
|
-
e.stopPropagation();
|
|
3595
|
-
handler(e);
|
|
3596
|
-
};
|
|
3597
|
-
}
|
|
3598
3591
|
|
|
3599
3592
|
// src/form-cells/EditableDateCell.tsx
|
|
3600
3593
|
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
@@ -3876,7 +3869,7 @@ function EditableTextAreaCell(_a) {
|
|
|
3876
3869
|
ref
|
|
3877
3870
|
}, field), getHelperTextProps({ error: errorFromProps != null ? errorFromProps : error }))
|
|
3878
3871
|
),
|
|
3879
|
-
/* @__PURE__ */ jsx27(IconButton, { variant: "ghost_icon", onClick:
|
|
3872
|
+
/* @__PURE__ */ jsx27(IconButton, { variant: "ghost_icon", onClick: stopPropagation(openDialog), children: /* @__PURE__ */ jsx27(Icon8, { data: arrow_up, size: 24, style: { transform: "rotateZ(45deg)" } }) })
|
|
3880
3873
|
]
|
|
3881
3874
|
}
|
|
3882
3875
|
),
|
|
@@ -4035,8 +4028,10 @@ export {
|
|
|
4035
4028
|
StyledStickyCell,
|
|
4036
4029
|
TableHeader,
|
|
4037
4030
|
TypographyCustom,
|
|
4031
|
+
WARNING_PREFIX,
|
|
4038
4032
|
addFormMeta,
|
|
4039
4033
|
capitalizeHeader,
|
|
4034
|
+
getHelperTextProps,
|
|
4040
4035
|
leftCellShadow,
|
|
4041
4036
|
prependSelectColumn,
|
|
4042
4037
|
removeFormMeta,
|