@webiny/app-admin 6.3.0 → 6.4.0-beta.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/assets/icons/add-18px.js +20 -0
- package/assets/icons/add-18px.js.map +1 -0
- package/assets/icons/arrow_drop_down-24px.js +20 -0
- package/assets/icons/arrow_drop_down-24px.js.map +1 -0
- package/assets/icons/attach_file_black_24dp.js +20 -0
- package/assets/icons/attach_file_black_24dp.js.map +1 -0
- package/assets/icons/baseline-menu-24px.js +20 -0
- package/assets/icons/baseline-menu-24px.js.map +1 -0
- package/assets/icons/baseline-notification_important-24px.js +19 -0
- package/assets/icons/baseline-notification_important-24px.js.map +1 -0
- package/assets/icons/baseline-security-24px.js +19 -0
- package/assets/icons/baseline-security-24px.js.map +1 -0
- package/assets/icons/file_download.js +19 -0
- package/assets/icons/file_download.js.map +1 -0
- package/assets/icons/file_upload.js +19 -0
- package/assets/icons/file_upload.js.map +1 -0
- package/assets/icons/filter-24px.js +23 -0
- package/assets/icons/filter-24px.js.map +1 -0
- package/assets/icons/github-brands.js +19 -0
- package/assets/icons/github-brands.js.map +1 -0
- package/assets/icons/highlight-24px.js +19 -0
- package/assets/icons/highlight-24px.js.map +1 -0
- package/assets/icons/icon-community.js +18 -0
- package/assets/icons/icon-community.js.map +1 -0
- package/assets/icons/icon-documentation.js +18 -0
- package/assets/icons/icon-documentation.js.map +1 -0
- package/assets/icons/info.js +19 -0
- package/assets/icons/info.js.map +1 -0
- package/assets/icons/insert_drive_file-24px.js +19 -0
- package/assets/icons/insert_drive_file-24px.js.map +1 -0
- package/assets/icons/insert_photo-24px.js +19 -0
- package/assets/icons/insert_photo-24px.js.map +1 -0
- package/assets/icons/label-24px.js +19 -0
- package/assets/icons/label-24px.js.map +1 -0
- package/assets/icons/round-account_circle-24px.js +19 -0
- package/assets/icons/round-account_circle-24px.js.map +1 -0
- package/assets/icons/round-add-24px.js +20 -0
- package/assets/icons/round-add-24px.js.map +1 -0
- package/assets/icons/round-arrow_drop_down-24px.js +19 -0
- package/assets/icons/round-arrow_drop_down-24px.js.map +1 -0
- package/assets/icons/round-chevron_right-24px.js +20 -0
- package/assets/icons/round-chevron_right-24px.js.map +1 -0
- package/assets/icons/round-feedback-24px.js +20 -0
- package/assets/icons/round-feedback-24px.js.map +1 -0
- package/assets/icons/round-help-24px.js +19 -0
- package/assets/icons/round-help-24px.js.map +1 -0
- package/assets/icons/round-invert_colors-24px.js +20 -0
- package/assets/icons/round-invert_colors-24px.js.map +1 -0
- package/assets/icons/round-keyboard_arrow_down-24px.js +17 -0
- package/assets/icons/round-keyboard_arrow_down-24px.js.map +1 -0
- package/assets/icons/round-keyboard_arrow_up-24px.js +17 -0
- package/assets/icons/round-keyboard_arrow_up-24px.js.map +1 -0
- package/assets/icons/round-lock_open-24px.js +22 -0
- package/assets/icons/round-lock_open-24px.js.map +1 -0
- package/assets/icons/round-more_vert-24px.js +20 -0
- package/assets/icons/round-more_vert-24px.js.map +1 -0
- package/assets/icons/round-open_in_new-24px.js +20 -0
- package/assets/icons/round-open_in_new-24px.js.map +1 -0
- package/assets/icons/round-settings-24px.js +20 -0
- package/assets/icons/round-settings-24px.js.map +1 -0
- package/assets/icons/search-24px.js +21 -0
- package/assets/icons/search-24px.js.map +1 -0
- package/assets/icons/slack-logo.js +14 -0
- package/assets/icons/slack-logo.js.map +1 -0
- package/assets/icons/today-24px.js +19 -0
- package/assets/icons/today-24px.js.map +1 -0
- package/assets/icons/touch_app.js +20 -0
- package/assets/icons/touch_app.js.map +1 -0
- package/assets/images/webiny-logo.js +34 -0
- package/assets/images/webiny-logo.js.map +1 -0
- package/assets/images/webiny-orange-logo.js +34 -0
- package/assets/images/webiny-orange-logo.js.map +1 -0
- package/base/Admin.js +37 -28
- package/base/Admin.js.map +1 -1
- package/base/Base/DefaultFieldRenderers.js +73 -70
- package/base/Base/DefaultFieldRenderers.js.map +1 -1
- package/base/Base/DefaultLayoutRenderers.js +9 -10
- package/base/Base/DefaultLayoutRenderers.js.map +1 -1
- package/base/Base/FieldRenderers/CheckboxesRenderer.js +22 -23
- package/base/Base/FieldRenderers/CheckboxesRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/CodeEditorRenderer.js +10 -13
- package/base/Base/FieldRenderers/CodeEditorRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/DateTimeInputsRenderer.js +60 -60
- package/base/Base/FieldRenderers/DateTimeInputsRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/DateTimeRenderer.js +38 -39
- package/base/Base/FieldRenderers/DateTimeRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/FilePickerRenderer.d.ts +2 -1
- package/base/Base/FieldRenderers/FilePickerRenderer.js +37 -40
- package/base/Base/FieldRenderers/FilePickerRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/FileUrlPickerRenderer.js +15 -20
- package/base/Base/FieldRenderers/FileUrlPickerRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/HiddenRenderer.js +3 -3
- package/base/Base/FieldRenderers/HiddenRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/HorizontalTabsRenderer.js +20 -21
- package/base/Base/FieldRenderers/HorizontalTabsRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/InputRenderer.js +16 -20
- package/base/Base/FieldRenderers/InputRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/MultiFilePickerRenderer.d.ts +13 -0
- package/base/Base/FieldRenderers/MultiFilePickerRenderer.js +70 -0
- package/base/Base/FieldRenderers/MultiFilePickerRenderer.js.map +1 -0
- package/base/Base/FieldRenderers/NumberInputRenderer.js +16 -19
- package/base/Base/FieldRenderers/NumberInputRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/NumberInputsRenderer.js +45 -44
- package/base/Base/FieldRenderers/NumberInputsRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/DynamicZoneRenderer.js +10 -13
- package/base/Base/FieldRenderers/ObjectRenderer/DynamicZoneRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/KeyValueTagsRenderer.js +50 -56
- package/base/Base/FieldRenderers/ObjectRenderer/KeyValueTagsRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/MultiValueDynamicZone.js +87 -99
- package/base/Base/FieldRenderers/ObjectRenderer/MultiValueDynamicZone.js.map +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/ObjectAccordionMultipleRenderer.js +41 -48
- package/base/Base/FieldRenderers/ObjectRenderer/ObjectAccordionMultipleRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/ObjectFieldComponents.d.ts +1 -2
- package/base/Base/FieldRenderers/ObjectRenderer/ObjectFieldComponents.js +62 -78
- package/base/Base/FieldRenderers/ObjectRenderer/ObjectFieldComponents.js.map +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/ObjectRenderer.js +12 -15
- package/base/Base/FieldRenderers/ObjectRenderer/ObjectRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/SingleValueDynamicZone.js +48 -54
- package/base/Base/FieldRenderers/ObjectRenderer/SingleValueDynamicZone.js.map +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker.js +62 -79
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker.js.map +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/resolveItemTitle.js +14 -17
- package/base/Base/FieldRenderers/ObjectRenderer/resolveItemTitle.js.map +1 -1
- package/base/Base/FieldRenderers/PassthroughRenderer.js +8 -11
- package/base/Base/FieldRenderers/PassthroughRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/RadioButtonsRenderer.js +21 -22
- package/base/Base/FieldRenderers/RadioButtonsRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/SelectRenderer.js +23 -24
- package/base/Base/FieldRenderers/SelectRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/SwitchRenderer.js +12 -15
- package/base/Base/FieldRenderers/SwitchRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/TagsRenderer.js +15 -16
- package/base/Base/FieldRenderers/TagsRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/TextInputsRenderer.js +44 -43
- package/base/Base/FieldRenderers/TextInputsRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/TextareaRenderer.js +17 -21
- package/base/Base/FieldRenderers/TextareaRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/TextareasRenderer.js +47 -46
- package/base/Base/FieldRenderers/TextareasRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/VerticalTabsRenderer.js +35 -36
- package/base/Base/FieldRenderers/VerticalTabsRenderer.js.map +1 -1
- package/base/Base/LexicalPreset.js +56 -60
- package/base/Base/LexicalPreset.js.map +1 -1
- package/base/Base/Menus/SupportMenuItems.js +9 -13
- package/base/Base/Menus/SupportMenuItems.js.map +1 -1
- package/base/Base/Menus/WebinyVersion.js +19 -20
- package/base/Base/Menus/WebinyVersion.js.map +1 -1
- package/base/Base/Menus.js +52 -66
- package/base/Base/Menus.js.map +1 -1
- package/base/Base/RoutesConfig.js +21 -29
- package/base/Base/RoutesConfig.js.map +1 -1
- package/base/Base/Tenant/wby-horizontal.js +33 -0
- package/base/Base/Tenant/wby-horizontal.js.map +1 -0
- package/base/Base/Tenant/wby-square.js +20 -0
- package/base/Base/Tenant/wby-square.js.map +1 -0
- package/base/Base/Tenant.js +17 -19
- package/base/Base/Tenant.js.map +1 -1
- package/base/Base/UserMenu/ExitTenant.js +18 -29
- package/base/Base/UserMenu/ExitTenant.js.map +1 -1
- package/base/Base/UserMenu/SignOut.js +13 -14
- package/base/Base/UserMenu/SignOut.js.map +1 -1
- package/base/Base/UserMenu/UserInfo.js +23 -36
- package/base/Base/UserMenu/UserInfo.js.map +1 -1
- package/base/Base/UserMenu.js +12 -13
- package/base/Base/UserMenu.js.map +1 -1
- package/base/Base.js +4 -5
- package/base/Base.js.map +1 -1
- package/base/TelemetryAdminAppStart.js +9 -12
- package/base/TelemetryAdminAppStart.js.map +1 -1
- package/base/WebinyVersion.js +19 -20
- package/base/WebinyVersion.js.map +1 -1
- package/base/createRootContainer.js +42 -40
- package/base/createRootContainer.js.map +1 -1
- package/base/plugins/AddGraphQLQuerySelection.js +12 -11
- package/base/plugins/AddGraphQLQuerySelection.js.map +1 -1
- package/base/providers/AdminUiStateProvider.js +5 -10
- package/base/providers/AdminUiStateProvider.js.map +1 -1
- package/base/providers/ApolloProvider.js +8 -11
- package/base/providers/ApolloProvider.js.map +1 -1
- package/base/providers/UiProviders.js +18 -27
- package/base/providers/UiProviders.js.map +1 -1
- package/base/providers/UiStateProvider.js +5 -10
- package/base/providers/UiStateProvider.js.map +1 -1
- package/base/ui/Brand.js +4 -5
- package/base/ui/Brand.js.map +1 -1
- package/base/ui/CenteredView.d.ts +1 -1
- package/base/ui/CenteredView.js +9 -13
- package/base/ui/CenteredView.js.map +1 -1
- package/base/ui/Dashboard.js +4 -5
- package/base/ui/Dashboard.js.map +1 -1
- package/base/ui/FileManager.js +38 -60
- package/base/ui/FileManager.js.map +1 -1
- package/base/ui/Layout.js +4 -8
- package/base/ui/Layout.js.map +1 -1
- package/base/ui/LoginScreen.js +16 -21
- package/base/ui/LoginScreen.js.map +1 -1
- package/base/ui/Logo.js +4 -5
- package/base/ui/Logo.js.map +1 -1
- package/base/ui/Navigation.js +11 -14
- package/base/ui/Navigation.js.map +1 -1
- package/base/ui/NotFound.js +4 -5
- package/base/ui/NotFound.js.map +1 -1
- package/base/ui/Tags.js +12 -16
- package/base/ui/Tags.js.map +1 -1
- package/base/ui/TenantSelector.js +4 -5
- package/base/ui/TenantSelector.js.map +1 -1
- package/base/ui/UserMenu/UserMenu.js +4 -5
- package/base/ui/UserMenu/UserMenu.js.map +1 -1
- package/base/ui/UserMenu/UserMenuHandle.js +4 -5
- package/base/ui/UserMenu/UserMenuHandle.js.map +1 -1
- package/base/ui/UserMenu/UserMenuItem.d.ts +4 -4
- package/base/ui/UserMenu/UserMenuItem.js +5 -15
- package/base/ui/UserMenu/UserMenuItem.js.map +1 -1
- package/base/ui/UserMenu/UserMenuLink.d.ts +4 -4
- package/base/ui/UserMenu/UserMenuLink.js +5 -15
- package/base/ui/UserMenu/UserMenuLink.js.map +1 -1
- package/base/ui/UserMenu/UserMenuSeparator.d.ts +2 -2
- package/base/ui/UserMenu/UserMenuSeparator.js +3 -5
- package/base/ui/UserMenu/UserMenuSeparator.js.map +1 -1
- package/base/ui/UserMenu.js +6 -13
- package/base/ui/UserMenu.js.map +1 -1
- package/components/AdminLayout.js +6 -10
- package/components/AdminLayout.js.map +1 -1
- package/components/BulkActions/Worker.js +57 -120
- package/components/BulkActions/Worker.js.map +1 -1
- package/components/BulkActions/index.js +0 -2
- package/components/BulkActions/useDialogWithReport/DialogMessage.js +17 -21
- package/components/BulkActions/useDialogWithReport/DialogMessage.js.map +1 -1
- package/components/BulkActions/useDialogWithReport/index.js +0 -2
- package/components/BulkActions/useDialogWithReport/useDialogWithReport.js +33 -44
- package/components/BulkActions/useDialogWithReport/useDialogWithReport.js.map +1 -1
- package/components/Buttons/Buttons.js +44 -71
- package/components/Buttons/Buttons.js.map +1 -1
- package/components/Buttons/Buttons.styles.js +9 -15
- package/components/Buttons/Buttons.styles.js.map +1 -1
- package/components/Buttons/index.js +1 -3
- package/components/Buttons/useButtons.js +15 -20
- package/components/Buttons/useButtons.js.map +1 -1
- package/components/DeveloperMode/DeveloperMode.js +5 -14
- package/components/DeveloperMode/DeveloperMode.js.map +1 -1
- package/components/DeveloperMode/index.js +0 -2
- package/components/Dialogs/Dialog.d.ts +2 -2
- package/components/Dialogs/Dialog.js +46 -59
- package/components/Dialogs/Dialog.js.map +1 -1
- package/components/Dialogs/DialogParamsContext.js +6 -7
- package/components/Dialogs/DialogParamsContext.js.map +1 -1
- package/components/Dialogs/DialogsContext.d.ts +2 -2
- package/components/Dialogs/DialogsContext.js +129 -149
- package/components/Dialogs/DialogsContext.js.map +1 -1
- package/components/Dialogs/useDialogs.js +5 -6
- package/components/Dialogs/useDialogs.js.map +1 -1
- package/components/EmptyView.js +26 -31
- package/components/EmptyView.js.map +1 -1
- package/components/Filters/Filters.js +15 -16
- package/components/Filters/Filters.js.map +1 -1
- package/components/Filters/FiltersToggle.js +18 -23
- package/components/Filters/FiltersToggle.js.map +1 -1
- package/components/Filters/index.js +0 -2
- package/components/FloatingActionButton.js +13 -15
- package/components/FloatingActionButton.js.map +1 -1
- package/components/IconPicker/IconPicker.js +24 -26
- package/components/IconPicker/IconPicker.js.map +1 -1
- package/components/IconPicker/IconPickerComponent.js +56 -72
- package/components/IconPicker/IconPickerComponent.js.map +1 -1
- package/components/IconPicker/IconPickerPresenter.js +64 -70
- package/components/IconPicker/IconPickerPresenter.js.map +1 -1
- package/components/IconPicker/IconPickerPresenter.test.js +79 -105
- package/components/IconPicker/IconPickerPresenter.test.js.map +1 -1
- package/components/IconPicker/IconPickerPresenterProvider.js +10 -16
- package/components/IconPicker/IconPickerPresenterProvider.js.map +1 -1
- package/components/IconPicker/IconPickerTab.js +97 -140
- package/components/IconPicker/IconPickerTab.js.map +1 -1
- package/components/IconPicker/IconRenderer.js +15 -23
- package/components/IconPicker/IconRenderer.js.map +1 -1
- package/components/IconPicker/IconRepository.js +41 -40
- package/components/IconPicker/IconRepository.js.map +1 -1
- package/components/IconPicker/IconRepository.test.js +56 -63
- package/components/IconPicker/IconRepository.test.js.map +1 -1
- package/components/IconPicker/IconRepositoryFactory.js +15 -11
- package/components/IconPicker/IconRepositoryFactory.js.map +1 -1
- package/components/IconPicker/Loading.js +47 -46
- package/components/IconPicker/Loading.js.map +1 -1
- package/components/IconPicker/components/IconPickerCell.js +18 -20
- package/components/IconPicker/components/IconPickerCell.js.map +1 -1
- package/components/IconPicker/components/IconPickerContent.js +27 -35
- package/components/IconPicker/components/IconPickerContent.js.map +1 -1
- package/components/IconPicker/components/IconPickerRow.js +5 -10
- package/components/IconPicker/components/IconPickerRow.js.map +1 -1
- package/components/IconPicker/components/IconPickerTrigger.js +42 -44
- package/components/IconPicker/components/IconPickerTrigger.js.map +1 -1
- package/components/IconPicker/components/index.js +0 -2
- package/components/IconPicker/config/Emojis.js +19 -21
- package/components/IconPicker/config/Emojis.js.map +1 -1
- package/components/IconPicker/config/FontAwesomeIcons.js +54 -58
- package/components/IconPicker/config/FontAwesomeIcons.js.map +1 -1
- package/components/IconPicker/config/IconPackProvider.js +17 -19
- package/components/IconPicker/config/IconPackProvider.js.map +1 -1
- package/components/IconPicker/config/IconType.js +48 -80
- package/components/IconPicker/config/IconType.js.map +1 -1
- package/components/IconPicker/config/index.js +28 -31
- package/components/IconPicker/config/index.js.map +1 -1
- package/components/IconPicker/defaultIcon.js +6 -5
- package/components/IconPicker/defaultIcon.js.map +1 -1
- package/components/IconPicker/index.js +0 -2
- package/components/IconPicker/plugins/customPlugin.js +87 -110
- package/components/IconPicker/plugins/customPlugin.js.map +1 -1
- package/components/IconPicker/plugins/emojisPlugin.js +90 -115
- package/components/IconPicker/plugins/emojisPlugin.js.map +1 -1
- package/components/IconPicker/plugins/graphql.js +3 -8
- package/components/IconPicker/plugins/graphql.js.map +1 -1
- package/components/IconPicker/plugins/iconsPlugin.js +73 -104
- package/components/IconPicker/plugins/iconsPlugin.js.map +1 -1
- package/components/IconPicker/types.js +4 -7
- package/components/IconPicker/types.js.map +1 -1
- package/components/LexicalEditor/LexicalEditor.js +40 -38
- package/components/LexicalEditor/LexicalEditor.js.map +1 -1
- package/components/LexicalEditor/LexicalLinkForm.js +80 -86
- package/components/LexicalEditor/LexicalLinkForm.js.map +1 -1
- package/components/LexicalEditor/index.js +0 -2
- package/components/LexicalEditor/lexicalValueFromHtml.js +21 -28
- package/components/LexicalEditor/lexicalValueFromHtml.js.map +1 -1
- package/components/LexicalEditor/lexicalValueWithHtml.js +24 -30
- package/components/LexicalEditor/lexicalValueWithHtml.js.map +1 -1
- package/components/MultiImageUpload.js +4 -13
- package/components/MultiImageUpload.js.map +1 -1
- package/components/NotAuthorizedError/NotAuthorizedError.js +16 -17
- package/components/NotAuthorizedError/NotAuthorizedError.js.map +1 -1
- package/components/NotAuthorizedError/SecureRouteError.js +297 -0
- package/components/NotAuthorizedError/SecureRouteError.js.map +1 -0
- package/components/NotAuthorizedError/index.js +0 -2
- package/components/OptionsMenu/OptionsMenu.js +20 -19
- package/components/OptionsMenu/OptionsMenu.js.map +1 -1
- package/components/OptionsMenu/OptionsMenuItem.js +15 -14
- package/components/OptionsMenu/OptionsMenuItem.js.map +1 -1
- package/components/OptionsMenu/OptionsMenuLink.js +13 -14
- package/components/OptionsMenu/OptionsMenuLink.js.map +1 -1
- package/components/OptionsMenu/index.js +0 -2
- package/components/OptionsMenu/useOptionsMenuItem.js +13 -18
- package/components/OptionsMenu/useOptionsMenuItem.js.map +1 -1
- package/components/OverlayLayout/OverlayLayout.js +35 -38
- package/components/OverlayLayout/OverlayLayout.js.map +1 -1
- package/components/OverlayLayout/components/OverlayBackdrop.js +6 -11
- package/components/OverlayLayout/components/OverlayBackdrop.js.map +1 -1
- package/components/OverlayLayout/components/OverlayContent.js +18 -17
- package/components/OverlayLayout/components/OverlayContent.js.map +1 -1
- package/components/OverlayLayout/components/OverlayHeader.js +30 -37
- package/components/OverlayLayout/components/OverlayHeader.js.map +1 -1
- package/components/OverlayLayout/components/OverlayRoot.js +13 -17
- package/components/OverlayLayout/components/OverlayRoot.js.map +1 -1
- package/components/OverlayLayout/components/index.js +0 -2
- package/components/OverlayLayout/index.js +0 -2
- package/components/Permissions/CannotUseAaclAlert.js +10 -11
- package/components/Permissions/CannotUseAaclAlert.js.map +1 -1
- package/components/Permissions/Permissions.js +32 -41
- package/components/Permissions/Permissions.js.map +1 -1
- package/components/Permissions/PermissionsGroup.js +9 -15
- package/components/Permissions/PermissionsGroup.js.map +1 -1
- package/components/Permissions/StyledComponents.js +9 -16
- package/components/Permissions/StyledComponents.js.map +1 -1
- package/components/Permissions/index.js +1 -3
- package/components/RegisterFeature.js +14 -21
- package/components/RegisterFeature.js.map +1 -1
- package/components/ResizablePanels/index.js +0 -2
- package/components/RoleAutocomplete/graphql.js +3 -2
- package/components/RoleAutocomplete/graphql.js.map +1 -1
- package/components/RoleAutocomplete/index.d.ts +5 -3
- package/components/RoleAutocomplete/index.js +21 -13
- package/components/RoleAutocomplete/index.js.map +1 -1
- package/components/RolesMultiAutocomplete/graphql.js +3 -2
- package/components/RolesMultiAutocomplete/graphql.js.map +1 -1
- package/components/RolesMultiAutocomplete/index.d.ts +5 -3
- package/components/RolesMultiAutocomplete/index.js +21 -14
- package/components/RolesMultiAutocomplete/index.js.map +1 -1
- package/components/SearchUI.js +18 -25
- package/components/SearchUI.js.map +1 -1
- package/components/SimpleForm/SimpleForm.d.ts +1 -1
- package/components/SimpleForm/SimpleForm.js +54 -73
- package/components/SimpleForm/SimpleForm.js.map +1 -1
- package/components/SimpleForm/index.js +1 -3
- package/components/SimpleUI/InputField.js +71 -64
- package/components/SimpleUI/InputField.js.map +1 -1
- package/components/SingleImageUpload.d.ts +2 -2
- package/components/SingleImageUpload.js +37 -58
- package/components/SingleImageUpload.js.map +1 -1
- package/components/SplitView/SplitView.js +47 -57
- package/components/SplitView/SplitView.js.map +1 -1
- package/components/SplitView/index.js +1 -3
- package/components/TeamAutocomplete/graphql.js +3 -2
- package/components/TeamAutocomplete/graphql.js.map +1 -1
- package/components/TeamAutocomplete/index.d.ts +5 -3
- package/components/TeamAutocomplete/index.js +21 -13
- package/components/TeamAutocomplete/index.js.map +1 -1
- package/components/TeamsMultiAutocomplete/graphql.js +3 -2
- package/components/TeamsMultiAutocomplete/graphql.js.map +1 -1
- package/components/TeamsMultiAutocomplete/index.d.ts +5 -3
- package/components/TeamsMultiAutocomplete/index.js +21 -14
- package/components/TeamsMultiAutocomplete/index.js.map +1 -1
- package/components/Wcp.js +27 -38
- package/components/Wcp.js.map +1 -1
- package/components/index.js +10 -13
- package/config/AdminConfig/Dashboard.js +3 -2
- package/config/AdminConfig/Dashboard.js.map +1 -1
- package/config/AdminConfig/Dialog.js +15 -17
- package/config/AdminConfig/Dialog.js.map +1 -1
- package/config/AdminConfig/FieldRenderer.js +15 -17
- package/config/AdminConfig/FieldRenderer.js.map +1 -1
- package/config/AdminConfig/Form.js +4 -3
- package/config/AdminConfig/Form.js.map +1 -1
- package/config/AdminConfig/LayoutRenderer.js +15 -17
- package/config/AdminConfig/LayoutRenderer.js.map +1 -1
- package/config/AdminConfig/LexicalTheme/Color.js +34 -41
- package/config/AdminConfig/LexicalTheme/Color.js.map +1 -1
- package/config/AdminConfig/LexicalTheme/Typography.js +61 -74
- package/config/AdminConfig/LexicalTheme/Typography.js.map +1 -1
- package/config/AdminConfig/LexicalTheme.js +4 -3
- package/config/AdminConfig/LexicalTheme.js.map +1 -1
- package/config/AdminConfig/Logo.d.ts +1 -1
- package/config/AdminConfig/Logo.js +15 -17
- package/config/AdminConfig/Logo.js.map +1 -1
- package/config/AdminConfig/Menu/MenuGroup.d.ts +3 -3
- package/config/AdminConfig/Menu/MenuGroup.js +7 -9
- package/config/AdminConfig/Menu/MenuGroup.js.map +1 -1
- package/config/AdminConfig/Menu/MenuItem.d.ts +2 -2
- package/config/AdminConfig/Menu/MenuItem.js +5 -7
- package/config/AdminConfig/Menu/MenuItem.js.map +1 -1
- package/config/AdminConfig/Menu/MenuLink.d.ts +2 -2
- package/config/AdminConfig/Menu/MenuLink.js +12 -15
- package/config/AdminConfig/Menu/MenuLink.js.map +1 -1
- package/config/AdminConfig/Menu/SupportMenu/SupportMenuItem.d.ts +2 -2
- package/config/AdminConfig/Menu/SupportMenu/SupportMenuItem.js +6 -8
- package/config/AdminConfig/Menu/SupportMenu/SupportMenuItem.js.map +1 -1
- package/config/AdminConfig/Menu/SupportMenu/SupportMenuLink.d.ts +1 -1
- package/config/AdminConfig/Menu/SupportMenu/SupportMenuLink.js +4 -6
- package/config/AdminConfig/Menu/SupportMenu/SupportMenuLink.js.map +1 -1
- package/config/AdminConfig/Menu/SupportMenu.d.ts +3 -3
- package/config/AdminConfig/Menu/SupportMenu.js +30 -41
- package/config/AdminConfig/Menu/SupportMenu.js.map +1 -1
- package/config/AdminConfig/Menu/UserMenu/UserMenuItem.js +4 -4
- package/config/AdminConfig/Menu/UserMenu/UserMenuItem.js.map +1 -1
- package/config/AdminConfig/Menu/UserMenu/UserMenuLink.js +4 -4
- package/config/AdminConfig/Menu/UserMenu/UserMenuLink.js.map +1 -1
- package/config/AdminConfig/Menu/UserMenu/UserMenuSeparator.js +0 -2
- package/config/AdminConfig/Menu/UserMenu/types.js +0 -3
- package/config/AdminConfig/Menu/UserMenu.d.ts +31 -31
- package/config/AdminConfig/Menu/UserMenu.js +39 -52
- package/config/AdminConfig/Menu/UserMenu.js.map +1 -1
- package/config/AdminConfig/Menu/types.js +0 -3
- package/config/AdminConfig/Menu.d.ts +42 -42
- package/config/AdminConfig/Menu.js +57 -73
- package/config/AdminConfig/Menu.js.map +1 -1
- package/config/AdminConfig/Route.js +4 -5
- package/config/AdminConfig/Route.js.map +1 -1
- package/config/AdminConfig/Security.js +3 -2
- package/config/AdminConfig/Security.js.map +1 -1
- package/config/AdminConfig/SecurityPermissions.js +20 -27
- package/config/AdminConfig/SecurityPermissions.js.map +1 -1
- package/config/AdminConfig/Tenant/TenantLogo.d.ts +1 -1
- package/config/AdminConfig/Tenant/TenantLogo.js +18 -20
- package/config/AdminConfig/Tenant/TenantLogo.js.map +1 -1
- package/config/AdminConfig/Tenant/TenantName.d.ts +1 -1
- package/config/AdminConfig/Tenant/TenantName.js +14 -15
- package/config/AdminConfig/Tenant/TenantName.js.map +1 -1
- package/config/AdminConfig/Tenant.js +6 -9
- package/config/AdminConfig/Tenant.js.map +1 -1
- package/config/AdminConfig/Theme/assignColor.js +51 -18
- package/config/AdminConfig/Theme/assignColor.js.map +1 -1
- package/config/AdminConfig/Theme/consts.js +20 -2
- package/config/AdminConfig/Theme/consts.js.map +1 -1
- package/config/AdminConfig/Theme/types.js +0 -3
- package/config/AdminConfig/Theme.js +8 -15
- package/config/AdminConfig/Theme.js.map +1 -1
- package/config/AdminConfig/Title.d.ts +1 -1
- package/config/AdminConfig/Title.js +11 -12
- package/config/AdminConfig/Title.js.map +1 -1
- package/config/AdminConfig/Widget.js +24 -31
- package/config/AdminConfig/Widget.js.map +1 -1
- package/config/AdminConfig.js +47 -59
- package/config/AdminConfig.js.map +1 -1
- package/config/createAdminConfig.js +55 -86
- package/config/createAdminConfig.js.map +1 -1
- package/domain/Identity.js +78 -88
- package/domain/Identity.js.map +1 -1
- package/errors/ErrorOverlayNetworkErrorHandler.js +37 -52
- package/errors/ErrorOverlayNetworkErrorHandler.js.map +1 -1
- package/errors/TenantIsDisabled.js +19 -20
- package/errors/TenantIsDisabled.js.map +1 -1
- package/exports/admin/build-params.js +0 -5
- package/exports/admin/configs.js +0 -2
- package/exports/admin/form.js +3 -18
- package/exports/admin/security.js +1 -7
- package/exports/admin/tenancy.js +0 -2
- package/exports/admin/ui.js +1 -4
- package/exports/admin.js +1 -4
- package/features/apolloClient/abstraction.js +2 -1
- package/features/apolloClient/abstraction.js.map +1 -1
- package/features/apolloClient/feature.js +22 -30
- package/features/apolloClient/feature.js.map +1 -1
- package/features/buildParams/BuildParams.js +20 -14
- package/features/buildParams/BuildParams.js.map +1 -1
- package/features/buildParams/abstractions.js +3 -2
- package/features/buildParams/abstractions.js.map +1 -1
- package/features/buildParams/feature.js +11 -10
- package/features/buildParams/feature.js.map +1 -1
- package/features/buildParams/index.js +0 -2
- package/features/formModel/ConditionRuleEvaluator.js +39 -46
- package/features/formModel/ConditionRuleEvaluator.js.map +1 -1
- package/features/formModel/Field.d.ts +1 -0
- package/features/formModel/Field.js +334 -411
- package/features/formModel/Field.js.map +1 -1
- package/features/formModel/FieldBuilder.d.ts +2 -1
- package/features/formModel/FieldBuilder.js +148 -171
- package/features/formModel/FieldBuilder.js.map +1 -1
- package/features/formModel/FieldBuilder.test.js +217 -201
- package/features/formModel/FieldBuilder.test.js.map +1 -1
- package/features/formModel/FieldBuilderRegistry.js +23 -25
- package/features/formModel/FieldBuilderRegistry.js.map +1 -1
- package/features/formModel/FocusManager.js +69 -95
- package/features/formModel/FocusManager.js.map +1 -1
- package/features/formModel/FormErrors.d.ts +9 -0
- package/features/formModel/FormErrors.js +35 -0
- package/features/formModel/FormErrors.js.map +1 -0
- package/features/formModel/FormModel.d.ts +2 -0
- package/features/formModel/FormModel.js +391 -396
- package/features/formModel/FormModel.js.map +1 -1
- package/features/formModel/FormModel.test.js +3791 -3354
- package/features/formModel/FormModel.test.js.map +1 -1
- package/features/formModel/FormModelFactory.js +27 -17
- package/features/formModel/FormModelFactory.js.map +1 -1
- package/features/formModel/FormView.d.ts +2 -1
- package/features/formModel/FormView.js +168 -156
- package/features/formModel/FormView.js.map +1 -1
- package/features/formModel/LayoutBuilderFactory.js +300 -370
- package/features/formModel/LayoutBuilderFactory.js.map +1 -1
- package/features/formModel/LayoutMutator.js +118 -125
- package/features/formModel/LayoutMutator.js.map +1 -1
- package/features/formModel/LayoutResolver.js +174 -214
- package/features/formModel/LayoutResolver.js.map +1 -1
- package/features/formModel/ObjectField.js +524 -724
- package/features/formModel/ObjectField.js.map +1 -1
- package/features/formModel/PresenterErrors.d.ts +9 -0
- package/features/formModel/PresenterErrors.js +32 -0
- package/features/formModel/PresenterErrors.js.map +1 -0
- package/features/formModel/Rules.test.js +311 -276
- package/features/formModel/Rules.test.js.map +1 -1
- package/features/formModel/abstractions.d.ts +10 -0
- package/features/formModel/abstractions.js +5 -114
- package/features/formModel/abstractions.js.map +1 -1
- package/features/formModel/createFieldRenderer.js +33 -10
- package/features/formModel/createFieldRenderer.js.map +1 -1
- package/features/formModel/demo/FieldRenderersDemoPresenter.js +289 -220
- package/features/formModel/demo/FieldRenderersDemoPresenter.js.map +1 -1
- package/features/formModel/demo/FormModelDemo.js +191 -215
- package/features/formModel/demo/FormModelDemo.js.map +1 -1
- package/features/formModel/demo/FormModelDemoPresenter.js +132 -113
- package/features/formModel/demo/FormModelDemoPresenter.js.map +1 -1
- package/features/formModel/demo/FormModelPhase11Presenter.js +101 -98
- package/features/formModel/demo/FormModelPhase11Presenter.js.map +1 -1
- package/features/formModel/demo/FormModelPhase8c1Presenter.js +64 -57
- package/features/formModel/demo/FormModelPhase8c1Presenter.js.map +1 -1
- package/features/formModel/feature.js +23 -22
- package/features/formModel/feature.js.map +1 -1
- package/features/formModel/fieldTypes/BooleanFieldType.js +18 -15
- package/features/formModel/fieldTypes/BooleanFieldType.js.map +1 -1
- package/features/formModel/fieldTypes/DateTimeFieldType.js +218 -341
- package/features/formModel/fieldTypes/DateTimeFieldType.js.map +1 -1
- package/features/formModel/fieldTypes/FileFieldType.d.ts +12 -1
- package/features/formModel/fieldTypes/FileFieldType.js +48 -12
- package/features/formModel/fieldTypes/FileFieldType.js.map +1 -1
- package/features/formModel/fieldTypes/FileUrlFieldType.js +15 -12
- package/features/formModel/fieldTypes/FileUrlFieldType.js.map +1 -1
- package/features/formModel/fieldTypes/NumberFieldType.js +19 -18
- package/features/formModel/fieldTypes/NumberFieldType.js.map +1 -1
- package/features/formModel/fieldTypes/ObjectFieldType.js +80 -94
- package/features/formModel/fieldTypes/ObjectFieldType.js.map +1 -1
- package/features/formModel/fieldTypes/TextFieldType.js +15 -12
- package/features/formModel/fieldTypes/TextFieldType.js.map +1 -1
- package/features/formModel/fieldTypes/index.js +7 -9
- package/features/formModel/index.d.ts +2 -0
- package/features/formModel/index.js +11 -29
- package/features/formModel/renderers.js +0 -4
- package/features/formModel/useFieldRenderers.js +10 -14
- package/features/formModel/useFieldRenderers.js.map +1 -1
- package/features/formModel/useLayoutRenderers.js +10 -14
- package/features/formModel/useLayoutRenderers.js.map +1 -1
- package/features/listCache/ListCache.d.ts +28 -0
- package/features/listCache/ListCache.js +48 -0
- package/features/listCache/ListCache.js.map +1 -0
- package/features/listCache/index.d.ts +2 -0
- package/features/listCache/index.js +1 -0
- package/features/security/AuthenticationContext/AuthenticationContext.js +27 -26
- package/features/security/AuthenticationContext/AuthenticationContext.js.map +1 -1
- package/features/security/AuthenticationContext/GraphQLClientDecorator.js +23 -22
- package/features/security/AuthenticationContext/GraphQLClientDecorator.js.map +1 -1
- package/features/security/AuthenticationContext/InternalIdTokenProvider.js +15 -12
- package/features/security/AuthenticationContext/InternalIdTokenProvider.js.map +1 -1
- package/features/security/AuthenticationContext/abstractions.js +3 -2
- package/features/security/AuthenticationContext/abstractions.js.map +1 -1
- package/features/security/AuthenticationContext/feature.js +15 -14
- package/features/security/AuthenticationContext/feature.js.map +1 -1
- package/features/security/AuthenticationContext/index.js +0 -2
- package/features/security/AuthenticationContext/types.js +0 -3
- package/features/security/IdentityContext/IdentityContext.js +18 -17
- package/features/security/IdentityContext/IdentityContext.js.map +1 -1
- package/features/security/IdentityContext/abstractions.js +2 -1
- package/features/security/IdentityContext/abstractions.js.map +1 -1
- package/features/security/IdentityContext/feature.js +13 -12
- package/features/security/IdentityContext/feature.js.map +1 -1
- package/features/security/IdentityContext/index.js +0 -2
- package/features/security/LogIn/IdentityMapper.js +8 -7
- package/features/security/LogIn/IdentityMapper.js.map +1 -1
- package/features/security/LogIn/LogInGateway.js +17 -19
- package/features/security/LogIn/LogInGateway.js.map +1 -1
- package/features/security/LogIn/LogInRepository.js +16 -14
- package/features/security/LogIn/LogInRepository.js.map +1 -1
- package/features/security/LogIn/LogInUseCase.js +23 -31
- package/features/security/LogIn/LogInUseCase.js.map +1 -1
- package/features/security/LogIn/abstractions.js +5 -16
- package/features/security/LogIn/abstractions.js.map +1 -1
- package/features/security/LogIn/createLoginMutation.js +2 -3
- package/features/security/LogIn/createLoginMutation.js.map +1 -1
- package/features/security/LogIn/feature.js +16 -15
- package/features/security/LogIn/feature.js.map +1 -1
- package/features/security/LogIn/index.js +0 -2
- package/features/security/LogOut/LogOutUseCase.js +18 -16
- package/features/security/LogOut/LogOutUseCase.js.map +1 -1
- package/features/security/LogOut/abstractions.js +2 -1
- package/features/security/LogOut/abstractions.js.map +1 -1
- package/features/security/LogOut/feature.js +12 -11
- package/features/security/LogOut/feature.js.map +1 -1
- package/features/security/LogOut/index.js +0 -2
- package/features/security/SecurityFeature.js +9 -8
- package/features/security/SecurityFeature.js.map +1 -1
- package/features/telemetry/TelemetryService.js +11 -12
- package/features/telemetry/TelemetryService.js.map +1 -1
- package/features/telemetry/abstractions.js +2 -1
- package/features/telemetry/abstractions.js.map +1 -1
- package/features/telemetry/feature.js +13 -12
- package/features/telemetry/feature.js.map +1 -1
- package/features/telemetry/index.js +0 -2
- package/features/tenancy/GraphQLClientDecorator.js +23 -20
- package/features/tenancy/GraphQLClientDecorator.js.map +1 -1
- package/features/tenancy/TenantContext.js +46 -50
- package/features/tenancy/TenantContext.js.map +1 -1
- package/features/tenancy/abstractions.js +2 -1
- package/features/tenancy/abstractions.js.map +1 -1
- package/features/tenancy/feature.js +25 -35
- package/features/tenancy/feature.js.map +1 -1
- package/features/tenancy/types.js +0 -3
- package/features/tools/LexicalContext/LexicalContext.js +20 -17
- package/features/tools/LexicalContext/LexicalContext.js.map +1 -1
- package/features/tools/LexicalContext/abstractions.js +2 -1
- package/features/tools/LexicalContext/abstractions.js.map +1 -1
- package/features/tools/LexicalContext/index.js +0 -2
- package/features/tools/ToolPipelineRunner.js +26 -24
- package/features/tools/ToolPipelineRunner.js.map +1 -1
- package/features/tools/ToolRegistry.js +32 -23
- package/features/tools/ToolRegistry.js.map +1 -1
- package/features/tools/abstractions.js +4 -3
- package/features/tools/abstractions.js.map +1 -1
- package/features/tools/feature.js +17 -16
- package/features/tools/feature.js.map +1 -1
- package/features/tools/index.js +1 -3
- package/features/wcp/ReactLicense.js +53 -52
- package/features/wcp/ReactLicense.js.map +1 -1
- package/features/wcp/WcpGateway.js +21 -20
- package/features/wcp/WcpGateway.js.map +1 -1
- package/features/wcp/WcpService.js +57 -67
- package/features/wcp/WcpService.js.map +1 -1
- package/features/wcp/abstractions.js +3 -2
- package/features/wcp/abstractions.js.map +1 -1
- package/features/wcp/feature.js +14 -13
- package/features/wcp/feature.js.map +1 -1
- package/features/wcp/types.js +0 -3
- package/features/webinySdk/WebinySdk.js +19 -18
- package/features/webinySdk/WebinySdk.js.map +1 -1
- package/features/webinySdk/abstractions.js +2 -5
- package/features/webinySdk/abstractions.js.map +1 -1
- package/features/webinySdk/feature.js +13 -12
- package/features/webinySdk/feature.js.map +1 -1
- package/features/webinySdk/index.js +0 -2
- package/hooks/index.js +0 -2
- package/hooks/useConfirmationDialog.d.ts +1 -1
- package/hooks/useConfirmationDialog.js +31 -38
- package/hooks/useConfirmationDialog.js.map +1 -1
- package/hooks/useDialog.js +14 -15
- package/hooks/useDialog.js.map +1 -1
- package/hooks/useHotkeys.js +52 -85
- package/hooks/useHotkeys.js.map +1 -1
- package/hooks/useIsMounted.js +12 -11
- package/hooks/useIsMounted.js.map +1 -1
- package/hooks/useKeyHandler.js +45 -53
- package/hooks/useKeyHandler.js.map +1 -1
- package/hooks/useModKey.js +20 -25
- package/hooks/useModKey.js.map +1 -1
- package/hooks/useOpenDialog.js +13 -13
- package/hooks/useOpenDialog.js.map +1 -1
- package/hooks/useShiftKey.d.ts +5 -1
- package/hooks/useShiftKey.js +38 -29
- package/hooks/useShiftKey.js.map +1 -1
- package/hooks/useSnackbar.d.ts +3 -0
- package/hooks/useSnackbar.js +26 -28
- package/hooks/useSnackbar.js.map +1 -1
- package/hooks/useStateIfMounted.js +14 -12
- package/hooks/useStateIfMounted.js.map +1 -1
- package/hooks/useStateWithCallback.js +18 -14
- package/hooks/useStateWithCallback.js.map +1 -1
- package/hooks/useToggler.js +12 -11
- package/hooks/useToggler.js.map +1 -1
- package/index.d.ts +4 -1
- package/index.js +15 -31
- package/package.json +29 -29
- package/permissions/PermissionRenderer.js +179 -193
- package/permissions/PermissionRenderer.js.map +1 -1
- package/permissions/PermissionValueContext.js +13 -20
- package/permissions/PermissionValueContext.js.map +1 -1
- package/permissions/createHasPermission.js +32 -40
- package/permissions/createHasPermission.js.map +1 -1
- package/permissions/createPermissionSchema.js +6 -5
- package/permissions/createPermissionSchema.js.map +1 -1
- package/permissions/createPermissions.js +125 -185
- package/permissions/createPermissions.js.map +1 -1
- package/permissions/createPermissions.test.js +190 -158
- package/permissions/createPermissions.test.js.map +1 -1
- package/permissions/index.js +2 -4
- package/permissions/types.js +0 -3
- package/permissions/usePermissionForm.js +133 -232
- package/permissions/usePermissionForm.js.map +1 -1
- package/permissions/usePermissions.js +6 -5
- package/permissions/usePermissions.js.map +1 -1
- package/plugins/MenuPlugin.js +15 -14
- package/plugins/MenuPlugin.js.map +1 -1
- package/presentation/browserFilePicker/BrowserFilePicker.d.ts +3 -0
- package/presentation/browserFilePicker/BrowserFilePicker.js +88 -0
- package/presentation/browserFilePicker/BrowserFilePicker.js.map +1 -0
- package/presentation/browserFilePicker/BrowserFilePickerPresenter.d.ts +10 -0
- package/presentation/browserFilePicker/BrowserFilePickerPresenter.js +84 -0
- package/presentation/browserFilePicker/BrowserFilePickerPresenter.js.map +1 -0
- package/presentation/browserFilePicker/index.d.ts +3 -0
- package/presentation/browserFilePicker/index.js +2 -0
- package/presentation/browserFilePicker/types.d.ts +53 -0
- package/presentation/browserFilePicker/types.js +0 -0
- package/presentation/browserFilePicker/utils.d.ts +2 -0
- package/presentation/browserFilePicker/utils.js +16 -0
- package/presentation/browserFilePicker/utils.js.map +1 -0
- package/presentation/buildParams/useBuildParams.js +2 -3
- package/presentation/buildParams/useBuildParams.js.map +1 -1
- package/presentation/installation/components/SystemInstaller/SystemInstaller.js +46 -53
- package/presentation/installation/components/SystemInstaller/SystemInstaller.js.map +1 -1
- package/presentation/installation/components/SystemInstaller/SystemInstallerProvider.js +9 -14
- package/presentation/installation/components/SystemInstaller/SystemInstallerProvider.js.map +1 -1
- package/presentation/installation/components/SystemInstaller/index.js +0 -2
- package/presentation/installation/components/SystemInstaller/steps/AdminUserStep/createPasswordValidator.js +14 -29
- package/presentation/installation/components/SystemInstaller/steps/AdminUserStep/createPasswordValidator.js.map +1 -1
- package/presentation/installation/components/SystemInstaller/steps/AdminUserStep/usePasswordValidator.js +11 -10
- package/presentation/installation/components/SystemInstaller/steps/AdminUserStep/usePasswordValidator.js.map +1 -1
- package/presentation/installation/components/SystemInstaller/steps/AdminUserStep.js +60 -60
- package/presentation/installation/components/SystemInstaller/steps/AdminUserStep.js.map +1 -1
- package/presentation/installation/components/SystemInstaller/steps/BasicInfoStep.js +75 -85
- package/presentation/installation/components/SystemInstaller/steps/BasicInfoStep.js.map +1 -1
- package/presentation/installation/components/SystemInstaller/steps/Center.js +5 -8
- package/presentation/installation/components/SystemInstaller/steps/Center.js.map +1 -1
- package/presentation/installation/components/SystemInstaller/steps/Container.js +18 -24
- package/presentation/installation/components/SystemInstaller/steps/Container.js.map +1 -1
- package/presentation/installation/components/SystemInstaller/steps/FinishSetup.js +48 -53
- package/presentation/installation/components/SystemInstaller/steps/FinishSetup.js.map +1 -1
- package/presentation/installation/components/SystemInstaller/steps/IntroductionStep.js +13 -16
- package/presentation/installation/components/SystemInstaller/steps/IntroductionStep.js.map +1 -1
- package/presentation/installation/components/SystemInstaller/steps/introduction.js +723 -0
- package/presentation/installation/components/SystemInstaller/steps/introduction.js.map +1 -0
- package/presentation/installation/components/SystemInstaller/steps/referralSources.js +14 -1
- package/presentation/installation/components/SystemInstaller/steps/referralSources.js.map +1 -1
- package/presentation/installation/presenters/SystemInstaller/SystemInstallerGateway.js +27 -28
- package/presentation/installation/presenters/SystemInstaller/SystemInstallerGateway.js.map +1 -1
- package/presentation/installation/presenters/SystemInstaller/SystemInstallerPresenter.js +117 -124
- package/presentation/installation/presenters/SystemInstaller/SystemInstallerPresenter.js.map +1 -1
- package/presentation/installation/presenters/SystemInstaller/SystemInstallerRepository.js +23 -21
- package/presentation/installation/presenters/SystemInstaller/SystemInstallerRepository.js.map +1 -1
- package/presentation/installation/presenters/SystemInstaller/abstractions.js +4 -3
- package/presentation/installation/presenters/SystemInstaller/abstractions.js.map +1 -1
- package/presentation/installation/presenters/SystemInstaller/feature.js +15 -14
- package/presentation/installation/presenters/SystemInstaller/feature.js.map +1 -1
- package/presentation/installation/presenters/SystemInstaller/index.js +0 -2
- package/presentation/lexicalContext/useLexicalContext.js +11 -8
- package/presentation/lexicalContext/useLexicalContext.js.map +1 -1
- package/presentation/listPresenter/ListPresenter.d.ts +30 -0
- package/presentation/listPresenter/ListPresenter.js +216 -0
- package/presentation/listPresenter/ListPresenter.js.map +1 -0
- package/presentation/listPresenter/ListPresenter.test.d.ts +1 -0
- package/presentation/listPresenter/ListPresenter.test.js +816 -0
- package/presentation/listPresenter/ListPresenter.test.js.map +1 -0
- package/presentation/listPresenter/SelectionController.d.ts +21 -0
- package/presentation/listPresenter/SelectionController.js +74 -0
- package/presentation/listPresenter/SelectionController.js.map +1 -0
- package/presentation/listPresenter/abstractions.d.ts +107 -0
- package/presentation/listPresenter/abstractions.js +5 -0
- package/presentation/listPresenter/abstractions.js.map +1 -0
- package/presentation/listPresenter/feature.d.ts +3 -0
- package/presentation/listPresenter/feature.js +17 -0
- package/presentation/listPresenter/feature.js.map +1 -0
- package/presentation/listPresenter/index.d.ts +3 -0
- package/presentation/listPresenter/index.js +2 -0
- package/presentation/security/components/HasPermission.js +15 -25
- package/presentation/security/components/HasPermission.js.map +1 -1
- package/presentation/security/components/SecureRoute.js +6 -12
- package/presentation/security/components/SecureRoute.js.map +1 -1
- package/presentation/security/hooks/useAuthentication.js +11 -17
- package/presentation/security/hooks/useAuthentication.js.map +1 -1
- package/presentation/security/hooks/useIdentity.js +19 -18
- package/presentation/security/hooks/useIdentity.js.map +1 -1
- package/presentation/security/hooks/useSecurity.js +14 -24
- package/presentation/security/hooks/useSecurity.js.map +1 -1
- package/presentation/tenancy/TenancyProvider.js +23 -36
- package/presentation/tenancy/TenancyProvider.js.map +1 -1
- package/presentation/tenancy/createTenancyProvider.js +6 -11
- package/presentation/tenancy/createTenancyProvider.js.map +1 -1
- package/presentation/tenancy/useTenantContext.js +17 -18
- package/presentation/tenancy/useTenantContext.js.map +1 -1
- package/presentation/textToLexicalTool/TextToLexicalTool.js +20 -18
- package/presentation/textToLexicalTool/TextToLexicalTool.js.map +1 -1
- package/presentation/textToLexicalTool/feature.js +6 -5
- package/presentation/textToLexicalTool/feature.js.map +1 -1
- package/presentation/textToLexicalTool/textToLexicalState.js +28 -28
- package/presentation/textToLexicalTool/textToLexicalState.js.map +1 -1
- package/presentation/wcp/WcpProvider.js +16 -26
- package/presentation/wcp/WcpProvider.js.map +1 -1
- package/presentation/wcp/useWcp.js +11 -12
- package/presentation/wcp/useWcp.js.map +1 -1
- package/routes.d.ts +0 -1
- package/routes.js +14 -17
- package/routes.js.map +1 -1
- package/static/svg/SecureRouteError.e8b15981.svg +1 -0
- package/static/svg/add-18px.b3062af6.svg +3 -0
- package/static/svg/arrow_drop_down-24px.da74d713.svg +4 -0
- package/static/svg/attach_file_black_24dp.7fb13a7e.svg +1 -0
- package/static/svg/baseline-menu-24px.071b179d.svg +4 -0
- package/static/svg/baseline-notification_important-24px.29277e73.svg +4 -0
- package/static/svg/baseline-security-24px.12e519cc.svg +4 -0
- package/static/svg/file_download.afe3fbec.svg +1 -0
- package/static/svg/file_upload.6865d820.svg +1 -0
- package/static/svg/filter-24px.886d9ff0.svg +8 -0
- package/static/svg/github-brands.6311f0fa.svg +1 -0
- package/static/svg/highlight-24px.959a97f7.svg +1 -0
- package/static/svg/icon-community.cd087355.svg +16 -0
- package/static/svg/icon-documentation.a189d24c.svg +16 -0
- package/static/svg/info.fe810b72.svg +1 -0
- package/static/svg/insert_drive_file-24px.39d490eb.svg +1 -0
- package/static/svg/insert_photo-24px.81a5f945.svg +1 -0
- package/static/svg/introduction.108720aa.svg +154 -0
- package/static/svg/label-24px.9deafa4f.svg +1 -0
- package/static/svg/round-account_circle-24px.f0b48cb7.svg +1 -0
- package/static/svg/round-add-24px.4a5219b4.svg +16 -0
- package/static/svg/round-arrow_drop_down-24px.5fdf92d1.svg +1 -0
- package/static/svg/round-chevron_right-24px.34936511.svg +12 -0
- package/static/svg/round-feedback-24px.4dae7231.svg +54 -0
- package/static/svg/round-help-24px.a61b1d66.svg +1 -0
- package/static/svg/round-invert_colors-24px.a229a1dd.svg +52 -0
- package/static/svg/round-keyboard_arrow_down-24px.6febe804.svg +16 -0
- package/static/svg/round-keyboard_arrow_up-24px.b1f7db34.svg +16 -0
- package/static/svg/round-lock_open-24px.d527f6a5.svg +60 -0
- package/static/svg/round-more_vert-24px.68d41b07.svg +12 -0
- package/static/svg/round-open_in_new-24px.be5b4ddd.svg +44 -0
- package/static/svg/round-settings-24px.c0b3056f.svg +4 -0
- package/static/svg/search-24px.3c0f88dd.svg +20 -0
- package/static/svg/slack-logo.7ee35e7f.svg +1 -0
- package/static/svg/today-24px.df206362.svg +1 -0
- package/static/svg/touch_app.debf3744.svg +1 -0
- package/static/svg/wby-horizontal.03327bf6.svg +23 -0
- package/static/svg/wby-square.ff8f47c3.svg +3 -0
- package/static/svg/webiny-logo.ef56725c.svg +20 -0
- package/static/svg/webiny-orange-logo.4eccf0f2.svg +20 -0
- package/types.js +0 -3
- package/components/BulkActions/index.js.map +0 -1
- package/components/BulkActions/useDialogWithReport/index.js.map +0 -1
- package/components/Buttons/index.js.map +0 -1
- package/components/DeveloperMode/index.js.map +0 -1
- package/components/Filters/index.js.map +0 -1
- package/components/IconPicker/components/index.js.map +0 -1
- package/components/IconPicker/index.js.map +0 -1
- package/components/LexicalEditor/index.js.map +0 -1
- package/components/NotAuthorizedError/index.js.map +0 -1
- package/components/OptionsMenu/index.js.map +0 -1
- package/components/OverlayLayout/components/index.js.map +0 -1
- package/components/OverlayLayout/index.js.map +0 -1
- package/components/Permissions/index.js.map +0 -1
- package/components/ResizablePanels/index.js.map +0 -1
- package/components/SimpleForm/index.js.map +0 -1
- package/components/SplitView/index.js.map +0 -1
- package/components/index.js.map +0 -1
- package/config/AdminConfig/Menu/UserMenu/UserMenuSeparator.js.map +0 -1
- package/config/AdminConfig/Menu/UserMenu/types.js.map +0 -1
- package/config/AdminConfig/Menu/types.js.map +0 -1
- package/config/AdminConfig/Theme/types.js.map +0 -1
- package/exports/admin/build-params.js.map +0 -1
- package/exports/admin/configs.js.map +0 -1
- package/exports/admin/form.js.map +0 -1
- package/exports/admin/security.js.map +0 -1
- package/exports/admin/tenancy.js.map +0 -1
- package/exports/admin/ui.js.map +0 -1
- package/exports/admin.js.map +0 -1
- package/features/buildParams/index.js.map +0 -1
- package/features/formModel/fieldTypes/index.js.map +0 -1
- package/features/formModel/index.js.map +0 -1
- package/features/formModel/renderers.js.map +0 -1
- package/features/security/AuthenticationContext/index.js.map +0 -1
- package/features/security/AuthenticationContext/types.js.map +0 -1
- package/features/security/IdentityContext/index.js.map +0 -1
- package/features/security/LogIn/index.js.map +0 -1
- package/features/security/LogOut/index.js.map +0 -1
- package/features/telemetry/index.js.map +0 -1
- package/features/tenancy/types.js.map +0 -1
- package/features/tools/LexicalContext/index.js.map +0 -1
- package/features/tools/index.js.map +0 -1
- package/features/wcp/types.js.map +0 -1
- package/features/webinySdk/index.js.map +0 -1
- package/hooks/index.js.map +0 -1
- package/index.js.map +0 -1
- package/permissions/index.js.map +0 -1
- package/permissions/types.js.map +0 -1
- package/presentation/installation/components/SystemInstaller/index.js.map +0 -1
- package/presentation/installation/presenters/SystemInstaller/index.js.map +0 -1
- package/types.js.map +0 -1
|
@@ -1,763 +1,563 @@
|
|
|
1
1
|
import { makeAutoObservable, runInAction, toJS } from "mobx";
|
|
2
2
|
import { Field } from "./Field.js";
|
|
3
3
|
import { createTemplateBuilder } from "./fieldTypes/ObjectFieldType.js";
|
|
4
|
-
|
|
5
|
-
export const TEMPLATE_DISCRIMINATOR = "_templateId";
|
|
4
|
+
const TEMPLATE_DISCRIMINATOR = "_templateId";
|
|
6
5
|
function createChildFields(childBuilders, form, parentPath) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
const children = new Map();
|
|
7
|
+
for (const [name, builder] of Object.entries(childBuilders)){
|
|
8
|
+
const config = builder.build(name);
|
|
9
|
+
const field = createFieldFromConfig(config, form, parentPath);
|
|
10
|
+
children.set(name, field);
|
|
11
|
+
}
|
|
12
|
+
return children;
|
|
14
13
|
}
|
|
15
14
|
function createFieldFromConfig(config, form, parentPath) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
if (form) {
|
|
25
|
-
field.setForm(form, parentPath);
|
|
26
|
-
}
|
|
27
|
-
return field;
|
|
15
|
+
if (config.childBuilders) {
|
|
16
|
+
const objField = new ObjectField(config);
|
|
17
|
+
if (form) objField.setForm(form, parentPath);
|
|
18
|
+
return objField;
|
|
19
|
+
}
|
|
20
|
+
const field = new Field(config);
|
|
21
|
+
if (form) field.setForm(form, parentPath);
|
|
22
|
+
return field;
|
|
28
23
|
}
|
|
29
24
|
function hydrateChildren(children, data, options) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
for (const [name, field] of children) {
|
|
34
|
-
if (name in data) {
|
|
35
|
-
if (options?.clone && field.config.cloneValue) {
|
|
36
|
-
field.setValueSilent(field.config.cloneValue(data[name]));
|
|
37
|
-
} else {
|
|
38
|
-
field.setValueSilent(data[name]);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
25
|
+
if (!data) return;
|
|
26
|
+
for (const [name, field] of children)if (name in data) if (options?.clone && field.config.cloneValue) field.setValueSilent(field.config.cloneValue(data[name]));
|
|
27
|
+
else field.setValueSilent(data[name]);
|
|
42
28
|
}
|
|
43
29
|
function getChildrenData(children) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
} else {
|
|
49
|
-
data[name] = toJS(field.getValue());
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
return data;
|
|
30
|
+
const data = {};
|
|
31
|
+
for (const [name, field] of children)if (isObjectField(field)) data[name] = toJS(field.getData());
|
|
32
|
+
else data[name] = toJS(field.getValue());
|
|
33
|
+
return data;
|
|
53
34
|
}
|
|
54
35
|
async function validateChildren(children, options) {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
return allValid;
|
|
36
|
+
let allValid = true;
|
|
37
|
+
for (const [, field] of children){
|
|
38
|
+
const valid = await field.validate(options);
|
|
39
|
+
if (!valid) allValid = false;
|
|
40
|
+
}
|
|
41
|
+
return allValid;
|
|
63
42
|
}
|
|
64
|
-
|
|
65
|
-
|
|
43
|
+
function isObjectField(field) {
|
|
44
|
+
return "object" === field.type;
|
|
66
45
|
}
|
|
67
46
|
let itemKeyCounter = 0;
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
});
|
|
90
|
-
this._templates = config.templates ?? [];
|
|
91
|
-
this._isTemplated = this._templates.length > 0;
|
|
92
|
-
if (this._isTemplated) {
|
|
93
|
-
// Templated mode: children populated per-item (list) or when a template is picked (single).
|
|
94
|
-
this._children = new Map();
|
|
95
|
-
} else {
|
|
96
|
-
this._children = createChildFields(config.childBuilders, null);
|
|
97
|
-
}
|
|
98
|
-
makeAutoObservable(this, {
|
|
99
|
-
config: false
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
_findTemplate(id) {
|
|
103
|
-
return this._templates.find(t => t.id === id);
|
|
104
|
-
}
|
|
105
|
-
_rebuildChildrenForTemplate(templateId) {
|
|
106
|
-
const template = this._findTemplate(templateId);
|
|
107
|
-
if (!template) {
|
|
108
|
-
throw new Error(`Template "${templateId}" not found on field "${this.config.name}". ` + `Available: ${this._templates.map(t => t.id).join(", ") || "(none)"}.`);
|
|
109
|
-
}
|
|
110
|
-
const children = createChildFields(template.childBuilders, this._form, this.qualifiedName);
|
|
111
|
-
this._children = children;
|
|
112
|
-
this._activeTemplateId = templateId;
|
|
113
|
-
const inner = this._innerLayoutFor(templateId);
|
|
114
|
-
if (inner) {
|
|
115
|
-
this._applyNestedObjectLayouts(inner, children);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
// --- Forwarded from _base ---
|
|
120
|
-
|
|
121
|
-
get name() {
|
|
122
|
-
return this._base.name;
|
|
123
|
-
}
|
|
124
|
-
get type() {
|
|
125
|
-
return "object";
|
|
126
|
-
}
|
|
127
|
-
get visible() {
|
|
128
|
-
return this._base.visible;
|
|
129
|
-
}
|
|
130
|
-
get disabled() {
|
|
131
|
-
return this._base.disabled;
|
|
132
|
-
}
|
|
133
|
-
setDisabled(value) {
|
|
134
|
-
this._base.setDisabled(value);
|
|
135
|
-
}
|
|
136
|
-
setVisible(value) {
|
|
137
|
-
this._base.setVisible(value);
|
|
138
|
-
}
|
|
139
|
-
setAncestorRules(rules) {
|
|
140
|
-
this._base.setAncestorRules(rules);
|
|
141
|
-
}
|
|
142
|
-
setForm(form, parentPath) {
|
|
143
|
-
this._form = form;
|
|
144
|
-
this._base.setForm(form, parentPath);
|
|
145
|
-
const myPath = this._base.qualifiedName;
|
|
146
|
-
for (const [, field] of this._children) {
|
|
147
|
-
field.setForm(form, myPath);
|
|
148
|
-
}
|
|
149
|
-
for (const item of this._items) {
|
|
150
|
-
for (const [, field] of item.children) {
|
|
151
|
-
field.setForm(form, myPath);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
setValidation(validation) {
|
|
156
|
-
this._base.setValidation(validation);
|
|
157
|
-
}
|
|
158
|
-
addBeforeChange(cb) {
|
|
159
|
-
this._base.addBeforeChange(cb);
|
|
160
|
-
}
|
|
161
|
-
addAfterChange(cb) {
|
|
162
|
-
this._base.addAfterChange(cb);
|
|
163
|
-
}
|
|
164
|
-
addAfterSetValue(cb) {
|
|
165
|
-
this._base.addAfterSetValue(cb);
|
|
166
|
-
}
|
|
167
|
-
addOnBlur(cb) {
|
|
168
|
-
this._base.addOnBlur(cb);
|
|
169
|
-
}
|
|
170
|
-
addRequiredWhen(fn, message) {
|
|
171
|
-
this._base.addRequiredWhen(fn, message);
|
|
172
|
-
}
|
|
173
|
-
setComputed(fn) {
|
|
174
|
-
this._base.setComputed(fn);
|
|
175
|
-
}
|
|
176
|
-
setComputedUntilDirty(fn) {
|
|
177
|
-
this._base.setComputedUntilDirty(fn);
|
|
178
|
-
}
|
|
179
|
-
blur() {
|
|
180
|
-
this._base.blur();
|
|
181
|
-
}
|
|
182
|
-
remove() {
|
|
183
|
-
this._base.remove();
|
|
184
|
-
}
|
|
185
|
-
get qualifiedName() {
|
|
186
|
-
return this._base.qualifiedName;
|
|
187
|
-
}
|
|
188
|
-
focus() {
|
|
189
|
-
this._base.focus();
|
|
190
|
-
}
|
|
191
|
-
requestFocus() {
|
|
192
|
-
this._base.requestFocus();
|
|
193
|
-
}
|
|
194
|
-
clearFocusRequest() {
|
|
195
|
-
this._base.clearFocusRequest();
|
|
196
|
-
}
|
|
197
|
-
getInnerLayout() {
|
|
198
|
-
if (this.isTemplated) {
|
|
199
|
-
return this._activeTemplateId ? this._templateLayouts[this._activeTemplateId] ?? null : null;
|
|
200
|
-
}
|
|
201
|
-
return this._ownLayout;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
// --- Object-specific ---
|
|
205
|
-
|
|
206
|
-
get isList() {
|
|
207
|
-
return this.config.isList;
|
|
208
|
-
}
|
|
209
|
-
get isTemplated() {
|
|
210
|
-
return this._isTemplated;
|
|
211
|
-
}
|
|
212
|
-
get activeTemplateId() {
|
|
213
|
-
return this._activeTemplateId;
|
|
214
|
-
}
|
|
215
|
-
get availableTemplates() {
|
|
216
|
-
const result = [];
|
|
217
|
-
for (const template of this._templates) {
|
|
218
|
-
if (template.visible && this._form) {
|
|
219
|
-
if (!template.visible(this._form)) {
|
|
220
|
-
continue;
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
result.push({
|
|
224
|
-
id: template.id,
|
|
225
|
-
label: template.label,
|
|
226
|
-
icon: template.icon
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
return result;
|
|
230
|
-
}
|
|
231
|
-
setTemplate(templateId) {
|
|
232
|
-
if (this._activeTemplateId === templateId) {
|
|
233
|
-
return;
|
|
234
|
-
}
|
|
235
|
-
this._rebuildChildrenForTemplate(templateId);
|
|
236
|
-
}
|
|
237
|
-
get templates() {
|
|
238
|
-
return {
|
|
239
|
-
add: (id, configure) => this._addTemplate(id, configure),
|
|
240
|
-
remove: templateId => this._removeTemplate(templateId)
|
|
241
|
-
};
|
|
242
|
-
}
|
|
243
|
-
_addTemplate(id, configure) {
|
|
244
|
-
if (!this.isTemplated) {
|
|
245
|
-
throw new Error(`Object field "${this.config.name}" is not templated; templates.add() requires the field to be defined with .template().`);
|
|
246
|
-
}
|
|
247
|
-
if (id === TEMPLATE_DISCRIMINATOR) {
|
|
248
|
-
throw new Error(`Template id "${TEMPLATE_DISCRIMINATOR}" is reserved. Choose a different id.`);
|
|
249
|
-
}
|
|
250
|
-
if (this._findTemplate(id)) {
|
|
251
|
-
throw new Error(`Duplicate template id "${id}".`);
|
|
252
|
-
}
|
|
253
|
-
const tb = createTemplateBuilder();
|
|
254
|
-
configure(tb);
|
|
255
|
-
this._templates.push(tb._build(id, this._form.registry));
|
|
256
|
-
}
|
|
257
|
-
_removeTemplate(templateId) {
|
|
258
|
-
if (!this.isTemplated) {
|
|
259
|
-
throw new Error(`Object field "${this.config.name}" is not templated; templates.remove() requires the field to be defined with .template().`);
|
|
260
|
-
}
|
|
261
|
-
const index = this._templates.findIndex(t => t.id === templateId);
|
|
262
|
-
if (index === -1) {
|
|
263
|
-
return;
|
|
264
|
-
}
|
|
265
|
-
this._templates.splice(index, 1);
|
|
266
|
-
if (this.config.isList) {
|
|
267
|
-
this._items = this._items.filter(item => item.templateId !== templateId);
|
|
268
|
-
return;
|
|
269
|
-
}
|
|
270
|
-
if (this._activeTemplateId === templateId) {
|
|
271
|
-
this._activeTemplateId = null;
|
|
272
|
-
this._children = new Map();
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
setInnerLayout(layout) {
|
|
276
|
-
if (Array.isArray(layout)) {
|
|
277
|
-
if (this.isTemplated) {
|
|
278
|
-
throw new Error(`Object field "${this.config.name}" is templated; layout.object() must pass a per-template map (Record<templateId, LayoutNode[]>), not a single LayoutNode[].`);
|
|
279
|
-
}
|
|
280
|
-
this._ownLayout = layout;
|
|
281
|
-
this._templateLayouts = {};
|
|
282
|
-
// Apply nested object layouts to children that already exist
|
|
283
|
-
// (non-templated single + non-templated list items).
|
|
284
|
-
this._applyNestedObjectLayouts(layout, this._children);
|
|
285
|
-
for (const item of this._items) {
|
|
286
|
-
this._applyNestedObjectLayouts(layout, item.children);
|
|
287
|
-
}
|
|
288
|
-
return;
|
|
289
|
-
}
|
|
290
|
-
if (!this.isTemplated) {
|
|
291
|
-
throw new Error(`Object field "${this.config.name}" is not templated; layout.object() must pass a single LayoutNode[], not a per-template map.`);
|
|
292
|
-
}
|
|
293
|
-
this._templateLayouts = layout;
|
|
294
|
-
this._ownLayout = null;
|
|
295
|
-
// Apply nested object layouts to currently-active templated children
|
|
296
|
-
// (templated single with active template + templated list items).
|
|
297
|
-
if (this._activeTemplateId && layout[this._activeTemplateId]) {
|
|
298
|
-
this._applyNestedObjectLayouts(layout[this._activeTemplateId], this._children);
|
|
299
|
-
}
|
|
300
|
-
for (const item of this._items) {
|
|
301
|
-
if (item.templateId && layout[item.templateId]) {
|
|
302
|
-
this._applyNestedObjectLayouts(layout[item.templateId], item.children);
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
/**
|
|
308
|
-
* Walk an inner layout for nested `object` nodes and forward each one to
|
|
309
|
-
* the matching child field. The recursion bottoms out naturally: each
|
|
310
|
-
* matched child is itself an ObjectField and will run `_applyNestedObjectLayouts`
|
|
311
|
-
* against its own children whenever they materialise.
|
|
312
|
-
*/
|
|
313
|
-
_applyNestedObjectLayouts(layout, children) {
|
|
314
|
-
for (const node of layout) {
|
|
315
|
-
if (node.type === "object") {
|
|
316
|
-
const child = children.get(node.fieldName);
|
|
317
|
-
if (child && isObjectField(child)) {
|
|
318
|
-
child.setInnerLayout(node.inner);
|
|
319
|
-
}
|
|
320
|
-
} else if (node.type === "tabs") {
|
|
321
|
-
for (const tab of node.tabs) {
|
|
322
|
-
this._applyNestedObjectLayouts(tab.layout, children);
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
/**
|
|
329
|
-
* Returns the inner layout that should apply to a freshly-built children
|
|
330
|
-
* Map for the given templateId (templated objects/lists) or for the
|
|
331
|
-
* non-templated case. Used to seed nested object layouts on newly-created
|
|
332
|
-
* children before they go live.
|
|
333
|
-
*/
|
|
334
|
-
_innerLayoutFor(templateId) {
|
|
335
|
-
if (this.isTemplated) {
|
|
336
|
-
if (templateId === undefined) {
|
|
337
|
-
return undefined;
|
|
338
|
-
}
|
|
339
|
-
return this._templateLayouts[templateId];
|
|
340
|
-
}
|
|
341
|
-
return this._ownLayout ?? undefined;
|
|
342
|
-
}
|
|
343
|
-
_resolveLayoutForChildren(children, templateId) {
|
|
344
|
-
const layoutNodes = this.isTemplated ? templateId !== null ? this._templateLayouts[templateId] : undefined : this._ownLayout ?? undefined;
|
|
345
|
-
if (layoutNodes && this._form?.resolveChildLayout) {
|
|
346
|
-
return this._form.resolveChildLayout(layoutNodes, children);
|
|
347
|
-
}
|
|
348
|
-
// Default: one row per visible child, in insertion order.
|
|
349
|
-
const fallback = [];
|
|
350
|
-
for (const [, field] of children) {
|
|
351
|
-
if (field.visible) {
|
|
352
|
-
fallback.push({
|
|
353
|
-
type: "row",
|
|
354
|
-
fields: [field.vm]
|
|
47
|
+
class ObjectField {
|
|
48
|
+
constructor(config){
|
|
49
|
+
this._form = null;
|
|
50
|
+
this._items = [];
|
|
51
|
+
this._templates = [];
|
|
52
|
+
this._activeTemplateId = null;
|
|
53
|
+
this._ownLayout = null;
|
|
54
|
+
this._templateLayouts = {};
|
|
55
|
+
this._validating = false;
|
|
56
|
+
this.config = config;
|
|
57
|
+
this._base = new Field({
|
|
58
|
+
...config,
|
|
59
|
+
type: "object",
|
|
60
|
+
renderer: config.renderer ?? (config.isList ? "objectAccordionMultiple" : "objectAccordionSingle")
|
|
61
|
+
});
|
|
62
|
+
this._templates = config.templates ?? [];
|
|
63
|
+
this._isTemplated = this._templates.length > 0;
|
|
64
|
+
if (this._isTemplated) this._children = new Map();
|
|
65
|
+
else this._children = createChildFields(config.childBuilders, null);
|
|
66
|
+
makeAutoObservable(this, {
|
|
67
|
+
config: false
|
|
355
68
|
});
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
return fallback;
|
|
359
|
-
}
|
|
360
|
-
get children() {
|
|
361
|
-
return this._children;
|
|
362
|
-
}
|
|
363
|
-
get items() {
|
|
364
|
-
return this._items.map(item => ({
|
|
365
|
-
key: item.key,
|
|
366
|
-
children: item.children,
|
|
367
|
-
templateId: item.templateId,
|
|
368
|
-
getData: () => this._getItemData(item)
|
|
369
|
-
}));
|
|
370
|
-
}
|
|
371
|
-
_getItemData(item) {
|
|
372
|
-
const data = getChildrenData(item.children);
|
|
373
|
-
if (item.templateId !== undefined) {
|
|
374
|
-
return {
|
|
375
|
-
[TEMPLATE_DISCRIMINATOR]: item.templateId,
|
|
376
|
-
...data
|
|
377
|
-
};
|
|
378
69
|
}
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
this.
|
|
393
|
-
|
|
70
|
+
_findTemplate(id) {
|
|
71
|
+
return this._templates.find((t)=>t.id === id);
|
|
72
|
+
}
|
|
73
|
+
_rebuildChildrenForTemplate(templateId) {
|
|
74
|
+
const template = this._findTemplate(templateId);
|
|
75
|
+
if (!template) throw new Error(`Template "${templateId}" not found on field "${this.config.name}". Available: ${this._templates.map((t)=>t.id).join(", ") || "(none)"}.`);
|
|
76
|
+
const children = createChildFields(template.childBuilders, this._form, this.qualifiedName);
|
|
77
|
+
this._children = children;
|
|
78
|
+
this._activeTemplateId = templateId;
|
|
79
|
+
const inner = this._innerLayoutFor(templateId);
|
|
80
|
+
if (inner) this._applyNestedObjectLayouts(inner, children);
|
|
81
|
+
}
|
|
82
|
+
get name() {
|
|
83
|
+
return this._base.name;
|
|
84
|
+
}
|
|
85
|
+
get type() {
|
|
86
|
+
return "object";
|
|
87
|
+
}
|
|
88
|
+
get visible() {
|
|
89
|
+
return this._base.visible;
|
|
90
|
+
}
|
|
91
|
+
get disabled() {
|
|
92
|
+
return this._base.disabled;
|
|
93
|
+
}
|
|
94
|
+
setDisabled(value) {
|
|
95
|
+
this._base.setDisabled(value);
|
|
96
|
+
}
|
|
97
|
+
setVisible(value) {
|
|
98
|
+
this._base.setVisible(value);
|
|
99
|
+
}
|
|
100
|
+
setAncestorRules(rules) {
|
|
101
|
+
this._base.setAncestorRules(rules);
|
|
102
|
+
}
|
|
103
|
+
setForm(form, parentPath) {
|
|
104
|
+
this._form = form;
|
|
105
|
+
this._base.setForm(form, parentPath);
|
|
106
|
+
const myPath = this._base.qualifiedName;
|
|
107
|
+
for (const [, field] of this._children)field.setForm(form, myPath);
|
|
108
|
+
for (const item of this._items)for (const [, field] of item.children)field.setForm(form, myPath);
|
|
109
|
+
}
|
|
110
|
+
setValidation(validation) {
|
|
111
|
+
this._base.setValidation(validation);
|
|
112
|
+
}
|
|
113
|
+
addBeforeChange(cb) {
|
|
114
|
+
this._base.addBeforeChange(cb);
|
|
115
|
+
}
|
|
116
|
+
addAfterChange(cb) {
|
|
117
|
+
this._base.addAfterChange(cb);
|
|
118
|
+
}
|
|
119
|
+
addAfterSetValue(cb) {
|
|
120
|
+
this._base.addAfterSetValue(cb);
|
|
121
|
+
}
|
|
122
|
+
addOnBlur(cb) {
|
|
123
|
+
this._base.addOnBlur(cb);
|
|
124
|
+
}
|
|
125
|
+
addRequiredWhen(fn, message) {
|
|
126
|
+
this._base.addRequiredWhen(fn, message);
|
|
127
|
+
}
|
|
128
|
+
setComputed(fn) {
|
|
129
|
+
this._base.setComputed(fn);
|
|
130
|
+
}
|
|
131
|
+
setComputedUntilDirty(fn) {
|
|
132
|
+
this._base.setComputedUntilDirty(fn);
|
|
133
|
+
}
|
|
134
|
+
blur() {
|
|
135
|
+
this._base.blur();
|
|
136
|
+
}
|
|
137
|
+
remove() {
|
|
138
|
+
this._base.remove();
|
|
139
|
+
}
|
|
140
|
+
get qualifiedName() {
|
|
141
|
+
return this._base.qualifiedName;
|
|
142
|
+
}
|
|
143
|
+
focus() {
|
|
144
|
+
this._base.focus();
|
|
145
|
+
}
|
|
146
|
+
requestFocus() {
|
|
147
|
+
this._base.requestFocus();
|
|
148
|
+
}
|
|
149
|
+
clearFocusRequest() {
|
|
150
|
+
this._base.clearFocusRequest();
|
|
151
|
+
}
|
|
152
|
+
getInnerLayout() {
|
|
153
|
+
if (this.isTemplated) return this._activeTemplateId ? this._templateLayouts[this._activeTemplateId] ?? null : null;
|
|
154
|
+
return this._ownLayout;
|
|
155
|
+
}
|
|
156
|
+
get isList() {
|
|
157
|
+
return this.config.isList;
|
|
158
|
+
}
|
|
159
|
+
get isTemplated() {
|
|
160
|
+
return this._isTemplated;
|
|
161
|
+
}
|
|
162
|
+
get activeTemplateId() {
|
|
163
|
+
return this._activeTemplateId;
|
|
164
|
+
}
|
|
165
|
+
get availableTemplates() {
|
|
166
|
+
const result = [];
|
|
167
|
+
for (const template of this._templates){
|
|
168
|
+
if (template.visible && this._form) {
|
|
169
|
+
if (!template.visible(this._form)) continue;
|
|
170
|
+
}
|
|
171
|
+
result.push({
|
|
172
|
+
id: template.id,
|
|
173
|
+
label: template.label,
|
|
174
|
+
icon: template.icon
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
return result;
|
|
178
|
+
}
|
|
179
|
+
setTemplate(templateId) {
|
|
180
|
+
if (this._activeTemplateId === templateId) return;
|
|
181
|
+
this._rebuildChildrenForTemplate(templateId);
|
|
182
|
+
}
|
|
183
|
+
get templates() {
|
|
184
|
+
return {
|
|
185
|
+
add: (id, configure)=>this._addTemplate(id, configure),
|
|
186
|
+
remove: (templateId)=>this._removeTemplate(templateId)
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
_addTemplate(id, configure) {
|
|
190
|
+
if (!this.isTemplated) throw new Error(`Object field "${this.config.name}" is not templated; templates.add() requires the field to be defined with .template().`);
|
|
191
|
+
if (id === TEMPLATE_DISCRIMINATOR) throw new Error(`Template id "${TEMPLATE_DISCRIMINATOR}" is reserved. Choose a different id.`);
|
|
192
|
+
if (this._findTemplate(id)) throw new Error(`Duplicate template id "${id}".`);
|
|
193
|
+
const tb = createTemplateBuilder();
|
|
194
|
+
configure(tb);
|
|
195
|
+
this._templates.push(tb._build(id, this._form.registry));
|
|
196
|
+
}
|
|
197
|
+
_removeTemplate(templateId) {
|
|
198
|
+
if (!this.isTemplated) throw new Error(`Object field "${this.config.name}" is not templated; templates.remove() requires the field to be defined with .template().`);
|
|
199
|
+
const index = this._templates.findIndex((t)=>t.id === templateId);
|
|
200
|
+
if (-1 === index) return;
|
|
201
|
+
this._templates.splice(index, 1);
|
|
394
202
|
if (this.config.isList) {
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
}
|
|
203
|
+
this._items = this._items.filter((item)=>item.templateId !== templateId);
|
|
204
|
+
return;
|
|
398
205
|
}
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
const built = builder.build(name);
|
|
403
|
-
const newField = createFieldFromConfig(built, this._form, this.qualifiedName);
|
|
404
|
-
this._children.set(name, newField);
|
|
405
|
-
if (this.config.isList) {
|
|
406
|
-
for (const item of this._items) {
|
|
407
|
-
const itemField = createFieldFromConfig(built, this._form, this.qualifiedName);
|
|
408
|
-
item.children.set(name, itemField);
|
|
206
|
+
if (this._activeTemplateId === templateId) {
|
|
207
|
+
this._activeTemplateId = null;
|
|
208
|
+
this._children = new Map();
|
|
409
209
|
}
|
|
410
|
-
}
|
|
411
210
|
}
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
211
|
+
setInnerLayout(layout) {
|
|
212
|
+
if (Array.isArray(layout)) {
|
|
213
|
+
if (this.isTemplated) throw new Error(`Object field "${this.config.name}" is templated; layout.object() must pass a per-template map (Record<templateId, LayoutNode[]>), not a single LayoutNode[].`);
|
|
214
|
+
this._ownLayout = layout;
|
|
215
|
+
this._templateLayouts = {};
|
|
216
|
+
this._applyNestedObjectLayouts(layout, this._children);
|
|
217
|
+
for (const item of this._items)this._applyNestedObjectLayouts(layout, item.children);
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
if (!this.isTemplated) throw new Error(`Object field "${this.config.name}" is not templated; layout.object() must pass a single LayoutNode[], not a per-template map.`);
|
|
221
|
+
this._templateLayouts = layout;
|
|
222
|
+
this._ownLayout = null;
|
|
223
|
+
if (this._activeTemplateId && layout[this._activeTemplateId]) this._applyNestedObjectLayouts(layout[this._activeTemplateId], this._children);
|
|
224
|
+
for (const item of this._items)if (item.templateId && layout[item.templateId]) this._applyNestedObjectLayouts(layout[item.templateId], item.children);
|
|
225
|
+
}
|
|
226
|
+
_applyNestedObjectLayouts(layout, children) {
|
|
227
|
+
for (const node of layout)if ("object" === node.type) {
|
|
228
|
+
const child = children.get(node.fieldName);
|
|
229
|
+
if (child && isObjectField(child)) child.setInnerLayout(node.inner);
|
|
230
|
+
} else if ("tabs" === node.type) for (const tab of node.tabs)this._applyNestedObjectLayouts(tab.layout, children);
|
|
231
|
+
}
|
|
232
|
+
_innerLayoutFor(templateId) {
|
|
233
|
+
if (this.isTemplated) {
|
|
234
|
+
if (void 0 === templateId) return;
|
|
235
|
+
return this._templateLayouts[templateId];
|
|
236
|
+
}
|
|
237
|
+
return this._ownLayout ?? void 0;
|
|
238
|
+
}
|
|
239
|
+
_resolveLayoutForChildren(children, templateId) {
|
|
240
|
+
const layoutNodes = this.isTemplated ? null !== templateId ? this._templateLayouts[templateId] : void 0 : this._ownLayout ?? void 0;
|
|
241
|
+
if (layoutNodes && this._form?.resolveChildLayout) return this._form.resolveChildLayout(layoutNodes, children);
|
|
242
|
+
const fallback = [];
|
|
243
|
+
for (const [, field] of children)if (field.visible) fallback.push({
|
|
244
|
+
type: "row",
|
|
245
|
+
fields: [
|
|
246
|
+
field.vm
|
|
247
|
+
]
|
|
248
|
+
});
|
|
249
|
+
return fallback;
|
|
250
|
+
}
|
|
251
|
+
get children() {
|
|
252
|
+
return this._children;
|
|
253
|
+
}
|
|
254
|
+
get items() {
|
|
255
|
+
return this._items.map((item)=>({
|
|
256
|
+
key: item.key,
|
|
257
|
+
children: item.children,
|
|
258
|
+
templateId: item.templateId,
|
|
259
|
+
getData: ()=>this._getItemData(item)
|
|
260
|
+
}));
|
|
261
|
+
}
|
|
262
|
+
_getItemData(item) {
|
|
263
|
+
const data = getChildrenData(item.children);
|
|
264
|
+
if (void 0 !== item.templateId) return {
|
|
265
|
+
[TEMPLATE_DISCRIMINATOR]: item.templateId,
|
|
266
|
+
...data
|
|
267
|
+
};
|
|
268
|
+
return data;
|
|
269
|
+
}
|
|
270
|
+
getChild(name) {
|
|
271
|
+
return this._children.get(name);
|
|
272
|
+
}
|
|
273
|
+
fields(factory) {
|
|
274
|
+
if (this.isTemplated) throw new Error(`Object field "${this.config.name}" is templated; use templates.add()/remove() to manage children. Each template owns its own fields.`);
|
|
275
|
+
const builders = factory(this._form.registry);
|
|
276
|
+
for (const [name, builder] of Object.entries(builders)){
|
|
277
|
+
if (void 0 === builder) {
|
|
278
|
+
this._children.delete(name);
|
|
279
|
+
this.config.childBuilders[name] = void 0;
|
|
280
|
+
delete this.config.childBuilders[name];
|
|
281
|
+
if (this.config.isList) for (const item of this._items)item.children.delete(name);
|
|
282
|
+
continue;
|
|
460
283
|
}
|
|
461
|
-
|
|
462
|
-
|
|
284
|
+
this.config.childBuilders[name] = builder;
|
|
285
|
+
const built = builder.build(name);
|
|
286
|
+
const newField = createFieldFromConfig(built, this._form, this.qualifiedName);
|
|
287
|
+
this._children.set(name, newField);
|
|
288
|
+
if (this.config.isList) for (const item of this._items){
|
|
289
|
+
const itemField = createFieldFromConfig(built, this._form, this.qualifiedName);
|
|
290
|
+
item.children.set(name, itemField);
|
|
463
291
|
}
|
|
464
|
-
const {
|
|
465
|
-
[TEMPLATE_DISCRIMINATOR]: _discarded,
|
|
466
|
-
...rest
|
|
467
|
-
} = data;
|
|
468
|
-
this._addItemInternal(rest, templateId);
|
|
469
|
-
} else {
|
|
470
|
-
this._addItemInternal(itemData);
|
|
471
|
-
}
|
|
472
292
|
}
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
if (this.isTemplated) {
|
|
477
|
-
if (value === null || value === undefined) {
|
|
478
|
-
this._activeTemplateId = null;
|
|
479
|
-
this._children = new Map();
|
|
480
|
-
return;
|
|
481
|
-
}
|
|
482
|
-
const data = value;
|
|
483
|
-
const templateId = data[TEMPLATE_DISCRIMINATOR];
|
|
484
|
-
if (typeof templateId !== "string") {
|
|
485
|
-
return;
|
|
486
|
-
}
|
|
487
|
-
if (!this._findTemplate(templateId)) {
|
|
488
|
-
return;
|
|
489
|
-
}
|
|
490
|
-
this._rebuildChildrenForTemplate(templateId);
|
|
491
|
-
const {
|
|
492
|
-
[TEMPLATE_DISCRIMINATOR]: _discarded,
|
|
493
|
-
...rest
|
|
494
|
-
} = data;
|
|
495
|
-
hydrateChildren(this._children, rest);
|
|
496
|
-
return;
|
|
497
|
-
}
|
|
498
|
-
hydrateChildren(this._children, value);
|
|
499
|
-
}
|
|
500
|
-
addItem(templateIdOrData, data) {
|
|
501
|
-
if (this.isTemplated) {
|
|
502
|
-
if (typeof templateIdOrData !== "string") {
|
|
503
|
-
throw new Error(`Object field "${this.config.name}": templated list items require a template id. ` + `Call addItem(templateId) with one of: ${this._templates.map(t => t.id).join(", ")}.`);
|
|
504
|
-
}
|
|
505
|
-
if (!this._findTemplate(templateIdOrData)) {
|
|
506
|
-
throw new Error(`Template "${templateIdOrData}" not found on field "${this.config.name}". ` + `Available: ${this._templates.map(t => t.id).join(", ") || "(none)"}.`);
|
|
507
|
-
}
|
|
508
|
-
this._addItemInternal(data, templateIdOrData);
|
|
509
|
-
return;
|
|
510
|
-
}
|
|
511
|
-
if (typeof templateIdOrData === "string") {
|
|
512
|
-
throw new Error(`Object field "${this.config.name}" is not templated; addItem() does not accept a template id.`);
|
|
513
|
-
}
|
|
514
|
-
this._addItemInternal(templateIdOrData);
|
|
515
|
-
}
|
|
516
|
-
removeItem(index) {
|
|
517
|
-
this._items.splice(index, 1);
|
|
518
|
-
}
|
|
519
|
-
moveItem(fromIndex, toIndex) {
|
|
520
|
-
if (fromIndex < 0 || fromIndex >= this._items.length || toIndex < 0 || toIndex >= this._items.length || fromIndex === toIndex) {
|
|
521
|
-
return;
|
|
522
|
-
}
|
|
523
|
-
const [item] = this._items.splice(fromIndex, 1);
|
|
524
|
-
this._items.splice(toIndex, 0, item);
|
|
525
|
-
}
|
|
526
|
-
duplicateItem(index) {
|
|
527
|
-
const source = this._items[index];
|
|
528
|
-
if (!source) {
|
|
529
|
-
return;
|
|
530
|
-
}
|
|
531
|
-
const data = getChildrenData(source.children);
|
|
532
|
-
const children = createChildFields(this._templateChildBuilders(source.templateId), this._form, this.qualifiedName);
|
|
533
|
-
hydrateChildren(children, data, {
|
|
534
|
-
clone: true
|
|
535
|
-
});
|
|
536
|
-
const key = `item_${++itemKeyCounter}`;
|
|
537
|
-
this._items.splice(index + 1, 0, {
|
|
538
|
-
key,
|
|
539
|
-
children,
|
|
540
|
-
templateId: source.templateId
|
|
541
|
-
});
|
|
542
|
-
const inner = this._innerLayoutFor(source.templateId);
|
|
543
|
-
if (inner) {
|
|
544
|
-
this._applyNestedObjectLayouts(inner, children);
|
|
545
|
-
}
|
|
546
|
-
}
|
|
547
|
-
_templateChildBuilders(templateId) {
|
|
548
|
-
if (templateId === undefined) {
|
|
549
|
-
return this.config.childBuilders;
|
|
550
|
-
}
|
|
551
|
-
const template = this._findTemplate(templateId);
|
|
552
|
-
if (!template) {
|
|
553
|
-
throw new Error(`Template "${templateId}" not found on field "${this.config.name}".`);
|
|
554
|
-
}
|
|
555
|
-
return template.childBuilders;
|
|
556
|
-
}
|
|
557
|
-
_addItemInternal(data, templateId) {
|
|
558
|
-
const children = createChildFields(this._templateChildBuilders(templateId), this._form, this.qualifiedName);
|
|
559
|
-
if (data) {
|
|
560
|
-
hydrateChildren(children, data);
|
|
561
|
-
}
|
|
562
|
-
const key = `item_${++itemKeyCounter}`;
|
|
563
|
-
this._items.push({
|
|
564
|
-
key,
|
|
565
|
-
children,
|
|
566
|
-
templateId
|
|
567
|
-
});
|
|
568
|
-
const inner = this._innerLayoutFor(templateId);
|
|
569
|
-
if (inner) {
|
|
570
|
-
this._applyNestedObjectLayouts(inner, children);
|
|
571
|
-
}
|
|
572
|
-
}
|
|
573
|
-
resetValidation() {
|
|
574
|
-
this._base.resetValidation();
|
|
575
|
-
for (const [, field] of this._children) {
|
|
576
|
-
field.resetValidation();
|
|
577
|
-
}
|
|
578
|
-
for (const item of this._items) {
|
|
579
|
-
for (const [, field] of item.children) {
|
|
580
|
-
field.resetValidation();
|
|
581
|
-
}
|
|
582
|
-
}
|
|
583
|
-
}
|
|
584
|
-
as(type) {
|
|
585
|
-
if (type !== "object") {
|
|
586
|
-
throw new Error(`Field "${this.config.name}" is type "object", not "${type}".`);
|
|
587
|
-
}
|
|
588
|
-
return this;
|
|
589
|
-
}
|
|
590
|
-
get vm() {
|
|
591
|
-
const baseVm = this._base.vm;
|
|
592
|
-
return {
|
|
593
|
-
name: baseVm.name,
|
|
594
|
-
type: "object",
|
|
595
|
-
label: baseVm.label,
|
|
596
|
-
help: baseVm.help,
|
|
597
|
-
description: baseVm.description,
|
|
598
|
-
note: baseVm.note,
|
|
599
|
-
placeholder: baseVm.placeholder,
|
|
600
|
-
value: this.getValue(),
|
|
601
|
-
validation: baseVm.validation,
|
|
602
|
-
validating: this._validating,
|
|
603
|
-
required: baseVm.required,
|
|
604
|
-
visible: baseVm.visible,
|
|
605
|
-
disabled: baseVm.disabled,
|
|
606
|
-
renderer: baseVm.renderer,
|
|
607
|
-
rendererSettings: baseVm.rendererSettings,
|
|
608
|
-
onChange: value => this.setValue(value),
|
|
609
|
-
onBlur: () => {
|
|
610
|
-
if (this._form?.submitted) {
|
|
611
|
-
void this.validate();
|
|
293
|
+
if (this._ownLayout) {
|
|
294
|
+
this._applyNestedObjectLayouts(this._ownLayout, this._children);
|
|
295
|
+
for (const item of this._items)this._applyNestedObjectLayouts(this._ownLayout, item.children);
|
|
612
296
|
}
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
moveUp: () => this.moveItem(index, index - 1),
|
|
627
|
-
moveDown: () => this.moveItem(index, index + 1),
|
|
628
|
-
duplicate: () => this.duplicateItem(index)
|
|
629
|
-
})) : [],
|
|
630
|
-
addItem: value => {
|
|
631
|
-
return value !== undefined ? this.addItem(value) : this.addItem();
|
|
632
|
-
},
|
|
633
|
-
removeItem: index => this.removeItem(index),
|
|
634
|
-
moveItem: (from, to) => this.moveItem(from, to),
|
|
635
|
-
duplicateItem: index => this.duplicateItem(index),
|
|
636
|
-
isTemplated: this.isTemplated,
|
|
637
|
-
availableTemplates: this.availableTemplates,
|
|
638
|
-
activeTemplateId: this._activeTemplateId,
|
|
639
|
-
setTemplate: templateId => this.setTemplate(templateId)
|
|
640
|
-
};
|
|
641
|
-
}
|
|
642
|
-
get hasErrors() {
|
|
643
|
-
const checkChildren = children => {
|
|
644
|
-
for (const [, field] of children) {
|
|
645
|
-
if (field.vm.validation.isValid === false) {
|
|
646
|
-
return true;
|
|
297
|
+
}
|
|
298
|
+
getListItemChild(index, name) {
|
|
299
|
+
const item = this._items[index];
|
|
300
|
+
return item?.children.get(name);
|
|
301
|
+
}
|
|
302
|
+
getData() {
|
|
303
|
+
if (this.config.isList) return this._items.map((item)=>this._getItemData(item));
|
|
304
|
+
if (this.isTemplated) {
|
|
305
|
+
if (null === this._activeTemplateId) return null;
|
|
306
|
+
return {
|
|
307
|
+
[TEMPLATE_DISCRIMINATOR]: this._activeTemplateId,
|
|
308
|
+
...getChildrenData(this._children)
|
|
309
|
+
};
|
|
647
310
|
}
|
|
648
|
-
|
|
649
|
-
|
|
311
|
+
return getChildrenData(this._children);
|
|
312
|
+
}
|
|
313
|
+
getValue() {
|
|
314
|
+
return this.getData();
|
|
315
|
+
}
|
|
316
|
+
setValue(value) {
|
|
317
|
+
this.setValueSilent(value);
|
|
318
|
+
}
|
|
319
|
+
setValueSilent(value) {
|
|
320
|
+
if (this.config.isList) {
|
|
321
|
+
this._items = [];
|
|
322
|
+
if (Array.isArray(value)) for (const itemData of value)if (this.isTemplated) {
|
|
323
|
+
if (!itemData || "object" != typeof itemData) continue;
|
|
324
|
+
const data = itemData;
|
|
325
|
+
const templateId = data[TEMPLATE_DISCRIMINATOR];
|
|
326
|
+
if ("string" != typeof templateId) continue;
|
|
327
|
+
if (!this._findTemplate(templateId)) continue;
|
|
328
|
+
const { [TEMPLATE_DISCRIMINATOR]: _discarded, ...rest } = data;
|
|
329
|
+
this._addItemInternal(rest, templateId);
|
|
330
|
+
} else this._addItemInternal(itemData);
|
|
331
|
+
return;
|
|
650
332
|
}
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
333
|
+
if (this.isTemplated) {
|
|
334
|
+
if (null == value) {
|
|
335
|
+
this._activeTemplateId = null;
|
|
336
|
+
this._children = new Map();
|
|
337
|
+
return;
|
|
338
|
+
}
|
|
339
|
+
const data = value;
|
|
340
|
+
const templateId = data[TEMPLATE_DISCRIMINATOR];
|
|
341
|
+
if ("string" != typeof templateId) return;
|
|
342
|
+
if (!this._findTemplate(templateId)) return;
|
|
343
|
+
this._rebuildChildrenForTemplate(templateId);
|
|
344
|
+
const { [TEMPLATE_DISCRIMINATOR]: _discarded, ...rest } = data;
|
|
345
|
+
hydrateChildren(this._children, rest);
|
|
346
|
+
return;
|
|
658
347
|
}
|
|
659
|
-
|
|
660
|
-
}
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
async validate(options) {
|
|
668
|
-
if (!this.visible) {
|
|
669
|
-
this.setValidation({
|
|
670
|
-
isValid: null
|
|
671
|
-
});
|
|
672
|
-
return true;
|
|
673
|
-
}
|
|
674
|
-
runInAction(() => {
|
|
675
|
-
this._validating = true;
|
|
676
|
-
});
|
|
677
|
-
try {
|
|
678
|
-
const requiredState = this._base.resolveRequired();
|
|
679
|
-
if (requiredState.required) {
|
|
680
|
-
const message = requiredState.message || "This field is required.";
|
|
681
|
-
if (this.config.isList && this._items.length === 0) {
|
|
682
|
-
this.setValidation({
|
|
683
|
-
isValid: false,
|
|
684
|
-
message
|
|
685
|
-
});
|
|
686
|
-
return false;
|
|
348
|
+
hydrateChildren(this._children, value);
|
|
349
|
+
}
|
|
350
|
+
addItem(templateIdOrData, data) {
|
|
351
|
+
if (this.isTemplated) {
|
|
352
|
+
if ("string" != typeof templateIdOrData) throw new Error(`Object field "${this.config.name}": templated list items require a template id. Call addItem(templateId) with one of: ${this._templates.map((t)=>t.id).join(", ")}.`);
|
|
353
|
+
if (!this._findTemplate(templateIdOrData)) throw new Error(`Template "${templateIdOrData}" not found on field "${this.config.name}". Available: ${this._templates.map((t)=>t.id).join(", ") || "(none)"}.`);
|
|
354
|
+
this._addItemInternal(data, templateIdOrData);
|
|
355
|
+
return;
|
|
687
356
|
}
|
|
688
|
-
if (
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
357
|
+
if ("string" == typeof templateIdOrData) throw new Error(`Object field "${this.config.name}" is not templated; addItem() does not accept a template id.`);
|
|
358
|
+
this._addItemInternal(templateIdOrData);
|
|
359
|
+
}
|
|
360
|
+
removeItem(index) {
|
|
361
|
+
this._items.splice(index, 1);
|
|
362
|
+
}
|
|
363
|
+
moveItem(fromIndex, toIndex) {
|
|
364
|
+
if (fromIndex < 0 || fromIndex >= this._items.length || toIndex < 0 || toIndex >= this._items.length || fromIndex === toIndex) return;
|
|
365
|
+
const [item] = this._items.splice(fromIndex, 1);
|
|
366
|
+
this._items.splice(toIndex, 0, item);
|
|
367
|
+
}
|
|
368
|
+
duplicateItem(index) {
|
|
369
|
+
const source = this._items[index];
|
|
370
|
+
if (!source) return;
|
|
371
|
+
const data = getChildrenData(source.children);
|
|
372
|
+
const children = createChildFields(this._templateChildBuilders(source.templateId), this._form, this.qualifiedName);
|
|
373
|
+
hydrateChildren(children, data, {
|
|
374
|
+
clone: true
|
|
375
|
+
});
|
|
376
|
+
const key = `item_${++itemKeyCounter}`;
|
|
377
|
+
this._items.splice(index + 1, 0, {
|
|
378
|
+
key,
|
|
379
|
+
children,
|
|
380
|
+
templateId: source.templateId
|
|
381
|
+
});
|
|
382
|
+
const inner = this._innerLayoutFor(source.templateId);
|
|
383
|
+
if (inner) this._applyNestedObjectLayouts(inner, children);
|
|
384
|
+
}
|
|
385
|
+
_templateChildBuilders(templateId) {
|
|
386
|
+
if (void 0 === templateId) return this.config.childBuilders;
|
|
387
|
+
const template = this._findTemplate(templateId);
|
|
388
|
+
if (!template) throw new Error(`Template "${templateId}" not found on field "${this.config.name}".`);
|
|
389
|
+
return template.childBuilders;
|
|
390
|
+
}
|
|
391
|
+
_addItemInternal(data, templateId) {
|
|
392
|
+
const children = createChildFields(this._templateChildBuilders(templateId), this._form, this.qualifiedName);
|
|
393
|
+
if (data) hydrateChildren(children, data);
|
|
394
|
+
const key = `item_${++itemKeyCounter}`;
|
|
395
|
+
this._items.push({
|
|
396
|
+
key,
|
|
397
|
+
children,
|
|
398
|
+
templateId
|
|
399
|
+
});
|
|
400
|
+
const inner = this._innerLayoutFor(templateId);
|
|
401
|
+
if (inner) this._applyNestedObjectLayouts(inner, children);
|
|
402
|
+
}
|
|
403
|
+
resetValidation() {
|
|
404
|
+
this._base.resetValidation();
|
|
405
|
+
for (const [, field] of this._children)field.resetValidation();
|
|
406
|
+
for (const item of this._items)for (const [, field] of item.children)field.resetValidation();
|
|
407
|
+
}
|
|
408
|
+
as(type) {
|
|
409
|
+
if ("object" !== type) throw new Error(`Field "${this.config.name}" is type "object", not "${type}".`);
|
|
410
|
+
return this;
|
|
411
|
+
}
|
|
412
|
+
get vm() {
|
|
413
|
+
const baseVm = this._base.vm;
|
|
414
|
+
return {
|
|
415
|
+
name: baseVm.name,
|
|
416
|
+
type: "object",
|
|
417
|
+
label: baseVm.label,
|
|
418
|
+
help: baseVm.help,
|
|
419
|
+
description: baseVm.description,
|
|
420
|
+
note: baseVm.note,
|
|
421
|
+
placeholder: baseVm.placeholder,
|
|
422
|
+
value: this.getValue(),
|
|
423
|
+
validation: baseVm.validation,
|
|
424
|
+
validating: this._validating,
|
|
425
|
+
required: baseVm.required,
|
|
426
|
+
visible: baseVm.visible,
|
|
427
|
+
disabled: baseVm.disabled,
|
|
428
|
+
renderer: baseVm.renderer,
|
|
429
|
+
rendererSettings: baseVm.rendererSettings,
|
|
430
|
+
onChange: (value)=>this.setValue(value),
|
|
431
|
+
onBlur: ()=>{
|
|
432
|
+
if (this._form?.submitted) this.validate();
|
|
433
|
+
this.blur();
|
|
434
|
+
},
|
|
435
|
+
focusRequested: baseVm.focusRequested,
|
|
436
|
+
clearFocusRequest: baseVm.clearFocusRequest,
|
|
437
|
+
isList: this.config.isList,
|
|
438
|
+
fields: this.config.isList ? [] : Array.from(this._children.values()).filter((f)=>f.visible).map((f)=>f.vm),
|
|
439
|
+
layout: this.config.isList ? [] : this._resolveLayoutForChildren(this._children, this._activeTemplateId),
|
|
440
|
+
items: this.config.isList ? this._items.map((item, index)=>({
|
|
441
|
+
key: item.key,
|
|
442
|
+
fields: Array.from(item.children.values()).filter((f)=>f.visible).map((f)=>f.vm),
|
|
443
|
+
layout: this._resolveLayoutForChildren(item.children, item.templateId ?? null),
|
|
444
|
+
templateId: item.templateId,
|
|
445
|
+
remove: ()=>this.removeItem(index),
|
|
446
|
+
moveUp: ()=>this.moveItem(index, index - 1),
|
|
447
|
+
moveDown: ()=>this.moveItem(index, index + 1),
|
|
448
|
+
duplicate: ()=>this.duplicateItem(index)
|
|
449
|
+
})) : [],
|
|
450
|
+
addItem: (value)=>void 0 !== value ? this.addItem(value) : this.addItem(),
|
|
451
|
+
removeItem: (index)=>this.removeItem(index),
|
|
452
|
+
moveItem: (from, to)=>this.moveItem(from, to),
|
|
453
|
+
duplicateItem: (index)=>this.duplicateItem(index),
|
|
454
|
+
isTemplated: this.isTemplated,
|
|
455
|
+
availableTemplates: this.availableTemplates,
|
|
456
|
+
activeTemplateId: this._activeTemplateId,
|
|
457
|
+
setTemplate: (templateId)=>this.setTemplate(templateId)
|
|
458
|
+
};
|
|
459
|
+
}
|
|
460
|
+
get hasErrors() {
|
|
461
|
+
const checkChildren = (children)=>{
|
|
462
|
+
for (const [, field] of children){
|
|
463
|
+
if (false === field.vm.validation.isValid) return true;
|
|
464
|
+
if (isObjectField(field) && field.hasErrors) return true;
|
|
706
465
|
}
|
|
707
|
-
|
|
708
|
-
}
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
466
|
+
return false;
|
|
467
|
+
};
|
|
468
|
+
if (this.config.isList) {
|
|
469
|
+
for (const item of this._items)if (checkChildren(item.children)) return true;
|
|
470
|
+
} else if (checkChildren(this._children)) return true;
|
|
471
|
+
return false;
|
|
472
|
+
}
|
|
473
|
+
async validate(options) {
|
|
474
|
+
if (!this.visible) {
|
|
716
475
|
this.setValidation({
|
|
717
|
-
|
|
718
|
-
message: firstIssue?.message || "Invalid value."
|
|
476
|
+
isValid: null
|
|
719
477
|
});
|
|
720
|
-
|
|
721
|
-
return false;
|
|
478
|
+
return true;
|
|
722
479
|
}
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
480
|
+
runInAction(()=>{
|
|
481
|
+
this._validating = true;
|
|
482
|
+
});
|
|
483
|
+
try {
|
|
484
|
+
const requiredState = this._base.resolveRequired();
|
|
485
|
+
if (requiredState.required) {
|
|
486
|
+
const message = requiredState.message || "This field is required.";
|
|
487
|
+
if (this.config.isList && 0 === this._items.length) {
|
|
488
|
+
this.setValidation({
|
|
489
|
+
isValid: false,
|
|
490
|
+
message
|
|
491
|
+
});
|
|
492
|
+
return false;
|
|
493
|
+
}
|
|
494
|
+
if (!this.config.isList) if (this.isTemplated) {
|
|
495
|
+
if (null === this._activeTemplateId) {
|
|
496
|
+
this.setValidation({
|
|
497
|
+
isValid: false,
|
|
498
|
+
message
|
|
499
|
+
});
|
|
500
|
+
return false;
|
|
501
|
+
}
|
|
502
|
+
} else {
|
|
503
|
+
const data = this.getData();
|
|
504
|
+
const hasAnyValue = Object.values(data).some((v)=>null != v && "" !== v);
|
|
505
|
+
if (!hasAnyValue) {
|
|
506
|
+
this.setValidation({
|
|
507
|
+
isValid: false,
|
|
508
|
+
message
|
|
509
|
+
});
|
|
510
|
+
return false;
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
if (this.config.isList && this.config.listSchema) {
|
|
515
|
+
const listData = this.getData();
|
|
516
|
+
const result = await this.config.listSchema.safeParseAsync(listData);
|
|
517
|
+
if (!result.success) {
|
|
518
|
+
const firstIssue = result.error.issues[0];
|
|
519
|
+
runInAction(()=>{
|
|
520
|
+
this.setValidation({
|
|
521
|
+
isValid: false,
|
|
522
|
+
message: firstIssue?.message || "Invalid value."
|
|
523
|
+
});
|
|
524
|
+
});
|
|
525
|
+
return false;
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
if (this.config.schema) {
|
|
529
|
+
const data = this.getData();
|
|
530
|
+
const result = await this.config.schema.safeParseAsync(data);
|
|
531
|
+
if (!result.success) {
|
|
532
|
+
const firstIssue = result.error.issues[0];
|
|
533
|
+
runInAction(()=>{
|
|
534
|
+
this.setValidation({
|
|
535
|
+
isValid: false,
|
|
536
|
+
message: firstIssue?.message || "Invalid value."
|
|
537
|
+
});
|
|
538
|
+
});
|
|
539
|
+
return false;
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
let allValid = true;
|
|
543
|
+
if (this.config.isList) for (const item of this._items){
|
|
544
|
+
const valid = await validateChildren(item.children, options);
|
|
545
|
+
if (!valid) allValid = false;
|
|
546
|
+
}
|
|
547
|
+
else allValid = await validateChildren(this._children, options);
|
|
548
|
+
runInAction(()=>{
|
|
549
|
+
this.setValidation({
|
|
550
|
+
isValid: allValid
|
|
551
|
+
});
|
|
552
|
+
});
|
|
553
|
+
return allValid;
|
|
554
|
+
} finally{
|
|
555
|
+
runInAction(()=>{
|
|
556
|
+
this._validating = false;
|
|
733
557
|
});
|
|
734
|
-
});
|
|
735
|
-
return false;
|
|
736
|
-
}
|
|
737
|
-
}
|
|
738
|
-
let allValid = true;
|
|
739
|
-
if (this.config.isList) {
|
|
740
|
-
for (const item of this._items) {
|
|
741
|
-
const valid = await validateChildren(item.children, options);
|
|
742
|
-
if (!valid) {
|
|
743
|
-
allValid = false;
|
|
744
|
-
}
|
|
745
558
|
}
|
|
746
|
-
} else {
|
|
747
|
-
allValid = await validateChildren(this._children, options);
|
|
748
|
-
}
|
|
749
|
-
runInAction(() => {
|
|
750
|
-
this.setValidation({
|
|
751
|
-
isValid: allValid
|
|
752
|
-
});
|
|
753
|
-
});
|
|
754
|
-
return allValid;
|
|
755
|
-
} finally {
|
|
756
|
-
runInAction(() => {
|
|
757
|
-
this._validating = false;
|
|
758
|
-
});
|
|
759
559
|
}
|
|
760
|
-
}
|
|
761
560
|
}
|
|
561
|
+
export { ObjectField, TEMPLATE_DISCRIMINATOR, isObjectField };
|
|
762
562
|
|
|
763
563
|
//# sourceMappingURL=ObjectField.js.map
|