@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.
- 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 +38 -0
- package/lib/field-utils/text.js +37 -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/tsfixme.d.ts +4 -0
- package/lib/tsfixme.js +0 -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 +17 -0
- package/lib/unit-utils/common.js +39 -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 +42 -0
- package/lib/units/canvas/type-badge-abbr.js +11 -0
- package/lib/units/canvas/type-badge.d.ts +42 -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 +75 -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 -42
- 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 -18
- 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 -57
- 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/truthy.d.ts +0 -1
- package/lib/src/truthy.js +0 -7
- 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 -54
- 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 -88
- 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 -261
- package/lib/src/units/types.d.ts +0 -73
- package/lib/src/units/types.js +0 -2
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { truthy } from "@fibery/helpers/src/_";
|
|
2
|
+
import { deleteExpressionsWithNotFoundFieldsVisitor, replaceIdsWithNamesVisitor, replaceNamesWithIdsVisitor } from "@fibery/expression-utils/src/visitors";
|
|
3
|
+
import pickBy from "lodash/pickBy.js";
|
|
4
|
+
//#region src/private/utils.ts
|
|
5
|
+
const REMOVE = Symbol("remove");
|
|
6
|
+
const skipRemove = (unit) => unit !== REMOVE;
|
|
7
|
+
function visitDeleteExpressionInFilterGroup(filter, visitExpression) {
|
|
8
|
+
if (filter.kind !== "group") return null;
|
|
9
|
+
const value = filter.value.map((nestedFilter) => {
|
|
10
|
+
if (nestedFilter.kind === "group") return visitFilterGroup(nestedFilter, visitExpression);
|
|
11
|
+
const leaf = nestedFilter;
|
|
12
|
+
const expression = leaf.value.expression ? visitExpression(leaf.value.expression) : null;
|
|
13
|
+
if (!expression) return null;
|
|
14
|
+
return {
|
|
15
|
+
...leaf,
|
|
16
|
+
value: {
|
|
17
|
+
...leaf.value,
|
|
18
|
+
expression
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
}).filter(truthy);
|
|
22
|
+
if (value.length === 0) return null;
|
|
23
|
+
return {
|
|
24
|
+
...filter,
|
|
25
|
+
value
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
const deleteExpressionWithNotFoundFieldsOrTypesInFilter = (schema, fromType, filter) => {
|
|
29
|
+
return visitDeleteExpressionInFilterGroup(filter, (expression) => deleteExpressionWithNotFoundFieldsOrTypesInExpression(schema, fromType, expression));
|
|
30
|
+
};
|
|
31
|
+
const deleteExpressionWithNotFoundFieldsOrTypesInQueryExpression = (schema, queryExpression) => {
|
|
32
|
+
const { "q/from": fromExpression, "q/where": whereExpression, "q/order-by": orderByExpression } = queryExpression;
|
|
33
|
+
if (Object.hasOwn(schema.typeObjectsByName, fromExpression)) {
|
|
34
|
+
const typeObject = schema.typeObjectsByName[fromExpression];
|
|
35
|
+
return pickBy({
|
|
36
|
+
...queryExpression,
|
|
37
|
+
...whereExpression ? { "q/where": deleteExpressionsWithNotFoundFieldsVisitor(typeObject).visitExpression(whereExpression) } : null,
|
|
38
|
+
...orderByExpression ? { "q/order-by": deleteExpressionsWithNotFoundFieldsVisitor(typeObject).visitOrderByExpression(orderByExpression) } : null
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
return null;
|
|
42
|
+
};
|
|
43
|
+
const replaceNamesWithIdsInExpression = (schema, fromType, expression) => {
|
|
44
|
+
if (Object.hasOwn(schema.typeObjectsByName, fromType)) {
|
|
45
|
+
const typeObject = schema.typeObjectsByName[fromType];
|
|
46
|
+
return replaceNamesWithIdsVisitor(typeObject).visitExpression(expression);
|
|
47
|
+
}
|
|
48
|
+
return expression;
|
|
49
|
+
};
|
|
50
|
+
const replaceIdsWithNamesInExpression = (schema, fromTypeId, expression) => {
|
|
51
|
+
if (Object.hasOwn(schema.typeObjectsById, fromTypeId)) {
|
|
52
|
+
const typeObject = schema.typeObjectsById[fromTypeId];
|
|
53
|
+
return replaceIdsWithNamesVisitor(typeObject).visitExpression(expression);
|
|
54
|
+
}
|
|
55
|
+
return expression;
|
|
56
|
+
};
|
|
57
|
+
const visitViewUnit = (fromType, unit, visitor) => {
|
|
58
|
+
if (unit.kind === "user-button") return unit;
|
|
59
|
+
const { expression } = unit;
|
|
60
|
+
if (!expression) return unit;
|
|
61
|
+
return {
|
|
62
|
+
...unit,
|
|
63
|
+
expression: visitor.visitExpression(fromType, expression)
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
const visitContextExpression = (fromType, contextExpression, visitor) => {
|
|
67
|
+
const visitContextExpression = visitor.visitContextExpression ? visitor.visitContextExpression : visitor.visitExpression;
|
|
68
|
+
return contextExpression ? visitContextExpression(fromType, contextExpression) : contextExpression;
|
|
69
|
+
};
|
|
70
|
+
const replaceIdsWithNamesInQueryExpression = (schema, queryExpression) => {
|
|
71
|
+
const { "q/from": fromExpression, "q/where": whereExpression, "q/order-by": orderByExpression } = queryExpression;
|
|
72
|
+
if (Object.hasOwn(schema.typeObjectsById, fromExpression)) {
|
|
73
|
+
const typeObject = schema.typeObjectsById[fromExpression];
|
|
74
|
+
return {
|
|
75
|
+
...queryExpression,
|
|
76
|
+
"q/from": typeObject.name,
|
|
77
|
+
...whereExpression ? { "q/where": replaceIdsWithNamesVisitor(typeObject).visitExpression(whereExpression) } : null,
|
|
78
|
+
...orderByExpression ? { "q/order-by": replaceIdsWithNamesVisitor(typeObject).visitOrderByExpression(orderByExpression) } : null
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
return queryExpression;
|
|
82
|
+
};
|
|
83
|
+
function visitFilterGroup(filter, visitExpression, _type) {
|
|
84
|
+
if (filter.kind !== "group") return null;
|
|
85
|
+
const group = filter;
|
|
86
|
+
return {
|
|
87
|
+
...group,
|
|
88
|
+
value: group.value.map((nestedFilter) => {
|
|
89
|
+
if (nestedFilter.kind === "group") return visitFilterGroup(nestedFilter, visitExpression);
|
|
90
|
+
const leaf = nestedFilter;
|
|
91
|
+
return {
|
|
92
|
+
...leaf,
|
|
93
|
+
value: {
|
|
94
|
+
...leaf.value,
|
|
95
|
+
expression: leaf.value.expression ? visitExpression(leaf.value.expression) : null
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
})
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
const replaceIdsWithNamesInFilter = (schema, fromType, filter) => {
|
|
102
|
+
if (Object.hasOwn(schema.typeObjectsById, fromType)) {
|
|
103
|
+
const typeObject = schema.typeObjectsById[fromType];
|
|
104
|
+
return filter ? visitFilterGroup(filter, (expression) => replaceIdsWithNamesVisitor(typeObject).visitExpression(expression), "ids") : null;
|
|
105
|
+
}
|
|
106
|
+
return filter;
|
|
107
|
+
};
|
|
108
|
+
const replaceNamesWithIdsInFilter = (schema, fromType, filter) => {
|
|
109
|
+
if (Object.hasOwn(schema.typeObjectsByName, fromType)) {
|
|
110
|
+
const typeObject = schema.typeObjectsByName[fromType];
|
|
111
|
+
return filter ? visitFilterGroup(filter, (expression) => replaceNamesWithIdsVisitor(typeObject).visitExpression(expression), "names") : null;
|
|
112
|
+
}
|
|
113
|
+
return filter;
|
|
114
|
+
};
|
|
115
|
+
const replaceNamesWithIdsInQueryExpression = (schema, queryExpression) => {
|
|
116
|
+
const { "q/from": fromExpression, "q/where": whereExpression, "q/order-by": orderByExpression } = queryExpression;
|
|
117
|
+
if (Object.hasOwn(schema.typeObjectsByName, fromExpression)) {
|
|
118
|
+
const typeObject = schema.typeObjectsByName[fromExpression];
|
|
119
|
+
return {
|
|
120
|
+
...queryExpression,
|
|
121
|
+
"q/from": typeObject.id,
|
|
122
|
+
...whereExpression ? { "q/where": replaceNamesWithIdsVisitor(typeObject).visitExpression(whereExpression) } : null,
|
|
123
|
+
...orderByExpression ? { "q/order-by": replaceNamesWithIdsVisitor(typeObject).visitOrderByExpression(orderByExpression) } : null
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
return queryExpression;
|
|
127
|
+
};
|
|
128
|
+
const deleteExpressionWithNotFoundFieldsOrTypesInExpression = (schema, fromType, expression) => {
|
|
129
|
+
if (Object.hasOwn(schema.typeObjectsByName, fromType)) {
|
|
130
|
+
const typeObject = schema.typeObjectsByName[fromType];
|
|
131
|
+
return deleteExpressionsWithNotFoundFieldsVisitor(typeObject).visitExpression(expression);
|
|
132
|
+
}
|
|
133
|
+
return null;
|
|
134
|
+
};
|
|
135
|
+
const resetContextExpressionIfBroken = (schema, fromType, expression, defaultExpression) => deleteExpressionWithNotFoundFieldsOrTypesInExpression(schema, fromType, expression) || defaultExpression;
|
|
136
|
+
const isUnitExpressionValid = (unit) => {
|
|
137
|
+
if (Object.hasOwn(unit, "expression")) {
|
|
138
|
+
const { expression } = unit;
|
|
139
|
+
return expression !== null;
|
|
140
|
+
}
|
|
141
|
+
return true;
|
|
142
|
+
};
|
|
143
|
+
const getFieldObjectsById = (smartFolder, schema) => {
|
|
144
|
+
return smartFolder["fibery/meta"].items.map((item) => item.query["q/from"]).reduce((acc, type) => {
|
|
145
|
+
if (!Object.hasOwn(schema.typeObjectsById, type)) return acc;
|
|
146
|
+
const fieldObjects = schema.typeObjectsById[type].fieldObjectsById;
|
|
147
|
+
return {
|
|
148
|
+
...acc,
|
|
149
|
+
...fieldObjects
|
|
150
|
+
};
|
|
151
|
+
}, {});
|
|
152
|
+
};
|
|
153
|
+
const replaceIdsWithNamesInUnitGroupKey = (unitGroupKey, fieldObjectsById) => {
|
|
154
|
+
return unitGroupKey.split("|").map((keyPart) => {
|
|
155
|
+
const [unitType, ...rest] = keyPart.split("_");
|
|
156
|
+
if (unitType === "user-button") return keyPart;
|
|
157
|
+
const fieldId = rest.join("_");
|
|
158
|
+
if (!fieldId) return keyPart;
|
|
159
|
+
const fieldObject = fieldObjectsById[fieldId];
|
|
160
|
+
if (!fieldObject) return keyPart;
|
|
161
|
+
return `${unitType}_${fieldObject.holderType}:${fieldObject.name}`;
|
|
162
|
+
}).filter(Boolean).join("|");
|
|
163
|
+
};
|
|
164
|
+
const replaceNamesWithIdsInUnitGroupKey = (unitGroupKey, schema) => {
|
|
165
|
+
return unitGroupKey.split("|").map((keyPart) => {
|
|
166
|
+
const [unitType, ...rest] = keyPart.split("_");
|
|
167
|
+
if (unitType === "user-button") return keyPart;
|
|
168
|
+
const name = rest.join("_");
|
|
169
|
+
if (!name) return keyPart;
|
|
170
|
+
const [type, field] = name.split(":");
|
|
171
|
+
if (!field) return keyPart;
|
|
172
|
+
if (!Object.hasOwn(schema.typeObjectsByName, type)) return keyPart;
|
|
173
|
+
const typeObject = schema.typeObjectsByName[type];
|
|
174
|
+
if (!Object.hasOwn(typeObject.fieldObjectsByName, field)) return keyPart;
|
|
175
|
+
return `${unitType}_${typeObject.fieldObjectsByName[field].id}`;
|
|
176
|
+
}).filter(Boolean).join("|");
|
|
177
|
+
};
|
|
178
|
+
//#endregion
|
|
179
|
+
export { REMOVE, deleteExpressionWithNotFoundFieldsOrTypesInExpression, deleteExpressionWithNotFoundFieldsOrTypesInFilter, deleteExpressionWithNotFoundFieldsOrTypesInQueryExpression, getFieldObjectsById, isUnitExpressionValid, replaceIdsWithNamesInExpression, replaceIdsWithNamesInFilter, replaceIdsWithNamesInQueryExpression, replaceIdsWithNamesInUnitGroupKey, replaceNamesWithIdsInExpression, replaceNamesWithIdsInFilter, replaceNamesWithIdsInQueryExpression, replaceNamesWithIdsInUnitGroupKey, resetContextExpressionIfBroken, skipRemove, visitContextExpression, visitViewUnit };
|
package/lib/tsfixme.d.ts
ADDED
package/lib/tsfixme.js
ADDED
|
File without changes
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { getAvatarSelectQuery } from "../field-utils/avatar.js";
|
|
2
|
+
import { generateAccessCheckQueryExpression } from "../unit-utils/access.js";
|
|
3
|
+
import { calculateUnitExpressionErrors, canEditFieldExpression, makeUnitMethod } from "../unit-utils/common.js";
|
|
4
|
+
import { getReferenceCollectionExportValue } from "../unit-utils/get-export-value.js";
|
|
5
|
+
import { getFieldLabel } from "../unit-utils/get-field-label.js";
|
|
6
|
+
import { truthy } from "@fibery/helpers/src/_";
|
|
7
|
+
import { getFieldObjectsByFieldExpression } from "@fibery/expression-utils/src/utils";
|
|
8
|
+
import { mergeDenormalizedSelects, toSelectMapClause } from "@fibery/query-utils/src/select";
|
|
9
|
+
//#region src/unit-definitions/avatar-collection.ts
|
|
10
|
+
const type = "avatar-collection";
|
|
11
|
+
const AvatarCollection = {
|
|
12
|
+
type,
|
|
13
|
+
name: "Avatar",
|
|
14
|
+
canEdit({ typeObject, unit: { expression } }) {
|
|
15
|
+
return canEditFieldExpression(typeObject, expression);
|
|
16
|
+
},
|
|
17
|
+
getLabel({ typeObject, unit }) {
|
|
18
|
+
return `Avatar of ${getFieldLabel({
|
|
19
|
+
typeObject,
|
|
20
|
+
unit
|
|
21
|
+
})}`;
|
|
22
|
+
},
|
|
23
|
+
makeUnit: makeUnitMethod(type),
|
|
24
|
+
getQuerySelect({ typeObject, unit: { expression } }) {
|
|
25
|
+
const fieldObjects = getFieldObjectsByFieldExpression({
|
|
26
|
+
typeObject,
|
|
27
|
+
expression
|
|
28
|
+
});
|
|
29
|
+
const terminalFieldObject = fieldObjects[fieldObjects.length - 1];
|
|
30
|
+
const collectionSubQuery = {
|
|
31
|
+
"q/from": expression,
|
|
32
|
+
"q/select": mergeDenormalizedSelects([
|
|
33
|
+
toSelectMapClause([terminalFieldObject.typeObject.idField, terminalFieldObject.typeObject.titleField]),
|
|
34
|
+
generateAccessCheckQueryExpression({ typeObject: terminalFieldObject.typeObject }),
|
|
35
|
+
getAvatarSelectQuery({ typeObject: terminalFieldObject.typeObject })
|
|
36
|
+
].filter(truthy)),
|
|
37
|
+
"q/limit": "q/no-limit"
|
|
38
|
+
};
|
|
39
|
+
return [...expression].reverse().reduce((inner, field, reversedIndex) => {
|
|
40
|
+
const originalIndex = expression.length - 1 - reversedIndex;
|
|
41
|
+
if (!(originalIndex === expression.length - 1)) {
|
|
42
|
+
const pathToField = expression.slice(0, originalIndex + 1);
|
|
43
|
+
const { idField } = fieldObjects[originalIndex].typeObject;
|
|
44
|
+
const innerForField = idField ? {
|
|
45
|
+
[idField]: [...pathToField, idField],
|
|
46
|
+
...inner
|
|
47
|
+
} : { ...inner };
|
|
48
|
+
return { [field]: innerForField };
|
|
49
|
+
}
|
|
50
|
+
return { [field]: inner };
|
|
51
|
+
}, collectionSubQuery);
|
|
52
|
+
},
|
|
53
|
+
calculateErrors: calculateUnitExpressionErrors,
|
|
54
|
+
getExportValue: getReferenceCollectionExportValue,
|
|
55
|
+
canExport: () => true,
|
|
56
|
+
getExportLabel: getFieldLabel
|
|
57
|
+
};
|
|
58
|
+
//#endregion
|
|
59
|
+
export { AvatarCollection };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { makeUnitMethod } from "../unit-utils/common.js";
|
|
2
|
+
import { Avatar } from "./avatar.js";
|
|
3
|
+
//#region src/unit-definitions/avatar-input.ts
|
|
4
|
+
const type = "avatar-input";
|
|
5
|
+
const AvatarInput = {
|
|
6
|
+
...Avatar,
|
|
7
|
+
type,
|
|
8
|
+
name: "Avatar",
|
|
9
|
+
makeUnit: makeUnitMethod(type)
|
|
10
|
+
};
|
|
11
|
+
//#endregion
|
|
12
|
+
export { AvatarInput };
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { getAvatarSelectQuery, isAvatarExtensionEnabledType, isAvatarExtensionField } from "../field-utils/avatar.js";
|
|
2
|
+
import { generateAccessCheckQueryExpression } from "../unit-utils/access.js";
|
|
3
|
+
import { calculateUnitExpressionErrors, canEditFieldExpression } from "../unit-utils/common.js";
|
|
4
|
+
import { getReferenceExportValue } from "../unit-utils/get-export-value.js";
|
|
5
|
+
import { getFieldLabel } from "../unit-utils/get-field-label.js";
|
|
6
|
+
import { truthy } from "@fibery/helpers/src/_";
|
|
7
|
+
import { assertIsValidExpression, getFieldObjectByFieldExpression, getFieldObjectsByFieldExpression } from "@fibery/expression-utils/src/utils";
|
|
8
|
+
import { denormalizeSelect, mergeDenormalizedSelects, normalizeSelect, toSelectMapClause } from "@fibery/query-utils/src/select";
|
|
9
|
+
//#region src/unit-definitions/avatar.ts
|
|
10
|
+
const type = "avatar";
|
|
11
|
+
const getSelfAvatarSelectQuery = (typeObject) => getAvatarSelectQuery({ typeObject }) || {};
|
|
12
|
+
const Avatar = {
|
|
13
|
+
type,
|
|
14
|
+
name: "Avatar",
|
|
15
|
+
canEdit({ typeObject, unit: { expression } }) {
|
|
16
|
+
if (!expression) return false;
|
|
17
|
+
return canEditFieldExpression(typeObject, expression);
|
|
18
|
+
},
|
|
19
|
+
getLabel({ typeObject, unit }) {
|
|
20
|
+
const { expression } = unit;
|
|
21
|
+
if (expression) {
|
|
22
|
+
if (isAvatarExtensionEnabledType(getFieldObjectByFieldExpression({
|
|
23
|
+
typeObject,
|
|
24
|
+
expression
|
|
25
|
+
}).typeObject)) return `Avatar of ${getFieldLabel({
|
|
26
|
+
typeObject,
|
|
27
|
+
unit
|
|
28
|
+
})}`;
|
|
29
|
+
}
|
|
30
|
+
return "Avatar";
|
|
31
|
+
},
|
|
32
|
+
makeUnit(args) {
|
|
33
|
+
if (!args) return {
|
|
34
|
+
type,
|
|
35
|
+
kind: "db"
|
|
36
|
+
};
|
|
37
|
+
assertIsValidExpression(args.expression);
|
|
38
|
+
return {
|
|
39
|
+
type,
|
|
40
|
+
kind: "field",
|
|
41
|
+
expression: args.expression
|
|
42
|
+
};
|
|
43
|
+
},
|
|
44
|
+
getQuerySelect({ typeObject, unit: { expression } }) {
|
|
45
|
+
if (!expression) return getSelfAvatarSelectQuery(typeObject);
|
|
46
|
+
const fieldObjects = getFieldObjectsByFieldExpression({
|
|
47
|
+
typeObject,
|
|
48
|
+
expression
|
|
49
|
+
});
|
|
50
|
+
const terminalFieldObject = fieldObjects[fieldObjects.length - 1];
|
|
51
|
+
if (isAvatarExtensionField(terminalFieldObject)) return getSelfAvatarSelectQuery(typeObject);
|
|
52
|
+
const innerSelect = normalizeSelect(mergeDenormalizedSelects([
|
|
53
|
+
toSelectMapClause([terminalFieldObject.typeObject.idField, terminalFieldObject.typeObject.titleField]),
|
|
54
|
+
generateAccessCheckQueryExpression({
|
|
55
|
+
typeObject: terminalFieldObject.typeObject,
|
|
56
|
+
contextPath: expression
|
|
57
|
+
}),
|
|
58
|
+
getAvatarSelectQuery({ typeObject: terminalFieldObject.typeObject })
|
|
59
|
+
].filter(truthy)));
|
|
60
|
+
return denormalizeSelect([...expression].reverse().reduce((inner, field, reversedIndex) => {
|
|
61
|
+
const originalIndex = expression.length - 1 - reversedIndex;
|
|
62
|
+
if (!(originalIndex === expression.length - 1)) {
|
|
63
|
+
const { idField } = fieldObjects[originalIndex].typeObject;
|
|
64
|
+
const innerWithId = idField ? {
|
|
65
|
+
[idField]: idField,
|
|
66
|
+
...inner
|
|
67
|
+
} : inner;
|
|
68
|
+
return { [field]: innerWithId };
|
|
69
|
+
}
|
|
70
|
+
return { [field]: inner };
|
|
71
|
+
}, innerSelect));
|
|
72
|
+
},
|
|
73
|
+
calculateErrors: calculateUnitExpressionErrors,
|
|
74
|
+
getExportValue: ({ typeObject, unit, object }) => {
|
|
75
|
+
if (unit.kind === "field") return getReferenceExportValue({
|
|
76
|
+
typeObject,
|
|
77
|
+
unit,
|
|
78
|
+
object
|
|
79
|
+
});
|
|
80
|
+
return null;
|
|
81
|
+
},
|
|
82
|
+
canExport: ({ unit }) => {
|
|
83
|
+
return unit.kind === "field";
|
|
84
|
+
},
|
|
85
|
+
getExportLabel: ({ unit, typeObject }) => {
|
|
86
|
+
const { expression } = unit;
|
|
87
|
+
if (expression) return getFieldObjectByFieldExpression({
|
|
88
|
+
typeObject,
|
|
89
|
+
expression
|
|
90
|
+
}).title;
|
|
91
|
+
return "Avatar";
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
//#endregion
|
|
95
|
+
export { Avatar };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { getEntityLinksListSelect } from "../field-utils/back-references.js";
|
|
2
|
+
import { calculateUnitExpressionErrors, makeUnitMethod } from "../unit-utils/common.js";
|
|
3
|
+
import { getExportValue } from "../unit-utils/get-export-value.js";
|
|
4
|
+
import { getFieldLabel } from "../unit-utils/get-field-label.js";
|
|
5
|
+
import { canEditField } from "../unit-utils/can-edit-field.js";
|
|
6
|
+
import { getFieldObjectByFieldExpression } from "@fibery/expression-utils/src/utils";
|
|
7
|
+
import { calculateDefaultOrderBy } from "@fibery/query-utils/src/query";
|
|
8
|
+
//#region src/unit-definitions/back-references-list.ts
|
|
9
|
+
const type = "back-references-list";
|
|
10
|
+
const getQuerySelect = (fieldObject) => {
|
|
11
|
+
const { name, typeObject } = fieldObject;
|
|
12
|
+
const orderBy = calculateDefaultOrderBy({ typeObject });
|
|
13
|
+
return { [name]: {
|
|
14
|
+
"q/from": [name],
|
|
15
|
+
"q/select": getEntityLinksListSelect(typeObject),
|
|
16
|
+
"q/order-by": orderBy,
|
|
17
|
+
"q/limit": "q/no-limit"
|
|
18
|
+
} };
|
|
19
|
+
};
|
|
20
|
+
const BackReferencesList = {
|
|
21
|
+
type,
|
|
22
|
+
name: "Back references list",
|
|
23
|
+
canEdit: canEditField,
|
|
24
|
+
makeUnit: makeUnitMethod(type),
|
|
25
|
+
getLabel: getFieldLabel,
|
|
26
|
+
getQuerySelect: ({ typeObject, unit }) => {
|
|
27
|
+
const { expression } = unit;
|
|
28
|
+
const fieldObject = getFieldObjectByFieldExpression({
|
|
29
|
+
typeObject,
|
|
30
|
+
expression
|
|
31
|
+
});
|
|
32
|
+
return getQuerySelect(fieldObject);
|
|
33
|
+
},
|
|
34
|
+
calculateErrors: calculateUnitExpressionErrors,
|
|
35
|
+
getExportValue,
|
|
36
|
+
canExport: () => true
|
|
37
|
+
};
|
|
38
|
+
//#endregion
|
|
39
|
+
export { BackReferencesList };
|
|
@@ -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/bool-checkbox.ts
|
|
7
|
+
const type = "bool-checkbox";
|
|
8
|
+
const BoolCheckbox = {
|
|
9
|
+
type,
|
|
10
|
+
name: "Bool checkbox",
|
|
11
|
+
canEdit: canEditField,
|
|
12
|
+
getLabel: getFieldLabel,
|
|
13
|
+
makeUnit: makeUnitMethod(type),
|
|
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 { BoolCheckbox };
|
|
@@ -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/bool.ts
|
|
7
|
+
const type = "bool";
|
|
8
|
+
const Bool = {
|
|
9
|
+
type,
|
|
10
|
+
name: "Bool",
|
|
11
|
+
canEdit: canEditField,
|
|
12
|
+
getLabel: getFieldLabel,
|
|
13
|
+
makeUnit: makeUnitMethod(type),
|
|
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 { Bool };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { getCountKey, makeCollectionCountExpression } from "../field-utils/reference-collection.js";
|
|
2
|
+
import { calculateUnitExpressionErrors, makeUnitMethod } from "../unit-utils/common.js";
|
|
3
|
+
import { getFieldLabel } from "../unit-utils/get-field-label.js";
|
|
4
|
+
import { getFieldObjectByFieldExpression } from "@fibery/expression-utils/src/utils";
|
|
5
|
+
//#region src/unit-definitions/collection-count.ts
|
|
6
|
+
const type = "collection-count";
|
|
7
|
+
const CollectionCount = {
|
|
8
|
+
type,
|
|
9
|
+
name: "Count",
|
|
10
|
+
canEdit: () => false,
|
|
11
|
+
makeUnit: makeUnitMethod(type),
|
|
12
|
+
getLabel({ typeObject, unit }) {
|
|
13
|
+
const { expression } = unit;
|
|
14
|
+
const fieldObject = getFieldObjectByFieldExpression({
|
|
15
|
+
typeObject,
|
|
16
|
+
expression
|
|
17
|
+
});
|
|
18
|
+
const label = getFieldLabel({
|
|
19
|
+
typeObject,
|
|
20
|
+
unit
|
|
21
|
+
});
|
|
22
|
+
if (fieldObject.name === "comments/comments") return label;
|
|
23
|
+
return `${label} Count`;
|
|
24
|
+
},
|
|
25
|
+
getQuerySelect({ unit: { expression } }) {
|
|
26
|
+
return { [getCountKey(expression.join("/"))]: makeCollectionCountExpression(expression) };
|
|
27
|
+
},
|
|
28
|
+
calculateErrors: calculateUnitExpressionErrors,
|
|
29
|
+
getExportValue: ({ object, unit }) => {
|
|
30
|
+
return object[getCountKey(unit.expression.join("/"))];
|
|
31
|
+
},
|
|
32
|
+
canExport: () => true
|
|
33
|
+
};
|
|
34
|
+
//#endregion
|
|
35
|
+
export { CollectionCount };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { calculateUnitExpressionErrors, makeUnitMethod } from "../unit-utils/common.js";
|
|
2
|
+
import { getFieldLabel } from "../unit-utils/get-field-label.js";
|
|
3
|
+
import { canEditField } from "../unit-utils/can-edit-field.js";
|
|
4
|
+
import { getQuerySelectForExpression } from "@fibery/query-utils/src/query";
|
|
5
|
+
//#region src/unit-definitions/color-input.ts
|
|
6
|
+
const type = "color-input";
|
|
7
|
+
const ColorInput = {
|
|
8
|
+
type,
|
|
9
|
+
name: "Color",
|
|
10
|
+
canEdit: canEditField,
|
|
11
|
+
makeUnit: makeUnitMethod(type),
|
|
12
|
+
getLabel: getFieldLabel,
|
|
13
|
+
getQuerySelect({ typeObject, unit: { expression } }) {
|
|
14
|
+
return getQuerySelectForExpression({
|
|
15
|
+
typeObject,
|
|
16
|
+
expression
|
|
17
|
+
});
|
|
18
|
+
},
|
|
19
|
+
calculateErrors: calculateUnitExpressionErrors,
|
|
20
|
+
getExportValue: () => null,
|
|
21
|
+
canExport: () => false
|
|
22
|
+
};
|
|
23
|
+
//#endregion
|
|
24
|
+
export { ColorInput };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { getQuerySelect } from "../field-utils/comments.js";
|
|
2
|
+
import { calculateUnitExpressionErrors, makeUnitMethod } from "../unit-utils/common.js";
|
|
3
|
+
import { getExportValue } from "../unit-utils/get-export-value.js";
|
|
4
|
+
import { getFieldLabel } from "../unit-utils/get-field-label.js";
|
|
5
|
+
import { canEditField } from "../unit-utils/can-edit-field.js";
|
|
6
|
+
import { getFieldObjectByFieldExpression } from "@fibery/expression-utils/src/utils";
|
|
7
|
+
//#region src/unit-definitions/comments-list.ts
|
|
8
|
+
const type = "comments-list";
|
|
9
|
+
const CommentsList = {
|
|
10
|
+
type,
|
|
11
|
+
name: "Comments list",
|
|
12
|
+
canEdit: canEditField,
|
|
13
|
+
makeUnit: makeUnitMethod(type),
|
|
14
|
+
getLabel: getFieldLabel,
|
|
15
|
+
getQuerySelect: ({ typeObject, unit }) => {
|
|
16
|
+
const { expression } = unit;
|
|
17
|
+
return getQuerySelect(getFieldObjectByFieldExpression({
|
|
18
|
+
typeObject,
|
|
19
|
+
expression
|
|
20
|
+
}));
|
|
21
|
+
},
|
|
22
|
+
calculateErrors: calculateUnitExpressionErrors,
|
|
23
|
+
getExportValue,
|
|
24
|
+
canExport: () => true
|
|
25
|
+
};
|
|
26
|
+
//#endregion
|
|
27
|
+
export { CommentsList };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { calculateUnitExpressionErrors, makeUnitMethod } from "../unit-utils/common.js";
|
|
2
|
+
import { getDateRangeExportValue } 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/date-range-combobox.ts
|
|
7
|
+
const type = "date-range-combobox";
|
|
8
|
+
const DateRangeCombobox = {
|
|
9
|
+
type,
|
|
10
|
+
name: "Date range",
|
|
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: getDateRangeExportValue,
|
|
22
|
+
canExport: () => true
|
|
23
|
+
};
|
|
24
|
+
//#endregion
|
|
25
|
+
export { DateRangeCombobox };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { calculateUnitExpressionErrors, makeUnitMethod } from "../unit-utils/common.js";
|
|
2
|
+
import { getDateRangeExportValue } 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/date-range.ts
|
|
7
|
+
const type = "date-range";
|
|
8
|
+
const DateRange = {
|
|
9
|
+
type,
|
|
10
|
+
name: "Date range",
|
|
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: getDateRangeExportValue,
|
|
22
|
+
canExport: () => true
|
|
23
|
+
};
|
|
24
|
+
//#endregion
|
|
25
|
+
export { DateRange };
|