@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
package/lib/src/private/form.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deleteExpressionWithNotFoundFieldsOrTypesInFormView = exports.replaceIdsWithNamesInFormView = exports.replaceNamesWithIdsInFormView = void 0;
|
|
4
|
-
const replaceNamesWithIdsInFormView = (schema, view) => {
|
|
5
|
-
const typeId = view["fibery/meta"]?.typeId;
|
|
6
|
-
const typeObject = typeId && Object.hasOwn(schema.typeObjectsByName, typeId) ? schema.typeObjectsByName[typeId] : null;
|
|
7
|
-
const fields = view["fibery/meta"]?.fields;
|
|
8
|
-
const fieldsInIdsTerms = fields &&
|
|
9
|
-
fields.map((field) => {
|
|
10
|
-
if (!typeObject || !Object.hasOwn(typeObject.fieldObjectsByName, field.id)) {
|
|
11
|
-
return field;
|
|
12
|
-
}
|
|
13
|
-
return { ...field, id: typeObject.fieldObjectsByName[field.id].id };
|
|
14
|
-
});
|
|
15
|
-
return {
|
|
16
|
-
...view,
|
|
17
|
-
"fibery/meta": {
|
|
18
|
-
...view["fibery/meta"],
|
|
19
|
-
typeId: typeObject ? typeObject.id : typeId,
|
|
20
|
-
fields: fieldsInIdsTerms || fields,
|
|
21
|
-
},
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
exports.replaceNamesWithIdsInFormView = replaceNamesWithIdsInFormView;
|
|
25
|
-
const replaceIdsWithNamesInFormView = (schema, view) => {
|
|
26
|
-
const typeId = view["fibery/meta"]?.typeId;
|
|
27
|
-
const typeObject = typeId && Object.hasOwn(schema.typeObjectsById, typeId) ? schema.typeObjectsById[typeId] : null;
|
|
28
|
-
const fields = view["fibery/meta"]?.fields;
|
|
29
|
-
const fieldsInNameTerms = fields &&
|
|
30
|
-
fields.map((field) => {
|
|
31
|
-
if (!typeObject || !Object.hasOwn(typeObject.fieldObjectsById, field.id)) {
|
|
32
|
-
return field;
|
|
33
|
-
}
|
|
34
|
-
return { ...field, id: typeObject.fieldObjectsById[field.id].name };
|
|
35
|
-
});
|
|
36
|
-
return {
|
|
37
|
-
...view,
|
|
38
|
-
"fibery/meta": {
|
|
39
|
-
...view["fibery/meta"],
|
|
40
|
-
typeId: typeObject ? typeObject.name : typeId,
|
|
41
|
-
fields: fieldsInNameTerms || fields,
|
|
42
|
-
},
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
exports.replaceIdsWithNamesInFormView = replaceIdsWithNamesInFormView;
|
|
46
|
-
const deleteExpressionWithNotFoundFieldsOrTypesInFormView = (schema, view) => {
|
|
47
|
-
// we expect view in names terms here.
|
|
48
|
-
const typeName = view["fibery/meta"]?.typeId;
|
|
49
|
-
const typeObject = typeName && Object.hasOwn(schema.typeObjectsByName, typeName) ? schema.typeObjectsByName[typeName] : null;
|
|
50
|
-
const fields = view["fibery/meta"]?.fields;
|
|
51
|
-
const existingFields = fields && fields.filter((field) => typeObject && Object.hasOwn(typeObject.fieldObjectsByName, field.id));
|
|
52
|
-
return {
|
|
53
|
-
...view,
|
|
54
|
-
"fibery/meta": {
|
|
55
|
-
...view["fibery/meta"],
|
|
56
|
-
typeId: typeObject ? typeObject.name : typeName,
|
|
57
|
-
fields: existingFields || fields,
|
|
58
|
-
},
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
exports.deleteExpressionWithNotFoundFieldsOrTypesInFormView = deleteExpressionWithNotFoundFieldsOrTypesInFormView;
|
package/lib/src/private/map.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Expression } 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, ViewRecord } from "./utils";
|
|
5
|
-
export declare const replaceNamesWithIdsInMapView: (schema: Schema, view: ViewRecord) => any;
|
|
6
|
-
export declare const replaceIdsWithNamesInMapView: (schema: Schema, view: ViewRecord) => any;
|
|
7
|
-
export declare const deleteExpressionWithNotFoundFieldsOrTypesInMapView: (schema: Schema, view: ViewRecord) => any;
|
|
8
|
-
export declare const fixUserSelectedUnitsInMapView: (schema: Schema, view: ViewRecord, { unitDefinitions, getDefaultUnitTypeForField, }: {
|
|
9
|
-
unitDefinitions: UnitDefinitions;
|
|
10
|
-
getDefaultUnitTypeForField: (fieldObject: FieldObject, allowedUnits: Unit[]) => string | undefined;
|
|
11
|
-
}) => any;
|
|
12
|
-
export declare const fixContextExpressionWithBrokenPath: (schema: Schema, view: ViewRecord, defaultContextExpression: Expression) => any;
|
|
13
|
-
export declare const collectGarbage: (view: ViewRecord) => any;
|
|
14
|
-
export declare const enableHideWhenEmptyForCheckedUnits: (view: ViewRecord) => any;
|
package/lib/src/private/map.js
DELETED
|
@@ -1,120 +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.enableHideWhenEmptyForCheckedUnits = exports.collectGarbage = exports.fixContextExpressionWithBrokenPath = exports.fixUserSelectedUnitsInMapView = exports.deleteExpressionWithNotFoundFieldsOrTypesInMapView = exports.replaceIdsWithNamesInMapView = exports.replaceNamesWithIdsInMapView = void 0;
|
|
7
|
-
const _1 = require("@fibery/helpers/src/_");
|
|
8
|
-
const immutability_helper_1 = __importDefault(require("immutability-helper"));
|
|
9
|
-
const get_1 = __importDefault(require("lodash/get"));
|
|
10
|
-
const units_1 = require("./units");
|
|
11
|
-
const utils_1 = require("./utils");
|
|
12
|
-
const visitView = (view, visitor) => (0, immutability_helper_1.default)(view, {
|
|
13
|
-
"fibery/meta": {
|
|
14
|
-
items: {
|
|
15
|
-
$apply: (items) => items
|
|
16
|
-
.map((item) => {
|
|
17
|
-
const fromType = (0, get_1.default)(item, ["query", "q/from"]);
|
|
18
|
-
return fromType
|
|
19
|
-
? (0, immutability_helper_1.default)(item, {
|
|
20
|
-
locationExpression: {
|
|
21
|
-
$apply: (startExpression) => startExpression ? visitor.visitExpression(fromType, startExpression) : startExpression,
|
|
22
|
-
},
|
|
23
|
-
contextExpression: {
|
|
24
|
-
$apply: (contextExpression) => (0, utils_1.visitContextExpression)(fromType, contextExpression, visitor),
|
|
25
|
-
},
|
|
26
|
-
query: {
|
|
27
|
-
$apply: (query) => (query ? visitor.visitQueryExpression(query) : null),
|
|
28
|
-
},
|
|
29
|
-
filter: {
|
|
30
|
-
$apply: (filter) => (filter ? visitor.visitFilter(fromType, filter) : null),
|
|
31
|
-
},
|
|
32
|
-
units: {
|
|
33
|
-
$apply: (units) => units
|
|
34
|
-
? units
|
|
35
|
-
.filter(_1.truthy)
|
|
36
|
-
.map((unit) => (0, utils_1.visitViewUnit)(fromType, unit, visitor))
|
|
37
|
-
.filter(utils_1.isUnitExpressionValid)
|
|
38
|
-
.map((unit, idx, units) => visitor.visitViewUnit ? visitor.visitViewUnit(fromType, unit, units) : unit)
|
|
39
|
-
.filter((unit) => unit !== utils_1.REMOVE)
|
|
40
|
-
: undefined,
|
|
41
|
-
},
|
|
42
|
-
colorCoding: {
|
|
43
|
-
$apply: (colorCodings) => {
|
|
44
|
-
return (colorCodings &&
|
|
45
|
-
colorCodings
|
|
46
|
-
.map((colorCoding) => ({
|
|
47
|
-
...colorCoding,
|
|
48
|
-
expression: visitor.visitExpression(fromType, colorCoding.expression),
|
|
49
|
-
}))
|
|
50
|
-
.filter((colorCoding) => colorCoding.expression !== null));
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
})
|
|
54
|
-
: item;
|
|
55
|
-
})
|
|
56
|
-
.filter((item) => {
|
|
57
|
-
const { query } = item;
|
|
58
|
-
return query ? item : null;
|
|
59
|
-
}),
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
});
|
|
63
|
-
const replaceNamesWithIdsInMapView = (schema, view) => {
|
|
64
|
-
return visitView(view, {
|
|
65
|
-
visitQueryExpression: (query) => (0, utils_1.replaceNamesWithIdsInQueryExpression)(schema, query),
|
|
66
|
-
visitFilter: (fromType, expression) => (0, utils_1.replaceNamesWithIdsInFilter)(schema, fromType, expression),
|
|
67
|
-
visitExpression: (fromType, expression) => (0, utils_1.replaceNamesWithIdsInExpression)(schema, fromType, expression),
|
|
68
|
-
});
|
|
69
|
-
};
|
|
70
|
-
exports.replaceNamesWithIdsInMapView = replaceNamesWithIdsInMapView;
|
|
71
|
-
const replaceIdsWithNamesInMapView = (schema, view) => {
|
|
72
|
-
return visitView(view, {
|
|
73
|
-
visitQueryExpression: (query) => (0, utils_1.replaceIdsWithNamesInQueryExpression)(schema, query),
|
|
74
|
-
visitFilter: (fromType, expression) => (0, utils_1.replaceIdsWithNamesInFilter)(schema, fromType, expression),
|
|
75
|
-
visitExpression: (fromType, expression) => (0, utils_1.replaceIdsWithNamesInExpression)(schema, fromType, expression),
|
|
76
|
-
});
|
|
77
|
-
};
|
|
78
|
-
exports.replaceIdsWithNamesInMapView = replaceIdsWithNamesInMapView;
|
|
79
|
-
const deleteExpressionWithNotFoundFieldsOrTypesInMapView = (schema, view) => visitView(view, {
|
|
80
|
-
visitQueryExpression: (queryExpression) => (0, utils_1.deleteExpressionWithNotFoundFieldsOrTypesInQueryExpression)(schema, queryExpression),
|
|
81
|
-
visitFilter: (fromType, expression) => (0, utils_1.deleteExpressionWithNotFoundFieldsOrTypesInFilter)(schema, fromType, expression),
|
|
82
|
-
visitExpression: (fromType, expression) => (0, utils_1.deleteExpressionWithNotFoundFieldsOrTypesInExpression)(schema, fromType, expression),
|
|
83
|
-
});
|
|
84
|
-
exports.deleteExpressionWithNotFoundFieldsOrTypesInMapView = deleteExpressionWithNotFoundFieldsOrTypesInMapView;
|
|
85
|
-
const fixUserSelectedUnitsInMapView = (schema, view, { unitDefinitions, getDefaultUnitTypeForField, }) => {
|
|
86
|
-
return visitView(view, {
|
|
87
|
-
visitQueryExpression: (query) => query,
|
|
88
|
-
visitFilter: (_fromType, filter) => filter,
|
|
89
|
-
visitExpression: (_fromType, expression) => expression,
|
|
90
|
-
visitViewUnit: (fromType, unit, units) => (0, units_1.fixViewUnit)(schema, fromType, unit, units, { unitDefinitions, getDefaultUnitTypeForField }),
|
|
91
|
-
});
|
|
92
|
-
};
|
|
93
|
-
exports.fixUserSelectedUnitsInMapView = fixUserSelectedUnitsInMapView;
|
|
94
|
-
const fixContextExpressionWithBrokenPath = (schema, view, defaultContextExpression) => visitView(view, {
|
|
95
|
-
visitExpression: (_fromType, expression) => expression,
|
|
96
|
-
visitQueryExpression: (query) => query,
|
|
97
|
-
visitFilter: (_fromType, filter) => filter,
|
|
98
|
-
visitContextExpression: (fromType, expression) => (0, utils_1.resetContextExpressionIfBroken)(schema, fromType, expression, defaultContextExpression),
|
|
99
|
-
});
|
|
100
|
-
exports.fixContextExpressionWithBrokenPath = fixContextExpressionWithBrokenPath;
|
|
101
|
-
const collectGarbage = (view) => {
|
|
102
|
-
return visitView(view, {
|
|
103
|
-
visitQueryExpression: (query) => query,
|
|
104
|
-
visitFilter: (_fromType, filter) => filter,
|
|
105
|
-
visitExpression: (_fromType, expression) => expression,
|
|
106
|
-
visitViewUnit: (_fromType, unit) => (unit.checked ? unit : utils_1.REMOVE),
|
|
107
|
-
});
|
|
108
|
-
};
|
|
109
|
-
exports.collectGarbage = collectGarbage;
|
|
110
|
-
const enableHideWhenEmptyForCheckedUnits = (view) => {
|
|
111
|
-
return visitView(view, {
|
|
112
|
-
visitQueryExpression: (queryExpression) => queryExpression,
|
|
113
|
-
visitGroupByExpression: (groupBy) => groupBy,
|
|
114
|
-
visitFilter: (_fromType, filter) => filter,
|
|
115
|
-
visitExpression: (_fromType, expression) => expression,
|
|
116
|
-
visitEnums: (enums) => enums,
|
|
117
|
-
visitViewUnit: (_fromType, unit) => (0, units_1.enableHideWhenEmptyForCheckedEditableUnit)(unit),
|
|
118
|
-
});
|
|
119
|
-
};
|
|
120
|
-
exports.enableHideWhenEmptyForCheckedUnits = enableHideWhenEmptyForCheckedUnits;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { Expression } 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, ViewRecord } from "./utils";
|
|
5
|
-
type GroupByEntry = {
|
|
6
|
-
expression: Expression;
|
|
7
|
-
[k: string]: unknown;
|
|
8
|
-
};
|
|
9
|
-
type GroupByExpression = Record<string, GroupByEntry>;
|
|
10
|
-
export declare const deleteExpressionWithNotFoundFieldsOrTypesInGroupByExpression: (schema: Schema, groupByExpression: GroupByExpression | null, fromType: string, removedItems: number[]) => any;
|
|
11
|
-
export declare const replaceIdsWithNamesInGroupByExpression: (schema: Schema, groupByExpression: GroupByExpression | null, fromType: string) => {
|
|
12
|
-
[k: string]: {
|
|
13
|
-
expression: any;
|
|
14
|
-
};
|
|
15
|
-
} | null;
|
|
16
|
-
export declare const replaceNamesWithIdsInGroupByExpression: (schema: Schema, groupByExpression: GroupByExpression | null, fromType: string) => {
|
|
17
|
-
[k: string]: {
|
|
18
|
-
expression: any;
|
|
19
|
-
};
|
|
20
|
-
} | null;
|
|
21
|
-
export declare const replaceNamesWithIdsInSmartFolder: (schema: Schema, smartFolder: ViewRecord) => any;
|
|
22
|
-
export declare const replaceIdsWithNamesInSmartFolder: (schema: Schema, smartFolder: ViewRecord) => any;
|
|
23
|
-
export declare const deleteExpressionWithNotFoundFieldsOrTypesInSmartFolder: (schema: Schema, smartFolder: ViewRecord) => any;
|
|
24
|
-
export declare const fixContextExpressionWithBrokenPath: (schema: Schema, view: ViewRecord, defaultContextExpression: Expression) => any;
|
|
25
|
-
export declare const fixUserSelectedUnitsInSmartFolder: (schema: Schema, view: ViewRecord, { unitDefinitions, getDefaultUnitTypeForField, }: {
|
|
26
|
-
unitDefinitions: UnitDefinitions;
|
|
27
|
-
getDefaultUnitTypeForField: (fieldObject: FieldObject, allowedUnits: Unit[]) => string | undefined;
|
|
28
|
-
}) => any;
|
|
29
|
-
export declare const collectGarbage: (view: ViewRecord) => any;
|
|
30
|
-
export declare const enableHideWhenEmptyForCheckedUnits: (view: ViewRecord) => any;
|
|
31
|
-
export {};
|
|
@@ -1,277 +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.enableHideWhenEmptyForCheckedUnits = exports.collectGarbage = exports.fixUserSelectedUnitsInSmartFolder = exports.fixContextExpressionWithBrokenPath = exports.deleteExpressionWithNotFoundFieldsOrTypesInSmartFolder = exports.replaceIdsWithNamesInSmartFolder = exports.replaceNamesWithIdsInSmartFolder = exports.replaceNamesWithIdsInGroupByExpression = exports.replaceIdsWithNamesInGroupByExpression = exports.deleteExpressionWithNotFoundFieldsOrTypesInGroupByExpression = void 0;
|
|
7
|
-
const visitors_1 = require("@fibery/expression-utils/src/visitors");
|
|
8
|
-
const _1 = require("@fibery/helpers/src/_");
|
|
9
|
-
const immutability_helper_1 = __importDefault(require("immutability-helper"));
|
|
10
|
-
const get_1 = __importDefault(require("lodash/get"));
|
|
11
|
-
const isEqual_1 = __importDefault(require("lodash/isEqual"));
|
|
12
|
-
const units_1 = require("./units");
|
|
13
|
-
const utils_1 = require("./utils");
|
|
14
|
-
const visitSmartFolder = (smartFolder, visitor) => (0, immutability_helper_1.default)(smartFolder, {
|
|
15
|
-
"fibery/meta": {
|
|
16
|
-
items: {
|
|
17
|
-
$apply: (items = []) => {
|
|
18
|
-
const isOldSmartFolder = !items.every((item) => Object.hasOwn(item, "groupBy"));
|
|
19
|
-
const removedItemsIndexes = items
|
|
20
|
-
.map((item, index) => visitor.visitQueryExpression(item.query) ? null : index)
|
|
21
|
-
.filter((value) => value !== null);
|
|
22
|
-
return items
|
|
23
|
-
.map((item) => {
|
|
24
|
-
if (isOldSmartFolder) {
|
|
25
|
-
return item;
|
|
26
|
-
}
|
|
27
|
-
const fromType = (0, get_1.default)(item, ["query", "q/from"]);
|
|
28
|
-
return fromType
|
|
29
|
-
? (0, immutability_helper_1.default)(item, {
|
|
30
|
-
groupBy: {
|
|
31
|
-
$apply: (groupBy) => {
|
|
32
|
-
if (!groupBy) {
|
|
33
|
-
return null;
|
|
34
|
-
}
|
|
35
|
-
const groupByIndexes = Object.keys(groupBy).map((key) => parseInt(key));
|
|
36
|
-
const removedItemsBeforeTargetLengths = groupByIndexes.map((groupByIndex) => removedItemsIndexes.filter((n) => n < groupByIndex).length);
|
|
37
|
-
return visitor.visitGroupByExpression(groupBy, fromType, removedItemsBeforeTargetLengths);
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
})
|
|
41
|
-
: item;
|
|
42
|
-
})
|
|
43
|
-
.map((item) => {
|
|
44
|
-
if (isOldSmartFolder) {
|
|
45
|
-
return item;
|
|
46
|
-
}
|
|
47
|
-
const fromType = (0, get_1.default)(item, ["query", "q/from"]);
|
|
48
|
-
return fromType
|
|
49
|
-
? (0, immutability_helper_1.default)(item, {
|
|
50
|
-
groupingExpression: {
|
|
51
|
-
$apply: (groupingExpression) => {
|
|
52
|
-
if (!groupingExpression) {
|
|
53
|
-
return null;
|
|
54
|
-
}
|
|
55
|
-
const groupingExpressionIndexes = Object.keys(groupingExpression).map((key) => parseInt(key));
|
|
56
|
-
const removedItemsBeforeTargetLengths = groupingExpressionIndexes.map((groupByIndex) => removedItemsIndexes.filter((n) => n < groupByIndex).length);
|
|
57
|
-
return visitor.visitGroupByExpression(groupingExpression, fromType, removedItemsBeforeTargetLengths);
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
})
|
|
61
|
-
: item;
|
|
62
|
-
})
|
|
63
|
-
.map((item) => {
|
|
64
|
-
const fromType = (0, get_1.default)(item, ["query", "q/from"]);
|
|
65
|
-
return fromType
|
|
66
|
-
? (0, immutability_helper_1.default)(item, {
|
|
67
|
-
filter: {
|
|
68
|
-
$apply: (filter) => (filter ? visitor.visitFilter(fromType, filter) : null),
|
|
69
|
-
},
|
|
70
|
-
query: {
|
|
71
|
-
$apply: (query) => {
|
|
72
|
-
const visitedQuery = visitor.visitQueryExpression(query);
|
|
73
|
-
return query ? visitedQuery : null;
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
units: {
|
|
77
|
-
$apply: (units) => {
|
|
78
|
-
return units
|
|
79
|
-
? units
|
|
80
|
-
.filter(_1.truthy)
|
|
81
|
-
.map((unit) => (0, utils_1.visitViewUnit)(fromType, unit, visitor))
|
|
82
|
-
.filter(utils_1.isUnitExpressionValid)
|
|
83
|
-
.map((unit, index, units) => visitor.visitViewUnit ? visitor.visitViewUnit(fromType, unit, units) : unit)
|
|
84
|
-
.filter((unit) => unit !== utils_1.REMOVE)
|
|
85
|
-
: undefined;
|
|
86
|
-
},
|
|
87
|
-
},
|
|
88
|
-
contextExpression: {
|
|
89
|
-
$apply: (contextExpression) => (0, utils_1.visitContextExpression)(fromType, contextExpression, visitor),
|
|
90
|
-
},
|
|
91
|
-
colorCoding: {
|
|
92
|
-
$apply: (colorCodings) => {
|
|
93
|
-
return colorCodings
|
|
94
|
-
? colorCodings
|
|
95
|
-
.map((colorCoding) => ({
|
|
96
|
-
...colorCoding,
|
|
97
|
-
expression: visitor.visitExpression(fromType, colorCoding.expression),
|
|
98
|
-
}))
|
|
99
|
-
.filter((colorCoding) => colorCoding.expression !== null)
|
|
100
|
-
: undefined;
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
})
|
|
104
|
-
: item;
|
|
105
|
-
})
|
|
106
|
-
.filter((item) => {
|
|
107
|
-
const { query } = item;
|
|
108
|
-
return query ? item : null;
|
|
109
|
-
});
|
|
110
|
-
},
|
|
111
|
-
},
|
|
112
|
-
columnOrderWithIds: {
|
|
113
|
-
$apply: (columnOrderWithIds) => {
|
|
114
|
-
if (!visitor.visitUnitGroupKey || !columnOrderWithIds) {
|
|
115
|
-
return columnOrderWithIds;
|
|
116
|
-
}
|
|
117
|
-
return columnOrderWithIds.map((key) => visitor.visitUnitGroupKey(key));
|
|
118
|
-
},
|
|
119
|
-
},
|
|
120
|
-
pinnedColumnsWithIds: {
|
|
121
|
-
$apply: (pinnedColumnsWithIds) => {
|
|
122
|
-
if (!visitor.visitUnitGroupKey || !pinnedColumnsWithIds) {
|
|
123
|
-
return pinnedColumnsWithIds;
|
|
124
|
-
}
|
|
125
|
-
return pinnedColumnsWithIds.map((key) => visitor.visitUnitGroupKey(key));
|
|
126
|
-
},
|
|
127
|
-
},
|
|
128
|
-
columnAggFunc: {
|
|
129
|
-
$apply: (columnAggFunc) => {
|
|
130
|
-
if (!visitor.visitUnitGroupKey || !columnAggFunc) {
|
|
131
|
-
return columnAggFunc;
|
|
132
|
-
}
|
|
133
|
-
return Object.fromEntries(Object.entries(columnAggFunc).map(([key, value]) => {
|
|
134
|
-
return [visitor.visitUnitGroupKey(key), value];
|
|
135
|
-
}));
|
|
136
|
-
},
|
|
137
|
-
},
|
|
138
|
-
},
|
|
139
|
-
});
|
|
140
|
-
const deleteExpressionWithNotFoundFieldsOrTypesInGroupByExpression = (schema, groupByExpression, fromType, removedItems) => {
|
|
141
|
-
if (!groupByExpression) {
|
|
142
|
-
return null;
|
|
143
|
-
}
|
|
144
|
-
const entries = Object.entries(groupByExpression)
|
|
145
|
-
.map(([index, { expression }], groupByIndex) => {
|
|
146
|
-
const visitedExpression = (0, utils_1.deleteExpressionWithNotFoundFieldsOrTypesInExpression)(schema, fromType, expression);
|
|
147
|
-
if (visitedExpression) {
|
|
148
|
-
return [
|
|
149
|
-
`${parseInt(index) - removedItems[groupByIndex]}`,
|
|
150
|
-
{
|
|
151
|
-
expression: visitedExpression,
|
|
152
|
-
},
|
|
153
|
-
];
|
|
154
|
-
}
|
|
155
|
-
return null;
|
|
156
|
-
})
|
|
157
|
-
.filter(_1.truthy);
|
|
158
|
-
return entries.length > 0 ? Object.fromEntries(entries) : null;
|
|
159
|
-
};
|
|
160
|
-
exports.deleteExpressionWithNotFoundFieldsOrTypesInGroupByExpression = deleteExpressionWithNotFoundFieldsOrTypesInGroupByExpression;
|
|
161
|
-
const replaceIdsWithNamesInGroupByExpression = (schema, groupByExpression, fromType) => {
|
|
162
|
-
if (!groupByExpression) {
|
|
163
|
-
return null;
|
|
164
|
-
}
|
|
165
|
-
return Object.fromEntries(Object.entries(groupByExpression).map(([index, { expression }]) => {
|
|
166
|
-
if (Object.hasOwn(schema.typeObjectsById, fromType)) {
|
|
167
|
-
const typeObject = schema.typeObjectsById[fromType];
|
|
168
|
-
return [
|
|
169
|
-
index,
|
|
170
|
-
{
|
|
171
|
-
expression: (0, visitors_1.replaceIdsWithNamesVisitor)(typeObject).visitExpression(expression),
|
|
172
|
-
},
|
|
173
|
-
];
|
|
174
|
-
}
|
|
175
|
-
else {
|
|
176
|
-
return [index, { expression }];
|
|
177
|
-
}
|
|
178
|
-
}));
|
|
179
|
-
};
|
|
180
|
-
exports.replaceIdsWithNamesInGroupByExpression = replaceIdsWithNamesInGroupByExpression;
|
|
181
|
-
const replaceNamesWithIdsInGroupByExpression = (schema, groupByExpression, fromType) => {
|
|
182
|
-
if (!groupByExpression) {
|
|
183
|
-
return null;
|
|
184
|
-
}
|
|
185
|
-
return Object.fromEntries(Object.entries(groupByExpression).map(([index, { expression }]) => {
|
|
186
|
-
if (Object.hasOwn(schema.typeObjectsByName, fromType)) {
|
|
187
|
-
const typeObject = schema.typeObjectsByName[fromType];
|
|
188
|
-
return [
|
|
189
|
-
index,
|
|
190
|
-
{
|
|
191
|
-
expression: (0, visitors_1.replaceNamesWithIdsVisitor)(typeObject).visitExpression(expression),
|
|
192
|
-
},
|
|
193
|
-
];
|
|
194
|
-
}
|
|
195
|
-
else {
|
|
196
|
-
return [index, { expression }];
|
|
197
|
-
}
|
|
198
|
-
}));
|
|
199
|
-
};
|
|
200
|
-
exports.replaceNamesWithIdsInGroupByExpression = replaceNamesWithIdsInGroupByExpression;
|
|
201
|
-
const replaceNamesWithIdsInSmartFolder = (schema, smartFolder) => visitSmartFolder(smartFolder, {
|
|
202
|
-
visitQueryExpression: (query) => (0, utils_1.replaceNamesWithIdsInQueryExpression)(schema, query),
|
|
203
|
-
visitFilter: (fromType, expression) => (0, utils_1.replaceNamesWithIdsInFilter)(schema, fromType, expression),
|
|
204
|
-
visitGroupByExpression: (groupBy, fromType) => (0, exports.replaceNamesWithIdsInGroupByExpression)(schema, groupBy, fromType),
|
|
205
|
-
visitExpression: (fromType, expression) => (0, utils_1.replaceNamesWithIdsInExpression)(schema, fromType, expression),
|
|
206
|
-
visitUnitGroupKey: (unitGroupKey) => (0, utils_1.replaceNamesWithIdsInUnitGroupKey)(unitGroupKey, schema),
|
|
207
|
-
});
|
|
208
|
-
exports.replaceNamesWithIdsInSmartFolder = replaceNamesWithIdsInSmartFolder;
|
|
209
|
-
const replaceIdsWithNamesInSmartFolder = (schema, smartFolder) => visitSmartFolder(smartFolder, {
|
|
210
|
-
visitQueryExpression: (query) => (0, utils_1.replaceIdsWithNamesInQueryExpression)(schema, query),
|
|
211
|
-
visitFilter: (fromType, expression) => (0, utils_1.replaceIdsWithNamesInFilter)(schema, fromType, expression),
|
|
212
|
-
visitGroupByExpression: (groupBy, fromType) => (0, exports.replaceIdsWithNamesInGroupByExpression)(schema, groupBy, fromType),
|
|
213
|
-
visitExpression: (fromType, expression) => (0, utils_1.replaceIdsWithNamesInExpression)(schema, fromType, expression),
|
|
214
|
-
visitUnitGroupKey: (unitGroupKey) => (0, utils_1.replaceIdsWithNamesInUnitGroupKey)(unitGroupKey, (0, utils_1.getFieldObjectsById)(smartFolder, schema)),
|
|
215
|
-
});
|
|
216
|
-
exports.replaceIdsWithNamesInSmartFolder = replaceIdsWithNamesInSmartFolder;
|
|
217
|
-
const deleteExpressionWithNotFoundFieldsOrTypesInSmartFolder = (schema, smartFolder) => visitSmartFolder(smartFolder, {
|
|
218
|
-
visitQueryExpression: (query) => (0, utils_1.deleteExpressionWithNotFoundFieldsOrTypesInQueryExpression)(schema, query),
|
|
219
|
-
visitGroupByExpression: (groupBy, fromType, removedItems) => (0, exports.deleteExpressionWithNotFoundFieldsOrTypesInGroupByExpression)(schema, groupBy, fromType, removedItems),
|
|
220
|
-
visitFilter: (fromType, expression) => (0, utils_1.deleteExpressionWithNotFoundFieldsOrTypesInFilter)(schema, fromType, expression),
|
|
221
|
-
visitExpression: (fromType, expression) => (0, utils_1.deleteExpressionWithNotFoundFieldsOrTypesInExpression)(schema, fromType, expression),
|
|
222
|
-
});
|
|
223
|
-
exports.deleteExpressionWithNotFoundFieldsOrTypesInSmartFolder = deleteExpressionWithNotFoundFieldsOrTypesInSmartFolder;
|
|
224
|
-
const fixContextExpressionWithBrokenPath = (schema, view, defaultContextExpression) => visitSmartFolder(view, {
|
|
225
|
-
visitQueryExpression: (query) => query,
|
|
226
|
-
visitGroupByExpression: (groupBy) => groupBy,
|
|
227
|
-
visitExpression: (_fromType, expression) => expression,
|
|
228
|
-
visitFilter: (_fromType, filter) => filter,
|
|
229
|
-
visitContextExpression: (fromType, expression) => (0, utils_1.resetContextExpressionIfBroken)(schema, fromType, expression, defaultContextExpression),
|
|
230
|
-
});
|
|
231
|
-
exports.fixContextExpressionWithBrokenPath = fixContextExpressionWithBrokenPath;
|
|
232
|
-
const fixUserSelectedUnitsInSmartFolder = (schema, view, { unitDefinitions, getDefaultUnitTypeForField, }) => {
|
|
233
|
-
return visitSmartFolder(view, {
|
|
234
|
-
visitQueryExpression: (query) => query,
|
|
235
|
-
visitGroupByExpression: (groupBy) => groupBy,
|
|
236
|
-
visitFilter: (_fromType, filter) => filter,
|
|
237
|
-
visitExpression: (_fromType, expression) => expression,
|
|
238
|
-
visitViewUnit: (fromType, unit, units) => {
|
|
239
|
-
if (unit.kind !== "user-button") {
|
|
240
|
-
// Migration: "rich-text" is a legacy unit type not in the current type system
|
|
241
|
-
if (unit.type === "rich-text" && view?.["fibery/type"] === "grid") {
|
|
242
|
-
if (unit.checked) {
|
|
243
|
-
const snippetsUnits = units.filter((x) => x.kind === "field" && x.type === "rich-text-snippet");
|
|
244
|
-
const snippetUnitForField = snippetsUnits.find((x) => (0, isEqual_1.default)(x.expression, unit.expression));
|
|
245
|
-
if (snippetUnitForField && !snippetUnitForField.checked) {
|
|
246
|
-
snippetUnitForField.checked = true;
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
return utils_1.REMOVE;
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
return (0, units_1.fixViewUnit)(schema, fromType, unit, units, { unitDefinitions, getDefaultUnitTypeForField });
|
|
253
|
-
},
|
|
254
|
-
});
|
|
255
|
-
};
|
|
256
|
-
exports.fixUserSelectedUnitsInSmartFolder = fixUserSelectedUnitsInSmartFolder;
|
|
257
|
-
const collectGarbage = (view) => {
|
|
258
|
-
return visitSmartFolder(view, {
|
|
259
|
-
visitQueryExpression: (query) => query,
|
|
260
|
-
visitFilter: (_fromType, filter) => filter,
|
|
261
|
-
visitGroupByExpression: (groupBy) => groupBy,
|
|
262
|
-
visitExpression: (_fromType, expression) => expression,
|
|
263
|
-
visitViewUnit: (_fromType, unit) => (unit.checked ? unit : utils_1.REMOVE),
|
|
264
|
-
});
|
|
265
|
-
};
|
|
266
|
-
exports.collectGarbage = collectGarbage;
|
|
267
|
-
const enableHideWhenEmptyForCheckedUnits = (view) => {
|
|
268
|
-
return visitSmartFolder(view, {
|
|
269
|
-
visitQueryExpression: (queryExpression) => queryExpression,
|
|
270
|
-
visitGroupByExpression: (groupBy) => groupBy,
|
|
271
|
-
visitExpression: (_fromType, expression) => expression,
|
|
272
|
-
visitFilter: (_fromType, filter) => filter,
|
|
273
|
-
visitEnums: (enums) => enums,
|
|
274
|
-
visitViewUnit: (_fromType, unit) => (0, units_1.enableHideWhenEmptyForCheckedEditableUnit)(unit),
|
|
275
|
-
});
|
|
276
|
-
};
|
|
277
|
-
exports.enableHideWhenEmptyForCheckedUnits = enableHideWhenEmptyForCheckedUnits;
|