@fibery/views 19.0.0 → 19.0.1
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/lib/src/index.d.ts +28 -16
- package/lib/src/index.js +1 -1
- package/lib/src/private/board.d.ts +15 -11
- package/lib/src/private/board.js +8 -7
- package/lib/src/private/calendar.d.ts +14 -10
- package/lib/src/private/calendar.js +4 -3
- package/lib/src/private/feed.d.ts +14 -10
- package/lib/src/private/feed.js +4 -3
- package/lib/src/private/form.d.ts +25 -3
- package/lib/src/private/form.js +3 -3
- package/lib/src/private/map.d.ts +14 -10
- package/lib/src/private/map.js +4 -3
- package/lib/src/private/smart-folder.d.ts +23 -15
- package/lib/src/private/smart-folder.js +16 -13
- package/lib/src/private/timeline.d.ts +39 -10
- package/lib/src/private/timeline.js +8 -6
- package/lib/src/private/units.d.ts +10 -6
- package/lib/src/private/units.js +32 -24
- package/lib/src/private/utils.d.ts +64 -17
- package/lib/src/private/utils.js +26 -20
- package/lib/src/truthy.d.ts +1 -0
- package/lib/src/truthy.js +7 -0
- package/lib/src/unit-definitions/avatar-collection.js +2 -3
- package/lib/src/unit-definitions/avatar.js +3 -5
- package/lib/src/unit-definitions/collection-count.js +4 -2
- package/lib/src/unit-definitions/file-collection-count.js +9 -7
- package/lib/src/unit-definitions/file-compact-collection.js +9 -7
- package/lib/src/unit-definitions/file-compact-reference.js +2 -11
- package/lib/src/unit-definitions/file-reference.js +6 -4
- package/lib/src/unit-definitions/files-gallery.js +9 -7
- package/lib/src/unit-definitions/files-l-list-item.js +6 -4
- package/lib/src/unit-definitions/files-l-list.js +9 -7
- package/lib/src/unit-definitions/files-list-item.js +6 -4
- package/lib/src/unit-definitions/files-list.js +9 -7
- package/lib/src/unit-definitions/number.js +2 -4
- package/lib/src/unit-definitions/progress-bar.js +1 -4
- package/lib/src/unit-definitions/rich-text-snippet.d.ts +1 -0
- package/lib/src/unit-definitions/rich-text-snippet.js +6 -11
- package/lib/src/unit-utils/get-export-value.js +2 -1
- package/lib/src/unit-utils/wrap-normalized-in-expression.d.ts +3 -0
- package/lib/src/unit-utils/wrap-normalized-in-expression.js +14 -0
- package/lib/src/units/board.d.ts +4 -4
- package/lib/src/units/canvas/index.d.ts +4 -4
- package/lib/src/units/default.d.ts +4 -4
- package/lib/src/units/gantt.d.ts +4 -4
- package/lib/src/units/grid.d.ts +4 -4
- package/lib/src/units/list.d.ts +4 -4
- package/lib/src/units/make-factory.d.ts +2 -3
- package/lib/src/units/make-factory.js +18 -7
- package/lib/src/units/types.d.ts +1 -1
- package/package.json +18 -18
- package/lib/jest.config.cjs +0 -34
- package/lib/jest.config.d.cts +0 -3
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FileLList = void 0;
|
|
4
4
|
const utils_1 = require("@fibery/expression-utils/src/utils");
|
|
5
|
+
const select_1 = require("@fibery/query-utils/src/select");
|
|
5
6
|
const file_1 = require("../field-utils/file");
|
|
6
7
|
const common_1 = require("../unit-utils/common");
|
|
7
8
|
const can_edit_field_1 = require("../unit-utils/can-edit-field");
|
|
8
9
|
const get_field_label_1 = require("../unit-utils/get-field-label");
|
|
9
10
|
const get_export_value_1 = require("../unit-utils/get-export-value");
|
|
11
|
+
const wrap_normalized_in_expression_1 = require("../unit-utils/wrap-normalized-in-expression");
|
|
10
12
|
const type = "files-l-list";
|
|
11
13
|
exports.FileLList = {
|
|
12
14
|
type,
|
|
@@ -16,14 +18,14 @@ exports.FileLList = {
|
|
|
16
18
|
calculateErrors: common_1.calculateUnitExpressionErrors,
|
|
17
19
|
makeUnit: (0, common_1.makeUnitMethod)(type),
|
|
18
20
|
getQuerySelect({ typeObject, unit: { expression } }) {
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
},
|
|
21
|
+
const fieldObjects = (0, utils_1.getFieldObjectsByFieldExpression)({ typeObject, expression });
|
|
22
|
+
const terminalFieldObject = fieldObjects[fieldObjects.length - 1];
|
|
23
|
+
const collectionNormalized = {
|
|
24
|
+
"q/from": null,
|
|
25
|
+
"q/limit": "q/no-limit",
|
|
26
|
+
"q/select": (0, select_1.normalizeSelect)((0, file_1.getFilesSelect)(terminalFieldObject)),
|
|
26
27
|
};
|
|
28
|
+
return (0, select_1.denormalizeSelect)((0, wrap_normalized_in_expression_1.wrapNormalizedInExpression)(collectionNormalized, fieldObjects, expression));
|
|
27
29
|
},
|
|
28
30
|
getExportValue: get_export_value_1.getExportValue,
|
|
29
31
|
canExport: () => true,
|
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FileListItem = void 0;
|
|
4
4
|
const utils_1 = require("@fibery/expression-utils/src/utils");
|
|
5
|
+
const select_1 = require("@fibery/query-utils/src/select");
|
|
5
6
|
const file_1 = require("../field-utils/file");
|
|
6
7
|
const common_1 = require("../unit-utils/common");
|
|
7
8
|
const can_edit_field_1 = require("../unit-utils/can-edit-field");
|
|
8
9
|
const get_field_label_1 = require("../unit-utils/get-field-label");
|
|
9
10
|
const get_export_value_1 = require("../unit-utils/get-export-value");
|
|
11
|
+
const wrap_normalized_in_expression_1 = require("../unit-utils/wrap-normalized-in-expression");
|
|
10
12
|
const type = "files-list-item";
|
|
11
13
|
exports.FileListItem = {
|
|
12
14
|
type,
|
|
@@ -16,10 +18,10 @@ exports.FileListItem = {
|
|
|
16
18
|
calculateErrors: common_1.calculateUnitExpressionErrors,
|
|
17
19
|
makeUnit: (0, common_1.makeUnitMethod)(type),
|
|
18
20
|
getQuerySelect({ typeObject, unit: { expression } }) {
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
const fieldObjects = (0, utils_1.getFieldObjectsByFieldExpression)({ typeObject, expression });
|
|
22
|
+
const terminalFieldObject = fieldObjects[fieldObjects.length - 1];
|
|
23
|
+
const innerNormalized = (0, select_1.normalizeSelect)((0, file_1.getFilesSelect)(terminalFieldObject));
|
|
24
|
+
return (0, select_1.denormalizeSelect)((0, wrap_normalized_in_expression_1.wrapNormalizedInExpression)(innerNormalized, fieldObjects, expression));
|
|
23
25
|
},
|
|
24
26
|
getExportValue: get_export_value_1.getExportValue,
|
|
25
27
|
canExport: () => true,
|
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FileList = void 0;
|
|
4
4
|
const utils_1 = require("@fibery/expression-utils/src/utils");
|
|
5
|
+
const select_1 = require("@fibery/query-utils/src/select");
|
|
5
6
|
const file_1 = require("../field-utils/file");
|
|
6
7
|
const common_1 = require("../unit-utils/common");
|
|
7
8
|
const can_edit_field_1 = require("../unit-utils/can-edit-field");
|
|
8
9
|
const get_field_label_1 = require("../unit-utils/get-field-label");
|
|
9
10
|
const get_export_value_1 = require("../unit-utils/get-export-value");
|
|
11
|
+
const wrap_normalized_in_expression_1 = require("../unit-utils/wrap-normalized-in-expression");
|
|
10
12
|
const type = "files-list";
|
|
11
13
|
exports.FileList = {
|
|
12
14
|
type,
|
|
@@ -16,14 +18,14 @@ exports.FileList = {
|
|
|
16
18
|
calculateErrors: common_1.calculateUnitExpressionErrors,
|
|
17
19
|
makeUnit: (0, common_1.makeUnitMethod)(type),
|
|
18
20
|
getQuerySelect({ typeObject, unit: { expression } }) {
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
},
|
|
21
|
+
const fieldObjects = (0, utils_1.getFieldObjectsByFieldExpression)({ typeObject, expression });
|
|
22
|
+
const terminalFieldObject = fieldObjects[fieldObjects.length - 1];
|
|
23
|
+
const collectionNormalized = {
|
|
24
|
+
"q/from": null,
|
|
25
|
+
"q/limit": "q/no-limit",
|
|
26
|
+
"q/select": (0, select_1.normalizeSelect)((0, file_1.getFilesSelect)(terminalFieldObject)),
|
|
26
27
|
};
|
|
28
|
+
return (0, select_1.denormalizeSelect)((0, wrap_normalized_in_expression_1.wrapNormalizedInExpression)(collectionNormalized, fieldObjects, expression));
|
|
27
29
|
},
|
|
28
30
|
getExportValue: get_export_value_1.getExportValue,
|
|
29
31
|
canExport: () => true,
|
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Number = void 0;
|
|
4
|
-
const utils_1 = require("@fibery/expression-utils/src/utils");
|
|
5
4
|
const query_1 = require("@fibery/query-utils/src/query");
|
|
6
5
|
const common_1 = require("../unit-utils/common");
|
|
7
6
|
const get_export_value_1 = require("../unit-utils/get-export-value");
|
|
7
|
+
const get_field_label_1 = require("../unit-utils/get-field-label");
|
|
8
8
|
const type = "number";
|
|
9
9
|
exports.Number = {
|
|
10
10
|
type,
|
|
11
11
|
name: "Input",
|
|
12
12
|
makeUnit: (0, common_1.makeUnitMethod)(type),
|
|
13
13
|
getLabel({ typeObject, unit }) {
|
|
14
|
-
|
|
15
|
-
const fieldObject = (0, utils_1.getFieldObjectByFieldExpression)({ typeObject, expression });
|
|
16
|
-
return fieldObject.title;
|
|
14
|
+
return (0, get_field_label_1.getFieldLabel)({ typeObject, unit });
|
|
17
15
|
},
|
|
18
16
|
getQuerySelect({ typeObject, unit: { expression } }) {
|
|
19
17
|
return (0, query_1.getQuerySelectForExpression)({ typeObject, expression });
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ProgressBar = void 0;
|
|
4
4
|
const query_1 = require("@fibery/query-utils/src/query");
|
|
5
|
-
const utils_1 = require("@fibery/expression-utils/src/utils");
|
|
6
5
|
const common_1 = require("../unit-utils/common");
|
|
7
6
|
const get_export_value_1 = require("../unit-utils/get-export-value");
|
|
8
7
|
const get_field_label_1 = require("../unit-utils/get-field-label");
|
|
@@ -12,9 +11,7 @@ exports.ProgressBar = {
|
|
|
12
11
|
name: "Progress bar",
|
|
13
12
|
makeUnit: (0, common_1.makeUnitMethod)(type),
|
|
14
13
|
getLabel({ typeObject, unit }) {
|
|
15
|
-
|
|
16
|
-
const fieldObject = (0, utils_1.getFieldObjectByFieldExpression)({ typeObject, expression });
|
|
17
|
-
return `${fieldObject.title} (progress bar)`;
|
|
14
|
+
return `${(0, get_field_label_1.getFieldLabel)({ typeObject, unit })} (progress bar)`;
|
|
18
15
|
},
|
|
19
16
|
getQuerySelect({ typeObject, unit: { expression } }) {
|
|
20
17
|
return (0, query_1.getQuerySelectForExpression)({
|
|
@@ -1,25 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RichTextSnippet = void 0;
|
|
3
|
+
exports.RichTextSnippet = exports.type = void 0;
|
|
4
4
|
const query_1 = require("@fibery/query-utils/src/query");
|
|
5
|
-
const utils_1 = require("@fibery/expression-utils/src/utils");
|
|
6
5
|
const common_1 = require("../unit-utils/common");
|
|
7
6
|
const get_export_value_1 = require("../unit-utils/get-export-value");
|
|
8
|
-
const
|
|
7
|
+
const get_field_label_1 = require("../unit-utils/get-field-label");
|
|
8
|
+
exports.type = "rich-text-snippet";
|
|
9
9
|
exports.RichTextSnippet = {
|
|
10
|
-
type,
|
|
10
|
+
type: exports.type,
|
|
11
11
|
name: "Snippet",
|
|
12
12
|
canEdit() {
|
|
13
13
|
return false;
|
|
14
14
|
},
|
|
15
|
-
makeUnit: (0, common_1.makeUnitMethod)(type),
|
|
15
|
+
makeUnit: (0, common_1.makeUnitMethod)(exports.type),
|
|
16
16
|
getLabel({ typeObject, unit }) {
|
|
17
|
-
|
|
18
|
-
const fieldObject = (0, utils_1.getFieldObjectByFieldExpression)({
|
|
19
|
-
typeObject,
|
|
20
|
-
expression,
|
|
21
|
-
});
|
|
22
|
-
return `${fieldObject.title} (Snippet)`;
|
|
17
|
+
return `${(0, get_field_label_1.getFieldLabel)({ typeObject, unit })} (Snippet)`;
|
|
23
18
|
},
|
|
24
19
|
getQuerySelect({ typeObject, unit: { expression } }) {
|
|
25
20
|
return (0, query_1.getQuerySelectForExpression)({
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getNumberExportValue = exports.getTitleExportValue = exports.getLocationExportValue = exports.getDateRangeExportValue = exports.formatDateRangeExportValue = exports.getSnippetExportValue = exports.getReferenceExportValue = exports.getReferenceCollectionExportValue = exports.getExportValue = void 0;
|
|
4
4
|
const query_1 = require("@fibery/query-utils/src/query");
|
|
5
|
+
const utils_1 = require("@fibery/expression-utils/src/utils");
|
|
5
6
|
const date_fns_1 = require("date-fns");
|
|
6
7
|
const number_1 = require("../field-utils/number");
|
|
7
8
|
const formatters_1 = require("./formatters");
|
|
@@ -51,7 +52,7 @@ const formatDateRangeExportValue = (value, fieldObject) => {
|
|
|
51
52
|
exports.formatDateRangeExportValue = formatDateRangeExportValue;
|
|
52
53
|
const getDateRangeExportValue = ({ object, unit, typeObject, }) => {
|
|
53
54
|
const value = (0, exports.getExportValue)({ object, unit });
|
|
54
|
-
const fieldObject = (0,
|
|
55
|
+
const fieldObject = (0, utils_1.getFieldObjectByFieldExpression)({ expression: unit.expression, typeObject });
|
|
55
56
|
return (0, exports.formatDateRangeExportValue)(value, fieldObject);
|
|
56
57
|
};
|
|
57
58
|
exports.getDateRangeExportValue = getDateRangeExportValue;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { FieldObject } from "@fibery/schema";
|
|
2
|
+
import { FieldExpression } from "@fibery/expression-utils/src/types";
|
|
3
|
+
export declare const wrapNormalizedInExpression: (innerNormalized: Record<string, unknown>, fieldObjects: FieldObject[], expression: FieldExpression) => Record<string, unknown>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.wrapNormalizedInExpression = void 0;
|
|
4
|
+
const wrapNormalizedInExpression = (innerNormalized, fieldObjects, expression) => [...expression].reverse().reduce((inner, field, reversedIndex) => {
|
|
5
|
+
const originalIndex = expression.length - 1 - reversedIndex;
|
|
6
|
+
const isTerminal = originalIndex === expression.length - 1;
|
|
7
|
+
if (!isTerminal) {
|
|
8
|
+
const { idField } = fieldObjects[originalIndex].typeObject;
|
|
9
|
+
const innerWithId = idField ? { [idField]: idField, ...inner } : inner;
|
|
10
|
+
return { [field]: innerWithId };
|
|
11
|
+
}
|
|
12
|
+
return { [field]: inner };
|
|
13
|
+
}, innerNormalized);
|
|
14
|
+
exports.wrapNormalizedInExpression = wrapNormalizedInExpression;
|
package/lib/src/units/board.d.ts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { TypeObject } from "@fibery/schema";
|
|
2
2
|
export declare const getTypeUnits: () => import("./types").PureUnit[], getUnitName: (unit: import("./types").Unit) => string | null, getUnitsForType: (typeObject: TypeObject, options?: {
|
|
3
|
-
|
|
3
|
+
parentFieldObjects?: import("@fibery/schema").FieldObject[];
|
|
4
4
|
showHiddenFields?: boolean;
|
|
5
5
|
isSharingMode?: boolean;
|
|
6
6
|
}) => {
|
|
7
7
|
unit: import("./types").Unit;
|
|
8
8
|
fieldObject: import("@fibery/schema").FieldObject;
|
|
9
9
|
}[], getUnitsForField: (fieldObject: import("@fibery/schema").FieldObject, options?: {
|
|
10
|
-
|
|
10
|
+
parentFieldObjects?: import("@fibery/schema").FieldObject[];
|
|
11
11
|
showHiddenFields?: boolean;
|
|
12
12
|
isSharingMode?: boolean;
|
|
13
13
|
}) => import("./types").Unit[], getUnitsForTypePerField: (typeObject: TypeObject, options?: {
|
|
14
|
-
|
|
14
|
+
parentFieldObjects?: import("@fibery/schema").FieldObject[];
|
|
15
15
|
showHiddenFields?: boolean;
|
|
16
16
|
isSharingMode?: boolean;
|
|
17
17
|
}) => {
|
|
18
18
|
fieldObject: import("@fibery/schema").FieldObject;
|
|
19
19
|
units: import("./types").Unit[];
|
|
20
20
|
}[], getUnitLabel: (typeObject: TypeObject, unit: import("./types").Unit) => string, getHardcodedUnitsForView: (typeObject: TypeObject) => ({
|
|
21
|
-
type: "avatar" | "avatar-collection" | "avatar-input" | "back-references-list" | "bool" | "bool-checkbox" | "collection-count" | "color-input" | "comments-list" | "date" | "date-time" | "date-time-combobox" | "date-range" | "date-range-combobox" | "email" | "email-input" | "emoji" | "field" | "files-gallery" | "files-list" | "files-list-item" | "files-l-list" | "files-l-list-item" | "file-reference" | "file-compact-collection" | "file-compact-reference" | "file-collection-count" | "geometry-preview" | "icon-button" | "icon-input" | "id" | "json-input" | "location" | "location-input" | "number" | "number-input" | "phone" | "phone-input" | "progress-bar" | "reference" | "reference-icon" | "reference-combobox" | "reference-collection" | "reference-collection-list" | "reference-collection-view" | "reference-collection-combobox" | "rich-text-snippet" | "rich-text-document" | "single-location-preview" | "text" | "text-input" | "title" | "title-input" | "url" | "url-input" | "user-role" | "user-role-input";
|
|
21
|
+
type: "avatar" | "avatar-collection" | "avatar-input" | "back-references-list" | "bool" | "bool-checkbox" | "collection-count" | "color-input" | "comments-list" | "date" | "date-time" | "date-time-range" | "date-time-combobox" | "date-range" | "date-range-combobox" | "email" | "email-input" | "emoji" | "field" | "files-collection" | "files-gallery" | "files-list" | "files-list-item" | "files-l-list" | "files-l-list-item" | "file-reference" | "file-compact-collection" | "file-compact-reference" | "file-collection-count" | "geometry-preview" | "icon-button" | "icon-input" | "id" | "json-input" | "location" | "location-input" | "number" | "number-input" | "phone" | "phone-input" | "progress-bar" | "reference" | "reference-icon" | "reference-combobox" | "reference-collection" | "reference-collection-list" | "reference-collection-view" | "reference-collection-combobox" | "rich-text-snippet" | "rich-text-document" | "single-location-preview" | "text" | "text-input" | "title" | "title-input" | "url" | "url-input" | "user-role" | "user-role-input";
|
|
22
22
|
expression: import("./types").UnitExpression;
|
|
23
23
|
kind: "field";
|
|
24
24
|
settings?: Record<string, unknown> | undefined;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
export declare const getTypeUnits: () => import("../types").PureUnit[], getUnitName: (unit: import("../types").Unit) => string | null, getUnitsForField: (fieldObject: import("@fibery/schema").FieldObject, options?: {
|
|
2
|
-
|
|
2
|
+
parentFieldObjects?: import("@fibery/schema").FieldObject[];
|
|
3
3
|
showHiddenFields?: boolean;
|
|
4
4
|
isSharingMode?: boolean;
|
|
5
5
|
}) => import("../types").Unit[], getUnitsForType: (typeObject: import("@fibery/schema").TypeObject, options?: {
|
|
6
|
-
|
|
6
|
+
parentFieldObjects?: import("@fibery/schema").FieldObject[];
|
|
7
7
|
showHiddenFields?: boolean;
|
|
8
8
|
isSharingMode?: boolean;
|
|
9
9
|
}) => {
|
|
10
10
|
unit: import("../types").Unit;
|
|
11
11
|
fieldObject: import("@fibery/schema").FieldObject;
|
|
12
12
|
}[], getUnitsForTypePerField: (typeObject: import("@fibery/schema").TypeObject, options?: {
|
|
13
|
-
|
|
13
|
+
parentFieldObjects?: import("@fibery/schema").FieldObject[];
|
|
14
14
|
showHiddenFields?: boolean;
|
|
15
15
|
isSharingMode?: boolean;
|
|
16
16
|
}) => {
|
|
@@ -21,7 +21,7 @@ export declare const getTypeUnits: () => import("../types").PureUnit[], getUnitN
|
|
|
21
21
|
typeObject: import("@fibery/schema").TypeObject;
|
|
22
22
|
units: import("../types").Unit[];
|
|
23
23
|
}) => any, getHardcodedUnitsForView: (typeObject: import("@fibery/schema").TypeObject) => ({
|
|
24
|
-
type: "avatar" | "avatar-collection" | "avatar-input" | "back-references-list" | "bool" | "bool-checkbox" | "collection-count" | "color-input" | "comments-list" | "date" | "date-time" | "date-time-combobox" | "date-range" | "date-range-combobox" | "email" | "email-input" | "emoji" | "field" | "files-gallery" | "files-list" | "files-list-item" | "files-l-list" | "files-l-list-item" | "file-reference" | "file-compact-collection" | "file-compact-reference" | "file-collection-count" | "geometry-preview" | "icon-button" | "icon-input" | "id" | "json-input" | "location" | "location-input" | "number" | "number-input" | "phone" | "phone-input" | "progress-bar" | "reference" | "reference-icon" | "reference-combobox" | "reference-collection" | "reference-collection-list" | "reference-collection-view" | "reference-collection-combobox" | "rich-text-snippet" | "rich-text-document" | "single-location-preview" | "text" | "text-input" | "title" | "title-input" | "url" | "url-input" | "user-role" | "user-role-input";
|
|
24
|
+
type: "avatar" | "avatar-collection" | "avatar-input" | "back-references-list" | "bool" | "bool-checkbox" | "collection-count" | "color-input" | "comments-list" | "date" | "date-time" | "date-time-range" | "date-time-combobox" | "date-range" | "date-range-combobox" | "email" | "email-input" | "emoji" | "field" | "files-collection" | "files-gallery" | "files-list" | "files-list-item" | "files-l-list" | "files-l-list-item" | "file-reference" | "file-compact-collection" | "file-compact-reference" | "file-collection-count" | "geometry-preview" | "icon-button" | "icon-input" | "id" | "json-input" | "location" | "location-input" | "number" | "number-input" | "phone" | "phone-input" | "progress-bar" | "reference" | "reference-icon" | "reference-combobox" | "reference-collection" | "reference-collection-list" | "reference-collection-view" | "reference-collection-combobox" | "rich-text-snippet" | "rich-text-document" | "single-location-preview" | "text" | "text-input" | "title" | "title-input" | "url" | "url-input" | "user-role" | "user-role-input";
|
|
25
25
|
expression: import("../types").UnitExpression;
|
|
26
26
|
kind: "field";
|
|
27
27
|
settings?: Record<string, unknown> | undefined;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { TypeObject } from "@fibery/schema";
|
|
2
2
|
export declare const getTypeUnits: () => import("./types").PureUnit[], getUnitName: (unit: import("./types").Unit) => string | null, getUnitsForType: (typeObject: TypeObject, options?: {
|
|
3
|
-
|
|
3
|
+
parentFieldObjects?: import("@fibery/schema").FieldObject[];
|
|
4
4
|
showHiddenFields?: boolean;
|
|
5
5
|
isSharingMode?: boolean;
|
|
6
6
|
}) => {
|
|
7
7
|
unit: import("./types").Unit;
|
|
8
8
|
fieldObject: import("@fibery/schema").FieldObject;
|
|
9
9
|
}[], getUnitsForField: (fieldObject: import("@fibery/schema").FieldObject, options?: {
|
|
10
|
-
|
|
10
|
+
parentFieldObjects?: import("@fibery/schema").FieldObject[];
|
|
11
11
|
showHiddenFields?: boolean;
|
|
12
12
|
isSharingMode?: boolean;
|
|
13
13
|
}) => import("./types").Unit[], getUnitsForTypePerField: (typeObject: TypeObject, options?: {
|
|
14
|
-
|
|
14
|
+
parentFieldObjects?: import("@fibery/schema").FieldObject[];
|
|
15
15
|
showHiddenFields?: boolean;
|
|
16
16
|
isSharingMode?: boolean;
|
|
17
17
|
}) => {
|
|
@@ -22,7 +22,7 @@ export declare const getTypeUnits: () => import("./types").PureUnit[], getUnitNa
|
|
|
22
22
|
typeObject: TypeObject;
|
|
23
23
|
units: import("./types").Unit[];
|
|
24
24
|
}) => any, getUnitLabel: (typeObject: TypeObject, unit: import("./types").Unit) => string, getHardcodedUnitsForView: (typeObject: TypeObject) => ({
|
|
25
|
-
type: "avatar" | "avatar-collection" | "avatar-input" | "back-references-list" | "bool" | "bool-checkbox" | "collection-count" | "color-input" | "comments-list" | "date" | "date-time" | "date-time-combobox" | "date-range" | "date-range-combobox" | "email" | "email-input" | "emoji" | "field" | "files-gallery" | "files-list" | "files-list-item" | "files-l-list" | "files-l-list-item" | "file-reference" | "file-compact-collection" | "file-compact-reference" | "file-collection-count" | "geometry-preview" | "icon-button" | "icon-input" | "id" | "json-input" | "location" | "location-input" | "number" | "number-input" | "phone" | "phone-input" | "progress-bar" | "reference" | "reference-icon" | "reference-combobox" | "reference-collection" | "reference-collection-list" | "reference-collection-view" | "reference-collection-combobox" | "rich-text-snippet" | "rich-text-document" | "single-location-preview" | "text" | "text-input" | "title" | "title-input" | "url" | "url-input" | "user-role" | "user-role-input";
|
|
25
|
+
type: "avatar" | "avatar-collection" | "avatar-input" | "back-references-list" | "bool" | "bool-checkbox" | "collection-count" | "color-input" | "comments-list" | "date" | "date-time" | "date-time-range" | "date-time-combobox" | "date-range" | "date-range-combobox" | "email" | "email-input" | "emoji" | "field" | "files-collection" | "files-gallery" | "files-list" | "files-list-item" | "files-l-list" | "files-l-list-item" | "file-reference" | "file-compact-collection" | "file-compact-reference" | "file-collection-count" | "geometry-preview" | "icon-button" | "icon-input" | "id" | "json-input" | "location" | "location-input" | "number" | "number-input" | "phone" | "phone-input" | "progress-bar" | "reference" | "reference-icon" | "reference-combobox" | "reference-collection" | "reference-collection-list" | "reference-collection-view" | "reference-collection-combobox" | "rich-text-snippet" | "rich-text-document" | "single-location-preview" | "text" | "text-input" | "title" | "title-input" | "url" | "url-input" | "user-role" | "user-role-input";
|
|
26
26
|
expression: import("./types").UnitExpression;
|
|
27
27
|
kind: "field";
|
|
28
28
|
settings?: Record<string, unknown> | undefined;
|
package/lib/src/units/gantt.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { TypeObject } from "@fibery/schema";
|
|
2
2
|
export declare const getTypeUnits: () => import("./types").PureUnit[], getUnitName: (unit: import("./types").Unit) => string | null, getUnitsForType: (typeObject: TypeObject, options?: {
|
|
3
|
-
|
|
3
|
+
parentFieldObjects?: import("@fibery/schema").FieldObject[];
|
|
4
4
|
showHiddenFields?: boolean;
|
|
5
5
|
isSharingMode?: boolean;
|
|
6
6
|
}) => {
|
|
7
7
|
unit: import("./types").Unit;
|
|
8
8
|
fieldObject: import("@fibery/schema").FieldObject;
|
|
9
9
|
}[], getUnitsForField: (fieldObject: import("@fibery/schema").FieldObject, options?: {
|
|
10
|
-
|
|
10
|
+
parentFieldObjects?: import("@fibery/schema").FieldObject[];
|
|
11
11
|
showHiddenFields?: boolean;
|
|
12
12
|
isSharingMode?: boolean;
|
|
13
13
|
}) => import("./types").Unit[], getUnitsForTypePerField: (typeObject: TypeObject, options?: {
|
|
14
|
-
|
|
14
|
+
parentFieldObjects?: import("@fibery/schema").FieldObject[];
|
|
15
15
|
showHiddenFields?: boolean;
|
|
16
16
|
isSharingMode?: boolean;
|
|
17
17
|
}) => {
|
|
@@ -22,7 +22,7 @@ export declare const getTypeUnits: () => import("./types").PureUnit[], getUnitNa
|
|
|
22
22
|
typeObject: TypeObject;
|
|
23
23
|
units: import("./types").Unit[];
|
|
24
24
|
}) => any, getUnitLabel: (typeObject: TypeObject, unit: import("./types").Unit) => string, getHardcodedUnitsForView: (typeObject: TypeObject) => ({
|
|
25
|
-
type: "avatar" | "avatar-collection" | "avatar-input" | "back-references-list" | "bool" | "bool-checkbox" | "collection-count" | "color-input" | "comments-list" | "date" | "date-time" | "date-time-combobox" | "date-range" | "date-range-combobox" | "email" | "email-input" | "emoji" | "field" | "files-gallery" | "files-list" | "files-list-item" | "files-l-list" | "files-l-list-item" | "file-reference" | "file-compact-collection" | "file-compact-reference" | "file-collection-count" | "geometry-preview" | "icon-button" | "icon-input" | "id" | "json-input" | "location" | "location-input" | "number" | "number-input" | "phone" | "phone-input" | "progress-bar" | "reference" | "reference-icon" | "reference-combobox" | "reference-collection" | "reference-collection-list" | "reference-collection-view" | "reference-collection-combobox" | "rich-text-snippet" | "rich-text-document" | "single-location-preview" | "text" | "text-input" | "title" | "title-input" | "url" | "url-input" | "user-role" | "user-role-input";
|
|
25
|
+
type: "avatar" | "avatar-collection" | "avatar-input" | "back-references-list" | "bool" | "bool-checkbox" | "collection-count" | "color-input" | "comments-list" | "date" | "date-time" | "date-time-range" | "date-time-combobox" | "date-range" | "date-range-combobox" | "email" | "email-input" | "emoji" | "field" | "files-collection" | "files-gallery" | "files-list" | "files-list-item" | "files-l-list" | "files-l-list-item" | "file-reference" | "file-compact-collection" | "file-compact-reference" | "file-collection-count" | "geometry-preview" | "icon-button" | "icon-input" | "id" | "json-input" | "location" | "location-input" | "number" | "number-input" | "phone" | "phone-input" | "progress-bar" | "reference" | "reference-icon" | "reference-combobox" | "reference-collection" | "reference-collection-list" | "reference-collection-view" | "reference-collection-combobox" | "rich-text-snippet" | "rich-text-document" | "single-location-preview" | "text" | "text-input" | "title" | "title-input" | "url" | "url-input" | "user-role" | "user-role-input";
|
|
26
26
|
expression: import("./types").UnitExpression;
|
|
27
27
|
kind: "field";
|
|
28
28
|
settings?: Record<string, unknown> | undefined;
|
package/lib/src/units/grid.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
export declare const getTypeUnits: () => import("./types").PureUnit[], getUnitName: (unit: import("./types").Unit) => string | null, getUnitsForType: (typeObject: import("@fibery/schema").TypeObject, options?: {
|
|
2
|
-
|
|
2
|
+
parentFieldObjects?: import("@fibery/schema").FieldObject[];
|
|
3
3
|
showHiddenFields?: boolean;
|
|
4
4
|
isSharingMode?: boolean;
|
|
5
5
|
}) => {
|
|
6
6
|
unit: import("./types").Unit;
|
|
7
7
|
fieldObject: import("@fibery/schema").FieldObject;
|
|
8
8
|
}[], getUnitsForField: (fieldObject: import("@fibery/schema").FieldObject, options?: {
|
|
9
|
-
|
|
9
|
+
parentFieldObjects?: import("@fibery/schema").FieldObject[];
|
|
10
10
|
showHiddenFields?: boolean;
|
|
11
11
|
isSharingMode?: boolean;
|
|
12
12
|
}) => import("./types").Unit[], getUnitsForTypePerField: (typeObject: import("@fibery/schema").TypeObject, options?: {
|
|
13
|
-
|
|
13
|
+
parentFieldObjects?: import("@fibery/schema").FieldObject[];
|
|
14
14
|
showHiddenFields?: boolean;
|
|
15
15
|
isSharingMode?: boolean;
|
|
16
16
|
}) => {
|
|
@@ -21,7 +21,7 @@ export declare const getTypeUnits: () => import("./types").PureUnit[], getUnitNa
|
|
|
21
21
|
typeObject: import("@fibery/schema").TypeObject;
|
|
22
22
|
units: import("./types").Unit[];
|
|
23
23
|
}) => any, getHardcodedUnitsForView: (typeObject: import("@fibery/schema").TypeObject) => ({
|
|
24
|
-
type: "avatar" | "avatar-collection" | "avatar-input" | "back-references-list" | "bool" | "bool-checkbox" | "collection-count" | "color-input" | "comments-list" | "date" | "date-time" | "date-time-combobox" | "date-range" | "date-range-combobox" | "email" | "email-input" | "emoji" | "field" | "files-gallery" | "files-list" | "files-list-item" | "files-l-list" | "files-l-list-item" | "file-reference" | "file-compact-collection" | "file-compact-reference" | "file-collection-count" | "geometry-preview" | "icon-button" | "icon-input" | "id" | "json-input" | "location" | "location-input" | "number" | "number-input" | "phone" | "phone-input" | "progress-bar" | "reference" | "reference-icon" | "reference-combobox" | "reference-collection" | "reference-collection-list" | "reference-collection-view" | "reference-collection-combobox" | "rich-text-snippet" | "rich-text-document" | "single-location-preview" | "text" | "text-input" | "title" | "title-input" | "url" | "url-input" | "user-role" | "user-role-input";
|
|
24
|
+
type: "avatar" | "avatar-collection" | "avatar-input" | "back-references-list" | "bool" | "bool-checkbox" | "collection-count" | "color-input" | "comments-list" | "date" | "date-time" | "date-time-range" | "date-time-combobox" | "date-range" | "date-range-combobox" | "email" | "email-input" | "emoji" | "field" | "files-collection" | "files-gallery" | "files-list" | "files-list-item" | "files-l-list" | "files-l-list-item" | "file-reference" | "file-compact-collection" | "file-compact-reference" | "file-collection-count" | "geometry-preview" | "icon-button" | "icon-input" | "id" | "json-input" | "location" | "location-input" | "number" | "number-input" | "phone" | "phone-input" | "progress-bar" | "reference" | "reference-icon" | "reference-combobox" | "reference-collection" | "reference-collection-list" | "reference-collection-view" | "reference-collection-combobox" | "rich-text-snippet" | "rich-text-document" | "single-location-preview" | "text" | "text-input" | "title" | "title-input" | "url" | "url-input" | "user-role" | "user-role-input";
|
|
25
25
|
expression: import("./types").UnitExpression;
|
|
26
26
|
kind: "field";
|
|
27
27
|
settings?: Record<string, unknown> | undefined;
|
package/lib/src/units/list.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { TypeObject } from "@fibery/schema";
|
|
2
2
|
export declare const getTypeUnits: () => import("./types").PureUnit[], getUnitName: (unit: import("./types").Unit) => string | null, getUnitsForType: (typeObject: TypeObject, options?: {
|
|
3
|
-
|
|
3
|
+
parentFieldObjects?: import("@fibery/schema").FieldObject[];
|
|
4
4
|
showHiddenFields?: boolean;
|
|
5
5
|
isSharingMode?: boolean;
|
|
6
6
|
}) => {
|
|
7
7
|
unit: import("./types").Unit;
|
|
8
8
|
fieldObject: import("@fibery/schema").FieldObject;
|
|
9
9
|
}[], getUnitsForField: (fieldObject: import("@fibery/schema").FieldObject, options?: {
|
|
10
|
-
|
|
10
|
+
parentFieldObjects?: import("@fibery/schema").FieldObject[];
|
|
11
11
|
showHiddenFields?: boolean;
|
|
12
12
|
isSharingMode?: boolean;
|
|
13
13
|
}) => import("./types").Unit[], getUnitsForTypePerField: (typeObject: TypeObject, options?: {
|
|
14
|
-
|
|
14
|
+
parentFieldObjects?: import("@fibery/schema").FieldObject[];
|
|
15
15
|
showHiddenFields?: boolean;
|
|
16
16
|
isSharingMode?: boolean;
|
|
17
17
|
}) => {
|
|
@@ -22,7 +22,7 @@ export declare const getTypeUnits: () => import("./types").PureUnit[], getUnitNa
|
|
|
22
22
|
typeObject: TypeObject;
|
|
23
23
|
units: import("./types").Unit[];
|
|
24
24
|
}) => any, getHardcodedUnitsForView: (typeObject: TypeObject) => ({
|
|
25
|
-
type: "avatar" | "avatar-collection" | "avatar-input" | "back-references-list" | "bool" | "bool-checkbox" | "collection-count" | "color-input" | "comments-list" | "date" | "date-time" | "date-time-combobox" | "date-range" | "date-range-combobox" | "email" | "email-input" | "emoji" | "field" | "files-gallery" | "files-list" | "files-list-item" | "files-l-list" | "files-l-list-item" | "file-reference" | "file-compact-collection" | "file-compact-reference" | "file-collection-count" | "geometry-preview" | "icon-button" | "icon-input" | "id" | "json-input" | "location" | "location-input" | "number" | "number-input" | "phone" | "phone-input" | "progress-bar" | "reference" | "reference-icon" | "reference-combobox" | "reference-collection" | "reference-collection-list" | "reference-collection-view" | "reference-collection-combobox" | "rich-text-snippet" | "rich-text-document" | "single-location-preview" | "text" | "text-input" | "title" | "title-input" | "url" | "url-input" | "user-role" | "user-role-input";
|
|
25
|
+
type: "avatar" | "avatar-collection" | "avatar-input" | "back-references-list" | "bool" | "bool-checkbox" | "collection-count" | "color-input" | "comments-list" | "date" | "date-time" | "date-time-range" | "date-time-combobox" | "date-range" | "date-range-combobox" | "email" | "email-input" | "emoji" | "field" | "files-collection" | "files-gallery" | "files-list" | "files-list-item" | "files-l-list" | "files-l-list-item" | "file-reference" | "file-compact-collection" | "file-compact-reference" | "file-collection-count" | "geometry-preview" | "icon-button" | "icon-input" | "id" | "json-input" | "location" | "location-input" | "number" | "number-input" | "phone" | "phone-input" | "progress-bar" | "reference" | "reference-icon" | "reference-combobox" | "reference-collection" | "reference-collection-list" | "reference-collection-view" | "reference-collection-combobox" | "rich-text-snippet" | "rich-text-document" | "single-location-preview" | "text" | "text-input" | "title" | "title-input" | "url" | "url-input" | "user-role" | "user-role-input";
|
|
26
26
|
expression: import("./types").UnitExpression;
|
|
27
27
|
kind: "field";
|
|
28
28
|
settings?: Record<string, unknown> | undefined;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { FieldExpression } from "@fibery/expression-utils";
|
|
2
1
|
import { FieldObject, Schema, TypeObject } from "@fibery/schema";
|
|
3
2
|
import { ButtonUnit, DbUnit, FieldUnit, Unit, UnitDataDefinition, UnitExpression } from "./types";
|
|
4
3
|
type AnyUnitDataDefinition = UnitDataDefinition<FieldUnit> | UnitDataDefinition<DbUnit> | UnitDataDefinition<ButtonUnit>;
|
|
5
4
|
type UnitCreationOptions = {
|
|
6
|
-
|
|
5
|
+
parentFieldObjects?: FieldObject[];
|
|
7
6
|
showHiddenFields?: boolean;
|
|
8
7
|
isSharingMode?: boolean;
|
|
9
8
|
};
|
|
@@ -19,7 +18,7 @@ export declare const makeUnitDefinitionsFactory: (allUnitDefinitions: Record<str
|
|
|
19
18
|
}[];
|
|
20
19
|
getUnitsForField: (fieldObject: FieldObject, options?: UnitCreationOptions) => Unit[];
|
|
21
20
|
getHardcodedUnitsForView: (typeObject: TypeObject) => ({
|
|
22
|
-
type: "avatar" | "avatar-collection" | "avatar-input" | "back-references-list" | "bool" | "bool-checkbox" | "collection-count" | "color-input" | "comments-list" | "date" | "date-time" | "date-time-combobox" | "date-range" | "date-range-combobox" | "email" | "email-input" | "emoji" | "field" | "files-gallery" | "files-list" | "files-list-item" | "files-l-list" | "files-l-list-item" | "file-reference" | "file-compact-collection" | "file-compact-reference" | "file-collection-count" | "geometry-preview" | "icon-button" | "icon-input" | "id" | "json-input" | "location" | "location-input" | "number" | "number-input" | "phone" | "phone-input" | "progress-bar" | "reference" | "reference-icon" | "reference-combobox" | "reference-collection" | "reference-collection-list" | "reference-collection-view" | "reference-collection-combobox" | "rich-text-snippet" | "rich-text-document" | "single-location-preview" | "text" | "text-input" | "title" | "title-input" | "url" | "url-input" | "user-role" | "user-role-input";
|
|
21
|
+
type: "avatar" | "avatar-collection" | "avatar-input" | "back-references-list" | "bool" | "bool-checkbox" | "collection-count" | "color-input" | "comments-list" | "date" | "date-time" | "date-time-range" | "date-time-combobox" | "date-range" | "date-range-combobox" | "email" | "email-input" | "emoji" | "field" | "files-collection" | "files-gallery" | "files-list" | "files-list-item" | "files-l-list" | "files-l-list-item" | "file-reference" | "file-compact-collection" | "file-compact-reference" | "file-collection-count" | "geometry-preview" | "icon-button" | "icon-input" | "id" | "json-input" | "location" | "location-input" | "number" | "number-input" | "phone" | "phone-input" | "progress-bar" | "reference" | "reference-icon" | "reference-combobox" | "reference-collection" | "reference-collection-list" | "reference-collection-view" | "reference-collection-combobox" | "rich-text-snippet" | "rich-text-document" | "single-location-preview" | "text" | "text-input" | "title" | "title-input" | "url" | "url-input" | "user-role" | "user-role-input";
|
|
23
22
|
expression: UnitExpression;
|
|
24
23
|
kind: "field";
|
|
25
24
|
settings?: Record<string, unknown> | undefined;
|
|
@@ -66,7 +66,12 @@ const makeUnitDefinitionsFactory = (allUnitDefinitions) => {
|
|
|
66
66
|
const creator = unitsFactoryByBasicFieldType[fieldObject.type] || fallbackFieldCreator;
|
|
67
67
|
return creator(fieldObject);
|
|
68
68
|
},
|
|
69
|
-
":field/reference": (fieldObject) => {
|
|
69
|
+
":field/reference": (fieldObject, options) => {
|
|
70
|
+
const parentFieldObjects = options.parentFieldObjects ?? [];
|
|
71
|
+
// Parent path goes through a collection — we can only render the collection as a result, and only via relation view
|
|
72
|
+
if (parentFieldObjects.some((f) => f.isCollection)) {
|
|
73
|
+
return options.isSharingMode ? [] : [ReferenceCollectionView];
|
|
74
|
+
}
|
|
70
75
|
if (FileReference && FileCompactReference && fieldObject.typeObject.name === "fibery/file") {
|
|
71
76
|
return [FileLListItem, FileCompactReference, FileListItem, FileReference].filter(Boolean);
|
|
72
77
|
}
|
|
@@ -81,9 +86,13 @@ const makeUnitDefinitionsFactory = (allUnitDefinitions) => {
|
|
|
81
86
|
];
|
|
82
87
|
},
|
|
83
88
|
":field/reference-collection": (fieldObject, options) => {
|
|
84
|
-
const
|
|
89
|
+
const parentFieldObjects = options.parentFieldObjects ?? [];
|
|
85
90
|
const common = [CollectionCount, (0, avatar_1.isAvatarExtensionEnabledType)(fieldObject.typeObject) && AvatarCollection];
|
|
86
|
-
|
|
91
|
+
// Parent path goes through a collection — we can only render the collection as a result, and only via relation view
|
|
92
|
+
if (parentFieldObjects.some((f) => f.isCollection)) {
|
|
93
|
+
return options.isSharingMode ? [] : [ReferenceCollectionView];
|
|
94
|
+
}
|
|
95
|
+
if ((0, relation_view_1.isRelationViewField)(fieldObject) && !options.isSharingMode) {
|
|
87
96
|
return [...common, ReferenceCollection, ReferenceCollectionCombobox, ReferenceCollectionView];
|
|
88
97
|
}
|
|
89
98
|
if ((0, back_references_1.isReferenceExtensionField)(fieldObject)) {
|
|
@@ -114,9 +123,11 @@ const makeUnitDefinitionsFactory = (allUnitDefinitions) => {
|
|
|
114
123
|
},
|
|
115
124
|
};
|
|
116
125
|
const getUnitsForField = (fieldObject, options = {}) => {
|
|
117
|
-
const { showHiddenFields
|
|
126
|
+
const { showHiddenFields } = options;
|
|
127
|
+
const parentFieldObjects = options.parentFieldObjects ?? [];
|
|
128
|
+
const parentExpression = parentFieldObjects.map((f) => f.name);
|
|
118
129
|
const makeUnit = (Unit) => Unit.makeUnit({ expression: [...parentExpression, fieldObject.name] });
|
|
119
|
-
const isTopLevel =
|
|
130
|
+
const isTopLevel = parentFieldObjects.length === 0;
|
|
120
131
|
if (fieldObject.isPublicId && isTopLevel) {
|
|
121
132
|
return [Id].filter(Boolean).map(makeUnit);
|
|
122
133
|
}
|
|
@@ -220,8 +231,8 @@ const makeUnitDefinitionsFactory = (allUnitDefinitions) => {
|
|
|
220
231
|
.filter((unit) => {
|
|
221
232
|
return ((0, common_1.isUnitEnabled)(unit) &&
|
|
222
233
|
unit.kind !== "user-button" &&
|
|
223
|
-
unit.expression?.
|
|
224
|
-
unit.expression?.
|
|
234
|
+
!unit.expression?.includes("documents/documents") &&
|
|
235
|
+
!unit.expression?.includes("whiteboards/whiteboards"));
|
|
225
236
|
})
|
|
226
237
|
.map((unit) => {
|
|
227
238
|
const unitExpressionErrors = (0, common_1.calculateUnitExpressionErrors)({ typeObject, unit });
|
package/lib/src/units/types.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export type DbUnit = {
|
|
|
24
24
|
};
|
|
25
25
|
export type FieldUnit = {
|
|
26
26
|
kind: "field";
|
|
27
|
-
type: "avatar" | "avatar-collection" | "avatar-input" | "back-references-list" | "bool" | "bool-checkbox" | "collection-count" | "color-input" | "comments-list" | "date" | "date-time" | "date-time-combobox" | "date-range" | "date-range-combobox" | "email" | "email-input" | "emoji" | "field" | "files-gallery" | "files-list" | "files-list-item" | "files-l-list" | "files-l-list-item" | "file-reference" | "file-compact-collection" | "file-compact-reference" | "file-collection-count" | "geometry-preview" | "icon-button" | "icon-input" | "id" | "json-input" | "location" | "location-input" | "number" | "number-input" | "phone" | "phone-input" | "progress-bar" | "reference" | "reference-icon" | "reference-combobox" | "reference-collection" | "reference-collection-list" | "reference-collection-view" | "reference-collection-combobox" | "rich-text-snippet" | "rich-text-document" | "single-location-preview" | "text" | "text-input" | "title" | "title-input" | "url" | "url-input" | "user-role" | "user-role-input";
|
|
27
|
+
type: "avatar" | "avatar-collection" | "avatar-input" | "back-references-list" | "bool" | "bool-checkbox" | "collection-count" | "color-input" | "comments-list" | "date" | "date-time" | "date-time-range" | "date-time-combobox" | "date-range" | "date-range-combobox" | "email" | "email-input" | "emoji" | "field" | "files-collection" | "files-gallery" | "files-list" | "files-list-item" | "files-l-list" | "files-l-list-item" | "file-reference" | "file-compact-collection" | "file-compact-reference" | "file-collection-count" | "geometry-preview" | "icon-button" | "icon-input" | "id" | "json-input" | "location" | "location-input" | "number" | "number-input" | "phone" | "phone-input" | "progress-bar" | "reference" | "reference-icon" | "reference-combobox" | "reference-collection" | "reference-collection-list" | "reference-collection-view" | "reference-collection-combobox" | "rich-text-snippet" | "rich-text-document" | "single-location-preview" | "text" | "text-input" | "title" | "title-input" | "url" | "url-input" | "user-role" | "user-role-input";
|
|
28
28
|
expression: UnitExpression;
|
|
29
29
|
checked?: boolean;
|
|
30
30
|
settings?: Record<string, unknown>;
|