@fibery/views 23.0.0 → 25.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,7 +9,7 @@ declare const getAvatarSelectQuery: ({ typeObject }: {
9
9
  typeObject: TypeObject;
10
10
  }) => {
11
11
  [x: string]: "__NOTHING_INTERESTING__TitleField__" | "fibery/id" | {
12
- "q/from": string[];
12
+ "q/from": import("@fibery/schema").FieldName[];
13
13
  "q/limit": string;
14
14
  "q/select": import("@fibery/expression-utils").Select;
15
15
  };
@@ -29,7 +29,7 @@ declare const getCommentsListSelect: (typeObject: TypeObject) => {
29
29
  };
30
30
  declare const getQuerySelect: (fieldObject: FieldObject) => {
31
31
  [x: string]: {
32
- "q/from": string[];
32
+ "q/from": import("@fibery/schema").FieldName[];
33
33
  "q/select": {
34
34
  "fibery/id": "fibery/id";
35
35
  "fibery/public-id": "fibery/public-id";
@@ -1,8 +1,8 @@
1
1
  import { NumberFormat } from "./number.js";
2
- import { FieldObject, TypeObject } from "@fibery/schema";
2
+ import { FieldObject, SpaceName, TypeObject } from "@fibery/schema";
3
3
  //#region src/field-utils/enum-value.d.ts
4
4
  declare const enumNumberFieldName = "Value";
5
- declare const getEnumNumberFieldName: (namespace: string) => string;
5
+ declare const getEnumNumberFieldName: (namespace: SpaceName) => string;
6
6
  declare const defaultEnumNumberFieldMeta: {
7
7
  numberFormat: NumberFormat;
8
8
  numberPrecision: number;
@@ -7,7 +7,7 @@ declare const isIconExtensionField: (fieldObject: FieldObject) => boolean;
7
7
  declare const getEntityIconSelect: ({ typeObject }: {
8
8
  typeObject: TypeObject;
9
9
  }) => {
10
- [x: string]: string;
10
+ [x: string]: import("@fibery/schema").FieldName;
11
11
  };
12
12
  //#endregion
13
13
  export { ICON_EXTENSION_FIELD, ICON_MIXIN_NAME, getEntityIconSelect, isIconExtensionEnabledType, isIconExtensionField };
@@ -88,32 +88,23 @@ const replaceNamesWithIdsInGroupByExpression = (schema, groupByExpression, fromT
88
88
  const visitor = replaceNamesWithIdsVisitor(typeObject);
89
89
  return Object.fromEntries(Object.entries(groupByExpression).map(([index, { expression }]) => [index, { expression: visitor.visitExpression(expression) }]));
90
90
  };
91
- const replaceHideHierarchiesWithoutType = (smartFolder, replaceType) => {
92
- const targetType = get(smartFolder, ["fibery/meta", "hideHierarchiesWithoutType"]);
93
- if (typeof targetType !== "string") return smartFolder;
94
- const replacedType = replaceType(targetType);
95
- if (!replacedType) return smartFolder;
96
- return immutableUpdate(smartFolder, { "fibery/meta": { hideHierarchiesWithoutType: { $set: replacedType } } });
97
- };
98
91
  const replaceNamesWithIdsInSmartFolder = (schema, smartFolder) => {
99
- const replacedSmartFolder = visitSmartFolder(smartFolder, {
92
+ return visitSmartFolder(smartFolder, {
100
93
  visitQueryExpression: (query) => replaceNamesWithIdsInQueryExpression(schema, query),
101
94
  visitFilter: (fromType, expression) => replaceNamesWithIdsInFilter(schema, fromType, expression),
102
95
  visitGroupByExpression: (groupBy, fromType) => replaceNamesWithIdsInGroupByExpression(schema, groupBy, fromType),
103
96
  visitExpression: (fromType, expression) => replaceNamesWithIdsInExpression(schema, fromType, expression),
104
97
  visitUnitGroupKey: (unitGroupKey) => replaceNamesWithIdsInUnitGroupKey(unitGroupKey, schema)
105
98
  });
106
- return replaceHideHierarchiesWithoutType(replacedSmartFolder, (type) => schema.getTypeObjectByName(type)?.id);
107
99
  };
108
100
  const replaceIdsWithNamesInSmartFolder = (schema, smartFolder) => {
109
- const replacedSmartFolder = visitSmartFolder(smartFolder, {
101
+ return visitSmartFolder(smartFolder, {
110
102
  visitQueryExpression: (query) => replaceIdsWithNamesInQueryExpression(schema, query),
111
103
  visitFilter: (fromType, expression) => replaceIdsWithNamesInFilter(schema, fromType, expression),
112
104
  visitGroupByExpression: (groupBy, fromType) => replaceIdsWithNamesInGroupByExpression(schema, groupBy, fromType),
113
105
  visitExpression: (fromType, expression) => replaceIdsWithNamesInExpression(schema, fromType, expression),
114
106
  visitUnitGroupKey: (unitGroupKey) => replaceIdsWithNamesInUnitGroupKey(unitGroupKey, getFieldObjectsById(smartFolder, schema))
115
107
  });
116
- return replaceHideHierarchiesWithoutType(replacedSmartFolder, (type) => schema.getTypeObjectById(type)?.name);
117
108
  };
118
109
  const deleteExpressionWithNotFoundFieldsOrTypesInSmartFolder = (schema, smartFolder) => visitSmartFolder(smartFolder, {
119
110
  visitQueryExpression: (query) => deleteExpressionWithNotFoundFieldsOrTypesInQueryExpression(schema, query),
@@ -38,23 +38,23 @@ declare const replaceNamesWithIdsInExpression: (schema: Schema, fromType: string
38
38
  declare const replaceIdsWithNamesInExpression: (schema: Schema, fromTypeId: string, expression: Expression) => any;
39
39
  declare const visitViewUnit: (fromType: string, unit: Unit, visitor: Pick<ViewVisitor, "visitExpression">) => Unit;
40
40
  declare const visitContextExpression: (fromType: string, contextExpression: Expression | null | undefined, visitor: Pick<ViewVisitor, "visitExpression" | "visitContextExpression">) => string | Expression[] | null | undefined;
41
- declare const replaceIdsWithNamesInQueryExpression: (schema: Schema, queryExpression: Query) => {
41
+ declare const replaceIdsWithNamesInQueryExpression: (schema: Schema, queryExpression: Query) => Query | {
42
42
  "q/select"?: Expression | import("@fibery/expression-utils").Select;
43
43
  "q/offset"?: number;
44
44
  "q/order-by"?: any;
45
45
  "q/limit"?: import("@fibery/expression-utils/src/types").QueryLimit;
46
46
  "q/where"?: any;
47
- "q/from": string;
47
+ "q/from": import("@fibery/schema").TypeName;
48
48
  };
49
49
  declare const replaceIdsWithNamesInFilter: (schema: Schema, fromType: string, filter: ViewFilter | null) => ViewFilter | null;
50
50
  declare const replaceNamesWithIdsInFilter: (schema: Schema, fromType: string, filter: ViewFilter | null) => ViewFilter | null;
51
- declare const replaceNamesWithIdsInQueryExpression: (schema: Schema, queryExpression: Query) => {
51
+ declare const replaceNamesWithIdsInQueryExpression: (schema: Schema, queryExpression: Query) => Query | {
52
52
  "q/select"?: Expression | import("@fibery/expression-utils").Select;
53
53
  "q/offset"?: number;
54
54
  "q/order-by"?: any;
55
55
  "q/limit"?: import("@fibery/expression-utils/src/types").QueryLimit;
56
56
  "q/where"?: any;
57
- "q/from": string;
57
+ "q/from": import("@fibery/schema").TypeId;
58
58
  };
59
59
  declare const deleteExpressionWithNotFoundFieldsOrTypesInExpression: (schema: Schema, fromType: string, expression: Expression) => any;
60
60
  declare const resetContextExpressionIfBroken: (schema: Schema, fromType: string, expression: Expression, defaultExpression: Expression) => any;
@@ -14,7 +14,7 @@ declare const toPureUnit: (unit: Unit) => {
14
14
  type: "user-button" | "icon-button";
15
15
  data: {
16
16
  id: string;
17
- typeId: string;
17
+ typeId: import("@fibery/schema").TypeId;
18
18
  };
19
19
  label: string;
20
20
  hideWhenEmpty?: boolean;
@@ -13,7 +13,7 @@ declare function getEnumIconSelect(typeObject: TypeObject): {
13
13
  };
14
14
  declare const getEnumsRequest: (enumTypeObject: TypeObject) => {
15
15
  query: {
16
- "q/from": string;
16
+ "q/from": import("@fibery/schema").TypeName;
17
17
  "q/select": {
18
18
  "workflow/Final"?: string | undefined;
19
19
  "workflow/Type"?: string | undefined;
@@ -24,7 +24,7 @@ declare const getTypeUnits: () => PureUnit[], getUnitName: (unit: Unit) => strin
24
24
  type: "user-button" | "icon-button";
25
25
  data: {
26
26
  id: string;
27
- typeId: string;
27
+ typeId: import("@fibery/schema").TypeId;
28
28
  };
29
29
  label: string;
30
30
  hideWhenEmpty?: boolean;
@@ -27,7 +27,7 @@ declare const getTypeUnits: () => PureUnit[], getUnitName: (unit: Unit) => strin
27
27
  type: "user-button" | "icon-button";
28
28
  data: {
29
29
  id: string;
30
- typeId: string;
30
+ typeId: import("@fibery/schema").TypeId;
31
31
  };
32
32
  label: string;
33
33
  hideWhenEmpty?: boolean;
@@ -28,7 +28,7 @@ declare const getTypeUnits: () => PureUnit[], getUnitName: (unit: Unit) => strin
28
28
  type: "user-button" | "icon-button";
29
29
  data: {
30
30
  id: string;
31
- typeId: string;
31
+ typeId: import("@fibery/schema").TypeId;
32
32
  };
33
33
  label: string;
34
34
  hideWhenEmpty?: boolean;
@@ -28,7 +28,7 @@ declare const getTypeUnits: () => PureUnit[], getUnitName: (unit: Unit) => strin
28
28
  type: "user-button" | "icon-button";
29
29
  data: {
30
30
  id: string;
31
- typeId: string;
31
+ typeId: import("@fibery/schema").TypeId;
32
32
  };
33
33
  label: string;
34
34
  hideWhenEmpty?: boolean;
@@ -27,7 +27,7 @@ declare const getTypeUnits: () => PureUnit[], getUnitName: (unit: Unit) => strin
27
27
  type: "user-button" | "icon-button";
28
28
  data: {
29
29
  id: string;
30
- typeId: string;
30
+ typeId: import("@fibery/schema").TypeId;
31
31
  };
32
32
  label: string;
33
33
  hideWhenEmpty?: boolean;
@@ -30,7 +30,7 @@ declare const getTypeUnits: () => PureUnit[], getUnitName: (unit: Unit) => strin
30
30
  type: "user-button" | "icon-button";
31
31
  data: {
32
32
  id: string;
33
- typeId: string;
33
+ typeId: import("@fibery/schema").TypeId;
34
34
  };
35
35
  label: string;
36
36
  hideWhenEmpty?: boolean;
@@ -23,7 +23,7 @@ declare const makeUnitDefinitionsFactory: (allUnitDefinitions: Record<string, An
23
23
  type: "user-button" | "icon-button";
24
24
  data: {
25
25
  id: string;
26
- typeId: string;
26
+ typeId: import("@fibery/schema").TypeId;
27
27
  };
28
28
  label: string;
29
29
  hideWhenEmpty?: boolean;
@@ -1,5 +1,5 @@
1
1
  import { NumberDisplaySettings } from "../field-utils/number.js";
2
- import { Schema, TypeObject } from "@fibery/schema";
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
5
  type ButtonUnit = {
@@ -7,7 +7,7 @@ type ButtonUnit = {
7
7
  type: "user-button" | "icon-button";
8
8
  data: {
9
9
  id: string;
10
- typeId: string;
10
+ typeId: TypeId;
11
11
  };
12
12
  label: string;
13
13
  checked?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fibery/views",
3
- "version": "23.0.0",
3
+ "version": "25.0.0",
4
4
  "description": "Operations on view objects",
5
5
  "license": "UNLICENSED",
6
6
  "author": "Fibery",
@@ -33,14 +33,14 @@
33
33
  "date-fns": "2.29.2",
34
34
  "lodash": "4.17.21",
35
35
  "moment": "2.29.4",
36
- "@fibery/expression-utils": "13.0.0",
37
- "@fibery/query-utils": "5.0.0",
38
- "@fibery/helpers": "3.3.1",
39
- "@fibery/schema": "11.2.0"
36
+ "@fibery/expression-utils": "15.0.0",
37
+ "@fibery/helpers": "4.0.0",
38
+ "@fibery/query-utils": "7.0.0",
39
+ "@fibery/schema": "12.0.0"
40
40
  },
41
41
  "peerDependencies": {
42
- "@fibery/expression-utils": "^13.0.0",
43
- "@fibery/schema": "^11.2.0",
42
+ "@fibery/expression-utils": "^15.0.0",
43
+ "@fibery/schema": "^12.0.0",
44
44
  "immutability-helper": "^2.4.0",
45
45
  "lodash": "4.17.21"
46
46
  }