react-semaphor 0.1.476 → 0.1.477
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/chunks/{dashboard-briefing-launcher-eBsB9kr8.js → dashboard-briefing-launcher-C9d8CPxv.js} +2 -2
- package/dist/chunks/{dashboard-briefing-launcher-ZfuxdRN2.cjs → dashboard-briefing-launcher-CXHq6ime.cjs} +1 -1
- package/dist/chunks/{dashboard-controls-BX6p6z8a.js → dashboard-controls-BqDm4ARp.js} +3 -3
- package/dist/chunks/{dashboard-controls-DwjEc7sO.cjs → dashboard-controls-d7Yd2fJb.cjs} +1 -1
- package/dist/chunks/{dashboard-json-CdwYFOsc.cjs → dashboard-json-BYQjTmqD.cjs} +1 -1
- package/dist/chunks/{dashboard-json-BfgitBXc.js → dashboard-json-CL_vgcWq.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-D80DLF7C.js → edit-dashboard-visual-C0Zvyo-X.js} +2 -2
- package/dist/chunks/{edit-dashboard-visual-Cbougpzc.cjs → edit-dashboard-visual-Dklel3MC.cjs} +1 -1
- package/dist/chunks/{editor-action-buttons-BDRLfaW-.cjs → editor-action-buttons-AcaZsiDy.cjs} +1 -1
- package/dist/chunks/{editor-action-buttons-DjsEDQok.js → editor-action-buttons-BOyUtX9j.js} +1 -1
- package/dist/chunks/{index-CneWIz__.cjs → index-Cd8qGOXl.cjs} +230 -230
- package/dist/chunks/{index-Dv5hbC1r.js → index-DrdF7QR7.js} +35179 -34776
- package/dist/chunks/{report-preferences-dialog-BXBlvW79.js → report-preferences-dialog-BjygtSP3.js} +1 -1
- package/dist/chunks/{report-preferences-dialog-cSMJYqns.cjs → report-preferences-dialog-DW40ECz1.cjs} +1 -1
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/data-app-builder/index.cjs +1 -1
- package/dist/data-app-builder/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +4 -4
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/briefings.d.ts +4 -2
- package/dist/types/dashboard-authoring.d.ts +4 -2
- package/dist/types/dashboard.d.ts +4 -2
- package/dist/types/main.d.ts +13 -6
- package/dist/types/shared.d.ts +4 -2
- package/dist/types/surfboard.d.ts +4 -2
- package/dist/types/types.d.ts +4 -2
- package/package.json +1 -1
package/dist/chunks/{report-preferences-dialog-BXBlvW79.js → report-preferences-dialog-BjygtSP3.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as o, Fragment as j, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import oe, { useState as S, useRef as X, useEffect as U, useCallback as E, useMemo as _ } from "react";
|
|
3
|
-
import { az as ee, aA as ce, aB as B, aC as $, aD as de, h as ue, i as me, j as fe, k as he, l as M, m as H, aE as ve, aF as V, aG as z, b as ye, aH as pe, aI as ge, aJ as Se, aK as be, aL as Te } from "./index-
|
|
3
|
+
import { az as ee, aA as ce, aB as B, aC as $, aD as de, h as ue, i as me, j as fe, k as he, l as M, m as H, aE as ve, aF as V, aG as z, b as ye, aH as pe, aI as ge, aJ as Se, aK as be, aL as Te } from "./index-DrdF7QR7.js";
|
|
4
4
|
import { u as ae, c as F, O as W, P as we, a as Ce, B as L, b as ke, d as q, L as te, T as xe, F as Ne, G, I as K } from "./switch-C8NihGV4.js";
|
|
5
5
|
import { a as Pe } from "./report-runtime-context-DNbgCsko.js";
|
|
6
6
|
import "./x-CXDkqdur.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),o=require("react"),l=require("./index-CneWIz__.cjs"),u=require("./switch-B1mZx2k9.cjs"),V=require("./report-runtime-context-RFiWq4wK.cjs");require("./x-B6ghREd2.cjs");require("./saved-temporal-bucket-format-DNMtD77o.cjs");require("./validators-DcshgK7w.cjs");require("./analyze-result-contract-OgPk-zGu.cjs");const L=require("../value-format-preferences/index.cjs");function G(a={}){const{authToken:c,tokenProps:t}=l.useSemaphorContext(),m=u.useDashboardStore(p=>p.actions.applyResolvedCalendarPreferences),s=a.enabled??!0,i=(c==null?void 0:c.accessToken)??null,h=(t==null?void 0:t.apiServiceUrl)??null,[g,S]=o.useState(!1),[b,C]=o.useState(!1),[f,j]=o.useState(!1),[T,x]=o.useState(null),[w,P]=o.useState(null),v=o.useRef(i);v.current=i,o.useEffect(()=>{P(null),x(null),S(!1),C(!1),j(!1)},[i]);const N=o.useCallback(async p=>{const r=V.parseCalendarPreferencesResponse(await p.json());if(!r.ok)throw new Error("Calendar preferences response is invalid");return r.value},[]),k=o.useCallback(async()=>{if(!s||!i||!h)return;const p=i;S(!0),x(null);try{const r=await fetch(`${h}/v1/user-preferences/calendar`,{method:"GET",headers:{Authorization:`Bearer ${i}`}});if(!r.ok){const y=await r.json().catch(()=>({}));throw new Error(y.error||"Failed to fetch preferences")}const n=await N(r);v.current===p&&P(n)}catch(r){v.current===p&&x(r instanceof Error?r.message:"Unknown error")}finally{v.current===p&&S(!1)}},[i,h,s,N]);o.useEffect(()=>{s&&k()},[s,k]);const E=o.useCallback(async p=>{if(!i||!h)return x("Not authenticated"),!1;const r=i;C(!0),x(null);try{const n=await fetch(`${h}/v1/user-preferences/calendar`,{method:"PATCH",headers:{"Content-Type":"application/json",Authorization:`Bearer ${i}`},body:JSON.stringify(p)});if(!n.ok){const D=await n.json().catch(()=>({}));throw new Error(D.error||"Failed to update preferences")}const y=await N(n);return v.current!==r?!1:(P(y),m(y.resolved,y.sources),!0)}catch(n){return v.current===r&&x(n instanceof Error?n.message:"Unknown error"),!1}finally{v.current===r&&C(!1)}},[i,h,m,N]),A=o.useCallback(async()=>{if(!i||!h)return x("Not authenticated"),!1;const p=i;j(!0),x(null);try{const r=await fetch(`${h}/v1/user-preferences/calendar`,{method:"DELETE",headers:{Authorization:`Bearer ${i}`}});if(!r.ok){const y=await r.json().catch(()=>({}));throw new Error(y.error||"Failed to clear preferences")}const n=await N(r);return v.current!==p?!1:(P(n),m(n.resolved,n.sources),!0)}catch(r){return v.current===p&&x(r instanceof Error?r.message:"Unknown error"),!1}finally{v.current===p&&j(!1)}},[i,h,m,N]);return{preferences:w,isLoading:g,isSaving:b,isClearing:f,error:T,updatePreferences:E,clearPreferences:A,refetch:k}}const F=[{value:"America/New_York",label:"Eastern Time (US & Canada)"},{value:"America/Chicago",label:"Central Time (US & Canada)"},{value:"America/Denver",label:"Mountain Time (US & Canada)"},{value:"America/Los_Angeles",label:"Pacific Time (US & Canada)"},{value:"America/Phoenix",label:"Arizona"},{value:"America/Anchorage",label:"Alaska"},{value:"Pacific/Honolulu",label:"Hawaii"},{value:"Europe/London",label:"London"},{value:"Europe/Paris",label:"Paris, Berlin, Rome"},{value:"Asia/Tokyo",label:"Tokyo"},{value:"Asia/Shanghai",label:"Beijing, Shanghai"},{value:"Asia/Kolkata",label:"Mumbai, New Delhi"},{value:"Australia/Sydney",label:"Sydney"},{value:"UTC",label:"UTC"}],B=[{value:0,label:"Sunday"},{value:1,label:"Monday"},{value:6,label:"Saturday"}],R="text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground";function W(){try{const a=Intl;if(a.supportedValuesOf)return a.supportedValuesOf("timeZone")}catch{}return F.map(a=>a.value)}function H(a){if(!a)return"default";if(a.tz!==a.weekStart)return"inherited";switch(a.tz){case"viewer_tenant":return"tenant";case"viewer_organization":return"organization";case"system_default":return"system";case"session_initial":return"embedded";default:return"default"}}function U(a){const c=F.find(t=>t.value===a);return c?c.label:a}function K(a){const c=B.find(t=>t.value===a);return c?c.label:String(a)}function J({active:a,onClose:c}){const{preferences:t,isLoading:m,isSaving:s,isClearing:i,updatePreferences:h,clearPreferences:g}=G({enabled:a}),S=l.useCalendarContext(),b=(t==null?void 0:t.resolved.tz)||(S==null?void 0:S.tz)||"UTC",C=(t==null?void 0:t.resolved.weekStart)??(S==null?void 0:S.weekStart)??1,[f,j]=o.useState((t==null?void 0:t.stored)===null),[T,x]=o.useState(!1),[w,P]=o.useState(b),[v,N]=o.useState(C),[k,E]=o.useState(!1),A=o.useMemo(()=>W(),[]),p=o.useMemo(()=>A.filter(d=>!F.some(M=>M.value===d)),[A]),r=o.useMemo(()=>U(w),[w]),n=t!=null&&t.inherited?U(t.inherited.tz):"UTC",y=t!=null&&t.inherited?K(t.inherited.weekStart):"Monday",D=H(t==null?void 0:t.inheritedSources);o.useEffect(()=>{if(!a){x(!1);return}T||(t&&j(t.stored===null),P(b),N(C))},[a,T,t,b,C]);const O=async()=>{if(m){l.ue.error("Preferences are still loading. Please try again.");return}f?await g()?(l.ue.success("Now using default settings."),c()):l.ue.error("Failed to save preferences. Please try again."):await h({tz:w,weekStart:v})?(l.ue.success("Preferences saved."),c()):l.ue.error("Failed to save preferences. Please try again.")},_=()=>{c()},z=s||i,$=z||m;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-4 py-1",children:[e.jsxs(l.RadioGroup,{value:f?"defaults":"custom",onValueChange:d=>{x(!0),j(d==="defaults")},className:"space-y-0.5",children:[e.jsxs("label",{htmlFor:"mode-defaults",className:u.cn("flex cursor-pointer items-start gap-2 rounded-control px-2 py-1.5 hover:bg-muted/50",f&&"bg-muted/50"),onClick:()=>{x(!0),j(!0)},children:[e.jsx(l.RadioGroupItem,{value:"defaults",id:"mode-defaults",className:"mt-0.5"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("p",{className:"text-[13px] font-medium text-foreground",children:["Use ",D," defaults"]}),e.jsxs("p",{className:"text-[12px] text-muted-foreground",children:[n,", week starts ",y]})]})]}),e.jsxs("label",{htmlFor:"mode-custom",className:u.cn("flex cursor-pointer items-start gap-2 rounded-control px-2 py-1.5 hover:bg-muted/50",!f&&"bg-muted/50"),onClick:()=>{x(!0),j(!1)},children:[e.jsx(l.RadioGroupItem,{value:"custom",id:"mode-custom",className:"mt-0.5"}),e.jsx("p",{className:"flex-1 text-[13px] font-medium text-foreground",children:"Use custom settings"})]})]}),e.jsxs("div",{className:u.cn("space-y-4 border-t border-border/60 pt-4 transition-opacity",f&&"pointer-events-none opacity-50"),children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(u.Label,{className:R,children:"Timezone"}),e.jsxs(u.Popover,{open:k,onOpenChange:E,modal:!0,children:[e.jsx(u.PopoverTrigger,{asChild:!0,children:e.jsxs(u.Button,{variant:"outline",size:"xs",role:"combobox","aria-expanded":k,className:"w-full justify-between text-[12px] font-normal",disabled:f,children:[e.jsx("span",{className:"truncate",children:r}),e.jsx(l.ChevronsUpDown,{className:"ml-2 h-3.5 w-3.5 shrink-0 opacity-50"})]})}),e.jsx(u.PopoverContent,{className:"z-50 w-[--radix-popover-trigger-width] p-0",align:"start",children:e.jsxs(l.Command,{className:"overflow-visible",children:[e.jsx(l.CommandInput,{placeholder:"Search timezones…"}),e.jsxs(l.CommandList,{children:[e.jsx(l.CommandEmpty,{children:"No timezone found."}),e.jsx(l.CommandGroup,{heading:"Common",children:F.map(d=>e.jsxs(l.CommandItem,{value:`${d.value} ${d.label}`,onSelect:()=>{x(!0),P(d.value),E(!1)},children:[e.jsx(u.Check,{className:u.cn("h-3.5 w-3.5",w===d.value?"opacity-100":"opacity-0")}),e.jsx("span",{className:"flex-1",children:d.label}),e.jsx("span",{className:"text-[11px] text-muted-foreground",children:d.value})]},d.value))}),e.jsx(l.CommandSeparator,{}),e.jsx(l.CommandGroup,{heading:"All timezones",children:p.map(d=>e.jsxs(l.CommandItem,{value:d,onSelect:()=>{x(!0),P(d),E(!1)},children:[e.jsx(u.Check,{className:u.cn("h-3.5 w-3.5",w===d?"opacity-100":"opacity-0")}),d]},d))})]})]})})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(u.Label,{className:R,children:"Week starts on"}),e.jsx(l.RadioGroup,{value:String(v),onValueChange:d=>{x(!0),N(Number(d))},className:"flex gap-4",disabled:f,children:B.map(d=>e.jsxs("label",{htmlFor:`week-start-${d.value}`,className:u.cn("flex cursor-pointer items-center gap-2 text-[13px]",f&&"cursor-not-allowed"),children:[e.jsx(l.RadioGroupItem,{value:String(d.value),id:`week-start-${d.value}`,disabled:f}),d.label]},d.value))})]})]})]}),e.jsxs(l.DialogFooter,{children:[e.jsx(u.Button,{variant:"outline",size:"xs",onClick:_,disabled:z,children:"Cancel"}),e.jsx(u.Button,{size:"xs",onClick:O,disabled:$,children:z?e.jsxs(e.Fragment,{children:[e.jsx(u.LoaderCircle,{className:"h-3.5 w-3.5 animate-spin"}),"Saving…"]}):"Save"})]})]})}function Y(a={}){const{authToken:c,tokenProps:t}=l.useSemaphorContext(),m=u.useDashboardStore(r=>r.actions.applyResolvedValueFormatPreferences),s=a.enabled??!0,i=(c==null?void 0:c.accessToken)??null,h=(t==null?void 0:t.apiServiceUrl)??null,g=o.useRef(i);g.current=i;const[S,b]=o.useState(null),[C,f]=o.useState(!1),[j,T]=o.useState(!1),[x,w]=o.useState(!1),[P,v]=o.useState(null);o.useEffect(()=>{b(null),v(null),f(!1),T(!1),w(!1)},[i]);const N=o.useCallback(async r=>{const n=L.parseValueFormatPreferencesResponse(await r.json());if(!n.ok)throw new Error("Value format preferences response is invalid");return n.value},[]),k=o.useCallback(async(r,n)=>{if(!i||!h)throw new Error("Not authenticated");const y=await fetch(`${h}/v1/user-preferences/value-format`,{method:r,headers:{Authorization:`Bearer ${i}`,...n?{"Content-Type":"application/json"}:{}},body:n?JSON.stringify(n):void 0});if(!y.ok){const D=await y.json().catch(()=>({}));throw new Error(D.error||"Failed to update preferences")}return N(y)},[i,h,N]),E=o.useCallback(async()=>{if(!s||!i||!h)return;const r=i;f(!0),v(null);try{const n=await k("GET");g.current===r&&b(n)}catch(n){g.current===r&&v(n instanceof Error?n.message:"Unknown error")}finally{g.current===r&&f(!1)}},[i,h,s,k]);o.useEffect(()=>{s&&E()},[s,E]);const A=o.useCallback(async r=>{const n=i;T(!0),v(null);try{const y=await k("PATCH",r);return g.current!==n?!1:(b(y),m(y.resolved,y.sources),!0)}catch(y){return g.current===n&&v(y instanceof Error?y.message:"Unknown error"),!1}finally{g.current===n&&T(!1)}},[i,m,k]),p=o.useCallback(async()=>{const r=i;w(!0),v(null);try{const n=await k("DELETE");return g.current!==r?!1:(b(n),m(n.resolved,n.sources),!0)}catch(n){return g.current===r&&v(n instanceof Error?n.message:"Unknown error"),!1}finally{g.current===r&&w(!1)}},[i,m,k]);return{preferences:S,isLoading:C,isSaving:j,isClearing:x,error:P,updatePreferences:A,clearPreferences:p,refetch:E}}const I=["locale","dateStyle","dateTime.dateStyle","dateTime.timeStyle","defaultCurrency"];function q(a,c){var t,m;switch(c){case"locale":return a==null?void 0:a.locale;case"dateStyle":return a==null?void 0:a.dateStyle;case"dateTime.dateStyle":return(t=a==null?void 0:a.dateTime)==null?void 0:t.dateStyle;case"dateTime.timeStyle":return(m=a==null?void 0:a.dateTime)==null?void 0:m.timeStyle;case"defaultCurrency":return a==null?void 0:a.defaultCurrency}}function Z(a){var m,s;const c=(m=a==null?void 0:a.dateTime)==null?void 0:m.dateStyle,t=(s=a==null?void 0:a.dateTime)==null?void 0:s.timeStyle;return{locale:a==null?void 0:a.locale,dateStyle:a==null?void 0:a.dateStyle,dateTime:c===void 0&&t===void 0?void 0:{dateStyle:c,timeStyle:t},defaultCurrency:a==null?void 0:a.defaultCurrency}}function Q({active:a,onClose:c}){var g,S,b,C,f,j,T;const{preferences:t,isLoading:m,isSaving:s,updatePreferences:i}=Y({enabled:a});if(!a)return null;if(!t)return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"py-2",children:e.jsx("div",{className:"flex min-h-36 items-center justify-center text-[12px] text-muted-foreground",children:m?"Loading preferences…":"Preferences unavailable."})}),e.jsxs(l.DialogFooter,{className:"justify-between sm:justify-between",children:[e.jsx(u.Button,{variant:"ghost",size:"xs",disabled:!0,children:"Reset display formats"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(u.Button,{variant:"outline",size:"xs",onClick:c,children:"Cancel"}),e.jsx(u.Button,{size:"xs",disabled:!0,children:"Save"})]})]})]});const h=[((g=t.stored)==null?void 0:g.locale)??"",((S=t.stored)==null?void 0:S.dateStyle)??"",((C=(b=t.stored)==null?void 0:b.dateTime)==null?void 0:C.dateStyle)??"",((j=(f=t.stored)==null?void 0:f.dateTime)==null?void 0:j.timeStyle)??"",((T=t.stored)==null?void 0:T.defaultCurrency)??""].join(":");return e.jsx(X,{preferences:t,isSaving:s,updatePreferences:i,onClose:c},h)}function X({preferences:a,isSaving:c,updatePreferences:t,onClose:m}){var b,C;const[s,i]=o.useState(()=>Z(a.stored)),h=(s.locale===void 0||L.canonicalizeSupportedLocale(s.locale)!==void 0)&&(s.defaultCurrency===void 0||L.canonicalizeSupportedCurrencyCode(s.defaultCurrency)!==void 0)&&(s.dateStyle===void 0||["short","medium","long"].includes(s.dateStyle))&&(((b=s.dateTime)==null?void 0:b.dateStyle)===void 0||["short","medium","long"].includes(s.dateTime.dateStyle))&&(((C=s.dateTime)==null?void 0:C.timeStyle)===void 0||["short","medium","long"].includes(s.dateTime.timeStyle)),g=async()=>{const f={...s.locale!==void 0?{locale:s.locale}:{},...s.dateStyle!==void 0?{dateStyle:s.dateStyle}:{},...s.dateTime?{dateTime:{...s.dateTime}}:{},...s.defaultCurrency!==void 0?{defaultCurrency:s.defaultCurrency}:{}},j=I.filter(w=>q(s,w)===void 0&&q(a.stored,w)!==void 0),T={...Object.keys(f).length>0?{set:f}:{},...j.length>0?{clear:j}:{}};(Object.keys(T).length===0?!0:await t(T))?(l.ue.success("Display format preferences saved."),m()):l.ue.error("Failed to save preferences. Please try again.")},S=async()=>{await t({clear:[...I]})?(l.ue.success("Display format preferences reset."),m()):l.ue.error("Failed to reset display format preferences. Please try again.")};return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"py-2",children:e.jsx(l.DisplayFormatPreferencesFields,{value:s,inherited:a.inherited,inheritedSources:a.inheritedSources,onChange:i,disabled:c})}),e.jsxs(l.DialogFooter,{className:"justify-between sm:justify-between",children:[e.jsx(u.Button,{variant:"ghost",size:"xs",onClick:S,disabled:c||a.stored===null,children:"Reset display formats"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(u.Button,{variant:"outline",size:"xs",onClick:m,disabled:c,children:"Cancel"}),e.jsx(u.Button,{size:"xs",onClick:g,disabled:c||!h,children:c?e.jsxs(e.Fragment,{children:[e.jsx(u.LoaderCircle,{className:"h-3.5 w-3.5 animate-spin"}),"Saving…"]}):"Save"})]})]})]})}function ee({open:a,onOpenChange:c}){const[t,m]=o.useState("display"),s=()=>c(!1);return e.jsx(l.Dialog,{open:a,onOpenChange:c,children:e.jsxs(l.DialogContent,{className:"rounded-control border-border/60 sm:max-w-[440px] sm:rounded-control",children:[e.jsxs(l.DialogHeader,{children:[e.jsx(l.DialogTitle,{className:"text-[15px]",children:"Report preferences"}),e.jsx(l.DialogDescription,{className:"text-[13px] leading-5",children:"Set how values and Calendar periods appear for you."})]}),e.jsxs(u.Tabs,{value:t,onValueChange:m,children:[e.jsxs(u.TabsList,{variant:"underline",className:"w-full justify-start",children:[e.jsx(u.TabsTrigger,{value:"display",children:"Display formats"}),e.jsx(u.TabsTrigger,{value:"calendar",children:"Calendar"})]}),e.jsx(u.TabsContent,{value:"display",children:e.jsx(Q,{active:a&&t==="display",onClose:s})}),e.jsx(u.TabsContent,{value:"calendar",children:e.jsx(J,{active:a&&t==="calendar",onClose:s})})]})]})})}exports.ReportPreferencesDialog=ee;
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),o=require("react"),l=require("./index-Cd8qGOXl.cjs"),u=require("./switch-B1mZx2k9.cjs"),V=require("./report-runtime-context-RFiWq4wK.cjs");require("./x-B6ghREd2.cjs");require("./saved-temporal-bucket-format-DNMtD77o.cjs");require("./validators-DcshgK7w.cjs");require("./analyze-result-contract-OgPk-zGu.cjs");const L=require("../value-format-preferences/index.cjs");function G(a={}){const{authToken:c,tokenProps:t}=l.useSemaphorContext(),m=u.useDashboardStore(p=>p.actions.applyResolvedCalendarPreferences),s=a.enabled??!0,i=(c==null?void 0:c.accessToken)??null,h=(t==null?void 0:t.apiServiceUrl)??null,[g,S]=o.useState(!1),[b,C]=o.useState(!1),[f,j]=o.useState(!1),[T,x]=o.useState(null),[w,P]=o.useState(null),v=o.useRef(i);v.current=i,o.useEffect(()=>{P(null),x(null),S(!1),C(!1),j(!1)},[i]);const N=o.useCallback(async p=>{const r=V.parseCalendarPreferencesResponse(await p.json());if(!r.ok)throw new Error("Calendar preferences response is invalid");return r.value},[]),k=o.useCallback(async()=>{if(!s||!i||!h)return;const p=i;S(!0),x(null);try{const r=await fetch(`${h}/v1/user-preferences/calendar`,{method:"GET",headers:{Authorization:`Bearer ${i}`}});if(!r.ok){const y=await r.json().catch(()=>({}));throw new Error(y.error||"Failed to fetch preferences")}const n=await N(r);v.current===p&&P(n)}catch(r){v.current===p&&x(r instanceof Error?r.message:"Unknown error")}finally{v.current===p&&S(!1)}},[i,h,s,N]);o.useEffect(()=>{s&&k()},[s,k]);const E=o.useCallback(async p=>{if(!i||!h)return x("Not authenticated"),!1;const r=i;C(!0),x(null);try{const n=await fetch(`${h}/v1/user-preferences/calendar`,{method:"PATCH",headers:{"Content-Type":"application/json",Authorization:`Bearer ${i}`},body:JSON.stringify(p)});if(!n.ok){const D=await n.json().catch(()=>({}));throw new Error(D.error||"Failed to update preferences")}const y=await N(n);return v.current!==r?!1:(P(y),m(y.resolved,y.sources),!0)}catch(n){return v.current===r&&x(n instanceof Error?n.message:"Unknown error"),!1}finally{v.current===r&&C(!1)}},[i,h,m,N]),A=o.useCallback(async()=>{if(!i||!h)return x("Not authenticated"),!1;const p=i;j(!0),x(null);try{const r=await fetch(`${h}/v1/user-preferences/calendar`,{method:"DELETE",headers:{Authorization:`Bearer ${i}`}});if(!r.ok){const y=await r.json().catch(()=>({}));throw new Error(y.error||"Failed to clear preferences")}const n=await N(r);return v.current!==p?!1:(P(n),m(n.resolved,n.sources),!0)}catch(r){return v.current===p&&x(r instanceof Error?r.message:"Unknown error"),!1}finally{v.current===p&&j(!1)}},[i,h,m,N]);return{preferences:w,isLoading:g,isSaving:b,isClearing:f,error:T,updatePreferences:E,clearPreferences:A,refetch:k}}const F=[{value:"America/New_York",label:"Eastern Time (US & Canada)"},{value:"America/Chicago",label:"Central Time (US & Canada)"},{value:"America/Denver",label:"Mountain Time (US & Canada)"},{value:"America/Los_Angeles",label:"Pacific Time (US & Canada)"},{value:"America/Phoenix",label:"Arizona"},{value:"America/Anchorage",label:"Alaska"},{value:"Pacific/Honolulu",label:"Hawaii"},{value:"Europe/London",label:"London"},{value:"Europe/Paris",label:"Paris, Berlin, Rome"},{value:"Asia/Tokyo",label:"Tokyo"},{value:"Asia/Shanghai",label:"Beijing, Shanghai"},{value:"Asia/Kolkata",label:"Mumbai, New Delhi"},{value:"Australia/Sydney",label:"Sydney"},{value:"UTC",label:"UTC"}],B=[{value:0,label:"Sunday"},{value:1,label:"Monday"},{value:6,label:"Saturday"}],R="text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground";function W(){try{const a=Intl;if(a.supportedValuesOf)return a.supportedValuesOf("timeZone")}catch{}return F.map(a=>a.value)}function H(a){if(!a)return"default";if(a.tz!==a.weekStart)return"inherited";switch(a.tz){case"viewer_tenant":return"tenant";case"viewer_organization":return"organization";case"system_default":return"system";case"session_initial":return"embedded";default:return"default"}}function U(a){const c=F.find(t=>t.value===a);return c?c.label:a}function K(a){const c=B.find(t=>t.value===a);return c?c.label:String(a)}function J({active:a,onClose:c}){const{preferences:t,isLoading:m,isSaving:s,isClearing:i,updatePreferences:h,clearPreferences:g}=G({enabled:a}),S=l.useCalendarContext(),b=(t==null?void 0:t.resolved.tz)||(S==null?void 0:S.tz)||"UTC",C=(t==null?void 0:t.resolved.weekStart)??(S==null?void 0:S.weekStart)??1,[f,j]=o.useState((t==null?void 0:t.stored)===null),[T,x]=o.useState(!1),[w,P]=o.useState(b),[v,N]=o.useState(C),[k,E]=o.useState(!1),A=o.useMemo(()=>W(),[]),p=o.useMemo(()=>A.filter(d=>!F.some(M=>M.value===d)),[A]),r=o.useMemo(()=>U(w),[w]),n=t!=null&&t.inherited?U(t.inherited.tz):"UTC",y=t!=null&&t.inherited?K(t.inherited.weekStart):"Monday",D=H(t==null?void 0:t.inheritedSources);o.useEffect(()=>{if(!a){x(!1);return}T||(t&&j(t.stored===null),P(b),N(C))},[a,T,t,b,C]);const O=async()=>{if(m){l.ue.error("Preferences are still loading. Please try again.");return}f?await g()?(l.ue.success("Now using default settings."),c()):l.ue.error("Failed to save preferences. Please try again."):await h({tz:w,weekStart:v})?(l.ue.success("Preferences saved."),c()):l.ue.error("Failed to save preferences. Please try again.")},_=()=>{c()},z=s||i,$=z||m;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-4 py-1",children:[e.jsxs(l.RadioGroup,{value:f?"defaults":"custom",onValueChange:d=>{x(!0),j(d==="defaults")},className:"space-y-0.5",children:[e.jsxs("label",{htmlFor:"mode-defaults",className:u.cn("flex cursor-pointer items-start gap-2 rounded-control px-2 py-1.5 hover:bg-muted/50",f&&"bg-muted/50"),onClick:()=>{x(!0),j(!0)},children:[e.jsx(l.RadioGroupItem,{value:"defaults",id:"mode-defaults",className:"mt-0.5"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("p",{className:"text-[13px] font-medium text-foreground",children:["Use ",D," defaults"]}),e.jsxs("p",{className:"text-[12px] text-muted-foreground",children:[n,", week starts ",y]})]})]}),e.jsxs("label",{htmlFor:"mode-custom",className:u.cn("flex cursor-pointer items-start gap-2 rounded-control px-2 py-1.5 hover:bg-muted/50",!f&&"bg-muted/50"),onClick:()=>{x(!0),j(!1)},children:[e.jsx(l.RadioGroupItem,{value:"custom",id:"mode-custom",className:"mt-0.5"}),e.jsx("p",{className:"flex-1 text-[13px] font-medium text-foreground",children:"Use custom settings"})]})]}),e.jsxs("div",{className:u.cn("space-y-4 border-t border-border/60 pt-4 transition-opacity",f&&"pointer-events-none opacity-50"),children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(u.Label,{className:R,children:"Timezone"}),e.jsxs(u.Popover,{open:k,onOpenChange:E,modal:!0,children:[e.jsx(u.PopoverTrigger,{asChild:!0,children:e.jsxs(u.Button,{variant:"outline",size:"xs",role:"combobox","aria-expanded":k,className:"w-full justify-between text-[12px] font-normal",disabled:f,children:[e.jsx("span",{className:"truncate",children:r}),e.jsx(l.ChevronsUpDown,{className:"ml-2 h-3.5 w-3.5 shrink-0 opacity-50"})]})}),e.jsx(u.PopoverContent,{className:"z-50 w-[--radix-popover-trigger-width] p-0",align:"start",children:e.jsxs(l.Command,{className:"overflow-visible",children:[e.jsx(l.CommandInput,{placeholder:"Search timezones…"}),e.jsxs(l.CommandList,{children:[e.jsx(l.CommandEmpty,{children:"No timezone found."}),e.jsx(l.CommandGroup,{heading:"Common",children:F.map(d=>e.jsxs(l.CommandItem,{value:`${d.value} ${d.label}`,onSelect:()=>{x(!0),P(d.value),E(!1)},children:[e.jsx(u.Check,{className:u.cn("h-3.5 w-3.5",w===d.value?"opacity-100":"opacity-0")}),e.jsx("span",{className:"flex-1",children:d.label}),e.jsx("span",{className:"text-[11px] text-muted-foreground",children:d.value})]},d.value))}),e.jsx(l.CommandSeparator,{}),e.jsx(l.CommandGroup,{heading:"All timezones",children:p.map(d=>e.jsxs(l.CommandItem,{value:d,onSelect:()=>{x(!0),P(d),E(!1)},children:[e.jsx(u.Check,{className:u.cn("h-3.5 w-3.5",w===d?"opacity-100":"opacity-0")}),d]},d))})]})]})})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(u.Label,{className:R,children:"Week starts on"}),e.jsx(l.RadioGroup,{value:String(v),onValueChange:d=>{x(!0),N(Number(d))},className:"flex gap-4",disabled:f,children:B.map(d=>e.jsxs("label",{htmlFor:`week-start-${d.value}`,className:u.cn("flex cursor-pointer items-center gap-2 text-[13px]",f&&"cursor-not-allowed"),children:[e.jsx(l.RadioGroupItem,{value:String(d.value),id:`week-start-${d.value}`,disabled:f}),d.label]},d.value))})]})]})]}),e.jsxs(l.DialogFooter,{children:[e.jsx(u.Button,{variant:"outline",size:"xs",onClick:_,disabled:z,children:"Cancel"}),e.jsx(u.Button,{size:"xs",onClick:O,disabled:$,children:z?e.jsxs(e.Fragment,{children:[e.jsx(u.LoaderCircle,{className:"h-3.5 w-3.5 animate-spin"}),"Saving…"]}):"Save"})]})]})}function Y(a={}){const{authToken:c,tokenProps:t}=l.useSemaphorContext(),m=u.useDashboardStore(r=>r.actions.applyResolvedValueFormatPreferences),s=a.enabled??!0,i=(c==null?void 0:c.accessToken)??null,h=(t==null?void 0:t.apiServiceUrl)??null,g=o.useRef(i);g.current=i;const[S,b]=o.useState(null),[C,f]=o.useState(!1),[j,T]=o.useState(!1),[x,w]=o.useState(!1),[P,v]=o.useState(null);o.useEffect(()=>{b(null),v(null),f(!1),T(!1),w(!1)},[i]);const N=o.useCallback(async r=>{const n=L.parseValueFormatPreferencesResponse(await r.json());if(!n.ok)throw new Error("Value format preferences response is invalid");return n.value},[]),k=o.useCallback(async(r,n)=>{if(!i||!h)throw new Error("Not authenticated");const y=await fetch(`${h}/v1/user-preferences/value-format`,{method:r,headers:{Authorization:`Bearer ${i}`,...n?{"Content-Type":"application/json"}:{}},body:n?JSON.stringify(n):void 0});if(!y.ok){const D=await y.json().catch(()=>({}));throw new Error(D.error||"Failed to update preferences")}return N(y)},[i,h,N]),E=o.useCallback(async()=>{if(!s||!i||!h)return;const r=i;f(!0),v(null);try{const n=await k("GET");g.current===r&&b(n)}catch(n){g.current===r&&v(n instanceof Error?n.message:"Unknown error")}finally{g.current===r&&f(!1)}},[i,h,s,k]);o.useEffect(()=>{s&&E()},[s,E]);const A=o.useCallback(async r=>{const n=i;T(!0),v(null);try{const y=await k("PATCH",r);return g.current!==n?!1:(b(y),m(y.resolved,y.sources),!0)}catch(y){return g.current===n&&v(y instanceof Error?y.message:"Unknown error"),!1}finally{g.current===n&&T(!1)}},[i,m,k]),p=o.useCallback(async()=>{const r=i;w(!0),v(null);try{const n=await k("DELETE");return g.current!==r?!1:(b(n),m(n.resolved,n.sources),!0)}catch(n){return g.current===r&&v(n instanceof Error?n.message:"Unknown error"),!1}finally{g.current===r&&w(!1)}},[i,m,k]);return{preferences:S,isLoading:C,isSaving:j,isClearing:x,error:P,updatePreferences:A,clearPreferences:p,refetch:E}}const I=["locale","dateStyle","dateTime.dateStyle","dateTime.timeStyle","defaultCurrency"];function q(a,c){var t,m;switch(c){case"locale":return a==null?void 0:a.locale;case"dateStyle":return a==null?void 0:a.dateStyle;case"dateTime.dateStyle":return(t=a==null?void 0:a.dateTime)==null?void 0:t.dateStyle;case"dateTime.timeStyle":return(m=a==null?void 0:a.dateTime)==null?void 0:m.timeStyle;case"defaultCurrency":return a==null?void 0:a.defaultCurrency}}function Z(a){var m,s;const c=(m=a==null?void 0:a.dateTime)==null?void 0:m.dateStyle,t=(s=a==null?void 0:a.dateTime)==null?void 0:s.timeStyle;return{locale:a==null?void 0:a.locale,dateStyle:a==null?void 0:a.dateStyle,dateTime:c===void 0&&t===void 0?void 0:{dateStyle:c,timeStyle:t},defaultCurrency:a==null?void 0:a.defaultCurrency}}function Q({active:a,onClose:c}){var g,S,b,C,f,j,T;const{preferences:t,isLoading:m,isSaving:s,updatePreferences:i}=Y({enabled:a});if(!a)return null;if(!t)return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"py-2",children:e.jsx("div",{className:"flex min-h-36 items-center justify-center text-[12px] text-muted-foreground",children:m?"Loading preferences…":"Preferences unavailable."})}),e.jsxs(l.DialogFooter,{className:"justify-between sm:justify-between",children:[e.jsx(u.Button,{variant:"ghost",size:"xs",disabled:!0,children:"Reset display formats"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(u.Button,{variant:"outline",size:"xs",onClick:c,children:"Cancel"}),e.jsx(u.Button,{size:"xs",disabled:!0,children:"Save"})]})]})]});const h=[((g=t.stored)==null?void 0:g.locale)??"",((S=t.stored)==null?void 0:S.dateStyle)??"",((C=(b=t.stored)==null?void 0:b.dateTime)==null?void 0:C.dateStyle)??"",((j=(f=t.stored)==null?void 0:f.dateTime)==null?void 0:j.timeStyle)??"",((T=t.stored)==null?void 0:T.defaultCurrency)??""].join(":");return e.jsx(X,{preferences:t,isSaving:s,updatePreferences:i,onClose:c},h)}function X({preferences:a,isSaving:c,updatePreferences:t,onClose:m}){var b,C;const[s,i]=o.useState(()=>Z(a.stored)),h=(s.locale===void 0||L.canonicalizeSupportedLocale(s.locale)!==void 0)&&(s.defaultCurrency===void 0||L.canonicalizeSupportedCurrencyCode(s.defaultCurrency)!==void 0)&&(s.dateStyle===void 0||["short","medium","long"].includes(s.dateStyle))&&(((b=s.dateTime)==null?void 0:b.dateStyle)===void 0||["short","medium","long"].includes(s.dateTime.dateStyle))&&(((C=s.dateTime)==null?void 0:C.timeStyle)===void 0||["short","medium","long"].includes(s.dateTime.timeStyle)),g=async()=>{const f={...s.locale!==void 0?{locale:s.locale}:{},...s.dateStyle!==void 0?{dateStyle:s.dateStyle}:{},...s.dateTime?{dateTime:{...s.dateTime}}:{},...s.defaultCurrency!==void 0?{defaultCurrency:s.defaultCurrency}:{}},j=I.filter(w=>q(s,w)===void 0&&q(a.stored,w)!==void 0),T={...Object.keys(f).length>0?{set:f}:{},...j.length>0?{clear:j}:{}};(Object.keys(T).length===0?!0:await t(T))?(l.ue.success("Display format preferences saved."),m()):l.ue.error("Failed to save preferences. Please try again.")},S=async()=>{await t({clear:[...I]})?(l.ue.success("Display format preferences reset."),m()):l.ue.error("Failed to reset display format preferences. Please try again.")};return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"py-2",children:e.jsx(l.DisplayFormatPreferencesFields,{value:s,inherited:a.inherited,inheritedSources:a.inheritedSources,onChange:i,disabled:c})}),e.jsxs(l.DialogFooter,{className:"justify-between sm:justify-between",children:[e.jsx(u.Button,{variant:"ghost",size:"xs",onClick:S,disabled:c||a.stored===null,children:"Reset display formats"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(u.Button,{variant:"outline",size:"xs",onClick:m,disabled:c,children:"Cancel"}),e.jsx(u.Button,{size:"xs",onClick:g,disabled:c||!h,children:c?e.jsxs(e.Fragment,{children:[e.jsx(u.LoaderCircle,{className:"h-3.5 w-3.5 animate-spin"}),"Saving…"]}):"Save"})]})]})]})}function ee({open:a,onOpenChange:c}){const[t,m]=o.useState("display"),s=()=>c(!1);return e.jsx(l.Dialog,{open:a,onOpenChange:c,children:e.jsxs(l.DialogContent,{className:"rounded-control border-border/60 sm:max-w-[440px] sm:rounded-control",children:[e.jsxs(l.DialogHeader,{children:[e.jsx(l.DialogTitle,{className:"text-[15px]",children:"Report preferences"}),e.jsx(l.DialogDescription,{className:"text-[13px] leading-5",children:"Set how values and Calendar periods appear for you."})]}),e.jsxs(u.Tabs,{value:t,onValueChange:m,children:[e.jsxs(u.TabsList,{variant:"underline",className:"w-full justify-start",children:[e.jsx(u.TabsTrigger,{value:"display",children:"Display formats"}),e.jsx(u.TabsTrigger,{value:"calendar",children:"Calendar"})]}),e.jsx(u.TabsContent,{value:"display",children:e.jsx(Q,{active:a&&t==="display",onClose:s})}),e.jsx(u.TabsContent,{value:"calendar",children:e.jsx(J,{active:a&&t==="calendar",onClose:s})})]})]})})}exports.ReportPreferencesDialog=ee;
|
package/dist/dashboard/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../chunks/index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../chunks/index-Cd8qGOXl.cjs"),e=require("../chunks/common-types-C1IM7gao.cjs");exports.Dashboard=o.Dashboard;exports.CONTROL_CARD_DEFAULT_VALUE=e.CONTROL_CARD_DEFAULT_VALUE;exports.EMPTY_SELECTION=e.EMPTY_SELECTION;
|
package/dist/dashboard/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),p=require("react"),An=require("react-dom/client"),k=require("../chunks/index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),p=require("react"),An=require("react-dom/client"),k=require("../chunks/index-Cd8qGOXl.cjs"),w=require("../chunks/switch-B1mZx2k9.cjs"),Ze=require("../data-app-builder-browser-runtime/index.cjs"),te=require("../chunks/x-B6ghREd2.cjs"),Cn=require("../chunks/save-3dYRmehL.cjs"),Rn=require("../chunks/mouse-pointer-2-DX4A_XZw.cjs"),tt=require("../chunks/search-BqqhaMx9.cjs");function Tr(t){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const d=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(s,a,d.get?d:{enumerable:!0,get:()=>t[a]})}}return s.default=t,Object.freeze(s)}const Bn=Tr(p),Dn=Tr(An);/**
|
|
2
2
|
* @license lucide-react v0.453.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -2,7 +2,7 @@ import { jsx as r, jsxs as c, Fragment as re } from "react/jsx-runtime";
|
|
|
2
2
|
import * as Zn from "react";
|
|
3
3
|
import { useContext as qn, useState as x, useRef as oe, useMemo as je, useEffect as W, useCallback as Ot } from "react";
|
|
4
4
|
import * as Xn from "react-dom/client";
|
|
5
|
-
import { aM as ea, aN as ta, aO as Ir, aP as jr, aQ as zr, aR as ra, aS as Wr, aT as Hr, aU as Jr, aV as Vr, aW as _r, aX as Ur, aY as Gr, aZ as na, a_ as aa, a$ as oa, b0 as Ht, b1 as on, R as Kr, b2 as sa, b3 as Vt, b4 as sn, b5 as ia, b6 as la } from "../chunks/index-
|
|
5
|
+
import { aM as ea, aN as ta, aO as Ir, aP as jr, aQ as zr, aR as ra, aS as Wr, aT as Hr, aU as Jr, aV as Vr, aW as _r, aX as Ur, aY as Gr, aZ as na, a_ as aa, a$ as oa, b0 as Ht, b1 as on, R as Kr, b2 as sa, b3 as Vt, b4 as sn, b5 as ia, b6 as la } from "../chunks/index-DrdF7QR7.js";
|
|
6
6
|
import { B as H, P as it, a as lt, b as dt, _ as da, $ as ca, a0 as ua, a1 as pa, a2 as ha, L as me, R as ma, d as _t } from "../chunks/switch-C8NihGV4.js";
|
|
7
7
|
import { loadSemaphorBrowserRuntime as ot } from "../data-app-builder-browser-runtime/index.js";
|
|
8
8
|
import { c as Ve, X as He } from "../chunks/x-CXDkqdur.js";
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-CneWIz__.cjs"),u=require("./chunks/common-types-C1IM7gao.cjs"),_=require("./chunks/report-preferences-dialog-cSMJYqns.cjs"),i=require("react/jsx-runtime"),r=require("./chunks/switch-B1mZx2k9.cjs"),h=require("react"),P=require("./chunks/token-types-CoHsSJ4E.cjs"),l=require("./chunks/dashboard-briefing-launcher-ZfuxdRN2.cjs"),N=require("./chunks/use-debounced-dirty-check-XHSwAefL.cjs");require("./value-format-preferences/index.cjs");require("./chunks/validators-DcshgK7w.cjs");const R=require("./chunks/report-runtime-context-RFiWq4wK.cjs"),T=require("./chunks/pivot-result-identity-DRUlTWUq.cjs");require("./chunks/analyze-result-contract-OgPk-zGu.cjs");require("./chunks/temporal-bucket-authoring-DSpzgXHc.cjs");require("./chunks/saved-temporal-bucket-format-DNMtD77o.cjs");require("react-dom");require("./chunks/appearance-context-DhyjbQk1.cjs");require("./chunks/color-CyB5o13F.cjs");require("./chunks/index-ByFbacH7.cjs");const B=require("./chunks/normalize-dashboard-for-dirty-check-BXRUMVb2.cjs"),w=require("./chunks/x-B6ghREd2.cjs");require("./chunks/appearance-runtime-provider-BgNYdUYH.cjs");function L(a){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const o in a)if(o!=="default"){const d=Object.getOwnPropertyDescriptor(a,o);Object.defineProperty(t,o,d.get?d:{enumerable:!0,get:()=>a[o]})}}return t.default=a,Object.freeze(t)}const m=L(h);function M(a){const{displayPreferences:t,cardId:o,...d}=a,n={...d,id:a.dashboardId};return i.jsx(e.ErrorBoundary,{FallbackComponent:e.Fallback,children:i.jsxs(e.SemaphorContextProvider,{dashboardProps:n,children:[i.jsx(e.SemaphorReadyIndicator,{componentType:"visual",componentId:a.cardId}),i.jsx(e.UXProvider,{appearance:a.appearance,children:i.jsx(e.DisplayPreferencesProvider,{displayPreferences:t,children:i.jsx(e.Container,{type:"visual",cardId:o,...n,children:i.jsx(j,{cardId:o})})})})]})})}function j({cardId:a}){const t=r.useDashboardStore(n=>{var c;return(c=n.dashboard)==null?void 0:c.sheets}),{card:o,frame:d}=h.useMemo(()=>{const n=t==null?void 0:t.flatMap(s=>s.frames),c=n==null?void 0:n.flatMap(s=>s==null?void 0:s.cards),D=c==null?void 0:c.find(s=>(s==null?void 0:s.id)===a),E=n==null?void 0:n.find(s=>{var C;return(C=s==null?void 0:s.cards)==null?void 0:C.find(g=>(g==null?void 0:g.id)===a)});return{card:D,frame:E}},[t,a]);return!o||!d?i.jsx(e.FallbackVisual,{error:new Error("Card not found"),resetErrorBoundary:()=>{},customerFacingMessage:`Card not found with ID: ${a}`}):i.jsx("main",{className:"flex h-full grow flex-col",children:i.jsx(e.ErrorBoundary,{FallbackComponent:({error:n,resetErrorBoundary:c})=>i.jsx(e.FallbackVisual,{error:n,resetErrorBoundary:c,customerFacingMessage:"Error creating visual. Please try again."}),children:i.jsx(e.DashboardCard,{card:o,frame:d})})})}function I(a,t,o,d){h.useEffect(()=>{a&&!o&&t&&d(e.cloneDeep(t))},[a,o,t,d])}function q({name:a,items:t,value:o,onChange:d,isLoading:n,isError:c,refetch:D,className:E,icon:s,showNone:C=!1}){const g=m.useRef(null),[y,b]=m.useState(!1),[A,S]=m.useState("100%"),x=C?[...t||[],{id:"none",name:"None"}]:t;m.useLayoutEffect(()=>{g.current&&S(g.current.offsetWidth)},[]);function F(){var f;return n?"Loading...":c?"Error":o?(f=t==null?void 0:t.find(p=>p.id===o))==null?void 0:f.name:`Select ${a}`}function v(f,p){d(p),b(!1)}return i.jsxs(r.Popover,{open:y,onOpenChange:b,children:[i.jsx(r.PopoverTrigger,{asChild:!0,children:i.jsxs(r.Button,{ref:g,variant:"outline",role:"combobox","aria-expanded":y,className:r.cn("flex h-9 w-full justify-between",E),children:[i.jsxs("div",{className:"flex items-center gap-2",children:[s&&i.jsx("div",{className:"mr-2",children:s}),i.jsx("span",{className:"max-w-[150px] overflow-hidden truncate text-ellipsis whitespace-nowrap",children:F()})]}),i.jsx(w.ChevronDown,{className:"size-4 opacity-50"})]})}),i.jsx(r.PopoverContent,{className:"w-full p-0",style:{minWidth:A},children:i.jsxs(e.Command,{children:[i.jsxs("div",{className:"flex h-9 items-center justify-between border-b pr-1",children:[i.jsx(e.CommandInput,{className:"h-9",placeholder:"Search..."}),i.jsx(e.IconButton,{className:"h-7",onClick:D,children:i.jsx(e.RefreshCw,{className:r.cn("size-3.5 opacity-50",n&&"animate-spin")})})]}),i.jsxs(e.CommandList,{children:[i.jsxs(e.CommandEmpty,{children:["No ",a==null?void 0:a.toLowerCase()," found."]}),i.jsx(e.CommandGroup,{children:x==null?void 0:x.map(f=>i.jsx(e.CommandItem,{className:"overflow-x-auto",value:f.name,onSelect:p=>v(p,f.id),children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(r.Check,{className:r.cn("size-4",o===f.id?"opacity-100":"opacity-0")}),i.jsx("div",{title:f.name,children:f.name})]})},f.id))})]})]})})]})}function U(a,t){h.useEffect(()=>(a&&t&&(window.__SEMAPHOR_PRINT_STATE__={...t}),()=>{a&&window.__SEMAPHOR_PRINT_STATE__&&delete window.__SEMAPHOR_PRINT_STATE__}),[a,t])}exports.BriefingAuthor=e.BriefingAuthor;exports.BriefingAuthorDialog=e.BriefingAuthorDialog;exports.BriefingUiCapabilitiesBoundary=e.BriefingUiCapabilitiesBoundary;exports.BriefingUiCapabilitiesProvider=e.BriefingUiCapabilitiesProvider;exports.BriefingsApiError=e.BriefingsApiError;exports.CardSummary=e.CardSummary;exports.Dashboard=e.Dashboard;exports.DashboardCreateDialogBase=e.DashboardCreateDialogBase;exports.DashboardExportDialog=e.DashboardExportDialog;exports.DashboardWC=e.DashboardWC;exports.DisplayFormatPreferencesFields=e.DisplayFormatPreferencesFields;exports.ExportError=e.ExportError;exports.MatrixTableVisual=e.MatrixTableVisual;exports.ResourceType=e.ResourceType;exports.SemaphorContextProvider=e.SemaphorContextProvider;exports.SemaphorDataProvider=e.SemaphorQueryClient;exports.SemaphorQueryClient=e.SemaphorQueryClient;exports.ShareDialog=e.ShareDialog;exports.SummaryCard=e.SummaryCard;exports.Surfboard=e.DashboardPlus;exports.applyBriefingFormPatch=e.applyBriefingFormPatch;exports.briefingFormDraftToCreateRequest=e.briefingFormDraftToCreateRequest;exports.briefingFormDraftToUpdateRequest=e.briefingFormDraftToUpdateRequest;exports.briefingToFormDraft=e.briefingToFormDraft;exports.cancelBriefingPreviewRun=e.cancelBriefingPreviewRun;exports.cancelBriefingRun=e.cancelBriefingRun;exports.cancelExport=e.cancelExport;exports.cloneDeep=e.cloneDeep;exports.createBriefing=e.createBriefing;exports.createBriefingFormDraft=e.createBriefingFormDraft;exports.createExport=e.createExport;exports.deleteBriefing=e.deleteBriefing;exports.deleteBriefingRun=e.deleteBriefingRun;exports.downloadDocumentPdf=e.downloadDocumentPdf;exports.downloadPdf=e.downloadPdf;exports.formatFileSize=e.formatFileSize;exports.getBriefing=e.getBriefing;exports.getBriefingArtifact=e.getBriefingArtifact;exports.getBriefingEvidence=e.getBriefingEvidence;exports.getBriefingPreviewRun=e.getBriefingPreviewRun;exports.getBriefingRun=e.getBriefingRun;exports.getDownloadUrl=e.getDownloadUrl;exports.getExportStatus=e.getExportStatus;exports.getExports=e.getExports;exports.isExportComplete=e.isExportComplete;exports.isExportInProgress=e.isExportInProgress;exports.listBriefingRuns=e.listBriefingRuns;exports.listBriefingTenantSummaries=e.listBriefingTenantSummaries;exports.listBriefings=e.listBriefings;exports.pauseBriefing=e.pauseBriefing;exports.polishBriefingText=e.polishBriefingText;exports.previewBriefingPlan=e.previewBriefingPlan;exports.resumeBriefing=e.resumeBriefing;exports.runBriefingNow=e.runBriefingNow;exports.runBriefingPreview=e.runBriefingPreview;exports.updateBriefing=e.updateBriefing;exports.useActiveExports=e.useActiveExports;exports.useAddNewFrame=e.useAddNewFrame;exports.useBriefingUiCapabilities=e.useBriefingUiCapabilities;exports.useCard=e.useCard;exports.useCardSummary=e.useCardSummary;exports.useDashboardById=e.useDashboardById;exports.useDashboardQuery=e.useDashboardQuery;exports.useDashboardSummary=e.useDashboardSummary;exports.useDataColumns=e.useDataColumns;exports.useDateFilterHook=e.useDateFilterHook;exports.useEditorAside=e.useEditorAside;exports.useExportActions=e.useExportActions;exports.useExportStore=e.useExportStore;exports.useInProgressExportsCount=e.useInProgressExportsCount;exports.useManagementStore=e.useManagementStore;exports.useResourceManagement=e.useResourceManagement;exports.useTextFilterHook=e.useTextFilterHook;exports.validateBriefingFormDraft=e.validateBriefingFormDraft;exports.CALCULATED_FIELD_ENTITY_MARKER=u.CALCULATED_FIELD_ENTITY_MARKER;exports.CONTROL_CARD_DEFAULT_VALUE=u.CONTROL_CARD_DEFAULT_VALUE;exports.DATE_FORMAT_VALUES=u.DATE_FORMAT_VALUES;exports.EMPTY_SELECTION=u.EMPTY_SELECTION;exports.LEGACY_CALCULATED_FIELD_ENTITY_MARKER=u.LEGACY_CALCULATED_FIELD_ENTITY_MARKER;exports.PivotMarkerEnum=u.PivotMarkerEnum;exports.getFieldRuntimeColumnName=u.getFieldRuntimeColumnName;exports.hasCalculatedFieldMarker=u.hasCalculatedFieldMarker;exports.hasCalculatedFormulaInputs=u.hasCalculatedFormulaInputs;exports.hasSyntheticCalculatedFieldOwner=u.hasSyntheticCalculatedFieldOwner;exports.isCalculatedDimension=u.isCalculatedDimension;exports.isCalculatedField=u.isCalculatedField;exports.isCalculatedMetric=u.isCalculatedMetric;exports.ReportPreferencesDialog=_.ReportPreferencesDialog;exports.createEmptyKpiConfig=r.createEmptyKpiConfig;exports.createSqlGenConfig=r.createSqlGenConfig;exports.emitDashboardLoad=r.emitDashboardLoad;exports.emitDashboardUnload=r.emitDashboardUnload;exports.fmt=r.fmt;exports.getColumnDataType=r.getColumnDataType;exports.getFilterValueType=r.getFilterValueType;exports.getFormattedTableNameForQuery=r.getFormattedTableNameForQuery;exports.getQualifiedTableName=r.getQualifiedTableName;exports.getSql=r.getSql;exports.invalidateToken=r.invalidateToken;exports.isBooleanDataType=r.isBooleanDataType;exports.isColumnInSqlGen=r.isColumnInSqlGen;exports.isDateDataType=r.isDateDataType;exports.isNumberDataType=r.isNumberDataType;exports.isTextDataType=r.isTextDataType;exports.resolveDataType=r.resolveDataType;exports.resolveDatamodelName=r.resolveDatamodelName;exports.useCurrentActiveCard=r.useCurrentActiveCard;exports.useCurrentCardConfig=r.useCurrentCardConfig;exports.useCurrentSheetActiveCards=r.useCurrentSheetActiveCards;exports.useDashboardActions=r.useDashboardActions;exports.useDashboardStore=r.useDashboardStore;exports.useEditorActions=r.useEditorActions;exports.useEditorStore=r.useEditorStore;exports.DEFAULT_SEMANTIC_DOMAIN_ACCESS=P.DEFAULT_SEMANTIC_DOMAIN_ACCESS;exports.AdvancedModeToggle=l.AdvancedModeToggle;exports.DashboardBriefingLauncher=l.DashboardBriefingLauncher;exports.DashboardControlsSettings=l.DashboardControlsSettings;exports.DashboardFilterControlsButton=l.DashboardFilterControlsButton;exports.DashboardFilterControlsLauncher=l.DashboardFilterControlsLauncher;exports.DocumentControlsSettings=l.DocumentControlsSettings;exports.ExportNotificationItem=l.ExportNotificationItem;exports.ExportNotificationList=l.ExportNotificationList;exports.NotificationBell=l.NotificationBell;exports.UnsavedChangesAlert=l.UnsavedChangesAlert;exports.VisualEditingControls=l.VisualEditingControls;exports.VisualsLibraryDialog=l.VisualsLibraryDialog;exports.WatchDashboardButton=l.WatchDashboardButton;exports.useExportPolling=l.useExportPolling;exports.useExportRecovery=l.useExportRecovery;exports.useDebouncedDirtyCheck=N.useDebouncedDirtyCheck;exports.DEFAULT_CALENDAR_CONTEXT=R.DEFAULT_CALENDAR_CONTEXT;exports.resolveQueryColumnKeyMapEntry=T.resolveQueryColumnKeyMapEntry;exports.resolveUniqueQueryColumnKeyMapEntry=T.resolveUniqueQueryColumnKeyMapEntry;exports.normalizeDashboardForDirtyCheck=B.normalizeDashboardForDirtyCheck;exports.serializeDashboardForDirtyCheck=B.serializeDashboardForDirtyCheck;exports.Combobox=q;exports.Visual=M;exports.useExposePrintState=U;exports.usePristineSnapshotInitializer=I;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-Cd8qGOXl.cjs"),u=require("./chunks/common-types-C1IM7gao.cjs"),_=require("./chunks/report-preferences-dialog-DW40ECz1.cjs"),i=require("react/jsx-runtime"),r=require("./chunks/switch-B1mZx2k9.cjs"),h=require("react"),P=require("./chunks/token-types-CoHsSJ4E.cjs"),l=require("./chunks/dashboard-briefing-launcher-CXHq6ime.cjs"),N=require("./chunks/use-debounced-dirty-check-XHSwAefL.cjs");require("./value-format-preferences/index.cjs");require("./chunks/validators-DcshgK7w.cjs");const R=require("./chunks/report-runtime-context-RFiWq4wK.cjs"),T=require("./chunks/pivot-result-identity-DRUlTWUq.cjs");require("./chunks/analyze-result-contract-OgPk-zGu.cjs");require("./chunks/temporal-bucket-authoring-DSpzgXHc.cjs");require("./chunks/saved-temporal-bucket-format-DNMtD77o.cjs");require("react-dom");require("./chunks/appearance-context-DhyjbQk1.cjs");require("./chunks/color-CyB5o13F.cjs");require("./chunks/index-ByFbacH7.cjs");const B=require("./chunks/normalize-dashboard-for-dirty-check-BXRUMVb2.cjs"),w=require("./chunks/x-B6ghREd2.cjs");require("./chunks/appearance-runtime-provider-BgNYdUYH.cjs");function L(a){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const o in a)if(o!=="default"){const d=Object.getOwnPropertyDescriptor(a,o);Object.defineProperty(t,o,d.get?d:{enumerable:!0,get:()=>a[o]})}}return t.default=a,Object.freeze(t)}const m=L(h);function M(a){const{displayPreferences:t,cardId:o,...d}=a,n={...d,id:a.dashboardId};return i.jsx(e.ErrorBoundary,{FallbackComponent:e.Fallback,children:i.jsxs(e.SemaphorContextProvider,{dashboardProps:n,children:[i.jsx(e.SemaphorReadyIndicator,{componentType:"visual",componentId:a.cardId}),i.jsx(e.UXProvider,{appearance:a.appearance,children:i.jsx(e.DisplayPreferencesProvider,{displayPreferences:t,children:i.jsx(e.Container,{type:"visual",cardId:o,...n,children:i.jsx(j,{cardId:o})})})})]})})}function j({cardId:a}){const t=r.useDashboardStore(n=>{var c;return(c=n.dashboard)==null?void 0:c.sheets}),{card:o,frame:d}=h.useMemo(()=>{const n=t==null?void 0:t.flatMap(s=>s.frames),c=n==null?void 0:n.flatMap(s=>s==null?void 0:s.cards),D=c==null?void 0:c.find(s=>(s==null?void 0:s.id)===a),E=n==null?void 0:n.find(s=>{var C;return(C=s==null?void 0:s.cards)==null?void 0:C.find(g=>(g==null?void 0:g.id)===a)});return{card:D,frame:E}},[t,a]);return!o||!d?i.jsx(e.FallbackVisual,{error:new Error("Card not found"),resetErrorBoundary:()=>{},customerFacingMessage:`Card not found with ID: ${a}`}):i.jsx("main",{className:"flex h-full grow flex-col",children:i.jsx(e.ErrorBoundary,{FallbackComponent:({error:n,resetErrorBoundary:c})=>i.jsx(e.FallbackVisual,{error:n,resetErrorBoundary:c,customerFacingMessage:"Error creating visual. Please try again."}),children:i.jsx(e.DashboardCard,{card:o,frame:d})})})}function I(a,t,o,d){h.useEffect(()=>{a&&!o&&t&&d(e.cloneDeep(t))},[a,o,t,d])}function q({name:a,items:t,value:o,onChange:d,isLoading:n,isError:c,refetch:D,className:E,icon:s,showNone:C=!1}){const g=m.useRef(null),[y,b]=m.useState(!1),[A,S]=m.useState("100%"),x=C?[...t||[],{id:"none",name:"None"}]:t;m.useLayoutEffect(()=>{g.current&&S(g.current.offsetWidth)},[]);function F(){var f;return n?"Loading...":c?"Error":o?(f=t==null?void 0:t.find(p=>p.id===o))==null?void 0:f.name:`Select ${a}`}function v(f,p){d(p),b(!1)}return i.jsxs(r.Popover,{open:y,onOpenChange:b,children:[i.jsx(r.PopoverTrigger,{asChild:!0,children:i.jsxs(r.Button,{ref:g,variant:"outline",role:"combobox","aria-expanded":y,className:r.cn("flex h-9 w-full justify-between",E),children:[i.jsxs("div",{className:"flex items-center gap-2",children:[s&&i.jsx("div",{className:"mr-2",children:s}),i.jsx("span",{className:"max-w-[150px] overflow-hidden truncate text-ellipsis whitespace-nowrap",children:F()})]}),i.jsx(w.ChevronDown,{className:"size-4 opacity-50"})]})}),i.jsx(r.PopoverContent,{className:"w-full p-0",style:{minWidth:A},children:i.jsxs(e.Command,{children:[i.jsxs("div",{className:"flex h-9 items-center justify-between border-b pr-1",children:[i.jsx(e.CommandInput,{className:"h-9",placeholder:"Search..."}),i.jsx(e.IconButton,{className:"h-7",onClick:D,children:i.jsx(e.RefreshCw,{className:r.cn("size-3.5 opacity-50",n&&"animate-spin")})})]}),i.jsxs(e.CommandList,{children:[i.jsxs(e.CommandEmpty,{children:["No ",a==null?void 0:a.toLowerCase()," found."]}),i.jsx(e.CommandGroup,{children:x==null?void 0:x.map(f=>i.jsx(e.CommandItem,{className:"overflow-x-auto",value:f.name,onSelect:p=>v(p,f.id),children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(r.Check,{className:r.cn("size-4",o===f.id?"opacity-100":"opacity-0")}),i.jsx("div",{title:f.name,children:f.name})]})},f.id))})]})]})})]})}function U(a,t){h.useEffect(()=>(a&&t&&(window.__SEMAPHOR_PRINT_STATE__={...t}),()=>{a&&window.__SEMAPHOR_PRINT_STATE__&&delete window.__SEMAPHOR_PRINT_STATE__}),[a,t])}exports.BriefingAuthor=e.BriefingAuthor;exports.BriefingAuthorDialog=e.BriefingAuthorDialog;exports.BriefingUiCapabilitiesBoundary=e.BriefingUiCapabilitiesBoundary;exports.BriefingUiCapabilitiesProvider=e.BriefingUiCapabilitiesProvider;exports.BriefingsApiError=e.BriefingsApiError;exports.CardSummary=e.CardSummary;exports.Dashboard=e.Dashboard;exports.DashboardCreateDialogBase=e.DashboardCreateDialogBase;exports.DashboardExportDialog=e.DashboardExportDialog;exports.DashboardWC=e.DashboardWC;exports.DisplayFormatPreferencesFields=e.DisplayFormatPreferencesFields;exports.ExportError=e.ExportError;exports.MatrixTableVisual=e.MatrixTableVisual;exports.ResourceType=e.ResourceType;exports.SemaphorContextProvider=e.SemaphorContextProvider;exports.SemaphorDataProvider=e.SemaphorQueryClient;exports.SemaphorQueryClient=e.SemaphorQueryClient;exports.ShareDialog=e.ShareDialog;exports.SummaryCard=e.SummaryCard;exports.Surfboard=e.DashboardPlus;exports.applyBriefingFormPatch=e.applyBriefingFormPatch;exports.briefingFormDraftToCreateRequest=e.briefingFormDraftToCreateRequest;exports.briefingFormDraftToUpdateRequest=e.briefingFormDraftToUpdateRequest;exports.briefingToFormDraft=e.briefingToFormDraft;exports.cancelBriefingPreviewRun=e.cancelBriefingPreviewRun;exports.cancelBriefingRun=e.cancelBriefingRun;exports.cancelExport=e.cancelExport;exports.cloneDeep=e.cloneDeep;exports.createBriefing=e.createBriefing;exports.createBriefingFormDraft=e.createBriefingFormDraft;exports.createExport=e.createExport;exports.deleteBriefing=e.deleteBriefing;exports.deleteBriefingRun=e.deleteBriefingRun;exports.downloadDocumentPdf=e.downloadDocumentPdf;exports.downloadPdf=e.downloadPdf;exports.formatFileSize=e.formatFileSize;exports.getBriefing=e.getBriefing;exports.getBriefingArtifact=e.getBriefingArtifact;exports.getBriefingEvidence=e.getBriefingEvidence;exports.getBriefingPreviewRun=e.getBriefingPreviewRun;exports.getBriefingRun=e.getBriefingRun;exports.getDownloadUrl=e.getDownloadUrl;exports.getExportStatus=e.getExportStatus;exports.getExports=e.getExports;exports.isExportComplete=e.isExportComplete;exports.isExportInProgress=e.isExportInProgress;exports.listBriefingRuns=e.listBriefingRuns;exports.listBriefingTenantSummaries=e.listBriefingTenantSummaries;exports.listBriefings=e.listBriefings;exports.pauseBriefing=e.pauseBriefing;exports.polishBriefingText=e.polishBriefingText;exports.previewBriefingPlan=e.previewBriefingPlan;exports.resumeBriefing=e.resumeBriefing;exports.runBriefingNow=e.runBriefingNow;exports.runBriefingPreview=e.runBriefingPreview;exports.updateBriefing=e.updateBriefing;exports.useActiveExports=e.useActiveExports;exports.useAddNewFrame=e.useAddNewFrame;exports.useBriefingUiCapabilities=e.useBriefingUiCapabilities;exports.useCard=e.useCard;exports.useCardSummary=e.useCardSummary;exports.useDashboardById=e.useDashboardById;exports.useDashboardQuery=e.useDashboardQuery;exports.useDashboardSummary=e.useDashboardSummary;exports.useDataColumns=e.useDataColumns;exports.useDateFilterHook=e.useDateFilterHook;exports.useEditorAside=e.useEditorAside;exports.useExportActions=e.useExportActions;exports.useExportStore=e.useExportStore;exports.useInProgressExportsCount=e.useInProgressExportsCount;exports.useManagementStore=e.useManagementStore;exports.useResourceManagement=e.useResourceManagement;exports.useTextFilterHook=e.useTextFilterHook;exports.validateBriefingFormDraft=e.validateBriefingFormDraft;exports.CALCULATED_FIELD_ENTITY_MARKER=u.CALCULATED_FIELD_ENTITY_MARKER;exports.CONTROL_CARD_DEFAULT_VALUE=u.CONTROL_CARD_DEFAULT_VALUE;exports.DATE_FORMAT_VALUES=u.DATE_FORMAT_VALUES;exports.EMPTY_SELECTION=u.EMPTY_SELECTION;exports.LEGACY_CALCULATED_FIELD_ENTITY_MARKER=u.LEGACY_CALCULATED_FIELD_ENTITY_MARKER;exports.PivotMarkerEnum=u.PivotMarkerEnum;exports.getFieldRuntimeColumnName=u.getFieldRuntimeColumnName;exports.hasCalculatedFieldMarker=u.hasCalculatedFieldMarker;exports.hasCalculatedFormulaInputs=u.hasCalculatedFormulaInputs;exports.hasSyntheticCalculatedFieldOwner=u.hasSyntheticCalculatedFieldOwner;exports.isCalculatedDimension=u.isCalculatedDimension;exports.isCalculatedField=u.isCalculatedField;exports.isCalculatedMetric=u.isCalculatedMetric;exports.ReportPreferencesDialog=_.ReportPreferencesDialog;exports.createEmptyKpiConfig=r.createEmptyKpiConfig;exports.createSqlGenConfig=r.createSqlGenConfig;exports.emitDashboardLoad=r.emitDashboardLoad;exports.emitDashboardUnload=r.emitDashboardUnload;exports.fmt=r.fmt;exports.getColumnDataType=r.getColumnDataType;exports.getFilterValueType=r.getFilterValueType;exports.getFormattedTableNameForQuery=r.getFormattedTableNameForQuery;exports.getQualifiedTableName=r.getQualifiedTableName;exports.getSql=r.getSql;exports.invalidateToken=r.invalidateToken;exports.isBooleanDataType=r.isBooleanDataType;exports.isColumnInSqlGen=r.isColumnInSqlGen;exports.isDateDataType=r.isDateDataType;exports.isNumberDataType=r.isNumberDataType;exports.isTextDataType=r.isTextDataType;exports.resolveDataType=r.resolveDataType;exports.resolveDatamodelName=r.resolveDatamodelName;exports.useCurrentActiveCard=r.useCurrentActiveCard;exports.useCurrentCardConfig=r.useCurrentCardConfig;exports.useCurrentSheetActiveCards=r.useCurrentSheetActiveCards;exports.useDashboardActions=r.useDashboardActions;exports.useDashboardStore=r.useDashboardStore;exports.useEditorActions=r.useEditorActions;exports.useEditorStore=r.useEditorStore;exports.DEFAULT_SEMANTIC_DOMAIN_ACCESS=P.DEFAULT_SEMANTIC_DOMAIN_ACCESS;exports.AdvancedModeToggle=l.AdvancedModeToggle;exports.DashboardBriefingLauncher=l.DashboardBriefingLauncher;exports.DashboardControlsSettings=l.DashboardControlsSettings;exports.DashboardFilterControlsButton=l.DashboardFilterControlsButton;exports.DashboardFilterControlsLauncher=l.DashboardFilterControlsLauncher;exports.DocumentControlsSettings=l.DocumentControlsSettings;exports.ExportNotificationItem=l.ExportNotificationItem;exports.ExportNotificationList=l.ExportNotificationList;exports.NotificationBell=l.NotificationBell;exports.UnsavedChangesAlert=l.UnsavedChangesAlert;exports.VisualEditingControls=l.VisualEditingControls;exports.VisualsLibraryDialog=l.VisualsLibraryDialog;exports.WatchDashboardButton=l.WatchDashboardButton;exports.useExportPolling=l.useExportPolling;exports.useExportRecovery=l.useExportRecovery;exports.useDebouncedDirtyCheck=N.useDebouncedDirtyCheck;exports.DEFAULT_CALENDAR_CONTEXT=R.DEFAULT_CALENDAR_CONTEXT;exports.resolveQueryColumnKeyMapEntry=T.resolveQueryColumnKeyMapEntry;exports.resolveUniqueQueryColumnKeyMapEntry=T.resolveUniqueQueryColumnKeyMapEntry;exports.normalizeDashboardForDirtyCheck=B.normalizeDashboardForDirtyCheck;exports.serializeDashboardForDirtyCheck=B.serializeDashboardForDirtyCheck;exports.Combobox=q;exports.Visual=M;exports.useExposePrintState=U;exports.usePristineSnapshotInitializer=I;
|
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { E as x, F as N, S, c as _, U as P, d as w, C as F, e as y, f as R, g as L, h as M, i as I, I as U, R as k, j as O, k as V, l as q, m as z } from "./chunks/index-
|
|
2
|
-
import { al as Ea, am as ya, an as xa, ao as ba, W as Ta, H as va, D as Aa, B as Ba, A as Na, x as Sa, b as _a, av as Pa, M as wa, o as Fa, r as Ra, r as La, s as Ma, G as Ia, a as Ua, ag as ka, ai as Oa, aj as Va, ah as qa, a7 as za, aa as Wa, au as ja, _ as Qa, af as Ha, aq as Ka, a2 as Ga, ab as Ya, z as Xa, y as $a, ay as Ja, Z as Za, ac as ae, ad as ee, a6 as se, a9 as re, at as oe, as as ie, ar as te, ax as ne, aw as le, a8 as ue, Y as de, X as ce, a0 as fe, ae as pe, a4 as me, a1 as he, a3 as ge, a5 as Ce, $ as De, Q as Ee, N as ye, ap as xe, w as be, K as Te, v as ve, n as Ae, J as Be, L as Ne, p as Se, V as _e, P as Pe, O as we, T as Fe, u as Re, t as Le, q as Me, ak as Ie } from "./chunks/index-
|
|
1
|
+
import { E as x, F as N, S, c as _, U as P, d as w, C as F, e as y, f as R, g as L, h as M, i as I, I as U, R as k, j as O, k as V, l as q, m as z } from "./chunks/index-DrdF7QR7.js";
|
|
2
|
+
import { al as Ea, am as ya, an as xa, ao as ba, W as Ta, H as va, D as Aa, B as Ba, A as Na, x as Sa, b as _a, av as Pa, M as wa, o as Fa, r as Ra, r as La, s as Ma, G as Ia, a as Ua, ag as ka, ai as Oa, aj as Va, ah as qa, a7 as za, aa as Wa, au as ja, _ as Qa, af as Ha, aq as Ka, a2 as Ga, ab as Ya, z as Xa, y as $a, ay as Ja, Z as Za, ac as ae, ad as ee, a6 as se, a9 as re, at as oe, as as ie, ar as te, ax as ne, aw as le, a8 as ue, Y as de, X as ce, a0 as fe, ae as pe, a4 as me, a1 as he, a3 as ge, a5 as Ce, $ as De, Q as Ee, N as ye, ap as xe, w as be, K as Te, v as ve, n as Ae, J as Be, L as Ne, p as Se, V as _e, P as Pe, O as we, T as Fe, u as Re, t as Le, q as Me, ak as Ie } from "./chunks/index-DrdF7QR7.js";
|
|
3
3
|
import { a as ke, C as Oe, D as Ve, E as qe, L as ze, P as We, g as je, d as Qe, h as He, e as Ke, b as Ge, c as Ye, i as Xe } from "./chunks/common-types-BLPy5_E0.js";
|
|
4
|
-
import { R as Je } from "./chunks/report-preferences-dialog-
|
|
4
|
+
import { R as Je } from "./chunks/report-preferences-dialog-BjygtSP3.js";
|
|
5
5
|
import { jsx as a, jsxs as u } from "react/jsx-runtime";
|
|
6
6
|
import { u as W, P as j, a as Q, B as H, c as C, b as K, d as G } from "./chunks/switch-C8NihGV4.js";
|
|
7
7
|
import { A as as, n as es, e as ss, f as rs, g as os, p as is, o as ts, s as ns, t as ls, m as us, i as ds, l as cs, q as fs, k as ps, j as ms, h as hs, v as gs, r as Cs, w as Ds, y as Es, x as ys, z as xs, E as bs, D as Ts } from "./chunks/switch-C8NihGV4.js";
|
|
8
8
|
import * as p from "react";
|
|
9
9
|
import { useMemo as Y, useEffect as b } from "react";
|
|
10
10
|
import { D as As } from "./chunks/token-types-DfDtCqlw.js";
|
|
11
|
-
import { A as Ns, g as Ss, D as _s, e as Ps, f as ws, d as Fs, b as Rs, E as Ls, N as Ms, U as Is, a as Us, V as ks, W as Os, u as Vs, c as qs } from "./chunks/dashboard-briefing-launcher-
|
|
11
|
+
import { A as Ns, g as Ss, D as _s, e as Ps, f as ws, d as Fs, b as Rs, E as Ls, N as Ms, U as Is, a as Us, V as ks, W as Os, u as Vs, c as qs } from "./chunks/dashboard-briefing-launcher-C9d8CPxv.js";
|
|
12
12
|
import { u as Ws } from "./chunks/use-debounced-dirty-check-BwAbnX_5.js";
|
|
13
13
|
import "./value-format-preferences/index.js";
|
|
14
14
|
import "./chunks/validators-D-T-2HOR.js";
|
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-Cd8qGOXl.cjs"),r=require("../chunks/common-types-C1IM7gao.cjs"),o=require("../chunks/report-preferences-dialog-DW40ECz1.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-DrdF7QR7.js";
|
|
2
2
|
import { C as f, E } from "../chunks/common-types-BLPy5_E0.js";
|
|
3
|
-
import { R as t } from "../chunks/report-preferences-dialog-
|
|
3
|
+
import { R as t } from "../chunks/report-preferences-dialog-BjygtSP3.js";
|
|
4
4
|
export {
|
|
5
5
|
f as CONTROL_CARD_DEFAULT_VALUE,
|
|
6
6
|
a as DisplayFormatPreferencesFields,
|
|
@@ -1790,12 +1790,12 @@ declare type FilterForDate = BaseFilter & {
|
|
|
1790
1790
|
|
|
1791
1791
|
declare type FilterForEqual = BaseFilter & {
|
|
1792
1792
|
operation: '=' | '!=';
|
|
1793
|
-
values: [
|
|
1793
|
+
values: [FilterOptionValue];
|
|
1794
1794
|
};
|
|
1795
1795
|
|
|
1796
1796
|
declare type FilterForIn = BaseFilter & {
|
|
1797
1797
|
operation: 'in' | 'not in';
|
|
1798
|
-
values:
|
|
1798
|
+
values: FilterOptionValue[];
|
|
1799
1799
|
};
|
|
1800
1800
|
|
|
1801
1801
|
declare type FilterForNull = BaseFilter & {
|
|
@@ -1853,6 +1853,8 @@ declare type FilterOnClick = {
|
|
|
1853
1853
|
columnIndex: number;
|
|
1854
1854
|
};
|
|
1855
1855
|
|
|
1856
|
+
declare type FilterOptionValue = string | number | boolean;
|
|
1857
|
+
|
|
1856
1858
|
declare type FilterSemanticContext = {
|
|
1857
1859
|
semanticDomainId?: string;
|
|
1858
1860
|
selectedEntities?: unknown[];
|
|
@@ -1630,12 +1630,12 @@ declare type FilterForDate = BaseFilter & {
|
|
|
1630
1630
|
|
|
1631
1631
|
declare type FilterForEqual = BaseFilter & {
|
|
1632
1632
|
operation: '=' | '!=';
|
|
1633
|
-
values: [
|
|
1633
|
+
values: [FilterOptionValue];
|
|
1634
1634
|
};
|
|
1635
1635
|
|
|
1636
1636
|
declare type FilterForIn = BaseFilter & {
|
|
1637
1637
|
operation: 'in' | 'not in';
|
|
1638
|
-
values:
|
|
1638
|
+
values: FilterOptionValue[];
|
|
1639
1639
|
};
|
|
1640
1640
|
|
|
1641
1641
|
declare type FilterForNull = BaseFilter & {
|
|
@@ -1693,6 +1693,8 @@ declare type FilterOnClick = {
|
|
|
1693
1693
|
columnIndex: number;
|
|
1694
1694
|
};
|
|
1695
1695
|
|
|
1696
|
+
declare type FilterOptionValue = string | number | boolean;
|
|
1697
|
+
|
|
1696
1698
|
declare type FilterSemanticContext = {
|
|
1697
1699
|
semanticDomainId?: string;
|
|
1698
1700
|
selectedEntities?: unknown[];
|
|
@@ -1656,12 +1656,12 @@ declare type FilterForDate = BaseFilter & {
|
|
|
1656
1656
|
|
|
1657
1657
|
declare type FilterForEqual = BaseFilter & {
|
|
1658
1658
|
operation: '=' | '!=';
|
|
1659
|
-
values: [
|
|
1659
|
+
values: [FilterOptionValue];
|
|
1660
1660
|
};
|
|
1661
1661
|
|
|
1662
1662
|
declare type FilterForIn = BaseFilter & {
|
|
1663
1663
|
operation: 'in' | 'not in';
|
|
1664
|
-
values:
|
|
1664
|
+
values: FilterOptionValue[];
|
|
1665
1665
|
};
|
|
1666
1666
|
|
|
1667
1667
|
declare type FilterForNull = BaseFilter & {
|
|
@@ -1719,6 +1719,8 @@ declare type FilterOnClick = {
|
|
|
1719
1719
|
columnIndex: number;
|
|
1720
1720
|
};
|
|
1721
1721
|
|
|
1722
|
+
declare type FilterOptionValue = string | number | boolean;
|
|
1723
|
+
|
|
1722
1724
|
declare type FilterSemanticContext = {
|
|
1723
1725
|
semanticDomainId?: string;
|
|
1724
1726
|
selectedEntities?: unknown[];
|
package/dist/types/main.d.ts
CHANGED
|
@@ -1610,9 +1610,9 @@ export declare function Combobox({ name, items, value, onChange, isLoading, isEr
|
|
|
1610
1610
|
}): JSX.Element;
|
|
1611
1611
|
|
|
1612
1612
|
declare type ComboBoxOption = {
|
|
1613
|
-
id:
|
|
1614
|
-
value:
|
|
1615
|
-
[key: string]:
|
|
1613
|
+
id: FilterOptionValue;
|
|
1614
|
+
value: FilterOptionValue;
|
|
1615
|
+
[key: string]: FilterOptionValue;
|
|
1616
1616
|
};
|
|
1617
1617
|
|
|
1618
1618
|
declare type ComparisonAvailability = {
|
|
@@ -3789,12 +3789,12 @@ declare type FilterForDate = BaseFilter & {
|
|
|
3789
3789
|
|
|
3790
3790
|
declare type FilterForEqual = BaseFilter & {
|
|
3791
3791
|
operation: '=' | '!=';
|
|
3792
|
-
values: [
|
|
3792
|
+
values: [FilterOptionValue];
|
|
3793
3793
|
};
|
|
3794
3794
|
|
|
3795
3795
|
declare type FilterForIn = BaseFilter & {
|
|
3796
3796
|
operation: 'in' | 'not in';
|
|
3797
|
-
values:
|
|
3797
|
+
values: FilterOptionValue[];
|
|
3798
3798
|
};
|
|
3799
3799
|
|
|
3800
3800
|
declare type FilterForNull = BaseFilter & {
|
|
@@ -3852,6 +3852,8 @@ declare type FilterOnClick = {
|
|
|
3852
3852
|
columnIndex: number;
|
|
3853
3853
|
};
|
|
3854
3854
|
|
|
3855
|
+
declare type FilterOptionValue = string | number | boolean;
|
|
3856
|
+
|
|
3855
3857
|
declare type FilterSemanticContext = {
|
|
3856
3858
|
semanticDomainId?: string;
|
|
3857
3859
|
selectedEntities?: unknown[];
|
|
@@ -7913,7 +7915,7 @@ export declare function useDataColumns(token?: AuthToken): {
|
|
|
7913
7915
|
};
|
|
7914
7916
|
|
|
7915
7917
|
export declare function useDateFilterHook(filterId: string): {
|
|
7916
|
-
records:
|
|
7918
|
+
records: Record<string, unknown>[] | undefined;
|
|
7917
7919
|
isLoading: boolean;
|
|
7918
7920
|
isFetching: boolean;
|
|
7919
7921
|
isError: boolean;
|
|
@@ -8126,6 +8128,11 @@ export declare function useTextFilterHook(filterId: string): {
|
|
|
8126
8128
|
isFetching: boolean;
|
|
8127
8129
|
isPlaceholderData: boolean;
|
|
8128
8130
|
isError: boolean;
|
|
8131
|
+
hasNextPage: boolean;
|
|
8132
|
+
hasLoadedMoreOptions: boolean;
|
|
8133
|
+
isFetchingNextPage: boolean;
|
|
8134
|
+
isNextPageError: boolean;
|
|
8135
|
+
loadNextPage: () => void;
|
|
8129
8136
|
records: ComboBoxOption[];
|
|
8130
8137
|
selectedRecords: ComboBoxOption[];
|
|
8131
8138
|
handleChange: (selectedRecords: TSelectedRecord[]) => void;
|
package/dist/types/shared.d.ts
CHANGED
|
@@ -1297,12 +1297,12 @@ declare type FilterForDate = BaseFilter & {
|
|
|
1297
1297
|
|
|
1298
1298
|
declare type FilterForEqual = BaseFilter & {
|
|
1299
1299
|
operation: '=' | '!=';
|
|
1300
|
-
values: [
|
|
1300
|
+
values: [FilterOptionValue];
|
|
1301
1301
|
};
|
|
1302
1302
|
|
|
1303
1303
|
declare type FilterForIn = BaseFilter & {
|
|
1304
1304
|
operation: 'in' | 'not in';
|
|
1305
|
-
values:
|
|
1305
|
+
values: FilterOptionValue[];
|
|
1306
1306
|
};
|
|
1307
1307
|
|
|
1308
1308
|
declare type FilterForNull = BaseFilter & {
|
|
@@ -1360,6 +1360,8 @@ declare type FilterOnClick = {
|
|
|
1360
1360
|
columnIndex: number;
|
|
1361
1361
|
};
|
|
1362
1362
|
|
|
1363
|
+
declare type FilterOptionValue = string | number | boolean;
|
|
1364
|
+
|
|
1363
1365
|
declare type FilterSemanticContext = {
|
|
1364
1366
|
semanticDomainId?: string;
|
|
1365
1367
|
selectedEntities?: unknown[];
|
|
@@ -1669,12 +1669,12 @@ declare type FilterForDate = BaseFilter & {
|
|
|
1669
1669
|
|
|
1670
1670
|
declare type FilterForEqual = BaseFilter & {
|
|
1671
1671
|
operation: '=' | '!=';
|
|
1672
|
-
values: [
|
|
1672
|
+
values: [FilterOptionValue];
|
|
1673
1673
|
};
|
|
1674
1674
|
|
|
1675
1675
|
declare type FilterForIn = BaseFilter & {
|
|
1676
1676
|
operation: 'in' | 'not in';
|
|
1677
|
-
values:
|
|
1677
|
+
values: FilterOptionValue[];
|
|
1678
1678
|
};
|
|
1679
1679
|
|
|
1680
1680
|
declare type FilterForNull = BaseFilter & {
|
|
@@ -1732,6 +1732,8 @@ declare type FilterOnClick = {
|
|
|
1732
1732
|
columnIndex: number;
|
|
1733
1733
|
};
|
|
1734
1734
|
|
|
1735
|
+
declare type FilterOptionValue = string | number | boolean;
|
|
1736
|
+
|
|
1735
1737
|
declare type FilterSemanticContext = {
|
|
1736
1738
|
semanticDomainId?: string;
|
|
1737
1739
|
selectedEntities?: unknown[];
|
package/dist/types/types.d.ts
CHANGED
|
@@ -2251,12 +2251,12 @@ declare type FilterForDate = BaseFilter & {
|
|
|
2251
2251
|
|
|
2252
2252
|
declare type FilterForEqual = BaseFilter & {
|
|
2253
2253
|
operation: '=' | '!=';
|
|
2254
|
-
values: [
|
|
2254
|
+
values: [FilterOptionValue];
|
|
2255
2255
|
};
|
|
2256
2256
|
|
|
2257
2257
|
declare type FilterForIn = BaseFilter & {
|
|
2258
2258
|
operation: 'in' | 'not in';
|
|
2259
|
-
values:
|
|
2259
|
+
values: FilterOptionValue[];
|
|
2260
2260
|
};
|
|
2261
2261
|
|
|
2262
2262
|
declare type FilterForNull = BaseFilter & {
|
|
@@ -2314,6 +2314,8 @@ declare type FilterOnClick = {
|
|
|
2314
2314
|
columnIndex: number;
|
|
2315
2315
|
};
|
|
2316
2316
|
|
|
2317
|
+
declare type FilterOptionValue = string | number | boolean;
|
|
2318
|
+
|
|
2317
2319
|
export declare type FilterSemanticContext = {
|
|
2318
2320
|
semanticDomainId?: string;
|
|
2319
2321
|
selectedEntities?: unknown[];
|