@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
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ExpressionFieldUnit, Unit, UnitExpression } from "../units/types.js";
|
|
2
2
|
import { TypeObject } from "@fibery/schema";
|
|
3
3
|
//#region src/unit-utils/common.d.ts
|
|
4
|
-
declare const makeUnitMethod: (type:
|
|
4
|
+
export declare const makeUnitMethod: (type: ExpressionFieldUnit["type"]) => ({ expression }?: {
|
|
5
5
|
expression?: UnitExpression;
|
|
6
|
-
}) =>
|
|
7
|
-
declare const calculateUnitExpressionErrors: ({ typeObject, unit }: {
|
|
6
|
+
}) => ExpressionFieldUnit;
|
|
7
|
+
export declare const calculateUnitExpressionErrors: ({ typeObject, unit }: {
|
|
8
8
|
typeObject: TypeObject;
|
|
9
9
|
unit: Unit;
|
|
10
10
|
}) => string[];
|
|
11
|
-
declare const isUnitEnabled: (unit: Unit) => boolean;
|
|
12
|
-
declare const toPureUnit: (unit: Unit) => {
|
|
11
|
+
export declare const isUnitEnabled: (unit: Unit) => boolean;
|
|
12
|
+
export declare const toPureUnit: (unit: Unit) => {
|
|
13
13
|
kind: "user-button";
|
|
14
14
|
type: "user-button" | "icon-button";
|
|
15
15
|
data: {
|
|
@@ -26,12 +26,17 @@ declare const toPureUnit: (unit: Unit) => {
|
|
|
26
26
|
hideWhenEmpty?: boolean;
|
|
27
27
|
} | {
|
|
28
28
|
kind: "field";
|
|
29
|
-
|
|
29
|
+
settings?: Record<string, unknown>;
|
|
30
|
+
hideWhenEmpty?: boolean;
|
|
31
|
+
type: "avatar" | "avatar-collection" | "avatar-input" | "back-references-list" | "bool" | "bool-checkbox" | "collection-count" | "color-input" | "comments-collection" | "comments-list" | "date" | "date-range" | "date-range-combobox" | "date-time" | "date-time-combobox" | "date-time-range" | "email" | "email-input" | "emoji" | "field" | "file-collection-count" | "file-compact-collection" | "file-compact-reference" | "file-reference" | "files-collection" | "files-gallery" | "files-l-list" | "files-l-list-item" | "files-list" | "files-list-item" | "geometry-preview" | "icon-button" | "icon-input" | "id" | "json-input" | "location" | "location-input" | "number" | "number-input" | "phone" | "phone-input" | "progress-bar" | "reference" | "reference-collection" | "reference-collection-combobox" | "reference-collection-list" | "reference-collection-view" | "reference-combobox" | "reference-icon" | "rich-text-document" | "rich-text-snippet" | "single-location-preview" | "text" | "text-input" | "title" | "title-input" | "url" | "url-input" | "user-role" | "user-role-input";
|
|
30
32
|
expression: UnitExpression;
|
|
33
|
+
} | {
|
|
34
|
+
kind: "field";
|
|
31
35
|
settings?: Record<string, unknown>;
|
|
32
36
|
hideWhenEmpty?: boolean;
|
|
37
|
+
type: "id" | "title";
|
|
38
|
+
expression?: UnitExpression;
|
|
33
39
|
};
|
|
34
|
-
declare const asString: (something: unknown) => string;
|
|
35
|
-
declare const canEditFieldExpression: (typeObject: TypeObject, expression: UnitExpression) => boolean;
|
|
36
|
-
//#endregion
|
|
37
|
-
export { asString, calculateUnitExpressionErrors, canEditFieldExpression, isUnitEnabled, makeUnitMethod, toPureUnit };
|
|
40
|
+
export declare const asString: (something: unknown) => string;
|
|
41
|
+
export declare const canEditFieldExpression: (typeObject: TypeObject, expression: UnitExpression) => boolean;
|
|
42
|
+
//#endregion
|
|
@@ -34,8 +34,8 @@ function digitsToString(d) {
|
|
|
34
34
|
const indexOfLastWord = d.length - 1;
|
|
35
35
|
if (indexOfLastWord > 0) {
|
|
36
36
|
str += w;
|
|
37
|
-
let i;
|
|
38
|
-
for (
|
|
37
|
+
let i = 1;
|
|
38
|
+
for (; i < indexOfLastWord; i++) {
|
|
39
39
|
const ws = String(d[i]);
|
|
40
40
|
const k = LOG_BASE - ws.length;
|
|
41
41
|
if (k) str += getZeroString(k);
|
|
@@ -153,8 +153,8 @@ function parseDecimal(x, str) {
|
|
|
153
153
|
let e = str.indexOf(".");
|
|
154
154
|
if (e > -1) str = str.replace(".", "");
|
|
155
155
|
if (e < 0) e = str.length;
|
|
156
|
-
let i;
|
|
157
|
-
for (
|
|
156
|
+
let i = 0;
|
|
157
|
+
for (; str.charCodeAt(i) === 48; i++);
|
|
158
158
|
let len;
|
|
159
159
|
for (len = str.length; str.charCodeAt(len - 1) === 48; --len);
|
|
160
160
|
str = str.slice(i, len);
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
//#region src/unit-utils/dynamic-keys.d.ts
|
|
2
|
-
declare const isUserActiveDynamicKeyPrefix = "is-user-active";
|
|
3
|
-
declare const isFinalStateDynamicKeyPrefix = "is-final-state";
|
|
4
|
-
declare const colorCodingKeyPrefix = "color-coding";
|
|
5
|
-
declare const hasAccessToSecretKeyPrefix = "has-access-to-secret";
|
|
6
|
-
declare const collectionCountKeyPrefix = "collection-count";
|
|
7
|
-
declare const accessCheckKeyKeyPrefix = "access/check";
|
|
8
|
-
declare const makeDynamicKey: (prefix: string, key?: string) => string;
|
|
9
|
-
//#endregion
|
|
10
|
-
export { accessCheckKeyKeyPrefix, collectionCountKeyPrefix, colorCodingKeyPrefix, hasAccessToSecretKeyPrefix, isFinalStateDynamicKeyPrefix, isUserActiveDynamicKeyPrefix, makeDynamicKey };
|
|
2
|
+
export declare const isUserActiveDynamicKeyPrefix = "is-user-active";
|
|
3
|
+
export declare const isFinalStateDynamicKeyPrefix = "is-final-state";
|
|
4
|
+
export declare const colorCodingKeyPrefix = "color-coding";
|
|
5
|
+
export declare const hasAccessToSecretKeyPrefix = "has-access-to-secret";
|
|
6
|
+
export declare const collectionCountKeyPrefix = "collection-count";
|
|
7
|
+
export declare const accessCheckKeyKeyPrefix = "access/check";
|
|
8
|
+
export declare const makeDynamicKey: (prefix: string, key?: string) => string;
|
|
9
|
+
//#endregion
|
|
@@ -2,16 +2,16 @@ import { 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
4
|
//#region src/unit-utils/enums.d.ts
|
|
5
|
-
declare const getEnumIconColorQuery: ({ typeObject, contextPath }: {
|
|
5
|
+
export declare const getEnumIconColorQuery: ({ typeObject, contextPath }: {
|
|
6
6
|
typeObject: TypeObject;
|
|
7
7
|
contextPath?: FieldExpression$1;
|
|
8
8
|
}) => Select;
|
|
9
|
-
declare function getEnumIconSelect(typeObject: TypeObject): {
|
|
9
|
+
export declare function getEnumIconSelect(typeObject: TypeObject): {
|
|
10
10
|
"enum/icon": string[];
|
|
11
11
|
} | {
|
|
12
12
|
"enum/icon"?: undefined;
|
|
13
13
|
};
|
|
14
|
-
declare const getEnumsRequest: (enumTypeObject: TypeObject) => {
|
|
14
|
+
export declare const getEnumsRequest: (enumTypeObject: TypeObject) => {
|
|
15
15
|
query: {
|
|
16
16
|
"q/from": import("@fibery/schema").TypeName;
|
|
17
17
|
"q/select": {
|
|
@@ -26,5 +26,4 @@ declare const getEnumsRequest: (enumTypeObject: TypeObject) => {
|
|
|
26
26
|
};
|
|
27
27
|
params: {};
|
|
28
28
|
};
|
|
29
|
-
//#endregion
|
|
30
|
-
export { getEnumIconColorQuery, getEnumIconSelect, getEnumsRequest };
|
|
29
|
+
//#endregion
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { NumberDisplaySettings } from "../field-utils/number.js";
|
|
2
2
|
import { FieldObject } from "@fibery/schema";
|
|
3
3
|
//#region src/unit-utils/formatters.d.ts
|
|
4
|
-
declare const defaultLocale = "en-US";
|
|
5
|
-
declare const defaultDateFormat = "MMM D, YYYY";
|
|
6
|
-
declare const defaultDateTimeFormat = "MMM D, YYYY HH:mm";
|
|
7
|
-
declare const defaultTimeFormat = "HH:mm";
|
|
8
|
-
declare const formatArbitraryNumber: (value: number, displaySettings?: NumberDisplaySettings, options?: Intl.NumberFormatOptions) => string;
|
|
9
|
-
declare const formatNumber: (useGrouping: boolean, precision: number, value: number, displaySettings?: NumberDisplaySettings) => string;
|
|
10
|
-
declare const formatCurrency: (currency: string, useGrouping: boolean, precision: number, value: number | string, displaySettings?: NumberDisplaySettings) => string;
|
|
11
|
-
declare const formatPercent: (useGrouping: boolean, precision: number, value: number | string, displaySettings?: NumberDisplaySettings) => string;
|
|
12
|
-
declare const formatNumberWithoutUnit: ({ value, format, displaySettings, currencyCode, precision, useThousandSeparator }: {
|
|
4
|
+
export declare const defaultLocale = "en-US";
|
|
5
|
+
export declare const defaultDateFormat = "MMM D, YYYY";
|
|
6
|
+
export declare const defaultDateTimeFormat = "MMM D, YYYY HH:mm";
|
|
7
|
+
export declare const defaultTimeFormat = "HH:mm";
|
|
8
|
+
export declare const formatArbitraryNumber: (value: number, displaySettings?: NumberDisplaySettings, options?: Intl.NumberFormatOptions) => string;
|
|
9
|
+
export declare const formatNumber: (useGrouping: boolean, precision: number, value: number, displaySettings?: NumberDisplaySettings) => string;
|
|
10
|
+
export declare const formatCurrency: (currency: string, useGrouping: boolean, precision: number, value: number | string, displaySettings?: NumberDisplaySettings) => string;
|
|
11
|
+
export declare const formatPercent: (useGrouping: boolean, precision: number, value: number | string, displaySettings?: NumberDisplaySettings) => string;
|
|
12
|
+
export declare const formatNumberWithoutUnit: ({ value, format, displaySettings, currencyCode, precision, useThousandSeparator }: {
|
|
13
13
|
value: string;
|
|
14
14
|
format?: string;
|
|
15
15
|
displaySettings?: NumberDisplaySettings;
|
|
@@ -17,7 +17,7 @@ declare const formatNumberWithoutUnit: ({ value, format, displaySettings, curren
|
|
|
17
17
|
precision: number;
|
|
18
18
|
useThousandSeparator: boolean;
|
|
19
19
|
}) => string;
|
|
20
|
-
declare const formatNumberWithUnitAsString: ({ value, format, displaySettings, unit, currencyCode, precision, useThousandSeparator, withNumberUnit }: {
|
|
20
|
+
export declare const formatNumberWithUnitAsString: ({ value, format, displaySettings, unit, currencyCode, precision, useThousandSeparator, withNumberUnit }: {
|
|
21
21
|
value: string;
|
|
22
22
|
format?: string;
|
|
23
23
|
displaySettings?: NumberDisplaySettings;
|
|
@@ -27,8 +27,8 @@ declare const formatNumberWithUnitAsString: ({ value, format, displaySettings, u
|
|
|
27
27
|
useThousandSeparator: boolean;
|
|
28
28
|
withNumberUnit: boolean;
|
|
29
29
|
}) => string;
|
|
30
|
-
declare const formatNumberWithUnitAsStringByFieldObject: (fieldObject: FieldObject, value: string, displaySettings?: NumberDisplaySettings) => string;
|
|
31
|
-
declare const formatDateRange: ({ value, type, format }: {
|
|
30
|
+
export declare const formatNumberWithUnitAsStringByFieldObject: (fieldObject: FieldObject, value: string, displaySettings?: NumberDisplaySettings) => string;
|
|
31
|
+
export declare const formatDateRange: ({ value, type, format }: {
|
|
32
32
|
value: {
|
|
33
33
|
start: string;
|
|
34
34
|
end: string;
|
|
@@ -36,7 +36,7 @@ declare const formatDateRange: ({ value, type, format }: {
|
|
|
36
36
|
type: string;
|
|
37
37
|
format?: string;
|
|
38
38
|
}) => string;
|
|
39
|
-
declare const formatDateTimeRange: ({ value, type, dateFormat, timeFormat, dateTimeFormat }: {
|
|
39
|
+
export declare const formatDateTimeRange: ({ value, type, dateFormat, timeFormat, dateTimeFormat }: {
|
|
40
40
|
value: {
|
|
41
41
|
start: string;
|
|
42
42
|
end: string;
|
|
@@ -46,8 +46,7 @@ declare const formatDateTimeRange: ({ value, type, dateFormat, timeFormat, dateT
|
|
|
46
46
|
timeFormat?: string;
|
|
47
47
|
dateTimeFormat?: string;
|
|
48
48
|
}) => string;
|
|
49
|
-
declare function formatUnitUrl(url: string): {
|
|
49
|
+
export declare function formatUnitUrl(url: string): {
|
|
50
50
|
host: string;
|
|
51
51
|
};
|
|
52
|
-
//#endregion
|
|
53
|
-
export { defaultDateFormat, defaultDateTimeFormat, defaultLocale, defaultTimeFormat, formatArbitraryNumber, formatCurrency, formatDateRange, formatDateTimeRange, formatNumber, formatNumberWithUnitAsString, formatNumberWithUnitAsStringByFieldObject, formatNumberWithoutUnit, formatPercent, formatUnitUrl };
|
|
52
|
+
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { parseEnd, parseStart } from "../field-utils/date-time.js";
|
|
2
|
-
import { parseNumberFieldMeta } from "../field-utils/number.js";
|
|
3
1
|
import Decimal from "./decimal.js";
|
|
2
|
+
import { parseNumberFieldMeta } from "../field-utils/number.js";
|
|
3
|
+
import { parseEnd, parseStart } from "../field-utils/date-time.js";
|
|
4
4
|
import isNil from "lodash/isNil.js";
|
|
5
5
|
//#region src/unit-utils/formatters.ts
|
|
6
6
|
const defaultLocale = "en-US";
|
|
@@ -1,48 +1,47 @@
|
|
|
1
1
|
import { NumberDisplaySettings } from "../field-utils/number.js";
|
|
2
|
-
import {
|
|
2
|
+
import { ExpressionFieldUnit } from "../units/types.js";
|
|
3
3
|
import { FieldObject, TypeObject } from "@fibery/schema";
|
|
4
4
|
import { FiberyObject } from "@fibery/expression-utils/src/types";
|
|
5
5
|
//#region src/unit-utils/get-export-value.d.ts
|
|
6
|
-
declare const getExportValue: <Value = unknown>({ object, unit }: {
|
|
6
|
+
export declare const getExportValue: <Value = unknown>({ object, unit }: {
|
|
7
7
|
object: FiberyObject;
|
|
8
|
-
unit:
|
|
8
|
+
unit: ExpressionFieldUnit;
|
|
9
9
|
}) => Value;
|
|
10
|
-
declare const getReferenceCollectionExportValue: ({ unit, typeObject, object }: {
|
|
10
|
+
export declare const getReferenceCollectionExportValue: ({ unit, typeObject, object }: {
|
|
11
11
|
object: FiberyObject;
|
|
12
|
-
unit:
|
|
12
|
+
unit: ExpressionFieldUnit;
|
|
13
13
|
typeObject: TypeObject;
|
|
14
14
|
}) => (string | undefined)[] | FiberyObject[] | null;
|
|
15
|
-
declare const getReferenceExportValue: ({ unit, typeObject, object }: {
|
|
15
|
+
export declare const getReferenceExportValue: ({ unit, typeObject, object }: {
|
|
16
16
|
object: FiberyObject;
|
|
17
|
-
unit:
|
|
17
|
+
unit: ExpressionFieldUnit;
|
|
18
18
|
typeObject: TypeObject;
|
|
19
19
|
}) => string | null | undefined;
|
|
20
|
-
declare const getSnippetExportValue: ({ object, unit }: {
|
|
20
|
+
export declare const getSnippetExportValue: ({ object, unit }: {
|
|
21
21
|
object: FiberyObject;
|
|
22
|
-
unit:
|
|
22
|
+
unit: ExpressionFieldUnit;
|
|
23
23
|
}) => unknown;
|
|
24
|
-
declare const formatDateRangeExportValue: (value: {
|
|
24
|
+
export declare const formatDateRangeExportValue: (value: {
|
|
25
25
|
start: string;
|
|
26
26
|
end: string;
|
|
27
27
|
} | null, fieldObject: FieldObject | null) => string | null;
|
|
28
|
-
declare const getDateRangeExportValue: ({ object, unit, typeObject }: {
|
|
28
|
+
export declare const getDateRangeExportValue: ({ object, unit, typeObject }: {
|
|
29
29
|
object: FiberyObject;
|
|
30
|
-
unit:
|
|
30
|
+
unit: ExpressionFieldUnit;
|
|
31
31
|
typeObject: TypeObject;
|
|
32
32
|
}) => string | null;
|
|
33
|
-
declare const getLocationExportValue: ({ object, unit }: {
|
|
33
|
+
export declare const getLocationExportValue: ({ object, unit }: {
|
|
34
34
|
object: FiberyObject;
|
|
35
|
-
unit:
|
|
35
|
+
unit: ExpressionFieldUnit;
|
|
36
36
|
}) => unknown;
|
|
37
|
-
declare const getTitleExportValue: ({ object, typeObject }: {
|
|
37
|
+
export declare const getTitleExportValue: ({ object, typeObject }: {
|
|
38
38
|
object: FiberyObject;
|
|
39
39
|
typeObject: TypeObject;
|
|
40
40
|
}) => string | undefined;
|
|
41
|
-
declare const getNumberExportValue: ({ object, unit, typeObject, displaySettings }: {
|
|
41
|
+
export declare const getNumberExportValue: ({ object, unit, typeObject, displaySettings }: {
|
|
42
42
|
object: FiberyObject;
|
|
43
43
|
typeObject: TypeObject;
|
|
44
|
-
unit:
|
|
44
|
+
unit: ExpressionFieldUnit;
|
|
45
45
|
displaySettings: NumberDisplaySettings;
|
|
46
46
|
}) => string;
|
|
47
|
-
//#endregion
|
|
48
|
-
export { formatDateRangeExportValue, getDateRangeExportValue, getExportValue, getLocationExportValue, getNumberExportValue, getReferenceCollectionExportValue, getReferenceExportValue, getSnippetExportValue, getTitleExportValue };
|
|
47
|
+
//#endregion
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ExpressionFieldUnit } from "../units/types.js";
|
|
2
2
|
import { TypeObject } from "@fibery/schema";
|
|
3
3
|
//#region src/unit-utils/get-field-label.d.ts
|
|
4
|
-
declare const getFieldLabel: ({ typeObject, unit }: {
|
|
4
|
+
export declare const getFieldLabel: ({ typeObject, unit }: {
|
|
5
5
|
typeObject: TypeObject;
|
|
6
|
-
unit:
|
|
6
|
+
unit: ExpressionFieldUnit;
|
|
7
7
|
}) => string;
|
|
8
|
-
//#endregion
|
|
9
|
-
export { getFieldLabel };
|
|
8
|
+
//#endregion
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Unit } from "../units/types.js";
|
|
2
2
|
//#region src/unit-utils/get-unmatched-unit-label.d.ts
|
|
3
|
-
declare const getUnmatchedUnitLabel: (unit: Unit) => string;
|
|
4
|
-
//#endregion
|
|
5
|
-
export { getUnmatchedUnitLabel };
|
|
3
|
+
export declare const getUnmatchedUnitLabel: (unit: Unit) => string;
|
|
4
|
+
//#endregion
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { FieldObject } from "@fibery/schema";
|
|
2
2
|
import { FieldExpression } from "@fibery/expression-utils/src/types";
|
|
3
3
|
//#region src/unit-utils/wrap-normalized-in-expression.d.ts
|
|
4
|
-
declare const wrapNormalizedInExpression: (innerNormalized: Record<string, unknown>, fieldObjects: FieldObject[], expression: FieldExpression) => Record<string, unknown>;
|
|
5
|
-
//#endregion
|
|
6
|
-
export { wrapNormalizedInExpression };
|
|
4
|
+
export declare const wrapNormalizedInExpression: (innerNormalized: Record<string, unknown>, fieldObjects: FieldObject[], expression: FieldExpression) => Record<string, unknown>;
|
|
5
|
+
//#endregion
|
package/lib/units/board.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { ButtonUnit, DbUnit,
|
|
1
|
+
import { ButtonUnit, DbUnit, ExpressionFieldUnit, PureUnit, Unit, UnitDataDefinition, UnitExpression } from "./types.js";
|
|
2
|
+
import { MissingUnitDefinition } from "../unit-definitions/not-found.js";
|
|
2
3
|
import { TypeObject } from "@fibery/schema";
|
|
3
4
|
//#region src/units/board.d.ts
|
|
4
|
-
declare const getTypeUnits: () => PureUnit[], getUnitName: (unit: Unit) => string | null, getUnitsForType: (typeObject: TypeObject, options?: {
|
|
5
|
+
export declare const getTypeUnits: () => PureUnit[], getUnitName: (unit: Unit) => string | null, getUnitsForType: (typeObject: TypeObject, options?: {
|
|
5
6
|
parentFieldObjects?: import("@fibery/schema").FieldObject[];
|
|
6
7
|
showHiddenFields?: boolean;
|
|
7
8
|
isSharingMode?: boolean;
|
|
@@ -19,32 +20,28 @@ declare const getTypeUnits: () => PureUnit[], getUnitName: (unit: Unit) => strin
|
|
|
19
20
|
}) => {
|
|
20
21
|
fieldObject: import("@fibery/schema").FieldObject;
|
|
21
22
|
units: Unit[];
|
|
22
|
-
}[], getUnitLabel: (typeObject: TypeObject, unit:
|
|
23
|
-
kind: "user-button";
|
|
24
|
-
type: "user-button" | "icon-button";
|
|
25
|
-
data: {
|
|
26
|
-
id: string;
|
|
27
|
-
typeId: import("@fibery/schema").TypeId;
|
|
28
|
-
};
|
|
29
|
-
label: string;
|
|
30
|
-
hideWhenEmpty?: boolean;
|
|
31
|
-
icon?: string;
|
|
32
|
-
} | {
|
|
33
|
-
kind: "db";
|
|
34
|
-
type: "type-icon" | "type-badge" | "type-badge-abbr";
|
|
35
|
-
expression?: UnitExpression;
|
|
36
|
-
hideWhenEmpty?: boolean;
|
|
37
|
-
} | {
|
|
23
|
+
}[], getUnitLabel: <U extends Unit>(typeObject: TypeObject, unit: U) => string, getHardcodedUnitsForView: (typeObject: TypeObject) => (Omit<ButtonUnit, "checked"> | Omit<DbUnit, "checked"> | Omit<ExpressionFieldUnit, "checked"> | Omit<{
|
|
38
24
|
kind: "field";
|
|
39
|
-
|
|
40
|
-
expression: UnitExpression;
|
|
25
|
+
checked?: boolean;
|
|
41
26
|
settings?: Record<string, unknown>;
|
|
42
27
|
hideWhenEmpty?: boolean;
|
|
43
|
-
}
|
|
28
|
+
} & {
|
|
29
|
+
type: "id" | "title";
|
|
30
|
+
expression?: UnitExpression;
|
|
31
|
+
}, "checked">)[], getCardUnitsSelect: ({ schema, typeObject, units }: {
|
|
44
32
|
schema: import("@fibery/schema").Schema;
|
|
45
33
|
typeObject: TypeObject;
|
|
46
34
|
units: Unit[];
|
|
47
|
-
}) => import("@fibery/
|
|
48
|
-
declare const getDefaultUnits: (typeObject: TypeObject) =>
|
|
49
|
-
|
|
50
|
-
|
|
35
|
+
}) => import("@fibery/schema").Select, getUnitDataDefinition: (unit: Unit) => UnitDataDefinition<Unit> | MissingUnitDefinition;
|
|
36
|
+
export declare const getDefaultUnits: (typeObject: TypeObject) => ({
|
|
37
|
+
type: "avatar";
|
|
38
|
+
kind: "field";
|
|
39
|
+
expression: string[];
|
|
40
|
+
} | {
|
|
41
|
+
type: "title";
|
|
42
|
+
kind: "field";
|
|
43
|
+
} | {
|
|
44
|
+
type: "type-badge-abbr";
|
|
45
|
+
kind: "db";
|
|
46
|
+
})[];
|
|
47
|
+
//#endregion
|
package/lib/units/board.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/board.ts
|
|
6
7
|
var board_exports = /* @__PURE__ */ __exportAll({
|
|
7
8
|
getCardUnitsSelect: () => getCardUnitsSelect,
|
|
@@ -18,7 +19,7 @@ var board_exports = /* @__PURE__ */ __exportAll({
|
|
|
18
19
|
const { getTypeUnits, getUnitName, getUnitsForType, getUnitsForField, getUnitsForTypePerField, getUnitLabel, getHardcodedUnitsForView, getCardUnitsSelect, getUnitDataDefinition } = makeUnitDefinitionsFactory(unit_definitions_exports);
|
|
19
20
|
const getDefaultUnits = (typeObject) => {
|
|
20
21
|
const { Title, Avatar, TypeBadgeAbbr } = unit_definitions_exports;
|
|
21
|
-
return [Title && Title.makeUnit(), typeObject && isAvatarExtensionEnabledType(typeObject) ? Avatar && Avatar.makeUnit() : TypeBadgeAbbr && TypeBadgeAbbr.makeUnit()].filter(
|
|
22
|
+
return [Title && Title.makeUnit(), typeObject && isAvatarExtensionEnabledType(typeObject) ? Avatar && Avatar.makeUnit() : TypeBadgeAbbr && TypeBadgeAbbr.makeUnit()].filter(truthy);
|
|
22
23
|
};
|
|
23
24
|
//#endregion
|
|
24
25
|
export { board_exports, getCardUnitsSelect, getDefaultUnits, getHardcodedUnitsForView, getTypeUnits, getUnitDataDefinition, getUnitLabel, getUnitName, getUnitsForField, getUnitsForType, getUnitsForTypePerField };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { PureUnit, Unit, UnitExpression } from "../types.js";
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { ButtonUnit, DbUnit, ExpressionFieldUnit, PureUnit, Unit, UnitExpression } from "../types.js";
|
|
2
|
+
declare namespace index_d_exports {
|
|
3
|
+
export { getCardUnitsSelect, getDefaultUnits, getHardcodedUnitsForView, getTypeUnits, getUnitLabel, getUnitName, getUnitsForField, getUnitsForType, getUnitsForTypePerField };
|
|
4
|
+
}
|
|
5
|
+
export declare const getTypeUnits: () => PureUnit[], getUnitName: (unit: Unit) => string | null, getUnitsForField: (fieldObject: import("@fibery/schema").FieldObject, options?: {
|
|
4
6
|
parentFieldObjects?: import("@fibery/schema").FieldObject[];
|
|
5
7
|
showHiddenFields?: boolean;
|
|
6
8
|
isSharingMode?: boolean;
|
|
@@ -18,32 +20,25 @@ declare const getTypeUnits: () => PureUnit[], getUnitName: (unit: Unit) => strin
|
|
|
18
20
|
}) => {
|
|
19
21
|
fieldObject: import("@fibery/schema").FieldObject;
|
|
20
22
|
units: Unit[];
|
|
21
|
-
}[], getUnitLabel: (typeObject: import("@fibery/schema").TypeObject, unit:
|
|
23
|
+
}[], getUnitLabel: <U extends Unit>(typeObject: import("@fibery/schema").TypeObject, unit: U) => string, getCardUnitsSelect: ({ schema, typeObject, units }: {
|
|
22
24
|
schema: import("@fibery/schema").Schema;
|
|
23
25
|
typeObject: import("@fibery/schema").TypeObject;
|
|
24
26
|
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
|
-
} | {
|
|
27
|
+
}) => import("@fibery/schema").Select, getHardcodedUnitsForView: (typeObject: import("@fibery/schema").TypeObject) => (Omit<ButtonUnit, "checked"> | Omit<DbUnit, "checked"> | Omit<ExpressionFieldUnit, "checked"> | Omit<{
|
|
41
28
|
kind: "field";
|
|
42
|
-
|
|
43
|
-
expression: UnitExpression;
|
|
29
|
+
checked?: boolean;
|
|
44
30
|
settings?: Record<string, unknown>;
|
|
45
31
|
hideWhenEmpty?: boolean;
|
|
32
|
+
} & {
|
|
33
|
+
type: "id" | "title";
|
|
34
|
+
expression?: UnitExpression;
|
|
35
|
+
}, "checked">)[];
|
|
36
|
+
export declare const getDefaultUnits: () => ({
|
|
37
|
+
type: "title";
|
|
38
|
+
kind: "field";
|
|
39
|
+
} | {
|
|
40
|
+
type: "type-badge";
|
|
41
|
+
kind: "db";
|
|
46
42
|
})[];
|
|
47
|
-
declare const getDefaultUnits: () => PureUnit[];
|
|
48
43
|
//#endregion
|
|
49
|
-
export {
|
|
44
|
+
export { index_d_exports };
|
|
@@ -1,41 +1,19 @@
|
|
|
1
|
-
import { NumberDisplaySettings } from "../../field-utils/number.js";
|
|
2
|
-
import { DbUnit, PureUnit, UnitExpression } from "../types.js";
|
|
3
1
|
import { TypeObject } from "@fibery/schema";
|
|
4
2
|
//#region src/units/canvas/type-badge-abbr.d.ts
|
|
5
|
-
declare const TypeBadgeAbbr: {
|
|
6
|
-
type:
|
|
3
|
+
export declare const TypeBadgeAbbr: {
|
|
4
|
+
type: "type-badge-abbr";
|
|
7
5
|
name: string;
|
|
8
|
-
canEdit: (
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
unit: DbUnit;
|
|
18
|
-
}) => string;
|
|
19
|
-
calculateErrors: (params: {
|
|
20
|
-
typeObject: TypeObject;
|
|
21
|
-
unit: DbUnit;
|
|
22
|
-
}) => string[];
|
|
23
|
-
getExportValue: (params: {
|
|
24
|
-
typeObject: TypeObject;
|
|
25
|
-
unit: DbUnit;
|
|
26
|
-
object: import("@fibery/expression-utils/src/types").FiberyObject;
|
|
27
|
-
displaySettings: NumberDisplaySettings;
|
|
28
|
-
}) => unknown;
|
|
29
|
-
canExport: (params: {
|
|
30
|
-
unit: DbUnit;
|
|
31
|
-
}) => boolean;
|
|
32
|
-
getExportLabel?: ((params: {
|
|
33
|
-
typeObject: TypeObject;
|
|
34
|
-
unit: DbUnit;
|
|
35
|
-
}) => string) | undefined;
|
|
6
|
+
canEdit: () => false;
|
|
7
|
+
getLabel(): string;
|
|
8
|
+
makeUnit(): {
|
|
9
|
+
type: "type-badge-abbr";
|
|
10
|
+
kind: "db";
|
|
11
|
+
};
|
|
12
|
+
calculateErrors(): never[];
|
|
13
|
+
getExportValue(): null;
|
|
14
|
+
canExport: () => false;
|
|
36
15
|
getQuerySelect({ typeObject }: {
|
|
37
16
|
typeObject: TypeObject;
|
|
38
|
-
}): import("@fibery/
|
|
17
|
+
}): import("@fibery/schema").Select;
|
|
39
18
|
};
|
|
40
|
-
//#endregion
|
|
41
|
-
export { TypeBadgeAbbr };
|
|
19
|
+
//#endregion
|
|
@@ -1,41 +1,19 @@
|
|
|
1
|
-
import { NumberDisplaySettings } from "../../field-utils/number.js";
|
|
2
|
-
import { DbUnit, PureUnit, UnitExpression } from "../types.js";
|
|
3
1
|
import { TypeObject } from "@fibery/schema";
|
|
4
2
|
//#region src/units/canvas/type-badge.d.ts
|
|
5
|
-
declare const TypeBadge: {
|
|
6
|
-
type:
|
|
3
|
+
export declare const TypeBadge: {
|
|
4
|
+
type: "type-badge";
|
|
7
5
|
name: string;
|
|
8
|
-
canEdit: (
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
unit: DbUnit;
|
|
18
|
-
}) => string;
|
|
19
|
-
calculateErrors: (params: {
|
|
20
|
-
typeObject: TypeObject;
|
|
21
|
-
unit: DbUnit;
|
|
22
|
-
}) => string[];
|
|
23
|
-
getExportValue: (params: {
|
|
24
|
-
typeObject: TypeObject;
|
|
25
|
-
unit: DbUnit;
|
|
26
|
-
object: import("@fibery/expression-utils/src/types").FiberyObject;
|
|
27
|
-
displaySettings: NumberDisplaySettings;
|
|
28
|
-
}) => unknown;
|
|
29
|
-
canExport: (params: {
|
|
30
|
-
unit: DbUnit;
|
|
31
|
-
}) => boolean;
|
|
32
|
-
getExportLabel?: ((params: {
|
|
33
|
-
typeObject: TypeObject;
|
|
34
|
-
unit: DbUnit;
|
|
35
|
-
}) => string) | undefined;
|
|
6
|
+
canEdit: () => false;
|
|
7
|
+
getLabel(): string;
|
|
8
|
+
makeUnit(): {
|
|
9
|
+
type: "type-badge";
|
|
10
|
+
kind: "db";
|
|
11
|
+
};
|
|
12
|
+
calculateErrors(): never[];
|
|
13
|
+
getExportValue(): null;
|
|
14
|
+
canExport: () => false;
|
|
36
15
|
getQuerySelect({ typeObject }: {
|
|
37
16
|
typeObject: TypeObject;
|
|
38
|
-
}): import("@fibery/
|
|
17
|
+
}): import("@fibery/schema").Select;
|
|
39
18
|
};
|
|
40
|
-
//#endregion
|
|
41
|
-
export { TypeBadge };
|
|
19
|
+
//#endregion
|
package/lib/units/default.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
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
|
-
|
|
3
|
+
declare namespace default_d_exports {
|
|
4
|
+
export { getCardUnitsSelect, getDefaultUnits, getHardcodedUnitsForView, getTypeUnits, getUnitLabel, getUnitName, getUnitsForField, getUnitsForType, getUnitsForTypePerField };
|
|
5
|
+
}
|
|
6
|
+
export declare const getTypeUnits: () => PureUnit[], getUnitName: (unit: Unit) => string | null, getUnitsForType: (typeObject: TypeObject, options?: {
|
|
5
7
|
parentFieldObjects?: import("@fibery/schema").FieldObject[];
|
|
6
8
|
showHiddenFields?: boolean;
|
|
7
9
|
isSharingMode?: boolean;
|
|
@@ -23,28 +25,25 @@ declare const getTypeUnits: () => PureUnit[], getUnitName: (unit: Unit) => strin
|
|
|
23
25
|
schema: import("@fibery/schema").Schema;
|
|
24
26
|
typeObject: TypeObject;
|
|
25
27
|
units: Unit[];
|
|
26
|
-
}) => import("@fibery/
|
|
27
|
-
kind: "
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
id: string;
|
|
31
|
-
typeId: import("@fibery/schema").TypeId;
|
|
32
|
-
};
|
|
33
|
-
label: string;
|
|
28
|
+
}) => 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<{
|
|
29
|
+
kind: "field";
|
|
30
|
+
checked?: boolean;
|
|
31
|
+
settings?: Record<string, unknown>;
|
|
34
32
|
hideWhenEmpty?: boolean;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
kind: "db";
|
|
38
|
-
type: "type-icon" | "type-badge" | "type-badge-abbr";
|
|
33
|
+
} & {
|
|
34
|
+
type: "id" | "title";
|
|
39
35
|
expression?: UnitExpression;
|
|
40
|
-
|
|
36
|
+
}, "checked">)[];
|
|
37
|
+
export declare const getDefaultUnits: (typeObject: TypeObject) => ({
|
|
38
|
+
type: "avatar";
|
|
39
|
+
kind: "field";
|
|
40
|
+
expression: string[];
|
|
41
41
|
} | {
|
|
42
|
+
type: "title";
|
|
42
43
|
kind: "field";
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
hideWhenEmpty?: boolean;
|
|
44
|
+
} | {
|
|
45
|
+
type: "type-badge-abbr";
|
|
46
|
+
kind: "db";
|
|
47
47
|
})[];
|
|
48
|
-
declare const getDefaultUnits: (typeObject: TypeObject) => PureUnit[];
|
|
49
48
|
//#endregion
|
|
50
|
-
export {
|
|
49
|
+
export { default_d_exports };
|
package/lib/units/default.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/default.ts
|
|
6
7
|
var default_exports = /* @__PURE__ */ __exportAll({
|
|
7
8
|
getCardUnitsSelect: () => getCardUnitsSelect,
|
|
@@ -17,7 +18,7 @@ var default_exports = /* @__PURE__ */ __exportAll({
|
|
|
17
18
|
const { getTypeUnits, getUnitName, getUnitsForType, getUnitsForField, getUnitsForTypePerField, getCardUnitsSelect, getUnitLabel, getHardcodedUnitsForView } = makeUnitDefinitionsFactory(unit_definitions_exports);
|
|
18
19
|
const getDefaultUnits = (typeObject) => {
|
|
19
20
|
const { Title, Avatar, TypeBadgeAbbr } = unit_definitions_exports;
|
|
20
|
-
return [Title && Title.makeUnit(), typeObject && isAvatarExtensionEnabledType(typeObject) ? Avatar && Avatar.makeUnit() : TypeBadgeAbbr && TypeBadgeAbbr.makeUnit()].filter(
|
|
21
|
+
return [Title && Title.makeUnit(), typeObject && isAvatarExtensionEnabledType(typeObject) ? Avatar && Avatar.makeUnit() : TypeBadgeAbbr && TypeBadgeAbbr.makeUnit()].filter(truthy);
|
|
21
22
|
};
|
|
22
23
|
//#endregion
|
|
23
24
|
export { default_exports, getCardUnitsSelect, getDefaultUnits, getHardcodedUnitsForView, getTypeUnits, getUnitLabel, getUnitName, getUnitsForField, getUnitsForType, getUnitsForTypePerField };
|