react-semaphor 0.1.59 → 0.1.61
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/axis-mapping-8ZVwlkl6.js +315 -0
- package/dist/chunks/axis-mapping-Cwa3KrDR.js +16 -0
- package/dist/chunks/bar-chart-settings-B_WyC-7g.js +52 -0
- package/dist/chunks/bar-chart-settings-CvorW7RD.js +1 -0
- package/dist/chunks/bubble-chart-settings-BPtESqYK.js +1 -0
- package/dist/chunks/bubble-chart-settings-CxFAlErV.js +50 -0
- package/dist/chunks/common-chart-settings-CvRrQf-H.js +1 -0
- package/dist/chunks/common-chart-settings-D3ww0Xtx.js +147 -0
- package/dist/chunks/custom-visual-settings-DXWyN2Dr.js +11 -0
- package/dist/chunks/custom-visual-settings-m5o8R5tL.js +243 -0
- package/dist/chunks/dashboard-plus-B8-ocT_Z.js +41 -0
- package/dist/chunks/dashboard-plus-DSUKhvcv.js +2941 -0
- package/dist/chunks/display-labels-BYsRReye.js +1 -0
- package/dist/chunks/display-labels-C_jsL0Jo.js +74 -0
- package/dist/chunks/editor-C7xQi9Ab.js +105 -0
- package/dist/chunks/editor-DqvyBUrl.js +8321 -0
- package/dist/chunks/filter-on-click-columns-6dRYhvgz.js +1 -0
- package/dist/chunks/filter-on-click-columns-BJUGTE6W.js +120 -0
- package/dist/chunks/frame-filters-D9sDN4Vm.js +1 -0
- package/dist/chunks/frame-filters-DFgqSoV2.js +75 -0
- package/dist/chunks/{index-D4y2uVa5.js → index--MUeDITx.js} +28329 -25746
- package/dist/chunks/index-Bvtpj-_R.js +1080 -0
- package/dist/chunks/kpi-settings-BONvmfNr.js +1 -0
- package/dist/chunks/kpi-settings-CI-9fp4Z.js +286 -0
- package/dist/chunks/map-chart-settings-CSxZdu_g.js +1 -0
- package/dist/chunks/map-chart-settings-DQIN7Pn8.js +334 -0
- package/dist/chunks/pie-chart-settings-CN3JCLdP.js +86 -0
- package/dist/chunks/pie-chart-settings-CsErfZOL.js +1 -0
- package/dist/chunks/reusable-select-CQbD03nT.js +40 -0
- package/dist/chunks/reusable-select-CVRzPWkg.js +1 -0
- package/dist/chunks/stacked-chart-settings-BfqHFFqA.js +1 -0
- package/dist/chunks/stacked-chart-settings-poYotO6Q.js +90 -0
- package/dist/chunks/table-visual-settings-B46pdUra.js +46 -0
- package/dist/chunks/table-visual-settings-ZKWuNokZ.js +1 -0
- package/dist/chunks/tag-BrxBSbSe.js +20 -0
- package/dist/chunks/tag-D9G2kz2B.js +6 -0
- package/dist/chunks/use-assign-filter-5gplfsO1.js +83 -0
- package/dist/chunks/use-assign-filter-DzmBSsyO.js +1 -0
- package/dist/chunks/use-local-storage-state-CBh2HHB9.js +16 -0
- package/dist/chunks/use-local-storage-state-CL0JsTZM.js +1745 -0
- package/dist/chunks/use-plugin-query-DA6Yrp7P.js +12 -0
- package/dist/chunks/use-plugin-query-JdHNPYZS.js +1 -0
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +103 -103
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/dashboard-plus-B-lXkbRY.js +0 -225
- package/dist/chunks/dashboard-plus-CHqCwJFO.js +0 -17362
- package/dist/chunks/index-CLxl35mK.js +0 -1045
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const c=require("react/jsx-runtime"),C=require("react"),u=require("./index-Bvtpj-_R.js");function k(){const[a,m]=C.useState([]),e=u.useEditorStore(n=>n.card.preferences),{setFilterOnClickColumnIndex:f,setCardPreferences:x}=u.useEditorStore(n=>n.actions),r=u.useEditorStore(n=>n.queryResultColumns);u.useEditorStore(n=>{var l;return(l=n.card.preferences)==null?void 0:l.filterOnClickColumnIndex}),C.useEffect(()=>{r&&m(new Array(r.length).fill(!1))},[r]);function d(n,l){var s,t;l?e!=null&&e.onClickFilter&&((s=e==null?void 0:e.onClickFilter)==null?void 0:s.length)>0?x({...e,onClickFilter:[...e.onClickFilter,{columnIndex:n,expression:""}]}):x({...e,onClickFilter:[{columnIndex:n,expression:""}]}):(x({...e,onClickFilter:(t=e==null?void 0:e.onClickFilter)==null?void 0:t.filter(i=>i.columnIndex!==n)}),m(i=>{const o=[...i];return o[n]=!1,o}))}function p(n,l){var t;const s=(t=e==null?void 0:e.onClickFilter)==null?void 0:t.map(i=>i.columnIndex===n?{...i,expression:l.target.value}:i);x({...e,onClickFilter:s})}function h(n){var l,s,t,i;if(a!=null&&a[n]||(s=(l=e==null?void 0:e.onClickFilter)==null?void 0:l.find(o=>o.columnIndex===n))!=null&&s.expression)return c.jsx(u.Input,{value:(i=(t=e==null?void 0:e.onClickFilter)==null?void 0:t.find(o=>o.columnIndex===n))==null?void 0:i.expression,onChange:o=>p(n,o),type:"text",className:"h-9 w-full font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",placeholder:"Expression"})}return c.jsx("div",{className:"max-h-[150px] space-y-2 overflow-y-auto",children:r==null?void 0:r.map((n,l)=>{var s,t;return c.jsx("div",{className:"group flex items-center justify-between space-y-2",children:c.jsxs("div",{className:"grow",children:[c.jsxs("div",{className:"flex items-center space-x-2 py-2",children:[c.jsx(u.Checkbox,{checked:!!((s=e==null?void 0:e.onClickFilter)!=null&&s.find(i=>i.columnIndex===l)),onCheckedChange:i=>d(l,i)}),c.jsx("label",{className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:n}),c.jsx("div",{className:"flex items-center gap-2",children:((t=e==null?void 0:e.onClickFilter)==null?void 0:t.find(i=>i.columnIndex===l))&&c.jsx(u.Pencil,{onClick:()=>{m(i=>{const o=[...i];return o[l]=!i[l],o})},className:"invisible size-3 cursor-pointer text-gray-400 group-hover:visible"})})]}),h(l)]})},n)})})}exports.FilterOnClickColumns=k;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { jsx as c, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import { useState as h, useEffect as k } from "react";
|
|
3
|
+
import { u as a, C as g, r as F, I } from "./index--MUeDITx.js";
|
|
4
|
+
function N() {
|
|
5
|
+
const [m, x] = h([]), n = a((e) => e.card.preferences), { setFilterOnClickColumnIndex: v, setCardPreferences: u } = a(
|
|
6
|
+
(e) => e.actions
|
|
7
|
+
), r = a(
|
|
8
|
+
(e) => e.queryResultColumns
|
|
9
|
+
);
|
|
10
|
+
a(
|
|
11
|
+
(e) => {
|
|
12
|
+
var i;
|
|
13
|
+
return (i = e.card.preferences) == null ? void 0 : i.filterOnClickColumnIndex;
|
|
14
|
+
}
|
|
15
|
+
), k(() => {
|
|
16
|
+
r && x(new Array(r.length).fill(!1));
|
|
17
|
+
}, [r]);
|
|
18
|
+
function C(e, i) {
|
|
19
|
+
var s, o;
|
|
20
|
+
i ? n != null && n.onClickFilter && ((s = n == null ? void 0 : n.onClickFilter) == null ? void 0 : s.length) > 0 ? u({
|
|
21
|
+
...n,
|
|
22
|
+
onClickFilter: [
|
|
23
|
+
...n.onClickFilter,
|
|
24
|
+
{
|
|
25
|
+
columnIndex: e,
|
|
26
|
+
expression: ""
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
}) : u({
|
|
30
|
+
...n,
|
|
31
|
+
onClickFilter: [
|
|
32
|
+
{
|
|
33
|
+
columnIndex: e,
|
|
34
|
+
expression: ""
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
}) : (u({
|
|
38
|
+
...n,
|
|
39
|
+
onClickFilter: (o = n == null ? void 0 : n.onClickFilter) == null ? void 0 : o.filter(
|
|
40
|
+
(l) => l.columnIndex !== e
|
|
41
|
+
)
|
|
42
|
+
}), x((l) => {
|
|
43
|
+
const t = [...l];
|
|
44
|
+
return t[e] = !1, t;
|
|
45
|
+
}));
|
|
46
|
+
}
|
|
47
|
+
function d(e, i) {
|
|
48
|
+
var o;
|
|
49
|
+
const s = (o = n == null ? void 0 : n.onClickFilter) == null ? void 0 : o.map((l) => l.columnIndex === e ? {
|
|
50
|
+
...l,
|
|
51
|
+
expression: i.target.value
|
|
52
|
+
} : l);
|
|
53
|
+
u({
|
|
54
|
+
...n,
|
|
55
|
+
onClickFilter: s
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
function f(e) {
|
|
59
|
+
var i, s, o, l;
|
|
60
|
+
if (m != null && m[e] || (s = (i = n == null ? void 0 : n.onClickFilter) == null ? void 0 : i.find((t) => t.columnIndex === e)) != null && s.expression)
|
|
61
|
+
return /* @__PURE__ */ c(
|
|
62
|
+
I,
|
|
63
|
+
{
|
|
64
|
+
value: (l = (o = n == null ? void 0 : n.onClickFilter) == null ? void 0 : o.find((t) => t.columnIndex === e)) == null ? void 0 : l.expression,
|
|
65
|
+
onChange: (t) => d(e, t),
|
|
66
|
+
type: "text",
|
|
67
|
+
className: "h-9 w-full font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
|
|
68
|
+
placeholder: "Expression"
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
return /* @__PURE__ */ c("div", { className: "max-h-[150px] space-y-2 overflow-y-auto", children: r == null ? void 0 : r.map((e, i) => {
|
|
73
|
+
var s, o;
|
|
74
|
+
return /* @__PURE__ */ c(
|
|
75
|
+
"div",
|
|
76
|
+
{
|
|
77
|
+
className: "group flex items-center justify-between space-y-2",
|
|
78
|
+
children: /* @__PURE__ */ p("div", { className: "grow", children: [
|
|
79
|
+
/* @__PURE__ */ p("div", { className: "flex items-center space-x-2 py-2", children: [
|
|
80
|
+
/* @__PURE__ */ c(
|
|
81
|
+
g,
|
|
82
|
+
{
|
|
83
|
+
checked: !!((s = n == null ? void 0 : n.onClickFilter) != null && s.find(
|
|
84
|
+
(l) => l.columnIndex === i
|
|
85
|
+
)),
|
|
86
|
+
onCheckedChange: (l) => C(i, l)
|
|
87
|
+
}
|
|
88
|
+
),
|
|
89
|
+
/* @__PURE__ */ c(
|
|
90
|
+
"label",
|
|
91
|
+
{
|
|
92
|
+
className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
93
|
+
children: e
|
|
94
|
+
}
|
|
95
|
+
),
|
|
96
|
+
/* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: ((o = n == null ? void 0 : n.onClickFilter) == null ? void 0 : o.find(
|
|
97
|
+
(l) => l.columnIndex === i
|
|
98
|
+
)) && /* @__PURE__ */ c(
|
|
99
|
+
F,
|
|
100
|
+
{
|
|
101
|
+
onClick: () => {
|
|
102
|
+
x((l) => {
|
|
103
|
+
const t = [...l];
|
|
104
|
+
return t[i] = !l[i], t;
|
|
105
|
+
});
|
|
106
|
+
},
|
|
107
|
+
className: "invisible size-3 cursor-pointer text-gray-400 group-hover:visible"
|
|
108
|
+
}
|
|
109
|
+
) })
|
|
110
|
+
] }),
|
|
111
|
+
f(i)
|
|
112
|
+
] })
|
|
113
|
+
},
|
|
114
|
+
e
|
|
115
|
+
);
|
|
116
|
+
}) });
|
|
117
|
+
}
|
|
118
|
+
export {
|
|
119
|
+
N as F
|
|
120
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const n=require("react/jsx-runtime"),e=require("./index-Bvtpj-_R.js"),f=require("react");require("react-dom");const p=require("./use-assign-filter-DzmBSsyO.js");function h(s){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const r in s)if(r!=="default"){const a=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(o,r,a.get?a:{enumerable:!0,get:()=>s[r]})}}return o.default=s,Object.freeze(o)}const d=h(f);function j(){const s=e.useDashboardStore(t=>t.dashboard.filters),o=e.useEditorStore(t=>t.frame),{setFrame:r}=e.useEditorActions(),{columns:a}=e.useEditorAside(),{assignFilter:i}=p.useAssignFilter();function m(t){const l=i(t,"frame");r({...o,filterId:l})}const c=s==null?void 0:s.find(t=>t.id===o.filterId);return n.jsxs("div",{className:"space-y-3",children:[n.jsx(e.Label,{children:"Card Filter"}),n.jsx(x,{onSelect:m,columns:a}),c&&n.jsx(e.FilterHeader,{filter:c})]})}function x({columns:s,onSelect:o}){var c;const[r,a]=d.useState(!1),[i,m]=d.useState("");return n.jsxs(e.Popover,{open:r,onOpenChange:a,children:[n.jsx(e.PopoverTrigger,{asChild:!0,children:n.jsxs(e.Button,{size:"sm",variant:"outline",role:"combobox","aria-expanded":r,className:"w-full justify-between font-normal",children:[i?(c=s.find(t=>t.column_name===i))==null?void 0:c.column_name:"Select Column...",n.jsx(e.CaretSortIcon,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),n.jsx(e.PopoverContent,{className:"w-[200px] p-0",children:n.jsxs(e.Command,{children:[n.jsx(e.CommandInput,{placeholder:"Search column",className:"h-9"}),n.jsxs(e.CommandList,{children:[n.jsx(e.CommandEmpty,{children:"No framework found."}),n.jsx(e.CommandGroup,{children:s==null?void 0:s.map(t=>n.jsxs(e.CommandItem,{value:t.column_name,onSelect:l=>{const u=l===i?"":l;m(u),a(!1),u&&o(t)},children:[t.column_name,n.jsx(e.CheckIcon,{className:e.cn("ml-auto h-4 w-4",i===t.column_name?"opacity-100":"opacity-0")})]},t.column_name))})]})]})})]})}exports.FrameFilters=j;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { jsxs as s, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { e as f, u as p, d as h, f as C, L as F, F as S, P as b, g as v, B as w, h as x, i as N, j as g, k as y, l as I, m as _, n as j, o as k, p as E, q as P } from "./index--MUeDITx.js";
|
|
3
|
+
import * as u from "react";
|
|
4
|
+
import "react-dom";
|
|
5
|
+
import { u as A } from "./use-assign-filter-5gplfsO1.js";
|
|
6
|
+
function D() {
|
|
7
|
+
const n = f(
|
|
8
|
+
(e) => e.dashboard.filters
|
|
9
|
+
), r = p((e) => e.frame), { setFrame: m } = h(), { columns: i } = C(), { assignFilter: o } = A();
|
|
10
|
+
function c(e) {
|
|
11
|
+
const l = o(e, "frame");
|
|
12
|
+
m({ ...r, filterId: l });
|
|
13
|
+
}
|
|
14
|
+
const t = n == null ? void 0 : n.find((e) => e.id === r.filterId);
|
|
15
|
+
return /* @__PURE__ */ s("div", { className: "space-y-3", children: [
|
|
16
|
+
/* @__PURE__ */ a(F, { children: "Card Filter" }),
|
|
17
|
+
/* @__PURE__ */ a(L, { onSelect: c, columns: i }),
|
|
18
|
+
t && /* @__PURE__ */ a(S, { filter: t })
|
|
19
|
+
] });
|
|
20
|
+
}
|
|
21
|
+
function L({
|
|
22
|
+
columns: n,
|
|
23
|
+
onSelect: r
|
|
24
|
+
}) {
|
|
25
|
+
var t;
|
|
26
|
+
const [m, i] = u.useState(!1), [o, c] = u.useState("");
|
|
27
|
+
return /* @__PURE__ */ s(b, { open: m, onOpenChange: i, children: [
|
|
28
|
+
/* @__PURE__ */ a(v, { asChild: !0, children: /* @__PURE__ */ s(
|
|
29
|
+
w,
|
|
30
|
+
{
|
|
31
|
+
size: "sm",
|
|
32
|
+
variant: "outline",
|
|
33
|
+
role: "combobox",
|
|
34
|
+
"aria-expanded": m,
|
|
35
|
+
className: "w-full justify-between font-normal",
|
|
36
|
+
children: [
|
|
37
|
+
o ? (t = n.find((e) => e.column_name === o)) == null ? void 0 : t.column_name : "Select Column...",
|
|
38
|
+
/* @__PURE__ */ a(x, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
) }),
|
|
42
|
+
/* @__PURE__ */ a(N, { className: "w-[200px] p-0", children: /* @__PURE__ */ s(g, { children: [
|
|
43
|
+
/* @__PURE__ */ a(y, { placeholder: "Search column", className: "h-9" }),
|
|
44
|
+
/* @__PURE__ */ s(I, { children: [
|
|
45
|
+
/* @__PURE__ */ a(_, { children: "No framework found." }),
|
|
46
|
+
/* @__PURE__ */ a(j, { children: n == null ? void 0 : n.map((e) => /* @__PURE__ */ s(
|
|
47
|
+
k,
|
|
48
|
+
{
|
|
49
|
+
value: e.column_name,
|
|
50
|
+
onSelect: (l) => {
|
|
51
|
+
const d = l === o ? "" : l;
|
|
52
|
+
c(d), i(!1), d && r(e);
|
|
53
|
+
},
|
|
54
|
+
children: [
|
|
55
|
+
e.column_name,
|
|
56
|
+
/* @__PURE__ */ a(
|
|
57
|
+
E,
|
|
58
|
+
{
|
|
59
|
+
className: P(
|
|
60
|
+
"ml-auto h-4 w-4",
|
|
61
|
+
o === e.column_name ? "opacity-100" : "opacity-0"
|
|
62
|
+
)
|
|
63
|
+
}
|
|
64
|
+
)
|
|
65
|
+
]
|
|
66
|
+
},
|
|
67
|
+
e.column_name
|
|
68
|
+
)) })
|
|
69
|
+
] })
|
|
70
|
+
] }) })
|
|
71
|
+
] });
|
|
72
|
+
}
|
|
73
|
+
export {
|
|
74
|
+
D as F
|
|
75
|
+
};
|