@trackunit/custom-field-components 2.6.17 → 2.6.19

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
@@ -139,7 +139,7 @@ const setupLibraryTranslations = () => {
139
139
  const BooleanCustomField = ({ defaultValue = false, "data-testid": dataTestId = "booleanField", onChange, value = defaultValue, id, setValue, register, validationRules, disabled = false, readOnly = false, label, tip, isInvalid = false, errorMessage, helpAddon, maxLength, helpText, ...rest }) => {
140
140
  const initialValue = value;
141
141
  const renderAsInvalid = isInvalid || Boolean(errorMessage);
142
- const htmlForId = id ? id : "boolean-custom-field-" + sharedUtils.uuidv4();
142
+ const htmlForId = id ? id : `boolean-custom-field-${sharedUtils.uuidv4()}`;
143
143
  const [internalValue, setInternalValue] = react.useState(initialValue);
144
144
  react.useEffect(() => {
145
145
  setInternalValue(value);
@@ -199,7 +199,7 @@ const convertToValueFormat = (value) => {
199
199
  */
200
200
  const DropdownCustomField = ({ defaultValue, "data-testid": dataTestId, onChange, onBlur, id, disabled = false, allValues, multiSelect = false, register, validationRules, setValue, label, tip, errorMessage, helpText, isInvalid = false, helpAddon, }) => {
201
201
  const renderAsInvalid = isInvalid || Boolean(errorMessage);
202
- const htmlFor = id ? id : "dropdown-custom-field-" + sharedUtils.uuidv4();
202
+ const htmlFor = id ? id : `dropdown-custom-field-${sharedUtils.uuidv4()}`;
203
203
  const options = react.useMemo(() => {
204
204
  return allValues ? allValues.map(convertToValueFormat) : [];
205
205
  }, [allValues]);
@@ -564,7 +564,7 @@ const useCustomFieldResolver = ({ field, definition, register, setValue, formSta
564
564
  const value = useValue(uniqueIdentifier, numberValue, control, def, field);
565
565
  const key = def?.key ?? uniqueIdentifier;
566
566
  const fieldError = uniqueIdentifier ? validation.formState.errors[uniqueIdentifier] : undefined;
567
- const errorMessage = fieldError ? fieldError.message + "" : undefined;
567
+ const errorMessage = fieldError ? `${fieldError.message}` : undefined;
568
568
  const { description, title, __typename } = def ?? {};
569
569
  if (!__typename || !def) {
570
570
  return null;
package/index.esm.js CHANGED
@@ -137,7 +137,7 @@ const setupLibraryTranslations = () => {
137
137
  const BooleanCustomField = ({ defaultValue = false, "data-testid": dataTestId = "booleanField", onChange, value = defaultValue, id, setValue, register, validationRules, disabled = false, readOnly = false, label, tip, isInvalid = false, errorMessage, helpAddon, maxLength, helpText, ...rest }) => {
138
138
  const initialValue = value;
139
139
  const renderAsInvalid = isInvalid || Boolean(errorMessage);
140
- const htmlForId = id ? id : "boolean-custom-field-" + uuidv4();
140
+ const htmlForId = id ? id : `boolean-custom-field-${uuidv4()}`;
141
141
  const [internalValue, setInternalValue] = useState(initialValue);
142
142
  useEffect(() => {
143
143
  setInternalValue(value);
@@ -197,7 +197,7 @@ const convertToValueFormat = (value) => {
197
197
  */
198
198
  const DropdownCustomField = ({ defaultValue, "data-testid": dataTestId, onChange, onBlur, id, disabled = false, allValues, multiSelect = false, register, validationRules, setValue, label, tip, errorMessage, helpText, isInvalid = false, helpAddon, }) => {
199
199
  const renderAsInvalid = isInvalid || Boolean(errorMessage);
200
- const htmlFor = id ? id : "dropdown-custom-field-" + uuidv4();
200
+ const htmlFor = id ? id : `dropdown-custom-field-${uuidv4()}`;
201
201
  const options = useMemo(() => {
202
202
  return allValues ? allValues.map(convertToValueFormat) : [];
203
203
  }, [allValues]);
@@ -562,7 +562,7 @@ const useCustomFieldResolver = ({ field, definition, register, setValue, formSta
562
562
  const value = useValue(uniqueIdentifier, numberValue, control, def, field);
563
563
  const key = def?.key ?? uniqueIdentifier;
564
564
  const fieldError = uniqueIdentifier ? validation.formState.errors[uniqueIdentifier] : undefined;
565
- const errorMessage = fieldError ? fieldError.message + "" : undefined;
565
+ const errorMessage = fieldError ? `${fieldError.message}` : undefined;
566
566
  const { description, title, __typename } = def ?? {};
567
567
  if (!__typename || !def) {
568
568
  return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/custom-field-components",
3
- "version": "2.6.17",
3
+ "version": "2.6.19",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -8,15 +8,15 @@
8
8
  },
9
9
  "dependencies": {
10
10
  "react-select": "^5.10.2",
11
- "@trackunit/react-form-components": "2.4.10",
12
- "@trackunit/shared-utils": "1.16.4",
13
- "@trackunit/custom-field-api": "2.7.17",
14
- "@trackunit/iris-app-runtime-core": "1.18.4",
15
- "@trackunit/react-components": "2.6.5",
16
- "@trackunit/react-modal": "2.4.10",
17
- "@trackunit/react-core-hooks": "1.20.6",
18
- "@trackunit/i18n-library-translation": "2.3.6",
19
- "@trackunit/iris-app-runtime-core-api": "1.17.4"
11
+ "@trackunit/react-form-components": "2.4.11",
12
+ "@trackunit/shared-utils": "1.16.5",
13
+ "@trackunit/custom-field-api": "2.7.19",
14
+ "@trackunit/iris-app-runtime-core": "1.18.5",
15
+ "@trackunit/react-components": "2.7.0",
16
+ "@trackunit/react-modal": "2.4.11",
17
+ "@trackunit/react-core-hooks": "1.20.7",
18
+ "@trackunit/i18n-library-translation": "2.3.7",
19
+ "@trackunit/iris-app-runtime-core-api": "1.17.5"
20
20
  },
21
21
  "peerDependencies": {
22
22
  "@apollo/client": "^3.13.8",
@@ -1 +0,0 @@
1
- {"version":3,"file":"entry.js","sourceRoot":"","sources":["../../../../../libs/custom-field/components/migrations/entry.ts"],"names":[],"mappings":"","sourcesContent":["export {};\n"]}