@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.
@@ -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<HTMLDivElement>>;
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 { TimePicker } from '@mantine/dates';
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 = (newValue) => {
6
+ const handleChange = (event) => {
7
7
  if (onChange) {
8
- const syntheticEvent = {
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(TimePicker, { ref: ref, label: field.label, value: value ? String(value) : '', onChange: handleChange, onBlur: onBlur, name: name || field.name, error: error?.message, disabled: field.disabled, withDropdown: true, minutesStep: 5, clearable: true }));
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 proper symbol
126
- // Replace non-breaking spaces (U+00A0) with regular spaces to prevent
127
- // encoding corruption when CSV is opened in Excel with non-UTF-8 encoding
128
- return new Intl.NumberFormat('en-ZA', {
129
- style: 'currency',
130
- currency: 'ZAR',
131
- minimumFractionDigits: 2,
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' | 'grid-no-grow';
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.298",
4
+ "version": "0.8.300",
5
5
  "publishConfig": {
6
6
  "access": "public",
7
7
  "provenance": false