@sito/dashboard 0.0.65 → 0.0.67
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 +3 -2
- package/dist/Badge-CIeYthEy.js +9 -0
- package/dist/Badge-Z78MlGoQ.cjs +1 -0
- package/dist/Badge.cjs +1 -0
- package/dist/Badge.css +1 -0
- package/dist/Badge.d.ts +2 -0
- package/dist/Badge.js +4 -0
- package/dist/Button-BlYa3uPc.cjs +1 -0
- package/dist/Button-D73-swfo.js +24 -0
- package/dist/Button.cjs +1 -0
- package/dist/Button.css +1 -0
- package/dist/Button.d.ts +2 -0
- package/dist/Button.js +4 -0
- package/dist/Chip-C5ogKbFn.js +37 -0
- package/dist/Chip-D17UJHW6.cjs +1 -0
- package/dist/Chip.cjs +1 -0
- package/dist/Chip.css +1 -0
- package/dist/Chip.d.ts +2 -0
- package/dist/Chip.js +4 -0
- package/dist/Close-O9P7wJGf.cjs +1 -0
- package/dist/Close-rKC9AcNX.js +17 -0
- package/dist/Dropdown-CAxauIXt.cjs +1 -0
- package/dist/Dropdown-CbaxuMbk.js +63 -0
- package/dist/Dropdown.cjs +1 -0
- package/dist/Dropdown.css +1 -0
- package/dist/Dropdown.d.ts +2 -0
- package/dist/Dropdown.js +4 -0
- package/dist/File-BuJndWMv.js +17 -0
- package/dist/File-_Hjw2d3F.cjs +1 -0
- package/dist/FileInput-Ch-GCxrS.cjs +1 -0
- package/dist/FileInput-DCR_Pyqe.js +91 -0
- package/dist/FileInput.css +1 -0
- package/dist/Filters-DL5jd8ps.js +78 -0
- package/dist/Filters-Dyee8QYH.cjs +1 -0
- package/dist/FiltersProvider-CY2fsw_F.js +57 -0
- package/dist/FiltersProvider-CYqLFEI9.cjs +1 -0
- package/dist/FiltersProvider.cjs +1 -0
- package/dist/FiltersProvider.d.ts +2 -0
- package/dist/FiltersProvider.js +8 -0
- package/dist/Form.cjs +1 -0
- package/dist/Form.d.ts +2 -0
- package/dist/Form.js +13 -0
- package/dist/IconButton-BpsTEj0z.js +29 -0
- package/dist/IconButton-CVnmT2E9.cjs +1 -0
- package/dist/IconButton.cjs +1 -0
- package/dist/IconButton.css +1 -0
- package/dist/IconButton.d.ts +2 -0
- package/dist/IconButton.js +4 -0
- package/dist/Loading-B_c_4XLr.js +26 -0
- package/dist/Loading-CNECRan-.cjs +1 -0
- package/dist/Loading.cjs +1 -0
- package/dist/Loading.css +1 -0
- package/dist/Loading.d.ts +2 -0
- package/dist/Loading.js +4 -0
- package/dist/SvgIcons.cjs +1 -0
- package/dist/SvgIcons.d.ts +2 -0
- package/dist/SvgIcons.js +13 -0
- package/dist/Table-BtZGG0d7.js +1056 -0
- package/dist/Table-DjIhOMXQ.cjs +1 -0
- package/dist/Table.cjs +1 -0
- package/dist/Table.css +1 -0
- package/dist/Table.d.ts +2 -0
- package/dist/Table.js +18 -0
- package/dist/TableOptions.cjs +1 -0
- package/dist/TableOptions.d.ts +2 -0
- package/dist/TableOptions.js +5 -0
- package/dist/TableOptionsProvider-BchUDA3B.cjs +1 -0
- package/dist/TableOptionsProvider-BfQS8l1N.js +50 -0
- package/dist/TextInput-BqW5YX-3.js +320 -0
- package/dist/TextInput-CY1fh4mf.cjs +1 -0
- package/dist/TextInput.css +1 -0
- package/dist/Tooltip-B4E-FRwY.js +37 -0
- package/dist/Tooltip-BSKAgRkc.cjs +1 -0
- package/dist/Tooltip.cjs +1 -0
- package/dist/Tooltip.css +1 -0
- package/dist/Tooltip.d.ts +2 -0
- package/dist/Tooltip.js +4 -0
- package/dist/Translation.cjs +1 -0
- package/dist/Translation.d.ts +2 -0
- package/dist/Translation.js +5 -0
- package/dist/TranslationProvider-51Pc9Xrr.cjs +1 -0
- package/dist/TranslationProvider-COebIyxr.js +19 -0
- package/dist/components/Actions/Action.d.ts +18 -0
- package/dist/components/Actions/Actions.d.ts +14 -0
- package/dist/components/Actions/Actions.stories.d.ts +20 -0
- package/dist/components/Actions/Actions.test.d.ts +1 -0
- package/dist/components/Actions/ActionsDropdown.d.ts +10 -0
- package/dist/components/Actions/ActionsDropdown.stories.d.ts +17 -0
- package/dist/components/Actions/ActionsDropdown.test.d.ts +1 -0
- package/dist/components/Actions/index.d.ts +4 -0
- package/dist/components/Actions/types.d.ts +17 -0
- package/dist/components/Button/Button.stories.d.ts +1 -0
- package/dist/components/Dropdown/Dropdown.d.ts +1 -1
- package/dist/components/Dropdown/Dropdown.stories.d.ts +1 -0
- package/dist/components/Dropdown/types.d.ts +1 -0
- package/dist/components/Form/FileInput/FileInput.test.d.ts +1 -0
- package/dist/components/Form/TextInput/TextInput.stories.d.ts +1 -0
- package/dist/components/Form/TextInput/TextInput.test.d.ts +1 -0
- package/dist/components/IconButton/IconButton.stories.d.ts +1 -0
- package/dist/components/SvgIcons/Ellipsis.d.ts +7 -0
- package/dist/components/SvgIcons/index.d.ts +1 -0
- package/dist/components/Table/Table.stories.d.ts +1 -0
- package/dist/components/Table/types.d.ts +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/index.cjs +1 -0
- package/dist/index.css +1 -0
- package/dist/index.js +74 -0
- package/dist/lib.cjs +1 -0
- package/dist/lib.d.ts +2 -0
- package/dist/lib.js +6 -0
- package/dist/query-81BrXp3i.cjs +1 -0
- package/dist/query-CwuehjY1.js +4 -0
- package/dist/setupTests.d.ts +0 -0
- package/package.json +83 -9
- package/dist/dashboard.cjs +0 -1
- package/dist/dashboard.js +0 -1661
- package/dist/main.css +0 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BaseDto } from '../../lib';
|
|
2
|
+
import { ActionPropsType } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Renders a single action button with optional icon, tooltip, and label.
|
|
5
|
+
* @param props - Component props.
|
|
6
|
+
* @param props.id - Unique identifier for the button element.
|
|
7
|
+
* @param props.icon - Icon rendered inside the button.
|
|
8
|
+
* @param props.tooltip - Accessible label shown as a tooltip or as visible text when `showText` is true.
|
|
9
|
+
* @param props.onClick - Callback fired when the button is clicked.
|
|
10
|
+
* @param props.children - Optional child elements rendered inside the button.
|
|
11
|
+
* @param props.hidden - When `true`, the button is not rendered. Defaults to `false`.
|
|
12
|
+
* @param props.disabled - When `true`, the button is disabled. Defaults to `false`.
|
|
13
|
+
* @param props.showText - When `true`, `tooltip` is rendered as visible text next to the icon. Defaults to `false`.
|
|
14
|
+
* @param props.showTooltips - When `false`, the tooltip is suppressed. Defaults to `true`.
|
|
15
|
+
* @param props.className - Additional CSS class applied to the button.
|
|
16
|
+
* @returns The action button element, or `null` when `hidden` is `true`.
|
|
17
|
+
*/
|
|
18
|
+
export declare function Action<TEntity extends BaseDto>(props: ActionPropsType<TEntity>): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseDto } from '../../lib';
|
|
2
|
+
import { ActionsContainerPropsType } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Renders a list of {@link Action} buttons from an array of action definitions.
|
|
5
|
+
* @param props - Component props.
|
|
6
|
+
* @param props.actions - Array of action definitions to render. Defaults to `[]`.
|
|
7
|
+
* @param props.className - Additional CSS class applied to the `<ul>` container.
|
|
8
|
+
* @param props.itemClassName - Additional CSS class applied to each `<li>` item.
|
|
9
|
+
* @param props.actionClassName - Additional CSS class applied to each `Action` button.
|
|
10
|
+
* @param props.showTooltips - Whether to show tooltips on each action. Defaults to `true`.
|
|
11
|
+
* @param props.showActionTexts - Whether to render the action label as visible text. Defaults to `false`.
|
|
12
|
+
* @returns A `<ul>` element containing one `<li>` per action.
|
|
13
|
+
*/
|
|
14
|
+
export declare function Actions<TRow extends BaseDto>(props: ActionsContainerPropsType<TRow>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
import { Actions } from './Actions';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: typeof Actions;
|
|
6
|
+
tags: string[];
|
|
7
|
+
args: {
|
|
8
|
+
showActionTexts: false;
|
|
9
|
+
actions: {
|
|
10
|
+
id: string;
|
|
11
|
+
tooltip: string;
|
|
12
|
+
icon: import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
onClick: () => void;
|
|
14
|
+
}[];
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export default meta;
|
|
18
|
+
type Story = StoryObj<typeof meta>;
|
|
19
|
+
export declare const Basic: Story;
|
|
20
|
+
export declare const WithText: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BaseDto } from '../../lib';
|
|
2
|
+
import { ActionsContainerPropsType } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Renders an ellipsis trigger button that opens a {@link Dropdown} containing an {@link Actions} list.
|
|
5
|
+
* @param props - Component props.
|
|
6
|
+
* @param props.actions - Array of action definitions displayed inside the dropdown. Defaults to `[]`.
|
|
7
|
+
* @param props.className - Additional CSS class applied to the root container.
|
|
8
|
+
* @returns A container with an ellipsis `IconButton` and a `Dropdown` holding the actions list.
|
|
9
|
+
*/
|
|
10
|
+
export declare const ActionsDropdown: <TRow extends BaseDto>(props: ActionsContainerPropsType<TRow>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: <TRow extends import('../../lib').BaseDto>(props: import('./types').ActionsContainerPropsType<TRow>) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
tags: string[];
|
|
6
|
+
args: {
|
|
7
|
+
actions: {
|
|
8
|
+
id: string;
|
|
9
|
+
tooltip: string;
|
|
10
|
+
icon: import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
onClick: () => void;
|
|
12
|
+
}[];
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export default meta;
|
|
16
|
+
type Story = StoryObj<typeof meta>;
|
|
17
|
+
export declare const Basic: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ActionType } from '..';
|
|
2
|
+
import { BaseDto } from '../../lib';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
export type ActionsContainerPropsType<TRow extends BaseDto> = {
|
|
5
|
+
actions: ActionPropsType<TRow>[];
|
|
6
|
+
className?: string;
|
|
7
|
+
itemClassName?: string;
|
|
8
|
+
actionClassName?: string;
|
|
9
|
+
showActionTexts?: boolean;
|
|
10
|
+
showTooltips?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export interface ActionPropsType<TRow extends BaseDto> extends ActionType<TRow> {
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
showText?: boolean;
|
|
15
|
+
showTooltips?: boolean;
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
@@ -4,4 +4,4 @@ import { DropdownPropsType } from './types';
|
|
|
4
4
|
* @param props - props parameter.
|
|
5
5
|
* @returns Function result.
|
|
6
6
|
*/
|
|
7
|
-
export declare const Dropdown: (props: DropdownPropsType) => import(
|
|
7
|
+
export declare const Dropdown: (props: DropdownPropsType) => import('react').ReactPortal;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -13,5 +13,6 @@ export declare const WithAutocompleteFilter: Story;
|
|
|
13
13
|
export declare const WithControlledFiltersDropdown: Story;
|
|
14
14
|
export declare const WithSimpleActions: Story;
|
|
15
15
|
export declare const WithMultipleActions: Story;
|
|
16
|
+
export declare const WithStickyAndDropdownActions: Story;
|
|
16
17
|
export declare const WithExpandableRows: Story;
|
|
17
18
|
export declare const WithMultipleExpandableRows: Story;
|
|
@@ -9,6 +9,7 @@ export type ActionType<TRow extends BaseDto> = {
|
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
hidden?: boolean;
|
|
11
11
|
multiple?: boolean;
|
|
12
|
+
sticky?: boolean;
|
|
12
13
|
onMultipleClick?: (rows: TRow[]) => void;
|
|
13
14
|
};
|
|
14
15
|
export interface TablePropsType<TRow extends BaseDto> extends TableHeaderPropsType<TRow> {
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var b=require("./index.css");Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./lib.cjs"),s=require("./query-81BrXp3i.cjs"),e=require("./Table-DjIhOMXQ.cjs"),a=require("./Badge-Z78MlGoQ.cjs"),u=require("./Button-BlYa3uPc.cjs"),p=require("./Chip-D17UJHW6.cjs"),c=require("./Dropdown-CAxauIXt.cjs"),t=require("./TextInput-CY1fh4mf.cjs"),d=require("./FileInput-Ch-GCxrS.cjs"),C=require("./IconButton-CVnmT2E9.cjs"),T=require("./Loading-CNECRan-.cjs"),r=require("./Filters-Dyee8QYH.cjs"),F=require("./Close-O9P7wJGf.cjs"),v=require("./File-_Hjw2d3F.cjs"),h=require("./Tooltip-BSKAgRkc.cjs"),o=require("./FiltersProvider-CYqLFEI9.cjs"),i=require("./TableOptionsProvider-BchUDA3B.cjs"),n=require("./TranslationProvider-51Pc9Xrr.cjs");exports.FilterTypes=l.FilterTypes;exports.SortOrder=s.SortOrder;exports.Action=e.Action;exports.Actions=e.Actions;exports.ActionsDropdown=e.ActionsDropdown;exports.ActiveFilters=e.ActiveFilters;exports.ArrayChip=e.ArrayChip;exports.Columns=e.Columns;exports.CountOfTotal=e.CountOfTotal;exports.FilterDropdown=e.FilterDropdown;exports.Footer=e.Footer;exports.Navigation=e.Navigation;exports.PageSize=e.PageSize;exports.RangeChip=e.RangeChip;exports.Rows=e.Rows;exports.Table=e.Table;exports.TableEmpty=e.TableEmpty;exports.TableHeader=e.TableHeader;exports.TableSelectionBar=e.TableSelectionBar;exports.renderFilterComponent=e.renderFilterComponent;exports.Badge=a.Badge;exports.Button=u.Button;exports.Chip=p.Chip;exports.Dropdown=c.Dropdown;exports.AutocompleteInput=t.AutocompleteInput;exports.CheckInput=t.CheckInput;exports.SelectInput=t.SelectInput;exports.State=t.State;exports.TextInput=t.TextInput;exports.helperTextStateClassName=t.helperTextStateClassName;exports.inputStateClassName=t.inputStateClassName;exports.labelStateClassName=t.labelStateClassName;exports.FileInput=d.FileInput;exports.IconButton=C.IconButton;exports.Loading=T.Loading;exports.ChevronDown=r.ChevronDown;exports.ChevronLeft=r.ChevronLeft;exports.ChevronRight=r.ChevronRight;exports.ChevronUp=r.ChevronUp;exports.Ellipsis=r.Ellipsis;exports.Filters=r.Filters;exports.Close=F.Close;exports.File=v.File;exports.Tooltip=h.Tooltip;exports.FiltersActions=o.FiltersActions;exports.FiltersProvider=o.FiltersProvider;exports.filtersReducer=o.filtersReducer;exports.initializer=o.initializer;exports.useFilters=o.useFilters;exports.TableOptionsProvider=i.TableOptionsProvider;exports.useTableOptions=i.useTableOptions;exports.TranslationProvider=n.TranslationProvider;exports.useTranslation=n.useTranslation;
|
package/dist/index.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-font-weight:initial;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-blue-800:oklch(42.4% .199 265.638);--color-gray-500:oklch(55.1% .027 264.364);--spacing:.25rem;--container-sm:24rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--font-weight-semibold:600;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.visible{visibility:visible}.relative{position:relative}.static{position:static}.sticky{position:sticky}.start{inset-inline-start:var(--spacing)}.end{inset-inline-end:var(--spacing)}.container{width:100%}@media(min-width:28rem){.container{max-width:28rem}}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mt-2{margin-top:calc(var(--spacing) * 2)}.\!hidden{display:none!important}.flex{display:flex}.hidden{display:none}.inline{display:inline}.table{display:table}.table-row{display:table-row}.h-3{height:calc(var(--spacing) * 3)}.h-4{height:calc(var(--spacing) * 4)}.w-3{width:calc(var(--spacing) * 3)}.w-4{width:calc(var(--spacing) * 4)}.w-full{width:100%}.w-px{width:1px}.max-w-sm{max-width:var(--container-sm)}.min-w-48{min-width:calc(var(--spacing) * 48)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.resize{resize:both}.flex-col{flex-direction:column}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.gap-1{gap:calc(var(--spacing) * 1)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}.stroke-blue-800{stroke:var(--color-blue-800)}.p-2{padding:calc(var(--spacing) * 2)}.p-4{padding:calc(var(--spacing) * 4)}.p-10{padding:calc(var(--spacing) * 10)}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.text-gray-500{color:var(--color-gray-500)}.capitalize{text-transform:capitalize}.opacity-70{opacity:.7}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}.input-normal{border-color:var(--color-border,#ccc);color:var(--color-text,#0d0d0d)}.input-normal:focus{border-color:var(--color-primary,#041e42)}.input-label-error{color:var(--color-secondary,#cd212a)}.input-label-good{color:var(--color-bg-success,#1d9a5b)}.input-label-normal{color:var(--color-text-muted,#4d4d4d)}.input-label-normal:is(:where(.peer):focus~*){color:var(--color-primary,#041e42)}.input-helper-text-error{color:var(--color-bg-error,#c14444)}.input-helper-text-good{color:var(--color-bg-success,#1d9a5b)}.input-helper-text-normal{color:var(--color-text-muted,#4d4d4d)}.autocomplete-suggestions-container{background-color:var(--color-base-light,#fff)}.autocomplete-suggestion-item:hover{background-color:var(--color-base-dark,#e6e6e6)}.autocomplete-delete-button{color:var(--color-text,#0d0d0d)}@media(hover:hover){.autocomplete-delete-button:hover{color:var(--color-secondary,#cd212a)}}.chip-main{background-color:var(--color-base-dark,#e6e6e6);color:var(--color-text,#0d0d0d)}.chip-delete-button:hover{color:var(--color-secondary,#cd212a)}.badge-main{background-color:var(--color-bg-error,#c14444);color:var(--color-error,#fbfbfb)}.table-loading{background-color:var(--color-base-light,#fff)}.table-row{border-bottom-color:var(--color-border,#ccc);background-color:var(--color-base-light,#fff)}.table-headers-row{background-color:var(--color-base,#f2f2f2);color:var(--color-text-muted,#4d4d4d)}.table-content{color:var(--color-text-muted,#4d4d4d)}.table-row-cell.basic{color:var(--color-text,#0d0d0d)}.table-navigation-buttons:disabled{color:var(--color-text-muted,#4d4d4d)}.filter-popup{background-color:var(--color-base-light,#fff)}.filter-dropdown-submit,.filter-dropdown-cancel{border-color:var(--color-border,#ccc);background-color:var(--color-base-light,#fff);color:var(--color-text-muted,#4d4d4d)}@media(hover:hover){:is(.filter-dropdown-submit,.filter-dropdown-cancel):hover{border-color:var(--color-text-muted,#4d4d4d);color:var(--color-text,#0d0d0d)}}.filter-dropdown-trigger{border-color:var(--color-border,#ccc);background-color:var(--color-base-light,#fff);color:var(--color-text-muted,#4d4d4d)}@media(hover:hover){.filter-dropdown-trigger:hover{border-color:var(--color-text-muted,#4d4d4d);color:var(--color-text,#0d0d0d)}}.filter-title{color:var(--color-text-muted,#4d4d4d)}.filter-footer{border-color:var(--color-border,#ccc);background-color:var(--color-base,#f2f2f2)}.table-headers-cell{border-color:var(--color-border,#ccc)}@media(hover:hover){.table-headers-cell:hover{background-color:var(--color-base-dark,#e6e6e6)}}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import "./index.css";
|
|
2
|
+
import { FilterTypes as o } from "./lib.js";
|
|
3
|
+
import { S as t } from "./query-CwuehjY1.js";
|
|
4
|
+
import { h as p, i as n, j as l, A as m, a as f, C as x, b as C, F as u, c as T, N as F, P as c, R as d, d as h, g as S, T as b, e as v, f as A, r as g } from "./Table-BtZGG0d7.js";
|
|
5
|
+
import { B } from "./Badge-CIeYthEy.js";
|
|
6
|
+
import { B as D } from "./Button-D73-swfo.js";
|
|
7
|
+
import { C as P } from "./Chip-C5ogKbFn.js";
|
|
8
|
+
import { D as O } from "./Dropdown-CbaxuMbk.js";
|
|
9
|
+
import { A as E, C as L, S as z, a as j, T as k, h as H, i as U, l as q } from "./TextInput-BqW5YX-3.js";
|
|
10
|
+
import { F as J } from "./FileInput-DCR_Pyqe.js";
|
|
11
|
+
import { I as M } from "./IconButton-BpsTEj0z.js";
|
|
12
|
+
import { L as V } from "./Loading-B_c_4XLr.js";
|
|
13
|
+
import { C as X, a as Y, b as Z, c as _, E as $, F as aa } from "./Filters-DL5jd8ps.js";
|
|
14
|
+
import { C as sa } from "./Close-rKC9AcNX.js";
|
|
15
|
+
import { F as ra } from "./File-BuJndWMv.js";
|
|
16
|
+
import { T as ia } from "./Tooltip-B4E-FRwY.js";
|
|
17
|
+
import { a as na, F as la, f as ma, i as fa, u as xa } from "./FiltersProvider-CY2fsw_F.js";
|
|
18
|
+
import { T as ua, u as Ta } from "./TableOptionsProvider-BfQS8l1N.js";
|
|
19
|
+
import { T as ca, u as da } from "./TranslationProvider-COebIyxr.js";
|
|
20
|
+
export {
|
|
21
|
+
p as Action,
|
|
22
|
+
n as Actions,
|
|
23
|
+
l as ActionsDropdown,
|
|
24
|
+
m as ActiveFilters,
|
|
25
|
+
f as ArrayChip,
|
|
26
|
+
E as AutocompleteInput,
|
|
27
|
+
B as Badge,
|
|
28
|
+
D as Button,
|
|
29
|
+
L as CheckInput,
|
|
30
|
+
X as ChevronDown,
|
|
31
|
+
Y as ChevronLeft,
|
|
32
|
+
Z as ChevronRight,
|
|
33
|
+
_ as ChevronUp,
|
|
34
|
+
P as Chip,
|
|
35
|
+
sa as Close,
|
|
36
|
+
x as Columns,
|
|
37
|
+
C as CountOfTotal,
|
|
38
|
+
O as Dropdown,
|
|
39
|
+
$ as Ellipsis,
|
|
40
|
+
ra as File,
|
|
41
|
+
J as FileInput,
|
|
42
|
+
u as FilterDropdown,
|
|
43
|
+
o as FilterTypes,
|
|
44
|
+
aa as Filters,
|
|
45
|
+
na as FiltersActions,
|
|
46
|
+
la as FiltersProvider,
|
|
47
|
+
T as Footer,
|
|
48
|
+
M as IconButton,
|
|
49
|
+
V as Loading,
|
|
50
|
+
F as Navigation,
|
|
51
|
+
c as PageSize,
|
|
52
|
+
d as RangeChip,
|
|
53
|
+
h as Rows,
|
|
54
|
+
z as SelectInput,
|
|
55
|
+
t as SortOrder,
|
|
56
|
+
j as State,
|
|
57
|
+
S as Table,
|
|
58
|
+
b as TableEmpty,
|
|
59
|
+
v as TableHeader,
|
|
60
|
+
ua as TableOptionsProvider,
|
|
61
|
+
A as TableSelectionBar,
|
|
62
|
+
k as TextInput,
|
|
63
|
+
ia as Tooltip,
|
|
64
|
+
ca as TranslationProvider,
|
|
65
|
+
ma as filtersReducer,
|
|
66
|
+
H as helperTextStateClassName,
|
|
67
|
+
fa as initializer,
|
|
68
|
+
U as inputStateClassName,
|
|
69
|
+
q as labelStateClassName,
|
|
70
|
+
g as renderFilterComponent,
|
|
71
|
+
xa as useFilters,
|
|
72
|
+
Ta as useTableOptions,
|
|
73
|
+
da as useTranslation
|
|
74
|
+
};
|
package/dist/lib.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./query-81BrXp3i.cjs");var c=(t=>(t[t.text=0]="text",t[t.number=1]="number",t[t.select=2]="select",t[t.autocomplete=3]="autocomplete",t[t.date=4]="date",t[t.check=5]="check",t))(c||{});exports.SortOrder=o.SortOrder;exports.FilterTypes=c;
|
package/dist/lib.d.ts
ADDED
package/dist/lib.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { S as t } from "./query-CwuehjY1.js";
|
|
2
|
+
var o = /* @__PURE__ */ ((c) => (c[c.text = 0] = "text", c[c.number = 1] = "number", c[c.select = 2] = "select", c[c.autocomplete = 3] = "autocomplete", c[c.date = 4] = "date", c[c.check = 5] = "check", c))(o || {});
|
|
3
|
+
export {
|
|
4
|
+
o as FilterTypes,
|
|
5
|
+
t as SortOrder
|
|
6
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var C=(r=>(r.ASC="ASC",r.DESC="DESC",r))(C||{});exports.SortOrder=C;
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sito/dashboard",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.67",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "UI library with custom components for dashboards",
|
|
7
|
-
"main": "dist/
|
|
8
|
-
"module": "dist/
|
|
7
|
+
"main": "dist/index.cjs",
|
|
8
|
+
"module": "dist/index.js",
|
|
9
9
|
"types": "dist/index.d.ts",
|
|
10
10
|
"files": [
|
|
11
11
|
"dist/"
|
|
@@ -21,8 +21,78 @@
|
|
|
21
21
|
"exports": {
|
|
22
22
|
".": {
|
|
23
23
|
"types": "./dist/index.d.ts",
|
|
24
|
-
"import": "./dist/
|
|
25
|
-
"require": "./dist/
|
|
24
|
+
"import": "./dist/index.js",
|
|
25
|
+
"require": "./dist/index.cjs"
|
|
26
|
+
},
|
|
27
|
+
"./Badge": {
|
|
28
|
+
"types": "./dist/components/Badge/index.d.ts",
|
|
29
|
+
"import": "./dist/Badge.js",
|
|
30
|
+
"require": "./dist/Badge.cjs"
|
|
31
|
+
},
|
|
32
|
+
"./Button": {
|
|
33
|
+
"types": "./dist/components/Button/index.d.ts",
|
|
34
|
+
"import": "./dist/Button.js",
|
|
35
|
+
"require": "./dist/Button.cjs"
|
|
36
|
+
},
|
|
37
|
+
"./Chip": {
|
|
38
|
+
"types": "./dist/components/Chip/index.d.ts",
|
|
39
|
+
"import": "./dist/Chip.js",
|
|
40
|
+
"require": "./dist/Chip.cjs"
|
|
41
|
+
},
|
|
42
|
+
"./Dropdown": {
|
|
43
|
+
"types": "./dist/components/Dropdown/index.d.ts",
|
|
44
|
+
"import": "./dist/Dropdown.js",
|
|
45
|
+
"require": "./dist/Dropdown.cjs"
|
|
46
|
+
},
|
|
47
|
+
"./Form": {
|
|
48
|
+
"types": "./dist/components/Form/index.d.ts",
|
|
49
|
+
"import": "./dist/Form.js",
|
|
50
|
+
"require": "./dist/Form.cjs"
|
|
51
|
+
},
|
|
52
|
+
"./IconButton": {
|
|
53
|
+
"types": "./dist/components/IconButton/index.d.ts",
|
|
54
|
+
"import": "./dist/IconButton.js",
|
|
55
|
+
"require": "./dist/IconButton.cjs"
|
|
56
|
+
},
|
|
57
|
+
"./Loading": {
|
|
58
|
+
"types": "./dist/components/Loading/index.d.ts",
|
|
59
|
+
"import": "./dist/Loading.js",
|
|
60
|
+
"require": "./dist/Loading.cjs"
|
|
61
|
+
},
|
|
62
|
+
"./SvgIcons": {
|
|
63
|
+
"types": "./dist/components/SvgIcons/index.d.ts",
|
|
64
|
+
"import": "./dist/SvgIcons.js",
|
|
65
|
+
"require": "./dist/SvgIcons.cjs"
|
|
66
|
+
},
|
|
67
|
+
"./Table": {
|
|
68
|
+
"types": "./dist/components/Table/index.d.ts",
|
|
69
|
+
"import": "./dist/Table.js",
|
|
70
|
+
"require": "./dist/Table.cjs"
|
|
71
|
+
},
|
|
72
|
+
"./Tooltip": {
|
|
73
|
+
"types": "./dist/components/Tooltip/index.d.ts",
|
|
74
|
+
"import": "./dist/Tooltip.js",
|
|
75
|
+
"require": "./dist/Tooltip.cjs"
|
|
76
|
+
},
|
|
77
|
+
"./FiltersProvider": {
|
|
78
|
+
"types": "./dist/providers/FiltersProvider/index.d.ts",
|
|
79
|
+
"import": "./dist/FiltersProvider.js",
|
|
80
|
+
"require": "./dist/FiltersProvider.cjs"
|
|
81
|
+
},
|
|
82
|
+
"./TableOptions": {
|
|
83
|
+
"types": "./dist/providers/TableOptions/index.d.ts",
|
|
84
|
+
"import": "./dist/TableOptions.js",
|
|
85
|
+
"require": "./dist/TableOptions.cjs"
|
|
86
|
+
},
|
|
87
|
+
"./Translation": {
|
|
88
|
+
"types": "./dist/providers/Translation/index.d.ts",
|
|
89
|
+
"import": "./dist/Translation.js",
|
|
90
|
+
"require": "./dist/Translation.cjs"
|
|
91
|
+
},
|
|
92
|
+
"./lib": {
|
|
93
|
+
"types": "./dist/lib/index.d.ts",
|
|
94
|
+
"import": "./dist/lib.js",
|
|
95
|
+
"require": "./dist/lib.cjs"
|
|
26
96
|
}
|
|
27
97
|
},
|
|
28
98
|
"sideEffects": [
|
|
@@ -47,7 +117,8 @@
|
|
|
47
117
|
"author": "sito8943",
|
|
48
118
|
"license": "MIT",
|
|
49
119
|
"peerDependencies": {
|
|
50
|
-
"react": ">=18.2 <20"
|
|
120
|
+
"react": ">=18.2 <20",
|
|
121
|
+
"react-dom": ">=18.2 <20"
|
|
51
122
|
},
|
|
52
123
|
"lint-staged": {
|
|
53
124
|
"*.{ts,tsx}": [
|
|
@@ -57,10 +128,13 @@
|
|
|
57
128
|
"*.{js,jsx,css,json,md}": "prettier --write"
|
|
58
129
|
},
|
|
59
130
|
"devDependencies": {
|
|
131
|
+
"@fortawesome/free-solid-svg-icons": "^7.2.0",
|
|
132
|
+
"@fortawesome/react-fontawesome": "^3.2.0",
|
|
60
133
|
"@storybook/addon-a11y": "^10.2.10",
|
|
61
134
|
"@storybook/addon-docs": "^10.2.13",
|
|
62
135
|
"@storybook/react": "^10.2.10",
|
|
63
136
|
"@storybook/react-vite": "^10.2.10",
|
|
137
|
+
"@tailwindcss/postcss": "^4.0.0",
|
|
64
138
|
"@testing-library/jest-dom": "^6.6.3",
|
|
65
139
|
"@testing-library/react": "^16.3.0",
|
|
66
140
|
"@types/node": "^20.19.0",
|
|
@@ -69,7 +143,6 @@
|
|
|
69
143
|
"@typescript-eslint/eslint-plugin": "^8",
|
|
70
144
|
"@typescript-eslint/parser": "^8",
|
|
71
145
|
"@vitejs/plugin-react": "^4.7.0",
|
|
72
|
-
"autoprefixer": "10.4.16",
|
|
73
146
|
"baseline-browser-mapping": "^2.10.0",
|
|
74
147
|
"depcheck": "^1.4.7",
|
|
75
148
|
"eslint": "^10.0.1",
|
|
@@ -80,12 +153,13 @@
|
|
|
80
153
|
"husky": "^9.1.7",
|
|
81
154
|
"jsdom": "^26.1.0",
|
|
82
155
|
"lint-staged": "^16.2.7",
|
|
83
|
-
"postcss": "8.
|
|
156
|
+
"postcss": "^8.5.0",
|
|
84
157
|
"prettier": "^3.8.1",
|
|
85
158
|
"react": "18.3.1",
|
|
86
159
|
"react-dom": "18.3.1",
|
|
160
|
+
"react-hook-form": "^7.71.2",
|
|
87
161
|
"storybook": "^10.2.10",
|
|
88
|
-
"tailwindcss": "
|
|
162
|
+
"tailwindcss": "^4.0.0",
|
|
89
163
|
"typescript": "5.5.4",
|
|
90
164
|
"vite": "^7.3.1",
|
|
91
165
|
"vite-plugin-dts": "^4.5.4",
|
package/dist/dashboard.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var Ze=require("./main.css");Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),a=require("react"),oe=t=>{const{count:s,className:r=""}=t;return e.jsx("span",{className:`${r} badge-main`,children:s})},ie=t=>{const{children:s,type:r="button",variant:n="text",color:l="default",className:o="",...p}=t;return e.jsx("button",{type:r,className:`button ${n} ${l} ${o}`,...p,children:s})};function W(t){const{text:s,onDelete:r,children:n,icon:l,variant:o="default",iconClassName:p="",className:i="",textClassName:u=""}=t;return e.jsxs("div",{className:`chip-main ${o} ${r?"deletable":""} ${i}`,children:[e.jsx("span",{className:u,children:s}),n,r?e.jsx(B,{icon:l??e.jsx(Z,{}),className:`chip-delete-button ${p}`,onClick:r}):null]})}const Ie=t=>{const{children:s,open:r,onClose:n}=t,l=a.useRef(null),o=a.useCallback(i=>{const u=l.current;!r||!u||u.contains(i.target)||n()},[r,n]),p=a.useCallback(i=>{r&&i.key==="Escape"&&n()},[r,n]);return a.useEffect(()=>{if(r)return setTimeout(()=>l.current?.focus(),0),document.addEventListener("mousedown",o),document.addEventListener("keydown",p),()=>{document.removeEventListener("mousedown",o),document.removeEventListener("keydown",p)}},[r,o,p]),e.jsx("div",{ref:l,role:"menu","aria-hidden":!r,tabIndex:-1,className:`dropdown-main ${r?"opened":"closed"}`,onClick:i=>i.stopPropagation(),children:s})},ce=a.forwardRef(function(t,s){const{state:r,value:n,onChange:l,options:o=[],name:p="",id:i="",label:u="",containerClassName:d="",inputContainerClassName:h="",helperText:m="",placeholder:x="",multiple:c=!1,...j}=t,[w,S]=a.useState("");a.useEffect(()=>{if(!c&&n&&!Array.isArray(n)){S(String(n.value??n.name??""));return}S("")},[c,n]);const[g,$]=a.useState(!1),y=a.useMemo(()=>o.filter(b=>{const F=String(b.value??b.name).toLowerCase().includes(w?.toLowerCase());return Array.isArray(n)&&n.length?F&&!n.some(D=>D.id===b.id):n&&!Array.isArray(n)?F&&n.id!==b.id:F}),[o,n,w]),C=a.useRef(null),N=a.useRef(null),[T,k]=a.useState(!1),A=a.useRef(null);a.useEffect(()=>{const b=D=>{C.current&&!C.current.contains(D.target)&&$(!1)},F=D=>{D.key==="Escape"&&$(!1)};return document.addEventListener("mousedown",b),document.addEventListener("keydown",F),()=>{document.removeEventListener("mousedown",b),document.removeEventListener("keydown",F)}},[]);const E=a.useCallback(b=>{S(b.target.value)},[]),I=a.useCallback(b=>{b?c?(S(""),Array.isArray(n)&&n.length?l([...n,b]):l([b])):(S(String(b.name??b.value??"")),l(b)):l(null),$(!1)},[c,l,n]),M=a.useCallback(b=>{if(!Array.isArray(n)){l(null);return}const F=n.filter((D,f)=>f!==b);F.length?l(F):l(null)},[l,n]),U=a.useCallback(()=>{Array.isArray(n)&&l([n[0]])},[l,n]);return a.useLayoutEffect(()=>{const b=A.current?.offsetWidth??0,F=C.current?.offsetWidth??0;k(b>F*.4)},[n]),e.jsxs("div",{className:`autocomplete-input-container ${d}`,ref:C,children:[e.jsxs("div",{className:"autocomplete-value-input-container",children:[e.jsx(X,{state:r,name:p,id:i,value:w,onChange:E,placeholder:x,helperText:m,onFocus:()=>$(!0),label:u,containerClassName:`autocomplete-text-input ${h}`,ref:s??N,...j,children:!c&&n&&!Array.isArray(n)&&(n.value||n.name)&&e.jsx(B,{icon:e.jsx(Z,{}),className:"autocomplete-delete-button",onClick:b=>{I(),b.stopPropagation()}})}),c&&Array.isArray(n)&&n.length?e.jsx("ul",{ref:A,className:"autocomplete-value-container",children:T?e.jsxs(e.Fragment,{children:[e.jsx("li",{children:e.jsx(W,{text:n[0]?.value??n[0]?.name,onDelete:b=>{M(0),b.stopPropagation()}})}),n.length>1&&e.jsx("li",{children:e.jsx(W,{text:`+${n.length-1}`,onDelete:b=>{U(),b.stopPropagation()}})})]}):n.map((b,F)=>e.jsx("li",{children:e.jsx(W,{text:String(b.value??b.name),onDelete:D=>{M(F),D.stopPropagation()}})},b.id??b.value??b.name))}):null]}),g&&e.jsx("ul",{className:"autocomplete-suggestions-container",style:{width:C.current?.offsetWidth},children:y.map(b=>e.jsx("li",{className:"autocomplete-suggestion-item",onClick:F=>{I(b),F.stopPropagation()},children:b.value??b.name},b.id??b.value??b.name))})]})}),ue=a.forwardRef(function(t,s){const{checked:r,onChange:n,name:l="",id:o="",label:p="",containerClassName:i="",inputClassName:u="",labelClassName:d="",...h}=t;return e.jsxs("label",{className:`input-check-container ${i}`,children:[e.jsx("input",{id:o,ref:s,name:l,type:"checkbox",checked:r,onChange:n,className:`input-check ${u}`,...h}),e.jsx("span",{className:`input-check-label ${d}`,children:p})]})});function ae(t,s=25){if(t.length<=s)return t;const r=t.lastIndexOf(".");if(r===-1)return t.slice(0,s-3)+"...";const n=t.slice(0,r),l=t.slice(r),o=s-l.length-3;return n.slice(0,o)+"..."+l}const De=a.forwardRef(function(t,s){const{children:r,label:n,containerClassName:l="",inputClassName:o="",labelClassName:p="",helperText:i="",helperTextClassName:u="",iconClassName:d="",multiple:h=!1,onChange:m,onClear:x,...c}=t,[j,w]=a.useState([]),S=a.useCallback(C=>{if(C.target.files){const N=Array.from(C.target.files);w(T=>[...T,...N])}m?.(C)},[m]),g=a.useCallback(C=>{w(N=>{const T=N.filter((k,A)=>A!==C);return T.length===0&&x?.(),T})},[x]),$=a.useCallback(()=>{w([]),x?.()},[x]),y=a.useCallback(C=>{C.currentTarget.value=""},[]);return e.jsxs("div",{className:`file-input-container ${l}`,children:[j.length===0&&e.jsxs("label",{htmlFor:c.name,className:`${p}`,children:[n,e.jsx("input",{type:"file",ref:s,multiple:h,onClick:y,onChange:S,className:`file-input ${o}`,...c}),c.required?" *":""]}),j.length>1&&e.jsx("ul",{className:"file-preview-list",children:j.map((C,N)=>e.jsx("li",{children:e.jsx(G,{content:C.name,children:e.jsx(W,{text:ae(C.name,25),onDelete:()=>g(N)})})},`${C.name}-${C.lastModified}`))}),j.length===1&&e.jsxs("div",{className:"file-preview",children:[e.jsx(fe,{className:`file-icon ${d}`}),e.jsx(G,{content:j[0]?.name??"",children:e.jsx("span",{className:"!cursor-default",children:ae(j[0]?.name??"",25)})}),e.jsx(B,{icon:e.jsx(Z,{}),onClick:$,type:"button"})]}),r,!!i&&e.jsx("p",{className:`file-input-helper-text ${u}`,children:i})]})});var Q=(t=>(t.error="error",t.good="good",t.default="default",t))(Q||{});const ne=t=>{switch(t){case"error":return"input-error";case"good":return"input-good";default:return"input-normal"}},se=t=>{switch(t){case"error":return"input-label-error";case"good":return"input-label-good";default:return"input-label-normal"}},le=t=>{switch(t){case"error":return"input-helper-text-error";case"good":return"input-helper-text-good";default:return"input-helper-text-normal"}},Y=a.forwardRef(function(t,s){const{value:r,onChange:n,options:l,containerClassName:o="",inputClassName:p="",labelClassName:i="",helperText:u="",helperTextClassName:d="",label:h="",name:m="",id:x="",state:c=Q.default,children:j,...w}=t;return e.jsxs("div",{className:`select-input-container ${o}`,children:[e.jsx("select",{...w,id:x,ref:s,name:m,value:r,onChange:n,className:`select-input ${ne(c)} peer ${p}`,children:l?.map(S=>e.jsx("option",{value:S.id,children:S.value??S.name??S.id},S.id))}),e.jsx("label",{htmlFor:x,className:`select-input-label ${se(c)} ${i}`,children:h}),j,u&&e.jsx("p",{className:`select-input-helper-text ${le(c)} ${d}`,children:u})]})}),X=a.forwardRef(function(t,s){const{children:r,state:n=Q.default,label:l="",containerClassName:o="",inputClassName:p="",labelClassName:i="",helperText:u="",helperTextClassName:d="",value:h="",...m}=t;return e.jsxs("div",{className:`text-input-container ${o}`,children:[e.jsx("input",{ref:s,value:h,className:`text-input ${ne(n)} peer ${p} ${h?"has-value":""} ${m.placeholder?"has-placeholder":""}`,...m}),!!l&&e.jsxs("label",{htmlFor:m.id,className:`text-input-label ${se(n)} ${i}`,children:[l,m.required?" *":""]}),r,!!u&&e.jsx("p",{className:`text-input-helper-text ${le(n)} ${d}`,children:u})]})}),B=t=>{const{children:s,icon:r,type:n="button",className:l="",variant:o="text",color:p="default",iconClassName:i="",...u}=t;return e.jsxs("button",{type:n,className:`icon-button ${l} ${o} ${p}`,...u,children:[e.jsx("span",{className:i,children:r}),s]})};function de(t){const{color:s="stroke-blue-800",className:r="",loaderClass:n="",strokeWidth:l="4",...o}=t;return e.jsx("div",{...o,className:`loading ${r}`,children:e.jsx("div",{className:"loader-container",children:e.jsx("div",{className:`loader ${n}`,children:e.jsx("svg",{className:"circular",viewBox:"25 25 50 50",children:e.jsx("circle",{className:`path ${s}`,cx:"50",cy:"50",r:"20",fill:"none",strokeWidth:l,strokeMiterlimit:"10"})})})})})}function pe(t){const{className:s=""}=t;return e.jsx("svg",{className:s,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor",children:e.jsx("path",{d:"M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"})})}function he(t){const{className:s=""}=t;return e.jsx("svg",{className:s,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",fill:"currentColor",children:e.jsx("path",{d:"M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z"})})}function me(t){const{className:s=""}=t;return e.jsx("svg",{className:s,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",fill:"currentColor",children:e.jsx("path",{d:"M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256 73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z"})})}function xe(t){const{className:s=""}=t;return e.jsx("svg",{className:s,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor",children:e.jsx("path",{d:"M233.4 105.4c12.5-12.5 32.8-12.5 45.3 0l192 192c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L256 173.3 86.6 342.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l192-192z"})})}function Z(t){const{className:s=""}=t;return e.jsx("svg",{className:s,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",fill:"currentColor",children:e.jsx("path",{d:"M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"})})}function fe(t){const{className:s=""}=t;return e.jsx("svg",{className:s,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 640 640",fill:"currentColor",children:e.jsx("path",{d:"M192 64C156.7 64 128 92.7 128 128L128 512C128 547.3 156.7 576 192 576L448 576C483.3 576 512 547.3 512 512L512 234.5C512 217.5 505.3 201.2 493.3 189.2L386.7 82.7C374.7 70.7 358.5 64 341.5 64L192 64zM453.5 240L360 240C346.7 240 336 229.3 336 216L336 122.5L453.5 240z"})})}const be=t=>{const{className:s=""}=t;return e.jsx("svg",{className:s,viewBox:"0 0 16 16",children:e.jsx("path",{d:"M9 15H7a1 1 0 010-2h2a1 1 0 010 2zM11 11H5a1 1 0 010-2h6a1 1 0 010 2zM13 7H3a1 1 0 010-2h10a1 1 0 010 2zM15 3H1a1 1 0 010-2h14a1 1 0 010 2z"})})};var V=(t=>(t[t.text=0]="text",t[t.number=1]="number",t[t.select=2]="select",t[t.autocomplete=3]="autocomplete",t[t.date=4]="date",t[t.check=5]="check",t))(V||{}),H=(t=>(t.ASC="ASC",t.DESC="DESC",t))(H||{}),O=(t=>(t[t.update=0]="update",t[t.reset=1]="reset",t))(O||{});const te=t=>{if(t){const s={};return Object.keys(t)?.forEach(n=>{s[n]={value:t[n]}}),s}return{}};function Ce(t,s){const{type:r}=s;switch(r){case O.reset:return{};case O.update:{const{toUpdate:n}=s;return{...t,...n}}default:return t}}const je=a.createContext({}),ge=t=>{const{children:s}=t,{filters:r}=z(),[n,l]=a.useReducer(Ce,te(r));a.useEffect(()=>{l({type:O.reset});const p=te(r);Object.keys(p).length&&l({type:O.update,toUpdate:p})},[r]);const o={currentFilters:n,setCurrentFilters:l};return e.jsx(je.Provider,{value:o,children:s})},J=()=>{const t=a.useContext(je);if(t===void 0)throw new Error("tableOptionsContext must be used within a Provider");return t},_e=[20,50,100],ve=a.createContext({}),Be=t=>{const{children:s}=t,[r,n]=a.useState(0),[l,o]=a.useState(20),[p,i]=a.useState(0),[u,d]=a.useState("id"),[h,m]=a.useState(H.DESC),[x,c]=a.useState({}),j=a.useCallback((y,C)=>{let N=h;u===y&&(h===H.ASC?N=H.DESC:N=H.ASC),d(y),m(N),C&&C(y,N)},[u,h]),w=a.useCallback(y=>{const C=Object.entries(y).reduce((N,[T,k])=>(k&&typeof k.value<"u"&&k.value!==null&&(N[T]=k.value),N),{});c(C)},[]),S=a.useCallback(y=>{y?(delete x[y.toLowerCase()],c({...x})):c({})},[x]),g=a.useMemo(()=>Object.keys(x).length,[x]),$={onSort:j,total:r,setTotal:n,sortingBy:u,setSortingBy:d,sortingOrder:h,setSortingOrder:m,pageSize:l,pageSizes:_e,setPageSize:o,currentPage:p,setCurrentPage:i,filters:x,onFilterApply:w,clearFilters:S,countOfFilters:g};return e.jsx(ve.Provider,{value:$,children:s})},z=()=>{const t=a.useContext(ve);if(t===void 0)throw new Error("tableOptionsContext must be used within a Provider");return t},Ne=a.createContext({});function Ve(t){const{children:s,t:r,language:n}=t;return e.jsx(Ne.Provider,{value:{t:r,language:n},children:s})}const L=()=>{const t=a.useContext(Ne);if(t===void 0)throw new Error("translationContext must be used within a Provider");return t};function we(t){return[...t].sort((s,r)=>(r.pos??0)-(s.pos??0)).filter(s=>s.display!=="none")}function Se(t){const{t:s}=L(),{entity:r="",columns:n=[],hasAction:l=!0,onSortCallback:o,selectionState:p,onToggleAllRows:i}=t,u=a.useRef(null);a.useEffect(()=>{u.current&&(u.current.indeterminate=!!(p?.hasSomeSelected&&!p?.allSelected))},[p]);const{onSort:d,sortingOrder:h,sortingBy:m}=z(),x=a.useMemo(()=>we(n).map(c=>({id:c.key,label:c.label,className:c.className??"",sortable:c.sortable??!0,sortOptions:c.sortOptions})),[n,r,s]);return e.jsx("thead",{className:"table-headers-row",children:e.jsxs("tr",{children:[e.jsx("th",{scope:"col",className:"table-headers-column table-headers-checkbox",children:i?e.jsx("input",{type:"checkbox",ref:u,checked:p?.allSelected??!1,onChange:i,"aria-label":s("_accessibility:components.table.selectAllRows")}):null}),x.map(c=>e.jsx("th",{scope:"col",className:`table-headers-column ${c.className}`,children:e.jsxs(ie,{disabled:!c.sortable,onClick:()=>d(c.id,o),className:"table-headers-cell",children:[e.jsx("span",{className:"table-headers-label",children:c.label}),c.sortable&&m===c.id&&e.jsx("span",{children:h===H.ASC?c.sortOptions?.icons?.asc??e.jsx(xe,{className:c.sortOptions?.icons?.className??"table-headers-sort-indicator"}):c.sortOptions?.icons?.desc??e.jsx(pe,{className:c.sortOptions?.icons?.className??"table-headers-sort-indicator"})})]})},c.id)),l&&e.jsx("th",{scope:"col",className:"table-headers-action",children:e.jsx("span",{className:"button text default disabled",children:s("_accessibility:labels.actions")})})]})})}const ye=t=>{const{items:s,text:r,id:n,onClearFilter:l}=t;return e.jsx(W,{text:`${r}: ${s.map(o=>o.value??o.name).join(", ")}`,onDelete:()=>l(n)})},ke=t=>{const{end:s,start:r,text:n,id:l,onClearFilter:o}=t;return e.jsx(W,{text:`${n}: ${r||"♾️"} - ${s||"♾️"}`,onDelete:()=>o(l)})},Re=t=>{const{filtersDefinition:s}=t,r=a.useMemo(()=>{const i={};return s.forEach(u=>{i[u.propertyName]=u.label??u.propertyName}),i},[s]),{filters:n,clearFilters:l}=z(),o=a.useMemo(()=>Object.keys(n),[n]),p=a.useCallback(i=>n[i]?.end||n[i]?.start?e.jsx(ke,{id:i,text:r[i],start:n[i].start,end:n[i].end,onClearFilter:l}):Array.isArray(n[i])?e.jsx(ye,{id:i,text:r[i],items:n[i],onClearFilter:l}):e.jsx(W,{text:`${r[i]}: ${n[i]?.value??n[i]?.name??n[i]}`,onDelete:()=>l(i)}),[n,r]);return e.jsx("ul",{className:"active-filters-main",children:o?.map(i=>e.jsx("li",{children:p(i)},i))})};function We(t){const{propertyName:s,label:r,placeholder:n,options:l,multiple:o=!0}=t,{currentFilters:p,setCurrentFilters:i}=J(),u=a.useMemo(()=>p[s]??l[0],[p]),d=a.useCallback(h=>{i({type:O.update,toUpdate:{[s]:{value:h}}})},[o]);return e.jsx(ce,{value:u?.value,label:r,options:l,multiple:o,helperTextClassName:"hidden",containerClassName:"options-widget-container",onChange:d,placeholder:n})}const Ue=t=>{const{propertyName:s,label:r}=t,{currentFilters:n,setCurrentFilters:l}=J(),o=a.useMemo(()=>n[s]?.value??"",[n]),p=a.useCallback(i=>{l({type:O.update,toUpdate:{[s]:{value:i.target.checked}}})},[]);return e.jsx(ue,{label:r,checked:o??!1,onChange:p})};function qe(t){const{propertyName:s,options:r,label:n,placeholder:l}=t,{currentFilters:o,setCurrentFilters:p}=J(),i=a.useMemo(()=>o[s]?.value??r[0],[o]),u=a.useCallback(d=>{p({type:O.update,toUpdate:{[s]:{value:d.target.value}}})},[]);return e.jsx(Y,{value:i,label:n,options:r,helperTextClassName:"hidden",containerClassName:"options-widget-container",onChange:u,placeholder:l})}const He=t=>{const{propertyName:s,label:r,placeholder:n}=t,{currentFilters:l,setCurrentFilters:o}=J(),p=a.useMemo(()=>l[s]?.value??"",[l]),i=a.useCallback(u=>{o({type:O.update,toUpdate:{[s]:{value:u.target.value}}})},[]);return e.jsx(X,{value:p??"",label:r,onChange:i,containerClassName:"input-widget-container",helperTextClassName:"",placeholder:n})},re=t=>{const{propertyName:s,label:r,inputType:n}=t,{t:l}=L(),{currentFilters:o,setCurrentFilters:p}=J(),i=a.useRef(null),u=a.useRef(null),d=a.useCallback(m=>{p({type:O.update,toUpdate:{[s]:{value:{end:u?.current?.value??null,start:m.target.value}}}})},[]),h=a.useCallback(m=>{p({type:O.update,toUpdate:{[s]:{value:{start:i?.current?.value??null,end:m.target.value}}}})},[]);return e.jsxs("div",{className:"range-widget-container",children:[e.jsx("p",{className:"text-input-label input-widget-label input-label-normal",children:r}),e.jsxs("div",{className:"range-widget-row",children:[e.jsx(X,{value:o[s]?.value?.start??"",placeholder:l("_accessibility:components.table.filters.range.start"),type:n,ref:i,onChange:d,containerClassName:"input-widget-container",helperTextClassName:""}),e.jsx(X,{value:o[s]?.value?.end??"",placeholder:l("_accessibility:components.table.filters.range.end"),type:n,ref:u,onChange:h,containerClassName:"input-widget-container",helperTextClassName:""})]})]})},Ee=t=>{switch(t.type){case V.text:return e.jsx(He,{...t});case V.number:return e.jsx(re,{...t,inputType:"number"});case V.date:return e.jsx(re,{...t,inputType:"date"});case V.select:return e.jsx(qe,{...t});case V.autocomplete:return e.jsx(We,{...t});case V.check:return e.jsx(Ue,{...t})}return e.jsx(e.Fragment,{})},$e=t=>{const{filters:s=[],show:r,handleShow:n}=t,{onFilterApply:l}=z(),{currentFilters:o,setCurrentFilters:p}=J(),{t:i}=L(),u=a.useRef(null);return a.useEffect(()=>{const d=({target:m})=>{u.current&&(m?.closest(".filter-dropdown-trigger")||!r||u.current.contains(m)||n(!1))},h=({code:m})=>{!r||m!=="Escape"||n(!1)};return document.addEventListener("click",d),document.addEventListener("keydown",h),()=>{document.removeEventListener("click",d),document.removeEventListener("keydown",h)}},[n,r]),e.jsx("div",{className:`filter-dropdown-backdrop ${r?"opened":"closed"}`,children:e.jsxs("div",{className:"filter-popup",ref:u,children:[e.jsx("div",{className:"filter-title",children:i("_accessibility:buttons.filters")}),e.jsx("ul",{className:"filter-container",children:s.map(d=>e.jsx("li",{className:"filter-container-item",children:Ee(d)},d.propertyName))}),e.jsx("div",{className:"filter-footer",children:e.jsxs("ul",{className:"filter-buttons-row",children:[e.jsx("li",{children:e.jsx("button",{onClick:()=>p({type:O.reset,filters:s}),className:"filter-dropdown-button small filter-dropdown-cancel",children:i("_accessibility:buttons.clear")})}),e.jsx("li",{children:e.jsx("button",{className:"filter-dropdown-button small filter-dropdown-submit",onClick:()=>{n(!1),l(o)},children:i("_accessibility:buttons.applyFilters")})})]})})]})})},Te=()=>{const{t}=L(),{total:s,pageSize:r,pageSizes:n,currentPage:l}=z(),o=(l+1)*r>s?s:(l+1)*r;return e.jsxs("div",{className:"table-navigation-sizes",children:[n[0]<s&&e.jsx(e.Fragment,{children:e.jsxs("p",{children:[l*r+1," - ",o," ",t("_accessibility:components.table.of")]})}),e.jsx("p",{children:s})]})};function Je(){const{t}=L(),{total:s,pageSize:r,currentPage:n,setCurrentPage:l}=z(),o=a.useMemo(()=>{const p=Math.ceil(s/r);return Array.from({length:p},(i,u)=>({id:u,value:u+1}))},[s,r]);return e.jsxs("div",{className:"jump-to-page",children:[e.jsx("p",{children:t("_accessibility:components.table.jumpToPage")}),e.jsx(Y,{value:n,options:o,inputClassName:"jump-to-page-input",containerClassName:"jump-to-page-input-container",helperTextClassName:"hidden",onChange:p=>l(Number(p.target.value))})]})}const Ae=()=>{const{t}=L(),{total:s,pageSize:r,currentPage:n,setCurrentPage:l}=z();return e.jsxs("div",{className:"table-navigation-pages",children:[e.jsx(B,{icon:e.jsx(he,{className:"w-2.5"}),className:"table-navigation-buttons",disabled:n===0,"aria-label":t("_accessibility:buttons.previous"),name:t("_accessibility:buttons.previous"),onClick:()=>l(n-1)}),e.jsx(B,{icon:e.jsx(me,{className:"w-2.5"}),disabled:Math.floor(s/((n+1)*r))===0,className:"table-navigation-buttons",name:t("_accessibility:buttons.next"),"aria-label":t("_accessibility:buttons.next"),onClick:()=>l(n+1)})]})};function Fe(){const{t}=L(),{pageSizes:s,pageSize:r,setPageSize:n}=z(),l=a.useMemo(()=>s?.map(o=>({id:o,value:o})),[s]);return e.jsxs("div",{className:"page-size",children:[e.jsx("p",{children:t("_accessibility:components.table.pageSizes")}),e.jsx(Y,{value:r,options:l,inputClassName:"page-size-input",containerClassName:"page-size-input-container",helperTextClassName:"hidden",onChange:o=>n(Number(o.target.value))})]})}function Me(){return e.jsxs("div",{className:"table-footer",children:[e.jsx(Je,{}),e.jsx(Fe,{}),e.jsx(Te,{}),e.jsx(Ae,{})]})}const Ke=t=>t,Pe=t=>{const{t:s}=L(),{columns:r,softDeleteProperty:n="deletedAt",data:l,actions:o,selectedRows:p,expandedRows:i=[],onRowSelectionChange:u,onRowExpand:d}=t,h=a.useMemo(()=>we(r),[r]),m=a.useMemo(()=>new Map(i.map(x=>[x.rowId,x])),[i]);return l?.map(x=>{const c=p.has(x.id),j=m.get(x.id),w=!!j,S=h.length+1+(o?1:0);return e.jsxs(a.Fragment,{children:[e.jsxs("tr",{className:`table-row ${d?"expandable":""} ${x[n]?"deleted-class":""} ${c?"selected":""} ${w?"expanded":""}`,onClick:()=>d?.(x),children:[e.jsx("td",{className:"table-row-cell table-row-checkbox",children:e.jsx("input",{type:"checkbox",checked:c,onClick:g=>g.stopPropagation(),onChange:()=>u(x),"aria-label":s("_accessibility:components.table.selectRow")})}),h?.map((g,$)=>e.jsx("td",{className:`table-row-cell ${$===0?"basic":""} ${g.className??""}`,children:g.renderBody?g.renderBody(x[g.key],x):Ke(x[g.key])},g.key)),o?e.jsx("td",{children:e.jsx("div",{className:"table-row-cell-action",children:o(x).filter(g=>!g.hidden)?.map(g=>e.jsx(G,{content:g.tooltip,children:e.jsx(B,{icon:g.icon,className:"row-table-action",onClick:$=>{$.stopPropagation(),g.onClick(x)}})},g.id))})}):null]}),w&&j?.content!==null&&typeof j?.content<"u"&&e.jsx("tr",{className:"table-row-expanded",children:e.jsx("td",{className:"table-row-expanded-cell",colSpan:S,children:e.jsx("div",{className:`table-row-expanded-content ${j.isVisible?"open":"closed"}`,children:e.jsx("div",{className:"table-row-expanded-inner",children:j.content})})})})]},x.id)})};function Oe(){const{t}=L();return e.jsx("div",{className:"table-empty",children:e.jsx("p",{children:t("_accessibility:components.table.empty")})})}const Le=t=>{const{columns:s,title:r,isLoading:n,toolbar:l,filterOptions:o}=t,{countOfFilters:p}=z(),{t:i}=L(),u=a.useMemo(()=>s?s.sort((c,j)=>(j.pos??0)-(c.pos??0)).filter(c=>!!c.filterOptions).map(c=>({...c.filterOptions,label:c.filterOptions?.label??c.label,propertyName:c.key})):[],[s]),[d,h]=a.useState(!1),m=a.useCallback(c=>{o?.dropdown?.setOpened?o.dropdown.setOpened(c??!1):h(c??!1)},[o]),x=a.useMemo(()=>o?.dropdown?.opened??d,[o,d]);return e.jsxs("div",{className:`table-header ${x?"showing-filters":""}`,children:[e.jsxs("div",{children:[r&&e.jsx("h1",{className:"table-header-title",children:r}),n?null:e.jsxs("div",{className:"table-header-content",children:[l,o?.button?.hide!==!0&&e.jsxs(B,{icon:o?.button?.icon??e.jsx(be,{className:"filter-dropdown-trigger-icon"}),className:"filter-dropdown-button normal filter-dropdown-trigger","aria-haspopup":"true",onClick:()=>m(!x),"aria-expanded":x,children:[e.jsx(oe,{count:p,className:`${p>0?"show":"hide"} `}),e.jsx("span",{className:"sr-only",children:i("_accessibility:buttons.filters")}),e.jsx("wbr",{})]})]})]}),!!u&&!!u.length&&e.jsx($e,{filters:u,show:x,handleShow:m,options:o}),e.jsx(Re,{filtersDefinition:u})]})};function ze({count:t,multiActions:s,onActionClick:r}){const{t:n}=L();return e.jsxs("div",{className:"table-selection-bar",children:[e.jsx("p",{className:"table-selection-bar-count",children:n("_accessibility:components.table.selectedCount",{count:t})}),s.length>0&&e.jsx("div",{className:"table-selection-bar-actions",children:s.map(l=>e.jsx(G,{content:l.tooltip,children:e.jsx(B,{icon:l.icon,className:"multi-table-action",onClick:()=>r(l),disabled:l.disabled})},l.id))})]})}const ee=220;function Xe({data:t,allowMultipleExpandedRows:s,controlledExpandedRowId:r,onExpandedRowChange:n,onRowExpand:l,findRowById:o}){const[p,i]=a.useState(null),[u,d]=a.useState(null),[h,m]=a.useState(null),[x,c]=a.useState(null),[j,w]=a.useState(!1),[S,g]=a.useState(new Set),[$,y]=a.useState([]),C=a.useRef(null),N=a.useRef(null),T=a.useRef(new Map),k=typeof r<"u",A=s&&!k,E=k?r??null:p,I=a.useCallback(()=>{N.current&&(clearTimeout(N.current),N.current=null)},[]),M=a.useCallback(f=>{if(typeof f<"u"){const v=T.current.get(f);if(!v)return;clearTimeout(v),T.current.delete(f);return}T.current.forEach(v=>clearTimeout(v)),T.current.clear()},[]),U=a.useCallback(f=>{M(f),y(v=>v.some(P=>P.rowId===f)?v.map(P=>P.rowId===f?{...P,isVisible:!1}:P):v),T.current.set(f,setTimeout(()=>{y(v=>v.filter(R=>R.rowId!==f)),T.current.delete(f)},ee))},[M]),b=a.useCallback((f,v)=>{M(f),y(R=>R.some(_=>_.rowId===f)?R.map(_=>_.rowId===f?{..._,content:v,isVisible:!1}:_):[...R,{rowId:f,content:v,isVisible:!1}]),requestAnimationFrame(()=>{y(R=>R.map(P=>P.rowId===f?{...P,isVisible:!0}:P))})},[M]);a.useEffect(()=>{if(!A)return;const f=new Set(t.map(v=>v.id));g(v=>{const R=new Set;return v.forEach(P=>{if(f.has(P)){R.add(P);return}M(P)}),R}),y(v=>(v.forEach(R=>{f.has(R.rowId)||M(R.rowId)}),v.filter(R=>f.has(R.rowId))))},[t,A,M]),a.useEffect(()=>{if(A)return;if(E===null){d(null),k&&(C.current=null);return}o(E)||(k||i(null),d(null),k&&(C.current=null))},[t,E,o,k,A]),a.useEffect(()=>{if(!A){if(I(),E===null||u===null){if(h===null){w(!1),c(null);return}w(!1),N.current=setTimeout(()=>{m(null),c(null),N.current=null},ee);return}if(h===null){m(E),c(u),requestAnimationFrame(()=>w(!0));return}if(h===E){c(u),requestAnimationFrame(()=>w(!0));return}w(!1),N.current=setTimeout(()=>{m(E),c(u),requestAnimationFrame(()=>w(!0)),N.current=null},ee)}},[I,u,E,A,h]),a.useEffect(()=>()=>{I(),M()},[I,M]),a.useEffect(()=>{if(!k)return;if(E===null){d(null),C.current=null;return}const f=o(E);if(!f){d(null),C.current=null;return}const v=C.current;d(l?.(f,v)??null),C.current=f},[E,o,k,l]);const F=a.useCallback(f=>{if(A){if(S.has(f.id)){g(K=>{const q=new Set(K);return q.delete(f.id),q}),U(f.id),n?.(null,f);return}g(K=>{const q=new Set(K);return q.add(f.id),q});const _=l?.(f,null)??null;_!==null&&typeof _<"u"?b(f.id,_):(M(f.id),y(K=>K.filter(q=>q.rowId!==f.id))),n?.(f,null);return}const v=E===f.id,R=v?f:o(E);if(k){n?.(v?null:f,R);return}if(v){i(null),d(null),n?.(null,f);return}i(f.id),d(l?.(f,R)??null),n?.(f,R)},[E,U,M,b,o,S,k,A,n,l]);return{expandedRowsToRender:a.useMemo(()=>A?$:h===null||x===null||typeof x>"u"?[]:[{rowId:h,content:x,isVisible:j}],[j,A,x,h,$]),onRowExpandChange:F}}function Ge({actions:t,selectedRowsData:s}){const r=a.useMemo(()=>!t||!s.length?[]:s.reduce((l,o,p)=>{const i=t(o).filter(d=>d.multiple&&!d.hidden);if(p===0)return i;const u=new Map(l.map(d=>[d.id,d]));return i.reduce((d,h)=>{const m=u.get(h.id);return m&&d.push({...m,...h,disabled:h.disabled||m.disabled}),d},[])},[]),[t,s]),n=a.useCallback(l=>{if(s.length){if(l.onMultipleClick){l.onMultipleClick(s);return}s.forEach(o=>l.onClick(o))}},[s]);return{multiActions:r,handleMultipleActionClick:n}}function Qe({data:t,onRowSelect:s,onSelectedRowsChange:r}){const[n,l]=a.useState(new Set),o=a.useMemo(()=>t?.filter(d=>n.has(d.id))??[],[t,n]);a.useEffect(()=>{if(!t?.length){l(new Set);return}l(d=>{const h=new Set,m=new Set(t.map(x=>x.id));return d.forEach(x=>{m.has(x)&&h.add(x)}),h})},[t]),a.useEffect(()=>{r&&r(o)},[o,r]);const p=a.useCallback(d=>{l(h=>{const m=new Set(h);return m.has(d.id)?(m.delete(d.id),s?.(d,!1)):(m.add(d.id),s?.(d,!0)),m})},[s]),i=a.useCallback(()=>{l(d=>{const h=new Set(d),m=t??[],x=m.every(c=>h.has(c.id));return m.forEach(c=>{const j=h.has(c.id);x?j&&(h.delete(c.id),s?.(c,!1)):j||(h.add(c.id),s?.(c,!0))}),h})},[t,s]),u=a.useMemo(()=>{if(!t?.length)return{allSelected:!1,hasSomeSelected:!1};const d=t.every(m=>n.has(m.id)),h=t.some(m=>n.has(m.id));return{allSelected:d,hasSomeSelected:h}},[t,n]);return{selectedRows:n,selectedRowsData:o,selectionState:u,onRowSelectionChange:p,onToggleAllRows:i}}function Ye(t){const{data:s,onSort:r,entity:n="",isLoading:l=!1,actions:o,columns:p=[],contentClassName:i="",className:u="",softDeleteProperty:d="deletedAt",onRowSelect:h,onSelectedRowsChange:m,allowMultipleExpandedRows:x=!1,expandedRowId:c,onExpandedRowChange:j,onRowExpand:w,...S}=t,g=a.useMemo(()=>!s?.length,[s]),$=a.useCallback(U=>U===null?null:s.find(b=>b.id===U)??null,[s]),{selectedRows:y,selectedRowsData:C,selectionState:N,onRowSelectionChange:T,onToggleAllRows:k}=Qe({data:s,onRowSelect:h,onSelectedRowsChange:m}),{expandedRowsToRender:A,onRowExpandChange:E}=Xe({data:s,allowMultipleExpandedRows:x,controlledExpandedRowId:c,onExpandedRowChange:j,onRowExpand:w,findRowById:$}),{multiActions:I,handleMultipleActionClick:M}=Ge({actions:o,selectedRowsData:C});return e.jsx(ge,{children:e.jsxs("div",{className:`${u} table-main`,children:[e.jsx(Le,{columns:p,isLoading:l,...S}),l?e.jsx(de,{className:"table-loading"}):e.jsx(e.Fragment,{children:g?e.jsx(Oe,{}):e.jsxs(e.Fragment,{children:[!!C.length&&e.jsx(ze,{count:C.length,multiActions:I,onActionClick:M}),e.jsx("div",{className:`${i} table-body`,children:e.jsxs("table",{className:"table-content",children:[e.jsx(Se,{entity:n,columns:p,onSortCallback:r,hasAction:!!o,selectionState:N,onToggleAllRows:k}),e.jsx("tbody",{children:e.jsx(Pe,{data:s,actions:o,columns:p,softDeleteProperty:d,selectedRows:y,expandedRows:A,onRowSelectionChange:T,onRowExpand:w?E:void 0})})]})}),e.jsx(Me,{})]})})]})})}function G(t){const{content:s,children:r,className:n=""}=t,l=a.useId(),o=a.isValidElement(r)?a.cloneElement(r,{"aria-describedby":l}):r;return e.jsxs("div",{className:`tooltip-container ${n}`,children:[o,e.jsx("div",{id:l,role:"tooltip",className:"tooltip-text",children:s})]})}exports.ActiveFilters=Re;exports.ArrayChip=ye;exports.AutocompleteInput=ce;exports.Badge=oe;exports.Button=ie;exports.CheckInput=ue;exports.ChevronDown=pe;exports.ChevronLeft=he;exports.ChevronRight=me;exports.ChevronUp=xe;exports.Chip=W;exports.Close=Z;exports.Columns=Se;exports.CountOfTotal=Te;exports.Dropdown=Ie;exports.File=fe;exports.FileInput=De;exports.FilterDropdown=$e;exports.FilterTypes=V;exports.Filters=be;exports.FiltersActions=O;exports.FiltersProvider=ge;exports.Footer=Me;exports.IconButton=B;exports.Loading=de;exports.Navigation=Ae;exports.PageSize=Fe;exports.RangeChip=ke;exports.Rows=Pe;exports.SelectInput=Y;exports.SortOrder=H;exports.State=Q;exports.Table=Ye;exports.TableEmpty=Oe;exports.TableHeader=Le;exports.TableOptionsProvider=Be;exports.TableSelectionBar=ze;exports.TextInput=X;exports.Tooltip=G;exports.TranslationProvider=Ve;exports.filtersReducer=Ce;exports.helperTextStateClassName=le;exports.initializer=te;exports.inputStateClassName=ne;exports.labelStateClassName=se;exports.renderFilterComponent=Ee;exports.useFilters=J;exports.useTableOptions=z;exports.useTranslation=L;
|