@opengeoweb/form-fields 9.20.2 → 9.22.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/form-fields",
3
- "version": "9.20.2",
3
+ "version": "9.22.0",
4
4
  "description": "GeoWeb form-fields library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -8,12 +8,14 @@
8
8
  "url": "git@gitlab.com:opengeoweb/opengeoweb.git"
9
9
  },
10
10
  "dependencies": {
11
- "@mui/material": "~5.15.11",
11
+ "@mui/material": "^5.16.0",
12
12
  "@opengeoweb/theme": "*",
13
13
  "react-hook-form": "^7.50.1",
14
14
  "@mui/x-date-pickers": "^6.18.5",
15
15
  "lodash": "^4.17.21",
16
- "@opengeoweb/shared": "9.20.2"
16
+ "@opengeoweb/shared": "9.22.0",
17
+ "react-i18next": "^14.1.2",
18
+ "i18next": "^23.11.5"
17
19
  },
18
20
  "peerDependencies": {
19
21
  "react": "18"
package/src/index.d.ts CHANGED
@@ -1,2 +1,5 @@
1
+ import formFieldsTranslations from '../locales/formFields.json';
1
2
  export * from './lib/components';
2
3
  export * from './lib/hooks/useDraftFormHelpers/useDraftFormHelpers';
4
+ export { FORM_FIELDS_NAMESPACE } from './lib/utils/i18n';
5
+ export { formFieldsTranslations };
@@ -13,3 +13,6 @@ export interface FormFieldsWrapperProps {
13
13
  isDarkTheme?: boolean;
14
14
  }
15
15
  export declare const FormFieldsWrapper: React.FC<FormFieldsWrapperProps>;
16
+ export declare const FormFieldsI18nProvider: React.FC<{
17
+ children?: React.ReactNode;
18
+ }>;
@@ -8,5 +8,5 @@ export * from './ReactHookFormDateTime';
8
8
  export { default as ReactHookFormProvider } from './ReactHookFormProvider';
9
9
  export { default as ReactHookFormHiddenInput } from './ReactHookFormHiddenInput';
10
10
  export { defaultFormOptions } from './ReactHookFormProvider';
11
- export { errorMessages, isMaximumOneDrawing, hasValidGeometry, isGeometryDirty, isValidGeoJsonCoordinates, hasIntersectionWithFIR, isValidMax, isValidMin, isInteger, hasMulitpleIntersections, isLatitude, isLongitude, isNonOrBothCoordinates, isEmpty, isXHoursAfter, isXHoursBefore, } from './utils';
11
+ export { errorMessages, isMaximumOneDrawing, hasValidGeometry, isGeometryDirty, isValidGeoJsonCoordinates, hasIntersectionWithFIR, countIntersectionPoints, isValidMax, isValidMin, isInteger, hasMulitpleIntersections, isLatitude, isLongitude, isNonOrBothCoordinates, isEmpty, isXHoursAfter, isXHoursBefore, } from './utils';
12
12
  export { getDeepProperty } from './formUtils';
@@ -1,3 +1,4 @@
1
+ import { Polygon } from 'geojson';
1
2
  export declare const defaultProps: {
2
3
  shouldUnregister: boolean;
3
4
  };
@@ -29,6 +30,7 @@ export declare const isValidGeoJsonCoordinates: (geojson: GeoJSON.FeatureCollect
29
30
  export declare const isMaximumOneDrawing: (geojson: GeoJSON.FeatureCollection) => boolean;
30
31
  export declare const hasIntersectionWithFIR: (geojson: GeoJSON.FeatureCollection, intersection: GeoJSON.FeatureCollection) => boolean;
31
32
  export declare const hasMulitpleIntersections: (geojson: GeoJSON.FeatureCollection) => boolean;
33
+ export declare const countIntersectionPoints: (geojson: GeoJSON.FeatureCollection<Polygon>, intersection: GeoJSON.FeatureCollection<Polygon>) => number;
32
34
  export declare const isGeometryDirty: (geoJSON?: GeoJSON.FeatureCollection | null, formGeoJSON?: GeoJSON.FeatureCollection | null) => boolean;
33
35
  export declare const isInteger: (value: number) => boolean;
34
36
  export declare const isNumeric: (value: any) => boolean;
@@ -0,0 +1,4 @@
1
+ import i18n from 'i18next';
2
+ export declare const FORM_FIELDS_NAMESPACE = "form-fields";
3
+ export declare const translateKeyOutsideComponents: (key: string, params?: Record<string, string | number> | undefined) => string;
4
+ export { i18n };