lecom-ui 5.4.29 → 5.4.30
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.
|
@@ -145,7 +145,8 @@ const PaginationPerPage = ({
|
|
|
145
145
|
className,
|
|
146
146
|
onChangePerPage,
|
|
147
147
|
perPage,
|
|
148
|
-
totalRowsSelected = 0
|
|
148
|
+
totalRowsSelected = 0,
|
|
149
|
+
maxSelection
|
|
149
150
|
}) => {
|
|
150
151
|
const { t } = useTranslation();
|
|
151
152
|
const perPageOptions = [
|
|
@@ -165,6 +166,12 @@ const PaginationPerPage = ({
|
|
|
165
166
|
if (!onChangePerPage) {
|
|
166
167
|
return null;
|
|
167
168
|
}
|
|
169
|
+
const getSelectedText = () => {
|
|
170
|
+
if (maxSelection === 1 && totalRowsSelected === 1) {
|
|
171
|
+
return `${totalRowsSelected} ${t("pagination.selectedItemSingular")}`;
|
|
172
|
+
}
|
|
173
|
+
return `${totalRowsSelected} ${t("pagination.selectedProcess")}`;
|
|
174
|
+
};
|
|
168
175
|
return /* @__PURE__ */ React.createElement("div", { className: cn("flex items-center gap-4", className) }, /* @__PURE__ */ React.createElement(DropdownMenu, null, /* @__PURE__ */ React.createElement(DropdownMenuTrigger, { asChild: true }, /* @__PURE__ */ React.createElement(Button, { size: "small", color: "grey", variant: "outlined" }, /* @__PURE__ */ React.createElement("span", { className: "max-md:hidden" }, t("pagination.show")), " ", perPage, /* @__PURE__ */ React.createElement(ChevronDown, { size: 20 }))), /* @__PURE__ */ React.createElement(DropdownMenuContent, { side: "top", align: "center" }, perPageOptions.map((option) => /* @__PURE__ */ React.createElement(
|
|
169
176
|
DropdownMenuItem,
|
|
170
177
|
{
|
|
@@ -174,7 +181,7 @@ const PaginationPerPage = ({
|
|
|
174
181
|
}
|
|
175
182
|
},
|
|
176
183
|
option.value.toString()
|
|
177
|
-
)))), totalRowsSelected > 0 && /* @__PURE__ */ React.createElement(Typography, { variant: "heading-xxsmall-600", textColor: "text-grey-800" },
|
|
184
|
+
)))), totalRowsSelected > 0 && /* @__PURE__ */ React.createElement(Typography, { variant: "heading-xxsmall-600", textColor: "text-grey-800" }, getSelectedText()));
|
|
178
185
|
};
|
|
179
186
|
PaginationPerPage.displayName = "PaginationPerPage";
|
|
180
187
|
const Pagination = ({
|
|
@@ -185,7 +192,8 @@ const Pagination = ({
|
|
|
185
192
|
onChangePerPage,
|
|
186
193
|
className,
|
|
187
194
|
activeColor,
|
|
188
|
-
showPerPageSelector = true
|
|
195
|
+
showPerPageSelector = true,
|
|
196
|
+
maxSelection
|
|
189
197
|
}) => {
|
|
190
198
|
const { t } = useTranslation();
|
|
191
199
|
const mapPaginationItem = (item) => {
|
|
@@ -215,6 +223,12 @@ const Pagination = ({
|
|
|
215
223
|
};
|
|
216
224
|
return React.createElement(mappedComponents[item.type], componentProps);
|
|
217
225
|
};
|
|
226
|
+
const getSelectedText = () => {
|
|
227
|
+
if (maxSelection === 1 && totalRowsSelected === 1) {
|
|
228
|
+
return `${totalRowsSelected} ${t("pagination.selectedItemSingular")}`;
|
|
229
|
+
}
|
|
230
|
+
return `${totalRowsSelected} ${t("pagination.selectedProcess")}`;
|
|
231
|
+
};
|
|
218
232
|
return /* @__PURE__ */ React.createElement(
|
|
219
233
|
"div",
|
|
220
234
|
{
|
|
@@ -225,10 +239,11 @@ const Pagination = ({
|
|
|
225
239
|
{
|
|
226
240
|
onChangePerPage,
|
|
227
241
|
perPage,
|
|
228
|
-
totalRowsSelected
|
|
242
|
+
totalRowsSelected,
|
|
243
|
+
maxSelection
|
|
229
244
|
}
|
|
230
245
|
),
|
|
231
|
-
!showPerPageSelector && totalRowsSelected > 0 && /* @__PURE__ */ React.createElement(Typography, { variant: "heading-xxsmall-600", textColor: "text-grey-800" },
|
|
246
|
+
!showPerPageSelector && totalRowsSelected > 0 && /* @__PURE__ */ React.createElement(Typography, { variant: "heading-xxsmall-600", textColor: "text-grey-800" }, getSelectedText()),
|
|
232
247
|
/* @__PURE__ */ React.createElement("nav", { role: "navigation", "aria-label": "pagination" }, /* @__PURE__ */ React.createElement(PaginationContent, null, itemsPage.map((item) => /* @__PURE__ */ React.createElement(PaginationItem, { key: item.id }, mapPaginationItem(item)))))
|
|
233
248
|
);
|
|
234
249
|
};
|
|
@@ -9,7 +9,8 @@ const language = {
|
|
|
9
9
|
},
|
|
10
10
|
pagination: {
|
|
11
11
|
show: "Show:",
|
|
12
|
-
selectedProcess: "Item(s) selected"
|
|
12
|
+
selectedProcess: "Item(s) selected",
|
|
13
|
+
selectedItemSingular: "item selected"
|
|
13
14
|
},
|
|
14
15
|
upload: {
|
|
15
16
|
label: "Drag and drop the file here or click to select it.",
|
|
@@ -9,7 +9,8 @@ const language = {
|
|
|
9
9
|
},
|
|
10
10
|
pagination: {
|
|
11
11
|
show: "Mostrar:",
|
|
12
|
-
selectedProcess: "Item(s) seleccionado(s)"
|
|
12
|
+
selectedProcess: "Item(s) seleccionado(s)",
|
|
13
|
+
selectedItemSingular: "item seleccionado"
|
|
13
14
|
},
|
|
14
15
|
upload: {
|
|
15
16
|
label: "Arrastre y suelte el archivo aqu\xED o haga clic para seleccionarlo.",
|
|
@@ -9,7 +9,8 @@ const language = {
|
|
|
9
9
|
},
|
|
10
10
|
pagination: {
|
|
11
11
|
show: "Mostrar:",
|
|
12
|
-
selectedProcess: "Item(s) selecionado(s)"
|
|
12
|
+
selectedProcess: "Item(s) selecionado(s)",
|
|
13
|
+
selectedItemSingular: "item selecionado"
|
|
13
14
|
},
|
|
14
15
|
upload: {
|
|
15
16
|
label: "Arraste e solte o arquivo aqui ou clique para selecion\xE1-lo.",
|
package/dist/index.d.ts
CHANGED
|
@@ -306,6 +306,7 @@ interface PaginationProps {
|
|
|
306
306
|
className?: string;
|
|
307
307
|
activeColor?: BgColor$1;
|
|
308
308
|
showPerPageSelector?: boolean;
|
|
309
|
+
maxSelection?: number;
|
|
309
310
|
}
|
|
310
311
|
declare const PaginationContent: React$1.ForwardRefExoticComponent<Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref"> & React$1.RefAttributes<HTMLUListElement>>;
|
|
311
312
|
declare const PaginationItem: React$1.ForwardRefExoticComponent<Omit<React$1.DetailedHTMLProps<React$1.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & React$1.RefAttributes<HTMLLIElement>>;
|
|
@@ -334,7 +335,7 @@ declare const PaginationIndex: {
|
|
|
334
335
|
displayName: string;
|
|
335
336
|
};
|
|
336
337
|
declare const Pagination: {
|
|
337
|
-
({ currentPage, itemsPage, perPage, totalRowsSelected, onChangePerPage, className, activeColor, showPerPageSelector, }: PaginationProps): React$1.JSX.Element;
|
|
338
|
+
({ currentPage, itemsPage, perPage, totalRowsSelected, onChangePerPage, className, activeColor, showPerPageSelector, maxSelection, }: PaginationProps): React$1.JSX.Element;
|
|
338
339
|
displayName: string;
|
|
339
340
|
};
|
|
340
341
|
|
|
@@ -992,7 +993,7 @@ declare const RadioGroup: React$1.ForwardRefExoticComponent<Omit<RadioGroupPrimi
|
|
|
992
993
|
declare const RadioGroupItem: React$1.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupItemProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
993
994
|
|
|
994
995
|
declare const ResizablePanelGroup: ({ className, ...props }: React$1.ComponentProps<typeof ResizablePrimitive.PanelGroup>) => React$1.JSX.Element;
|
|
995
|
-
declare const ResizablePanel: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttributes<HTMLDivElement | HTMLElement | HTMLButtonElement | HTMLOListElement | HTMLLIElement | HTMLAnchorElement | HTMLSpanElement | HTMLHeadingElement | HTMLParagraphElement |
|
|
996
|
+
declare const ResizablePanel: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttributes<HTMLDivElement | HTMLElement | HTMLButtonElement | HTMLOListElement | HTMLLIElement | HTMLAnchorElement | HTMLSpanElement | HTMLHeadingElement | HTMLParagraphElement | HTMLInputElement | HTMLLabelElement | HTMLUListElement | HTMLObjectElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLQuoteElement | HTMLBodyElement | HTMLBRElement | HTMLCanvasElement | HTMLTableCaptionElement | HTMLTableColElement | HTMLDataElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDialogElement | HTMLDListElement | HTMLEmbedElement | HTMLFieldSetElement | HTMLFormElement | HTMLHeadElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLImageElement | HTMLLegendElement | HTMLLinkElement | HTMLMapElement | HTMLMenuElement | HTMLMetaElement | HTMLMeterElement | HTMLOptGroupElement | HTMLOptionElement | HTMLOutputElement | HTMLPictureElement | HTMLPreElement | HTMLProgressElement | HTMLScriptElement | HTMLSelectElement | HTMLSlotElement | HTMLSourceElement | HTMLStyleElement | HTMLTableElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTemplateElement | HTMLTextAreaElement | HTMLTimeElement | HTMLTitleElement | HTMLTableRowElement | HTMLTrackElement | HTMLVideoElement>, "id" | "onResize"> & {
|
|
996
997
|
className?: string;
|
|
997
998
|
collapsedSize?: number | undefined;
|
|
998
999
|
collapsible?: boolean | undefined;
|