@fibery/views 19.1.1 → 20.0.1

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 (470) hide show
  1. package/lib/_virtual/_rolldown/runtime.js +13 -0
  2. package/lib/errors.d.ts +4 -0
  3. package/lib/errors.js +4 -0
  4. package/lib/field-utils/avatar.d.ts +23 -0
  5. package/lib/field-utils/avatar.js +35 -0
  6. package/lib/field-utils/back-references.d.ts +18 -0
  7. package/lib/field-utils/back-references.js +15 -0
  8. package/lib/field-utils/comments.d.ts +63 -0
  9. package/lib/field-utils/comments.js +41 -0
  10. package/lib/field-utils/date-time.d.ts +17 -0
  11. package/lib/field-utils/date-time.js +31 -0
  12. package/lib/field-utils/enum-value.d.ts +16 -0
  13. package/lib/field-utils/enum-value.js +26 -0
  14. package/lib/field-utils/file.d.ts +7 -0
  15. package/lib/field-utils/file.js +14 -0
  16. package/lib/field-utils/icon.d.ts +13 -0
  17. package/lib/field-utils/icon.js +17 -0
  18. package/lib/field-utils/number.d.ts +34 -0
  19. package/lib/field-utils/number.js +64 -0
  20. package/lib/field-utils/reference-collection.d.ts +16 -0
  21. package/lib/field-utils/reference-collection.js +49 -0
  22. package/lib/field-utils/reference.d.ts +10 -0
  23. package/lib/field-utils/reference.js +55 -0
  24. package/lib/field-utils/relation-view.d.ts +5 -0
  25. package/lib/field-utils/relation-view.js +7 -0
  26. package/lib/field-utils/rich-text.d.ts +16 -0
  27. package/lib/field-utils/rich-text.js +33 -0
  28. package/lib/field-utils/text.d.ts +38 -0
  29. package/lib/field-utils/text.js +37 -0
  30. package/lib/field-utils/user-active.d.ts +11 -0
  31. package/lib/field-utils/user-active.js +24 -0
  32. package/lib/field-utils/user-role.d.ts +9 -0
  33. package/lib/field-utils/user-role.js +23 -0
  34. package/lib/field-utils/workflow.d.ts +18 -0
  35. package/lib/field-utils/workflow.js +48 -0
  36. package/lib/index.d.ts +34 -1
  37. package/lib/index.js +169 -16
  38. package/lib/meta-validation.d.ts +13 -0
  39. package/lib/meta-validation.js +53 -0
  40. package/lib/private/board.d.ts +18 -0
  41. package/lib/private/board.js +234 -0
  42. package/lib/private/calendar.d.ts +17 -0
  43. package/lib/private/calendar.js +82 -0
  44. package/lib/private/feed.d.ts +17 -0
  45. package/lib/private/feed.js +81 -0
  46. package/lib/private/form.d.ts +27 -0
  47. package/lib/private/form.js +57 -0
  48. package/lib/private/map.d.ts +17 -0
  49. package/lib/private/map.js +81 -0
  50. package/lib/private/smart-folder.d.ts +33 -0
  51. package/lib/private/smart-folder.js +165 -0
  52. package/lib/private/timeline.d.ts +41 -0
  53. package/lib/private/timeline.js +223 -0
  54. package/lib/private/units.d.ts +12 -0
  55. package/lib/private/units.js +131 -0
  56. package/lib/private/utils.d.ts +66 -0
  57. package/lib/private/utils.js +179 -0
  58. package/lib/tsfixme.d.ts +4 -0
  59. package/lib/tsfixme.js +0 -0
  60. package/lib/unit-definitions/avatar-collection.d.ts +5 -0
  61. package/lib/unit-definitions/avatar-collection.js +59 -0
  62. package/lib/unit-definitions/avatar-input.d.ts +5 -0
  63. package/lib/unit-definitions/avatar-input.js +12 -0
  64. package/lib/unit-definitions/avatar.d.ts +5 -0
  65. package/lib/unit-definitions/avatar.js +95 -0
  66. package/lib/unit-definitions/back-references-list.d.ts +5 -0
  67. package/lib/unit-definitions/back-references-list.js +39 -0
  68. package/lib/unit-definitions/bool-checkbox.d.ts +5 -0
  69. package/lib/unit-definitions/bool-checkbox.js +25 -0
  70. package/lib/unit-definitions/bool.d.ts +5 -0
  71. package/lib/unit-definitions/bool.js +25 -0
  72. package/lib/unit-definitions/collection-count.d.ts +5 -0
  73. package/lib/unit-definitions/collection-count.js +35 -0
  74. package/lib/unit-definitions/color-input.d.ts +5 -0
  75. package/lib/unit-definitions/color-input.js +24 -0
  76. package/lib/unit-definitions/comments-list.d.ts +5 -0
  77. package/lib/unit-definitions/comments-list.js +27 -0
  78. package/lib/unit-definitions/date-range-combobox.d.ts +5 -0
  79. package/lib/unit-definitions/date-range-combobox.js +25 -0
  80. package/lib/unit-definitions/date-range.d.ts +5 -0
  81. package/lib/unit-definitions/date-range.js +25 -0
  82. package/lib/unit-definitions/date-time-combobox.d.ts +5 -0
  83. package/lib/unit-definitions/date-time-combobox.js +25 -0
  84. package/lib/unit-definitions/date.d.ts +5 -0
  85. package/lib/unit-definitions/date.js +25 -0
  86. package/lib/unit-definitions/email-input.d.ts +5 -0
  87. package/lib/unit-definitions/email-input.js +12 -0
  88. package/lib/unit-definitions/email.d.ts +5 -0
  89. package/lib/unit-definitions/email.js +17 -0
  90. package/lib/unit-definitions/emoji.d.ts +5 -0
  91. package/lib/unit-definitions/emoji.js +17 -0
  92. package/lib/unit-definitions/file-collection-count.d.ts +5 -0
  93. package/lib/unit-definitions/file-collection-count.js +34 -0
  94. package/lib/unit-definitions/file-compact-collection.d.ts +5 -0
  95. package/lib/unit-definitions/file-compact-collection.js +34 -0
  96. package/lib/unit-definitions/file-compact-reference.d.ts +5 -0
  97. package/lib/unit-definitions/file-compact-reference.js +47 -0
  98. package/lib/unit-definitions/file-reference.d.ts +5 -0
  99. package/lib/unit-definitions/file-reference.js +30 -0
  100. package/lib/unit-definitions/files-gallery.d.ts +5 -0
  101. package/lib/unit-definitions/files-gallery.js +34 -0
  102. package/lib/unit-definitions/files-l-list-item.d.ts +5 -0
  103. package/lib/unit-definitions/files-l-list-item.js +30 -0
  104. package/lib/unit-definitions/files-l-list.d.ts +5 -0
  105. package/lib/unit-definitions/files-l-list.js +34 -0
  106. package/lib/unit-definitions/files-list-item.d.ts +5 -0
  107. package/lib/unit-definitions/files-list-item.js +30 -0
  108. package/lib/unit-definitions/files-list.d.ts +5 -0
  109. package/lib/unit-definitions/files-list.js +34 -0
  110. package/lib/unit-definitions/geometry-preview.d.ts +5 -0
  111. package/lib/unit-definitions/geometry-preview.js +17 -0
  112. package/lib/unit-definitions/icon-button.d.ts +5 -0
  113. package/lib/unit-definitions/icon-button.js +41 -0
  114. package/lib/unit-definitions/icon-input.d.ts +5 -0
  115. package/lib/unit-definitions/icon-input.js +12 -0
  116. package/lib/unit-definitions/id.d.ts +5 -0
  117. package/lib/unit-definitions/id.js +30 -0
  118. package/lib/unit-definitions/index.d.ts +28 -0
  119. package/lib/unit-definitions/index.js +60 -0
  120. package/lib/unit-definitions/json-input.d.ts +5 -0
  121. package/lib/unit-definitions/json-input.js +24 -0
  122. package/lib/unit-definitions/location-input.d.ts +5 -0
  123. package/lib/unit-definitions/location-input.js +18 -0
  124. package/lib/unit-definitions/location.d.ts +5 -0
  125. package/lib/unit-definitions/location.js +17 -0
  126. package/lib/unit-definitions/not-found.d.ts +5 -0
  127. package/lib/unit-definitions/not-found.js +22 -0
  128. package/lib/unit-definitions/number-input.d.ts +5 -0
  129. package/lib/unit-definitions/number-input.js +25 -0
  130. package/lib/unit-definitions/number.d.ts +5 -0
  131. package/lib/unit-definitions/number.js +31 -0
  132. package/lib/unit-definitions/phone-input.d.ts +5 -0
  133. package/lib/unit-definitions/phone-input.js +12 -0
  134. package/lib/unit-definitions/phone.d.ts +5 -0
  135. package/lib/unit-definitions/phone.js +12 -0
  136. package/lib/unit-definitions/progress-bar.d.ts +5 -0
  137. package/lib/unit-definitions/progress-bar.js +32 -0
  138. package/lib/unit-definitions/reference-collection-combobox.d.ts +5 -0
  139. package/lib/unit-definitions/reference-collection-combobox.js +21 -0
  140. package/lib/unit-definitions/reference-collection-list.d.ts +5 -0
  141. package/lib/unit-definitions/reference-collection-list.js +21 -0
  142. package/lib/unit-definitions/reference-collection-view.d.ts +5 -0
  143. package/lib/unit-definitions/reference-collection-view.js +19 -0
  144. package/lib/unit-definitions/reference-collection.d.ts +5 -0
  145. package/lib/unit-definitions/reference-collection.js +30 -0
  146. package/lib/unit-definitions/reference-combobox.d.ts +5 -0
  147. package/lib/unit-definitions/reference-combobox.js +21 -0
  148. package/lib/unit-definitions/reference-icon.d.ts +5 -0
  149. package/lib/unit-definitions/reference-icon.js +12 -0
  150. package/lib/unit-definitions/reference.d.ts +5 -0
  151. package/lib/unit-definitions/reference.js +63 -0
  152. package/lib/unit-definitions/rich-text-document.d.ts +5 -0
  153. package/lib/unit-definitions/rich-text-document.js +26 -0
  154. package/lib/unit-definitions/rich-text-snippet.d.ts +6 -0
  155. package/lib/unit-definitions/rich-text-snippet.js +35 -0
  156. package/lib/unit-definitions/single-location-preview.d.ts +5 -0
  157. package/lib/unit-definitions/single-location-preview.js +17 -0
  158. package/lib/unit-definitions/text-input.d.ts +5 -0
  159. package/lib/unit-definitions/text-input.js +25 -0
  160. package/lib/unit-definitions/text.d.ts +5 -0
  161. package/lib/unit-definitions/text.js +25 -0
  162. package/lib/unit-definitions/title-input.d.ts +5 -0
  163. package/lib/unit-definitions/title-input.js +19 -0
  164. package/lib/unit-definitions/title.d.ts +5 -0
  165. package/lib/unit-definitions/title.js +33 -0
  166. package/lib/unit-definitions/type-badge-abbr.d.ts +5 -0
  167. package/lib/unit-definitions/type-badge-abbr.js +28 -0
  168. package/lib/unit-definitions/type-badge.d.ts +5 -0
  169. package/lib/unit-definitions/type-badge.js +28 -0
  170. package/lib/unit-definitions/type-icon.d.ts +5 -0
  171. package/lib/unit-definitions/type-icon.js +28 -0
  172. package/lib/unit-definitions/url-input.d.ts +5 -0
  173. package/lib/unit-definitions/url-input.js +12 -0
  174. package/lib/unit-definitions/url.d.ts +5 -0
  175. package/lib/unit-definitions/url.js +17 -0
  176. package/lib/unit-definitions/user-button.d.ts +5 -0
  177. package/lib/unit-definitions/user-button.js +26 -0
  178. package/lib/unit-definitions/user-role-input.d.ts +5 -0
  179. package/lib/unit-definitions/user-role-input.js +12 -0
  180. package/lib/unit-definitions/user-role.d.ts +5 -0
  181. package/lib/unit-definitions/user-role.js +35 -0
  182. package/lib/unit-utils/access.d.ts +12 -0
  183. package/lib/unit-utils/access.js +9 -0
  184. package/lib/unit-utils/can-edit-field.d.ts +9 -0
  185. package/lib/unit-utils/can-edit-field.js +7 -0
  186. package/lib/unit-utils/common.d.ts +17 -0
  187. package/lib/unit-utils/common.js +39 -0
  188. package/lib/unit-utils/decimal.d.ts +44 -0
  189. package/lib/unit-utils/decimal.js +248 -0
  190. package/lib/unit-utils/dynamic-keys.d.ts +10 -0
  191. package/lib/unit-utils/dynamic-keys.js +12 -0
  192. package/lib/unit-utils/enums.d.ts +30 -0
  193. package/lib/unit-utils/enums.js +48 -0
  194. package/lib/unit-utils/formatters.d.ts +53 -0
  195. package/lib/unit-utils/formatters.js +128 -0
  196. package/lib/unit-utils/get-export-value.d.ts +48 -0
  197. package/lib/unit-utils/get-export-value.js +83 -0
  198. package/lib/unit-utils/get-field-label.d.ts +9 -0
  199. package/lib/unit-utils/get-field-label.js +11 -0
  200. package/lib/unit-utils/get-unmatched-unit-label.d.ts +5 -0
  201. package/lib/unit-utils/get-unmatched-unit-label.js +5 -0
  202. package/lib/unit-utils/schema.d.ts +7 -0
  203. package/lib/unit-utils/schema.js +9 -0
  204. package/lib/unit-utils/wrap-normalized-in-expression.d.ts +6 -0
  205. package/lib/unit-utils/wrap-normalized-in-expression.js +15 -0
  206. package/lib/units/board.d.ts +50 -0
  207. package/lib/units/board.js +24 -0
  208. package/lib/units/canvas/all-units-data-definitions.d.ts +19 -0
  209. package/lib/units/canvas/all-units-data-definitions.js +42 -0
  210. package/lib/units/canvas/index.d.ts +49 -0
  211. package/lib/units/canvas/index.js +27 -0
  212. package/lib/units/canvas/type-badge-abbr.d.ts +42 -0
  213. package/lib/units/canvas/type-badge-abbr.js +11 -0
  214. package/lib/units/canvas/type-badge.d.ts +42 -0
  215. package/lib/units/canvas/type-badge.js +11 -0
  216. package/lib/units/default.d.ts +50 -0
  217. package/lib/units/default.js +23 -0
  218. package/lib/units/gallery.d.ts +7 -0
  219. package/lib/units/gallery.js +21 -0
  220. package/lib/units/gantt.d.ts +51 -0
  221. package/lib/units/gantt.js +28 -0
  222. package/lib/units/get-unit-definitions-for-view-type.d.ts +5 -0
  223. package/lib/units/get-unit-definitions-for-view-type.js +22 -0
  224. package/lib/units/grid.d.ts +49 -0
  225. package/lib/units/grid.js +81 -0
  226. package/lib/units/list.d.ts +52 -0
  227. package/lib/units/list.js +23 -0
  228. package/lib/units/make-factory.d.ts +53 -0
  229. package/lib/units/make-factory.js +272 -0
  230. package/lib/units/types.d.ts +75 -0
  231. package/lib/units/types.js +0 -0
  232. package/package.json +18 -40
  233. package/lib/src/errors.d.ts +0 -2
  234. package/lib/src/errors.js +0 -6
  235. package/lib/src/field-utils/avatar.d.ts +0 -20
  236. package/lib/src/field-utils/avatar.js +0 -42
  237. package/lib/src/field-utils/back-references.d.ts +0 -15
  238. package/lib/src/field-utils/back-references.js +0 -21
  239. package/lib/src/field-utils/comments.d.ts +0 -60
  240. package/lib/src/field-utils/comments.js +0 -46
  241. package/lib/src/field-utils/date-time.d.ts +0 -14
  242. package/lib/src/field-utils/date-time.js +0 -56
  243. package/lib/src/field-utils/enum-value.d.ts +0 -13
  244. package/lib/src/field-utils/enum-value.js +0 -29
  245. package/lib/src/field-utils/file.d.ts +0 -4
  246. package/lib/src/field-utils/file.js +0 -18
  247. package/lib/src/field-utils/icon.d.ts +0 -10
  248. package/lib/src/field-utils/icon.js +0 -26
  249. package/lib/src/field-utils/number.d.ts +0 -31
  250. package/lib/src/field-utils/number.js +0 -91
  251. package/lib/src/field-utils/reference-collection.d.ts +0 -13
  252. package/lib/src/field-utils/reference-collection.js +0 -67
  253. package/lib/src/field-utils/reference.d.ts +0 -7
  254. package/lib/src/field-utils/reference.js +0 -57
  255. package/lib/src/field-utils/relation-view.d.ts +0 -2
  256. package/lib/src/field-utils/relation-view.js +0 -12
  257. package/lib/src/field-utils/rich-text.d.ts +0 -13
  258. package/lib/src/field-utils/rich-text.js +0 -38
  259. package/lib/src/field-utils/text.d.ts +0 -35
  260. package/lib/src/field-utils/text.js +0 -40
  261. package/lib/src/field-utils/user-active.d.ts +0 -8
  262. package/lib/src/field-utils/user-active.js +0 -23
  263. package/lib/src/field-utils/user-role.d.ts +0 -6
  264. package/lib/src/field-utils/user-role.js +0 -25
  265. package/lib/src/field-utils/workflow.d.ts +0 -15
  266. package/lib/src/field-utils/workflow.js +0 -53
  267. package/lib/src/index.d.ts +0 -30
  268. package/lib/src/index.js +0 -263
  269. package/lib/src/meta-validation.d.ts +0 -10
  270. package/lib/src/meta-validation.js +0 -78
  271. package/lib/src/private/board.d.ts +0 -15
  272. package/lib/src/private/board.js +0 -327
  273. package/lib/src/private/calendar.d.ts +0 -14
  274. package/lib/src/private/calendar.js +0 -123
  275. package/lib/src/private/feed.d.ts +0 -14
  276. package/lib/src/private/feed.js +0 -120
  277. package/lib/src/private/form.d.ts +0 -25
  278. package/lib/src/private/form.js +0 -61
  279. package/lib/src/private/map.d.ts +0 -14
  280. package/lib/src/private/map.js +0 -120
  281. package/lib/src/private/smart-folder.d.ts +0 -31
  282. package/lib/src/private/smart-folder.js +0 -277
  283. package/lib/src/private/test-data/garbage-test.d.ts +0 -649
  284. package/lib/src/private/test-data/garbage-test.js +0 -520
  285. package/lib/src/private/test-data/kanban.d.ts +0 -1123
  286. package/lib/src/private/test-data/kanban.js +0 -1203
  287. package/lib/src/private/test-data/tasks.d.ts +0 -3216
  288. package/lib/src/private/test-data/tasks.js +0 -2731
  289. package/lib/src/private/timeline.d.ts +0 -39
  290. package/lib/src/private/timeline.js +0 -325
  291. package/lib/src/private/units.d.ts +0 -10
  292. package/lib/src/private/units.js +0 -165
  293. package/lib/src/private/utils.d.ts +0 -64
  294. package/lib/src/private/utils.js +0 -273
  295. package/lib/src/truthy.d.ts +0 -1
  296. package/lib/src/truthy.js +0 -7
  297. package/lib/src/tsfixme.d.ts +0 -1
  298. package/lib/src/tsfixme.js +0 -2
  299. package/lib/src/unit-definitions/avatar-collection.d.ts +0 -2
  300. package/lib/src/unit-definitions/avatar-collection.js +0 -54
  301. package/lib/src/unit-definitions/avatar-input.d.ts +0 -2
  302. package/lib/src/unit-definitions/avatar-input.js +0 -12
  303. package/lib/src/unit-definitions/avatar.d.ts +0 -2
  304. package/lib/src/unit-definitions/avatar.js +0 -88
  305. package/lib/src/unit-definitions/back-references-list.d.ts +0 -2
  306. package/lib/src/unit-definitions/back-references-list.js +0 -38
  307. package/lib/src/unit-definitions/bool-checkbox.d.ts +0 -2
  308. package/lib/src/unit-definitions/bool-checkbox.js +0 -25
  309. package/lib/src/unit-definitions/bool.d.ts +0 -2
  310. package/lib/src/unit-definitions/bool.js +0 -22
  311. package/lib/src/unit-definitions/collection-count.d.ts +0 -2
  312. package/lib/src/unit-definitions/collection-count.js +0 -32
  313. package/lib/src/unit-definitions/color-input.d.ts +0 -2
  314. package/lib/src/unit-definitions/color-input.js +0 -21
  315. package/lib/src/unit-definitions/comments-list.d.ts +0 -2
  316. package/lib/src/unit-definitions/comments-list.js +0 -25
  317. package/lib/src/unit-definitions/date-range-combobox.d.ts +0 -2
  318. package/lib/src/unit-definitions/date-range-combobox.js +0 -22
  319. package/lib/src/unit-definitions/date-range.d.ts +0 -2
  320. package/lib/src/unit-definitions/date-range.js +0 -22
  321. package/lib/src/unit-definitions/date-time-combobox.d.ts +0 -2
  322. package/lib/src/unit-definitions/date-time-combobox.js +0 -22
  323. package/lib/src/unit-definitions/date.d.ts +0 -2
  324. package/lib/src/unit-definitions/date.js +0 -22
  325. package/lib/src/unit-definitions/email-input.d.ts +0 -2
  326. package/lib/src/unit-definitions/email-input.js +0 -12
  327. package/lib/src/unit-definitions/email.d.ts +0 -2
  328. package/lib/src/unit-definitions/email.js +0 -17
  329. package/lib/src/unit-definitions/emoji.d.ts +0 -2
  330. package/lib/src/unit-definitions/emoji.js +0 -17
  331. package/lib/src/unit-definitions/file-collection-count.d.ts +0 -2
  332. package/lib/src/unit-definitions/file-collection-count.js +0 -32
  333. package/lib/src/unit-definitions/file-compact-collection.d.ts +0 -2
  334. package/lib/src/unit-definitions/file-compact-collection.js +0 -32
  335. package/lib/src/unit-definitions/file-compact-reference.d.ts +0 -2
  336. package/lib/src/unit-definitions/file-compact-reference.js +0 -37
  337. package/lib/src/unit-definitions/file-reference.d.ts +0 -2
  338. package/lib/src/unit-definitions/file-reference.js +0 -28
  339. package/lib/src/unit-definitions/files-gallery.d.ts +0 -2
  340. package/lib/src/unit-definitions/files-gallery.js +0 -32
  341. package/lib/src/unit-definitions/files-l-list-item.d.ts +0 -2
  342. package/lib/src/unit-definitions/files-l-list-item.js +0 -28
  343. package/lib/src/unit-definitions/files-l-list.d.ts +0 -2
  344. package/lib/src/unit-definitions/files-l-list.js +0 -32
  345. package/lib/src/unit-definitions/files-list-item.d.ts +0 -2
  346. package/lib/src/unit-definitions/files-list-item.js +0 -28
  347. package/lib/src/unit-definitions/files-list.d.ts +0 -2
  348. package/lib/src/unit-definitions/files-list.js +0 -32
  349. package/lib/src/unit-definitions/geometry-preview.d.ts +0 -2
  350. package/lib/src/unit-definitions/geometry-preview.js +0 -17
  351. package/lib/src/unit-definitions/icon-button.d.ts +0 -2
  352. package/lib/src/unit-definitions/icon-button.js +0 -29
  353. package/lib/src/unit-definitions/icon-input.d.ts +0 -2
  354. package/lib/src/unit-definitions/icon-input.js +0 -12
  355. package/lib/src/unit-definitions/id.d.ts +0 -2
  356. package/lib/src/unit-definitions/id.js +0 -29
  357. package/lib/src/unit-definitions/index.d.ts +0 -27
  358. package/lib/src/unit-definitions/index.js +0 -57
  359. package/lib/src/unit-definitions/json-input.d.ts +0 -2
  360. package/lib/src/unit-definitions/json-input.js +0 -21
  361. package/lib/src/unit-definitions/location-input.d.ts +0 -2
  362. package/lib/src/unit-definitions/location-input.js +0 -18
  363. package/lib/src/unit-definitions/location.d.ts +0 -2
  364. package/lib/src/unit-definitions/location.js +0 -17
  365. package/lib/src/unit-definitions/not-found.d.ts +0 -2
  366. package/lib/src/unit-definitions/not-found.js +0 -24
  367. package/lib/src/unit-definitions/number-input.d.ts +0 -2
  368. package/lib/src/unit-definitions/number-input.js +0 -22
  369. package/lib/src/unit-definitions/number.d.ts +0 -2
  370. package/lib/src/unit-definitions/number.js +0 -25
  371. package/lib/src/unit-definitions/phone-input.d.ts +0 -2
  372. package/lib/src/unit-definitions/phone-input.js +0 -12
  373. package/lib/src/unit-definitions/phone.d.ts +0 -2
  374. package/lib/src/unit-definitions/phone.js +0 -12
  375. package/lib/src/unit-definitions/progress-bar.d.ts +0 -2
  376. package/lib/src/unit-definitions/progress-bar.js +0 -29
  377. package/lib/src/unit-definitions/reference-collection-combobox.d.ts +0 -2
  378. package/lib/src/unit-definitions/reference-collection-combobox.js +0 -21
  379. package/lib/src/unit-definitions/reference-collection-list.d.ts +0 -2
  380. package/lib/src/unit-definitions/reference-collection-list.js +0 -22
  381. package/lib/src/unit-definitions/reference-collection-view.d.ts +0 -2
  382. package/lib/src/unit-definitions/reference-collection-view.js +0 -19
  383. package/lib/src/unit-definitions/reference-collection.d.ts +0 -2
  384. package/lib/src/unit-definitions/reference-collection.js +0 -28
  385. package/lib/src/unit-definitions/reference-combobox.d.ts +0 -2
  386. package/lib/src/unit-definitions/reference-combobox.js +0 -21
  387. package/lib/src/unit-definitions/reference-icon.d.ts +0 -2
  388. package/lib/src/unit-definitions/reference-icon.js +0 -12
  389. package/lib/src/unit-definitions/reference.d.ts +0 -2
  390. package/lib/src/unit-definitions/reference.js +0 -61
  391. package/lib/src/unit-definitions/rich-text-document.d.ts +0 -2
  392. package/lib/src/unit-definitions/rich-text-document.js +0 -22
  393. package/lib/src/unit-definitions/rich-text-snippet.d.ts +0 -3
  394. package/lib/src/unit-definitions/rich-text-snippet.js +0 -34
  395. package/lib/src/unit-definitions/single-location-preview.d.ts +0 -2
  396. package/lib/src/unit-definitions/single-location-preview.js +0 -17
  397. package/lib/src/unit-definitions/text-input.d.ts +0 -2
  398. package/lib/src/unit-definitions/text-input.js +0 -22
  399. package/lib/src/unit-definitions/text.d.ts +0 -2
  400. package/lib/src/unit-definitions/text.js +0 -22
  401. package/lib/src/unit-definitions/title-input.d.ts +0 -2
  402. package/lib/src/unit-definitions/title-input.js +0 -16
  403. package/lib/src/unit-definitions/title.d.ts +0 -2
  404. package/lib/src/unit-definitions/title.js +0 -34
  405. package/lib/src/unit-definitions/type-badge-abbr.d.ts +0 -2
  406. package/lib/src/unit-definitions/type-badge-abbr.js +0 -25
  407. package/lib/src/unit-definitions/type-badge.d.ts +0 -2
  408. package/lib/src/unit-definitions/type-badge.js +0 -25
  409. package/lib/src/unit-definitions/type-icon.d.ts +0 -2
  410. package/lib/src/unit-definitions/type-icon.js +0 -25
  411. package/lib/src/unit-definitions/url-input.d.ts +0 -2
  412. package/lib/src/unit-definitions/url-input.js +0 -12
  413. package/lib/src/unit-definitions/url.d.ts +0 -2
  414. package/lib/src/unit-definitions/url.js +0 -17
  415. package/lib/src/unit-definitions/user-button.d.ts +0 -2
  416. package/lib/src/unit-definitions/user-button.js +0 -23
  417. package/lib/src/unit-definitions/user-role-input.d.ts +0 -2
  418. package/lib/src/unit-definitions/user-role-input.js +0 -12
  419. package/lib/src/unit-definitions/user-role.d.ts +0 -2
  420. package/lib/src/unit-definitions/user-role.js +0 -29
  421. package/lib/src/unit-utils/access.d.ts +0 -9
  422. package/lib/src/unit-utils/access.js +0 -14
  423. package/lib/src/unit-utils/can-edit-field.d.ts +0 -6
  424. package/lib/src/unit-utils/can-edit-field.js +0 -8
  425. package/lib/src/unit-utils/common.d.ts +0 -14
  426. package/lib/src/unit-utils/common.js +0 -43
  427. package/lib/src/unit-utils/decimal.d.ts +0 -42
  428. package/lib/src/unit-utils/decimal.js +0 -418
  429. package/lib/src/unit-utils/dynamic-keys.d.ts +0 -7
  430. package/lib/src/unit-utils/dynamic-keys.js +0 -13
  431. package/lib/src/unit-utils/enums.d.ts +0 -27
  432. package/lib/src/unit-utils/enums.js +0 -69
  433. package/lib/src/unit-utils/formatters.d.ts +0 -50
  434. package/lib/src/unit-utils/formatters.js +0 -163
  435. package/lib/src/unit-utils/get-export-value.d.ts +0 -45
  436. package/lib/src/unit-utils/get-export-value.js +0 -83
  437. package/lib/src/unit-utils/get-field-label.d.ts +0 -6
  438. package/lib/src/unit-utils/get-field-label.js +0 -10
  439. package/lib/src/unit-utils/get-unmatched-unit-label.d.ts +0 -2
  440. package/lib/src/unit-utils/get-unmatched-unit-label.js +0 -9
  441. package/lib/src/unit-utils/schema.d.ts +0 -4
  442. package/lib/src/unit-utils/schema.js +0 -12
  443. package/lib/src/unit-utils/wrap-normalized-in-expression.d.ts +0 -3
  444. package/lib/src/unit-utils/wrap-normalized-in-expression.js +0 -14
  445. package/lib/src/units/board.d.ts +0 -46
  446. package/lib/src/units/board.js +0 -51
  447. package/lib/src/units/canvas/all-units-data-definitions.d.ts +0 -18
  448. package/lib/src/units/canvas/all-units-data-definitions.js +0 -40
  449. package/lib/src/units/canvas/index.d.ts +0 -45
  450. package/lib/src/units/canvas/index.js +0 -48
  451. package/lib/src/units/canvas/type-badge-abbr.d.ts +0 -36
  452. package/lib/src/units/canvas/type-badge-abbr.js +0 -11
  453. package/lib/src/units/canvas/type-badge.d.ts +0 -36
  454. package/lib/src/units/canvas/type-badge.js +0 -11
  455. package/lib/src/units/default.d.ts +0 -46
  456. package/lib/src/units/default.js +0 -51
  457. package/lib/src/units/gallery.d.ts +0 -3
  458. package/lib/src/units/gallery.js +0 -18
  459. package/lib/src/units/gantt.d.ts +0 -47
  460. package/lib/src/units/gantt.js +0 -59
  461. package/lib/src/units/get-unit-definitions-for-view-type.d.ts +0 -2
  462. package/lib/src/units/get-unit-definitions-for-view-type.js +0 -64
  463. package/lib/src/units/grid.d.ts +0 -45
  464. package/lib/src/units/grid.js +0 -71
  465. package/lib/src/units/list.d.ts +0 -46
  466. package/lib/src/units/list.js +0 -49
  467. package/lib/src/units/make-factory.d.ts +0 -51
  468. package/lib/src/units/make-factory.js +0 -261
  469. package/lib/src/units/types.d.ts +0 -73
  470. package/lib/src/units/types.js +0 -2
@@ -0,0 +1,35 @@
1
+ import { calculateUnitExpressionErrors, makeUnitMethod } from "../unit-utils/common.js";
2
+ import { getSnippetExportValue } from "../unit-utils/get-export-value.js";
3
+ import { getFieldLabel } from "../unit-utils/get-field-label.js";
4
+ import { getQuerySelectForExpression } from "@fibery/query-utils/src/query";
5
+ //#region src/unit-definitions/rich-text-snippet.ts
6
+ const type = "rich-text-snippet";
7
+ const RichTextSnippet = {
8
+ type,
9
+ name: "Snippet",
10
+ canEdit() {
11
+ return false;
12
+ },
13
+ makeUnit: makeUnitMethod(type),
14
+ getLabel({ typeObject, unit }) {
15
+ return `${getFieldLabel({
16
+ typeObject,
17
+ unit
18
+ })} (Snippet)`;
19
+ },
20
+ getQuerySelect({ typeObject, unit: { expression } }) {
21
+ return getQuerySelectForExpression({
22
+ typeObject,
23
+ expression: [...expression, "Collaboration~Documents/Snippet"],
24
+ selectsByTypeLookup: { "Collaboration~Documents/Document": {
25
+ "fibery/id": "fibery/id",
26
+ "Collaboration~Documents/secret": "Collaboration~Documents/secret"
27
+ } }
28
+ });
29
+ },
30
+ calculateErrors: calculateUnitExpressionErrors,
31
+ getExportValue: getSnippetExportValue,
32
+ canExport: () => true
33
+ };
34
+ //#endregion
35
+ export { RichTextSnippet, type };
@@ -0,0 +1,5 @@
1
+ import { FieldUnit, UnitDataDefinition } from "../units/types.js";
2
+ //#region src/unit-definitions/single-location-preview.d.ts
3
+ declare const SingleLocationPreview: UnitDataDefinition<FieldUnit>;
4
+ //#endregion
5
+ export { SingleLocationPreview };
@@ -0,0 +1,17 @@
1
+ import { makeUnitMethod } from "../unit-utils/common.js";
2
+ import { Text } from "./text.js";
3
+ //#region src/unit-definitions/single-location-preview.ts
4
+ const type = "single-location-preview";
5
+ const SingleLocationPreview = {
6
+ type,
7
+ name: "Preview",
8
+ makeUnit: makeUnitMethod(type),
9
+ getLabel: Text.getLabel,
10
+ getQuerySelect: Text.getQuerySelect,
11
+ calculateErrors: Text.calculateErrors,
12
+ canEdit: Text.canEdit,
13
+ getExportValue: Text.getExportValue,
14
+ canExport: () => true
15
+ };
16
+ //#endregion
17
+ export { SingleLocationPreview };
@@ -0,0 +1,5 @@
1
+ import { FieldUnit, UnitDataDefinition } from "../units/types.js";
2
+ //#region src/unit-definitions/text-input.d.ts
3
+ declare const TextInput: UnitDataDefinition<FieldUnit>;
4
+ //#endregion
5
+ export { TextInput };
@@ -0,0 +1,25 @@
1
+ import { calculateUnitExpressionErrors, makeUnitMethod } from "../unit-utils/common.js";
2
+ import { getExportValue } from "../unit-utils/get-export-value.js";
3
+ import { getFieldLabel } from "../unit-utils/get-field-label.js";
4
+ import { canEditField } from "../unit-utils/can-edit-field.js";
5
+ import { getQuerySelectForExpression } from "@fibery/query-utils/src/query";
6
+ //#region src/unit-definitions/text-input.tsx
7
+ const type = "text-input";
8
+ const TextInput = {
9
+ type,
10
+ name: "Input",
11
+ canEdit: canEditField,
12
+ makeUnit: makeUnitMethod(type),
13
+ getLabel: getFieldLabel,
14
+ getQuerySelect({ typeObject, unit: { expression } }) {
15
+ return getQuerySelectForExpression({
16
+ typeObject,
17
+ expression
18
+ });
19
+ },
20
+ calculateErrors: calculateUnitExpressionErrors,
21
+ getExportValue,
22
+ canExport: () => true
23
+ };
24
+ //#endregion
25
+ export { TextInput };
@@ -0,0 +1,5 @@
1
+ import { FieldUnit, UnitDataDefinition } from "../units/types.js";
2
+ //#region src/unit-definitions/text.d.ts
3
+ declare const Text: UnitDataDefinition<FieldUnit>;
4
+ //#endregion
5
+ export { Text };
@@ -0,0 +1,25 @@
1
+ import { calculateUnitExpressionErrors, makeUnitMethod } from "../unit-utils/common.js";
2
+ import { getExportValue } from "../unit-utils/get-export-value.js";
3
+ import { getFieldLabel } from "../unit-utils/get-field-label.js";
4
+ import { canEditField } from "../unit-utils/can-edit-field.js";
5
+ import { getQuerySelectForExpression } from "@fibery/query-utils/src/query";
6
+ //#region src/unit-definitions/text.ts
7
+ const type = "text";
8
+ const Text = {
9
+ type,
10
+ name: "Input",
11
+ canEdit: canEditField,
12
+ makeUnit: makeUnitMethod(type),
13
+ getLabel: getFieldLabel,
14
+ getQuerySelect({ typeObject, unit: { expression } }) {
15
+ return getQuerySelectForExpression({
16
+ typeObject,
17
+ expression
18
+ });
19
+ },
20
+ calculateErrors: calculateUnitExpressionErrors,
21
+ getExportValue,
22
+ canExport: () => true
23
+ };
24
+ //#endregion
25
+ export { Text };
@@ -0,0 +1,5 @@
1
+ import { FieldUnit, UnitDataDefinition } from "../units/types.js";
2
+ //#region src/unit-definitions/title-input.d.ts
3
+ declare const TitleInput: UnitDataDefinition<FieldUnit>;
4
+ //#endregion
5
+ export { TitleInput };
@@ -0,0 +1,19 @@
1
+ import { Title } from "./title.js";
2
+ //#region src/unit-definitions/title-input.tsx
3
+ const type = "title-input";
4
+ const TitleInput = {
5
+ type,
6
+ name: "Input",
7
+ makeUnit: () => ({
8
+ type,
9
+ kind: "field"
10
+ }),
11
+ getLabel: Title.getLabel,
12
+ getQuerySelect: Title.getQuerySelect,
13
+ calculateErrors: Title.calculateErrors,
14
+ canEdit: Title.canEdit,
15
+ getExportValue: Title.getExportValue,
16
+ canExport: () => true
17
+ };
18
+ //#endregion
19
+ export { TitleInput };
@@ -0,0 +1,5 @@
1
+ import { FieldUnit, UnitDataDefinition } from "../units/types.js";
2
+ //#region src/unit-definitions/title.d.ts
3
+ declare const Title: UnitDataDefinition<FieldUnit>;
4
+ //#endregion
5
+ export { Title };
@@ -0,0 +1,33 @@
1
+ import { getTitleExportValue } from "../unit-utils/get-export-value.js";
2
+ import { toSelectMapClause } from "@fibery/query-utils/src/select";
3
+ //#region src/unit-definitions/title.ts
4
+ const type = "title";
5
+ const Title = {
6
+ type,
7
+ name: "Full",
8
+ makeUnit() {
9
+ return {
10
+ type,
11
+ kind: "field"
12
+ };
13
+ },
14
+ getLabel({ typeObject }) {
15
+ return typeObject.titleFieldObject.title;
16
+ },
17
+ getQuerySelect({ typeObject }) {
18
+ return toSelectMapClause([typeObject.publicIdFieldObject, typeObject.titleFieldObject].filter(Boolean).map((x) => x.name));
19
+ },
20
+ calculateErrors({ typeObject, unit }) {
21
+ const errors = [];
22
+ if (typeObject.publicIdFieldObject === null) errors.push(`${typeObject.name} does not have public id field for ${unit.type} unit`);
23
+ if (typeObject.titleFieldObject === null) errors.push(`${typeObject.name} does not have title field for ${unit.type} unit`);
24
+ return errors;
25
+ },
26
+ canEdit() {
27
+ return false;
28
+ },
29
+ getExportValue: getTitleExportValue,
30
+ canExport: () => true
31
+ };
32
+ //#endregion
33
+ export { Title };
@@ -0,0 +1,5 @@
1
+ import { DbUnit, UnitDataDefinition } from "../units/types.js";
2
+ //#region src/unit-definitions/type-badge-abbr.d.ts
3
+ declare const TypeBadgeAbbr: UnitDataDefinition<DbUnit>;
4
+ //#endregion
5
+ export { TypeBadgeAbbr };
@@ -0,0 +1,28 @@
1
+ //#region src/unit-definitions/type-badge-abbr.ts
2
+ const type = "type-badge-abbr";
3
+ const TypeBadgeAbbr = {
4
+ type,
5
+ name: "Abbreviation",
6
+ canEdit: () => false,
7
+ getLabel() {
8
+ return "Database Abbreviation Badge";
9
+ },
10
+ makeUnit() {
11
+ return {
12
+ type,
13
+ kind: "db"
14
+ };
15
+ },
16
+ getQuerySelect() {
17
+ return {};
18
+ },
19
+ calculateErrors() {
20
+ return [];
21
+ },
22
+ getExportValue() {
23
+ return null;
24
+ },
25
+ canExport: () => false
26
+ };
27
+ //#endregion
28
+ export { TypeBadgeAbbr };
@@ -0,0 +1,5 @@
1
+ import { DbUnit, UnitDataDefinition } from "../units/types.js";
2
+ //#region src/unit-definitions/type-badge.d.ts
3
+ declare const TypeBadge: UnitDataDefinition<DbUnit>;
4
+ //#endregion
5
+ export { TypeBadge };
@@ -0,0 +1,28 @@
1
+ //#region src/unit-definitions/type-badge.ts
2
+ const type = "type-badge";
3
+ const TypeBadge = {
4
+ type,
5
+ name: "Name",
6
+ canEdit: () => false,
7
+ getLabel() {
8
+ return "Database Badge";
9
+ },
10
+ makeUnit() {
11
+ return {
12
+ type,
13
+ kind: "db"
14
+ };
15
+ },
16
+ getQuerySelect() {
17
+ return {};
18
+ },
19
+ calculateErrors() {
20
+ return [];
21
+ },
22
+ getExportValue() {
23
+ return null;
24
+ },
25
+ canExport: () => false
26
+ };
27
+ //#endregion
28
+ export { TypeBadge };
@@ -0,0 +1,5 @@
1
+ import { DbUnit, UnitDataDefinition } from "../units/types.js";
2
+ //#region src/unit-definitions/type-icon.d.ts
3
+ declare const TypeIcon: UnitDataDefinition<DbUnit>;
4
+ //#endregion
5
+ export { TypeIcon };
@@ -0,0 +1,28 @@
1
+ //#region src/unit-definitions/type-icon.ts
2
+ const type = "type-icon";
3
+ const TypeIcon = {
4
+ type,
5
+ name: "Icon",
6
+ canEdit: () => false,
7
+ getLabel() {
8
+ return "Database Icon";
9
+ },
10
+ makeUnit() {
11
+ return {
12
+ type,
13
+ kind: "db"
14
+ };
15
+ },
16
+ getQuerySelect() {
17
+ return {};
18
+ },
19
+ calculateErrors() {
20
+ return [];
21
+ },
22
+ getExportValue() {
23
+ return null;
24
+ },
25
+ canExport: () => false
26
+ };
27
+ //#endregion
28
+ export { TypeIcon };
@@ -0,0 +1,5 @@
1
+ import { FieldUnit, UnitDataDefinition } from "../units/types.js";
2
+ //#region src/unit-definitions/url-input.d.ts
3
+ declare const UrlInput: UnitDataDefinition<FieldUnit>;
4
+ //#endregion
5
+ export { UrlInput };
@@ -0,0 +1,12 @@
1
+ import { makeUnitMethod } from "../unit-utils/common.js";
2
+ import { TextInput } from "./text-input.js";
3
+ //#region src/unit-definitions/url-input.tsx
4
+ const type = "url-input";
5
+ const UrlInput = {
6
+ ...TextInput,
7
+ type,
8
+ name: "Input",
9
+ makeUnit: makeUnitMethod(type)
10
+ };
11
+ //#endregion
12
+ export { UrlInput };
@@ -0,0 +1,5 @@
1
+ import { FieldUnit, UnitDataDefinition } from "../units/types.js";
2
+ //#region src/unit-definitions/url.d.ts
3
+ declare const Url: UnitDataDefinition<FieldUnit>;
4
+ //#endregion
5
+ export { Url };
@@ -0,0 +1,17 @@
1
+ import { makeUnitMethod } from "../unit-utils/common.js";
2
+ import { Text } from "./text.js";
3
+ //#region src/unit-definitions/url.ts
4
+ const type = "url";
5
+ const Url = {
6
+ type,
7
+ name: "Input",
8
+ makeUnit: makeUnitMethod(type),
9
+ getLabel: Text.getLabel,
10
+ getQuerySelect: Text.getQuerySelect,
11
+ calculateErrors: Text.calculateErrors,
12
+ canEdit: Text.canEdit,
13
+ getExportValue: Text.getExportValue,
14
+ canExport: () => true
15
+ };
16
+ //#endregion
17
+ export { Url };
@@ -0,0 +1,5 @@
1
+ import { ButtonUnit, UnitDataDefinition } from "../units/types.js";
2
+ //#region src/unit-definitions/user-button.d.ts
3
+ declare const UserButton: UnitDataDefinition<ButtonUnit>;
4
+ //#endregion
5
+ export { UserButton };
@@ -0,0 +1,26 @@
1
+ //#region src/unit-definitions/user-button.ts
2
+ const type = "user-button";
3
+ const UserButton = {
4
+ type,
5
+ name: "Button",
6
+ canEdit() {
7
+ return true;
8
+ },
9
+ getLabel() {
10
+ return "";
11
+ },
12
+ makeUnit() {
13
+ return {
14
+ type,
15
+ kind: "user-button"
16
+ };
17
+ },
18
+ getQuerySelect() {
19
+ return {};
20
+ },
21
+ calculateErrors: () => [],
22
+ getExportValue: () => null,
23
+ canExport: () => false
24
+ };
25
+ //#endregion
26
+ export { UserButton };
@@ -0,0 +1,5 @@
1
+ import { FieldUnit, UnitDataDefinition } from "../units/types.js";
2
+ //#region src/unit-definitions/user-role-input.d.ts
3
+ declare const UserRoleInput: UnitDataDefinition<FieldUnit>;
4
+ //#endregion
5
+ export { UserRoleInput };
@@ -0,0 +1,12 @@
1
+ import { makeUnitMethod } from "../unit-utils/common.js";
2
+ import { UserRole } from "./user-role.js";
3
+ //#region src/unit-definitions/user-role-input.tsx
4
+ const type = "user-role-input";
5
+ const UserRoleInput = {
6
+ ...UserRole,
7
+ type,
8
+ name: "Compact List",
9
+ makeUnit: makeUnitMethod(type)
10
+ };
11
+ //#endregion
12
+ export { UserRoleInput };
@@ -0,0 +1,5 @@
1
+ import { FieldUnit, UnitDataDefinition } from "../units/types.js";
2
+ //#region src/unit-definitions/user-role.d.ts
3
+ declare const UserRole: UnitDataDefinition<FieldUnit>;
4
+ //#endregion
5
+ export { UserRole };
@@ -0,0 +1,35 @@
1
+ import { getUserRoleByKey } from "../field-utils/user-role.js";
2
+ import { calculateUnitExpressionErrors, makeUnitMethod } from "../unit-utils/common.js";
3
+ import { getExportValue } from "../unit-utils/get-export-value.js";
4
+ import { canEditField } from "../unit-utils/can-edit-field.js";
5
+ import { getQuerySelectForExpression } from "@fibery/query-utils/src/query";
6
+ //#region src/unit-definitions/user-role.ts
7
+ const type = "user-role";
8
+ const UserRole = {
9
+ type,
10
+ name: "User Role",
11
+ canEdit: canEditField,
12
+ getLabel: () => "User Role",
13
+ makeUnit: makeUnitMethod(type),
14
+ getQuerySelect({ typeObject, unit: { expression } }) {
15
+ return getQuerySelectForExpression({
16
+ typeObject,
17
+ expression
18
+ });
19
+ },
20
+ calculateErrors: calculateUnitExpressionErrors,
21
+ getExportValue: ({ object, unit }) => {
22
+ const value = getExportValue({
23
+ object,
24
+ unit
25
+ });
26
+ if (value) {
27
+ const roleDef = getUserRoleByKey(value);
28
+ return roleDef ? roleDef.label : value;
29
+ }
30
+ return value;
31
+ },
32
+ canExport: () => true
33
+ };
34
+ //#endregion
35
+ export { UserRole };
@@ -0,0 +1,12 @@
1
+ import { TypeObject } from "@fibery/schema";
2
+ import { FieldExpression } from "@fibery/expression-utils";
3
+ //#region src/unit-utils/access.d.ts
4
+ declare const accessCheckKey: string;
5
+ declare const generateAccessCheckQueryExpression: ({ typeObject, contextPath }: {
6
+ typeObject: TypeObject;
7
+ contextPath?: FieldExpression;
8
+ }) => {
9
+ [accessCheckKey]: (string | (string | import("@fibery/expression-utils").MultiFieldAccess)[])[];
10
+ };
11
+ //#endregion
12
+ export { accessCheckKey, generateAccessCheckQueryExpression };
@@ -0,0 +1,9 @@
1
+ import { accessCheckKeyKeyPrefix, makeDynamicKey } from "./dynamic-keys.js";
2
+ //#region src/unit-utils/access.ts
3
+ const accessCheckKey = makeDynamicKey(accessCheckKeyKeyPrefix);
4
+ const generateAccessCheckQueryExpression = ({ typeObject, contextPath = [] }) => {
5
+ const titleFieldName = typeObject.titleField;
6
+ return titleFieldName ? { [accessCheckKey]: ["q/access?", [...contextPath, titleFieldName]] } : {};
7
+ };
8
+ //#endregion
9
+ export { accessCheckKey, generateAccessCheckQueryExpression };
@@ -0,0 +1,9 @@
1
+ import { FieldUnit } from "../units/types.js";
2
+ import { TypeObject } from "@fibery/schema";
3
+ //#region src/unit-utils/can-edit-field.d.ts
4
+ declare const canEditField: ({ typeObject, unit: { expression } }: {
5
+ typeObject: TypeObject;
6
+ unit: FieldUnit;
7
+ }) => boolean;
8
+ //#endregion
9
+ export { canEditField };
@@ -0,0 +1,7 @@
1
+ import { canEditFieldExpression } from "./common.js";
2
+ //#region src/unit-utils/can-edit-field.ts
3
+ const canEditField = ({ typeObject, unit: { expression } }) => {
4
+ return canEditFieldExpression(typeObject, expression);
5
+ };
6
+ //#endregion
7
+ export { canEditField };
@@ -0,0 +1,17 @@
1
+ import { $TSFixMe } from "../tsfixme.js";
2
+ import { FieldUnit, PureUnit, Unit, UnitExpression } from "../units/types.js";
3
+ import { TypeObject } from "@fibery/schema";
4
+ //#region src/unit-utils/common.d.ts
5
+ declare const makeUnitMethod: (type: FieldUnit["type"]) => ({ expression }?: {
6
+ expression?: UnitExpression;
7
+ }) => FieldUnit;
8
+ declare const calculateUnitExpressionErrors: ({ typeObject, unit }: {
9
+ typeObject: TypeObject;
10
+ unit: Unit;
11
+ }) => string[];
12
+ declare const isUnitEnabled: (unit: Unit) => boolean;
13
+ declare const toPureUnit: (unit: Unit) => PureUnit;
14
+ declare const asString: (something: $TSFixMe) => string;
15
+ declare const canEditFieldExpression: (typeObject: TypeObject, expression: UnitExpression) => boolean;
16
+ //#endregion
17
+ export { asString, calculateUnitExpressionErrors, canEditFieldExpression, isUnitEnabled, makeUnitMethod, toPureUnit };
@@ -0,0 +1,39 @@
1
+ import { getUnmatchedUnitLabel } from "./get-unmatched-unit-label.js";
2
+ import omit from "lodash/omit.js";
3
+ import { assertIsValidExpression, getFieldObjectByFieldExpression, isFieldExpressionValid } from "@fibery/expression-utils/src/utils";
4
+ //#region src/unit-utils/common.ts
5
+ const makeUnitMethod = (type) => ({ expression } = {}) => {
6
+ assertIsValidExpression(expression);
7
+ return {
8
+ type,
9
+ kind: "field",
10
+ expression
11
+ };
12
+ };
13
+ const calculateUnitExpressionErrors = ({ typeObject, unit }) => {
14
+ if ("expression" in unit && !isFieldExpressionValid({
15
+ typeObject,
16
+ expression: unit.expression
17
+ })) return [`Invalid unit ${getUnmatchedUnitLabel(unit)} selected`];
18
+ return [];
19
+ };
20
+ const isUnitEnabled = (unit) => {
21
+ const { checked } = unit;
22
+ return checked === void 0 || checked === true;
23
+ };
24
+ const toPureUnit = (unit) => omit(unit, ["checked"]);
25
+ const asString = (something) => typeof something === "string" ? something : JSON.stringify(something);
26
+ const canEditFieldExpression = (typeObject, expression) => {
27
+ if (isFieldExpressionValid({
28
+ typeObject,
29
+ expression
30
+ })) {
31
+ const fieldObject = getFieldObjectByFieldExpression({
32
+ typeObject,
33
+ expression
34
+ });
35
+ return fieldObject.type !== "fibery/file" && !fieldObject.isReadOnly;
36
+ } else return false;
37
+ };
38
+ //#endregion
39
+ export { asString, calculateUnitExpressionErrors, canEditFieldExpression, isUnitEnabled, makeUnitMethod, toPureUnit };
@@ -0,0 +1,44 @@
1
+ //#region src/unit-utils/decimal.d.ts
2
+ declare class Decimal {
3
+ static readonly ROUND_UP = 0;
4
+ static readonly ROUND_DOWN = 1;
5
+ static readonly ROUND_CEIL = 2;
6
+ static readonly ROUND_FLOOR = 3;
7
+ static readonly ROUND_HALF_UP = 4;
8
+ static readonly ROUND_HALF_DOWN = 5;
9
+ static readonly ROUND_HALF_EVEN = 6;
10
+ static readonly ROUND_HALF_CEIL = 7;
11
+ static readonly ROUND_HALF_FLOOR = 8;
12
+ s: number;
13
+ e: number;
14
+ d: number[] | null;
15
+ /**
16
+ * Create a new Decimal instance.
17
+ * @param v A numeric string or Decimal instance
18
+ */
19
+ constructor(v: string | Decimal);
20
+ /**
21
+ * Return a string representing the value of this Decimal in normal (fixed-point) notation to
22
+ * `dp` fixed decimal places and rounded using rounding mode `rm`.
23
+ *
24
+ * As with JavaScript numbers, (-0).toFixed(0) is '0', but e.g. (-0.00001).toFixed(0) is '-0'.
25
+ *
26
+ * @param dp Decimal places. Integer, 0 to MAX_DIGITS inclusive.
27
+ * @param rm Rounding mode. Integer, 0 to 8 inclusive.
28
+ *
29
+ * @example
30
+ * (-0).toFixed(0) is '0', but (-0.1).toFixed(0) is '-0'.
31
+ * (-0).toFixed(1) is '0.0', but (-0.01).toFixed(1) is '-0.0'.
32
+ * (-0).toFixed(3) is '0.000'.
33
+ * (-0.5).toFixed(0) is '-0'.
34
+ */
35
+ toFixed(dp: number, rm: number): string;
36
+ /**
37
+ * Test whether a string value is a valid decimal.
38
+ * @param value The string to test
39
+ * @returns true if the value is a valid decimal string
40
+ */
41
+ static isDecimal(value: string): boolean;
42
+ }
43
+ //#endregion
44
+ export { Decimal as default };