@fibery/views 17.0.4 → 18.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.
Files changed (236) hide show
  1. package/lib/index.js +17 -0
  2. package/lib/jest.config.d.ts +2 -0
  3. package/lib/jest.config.js +33 -0
  4. package/lib/src/field-utils/avatar.d.ts +20 -0
  5. package/lib/src/field-utils/avatar.js +42 -0
  6. package/lib/src/field-utils/back-references.d.ts +15 -0
  7. package/lib/src/field-utils/back-references.js +21 -0
  8. package/lib/src/field-utils/comments.d.ts +60 -0
  9. package/lib/src/field-utils/comments.js +46 -0
  10. package/lib/src/field-utils/date-time.d.ts +14 -0
  11. package/lib/src/field-utils/date-time.js +56 -0
  12. package/lib/src/field-utils/enum-value.d.ts +13 -0
  13. package/lib/src/field-utils/enum-value.js +29 -0
  14. package/lib/src/field-utils/file.d.ts +4 -0
  15. package/lib/src/field-utils/file.js +18 -0
  16. package/lib/src/field-utils/icon.d.ts +10 -0
  17. package/lib/src/field-utils/icon.js +26 -0
  18. package/lib/src/field-utils/number.d.ts +31 -0
  19. package/lib/src/field-utils/number.js +91 -0
  20. package/lib/src/field-utils/reference-collection.d.ts +18 -0
  21. package/lib/src/field-utils/reference-collection.js +45 -0
  22. package/lib/src/field-utils/reference.d.ts +7 -0
  23. package/lib/src/field-utils/reference.js +57 -0
  24. package/lib/src/field-utils/relation-view.d.ts +2 -0
  25. package/lib/src/field-utils/relation-view.js +12 -0
  26. package/lib/src/field-utils/rich-text.d.ts +12 -0
  27. package/lib/src/field-utils/rich-text.js +27 -0
  28. package/lib/src/field-utils/text.d.ts +35 -0
  29. package/lib/src/field-utils/text.js +40 -0
  30. package/lib/src/field-utils/user-active.d.ts +8 -0
  31. package/lib/src/field-utils/user-active.js +28 -0
  32. package/lib/src/field-utils/user-role.d.ts +6 -0
  33. package/lib/src/field-utils/user-role.js +25 -0
  34. package/lib/src/field-utils/workflow.d.ts +15 -0
  35. package/lib/src/field-utils/workflow.js +56 -0
  36. package/lib/src/index.d.ts +16 -0
  37. package/lib/src/index.js +258 -0
  38. package/lib/src/private/board.d.ts +11 -0
  39. package/lib/src/private/board.js +326 -0
  40. package/lib/src/private/calendar.d.ts +10 -0
  41. package/lib/src/private/calendar.js +122 -0
  42. package/lib/src/private/feed.d.ts +10 -0
  43. package/lib/src/private/feed.js +119 -0
  44. package/lib/src/private/form.d.ts +3 -0
  45. package/lib/src/private/form.js +61 -0
  46. package/lib/src/private/map.d.ts +10 -0
  47. package/lib/src/private/map.js +119 -0
  48. package/lib/src/private/smart-folder.d.ts +23 -0
  49. package/lib/src/private/smart-folder.js +274 -0
  50. package/lib/src/private/test-data/garbage-test.d.ts +649 -0
  51. package/lib/src/private/test-data/garbage-test.js +520 -0
  52. package/lib/src/private/test-data/kanban.d.ts +1123 -0
  53. package/lib/src/private/test-data/kanban.js +1203 -0
  54. package/lib/src/private/test-data/tasks.d.ts +3216 -0
  55. package/lib/src/private/test-data/tasks.js +2731 -0
  56. package/lib/src/private/timeline.d.ts +10 -0
  57. package/lib/src/private/timeline.js +323 -0
  58. package/lib/src/private/units.d.ts +6 -0
  59. package/lib/src/private/units.js +144 -0
  60. package/lib/src/private/utils.d.ts +17 -0
  61. package/lib/src/private/utils.js +267 -0
  62. package/lib/src/tsfixme.d.ts +1 -0
  63. package/lib/src/tsfixme.js +2 -0
  64. package/lib/src/unit-definitions/avatar-collection.d.ts +2 -0
  65. package/lib/src/unit-definitions/avatar-collection.js +53 -0
  66. package/lib/src/unit-definitions/avatar-input.d.ts +2 -0
  67. package/lib/src/unit-definitions/avatar-input.js +12 -0
  68. package/lib/src/unit-definitions/avatar.d.ts +2 -0
  69. package/lib/src/unit-definitions/avatar.js +80 -0
  70. package/lib/src/unit-definitions/back-references-list.d.ts +2 -0
  71. package/lib/src/unit-definitions/back-references-list.js +38 -0
  72. package/lib/src/unit-definitions/bool-checkbox.d.ts +2 -0
  73. package/lib/src/unit-definitions/bool-checkbox.js +25 -0
  74. package/lib/src/unit-definitions/bool.d.ts +2 -0
  75. package/lib/src/unit-definitions/bool.js +22 -0
  76. package/lib/src/unit-definitions/collection-count.d.ts +2 -0
  77. package/lib/src/unit-definitions/collection-count.js +32 -0
  78. package/lib/src/unit-definitions/color-input.d.ts +2 -0
  79. package/lib/src/unit-definitions/color-input.js +21 -0
  80. package/lib/src/unit-definitions/comments-list.d.ts +2 -0
  81. package/lib/src/unit-definitions/comments-list.js +25 -0
  82. package/lib/src/unit-definitions/date-range-combobox.d.ts +2 -0
  83. package/lib/src/unit-definitions/date-range-combobox.js +22 -0
  84. package/lib/src/unit-definitions/date-range.d.ts +2 -0
  85. package/lib/src/unit-definitions/date-range.js +22 -0
  86. package/lib/src/unit-definitions/date-time-combobox.d.ts +2 -0
  87. package/lib/src/unit-definitions/date-time-combobox.js +22 -0
  88. package/lib/src/unit-definitions/date.d.ts +2 -0
  89. package/lib/src/unit-definitions/date.js +22 -0
  90. package/lib/src/unit-definitions/email-input.d.ts +2 -0
  91. package/lib/src/unit-definitions/email-input.js +12 -0
  92. package/lib/src/unit-definitions/email.d.ts +2 -0
  93. package/lib/src/unit-definitions/email.js +17 -0
  94. package/lib/src/unit-definitions/emoji.d.ts +2 -0
  95. package/lib/src/unit-definitions/emoji.js +17 -0
  96. package/lib/src/unit-definitions/file-collection-count.d.ts +2 -0
  97. package/lib/src/unit-definitions/file-collection-count.js +30 -0
  98. package/lib/src/unit-definitions/file-compact-collection.d.ts +2 -0
  99. package/lib/src/unit-definitions/file-compact-collection.js +30 -0
  100. package/lib/src/unit-definitions/file-compact-reference.d.ts +2 -0
  101. package/lib/src/unit-definitions/file-compact-reference.js +36 -0
  102. package/lib/src/unit-definitions/file-reference.d.ts +2 -0
  103. package/lib/src/unit-definitions/file-reference.js +26 -0
  104. package/lib/src/unit-definitions/files-gallery.d.ts +2 -0
  105. package/lib/src/unit-definitions/files-gallery.js +30 -0
  106. package/lib/src/unit-definitions/files-l-list-item.d.ts +2 -0
  107. package/lib/src/unit-definitions/files-l-list-item.js +26 -0
  108. package/lib/src/unit-definitions/files-l-list.d.ts +2 -0
  109. package/lib/src/unit-definitions/files-l-list.js +30 -0
  110. package/lib/src/unit-definitions/files-list-item.d.ts +2 -0
  111. package/lib/src/unit-definitions/files-list-item.js +26 -0
  112. package/lib/src/unit-definitions/files-list.d.ts +2 -0
  113. package/lib/src/unit-definitions/files-list.js +30 -0
  114. package/lib/src/unit-definitions/geometry-preview.d.ts +2 -0
  115. package/lib/src/unit-definitions/geometry-preview.js +17 -0
  116. package/lib/src/unit-definitions/icon-button.d.ts +2 -0
  117. package/lib/src/unit-definitions/icon-button.js +29 -0
  118. package/lib/src/unit-definitions/icon-input.d.ts +2 -0
  119. package/lib/src/unit-definitions/icon-input.js +12 -0
  120. package/lib/src/unit-definitions/id.d.ts +2 -0
  121. package/lib/src/unit-definitions/id.js +29 -0
  122. package/lib/src/unit-definitions/index.d.ts +27 -0
  123. package/lib/src/unit-definitions/index.js +57 -0
  124. package/lib/src/unit-definitions/json-input.d.ts +2 -0
  125. package/lib/src/unit-definitions/json-input.js +21 -0
  126. package/lib/src/unit-definitions/location-input.d.ts +2 -0
  127. package/lib/src/unit-definitions/location-input.js +18 -0
  128. package/lib/src/unit-definitions/location.d.ts +2 -0
  129. package/lib/src/unit-definitions/location.js +17 -0
  130. package/lib/src/unit-definitions/not-found.d.ts +2 -0
  131. package/lib/src/unit-definitions/not-found.js +24 -0
  132. package/lib/src/unit-definitions/number-input.d.ts +2 -0
  133. package/lib/src/unit-definitions/number-input.js +22 -0
  134. package/lib/src/unit-definitions/number.d.ts +2 -0
  135. package/lib/src/unit-definitions/number.js +27 -0
  136. package/lib/src/unit-definitions/phone-input.d.ts +2 -0
  137. package/lib/src/unit-definitions/phone-input.js +12 -0
  138. package/lib/src/unit-definitions/phone.d.ts +2 -0
  139. package/lib/src/unit-definitions/phone.js +12 -0
  140. package/lib/src/unit-definitions/progress-bar.d.ts +2 -0
  141. package/lib/src/unit-definitions/progress-bar.js +32 -0
  142. package/lib/src/unit-definitions/reference-collection-combobox.d.ts +2 -0
  143. package/lib/src/unit-definitions/reference-collection-combobox.js +21 -0
  144. package/lib/src/unit-definitions/reference-collection-list.d.ts +2 -0
  145. package/lib/src/unit-definitions/reference-collection-list.js +22 -0
  146. package/lib/src/unit-definitions/reference-collection-view.d.ts +2 -0
  147. package/lib/src/unit-definitions/reference-collection-view.js +19 -0
  148. package/lib/src/unit-definitions/reference-collection.d.ts +2 -0
  149. package/lib/src/unit-definitions/reference-collection.js +27 -0
  150. package/lib/src/unit-definitions/reference-combobox.d.ts +2 -0
  151. package/lib/src/unit-definitions/reference-combobox.js +21 -0
  152. package/lib/src/unit-definitions/reference-icon.d.ts +2 -0
  153. package/lib/src/unit-definitions/reference-icon.js +12 -0
  154. package/lib/src/unit-definitions/reference.d.ts +2 -0
  155. package/lib/src/unit-definitions/reference.js +49 -0
  156. package/lib/src/unit-definitions/rich-text-document.d.ts +2 -0
  157. package/lib/src/unit-definitions/rich-text-document.js +22 -0
  158. package/lib/src/unit-definitions/rich-text-snippet.d.ts +2 -0
  159. package/lib/src/unit-definitions/rich-text-snippet.js +39 -0
  160. package/lib/src/unit-definitions/single-location-preview.d.ts +2 -0
  161. package/lib/src/unit-definitions/single-location-preview.js +17 -0
  162. package/lib/src/unit-definitions/text-input.d.ts +2 -0
  163. package/lib/src/unit-definitions/text-input.js +22 -0
  164. package/lib/src/unit-definitions/text.d.ts +2 -0
  165. package/lib/src/unit-definitions/text.js +22 -0
  166. package/lib/src/unit-definitions/title-input.d.ts +2 -0
  167. package/lib/src/unit-definitions/title-input.js +16 -0
  168. package/lib/src/unit-definitions/title.d.ts +2 -0
  169. package/lib/src/unit-definitions/title.js +34 -0
  170. package/lib/src/unit-definitions/type-badge-abbr.d.ts +2 -0
  171. package/lib/src/unit-definitions/type-badge-abbr.js +25 -0
  172. package/lib/src/unit-definitions/type-badge.d.ts +2 -0
  173. package/lib/src/unit-definitions/type-badge.js +25 -0
  174. package/lib/src/unit-definitions/type-icon.d.ts +2 -0
  175. package/lib/src/unit-definitions/type-icon.js +25 -0
  176. package/lib/src/unit-definitions/url-input.d.ts +2 -0
  177. package/lib/src/unit-definitions/url-input.js +12 -0
  178. package/lib/src/unit-definitions/url.d.ts +2 -0
  179. package/lib/src/unit-definitions/url.js +17 -0
  180. package/lib/src/unit-definitions/user-button.d.ts +2 -0
  181. package/lib/src/unit-definitions/user-button.js +23 -0
  182. package/lib/src/unit-definitions/user-role-input.d.ts +2 -0
  183. package/lib/src/unit-definitions/user-role-input.js +12 -0
  184. package/lib/src/unit-definitions/user-role.d.ts +2 -0
  185. package/lib/src/unit-definitions/user-role.js +29 -0
  186. package/lib/src/unit-utils/access.d.ts +9 -0
  187. package/lib/src/unit-utils/access.js +14 -0
  188. package/lib/src/unit-utils/can-edit-field.d.ts +6 -0
  189. package/lib/src/unit-utils/can-edit-field.js +8 -0
  190. package/lib/src/unit-utils/common.d.ts +14 -0
  191. package/lib/src/unit-utils/common.js +43 -0
  192. package/lib/src/unit-utils/decimal.d.ts +42 -0
  193. package/lib/src/unit-utils/decimal.js +414 -0
  194. package/lib/src/unit-utils/dynamic-keys.d.ts +7 -0
  195. package/lib/src/unit-utils/dynamic-keys.js +13 -0
  196. package/lib/src/unit-utils/enums.d.ts +27 -0
  197. package/lib/src/unit-utils/enums.js +69 -0
  198. package/lib/src/unit-utils/formatters.d.ts +50 -0
  199. package/lib/src/unit-utils/formatters.js +163 -0
  200. package/lib/src/unit-utils/get-export-value.d.ts +45 -0
  201. package/lib/src/unit-utils/get-export-value.js +83 -0
  202. package/lib/src/unit-utils/get-field-label.d.ts +6 -0
  203. package/lib/src/unit-utils/get-field-label.js +10 -0
  204. package/lib/src/unit-utils/get-unmatched-unit-label.d.ts +2 -0
  205. package/lib/src/unit-utils/get-unmatched-unit-label.js +9 -0
  206. package/lib/src/unit-utils/schema.d.ts +4 -0
  207. package/lib/src/unit-utils/schema.js +12 -0
  208. package/lib/src/units/board.d.ts +43 -0
  209. package/lib/src/units/board.js +51 -0
  210. package/lib/src/units/canvas/all-units-data-definitions.d.ts +18 -0
  211. package/lib/src/units/canvas/all-units-data-definitions.js +40 -0
  212. package/lib/src/units/canvas/index.d.ts +42 -0
  213. package/lib/src/units/canvas/index.js +48 -0
  214. package/lib/src/units/canvas/type-badge-abbr.d.ts +36 -0
  215. package/lib/src/units/canvas/type-badge-abbr.js +11 -0
  216. package/lib/src/units/canvas/type-badge.d.ts +36 -0
  217. package/lib/src/units/canvas/type-badge.js +11 -0
  218. package/lib/src/units/default.d.ts +43 -0
  219. package/lib/src/units/default.js +51 -0
  220. package/lib/src/units/gallery.d.ts +3 -0
  221. package/lib/src/units/gallery.js +18 -0
  222. package/lib/src/units/gantt.d.ts +44 -0
  223. package/lib/src/units/gantt.js +59 -0
  224. package/lib/src/units/get-unit-definitions-for-view-type.d.ts +2 -0
  225. package/lib/src/units/get-unit-definitions-for-view-type.js +64 -0
  226. package/lib/src/units/grid.d.ts +42 -0
  227. package/lib/src/units/grid.js +67 -0
  228. package/lib/src/units/list.d.ts +43 -0
  229. package/lib/src/units/list.js +49 -0
  230. package/lib/src/units/make-factory.d.ts +50 -0
  231. package/lib/src/units/make-factory.js +245 -0
  232. package/lib/src/units/types.d.ts +73 -0
  233. package/lib/src/units/types.js +2 -0
  234. package/package.json +42 -52
  235. package/lib/views.js +0 -1813
  236. /package/{index.js → lib/index.d.ts} +0 -0
@@ -0,0 +1,36 @@
1
+ import { TypeObject } from "@fibery/schema";
2
+ export declare const TypeBadge: {
3
+ getQuerySelect({ typeObject }: {
4
+ typeObject: TypeObject;
5
+ }): import("@fibery/expression-utils").Select;
6
+ type: string;
7
+ name: string;
8
+ canEdit: (params: {
9
+ typeObject: TypeObject;
10
+ unit: import("../types").DbUnit;
11
+ }) => boolean;
12
+ makeUnit: (params?: {
13
+ expression: import("../types").UnitExpression;
14
+ }) => import("../types").PureUnit;
15
+ getLabel: (params: {
16
+ typeObject: TypeObject;
17
+ unit: import("../types").DbUnit;
18
+ }) => string;
19
+ calculateErrors: (params: {
20
+ typeObject: TypeObject;
21
+ unit: import("../types").DbUnit;
22
+ }) => import("../../tsfixme").$TSFixMe[];
23
+ getExportValue: (params: {
24
+ typeObject: TypeObject;
25
+ unit: import("../types").DbUnit;
26
+ object: import("@fibery/expression-utils/src/types").FiberyObject;
27
+ displaySettings: import("../../field-utils/number").NumberDisplaySettings;
28
+ }) => unknown;
29
+ canExport: (params: {
30
+ unit: import("../types").DbUnit;
31
+ }) => boolean;
32
+ getExportLabel?: ((params: {
33
+ typeObject: TypeObject;
34
+ unit: import("../types").DbUnit;
35
+ }) => string) | undefined;
36
+ };
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TypeBadge = void 0;
4
+ const select_1 = require("@fibery/query-utils/src/select");
5
+ const type_badge_1 = require("../../unit-definitions/type-badge");
6
+ exports.TypeBadge = {
7
+ ...type_badge_1.TypeBadge,
8
+ getQuerySelect({ typeObject }) {
9
+ return typeObject.name === "fibery/view" ? (0, select_1.toSelectMapClause)(["fibery/type"]) : {};
10
+ },
11
+ };
@@ -0,0 +1,43 @@
1
+ import { TypeObject } from "@fibery/schema";
2
+ export declare const getTypeUnits: () => import("./types").PureUnit[], getUnitName: (unit: import("./types").Unit) => string | null, getUnitsForType: (typeObject: TypeObject, options?: {
3
+ showHiddenFields?: boolean;
4
+ isSharingMode?: boolean;
5
+ }) => {
6
+ unit: import("./types").Unit;
7
+ fieldObject: import("@fibery/schema").FieldObject;
8
+ }[], getUnitsForField: (fieldObject: import("@fibery/schema").FieldObject, options?: {
9
+ showHiddenFields?: boolean;
10
+ isSharingMode?: boolean;
11
+ }) => import("./types").Unit[], getUnitsForTypePerField: (typeObject: TypeObject, options?: {
12
+ showHiddenFields?: boolean;
13
+ isSharingMode?: boolean;
14
+ }) => {
15
+ fieldObject: import("@fibery/schema").FieldObject;
16
+ units: import("./types").Unit[];
17
+ }[], getCardUnitsSelect: ({ schema, typeObject, units }: {
18
+ schema: import("@fibery/schema").Schema;
19
+ typeObject: TypeObject;
20
+ units: import("./types").Unit[];
21
+ }) => any, getUnitLabel: (fieldObject: import("@fibery/schema").FieldObject, unit: import("./types").Unit) => string, getHardcodedUnitsForView: (typeObject: TypeObject) => ({
22
+ expression: import("./types").UnitExpression;
23
+ type: "avatar" | "avatar-collection" | "avatar-input" | "back-references-list" | "bool" | "bool-checkbox" | "collection-count" | "color-input" | "comments-list" | "date" | "date-time" | "date-time-combobox" | "date-range" | "date-range-combobox" | "email" | "email-input" | "emoji" | "field" | "files-gallery" | "files-list" | "files-list-item" | "files-l-list" | "files-l-list-item" | "file-reference" | "file-compact-collection" | "file-compact-reference" | "file-collection-count" | "geometry-preview" | "icon-button" | "icon-input" | "id" | "json-input" | "location" | "location-input" | "number" | "number-input" | "phone" | "phone-input" | "progress-bar" | "reference" | "reference-icon" | "reference-combobox" | "reference-collection" | "reference-collection-list" | "reference-collection-view" | "reference-collection-combobox" | "rich-text-snippet" | "rich-text-document" | "single-location-preview" | "text" | "text-input" | "title" | "title-input" | "url" | "url-input" | "user-role" | "user-role-input";
24
+ kind: "field";
25
+ settings?: Record<string, unknown> | undefined;
26
+ hideWhenEmpty?: boolean | undefined;
27
+ } | {
28
+ type: "user-button" | "icon-button";
29
+ kind: "user-button";
30
+ hideWhenEmpty?: boolean | undefined;
31
+ data: {
32
+ id: string;
33
+ typeId: string;
34
+ };
35
+ label: string;
36
+ icon?: string | undefined;
37
+ } | {
38
+ expression?: import("./types").UnitExpression | undefined;
39
+ type: "type-icon" | "type-badge" | "type-badge-abbr";
40
+ kind: "db";
41
+ hideWhenEmpty?: boolean | undefined;
42
+ })[];
43
+ export declare const getDefaultUnits: (typeObject: TypeObject) => import("./types").PureUnit[];
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var _a;
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ exports.getDefaultUnits = exports.getHardcodedUnitsForView = exports.getUnitLabel = exports.getCardUnitsSelect = exports.getUnitsForTypePerField = exports.getUnitsForField = exports.getUnitsForType = exports.getUnitName = exports.getTypeUnits = void 0;
38
+ const avatar_1 = require("../field-utils/avatar");
39
+ const make_factory_1 = require("./make-factory");
40
+ const allUnitDefinitions = __importStar(require("../unit-definitions"));
41
+ _a = (0, make_factory_1.makeUnitDefinitionsFactory)(allUnitDefinitions), exports.getTypeUnits = _a.getTypeUnits, exports.getUnitName = _a.getUnitName, exports.getUnitsForType = _a.getUnitsForType, exports.getUnitsForField = _a.getUnitsForField, exports.getUnitsForTypePerField = _a.getUnitsForTypePerField, exports.getCardUnitsSelect = _a.getCardUnitsSelect, exports.getUnitLabel = _a.getUnitLabel, exports.getHardcodedUnitsForView = _a.getHardcodedUnitsForView;
42
+ const getDefaultUnits = (typeObject) => {
43
+ const { Title, Avatar, TypeBadgeAbbr } = allUnitDefinitions;
44
+ return [
45
+ Title && Title.makeUnit(),
46
+ typeObject && (0, avatar_1.isAvatarExtensionEnabledType)(typeObject)
47
+ ? Avatar && Avatar.makeUnit()
48
+ : TypeBadgeAbbr && TypeBadgeAbbr.makeUnit(),
49
+ ].filter(Boolean);
50
+ };
51
+ exports.getDefaultUnits = getDefaultUnits;
@@ -0,0 +1,3 @@
1
+ import { TypeObject } from "@fibery/schema";
2
+ export { getCardUnitsSelect, getHardcodedUnitsForView, getTypeUnits, getUnitDataDefinition, getUnitLabel, getUnitName, getUnitsForField, getUnitsForType, getUnitsForTypePerField, } from "./board";
3
+ export declare const getDefaultUnits: (_typeObject: TypeObject) => import("./types").PureUnit[];
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getDefaultUnits = exports.getUnitsForTypePerField = exports.getUnitsForType = exports.getUnitsForField = exports.getUnitName = exports.getUnitLabel = exports.getUnitDataDefinition = exports.getTypeUnits = exports.getHardcodedUnitsForView = exports.getCardUnitsSelect = void 0;
4
+ const title_1 = require("../unit-definitions/title");
5
+ var board_1 = require("./board");
6
+ Object.defineProperty(exports, "getCardUnitsSelect", { enumerable: true, get: function () { return board_1.getCardUnitsSelect; } });
7
+ Object.defineProperty(exports, "getHardcodedUnitsForView", { enumerable: true, get: function () { return board_1.getHardcodedUnitsForView; } });
8
+ Object.defineProperty(exports, "getTypeUnits", { enumerable: true, get: function () { return board_1.getTypeUnits; } });
9
+ Object.defineProperty(exports, "getUnitDataDefinition", { enumerable: true, get: function () { return board_1.getUnitDataDefinition; } });
10
+ Object.defineProperty(exports, "getUnitLabel", { enumerable: true, get: function () { return board_1.getUnitLabel; } });
11
+ Object.defineProperty(exports, "getUnitName", { enumerable: true, get: function () { return board_1.getUnitName; } });
12
+ Object.defineProperty(exports, "getUnitsForField", { enumerable: true, get: function () { return board_1.getUnitsForField; } });
13
+ Object.defineProperty(exports, "getUnitsForType", { enumerable: true, get: function () { return board_1.getUnitsForType; } });
14
+ Object.defineProperty(exports, "getUnitsForTypePerField", { enumerable: true, get: function () { return board_1.getUnitsForTypePerField; } });
15
+ const getDefaultUnits = (_typeObject) => {
16
+ return [title_1.Title.makeUnit()];
17
+ };
18
+ exports.getDefaultUnits = getDefaultUnits;
@@ -0,0 +1,44 @@
1
+ import { TypeObject } from "@fibery/schema";
2
+ export declare const getTypeUnits: () => import("./types").PureUnit[], getUnitName: (unit: import("./types").Unit) => string | null, getUnitsForType: (typeObject: TypeObject, options?: {
3
+ showHiddenFields?: boolean;
4
+ isSharingMode?: boolean;
5
+ }) => {
6
+ unit: import("./types").Unit;
7
+ fieldObject: import("@fibery/schema").FieldObject;
8
+ }[], getUnitsForField: (fieldObject: import("@fibery/schema").FieldObject, options?: {
9
+ showHiddenFields?: boolean;
10
+ isSharingMode?: boolean;
11
+ }) => import("./types").Unit[], getUnitsForTypePerField: (typeObject: TypeObject, options?: {
12
+ showHiddenFields?: boolean;
13
+ isSharingMode?: boolean;
14
+ }) => {
15
+ fieldObject: import("@fibery/schema").FieldObject;
16
+ units: import("./types").Unit[];
17
+ }[], getCardUnitsSelect: ({ schema, typeObject, units }: {
18
+ schema: import("@fibery/schema").Schema;
19
+ typeObject: TypeObject;
20
+ units: import("./types").Unit[];
21
+ }) => any, getUnitLabel: (fieldObject: import("@fibery/schema").FieldObject, unit: import("./types").Unit) => string, getHardcodedUnitsForView: (typeObject: TypeObject) => ({
22
+ expression: import("./types").UnitExpression;
23
+ type: "avatar" | "avatar-collection" | "avatar-input" | "back-references-list" | "bool" | "bool-checkbox" | "collection-count" | "color-input" | "comments-list" | "date" | "date-time" | "date-time-combobox" | "date-range" | "date-range-combobox" | "email" | "email-input" | "emoji" | "field" | "files-gallery" | "files-list" | "files-list-item" | "files-l-list" | "files-l-list-item" | "file-reference" | "file-compact-collection" | "file-compact-reference" | "file-collection-count" | "geometry-preview" | "icon-button" | "icon-input" | "id" | "json-input" | "location" | "location-input" | "number" | "number-input" | "phone" | "phone-input" | "progress-bar" | "reference" | "reference-icon" | "reference-combobox" | "reference-collection" | "reference-collection-list" | "reference-collection-view" | "reference-collection-combobox" | "rich-text-snippet" | "rich-text-document" | "single-location-preview" | "text" | "text-input" | "title" | "title-input" | "url" | "url-input" | "user-role" | "user-role-input";
24
+ kind: "field";
25
+ settings?: Record<string, unknown> | undefined;
26
+ hideWhenEmpty?: boolean | undefined;
27
+ } | {
28
+ type: "user-button" | "icon-button";
29
+ kind: "user-button";
30
+ hideWhenEmpty?: boolean | undefined;
31
+ data: {
32
+ id: string;
33
+ typeId: string;
34
+ };
35
+ label: string;
36
+ icon?: string | undefined;
37
+ } | {
38
+ expression?: import("./types").UnitExpression | undefined;
39
+ type: "type-icon" | "type-badge" | "type-badge-abbr";
40
+ kind: "db";
41
+ hideWhenEmpty?: boolean | undefined;
42
+ })[];
43
+ export declare const getDefaultUnits: () => import("./types").PureUnit[];
44
+ export declare const getDefaultLaneUnits: (typeObject: TypeObject) => import("./types").PureUnit[];
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var _a;
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ exports.getDefaultLaneUnits = exports.getDefaultUnits = exports.getHardcodedUnitsForView = exports.getUnitLabel = exports.getCardUnitsSelect = exports.getUnitsForTypePerField = exports.getUnitsForField = exports.getUnitsForType = exports.getUnitName = exports.getTypeUnits = void 0;
38
+ const avatar_1 = require("../field-utils/avatar");
39
+ const make_factory_1 = require("./make-factory");
40
+ const allUnitDefinitions = __importStar(require("../unit-definitions"));
41
+ _a = (0, make_factory_1.makeUnitDefinitionsFactory)(allUnitDefinitions), exports.getTypeUnits = _a.getTypeUnits, exports.getUnitName = _a.getUnitName, exports.getUnitsForType = _a.getUnitsForType, exports.getUnitsForField = _a.getUnitsForField, exports.getUnitsForTypePerField = _a.getUnitsForTypePerField, exports.getCardUnitsSelect = _a.getCardUnitsSelect, exports.getUnitLabel = _a.getUnitLabel, exports.getHardcodedUnitsForView = _a.getHardcodedUnitsForView;
42
+ const getDefaultUnits = () => {
43
+ const { Title } = allUnitDefinitions;
44
+ return [Title && Title.makeUnit()].filter(Boolean);
45
+ };
46
+ exports.getDefaultUnits = getDefaultUnits;
47
+ const getDefaultLaneUnits = (typeObject) => {
48
+ const { Title, Avatar, Emoji, TypeBadgeAbbr } = allUnitDefinitions;
49
+ return [
50
+ Title && Title.makeUnit(),
51
+ (typeObject && (0, avatar_1.isAvatarExtensionEnabledType)(typeObject) && Avatar && Avatar.makeUnit()) ||
52
+ (typeObject.isEnum &&
53
+ Object.hasOwn(typeObject.fieldObjectsByName, "enum/icon") &&
54
+ Emoji &&
55
+ Emoji.makeUnit({ expression: ["enum/icon"] })) ||
56
+ (TypeBadgeAbbr && TypeBadgeAbbr.makeUnit()),
57
+ ].filter(Boolean);
58
+ };
59
+ exports.getDefaultLaneUnits = getDefaultLaneUnits;
@@ -0,0 +1,2 @@
1
+ import * as listDefinitions from "./list";
2
+ export declare const getUnitDefinitionsForViewType: (viewType: string) => typeof listDefinitions;
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.getUnitDefinitionsForViewType = void 0;
37
+ const defaultDefinitions = __importStar(require("./default"));
38
+ const boardDefinitions = __importStar(require("./board"));
39
+ const canvasDefinitions = __importStar(require("./canvas"));
40
+ const listDefinitions = __importStar(require("./list"));
41
+ const gridDefinitions = __importStar(require("./grid"));
42
+ const ganttDefinitions = __importStar(require("./gantt"));
43
+ const galleryDefinitions = __importStar(require("./gallery"));
44
+ const getUnitDefinitionsForViewType = (viewType) => {
45
+ switch (viewType) {
46
+ case "board":
47
+ return boardDefinitions;
48
+ case "gallery":
49
+ return galleryDefinitions;
50
+ case "table":
51
+ return gridDefinitions;
52
+ case "canvas":
53
+ return canvasDefinitions;
54
+ case "grid":
55
+ return gridDefinitions;
56
+ case "list":
57
+ return listDefinitions;
58
+ case "gantt":
59
+ return ganttDefinitions;
60
+ default:
61
+ return defaultDefinitions;
62
+ }
63
+ };
64
+ exports.getUnitDefinitionsForViewType = getUnitDefinitionsForViewType;
@@ -0,0 +1,42 @@
1
+ export declare const getTypeUnits: () => import("./types").PureUnit[], getUnitName: (unit: import("./types").Unit) => string | null, getUnitsForType: (typeObject: import("@fibery/schema").TypeObject, options?: {
2
+ showHiddenFields?: boolean;
3
+ isSharingMode?: boolean;
4
+ }) => {
5
+ unit: import("./types").Unit;
6
+ fieldObject: import("@fibery/schema").FieldObject;
7
+ }[], getUnitsForField: (fieldObject: import("@fibery/schema").FieldObject, options?: {
8
+ showHiddenFields?: boolean;
9
+ isSharingMode?: boolean;
10
+ }) => import("./types").Unit[], getUnitsForTypePerField: (typeObject: import("@fibery/schema").TypeObject, options?: {
11
+ showHiddenFields?: boolean;
12
+ isSharingMode?: boolean;
13
+ }) => {
14
+ fieldObject: import("@fibery/schema").FieldObject;
15
+ units: import("./types").Unit[];
16
+ }[], getUnitLabel: (fieldObject: import("@fibery/schema").FieldObject, unit: import("./types").Unit) => string, getCardUnitsSelect: ({ schema, typeObject, units }: {
17
+ schema: import("@fibery/schema").Schema;
18
+ typeObject: import("@fibery/schema").TypeObject;
19
+ units: import("./types").Unit[];
20
+ }) => any, getHardcodedUnitsForView: (typeObject: import("@fibery/schema").TypeObject) => ({
21
+ expression: import("./types").UnitExpression;
22
+ type: "avatar" | "avatar-collection" | "avatar-input" | "back-references-list" | "bool" | "bool-checkbox" | "collection-count" | "color-input" | "comments-list" | "date" | "date-time" | "date-time-combobox" | "date-range" | "date-range-combobox" | "email" | "email-input" | "emoji" | "field" | "files-gallery" | "files-list" | "files-list-item" | "files-l-list" | "files-l-list-item" | "file-reference" | "file-compact-collection" | "file-compact-reference" | "file-collection-count" | "geometry-preview" | "icon-button" | "icon-input" | "id" | "json-input" | "location" | "location-input" | "number" | "number-input" | "phone" | "phone-input" | "progress-bar" | "reference" | "reference-icon" | "reference-combobox" | "reference-collection" | "reference-collection-list" | "reference-collection-view" | "reference-collection-combobox" | "rich-text-snippet" | "rich-text-document" | "single-location-preview" | "text" | "text-input" | "title" | "title-input" | "url" | "url-input" | "user-role" | "user-role-input";
23
+ kind: "field";
24
+ settings?: Record<string, unknown> | undefined;
25
+ hideWhenEmpty?: boolean | undefined;
26
+ } | {
27
+ type: "user-button" | "icon-button";
28
+ kind: "user-button";
29
+ hideWhenEmpty?: boolean | undefined;
30
+ data: {
31
+ id: string;
32
+ typeId: string;
33
+ };
34
+ label: string;
35
+ icon?: string | undefined;
36
+ } | {
37
+ expression?: import("./types").UnitExpression | undefined;
38
+ type: "type-icon" | "type-badge" | "type-badge-abbr";
39
+ kind: "db";
40
+ hideWhenEmpty?: boolean | undefined;
41
+ })[];
42
+ export declare const getDefaultUnits: () => import("./types").PureUnit[];
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ var _a;
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.getDefaultUnits = exports.getHardcodedUnitsForView = exports.getCardUnitsSelect = exports.getUnitLabel = exports.getUnitsForTypePerField = exports.getUnitsForField = exports.getUnitsForType = exports.getUnitName = exports.getTypeUnits = void 0;
5
+ const make_factory_1 = require("./make-factory");
6
+ const avatar_collection_1 = require("../unit-definitions/avatar-collection");
7
+ const avatar_1 = require("../unit-definitions/avatar");
8
+ const bool_1 = require("../unit-definitions/bool");
9
+ const collection_count_1 = require("../unit-definitions/collection-count");
10
+ const date_1 = require("../unit-definitions/date");
11
+ const date_range_1 = require("../unit-definitions/date-range");
12
+ const email_1 = require("../unit-definitions/email");
13
+ const emoji_1 = require("../unit-definitions/emoji");
14
+ const icon_button_1 = require("../unit-definitions/icon-button");
15
+ const id_1 = require("../unit-definitions/id");
16
+ const location_1 = require("../unit-definitions/location");
17
+ const number_1 = require("../unit-definitions/number");
18
+ const phone_1 = require("../unit-definitions/phone");
19
+ const progress_bar_1 = require("../unit-definitions/progress-bar");
20
+ const reference_collection_1 = require("../unit-definitions/reference-collection");
21
+ const reference_1 = require("../unit-definitions/reference");
22
+ const reference_icon_1 = require("../unit-definitions/reference-icon");
23
+ const rich_text_snippet_1 = require("../unit-definitions/rich-text-snippet");
24
+ const text_1 = require("../unit-definitions/text");
25
+ const title_1 = require("../unit-definitions/title");
26
+ const type_badge_abbr_1 = require("../unit-definitions/type-badge-abbr");
27
+ const type_badge_1 = require("../unit-definitions/type-badge");
28
+ const type_icon_1 = require("../unit-definitions/type-icon");
29
+ const url_1 = require("../unit-definitions/url");
30
+ const user_button_1 = require("../unit-definitions/user-button");
31
+ const user_role_1 = require("../unit-definitions/user-role");
32
+ const file_collection_count_1 = require("../unit-definitions/file-collection-count");
33
+ const allUnitDefinitions = {
34
+ AvatarCollection: avatar_collection_1.AvatarCollection,
35
+ Bool: bool_1.Bool,
36
+ Date: date_1.Date,
37
+ DateRange: date_range_1.DateRange,
38
+ Email: email_1.Email,
39
+ Id: id_1.Id,
40
+ Number: number_1.Number,
41
+ ProgressBar: progress_bar_1.ProgressBar,
42
+ Phone: phone_1.Phone,
43
+ Reference: reference_1.Reference,
44
+ ReferenceIcon: reference_icon_1.ReferenceIcon,
45
+ ReferenceCollection: reference_collection_1.ReferenceCollection,
46
+ Text: text_1.Text,
47
+ Title: title_1.Title,
48
+ Emoji: emoji_1.Emoji,
49
+ Url: url_1.Url,
50
+ Location: location_1.Location,
51
+ UserButton: user_button_1.UserButton,
52
+ Avatar: avatar_1.Avatar,
53
+ CollectionCount: collection_count_1.CollectionCount,
54
+ TypeBadge: type_badge_1.TypeBadge,
55
+ TypeBadgeAbbr: type_badge_abbr_1.TypeBadgeAbbr,
56
+ TypeIcon: type_icon_1.TypeIcon,
57
+ RichTextSnippet: rich_text_snippet_1.RichTextSnippet,
58
+ IconButton: icon_button_1.IconButton,
59
+ UserRole: user_role_1.UserRole,
60
+ FileCollectionCount: file_collection_count_1.FileCollectionCount,
61
+ };
62
+ _a = (0, make_factory_1.makeUnitDefinitionsFactory)(allUnitDefinitions), exports.getTypeUnits = _a.getTypeUnits, exports.getUnitName = _a.getUnitName, exports.getUnitsForType = _a.getUnitsForType, exports.getUnitsForField = _a.getUnitsForField, exports.getUnitsForTypePerField = _a.getUnitsForTypePerField, exports.getUnitLabel = _a.getUnitLabel, exports.getCardUnitsSelect = _a.getCardUnitsSelect, exports.getHardcodedUnitsForView = _a.getHardcodedUnitsForView;
63
+ const getDefaultUnits = () => {
64
+ const { Title } = allUnitDefinitions;
65
+ return [Title && Title.makeUnit()].filter(Boolean);
66
+ };
67
+ exports.getDefaultUnits = getDefaultUnits;
@@ -0,0 +1,43 @@
1
+ import { TypeObject } from "@fibery/schema";
2
+ export declare const getTypeUnits: () => import("./types").PureUnit[], getUnitName: (unit: import("./types").Unit) => string | null, getUnitsForType: (typeObject: TypeObject, options?: {
3
+ showHiddenFields?: boolean;
4
+ isSharingMode?: boolean;
5
+ }) => {
6
+ unit: import("./types").Unit;
7
+ fieldObject: import("@fibery/schema").FieldObject;
8
+ }[], getUnitsForField: (fieldObject: import("@fibery/schema").FieldObject, options?: {
9
+ showHiddenFields?: boolean;
10
+ isSharingMode?: boolean;
11
+ }) => import("./types").Unit[], getUnitsForTypePerField: (typeObject: TypeObject, options?: {
12
+ showHiddenFields?: boolean;
13
+ isSharingMode?: boolean;
14
+ }) => {
15
+ fieldObject: import("@fibery/schema").FieldObject;
16
+ units: import("./types").Unit[];
17
+ }[], getUnitLabel: (fieldObject: import("@fibery/schema").FieldObject, unit: import("./types").Unit) => string, getCardUnitsSelect: ({ schema, typeObject, units }: {
18
+ schema: import("@fibery/schema").Schema;
19
+ typeObject: TypeObject;
20
+ units: import("./types").Unit[];
21
+ }) => any, getHardcodedUnitsForView: (typeObject: TypeObject) => ({
22
+ expression: import("./types").UnitExpression;
23
+ type: "avatar" | "avatar-collection" | "avatar-input" | "back-references-list" | "bool" | "bool-checkbox" | "collection-count" | "color-input" | "comments-list" | "date" | "date-time" | "date-time-combobox" | "date-range" | "date-range-combobox" | "email" | "email-input" | "emoji" | "field" | "files-gallery" | "files-list" | "files-list-item" | "files-l-list" | "files-l-list-item" | "file-reference" | "file-compact-collection" | "file-compact-reference" | "file-collection-count" | "geometry-preview" | "icon-button" | "icon-input" | "id" | "json-input" | "location" | "location-input" | "number" | "number-input" | "phone" | "phone-input" | "progress-bar" | "reference" | "reference-icon" | "reference-combobox" | "reference-collection" | "reference-collection-list" | "reference-collection-view" | "reference-collection-combobox" | "rich-text-snippet" | "rich-text-document" | "single-location-preview" | "text" | "text-input" | "title" | "title-input" | "url" | "url-input" | "user-role" | "user-role-input";
24
+ kind: "field";
25
+ settings?: Record<string, unknown> | undefined;
26
+ hideWhenEmpty?: boolean | undefined;
27
+ } | {
28
+ type: "user-button" | "icon-button";
29
+ kind: "user-button";
30
+ hideWhenEmpty?: boolean | undefined;
31
+ data: {
32
+ id: string;
33
+ typeId: string;
34
+ };
35
+ label: string;
36
+ icon?: string | undefined;
37
+ } | {
38
+ expression?: import("./types").UnitExpression | undefined;
39
+ type: "type-icon" | "type-badge" | "type-badge-abbr";
40
+ kind: "db";
41
+ hideWhenEmpty?: boolean | undefined;
42
+ })[];
43
+ export declare const getDefaultUnits: (typeObject: TypeObject) => (false | import("./types").PureUnit)[];
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var _a;
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ exports.getDefaultUnits = exports.getHardcodedUnitsForView = exports.getCardUnitsSelect = exports.getUnitLabel = exports.getUnitsForTypePerField = exports.getUnitsForField = exports.getUnitsForType = exports.getUnitName = exports.getTypeUnits = void 0;
38
+ const avatar_1 = require("../field-utils/avatar");
39
+ const make_factory_1 = require("./make-factory");
40
+ const allUnitDefinitions = __importStar(require("../unit-definitions"));
41
+ _a = (0, make_factory_1.makeUnitDefinitionsFactory)(allUnitDefinitions), exports.getTypeUnits = _a.getTypeUnits, exports.getUnitName = _a.getUnitName, exports.getUnitsForType = _a.getUnitsForType, exports.getUnitsForField = _a.getUnitsForField, exports.getUnitsForTypePerField = _a.getUnitsForTypePerField, exports.getUnitLabel = _a.getUnitLabel, exports.getCardUnitsSelect = _a.getCardUnitsSelect, exports.getHardcodedUnitsForView = _a.getHardcodedUnitsForView;
42
+ const getDefaultUnits = (typeObject) => {
43
+ const { Title, Avatar } = allUnitDefinitions;
44
+ return [
45
+ Title && Title.makeUnit(),
46
+ typeObject && (0, avatar_1.isAvatarExtensionEnabledType)(typeObject) && Avatar && Avatar.makeUnit(),
47
+ ].filter(Boolean);
48
+ };
49
+ exports.getDefaultUnits = getDefaultUnits;
@@ -0,0 +1,50 @@
1
+ import { FieldObject, Schema, TypeObject } from "@fibery/schema";
2
+ import { ButtonUnit, DbUnit, FieldUnit, Unit, UnitDataDefinition } from "./types";
3
+ type AnyUnitDataDefinition = UnitDataDefinition<FieldUnit> | UnitDataDefinition<DbUnit> | UnitDataDefinition<ButtonUnit>;
4
+ type UnitFilterOptions = {
5
+ showHiddenFields?: boolean;
6
+ isSharingMode?: boolean;
7
+ };
8
+ export declare const makeUnitDefinitionsFactory: (allUnitDefinitions: Record<string, AnyUnitDataDefinition>) => {
9
+ getTypeUnits: () => import("./types").PureUnit[];
10
+ getUnitsForType: (typeObject: TypeObject, options?: UnitFilterOptions) => {
11
+ unit: Unit;
12
+ fieldObject: FieldObject;
13
+ }[];
14
+ getUnitsForTypePerField: (typeObject: TypeObject, options?: UnitFilterOptions) => {
15
+ fieldObject: FieldObject;
16
+ units: Unit[];
17
+ }[];
18
+ getUnitsForField: (fieldObject: FieldObject, options?: UnitFilterOptions) => Unit[];
19
+ getHardcodedUnitsForView: (typeObject: TypeObject) => ({
20
+ expression: import("./types").UnitExpression;
21
+ type: "avatar" | "avatar-collection" | "avatar-input" | "back-references-list" | "bool" | "bool-checkbox" | "collection-count" | "color-input" | "comments-list" | "date" | "date-time" | "date-time-combobox" | "date-range" | "date-range-combobox" | "email" | "email-input" | "emoji" | "field" | "files-gallery" | "files-list" | "files-list-item" | "files-l-list" | "files-l-list-item" | "file-reference" | "file-compact-collection" | "file-compact-reference" | "file-collection-count" | "geometry-preview" | "icon-button" | "icon-input" | "id" | "json-input" | "location" | "location-input" | "number" | "number-input" | "phone" | "phone-input" | "progress-bar" | "reference" | "reference-icon" | "reference-combobox" | "reference-collection" | "reference-collection-list" | "reference-collection-view" | "reference-collection-combobox" | "rich-text-snippet" | "rich-text-document" | "single-location-preview" | "text" | "text-input" | "title" | "title-input" | "url" | "url-input" | "user-role" | "user-role-input";
22
+ kind: "field";
23
+ settings?: Record<string, unknown> | undefined;
24
+ hideWhenEmpty?: boolean | undefined;
25
+ } | {
26
+ type: "user-button" | "icon-button";
27
+ kind: "user-button";
28
+ hideWhenEmpty?: boolean | undefined;
29
+ data: {
30
+ id: string;
31
+ typeId: string;
32
+ };
33
+ label: string;
34
+ icon?: string | undefined;
35
+ } | {
36
+ expression?: import("./types").UnitExpression | undefined;
37
+ type: "type-icon" | "type-badge" | "type-badge-abbr";
38
+ kind: "db";
39
+ hideWhenEmpty?: boolean | undefined;
40
+ })[];
41
+ getUnitLabel: (fieldObject: FieldObject, unit: Unit) => string;
42
+ getUnitName: (unit: Unit) => string | null;
43
+ getCardUnitsSelect: ({ schema, typeObject, units }: {
44
+ schema: Schema;
45
+ typeObject: TypeObject;
46
+ units: Unit[];
47
+ }) => any;
48
+ getUnitDataDefinition: (unit: Unit) => AnyUnitDataDefinition;
49
+ };
50
+ export {};