react-semaphor 0.1.507 → 0.1.509
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/DATA_APP_SDK.md +56 -0
- package/dist/analytics-protocol/index.cjs +1 -1
- package/dist/analytics-protocol/index.js +194 -172
- package/dist/appearance/index.cjs +1 -1
- package/dist/appearance/index.js +1 -1
- package/dist/appearance-runtime/index.cjs +1 -1
- package/dist/appearance-runtime/index.js +1 -1
- package/dist/brand-studio/index.cjs +2 -2
- package/dist/brand-studio/index.js +279 -250
- package/dist/briefings/index.cjs +1 -1
- package/dist/briefings/index.js +3 -3
- package/dist/chunks/appearance-context-DzqCdhB4.cjs +1 -0
- package/dist/chunks/{appearance-context-XviHOhWJ.js → appearance-context-VJdrKi7r.js} +2 -1
- package/dist/chunks/{appearance-runtime-provider-D0xVQWnH.js → appearance-runtime-provider-CC4HT2Gi.js} +2 -2
- package/dist/chunks/{appearance-runtime-provider-Ca8rxO86.cjs → appearance-runtime-provider-D5pkvgE4.cjs} +1 -1
- package/dist/chunks/calculated-field-identity-BiTGmnST.cjs +1 -0
- package/dist/chunks/calculated-field-identity-CJL54uFx.js +1373 -0
- package/dist/chunks/{constants-NUleP4DY.js → card-config-utils-Bq1enstT.js} +260 -260
- package/dist/chunks/card-config-utils-CMO4_zVs.cjs +1 -0
- package/dist/chunks/{dashboard-briefing-launcher-DXTpU85p.js → dashboard-briefing-launcher-B5AQu-Vb.js} +12 -12
- package/dist/chunks/{dashboard-briefing-launcher-C8nDSDnV.cjs → dashboard-briefing-launcher-BoXFrqq0.cjs} +1 -1
- package/dist/chunks/{dashboard-controls-CyL0yimg.js → dashboard-controls-CKKkSXEX.js} +16 -14
- package/dist/chunks/dashboard-controls-gUVkQm8o.cjs +52 -0
- package/dist/chunks/dashboard-json-B7fSi6_b.cjs +1 -0
- package/dist/chunks/{dashboard-json-5Jr3RudV.js → dashboard-json-CAJJquVx.js} +9 -9
- package/dist/chunks/edit-dashboard-visual-AZetLUv1.cjs +172 -0
- package/dist/chunks/{edit-dashboard-visual-C7X-um9g.js → edit-dashboard-visual-DCnbqRRn.js} +1986 -1990
- package/dist/chunks/{editor-action-buttons-CcDm8nA5.cjs → editor-action-buttons-CBQsVYdt.cjs} +2 -2
- package/dist/chunks/{editor-action-buttons-C5Wja_J4.js → editor-action-buttons-DDA5JGwO.js} +6 -6
- package/dist/chunks/field-aggregations-DUb0NU6c.js +1229 -0
- package/dist/chunks/field-aggregations-jSi77h9Z.cjs +1 -0
- package/dist/chunks/{field-dependencies-DVl2p1Nm.js → field-dependencies-Cl97kkHy.js} +30 -34
- package/dist/chunks/{field-dependencies-r_U0CGQ-.cjs → field-dependencies-DIab72rQ.cjs} +1 -1
- package/dist/chunks/{index-BVr4fcCB.js → index-0pdaQ9e1.js} +5 -5
- package/dist/chunks/{index-De2QNsqV.js → index-CL2lvhwk.js} +47783 -46019
- package/dist/chunks/{index-C9KXfCkC.js → index-CLIro-EG.js} +3 -0
- package/dist/chunks/index-Cx3qmRUB.cjs +1 -0
- package/dist/chunks/{index-BlYf8gNa.cjs → index-DhlVxvyI.cjs} +1 -1
- package/dist/chunks/index-DkEAikW8.cjs +1420 -0
- package/dist/chunks/{matrix-card-DACDwdTq.js → matrix-card-CnKQpnsj.js} +1 -1
- package/dist/chunks/{matrix-card-CRXcmAjp.cjs → matrix-card-U4c72doZ.cjs} +1 -1
- package/dist/chunks/{matrix-control-sources-ClQzIk7E.js → matrix-control-sources-CRRdP03Q.js} +165 -134
- package/dist/chunks/matrix-control-sources-FjxGIbqk.cjs +1 -0
- package/dist/chunks/{matrix-formatter-7GLTcBuy.cjs → matrix-formatter-CveLJo6S.cjs} +1 -1
- package/dist/chunks/{matrix-formatter-xsq7n_e6.js → matrix-formatter-ZVS5QOuq.js} +2 -2
- package/dist/chunks/matrix-member-presentation-CFHjdrxT.cjs +1 -0
- package/dist/chunks/matrix-member-presentation-CzGZJd3a.js +182 -0
- package/dist/chunks/matrix-operation-contract-DoiWTUbT.cjs +1 -0
- package/dist/chunks/matrix-operation-contract-xL8IhFzp.js +1802 -0
- package/dist/chunks/{pivot-header-presentation-3wqWChFd.cjs → pivot-header-presentation-Cxz8-06f.cjs} +1 -1
- package/dist/chunks/{pivot-header-presentation-D44ODZGn.js → pivot-header-presentation-DVylCBHB.js} +2 -2
- package/dist/chunks/{pivot-result-lifecycle-DZ0ZSMoM.cjs → pivot-result-lifecycle-BiERyXnS.cjs} +1 -1
- package/dist/chunks/{pivot-result-lifecycle-BSmqVkVG.js → pivot-result-lifecycle-CmjpW7qG.js} +1 -1
- package/dist/chunks/{report-preferences-dialog-xADifRXs.js → report-preferences-dialog-Bv2VIOKc.js} +4 -4
- package/dist/chunks/report-preferences-dialog-Wg9g9fIj.cjs +1 -0
- package/dist/chunks/{search-BHsQIWBV.js → selection-reducer-B94WgZ9V.js} +55 -11
- package/dist/chunks/selection-reducer-CGKKsaPa.cjs +26 -0
- package/dist/chunks/{semantic-format-BhIL1PXP.cjs → semantic-format-BzH69TRq.cjs} +1 -1
- package/dist/chunks/{semantic-format-C3amkGmY.js → semantic-format-CBlRO8Aw.js} +1 -1
- package/dist/chunks/{switch-DHGiC0aU.js → switch-CD4uGTZI.js} +7450 -7694
- package/dist/chunks/switch-iC1x2dcE.cjs +134 -0
- package/dist/chunks/token-types-Ahh5u4iT.cjs +1 -0
- package/dist/chunks/token-types-CPde8_LG.js +8 -0
- package/dist/chunks/{update-policy-Cc9h57pA.cjs → update-policy-COjFudhl.cjs} +1 -1
- package/dist/chunks/{update-policy-eTcz52jO.js → update-policy-D9q1Tz8k.js} +1 -1
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.cjs +3 -3
- package/dist/dashboard-authoring/index.js +734 -622
- package/dist/data-app-builder/index.cjs +1 -1
- package/dist/data-app-builder/index.js +3 -3
- package/dist/data-app-codegen/index.cjs +1 -1
- package/dist/data-app-codegen/index.js +2 -2
- package/dist/data-app-codegen-node/index.cjs +94 -92
- package/dist/data-app-codegen-node/index.js +337 -333
- package/dist/data-app-sdk/index.cjs +9 -9
- package/dist/data-app-sdk/index.js +1091 -969
- package/dist/data-app-sdk-adapters/index.cjs +1 -1
- package/dist/data-app-sdk-adapters/index.js +104 -96
- package/dist/data-app-sdk-validation/index.cjs +1 -1
- package/dist/data-app-sdk-validation/index.js +2 -2
- package/dist/format-utils/index.cjs +1 -1
- package/dist/format-utils/index.js +8 -8
- package/dist/index.cjs +1 -1
- package/dist/index.js +15 -15
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/brand-studio/brand-studio-draft.d.ts +3 -1
- package/dist/types/components/dashboard/card-selection-pill.d.ts +5 -0
- package/dist/types/components/dashboard/dashboard-container.d.ts +1 -1
- package/dist/types/components/dashboard/drill-breadcrumb.d.ts +1 -0
- package/dist/types/components/dashboard/drill-navigation-controls.d.ts +3 -3
- package/dist/types/components/interactions/applied-filters-display.d.ts +6 -1
- package/dist/types/components/interactions/click-to-filter-review-dialog.d.ts +21 -0
- package/dist/types/components/interactions/dashboard-drill-host.d.ts +13 -0
- package/dist/types/components/interactions/filter-badge-tooltip.d.ts +4 -4
- package/dist/types/components/interactions/insight-modal.d.ts +4 -14
- package/dist/types/components/interactions/insight-viewer.d.ts +7 -19
- package/dist/types/components/interactions/interactions-sheet.d.ts +6 -0
- package/dist/types/components/interactions/panels/click-to-filter-panel.d.ts +20 -0
- package/dist/types/components/interactions/reusable/interaction-selection-popover.d.ts +2 -2
- package/dist/types/components/interactions/sheet/action-editor.d.ts +17 -0
- package/dist/types/components/interactions/sheet/action-meta.d.ts +45 -0
- package/dist/types/components/interactions/sheet/action-picker.d.ts +7 -0
- package/dist/types/components/interactions/sheet/click-outcome-preview.d.ts +10 -0
- package/dist/types/components/interactions/sheet/interactions-home.d.ts +28 -0
- package/dist/types/components/interactions/sheet/sheet-parts.d.ts +37 -0
- package/dist/types/components/surfboard/filter/dashboard-filter-mapping-panel.d.ts +28 -1
- package/dist/types/components/surfboard/filter/selection-chip.d.ts +11 -0
- package/dist/types/components/surfboard/filter/selection-filter-section.d.ts +4 -0
- package/dist/types/components/surfboard/filter/use-dashboard-filter-mapping-popover.d.ts +3 -0
- package/dist/types/components/ui/resizable.d.ts +1 -1
- package/dist/types/components/visual/matrix-table/matrix-interaction-actions.d.ts +24 -3
- package/dist/types/components/visual/matrix-table/matrix-selection-click.d.ts +6 -0
- package/dist/types/components/visual/matrix-table/matrix-window-viewer.d.ts +1 -1
- package/dist/types/data-app-sdk/adapters.d.ts +3 -2
- package/dist/types/data-app-sdk/builders.d.ts +2 -1
- package/dist/types/data-app-sdk/contracts.d.ts +44 -2
- package/dist/types/data-app-sdk/index.d.ts +1 -0
- package/dist/types/data-app-sdk/query-request.d.ts +7 -2
- package/dist/types/data-app-sdk/selection.d.ts +2 -0
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.js +24 -23
- package/dist/types/lib/appearance/types.d.ts +3 -1
- package/dist/types/lib/briefings/briefing-attachment-model.d.ts +0 -2
- package/dist/types/lib/contexts/interactions-popover-context.d.ts +1 -8
- package/dist/types/lib/dashboard/click-to-filter-card-references.d.ts +23 -0
- package/dist/types/lib/dashboard-inputs/build-normalized-dashboard-inputs.d.ts +16 -2
- package/dist/types/lib/dashboard-inputs/build-selection-dashboard-inputs.d.ts +31 -0
- package/dist/types/lib/dashboard-inputs/click-to-filter-emitted-fields.d.ts +17 -0
- package/dist/types/lib/dashboard-inputs/click-to-filter-mapping-draft.d.ts +99 -0
- package/dist/types/lib/dashboard-inputs/click-to-filter-sheet-reach.d.ts +12 -0
- package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-authoring.d.ts +18 -1
- package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-candidate-metadata.d.ts +4 -1
- package/dist/types/lib/dashboard-inputs/dashboard-input-scope.d.ts +10 -0
- package/dist/types/lib/dashboard-inputs/dashboard-input-snapshot.d.ts +8 -1
- package/dist/types/lib/dashboard-inputs/index.d.ts +1 -0
- package/dist/types/lib/dashboard-inputs/resolve-dashboard-input-context.d.ts +18 -7
- package/dist/types/lib/dashboard-inputs/resolve-field-date-comparison-coverage.d.ts +5 -2
- package/dist/types/lib/dashboard-inputs/resolve-selection-input.d.ts +77 -0
- package/dist/types/lib/dashboard-inputs/selection-targets.d.ts +26 -0
- package/dist/types/lib/dashboard-inputs/transient-input-context.d.ts +102 -0
- package/dist/types/lib/dashboard-navigation/build-carried-click-context.d.ts +50 -0
- package/dist/types/lib/dashboard-navigation/describe-carried-context.d.ts +11 -0
- package/dist/types/lib/dashboard-navigation/index.d.ts +1 -0
- package/dist/types/lib/dashboard-navigation/navigation-state.d.ts +120 -0
- package/dist/types/lib/dashboard-navigation/run-one-off-drill.d.ts +11 -0
- package/dist/types/lib/dashboard-navigation/use-transient-contexts.d.ts +17 -0
- package/dist/types/lib/dashboard-view-state/card-view-state.d.ts +48 -0
- package/dist/types/lib/dashboard-view-state/drill-path.d.ts +20 -0
- package/dist/types/lib/dashboard-view-state/index.d.ts +2 -0
- package/dist/types/lib/download-pdf.d.ts +0 -3
- package/dist/types/lib/formatters/metric-formatting.d.ts +1 -1
- package/dist/types/lib/hooks/ai/dashboard-context.d.ts +15 -8
- package/dist/types/lib/hooks/chartjs/use-chart-blur.d.ts +10 -2
- package/dist/types/lib/hooks/interactions/{use-event-engine.d.ts → use-drill-actions.d.ts} +28 -7
- package/dist/types/lib/hooks/selection/use-active-selections.d.ts +15 -0
- package/dist/types/lib/hooks/selection/use-click-to-filter-mapping-draft.d.ts +20 -0
- package/dist/types/lib/hooks/selection/use-selection-click.d.ts +34 -0
- package/dist/types/lib/hooks/selection/use-selection-gestures.d.ts +38 -0
- package/dist/types/lib/hooks/selection/use-table-row-selection.d.ts +46 -0
- package/dist/types/lib/hooks/use-dashboard-card.d.ts +0 -2
- package/dist/types/lib/hooks/use-dashboard-filter-mapping-candidates.d.ts +18 -0
- package/dist/types/lib/hooks/use-dashboard-frame-query.d.ts +0 -1
- package/dist/types/lib/hooks/use-dashboard.d.ts +1 -3
- package/dist/types/lib/hooks/use-interactions-popover.d.ts +1 -8
- package/dist/types/lib/hooks/use-resolved-card-config.d.ts +6 -0
- package/dist/types/lib/interactions/click-outcome.d.ts +25 -0
- package/dist/types/lib/interactions/get-click-context-from-chartjs.d.ts +3 -1
- package/dist/types/lib/interactions/get-click-context-from-matrix.d.ts +1 -1
- package/dist/types/lib/interactions/get-click-context-from-table.d.ts +7 -0
- package/dist/types/lib/interactions/interaction-utils.d.ts +17 -1
- package/dist/types/lib/matrix-table/build-matrix-drill-to-detail.d.ts +15 -0
- package/dist/types/lib/matrix-table/matrix-card-interactions.d.ts +14 -3
- package/dist/types/lib/matrix-table/matrix-runtime-types.d.ts +0 -3
- package/dist/types/lib/matrix-table/matrix-runtime.d.ts +0 -4
- package/dist/types/lib/matrix-table/{use-matrix-selection.d.ts → use-matrix-cell-focus.d.ts} +13 -17
- package/dist/types/lib/matrix-table/use-matrix.d.ts +0 -1
- package/dist/types/lib/query-context/build-card-query-context.d.ts +19 -8
- package/dist/types/lib/query-context/build-dashboard-execution-snapshot.d.ts +5 -3
- package/dist/types/lib/query-context/build-dashboard-frame-base-query-contexts.d.ts +12 -4
- package/dist/types/lib/query-context/compile-selection-filters.d.ts +5 -0
- package/dist/types/lib/query-context/dashboard-filter-mapping-resolution.d.ts +46 -0
- package/dist/types/lib/query-context/filter-group-utils.d.ts +3 -0
- package/dist/types/lib/query-context/resolve-runtime-card-filters.d.ts +29 -0
- package/dist/types/lib/selection/click-to-filter-authoring-support.d.ts +9 -0
- package/dist/types/lib/selection/selection-from-click-context.d.ts +41 -0
- package/dist/types/lib/selection/selection-labels.d.ts +3 -0
- package/dist/types/lib/selection/selection-notices.d.ts +9 -0
- package/dist/types/lib/selection/selection-reducer.d.ts +46 -0
- package/dist/types/lib/stores/dashboard-store.d.ts +62 -17
- package/dist/types/lib/stores/editor-store.d.ts +1 -2
- package/dist/types/lib/stores/index.d.ts +0 -2
- package/dist/types/lib/types/common-types.d.ts +60 -6
- package/dist/types/lib/types/explorer-types.d.ts +1 -22
- package/dist/types/lib/types/interaction-types.d.ts +6 -198
- package/dist/types/lib/utils/calculate-context-aware-filters.d.ts +21 -12
- package/dist/types/lib/utils/card-utils.d.ts +11 -0
- package/dist/types/lib/utils/date-hierarchy-utils.d.ts +3 -1
- package/dist/types/lib/utils/drag-and-drop-utils.d.ts +1 -1
- package/dist/types/lib/utils/interaction-icons.d.ts +1 -1
- package/dist/types/shared/analytics-protocol/execution-input-schemas.d.ts +32 -32
- package/dist/types/shared/analytics-protocol/index.d.ts +2 -0
- package/dist/types/shared/analytics-protocol/selection-contract.d.ts +100 -0
- package/dist/types/shared/analytics-protocol/selection-filter-compiler.d.ts +12 -0
- package/dist/types/shared/dashboard-authoring/apply-group-by-override.d.ts +19 -0
- package/dist/types/shared/dashboard-authoring/click-to-filter-settings.d.ts +88 -0
- package/dist/types/shared/dashboard-authoring/contracts.d.ts +8 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +3 -0
- package/dist/types/shared/dashboard-authoring/linked-click-to-filter-overrides.d.ts +32 -0
- package/dist/types/shared/format-utils/matrix-continuation.d.ts +3 -3
- package/package.json +1 -1
- package/src/data-app-sdk/README.md +58 -1
- package/dist/chunks/appearance-context-tNjvTJj3.cjs +0 -1
- package/dist/chunks/calculated-field-identity-BTpUqfEu.js +0 -1276
- package/dist/chunks/calculated-field-identity-rMuXuzEY.cjs +0 -1
- package/dist/chunks/constants-vtu7_IUo.cjs +0 -1
- package/dist/chunks/dashboard-controls-DlxeddZN.cjs +0 -52
- package/dist/chunks/dashboard-json-DhS4yJfc.cjs +0 -1
- package/dist/chunks/edit-dashboard-visual-X3OCnivL.cjs +0 -172
- package/dist/chunks/field-aggregations-BU_3gHKR.js +0 -957
- package/dist/chunks/field-aggregations-CDCamEsQ.cjs +0 -1
- package/dist/chunks/index-C8XCKzB6.cjs +0 -1
- package/dist/chunks/index-DSa6RSdg.cjs +0 -1417
- package/dist/chunks/matrix-control-sources-CeC5EMyq.cjs +0 -1
- package/dist/chunks/matrix-member-presentation-E2B4k3ws.cjs +0 -1
- package/dist/chunks/matrix-member-presentation-qiHxv67e.js +0 -105
- package/dist/chunks/matrix-operation-contract-Cqy4EW2H.js +0 -1638
- package/dist/chunks/matrix-operation-contract-D9dLX-Wr.cjs +0 -1
- package/dist/chunks/report-preferences-dialog-7Vsc_fsG.cjs +0 -1
- package/dist/chunks/search-BqqhaMx9.cjs +0 -26
- package/dist/chunks/switch-BytP6QY8.cjs +0 -139
- package/dist/types/components/interactions/configuration-popover.d.ts +0 -1
- package/dist/types/components/interactions/interaction-card.d.ts +0 -59
- package/dist/types/components/interactions/interaction-event-handler.d.ts +0 -11
- package/dist/types/components/interactions/interactions-list.d.ts +0 -50
- package/dist/types/components/interactions/panels/cross-filter-panel.d.ts +0 -24
- package/dist/types/components/interactions/panels/inline-drill-panel.d.ts +0 -24
- package/dist/types/components/interactions/selectors/action-selector.d.ts +0 -31
- package/dist/types/components/interactions/selectors/trigger-selector.d.ts +0 -38
- package/dist/types/components/surfboard/filter/click-filter-section.d.ts +0 -5
- package/dist/types/lib/interactions/build-interaction-event.d.ts +0 -25
- package/dist/types/lib/interactions/convert-click-filters-to-filter-group.d.ts +0 -10
- package/dist/types/lib/interactions/execute-interaction-event.d.ts +0 -80
- package/dist/types/lib/interactions/field-utils.d.ts +0 -11
- package/dist/types/lib/interactions/handle-chart-click.d.ts +0 -75
- package/dist/types/lib/interactions/linked-interaction-utils.d.ts +0 -14
- package/dist/types/lib/interactions/source-card-filter-utils.d.ts +0 -9
- package/dist/types/lib/matrix-table/matrix-clipboard.d.ts +0 -45
- package/dist/types/lib/matrix-table/matrix-selection.d.ts +0 -20
- package/dist/types/lib/stores/drill-actions.d.ts +0 -139
- package/dist/types/lib/stores/interaction-store.d.ts +0 -113
- package/dist/types/lib/stores/pointer-interaction-store.d.ts +0 -18
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { DrillStep } from '../../dashboard-view-state/index.js';
|
|
1
2
|
import { ClickContextResult } from '../../interactions/get-click-context-from-chartjs.js';
|
|
2
3
|
import { TCard } from '../../types/index.js';
|
|
3
|
-
import {
|
|
4
|
+
import { Interaction, ClickFilterCondition, DrillDownInteraction, DrillToURLInteraction } from '../../types/interaction-types.js';
|
|
4
5
|
/**
|
|
5
6
|
* Find matching V2 interaction based on click context
|
|
6
7
|
*
|
|
@@ -34,21 +35,41 @@ export declare function findAllMatchingV2Interactions(interactions: Interaction[
|
|
|
34
35
|
*/
|
|
35
36
|
export declare function findMatchingV2Interaction(interactions: Interaction[], context: ClickContextResult, identity?: InteractionTriggerIdentity): Interaction | null;
|
|
36
37
|
/**
|
|
37
|
-
*
|
|
38
|
-
*
|
|
38
|
+
* Next step of a card's drill hierarchy, or undefined when the hierarchy is
|
|
39
|
+
* missing or exhausted. Date hierarchies resolve from the chart's current
|
|
40
|
+
* granularity; static hierarchies from the drill depth.
|
|
39
41
|
*/
|
|
40
|
-
export declare function
|
|
42
|
+
export declare function resolveDrillDownStep(card: TCard, interaction: DrillDownInteraction, breadcrumbs: readonly Pick<DrillStep, 'granularity'>[]): {
|
|
43
|
+
hierarchy: import('../../types/interaction-types.js').DrillHierarchy;
|
|
44
|
+
nextStep: import('../../types/interaction-types.js').DrillHierarchyStep;
|
|
45
|
+
} | undefined;
|
|
41
46
|
/**
|
|
42
|
-
*
|
|
47
|
+
* Opens a drill-to-URL target. Must run synchronously inside the click handler
|
|
48
|
+
* so popup blockers allow it. Returns false when the interpolated URL is invalid.
|
|
49
|
+
*/
|
|
50
|
+
export declare function openDrillToUrl(interaction: DrillToURLInteraction, params: {
|
|
51
|
+
conditions: ClickFilterCondition[];
|
|
52
|
+
cardId: string;
|
|
53
|
+
frameId: string;
|
|
54
|
+
sheetId: string;
|
|
55
|
+
}): boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Drill interactions a click matches. Click to filter is not an interaction any
|
|
58
|
+
* more: it is a card setting whose clicks become a selection input, so a legacy
|
|
59
|
+
* `clickFilter` entry never executes here.
|
|
60
|
+
*/
|
|
61
|
+
export declare function findMatchingDrillInteractions(interactions: Interaction[], context: ClickContextResult, identity?: InteractionTriggerIdentity): Interaction[];
|
|
62
|
+
/**
|
|
63
|
+
* Hook to run a card's drill interactions
|
|
43
64
|
*
|
|
44
65
|
* @param card - The card configuration
|
|
45
66
|
* @param onMultipleInteractions - Optional callback when multiple interactions match a click
|
|
46
67
|
*/
|
|
47
|
-
export declare function
|
|
68
|
+
export declare function useDrillActions(card: TCard, frameId: string, sheetId: string, onMultipleInteractions?: (matches: Interaction[], context: ClickContextResult, position?: {
|
|
48
69
|
x: number;
|
|
49
70
|
y: number;
|
|
50
71
|
}) => void): {
|
|
51
|
-
handlePointerInteraction: ({ context, gesture, position,
|
|
72
|
+
handlePointerInteraction: ({ context, gesture, position, }: {
|
|
52
73
|
context: ClickContextResult;
|
|
53
74
|
gesture: "leftClick" | "rightClick" | "longPress" | "hover";
|
|
54
75
|
modifierKeys?: {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Every selection in effect, with how many cards each narrows. For the filter bar. */
|
|
2
|
+
export declare function useActiveSelections(): (import('../../dashboard-inputs/build-selection-dashboard-inputs.js').ActiveSelection & {
|
|
3
|
+
targetCount: number;
|
|
4
|
+
})[];
|
|
5
|
+
/** What each active selection does on one card. For that card's filter badge. */
|
|
6
|
+
export declare function useSelectionsOnCard(cardId: string | undefined): {
|
|
7
|
+
resolution: import('../../dashboard-inputs/resolve-selection-input.js').ResolvedCardSelection;
|
|
8
|
+
input: import('../../types/index.js').SelectionDashboardInput;
|
|
9
|
+
value: import('../../../shared/analytics-protocol/selection-contract.js').SelectionInputValue;
|
|
10
|
+
sourceCard: import('../../types/index.js').TCard;
|
|
11
|
+
}[];
|
|
12
|
+
/** How many source cards currently narrow this card. */
|
|
13
|
+
export declare function useCardSelectionFilterCount(cardId: string | undefined): number;
|
|
14
|
+
/** Clears every selection slot, including one whose source card is gone. */
|
|
15
|
+
export declare function clearAllSelections(): void;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { NormalizedFilterDashboardInput, TCard } from '../../types/common-types.js';
|
|
2
|
+
import { ClickToFilterSettings } from '../../../shared/dashboard-authoring/index.js';
|
|
3
|
+
import { ClickToFilterDimension } from '../../dashboard-inputs/click-to-filter-emitted-fields.js';
|
|
4
|
+
/**
|
|
5
|
+
* The review rows for one source card's draft settings. Field metadata and
|
|
6
|
+
* labels come from the same loader the toolbar filter's Cards tab uses, and
|
|
7
|
+
* are requested only while the behavior is on and the surface is open.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useClickToFilterMappingDraft(params: {
|
|
10
|
+
sourceCard: Pick<TCard, 'id'> | null | undefined;
|
|
11
|
+
settings: ClickToFilterSettings;
|
|
12
|
+
dimensions: ClickToFilterDimension[];
|
|
13
|
+
enabled: boolean;
|
|
14
|
+
}): {
|
|
15
|
+
draft: import('../../dashboard-inputs/click-to-filter-mapping-draft.js').ClickToFilterMappingDraft | undefined;
|
|
16
|
+
fieldLabels: import('../../dashboard-inputs/dashboard-filter-mapping-candidate-metadata.js').DashboardFilterMappingFieldLabels;
|
|
17
|
+
filterInputs: NormalizedFilterDashboardInput[];
|
|
18
|
+
isLoading: boolean;
|
|
19
|
+
retry: () => void;
|
|
20
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ClickContextResult } from '../../interactions/get-click-context-from-chartjs.js';
|
|
2
|
+
import { TCard } from '../../types/common-types.js';
|
|
3
|
+
import { Interaction } from '../../types/interaction-types.js';
|
|
4
|
+
type PointerInteraction = (params: {
|
|
5
|
+
context: ClickContextResult;
|
|
6
|
+
gesture: 'leftClick';
|
|
7
|
+
modifierKeys?: {
|
|
8
|
+
shift: boolean;
|
|
9
|
+
ctrl: boolean;
|
|
10
|
+
meta: boolean;
|
|
11
|
+
};
|
|
12
|
+
position?: {
|
|
13
|
+
x: number;
|
|
14
|
+
y: number;
|
|
15
|
+
};
|
|
16
|
+
}) => void;
|
|
17
|
+
/**
|
|
18
|
+
* One left click on a mark or cell of a visual without row ranges: it selects
|
|
19
|
+
* for click to filter, runs the card's drill, or, when it does both, opens the
|
|
20
|
+
* menu with "Filter" beside the drills. Cmd, Ctrl and Shift toggle.
|
|
21
|
+
*/
|
|
22
|
+
export declare function useSelectionClick(card: TCard, params: {
|
|
23
|
+
handlePointerInteraction: PointerInteraction;
|
|
24
|
+
onMultipleInteractions?: (matches: Interaction[], context: ClickContextResult, position?: {
|
|
25
|
+
x: number;
|
|
26
|
+
y: number;
|
|
27
|
+
}) => void;
|
|
28
|
+
}): {
|
|
29
|
+
isEnabled: boolean;
|
|
30
|
+
handleClick: (event: Pick<React.MouseEvent, "shiftKey" | "metaKey" | "ctrlKey" | "clientX" | "clientY">, context: ClickContextResult, options?: {
|
|
31
|
+
canDrill: boolean;
|
|
32
|
+
}) => void;
|
|
33
|
+
};
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { SelectionTuple } from '../../../shared/analytics-protocol/selection-contract.js';
|
|
2
|
+
import { SelectionGesture, SelectionReduceResult } from '../../selection/selection-reducer.js';
|
|
3
|
+
import { SelectionTupleResult } from '../../selection/selection-from-click-context.js';
|
|
4
|
+
import { ClickToFilterFieldsRule, ClickToFilterSettings, TCard } from '../../types/common-types.js';
|
|
5
|
+
import { Field } from '../../types/explorer-types.js';
|
|
6
|
+
import { ClickFilterCondition, Interaction } from '../../types/interaction-types.js';
|
|
7
|
+
/**
|
|
8
|
+
* The "Filter" entry offered beside a card's drills when one click matches
|
|
9
|
+
* both. Compared by identity; it is never persisted and never executed by the
|
|
10
|
+
* drill engine.
|
|
11
|
+
*/
|
|
12
|
+
export declare const SELECTION_MENU_INTERACTION: Interaction;
|
|
13
|
+
export type SelectionGestures = {
|
|
14
|
+
/** Normalized `settings.enabled`. */
|
|
15
|
+
isEnabled: boolean;
|
|
16
|
+
settings: ClickToFilterSettings;
|
|
17
|
+
/** From the card's selection slot. */
|
|
18
|
+
selection: SelectionTuple[];
|
|
19
|
+
select: (tuple: SelectionTuple, gesture: SelectionGesture) => SelectionReduceResult;
|
|
20
|
+
/** Checkbox column: the checked set replaces the selection. */
|
|
21
|
+
selectMany: (tuples: SelectionTuple[]) => void;
|
|
22
|
+
clear: () => void;
|
|
23
|
+
/** Turns a capture builder's conditions into a tuple under this card's fields rule. */
|
|
24
|
+
tupleFromClick: (conditions: ClickFilterCondition[], clickedField?: Field,
|
|
25
|
+
/** Overrides the card's fields rule, for callers that need one specific cell or the whole row. */
|
|
26
|
+
rule?: ClickToFilterFieldsRule) => SelectionTupleResult;
|
|
27
|
+
/** Last tuple selected by replace or toggle, read at call time; the start of a Shift range. */
|
|
28
|
+
getAnchor: () => SelectionTuple | undefined;
|
|
29
|
+
/** Target cards the current selection narrows. Zero without a selection. */
|
|
30
|
+
targetCount: number;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Writes a source card's selection slot. Callable outside React so a store
|
|
34
|
+
* action or an imperative grid callback shares the one write path.
|
|
35
|
+
*/
|
|
36
|
+
export declare function writeSelection(sourceCardId: string, tuples: SelectionTuple[]): void;
|
|
37
|
+
/** The one place a card reads and changes its own selection. */
|
|
38
|
+
export declare function useSelectionGestures(card: TCard): SelectionGestures;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Row, Table } from '@tanstack/react-table';
|
|
2
|
+
import { SelectionTupleResult } from '../../selection/selection-from-click-context.js';
|
|
3
|
+
import { Field } from '../../types/explorer-types.js';
|
|
4
|
+
import { ClickFilterCondition } from '../../types/interaction-types.js';
|
|
5
|
+
import { SelectionGestures } from './use-selection-gestures.js';
|
|
6
|
+
/** Checkboxes are the touch affordance: always, never, or on coarse pointers only. */
|
|
7
|
+
export declare function areSelectionCheckboxesShown(gestures: Pick<SelectionGestures, 'isEnabled' | 'settings'>): boolean;
|
|
8
|
+
export type TableRowClickOutcome =
|
|
9
|
+
/** Click to filter is off, or the table is not interactive. */
|
|
10
|
+
{
|
|
11
|
+
status: 'ignored';
|
|
12
|
+
} | {
|
|
13
|
+
status: 'selected';
|
|
14
|
+
}
|
|
15
|
+
/** The click cannot become a selection. */
|
|
16
|
+
| {
|
|
17
|
+
status: 'unavailable';
|
|
18
|
+
result: Extract<SelectionTupleResult, {
|
|
19
|
+
status: 'unavailable';
|
|
20
|
+
}>;
|
|
21
|
+
} | {
|
|
22
|
+
status: 'limitReached';
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Click to filter for a row-based table. The selection slot is the record:
|
|
26
|
+
* row highlight and checkbox state are derived from it, and a checkbox change
|
|
27
|
+
* is applied to it as a difference, so rows selected on another page survive.
|
|
28
|
+
*/
|
|
29
|
+
export declare function useTableRowSelection<TData>(params: {
|
|
30
|
+
/** The card's one gestures instance, shared with the rest of the table. */
|
|
31
|
+
gestures: SelectionGestures;
|
|
32
|
+
table: Table<TData>;
|
|
33
|
+
/** Visible rows in display order, after sort and filter. */
|
|
34
|
+
rows: Row<TData>[];
|
|
35
|
+
isInteractive: boolean;
|
|
36
|
+
/** Dimension conditions of a row, from the table's capture builder. */
|
|
37
|
+
conditionsForRow: (row: Row<TData>) => ClickFilterCondition[] | undefined;
|
|
38
|
+
/** The dimension field a column shows, if any. */
|
|
39
|
+
fieldForColumnId: (columnId: string) => Field | undefined;
|
|
40
|
+
}): {
|
|
41
|
+
isEnabled: boolean;
|
|
42
|
+
checkboxesShown: boolean;
|
|
43
|
+
hasSelection: boolean;
|
|
44
|
+
handleRowClick: (event: Pick<React.MouseEvent, "shiftKey" | "metaKey" | "ctrlKey" | "nativeEvent">, row: Row<TData>, columnId: string | undefined) => TableRowClickOutcome;
|
|
45
|
+
clear: () => void;
|
|
46
|
+
};
|
|
@@ -11,7 +11,6 @@ export declare function useCard(cardId: string): {
|
|
|
11
11
|
visualKey: number;
|
|
12
12
|
handleDatapointClick: (chart: Chart, datasetIndex: number, clickIndex: number, value: number) => void;
|
|
13
13
|
cfg: any;
|
|
14
|
-
isRetainingSourceResult: boolean;
|
|
15
14
|
queryKey: string[];
|
|
16
15
|
queryRequestPayload: Record<string, unknown> | undefined;
|
|
17
16
|
pagination: import('../types/index.js').PaginationMetadata | undefined;
|
|
@@ -30,7 +29,6 @@ export declare function useDashboardCard(card: TCard): {
|
|
|
30
29
|
visualKey: number;
|
|
31
30
|
handleDatapointClick: (chart: Chart, datasetIndex: number, clickIndex: number, value: number) => void;
|
|
32
31
|
cfg: any;
|
|
33
|
-
isRetainingSourceResult: boolean;
|
|
34
32
|
queryKey: string[];
|
|
35
33
|
queryRequestPayload: Record<string, unknown> | undefined;
|
|
36
34
|
pagination: import('../types/index.js').PaginationMetadata | undefined;
|
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
import { TFilter } from '../../components/surfboard/filter/types.js';
|
|
2
2
|
import { DashboardInputScope } from '../types/common-types.js';
|
|
3
3
|
import { DashboardFilterOptionSource } from '../../shared/dashboard-authoring/index.js';
|
|
4
|
+
/**
|
|
5
|
+
* Live column metadata, candidate targets and field labels for every card in
|
|
6
|
+
* a scope. Independent of what is being mapped, so a toolbar filter's Cards
|
|
7
|
+
* tab and the click-to-filter review dialog load and label fields identically.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useDashboardMappingCandidateCatalogs(params: {
|
|
10
|
+
enabled: boolean;
|
|
11
|
+
outerScope: Extract<DashboardInputScope, {
|
|
12
|
+
kind: 'allSheets' | 'sheets';
|
|
13
|
+
}>;
|
|
14
|
+
/** Click-to-filter can target document cards; toolbar mappings cannot. */
|
|
15
|
+
includeDocumentSections?: boolean;
|
|
16
|
+
}): {
|
|
17
|
+
candidatesByCardId: Record<string, import('../dashboard-inputs/index.js').DashboardFilterMappingCandidateCatalog | undefined>;
|
|
18
|
+
fieldLabels: import('../dashboard-inputs/dashboard-filter-mapping-candidate-metadata.js').DashboardFilterMappingFieldLabels;
|
|
19
|
+
isLoading: boolean;
|
|
20
|
+
retry: () => void;
|
|
21
|
+
};
|
|
4
22
|
export declare function useDashboardFilterMappingCandidates(params: {
|
|
5
23
|
filter: TFilter;
|
|
6
24
|
enabled: boolean;
|
|
@@ -25,7 +25,6 @@ type AdditionalState = {
|
|
|
25
25
|
effectiveCardConfig?: CardConfig;
|
|
26
26
|
resultOwner: TemporalResultOwner;
|
|
27
27
|
isCurrentQueryResult: boolean;
|
|
28
|
-
isRetainingSourceResult: boolean;
|
|
29
28
|
};
|
|
30
29
|
export type DashboardCardQueryResult = UseQueryResult<any, Error> & AdditionalState;
|
|
31
30
|
export type DashboardCardQueryOptions = {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { AuthToken, ControlBinding, ControlDefinition, CustomCard, DashboardLifecycleEvent, DashboardInputExecutionSnapshot, TDashboard, TEvent, TStyle } from '../types/common-types.js';
|
|
2
2
|
import { PresentationExecutionSnapshot } from '../../shared/format-utils/index.js';
|
|
3
3
|
import { TFilterValue } from '../../components/index.js';
|
|
4
|
-
import { InteractionState } from '../types/interaction-types.js';
|
|
5
4
|
type UseDashboardProps = {
|
|
6
5
|
id?: string;
|
|
7
6
|
version?: string;
|
|
@@ -17,7 +16,6 @@ type UseDashboardProps = {
|
|
|
17
16
|
controlBindings?: ControlBinding[];
|
|
18
17
|
};
|
|
19
18
|
dashboardInputExecutionSnapshot?: DashboardInputExecutionSnapshot;
|
|
20
|
-
interactionExecutionSnapshot?: Record<string, InteractionState>;
|
|
21
19
|
presentationExecutionSnapshot?: PresentationExecutionSnapshot;
|
|
22
20
|
customStyle?: TStyle;
|
|
23
21
|
currentTheme?: 'light' | 'dark' | 'system';
|
|
@@ -30,7 +28,7 @@ type UseDashboardProps = {
|
|
|
30
28
|
type?: 'dashboard' | 'visual';
|
|
31
29
|
cardId?: string;
|
|
32
30
|
};
|
|
33
|
-
export declare function useDashboard({ customStyle, currentTheme, onSave, onEvent, onDashboardLifecycleEvent, defaultFilterValues, defaultControlValues, controlContractOverrides, dashboardInputExecutionSnapshot,
|
|
31
|
+
export declare function useDashboard({ customStyle, currentTheme, onSave, onEvent, onDashboardLifecycleEvent, defaultFilterValues, defaultControlValues, controlContractOverrides, dashboardInputExecutionSnapshot, presentationExecutionSnapshot, type, cardId, selectedSheetId, onFilterValuesChange, }: UseDashboardProps): {
|
|
34
32
|
isFetching: boolean;
|
|
35
33
|
isLoading: boolean;
|
|
36
34
|
isError: boolean;
|
|
@@ -2,13 +2,6 @@ export declare function useInteractionsPopover(): {
|
|
|
2
2
|
open: boolean;
|
|
3
3
|
frameId: string | null;
|
|
4
4
|
cardId: string | null;
|
|
5
|
-
|
|
6
|
-
anchorPosition: {
|
|
7
|
-
left: number;
|
|
8
|
-
top: number;
|
|
9
|
-
width: number;
|
|
10
|
-
height: number;
|
|
11
|
-
} | null;
|
|
12
|
-
openPopover: (frameId: string, cardId: string, triggerElement: HTMLElement) => void;
|
|
5
|
+
openPopover: (frameId: string, cardId: string) => void;
|
|
13
6
|
closePopover: () => void;
|
|
14
7
|
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CardConfig, FilterGroup } from '../types/explorer-types.js';
|
|
2
|
+
import { TCard } from '../types/common-types.js';
|
|
3
|
+
/** The card's authored filters narrowed by its drill path. Selections reach a query through its card query context. */
|
|
4
|
+
export declare function useResolvedFilters(card: TCard): FilterGroup | undefined;
|
|
5
|
+
export declare function useResolvedCardConfig(card: TCard): CardConfig;
|
|
6
|
+
export declare function useFinalFilterGroupKey(card: TCard): string | undefined;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Interaction } from '../types/interaction-types.js';
|
|
2
|
+
/**
|
|
3
|
+
* What a viewer gets from one click on a card, given what the author set up.
|
|
4
|
+
* Mirrors the runtime rule in `use-drill-actions.ts` and `use-selection-click.ts`:
|
|
5
|
+
* one thing to do runs directly, several open a menu with "Filter" beside the
|
|
6
|
+
* drills. It assumes a click that every action's trigger matches, so a card
|
|
7
|
+
* whose actions sit on different fields can show a longer menu here than any
|
|
8
|
+
* single click opens.
|
|
9
|
+
*/
|
|
10
|
+
export type ClickOutcome = {
|
|
11
|
+
kind: 'nothing';
|
|
12
|
+
} | {
|
|
13
|
+
kind: 'filter';
|
|
14
|
+
} | {
|
|
15
|
+
kind: 'direct';
|
|
16
|
+
interaction: Interaction;
|
|
17
|
+
} | {
|
|
18
|
+
kind: 'menu';
|
|
19
|
+
filter: boolean;
|
|
20
|
+
interactions: Interaction[];
|
|
21
|
+
};
|
|
22
|
+
export declare function resolveClickOutcome({ filterEnabled, interactions, }: {
|
|
23
|
+
filterEnabled: boolean;
|
|
24
|
+
interactions: readonly Interaction[];
|
|
25
|
+
}): ClickOutcome;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TCard } from '../types/index.js';
|
|
2
|
-
import { CardConfig } from '../../components/index.js';
|
|
2
|
+
import { CardConfig, Field } from '../../components/index.js';
|
|
3
3
|
import { QueryColumnKeyMap } from '../types/explorer-types.js';
|
|
4
4
|
import { ClickedMetricValue, ClickFilterCondition } from '../types/interaction-types.js';
|
|
5
5
|
import { Chart } from 'chart.js';
|
|
@@ -8,6 +8,8 @@ import { ResolvedTemporalValueFormatPreferences } from '../../shared/value-forma
|
|
|
8
8
|
export interface ClickContextResult {
|
|
9
9
|
conditions: ClickFilterCondition[];
|
|
10
10
|
metrics?: ClickedMetricValue[];
|
|
11
|
+
/** The dimension column under the pointer, when the visual has cells. */
|
|
12
|
+
clickedField?: Field;
|
|
11
13
|
}
|
|
12
14
|
export declare function getClickContextFromChartJs({ resolvedCardConfig, card, records, chart, clickEvent, columnKeyMap, resultColumns, valueFormatPreferences, }: {
|
|
13
15
|
resolvedCardConfig: CardConfig;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MatrixField, MatrixPath, MatrixSpec, MatrixWindow } from '../../shared/analytics-protocol/index.js';
|
|
2
2
|
import { Field } from '../types/explorer-types.js';
|
|
3
3
|
import { ClickContextResult } from './get-click-context-from-chartjs.js';
|
|
4
|
-
import { InteractionTriggerIdentity } from '../hooks/interactions/use-
|
|
4
|
+
import { InteractionTriggerIdentity } from '../hooks/interactions/use-drill-actions.js';
|
|
5
5
|
export type MatrixInteractionEligibility = {
|
|
6
6
|
enabled: true;
|
|
7
7
|
} | {
|
|
@@ -33,3 +33,10 @@ export interface TableClickContextParams {
|
|
|
33
33
|
* @returns Click context with dimension conditions and metric values, or undefined if no valid context
|
|
34
34
|
*/
|
|
35
35
|
export declare function getClickContextFromTable({ resolvedCardConfig, card, row, columnKeyMap, temporalPresentation, }: TableClickContextParams): ClickContextResult | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* The dimension field a table column shows, resolved through the same column
|
|
38
|
+
* key binding the row capture uses. Undefined for metric and utility columns.
|
|
39
|
+
*/
|
|
40
|
+
export declare function getTableDimensionFieldForColumn({ resolvedCardConfig, card, columnId, columnKeyMap, }: Pick<TableClickContextParams, 'resolvedCardConfig' | 'card' | 'columnKeyMap'> & {
|
|
41
|
+
columnId: string;
|
|
42
|
+
}): import('../types/index.js').Field | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CardInteractionConfig, Interaction } from '../types/interaction-types.js';
|
|
1
|
+
import { CardInteractionConfig, Interaction, PersistedInteraction } from '../types/interaction-types.js';
|
|
2
2
|
/**
|
|
3
3
|
* Get all interactions from a config.
|
|
4
4
|
*
|
|
@@ -14,3 +14,19 @@ export declare function getInteractions(config: CardInteractionConfig | undefine
|
|
|
14
14
|
* @returns true if interaction has a trigger
|
|
15
15
|
*/
|
|
16
16
|
export declare function hasTrigger(interaction: Interaction): boolean;
|
|
17
|
+
type InteractionWithId = PersistedInteraction & {
|
|
18
|
+
id: string;
|
|
19
|
+
};
|
|
20
|
+
/** Interactions saved before ids existed get a stable, position-derived id. */
|
|
21
|
+
export declare function ensureInteractionIds(interactions?: PersistedInteraction[]): InteractionWithId[];
|
|
22
|
+
export declare function createInteractionWithStableId(): {
|
|
23
|
+
id: string;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Rewrites the card ids of legacy cross-filter entries when a card is copied
|
|
27
|
+
* or linked. Cards not yet re-saved still carry those entries, and the
|
|
28
|
+
* click-to-filter normalizer reads their targets, so the ids must follow the
|
|
29
|
+
* copy. Authored settings are remapped by `remapClickToFilterReferences`.
|
|
30
|
+
*/
|
|
31
|
+
export declare function remapClickFilterTargetsToInstance(interactions: PersistedInteraction[], sourceToInstanceCardIds: Map<string, string>): PersistedInteraction[];
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TCard } from '../types/index.js';
|
|
2
|
+
import { ClickFilterCondition, ClickedMetricValue, DrillToDetailEvent } from '../types/interaction-types.js';
|
|
3
|
+
import { InteractionTriggerIdentity } from '../hooks/interactions/use-drill-actions.js';
|
|
4
|
+
export type MatrixDrillClickContext = {
|
|
5
|
+
cardId: string;
|
|
6
|
+
conditions: ClickFilterCondition[];
|
|
7
|
+
metric?: ClickedMetricValue;
|
|
8
|
+
};
|
|
9
|
+
/** Resolve the authored drill-to-insight action for one Matrix click. */
|
|
10
|
+
export declare function buildMatrixDrillToDetail({ card, context, triggerIdentity, }: {
|
|
11
|
+
card: TCard;
|
|
12
|
+
context: MatrixDrillClickContext;
|
|
13
|
+
/** Authored instances select actions; grounded condition fields remain unchanged. */
|
|
14
|
+
triggerIdentity?: InteractionTriggerIdentity;
|
|
15
|
+
}): DrillToDetailEvent | undefined;
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import { MatrixInteractionHost } from '../../components/visual/matrix-table/matrix-interaction-actions.js';
|
|
2
|
+
import { SelectionGestures } from '../hooks/selection/use-selection-gestures.js';
|
|
3
|
+
import { SelectionTupleResult } from '../selection/selection-from-click-context.js';
|
|
2
4
|
import { TCard } from '../types/common-types.js';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
import { DrillToDetailEvent } from '../types/interaction-types.js';
|
|
6
|
+
export type MatrixSelectionHost = {
|
|
7
|
+
gestures: Pick<SelectionGestures, 'isEnabled' | 'settings' | 'tupleFromClick' | 'select' | 'selection'>;
|
|
8
|
+
onUnavailable?: (result: Extract<SelectionTupleResult, {
|
|
9
|
+
status: 'unavailable';
|
|
10
|
+
}>) => void;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Drill-to-insight requests dispatch directly to the dashboard drill runtime.
|
|
14
|
+
* A context-menu filter and a direct click both write the card's selection slot.
|
|
15
|
+
*/
|
|
16
|
+
export declare function createMatrixCardInteractions(card: TCard, host: Pick<MatrixInteractionHost, 'resolveField' | 'capabilities'>, dispatch: (event: DrillToDetailEvent) => void, selection?: MatrixSelectionHost): MatrixInteractionHost;
|
|
@@ -28,8 +28,6 @@ export declare class MatrixRuntimeController {
|
|
|
28
28
|
private view;
|
|
29
29
|
private spec;
|
|
30
30
|
private snapshot;
|
|
31
|
-
private copyDemand?;
|
|
32
|
-
private rejectCopy?;
|
|
33
31
|
constructor(input: MatrixRuntimeInput, query: QueryClient, execute: MatrixWindowExecutor, session?: MatrixViewState);
|
|
34
32
|
subscribe: (listener: () => void) => () => boolean;
|
|
35
33
|
getSnapshot: () => MatrixRuntimeSnapshot;
|
|
@@ -53,8 +51,6 @@ export declare class MatrixRuntimeController {
|
|
|
53
51
|
/** Used by explicit refresh/retry integrations; latest-issued response wins. */
|
|
54
52
|
refetchCell: (coordinate: MatrixCoordinate) => void;
|
|
55
53
|
refetchPage: (key: string) => void;
|
|
56
|
-
/** Clipboard demand shares page-owner tiles, the queue and retention policy. */
|
|
57
|
-
acquireCells: (coordinates: readonly MatrixCoordinate[], signal?: AbortSignal) => Promise<MatrixCellState[]>;
|
|
58
54
|
private visible;
|
|
59
55
|
private plan;
|
|
60
56
|
private loadPage;
|
package/dist/types/lib/matrix-table/{use-matrix-selection.d.ts → use-matrix-cell-focus.d.ts}
RENAMED
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import { KeyboardEvent } from 'react';
|
|
2
|
-
import { MatrixCoordinate,
|
|
2
|
+
import { MatrixCoordinate, MatrixSpec } from '../../shared/analytics-protocol/index.js';
|
|
3
3
|
import { MatrixRuntime } from './use-matrix.js';
|
|
4
|
-
/**
|
|
5
|
-
|
|
4
|
+
/**
|
|
5
|
+
* One view-local active cell for grid navigation and editor field scoping.
|
|
6
|
+
* Dashboard selection remains owned by the selection input runtime.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useMatrixCellFocus(input: {
|
|
6
9
|
runtime: MatrixRuntime;
|
|
7
10
|
spec: MatrixSpec;
|
|
8
|
-
absence: MatrixPresentation['absence'];
|
|
9
11
|
reveal: (row: number, valueColumn: number) => void;
|
|
10
|
-
|
|
12
|
+
onFocusChange?: (coordinate: MatrixCoordinate | undefined) => void;
|
|
13
|
+
onActivate?: (coordinate: MatrixCoordinate, event: KeyboardEvent<HTMLDivElement>) => void;
|
|
11
14
|
}): {
|
|
12
15
|
hasFocus: boolean;
|
|
13
16
|
focusedRow: number;
|
|
14
17
|
focusedColumn: number;
|
|
15
|
-
|
|
18
|
+
coordinate: {
|
|
16
19
|
rowPath: readonly {
|
|
17
20
|
member: {
|
|
18
21
|
value: string | number | boolean | {
|
|
@@ -43,17 +46,10 @@ export declare function useMatrixSelection(input: {
|
|
|
43
46
|
}[];
|
|
44
47
|
measureId: string;
|
|
45
48
|
} | undefined;
|
|
46
|
-
/** Inclusive row and value-column bounds of the current selection. */
|
|
47
|
-
range: {
|
|
48
|
-
rows: readonly [number, number];
|
|
49
|
-
columns: readonly [number, number];
|
|
50
|
-
} | null;
|
|
51
|
-
copyState: string;
|
|
52
|
-
copyPending: boolean;
|
|
53
|
-
copy: () => Promise<void>;
|
|
54
49
|
keyboard: (event: KeyboardEvent<HTMLDivElement>) => void;
|
|
55
|
-
|
|
56
|
-
|
|
50
|
+
setFocus: (rowIndex: number, valueColumn: number, options?: {
|
|
51
|
+
toggle?: boolean;
|
|
52
|
+
}) => void;
|
|
57
53
|
clear: () => void;
|
|
58
|
-
|
|
54
|
+
isFocused: (rowIndex: number, valueColumn: number) => boolean;
|
|
59
55
|
};
|
|
@@ -25,7 +25,6 @@ export declare function useMatrix(input: MatrixInput): {
|
|
|
25
25
|
}>;
|
|
26
26
|
};
|
|
27
27
|
readCell: (coordinate: import('./matrix-runtime-types.js').MatrixCellAddress) => import('./matrix-runtime-types.js').MatrixCellState;
|
|
28
|
-
acquireCells: (coordinates: readonly import('../../shared/analytics-protocol/index.js').MatrixCoordinate[], signal?: AbortSignal) => Promise<import('./matrix-runtime-types.js').MatrixCellState[]>;
|
|
29
28
|
setViewport: (viewport: import('./matrix-runtime-types.js').MatrixViewport) => void;
|
|
30
29
|
retry: (retryKey: string) => void;
|
|
31
30
|
refresh: () => void;
|
|
@@ -2,16 +2,28 @@ import { TFilter, TFilterValue } from '../../components/surfboard/filter/types.j
|
|
|
2
2
|
import { ControlBinding, ControlDefinition, ResolvedDashboardDateComparisonInput, ResolvedDashboardInputContext, TCard, TDashboard } from '../types/common-types.js';
|
|
3
3
|
import { GlobalDateComparisonSelection } from '../../shared/analytics-protocol/index.js';
|
|
4
4
|
import { CardConfig } from '../types/explorer-types.js';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { resolveRuntimeCardFilters } from './resolve-runtime-card-filters.js';
|
|
6
|
+
import { CardViewState } from '../dashboard-view-state/index.js';
|
|
7
|
+
import { TransientInputContext } from '../dashboard-inputs/transient-input-context.js';
|
|
7
8
|
import { DashboardCardFilterCompilationInput } from './compile-dashboard-card-filters.js';
|
|
8
9
|
import { ResolvedCardDateFields } from './resolve-card-primary-date-field.js';
|
|
9
|
-
export type InteractionStateMap = Record<string, InteractionState | undefined>;
|
|
10
10
|
export type BuildCardQueryContextParams = {
|
|
11
11
|
card: TCard;
|
|
12
12
|
dashboard: Pick<TDashboard, 'sheets'>;
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
/**
|
|
14
|
+
* The carried contexts this card resolves under, the same value its
|
|
15
|
+
* `dashboardInputContext` was resolved with. Their context mode decides
|
|
16
|
+
* whether the dashboard's own toolbar filters apply. Required so that every
|
|
17
|
+
* caller decides; a caller that leaves it out would apply the dashboard's
|
|
18
|
+
* filters where the viewer drilled in without them.
|
|
19
|
+
*/
|
|
20
|
+
transientContexts: readonly TransientInputContext[] | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* This card's view state: its drill path regroups and narrows the card.
|
|
23
|
+
* Required so that every caller decides; a caller that leaves it out would
|
|
24
|
+
* query the card at its top level while the viewer sees it drilled.
|
|
25
|
+
*/
|
|
26
|
+
cardViewState: CardViewState | undefined;
|
|
15
27
|
filters: TFilter[] | undefined;
|
|
16
28
|
filterValues: TFilterValue[] | undefined;
|
|
17
29
|
selectedSheetId: string | null | undefined;
|
|
@@ -30,11 +42,10 @@ export type CardQueryContext = {
|
|
|
30
42
|
controlDefinitions: ControlDefinition[];
|
|
31
43
|
cardControlDefinitions: ControlDefinition[];
|
|
32
44
|
controlBindings: ControlBinding[];
|
|
33
|
-
resolvedFilters: ReturnType<typeof
|
|
45
|
+
resolvedFilters: ReturnType<typeof resolveRuntimeCardFilters>;
|
|
34
46
|
finalConfig: CardConfig;
|
|
35
47
|
queryRelevantConfig: CardConfig;
|
|
36
48
|
finalFiltersKey: string;
|
|
37
|
-
appliedClickFilters: ClickFilterEvent[] | undefined;
|
|
38
49
|
};
|
|
39
50
|
export type CompiledCardQueryContext = Omit<CardQueryContext, 'filterCompilationInput'> & {
|
|
40
51
|
cardFilterValues: TFilterValue[];
|
|
@@ -42,4 +53,4 @@ export type CompiledCardQueryContext = Omit<CardQueryContext, 'filterCompilation
|
|
|
42
53
|
globalDateComparisonSelection?: GlobalDateComparisonSelection;
|
|
43
54
|
dateComparisonInputs?: ResolvedDashboardDateComparisonInput[];
|
|
44
55
|
};
|
|
45
|
-
export declare function buildCardQueryContext({ card, dashboard,
|
|
56
|
+
export declare function buildCardQueryContext({ card, dashboard, transientContexts, cardViewState, filters, filterValues, selectedSheetId, inlineFilterValuesMap, dashboardControls, dashboardControlValues, cardControlValuesMap, dashboardInputContext, includeAuthoredFilters, }: BuildCardQueryContextParams): CardQueryContext;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CardViewStateMap } from '../dashboard-view-state/index.js';
|
|
1
2
|
import { TFilterValue } from '../../components/surfboard/filter/types.js';
|
|
2
3
|
import { DashboardInputValues, TCard, TDashboard } from '../types/common-types.js';
|
|
3
4
|
import { SemanticExecutionPayload } from '../types/semantic-runtime-types.js';
|
|
@@ -21,10 +22,11 @@ type BuildDashboardExecutionSnapshotParams = {
|
|
|
21
22
|
timezone?: string;
|
|
22
23
|
};
|
|
23
24
|
export declare function buildDashboardExecutionSnapshot({ dashboard, filterValues, selectedSheetId, sheetSelection, dashboardControlValues, cardControlValuesMap, semanticExecutionPayload, timezone, }: BuildDashboardExecutionSnapshotParams): DashboardExecutionSnapshot;
|
|
24
|
-
export type BuildDashboardCardExecutionSnapshotParams = Omit<BuildCardQueryContextParams, 'card' | 'dashboard' | 'selectedSheetId' | '
|
|
25
|
+
export type BuildDashboardCardExecutionSnapshotParams = Omit<BuildCardQueryContextParams, 'card' | 'dashboard' | 'selectedSheetId' | 'dashboardInputContext' | 'cardViewState'> & {
|
|
25
26
|
dashboard: TDashboard | undefined;
|
|
26
27
|
cardId: string;
|
|
27
|
-
|
|
28
|
+
/** Drill paths by card. Required so that every caller decides; see `buildCardQueryContext`. */
|
|
29
|
+
cardViewStates: CardViewStateMap | undefined;
|
|
28
30
|
dashboardInputValues?: DashboardInputValues;
|
|
29
31
|
dashboardInputMode?: DashboardInputResolveMode;
|
|
30
32
|
semanticExecutionPayload?: SemanticExecutionPayload;
|
|
@@ -50,5 +52,5 @@ export type DashboardCardExecutionSnapshotResult = DashboardCardExecutionSnapsho
|
|
|
50
52
|
message?: string;
|
|
51
53
|
} | null;
|
|
52
54
|
export declare function requireReadyDashboardCardExecutionSnapshot(result: DashboardCardExecutionSnapshotResult): DashboardCardExecutionSnapshot | null;
|
|
53
|
-
export declare function buildDashboardCardExecutionSnapshot({ dashboard, cardId,
|
|
55
|
+
export declare function buildDashboardCardExecutionSnapshot({ dashboard, cardId, transientContexts, cardViewStates, semanticExecutionPayload, filters, filterValues, inlineFilterValuesMap, dashboardControls, dashboardControlValues, cardControlValuesMap, dashboardInputValues, dashboardInputMode, timezone, matrixCatalog, cardOverride, sheetId, }: BuildDashboardCardExecutionSnapshotParams): DashboardCardExecutionSnapshotResult;
|
|
54
56
|
export {};
|