@pyck/react 0.0.5 → 0.0.6
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/checkmark-fJPHeX8N.js +62 -0
- package/dist/close-button-r3blTfSH.js +141 -0
- package/dist/components/avatar/index.js +96 -11
- package/dist/components/button/index.js +1 -1
- package/dist/components/carousel/index.js +35 -10
- package/dist/components/checkbox/index.js +103 -22
- package/dist/components/checkmark/index.js +1 -1
- package/dist/components/combobox/index.js +30 -6
- package/dist/components/data-list/index.js +19 -8
- package/dist/components/date-picker/index.js +1 -1
- package/dist/components/dialog/index.js +44 -13
- package/dist/components/display-date-value/index.js +2 -2
- package/dist/components/display-value/index.js +1 -1
- package/dist/components/drawer/index.js +17 -1
- package/dist/components/drilldown-menu/index.js +209 -78
- package/dist/components/field/index.js +89 -16
- package/dist/components/floating-panel/index.js +54 -43
- package/dist/components/form/index.js +115 -26
- package/dist/components/highlight/index.js +52 -14
- package/dist/components/icon/index.js +1 -1
- package/dist/components/image/index.js +27 -2
- package/dist/components/input/index.js +47 -4
- package/dist/components/input-group/index.js +56 -14
- package/dist/components/json-form-builder/index.js +245 -87
- package/dist/components/logo/index.js +46 -19
- package/dist/components/menu/index.js +28 -6
- package/dist/components/number-input/index.js +46 -7
- package/dist/components/page-header/index.js +45 -12
- package/dist/components/pagination/index.js +35 -13
- package/dist/components/progress/index.js +47 -8
- package/dist/components/progress-circle/index.js +66 -17
- package/dist/components/radio-group/index.js +47 -6
- package/dist/components/scroll-area/index.js +64 -9
- package/dist/components/segment-group/index.js +34 -5
- package/dist/components/select/index.js +85 -21
- package/dist/components/show/index.js +1 -1
- package/dist/components/skeleton/index.js +44 -4
- package/dist/components/slider/index.js +134 -37
- package/dist/components/spotlight/index.js +269 -125
- package/dist/components/steps/index.js +26 -12
- package/dist/components/switch/index.js +160 -29
- package/dist/components/table/index.js +370 -66
- package/dist/components/tags-input/index.js +17 -7
- package/dist/components/textarea/index.js +47 -4
- package/dist/components/toast/index.js +28 -22
- package/dist/components/tooltip/index.js +71 -14
- package/dist/components/tree-view/index.js +45 -8
- package/dist/display-date-value-BAU46P8s.js +40 -0
- package/dist/display-value-Bz71ZqgM.js +57 -0
- package/dist/{featured-icon-DPysOpSf.js → featured-icon-CKDv0xfF.js} +27 -4
- package/dist/show-DAysVQAC.js +27 -0
- package/dist/utils/index.js +164 -73
- package/package.json +5 -3
- package/dist/checkmark-CW-yHMvN.js +0 -18
- package/dist/close-button-BM7ikbYh.js +0 -52
- package/dist/display-date-value-gTlidtNz.js +0 -21
- package/dist/display-value-BNKxQ99u.js +0 -37
- package/dist/show-IaI-36v9.js +0 -12
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "../../chunk-BYypO7fO.js";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
2
3
|
import { forwardRef } from "react";
|
|
3
4
|
import { VisuallyHidden, createStyleContext, styled } from "@pyck/styled-system/jsx";
|
|
4
5
|
import { switchRecipe } from "@pyck/styled-system/recipes";
|
|
@@ -28,52 +29,182 @@ const HiddenInput = Switch$1.HiddenInput;
|
|
|
28
29
|
const Control = withContext(Switch$1.Control, "control", { defaultProps: { children: <Thumb /> } });
|
|
29
30
|
const StyledIndicator = withContext(ark.span, "indicator");
|
|
30
31
|
const Indicator = forwardRef(function Indicator(props, ref) {
|
|
31
|
-
const
|
|
32
|
+
const $ = c(9);
|
|
33
|
+
let children;
|
|
34
|
+
let fallback;
|
|
35
|
+
let rest;
|
|
36
|
+
if ($[0] !== props) {
|
|
37
|
+
({fallback, children, ...rest} = props);
|
|
38
|
+
$[0] = props;
|
|
39
|
+
$[1] = children;
|
|
40
|
+
$[2] = fallback;
|
|
41
|
+
$[3] = rest;
|
|
42
|
+
} else {
|
|
43
|
+
children = $[1];
|
|
44
|
+
fallback = $[2];
|
|
45
|
+
rest = $[3];
|
|
46
|
+
}
|
|
32
47
|
const api = useSwitchContext();
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
48
|
+
const t0 = api.checked ? "" : void 0;
|
|
49
|
+
const t1 = api.checked ? children : fallback;
|
|
50
|
+
let t2;
|
|
51
|
+
if ($[4] !== ref || $[5] !== rest || $[6] !== t0 || $[7] !== t1) {
|
|
52
|
+
t2 = <StyledIndicator ref={ref} data-checked={t0} {...rest}>{t1}</StyledIndicator>;
|
|
53
|
+
$[4] = ref;
|
|
54
|
+
$[5] = rest;
|
|
55
|
+
$[6] = t0;
|
|
56
|
+
$[7] = t1;
|
|
57
|
+
$[8] = t2;
|
|
58
|
+
} else t2 = $[8];
|
|
59
|
+
return t2;
|
|
36
60
|
});
|
|
37
61
|
const StyledThumbIndicator = styled(ark.span);
|
|
38
62
|
const ThumbIndicator = forwardRef(function SwitchThumbIndicator(props, ref) {
|
|
39
|
-
const
|
|
63
|
+
const $ = c(9);
|
|
64
|
+
let children;
|
|
65
|
+
let fallback;
|
|
66
|
+
let rest;
|
|
67
|
+
if ($[0] !== props) {
|
|
68
|
+
({fallback, children, ...rest} = props);
|
|
69
|
+
$[0] = props;
|
|
70
|
+
$[1] = children;
|
|
71
|
+
$[2] = fallback;
|
|
72
|
+
$[3] = rest;
|
|
73
|
+
} else {
|
|
74
|
+
children = $[1];
|
|
75
|
+
fallback = $[2];
|
|
76
|
+
rest = $[3];
|
|
77
|
+
}
|
|
40
78
|
const api = useSwitchContext();
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
79
|
+
const t0 = api.checked ? "" : void 0;
|
|
80
|
+
const t1 = api.checked ? children : fallback;
|
|
81
|
+
let t2;
|
|
82
|
+
if ($[4] !== ref || $[5] !== rest || $[6] !== t0 || $[7] !== t1) {
|
|
83
|
+
t2 = <StyledThumbIndicator ref={ref} data-checked={t0} {...rest}>{t1}</StyledThumbIndicator>;
|
|
84
|
+
$[4] = ref;
|
|
85
|
+
$[5] = rest;
|
|
86
|
+
$[6] = t0;
|
|
87
|
+
$[7] = t1;
|
|
88
|
+
$[8] = t2;
|
|
89
|
+
} else t2 = $[8];
|
|
90
|
+
return t2;
|
|
44
91
|
});
|
|
45
92
|
|
|
46
93
|
//#endregion
|
|
47
94
|
//#region src/components/switch/switch.closed.tsx
|
|
48
95
|
const Switch = forwardRef(function Switch(props, ref) {
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
96
|
+
const $ = c(30);
|
|
97
|
+
let children;
|
|
98
|
+
let inputProps;
|
|
99
|
+
let rest;
|
|
100
|
+
let t0;
|
|
101
|
+
let thumbLabel;
|
|
102
|
+
let trackLabel;
|
|
103
|
+
if ($[0] !== props) {
|
|
104
|
+
({inputProps, children, rootRef: t0, trackLabel, thumbLabel, ...rest} = props);
|
|
105
|
+
$[0] = props;
|
|
106
|
+
$[1] = children;
|
|
107
|
+
$[2] = inputProps;
|
|
108
|
+
$[3] = rest;
|
|
109
|
+
$[4] = t0;
|
|
110
|
+
$[5] = thumbLabel;
|
|
111
|
+
$[6] = trackLabel;
|
|
112
|
+
} else {
|
|
113
|
+
children = $[1];
|
|
114
|
+
inputProps = $[2];
|
|
115
|
+
rest = $[3];
|
|
116
|
+
t0 = $[4];
|
|
117
|
+
thumbLabel = $[5];
|
|
118
|
+
trackLabel = $[6];
|
|
119
|
+
}
|
|
120
|
+
const rootRef = t0 === void 0 ? null : t0;
|
|
121
|
+
let t1;
|
|
122
|
+
if ($[7] !== inputProps || $[8] !== ref) {
|
|
123
|
+
t1 = <switch_exports.HiddenInput ref={ref} {...inputProps} />;
|
|
124
|
+
$[7] = inputProps;
|
|
125
|
+
$[8] = ref;
|
|
126
|
+
$[9] = t1;
|
|
127
|
+
} else t1 = $[9];
|
|
128
|
+
let t2;
|
|
129
|
+
if ($[10] !== thumbLabel) {
|
|
130
|
+
t2 = thumbLabel && <switch_exports.ThumbIndicator fallback={thumbLabel?.off}>{thumbLabel?.on}</switch_exports.ThumbIndicator>;
|
|
131
|
+
$[10] = thumbLabel;
|
|
132
|
+
$[11] = t2;
|
|
133
|
+
} else t2 = $[11];
|
|
134
|
+
let t3;
|
|
135
|
+
if ($[12] !== t2) {
|
|
136
|
+
t3 = <switch_exports.Thumb>{t2}</switch_exports.Thumb>;
|
|
137
|
+
$[12] = t2;
|
|
138
|
+
$[13] = t3;
|
|
139
|
+
} else t3 = $[13];
|
|
140
|
+
let t4;
|
|
141
|
+
if ($[14] !== trackLabel) {
|
|
142
|
+
t4 = trackLabel && <switch_exports.Indicator fallback={trackLabel.off}>{trackLabel.on}</switch_exports.Indicator>;
|
|
143
|
+
$[14] = trackLabel;
|
|
144
|
+
$[15] = t4;
|
|
145
|
+
} else t4 = $[15];
|
|
146
|
+
let t5;
|
|
147
|
+
if ($[16] !== t3 || $[17] !== t4) {
|
|
148
|
+
t5 = <switch_exports.Control>{t3}{t4}</switch_exports.Control>;
|
|
149
|
+
$[16] = t3;
|
|
150
|
+
$[17] = t4;
|
|
151
|
+
$[18] = t5;
|
|
152
|
+
} else t5 = $[18];
|
|
153
|
+
let t6;
|
|
154
|
+
if ($[19] !== children) {
|
|
155
|
+
t6 = children && <switch_exports.Label>{children}</switch_exports.Label>;
|
|
156
|
+
$[19] = children;
|
|
157
|
+
$[20] = t6;
|
|
158
|
+
} else t6 = $[20];
|
|
159
|
+
let t7;
|
|
160
|
+
if ($[21] !== props) {
|
|
161
|
+
t7 = props["aria-label"] && <switch_exports.Label asChild={true}><VisuallyHidden>{props["aria-label"]}</VisuallyHidden></switch_exports.Label>;
|
|
162
|
+
$[21] = props;
|
|
163
|
+
$[22] = t7;
|
|
164
|
+
} else t7 = $[22];
|
|
165
|
+
let t8;
|
|
166
|
+
if ($[23] !== rest || $[24] !== rootRef || $[25] !== t1 || $[26] !== t5 || $[27] !== t6 || $[28] !== t7) {
|
|
167
|
+
t8 = <switch_exports.Root ref={rootRef} {...rest}>{t1}{t5}{t6}{t7}</switch_exports.Root>;
|
|
168
|
+
$[23] = rest;
|
|
169
|
+
$[24] = rootRef;
|
|
170
|
+
$[25] = t1;
|
|
171
|
+
$[26] = t5;
|
|
172
|
+
$[27] = t6;
|
|
173
|
+
$[28] = t7;
|
|
174
|
+
$[29] = t8;
|
|
175
|
+
} else t8 = $[29];
|
|
176
|
+
return t8;
|
|
65
177
|
});
|
|
66
178
|
|
|
67
179
|
//#endregion
|
|
68
180
|
//#region src/components/switch/switch.field.tsx
|
|
69
181
|
const SwitchField = (props) => {
|
|
182
|
+
const $ = c(8);
|
|
70
183
|
const { name, label, helperText, disabled } = props;
|
|
71
184
|
const { control } = useFormContext();
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
185
|
+
let t0;
|
|
186
|
+
if ($[0] !== disabled || $[1] !== helperText || $[2] !== label) {
|
|
187
|
+
t0 = (t1) => {
|
|
188
|
+
const { field, fieldState } = t1;
|
|
189
|
+
return <Field helperText={helperText} disabled={field.disabled || disabled} invalid={!!fieldState.error} errorText={fieldState.error?.message}><Switch name={field.name} checked={field.value} onCheckedChange={(t2) => {
|
|
190
|
+
const { checked } = t2;
|
|
191
|
+
return field.onChange(checked);
|
|
192
|
+
}} inputProps={{ onBlur: field.onBlur }}>{label}</Switch></Field>;
|
|
193
|
+
};
|
|
194
|
+
$[0] = disabled;
|
|
195
|
+
$[1] = helperText;
|
|
196
|
+
$[2] = label;
|
|
197
|
+
$[3] = t0;
|
|
198
|
+
} else t0 = $[3];
|
|
199
|
+
let t1;
|
|
200
|
+
if ($[4] !== control || $[5] !== name || $[6] !== t0) {
|
|
201
|
+
t1 = <Controller name={name} control={control} render={t0} />;
|
|
202
|
+
$[4] = control;
|
|
203
|
+
$[5] = name;
|
|
204
|
+
$[6] = t0;
|
|
205
|
+
$[7] = t1;
|
|
206
|
+
} else t1 = $[7];
|
|
207
|
+
return t1;
|
|
77
208
|
};
|
|
78
209
|
|
|
79
210
|
//#endregion
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "../../chunk-BYypO7fO.js";
|
|
2
2
|
import { match } from "ts-pattern";
|
|
3
|
+
import { c } from "react/compiler-runtime";
|
|
3
4
|
import { useCallback, useEffect, useState } from "react";
|
|
4
5
|
import { ark } from "@ark-ui/react/factory";
|
|
5
6
|
import { Box, HStack, createStyleContext } from "@pyck/styled-system/jsx";
|
|
@@ -14,67 +15,323 @@ import { DisplayDateValue } from "@pyck/react/display-date-value";
|
|
|
14
15
|
//#region src/components/table/cells/table-cell-content.tsx
|
|
15
16
|
const renderIcon = (icon, iconProps) => match(icon).when((x) => typeof x === "function", (Icon) => <Icon {...iconProps} />).otherwise((node) => node ?? null);
|
|
16
17
|
const TableCellContent = (props) => {
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
18
|
+
const $ = c(27);
|
|
19
|
+
let children;
|
|
20
|
+
let icon;
|
|
21
|
+
let iconProps;
|
|
22
|
+
let rest;
|
|
23
|
+
let t0;
|
|
24
|
+
let tooltip;
|
|
25
|
+
if ($[0] !== props) {
|
|
26
|
+
({children, icon, iconProps, tooltip, justifyContent: t0, ...rest} = props);
|
|
27
|
+
$[0] = props;
|
|
28
|
+
$[1] = children;
|
|
29
|
+
$[2] = icon;
|
|
30
|
+
$[3] = iconProps;
|
|
31
|
+
$[4] = rest;
|
|
32
|
+
$[5] = t0;
|
|
33
|
+
$[6] = tooltip;
|
|
34
|
+
} else {
|
|
35
|
+
children = $[1];
|
|
36
|
+
icon = $[2];
|
|
37
|
+
iconProps = $[3];
|
|
38
|
+
rest = $[4];
|
|
39
|
+
t0 = $[5];
|
|
40
|
+
tooltip = $[6];
|
|
41
|
+
}
|
|
42
|
+
const justifyContent = t0 === void 0 ? "flex-start" : t0;
|
|
43
|
+
const t1 = !!icon;
|
|
44
|
+
let t2;
|
|
45
|
+
if ($[7] !== icon || $[8] !== iconProps) {
|
|
46
|
+
t2 = renderIcon(icon, iconProps);
|
|
47
|
+
$[7] = icon;
|
|
48
|
+
$[8] = iconProps;
|
|
49
|
+
$[9] = t2;
|
|
50
|
+
} else t2 = $[9];
|
|
51
|
+
let t3;
|
|
52
|
+
if ($[10] !== t1 || $[11] !== t2) {
|
|
53
|
+
t3 = <Wrap when={t1} with={_temp}>{t2}</Wrap>;
|
|
54
|
+
$[10] = t1;
|
|
55
|
+
$[11] = t2;
|
|
56
|
+
$[12] = t3;
|
|
57
|
+
} else t3 = $[12];
|
|
58
|
+
let t4;
|
|
59
|
+
if ($[13] !== children) {
|
|
60
|
+
t4 = <Box overflow="hidden" textOverflow="ellipsis">{children}</Box>;
|
|
61
|
+
$[13] = children;
|
|
62
|
+
$[14] = t4;
|
|
63
|
+
} else t4 = $[14];
|
|
64
|
+
let t5;
|
|
65
|
+
if ($[15] !== justifyContent || $[16] !== rest || $[17] !== t3 || $[18] !== t4) {
|
|
66
|
+
t5 = <HStack justifyContent={justifyContent} {...rest}>{t3}{t4}</HStack>;
|
|
67
|
+
$[15] = justifyContent;
|
|
68
|
+
$[16] = rest;
|
|
69
|
+
$[17] = t3;
|
|
70
|
+
$[18] = t4;
|
|
71
|
+
$[19] = t5;
|
|
72
|
+
} else t5 = $[19];
|
|
73
|
+
const content = t5;
|
|
74
|
+
const t6 = !!tooltip;
|
|
75
|
+
let t7;
|
|
76
|
+
if ($[20] !== content || $[21] !== tooltip) {
|
|
77
|
+
t7 = <Tooltip content={tooltip} openDelay={100}>{content}</Tooltip>;
|
|
78
|
+
$[20] = content;
|
|
79
|
+
$[21] = tooltip;
|
|
80
|
+
$[22] = t7;
|
|
81
|
+
} else t7 = $[22];
|
|
82
|
+
let t8;
|
|
83
|
+
if ($[23] !== content || $[24] !== t6 || $[25] !== t7) {
|
|
84
|
+
t8 = <Show when={t6} fallback={content}>{t7}</Show>;
|
|
85
|
+
$[23] = content;
|
|
86
|
+
$[24] = t6;
|
|
87
|
+
$[25] = t7;
|
|
88
|
+
$[26] = t8;
|
|
89
|
+
} else t8 = $[26];
|
|
90
|
+
return t8;
|
|
32
91
|
};
|
|
92
|
+
function _temp(children_0) {
|
|
93
|
+
return <Icon boxSize="4">{children_0}</Icon>;
|
|
94
|
+
}
|
|
33
95
|
|
|
34
96
|
//#endregion
|
|
35
97
|
//#region src/components/table/cells/boolean-cell.tsx
|
|
36
98
|
const BooleanCell = (props) => {
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
99
|
+
const $ = c(16);
|
|
100
|
+
let booleanValue;
|
|
101
|
+
let copyable;
|
|
102
|
+
let icon;
|
|
103
|
+
let rest;
|
|
104
|
+
let t0;
|
|
105
|
+
let t1;
|
|
106
|
+
let tooltip;
|
|
107
|
+
if ($[0] !== props) {
|
|
108
|
+
({value: booleanValue, trueLabel: t0, falseLabel: t1, copyable, icon, tooltip, ...rest} = props);
|
|
109
|
+
$[0] = props;
|
|
110
|
+
$[1] = booleanValue;
|
|
111
|
+
$[2] = copyable;
|
|
112
|
+
$[3] = icon;
|
|
113
|
+
$[4] = rest;
|
|
114
|
+
$[5] = t0;
|
|
115
|
+
$[6] = t1;
|
|
116
|
+
$[7] = tooltip;
|
|
117
|
+
} else {
|
|
118
|
+
booleanValue = $[1];
|
|
119
|
+
copyable = $[2];
|
|
120
|
+
icon = $[3];
|
|
121
|
+
rest = $[4];
|
|
122
|
+
t0 = $[5];
|
|
123
|
+
t1 = $[6];
|
|
124
|
+
tooltip = $[7];
|
|
125
|
+
}
|
|
126
|
+
const value = booleanValue ? t0 === void 0 ? "Yes" : t0 : t1 === void 0 ? "No" : t1;
|
|
127
|
+
let t2;
|
|
128
|
+
if ($[8] !== copyable || $[9] !== value) {
|
|
129
|
+
t2 = <DisplayValue value={value} copyable={copyable} />;
|
|
130
|
+
$[8] = copyable;
|
|
131
|
+
$[9] = value;
|
|
132
|
+
$[10] = t2;
|
|
133
|
+
} else t2 = $[10];
|
|
134
|
+
let t3;
|
|
135
|
+
if ($[11] !== icon || $[12] !== rest || $[13] !== t2 || $[14] !== tooltip) {
|
|
136
|
+
t3 = <TableCellContent tooltip={tooltip} icon={icon} {...rest}>{t2}</TableCellContent>;
|
|
137
|
+
$[11] = icon;
|
|
138
|
+
$[12] = rest;
|
|
139
|
+
$[13] = t2;
|
|
140
|
+
$[14] = tooltip;
|
|
141
|
+
$[15] = t3;
|
|
142
|
+
} else t3 = $[15];
|
|
143
|
+
return t3;
|
|
42
144
|
};
|
|
43
145
|
|
|
44
146
|
//#endregion
|
|
45
147
|
//#region src/components/table/cells/date-cell.tsx
|
|
46
148
|
const DateCell = (props) => {
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
149
|
+
const $ = c(22);
|
|
150
|
+
let copyable;
|
|
151
|
+
let format;
|
|
152
|
+
let icon;
|
|
153
|
+
let justifyContent;
|
|
154
|
+
let locale;
|
|
155
|
+
let rest;
|
|
156
|
+
let t0;
|
|
157
|
+
let tooltip;
|
|
158
|
+
let value;
|
|
159
|
+
if ($[0] !== props) {
|
|
160
|
+
({value, type: t0, format, locale, copyable, icon, tooltip, justifyContent, ...rest} = props);
|
|
161
|
+
$[0] = props;
|
|
162
|
+
$[1] = copyable;
|
|
163
|
+
$[2] = format;
|
|
164
|
+
$[3] = icon;
|
|
165
|
+
$[4] = justifyContent;
|
|
166
|
+
$[5] = locale;
|
|
167
|
+
$[6] = rest;
|
|
168
|
+
$[7] = t0;
|
|
169
|
+
$[8] = tooltip;
|
|
170
|
+
$[9] = value;
|
|
171
|
+
} else {
|
|
172
|
+
copyable = $[1];
|
|
173
|
+
format = $[2];
|
|
174
|
+
icon = $[3];
|
|
175
|
+
justifyContent = $[4];
|
|
176
|
+
locale = $[5];
|
|
177
|
+
rest = $[6];
|
|
178
|
+
t0 = $[7];
|
|
179
|
+
tooltip = $[8];
|
|
180
|
+
value = $[9];
|
|
181
|
+
}
|
|
182
|
+
const type = t0 === void 0 ? "date" : t0;
|
|
183
|
+
let t1;
|
|
184
|
+
if ($[10] !== copyable || $[11] !== format || $[12] !== locale || $[13] !== type || $[14] !== value) {
|
|
185
|
+
t1 = <DisplayDateValue value={value} type={type} format={format} locale={locale} copyable={copyable} />;
|
|
186
|
+
$[10] = copyable;
|
|
187
|
+
$[11] = format;
|
|
188
|
+
$[12] = locale;
|
|
189
|
+
$[13] = type;
|
|
190
|
+
$[14] = value;
|
|
191
|
+
$[15] = t1;
|
|
192
|
+
} else t1 = $[15];
|
|
193
|
+
let t2;
|
|
194
|
+
if ($[16] !== icon || $[17] !== justifyContent || $[18] !== rest || $[19] !== t1 || $[20] !== tooltip) {
|
|
195
|
+
t2 = <TableCellContent icon={icon} tooltip={tooltip} justifyContent={justifyContent} {...rest}>{t1}</TableCellContent>;
|
|
196
|
+
$[16] = icon;
|
|
197
|
+
$[17] = justifyContent;
|
|
198
|
+
$[18] = rest;
|
|
199
|
+
$[19] = t1;
|
|
200
|
+
$[20] = tooltip;
|
|
201
|
+
$[21] = t2;
|
|
202
|
+
} else t2 = $[21];
|
|
203
|
+
return t2;
|
|
51
204
|
};
|
|
52
205
|
|
|
53
206
|
//#endregion
|
|
54
207
|
//#region src/components/table/cells/number-cell.tsx
|
|
55
208
|
const NumberCell = (props) => {
|
|
56
|
-
const
|
|
209
|
+
const $ = c(26);
|
|
210
|
+
let copyable;
|
|
211
|
+
let icon;
|
|
212
|
+
let localeProp;
|
|
213
|
+
let maximumFractionDigits;
|
|
214
|
+
let minimumFractionDigits;
|
|
215
|
+
let rest;
|
|
216
|
+
let t0;
|
|
217
|
+
let tooltip;
|
|
218
|
+
let useGrouping;
|
|
219
|
+
let value;
|
|
220
|
+
if ($[0] !== props) {
|
|
221
|
+
({value, minimumFractionDigits, maximumFractionDigits, locale: localeProp, useGrouping, copyable, tooltip, justifyContent: t0, icon, ...rest} = props);
|
|
222
|
+
$[0] = props;
|
|
223
|
+
$[1] = copyable;
|
|
224
|
+
$[2] = icon;
|
|
225
|
+
$[3] = localeProp;
|
|
226
|
+
$[4] = maximumFractionDigits;
|
|
227
|
+
$[5] = minimumFractionDigits;
|
|
228
|
+
$[6] = rest;
|
|
229
|
+
$[7] = t0;
|
|
230
|
+
$[8] = tooltip;
|
|
231
|
+
$[9] = useGrouping;
|
|
232
|
+
$[10] = value;
|
|
233
|
+
} else {
|
|
234
|
+
copyable = $[1];
|
|
235
|
+
icon = $[2];
|
|
236
|
+
localeProp = $[3];
|
|
237
|
+
maximumFractionDigits = $[4];
|
|
238
|
+
minimumFractionDigits = $[5];
|
|
239
|
+
rest = $[6];
|
|
240
|
+
t0 = $[7];
|
|
241
|
+
tooltip = $[8];
|
|
242
|
+
useGrouping = $[9];
|
|
243
|
+
value = $[10];
|
|
244
|
+
}
|
|
245
|
+
const justifyContent = t0 === void 0 ? "flex-end" : t0;
|
|
57
246
|
const locale = localeProp ?? "en";
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
247
|
+
let t1;
|
|
248
|
+
if ($[11] !== locale || $[12] !== maximumFractionDigits || $[13] !== minimumFractionDigits || $[14] !== useGrouping) {
|
|
249
|
+
t1 = (n) => {
|
|
250
|
+
if (!Number.isFinite(n)) return null;
|
|
251
|
+
return new Intl.NumberFormat(locale, {
|
|
252
|
+
useGrouping,
|
|
253
|
+
minimumFractionDigits,
|
|
254
|
+
maximumFractionDigits
|
|
255
|
+
}).format(n);
|
|
256
|
+
};
|
|
257
|
+
$[11] = locale;
|
|
258
|
+
$[12] = maximumFractionDigits;
|
|
259
|
+
$[13] = minimumFractionDigits;
|
|
260
|
+
$[14] = useGrouping;
|
|
261
|
+
$[15] = t1;
|
|
262
|
+
} else t1 = $[15];
|
|
263
|
+
const formatValue = t1;
|
|
264
|
+
let t2;
|
|
265
|
+
if ($[16] !== copyable || $[17] !== formatValue || $[18] !== value) {
|
|
266
|
+
t2 = <DisplayValue value={value} formatValue={formatValue} copyable={copyable} />;
|
|
267
|
+
$[16] = copyable;
|
|
268
|
+
$[17] = formatValue;
|
|
269
|
+
$[18] = value;
|
|
270
|
+
$[19] = t2;
|
|
271
|
+
} else t2 = $[19];
|
|
272
|
+
let t3;
|
|
273
|
+
if ($[20] !== icon || $[21] !== justifyContent || $[22] !== rest || $[23] !== t2 || $[24] !== tooltip) {
|
|
274
|
+
t3 = <TableCellContent icon={icon} tooltip={tooltip} justifyContent={justifyContent} {...rest}>{t2}</TableCellContent>;
|
|
275
|
+
$[20] = icon;
|
|
276
|
+
$[21] = justifyContent;
|
|
277
|
+
$[22] = rest;
|
|
278
|
+
$[23] = t2;
|
|
279
|
+
$[24] = tooltip;
|
|
280
|
+
$[25] = t3;
|
|
281
|
+
} else t3 = $[25];
|
|
282
|
+
return t3;
|
|
69
283
|
};
|
|
70
284
|
|
|
71
285
|
//#endregion
|
|
72
286
|
//#region src/components/table/cells/text-cell.tsx
|
|
73
287
|
const TextCell = (props) => {
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
288
|
+
const $ = c(18);
|
|
289
|
+
let copyable;
|
|
290
|
+
let formatValue;
|
|
291
|
+
let icon;
|
|
292
|
+
let rest;
|
|
293
|
+
let t0;
|
|
294
|
+
let tooltip;
|
|
295
|
+
let value;
|
|
296
|
+
if ($[0] !== props) {
|
|
297
|
+
({value, formatValue, copyable, icon, tooltip, justifyContent: t0, ...rest} = props);
|
|
298
|
+
$[0] = props;
|
|
299
|
+
$[1] = copyable;
|
|
300
|
+
$[2] = formatValue;
|
|
301
|
+
$[3] = icon;
|
|
302
|
+
$[4] = rest;
|
|
303
|
+
$[5] = t0;
|
|
304
|
+
$[6] = tooltip;
|
|
305
|
+
$[7] = value;
|
|
306
|
+
} else {
|
|
307
|
+
copyable = $[1];
|
|
308
|
+
formatValue = $[2];
|
|
309
|
+
icon = $[3];
|
|
310
|
+
rest = $[4];
|
|
311
|
+
t0 = $[5];
|
|
312
|
+
tooltip = $[6];
|
|
313
|
+
value = $[7];
|
|
314
|
+
}
|
|
315
|
+
const justifyContent = t0 === void 0 ? "flex-start" : t0;
|
|
316
|
+
let t1;
|
|
317
|
+
if ($[8] !== copyable || $[9] !== formatValue || $[10] !== value) {
|
|
318
|
+
t1 = <DisplayValue value={value} formatValue={formatValue} copyable={copyable} />;
|
|
319
|
+
$[8] = copyable;
|
|
320
|
+
$[9] = formatValue;
|
|
321
|
+
$[10] = value;
|
|
322
|
+
$[11] = t1;
|
|
323
|
+
} else t1 = $[11];
|
|
324
|
+
let t2;
|
|
325
|
+
if ($[12] !== icon || $[13] !== justifyContent || $[14] !== rest || $[15] !== t1 || $[16] !== tooltip) {
|
|
326
|
+
t2 = <TableCellContent icon={icon} tooltip={tooltip} justifyContent={justifyContent} {...rest}>{t1}</TableCellContent>;
|
|
327
|
+
$[12] = icon;
|
|
328
|
+
$[13] = justifyContent;
|
|
329
|
+
$[14] = rest;
|
|
330
|
+
$[15] = t1;
|
|
331
|
+
$[16] = tooltip;
|
|
332
|
+
$[17] = t2;
|
|
333
|
+
} else t2 = $[17];
|
|
334
|
+
return t2;
|
|
78
335
|
};
|
|
79
336
|
|
|
80
337
|
//#endregion
|
|
@@ -102,34 +359,81 @@ const Row = withContext(ark.tr, "row");
|
|
|
102
359
|
//#endregion
|
|
103
360
|
//#region src/components/table/use-virtualized-table-height.ts
|
|
104
361
|
const SCROLL_THRESHOLD = .95;
|
|
105
|
-
const useVirtualizedTableHeight = (
|
|
362
|
+
const useVirtualizedTableHeight = (t0) => {
|
|
363
|
+
const $ = c(17);
|
|
364
|
+
const { virtualSize, tableRef, scrollRef } = t0;
|
|
106
365
|
const [isScrollNearBottom, setIsScrollNearBottom] = useState(false);
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
366
|
+
let t1;
|
|
367
|
+
if ($[0] !== tableRef || $[1] !== virtualSize) {
|
|
368
|
+
t1 = () => adjustTableHeight(tableRef, virtualSize);
|
|
369
|
+
$[0] = tableRef;
|
|
370
|
+
$[1] = virtualSize;
|
|
371
|
+
$[2] = t1;
|
|
372
|
+
} else t1 = $[2];
|
|
373
|
+
const handlePseudoResize = t1;
|
|
374
|
+
let t2;
|
|
375
|
+
if ($[3] !== scrollRef || $[4] !== virtualSize) {
|
|
376
|
+
t2 = () => {
|
|
377
|
+
if (scrollRef.current) {
|
|
378
|
+
const scrollPosition = scrollRef.current.scrollTop;
|
|
379
|
+
const visibleHeight = scrollRef.current.clientHeight;
|
|
380
|
+
setIsScrollNearBottom(scrollPosition > virtualSize * SCROLL_THRESHOLD - visibleHeight);
|
|
381
|
+
}
|
|
382
|
+
};
|
|
383
|
+
$[3] = scrollRef;
|
|
384
|
+
$[4] = virtualSize;
|
|
385
|
+
$[5] = t2;
|
|
386
|
+
} else t2 = $[5];
|
|
387
|
+
const handleScroll = t2;
|
|
388
|
+
let t3;
|
|
389
|
+
let t4;
|
|
390
|
+
if ($[6] !== handlePseudoResize || $[7] !== handleScroll || $[8] !== scrollRef) {
|
|
391
|
+
t3 = () => {
|
|
392
|
+
const scrollable = scrollRef.current;
|
|
393
|
+
if (scrollable) scrollable.addEventListener("scroll", handleScroll);
|
|
394
|
+
handlePseudoResize();
|
|
395
|
+
return () => {
|
|
396
|
+
if (scrollable) scrollable.removeEventListener("scroll", handleScroll);
|
|
397
|
+
};
|
|
398
|
+
};
|
|
399
|
+
t4 = [
|
|
400
|
+
scrollRef,
|
|
401
|
+
handleScroll,
|
|
402
|
+
handlePseudoResize
|
|
403
|
+
];
|
|
404
|
+
$[6] = handlePseudoResize;
|
|
405
|
+
$[7] = handleScroll;
|
|
406
|
+
$[8] = scrollRef;
|
|
407
|
+
$[9] = t3;
|
|
408
|
+
$[10] = t4;
|
|
409
|
+
} else {
|
|
410
|
+
t3 = $[9];
|
|
411
|
+
t4 = $[10];
|
|
412
|
+
}
|
|
413
|
+
useEffect(t3, t4);
|
|
414
|
+
let t5;
|
|
415
|
+
let t6;
|
|
416
|
+
if ($[11] !== handlePseudoResize || $[12] !== isScrollNearBottom) {
|
|
417
|
+
t5 = () => {
|
|
418
|
+
if (isScrollNearBottom) handlePseudoResize();
|
|
123
419
|
};
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
420
|
+
t6 = [isScrollNearBottom, handlePseudoResize];
|
|
421
|
+
$[11] = handlePseudoResize;
|
|
422
|
+
$[12] = isScrollNearBottom;
|
|
423
|
+
$[13] = t5;
|
|
424
|
+
$[14] = t6;
|
|
425
|
+
} else {
|
|
426
|
+
t5 = $[13];
|
|
427
|
+
t6 = $[14];
|
|
428
|
+
}
|
|
429
|
+
useEffect(t5, t6);
|
|
430
|
+
let t7;
|
|
431
|
+
if ($[15] !== isScrollNearBottom) {
|
|
432
|
+
t7 = { isScrollNearBottom };
|
|
433
|
+
$[15] = isScrollNearBottom;
|
|
434
|
+
$[16] = t7;
|
|
435
|
+
} else t7 = $[16];
|
|
436
|
+
return t7;
|
|
133
437
|
};
|
|
134
438
|
const adjustTableHeight = (tableRef, virtualHeight) => {
|
|
135
439
|
if (!tableRef.current) return;
|