@fibery/views 26.0.6 → 26.0.8
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/_virtual/_rolldown/runtime.js +1 -2
- package/lib/errors.d.ts +1 -3
- package/lib/errors.js +1 -2
- package/lib/field-utils/avatar.d.ts +1 -3
- package/lib/field-utils/avatar.js +1 -2
- package/lib/field-utils/back-references.d.ts +1 -3
- package/lib/field-utils/back-references.js +1 -2
- package/lib/field-utils/comments.d.ts +1 -3
- package/lib/field-utils/comments.js +1 -2
- package/lib/field-utils/date-time.d.ts +1 -3
- package/lib/field-utils/date-time.js +1 -2
- package/lib/field-utils/enum-value.d.ts +1 -3
- package/lib/field-utils/enum-value.js +1 -2
- package/lib/field-utils/file.d.ts +1 -3
- package/lib/field-utils/file.js +1 -2
- package/lib/field-utils/icon.d.ts +1 -3
- package/lib/field-utils/icon.js +1 -2
- package/lib/field-utils/number.d.ts +1 -3
- package/lib/field-utils/number.js +5 -8
- package/lib/field-utils/reference-collection.d.ts +1 -3
- package/lib/field-utils/reference-collection.js +7 -20
- package/lib/field-utils/reference.d.ts +1 -3
- package/lib/field-utils/reference.js +3 -4
- package/lib/field-utils/relation-view.d.ts +1 -3
- package/lib/field-utils/relation-view.js +1 -2
- package/lib/field-utils/rich-text.d.ts +1 -3
- package/lib/field-utils/rich-text.js +4 -15
- package/lib/field-utils/text.d.ts +1 -3
- package/lib/field-utils/text.js +1 -2
- package/lib/field-utils/user-active.d.ts +1 -3
- package/lib/field-utils/user-active.js +1 -2
- package/lib/field-utils/user-role.d.ts +1 -3
- package/lib/field-utils/user-role.js +1 -2
- package/lib/field-utils/workflow.d.ts +1 -3
- package/lib/field-utils/workflow.js +1 -2
- package/lib/filter.d.ts +1 -3
- package/lib/index.d.ts +2 -4
- package/lib/index.js +2 -3
- package/lib/meta-validation.d.ts +1 -3
- package/lib/meta-validation.js +5 -9
- package/lib/private/board.d.ts +1 -3
- package/lib/private/board.js +4 -5
- package/lib/private/calendar.d.ts +1 -3
- package/lib/private/calendar.js +2 -3
- package/lib/private/feed.d.ts +1 -3
- package/lib/private/feed.js +2 -3
- package/lib/private/form.d.ts +1 -3
- package/lib/private/form.js +1 -2
- package/lib/private/map.d.ts +1 -3
- package/lib/private/map.js +2 -3
- package/lib/private/smart-folder.d.ts +1 -3
- package/lib/private/smart-folder.js +5 -6
- package/lib/private/timeline.d.ts +1 -3
- package/lib/private/timeline.js +6 -7
- package/lib/private/units.d.ts +1 -3
- package/lib/private/units.js +17 -2
- package/lib/private/utils.d.ts +1 -3
- package/lib/private/utils.js +3 -5
- package/lib/refs.d.ts +1 -3
- package/lib/unit-definitions/avatar-collection.d.ts +1 -3
- package/lib/unit-definitions/avatar-collection.js +3 -15
- package/lib/unit-definitions/avatar-input.d.ts +2 -4
- package/lib/unit-definitions/avatar-input.js +1 -2
- package/lib/unit-definitions/avatar.d.ts +2 -4
- package/lib/unit-definitions/avatar.js +3 -14
- package/lib/unit-definitions/back-references-list.d.ts +3 -5
- package/lib/unit-definitions/back-references-list.js +2 -3
- package/lib/unit-definitions/bool-checkbox.d.ts +2 -4
- package/lib/unit-definitions/bool-checkbox.js +2 -3
- package/lib/unit-definitions/bool.d.ts +2 -4
- package/lib/unit-definitions/bool.js +2 -3
- package/lib/unit-definitions/collection-count.d.ts +2 -4
- package/lib/unit-definitions/collection-count.js +1 -2
- package/lib/unit-definitions/color-input.d.ts +2 -4
- package/lib/unit-definitions/color-input.js +2 -3
- package/lib/unit-definitions/comments-list.d.ts +2 -4
- package/lib/unit-definitions/comments-list.js +2 -3
- package/lib/unit-definitions/date-range-combobox.d.ts +2 -4
- package/lib/unit-definitions/date-range-combobox.js +2 -3
- package/lib/unit-definitions/date-range.d.ts +2 -4
- package/lib/unit-definitions/date-range.js +2 -3
- package/lib/unit-definitions/date-time-combobox.d.ts +2 -4
- package/lib/unit-definitions/date-time-combobox.js +2 -3
- package/lib/unit-definitions/date.d.ts +2 -4
- package/lib/unit-definitions/date.js +2 -3
- package/lib/unit-definitions/email-input.d.ts +4 -6
- package/lib/unit-definitions/email-input.js +1 -2
- package/lib/unit-definitions/email.d.ts +3 -5
- package/lib/unit-definitions/email.js +1 -2
- package/lib/unit-definitions/emoji.d.ts +3 -5
- package/lib/unit-definitions/emoji.js +1 -2
- package/lib/unit-definitions/file-collection-count.d.ts +2 -4
- package/lib/unit-definitions/file-collection-count.js +2 -3
- package/lib/unit-definitions/file-compact-collection.d.ts +2 -4
- package/lib/unit-definitions/file-compact-collection.js +2 -3
- package/lib/unit-definitions/file-compact-reference.d.ts +1 -3
- package/lib/unit-definitions/file-compact-reference.js +1 -2
- package/lib/unit-definitions/file-reference.d.ts +2 -4
- package/lib/unit-definitions/file-reference.js +2 -3
- package/lib/unit-definitions/files-gallery.d.ts +2 -4
- package/lib/unit-definitions/files-gallery.js +2 -3
- package/lib/unit-definitions/files-l-list-item.d.ts +2 -4
- package/lib/unit-definitions/files-l-list-item.js +2 -3
- package/lib/unit-definitions/files-l-list.d.ts +2 -4
- package/lib/unit-definitions/files-l-list.js +2 -3
- package/lib/unit-definitions/files-list-item.d.ts +2 -4
- package/lib/unit-definitions/files-list-item.js +2 -3
- package/lib/unit-definitions/files-list.d.ts +2 -4
- package/lib/unit-definitions/files-list.js +2 -3
- package/lib/unit-definitions/geometry-preview.d.ts +3 -5
- package/lib/unit-definitions/geometry-preview.js +1 -2
- package/lib/unit-definitions/icon-button.d.ts +2 -4
- package/lib/unit-definitions/icon-button.js +2 -3
- package/lib/unit-definitions/icon-input.d.ts +4 -6
- package/lib/unit-definitions/icon-input.js +1 -2
- package/lib/unit-definitions/id.d.ts +1 -3
- package/lib/unit-definitions/id.js +1 -2
- package/lib/unit-definitions/index.d.ts +4 -3
- package/lib/unit-definitions/index.js +6 -5
- package/lib/unit-definitions/json-input.d.ts +2 -4
- package/lib/unit-definitions/json-input.js +2 -3
- package/lib/unit-definitions/json-preview.d.ts +26 -0
- package/lib/unit-definitions/json-preview.js +31 -0
- package/lib/unit-definitions/location-input.d.ts +3 -5
- package/lib/unit-definitions/location-input.js +1 -2
- package/lib/unit-definitions/location.d.ts +3 -5
- package/lib/unit-definitions/location.js +1 -2
- package/lib/unit-definitions/not-found.d.ts +1 -3
- package/lib/unit-definitions/not-found.js +0 -1
- package/lib/unit-definitions/number-input.d.ts +2 -4
- package/lib/unit-definitions/number-input.js +2 -3
- package/lib/unit-definitions/number.d.ts +1 -3
- package/lib/unit-definitions/number.js +1 -2
- package/lib/unit-definitions/phone-input.d.ts +4 -6
- package/lib/unit-definitions/phone-input.js +1 -2
- package/lib/unit-definitions/phone.d.ts +4 -6
- package/lib/unit-definitions/phone.js +1 -2
- package/lib/unit-definitions/progress-bar.d.ts +1 -3
- package/lib/unit-definitions/progress-bar.js +1 -2
- package/lib/unit-definitions/reference-collection-combobox.d.ts +2 -4
- package/lib/unit-definitions/reference-collection-combobox.js +2 -3
- package/lib/unit-definitions/reference-collection-list.d.ts +2 -4
- package/lib/unit-definitions/reference-collection-list.js +2 -3
- package/lib/unit-definitions/reference-collection-view.d.ts +2 -4
- package/lib/unit-definitions/reference-collection-view.js +2 -3
- package/lib/unit-definitions/reference-collection.d.ts +2 -4
- package/lib/unit-definitions/reference-collection.js +2 -3
- package/lib/unit-definitions/reference-combobox.d.ts +2 -4
- package/lib/unit-definitions/reference-combobox.js +2 -3
- package/lib/unit-definitions/reference-icon.d.ts +3 -5
- package/lib/unit-definitions/reference-icon.js +1 -2
- package/lib/unit-definitions/reference.d.ts +1 -3
- package/lib/unit-definitions/reference.js +3 -14
- package/lib/unit-definitions/rich-text-document.d.ts +2 -4
- package/lib/unit-definitions/rich-text-document.js +2 -3
- package/lib/unit-definitions/rich-text-snippet.d.ts +1 -3
- package/lib/unit-definitions/rich-text-snippet.js +1 -2
- package/lib/unit-definitions/single-location-preview.d.ts +3 -5
- package/lib/unit-definitions/single-location-preview.js +1 -2
- package/lib/unit-definitions/text-input.d.ts +2 -4
- package/lib/unit-definitions/text-input.js +2 -3
- package/lib/unit-definitions/text.d.ts +2 -4
- package/lib/unit-definitions/text.js +2 -3
- package/lib/unit-definitions/title-input.d.ts +1 -3
- package/lib/unit-definitions/title-input.js +1 -2
- package/lib/unit-definitions/title.d.ts +2 -4
- package/lib/unit-definitions/title.js +1 -2
- package/lib/unit-definitions/type-badge-abbr.d.ts +1 -3
- package/lib/unit-definitions/type-badge-abbr.js +1 -2
- package/lib/unit-definitions/type-badge.d.ts +1 -3
- package/lib/unit-definitions/type-badge.js +1 -2
- package/lib/unit-definitions/type-icon.d.ts +1 -3
- package/lib/unit-definitions/type-icon.js +1 -2
- package/lib/unit-definitions/url-input.d.ts +4 -6
- package/lib/unit-definitions/url-input.js +1 -2
- package/lib/unit-definitions/url.d.ts +3 -5
- package/lib/unit-definitions/url.js +1 -2
- package/lib/unit-definitions/user-button.d.ts +1 -3
- package/lib/unit-definitions/user-button.js +1 -2
- package/lib/unit-definitions/user-role-input.d.ts +3 -5
- package/lib/unit-definitions/user-role-input.js +1 -2
- package/lib/unit-definitions/user-role.d.ts +3 -5
- package/lib/unit-definitions/user-role.js +2 -3
- package/lib/unit-utils/access.d.ts +1 -3
- package/lib/unit-utils/access.js +1 -2
- package/lib/unit-utils/can-edit-field.d.ts +1 -3
- package/lib/unit-utils/can-edit-field.js +1 -2
- package/lib/unit-utils/common.d.ts +2 -4
- package/lib/unit-utils/common.js +1 -2
- package/lib/unit-utils/decimal.d.ts +0 -2
- package/lib/unit-utils/decimal.js +1 -2
- package/lib/unit-utils/dynamic-keys.d.ts +1 -3
- package/lib/unit-utils/dynamic-keys.js +1 -2
- package/lib/unit-utils/enums.d.ts +1 -3
- package/lib/unit-utils/enums.js +2 -3
- package/lib/unit-utils/formatters.d.ts +1 -3
- package/lib/unit-utils/formatters.js +3 -5
- package/lib/unit-utils/get-export-value.d.ts +1 -3
- package/lib/unit-utils/get-export-value.js +1 -2
- package/lib/unit-utils/get-field-label.d.ts +1 -3
- package/lib/unit-utils/get-field-label.js +1 -2
- package/lib/unit-utils/get-unmatched-unit-label.d.ts +1 -3
- package/lib/unit-utils/get-unmatched-unit-label.js +2 -4
- package/lib/unit-utils/wrap-normalized-in-expression.d.ts +2 -3
- package/lib/unit-utils/wrap-normalized-in-expression.js +15 -14
- package/lib/units/board.d.ts +1 -3
- package/lib/units/board.js +1 -2
- package/lib/units/canvas/all-units-data-definitions.d.ts +5 -5
- package/lib/units/canvas/all-units-data-definitions.js +6 -7
- package/lib/units/canvas/index.d.ts +0 -1
- package/lib/units/canvas/index.js +1 -2
- package/lib/units/canvas/type-badge-abbr.d.ts +1 -3
- package/lib/units/canvas/type-badge-abbr.js +1 -2
- package/lib/units/canvas/type-badge.d.ts +1 -3
- package/lib/units/canvas/type-badge.js +1 -2
- package/lib/units/default.d.ts +0 -1
- package/lib/units/default.js +1 -2
- package/lib/units/gallery.d.ts +0 -2
- package/lib/units/gallery.js +1 -2
- package/lib/units/gantt.d.ts +1 -3
- package/lib/units/gantt.js +1 -2
- package/lib/units/get-unit-definitions-for-view-type.d.ts +1 -3
- package/lib/units/get-unit-definitions-for-view-type.js +2 -3
- package/lib/units/grid.d.ts +1 -3
- package/lib/units/grid.js +8 -7
- package/lib/units/list.d.ts +1 -3
- package/lib/units/list.js +1 -2
- package/lib/units/make-factory.d.ts +1 -3
- package/lib/units/make-factory.js +20 -28
- package/lib/units/types.d.ts +2 -4
- package/package.json +7 -9
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// \0rolldown/runtime.js
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __exportAll = (all, no_symbols) => {
|
|
4
4
|
let target = {};
|
|
@@ -9,5 +9,4 @@ var __exportAll = (all, no_symbols) => {
|
|
|
9
9
|
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
10
10
|
return target;
|
|
11
11
|
};
|
|
12
|
-
//#endregion
|
|
13
12
|
export { __exportAll };
|
package/lib/errors.d.ts
CHANGED
package/lib/errors.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { FieldObject, TypeObject } from "@fibery/schema";
|
|
2
|
-
//#region src/field-utils/avatar.d.ts
|
|
3
2
|
export declare const AVATAR_MIXIN_NAME = "avatar/avatar-mixin";
|
|
4
3
|
export declare const AVATAR_EXTENSION_FIELD = "avatar/avatars";
|
|
5
4
|
export declare const isAvatarExtensionEnabledType: (typeObject: TypeObject) => boolean;
|
|
@@ -18,5 +17,4 @@ export declare const getAvatarSelectQuery: ({ typeObject }: {
|
|
|
18
17
|
} | {
|
|
19
18
|
"fibery/id"?: undefined;
|
|
20
19
|
__NOTHING_INTERESTING__TitleField__?: undefined;
|
|
21
|
-
};
|
|
22
|
-
//#endregion
|
|
20
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { truthy } from "@fibery/helpers/src/_";
|
|
2
2
|
import { toSelectMapClause } from "@fibery/query-utils/src/select";
|
|
3
|
-
|
|
3
|
+
// src/field-utils/avatar.ts
|
|
4
4
|
const AVATAR_MIXIN_NAME = "avatar/avatar-mixin";
|
|
5
5
|
const AVATAR_EXTENSION_FIELD = "avatar/avatars";
|
|
6
6
|
const isAvatarExtensionEnabledType = (typeObject) => {
|
|
@@ -31,5 +31,4 @@ const getAvatarSelectQuery = ({ typeObject }) => {
|
|
|
31
31
|
};
|
|
32
32
|
} else return {};
|
|
33
33
|
};
|
|
34
|
-
//#endregion
|
|
35
34
|
export { AVATAR_EXTENSION_FIELD, AVATAR_MIXIN_NAME, getAvatarSelect, getAvatarSelectQuery, isAvatarExtensionEnabledType, isAvatarExtensionField };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { EntityId, FieldObject, TypeId, TypeObject } from "@fibery/schema";
|
|
2
2
|
import { FiberyObject, Projection } from "@fibery/expression-utils/src/types";
|
|
3
|
-
//#region src/field-utils/back-references.d.ts
|
|
4
3
|
export declare const isReferenceExtensionField: (fieldObject: FieldObject) => boolean;
|
|
5
4
|
export type EntityLinkProjection = FiberyObject & {
|
|
6
5
|
"fibery/creation-date": string;
|
|
@@ -14,5 +13,4 @@ export type EntityLinkProjection = FiberyObject & {
|
|
|
14
13
|
"fibery/id": string;
|
|
15
14
|
} | null;
|
|
16
15
|
};
|
|
17
|
-
export declare const getEntityLinksListSelect: (typeObject: TypeObject) => Projection<EntityLinkProjection>;
|
|
18
|
-
//#endregion
|
|
16
|
+
export declare const getEntityLinksListSelect: (typeObject: TypeObject) => Projection<EntityLinkProjection>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/field-utils/back-references.ts
|
|
2
2
|
const isReferenceExtensionField = (fieldObject) => fieldObject.type === "Collaboration~Documents/Reference";
|
|
3
3
|
const getEntityLinksListSelect = (typeObject) => {
|
|
4
4
|
return {
|
|
@@ -11,5 +11,4 @@ const getEntityLinksListSelect = (typeObject) => {
|
|
|
11
11
|
"fibery/created-by": { "fibery/id": ["fibery/created-by", "fibery/id"] }
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
|
-
//#endregion
|
|
15
14
|
export { getEntityLinksListSelect, isReferenceExtensionField };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { accessCheckKey } from "../unit-utils/access.js";
|
|
2
2
|
import { FieldObject, TypeObject } from "@fibery/schema";
|
|
3
|
-
//#region src/field-utils/comments.d.ts
|
|
4
3
|
export declare const isCommentExtensionField: (fieldObject: FieldObject) => boolean;
|
|
5
4
|
export declare const getCommentsListSelect: (typeObject: TypeObject) => {
|
|
6
5
|
"fibery/id": "fibery/id";
|
|
@@ -58,5 +57,4 @@ export declare const getQuerySelect: (fieldObject: FieldObject) => {
|
|
|
58
57
|
"q/order-by": import("@fibery/schema").OrderBy | undefined;
|
|
59
58
|
"q/limit": string;
|
|
60
59
|
};
|
|
61
|
-
};
|
|
62
|
-
//#endregion
|
|
60
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { accessCheckKey } from "../unit-utils/access.js";
|
|
2
2
|
import { calculateDefaultOrderBy } from "@fibery/query-utils/src/query";
|
|
3
|
-
|
|
3
|
+
// src/field-utils/comments.ts
|
|
4
4
|
const isCommentExtensionField = (fieldObject) => fieldObject.name === "comments/comments";
|
|
5
5
|
const getCommentsListSelect = (typeObject) => {
|
|
6
6
|
return {
|
|
@@ -37,5 +37,4 @@ const getQuerySelect = (fieldObject) => {
|
|
|
37
37
|
"q/limit": "q/no-limit"
|
|
38
38
|
} };
|
|
39
39
|
};
|
|
40
|
-
//#endregion
|
|
41
40
|
export { getCommentsListSelect, getQuerySelect, isCommentExtensionField };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Moment, MomentInput, unitOfTime } from "moment/moment";
|
|
2
|
-
//#region src/field-utils/date-time.d.ts
|
|
3
2
|
export declare const parseDate: (isoDate: MomentInput) => Moment;
|
|
4
3
|
export declare const serializeDate: (momentDate: Moment) => string;
|
|
5
4
|
export declare const parseDateTime: (isoDateTime: MomentInput) => Moment;
|
|
@@ -12,5 +11,4 @@ export declare const parseEnd: ({ value, type, minimumDelta }: {
|
|
|
12
11
|
value: MomentInput;
|
|
13
12
|
type: string;
|
|
14
13
|
minimumDelta?: [number, unitOfTime.DurationConstructor] | null;
|
|
15
|
-
}) => Moment;
|
|
16
|
-
//#endregion
|
|
14
|
+
}) => Moment;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isDateTimeType, isDateType, isRangeType } from "@fibery/expression-utils/src/utils";
|
|
2
2
|
import { NotImplementedError } from "@fibery/expression-utils/src/errors";
|
|
3
3
|
import moment from "moment/moment.js";
|
|
4
|
-
|
|
4
|
+
// src/field-utils/date-time.ts
|
|
5
5
|
const defaultDateDelta = [1, "day"];
|
|
6
6
|
const defaultDateTimeDelta = [1, "second"];
|
|
7
7
|
const parseDate = (isoDate) => {
|
|
@@ -29,5 +29,4 @@ const parseEnd = ({ value, type, minimumDelta = null }) => {
|
|
|
29
29
|
if (isDateTimeType(type)) return parseDateTime(value).subtract(...minimumDelta || defaultDateTimeDelta).startOf("second");
|
|
30
30
|
throw new NotImplementedError(type);
|
|
31
31
|
};
|
|
32
|
-
//#endregion
|
|
33
32
|
export { parseDate, parseDateTime, parseEnd, parseStart, serializeDate, serializeDateTime };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { NumberFormat } from "./number.js";
|
|
2
2
|
import { FieldObject, SpaceName, TypeObject } from "@fibery/schema";
|
|
3
|
-
//#region src/field-utils/enum-value.d.ts
|
|
4
3
|
export declare const enumNumberFieldName = "Value";
|
|
5
4
|
export declare const getEnumNumberFieldName: (namespace: SpaceName) => string;
|
|
6
5
|
export declare const defaultEnumNumberFieldMeta: {
|
|
@@ -11,5 +10,4 @@ export declare const defaultEnumNumberFieldMeta: {
|
|
|
11
10
|
numberUseThousandSeparator: boolean;
|
|
12
11
|
};
|
|
13
12
|
export declare const getIsNumberFieldObjectTaken: (typeObject: TypeObject) => boolean;
|
|
14
|
-
export declare const getNumberFieldObject: (typeObject: TypeObject) => FieldObject | undefined;
|
|
15
|
-
//#endregion
|
|
13
|
+
export declare const getNumberFieldObject: (typeObject: TypeObject) => FieldObject | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./number.js";
|
|
2
|
-
|
|
2
|
+
// src/field-utils/enum-value.ts
|
|
3
3
|
const enumNumberFieldName = "Value";
|
|
4
4
|
const getEnumNumberFieldName = (namespace) => `${namespace}/${enumNumberFieldName}`;
|
|
5
5
|
const defaultEnumNumberFieldMeta = {
|
|
@@ -22,5 +22,4 @@ const getNumberFieldObject = (typeObject) => {
|
|
|
22
22
|
return fieldObject.nameParts.name === "Value" && isNumeric(fieldObject);
|
|
23
23
|
});
|
|
24
24
|
};
|
|
25
|
-
//#endregion
|
|
26
25
|
export { defaultEnumNumberFieldMeta, enumNumberFieldName, getEnumNumberFieldName, getIsNumberFieldObjectTaken, getNumberFieldObject };
|
package/lib/field-utils/file.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { truthy } from "@fibery/helpers/src/_";
|
|
2
2
|
import { toSelectMapClause } from "@fibery/query-utils/src/select";
|
|
3
|
-
|
|
3
|
+
// src/field-utils/file.ts
|
|
4
4
|
const getFilesSelect = ({ typeObject }) => toSelectMapClause([
|
|
5
5
|
typeObject.idField,
|
|
6
6
|
typeObject.titleField,
|
|
@@ -10,5 +10,4 @@ const getFilesSelect = ({ typeObject }) => toSelectMapClause([
|
|
|
10
10
|
"fibery/secret",
|
|
11
11
|
"fibery/rank"
|
|
12
12
|
].filter(truthy));
|
|
13
|
-
//#endregion
|
|
14
13
|
export { getFilesSelect };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { FieldObject, TypeObject } from "@fibery/schema";
|
|
2
|
-
//#region src/field-utils/icon.d.ts
|
|
3
2
|
export declare const ICON_MIXIN_NAME = "icon/icon-mixin";
|
|
4
3
|
export declare const ICON_EXTENSION_FIELD = "icon/icon";
|
|
5
4
|
export declare const isIconExtensionEnabledType: (typeObject: TypeObject) => boolean;
|
|
@@ -8,5 +7,4 @@ export declare const getEntityIconSelect: ({ typeObject }: {
|
|
|
8
7
|
typeObject: TypeObject;
|
|
9
8
|
}) => {
|
|
10
9
|
[x: string]: import("@fibery/schema").FieldName;
|
|
11
|
-
};
|
|
12
|
-
//#endregion
|
|
10
|
+
};
|
package/lib/field-utils/icon.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/field-utils/icon.ts
|
|
2
2
|
const ICON_MIXIN_NAME = "icon/icon-mixin";
|
|
3
3
|
const ICON_EXTENSION_FIELD = "icon/icon";
|
|
4
4
|
const isIconExtensionEnabledType = (typeObject) => {
|
|
@@ -13,5 +13,4 @@ const getEntityIconSelect = ({ typeObject }) => {
|
|
|
13
13
|
return { [fieldObject.name]: fieldObject.name };
|
|
14
14
|
} else return {};
|
|
15
15
|
};
|
|
16
|
-
//#endregion
|
|
17
16
|
export { ICON_EXTENSION_FIELD, ICON_MIXIN_NAME, getEntityIconSelect, isIconExtensionEnabledType, isIconExtensionField };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { FieldObject } from "@fibery/schema";
|
|
2
|
-
//#region src/field-utils/number.d.ts
|
|
3
2
|
export declare enum NumberFormat {
|
|
4
3
|
NUMBER = "Number",
|
|
5
4
|
MONEY = "Money",
|
|
@@ -29,5 +28,4 @@ export declare const parseNumberMeta: ({ rawNumberPrecision, rawNumberUnit, rawN
|
|
|
29
28
|
rawNumberFormat: unknown;
|
|
30
29
|
fieldType: string;
|
|
31
30
|
}) => NumberFieldMeta;
|
|
32
|
-
export declare const parseNumberFieldMeta: (fieldObject: FieldObject) => NumberFieldMeta;
|
|
33
|
-
//#endregion
|
|
31
|
+
export declare const parseNumberFieldMeta: (fieldObject: FieldObject) => NumberFieldMeta;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import flow from "lodash/flow.js";
|
|
3
|
-
//#region src/field-utils/number.ts
|
|
1
|
+
// src/field-utils/number.ts
|
|
4
2
|
let NumberFormat = /* @__PURE__ */ function(NumberFormat) {
|
|
5
3
|
NumberFormat["NUMBER"] = "Number";
|
|
6
4
|
NumberFormat["MONEY"] = "Money";
|
|
@@ -25,13 +23,13 @@ const getInitialNumberFieldMeta = () => {
|
|
|
25
23
|
numberUseThousandSeparator: true
|
|
26
24
|
};
|
|
27
25
|
};
|
|
28
|
-
const parsePrecisionWithBackwardCompatibility = (fieldType
|
|
26
|
+
const parsePrecisionWithBackwardCompatibility = (fieldType, rawNumberPrecision) => {
|
|
29
27
|
return fieldType === "fibery/int" ? 0 : Number(rawNumberPrecision) || 1;
|
|
30
28
|
};
|
|
31
|
-
const internalizePrecision =
|
|
29
|
+
const internalizePrecision = (numberFormat, numberPrecision) => {
|
|
32
30
|
if (numberFormat === "Percent") return numberPrecision - 2;
|
|
33
31
|
return numberPrecision;
|
|
34
|
-
}
|
|
32
|
+
};
|
|
35
33
|
const externalizePrecision = (numberFormat, numberPrecision) => {
|
|
36
34
|
if (numberFormat === "Percent") return numberPrecision + 2;
|
|
37
35
|
return numberPrecision;
|
|
@@ -43,7 +41,7 @@ const parseNumberMeta = ({ rawNumberPrecision, rawNumberUnit, rawNumberCurrencyC
|
|
|
43
41
|
const numberFormat = getNumberFormatOrDefault(rawNumberFormat);
|
|
44
42
|
return {
|
|
45
43
|
numberFormat,
|
|
46
|
-
numberPrecision:
|
|
44
|
+
numberPrecision: internalizePrecision(numberFormat, parsePrecisionWithBackwardCompatibility(fieldType, rawNumberPrecision)),
|
|
47
45
|
numberUnit: rawNumberUnit || null,
|
|
48
46
|
numberCurrencyCode: numberFormat === "Money" ? rawNumberCurrencyCode : null,
|
|
49
47
|
numberUseThousandSeparator: Boolean(rawNumberUseThousandSeparator)
|
|
@@ -60,5 +58,4 @@ const parseNumberFieldMeta = (fieldObject) => {
|
|
|
60
58
|
fieldType: fieldObject.type
|
|
61
59
|
});
|
|
62
60
|
};
|
|
63
|
-
//#endregion
|
|
64
61
|
export { NumberFormat, externalizePrecision, getDefaultCurrencyCode, getDefaultPrecision, getInitialNumberFieldMeta, getNumberFormatOrDefault, parseNumberFieldMeta, parseNumberMeta };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { FieldObject } from "@fibery/schema";
|
|
2
2
|
import { QueryLimit } from "@fibery/expression-utils/src/types";
|
|
3
|
-
//#region src/field-utils/reference-collection.d.ts
|
|
4
3
|
export declare const REFERENCE_COLLECTION_LIMIT = 1000;
|
|
5
4
|
export declare const makeCollectionCountExpression: (field: string | string[]) => (string | string[])[];
|
|
6
5
|
export declare const getCountKey: (field: string) => string;
|
|
@@ -11,5 +10,4 @@ export declare const calculateReferenceCollectionQuery: ({ fieldObjects, express
|
|
|
11
10
|
fieldObjects: FieldObject[];
|
|
12
11
|
expression: string[];
|
|
13
12
|
limit: QueryLimit;
|
|
14
|
-
}) => Record<string, unknown>;
|
|
15
|
-
//#endregion
|
|
13
|
+
}) => Record<string, unknown>;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { getAvatarSelectQuery } from "./avatar.js";
|
|
2
|
-
import { collectionCountKeyPrefix, makeDynamicKey } from "../unit-utils/dynamic-keys.js";
|
|
3
1
|
import { generateAccessCheckQueryExpression } from "../unit-utils/access.js";
|
|
2
|
+
import { collectionCountKeyPrefix, makeDynamicKey } from "../unit-utils/dynamic-keys.js";
|
|
3
|
+
import { getEnumIconColorQuery } from "../unit-utils/enums.js";
|
|
4
|
+
import { wrapCollectionSelectInExpression } from "../unit-utils/wrap-normalized-in-expression.js";
|
|
5
|
+
import { getAvatarSelectQuery } from "./avatar.js";
|
|
4
6
|
import { getFilesSelect } from "./file.js";
|
|
5
7
|
import { getEntityIconSelect } from "./icon.js";
|
|
6
|
-
import { getEnumIconColorQuery } from "../unit-utils/enums.js";
|
|
7
8
|
import { truthy } from "@fibery/helpers/src/_";
|
|
8
9
|
import { mergeDenormalizedSelects, toSelectMapClause } from "@fibery/query-utils/src/select";
|
|
9
|
-
|
|
10
|
-
//#region src/field-utils/reference-collection.ts
|
|
10
|
+
// src/field-utils/reference-collection.ts
|
|
11
11
|
const REFERENCE_COLLECTION_LIMIT = 1e3;
|
|
12
12
|
const makeCollectionCountExpression = (field) => ["q/count", [...Array.isArray(field) ? field : [field], "fibery/id"]];
|
|
13
13
|
const getCountKey = (field) => makeDynamicKey(collectionCountKeyPrefix, field);
|
|
14
14
|
const getCollectionCountSelect = (field) => ({ [getCountKey(field)]: makeCollectionCountExpression(field) });
|
|
15
15
|
const calculateReferenceCollectionQuery = ({ fieldObjects, expression, limit }) => {
|
|
16
|
-
const fieldObject =
|
|
16
|
+
const fieldObject = fieldObjects.at(-1);
|
|
17
17
|
if (!fieldObject) return {};
|
|
18
18
|
const collectionSubQuery = {
|
|
19
19
|
"q/from": expression,
|
|
@@ -31,19 +31,6 @@ const calculateReferenceCollectionQuery = ({ fieldObjects, expression, limit })
|
|
|
31
31
|
].filter(truthy)),
|
|
32
32
|
"q/limit": limit
|
|
33
33
|
};
|
|
34
|
-
return
|
|
35
|
-
const originalIndex = expression.length - 1 - reversedIndex;
|
|
36
|
-
if (!(originalIndex === expression.length - 1)) {
|
|
37
|
-
const pathToField = expression.slice(0, originalIndex + 1);
|
|
38
|
-
const { idField } = fieldObjects[originalIndex].typeObject;
|
|
39
|
-
const innerForField = idField ? {
|
|
40
|
-
[idField]: [...pathToField, idField],
|
|
41
|
-
...inner
|
|
42
|
-
} : { ...inner };
|
|
43
|
-
return { [field]: innerForField };
|
|
44
|
-
}
|
|
45
|
-
return { [field]: inner };
|
|
46
|
-
}, collectionSubQuery);
|
|
34
|
+
return wrapCollectionSelectInExpression(collectionSubQuery, fieldObjects, expression);
|
|
47
35
|
};
|
|
48
|
-
//#endregion
|
|
49
36
|
export { REFERENCE_COLLECTION_LIMIT, calculateReferenceCollectionQuery, getCollectionCountSelect, getCountKey, makeCollectionCountExpression };
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { FieldObject, TypeObject } from "@fibery/schema";
|
|
2
2
|
import { Select } from "@fibery/expression-utils/src/types";
|
|
3
3
|
import { FieldExpression as FieldExpression$1 } from "@fibery/expression-utils";
|
|
4
|
-
//#region src/field-utils/reference.d.ts
|
|
5
4
|
export declare const getReferenceTypeSelectClause: ({ typeObject }: {
|
|
6
5
|
typeObject: TypeObject;
|
|
7
6
|
}, contextPath: FieldExpression$1) => Select;
|
|
8
|
-
export declare const getReferenceFieldNormalizedSelectClause: (fieldObject: FieldObject, contextPath: FieldExpression$1) => any;
|
|
9
|
-
//#endregion
|
|
7
|
+
export declare const getReferenceFieldNormalizedSelectClause: (fieldObject: FieldObject, contextPath: FieldExpression$1) => any;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { getAvatarSelectQuery } from "./avatar.js";
|
|
2
1
|
import { generateAccessCheckQueryExpression } from "../unit-utils/access.js";
|
|
2
|
+
import { getEnumIconColorQuery } from "../unit-utils/enums.js";
|
|
3
|
+
import { getAvatarSelectQuery } from "./avatar.js";
|
|
3
4
|
import { getFilesSelect } from "./file.js";
|
|
4
5
|
import { getEntityIconSelect } from "./icon.js";
|
|
5
|
-
import { getEnumIconColorQuery } from "../unit-utils/enums.js";
|
|
6
6
|
import { getIsUserActiveSelect } from "./user-active.js";
|
|
7
7
|
import { getIsFinalStateSelect } from "./workflow.js";
|
|
8
8
|
import { truthy } from "@fibery/helpers/src/_";
|
|
9
9
|
import { isSelectForMultiFieldKey, normalizeSelect, toSelectMapClause } from "@fibery/query-utils/src/select";
|
|
10
|
-
|
|
10
|
+
// src/field-utils/reference.ts
|
|
11
11
|
const getReferenceTypeSelectClause = ({ typeObject }, contextPath) => {
|
|
12
12
|
return {
|
|
13
13
|
...toSelectMapClause([
|
|
@@ -52,5 +52,4 @@ const getReferenceFieldNormalizedSelectClause = (fieldObject, contextPath) => {
|
|
|
52
52
|
return Object.fromEntries(pairs);
|
|
53
53
|
} else return normalizeSelect(getReferenceTypeSelectClause({ typeObject }, contextPath));
|
|
54
54
|
};
|
|
55
|
-
//#endregion
|
|
56
55
|
export { getReferenceFieldNormalizedSelectClause, getReferenceTypeSelectClause };
|
|
@@ -1,4 +1,2 @@
|
|
|
1
1
|
import { FieldObject } from "@fibery/schema";
|
|
2
|
-
|
|
3
|
-
export declare const isRelationViewField: (fieldObject: FieldObject) => boolean;
|
|
4
|
-
//#endregion
|
|
2
|
+
export declare const isRelationViewField: (fieldObject: FieldObject) => boolean;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
// src/field-utils/relation-view.ts
|
|
2
2
|
const isRelationViewField = (fieldObject) => {
|
|
3
3
|
if (fieldObject.typeObject.isPrimitive || !fieldObject.relation && !fieldObject.multiRelation || fieldObject.typeObject.isEnum) return false;
|
|
4
4
|
return [":cardinality/one-to-many", ":cardinality/many-to-many"].includes(fieldObject.cardinality);
|
|
5
5
|
};
|
|
6
|
-
//#endregion
|
|
7
6
|
export { isRelationViewField };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ExpressionFieldUnit } from "../units/types.js";
|
|
2
2
|
import { TypeObject } from "@fibery/schema";
|
|
3
3
|
import { FieldExpression } from "@fibery/expression-utils/src/types";
|
|
4
|
-
//#region src/field-utils/rich-text.d.ts
|
|
5
4
|
export declare const hasAccessToSecretKey: string;
|
|
6
5
|
export declare const getHasAccessToSecretExpr: (expression: FieldExpression) => (string | (string | import("@fibery/schema").MultiFieldAccess)[])[];
|
|
7
6
|
export declare const getHasAccessToSecret: (expression: FieldExpression) => {
|
|
@@ -11,5 +10,4 @@ export declare function getRichTextQuerySelect({ typeObject, unit: { expression
|
|
|
11
10
|
typeObject: TypeObject;
|
|
12
11
|
unit: ExpressionFieldUnit;
|
|
13
12
|
includeSnippet?: boolean;
|
|
14
|
-
}): import("@fibery/schema").Select;
|
|
15
|
-
//#endregion
|
|
13
|
+
}): import("@fibery/schema").Select;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { hasAccessToSecretKeyPrefix, makeDynamicKey } from "../unit-utils/dynamic-keys.js";
|
|
2
|
+
import { wrapNormalizedInExpression } from "../unit-utils/wrap-normalized-in-expression.js";
|
|
2
3
|
import { getFieldObjectsByFieldExpression } from "@fibery/expression-utils/src/utils";
|
|
3
4
|
import { denormalizeSelect, normalizeSelect, toSelectMapClause } from "@fibery/query-utils/src/select";
|
|
4
|
-
|
|
5
|
+
// src/field-utils/rich-text.ts
|
|
5
6
|
const hasAccessToSecretKey = makeDynamicKey(hasAccessToSecretKeyPrefix);
|
|
6
7
|
const getHasAccessToSecretExpr = (expression) => ["q/access?", [...expression, "Collaboration~Documents/secret"]];
|
|
7
8
|
const getHasAccessToSecret = (expression) => ({ [hasAccessToSecretKey]: getHasAccessToSecretExpr(expression) });
|
|
@@ -14,21 +15,9 @@ function getRichTextQuerySelect({ typeObject, unit: { expression }, includeSnipp
|
|
|
14
15
|
const innerNormalized = normalizeSelect({
|
|
15
16
|
...getHasAccessToSecret(expression),
|
|
16
17
|
...toSelectMapClause([terminalTypeObject.idField, "Collaboration~Documents/secret"]),
|
|
17
|
-
...includeSnippet
|
|
18
|
+
...includeSnippet && toSelectMapClause([terminalTypeObject.idField, "Collaboration~Documents/Snippet"])
|
|
18
19
|
});
|
|
19
|
-
const nested =
|
|
20
|
-
const originalIndex = expression.length - 1 - reversedIndex;
|
|
21
|
-
if (!(originalIndex === expression.length - 1)) {
|
|
22
|
-
const { idField } = fieldObjects[originalIndex].typeObject;
|
|
23
|
-
const innerWithId = idField ? {
|
|
24
|
-
[idField]: idField,
|
|
25
|
-
...inner
|
|
26
|
-
} : inner;
|
|
27
|
-
return { [field]: innerWithId };
|
|
28
|
-
}
|
|
29
|
-
return { [field]: inner };
|
|
30
|
-
}, innerNormalized);
|
|
20
|
+
const nested = wrapNormalizedInExpression(innerNormalized, fieldObjects, expression);
|
|
31
21
|
return denormalizeSelect(nested);
|
|
32
22
|
}
|
|
33
|
-
//#endregion
|
|
34
23
|
export { getHasAccessToSecret, getHasAccessToSecretExpr, getRichTextQuerySelect, hasAccessToSecretKey };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/field-utils/text.d.ts
|
|
2
1
|
export declare const TextUIMetaKey = "ui/type";
|
|
3
2
|
export declare const TextUIMeta: {
|
|
4
3
|
Phone: string;
|
|
@@ -28,5 +27,4 @@ export declare const TextTypeToUiMeta: {
|
|
|
28
27
|
};
|
|
29
28
|
export declare const TextUiMetaToTextType: Record<string, string>;
|
|
30
29
|
export declare const getTextType: (fieldMeta: Record<string, unknown>) => string;
|
|
31
|
-
export declare const getTextTypeLabel: (textType: string) => string;
|
|
32
|
-
//#endregion
|
|
30
|
+
export declare const getTextTypeLabel: (textType: string) => string;
|
package/lib/field-utils/text.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/field-utils/text.ts
|
|
2
2
|
const TextUIMetaKey = "ui/type";
|
|
3
3
|
const TextUIMeta = {
|
|
4
4
|
Phone: "phone",
|
|
@@ -36,5 +36,4 @@ const getTextTypeLabel = (textType) => {
|
|
|
36
36
|
[TextTypes.CustomURL]: "URL"
|
|
37
37
|
}[textType] || "Text";
|
|
38
38
|
};
|
|
39
|
-
//#endregion
|
|
40
39
|
export { TextTypeToFiberyType, TextTypeToUiMeta, TextTypes, TextUIMeta, TextUIMetaKey, TextUiMetaToTextType, getTextType, getTextTypeLabel };
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { TypeObject } from "@fibery/schema";
|
|
2
2
|
import { FieldExpression } from "@fibery/expression-utils";
|
|
3
|
-
//#region src/field-utils/user-active.d.ts
|
|
4
3
|
export declare const getIsUserActiveSelect: ({ typeObject, contextPath }: {
|
|
5
4
|
typeObject: TypeObject;
|
|
6
5
|
contextPath?: FieldExpression;
|
|
7
6
|
}) => {
|
|
8
7
|
[x: string]: (string | (string | import("@fibery/schema").MultiFieldAccess)[])[];
|
|
9
|
-
} | null;
|
|
10
|
-
//#endregion
|
|
8
|
+
} | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isUserActiveDynamicKeyPrefix, makeDynamicKey } from "../unit-utils/dynamic-keys.js";
|
|
2
2
|
import { memoizeLeak, memoizeWeak } from "@fibery/helpers/src/_";
|
|
3
|
-
|
|
3
|
+
// src/field-utils/user-active.ts
|
|
4
4
|
const noUserActiveQueryPredicate = () => null;
|
|
5
5
|
const getIsUserActiveQueryPredicate = memoizeWeak((typeObject) => {
|
|
6
6
|
if (typeObject.name !== "fibery/user") return noUserActiveQueryPredicate;
|
|
@@ -20,5 +20,4 @@ const getIsUserActiveSelect = ({ typeObject, contextPath = [] }) => {
|
|
|
20
20
|
const isUserActiveQueryPredicate = getIsUserActiveQueryPredicate(typeObject)(contextPath);
|
|
21
21
|
return isUserActiveQueryPredicate ? { [isUserActiveQueryPredicate.key]: isUserActiveQueryPredicate.expression } : null;
|
|
22
22
|
};
|
|
23
|
-
//#endregion
|
|
24
23
|
export { getIsUserActiveSelect };
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { FieldObject } from "@fibery/schema";
|
|
2
|
-
//#region src/field-utils/user-role.d.ts
|
|
3
2
|
export declare const isUserRoleField: (fieldObject: FieldObject) => boolean;
|
|
4
3
|
export declare const getUserRoleByKey: (roleKey: string) => {
|
|
5
4
|
key: string;
|
|
6
5
|
label: string;
|
|
7
|
-
} | undefined;
|
|
8
|
-
//#endregion
|
|
6
|
+
} | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/field-utils/user-role.ts
|
|
2
2
|
const roles = [
|
|
3
3
|
{
|
|
4
4
|
key: "role/admin",
|
|
@@ -19,5 +19,4 @@ const roles = [
|
|
|
19
19
|
];
|
|
20
20
|
const isUserRoleField = (fieldObject) => fieldObject.holderType === "fibery/user" && fieldObject.name === "fibery/role";
|
|
21
21
|
const getUserRoleByKey = (roleKey) => roles.find(({ key }) => key === roleKey);
|
|
22
|
-
//#endregion
|
|
23
22
|
export { getUserRoleByKey, isUserRoleField };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { TypeObject } from "@fibery/schema";
|
|
2
2
|
import { FiberyObject } from "@fibery/expression-utils/src/types";
|
|
3
3
|
import { FieldExpression as FieldExpression$1 } from "@fibery/expression-utils";
|
|
4
|
-
//#region src/field-utils/workflow.d.ts
|
|
5
4
|
export declare function isWorkflowType(typeObject: TypeObject): boolean;
|
|
6
5
|
export declare const getWorkflowFieldObject: (typeObject: TypeObject) => import("@fibery/schema").FieldObject | undefined;
|
|
7
6
|
export declare const getIsFinalStateSelect: ({ typeObject, contextPath }: {
|
|
@@ -20,5 +19,4 @@ export declare function getWorkflowTypeSelect(typeObject: TypeObject): {
|
|
|
20
19
|
"workflow/Type": string[];
|
|
21
20
|
} | {
|
|
22
21
|
"workflow/Type"?: undefined;
|
|
23
|
-
};
|
|
24
|
-
//#endregion
|
|
22
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isFinalStateDynamicKeyPrefix, makeDynamicKey } from "../unit-utils/dynamic-keys.js";
|
|
2
2
|
import { memoizeLeak, memoizeWeak } from "@fibery/helpers/src/_";
|
|
3
|
-
|
|
3
|
+
// src/field-utils/workflow.ts
|
|
4
4
|
function isWorkflowType(typeObject) {
|
|
5
5
|
return typeObject.isEnum && typeObject.nameParts.namespace === "workflow";
|
|
6
6
|
}
|
|
@@ -47,5 +47,4 @@ function getWorkflowTypeSelect(typeObject) {
|
|
|
47
47
|
if (isWorkflowType(typeObject)) return { "workflow/Type": ["workflow/Type"] };
|
|
48
48
|
return {};
|
|
49
49
|
}
|
|
50
|
-
//#endregion
|
|
51
50
|
export { getIsFinalStateSelect, getIsInFinalState, getWorkflowFieldObject, getWorkflowTypeSelect, isWorkflowType };
|
package/lib/filter.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Expression } from "@fibery/expression-utils/src/types";
|
|
2
|
-
//#region src/filter.d.ts
|
|
3
2
|
export type LogicalOperator = "or" | "and";
|
|
4
3
|
export type FilterValue = {
|
|
5
4
|
/** q/where expression like ["=", ["kanban/name"], "$where1"] **/
|
|
@@ -25,5 +24,4 @@ export type FilterGroup = FilterBase & {
|
|
|
25
24
|
kind: "group";
|
|
26
25
|
operator: LogicalOperator;
|
|
27
26
|
value: Array<FilterGroup | Filter>;
|
|
28
|
-
};
|
|
29
|
-
//#endregion
|
|
27
|
+
};
|
package/lib/index.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { InvalidMetaError } from "./errors.js";
|
|
2
|
-
import { Unit } from "./units/types.js";
|
|
3
1
|
import { UnitDefinitions, ViewRecord } from "./private/utils.js";
|
|
2
|
+
import { Unit } from "./units/types.js";
|
|
4
3
|
import { deleteExpressionWithNotFoundFieldsOrTypesInSmartFolder, replaceIdsWithNamesInSmartFolder, replaceNamesWithIdsInSmartFolder } from "./private/smart-folder.js";
|
|
4
|
+
import { InvalidMetaError } from "./errors.js";
|
|
5
5
|
import { assertMetaValid, isMetaValid } from "./meta-validation.js";
|
|
6
6
|
import { FieldObject, Schema } from "@fibery/schema";
|
|
7
7
|
import { FieldExpression } from "@fibery/expression-utils/src/types";
|
|
8
|
-
//#region src/index.d.ts
|
|
9
8
|
export declare const getViewCardTypes: <From extends string>({ "fibery/meta": { items } }: {
|
|
10
9
|
"fibery/meta": {
|
|
11
10
|
items: {
|
|
@@ -66,5 +65,4 @@ export declare const replaceIdsWithNamesInView: <V extends ViewRecord>(schema: S
|
|
|
66
65
|
* `./private/map`), `enableHideWhenEmptyForCheckedEditableUnits` (`./private/timeline`).
|
|
67
66
|
*/
|
|
68
67
|
export declare const migrateHideWhenEmptyToUnitsLevel: <V extends ViewRecord>(view: V) => V;
|
|
69
|
-
//#endregion
|
|
70
68
|
export { InvalidMetaError, assertMetaValid, deleteExpressionWithNotFoundFieldsOrTypesInSmartFolder, isMetaValid, replaceIdsWithNamesInSmartFolder, replaceNamesWithIdsInSmartFolder };
|
package/lib/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { InvalidMetaError } from "./errors.js";
|
|
2
1
|
import { collectGarbage as collectGarbage$1, deleteExpressionWithNotFoundOrInvalidFieldsOrTypesInBoardView, enableHideWhenEmptyForCheckedEditableUnits, enableHideWhenEmptyForCovers, fixContextExpressionWithBrokenPath as fixContextExpressionWithBrokenPath$1, fixUserSelectedUnitsInBoardView, replaceIdsWithNamesInBoardView, replaceNamesWithIdsInBoardView } from "./private/board.js";
|
|
3
2
|
import { collectGarbage as collectGarbage$2, deleteExpressionWithNotFoundFieldsOrTypesInCalendarView, enableHideWhenEmptyForCheckedUnits, fixContextExpressionWithBrokenPath as fixContextExpressionWithBrokenPath$2, fixUserSelectedUnitsInCalendarView, replaceIdsWithNamesInCalendarView, replaceNamesWithIdsInCalendarView } from "./private/calendar.js";
|
|
4
3
|
import { collectGarbage as collectGarbage$3, deleteExpressionWithNotFoundFieldsOrTypesInFeedView, enableHideWhenEmptyForCheckedUnits as enableHideWhenEmptyForCheckedUnits$1, fixContextExpressionWithBrokenPath as fixContextExpressionWithBrokenPath$3, fixUserSelectedUnitsInFeedView, replaceIdsWithNamesInFeedView, replaceNamesWithIdsInFeedView } from "./private/feed.js";
|
|
@@ -6,8 +5,9 @@ import { deleteExpressionWithNotFoundFieldsOrTypesInFormView, replaceIdsWithName
|
|
|
6
5
|
import { collectGarbage as collectGarbage$4, deleteExpressionWithNotFoundFieldsOrTypesInMapView, enableHideWhenEmptyForCheckedUnits as enableHideWhenEmptyForCheckedUnits$2, fixContextExpressionWithBrokenPath as fixContextExpressionWithBrokenPath$4, fixUserSelectedUnitsInMapView, replaceIdsWithNamesInMapView, replaceNamesWithIdsInMapView } from "./private/map.js";
|
|
7
6
|
import { collectGarbage as collectGarbage$5, deleteExpressionWithNotFoundFieldsOrTypesInSmartFolder, enableHideWhenEmptyForCheckedUnits as enableHideWhenEmptyForCheckedUnits$3, fixContextExpressionWithBrokenPath as fixContextExpressionWithBrokenPath$5, fixUserSelectedUnitsInSmartFolder, replaceIdsWithNamesInSmartFolder, replaceNamesWithIdsInSmartFolder } from "./private/smart-folder.js";
|
|
8
7
|
import { collectGarbage as collectGarbage$6, deleteExpressionWithNotFoundFieldsOrTypesInGanttView, deleteExpressionWithNotFoundFieldsOrTypesInTimelineView, enableHideWhenEmptyForCheckedEditableUnits as enableHideWhenEmptyForCheckedEditableUnits$1, fixContextExpressionWithBrokenPath as fixContextExpressionWithBrokenPath$6, fixUserSelectedUnitsInTimelineView, replaceIdsWithNamesInTimelineView, replaceNamesWithIdsInTimelineView } from "./private/timeline.js";
|
|
8
|
+
import { InvalidMetaError } from "./errors.js";
|
|
9
9
|
import { assertMetaValid, isMetaValid } from "./meta-validation.js";
|
|
10
|
-
|
|
10
|
+
// src/index.ts
|
|
11
11
|
const getViewCardTypes = ({ "fibery/meta": { items } }) => items.map(({ query: { "q/from": type } }) => type);
|
|
12
12
|
const loose = (converter) => converter;
|
|
13
13
|
const looseView = (converter) => converter;
|
|
@@ -175,5 +175,4 @@ const migrateHideWhenEmptyToUnitsLevel = (view) => {
|
|
|
175
175
|
default: return result;
|
|
176
176
|
}
|
|
177
177
|
};
|
|
178
|
-
//#endregion
|
|
179
178
|
export { InvalidMetaError, assertMetaValid, collectGarbage, deleteExpressionWithNotFoundFieldsOrTypesInSmartFolder, deleteExpressionWithNotFoundFieldsOrTypesInView, fixContextExpressionWithBrokenPath, fixUserSelectedUnits, getViewCardTypes, isMetaValid, migrateHideWhenEmptyToUnitsLevel, replaceIdsWithNamesInSmartFolder, replaceIdsWithNamesInView, replaceNamesWithIdsInSmartFolder, replaceNamesWithIdsInView };
|
package/lib/meta-validation.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/meta-validation.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Validates meta payload for the view of given type.
|
|
4
3
|
* Throws `InvalidMeta` if meta is not valid.
|
|
@@ -8,5 +7,4 @@ export declare const assertMetaValid: (type: string, meta: unknown) => void;
|
|
|
8
7
|
/**
|
|
9
8
|
* Returns true if meta is valid for given view type.
|
|
10
9
|
*/
|
|
11
|
-
export declare const isMetaValid: (type: string, meta: unknown) => boolean;
|
|
12
|
-
//#endregion
|
|
10
|
+
export declare const isMetaValid: (type: string, meta: unknown) => boolean;
|