@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
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import type { Expression, Query } from "@fibery/expression-utils/src/types";
|
|
2
|
-
import type { FieldObject, Schema } from "@fibery/schema";
|
|
3
|
-
import type { Unit } from "@fibery/views/src/units/types";
|
|
4
|
-
import type { UnitDefinitions, ViewFilter, ViewRecord } from "./utils";
|
|
5
|
-
type GroupByEntry = {
|
|
6
|
-
expression: Expression;
|
|
7
|
-
[k: string]: unknown;
|
|
8
|
-
};
|
|
9
|
-
type GroupByExpression = Record<string, GroupByEntry>;
|
|
10
|
-
type TimelineMetaItem = {
|
|
11
|
-
query?: Query | null;
|
|
12
|
-
filter?: ViewFilter | null;
|
|
13
|
-
yExpression?: Expression | null;
|
|
14
|
-
startExpression?: Expression | null;
|
|
15
|
-
endExpression?: Expression | null;
|
|
16
|
-
secondaryStartExpression?: Expression | null;
|
|
17
|
-
secondaryEndExpression?: Expression | null;
|
|
18
|
-
contextExpression?: Expression | null;
|
|
19
|
-
units?: Unit[] | null;
|
|
20
|
-
colorCoding?: {
|
|
21
|
-
expression: Expression;
|
|
22
|
-
[k: string]: unknown;
|
|
23
|
-
}[] | null;
|
|
24
|
-
dependencyExpression?: Expression | null;
|
|
25
|
-
groupBy?: GroupByExpression | null;
|
|
26
|
-
groupingExpression?: GroupByExpression | null;
|
|
27
|
-
[k: string]: unknown;
|
|
28
|
-
};
|
|
29
|
-
export declare const replaceNamesWithIdsInTimelineView: (schema: Schema, view: ViewRecord) => any;
|
|
30
|
-
export declare const replaceIdsWithNamesInTimelineView: (schema: Schema, view: ViewRecord) => any;
|
|
31
|
-
export declare const deleteExpressionWithNotFoundFieldsOrTypesInTimelineView: (schema: Schema, view: ViewRecord, ensureAxisInvariant: boolean, canGroupMetaItem?: (_metaItem: TimelineMetaItem) => boolean) => any;
|
|
32
|
-
export declare const fixUserSelectedUnitsInTimelineView: (schema: Schema, view: ViewRecord, { unitDefinitions, getDefaultUnitTypeForField, }: {
|
|
33
|
-
unitDefinitions: UnitDefinitions;
|
|
34
|
-
getDefaultUnitTypeForField: (fieldObject: FieldObject, allowedUnits: Unit[]) => string | undefined;
|
|
35
|
-
}) => any;
|
|
36
|
-
export declare const fixContextExpressionWithBrokenPath: (schema: Schema, view: ViewRecord, defaultContextExpression: Expression) => any;
|
|
37
|
-
export declare const collectGarbage: (view: ViewRecord) => any;
|
|
38
|
-
export declare const enableHideWhenEmptyForCheckedEditableUnits: (view: ViewRecord) => any;
|
|
39
|
-
export {};
|
|
@@ -1,325 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.enableHideWhenEmptyForCheckedEditableUnits = exports.collectGarbage = exports.fixContextExpressionWithBrokenPath = exports.fixUserSelectedUnitsInTimelineView = exports.deleteExpressionWithNotFoundFieldsOrTypesInTimelineView = exports.replaceIdsWithNamesInTimelineView = exports.replaceNamesWithIdsInTimelineView = void 0;
|
|
7
|
-
const immutability_helper_1 = __importDefault(require("immutability-helper"));
|
|
8
|
-
const entries_1 = __importDefault(require("lodash/entries"));
|
|
9
|
-
const first_1 = __importDefault(require("lodash/first"));
|
|
10
|
-
const get_1 = __importDefault(require("lodash/get"));
|
|
11
|
-
const has_1 = __importDefault(require("lodash/has"));
|
|
12
|
-
const isEmpty_1 = __importDefault(require("lodash/isEmpty"));
|
|
13
|
-
const set_1 = __importDefault(require("lodash/set"));
|
|
14
|
-
const some_1 = __importDefault(require("lodash/some"));
|
|
15
|
-
const truthy_1 = require("../truthy");
|
|
16
|
-
const smart_folder_1 = require("./smart-folder");
|
|
17
|
-
const units_1 = require("./units");
|
|
18
|
-
const utils_1 = require("./utils");
|
|
19
|
-
const visitAxisSingle = (axis, visitor) => {
|
|
20
|
-
const fromType = (0, get_1.default)(axis, ["query", "q/from"]);
|
|
21
|
-
const firstOrNull = (x) => (0, first_1.default)(x) || null;
|
|
22
|
-
const axisResult = {
|
|
23
|
-
...axis,
|
|
24
|
-
filter: axis.filter ? visitor.visitFilter(fromType, axis.filter) : null,
|
|
25
|
-
query: axis.query && visitor.visitQueryExpression(axis.query),
|
|
26
|
-
contextExpression: (0, utils_1.visitContextExpression)(fromType, axis.contextExpression, visitor),
|
|
27
|
-
units: axis.units &&
|
|
28
|
-
axis.units
|
|
29
|
-
.map((unit) => (0, utils_1.visitViewUnit)(fromType, unit, visitor))
|
|
30
|
-
.filter(utils_1.isUnitExpressionValid)
|
|
31
|
-
.map((unit, idx, units) => (visitor.visitViewUnit ? visitor.visitViewUnit(fromType, unit, units) : unit))
|
|
32
|
-
.filter((unit) => unit !== utils_1.REMOVE),
|
|
33
|
-
groupByExpression: axis.groupByExpression &&
|
|
34
|
-
firstOrNull(visitor.visitExpression(fromType, [axis.groupByExpression])),
|
|
35
|
-
};
|
|
36
|
-
if (!axisResult.query) {
|
|
37
|
-
return null;
|
|
38
|
-
}
|
|
39
|
-
if (!axisResult.units) {
|
|
40
|
-
delete axisResult.units;
|
|
41
|
-
}
|
|
42
|
-
return axisResult;
|
|
43
|
-
};
|
|
44
|
-
const visitAxis = (axis, visitor) => {
|
|
45
|
-
if (axis && Object.hasOwn(axis, "query")) {
|
|
46
|
-
return visitAxisSingle(axis, visitor);
|
|
47
|
-
}
|
|
48
|
-
if (axis && Object.hasOwn(axis, "enums")) {
|
|
49
|
-
const axisNew = (0, immutability_helper_1.default)(axis, {
|
|
50
|
-
enums: {
|
|
51
|
-
$apply: (enums) => visitor.visitEnums(enums),
|
|
52
|
-
},
|
|
53
|
-
});
|
|
54
|
-
const { enums } = axisNew;
|
|
55
|
-
return enums ? axisNew : null;
|
|
56
|
-
}
|
|
57
|
-
return axis;
|
|
58
|
-
};
|
|
59
|
-
const visitView = (view, visitor) => (0, immutability_helper_1.default)(view, {
|
|
60
|
-
"fibery/meta": {
|
|
61
|
-
y: {
|
|
62
|
-
$apply: (y) => visitAxis(y, visitor),
|
|
63
|
-
},
|
|
64
|
-
items: {
|
|
65
|
-
$apply: (items) => {
|
|
66
|
-
const removedItemsIndexes = items
|
|
67
|
-
.map((item, index) => (visitor.visitQueryExpression(item.query) ? null : index))
|
|
68
|
-
.filter((value) => value !== null);
|
|
69
|
-
return items
|
|
70
|
-
.map((item) => {
|
|
71
|
-
const fromType = (0, get_1.default)(item, ["query", "q/from"]);
|
|
72
|
-
const hasGroupingExpression = (0, has_1.default)(item, ["groupingExpression"]);
|
|
73
|
-
return fromType
|
|
74
|
-
? (0, immutability_helper_1.default)(item, {
|
|
75
|
-
yExpression: {
|
|
76
|
-
$apply: (yExpression) => yExpression ? visitor.visitExpression(fromType, yExpression) : yExpression,
|
|
77
|
-
},
|
|
78
|
-
startExpression: {
|
|
79
|
-
$apply: (startExpression) => startExpression ? visitor.visitExpression(fromType, startExpression) : startExpression,
|
|
80
|
-
},
|
|
81
|
-
endExpression: {
|
|
82
|
-
$apply: (endExpression) => endExpression ? visitor.visitExpression(fromType, endExpression) : endExpression,
|
|
83
|
-
},
|
|
84
|
-
secondaryStartExpression: {
|
|
85
|
-
$apply: (secondaryStartExpression) => secondaryStartExpression
|
|
86
|
-
? visitor.visitExpression(fromType, secondaryStartExpression)
|
|
87
|
-
: secondaryStartExpression,
|
|
88
|
-
},
|
|
89
|
-
secondaryEndExpression: {
|
|
90
|
-
$apply: (secondaryEndExpression) => secondaryEndExpression
|
|
91
|
-
? visitor.visitExpression(fromType, secondaryEndExpression)
|
|
92
|
-
: secondaryEndExpression,
|
|
93
|
-
},
|
|
94
|
-
contextExpression: {
|
|
95
|
-
$apply: (contextExpression) => (0, utils_1.visitContextExpression)(fromType, contextExpression, visitor),
|
|
96
|
-
},
|
|
97
|
-
filter: {
|
|
98
|
-
$apply: (filter) => (filter ? visitor.visitFilter(fromType, filter) : null),
|
|
99
|
-
},
|
|
100
|
-
query: {
|
|
101
|
-
$apply: (query) => (query ? visitor.visitQueryExpression(query) : null),
|
|
102
|
-
},
|
|
103
|
-
units: {
|
|
104
|
-
$apply: (units) => units
|
|
105
|
-
? units
|
|
106
|
-
.filter(truthy_1.truthy)
|
|
107
|
-
.map((unit) => (0, utils_1.visitViewUnit)(fromType, unit, visitor))
|
|
108
|
-
.filter(utils_1.isUnitExpressionValid)
|
|
109
|
-
.map((unit, idx, units) => visitor.visitViewUnit ? visitor.visitViewUnit(fromType, unit, units) : unit)
|
|
110
|
-
.filter((unit) => unit !== utils_1.REMOVE)
|
|
111
|
-
: undefined,
|
|
112
|
-
},
|
|
113
|
-
colorCoding: {
|
|
114
|
-
$apply: (colorCodings) => {
|
|
115
|
-
return (colorCodings &&
|
|
116
|
-
colorCodings
|
|
117
|
-
.map((colorCoding) => ({
|
|
118
|
-
...colorCoding,
|
|
119
|
-
expression: visitor.visitExpression(fromType, colorCoding.expression),
|
|
120
|
-
}))
|
|
121
|
-
.filter((colorCoding) => colorCoding.expression !== null));
|
|
122
|
-
},
|
|
123
|
-
},
|
|
124
|
-
dependencyExpression: {
|
|
125
|
-
$apply: (expression) => {
|
|
126
|
-
return expression && visitor.visitExpression(fromType, expression);
|
|
127
|
-
},
|
|
128
|
-
},
|
|
129
|
-
groupBy: {
|
|
130
|
-
$apply: (groupBy) => {
|
|
131
|
-
if (!groupBy) {
|
|
132
|
-
return groupBy;
|
|
133
|
-
}
|
|
134
|
-
const groupByIndexes = Object.keys(groupBy).map((key) => parseInt(key));
|
|
135
|
-
const removedItemsBeforeTargetLengths = groupByIndexes.map((groupByIndex) => removedItemsIndexes.filter((n) => n < groupByIndex).length);
|
|
136
|
-
return visitor.visitGroupByExpression(groupBy, fromType, removedItemsBeforeTargetLengths);
|
|
137
|
-
},
|
|
138
|
-
},
|
|
139
|
-
...(hasGroupingExpression
|
|
140
|
-
? {
|
|
141
|
-
groupingExpression: {
|
|
142
|
-
$apply: (groupingExpression) => {
|
|
143
|
-
if (!groupingExpression) {
|
|
144
|
-
return null;
|
|
145
|
-
}
|
|
146
|
-
const groupingExpressionIndexes = Object.keys(groupingExpression).map((key) => parseInt(key));
|
|
147
|
-
const removedItemsBeforeTargetLengths = groupingExpressionIndexes.map((groupByIndex) => removedItemsIndexes.filter((n) => n < groupByIndex).length);
|
|
148
|
-
return visitor.visitGroupByExpression(groupingExpression, fromType, removedItemsBeforeTargetLengths);
|
|
149
|
-
},
|
|
150
|
-
},
|
|
151
|
-
}
|
|
152
|
-
: undefined),
|
|
153
|
-
})
|
|
154
|
-
: item;
|
|
155
|
-
})
|
|
156
|
-
.filter((item) => {
|
|
157
|
-
const { query } = item;
|
|
158
|
-
return query ? item : null;
|
|
159
|
-
});
|
|
160
|
-
},
|
|
161
|
-
},
|
|
162
|
-
milestones: {
|
|
163
|
-
$apply: (milestones) => {
|
|
164
|
-
if (!milestones) {
|
|
165
|
-
return milestones;
|
|
166
|
-
}
|
|
167
|
-
return milestones
|
|
168
|
-
.map((item) => {
|
|
169
|
-
const fromType = (0, get_1.default)(item, ["query", "q/from"]);
|
|
170
|
-
return fromType
|
|
171
|
-
? (0, immutability_helper_1.default)(item, {
|
|
172
|
-
dateExpression: {
|
|
173
|
-
$apply: (startExpression) => startExpression ? visitor.visitExpression(fromType, startExpression) : startExpression,
|
|
174
|
-
},
|
|
175
|
-
filter: {
|
|
176
|
-
$apply: (filter) => (filter ? visitor.visitFilter(fromType, filter) : null),
|
|
177
|
-
},
|
|
178
|
-
query: {
|
|
179
|
-
$apply: (query) => (query ? visitor.visitQueryExpression(query) : null),
|
|
180
|
-
},
|
|
181
|
-
contextExpression: {
|
|
182
|
-
$apply: (contextExpression) => (0, utils_1.visitContextExpression)(fromType, contextExpression, visitor),
|
|
183
|
-
},
|
|
184
|
-
})
|
|
185
|
-
: item;
|
|
186
|
-
})
|
|
187
|
-
.filter((item) => {
|
|
188
|
-
const { query } = item;
|
|
189
|
-
return query ? item : null;
|
|
190
|
-
});
|
|
191
|
-
},
|
|
192
|
-
},
|
|
193
|
-
},
|
|
194
|
-
});
|
|
195
|
-
const replaceNamesWithIdsInTimelineView = (schema, view) => {
|
|
196
|
-
const visitor = {
|
|
197
|
-
visitQueryExpression: (query) => (0, utils_1.replaceNamesWithIdsInQueryExpression)(schema, query),
|
|
198
|
-
visitFilter: (fromType, expression) => (0, utils_1.replaceNamesWithIdsInFilter)(schema, fromType, expression),
|
|
199
|
-
visitExpression: (fromType, expression) => (0, utils_1.replaceNamesWithIdsInExpression)(schema, fromType, expression),
|
|
200
|
-
visitEnums: (enums) => (0, entries_1.default)(enums).reduce((result, [type, axis]) => {
|
|
201
|
-
if (Object.hasOwn(schema.typeObjectsByName, type)) {
|
|
202
|
-
const typeObject = schema.typeObjectsByName[type];
|
|
203
|
-
result[typeObject.id] = visitAxisSingle(axis, visitor);
|
|
204
|
-
}
|
|
205
|
-
else {
|
|
206
|
-
result[type] = axis;
|
|
207
|
-
}
|
|
208
|
-
return result;
|
|
209
|
-
}, {}),
|
|
210
|
-
visitGroupByExpression: (groupBy, fromType) => (0, smart_folder_1.replaceNamesWithIdsInGroupByExpression)(schema, groupBy, fromType),
|
|
211
|
-
};
|
|
212
|
-
return visitView(view, visitor);
|
|
213
|
-
};
|
|
214
|
-
exports.replaceNamesWithIdsInTimelineView = replaceNamesWithIdsInTimelineView;
|
|
215
|
-
const replaceIdsWithNamesInTimelineView = (schema, view) => {
|
|
216
|
-
const visitor = {
|
|
217
|
-
visitQueryExpression: (query) => (0, utils_1.replaceIdsWithNamesInQueryExpression)(schema, query),
|
|
218
|
-
visitFilter: (fromType, expression) => (0, utils_1.replaceIdsWithNamesInFilter)(schema, fromType, expression),
|
|
219
|
-
visitExpression: (fromType, expression) => (0, utils_1.replaceIdsWithNamesInExpression)(schema, fromType, expression),
|
|
220
|
-
visitEnums: (enums) => (0, entries_1.default)(enums).reduce((result, [typeId, axis]) => {
|
|
221
|
-
if (Object.hasOwn(schema.typeObjectsById, typeId)) {
|
|
222
|
-
const typeObject = schema.typeObjectsById[typeId];
|
|
223
|
-
result[typeObject.name] = visitAxisSingle(axis, visitor);
|
|
224
|
-
}
|
|
225
|
-
else {
|
|
226
|
-
result[typeId] = axis;
|
|
227
|
-
}
|
|
228
|
-
return result;
|
|
229
|
-
}, {}),
|
|
230
|
-
visitGroupByExpression: (groupBy, fromType) => (0, smart_folder_1.replaceIdsWithNamesInGroupByExpression)(schema, groupBy, fromType),
|
|
231
|
-
};
|
|
232
|
-
return visitView(view, visitor);
|
|
233
|
-
};
|
|
234
|
-
exports.replaceIdsWithNamesInTimelineView = replaceIdsWithNamesInTimelineView;
|
|
235
|
-
const ensureAxisAndItemExpressionInvariant = (view, canGroupMetaItem) => {
|
|
236
|
-
const actions = [];
|
|
237
|
-
const y = (0, get_1.default)(view, ["fibery/meta", "y"]);
|
|
238
|
-
const yQuery = (0, get_1.default)(view, ["fibery/meta", "y", "query"]);
|
|
239
|
-
const yGroupByExpression = (0, get_1.default)(view, ["fibery/meta", "y", "groupByExpression"]);
|
|
240
|
-
const items = (0, get_1.default)(view, ["fibery/meta", "items"]);
|
|
241
|
-
if (yQuery === null && yGroupByExpression !== null) {
|
|
242
|
-
actions.push(() => (0, set_1.default)(view, ["fibery/meta", "y", "groupByExpression"], null));
|
|
243
|
-
}
|
|
244
|
-
if (y === null) {
|
|
245
|
-
const resetActions = items.map((item) => () => (item.yExpression = null));
|
|
246
|
-
actions.push(...resetActions);
|
|
247
|
-
}
|
|
248
|
-
const filteredMetaItems = items.filter(canGroupMetaItem);
|
|
249
|
-
if (y !== null && (0, some_1.default)(filteredMetaItems, ({ yExpression }) => yExpression === null)) {
|
|
250
|
-
const resetActions = filteredMetaItems.map((item) => () => (item.yExpression = null));
|
|
251
|
-
actions.push(...resetActions);
|
|
252
|
-
actions.push(() => (0, set_1.default)(view, ["fibery/meta", "y"], null));
|
|
253
|
-
}
|
|
254
|
-
if (y !== null && (0, isEmpty_1.default)(items)) {
|
|
255
|
-
actions.push(() => (0, set_1.default)(view, ["fibery/meta", "y"], null));
|
|
256
|
-
}
|
|
257
|
-
actions.forEach((action) => action());
|
|
258
|
-
return view;
|
|
259
|
-
};
|
|
260
|
-
const deleteExpressionWithNotFoundFieldsOrTypesInTimelineView = (schema, view, ensureAxisInvariant, canGroupMetaItem = (_metaItem) => true) => {
|
|
261
|
-
const visitor = {
|
|
262
|
-
visitQueryExpression: (queryExpression) => (0, utils_1.deleteExpressionWithNotFoundFieldsOrTypesInQueryExpression)(schema, queryExpression),
|
|
263
|
-
visitFilter: (fromType, expression) => (0, utils_1.deleteExpressionWithNotFoundFieldsOrTypesInFilter)(schema, fromType, expression),
|
|
264
|
-
visitExpression: (fromType, expression) => (0, utils_1.deleteExpressionWithNotFoundFieldsOrTypesInExpression)(schema, fromType, expression),
|
|
265
|
-
visitEnums: (enums) => {
|
|
266
|
-
const enumsNew = (0, entries_1.default)(enums).reduce((result, [type, axis]) => {
|
|
267
|
-
if (Object.hasOwn(schema.typeObjectsByName, type)) {
|
|
268
|
-
const typeObject = schema.typeObjectsByName[type];
|
|
269
|
-
const axisResult = visitAxisSingle(axis, visitor);
|
|
270
|
-
if (axisResult) {
|
|
271
|
-
result[typeObject.name] = axisResult;
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
return result;
|
|
275
|
-
}, {});
|
|
276
|
-
return (0, isEmpty_1.default)(enumsNew) ? null : enumsNew;
|
|
277
|
-
},
|
|
278
|
-
visitGroupByExpression: (groupBy, fromType, removedItems) => (0, smart_folder_1.deleteExpressionWithNotFoundFieldsOrTypesInGroupByExpression)(schema, groupBy, fromType, removedItems),
|
|
279
|
-
};
|
|
280
|
-
const viewNew = visitView(view, visitor);
|
|
281
|
-
return ensureAxisInvariant ? ensureAxisAndItemExpressionInvariant(viewNew, canGroupMetaItem) : viewNew;
|
|
282
|
-
};
|
|
283
|
-
exports.deleteExpressionWithNotFoundFieldsOrTypesInTimelineView = deleteExpressionWithNotFoundFieldsOrTypesInTimelineView;
|
|
284
|
-
const fixUserSelectedUnitsInTimelineView = (schema, view, { unitDefinitions, getDefaultUnitTypeForField, }) => {
|
|
285
|
-
return visitView(view, {
|
|
286
|
-
visitQueryExpression: (query) => query,
|
|
287
|
-
visitExpression: (_fromType, expression) => expression,
|
|
288
|
-
visitFilter: (_fromType, filter) => filter,
|
|
289
|
-
visitViewUnit: (fromType, unit, units) => (0, units_1.fixViewUnit)(schema, fromType, unit, units, { unitDefinitions, getDefaultUnitTypeForField }),
|
|
290
|
-
visitEnums: (enums) => enums,
|
|
291
|
-
visitGroupByExpression: (groupBy) => groupBy,
|
|
292
|
-
});
|
|
293
|
-
};
|
|
294
|
-
exports.fixUserSelectedUnitsInTimelineView = fixUserSelectedUnitsInTimelineView;
|
|
295
|
-
const fixContextExpressionWithBrokenPath = (schema, view, defaultContextExpression) => visitView(view, {
|
|
296
|
-
visitExpression: (_fromType, expression) => expression,
|
|
297
|
-
visitFilter: (_fromType, filter) => filter,
|
|
298
|
-
visitQueryExpression: (query) => query,
|
|
299
|
-
visitContextExpression: (fromType, expression) => (0, utils_1.resetContextExpressionIfBroken)(schema, fromType, expression, defaultContextExpression),
|
|
300
|
-
visitEnums: (enums) => enums,
|
|
301
|
-
visitGroupByExpression: (groupBy) => groupBy,
|
|
302
|
-
});
|
|
303
|
-
exports.fixContextExpressionWithBrokenPath = fixContextExpressionWithBrokenPath;
|
|
304
|
-
const collectGarbage = (view) => {
|
|
305
|
-
return visitView(view, {
|
|
306
|
-
visitQueryExpression: (query) => query,
|
|
307
|
-
visitFilter: (_fromType, filter) => filter,
|
|
308
|
-
visitExpression: (_fromType, expression) => expression,
|
|
309
|
-
visitViewUnit: (_fromType, unit) => (unit.checked ? unit : utils_1.REMOVE),
|
|
310
|
-
visitEnums: (enums) => enums,
|
|
311
|
-
visitGroupByExpression: (groupBy) => groupBy,
|
|
312
|
-
});
|
|
313
|
-
};
|
|
314
|
-
exports.collectGarbage = collectGarbage;
|
|
315
|
-
const enableHideWhenEmptyForCheckedEditableUnits = (view) => {
|
|
316
|
-
return visitView(view, {
|
|
317
|
-
visitQueryExpression: (queryExpression) => queryExpression,
|
|
318
|
-
visitExpression: (_fromType, expression) => expression,
|
|
319
|
-
visitFilter: (_fromType, filter) => filter,
|
|
320
|
-
visitViewUnit: (_fromType, unit) => (0, units_1.enableHideWhenEmptyForCheckedEditableUnit)(unit),
|
|
321
|
-
visitEnums: (enums) => enums,
|
|
322
|
-
visitGroupByExpression: (groupBy) => groupBy,
|
|
323
|
-
});
|
|
324
|
-
};
|
|
325
|
-
exports.enableHideWhenEmptyForCheckedEditableUnits = enableHideWhenEmptyForCheckedEditableUnits;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { FieldObject, Schema } from "@fibery/schema";
|
|
2
|
-
import type { Unit } from "@fibery/views/src/units/types";
|
|
3
|
-
import type { UnitDefinitions } from "./utils";
|
|
4
|
-
import { REMOVE } from "./utils";
|
|
5
|
-
export declare const fixViewUnit: (schema: Schema, fromType: string, unit: Unit, units: Unit[], { unitDefinitions, getDefaultUnitTypeForField, migrateFileCollectionUnit, }: {
|
|
6
|
-
unitDefinitions: UnitDefinitions;
|
|
7
|
-
getDefaultUnitTypeForField: (fieldObject: FieldObject, allowedUnits: Unit[]) => string | undefined;
|
|
8
|
-
migrateFileCollectionUnit?: boolean;
|
|
9
|
-
}) => Unit | typeof REMOVE;
|
|
10
|
-
export declare const enableHideWhenEmptyForCheckedEditableUnit: (unit: Unit) => Unit;
|
package/lib/src/private/units.js
DELETED
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.enableHideWhenEmptyForCheckedEditableUnit = exports.fixViewUnit = void 0;
|
|
4
|
-
const utils_1 = require("@fibery/expression-utils/src/utils");
|
|
5
|
-
const utils_2 = require("./utils");
|
|
6
|
-
const getField = (schema, fromType, field) => Object.hasOwn(schema.typeObjectsByName, fromType) &&
|
|
7
|
-
Object.hasOwn(schema.typeObjectsByName[fromType].fieldObjectsByName, field)
|
|
8
|
-
? schema.typeObjectsByName[fromType].fieldObjectsByName[field]
|
|
9
|
-
: undefined;
|
|
10
|
-
const getFieldType = (schema, fromType, field) => getField(schema, fromType, field)?.type;
|
|
11
|
-
const getFieldMeta = (schema, fromType, field) => getField(schema, fromType, field)?.rawMeta;
|
|
12
|
-
const getFieldByExpression = (schema, fromType, expression) => {
|
|
13
|
-
let currentType = fromType;
|
|
14
|
-
let fieldObject;
|
|
15
|
-
for (const part of expression) {
|
|
16
|
-
fieldObject = getField(schema, currentType, part);
|
|
17
|
-
if (!fieldObject) {
|
|
18
|
-
return null;
|
|
19
|
-
}
|
|
20
|
-
currentType = fieldObject.type;
|
|
21
|
-
}
|
|
22
|
-
return fieldObject ?? null;
|
|
23
|
-
};
|
|
24
|
-
const getUnitTypeForTextField = (fieldMeta) => {
|
|
25
|
-
switch (fieldMeta["ui/type"]) {
|
|
26
|
-
case "email":
|
|
27
|
-
return "email";
|
|
28
|
-
case "url":
|
|
29
|
-
return "url";
|
|
30
|
-
case "phone":
|
|
31
|
-
return "phone";
|
|
32
|
-
default:
|
|
33
|
-
return "text";
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
const getUnitKind = (unit) => {
|
|
37
|
-
if (unit.type === "user-button") {
|
|
38
|
-
return "user-button";
|
|
39
|
-
}
|
|
40
|
-
if (["type-icon", "type-badge", "type-badge-abbr"].includes(unit.type)) {
|
|
41
|
-
return "db";
|
|
42
|
-
}
|
|
43
|
-
return "field";
|
|
44
|
-
};
|
|
45
|
-
const migrateUnitOptsDefault = {
|
|
46
|
-
migrateFileCollectionUnit: true,
|
|
47
|
-
};
|
|
48
|
-
const migrateUnit = (schema, fromType, unit, units, opts = migrateUnitOptsDefault) => {
|
|
49
|
-
const kind = unit.kind || getUnitKind(unit);
|
|
50
|
-
if (unit.type === "date-time") {
|
|
51
|
-
return {
|
|
52
|
-
...unit,
|
|
53
|
-
kind,
|
|
54
|
-
type: "date",
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
if (unit.type === "date-time-range") {
|
|
58
|
-
return {
|
|
59
|
-
...unit,
|
|
60
|
-
kind,
|
|
61
|
-
type: "date-range",
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
if (unit.type === "text") {
|
|
65
|
-
const [field] = unit.expression;
|
|
66
|
-
const fieldType = getFieldType(schema, fromType, field);
|
|
67
|
-
if (fieldType === "fibery/email") {
|
|
68
|
-
return {
|
|
69
|
-
...unit,
|
|
70
|
-
kind,
|
|
71
|
-
type: "email",
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
if (unit.type === "text" || unit.type === "email" || unit.type === "phone" || unit.type === "url") {
|
|
76
|
-
const [field] = unit.expression;
|
|
77
|
-
if (getFieldType(schema, fromType, field) === "fibery/text") {
|
|
78
|
-
return {
|
|
79
|
-
...unit,
|
|
80
|
-
kind,
|
|
81
|
-
type: getUnitTypeForTextField(getFieldMeta(schema, fromType, field)),
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
if (unit.type === "files-collection") {
|
|
86
|
-
const [field] = unit.expression;
|
|
87
|
-
if (getFieldType(schema, fromType, field) === "fibery/file") {
|
|
88
|
-
return {
|
|
89
|
-
...unit,
|
|
90
|
-
kind,
|
|
91
|
-
type: opts.migrateFileCollectionUnit ? "file-collection-count" : "collection-count",
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
if (unit.type === "avatar" && !unit.expression) {
|
|
96
|
-
const isAvatarExntensionEnabled = schema.typeObjectsByName[fromType]?.installedMixins.has("avatar/avatar-mixin");
|
|
97
|
-
const hasAvatarExntensionField = getFieldType(schema, fromType, "avatar/avatars") === "fibery/file";
|
|
98
|
-
if (isAvatarExntensionEnabled && hasAvatarExntensionField) {
|
|
99
|
-
return {
|
|
100
|
-
...unit,
|
|
101
|
-
expression: ["avatar/avatars"],
|
|
102
|
-
kind,
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
if (opts.migrateFileCollectionUnit && unit.type === "collection-count") {
|
|
107
|
-
const [field] = unit.expression;
|
|
108
|
-
const fieldObject = getField(schema, fromType, field);
|
|
109
|
-
if (fieldObject?.type === "fibery/file" && fieldObject?.isCollection) {
|
|
110
|
-
return {
|
|
111
|
-
...unit,
|
|
112
|
-
kind,
|
|
113
|
-
type: "file-collection-count",
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
return { ...unit, kind };
|
|
118
|
-
};
|
|
119
|
-
const expressionFrom = (unit) => unit.expression;
|
|
120
|
-
const fixViewUnit = (schema, fromType, unit, units, { unitDefinitions, getDefaultUnitTypeForField, migrateFileCollectionUnit = true, }) => {
|
|
121
|
-
const migrated = migrateUnit(schema, fromType, unit, units, { migrateFileCollectionUnit });
|
|
122
|
-
const expression = expressionFrom(unit) ?? [];
|
|
123
|
-
const fieldObject = getFieldByExpression(schema, fromType, expression);
|
|
124
|
-
if (fieldObject) {
|
|
125
|
-
const typeObject = schema.typeObjectsByName[fromType];
|
|
126
|
-
const parentFieldObjects = typeObject && expression.length > 1
|
|
127
|
-
? (0, utils_1.getFieldObjectsByFieldExpression)({ typeObject, expression }).slice(0, -1)
|
|
128
|
-
: [];
|
|
129
|
-
const allowedUnits = unitDefinitions.getUnitsForField(fieldObject, { parentFieldObjects });
|
|
130
|
-
if (allowedUnits.some((u) => u.type === migrated.type)) {
|
|
131
|
-
return migrated;
|
|
132
|
-
}
|
|
133
|
-
else {
|
|
134
|
-
if (unit.checked) {
|
|
135
|
-
const otherUnitsForField = units.filter((u) => {
|
|
136
|
-
const uExpression = expressionFrom(u);
|
|
137
|
-
return u !== unit && uExpression && expressionFrom(unit) && uExpression.join("/") === expression.join("/");
|
|
138
|
-
});
|
|
139
|
-
const hasEnabledUnitForField = otherUnitsForField.some((u) => u.checked);
|
|
140
|
-
if (hasEnabledUnitForField) {
|
|
141
|
-
return utils_2.REMOVE;
|
|
142
|
-
}
|
|
143
|
-
const defaultUnitType = getDefaultUnitTypeForField(fieldObject, allowedUnits);
|
|
144
|
-
const defaultUnit = (defaultUnitType && otherUnitsForField.find((u) => u.type === defaultUnitType)) ||
|
|
145
|
-
otherUnitsForField[0];
|
|
146
|
-
if (defaultUnit) {
|
|
147
|
-
defaultUnit.checked = true;
|
|
148
|
-
return utils_2.REMOVE;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
else {
|
|
152
|
-
return utils_2.REMOVE;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
return migrated;
|
|
157
|
-
};
|
|
158
|
-
exports.fixViewUnit = fixViewUnit;
|
|
159
|
-
const enableHideWhenEmptyForCheckedEditableUnit = (unit) => {
|
|
160
|
-
if (unit.checked) {
|
|
161
|
-
return { ...unit, hideWhenEmpty: true };
|
|
162
|
-
}
|
|
163
|
-
return unit;
|
|
164
|
-
};
|
|
165
|
-
exports.enableHideWhenEmptyForCheckedEditableUnit = enableHideWhenEmptyForCheckedEditableUnit;
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import type { Expression, Query } from "@fibery/expression-utils/src/types";
|
|
2
|
-
import type { FieldObject, Schema } from "@fibery/schema";
|
|
3
|
-
import type { Unit } from "@fibery/views/src/units/types";
|
|
4
|
-
export declare const REMOVE: unique symbol;
|
|
5
|
-
export declare const skipRemove: (unit: Unit | typeof REMOVE) => unit is Unit;
|
|
6
|
-
export type ViewVisitor = {
|
|
7
|
-
visitExpression: (fromType: string, expression: Expression) => Expression | null;
|
|
8
|
-
visitFilter: (fromType: string, filter: ViewFilter | null) => ViewFilter | null;
|
|
9
|
-
visitQueryExpression: (query: Query) => Query | null;
|
|
10
|
-
visitViewUnit?: (fromType: string, unit: Unit, units: Unit[]) => Unit | typeof REMOVE;
|
|
11
|
-
visitContextExpression?: (fromType: string, expression: Expression) => Expression;
|
|
12
|
-
visitGroupByExpression?: (groupBy: Record<string, unknown>, fromType: string, removedItems?: number[]) => Record<string, unknown> | null;
|
|
13
|
-
visitEnums?: (enums: Record<string, unknown>) => Record<string, unknown> | null;
|
|
14
|
-
visitUnitGroupKey?: (key: string) => string;
|
|
15
|
-
};
|
|
16
|
-
export type UnitDefinitions = {
|
|
17
|
-
getUnitsForField: (fieldObject: FieldObject, options?: {
|
|
18
|
-
parentFieldObjects?: FieldObject[];
|
|
19
|
-
}) => Unit[];
|
|
20
|
-
};
|
|
21
|
-
export type ViewRecord = Record<string, unknown>;
|
|
22
|
-
type ViewFilterLeaf = {
|
|
23
|
-
kind: string;
|
|
24
|
-
value: {
|
|
25
|
-
expression: Expression | null;
|
|
26
|
-
[k: string]: unknown;
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
type ViewFilterGroup = {
|
|
30
|
-
kind: "group";
|
|
31
|
-
value: ViewFilter[];
|
|
32
|
-
};
|
|
33
|
-
export type ViewFilter = ViewFilterLeaf | ViewFilterGroup;
|
|
34
|
-
export declare const deleteExpressionWithNotFoundFieldsOrTypesInFilter: (schema: Schema, fromType: string, filter: ViewFilter) => ViewFilter | null;
|
|
35
|
-
export declare const deleteExpressionWithNotFoundFieldsOrTypesInQueryExpression: (schema: Schema, queryExpression: Query) => Query | null;
|
|
36
|
-
export declare const replaceNamesWithIdsInExpression: (schema: Schema, fromType: string, expression: Expression) => any;
|
|
37
|
-
export declare const replaceIdsWithNamesInExpression: (schema: Schema, fromTypeId: string, expression: Expression) => any;
|
|
38
|
-
export declare const visitViewUnit: (fromType: string, unit: Unit, visitor: Pick<ViewVisitor, "visitExpression">) => Unit;
|
|
39
|
-
export declare const visitContextExpression: (fromType: string, contextExpression: Expression | null | undefined, visitor: Pick<ViewVisitor, "visitExpression" | "visitContextExpression">) => string | Expression[] | null | undefined;
|
|
40
|
-
export declare const replaceIdsWithNamesInQueryExpression: (schema: Schema, queryExpression: Query) => {
|
|
41
|
-
"q/order-by"?: any;
|
|
42
|
-
"q/where"?: any;
|
|
43
|
-
"q/from": string;
|
|
44
|
-
"q/select"?: Expression | import("@fibery/expression-utils/src/types").Select;
|
|
45
|
-
"q/offset"?: number;
|
|
46
|
-
"q/limit"?: import("@fibery/expression-utils/src/types").QueryLimit;
|
|
47
|
-
};
|
|
48
|
-
export declare const replaceIdsWithNamesInFilter: (schema: Schema, fromType: string, filter: ViewFilter | null) => ViewFilter | null;
|
|
49
|
-
export declare const replaceNamesWithIdsInFilter: (schema: Schema, fromType: string, filter: ViewFilter | null) => ViewFilter | null;
|
|
50
|
-
export declare const replaceNamesWithIdsInQueryExpression: (schema: Schema, queryExpression: Query) => {
|
|
51
|
-
"q/order-by"?: any;
|
|
52
|
-
"q/where"?: any;
|
|
53
|
-
"q/from": string;
|
|
54
|
-
"q/select"?: Expression | import("@fibery/expression-utils/src/types").Select;
|
|
55
|
-
"q/offset"?: number;
|
|
56
|
-
"q/limit"?: import("@fibery/expression-utils/src/types").QueryLimit;
|
|
57
|
-
};
|
|
58
|
-
export declare const deleteExpressionWithNotFoundFieldsOrTypesInExpression: (schema: Schema, fromType: string, expression: Expression) => any;
|
|
59
|
-
export declare const resetContextExpressionIfBroken: (schema: Schema, fromType: string, expression: Expression, defaultExpression: Expression) => any;
|
|
60
|
-
export declare const isUnitExpressionValid: (unit: Record<string, unknown>) => boolean;
|
|
61
|
-
export declare const getFieldObjectsById: (smartFolder: Record<string, unknown>, schema: Schema) => Record<string, FieldObject>;
|
|
62
|
-
export declare const replaceIdsWithNamesInUnitGroupKey: (unitGroupKey: string, fieldObjectsById: Record<string, FieldObject>) => string;
|
|
63
|
-
export declare const replaceNamesWithIdsInUnitGroupKey: (unitGroupKey: string, schema: Schema) => string;
|
|
64
|
-
export {};
|