@fibery/views 19.0.0 → 19.1.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.
- package/lib/src/errors.d.ts +2 -0
- package/lib/src/errors.js +6 -0
- package/lib/src/field-utils/avatar.d.ts +1 -1
- package/lib/src/field-utils/avatar.js +1 -1
- package/lib/src/field-utils/back-references.d.ts +1 -1
- package/lib/src/field-utils/comments.d.ts +1 -1
- package/lib/src/field-utils/date-time.d.ts +5 -5
- package/lib/src/field-utils/date-time.js +1 -1
- package/lib/src/field-utils/enum-value.d.ts +1 -1
- package/lib/src/field-utils/file.d.ts +1 -1
- package/lib/src/field-utils/file.js +1 -1
- package/lib/src/field-utils/icon.d.ts +1 -1
- package/lib/src/field-utils/number.d.ts +1 -1
- package/lib/src/field-utils/reference-collection.d.ts +2 -2
- package/lib/src/field-utils/reference-collection.js +4 -4
- package/lib/src/field-utils/reference.d.ts +2 -2
- package/lib/src/field-utils/reference.js +4 -4
- package/lib/src/field-utils/relation-view.d.ts +1 -1
- package/lib/src/field-utils/rich-text.d.ts +2 -2
- package/lib/src/field-utils/rich-text.js +1 -1
- package/lib/src/field-utils/text.d.ts +1 -1
- package/lib/src/field-utils/user-active.d.ts +2 -2
- package/lib/src/field-utils/user-role.d.ts +1 -1
- package/lib/src/field-utils/workflow.d.ts +2 -2
- package/lib/src/index.d.ts +30 -16
- package/lib/src/index.js +7 -2
- package/lib/src/meta-validation.d.ts +10 -0
- package/lib/src/meta-validation.js +78 -0
- 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.d.ts +1 -1
- package/lib/src/unit-definitions/avatar-collection.js +5 -10
- package/lib/src/unit-definitions/avatar-input.d.ts +1 -1
- package/lib/src/unit-definitions/avatar-input.js +1 -1
- package/lib/src/unit-definitions/avatar.d.ts +1 -1
- package/lib/src/unit-definitions/avatar.js +5 -7
- package/lib/src/unit-definitions/back-references-list.d.ts +1 -1
- package/lib/src/unit-definitions/back-references-list.js +3 -3
- package/lib/src/unit-definitions/bool-checkbox.d.ts +1 -1
- package/lib/src/unit-definitions/bool-checkbox.js +2 -2
- package/lib/src/unit-definitions/bool.d.ts +1 -1
- package/lib/src/unit-definitions/bool.js +1 -1
- package/lib/src/unit-definitions/collection-count.d.ts +1 -1
- package/lib/src/unit-definitions/collection-count.js +4 -2
- package/lib/src/unit-definitions/color-input.d.ts +1 -1
- package/lib/src/unit-definitions/color-input.js +1 -1
- package/lib/src/unit-definitions/comments-list.d.ts +1 -1
- package/lib/src/unit-definitions/comments-list.js +1 -1
- package/lib/src/unit-definitions/date-range-combobox.d.ts +1 -1
- package/lib/src/unit-definitions/date-range-combobox.js +1 -1
- package/lib/src/unit-definitions/date-range.d.ts +1 -1
- package/lib/src/unit-definitions/date-range.js +1 -1
- package/lib/src/unit-definitions/date-time-combobox.d.ts +1 -1
- package/lib/src/unit-definitions/date-time-combobox.js +2 -2
- package/lib/src/unit-definitions/date.d.ts +1 -1
- package/lib/src/unit-definitions/date.js +2 -2
- package/lib/src/unit-definitions/email-input.d.ts +1 -1
- package/lib/src/unit-definitions/email-input.js +1 -1
- package/lib/src/unit-definitions/email.d.ts +1 -1
- package/lib/src/unit-definitions/email.js +1 -1
- package/lib/src/unit-definitions/emoji.d.ts +1 -1
- package/lib/src/unit-definitions/emoji.js +1 -1
- package/lib/src/unit-definitions/file-collection-count.d.ts +1 -1
- package/lib/src/unit-definitions/file-collection-count.js +11 -9
- package/lib/src/unit-definitions/file-compact-collection.d.ts +1 -1
- package/lib/src/unit-definitions/file-compact-collection.js +11 -9
- package/lib/src/unit-definitions/file-compact-reference.d.ts +1 -1
- package/lib/src/unit-definitions/file-compact-reference.js +3 -12
- package/lib/src/unit-definitions/file-reference.d.ts +1 -1
- package/lib/src/unit-definitions/file-reference.js +8 -6
- package/lib/src/unit-definitions/files-gallery.d.ts +1 -1
- package/lib/src/unit-definitions/files-gallery.js +11 -9
- package/lib/src/unit-definitions/files-l-list-item.d.ts +1 -1
- package/lib/src/unit-definitions/files-l-list-item.js +8 -6
- package/lib/src/unit-definitions/files-l-list.d.ts +1 -1
- package/lib/src/unit-definitions/files-l-list.js +11 -9
- package/lib/src/unit-definitions/files-list-item.d.ts +1 -1
- package/lib/src/unit-definitions/files-list-item.js +8 -6
- package/lib/src/unit-definitions/files-list.d.ts +1 -1
- package/lib/src/unit-definitions/files-list.js +11 -9
- package/lib/src/unit-definitions/geometry-preview.d.ts +1 -1
- package/lib/src/unit-definitions/geometry-preview.js +1 -1
- package/lib/src/unit-definitions/icon-button.d.ts +1 -1
- package/lib/src/unit-definitions/icon-button.js +1 -1
- package/lib/src/unit-definitions/icon-input.d.ts +1 -1
- package/lib/src/unit-definitions/icon-input.js +1 -1
- package/lib/src/unit-definitions/id.d.ts +1 -1
- package/lib/src/unit-definitions/json-input.d.ts +1 -1
- package/lib/src/unit-definitions/json-input.js +1 -1
- package/lib/src/unit-definitions/location-input.d.ts +1 -1
- package/lib/src/unit-definitions/location-input.js +1 -1
- package/lib/src/unit-definitions/location.d.ts +1 -1
- package/lib/src/unit-definitions/location.js +1 -1
- package/lib/src/unit-definitions/not-found.d.ts +1 -1
- package/lib/src/unit-definitions/number-input.d.ts +1 -1
- package/lib/src/unit-definitions/number-input.js +2 -2
- package/lib/src/unit-definitions/number.d.ts +1 -1
- package/lib/src/unit-definitions/number.js +2 -4
- package/lib/src/unit-definitions/phone-input.d.ts +1 -1
- package/lib/src/unit-definitions/phone-input.js +1 -1
- package/lib/src/unit-definitions/phone.d.ts +1 -1
- package/lib/src/unit-definitions/phone.js +1 -1
- package/lib/src/unit-definitions/progress-bar.d.ts +1 -1
- package/lib/src/unit-definitions/progress-bar.js +1 -4
- package/lib/src/unit-definitions/reference-collection-combobox.d.ts +1 -1
- package/lib/src/unit-definitions/reference-collection-combobox.js +1 -1
- package/lib/src/unit-definitions/reference-collection-list.d.ts +1 -1
- package/lib/src/unit-definitions/reference-collection-list.js +1 -1
- package/lib/src/unit-definitions/reference-collection-view.d.ts +1 -1
- package/lib/src/unit-definitions/reference-collection-view.js +1 -1
- package/lib/src/unit-definitions/reference-collection.d.ts +1 -1
- package/lib/src/unit-definitions/reference-collection.js +3 -3
- package/lib/src/unit-definitions/reference-combobox.d.ts +1 -1
- package/lib/src/unit-definitions/reference-combobox.js +1 -1
- package/lib/src/unit-definitions/reference-icon.d.ts +1 -1
- package/lib/src/unit-definitions/reference-icon.js +1 -1
- package/lib/src/unit-definitions/reference.d.ts +1 -1
- package/lib/src/unit-definitions/reference.js +1 -1
- package/lib/src/unit-definitions/rich-text-document.d.ts +1 -1
- package/lib/src/unit-definitions/rich-text-document.js +2 -2
- package/lib/src/unit-definitions/rich-text-snippet.d.ts +2 -1
- package/lib/src/unit-definitions/rich-text-snippet.js +6 -11
- package/lib/src/unit-definitions/single-location-preview.d.ts +1 -1
- package/lib/src/unit-definitions/single-location-preview.js +1 -1
- package/lib/src/unit-definitions/text-input.d.ts +1 -1
- package/lib/src/unit-definitions/text-input.js +2 -2
- package/lib/src/unit-definitions/text.d.ts +1 -1
- package/lib/src/unit-definitions/text.js +2 -2
- package/lib/src/unit-definitions/title-input.d.ts +1 -1
- package/lib/src/unit-definitions/title.d.ts +1 -1
- package/lib/src/unit-definitions/type-badge-abbr.d.ts +1 -1
- package/lib/src/unit-definitions/type-badge.d.ts +1 -1
- package/lib/src/unit-definitions/type-icon.d.ts +1 -1
- package/lib/src/unit-definitions/url-input.d.ts +1 -1
- package/lib/src/unit-definitions/url-input.js +1 -1
- package/lib/src/unit-definitions/url.d.ts +1 -1
- package/lib/src/unit-definitions/url.js +1 -1
- package/lib/src/unit-definitions/user-button.d.ts +1 -1
- package/lib/src/unit-definitions/user-role-input.d.ts +1 -1
- package/lib/src/unit-definitions/user-role-input.js +1 -1
- package/lib/src/unit-definitions/user-role.d.ts +1 -1
- package/lib/src/unit-definitions/user-role.js +1 -1
- package/lib/src/unit-utils/access.d.ts +2 -2
- package/lib/src/unit-utils/can-edit-field.d.ts +2 -2
- package/lib/src/unit-utils/common.d.ts +3 -3
- package/lib/src/unit-utils/common.js +1 -1
- package/lib/src/unit-utils/enums.d.ts +2 -2
- package/lib/src/unit-utils/formatters.d.ts +2 -2
- package/lib/src/unit-utils/get-export-value.d.ts +4 -4
- package/lib/src/unit-utils/get-export-value.js +3 -3
- package/lib/src/unit-utils/get-field-label.d.ts +2 -2
- package/lib/src/unit-utils/get-unmatched-unit-label.d.ts +1 -1
- package/lib/src/unit-utils/schema.d.ts +1 -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 +5 -5
- package/lib/src/units/board.js +1 -1
- package/lib/src/units/canvas/index.d.ts +4 -4
- package/lib/src/units/canvas/index.js +1 -1
- package/lib/src/units/canvas/type-badge-abbr.d.ts +1 -1
- package/lib/src/units/canvas/type-badge.d.ts +1 -1
- package/lib/src/units/default.d.ts +5 -5
- package/lib/src/units/default.js +1 -1
- package/lib/src/units/gallery.d.ts +1 -1
- package/lib/src/units/gantt.d.ts +5 -5
- package/lib/src/units/gantt.js +1 -1
- package/lib/src/units/get-unit-definitions-for-view-type.js +4 -4
- package/lib/src/units/grid.d.ts +4 -4
- package/lib/src/units/grid.js +7 -7
- package/lib/src/units/list.d.ts +5 -5
- package/lib/src/units/list.js +1 -1
- package/lib/src/units/make-factory.d.ts +4 -5
- package/lib/src/units/make-factory.js +26 -15
- package/lib/src/units/types.d.ts +5 -5
- package/package.json +18 -18
- package/lib/jest.config.cjs +0 -34
- package/lib/jest.config.d.cts +0 -3
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/grid.js
CHANGED
|
@@ -2,36 +2,36 @@
|
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.getDefaultUnits = exports.getHardcodedUnitsForView = exports.getCardUnitsSelect = exports.getUnitLabel = exports.getUnitsForTypePerField = exports.getUnitsForField = exports.getUnitsForType = exports.getUnitName = exports.getTypeUnits = void 0;
|
|
5
|
-
const
|
|
6
|
-
const avatar_collection_1 = require("../unit-definitions/avatar-collection");
|
|
5
|
+
const file_reference_1 = require("@fibery/views/src/unit-definitions/file-reference");
|
|
7
6
|
const avatar_1 = require("../unit-definitions/avatar");
|
|
7
|
+
const avatar_collection_1 = require("../unit-definitions/avatar-collection");
|
|
8
8
|
const bool_1 = require("../unit-definitions/bool");
|
|
9
9
|
const collection_count_1 = require("../unit-definitions/collection-count");
|
|
10
10
|
const date_1 = require("../unit-definitions/date");
|
|
11
11
|
const date_range_1 = require("../unit-definitions/date-range");
|
|
12
12
|
const email_1 = require("../unit-definitions/email");
|
|
13
13
|
const emoji_1 = require("../unit-definitions/emoji");
|
|
14
|
+
const file_collection_count_1 = require("../unit-definitions/file-collection-count");
|
|
15
|
+
const files_gallery_1 = require("../unit-definitions/files-gallery");
|
|
14
16
|
const icon_button_1 = require("../unit-definitions/icon-button");
|
|
15
17
|
const id_1 = require("../unit-definitions/id");
|
|
16
18
|
const location_1 = require("../unit-definitions/location");
|
|
17
19
|
const number_1 = require("../unit-definitions/number");
|
|
18
20
|
const phone_1 = require("../unit-definitions/phone");
|
|
19
21
|
const progress_bar_1 = require("../unit-definitions/progress-bar");
|
|
20
|
-
const reference_collection_1 = require("../unit-definitions/reference-collection");
|
|
21
22
|
const reference_1 = require("../unit-definitions/reference");
|
|
23
|
+
const reference_collection_1 = require("../unit-definitions/reference-collection");
|
|
22
24
|
const reference_icon_1 = require("../unit-definitions/reference-icon");
|
|
23
25
|
const rich_text_snippet_1 = require("../unit-definitions/rich-text-snippet");
|
|
24
26
|
const text_1 = require("../unit-definitions/text");
|
|
25
27
|
const title_1 = require("../unit-definitions/title");
|
|
26
|
-
const type_badge_abbr_1 = require("../unit-definitions/type-badge-abbr");
|
|
27
28
|
const type_badge_1 = require("../unit-definitions/type-badge");
|
|
29
|
+
const type_badge_abbr_1 = require("../unit-definitions/type-badge-abbr");
|
|
28
30
|
const type_icon_1 = require("../unit-definitions/type-icon");
|
|
29
31
|
const url_1 = require("../unit-definitions/url");
|
|
30
32
|
const user_button_1 = require("../unit-definitions/user-button");
|
|
31
33
|
const user_role_1 = require("../unit-definitions/user-role");
|
|
32
|
-
const
|
|
33
|
-
const files_gallery_1 = require("../unit-definitions/files-gallery");
|
|
34
|
-
const file_reference_1 = require("@fibery/views/src/unit-definitions/file-reference");
|
|
34
|
+
const make_factory_1 = require("./make-factory");
|
|
35
35
|
const allUnitDefinitions = {
|
|
36
36
|
AvatarCollection: avatar_collection_1.AvatarCollection,
|
|
37
37
|
Bool: bool_1.Bool,
|
package/lib/src/units/list.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { TypeObject } from "@fibery/schema";
|
|
1
|
+
import type { 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;
|
package/lib/src/units/list.js
CHANGED
|
@@ -36,8 +36,8 @@ var _a;
|
|
|
36
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
37
|
exports.getDefaultUnits = exports.getHardcodedUnitsForView = exports.getCardUnitsSelect = exports.getUnitLabel = exports.getUnitsForTypePerField = exports.getUnitsForField = exports.getUnitsForType = exports.getUnitName = exports.getTypeUnits = void 0;
|
|
38
38
|
const avatar_1 = require("../field-utils/avatar");
|
|
39
|
-
const make_factory_1 = require("./make-factory");
|
|
40
39
|
const allUnitDefinitions = __importStar(require("../unit-definitions"));
|
|
40
|
+
const make_factory_1 = require("./make-factory");
|
|
41
41
|
_a = (0, make_factory_1.makeUnitDefinitionsFactory)(allUnitDefinitions), exports.getTypeUnits = _a.getTypeUnits, exports.getUnitName = _a.getUnitName, exports.getUnitsForType = _a.getUnitsForType, exports.getUnitsForField = _a.getUnitsForField, exports.getUnitsForTypePerField = _a.getUnitsForTypePerField, exports.getUnitLabel = _a.getUnitLabel, exports.getCardUnitsSelect = _a.getCardUnitsSelect, exports.getHardcodedUnitsForView = _a.getHardcodedUnitsForView;
|
|
42
42
|
const getDefaultUnits = (typeObject) => {
|
|
43
43
|
const { Title, Avatar } = allUnitDefinitions;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { ButtonUnit, DbUnit, FieldUnit, Unit, UnitDataDefinition, UnitExpression } from "./types";
|
|
1
|
+
import type { FieldObject, Schema, TypeObject } from "@fibery/schema";
|
|
2
|
+
import type { 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;
|
|
@@ -4,6 +4,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.makeUnitDefinitionsFactory = void 0;
|
|
7
|
+
const array_1 = require("@fibery/helpers/utils/array");
|
|
8
|
+
const trace_1 = require("@fibery/helpers/utils/trace");
|
|
9
|
+
const select_1 = require("@fibery/query-utils/src/select");
|
|
7
10
|
const compact_1 = __importDefault(require("lodash/compact"));
|
|
8
11
|
const constant_1 = __importDefault(require("lodash/constant"));
|
|
9
12
|
const flatMap_1 = __importDefault(require("lodash/flatMap"));
|
|
@@ -11,18 +14,15 @@ const groupBy_1 = __importDefault(require("lodash/groupBy"));
|
|
|
11
14
|
const isPlainObject_1 = __importDefault(require("lodash/isPlainObject"));
|
|
12
15
|
const mapValues_1 = __importDefault(require("lodash/mapValues"));
|
|
13
16
|
const sortBy_1 = __importDefault(require("lodash/sortBy"));
|
|
14
|
-
const trace_1 = require("@fibery/helpers/utils/trace");
|
|
15
|
-
const number_1 = require("../field-utils/number");
|
|
16
|
-
const text_1 = require("../field-utils/text");
|
|
17
17
|
const avatar_1 = require("../field-utils/avatar");
|
|
18
|
-
const comments_1 = require("../field-utils/comments");
|
|
19
18
|
const back_references_1 = require("../field-utils/back-references");
|
|
19
|
+
const comments_1 = require("../field-utils/comments");
|
|
20
|
+
const number_1 = require("../field-utils/number");
|
|
20
21
|
const relation_view_1 = require("../field-utils/relation-view");
|
|
21
|
-
const
|
|
22
|
-
const common_1 = require("../unit-utils/common");
|
|
23
|
-
const not_found_1 = require("../unit-definitions/not-found");
|
|
24
|
-
const array_1 = require("@fibery/helpers/utils/array");
|
|
22
|
+
const text_1 = require("../field-utils/text");
|
|
25
23
|
const user_role_1 = require("../field-utils/user-role");
|
|
24
|
+
const not_found_1 = require("../unit-definitions/not-found");
|
|
25
|
+
const common_1 = require("../unit-utils/common");
|
|
26
26
|
const NoUnitsCreator = () => [];
|
|
27
27
|
const makeUnitDefinitionsFactory = (allUnitDefinitions) => {
|
|
28
28
|
const { BackReferencesList, Bool, BoolCheckbox, ColorInput, CommentsList, Text, TextInput, Email, EmailInput, Emoji, IconInput, JsonInput, Number, NumberInput, ProgressBar, ReferenceCombobox, ReferenceCollection, ReferenceCollectionList, ReferenceCollectionView, ReferenceCollectionCombobox, FileReference, FileCompactReference, FilesGallery, FileList, FileListItem, FileLList, FileLListItem, FileCollectionCount, FileCompactCollection, Date, DateTimeCombobox, DateRange, DateRangeCombobox, Avatar, AvatarCollection, AvatarInput, CollectionCount, Reference, ReferenceIcon, TypeIcon, TypeBadge, TypeBadgeAbbr, Title, TitleInput, Id, UserButton, Phone, PhoneInput, Location, LocationInput, SingleLocationPreview, GeometryPreview, RichText, RichTextSnippet, RichTextDocument, CommentsCollection, Url, UrlInput, UserRole, UserRoleInput, IconButton, } = allUnitDefinitions;
|
|
@@ -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
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import type { FiberyObject } from "@fibery/expression-utils/src/types";
|
|
2
|
+
import type { Schema, TypeObject } from "@fibery/schema";
|
|
3
|
+
import type { NumberDisplaySettings } from "../field-utils/number";
|
|
4
|
+
import type { $TSFixMe } from "../tsfixme";
|
|
5
5
|
export type ButtonUnit = {
|
|
6
6
|
kind: "user-button";
|
|
7
7
|
type: "user-button" | "icon-button";
|
|
@@ -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>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fibery/views",
|
|
3
|
-
"version": "19.
|
|
3
|
+
"version": "19.1.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Operations on view objects",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -11,23 +11,26 @@
|
|
|
11
11
|
"main": "./lib/index.js",
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|
|
14
|
-
"types": "./lib/index.d.ts",
|
|
15
14
|
"@fibery/source": "./index.ts",
|
|
15
|
+
"types": "./lib/index.d.ts",
|
|
16
16
|
"default": "./lib/index.js"
|
|
17
17
|
},
|
|
18
18
|
"./src/*": {
|
|
19
|
+
"@fibery/source": {
|
|
20
|
+
"types": "./src/*.ts",
|
|
21
|
+
"default": "./src/*"
|
|
22
|
+
},
|
|
19
23
|
"types": "./lib/src/*.d.ts",
|
|
20
|
-
"@fibery/source": "./src/*",
|
|
21
24
|
"default": "./lib/src/*.js"
|
|
22
25
|
},
|
|
23
26
|
"./src/unit-definitions": {
|
|
24
|
-
"types": "./lib/src/unit-definitions/index.d.ts",
|
|
25
27
|
"@fibery/source": "./src/unit-definitions/index.ts",
|
|
28
|
+
"types": "./lib/src/unit-definitions/index.d.ts",
|
|
26
29
|
"default": "./lib/src/unit-definitions/index.js"
|
|
27
30
|
},
|
|
28
31
|
"./src/units/canvas": {
|
|
29
|
-
"types": "./lib/src/units/canvas/index.d.ts",
|
|
30
32
|
"@fibery/source": "./src/units/canvas/index.ts",
|
|
33
|
+
"types": "./lib/src/units/canvas/index.d.ts",
|
|
31
34
|
"default": "./lib/src/units/canvas/index.js"
|
|
32
35
|
}
|
|
33
36
|
},
|
|
@@ -36,32 +39,29 @@
|
|
|
36
39
|
"lodash": "4.17.21",
|
|
37
40
|
"moment": "2.29.4",
|
|
38
41
|
"@fibery/context-filters": "1.1.4",
|
|
39
|
-
"@fibery/expression-utils": "9.7.
|
|
40
|
-
"@fibery/
|
|
41
|
-
"@fibery/
|
|
42
|
-
"@fibery/
|
|
42
|
+
"@fibery/expression-utils": "9.7.1",
|
|
43
|
+
"@fibery/query-utils": "1.1.6",
|
|
44
|
+
"@fibery/schema": "10.2.16",
|
|
45
|
+
"@fibery/helpers": "2.0.1"
|
|
43
46
|
},
|
|
44
47
|
"devDependencies": {
|
|
45
48
|
"@babel/core": "7.28.5",
|
|
46
|
-
"@swc/jest": "0.2.39",
|
|
47
49
|
"@types/lodash": "4.14.172",
|
|
48
50
|
"immutability-helper": "2.4.0",
|
|
49
|
-
"
|
|
50
|
-
"jest-junit": "16.0.0",
|
|
51
|
-
"typescript": "6.0.0-beta",
|
|
51
|
+
"typescript": "6.0.1-rc",
|
|
52
52
|
"@fibery/babel-preset": "7.4.2"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
|
-
"@fibery/expression-utils": "^9.7.
|
|
56
|
-
"@fibery/schema": "^10.2.
|
|
55
|
+
"@fibery/expression-utils": "^9.7.1",
|
|
56
|
+
"@fibery/schema": "^10.2.16",
|
|
57
57
|
"immutability-helper": "^2.4.0",
|
|
58
58
|
"lodash": "4.17.21"
|
|
59
59
|
},
|
|
60
60
|
"scripts": {
|
|
61
61
|
"build": "rm -rf lib && tsc --project tsconfig.build.json",
|
|
62
|
-
"test": "
|
|
63
|
-
"test:ci": "
|
|
64
|
-
"test:coverage": "
|
|
62
|
+
"test": "../../scripts/test.sh",
|
|
63
|
+
"test:ci": "../../scripts/test.sh --ci",
|
|
64
|
+
"test:coverage": "../../scripts/test.sh --ci --coverage",
|
|
65
65
|
"check": "../../scripts/check.sh",
|
|
66
66
|
"lint": "../../scripts/lint.sh"
|
|
67
67
|
},
|
package/lib/jest.config.cjs
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/** @type {import('@jest/schemas').InitialOptions} */
|
|
3
|
-
const config = {
|
|
4
|
-
testEnvironment: "node",
|
|
5
|
-
testEnvironmentOptions: {
|
|
6
|
-
customExportConditions: ["@fibery/source"],
|
|
7
|
-
url: "http://localhost",
|
|
8
|
-
},
|
|
9
|
-
coveragePathIgnorePatterns: ["/node_modules/"],
|
|
10
|
-
collectCoverageFrom: ["src/**/*.{js,jsx,ts,tsx}", "!src/**/*.d.ts"],
|
|
11
|
-
coverageReporters: ["text", "cobertura"],
|
|
12
|
-
testPathIgnorePatterns: ["<rootDir>[/\\\\](build|docs|node_modules|scripts)[/\\\\]"],
|
|
13
|
-
transform: {
|
|
14
|
-
"^.+\\.(js|jsx|ts|tsx)$": [
|
|
15
|
-
"@swc/jest",
|
|
16
|
-
{
|
|
17
|
-
jsc: {
|
|
18
|
-
parser: {
|
|
19
|
-
syntax: "typescript",
|
|
20
|
-
tsx: true,
|
|
21
|
-
decorators: true,
|
|
22
|
-
dynamicImport: true,
|
|
23
|
-
},
|
|
24
|
-
transform: {
|
|
25
|
-
react: {
|
|
26
|
-
runtime: "automatic",
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
],
|
|
32
|
-
},
|
|
33
|
-
};
|
|
34
|
-
module.exports = config;
|
package/lib/jest.config.d.cts
DELETED