@pagamio/frontend-commons-lib 0.8.298 → 0.8.300
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/lib/form-engine/FormEngine.js +1 -1
- package/lib/form-engine/components/inputs/time-input/TimeInput.d.ts +1 -1
- package/lib/form-engine/components/inputs/time-input/TimeInput.js +4 -8
- package/lib/pagamio-table/data-table/exportUtils.js +7 -11
- package/lib/pagamio-table/data-table/types.d.ts +1 -1
- package/package.json +1 -1
|
@@ -74,7 +74,7 @@ const FormEngine = ({ fields, onSubmit, initialValues, layout = 'vertical', isNo
|
|
|
74
74
|
}, [allFields, persistenceKey, saveFormData]);
|
|
75
75
|
// Expose form control methods via ref
|
|
76
76
|
useEffect(() => {
|
|
77
|
-
if (formRef) {
|
|
77
|
+
if (formRef && 'current' in formRef) {
|
|
78
78
|
formRef.current = {
|
|
79
79
|
reset: () => reset(getEffectiveInitialValues()),
|
|
80
80
|
setValue: (name, value) => setValue(name, value),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { InputProps } from '../../../types';
|
|
3
|
-
declare const TimeInput: React.ForwardRefExoticComponent<Omit<InputProps, "ref"> & React.RefAttributes<
|
|
3
|
+
declare const TimeInput: React.ForwardRefExoticComponent<Omit<InputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
4
4
|
export default TimeInput;
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { TimeInput as MantineTimeInput } from '@mantine/dates';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
const TimeInput = React.forwardRef(({ field, error, ...props }, ref) => {
|
|
5
5
|
const { value, onChange, onBlur, name } = props;
|
|
6
|
-
const handleChange = (
|
|
6
|
+
const handleChange = (event) => {
|
|
7
7
|
if (onChange) {
|
|
8
|
-
|
|
9
|
-
target: { value: newValue, name: name || field.name },
|
|
10
|
-
currentTarget: { value: newValue, name: name || field.name },
|
|
11
|
-
};
|
|
12
|
-
onChange(syntheticEvent);
|
|
8
|
+
onChange(event);
|
|
13
9
|
}
|
|
14
10
|
};
|
|
15
|
-
return (_jsx(
|
|
11
|
+
return (_jsx(MantineTimeInput, { ref: ref, label: field.label, value: value ? String(value) : '', onChange: handleChange, onBlur: onBlur, name: name || field.name, error: error?.message, disabled: field.disabled }));
|
|
16
12
|
});
|
|
17
13
|
export default TimeInput;
|
|
@@ -122,17 +122,13 @@ const formatUrlString = (value) => {
|
|
|
122
122
|
};
|
|
123
123
|
const formatNumberValue = (value, columnKey) => {
|
|
124
124
|
if (columnKey && (columnKey.toLowerCase().includes('amount') || columnKey.toLowerCase().includes('price'))) {
|
|
125
|
-
// Format as currency with
|
|
126
|
-
//
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
maximumFractionDigits: 2,
|
|
133
|
-
})
|
|
134
|
-
.format(value)
|
|
135
|
-
.replace(/\u00A0/g, ' ');
|
|
125
|
+
// Format as currency with R symbol and en-US number formatting
|
|
126
|
+
// Uses period for decimal and comma for thousands: R 1,121.00
|
|
127
|
+
return ('R ' +
|
|
128
|
+
new Intl.NumberFormat('en-US', {
|
|
129
|
+
minimumFractionDigits: 2,
|
|
130
|
+
maximumFractionDigits: 2,
|
|
131
|
+
}).format(value));
|
|
136
132
|
}
|
|
137
133
|
return value.toString();
|
|
138
134
|
};
|
|
@@ -160,7 +160,7 @@ export interface PagamioTableProps<T extends Record<string, any>> {
|
|
|
160
160
|
positionActionsColumn?: 'first' | 'last';
|
|
161
161
|
renderTopToolbarCustomActions?: MRT_TableOptions<T>['renderTopToolbarCustomActions'];
|
|
162
162
|
renderBottomToolbarCustomActions?: MRT_TableOptions<T>['renderBottomToolbarCustomActions'];
|
|
163
|
-
layoutMode?: 'semantic' | 'grid'
|
|
163
|
+
layoutMode?: 'semantic' | 'grid';
|
|
164
164
|
defaultColumn?: Partial<MRT_ColumnDef<T>>;
|
|
165
165
|
mantineTableOptions?: Partial<MRT_TableOptions<T>>;
|
|
166
166
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pagamio/frontend-commons-lib",
|
|
3
3
|
"description": "Pagamio library for Frontend reusable components like the form engine and table container",
|
|
4
|
-
"version": "0.8.
|
|
4
|
+
"version": "0.8.300",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
7
7
|
"provenance": false
|