@fibery/views 25.1.5 → 26.0.2
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/errors.d.ts +2 -3
- package/lib/field-utils/avatar.d.ts +8 -9
- package/lib/field-utils/back-references.d.ts +4 -5
- package/lib/field-utils/comments.d.ts +5 -6
- package/lib/field-utils/date-time.d.ts +7 -8
- package/lib/field-utils/enum-value.d.ts +6 -7
- package/lib/field-utils/file.d.ts +3 -4
- package/lib/field-utils/icon.d.ts +6 -7
- package/lib/field-utils/number.d.ts +11 -12
- package/lib/field-utils/reference-collection.d.ts +6 -7
- package/lib/field-utils/reference-collection.js +1 -1
- package/lib/field-utils/reference.d.ts +3 -4
- package/lib/field-utils/reference.js +1 -1
- package/lib/field-utils/relation-view.d.ts +2 -3
- package/lib/field-utils/rich-text.d.ts +9 -10
- package/lib/field-utils/text.d.ts +9 -10
- package/lib/field-utils/user-active.d.ts +3 -4
- package/lib/field-utils/user-role.d.ts +3 -4
- package/lib/field-utils/workflow.d.ts +9 -10
- package/lib/filter.d.ts +29 -0
- package/lib/filter.js +0 -0
- package/lib/index.d.ts +57 -21
- package/lib/index.js +101 -94
- package/lib/meta-validation.d.ts +3 -4
- package/lib/private/board.d.ts +218 -14
- package/lib/private/board.js +139 -231
- package/lib/private/calendar.d.ts +213 -13
- package/lib/private/calendar.js +35 -81
- package/lib/private/feed.d.ts +211 -13
- package/lib/private/feed.js +34 -80
- package/lib/private/form.d.ts +52 -7
- package/lib/private/form.js +41 -48
- package/lib/private/map.d.ts +211 -13
- package/lib/private/map.js +34 -80
- package/lib/private/smart-folder.d.ts +118 -29
- package/lib/private/smart-folder.js +70 -148
- package/lib/private/timeline.d.ts +535 -31
- package/lib/private/timeline.js +158 -219
- package/lib/private/units.d.ts +3 -4
- package/lib/private/utils.d.ts +63 -57
- package/lib/private/utils.js +71 -49
- package/lib/refs.d.ts +19 -0
- package/lib/refs.js +0 -0
- package/lib/unit-definitions/avatar-collection.d.ts +29 -4
- package/lib/unit-definitions/avatar-collection.js +1 -1
- package/lib/unit-definitions/avatar-input.d.ts +49 -4
- package/lib/unit-definitions/avatar.d.ts +54 -4
- package/lib/unit-definitions/avatar.js +1 -1
- package/lib/unit-definitions/back-references-list.d.ts +31 -4
- package/lib/unit-definitions/back-references-list.js +2 -2
- package/lib/unit-definitions/bool-checkbox.d.ts +23 -4
- package/lib/unit-definitions/bool-checkbox.js +1 -1
- package/lib/unit-definitions/bool.d.ts +23 -4
- package/lib/unit-definitions/bool.js +1 -1
- package/lib/unit-definitions/collection-count.d.ts +31 -4
- package/lib/unit-definitions/collection-count.js +1 -1
- package/lib/unit-definitions/color-input.d.ts +22 -4
- package/lib/unit-definitions/color-input.js +1 -1
- package/lib/unit-definitions/comments-list.d.ts +63 -4
- package/lib/unit-definitions/comments-list.js +2 -2
- package/lib/unit-definitions/date-range-combobox.d.ts +23 -4
- package/lib/unit-definitions/date-range-combobox.js +1 -1
- package/lib/unit-definitions/date-range.d.ts +23 -4
- package/lib/unit-definitions/date-range.js +1 -1
- package/lib/unit-definitions/date-time-combobox.d.ts +23 -4
- package/lib/unit-definitions/date-time-combobox.js +1 -1
- package/lib/unit-definitions/date.d.ts +23 -4
- package/lib/unit-definitions/date.js +1 -1
- package/lib/unit-definitions/email-input.d.ts +23 -4
- package/lib/unit-definitions/email.d.ts +23 -4
- package/lib/unit-definitions/emoji.d.ts +23 -4
- package/lib/unit-definitions/file-collection-count.d.ts +23 -4
- package/lib/unit-definitions/file-collection-count.js +2 -2
- package/lib/unit-definitions/file-compact-collection.d.ts +23 -4
- package/lib/unit-definitions/file-compact-collection.js +2 -2
- package/lib/unit-definitions/file-compact-reference.d.ts +27 -4
- package/lib/unit-definitions/file-compact-reference.js +1 -1
- package/lib/unit-definitions/file-reference.d.ts +23 -4
- package/lib/unit-definitions/file-reference.js +2 -2
- package/lib/unit-definitions/files-gallery.d.ts +23 -4
- package/lib/unit-definitions/files-gallery.js +2 -2
- package/lib/unit-definitions/files-l-list-item.d.ts +23 -4
- package/lib/unit-definitions/files-l-list-item.js +2 -2
- package/lib/unit-definitions/files-l-list.d.ts +23 -4
- package/lib/unit-definitions/files-l-list.js +2 -2
- package/lib/unit-definitions/files-list-item.d.ts +23 -4
- package/lib/unit-definitions/files-list-item.js +2 -2
- package/lib/unit-definitions/files-list.d.ts +23 -4
- package/lib/unit-definitions/files-list.js +2 -2
- package/lib/unit-definitions/geometry-preview.d.ts +23 -4
- package/lib/unit-definitions/icon-button.d.ts +28 -4
- package/lib/unit-definitions/icon-button.js +1 -1
- package/lib/unit-definitions/icon-input.d.ts +23 -4
- package/lib/unit-definitions/id.d.ts +32 -4
- package/lib/unit-definitions/json-input.d.ts +22 -4
- package/lib/unit-definitions/json-input.js +1 -1
- package/lib/unit-definitions/location-input.d.ts +23 -4
- package/lib/unit-definitions/location.d.ts +23 -4
- package/lib/unit-definitions/not-found.d.ts +6 -4
- package/lib/unit-definitions/number-input.d.ts +23 -4
- package/lib/unit-definitions/number-input.js +1 -1
- package/lib/unit-definitions/number.d.ts +27 -4
- package/lib/unit-definitions/phone-input.d.ts +23 -4
- package/lib/unit-definitions/phone.d.ts +23 -4
- package/lib/unit-definitions/progress-bar.d.ts +26 -4
- package/lib/unit-definitions/reference-collection-combobox.d.ts +19 -4
- package/lib/unit-definitions/reference-collection-combobox.js +1 -1
- package/lib/unit-definitions/reference-collection-list.d.ts +19 -4
- package/lib/unit-definitions/reference-collection-list.js +1 -1
- package/lib/unit-definitions/reference-collection-view.d.ts +19 -4
- package/lib/unit-definitions/reference-collection-view.js +1 -1
- package/lib/unit-definitions/reference-collection.d.ts +23 -4
- package/lib/unit-definitions/reference-collection.js +2 -2
- package/lib/unit-definitions/reference-combobox.d.ts +19 -4
- package/lib/unit-definitions/reference-combobox.js +1 -1
- package/lib/unit-definitions/reference-icon.d.ts +27 -4
- package/lib/unit-definitions/reference.d.ts +27 -4
- package/lib/unit-definitions/reference.js +1 -1
- package/lib/unit-definitions/rich-text-document.d.ts +23 -4
- package/lib/unit-definitions/rich-text-document.js +2 -2
- package/lib/unit-definitions/rich-text-snippet.d.ts +25 -5
- package/lib/unit-definitions/single-location-preview.d.ts +23 -4
- package/lib/unit-definitions/text-input.d.ts +23 -4
- package/lib/unit-definitions/text-input.js +1 -1
- package/lib/unit-definitions/text.d.ts +23 -4
- package/lib/unit-definitions/text.js +1 -1
- package/lib/unit-definitions/title-input.d.ts +24 -4
- package/lib/unit-definitions/title.d.ts +27 -4
- package/lib/unit-definitions/type-badge-abbr.d.ts +15 -4
- package/lib/unit-definitions/type-badge.d.ts +15 -4
- package/lib/unit-definitions/type-icon.d.ts +15 -4
- package/lib/unit-definitions/url-input.d.ts +23 -4
- package/lib/unit-definitions/url.d.ts +23 -4
- package/lib/unit-definitions/user-button.d.ts +13 -4
- package/lib/unit-definitions/user-role-input.d.ts +26 -4
- package/lib/unit-definitions/user-role.d.ts +27 -4
- package/lib/unit-definitions/user-role.js +2 -2
- package/lib/unit-utils/access.d.ts +4 -5
- package/lib/unit-utils/can-edit-field.d.ts +4 -5
- package/lib/unit-utils/common.d.ts +16 -11
- package/lib/unit-utils/decimal.js +4 -4
- package/lib/unit-utils/dynamic-keys.d.ts +8 -9
- package/lib/unit-utils/enums.d.ts +4 -5
- package/lib/unit-utils/formatters.d.ts +15 -16
- package/lib/unit-utils/formatters.js +2 -2
- package/lib/unit-utils/get-export-value.d.ts +18 -19
- package/lib/unit-utils/get-field-label.d.ts +4 -5
- package/lib/unit-utils/get-unmatched-unit-label.d.ts +2 -3
- package/lib/unit-utils/wrap-normalized-in-expression.d.ts +2 -3
- package/lib/units/board.d.ts +22 -25
- package/lib/units/board.js +2 -1
- package/lib/units/canvas/index.d.ts +19 -24
- package/lib/units/canvas/type-badge-abbr.d.ts +13 -35
- package/lib/units/canvas/type-badge.d.ts +13 -35
- package/lib/units/default.d.ts +21 -22
- package/lib/units/default.js +2 -1
- package/lib/units/gallery.d.ts +5 -3
- package/lib/units/gantt.d.ts +23 -24
- package/lib/units/gantt.js +3 -2
- package/lib/units/get-unit-definitions-for-view-type.d.ts +4 -4
- package/lib/units/grid.d.ts +14 -25
- package/lib/units/grid.js +2 -1
- package/lib/units/list.d.ts +17 -26
- package/lib/units/list.js +2 -1
- package/lib/units/make-factory.d.ts +25 -27
- package/lib/units/make-factory.js +3 -3
- package/lib/units/types.d.ts +19 -13
- package/package.json +8 -8
package/lib/units/gallery.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { PureUnit } from "./types.js";
|
|
2
1
|
import { getCardUnitsSelect, getHardcodedUnitsForView, getTypeUnits, getUnitDataDefinition, getUnitLabel, getUnitName, getUnitsForField, getUnitsForType, getUnitsForTypePerField } from "./board.js";
|
|
3
2
|
import { TypeObject } from "@fibery/schema";
|
|
4
3
|
//#region src/units/gallery.d.ts
|
|
5
|
-
declare const getDefaultUnits: (_typeObject: TypeObject) =>
|
|
4
|
+
export declare const getDefaultUnits: (_typeObject: TypeObject) => {
|
|
5
|
+
type: "title";
|
|
6
|
+
kind: "field";
|
|
7
|
+
}[];
|
|
6
8
|
//#endregion
|
|
7
|
-
export { getCardUnitsSelect,
|
|
9
|
+
export { getCardUnitsSelect, getHardcodedUnitsForView, getTypeUnits, getUnitDataDefinition, getUnitLabel, getUnitName, getUnitsForField, getUnitsForType, getUnitsForTypePerField };
|
package/lib/units/gantt.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { PureUnit, Unit, UnitExpression } from "./types.js";
|
|
1
|
+
import { ButtonUnit, DbUnit, ExpressionFieldUnit, PureUnit, Unit, UnitExpression } from "./types.js";
|
|
2
2
|
import { TypeObject } from "@fibery/schema";
|
|
3
3
|
//#region src/units/gantt.d.ts
|
|
4
|
-
declare const getTypeUnits: () => PureUnit[], getUnitName: (unit: Unit) => string | null, getUnitsForType: (typeObject: TypeObject, options?: {
|
|
4
|
+
export declare const getTypeUnits: () => PureUnit[], getUnitName: (unit: Unit) => string | null, getUnitsForType: (typeObject: TypeObject, options?: {
|
|
5
5
|
parentFieldObjects?: import("@fibery/schema").FieldObject[];
|
|
6
6
|
showHiddenFields?: boolean;
|
|
7
7
|
isSharingMode?: boolean;
|
|
@@ -23,29 +23,28 @@ declare const getTypeUnits: () => PureUnit[], getUnitName: (unit: Unit) => strin
|
|
|
23
23
|
schema: import("@fibery/schema").Schema;
|
|
24
24
|
typeObject: TypeObject;
|
|
25
25
|
units: Unit[];
|
|
26
|
-
}) => import("@fibery/
|
|
27
|
-
kind: "
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
id: string;
|
|
31
|
-
typeId: import("@fibery/schema").TypeId;
|
|
32
|
-
};
|
|
33
|
-
label: string;
|
|
26
|
+
}) => import("@fibery/schema").Select, getUnitLabel: <U extends Unit>(typeObject: TypeObject, unit: U) => string, getHardcodedUnitsForView: (typeObject: TypeObject) => (Omit<ButtonUnit, "checked"> | Omit<DbUnit, "checked"> | Omit<ExpressionFieldUnit, "checked"> | Omit<{
|
|
27
|
+
kind: "field";
|
|
28
|
+
checked?: boolean;
|
|
29
|
+
settings?: Record<string, unknown>;
|
|
34
30
|
hideWhenEmpty?: boolean;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
kind: "db";
|
|
38
|
-
type: "type-icon" | "type-badge" | "type-badge-abbr";
|
|
31
|
+
} & {
|
|
32
|
+
type: "id" | "title";
|
|
39
33
|
expression?: UnitExpression;
|
|
40
|
-
|
|
34
|
+
}, "checked">)[];
|
|
35
|
+
export declare const getDefaultUnits: () => {
|
|
36
|
+
type: "title";
|
|
37
|
+
kind: "field";
|
|
38
|
+
}[];
|
|
39
|
+
export declare const getDefaultLaneUnits: (typeObject: TypeObject) => ({
|
|
40
|
+
type: "avatar";
|
|
41
|
+
kind: "field";
|
|
42
|
+
expression: string[];
|
|
41
43
|
} | {
|
|
44
|
+
type: "title";
|
|
42
45
|
kind: "field";
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
declare const getDefaultUnits: () => PureUnit[];
|
|
49
|
-
declare const getDefaultLaneUnits: (typeObject: TypeObject) => PureUnit[];
|
|
50
|
-
//#endregion
|
|
51
|
-
export { getCardUnitsSelect, getDefaultLaneUnits, getDefaultUnits, getHardcodedUnitsForView, getTypeUnits, getUnitLabel, getUnitName, getUnitsForField, getUnitsForType, getUnitsForTypePerField };
|
|
46
|
+
} | {
|
|
47
|
+
type: "type-badge-abbr";
|
|
48
|
+
kind: "db";
|
|
49
|
+
} | ExpressionFieldUnit)[];
|
|
50
|
+
//#endregion
|
package/lib/units/gantt.js
CHANGED
|
@@ -2,6 +2,7 @@ import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
|
2
2
|
import { isAvatarExtensionEnabledType } from "../field-utils/avatar.js";
|
|
3
3
|
import { unit_definitions_exports } from "../unit-definitions/index.js";
|
|
4
4
|
import { makeUnitDefinitionsFactory } from "./make-factory.js";
|
|
5
|
+
import { truthy } from "@fibery/helpers/src/_";
|
|
5
6
|
//#region src/units/gantt.ts
|
|
6
7
|
var gantt_exports = /* @__PURE__ */ __exportAll({
|
|
7
8
|
getCardUnitsSelect: () => getCardUnitsSelect,
|
|
@@ -18,11 +19,11 @@ var gantt_exports = /* @__PURE__ */ __exportAll({
|
|
|
18
19
|
const { getTypeUnits, getUnitName, getUnitsForType, getUnitsForField, getUnitsForTypePerField, getCardUnitsSelect, getUnitLabel, getHardcodedUnitsForView } = makeUnitDefinitionsFactory(unit_definitions_exports);
|
|
19
20
|
const getDefaultUnits = () => {
|
|
20
21
|
const { Title } = unit_definitions_exports;
|
|
21
|
-
return [Title && Title.makeUnit()].filter(
|
|
22
|
+
return [Title && Title.makeUnit()].filter(truthy);
|
|
22
23
|
};
|
|
23
24
|
const getDefaultLaneUnits = (typeObject) => {
|
|
24
25
|
const { Title, Avatar, Emoji, TypeBadgeAbbr } = unit_definitions_exports;
|
|
25
|
-
return [Title && Title.makeUnit(), typeObject && isAvatarExtensionEnabledType(typeObject) && Avatar && Avatar.makeUnit() || typeObject.isEnum && Boolean(typeObject.getFieldObjectByName("enum/icon")) && Emoji && Emoji.makeUnit({ expression: ["enum/icon"] }) || TypeBadgeAbbr && TypeBadgeAbbr.makeUnit()].filter(
|
|
26
|
+
return [Title && Title.makeUnit(), typeObject && isAvatarExtensionEnabledType(typeObject) && Avatar && Avatar.makeUnit() || typeObject.isEnum && Boolean(typeObject.getFieldObjectByName("enum/icon")) && Emoji && Emoji.makeUnit({ expression: ["enum/icon"] }) || TypeBadgeAbbr && TypeBadgeAbbr.makeUnit()].filter(truthy);
|
|
26
27
|
};
|
|
27
28
|
//#endregion
|
|
28
29
|
export { gantt_exports, getCardUnitsSelect, getDefaultLaneUnits, getDefaultUnits, getHardcodedUnitsForView, getTypeUnits, getUnitLabel, getUnitName, getUnitsForField, getUnitsForType, getUnitsForTypePerField };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { index_d_exports } from "./canvas/index.js";
|
|
2
|
+
import { default_d_exports } from "./default.js";
|
|
2
3
|
//#region src/units/get-unit-definitions-for-view-type.d.ts
|
|
3
|
-
declare const getUnitDefinitionsForViewType: (viewType: string) => typeof
|
|
4
|
-
//#endregion
|
|
5
|
-
export { getUnitDefinitionsForViewType };
|
|
4
|
+
export declare const getUnitDefinitionsForViewType: (viewType: string) => typeof default_d_exports | typeof index_d_exports;
|
|
5
|
+
//#endregion
|
package/lib/units/grid.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { PureUnit, Unit, UnitExpression } from "./types.js";
|
|
1
|
+
import { ButtonUnit, DbUnit, ExpressionFieldUnit, PureUnit, Unit, UnitExpression } from "./types.js";
|
|
2
2
|
//#region src/units/grid.d.ts
|
|
3
|
-
declare const getTypeUnits: () => PureUnit[], getUnitName: (unit: Unit) => string | null, getUnitsForType: (typeObject: import("@fibery/schema").TypeObject, options?: {
|
|
3
|
+
export declare const getTypeUnits: () => PureUnit[], getUnitName: (unit: Unit) => string | null, getUnitsForType: (typeObject: import("@fibery/schema").TypeObject, options?: {
|
|
4
4
|
parentFieldObjects?: import("@fibery/schema").FieldObject[];
|
|
5
5
|
showHiddenFields?: boolean;
|
|
6
6
|
isSharingMode?: boolean;
|
|
@@ -18,32 +18,21 @@ declare const getTypeUnits: () => PureUnit[], getUnitName: (unit: Unit) => strin
|
|
|
18
18
|
}) => {
|
|
19
19
|
fieldObject: import("@fibery/schema").FieldObject;
|
|
20
20
|
units: Unit[];
|
|
21
|
-
}[], getUnitLabel: (typeObject: import("@fibery/schema").TypeObject, unit:
|
|
21
|
+
}[], getUnitLabel: <U extends Unit>(typeObject: import("@fibery/schema").TypeObject, unit: U) => string, getCardUnitsSelect: ({ schema, typeObject, units }: {
|
|
22
22
|
schema: import("@fibery/schema").Schema;
|
|
23
23
|
typeObject: import("@fibery/schema").TypeObject;
|
|
24
24
|
units: Unit[];
|
|
25
|
-
}) => import("@fibery/
|
|
26
|
-
kind: "user-button";
|
|
27
|
-
type: "user-button" | "icon-button";
|
|
28
|
-
data: {
|
|
29
|
-
id: string;
|
|
30
|
-
typeId: import("@fibery/schema").TypeId;
|
|
31
|
-
};
|
|
32
|
-
label: string;
|
|
33
|
-
hideWhenEmpty?: boolean;
|
|
34
|
-
icon?: string;
|
|
35
|
-
} | {
|
|
36
|
-
kind: "db";
|
|
37
|
-
type: "type-icon" | "type-badge" | "type-badge-abbr";
|
|
38
|
-
expression?: UnitExpression;
|
|
39
|
-
hideWhenEmpty?: boolean;
|
|
40
|
-
} | {
|
|
25
|
+
}) => import("@fibery/schema").Select, getHardcodedUnitsForView: (typeObject: import("@fibery/schema").TypeObject) => (Omit<ButtonUnit, "checked"> | Omit<DbUnit, "checked"> | Omit<ExpressionFieldUnit, "checked"> | Omit<{
|
|
41
26
|
kind: "field";
|
|
42
|
-
|
|
43
|
-
expression: UnitExpression;
|
|
27
|
+
checked?: boolean;
|
|
44
28
|
settings?: Record<string, unknown>;
|
|
45
29
|
hideWhenEmpty?: boolean;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
30
|
+
} & {
|
|
31
|
+
type: "id" | "title";
|
|
32
|
+
expression?: UnitExpression;
|
|
33
|
+
}, "checked">)[];
|
|
34
|
+
export declare const getDefaultUnits: () => {
|
|
35
|
+
type: "title";
|
|
36
|
+
kind: "field";
|
|
37
|
+
}[];
|
|
38
|
+
//#endregion
|
package/lib/units/grid.js
CHANGED
|
@@ -28,6 +28,7 @@ import { UserRole } from "../unit-definitions/user-role.js";
|
|
|
28
28
|
import { FileCollectionCount } from "../unit-definitions/file-collection-count.js";
|
|
29
29
|
import { makeUnitDefinitionsFactory } from "./make-factory.js";
|
|
30
30
|
import { FilesGallery } from "../unit-definitions/files-gallery.js";
|
|
31
|
+
import { truthy } from "@fibery/helpers/src/_";
|
|
31
32
|
import { FileReference } from "@fibery/views/src/unit-definitions/file-reference";
|
|
32
33
|
//#region src/units/grid.ts
|
|
33
34
|
var grid_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -75,7 +76,7 @@ const allUnitDefinitions = {
|
|
|
75
76
|
const { getTypeUnits, getUnitName, getUnitsForType, getUnitsForField, getUnitsForTypePerField, getUnitLabel, getCardUnitsSelect, getHardcodedUnitsForView } = makeUnitDefinitionsFactory(allUnitDefinitions);
|
|
76
77
|
const getDefaultUnits = () => {
|
|
77
78
|
const { Title } = allUnitDefinitions;
|
|
78
|
-
return [Title && Title.makeUnit()].filter(
|
|
79
|
+
return [Title && Title.makeUnit()].filter(truthy);
|
|
79
80
|
};
|
|
80
81
|
//#endregion
|
|
81
82
|
export { getCardUnitsSelect, getDefaultUnits, getHardcodedUnitsForView, getTypeUnits, getUnitLabel, getUnitName, getUnitsForField, getUnitsForType, getUnitsForTypePerField, grid_exports };
|
package/lib/units/list.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { PureUnit, Unit, UnitExpression } from "./types.js";
|
|
1
|
+
import { ButtonUnit, DbUnit, ExpressionFieldUnit, PureUnit, Unit, UnitExpression } from "./types.js";
|
|
2
2
|
import { TypeObject } from "@fibery/schema";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
declare const getTypeUnits: () => PureUnit[], getUnitName: (unit: Unit) => string | null, getUnitsForType: (typeObject: TypeObject, options?: {
|
|
3
|
+
//#region src/units/list.d.ts
|
|
4
|
+
export declare const getTypeUnits: () => PureUnit[], getUnitName: (unit: Unit) => string | null, getUnitsForType: (typeObject: TypeObject, options?: {
|
|
7
5
|
parentFieldObjects?: import("@fibery/schema").FieldObject[];
|
|
8
6
|
showHiddenFields?: boolean;
|
|
9
7
|
isSharingMode?: boolean;
|
|
@@ -21,32 +19,25 @@ declare const getTypeUnits: () => PureUnit[], getUnitName: (unit: Unit) => strin
|
|
|
21
19
|
}) => {
|
|
22
20
|
fieldObject: import("@fibery/schema").FieldObject;
|
|
23
21
|
units: Unit[];
|
|
24
|
-
}[], getUnitLabel: (typeObject: TypeObject, unit:
|
|
22
|
+
}[], getUnitLabel: <U extends Unit>(typeObject: TypeObject, unit: U) => string, getCardUnitsSelect: ({ schema, typeObject, units }: {
|
|
25
23
|
schema: import("@fibery/schema").Schema;
|
|
26
24
|
typeObject: TypeObject;
|
|
27
25
|
units: Unit[];
|
|
28
|
-
}) => import("@fibery/
|
|
29
|
-
kind: "
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
id: string;
|
|
33
|
-
typeId: import("@fibery/schema").TypeId;
|
|
34
|
-
};
|
|
35
|
-
label: string;
|
|
26
|
+
}) => import("@fibery/schema").Select, getHardcodedUnitsForView: (typeObject: TypeObject) => (Omit<ButtonUnit, "checked"> | Omit<DbUnit, "checked"> | Omit<ExpressionFieldUnit, "checked"> | Omit<{
|
|
27
|
+
kind: "field";
|
|
28
|
+
checked?: boolean;
|
|
29
|
+
settings?: Record<string, unknown>;
|
|
36
30
|
hideWhenEmpty?: boolean;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
kind: "db";
|
|
40
|
-
type: "type-icon" | "type-badge" | "type-badge-abbr";
|
|
31
|
+
} & {
|
|
32
|
+
type: "id" | "title";
|
|
41
33
|
expression?: UnitExpression;
|
|
42
|
-
|
|
34
|
+
}, "checked">)[];
|
|
35
|
+
export declare const getDefaultUnits: (typeObject: TypeObject) => ({
|
|
36
|
+
type: "avatar";
|
|
37
|
+
kind: "field";
|
|
38
|
+
expression: string[];
|
|
43
39
|
} | {
|
|
40
|
+
type: "title";
|
|
44
41
|
kind: "field";
|
|
45
|
-
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";
|
|
46
|
-
expression: UnitExpression;
|
|
47
|
-
settings?: Record<string, unknown>;
|
|
48
|
-
hideWhenEmpty?: boolean;
|
|
49
42
|
})[];
|
|
50
|
-
|
|
51
|
-
//#endregion
|
|
52
|
-
export { getCardUnitsSelect, getDefaultUnits, getHardcodedUnitsForView, getTypeUnits, getUnitLabel, getUnitName, getUnitsForField, getUnitsForType, getUnitsForTypePerField, list_d_exports };
|
|
43
|
+
//#endregion
|
package/lib/units/list.js
CHANGED
|
@@ -2,6 +2,7 @@ import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
|
2
2
|
import { isAvatarExtensionEnabledType } from "../field-utils/avatar.js";
|
|
3
3
|
import { unit_definitions_exports } from "../unit-definitions/index.js";
|
|
4
4
|
import { makeUnitDefinitionsFactory } from "./make-factory.js";
|
|
5
|
+
import { truthy } from "@fibery/helpers/src/_";
|
|
5
6
|
//#region src/units/list.ts
|
|
6
7
|
var list_exports = /* @__PURE__ */ __exportAll({
|
|
7
8
|
getCardUnitsSelect: () => getCardUnitsSelect,
|
|
@@ -17,7 +18,7 @@ var list_exports = /* @__PURE__ */ __exportAll({
|
|
|
17
18
|
const { getTypeUnits, getUnitName, getUnitsForType, getUnitsForField, getUnitsForTypePerField, getUnitLabel, getCardUnitsSelect, getHardcodedUnitsForView } = makeUnitDefinitionsFactory(unit_definitions_exports);
|
|
18
19
|
const getDefaultUnits = (typeObject) => {
|
|
19
20
|
const { Title, Avatar } = unit_definitions_exports;
|
|
20
|
-
return [Title && Title.makeUnit(), typeObject && isAvatarExtensionEnabledType(typeObject) && Avatar && Avatar.makeUnit()].filter(
|
|
21
|
+
return [Title && Title.makeUnit(), typeObject && isAvatarExtensionEnabledType(typeObject) && Avatar && Avatar.makeUnit()].filter(truthy);
|
|
21
22
|
};
|
|
22
23
|
//#endregion
|
|
23
24
|
export { getCardUnitsSelect, getDefaultUnits, getHardcodedUnitsForView, getTypeUnits, getUnitLabel, getUnitName, getUnitsForField, getUnitsForType, getUnitsForTypePerField, list_exports };
|
|
@@ -1,13 +1,25 @@
|
|
|
1
|
-
import { ButtonUnit, DbUnit, FieldUnit, PureUnit, Unit, UnitDataDefinition, UnitExpression } from "./types.js";
|
|
1
|
+
import { ButtonUnit, DbUnit, ExpressionFieldUnit, FieldUnit, PureUnit, Unit, UnitDataDefinition, UnitExpression } from "./types.js";
|
|
2
|
+
import { MissingUnitDefinition } from "../unit-definitions/not-found.js";
|
|
2
3
|
import { FieldObject, Schema, TypeObject } from "@fibery/schema";
|
|
3
4
|
//#region src/units/make-factory.d.ts
|
|
4
|
-
type AnyUnitDataDefinition = UnitDataDefinition<FieldUnit
|
|
5
|
+
type AnyUnitDataDefinition = (UnitDataDefinition<FieldUnit & {
|
|
6
|
+
type: "id" | "title";
|
|
7
|
+
}> & {
|
|
8
|
+
type: "id" | "title";
|
|
9
|
+
}) | (UnitDataDefinition<ExpressionFieldUnit> & {
|
|
10
|
+
type: Exclude<ExpressionFieldUnit["type"], "id" | "title" | "icon-button">;
|
|
11
|
+
}) | UnitDataDefinition<DbUnit> | (UnitDataDefinition<ButtonUnit> & {
|
|
12
|
+
type: "user-button";
|
|
13
|
+
}) | (UnitDataDefinition<ExpressionFieldUnit | ButtonUnit> & {
|
|
14
|
+
type: "icon-button";
|
|
15
|
+
});
|
|
16
|
+
export type UnitDefinitionRegistry = Record<string, AnyUnitDataDefinition>;
|
|
5
17
|
type UnitCreationOptions = {
|
|
6
18
|
parentFieldObjects?: FieldObject[];
|
|
7
19
|
showHiddenFields?: boolean;
|
|
8
20
|
isSharingMode?: boolean;
|
|
9
21
|
};
|
|
10
|
-
declare const makeUnitDefinitionsFactory: (allUnitDefinitions:
|
|
22
|
+
export declare const makeUnitDefinitionsFactory: (allUnitDefinitions: UnitDefinitionRegistry) => {
|
|
11
23
|
getTypeUnits: () => PureUnit[];
|
|
12
24
|
getUnitsForType: (typeObject: TypeObject, options?: UnitCreationOptions) => {
|
|
13
25
|
unit: Unit;
|
|
@@ -18,36 +30,22 @@ declare const makeUnitDefinitionsFactory: (allUnitDefinitions: Record<string, An
|
|
|
18
30
|
units: Unit[];
|
|
19
31
|
}[];
|
|
20
32
|
getUnitsForField: (fieldObject: FieldObject, options?: UnitCreationOptions) => Unit[];
|
|
21
|
-
getHardcodedUnitsForView: (typeObject: TypeObject) => ({
|
|
22
|
-
kind: "user-button";
|
|
23
|
-
type: "user-button" | "icon-button";
|
|
24
|
-
data: {
|
|
25
|
-
id: string;
|
|
26
|
-
typeId: import("@fibery/schema").TypeId;
|
|
27
|
-
};
|
|
28
|
-
label: string;
|
|
29
|
-
hideWhenEmpty?: boolean;
|
|
30
|
-
icon?: string;
|
|
31
|
-
} | {
|
|
32
|
-
kind: "db";
|
|
33
|
-
type: "type-icon" | "type-badge" | "type-badge-abbr";
|
|
34
|
-
expression?: UnitExpression;
|
|
35
|
-
hideWhenEmpty?: boolean;
|
|
36
|
-
} | {
|
|
33
|
+
getHardcodedUnitsForView: (typeObject: TypeObject) => (Omit<ButtonUnit, "checked"> | Omit<DbUnit, "checked"> | Omit<ExpressionFieldUnit, "checked"> | Omit<{
|
|
37
34
|
kind: "field";
|
|
38
|
-
|
|
39
|
-
expression: UnitExpression;
|
|
35
|
+
checked?: boolean;
|
|
40
36
|
settings?: Record<string, unknown>;
|
|
41
37
|
hideWhenEmpty?: boolean;
|
|
42
|
-
}
|
|
43
|
-
|
|
38
|
+
} & {
|
|
39
|
+
type: "id" | "title";
|
|
40
|
+
expression?: UnitExpression;
|
|
41
|
+
}, "checked">)[];
|
|
42
|
+
getUnitLabel: <U extends Unit>(typeObject: TypeObject, unit: U) => string;
|
|
44
43
|
getUnitName: (unit: Unit) => string | null;
|
|
45
44
|
getCardUnitsSelect: ({ schema, typeObject, units }: {
|
|
46
45
|
schema: Schema;
|
|
47
46
|
typeObject: TypeObject;
|
|
48
47
|
units: Unit[];
|
|
49
|
-
}) => import("@fibery/
|
|
50
|
-
getUnitDataDefinition: (unit: Unit) =>
|
|
48
|
+
}) => import("@fibery/schema").Select;
|
|
49
|
+
getUnitDataDefinition: (unit: Unit) => UnitDataDefinition<Unit> | MissingUnitDefinition;
|
|
51
50
|
};
|
|
52
|
-
//#endregion
|
|
53
|
-
export { makeUnitDefinitionsFactory };
|
|
51
|
+
//#endregion
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { isAvatarExtensionEnabledType, isAvatarExtensionField } from "../field-utils/avatar.js";
|
|
2
|
+
import { calculateUnitExpressionErrors, isUnitEnabled } from "../unit-utils/common.js";
|
|
3
|
+
import { parseNumberFieldMeta } from "../field-utils/number.js";
|
|
4
|
+
import { isUserRoleField } from "../field-utils/user-role.js";
|
|
2
5
|
import { isReferenceExtensionField } from "../field-utils/back-references.js";
|
|
3
6
|
import { isCommentExtensionField } from "../field-utils/comments.js";
|
|
4
|
-
import { parseNumberFieldMeta } from "../field-utils/number.js";
|
|
5
7
|
import { isRelationViewField } from "../field-utils/relation-view.js";
|
|
6
8
|
import { TextUIMeta } from "../field-utils/text.js";
|
|
7
|
-
import { isUserRoleField } from "../field-utils/user-role.js";
|
|
8
|
-
import { calculateUnitExpressionErrors, isUnitEnabled } from "../unit-utils/common.js";
|
|
9
9
|
import { NotFound } from "../unit-definitions/not-found.js";
|
|
10
10
|
import { mapValues, truthy } from "@fibery/helpers/src/_";
|
|
11
11
|
import { mergeDenormalizedSelects } from "@fibery/query-utils/src/select";
|
package/lib/units/types.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { NumberDisplaySettings } from "../field-utils/number.js";
|
|
|
2
2
|
import { Schema, TypeId, TypeObject } from "@fibery/schema";
|
|
3
3
|
import { FiberyObject } from "@fibery/expression-utils/src/types";
|
|
4
4
|
//#region src/units/types.d.ts
|
|
5
|
-
type ButtonUnit = {
|
|
5
|
+
export type ButtonUnit = {
|
|
6
6
|
kind: "user-button";
|
|
7
7
|
type: "user-button" | "icon-button";
|
|
8
8
|
data: {
|
|
@@ -14,27 +14,34 @@ type ButtonUnit = {
|
|
|
14
14
|
hideWhenEmpty?: boolean;
|
|
15
15
|
icon?: string;
|
|
16
16
|
};
|
|
17
|
-
type UnitExpression = string[];
|
|
18
|
-
type DbUnit = {
|
|
17
|
+
export type UnitExpression = string[];
|
|
18
|
+
export type DbUnit = {
|
|
19
19
|
kind: "db";
|
|
20
20
|
type: "type-icon" | "type-badge" | "type-badge-abbr";
|
|
21
21
|
expression?: UnitExpression;
|
|
22
22
|
checked?: boolean;
|
|
23
23
|
hideWhenEmpty?: boolean;
|
|
24
24
|
};
|
|
25
|
-
type
|
|
25
|
+
type FieldUnitMetadata = {
|
|
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-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
|
-
expression: UnitExpression;
|
|
29
27
|
checked?: boolean;
|
|
30
28
|
settings?: Record<string, unknown>;
|
|
31
29
|
hideWhenEmpty?: boolean;
|
|
32
30
|
};
|
|
33
|
-
type
|
|
34
|
-
type
|
|
35
|
-
type
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
type FieldUnitType = "avatar" | "avatar-collection" | "avatar-input" | "back-references-list" | "bool" | "bool-checkbox" | "collection-count" | "color-input" | "comments-collection" | "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";
|
|
32
|
+
export type ExpressionFieldUnit = FieldUnitMetadata & {
|
|
33
|
+
type: FieldUnitType;
|
|
34
|
+
expression: UnitExpression;
|
|
35
|
+
};
|
|
36
|
+
export type FieldUnit = ExpressionFieldUnit | (FieldUnitMetadata & {
|
|
37
|
+
type: "id" | "title";
|
|
38
|
+
expression?: UnitExpression;
|
|
39
|
+
});
|
|
40
|
+
export type Unit = FieldUnit | ButtonUnit | DbUnit;
|
|
41
|
+
type ToPure<T extends Unit> = T extends Unit ? Omit<T, "checked"> : never;
|
|
42
|
+
export type PureUnit = ToPure<FieldUnit> | ToPure<ButtonUnit> | ToPure<DbUnit>;
|
|
43
|
+
export type UnitDataDefinition<T extends Unit> = {
|
|
44
|
+
type: T["type"];
|
|
38
45
|
name: string;
|
|
39
46
|
canEdit: (params: {
|
|
40
47
|
typeObject: TypeObject;
|
|
@@ -70,5 +77,4 @@ type UnitDataDefinition<T extends Unit> = {
|
|
|
70
77
|
unit: T;
|
|
71
78
|
}) => string;
|
|
72
79
|
};
|
|
73
|
-
//#endregion
|
|
74
|
-
export { ButtonUnit, DbUnit, FieldUnit, PureUnit, Unit, UnitDataDefinition, UnitExpression };
|
|
80
|
+
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fibery/views",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "26.0.2",
|
|
4
4
|
"description": "Operations on view objects",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "Fibery",
|
|
@@ -30,17 +30,17 @@
|
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
+
"@fibery/expression-utils": "17.0.0",
|
|
34
|
+
"@fibery/helpers": "5.0.0",
|
|
35
|
+
"@fibery/query-utils": "7.2.4",
|
|
36
|
+
"@fibery/schema": "13.1.0",
|
|
33
37
|
"date-fns": "2.29.2",
|
|
34
38
|
"lodash": "4.18.1",
|
|
35
|
-
"moment": "2.31.0"
|
|
36
|
-
"@fibery/expression-utils": "16.0.4",
|
|
37
|
-
"@fibery/helpers": "4.2.1",
|
|
38
|
-
"@fibery/query-utils": "7.2.3",
|
|
39
|
-
"@fibery/schema": "13.0.2"
|
|
39
|
+
"moment": "2.31.0"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"@fibery/expression-utils": "^
|
|
43
|
-
"@fibery/schema": "^13.0
|
|
42
|
+
"@fibery/expression-utils": "^17.0.0",
|
|
43
|
+
"@fibery/schema": "^13.1.0",
|
|
44
44
|
"lodash": "4.18.1"
|
|
45
45
|
}
|
|
46
46
|
}
|