react-semaphor 0.1.512 → 0.1.514
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/dist/analytics-protocol/index.js +10 -10
- package/dist/brand-studio/index.cjs +1 -1
- package/dist/brand-studio/index.js +4 -4
- package/dist/briefings/index.js +5 -5
- package/dist/chunks/{calculated-field-identity-CJL54uFx.js → calculated-field-identity-DnRd4YIY.js} +4 -4
- package/dist/chunks/{card-config-utils-Bq1enstT.js → card-config-utils-B2cDWQqB.js} +5 -5
- package/dist/chunks/{dashboard-briefing-launcher-Dna1RtyP.cjs → dashboard-briefing-launcher-BzPD50QD.cjs} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-CKOSxJJy.js → dashboard-briefing-launcher-e3s3MuSs.js} +10 -10
- package/dist/chunks/{dashboard-controls-BqePoOt8.js → dashboard-controls-DAOABnks.js} +12 -12
- package/dist/chunks/{dashboard-controls-9H6PxWNh.cjs → dashboard-controls-DQBfOqmC.cjs} +1 -1
- package/dist/chunks/{dashboard-date-comparison-definition-BX0ltXzm.js → dashboard-date-comparison-definition-D7Bl-YAl.js} +1 -1
- package/dist/chunks/{dashboard-json-BwwJoZdd.cjs → dashboard-json-1jZycd5h.cjs} +1 -1
- package/dist/chunks/{dashboard-json-BJJ1cddf.js → dashboard-json-S5Eq2GAg.js} +7 -7
- package/dist/chunks/{edit-dashboard-visual-Db2mRA_9.js → edit-dashboard-visual-Bkm0ciHG.js} +16 -16
- package/dist/chunks/{edit-dashboard-visual-cJdvfkou.cjs → edit-dashboard-visual-BwJ2Eljw.cjs} +1 -1
- package/dist/chunks/{editor-action-buttons-CKS-8x2Y.cjs → editor-action-buttons-B2NCSsDw.cjs} +1 -1
- package/dist/chunks/{editor-action-buttons-ktNQjwNQ.js → editor-action-buttons-Bvv16QA-.js} +7 -7
- package/dist/chunks/{field-aggregations-DUb0NU6c.js → field-aggregations-CzuQKtqx.js} +6 -6
- package/dist/chunks/{field-dependencies-Cl97kkHy.js → field-dependencies-DXW4jtvJ.js} +11 -11
- package/dist/chunks/{index-0pdaQ9e1.js → index-CnGVjyF8.js} +11 -11
- package/dist/chunks/{index-CdlFHeq9.cjs → index-DrOFJOCq.cjs} +247 -242
- package/dist/chunks/{index-SVO291wS.js → index-nhUr9xBz.js} +35417 -34650
- package/dist/chunks/{matrix-analytical-definition-xesmc3Qa.js → matrix-analytical-definition-BDAK2aEi.js} +1 -1
- package/dist/chunks/{matrix-card-CnKQpnsj.js → matrix-card-DOIeTmjh.js} +2 -2
- package/dist/chunks/{matrix-control-sources-CRRdP03Q.js → matrix-control-sources-BxKH2yu2.js} +5 -5
- package/dist/chunks/{matrix-definition-RyU0cpLX.js → matrix-definition-I9rHB9zN.js} +1 -1
- package/dist/chunks/{matrix-formatter-ZVS5QOuq.js → matrix-formatter-BLunke3R.js} +4 -4
- package/dist/chunks/{matrix-member-presentation-CzGZJd3a.js → matrix-member-presentation-DO1VSqfh.js} +1 -1
- package/dist/chunks/{matrix-operation-contract-xL8IhFzp.js → matrix-operation-contract-D0HfzwZg.js} +27 -27
- package/dist/chunks/{metric-comparison-C-sYqv0g.js → metric-comparison-Dqc7_tnW.js} +1 -1
- package/dist/chunks/{pivot-header-presentation-DVylCBHB.js → pivot-header-presentation-Dm9dUQsl.js} +3 -3
- package/dist/chunks/{pivot-result-identity-BSudrDLN.js → pivot-result-identity-8M-bZrw9.js} +1 -1
- package/dist/chunks/{pivot-result-lifecycle-CmjpW7qG.js → pivot-result-lifecycle-BeOpjAhg.js} +7 -7
- package/dist/chunks/{raw-temporal-CUJ86xHI.js → raw-temporal-DrmCX9Wq.js} +2 -2
- package/dist/chunks/{raw-temporal-contract-Eyr5U8DK.js → raw-temporal-contract-CFLGwTiI.js} +1 -1
- package/dist/chunks/{report-preferences-dialog-CBZBmpxZ.js → report-preferences-dialog-B2fzQH1T.js} +6 -6
- package/dist/chunks/{report-preferences-dialog-DserKhuQ.cjs → report-preferences-dialog-DcLkVqni.cjs} +1 -1
- package/dist/chunks/{report-runtime-context-DWvUf1HT.js → report-runtime-context-Cs65Mrxj.js} +5 -5
- package/dist/chunks/{selection-reducer-B94WgZ9V.js → selection-reducer-BIiQXbGM.js} +1 -1
- package/dist/chunks/{semantic-format-CBlRO8Aw.js → semantic-format-BZxJLKvw.js} +2 -2
- package/dist/chunks/{source-entity-resolution-DZhUckix.js → source-entity-resolution-D7vnmDwm.js} +1 -1
- package/dist/chunks/switch--Re1K566.cjs +134 -0
- package/dist/chunks/{switch-CrstROAR.js → switch-QfKb0Iwe.js} +2373 -2294
- package/dist/chunks/{temporal-bucket-contract-D5QlJbmm.js → temporal-bucket-contract-IWDgyTMw.js} +1 -1
- package/dist/chunks/{token-types-CPde8_LG.js → token-types-Dl0hcKBX.js} +1 -1
- package/dist/chunks/{update-policy-D9q1Tz8k.js → update-policy-BeQqjupC.js} +2 -2
- package/dist/chunks/{validators-BDYzZFgs.js → validators-CkHsAvwB.js} +12 -12
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.js +10 -10
- package/dist/data-app-builder/index.cjs +1 -1
- package/dist/data-app-builder/index.js +3 -3
- package/dist/data-app-codegen/index.js +2 -2
- package/dist/data-app-codegen-node/index.js +3 -3
- package/dist/data-app-sdk/index.js +5 -5
- package/dist/data-app-sdk-adapters/index.js +2 -2
- package/dist/data-app-sdk-validation/index.js +5 -5
- package/dist/format-utils/index.js +16 -16
- package/dist/index.cjs +1 -1
- package/dist/index.js +32 -32
- package/dist/report-runtime-context/index.js +2 -2
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/components/calculated-fields/field-picker-panel.d.ts +5 -1
- package/dist/types/components/calculated-fields/placeholder-field-picker.d.ts +30 -0
- package/dist/types/components/calculated-fields/templates-menu.d.ts +7 -10
- package/dist/types/components/explorer/fields/field-option-list.d.ts +3 -1
- package/dist/types/components/semaphor/code-editor.d.ts +28 -0
- package/dist/types/components/surfboard/filter/use-dashboard-filter-mapping-popover.d.ts +0 -1
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.js +62 -29
- package/dist/types/lib/hooks/calculated-fields/use-calculated-field-templates.d.ts +9 -0
- package/dist/types/lib/hooks/calculated-fields/use-formula-placeholders.d.ts +54 -0
- package/dist/types/lib/stores/dashboard-store.d.ts +1 -2
- package/dist/types/lib/types/calculated-field-template-types.d.ts +14 -0
- package/dist/types/lib/types/common-types.d.ts +0 -7
- package/dist/types/lib/types/index.d.ts +1 -0
- package/dist/types/lib/utils/calculated-field-row-templates.d.ts +15 -0
- package/dist/types/lib/utils/calculated-field-token-utils.d.ts +23 -0
- package/package.json +1 -1
- package/dist/chunks/switch-BkcJCTS7.cjs +0 -134
package/dist/surfboard/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/index-DrOFJOCq.cjs"),r=require("../chunks/common-types-nBuCd3u2.cjs"),o=require("../chunks/report-preferences-dialog-DcLkVqni.cjs");exports.DisplayFormatPreferencesFields=e.DisplayFormatPreferencesFields;exports.Surfboard=e.DashboardPlus;exports.CONTROL_CARD_DEFAULT_VALUE=r.CONTROL_CARD_DEFAULT_VALUE;exports.EMPTY_SELECTION=r.EMPTY_SELECTION;exports.ReportPreferencesDialog=o.ReportPreferencesDialog;
|
package/dist/surfboard/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { b as a, a as o } from "../chunks/index-
|
|
1
|
+
import { b as a, a as o } from "../chunks/index-nhUr9xBz.js";
|
|
2
2
|
import { C as f, E } from "../chunks/common-types-C6cAQgyh.js";
|
|
3
|
-
import { R as t } from "../chunks/report-preferences-dialog-
|
|
3
|
+
import { R as t } from "../chunks/report-preferences-dialog-B2fzQH1T.js";
|
|
4
4
|
export {
|
|
5
5
|
f as CONTROL_CARD_DEFAULT_VALUE,
|
|
6
6
|
a as DisplayFormatPreferencesFields,
|
|
@@ -4,7 +4,7 @@ import { AvailableFieldGroup, AvailableField } from '../../lib/hooks/calculated-
|
|
|
4
4
|
* `useAvailableFields` decides compatibility and grouping (it knows about
|
|
5
5
|
* the calculated-fields group and aggregate rules); this panel only renders.
|
|
6
6
|
*/
|
|
7
|
-
export declare function FieldPickerPanel({ groups, searchTerm, onSearchTermChange, onFieldClick, selectedFieldIds, unavailableFieldReasons, disabled, }: {
|
|
7
|
+
export declare function FieldPickerPanel({ groups, searchTerm, onSearchTermChange, onFieldClick, selectedFieldIds, unavailableFieldReasons, disabled, listLabel, autoFocusSearch, selectFirstOnEnter, }: {
|
|
8
8
|
groups: AvailableFieldGroup[];
|
|
9
9
|
searchTerm: string;
|
|
10
10
|
onSearchTermChange: (value: string) => void;
|
|
@@ -13,4 +13,8 @@ export declare function FieldPickerPanel({ groups, searchTerm, onSearchTermChang
|
|
|
13
13
|
/** Fields blocked for the current chart, by id, with the reason. */
|
|
14
14
|
unavailableFieldReasons?: Record<string, string>;
|
|
15
15
|
disabled?: boolean;
|
|
16
|
+
listLabel?: string;
|
|
17
|
+
autoFocusSearch?: boolean;
|
|
18
|
+
/** Enter in the search box picks the first enabled match. */
|
|
19
|
+
selectFirstOnEnter?: boolean;
|
|
16
20
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import { AvailableField, AvailableFieldGroup } from '../../lib/hooks/calculated-fields/use-available-fields.js';
|
|
3
|
+
type Measurable = {
|
|
4
|
+
getBoundingClientRect: () => DOMRect;
|
|
5
|
+
};
|
|
6
|
+
export type PlaceholderFieldPickerProps = {
|
|
7
|
+
/** Token being replaced (text between the braces); null when closed. */
|
|
8
|
+
token: string | null;
|
|
9
|
+
/** Unbound tokens left in the formula, including this one. */
|
|
10
|
+
remaining: number;
|
|
11
|
+
/** Measures the chip the picker hangs from. */
|
|
12
|
+
anchorRef: RefObject<Measurable>;
|
|
13
|
+
groups: AvailableFieldGroup[];
|
|
14
|
+
unavailableFieldReasons?: Record<string, string>;
|
|
15
|
+
onPick: (field: AvailableField) => void;
|
|
16
|
+
/** Esc: close and keep the token selected so typing replaces it. */
|
|
17
|
+
onEscape: () => void;
|
|
18
|
+
/** Click outside: close and leave focus where the click put it. */
|
|
19
|
+
onDismiss: () => void;
|
|
20
|
+
onCloseAutoFocus: (event: Event) => void;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Field picker anchored under a dashed chip in the formula box. Opens
|
|
24
|
+
* when the author clicks a chip, presses Tab in the formula, or inserts
|
|
25
|
+
* a template. Picking replaces the whole token; the editor then moves to
|
|
26
|
+
* the next chip. Reuses `FieldPickerPanel`, so compatibility and the
|
|
27
|
+
* "Not in this visual" hints match Insert field.
|
|
28
|
+
*/
|
|
29
|
+
export declare function PlaceholderFieldPicker({ token, remaining, anchorRef, groups, unavailableFieldReasons, onPick, onEscape, onDismiss, onCloseAutoFocus, }: PlaceholderFieldPickerProps): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
export {};
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
+
import { CalculatedFieldType } from '../../lib/types/calculated-field-editor-types.js';
|
|
2
|
+
import { CalculatedFieldTemplateDefaults, ResolvedCalculatedFieldTemplate } from '../../lib/types/calculated-field-template-types.js';
|
|
1
3
|
export type TemplatesMenuProps = {
|
|
4
|
+
fieldType: CalculatedFieldType;
|
|
2
5
|
onInsert: (snippet: string) => void;
|
|
6
|
+
onInsertRowTemplate: (template: ResolvedCalculatedFieldTemplate) => void;
|
|
7
|
+
rowTemplates?: CalculatedFieldTemplateDefaults;
|
|
8
|
+
rowTemplatesLoading?: boolean;
|
|
3
9
|
disabled?: boolean;
|
|
4
10
|
};
|
|
5
|
-
|
|
6
|
-
* Variant B "Templates" menu — replaces the legacy OperationSelector +
|
|
7
|
-
* A/B input shelf. Selecting a template inserts the formula text into
|
|
8
|
-
* the formula editor at the cursor; the user replaces `{a}` / `{b}`
|
|
9
|
-
* placeholders with real fields after.
|
|
10
|
-
*
|
|
11
|
-
* Metric-only — caller decides whether to render this. Calculated
|
|
12
|
-
* Columns are row-level and do not have aggregate templates.
|
|
13
|
-
*/
|
|
14
|
-
export declare function TemplatesMenu({ onInsert, disabled }: TemplatesMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function TemplatesMenu({ fieldType, onInsert, onInsertRowTemplate, rowTemplates, rowTemplatesLoading, disabled, }: TemplatesMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -35,6 +35,8 @@ export type FieldOptionListProps<TField extends Field = Field> = {
|
|
|
35
35
|
/** Classes for the scrolling list container (height belongs here). */
|
|
36
36
|
listClassName?: string;
|
|
37
37
|
autoFocusSearch?: boolean;
|
|
38
|
+
/** Enter in the search box picks the first enabled match. */
|
|
39
|
+
selectFirstOnEnter?: boolean;
|
|
38
40
|
emptyMessage?: string;
|
|
39
41
|
};
|
|
40
42
|
/**
|
|
@@ -49,4 +51,4 @@ export type FieldOptionListProps<TField extends Field = Field> = {
|
|
|
49
51
|
*
|
|
50
52
|
* Hosts own the trigger, what a selection means, and where it lives.
|
|
51
53
|
*/
|
|
52
|
-
export declare function FieldOptionList<TField extends Field = Field>({ fields, selectedIds, onSelect, selectionMode, query: controlledQuery, onQueryChange, searchPlaceholder, listLabel, getGroup, sorted, isDisabled, isCalculated, renderTrailing, toolbar, density, listClassName, autoFocusSearch, emptyMessage, }: FieldOptionListProps<TField>): import("react/jsx-runtime").JSX.Element;
|
|
54
|
+
export declare function FieldOptionList<TField extends Field = Field>({ fields, selectedIds, onSelect, selectionMode, query: controlledQuery, onQueryChange, searchPlaceholder, listLabel, getGroup, sorted, isDisabled, isCalculated, renderTrailing, toolbar, density, listClassName, autoFocusSearch, selectFirstOnEnter, emptyMessage, }: FieldOptionListProps<TField>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import { ElementRef, KeyboardEventHandler } from 'react';
|
|
2
2
|
import { default as Editor } from 'react-simple-code-editor';
|
|
3
3
|
export type CodeEditorLanguage = 'yaml' | 'json' | 'sql' | 'sql-jinja' | 'python' | 'javascript';
|
|
4
|
+
/**
|
|
5
|
+
* A character range drawn as a chip behind the text. `field` is a quiet
|
|
6
|
+
* solid tint; `pending` is a dashed outline that can be hovered and
|
|
7
|
+
* clicked (see `onChipClick`).
|
|
8
|
+
*/
|
|
9
|
+
export type CodeEditorChip = {
|
|
10
|
+
start: number;
|
|
11
|
+
end: number;
|
|
12
|
+
tone: 'field' | 'pending';
|
|
13
|
+
};
|
|
4
14
|
export type CodeEditorProps = {
|
|
5
15
|
value: string;
|
|
6
16
|
onValueChange?: (value: string) => void;
|
|
@@ -66,6 +76,21 @@ export type CodeEditorProps = {
|
|
|
66
76
|
* global shortcuts on its own.
|
|
67
77
|
*/
|
|
68
78
|
onKeyDown?: KeyboardEventHandler<HTMLTextAreaElement & HTMLDivElement>;
|
|
79
|
+
/**
|
|
80
|
+
* Opt-in chips drawn behind the text (non-overlapping ranges into
|
|
81
|
+
* `value`). Chips use background and outline only, so they never
|
|
82
|
+
* change character metrics and the caret stays on the text.
|
|
83
|
+
*/
|
|
84
|
+
chips?: ReadonlyArray<CodeEditorChip>;
|
|
85
|
+
/** Index into `chips` rendered in the active state. */
|
|
86
|
+
activeChipIndex?: number | null;
|
|
87
|
+
/**
|
|
88
|
+
* Called with the index into `chips` when a `pending` chip is clicked.
|
|
89
|
+
* Clicks land on the textarea, so hits are resolved by measuring the
|
|
90
|
+
* chip layer. Not called when `readOnly`, or for drag selections that
|
|
91
|
+
* reach outside the chip.
|
|
92
|
+
*/
|
|
93
|
+
onChipClick?: (index: number) => void;
|
|
69
94
|
className?: string;
|
|
70
95
|
};
|
|
71
96
|
type SimpleCodeEditorHandle = ElementRef<typeof Editor>;
|
|
@@ -81,6 +106,9 @@ export type CodeEditorHandle = {
|
|
|
81
106
|
captureSession: () => CodeEditorSessionSnapshot | null;
|
|
82
107
|
restoreSession: (snapshot: CodeEditorSessionSnapshot) => void;
|
|
83
108
|
focus: () => void;
|
|
109
|
+
/** Viewport rect of chip `index` (its last line when it wraps), for
|
|
110
|
+
* anchoring a popover to it. */
|
|
111
|
+
getChipRect: (index: number) => DOMRect | null;
|
|
84
112
|
};
|
|
85
113
|
export declare const CodeEditor: import('react').ForwardRefExoticComponent<CodeEditorProps & import('react').RefAttributes<CodeEditorHandle>>;
|
|
86
114
|
export {};
|
|
@@ -54,7 +54,6 @@ export declare function useDashboardFilterMappingPopover(params: {
|
|
|
54
54
|
aiScopeTables?: import('../index.js').AIScopeTable[];
|
|
55
55
|
globalStyle?: import('../index.js').TStyle;
|
|
56
56
|
globalCacheConfig?: import('../index.js').CacheConfig;
|
|
57
|
-
emailSettings?: import('../index.js').EmailSettings;
|
|
58
57
|
defaultFilterValues?: import('./types.js').TFilterValue[];
|
|
59
58
|
controls?: import('../index.js').ControlDefinition[];
|
|
60
59
|
defaultControlValues?: Record<string, unknown>;
|
package/dist/types/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../chunks/common-types-nBuCd3u2.cjs"),e=require("../chunks/validators-DVYAnnX0.cjs"),t=require("../chunks/field-dependencies-DIab72rQ.cjs"),r=require("../chunks/token-types-Ahh5u4iT.cjs"),l=require("../chunks/pivot-result-identity-uTiylUNr.cjs"),o=require("../chunks/report-runtime-context-DzvHBPxl.cjs"),i=["concatenate","conditional-category","date-part","date-difference","null-to-zero","safe-ratio","nested-conditional","membership-test","uppercase","lowercase","trim-whitespace","replace-text","first-characters","character-count","starts-with","number-to-text","start-of-month","start-of-quarter","start-of-year","year-number","add-days","round-number","round-down","round-up","absolute-value","cap-maximum","floor-minimum","fill-blanks","null-if-zero","is-blank"];exports.CONTROL_CARD_DEFAULT_VALUE=a.CONTROL_CARD_DEFAULT_VALUE;exports.EMPTY_SELECTION=a.EMPTY_SELECTION;exports.CALCULATED_FIELD_ENTITY_MARKER=e.CALCULATED_FIELD_ENTITY_MARKER;exports.DATE_FORMAT_VALUES=e.DATE_FORMAT_VALUES;exports.LEGACY_CALCULATED_FIELD_ENTITY_MARKER=e.LEGACY_CALCULATED_FIELD_ENTITY_MARKER;exports.PivotMarkerEnum=e.PivotMarkerEnum;exports.getCalculatedFieldComputeStage=e.getCalculatedFieldComputeStage;exports.getFieldRuntimeColumnName=e.getFieldRuntimeColumnName;exports.hasCalculatedFieldMarker=e.hasCalculatedFieldMarker;exports.hasCalculatedFormulaInputs=e.hasCalculatedFormulaInputs;exports.hasSyntheticCalculatedFieldOwner=e.hasSyntheticCalculatedFieldOwner;exports.inspectCalculatedField=e.inspectCalculatedField;exports.isCalculatedDimension=e.isCalculatedDimension;exports.isCalculatedMetric=e.isCalculatedMetric;exports.isDerivedField=e.isDerivedField;exports.normalizeCalculatedFieldRepresentation=e.normalizeCalculatedFieldRepresentation;exports.shouldDropInheritedCalculationAggregate=e.shouldDropInheritedCalculationAggregate;exports.collectDatasetNamesFromExplorerField=t.collectDatasetNamesFromExplorerField;exports.collectDatasetNamesFromFilterGroup=t.collectDatasetNamesFromFilterGroup;exports.collectExecutionDatasetNamesFromExplorerField=t.collectExecutionDatasetNamesFromExplorerField;exports.collectPreferredDatasetNamesFromExplorerField=t.collectPreferredDatasetNamesFromExplorerField;exports.collectQualifiedDatasetNamesFromExplorerField=t.collectQualifiedDatasetNamesFromExplorerField;exports.datasetRefFromSource=t.datasetRefFromSource;exports.dependencyDisplayIdentity=t.dependencyDisplayIdentity;exports.humanizeDatasetName=t.humanizeDatasetName;exports.resolveFieldDatasetDependencies=t.resolveFieldDatasetDependencies;exports.DEFAULT_SEMANTIC_DOMAIN_ACCESS=r.DEFAULT_SEMANTIC_DOMAIN_ACCESS;exports.resolveQueryColumnKeyMapEntry=l.resolveQueryColumnKeyMapEntry;exports.resolveUniqueQueryColumnKeyMapEntry=l.resolveUniqueQueryColumnKeyMapEntry;exports.DEFAULT_CALENDAR_CONTEXT=o.DEFAULT_CALENDAR_CONTEXT;exports.CALCULATED_FIELD_TEMPLATE_IDS=i;
|
package/dist/types/index.js
CHANGED
|
@@ -1,37 +1,70 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
import { C as
|
|
3
|
-
import { c as
|
|
4
|
-
import { D as S } from "../chunks/token-types-
|
|
5
|
-
import { r as O, a as v } from "../chunks/pivot-result-identity-
|
|
6
|
-
import { D as
|
|
1
|
+
import { C as r, E as s } from "../chunks/common-types-C6cAQgyh.js";
|
|
2
|
+
import { C as o, D as i, L as n, P as c, f as d, g as m, k as u, j as E, l as p, e as C, c as D, b as F, d as A, n as f, h as _ } from "../chunks/validators-CkHsAvwB.js";
|
|
3
|
+
import { c as T, g as h, f as x, b as N, e as y, d as I, a as M, h as R, r as b } from "../chunks/field-dependencies-DXW4jtvJ.js";
|
|
4
|
+
import { D as S } from "../chunks/token-types-Dl0hcKBX.js";
|
|
5
|
+
import { r as O, a as v } from "../chunks/pivot-result-identity-8M-bZrw9.js";
|
|
6
|
+
import { D as w } from "../chunks/report-runtime-context-Cs65Mrxj.js";
|
|
7
|
+
const e = [
|
|
8
|
+
"concatenate",
|
|
9
|
+
"conditional-category",
|
|
10
|
+
"date-part",
|
|
11
|
+
"date-difference",
|
|
12
|
+
"null-to-zero",
|
|
13
|
+
"safe-ratio",
|
|
14
|
+
"nested-conditional",
|
|
15
|
+
"membership-test",
|
|
16
|
+
"uppercase",
|
|
17
|
+
"lowercase",
|
|
18
|
+
"trim-whitespace",
|
|
19
|
+
"replace-text",
|
|
20
|
+
"first-characters",
|
|
21
|
+
"character-count",
|
|
22
|
+
"starts-with",
|
|
23
|
+
"number-to-text",
|
|
24
|
+
"start-of-month",
|
|
25
|
+
"start-of-quarter",
|
|
26
|
+
"start-of-year",
|
|
27
|
+
"year-number",
|
|
28
|
+
"add-days",
|
|
29
|
+
"round-number",
|
|
30
|
+
"round-down",
|
|
31
|
+
"round-up",
|
|
32
|
+
"absolute-value",
|
|
33
|
+
"cap-maximum",
|
|
34
|
+
"floor-minimum",
|
|
35
|
+
"fill-blanks",
|
|
36
|
+
"null-if-zero",
|
|
37
|
+
"is-blank"
|
|
38
|
+
];
|
|
7
39
|
export {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
40
|
+
o as CALCULATED_FIELD_ENTITY_MARKER,
|
|
41
|
+
e as CALCULATED_FIELD_TEMPLATE_IDS,
|
|
42
|
+
r as CONTROL_CARD_DEFAULT_VALUE,
|
|
43
|
+
i as DATE_FORMAT_VALUES,
|
|
44
|
+
w as DEFAULT_CALENDAR_CONTEXT,
|
|
12
45
|
S as DEFAULT_SEMANTIC_DOMAIN_ACCESS,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
46
|
+
s as EMPTY_SELECTION,
|
|
47
|
+
n as LEGACY_CALCULATED_FIELD_ENTITY_MARKER,
|
|
48
|
+
c as PivotMarkerEnum,
|
|
49
|
+
T as collectDatasetNamesFromExplorerField,
|
|
50
|
+
h as collectDatasetNamesFromFilterGroup,
|
|
51
|
+
x as collectExecutionDatasetNamesFromExplorerField,
|
|
52
|
+
N as collectPreferredDatasetNamesFromExplorerField,
|
|
53
|
+
y as collectQualifiedDatasetNamesFromExplorerField,
|
|
54
|
+
I as datasetRefFromSource,
|
|
55
|
+
M as dependencyDisplayIdentity,
|
|
56
|
+
d as getCalculatedFieldComputeStage,
|
|
24
57
|
m as getFieldRuntimeColumnName,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
58
|
+
u as hasCalculatedFieldMarker,
|
|
59
|
+
E as hasCalculatedFormulaInputs,
|
|
60
|
+
p as hasSyntheticCalculatedFieldOwner,
|
|
61
|
+
R as humanizeDatasetName,
|
|
62
|
+
C as inspectCalculatedField,
|
|
30
63
|
D as isCalculatedDimension,
|
|
31
64
|
F as isCalculatedMetric,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
65
|
+
A as isDerivedField,
|
|
66
|
+
f as normalizeCalculatedFieldRepresentation,
|
|
67
|
+
b as resolveFieldDatasetDependencies,
|
|
35
68
|
O as resolveQueryColumnKeyMapEntry,
|
|
36
69
|
v as resolveUniqueQueryColumnKeyMapEntry,
|
|
37
70
|
_ as shouldDropInheritedCalculationAggregate
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare function useCalculatedFieldTemplates({ endpoint, connectionId, enabled, }: {
|
|
2
|
+
endpoint: string | null;
|
|
3
|
+
connectionId?: string;
|
|
4
|
+
enabled?: boolean;
|
|
5
|
+
}): {
|
|
6
|
+
templates: import('../../types/calculated-field-template-types.js').CalculatedFieldTemplateDefaults | undefined;
|
|
7
|
+
isLoading: boolean;
|
|
8
|
+
error: string | null;
|
|
9
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { KeyboardEvent, RefObject } from 'react';
|
|
2
|
+
import { CodeEditorChip, CodeEditorHandle } from '../../../components/semaphor/code-editor.js';
|
|
3
|
+
import { AvailableField } from './use-available-fields.js';
|
|
4
|
+
type Range = {
|
|
5
|
+
start: number;
|
|
6
|
+
end: number;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Clickable placeholders in the calculated-field formula box.
|
|
10
|
+
*
|
|
11
|
+
* Every `{token}` renders as a chip. Tokens that bind to exactly one field
|
|
12
|
+
* (the rule validation uses) are quiet `field` chips; the rest are dashed
|
|
13
|
+
* `pending` chips: template slots like `{a}`, typos, stale or ambiguous
|
|
14
|
+
* references. A pending chip opens a field picker when it is clicked, when
|
|
15
|
+
* the author presses Tab in the formula, or right after a template is
|
|
16
|
+
* inserted. Picking replaces the whole token and moves to the next pending
|
|
17
|
+
* chip.
|
|
18
|
+
*
|
|
19
|
+
* Reference: semaphor-app/src/app/design/calculated-field-placeholders/page.tsx
|
|
20
|
+
*/
|
|
21
|
+
export declare function useFormulaPlaceholders({ expression, onExpressionChange, tokenCandidates, textareaId, editorRef, interactive, }: {
|
|
22
|
+
expression: string;
|
|
23
|
+
onExpressionChange: (next: string) => void;
|
|
24
|
+
/** Same candidates validation resolves against. */
|
|
25
|
+
tokenCandidates: Map<string, AvailableField[]>;
|
|
26
|
+
textareaId: string;
|
|
27
|
+
editorRef: RefObject<CodeEditorHandle | null>;
|
|
28
|
+
/** False when read-only or while the formula box is hidden. */
|
|
29
|
+
interactive: boolean;
|
|
30
|
+
}): {
|
|
31
|
+
chips: CodeEditorChip[];
|
|
32
|
+
activeChipIndex: number | null;
|
|
33
|
+
onChipClick: (chipIndex: number) => void;
|
|
34
|
+
onEditorKeyDown: (event: KeyboardEvent<HTMLTextAreaElement & HTMLDivElement>) => void;
|
|
35
|
+
/** Call after inserting text at `range` (offsets in the new value). */
|
|
36
|
+
openFirstIn: import('react').Dispatch<import('react').SetStateAction<Range | null>>;
|
|
37
|
+
reset: () => void;
|
|
38
|
+
summary: {
|
|
39
|
+
placeholders: number;
|
|
40
|
+
unresolved: number;
|
|
41
|
+
};
|
|
42
|
+
picker: {
|
|
43
|
+
token: string | null;
|
|
44
|
+
remaining: number;
|
|
45
|
+
anchorRef: RefObject<{
|
|
46
|
+
getBoundingClientRect: () => DOMRect;
|
|
47
|
+
}>;
|
|
48
|
+
onPick: (field: AvailableField) => void;
|
|
49
|
+
onEscape: () => void;
|
|
50
|
+
onDismiss: () => void;
|
|
51
|
+
onCloseAutoFocus: (event: Event) => void;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AuthToken, TBaseQuery, Breakpoint, ControlDefinition, CustomCard, StyleProps, TCard, TDashboard, TEvent, TFrame, TSheet, TStyle, AIScopeTable, TLens, CacheConfig,
|
|
1
|
+
import { AuthToken, TBaseQuery, Breakpoint, ControlDefinition, CustomCard, StyleProps, TCard, TDashboard, TEvent, TFrame, TSheet, TStyle, AIScopeTable, TLens, CacheConfig, FilterLayoutSettings, DocumentDefinition, DashboardInput, DashboardInputSlot, DashboardInputValues, DashboardLifecycleEvent } from '../types/common-types.js';
|
|
2
2
|
import { TFilter, TFilterValue } from '../../components/surfboard/filter/types.js';
|
|
3
3
|
import { TransientInputContext } from '../dashboard-inputs/transient-input-context.js';
|
|
4
4
|
import { default as ReactGridLayout } from 'react-grid-layout';
|
|
@@ -184,7 +184,6 @@ type Actions = {
|
|
|
184
184
|
setDashboardControlsModel: (controls: ControlDefinition[], defaultValues?: Record<string, unknown>, options?: DashboardControlsModelOptions) => void;
|
|
185
185
|
updateDashboardControl: (controlId: string, updates: Partial<ControlDefinition>) => void;
|
|
186
186
|
reorderDashboardControls: (orderedControlIds: string[]) => void;
|
|
187
|
-
updateEmailSettings: (emailSettings: EmailSettings) => void;
|
|
188
187
|
setIsDownloadingPdf: (isDownloadingPdf: boolean) => void;
|
|
189
188
|
setLenses: (lenses: TLens[]) => void;
|
|
190
189
|
setSelectedLensId: (lensId: string) => void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DataType } from './explorer-types.js';
|
|
2
|
+
export declare const CALCULATED_FIELD_TEMPLATE_IDS: readonly ["concatenate", "conditional-category", "date-part", "date-difference", "null-to-zero", "safe-ratio", "nested-conditional", "membership-test", "uppercase", "lowercase", "trim-whitespace", "replace-text", "first-characters", "character-count", "starts-with", "number-to-text", "start-of-month", "start-of-quarter", "start-of-year", "year-number", "add-days", "round-number", "round-down", "round-up", "absolute-value", "cap-maximum", "floor-minimum", "fill-blanks", "null-if-zero", "is-blank"];
|
|
3
|
+
export type CalculatedFieldTemplateId = (typeof CALCULATED_FIELD_TEMPLATE_IDS)[number];
|
|
4
|
+
export type ResolvedCalculatedFieldTemplate = {
|
|
5
|
+
expression: string;
|
|
6
|
+
outputType: Extract<DataType, 'string' | 'number' | 'date' | 'boolean'>;
|
|
7
|
+
};
|
|
8
|
+
export type CalculatedFieldTemplateDefaults = Record<CalculatedFieldTemplateId, ResolvedCalculatedFieldTemplate>;
|
|
9
|
+
export type CalculatedFieldTemplateDefaultsRequest = {
|
|
10
|
+
connectionId: string;
|
|
11
|
+
};
|
|
12
|
+
export type CalculatedFieldTemplateDefaultsResponse = {
|
|
13
|
+
templates: CalculatedFieldTemplateDefaults;
|
|
14
|
+
};
|
|
@@ -1568,12 +1568,6 @@ export type CacheConfig = {
|
|
|
1568
1568
|
ttl: string;
|
|
1569
1569
|
status: 'on' | 'on-refresh' | 'off';
|
|
1570
1570
|
};
|
|
1571
|
-
export type EmailSettings = {
|
|
1572
|
-
companyName: string;
|
|
1573
|
-
dashboardUrl: string;
|
|
1574
|
-
supportEmail: string;
|
|
1575
|
-
senderTitle: string;
|
|
1576
|
-
};
|
|
1577
1571
|
export type TDashboard = {
|
|
1578
1572
|
id: string;
|
|
1579
1573
|
title?: string;
|
|
@@ -1597,7 +1591,6 @@ export type TDashboard = {
|
|
|
1597
1591
|
aiScopeTables?: AIScopeTable[];
|
|
1598
1592
|
globalStyle?: TStyle;
|
|
1599
1593
|
globalCacheConfig?: CacheConfig;
|
|
1600
|
-
emailSettings?: EmailSettings;
|
|
1601
1594
|
defaultFilterValues?: TFilterValue[];
|
|
1602
1595
|
controls?: ControlDefinition[];
|
|
1603
1596
|
defaultControlValues?: Record<string, unknown>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CalculatedFieldTemplateId } from '../types/calculated-field-template-types.js';
|
|
2
|
+
export declare const ROW_TEMPLATE_CATEGORIES: readonly ["Logic", "Text", "Dates", "Numbers", "Empty values"];
|
|
3
|
+
export type RowTemplateCategory = (typeof ROW_TEMPLATE_CATEGORIES)[number];
|
|
4
|
+
export type RowFormulaTemplateDefinition = {
|
|
5
|
+
id: CalculatedFieldTemplateId;
|
|
6
|
+
label: string;
|
|
7
|
+
symbol: string;
|
|
8
|
+
preview: string;
|
|
9
|
+
hint: string;
|
|
10
|
+
category: RowTemplateCategory;
|
|
11
|
+
keywords: string[];
|
|
12
|
+
common?: boolean;
|
|
13
|
+
};
|
|
14
|
+
/** Dialect-neutral searchable metadata. Executable SQL remains app-owned. */
|
|
15
|
+
export declare const ROW_FORMULA_TEMPLATES: RowFormulaTemplateDefinition[];
|
|
@@ -3,6 +3,29 @@ export declare function normalizeToken(token: string): string;
|
|
|
3
3
|
export declare function extractExpressionTokens(expression: string): string[];
|
|
4
4
|
export declare function getUniqueTokens(tokens: string[]): string[];
|
|
5
5
|
export declare function buildTokenCandidates(fields: AvailableField[]): Map<string, AvailableField[]>;
|
|
6
|
+
export type ExpressionTokenRange = {
|
|
7
|
+
/** Text between the braces, as typed. */
|
|
8
|
+
token: string;
|
|
9
|
+
/** Offset of `{`. */
|
|
10
|
+
start: number;
|
|
11
|
+
/** Offset just past `}`. */
|
|
12
|
+
end: number;
|
|
13
|
+
};
|
|
14
|
+
/** Every `{token}` in the expression with its offsets. Same grammar as
|
|
15
|
+
* `extractExpressionTokens`, so it agrees with validation. */
|
|
16
|
+
export declare function findExpressionTokenRanges(expression: string): ExpressionTokenRange[];
|
|
17
|
+
/** Template slots are single lowercase letters: `{a}`, `{b}`. */
|
|
18
|
+
export declare function isTemplatePlaceholderToken(token: string): boolean;
|
|
19
|
+
/** A token binds only when exactly one field claims it, the same rule
|
|
20
|
+
* `resolveExpressionTokens` uses before validation. */
|
|
21
|
+
export declare function isResolvedToken(token: string, candidates: Map<string, AvailableField[]>): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Tokens that do not bind to a field, in the order the author should fill
|
|
24
|
+
* them: template placeholders by letter (`{a}` before `{b}`, even when the
|
|
25
|
+
* dialect SQL mentions `{b}` first), then any other unbound token (typo,
|
|
26
|
+
* stale or ambiguous reference) by position.
|
|
27
|
+
*/
|
|
28
|
+
export declare function findPendingTokenRanges(ranges: ExpressionTokenRange[], candidates: Map<string, AvailableField[]>): ExpressionTokenRange[];
|
|
6
29
|
export declare function resolveExpressionTokens(expression: string, fields: AvailableField[]): {
|
|
7
30
|
orderedTokens: string[];
|
|
8
31
|
orderedFields: (AvailableField | null)[];
|