@trackunit/custom-field-components 1.7.160 → 1.7.164
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/index.cjs.js
CHANGED
|
@@ -246,7 +246,7 @@ const DropdownCustomField = ({ defaultValue, "data-testid": dataTestId, onChange
|
|
|
246
246
|
/**
|
|
247
247
|
* Modal for adding a new string list field
|
|
248
248
|
*/
|
|
249
|
-
const AddStringListField = ({ id, label, isEditing, setIsEditing, onAdd }) => {
|
|
249
|
+
const AddStringListField = ({ id, label, isEditing, setIsEditing, onAdd, }) => {
|
|
250
250
|
const modal = reactModal.useModal({
|
|
251
251
|
isOpen: isEditing,
|
|
252
252
|
onClose: () => {
|
package/index.esm.js
CHANGED
|
@@ -244,7 +244,7 @@ const DropdownCustomField = ({ defaultValue, "data-testid": dataTestId, onChange
|
|
|
244
244
|
/**
|
|
245
245
|
* Modal for adding a new string list field
|
|
246
246
|
*/
|
|
247
|
-
const AddStringListField = ({ id, label, isEditing, setIsEditing, onAdd }) => {
|
|
247
|
+
const AddStringListField = ({ id, label, isEditing, setIsEditing, onAdd, }) => {
|
|
248
248
|
const modal = useModal({
|
|
249
249
|
isOpen: isEditing,
|
|
250
250
|
onClose: () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/custom-field-components",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.164",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -10,15 +10,15 @@
|
|
|
10
10
|
"react": "19.0.0",
|
|
11
11
|
"react-hook-form": "7.62.0",
|
|
12
12
|
"react-select": "^5.10.2",
|
|
13
|
-
"@trackunit/react-form-components": "1.8.
|
|
14
|
-
"@trackunit/shared-utils": "1.9.
|
|
15
|
-
"@trackunit/custom-field-api": "1.7.
|
|
16
|
-
"@trackunit/iris-app-runtime-core": "1.8.
|
|
17
|
-
"@trackunit/react-components": "1.10.
|
|
18
|
-
"@trackunit/react-modal": "1.8.
|
|
19
|
-
"@trackunit/react-core-hooks": "1.7.
|
|
20
|
-
"@trackunit/i18n-library-translation": "1.7.
|
|
21
|
-
"@trackunit/iris-app-runtime-core-api": "1.7.
|
|
13
|
+
"@trackunit/react-form-components": "1.8.161",
|
|
14
|
+
"@trackunit/shared-utils": "1.9.110",
|
|
15
|
+
"@trackunit/custom-field-api": "1.7.146",
|
|
16
|
+
"@trackunit/iris-app-runtime-core": "1.8.120",
|
|
17
|
+
"@trackunit/react-components": "1.10.86",
|
|
18
|
+
"@trackunit/react-modal": "1.8.150",
|
|
19
|
+
"@trackunit/react-core-hooks": "1.7.124",
|
|
20
|
+
"@trackunit/i18n-library-translation": "1.7.131",
|
|
21
|
+
"@trackunit/iris-app-runtime-core-api": "1.7.120"
|
|
22
22
|
},
|
|
23
23
|
"module": "./index.esm.js",
|
|
24
24
|
"main": "./index.cjs.js",
|
package/src/CustomField.d.ts
CHANGED
|
@@ -71,5 +71,5 @@ export declare const useCustomFieldResolver: ({ field, definition, register, set
|
|
|
71
71
|
* validation rules, and form registration functions from react-hook-form.
|
|
72
72
|
* @returns {ReactElement | null} - The resolved custom field component or null if the field cannot be resolved.
|
|
73
73
|
*/
|
|
74
|
-
export declare const CustomField: (props: CustomFieldProps) => ReactElement
|
|
74
|
+
export declare const CustomField: (props: CustomFieldProps) => ReactElement | null;
|
|
75
75
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReactElement } from "react";
|
|
1
2
|
interface AddStringListFieldProps {
|
|
2
3
|
id: string;
|
|
3
4
|
label: string;
|
|
@@ -8,5 +9,5 @@ interface AddStringListFieldProps {
|
|
|
8
9
|
/**
|
|
9
10
|
* Modal for adding a new string list field
|
|
10
11
|
*/
|
|
11
|
-
export declare const AddStringListField: ({ id, label, isEditing, setIsEditing, onAdd }: AddStringListFieldProps) =>
|
|
12
|
+
export declare const AddStringListField: ({ id, label, isEditing, setIsEditing, onAdd, }: AddStringListFieldProps) => ReactElement;
|
|
12
13
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CommonProps } from "@trackunit/react-components";
|
|
2
|
+
import { ReactElement } from "react";
|
|
2
3
|
import { Control, FieldValues, RegisterOptions, UseFormRegister, UseFormSetValue } from "react-hook-form";
|
|
3
4
|
export interface StringListFieldProps extends CommonProps {
|
|
4
5
|
defaultValue?: Array<string>;
|
|
@@ -16,4 +17,4 @@ export interface StringListFieldProps extends CommonProps {
|
|
|
16
17
|
/**
|
|
17
18
|
* A custom field that displays a list of strings.
|
|
18
19
|
*/
|
|
19
|
-
export declare const StringListField: ({ defaultValue, label, description, disabled, validationRules, id, control, register, setValue, "data-testid": dataTestId, ...props }: StringListFieldProps) =>
|
|
20
|
+
export declare const StringListField: ({ defaultValue, label, description, disabled, validationRules, id, control, register, setValue, "data-testid": dataTestId, ...props }: StringListFieldProps) => ReactElement;
|
package/src/translation.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { NamespaceTransProps, TransForLibs, TranslationResource } from "@trackunit/i18n-library-translation";
|
|
1
|
+
import { NamespaceTransProps, TransForLibs, TranslationResource, useNamespaceTranslation } from "@trackunit/i18n-library-translation";
|
|
2
|
+
import { ReactElement } from "react";
|
|
2
3
|
import defaultTranslations from "./locales/en/translation.json";
|
|
3
4
|
/** A type for all available translation keys in this library */
|
|
4
5
|
export type TranslationKeys = keyof typeof defaultTranslations;
|
|
@@ -14,11 +15,7 @@ export declare const translations: TranslationResource<TranslationKeys>;
|
|
|
14
15
|
/**
|
|
15
16
|
* Local useTranslation for this specific library
|
|
16
17
|
*/
|
|
17
|
-
export declare const useTranslation: () =>
|
|
18
|
-
t: TransForLibs<"customfield.stringlistfield.add" | "customfield.stringlistfield.addField.Heading" | "customfield.stringlistfield.addField.InputPlaceholder" | "customfield.stringlistfield.deleteField.Heading" | "customfield.stringlistfield.deleteField.Message" | "customfield.stringlistfield.deleteField.PrimaryActionLabel" | "customfield.stringlistfield.deleteField.SecondaryActionLabel" | "customfield.stringlistfield.discard" | "customfield.stringlistfield.noValuesAddedYet" | "customfield.unit.ACRE" | "customfield.unit.AMPERE" | "customfield.unit.AMPERE_HOUR" | "customfield.unit.ARE" | "customfield.unit.BAR" | "customfield.unit.CELSIUS" | "customfield.unit.CENTIMETRE" | "customfield.unit.CUBIC_FOOT" | "customfield.unit.CUBIC_METRE" | "customfield.unit.DAY" | "customfield.unit.DEGREE_ANGLE" | "customfield.unit.FAHRENHEIT" | "customfield.unit.FOOT" | "customfield.unit.G_FORCE" | "customfield.unit.GALLON_LIQUID" | "customfield.unit.GALLONS_PER_HOUR" | "customfield.unit.GRAM" | "customfield.unit.HECTARE" | "customfield.unit.HERTZ" | "customfield.unit.HOUR" | "customfield.unit.INCH" | "customfield.unit.INCHES_OF_WATER" | "customfield.unit.KILOGRAM" | "customfield.unit.KILOGRAM_PER_HOUR" | "customfield.unit.KILOGRAM_PER_SECOND" | "customfield.unit.KILOMETRE" | "customfield.unit.KILOMETRE_PER_HOUR" | "customfield.unit.KILOPASCAL" | "customfield.unit.KILOWATT" | "customfield.unit.KILOWATT_HOUR" | "customfield.unit.LITRE" | "customfield.unit.LITRES_PER_HOUR" | "customfield.unit.METRE" | "customfield.unit.METRE_PER_SECOND" | "customfield.unit.METRE_PER_SECOND_SQUARED" | "customfield.unit.METRIC_TON" | "customfield.unit.MILE" | "customfield.unit.MILE_PER_HOUR" | "customfield.unit.MILLIMETRE" | "customfield.unit.MILLISECOND" | "customfield.unit.MINUTE" | "customfield.unit.MONTH" | "customfield.unit.NEWTON" | "customfield.unit.OUNCE" | "customfield.unit.PASCAL" | "customfield.unit.PERCENT" | "customfield.unit.POUND" | "customfield.unit.POUND_PER_HOUR" | "customfield.unit.POUND_PER_SECOND" | "customfield.unit.POUND_PER_SQUARE_INCH" | "customfield.unit.REVOLUTIONS_PER_MINUTE" | "customfield.unit.SECOND" | "customfield.unit.SQUARE_FOOT" | "customfield.unit.SQUARE_KILOMETRE" | "customfield.unit.SQUARE_METRE" | "customfield.unit.TON" | "customfield.unit.US_TON" | "customfield.unit.VOLT" | "customfield.unit.VOLT_AMPERE" | "customfield.unit.WATT" | "customfield.unit.WEEK" | "customfield.unit.YARD" | "customfield.unit.YEAR">;
|
|
19
|
-
i18n: import("i18next").i18n;
|
|
20
|
-
ready: boolean;
|
|
21
|
-
};
|
|
18
|
+
export declare const useTranslation: () => ReturnType<typeof useNamespaceTranslation<TranslationKeys>>;
|
|
22
19
|
/**
|
|
23
20
|
* Type of the t function for the local useTranslation for this specific library
|
|
24
21
|
*/
|
|
@@ -26,7 +23,7 @@ export type TranslationFunction = TransForLibs<TranslationKeys>;
|
|
|
26
23
|
/**
|
|
27
24
|
* Trans for this specific library.
|
|
28
25
|
*/
|
|
29
|
-
export declare const Trans: (props: NamespaceTransProps<TranslationKeys>) =>
|
|
26
|
+
export declare const Trans: (props: NamespaceTransProps<TranslationKeys>) => ReactElement;
|
|
30
27
|
/**
|
|
31
28
|
* Registers the translations for this library
|
|
32
29
|
*/
|