@esic-lab/data-core-ui 0.0.56 → 0.0.57
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/index.d.mts +623 -0
- package/dist/index.d.ts +623 -0
- package/dist/index.js +24 -3
- package/dist/index.mjs +24 -3
- package/package.json +2 -3
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,623 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import react, { ReactNode } from 'react';
|
|
3
|
+
import * as antd_es_table_interface from 'antd/es/table/interface';
|
|
4
|
+
import { ColumnsType, TableProps } from 'antd/es/table';
|
|
5
|
+
import { EventSourceInput } from '@fullcalendar/core';
|
|
6
|
+
import { InputNumberProps, SelectProps } from 'antd';
|
|
7
|
+
import { Color } from 'antd/es/color-picker';
|
|
8
|
+
import { MessageInstance } from 'antd/es/message/interface';
|
|
9
|
+
import { ItemType } from 'antd/es/breadcrumb/Breadcrumb';
|
|
10
|
+
import { ReactNode as ReactNode$1 } from '@tabler/icons-react';
|
|
11
|
+
|
|
12
|
+
type ColorScale = 50 | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
|
|
13
|
+
type BaseColor = "primary" | "gray" | "green" | "red" | "yellow" | "blue";
|
|
14
|
+
type ThemeColor = `bg-${BaseColor}-${ColorScale}`;
|
|
15
|
+
interface PrimaryButtonProps {
|
|
16
|
+
title: string;
|
|
17
|
+
onClick: () => void;
|
|
18
|
+
iconLeft?: React.ReactNode;
|
|
19
|
+
iconRight?: React.ReactNode;
|
|
20
|
+
bgColor?: ThemeColor;
|
|
21
|
+
textColor?: "white" | "black";
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
}
|
|
24
|
+
declare function PrimaryButton({ title, onClick, iconLeft, iconRight, bgColor, textColor, disabled, }: PrimaryButtonProps): react_jsx_runtime.JSX.Element;
|
|
25
|
+
|
|
26
|
+
interface SecondaryButtonProps {
|
|
27
|
+
title: string;
|
|
28
|
+
onClick: () => void;
|
|
29
|
+
iconLeft?: React.ReactNode;
|
|
30
|
+
iconRight?: React.ReactNode;
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
}
|
|
33
|
+
declare function SecondaryButton({ title, onClick, iconLeft, iconRight, disabled }: SecondaryButtonProps): react_jsx_runtime.JSX.Element;
|
|
34
|
+
|
|
35
|
+
interface GhostButtonProps {
|
|
36
|
+
title: string;
|
|
37
|
+
onClick: () => void;
|
|
38
|
+
iconLeft?: React.ReactNode;
|
|
39
|
+
iconRight?: React.ReactNode;
|
|
40
|
+
disabled?: boolean;
|
|
41
|
+
}
|
|
42
|
+
declare function GhostButton({ title, onClick, iconLeft, iconRight, disabled }: GhostButtonProps): react_jsx_runtime.JSX.Element;
|
|
43
|
+
|
|
44
|
+
interface Title {
|
|
45
|
+
path: string;
|
|
46
|
+
name: string;
|
|
47
|
+
}
|
|
48
|
+
interface ParamTabSelection {
|
|
49
|
+
title: Title[];
|
|
50
|
+
now: string;
|
|
51
|
+
onClickGoto: (path: string) => void;
|
|
52
|
+
}
|
|
53
|
+
declare const TabSelectionButton: ({ title, now, onClickGoto }: ParamTabSelection) => react_jsx_runtime.JSX.Element;
|
|
54
|
+
|
|
55
|
+
interface LoaderProps {
|
|
56
|
+
size?: number;
|
|
57
|
+
color?: string;
|
|
58
|
+
}
|
|
59
|
+
declare function Loader({ size, color }: LoaderProps): react_jsx_runtime.JSX.Element;
|
|
60
|
+
|
|
61
|
+
interface CheckboxProps {
|
|
62
|
+
label?: string;
|
|
63
|
+
checked: boolean;
|
|
64
|
+
onChange: (checked: boolean) => void;
|
|
65
|
+
disabled?: boolean;
|
|
66
|
+
}
|
|
67
|
+
declare function Checkbox({ label, checked, onChange, disabled }: CheckboxProps): react_jsx_runtime.JSX.Element;
|
|
68
|
+
|
|
69
|
+
interface CheckboxOption {
|
|
70
|
+
checked: boolean;
|
|
71
|
+
label: string;
|
|
72
|
+
disabled?: boolean;
|
|
73
|
+
}
|
|
74
|
+
interface CheckboxGroupProps {
|
|
75
|
+
options: CheckboxOption[];
|
|
76
|
+
onChange: (label: string) => void;
|
|
77
|
+
alignment?: "horizontal" | "vertical";
|
|
78
|
+
}
|
|
79
|
+
declare function CheckboxGroup({ options, onChange, alignment }: CheckboxGroupProps): react_jsx_runtime.JSX.Element;
|
|
80
|
+
|
|
81
|
+
interface RadioProps {
|
|
82
|
+
selected: boolean;
|
|
83
|
+
onChange: (selected: boolean) => void;
|
|
84
|
+
disabled?: boolean;
|
|
85
|
+
}
|
|
86
|
+
declare function Radio({ selected, onChange, disabled }: RadioProps): react_jsx_runtime.JSX.Element;
|
|
87
|
+
|
|
88
|
+
interface RadioOption {
|
|
89
|
+
value: string;
|
|
90
|
+
label: string;
|
|
91
|
+
disabled?: boolean;
|
|
92
|
+
}
|
|
93
|
+
interface RadioGroupProps {
|
|
94
|
+
options: RadioOption[];
|
|
95
|
+
value: string;
|
|
96
|
+
onChange: (value: string) => void;
|
|
97
|
+
alignment?: "vertical" | "horizontal";
|
|
98
|
+
}
|
|
99
|
+
declare function RadioGroup({ options, value, onChange, alignment }: RadioGroupProps): react_jsx_runtime.JSX.Element;
|
|
100
|
+
|
|
101
|
+
interface SwitchProps {
|
|
102
|
+
label?: string;
|
|
103
|
+
checked: boolean;
|
|
104
|
+
onChange: (checked: boolean) => void;
|
|
105
|
+
disabled?: boolean;
|
|
106
|
+
}
|
|
107
|
+
declare function Switch({ label, checked, onChange, disabled }: SwitchProps): react_jsx_runtime.JSX.Element;
|
|
108
|
+
|
|
109
|
+
interface SwitchSelectProp {
|
|
110
|
+
option: {
|
|
111
|
+
value: string;
|
|
112
|
+
label: string;
|
|
113
|
+
}[];
|
|
114
|
+
value: string | number;
|
|
115
|
+
label: string;
|
|
116
|
+
color?: string;
|
|
117
|
+
required?: boolean;
|
|
118
|
+
onClick: (active: string) => void;
|
|
119
|
+
}
|
|
120
|
+
declare function SwitchSelect({ option, onClick, value, label, required, color, }: SwitchSelectProp): react_jsx_runtime.JSX.Element;
|
|
121
|
+
|
|
122
|
+
interface Menu {
|
|
123
|
+
title: string;
|
|
124
|
+
subMenus: {
|
|
125
|
+
title: string;
|
|
126
|
+
icon?: React.ReactNode | React.ReactElement;
|
|
127
|
+
iconActive?: React.ReactNode | React.ReactElement;
|
|
128
|
+
path: string;
|
|
129
|
+
customNode?: React.ReactNode | React.ReactElement;
|
|
130
|
+
}[];
|
|
131
|
+
}
|
|
132
|
+
interface MenuNavBarProps {
|
|
133
|
+
menus: Menu[];
|
|
134
|
+
onClick: (path: string) => void;
|
|
135
|
+
}
|
|
136
|
+
declare function MenuNavBar({ menus, onClick }: MenuNavBarProps): react_jsx_runtime.JSX.Element;
|
|
137
|
+
|
|
138
|
+
interface SidebarProps {
|
|
139
|
+
children: React.ReactNode;
|
|
140
|
+
logo?: string;
|
|
141
|
+
}
|
|
142
|
+
interface Sidebar {
|
|
143
|
+
icon: React.ReactNode;
|
|
144
|
+
iconHover?: React.ReactNode;
|
|
145
|
+
text: string;
|
|
146
|
+
disabled?: boolean;
|
|
147
|
+
}
|
|
148
|
+
declare function Sidebar({ children, logo }: SidebarProps): react_jsx_runtime.JSX.Element;
|
|
149
|
+
|
|
150
|
+
interface TopNavBarProps {
|
|
151
|
+
onClickNoti: () => void;
|
|
152
|
+
logo?: React.ReactNode;
|
|
153
|
+
}
|
|
154
|
+
declare function TopNavBar({ onClickNoti, logo }: TopNavBarProps): react_jsx_runtime.JSX.Element;
|
|
155
|
+
|
|
156
|
+
interface Column<T> {
|
|
157
|
+
header: string;
|
|
158
|
+
accessor: keyof T | ((row: T) => react.ReactNode);
|
|
159
|
+
sortable?: boolean;
|
|
160
|
+
}
|
|
161
|
+
interface DataTableProps<T> {
|
|
162
|
+
columns: Column<T>[];
|
|
163
|
+
data: T[];
|
|
164
|
+
onSort: () => void;
|
|
165
|
+
isLoading?: boolean;
|
|
166
|
+
}
|
|
167
|
+
declare function DataTable<T>({ columns, data, onSort, isLoading }: DataTableProps<T>): react_jsx_runtime.JSX.Element;
|
|
168
|
+
|
|
169
|
+
interface AntDataTableProps<T> {
|
|
170
|
+
dataSource: T[];
|
|
171
|
+
columns: ColumnsType<T>;
|
|
172
|
+
pageSize?: number;
|
|
173
|
+
rowCheckbox?: boolean;
|
|
174
|
+
onRowSelect?: (newSelectedRowKeys: React.Key[]) => void;
|
|
175
|
+
onFilter: (filters: Record<string, antd_es_table_interface.FilterValue | null>) => void;
|
|
176
|
+
onChange?: TableProps<T>["onChange"];
|
|
177
|
+
width?: number;
|
|
178
|
+
height?: number;
|
|
179
|
+
pagination?: boolean;
|
|
180
|
+
}
|
|
181
|
+
declare function AntDataTable<T extends {
|
|
182
|
+
key: React.Key;
|
|
183
|
+
}>({ dataSource, columns, pageSize, rowCheckbox, onRowSelect, onFilter, onChange, width, height, pagination, }: AntDataTableProps<T>): react_jsx_runtime.JSX.Element;
|
|
184
|
+
|
|
185
|
+
interface CalendarProps {
|
|
186
|
+
events: EventSourceInput | undefined;
|
|
187
|
+
}
|
|
188
|
+
declare function Calendar({ events }: CalendarProps): react_jsx_runtime.JSX.Element;
|
|
189
|
+
|
|
190
|
+
interface TextInputProps {
|
|
191
|
+
label?: string;
|
|
192
|
+
placeholder?: string;
|
|
193
|
+
type?: "text" | "password";
|
|
194
|
+
maxLength?: number;
|
|
195
|
+
required?: boolean;
|
|
196
|
+
error?: string;
|
|
197
|
+
value?: string;
|
|
198
|
+
onChange: (value: string) => void;
|
|
199
|
+
disabled?: boolean;
|
|
200
|
+
}
|
|
201
|
+
declare function TextInput({ label, placeholder, type, maxLength, required, error, value, onChange, disabled, }: TextInputProps): react_jsx_runtime.JSX.Element;
|
|
202
|
+
|
|
203
|
+
interface TextAreaProps {
|
|
204
|
+
label?: string;
|
|
205
|
+
height?: number;
|
|
206
|
+
placeholder?: string;
|
|
207
|
+
value: string;
|
|
208
|
+
onChange: (value: string) => void;
|
|
209
|
+
maxLength?: number;
|
|
210
|
+
resizable?: boolean;
|
|
211
|
+
showCount?: boolean;
|
|
212
|
+
required?: boolean;
|
|
213
|
+
error?: string;
|
|
214
|
+
disabled?: boolean;
|
|
215
|
+
}
|
|
216
|
+
declare function TextAreaInput({ label, height, placeholder, onChange, value, maxLength, resizable, showCount, required, error, disabled, }: TextAreaProps): react_jsx_runtime.JSX.Element;
|
|
217
|
+
|
|
218
|
+
interface InputFieldProps {
|
|
219
|
+
value: string | undefined;
|
|
220
|
+
onChange: (value: string | undefined) => void;
|
|
221
|
+
placeholder?: string;
|
|
222
|
+
label?: string;
|
|
223
|
+
required?: boolean;
|
|
224
|
+
disabled?: boolean;
|
|
225
|
+
error?: string;
|
|
226
|
+
addonBefore?: ReactNode;
|
|
227
|
+
addonAfter?: ReactNode;
|
|
228
|
+
defaultValue?: string;
|
|
229
|
+
className?: string;
|
|
230
|
+
onClear?: () => void;
|
|
231
|
+
statickey?: string;
|
|
232
|
+
}
|
|
233
|
+
declare function InputField({ value, onChange, placeholder, label, required, disabled, error, addonBefore, addonAfter, defaultValue, className, onClear, statickey, }: InputFieldProps): react_jsx_runtime.JSX.Element;
|
|
234
|
+
|
|
235
|
+
interface InputFieldNumberProps {
|
|
236
|
+
value: number | string | null;
|
|
237
|
+
onChange: (value: number | string | null) => void;
|
|
238
|
+
placeholder?: string;
|
|
239
|
+
label?: string;
|
|
240
|
+
required?: boolean;
|
|
241
|
+
disabled?: boolean;
|
|
242
|
+
error?: string;
|
|
243
|
+
addonBefore?: React.ReactNode;
|
|
244
|
+
addonAfter?: React.ReactNode;
|
|
245
|
+
defaultValue?: number;
|
|
246
|
+
className?: string;
|
|
247
|
+
max?: number;
|
|
248
|
+
min?: number;
|
|
249
|
+
controls?: boolean | {
|
|
250
|
+
upIcon?: React.ReactNode;
|
|
251
|
+
downIcon?: React.ReactNode;
|
|
252
|
+
};
|
|
253
|
+
size?: "large" | "middle" | "small";
|
|
254
|
+
changeOnWheel?: boolean;
|
|
255
|
+
formatter?: InputNumberProps["formatter"];
|
|
256
|
+
parser?: InputNumberProps["parser"];
|
|
257
|
+
}
|
|
258
|
+
declare function InputFieldNumber({ value, onChange, placeholder, label, required, disabled, error, addonBefore, addonAfter, defaultValue, className, max, min, controls, size, changeOnWheel, formatter, parser, }: InputFieldNumberProps): react_jsx_runtime.JSX.Element;
|
|
259
|
+
|
|
260
|
+
interface DatePickerBasicProps {
|
|
261
|
+
value: Date | null;
|
|
262
|
+
onChange: (day: Date | null) => void;
|
|
263
|
+
required?: boolean;
|
|
264
|
+
label?: string;
|
|
265
|
+
error?: string;
|
|
266
|
+
placeholder?: string;
|
|
267
|
+
disabled?: boolean;
|
|
268
|
+
defaultValue?: Date | null;
|
|
269
|
+
minDate?: Date;
|
|
270
|
+
maxDate?: Date;
|
|
271
|
+
disabledDate?: (currentDate: Date) => boolean;
|
|
272
|
+
disablePast?: boolean;
|
|
273
|
+
className?: string;
|
|
274
|
+
size?: "small" | "middle" | "large";
|
|
275
|
+
}
|
|
276
|
+
declare function DatePickerBasic({ value, onChange, label, required, error, disabled, placeholder, minDate, maxDate, disabledDate, disablePast, }: DatePickerBasicProps): react_jsx_runtime.JSX.Element;
|
|
277
|
+
|
|
278
|
+
interface DatePickerRangeProps {
|
|
279
|
+
value: [Date | null, Date | null];
|
|
280
|
+
onChange: (range: [Date | null, Date | null]) => void;
|
|
281
|
+
required?: boolean;
|
|
282
|
+
label?: string;
|
|
283
|
+
error?: string;
|
|
284
|
+
disabled?: boolean;
|
|
285
|
+
minDate?: Date;
|
|
286
|
+
maxDate?: Date;
|
|
287
|
+
disabledDate?: (currentDate: Date) => boolean;
|
|
288
|
+
disablePast?: boolean;
|
|
289
|
+
className?: string;
|
|
290
|
+
}
|
|
291
|
+
declare function DatePickerRange({ value, onChange, label, required, error, disabled, minDate, maxDate, disabledDate, disablePast, }: DatePickerRangeProps): react_jsx_runtime.JSX.Element;
|
|
292
|
+
|
|
293
|
+
interface ColorPickerProps {
|
|
294
|
+
value: string | null;
|
|
295
|
+
onChange?: (color: Color, hex: string) => void;
|
|
296
|
+
required?: boolean;
|
|
297
|
+
label?: string;
|
|
298
|
+
error?: string;
|
|
299
|
+
disabled?: boolean;
|
|
300
|
+
allowClear?: boolean;
|
|
301
|
+
defaultFormat?: "hex" | "rgb" | "hsb";
|
|
302
|
+
className?: string;
|
|
303
|
+
placeholder?: string;
|
|
304
|
+
}
|
|
305
|
+
declare function ColorPickerBasic({ value, onChange, required, label, error, disabled, allowClear, defaultFormat, className, placeholder, }: ColorPickerProps): react_jsx_runtime.JSX.Element;
|
|
306
|
+
|
|
307
|
+
interface ColorPalettePickerBasicProps {
|
|
308
|
+
value: string | null;
|
|
309
|
+
onChange?: (color: Color, hex: string) => void;
|
|
310
|
+
required?: boolean;
|
|
311
|
+
label?: string;
|
|
312
|
+
error?: string;
|
|
313
|
+
disabled?: boolean;
|
|
314
|
+
allowClear?: boolean;
|
|
315
|
+
defaultFormat?: "hex" | "rgb" | "hsb";
|
|
316
|
+
className?: string;
|
|
317
|
+
placeholder?: string;
|
|
318
|
+
onClear?: () => void;
|
|
319
|
+
}
|
|
320
|
+
declare function ColorPalettePickerBasic({ value, onChange, required, label, error, disabled, allowClear, defaultFormat, className, placeholder, onClear, }: ColorPalettePickerBasicProps): react_jsx_runtime.JSX.Element;
|
|
321
|
+
|
|
322
|
+
interface SelectFieldProps$1 {
|
|
323
|
+
value?: SelectProps["value"];
|
|
324
|
+
onChange: (value: SelectProps["value"]) => void;
|
|
325
|
+
placeholder?: string;
|
|
326
|
+
label?: string;
|
|
327
|
+
required?: boolean;
|
|
328
|
+
error?: string;
|
|
329
|
+
disabled?: boolean;
|
|
330
|
+
defaultValue?: string;
|
|
331
|
+
options?: {
|
|
332
|
+
label: ReactNode;
|
|
333
|
+
value: string | number | null;
|
|
334
|
+
disabled?: boolean;
|
|
335
|
+
}[];
|
|
336
|
+
mode?: "multiple" | "tags";
|
|
337
|
+
handleSearch?: (value: string) => void;
|
|
338
|
+
prefix?: ReactNode;
|
|
339
|
+
prefixSize?: number;
|
|
340
|
+
className?: string;
|
|
341
|
+
onClear?: () => void;
|
|
342
|
+
}
|
|
343
|
+
declare function SelectField({ value, onChange, placeholder, label, required, error, disabled, defaultValue, options, mode, prefix, prefixSize, handleSearch, className, onClear, }: SelectFieldProps$1): react_jsx_runtime.JSX.Element;
|
|
344
|
+
|
|
345
|
+
interface SelectFieldProps {
|
|
346
|
+
value?: SelectProps["value"];
|
|
347
|
+
onChange: (value: SelectProps["value"]) => void;
|
|
348
|
+
placeholder?: string;
|
|
349
|
+
label?: string;
|
|
350
|
+
required?: boolean;
|
|
351
|
+
error?: string;
|
|
352
|
+
disabled?: boolean;
|
|
353
|
+
defaultValue?: string;
|
|
354
|
+
options?: {
|
|
355
|
+
label: ReactNode;
|
|
356
|
+
options: {
|
|
357
|
+
label: ReactNode;
|
|
358
|
+
value: string | number;
|
|
359
|
+
disabled?: boolean;
|
|
360
|
+
}[];
|
|
361
|
+
}[];
|
|
362
|
+
mode?: "multiple" | "tags";
|
|
363
|
+
handleSearch?: (value: string) => void;
|
|
364
|
+
prefix?: ReactNode;
|
|
365
|
+
prefixSize?: number;
|
|
366
|
+
className?: string;
|
|
367
|
+
}
|
|
368
|
+
declare function SelectFieldGroup({ value, onChange, placeholder, label, required, error, disabled, defaultValue, options, mode, prefix, prefixSize, handleSearch, className, }: SelectFieldProps): react_jsx_runtime.JSX.Element;
|
|
369
|
+
|
|
370
|
+
interface SelectFieldStatusProps {
|
|
371
|
+
value: string | undefined;
|
|
372
|
+
onChange: (value: string | undefined) => void;
|
|
373
|
+
placeholder?: string;
|
|
374
|
+
label?: string;
|
|
375
|
+
required?: boolean;
|
|
376
|
+
disabled?: boolean;
|
|
377
|
+
error?: string;
|
|
378
|
+
options?: {
|
|
379
|
+
label: ReactNode;
|
|
380
|
+
value: string | number | null;
|
|
381
|
+
disabled?: boolean;
|
|
382
|
+
}[];
|
|
383
|
+
className?: string;
|
|
384
|
+
}
|
|
385
|
+
declare function SelectFieldStatus({ value, onChange, placeholder, label, required, disabled, error, options, className, }: SelectFieldStatusProps): react_jsx_runtime.JSX.Element;
|
|
386
|
+
|
|
387
|
+
interface SelectFieldStatusReportProps {
|
|
388
|
+
value: string | undefined;
|
|
389
|
+
onChange: (value: string | undefined) => void;
|
|
390
|
+
placeholder?: string;
|
|
391
|
+
label?: string;
|
|
392
|
+
required?: boolean;
|
|
393
|
+
disabled?: boolean;
|
|
394
|
+
error?: string;
|
|
395
|
+
className?: string;
|
|
396
|
+
options?: {
|
|
397
|
+
label: ReactNode;
|
|
398
|
+
value: string | number | null;
|
|
399
|
+
disabled?: boolean;
|
|
400
|
+
}[];
|
|
401
|
+
}
|
|
402
|
+
declare function SelectFieldStatusReport({ value, onChange, placeholder, label, required, disabled, error, className, options, }: SelectFieldStatusReportProps): react_jsx_runtime.JSX.Element;
|
|
403
|
+
|
|
404
|
+
interface SelectFieldTagProps {
|
|
405
|
+
label?: string | null;
|
|
406
|
+
required?: boolean;
|
|
407
|
+
placeholder?: string;
|
|
408
|
+
options?: {
|
|
409
|
+
label: ReactNode;
|
|
410
|
+
value: string | number | null;
|
|
411
|
+
disabled?: boolean;
|
|
412
|
+
}[];
|
|
413
|
+
error?: string;
|
|
414
|
+
value?: string[];
|
|
415
|
+
onChange?: (val: string[]) => void;
|
|
416
|
+
className?: string;
|
|
417
|
+
onClear?: () => void;
|
|
418
|
+
}
|
|
419
|
+
declare function SelectFieldTag({ label, required, placeholder, options, error, value: controlledValue, className, onChange, onClear, }: SelectFieldTagProps): react_jsx_runtime.JSX.Element;
|
|
420
|
+
|
|
421
|
+
interface OptionItem {
|
|
422
|
+
value: string;
|
|
423
|
+
label: string;
|
|
424
|
+
}
|
|
425
|
+
interface SelectCustomProps {
|
|
426
|
+
label?: string;
|
|
427
|
+
placeholder?: string;
|
|
428
|
+
options: OptionItem[];
|
|
429
|
+
required?: boolean;
|
|
430
|
+
onChange?: (valueList: string[]) => void;
|
|
431
|
+
error?: string;
|
|
432
|
+
onClear?: () => void;
|
|
433
|
+
}
|
|
434
|
+
declare function SelectCustom({ label, placeholder, options, required, onChange, error, onClear, }: SelectCustomProps): react_jsx_runtime.JSX.Element;
|
|
435
|
+
|
|
436
|
+
interface SortFilterProps {
|
|
437
|
+
showYear?: boolean;
|
|
438
|
+
showQuarter?: boolean;
|
|
439
|
+
showMonth?: boolean;
|
|
440
|
+
onSortClick?: () => void;
|
|
441
|
+
onFilterClick?: () => void;
|
|
442
|
+
}
|
|
443
|
+
declare function SortFilter({ showYear, showQuarter, showMonth, onSortClick, onFilterClick, }: SortFilterProps): react_jsx_runtime.JSX.Element;
|
|
444
|
+
|
|
445
|
+
interface FileUploaderProps {
|
|
446
|
+
onUpload: (file: any) => Promise<void>;
|
|
447
|
+
onRemove?: (index: number) => Promise<void>;
|
|
448
|
+
onError?: (message: string) => void;
|
|
449
|
+
onClickFile?: (file: any) => void;
|
|
450
|
+
accept?: string[];
|
|
451
|
+
maxSize?: number;
|
|
452
|
+
disabled?: boolean;
|
|
453
|
+
mode: "upload" | "drop";
|
|
454
|
+
description?: string;
|
|
455
|
+
label?: string;
|
|
456
|
+
value?: File[] | any[];
|
|
457
|
+
uploadText?: string;
|
|
458
|
+
uploaderWidth?: string;
|
|
459
|
+
attachWidth?: string;
|
|
460
|
+
readOnly?: boolean;
|
|
461
|
+
}
|
|
462
|
+
declare function FileUploader({ onUpload, onError, onRemove, onClickFile, accept, maxSize, disabled, mode, description, label, value, uploadText, uploaderWidth, attachWidth, readOnly, }: FileUploaderProps): react_jsx_runtime.JSX.Element;
|
|
463
|
+
|
|
464
|
+
declare function setMessageApi(api: MessageInstance): void;
|
|
465
|
+
declare function messageSuccess(content: string): void;
|
|
466
|
+
declare function messageError(content: string): void;
|
|
467
|
+
declare function messageWarning(content: string): void;
|
|
468
|
+
declare function messageInfo(content: string): void;
|
|
469
|
+
declare function messageLoading(content: string, duration?: number): void;
|
|
470
|
+
|
|
471
|
+
interface BreadcrumbsProps {
|
|
472
|
+
items: ItemType[];
|
|
473
|
+
separator: ReactNode;
|
|
474
|
+
itemRender?: (route: any, params: any, routes: any[], paths: string[]) => ReactNode;
|
|
475
|
+
classname?: string;
|
|
476
|
+
params?: object;
|
|
477
|
+
}
|
|
478
|
+
declare function Breadcrumbs({ items, separator, itemRender, classname, params, }: BreadcrumbsProps): react_jsx_runtime.JSX.Element;
|
|
479
|
+
|
|
480
|
+
interface HeadingPageProps {
|
|
481
|
+
Heading: string;
|
|
482
|
+
}
|
|
483
|
+
declare function HeadingPage({ Heading }: HeadingPageProps): react_jsx_runtime.JSX.Element;
|
|
484
|
+
|
|
485
|
+
interface ProgressBarProps {
|
|
486
|
+
percent: number | undefined;
|
|
487
|
+
size?: number | [number | string, number] | {
|
|
488
|
+
width: number;
|
|
489
|
+
height: number;
|
|
490
|
+
} | "small" | "default";
|
|
491
|
+
checkpoints?: number[] | undefined;
|
|
492
|
+
showInfo?: boolean;
|
|
493
|
+
trailColor?: string;
|
|
494
|
+
type: "line" | "circle" | "dashboard";
|
|
495
|
+
strokeLinecap?: "round" | "butt" | "square";
|
|
496
|
+
strokeWidth?: number;
|
|
497
|
+
steps?: number;
|
|
498
|
+
isCheckPoints?: boolean;
|
|
499
|
+
}
|
|
500
|
+
declare function ProgressBar({ percent, size, checkpoints, showInfo, trailColor, type, strokeLinecap, strokeWidth, steps, isCheckPoints, }: ProgressBarProps): react_jsx_runtime.JSX.Element;
|
|
501
|
+
|
|
502
|
+
interface KpiNumberItem {
|
|
503
|
+
id: string;
|
|
504
|
+
name: string;
|
|
505
|
+
value: string;
|
|
506
|
+
unit: string;
|
|
507
|
+
isEditing?: boolean;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
interface KpiSectionProps {
|
|
511
|
+
type: "number" | "text";
|
|
512
|
+
onChangeKpiList?: (data: KpiNumberItem[]) => void;
|
|
513
|
+
}
|
|
514
|
+
declare function KpiSection({ type, onChangeKpiList }: KpiSectionProps): react_jsx_runtime.JSX.Element;
|
|
515
|
+
|
|
516
|
+
interface ModalProps {
|
|
517
|
+
children: ReactNode;
|
|
518
|
+
isOpen: boolean;
|
|
519
|
+
width?: string | number;
|
|
520
|
+
onCancel: () => void;
|
|
521
|
+
}
|
|
522
|
+
declare function AntDModal({ children, isOpen, width, onCancel }: ModalProps): react_jsx_runtime.JSX.Element;
|
|
523
|
+
|
|
524
|
+
interface IndicatorProps {
|
|
525
|
+
option?: {
|
|
526
|
+
value: string;
|
|
527
|
+
label: string;
|
|
528
|
+
}[];
|
|
529
|
+
type: "OUTPUT" | "OUTCOME";
|
|
530
|
+
arrayData: IndicatorArray[];
|
|
531
|
+
canEdit?: boolean;
|
|
532
|
+
setArrayData: (data: IndicatorArray[]) => void;
|
|
533
|
+
onDeleteClick?: (payload: {
|
|
534
|
+
index: number;
|
|
535
|
+
item: IndicatorArray;
|
|
536
|
+
confirm: () => void;
|
|
537
|
+
}) => void;
|
|
538
|
+
}
|
|
539
|
+
interface IndicatorArray {
|
|
540
|
+
indicatorType: "OUTPUT" | "OUTCOME";
|
|
541
|
+
inputType: "TEXT" | "NUMBER";
|
|
542
|
+
textValue: string;
|
|
543
|
+
numberValue?: number;
|
|
544
|
+
unit?: string;
|
|
545
|
+
}
|
|
546
|
+
declare function Indicator({ option, type, arrayData, setArrayData, canEdit, onDeleteClick, }: IndicatorProps): react_jsx_runtime.JSX.Element;
|
|
547
|
+
|
|
548
|
+
interface optionSelect {
|
|
549
|
+
value: string;
|
|
550
|
+
label: string;
|
|
551
|
+
}
|
|
552
|
+
declare const FilterPopUp: (filter: {
|
|
553
|
+
selectionFilter: optionSelect[];
|
|
554
|
+
handleSearch: (listFiler: string[]) => void;
|
|
555
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
556
|
+
|
|
557
|
+
interface UserData {
|
|
558
|
+
id: string;
|
|
559
|
+
name: string;
|
|
560
|
+
profile: string;
|
|
561
|
+
}
|
|
562
|
+
interface ProfileSelectProp {
|
|
563
|
+
allUser: UserData[];
|
|
564
|
+
assignUser: UserData[];
|
|
565
|
+
mode: "show" | "showAssign" | "icon";
|
|
566
|
+
className?: string;
|
|
567
|
+
onUpdateAssignUser: (user: UserData, action?: "add" | "remove") => void;
|
|
568
|
+
}
|
|
569
|
+
declare function ProfileSelect({ allUser, assignUser, mode, className, onUpdateAssignUser, }: ProfileSelectProp): react_jsx_runtime.JSX.Element;
|
|
570
|
+
|
|
571
|
+
interface QRCodeGeneratorProps {
|
|
572
|
+
url: string;
|
|
573
|
+
previewSize?: number;
|
|
574
|
+
defaultExportSize?: number;
|
|
575
|
+
fileBaseName?: string;
|
|
576
|
+
}
|
|
577
|
+
declare const QRCodeGenerator: react.FC<QRCodeGeneratorProps>;
|
|
578
|
+
|
|
579
|
+
interface TabProjectProp {
|
|
580
|
+
tabOption: {
|
|
581
|
+
key: string;
|
|
582
|
+
label: string;
|
|
583
|
+
icon: ReactNode$1;
|
|
584
|
+
}[];
|
|
585
|
+
projectId: string;
|
|
586
|
+
now: string;
|
|
587
|
+
onChange: (key: string) => void;
|
|
588
|
+
}
|
|
589
|
+
declare function TabProject({ tabOption, now, onChange }: TabProjectProp): react_jsx_runtime.JSX.Element;
|
|
590
|
+
|
|
591
|
+
type Datum = {
|
|
592
|
+
x: string;
|
|
593
|
+
y: number;
|
|
594
|
+
};
|
|
595
|
+
type Props = {
|
|
596
|
+
data: Datum[];
|
|
597
|
+
height?: number;
|
|
598
|
+
margin?: {
|
|
599
|
+
top: number;
|
|
600
|
+
right: number;
|
|
601
|
+
bottom: number;
|
|
602
|
+
left: number;
|
|
603
|
+
};
|
|
604
|
+
yLabel?: string;
|
|
605
|
+
xLabel?: string;
|
|
606
|
+
colorPalette?: string[];
|
|
607
|
+
};
|
|
608
|
+
declare const BarChart: ({ data, height, margin, yLabel, xLabel, colorPalette, }: Props) => react_jsx_runtime.JSX.Element;
|
|
609
|
+
|
|
610
|
+
interface PieChartProps {
|
|
611
|
+
title?: string;
|
|
612
|
+
description?: string;
|
|
613
|
+
data: {
|
|
614
|
+
label: string;
|
|
615
|
+
value: number;
|
|
616
|
+
}[];
|
|
617
|
+
width: number;
|
|
618
|
+
height: number;
|
|
619
|
+
colorPalette?: string[];
|
|
620
|
+
}
|
|
621
|
+
declare const PieChart: react.FC<PieChartProps>;
|
|
622
|
+
|
|
623
|
+
export { AntDModal, AntDataTable, BarChart, Breadcrumbs, Calendar, Checkbox, CheckboxGroup, ColorPalettePickerBasic, ColorPickerBasic, DataTable, DatePickerBasic, DatePickerRange, FileUploader, FilterPopUp, GhostButton, HeadingPage, Indicator, InputField, InputFieldNumber, KpiSection, Loader, MenuNavBar, type MenuNavBarProps, PieChart, PrimaryButton, ProfileSelect, ProgressBar, QRCodeGenerator, Radio, RadioGroup, SecondaryButton, SelectCustom, SelectField, SelectFieldGroup, SelectFieldStatus, SelectFieldStatusReport, SelectFieldTag, Sidebar, SortFilter, Switch, SwitchSelect, TabProject, TabSelectionButton, TextAreaInput, TextInput, TopNavBar, messageError, messageInfo, messageLoading, messageSuccess, messageWarning, setMessageApi };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,623 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import react, { ReactNode } from 'react';
|
|
3
|
+
import * as antd_es_table_interface from 'antd/es/table/interface';
|
|
4
|
+
import { ColumnsType, TableProps } from 'antd/es/table';
|
|
5
|
+
import { EventSourceInput } from '@fullcalendar/core';
|
|
6
|
+
import { InputNumberProps, SelectProps } from 'antd';
|
|
7
|
+
import { Color } from 'antd/es/color-picker';
|
|
8
|
+
import { MessageInstance } from 'antd/es/message/interface';
|
|
9
|
+
import { ItemType } from 'antd/es/breadcrumb/Breadcrumb';
|
|
10
|
+
import { ReactNode as ReactNode$1 } from '@tabler/icons-react';
|
|
11
|
+
|
|
12
|
+
type ColorScale = 50 | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
|
|
13
|
+
type BaseColor = "primary" | "gray" | "green" | "red" | "yellow" | "blue";
|
|
14
|
+
type ThemeColor = `bg-${BaseColor}-${ColorScale}`;
|
|
15
|
+
interface PrimaryButtonProps {
|
|
16
|
+
title: string;
|
|
17
|
+
onClick: () => void;
|
|
18
|
+
iconLeft?: React.ReactNode;
|
|
19
|
+
iconRight?: React.ReactNode;
|
|
20
|
+
bgColor?: ThemeColor;
|
|
21
|
+
textColor?: "white" | "black";
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
}
|
|
24
|
+
declare function PrimaryButton({ title, onClick, iconLeft, iconRight, bgColor, textColor, disabled, }: PrimaryButtonProps): react_jsx_runtime.JSX.Element;
|
|
25
|
+
|
|
26
|
+
interface SecondaryButtonProps {
|
|
27
|
+
title: string;
|
|
28
|
+
onClick: () => void;
|
|
29
|
+
iconLeft?: React.ReactNode;
|
|
30
|
+
iconRight?: React.ReactNode;
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
}
|
|
33
|
+
declare function SecondaryButton({ title, onClick, iconLeft, iconRight, disabled }: SecondaryButtonProps): react_jsx_runtime.JSX.Element;
|
|
34
|
+
|
|
35
|
+
interface GhostButtonProps {
|
|
36
|
+
title: string;
|
|
37
|
+
onClick: () => void;
|
|
38
|
+
iconLeft?: React.ReactNode;
|
|
39
|
+
iconRight?: React.ReactNode;
|
|
40
|
+
disabled?: boolean;
|
|
41
|
+
}
|
|
42
|
+
declare function GhostButton({ title, onClick, iconLeft, iconRight, disabled }: GhostButtonProps): react_jsx_runtime.JSX.Element;
|
|
43
|
+
|
|
44
|
+
interface Title {
|
|
45
|
+
path: string;
|
|
46
|
+
name: string;
|
|
47
|
+
}
|
|
48
|
+
interface ParamTabSelection {
|
|
49
|
+
title: Title[];
|
|
50
|
+
now: string;
|
|
51
|
+
onClickGoto: (path: string) => void;
|
|
52
|
+
}
|
|
53
|
+
declare const TabSelectionButton: ({ title, now, onClickGoto }: ParamTabSelection) => react_jsx_runtime.JSX.Element;
|
|
54
|
+
|
|
55
|
+
interface LoaderProps {
|
|
56
|
+
size?: number;
|
|
57
|
+
color?: string;
|
|
58
|
+
}
|
|
59
|
+
declare function Loader({ size, color }: LoaderProps): react_jsx_runtime.JSX.Element;
|
|
60
|
+
|
|
61
|
+
interface CheckboxProps {
|
|
62
|
+
label?: string;
|
|
63
|
+
checked: boolean;
|
|
64
|
+
onChange: (checked: boolean) => void;
|
|
65
|
+
disabled?: boolean;
|
|
66
|
+
}
|
|
67
|
+
declare function Checkbox({ label, checked, onChange, disabled }: CheckboxProps): react_jsx_runtime.JSX.Element;
|
|
68
|
+
|
|
69
|
+
interface CheckboxOption {
|
|
70
|
+
checked: boolean;
|
|
71
|
+
label: string;
|
|
72
|
+
disabled?: boolean;
|
|
73
|
+
}
|
|
74
|
+
interface CheckboxGroupProps {
|
|
75
|
+
options: CheckboxOption[];
|
|
76
|
+
onChange: (label: string) => void;
|
|
77
|
+
alignment?: "horizontal" | "vertical";
|
|
78
|
+
}
|
|
79
|
+
declare function CheckboxGroup({ options, onChange, alignment }: CheckboxGroupProps): react_jsx_runtime.JSX.Element;
|
|
80
|
+
|
|
81
|
+
interface RadioProps {
|
|
82
|
+
selected: boolean;
|
|
83
|
+
onChange: (selected: boolean) => void;
|
|
84
|
+
disabled?: boolean;
|
|
85
|
+
}
|
|
86
|
+
declare function Radio({ selected, onChange, disabled }: RadioProps): react_jsx_runtime.JSX.Element;
|
|
87
|
+
|
|
88
|
+
interface RadioOption {
|
|
89
|
+
value: string;
|
|
90
|
+
label: string;
|
|
91
|
+
disabled?: boolean;
|
|
92
|
+
}
|
|
93
|
+
interface RadioGroupProps {
|
|
94
|
+
options: RadioOption[];
|
|
95
|
+
value: string;
|
|
96
|
+
onChange: (value: string) => void;
|
|
97
|
+
alignment?: "vertical" | "horizontal";
|
|
98
|
+
}
|
|
99
|
+
declare function RadioGroup({ options, value, onChange, alignment }: RadioGroupProps): react_jsx_runtime.JSX.Element;
|
|
100
|
+
|
|
101
|
+
interface SwitchProps {
|
|
102
|
+
label?: string;
|
|
103
|
+
checked: boolean;
|
|
104
|
+
onChange: (checked: boolean) => void;
|
|
105
|
+
disabled?: boolean;
|
|
106
|
+
}
|
|
107
|
+
declare function Switch({ label, checked, onChange, disabled }: SwitchProps): react_jsx_runtime.JSX.Element;
|
|
108
|
+
|
|
109
|
+
interface SwitchSelectProp {
|
|
110
|
+
option: {
|
|
111
|
+
value: string;
|
|
112
|
+
label: string;
|
|
113
|
+
}[];
|
|
114
|
+
value: string | number;
|
|
115
|
+
label: string;
|
|
116
|
+
color?: string;
|
|
117
|
+
required?: boolean;
|
|
118
|
+
onClick: (active: string) => void;
|
|
119
|
+
}
|
|
120
|
+
declare function SwitchSelect({ option, onClick, value, label, required, color, }: SwitchSelectProp): react_jsx_runtime.JSX.Element;
|
|
121
|
+
|
|
122
|
+
interface Menu {
|
|
123
|
+
title: string;
|
|
124
|
+
subMenus: {
|
|
125
|
+
title: string;
|
|
126
|
+
icon?: React.ReactNode | React.ReactElement;
|
|
127
|
+
iconActive?: React.ReactNode | React.ReactElement;
|
|
128
|
+
path: string;
|
|
129
|
+
customNode?: React.ReactNode | React.ReactElement;
|
|
130
|
+
}[];
|
|
131
|
+
}
|
|
132
|
+
interface MenuNavBarProps {
|
|
133
|
+
menus: Menu[];
|
|
134
|
+
onClick: (path: string) => void;
|
|
135
|
+
}
|
|
136
|
+
declare function MenuNavBar({ menus, onClick }: MenuNavBarProps): react_jsx_runtime.JSX.Element;
|
|
137
|
+
|
|
138
|
+
interface SidebarProps {
|
|
139
|
+
children: React.ReactNode;
|
|
140
|
+
logo?: string;
|
|
141
|
+
}
|
|
142
|
+
interface Sidebar {
|
|
143
|
+
icon: React.ReactNode;
|
|
144
|
+
iconHover?: React.ReactNode;
|
|
145
|
+
text: string;
|
|
146
|
+
disabled?: boolean;
|
|
147
|
+
}
|
|
148
|
+
declare function Sidebar({ children, logo }: SidebarProps): react_jsx_runtime.JSX.Element;
|
|
149
|
+
|
|
150
|
+
interface TopNavBarProps {
|
|
151
|
+
onClickNoti: () => void;
|
|
152
|
+
logo?: React.ReactNode;
|
|
153
|
+
}
|
|
154
|
+
declare function TopNavBar({ onClickNoti, logo }: TopNavBarProps): react_jsx_runtime.JSX.Element;
|
|
155
|
+
|
|
156
|
+
interface Column<T> {
|
|
157
|
+
header: string;
|
|
158
|
+
accessor: keyof T | ((row: T) => react.ReactNode);
|
|
159
|
+
sortable?: boolean;
|
|
160
|
+
}
|
|
161
|
+
interface DataTableProps<T> {
|
|
162
|
+
columns: Column<T>[];
|
|
163
|
+
data: T[];
|
|
164
|
+
onSort: () => void;
|
|
165
|
+
isLoading?: boolean;
|
|
166
|
+
}
|
|
167
|
+
declare function DataTable<T>({ columns, data, onSort, isLoading }: DataTableProps<T>): react_jsx_runtime.JSX.Element;
|
|
168
|
+
|
|
169
|
+
interface AntDataTableProps<T> {
|
|
170
|
+
dataSource: T[];
|
|
171
|
+
columns: ColumnsType<T>;
|
|
172
|
+
pageSize?: number;
|
|
173
|
+
rowCheckbox?: boolean;
|
|
174
|
+
onRowSelect?: (newSelectedRowKeys: React.Key[]) => void;
|
|
175
|
+
onFilter: (filters: Record<string, antd_es_table_interface.FilterValue | null>) => void;
|
|
176
|
+
onChange?: TableProps<T>["onChange"];
|
|
177
|
+
width?: number;
|
|
178
|
+
height?: number;
|
|
179
|
+
pagination?: boolean;
|
|
180
|
+
}
|
|
181
|
+
declare function AntDataTable<T extends {
|
|
182
|
+
key: React.Key;
|
|
183
|
+
}>({ dataSource, columns, pageSize, rowCheckbox, onRowSelect, onFilter, onChange, width, height, pagination, }: AntDataTableProps<T>): react_jsx_runtime.JSX.Element;
|
|
184
|
+
|
|
185
|
+
interface CalendarProps {
|
|
186
|
+
events: EventSourceInput | undefined;
|
|
187
|
+
}
|
|
188
|
+
declare function Calendar({ events }: CalendarProps): react_jsx_runtime.JSX.Element;
|
|
189
|
+
|
|
190
|
+
interface TextInputProps {
|
|
191
|
+
label?: string;
|
|
192
|
+
placeholder?: string;
|
|
193
|
+
type?: "text" | "password";
|
|
194
|
+
maxLength?: number;
|
|
195
|
+
required?: boolean;
|
|
196
|
+
error?: string;
|
|
197
|
+
value?: string;
|
|
198
|
+
onChange: (value: string) => void;
|
|
199
|
+
disabled?: boolean;
|
|
200
|
+
}
|
|
201
|
+
declare function TextInput({ label, placeholder, type, maxLength, required, error, value, onChange, disabled, }: TextInputProps): react_jsx_runtime.JSX.Element;
|
|
202
|
+
|
|
203
|
+
interface TextAreaProps {
|
|
204
|
+
label?: string;
|
|
205
|
+
height?: number;
|
|
206
|
+
placeholder?: string;
|
|
207
|
+
value: string;
|
|
208
|
+
onChange: (value: string) => void;
|
|
209
|
+
maxLength?: number;
|
|
210
|
+
resizable?: boolean;
|
|
211
|
+
showCount?: boolean;
|
|
212
|
+
required?: boolean;
|
|
213
|
+
error?: string;
|
|
214
|
+
disabled?: boolean;
|
|
215
|
+
}
|
|
216
|
+
declare function TextAreaInput({ label, height, placeholder, onChange, value, maxLength, resizable, showCount, required, error, disabled, }: TextAreaProps): react_jsx_runtime.JSX.Element;
|
|
217
|
+
|
|
218
|
+
interface InputFieldProps {
|
|
219
|
+
value: string | undefined;
|
|
220
|
+
onChange: (value: string | undefined) => void;
|
|
221
|
+
placeholder?: string;
|
|
222
|
+
label?: string;
|
|
223
|
+
required?: boolean;
|
|
224
|
+
disabled?: boolean;
|
|
225
|
+
error?: string;
|
|
226
|
+
addonBefore?: ReactNode;
|
|
227
|
+
addonAfter?: ReactNode;
|
|
228
|
+
defaultValue?: string;
|
|
229
|
+
className?: string;
|
|
230
|
+
onClear?: () => void;
|
|
231
|
+
statickey?: string;
|
|
232
|
+
}
|
|
233
|
+
declare function InputField({ value, onChange, placeholder, label, required, disabled, error, addonBefore, addonAfter, defaultValue, className, onClear, statickey, }: InputFieldProps): react_jsx_runtime.JSX.Element;
|
|
234
|
+
|
|
235
|
+
interface InputFieldNumberProps {
|
|
236
|
+
value: number | string | null;
|
|
237
|
+
onChange: (value: number | string | null) => void;
|
|
238
|
+
placeholder?: string;
|
|
239
|
+
label?: string;
|
|
240
|
+
required?: boolean;
|
|
241
|
+
disabled?: boolean;
|
|
242
|
+
error?: string;
|
|
243
|
+
addonBefore?: React.ReactNode;
|
|
244
|
+
addonAfter?: React.ReactNode;
|
|
245
|
+
defaultValue?: number;
|
|
246
|
+
className?: string;
|
|
247
|
+
max?: number;
|
|
248
|
+
min?: number;
|
|
249
|
+
controls?: boolean | {
|
|
250
|
+
upIcon?: React.ReactNode;
|
|
251
|
+
downIcon?: React.ReactNode;
|
|
252
|
+
};
|
|
253
|
+
size?: "large" | "middle" | "small";
|
|
254
|
+
changeOnWheel?: boolean;
|
|
255
|
+
formatter?: InputNumberProps["formatter"];
|
|
256
|
+
parser?: InputNumberProps["parser"];
|
|
257
|
+
}
|
|
258
|
+
declare function InputFieldNumber({ value, onChange, placeholder, label, required, disabled, error, addonBefore, addonAfter, defaultValue, className, max, min, controls, size, changeOnWheel, formatter, parser, }: InputFieldNumberProps): react_jsx_runtime.JSX.Element;
|
|
259
|
+
|
|
260
|
+
interface DatePickerBasicProps {
|
|
261
|
+
value: Date | null;
|
|
262
|
+
onChange: (day: Date | null) => void;
|
|
263
|
+
required?: boolean;
|
|
264
|
+
label?: string;
|
|
265
|
+
error?: string;
|
|
266
|
+
placeholder?: string;
|
|
267
|
+
disabled?: boolean;
|
|
268
|
+
defaultValue?: Date | null;
|
|
269
|
+
minDate?: Date;
|
|
270
|
+
maxDate?: Date;
|
|
271
|
+
disabledDate?: (currentDate: Date) => boolean;
|
|
272
|
+
disablePast?: boolean;
|
|
273
|
+
className?: string;
|
|
274
|
+
size?: "small" | "middle" | "large";
|
|
275
|
+
}
|
|
276
|
+
declare function DatePickerBasic({ value, onChange, label, required, error, disabled, placeholder, minDate, maxDate, disabledDate, disablePast, }: DatePickerBasicProps): react_jsx_runtime.JSX.Element;
|
|
277
|
+
|
|
278
|
+
interface DatePickerRangeProps {
|
|
279
|
+
value: [Date | null, Date | null];
|
|
280
|
+
onChange: (range: [Date | null, Date | null]) => void;
|
|
281
|
+
required?: boolean;
|
|
282
|
+
label?: string;
|
|
283
|
+
error?: string;
|
|
284
|
+
disabled?: boolean;
|
|
285
|
+
minDate?: Date;
|
|
286
|
+
maxDate?: Date;
|
|
287
|
+
disabledDate?: (currentDate: Date) => boolean;
|
|
288
|
+
disablePast?: boolean;
|
|
289
|
+
className?: string;
|
|
290
|
+
}
|
|
291
|
+
declare function DatePickerRange({ value, onChange, label, required, error, disabled, minDate, maxDate, disabledDate, disablePast, }: DatePickerRangeProps): react_jsx_runtime.JSX.Element;
|
|
292
|
+
|
|
293
|
+
interface ColorPickerProps {
|
|
294
|
+
value: string | null;
|
|
295
|
+
onChange?: (color: Color, hex: string) => void;
|
|
296
|
+
required?: boolean;
|
|
297
|
+
label?: string;
|
|
298
|
+
error?: string;
|
|
299
|
+
disabled?: boolean;
|
|
300
|
+
allowClear?: boolean;
|
|
301
|
+
defaultFormat?: "hex" | "rgb" | "hsb";
|
|
302
|
+
className?: string;
|
|
303
|
+
placeholder?: string;
|
|
304
|
+
}
|
|
305
|
+
declare function ColorPickerBasic({ value, onChange, required, label, error, disabled, allowClear, defaultFormat, className, placeholder, }: ColorPickerProps): react_jsx_runtime.JSX.Element;
|
|
306
|
+
|
|
307
|
+
interface ColorPalettePickerBasicProps {
|
|
308
|
+
value: string | null;
|
|
309
|
+
onChange?: (color: Color, hex: string) => void;
|
|
310
|
+
required?: boolean;
|
|
311
|
+
label?: string;
|
|
312
|
+
error?: string;
|
|
313
|
+
disabled?: boolean;
|
|
314
|
+
allowClear?: boolean;
|
|
315
|
+
defaultFormat?: "hex" | "rgb" | "hsb";
|
|
316
|
+
className?: string;
|
|
317
|
+
placeholder?: string;
|
|
318
|
+
onClear?: () => void;
|
|
319
|
+
}
|
|
320
|
+
declare function ColorPalettePickerBasic({ value, onChange, required, label, error, disabled, allowClear, defaultFormat, className, placeholder, onClear, }: ColorPalettePickerBasicProps): react_jsx_runtime.JSX.Element;
|
|
321
|
+
|
|
322
|
+
interface SelectFieldProps$1 {
|
|
323
|
+
value?: SelectProps["value"];
|
|
324
|
+
onChange: (value: SelectProps["value"]) => void;
|
|
325
|
+
placeholder?: string;
|
|
326
|
+
label?: string;
|
|
327
|
+
required?: boolean;
|
|
328
|
+
error?: string;
|
|
329
|
+
disabled?: boolean;
|
|
330
|
+
defaultValue?: string;
|
|
331
|
+
options?: {
|
|
332
|
+
label: ReactNode;
|
|
333
|
+
value: string | number | null;
|
|
334
|
+
disabled?: boolean;
|
|
335
|
+
}[];
|
|
336
|
+
mode?: "multiple" | "tags";
|
|
337
|
+
handleSearch?: (value: string) => void;
|
|
338
|
+
prefix?: ReactNode;
|
|
339
|
+
prefixSize?: number;
|
|
340
|
+
className?: string;
|
|
341
|
+
onClear?: () => void;
|
|
342
|
+
}
|
|
343
|
+
declare function SelectField({ value, onChange, placeholder, label, required, error, disabled, defaultValue, options, mode, prefix, prefixSize, handleSearch, className, onClear, }: SelectFieldProps$1): react_jsx_runtime.JSX.Element;
|
|
344
|
+
|
|
345
|
+
interface SelectFieldProps {
|
|
346
|
+
value?: SelectProps["value"];
|
|
347
|
+
onChange: (value: SelectProps["value"]) => void;
|
|
348
|
+
placeholder?: string;
|
|
349
|
+
label?: string;
|
|
350
|
+
required?: boolean;
|
|
351
|
+
error?: string;
|
|
352
|
+
disabled?: boolean;
|
|
353
|
+
defaultValue?: string;
|
|
354
|
+
options?: {
|
|
355
|
+
label: ReactNode;
|
|
356
|
+
options: {
|
|
357
|
+
label: ReactNode;
|
|
358
|
+
value: string | number;
|
|
359
|
+
disabled?: boolean;
|
|
360
|
+
}[];
|
|
361
|
+
}[];
|
|
362
|
+
mode?: "multiple" | "tags";
|
|
363
|
+
handleSearch?: (value: string) => void;
|
|
364
|
+
prefix?: ReactNode;
|
|
365
|
+
prefixSize?: number;
|
|
366
|
+
className?: string;
|
|
367
|
+
}
|
|
368
|
+
declare function SelectFieldGroup({ value, onChange, placeholder, label, required, error, disabled, defaultValue, options, mode, prefix, prefixSize, handleSearch, className, }: SelectFieldProps): react_jsx_runtime.JSX.Element;
|
|
369
|
+
|
|
370
|
+
interface SelectFieldStatusProps {
|
|
371
|
+
value: string | undefined;
|
|
372
|
+
onChange: (value: string | undefined) => void;
|
|
373
|
+
placeholder?: string;
|
|
374
|
+
label?: string;
|
|
375
|
+
required?: boolean;
|
|
376
|
+
disabled?: boolean;
|
|
377
|
+
error?: string;
|
|
378
|
+
options?: {
|
|
379
|
+
label: ReactNode;
|
|
380
|
+
value: string | number | null;
|
|
381
|
+
disabled?: boolean;
|
|
382
|
+
}[];
|
|
383
|
+
className?: string;
|
|
384
|
+
}
|
|
385
|
+
declare function SelectFieldStatus({ value, onChange, placeholder, label, required, disabled, error, options, className, }: SelectFieldStatusProps): react_jsx_runtime.JSX.Element;
|
|
386
|
+
|
|
387
|
+
interface SelectFieldStatusReportProps {
|
|
388
|
+
value: string | undefined;
|
|
389
|
+
onChange: (value: string | undefined) => void;
|
|
390
|
+
placeholder?: string;
|
|
391
|
+
label?: string;
|
|
392
|
+
required?: boolean;
|
|
393
|
+
disabled?: boolean;
|
|
394
|
+
error?: string;
|
|
395
|
+
className?: string;
|
|
396
|
+
options?: {
|
|
397
|
+
label: ReactNode;
|
|
398
|
+
value: string | number | null;
|
|
399
|
+
disabled?: boolean;
|
|
400
|
+
}[];
|
|
401
|
+
}
|
|
402
|
+
declare function SelectFieldStatusReport({ value, onChange, placeholder, label, required, disabled, error, className, options, }: SelectFieldStatusReportProps): react_jsx_runtime.JSX.Element;
|
|
403
|
+
|
|
404
|
+
interface SelectFieldTagProps {
|
|
405
|
+
label?: string | null;
|
|
406
|
+
required?: boolean;
|
|
407
|
+
placeholder?: string;
|
|
408
|
+
options?: {
|
|
409
|
+
label: ReactNode;
|
|
410
|
+
value: string | number | null;
|
|
411
|
+
disabled?: boolean;
|
|
412
|
+
}[];
|
|
413
|
+
error?: string;
|
|
414
|
+
value?: string[];
|
|
415
|
+
onChange?: (val: string[]) => void;
|
|
416
|
+
className?: string;
|
|
417
|
+
onClear?: () => void;
|
|
418
|
+
}
|
|
419
|
+
declare function SelectFieldTag({ label, required, placeholder, options, error, value: controlledValue, className, onChange, onClear, }: SelectFieldTagProps): react_jsx_runtime.JSX.Element;
|
|
420
|
+
|
|
421
|
+
interface OptionItem {
|
|
422
|
+
value: string;
|
|
423
|
+
label: string;
|
|
424
|
+
}
|
|
425
|
+
interface SelectCustomProps {
|
|
426
|
+
label?: string;
|
|
427
|
+
placeholder?: string;
|
|
428
|
+
options: OptionItem[];
|
|
429
|
+
required?: boolean;
|
|
430
|
+
onChange?: (valueList: string[]) => void;
|
|
431
|
+
error?: string;
|
|
432
|
+
onClear?: () => void;
|
|
433
|
+
}
|
|
434
|
+
declare function SelectCustom({ label, placeholder, options, required, onChange, error, onClear, }: SelectCustomProps): react_jsx_runtime.JSX.Element;
|
|
435
|
+
|
|
436
|
+
interface SortFilterProps {
|
|
437
|
+
showYear?: boolean;
|
|
438
|
+
showQuarter?: boolean;
|
|
439
|
+
showMonth?: boolean;
|
|
440
|
+
onSortClick?: () => void;
|
|
441
|
+
onFilterClick?: () => void;
|
|
442
|
+
}
|
|
443
|
+
declare function SortFilter({ showYear, showQuarter, showMonth, onSortClick, onFilterClick, }: SortFilterProps): react_jsx_runtime.JSX.Element;
|
|
444
|
+
|
|
445
|
+
interface FileUploaderProps {
|
|
446
|
+
onUpload: (file: any) => Promise<void>;
|
|
447
|
+
onRemove?: (index: number) => Promise<void>;
|
|
448
|
+
onError?: (message: string) => void;
|
|
449
|
+
onClickFile?: (file: any) => void;
|
|
450
|
+
accept?: string[];
|
|
451
|
+
maxSize?: number;
|
|
452
|
+
disabled?: boolean;
|
|
453
|
+
mode: "upload" | "drop";
|
|
454
|
+
description?: string;
|
|
455
|
+
label?: string;
|
|
456
|
+
value?: File[] | any[];
|
|
457
|
+
uploadText?: string;
|
|
458
|
+
uploaderWidth?: string;
|
|
459
|
+
attachWidth?: string;
|
|
460
|
+
readOnly?: boolean;
|
|
461
|
+
}
|
|
462
|
+
declare function FileUploader({ onUpload, onError, onRemove, onClickFile, accept, maxSize, disabled, mode, description, label, value, uploadText, uploaderWidth, attachWidth, readOnly, }: FileUploaderProps): react_jsx_runtime.JSX.Element;
|
|
463
|
+
|
|
464
|
+
declare function setMessageApi(api: MessageInstance): void;
|
|
465
|
+
declare function messageSuccess(content: string): void;
|
|
466
|
+
declare function messageError(content: string): void;
|
|
467
|
+
declare function messageWarning(content: string): void;
|
|
468
|
+
declare function messageInfo(content: string): void;
|
|
469
|
+
declare function messageLoading(content: string, duration?: number): void;
|
|
470
|
+
|
|
471
|
+
interface BreadcrumbsProps {
|
|
472
|
+
items: ItemType[];
|
|
473
|
+
separator: ReactNode;
|
|
474
|
+
itemRender?: (route: any, params: any, routes: any[], paths: string[]) => ReactNode;
|
|
475
|
+
classname?: string;
|
|
476
|
+
params?: object;
|
|
477
|
+
}
|
|
478
|
+
declare function Breadcrumbs({ items, separator, itemRender, classname, params, }: BreadcrumbsProps): react_jsx_runtime.JSX.Element;
|
|
479
|
+
|
|
480
|
+
interface HeadingPageProps {
|
|
481
|
+
Heading: string;
|
|
482
|
+
}
|
|
483
|
+
declare function HeadingPage({ Heading }: HeadingPageProps): react_jsx_runtime.JSX.Element;
|
|
484
|
+
|
|
485
|
+
interface ProgressBarProps {
|
|
486
|
+
percent: number | undefined;
|
|
487
|
+
size?: number | [number | string, number] | {
|
|
488
|
+
width: number;
|
|
489
|
+
height: number;
|
|
490
|
+
} | "small" | "default";
|
|
491
|
+
checkpoints?: number[] | undefined;
|
|
492
|
+
showInfo?: boolean;
|
|
493
|
+
trailColor?: string;
|
|
494
|
+
type: "line" | "circle" | "dashboard";
|
|
495
|
+
strokeLinecap?: "round" | "butt" | "square";
|
|
496
|
+
strokeWidth?: number;
|
|
497
|
+
steps?: number;
|
|
498
|
+
isCheckPoints?: boolean;
|
|
499
|
+
}
|
|
500
|
+
declare function ProgressBar({ percent, size, checkpoints, showInfo, trailColor, type, strokeLinecap, strokeWidth, steps, isCheckPoints, }: ProgressBarProps): react_jsx_runtime.JSX.Element;
|
|
501
|
+
|
|
502
|
+
interface KpiNumberItem {
|
|
503
|
+
id: string;
|
|
504
|
+
name: string;
|
|
505
|
+
value: string;
|
|
506
|
+
unit: string;
|
|
507
|
+
isEditing?: boolean;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
interface KpiSectionProps {
|
|
511
|
+
type: "number" | "text";
|
|
512
|
+
onChangeKpiList?: (data: KpiNumberItem[]) => void;
|
|
513
|
+
}
|
|
514
|
+
declare function KpiSection({ type, onChangeKpiList }: KpiSectionProps): react_jsx_runtime.JSX.Element;
|
|
515
|
+
|
|
516
|
+
interface ModalProps {
|
|
517
|
+
children: ReactNode;
|
|
518
|
+
isOpen: boolean;
|
|
519
|
+
width?: string | number;
|
|
520
|
+
onCancel: () => void;
|
|
521
|
+
}
|
|
522
|
+
declare function AntDModal({ children, isOpen, width, onCancel }: ModalProps): react_jsx_runtime.JSX.Element;
|
|
523
|
+
|
|
524
|
+
interface IndicatorProps {
|
|
525
|
+
option?: {
|
|
526
|
+
value: string;
|
|
527
|
+
label: string;
|
|
528
|
+
}[];
|
|
529
|
+
type: "OUTPUT" | "OUTCOME";
|
|
530
|
+
arrayData: IndicatorArray[];
|
|
531
|
+
canEdit?: boolean;
|
|
532
|
+
setArrayData: (data: IndicatorArray[]) => void;
|
|
533
|
+
onDeleteClick?: (payload: {
|
|
534
|
+
index: number;
|
|
535
|
+
item: IndicatorArray;
|
|
536
|
+
confirm: () => void;
|
|
537
|
+
}) => void;
|
|
538
|
+
}
|
|
539
|
+
interface IndicatorArray {
|
|
540
|
+
indicatorType: "OUTPUT" | "OUTCOME";
|
|
541
|
+
inputType: "TEXT" | "NUMBER";
|
|
542
|
+
textValue: string;
|
|
543
|
+
numberValue?: number;
|
|
544
|
+
unit?: string;
|
|
545
|
+
}
|
|
546
|
+
declare function Indicator({ option, type, arrayData, setArrayData, canEdit, onDeleteClick, }: IndicatorProps): react_jsx_runtime.JSX.Element;
|
|
547
|
+
|
|
548
|
+
interface optionSelect {
|
|
549
|
+
value: string;
|
|
550
|
+
label: string;
|
|
551
|
+
}
|
|
552
|
+
declare const FilterPopUp: (filter: {
|
|
553
|
+
selectionFilter: optionSelect[];
|
|
554
|
+
handleSearch: (listFiler: string[]) => void;
|
|
555
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
556
|
+
|
|
557
|
+
interface UserData {
|
|
558
|
+
id: string;
|
|
559
|
+
name: string;
|
|
560
|
+
profile: string;
|
|
561
|
+
}
|
|
562
|
+
interface ProfileSelectProp {
|
|
563
|
+
allUser: UserData[];
|
|
564
|
+
assignUser: UserData[];
|
|
565
|
+
mode: "show" | "showAssign" | "icon";
|
|
566
|
+
className?: string;
|
|
567
|
+
onUpdateAssignUser: (user: UserData, action?: "add" | "remove") => void;
|
|
568
|
+
}
|
|
569
|
+
declare function ProfileSelect({ allUser, assignUser, mode, className, onUpdateAssignUser, }: ProfileSelectProp): react_jsx_runtime.JSX.Element;
|
|
570
|
+
|
|
571
|
+
interface QRCodeGeneratorProps {
|
|
572
|
+
url: string;
|
|
573
|
+
previewSize?: number;
|
|
574
|
+
defaultExportSize?: number;
|
|
575
|
+
fileBaseName?: string;
|
|
576
|
+
}
|
|
577
|
+
declare const QRCodeGenerator: react.FC<QRCodeGeneratorProps>;
|
|
578
|
+
|
|
579
|
+
interface TabProjectProp {
|
|
580
|
+
tabOption: {
|
|
581
|
+
key: string;
|
|
582
|
+
label: string;
|
|
583
|
+
icon: ReactNode$1;
|
|
584
|
+
}[];
|
|
585
|
+
projectId: string;
|
|
586
|
+
now: string;
|
|
587
|
+
onChange: (key: string) => void;
|
|
588
|
+
}
|
|
589
|
+
declare function TabProject({ tabOption, now, onChange }: TabProjectProp): react_jsx_runtime.JSX.Element;
|
|
590
|
+
|
|
591
|
+
type Datum = {
|
|
592
|
+
x: string;
|
|
593
|
+
y: number;
|
|
594
|
+
};
|
|
595
|
+
type Props = {
|
|
596
|
+
data: Datum[];
|
|
597
|
+
height?: number;
|
|
598
|
+
margin?: {
|
|
599
|
+
top: number;
|
|
600
|
+
right: number;
|
|
601
|
+
bottom: number;
|
|
602
|
+
left: number;
|
|
603
|
+
};
|
|
604
|
+
yLabel?: string;
|
|
605
|
+
xLabel?: string;
|
|
606
|
+
colorPalette?: string[];
|
|
607
|
+
};
|
|
608
|
+
declare const BarChart: ({ data, height, margin, yLabel, xLabel, colorPalette, }: Props) => react_jsx_runtime.JSX.Element;
|
|
609
|
+
|
|
610
|
+
interface PieChartProps {
|
|
611
|
+
title?: string;
|
|
612
|
+
description?: string;
|
|
613
|
+
data: {
|
|
614
|
+
label: string;
|
|
615
|
+
value: number;
|
|
616
|
+
}[];
|
|
617
|
+
width: number;
|
|
618
|
+
height: number;
|
|
619
|
+
colorPalette?: string[];
|
|
620
|
+
}
|
|
621
|
+
declare const PieChart: react.FC<PieChartProps>;
|
|
622
|
+
|
|
623
|
+
export { AntDModal, AntDataTable, BarChart, Breadcrumbs, Calendar, Checkbox, CheckboxGroup, ColorPalettePickerBasic, ColorPickerBasic, DataTable, DatePickerBasic, DatePickerRange, FileUploader, FilterPopUp, GhostButton, HeadingPage, Indicator, InputField, InputFieldNumber, KpiSection, Loader, MenuNavBar, type MenuNavBarProps, PieChart, PrimaryButton, ProfileSelect, ProgressBar, QRCodeGenerator, Radio, RadioGroup, SecondaryButton, SelectCustom, SelectField, SelectFieldGroup, SelectFieldStatus, SelectFieldStatusReport, SelectFieldTag, Sidebar, SortFilter, Switch, SwitchSelect, TabProject, TabSelectionButton, TextAreaInput, TextInput, TopNavBar, messageError, messageInfo, messageLoading, messageSuccess, messageWarning, setMessageApi };
|
package/dist/index.js
CHANGED
|
@@ -4588,11 +4588,32 @@ var BarChart = ({
|
|
|
4588
4588
|
(enter) => enter.append("text").attr("class", "x-axis-label").attr("fill", "currentColor").attr("x", width).attr("y", height - margin.bottom).attr("text-anchor", "middle").style("font-size", "14px").style("font-family", "Arial").text((d) => d),
|
|
4589
4589
|
(update) => update.text((d) => d).attr("x", width)
|
|
4590
4590
|
);
|
|
4591
|
-
const t =
|
|
4591
|
+
const t = d3.transition().duration(400);
|
|
4592
4592
|
const bars = g.selectAll("rect.bar").data(data, (d) => d.x);
|
|
4593
4593
|
bars.join(
|
|
4594
|
-
(enter) =>
|
|
4595
|
-
//
|
|
4594
|
+
// (enter) =>
|
|
4595
|
+
// enter
|
|
4596
|
+
// .append("rect")
|
|
4597
|
+
// .attr("class", "bar")
|
|
4598
|
+
// .attr("x", (d) => margin.left)
|
|
4599
|
+
// .attr("width", x.bandwidth())
|
|
4600
|
+
// .attr("y", () => margin.top + y(0))
|
|
4601
|
+
// .attr("height", () => innerH - y(0))
|
|
4602
|
+
// .attr("rx", 5) // rounded corners
|
|
4603
|
+
// .attr("ry", 5) // rounded corners
|
|
4604
|
+
// .style("fill", (d, i) => colorPalette[i % colorPalette.length]) // Apply color based on index
|
|
4605
|
+
// .append("title")
|
|
4606
|
+
// .text((d) => `${d.x}: ${d.y}`)
|
|
4607
|
+
// .merge(bars) // merge the existing bars after joining
|
|
4608
|
+
// .attr("width", x.bandwidth())
|
|
4609
|
+
// .attr("y", (d) => y(d.y))
|
|
4610
|
+
// .attr("height", (d) => innerH - y(d.y))
|
|
4611
|
+
// .call((enter) => enter.raise()), // Bring the new bars to the front
|
|
4612
|
+
(enter) => {
|
|
4613
|
+
const rects = enter.append("rect").attr("class", "bar").attr("x", (d) => margin.left).attr("width", x.bandwidth()).attr("y", () => margin.top + y(0)).attr("height", () => innerH - y(0)).attr("rx", 5).attr("ry", 5).style("fill", (d, i) => colorPalette[i % colorPalette.length]);
|
|
4614
|
+
rects.append("title").text((d) => `${d.x}: ${d.y}`);
|
|
4615
|
+
return rects.merge(bars).attr("width", x.bandwidth()).attr("y", (d) => y(d.y)).attr("height", (d) => innerH - y(d.y)).call((g2) => g2.raise());
|
|
4616
|
+
},
|
|
4596
4617
|
(update) => update.call((update2) => update2.raise()).transition(t).attr("x", (d) => x(d.x) ?? 0).attr("width", x.bandwidth()).attr("y", (d) => y(d.y)).attr("height", (d) => innerH - y(d.y)).style("fill", (d, i) => colorPalette[i % colorPalette.length]),
|
|
4597
4618
|
// Update color on update
|
|
4598
4619
|
(exit) => exit.transition(t).attr("y", margin.top + y(0)).attr("height", innerH - y(0)).remove()
|
package/dist/index.mjs
CHANGED
|
@@ -4531,11 +4531,32 @@ var BarChart = ({
|
|
|
4531
4531
|
(enter) => enter.append("text").attr("class", "x-axis-label").attr("fill", "currentColor").attr("x", width).attr("y", height - margin.bottom).attr("text-anchor", "middle").style("font-size", "14px").style("font-family", "Arial").text((d) => d),
|
|
4532
4532
|
(update) => update.text((d) => d).attr("x", width)
|
|
4533
4533
|
);
|
|
4534
|
-
const t =
|
|
4534
|
+
const t = d3.transition().duration(400);
|
|
4535
4535
|
const bars = g.selectAll("rect.bar").data(data, (d) => d.x);
|
|
4536
4536
|
bars.join(
|
|
4537
|
-
(enter) =>
|
|
4538
|
-
//
|
|
4537
|
+
// (enter) =>
|
|
4538
|
+
// enter
|
|
4539
|
+
// .append("rect")
|
|
4540
|
+
// .attr("class", "bar")
|
|
4541
|
+
// .attr("x", (d) => margin.left)
|
|
4542
|
+
// .attr("width", x.bandwidth())
|
|
4543
|
+
// .attr("y", () => margin.top + y(0))
|
|
4544
|
+
// .attr("height", () => innerH - y(0))
|
|
4545
|
+
// .attr("rx", 5) // rounded corners
|
|
4546
|
+
// .attr("ry", 5) // rounded corners
|
|
4547
|
+
// .style("fill", (d, i) => colorPalette[i % colorPalette.length]) // Apply color based on index
|
|
4548
|
+
// .append("title")
|
|
4549
|
+
// .text((d) => `${d.x}: ${d.y}`)
|
|
4550
|
+
// .merge(bars) // merge the existing bars after joining
|
|
4551
|
+
// .attr("width", x.bandwidth())
|
|
4552
|
+
// .attr("y", (d) => y(d.y))
|
|
4553
|
+
// .attr("height", (d) => innerH - y(d.y))
|
|
4554
|
+
// .call((enter) => enter.raise()), // Bring the new bars to the front
|
|
4555
|
+
(enter) => {
|
|
4556
|
+
const rects = enter.append("rect").attr("class", "bar").attr("x", (d) => margin.left).attr("width", x.bandwidth()).attr("y", () => margin.top + y(0)).attr("height", () => innerH - y(0)).attr("rx", 5).attr("ry", 5).style("fill", (d, i) => colorPalette[i % colorPalette.length]);
|
|
4557
|
+
rects.append("title").text((d) => `${d.x}: ${d.y}`);
|
|
4558
|
+
return rects.merge(bars).attr("width", x.bandwidth()).attr("y", (d) => y(d.y)).attr("height", (d) => innerH - y(d.y)).call((g2) => g2.raise());
|
|
4559
|
+
},
|
|
4539
4560
|
(update) => update.call((update2) => update2.raise()).transition(t).attr("x", (d) => x(d.x) ?? 0).attr("width", x.bandwidth()).attr("y", (d) => y(d.y)).attr("height", (d) => innerH - y(d.y)).style("fill", (d, i) => colorPalette[i % colorPalette.length]),
|
|
4540
4561
|
// Update color on update
|
|
4541
4562
|
(exit) => exit.transition(t).attr("y", margin.top + y(0)).attr("height", innerH - y(0)).remove()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@esic-lab/data-core-ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.57",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -41,8 +41,7 @@
|
|
|
41
41
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
42
42
|
"storybook": "storybook dev -p 6006",
|
|
43
43
|
"build-storybook": "storybook build",
|
|
44
|
-
"build": "tsup src/index.ts --format esm,cjs --out-dir dist && npm run copy-assets",
|
|
45
|
-
"build:dts": "tsup src/index.ts --dts --dts-resolve --out-dir dist",
|
|
44
|
+
"build": "tsup src/index.ts --dts --dts-resolve --format esm,cjs --out-dir dist && npm run copy-assets",
|
|
46
45
|
"copy-assets": "xcopy src\\assets dist\\assets /E /I /Y",
|
|
47
46
|
"type-check": "tsc --noEmit"
|
|
48
47
|
},
|