@trackunit/react-table-helpers 2.33.4 → 3.0.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.
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.readCompanionVersion = exports.findPackageJsonsDeclaring = exports.ensureDependency = void 0;
4
+ const devkit_1 = require("@nx/devkit");
5
+ const node_fs_1 = require("node:fs");
6
+ /** Root package name of the manager monorepo, where `@trackunit/*` versions are owned by CI. */
7
+ const MANAGER_WORKSPACE_PACKAGE_NAME = "@trackunit/manager";
8
+ /**
9
+ * Adds `packageName@range` to a package.json unless it is already declared
10
+ * in `dependencies` or `devDependencies` (an existing entry is never
11
+ * changed). Does nothing in the manager monorepo itself. Doesn't install;
12
+ * the consumer has to re-install afterwards.
13
+ */
14
+ const ensureDependency = (tree, options) => {
15
+ const { packageName, range, besidePackage, packageJsonPath = "package.json" } = options;
16
+ if (!tree.exists(packageJsonPath))
17
+ return "no-package-json";
18
+ const packageJson = (0, devkit_1.readJson)(tree, packageJsonPath);
19
+ if (packageJson.name === MANAGER_WORKSPACE_PACKAGE_NAME)
20
+ return "manager-workspace";
21
+ if (packageJson.dependencies?.[packageName] !== undefined ||
22
+ packageJson.devDependencies?.[packageName] !== undefined) {
23
+ return "already-present";
24
+ }
25
+ const asDevDependency = besidePackage !== undefined &&
26
+ packageJson.dependencies?.[besidePackage] === undefined &&
27
+ packageJson.devDependencies?.[besidePackage] !== undefined;
28
+ const entry = { [packageName]: range };
29
+ (0, devkit_1.addDependenciesToPackageJson)(tree, asDevDependency ? {} : entry, asDevDependency ? entry : {}, packageJsonPath, true);
30
+ return "added";
31
+ };
32
+ exports.ensureDependency = ensureDependency;
33
+ /**
34
+ * Every package.json except the root one (and anything under
35
+ * `node_modules`) that declares `packageName` as a dependency, devDependency
36
+ * or peerDependency.
37
+ */
38
+ const findPackageJsonsDeclaring = (tree, packageName) => {
39
+ const found = [];
40
+ (0, devkit_1.visitNotIgnoredFiles)(tree, "/", filePath => {
41
+ if (filePath === "package.json" || !filePath.endsWith("/package.json"))
42
+ return;
43
+ if (filePath.startsWith("node_modules/") || filePath.includes("/node_modules/"))
44
+ return;
45
+ const packageJson = (0, devkit_1.readJson)(tree, filePath);
46
+ if (packageJson.dependencies?.[packageName] !== undefined ||
47
+ packageJson.devDependencies?.[packageName] !== undefined ||
48
+ packageJson.peerDependencies?.[packageName] !== undefined) {
49
+ found.push(filePath);
50
+ }
51
+ });
52
+ return found;
53
+ };
54
+ exports.findPackageJsonsDeclaring = findPackageJsonsDeclaring;
55
+ /**
56
+ * Version of a companion package, read from the first of `candidatePaths`
57
+ * (absolute file-system paths, not tree paths) that is the package.json of
58
+ * `packageName`. Throws when none is, so a migration fails and stays pending
59
+ * instead of writing a wrong range.
60
+ */
61
+ const readCompanionVersion = (packageName, candidatePaths) => {
62
+ for (const candidatePath of candidatePaths) {
63
+ if (!(0, node_fs_1.existsSync)(candidatePath))
64
+ continue;
65
+ const packageJson = JSON.parse((0, node_fs_1.readFileSync)(candidatePath, "utf-8"));
66
+ if (packageJson.name === packageName && typeof packageJson.version === "string" && packageJson.version !== "") {
67
+ return packageJson.version;
68
+ }
69
+ }
70
+ throw new Error(`Could not find the version of ${packageName}. Looked in: ${candidatePaths.join(", ")}`);
71
+ };
72
+ exports.readCompanionVersion = readCompanionVersion;
73
+ //# sourceMappingURL=package-json-utils.js.map
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.moveCustomFieldTableHelpers = exports.resolveCustomFieldTableHelpersRange = exports.CUSTOM_FIELD_TABLE_HELPERS_MOVED_NAMES = void 0;
4
+ const devkit_1 = require("@nx/devkit");
5
+ const node_path_1 = require("node:path");
6
+ const jsx_utils_1 = require("../utils/jsx-utils");
7
+ const move_named_imports_1 = require("../utils/move-named-imports");
8
+ const package_json_utils_1 = require("../utils/package-json-utils");
9
+ const MIGRATION_NAME = "move-custom-field-table-helpers";
10
+ const FROM_MODULE = "@trackunit/react-table-helpers";
11
+ const TO_MODULE = "@trackunit/custom-field-table-helpers";
12
+ /** Exports that left `@trackunit/react-table-helpers` for `@trackunit/custom-field-table-helpers`. */
13
+ exports.CUSTOM_FIELD_TABLE_HELPERS_MOVED_NAMES = [
14
+ "useColumnDefinitionsFromCustomFieldDefinition",
15
+ "customFieldToCell",
16
+ "customFieldToExportString",
17
+ "CustomFieldData",
18
+ "DataWithCustomFields",
19
+ ];
20
+ /**
21
+ * `^<version>` of `@trackunit/custom-field-table-helpers`. The published
22
+ * package ships its package.json as a `build-migrations` asset; running from
23
+ * source falls back to the workspace copy.
24
+ */
25
+ const resolveCustomFieldTableHelpersRange = () => `^${(0, package_json_utils_1.readCompanionVersion)(TO_MODULE, [
26
+ (0, node_path_1.join)(__dirname, "../assets/custom-field-table-helpers/package.json"),
27
+ (0, node_path_1.join)(__dirname, "../../../../custom-field/table-helpers/package.json"),
28
+ ])}`;
29
+ exports.resolveCustomFieldTableHelpersRange = resolveCustomFieldTableHelpersRange;
30
+ /**
31
+ * Moves imports and re-exports of the custom-field column helpers from
32
+ * `@trackunit/react-table-helpers` to `@trackunit/custom-field-table-helpers`.
33
+ *
34
+ * When something was rewritten, `@trackunit/custom-field-table-helpers` is added
35
+ * to the root package.json next to `@trackunit/react-table-helpers` (an
36
+ * existing entry is kept). Per-project package.json files are only reported.
37
+ * Throws before touching any file when the custom-field-table-helpers version
38
+ * can't be resolved, so a failed run leaves nothing half-migrated.
39
+ */
40
+ const moveCustomFieldTableHelpers = (tree, resolveRange = exports.resolveCustomFieldTableHelpersRange) => {
41
+ const range = resolveRange();
42
+ const { changedFiles, manualReview } = (0, move_named_imports_1.moveNamedImports)(tree, {
43
+ fromModule: FROM_MODULE,
44
+ toModule: TO_MODULE,
45
+ names: exports.CUSTOM_FIELD_TABLE_HELPERS_MOVED_NAMES,
46
+ });
47
+ (0, move_named_imports_1.logManualReview)(MIGRATION_NAME, manualReview);
48
+ if (changedFiles.length > 0) {
49
+ const result = (0, package_json_utils_1.ensureDependency)(tree, {
50
+ packageName: TO_MODULE,
51
+ range,
52
+ besidePackage: FROM_MODULE,
53
+ });
54
+ if (result === "added") {
55
+ devkit_1.logger.info(` ${MIGRATION_NAME}: added ${TO_MODULE} to package.json; re-install dependencies (e.g. \`yarn\` or \`npm install\`) after running migrations`);
56
+ }
57
+ else if (result === "no-package-json") {
58
+ devkit_1.logger.warn(` ${MIGRATION_NAME}: no root package.json found; add ${TO_MODULE} as a dependency yourself`);
59
+ }
60
+ if (result !== "manager-workspace") {
61
+ for (const packageJsonPath of (0, package_json_utils_1.findPackageJsonsDeclaring)(tree, FROM_MODULE)) {
62
+ devkit_1.logger.warn(` ${MIGRATION_NAME}: ${packageJsonPath} declares ${FROM_MODULE}; add ${TO_MODULE} there too if that project uses the moved names`);
63
+ }
64
+ }
65
+ }
66
+ (0, jsx_utils_1.logSummary)(MIGRATION_NAME, changedFiles.length, manualReview.length);
67
+ };
68
+ exports.moveCustomFieldTableHelpers = moveCustomFieldTableHelpers;
69
+ exports.default = exports.moveCustomFieldTableHelpers;
70
+ //# sourceMappingURL=move-custom-field-table-helpers.js.map
package/migrations.json CHANGED
@@ -1,3 +1,9 @@
1
1
  {
2
- "generators": {}
2
+ "generators": {
3
+ "v3-0-0-move-custom-field-table-helpers": {
4
+ "version": "3.0.0",
5
+ "description": "Move imports of useColumnDefinitionsFromCustomFieldDefinition, customFieldToCell, customFieldToExportString, CustomFieldData and DataWithCustomFields from @trackunit/react-table-helpers to @trackunit/custom-field-table-helpers, and add @trackunit/custom-field-table-helpers to the root package.json. Re-install dependencies afterwards.",
6
+ "implementation": "./migrations/v3-0-0/move-custom-field-table-helpers"
7
+ }
8
+ }
3
9
  }
package/package.json CHANGED
@@ -1,26 +1,17 @@
1
1
  {
2
2
  "name": "@trackunit/react-table-helpers",
3
- "version": "2.33.4",
3
+ "version": "3.0.0",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
7
7
  "node": ">=24.x"
8
8
  },
9
9
  "dependencies": {
10
- "@trackunit/date-and-time-utils": "1.20.24",
11
- "@trackunit/filters-filter-bar": "2.17.16",
12
- "@trackunit/filters-graphql-hook": "2.32.4",
13
- "@trackunit/i18n-library-translation": "2.14.14",
14
- "@trackunit/custom-field-components": "2.32.4",
15
- "@trackunit/iris-app-runtime-core": "1.28.14",
16
- "@trackunit/iris-app-runtime-core-api": "1.27.14",
17
- "@trackunit/react-table-base-components": "2.19.15",
18
- "@trackunit/react-table": "2.18.15",
19
- "@trackunit/react-components": "6.0.14",
20
- "@trackunit/react-core-hooks": "1.31.14",
21
- "@trackunit/react-graphql-hooks": "2.17.15",
22
- "@trackunit/iris-app-api": "2.12.27",
23
- "@graphql-typed-document-node/core": "^3.2.0"
10
+ "@trackunit/i18n-library-translation": "2.14.15",
11
+ "@trackunit/react-components": "6.0.15",
12
+ "@trackunit/react-core-hooks": "1.31.15",
13
+ "@trackunit/react-graphql-hooks": "2.17.16",
14
+ "@trackunit/react-table": "2.18.16"
24
15
  },
25
16
  "peerDependencies": {
26
17
  "@apollo/client": "^3.13.8",
package/src/index.d.ts CHANGED
@@ -1,5 +1 @@
1
1
  export * from "./ExportTableButton/ExportTableButton";
2
- export * from "./useColumnDefinitionsFromCustomFieldDefinition/customFieldToCell";
3
- export * from "./useColumnDefinitionsFromCustomFieldDefinition/customFieldToExportString";
4
- export type { CustomFieldData, DataWithCustomFields } from "./useColumnDefinitionsFromCustomFieldDefinition/types";
5
- export * from "./useColumnDefinitionsFromCustomFieldDefinition/useColumnDefinitionsFromCustomFieldDefinition";
@@ -1 +0,0 @@
1
- {"version":3,"file":"entry.js","sourceRoot":"","sources":["../../../../../libs/react/table-helpers/migrations/entry.ts"],"names":[],"mappings":"","sourcesContent":["export {};\n"]}
@@ -1,19 +0,0 @@
1
- import { ResultOf, DocumentTypeDecoration, TypedDocumentNode } from '@graphql-typed-document-node/core';
2
- import { Incremental } from './graphql';
3
- export type FragmentType<TDocumentType extends DocumentTypeDecoration<any, any>> = TDocumentType extends DocumentTypeDecoration<infer TType, any> ? [TType] extends [{
4
- ' $fragmentName'?: infer TKey;
5
- }] ? TKey extends string ? {
6
- ' $fragmentRefs'?: {
7
- [key in TKey]: TType;
8
- };
9
- } : never : never : never;
10
- export declare function getFragmentData<TType>(_documentNode: DocumentTypeDecoration<TType, any>, fragmentType: FragmentType<DocumentTypeDecoration<TType, any>>): TType;
11
- export declare function getFragmentData<TType>(_documentNode: DocumentTypeDecoration<TType, any>, fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | undefined): TType | undefined;
12
- export declare function getFragmentData<TType>(_documentNode: DocumentTypeDecoration<TType, any>, fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | null): TType | null;
13
- export declare function getFragmentData<TType>(_documentNode: DocumentTypeDecoration<TType, any>, fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | null | undefined): TType | null | undefined;
14
- export declare function getFragmentData<TType>(_documentNode: DocumentTypeDecoration<TType, any>, fragmentType: Array<FragmentType<DocumentTypeDecoration<TType, any>>>): Array<TType>;
15
- export declare function getFragmentData<TType>(_documentNode: DocumentTypeDecoration<TType, any>, fragmentType: Array<FragmentType<DocumentTypeDecoration<TType, any>>> | null | undefined): Array<TType> | null | undefined;
16
- export declare function getFragmentData<TType>(_documentNode: DocumentTypeDecoration<TType, any>, fragmentType: ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>>): ReadonlyArray<TType>;
17
- export declare function getFragmentData<TType>(_documentNode: DocumentTypeDecoration<TType, any>, fragmentType: ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>> | null | undefined): ReadonlyArray<TType> | null | undefined;
18
- export declare function makeFragmentData<F extends DocumentTypeDecoration<any, any>, FT extends ResultOf<F>>(data: FT, _fragment: F): FragmentType<F>;
19
- export declare function isFragmentReady<TQuery, TFrag>(queryNode: DocumentTypeDecoration<TQuery, any>, fragmentNode: TypedDocumentNode<TFrag>, data: FragmentType<TypedDocumentNode<Incremental<TFrag>, any>> | null | undefined): data is FragmentType<typeof fragmentNode>;
@@ -1,35 +0,0 @@
1
- import * as types from './graphql';
2
- import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';
3
- /**
4
- * Map of all GraphQL operations in the project.
5
- *
6
- * This map has several performance disadvantages:
7
- * 1. It is not tree-shakeable, so it will include all operations in the project.
8
- * 2. It is not minifiable, so the string of a GraphQL query will be multiple times inside the bundle.
9
- * 3. It does not support dead code elimination, so it will add unused operations.
10
- *
11
- * Therefore it is highly recommended to use the babel or swc plugin for production.
12
- * Learn more about it here: https://the-guild.dev/graphql/codegen/plugins/presets/preset-client#reducing-bundle-size
13
- */
14
- declare const documents: {
15
- "fragment AssetCustomFields on Asset {\n customFields(definitionIds: $definitionIds) {\n edges {\n node {\n __typename\n definition {\n id\n title\n key\n }\n valueId\n ... on BooleanFieldValueAndDefinition {\n booleanValue\n }\n ... on DateFieldValueAndDefinition {\n dateValue\n }\n ... on DropDownFieldValueAndDefinition {\n stringArrayValue\n }\n ... on EmailFieldValueAndDefinition {\n emailValue\n }\n ... on NumberFieldValueAndDefinition {\n definition {\n unitSi\n unitUs\n }\n numberValue(systemOfMeasurement: $systemOfMeasurement)\n }\n ... on PhoneNumberFieldValueAndDefinition {\n phoneNumberValue\n }\n ... on StringFieldValueAndDefinition {\n stringValue\n }\n ... on WebAddressFieldValueAndDefinition {\n webAddressValue\n }\n ... on JsonFieldValueAndDefinition {\n jsonValue\n }\n ... on MonetaryFieldValueAndDefinition {\n monetaryValue\n }\n ... on StringListFieldValueAndDefinition {\n stringArrayValue\n }\n ... on FileFieldValueAndDefinition {\n fileName\n downloadLink\n }\n }\n }\n }\n}": DocumentNode<types.AssetCustomFieldsFragment, unknown>;
16
- };
17
- /**
18
- * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
19
- *
20
- *
21
- * @example
22
- * ```ts
23
- * const query = graphql(`query GetUser($id: ID!) { user(id: $id) { name } }`);
24
- * ```
25
- *
26
- * The query argument is unknown!
27
- * Please regenerate the types.
28
- */
29
- export declare function graphql(source: string): unknown;
30
- /**
31
- * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
32
- */
33
- export declare function graphql(source: "fragment AssetCustomFields on Asset {\n customFields(definitionIds: $definitionIds) {\n edges {\n node {\n __typename\n definition {\n id\n title\n key\n }\n valueId\n ... on BooleanFieldValueAndDefinition {\n booleanValue\n }\n ... on DateFieldValueAndDefinition {\n dateValue\n }\n ... on DropDownFieldValueAndDefinition {\n stringArrayValue\n }\n ... on EmailFieldValueAndDefinition {\n emailValue\n }\n ... on NumberFieldValueAndDefinition {\n definition {\n unitSi\n unitUs\n }\n numberValue(systemOfMeasurement: $systemOfMeasurement)\n }\n ... on PhoneNumberFieldValueAndDefinition {\n phoneNumberValue\n }\n ... on StringFieldValueAndDefinition {\n stringValue\n }\n ... on WebAddressFieldValueAndDefinition {\n webAddressValue\n }\n ... on JsonFieldValueAndDefinition {\n jsonValue\n }\n ... on MonetaryFieldValueAndDefinition {\n monetaryValue\n }\n ... on StringListFieldValueAndDefinition {\n stringArrayValue\n }\n ... on FileFieldValueAndDefinition {\n fileName\n downloadLink\n }\n }\n }\n }\n}"): (typeof documents)["fragment AssetCustomFields on Asset {\n customFields(definitionIds: $definitionIds) {\n edges {\n node {\n __typename\n definition {\n id\n title\n key\n }\n valueId\n ... on BooleanFieldValueAndDefinition {\n booleanValue\n }\n ... on DateFieldValueAndDefinition {\n dateValue\n }\n ... on DropDownFieldValueAndDefinition {\n stringArrayValue\n }\n ... on EmailFieldValueAndDefinition {\n emailValue\n }\n ... on NumberFieldValueAndDefinition {\n definition {\n unitSi\n unitUs\n }\n numberValue(systemOfMeasurement: $systemOfMeasurement)\n }\n ... on PhoneNumberFieldValueAndDefinition {\n phoneNumberValue\n }\n ... on StringFieldValueAndDefinition {\n stringValue\n }\n ... on WebAddressFieldValueAndDefinition {\n webAddressValue\n }\n ... on JsonFieldValueAndDefinition {\n jsonValue\n }\n ... on MonetaryFieldValueAndDefinition {\n monetaryValue\n }\n ... on StringListFieldValueAndDefinition {\n stringArrayValue\n }\n ... on FileFieldValueAndDefinition {\n fileName\n downloadLink\n }\n }\n }\n }\n}"];
34
- export type DocumentType<TDocumentNode extends DocumentNode<any, any>> = TDocumentNode extends DocumentNode<infer TType, any> ? TType : never;
35
- export {};
@@ -1,323 +0,0 @@
1
- import { TypedDocumentNode as DocumentNode } from "@graphql-typed-document-node/core";
2
- import type { PublicIrisAppManifest } from "@trackunit/iris-app-api";
3
- export type Maybe<T> = T | null;
4
- export type InputMaybe<T> = Maybe<T> | undefined;
5
- export type Exact<T extends {
6
- [key: string]: unknown;
7
- }> = {
8
- [K in keyof T]: T[K];
9
- };
10
- export type MakeOptional<T, K extends keyof T> = Omit<T, K> & {
11
- [SubKey in K]?: Maybe<T[SubKey]>;
12
- };
13
- export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & {
14
- [SubKey in K]: Maybe<T[SubKey]>;
15
- };
16
- export type MakeEmpty<T extends {
17
- [key: string]: unknown;
18
- }, K extends keyof T> = {
19
- [_ in K]?: never;
20
- };
21
- export type Incremental<T> = T | {
22
- [P in keyof T]?: P extends " $fragmentName" | "__typename" ? T[P] : never;
23
- };
24
- export type DateTimeISOString = string;
25
- /** All built-in and custom scalars, mapped to their actual values */
26
- export type Scalars = {
27
- ID: {
28
- input: string;
29
- output: string;
30
- };
31
- String: {
32
- input: string;
33
- output: string;
34
- };
35
- Boolean: {
36
- input: boolean;
37
- output: boolean;
38
- };
39
- Int: {
40
- input: number;
41
- output: number;
42
- };
43
- Float: {
44
- input: number;
45
- output: number;
46
- };
47
- /** The ISO 4217 currency code of the monetary field definition. */
48
- Currency: {
49
- input: string;
50
- output: string;
51
- };
52
- /** Cursor scalar. */
53
- Cursor: {
54
- input: string;
55
- output: string;
56
- };
57
- /** Date scalar */
58
- Date: {
59
- input: DateTimeISOString;
60
- output: DateTimeISOString;
61
- };
62
- /** DateTime represents a “date-time” as specified in section 5.6 of RFC 3339 */
63
- DateTime: {
64
- input: DateTimeISOString;
65
- output: DateTimeISOString;
66
- };
67
- /** Duration represents an ISO 8601 duration */
68
- Duration: {
69
- input: any;
70
- output: any;
71
- };
72
- /** Valid email address according to https://owasp.org/www-community/OWASP_Validation_Regex_Repository */
73
- EmailAddress: {
74
- input: string;
75
- output: string;
76
- };
77
- /** A (possiblely multidimensional) set of coordinates following x, y, z order. */
78
- GeoJSONCoordinates: {
79
- input: [number, number] | [number, number][] | [number, number][][];
80
- output: [number, number] | [number, number][] | [number, number][][];
81
- };
82
- /** Raw JSON object structure, not serialized to string */
83
- JSON: {
84
- input: any;
85
- output: any;
86
- };
87
- /** The `JSONObject` scalar type represents JSON values as a string */
88
- JSONObject: {
89
- input: any;
90
- output: any;
91
- };
92
- /** 24-hour clock time string in the format hh:mm:ss.sss or hh:mm:ss if partial seconds is zero */
93
- LocalTime: {
94
- input: any;
95
- output: any;
96
- };
97
- /** Javascript `Long`. Type represents a 64 bit integer. */
98
- Long: {
99
- input: any;
100
- output: any;
101
- };
102
- /** Phone number in E.164 format */
103
- PhoneNumber: {
104
- input: string;
105
- output: string;
106
- };
107
- /** The `PublicIrisAppManifest` scalar type represents an Iris App Manifest as JSON */
108
- PublicIrisAppManifest: {
109
- input: PublicIrisAppManifest;
110
- output: PublicIrisAppManifest;
111
- };
112
- /** Uniform resource locator */
113
- Url: {
114
- input: string;
115
- output: string;
116
- };
117
- /** YearMonth scalar */
118
- YearMonth: {
119
- input: any;
120
- output: any;
121
- };
122
- };
123
- export declare const unitOfMeasurement: {
124
- readonly ACRE: "ACRE";
125
- readonly AMPERE: "AMPERE";
126
- readonly AMPERE_HOUR: "AMPERE_HOUR";
127
- readonly ARE: "ARE";
128
- readonly BAR: "BAR";
129
- readonly CELSIUS: "CELSIUS";
130
- readonly CENTIMETRE: "CENTIMETRE";
131
- readonly CUBIC_FOOT: "CUBIC_FOOT";
132
- readonly CUBIC_METRE: "CUBIC_METRE";
133
- readonly DAY: "DAY";
134
- readonly DEGREE_ANGLE: "DEGREE_ANGLE";
135
- readonly FAHRENHEIT: "FAHRENHEIT";
136
- readonly FOOT: "FOOT";
137
- readonly GALLONS_PER_HOUR: "GALLONS_PER_HOUR";
138
- readonly GALLON_LIQUID: "GALLON_LIQUID";
139
- readonly GRAM: "GRAM";
140
- readonly G_FORCE: "G_FORCE";
141
- readonly HECTARE: "HECTARE";
142
- readonly HERTZ: "HERTZ";
143
- readonly HOUR: "HOUR";
144
- readonly INCH: "INCH";
145
- readonly INCHES_OF_WATER: "INCHES_OF_WATER";
146
- readonly KILOGRAM: "KILOGRAM";
147
- readonly KILOGRAM_PER_HOUR: "KILOGRAM_PER_HOUR";
148
- readonly KILOGRAM_PER_SECOND: "KILOGRAM_PER_SECOND";
149
- readonly KILOMETRE: "KILOMETRE";
150
- readonly KILOMETRE_PER_HOUR: "KILOMETRE_PER_HOUR";
151
- readonly KILOPASCAL: "KILOPASCAL";
152
- readonly KILOWATT: "KILOWATT";
153
- readonly KILOWATT_HOUR: "KILOWATT_HOUR";
154
- readonly LITRE: "LITRE";
155
- readonly LITRES_PER_HOUR: "LITRES_PER_HOUR";
156
- readonly METRE: "METRE";
157
- readonly METRE_PER_SECOND: "METRE_PER_SECOND";
158
- readonly METRE_PER_SECOND_SQUARED: "METRE_PER_SECOND_SQUARED";
159
- readonly METRIC_TON: "METRIC_TON";
160
- readonly MILE: "MILE";
161
- readonly MILE_PER_HOUR: "MILE_PER_HOUR";
162
- readonly MILLIMETRE: "MILLIMETRE";
163
- readonly MILLISECOND: "MILLISECOND";
164
- readonly MINUTE: "MINUTE";
165
- readonly MONTH: "MONTH";
166
- readonly NEWTON: "NEWTON";
167
- readonly OUNCE: "OUNCE";
168
- readonly PASCAL: "PASCAL";
169
- readonly PERCENT: "PERCENT";
170
- readonly POUND: "POUND";
171
- readonly POUND_PER_HOUR: "POUND_PER_HOUR";
172
- readonly POUND_PER_SECOND: "POUND_PER_SECOND";
173
- readonly POUND_PER_SQUARE_INCH: "POUND_PER_SQUARE_INCH";
174
- readonly REVOLUTIONS_PER_MINUTE: "REVOLUTIONS_PER_MINUTE";
175
- readonly SECOND: "SECOND";
176
- readonly SQUARE_FOOT: "SQUARE_FOOT";
177
- readonly SQUARE_KILOMETRE: "SQUARE_KILOMETRE";
178
- readonly SQUARE_METRE: "SQUARE_METRE";
179
- readonly US_TON: "US_TON";
180
- readonly VOLT: "VOLT";
181
- readonly VOLT_AMPERE: "VOLT_AMPERE";
182
- readonly WATT: "WATT";
183
- readonly WEEK: "WEEK";
184
- readonly YARD: "YARD";
185
- readonly YEAR: "YEAR";
186
- };
187
- export type UnitOfMeasurement = (typeof unitOfMeasurement)[keyof typeof unitOfMeasurement];
188
- export type AssetCustomFieldsFragment = {
189
- __typename?: "Asset";
190
- customFields: {
191
- __typename?: "CustomFieldValueAndDefinitionConnection";
192
- edges: Array<{
193
- __typename?: "CustomFieldValueAndDefinitionEdge";
194
- node: {
195
- __typename: "BooleanFieldValueAndDefinition";
196
- booleanValue: boolean | null;
197
- valueId: string | null;
198
- definition: {
199
- __typename?: "BooleanFieldDefinition";
200
- id: string;
201
- title: string | null;
202
- key: string | null;
203
- };
204
- } | {
205
- __typename: "DateFieldValueAndDefinition";
206
- dateValue: DateTimeISOString | null;
207
- valueId: string | null;
208
- definition: {
209
- __typename?: "DateFieldDefinition";
210
- id: string;
211
- title: string | null;
212
- key: string | null;
213
- };
214
- } | {
215
- __typename: "DropDownFieldValueAndDefinition";
216
- stringArrayValue: Array<string> | null;
217
- valueId: string | null;
218
- definition: {
219
- __typename?: "DropDownFieldDefinition";
220
- id: string;
221
- title: string | null;
222
- key: string | null;
223
- };
224
- } | {
225
- __typename: "EmailFieldValueAndDefinition";
226
- emailValue: string | null;
227
- valueId: string | null;
228
- definition: {
229
- __typename?: "EmailFieldDefinition";
230
- id: string;
231
- title: string | null;
232
- key: string | null;
233
- };
234
- } | {
235
- __typename: "FileFieldValueAndDefinition";
236
- fileName: string | null;
237
- downloadLink: string | null;
238
- valueId: string | null;
239
- definition: {
240
- __typename?: "FileFieldDefinition";
241
- id: string;
242
- title: string | null;
243
- key: string | null;
244
- };
245
- } | {
246
- __typename: "JsonFieldValueAndDefinition";
247
- jsonValue: any | null;
248
- valueId: string | null;
249
- definition: {
250
- __typename?: "JsonFieldDefinition";
251
- id: string;
252
- title: string | null;
253
- key: string | null;
254
- };
255
- } | {
256
- __typename: "MonetaryFieldValueAndDefinition";
257
- monetaryValue: number | null;
258
- valueId: string | null;
259
- definition: {
260
- __typename?: "MonetaryFieldDefinition";
261
- id: string;
262
- title: string | null;
263
- key: string | null;
264
- };
265
- } | {
266
- __typename: "NumberFieldValueAndDefinition";
267
- numberValue: number | null;
268
- valueId: string | null;
269
- definition: {
270
- __typename?: "NumberFieldDefinition";
271
- unitSi: UnitOfMeasurement | null;
272
- unitUs: UnitOfMeasurement | null;
273
- id: string;
274
- title: string | null;
275
- key: string | null;
276
- };
277
- } | {
278
- __typename: "PhoneNumberFieldValueAndDefinition";
279
- phoneNumberValue: string | null;
280
- valueId: string | null;
281
- definition: {
282
- __typename?: "PhoneNumberFieldDefinition";
283
- id: string;
284
- title: string | null;
285
- key: string | null;
286
- };
287
- } | {
288
- __typename: "StringFieldValueAndDefinition";
289
- stringValue: string | null;
290
- valueId: string | null;
291
- definition: {
292
- __typename?: "StringFieldDefinition";
293
- id: string;
294
- title: string | null;
295
- key: string | null;
296
- };
297
- } | {
298
- __typename: "StringListFieldValueAndDefinition";
299
- stringArrayValue: Array<string> | null;
300
- valueId: string | null;
301
- definition: {
302
- __typename?: "StringListFieldDefinition";
303
- id: string;
304
- title: string | null;
305
- key: string | null;
306
- };
307
- } | {
308
- __typename: "WebAddressFieldValueAndDefinition";
309
- webAddressValue: string | null;
310
- valueId: string | null;
311
- definition: {
312
- __typename?: "WebAddressFieldDefinition";
313
- id: string;
314
- title: string | null;
315
- key: string | null;
316
- };
317
- } | null;
318
- } | null> | null;
319
- } | null;
320
- } & {
321
- " $fragmentName"?: "AssetCustomFieldsFragment";
322
- };
323
- export declare const AssetCustomFieldsFragmentDoc: DocumentNode<AssetCustomFieldsFragment, unknown>;
@@ -1,2 +0,0 @@
1
- export * from "./fragment-masking";
2
- export * from "./gql";
@@ -1,8 +0,0 @@
1
- import { UnitType } from "@trackunit/custom-field-components";
2
- import { SystemOfMeasurementType } from "@trackunit/iris-app-runtime-core-api";
3
- import { ReactNode } from "react";
4
- import { CustomFieldData } from "./types";
5
- /**
6
- * Takes a custom fields data object and returns a react node that can be used as a cell in a table.
7
- */
8
- export declare const customFieldToCell: (customField: CustomFieldData, unitTranslation: (unit: UnitType) => string | null, unitPreference?: SystemOfMeasurementType | null, language?: string) => ReactNode;
@@ -1,8 +0,0 @@
1
- import { UnitType } from "@trackunit/custom-field-components";
2
- import { SystemOfMeasurementType } from "@trackunit/iris-app-runtime-core-api";
3
- import { ReactNode } from "react";
4
- import { CustomFieldData } from "./types";
5
- /**
6
- * Takes a custom fields data object and returns a react node that can be used as a cell in a table.
7
- */
8
- export declare const customFieldToExportString: (customField: CustomFieldData, unitTranslation: (unit: UnitType) => string | null, unitPreference?: SystemOfMeasurementType | null, language?: string) => ReactNode;