@pstdio/ui 0.43.1 → 0.44.0-nightly.20261015030224
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/chat-ui.d.ts +50 -50
- package/dist/collection-view.d.ts +3 -90
- package/dist/data-table-stat-chart-content-waJAm_nt.js +125 -0
- package/dist/data-table-stat-chart-content-waJAm_nt.js.map +1 -0
- package/dist/data-table.d.ts +2 -1
- package/dist/data-table.js +700 -399
- package/dist/data-table.js.map +1 -1
- package/dist/{index-DXpADqIg.d.ts → index-0ZbpwSzu.d.ts} +1 -1
- package/dist/index-CvrqviEK.d.ts +91 -0
- package/dist/index.d.ts +50 -50
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/kanban-renderer.d.ts +1 -1
- package/dist/{workspace-badge-De6OQjb5.d.ts → workspace-badge-CvQBU6Hs.d.ts} +1 -1
- package/package.json +2 -2
- package/dist/data-table-stats-row-83mX8b1B.js +0 -415
- package/dist/data-table-stats-row-83mX8b1B.js.map +0 -1
package/dist/chat-ui.d.ts
CHANGED
|
@@ -14,63 +14,19 @@ export declare const ChatPrimitives: {
|
|
|
14
14
|
onChange?: import("react").ChangeEventHandler<HTMLDivElement, Element> | undefined;
|
|
15
15
|
onError?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
16
16
|
onSubmit?: import("react").SubmitEventHandler<HTMLDivElement> | undefined;
|
|
17
|
-
resource?: string | undefined | undefined;
|
|
18
17
|
id?: string | undefined | undefined;
|
|
18
|
+
resource?: string | undefined | undefined;
|
|
19
19
|
children: ((context: import("use-stick-to-bottom").StickToBottomContext) => import("react").ReactNode) | import("react").ReactNode;
|
|
20
|
-
slot?: string | undefined | undefined;
|
|
21
|
-
style?: import("react").CSSProperties | undefined;
|
|
22
|
-
title?: string | undefined | undefined;
|
|
23
|
-
color?: string | undefined | undefined;
|
|
24
|
-
content?: string | undefined | undefined;
|
|
25
|
-
translate?: "yes" | "no" | undefined | undefined;
|
|
26
|
-
initial?: (import("use-stick-to-bottom").Animation | boolean) | undefined;
|
|
27
|
-
hidden?: boolean | undefined | undefined;
|
|
28
|
-
"aria-roledescription"?: string | undefined | undefined;
|
|
29
|
-
role?: import("react").AriaRole | undefined;
|
|
30
|
-
defaultChecked?: boolean | undefined | undefined;
|
|
31
|
-
defaultValue?: string | number | readonly string[] | undefined;
|
|
32
|
-
suppressContentEditableWarning?: boolean | undefined | undefined;
|
|
33
20
|
suppressHydrationWarning?: boolean | undefined | undefined;
|
|
34
|
-
accessKey?: string | undefined | undefined;
|
|
35
|
-
autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {}) | undefined;
|
|
36
|
-
autoFocus?: boolean | undefined | undefined;
|
|
37
21
|
className?: string | undefined | undefined;
|
|
38
|
-
|
|
39
|
-
contextMenu?: string | undefined | undefined;
|
|
40
|
-
dir?: string | undefined | undefined;
|
|
41
|
-
draggable?: (boolean | "true" | "false") | undefined;
|
|
42
|
-
enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
|
|
22
|
+
color?: string | undefined | undefined;
|
|
43
23
|
lang?: string | undefined | undefined;
|
|
44
24
|
nonce?: string | undefined | undefined;
|
|
45
|
-
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
46
|
-
tabIndex?: number | undefined | undefined;
|
|
47
|
-
radioGroup?: string | undefined | undefined;
|
|
48
|
-
about?: string | undefined | undefined;
|
|
49
|
-
datatype?: string | undefined | undefined;
|
|
50
|
-
inlist?: any;
|
|
51
|
-
prefix?: string | undefined | undefined;
|
|
52
|
-
property?: string | undefined | undefined;
|
|
53
|
-
rel?: string | undefined | undefined;
|
|
54
|
-
rev?: string | undefined | undefined;
|
|
55
|
-
typeof?: string | undefined | undefined;
|
|
56
|
-
vocab?: string | undefined | undefined;
|
|
57
|
-
autoCorrect?: string | undefined | undefined;
|
|
58
|
-
autoSave?: string | undefined | undefined;
|
|
59
|
-
itemProp?: string | undefined | undefined;
|
|
60
|
-
itemScope?: boolean | undefined | undefined;
|
|
61
|
-
itemType?: string | undefined | undefined;
|
|
62
|
-
itemID?: string | undefined | undefined;
|
|
63
|
-
itemRef?: string | undefined | undefined;
|
|
64
|
-
results?: number | undefined | undefined;
|
|
65
|
-
security?: string | undefined | undefined;
|
|
66
|
-
unselectable?: "on" | "off" | undefined | undefined;
|
|
67
|
-
popover?: "" | "auto" | "manual" | "hint" | undefined | undefined;
|
|
68
|
-
popoverTargetAction?: "toggle" | "show" | "hide" | undefined | undefined;
|
|
69
|
-
popoverTarget?: string | undefined | undefined;
|
|
70
|
-
inert?: boolean | undefined | undefined;
|
|
71
|
-
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined | undefined;
|
|
72
|
-
exportparts?: string | undefined | undefined;
|
|
73
25
|
part?: string | undefined | undefined;
|
|
26
|
+
slot?: string | undefined | undefined;
|
|
27
|
+
style?: import("react").CSSProperties | undefined;
|
|
28
|
+
role?: import("react").AriaRole | undefined;
|
|
29
|
+
tabIndex?: number | undefined | undefined;
|
|
74
30
|
"aria-activedescendant"?: string | undefined | undefined;
|
|
75
31
|
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
76
32
|
"aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined | undefined;
|
|
@@ -112,6 +68,7 @@ export declare const ChatPrimitives: {
|
|
|
112
68
|
"aria-readonly"?: (boolean | "true" | "false") | undefined;
|
|
113
69
|
"aria-relevant"?: "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text" | "text additions" | "text removals" | undefined | undefined;
|
|
114
70
|
"aria-required"?: (boolean | "true" | "false") | undefined;
|
|
71
|
+
"aria-roledescription"?: string | undefined | undefined;
|
|
115
72
|
"aria-rowcount"?: number | undefined | undefined;
|
|
116
73
|
"aria-rowindex"?: number | undefined | undefined;
|
|
117
74
|
"aria-rowindextext"?: string | undefined | undefined;
|
|
@@ -291,6 +248,49 @@ export declare const ChatPrimitives: {
|
|
|
291
248
|
onTransitionRunCapture?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
292
249
|
onTransitionStart?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
293
250
|
onTransitionStartCapture?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
251
|
+
title?: string | undefined | undefined;
|
|
252
|
+
content?: string | undefined | undefined;
|
|
253
|
+
translate?: "yes" | "no" | undefined | undefined;
|
|
254
|
+
initial?: (import("use-stick-to-bottom").Animation | boolean) | undefined;
|
|
255
|
+
hidden?: boolean | undefined | undefined;
|
|
256
|
+
defaultChecked?: boolean | undefined | undefined;
|
|
257
|
+
defaultValue?: string | number | readonly string[] | undefined;
|
|
258
|
+
suppressContentEditableWarning?: boolean | undefined | undefined;
|
|
259
|
+
accessKey?: string | undefined | undefined;
|
|
260
|
+
autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {}) | undefined;
|
|
261
|
+
autoFocus?: boolean | undefined | undefined;
|
|
262
|
+
contentEditable?: "inherit" | (boolean | "true" | "false") | "plaintext-only" | undefined;
|
|
263
|
+
contextMenu?: string | undefined | undefined;
|
|
264
|
+
dir?: string | undefined | undefined;
|
|
265
|
+
draggable?: (boolean | "true" | "false") | undefined;
|
|
266
|
+
enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
|
|
267
|
+
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
268
|
+
radioGroup?: string | undefined | undefined;
|
|
269
|
+
about?: string | undefined | undefined;
|
|
270
|
+
datatype?: string | undefined | undefined;
|
|
271
|
+
inlist?: any;
|
|
272
|
+
prefix?: string | undefined | undefined;
|
|
273
|
+
property?: string | undefined | undefined;
|
|
274
|
+
rel?: string | undefined | undefined;
|
|
275
|
+
rev?: string | undefined | undefined;
|
|
276
|
+
typeof?: string | undefined | undefined;
|
|
277
|
+
vocab?: string | undefined | undefined;
|
|
278
|
+
autoCorrect?: string | undefined | undefined;
|
|
279
|
+
autoSave?: string | undefined | undefined;
|
|
280
|
+
itemProp?: string | undefined | undefined;
|
|
281
|
+
itemScope?: boolean | undefined | undefined;
|
|
282
|
+
itemType?: string | undefined | undefined;
|
|
283
|
+
itemID?: string | undefined | undefined;
|
|
284
|
+
itemRef?: string | undefined | undefined;
|
|
285
|
+
results?: number | undefined | undefined;
|
|
286
|
+
security?: string | undefined | undefined;
|
|
287
|
+
unselectable?: "on" | "off" | undefined | undefined;
|
|
288
|
+
popover?: "" | "auto" | "manual" | "hint" | undefined | undefined;
|
|
289
|
+
popoverTargetAction?: "toggle" | "show" | "hide" | undefined | undefined;
|
|
290
|
+
popoverTarget?: string | undefined | undefined;
|
|
291
|
+
inert?: boolean | undefined | undefined;
|
|
292
|
+
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined | undefined;
|
|
293
|
+
exportparts?: string | undefined | undefined;
|
|
294
294
|
damping?: number | undefined;
|
|
295
295
|
stiffness?: number | undefined;
|
|
296
296
|
mass?: number | undefined;
|
|
@@ -1,91 +1,4 @@
|
|
|
1
|
-
import { A as CollectionSavedView, F as ViewFilterGroup, I as ViewFilterRule, L as ViewSort, M as CollectionViewsSource, N as EMPTY_VIEW_FILTER, a as CollectionViewStoreState, i as CollectionViewStoreInitialState, j as CollectionViewState, o as useCollectionViewStore, r as withTitleField
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
//#region src/components/collection-view/filter-rule-value.d.ts
|
|
5
|
-
interface RuleValueOption {
|
|
6
|
-
value: string;
|
|
7
|
-
label: string;
|
|
8
|
-
count?: number;
|
|
9
|
-
icon?: string | null;
|
|
10
|
-
color?: string;
|
|
11
|
-
}
|
|
12
|
-
//#endregion
|
|
13
|
-
//#region src/components/collection-view/collection-filter.d.ts
|
|
14
|
-
interface CollectionFilterProps {
|
|
15
|
-
itemLabel?: string;
|
|
16
|
-
fields: AttributeDescriptor[];
|
|
17
|
-
filter: ViewFilterGroup$1;
|
|
18
|
-
optionsFor: (field: AttributeDescriptor) => RuleValueOption[];
|
|
19
|
-
onFilterChange: (filter: ViewFilterGroup$1) => void;
|
|
20
|
-
}
|
|
21
|
-
/** The collection picker and editable criteria, without saved views or search. */
|
|
22
|
-
export declare function CollectionFilter(props: CollectionFilterProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
-
//#endregion
|
|
24
|
-
//#region src/components/collection-view/collection-view-bar.d.ts
|
|
25
|
-
interface CollectionViewBarProps<TSettings> {
|
|
26
|
-
storageKey: string;
|
|
27
|
-
/** Singular resource label used as the subject of boolean predicates. */
|
|
28
|
-
itemLabel?: string;
|
|
29
|
-
initialState: CollectionViewStoreInitialState<TSettings>;
|
|
30
|
-
views: (CollectionSavedView<TSettings> & {
|
|
31
|
-
builtIn: boolean;
|
|
32
|
-
})[];
|
|
33
|
-
viewsSource?: CollectionViewsSource<TSettings>;
|
|
34
|
-
/** Every field of the view. Filter offers the filterable ones and Sort the sortable ones. */
|
|
35
|
-
fields: AttributeDescriptor[];
|
|
36
|
-
optionsFor: (field: AttributeDescriptor) => RuleValueOption[];
|
|
37
|
-
/** Search is screen state owned by the renderer. It is never saved. */
|
|
38
|
-
search: string;
|
|
39
|
-
onSearchChange: (value: string) => void;
|
|
40
|
-
searchResultLabel?: string;
|
|
41
|
-
leading?: ReactNode;
|
|
42
|
-
actions?: ReactNode;
|
|
43
|
-
displayControl: ReactNode;
|
|
44
|
-
align?: "split" | "end";
|
|
45
|
-
}
|
|
46
|
-
/** One view bar for data tables and both kanban displays: saved views, then Search, Filter, and Display. */
|
|
47
|
-
export declare const CollectionViewBar: <TSettings>(props: CollectionViewBarProps<TSettings>) => import("react/jsx-runtime").JSX.Element;
|
|
48
|
-
//#endregion
|
|
49
|
-
//#region src/components/collection-view/collection-view-filter.d.ts
|
|
50
|
-
/** Rules that are incomplete or no longer fit a field are skipped, so they never hide rows. */
|
|
51
|
-
export declare const filterRowsByView: <TRow extends KanbanRendererRow>(rows: TRow[], filter: ViewFilterGroup$1, fields: AttributeDescriptor[], today?: Date) => TRow[];
|
|
52
|
-
//#endregion
|
|
53
|
-
//#region src/components/collection-view/collection-view-search.d.ts
|
|
54
|
-
/** Search only looks at the text a view shows, which the caller collects per row. */
|
|
55
|
-
export declare const searchRows: <TRow>(rows: TRow[], query: string, textsOf: (row: TRow) => string[]) => TRow[];
|
|
56
|
-
//#endregion
|
|
57
|
-
//#region src/components/collection-view/use-collection-views.d.ts
|
|
58
|
-
interface CollectionViewsInput<TSettings> {
|
|
59
|
-
storageKey: string;
|
|
60
|
-
fields?: AttributeDescriptor[];
|
|
61
|
-
initialState: CollectionViewStoreInitialState<TSettings>;
|
|
62
|
-
viewsSource?: CollectionViewsSource<TSettings>;
|
|
63
|
-
defaultViews?: CollectionSavedView<TSettings>[];
|
|
64
|
-
defaultActiveViewId?: string;
|
|
65
|
-
}
|
|
66
|
-
/** Picks the views a renderer offers and keeps the store on a view that still exists. */
|
|
67
|
-
export declare const useCollectionViews: <TSettings>(input: CollectionViewsInput<TSettings>) => {
|
|
68
|
-
views: (CollectionSavedView<TSettings> & {
|
|
69
|
-
builtIn: boolean;
|
|
70
|
-
})[];
|
|
71
|
-
defaultId: string | undefined;
|
|
72
|
-
};
|
|
73
|
-
//#endregion
|
|
74
|
-
//#region src/components/collection-view/view-bar-popover.d.ts
|
|
75
|
-
interface ViewBarPopoverProps {
|
|
76
|
-
open: boolean;
|
|
77
|
-
onOpenChange: (open: boolean) => void;
|
|
78
|
-
/** The button the menu opens from. Several buttons can open the same menu. */
|
|
79
|
-
anchorRef: RefObject<HTMLElement | null>;
|
|
80
|
-
width: string;
|
|
81
|
-
placement?: "bottom-start" | "bottom-end";
|
|
82
|
-
/** The quick picker draws its own panes edge to edge. */
|
|
83
|
-
padding?: "0" | "2xs";
|
|
84
|
-
testId?: string;
|
|
85
|
-
children: ReactNode;
|
|
86
|
-
}
|
|
87
|
-
/** The menu shell for Search, Filter, and Sort. Menus inside it render in place, so using them never closes it. */
|
|
88
|
-
export declare const ViewBarPopover: (props: ViewBarPopoverProps) => import("react/jsx-runtime").JSX.Element;
|
|
89
|
-
//#endregion
|
|
90
|
-
export { type CollectionFilterProps, type CollectionSavedView, type CollectionViewBarProps, type CollectionViewState, type CollectionViewStoreInitialState, type CollectionViewStoreState, type CollectionViewsInput, type CollectionViewsSource, EMPTY_VIEW_FILTER, type ViewBarPopoverProps, type ViewFilterGroup, type ViewFilterRule, type ViewSort, useCollectionViewStore, withTitleField };
|
|
1
|
+
import { A as CollectionSavedView, F as ViewFilterGroup, I as ViewFilterRule, L as ViewSort, M as CollectionViewsSource, N as EMPTY_VIEW_FILTER, a as CollectionViewStoreState, i as CollectionViewStoreInitialState, j as CollectionViewState, o as useCollectionViewStore, r as withTitleField } from "./collection-view-fields-B3fhsgn7.js";
|
|
2
|
+
import { a as searchRows, c as CollectionViewBarProps, i as useCollectionViews, l as CollectionFilter, n as ViewBarPopoverProps, o as filterRowsByView, r as CollectionViewsInput, s as CollectionViewBar, t as ViewBarPopover, u as CollectionFilterProps } from "./index-CvrqviEK.js";
|
|
3
|
+
export { CollectionFilter, type CollectionFilterProps, type CollectionSavedView, CollectionViewBar, type CollectionViewBarProps, type CollectionViewState, type CollectionViewStoreInitialState, type CollectionViewStoreState, type CollectionViewsInput, type CollectionViewsSource, EMPTY_VIEW_FILTER, ViewBarPopover, type ViewBarPopoverProps, type ViewFilterGroup, type ViewFilterRule, type ViewSort, filterRowsByView, searchRows, useCollectionViewStore, useCollectionViews, withTitleField };
|
|
91
4
|
export {};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { c as e } from "react/compiler-runtime";
|
|
2
|
+
import { Fragment as t, jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
3
|
+
import { Chart as i, useChart as a } from "@chakra-ui/charts";
|
|
4
|
+
import { Bar as o, BarChart as s, Tooltip as c, XAxis as l, YAxis as u, useActiveTooltipCoordinate as d, usePlotArea as f } from "recharts";
|
|
5
|
+
//#region src/components/data-table/data-table-stat-chart-content.tsx
|
|
6
|
+
var p = () => {
|
|
7
|
+
let t = e(11), i = d(), a = f();
|
|
8
|
+
if (!i || !a) return null;
|
|
9
|
+
let o = a.y + a.height, s;
|
|
10
|
+
t[0] !== i.x || t[1] !== a.y || t[2] !== o ? (s = /* @__PURE__ */ n("line", {
|
|
11
|
+
x1: i.x,
|
|
12
|
+
x2: i.x,
|
|
13
|
+
y1: a.y,
|
|
14
|
+
y2: o
|
|
15
|
+
}), t[0] = i.x, t[1] = a.y, t[2] = o, t[3] = s) : s = t[3];
|
|
16
|
+
let c = a.x + a.width, l;
|
|
17
|
+
t[4] !== i.y || t[5] !== a.x || t[6] !== c ? (l = /* @__PURE__ */ n("line", {
|
|
18
|
+
x1: a.x,
|
|
19
|
+
x2: c,
|
|
20
|
+
y1: i.y,
|
|
21
|
+
y2: i.y
|
|
22
|
+
}), t[4] = i.y, t[5] = a.x, t[6] = c, t[7] = l) : l = t[7];
|
|
23
|
+
let u;
|
|
24
|
+
return t[8] !== s || t[9] !== l ? (u = /* @__PURE__ */ r("g", {
|
|
25
|
+
pointerEvents: "none",
|
|
26
|
+
stroke: "var(--chakra-colors-border-emphasized)",
|
|
27
|
+
strokeWidth: "1",
|
|
28
|
+
children: [s, l]
|
|
29
|
+
}), t[8] = s, t[9] = l, t[10] = u) : u = t[10], u;
|
|
30
|
+
}, m = (d) => {
|
|
31
|
+
let f = e(46), { data: m, dataKey: h, color: g, height: _, tooltipLabel: v, tooltipValue: y, tooltipSeriesLabel: b, layout: x, categoryKey: S, domain: C, barSize: w, barCategoryGap: T } = d, E = x === void 0 ? "horizontal" : x, D = T === void 0 ? 1 : T, O;
|
|
32
|
+
f[0] !== g || f[1] !== h ? (O = [{
|
|
33
|
+
name: h,
|
|
34
|
+
color: g
|
|
35
|
+
}], f[0] = g, f[1] = h, f[2] = O) : O = f[2];
|
|
36
|
+
let k;
|
|
37
|
+
f[3] !== m || f[4] !== O ? (k = {
|
|
38
|
+
data: m,
|
|
39
|
+
series: O
|
|
40
|
+
}, f[3] = m, f[4] = O, f[5] = k) : k = f[5];
|
|
41
|
+
let A = a(k), j;
|
|
42
|
+
f[6] === h ? j = f[7] : (j = (e) => e[h], f[6] = h, f[7] = j);
|
|
43
|
+
let M = j, N;
|
|
44
|
+
f[8] === S ? N = f[9] : (N = S ? (e) => e[S] : void 0, f[8] = S, f[9] = N);
|
|
45
|
+
let P = N, F = A.data, I;
|
|
46
|
+
f[10] === Symbol.for("react.memo_cache_sentinel") ? (I = {
|
|
47
|
+
top: 2,
|
|
48
|
+
right: 0,
|
|
49
|
+
bottom: 0,
|
|
50
|
+
left: 0
|
|
51
|
+
}, f[10] = I) : I = f[10];
|
|
52
|
+
let L;
|
|
53
|
+
f[11] !== C || f[12] !== P || f[13] !== E ? (L = E === "vertical" ? /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ n(l, {
|
|
54
|
+
type: "number",
|
|
55
|
+
domain: C,
|
|
56
|
+
hide: !0
|
|
57
|
+
}), /* @__PURE__ */ n(u, {
|
|
58
|
+
type: "category",
|
|
59
|
+
dataKey: P,
|
|
60
|
+
hide: !0
|
|
61
|
+
})] }) : null, f[11] = C, f[12] = P, f[13] = E, f[14] = L) : L = f[14];
|
|
62
|
+
let R;
|
|
63
|
+
f[15] !== A || f[16] !== g ? (R = A.color(g), f[15] = A, f[16] = g, f[17] = R) : R = f[17];
|
|
64
|
+
let z;
|
|
65
|
+
f[18] !== w || f[19] !== M || f[20] !== R ? (z = /* @__PURE__ */ n(o, {
|
|
66
|
+
dataKey: M,
|
|
67
|
+
fill: R,
|
|
68
|
+
barSize: w,
|
|
69
|
+
isAnimationActive: !1
|
|
70
|
+
}), f[18] = w, f[19] = M, f[20] = R, f[21] = z) : z = f[21];
|
|
71
|
+
let B;
|
|
72
|
+
f[22] === Symbol.for("react.memo_cache_sentinel") ? (B = {
|
|
73
|
+
x: !0,
|
|
74
|
+
y: !0
|
|
75
|
+
}, f[22] = B) : B = f[22];
|
|
76
|
+
let V;
|
|
77
|
+
f[23] === v ? V = f[24] : (V = (e, t) => {
|
|
78
|
+
let n = t[0]?.payload;
|
|
79
|
+
return n ? v(n) : e;
|
|
80
|
+
}, f[23] = v, f[24] = V);
|
|
81
|
+
let H;
|
|
82
|
+
f[25] !== b || f[26] !== y ? (H = (e) => [y(e), b], f[25] = b, f[26] = y, f[27] = H) : H = f[27];
|
|
83
|
+
let U;
|
|
84
|
+
f[28] !== V || f[29] !== H ? (U = /* @__PURE__ */ n(i.Tooltip, {
|
|
85
|
+
labelFormatter: V,
|
|
86
|
+
formatter: H
|
|
87
|
+
}), f[28] = V, f[29] = H, f[30] = U) : U = f[30];
|
|
88
|
+
let W;
|
|
89
|
+
f[31] === Symbol.for("react.memo_cache_sentinel") ? (W = /* @__PURE__ */ n(p, {}), f[31] = W) : W = f[31];
|
|
90
|
+
let G;
|
|
91
|
+
f[32] === Symbol.for("react.memo_cache_sentinel") ? (G = { zIndex: 1800 }, f[32] = G) : G = f[32];
|
|
92
|
+
let K;
|
|
93
|
+
f[33] === U ? K = f[34] : (K = /* @__PURE__ */ n(c, {
|
|
94
|
+
allowEscapeViewBox: B,
|
|
95
|
+
content: U,
|
|
96
|
+
cursor: W,
|
|
97
|
+
isAnimationActive: !1,
|
|
98
|
+
wrapperStyle: G
|
|
99
|
+
}), f[33] = U, f[34] = K);
|
|
100
|
+
let q;
|
|
101
|
+
f[35] !== D || f[36] !== A.data || f[37] !== E || f[38] !== z || f[39] !== K || f[40] !== L ? (q = /* @__PURE__ */ r(s, {
|
|
102
|
+
responsive: !0,
|
|
103
|
+
data: F,
|
|
104
|
+
layout: E,
|
|
105
|
+
margin: I,
|
|
106
|
+
barCategoryGap: D,
|
|
107
|
+
children: [
|
|
108
|
+
L,
|
|
109
|
+
z,
|
|
110
|
+
K
|
|
111
|
+
]
|
|
112
|
+
}), f[35] = D, f[36] = A.data, f[37] = E, f[38] = z, f[39] = K, f[40] = L, f[41] = q) : q = f[41];
|
|
113
|
+
let J;
|
|
114
|
+
return f[42] !== A || f[43] !== _ || f[44] !== q ? (J = /* @__PURE__ */ n(i.Root, {
|
|
115
|
+
chart: A,
|
|
116
|
+
height: _,
|
|
117
|
+
aspectRatio: "auto",
|
|
118
|
+
cursor: "crosshair",
|
|
119
|
+
children: q
|
|
120
|
+
}), f[42] = A, f[43] = _, f[44] = q, f[45] = J) : J = f[45], J;
|
|
121
|
+
};
|
|
122
|
+
//#endregion
|
|
123
|
+
export { m as DataTableStatChart };
|
|
124
|
+
|
|
125
|
+
//# sourceMappingURL=data-table-stat-chart-content-waJAm_nt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-table-stat-chart-content-waJAm_nt.js","names":["Chart","UseChartProps","useChart","ReactNode","Bar","BarChart","Tooltip","RechartsTooltip","useActiveTooltipCoordinate","usePlotArea","XAxis","YAxis","ChartSeries","NonNullable","T","StringKeyOf","Extract","StatChartCrosshair","$","_c","coordinate","plotArea","t0","y","height","t1","x","t2","width","t3","t4","DataTableStatChartProps","data","dataKey","color","ariaLabel","tooltipLabel","datum","tooltipValue","value","tooltipSeriesLabel","layout","categoryKey","domain","barSize","barCategoryGap","DataTableStatChart","props","undefined","name","series","chart","getBarValue","t5","datum_0","getCategoryValue","t6","t7","Symbol","for","top","right","bottom","left","t8","t9","t10","t11","t12","label","payload","datum_1","t13","t14","t15","t16","zIndex","t17","t18","t19","_c","_Fragment","RechartsTooltip","StatChartCrosshair","$","c","coordinate","useActiveTooltipCoordinate","plotArea","usePlotArea","t0","t1","t2","t3","t4","DataTableStatChart","props","layout","barCategoryGap","color","dataKey","data","chart","useChart","datum","getBarValue","t5","categoryKey","datum_0","getCategoryValue","t6","t7","t8","domain","Fragment","XAxis","YAxis","t9","t10","barSize","Bar","t11","t12","tooltipLabel","datum_1","payload","label","t13","tooltipSeriesLabel","tooltipValue","value","t14","Chart","t15","t16","t17","Tooltip","t18","BarChart","t19","height"],"sources":["../src/components/data-table/data-table-stat-chart-content.tsx"],"sourcesContent":["import { Chart, type UseChartProps, useChart } from \"@chakra-ui/charts\";\nimport type { ReactNode } from \"react\";\nimport {\n Bar,\n BarChart,\n Tooltip as RechartsTooltip,\n useActiveTooltipCoordinate,\n usePlotArea,\n XAxis,\n YAxis,\n} from \"recharts\";\n\ntype ChartSeries<T> = NonNullable<UseChartProps<T>[\"series\"]>[number];\ntype StringKeyOf<T> = Extract<keyof T, string>;\n\nconst StatChartCrosshair = () => {\n const coordinate = useActiveTooltipCoordinate();\n const plotArea = usePlotArea();\n\n if (!coordinate || !plotArea) return null;\n\n return (\n <g pointerEvents=\"none\" stroke=\"var(--chakra-colors-border-emphasized)\" strokeWidth=\"1\">\n <line x1={coordinate.x} x2={coordinate.x} y1={plotArea.y} y2={plotArea.y + plotArea.height} />\n <line x1={plotArea.x} x2={plotArea.x + plotArea.width} y1={coordinate.y} y2={coordinate.y} />\n </g>\n );\n};\n\nexport interface DataTableStatChartProps<T extends object> {\n data: T[];\n dataKey: StringKeyOf<T>;\n color: ChartSeries<T>[\"color\"];\n height: string;\n ariaLabel: string;\n tooltipLabel: (datum: T) => ReactNode;\n tooltipValue: (value: string | number) => ReactNode;\n tooltipSeriesLabel: string;\n layout?: \"horizontal\" | \"vertical\";\n categoryKey?: StringKeyOf<T>;\n domain?: [number, number];\n barSize?: number;\n barCategoryGap?: number;\n}\n\nexport const DataTableStatChart = <T extends object>(props: DataTableStatChartProps<T>) => {\n const {\n data,\n dataKey,\n color,\n height,\n tooltipLabel,\n tooltipValue,\n tooltipSeriesLabel,\n layout = \"horizontal\",\n categoryKey,\n domain,\n barSize,\n barCategoryGap = 1,\n } = props;\n const chart = useChart({ data, series: [{ name: dataKey, color }] });\n const getBarValue = (datum: T) => datum[dataKey] as string | number;\n const getCategoryValue = categoryKey ? (datum: T) => datum[categoryKey] as string | number : undefined;\n\n return (\n <Chart.Root chart={chart} height={height} aspectRatio=\"auto\" cursor=\"crosshair\">\n <BarChart\n responsive\n data={chart.data}\n layout={layout}\n margin={{ top: 2, right: 0, bottom: 0, left: 0 }}\n barCategoryGap={barCategoryGap}\n >\n {layout === \"vertical\" ? (\n <>\n <XAxis type=\"number\" domain={domain} hide />\n <YAxis type=\"category\" dataKey={getCategoryValue} hide />\n </>\n ) : null}\n <Bar dataKey={getBarValue} fill={chart.color(color)} barSize={barSize} isAnimationActive={false} />\n <RechartsTooltip\n allowEscapeViewBox={{ x: true, y: true }}\n content={\n <Chart.Tooltip\n labelFormatter={(label, payload) => {\n const datum = payload[0]?.payload as T | undefined;\n return datum ? tooltipLabel(datum) : label;\n }}\n formatter={(value) => [tooltipValue(value), tooltipSeriesLabel]}\n />\n }\n cursor={<StatChartCrosshair />}\n isAnimationActive={false}\n wrapperStyle={{ zIndex: 1800 }}\n />\n </BarChart>\n </Chart.Root>\n );\n};\n"],"mappings":";;;;;AAeA,IAAMiB,UAAqB;CAAA,IAAAC,IAAAC,EAAA,EAAA,GACzBC,IAAmBZ,EAA2B,GAC9Ca,IAAiBZ,EAAY;CAE7B,IAAI,CAACW,KAAD,CAAgBC,GAAQ,OAAS;CAI6B,IAAAC,IAAAD,EAAQE,IAAKF,EAAQG,QAAOC;CAAA,AAAAP,EAAA,OAAAE,EAAAM,KAAAR,EAAA,OAAAG,EAAAE,KAAAL,EAAA,OAAAI,KAA1FG,IAAA,kBAAA,QAAA;EAAU,IAAAL,EAAUM;EAAQ,IAAAN,EAAUM;EAAQ,IAAAL,EAAQE;EAAQ,IAAAD;CAA4B,CAAA,GAAIJ,EAAA,KAAAE,EAAAM,GAAAR,EAAA,KAAAG,EAAAE,GAAAL,EAAA,KAAAI,GAAAJ,EAAA,KAAAO,KAAAA,IAAAP,EAAA;CACpE,IAAAS,IAAAN,EAAQK,IAAKL,EAAQO,OAAMC;CAAA,AAAAX,EAAA,OAAAE,EAAAG,KAAAL,EAAA,OAAAG,EAAAK,KAAAR,EAAA,OAAAS,KAArDE,IAAA,kBAAA,QAAA;EAAU,IAAAR,EAAQK;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AA,IAAAzD,EAAA;CAAA,IAAA2D;CAAA,AAAA3D,EAAA,QAAAuD,IAC9BI,IAAA3D,EAAA,OAdF2D,IAAA,kBAACK,GAAD;EACsB,oBAAAf;EAElB,SAAAM;EAQM,QAAAC;EACW,mBAAA;EACL,cAAAC;CAAgB,CAAA,GAC9BzD,EAAA,MAAAuD,GAAAvD,EAAA,MAAA2D;CAAA,IAAAC;CAAA,AAAA5D,EAAA,QAAA2B,KAAA3B,EAAA,QAAAiC,EAAAnB,QAAAd,EAAA,QAAAuB,KAAAvB,EAAA,QAAAgD,KAAAhD,EAAA,QAAA2D,KAAA3D,EAAA,QAAA8C,KA5BJc,IAAA,kBAAC4D,GAAD;EACE,YAAA;EACM,MAAAlF;EACEf;EACA,QAAAgB;EACQZ;EALlB,UAAA;GAOGmB;GAMDE;GACAW;EAdO;KA6BE3D,EAAA,MAAA2B,GAAA3B,EAAA,MAAAiC,EAAAnB,MAAAd,EAAA,MAAAuB,GAAAvB,EAAA,MAAAgD,GAAAhD,EAAA,MAAA2D,GAAA3D,EAAA,MAAA8C,GAAA9C,EAAA,MAAA4D,KAAAA,IAAA5D,EAAA;CAAA,IAAA6D;CACA,OADA7D,EAAA,QAAAiC,KAAAjC,EAAA,QAAAM,KAAAN,EAAA,QAAA4D,KA9BbC,IAAA,kBAAAqD,EAAA,MAAA;EAAmBjF;EAAe3B;EAAoB,aAAA;EAAc,QAAA;EAClEsD,UAAAA;CA8BF,CAAA,GAAa5D,EAAA,MAAAiC,GAAAjC,EAAA,MAAAM,GAAAN,EAAA,MAAA4D,GAAA5D,EAAA,MAAA6D,KAAAA,IAAA7D,EAAA,KA/Bb6D;AA+Ba"}
|
package/dist/data-table.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { A as CollectionSavedView, M as CollectionViewsSource, a as CollectionViewStoreState } from "./collection-view-fields-B3fhsgn7.js";
|
|
2
|
-
import "./index-
|
|
2
|
+
import "./index-CvrqviEK.js";
|
|
3
|
+
import "./index-0ZbpwSzu.js";
|
|
3
4
|
import { ReactElement, ReactNode } from "react";
|
|
4
5
|
import { DataTableRendererSettings, ViewFilterGroup, ViewSort } from "@pstdio/sdk/extensions";
|
|
5
6
|
//#region src/components/data-table/types.d.ts
|