@ultraviolet/ui 3.23.0 → 3.24.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/dist/_virtual/{_@oxc-project_runtime@0.142.0 → _@oxc-project_runtime@0.146.0}/helpers/esm/asyncToGenerator.js +1 -1
- package/dist/_virtual/{_@oxc-project_runtime@0.142.0 → _@oxc-project_runtime@0.146.0}/helpers/esm/defineProperty.js +1 -1
- package/dist/_virtual/{_@oxc-project_runtime@0.142.0 → _@oxc-project_runtime@0.146.0}/helpers/esm/extends.js +1 -1
- package/dist/_virtual/{_@oxc-project_runtime@0.142.0 → _@oxc-project_runtime@0.146.0}/helpers/esm/objectDestructuringEmpty.js +1 -1
- package/dist/_virtual/{_@oxc-project_runtime@0.142.0 → _@oxc-project_runtime@0.146.0}/helpers/esm/objectSpread2.js +1 -1
- package/dist/_virtual/{_@oxc-project_runtime@0.142.0 → _@oxc-project_runtime@0.146.0}/helpers/esm/objectWithoutProperties.js +1 -1
- package/dist/_virtual/{_@oxc-project_runtime@0.142.0 → _@oxc-project_runtime@0.146.0}/helpers/esm/objectWithoutPropertiesLoose.js +1 -1
- package/dist/_virtual/{_@oxc-project_runtime@0.142.0 → _@oxc-project_runtime@0.146.0}/helpers/esm/toPrimitive.js +1 -1
- package/dist/_virtual/{_@oxc-project_runtime@0.142.0 → _@oxc-project_runtime@0.146.0}/helpers/esm/toPropertyKey.js +1 -1
- package/dist/_virtual/{_@oxc-project_runtime@0.142.0 → _@oxc-project_runtime@0.146.0}/helpers/esm/typeof.js +1 -1
- package/dist/components/ActionBar/index.js +1 -1
- package/dist/components/Alert/index.js +0 -1
- package/dist/components/Alert/styles.css.d.ts +0 -40
- package/dist/components/Alert/styles.css.d.ts.map +1 -1
- package/dist/components/Avatar/index.js +1 -1
- package/dist/components/Badge/index.d.ts +5 -2
- package/dist/components/Badge/index.d.ts.map +1 -1
- package/dist/components/Badge/styles.css.d.ts +0 -45
- package/dist/components/Badge/styles.css.d.ts.map +1 -1
- package/dist/components/Banner/index.d.ts +3 -2
- package/dist/components/Banner/index.d.ts.map +1 -1
- package/dist/components/Banner/styles.css.d.ts +0 -17
- package/dist/components/Banner/styles.css.d.ts.map +1 -1
- package/dist/components/BarChart/index.js +1 -1
- package/dist/components/Breadcrumbs/components/Item.js +1 -1
- package/dist/components/Button/index.d.ts +6 -2
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Button/styles.css.d.ts +0 -83
- package/dist/components/Button/styles.css.d.ts.map +1 -1
- package/dist/components/Carousel/Item.js +1 -1
- package/dist/components/Chip/index.js +4 -2
- package/dist/components/DateInput/components/CalendarContent.js +14 -10
- package/dist/components/DateInput/components/CalendarDaily.js +37 -35
- package/dist/components/DateInput/components/CalendarMonthly.js +46 -42
- package/dist/components/DateInput/index.js +8 -6
- package/dist/components/DateInput/styles.css.d.ts.map +1 -1
- package/dist/components/Dialog/index.js +1 -1
- package/dist/components/Expandable/AnimatedExpandable.js +1 -1
- package/dist/components/Expandable/NonAnimatedExpandable.js +1 -1
- package/dist/components/FileInput/components/Button.js +2 -2
- package/dist/components/FileInput/helpers.js +1 -1
- package/dist/components/FileInput/index.js +2 -2
- package/dist/components/InfiniteScroll/index.js +1 -1
- package/dist/components/KeyValueInput/index.js +1 -1
- package/dist/components/LineChart/index.js +1 -1
- package/dist/components/List/Cell.js +1 -1
- package/dist/components/List/ListContext.js +3 -3
- package/dist/components/Loader/index.js +1 -1
- package/dist/components/Menu/MenuContent.js +1 -1
- package/dist/components/Menu/index.js +2 -2
- package/dist/components/Modal/components/Dialog.js +1 -1
- package/dist/components/Notification/Notification.js +1 -1
- package/dist/components/NumberInput/components/Controls.d.ts.map +1 -1
- package/dist/components/NumberInput/components/Controls.js +1 -0
- package/dist/components/Pagination/PaginationButtons.d.ts +2 -1
- package/dist/components/Pagination/PaginationButtons.d.ts.map +1 -1
- package/dist/components/Pagination/PaginationButtons.js +19 -15
- package/dist/components/Pagination/getPageItems.d.ts +8 -0
- package/dist/components/Pagination/getPageItems.d.ts.map +1 -0
- package/dist/components/Pagination/getPageItems.js +35 -0
- package/dist/components/Pagination/getPageNumbers.d.ts +2 -1
- package/dist/components/Pagination/getPageNumbers.d.ts.map +1 -1
- package/dist/components/Pagination/getPageNumbers.js +3 -4
- package/dist/components/Pagination/index.d.ts.map +1 -1
- package/dist/components/Pagination/index.js +15 -3
- package/dist/components/Pagination/styles.css.d.ts +1 -0
- package/dist/components/Pagination/styles.css.d.ts.map +1 -1
- package/dist/components/Pagination/styles.css.js +6 -5
- package/dist/components/PieChart/index.js +1 -1
- package/dist/components/Popup/index.js +1 -1
- package/dist/components/Popup/styles.css.d.ts.map +1 -1
- package/dist/components/Popup/styles.css.js +1 -7
- package/dist/components/Row/index.js +1 -1
- package/dist/components/SearchInput/styles.css.d.ts.map +1 -1
- package/dist/components/SelectInput/components/Dropdown/Dropdown.js +1 -1
- package/dist/components/SelectInput/components/Dropdown/Group.js +9 -7
- package/dist/components/SelectInput/components/Dropdown/Item.d.ts.map +1 -1
- package/dist/components/SelectInput/components/Dropdown/Item.js +49 -43
- package/dist/components/SelectInput/components/Dropdown/Option.d.ts.map +1 -1
- package/dist/components/SelectInput/components/Dropdown/Option.js +71 -89
- package/dist/components/SelectInput/components/Dropdown/SearchBar.js +36 -31
- package/dist/components/SelectInput/components/Dropdown/dropdown.css.d.ts.map +1 -1
- package/dist/components/SelectInput/components/SelectBar/SelectBar.js +6 -4
- package/dist/components/SelectableCard/MultiStateInput.js +1 -1
- package/dist/components/SelectableCard/SelectableCard.js +1 -1
- package/dist/components/SelectableCardOptionGroup/components/Option.js +1 -1
- package/dist/components/Separator/index.d.ts +3 -2
- package/dist/components/Separator/index.d.ts.map +1 -1
- package/dist/components/Separator/styles.css.d.ts +0 -60
- package/dist/components/Separator/styles.css.d.ts.map +1 -1
- package/dist/components/Separator/styles.css.js +6 -4
- package/dist/components/Slider/components/DoubleSlider.d.ts.map +1 -1
- package/dist/components/Slider/components/DoubleSlider.js +103 -114
- package/dist/components/Slider/components/SingleSlider.js +2 -5
- package/dist/components/Slider/styles.css.d.ts +0 -37
- package/dist/components/Slider/styles.css.d.ts.map +1 -1
- package/dist/components/Slider/styles.css.js +27 -44
- package/dist/components/Stack/index.js +2 -2
- package/dist/components/Stepper/index.js +1 -1
- package/dist/components/SwitchButton/index.js +1 -0
- package/dist/components/Table/Cell.js +1 -1
- package/dist/components/Table/TableContext.js +2 -2
- package/dist/components/Tabs/Tab.js +2 -2
- package/dist/components/Tabs/TabMenu.js +2 -2
- package/dist/components/Tabs/TabMenuItem.js +2 -2
- package/dist/components/Tabs/index.js +2 -2
- package/dist/components/Tag/index.d.ts.map +1 -1
- package/dist/components/Tag/index.js +28 -23
- package/dist/components/Tag/styles.css.d.ts.map +1 -1
- package/dist/components/Tag/styles.css.js +43 -41
- package/dist/components/Tag/type.d.ts +1 -2
- package/dist/components/Tag/type.d.ts.map +1 -1
- package/dist/components/TagInput/index.js +2 -1
- package/dist/components/TagList/constant.d.ts +2 -2
- package/dist/components/TagList/constant.d.ts.map +1 -1
- package/dist/components/TagList/constant.js +2 -4
- package/dist/components/TagList/index.d.ts +6 -6
- package/dist/components/TagList/index.d.ts.map +1 -1
- package/dist/components/TagList/index.js +77 -115
- package/dist/components/TagList/styles.css.d.ts +3 -3
- package/dist/components/TagList/styles.css.d.ts.map +1 -1
- package/dist/components/TagList/styles.css.js +7 -8
- package/dist/components/Text/index.d.ts.map +1 -1
- package/dist/components/Text/index.js +4 -6
- package/dist/components/Text/style.css.d.ts +0 -47
- package/dist/components/Text/style.css.d.ts.map +1 -1
- package/dist/components/TextArea/index.js +1 -1
- package/dist/components/TimeInput/index.js +1 -1
- package/dist/components/Toaster/Toaster.js +1 -1
- package/dist/components/Toaster/components/Button.js +2 -2
- package/dist/components/Toaster/components/Link.js +3 -3
- package/dist/components/Tooltip/TooltipChildren.d.ts +10 -0
- package/dist/components/Tooltip/TooltipChildren.d.ts.map +1 -0
- package/dist/components/Tooltip/TooltipChildren.js +71 -0
- package/dist/components/Tooltip/TooltipElement.d.ts +8 -0
- package/dist/components/Tooltip/TooltipElement.d.ts.map +1 -0
- package/dist/components/Tooltip/TooltipElement.js +39 -0
- package/dist/components/Tooltip/index.d.ts +92 -34
- package/dist/components/Tooltip/index.d.ts.map +1 -1
- package/dist/components/Tooltip/index.js +51 -29
- package/dist/components/Tooltip/styles.css.d.ts +17 -0
- package/dist/components/Tooltip/styles.css.d.ts.map +1 -1
- package/dist/components/Tooltip/styles.css.js +23 -1
- package/dist/components/Tooltip/types.d.ts +7 -0
- package/dist/components/Tooltip/types.d.ts.map +1 -0
- package/dist/components/Tooltip/useTooltip.d.ts +25 -0
- package/dist/components/Tooltip/useTooltip.d.ts.map +1 -0
- package/dist/components/Tooltip/useTooltip.js +75 -0
- package/dist/components/TreeMapChart/index.js +1 -1
- package/dist/components/VisuallyHidden/index.js +2 -2
- package/dist/composition.js +3 -3
- package/dist/compositions/EstimateCost/Components/Item.js +1 -1
- package/dist/compositions/EstimateCost/Components/LineThrough.js +2 -2
- package/dist/compositions/EstimateCost/Components/Unit.js +1 -1
- package/dist/compositions/EstimateCost/EstimateCostProvider.js +1 -1
- package/dist/compositions/EstimateCost/Image.js +1 -1
- package/dist/compositions/Filters/filterTypes/FilterSlider.js +1 -1
- package/dist/compositions/Filters/filterTypes/FilterText.d.ts.map +1 -1
- package/dist/compositions/Filters/filterTypes/FilterText.js +1 -0
- package/dist/compositions/Filters/parts/AbstractFilter.js +1 -1
- package/dist/compositions/Filters/parts/FiltersDrawer.d.ts +1 -0
- package/dist/compositions/Filters/parts/FiltersDrawer.d.ts.map +1 -1
- package/dist/compositions/Filters/parts/FiltersDrawer.js +15 -4
- package/dist/compositions/Filters/parts/FiltersMainRow.js +1 -0
- package/dist/compositions/Filters/parts/helpers.d.ts.map +1 -1
- package/dist/compositions/Filters/parts/helpers.js +3 -1
- package/dist/compositions/Filters/parts/reducer.js +1 -1
- package/dist/compositions/Filters/parts/useFilters.js +1 -1
- package/dist/compositions/Filters/types.d.ts +1 -0
- package/dist/compositions/Filters/types.d.ts.map +1 -1
- package/dist/compositions/InfoTable/components/Row.js +1 -1
- package/dist/compositions/InfoTable/styles.css.d.ts.map +1 -1
- package/dist/compositions/InfoTable/styles.css.js +30 -30
- package/dist/compositions/Navigation/NavigationProvider.js +1 -1
- package/dist/compositions/Navigation/components/items.css.d.ts.map +1 -1
- package/dist/compositions/Navigation/components/styles.css.d.ts.map +1 -1
- package/dist/compositions/OfferList/components/Row.js +4 -2
- package/dist/compositions/OptionSelector/styles.css.js +30 -30
- package/dist/compositions/OrderSummary/helpers.js +1 -1
- package/dist/compositions/RichTextInput/index.js +1 -1
- package/dist/hooks/useBreakpoint.d.ts +15 -0
- package/dist/hooks/useBreakpoint.d.ts.map +1 -0
- package/dist/hooks/useBreakpoint.js +46 -0
- package/dist/hooks/useIsOverflowing.d.ts +7 -3
- package/dist/hooks/useIsOverflowing.d.ts.map +1 -1
- package/dist/hooks/useIsOverflowing.js +13 -10
- package/dist/index.js +13 -13
- package/dist/ui.css +1 -1
- package/package.json +5 -4
- package/dist/components/Pagination/PaginationButton.d.ts +0 -11
- package/dist/components/Pagination/PaginationButton.d.ts.map +0 -1
- package/dist/components/Pagination/PaginationButton.js +0 -34
|
@@ -32,41 +32,43 @@ function init_CalendarMonthly() {
|
|
|
32
32
|
const isInHoveredRange = getIsInHoveredRange(selectsRange, constructedDate, hoveredDate, range);
|
|
33
33
|
const isSelected = value && isSameMonth(constructedDate, value) || (range === null || range === void 0 ? void 0 : range.start) && isSameMonth(constructedDate, range.start) || (range === null || range === void 0 ? void 0 : range.end) && isSameMonth(constructedDate, range.end);
|
|
34
34
|
const onClickRange = (event, newDate) => {
|
|
35
|
-
if (selectsRange)
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
35
|
+
if (selectsRange) {
|
|
36
|
+
if (rangeState === "end" && isAfterStartDate) {
|
|
37
|
+
setRange === null || setRange === void 0 || setRange({
|
|
38
|
+
end: newDate,
|
|
39
|
+
start: range.start
|
|
40
|
+
});
|
|
41
|
+
onChange === null || onChange === void 0 || onChange([range.start, newDate], event);
|
|
42
|
+
setInputValue(formatValue(null, {
|
|
43
|
+
end: newDate,
|
|
44
|
+
start: range.start
|
|
45
|
+
}, true, true, format));
|
|
46
|
+
setVisible(false);
|
|
47
|
+
setRangeState("start");
|
|
48
|
+
} else if (rangeState === "end" && !isAfterStartDate && range) {
|
|
49
|
+
setRange === null || setRange === void 0 || setRange({
|
|
50
|
+
end: range.start,
|
|
51
|
+
start: newDate
|
|
52
|
+
});
|
|
53
|
+
onChange === null || onChange === void 0 || onChange([newDate, range.start], event);
|
|
54
|
+
setInputValue(formatValue(null, {
|
|
55
|
+
end: range.start,
|
|
56
|
+
start: newDate
|
|
57
|
+
}, true, true, format));
|
|
58
|
+
setVisible(false);
|
|
59
|
+
setRangeState("start");
|
|
60
|
+
} else {
|
|
61
|
+
setRange === null || setRange === void 0 || setRange({
|
|
62
|
+
end: null,
|
|
63
|
+
start: newDate
|
|
64
|
+
});
|
|
65
|
+
onChange === null || onChange === void 0 || onChange([newDate, null], event);
|
|
66
|
+
setInputValue(formatValue(null, {
|
|
67
|
+
end: null,
|
|
68
|
+
start: newDate
|
|
69
|
+
}, true, true, format));
|
|
70
|
+
setRangeState("end");
|
|
71
|
+
}
|
|
70
72
|
}
|
|
71
73
|
};
|
|
72
74
|
const monthState = () => {
|
|
@@ -80,13 +82,15 @@ function init_CalendarMonthly() {
|
|
|
80
82
|
className: cn(dateInputStyle.dayMonth, dateInputStyle.capitalizedText),
|
|
81
83
|
disabled: disabled || isExcluded || isOutsideRange,
|
|
82
84
|
onClick: (event) => {
|
|
83
|
-
if (!(isExcluded || isOutsideRange || readOnly))
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
85
|
+
if (!(isExcluded || isOutsideRange || readOnly)) {
|
|
86
|
+
if (selectsRange) onClickRange(event, constructedDate);
|
|
87
|
+
else {
|
|
88
|
+
setMonthToShow(index + 1);
|
|
89
|
+
setValue(constructedDate);
|
|
90
|
+
onChange === null || onChange === void 0 || onChange(constructedDate, event);
|
|
91
|
+
setInputValue(formatValue(constructedDate, null, true, false, format));
|
|
92
|
+
setVisible(false);
|
|
93
|
+
}
|
|
90
94
|
}
|
|
91
95
|
},
|
|
92
96
|
onMouseEnter: () => setHoveredDate(constructedDate),
|
|
@@ -163,12 +163,14 @@ function init_DateInput() {
|
|
|
163
163
|
setInputValue(newValue);
|
|
164
164
|
};
|
|
165
165
|
const onBlurInput = () => {
|
|
166
|
-
if (inputValue)
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
166
|
+
if (inputValue) {
|
|
167
|
+
if (selectsRange) {
|
|
168
|
+
const computedNewRange = createDateRange(inputValue, showMonthYearPicker);
|
|
169
|
+
onChange === null || onChange === void 0 || onChange(computedNewRange, void 0);
|
|
170
|
+
} else {
|
|
171
|
+
const computedDate = createDate(inputValue, showMonthYearPicker, minDate, maxDate);
|
|
172
|
+
onChange === null || onChange === void 0 || onChange(computedDate, void 0);
|
|
173
|
+
}
|
|
172
174
|
}
|
|
173
175
|
};
|
|
174
176
|
return /* @__PURE__ */ jsx(DateInputContext.Provider, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.css.d.ts","sourceRoot":"","sources":["../../../src/components/DateInput/styles.css.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"styles.css.d.ts","sourceRoot":"","sources":["../../../src/components/DateInput/styles.css.ts"],"names":[],"mappings":"AAoCA,eAAO,MAAM,cAAc;;;;;;;;;;;;;CAO1B,CAAA"}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { __esmMin, __name } from "../../_virtual/_rolldown/runtime.js";
|
|
3
3
|
import { Text, init_Text } from "../Text/index.js";
|
|
4
4
|
import { dialogStyle, init_styles_css } from "./styles.css.js";
|
|
5
|
-
import { Modal, init_Modal } from "../Modal/index.js";
|
|
6
5
|
import { Bullet, init_Bullet } from "../Bullet/index.js";
|
|
6
|
+
import { Modal, init_Modal } from "../Modal/index.js";
|
|
7
7
|
import { DialogContext, init_Context, useDialogContext } from "./Context.js";
|
|
8
8
|
import { DialogButton, init_Button } from "./components/Button.js";
|
|
9
9
|
import { DialogButtons, init_Buttons } from "./components/Buttons.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __esmMin, __name } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import _objectSpread2, { init_objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.
|
|
2
|
+
import _objectSpread2, { init_objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.146.0/helpers/esm/objectSpread2.js";
|
|
3
3
|
import { animationDurationVar, expandableStyle, init_styles_css } from "./styles.css.js";
|
|
4
4
|
import { useEffect, useRef, useState } from "react";
|
|
5
5
|
import { cn } from "@ultraviolet/utils";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __esmMin, __name } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import _objectSpread2, { init_objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.
|
|
2
|
+
import _objectSpread2, { init_objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.146.0/helpers/esm/objectSpread2.js";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
//#region src/components/Expandable/NonAnimatedExpandable.tsx
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __esmMin, __name } from "../../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import _objectSpread2, { init_objectSpread2 } from "../../../_virtual/_@oxc-project_runtime@0.
|
|
3
|
-
import _objectWithoutProperties, { init_objectWithoutProperties } from "../../../_virtual/_@oxc-project_runtime@0.
|
|
2
|
+
import _objectSpread2, { init_objectSpread2 } from "../../../_virtual/_@oxc-project_runtime@0.146.0/helpers/esm/objectSpread2.js";
|
|
3
|
+
import _objectWithoutProperties, { init_objectWithoutProperties } from "../../../_virtual/_@oxc-project_runtime@0.146.0/helpers/esm/objectWithoutProperties.js";
|
|
4
4
|
import { Button, init_Button as init_Button$1 } from "../../Button/index.js";
|
|
5
5
|
import { init_FileInputProvider, useFileInput } from "../FileInputProvider.js";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __esmMin, __name } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import _asyncToGenerator, { init_asyncToGenerator } from "../../_virtual/_@oxc-project_runtime@0.
|
|
2
|
+
import _asyncToGenerator, { init_asyncToGenerator } from "../../_virtual/_@oxc-project_runtime@0.146.0/helpers/esm/asyncToGenerator.js";
|
|
3
3
|
|
|
4
4
|
//#region src/components/FileInput/helpers.ts
|
|
5
5
|
var getMimeTypeType, formatFileSize, fileIsAccepted, isFileEntry, isDirectoryEntry, convertEntryToFile, readEntriesInDirectory, readEntries, readTransferredFiles;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { __esmMin, __name } from "../../_virtual/_rolldown/runtime.js";
|
|
3
|
-
import _objectSpread2, { init_objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.
|
|
3
|
+
import _objectSpread2, { init_objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.146.0/helpers/esm/objectSpread2.js";
|
|
4
4
|
import { Stack, init_Stack } from "../Stack/index.js";
|
|
5
5
|
import { Text, init_Text } from "../Text/index.js";
|
|
6
6
|
import { hasHelperText, init_hasHelperText } from "../../helpers/hasHelperText.js";
|
|
@@ -9,7 +9,7 @@ import { Label, init_Label } from "../Label/index.js";
|
|
|
9
9
|
import { fileInputStyle, init_styles_css } from "./styles.css.js";
|
|
10
10
|
import { FileInputContext, init_FileInputProvider } from "./FileInputProvider.js";
|
|
11
11
|
import { FileInputButton, init_Button } from "./components/Button.js";
|
|
12
|
-
import _asyncToGenerator, { init_asyncToGenerator } from "../../_virtual/_@oxc-project_runtime@0.
|
|
12
|
+
import _asyncToGenerator, { init_asyncToGenerator } from "../../_virtual/_@oxc-project_runtime@0.146.0/helpers/esm/asyncToGenerator.js";
|
|
13
13
|
import { fileIsAccepted, init_helpers, readTransferredFiles } from "./helpers.js";
|
|
14
14
|
import { ListFiles, init_List } from "./components/List.js";
|
|
15
15
|
import { DropzoneContent, init_DropzoneContent } from "./DropzoneContent.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { __esmMin, __name } from "../../_virtual/_rolldown/runtime.js";
|
|
3
|
-
import _objectSpread2, { init_objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.
|
|
3
|
+
import _objectSpread2, { init_objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.146.0/helpers/esm/objectSpread2.js";
|
|
4
4
|
import { Loader, init_Loader } from "../Loader/index.js";
|
|
5
5
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
6
6
|
import { useDebouncedCallback } from "@ultraviolet/utils";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { __esmMin, __name } from "../../_virtual/_rolldown/runtime.js";
|
|
3
|
-
import _objectSpread2, { init_objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.
|
|
3
|
+
import _objectSpread2, { init_objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.146.0/helpers/esm/objectSpread2.js";
|
|
4
4
|
import { Stack, init_Stack } from "../Stack/index.js";
|
|
5
5
|
import { Button, init_Button } from "../Button/index.js";
|
|
6
6
|
import { hasHelperText, init_hasHelperText } from "../../helpers/hasHelperText.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { __esmMin, __name } from "../../_virtual/_rolldown/runtime.js";
|
|
3
|
-
import _objectSpread2, { init_objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.
|
|
3
|
+
import _objectSpread2, { init_objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.146.0/helpers/esm/objectSpread2.js";
|
|
4
4
|
import { getLegendColor, init_legend } from "../../helpers/legend.js";
|
|
5
5
|
import { getNivoTheme, init_nivoTheme } from "../../helpers/nivoTheme.js";
|
|
6
6
|
import { getMaxChartValue, getMinChartValue, init_helpers } from "./helpers.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { __esmMin, __name } from "../../_virtual/_rolldown/runtime.js";
|
|
3
|
-
import _objectSpread2, { init_objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.
|
|
3
|
+
import _objectSpread2, { init_objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.146.0/helpers/esm/objectSpread2.js";
|
|
4
4
|
import { init_styles_css, listStyle } from "./styles.css.js";
|
|
5
5
|
import { init_ColumnProvider, useColumnProvider } from "./ColumnProvider.js";
|
|
6
6
|
import { init_ListContext, useListContext } from "./ListContext.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { __esmMin, __name } from "../../_virtual/_rolldown/runtime.js";
|
|
3
|
-
import toPropertyKey, { init_toPropertyKey } from "../../_virtual/_@oxc-project_runtime@0.
|
|
4
|
-
import _objectSpread2, { init_objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.
|
|
5
|
-
import _objectWithoutProperties, { init_objectWithoutProperties } from "../../_virtual/_@oxc-project_runtime@0.
|
|
3
|
+
import toPropertyKey, { init_toPropertyKey } from "../../_virtual/_@oxc-project_runtime@0.146.0/helpers/esm/toPropertyKey.js";
|
|
4
|
+
import _objectSpread2, { init_objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.146.0/helpers/esm/objectSpread2.js";
|
|
5
|
+
import _objectWithoutProperties, { init_objectWithoutProperties } from "../../_virtual/_@oxc-project_runtime@0.146.0/helpers/esm/objectWithoutProperties.js";
|
|
6
6
|
import { createContext, useCallback, useContext, useEffect, useMemo, useState } from "react";
|
|
7
7
|
import { jsx } from "react/jsx-runtime";
|
|
8
8
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { __esmMin, __name } from "../../_virtual/_rolldown/runtime.js";
|
|
3
|
-
import _objectSpread2, { init_objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.
|
|
3
|
+
import _objectSpread2, { init_objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.146.0/helpers/esm/objectSpread2.js";
|
|
4
4
|
import { SIZES, init_constants } from "./constants.js";
|
|
5
5
|
import { init_styles_css, loaderStyle } from "./styles.css.js";
|
|
6
6
|
import { useTheme } from "@ultraviolet/themes";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { __esmMin, __name } from "../../_virtual/_rolldown/runtime.js";
|
|
3
3
|
import { Stack, init_Stack } from "../Stack/index.js";
|
|
4
|
-
import { Popup, init_Popup } from "../Popup/index.js";
|
|
5
4
|
import { heightAvailableSpace, heightMenu, init_styles_css, menuStyle } from "./styles.css.js";
|
|
6
5
|
import { getListItem, init_helpers, searchChildren } from "./helpers.js";
|
|
7
6
|
import { DisclosureContext, init_MenuProvider, useMenu } from "./MenuProvider.js";
|
|
7
|
+
import { Popup, init_Popup } from "../Popup/index.js";
|
|
8
8
|
import { SearchInput, init_SearchInput } from "../SearchInput/index.js";
|
|
9
9
|
import { cloneElement, forwardRef, isValidElement, useCallback, useEffect, useId, useImperativeHandle, useMemo, useRef, useState } from "react";
|
|
10
10
|
import { cn } from "@ultraviolet/utils";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { __esmMin, __name } from "../../_virtual/_rolldown/runtime.js";
|
|
3
|
-
import _objectSpread2, { init_objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.
|
|
4
|
-
import _objectWithoutProperties, { init_objectWithoutProperties } from "../../_virtual/_@oxc-project_runtime@0.
|
|
3
|
+
import _objectSpread2, { init_objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.146.0/helpers/esm/objectSpread2.js";
|
|
4
|
+
import _objectWithoutProperties, { init_objectWithoutProperties } from "../../_virtual/_@oxc-project_runtime@0.146.0/helpers/esm/objectWithoutProperties.js";
|
|
5
5
|
import { Group, init_Group } from "./components/Group.js";
|
|
6
6
|
import { MenuProvider, init_MenuProvider } from "./MenuProvider.js";
|
|
7
7
|
import { Item, init_Item } from "./components/Item.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { __esmMin, __name } from "../../../_virtual/_rolldown/runtime.js";
|
|
3
|
-
import _objectSpread2, { init_objectSpread2 } from "../../../_virtual/_@oxc-project_runtime@0.
|
|
3
|
+
import _objectSpread2, { init_objectSpread2 } from "../../../_virtual/_@oxc-project_runtime@0.146.0/helpers/esm/objectSpread2.js";
|
|
4
4
|
import { Stack, init_Stack } from "../../Stack/index.js";
|
|
5
5
|
import { init_ModalProvider, useModal } from "../ModalProvider.js";
|
|
6
6
|
import { init_styles_css, modalStyle, nestedModalScale, nestedModalTop } from "../styles.css.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { __esmMin, __name } from "../../_virtual/_rolldown/runtime.js";
|
|
3
|
-
import _objectSpread2, { init_objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.
|
|
3
|
+
import _objectSpread2, { init_objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.146.0/helpers/esm/objectSpread2.js";
|
|
4
4
|
import { Stack, init_Stack } from "../Stack/index.js";
|
|
5
5
|
import { Text, init_Text } from "../Text/index.js";
|
|
6
6
|
import { Button, init_Button } from "../Button/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Controls.d.ts","sourceRoot":"","sources":["../../../../src/components/NumberInput/components/Controls.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAG7C,eAAO,MAAM,QAAQ,4EAA6E,aAAa,
|
|
1
|
+
{"version":3,"file":"Controls.d.ts","sourceRoot":"","sources":["../../../../src/components/NumberInput/components/Controls.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAG7C,eAAO,MAAM,QAAQ,4EAA6E,aAAa,uCAmE9G,CAAA"}
|
|
@@ -64,6 +64,7 @@ function init_Controls() {
|
|
|
64
64
|
sentiment: "neutral",
|
|
65
65
|
size: size === "small" ? "xsmall" : "small",
|
|
66
66
|
variant: "ghost",
|
|
67
|
+
tabIndex: -1,
|
|
67
68
|
children: isUp ? /* @__PURE__ */ jsx(PlusIcon, { size: size === "large" ? "small" : "small" }) : /* @__PURE__ */ jsx(MinusIcon, { size: size === "large" ? "small" : "small" })
|
|
68
69
|
})
|
|
69
70
|
}) : null;
|
|
@@ -8,8 +8,9 @@ type PaginationButtonsProps = {
|
|
|
8
8
|
'data-testid'?: string;
|
|
9
9
|
hideFirstPage?: boolean;
|
|
10
10
|
hideLastPage?: boolean;
|
|
11
|
+
isSmall: boolean;
|
|
11
12
|
size: 'small' | 'medium';
|
|
12
13
|
};
|
|
13
|
-
export declare const PaginationButtons: ({ page, disabled, onChange, pageCount, pageTabCount, 'data-testid': dataTestId, className, hideFirstPage, hideLastPage, size, }: PaginationButtonsProps) => import("react").JSX.Element;
|
|
14
|
+
export declare const PaginationButtons: ({ page, disabled, onChange, pageCount, pageTabCount, 'data-testid': dataTestId, className, hideFirstPage, hideLastPage, isSmall, size, }: PaginationButtonsProps) => import("react").JSX.Element;
|
|
14
15
|
export {};
|
|
15
16
|
//# sourceMappingURL=PaginationButtons.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaginationButtons.d.ts","sourceRoot":"","sources":["../../../src/components/Pagination/PaginationButtons.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PaginationButtons.d.ts","sourceRoot":"","sources":["../../../src/components/Pagination/PaginationButtons.tsx"],"names":[],"mappings":"AAWA,KAAK,sBAAsB,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,OAAO,CAAA;IACjB,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,SAAS,EAAE,MAAM,CAAA;IACjB,YAAY,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,OAAO,EAAE,OAAO,CAAA;IAChB,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAA;CACzB,CAAA;AAED,eAAO,MAAM,iBAAiB,6IAY3B,sBAAsB,gCAsExB,CAAA"}
|
|
@@ -4,8 +4,7 @@ import { Stack, init_Stack } from "../Stack/index.js";
|
|
|
4
4
|
import { Button, init_Button } from "../Button/index.js";
|
|
5
5
|
import { init_styles_css, paginationStyle } from "./styles.css.js";
|
|
6
6
|
import { Ellipsis, init_Ellipsis } from "./Ellipsis.js";
|
|
7
|
-
import {
|
|
8
|
-
import { MakeButton, init_PaginationButton } from "./PaginationButton.js";
|
|
7
|
+
import { getPageItems, init_getPageItems } from "./getPageItems.js";
|
|
9
8
|
import { useCallback, useMemo } from "react";
|
|
10
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
10
|
import { ArrowRightIcon } from "@ultraviolet/icons/ArrowRightIcon";
|
|
@@ -18,17 +17,19 @@ function init_PaginationButtons() {
|
|
|
18
17
|
init_Button();
|
|
19
18
|
init_Stack();
|
|
20
19
|
init_Ellipsis();
|
|
21
|
-
|
|
22
|
-
init_PaginationButton();
|
|
20
|
+
init_getPageItems();
|
|
23
21
|
init_styles_css();
|
|
24
|
-
PaginationButtons = ({ page, disabled, onChange, pageCount, pageTabCount, "data-testid": dataTestId, className, hideFirstPage, hideLastPage, size }) => {
|
|
22
|
+
PaginationButtons = ({ page, disabled, onChange, pageCount, pageTabCount, "data-testid": dataTestId, className, hideFirstPage, hideLastPage, isSmall, size }) => {
|
|
25
23
|
const goToNextPage = useCallback(() => {
|
|
26
24
|
onChange(page + 1);
|
|
27
25
|
}, [onChange, page]);
|
|
28
26
|
const goToPreviousPage = useCallback(() => {
|
|
29
27
|
onChange(page - 1);
|
|
30
28
|
}, [onChange, page]);
|
|
31
|
-
const
|
|
29
|
+
const pageItems = useMemo(() => {
|
|
30
|
+
return getPageItems(page, pageCount, pageTabCount, isSmall ? 1 : 3, hideFirstPage, hideLastPage);
|
|
31
|
+
}, [
|
|
32
|
+
isSmall,
|
|
32
33
|
page,
|
|
33
34
|
pageCount,
|
|
34
35
|
pageTabCount,
|
|
@@ -55,21 +56,24 @@ function init_PaginationButtons() {
|
|
|
55
56
|
children: /* @__PURE__ */ jsx(ArrowLeftIcon, {})
|
|
56
57
|
})
|
|
57
58
|
}),
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
+
/* @__PURE__ */ jsx(Stack, {
|
|
59
60
|
className: paginationStyle.pageNumbersContainer,
|
|
60
61
|
direction: "row",
|
|
61
62
|
gap: 1,
|
|
62
|
-
children:
|
|
63
|
+
children: pageItems.map((item, index) => item.type === "ellipsis" ? /* @__PURE__ */ jsx(Ellipsis, {
|
|
63
64
|
disabled,
|
|
64
|
-
handlePageClick,
|
|
65
|
-
hasEllipsisBefore: !(index === 0 || pageNumbersToDisplay[index - 1] === pageNumber - 1) || index === 0 && pageNumber !== 1,
|
|
66
|
-
page,
|
|
67
|
-
pageNumber,
|
|
68
65
|
size
|
|
69
|
-
},
|
|
66
|
+
}, `ellipsis-${index}`) : /* @__PURE__ */ jsx(Button, {
|
|
67
|
+
"aria-current": item.page === page,
|
|
68
|
+
className: paginationStyle.pageButton[size],
|
|
70
69
|
disabled,
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
onClick: handlePageClick(item.page),
|
|
71
|
+
sentiment: item.page === page ? "primary" : "neutral",
|
|
72
|
+
size,
|
|
73
|
+
type: "button",
|
|
74
|
+
variant: item.page === page ? "filled" : "outlined",
|
|
75
|
+
children: item.page
|
|
76
|
+
}, item.page))
|
|
73
77
|
}),
|
|
74
78
|
/* @__PURE__ */ jsx(Stack, {
|
|
75
79
|
gap: 1,
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type PageItem = {
|
|
2
|
+
type: 'page';
|
|
3
|
+
page: number;
|
|
4
|
+
} | {
|
|
5
|
+
type: 'ellipsis';
|
|
6
|
+
};
|
|
7
|
+
export declare const getPageItems: (page: number, pageCount: number, range: number, numberOfButtonsInBetween: number, hideFirstPage?: boolean, hideLastPage?: boolean) => PageItem[];
|
|
8
|
+
//# sourceMappingURL=getPageItems.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getPageItems.d.ts","sourceRoot":"","sources":["../../../src/components/Pagination/getPageItems.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,QAAQ,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,CAAA;AA+B5E,eAAO,MAAM,YAAY,SACjB,MAAM,aACD,MAAM,SACV,MAAM,4BACa,MAAM,kBAChB,OAAO,iBACR,OAAO,KACrB,QAAQ,EAQV,CAAA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { __esmMin, __name } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { getPageNumbers, init_getPageNumbers } from "./getPageNumbers.js";
|
|
3
|
+
|
|
4
|
+
//#region src/components/Pagination/getPageItems.ts
|
|
5
|
+
var toPageItems, expandSinglePageGaps, getPageItems;
|
|
6
|
+
function init_getPageItems() {
|
|
7
|
+
return (init_getPageItems = __esmMin(() => {
|
|
8
|
+
init_getPageNumbers();
|
|
9
|
+
toPageItems = (pageNumbers, pageCount) => {
|
|
10
|
+
const items = [];
|
|
11
|
+
pageNumbers.forEach((pageNumber, index) => {
|
|
12
|
+
if (!(index === 0 || pageNumbers[index - 1] === pageNumber - 1) || index === 0 && pageNumber !== 1) items.push({ type: "ellipsis" });
|
|
13
|
+
items.push({
|
|
14
|
+
type: "page",
|
|
15
|
+
page: pageNumber
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
if (pageNumbers.at(-1) !== pageCount) items.push({ type: "ellipsis" });
|
|
19
|
+
return items;
|
|
20
|
+
};
|
|
21
|
+
expandSinglePageGaps = (pageNumbers) => pageNumbers.flatMap((pageNumber, index) => index > 0 && pageNumber - pageNumbers[index - 1] === 2 ? [pageNumber - 1, pageNumber] : [pageNumber]);
|
|
22
|
+
getPageItems = (page, pageCount, range, numberOfButtonsInBetween, hideFirstPage, hideLastPage) => {
|
|
23
|
+
if (pageCount <= 1) return [{
|
|
24
|
+
type: "page",
|
|
25
|
+
page: 1
|
|
26
|
+
}];
|
|
27
|
+
const pageNumbers = getPageNumbers(page, pageCount, range, numberOfButtonsInBetween, hideFirstPage, hideLastPage);
|
|
28
|
+
return toPageItems(expandSinglePageGaps(pageNumbers), pageCount);
|
|
29
|
+
};
|
|
30
|
+
}))();
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
//#endregion
|
|
34
|
+
init_getPageItems();
|
|
35
|
+
export { getPageItems, init_getPageItems };
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
* @param currentPage The current page
|
|
4
4
|
* @param pageCount The last page number
|
|
5
5
|
* @param range The number of pages wanted
|
|
6
|
+
* @param numberOfButtonsInBetween The number of buttons to show in the middle section between the two ellipsis
|
|
6
7
|
* @returns List of page numbers to display
|
|
7
8
|
*/
|
|
8
|
-
export declare const getPageNumbers: (currentPage: number, pageCount: number, range?: number, hideFirstPage?: boolean, hideLastPage?: boolean) => number[];
|
|
9
|
+
export declare const getPageNumbers: (currentPage: number, pageCount: number, range?: number, numberOfButtonsInBetween?: number, hideFirstPage?: boolean, hideLastPage?: boolean) => number[];
|
|
9
10
|
//# sourceMappingURL=getPageNumbers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getPageNumbers.d.ts","sourceRoot":"","sources":["../../../src/components/Pagination/getPageNumbers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getPageNumbers.d.ts","sourceRoot":"","sources":["../../../src/components/Pagination/getPageNumbers.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,gBACZ,MAAM,aACR,MAAM,qEAGD,OAAO,iBACR,OAAO,KACrB,MAAM,EA6BR,CAAA"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { __esmMin, __name } from "../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
|
|
3
3
|
//#region src/components/Pagination/getPageNumbers.ts
|
|
4
|
-
var
|
|
4
|
+
var getPageNumbers;
|
|
5
5
|
function init_getPageNumbers() {
|
|
6
6
|
return (init_getPageNumbers = __esmMin(() => {
|
|
7
|
-
|
|
8
|
-
getPageNumbers = (currentPage, pageCount, range = 5, hideFirstPage, hideLastPage) => {
|
|
7
|
+
getPageNumbers = (currentPage, pageCount, range = 5, numberOfButtonsInBetween = 3, hideFirstPage, hideLastPage) => {
|
|
9
8
|
const truncationBefore = currentPage >= range;
|
|
10
9
|
const truncationAfter = currentPage <= pageCount - range + 1 || currentPage < range;
|
|
11
10
|
if (pageCount <= range) return Array.from({ length: pageCount }, (_, index) => index + 1);
|
|
@@ -13,7 +12,7 @@ function init_getPageNumbers() {
|
|
|
13
12
|
const lastPage = hideLastPage ? [] : [pageCount];
|
|
14
13
|
const pagesToShowBeforeTruncation = truncationBefore ? firstPage : Array.from({ length: range }, (_, index) => index + 1);
|
|
15
14
|
const pagesToShowAfterTruncation = truncationAfter ? lastPage : Array.from({ length: range }, (_, index) => index + pageCount - range + 1);
|
|
16
|
-
const pagesToShowBetweenTruncation = truncationBefore && truncationAfter ? Array.from({ length:
|
|
15
|
+
const pagesToShowBetweenTruncation = truncationBefore && truncationAfter ? Array.from({ length: numberOfButtonsInBetween }, (_, index) => currentPage + index - Math.floor((numberOfButtonsInBetween - 1) / 2)) : [];
|
|
17
16
|
return [
|
|
18
17
|
...pagesToShowBeforeTruncation,
|
|
19
18
|
...pagesToShowBetweenTruncation,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Pagination/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Pagination/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAO1C,KAAK,eAAe,GAAG;IACrB;;MAEE;IACF,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC;;MAEE;IACF,IAAI,EAAE,MAAM,CAAA;IACZ;;MAEE;IACF,SAAS,EAAE,MAAM,CAAA;IACjB;;MAEE;IACF,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB;;MAEE;IACF,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,aAAa,CAAA;IACrB,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB,GAAG,CACA;IACE;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IAC3C;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B;;OAEG;IACH,aAAa,EAAE,MAAM,CAAA;IACrB;;OAEG;IACH,mBAAmB,CAAC,EAAE,WAAW,CAAA;IACjC,IAAI,CAAC,EAAE,KAAK,CAAA;CACb,GACD;IACE,OAAO,CAAC,EAAE,KAAK,CAAA;IACf,eAAe,CAAC,EAAE,KAAK,CAAA;IACvB,WAAW,CAAC,EAAE,KAAK,CAAA;IACnB,iBAAiB,CAAC,EAAE,KAAK,CAAA;IACzB,aAAa,CAAC,EAAE,KAAK,CAAA;IACrB,mBAAmB,CAAC,EAAE,KAAK,CAAA;IAC3B,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAA;CAC1B,CACJ,CAAA;mCAM0B,EACzB,QAAgB,EAChB,IAAI,EACJ,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,OAAO,EACP,eAAe,EACf,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,mBAAmB,EACnB,aAAa,EACb,YAAY,EACZ,IAAe,EACf,aAAa,EAAE,UAAU,EACzB,KAAK,GACN,EAAE,eAAe"}
|
|
@@ -1,20 +1,29 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { __esmMin, __name } from "../../_virtual/_rolldown/runtime.js";
|
|
3
3
|
import { Stack, init_Stack } from "../Stack/index.js";
|
|
4
|
+
import { init_styles_css, paginationStyle } from "./styles.css.js";
|
|
5
|
+
import { init_useBreakpoint, useBreakpoints } from "../../hooks/useBreakpoint.js";
|
|
4
6
|
import { PaginationButtons, init_PaginationButtons } from "./PaginationButtons.js";
|
|
5
7
|
import { PerPage, init_PerPage } from "./PerPage.js";
|
|
6
|
-
import { useEffect, useState } from "react";
|
|
8
|
+
import { useEffect, useRef, useState } from "react";
|
|
7
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
10
|
|
|
9
11
|
//#region src/components/Pagination/index.tsx
|
|
10
12
|
var Pagination;
|
|
11
13
|
function init_Pagination() {
|
|
12
14
|
return (init_Pagination = __esmMin(() => {
|
|
15
|
+
init_useBreakpoint();
|
|
13
16
|
init_Stack();
|
|
14
17
|
init_PaginationButtons();
|
|
15
18
|
init_PerPage();
|
|
16
|
-
|
|
19
|
+
init_styles_css();
|
|
20
|
+
Pagination = ({ disabled = false, page, pageCount, onChange, pageTabCount, className, perPage, onChangePerPage, perPageText, numberOfItemsText, numberOfItems, perPagePortalTarget, hideFirstPage, hideLastPage, size = "medium", "data-testid": dataTestId, style }) => {
|
|
17
21
|
const [perPageComputed, setPerPage] = useState(perPage !== null && perPage !== void 0 ? perPage : 10);
|
|
22
|
+
const rootRef = useRef(null);
|
|
23
|
+
const breakpoint = useBreakpoints(rootRef, {
|
|
24
|
+
small: 0,
|
|
25
|
+
large: 420
|
|
26
|
+
});
|
|
18
27
|
useEffect(() => {
|
|
19
28
|
if (page < 1) onChange(1);
|
|
20
29
|
if (page > pageCount) onChange(pageCount);
|
|
@@ -28,7 +37,9 @@ function init_Pagination() {
|
|
|
28
37
|
}, [perPage]);
|
|
29
38
|
return /* @__PURE__ */ jsxs(Stack, {
|
|
30
39
|
direction: "row",
|
|
40
|
+
className: rootRef.current ? void 0 : paginationStyle.hiddenContainer,
|
|
31
41
|
justifyContent: "space-between",
|
|
42
|
+
ref: rootRef,
|
|
32
43
|
style,
|
|
33
44
|
children: [perPage ? /* @__PURE__ */ jsx(PerPage, {
|
|
34
45
|
numberOfItems,
|
|
@@ -43,10 +54,11 @@ function init_Pagination() {
|
|
|
43
54
|
className,
|
|
44
55
|
"data-testid": dataTestId,
|
|
45
56
|
disabled,
|
|
57
|
+
isSmall: breakpoint.small,
|
|
46
58
|
onChange,
|
|
47
59
|
page,
|
|
48
60
|
pageCount,
|
|
49
|
-
pageTabCount,
|
|
61
|
+
pageTabCount: pageTabCount !== null && pageTabCount !== void 0 ? pageTabCount : breakpoint.small ? 3 : 5,
|
|
50
62
|
size: perPage ? "small" : size,
|
|
51
63
|
hideFirstPage,
|
|
52
64
|
hideLastPage
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.css.d.ts","sourceRoot":"","sources":["../../../src/components/Pagination/styles.css.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"styles.css.d.ts","sourceRoot":"","sources":["../../../src/components/Pagination/styles.css.ts"],"names":[],"mappings":"AAsCA,eAAO,MAAM,eAAe;;;;;CAK3B,CAAA"}
|
|
@@ -7,14 +7,15 @@ function init_styles_css() {
|
|
|
7
7
|
return (init_styles_css = __esmMin(() => {
|
|
8
8
|
/* @__PURE__ */ init_styles_css_ts_vanilla();
|
|
9
9
|
paginationStyle = {
|
|
10
|
-
|
|
10
|
+
hiddenContainer: "uv_a0295u0",
|
|
11
|
+
pageNumbersContainer: "uv_a0295u1",
|
|
11
12
|
pageButton: {
|
|
12
|
-
medium: "
|
|
13
|
-
small: "
|
|
13
|
+
medium: "uv_a0295u2",
|
|
14
|
+
small: "uv_a0295u3"
|
|
14
15
|
},
|
|
15
16
|
ellipsisClass: {
|
|
16
|
-
medium: "uv_a0295u4
|
|
17
|
-
small: "
|
|
17
|
+
medium: "uv_a0295u5 uv_a0295u4",
|
|
18
|
+
small: "uv_a0295u6 uv_a0295u4"
|
|
18
19
|
}
|
|
19
20
|
};
|
|
20
21
|
}))();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { __esmMin, __name } from "../../_virtual/_rolldown/runtime.js";
|
|
3
|
-
import _objectSpread2, { init_objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.
|
|
3
|
+
import _objectSpread2, { init_objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.146.0/helpers/esm/objectSpread2.js";
|
|
4
4
|
import { Text, init_Text } from "../Text/index.js";
|
|
5
5
|
import { heightContainerPie, init_styles_css, pieChartStyle } from "./styles.css.js";
|
|
6
6
|
import { getLegendColor, init_legend } from "../../helpers/legend.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { __esmMin, __name } from "../../_virtual/_rolldown/runtime.js";
|
|
3
|
-
import _objectSpread2, { init_objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.
|
|
3
|
+
import _objectSpread2, { init_objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.146.0/helpers/esm/objectSpread2.js";
|
|
4
4
|
import { init_isClientSide, isClientSide } from "../../helpers/isClientSide.js";
|
|
5
5
|
import { DEFAULT_POSITIONS, computePositions, init_helpers } from "./helpers.js";
|
|
6
6
|
import { init_styles_css, popupStyle } from "./styles.css.js";
|