@povio/ui 3.3.0-rc.4 → 3.4.0-rc.1
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/README.md +15 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.js +55 -206
- package/dist/components/buttons/InlineIconButton/InlineIconButton.js +9 -34
- package/dist/components/buttons/shared/ButtonContent.js +22 -80
- package/dist/components/inputs/Checkbox/Checkbox.d.ts +1 -2
- package/dist/components/inputs/Checkbox/Checkbox.js +93 -100
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +10 -24
- package/dist/components/inputs/Checkbox/CheckboxGroup.d.ts +1 -2
- package/dist/components/inputs/Checkbox/CheckboxGroup.js +109 -113
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +1 -2
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +97 -238
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +1 -2
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +88 -214
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +1 -2
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +64 -143
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +1 -2
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +275 -294
- package/dist/components/inputs/DateTime/shared/Calendar.js +139 -339
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +114 -308
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +35 -150
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +95 -229
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +115 -296
- package/dist/components/inputs/DateTime/shared/DateField.js +135 -306
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +1 -2
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +136 -343
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +10 -59
- package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +1 -2
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +43 -46
- package/dist/components/inputs/File/FileUpload.d.ts +1 -1
- package/dist/components/inputs/File/FileUpload.js +18 -18
- package/dist/components/inputs/File/InputUpload.d.ts +1 -1
- package/dist/components/inputs/File/InputUpload.js +82 -278
- package/dist/components/inputs/File/fileUpload.types.d.ts +1 -1
- package/dist/components/inputs/File/inputUpload.types.d.ts +1 -1
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +48 -180
- package/dist/components/inputs/File/shared/FileUploadContentError.js +95 -265
- package/dist/components/inputs/File/shared/FileUploadContentFilled.js +99 -261
- package/dist/components/inputs/File/shared/FileUploadContentLoading.js +56 -234
- package/dist/components/inputs/File/shared/ProgressBar.js +15 -102
- package/dist/components/inputs/FormField/FormField.js +34 -47
- package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +1 -1
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +19 -19
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts +1 -1
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +93 -331
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.d.ts +1 -1
- package/dist/components/inputs/Input/TextArea/TextArea.d.ts +1 -1
- package/dist/components/inputs/Input/TextArea/TextArea.js +18 -18
- package/dist/components/inputs/Input/TextInput/TextInput.d.ts +2 -2
- package/dist/components/inputs/Input/TextInput/TextInput.js +36 -38
- package/dist/components/inputs/Inputs/Form.d.ts +4 -4
- package/dist/components/inputs/Inputs/InputItem.d.ts +22 -22
- package/dist/components/inputs/Inputs/InputItem.js +35 -36
- package/dist/components/inputs/Inputs/Inputs.d.ts +2 -2
- package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +1 -2
- package/dist/components/inputs/RadioGroup/RadioGroup.js +107 -111
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +1 -1
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +26 -86
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +1 -1
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +19 -19
- package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +1 -1
- package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +1 -1
- package/dist/components/inputs/Selection/Select/QuerySelect.js +49 -115
- package/dist/components/inputs/Selection/Select/Select.d.ts +1 -1
- package/dist/components/inputs/Selection/Select/Select.js +22 -22
- package/dist/components/inputs/Selection/shared/SelectBase.d.ts +0 -1
- package/dist/components/inputs/Selection/shared/SelectBase.js +34 -37
- package/dist/components/inputs/Selection/shared/SelectInput.js +1 -0
- package/dist/components/inputs/Selection/shared/SelectListBox.js +51 -163
- package/dist/components/inputs/Selection/shared/select.context.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/select.context.js +4 -8
- package/dist/components/inputs/Selection/shared/select.types.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/useSelectItems.js +48 -108
- package/dist/components/inputs/Skeleton/InputFrame.js +177 -552
- package/dist/components/inputs/Slider/Slider.d.ts +1 -1
- package/dist/components/inputs/Slider/Slider.js +18 -18
- package/dist/components/inputs/TextEditor/TextEditor.d.ts +1 -1
- package/dist/components/inputs/TextEditor/TextEditor.js +105 -407
- package/dist/components/inputs/Toggle/Toggle.d.ts +1 -2
- package/dist/components/inputs/Toggle/Toggle.js +59 -63
- package/dist/components/inputs/shared/InputClear.js +24 -40
- package/dist/components/inputs/shared/form.binding.d.ts +27 -0
- package/dist/components/inputs/shared/form.binding.js +57 -0
- package/dist/components/inputs/shared/form.types.d.ts +9 -8
- package/dist/components/inputs/shared/form.types.js +8 -0
- package/dist/components/navigation/Accordion/Accordion.js +22 -69
- package/dist/components/navigation/Accordion/AccordionItem.js +41 -86
- package/dist/components/navigation/Stepper/Stepper.js +22 -67
- package/dist/components/overlays/ActionModal/ActionModal.js +35 -169
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +29 -110
- package/dist/components/segment/Segment.d.ts +1 -1
- package/dist/components/segment/Segment.js +17 -17
- package/dist/components/segment/segment.types.d.ts +1 -1
- package/dist/components/shared/pagination/Pagination.js +22 -108
- package/dist/components/status/Alert/Alert.js +30 -97
- package/dist/components/table/InfiniteTable.js +16 -67
- package/dist/components/table/Table.d.ts +2 -8
- package/dist/components/table/Table.js +33 -55
- package/dist/components/text/Typography/Typography.js +8 -23
- package/dist/config/confirmation.context.js +1 -1
- package/dist/config/theme.context.js +45 -98
- package/dist/config/uiConfig.context.d.ts +5 -5
- package/dist/config/uiConfig.context.js +11 -51
- package/dist/config/uiOverrides.context.d.ts +0 -1
- package/dist/helpers/dynamicColumns.d.ts +1 -1
- package/dist/helpers/dynamicInputs.d.ts +7 -7
- package/dist/hooks/useAutosave.d.ts +4 -4
- package/dist/hooks/useAutosave.js +64 -49
- package/dist/hooks/useDebounceCallback.js +17 -51
- package/dist/hooks/useForm.d.ts +39 -15
- package/dist/hooks/useForm.js +96 -43
- package/dist/hooks/useFormAutosave.d.ts +8 -9
- package/dist/hooks/useFormAutosave.js +49 -122
- package/dist/hooks/useLongPressRepeat.js +20 -55
- package/dist/index.d.ts +2 -3
- package/dist/index.js +3 -4
- package/package.json +3 -4
- package/dist/components/inputs/FormField/formField.cva.d.ts +0 -11
- package/dist/components/inputs/FormField/formField.cva.js +0 -16
- package/dist/components/table/TableColumnFilterInput.d.ts +0 -9
- package/dist/components/table/TableColumnFilterInput.js +0 -108
- package/dist/components/table/TableColumnFilterPlaceholder.d.ts +0 -5
- package/dist/components/table/TableColumnFilterPlaceholder.js +0 -41
- package/dist/components/table/TableColumnFilterRow.d.ts +0 -16
- package/dist/components/table/TableColumnFilterRow.js +0 -68
- package/dist/hooks/useAutosave.spec.d.ts +0 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { UIOverrides } from "../../config/uiOverrides.context.js";
|
|
2
|
+
import { FieldController } from "../inputs/shared/form.binding.js";
|
|
2
3
|
import { FormField } from "../inputs/FormField/FormField.js";
|
|
3
4
|
import { segmentDefinition } from "./segment.cva.js";
|
|
4
5
|
import { SegmentItem } from "./SegmentItem.js";
|
|
@@ -9,7 +10,6 @@ import { Fragment as Fragment$1, useRef } from "react";
|
|
|
9
10
|
import { ToggleButtonGroup } from "react-aria-components";
|
|
10
11
|
import { useToggleButtonGroup } from "react-aria";
|
|
11
12
|
import { mergeRefs } from "@react-aria/utils";
|
|
12
|
-
import { Controller } from "react-hook-form";
|
|
13
13
|
import { useToggleGroupState } from "react-stately";
|
|
14
14
|
//#region src/components/segment/Segment.tsx
|
|
15
15
|
var SegmentBase = (t0) => {
|
|
@@ -181,32 +181,32 @@ var SegmentBase = (t0) => {
|
|
|
181
181
|
};
|
|
182
182
|
var Segment = (props) => {
|
|
183
183
|
const $ = c(15);
|
|
184
|
-
if ("
|
|
185
|
-
let
|
|
184
|
+
if ("field" in props && props.field) {
|
|
185
|
+
let field;
|
|
186
186
|
let innerProps;
|
|
187
187
|
let ref;
|
|
188
188
|
if ($[0] !== props) {
|
|
189
|
-
({
|
|
189
|
+
({field, ref, ...innerProps} = props);
|
|
190
190
|
$[0] = props;
|
|
191
|
-
$[1] =
|
|
191
|
+
$[1] = field;
|
|
192
192
|
$[2] = innerProps;
|
|
193
193
|
$[3] = ref;
|
|
194
194
|
} else {
|
|
195
|
-
|
|
195
|
+
field = $[1];
|
|
196
196
|
innerProps = $[2];
|
|
197
197
|
ref = $[3];
|
|
198
198
|
}
|
|
199
199
|
let t0;
|
|
200
200
|
if ($[4] !== innerProps || $[5] !== props.error || $[6] !== props.isDisabled || $[7] !== ref) {
|
|
201
201
|
t0 = (t1) => {
|
|
202
|
-
const { field, fieldState: t2 } = t1;
|
|
202
|
+
const { field: field_0, fieldState: t2 } = t1;
|
|
203
203
|
const { error } = t2;
|
|
204
204
|
return /* @__PURE__ */ jsx(SegmentBase, {
|
|
205
205
|
...innerProps,
|
|
206
|
-
ref: mergeRefs(ref,
|
|
207
|
-
value:
|
|
208
|
-
onChange:
|
|
209
|
-
isDisabled:
|
|
206
|
+
ref: mergeRefs(ref, field_0.ref),
|
|
207
|
+
value: field_0.value,
|
|
208
|
+
onChange: field_0.onChange,
|
|
209
|
+
isDisabled: field_0.disabled || props.isDisabled,
|
|
210
210
|
error: props.error ?? error?.message
|
|
211
211
|
});
|
|
212
212
|
};
|
|
@@ -217,14 +217,14 @@ var Segment = (props) => {
|
|
|
217
217
|
$[8] = t0;
|
|
218
218
|
} else t0 = $[8];
|
|
219
219
|
let t1;
|
|
220
|
-
if ($[9] !==
|
|
221
|
-
t1 = /* @__PURE__ */ jsx(
|
|
222
|
-
control:
|
|
223
|
-
name:
|
|
220
|
+
if ($[9] !== field.form || $[10] !== field.name || $[11] !== t0) {
|
|
221
|
+
t1 = /* @__PURE__ */ jsx(FieldController, {
|
|
222
|
+
control: field.form,
|
|
223
|
+
name: field.name,
|
|
224
224
|
render: t0
|
|
225
225
|
});
|
|
226
|
-
$[9] =
|
|
227
|
-
$[10] =
|
|
226
|
+
$[9] = field.form;
|
|
227
|
+
$[10] = field.name;
|
|
228
228
|
$[11] = t0;
|
|
229
229
|
$[12] = t1;
|
|
230
230
|
} else t1 = $[12];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FC, ReactElement, Ref, SVGProps } from 'react';
|
|
2
2
|
import { Key, ToggleButtonGroupProps, ToggleButtonProps } from 'react-aria-components';
|
|
3
|
-
import { FieldValues } from '
|
|
3
|
+
import { FieldValues } from '../inputs/shared/form.binding';
|
|
4
4
|
import { ControlProps } from '../inputs/shared/form.types';
|
|
5
5
|
import { SegmentItemVariantProps, SegmentVariantProps } from './segment.cva';
|
|
6
6
|
export interface SegmentItem<TKey extends Key = Key> extends ToggleButtonProps, SegmentItemVariantProps {
|
|
@@ -2,31 +2,16 @@ import { Typography } from "../../text/Typography/Typography.js";
|
|
|
2
2
|
import "../../../config/i18n.js";
|
|
3
3
|
import { NumberInput } from "../../inputs/Input/NumberInput/NumberInput.js";
|
|
4
4
|
import { PaginationList } from "./PaginationList.js";
|
|
5
|
-
import { c } from "react/compiler-runtime";
|
|
6
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
6
|
import { clsx } from "clsx";
|
|
8
7
|
import { useTranslation } from "react-i18next";
|
|
9
8
|
//#region src/components/shared/pagination/Pagination.tsx
|
|
10
|
-
var Pagination = (
|
|
11
|
-
const $ = c(34);
|
|
12
|
-
const { size: t1, variant: t2, color: t3, page, totalItems, totalPages, pageSize, hideText: t4, hideFirstLast: t5, hidePrevNext: t6, hideNumbers: t7, className, onPageChange, onPageSizeChange } = t0;
|
|
13
|
-
const size = t1 === void 0 ? "s" : t1;
|
|
14
|
-
const variant = t2 === void 0 ? "subtle" : t2;
|
|
15
|
-
const color = t3 === void 0 ? "secondary" : t3;
|
|
16
|
-
const hideText = t4 === void 0 ? true : t4;
|
|
17
|
-
const hideFirstLast = t5 === void 0 ? true : t5;
|
|
18
|
-
const hidePrevNext = t6 === void 0 ? false : t6;
|
|
19
|
-
const hideNumbers = t7 === void 0 ? false : t7;
|
|
9
|
+
var Pagination = ({ size = "s", variant = "subtle", color = "secondary", page, totalItems, totalPages, pageSize, hideText = true, hideFirstLast = true, hidePrevNext = false, hideNumbers = false, className, onPageChange, onPageSizeChange }) => {
|
|
20
10
|
const { t } = useTranslation("ui");
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
$[1] = t8;
|
|
26
|
-
} else t8 = $[1];
|
|
27
|
-
let t9;
|
|
28
|
-
if ($[2] !== color || $[3] !== hideFirstLast || $[4] !== hideNumbers || $[5] !== hidePrevNext || $[6] !== hideText || $[7] !== onPageChange || $[8] !== page || $[9] !== pageSize || $[10] !== size || $[11] !== totalItems || $[12] !== totalPages || $[13] !== variant) {
|
|
29
|
-
t9 = totalItems > pageSize && /* @__PURE__ */ jsx(PaginationList, {
|
|
11
|
+
return /* @__PURE__ */ jsxs("nav", {
|
|
12
|
+
id: "pagination",
|
|
13
|
+
className: clsx("flex items-center gap-2", className),
|
|
14
|
+
children: [totalItems > pageSize && /* @__PURE__ */ jsx(PaginationList, {
|
|
30
15
|
page,
|
|
31
16
|
size,
|
|
32
17
|
color,
|
|
@@ -37,95 +22,24 @@ var Pagination = (t0) => {
|
|
|
37
22
|
hideNumbers,
|
|
38
23
|
totalPages: totalPages ?? Math.ceil(totalItems / pageSize),
|
|
39
24
|
onPageChange
|
|
40
|
-
})
|
|
41
|
-
$[2] = color;
|
|
42
|
-
$[3] = hideFirstLast;
|
|
43
|
-
$[4] = hideNumbers;
|
|
44
|
-
$[5] = hidePrevNext;
|
|
45
|
-
$[6] = hideText;
|
|
46
|
-
$[7] = onPageChange;
|
|
47
|
-
$[8] = page;
|
|
48
|
-
$[9] = pageSize;
|
|
49
|
-
$[10] = size;
|
|
50
|
-
$[11] = totalItems;
|
|
51
|
-
$[12] = totalPages;
|
|
52
|
-
$[13] = variant;
|
|
53
|
-
$[14] = t9;
|
|
54
|
-
} else t9 = $[14];
|
|
55
|
-
let t10;
|
|
56
|
-
if ($[15] !== t) {
|
|
57
|
-
t10 = t(_temp);
|
|
58
|
-
$[15] = t;
|
|
59
|
-
$[16] = t10;
|
|
60
|
-
} else t10 = $[16];
|
|
61
|
-
let t11;
|
|
62
|
-
if ($[17] !== t10) {
|
|
63
|
-
t11 = /* @__PURE__ */ jsx(Typography, {
|
|
64
|
-
variant: "default",
|
|
65
|
-
size: "label-2",
|
|
66
|
-
as: "span",
|
|
67
|
-
className: "whitespace-nowrap text-text-default-1",
|
|
68
|
-
children: t10
|
|
69
|
-
});
|
|
70
|
-
$[17] = t10;
|
|
71
|
-
$[18] = t11;
|
|
72
|
-
} else t11 = $[18];
|
|
73
|
-
let t12;
|
|
74
|
-
if ($[19] !== onPageSizeChange) {
|
|
75
|
-
t12 = (value) => onPageSizeChange?.(Number(value));
|
|
76
|
-
$[19] = onPageSizeChange;
|
|
77
|
-
$[20] = t12;
|
|
78
|
-
} else t12 = $[20];
|
|
79
|
-
let t13;
|
|
80
|
-
if ($[21] !== t) {
|
|
81
|
-
t13 = t(_temp2);
|
|
82
|
-
$[21] = t;
|
|
83
|
-
$[22] = t13;
|
|
84
|
-
} else t13 = $[22];
|
|
85
|
-
let t14;
|
|
86
|
-
if ($[23] !== pageSize || $[24] !== t12 || $[25] !== t13) {
|
|
87
|
-
t14 = /* @__PURE__ */ jsx(NumberInput, {
|
|
88
|
-
value: pageSize,
|
|
89
|
-
onChange: t12,
|
|
90
|
-
label: t13,
|
|
91
|
-
hideLabel: true,
|
|
92
|
-
className: "w-min",
|
|
93
|
-
inputClassName: "min-w-12 !px-3 !py-0-5"
|
|
94
|
-
});
|
|
95
|
-
$[23] = pageSize;
|
|
96
|
-
$[24] = t12;
|
|
97
|
-
$[25] = t13;
|
|
98
|
-
$[26] = t14;
|
|
99
|
-
} else t14 = $[26];
|
|
100
|
-
let t15;
|
|
101
|
-
if ($[27] !== t11 || $[28] !== t14) {
|
|
102
|
-
t15 = /* @__PURE__ */ jsxs("div", {
|
|
25
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
103
26
|
className: "flex items-center gap-2",
|
|
104
|
-
children: [
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
$[33] = t16;
|
|
121
|
-
} else t16 = $[33];
|
|
122
|
-
return t16;
|
|
27
|
+
children: [/* @__PURE__ */ jsx(Typography, {
|
|
28
|
+
variant: "default",
|
|
29
|
+
size: "label-2",
|
|
30
|
+
as: "span",
|
|
31
|
+
className: "whitespace-nowrap text-text-default-1",
|
|
32
|
+
children: t(($) => $.ui.pagination.resultsPerPage)
|
|
33
|
+
}), /* @__PURE__ */ jsx(NumberInput, {
|
|
34
|
+
value: pageSize,
|
|
35
|
+
onChange: (value) => onPageSizeChange?.(Number(value)),
|
|
36
|
+
label: t(($_0) => $_0.ui.pagination.resultsPerPage),
|
|
37
|
+
hideLabel: true,
|
|
38
|
+
className: "w-min",
|
|
39
|
+
inputClassName: "min-w-12 !px-3 !py-0-5"
|
|
40
|
+
})]
|
|
41
|
+
})]
|
|
42
|
+
});
|
|
123
43
|
};
|
|
124
|
-
function _temp($) {
|
|
125
|
-
return $.ui.pagination.resultsPerPage;
|
|
126
|
-
}
|
|
127
|
-
function _temp2($_0) {
|
|
128
|
-
return $_0.ui.pagination.resultsPerPage;
|
|
129
|
-
}
|
|
130
44
|
//#endregion
|
|
131
45
|
export { Pagination };
|
|
@@ -3,112 +3,45 @@ import { Typography } from "../../text/Typography/Typography.js";
|
|
|
3
3
|
import { Loader } from "../Loader/Loader.js";
|
|
4
4
|
import { alertDefinition } from "./alert.cva.js";
|
|
5
5
|
import { statusIconDefinition, statusSeparatorDefinition } from "../shared/status.cva.js";
|
|
6
|
-
import { c } from "react/compiler-runtime";
|
|
7
6
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
7
|
//#region src/components/status/Alert/Alert.tsx
|
|
9
|
-
var Alert = (
|
|
10
|
-
const $ = c(31);
|
|
11
|
-
const { variant, color, text, isLoading: t1, rightContent, hasSeparator, icon: Icon, className } = t0;
|
|
12
|
-
const isLoading = t1 === void 0 ? false : t1;
|
|
8
|
+
var Alert = ({ variant, color, text, isLoading = false, rightContent, hasSeparator, icon: Icon, className }) => {
|
|
13
9
|
const alertCva = UIOverrides.useCva("alert.cva", alertDefinition);
|
|
14
10
|
const iconCva = UIOverrides.useCva("status.iconCva", statusIconDefinition);
|
|
15
11
|
const separatorCva = UIOverrides.useCva("status.separatorCva", statusSeparatorDefinition);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
t2 = alertCva({
|
|
12
|
+
return /* @__PURE__ */ jsx("div", {
|
|
13
|
+
className: alertCva({
|
|
19
14
|
variant,
|
|
20
15
|
color,
|
|
21
16
|
className
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
$[1] = className;
|
|
25
|
-
$[2] = color;
|
|
26
|
-
$[3] = variant;
|
|
27
|
-
$[4] = t2;
|
|
28
|
-
} else t2 = $[4];
|
|
29
|
-
let t3;
|
|
30
|
-
if ($[5] !== isLoading) {
|
|
31
|
-
t3 = isLoading && /* @__PURE__ */ jsx(Loader, {
|
|
32
|
-
size: "default",
|
|
33
|
-
className: "shrink-0"
|
|
34
|
-
});
|
|
35
|
-
$[5] = isLoading;
|
|
36
|
-
$[6] = t3;
|
|
37
|
-
} else t3 = $[6];
|
|
38
|
-
let t4;
|
|
39
|
-
if ($[7] !== Icon || $[8] !== color || $[9] !== iconCva || $[10] !== isLoading || $[11] !== variant) {
|
|
40
|
-
t4 = !isLoading && Icon && /* @__PURE__ */ jsx(Icon, { className: iconCva({
|
|
41
|
-
variant,
|
|
42
|
-
color
|
|
43
|
-
}) });
|
|
44
|
-
$[7] = Icon;
|
|
45
|
-
$[8] = color;
|
|
46
|
-
$[9] = iconCva;
|
|
47
|
-
$[10] = isLoading;
|
|
48
|
-
$[11] = variant;
|
|
49
|
-
$[12] = t4;
|
|
50
|
-
} else t4 = $[12];
|
|
51
|
-
let t5;
|
|
52
|
-
if ($[13] !== text) {
|
|
53
|
-
t5 = /* @__PURE__ */ jsx(Typography, {
|
|
54
|
-
size: "label-2",
|
|
55
|
-
children: text
|
|
56
|
-
});
|
|
57
|
-
$[13] = text;
|
|
58
|
-
$[14] = t5;
|
|
59
|
-
} else t5 = $[14];
|
|
60
|
-
let t6;
|
|
61
|
-
if ($[15] !== t3 || $[16] !== t4 || $[17] !== t5) {
|
|
62
|
-
t6 = /* @__PURE__ */ jsxs("div", {
|
|
63
|
-
className: "flex w-full items-start gap-alert-gap-icon-to-text px-alert-side-default py-alert-height-content",
|
|
64
|
-
children: [
|
|
65
|
-
t3,
|
|
66
|
-
t4,
|
|
67
|
-
t5
|
|
68
|
-
]
|
|
69
|
-
});
|
|
70
|
-
$[15] = t3;
|
|
71
|
-
$[16] = t4;
|
|
72
|
-
$[17] = t5;
|
|
73
|
-
$[18] = t6;
|
|
74
|
-
} else t6 = $[18];
|
|
75
|
-
let t7;
|
|
76
|
-
if ($[19] !== color || $[20] !== hasSeparator || $[21] !== rightContent || $[22] !== separatorCva || $[23] !== variant) {
|
|
77
|
-
t7 = !!rightContent && /* @__PURE__ */ jsxs(Fragment, { children: [hasSeparator && /* @__PURE__ */ jsx("div", { className: separatorCva({
|
|
78
|
-
variant,
|
|
79
|
-
color
|
|
80
|
-
}) }), /* @__PURE__ */ jsx("div", {
|
|
81
|
-
className: "flex w-full shrink-0 flex-wrap items-center justify-end gap-alert-gap-action px-alert-side-default py-alert-height-actions-mobile md:w-auto md:justify-center md:py-alert-height-actions-desktop",
|
|
82
|
-
children: rightContent
|
|
83
|
-
})] });
|
|
84
|
-
$[19] = color;
|
|
85
|
-
$[20] = hasSeparator;
|
|
86
|
-
$[21] = rightContent;
|
|
87
|
-
$[22] = separatorCva;
|
|
88
|
-
$[23] = variant;
|
|
89
|
-
$[24] = t7;
|
|
90
|
-
} else t7 = $[24];
|
|
91
|
-
let t8;
|
|
92
|
-
if ($[25] !== t6 || $[26] !== t7) {
|
|
93
|
-
t8 = /* @__PURE__ */ jsxs("div", {
|
|
17
|
+
}),
|
|
18
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
94
19
|
className: "flex w-auto flex-col items-center md:flex-row",
|
|
95
|
-
children: [
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
20
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
21
|
+
className: "flex w-full items-start gap-alert-gap-icon-to-text px-alert-side-default py-alert-height-content",
|
|
22
|
+
children: [
|
|
23
|
+
isLoading && /* @__PURE__ */ jsx(Loader, {
|
|
24
|
+
size: "default",
|
|
25
|
+
className: "shrink-0"
|
|
26
|
+
}),
|
|
27
|
+
!isLoading && Icon && /* @__PURE__ */ jsx(Icon, { className: iconCva({
|
|
28
|
+
variant,
|
|
29
|
+
color
|
|
30
|
+
}) }),
|
|
31
|
+
/* @__PURE__ */ jsx(Typography, {
|
|
32
|
+
size: "label-2",
|
|
33
|
+
children: text
|
|
34
|
+
})
|
|
35
|
+
]
|
|
36
|
+
}), !!rightContent && /* @__PURE__ */ jsxs(Fragment, { children: [hasSeparator && /* @__PURE__ */ jsx("div", { className: separatorCva({
|
|
37
|
+
variant,
|
|
38
|
+
color
|
|
39
|
+
}) }), /* @__PURE__ */ jsx("div", {
|
|
40
|
+
className: "flex w-full shrink-0 flex-wrap items-center justify-end gap-alert-gap-action px-alert-side-default py-alert-height-actions-mobile md:w-auto md:justify-center md:py-alert-height-actions-desktop",
|
|
41
|
+
children: rightContent
|
|
42
|
+
})] })]
|
|
43
|
+
})
|
|
44
|
+
});
|
|
112
45
|
};
|
|
113
46
|
//#endregion
|
|
114
47
|
export { Alert };
|
|
@@ -1,79 +1,28 @@
|
|
|
1
1
|
import { Loader } from "../status/Loader/Loader.js";
|
|
2
2
|
import { useIntersectionObserver } from "../../hooks/useIntersectionObserver.js";
|
|
3
3
|
import { Table } from "./Table.js";
|
|
4
|
-
import { c } from "react/compiler-runtime";
|
|
5
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { useCallback } from "react";
|
|
6
6
|
//#region src/components/table/InfiniteTable.tsx
|
|
7
|
-
var InfiniteTable = (
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
let hasNextPage;
|
|
11
|
-
let rest;
|
|
12
|
-
let t1;
|
|
13
|
-
if ($[0] !== t0) {
|
|
14
|
-
({hasNextPage, isFetchingNextPage: t1, fetchNextPage, ...rest} = t0);
|
|
15
|
-
$[0] = t0;
|
|
16
|
-
$[1] = fetchNextPage;
|
|
17
|
-
$[2] = hasNextPage;
|
|
18
|
-
$[3] = rest;
|
|
19
|
-
$[4] = t1;
|
|
20
|
-
} else {
|
|
21
|
-
fetchNextPage = $[1];
|
|
22
|
-
hasNextPage = $[2];
|
|
23
|
-
rest = $[3];
|
|
24
|
-
t1 = $[4];
|
|
25
|
-
}
|
|
26
|
-
const isFetchingNextPage = t1 === void 0 ? false : t1;
|
|
27
|
-
let t2;
|
|
28
|
-
if ($[5] !== fetchNextPage || $[6] !== hasNextPage || $[7] !== isFetchingNextPage) {
|
|
29
|
-
t2 = () => {
|
|
7
|
+
var InfiniteTable = ({ hasNextPage, isFetchingNextPage = false, fetchNextPage, ...rest }) => {
|
|
8
|
+
const { ref } = useIntersectionObserver({
|
|
9
|
+
onIntersection: useCallback(() => {
|
|
30
10
|
if (!isFetchingNextPage && hasNextPage) fetchNextPage();
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
onIntersection: handleLoadMore,
|
|
42
|
-
rootMargin: "100px"
|
|
43
|
-
};
|
|
44
|
-
$[9] = handleLoadMore;
|
|
45
|
-
$[10] = t3;
|
|
46
|
-
} else t3 = $[10];
|
|
47
|
-
const { ref } = useIntersectionObserver(t3);
|
|
48
|
-
let t4;
|
|
49
|
-
if ($[11] !== rest) {
|
|
50
|
-
t4 = /* @__PURE__ */ jsx(Table, { ...rest });
|
|
51
|
-
$[11] = rest;
|
|
52
|
-
$[12] = t4;
|
|
53
|
-
} else t4 = $[12];
|
|
54
|
-
let t5;
|
|
55
|
-
if ($[13] !== hasNextPage || $[14] !== isFetchingNextPage || $[15] !== ref) {
|
|
56
|
-
t5 = (hasNextPage || isFetchingNextPage) && /* @__PURE__ */ jsx("div", {
|
|
11
|
+
}, [
|
|
12
|
+
isFetchingNextPage,
|
|
13
|
+
hasNextPage,
|
|
14
|
+
fetchNextPage
|
|
15
|
+
]),
|
|
16
|
+
rootMargin: "100px"
|
|
17
|
+
});
|
|
18
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
19
|
+
className: "flex flex-col",
|
|
20
|
+
children: [/* @__PURE__ */ jsx(Table, { ...rest }), (hasNextPage || isFetchingNextPage) && /* @__PURE__ */ jsx("div", {
|
|
57
21
|
ref,
|
|
58
22
|
className: "flex justify-center py-4",
|
|
59
23
|
children: /* @__PURE__ */ jsx(Loader, {})
|
|
60
|
-
})
|
|
61
|
-
|
|
62
|
-
$[14] = isFetchingNextPage;
|
|
63
|
-
$[15] = ref;
|
|
64
|
-
$[16] = t5;
|
|
65
|
-
} else t5 = $[16];
|
|
66
|
-
let t6;
|
|
67
|
-
if ($[17] !== t4 || $[18] !== t5) {
|
|
68
|
-
t6 = /* @__PURE__ */ jsxs("div", {
|
|
69
|
-
className: "flex flex-col",
|
|
70
|
-
children: [t4, t5]
|
|
71
|
-
});
|
|
72
|
-
$[17] = t4;
|
|
73
|
-
$[18] = t5;
|
|
74
|
-
$[19] = t6;
|
|
75
|
-
} else t6 = $[19];
|
|
76
|
-
return t6;
|
|
24
|
+
})]
|
|
25
|
+
});
|
|
77
26
|
};
|
|
78
27
|
//#endregion
|
|
79
28
|
export { InfiniteTable };
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { DragEndEvent, UniqueIdentifier } from '@dnd-kit/core';
|
|
2
2
|
import { ColumnDef, ColumnOrderState, OnChangeFn, Table as ReactTable, Row, RowSelectionState, SortingState, VisibilityState } from '@tanstack/react-table';
|
|
3
3
|
import { TFunction } from 'i18next';
|
|
4
|
-
import { ComponentType, Dispatch,
|
|
5
|
-
import { UseFormReturn } from 'react-hook-form';
|
|
6
|
-
import { InputDef } from '../inputs/Inputs/InputItem';
|
|
4
|
+
import { ComponentType, Dispatch, SetStateAction } from 'react';
|
|
7
5
|
import { TableRowVariantProps } from './table.cva';
|
|
8
6
|
export type BulkSelectionActionsComponent<T> = ComponentType<{
|
|
9
7
|
table: ReactTable<T>;
|
|
@@ -32,12 +30,8 @@ export interface TableProps<T> extends TableRowVariantProps {
|
|
|
32
30
|
enableMultiRowSelection?: boolean | ((row: Row<T>) => boolean);
|
|
33
31
|
defaultSelectedRows?: RowSelectionState;
|
|
34
32
|
onRowSelectionChange?: OnChangeFn<RowSelectionState>;
|
|
35
|
-
filterForm?: UseFormReturn<Record<string, any>>;
|
|
36
|
-
filterDefs?: InputDef<any>[];
|
|
37
|
-
headerFilterCellClassName?: string;
|
|
38
|
-
emptyContent?: ReactNode;
|
|
39
33
|
}
|
|
40
34
|
export declare const RowDragHandleCell: ({ rowId }: {
|
|
41
35
|
rowId: string;
|
|
42
36
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
43
|
-
export declare const Table: <T>({ items, showCellBorder, columns, onRowClick, onDoubleClick, className, sorting, setSorting, columnOrder, setColumnOrder, columnVisibility, setColumnVisibility, bulkSelectionActions: ActionHeader, enableDragDrop, onDragEnd, onReorder, getRowId, enableRowSelection, enableMultiRowSelection, defaultSelectedRows, onRowSelectionChange,
|
|
37
|
+
export declare const Table: <T>({ items, showCellBorder, columns, onRowClick, onDoubleClick, className, sorting, setSorting, columnOrder, setColumnOrder, columnVisibility, setColumnVisibility, bulkSelectionActions: ActionHeader, enableDragDrop, onDragEnd, onReorder, getRowId, enableRowSelection, enableMultiRowSelection, defaultSelectedRows, onRowSelectionChange, ...props }: TableProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -8,7 +8,6 @@ import { tableDataDefinition, tableHeadDataDefinition, tableHeadRowDefinition, t
|
|
|
8
8
|
import { CellText } from "./CellText.js";
|
|
9
9
|
import { DragIndicatorIcon } from "../../assets/icons/DragIndicator.js";
|
|
10
10
|
import { HeaderText } from "./HeaderText.js";
|
|
11
|
-
import { TableColumnFilterRow } from "./TableColumnFilterRow.js";
|
|
12
11
|
import { useTableNav } from "../../hooks/useTableNav.js";
|
|
13
12
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
13
|
import { clsx } from "clsx";
|
|
@@ -75,7 +74,7 @@ var DraggableRow = ({ row, showCellBorder, onRowClick, onDoubleClick, tableRowCv
|
|
|
75
74
|
})
|
|
76
75
|
});
|
|
77
76
|
};
|
|
78
|
-
var Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, className, sorting, setSorting, columnOrder, setColumnOrder, columnVisibility, setColumnVisibility, bulkSelectionActions: ActionHeader, enableDragDrop = false, onDragEnd, onReorder, getRowId, enableRowSelection, enableMultiRowSelection = false, defaultSelectedRows, onRowSelectionChange,
|
|
77
|
+
var Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, className, sorting, setSorting, columnOrder, setColumnOrder, columnVisibility, setColumnVisibility, bulkSelectionActions: ActionHeader, enableDragDrop = false, onDragEnd, onReorder, getRowId, enableRowSelection, enableMultiRowSelection = false, defaultSelectedRows, onRowSelectionChange, ...props }) => {
|
|
79
78
|
const tableRowCva = UIOverrides.useCva("table.rowCva", tableRowDefinition);
|
|
80
79
|
const theadCva = UIOverrides.useCva("table.theadCva", theadDefinition);
|
|
81
80
|
const tableHeadRowCva = UIOverrides.useCva("table.headRowCva", tableHeadRowDefinition);
|
|
@@ -173,71 +172,50 @@ var Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, classN
|
|
|
173
172
|
const selectedRows = table.getSelectedRowModel().rows;
|
|
174
173
|
const columnCount = table.getHeaderGroups()[0].headers.length;
|
|
175
174
|
const isAnyRowSelected = selectedRows.length > 0 && !!ActionHeader;
|
|
176
|
-
const showFilterRow = !!filterForm && !!filterDefs?.length && !isAnyRowSelected;
|
|
177
175
|
const hasOnClick = !!onRowClick || !!onDoubleClick;
|
|
178
176
|
const tableElement = /* @__PURE__ */ jsxs("table", {
|
|
179
|
-
className: clsx("w-full",
|
|
177
|
+
className: clsx("w-full", className),
|
|
180
178
|
...listeners,
|
|
181
179
|
children: [/* @__PURE__ */ jsxs("thead", {
|
|
182
180
|
className: clsx(theadCva({})),
|
|
183
181
|
"data-is-sticky": isSticky || void 0,
|
|
184
|
-
children: [
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
}
|
|
194
|
-
return /* @__PURE__ */ jsx("
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
}),
|
|
212
|
-
desc: /* @__PURE__ */ jsx(ChevronDownIcon, {
|
|
213
|
-
width: 18,
|
|
214
|
-
height: 18
|
|
215
|
-
})
|
|
216
|
-
}[header_0.column.getIsSorted()] ?? null]
|
|
182
|
+
children: [/* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("th", {
|
|
183
|
+
ref: stickyRef,
|
|
184
|
+
className: "-mt-px block"
|
|
185
|
+
}) }), table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx("tr", {
|
|
186
|
+
className: clsx(tableHeadRowCva({})),
|
|
187
|
+
children: headerGroup.headers.filter((header) => {
|
|
188
|
+
if (isAnyRowSelected && header.index > 0) return false;
|
|
189
|
+
return header.column.getIsVisible();
|
|
190
|
+
}).map((header_0, index) => {
|
|
191
|
+
const columnMeta = header_0.column.columnDef.meta ?? {};
|
|
192
|
+
return /* @__PURE__ */ jsx("th", {
|
|
193
|
+
colSpan: isAnyRowSelected ? columnCount : header_0.colSpan,
|
|
194
|
+
tabIndex: -1,
|
|
195
|
+
className: clsx(tableHeadDataCva({ hasRightBorder: index > 0 && showCellBorder }), columnMeta.headerClass, columnMeta.width),
|
|
196
|
+
children: isAnyRowSelected ? /* @__PURE__ */ jsx(ActionHeader, { table }) : /* @__PURE__ */ jsxs("button", {
|
|
197
|
+
type: "button",
|
|
198
|
+
"aria-label": "Sort column",
|
|
199
|
+
className: clsx("flex select-none items-center gap-1 text-text-default-1", header_0.column.getCanSort() ? "h-6 cursor-pointer rounded-xs px-1 hover:bg-elevation-fill-default-2" : "cursor-default", columnMeta.sortClass),
|
|
200
|
+
onClick: header_0.column.getToggleSortingHandler(),
|
|
201
|
+
children: [typeof header_0.column.columnDef.header === "function" ? flexRender(header_0.column.columnDef.header, header_0.getContext()) : /* @__PURE__ */ jsx(HeaderText, { children: header_0.column.columnDef.header }), {
|
|
202
|
+
asc: /* @__PURE__ */ jsx(ChevronUpIcon, {
|
|
203
|
+
width: 18,
|
|
204
|
+
height: 18
|
|
205
|
+
}),
|
|
206
|
+
desc: /* @__PURE__ */ jsx(ChevronDownIcon, {
|
|
207
|
+
width: 18,
|
|
208
|
+
height: 18
|
|
217
209
|
})
|
|
218
|
-
}
|
|
210
|
+
}[header_0.column.getIsSorted()] ?? null]
|
|
219
211
|
})
|
|
220
|
-
},
|
|
221
|
-
}),
|
|
222
|
-
showFilterRow && table.getHeaderGroups().map((headerGroup_0) => {
|
|
223
|
-
return /* @__PURE__ */ jsx(TableColumnFilterRow, {
|
|
224
|
-
headers: headerGroup_0.headers.filter((header_1) => header_1.column.getIsVisible()),
|
|
225
|
-
filterForm,
|
|
226
|
-
filterDefs,
|
|
227
|
-
tableHeadDataCva,
|
|
228
|
-
rowClassName: clsx(tableHeadRowCva({})),
|
|
229
|
-
cellClassName: headerFilterCellClassName,
|
|
230
|
-
showCellBorder
|
|
231
|
-
}, `${headerGroup_0.id}-filters`);
|
|
212
|
+
}, header_0.id);
|
|
232
213
|
})
|
|
233
|
-
]
|
|
214
|
+
}, headerGroup.id))]
|
|
234
215
|
}), /* @__PURE__ */ jsx("tbody", {
|
|
235
216
|
ref,
|
|
236
217
|
className: "relative",
|
|
237
|
-
children:
|
|
238
|
-
colSpan: columnCount,
|
|
239
|
-
children: emptyContent
|
|
240
|
-
}) }) : enableDragDrop ? /* @__PURE__ */ jsx(SortableContext, {
|
|
218
|
+
children: enableDragDrop ? /* @__PURE__ */ jsx(SortableContext, {
|
|
241
219
|
items: dataIds,
|
|
242
220
|
strategy: verticalListSortingStrategy,
|
|
243
221
|
children: table.getRowModel().rows.map((row_0) => /* @__PURE__ */ jsx(DraggableRow, {
|
|
@@ -1,31 +1,16 @@
|
|
|
1
1
|
import { UIOverrides } from "../../../config/uiOverrides.context.js";
|
|
2
2
|
import { typographyDefinition } from "./typography.cva.js";
|
|
3
|
-
import { c } from "react/compiler-runtime";
|
|
4
3
|
import { jsx } from "react/jsx-runtime";
|
|
5
4
|
//#region src/components/text/Typography/Typography.tsx
|
|
6
|
-
var Typography = (
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
...props
|
|
14
|
-
sizeMobile: props.sizeMobile ?? props.size,
|
|
15
|
-
className
|
|
5
|
+
var Typography = ({ as = "p", className, ...props }) => {
|
|
6
|
+
return /* @__PURE__ */ jsx(as, {
|
|
7
|
+
className: UIOverrides.useCva("typography.cva", typographyDefinition)({
|
|
8
|
+
...props,
|
|
9
|
+
sizeMobile: props.sizeMobile ?? props.size,
|
|
10
|
+
className
|
|
11
|
+
}),
|
|
12
|
+
...props
|
|
16
13
|
});
|
|
17
|
-
let t3;
|
|
18
|
-
if ($[0] !== Tag || $[1] !== props || $[2] !== t2) {
|
|
19
|
-
t3 = /* @__PURE__ */ jsx(Tag, {
|
|
20
|
-
className: t2,
|
|
21
|
-
...props
|
|
22
|
-
});
|
|
23
|
-
$[0] = Tag;
|
|
24
|
-
$[1] = props;
|
|
25
|
-
$[2] = t2;
|
|
26
|
-
$[3] = t3;
|
|
27
|
-
} else t3 = $[3];
|
|
28
|
-
return t3;
|
|
29
14
|
};
|
|
30
15
|
//#endregion
|
|
31
16
|
export { Typography };
|