@trackunit/custom-field-api 1.7.17 → 1.7.20
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 +8 -7
- package/index.esm.js +2 -1
- package/package.json +10 -9
package/index.cjs.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var reactGraphqlHooks = require('@trackunit/react-graphql-hooks');
|
|
4
4
|
var sharedUtils = require('@trackunit/shared-utils');
|
|
5
5
|
var react = require('react');
|
|
6
6
|
var reactCoreHooks = require('@trackunit/react-core-hooks');
|
|
7
|
+
var client = require('@apollo/client');
|
|
7
8
|
var irisAppRuntimeCore = require('@trackunit/iris-app-runtime-core');
|
|
8
9
|
var reactCoreContextsApi = require('@trackunit/react-core-contexts-api');
|
|
9
10
|
|
|
@@ -2211,7 +2212,7 @@ const getCustomFieldDefinitionFromRelevantNode$1 = (node) => getFragmentData(Cus
|
|
|
2211
2212
|
* @returns {UseAllCustomFieldDefinitionsReturnValue} An object containing a loading state and an array of custom field definitions.
|
|
2212
2213
|
*/
|
|
2213
2214
|
const useAllCustomFieldDefinitions = ({ entityType, filterQuery, owners, systemOfMeasurement, onlyEditable, }) => {
|
|
2214
|
-
const { data: definitions, loading } =
|
|
2215
|
+
const { data: definitions, loading } = reactGraphqlHooks.useQuery(GetCustomFieldDefinitionsDocument, {
|
|
2215
2216
|
variables: {
|
|
2216
2217
|
entityType,
|
|
2217
2218
|
systemOfMeasurement,
|
|
@@ -2265,7 +2266,7 @@ const getAllCustomFieldValueAndDefinitionFromRelevantNode = (node) => getFragmen
|
|
|
2265
2266
|
* @returns {UseAllCustomFieldsValueAndDefinitionReturnValue} An object containing a loading state and an array of custom fields and definitions.
|
|
2266
2267
|
*/
|
|
2267
2268
|
const useAllCustomFieldsValueAndDefinition = ({ entityId, entityType, systemOfMeasurement, }) => {
|
|
2268
|
-
const { data: assetFields, loading: loadingAssetFields, refetch: refetchAssetFields, } =
|
|
2269
|
+
const { data: assetFields, loading: loadingAssetFields, refetch: refetchAssetFields, } = reactGraphqlHooks.useQuery(GetCustomFieldsForAssetDocument, {
|
|
2269
2270
|
variables: {
|
|
2270
2271
|
entityId: entityId || "",
|
|
2271
2272
|
systemOfMeasurement,
|
|
@@ -2277,7 +2278,7 @@ const useAllCustomFieldsValueAndDefinition = ({ entityId, entityType, systemOfMe
|
|
|
2277
2278
|
},
|
|
2278
2279
|
},
|
|
2279
2280
|
});
|
|
2280
|
-
const { data: siteFields, loading: loadingSiteFields, refetch: refetchSiteFields, } =
|
|
2281
|
+
const { data: siteFields, loading: loadingSiteFields, refetch: refetchSiteFields, } = reactGraphqlHooks.useQuery(GetCustomFieldsForSiteDocument, {
|
|
2281
2282
|
variables: {
|
|
2282
2283
|
entityId: entityId || "",
|
|
2283
2284
|
systemOfMeasurement,
|
|
@@ -2372,7 +2373,7 @@ const getCustomFieldDefinitionFromRelevantNode = (node) => getFragmentData(Custo
|
|
|
2372
2373
|
*/
|
|
2373
2374
|
const useCustomFieldDefinitions = ({ entityType, filterQuery, owners, systemOfMeasurement, onlyEditable, }) => {
|
|
2374
2375
|
const { irisAppId } = reactCoreHooks.useIrisAppId();
|
|
2375
|
-
const { data: definitions, loading } =
|
|
2376
|
+
const { data: definitions, loading } = reactGraphqlHooks.useQuery(GetCustomFieldDefinitionsForIrisAppDocument, {
|
|
2376
2377
|
variables: {
|
|
2377
2378
|
entityType,
|
|
2378
2379
|
systemOfMeasurement,
|
|
@@ -2433,7 +2434,7 @@ const getCustomFieldValueAndDefinitionFromRelevantNode = (node) => getFragmentDa
|
|
|
2433
2434
|
*/
|
|
2434
2435
|
const useCustomFieldsValueAndDefinition = ({ entityId, entityType, systemOfMeasurement, }) => {
|
|
2435
2436
|
const { irisAppId } = reactCoreHooks.useIrisAppId();
|
|
2436
|
-
const { data: assetFields, loading: loadingAssetFields } =
|
|
2437
|
+
const { data: assetFields, loading: loadingAssetFields } = reactGraphqlHooks.useQuery(GetCustomFieldsForAssetForIrisAppDocument, {
|
|
2437
2438
|
variables: {
|
|
2438
2439
|
entityId: entityId || "",
|
|
2439
2440
|
systemOfMeasurement,
|
|
@@ -2446,7 +2447,7 @@ const useCustomFieldsValueAndDefinition = ({ entityId, entityType, systemOfMeasu
|
|
|
2446
2447
|
},
|
|
2447
2448
|
},
|
|
2448
2449
|
});
|
|
2449
|
-
const { data: siteFields, loading: loadingSiteFields } =
|
|
2450
|
+
const { data: siteFields, loading: loadingSiteFields } = reactGraphqlHooks.useQuery(GetCustomFieldsForSiteForIrisAppDocument, {
|
|
2450
2451
|
variables: {
|
|
2451
2452
|
entityId: entityId || "",
|
|
2452
2453
|
systemOfMeasurement,
|
package/index.esm.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { useQuery
|
|
1
|
+
import { useQuery } from '@trackunit/react-graphql-hooks';
|
|
2
2
|
import { nonNullable, exhaustiveCheck, objectKeys } from '@trackunit/shared-utils';
|
|
3
3
|
import { useMemo, useCallback } from 'react';
|
|
4
4
|
import { useIrisAppId, useCurrentUserLanguage } from '@trackunit/react-core-hooks';
|
|
5
|
+
import { useMutation } from '@apollo/client';
|
|
5
6
|
import { isValidCustomFieldValue, getCustomFieldValueToSaveFromRawValue } from '@trackunit/iris-app-runtime-core';
|
|
6
7
|
import { SystemOfMeasurement } from '@trackunit/react-core-contexts-api';
|
|
7
8
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/custom-field-api",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.20",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=22.x"
|
|
6
6
|
},
|
|
@@ -12,14 +12,15 @@
|
|
|
12
12
|
"graphql": "^16.10.0",
|
|
13
13
|
"@apollo/client": "3.13.8",
|
|
14
14
|
"react": "19.0.0",
|
|
15
|
-
"@trackunit/iris-app-build-utilities": "1.7.
|
|
16
|
-
"@trackunit/iris-app-api": "1.7.
|
|
17
|
-
"@trackunit/react-core-contexts-test": "1.7.
|
|
18
|
-
"@trackunit/shared-utils": "1.9.
|
|
19
|
-
"@trackunit/react-core-hooks": "1.7.
|
|
20
|
-
"@trackunit/iris-app-runtime-core": "1.8.
|
|
21
|
-
"@trackunit/react-core-contexts-api": "1.8.
|
|
22
|
-
"@trackunit/react-test-setup": "1.4.
|
|
15
|
+
"@trackunit/iris-app-build-utilities": "1.7.17",
|
|
16
|
+
"@trackunit/iris-app-api": "1.7.17",
|
|
17
|
+
"@trackunit/react-core-contexts-test": "1.7.19",
|
|
18
|
+
"@trackunit/shared-utils": "1.9.16",
|
|
19
|
+
"@trackunit/react-core-hooks": "1.7.19",
|
|
20
|
+
"@trackunit/iris-app-runtime-core": "1.8.18",
|
|
21
|
+
"@trackunit/react-core-contexts-api": "1.8.18",
|
|
22
|
+
"@trackunit/react-test-setup": "1.4.16",
|
|
23
|
+
"@trackunit/react-graphql-hooks": "1.7.26"
|
|
23
24
|
},
|
|
24
25
|
"module": "./index.esm.js",
|
|
25
26
|
"main": "./index.cjs.js",
|