@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
|
@@ -17,7 +17,7 @@ import { PhiSliderControl } from "./phi-slider-control";
|
|
|
17
17
|
import { PhiTextControl } from "./phi-text-control";
|
|
18
18
|
import { usePhiImmediatePicker } from "./use-phi-immediate-picker";
|
|
19
19
|
import { PhiIcon } from "../shell/phi-icon";
|
|
20
|
-
export function PhiMediaPickerControl({ open, value = null, assets, spaces = [], spaceValue = null, sources = [], sourceValue = "", sourceItems = [], sourceHasMore = false, importingItemId = null, sourceNotice = null, uploadPanel, uploadNotice = null, folders = [], folderValue = "/", query = "", page = 1, pageSize = 20, total = assets.length, minColumnWidth = PHI_MEDIA_PICKER_DEFAULT_COLUMN_WIDTH, loading, disabled, readOnly, placement = "
|
|
20
|
+
export function PhiMediaPickerControl({ open, value = null, assets, spaces = [], spaceValue = null, sources = [], sourceValue = "", sourceItems = [], sourceHasMore = false, importingItemId = null, sourceNotice = null, uploadPanel, uploadNotice = null, folders = [], folderValue = "/", query = "", page = 1, pageSize = 20, total = assets.length, minColumnWidth = PHI_MEDIA_PICKER_DEFAULT_COLUMN_WIDTH, loading, disabled, readOnly, placement = "bottom", showSearchBar = true, showFolderFilter = true, showPagination = true, trigger, isAssetSelectable, labels, getPopupContainer, popupRootClassName, onOpenChange, onQueryChange, onSpaceChange, onSourceChange, onSourceItemSelect, onSourceLoadMore, onFolderChange, onPageChange, onMinColumnWidthChange, onReload, onChange, onCommit, onDiscard, }) {
|
|
21
21
|
const { token } = usePhiConfig();
|
|
22
22
|
const locked = disabled || readOnly;
|
|
23
23
|
const resolvedMinColumnWidth = normalizePhiMediaPickerMinColumnWidth(minColumnWidth);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { PhiModalControlProps } from "./phi-modal-control";
|
|
2
|
-
export declare function PhiModalControlAdapter({ open, title, header, body, footer, closable, keyboard, mask, mountPolicy, centered, controlSize, size,
|
|
2
|
+
export declare function PhiModalControlAdapter({ open, title, header, body, footer, closable, keyboard, mask, mountPolicy, centered, controlSize, size, minSize, maxSize, toldSize, rootClassName, containerStyle, onDismiss, afterOpenChange, panelRef, }: PhiModalControlProps): import("react").JSX.Element;
|
|
@@ -5,38 +5,13 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
5
5
|
* Everything Ant Design's Modal brings -- the dialog, its motion and focus trap -- is paid by the pages
|
|
6
6
|
* that open one, not by every page that could.
|
|
7
7
|
*/
|
|
8
|
-
import { useEffect, useRef
|
|
8
|
+
import { useEffect, useRef } from "react";
|
|
9
9
|
import { Modal } from "antd";
|
|
10
10
|
import { PHI_CONTROL, PHI_SPACE } from "../../theme/antd-css-var-contract";
|
|
11
11
|
import { resolvePhiMotionDurationMs } from "../../helpers/motion";
|
|
12
12
|
import { usePhiConfig } from "../root/phi-config-provider";
|
|
13
|
-
import {
|
|
13
|
+
import { PHI_OVERLAY_DEFAULT_MASK, resolvePhiModalGeometry, resolvePhiOverlayDismissSource, resolvePhiOverlayMaskPresentation, } from "./phi-overlay-control-contract";
|
|
14
14
|
import { usePhiHydrated } from "../state/use-phi-hydrated";
|
|
15
|
-
const PHI_MODAL_MODE_QUERIES = [
|
|
16
|
-
`(min-width: ${PHI_MODAL_RESPONSIVE_MIN_WIDTH.medium}px)`,
|
|
17
|
-
`(min-width: ${PHI_MODAL_RESPONSIVE_MIN_WIDTH.wide}px)`,
|
|
18
|
-
];
|
|
19
|
-
/** The viewport crosses one of the Modal's two thresholds far less often than it resizes. */
|
|
20
|
-
function subscribeModalMode(onChange) {
|
|
21
|
-
const queries = PHI_MODAL_MODE_QUERIES.map((query) => window.matchMedia(query));
|
|
22
|
-
for (const query of queries)
|
|
23
|
-
query.addEventListener("change", onChange);
|
|
24
|
-
return () => {
|
|
25
|
-
for (const query of queries)
|
|
26
|
-
query.removeEventListener("change", onChange);
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
function readModalMode() {
|
|
30
|
-
return resolvePhiModalResponsiveMode(window.innerWidth);
|
|
31
|
-
}
|
|
32
|
-
function readServerModalMode() {
|
|
33
|
-
return "compact";
|
|
34
|
-
}
|
|
35
|
-
const PHI_MODAL_WIDTH_BY_CONTROL_SIZE = {
|
|
36
|
-
small: 520,
|
|
37
|
-
medium: 720,
|
|
38
|
-
large: 960,
|
|
39
|
-
};
|
|
40
15
|
/** What a dialog opens on: the first thing to type into or choose from, never a button or a hint. */
|
|
41
16
|
const PHI_MODAL_FIRST_FIELD_SELECTOR = [
|
|
42
17
|
"input:not([type=hidden]):not(:disabled)",
|
|
@@ -56,10 +31,11 @@ const PHI_MODAL_TAB_STOP_SELECTOR = [
|
|
|
56
31
|
/** About a second: a Form that loads its descriptor late still gets the focus, a slower one does not. */
|
|
57
32
|
const PHI_MODAL_FIRST_FIELD_MAX_FRAMES = 60;
|
|
58
33
|
const PHI_MODAL_HEADER_MIN_BLOCK_SIZE = `calc(${PHI_CONTROL.md} + ${PHI_SPACE.xs} + ${PHI_SPACE.xs})`;
|
|
59
|
-
export function PhiModalControlAdapter({ open, title, header, body, footer, closable = true, keyboard = true, mask = PHI_OVERLAY_DEFAULT_MASK, mountPolicy = "remount", centered = false, controlSize, size,
|
|
34
|
+
export function PhiModalControlAdapter({ open, title, header, body, footer, closable = true, keyboard = true, mask = PHI_OVERLAY_DEFAULT_MASK, mountPolicy = "remount", centered = false, controlSize, size, minSize, maxSize, toldSize, rootClassName, containerStyle, onDismiss, afterOpenChange, panelRef, }) {
|
|
60
35
|
const { token } = usePhiConfig();
|
|
61
36
|
const hydrated = usePhiHydrated();
|
|
62
|
-
const
|
|
37
|
+
const geometry = resolvePhiModalGeometry({ size, minSize, maxSize, toldSize, controlSize });
|
|
38
|
+
const blockSize = geometry.blockSize;
|
|
63
39
|
const bodyMeasureRef = useRef(null);
|
|
64
40
|
const bodyContentRef = useRef(null);
|
|
65
41
|
const dialogRef = useRef(null);
|
|
@@ -67,7 +43,7 @@ export function PhiModalControlAdapter({ open, title, header, body, footer, clos
|
|
|
67
43
|
useEffect(() => {
|
|
68
44
|
const bodyMeasure = bodyMeasureRef.current;
|
|
69
45
|
const bodyContent = bodyContentRef.current;
|
|
70
|
-
if (!open || !bodyMeasure || !bodyContent ||
|
|
46
|
+
if (!open || !bodyMeasure || !bodyContent || blockSize != null || typeof ResizeObserver === "undefined") {
|
|
71
47
|
return undefined;
|
|
72
48
|
}
|
|
73
49
|
let targetBlockSize = bodyContent.getBoundingClientRect().height;
|
|
@@ -105,7 +81,7 @@ export function PhiModalControlAdapter({ open, title, header, body, footer, clos
|
|
|
105
81
|
resizeAnimationRef.current?.cancel();
|
|
106
82
|
resizeAnimationRef.current = null;
|
|
107
83
|
};
|
|
108
|
-
}, [open,
|
|
84
|
+
}, [open, blockSize, token.motionDurationMid, token.motionEaseInOut]);
|
|
109
85
|
/*
|
|
110
86
|
* Ant Design's lock moves the focus to the first focusable element, which is the close button, so a
|
|
111
87
|
* dialog with a Form could not be typed into until Tab was pressed. The field may mount a few frames
|
|
@@ -156,11 +132,11 @@ export function PhiModalControlAdapter({ open, title, header, body, footer, clos
|
|
|
156
132
|
transform: "translateY(-50%)",
|
|
157
133
|
zIndex: 1,
|
|
158
134
|
}, children: title }))] }));
|
|
159
|
-
const resolvedWidth = size?.width ?? resolvePhiModalWidth(width, controlSize == null ? undefined : PHI_MODAL_WIDTH_BY_CONTROL_SIZE[controlSize], mode);
|
|
160
135
|
// The wrapper covers the viewport; letting the pointer through means opening it, not just the mask.
|
|
161
136
|
const passesOutsidePointer = !resolvedMask.capturesOutsidePointer;
|
|
162
|
-
return (_jsx(Modal, { open: open, title: renderedTitle, closable: closable, keyboard: keyboard, mask: resolvedMask.adapterMask, destroyOnHidden: mountPolicy === "remount", forceRender: hydrated && mountPolicy === "eager", centered: centered, width:
|
|
163
|
-
|
|
137
|
+
return (_jsx(Modal, { open: open, title: renderedTitle, closable: closable, keyboard: keyboard, mask: resolvedMask.adapterMask, destroyOnHidden: mountPolicy === "remount", forceRender: hydrated && mountPolicy === "eager", centered: centered, width: geometry.width, style: {
|
|
138
|
+
...(geometry.minWidth == null ? null : { minWidth: geometry.minWidth }),
|
|
139
|
+
maxWidth: geometry.maxWidth,
|
|
164
140
|
transition: `width ${token.motionDurationMid} ${token.motionEaseInOut}`,
|
|
165
141
|
}, rootClassName: rootClassName, footer: footer ?? null, focusable: { trap: true, focusTriggerAfterClose: true }, styles: {
|
|
166
142
|
mask: resolvedMask.maskStyle,
|
|
@@ -170,8 +146,9 @@ export function PhiModalControlAdapter({ open, title, header, body, footer, clos
|
|
|
170
146
|
display: "flex",
|
|
171
147
|
flexDirection: "column",
|
|
172
148
|
gap: 0,
|
|
173
|
-
...(
|
|
174
|
-
|
|
149
|
+
...(blockSize == null ? {} : { blockSize }),
|
|
150
|
+
...(geometry.minBlockSize == null ? {} : { minBlockSize: geometry.minBlockSize }),
|
|
151
|
+
maxBlockSize: geometry.maxBlockSize,
|
|
175
152
|
overflow: "hidden",
|
|
176
153
|
...containerStyle,
|
|
177
154
|
padding: 0,
|
|
@@ -220,6 +197,6 @@ export function PhiModalControlAdapter({ open, title, header, body, footer, clos
|
|
|
220
197
|
minWidth: 0,
|
|
221
198
|
overflow: "hidden",
|
|
222
199
|
width: "100%",
|
|
223
|
-
...(
|
|
200
|
+
...(blockSize == null ? {} : { minBlockSize: "100%" }),
|
|
224
201
|
}, children: _jsx("div", { ref: bodyContentRef, "data-phi-modal-body-content": "true", style: { minWidth: 0, width: "100%" }, children: body }) }) }));
|
|
225
202
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { PhiControlSize } from "../../types/control";
|
|
2
2
|
import type { PhiRenderableBlockSize } from "../../types/renderable-block";
|
|
3
|
-
import type {
|
|
4
|
-
export type PhiModalControlProps = PhiOverlayControlCommonProps & {
|
|
3
|
+
import type { PhiOverlayControlCommonProps, PhiOverlayControlGeometryProps } from "./phi-overlay-control-contract";
|
|
4
|
+
export type PhiModalControlProps = PhiOverlayControlCommonProps & PhiOverlayControlGeometryProps & {
|
|
5
5
|
centered?: boolean;
|
|
6
|
+
/** The width step where `size` names no width (`PHI_MODAL_WIDTH_BY_CONTROL_SIZE`). */
|
|
6
7
|
controlSize?: PhiControlSize;
|
|
7
|
-
size
|
|
8
|
-
|
|
9
|
-
width?: PhiModalWidth;
|
|
8
|
+
/** What a `size` Signal told the open Modal; each axis it names stands over the stated `size`. */
|
|
9
|
+
toldSize?: PhiRenderableBlockSize | null;
|
|
10
10
|
rootClassName?: string;
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
@@ -128,6 +128,7 @@ export declare function usePhiControlOptionsProvider<TValue extends string | num
|
|
|
128
128
|
description?: string;
|
|
129
129
|
icon?: string;
|
|
130
130
|
parentValue?: TValue;
|
|
131
|
+
flags?: number;
|
|
131
132
|
}[] | null;
|
|
132
133
|
optionsProvider?: PhiControlOptionsProviderConfig | null;
|
|
133
134
|
sourceConfig?: Record<string, unknown> | null;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { CSSProperties, ReactNode } from "react";
|
|
2
|
+
import type { PhiControlSize } from "../../types/control";
|
|
2
3
|
import type { PhiCmsMountPolicy } from "../../types/cms-mount-policy";
|
|
3
|
-
import type {
|
|
4
|
-
import
|
|
4
|
+
import type { PhiCmsOverlayConfig, PhiOverlayCloseSource, PhiOverlayMaskBehaviour } from "../../types/cms-overlay";
|
|
5
|
+
import type { PhiRenderableBlockSize } from "../../types/renderable-block";
|
|
5
6
|
export type PhiOverlayControlDismissEvent = {
|
|
6
7
|
target: EventTarget | null;
|
|
7
8
|
key?: string;
|
|
@@ -55,26 +56,60 @@ export declare function resolvePhiOverlayMaskPresentation(mask: PhiOverlayMaskBe
|
|
|
55
56
|
background?: string | undefined;
|
|
56
57
|
};
|
|
57
58
|
};
|
|
58
|
-
export type PhiModalWidth = PhiCmsOverlaySize | PhiResponsiveValue<PhiCmsOverlaySize>;
|
|
59
|
-
export type PhiModalResponsiveMode = keyof PhiResolvedResponsiveValue<unknown>;
|
|
60
59
|
/**
|
|
61
|
-
*
|
|
60
|
+
* An Overlay's geometry as a Control takes it: the block's own three pairs (`PhiCmsOverlayConfig`), one
|
|
61
|
+
* value per axis.
|
|
62
|
+
*/
|
|
63
|
+
export type PhiOverlayControlGeometryProps = {
|
|
64
|
+
size?: PhiRenderableBlockSize | null;
|
|
65
|
+
minSize?: PhiRenderableBlockSize | null;
|
|
66
|
+
maxSize?: PhiRenderableBlockSize | null;
|
|
67
|
+
};
|
|
68
|
+
/** The width each `controlSize` step gives a Modal whose `size` names none. */
|
|
69
|
+
export declare const PHI_MODAL_WIDTH_BY_CONTROL_SIZE: Record<PhiControlSize, number>;
|
|
70
|
+
/** What a Modal draws of its geometry, as CSS: the dialog's width and box, and its container's height. */
|
|
71
|
+
export type PhiModalGeometry = {
|
|
72
|
+
/** Handed to the Modal as its width; undefined leaves it Ant Design's default. */
|
|
73
|
+
width: string | undefined;
|
|
74
|
+
minWidth: string | undefined;
|
|
75
|
+
maxWidth: string;
|
|
76
|
+
blockSize: string | undefined;
|
|
77
|
+
minBlockSize: string | undefined;
|
|
78
|
+
maxBlockSize: string;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* A Modal's geometry, read once through the block's resolver.
|
|
62
82
|
*
|
|
63
|
-
* The
|
|
64
|
-
*
|
|
65
|
-
*
|
|
83
|
+
* The width is the one a Signal told (`toldSize`, the `size` input), else the stated `size`, else the
|
|
84
|
+
* `controlSize` step; the height the told one, else the stated one, else none -- the Modal is as tall as
|
|
85
|
+
* its content up to the viewport. A minimum and a maximum are the stated ones, each held inside the
|
|
86
|
+
* viewport room, and with no maximum stated the viewport room is the maximum.
|
|
66
87
|
*/
|
|
67
|
-
export declare
|
|
68
|
-
|
|
69
|
-
|
|
88
|
+
export declare function resolvePhiModalGeometry({ size, minSize, maxSize, toldSize, controlSize, }: PhiOverlayControlGeometryProps & {
|
|
89
|
+
toldSize?: PhiRenderableBlockSize | null;
|
|
90
|
+
controlSize?: PhiControlSize;
|
|
91
|
+
}): PhiModalGeometry;
|
|
92
|
+
/** What a Drawer draws of its geometry: the length along the axis it opens on, and its bounds. */
|
|
93
|
+
export type PhiDrawerGeometry = {
|
|
94
|
+
/**
|
|
95
|
+
* Handed to the Drawer as its `size`, a pixel length as a number (the Drawer warns on a string that is
|
|
96
|
+
* one); undefined leaves it Ant Design's default.
|
|
97
|
+
*/
|
|
98
|
+
size: number | string | undefined;
|
|
99
|
+
/** How far a resizable Drawer may be dragged, where the stated maximum is in pixels. */
|
|
100
|
+
resizeMaxSize: number | undefined;
|
|
101
|
+
/** The bounds on the panel (`min-width`/`max-width`, or the height pair at `top` and `bottom`). */
|
|
102
|
+
style: CSSProperties;
|
|
70
103
|
};
|
|
71
|
-
export declare function resolvePhiModalResponsiveMode(availableWidth: number): PhiModalResponsiveMode;
|
|
72
104
|
/**
|
|
73
|
-
*
|
|
105
|
+
* A Drawer's geometry, read once through the block's resolver.
|
|
74
106
|
*
|
|
75
|
-
* A
|
|
76
|
-
*
|
|
77
|
-
*
|
|
107
|
+
* A Drawer opens along one axis: `width` at `left` and `right`, `height` at `top` and `bottom`. The other
|
|
108
|
+
* axis is the viewport's, and what a config states for it is not drawn. The maximum reaches the panel as
|
|
109
|
+
* CSS whatever its unit, and Ant Design's resize as a limit only where it is in pixels, the one unit a
|
|
110
|
+
* drag counts in.
|
|
78
111
|
*/
|
|
79
|
-
export declare function
|
|
112
|
+
export declare function resolvePhiDrawerGeometry({ size, minSize, maxSize, placement, }: PhiOverlayControlGeometryProps & {
|
|
113
|
+
placement: PhiCmsOverlayConfig["placement"];
|
|
114
|
+
}): PhiDrawerGeometry;
|
|
80
115
|
export declare function resolvePhiOverlayDismissSource(event: PhiOverlayControlDismissEvent): PhiOverlayCloseSource;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { PHI_SPACE } from "../../theme/antd-css-var-contract";
|
|
2
|
+
import { resolvePhiRenderableBlockGeometry, } from "../../types/renderable-block-geometry";
|
|
3
3
|
export const PHI_OVERLAY_DEFAULT_MASK = {
|
|
4
4
|
appearance: "normal",
|
|
5
5
|
allowOutsideInteraction: false,
|
|
@@ -36,41 +36,66 @@ export function resolvePhiOverlayMaskPresentation(mask) {
|
|
|
36
36
|
},
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
|
+
/** The width each `controlSize` step gives a Modal whose `size` names none. */
|
|
40
|
+
export const PHI_MODAL_WIDTH_BY_CONTROL_SIZE = {
|
|
41
|
+
small: 520,
|
|
42
|
+
medium: 720,
|
|
43
|
+
large: 960,
|
|
44
|
+
};
|
|
39
45
|
/**
|
|
40
|
-
*
|
|
46
|
+
* The room a Modal never leaves: one `base` step clear of the viewport on both inline sides, one `lg`
|
|
47
|
+
* step on both block sides. Every stated length is held inside it, a minimum included, so a floor that
|
|
48
|
+
* keeps a Form in two columns on a desk does not push the dialog off a phone.
|
|
49
|
+
*/
|
|
50
|
+
const PHI_MODAL_VIEWPORT_INLINE = `calc(100vw - ${PHI_SPACE.base} - ${PHI_SPACE.base})`;
|
|
51
|
+
const PHI_MODAL_VIEWPORT_BLOCK = `calc(100dvh - ${PHI_SPACE.lg} - ${PHI_SPACE.lg})`;
|
|
52
|
+
function withinViewport(length, viewport) {
|
|
53
|
+
return length == null ? undefined : `min(${length.css}, ${viewport})`;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* A Modal's geometry, read once through the block's resolver.
|
|
41
57
|
*
|
|
42
|
-
* The
|
|
43
|
-
*
|
|
44
|
-
*
|
|
58
|
+
* The width is the one a Signal told (`toldSize`, the `size` input), else the stated `size`, else the
|
|
59
|
+
* `controlSize` step; the height the told one, else the stated one, else none -- the Modal is as tall as
|
|
60
|
+
* its content up to the viewport. A minimum and a maximum are the stated ones, each held inside the
|
|
61
|
+
* viewport room, and with no maximum stated the viewport room is the maximum.
|
|
45
62
|
*/
|
|
46
|
-
export
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
63
|
+
export function resolvePhiModalGeometry({ size, minSize, maxSize, toldSize, controlSize, }) {
|
|
64
|
+
const stated = resolvePhiRenderableBlockGeometry({ size, minSize, maxSize });
|
|
65
|
+
const told = resolvePhiRenderableBlockGeometry({ size: toldSize });
|
|
66
|
+
const width = told.inline.size?.css
|
|
67
|
+
?? stated.inline.size?.css
|
|
68
|
+
?? (controlSize == null ? undefined : `${PHI_MODAL_WIDTH_BY_CONTROL_SIZE[controlSize]}px`);
|
|
69
|
+
return {
|
|
70
|
+
width,
|
|
71
|
+
minWidth: withinViewport(stated.inline.min, PHI_MODAL_VIEWPORT_INLINE),
|
|
72
|
+
maxWidth: withinViewport(stated.inline.max, PHI_MODAL_VIEWPORT_INLINE) ?? PHI_MODAL_VIEWPORT_INLINE,
|
|
73
|
+
blockSize: told.block.size?.css ?? stated.block.size?.css,
|
|
74
|
+
minBlockSize: withinViewport(stated.block.min, PHI_MODAL_VIEWPORT_BLOCK),
|
|
75
|
+
maxBlockSize: withinViewport(stated.block.max, PHI_MODAL_VIEWPORT_BLOCK) ?? PHI_MODAL_VIEWPORT_BLOCK,
|
|
76
|
+
};
|
|
56
77
|
}
|
|
57
78
|
/**
|
|
58
|
-
*
|
|
79
|
+
* A Drawer's geometry, read once through the block's resolver.
|
|
59
80
|
*
|
|
60
|
-
* A
|
|
61
|
-
*
|
|
62
|
-
*
|
|
81
|
+
* A Drawer opens along one axis: `width` at `left` and `right`, `height` at `top` and `bottom`. The other
|
|
82
|
+
* axis is the viewport's, and what a config states for it is not drawn. The maximum reaches the panel as
|
|
83
|
+
* CSS whatever its unit, and Ant Design's resize as a limit only where it is in pixels, the one unit a
|
|
84
|
+
* drag counts in.
|
|
63
85
|
*/
|
|
64
|
-
export function
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
86
|
+
export function resolvePhiDrawerGeometry({ size, minSize, maxSize, placement, }) {
|
|
87
|
+
const geometry = resolvePhiRenderableBlockGeometry({ size, minSize, maxSize });
|
|
88
|
+
const horizontal = placement === "left" || placement === "right";
|
|
89
|
+
const axis = horizontal ? geometry.inline : geometry.block;
|
|
90
|
+
const min = axis.min?.css;
|
|
91
|
+
const max = axis.max?.css;
|
|
92
|
+
return {
|
|
93
|
+
size: axis.size?.part?.unit === "px" ? axis.size.part.value : axis.size?.css,
|
|
94
|
+
resizeMaxSize: axis.max?.part?.unit === "px" ? axis.max.part.value : undefined,
|
|
95
|
+
style: horizontal
|
|
96
|
+
? { ...(min == null ? null : { minWidth: min }), ...(max == null ? null : { maxWidth: max }) }
|
|
97
|
+
: { ...(min == null ? null : { minHeight: min }), ...(max == null ? null : { maxHeight: max }) },
|
|
98
|
+
};
|
|
74
99
|
}
|
|
75
100
|
export function resolvePhiOverlayDismissSource(event) {
|
|
76
101
|
if ("key" in event && event.key === "Escape")
|
|
@@ -3,7 +3,10 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { Popover } from "antd";
|
|
4
4
|
import { PHI_SPACE } from "../../theme/antd-css-var-contract";
|
|
5
5
|
export function PhiPopoverControl({ open, content, children, title, trigger = "click", placement, disabled = false, destroyOnHidden = false, arrow, padding = "sm", popupContentStyle, zIndex, getPopupContainer, rootClassName, onOpenChange, }) {
|
|
6
|
-
return (_jsx(Popover, { open: disabled ? false : open, content: content, title: title, trigger: trigger, placement: (placement === "auto" ? undefined : placement),
|
|
6
|
+
return (_jsx(Popover, { open: disabled ? false : open, content: content, title: title, trigger: trigger, placement: (placement === "auto" ? undefined : placement),
|
|
7
|
+
// Stated rather than left to the default: a popup wider than the room beside its trigger is moved
|
|
8
|
+
// into the window instead of pushing the page into a sideways scroll.
|
|
9
|
+
autoAdjustOverflow: true, destroyOnHidden: destroyOnHidden, arrow: arrow === false ? false : arrow === "point-at-center" ? { pointAtCenter: true } : undefined, styles: {
|
|
7
10
|
container: {
|
|
8
11
|
...popupContentStyle,
|
|
9
12
|
padding: PHI_SPACE[padding],
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type PhiRevealOnceDialogLabels } from "./phi-reveal-once-dialog-labels";
|
|
2
|
+
/** Writes the value to the clipboard: true where it was written, false where the browser refused. */
|
|
3
|
+
export declare function copyPhiRevealedValue(value: string, clipboard?: Pick<Clipboard, "writeText"> | undefined): Promise<boolean>;
|
|
4
|
+
export type PhiRevealOnceDialogControlProps = {
|
|
5
|
+
/** The value shown once -- a new key's activation code. Null closes the Dialog. */
|
|
6
|
+
value: string | null;
|
|
7
|
+
title: string;
|
|
8
|
+
/** What the reader is told about it: that it is shown only now. */
|
|
9
|
+
description?: string;
|
|
10
|
+
labels?: Partial<PhiRevealOnceDialogLabels>;
|
|
11
|
+
/** Called when the Dialog closes, copied or not; the caller forgets the value then. */
|
|
12
|
+
onClose: () => void;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* A value shown once, in a Dialog that copies it and closes: the answer of an act whose result is not kept
|
|
16
|
+
* anywhere it could be read again -- an activation code stored as its hash. The value stands in a code
|
|
17
|
+
* box the reader can select; "Copy and close" writes it to the clipboard and closes, and where the browser
|
|
18
|
+
* refuses, the Dialog stays open and says so. Nothing here keeps the value: the caller holds it until
|
|
19
|
+
* `onClose` and drops it then.
|
|
20
|
+
*/
|
|
21
|
+
export declare function PhiRevealOnceDialogControl({ value, title, description, labels, onClose, }: PhiRevealOnceDialogControlProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { PhiDialogControl } from "./phi-dialog-control";
|
|
5
|
+
import { PhiTypographyControl } from "./phi-typography-control";
|
|
6
|
+
import { PhiIcon } from "../shell/phi-icon";
|
|
7
|
+
import { PHI_REVEAL_ONCE_DIALOG_DEFAULT_LABELS } from "./phi-reveal-once-dialog-labels";
|
|
8
|
+
/** Writes the value to the clipboard: true where it was written, false where the browser refused. */
|
|
9
|
+
export async function copyPhiRevealedValue(value, clipboard = typeof navigator === "undefined" ? undefined : navigator.clipboard) {
|
|
10
|
+
if (!clipboard)
|
|
11
|
+
return false;
|
|
12
|
+
try {
|
|
13
|
+
await clipboard.writeText(value);
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A value shown once, in a Dialog that copies it and closes: the answer of an act whose result is not kept
|
|
22
|
+
* anywhere it could be read again -- an activation code stored as its hash. The value stands in a code
|
|
23
|
+
* box the reader can select; "Copy and close" writes it to the clipboard and closes, and where the browser
|
|
24
|
+
* refuses, the Dialog stays open and says so. Nothing here keeps the value: the caller holds it until
|
|
25
|
+
* `onClose` and drops it then.
|
|
26
|
+
*/
|
|
27
|
+
export function PhiRevealOnceDialogControl({ value, title, description, labels, onClose, }) {
|
|
28
|
+
const words = { ...PHI_REVEAL_ONCE_DIALOG_DEFAULT_LABELS, ...labels };
|
|
29
|
+
const [failed, setFailed] = useState(false);
|
|
30
|
+
const close = () => {
|
|
31
|
+
setFailed(false);
|
|
32
|
+
onClose();
|
|
33
|
+
};
|
|
34
|
+
const copyAndClose = async () => {
|
|
35
|
+
if (value == null)
|
|
36
|
+
return;
|
|
37
|
+
if (await copyPhiRevealedValue(value))
|
|
38
|
+
close();
|
|
39
|
+
else
|
|
40
|
+
setFailed(true);
|
|
41
|
+
};
|
|
42
|
+
return (_jsxs(PhiDialogControl, { open: value != null, title: title, alert: failed ? { level: "warning", showIcon: true, title: words.copyFailed } : null, actions: [
|
|
43
|
+
{ key: "close", label: words.close, onClick: close },
|
|
44
|
+
{
|
|
45
|
+
key: "copy",
|
|
46
|
+
label: words.copyAndClose,
|
|
47
|
+
type: "primary",
|
|
48
|
+
icon: _jsx(PhiIcon, { name: "copy", size: "inherit" }),
|
|
49
|
+
onClick: () => void copyAndClose(),
|
|
50
|
+
},
|
|
51
|
+
], onDismiss: close, children: [description ? _jsx(PhiTypographyControl, { type: "secondary", children: description }) : null, _jsx(PhiTypographyControl, { code: true, style: { fontSize: "1.25em", userSelect: "all", wordBreak: "break-all" }, children: value ?? "" })] }));
|
|
52
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** The words of `PhiRevealOnceDialogControl`, apart from it so a server Label Set can name them. */
|
|
2
|
+
export type PhiRevealOnceDialogLabels = {
|
|
3
|
+
/** The primary button: copies the value and closes. */
|
|
4
|
+
copyAndClose: string;
|
|
5
|
+
/** Closes without copying. */
|
|
6
|
+
close: string;
|
|
7
|
+
/** Said where the browser refused the copy; the value stays on screen to be selected by hand. */
|
|
8
|
+
copyFailed: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const PHI_REVEAL_ONCE_DIALOG_DEFAULT_LABELS: PhiRevealOnceDialogLabels;
|
|
@@ -122,6 +122,12 @@ export type PhiTableControlProps<TRow extends Record<string, unknown>> = {
|
|
|
122
122
|
rowReordering?: PhiTableControlRowReordering;
|
|
123
123
|
editing?: PhiTableControlRowEditing<TRow>;
|
|
124
124
|
loading?: boolean;
|
|
125
|
+
/**
|
|
126
|
+
* How many skeleton rows stand in for the rows while they load: three unless a Table says otherwise
|
|
127
|
+
* (`PHI_TABLE_LOADING_ROWS`). Few on purpose -- a Table grows when its rows arrive rather than shrinks,
|
|
128
|
+
* and most Tables hold a handful of rows (TABLES.md, "Loading").
|
|
129
|
+
*/
|
|
130
|
+
loadingRows?: number;
|
|
125
131
|
bordered?: boolean;
|
|
126
132
|
striped?: boolean;
|
|
127
133
|
showHeader?: boolean;
|
|
@@ -149,4 +155,4 @@ export type PhiTableControlProps<TRow extends Record<string, unknown>> = {
|
|
|
149
155
|
onExternalDrop?: (event: DragEvent<HTMLDivElement>) => void;
|
|
150
156
|
};
|
|
151
157
|
export declare function readPhiTableControlValue(row: Record<string, unknown>, path: string): unknown;
|
|
152
|
-
export declare function PhiTableControl<TRow extends Record<string, unknown>>({ rows, rowIdentityPath, columns, columnOrder, sortingMode, sorts, onSortsChange, columnReordering, onColumnOrderChange, rowSelection, pagination, tree, rowReordering, editing, loading, bordered, striped, stickyHeader, showHeader, footer, summary, size, emptyText, layout, rowStyle, onRowActivate, onExternalRowDragOver, onExternalRowDrop, onExternalDragOver, onExternalDrop, }: PhiTableControlProps<TRow>): import("react").JSX.Element;
|
|
158
|
+
export declare function PhiTableControl<TRow extends Record<string, unknown>>({ rows, rowIdentityPath, columns, columnOrder, sortingMode, sorts, onSortsChange, columnReordering, onColumnOrderChange, rowSelection, pagination, tree, rowReordering, editing, loading, loadingRows: loadingRowCount, bordered, striped, stickyHeader, showHeader, footer, summary, size, emptyText, layout, rowStyle, onRowActivate, onExternalRowDragOver, onExternalRowDrop, onExternalDragOver, onExternalDrop, }: PhiTableControlProps<TRow>): import("react").JSX.Element;
|
|
@@ -9,6 +9,7 @@ import { flushSync } from "react-dom";
|
|
|
9
9
|
import { Children, cloneElement, createContext, isValidElement, useCallback, useContext, useEffect, useMemo, useRef, useState, } from "react";
|
|
10
10
|
import { PHI_GREGORY_CALENDAR_ADAPTER_KEY } from "../../types/calendar-keys";
|
|
11
11
|
import { PHI_VISUAL_ANCHOR_PART_ATTRIBUTE } from "../../types/visual-anchors";
|
|
12
|
+
import { PHI_TABLE_LOADING_ROWS, PHI_TABLE_LOADING_ROWS_MAX } from "../../constants/table-loading";
|
|
12
13
|
import { PhiTruncatedHoverText } from "./phi-truncated-hover-text";
|
|
13
14
|
import { PhiColorControl } from "./phi-color-control";
|
|
14
15
|
import { PhiCheckboxControl } from "./phi-checkbox-control";
|
|
@@ -207,8 +208,9 @@ function buildColumnStyle(sizing) {
|
|
|
207
208
|
};
|
|
208
209
|
}
|
|
209
210
|
function buildLoadingSkeletonStyle(width, cellPaddingInline) {
|
|
211
|
+
// A column that sizes to its content gets a skeleton a short word wide, so it does not collapse to nothing.
|
|
210
212
|
if (width == null)
|
|
211
|
-
return { display: "block", width: "100%", minWidth:
|
|
213
|
+
return { display: "block", width: "100%", minWidth: 48 };
|
|
212
214
|
const contentWidth = typeof width === "number"
|
|
213
215
|
? Math.max(24, width - cellPaddingInline * 2)
|
|
214
216
|
: `max(24px, calc(${width} - ${cellPaddingInline * 2}px))`;
|
|
@@ -377,7 +379,7 @@ const PHI_TABLE_COLUMN_TITLE_STYLE = { display: "block", minWidth: 0, overflow:
|
|
|
377
379
|
function renderPhiTableColumnTitle(title) {
|
|
378
380
|
return (_jsx(PhiTruncatedHoverText, { title: title, children: _jsx("span", { style: PHI_TABLE_COLUMN_TITLE_STYLE, children: title }) }));
|
|
379
381
|
}
|
|
380
|
-
export function PhiTableControl({ rows, rowIdentityPath, columns, columnOrder, sortingMode, sorts, onSortsChange, columnReordering = false, onColumnOrderChange, rowSelection, pagination = false, tree, rowReordering, editing, loading = false, bordered, striped = false, stickyHeader = false, showHeader, footer, summary, size, emptyText, layout, rowStyle, onRowActivate, onExternalRowDragOver, onExternalRowDrop, onExternalDragOver, onExternalDrop, }) {
|
|
382
|
+
export function PhiTableControl({ rows, rowIdentityPath, columns, columnOrder, sortingMode, sorts, onSortsChange, columnReordering = false, onColumnOrderChange, rowSelection, pagination = false, tree, rowReordering, editing, loading = false, loadingRows: loadingRowCount = PHI_TABLE_LOADING_ROWS, bordered, striped = false, stickyHeader = false, showHeader, footer, summary, size, emptyText, layout, rowStyle, onRowActivate, onExternalRowDragOver, onExternalRowDrop, onExternalDragOver, onExternalDrop, }) {
|
|
381
383
|
const { token } = usePhiConfig();
|
|
382
384
|
const [editingRowIdentityState, setEditingRowIdentity] = useState(null);
|
|
383
385
|
const [rowEditPatch, setRowEditPatch] = useState({});
|
|
@@ -709,9 +711,8 @@ export function PhiTableControl({ rows, rowIdentityPath, columns, columnOrder, s
|
|
|
709
711
|
const visibleRows = useMemo(() => tree
|
|
710
712
|
? flattenVisibleTreeRows(dataSource, rowIdentityPath, tree.expandedRowIdentities)
|
|
711
713
|
: dataSource, [dataSource, rowIdentityPath, tree]);
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
: Math.min(8, Math.max(3, pagination.pageSize));
|
|
714
|
+
// Never more than a page holds: a Table that pages by five does not load as ten.
|
|
715
|
+
const loadingSkeletonRows = Math.max(1, Math.min(Math.trunc(loadingRowCount), pagination === false ? PHI_TABLE_LOADING_ROWS_MAX : pagination.pageSize)) || PHI_TABLE_LOADING_ROWS;
|
|
715
716
|
const loadingRows = useMemo(() => Array.from({ length: loadingSkeletonRows }, (_, index) => ({
|
|
716
717
|
[PHI_TABLE_LOADING_ROW]: index,
|
|
717
718
|
})), [loadingSkeletonRows]);
|
|
@@ -737,12 +738,13 @@ export function PhiTableControl({ rows, rowIdentityPath, columns, columnOrder, s
|
|
|
737
738
|
const controlColumns = useMemo(() => {
|
|
738
739
|
return [
|
|
739
740
|
...rowDragColumn,
|
|
740
|
-
|
|
741
|
+
// Kept while loading, its controls disabled, so the columns do not move when the rows arrive.
|
|
742
|
+
...(rowSelection ? [Table.SELECTION_COLUMN] : []),
|
|
741
743
|
...antdColumns,
|
|
742
744
|
...rowEditingColumn,
|
|
743
745
|
...fallbackRowOrderingColumn,
|
|
744
746
|
];
|
|
745
|
-
}, [antdColumns, fallbackRowOrderingColumn,
|
|
747
|
+
}, [antdColumns, fallbackRowOrderingColumn, rowDragColumn, rowEditingColumn, rowSelection]);
|
|
746
748
|
const loadingSkeletonWidths = useMemo(() => new Map(orderedColumns.flatMap((column) => {
|
|
747
749
|
const width = column.sizing?.mode === "fixed"
|
|
748
750
|
? column.sizing.width
|
|
@@ -1004,6 +1006,18 @@ export function PhiTableControl({ rows, rowIdentityPath, columns, columnOrder, s
|
|
|
1004
1006
|
getCheckboxProps: (row) => ({ disabled: rowSelection.isRowDisabled?.(row) ?? false }),
|
|
1005
1007
|
}
|
|
1006
1008
|
: undefined;
|
|
1009
|
+
/*
|
|
1010
|
+
* The selection column of a loading Table: the same column, nothing chosen and nothing to choose, so
|
|
1011
|
+
* the skeleton has the width the rows will have.
|
|
1012
|
+
*/
|
|
1013
|
+
const loadingRowSelection = antdRowSelection
|
|
1014
|
+
? {
|
|
1015
|
+
type: antdRowSelection.type,
|
|
1016
|
+
fixed: antdRowSelection.fixed,
|
|
1017
|
+
selectedRowKeys: [],
|
|
1018
|
+
getCheckboxProps: () => ({ disabled: true }),
|
|
1019
|
+
}
|
|
1020
|
+
: undefined;
|
|
1007
1021
|
/*
|
|
1008
1022
|
* Whether something of the Table's own stands at its bottom edge. A sticky-top summary does not: it
|
|
1009
1023
|
* rides above the rows and leaves the last row to end the Table.
|
|
@@ -1038,11 +1052,12 @@ export function PhiTableControl({ rows, rowIdentityPath, columns, columnOrder, s
|
|
|
1038
1052
|
stickyHeader && showHeader !== false ? "phi-table-control--sticky-header" : null,
|
|
1039
1053
|
// No rows, nothing measured: the sticky header's fixed layout would have no widths to fix.
|
|
1040
1054
|
!loading && dataSource.length === 0 ? "phi-table-control--empty" : null,
|
|
1055
|
+
loading ? "phi-table-control--loading" : null,
|
|
1041
1056
|
]
|
|
1042
1057
|
.filter(Boolean)
|
|
1043
1058
|
.join(" "), style: { "--phi-table-striped-row-background": token.colorFillAlter }, rowKey: (row) => loading
|
|
1044
1059
|
? `__phi_table_loading_${String(row[PHI_TABLE_LOADING_ROW])}`
|
|
1045
|
-
: String(readIdentity(row, rowIdentityPath)), columns: renderedColumns, dataSource: loading ? loadingRows : dataSource, bordered: bordered, showHeader: showHeader, tableLayout: layout.mode, size: size, rowClassName: (_row, index) => striped && index % 2 === 1 ? "phi-table-control__row--striped" : "", rowSelection: loading ?
|
|
1060
|
+
: String(readIdentity(row, rowIdentityPath)), columns: renderedColumns, dataSource: loading ? loadingRows : dataSource, bordered: bordered, showHeader: showHeader, tableLayout: layout.mode, size: size, rowClassName: (_row, index) => striped && index % 2 === 1 ? "phi-table-control__row--striped" : "", rowSelection: loading ? loadingRowSelection : antdRowSelection, components: rowReordering?.enabled && !loading ? { body: { row: PhiTableSortableRow } } : undefined, scroll: layout.overflowX === "auto" ? { x: true } : undefined, sticky: stickyHeader && showHeader !== false ? true : undefined, pagination: pagination === false ? false : {
|
|
1046
1061
|
...{ [PHI_VISUAL_ANCHOR_PART_ATTRIBUTE]: "pagination" },
|
|
1047
1062
|
current: pagination.page,
|
|
1048
1063
|
pageSize: pagination.pageSize,
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { PhiControlOption } from "../controls/phi-control-options";
|
|
2
|
+
/**
|
|
3
|
+
* The `flags` field: several yes-or-no answers held as one bit-flag number, the shape every yes-or-no
|
|
4
|
+
* state of a Core contract has. Each option's `value` is its bit, written as the decimal number
|
|
5
|
+
* (`"1"`, `"2"`, `"4"`, ...); the value is the sum of the bits checked, `0` for none. `config.requires`
|
|
6
|
+
* names, by option value, the option an option needs: it is offered only while that one is checked and
|
|
7
|
+
* is cleared when it is unchecked -- a default only for a purpose the address has.
|
|
8
|
+
*/
|
|
9
|
+
export type PhiFlagsFieldConfig = {
|
|
10
|
+
bits: ReadonlyMap<string, number>;
|
|
11
|
+
requires: ReadonlyMap<number, number>;
|
|
12
|
+
};
|
|
13
|
+
/** The field's bits and dependencies, or an Error naming what is wrong: a field nobody can read the value of is refused. */
|
|
14
|
+
export declare function readPhiFlagsFieldConfig(config: Readonly<Record<string, unknown>> | undefined, options: readonly Pick<PhiControlOption, "value">[]): PhiFlagsFieldConfig;
|
|
15
|
+
/** The value as a number of the field's bits: anything else is none, and bits it does not offer are kept. */
|
|
16
|
+
export declare function readPhiFlagsFieldValue(value: unknown): number;
|
|
17
|
+
/**
|
|
18
|
+
* The value after a change of the checked options: the bits of those checked set, the field's other bits
|
|
19
|
+
* cleared, an option whose required one is not set cleared with it, and bits the field does not offer
|
|
20
|
+
* kept as they were.
|
|
21
|
+
*/
|
|
22
|
+
export declare function writePhiFlagsFieldValue(config: PhiFlagsFieldConfig, previous: number, checked: readonly string[]): number;
|