@phis/ui 0.7.8 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/cms/phi-cms-layout-renderer.js +15 -7
- package/components/cms/phi-cms-render-diagnostic-client.d.ts +3 -1
- package/components/cms/phi-cms-render-diagnostic-client.js +4 -3
- package/components/cms/phi-cms-render-diagnostic.d.ts +8 -2
- package/components/cms/phi-cms-render-diagnostic.js +12 -2
- package/components/cms/phi-cms-render-error-boundary.d.ts +2 -0
- package/components/cms/phi-cms-render-error-boundary.js +1 -1
- package/components/cms/phi-cms-root-layout.js +3 -1
- package/components/controls/phi-address-control.d.ts +23 -0
- package/components/controls/phi-address-control.js +43 -0
- package/components/controls/phi-color-control.d.ts +3 -1
- package/components/controls/phi-color-control.js +2 -2
- package/components/controls/phi-country-select-control.d.ts +22 -0
- package/components/controls/phi-country-select-control.js +16 -0
- package/components/controls/phi-dialog-control.d.ts +1 -1
- package/components/controls/phi-drawer-control-adapter.d.ts +1 -1
- package/components/controls/phi-drawer-control-adapter.js +5 -3
- package/components/controls/phi-drawer-control.d.ts +7 -5
- package/components/controls/phi-float-button-control.d.ts +8 -1
- package/components/controls/phi-float-button-control.js +19 -3
- package/components/controls/phi-form-control.js +52 -8
- package/components/controls/phi-media-picker-control.d.ts +9 -0
- package/components/controls/phi-media-picker-control.js +1 -1
- package/components/controls/phi-modal-control-adapter.d.ts +1 -1
- package/components/controls/phi-modal-control-adapter.js +14 -37
- package/components/controls/phi-modal-control.d.ts +5 -5
- package/components/controls/phi-options-provider.d.ts +1 -0
- package/components/controls/phi-options-provider.js +1 -0
- package/components/controls/phi-overlay-control-contract.d.ts +52 -17
- package/components/controls/phi-overlay-control-contract.js +55 -30
- package/components/controls/phi-popover-control.js +4 -1
- package/components/controls/phi-reveal-once-dialog-control.d.ts +21 -0
- package/components/controls/phi-reveal-once-dialog-control.js +52 -0
- package/components/controls/phi-reveal-once-dialog-labels.d.ts +10 -0
- package/components/controls/phi-reveal-once-dialog-labels.js +5 -0
- package/components/controls/phi-table-control.d.ts +7 -1
- package/components/controls/phi-table-control.js +23 -8
- package/components/forms/flags-field.d.ts +22 -0
- package/components/forms/flags-field.js +58 -0
- package/components/forms/form-descriptor-field-check.d.ts +18 -0
- package/components/forms/form-descriptor-field-check.js +41 -0
- package/components/forms/form-descriptor-runtime-client.js +11 -10
- package/components/forms/form-option-flags.d.ts +20 -0
- package/components/forms/form-option-flags.js +38 -0
- package/components/forms/form-provider-contract.d.ts +23 -0
- package/components/forms/form-provider-contract.js +36 -0
- package/components/forms/form-provider-registry.d.ts +5 -1
- package/components/forms/form-record-source.d.ts +38 -0
- package/components/forms/form-record-source.js +48 -0
- package/components/forms/shared-form-descriptors.d.ts +0 -34
- package/components/forms/shared-form-descriptors.js +0 -6
- package/components/forms/shared-form-ids.d.ts +1 -1
- package/components/forms/shared-form-ids.js +1 -1
- package/components/forms/shared-form-provider-registry.js +13 -0
- package/components/forms/structured-field-labels.d.ts +24 -0
- package/components/forms/structured-field-labels.js +43 -0
- package/components/forms/structured-form-field-controls.d.ts +12 -0
- package/components/forms/structured-form-field-controls.js +65 -0
- package/components/media/media-settings-labels.d.ts +1 -0
- package/components/media/media-settings-labels.js +2 -0
- package/components/media/phi-media-picker-binding.d.ts +41 -33
- package/components/media/phi-media-picker-binding.js +2 -1
- package/components/media/use-media-library-add-picker.d.ts +33 -32
- package/components/overlays/phi-overlay-container-client.js +13 -11
- package/components/regions/phi-cms-region-shell.js +2 -2
- package/components/regions/presets/content-entry-editor-page-tree.js +12 -3
- package/components/regions/presets/phi-settings-page-shell-tree.d.ts +13 -2
- package/components/regions/presets/phi-settings-page-shell-tree.js +4 -4
- package/components/root/phi-root-theme-resolver.js +3 -0
- package/components/shell/phi-antd-icon.d.ts +1 -8
- package/components/shell/phi-antd-icon.js +1 -227
- package/components/shell/phi-icon-names.d.ts +22 -0
- package/components/shell/phi-icon-names.js +267 -0
- package/components/shell/phi-icon.d.ts +4 -15
- package/components/shell/phi-icon.js +9 -50
- package/components/tables/client/phi-table-binding-params.d.ts +24 -0
- package/components/tables/client/phi-table-binding-params.js +39 -0
- package/components/tables/client/phi-table-binding.d.ts +1 -3
- package/components/tables/client/phi-table-binding.js +5 -9
- package/components/widgets/client/shared/phi-button-icons.d.ts +6 -4
- package/components/widgets/client/shared/phi-button-icons.js +8 -12
- package/components/widgets/client/shared/phi-collection-binding-params.d.ts +8 -0
- package/components/widgets/client/shared/phi-collection-binding-params.js +13 -0
- package/components/widgets/client/shared/phi-collection-provider.d.ts +11 -1
- package/components/widgets/client/shared/phi-collection-provider.js +5 -0
- package/components/widgets/client/shared/phi-collection-view-binding.d.ts +1 -0
- package/components/widgets/client/shared/phi-command-buttons.d.ts +29 -2
- package/components/widgets/client/shared/phi-command-buttons.js +19 -5
- package/components/widgets/client/shared/phi-rendered-value.js +27 -3
- package/components/widgets/client/shared/phi-table-provider-refusal.d.ts +13 -0
- package/components/widgets/client/shared/phi-table-provider-refusal.js +13 -0
- package/components/widgets/config/background.d.ts +3 -2
- package/components/widgets/config/choice-shared.d.ts +10 -1
- package/components/widgets/config/choice-shared.js +8 -2
- package/components/widgets/label-sets/admin-locales.js +1 -1
- package/components/widgets/label-sets/admin-users.d.ts +3 -5
- package/components/widgets/label-sets/admin-users.js +6 -10
- package/components/widgets/label-sets/builder-modules.js +4 -0
- package/components/widgets/label-sets/effects.js +2 -4
- package/components/widgets/label-sets/profile.d.ts +13 -16
- package/components/widgets/label-sets/profile.js +24 -33
- package/components/widgets/label-sets/registration.d.ts +0 -1
- package/components/widgets/label-sets/registration.js +0 -2
- package/components/widgets/label-sets/revisions.js +2 -0
- package/components/widgets/label-sets/search-results.js +2 -4
- package/components/widgets/label-sets/signals.js +2 -0
- package/components/widgets/label-sets/table.js +9 -0
- package/components/widgets/label-types/builder-modules.d.ts +4 -0
- package/components/widgets/label-types/builder-modules.js +2 -0
- package/components/widgets/label-types/effects.d.ts +3 -2
- package/components/widgets/label-types/effects.js +1 -2
- package/components/widgets/label-types/revisions.d.ts +2 -0
- package/components/widgets/label-types/revisions.js +2 -1
- package/components/widgets/label-types/search-results.d.ts +2 -2
- package/components/widgets/label-types/search-results.js +1 -2
- package/components/widgets/label-types/signals.d.ts +2 -0
- package/components/widgets/label-types/signals.js +1 -0
- package/components/widgets/label-types/table.d.ts +3 -0
- package/components/widgets/label-types/table.js +2 -0
- package/components/widgets/server/builder-chrome.d.ts +4 -1
- package/components/widgets/server/builder-chrome.js +2 -2
- package/components/widgets/shared/markdown-body-client.d.ts +26 -0
- package/components/widgets/shared/markdown-body-client.js +31 -1
- package/components/widgets/shared/markdown-render.d.ts +10 -2
- package/components/widgets/shared/markdown-render.js +35 -13
- package/components/widgets/shared/widget-failure-audience.d.ts +7 -0
- package/components/widgets/shared/widget-failure-audience.js +21 -0
- package/components/widgets/shared/widget-failure-client.js +5 -2
- package/components/widgets/shared/widget-failure-notice-client.d.ts +6 -0
- package/components/widgets/shared/widget-failure-notice-client.js +10 -0
- package/components/widgets/shared/widget-failure-notice.d.ts +6 -0
- package/components/widgets/shared/widget-failure-notice.js +17 -0
- package/components/widgets/shared/widget-failure-staff.d.ts +3 -0
- package/components/widgets/shared/widget-failure-staff.js +18 -0
- package/components/widgets/shared/widget-failure.d.ts +9 -6
- package/components/widgets/shared/widget-failure.js +0 -9
- package/components/widgets/shared/widget-failure.server.d.ts +4 -2
- package/components/widgets/shared/widget-failure.server.js +8 -3
- package/constants/countries.d.ts +9 -0
- package/constants/countries.js +28 -0
- package/constants/customer-file.d.ts +34 -0
- package/constants/customer-file.js +35 -0
- package/constants/record-field-kinds.d.ts +15 -0
- package/constants/record-field-kinds.js +13 -0
- package/constants/runtime-module-ownership.js +15 -2
- package/constants/runtime-render-client-types.d.ts +5 -0
- package/constants/runtime-render-client-types.js +5 -0
- package/constants/site-address.d.ts +9 -0
- package/constants/site-address.js +10 -0
- package/constants/table-loading.d.ts +14 -0
- package/constants/table-loading.js +14 -0
- package/{plugins/runtime-modules/threads/controller/address.js → constants/threads-controller-address.js} +1 -1
- package/constants.d.ts +2 -0
- package/constants.js +4 -0
- package/gateway/form-handler-request.d.ts +22 -0
- package/gateway/form-handler-request.js +40 -0
- package/gateway/label-set.d.ts +15 -2
- package/gateway/label-set.js +60 -22
- package/gateway/site-cms-write-validation.js +19 -3
- package/gateway/site-form-route.js +11 -2
- package/helpers/address-field.d.ts +43 -0
- package/helpers/address-field.js +68 -0
- package/helpers/announced-action.d.ts +17 -0
- package/helpers/announced-action.js +29 -0
- package/helpers/cms-dialog.d.ts +5 -20
- package/helpers/cms-dialog.js +8 -13
- package/helpers/cms-page-catalog.d.ts +10 -0
- package/helpers/cms-page-catalog.js +19 -0
- package/helpers/cms-preset-nodes.d.ts +4 -4
- package/helpers/cms-preset-nodes.js +1 -1
- package/helpers/cms-region-keys.d.ts +1 -1
- package/helpers/country-names.d.ts +12 -0
- package/helpers/country-names.js +14 -0
- package/helpers/phi-metadata.d.ts +25 -1
- package/helpers/phi-metadata.js +53 -1
- package/helpers/phi-site-description.d.ts +11 -0
- package/helpers/phi-site-description.js +13 -0
- package/helpers/preset-form-check.d.ts +14 -0
- package/helpers/preset-form-check.js +12 -0
- package/helpers/preset-table-check.d.ts +38 -0
- package/helpers/preset-table-check.js +118 -0
- package/helpers/preset-text-source-check.d.ts +4 -1
- package/helpers/preset-text-source-check.js +6 -1
- package/helpers/preset-tree-contract-check.d.ts +3 -2
- package/helpers/preset-tree-contract-check.js +30 -5
- package/helpers/public-route-claims.d.ts +9 -1
- package/helpers/public-route-claims.js +23 -3
- package/helpers/record-fields.d.ts +1 -5
- package/helpers/record-fields.js +15 -6
- package/helpers/record-widget-binding.d.ts +10 -0
- package/helpers/record-widget-binding.js +35 -0
- package/helpers/record-widget.d.ts +1 -10
- package/helpers/record-widget.js +4 -33
- package/helpers/route-address-check.d.ts +22 -2
- package/helpers/route-address-check.js +29 -8
- package/helpers/site-address-row.d.ts +23 -0
- package/helpers/site-address-row.js +36 -0
- package/helpers/surface-style.d.ts +8 -1
- package/helpers/surface-style.js +12 -2
- package/helpers/table-widget-binding.d.ts +12 -0
- package/helpers/table-widget-binding.js +296 -0
- package/helpers/thread-inbox-row.d.ts +20 -0
- package/helpers/thread-inbox-row.js +26 -0
- package/helpers/translation-format.d.ts +26 -0
- package/helpers/translation-format.js +31 -0
- package/helpers/tree-widget-binding.d.ts +19 -0
- package/helpers/tree-widget-binding.js +72 -0
- package/helpers/typed-confirmation.d.ts +9 -0
- package/helpers/typed-confirmation.js +13 -0
- package/helpers/widget-binding-check.d.ts +22 -0
- package/helpers/widget-binding-check.js +91 -0
- package/module-labels.d.ts +1 -1
- package/module-labels.js +1 -1
- package/module-page-check.d.ts +3 -0
- package/module-page-check.js +3 -0
- package/module-records.d.ts +2 -2
- package/module-records.js +1 -0
- package/next/area-route.js +34 -1
- package/next/root-route.js +4 -4
- package/package.json +2 -2
- package/plugins/runtime-modules/accounting/customer-file-access.d.ts +11 -0
- package/plugins/runtime-modules/accounting/customer-file-access.js +12 -0
- package/plugins/runtime-modules/accounting/data-providers.js +1 -1
- package/plugins/runtime-modules/accounting/ids.d.ts +14 -0
- package/plugins/runtime-modules/accounting/ids.js +34 -0
- package/plugins/runtime-modules/accounting/presets.js +32 -5
- package/plugins/runtime-modules/accounting/trees/accounting-customer-file-label-set.d.ts +78 -0
- package/plugins/runtime-modules/accounting/trees/accounting-customer-file-label-set.js +136 -0
- package/plugins/runtime-modules/accounting/trees/accounting-products-label-set.js +2 -2
- package/plugins/runtime-modules/accounting/trees/phi-default-accounting-customer-file-page-tree.d.ts +29 -0
- package/plugins/runtime-modules/accounting/trees/phi-default-accounting-customer-file-page-tree.js +450 -0
- package/plugins/runtime-modules/accounting/trees/phi-default-accounting-products-page-tree.js +4 -0
- package/plugins/runtime-modules/app/client-data-providers.d.ts +7 -0
- package/plugins/runtime-modules/app/client-data-providers.js +9 -0
- package/plugins/runtime-modules/app/data-providers.d.ts +43 -0
- package/plugins/runtime-modules/app/data-providers.js +45 -0
- package/plugins/runtime-modules/app/definition.d.ts +60 -1
- package/plugins/runtime-modules/app/definition.js +2 -0
- package/plugins/runtime-modules/app/forms.d.ts +33 -3
- package/plugins/runtime-modules/app/forms.js +166 -31
- package/plugins/runtime-modules/app/ids.d.ts +8 -0
- package/plugins/runtime-modules/app/ids.js +9 -0
- package/plugins/runtime-modules/app/module.d.ts +60 -1
- package/plugins/runtime-modules/app/services/addresses-collection.d.ts +59 -0
- package/plugins/runtime-modules/app/services/addresses-collection.js +105 -0
- package/plugins/runtime-modules/app/trees/account-addresses-panel.d.ts +21 -0
- package/plugins/runtime-modules/app/trees/account-addresses-panel.js +143 -0
- package/plugins/runtime-modules/app/trees/addresses-label-set.d.ts +57 -0
- package/plugins/runtime-modules/app/trees/addresses-label-set.js +104 -0
- package/plugins/runtime-modules/app/trees/phi-default-app-profile-page-tree.d.ts +1 -2
- package/plugins/runtime-modules/app/trees/phi-default-app-profile-page-tree.js +28 -19
- package/plugins/runtime-modules/app/trees/profile-label-set.d.ts +1 -2
- package/plugins/runtime-modules/app/trees/profile-label-set.js +5 -14
- package/plugins/runtime-modules/asset/presets.d.ts +4 -0
- package/plugins/runtime-modules/asset/trees/phi-default-admin-media-settings-page-tree.js +5 -0
- package/plugins/runtime-modules/asset/trees/phi-default-builder-media-page-tree.js +4 -2
- package/plugins/runtime-modules/auth/trees/phi-auth-area-overlay-tree.server.js +4 -2
- package/plugins/runtime-modules/auth/trees/phi-default-admin-auth-settings-page-tree.js +2 -2
- package/plugins/runtime-modules/auth/widgets/logout/client.d.ts +1 -1
- package/plugins/runtime-modules/auth/widgets/logout/client.js +2 -2
- package/plugins/runtime-modules/auth/widgets/security/client.d.ts +5 -1
- package/plugins/runtime-modules/auth/widgets/security/client.js +12 -10
- package/plugins/runtime-modules/avatar/overlay-tree.server.js +1 -1
- package/plugins/runtime-modules/blog/presets.d.ts +4 -0
- package/plugins/runtime-modules/builder/clients/inspector-config-field.js +16 -6
- package/plugins/runtime-modules/builder/clients/inspector-image-field.d.ts +2 -1
- package/plugins/runtime-modules/builder/clients/inspector-image-field.js +6 -3
- package/plugins/runtime-modules/builder/clients/inspector-section-widget.js +3 -1
- package/plugins/runtime-modules/builder/clients/metadata-table-provider-stand-ins.d.ts +23 -0
- package/plugins/runtime-modules/builder/clients/metadata-table-provider-stand-ins.js +38 -0
- package/plugins/runtime-modules/builder/clients/mode-switch.d.ts +4 -1
- package/plugins/runtime-modules/builder/clients/mode-switch.js +2 -15
- package/plugins/runtime-modules/builder/clients/pages-workspace.js +2 -0
- package/plugins/runtime-modules/builder/clients/runtime-module-authoring-boundary.js +2 -1
- package/plugins/runtime-modules/builder/controller/draft-status-controller.js +28 -1
- package/plugins/runtime-modules/builder/controller/signal-wiring-controller.js +5 -1
- package/plugins/runtime-modules/builder/developer-workspace-types.d.ts +5 -0
- package/plugins/runtime-modules/builder/page-presets.server.d.ts +7 -0
- package/plugins/runtime-modules/builder/page-presets.server.js +10 -1
- package/plugins/runtime-modules/builder/persistence.js +4 -0
- package/plugins/runtime-modules/builder/public-route-collisions.js +8 -3
- package/plugins/runtime-modules/builder/signal-wiring-options.js +9 -2
- package/plugins/runtime-modules/builder/trees/phi-builder-inspector-area-overlay-tree.server.js +8 -1
- package/plugins/runtime-modules/builder/trees/phi-default-builder-area-preset-tree.js +47 -7
- package/plugins/runtime-modules/builder/widgets/chrome/config.d.ts +6 -4
- package/plugins/runtime-modules/builder/widgets/chrome/config.js +11 -1
- package/plugins/runtime-modules/builder/widgets/inspector-header/authoring.d.ts +2 -2
- package/plugins/runtime-modules/builder/widgets/inspector-header/plugin.d.ts +2 -2
- package/plugins/runtime-modules/builder/widgets/mode-switch/plugin.js +1 -1
- package/plugins/runtime-modules/builder/widgets/structure-region/built-in.js +2 -2
- package/plugins/runtime-modules/client-manifests/app.js +3 -0
- package/plugins/runtime-modules/client-manifests/builder.js +10 -0
- package/plugins/runtime-modules/client-manifests/common.js +6 -0
- package/plugins/runtime-modules/content-entry-routes.d.ts +4 -0
- package/plugins/runtime-modules/contracts.js +31 -1
- package/plugins/runtime-modules/core/definition.d.ts +23 -0
- package/plugins/runtime-modules/core/form-providers.d.ts +23 -0
- package/plugins/runtime-modules/core/messaging/thread-inbox-table.d.ts +0 -17
- package/plugins/runtime-modules/core/messaging/thread-inbox-table.js +2 -23
- package/plugins/runtime-modules/core/widgets/card/config.d.ts +1 -2
- package/plugins/runtime-modules/core/widgets/card/config.js +0 -1
- package/plugins/runtime-modules/core/widgets/card/editor.js +1 -1
- package/plugins/runtime-modules/core/widgets/collection-view/client.js +5 -2
- package/plugins/runtime-modules/core/widgets/collection-view/config.js +8 -0
- package/plugins/runtime-modules/core/widgets/collection-view/site-address-binding.d.ts +55 -0
- package/plugins/runtime-modules/core/widgets/collection-view/site-address-binding.js +173 -0
- package/plugins/runtime-modules/core/widgets/collection-view/site-address-tiles.d.ts +48 -0
- package/plugins/runtime-modules/core/widgets/collection-view/site-address-tiles.js +67 -0
- package/plugins/runtime-modules/core/widgets/command-toolbar/client.js +3 -0
- package/plugins/runtime-modules/core/widgets/command-toolbar/config.d.ts +316 -1
- package/plugins/runtime-modules/core/widgets/command-toolbar/config.js +4 -4
- package/plugins/runtime-modules/core/widgets/description/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/dimension/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/entry-list/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/float-button/client.js +4 -1
- package/plugins/runtime-modules/core/widgets/float-button/config.d.ts +326 -3
- package/plugins/runtime-modules/core/widgets/float-button/config.js +5 -2
- package/plugins/runtime-modules/core/widgets/form/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/form/config.js +14 -1
- package/plugins/runtime-modules/core/widgets/gallery/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/header-navigation/client.js +1 -1
- package/plugins/runtime-modules/core/widgets/length/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/markdown/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/markdown/plugin.js +20 -7
- package/plugins/runtime-modules/core/widgets/markdown/server.d.ts +6 -2
- package/plugins/runtime-modules/core/widgets/markdown/server.js +2 -2
- package/plugins/runtime-modules/core/widgets/markdown/table-embeds.server.d.ts +12 -0
- package/plugins/runtime-modules/core/widgets/markdown/table-embeds.server.js +68 -0
- package/plugins/runtime-modules/core/widgets/number-input/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/record/client.js +2 -6
- package/plugins/runtime-modules/core/widgets/result/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/simple-text/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/simple-text/config.js +1 -1
- package/plugins/runtime-modules/core/widgets/simple-text/plugin.js +2 -1
- package/plugins/runtime-modules/core/widgets/table/client.js +48 -51
- package/plugins/runtime-modules/core/widgets/table/config.d.ts +3 -3
- package/plugins/runtime-modules/core/widgets/table/config.js +9 -0
- package/plugins/runtime-modules/core/widgets/table/reader-query.d.ts +17 -0
- package/plugins/runtime-modules/core/widgets/table/reader-query.js +33 -0
- package/plugins/runtime-modules/core/widgets/thread-conversation/client.js +2 -2
- package/plugins/runtime-modules/core/widgets/thread-conversation/config.d.ts +6 -2
- package/plugins/runtime-modules/core/widgets/thread-conversation/config.js +6 -1
- package/plugins/runtime-modules/core/widgets/thread-widget-config.d.ts +10 -0
- package/plugins/runtime-modules/core/widgets/thread-widget-config.js +6 -0
- package/plugins/runtime-modules/core/widgets/tree/client.js +6 -6
- package/plugins/runtime-modules/dashboard/trees/dashboard-cards-page-tree.js +3 -1
- package/plugins/runtime-modules/descriptor-compiler.d.ts +19 -3
- package/plugins/runtime-modules/descriptor-compiler.js +44 -16
- package/plugins/runtime-modules/editor/presets.d.ts +4 -0
- package/plugins/runtime-modules/editor/trees/phi-default-editor-releases-page-tree.js +3 -1
- package/plugins/runtime-modules/groups/trees/phi-default-admin-groups-page-tree.js +5 -1
- package/plugins/runtime-modules/groups/trees/phi-default-app-groups-page-tree.js +5 -1
- package/plugins/runtime-modules/localization/presets.d.ts +4 -0
- package/plugins/runtime-modules/localization/trees/editor-translations-widget-label-set.d.ts +2 -0
- package/plugins/runtime-modules/localization/trees/editor-translations-widget-label-set.js +2 -0
- package/plugins/runtime-modules/localization/trees/phi-default-admin-locales-page-tree.js +3 -1
- package/plugins/runtime-modules/localization/trees/phi-default-editor-translations-page-tree.js +9 -2
- package/plugins/runtime-modules/news/presets.d.ts +4 -0
- package/plugins/runtime-modules/observability/trees/phi-default-admin-logs-page-tree.js +6 -2
- package/plugins/runtime-modules/resolver.js +17 -0
- package/plugins/runtime-modules/revisions/controller/binding.d.ts +37 -0
- package/plugins/runtime-modules/revisions/controller/binding.js +75 -0
- package/plugins/runtime-modules/revisions/controller/client.d.ts +5 -0
- package/plugins/runtime-modules/revisions/controller/client.js +86 -60
- package/plugins/runtime-modules/revisions/controller/definition.d.ts +5 -0
- package/plugins/runtime-modules/revisions/controller/definition.js +10 -0
- package/plugins/runtime-modules/revisions/controller/draft-context-target.d.ts +25 -0
- package/plugins/runtime-modules/revisions/controller/draft-context-target.js +33 -0
- package/plugins/runtime-modules/revisions/forms.js +1 -1
- package/plugins/runtime-modules/revisions/page-ids.d.ts +1 -1
- package/plugins/runtime-modules/revisions/page-ids.js +4 -1
- package/plugins/runtime-modules/revisions/presets.d.ts +4 -0
- package/plugins/runtime-modules/revisions/services/options.js +14 -4
- package/plugins/runtime-modules/revisions/services/table.js +54 -25
- package/plugins/runtime-modules/revisions/trees/phi-default-builder-revisions-page-tree.js +79 -4
- package/plugins/runtime-modules/search/widgets/search-results/client.js +4 -2
- package/plugins/runtime-modules/theme/controller/runtime.js +14 -2
- package/plugins/runtime-modules/theme/presets.d.ts +4 -0
- package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +105 -7
- package/plugins/runtime-modules/theme/widgets/brand-controls/config.d.ts +3 -2
- package/plugins/runtime-modules/theme/widgets/brand-controls/config.js +2 -2
- package/plugins/runtime-modules/theme/widgets/brand-controls/plugin.js +19 -7
- package/plugins/runtime-modules/threads/client-data-providers.js +10 -0
- package/plugins/runtime-modules/threads/controller/client.js +62 -2
- package/plugins/runtime-modules/threads/controller/definition.js +49 -1
- package/plugins/runtime-modules/threads/data-providers.d.ts +100 -2
- package/plugins/runtime-modules/threads/data-providers.js +96 -0
- package/plugins/runtime-modules/threads/definition.d.ts +100 -2
- package/plugins/runtime-modules/threads/definition.js +1 -1
- package/plugins/runtime-modules/threads/ids.d.ts +4 -0
- package/plugins/runtime-modules/threads/ids.js +5 -0
- package/plugins/runtime-modules/threads/services/customer-file-addresses.d.ts +30 -0
- package/plugins/runtime-modules/threads/services/customer-file-addresses.js +59 -0
- package/plugins/runtime-modules/threads/services/customer-file-read.d.ts +22 -0
- package/plugins/runtime-modules/threads/services/customer-file-read.js +101 -0
- package/plugins/runtime-modules/threads/services/customer-file-table.d.ts +126 -0
- package/plugins/runtime-modules/threads/services/customer-file-table.js +79 -0
- package/plugins/runtime-modules/threads/trees/phi-default-threads-page-tree.js +5 -3
- package/plugins/runtime-modules/user-management/client-data-providers.js +5 -0
- package/plugins/runtime-modules/user-management/data-providers.d.ts +159 -0
- package/plugins/runtime-modules/user-management/data-providers.js +101 -3
- package/plugins/runtime-modules/user-management/definition.d.ts +159 -0
- package/plugins/runtime-modules/user-management/ids.d.ts +9 -0
- package/plugins/runtime-modules/user-management/ids.js +9 -0
- package/plugins/runtime-modules/user-management/presets.js +17 -1
- package/plugins/runtime-modules/user-management/services/users-access-table.d.ts +378 -0
- package/plugins/runtime-modules/user-management/services/users-access-table.js +132 -0
- package/plugins/runtime-modules/user-management/trees/admin-users-access-label-set.d.ts +90 -0
- package/plugins/runtime-modules/user-management/trees/admin-users-access-label-set.js +122 -0
- package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-access-page-tree.d.ts +20 -0
- package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-access-page-tree.js +181 -0
- package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-page-tree.js +24 -18
- package/server-helpers/cms-page-record.d.ts +9 -1
- package/server-helpers/cms-page-record.js +11 -1
- package/server-helpers/cms-request.js +8 -5
- package/server-helpers/link-preview-image.d.ts +30 -0
- package/server-helpers/link-preview-image.js +57 -0
- package/server-helpers/runtime.js +0 -1
- package/server-helpers/search-text.js +3 -0
- package/server-helpers.d.ts +1 -1
- package/server-helpers.js +1 -1
- package/styles/controls.css +4 -2
- package/styles/layout.css +7 -0
- package/styles/shell.css +30 -6
- package/theme/phi-antd-token-resolver.d.ts +8 -0
- package/theme/phi-antd-token-resolver.js +10 -0
- package/theme/phi-theme-color.d.ts +19 -0
- package/theme/phi-theme-color.js +42 -0
- package/theme/phi-theme-composition.js +9 -0
- package/theme/phi-theme-gradients.js +4 -22
- package/theme/phi-theme-inverse-ground.d.ts +39 -0
- package/theme/phi-theme-inverse-ground.js +103 -0
- package/theme/phi-theme-palette-defaults.d.ts +16 -0
- package/theme/phi-theme-palette-defaults.js +103 -0
- package/theme/phi-theme-tokens.d.ts +2 -1
- package/theme/phi-theme-tokens.js +2 -0
- package/types/cms-module-descriptors.d.ts +14 -0
- package/types/cms-overlay.d.ts +13 -6
- package/types/cms-overlay.js +6 -22
- package/types/cms-plugins.d.ts +20 -3
- package/types/cms.d.ts +10 -0
- package/types/collection-provider.d.ts +27 -0
- package/types/collection-signal-values.d.ts +2 -0
- package/types/collection-signal-values.js +23 -0
- package/types/collection-view-widget.d.ts +9 -0
- package/types/core-widget-placements.d.ts +9 -3
- package/types/link-preview.d.ts +19 -0
- package/types/link-preview.js +19 -0
- package/types/record-provider.d.ts +22 -1
- package/types/signals.d.ts +2 -0
- package/types/signals.js +2 -0
- package/types/site-theme.d.ts +27 -0
- package/types/table-embed.d.ts +48 -0
- package/types/table-embed.js +1 -0
- package/types/table-widget.d.ts +29 -1
- package/types/table-widget.js +0 -282
- package/types/tree-widget.d.ts +0 -1
- package/types/tree-widget.js +0 -60
- package/types/widget-runtime.d.ts +3 -1
- package/types.d.ts +2 -1
- package/types.js +1 -1
- /package/{plugins/runtime-modules/threads/controller/address.d.ts → constants/threads-controller-address.d.ts} +0 -0
|
@@ -18,7 +18,6 @@ import { PHI_RECORD_WIDGET_DEFAULT_LABELS, formatPhiRecordWidgetLabel, } from ".
|
|
|
18
18
|
import { PhiWidgetFailure } from "../../../../../components/widgets/shared/widget-failure-client";
|
|
19
19
|
import { PhiCmsWidgetType } from "../../../../../constants/cms-widget-types";
|
|
20
20
|
import { fillPhiRecordTitle } from "../../../../../helpers/record-title";
|
|
21
|
-
import { validatePhiRecordWidgetBinding } from "../../../../../helpers/record-widget";
|
|
22
21
|
import { readPhiTableActionSignalValue } from "../../../../../types/table-signal-values";
|
|
23
22
|
import { usePhiRecordWidgetActions } from "./actions";
|
|
24
23
|
export function PhiRecordWidgetClient({ config, labels = PHI_RECORD_WIDGET_DEFAULT_LABELS, renderMode, }) {
|
|
@@ -43,8 +42,6 @@ export function PhiRecordWidgetClient({ config, labels = PHI_RECORD_WIDGET_DEFAU
|
|
|
43
42
|
const emitCapability = useCallback((capabilityId, value, correlationId) => emitPhiSignalCapability(emitSignal, emitRoutes, capabilityId, value, correlationId), [emitRoutes, emitSignal]);
|
|
44
43
|
const { showMessage } = usePhiApplicationFeedback();
|
|
45
44
|
const { provider, resource, bindingError } = usePhiTableProvider(config.source);
|
|
46
|
-
// The actions measured against the resource, said where the record would stand (Table: contractError).
|
|
47
|
-
const contractError = useMemo(() => resource ? validatePhiRecordWidgetBinding(config, resource)[0] ?? null : null, [config, resource]);
|
|
48
45
|
// Sent with the read and part of what makes one new: an open record is read again after a switch.
|
|
49
46
|
const locale = usePhiIntlLocale();
|
|
50
47
|
const timeZone = usePhiIntlTimeZone();
|
|
@@ -190,9 +187,8 @@ export function PhiRecordWidgetClient({ config, labels = PHI_RECORD_WIDGET_DEFAU
|
|
|
190
187
|
* Every error here is the source's -- no binding, a resource that reads no single records, a read that
|
|
191
188
|
* failed -- and none of them is the reader's to fix, so it goes the way of every such failure.
|
|
192
189
|
*/
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
return _jsx(PhiWidgetFailure, { renderMode: renderMode, widgetType: PhiCmsWidgetType.Record, title: failure });
|
|
190
|
+
if (error) {
|
|
191
|
+
return _jsx(PhiWidgetFailure, { renderMode: renderMode, widgetType: PhiCmsWidgetType.Record, title: error });
|
|
196
192
|
}
|
|
197
193
|
if (!record) {
|
|
198
194
|
return _jsx(PhiEmptyControl, { description: labels.empty });
|
|
@@ -80,7 +80,7 @@ export declare const PHI_RESULT_WIDGET_DEFINITION: {
|
|
|
80
80
|
heading?: string;
|
|
81
81
|
} & {
|
|
82
82
|
type: "data-provider";
|
|
83
|
-
providerKind?: import("../../../../../types").PhiRuntimeDataProviderKind;
|
|
83
|
+
providerKind?: import("../../../../../types").PhiRuntimeDataProviderKind | readonly import("../../../../../types").PhiRuntimeDataProviderKind[];
|
|
84
84
|
providerKey?: import("@phis/contracts/controls").PhiRuntimeDataProviderKey;
|
|
85
85
|
}) | ({
|
|
86
86
|
key: string;
|
|
@@ -96,7 +96,7 @@ export declare const PHI_SIMPLE_TEXT_WIDGET_DEFINITION: {
|
|
|
96
96
|
heading?: string;
|
|
97
97
|
} & {
|
|
98
98
|
type: "data-provider";
|
|
99
|
-
providerKind?: import("../../../../../types").PhiRuntimeDataProviderKind;
|
|
99
|
+
providerKind?: import("../../../../../types").PhiRuntimeDataProviderKind | readonly import("../../../../../types").PhiRuntimeDataProviderKind[];
|
|
100
100
|
providerKey?: import("@phis/contracts/controls").PhiRuntimeDataProviderKey;
|
|
101
101
|
}) | ({
|
|
102
102
|
key: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PHI_RECORD_TEXT_FIELD_KINDS } from "../../../../../
|
|
1
|
+
import { PHI_RECORD_TEXT_FIELD_KINDS } from "../../../../../constants/record-field-kinds";
|
|
2
2
|
import { resolvePhiCmsWidgetPluginKey } from "../../../../../constants/cms-widget-types";
|
|
3
3
|
import { readPhiTextSource } from "../../../../../helpers/text-source";
|
|
4
4
|
import { PHI_SIMPLE_TEXT_MARKS } from "../../../../../types/core-widget-placements";
|
|
@@ -2,7 +2,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { PhiCmsFlags } from "../../../../../constants/phi-cms";
|
|
3
3
|
import { hasPhiFlag } from "../../../../../helpers/flags";
|
|
4
4
|
import { translatePhiSearchWidgetTexts } from "../../../../../server-helpers/search-text";
|
|
5
|
-
import {
|
|
5
|
+
import { PHI_RECORD_TEXT_FIELD_KINDS } from "../../../../../constants/record-field-kinds";
|
|
6
|
+
import { formatPhiRecordFieldText } from "../../../../../helpers/record-fields";
|
|
6
7
|
import { resolvePhiWidgetRecordField } from "../../../../../server-helpers/record-fields";
|
|
7
8
|
import { isPhiExternalHref } from "../../../../../helpers/external-href";
|
|
8
9
|
import { resolvePhiLinkHref } from "../../../../../helpers/link-target";
|
|
@@ -8,6 +8,7 @@ import { useCallback, useEffect, useEffectEvent, useMemo, useRef, useState } fro
|
|
|
8
8
|
import { PhiMultiSelectControl } from "../../../../../components/controls/phi-multi-select-control";
|
|
9
9
|
import { PhiAlertControl } from "../../../../../components/controls/phi-alert-control";
|
|
10
10
|
import { PhiWidgetFailure } from "../../../../../components/widgets/shared/widget-failure-client";
|
|
11
|
+
import { isPhiTableProviderRefusal } from "../../../../../components/widgets/client/shared/phi-table-provider-refusal";
|
|
11
12
|
import { PhiCmsWidgetType } from "../../../../../constants/cms-widget-types";
|
|
12
13
|
import { usePhiConfirmDialog } from "../../../../../components/controls/phi-confirm-dialog";
|
|
13
14
|
import { PhiCascaderControl } from "../../../../../components/controls/phi-cascader-control";
|
|
@@ -33,17 +34,20 @@ import { emitPhiSignalCapability, usePhiSignalEmitter, usePhiSignalIdentity } fr
|
|
|
33
34
|
import { usePhiVisualAnchorParts } from "../../../../../components/runtime/runtime-visual-anchors";
|
|
34
35
|
import { usePhiApplicationFeedback } from "../../../../../components/runtime/use-phi-application-feedback";
|
|
35
36
|
import { usePhiTableBinding } from "../../../../../components/tables/client/phi-table-binding";
|
|
37
|
+
import { usePhiTableBindingParams } from "../../../../../components/tables/client/phi-table-binding-params";
|
|
36
38
|
import { PhiTableBindingControl } from "../../../../../components/tables/client/phi-table-binding-control";
|
|
37
39
|
import { usePhiTableFilterOptions } from "../../../../../components/tables/client/phi-table-filter-options";
|
|
40
|
+
import { isTableQueryNarrowedByReader } from "./reader-query";
|
|
38
41
|
import { clearPhiDataDragPayload, readPhiDataDragPayload } from "../../../../../components/runtime/client/phi-data-dnd";
|
|
39
42
|
import { renderPhiValueContent, renderPhiValueWithLead, } from "../../../../../components/widgets/client/shared/phi-rendered-value";
|
|
40
43
|
import { formatPhiTranslation } from "../../../../../helpers/translation-format";
|
|
41
|
-
import { readPhiTableFilters, readPhiTableQuery, readPhiTableRowOptions,
|
|
44
|
+
import { readPhiTableFilters, readPhiTableQuery, readPhiTableRowOptions, } from "../../../../../types/table-widget";
|
|
42
45
|
import { readPhiTableColumnOrderSignalValue, readPhiTableBindingParamsSignalValue, readPhiTableExpansionSignalValue, readPhiTableActionSignalValue, isPhiTableQueryValue, } from "../../../../../types/table-signal-values";
|
|
43
46
|
import { collectPhiRuntimeValueConditions, combinePhiRuntimeConditionExpressions, evaluatePhiRuntimeConditionExpression, readPhiRuntimeConditionStateSignalValue, } from "../../../../../types/runtime-condition";
|
|
44
47
|
import { isPhiControllerSignalAddress, } from "../../../../../types/signals";
|
|
45
48
|
import { resolvePhiButtonIcon } from "../../../../../components/widgets/client/shared/phi-button-icons";
|
|
46
49
|
import { PhiFlexControl } from "../../../../../components/controls/phi-flex-control";
|
|
50
|
+
import { PhiRevealOnceDialogControl } from "../../../../../components/controls/phi-reveal-once-dialog-control";
|
|
47
51
|
import { PhiTypographyControl } from "../../../../../components/controls/phi-typography-control";
|
|
48
52
|
import { PhiCompactGroupControl } from "../../../../../components/controls/phi-compact-group-control";
|
|
49
53
|
import { isPhiRecord } from "../../../../../helpers/is-record";
|
|
@@ -224,17 +228,13 @@ export function PhiTableWidgetClient({ config: inputConfig, renderMode, external
|
|
|
224
228
|
const config = useMemo(() => JSON.parse(configKey), [configKey]);
|
|
225
229
|
const { presentation, features, source } = config;
|
|
226
230
|
/*
|
|
227
|
-
* What the reader set, tagged with the configuration it was set against.
|
|
228
|
-
* configured params or columns is a new starting point; the reader's earlier
|
|
229
|
-
* one and would otherwise outlive it -- an order missing the new column,
|
|
230
|
-
* refused.
|
|
231
|
+
* What the reader set, tagged with the configuration it was set against (`usePhiTableBindingParams`).
|
|
232
|
+
* A Builder edit of the configured params or columns is a new starting point; the reader's earlier
|
|
233
|
+
* choice belonged to the old one and would otherwise outlive it -- an order missing the new column,
|
|
234
|
+
* which every reorder then refused.
|
|
231
235
|
*/
|
|
232
236
|
const configuredBindingParams = useMemo(() => isPhiRecord(source?.params) ? source.params : {}, [source]);
|
|
233
|
-
const
|
|
234
|
-
const [chosenBindingParams, setChosenBindingParams] = useState(null);
|
|
235
|
-
const bindingParams = chosenBindingParams?.seed === bindingParamsSeed
|
|
236
|
-
? chosenBindingParams.params
|
|
237
|
-
: configuredBindingParams;
|
|
237
|
+
const { bindingParams, changeBindingParams } = usePhiTableBindingParams(configuredBindingParams);
|
|
238
238
|
const resolvedSource = useMemo(() => source ? { ...source, params: bindingParams } : null, [bindingParams, source]);
|
|
239
239
|
const resolvedControlSize = presentation.controlSize ??
|
|
240
240
|
(features.tools?.mode !== "external" ? "small" : undefined);
|
|
@@ -245,6 +245,8 @@ export function PhiTableWidgetClient({ config: inputConfig, renderMode, external
|
|
|
245
245
|
...(initialQuery.filters ?? {}),
|
|
246
246
|
};
|
|
247
247
|
const [searchDraft, setSearchDraft] = useState(initialQuery.search ?? "");
|
|
248
|
+
// A value an action answered to be shown once (`reveal`), held only while its Dialog is open.
|
|
249
|
+
const [revealed, setRevealed] = useState(null);
|
|
248
250
|
const [conditionControllerStates, setConditionControllerStates] = useState({});
|
|
249
251
|
/*
|
|
250
252
|
* What a condition on this Table can read besides its row: the Controllers that answered, and the
|
|
@@ -269,22 +271,6 @@ export function PhiTableWidgetClient({ config: inputConfig, renderMode, external
|
|
|
269
271
|
* signal it received, absent when the operator drove it from the Table itself, which begins one.
|
|
270
272
|
*/
|
|
271
273
|
const emitCapability = useCallback((capabilityId, value, correlationId) => emitPhiSignalCapability(emitSignal, emitRoutes, capabilityId, value, correlationId), [emitRoutes, emitSignal]);
|
|
272
|
-
const validateResource = useCallback((candidate) => {
|
|
273
|
-
const contractError = validatePhiTableWidgetBinding(config, candidate)[0];
|
|
274
|
-
if (contractError)
|
|
275
|
-
return contractError;
|
|
276
|
-
const iconAction = [
|
|
277
|
-
...(config.features.actions?.toolbar ?? []),
|
|
278
|
-
...(config.features.actions?.row ?? []),
|
|
279
|
-
...(config.features.actions?.bulk ?? []),
|
|
280
|
-
].find((action) => action.display !== "label" && action.icon && !resolvePhiButtonIcon(action.icon));
|
|
281
|
-
if (iconAction)
|
|
282
|
-
return `Table action "${iconAction.key}" references an unavailable icon.`;
|
|
283
|
-
const iconBindingTool = config.features.tools?.bindingFields?.find((tool) => tool.create?.display !== "label" && tool.create?.icon && !resolvePhiButtonIcon(tool.create.icon));
|
|
284
|
-
return iconBindingTool
|
|
285
|
-
? `Table binding field "${iconBindingTool.key}" create tool references an unavailable icon.`
|
|
286
|
-
: null;
|
|
287
|
-
}, [config]);
|
|
288
274
|
const binding = usePhiTableBinding({
|
|
289
275
|
source: resolvedSource,
|
|
290
276
|
initialQuery: { ...initialQuery, sorts: defaultSorts, filters: initialFilters },
|
|
@@ -314,11 +300,12 @@ export function PhiTableWidgetClient({ config: inputConfig, renderMode, external
|
|
|
314
300
|
if (result.status === "accepted" && result.message?.trim()) {
|
|
315
301
|
showMessage({ level: "info", content: result.message.trim() });
|
|
316
302
|
}
|
|
317
|
-
|
|
303
|
+
// A value shown once never leaves the Table: the result goes on without it.
|
|
304
|
+
const { revealValue: _shownOnce, ...announced } = result;
|
|
305
|
+
emitCapability("mutationChange", announced);
|
|
318
306
|
},
|
|
319
|
-
validateResource,
|
|
320
307
|
});
|
|
321
|
-
const { resource, bindingError,
|
|
308
|
+
const { resource, bindingError, rows, total, hasMore, summary, loading, error, queryError, query, resolvedQuery, setQuery, changePage, selectedRowIdentities, setSelectedRowIdentities, expandedRowIdentities, setExpandedRowIdentities, reload, executeAction, commitField, commitRow, isFieldMutationPending, moveRow, drop, } = binding;
|
|
322
309
|
const toolbarActions = useMemo(() => resolveTableActions(features.actions?.toolbar, resource?.actions), [features.actions?.toolbar, resource?.actions]);
|
|
323
310
|
const rowActions = useMemo(() => resolveTableActions(features.actions?.row, resource?.actions), [features.actions?.row, resource?.actions]);
|
|
324
311
|
const bulkActions = useMemo(() => resolveTableActions(features.actions?.bulk, resource?.actions), [features.actions?.bulk, resource?.actions]);
|
|
@@ -341,7 +328,7 @@ export function PhiTableWidgetClient({ config: inputConfig, renderMode, external
|
|
|
341
328
|
.flatMap((condition) => condition.source === "controller" && condition.controllerAddress
|
|
342
329
|
? [condition.controllerAddress]
|
|
343
330
|
: [])), [bulkActions, features.editing?.disabledWhen, features.rowSelection?.disabledWhen, presentation.columns, presentation.row?.mutedWhen, resource?.fields, rowActions, toolbarActions]);
|
|
344
|
-
const effectiveLoading = loading && !bindingError
|
|
331
|
+
const effectiveLoading = loading && !bindingError;
|
|
345
332
|
useEffect(() => {
|
|
346
333
|
if (features.search?.enabled !== true || query.search === searchDraft)
|
|
347
334
|
return undefined;
|
|
@@ -414,8 +401,11 @@ export function PhiTableWidgetClient({ config: inputConfig, renderMode, external
|
|
|
414
401
|
return;
|
|
415
402
|
emitSelection(selectedRowIdentities);
|
|
416
403
|
}, [emitFields, emitSelection, readSelectedRows, selectedRowIdentities]);
|
|
417
|
-
|
|
418
|
-
|
|
404
|
+
/* A change to the params; the same params again change nothing and hand nothing on. */
|
|
405
|
+
const updateBindingParams = useCallback((patch, correlationId) => {
|
|
406
|
+
const next = changeBindingParams(patch);
|
|
407
|
+
if (!next)
|
|
408
|
+
return;
|
|
419
409
|
setQuery((current) => ({ ...current, page: 1, cursor: null }));
|
|
420
410
|
setSelectedRowIdentities([]);
|
|
421
411
|
setExpandedRowIdentities([]);
|
|
@@ -429,24 +419,22 @@ export function PhiTableWidgetClient({ config: inputConfig, renderMode, external
|
|
|
429
419
|
: [];
|
|
430
420
|
})),
|
|
431
421
|
}, correlationId);
|
|
432
|
-
}, [
|
|
422
|
+
}, [changeBindingParams, configuredBindingFields, emitCapability, setExpandedRowIdentities, setQuery, setSelectedRowIdentities]);
|
|
433
423
|
useEffect(() => {
|
|
434
424
|
if (!resource?.bindingFields?.length)
|
|
435
425
|
return;
|
|
436
|
-
const
|
|
437
|
-
let changed = false;
|
|
426
|
+
const defaults = {};
|
|
438
427
|
for (const field of resource.bindingFields) {
|
|
439
|
-
if (
|
|
440
|
-
|
|
441
|
-
changed = true;
|
|
428
|
+
if (bindingParams[field.key] === undefined && field.defaultValue !== undefined) {
|
|
429
|
+
defaults[field.key] = field.defaultValue;
|
|
442
430
|
}
|
|
443
431
|
}
|
|
444
|
-
if (
|
|
432
|
+
if (Object.keys(defaults).length === 0)
|
|
445
433
|
return;
|
|
446
434
|
let cancelled = false;
|
|
447
435
|
queueMicrotask(() => {
|
|
448
436
|
if (!cancelled)
|
|
449
|
-
updateBindingParams(
|
|
437
|
+
updateBindingParams(defaults);
|
|
450
438
|
});
|
|
451
439
|
return () => { cancelled = true; };
|
|
452
440
|
}, [bindingParams, resource?.bindingFields, updateBindingParams]);
|
|
@@ -482,6 +470,10 @@ export function PhiTableWidgetClient({ config: inputConfig, renderMode, external
|
|
|
482
470
|
selectedRowIdentities: identities,
|
|
483
471
|
actionValue,
|
|
484
472
|
query: resolvedQuery,
|
|
473
|
+
}).then((result) => {
|
|
474
|
+
if (action.reveal && result.status === "accepted" && typeof result.revealValue === "string" && result.revealValue) {
|
|
475
|
+
setRevealed({ title: action.reveal.title, description: action.reveal.description, value: result.revealValue });
|
|
476
|
+
}
|
|
485
477
|
}).catch(() => undefined);
|
|
486
478
|
}, [emitCapability, executeAction, onAction, resolvedQuery, resource]);
|
|
487
479
|
usePhiSignalListener(useCallback((signal) => {
|
|
@@ -509,7 +501,7 @@ export function PhiTableWidgetClient({ config: inputConfig, renderMode, external
|
|
|
509
501
|
else if (route.capabilityId === "bindingParamsChange") {
|
|
510
502
|
const next = readPhiTableBindingParamsSignalValue(signal.value);
|
|
511
503
|
if (next)
|
|
512
|
-
updateBindingParams(
|
|
504
|
+
updateBindingParams(next.params, signal.correlationId);
|
|
513
505
|
}
|
|
514
506
|
else if (route.capabilityId === "reload") {
|
|
515
507
|
reload();
|
|
@@ -565,7 +557,7 @@ export function PhiTableWidgetClient({ config: inputConfig, renderMode, external
|
|
|
565
557
|
setConditionControllerStates((current) => ({ ...current, [signal.sender]: next.state }));
|
|
566
558
|
}
|
|
567
559
|
}
|
|
568
|
-
}, [activateAction,
|
|
560
|
+
}, [activateAction, bulkActions, conditionControllerAddresses, confirm, listenRoutes, reload, resource, rowActions, rows, setQuery, signalIdentity.receiver, toolbarActions, updateBindingParams, updateColumnOrder, updateExpandedRows, updateSelection]), useMemo(() => resolvePhiSignalListenFilter(listenRoutes), [listenRoutes]), signalIdentity.receiver);
|
|
569
561
|
useEffect(() => {
|
|
570
562
|
if (conditionControllerAddresses.size > 0) {
|
|
571
563
|
emitCapability("conditionStateRequest", null);
|
|
@@ -730,6 +722,9 @@ export function PhiTableWidgetClient({ config: inputConfig, renderMode, external
|
|
|
730
722
|
const childAcceptanceField = resource?.hierarchy?.canAcceptChildrenField;
|
|
731
723
|
const selfContainedTools = features.tools?.mode !== "external";
|
|
732
724
|
const hasQueryTools = (features.search?.enabled ?? false) || (features.filters?.length ?? 0) > 0;
|
|
725
|
+
// The Page's own words always; the generic "adjust the filters" only where a filter of the reader's is set.
|
|
726
|
+
const emptyDescription = presentation.emptyState?.description ??
|
|
727
|
+
(isTableQueryNarrowedByReader(features.filters, resolvedQuery, config.fixedFilters) ? labels.emptyDescription : undefined);
|
|
733
728
|
const hasSelfContainedTools = selfContainedTools && (configuredBindingFields.length > 0 ||
|
|
734
729
|
hasQueryTools ||
|
|
735
730
|
features.tools?.reload === true ||
|
|
@@ -746,7 +741,7 @@ export function PhiTableWidgetClient({ config: inputConfig, renderMode, external
|
|
|
746
741
|
filters: initialFilters,
|
|
747
742
|
}));
|
|
748
743
|
};
|
|
749
|
-
const collectionFilters = hasSelfContainedTools && (configuredBindingFields.length > 0 || hasQueryTools) ? (_jsxs(PhiFlexControl, { align: "end", gap: token.paddingSM, wrap: true, children: [configuredBindingFields.map(({ field, tool }) => (_jsx(TableBindingTool, { field: field, tool: tool, sourceConfig: bindingParams, value: bindingParams[field.key], size: resolvedControlSize, onChange: (value) => updateBindingParams({
|
|
744
|
+
const collectionFilters = hasSelfContainedTools && (configuredBindingFields.length > 0 || hasQueryTools) ? (_jsxs(PhiFlexControl, { align: "end", gap: token.paddingSM, wrap: true, children: [configuredBindingFields.map(({ field, tool }) => (_jsx(TableBindingTool, { field: field, tool: tool, sourceConfig: bindingParams, value: bindingParams[field.key], size: resolvedControlSize, onChange: (value) => updateBindingParams({ [field.key]: value }), onCreate: field.create && tool.create ? async (value) => {
|
|
750
745
|
const result = await executeAction({
|
|
751
746
|
kind: "action",
|
|
752
747
|
actionKey: field.create.actionKey,
|
|
@@ -758,7 +753,7 @@ export function PhiTableWidgetClient({ config: inputConfig, renderMode, external
|
|
|
758
753
|
(typeof result.canonicalValue !== "string" && typeof result.canonicalValue !== "number")) {
|
|
759
754
|
return null;
|
|
760
755
|
}
|
|
761
|
-
updateBindingParams({
|
|
756
|
+
updateBindingParams({ [field.key]: result.canonicalValue });
|
|
762
757
|
return result.canonicalValue;
|
|
763
758
|
} : undefined }, field.key))), features.filters?.map((filter) => {
|
|
764
759
|
const control = (_jsx(TableFilter, { filter: filter, field: resource?.fields.find((field) => field.key === filter.key), sourceConfig: bindingParams, value: readTableFilterValue(filter, resolvedQuery.filters), labels: labels, size: resolvedControlSize, onChange: (value) => {
|
|
@@ -794,20 +789,22 @@ export function PhiTableWidgetClient({ config: inputConfig, renderMode, external
|
|
|
794
789
|
return _jsx(TableAction, { action: action, size: resolvedControlSize, disabled: selectedRowIdentities.length === 0 || Boolean(disabled), disabledReason: disabled && "reason" in disabled ? disabled.reason : undefined, templateValue: selectedRowIdentities.length, onActivate: () => activateAction(action, undefined, selectedRowIdentities) }, action.key);
|
|
795
790
|
}), hasQueryTools && features.tools?.reset !== false ? (_jsx(PhiButtonControl, { icon: _jsx(PhiIcon, { name: "rollback-outlined", size: "inherit" }), ariaLabel: labels.reset, tooltip: labels.reset, size: resolvedControlSize, onClick: resetQuery })) : null, features.tools?.reload ? (_jsx(PhiButtonControl, { icon: _jsx(PhiIcon, { name: "reload", size: "inherit" }), ariaLabel: labels.reload, tooltip: labels.reload, size: resolvedControlSize, onClick: reload })) : null] })) : null;
|
|
796
791
|
/*
|
|
797
|
-
* The source's failures end the Table here: a
|
|
798
|
-
*
|
|
799
|
-
*
|
|
792
|
+
* The source's failures end the Table here: a Provider the Area does not offer, a read that failed.
|
|
793
|
+
* A refused edit is not one of them -- it stays in `error` alone and is said above the rows to the
|
|
794
|
+
* person who made it. Whether the configuration fits the resource is not asked here: that is checked
|
|
795
|
+
* where the config is made (`checkPhiPresetTables`, the Builder's save), and a live Table trusts it.
|
|
800
796
|
*/
|
|
801
|
-
const
|
|
797
|
+
const refusal = isPhiTableProviderRefusal(queryError) ? queryError : null;
|
|
798
|
+
const sourceFailure = bindingError ?? (refusal ? null : queryError?.message) ?? null;
|
|
802
799
|
if (sourceFailure) {
|
|
803
800
|
return (_jsx(PhiWidgetFailure, { renderMode: renderMode, widgetType: PhiCmsWidgetType.Table, title: sourceFailure, error: queryError }));
|
|
804
801
|
}
|
|
805
|
-
return (_jsxs(PhiFlexControl, { vertical: true, gap: selfContainedTools ? token.paddingSM : token.padding, style: { minWidth: 0, width: "100%" }, children: [confirmDialog, _jsx(PhiCollectionHeaderControl, { title: presentation.title, description: presentation.description, filters: collectionFilters, toolbar: collectionToolbar }), !selfContainedTools && bulkActions.length && selectedRowIdentities.length > 0 ? (_jsx(PhiAlertControl, { level: "info", title: (_jsxs(PhiFlexControl, { align: "center", justify: "space-between", gap: "small", wrap: true, children: [_jsx("span", { children: formatPhiTableWidgetLabel(labels.selected, selectedRowIdentities.length) }), _jsx(PhiFlexControl, { align: "center", gap: "small", children: bulkActions.map((action) => {
|
|
802
|
+
return (_jsxs(PhiFlexControl, { vertical: true, gap: selfContainedTools ? token.paddingSM : token.padding, style: { minWidth: 0, width: "100%" }, children: [confirmDialog, _jsx(PhiRevealOnceDialogControl, { value: revealed?.value ?? null, title: revealed?.title ?? "", description: revealed?.description, labels: labels.reveal, onClose: () => setRevealed(null) }), _jsx(PhiCollectionHeaderControl, { title: presentation.title, description: presentation.description, filters: collectionFilters, toolbar: collectionToolbar }), !selfContainedTools && bulkActions.length && selectedRowIdentities.length > 0 ? (_jsx(PhiAlertControl, { level: "info", title: (_jsxs(PhiFlexControl, { align: "center", justify: "space-between", gap: "small", wrap: true, children: [_jsx("span", { children: formatPhiTableWidgetLabel(labels.selected, selectedRowIdentities.length) }), _jsx(PhiFlexControl, { align: "center", gap: "small", children: bulkActions.map((action) => {
|
|
806
803
|
if (!matchesAllConditions(null, action.visibleWhen, conditionSources))
|
|
807
804
|
return null;
|
|
808
805
|
const disabled = findMatchingCondition(null, action.disabledWhen, conditionSources);
|
|
809
806
|
return _jsx(TableAction, { action: action, size: resolvedControlSize, disabled: Boolean(disabled), disabledReason: disabled && "reason" in disabled ? disabled.reason : undefined, onActivate: () => activateAction(action, undefined, selectedRowIdentities) }, action.key);
|
|
810
|
-
}) })] })) })) : null, error ? _jsx(PhiAlertControl, { level: "error", showIcon: true, title: error.message }) : null, _jsx(PhiTableBindingControl, { rows: rows, fields: resource?.fields ?? [], sourceConfig: bindingParams,
|
|
807
|
+
}) })] })) })) : null, error && !isPhiTableProviderRefusal(error) ? _jsx(PhiAlertControl, { level: "error", showIcon: true, title: error.message }) : null, _jsx(PhiTableBindingControl, { rows: rows, fields: resource?.fields ?? [], sourceConfig: bindingParams,
|
|
811
808
|
/* Options an editor could not be given: the rows still stand, the author reads why. */
|
|
812
809
|
renderDiagnostics: (warnings) => warnings.map((warning) => (_jsx(PhiWidgetFailure, { renderMode: renderMode, widgetType: PhiCmsWidgetType.Table, title: warning }, warning))), rowIdentityPath: resource?.rowIdentityPath ?? "id", columns: columns, columnOrder: columnOrder, sortingMode: features.sorting?.mode ?? "none", sorts: resolvedQuery.sorts ?? [], onSortsChange: (sorts) => setQuery((current) => ({ ...current, page: 1, cursor: null, sorts })), columnReordering: features.columnReordering?.enabled === true, onColumnOrderChange: updateColumnOrder, rowSelection: features.rowSelection?.mode && features.rowSelection.mode !== "none" ? {
|
|
813
810
|
mode: features.rowSelection.mode,
|
|
@@ -945,7 +942,7 @@ export function PhiTableWidgetClient({ config: inputConfig, renderMode, external
|
|
|
945
942
|
afterRowIdentity: null,
|
|
946
943
|
}).catch(() => undefined).finally(clearPhiDataDragPayload);
|
|
947
944
|
}
|
|
948
|
-
: undefined, loading: effectiveLoading, bordered: presentation.borders, striped: presentation.row?.striped, showHeader: presentation.header, stickyHeader: presentation.stickyHeader !== false, size: resolvedControlSize, emptyText: (_jsxs(PhiFlexControl, { vertical: true, gap: "small", children: [_jsx(PhiTypographyControl, { strong: true, children: presentation.emptyState?.title ?? labels.emptyTitle }), _jsx(PhiTypographyControl, { type: "secondary", children:
|
|
945
|
+
: undefined, loading: effectiveLoading, loadingRows: presentation.loadingRows, bordered: presentation.borders, striped: presentation.row?.striped, showHeader: presentation.header, stickyHeader: presentation.stickyHeader !== false, size: resolvedControlSize, emptyText: (_jsxs(PhiFlexControl, { vertical: true, gap: "small", children: [_jsx(PhiTypographyControl, { strong: true, children: refusal?.message ?? presentation.emptyState?.title ?? labels.emptyTitle }), emptyDescription && !refusal ? _jsx(PhiTypographyControl, { type: "secondary", children: emptyDescription }) : null] })), layout: presentation.layout, footer: footer, summary: tableSummary })] }));
|
|
949
946
|
}
|
|
950
947
|
function TableAction({ action, disabled = false, disabledReason, templateValue, size, onActivate }) {
|
|
951
948
|
const icon = action.icon ? resolvePhiButtonIcon(action.icon) : null;
|
|
@@ -106,7 +106,7 @@ export declare const PHI_TABLE_WIDGET_DEFINITION: {
|
|
|
106
106
|
heading?: string;
|
|
107
107
|
} & {
|
|
108
108
|
type: "data-provider";
|
|
109
|
-
providerKind?: import("../../../../../types").PhiRuntimeDataProviderKind;
|
|
109
|
+
providerKind?: import("../../../../../types").PhiRuntimeDataProviderKind | readonly import("../../../../../types").PhiRuntimeDataProviderKind[];
|
|
110
110
|
providerKey?: import("@phis/contracts/controls").PhiRuntimeDataProviderKey;
|
|
111
111
|
}) | ({
|
|
112
112
|
key: string;
|
|
@@ -435,7 +435,7 @@ export declare const PHI_TABLE_WIDGET_DEFINITION: {
|
|
|
435
435
|
editorPlacement?: "inspector" | "geometry" | "toolbar";
|
|
436
436
|
heading?: string;
|
|
437
437
|
type: "data-provider";
|
|
438
|
-
providerKind?: import("../../../../../types").PhiRuntimeDataProviderKind;
|
|
438
|
+
providerKind?: import("../../../../../types").PhiRuntimeDataProviderKind | readonly import("../../../../../types").PhiRuntimeDataProviderKind[];
|
|
439
439
|
providerKey?: import("@phis/contracts/controls").PhiRuntimeDataProviderKey;
|
|
440
440
|
} | {
|
|
441
441
|
visibleWhen: {
|
|
@@ -827,7 +827,7 @@ export declare const PHI_TABLE_WIDGET_DEFINITION: {
|
|
|
827
827
|
editorPlacement?: "inspector" | "geometry" | "toolbar";
|
|
828
828
|
heading?: string;
|
|
829
829
|
type: "data-provider";
|
|
830
|
-
providerKind?: import("../../../../../types").PhiRuntimeDataProviderKind;
|
|
830
|
+
providerKind?: import("../../../../../types").PhiRuntimeDataProviderKind | readonly import("../../../../../types").PhiRuntimeDataProviderKind[];
|
|
831
831
|
providerKey?: import("@phis/contracts/controls").PhiRuntimeDataProviderKey;
|
|
832
832
|
} | {
|
|
833
833
|
visibleWhen: {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { resolvePhiCmsWidgetPluginKey } from "../../../../../constants/cms-widget-types";
|
|
2
|
+
import { PHI_TABLE_LOADING_ROWS_MAX } from "../../../../../constants/table-loading";
|
|
2
3
|
import { readPhiProviderResourceSource } from "../../../../../types/runtime-data-provider";
|
|
3
4
|
import { PHI_TABLE_TAG_COLORS, PHI_TABLE_TAG_VARIANTS, readPhiTableQuery, } from "../../../../../types/table-widget";
|
|
4
5
|
import { PHI_SIGNAL_VALUE_SCHEMAS, readPhiSignalRouteSet } from "../../../../../types/signals";
|
|
@@ -116,6 +117,8 @@ const PHI_TABLE_ACTION_CONFIG_FIELDS = [
|
|
|
116
117
|
{ key: "newTab", type: "boolean", label: "Open In New Tab", visibleWhen: { field: "execution", equals: "link" } },
|
|
117
118
|
...buildPhiTableConditionExpressionConfigFields("visibleWhen", "Visible Conditions", "all", "Always visible"),
|
|
118
119
|
...buildPhiTableConditionExpressionConfigFields("disabledWhen", "Disabled Conditions", "any", "No disabled conditions"),
|
|
120
|
+
{ key: "reveal.title", type: "string", label: "Shown Once Title", visibleWhen: { field: "execution", equals: "provider" } },
|
|
121
|
+
{ key: "reveal.description", type: "string", label: "Shown Once Description", visibleWhen: { field: "execution", equals: "provider" } },
|
|
119
122
|
{ key: "confirm.title", type: "string", label: "Confirm Title" },
|
|
120
123
|
{ key: "confirm.description", type: "string", label: "Confirm Description" },
|
|
121
124
|
{ key: "confirm.alert.level", type: "choice", label: "Confirm Alert Level", options: [
|
|
@@ -361,6 +364,10 @@ function readAction(reader) {
|
|
|
361
364
|
newTab: reader.boolean("newTab"),
|
|
362
365
|
visibleWhen: readCondition(reader, "visibleWhen"),
|
|
363
366
|
disabledWhen: readCondition(reader, "disabledWhen"),
|
|
367
|
+
reveal: reader.object("reveal", (revealReader) => ({
|
|
368
|
+
title: requireString(revealReader, "title"),
|
|
369
|
+
description: revealReader.string("description"),
|
|
370
|
+
})),
|
|
364
371
|
confirm: reader.object("confirm", (confirmReader) => ({
|
|
365
372
|
title: requireString(confirmReader, "title"),
|
|
366
373
|
description: confirmReader.string("description"),
|
|
@@ -467,6 +474,8 @@ export function parsePhiTableWidgetConfig(config) {
|
|
|
467
474
|
header: presentation.boolean("header"),
|
|
468
475
|
stickyHeader: presentation.boolean("stickyHeader"),
|
|
469
476
|
footer: presentation.object("footer", readTableFooter),
|
|
477
|
+
footerOmitted: presentation.string("footerOmitted"),
|
|
478
|
+
loadingRows: presentation.value("loadingRows", `a whole number from 1 to ${PHI_TABLE_LOADING_ROWS_MAX}`, (value) => typeof value === "number" && Number.isInteger(value) && value >= 1 && value <= PHI_TABLE_LOADING_ROWS_MAX ? value : undefined),
|
|
470
479
|
summary: presentation.object("summary", readTableSummary),
|
|
471
480
|
row: {
|
|
472
481
|
striped: row.boolean("striped"),
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { PhiTableFilterDefinition, PhiTableQuery, PhiTableQueryValue } from "../../../../../types/table-widget";
|
|
2
|
+
/**
|
|
3
|
+
* Whether what the reader can change narrows the rows: a search text, or one of the Table's own filters
|
|
4
|
+
* (`features.filters`) holding a value in the query. Only then does the generic empty hint ("adjust the
|
|
5
|
+
* filters") have anything to point at.
|
|
6
|
+
*
|
|
7
|
+
* A filter holds a value when the query carries one for its key -- for a date range, for either of its
|
|
8
|
+
* two keys -- that is not blank: an empty text, an empty list and a cleared choice are never sent, so they
|
|
9
|
+
* narrow nothing. A `defaultValue` counts like a chosen value: it narrows the query just the same and the
|
|
10
|
+
* reader can clear it, so the hint is true of it. A boolean `false` counts, since the query is narrowed
|
|
11
|
+
* to it; a switch that was never touched and has no default carries nothing.
|
|
12
|
+
*
|
|
13
|
+
* What the reader cannot change does not count: a key the Page pins through `fixedFilters`, and a filter
|
|
14
|
+
* key the query carries that is none of the Table's own filters -- one a Controller or another Widget
|
|
15
|
+
* sets by signal, such as the key a list below a selection is narrowed to.
|
|
16
|
+
*/
|
|
17
|
+
export declare function isTableQueryNarrowedByReader(filters: readonly PhiTableFilterDefinition[] | undefined, query: PhiTableQuery, fixedFilters?: Readonly<Record<string, PhiTableQueryValue>>): boolean;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
function holdsValue(value) {
|
|
2
|
+
if (value === undefined || value === null)
|
|
3
|
+
return false;
|
|
4
|
+
if (typeof value === "string")
|
|
5
|
+
return value.trim() !== "";
|
|
6
|
+
if (Array.isArray(value))
|
|
7
|
+
return value.length > 0;
|
|
8
|
+
return true;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Whether what the reader can change narrows the rows: a search text, or one of the Table's own filters
|
|
12
|
+
* (`features.filters`) holding a value in the query. Only then does the generic empty hint ("adjust the
|
|
13
|
+
* filters") have anything to point at.
|
|
14
|
+
*
|
|
15
|
+
* A filter holds a value when the query carries one for its key -- for a date range, for either of its
|
|
16
|
+
* two keys -- that is not blank: an empty text, an empty list and a cleared choice are never sent, so they
|
|
17
|
+
* narrow nothing. A `defaultValue` counts like a chosen value: it narrows the query just the same and the
|
|
18
|
+
* reader can clear it, so the hint is true of it. A boolean `false` counts, since the query is narrowed
|
|
19
|
+
* to it; a switch that was never touched and has no default carries nothing.
|
|
20
|
+
*
|
|
21
|
+
* What the reader cannot change does not count: a key the Page pins through `fixedFilters`, and a filter
|
|
22
|
+
* key the query carries that is none of the Table's own filters -- one a Controller or another Widget
|
|
23
|
+
* sets by signal, such as the key a list below a selection is narrowed to.
|
|
24
|
+
*/
|
|
25
|
+
export function isTableQueryNarrowedByReader(filters, query, fixedFilters) {
|
|
26
|
+
if (holdsValue(query.search))
|
|
27
|
+
return true;
|
|
28
|
+
const readerKey = (key) => !Object.prototype.hasOwnProperty.call(fixedFilters ?? {}, key) &&
|
|
29
|
+
holdsValue(query.filters?.[key]);
|
|
30
|
+
return (filters ?? []).some((filter) => filter.type === "dateRange"
|
|
31
|
+
? readerKey(filter.startKey) || readerKey(filter.endKey)
|
|
32
|
+
: readerKey(filter.key));
|
|
33
|
+
}
|
|
@@ -450,7 +450,7 @@ export function PhiThreadConversationWidgetClient({ runtime, labels, config, })
|
|
|
450
450
|
* the frame instead -- a box around a box, and the sign that the Card was missing the prop.
|
|
451
451
|
*/
|
|
452
452
|
if (threadId == null) {
|
|
453
|
-
return (_jsx(PhiCardControl, { padding: config?.padding, children: _jsx(PhiTypographyControl, { type: "secondary", children: labels.noThreadText }) }));
|
|
453
|
+
return (_jsx(PhiCardControl, { padding: config?.padding, children: _jsx(PhiTypographyControl, { type: "secondary", children: config?.emptyDescription ?? labels.noThreadText }) }));
|
|
454
454
|
}
|
|
455
455
|
if (error && !detail) {
|
|
456
456
|
return (_jsx(PhiCardControl, { padding: config?.padding, children: _jsx(PhiAlertControl, { level: "error", title: labels.feedback.errorTitle, description: error }) }));
|
|
@@ -460,7 +460,7 @@ export function PhiThreadConversationWidgetClient({ runtime, labels, config, })
|
|
|
460
460
|
}
|
|
461
461
|
const archived = detail.thread.status === PhisThreadStatus.Archived;
|
|
462
462
|
const locked = isPhiThreadLocked(detail);
|
|
463
|
-
return (_jsx(_Fragment, { children: _jsx(PhiCardControl, { padding: config?.padding, toolbar: config?.reply && !archived && !locked ? (_jsx(PhiButtonControl, { label: labels.replyLabel, icon: _jsx(PhiIcon, { name: "antd:message-outlined", size: "inherit" }), size: "small", onClick: reply })) : undefined, title: _jsxs(PhiFlexControl, { align: "center", gap: "small", wrap: true, children: [readThreadTitle(detail, labels), archived ? (_jsx(PhiTagControl, { children: labels.archivedLabel })) : null, locked ? (_jsxs(PhiTagControl, { color: "warning", children: [_jsx(PhiIcon, { name: "antd:lock", size: "inherit" }), " ", labels.lockedLabel] })) : null] }), children: _jsxs(PhiFlexControl, { vertical: true, gap: "middle", children: [detail.thread.subject?.trim() && detail.participants.length > 0 ? (_jsx(PhiTypographyControl, { type: "secondary", children: `${labels.participantsLabel}: ${readParticipantNames(detail, labels).join(", ")}` })) : null, config?.reply && locked && !archived ? (_jsx(PhiAlertControl, { level: "info", showIcon: true, title: labels.lockedText })) : null, error ? (_jsx(PhiAlertControl, { level: "error", title: labels.feedback.errorTitle, description: error })) : null, detail.hasMoreMessages ? (_jsx(PhiButtonControl, { label: labels.olderLabel, type: "link", loading: loadingOlder, onClick: () => void loadOlder() })) : null, detail.messages.length === 0 ? (_jsx(PhiTypographyControl, { type: "secondary", children: labels.emptyText })) : (detail.messages.map((message, index) => (_jsxs(Fragment, { children: [index > 0 ? _jsx(PhiDividerControl, { style: { margin: 0 } }) : null, _jsx(PhiThreadMessageRow, { message: message, labels: labels, formatTime: formatTime, formatLanguage: formatLanguage, translation: translations[message.id] ?? null, canTranslate: translationTarget != null, onTranslate: translate })] }, message.id))))] }) }) }));
|
|
463
|
+
return (_jsx(_Fragment, { children: _jsx(PhiCardControl, { padding: config?.padding, toolbar: config?.reply && !archived && !locked ? (_jsx(PhiButtonControl, { label: config?.replyLabel ?? labels.replyLabel, icon: _jsx(PhiIcon, { name: "antd:message-outlined", size: "inherit" }), size: "small", onClick: reply })) : undefined, title: _jsxs(PhiFlexControl, { align: "center", gap: "small", wrap: true, children: [config?.title ?? readThreadTitle(detail, labels), archived ? (_jsx(PhiTagControl, { children: labels.archivedLabel })) : null, locked ? (_jsxs(PhiTagControl, { color: "warning", children: [_jsx(PhiIcon, { name: "antd:lock", size: "inherit" }), " ", labels.lockedLabel] })) : null] }), children: _jsxs(PhiFlexControl, { vertical: true, gap: "middle", children: [detail.thread.subject?.trim() && detail.participants.length > 0 ? (_jsx(PhiTypographyControl, { type: "secondary", children: `${labels.participantsLabel}: ${readParticipantNames(detail, labels).join(", ")}` })) : null, config?.reply && locked && !archived ? (_jsx(PhiAlertControl, { level: "info", showIcon: true, title: labels.lockedText })) : null, error ? (_jsx(PhiAlertControl, { level: "error", title: labels.feedback.errorTitle, description: error })) : null, detail.hasMoreMessages ? (_jsx(PhiButtonControl, { label: labels.olderLabel, type: "link", loading: loadingOlder, onClick: () => void loadOlder() })) : null, detail.messages.length === 0 ? (_jsx(PhiTypographyControl, { type: "secondary", children: labels.emptyText })) : (detail.messages.map((message, index) => (_jsxs(Fragment, { children: [index > 0 ? _jsx(PhiDividerControl, { style: { margin: 0 } }) : null, _jsx(PhiThreadMessageRow, { message: message, labels: labels, formatTime: formatTime, formatLanguage: formatLanguage, translation: translations[message.id] ?? null, canTranslate: translationTarget != null, onTranslate: translate })] }, message.id))))] }) }) }));
|
|
464
464
|
}
|
|
465
465
|
/** Whether Core takes new messages into this conversation; `PhisThreadFlag.Locked` says it does not. */
|
|
466
466
|
export function isPhiThreadLocked(detail) {
|
|
@@ -46,10 +46,14 @@ export declare const PHI_THREAD_CONVERSATION_WIDGET_DEFINITION: {
|
|
|
46
46
|
valueSchema: `${string}/signals/${string}`;
|
|
47
47
|
})[];
|
|
48
48
|
};
|
|
49
|
-
fields: {
|
|
49
|
+
fields: ({
|
|
50
50
|
key: string;
|
|
51
51
|
type: "boolean";
|
|
52
52
|
label: string;
|
|
53
|
-
}
|
|
53
|
+
} | {
|
|
54
|
+
key: string;
|
|
55
|
+
type: "string";
|
|
56
|
+
label: string;
|
|
57
|
+
})[];
|
|
54
58
|
parseConfig: typeof parsePhiThreadWidgetConfig;
|
|
55
59
|
};
|
|
@@ -60,6 +60,11 @@ export const PHI_THREAD_CONVERSATION_WIDGET_DEFINITION = {
|
|
|
60
60
|
{ id: "reply", action: "activate", valueType: "json", valueSchema: PHI_SIGNAL_VALUE_SCHEMAS.tableAction },
|
|
61
61
|
],
|
|
62
62
|
},
|
|
63
|
-
fields: [
|
|
63
|
+
fields: [
|
|
64
|
+
{ key: "reply", type: "boolean", label: "Offer a reply" },
|
|
65
|
+
{ key: "replyLabel", type: "string", label: "Reply label" },
|
|
66
|
+
{ key: "title", type: "string", label: "Heading" },
|
|
67
|
+
{ key: "emptyDescription", type: "string", label: "Text without a conversation" },
|
|
68
|
+
],
|
|
64
69
|
parseConfig: parsePhiThreadWidgetConfig,
|
|
65
70
|
};
|
|
@@ -19,6 +19,16 @@ export type PhiThreadWidgetConfig = {
|
|
|
19
19
|
* conversation, which takes no new messages.
|
|
20
20
|
*/
|
|
21
21
|
reply?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* The heading in place of the conversation's own subject, for a placement that always shows one kind of
|
|
24
|
+
* conversation and names it -- a customer file's File, which Core opens without a subject. Already in the
|
|
25
|
+
* reader's language.
|
|
26
|
+
*/
|
|
27
|
+
title?: string;
|
|
28
|
+
/** What the Reply says, where the placement offers it as something else -- "Add note" in a file. */
|
|
29
|
+
replyLabel?: string;
|
|
30
|
+
/** The sentence where no conversation is chosen yet, in place of the Widget's own. */
|
|
31
|
+
emptyDescription?: string;
|
|
22
32
|
signalRoutes?: PhiSignalRouteSet | null;
|
|
23
33
|
};
|
|
24
34
|
export declare function parsePhiThreadWidgetConfig(rawConfig: Record<string, unknown> | null | undefined): PhiThreadWidgetConfig;
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { readPhiSignalRouteSet, } from "../../../../types/signals";
|
|
2
2
|
import { findPhiControlListenRoute } from "../../../../components/widgets/client/shared/phi-control-signal-routing";
|
|
3
|
+
function readText(value) {
|
|
4
|
+
return typeof value === "string" && value.trim() ? value.trim() : undefined;
|
|
5
|
+
}
|
|
3
6
|
export function parsePhiThreadWidgetConfig(rawConfig) {
|
|
4
7
|
const raw = rawConfig ?? {};
|
|
5
8
|
const padding = raw.padding;
|
|
6
9
|
return {
|
|
7
10
|
padding: typeof padding === "number" || typeof padding === "string" ? padding : undefined,
|
|
8
11
|
reply: raw.reply === true,
|
|
12
|
+
title: readText(raw.title),
|
|
13
|
+
replyLabel: readText(raw.replyLabel),
|
|
14
|
+
emptyDescription: readText(raw.emptyDescription),
|
|
9
15
|
signalRoutes: readPhiSignalRouteSet(raw.signalRoutes),
|
|
10
16
|
};
|
|
11
17
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { isPhiRecord } from "../../../../../helpers/is-record";
|
|
4
4
|
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
5
|
-
import { readPhiTreeProviderError
|
|
5
|
+
import { readPhiTreeProviderError } from "../../../../../types/tree-widget";
|
|
6
6
|
import { usePhiTreeBinding } from "../../../../../components/trees/client/phi-tree-binding";
|
|
7
7
|
import { PhiTreeActionButton, PhiTreeControl } from "../../../../../components/controls/phi-tree-control";
|
|
8
8
|
import { PhiTextControl } from "../../../../../components/controls/phi-text-control";
|
|
@@ -84,7 +84,6 @@ export function PhiTreeWidgetClient({ config, labels, renderMode }) {
|
|
|
84
84
|
binding.setQuery({ ...(config.initialQuery ?? {}) });
|
|
85
85
|
emitCapability("bindingParamsChange", { params: nextParams });
|
|
86
86
|
}, [binding, config.initialQuery, config.source?.params, emitCapability, setBindingParams]);
|
|
87
|
-
const contractError = binding.resource ? validatePhiTreeWidgetBinding(config, binding.resource)[0] ?? null : null;
|
|
88
87
|
const treeQuery = binding.query;
|
|
89
88
|
const setTreeQuery = binding.setQuery;
|
|
90
89
|
const activate = useCallback((action, identity, correlationId) => {
|
|
@@ -186,11 +185,12 @@ export function PhiTreeWidgetClient({ config, labels, renderMode }) {
|
|
|
186
185
|
hasResettableQuery && tools?.reset !== false ||
|
|
187
186
|
tools?.reload === true) ? (_jsxs(PhiToolbarControl, { size: controlSize, compact: true, children: [(config.features.actions?.toolbar ?? []).map((action) => (_jsx(PhiTreeActionButton, { action: action, size: controlSize, onActivate: () => activate(action) }, action.key))), (config.features.actions?.selection ?? []).map((action) => (_jsx(PhiTreeActionButton, { action: action, size: controlSize, disabled: binding.selectedNodeIdentities.length === 0, onActivate: () => activate(action) }, action.key))), hasResettableQuery && tools?.reset !== false ? (_jsx(PhiButtonControl, { icon: _jsx(PhiIcon, { name: "rollback-outlined", size: "inherit" }), ariaLabel: labels.reset, tooltip: labels.reset, size: controlSize, onClick: resetTools })) : null, tools?.reload ? (_jsx(PhiButtonControl, { icon: _jsx(PhiIcon, { name: "reload", size: "inherit" }), ariaLabel: labels.reload, tooltip: labels.reload, size: controlSize, onClick: binding.reload })) : null] })) : null;
|
|
188
187
|
/*
|
|
189
|
-
* The source's failures end the Tree here: a
|
|
190
|
-
*
|
|
191
|
-
*
|
|
188
|
+
* The source's failures end the Tree here: a Provider the Area does not offer, a read that failed. A
|
|
189
|
+
* refused change stays in `binding.error` alone, said above the nodes to the person who made it. The
|
|
190
|
+
* configuration against the resource is checked where it is made (`checkPhiPresetTables`, the
|
|
191
|
+
* Builder's save), not here.
|
|
192
192
|
*/
|
|
193
|
-
const sourceFailure = binding.bindingError ??
|
|
193
|
+
const sourceFailure = binding.bindingError ?? binding.queryError?.message ?? null;
|
|
194
194
|
if (sourceFailure) {
|
|
195
195
|
return (_jsx(PhiWidgetFailure, { renderMode: renderMode, widgetType: PhiCmsWidgetType.Tree, title: sourceFailure, error: binding.queryError }));
|
|
196
196
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PHI_CMS_SEQUENTIAL_LAYOUT_SLOTS } from "../../../../constants/cms-layout-types";
|
|
2
2
|
import { PHI_DASHBOARD_CARD_DATA_PROVIDER_KEY, PHI_DASHBOARD_CARD_RESOURCE_KEY, } from "../../../../constants/dashboard-card-provider-keys";
|
|
3
|
-
import { PhiCmsPageType } from "../../../../constants/phi-cms";
|
|
3
|
+
import { PhiCmsFlags, PhiCmsPageType } from "../../../../constants/phi-cms";
|
|
4
4
|
import { createPhiCmsPresetNodes } from "../../../../helpers/cms-preset-nodes";
|
|
5
5
|
import { buildPhiBasePageContentScaffold, PHI_BASE_PAGE_LAYOUT_NODE_ID } from "../../../../components/regions/presets/phi-base-page-layout";
|
|
6
6
|
/**
|
|
@@ -16,6 +16,8 @@ export function buildPhiDashboardCardsWidget({ nodes, widgetId, area, slotIndex,
|
|
|
16
16
|
typeKey: "collection-view",
|
|
17
17
|
slotIndex,
|
|
18
18
|
sortOrder: 0,
|
|
19
|
+
// `emptyDescription` is the Dashboard's Label Set, translated already.
|
|
20
|
+
flags: PhiCmsFlags.NoTranslate,
|
|
19
21
|
label: `${area} dashboard cards`,
|
|
20
22
|
config: {
|
|
21
23
|
presentation: {
|