@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,49 @@
|
|
|
1
|
+
import { PureUnit, Unit, UnitExpression } from "./types.js";
|
|
2
|
+
//#region src/units/grid.d.ts
|
|
3
|
+
declare const getTypeUnits: () => PureUnit[], getUnitName: (unit: Unit) => string | null, getUnitsForType: (typeObject: import("@fibery/schema").TypeObject, options?: {
|
|
4
|
+
parentFieldObjects?: import("@fibery/schema").FieldObject[];
|
|
5
|
+
showHiddenFields?: boolean;
|
|
6
|
+
isSharingMode?: boolean;
|
|
7
|
+
}) => {
|
|
8
|
+
unit: Unit;
|
|
9
|
+
fieldObject: import("@fibery/schema").FieldObject;
|
|
10
|
+
}[], getUnitsForField: (fieldObject: import("@fibery/schema").FieldObject, options?: {
|
|
11
|
+
parentFieldObjects?: import("@fibery/schema").FieldObject[];
|
|
12
|
+
showHiddenFields?: boolean;
|
|
13
|
+
isSharingMode?: boolean;
|
|
14
|
+
}) => Unit[], getUnitsForTypePerField: (typeObject: import("@fibery/schema").TypeObject, options?: {
|
|
15
|
+
parentFieldObjects?: import("@fibery/schema").FieldObject[];
|
|
16
|
+
showHiddenFields?: boolean;
|
|
17
|
+
isSharingMode?: boolean;
|
|
18
|
+
}) => {
|
|
19
|
+
fieldObject: import("@fibery/schema").FieldObject;
|
|
20
|
+
units: Unit[];
|
|
21
|
+
}[], getUnitLabel: (typeObject: import("@fibery/schema").TypeObject, unit: Unit) => string, getCardUnitsSelect: ({ schema, typeObject, units }: {
|
|
22
|
+
schema: import("@fibery/schema").Schema;
|
|
23
|
+
typeObject: import("@fibery/schema").TypeObject;
|
|
24
|
+
units: Unit[];
|
|
25
|
+
}) => any, getHardcodedUnitsForView: (typeObject: import("@fibery/schema").TypeObject) => ({
|
|
26
|
+
kind: "user-button";
|
|
27
|
+
type: "user-button" | "icon-button";
|
|
28
|
+
data: {
|
|
29
|
+
id: string;
|
|
30
|
+
typeId: string;
|
|
31
|
+
};
|
|
32
|
+
label: string;
|
|
33
|
+
hideWhenEmpty?: boolean;
|
|
34
|
+
icon?: string;
|
|
35
|
+
} | {
|
|
36
|
+
kind: "db";
|
|
37
|
+
type: "type-icon" | "type-badge" | "type-badge-abbr";
|
|
38
|
+
expression?: UnitExpression;
|
|
39
|
+
hideWhenEmpty?: boolean;
|
|
40
|
+
} | {
|
|
41
|
+
kind: "field";
|
|
42
|
+
type: "avatar" | "avatar-collection" | "avatar-input" | "back-references-list" | "bool" | "bool-checkbox" | "collection-count" | "color-input" | "comments-list" | "date" | "date-time" | "date-time-range" | "date-time-combobox" | "date-range" | "date-range-combobox" | "email" | "email-input" | "emoji" | "field" | "files-collection" | "files-gallery" | "files-list" | "files-list-item" | "files-l-list" | "files-l-list-item" | "file-reference" | "file-compact-collection" | "file-compact-reference" | "file-collection-count" | "geometry-preview" | "icon-button" | "icon-input" | "id" | "json-input" | "location" | "location-input" | "number" | "number-input" | "phone" | "phone-input" | "progress-bar" | "reference" | "reference-icon" | "reference-combobox" | "reference-collection" | "reference-collection-list" | "reference-collection-view" | "reference-collection-combobox" | "rich-text-snippet" | "rich-text-document" | "single-location-preview" | "text" | "text-input" | "title" | "title-input" | "url" | "url-input" | "user-role" | "user-role-input";
|
|
43
|
+
expression: UnitExpression;
|
|
44
|
+
settings?: Record<string, unknown>;
|
|
45
|
+
hideWhenEmpty?: boolean;
|
|
46
|
+
})[];
|
|
47
|
+
declare const getDefaultUnits: () => PureUnit[];
|
|
48
|
+
//#endregion
|
|
49
|
+
export { getCardUnitsSelect, getDefaultUnits, getHardcodedUnitsForView, getTypeUnits, getUnitLabel, getUnitName, getUnitsForField, getUnitsForType, getUnitsForTypePerField };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { AvatarCollection } from "../unit-definitions/avatar-collection.js";
|
|
3
|
+
import { Avatar } from "../unit-definitions/avatar.js";
|
|
4
|
+
import { Bool } from "../unit-definitions/bool.js";
|
|
5
|
+
import { CollectionCount } from "../unit-definitions/collection-count.js";
|
|
6
|
+
import { DateRange } from "../unit-definitions/date-range.js";
|
|
7
|
+
import { Date } from "../unit-definitions/date.js";
|
|
8
|
+
import { Text } from "../unit-definitions/text.js";
|
|
9
|
+
import { Email } from "../unit-definitions/email.js";
|
|
10
|
+
import { Emoji } from "../unit-definitions/emoji.js";
|
|
11
|
+
import { FileCollectionCount } from "../unit-definitions/file-collection-count.js";
|
|
12
|
+
import { FilesGallery } from "../unit-definitions/files-gallery.js";
|
|
13
|
+
import { IconButton } from "../unit-definitions/icon-button.js";
|
|
14
|
+
import { Id } from "../unit-definitions/id.js";
|
|
15
|
+
import { Location } from "../unit-definitions/location.js";
|
|
16
|
+
import { Number } from "../unit-definitions/number.js";
|
|
17
|
+
import { Phone } from "../unit-definitions/phone.js";
|
|
18
|
+
import { ProgressBar } from "../unit-definitions/progress-bar.js";
|
|
19
|
+
import { ReferenceCollection } from "../unit-definitions/reference-collection.js";
|
|
20
|
+
import { Reference } from "../unit-definitions/reference.js";
|
|
21
|
+
import { ReferenceIcon } from "../unit-definitions/reference-icon.js";
|
|
22
|
+
import { RichTextSnippet } from "../unit-definitions/rich-text-snippet.js";
|
|
23
|
+
import { Title } from "../unit-definitions/title.js";
|
|
24
|
+
import { TypeBadgeAbbr } from "../unit-definitions/type-badge-abbr.js";
|
|
25
|
+
import { TypeBadge } from "../unit-definitions/type-badge.js";
|
|
26
|
+
import { TypeIcon } from "../unit-definitions/type-icon.js";
|
|
27
|
+
import { Url } from "../unit-definitions/url.js";
|
|
28
|
+
import { UserButton } from "../unit-definitions/user-button.js";
|
|
29
|
+
import { UserRole } from "../unit-definitions/user-role.js";
|
|
30
|
+
import { makeUnitDefinitionsFactory } from "./make-factory.js";
|
|
31
|
+
import { FileReference } from "@fibery/views/src/unit-definitions/file-reference";
|
|
32
|
+
//#region src/units/grid.ts
|
|
33
|
+
var grid_exports = /* @__PURE__ */ __exportAll({
|
|
34
|
+
getCardUnitsSelect: () => getCardUnitsSelect,
|
|
35
|
+
getDefaultUnits: () => getDefaultUnits,
|
|
36
|
+
getHardcodedUnitsForView: () => getHardcodedUnitsForView,
|
|
37
|
+
getTypeUnits: () => getTypeUnits,
|
|
38
|
+
getUnitLabel: () => getUnitLabel,
|
|
39
|
+
getUnitName: () => getUnitName,
|
|
40
|
+
getUnitsForField: () => getUnitsForField,
|
|
41
|
+
getUnitsForType: () => getUnitsForType,
|
|
42
|
+
getUnitsForTypePerField: () => getUnitsForTypePerField
|
|
43
|
+
});
|
|
44
|
+
const allUnitDefinitions = {
|
|
45
|
+
AvatarCollection,
|
|
46
|
+
Bool,
|
|
47
|
+
Date,
|
|
48
|
+
DateRange,
|
|
49
|
+
Email,
|
|
50
|
+
Id,
|
|
51
|
+
Number,
|
|
52
|
+
ProgressBar,
|
|
53
|
+
Phone,
|
|
54
|
+
Reference,
|
|
55
|
+
ReferenceIcon,
|
|
56
|
+
ReferenceCollection,
|
|
57
|
+
Text,
|
|
58
|
+
Title,
|
|
59
|
+
Emoji,
|
|
60
|
+
Url,
|
|
61
|
+
Location,
|
|
62
|
+
UserButton,
|
|
63
|
+
Avatar,
|
|
64
|
+
CollectionCount,
|
|
65
|
+
TypeBadge,
|
|
66
|
+
TypeBadgeAbbr,
|
|
67
|
+
TypeIcon,
|
|
68
|
+
RichTextSnippet,
|
|
69
|
+
IconButton,
|
|
70
|
+
UserRole,
|
|
71
|
+
FileCollectionCount,
|
|
72
|
+
FilesGallery,
|
|
73
|
+
FileReference
|
|
74
|
+
};
|
|
75
|
+
const { getTypeUnits, getUnitName, getUnitsForType, getUnitsForField, getUnitsForTypePerField, getUnitLabel, getCardUnitsSelect, getHardcodedUnitsForView } = makeUnitDefinitionsFactory(allUnitDefinitions);
|
|
76
|
+
const getDefaultUnits = () => {
|
|
77
|
+
const { Title } = allUnitDefinitions;
|
|
78
|
+
return [Title && Title.makeUnit()].filter(Boolean);
|
|
79
|
+
};
|
|
80
|
+
//#endregion
|
|
81
|
+
export { getCardUnitsSelect, getDefaultUnits, getHardcodedUnitsForView, getTypeUnits, getUnitLabel, getUnitName, getUnitsForField, getUnitsForType, getUnitsForTypePerField, grid_exports };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { PureUnit, Unit, UnitExpression } from "./types.js";
|
|
2
|
+
import { TypeObject } from "@fibery/schema";
|
|
3
|
+
declare namespace list_d_exports {
|
|
4
|
+
export { getCardUnitsSelect, getDefaultUnits, getHardcodedUnitsForView, getTypeUnits, getUnitLabel, getUnitName, getUnitsForField, getUnitsForType, getUnitsForTypePerField };
|
|
5
|
+
}
|
|
6
|
+
declare const getTypeUnits: () => PureUnit[], getUnitName: (unit: Unit) => string | null, getUnitsForType: (typeObject: TypeObject, options?: {
|
|
7
|
+
parentFieldObjects?: import("@fibery/schema").FieldObject[];
|
|
8
|
+
showHiddenFields?: boolean;
|
|
9
|
+
isSharingMode?: boolean;
|
|
10
|
+
}) => {
|
|
11
|
+
unit: Unit;
|
|
12
|
+
fieldObject: import("@fibery/schema").FieldObject;
|
|
13
|
+
}[], getUnitsForField: (fieldObject: import("@fibery/schema").FieldObject, options?: {
|
|
14
|
+
parentFieldObjects?: import("@fibery/schema").FieldObject[];
|
|
15
|
+
showHiddenFields?: boolean;
|
|
16
|
+
isSharingMode?: boolean;
|
|
17
|
+
}) => Unit[], getUnitsForTypePerField: (typeObject: TypeObject, options?: {
|
|
18
|
+
parentFieldObjects?: import("@fibery/schema").FieldObject[];
|
|
19
|
+
showHiddenFields?: boolean;
|
|
20
|
+
isSharingMode?: boolean;
|
|
21
|
+
}) => {
|
|
22
|
+
fieldObject: import("@fibery/schema").FieldObject;
|
|
23
|
+
units: Unit[];
|
|
24
|
+
}[], getUnitLabel: (typeObject: TypeObject, unit: Unit) => string, getCardUnitsSelect: ({ schema, typeObject, units }: {
|
|
25
|
+
schema: import("@fibery/schema").Schema;
|
|
26
|
+
typeObject: TypeObject;
|
|
27
|
+
units: Unit[];
|
|
28
|
+
}) => any, getHardcodedUnitsForView: (typeObject: TypeObject) => ({
|
|
29
|
+
kind: "user-button";
|
|
30
|
+
type: "user-button" | "icon-button";
|
|
31
|
+
data: {
|
|
32
|
+
id: string;
|
|
33
|
+
typeId: string;
|
|
34
|
+
};
|
|
35
|
+
label: string;
|
|
36
|
+
hideWhenEmpty?: boolean;
|
|
37
|
+
icon?: string;
|
|
38
|
+
} | {
|
|
39
|
+
kind: "db";
|
|
40
|
+
type: "type-icon" | "type-badge" | "type-badge-abbr";
|
|
41
|
+
expression?: UnitExpression;
|
|
42
|
+
hideWhenEmpty?: boolean;
|
|
43
|
+
} | {
|
|
44
|
+
kind: "field";
|
|
45
|
+
type: "avatar" | "avatar-collection" | "avatar-input" | "back-references-list" | "bool" | "bool-checkbox" | "collection-count" | "color-input" | "comments-list" | "date" | "date-time" | "date-time-range" | "date-time-combobox" | "date-range" | "date-range-combobox" | "email" | "email-input" | "emoji" | "field" | "files-collection" | "files-gallery" | "files-list" | "files-list-item" | "files-l-list" | "files-l-list-item" | "file-reference" | "file-compact-collection" | "file-compact-reference" | "file-collection-count" | "geometry-preview" | "icon-button" | "icon-input" | "id" | "json-input" | "location" | "location-input" | "number" | "number-input" | "phone" | "phone-input" | "progress-bar" | "reference" | "reference-icon" | "reference-combobox" | "reference-collection" | "reference-collection-list" | "reference-collection-view" | "reference-collection-combobox" | "rich-text-snippet" | "rich-text-document" | "single-location-preview" | "text" | "text-input" | "title" | "title-input" | "url" | "url-input" | "user-role" | "user-role-input";
|
|
46
|
+
expression: UnitExpression;
|
|
47
|
+
settings?: Record<string, unknown>;
|
|
48
|
+
hideWhenEmpty?: boolean;
|
|
49
|
+
})[];
|
|
50
|
+
declare const getDefaultUnits: (typeObject: TypeObject) => (false | PureUnit)[];
|
|
51
|
+
//#endregion
|
|
52
|
+
export { getCardUnitsSelect, getDefaultUnits, getHardcodedUnitsForView, getTypeUnits, getUnitLabel, getUnitName, getUnitsForField, getUnitsForType, getUnitsForTypePerField, list_d_exports };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { isAvatarExtensionEnabledType } from "../field-utils/avatar.js";
|
|
3
|
+
import { unit_definitions_exports } from "../unit-definitions/index.js";
|
|
4
|
+
import { makeUnitDefinitionsFactory } from "./make-factory.js";
|
|
5
|
+
//#region src/units/list.ts
|
|
6
|
+
var list_exports = /* @__PURE__ */ __exportAll({
|
|
7
|
+
getCardUnitsSelect: () => getCardUnitsSelect,
|
|
8
|
+
getDefaultUnits: () => getDefaultUnits,
|
|
9
|
+
getHardcodedUnitsForView: () => getHardcodedUnitsForView,
|
|
10
|
+
getTypeUnits: () => getTypeUnits,
|
|
11
|
+
getUnitLabel: () => getUnitLabel,
|
|
12
|
+
getUnitName: () => getUnitName,
|
|
13
|
+
getUnitsForField: () => getUnitsForField,
|
|
14
|
+
getUnitsForType: () => getUnitsForType,
|
|
15
|
+
getUnitsForTypePerField: () => getUnitsForTypePerField
|
|
16
|
+
});
|
|
17
|
+
const { getTypeUnits, getUnitName, getUnitsForType, getUnitsForField, getUnitsForTypePerField, getUnitLabel, getCardUnitsSelect, getHardcodedUnitsForView } = makeUnitDefinitionsFactory(unit_definitions_exports);
|
|
18
|
+
const getDefaultUnits = (typeObject) => {
|
|
19
|
+
const { Title, Avatar } = unit_definitions_exports;
|
|
20
|
+
return [Title && Title.makeUnit(), typeObject && isAvatarExtensionEnabledType(typeObject) && Avatar && Avatar.makeUnit()].filter(Boolean);
|
|
21
|
+
};
|
|
22
|
+
//#endregion
|
|
23
|
+
export { getCardUnitsSelect, getDefaultUnits, getHardcodedUnitsForView, getTypeUnits, getUnitLabel, getUnitName, getUnitsForField, getUnitsForType, getUnitsForTypePerField, list_exports };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ButtonUnit, DbUnit, FieldUnit, PureUnit, Unit, UnitDataDefinition, UnitExpression } from "./types.js";
|
|
2
|
+
import { FieldObject, Schema, TypeObject } from "@fibery/schema";
|
|
3
|
+
//#region src/units/make-factory.d.ts
|
|
4
|
+
type AnyUnitDataDefinition = UnitDataDefinition<FieldUnit> | UnitDataDefinition<DbUnit> | UnitDataDefinition<ButtonUnit>;
|
|
5
|
+
type UnitCreationOptions = {
|
|
6
|
+
parentFieldObjects?: FieldObject[];
|
|
7
|
+
showHiddenFields?: boolean;
|
|
8
|
+
isSharingMode?: boolean;
|
|
9
|
+
};
|
|
10
|
+
declare const makeUnitDefinitionsFactory: (allUnitDefinitions: Record<string, AnyUnitDataDefinition>) => {
|
|
11
|
+
getTypeUnits: () => PureUnit[];
|
|
12
|
+
getUnitsForType: (typeObject: TypeObject, options?: UnitCreationOptions) => {
|
|
13
|
+
unit: Unit;
|
|
14
|
+
fieldObject: FieldObject;
|
|
15
|
+
}[];
|
|
16
|
+
getUnitsForTypePerField: (typeObject: TypeObject, options?: UnitCreationOptions) => {
|
|
17
|
+
fieldObject: FieldObject;
|
|
18
|
+
units: Unit[];
|
|
19
|
+
}[];
|
|
20
|
+
getUnitsForField: (fieldObject: FieldObject, options?: UnitCreationOptions) => Unit[];
|
|
21
|
+
getHardcodedUnitsForView: (typeObject: TypeObject) => ({
|
|
22
|
+
kind: "user-button";
|
|
23
|
+
type: "user-button" | "icon-button";
|
|
24
|
+
data: {
|
|
25
|
+
id: string;
|
|
26
|
+
typeId: string;
|
|
27
|
+
};
|
|
28
|
+
label: string;
|
|
29
|
+
hideWhenEmpty?: boolean;
|
|
30
|
+
icon?: string;
|
|
31
|
+
} | {
|
|
32
|
+
kind: "db";
|
|
33
|
+
type: "type-icon" | "type-badge" | "type-badge-abbr";
|
|
34
|
+
expression?: UnitExpression;
|
|
35
|
+
hideWhenEmpty?: boolean;
|
|
36
|
+
} | {
|
|
37
|
+
kind: "field";
|
|
38
|
+
type: "avatar" | "avatar-collection" | "avatar-input" | "back-references-list" | "bool" | "bool-checkbox" | "collection-count" | "color-input" | "comments-list" | "date" | "date-time" | "date-time-range" | "date-time-combobox" | "date-range" | "date-range-combobox" | "email" | "email-input" | "emoji" | "field" | "files-collection" | "files-gallery" | "files-list" | "files-list-item" | "files-l-list" | "files-l-list-item" | "file-reference" | "file-compact-collection" | "file-compact-reference" | "file-collection-count" | "geometry-preview" | "icon-button" | "icon-input" | "id" | "json-input" | "location" | "location-input" | "number" | "number-input" | "phone" | "phone-input" | "progress-bar" | "reference" | "reference-icon" | "reference-combobox" | "reference-collection" | "reference-collection-list" | "reference-collection-view" | "reference-collection-combobox" | "rich-text-snippet" | "rich-text-document" | "single-location-preview" | "text" | "text-input" | "title" | "title-input" | "url" | "url-input" | "user-role" | "user-role-input";
|
|
39
|
+
expression: UnitExpression;
|
|
40
|
+
settings?: Record<string, unknown>;
|
|
41
|
+
hideWhenEmpty?: boolean;
|
|
42
|
+
})[];
|
|
43
|
+
getUnitLabel: (typeObject: TypeObject, unit: Unit) => string;
|
|
44
|
+
getUnitName: (unit: Unit) => string | null;
|
|
45
|
+
getCardUnitsSelect: ({ schema, typeObject, units }: {
|
|
46
|
+
schema: Schema;
|
|
47
|
+
typeObject: TypeObject;
|
|
48
|
+
units: Unit[];
|
|
49
|
+
}) => any;
|
|
50
|
+
getUnitDataDefinition: (unit: Unit) => AnyUnitDataDefinition;
|
|
51
|
+
};
|
|
52
|
+
//#endregion
|
|
53
|
+
export { makeUnitDefinitionsFactory };
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
import { isAvatarExtensionEnabledType, isAvatarExtensionField } from "../field-utils/avatar.js";
|
|
2
|
+
import { isReferenceExtensionField } from "../field-utils/back-references.js";
|
|
3
|
+
import { isCommentExtensionField } from "../field-utils/comments.js";
|
|
4
|
+
import { parseNumberFieldMeta } from "../field-utils/number.js";
|
|
5
|
+
import { isRelationViewField } from "../field-utils/relation-view.js";
|
|
6
|
+
import { TextUIMeta } from "../field-utils/text.js";
|
|
7
|
+
import { isUserRoleField } from "../field-utils/user-role.js";
|
|
8
|
+
import { calculateUnitExpressionErrors, isUnitEnabled } from "../unit-utils/common.js";
|
|
9
|
+
import { NotFound } from "../unit-definitions/not-found.js";
|
|
10
|
+
import { mapValues, truthy } from "@fibery/helpers/src/_";
|
|
11
|
+
import { mergeDenormalizedSelects } from "@fibery/query-utils/src/select";
|
|
12
|
+
import { single } from "@fibery/helpers/utils/array";
|
|
13
|
+
import { assert, traceError } from "@fibery/helpers/utils/trace";
|
|
14
|
+
import constant from "lodash/constant.js";
|
|
15
|
+
import flatMap from "lodash/flatMap.js";
|
|
16
|
+
import groupBy from "lodash/groupBy.js";
|
|
17
|
+
import isPlainObject from "lodash/isPlainObject.js";
|
|
18
|
+
import sortBy from "lodash/sortBy.js";
|
|
19
|
+
//#region src/units/make-factory.ts
|
|
20
|
+
const NoUnitsCreator = () => [];
|
|
21
|
+
const makeUnitDefinitionsFactory = (allUnitDefinitions) => {
|
|
22
|
+
const { BackReferencesList, Bool, BoolCheckbox, ColorInput, CommentsList, Text, TextInput, Email, EmailInput, Emoji, IconInput, JsonInput, Number, NumberInput, ProgressBar, ReferenceCombobox, ReferenceCollection, ReferenceCollectionList, ReferenceCollectionView, ReferenceCollectionCombobox, FileReference, FileCompactReference, FilesGallery, FileList, FileListItem, FileLList, FileLListItem, FileCollectionCount, FileCompactCollection, Date, DateTimeCombobox, DateRange, DateRangeCombobox, Avatar, AvatarCollection, AvatarInput, CollectionCount, Reference, ReferenceIcon, TypeIcon, TypeBadge, TypeBadgeAbbr, Title, TitleInput, Id, UserButton, Phone, PhoneInput, Location, LocationInput, SingleLocationPreview, GeometryPreview, RichText, RichTextSnippet, RichTextDocument, CommentsCollection, Url, UrlInput, UserRole, UserRoleInput, IconButton } = allUnitDefinitions;
|
|
23
|
+
const unitsFactoryByBasicFieldType = {
|
|
24
|
+
"fibery/bool": () => [Bool, BoolCheckbox],
|
|
25
|
+
"fibery/date": () => [Date, DateTimeCombobox],
|
|
26
|
+
"fibery/date-range": () => [DateRange, DateRangeCombobox],
|
|
27
|
+
"fibery/date-time": () => [Date, DateTimeCombobox],
|
|
28
|
+
"fibery/date-time-range": () => [DateRange, DateRangeCombobox],
|
|
29
|
+
"fibery/text": (fieldObject) => {
|
|
30
|
+
return {
|
|
31
|
+
[TextUIMeta.Phone]: [
|
|
32
|
+
Phone,
|
|
33
|
+
PhoneInput,
|
|
34
|
+
IconButton
|
|
35
|
+
],
|
|
36
|
+
[TextUIMeta.Email]: [
|
|
37
|
+
Email,
|
|
38
|
+
EmailInput,
|
|
39
|
+
IconButton
|
|
40
|
+
],
|
|
41
|
+
[TextUIMeta.URL]: [
|
|
42
|
+
Url,
|
|
43
|
+
UrlInput,
|
|
44
|
+
IconButton
|
|
45
|
+
]
|
|
46
|
+
}[fieldObject.rawMeta["ui/type"]] || [Text, TextInput];
|
|
47
|
+
},
|
|
48
|
+
"fibery/url": () => [
|
|
49
|
+
Url,
|
|
50
|
+
UrlInput,
|
|
51
|
+
IconButton
|
|
52
|
+
],
|
|
53
|
+
"fibery/email": () => [
|
|
54
|
+
Email,
|
|
55
|
+
EmailInput,
|
|
56
|
+
IconButton
|
|
57
|
+
],
|
|
58
|
+
"fibery/emoji": () => [Emoji, IconInput],
|
|
59
|
+
"fibery/int": () => [Number, NumberInput],
|
|
60
|
+
"fibery/location": () => [
|
|
61
|
+
SingleLocationPreview,
|
|
62
|
+
Location,
|
|
63
|
+
LocationInput
|
|
64
|
+
],
|
|
65
|
+
"fibery/rich-text": NoUnitsCreator,
|
|
66
|
+
"fibery/rank": NoUnitsCreator,
|
|
67
|
+
"fibery/json-value": () => [GeometryPreview, JsonInput],
|
|
68
|
+
"fibery/uuid": NoUnitsCreator,
|
|
69
|
+
"fibery/decimal": (fieldObject) => [
|
|
70
|
+
Number,
|
|
71
|
+
NumberInput,
|
|
72
|
+
parseNumberFieldMeta(fieldObject).numberFormat === "Percent" && ProgressBar
|
|
73
|
+
],
|
|
74
|
+
"fibery/color": () => [ColorInput]
|
|
75
|
+
};
|
|
76
|
+
const fallbackFieldCreator = (fieldObject) => {
|
|
77
|
+
traceError(`basicFieldCreators["${fieldObject.type}"] is not defined`);
|
|
78
|
+
return [];
|
|
79
|
+
};
|
|
80
|
+
const unitsFactoryByFieldKind = {
|
|
81
|
+
":field/basic": (fieldObject) => {
|
|
82
|
+
return (unitsFactoryByBasicFieldType[fieldObject.type] || fallbackFieldCreator)(fieldObject);
|
|
83
|
+
},
|
|
84
|
+
":field/reference": (fieldObject, options) => {
|
|
85
|
+
if ((options.parentFieldObjects ?? []).some((f) => f.isCollection)) return options.isSharingMode ? [] : [ReferenceCollectionView];
|
|
86
|
+
if (FileReference && FileCompactReference && fieldObject.typeObject.name === "fibery/file") return [
|
|
87
|
+
FileLListItem,
|
|
88
|
+
FileCompactReference,
|
|
89
|
+
FileListItem,
|
|
90
|
+
FileReference
|
|
91
|
+
].filter(Boolean);
|
|
92
|
+
if (FileReference && fieldObject.typeObject.name === "fibery/file") return [Reference, FileReference].filter(Boolean);
|
|
93
|
+
return [
|
|
94
|
+
isAvatarExtensionEnabledType(fieldObject.typeObject) && Avatar,
|
|
95
|
+
fieldObject.name === "workflow/state" && ReferenceIcon,
|
|
96
|
+
Reference,
|
|
97
|
+
ReferenceCombobox
|
|
98
|
+
];
|
|
99
|
+
},
|
|
100
|
+
":field/reference-collection": (fieldObject, options) => {
|
|
101
|
+
const parentFieldObjects = options.parentFieldObjects ?? [];
|
|
102
|
+
const common = [CollectionCount, isAvatarExtensionEnabledType(fieldObject.typeObject) && AvatarCollection];
|
|
103
|
+
if (parentFieldObjects.some((f) => f.isCollection)) return options.isSharingMode ? [] : [ReferenceCollectionView];
|
|
104
|
+
if (isRelationViewField(fieldObject) && !options.isSharingMode) return [
|
|
105
|
+
...common,
|
|
106
|
+
ReferenceCollection,
|
|
107
|
+
ReferenceCollectionCombobox,
|
|
108
|
+
ReferenceCollectionView
|
|
109
|
+
];
|
|
110
|
+
if (isReferenceExtensionField(fieldObject)) return [...common, BackReferencesList];
|
|
111
|
+
if (isCommentExtensionField(fieldObject)) return [...common, CommentsList];
|
|
112
|
+
if (fieldObject.typeObject.name === "fibery/view") return [
|
|
113
|
+
...common,
|
|
114
|
+
ReferenceCollection,
|
|
115
|
+
ReferenceCollectionCombobox,
|
|
116
|
+
ReferenceCollectionList
|
|
117
|
+
];
|
|
118
|
+
if (fieldObject.typeObject.name === "fibery/file") return [
|
|
119
|
+
FileLList,
|
|
120
|
+
FileCompactCollection ? FileCompactCollection : ReferenceCollection,
|
|
121
|
+
FileCollectionCount ? FileCollectionCount : CollectionCount,
|
|
122
|
+
FilesGallery,
|
|
123
|
+
FileList
|
|
124
|
+
].filter(Boolean);
|
|
125
|
+
if (fieldObject.typeObject.isEnum) return [
|
|
126
|
+
...common,
|
|
127
|
+
ReferenceCollection,
|
|
128
|
+
ReferenceCollectionCombobox
|
|
129
|
+
];
|
|
130
|
+
if (fieldObject.cardinality === ":cardinality/many-to-many" && fieldObject.type === "fibery/user") return [
|
|
131
|
+
...common,
|
|
132
|
+
ReferenceCollection,
|
|
133
|
+
ReferenceCollectionCombobox
|
|
134
|
+
];
|
|
135
|
+
return [
|
|
136
|
+
...common,
|
|
137
|
+
ReferenceCollection,
|
|
138
|
+
ReferenceCollectionCombobox,
|
|
139
|
+
ReferenceCollectionList
|
|
140
|
+
];
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
const getUnitsForField = (fieldObject, options = {}) => {
|
|
144
|
+
const { showHiddenFields } = options;
|
|
145
|
+
const parentFieldObjects = options.parentFieldObjects ?? [];
|
|
146
|
+
const parentExpression = parentFieldObjects.map((f) => f.name);
|
|
147
|
+
const makeUnit = (Unit) => Unit.makeUnit({ expression: [...parentExpression, fieldObject.name] });
|
|
148
|
+
const isTopLevel = parentFieldObjects.length === 0;
|
|
149
|
+
if (fieldObject.isPublicId && isTopLevel) return [Id].filter(Boolean).map(makeUnit);
|
|
150
|
+
if (fieldObject.isTitle && isTopLevel) return [Title, TitleInput].filter(Boolean).map(makeUnit);
|
|
151
|
+
if (isAvatarExtensionField(fieldObject) && isTopLevel) return [Avatar, AvatarInput].filter(Boolean).map(makeUnit);
|
|
152
|
+
if (fieldObject.type === "Collaboration~Documents/Document") return [
|
|
153
|
+
RichText,
|
|
154
|
+
RichTextSnippet,
|
|
155
|
+
RichTextDocument
|
|
156
|
+
].filter(Boolean).map(makeUnit);
|
|
157
|
+
if (fieldObject.type === "comments/comment" && CommentsCollection) return [CommentsCollection].filter(Boolean).map(makeUnit);
|
|
158
|
+
if (isUserRoleField(fieldObject)) return [UserRole, UserRoleInput].filter(Boolean).map(makeUnit);
|
|
159
|
+
if (fieldObject.isHidden && !showHiddenFields) return [];
|
|
160
|
+
return (unitsFactoryByFieldKind[fieldObject.kind] || constant([]))(fieldObject, options).filter(truthy).map(makeUnit);
|
|
161
|
+
};
|
|
162
|
+
const staticUnitsTypeOrder = [
|
|
163
|
+
Id,
|
|
164
|
+
AvatarCollection,
|
|
165
|
+
TypeIcon,
|
|
166
|
+
TypeBadge,
|
|
167
|
+
TypeBadgeAbbr,
|
|
168
|
+
Avatar,
|
|
169
|
+
Title,
|
|
170
|
+
UserButton
|
|
171
|
+
].filter(Boolean).map(({ type }) => type);
|
|
172
|
+
function getTypeUnits() {
|
|
173
|
+
return [
|
|
174
|
+
TypeIcon,
|
|
175
|
+
TypeBadge,
|
|
176
|
+
TypeBadgeAbbr
|
|
177
|
+
].filter(Boolean).map((Unit) => Unit.makeUnit());
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* @returns flat list of all units for given type
|
|
181
|
+
*/
|
|
182
|
+
function getUnitsForType(typeObject, options = {}) {
|
|
183
|
+
return sortBy(flatMap(typeObject.fieldObjects.filter((x) => !x.isHidden), (fieldObject) => getUnitsForField(fieldObject, options).map((unit) => ({
|
|
184
|
+
unit,
|
|
185
|
+
fieldObject
|
|
186
|
+
}))).concat(getTypeUnits().map((unit) => ({
|
|
187
|
+
unit,
|
|
188
|
+
fieldObject: typeObject.titleFieldObject
|
|
189
|
+
}))), ({ unit }) => {
|
|
190
|
+
const index = staticUnitsTypeOrder.indexOf(unit.type);
|
|
191
|
+
return index === -1 ? staticUnitsTypeOrder.length : index;
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* @returns list of units grouped by field
|
|
196
|
+
*/
|
|
197
|
+
function getUnitsForTypePerField(typeObject, options = {}) {
|
|
198
|
+
const collection = [];
|
|
199
|
+
for (const fieldObject of typeObject.fieldObjects) if (!fieldObject.isHidden) {
|
|
200
|
+
const units = getUnitsForField(fieldObject, options);
|
|
201
|
+
if (units.length > 0) collection.push({
|
|
202
|
+
fieldObject,
|
|
203
|
+
units
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
return sortBy(collection, ({ units }) => {
|
|
207
|
+
return units.map((unit) => {
|
|
208
|
+
const index = staticUnitsTypeOrder.indexOf(unit.type);
|
|
209
|
+
return index === -1 ? staticUnitsTypeOrder.length : index;
|
|
210
|
+
}).sort((a, b) => a - b)[0];
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
const getHardcodedUnitsForView = (typeObject) => {
|
|
214
|
+
return [
|
|
215
|
+
TypeIcon && TypeIcon.makeUnit(),
|
|
216
|
+
Title && Title.makeUnit(),
|
|
217
|
+
...getUnitsForField(typeObject.fieldObjectsByName["fibery/creation-date"]),
|
|
218
|
+
...getUnitsForField(typeObject.fieldObjectsByName["fibery/container-app"]),
|
|
219
|
+
...getUnitsForField(typeObject.fieldObjectsByName["fibery/container-entity-id"]),
|
|
220
|
+
...getUnitsForField(typeObject.fieldObjectsByName["fibery/container-entity-type"])
|
|
221
|
+
].filter(Boolean);
|
|
222
|
+
};
|
|
223
|
+
const unitDefinitionsByTypeLookup = mapValues(groupBy(allUnitDefinitions, (x) => x.type), (value) => single(value));
|
|
224
|
+
const getUnitLabel = (typeObject, unit) => {
|
|
225
|
+
const unitDefinition = unitDefinitionsByTypeLookup[unit.type];
|
|
226
|
+
if (!unitDefinition) return "";
|
|
227
|
+
return unitDefinition.getLabel({
|
|
228
|
+
typeObject,
|
|
229
|
+
unit
|
|
230
|
+
});
|
|
231
|
+
};
|
|
232
|
+
const getUnitName = (unit) => {
|
|
233
|
+
const unitDefinition = unitDefinitionsByTypeLookup[unit.type];
|
|
234
|
+
if (!unitDefinition) return null;
|
|
235
|
+
return unitDefinition.name;
|
|
236
|
+
};
|
|
237
|
+
const getUnitDataDefinition = (unit) => {
|
|
238
|
+
if (unitDefinitionsByTypeLookup[unit.type]) return unitDefinitionsByTypeLookup[unit.type];
|
|
239
|
+
console.warn(`Unit Definition of type "${unit.type}" does not exist.`);
|
|
240
|
+
return NotFound;
|
|
241
|
+
};
|
|
242
|
+
const getCardUnitsSelect = ({ schema, typeObject, units }) => {
|
|
243
|
+
return mergeDenormalizedSelects(units.filter((unit) => {
|
|
244
|
+
return isUnitEnabled(unit) && unit.kind !== "user-button" && !unit.expression?.includes("documents/documents") && !unit.expression?.includes("whiteboards/whiteboards");
|
|
245
|
+
}).map((unit) => {
|
|
246
|
+
if (calculateUnitExpressionErrors({
|
|
247
|
+
typeObject,
|
|
248
|
+
unit
|
|
249
|
+
}).length > 0) return {};
|
|
250
|
+
const select = getUnitDataDefinition(unit).getQuerySelect({
|
|
251
|
+
schema,
|
|
252
|
+
typeObject,
|
|
253
|
+
unit
|
|
254
|
+
});
|
|
255
|
+
assert(isPlainObject(select), "getQuerySelect must return object-shaped select");
|
|
256
|
+
return select;
|
|
257
|
+
}));
|
|
258
|
+
};
|
|
259
|
+
return {
|
|
260
|
+
getTypeUnits,
|
|
261
|
+
getUnitsForType,
|
|
262
|
+
getUnitsForTypePerField,
|
|
263
|
+
getUnitsForField,
|
|
264
|
+
getHardcodedUnitsForView,
|
|
265
|
+
getUnitLabel,
|
|
266
|
+
getUnitName,
|
|
267
|
+
getCardUnitsSelect,
|
|
268
|
+
getUnitDataDefinition
|
|
269
|
+
};
|
|
270
|
+
};
|
|
271
|
+
//#endregion
|
|
272
|
+
export { makeUnitDefinitionsFactory };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { NumberDisplaySettings } from "../field-utils/number.js";
|
|
2
|
+
import { $TSFixMe } from "../tsfixme.js";
|
|
3
|
+
import { Schema, TypeObject } from "@fibery/schema";
|
|
4
|
+
import { FiberyObject } from "@fibery/expression-utils/src/types";
|
|
5
|
+
//#region src/units/types.d.ts
|
|
6
|
+
type ButtonUnit = {
|
|
7
|
+
kind: "user-button";
|
|
8
|
+
type: "user-button" | "icon-button";
|
|
9
|
+
data: {
|
|
10
|
+
id: string;
|
|
11
|
+
typeId: string;
|
|
12
|
+
};
|
|
13
|
+
label: string;
|
|
14
|
+
checked?: boolean;
|
|
15
|
+
hideWhenEmpty?: boolean;
|
|
16
|
+
icon?: string;
|
|
17
|
+
};
|
|
18
|
+
type UnitExpression = string[];
|
|
19
|
+
type DbUnit = {
|
|
20
|
+
kind: "db";
|
|
21
|
+
type: "type-icon" | "type-badge" | "type-badge-abbr";
|
|
22
|
+
expression?: UnitExpression;
|
|
23
|
+
checked?: boolean;
|
|
24
|
+
hideWhenEmpty?: boolean;
|
|
25
|
+
};
|
|
26
|
+
type FieldUnit = {
|
|
27
|
+
kind: "field";
|
|
28
|
+
type: "avatar" | "avatar-collection" | "avatar-input" | "back-references-list" | "bool" | "bool-checkbox" | "collection-count" | "color-input" | "comments-list" | "date" | "date-time" | "date-time-range" | "date-time-combobox" | "date-range" | "date-range-combobox" | "email" | "email-input" | "emoji" | "field" | "files-collection" | "files-gallery" | "files-list" | "files-list-item" | "files-l-list" | "files-l-list-item" | "file-reference" | "file-compact-collection" | "file-compact-reference" | "file-collection-count" | "geometry-preview" | "icon-button" | "icon-input" | "id" | "json-input" | "location" | "location-input" | "number" | "number-input" | "phone" | "phone-input" | "progress-bar" | "reference" | "reference-icon" | "reference-combobox" | "reference-collection" | "reference-collection-list" | "reference-collection-view" | "reference-collection-combobox" | "rich-text-snippet" | "rich-text-document" | "single-location-preview" | "text" | "text-input" | "title" | "title-input" | "url" | "url-input" | "user-role" | "user-role-input";
|
|
29
|
+
expression: UnitExpression;
|
|
30
|
+
checked?: boolean;
|
|
31
|
+
settings?: Record<string, unknown>;
|
|
32
|
+
hideWhenEmpty?: boolean;
|
|
33
|
+
};
|
|
34
|
+
type Unit = FieldUnit | ButtonUnit | DbUnit;
|
|
35
|
+
type ToPure<T extends Unit> = Omit<T, "checked">;
|
|
36
|
+
type PureUnit = ToPure<FieldUnit> | ToPure<ButtonUnit> | ToPure<DbUnit>;
|
|
37
|
+
type UnitDataDefinition<T extends Unit> = {
|
|
38
|
+
type: string;
|
|
39
|
+
name: string;
|
|
40
|
+
canEdit: (params: {
|
|
41
|
+
typeObject: TypeObject;
|
|
42
|
+
unit: T;
|
|
43
|
+
}) => boolean;
|
|
44
|
+
makeUnit: (params?: {
|
|
45
|
+
expression: UnitExpression;
|
|
46
|
+
}) => PureUnit;
|
|
47
|
+
getLabel: (params: {
|
|
48
|
+
typeObject: TypeObject;
|
|
49
|
+
unit: T;
|
|
50
|
+
}) => string;
|
|
51
|
+
getQuerySelect: (params: {
|
|
52
|
+
typeObject: TypeObject;
|
|
53
|
+
unit: T;
|
|
54
|
+
schema: Schema;
|
|
55
|
+
}) => $TSFixMe;
|
|
56
|
+
calculateErrors: (params: {
|
|
57
|
+
typeObject: TypeObject;
|
|
58
|
+
unit: T;
|
|
59
|
+
}) => $TSFixMe[];
|
|
60
|
+
getExportValue: (params: {
|
|
61
|
+
typeObject: TypeObject;
|
|
62
|
+
unit: T;
|
|
63
|
+
object: FiberyObject;
|
|
64
|
+
displaySettings: NumberDisplaySettings;
|
|
65
|
+
}) => unknown;
|
|
66
|
+
canExport: (params: {
|
|
67
|
+
unit: T;
|
|
68
|
+
}) => boolean;
|
|
69
|
+
getExportLabel?: (params: {
|
|
70
|
+
typeObject: TypeObject;
|
|
71
|
+
unit: T;
|
|
72
|
+
}) => string;
|
|
73
|
+
};
|
|
74
|
+
//#endregion
|
|
75
|
+
export { ButtonUnit, DbUnit, FieldUnit, PureUnit, Unit, UnitDataDefinition, UnitExpression };
|
|
File without changes
|