@fibery/views 19.1.2 → 20.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/_virtual/_rolldown/runtime.js +13 -0
- package/lib/errors.d.ts +4 -0
- package/lib/errors.js +4 -0
- package/lib/field-utils/avatar.d.ts +23 -0
- package/lib/field-utils/avatar.js +35 -0
- package/lib/field-utils/back-references.d.ts +18 -0
- package/lib/field-utils/back-references.js +15 -0
- package/lib/field-utils/comments.d.ts +63 -0
- package/lib/field-utils/comments.js +41 -0
- package/lib/field-utils/date-time.d.ts +17 -0
- package/lib/field-utils/date-time.js +31 -0
- package/lib/field-utils/enum-value.d.ts +16 -0
- package/lib/field-utils/enum-value.js +26 -0
- package/lib/field-utils/file.d.ts +7 -0
- package/lib/field-utils/file.js +14 -0
- package/lib/field-utils/icon.d.ts +13 -0
- package/lib/field-utils/icon.js +17 -0
- package/lib/field-utils/number.d.ts +34 -0
- package/lib/field-utils/number.js +64 -0
- package/lib/field-utils/reference-collection.d.ts +16 -0
- package/lib/field-utils/reference-collection.js +49 -0
- package/lib/field-utils/reference.d.ts +10 -0
- package/lib/field-utils/reference.js +55 -0
- package/lib/field-utils/relation-view.d.ts +5 -0
- package/lib/field-utils/relation-view.js +7 -0
- package/lib/field-utils/rich-text.d.ts +16 -0
- package/lib/field-utils/rich-text.js +33 -0
- package/lib/field-utils/text.d.ts +33 -0
- package/lib/field-utils/text.js +40 -0
- package/lib/field-utils/user-active.d.ts +11 -0
- package/lib/field-utils/user-active.js +24 -0
- package/lib/field-utils/user-role.d.ts +9 -0
- package/lib/field-utils/user-role.js +23 -0
- package/lib/field-utils/workflow.d.ts +18 -0
- package/lib/field-utils/workflow.js +48 -0
- package/lib/index.d.ts +34 -1
- package/lib/index.js +169 -16
- package/lib/meta-validation.d.ts +13 -0
- package/lib/meta-validation.js +53 -0
- package/lib/private/board.d.ts +18 -0
- package/lib/private/board.js +234 -0
- package/lib/private/calendar.d.ts +17 -0
- package/lib/private/calendar.js +82 -0
- package/lib/private/feed.d.ts +17 -0
- package/lib/private/feed.js +81 -0
- package/lib/private/form.d.ts +27 -0
- package/lib/private/form.js +57 -0
- package/lib/private/map.d.ts +17 -0
- package/lib/private/map.js +81 -0
- package/lib/private/smart-folder.d.ts +33 -0
- package/lib/private/smart-folder.js +165 -0
- package/lib/private/timeline.d.ts +41 -0
- package/lib/private/timeline.js +223 -0
- package/lib/private/units.d.ts +12 -0
- package/lib/private/units.js +131 -0
- package/lib/private/utils.d.ts +66 -0
- package/lib/private/utils.js +179 -0
- package/lib/unit-definitions/avatar-collection.d.ts +5 -0
- package/lib/unit-definitions/avatar-collection.js +59 -0
- package/lib/unit-definitions/avatar-input.d.ts +5 -0
- package/lib/unit-definitions/avatar-input.js +12 -0
- package/lib/unit-definitions/avatar.d.ts +5 -0
- package/lib/unit-definitions/avatar.js +95 -0
- package/lib/unit-definitions/back-references-list.d.ts +5 -0
- package/lib/unit-definitions/back-references-list.js +39 -0
- package/lib/unit-definitions/bool-checkbox.d.ts +5 -0
- package/lib/unit-definitions/bool-checkbox.js +25 -0
- package/lib/unit-definitions/bool.d.ts +5 -0
- package/lib/unit-definitions/bool.js +25 -0
- package/lib/unit-definitions/collection-count.d.ts +5 -0
- package/lib/unit-definitions/collection-count.js +35 -0
- package/lib/unit-definitions/color-input.d.ts +5 -0
- package/lib/unit-definitions/color-input.js +24 -0
- package/lib/unit-definitions/comments-list.d.ts +5 -0
- package/lib/unit-definitions/comments-list.js +27 -0
- package/lib/unit-definitions/date-range-combobox.d.ts +5 -0
- package/lib/unit-definitions/date-range-combobox.js +25 -0
- package/lib/unit-definitions/date-range.d.ts +5 -0
- package/lib/unit-definitions/date-range.js +25 -0
- package/lib/unit-definitions/date-time-combobox.d.ts +5 -0
- package/lib/unit-definitions/date-time-combobox.js +25 -0
- package/lib/unit-definitions/date.d.ts +5 -0
- package/lib/unit-definitions/date.js +25 -0
- package/lib/unit-definitions/email-input.d.ts +5 -0
- package/lib/unit-definitions/email-input.js +12 -0
- package/lib/unit-definitions/email.d.ts +5 -0
- package/lib/unit-definitions/email.js +17 -0
- package/lib/unit-definitions/emoji.d.ts +5 -0
- package/lib/unit-definitions/emoji.js +17 -0
- package/lib/unit-definitions/file-collection-count.d.ts +5 -0
- package/lib/unit-definitions/file-collection-count.js +34 -0
- package/lib/unit-definitions/file-compact-collection.d.ts +5 -0
- package/lib/unit-definitions/file-compact-collection.js +34 -0
- package/lib/unit-definitions/file-compact-reference.d.ts +5 -0
- package/lib/unit-definitions/file-compact-reference.js +47 -0
- package/lib/unit-definitions/file-reference.d.ts +5 -0
- package/lib/unit-definitions/file-reference.js +30 -0
- package/lib/unit-definitions/files-gallery.d.ts +5 -0
- package/lib/unit-definitions/files-gallery.js +34 -0
- package/lib/unit-definitions/files-l-list-item.d.ts +5 -0
- package/lib/unit-definitions/files-l-list-item.js +30 -0
- package/lib/unit-definitions/files-l-list.d.ts +5 -0
- package/lib/unit-definitions/files-l-list.js +34 -0
- package/lib/unit-definitions/files-list-item.d.ts +5 -0
- package/lib/unit-definitions/files-list-item.js +30 -0
- package/lib/unit-definitions/files-list.d.ts +5 -0
- package/lib/unit-definitions/files-list.js +34 -0
- package/lib/unit-definitions/geometry-preview.d.ts +5 -0
- package/lib/unit-definitions/geometry-preview.js +17 -0
- package/lib/unit-definitions/icon-button.d.ts +5 -0
- package/lib/unit-definitions/icon-button.js +41 -0
- package/lib/unit-definitions/icon-input.d.ts +5 -0
- package/lib/unit-definitions/icon-input.js +12 -0
- package/lib/unit-definitions/id.d.ts +5 -0
- package/lib/unit-definitions/id.js +30 -0
- package/lib/unit-definitions/index.d.ts +28 -0
- package/lib/unit-definitions/index.js +60 -0
- package/lib/unit-definitions/json-input.d.ts +5 -0
- package/lib/unit-definitions/json-input.js +24 -0
- package/lib/unit-definitions/location-input.d.ts +5 -0
- package/lib/unit-definitions/location-input.js +18 -0
- package/lib/unit-definitions/location.d.ts +5 -0
- package/lib/unit-definitions/location.js +17 -0
- package/lib/unit-definitions/not-found.d.ts +5 -0
- package/lib/unit-definitions/not-found.js +22 -0
- package/lib/unit-definitions/number-input.d.ts +5 -0
- package/lib/unit-definitions/number-input.js +25 -0
- package/lib/unit-definitions/number.d.ts +5 -0
- package/lib/unit-definitions/number.js +31 -0
- package/lib/unit-definitions/phone-input.d.ts +5 -0
- package/lib/unit-definitions/phone-input.js +12 -0
- package/lib/unit-definitions/phone.d.ts +5 -0
- package/lib/unit-definitions/phone.js +12 -0
- package/lib/unit-definitions/progress-bar.d.ts +5 -0
- package/lib/unit-definitions/progress-bar.js +32 -0
- package/lib/unit-definitions/reference-collection-combobox.d.ts +5 -0
- package/lib/unit-definitions/reference-collection-combobox.js +21 -0
- package/lib/unit-definitions/reference-collection-list.d.ts +5 -0
- package/lib/unit-definitions/reference-collection-list.js +21 -0
- package/lib/unit-definitions/reference-collection-view.d.ts +5 -0
- package/lib/unit-definitions/reference-collection-view.js +19 -0
- package/lib/unit-definitions/reference-collection.d.ts +5 -0
- package/lib/unit-definitions/reference-collection.js +30 -0
- package/lib/unit-definitions/reference-combobox.d.ts +5 -0
- package/lib/unit-definitions/reference-combobox.js +21 -0
- package/lib/unit-definitions/reference-icon.d.ts +5 -0
- package/lib/unit-definitions/reference-icon.js +12 -0
- package/lib/unit-definitions/reference.d.ts +5 -0
- package/lib/unit-definitions/reference.js +63 -0
- package/lib/unit-definitions/rich-text-document.d.ts +5 -0
- package/lib/unit-definitions/rich-text-document.js +26 -0
- package/lib/unit-definitions/rich-text-snippet.d.ts +6 -0
- package/lib/unit-definitions/rich-text-snippet.js +35 -0
- package/lib/unit-definitions/single-location-preview.d.ts +5 -0
- package/lib/unit-definitions/single-location-preview.js +17 -0
- package/lib/unit-definitions/text-input.d.ts +5 -0
- package/lib/unit-definitions/text-input.js +25 -0
- package/lib/unit-definitions/text.d.ts +5 -0
- package/lib/unit-definitions/text.js +25 -0
- package/lib/unit-definitions/title-input.d.ts +5 -0
- package/lib/unit-definitions/title-input.js +19 -0
- package/lib/unit-definitions/title.d.ts +5 -0
- package/lib/unit-definitions/title.js +33 -0
- package/lib/unit-definitions/type-badge-abbr.d.ts +5 -0
- package/lib/unit-definitions/type-badge-abbr.js +28 -0
- package/lib/unit-definitions/type-badge.d.ts +5 -0
- package/lib/unit-definitions/type-badge.js +28 -0
- package/lib/unit-definitions/type-icon.d.ts +5 -0
- package/lib/unit-definitions/type-icon.js +28 -0
- package/lib/unit-definitions/url-input.d.ts +5 -0
- package/lib/unit-definitions/url-input.js +12 -0
- package/lib/unit-definitions/url.d.ts +5 -0
- package/lib/unit-definitions/url.js +17 -0
- package/lib/unit-definitions/user-button.d.ts +5 -0
- package/lib/unit-definitions/user-button.js +26 -0
- package/lib/unit-definitions/user-role-input.d.ts +5 -0
- package/lib/unit-definitions/user-role-input.js +12 -0
- package/lib/unit-definitions/user-role.d.ts +5 -0
- package/lib/unit-definitions/user-role.js +35 -0
- package/lib/unit-utils/access.d.ts +12 -0
- package/lib/unit-utils/access.js +9 -0
- package/lib/unit-utils/can-edit-field.d.ts +9 -0
- package/lib/unit-utils/can-edit-field.js +7 -0
- package/lib/unit-utils/common.d.ts +37 -0
- package/lib/unit-utils/common.js +41 -0
- package/lib/unit-utils/decimal.d.ts +44 -0
- package/lib/unit-utils/decimal.js +248 -0
- package/lib/unit-utils/dynamic-keys.d.ts +10 -0
- package/lib/unit-utils/dynamic-keys.js +12 -0
- package/lib/unit-utils/enums.d.ts +30 -0
- package/lib/unit-utils/enums.js +48 -0
- package/lib/unit-utils/formatters.d.ts +53 -0
- package/lib/unit-utils/formatters.js +128 -0
- package/lib/unit-utils/get-export-value.d.ts +48 -0
- package/lib/unit-utils/get-export-value.js +83 -0
- package/lib/unit-utils/get-field-label.d.ts +9 -0
- package/lib/unit-utils/get-field-label.js +11 -0
- package/lib/unit-utils/get-unmatched-unit-label.d.ts +5 -0
- package/lib/unit-utils/get-unmatched-unit-label.js +5 -0
- package/lib/unit-utils/schema.d.ts +7 -0
- package/lib/unit-utils/schema.js +9 -0
- package/lib/unit-utils/wrap-normalized-in-expression.d.ts +6 -0
- package/lib/unit-utils/wrap-normalized-in-expression.js +15 -0
- package/lib/units/board.d.ts +50 -0
- package/lib/units/board.js +24 -0
- package/lib/units/canvas/all-units-data-definitions.d.ts +19 -0
- package/lib/units/canvas/all-units-data-definitions.js +42 -0
- package/lib/units/canvas/index.d.ts +49 -0
- package/lib/units/canvas/index.js +27 -0
- package/lib/units/canvas/type-badge-abbr.d.ts +41 -0
- package/lib/units/canvas/type-badge-abbr.js +11 -0
- package/lib/units/canvas/type-badge.d.ts +41 -0
- package/lib/units/canvas/type-badge.js +11 -0
- package/lib/units/default.d.ts +50 -0
- package/lib/units/default.js +23 -0
- package/lib/units/gallery.d.ts +7 -0
- package/lib/units/gallery.js +21 -0
- package/lib/units/gantt.d.ts +51 -0
- package/lib/units/gantt.js +28 -0
- package/lib/units/get-unit-definitions-for-view-type.d.ts +5 -0
- package/lib/units/get-unit-definitions-for-view-type.js +22 -0
- package/lib/units/grid.d.ts +49 -0
- package/lib/units/grid.js +81 -0
- package/lib/units/list.d.ts +52 -0
- package/lib/units/list.js +23 -0
- package/lib/units/make-factory.d.ts +53 -0
- package/lib/units/make-factory.js +272 -0
- package/lib/units/types.d.ts +74 -0
- package/lib/units/types.js +0 -0
- package/package.json +18 -40
- package/lib/src/errors.d.ts +0 -2
- package/lib/src/errors.js +0 -6
- package/lib/src/field-utils/avatar.d.ts +0 -20
- package/lib/src/field-utils/avatar.js +0 -39
- package/lib/src/field-utils/back-references.d.ts +0 -15
- package/lib/src/field-utils/back-references.js +0 -21
- package/lib/src/field-utils/comments.d.ts +0 -60
- package/lib/src/field-utils/comments.js +0 -46
- package/lib/src/field-utils/date-time.d.ts +0 -14
- package/lib/src/field-utils/date-time.js +0 -56
- package/lib/src/field-utils/enum-value.d.ts +0 -13
- package/lib/src/field-utils/enum-value.js +0 -29
- package/lib/src/field-utils/file.d.ts +0 -4
- package/lib/src/field-utils/file.js +0 -15
- package/lib/src/field-utils/icon.d.ts +0 -10
- package/lib/src/field-utils/icon.js +0 -26
- package/lib/src/field-utils/number.d.ts +0 -31
- package/lib/src/field-utils/number.js +0 -91
- package/lib/src/field-utils/reference-collection.d.ts +0 -13
- package/lib/src/field-utils/reference-collection.js +0 -67
- package/lib/src/field-utils/reference.d.ts +0 -7
- package/lib/src/field-utils/reference.js +0 -54
- package/lib/src/field-utils/relation-view.d.ts +0 -2
- package/lib/src/field-utils/relation-view.js +0 -12
- package/lib/src/field-utils/rich-text.d.ts +0 -13
- package/lib/src/field-utils/rich-text.js +0 -38
- package/lib/src/field-utils/text.d.ts +0 -35
- package/lib/src/field-utils/text.js +0 -40
- package/lib/src/field-utils/user-active.d.ts +0 -8
- package/lib/src/field-utils/user-active.js +0 -23
- package/lib/src/field-utils/user-role.d.ts +0 -6
- package/lib/src/field-utils/user-role.js +0 -25
- package/lib/src/field-utils/workflow.d.ts +0 -15
- package/lib/src/field-utils/workflow.js +0 -53
- package/lib/src/index.d.ts +0 -30
- package/lib/src/index.js +0 -263
- package/lib/src/meta-validation.d.ts +0 -10
- package/lib/src/meta-validation.js +0 -78
- package/lib/src/private/board.d.ts +0 -15
- package/lib/src/private/board.js +0 -327
- package/lib/src/private/calendar.d.ts +0 -14
- package/lib/src/private/calendar.js +0 -123
- package/lib/src/private/feed.d.ts +0 -14
- package/lib/src/private/feed.js +0 -120
- package/lib/src/private/form.d.ts +0 -25
- package/lib/src/private/form.js +0 -61
- package/lib/src/private/map.d.ts +0 -14
- package/lib/src/private/map.js +0 -120
- package/lib/src/private/smart-folder.d.ts +0 -31
- package/lib/src/private/smart-folder.js +0 -277
- package/lib/src/private/test-data/garbage-test.d.ts +0 -649
- package/lib/src/private/test-data/garbage-test.js +0 -520
- package/lib/src/private/test-data/kanban.d.ts +0 -1123
- package/lib/src/private/test-data/kanban.js +0 -1203
- package/lib/src/private/test-data/tasks.d.ts +0 -3216
- package/lib/src/private/test-data/tasks.js +0 -2731
- package/lib/src/private/timeline.d.ts +0 -39
- package/lib/src/private/timeline.js +0 -325
- package/lib/src/private/units.d.ts +0 -10
- package/lib/src/private/units.js +0 -165
- package/lib/src/private/utils.d.ts +0 -64
- package/lib/src/private/utils.js +0 -273
- package/lib/src/tsfixme.d.ts +0 -1
- package/lib/src/tsfixme.js +0 -2
- package/lib/src/unit-definitions/avatar-collection.d.ts +0 -2
- package/lib/src/unit-definitions/avatar-collection.js +0 -53
- package/lib/src/unit-definitions/avatar-input.d.ts +0 -2
- package/lib/src/unit-definitions/avatar-input.js +0 -12
- package/lib/src/unit-definitions/avatar.d.ts +0 -2
- package/lib/src/unit-definitions/avatar.js +0 -87
- package/lib/src/unit-definitions/back-references-list.d.ts +0 -2
- package/lib/src/unit-definitions/back-references-list.js +0 -38
- package/lib/src/unit-definitions/bool-checkbox.d.ts +0 -2
- package/lib/src/unit-definitions/bool-checkbox.js +0 -25
- package/lib/src/unit-definitions/bool.d.ts +0 -2
- package/lib/src/unit-definitions/bool.js +0 -22
- package/lib/src/unit-definitions/collection-count.d.ts +0 -2
- package/lib/src/unit-definitions/collection-count.js +0 -32
- package/lib/src/unit-definitions/color-input.d.ts +0 -2
- package/lib/src/unit-definitions/color-input.js +0 -21
- package/lib/src/unit-definitions/comments-list.d.ts +0 -2
- package/lib/src/unit-definitions/comments-list.js +0 -25
- package/lib/src/unit-definitions/date-range-combobox.d.ts +0 -2
- package/lib/src/unit-definitions/date-range-combobox.js +0 -22
- package/lib/src/unit-definitions/date-range.d.ts +0 -2
- package/lib/src/unit-definitions/date-range.js +0 -22
- package/lib/src/unit-definitions/date-time-combobox.d.ts +0 -2
- package/lib/src/unit-definitions/date-time-combobox.js +0 -22
- package/lib/src/unit-definitions/date.d.ts +0 -2
- package/lib/src/unit-definitions/date.js +0 -22
- package/lib/src/unit-definitions/email-input.d.ts +0 -2
- package/lib/src/unit-definitions/email-input.js +0 -12
- package/lib/src/unit-definitions/email.d.ts +0 -2
- package/lib/src/unit-definitions/email.js +0 -17
- package/lib/src/unit-definitions/emoji.d.ts +0 -2
- package/lib/src/unit-definitions/emoji.js +0 -17
- package/lib/src/unit-definitions/file-collection-count.d.ts +0 -2
- package/lib/src/unit-definitions/file-collection-count.js +0 -32
- package/lib/src/unit-definitions/file-compact-collection.d.ts +0 -2
- package/lib/src/unit-definitions/file-compact-collection.js +0 -32
- package/lib/src/unit-definitions/file-compact-reference.d.ts +0 -2
- package/lib/src/unit-definitions/file-compact-reference.js +0 -37
- package/lib/src/unit-definitions/file-reference.d.ts +0 -2
- package/lib/src/unit-definitions/file-reference.js +0 -28
- package/lib/src/unit-definitions/files-gallery.d.ts +0 -2
- package/lib/src/unit-definitions/files-gallery.js +0 -32
- package/lib/src/unit-definitions/files-l-list-item.d.ts +0 -2
- package/lib/src/unit-definitions/files-l-list-item.js +0 -28
- package/lib/src/unit-definitions/files-l-list.d.ts +0 -2
- package/lib/src/unit-definitions/files-l-list.js +0 -32
- package/lib/src/unit-definitions/files-list-item.d.ts +0 -2
- package/lib/src/unit-definitions/files-list-item.js +0 -28
- package/lib/src/unit-definitions/files-list.d.ts +0 -2
- package/lib/src/unit-definitions/files-list.js +0 -32
- package/lib/src/unit-definitions/geometry-preview.d.ts +0 -2
- package/lib/src/unit-definitions/geometry-preview.js +0 -17
- package/lib/src/unit-definitions/icon-button.d.ts +0 -2
- package/lib/src/unit-definitions/icon-button.js +0 -29
- package/lib/src/unit-definitions/icon-input.d.ts +0 -2
- package/lib/src/unit-definitions/icon-input.js +0 -12
- package/lib/src/unit-definitions/id.d.ts +0 -2
- package/lib/src/unit-definitions/id.js +0 -29
- package/lib/src/unit-definitions/index.d.ts +0 -27
- package/lib/src/unit-definitions/index.js +0 -57
- package/lib/src/unit-definitions/json-input.d.ts +0 -2
- package/lib/src/unit-definitions/json-input.js +0 -21
- package/lib/src/unit-definitions/location-input.d.ts +0 -2
- package/lib/src/unit-definitions/location-input.js +0 -18
- package/lib/src/unit-definitions/location.d.ts +0 -2
- package/lib/src/unit-definitions/location.js +0 -17
- package/lib/src/unit-definitions/not-found.d.ts +0 -2
- package/lib/src/unit-definitions/not-found.js +0 -24
- package/lib/src/unit-definitions/number-input.d.ts +0 -2
- package/lib/src/unit-definitions/number-input.js +0 -22
- package/lib/src/unit-definitions/number.d.ts +0 -2
- package/lib/src/unit-definitions/number.js +0 -25
- package/lib/src/unit-definitions/phone-input.d.ts +0 -2
- package/lib/src/unit-definitions/phone-input.js +0 -12
- package/lib/src/unit-definitions/phone.d.ts +0 -2
- package/lib/src/unit-definitions/phone.js +0 -12
- package/lib/src/unit-definitions/progress-bar.d.ts +0 -2
- package/lib/src/unit-definitions/progress-bar.js +0 -29
- package/lib/src/unit-definitions/reference-collection-combobox.d.ts +0 -2
- package/lib/src/unit-definitions/reference-collection-combobox.js +0 -21
- package/lib/src/unit-definitions/reference-collection-list.d.ts +0 -2
- package/lib/src/unit-definitions/reference-collection-list.js +0 -22
- package/lib/src/unit-definitions/reference-collection-view.d.ts +0 -2
- package/lib/src/unit-definitions/reference-collection-view.js +0 -19
- package/lib/src/unit-definitions/reference-collection.d.ts +0 -2
- package/lib/src/unit-definitions/reference-collection.js +0 -28
- package/lib/src/unit-definitions/reference-combobox.d.ts +0 -2
- package/lib/src/unit-definitions/reference-combobox.js +0 -21
- package/lib/src/unit-definitions/reference-icon.d.ts +0 -2
- package/lib/src/unit-definitions/reference-icon.js +0 -12
- package/lib/src/unit-definitions/reference.d.ts +0 -2
- package/lib/src/unit-definitions/reference.js +0 -61
- package/lib/src/unit-definitions/rich-text-document.d.ts +0 -2
- package/lib/src/unit-definitions/rich-text-document.js +0 -22
- package/lib/src/unit-definitions/rich-text-snippet.d.ts +0 -3
- package/lib/src/unit-definitions/rich-text-snippet.js +0 -34
- package/lib/src/unit-definitions/single-location-preview.d.ts +0 -2
- package/lib/src/unit-definitions/single-location-preview.js +0 -17
- package/lib/src/unit-definitions/text-input.d.ts +0 -2
- package/lib/src/unit-definitions/text-input.js +0 -22
- package/lib/src/unit-definitions/text.d.ts +0 -2
- package/lib/src/unit-definitions/text.js +0 -22
- package/lib/src/unit-definitions/title-input.d.ts +0 -2
- package/lib/src/unit-definitions/title-input.js +0 -16
- package/lib/src/unit-definitions/title.d.ts +0 -2
- package/lib/src/unit-definitions/title.js +0 -34
- package/lib/src/unit-definitions/type-badge-abbr.d.ts +0 -2
- package/lib/src/unit-definitions/type-badge-abbr.js +0 -25
- package/lib/src/unit-definitions/type-badge.d.ts +0 -2
- package/lib/src/unit-definitions/type-badge.js +0 -25
- package/lib/src/unit-definitions/type-icon.d.ts +0 -2
- package/lib/src/unit-definitions/type-icon.js +0 -25
- package/lib/src/unit-definitions/url-input.d.ts +0 -2
- package/lib/src/unit-definitions/url-input.js +0 -12
- package/lib/src/unit-definitions/url.d.ts +0 -2
- package/lib/src/unit-definitions/url.js +0 -17
- package/lib/src/unit-definitions/user-button.d.ts +0 -2
- package/lib/src/unit-definitions/user-button.js +0 -23
- package/lib/src/unit-definitions/user-role-input.d.ts +0 -2
- package/lib/src/unit-definitions/user-role-input.js +0 -12
- package/lib/src/unit-definitions/user-role.d.ts +0 -2
- package/lib/src/unit-definitions/user-role.js +0 -29
- package/lib/src/unit-utils/access.d.ts +0 -9
- package/lib/src/unit-utils/access.js +0 -14
- package/lib/src/unit-utils/can-edit-field.d.ts +0 -6
- package/lib/src/unit-utils/can-edit-field.js +0 -8
- package/lib/src/unit-utils/common.d.ts +0 -14
- package/lib/src/unit-utils/common.js +0 -43
- package/lib/src/unit-utils/decimal.d.ts +0 -42
- package/lib/src/unit-utils/decimal.js +0 -418
- package/lib/src/unit-utils/dynamic-keys.d.ts +0 -7
- package/lib/src/unit-utils/dynamic-keys.js +0 -13
- package/lib/src/unit-utils/enums.d.ts +0 -27
- package/lib/src/unit-utils/enums.js +0 -69
- package/lib/src/unit-utils/formatters.d.ts +0 -50
- package/lib/src/unit-utils/formatters.js +0 -163
- package/lib/src/unit-utils/get-export-value.d.ts +0 -45
- package/lib/src/unit-utils/get-export-value.js +0 -83
- package/lib/src/unit-utils/get-field-label.d.ts +0 -6
- package/lib/src/unit-utils/get-field-label.js +0 -10
- package/lib/src/unit-utils/get-unmatched-unit-label.d.ts +0 -2
- package/lib/src/unit-utils/get-unmatched-unit-label.js +0 -9
- package/lib/src/unit-utils/schema.d.ts +0 -4
- package/lib/src/unit-utils/schema.js +0 -12
- package/lib/src/unit-utils/wrap-normalized-in-expression.d.ts +0 -3
- package/lib/src/unit-utils/wrap-normalized-in-expression.js +0 -14
- package/lib/src/units/board.d.ts +0 -46
- package/lib/src/units/board.js +0 -51
- package/lib/src/units/canvas/all-units-data-definitions.d.ts +0 -18
- package/lib/src/units/canvas/all-units-data-definitions.js +0 -40
- package/lib/src/units/canvas/index.d.ts +0 -45
- package/lib/src/units/canvas/index.js +0 -48
- package/lib/src/units/canvas/type-badge-abbr.d.ts +0 -36
- package/lib/src/units/canvas/type-badge-abbr.js +0 -11
- package/lib/src/units/canvas/type-badge.d.ts +0 -36
- package/lib/src/units/canvas/type-badge.js +0 -11
- package/lib/src/units/default.d.ts +0 -46
- package/lib/src/units/default.js +0 -51
- package/lib/src/units/gallery.d.ts +0 -3
- package/lib/src/units/gallery.js +0 -18
- package/lib/src/units/gantt.d.ts +0 -47
- package/lib/src/units/gantt.js +0 -59
- package/lib/src/units/get-unit-definitions-for-view-type.d.ts +0 -2
- package/lib/src/units/get-unit-definitions-for-view-type.js +0 -64
- package/lib/src/units/grid.d.ts +0 -45
- package/lib/src/units/grid.js +0 -71
- package/lib/src/units/list.d.ts +0 -46
- package/lib/src/units/list.js +0 -49
- package/lib/src/units/make-factory.d.ts +0 -51
- package/lib/src/units/make-factory.js +0 -260
- package/lib/src/units/types.d.ts +0 -73
- package/lib/src/units/types.js +0 -2
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { hasAccessToSecretKeyPrefix, makeDynamicKey } from "../unit-utils/dynamic-keys.js";
|
|
2
|
+
import { getFieldObjectsByFieldExpression } from "@fibery/expression-utils/src/utils";
|
|
3
|
+
import { denormalizeSelect, normalizeSelect, toSelectMapClause } from "@fibery/query-utils/src/select";
|
|
4
|
+
//#region src/field-utils/rich-text.ts
|
|
5
|
+
const hasAccessToSecretKey = makeDynamicKey(hasAccessToSecretKeyPrefix);
|
|
6
|
+
const getHasAccessToSecretExpr = (expression) => ["q/access?", [...expression, "Collaboration~Documents/secret"]];
|
|
7
|
+
const getHasAccessToSecret = (expression) => ({ [hasAccessToSecretKey]: getHasAccessToSecretExpr(expression) });
|
|
8
|
+
function getRichTextQuerySelect({ typeObject, unit: { expression }, includeSnippet }) {
|
|
9
|
+
const fieldObjects = getFieldObjectsByFieldExpression({
|
|
10
|
+
typeObject,
|
|
11
|
+
expression
|
|
12
|
+
});
|
|
13
|
+
const { typeObject: terminalTypeObject } = fieldObjects[fieldObjects.length - 1];
|
|
14
|
+
const innerNormalized = normalizeSelect({
|
|
15
|
+
...getHasAccessToSecret(expression),
|
|
16
|
+
...toSelectMapClause([terminalTypeObject.idField, "Collaboration~Documents/secret"]),
|
|
17
|
+
...includeSnippet ? toSelectMapClause([terminalTypeObject.idField, "Collaboration~Documents/Snippet"]) : {}
|
|
18
|
+
});
|
|
19
|
+
return denormalizeSelect([...expression].reverse().reduce((inner, field, reversedIndex) => {
|
|
20
|
+
const originalIndex = expression.length - 1 - reversedIndex;
|
|
21
|
+
if (!(originalIndex === expression.length - 1)) {
|
|
22
|
+
const { idField } = fieldObjects[originalIndex].typeObject;
|
|
23
|
+
const innerWithId = idField ? {
|
|
24
|
+
[idField]: idField,
|
|
25
|
+
...inner
|
|
26
|
+
} : inner;
|
|
27
|
+
return { [field]: innerWithId };
|
|
28
|
+
}
|
|
29
|
+
return { [field]: inner };
|
|
30
|
+
}, innerNormalized));
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { getHasAccessToSecret, getHasAccessToSecretExpr, getRichTextQuerySelect, hasAccessToSecretKey };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//#region src/field-utils/text.d.ts
|
|
2
|
+
declare const TextUIMetaKey = "ui/type";
|
|
3
|
+
declare const TextUIMeta: {
|
|
4
|
+
Phone: string;
|
|
5
|
+
Email: string;
|
|
6
|
+
URL: string;
|
|
7
|
+
};
|
|
8
|
+
declare const TextTypes: {
|
|
9
|
+
CustomPhone: string;
|
|
10
|
+
CustomEmail: string;
|
|
11
|
+
CustomURL: string;
|
|
12
|
+
};
|
|
13
|
+
declare const TextTypeToFiberyType: {
|
|
14
|
+
[TextTypes.CustomPhone]: string;
|
|
15
|
+
[TextTypes.CustomEmail]: string;
|
|
16
|
+
[TextTypes.CustomURL]: string;
|
|
17
|
+
};
|
|
18
|
+
declare const TextTypeToUiMeta: {
|
|
19
|
+
[TextTypes.CustomPhone]: {
|
|
20
|
+
"ui/type": string;
|
|
21
|
+
};
|
|
22
|
+
[TextTypes.CustomEmail]: {
|
|
23
|
+
"ui/type": string;
|
|
24
|
+
};
|
|
25
|
+
[TextTypes.CustomURL]: {
|
|
26
|
+
"ui/type": string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
declare const TextUiMetaToTextType: Record<string, string>;
|
|
30
|
+
declare const getTextType: (fieldMeta: Record<string, unknown>) => string;
|
|
31
|
+
declare const getTextTypeLabel: (textType: string) => string;
|
|
32
|
+
//#endregion
|
|
33
|
+
export { TextTypeToFiberyType, TextTypeToUiMeta, TextTypes, TextUIMeta, TextUIMetaKey, TextUiMetaToTextType, getTextType, getTextTypeLabel };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
//#region src/field-utils/text.ts
|
|
2
|
+
const TextUIMetaKey = "ui/type";
|
|
3
|
+
const TextUIMeta = {
|
|
4
|
+
Phone: "phone",
|
|
5
|
+
Email: "email",
|
|
6
|
+
URL: "url"
|
|
7
|
+
};
|
|
8
|
+
const TextTypes = {
|
|
9
|
+
CustomPhone: "custom/phone",
|
|
10
|
+
CustomEmail: "custom/email",
|
|
11
|
+
CustomURL: "custom/url"
|
|
12
|
+
};
|
|
13
|
+
const TextTypeToFiberyType = {
|
|
14
|
+
[TextTypes.CustomPhone]: "fibery/text",
|
|
15
|
+
[TextTypes.CustomEmail]: "fibery/text",
|
|
16
|
+
[TextTypes.CustomURL]: "fibery/text"
|
|
17
|
+
};
|
|
18
|
+
const TextTypeToUiMeta = {
|
|
19
|
+
[TextTypes.CustomPhone]: { [TextUIMetaKey]: TextUIMeta.Phone },
|
|
20
|
+
[TextTypes.CustomEmail]: { [TextUIMetaKey]: TextUIMeta.Email },
|
|
21
|
+
[TextTypes.CustomURL]: { [TextUIMetaKey]: TextUIMeta.URL }
|
|
22
|
+
};
|
|
23
|
+
const TextUiMetaToTextType = {
|
|
24
|
+
[TextUIMeta.Phone]: TextTypes.CustomPhone,
|
|
25
|
+
[TextUIMeta.Email]: TextTypes.CustomEmail,
|
|
26
|
+
[TextUIMeta.URL]: TextTypes.CustomURL
|
|
27
|
+
};
|
|
28
|
+
const getTextType = (fieldMeta) => {
|
|
29
|
+
const textUiMeta = fieldMeta[TextUIMetaKey];
|
|
30
|
+
return typeof textUiMeta === "string" ? TextUiMetaToTextType[textUiMeta] || "fibery/text" : "fibery/text";
|
|
31
|
+
};
|
|
32
|
+
const getTextTypeLabel = (textType) => {
|
|
33
|
+
return {
|
|
34
|
+
[TextTypes.CustomPhone]: "Phone",
|
|
35
|
+
[TextTypes.CustomEmail]: "Email",
|
|
36
|
+
[TextTypes.CustomURL]: "URL"
|
|
37
|
+
}[textType] || "Text";
|
|
38
|
+
};
|
|
39
|
+
//#endregion
|
|
40
|
+
export { TextTypeToFiberyType, TextTypeToUiMeta, TextTypes, TextUIMeta, TextUIMetaKey, TextUiMetaToTextType, getTextType, getTextTypeLabel };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TypeObject } from "@fibery/schema";
|
|
2
|
+
import { FieldExpression } from "@fibery/expression-utils";
|
|
3
|
+
//#region src/field-utils/user-active.d.ts
|
|
4
|
+
declare const getIsUserActiveSelect: ({ typeObject, contextPath }: {
|
|
5
|
+
typeObject: TypeObject;
|
|
6
|
+
contextPath?: FieldExpression;
|
|
7
|
+
}) => {
|
|
8
|
+
[x: string]: (string | (string | import("@fibery/expression-utils").MultiFieldAccess)[])[];
|
|
9
|
+
} | null;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { getIsUserActiveSelect };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { isUserActiveDynamicKeyPrefix, makeDynamicKey } from "../unit-utils/dynamic-keys.js";
|
|
2
|
+
import { memoize } from "@fibery/helpers/src/_";
|
|
3
|
+
//#region src/field-utils/user-active.ts
|
|
4
|
+
const getIsUserActiveQueryPredicate = memoize(({ typeObject, contextPath }) => {
|
|
5
|
+
if (typeObject.name !== "fibery/user") return null;
|
|
6
|
+
const expression = [
|
|
7
|
+
"=",
|
|
8
|
+
[...contextPath, "fibery/active?"],
|
|
9
|
+
"$true"
|
|
10
|
+
];
|
|
11
|
+
return {
|
|
12
|
+
key: makeDynamicKey(isUserActiveDynamicKeyPrefix),
|
|
13
|
+
expression
|
|
14
|
+
};
|
|
15
|
+
}, ({ typeObject, contextPath }) => `${typeObject.name}_${typeObject.version}_${contextPath.join(",")}`);
|
|
16
|
+
const getIsUserActiveSelect = ({ typeObject, contextPath = [] }) => {
|
|
17
|
+
const isUserActiveQueryPredicate = getIsUserActiveQueryPredicate({
|
|
18
|
+
typeObject,
|
|
19
|
+
contextPath
|
|
20
|
+
});
|
|
21
|
+
return isUserActiveQueryPredicate ? { [isUserActiveQueryPredicate.key]: isUserActiveQueryPredicate.expression } : null;
|
|
22
|
+
};
|
|
23
|
+
//#endregion
|
|
24
|
+
export { getIsUserActiveSelect };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FieldObject } from "@fibery/schema";
|
|
2
|
+
//#region src/field-utils/user-role.d.ts
|
|
3
|
+
declare const isUserRoleField: (fieldObject: FieldObject) => boolean;
|
|
4
|
+
declare const getUserRoleByKey: (roleKey: string) => {
|
|
5
|
+
key: string;
|
|
6
|
+
label: string;
|
|
7
|
+
} | undefined;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { getUserRoleByKey, isUserRoleField };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region src/field-utils/user-role.ts
|
|
2
|
+
const roles = [
|
|
3
|
+
{
|
|
4
|
+
key: "role/admin",
|
|
5
|
+
label: "Admin"
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
key: "role/member",
|
|
9
|
+
label: "Member"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
key: "role/observer",
|
|
13
|
+
label: "Observer"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
key: "role/guest",
|
|
17
|
+
label: "Guest"
|
|
18
|
+
}
|
|
19
|
+
];
|
|
20
|
+
const isUserRoleField = (fieldObject) => fieldObject.holderType === "fibery/user" && fieldObject.name === "fibery/role";
|
|
21
|
+
const getUserRoleByKey = (roleKey) => roles.find(({ key }) => key === roleKey);
|
|
22
|
+
//#endregion
|
|
23
|
+
export { getUserRoleByKey, isUserRoleField };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { TypeObject } from "@fibery/schema";
|
|
2
|
+
import { FieldExpression } from "@fibery/expression-utils";
|
|
3
|
+
//#region src/field-utils/workflow.d.ts
|
|
4
|
+
declare function isWorkflowType(typeObject: TypeObject): boolean;
|
|
5
|
+
declare const getWorkflowFieldObject: (typeObject: TypeObject) => import("@fibery/schema").FieldObject | undefined;
|
|
6
|
+
declare const getIsFinalStateSelect: ({ typeObject, contextPath }: {
|
|
7
|
+
typeObject: TypeObject;
|
|
8
|
+
contextPath?: FieldExpression;
|
|
9
|
+
}) => {
|
|
10
|
+
[x: string]: (string | (string | import("@fibery/expression-utils").MultiFieldAccess)[])[];
|
|
11
|
+
} | null;
|
|
12
|
+
declare function getWorkflowTypeSelect(typeObject: TypeObject): {
|
|
13
|
+
"workflow/Type": string[];
|
|
14
|
+
} | {
|
|
15
|
+
"workflow/Type"?: undefined;
|
|
16
|
+
};
|
|
17
|
+
//#endregion
|
|
18
|
+
export { getIsFinalStateSelect, getWorkflowFieldObject, getWorkflowTypeSelect, isWorkflowType };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { isFinalStateDynamicKeyPrefix, makeDynamicKey } from "../unit-utils/dynamic-keys.js";
|
|
2
|
+
import { memoize } from "@fibery/helpers/src/_";
|
|
3
|
+
//#region src/field-utils/workflow.ts
|
|
4
|
+
function isWorkflowType(typeObject) {
|
|
5
|
+
return typeObject.isEnum && typeObject.nameParts.namespace === "workflow";
|
|
6
|
+
}
|
|
7
|
+
const getWorkflowFieldObject = (typeObject) => {
|
|
8
|
+
const isWorkflowEnabledForType = typeObject.installedMixins.has("workflow/workflow");
|
|
9
|
+
let workflowFieldObject;
|
|
10
|
+
if (isWorkflowEnabledForType) workflowFieldObject = typeObject.fieldObjects.find((fieldObject) => {
|
|
11
|
+
if (fieldObject.nameParts.namespace === "workflow") return fieldObject.typeObject.fieldObjects.find((x) => x.name === "workflow/Final");
|
|
12
|
+
return false;
|
|
13
|
+
});
|
|
14
|
+
return workflowFieldObject;
|
|
15
|
+
};
|
|
16
|
+
const getIsFinalStateQueryPredicate = memoize(({ typeObject, contextPath }) => {
|
|
17
|
+
const workflowFieldObject = getWorkflowFieldObject(typeObject);
|
|
18
|
+
if (workflowFieldObject) {
|
|
19
|
+
const expression = [
|
|
20
|
+
"=",
|
|
21
|
+
[
|
|
22
|
+
...contextPath,
|
|
23
|
+
workflowFieldObject.name,
|
|
24
|
+
"workflow/Final"
|
|
25
|
+
],
|
|
26
|
+
"$true"
|
|
27
|
+
];
|
|
28
|
+
return {
|
|
29
|
+
key: makeDynamicKey(isFinalStateDynamicKeyPrefix),
|
|
30
|
+
expression
|
|
31
|
+
};
|
|
32
|
+
} else return null;
|
|
33
|
+
}, ({ typeObject, contextPath }) => {
|
|
34
|
+
return `${typeObject.name}_${typeObject.version}_${contextPath.join(",")}`;
|
|
35
|
+
});
|
|
36
|
+
const getIsFinalStateSelect = ({ typeObject, contextPath = [] }) => {
|
|
37
|
+
const isFinalStateQueryPredicate = getIsFinalStateQueryPredicate({
|
|
38
|
+
typeObject,
|
|
39
|
+
contextPath
|
|
40
|
+
});
|
|
41
|
+
return isFinalStateQueryPredicate ? { [isFinalStateQueryPredicate.key]: isFinalStateQueryPredicate.expression } : null;
|
|
42
|
+
};
|
|
43
|
+
function getWorkflowTypeSelect(typeObject) {
|
|
44
|
+
if (isWorkflowType(typeObject)) return { "workflow/Type": ["workflow/Type"] };
|
|
45
|
+
return {};
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
export { getIsFinalStateSelect, getWorkflowFieldObject, getWorkflowTypeSelect, isWorkflowType };
|
package/lib/index.d.ts
CHANGED
|
@@ -1 +1,34 @@
|
|
|
1
|
-
|
|
1
|
+
import { InvalidMetaError } from "./errors.js";
|
|
2
|
+
import { Unit } from "./units/types.js";
|
|
3
|
+
import { UnitDefinitions, ViewRecord } from "./private/utils.js";
|
|
4
|
+
import { deleteExpressionWithNotFoundFieldsOrTypesInSmartFolder, replaceIdsWithNamesInSmartFolder, replaceNamesWithIdsInSmartFolder } from "./private/smart-folder.js";
|
|
5
|
+
import { assertMetaValid, isMetaValid } from "./meta-validation.js";
|
|
6
|
+
import { FieldObject, Schema } from "@fibery/schema";
|
|
7
|
+
import { Expression } from "@fibery/expression-utils/src/types";
|
|
8
|
+
//#region src/index.d.ts
|
|
9
|
+
declare const deleteExpressionWithNotFoundFieldsOrTypesInView: (schema: Schema, view: ViewRecord, ensureAxisInvariant?: boolean) => any;
|
|
10
|
+
declare const fixUserSelectedUnits: (schema: Schema, view: ViewRecord, { unitDefinitions, getDefaultUnitTypeForField }: {
|
|
11
|
+
unitDefinitions: UnitDefinitions;
|
|
12
|
+
getDefaultUnitTypeForField: (fieldObject: FieldObject, allowedUnits: Unit[]) => string | undefined;
|
|
13
|
+
}) => any;
|
|
14
|
+
declare const fixContextExpressionWithBrokenPath: (schema: Schema, view: ViewRecord, defaultContextExpression: Expression) => any;
|
|
15
|
+
/**
|
|
16
|
+
* Removes garbage from view's meta to reduce the size.
|
|
17
|
+
*/
|
|
18
|
+
type CollectGarbageSchema = unknown;
|
|
19
|
+
declare const collectGarbage: (_schema: CollectGarbageSchema, view: ViewRecord) => unknown;
|
|
20
|
+
declare const replaceNamesWithIdsInView: (schema: Schema, view: ViewRecord) => any;
|
|
21
|
+
declare const replaceIdsWithNamesInView: (schema: Schema, view: ViewRecord) => any;
|
|
22
|
+
type ViewMeta = {
|
|
23
|
+
items: {
|
|
24
|
+
query: {
|
|
25
|
+
"q/from": string;
|
|
26
|
+
};
|
|
27
|
+
}[];
|
|
28
|
+
};
|
|
29
|
+
declare const getViewCardTypes: ({ "fibery/meta": { items } }: {
|
|
30
|
+
"fibery/meta": ViewMeta;
|
|
31
|
+
}) => string[];
|
|
32
|
+
declare const migrateHideWhenEmptyToUnitsLevel: (view: ViewRecord) => any;
|
|
33
|
+
//#endregion
|
|
34
|
+
export { CollectGarbageSchema, InvalidMetaError, assertMetaValid, collectGarbage, deleteExpressionWithNotFoundFieldsOrTypesInSmartFolder, deleteExpressionWithNotFoundFieldsOrTypesInView, fixContextExpressionWithBrokenPath, fixUserSelectedUnits, getViewCardTypes, isMetaValid, migrateHideWhenEmptyToUnitsLevel, replaceIdsWithNamesInSmartFolder, replaceIdsWithNamesInView, replaceNamesWithIdsInSmartFolder, replaceNamesWithIdsInView };
|
package/lib/index.js
CHANGED
|
@@ -1,17 +1,170 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { InvalidMetaError } from "./errors.js";
|
|
2
|
+
import { REMOVE } from "./private/utils.js";
|
|
3
|
+
import { collectGarbage as collectGarbage$1, deleteExpressionWithNotFoundOrInvalidFieldsOrTypesInBoardView, enableHideWhenEmptyForCheckedEditableUnits, enableHideWhenEmptyForCovers, fixContextExpressionWithBrokenPath as fixContextExpressionWithBrokenPath$1, fixUserSelectedUnitsInBoardView, replaceIdsWithNamesInBoardView, replaceNamesWithIdsInBoardView } from "./private/board.js";
|
|
4
|
+
import { collectGarbage as collectGarbage$2, deleteExpressionWithNotFoundFieldsOrTypesInCalendarView, enableHideWhenEmptyForCheckedUnits, fixContextExpressionWithBrokenPath as fixContextExpressionWithBrokenPath$2, fixUserSelectedUnitsInCalendarView, replaceIdsWithNamesInCalendarView, replaceNamesWithIdsInCalendarView } from "./private/calendar.js";
|
|
5
|
+
import { collectGarbage as collectGarbage$3, deleteExpressionWithNotFoundFieldsOrTypesInFeedView, enableHideWhenEmptyForCheckedUnits as enableHideWhenEmptyForCheckedUnits$1, fixContextExpressionWithBrokenPath as fixContextExpressionWithBrokenPath$3, fixUserSelectedUnitsInFeedView, replaceIdsWithNamesInFeedView, replaceNamesWithIdsInFeedView } from "./private/feed.js";
|
|
6
|
+
import { deleteExpressionWithNotFoundFieldsOrTypesInFormView, replaceIdsWithNamesInFormView, replaceNamesWithIdsInFormView } from "./private/form.js";
|
|
7
|
+
import { collectGarbage as collectGarbage$4, deleteExpressionWithNotFoundFieldsOrTypesInMapView, enableHideWhenEmptyForCheckedUnits as enableHideWhenEmptyForCheckedUnits$2, fixContextExpressionWithBrokenPath as fixContextExpressionWithBrokenPath$4, fixUserSelectedUnitsInMapView, replaceIdsWithNamesInMapView, replaceNamesWithIdsInMapView } from "./private/map.js";
|
|
8
|
+
import { collectGarbage as collectGarbage$5, deleteExpressionWithNotFoundFieldsOrTypesInSmartFolder, enableHideWhenEmptyForCheckedUnits as enableHideWhenEmptyForCheckedUnits$3, fixContextExpressionWithBrokenPath as fixContextExpressionWithBrokenPath$5, fixUserSelectedUnitsInSmartFolder, replaceIdsWithNamesInSmartFolder, replaceNamesWithIdsInSmartFolder } from "./private/smart-folder.js";
|
|
9
|
+
import { collectGarbage as collectGarbage$6, deleteExpressionWithNotFoundFieldsOrTypesInTimelineView, enableHideWhenEmptyForCheckedEditableUnits as enableHideWhenEmptyForCheckedEditableUnits$1, fixContextExpressionWithBrokenPath as fixContextExpressionWithBrokenPath$6, fixUserSelectedUnitsInTimelineView, replaceIdsWithNamesInTimelineView, replaceNamesWithIdsInTimelineView } from "./private/timeline.js";
|
|
10
|
+
import { assertMetaValid, isMetaValid } from "./meta-validation.js";
|
|
11
|
+
import { isRecord } from "@fibery/helpers/src/_";
|
|
12
|
+
import immutableUpdate from "immutability-helper";
|
|
13
|
+
import get from "lodash/get.js";
|
|
14
|
+
import omit from "lodash/omit.js";
|
|
15
|
+
//#region src/index.ts
|
|
16
|
+
const deleteExpressionWithNotFoundFieldsOrTypesInView = (schema, view, ensureAxisInvariant = true) => {
|
|
17
|
+
switch (view["fibery/type"]) {
|
|
18
|
+
case "board":
|
|
19
|
+
case "gallery": return deleteExpressionWithNotFoundOrInvalidFieldsOrTypesInBoardView(schema, view, ensureAxisInvariant);
|
|
20
|
+
case "list":
|
|
21
|
+
case "grid":
|
|
22
|
+
case "table": return deleteExpressionWithNotFoundFieldsOrTypesInSmartFolder(schema, view);
|
|
23
|
+
case "timeline": return deleteExpressionWithNotFoundFieldsOrTypesInTimelineView(schema, view, ensureAxisInvariant, () => true);
|
|
24
|
+
case "gantt": return deleteExpressionWithNotFoundFieldsOrTypesInTimelineView(schema, view, ensureAxisInvariant, (metaItem) => !metaItem.groupBy);
|
|
25
|
+
case "calendar": return deleteExpressionWithNotFoundFieldsOrTypesInCalendarView(schema, view);
|
|
26
|
+
case "feed": return deleteExpressionWithNotFoundFieldsOrTypesInFeedView(schema, view);
|
|
27
|
+
case "form": return deleteExpressionWithNotFoundFieldsOrTypesInFormView(schema, view);
|
|
28
|
+
case "map": return deleteExpressionWithNotFoundFieldsOrTypesInMapView(schema, view);
|
|
29
|
+
default: return view;
|
|
30
|
+
}
|
|
15
31
|
};
|
|
16
|
-
|
|
17
|
-
|
|
32
|
+
const fixUserSelectedUnits = (schema, view, { unitDefinitions, getDefaultUnitTypeForField }) => {
|
|
33
|
+
switch (view["fibery/type"]) {
|
|
34
|
+
case "board":
|
|
35
|
+
case "gallery": return fixUserSelectedUnitsInBoardView(schema, view, {
|
|
36
|
+
unitDefinitions,
|
|
37
|
+
getDefaultUnitTypeForField
|
|
38
|
+
});
|
|
39
|
+
case "list":
|
|
40
|
+
case "grid":
|
|
41
|
+
case "table": return fixUserSelectedUnitsInSmartFolder(schema, view, {
|
|
42
|
+
unitDefinitions,
|
|
43
|
+
getDefaultUnitTypeForField
|
|
44
|
+
});
|
|
45
|
+
case "timeline":
|
|
46
|
+
case "gantt": return fixUserSelectedUnitsInTimelineView(schema, view, {
|
|
47
|
+
unitDefinitions,
|
|
48
|
+
getDefaultUnitTypeForField
|
|
49
|
+
});
|
|
50
|
+
case "calendar": return fixUserSelectedUnitsInCalendarView(schema, view, {
|
|
51
|
+
unitDefinitions,
|
|
52
|
+
getDefaultUnitTypeForField
|
|
53
|
+
});
|
|
54
|
+
case "feed": return fixUserSelectedUnitsInFeedView(schema, view, {
|
|
55
|
+
unitDefinitions,
|
|
56
|
+
getDefaultUnitTypeForField
|
|
57
|
+
});
|
|
58
|
+
case "map": return fixUserSelectedUnitsInMapView(schema, view, {
|
|
59
|
+
unitDefinitions,
|
|
60
|
+
getDefaultUnitTypeForField
|
|
61
|
+
});
|
|
62
|
+
default: return view;
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
const fixContextExpressionWithBrokenPath = (schema, view, defaultContextExpression) => {
|
|
66
|
+
switch (view["fibery/type"]) {
|
|
67
|
+
case "board":
|
|
68
|
+
case "gallery": return fixContextExpressionWithBrokenPath$1(schema, view, defaultContextExpression);
|
|
69
|
+
case "list":
|
|
70
|
+
case "grid":
|
|
71
|
+
case "table": return fixContextExpressionWithBrokenPath$5(schema, view, defaultContextExpression);
|
|
72
|
+
case "timeline":
|
|
73
|
+
case "gantt": return fixContextExpressionWithBrokenPath$6(schema, view, defaultContextExpression);
|
|
74
|
+
case "calendar": return fixContextExpressionWithBrokenPath$2(schema, view, defaultContextExpression);
|
|
75
|
+
case "feed": return fixContextExpressionWithBrokenPath$3(schema, view, defaultContextExpression);
|
|
76
|
+
case "map": return fixContextExpressionWithBrokenPath$4(schema, view, defaultContextExpression);
|
|
77
|
+
default: return view;
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
const collectGarbage = (_schema, view) => {
|
|
81
|
+
const deleteRemoved = (x) => {
|
|
82
|
+
if (Array.isArray(x)) return x.map(deleteRemoved).filter((y) => y !== REMOVE);
|
|
83
|
+
if (isRecord(x)) {
|
|
84
|
+
let tmp = Object.entries(x);
|
|
85
|
+
tmp = tmp.map((e) => [e[0], deleteRemoved(e[1])]);
|
|
86
|
+
tmp = tmp.filter((e) => e[1] !== REMOVE);
|
|
87
|
+
return Object.fromEntries(tmp);
|
|
88
|
+
}
|
|
89
|
+
return x;
|
|
90
|
+
};
|
|
91
|
+
switch (view["fibery/type"]) {
|
|
92
|
+
case "board":
|
|
93
|
+
case "gallery": return deleteRemoved(collectGarbage$1(view));
|
|
94
|
+
case "list":
|
|
95
|
+
case "grid":
|
|
96
|
+
case "table": return deleteRemoved(collectGarbage$5(view));
|
|
97
|
+
case "timeline":
|
|
98
|
+
case "gantt": return deleteRemoved(collectGarbage$6(view));
|
|
99
|
+
case "calendar": return deleteRemoved(collectGarbage$2(view));
|
|
100
|
+
case "feed": return deleteRemoved(collectGarbage$3(view));
|
|
101
|
+
case "map": return deleteRemoved(collectGarbage$4(view));
|
|
102
|
+
default: return view;
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
const replaceNamesWithIdsInView = (schema, view) => {
|
|
106
|
+
switch (view["fibery/type"]) {
|
|
107
|
+
case "board":
|
|
108
|
+
case "gallery": return replaceNamesWithIdsInBoardView(schema, view);
|
|
109
|
+
case "list":
|
|
110
|
+
case "grid":
|
|
111
|
+
case "table": return replaceNamesWithIdsInSmartFolder(schema, view);
|
|
112
|
+
case "timeline":
|
|
113
|
+
case "gantt": return replaceNamesWithIdsInTimelineView(schema, view);
|
|
114
|
+
case "calendar": return replaceNamesWithIdsInCalendarView(schema, view);
|
|
115
|
+
case "feed": return replaceNamesWithIdsInFeedView(schema, view);
|
|
116
|
+
case "form": return replaceNamesWithIdsInFormView(schema, view);
|
|
117
|
+
case "map": return replaceNamesWithIdsInMapView(schema, view);
|
|
118
|
+
default: return view;
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
const replaceIdsWithNamesInView = (schema, view) => {
|
|
122
|
+
switch (view["fibery/type"]) {
|
|
123
|
+
case "board":
|
|
124
|
+
case "gallery": return replaceIdsWithNamesInBoardView(schema, view);
|
|
125
|
+
case "list":
|
|
126
|
+
case "grid":
|
|
127
|
+
case "table": return replaceIdsWithNamesInSmartFolder(schema, view);
|
|
128
|
+
case "timeline":
|
|
129
|
+
case "gantt": return replaceIdsWithNamesInTimelineView(schema, view);
|
|
130
|
+
case "calendar": return replaceIdsWithNamesInCalendarView(schema, view);
|
|
131
|
+
case "feed": return replaceIdsWithNamesInFeedView(schema, view);
|
|
132
|
+
case "form": return replaceIdsWithNamesInFormView(schema, view);
|
|
133
|
+
case "map": return replaceIdsWithNamesInMapView(schema, view);
|
|
134
|
+
default: return view;
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
const getViewCardTypes = ({ "fibery/meta": { items } }) => items.map(({ query: { "q/from": type } }) => type);
|
|
138
|
+
const migrateHideWhenEmptyToUnitsLevel = (view) => {
|
|
139
|
+
const viewTypesToTransform = [
|
|
140
|
+
"board",
|
|
141
|
+
"list",
|
|
142
|
+
"timeline",
|
|
143
|
+
"gantt",
|
|
144
|
+
"calendar",
|
|
145
|
+
"feed",
|
|
146
|
+
"map"
|
|
147
|
+
];
|
|
148
|
+
const viewType = view["fibery/type"];
|
|
149
|
+
if (!viewTypesToTransform.includes(viewType)) return view;
|
|
150
|
+
const showEmptyUnitValues = get(view, ["fibery/meta", "showEmptyUnitValues"]);
|
|
151
|
+
if (showEmptyUnitValues === void 0) return view;
|
|
152
|
+
let result = immutableUpdate(view, { "fibery/meta": { $apply: (x) => omit(x, "showEmptyUnitValues") } });
|
|
153
|
+
if (showEmptyUnitValues === true) return result;
|
|
154
|
+
switch (result["fibery/type"]) {
|
|
155
|
+
case "board":
|
|
156
|
+
case "gallery":
|
|
157
|
+
result = enableHideWhenEmptyForCovers(result);
|
|
158
|
+
result = enableHideWhenEmptyForCheckedEditableUnits(result);
|
|
159
|
+
return result;
|
|
160
|
+
case "list": return enableHideWhenEmptyForCheckedUnits$3(result);
|
|
161
|
+
case "timeline":
|
|
162
|
+
case "gantt": return enableHideWhenEmptyForCheckedEditableUnits$1(result);
|
|
163
|
+
case "calendar": return enableHideWhenEmptyForCheckedUnits(result);
|
|
164
|
+
case "feed": return enableHideWhenEmptyForCheckedUnits$1(result);
|
|
165
|
+
case "map": return enableHideWhenEmptyForCheckedUnits$2(result);
|
|
166
|
+
default: return result;
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
//#endregion
|
|
170
|
+
export { InvalidMetaError, assertMetaValid, collectGarbage, deleteExpressionWithNotFoundFieldsOrTypesInSmartFolder, deleteExpressionWithNotFoundFieldsOrTypesInView, fixContextExpressionWithBrokenPath, fixUserSelectedUnits, getViewCardTypes, isMetaValid, migrateHideWhenEmptyToUnitsLevel, replaceIdsWithNamesInSmartFolder, replaceIdsWithNamesInView, replaceNamesWithIdsInSmartFolder, replaceNamesWithIdsInView };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/meta-validation.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Validates meta payload for the view of given type.
|
|
4
|
+
* Throws `InvalidMeta` if meta is not valid.
|
|
5
|
+
* Re-throws errors that are not InvalidMeta.
|
|
6
|
+
*/
|
|
7
|
+
declare const assertMetaValid: (type: string, meta: unknown) => void;
|
|
8
|
+
/**
|
|
9
|
+
* Returns true if meta is valid for given view type.
|
|
10
|
+
*/
|
|
11
|
+
declare const isMetaValid: (type: string, meta: unknown) => boolean;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { assertMetaValid, isMetaValid };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { InvalidMetaError } from "./errors.js";
|
|
2
|
+
import { isRecord } from "@fibery/helpers/src/_";
|
|
3
|
+
import get from "lodash/get.js";
|
|
4
|
+
//#region src/meta-validation.ts
|
|
5
|
+
/**
|
|
6
|
+
* Validates meta payload for the view of given type.
|
|
7
|
+
* Throws `InvalidMeta` if meta is not valid.
|
|
8
|
+
* Re-throws errors that are not InvalidMeta.
|
|
9
|
+
*/
|
|
10
|
+
const assertMetaValid = (type, meta) => {
|
|
11
|
+
(validators.get(type) ?? genericValidator)(meta);
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Returns true if meta is valid for given view type.
|
|
15
|
+
*/
|
|
16
|
+
const isMetaValid = (type, meta) => {
|
|
17
|
+
try {
|
|
18
|
+
assertMetaValid(type, meta);
|
|
19
|
+
return true;
|
|
20
|
+
} catch (err) {
|
|
21
|
+
if (err instanceof InvalidMetaError) return false;
|
|
22
|
+
throw err;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
const isEmptyObject = (m) => isRecord(m) && Object.keys(m).length === 0;
|
|
26
|
+
const genericValidator = (m) => {
|
|
27
|
+
if (m === null) return;
|
|
28
|
+
const items = get(m, "items");
|
|
29
|
+
if (!Array.isArray(items)) throw new InvalidMetaError("expected fibery/meta.items to be an array");
|
|
30
|
+
};
|
|
31
|
+
const validators = /* @__PURE__ */ new Map([
|
|
32
|
+
["document", (m) => {
|
|
33
|
+
if (m === null || m === void 0 || isEmptyObject(m)) return;
|
|
34
|
+
if (typeof get(m, "documentSecret") !== "string") throw new InvalidMetaError("expected fibery/meta.documentSecret to be a string");
|
|
35
|
+
}],
|
|
36
|
+
["vizydrop/chart", () => {}],
|
|
37
|
+
["form", () => {}],
|
|
38
|
+
["canvas", () => {}],
|
|
39
|
+
["tlcanvas", () => {}],
|
|
40
|
+
["spreadsheet", () => {}],
|
|
41
|
+
["thread", (m) => {
|
|
42
|
+
if (isEmptyObject(m)) return;
|
|
43
|
+
const id = get(m, "id");
|
|
44
|
+
const typeId = get(m, "typeId");
|
|
45
|
+
if (typeof id !== "string" || typeof typeId !== "string") throw new InvalidMetaError("expected fibery/meta.id and fibery/meta.typeId to be strings");
|
|
46
|
+
}],
|
|
47
|
+
["dashboard", () => {}],
|
|
48
|
+
["embed", () => {}],
|
|
49
|
+
["page", () => {}],
|
|
50
|
+
["custom-app", () => {}]
|
|
51
|
+
]);
|
|
52
|
+
//#endregion
|
|
53
|
+
export { assertMetaValid, isMetaValid };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { UnitDefinitions, ViewRecord } from "./utils.js";
|
|
2
|
+
import { FieldObject, Schema } from "@fibery/schema";
|
|
3
|
+
import { Expression } from "@fibery/expression-utils/src/types";
|
|
4
|
+
import { Unit } from "@fibery/views/src/units/types";
|
|
5
|
+
//#region src/private/board.d.ts
|
|
6
|
+
declare const replaceIdsWithNamesInBoardView: (schema: Schema, view: ViewRecord) => any;
|
|
7
|
+
declare const replaceNamesWithIdsInBoardView: (schema: Schema, view: ViewRecord) => any;
|
|
8
|
+
declare const deleteExpressionWithNotFoundOrInvalidFieldsOrTypesInBoardView: (schema: Schema, view: ViewRecord, ensureAxisInvariant?: boolean) => any;
|
|
9
|
+
declare const fixUserSelectedUnitsInBoardView: (schema: Schema, view: ViewRecord, { unitDefinitions, getDefaultUnitTypeForField }: {
|
|
10
|
+
unitDefinitions: UnitDefinitions;
|
|
11
|
+
getDefaultUnitTypeForField: (fieldObject: FieldObject, allowedUnits: Unit[]) => string | undefined;
|
|
12
|
+
}) => any;
|
|
13
|
+
declare const fixContextExpressionWithBrokenPath: (schema: Schema, view: ViewRecord, defaultContextExpression: Expression) => any;
|
|
14
|
+
declare const collectGarbage: (view: ViewRecord) => any;
|
|
15
|
+
declare const enableHideWhenEmptyForCovers: (view: ViewRecord) => any;
|
|
16
|
+
declare const enableHideWhenEmptyForCheckedEditableUnits: (view: ViewRecord) => any;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { collectGarbage, deleteExpressionWithNotFoundOrInvalidFieldsOrTypesInBoardView, enableHideWhenEmptyForCheckedEditableUnits, enableHideWhenEmptyForCovers, fixContextExpressionWithBrokenPath, fixUserSelectedUnitsInBoardView, replaceIdsWithNamesInBoardView, replaceNamesWithIdsInBoardView };
|