@fibery/views 19.1.2 → 20.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/_virtual/_rolldown/runtime.js +13 -0
- package/lib/errors.d.ts +4 -0
- package/lib/errors.js +4 -0
- package/lib/field-utils/avatar.d.ts +23 -0
- package/lib/field-utils/avatar.js +35 -0
- package/lib/field-utils/back-references.d.ts +18 -0
- package/lib/field-utils/back-references.js +15 -0
- package/lib/field-utils/comments.d.ts +63 -0
- package/lib/field-utils/comments.js +41 -0
- package/lib/field-utils/date-time.d.ts +17 -0
- package/lib/field-utils/date-time.js +31 -0
- package/lib/field-utils/enum-value.d.ts +16 -0
- package/lib/field-utils/enum-value.js +26 -0
- package/lib/field-utils/file.d.ts +7 -0
- package/lib/field-utils/file.js +14 -0
- package/lib/field-utils/icon.d.ts +13 -0
- package/lib/field-utils/icon.js +17 -0
- package/lib/field-utils/number.d.ts +34 -0
- package/lib/field-utils/number.js +64 -0
- package/lib/field-utils/reference-collection.d.ts +16 -0
- package/lib/field-utils/reference-collection.js +49 -0
- package/lib/field-utils/reference.d.ts +10 -0
- package/lib/field-utils/reference.js +55 -0
- package/lib/field-utils/relation-view.d.ts +5 -0
- package/lib/field-utils/relation-view.js +7 -0
- package/lib/field-utils/rich-text.d.ts +16 -0
- package/lib/field-utils/rich-text.js +33 -0
- package/lib/field-utils/text.d.ts +33 -0
- package/lib/field-utils/text.js +40 -0
- package/lib/field-utils/user-active.d.ts +11 -0
- package/lib/field-utils/user-active.js +24 -0
- package/lib/field-utils/user-role.d.ts +9 -0
- package/lib/field-utils/user-role.js +23 -0
- package/lib/field-utils/workflow.d.ts +18 -0
- package/lib/field-utils/workflow.js +48 -0
- package/lib/index.d.ts +34 -1
- package/lib/index.js +169 -16
- package/lib/meta-validation.d.ts +13 -0
- package/lib/meta-validation.js +53 -0
- package/lib/private/board.d.ts +18 -0
- package/lib/private/board.js +234 -0
- package/lib/private/calendar.d.ts +17 -0
- package/lib/private/calendar.js +82 -0
- package/lib/private/feed.d.ts +17 -0
- package/lib/private/feed.js +81 -0
- package/lib/private/form.d.ts +27 -0
- package/lib/private/form.js +57 -0
- package/lib/private/map.d.ts +17 -0
- package/lib/private/map.js +81 -0
- package/lib/private/smart-folder.d.ts +33 -0
- package/lib/private/smart-folder.js +165 -0
- package/lib/private/timeline.d.ts +41 -0
- package/lib/private/timeline.js +223 -0
- package/lib/private/units.d.ts +12 -0
- package/lib/private/units.js +131 -0
- package/lib/private/utils.d.ts +66 -0
- package/lib/private/utils.js +179 -0
- package/lib/unit-definitions/avatar-collection.d.ts +5 -0
- package/lib/unit-definitions/avatar-collection.js +59 -0
- package/lib/unit-definitions/avatar-input.d.ts +5 -0
- package/lib/unit-definitions/avatar-input.js +12 -0
- package/lib/unit-definitions/avatar.d.ts +5 -0
- package/lib/unit-definitions/avatar.js +95 -0
- package/lib/unit-definitions/back-references-list.d.ts +5 -0
- package/lib/unit-definitions/back-references-list.js +39 -0
- package/lib/unit-definitions/bool-checkbox.d.ts +5 -0
- package/lib/unit-definitions/bool-checkbox.js +25 -0
- package/lib/unit-definitions/bool.d.ts +5 -0
- package/lib/unit-definitions/bool.js +25 -0
- package/lib/unit-definitions/collection-count.d.ts +5 -0
- package/lib/unit-definitions/collection-count.js +35 -0
- package/lib/unit-definitions/color-input.d.ts +5 -0
- package/lib/unit-definitions/color-input.js +24 -0
- package/lib/unit-definitions/comments-list.d.ts +5 -0
- package/lib/unit-definitions/comments-list.js +27 -0
- package/lib/unit-definitions/date-range-combobox.d.ts +5 -0
- package/lib/unit-definitions/date-range-combobox.js +25 -0
- package/lib/unit-definitions/date-range.d.ts +5 -0
- package/lib/unit-definitions/date-range.js +25 -0
- package/lib/unit-definitions/date-time-combobox.d.ts +5 -0
- package/lib/unit-definitions/date-time-combobox.js +25 -0
- package/lib/unit-definitions/date.d.ts +5 -0
- package/lib/unit-definitions/date.js +25 -0
- package/lib/unit-definitions/email-input.d.ts +5 -0
- package/lib/unit-definitions/email-input.js +12 -0
- package/lib/unit-definitions/email.d.ts +5 -0
- package/lib/unit-definitions/email.js +17 -0
- package/lib/unit-definitions/emoji.d.ts +5 -0
- package/lib/unit-definitions/emoji.js +17 -0
- package/lib/unit-definitions/file-collection-count.d.ts +5 -0
- package/lib/unit-definitions/file-collection-count.js +34 -0
- package/lib/unit-definitions/file-compact-collection.d.ts +5 -0
- package/lib/unit-definitions/file-compact-collection.js +34 -0
- package/lib/unit-definitions/file-compact-reference.d.ts +5 -0
- package/lib/unit-definitions/file-compact-reference.js +47 -0
- package/lib/unit-definitions/file-reference.d.ts +5 -0
- package/lib/unit-definitions/file-reference.js +30 -0
- package/lib/unit-definitions/files-gallery.d.ts +5 -0
- package/lib/unit-definitions/files-gallery.js +34 -0
- package/lib/unit-definitions/files-l-list-item.d.ts +5 -0
- package/lib/unit-definitions/files-l-list-item.js +30 -0
- package/lib/unit-definitions/files-l-list.d.ts +5 -0
- package/lib/unit-definitions/files-l-list.js +34 -0
- package/lib/unit-definitions/files-list-item.d.ts +5 -0
- package/lib/unit-definitions/files-list-item.js +30 -0
- package/lib/unit-definitions/files-list.d.ts +5 -0
- package/lib/unit-definitions/files-list.js +34 -0
- package/lib/unit-definitions/geometry-preview.d.ts +5 -0
- package/lib/unit-definitions/geometry-preview.js +17 -0
- package/lib/unit-definitions/icon-button.d.ts +5 -0
- package/lib/unit-definitions/icon-button.js +41 -0
- package/lib/unit-definitions/icon-input.d.ts +5 -0
- package/lib/unit-definitions/icon-input.js +12 -0
- package/lib/unit-definitions/id.d.ts +5 -0
- package/lib/unit-definitions/id.js +30 -0
- package/lib/unit-definitions/index.d.ts +28 -0
- package/lib/unit-definitions/index.js +60 -0
- package/lib/unit-definitions/json-input.d.ts +5 -0
- package/lib/unit-definitions/json-input.js +24 -0
- package/lib/unit-definitions/location-input.d.ts +5 -0
- package/lib/unit-definitions/location-input.js +18 -0
- package/lib/unit-definitions/location.d.ts +5 -0
- package/lib/unit-definitions/location.js +17 -0
- package/lib/unit-definitions/not-found.d.ts +5 -0
- package/lib/unit-definitions/not-found.js +22 -0
- package/lib/unit-definitions/number-input.d.ts +5 -0
- package/lib/unit-definitions/number-input.js +25 -0
- package/lib/unit-definitions/number.d.ts +5 -0
- package/lib/unit-definitions/number.js +31 -0
- package/lib/unit-definitions/phone-input.d.ts +5 -0
- package/lib/unit-definitions/phone-input.js +12 -0
- package/lib/unit-definitions/phone.d.ts +5 -0
- package/lib/unit-definitions/phone.js +12 -0
- package/lib/unit-definitions/progress-bar.d.ts +5 -0
- package/lib/unit-definitions/progress-bar.js +32 -0
- package/lib/unit-definitions/reference-collection-combobox.d.ts +5 -0
- package/lib/unit-definitions/reference-collection-combobox.js +21 -0
- package/lib/unit-definitions/reference-collection-list.d.ts +5 -0
- package/lib/unit-definitions/reference-collection-list.js +21 -0
- package/lib/unit-definitions/reference-collection-view.d.ts +5 -0
- package/lib/unit-definitions/reference-collection-view.js +19 -0
- package/lib/unit-definitions/reference-collection.d.ts +5 -0
- package/lib/unit-definitions/reference-collection.js +30 -0
- package/lib/unit-definitions/reference-combobox.d.ts +5 -0
- package/lib/unit-definitions/reference-combobox.js +21 -0
- package/lib/unit-definitions/reference-icon.d.ts +5 -0
- package/lib/unit-definitions/reference-icon.js +12 -0
- package/lib/unit-definitions/reference.d.ts +5 -0
- package/lib/unit-definitions/reference.js +63 -0
- package/lib/unit-definitions/rich-text-document.d.ts +5 -0
- package/lib/unit-definitions/rich-text-document.js +26 -0
- package/lib/unit-definitions/rich-text-snippet.d.ts +6 -0
- package/lib/unit-definitions/rich-text-snippet.js +35 -0
- package/lib/unit-definitions/single-location-preview.d.ts +5 -0
- package/lib/unit-definitions/single-location-preview.js +17 -0
- package/lib/unit-definitions/text-input.d.ts +5 -0
- package/lib/unit-definitions/text-input.js +25 -0
- package/lib/unit-definitions/text.d.ts +5 -0
- package/lib/unit-definitions/text.js +25 -0
- package/lib/unit-definitions/title-input.d.ts +5 -0
- package/lib/unit-definitions/title-input.js +19 -0
- package/lib/unit-definitions/title.d.ts +5 -0
- package/lib/unit-definitions/title.js +33 -0
- package/lib/unit-definitions/type-badge-abbr.d.ts +5 -0
- package/lib/unit-definitions/type-badge-abbr.js +28 -0
- package/lib/unit-definitions/type-badge.d.ts +5 -0
- package/lib/unit-definitions/type-badge.js +28 -0
- package/lib/unit-definitions/type-icon.d.ts +5 -0
- package/lib/unit-definitions/type-icon.js +28 -0
- package/lib/unit-definitions/url-input.d.ts +5 -0
- package/lib/unit-definitions/url-input.js +12 -0
- package/lib/unit-definitions/url.d.ts +5 -0
- package/lib/unit-definitions/url.js +17 -0
- package/lib/unit-definitions/user-button.d.ts +5 -0
- package/lib/unit-definitions/user-button.js +26 -0
- package/lib/unit-definitions/user-role-input.d.ts +5 -0
- package/lib/unit-definitions/user-role-input.js +12 -0
- package/lib/unit-definitions/user-role.d.ts +5 -0
- package/lib/unit-definitions/user-role.js +35 -0
- package/lib/unit-utils/access.d.ts +12 -0
- package/lib/unit-utils/access.js +9 -0
- package/lib/unit-utils/can-edit-field.d.ts +9 -0
- package/lib/unit-utils/can-edit-field.js +7 -0
- package/lib/unit-utils/common.d.ts +37 -0
- package/lib/unit-utils/common.js +41 -0
- package/lib/unit-utils/decimal.d.ts +44 -0
- package/lib/unit-utils/decimal.js +248 -0
- package/lib/unit-utils/dynamic-keys.d.ts +10 -0
- package/lib/unit-utils/dynamic-keys.js +12 -0
- package/lib/unit-utils/enums.d.ts +30 -0
- package/lib/unit-utils/enums.js +48 -0
- package/lib/unit-utils/formatters.d.ts +53 -0
- package/lib/unit-utils/formatters.js +128 -0
- package/lib/unit-utils/get-export-value.d.ts +48 -0
- package/lib/unit-utils/get-export-value.js +83 -0
- package/lib/unit-utils/get-field-label.d.ts +9 -0
- package/lib/unit-utils/get-field-label.js +11 -0
- package/lib/unit-utils/get-unmatched-unit-label.d.ts +5 -0
- package/lib/unit-utils/get-unmatched-unit-label.js +5 -0
- package/lib/unit-utils/schema.d.ts +7 -0
- package/lib/unit-utils/schema.js +9 -0
- package/lib/unit-utils/wrap-normalized-in-expression.d.ts +6 -0
- package/lib/unit-utils/wrap-normalized-in-expression.js +15 -0
- package/lib/units/board.d.ts +50 -0
- package/lib/units/board.js +24 -0
- package/lib/units/canvas/all-units-data-definitions.d.ts +19 -0
- package/lib/units/canvas/all-units-data-definitions.js +42 -0
- package/lib/units/canvas/index.d.ts +49 -0
- package/lib/units/canvas/index.js +27 -0
- package/lib/units/canvas/type-badge-abbr.d.ts +41 -0
- package/lib/units/canvas/type-badge-abbr.js +11 -0
- package/lib/units/canvas/type-badge.d.ts +41 -0
- package/lib/units/canvas/type-badge.js +11 -0
- package/lib/units/default.d.ts +50 -0
- package/lib/units/default.js +23 -0
- package/lib/units/gallery.d.ts +7 -0
- package/lib/units/gallery.js +21 -0
- package/lib/units/gantt.d.ts +51 -0
- package/lib/units/gantt.js +28 -0
- package/lib/units/get-unit-definitions-for-view-type.d.ts +5 -0
- package/lib/units/get-unit-definitions-for-view-type.js +22 -0
- package/lib/units/grid.d.ts +49 -0
- package/lib/units/grid.js +81 -0
- package/lib/units/list.d.ts +52 -0
- package/lib/units/list.js +23 -0
- package/lib/units/make-factory.d.ts +53 -0
- package/lib/units/make-factory.js +272 -0
- package/lib/units/types.d.ts +74 -0
- package/lib/units/types.js +0 -0
- package/package.json +18 -40
- package/lib/src/errors.d.ts +0 -2
- package/lib/src/errors.js +0 -6
- package/lib/src/field-utils/avatar.d.ts +0 -20
- package/lib/src/field-utils/avatar.js +0 -39
- package/lib/src/field-utils/back-references.d.ts +0 -15
- package/lib/src/field-utils/back-references.js +0 -21
- package/lib/src/field-utils/comments.d.ts +0 -60
- package/lib/src/field-utils/comments.js +0 -46
- package/lib/src/field-utils/date-time.d.ts +0 -14
- package/lib/src/field-utils/date-time.js +0 -56
- package/lib/src/field-utils/enum-value.d.ts +0 -13
- package/lib/src/field-utils/enum-value.js +0 -29
- package/lib/src/field-utils/file.d.ts +0 -4
- package/lib/src/field-utils/file.js +0 -15
- package/lib/src/field-utils/icon.d.ts +0 -10
- package/lib/src/field-utils/icon.js +0 -26
- package/lib/src/field-utils/number.d.ts +0 -31
- package/lib/src/field-utils/number.js +0 -91
- package/lib/src/field-utils/reference-collection.d.ts +0 -13
- package/lib/src/field-utils/reference-collection.js +0 -67
- package/lib/src/field-utils/reference.d.ts +0 -7
- package/lib/src/field-utils/reference.js +0 -54
- package/lib/src/field-utils/relation-view.d.ts +0 -2
- package/lib/src/field-utils/relation-view.js +0 -12
- package/lib/src/field-utils/rich-text.d.ts +0 -13
- package/lib/src/field-utils/rich-text.js +0 -38
- package/lib/src/field-utils/text.d.ts +0 -35
- package/lib/src/field-utils/text.js +0 -40
- package/lib/src/field-utils/user-active.d.ts +0 -8
- package/lib/src/field-utils/user-active.js +0 -23
- package/lib/src/field-utils/user-role.d.ts +0 -6
- package/lib/src/field-utils/user-role.js +0 -25
- package/lib/src/field-utils/workflow.d.ts +0 -15
- package/lib/src/field-utils/workflow.js +0 -53
- package/lib/src/index.d.ts +0 -30
- package/lib/src/index.js +0 -263
- package/lib/src/meta-validation.d.ts +0 -10
- package/lib/src/meta-validation.js +0 -78
- package/lib/src/private/board.d.ts +0 -15
- package/lib/src/private/board.js +0 -327
- package/lib/src/private/calendar.d.ts +0 -14
- package/lib/src/private/calendar.js +0 -123
- package/lib/src/private/feed.d.ts +0 -14
- package/lib/src/private/feed.js +0 -120
- package/lib/src/private/form.d.ts +0 -25
- package/lib/src/private/form.js +0 -61
- package/lib/src/private/map.d.ts +0 -14
- package/lib/src/private/map.js +0 -120
- package/lib/src/private/smart-folder.d.ts +0 -31
- package/lib/src/private/smart-folder.js +0 -277
- package/lib/src/private/test-data/garbage-test.d.ts +0 -649
- package/lib/src/private/test-data/garbage-test.js +0 -520
- package/lib/src/private/test-data/kanban.d.ts +0 -1123
- package/lib/src/private/test-data/kanban.js +0 -1203
- package/lib/src/private/test-data/tasks.d.ts +0 -3216
- package/lib/src/private/test-data/tasks.js +0 -2731
- package/lib/src/private/timeline.d.ts +0 -39
- package/lib/src/private/timeline.js +0 -325
- package/lib/src/private/units.d.ts +0 -10
- package/lib/src/private/units.js +0 -165
- package/lib/src/private/utils.d.ts +0 -64
- package/lib/src/private/utils.js +0 -273
- package/lib/src/tsfixme.d.ts +0 -1
- package/lib/src/tsfixme.js +0 -2
- package/lib/src/unit-definitions/avatar-collection.d.ts +0 -2
- package/lib/src/unit-definitions/avatar-collection.js +0 -53
- package/lib/src/unit-definitions/avatar-input.d.ts +0 -2
- package/lib/src/unit-definitions/avatar-input.js +0 -12
- package/lib/src/unit-definitions/avatar.d.ts +0 -2
- package/lib/src/unit-definitions/avatar.js +0 -87
- package/lib/src/unit-definitions/back-references-list.d.ts +0 -2
- package/lib/src/unit-definitions/back-references-list.js +0 -38
- package/lib/src/unit-definitions/bool-checkbox.d.ts +0 -2
- package/lib/src/unit-definitions/bool-checkbox.js +0 -25
- package/lib/src/unit-definitions/bool.d.ts +0 -2
- package/lib/src/unit-definitions/bool.js +0 -22
- package/lib/src/unit-definitions/collection-count.d.ts +0 -2
- package/lib/src/unit-definitions/collection-count.js +0 -32
- package/lib/src/unit-definitions/color-input.d.ts +0 -2
- package/lib/src/unit-definitions/color-input.js +0 -21
- package/lib/src/unit-definitions/comments-list.d.ts +0 -2
- package/lib/src/unit-definitions/comments-list.js +0 -25
- package/lib/src/unit-definitions/date-range-combobox.d.ts +0 -2
- package/lib/src/unit-definitions/date-range-combobox.js +0 -22
- package/lib/src/unit-definitions/date-range.d.ts +0 -2
- package/lib/src/unit-definitions/date-range.js +0 -22
- package/lib/src/unit-definitions/date-time-combobox.d.ts +0 -2
- package/lib/src/unit-definitions/date-time-combobox.js +0 -22
- package/lib/src/unit-definitions/date.d.ts +0 -2
- package/lib/src/unit-definitions/date.js +0 -22
- package/lib/src/unit-definitions/email-input.d.ts +0 -2
- package/lib/src/unit-definitions/email-input.js +0 -12
- package/lib/src/unit-definitions/email.d.ts +0 -2
- package/lib/src/unit-definitions/email.js +0 -17
- package/lib/src/unit-definitions/emoji.d.ts +0 -2
- package/lib/src/unit-definitions/emoji.js +0 -17
- package/lib/src/unit-definitions/file-collection-count.d.ts +0 -2
- package/lib/src/unit-definitions/file-collection-count.js +0 -32
- package/lib/src/unit-definitions/file-compact-collection.d.ts +0 -2
- package/lib/src/unit-definitions/file-compact-collection.js +0 -32
- package/lib/src/unit-definitions/file-compact-reference.d.ts +0 -2
- package/lib/src/unit-definitions/file-compact-reference.js +0 -37
- package/lib/src/unit-definitions/file-reference.d.ts +0 -2
- package/lib/src/unit-definitions/file-reference.js +0 -28
- package/lib/src/unit-definitions/files-gallery.d.ts +0 -2
- package/lib/src/unit-definitions/files-gallery.js +0 -32
- package/lib/src/unit-definitions/files-l-list-item.d.ts +0 -2
- package/lib/src/unit-definitions/files-l-list-item.js +0 -28
- package/lib/src/unit-definitions/files-l-list.d.ts +0 -2
- package/lib/src/unit-definitions/files-l-list.js +0 -32
- package/lib/src/unit-definitions/files-list-item.d.ts +0 -2
- package/lib/src/unit-definitions/files-list-item.js +0 -28
- package/lib/src/unit-definitions/files-list.d.ts +0 -2
- package/lib/src/unit-definitions/files-list.js +0 -32
- package/lib/src/unit-definitions/geometry-preview.d.ts +0 -2
- package/lib/src/unit-definitions/geometry-preview.js +0 -17
- package/lib/src/unit-definitions/icon-button.d.ts +0 -2
- package/lib/src/unit-definitions/icon-button.js +0 -29
- package/lib/src/unit-definitions/icon-input.d.ts +0 -2
- package/lib/src/unit-definitions/icon-input.js +0 -12
- package/lib/src/unit-definitions/id.d.ts +0 -2
- package/lib/src/unit-definitions/id.js +0 -29
- package/lib/src/unit-definitions/index.d.ts +0 -27
- package/lib/src/unit-definitions/index.js +0 -57
- package/lib/src/unit-definitions/json-input.d.ts +0 -2
- package/lib/src/unit-definitions/json-input.js +0 -21
- package/lib/src/unit-definitions/location-input.d.ts +0 -2
- package/lib/src/unit-definitions/location-input.js +0 -18
- package/lib/src/unit-definitions/location.d.ts +0 -2
- package/lib/src/unit-definitions/location.js +0 -17
- package/lib/src/unit-definitions/not-found.d.ts +0 -2
- package/lib/src/unit-definitions/not-found.js +0 -24
- package/lib/src/unit-definitions/number-input.d.ts +0 -2
- package/lib/src/unit-definitions/number-input.js +0 -22
- package/lib/src/unit-definitions/number.d.ts +0 -2
- package/lib/src/unit-definitions/number.js +0 -25
- package/lib/src/unit-definitions/phone-input.d.ts +0 -2
- package/lib/src/unit-definitions/phone-input.js +0 -12
- package/lib/src/unit-definitions/phone.d.ts +0 -2
- package/lib/src/unit-definitions/phone.js +0 -12
- package/lib/src/unit-definitions/progress-bar.d.ts +0 -2
- package/lib/src/unit-definitions/progress-bar.js +0 -29
- package/lib/src/unit-definitions/reference-collection-combobox.d.ts +0 -2
- package/lib/src/unit-definitions/reference-collection-combobox.js +0 -21
- package/lib/src/unit-definitions/reference-collection-list.d.ts +0 -2
- package/lib/src/unit-definitions/reference-collection-list.js +0 -22
- package/lib/src/unit-definitions/reference-collection-view.d.ts +0 -2
- package/lib/src/unit-definitions/reference-collection-view.js +0 -19
- package/lib/src/unit-definitions/reference-collection.d.ts +0 -2
- package/lib/src/unit-definitions/reference-collection.js +0 -28
- package/lib/src/unit-definitions/reference-combobox.d.ts +0 -2
- package/lib/src/unit-definitions/reference-combobox.js +0 -21
- package/lib/src/unit-definitions/reference-icon.d.ts +0 -2
- package/lib/src/unit-definitions/reference-icon.js +0 -12
- package/lib/src/unit-definitions/reference.d.ts +0 -2
- package/lib/src/unit-definitions/reference.js +0 -61
- package/lib/src/unit-definitions/rich-text-document.d.ts +0 -2
- package/lib/src/unit-definitions/rich-text-document.js +0 -22
- package/lib/src/unit-definitions/rich-text-snippet.d.ts +0 -3
- package/lib/src/unit-definitions/rich-text-snippet.js +0 -34
- package/lib/src/unit-definitions/single-location-preview.d.ts +0 -2
- package/lib/src/unit-definitions/single-location-preview.js +0 -17
- package/lib/src/unit-definitions/text-input.d.ts +0 -2
- package/lib/src/unit-definitions/text-input.js +0 -22
- package/lib/src/unit-definitions/text.d.ts +0 -2
- package/lib/src/unit-definitions/text.js +0 -22
- package/lib/src/unit-definitions/title-input.d.ts +0 -2
- package/lib/src/unit-definitions/title-input.js +0 -16
- package/lib/src/unit-definitions/title.d.ts +0 -2
- package/lib/src/unit-definitions/title.js +0 -34
- package/lib/src/unit-definitions/type-badge-abbr.d.ts +0 -2
- package/lib/src/unit-definitions/type-badge-abbr.js +0 -25
- package/lib/src/unit-definitions/type-badge.d.ts +0 -2
- package/lib/src/unit-definitions/type-badge.js +0 -25
- package/lib/src/unit-definitions/type-icon.d.ts +0 -2
- package/lib/src/unit-definitions/type-icon.js +0 -25
- package/lib/src/unit-definitions/url-input.d.ts +0 -2
- package/lib/src/unit-definitions/url-input.js +0 -12
- package/lib/src/unit-definitions/url.d.ts +0 -2
- package/lib/src/unit-definitions/url.js +0 -17
- package/lib/src/unit-definitions/user-button.d.ts +0 -2
- package/lib/src/unit-definitions/user-button.js +0 -23
- package/lib/src/unit-definitions/user-role-input.d.ts +0 -2
- package/lib/src/unit-definitions/user-role-input.js +0 -12
- package/lib/src/unit-definitions/user-role.d.ts +0 -2
- package/lib/src/unit-definitions/user-role.js +0 -29
- package/lib/src/unit-utils/access.d.ts +0 -9
- package/lib/src/unit-utils/access.js +0 -14
- package/lib/src/unit-utils/can-edit-field.d.ts +0 -6
- package/lib/src/unit-utils/can-edit-field.js +0 -8
- package/lib/src/unit-utils/common.d.ts +0 -14
- package/lib/src/unit-utils/common.js +0 -43
- package/lib/src/unit-utils/decimal.d.ts +0 -42
- package/lib/src/unit-utils/decimal.js +0 -418
- package/lib/src/unit-utils/dynamic-keys.d.ts +0 -7
- package/lib/src/unit-utils/dynamic-keys.js +0 -13
- package/lib/src/unit-utils/enums.d.ts +0 -27
- package/lib/src/unit-utils/enums.js +0 -69
- package/lib/src/unit-utils/formatters.d.ts +0 -50
- package/lib/src/unit-utils/formatters.js +0 -163
- package/lib/src/unit-utils/get-export-value.d.ts +0 -45
- package/lib/src/unit-utils/get-export-value.js +0 -83
- package/lib/src/unit-utils/get-field-label.d.ts +0 -6
- package/lib/src/unit-utils/get-field-label.js +0 -10
- package/lib/src/unit-utils/get-unmatched-unit-label.d.ts +0 -2
- package/lib/src/unit-utils/get-unmatched-unit-label.js +0 -9
- package/lib/src/unit-utils/schema.d.ts +0 -4
- package/lib/src/unit-utils/schema.js +0 -12
- package/lib/src/unit-utils/wrap-normalized-in-expression.d.ts +0 -3
- package/lib/src/unit-utils/wrap-normalized-in-expression.js +0 -14
- package/lib/src/units/board.d.ts +0 -46
- package/lib/src/units/board.js +0 -51
- package/lib/src/units/canvas/all-units-data-definitions.d.ts +0 -18
- package/lib/src/units/canvas/all-units-data-definitions.js +0 -40
- package/lib/src/units/canvas/index.d.ts +0 -45
- package/lib/src/units/canvas/index.js +0 -48
- package/lib/src/units/canvas/type-badge-abbr.d.ts +0 -36
- package/lib/src/units/canvas/type-badge-abbr.js +0 -11
- package/lib/src/units/canvas/type-badge.d.ts +0 -36
- package/lib/src/units/canvas/type-badge.js +0 -11
- package/lib/src/units/default.d.ts +0 -46
- package/lib/src/units/default.js +0 -51
- package/lib/src/units/gallery.d.ts +0 -3
- package/lib/src/units/gallery.js +0 -18
- package/lib/src/units/gantt.d.ts +0 -47
- package/lib/src/units/gantt.js +0 -59
- package/lib/src/units/get-unit-definitions-for-view-type.d.ts +0 -2
- package/lib/src/units/get-unit-definitions-for-view-type.js +0 -64
- package/lib/src/units/grid.d.ts +0 -45
- package/lib/src/units/grid.js +0 -71
- package/lib/src/units/list.d.ts +0 -46
- package/lib/src/units/list.js +0 -49
- package/lib/src/units/make-factory.d.ts +0 -51
- package/lib/src/units/make-factory.js +0 -260
- package/lib/src/units/types.d.ts +0 -73
- package/lib/src/units/types.js +0 -2
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __exportAll = (all, no_symbols) => {
|
|
4
|
+
let target = {};
|
|
5
|
+
for (var name in all) __defProp(target, name, {
|
|
6
|
+
get: all[name],
|
|
7
|
+
enumerable: true
|
|
8
|
+
});
|
|
9
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
10
|
+
return target;
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { __exportAll };
|
package/lib/errors.d.ts
ADDED
package/lib/errors.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { FieldObject, TypeObject } from "@fibery/schema";
|
|
2
|
+
//#region src/field-utils/avatar.d.ts
|
|
3
|
+
declare const AVATAR_MIXIN_NAME = "avatar/avatar-mixin";
|
|
4
|
+
declare const AVATAR_EXTENSION_FIELD = "avatar/avatars";
|
|
5
|
+
declare const isAvatarExtensionEnabledType: (typeObject: TypeObject) => boolean;
|
|
6
|
+
declare const isAvatarExtensionField: (fieldObject: FieldObject) => boolean;
|
|
7
|
+
declare const getAvatarSelect: (fieldObject: FieldObject) => import("@fibery/expression-utils").Select;
|
|
8
|
+
declare const getAvatarSelectQuery: ({ typeObject }: {
|
|
9
|
+
typeObject: TypeObject;
|
|
10
|
+
}) => {
|
|
11
|
+
[x: string]: "__NOTHING_INTERESTING__TitleField__" | "fibery/id" | {
|
|
12
|
+
"q/from": string[];
|
|
13
|
+
"q/limit": string;
|
|
14
|
+
"q/select": import("@fibery/expression-utils").Select;
|
|
15
|
+
};
|
|
16
|
+
"fibery/id": "fibery/id";
|
|
17
|
+
__NOTHING_INTERESTING__TitleField__: "__NOTHING_INTERESTING__TitleField__";
|
|
18
|
+
} | {
|
|
19
|
+
"fibery/id"?: undefined;
|
|
20
|
+
__NOTHING_INTERESTING__TitleField__?: undefined;
|
|
21
|
+
};
|
|
22
|
+
//#endregion
|
|
23
|
+
export { AVATAR_EXTENSION_FIELD, AVATAR_MIXIN_NAME, getAvatarSelect, getAvatarSelectQuery, isAvatarExtensionEnabledType, isAvatarExtensionField };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { truthy } from "@fibery/helpers/src/_";
|
|
2
|
+
import { toSelectMapClause } from "@fibery/query-utils/src/select";
|
|
3
|
+
//#region src/field-utils/avatar.ts
|
|
4
|
+
const AVATAR_MIXIN_NAME = "avatar/avatar-mixin";
|
|
5
|
+
const AVATAR_EXTENSION_FIELD = "avatar/avatars";
|
|
6
|
+
const isAvatarExtensionEnabledType = (typeObject) => {
|
|
7
|
+
return typeObject && typeObject.installedMixins.has("avatar/avatar-mixin") && isAvatarExtensionField(typeObject.fieldObjectsByName["avatar/avatars"]);
|
|
8
|
+
};
|
|
9
|
+
const isAvatarExtensionField = (fieldObject) => {
|
|
10
|
+
return fieldObject.name === "avatar/avatars" && fieldObject.type === "fibery/file";
|
|
11
|
+
};
|
|
12
|
+
const getAvatarSelect = (fieldObject) => toSelectMapClause([
|
|
13
|
+
fieldObject.typeObject.idField,
|
|
14
|
+
fieldObject.typeObject.titleField,
|
|
15
|
+
"fibery/content-type",
|
|
16
|
+
"fibery/secret"
|
|
17
|
+
].filter(truthy));
|
|
18
|
+
const getAvatarSelectQuery = ({ typeObject }) => {
|
|
19
|
+
if (isAvatarExtensionEnabledType(typeObject)) {
|
|
20
|
+
const fieldObject = typeObject.fieldObjectsByName[AVATAR_EXTENSION_FIELD];
|
|
21
|
+
const idField = fieldObject.typeObject.idField;
|
|
22
|
+
const typeTitleField = typeObject.titleField;
|
|
23
|
+
return {
|
|
24
|
+
[idField]: idField,
|
|
25
|
+
[typeTitleField]: typeTitleField,
|
|
26
|
+
[fieldObject.name]: {
|
|
27
|
+
"q/from": [fieldObject.name],
|
|
28
|
+
"q/limit": "q/no-limit",
|
|
29
|
+
"q/select": getAvatarSelect(fieldObject)
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
} else return {};
|
|
33
|
+
};
|
|
34
|
+
//#endregion
|
|
35
|
+
export { AVATAR_EXTENSION_FIELD, AVATAR_MIXIN_NAME, getAvatarSelect, getAvatarSelectQuery, isAvatarExtensionEnabledType, isAvatarExtensionField };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FieldObject, TypeObject } from "@fibery/schema";
|
|
2
|
+
//#region src/field-utils/back-references.d.ts
|
|
3
|
+
declare const isReferenceExtensionField: (fieldObject: FieldObject) => boolean;
|
|
4
|
+
declare const getEntityLinksListSelect: (typeObject: TypeObject) => {
|
|
5
|
+
"fibery/id": "fibery/id";
|
|
6
|
+
"fibery/creation-date": string;
|
|
7
|
+
"Collaboration~Documents/ParagraphSecret": string;
|
|
8
|
+
"Collaboration~Documents/FromTypeId": string;
|
|
9
|
+
"Collaboration~Documents/FromEntityId": string;
|
|
10
|
+
"Collaboration~Documents/FromEntityField": {
|
|
11
|
+
"fibery/id": string[];
|
|
12
|
+
};
|
|
13
|
+
"fibery/created-by": {
|
|
14
|
+
"fibery/id": string[];
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
//#endregion
|
|
18
|
+
export { getEntityLinksListSelect, isReferenceExtensionField };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/field-utils/back-references.ts
|
|
2
|
+
const isReferenceExtensionField = (fieldObject) => fieldObject.type === "Collaboration~Documents/Reference";
|
|
3
|
+
const getEntityLinksListSelect = (typeObject) => {
|
|
4
|
+
return {
|
|
5
|
+
[typeObject.idField]: typeObject.idField,
|
|
6
|
+
"fibery/creation-date": "fibery/creation-date",
|
|
7
|
+
"Collaboration~Documents/ParagraphSecret": "Collaboration~Documents/ParagraphSecret",
|
|
8
|
+
"Collaboration~Documents/FromTypeId": "Collaboration~Documents/FromTypeId",
|
|
9
|
+
"Collaboration~Documents/FromEntityId": "Collaboration~Documents/FromEntityId",
|
|
10
|
+
"Collaboration~Documents/FromEntityField": { "fibery/id": ["Collaboration~Documents/FromEntityField", "fibery/id"] },
|
|
11
|
+
"fibery/created-by": { "fibery/id": ["fibery/created-by", "fibery/id"] }
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { getEntityLinksListSelect, isReferenceExtensionField };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { accessCheckKey } from "../unit-utils/access.js";
|
|
2
|
+
import { FieldObject, TypeObject } from "@fibery/schema";
|
|
3
|
+
//#region src/field-utils/comments.d.ts
|
|
4
|
+
declare const isCommentExtensionField: (fieldObject: FieldObject) => boolean;
|
|
5
|
+
declare const getCommentsListSelect: (typeObject: TypeObject) => {
|
|
6
|
+
"fibery/id": "fibery/id";
|
|
7
|
+
"fibery/public-id": "fibery/public-id";
|
|
8
|
+
"fibery/creation-date": string;
|
|
9
|
+
"comment/document-secret": string;
|
|
10
|
+
"comments/parent": {
|
|
11
|
+
"fibery/id": string[];
|
|
12
|
+
};
|
|
13
|
+
"fibery/created-by": {
|
|
14
|
+
[accessCheckKey]: (string | string[])[];
|
|
15
|
+
"fibery/id": string[];
|
|
16
|
+
"user/email": string[];
|
|
17
|
+
"user/name": string[];
|
|
18
|
+
"avatar/avatars": {
|
|
19
|
+
"q/from": string[];
|
|
20
|
+
"q/limit": string;
|
|
21
|
+
"q/select": {
|
|
22
|
+
"fibery/id": string[];
|
|
23
|
+
"fibery/name": string[];
|
|
24
|
+
"fibery/content-type": string[];
|
|
25
|
+
"fibery/secret": string[];
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
declare const getQuerySelect: (fieldObject: FieldObject) => {
|
|
31
|
+
[x: string]: {
|
|
32
|
+
"q/from": string[];
|
|
33
|
+
"q/select": {
|
|
34
|
+
"fibery/id": "fibery/id";
|
|
35
|
+
"fibery/public-id": "fibery/public-id";
|
|
36
|
+
"fibery/creation-date": string;
|
|
37
|
+
"comment/document-secret": string;
|
|
38
|
+
"comments/parent": {
|
|
39
|
+
"fibery/id": string[];
|
|
40
|
+
};
|
|
41
|
+
"fibery/created-by": {
|
|
42
|
+
[accessCheckKey]: (string | string[])[];
|
|
43
|
+
"fibery/id": string[];
|
|
44
|
+
"user/email": string[];
|
|
45
|
+
"user/name": string[];
|
|
46
|
+
"avatar/avatars": {
|
|
47
|
+
"q/from": string[];
|
|
48
|
+
"q/limit": string;
|
|
49
|
+
"q/select": {
|
|
50
|
+
"fibery/id": string[];
|
|
51
|
+
"fibery/name": string[];
|
|
52
|
+
"fibery/content-type": string[];
|
|
53
|
+
"fibery/secret": string[];
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
"q/order-by": import("@fibery/expression-utils").OrderBy | undefined;
|
|
59
|
+
"q/limit": string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
//#endregion
|
|
63
|
+
export { getCommentsListSelect, getQuerySelect, isCommentExtensionField };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { accessCheckKey } from "../unit-utils/access.js";
|
|
2
|
+
import { calculateDefaultOrderBy } from "@fibery/query-utils/src/query";
|
|
3
|
+
//#region src/field-utils/comments.ts
|
|
4
|
+
const isCommentExtensionField = (fieldObject) => fieldObject.name === "comments/comments";
|
|
5
|
+
const getCommentsListSelect = (typeObject) => {
|
|
6
|
+
return {
|
|
7
|
+
[typeObject.idField]: typeObject.idField,
|
|
8
|
+
[typeObject.publicIdField]: typeObject.publicIdField,
|
|
9
|
+
"fibery/creation-date": "fibery/creation-date",
|
|
10
|
+
"comment/document-secret": "comment/document-secret",
|
|
11
|
+
"comments/parent": { "fibery/id": ["comments/parent", "fibery/id"] },
|
|
12
|
+
"fibery/created-by": {
|
|
13
|
+
[accessCheckKey]: ["q/access?", ["fibery/created-by", "user/name"]],
|
|
14
|
+
"fibery/id": ["fibery/created-by", "fibery/id"],
|
|
15
|
+
"user/email": ["fibery/created-by", "user/email"],
|
|
16
|
+
"user/name": ["fibery/created-by", "user/name"],
|
|
17
|
+
"avatar/avatars": {
|
|
18
|
+
"q/from": ["fibery/created-by", "avatar/avatars"],
|
|
19
|
+
"q/limit": "q/no-limit",
|
|
20
|
+
"q/select": {
|
|
21
|
+
"fibery/id": ["fibery/id"],
|
|
22
|
+
"fibery/name": ["fibery/name"],
|
|
23
|
+
"fibery/content-type": ["fibery/content-type"],
|
|
24
|
+
"fibery/secret": ["fibery/secret"]
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
const getQuerySelect = (fieldObject) => {
|
|
31
|
+
const { name, typeObject } = fieldObject;
|
|
32
|
+
const orderBy = calculateDefaultOrderBy({ typeObject });
|
|
33
|
+
return { [name]: {
|
|
34
|
+
"q/from": [name],
|
|
35
|
+
"q/select": getCommentsListSelect(typeObject),
|
|
36
|
+
"q/order-by": orderBy,
|
|
37
|
+
"q/limit": "q/no-limit"
|
|
38
|
+
} };
|
|
39
|
+
};
|
|
40
|
+
//#endregion
|
|
41
|
+
export { getCommentsListSelect, getQuerySelect, isCommentExtensionField };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Moment, MomentInput, unitOfTime } from "moment/moment";
|
|
2
|
+
//#region src/field-utils/date-time.d.ts
|
|
3
|
+
declare const parseDate: (isoDate: MomentInput) => Moment;
|
|
4
|
+
declare const serializeDate: (momentDate: Moment) => string;
|
|
5
|
+
declare const parseDateTime: (isoDateTime: MomentInput) => Moment;
|
|
6
|
+
declare const serializeDateTime: (momentDate: Moment) => string;
|
|
7
|
+
declare const parseStart: ({ value, type }: {
|
|
8
|
+
value: MomentInput;
|
|
9
|
+
type: string;
|
|
10
|
+
}) => Moment;
|
|
11
|
+
declare const parseEnd: ({ value, type, minimumDelta }: {
|
|
12
|
+
value: MomentInput;
|
|
13
|
+
type: string;
|
|
14
|
+
minimumDelta?: [number, unitOfTime.DurationConstructor] | null;
|
|
15
|
+
}) => Moment;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { parseDate, parseDateTime, parseEnd, parseStart, serializeDate, serializeDateTime };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { isDateTimeType, isDateType, isRangeType } from "@fibery/expression-utils/src/utils";
|
|
2
|
+
import { NotImplementedError } from "@fibery/expression-utils/src/errors";
|
|
3
|
+
import moment from "moment/moment.js";
|
|
4
|
+
//#region src/field-utils/date-time.ts
|
|
5
|
+
const defaultDateDelta = [1, "day"];
|
|
6
|
+
const defaultDateTimeDelta = [1, "second"];
|
|
7
|
+
const parseDate = (isoDate) => {
|
|
8
|
+
return moment(isoDate).set({ hour: 12 });
|
|
9
|
+
};
|
|
10
|
+
const serializeDate = (momentDate) => {
|
|
11
|
+
return momentDate.format("YYYY-MM-DD");
|
|
12
|
+
};
|
|
13
|
+
const parseDateTime = (isoDateTime) => {
|
|
14
|
+
return moment.utc(isoDateTime).local();
|
|
15
|
+
};
|
|
16
|
+
const serializeDateTime = (momentDate) => {
|
|
17
|
+
return momentDate.toISOString();
|
|
18
|
+
};
|
|
19
|
+
const parseStart = ({ value, type }) => {
|
|
20
|
+
if (isDateType(type)) return parseDate(value).startOf("day");
|
|
21
|
+
if (isDateTimeType(type)) return parseDateTime(value).startOf("second");
|
|
22
|
+
throw new NotImplementedError(type);
|
|
23
|
+
};
|
|
24
|
+
const parseEnd = ({ value, type, minimumDelta = null }) => {
|
|
25
|
+
if (isDateType(type)) if (isRangeType(type)) return parseDate(value).subtract(...minimumDelta || defaultDateDelta).endOf("day");
|
|
26
|
+
else return parseDate(value).endOf("day");
|
|
27
|
+
if (isDateTimeType(type)) return parseDateTime(value).subtract(...minimumDelta || defaultDateTimeDelta).startOf("second");
|
|
28
|
+
throw new NotImplementedError(type);
|
|
29
|
+
};
|
|
30
|
+
//#endregion
|
|
31
|
+
export { parseDate, parseDateTime, parseEnd, parseStart, serializeDate, serializeDateTime };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { NumberFormat } from "./number.js";
|
|
2
|
+
import { FieldObject, TypeObject } from "@fibery/schema";
|
|
3
|
+
//#region src/field-utils/enum-value.d.ts
|
|
4
|
+
declare const enumNumberFieldName = "Value";
|
|
5
|
+
declare const getEnumNumberFieldName: (namespace: string) => string;
|
|
6
|
+
declare const defaultEnumNumberFieldMeta: {
|
|
7
|
+
numberFormat: NumberFormat;
|
|
8
|
+
numberPrecision: number;
|
|
9
|
+
numberUnit: null;
|
|
10
|
+
numberCurrencyCode: null;
|
|
11
|
+
numberUseThousandSeparator: boolean;
|
|
12
|
+
};
|
|
13
|
+
declare const getIsNumberFieldObjectTaken: (typeObject: TypeObject) => boolean;
|
|
14
|
+
declare const getNumberFieldObject: (typeObject: TypeObject) => FieldObject | undefined;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { defaultEnumNumberFieldMeta, enumNumberFieldName, getEnumNumberFieldName, getIsNumberFieldObjectTaken, getNumberFieldObject };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import "./number.js";
|
|
2
|
+
//#region src/field-utils/enum-value.ts
|
|
3
|
+
const enumNumberFieldName = "Value";
|
|
4
|
+
const getEnumNumberFieldName = (namespace) => `${namespace}/${enumNumberFieldName}`;
|
|
5
|
+
const defaultEnumNumberFieldMeta = {
|
|
6
|
+
numberFormat: "Number",
|
|
7
|
+
numberPrecision: 0,
|
|
8
|
+
numberUnit: null,
|
|
9
|
+
numberCurrencyCode: null,
|
|
10
|
+
numberUseThousandSeparator: true
|
|
11
|
+
};
|
|
12
|
+
const isNumeric = (fieldObject) => {
|
|
13
|
+
return fieldObject.type === "fibery/int" || fieldObject.type === "fibery/decimal";
|
|
14
|
+
};
|
|
15
|
+
const getIsNumberFieldObjectTaken = (typeObject) => {
|
|
16
|
+
return Boolean(typeObject.fieldObjects.find((fieldObject) => {
|
|
17
|
+
return fieldObject.nameParts.name === "Value" && !isNumeric(fieldObject);
|
|
18
|
+
}));
|
|
19
|
+
};
|
|
20
|
+
const getNumberFieldObject = (typeObject) => {
|
|
21
|
+
return typeObject.fieldObjects.find((fieldObject) => {
|
|
22
|
+
return fieldObject.nameParts.name === "Value" && isNumeric(fieldObject);
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
//#endregion
|
|
26
|
+
export { defaultEnumNumberFieldMeta, enumNumberFieldName, getEnumNumberFieldName, getIsNumberFieldObjectTaken, getNumberFieldObject };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { truthy } from "@fibery/helpers/src/_";
|
|
2
|
+
import { toSelectMapClause } from "@fibery/query-utils/src/select";
|
|
3
|
+
//#region src/field-utils/file.ts
|
|
4
|
+
const getFilesSelect = ({ typeObject }) => toSelectMapClause([
|
|
5
|
+
typeObject.idField,
|
|
6
|
+
typeObject.titleField,
|
|
7
|
+
"fibery/creation-date",
|
|
8
|
+
"fibery/content-type",
|
|
9
|
+
"fibery/content-length",
|
|
10
|
+
"fibery/secret",
|
|
11
|
+
"fibery/rank"
|
|
12
|
+
].filter(truthy));
|
|
13
|
+
//#endregion
|
|
14
|
+
export { getFilesSelect };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FieldObject, TypeObject } from "@fibery/schema";
|
|
2
|
+
//#region src/field-utils/icon.d.ts
|
|
3
|
+
declare const ICON_MIXIN_NAME = "icon/icon-mixin";
|
|
4
|
+
declare const ICON_EXTENSION_FIELD = "icon/icon";
|
|
5
|
+
declare const isIconExtensionEnabledType: (typeObject: TypeObject) => boolean;
|
|
6
|
+
declare const isIconExtensionField: (fieldObject: FieldObject) => boolean;
|
|
7
|
+
declare const getEntityIconSelect: ({ typeObject }: {
|
|
8
|
+
typeObject: TypeObject;
|
|
9
|
+
}) => {
|
|
10
|
+
[x: string]: string;
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { ICON_EXTENSION_FIELD, ICON_MIXIN_NAME, getEntityIconSelect, isIconExtensionEnabledType, isIconExtensionField };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//#region src/field-utils/icon.ts
|
|
2
|
+
const ICON_MIXIN_NAME = "icon/icon-mixin";
|
|
3
|
+
const ICON_EXTENSION_FIELD = "icon/icon";
|
|
4
|
+
const isIconExtensionEnabledType = (typeObject) => {
|
|
5
|
+
return typeObject.installedMixins.has("icon/icon-mixin") && isIconExtensionField(typeObject.fieldObjectsByName["icon/icon"]);
|
|
6
|
+
};
|
|
7
|
+
const isIconExtensionField = (fieldObject) => {
|
|
8
|
+
return fieldObject.name === "icon/icon" && fieldObject.type === "fibery/emoji";
|
|
9
|
+
};
|
|
10
|
+
const getEntityIconSelect = ({ typeObject }) => {
|
|
11
|
+
if (isIconExtensionEnabledType(typeObject)) {
|
|
12
|
+
const fieldObject = typeObject.fieldObjectsByName[ICON_EXTENSION_FIELD];
|
|
13
|
+
return { [fieldObject.name]: fieldObject.name };
|
|
14
|
+
} else return {};
|
|
15
|
+
};
|
|
16
|
+
//#endregion
|
|
17
|
+
export { ICON_EXTENSION_FIELD, ICON_MIXIN_NAME, getEntityIconSelect, isIconExtensionEnabledType, isIconExtensionField };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { FieldObject } from "@fibery/schema";
|
|
2
|
+
//#region src/field-utils/number.d.ts
|
|
3
|
+
declare enum NumberFormat {
|
|
4
|
+
NUMBER = "Number",
|
|
5
|
+
MONEY = "Money",
|
|
6
|
+
PERCENT = "Percent"
|
|
7
|
+
}
|
|
8
|
+
type NumberDisplaySettings = {
|
|
9
|
+
thousandSeparator: string;
|
|
10
|
+
decimalSeparator: string;
|
|
11
|
+
};
|
|
12
|
+
type NumberFieldMeta = {
|
|
13
|
+
numberFormat: NumberFormat;
|
|
14
|
+
numberPrecision: number;
|
|
15
|
+
numberUnit: string | null;
|
|
16
|
+
numberCurrencyCode: string | null;
|
|
17
|
+
numberUseThousandSeparator: boolean;
|
|
18
|
+
};
|
|
19
|
+
declare const getDefaultCurrencyCode: (numberFormat: NumberFormat) => "USD" | null;
|
|
20
|
+
declare const getDefaultPrecision: (numberFormat: NumberFormat) => 0 | 2;
|
|
21
|
+
declare const getInitialNumberFieldMeta: () => NumberFieldMeta;
|
|
22
|
+
declare const externalizePrecision: (numberFormat: NumberFormat, numberPrecision: number) => number;
|
|
23
|
+
declare function getNumberFormatOrDefault(numberFormat: NumberFormat | undefined): NumberFormat;
|
|
24
|
+
declare const parseNumberMeta: ({ rawNumberPrecision, rawNumberUnit, rawNumberCurrencyCode, rawNumberUseThousandSeparator, rawNumberFormat, fieldType }: {
|
|
25
|
+
rawNumberPrecision: unknown;
|
|
26
|
+
rawNumberUnit: unknown;
|
|
27
|
+
rawNumberCurrencyCode: unknown;
|
|
28
|
+
rawNumberUseThousandSeparator: unknown;
|
|
29
|
+
rawNumberFormat: unknown;
|
|
30
|
+
fieldType: string;
|
|
31
|
+
}) => NumberFieldMeta;
|
|
32
|
+
declare const parseNumberFieldMeta: (fieldObject: FieldObject) => NumberFieldMeta;
|
|
33
|
+
//#endregion
|
|
34
|
+
export { NumberDisplaySettings, NumberFieldMeta, NumberFormat, externalizePrecision, getDefaultCurrencyCode, getDefaultPrecision, getInitialNumberFieldMeta, getNumberFormatOrDefault, parseNumberFieldMeta, parseNumberMeta };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import curry from "lodash/curry.js";
|
|
2
|
+
import flow from "lodash/flow.js";
|
|
3
|
+
//#region src/field-utils/number.ts
|
|
4
|
+
let NumberFormat = /* @__PURE__ */ function(NumberFormat) {
|
|
5
|
+
NumberFormat["NUMBER"] = "Number";
|
|
6
|
+
NumberFormat["MONEY"] = "Money";
|
|
7
|
+
NumberFormat["PERCENT"] = "Percent";
|
|
8
|
+
return NumberFormat;
|
|
9
|
+
}({});
|
|
10
|
+
const DEFAULT_NUMBER_FORMAT = "Number";
|
|
11
|
+
const getDefaultCurrencyCode = (numberFormat) => {
|
|
12
|
+
if (numberFormat === "Money") return "USD";
|
|
13
|
+
return null;
|
|
14
|
+
};
|
|
15
|
+
const getDefaultPrecision = (numberFormat) => {
|
|
16
|
+
if (numberFormat === "Money") return 2;
|
|
17
|
+
return 0;
|
|
18
|
+
};
|
|
19
|
+
const getInitialNumberFieldMeta = () => {
|
|
20
|
+
return {
|
|
21
|
+
numberFormat: DEFAULT_NUMBER_FORMAT,
|
|
22
|
+
numberPrecision: getDefaultPrecision(DEFAULT_NUMBER_FORMAT),
|
|
23
|
+
numberUnit: null,
|
|
24
|
+
numberCurrencyCode: getDefaultCurrencyCode(DEFAULT_NUMBER_FORMAT),
|
|
25
|
+
numberUseThousandSeparator: true
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
const parsePrecisionWithBackwardCompatibility = (fieldType) => (rawNumberPrecision) => {
|
|
29
|
+
return fieldType === "fibery/int" ? 0 : Number(rawNumberPrecision) || 1;
|
|
30
|
+
};
|
|
31
|
+
const internalizePrecision = curry((numberFormat, numberPrecision) => {
|
|
32
|
+
if (numberFormat === "Percent") return numberPrecision - 2;
|
|
33
|
+
return numberPrecision;
|
|
34
|
+
});
|
|
35
|
+
const externalizePrecision = (numberFormat, numberPrecision) => {
|
|
36
|
+
if (numberFormat === "Percent") return numberPrecision + 2;
|
|
37
|
+
return numberPrecision;
|
|
38
|
+
};
|
|
39
|
+
function getNumberFormatOrDefault(numberFormat) {
|
|
40
|
+
return numberFormat || DEFAULT_NUMBER_FORMAT;
|
|
41
|
+
}
|
|
42
|
+
const parseNumberMeta = ({ rawNumberPrecision, rawNumberUnit, rawNumberCurrencyCode, rawNumberUseThousandSeparator, rawNumberFormat, fieldType }) => {
|
|
43
|
+
const numberFormat = getNumberFormatOrDefault(rawNumberFormat);
|
|
44
|
+
return {
|
|
45
|
+
numberFormat,
|
|
46
|
+
numberPrecision: flow([parsePrecisionWithBackwardCompatibility(fieldType), internalizePrecision(numberFormat)])(rawNumberPrecision),
|
|
47
|
+
numberUnit: rawNumberUnit || null,
|
|
48
|
+
numberCurrencyCode: numberFormat === "Money" ? rawNumberCurrencyCode : null,
|
|
49
|
+
numberUseThousandSeparator: Boolean(rawNumberUseThousandSeparator)
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
const parseNumberFieldMeta = (fieldObject) => {
|
|
53
|
+
const { "ui/number-precision": rawNumberPrecision, "ui/number-unit": rawNumberUnit, "ui/number-currency-code": rawNumberCurrencyCode, "ui/number-thousand-separator?": rawNumberUseThousandSeparator, "ui/number-format": rawNumberFormat } = fieldObject.rawMeta;
|
|
54
|
+
return parseNumberMeta({
|
|
55
|
+
rawNumberPrecision,
|
|
56
|
+
rawNumberUnit,
|
|
57
|
+
rawNumberCurrencyCode,
|
|
58
|
+
rawNumberUseThousandSeparator,
|
|
59
|
+
rawNumberFormat,
|
|
60
|
+
fieldType: fieldObject.type
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
//#endregion
|
|
64
|
+
export { NumberFormat, externalizePrecision, getDefaultCurrencyCode, getDefaultPrecision, getInitialNumberFieldMeta, getNumberFormatOrDefault, parseNumberFieldMeta, parseNumberMeta };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FieldObject } from "@fibery/schema";
|
|
2
|
+
import { QueryLimit } from "@fibery/expression-utils/src/types";
|
|
3
|
+
//#region src/field-utils/reference-collection.d.ts
|
|
4
|
+
declare const REFERENCE_COLLECTION_LIMIT = 1000;
|
|
5
|
+
declare const makeCollectionCountExpression: (field: string | string[]) => (string | string[])[];
|
|
6
|
+
declare const getCountKey: (field: string) => string;
|
|
7
|
+
declare const getCollectionCountSelect: (field: string) => {
|
|
8
|
+
[x: string]: (string | string[])[];
|
|
9
|
+
};
|
|
10
|
+
declare const calculateReferenceCollectionQuery: ({ fieldObjects, expression, limit }: {
|
|
11
|
+
fieldObjects: FieldObject[];
|
|
12
|
+
expression: string[];
|
|
13
|
+
limit: QueryLimit;
|
|
14
|
+
}) => Record<string, unknown>;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { REFERENCE_COLLECTION_LIMIT, calculateReferenceCollectionQuery, getCollectionCountSelect, getCountKey, makeCollectionCountExpression };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { getAvatarSelectQuery } from "./avatar.js";
|
|
2
|
+
import { collectionCountKeyPrefix, makeDynamicKey } from "../unit-utils/dynamic-keys.js";
|
|
3
|
+
import { generateAccessCheckQueryExpression } from "../unit-utils/access.js";
|
|
4
|
+
import { getFilesSelect } from "./file.js";
|
|
5
|
+
import { getEntityIconSelect } from "./icon.js";
|
|
6
|
+
import { getEnumIconColorQuery } from "../unit-utils/enums.js";
|
|
7
|
+
import { truthy } from "@fibery/helpers/src/_";
|
|
8
|
+
import { mergeDenormalizedSelects, toSelectMapClause } from "@fibery/query-utils/src/select";
|
|
9
|
+
import last from "lodash/last.js";
|
|
10
|
+
//#region src/field-utils/reference-collection.ts
|
|
11
|
+
const REFERENCE_COLLECTION_LIMIT = 1e3;
|
|
12
|
+
const makeCollectionCountExpression = (field) => ["q/count", [...Array.isArray(field) ? field : [field], "fibery/id"]];
|
|
13
|
+
const getCountKey = (field) => makeDynamicKey(collectionCountKeyPrefix, field);
|
|
14
|
+
const getCollectionCountSelect = (field) => ({ [getCountKey(field)]: makeCollectionCountExpression(field) });
|
|
15
|
+
const calculateReferenceCollectionQuery = ({ fieldObjects, expression, limit }) => {
|
|
16
|
+
const fieldObject = last(fieldObjects);
|
|
17
|
+
if (!fieldObject) return {};
|
|
18
|
+
const collectionSubQuery = {
|
|
19
|
+
"q/from": expression,
|
|
20
|
+
"q/select": mergeDenormalizedSelects([
|
|
21
|
+
toSelectMapClause([
|
|
22
|
+
fieldObject.typeObject.idField,
|
|
23
|
+
fieldObject.typeObject.titleField,
|
|
24
|
+
fieldObject.typeObject.publicIdField
|
|
25
|
+
].filter(truthy)),
|
|
26
|
+
generateAccessCheckQueryExpression({ typeObject: fieldObject.typeObject }),
|
|
27
|
+
getAvatarSelectQuery({ typeObject: fieldObject.typeObject }),
|
|
28
|
+
getEntityIconSelect({ typeObject: fieldObject.typeObject }),
|
|
29
|
+
fieldObject.type === "fibery/file" && getFilesSelect(fieldObject),
|
|
30
|
+
getEnumIconColorQuery({ typeObject: fieldObject.typeObject })
|
|
31
|
+
].filter(truthy)),
|
|
32
|
+
"q/limit": limit
|
|
33
|
+
};
|
|
34
|
+
return [...expression].reverse().reduce((inner, field, reversedIndex) => {
|
|
35
|
+
const originalIndex = expression.length - 1 - reversedIndex;
|
|
36
|
+
if (!(originalIndex === expression.length - 1)) {
|
|
37
|
+
const pathToField = expression.slice(0, originalIndex + 1);
|
|
38
|
+
const { idField } = fieldObjects[originalIndex].typeObject;
|
|
39
|
+
const innerForField = idField ? {
|
|
40
|
+
[idField]: [...pathToField, idField],
|
|
41
|
+
...inner
|
|
42
|
+
} : { ...inner };
|
|
43
|
+
return { [field]: innerForField };
|
|
44
|
+
}
|
|
45
|
+
return { [field]: inner };
|
|
46
|
+
}, collectionSubQuery);
|
|
47
|
+
};
|
|
48
|
+
//#endregion
|
|
49
|
+
export { REFERENCE_COLLECTION_LIMIT, calculateReferenceCollectionQuery, getCollectionCountSelect, getCountKey, makeCollectionCountExpression };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FieldObject, TypeObject } from "@fibery/schema";
|
|
2
|
+
import { FieldExpression } from "@fibery/expression-utils";
|
|
3
|
+
import { Select } from "@fibery/expression-utils/src/types";
|
|
4
|
+
//#region src/field-utils/reference.d.ts
|
|
5
|
+
declare const getReferenceTypeSelectClause: ({ typeObject }: {
|
|
6
|
+
typeObject: TypeObject;
|
|
7
|
+
}, contextPath: FieldExpression) => Select;
|
|
8
|
+
declare const getReferenceFieldNormalizedSelectClause: (fieldObject: FieldObject, contextPath: FieldExpression) => any;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { getReferenceFieldNormalizedSelectClause, getReferenceTypeSelectClause };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { getAvatarSelectQuery } from "./avatar.js";
|
|
2
|
+
import { generateAccessCheckQueryExpression } from "../unit-utils/access.js";
|
|
3
|
+
import { getFilesSelect } from "./file.js";
|
|
4
|
+
import { getEntityIconSelect } from "./icon.js";
|
|
5
|
+
import { getEnumIconColorQuery } from "../unit-utils/enums.js";
|
|
6
|
+
import { getIsUserActiveSelect } from "./user-active.js";
|
|
7
|
+
import { getIsFinalStateSelect } from "./workflow.js";
|
|
8
|
+
import { truthy } from "@fibery/helpers/src/_";
|
|
9
|
+
import { isSelectForMultiFieldKey, normalizeSelect, toSelectMapClause } from "@fibery/query-utils/src/select";
|
|
10
|
+
//#region src/field-utils/reference.ts
|
|
11
|
+
const getReferenceTypeSelectClause = ({ typeObject }, contextPath) => {
|
|
12
|
+
return {
|
|
13
|
+
...toSelectMapClause([
|
|
14
|
+
typeObject.idField,
|
|
15
|
+
typeObject.publicIdField,
|
|
16
|
+
typeObject.titleField,
|
|
17
|
+
typeObject.rankField,
|
|
18
|
+
typeObject.name === "fibery/user" ? "user/email" : null
|
|
19
|
+
].filter(truthy)),
|
|
20
|
+
...generateAccessCheckQueryExpression({
|
|
21
|
+
typeObject,
|
|
22
|
+
contextPath
|
|
23
|
+
}),
|
|
24
|
+
...getIsFinalStateSelect({
|
|
25
|
+
typeObject,
|
|
26
|
+
contextPath
|
|
27
|
+
}),
|
|
28
|
+
...getIsUserActiveSelect({
|
|
29
|
+
typeObject,
|
|
30
|
+
contextPath
|
|
31
|
+
}),
|
|
32
|
+
...getEnumIconColorQuery({
|
|
33
|
+
typeObject,
|
|
34
|
+
contextPath
|
|
35
|
+
}),
|
|
36
|
+
...getAvatarSelectQuery({ typeObject }),
|
|
37
|
+
...getEntityIconSelect({ typeObject }),
|
|
38
|
+
...typeObject.name === "fibery/file" ? getFilesSelect({ typeObject }) : null
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
const getReferenceFieldNormalizedSelectClause = (fieldObject, contextPath) => {
|
|
42
|
+
const { typeObject } = fieldObject;
|
|
43
|
+
if (typeObject.isEntityRef) {
|
|
44
|
+
const pairs = fieldObject.multiRelatedFieldObjects.map((f) => {
|
|
45
|
+
const normalizedSelect = normalizeSelect(getReferenceTypeSelectClause({ typeObject: f.holderTypeObject }, [contextPath.concat(f.holderType)]));
|
|
46
|
+
return [f.holderType, {
|
|
47
|
+
...normalizedSelect,
|
|
48
|
+
[isSelectForMultiFieldKey]: true
|
|
49
|
+
}];
|
|
50
|
+
});
|
|
51
|
+
return Object.fromEntries(pairs);
|
|
52
|
+
} else return normalizeSelect(getReferenceTypeSelectClause({ typeObject }, contextPath));
|
|
53
|
+
};
|
|
54
|
+
//#endregion
|
|
55
|
+
export { getReferenceFieldNormalizedSelectClause, getReferenceTypeSelectClause };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
//#region src/field-utils/relation-view.ts
|
|
2
|
+
const isRelationViewField = (fieldObject) => {
|
|
3
|
+
if (fieldObject.typeObject.isPrimitive || !fieldObject.relation && !fieldObject.multiRelation || fieldObject.typeObject.isEnum) return false;
|
|
4
|
+
return [":cardinality/one-to-many", ":cardinality/many-to-many"].includes(fieldObject.cardinality);
|
|
5
|
+
};
|
|
6
|
+
//#endregion
|
|
7
|
+
export { isRelationViewField };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FieldUnit } from "../units/types.js";
|
|
2
|
+
import { TypeObject } from "@fibery/schema";
|
|
3
|
+
import { FieldExpression } from "@fibery/expression-utils/src/types";
|
|
4
|
+
//#region src/field-utils/rich-text.d.ts
|
|
5
|
+
declare const hasAccessToSecretKey: string;
|
|
6
|
+
declare const getHasAccessToSecretExpr: (expression: FieldExpression) => (string | (string | import("@fibery/expression-utils").MultiFieldAccess)[])[];
|
|
7
|
+
declare const getHasAccessToSecret: (expression: FieldExpression) => {
|
|
8
|
+
[hasAccessToSecretKey]: (string | (string | import("@fibery/expression-utils").MultiFieldAccess)[])[];
|
|
9
|
+
};
|
|
10
|
+
declare function getRichTextQuerySelect({ typeObject, unit: { expression }, includeSnippet }: {
|
|
11
|
+
typeObject: TypeObject;
|
|
12
|
+
unit: FieldUnit;
|
|
13
|
+
includeSnippet?: boolean;
|
|
14
|
+
}): any;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { getHasAccessToSecret, getHasAccessToSecretExpr, getRichTextQuerySelect, hasAccessToSecretKey };
|