@webiny/app-admin 6.6.0-alpha.1 → 6.6.0-alpha.10
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/base/Admin.js +19 -2
- package/base/Admin.js.map +1 -1
- package/base/Base/DefaultFieldRenderers.js +4 -0
- package/base/Base/DefaultFieldRenderers.js.map +1 -1
- package/base/Base/FieldRenderers/AutoCompleteRenderer.js +1 -0
- package/base/Base/FieldRenderers/AutoCompleteRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/BirthdayInputRenderer.d.ts +21 -0
- package/base/Base/FieldRenderers/BirthdayInputRenderer.js +39 -0
- package/base/Base/FieldRenderers/BirthdayInputRenderer.js.map +1 -0
- package/base/Base/FieldRenderers/BirthdayInputRenderer.test.d.ts +1 -0
- package/base/Base/FieldRenderers/BirthdayInputRenderer.test.js +123 -0
- package/base/Base/FieldRenderers/BirthdayInputRenderer.test.js.map +1 -0
- package/base/Base/FieldRenderers/ObjectRenderer/MultiValueDynamicZone/MultiValueDynamicZone.js +21 -4
- package/base/Base/FieldRenderers/ObjectRenderer/MultiValueDynamicZone/MultiValueDynamicZone.js.map +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/ObjectAccordionMultipleRenderer.js +11 -2
- package/base/Base/FieldRenderers/ObjectRenderer/ObjectAccordionMultipleRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/ObjectFieldComponents.d.ts +2 -0
- package/base/Base/FieldRenderers/ObjectRenderer/ObjectFieldComponents.js +14 -5
- package/base/Base/FieldRenderers/ObjectRenderer/ObjectFieldComponents.js.map +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/ObjectRenderer.js +16 -25
- package/base/Base/FieldRenderers/ObjectRenderer/ObjectRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/SingleValueDynamicZone.js +18 -3
- package/base/Base/FieldRenderers/ObjectRenderer/SingleValueDynamicZone.js.map +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/{TemplatePicker.d.ts → TemplatePicker/AddTemplateButton.d.ts} +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/AddTemplateButton.js +24 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/AddTemplateButton.js.map +1 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/SelectableTemplate.d.ts +13 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/SelectableTemplate.js +21 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/SelectableTemplate.js.map +1 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateCard.d.ts +3 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateCard.js +35 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateCard.js.map +1 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateGallery.d.ts +8 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateGallery.js +22 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateGallery.js.map +1 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateGalleryToolbar.d.ts +10 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateGalleryToolbar.js +52 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateGalleryToolbar.js.map +1 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateIcon.d.ts +8 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateIcon.js +16 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateIcon.js.map +1 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateList.d.ts +10 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateList.js +22 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateList.js.map +1 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateListItem.d.ts +3 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateListItem.js +35 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/TemplateListItem.js.map +1 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/index.d.ts +1 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/index.js +1 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/types.d.ts +6 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker/types.js +0 -0
- package/base/Base/FieldRenderers/ObjectRenderer/resolveItemTitle.d.ts +8 -3
- package/base/Base/FieldRenderers/ObjectRenderer/resolveItemTitle.js +25 -17
- package/base/Base/FieldRenderers/ObjectRenderer/resolveItemTitle.js.map +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/resolveItemTitle.test.d.ts +1 -0
- package/base/Base/FieldRenderers/ObjectRenderer/resolveItemTitle.test.js +106 -0
- package/base/Base/FieldRenderers/ObjectRenderer/resolveItemTitle.test.js.map +1 -0
- package/base/Base/FieldRenderers/RadioButtonsRenderer.js +3 -2
- package/base/Base/FieldRenderers/RadioButtonsRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/SelectRenderer.js +4 -2
- package/base/Base/FieldRenderers/SelectRenderer.js.map +1 -1
- package/base/Base.js +2 -1
- package/base/Base.js.map +1 -1
- package/base/createRootContainer.js +4 -0
- package/base/createRootContainer.js.map +1 -1
- package/base/resolveApiUrl.d.ts +10 -0
- package/base/resolveApiUrl.js +11 -3
- package/base/resolveApiUrl.js.map +1 -1
- package/base/ui/AssumedPermissionsSelector.d.ts +47 -0
- package/base/ui/AssumedPermissionsSelector.js +7 -0
- package/base/ui/AssumedPermissionsSelector.js.map +1 -0
- package/base/ui/DebuggerIndicator.d.ts +23 -0
- package/base/ui/DebuggerIndicator.js +5 -0
- package/base/ui/DebuggerIndicator.js.map +1 -0
- package/base/ui/Layout.d.ts +20 -0
- package/base/ui/Layout.js +2 -1
- package/base/ui/Layout.js.map +1 -1
- package/components/DeveloperMode/DeveloperMode.d.ts +1 -3
- package/components/DeveloperMode/DeveloperMode.js.map +1 -1
- package/components/Filters/Filters.js +7 -1
- package/components/Filters/Filters.js.map +1 -1
- package/components/IconPicker/IconPickerComponent.js +1 -1
- package/components/IconPicker/IconPickerComponent.js.map +1 -1
- package/components/SplitView/SplitView.d.ts +2 -2
- package/components/SplitView/SplitView.js +7 -7
- package/components/SplitView/SplitView.js.map +1 -1
- package/config/AdminConfig/Widget.d.ts +9 -1
- package/config/AdminConfig/Widget.js +6 -2
- package/config/AdminConfig/Widget.js.map +1 -1
- package/domain/Identity.js +1 -1
- package/domain/Identity.js.map +1 -1
- package/exports/admin/ui.d.ts +4 -0
- package/exports/admin/ui.js +4 -1
- package/exports/admin.d.ts +4 -0
- package/exports/admin.js +2 -0
- package/features/{aiChat/AiChatGateway.d.ts → adminAssistant/AdminAssistantGateway.d.ts} +7 -7
- package/features/{aiChat/AiChatGateway.js → adminAssistant/AdminAssistantGateway.js} +8 -8
- package/features/adminAssistant/AdminAssistantGateway.js.map +1 -0
- package/features/adminAssistant/AdminAssistantPresenter.d.ts +60 -0
- package/features/adminAssistant/AdminAssistantPresenter.js +377 -0
- package/features/adminAssistant/AdminAssistantPresenter.js.map +1 -0
- package/features/adminAssistant/abstractions.d.ts +176 -0
- package/features/adminAssistant/abstractions.js +6 -0
- package/features/adminAssistant/abstractions.js.map +1 -0
- package/features/adminAssistant/feature.d.ts +3 -0
- package/features/adminAssistant/feature.js +19 -0
- package/features/adminAssistant/feature.js.map +1 -0
- package/features/adminAssistant/index.d.ts +6 -0
- package/features/adminAssistant/index.js +3 -0
- package/features/adminAssistant/turnsFromMessages.d.ts +15 -0
- package/features/adminAssistant/turnsFromMessages.js +77 -0
- package/features/adminAssistant/turnsFromMessages.js.map +1 -0
- package/features/adminUsers/account/getCurrentUser/GetCurrentUserGateway.d.ts +11 -0
- package/features/adminUsers/account/getCurrentUser/GetCurrentUserGateway.js +44 -0
- package/features/adminUsers/account/getCurrentUser/GetCurrentUserGateway.js.map +1 -0
- package/features/adminUsers/account/getCurrentUser/GetCurrentUserUseCase.d.ts +10 -0
- package/features/adminUsers/account/getCurrentUser/GetCurrentUserUseCase.js +19 -0
- package/features/adminUsers/account/getCurrentUser/GetCurrentUserUseCase.js.map +1 -0
- package/features/adminUsers/account/getCurrentUser/abstractions/GetCurrentUserGateway.d.ts +16 -0
- package/features/adminUsers/account/getCurrentUser/abstractions/GetCurrentUserGateway.js +5 -0
- package/features/adminUsers/account/getCurrentUser/abstractions/GetCurrentUserGateway.js.map +1 -0
- package/features/adminUsers/account/getCurrentUser/abstractions/GetCurrentUserUseCase.d.ts +10 -0
- package/features/adminUsers/account/getCurrentUser/abstractions/GetCurrentUserUseCase.js +5 -0
- package/features/adminUsers/account/getCurrentUser/abstractions/GetCurrentUserUseCase.js.map +1 -0
- package/features/adminUsers/account/getCurrentUser/abstractions/index.d.ts +6 -0
- package/features/adminUsers/account/getCurrentUser/abstractions/index.js +2 -0
- package/features/adminUsers/account/getCurrentUser/feature.d.ts +3 -0
- package/features/adminUsers/account/getCurrentUser/feature.js +19 -0
- package/features/adminUsers/account/getCurrentUser/feature.js.map +1 -0
- package/features/adminUsers/account/getCurrentUser/index.d.ts +1 -0
- package/features/adminUsers/account/getCurrentUser/index.js +1 -0
- package/features/adminUsers/account/updateCurrentUser/UpdateCurrentUserGateway.d.ts +11 -0
- package/features/adminUsers/account/updateCurrentUser/UpdateCurrentUserGateway.js +48 -0
- package/features/adminUsers/account/updateCurrentUser/UpdateCurrentUserGateway.js.map +1 -0
- package/features/adminUsers/account/updateCurrentUser/UpdateCurrentUserUseCase.d.ts +10 -0
- package/features/adminUsers/account/updateCurrentUser/UpdateCurrentUserUseCase.js +19 -0
- package/features/adminUsers/account/updateCurrentUser/UpdateCurrentUserUseCase.js.map +1 -0
- package/features/adminUsers/account/updateCurrentUser/abstractions/UpdateCurrentUserGateway.d.ts +26 -0
- package/features/adminUsers/account/updateCurrentUser/abstractions/UpdateCurrentUserGateway.js +5 -0
- package/features/adminUsers/account/updateCurrentUser/abstractions/UpdateCurrentUserGateway.js.map +1 -0
- package/features/adminUsers/account/updateCurrentUser/abstractions/UpdateCurrentUserUseCase.d.ts +13 -0
- package/features/adminUsers/account/updateCurrentUser/abstractions/UpdateCurrentUserUseCase.js +5 -0
- package/features/adminUsers/account/updateCurrentUser/abstractions/UpdateCurrentUserUseCase.js.map +1 -0
- package/features/adminUsers/account/updateCurrentUser/abstractions/index.d.ts +8 -0
- package/features/adminUsers/account/updateCurrentUser/abstractions/index.js +2 -0
- package/features/adminUsers/account/updateCurrentUser/feature.d.ts +3 -0
- package/features/adminUsers/account/updateCurrentUser/feature.js +19 -0
- package/features/adminUsers/account/updateCurrentUser/feature.js.map +1 -0
- package/features/adminUsers/account/updateCurrentUser/index.d.ts +1 -0
- package/features/adminUsers/account/updateCurrentUser/index.js +1 -0
- package/features/adminUsers/passwordPolicy/RulesPasswordPolicy.d.ts +6 -0
- package/features/adminUsers/passwordPolicy/RulesPasswordPolicy.js +22 -0
- package/features/adminUsers/passwordPolicy/RulesPasswordPolicy.js.map +1 -0
- package/features/adminUsers/passwordPolicy/abstractions.d.ts +20 -0
- package/features/adminUsers/passwordPolicy/abstractions.js +5 -0
- package/features/adminUsers/passwordPolicy/abstractions.js.map +1 -0
- package/features/adminUsers/passwordPolicy/feature.d.ts +8 -0
- package/features/adminUsers/passwordPolicy/feature.js +18 -0
- package/features/adminUsers/passwordPolicy/feature.js.map +1 -0
- package/features/adminUsers/passwordPolicy/index.d.ts +3 -0
- package/features/adminUsers/passwordPolicy/index.js +3 -0
- package/features/adminUsers/passwordPolicy/readPasswordPolicyRules.d.ts +10 -0
- package/features/adminUsers/passwordPolicy/readPasswordPolicyRules.js +11 -0
- package/features/adminUsers/passwordPolicy/readPasswordPolicyRules.js.map +1 -0
- package/features/adminUsers/permissions/abstractions.d.ts +17 -0
- package/features/adminUsers/permissions/abstractions.js +6 -0
- package/features/adminUsers/permissions/abstractions.js.map +1 -0
- package/features/adminUsers/permissions/feature.d.ts +14 -0
- package/features/adminUsers/permissions/feature.js +7 -0
- package/features/adminUsers/permissions/feature.js.map +1 -0
- package/features/adminUsers/permissionsSchema.d.ts +10 -0
- package/features/adminUsers/permissionsSchema.js +18 -0
- package/features/adminUsers/permissionsSchema.js.map +1 -0
- package/features/adminUsers/users/createUser/CreateUserGateway.d.ts +11 -0
- package/features/adminUsers/users/createUser/CreateUserGateway.js +49 -0
- package/features/adminUsers/users/createUser/CreateUserGateway.js.map +1 -0
- package/features/adminUsers/users/createUser/CreateUserUseCase.d.ts +10 -0
- package/features/adminUsers/users/createUser/CreateUserUseCase.js +18 -0
- package/features/adminUsers/users/createUser/CreateUserUseCase.js.map +1 -0
- package/features/adminUsers/users/createUser/abstractions/CreateUserGateway.d.ts +21 -0
- package/features/adminUsers/users/createUser/abstractions/CreateUserGateway.js +5 -0
- package/features/adminUsers/users/createUser/abstractions/CreateUserGateway.js.map +1 -0
- package/features/adminUsers/users/createUser/abstractions/CreateUserUseCase.d.ts +14 -0
- package/features/adminUsers/users/createUser/abstractions/CreateUserUseCase.js +5 -0
- package/features/adminUsers/users/createUser/abstractions/CreateUserUseCase.js.map +1 -0
- package/features/adminUsers/users/createUser/abstractions/index.d.ts +2 -0
- package/features/adminUsers/users/createUser/abstractions/index.js +2 -0
- package/features/adminUsers/users/createUser/feature.d.ts +3 -0
- package/features/adminUsers/users/createUser/feature.js +19 -0
- package/features/adminUsers/users/createUser/feature.js.map +1 -0
- package/features/adminUsers/users/createUser/index.d.ts +2 -0
- package/features/adminUsers/users/createUser/index.js +2 -0
- package/features/adminUsers/users/deleteUser/DeleteUserGateway.d.ts +11 -0
- package/features/adminUsers/users/deleteUser/DeleteUserGateway.js +40 -0
- package/features/adminUsers/users/deleteUser/DeleteUserGateway.js.map +1 -0
- package/features/adminUsers/users/deleteUser/DeleteUserUseCase.d.ts +10 -0
- package/features/adminUsers/users/deleteUser/DeleteUserUseCase.js +18 -0
- package/features/adminUsers/users/deleteUser/DeleteUserUseCase.js.map +1 -0
- package/features/adminUsers/users/deleteUser/abstractions/DeleteUserGateway.d.ts +11 -0
- package/features/adminUsers/users/deleteUser/abstractions/DeleteUserGateway.js +5 -0
- package/features/adminUsers/users/deleteUser/abstractions/DeleteUserGateway.js.map +1 -0
- package/features/adminUsers/users/deleteUser/abstractions/DeleteUserUseCase.d.ts +11 -0
- package/features/adminUsers/users/deleteUser/abstractions/DeleteUserUseCase.js +5 -0
- package/features/adminUsers/users/deleteUser/abstractions/DeleteUserUseCase.js.map +1 -0
- package/features/adminUsers/users/deleteUser/abstractions/index.d.ts +2 -0
- package/features/adminUsers/users/deleteUser/abstractions/index.js +2 -0
- package/features/adminUsers/users/deleteUser/feature.d.ts +3 -0
- package/features/adminUsers/users/deleteUser/feature.js +19 -0
- package/features/adminUsers/users/deleteUser/feature.js.map +1 -0
- package/features/adminUsers/users/deleteUser/index.d.ts +2 -0
- package/features/adminUsers/users/deleteUser/index.js +2 -0
- package/features/adminUsers/users/getUser/GetUserGateway.d.ts +11 -0
- package/features/adminUsers/users/getUser/GetUserGateway.js +57 -0
- package/features/adminUsers/users/getUser/GetUserGateway.js.map +1 -0
- package/features/adminUsers/users/getUser/GetUserUseCase.d.ts +10 -0
- package/features/adminUsers/users/getUser/GetUserUseCase.js +18 -0
- package/features/adminUsers/users/getUser/GetUserUseCase.js.map +1 -0
- package/features/adminUsers/users/getUser/abstractions/GetUserGateway.d.ts +32 -0
- package/features/adminUsers/users/getUser/abstractions/GetUserGateway.js +5 -0
- package/features/adminUsers/users/getUser/abstractions/GetUserGateway.js.map +1 -0
- package/features/adminUsers/users/getUser/abstractions/GetUserUseCase.d.ts +14 -0
- package/features/adminUsers/users/getUser/abstractions/GetUserUseCase.js +5 -0
- package/features/adminUsers/users/getUser/abstractions/GetUserUseCase.js.map +1 -0
- package/features/adminUsers/users/getUser/abstractions/index.d.ts +2 -0
- package/features/adminUsers/users/getUser/abstractions/index.js +2 -0
- package/features/adminUsers/users/getUser/feature.d.ts +3 -0
- package/features/adminUsers/users/getUser/feature.js +19 -0
- package/features/adminUsers/users/getUser/feature.js.map +1 -0
- package/features/adminUsers/users/getUser/index.d.ts +2 -0
- package/features/adminUsers/users/getUser/index.js +2 -0
- package/features/adminUsers/users/listUsers/ListUsersGateway.d.ts +11 -0
- package/features/adminUsers/users/listUsers/ListUsersGateway.js +39 -0
- package/features/adminUsers/users/listUsers/ListUsersGateway.js.map +1 -0
- package/features/adminUsers/users/listUsers/ListUsersUseCase.d.ts +10 -0
- package/features/adminUsers/users/listUsers/ListUsersUseCase.js +18 -0
- package/features/adminUsers/users/listUsers/ListUsersUseCase.js.map +1 -0
- package/features/adminUsers/users/listUsers/abstractions/ListUsersGateway.d.ts +17 -0
- package/features/adminUsers/users/listUsers/abstractions/ListUsersGateway.js +5 -0
- package/features/adminUsers/users/listUsers/abstractions/ListUsersGateway.js.map +1 -0
- package/features/adminUsers/users/listUsers/abstractions/ListUsersUseCase.d.ts +10 -0
- package/features/adminUsers/users/listUsers/abstractions/ListUsersUseCase.js +5 -0
- package/features/adminUsers/users/listUsers/abstractions/ListUsersUseCase.js.map +1 -0
- package/features/adminUsers/users/listUsers/abstractions/index.d.ts +2 -0
- package/features/adminUsers/users/listUsers/abstractions/index.js +2 -0
- package/features/adminUsers/users/listUsers/feature.d.ts +3 -0
- package/features/adminUsers/users/listUsers/feature.js +19 -0
- package/features/adminUsers/users/listUsers/feature.js.map +1 -0
- package/features/adminUsers/users/listUsers/index.d.ts +2 -0
- package/features/adminUsers/users/listUsers/index.js +2 -0
- package/features/adminUsers/users/updateUser/UpdateUserGateway.d.ts +11 -0
- package/features/adminUsers/users/updateUser/UpdateUserGateway.js +59 -0
- package/features/adminUsers/users/updateUser/UpdateUserGateway.js.map +1 -0
- package/features/adminUsers/users/updateUser/UpdateUserUseCase.d.ts +10 -0
- package/features/adminUsers/users/updateUser/UpdateUserUseCase.js +18 -0
- package/features/adminUsers/users/updateUser/UpdateUserUseCase.js.map +1 -0
- package/features/adminUsers/users/updateUser/abstractions/UpdateUserGateway.d.ts +33 -0
- package/features/adminUsers/users/updateUser/abstractions/UpdateUserGateway.js +5 -0
- package/features/adminUsers/users/updateUser/abstractions/UpdateUserGateway.js.map +1 -0
- package/features/adminUsers/users/updateUser/abstractions/UpdateUserUseCase.d.ts +15 -0
- package/features/adminUsers/users/updateUser/abstractions/UpdateUserUseCase.js +5 -0
- package/features/adminUsers/users/updateUser/abstractions/UpdateUserUseCase.js.map +1 -0
- package/features/adminUsers/users/updateUser/abstractions/index.d.ts +2 -0
- package/features/adminUsers/users/updateUser/abstractions/index.js +2 -0
- package/features/adminUsers/users/updateUser/feature.d.ts +3 -0
- package/features/adminUsers/users/updateUser/feature.js +19 -0
- package/features/adminUsers/users/updateUser/feature.js.map +1 -0
- package/features/adminUsers/users/updateUser/index.d.ts +2 -0
- package/features/adminUsers/users/updateUser/index.js +2 -0
- package/features/aiChats/AiChatSaveError.d.ts +6 -0
- package/features/aiChats/AiChatSaveError.js +8 -0
- package/features/aiChats/AiChatSaveError.js.map +1 -0
- package/features/aiChats/AiChatsGateway.d.ts +18 -0
- package/features/aiChats/AiChatsGateway.js +132 -0
- package/features/aiChats/AiChatsGateway.js.map +1 -0
- package/features/aiChats/AiChatsRepository.d.ts +36 -0
- package/features/aiChats/AiChatsRepository.js +110 -0
- package/features/aiChats/AiChatsRepository.js.map +1 -0
- package/features/aiChats/AiChatsRequestError.d.ts +9 -0
- package/features/aiChats/AiChatsRequestError.js +8 -0
- package/features/aiChats/AiChatsRequestError.js.map +1 -0
- package/features/aiChats/abstractions.d.ts +76 -0
- package/features/aiChats/abstractions.js +6 -0
- package/features/aiChats/abstractions.js.map +1 -0
- package/features/aiChats/feature.d.ts +3 -0
- package/features/aiChats/feature.js +19 -0
- package/features/aiChats/feature.js.map +1 -0
- package/features/aiChats/index.d.ts +9 -0
- package/features/aiChats/index.js +3 -0
- package/features/aiChats/messageOf.d.ts +2 -0
- package/features/aiChats/messageOf.js +7 -0
- package/features/aiChats/messageOf.js.map +1 -0
- package/features/aiSettings/abstractions.d.ts +16 -0
- package/features/aiSettings/abstractions.js +5 -0
- package/features/aiSettings/abstractions.js.map +1 -0
- package/features/aiSettings/index.d.ts +2 -0
- package/features/aiSettings/index.js +1 -0
- package/features/assumePermissions/ApiStreamClientDecorator.d.ts +16 -0
- package/features/assumePermissions/ApiStreamClientDecorator.js +29 -0
- package/features/assumePermissions/ApiStreamClientDecorator.js.map +1 -0
- package/features/assumePermissions/AssumePermissionsContext.d.ts +17 -0
- package/features/assumePermissions/AssumePermissionsContext.js +32 -0
- package/features/assumePermissions/AssumePermissionsContext.js.map +1 -0
- package/features/assumePermissions/AssumePermissionsUseCase.d.ts +33 -0
- package/features/assumePermissions/AssumePermissionsUseCase.js +48 -0
- package/features/assumePermissions/AssumePermissionsUseCase.js.map +1 -0
- package/features/assumePermissions/GraphQLClientDecorator.d.ts +16 -0
- package/features/assumePermissions/GraphQLClientDecorator.js +29 -0
- package/features/assumePermissions/GraphQLClientDecorator.js.map +1 -0
- package/features/assumePermissions/ListAssumableTargetsGateway.d.ts +13 -0
- package/features/assumePermissions/ListAssumableTargetsGateway.js +74 -0
- package/features/assumePermissions/ListAssumableTargetsGateway.js.map +1 -0
- package/features/assumePermissions/ListAssumableTargetsUseCase.d.ts +16 -0
- package/features/assumePermissions/ListAssumableTargetsUseCase.js +38 -0
- package/features/assumePermissions/ListAssumableTargetsUseCase.js.map +1 -0
- package/features/assumePermissions/LogInUseCaseDecorator.d.ts +33 -0
- package/features/assumePermissions/LogInUseCaseDecorator.js +36 -0
- package/features/assumePermissions/LogInUseCaseDecorator.js.map +1 -0
- package/features/assumePermissions/LogOutUseCaseDecorator.d.ts +16 -0
- package/features/assumePermissions/LogOutUseCaseDecorator.js +21 -0
- package/features/assumePermissions/LogOutUseCaseDecorator.js.map +1 -0
- package/features/assumePermissions/abstractions.d.ts +78 -0
- package/features/assumePermissions/abstractions.js +8 -0
- package/features/assumePermissions/abstractions.js.map +1 -0
- package/features/assumePermissions/assumePermissionsHeader.d.ts +3 -0
- package/features/assumePermissions/assumePermissionsHeader.js +7 -0
- package/features/assumePermissions/assumePermissionsHeader.js.map +1 -0
- package/features/assumePermissions/feature.d.ts +4 -0
- package/features/assumePermissions/feature.js +32 -0
- package/features/assumePermissions/feature.js.map +1 -0
- package/features/assumePermissions/index.d.ts +4 -0
- package/features/assumePermissions/index.js +2 -0
- package/features/banners/Banners.d.ts +15 -0
- package/features/banners/Banners.js +39 -0
- package/features/banners/Banners.js.map +1 -0
- package/features/banners/abstractions.d.ts +34 -0
- package/features/banners/abstractions.js +5 -0
- package/features/banners/abstractions.js.map +1 -0
- package/features/banners/feature.d.ts +3 -0
- package/features/banners/feature.js +17 -0
- package/features/banners/feature.js.map +1 -0
- package/features/banners/index.d.ts +2 -0
- package/features/banners/index.js +2 -0
- package/features/dateFormatter/formatUtcOffset.d.ts +1 -0
- package/features/dateFormatter/formatUtcOffset.js +11 -0
- package/features/dateFormatter/formatUtcOffset.js.map +1 -0
- package/features/debugger/DebugSessionsRepository.d.ts +35 -0
- package/features/debugger/DebugSessionsRepository.js +57 -0
- package/features/debugger/DebugSessionsRepository.js.map +1 -0
- package/features/debugger/GraphQLExtensionsDebugHandler.d.ts +17 -0
- package/features/debugger/GraphQLExtensionsDebugHandler.js +21 -0
- package/features/debugger/GraphQLExtensionsDebugHandler.js.map +1 -0
- package/features/debugger/GraphQLExtensionsDebugHandler.test.d.ts +1 -0
- package/features/debugger/GraphQLExtensionsDebugHandler.test.js +112 -0
- package/features/debugger/GraphQLExtensionsDebugHandler.test.js.map +1 -0
- package/features/debugger/abstractions.d.ts +50 -0
- package/features/debugger/abstractions.js +5 -0
- package/features/debugger/abstractions.js.map +1 -0
- package/features/debugger/constants.d.ts +1 -0
- package/features/debugger/constants.js +4 -0
- package/features/debugger/constants.js.map +1 -0
- package/features/debugger/feature.d.ts +3 -0
- package/features/debugger/feature.js +19 -0
- package/features/debugger/feature.js.map +1 -0
- package/features/debugger/index.d.ts +3 -0
- package/features/debugger/index.js +3 -0
- package/features/formModel/AccessControlRuleEvaluator.d.ts +12 -0
- package/features/formModel/AccessControlRuleEvaluator.js +30 -0
- package/features/formModel/AccessControlRuleEvaluator.js.map +1 -0
- package/features/formModel/AccessControlRuleEvaluator.test.d.ts +1 -0
- package/features/formModel/AccessControlRuleEvaluator.test.js +219 -0
- package/features/formModel/AccessControlRuleEvaluator.test.js.map +1 -0
- package/features/formModel/ConditionRuleEvaluator.js +34 -4
- package/features/formModel/ConditionRuleEvaluator.js.map +1 -1
- package/features/formModel/Field.d.ts +14 -1
- package/features/formModel/Field.js +41 -5
- package/features/formModel/Field.js.map +1 -1
- package/features/formModel/FieldBuilder.d.ts +3 -3
- package/features/formModel/FieldBuilder.js +2 -1
- package/features/formModel/FieldBuilder.js.map +1 -1
- package/features/formModel/FieldBuilder.test.js +158 -1
- package/features/formModel/FieldBuilder.test.js.map +1 -1
- package/features/formModel/FocusManager.js +10 -3
- package/features/formModel/FocusManager.js.map +1 -1
- package/features/formModel/FormErrors.js +1 -1
- package/features/formModel/FormErrors.js.map +1 -1
- package/features/formModel/FormModel.d.ts +2 -0
- package/features/formModel/FormModel.js +32 -9
- package/features/formModel/FormModel.js.map +1 -1
- package/features/formModel/FormModel.test.js +835 -4
- package/features/formModel/FormModel.test.js.map +1 -1
- package/features/formModel/ObjectField.d.ts +12 -1
- package/features/formModel/ObjectField.js +70 -20
- package/features/formModel/ObjectField.js.map +1 -1
- package/features/formModel/Rules.test.js +224 -16
- package/features/formModel/Rules.test.js.map +1 -1
- package/features/formModel/abstractions.d.ts +56 -4
- package/features/formModel/abstractions.js +2 -1
- package/features/formModel/abstractions.js.map +1 -1
- package/features/formModel/createFieldRenderer.d.ts +42 -0
- package/features/formModel/createFieldRenderer.js +33 -10
- package/features/formModel/createFieldRenderer.js.map +1 -1
- package/features/formModel/feature.js +2 -0
- package/features/formModel/feature.js.map +1 -1
- package/features/formModel/fieldTypes/DateTimeFieldType.d.ts +67 -4
- package/features/formModel/fieldTypes/DateTimeFieldType.js +88 -22
- package/features/formModel/fieldTypes/DateTimeFieldType.js.map +1 -1
- package/features/formModel/fieldTypes/ObjectFieldType.d.ts +3 -1
- package/features/formModel/fieldTypes/ObjectFieldType.js +23 -1
- package/features/formModel/fieldTypes/ObjectFieldType.js.map +1 -1
- package/features/formModel/fieldTypes/dateLimits.d.ts +37 -0
- package/features/formModel/fieldTypes/dateLimits.js +64 -0
- package/features/formModel/fieldTypes/dateLimits.js.map +1 -0
- package/features/formModel/fieldTypes/dateLimits.test.d.ts +1 -0
- package/features/formModel/fieldTypes/dateLimits.test.js +60 -0
- package/features/formModel/fieldTypes/dateLimits.test.js.map +1 -0
- package/features/formModel/hasSubtreeFocusRequest.d.ts +12 -0
- package/features/formModel/hasSubtreeFocusRequest.js +15 -0
- package/features/formModel/hasSubtreeFocusRequest.js.map +1 -0
- package/features/formModel/index.d.ts +3 -2
- package/features/formModel/index.js +2 -1
- package/features/formModel/jsonSchema/JsonSchema.d.ts +18 -0
- package/features/formModel/jsonSchema/JsonSchema.js +0 -0
- package/features/formModel/jsonSchema/JsonSchemaFieldOptions.d.ts +4 -0
- package/features/formModel/jsonSchema/JsonSchemaFieldOptions.js +0 -0
- package/features/formModel/jsonSchema/JsonSchemaIssue.d.ts +4 -0
- package/features/formModel/jsonSchema/JsonSchemaIssue.js +0 -0
- package/features/formModel/jsonSchema/JsonSchemaValidationResult.d.ts +5 -0
- package/features/formModel/jsonSchema/JsonSchemaValidationResult.js +0 -0
- package/features/formModel/jsonSchema/JsonSchemaValidator.d.ts +4 -0
- package/features/formModel/jsonSchema/JsonSchemaValidator.js +0 -0
- package/features/formModel/jsonSchema/PlainObject.d.ts +1 -0
- package/features/formModel/jsonSchema/PlainObject.js +0 -0
- package/features/formModel/jsonSchema/buildFieldsFromJsonSchema.d.ts +5 -0
- package/features/formModel/jsonSchema/buildFieldsFromJsonSchema.js +154 -0
- package/features/formModel/jsonSchema/buildFieldsFromJsonSchema.js.map +1 -0
- package/features/formModel/jsonSchema/buildFieldsFromJsonSchema.test.d.ts +1 -0
- package/features/formModel/jsonSchema/buildFieldsFromJsonSchema.test.js +643 -0
- package/features/formModel/jsonSchema/buildFieldsFromJsonSchema.test.js.map +1 -0
- package/features/formModel/jsonSchema/createJsonSchemaValidator.d.ts +3 -0
- package/features/formModel/jsonSchema/createJsonSchemaValidator.js +40 -0
- package/features/formModel/jsonSchema/createJsonSchemaValidator.js.map +1 -0
- package/features/formModel/jsonSchema/createJsonSchemaValidator.test.d.ts +1 -0
- package/features/formModel/jsonSchema/createJsonSchemaValidator.test.js +141 -0
- package/features/formModel/jsonSchema/createJsonSchemaValidator.test.js.map +1 -0
- package/features/formModel/jsonSchema/formDataToJsonSchemaValue.d.ts +3 -0
- package/features/formModel/jsonSchema/formDataToJsonSchemaValue.js +52 -0
- package/features/formModel/jsonSchema/formDataToJsonSchemaValue.js.map +1 -0
- package/features/formModel/jsonSchema/formDataToJsonSchemaValue.test.d.ts +1 -0
- package/features/formModel/jsonSchema/formDataToJsonSchemaValue.test.js +250 -0
- package/features/formModel/jsonSchema/formDataToJsonSchemaValue.test.js.map +1 -0
- package/features/formModel/jsonSchema/getJsonSchemaKind.d.ts +3 -0
- package/features/formModel/jsonSchema/getJsonSchemaKind.js +31 -0
- package/features/formModel/jsonSchema/getJsonSchemaKind.js.map +1 -0
- package/features/formModel/jsonSchema/getJsonSchemaKind.test.d.ts +1 -0
- package/features/formModel/jsonSchema/getJsonSchemaKind.test.js +123 -0
- package/features/formModel/jsonSchema/getJsonSchemaKind.test.js.map +1 -0
- package/features/formModel/jsonSchema/isPlainObject.d.ts +2 -0
- package/features/formModel/jsonSchema/isPlainObject.js +4 -0
- package/features/formModel/jsonSchema/isPlainObject.js.map +1 -0
- package/features/formModel/jsonSchema/jsonSchemaValueToFormData.d.ts +3 -0
- package/features/formModel/jsonSchema/jsonSchemaValueToFormData.js +30 -0
- package/features/formModel/jsonSchema/jsonSchemaValueToFormData.js.map +1 -0
- package/features/formModel/jsonSchema/jsonSchemaValueToFormData.test.d.ts +1 -0
- package/features/formModel/jsonSchema/jsonSchemaValueToFormData.test.js +207 -0
- package/features/formModel/jsonSchema/jsonSchemaValueToFormData.test.js.map +1 -0
- package/features/formModel/jsonSchema/normalizeJsonSchema.d.ts +2 -0
- package/features/formModel/jsonSchema/normalizeJsonSchema.js +10 -0
- package/features/formModel/jsonSchema/normalizeJsonSchema.js.map +1 -0
- package/features/formModel/renderers.d.ts +1 -0
- package/features/formModel/renderers.js +1 -0
- package/features/notifications/Notifications.d.ts +1 -0
- package/features/notifications/Notifications.js +3 -0
- package/features/notifications/Notifications.js.map +1 -1
- package/features/notifications/Notifications.test.d.ts +1 -0
- package/features/notifications/Notifications.test.js +106 -0
- package/features/notifications/Notifications.test.js.map +1 -0
- package/features/notifications/NotificationsRenderer.d.ts +2 -1
- package/features/notifications/NotificationsRenderer.js +23 -4
- package/features/notifications/NotificationsRenderer.js.map +1 -1
- package/features/notifications/NotificationsRenderer.test.d.ts +1 -0
- package/features/notifications/NotificationsRenderer.test.js +261 -0
- package/features/notifications/NotificationsRenderer.test.js.map +1 -0
- package/features/notifications/abstractions.d.ts +13 -2
- package/features/notifications/abstractions.js.map +1 -1
- package/features/security/LogIn/LogInUseCase.d.ts +0 -1
- package/features/security/LogIn/LogInUseCase.js +2 -5
- package/features/security/LogIn/LogInUseCase.js.map +1 -1
- package/features/security/LogIn/hasAppPermissions.d.ts +2 -0
- package/features/security/LogIn/hasAppPermissions.js +8 -0
- package/features/security/LogIn/hasAppPermissions.js.map +1 -0
- package/features/wcp/ReactLicense.d.ts +6 -1
- package/features/wcp/ReactLicense.js +17 -2
- package/features/wcp/ReactLicense.js.map +1 -1
- package/features/wcp/WcpGateway.js +4 -0
- package/features/wcp/WcpGateway.js.map +1 -1
- package/hooks/useHotkeys.js +6 -4
- package/hooks/useHotkeys.js.map +1 -1
- package/index.d.ts +27 -3
- package/index.js +23 -6
- package/modules/AccessManagementExtension.js +3 -1
- package/modules/AccessManagementExtension.js.map +1 -1
- package/modules/DebuggerExtension.d.ts +2 -0
- package/modules/DebuggerExtension.js +55 -0
- package/modules/DebuggerExtension.js.map +1 -0
- package/package.json +41 -41
- package/presentation/accessManagement/apiKeys/ApiKeysPresenter.js +1 -2
- package/presentation/accessManagement/apiKeys/ApiKeysPresenter.js.map +1 -1
- package/presentation/accessManagement/roles/RolesPresenter.js +1 -2
- package/presentation/accessManagement/roles/RolesPresenter.js.map +1 -1
- package/presentation/accessManagement/roles/components/RolesDataList.d.ts +10 -0
- package/presentation/accessManagement/roles/components/RolesDataList.js +146 -0
- package/presentation/accessManagement/roles/components/RolesDataList.js.map +1 -0
- package/presentation/accessManagement/roles/components/RolesForm.d.ts +13 -0
- package/presentation/accessManagement/roles/components/RolesForm.js +114 -0
- package/presentation/accessManagement/roles/components/RolesForm.js.map +1 -0
- package/presentation/accessManagement/roles/components/RolesView.js +6 -216
- package/presentation/accessManagement/roles/components/RolesView.js.map +1 -1
- package/presentation/accessManagement/teams/TeamsPresenter.js +1 -2
- package/presentation/accessManagement/teams/TeamsPresenter.js.map +1 -1
- package/presentation/accessManagement/teams/components/TeamsDataList.d.ts +10 -0
- package/presentation/accessManagement/teams/components/TeamsDataList.js +146 -0
- package/presentation/accessManagement/teams/components/TeamsDataList.js.map +1 -0
- package/presentation/accessManagement/teams/components/TeamsForm.d.ts +13 -0
- package/presentation/accessManagement/teams/components/TeamsForm.js +96 -0
- package/presentation/accessManagement/teams/components/TeamsForm.js.map +1 -0
- package/presentation/accessManagement/teams/components/TeamsView.js +6 -198
- package/presentation/accessManagement/teams/components/TeamsView.js.map +1 -1
- package/presentation/adminUsers/AdminUsers.d.ts +10 -0
- package/presentation/adminUsers/AdminUsers.js +77 -0
- package/presentation/adminUsers/AdminUsers.js.map +1 -0
- package/presentation/adminUsers/SecurityPermission.d.ts +2 -0
- package/presentation/adminUsers/SecurityPermission.js +15 -0
- package/presentation/adminUsers/SecurityPermission.js.map +1 -0
- package/presentation/adminUsers/UserItem.d.ts +10 -0
- package/presentation/adminUsers/UserItem.js +0 -0
- package/presentation/adminUsers/components/AvatarImage/AvatarImage.d.ts +3 -0
- package/presentation/adminUsers/components/AvatarImage/AvatarImage.js +31 -0
- package/presentation/adminUsers/components/AvatarImage/AvatarImage.js.map +1 -0
- package/presentation/adminUsers/components/AvatarImage/AvatarImagePreview.d.ts +10 -0
- package/presentation/adminUsers/components/AvatarImage/AvatarImagePreview.js +53 -0
- package/presentation/adminUsers/components/AvatarImage/AvatarImagePreview.js.map +1 -0
- package/presentation/adminUsers/components/AvatarImage/AvatarImageTrigger.d.ts +7 -0
- package/presentation/adminUsers/components/AvatarImage/AvatarImageTrigger.js +28 -0
- package/presentation/adminUsers/components/AvatarImage/AvatarImageTrigger.js.map +1 -0
- package/presentation/adminUsers/components/AvatarImage/index.d.ts +1 -0
- package/presentation/adminUsers/components/AvatarImage/index.js +1 -0
- package/presentation/adminUsers/routes.d.ts +10 -0
- package/presentation/adminUsers/routes.js +20 -0
- package/presentation/adminUsers/routes.js.map +1 -0
- package/presentation/adminUsers/userMenu/AccountDetails.d.ts +6 -0
- package/presentation/adminUsers/userMenu/AccountDetails.js +20 -0
- package/presentation/adminUsers/userMenu/AccountDetails.js.map +1 -0
- package/presentation/adminUsers/userMenu/useIsDefaultTenant.d.ts +1 -0
- package/presentation/adminUsers/userMenu/useIsDefaultTenant.js +9 -0
- package/presentation/adminUsers/userMenu/useIsDefaultTenant.js.map +1 -0
- package/presentation/adminUsers/views/Account/Account.d.ts +2 -0
- package/presentation/adminUsers/views/Account/Account.js +137 -0
- package/presentation/adminUsers/views/Account/Account.js.map +1 -0
- package/presentation/adminUsers/views/Account/index.d.ts +1 -0
- package/presentation/adminUsers/views/Account/index.js +1 -0
- package/presentation/adminUsers/views/Users/UsersDataList.d.ts +3 -0
- package/presentation/adminUsers/views/Users/UsersDataList.js +180 -0
- package/presentation/adminUsers/views/Users/UsersDataList.js.map +1 -0
- package/presentation/adminUsers/views/Users/UsersForm.d.ts +5 -0
- package/presentation/adminUsers/views/Users/UsersForm.js +175 -0
- package/presentation/adminUsers/views/Users/UsersForm.js.map +1 -0
- package/presentation/adminUsers/views/Users/UsersView.d.ts +2 -0
- package/presentation/adminUsers/views/Users/UsersView.js +15 -0
- package/presentation/adminUsers/views/Users/UsersView.js.map +1 -0
- package/presentation/adminUsers/views/Users/components/DeleteAction.d.ts +7 -0
- package/presentation/adminUsers/views/Users/components/DeleteAction.js +29 -0
- package/presentation/adminUsers/views/Users/components/DeleteAction.js.map +1 -0
- package/presentation/adminUsers/views/Users/hooks/useUserForm.d.ts +27 -0
- package/presentation/adminUsers/views/Users/hooks/useUserForm.js +101 -0
- package/presentation/adminUsers/views/Users/hooks/useUserForm.js.map +1 -0
- package/presentation/adminUsers/views/Users/search.js +21 -0
- package/presentation/adminUsers/views/Users/search.js.map +1 -0
- package/presentation/adminUsers/views/Users/search.svg +20 -0
- package/presentation/adminUsers/views/utils.d.ts +3 -0
- package/presentation/adminUsers/views/utils.js +12 -0
- package/presentation/adminUsers/views/utils.js.map +1 -0
- package/presentation/aiChats/AiChatsPanelPresenter.d.ts +28 -0
- package/presentation/aiChats/AiChatsPanelPresenter.js +132 -0
- package/presentation/aiChats/AiChatsPanelPresenter.js.map +1 -0
- package/presentation/aiChats/abstractions.d.ts +69 -0
- package/presentation/aiChats/abstractions.js +5 -0
- package/presentation/aiChats/abstractions.js.map +1 -0
- package/presentation/aiChats/feature.d.ts +3 -0
- package/presentation/aiChats/feature.js +17 -0
- package/presentation/aiChats/feature.js.map +1 -0
- package/presentation/aiChats/index.d.ts +2 -0
- package/presentation/aiChats/index.js +2 -0
- package/presentation/assumePermissions/AssumePermissionsPresenter.d.ts +36 -0
- package/presentation/assumePermissions/AssumePermissionsPresenter.js +153 -0
- package/presentation/assumePermissions/AssumePermissionsPresenter.js.map +1 -0
- package/presentation/assumePermissions/abstractions.d.ts +30 -0
- package/presentation/assumePermissions/abstractions.js +5 -0
- package/presentation/assumePermissions/abstractions.js.map +1 -0
- package/presentation/assumePermissions/components/AssumePermissionsButton.d.ts +14 -0
- package/presentation/assumePermissions/components/AssumePermissionsButton.js +42 -0
- package/presentation/assumePermissions/components/AssumePermissionsButton.js.map +1 -0
- package/presentation/assumePermissions/components/AssumedPermissionsBanner.d.ts +11 -0
- package/presentation/assumePermissions/components/AssumedPermissionsBanner.js +25 -0
- package/presentation/assumePermissions/components/AssumedPermissionsBanner.js.map +1 -0
- package/presentation/assumePermissions/components/AssumedPermissionsSelector.d.ts +2 -0
- package/presentation/assumePermissions/components/AssumedPermissionsSelector.js +68 -0
- package/presentation/assumePermissions/components/AssumedPermissionsSelector.js.map +1 -0
- package/presentation/assumePermissions/feature.d.ts +3 -0
- package/presentation/assumePermissions/feature.js +17 -0
- package/presentation/assumePermissions/feature.js.map +1 -0
- package/presentation/assumePermissions/index.d.ts +4 -0
- package/presentation/assumePermissions/index.js +4 -0
- package/presentation/banners/BannersPresenter.d.ts +14 -0
- package/presentation/banners/BannersPresenter.js +60 -0
- package/presentation/banners/BannersPresenter.js.map +1 -0
- package/presentation/banners/abstractions.d.ts +24 -0
- package/presentation/banners/abstractions.js +5 -0
- package/presentation/banners/abstractions.js.map +1 -0
- package/presentation/banners/components/Banner.d.ts +10 -0
- package/presentation/banners/components/Banner.js +32 -0
- package/presentation/banners/components/Banner.js.map +1 -0
- package/presentation/banners/components/BannerBar.d.ts +11 -0
- package/presentation/banners/components/BannerBar.js +51 -0
- package/presentation/banners/components/BannerBar.js.map +1 -0
- package/presentation/banners/feature.d.ts +3 -0
- package/presentation/banners/feature.js +17 -0
- package/presentation/banners/feature.js.map +1 -0
- package/presentation/banners/index.d.ts +6 -0
- package/presentation/banners/index.js +4 -0
- package/presentation/banners/useBanner.d.ts +10 -0
- package/presentation/banners/useBanner.js +15 -0
- package/presentation/banners/useBanner.js.map +1 -0
- package/presentation/commandPalette/CommandPalettePresenter.js +3 -1
- package/presentation/commandPalette/CommandPalettePresenter.js.map +1 -1
- package/presentation/commandPalette/abstractions.d.ts +5 -0
- package/presentation/commandPalette/abstractions.js.map +1 -1
- package/presentation/commandPalette/commands/AiChatsCommand.d.ts +24 -0
- package/presentation/commandPalette/commands/AiChatsCommand.js +41 -0
- package/presentation/commandPalette/commands/AiChatsCommand.js.map +1 -0
- package/presentation/commandPalette/commands/AskAiCommand.d.ts +1 -0
- package/presentation/commandPalette/commands/AskAiCommand.js +3 -2
- package/presentation/commandPalette/commands/AskAiCommand.js.map +1 -1
- package/presentation/commandPalette/commands/feature.js +2 -0
- package/presentation/commandPalette/commands/feature.js.map +1 -1
- package/presentation/createReactiveComponent.d.ts +1 -0
- package/presentation/createReactiveComponent.js +1 -0
- package/presentation/debugger/DebuggerPresenter.d.ts +14 -0
- package/presentation/debugger/DebuggerPresenter.js +45 -0
- package/presentation/debugger/DebuggerPresenter.js.map +1 -0
- package/presentation/debugger/abstractions.d.ts +17 -0
- package/presentation/debugger/abstractions.js +5 -0
- package/presentation/debugger/abstractions.js.map +1 -0
- package/presentation/debugger/components/DebuggerIndicator.d.ts +2 -0
- package/presentation/debugger/components/DebuggerIndicator.js +45 -0
- package/presentation/debugger/components/DebuggerIndicator.js.map +1 -0
- package/presentation/debugger/components/DebuggerView.d.ts +4 -0
- package/presentation/debugger/components/DebuggerView.js +44 -0
- package/presentation/debugger/components/DebuggerView.js.map +1 -0
- package/presentation/debugger/downloadJson.d.ts +7 -0
- package/presentation/debugger/downloadJson.js +17 -0
- package/presentation/debugger/downloadJson.js.map +1 -0
- package/presentation/debugger/feature.d.ts +3 -0
- package/presentation/debugger/feature.js +17 -0
- package/presentation/debugger/feature.js.map +1 -0
- package/presentation/debugger/routes.d.ts +4 -0
- package/presentation/debugger/routes.js +10 -0
- package/presentation/debugger/routes.js.map +1 -0
- package/presentation/installation/components/SystemInstaller/steps/AdminUserStep.js +4 -3
- package/presentation/installation/components/SystemInstaller/steps/AdminUserStep.js.map +1 -1
- package/presentation/installation/components/SystemInstaller/steps/FinishSetup/handleStartUsing.js.map +1 -1
- package/presentation/installation/presenters/SystemInstaller/SystemInstallerPresenter.js.map +1 -1
- package/presentation/listPresenter/FolderAwareDataSource.d.ts +5 -0
- package/presentation/listPresenter/FolderAwareDataSource.js +4 -3
- package/presentation/listPresenter/FolderAwareDataSource.js.map +1 -1
- package/presentation/listPresenter/QueryMatcher.d.ts +28 -5
- package/presentation/listPresenter/QueryMatcher.js +72 -2
- package/presentation/listPresenter/QueryMatcher.js.map +1 -1
- package/presentation/listPresenter/QueryMatcher.test.d.ts +1 -0
- package/presentation/listPresenter/QueryMatcher.test.js +345 -0
- package/presentation/listPresenter/QueryMatcher.test.js.map +1 -0
- package/presentation/trashBin/TrashBinPresenter.js +3 -1
- package/presentation/trashBin/TrashBinPresenter.js.map +1 -1
- package/presentation/trashBin/TrashBinPresenter.test.d.ts +1 -0
- package/presentation/trashBin/TrashBinPresenter.test.js +91 -0
- package/presentation/trashBin/TrashBinPresenter.test.js.map +1 -0
- package/presentation/trashBin/abstractions.d.ts +1 -1
- package/presentation/trashBin/abstractions.js.map +1 -1
- package/presentation/trashBin/components/BulkActions/DeleteItems.js +5 -1
- package/presentation/trashBin/components/BulkActions/DeleteItems.js.map +1 -1
- package/presentation/trashBin/components/BulkActions/DeleteItems.test.d.ts +1 -0
- package/presentation/trashBin/components/BulkActions/DeleteItems.test.js +100 -0
- package/presentation/trashBin/components/BulkActions/DeleteItems.test.js.map +1 -0
- package/presentation/trashBin/hooks/useDeleteTrashBinItem.js +2 -1
- package/presentation/trashBin/hooks/useDeleteTrashBinItem.js.map +1 -1
- package/presentation/trashBin/hooks/useDeleteTrashBinItem.test.d.ts +1 -0
- package/presentation/trashBin/hooks/useDeleteTrashBinItem.test.js +67 -0
- package/presentation/trashBin/hooks/useDeleteTrashBinItem.test.js.map +1 -0
- package/static/svg/search.43fa797c.svg +20 -0
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker.js +0 -68
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker.js.map +0 -1
- package/features/aiChat/AiChatGateway.js.map +0 -1
- package/features/aiChat/AiChatPresenter.d.ts +0 -32
- package/features/aiChat/AiChatPresenter.js +0 -220
- package/features/aiChat/AiChatPresenter.js.map +0 -1
- package/features/aiChat/abstractions.d.ts +0 -124
- package/features/aiChat/abstractions.js +0 -6
- package/features/aiChat/abstractions.js.map +0 -1
- package/features/aiChat/feature.d.ts +0 -3
- package/features/aiChat/feature.js +0 -19
- package/features/aiChat/feature.js.map +0 -1
- package/features/aiChat/index.d.ts +0 -6
- package/features/aiChat/index.js +0 -3
- package/presentation/installation/components/SystemInstaller/steps/AdminUserStep/createPasswordValidator.d.ts +0 -8
- package/presentation/installation/components/SystemInstaller/steps/AdminUserStep/createPasswordValidator.js +0 -17
- package/presentation/installation/components/SystemInstaller/steps/AdminUserStep/createPasswordValidator.js.map +0 -1
- package/presentation/installation/components/SystemInstaller/steps/AdminUserStep/usePasswordValidator.d.ts +0 -1
- package/presentation/installation/components/SystemInstaller/steps/AdminUserStep/usePasswordValidator.js +0 -16
- package/presentation/installation/components/SystemInstaller/steps/AdminUserStep/usePasswordValidator.js.map +0 -1
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
2
|
import { Container } from "@webiny/di";
|
|
3
3
|
import { FormModelFeature } from "./feature.js";
|
|
4
|
+
import { IdentityContextFeature } from "../security/IdentityContext/feature.js";
|
|
4
5
|
import { ConditionRuleEvaluator } from "./ConditionRuleEvaluator.js";
|
|
5
6
|
import { FormModelFactory } from "./abstractions.js";
|
|
6
7
|
function createForm(config) {
|
|
7
8
|
const container = new Container();
|
|
9
|
+
IdentityContextFeature.register(container);
|
|
8
10
|
FormModelFeature.register(container);
|
|
9
11
|
return container.resolve(FormModelFactory).create({
|
|
10
12
|
fields: config.fields,
|
|
@@ -62,7 +64,7 @@ describe("Rules system", ()=>{
|
|
|
62
64
|
{
|
|
63
65
|
type: "condition",
|
|
64
66
|
target: "plan",
|
|
65
|
-
operator: "
|
|
67
|
+
operator: "==",
|
|
66
68
|
value: "enterprise",
|
|
67
69
|
action: "hide"
|
|
68
70
|
}
|
|
@@ -228,38 +230,36 @@ describe("Rules system", ()=>{
|
|
|
228
230
|
});
|
|
229
231
|
describe("custom rule evaluators", ()=>{
|
|
230
232
|
it("uses externally registered evaluators for custom rule types", ()=>{
|
|
231
|
-
class
|
|
232
|
-
constructor(
|
|
233
|
-
this.
|
|
233
|
+
class FeatureFlagEvaluator {
|
|
234
|
+
constructor(enabledFlags){
|
|
235
|
+
this.enabledFlags = enabledFlags;
|
|
234
236
|
}
|
|
235
237
|
canEvaluate(rule) {
|
|
236
|
-
return "
|
|
238
|
+
return "featureFlag" === rule.type;
|
|
237
239
|
}
|
|
238
240
|
evaluate(rule) {
|
|
239
|
-
|
|
240
|
-
const [scope, id] = rule.value.split(":");
|
|
241
|
-
return "team" === scope && this.userTeams.includes(id);
|
|
241
|
+
return "string" == typeof rule.value && this.enabledFlags.includes(rule.value);
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
244
|
const form = createForm({
|
|
245
245
|
extraEvaluators: [
|
|
246
|
-
new
|
|
247
|
-
"
|
|
246
|
+
new FeatureFlagEvaluator([
|
|
247
|
+
"beta"
|
|
248
248
|
])
|
|
249
249
|
],
|
|
250
250
|
fields: (fields)=>({
|
|
251
|
-
|
|
251
|
+
betaField: fields.text().label("Beta Only").rules([
|
|
252
252
|
{
|
|
253
|
-
type: "
|
|
254
|
-
target: "
|
|
253
|
+
type: "featureFlag",
|
|
254
|
+
target: "flags",
|
|
255
255
|
operator: "matches",
|
|
256
|
-
value: "
|
|
256
|
+
value: "beta",
|
|
257
257
|
action: "disable"
|
|
258
258
|
}
|
|
259
259
|
])
|
|
260
260
|
})
|
|
261
261
|
});
|
|
262
|
-
expect(form.field("
|
|
262
|
+
expect(form.field("betaField").vm.disabled).toBe(true);
|
|
263
263
|
});
|
|
264
264
|
it("ignores rules with unknown types (no evaluator)", ()=>{
|
|
265
265
|
const form = createForm({
|
|
@@ -285,7 +285,7 @@ describe("Rules system", ()=>{
|
|
|
285
285
|
expect(e.canEvaluate({
|
|
286
286
|
type: "condition",
|
|
287
287
|
target: "x",
|
|
288
|
-
operator: "
|
|
288
|
+
operator: "==",
|
|
289
289
|
value: "y",
|
|
290
290
|
action: "hide"
|
|
291
291
|
})).toBe(true);
|
|
@@ -318,6 +318,214 @@ describe("Rules system", ()=>{
|
|
|
318
318
|
expect(e.evaluate(rule, mkForm("hello"))).toBe(false);
|
|
319
319
|
expect(e.evaluate(rule, mkForm(0))).toBe(false);
|
|
320
320
|
});
|
|
321
|
+
describe("typed rule values", ()=>{
|
|
322
|
+
const e = new ConditionRuleEvaluator();
|
|
323
|
+
const mkForm = (value)=>({
|
|
324
|
+
field: ()=>({
|
|
325
|
+
getValue: ()=>value
|
|
326
|
+
})
|
|
327
|
+
});
|
|
328
|
+
const mkRule = (operator, value)=>({
|
|
329
|
+
type: "condition",
|
|
330
|
+
target: "x",
|
|
331
|
+
operator,
|
|
332
|
+
value,
|
|
333
|
+
action: "hide"
|
|
334
|
+
});
|
|
335
|
+
it.each([
|
|
336
|
+
[
|
|
337
|
+
false,
|
|
338
|
+
false,
|
|
339
|
+
true
|
|
340
|
+
],
|
|
341
|
+
[
|
|
342
|
+
false,
|
|
343
|
+
true,
|
|
344
|
+
false
|
|
345
|
+
],
|
|
346
|
+
[
|
|
347
|
+
true,
|
|
348
|
+
true,
|
|
349
|
+
true
|
|
350
|
+
],
|
|
351
|
+
[
|
|
352
|
+
true,
|
|
353
|
+
false,
|
|
354
|
+
false
|
|
355
|
+
]
|
|
356
|
+
])("== with boolean field %s and boolean rule value %s -> %s", (field, rule, out)=>{
|
|
357
|
+
expect(e.evaluate(mkRule("==", rule), mkForm(field))).toBe(out);
|
|
358
|
+
});
|
|
359
|
+
it.each([
|
|
360
|
+
[
|
|
361
|
+
false,
|
|
362
|
+
false,
|
|
363
|
+
false
|
|
364
|
+
],
|
|
365
|
+
[
|
|
366
|
+
false,
|
|
367
|
+
true,
|
|
368
|
+
true
|
|
369
|
+
],
|
|
370
|
+
[
|
|
371
|
+
true,
|
|
372
|
+
true,
|
|
373
|
+
false
|
|
374
|
+
],
|
|
375
|
+
[
|
|
376
|
+
true,
|
|
377
|
+
false,
|
|
378
|
+
true
|
|
379
|
+
]
|
|
380
|
+
])("!= with boolean field %s and boolean rule value %s -> %s", (field, rule, out)=>{
|
|
381
|
+
expect(e.evaluate(mkRule("!=", rule), mkForm(field))).toBe(out);
|
|
382
|
+
});
|
|
383
|
+
it("supports eq/neq aliases with boolean values", ()=>{
|
|
384
|
+
expect(e.evaluate(mkRule("eq", false), mkForm(false))).toBe(true);
|
|
385
|
+
expect(e.evaluate(mkRule("neq", false), mkForm(true))).toBe(true);
|
|
386
|
+
});
|
|
387
|
+
it("does not coerce strings to booleans", ()=>{
|
|
388
|
+
expect(e.evaluate(mkRule("==", "false"), mkForm(false))).toBe(false);
|
|
389
|
+
expect(e.evaluate(mkRule("==", "true"), mkForm(true))).toBe(false);
|
|
390
|
+
expect(e.evaluate(mkRule("==", false), mkForm("false"))).toBe(false);
|
|
391
|
+
expect(e.evaluate(mkRule("!=", "false"), mkForm(false))).toBe(true);
|
|
392
|
+
});
|
|
393
|
+
it("does not loosely match falsy values against booleans", ()=>{
|
|
394
|
+
expect(e.evaluate(mkRule("==", ""), mkForm(false))).toBe(false);
|
|
395
|
+
expect(e.evaluate(mkRule("==", 0), mkForm(false))).toBe(false);
|
|
396
|
+
expect(e.evaluate(mkRule("==", false), mkForm(0))).toBe(false);
|
|
397
|
+
expect(e.evaluate(mkRule("==", true), mkForm(1))).toBe(false);
|
|
398
|
+
});
|
|
399
|
+
it("compares plain strings as strings", ()=>{
|
|
400
|
+
expect(e.evaluate(mkRule("==", "false"), mkForm("false"))).toBe(true);
|
|
401
|
+
expect(e.evaluate(mkRule("==", "map"), mkForm("map"))).toBe(true);
|
|
402
|
+
expect(e.evaluate(mkRule("!=", "map"), mkForm("other"))).toBe(true);
|
|
403
|
+
});
|
|
404
|
+
it("does not treat an empty field as false", ()=>{
|
|
405
|
+
expect(e.evaluate(mkRule("==", false), mkForm(null))).toBe(false);
|
|
406
|
+
});
|
|
407
|
+
it("compares numbers with number and numeric string rule values", ()=>{
|
|
408
|
+
expect(e.evaluate(mkRule("==", 5), mkForm(5))).toBe(true);
|
|
409
|
+
expect(e.evaluate(mkRule("==", "5"), mkForm(5))).toBe(true);
|
|
410
|
+
expect(e.evaluate(mkRule("!=", 5), mkForm(6))).toBe(true);
|
|
411
|
+
expect(e.evaluate(mkRule(">", 5), mkForm(6))).toBe(true);
|
|
412
|
+
expect(e.evaluate(mkRule("gte", 5), mkForm(5))).toBe(true);
|
|
413
|
+
expect(e.evaluate(mkRule("<", 5), mkForm(6))).toBe(false);
|
|
414
|
+
expect(e.evaluate(mkRule("lte", "5"), mkForm(4))).toBe(true);
|
|
415
|
+
});
|
|
416
|
+
});
|
|
417
|
+
});
|
|
418
|
+
describe("rules with typed values on layout elements", ()=>{
|
|
419
|
+
const createAdvancedForm = (ruleValue)=>createForm({
|
|
420
|
+
fields: (fields)=>({
|
|
421
|
+
advanced: fields.text().label("Advanced").defaultValue(false),
|
|
422
|
+
options: fields.text().label("Options"),
|
|
423
|
+
map: fields.text().label("Map")
|
|
424
|
+
}),
|
|
425
|
+
layout: (layout)=>[
|
|
426
|
+
layout.row("advanced"),
|
|
427
|
+
layout.tabs("tabs").rules([
|
|
428
|
+
{
|
|
429
|
+
type: "condition",
|
|
430
|
+
target: "advanced",
|
|
431
|
+
operator: "==",
|
|
432
|
+
value: ruleValue,
|
|
433
|
+
action: "hide"
|
|
434
|
+
}
|
|
435
|
+
]).tab("tab1", (tab)=>{
|
|
436
|
+
tab.label("Tab 1").layout((layout)=>[
|
|
437
|
+
layout.row("options")
|
|
438
|
+
]);
|
|
439
|
+
}).tab("tab2", (tab)=>{
|
|
440
|
+
tab.label("Tab 2").rules([
|
|
441
|
+
{
|
|
442
|
+
type: "condition",
|
|
443
|
+
target: "options",
|
|
444
|
+
operator: "!=",
|
|
445
|
+
value: "map",
|
|
446
|
+
action: "disable"
|
|
447
|
+
}
|
|
448
|
+
]).layout((layout)=>[
|
|
449
|
+
layout.row("map")
|
|
450
|
+
]);
|
|
451
|
+
})
|
|
452
|
+
]
|
|
453
|
+
});
|
|
454
|
+
const tabsVm = (form)=>form.vm.layout.find((n)=>"tabs" === n.type);
|
|
455
|
+
it("hides tabs while a boolean field equals false", ()=>{
|
|
456
|
+
const form = createAdvancedForm(false);
|
|
457
|
+
expect(tabsVm(form)).toBeUndefined();
|
|
458
|
+
expect(form.field("options").visible).toBe(false);
|
|
459
|
+
form.field("advanced").setValue(true);
|
|
460
|
+
expect(tabsVm(form)).toBeDefined();
|
|
461
|
+
expect(form.field("options").visible).toBe(true);
|
|
462
|
+
form.field("advanced").setValue(false);
|
|
463
|
+
expect(tabsVm(form)).toBeUndefined();
|
|
464
|
+
});
|
|
465
|
+
it("disables a tab until its string condition stops matching", ()=>{
|
|
466
|
+
const form = createAdvancedForm(false);
|
|
467
|
+
form.field("advanced").setValue(true);
|
|
468
|
+
expect(tabsVm(form).tabs[1].disabled).toBe(true);
|
|
469
|
+
expect(form.field("map").vm.disabled).toBe(true);
|
|
470
|
+
form.field("options").setValue("map");
|
|
471
|
+
expect(tabsVm(form).tabs[1].disabled).toBe(false);
|
|
472
|
+
expect(form.field("map").vm.disabled).toBe(false);
|
|
473
|
+
});
|
|
474
|
+
});
|
|
475
|
+
});
|
|
476
|
+
describe("disabled cascades into containers", ()=>{
|
|
477
|
+
it("disables the children of a disabled object field", ()=>{
|
|
478
|
+
const form = createForm({
|
|
479
|
+
fields: (fields)=>({
|
|
480
|
+
title: fields.text().label("Title"),
|
|
481
|
+
meta: fields.object().label("Meta").disabled().fields((inner)=>({
|
|
482
|
+
source: inner.text().label("Source"),
|
|
483
|
+
comment: inner.text().label("Comment")
|
|
484
|
+
}))
|
|
485
|
+
})
|
|
486
|
+
});
|
|
487
|
+
expect(form.field("meta").disabled).toBe(true);
|
|
488
|
+
expect(form.field("meta.source").disabled).toBe(true);
|
|
489
|
+
expect(form.field("meta.comment").disabled).toBe(true);
|
|
490
|
+
expect(form.field("title").disabled).toBe(false);
|
|
491
|
+
});
|
|
492
|
+
it("reaches grandchildren of a disabled object field", ()=>{
|
|
493
|
+
const form = createForm({
|
|
494
|
+
fields: (fields)=>({
|
|
495
|
+
outer: fields.object().label("Outer").disabled().fields((inner)=>({
|
|
496
|
+
nested: inner.object().label("Nested").fields((deep)=>({
|
|
497
|
+
value: deep.text().label("Value")
|
|
498
|
+
}))
|
|
499
|
+
}))
|
|
500
|
+
})
|
|
501
|
+
});
|
|
502
|
+
expect(form.field("outer.nested").disabled).toBe(true);
|
|
503
|
+
expect(form.field("outer.nested.value").disabled).toBe(true);
|
|
504
|
+
});
|
|
505
|
+
it("leaves children alone when the container is not disabled", ()=>{
|
|
506
|
+
const form = createForm({
|
|
507
|
+
fields: (fields)=>({
|
|
508
|
+
meta: fields.object().label("Meta").fields((inner)=>({
|
|
509
|
+
source: inner.text().label("Source").disabled(),
|
|
510
|
+
comment: inner.text().label("Comment")
|
|
511
|
+
}))
|
|
512
|
+
})
|
|
513
|
+
});
|
|
514
|
+
expect(form.field("meta").disabled).toBe(false);
|
|
515
|
+
expect(form.field("meta.source").disabled).toBe(true);
|
|
516
|
+
expect(form.field("meta.comment").disabled).toBe(false);
|
|
517
|
+
});
|
|
518
|
+
it("picks up a container disabled after the form was built", ()=>{
|
|
519
|
+
const form = createForm({
|
|
520
|
+
fields: (fields)=>({
|
|
521
|
+
meta: fields.object().label("Meta").fields((inner)=>({
|
|
522
|
+
source: inner.text().label("Source")
|
|
523
|
+
}))
|
|
524
|
+
})
|
|
525
|
+
});
|
|
526
|
+
expect(form.field("meta.source").disabled).toBe(false);
|
|
527
|
+
form.field("meta").setDisabled(true);
|
|
528
|
+
expect(form.field("meta.source").disabled).toBe(true);
|
|
321
529
|
});
|
|
322
530
|
});
|
|
323
531
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features/formModel/Rules.test.js","sources":["../../../src/features/formModel/Rules.test.ts"],"sourcesContent":["import { describe, it, expect } from \"vitest\";\nimport { Container } from \"@webiny/di\";\nimport { FormModelFeature } from \"./feature.js\";\nimport { ConditionRuleEvaluator } from \"./ConditionRuleEvaluator.js\";\nimport {\n FormModelFactory,\n type IRule,\n type IRuleEvaluator,\n type ITabsNodeVM,\n type IFormModel,\n type IFormModelConfig\n} from \"./abstractions.js\";\n\nfunction createForm(config: {\n extraEvaluators?: IRuleEvaluator[];\n fields: IFormModelConfig[\"fields\"];\n layout?: IFormModelConfig[\"layout\"];\n}) {\n const container = new Container();\n FormModelFeature.register(container);\n return container.resolve(FormModelFactory).create({\n fields: config.fields,\n layout: config.layout,\n ruleEvaluators: config.extraEvaluators\n });\n}\n\ndescribe(\"Rules system\", () => {\n describe(\"condition rule on a field\", () => {\n it(\"hides a field when its rule matches\", () => {\n const form = createForm({\n fields: fields => ({\n title: fields.text().label(\"Title\"),\n subtitle: fields\n .text()\n .label(\"Subtitle\")\n .rules([\n {\n type: \"condition\",\n target: \"title\",\n operator: \"isEmpty\",\n value: null,\n action: \"hide\"\n }\n ])\n })\n });\n\n expect(form.field(\"subtitle\").visible).toBe(false);\n expect(form.field(\"subtitle\").vm.visible).toBe(false);\n\n form.field(\"title\").setValue(\"Hello\");\n expect(form.field(\"subtitle\").visible).toBe(true);\n expect(form.field(\"subtitle\").vm.visible).toBe(true);\n });\n\n it(\"disables a field when its rule matches\", () => {\n const form = createForm({\n fields: fields => ({\n country: fields.text().label(\"Country\"),\n city: fields\n .text()\n .label(\"City\")\n .rules([\n {\n type: \"condition\",\n target: \"country\",\n operator: \"isEmpty\",\n value: null,\n action: \"disable\"\n }\n ])\n })\n });\n\n expect(form.field(\"city\").vm.disabled).toBe(true);\n\n form.field(\"country\").setValue(\"US\");\n expect(form.field(\"city\").vm.disabled).toBe(false);\n });\n\n it(\"supports eq operator\", () => {\n const form = createForm({\n fields: fields => ({\n plan: fields.text().label(\"Plan\"),\n enterpriseOnly: fields\n .text()\n .label(\"Enterprise\")\n .rules([\n {\n type: \"condition\",\n target: \"plan\",\n operator: \"eq\",\n value: \"enterprise\",\n action: \"hide\"\n }\n ])\n })\n });\n\n form.field(\"plan\").setValue(\"starter\");\n expect(form.field(\"enterpriseOnly\").visible).toBe(true);\n\n form.field(\"plan\").setValue(\"enterprise\");\n expect(form.field(\"enterpriseOnly\").visible).toBe(false);\n });\n\n it(\"excludes hidden fields from validation\", async () => {\n const form = createForm({\n fields: fields => ({\n toggle: fields.text().label(\"Toggle\"),\n required: fields\n .text()\n .label(\"Required\")\n .required(\"Must fill\")\n .rules([\n {\n type: \"condition\",\n target: \"toggle\",\n operator: \"isEmpty\",\n value: null,\n action: \"hide\"\n }\n ])\n })\n });\n\n // toggle is empty → \"required\" is hidden → should not count as invalid\n const valid = await form.validate();\n expect(valid).toBe(true);\n\n // Fill toggle → \"required\" becomes visible → fails without a value\n form.field(\"toggle\").setValue(\"anything\");\n const valid2 = await form.validate();\n expect(valid2).toBe(false);\n expect(form.errors.some(e => e.path === \"required\")).toBe(true);\n });\n });\n\n describe(\"rules on layout elements\", () => {\n it(\"cascades disable from tabs container to contained fields\", () => {\n const form = createForm({\n fields: fields => ({\n trigger: fields.text().label(\"Trigger\"),\n general: fields.text().label(\"General\"),\n seo: fields.text().label(\"SEO\")\n }),\n layout: layout => [\n layout.row(\"trigger\"),\n layout\n .tabs(\"settings\")\n .rules([\n {\n type: \"condition\",\n target: \"trigger\",\n operator: \"isEmpty\",\n value: null,\n action: \"disable\"\n }\n ])\n .tab(\"general\", tab => {\n tab.label(\"General\").layout(layout => [layout.row(\"general\")]);\n })\n .tab(\"seo\", tab => {\n tab.label(\"SEO\").layout(layout => [layout.row(\"seo\")]);\n })\n ]\n });\n\n expect(form.field(\"general\").vm.disabled).toBe(true);\n expect(form.field(\"seo\").vm.disabled).toBe(true);\n\n const tabs = form.vm.layout[1] as ITabsNodeVM;\n expect(tabs.disabled).toBe(true);\n expect(tabs.tabs[0].disabled).toBe(true);\n\n form.field(\"trigger\").setValue(\"go\");\n expect(form.field(\"general\").vm.disabled).toBe(false);\n expect(form.field(\"seo\").vm.disabled).toBe(false);\n });\n\n it(\"cascades disable from a single tab to its fields only\", () => {\n const form = createForm({\n fields: fields => ({\n title: fields.text().label(\"Title\"),\n general: fields.text().label(\"General\"),\n seo: fields.text().label(\"SEO\")\n }),\n layout: layout => [\n layout\n .tabs(\"settings\")\n .tab(\"general\", tab => {\n tab.label(\"General\").layout(layout => [layout.row(\"general\")]);\n })\n .tab(\"seo\", tab => {\n tab.label(\"SEO\")\n .rules([\n {\n type: \"condition\",\n target: \"title\",\n operator: \"isEmpty\",\n value: null,\n action: \"disable\"\n }\n ])\n .layout(layout => [layout.row(\"seo\")]);\n })\n ]\n });\n\n expect(form.field(\"general\").vm.disabled).toBe(false);\n expect(form.field(\"seo\").vm.disabled).toBe(true);\n\n const tabs = form.vm.layout[0] as ITabsNodeVM;\n expect(tabs.tabs[0].disabled).toBe(false);\n expect(tabs.tabs[1].disabled).toBe(true);\n });\n\n it(\"hides a tab and its fields when the tab has a hide rule\", async () => {\n const form = createForm({\n fields: fields => ({\n trigger: fields.text().label(\"Trigger\"),\n hiddenField: fields.text().label(\"Hidden\").required(\"needed\")\n }),\n layout: layout => [\n layout.row(\"trigger\"),\n layout.tabs(\"settings\").tab(\"secret\", tab => {\n tab.label(\"Secret\")\n .rules([\n {\n type: \"condition\",\n target: \"trigger\",\n operator: \"isEmpty\",\n value: null,\n action: \"hide\"\n }\n ])\n .layout(layout => [layout.row(\"hiddenField\")]);\n })\n ]\n });\n\n // Tab is hidden → field inside is hidden → not validated\n const valid = await form.validate();\n expect(valid).toBe(true);\n\n // Form VM should not expose this tabs node (all tabs hidden = no tabs node)\n const tabsVm = form.vm.layout.find(n => n.type === \"tabs\");\n expect(tabsVm).toBeUndefined();\n });\n\n it(\"hides the entire tabs container when its rule matches\", () => {\n const form = createForm({\n fields: fields => ({\n trigger: fields.text().label(\"Trigger\"),\n inner: fields.text().label(\"Inner\")\n }),\n layout: layout => [\n layout.row(\"trigger\"),\n layout\n .tabs(\"settings\")\n .rules([\n {\n type: \"condition\",\n target: \"trigger\",\n operator: \"isEmpty\",\n value: null,\n action: \"hide\"\n }\n ])\n .tab(\"tab1\", tab => {\n tab.label(\"Tab 1\").layout(layout => [layout.row(\"inner\")]);\n })\n ]\n });\n\n expect(form.vm.layout.find(n => n.type === \"tabs\")).toBeUndefined();\n expect(form.field(\"inner\").visible).toBe(false);\n\n form.field(\"trigger\").setValue(\"yes\");\n expect(form.field(\"inner\").visible).toBe(true);\n expect(form.vm.layout.find(n => n.type === \"tabs\")).toBeDefined();\n });\n });\n\n describe(\"custom rule evaluators\", () => {\n it(\"uses externally registered evaluators for custom rule types\", () => {\n class AccessControlEvaluator implements IRuleEvaluator {\n constructor(private userTeams: string[]) {}\n canEvaluate(rule: IRule) {\n return rule.type === \"accessControl\";\n }\n evaluate(rule: IRule): boolean {\n if (!rule.value) {\n return false;\n }\n const [scope, id] = rule.value.split(\":\");\n return scope === \"team\" && this.userTeams.includes(id);\n }\n }\n\n const form = createForm({\n extraEvaluators: [new AccessControlEvaluator([\"admins\"])],\n fields: fields => ({\n adminField: fields\n .text()\n .label(\"Admin Only\")\n .rules([\n {\n type: \"accessControl\",\n target: \"identity\",\n operator: \"matches\",\n value: \"team:admins\",\n action: \"disable\"\n }\n ])\n })\n });\n\n expect(form.field(\"adminField\").vm.disabled).toBe(true);\n });\n\n it(\"ignores rules with unknown types (no evaluator)\", () => {\n const form = createForm({\n fields: fields => ({\n weird: fields\n .text()\n .label(\"Weird\")\n .rules([\n {\n type: \"bogusType\",\n target: \"x\",\n operator: \"noop\",\n value: null,\n action: \"hide\"\n }\n ])\n })\n });\n\n // Unknown rule types are ignored — field remains visible\n expect(form.field(\"weird\").visible).toBe(true);\n expect(form.field(\"weird\").vm.disabled).toBe(false);\n });\n });\n\n describe(\"ConditionRuleEvaluator\", () => {\n it(\"canEvaluate returns true only for condition rules\", () => {\n const e = new ConditionRuleEvaluator();\n expect(\n e.canEvaluate({\n type: \"condition\",\n target: \"x\",\n operator: \"eq\",\n value: \"y\",\n action: \"hide\"\n })\n ).toBe(true);\n expect(\n e.canEvaluate({\n type: \"accessControl\",\n target: \"identity\",\n operator: \"matches\",\n value: \"team:x\",\n action: \"hide\"\n })\n ).toBe(false);\n });\n\n it(\"isEmpty matches null, undefined, empty string, empty array\", () => {\n const e = new ConditionRuleEvaluator();\n const mkForm = (value: unknown): IFormModel =>\n ({\n field: () => ({ getValue: () => value })\n }) as unknown as IFormModel;\n\n const rule: IRule = {\n type: \"condition\",\n target: \"x\",\n operator: \"isEmpty\",\n value: null,\n action: \"hide\"\n };\n\n expect(e.evaluate(rule, mkForm(null))).toBe(true);\n expect(e.evaluate(rule, mkForm(undefined))).toBe(true);\n expect(e.evaluate(rule, mkForm(\"\"))).toBe(true);\n expect(e.evaluate(rule, mkForm([]))).toBe(true);\n expect(e.evaluate(rule, mkForm(\"hello\"))).toBe(false);\n expect(e.evaluate(rule, mkForm(0))).toBe(false);\n });\n });\n});\n"],"names":["createForm","config","container","Container","FormModelFeature","FormModelFactory","describe","it","form","fields","expect","valid","valid2","e","layout","tab","tabs","tabsVm","n","AccessControlEvaluator","userTeams","rule","scope","id","ConditionRuleEvaluator","mkForm","value","undefined"],"mappings":";;;;;AAaA,SAASA,WAAWC,MAInB;IACG,MAAMC,YAAY,IAAIC;IACtBC,iBAAiB,QAAQ,CAACF;IAC1B,OAAOA,UAAU,OAAO,CAACG,kBAAkB,MAAM,CAAC;QAC9C,QAAQJ,OAAO,MAAM;QACrB,QAAQA,OAAO,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BACP,QAAQ;YACZ,IACF,IAAI,CAAC;YACPH,OACIG,EAAE,WAAW,CAAC;gBACV,MAAM;gBACN,QAAQ;gBACR,UAAU;gBACV,OAAO;gBACP,QAAQ;YACZ,IACF,IAAI,CAAC;QACX;QAEAN,GAAG,8DAA8D;YAC7D,MAAMM,IAAI,IAAIW;YACd,MAAMC,SAAS,CAACC,QACX;oBACG,OAAO,IAAO;4BAAE,UAAU,IAAMA;wBAAM;gBAC1C;YAEJ,MAAML,OAAc;gBAChB,MAAM;gBACN,QAAQ;gBACR,UAAU;gBACV,OAAO;gBACP,QAAQ;YACZ;YAEAX,OAAOG,EAAE,QAAQ,CAACQ,MAAMI,OAAO,QAAQ,IAAI,CAAC;YAC5Cf,OAAOG,EAAE,QAAQ,CAACQ,MAAMI,OAAOE,UAAa,IAAI,CAAC;YACjDjB,OAAOG,EAAE,QAAQ,CAACQ,MAAMI,OAAO,MAAM,IAAI,CAAC;YAC1Cf,OAAOG,EAAE,QAAQ,CAACQ,MAAMI,OAAO,EAAE,IAAI,IAAI,CAAC;YAC1Cf,OAAOG,EAAE,QAAQ,CAACQ,MAAMI,OAAO,WAAW,IAAI,CAAC;YAC/Cf,OAAOG,EAAE,QAAQ,CAACQ,MAAMI,OAAO,KAAK,IAAI,CAAC;QAC7C;IACJ;AACJ"}
|
|
1
|
+
{"version":3,"file":"features/formModel/Rules.test.js","sources":["../../../src/features/formModel/Rules.test.ts"],"sourcesContent":["import { describe, it, expect } from \"vitest\";\nimport { Container } from \"@webiny/di\";\nimport { FormModelFeature } from \"./feature.js\";\nimport { IdentityContextFeature } from \"~/features/security/IdentityContext/feature.js\";\nimport { ConditionRuleEvaluator } from \"./ConditionRuleEvaluator.js\";\nimport {\n FormModelFactory,\n type IRule,\n type IRuleEvaluator,\n type ITabsNodeVM,\n type IFormModel,\n type IFormModelConfig\n} from \"./abstractions.js\";\n\nfunction createForm(config: {\n extraEvaluators?: IRuleEvaluator[];\n fields: IFormModelConfig[\"fields\"];\n layout?: IFormModelConfig[\"layout\"];\n}) {\n const container = new Container();\n IdentityContextFeature.register(container);\n FormModelFeature.register(container);\n return container.resolve(FormModelFactory).create({\n fields: config.fields,\n layout: config.layout,\n ruleEvaluators: config.extraEvaluators\n });\n}\n\ndescribe(\"Rules system\", () => {\n describe(\"condition rule on a field\", () => {\n it(\"hides a field when its rule matches\", () => {\n const form = createForm({\n fields: fields => ({\n title: fields.text().label(\"Title\"),\n subtitle: fields\n .text()\n .label(\"Subtitle\")\n .rules([\n {\n type: \"condition\",\n target: \"title\",\n operator: \"isEmpty\",\n value: null,\n action: \"hide\"\n }\n ])\n })\n });\n\n expect(form.field(\"subtitle\").visible).toBe(false);\n expect(form.field(\"subtitle\").vm.visible).toBe(false);\n\n form.field(\"title\").setValue(\"Hello\");\n expect(form.field(\"subtitle\").visible).toBe(true);\n expect(form.field(\"subtitle\").vm.visible).toBe(true);\n });\n\n it(\"disables a field when its rule matches\", () => {\n const form = createForm({\n fields: fields => ({\n country: fields.text().label(\"Country\"),\n city: fields\n .text()\n .label(\"City\")\n .rules([\n {\n type: \"condition\",\n target: \"country\",\n operator: \"isEmpty\",\n value: null,\n action: \"disable\"\n }\n ])\n })\n });\n\n expect(form.field(\"city\").vm.disabled).toBe(true);\n\n form.field(\"country\").setValue(\"US\");\n expect(form.field(\"city\").vm.disabled).toBe(false);\n });\n\n it(\"supports eq operator\", () => {\n const form = createForm({\n fields: fields => ({\n plan: fields.text().label(\"Plan\"),\n enterpriseOnly: fields\n .text()\n .label(\"Enterprise\")\n .rules([\n {\n type: \"condition\",\n target: \"plan\",\n operator: \"==\",\n value: \"enterprise\",\n action: \"hide\"\n }\n ])\n })\n });\n\n form.field(\"plan\").setValue(\"starter\");\n expect(form.field(\"enterpriseOnly\").visible).toBe(true);\n\n form.field(\"plan\").setValue(\"enterprise\");\n expect(form.field(\"enterpriseOnly\").visible).toBe(false);\n });\n\n it(\"excludes hidden fields from validation\", async () => {\n const form = createForm({\n fields: fields => ({\n toggle: fields.text().label(\"Toggle\"),\n required: fields\n .text()\n .label(\"Required\")\n .required(\"Must fill\")\n .rules([\n {\n type: \"condition\",\n target: \"toggle\",\n operator: \"isEmpty\",\n value: null,\n action: \"hide\"\n }\n ])\n })\n });\n\n // toggle is empty → \"required\" is hidden → should not count as invalid\n const valid = await form.validate();\n expect(valid).toBe(true);\n\n // Fill toggle → \"required\" becomes visible → fails without a value\n form.field(\"toggle\").setValue(\"anything\");\n const valid2 = await form.validate();\n expect(valid2).toBe(false);\n expect(form.errors.some(e => e.path === \"required\")).toBe(true);\n });\n });\n\n describe(\"rules on layout elements\", () => {\n it(\"cascades disable from tabs container to contained fields\", () => {\n const form = createForm({\n fields: fields => ({\n trigger: fields.text().label(\"Trigger\"),\n general: fields.text().label(\"General\"),\n seo: fields.text().label(\"SEO\")\n }),\n layout: layout => [\n layout.row(\"trigger\"),\n layout\n .tabs(\"settings\")\n .rules([\n {\n type: \"condition\",\n target: \"trigger\",\n operator: \"isEmpty\",\n value: null,\n action: \"disable\"\n }\n ])\n .tab(\"general\", tab => {\n tab.label(\"General\").layout(layout => [layout.row(\"general\")]);\n })\n .tab(\"seo\", tab => {\n tab.label(\"SEO\").layout(layout => [layout.row(\"seo\")]);\n })\n ]\n });\n\n expect(form.field(\"general\").vm.disabled).toBe(true);\n expect(form.field(\"seo\").vm.disabled).toBe(true);\n\n const tabs = form.vm.layout[1] as ITabsNodeVM;\n expect(tabs.disabled).toBe(true);\n expect(tabs.tabs[0].disabled).toBe(true);\n\n form.field(\"trigger\").setValue(\"go\");\n expect(form.field(\"general\").vm.disabled).toBe(false);\n expect(form.field(\"seo\").vm.disabled).toBe(false);\n });\n\n it(\"cascades disable from a single tab to its fields only\", () => {\n const form = createForm({\n fields: fields => ({\n title: fields.text().label(\"Title\"),\n general: fields.text().label(\"General\"),\n seo: fields.text().label(\"SEO\")\n }),\n layout: layout => [\n layout\n .tabs(\"settings\")\n .tab(\"general\", tab => {\n tab.label(\"General\").layout(layout => [layout.row(\"general\")]);\n })\n .tab(\"seo\", tab => {\n tab.label(\"SEO\")\n .rules([\n {\n type: \"condition\",\n target: \"title\",\n operator: \"isEmpty\",\n value: null,\n action: \"disable\"\n }\n ])\n .layout(layout => [layout.row(\"seo\")]);\n })\n ]\n });\n\n expect(form.field(\"general\").vm.disabled).toBe(false);\n expect(form.field(\"seo\").vm.disabled).toBe(true);\n\n const tabs = form.vm.layout[0] as ITabsNodeVM;\n expect(tabs.tabs[0].disabled).toBe(false);\n expect(tabs.tabs[1].disabled).toBe(true);\n });\n\n it(\"hides a tab and its fields when the tab has a hide rule\", async () => {\n const form = createForm({\n fields: fields => ({\n trigger: fields.text().label(\"Trigger\"),\n hiddenField: fields.text().label(\"Hidden\").required(\"needed\")\n }),\n layout: layout => [\n layout.row(\"trigger\"),\n layout.tabs(\"settings\").tab(\"secret\", tab => {\n tab.label(\"Secret\")\n .rules([\n {\n type: \"condition\",\n target: \"trigger\",\n operator: \"isEmpty\",\n value: null,\n action: \"hide\"\n }\n ])\n .layout(layout => [layout.row(\"hiddenField\")]);\n })\n ]\n });\n\n // Tab is hidden → field inside is hidden → not validated\n const valid = await form.validate();\n expect(valid).toBe(true);\n\n // Form VM should not expose this tabs node (all tabs hidden = no tabs node)\n const tabsVm = form.vm.layout.find(n => n.type === \"tabs\");\n expect(tabsVm).toBeUndefined();\n });\n\n it(\"hides the entire tabs container when its rule matches\", () => {\n const form = createForm({\n fields: fields => ({\n trigger: fields.text().label(\"Trigger\"),\n inner: fields.text().label(\"Inner\")\n }),\n layout: layout => [\n layout.row(\"trigger\"),\n layout\n .tabs(\"settings\")\n .rules([\n {\n type: \"condition\",\n target: \"trigger\",\n operator: \"isEmpty\",\n value: null,\n action: \"hide\"\n }\n ])\n .tab(\"tab1\", tab => {\n tab.label(\"Tab 1\").layout(layout => [layout.row(\"inner\")]);\n })\n ]\n });\n\n expect(form.vm.layout.find(n => n.type === \"tabs\")).toBeUndefined();\n expect(form.field(\"inner\").visible).toBe(false);\n\n form.field(\"trigger\").setValue(\"yes\");\n expect(form.field(\"inner\").visible).toBe(true);\n expect(form.vm.layout.find(n => n.type === \"tabs\")).toBeDefined();\n });\n });\n\n describe(\"custom rule evaluators\", () => {\n it(\"uses externally registered evaluators for custom rule types\", () => {\n class FeatureFlagEvaluator implements IRuleEvaluator {\n constructor(private enabledFlags: string[]) {}\n canEvaluate(rule: IRule) {\n return rule.type === \"featureFlag\";\n }\n evaluate(rule: IRule): boolean {\n return typeof rule.value === \"string\" && this.enabledFlags.includes(rule.value);\n }\n }\n\n const form = createForm({\n extraEvaluators: [new FeatureFlagEvaluator([\"beta\"])],\n fields: fields => ({\n betaField: fields\n .text()\n .label(\"Beta Only\")\n .rules([\n {\n type: \"featureFlag\",\n target: \"flags\",\n operator: \"matches\",\n value: \"beta\",\n action: \"disable\"\n }\n ])\n })\n });\n\n expect(form.field(\"betaField\").vm.disabled).toBe(true);\n });\n\n it(\"ignores rules with unknown types (no evaluator)\", () => {\n const form = createForm({\n fields: fields => ({\n weird: fields\n .text()\n .label(\"Weird\")\n .rules([\n {\n type: \"bogusType\",\n target: \"x\",\n operator: \"noop\",\n value: null,\n action: \"hide\"\n }\n ])\n })\n });\n\n // Unknown rule types are ignored — field remains visible\n expect(form.field(\"weird\").visible).toBe(true);\n expect(form.field(\"weird\").vm.disabled).toBe(false);\n });\n });\n\n describe(\"ConditionRuleEvaluator\", () => {\n it(\"canEvaluate returns true only for condition rules\", () => {\n const e = new ConditionRuleEvaluator();\n expect(\n e.canEvaluate({\n type: \"condition\",\n target: \"x\",\n operator: \"==\",\n value: \"y\",\n action: \"hide\"\n })\n ).toBe(true);\n expect(\n e.canEvaluate({\n type: \"accessControl\",\n target: \"identity\",\n operator: \"matches\",\n value: \"team:x\",\n action: \"hide\"\n })\n ).toBe(false);\n });\n\n it(\"isEmpty matches null, undefined, empty string, empty array\", () => {\n const e = new ConditionRuleEvaluator();\n const mkForm = (value: unknown): IFormModel =>\n ({\n field: () => ({ getValue: () => value })\n }) as unknown as IFormModel;\n\n const rule: IRule = {\n type: \"condition\",\n target: \"x\",\n operator: \"isEmpty\",\n value: null,\n action: \"hide\"\n };\n\n expect(e.evaluate(rule, mkForm(null))).toBe(true);\n expect(e.evaluate(rule, mkForm(undefined))).toBe(true);\n expect(e.evaluate(rule, mkForm(\"\"))).toBe(true);\n expect(e.evaluate(rule, mkForm([]))).toBe(true);\n expect(e.evaluate(rule, mkForm(\"hello\"))).toBe(false);\n expect(e.evaluate(rule, mkForm(0))).toBe(false);\n });\n\n describe(\"typed rule values\", () => {\n const e = new ConditionRuleEvaluator();\n const mkForm = (value: unknown): IFormModel =>\n ({\n field: () => ({ getValue: () => value })\n }) as unknown as IFormModel;\n const mkRule = (operator: string, value: IRule[\"value\"]): IRule => ({\n type: \"condition\",\n target: \"x\",\n operator,\n value,\n action: \"hide\"\n });\n\n it.each([\n [false, false, true],\n [false, true, false],\n [true, true, true],\n [true, false, false]\n ])(\"== with boolean field %s and boolean rule value %s -> %s\", (field, rule, out) => {\n expect(e.evaluate(mkRule(\"==\", rule), mkForm(field))).toBe(out);\n });\n\n it.each([\n [false, false, false],\n [false, true, true],\n [true, true, false],\n [true, false, true]\n ])(\"!= with boolean field %s and boolean rule value %s -> %s\", (field, rule, out) => {\n expect(e.evaluate(mkRule(\"!=\", rule), mkForm(field))).toBe(out);\n });\n\n it(\"supports eq/neq aliases with boolean values\", () => {\n expect(e.evaluate(mkRule(\"eq\", false), mkForm(false))).toBe(true);\n expect(e.evaluate(mkRule(\"neq\", false), mkForm(true))).toBe(true);\n });\n\n it(\"does not coerce strings to booleans\", () => {\n expect(e.evaluate(mkRule(\"==\", \"false\"), mkForm(false))).toBe(false);\n expect(e.evaluate(mkRule(\"==\", \"true\"), mkForm(true))).toBe(false);\n expect(e.evaluate(mkRule(\"==\", false), mkForm(\"false\"))).toBe(false);\n expect(e.evaluate(mkRule(\"!=\", \"false\"), mkForm(false))).toBe(true);\n });\n\n it(\"does not loosely match falsy values against booleans\", () => {\n expect(e.evaluate(mkRule(\"==\", \"\"), mkForm(false))).toBe(false);\n expect(e.evaluate(mkRule(\"==\", 0), mkForm(false))).toBe(false);\n expect(e.evaluate(mkRule(\"==\", false), mkForm(0))).toBe(false);\n expect(e.evaluate(mkRule(\"==\", true), mkForm(1))).toBe(false);\n });\n\n it(\"compares plain strings as strings\", () => {\n expect(e.evaluate(mkRule(\"==\", \"false\"), mkForm(\"false\"))).toBe(true);\n expect(e.evaluate(mkRule(\"==\", \"map\"), mkForm(\"map\"))).toBe(true);\n expect(e.evaluate(mkRule(\"!=\", \"map\"), mkForm(\"other\"))).toBe(true);\n });\n\n it(\"does not treat an empty field as false\", () => {\n expect(e.evaluate(mkRule(\"==\", false), mkForm(null))).toBe(false);\n });\n\n it(\"compares numbers with number and numeric string rule values\", () => {\n expect(e.evaluate(mkRule(\"==\", 5), mkForm(5))).toBe(true);\n expect(e.evaluate(mkRule(\"==\", \"5\"), mkForm(5))).toBe(true);\n expect(e.evaluate(mkRule(\"!=\", 5), mkForm(6))).toBe(true);\n expect(e.evaluate(mkRule(\">\", 5), mkForm(6))).toBe(true);\n expect(e.evaluate(mkRule(\"gte\", 5), mkForm(5))).toBe(true);\n expect(e.evaluate(mkRule(\"<\", 5), mkForm(6))).toBe(false);\n expect(e.evaluate(mkRule(\"lte\", \"5\"), mkForm(4))).toBe(true);\n });\n });\n });\n\n describe(\"rules with typed values on layout elements\", () => {\n const createAdvancedForm = (ruleValue: IRule[\"value\"]) =>\n createForm({\n fields: fields => ({\n advanced: fields.text().label(\"Advanced\").defaultValue(false),\n options: fields.text().label(\"Options\"),\n map: fields.text().label(\"Map\")\n }),\n layout: layout => [\n layout.row(\"advanced\"),\n layout\n .tabs(\"tabs\")\n .rules([\n {\n type: \"condition\",\n target: \"advanced\",\n operator: \"==\",\n value: ruleValue,\n action: \"hide\"\n }\n ])\n .tab(\"tab1\", tab => {\n tab.label(\"Tab 1\").layout(layout => [layout.row(\"options\")]);\n })\n .tab(\"tab2\", tab => {\n tab.label(\"Tab 2\")\n .rules([\n {\n type: \"condition\",\n target: \"options\",\n operator: \"!=\",\n value: \"map\",\n action: \"disable\"\n }\n ])\n .layout(layout => [layout.row(\"map\")]);\n })\n ]\n });\n\n const tabsVm = (form: IFormModel) =>\n form.vm.layout.find(n => n.type === \"tabs\") as ITabsNodeVM | undefined;\n\n it(\"hides tabs while a boolean field equals false\", () => {\n const form = createAdvancedForm(false);\n\n expect(tabsVm(form)).toBeUndefined();\n expect(form.field(\"options\").visible).toBe(false);\n\n form.field(\"advanced\").setValue(true);\n expect(tabsVm(form)).toBeDefined();\n expect(form.field(\"options\").visible).toBe(true);\n\n form.field(\"advanced\").setValue(false);\n expect(tabsVm(form)).toBeUndefined();\n });\n\n it(\"disables a tab until its string condition stops matching\", () => {\n const form = createAdvancedForm(false);\n form.field(\"advanced\").setValue(true);\n\n expect(tabsVm(form)!.tabs[1].disabled).toBe(true);\n expect(form.field(\"map\").vm.disabled).toBe(true);\n\n form.field(\"options\").setValue(\"map\");\n expect(tabsVm(form)!.tabs[1].disabled).toBe(false);\n expect(form.field(\"map\").vm.disabled).toBe(false);\n });\n });\n});\n\ndescribe(\"disabled cascades into containers\", () => {\n it(\"disables the children of a disabled object field\", () => {\n const form = createForm({\n fields: fields => ({\n title: fields.text().label(\"Title\"),\n meta: fields\n .object()\n .label(\"Meta\")\n .disabled()\n .fields(inner => ({\n source: inner.text().label(\"Source\"),\n comment: inner.text().label(\"Comment\")\n }))\n })\n });\n\n expect(form.field(\"meta\").disabled).toBe(true);\n expect(form.field(\"meta.source\").disabled).toBe(true);\n expect(form.field(\"meta.comment\").disabled).toBe(true);\n expect(form.field(\"title\").disabled).toBe(false);\n });\n\n it(\"reaches grandchildren of a disabled object field\", () => {\n const form = createForm({\n fields: fields => ({\n outer: fields\n .object()\n .label(\"Outer\")\n .disabled()\n .fields(inner => ({\n nested: inner\n .object()\n .label(\"Nested\")\n .fields(deep => ({\n value: deep.text().label(\"Value\")\n }))\n }))\n })\n });\n\n expect(form.field(\"outer.nested\").disabled).toBe(true);\n expect(form.field(\"outer.nested.value\").disabled).toBe(true);\n });\n\n it(\"leaves children alone when the container is not disabled\", () => {\n const form = createForm({\n fields: fields => ({\n meta: fields\n .object()\n .label(\"Meta\")\n .fields(inner => ({\n source: inner.text().label(\"Source\").disabled(),\n comment: inner.text().label(\"Comment\")\n }))\n })\n });\n\n expect(form.field(\"meta\").disabled).toBe(false);\n expect(form.field(\"meta.source\").disabled).toBe(true);\n expect(form.field(\"meta.comment\").disabled).toBe(false);\n });\n\n it(\"picks up a container disabled after the form was built\", () => {\n const form = createForm({\n fields: fields => ({\n meta: fields\n .object()\n .label(\"Meta\")\n .fields(inner => ({\n source: inner.text().label(\"Source\")\n }))\n })\n });\n\n expect(form.field(\"meta.source\").disabled).toBe(false);\n form.field(\"meta\").setDisabled(true);\n expect(form.field(\"meta.source\").disabled).toBe(true);\n });\n});\n"],"names":["createForm","config","container","Container","IdentityContextFeature","FormModelFeature","FormModelFactory","describe","it","form","fields","expect","valid","valid2","e","layout","tab","tabs","tabsVm","n","FeatureFlagEvaluator","enabledFlags","rule","ConditionRuleEvaluator","mkForm","value","undefined","mkRule","operator","field","out","createAdvancedForm","ruleValue","inner","deep"],"mappings":";;;;;;AAcA,SAASA,WAAWC,MAInB;IACG,MAAMC,YAAY,IAAIC;IACtBC,uBAAuB,QAAQ,CAACF;IAChCG,iBAAiB,QAAQ,CAACH;IAC1B,OAAOA,UAAU,OAAO,CAACI,kBAAkB,MAAM,CAAC;QAC9C,QAAQL,OAAO,MAAM;QACrB,QAAQA,OAAO,MAAM;QACrB,gBAAgBA,OAAO,eAAe;IAC1C;AACJ;AAEAM,SAAS,gBAAgB;IACrBA,SAAS,6BAA6B;QAClCC,GAAG,uCAAuC;YACtC,MAAMC,OAAOT,WAAW;gBACpB,QAAQU,CAAAA,SAAW;wBACf,OAAOA,OAAO,IAAI,GAAG,KAAK,CAAC;wBAC3B,UAAUA,OACL,IAAI,GACJ,KAAK,CAA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7C,SAASA,MAAM,IAAI,GAAG,KAAK,CAAC;wBAChC;gBACR;QACJ;QAEAtB,OAAOF,KAAK,KAAK,CAAC,QAAQ,QAAQ,EAAE,IAAI,CAAC;QACzCE,OAAOF,KAAK,KAAK,CAAC,eAAe,QAAQ,EAAE,IAAI,CAAC;QAChDE,OAAOF,KAAK,KAAK,CAAC,gBAAgB,QAAQ,EAAE,IAAI,CAAC;IACrD;IAEAD,GAAG,0DAA0D;QACzD,MAAMC,OAAOT,WAAW;YACpB,QAAQU,CAAAA,SAAW;oBACf,MAAMA,OACD,MAAM,GACN,KAAK,CAAC,QACN,MAAM,CAACuB,CAAAA,QAAU;4BACd,QAAQA,MAAM,IAAI,GAAG,KAAK,CAAC;wBAC/B;gBACR;QACJ;QAEAtB,OAAOF,KAAK,KAAK,CAAC,eAAe,QAAQ,EAAE,IAAI,CAAC;QAChDA,KAAK,KAAK,CAAC,QAAQ,WAAW,CAAC;QAC/BE,OAAOF,KAAK,KAAK,CAAC,eAAe,QAAQ,EAAE,IAAI,CAAC;IACpD;AACJ"}
|
|
@@ -65,12 +65,12 @@ export type DisabledWhenCallback = (params: IFieldCallbackParams) => boolean;
|
|
|
65
65
|
export type ComputedFieldCallback = (params: IFieldCallbackParams) => unknown;
|
|
66
66
|
export type FieldContextCallback = (params: IFieldCallbackParams) => Record<string, unknown>;
|
|
67
67
|
export type RuleAction = "hide" | "disable";
|
|
68
|
-
export type RuleOperator = "eq" | "neq" | "isEmpty" | "isNotEmpty" | "isTruthy" | "isFalsy" | "matches";
|
|
68
|
+
export type RuleOperator = "==" | "eq" | "!=" | "neq" | ">" | "gt" | "<" | "lt" | ">=" | "gte" | "<=" | "lte" | "isEmpty" | "isNotEmpty" | "isTruthy" | "isFalsy" | "matches" | "contains" | "notContains" | "startsWith" | "notStartsWith" | "endsWith" | "notEndsWith";
|
|
69
69
|
export interface IRule {
|
|
70
70
|
type: string;
|
|
71
71
|
target: string;
|
|
72
72
|
operator: RuleOperator | (string & {});
|
|
73
|
-
value: string | null;
|
|
73
|
+
value: string | number | boolean | null;
|
|
74
74
|
action: RuleAction;
|
|
75
75
|
}
|
|
76
76
|
export interface IRuleEvaluator {
|
|
@@ -89,6 +89,8 @@ export interface IFieldValidation {
|
|
|
89
89
|
}
|
|
90
90
|
export interface IFieldVM {
|
|
91
91
|
name: string;
|
|
92
|
+
/** Full dotted path of the field within the form (e.g. "author.address.street"). */
|
|
93
|
+
qualifiedName: string;
|
|
92
94
|
type: string;
|
|
93
95
|
label?: string;
|
|
94
96
|
help?: string;
|
|
@@ -171,6 +173,7 @@ export interface ITemplateIcon {
|
|
|
171
173
|
export interface ITemplateVM {
|
|
172
174
|
id: string;
|
|
173
175
|
label: string;
|
|
176
|
+
description?: string;
|
|
174
177
|
icon?: ITemplateIcon;
|
|
175
178
|
}
|
|
176
179
|
export interface IField {
|
|
@@ -185,7 +188,13 @@ export interface IField {
|
|
|
185
188
|
setValueSilent(value: unknown): void;
|
|
186
189
|
setDisabled(value: boolean): void;
|
|
187
190
|
setVisible(value: boolean): void;
|
|
188
|
-
|
|
191
|
+
/**
|
|
192
|
+
* `parentPath` is the parent's qualified name. `scopePath` returns a path that
|
|
193
|
+
* `form.field()` resolves to the parent itself; it differs from `parentPath` for
|
|
194
|
+
* list item children, where it includes the item index (`blocks.2`). `$.` rule
|
|
195
|
+
* targets and `field.parent()` resolve against it. Defaults to `parentPath`.
|
|
196
|
+
*/
|
|
197
|
+
setForm(form: IFormModel, parentPath?: string, scopePath?: () => string): void;
|
|
189
198
|
setAncestorRules(rules: IRule[]): void;
|
|
190
199
|
setValidation(validation: IFieldValidation): void;
|
|
191
200
|
resetValidation(): void;
|
|
@@ -252,18 +261,27 @@ export interface IObjectFieldConfig extends IFieldConfig {
|
|
|
252
261
|
isList: boolean;
|
|
253
262
|
listSchema?: z.ZodTypeAny;
|
|
254
263
|
templates?: ITemplateConfig[];
|
|
264
|
+
/**
|
|
265
|
+
* Inner layout declared on the field itself via `.layout()`. A `layout.object()`
|
|
266
|
+
* node in the parent layout takes precedence over it.
|
|
267
|
+
*/
|
|
268
|
+
layout?: LayoutNode[];
|
|
255
269
|
}
|
|
256
270
|
export interface ITemplateBuilder {
|
|
257
271
|
label(text: string): this;
|
|
272
|
+
description(text: string): this;
|
|
258
273
|
icon(icon: ITemplateIcon): this;
|
|
259
274
|
fields(factory: (registry: IFieldBuilderRegistry) => Record<string, IFieldBuilder>): this;
|
|
275
|
+
layout(factory: (layout: ILayoutBuilder) => ILayoutNodeBuilder[]): this;
|
|
260
276
|
visible(predicate: (form: IFormModel) => boolean): this;
|
|
261
277
|
}
|
|
262
278
|
export interface ITemplateConfig {
|
|
263
279
|
id: string;
|
|
264
280
|
label: string;
|
|
281
|
+
description?: string;
|
|
265
282
|
icon?: ITemplateIcon;
|
|
266
283
|
childBuilders: Record<string, IFieldBuilder>;
|
|
284
|
+
layout?: LayoutNode[];
|
|
267
285
|
visible?: (form: IFormModel) => boolean;
|
|
268
286
|
}
|
|
269
287
|
export interface IObjectField extends ITypedField<Record<string, unknown> | null> {
|
|
@@ -324,6 +342,8 @@ export type BeforeChangeCallback = (value: unknown, params: IFieldCallbackParams
|
|
|
324
342
|
export type AfterChangeCallback = (value: unknown, params: IFieldCallbackParams) => void;
|
|
325
343
|
export type AfterSetValueCallback = (value: unknown, params: IFieldCallbackParams) => void;
|
|
326
344
|
export type OnBlurCallback = (value: unknown, params: IFieldCallbackParams) => void;
|
|
345
|
+
/** Builds a field's schema from the zod it's given, so callers needn't import zod themselves. */
|
|
346
|
+
export type FieldSchemaCallback = (zod: typeof z) => z.ZodTypeAny;
|
|
327
347
|
export type CloneValueCallback = (value: unknown) => unknown;
|
|
328
348
|
export type LayoutNode = IRowNode | ISeparatorNode | IAlertNode | ITabsNode | IElementNode | IObjectNode;
|
|
329
349
|
export interface IRowNode {
|
|
@@ -583,6 +603,13 @@ export interface IFormModel<T = Record<string, any>> {
|
|
|
583
603
|
}): void;
|
|
584
604
|
reset(): void;
|
|
585
605
|
validate(): Promise<boolean>;
|
|
606
|
+
/**
|
|
607
|
+
* Assign errors from outside the form, e.g. a rejected save. Errors whose `path`
|
|
608
|
+
* resolves to a visible field become that field's validation error; the rest are
|
|
609
|
+
* form-level. The form is marked as submitted so `FormErrors` renders them. They are
|
|
610
|
+
* cleared by the next `validate()`, `setData()` or `reset()`.
|
|
611
|
+
*/
|
|
612
|
+
setErrors(errors: IFormError[]): void;
|
|
586
613
|
submit<T = Record<string, unknown>>(options?: {
|
|
587
614
|
skipValidation?: boolean;
|
|
588
615
|
}): Promise<T | false>;
|
|
@@ -698,7 +725,8 @@ export interface IFieldBuilder<TType extends string = string, TOptions extends b
|
|
|
698
725
|
note(text: string): this;
|
|
699
726
|
placeholder(text: string): this;
|
|
700
727
|
autoFocus(value?: boolean): this;
|
|
701
|
-
schema
|
|
728
|
+
/** A zod schema, or a callback that builds one from the zod it's given. */
|
|
729
|
+
schema(zodSchema: z.ZodTypeAny | FieldSchemaCallback): this;
|
|
702
730
|
defaultValue(value: unknown): this;
|
|
703
731
|
renderer<TName extends FieldRendererName<TType, TOptions>>(name: TName, ...args: undefined extends FieldRendererSettings<TName> ? [settings?: FieldRendererSettings<TName>] : FieldRendererSettings<TName> extends undefined ? [] : [settings: FieldRendererSettings<TName>]): this;
|
|
704
732
|
hidden(): this;
|
|
@@ -719,6 +747,8 @@ export interface IFieldBuilder<TType extends string = string, TOptions extends b
|
|
|
719
747
|
afterSetValue(fn: AfterSetValueCallback): this;
|
|
720
748
|
onBlur(fn: OnBlurCallback): this;
|
|
721
749
|
cloneValue(fn: CloneValueCallback): this;
|
|
750
|
+
/** Reactive context for the field's renderer (`field.context`), computed from the form. */
|
|
751
|
+
context(fn: FieldContextCallback): this;
|
|
722
752
|
getName(): string;
|
|
723
753
|
getType(): string;
|
|
724
754
|
getTags(): string[];
|
|
@@ -746,6 +776,12 @@ export interface IObjectFieldBuilder extends IFieldBuilder<"object", false, Reco
|
|
|
746
776
|
list(): this;
|
|
747
777
|
listSchema(schema: z.ZodTypeAny): this;
|
|
748
778
|
template(id: string, configure: (t: ITemplateBuilder) => void): this;
|
|
779
|
+
/**
|
|
780
|
+
* Lay out the object's children: rows of child field names, plus separators, alerts
|
|
781
|
+
* and tabs. Applies to the single object and to every list item. Templated objects
|
|
782
|
+
* declare their layouts per template instead.
|
|
783
|
+
*/
|
|
784
|
+
layout(factory: (layout: ILayoutBuilder) => ILayoutNodeBuilder[]): this;
|
|
749
785
|
}
|
|
750
786
|
export interface IFieldBuilderRegistry {
|
|
751
787
|
}
|
|
@@ -759,6 +795,22 @@ export declare namespace FieldType {
|
|
|
759
795
|
type FieldBuilder = IFieldBuilder;
|
|
760
796
|
type FieldBuilderRegistry = IFieldBuilderRegistry;
|
|
761
797
|
}
|
|
798
|
+
/**
|
|
799
|
+
* Turns a field's value into the text shown where the value is summarised rather than edited,
|
|
800
|
+
* such as an accordion item's title. Register one for a field type whose raw value is not
|
|
801
|
+
* readable, like a reference, which holds an entry ID rather than the entry's title.
|
|
802
|
+
*
|
|
803
|
+
* `format` is read inside an observer, so it may return `undefined` while it loads a value and
|
|
804
|
+
* an observable value once it has it.
|
|
805
|
+
*/
|
|
806
|
+
export interface IFieldValueFormatter {
|
|
807
|
+
readonly type: string;
|
|
808
|
+
format(field: IFieldVM): string | undefined;
|
|
809
|
+
}
|
|
810
|
+
export declare const FieldValueFormatter: import("@webiny/di").Abstraction<IFieldValueFormatter>;
|
|
811
|
+
export declare namespace FieldValueFormatter {
|
|
812
|
+
type Interface = IFieldValueFormatter;
|
|
813
|
+
}
|
|
762
814
|
export declare const FieldBuilderRegistry: import("@webiny/di").Abstraction<IFieldBuilderRegistry>;
|
|
763
815
|
export declare namespace FieldBuilderRegistry {
|
|
764
816
|
type Interface = IFieldBuilderRegistry;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { createAbstraction } from "@webiny/feature/admin";
|
|
2
2
|
const FieldType = createAbstraction("FormModel/FieldType");
|
|
3
|
+
const FieldValueFormatter = createAbstraction("FormModel/FieldValueFormatter");
|
|
3
4
|
const FieldBuilderRegistry = createAbstraction("FormModel/FieldBuilderRegistry");
|
|
4
5
|
const FormModelFactory = createAbstraction("FormModelFactory");
|
|
5
6
|
const RuleEvaluator = createAbstraction("FormModelRuleEvaluator");
|
|
6
|
-
export { FieldBuilderRegistry, FieldType, FormModelFactory, RuleEvaluator };
|
|
7
|
+
export { FieldBuilderRegistry, FieldType, FieldValueFormatter, FormModelFactory, RuleEvaluator };
|
|
7
8
|
|
|
8
9
|
//# sourceMappingURL=abstractions.js.map
|