react-semaphor 0.1.589 → 0.1.591
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 +254 -236
- package/dist/assistant-context/index.js +1 -1
- package/dist/brand-studio/index.js +7 -7
- package/dist/briefings/index.js +4 -4
- package/dist/chunks/{aggregate-measure-field-BrkXsSJp.js → aggregate-measure-field-DHlDj0Pc.js} +2 -2
- package/dist/chunks/{assistant-chat-DBPa6sJU.js → assistant-chat-Cazikwyh.js} +13 -13
- package/dist/chunks/{bookmark-impact-B7pbMx2e.js → bookmark-impact-rWjQgk8h.js} +2 -2
- package/dist/chunks/{bookmark-state-Bn7k3ttp.js → bookmark-state-Bt_eQEqt.js} +569 -537
- package/dist/chunks/{card-filter-builder-CGM7ROM0.js → card-filter-builder-DFR-6Jpm.js} +929 -910
- package/dist/chunks/{comparison-window-caption-fqijZdVd.js → comparison-window-caption-CFaw-kIV.js} +6 -6
- package/dist/chunks/{dashboard-UXH3E31V.js → dashboard-DCh9hKnJ.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-CTFuSWH_.js → dashboard-briefing-launcher-ob8G1b58.js} +91 -91
- package/dist/chunks/{dashboard-controls-BcxWhOKw.js → dashboard-controls-Nszg0k1A.js} +64 -64
- package/dist/chunks/{dashboard-json-C-oBcKKC.js → dashboard-json-BpwnG23b.js} +4 -4
- package/dist/chunks/{dates-BunbHJH0.js → dates-BOLBSBpn.js} +8 -8
- package/dist/chunks/{edit-dashboard-visual-COjKc_Du.js → edit-dashboard-visual-BvM7br5P.js} +5501 -5475
- package/dist/chunks/filter-line-CYT7KIXb.js +133 -0
- package/dist/chunks/{filter-reach-copy-D5AmDHda.js → filter-reach-copy-By3r7O3G.js} +11 -11
- package/dist/chunks/filter-value-text-CFiIZWJP.js +153 -0
- package/dist/chunks/{index-dGxJTaP1.js → index-CsQYlwhU.js} +5 -5
- package/dist/chunks/{layout-grid-BG__sPkb.js → layout-grid-DoFIfQGd.js} +1 -1
- package/dist/chunks/{list-filter-Cb8i7N8f.js → list-filter-BeTQxjNy.js} +1 -1
- package/dist/chunks/{matrix-analytical-definition-SN0JUJVk.js → matrix-analytical-definition-CyWOwLmE.js} +202 -190
- package/dist/chunks/{matrix-member-presentation-DVBJR0MA.js → matrix-member-presentation-Bj2YcHAP.js} +1 -1
- package/dist/chunks/{matrix-operation-contract-JSmproo9.js → matrix-operation-contract-CAanJeCj.js} +60 -60
- package/dist/chunks/{metric-comparison-xE_J6hkg.js → metric-comparison-BeKnUD08.js} +27 -31
- package/dist/chunks/{paintbrush-C310xSuR.js → paintbrush-KeaU1L1a.js} +1 -1
- package/dist/chunks/{palette-Ci5P91Zb.js → palette-BcFJLeXB.js} +1 -1
- package/dist/chunks/{pivot-header-presentation-D-DfPAjb.js → pivot-header-presentation-gUxhdIdr.js} +1 -1
- package/dist/chunks/{pivot-result-contract-expectations-DbBahmgc.js → pivot-result-contract-expectations-BkMRCjzf.js} +111 -111
- package/dist/chunks/{pivot-result-identity-CUsMt_4r.js → pivot-result-identity-BKUjYO1u.js} +1 -1
- package/dist/chunks/raw-temporal-value-BzdgeDa7.js +454 -0
- package/dist/chunks/{report-preferences-dialog-DtuOcejh.js → report-preferences-dialog-ChXt8wCt.js} +13 -13
- package/dist/chunks/{report-runtime-context-CrOgmuxO.js → report-runtime-context-g4Zp_TU9.js} +1 -1
- package/dist/chunks/{resolve-dashboard-input-context-DFBIngUZ.js → resolve-dashboard-input-context-BlyFX8He.js} +5053 -4955
- package/dist/chunks/{save-BhhXfp4s.js → save-C9CZAk6V.js} +1 -1
- package/dist/chunks/{saved-dashboard-context-DKMTP9ib.js → saved-dashboard-context-BPSdH2jW.js} +7 -7
- package/dist/chunks/{selection-filter-compiler-DkIjp1yH.js → selection-filter-compiler-BclSpK3P.js} +1 -1
- package/dist/chunks/{semaphor-ready-indicator-HGEnCavj.js → semaphor-ready-indicator-BZUMCHRU.js} +28972 -28922
- package/dist/chunks/{shelf-drop-preview-context-DaCXCdMA.js → shelf-drop-preview-context-yJheoeTC.js} +5 -5
- package/dist/chunks/{stored-dashboard-CksluF2S.js → stored-dashboard-CxQl9g0l.js} +654 -658
- package/dist/chunks/{style-sheet-parts-CmXmKqGw.js → style-sheet-parts-DM_Mw_sm.js} +45 -42
- package/dist/chunks/{table-export-sheet-ClSgERQC.js → table-export-sheet-h7wm5TwP.js} +1 -1
- package/dist/chunks/{token-types-DTocOcwt.js → token-types-BB2ImFx6.js} +1 -1
- package/dist/chunks/{upload-DDYc1Qjj.js → upload-CMTCg47S.js} +1 -1
- package/dist/chunks/{validators-CrYXNnNE.js → validators-BlEWWX9O.js} +576 -562
- package/dist/chunks/{variable-draft-rbtGPvmX.js → variable-draft-OpYyaVCW.js} +4 -4
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +1602 -1555
- package/dist/format-utils/index.js +14 -14
- package/dist/index.js +18 -18
- package/dist/report-runtime-context/index.js +1 -1
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/components/surfboard/filter/types.d.ts +7 -5
- package/dist/types/index.js +5 -5
- package/dist/types/lib/dashboard-inputs/dashboard-date-comparison-plan.d.ts +0 -1
- package/dist/types/lib/dashboard-view-state/date-zoom.d.ts +2 -2
- package/dist/types/lib/formatters/raw-temporal-presentation.d.ts +0 -2
- package/dist/types/shared/analytics-protocol/agent-time-window.d.ts +1 -1
- package/dist/types/shared/analytics-protocol/metric-comparison.d.ts +7 -0
- package/dist/types/shared/analytics-protocol/relative-date/index.d.ts +2 -1
- package/dist/types/shared/analytics-protocol/relative-date/sentence.d.ts +81 -0
- package/dist/types/shared/analytics-protocol/relative-date/traits.d.ts +0 -9
- package/dist/types/shared/analytics-protocol/relative-date/window.d.ts +23 -2
- package/dist/types/shared/dashboard-authoring/canonical-result-keys.d.ts +20 -0
- package/dist/types/shared/dashboard-authoring/card-formats/detail-date-display.d.ts +84 -0
- package/dist/types/shared/dashboard-authoring/card-settings/column-names.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +36 -36
- package/dist/types/shared/dashboard-authoring/filter-model/date-filter-default.d.ts +37 -0
- package/dist/types/shared/dashboard-authoring/filter-model/index.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +1 -0
- package/dist/types/shared/format-utils/filter-line.d.ts +2 -0
- package/package.json +1 -1
- package/dist/chunks/filter-line-Dza3ee4w.js +0 -131
- package/dist/chunks/filter-value-text-DQw4v3nC.js +0 -146
- package/dist/chunks/raw-temporal-value-BnGCWJAL.js +0 -322
package/dist/surfboard/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a, R as s, D as o } from "../chunks/report-preferences-dialog-
|
|
2
|
-
import { C as f, E as D } from "../chunks/bookmark-state-
|
|
1
|
+
import { a, R as s, D as o } from "../chunks/report-preferences-dialog-ChXt8wCt.js";
|
|
2
|
+
import { C as f, E as D } from "../chunks/bookmark-state-Bt_eQEqt.js";
|
|
3
3
|
export {
|
|
4
4
|
f as CONTROL_CARD_DEFAULT_VALUE,
|
|
5
5
|
a as DisplayFormatPreferencesFields,
|
|
@@ -2,7 +2,7 @@ import { DashboardInputTargetContext } from '../../../lib/dashboard-inputs/dashb
|
|
|
2
2
|
import { NormalizedDashboardInput } from '../../../lib/types/common-types.js';
|
|
3
3
|
import { CalculatedFieldFormula, Field } from '../../../lib/types/explorer-types.js';
|
|
4
4
|
import { RawTemporalSelection, TemporalBucketMetadata } from '../../../shared/analytics-protocol/contracts.js';
|
|
5
|
-
import { DateUnit, RelativeDateUnit, RelativeDateWindow, StoredRelativeDate, SubDayDateUnit } from '../../../shared/analytics-protocol/relative-date/index.js';
|
|
5
|
+
import { RelativeDateOperator, DateUnit, RelativeDateUnit, RelativeDateWindow, StoredRelativeDate, SubDayDateUnit } from '../../../shared/analytics-protocol/relative-date/index.js';
|
|
6
6
|
export type DateSelectionMode = 'range' | 'months' | 'day';
|
|
7
7
|
export type DateComparisonOperation = '=' | '!=' | '>' | '>=' | '<' | '<=' | 'between' | 'not between' | 'is null' | 'is not null';
|
|
8
8
|
export type FilterLocation = 'dashboard' | 'frame' | 'sheet' | undefined;
|
|
@@ -16,13 +16,15 @@ export type TSelectedRecord = ComboBoxOption;
|
|
|
16
16
|
export type { DateUnit, RelativeDateUnit, RelativeDateWindow, StoredRelativeDate, SubDayDateUnit, };
|
|
17
17
|
export type TemporalPrecision = 'minute';
|
|
18
18
|
/**
|
|
19
|
-
* Options for a relative date pick ("Today", "Last 7 days"
|
|
20
|
-
* window; `operation` is the
|
|
21
|
-
* the window, "not between" excludes it
|
|
19
|
+
* Options for a relative date pick ("Today", "Last 7 days", "90 days ago").
|
|
20
|
+
* The pick is a window; `operation` is the condition it runs under: "between"
|
|
21
|
+
* keeps the window, "not between" excludes it, a one-sided condition is
|
|
22
|
+
* measured from one edge of it (date filter relative RF-D7). Absent means
|
|
23
|
+
* "between".
|
|
22
24
|
*/
|
|
23
25
|
export type RelativeDateChangeOptions = {
|
|
24
26
|
temporalPrecision?: TemporalPrecision;
|
|
25
|
-
operation?:
|
|
27
|
+
operation?: RelativeDateOperator;
|
|
26
28
|
};
|
|
27
29
|
/**
|
|
28
30
|
* Absolute fixed month/year default used by Month Picker defaults.
|
package/dist/types/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { B as t, y as r, C as l, E as o, V as i, j as n, c as d, g as m, f as u, b as c, e as E, d as C, a as T, x as p, w as D, l as A, h as I, o as _, v as F, u as S, m as b, n as L, p as f, k as N, q as y, s as R, i as h, r as g, t as x } from "../chunks/bookmark-state-
|
|
2
|
-
import { C as O, D as V, L as w, d as U, g as k, h as z, e as B, f as K, c as v, a as Y, i as q, b as G, n as P, s as Q } from "../chunks/validators-
|
|
3
|
-
import { D as j } from "../chunks/token-types-
|
|
4
|
-
import { r as X, a as H } from "../chunks/pivot-result-identity-
|
|
5
|
-
import { D as $ } from "../chunks/report-runtime-context-
|
|
1
|
+
import { B as t, y as r, C as l, E as o, V as i, j as n, c as d, g as m, f as u, b as c, e as E, d as C, a as T, x as p, w as D, l as A, h as I, o as _, v as F, u as S, m as b, n as L, p as f, k as N, q as y, s as R, i as h, r as g, t as x } from "../chunks/bookmark-state-Bt_eQEqt.js";
|
|
2
|
+
import { C as O, D as V, L as w, d as U, g as k, h as z, e as B, f as K, c as v, a as Y, i as q, b as G, n as P, s as Q } from "../chunks/validators-BlEWWX9O.js";
|
|
3
|
+
import { D as j } from "../chunks/token-types-BB2ImFx6.js";
|
|
4
|
+
import { r as X, a as H } from "../chunks/pivot-result-identity-BKUjYO1u.js";
|
|
5
|
+
import { D as $ } from "../chunks/report-runtime-context-g4Zp_TU9.js";
|
|
6
6
|
const e = [
|
|
7
7
|
"concatenate",
|
|
8
8
|
"conditional-category",
|
|
@@ -37,8 +37,8 @@ export declare function applicableDateZoom(zoom: CardDateZoom | undefined, saved
|
|
|
37
37
|
* otherwise. The one rule for any axis shape:
|
|
38
38
|
* - every shaded bucket is a date (a blank inside the band or at its end can't
|
|
39
39
|
* be zoomed: a date range leaves undated rows out);
|
|
40
|
-
* -
|
|
41
|
-
*
|
|
40
|
+
* - one period is a zoom into that period (DZ-D3, Rev 5), on a two-level
|
|
41
|
+
* axis too (the levels of one date);
|
|
42
42
|
* - no bucket outside the band falls strictly between its first and last date
|
|
43
43
|
* (an axis sorted by a measure would pull in periods the band skipped). A
|
|
44
44
|
* bucket outside the band on the first or last date is the same period (a
|
|
@@ -121,8 +121,6 @@ export declare function prepareDetailDateColumn(input: {
|
|
|
121
121
|
format: ResolvedRawTemporalFormat;
|
|
122
122
|
formatValue: PreparedRawTemporalFormatter;
|
|
123
123
|
};
|
|
124
|
-
/** The detail date choice that stores no format: the column draws in the report's date style. */
|
|
125
|
-
export declare const AUTOMATIC_DETAIL_DATE_FORMAT = "auto";
|
|
126
124
|
/** A detail date format drawn on a sample of the column's kind; no format is automatic. Throws when the column can't draw it. */
|
|
127
125
|
export declare function previewDetailDateFormat(input: {
|
|
128
126
|
format: DetailField['format'];
|
|
@@ -10,7 +10,7 @@ export type CheckedAbsoluteTimeWindow = SemaphorAbsoluteTimeWindow & {
|
|
|
10
10
|
export type AgentTimeWindow = RelativeDateWindow | CheckedAbsoluteTimeWindow;
|
|
11
11
|
/** Where a window is going. Each use allows a subset of windows (SPEC-B 3.2). */
|
|
12
12
|
export type AgentTimeWindowUse = 'analysis' | 'cardFilter' | 'filterDefault';
|
|
13
|
-
export type AgentTimeWindowRefusalReason = 'old_form' | 'missing_anchor' | 'seconds' | 'sub_day_periods' | 'sub_day_on_date' | 'over_limit' | 'not_a_window' | 'rolling_days_saved' | 'data_anchor_default' | 'absolute_default' | 'absolute_invalid';
|
|
13
|
+
export type AgentTimeWindowRefusalReason = 'old_form' | 'missing_anchor' | 'seconds' | 'sub_day_periods' | 'sub_day_on_date' | 'over_limit' | 'not_a_window' | 'rolling_days_saved' | 'data_anchor_default' | 'absolute_default' | 'point_default' | 'absolute_invalid';
|
|
14
14
|
/** One refusal, worded for an agent: what is wrong and what to send instead (RB-INV-5). */
|
|
15
15
|
export type AgentTimeWindowRefusal = {
|
|
16
16
|
reason: AgentTimeWindowRefusalReason;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SemaphorFieldRef, SemaphorTimeGrain, SemaphorValidationResult } from './contracts.js';
|
|
2
|
+
import { TemporalShift } from '../temporal/calendar-periods.js';
|
|
2
3
|
export type MetricComparisonSpec = {
|
|
3
4
|
kind: 'previous_period';
|
|
4
5
|
offsetPeriods?: number;
|
|
@@ -111,6 +112,12 @@ export type MetricComparisonOutputBase = {
|
|
|
111
112
|
windowGrain?: MetricComparisonWindowGrain;
|
|
112
113
|
currentWindow?: ResolvedDateWindow;
|
|
113
114
|
comparisonWindow?: ResolvedDateWindow;
|
|
115
|
+
/**
|
|
116
|
+
* How far back `comparisonWindow` sits from `currentWindow`: the one step a
|
|
117
|
+
* consumer moves a date by to reach the comparison period (a clicked
|
|
118
|
+
* bucket, a selection). Set with the windows.
|
|
119
|
+
*/
|
|
120
|
+
step?: TemporalShift;
|
|
114
121
|
referenceTime?: string;
|
|
115
122
|
temporalField?: SemaphorFieldRef;
|
|
116
123
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export { allowsRelativeDate, explainRelativeDateInput, readRelativeDate, type DateUnit, type ReadRelativeDateOptions, type RelativeDateProblem, type RelativeDateAnchor, type RelativeDateModeShape, type RelativeDateUnit, type RelativeDateWindow, type RelativeDateWindowInput, type RelativeMonthDayWindowInput, type RelativePeriodsWindowInput, type RelativeRollingWindowInput, type StoredRelativeDate, type SubDayDateUnit, } from './window.js';
|
|
1
|
+
export { allowsRelativeDate, relativeDateConditionValues, relativeDateEdge, explainRelativeDateInput, readRelativeDate, type DateUnit, type ReadRelativeDateOptions, type RelativeDateProblem, type RelativeDateAnchor, type RelativeDateModeShape, type RelativeDateOperator, type RelativeDateUnit, type RelativeDateWindow, type RelativeDateWindowInput, type RelativeMonthDayWindowInput, type RelativePeriodsWindowInput, type RelativeRollingWindowInput, type StoredRelativeDate, type SubDayDateUnit, } from './window.js';
|
|
2
2
|
export { RelativeDateUsageError, resolveRelativeDate, type RelativeDateInstants, type RelativeDateResolveOptions, type ResolvedRelativeDate, } from './resolve.js';
|
|
3
3
|
export { describeRelativeDate, relativeDatesEqual, type RelativeDateDescription, } from './describe.js';
|
|
4
4
|
export { relativeDateTraits, type RelativeDateTraits } from './traits.js';
|
|
5
5
|
export { RELATIVE_DATE_PRESETS, type RelativeDatePreset, type RelativeDatePresetCategory, type RelativeDatePresetId, } from './presets.js';
|
|
6
6
|
export { relativeDateWindowSchema, relativeDateWindowShapes, storedRelativeDateSchema } from './schemas.js';
|
|
7
7
|
export { SEMAPHOR_TIME_WINDOW_MAX_VALUE } from './limits.js';
|
|
8
|
+
export { DEFAULT_RELATIVE_POINT, describeRelativeCondition, explainRelativePoint, readRelativePoint, relativePointInput, relativeConditionLead, relativePointOperator, relativePointSide, relativePointSentenceWords, relativePointWords, type RelativePoint, type RelativePointSentence, DEFAULT_RELATIVE_SENTENCE, explainRelativeSentence, isSubDayUnit, normalRelativeSentence, readRelativeSentence, relativeSentenceInput, type RelativeSentence, type RelativeSentenceDirection, } from './sentence.js';
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { DateUnit, RelativeDateUnit, RelativeDateWindow, RelativeDateWindowInput, SubDayDateUnit } from './window.js';
|
|
2
|
+
export type RelativeSentenceDirection = 'last' | 'this' | 'next';
|
|
3
|
+
export type RelativeSentence = {
|
|
4
|
+
direction: RelativeSentenceDirection;
|
|
5
|
+
/** How many units; unused with `this`. */
|
|
6
|
+
count: number;
|
|
7
|
+
unit: RelativeDateUnit;
|
|
8
|
+
/** The current period counts (Last and Next on calendar units). */
|
|
9
|
+
includeCurrent: boolean;
|
|
10
|
+
/** This: only up to now. */
|
|
11
|
+
toDate: boolean;
|
|
12
|
+
};
|
|
13
|
+
/** The sentence the Relative tab starts on when the applied window is none or no sentence: Last 7 days. */
|
|
14
|
+
export declare const DEFAULT_RELATIVE_SENTENCE: RelativeSentence;
|
|
15
|
+
export declare const isSubDayUnit: (unit: RelativeDateUnit) => unit is SubDayDateUnit;
|
|
16
|
+
/**
|
|
17
|
+
* The sentence's normal form: Last 1 or Next 1 with the current period is
|
|
18
|
+
* This; a sentence's unused parts are reset. Two sentences that mean one
|
|
19
|
+
* window have one normal form, which is what `readRelativeSentence` returns.
|
|
20
|
+
*/
|
|
21
|
+
export declare function normalRelativeSentence(sentence: RelativeSentence): RelativeSentence;
|
|
22
|
+
/** Why a sentence can't be a window, in words for the picker, or undefined when it can. */
|
|
23
|
+
export declare function explainRelativeSentence(sentence: RelativeSentence): string | undefined;
|
|
24
|
+
/** The window input a sentence states (RF-D1); undefined when `explainRelativeSentence` refuses it. */
|
|
25
|
+
export declare function relativeSentenceInput(sentence: RelativeSentence): RelativeDateWindowInput | undefined;
|
|
26
|
+
/** The sentence a window states, in normal form, or undefined when no sentence says it (RF-D3). */
|
|
27
|
+
export declare function readRelativeSentence(window: RelativeDateWindow): RelativeSentence | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Where a one-sided condition is measured from: now, the current period
|
|
30
|
+
* ("today", "this month"), or whole periods ago or from now.
|
|
31
|
+
*/
|
|
32
|
+
export type RelativePoint = {
|
|
33
|
+
kind: 'now';
|
|
34
|
+
} | {
|
|
35
|
+
kind: 'current';
|
|
36
|
+
unit: DateUnit;
|
|
37
|
+
} | {
|
|
38
|
+
kind: 'ago' | 'ahead';
|
|
39
|
+
count: number;
|
|
40
|
+
unit: DateUnit;
|
|
41
|
+
};
|
|
42
|
+
/** "Before 90 days ago", "On or after this month", "After now". */
|
|
43
|
+
export type RelativePointSentence = {
|
|
44
|
+
side: 'before' | 'after';
|
|
45
|
+
point: RelativePoint;
|
|
46
|
+
/** The point's own period counts ("on or before"); unused with `now`. */
|
|
47
|
+
inclusive: boolean;
|
|
48
|
+
};
|
|
49
|
+
export declare const DEFAULT_RELATIVE_POINT: RelativePointSentence;
|
|
50
|
+
/** Why a point can't be stated, in words for the picker, or undefined when it can. */
|
|
51
|
+
export declare function explainRelativePoint(sentence: RelativePointSentence): string | undefined;
|
|
52
|
+
/** The side a one-sided condition takes, and whether the point's own period counts; undefined for any other condition. */
|
|
53
|
+
export declare function relativePointSide(operator: string): Pick<RelativePointSentence, 'side' | 'inclusive'> | undefined;
|
|
54
|
+
/** The one-sided condition a side states, with or without the point's own period. */
|
|
55
|
+
export declare const relativePointOperator: (side: RelativePointSentence["side"], inclusive: boolean) => "<" | "<=" | ">" | ">=";
|
|
56
|
+
/**
|
|
57
|
+
* The condition and window a point states (RF-D7). Before a period is `<` its
|
|
58
|
+
* start, on or before it `<=` its end; after a period is `>` its end, on or
|
|
59
|
+
* after it `>=` its start. Now is the end of today so far: before now `<=`,
|
|
60
|
+
* after now `>`.
|
|
61
|
+
*/
|
|
62
|
+
export declare function relativePointInput(sentence: RelativePointSentence): {
|
|
63
|
+
operator: '<' | '<=' | '>' | '>=';
|
|
64
|
+
window: RelativeDateWindowInput;
|
|
65
|
+
} | undefined;
|
|
66
|
+
/** The point a one-sided condition and its window state, or undefined when no point says it. */
|
|
67
|
+
export declare function readRelativePoint(operator: string, window: RelativeDateWindow): RelativePointSentence | undefined;
|
|
68
|
+
/** A point in words: "now", "today", "this month", "yesterday", "90 days ago", "2 weeks from now". */
|
|
69
|
+
export declare function relativePointWords(point: RelativePoint): string;
|
|
70
|
+
/** A one-sided condition's words, "Before" to "On or after", for every reader (the picker's header too); undefined for any other. */
|
|
71
|
+
export declare function relativeConditionLead(operator: string): string | undefined;
|
|
72
|
+
/** A point sentence in words: "Before 90 days ago", "On or after this month", "After now". */
|
|
73
|
+
export declare function relativePointSentenceWords(sentence: RelativePointSentence): string;
|
|
74
|
+
/**
|
|
75
|
+
* A one-sided relative condition in words, for chips, filter lines and PDF
|
|
76
|
+
* lines (RF-D7): its point ("Before 90 days ago", "After now"), or for a
|
|
77
|
+
* window no point says, the edge it compares against ("Before the start of
|
|
78
|
+
* last 7 days"). Undefined for any other condition, whose callers word the
|
|
79
|
+
* window themselves.
|
|
80
|
+
*/
|
|
81
|
+
export declare function describeRelativeCondition(operator: string, window: RelativeDateWindow): string | undefined;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { RelativeDatePresetCategory } from './presets.js';
|
|
2
1
|
import { DateUnit, RelativeDateUnit, RelativeDateWindow } from './window.js';
|
|
3
2
|
export type RelativeDateTraits = {
|
|
4
3
|
/** A rolling minute or hour window. */
|
|
@@ -24,14 +23,6 @@ export type RelativeDateTraits = {
|
|
|
24
23
|
* (plan D8).
|
|
25
24
|
*/
|
|
26
25
|
printsByName: boolean;
|
|
27
|
-
/** The picker's preset category the window opens on: `time` for sub-day windows, `day` for a month's first or last day, else its unit. */
|
|
28
|
-
pickerCategory: RelativeDatePresetCategory;
|
|
29
|
-
/** The From and To offsets the picker's Relative tab edits: a `periods` window anchored at now without `toDate`. */
|
|
30
|
-
periodOffsets?: {
|
|
31
|
-
unit: DateUnit;
|
|
32
|
-
from: number;
|
|
33
|
-
to: number;
|
|
34
|
-
};
|
|
35
26
|
/** Valid as a Day Picker default: exactly one calendar day. */
|
|
36
27
|
dayPickerDefault: boolean;
|
|
37
28
|
/** Valid as a month picker default: this month or the previous one. */
|
|
@@ -83,8 +83,29 @@ export type ReadRelativeDateOptions = {
|
|
|
83
83
|
/** Also apply the authoring limits (SPEC 3.1). Writers pass it; readers of stored values never do. */
|
|
84
84
|
authoring?: boolean;
|
|
85
85
|
};
|
|
86
|
-
/**
|
|
87
|
-
export
|
|
86
|
+
/** The conditions a relative date can run under. */
|
|
87
|
+
export type RelativeDateOperator = 'between' | 'not between' | '<' | '<=' | '>' | '>=';
|
|
88
|
+
/**
|
|
89
|
+
* Which edge of its window a one-sided condition is measured from (date filter
|
|
90
|
+
* relative plan, RF-D7): `<` and `>=` its start, `<=` and `>` its end, the same
|
|
91
|
+
* day edges a fixed date takes under those conditions. Undefined for the range
|
|
92
|
+
* conditions, which take the whole window.
|
|
93
|
+
*/
|
|
94
|
+
export declare function relativeDateEdge(operator: string): 'start' | 'end' | undefined;
|
|
95
|
+
/**
|
|
96
|
+
* What a condition keeps of its window's two ends (RF-D7): both for a range
|
|
97
|
+
* condition, the one edge for a one-sided condition. Dates, ISO strings and
|
|
98
|
+
* the ends' day-or-instant kinds all go through it, so the browser and the
|
|
99
|
+
* server pick the same edge.
|
|
100
|
+
*/
|
|
101
|
+
export declare function relativeDateConditionValues<T>(operator: string, ends: readonly [T, T]): [T] | [T, T];
|
|
102
|
+
/**
|
|
103
|
+
* Whether a relative date can run under a condition: a range condition, or a
|
|
104
|
+
* one-sided one measured from an edge of the window (RF-D7, plan D3). A
|
|
105
|
+
* window counted from the newest row runs only as a range: the server's
|
|
106
|
+
* newest-row lookup resolves ranges (RF-D10). The one rule; every gate calls it.
|
|
107
|
+
*/
|
|
108
|
+
export declare function allowsRelativeDate(operator: string, window?: RelativeDateWindowInput): boolean;
|
|
88
109
|
/**
|
|
89
110
|
* The one reader of a relative date, and the only way to get a window: any
|
|
90
111
|
* stored form or writer input becomes its canonical window (SPEC 2.4, 2.5),
|
|
@@ -36,3 +36,23 @@ export declare function resolveCanonicalResultOutputKeys(config: {
|
|
|
36
36
|
pivotByColumns?: readonly CanonicalDetailResultFieldIdentity[];
|
|
37
37
|
detailColumns?: readonly CanonicalDetailResultFieldIdentity[];
|
|
38
38
|
}): Map<CanonicalDetailResultFieldIdentity, string>;
|
|
39
|
+
/**
|
|
40
|
+
* A detail table's raw result keys, one per placement (date and time display
|
|
41
|
+
* DT-D4, DT-INV-4). A field may sit in a detail table's columns more than once
|
|
42
|
+
* (a timestamp shown as its date and as its time); a later copy whose key is
|
|
43
|
+
* taken is keyed `<key>_2`, `<key>_3`, ..., stepping past every column's own
|
|
44
|
+
* key, so a repeat never takes the key of another column (`address_2` beside
|
|
45
|
+
* a repeated `address`) wherever that column sits. The one rule for the query
|
|
46
|
+
* (`withDistinctDetailColumnAliases`) and for every offline reader of a
|
|
47
|
+
* card's keys (`resolveCanonicalResultOutputKeys`).
|
|
48
|
+
*/
|
|
49
|
+
export declare function resolveDistinctDetailRawKeys(detailColumns: readonly CanonicalDetailResultFieldIdentity[]): string[];
|
|
50
|
+
/**
|
|
51
|
+
* A card config whose repeated detail placements carry their own `alias`
|
|
52
|
+
* (`resolveDistinctDetailRawKeys`), so every key derived from a field alone
|
|
53
|
+
* agrees: the server applies it once where a query normalizes its config.
|
|
54
|
+
* Returns the same config when nothing repeats.
|
|
55
|
+
*/
|
|
56
|
+
export declare function withDistinctDetailColumnAliases<T extends {
|
|
57
|
+
detailColumns?: readonly CanonicalDetailResultFieldIdentity[];
|
|
58
|
+
}>(config: T): T;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { RawDatePreset, SemaphorDateValueFormat } from '../../analytics-protocol/contracts.js';
|
|
2
|
+
import { RawTemporalPatternDialect } from '../../format-utils/raw-temporal.js';
|
|
3
|
+
export type DetailDateShow = 'date' | 'time' | 'datetime';
|
|
4
|
+
export type DetailDateClock = '12h' | '24h';
|
|
5
|
+
/** The date styles a detail column offers: today's date-only presets, in both token sets. */
|
|
6
|
+
declare const DATE_STYLES: readonly [{
|
|
7
|
+
readonly id: "MMM DD, YYYY";
|
|
8
|
+
readonly dateFns: "MMM dd, yyyy";
|
|
9
|
+
readonly label: "Jan 15, 2024";
|
|
10
|
+
}, {
|
|
11
|
+
readonly id: "MMMM DD, YYYY";
|
|
12
|
+
readonly dateFns: "MMMM dd, yyyy";
|
|
13
|
+
readonly label: "January 15, 2024";
|
|
14
|
+
}, {
|
|
15
|
+
readonly id: "MM/DD/YYYY";
|
|
16
|
+
readonly dateFns: "MM/dd/yyyy";
|
|
17
|
+
readonly label: "01/15/2024";
|
|
18
|
+
}, {
|
|
19
|
+
readonly id: "DD/MM/YYYY";
|
|
20
|
+
readonly dateFns: "dd/MM/yyyy";
|
|
21
|
+
readonly label: "15/01/2024";
|
|
22
|
+
}, {
|
|
23
|
+
readonly id: "MM-DD-YYYY";
|
|
24
|
+
readonly dateFns: "MM-dd-yyyy";
|
|
25
|
+
readonly label: "01-15-2024";
|
|
26
|
+
}, {
|
|
27
|
+
readonly id: "YYYY-MM-DD";
|
|
28
|
+
readonly dateFns: "yyyy-MM-dd";
|
|
29
|
+
readonly label: "2024-01-15";
|
|
30
|
+
}, {
|
|
31
|
+
readonly id: "DD MMM YYYY";
|
|
32
|
+
readonly dateFns: "dd MMM yyyy";
|
|
33
|
+
readonly label: "15 Jan 2024";
|
|
34
|
+
}];
|
|
35
|
+
export type DetailDateStyle = (typeof DATE_STYLES)[number]['id'];
|
|
36
|
+
/** The date styles, in the order the panel lists them. */
|
|
37
|
+
export declare const DETAIL_DATE_STYLES: ReadonlyArray<{
|
|
38
|
+
id: DetailDateStyle;
|
|
39
|
+
label: string;
|
|
40
|
+
}>;
|
|
41
|
+
export type DetailDateDisplay = {
|
|
42
|
+
show: DetailDateShow;
|
|
43
|
+
/** Unused with `show: 'time'`. */
|
|
44
|
+
dateStyle: DetailDateStyle;
|
|
45
|
+
clock: DetailDateClock;
|
|
46
|
+
seconds: boolean;
|
|
47
|
+
};
|
|
48
|
+
/** What a stored detail date format opens as in the panel (DT-D7). */
|
|
49
|
+
export type DetailDateChoice = {
|
|
50
|
+
kind: 'automatic';
|
|
51
|
+
} | {
|
|
52
|
+
kind: 'display';
|
|
53
|
+
display: DetailDateDisplay;
|
|
54
|
+
} | {
|
|
55
|
+
kind: 'custom';
|
|
56
|
+
pattern: string;
|
|
57
|
+
dialect: RawTemporalPatternDialect;
|
|
58
|
+
} | {
|
|
59
|
+
kind: 'preset';
|
|
60
|
+
preset: RawDatePreset;
|
|
61
|
+
};
|
|
62
|
+
export declare const DEFAULT_DETAIL_DATE_STYLE: DetailDateStyle;
|
|
63
|
+
/** The stored format for a display: a 24-hour or date-only display in Semaphor tokens, a 12-hour one in `date_fns`. */
|
|
64
|
+
export declare function detailDateDisplayFormat(display: DetailDateDisplay): SemaphorDateValueFormat;
|
|
65
|
+
/** What a stored detail date format opens as (DT-D7): none is Automatic; a writer's pattern its choices; any other pattern Custom. */
|
|
66
|
+
export declare function readDetailDateChoice(format: unknown): DetailDateChoice;
|
|
67
|
+
/**
|
|
68
|
+
* A typed custom pattern as a stored format (DT-D8): Semaphor tokens when it
|
|
69
|
+
* reads as them, else `date_fns` when it reads as that; a stored `date_fns`
|
|
70
|
+
* pattern being edited stays `date_fns` while it reads (column formats
|
|
71
|
+
* P5-54). The validators decide, never character matching.
|
|
72
|
+
*/
|
|
73
|
+
export declare function customDetailDateFormat(typed: string, storedDialect?: RawTemporalPatternDialect): {
|
|
74
|
+
ok: true;
|
|
75
|
+
format: SemaphorDateValueFormat;
|
|
76
|
+
} | {
|
|
77
|
+
ok: false;
|
|
78
|
+
reason: string;
|
|
79
|
+
};
|
|
80
|
+
/** Why a detail date format can't be drawn on this connection (DT-D3), or undefined when it can. */
|
|
81
|
+
export declare function detailDateFormatProblem(format: unknown, connectionType: unknown): string | undefined;
|
|
82
|
+
/** Whether 12-hour times can be drawn for a detail table on this connection (DT-D3). */
|
|
83
|
+
export declare function detailDateTwelveHourAvailable(connectionType: unknown): boolean;
|
|
84
|
+
export {};
|
|
@@ -23,6 +23,8 @@ export type NamedColumn = {
|
|
|
23
23
|
qualifier?: string;
|
|
24
24
|
/** The type of the values the column shows, which decides the formats it takes: a measure's is its aggregation's result type (`measureResultDataType`). Absent for SQL result columns. */
|
|
25
25
|
dataType?: string;
|
|
26
|
+
/** The source's own type, when it has one: a timestamp the catalog calls `date` still holds a time (date and time display, review). */
|
|
27
|
+
nativeDataType?: string;
|
|
26
28
|
/** A grouped date's grain: its formats are temporal buckets at this grain. */
|
|
27
29
|
granularity?: string;
|
|
28
30
|
/**
|