@redi.run/redi-components 0.0.2 → 0.0.7
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/components/AdvancedTable/AdvancedFilter.d.ts +18 -0
- package/dist/components/AdvancedTable/AdvancedTable.d.ts +3 -0
- package/dist/components/AdvancedTable/AdvancedTable.stories.d.ts +16 -0
- package/dist/components/AdvancedTable/FilterDropdown.d.ts +9 -0
- package/dist/components/AdvancedTable/hooks/useAdvancedTable.d.ts +15 -0
- package/dist/components/AdvancedTable/index.d.ts +2 -0
- package/dist/components/AdvancedTable/types.d.ts +82 -0
- package/dist/components/Button/Button.d.ts +4 -0
- package/dist/components/Button/Button.stories.d.ts +19 -0
- package/dist/components/Button/index.d.ts +2 -0
- package/dist/components/Button/types.d.ts +20 -0
- package/dist/components/forms/Input/Input.d.ts +3 -0
- package/dist/components/forms/Input/Input.stories.d.ts +12 -0
- package/dist/components/forms/Input/index.d.ts +2 -0
- package/dist/components/forms/Input/types.d.ts +10 -0
- package/dist/icons/DownloadIcon.d.ts +2 -0
- package/dist/icons/EyeIcon.d.ts +2 -0
- package/dist/icons/FilterIcon.d.ts +2 -0
- package/dist/icons/YinYanIcon.d.ts +2 -0
- package/dist/main.d.ts +2 -0
- package/dist/mocks/AdvancedTable.d.ts +16 -0
- package/dist/redi-components.css +3 -0
- package/dist/redi-components.js +747 -0
- package/dist/redi-components.umd.cjs +3 -0
- package/dist/utils/exportUtils.d.ts +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface FilterOption {
|
|
2
|
+
value: string;
|
|
3
|
+
count: number;
|
|
4
|
+
label: string;
|
|
5
|
+
}
|
|
6
|
+
interface AdvancedFilterProps {
|
|
7
|
+
color?: string;
|
|
8
|
+
columnId: string;
|
|
9
|
+
label: string;
|
|
10
|
+
options: FilterOption[];
|
|
11
|
+
textValue: string;
|
|
12
|
+
selectedValues: string[];
|
|
13
|
+
onTextChange: (value: string) => void;
|
|
14
|
+
onSelectionChange: (values: string[]) => void;
|
|
15
|
+
onClose: () => void;
|
|
16
|
+
}
|
|
17
|
+
declare const AdvancedFilter: React.FC<AdvancedFilterProps>;
|
|
18
|
+
export default AdvancedFilter;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { AdvancedTableProps } from './types';
|
|
2
|
+
declare const AdvancedTable: <T extends Record<string, unknown>>({ data, columns, defaultSort, defaultFilters, defaultPageSize, pageSizeOptions, enableSorting, enableFiltering, enablePagination, enableExport, persistConfig, configKey, className, labels }: AdvancedTableProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default AdvancedTable;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
parameters: {
|
|
5
|
+
layout: string;
|
|
6
|
+
};
|
|
7
|
+
tags: string[];
|
|
8
|
+
args: {
|
|
9
|
+
onRowClick: import('@vitest/spy').Mock<(...args: any[]) => any>;
|
|
10
|
+
onConfigChange: import('@vitest/spy').Mock<(...args: any[]) => any>;
|
|
11
|
+
};
|
|
12
|
+
component: <T extends Record<string, unknown>>({ data, columns, defaultSort, defaultFilters, defaultPageSize, pageSizeOptions, enableSorting, enableFiltering, enablePagination, enableExport, persistConfig, configKey, className, labels }: import('./types').AdvancedTableProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
};
|
|
14
|
+
export default meta;
|
|
15
|
+
type Story = StoryObj<typeof meta>;
|
|
16
|
+
export declare const Default: Story;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface FilterDropdownProps {
|
|
2
|
+
label: string;
|
|
3
|
+
options: string[];
|
|
4
|
+
selectedValues: string[];
|
|
5
|
+
onSelectionChange: (values: string[]) => void;
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const FilterDropdown: React.FC<FilterDropdownProps>;
|
|
9
|
+
export default FilterDropdown;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AdvancedTableProps, Column, TableState } from '../types';
|
|
2
|
+
export declare const useAdvancedTable: <T>(props: AdvancedTableProps<T>) => {
|
|
3
|
+
state: TableState<T>;
|
|
4
|
+
orderedColumns: Column<T>[];
|
|
5
|
+
pageSizeOptions: number[];
|
|
6
|
+
handleSort: (columnId: string) => void;
|
|
7
|
+
handleFilter: (columnId: string, filterValue: string | string[], filterType?: "text" | "select" | "multiselect") => void;
|
|
8
|
+
clearFilter: (columnId: string) => void;
|
|
9
|
+
clearAllFilters: () => void;
|
|
10
|
+
handlePageChange: (page: number) => void;
|
|
11
|
+
handlePageSizeChange: (pageSize: number) => void;
|
|
12
|
+
handleColumnReorder: (newOrder: string[]) => void;
|
|
13
|
+
handleToggleColumn: (columnId: string) => void;
|
|
14
|
+
allColumns: Column<T>[];
|
|
15
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
export interface Column<T = any> {
|
|
2
|
+
id: string;
|
|
3
|
+
label: string;
|
|
4
|
+
accessor: keyof T | ((row: T) => any);
|
|
5
|
+
sortable?: boolean;
|
|
6
|
+
filterable?: boolean;
|
|
7
|
+
width?: number;
|
|
8
|
+
minWidth?: number;
|
|
9
|
+
align?: 'left' | 'center' | 'right';
|
|
10
|
+
render?: (value: any, row: T, index: number) => React.ReactNode;
|
|
11
|
+
hidden?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface SortConfig {
|
|
14
|
+
column: string;
|
|
15
|
+
direction: 'asc' | 'desc';
|
|
16
|
+
}
|
|
17
|
+
export interface FilterConfig {
|
|
18
|
+
[columnId: string]: {
|
|
19
|
+
type: 'text' | 'select' | 'multiselect';
|
|
20
|
+
value: string | string[];
|
|
21
|
+
textValue?: string;
|
|
22
|
+
options?: string[];
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export interface PaginationConfig {
|
|
26
|
+
page: number;
|
|
27
|
+
pageSize: number;
|
|
28
|
+
total: number;
|
|
29
|
+
}
|
|
30
|
+
export interface TableConfig {
|
|
31
|
+
columns: Column[];
|
|
32
|
+
sort?: SortConfig;
|
|
33
|
+
filters: FilterConfig;
|
|
34
|
+
pagination: PaginationConfig;
|
|
35
|
+
columnOrder: string[];
|
|
36
|
+
hiddenColumns: string[];
|
|
37
|
+
}
|
|
38
|
+
export interface LabelsProps {
|
|
39
|
+
configuration?: string;
|
|
40
|
+
columnVisibility?: string;
|
|
41
|
+
pagination?: {
|
|
42
|
+
showingItems: string;
|
|
43
|
+
to: string;
|
|
44
|
+
of: string;
|
|
45
|
+
items: string;
|
|
46
|
+
showPerPage?: string;
|
|
47
|
+
perPageItems?: string;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
export interface AdvancedTableProps<T = any> {
|
|
51
|
+
data: T[];
|
|
52
|
+
columns: Column<T>[];
|
|
53
|
+
defaultSort?: SortConfig;
|
|
54
|
+
defaultFilters?: FilterConfig;
|
|
55
|
+
defaultPageSize?: number;
|
|
56
|
+
pageSizeOptions?: number[];
|
|
57
|
+
enableSorting?: boolean;
|
|
58
|
+
enableFiltering?: boolean;
|
|
59
|
+
enablePagination?: boolean;
|
|
60
|
+
enableColumnReordering?: boolean;
|
|
61
|
+
enableExport?: boolean;
|
|
62
|
+
persistConfig?: boolean;
|
|
63
|
+
configKey?: string;
|
|
64
|
+
onRowClick?: (row: T, index: number) => void;
|
|
65
|
+
onConfigChange?: (config: TableConfig) => void;
|
|
66
|
+
className?: string;
|
|
67
|
+
loading?: boolean;
|
|
68
|
+
emptyMessage?: string;
|
|
69
|
+
exportFileName?: string;
|
|
70
|
+
labels?: LabelsProps;
|
|
71
|
+
}
|
|
72
|
+
export interface TableState<T = any> {
|
|
73
|
+
data: T[];
|
|
74
|
+
filteredData: T[];
|
|
75
|
+
paginatedData: T[];
|
|
76
|
+
sortConfig: SortConfig | undefined;
|
|
77
|
+
filters: FilterConfig;
|
|
78
|
+
pagination: PaginationConfig;
|
|
79
|
+
columnOrder: string[];
|
|
80
|
+
hiddenColumns: string[];
|
|
81
|
+
loading: boolean;
|
|
82
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: ({ level, size, type, posIcon, disabled, label, icon, children, ...props }: import('./types').ButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
tags: string[];
|
|
9
|
+
args: {
|
|
10
|
+
onClick: import('@vitest/spy').Mock<(...args: any[]) => any>;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export default meta;
|
|
14
|
+
type Story = StoryObj<typeof meta>;
|
|
15
|
+
export declare const ButtonPrimary: Story;
|
|
16
|
+
export declare const ButtonSecondary: Story;
|
|
17
|
+
export declare const ButtonTertiary: Story;
|
|
18
|
+
export declare const ButtonLink: Story;
|
|
19
|
+
export declare const ButtonIcon: Story;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type ButtonLevel = 'primary' | 'secondary' | 'tertiary' | 'link' | 'icon';
|
|
2
|
+
export interface ButtonProps {
|
|
3
|
+
level?: ButtonLevel;
|
|
4
|
+
color?: string;
|
|
5
|
+
backgroundColor?: string;
|
|
6
|
+
size?: 'small' | 'medium' | 'large';
|
|
7
|
+
type?: 'button' | 'submit' | 'reset';
|
|
8
|
+
label?: string;
|
|
9
|
+
onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
10
|
+
icon?: React.ReactNode;
|
|
11
|
+
posIcon?: 'left' | 'right';
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
}
|
|
15
|
+
export interface IconsProps {
|
|
16
|
+
color?: string;
|
|
17
|
+
size?: number;
|
|
18
|
+
width?: number;
|
|
19
|
+
height?: number;
|
|
20
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: ({ placeholder, value, onChange }: import('./types').RediInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
tags: string[];
|
|
9
|
+
};
|
|
10
|
+
export default meta;
|
|
11
|
+
type Story = StoryObj<typeof meta>;
|
|
12
|
+
export declare const InputDefault: Story;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type InputType = 'text' | 'password' | 'email' | 'number' | 'phone';
|
|
2
|
+
export interface RediInputProps {
|
|
3
|
+
value: string;
|
|
4
|
+
onChange: (value: string) => void;
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
error?: string;
|
|
8
|
+
hint?: string;
|
|
9
|
+
type?: InputType;
|
|
10
|
+
}
|
package/dist/main.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Column } from '../components/AdvancedTable';
|
|
2
|
+
export interface Contract extends Record<string, unknown> {
|
|
3
|
+
id: string;
|
|
4
|
+
contractNumber: string;
|
|
5
|
+
property: string;
|
|
6
|
+
responsible: string;
|
|
7
|
+
createdBy: string;
|
|
8
|
+
openingDate: string;
|
|
9
|
+
type: string;
|
|
10
|
+
subtype: string;
|
|
11
|
+
status: string;
|
|
12
|
+
province: string;
|
|
13
|
+
population: string;
|
|
14
|
+
}
|
|
15
|
+
export declare const sampleData: Contract[];
|
|
16
|
+
export declare const columns: Column<Contract>[];
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! tailwindcss v4.1.15 | MIT License | https://tailwindcss.com */
|
|
2
|
+
@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-border-style:solid;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--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;--tw-duration: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-gray-50:#f9fafb;--color-gray-200:#e5e7eb;--color-gray-300:#d1d5dc;--color-gray-400:#99a1af;--color-gray-500:#6a7282;--color-white:#fff;--spacing:.25rem;--container-2xs:18rem;--container-xs:20rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height:calc(1.5/1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--font-weight-medium:500;--font-weight-semibold:600;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--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);--font-family-base:"Nunito Sans","Helvetica Neue",sans-serif;--color-redi-primary:#fa8c16;--color-redi-background:#f9fafb;--color-redi-text:#111827;--color-redi-primary-bg:#e68313;--color-redi-primary-bg-hover:#d97706;--color-redi-primary-bg-active:#f28d1a;--color-redi-primary-text:#fff9ed;--color-redi-secondary-bg:#fff9ed;--color-redi-secondary-bg-hover:#fae1b5;--color-redi-secondary-bg-active:#fae1b5;--color-redi-secondary-text:#fa8c16;--color-redi-tertiary-bg:#e5e7eb;--color-redi-tertiary-bg-hover:#d1d5db;--color-redi-tertiary-bg-active:#9ca3af;--color-redi-tertiary-text:#374151;--color-redi-link-text:#fa8c16;--color-redi-link-bg:#fff9ed;--color-redi-link-bg-active:#fae1b5;--color-redi-icon-text:#fa8c16;--color-redi-icon-bg:#fff9ed;--color-redi-icon-bg-active:#fae1b5;--color-redi-disabled-bg:#f1f1f1;--color-redi-disabled-text:#c4c4c4;--color-redi-disabled-border:#d1d5db}@supports (color:lab(0% 0 0)){:root,:host{--color-gray-50:lab(98.2596% -.247031 -.706708);--color-gray-200:lab(91.6229% -.159115 -2.26791);--color-gray-300:lab(85.1236% -.612289 -3.7138);--color-gray-400:lab(65.9269% -.832677 -8.17474);--color-gray-500:lab(47.7841% -.393182 -10.0268)}}}@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;-webkit-text-decoration:inherit;-webkit-text-decoration: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}.absolute{position:absolute}.relative{position:relative}.static{position:static}.sticky{position:sticky}.top-0{top:calc(var(--spacing)*0)}.top-full{top:100%}.left-0{left:calc(var(--spacing)*0)}.z-10{z-index:10}.z-1000{z-index:1000}.mt-2{margin-top:calc(var(--spacing)*2)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.flex{display:flex}.hidden{display:none}.inline-block{display:inline-block}.table{display:table}.h-4{height:calc(var(--spacing)*4)}.max-h-\[600px\]{max-height:600px}.min-h-\[500px\]{min-height:500px}.w-4{width:calc(var(--spacing)*4)}.w-full{width:100%}.max-w-xs{max-width:var(--container-xs)}.min-w-2xs{min-width:var(--container-2xs)}.shrink-0{flex-shrink:0}.table-auto{table-layout:auto}.border-collapse{border-collapse:collapse}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.cursor-pointer{cursor:pointer}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-1{gap:calc(var(--spacing)*1)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.gap-5{gap:calc(var(--spacing)*5)}.gap-x-1{column-gap:calc(var(--spacing)*1)}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.border,.border-1{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-solid{--tw-border-style:solid;border-style:solid}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.border-gray-400{border-color:var(--color-gray-400)}.border-gray-500{border-color:var(--color-gray-500)}.border-redi-primary{border-color:var(--color-redi-primary)}.border-t-gray-300{border-top-color:var(--color-gray-300)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-300{background-color:var(--color-gray-300)}.bg-redi-background{background-color:var(--color-redi-background)}.bg-redi-primary-bg{background-color:var(--color-redi-primary-bg)}.bg-redi-secondary-bg{background-color:var(--color-redi-secondary-bg)}.bg-redi-tertiary-bg{background-color:var(--color-redi-tertiary-bg)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.p-0{padding:calc(var(--spacing)*0)}.p-4{padding:calc(var(--spacing)*4)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-1{padding-block:calc(var(--spacing)*1)}.py-2{padding-block:calc(var(--spacing)*2)}.py-3{padding-block:calc(var(--spacing)*3)}.py-4{padding-block:calc(var(--spacing)*4)}.text-left{text-align:left}.font-family-base{font-family:var(--font-family-base)}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.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-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.text-redi-icon-text{color:var(--color-redi-icon-text)}.text-redi-link-text{color:var(--color-redi-link-text)}.text-redi-primary-text{color:var(--color-redi-primary-text)}.text-redi-secondary-text{color:var(--color-redi-secondary-text)}.text-redi-tertiary-text{color:var(--color-redi-tertiary-text)}.text-redi-text{color:var(--color-redi-text)}.uppercase{text-transform:uppercase}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.accent-redi-primary{accent-color:var(--color-redi-primary)}.opacity-50{opacity:.5}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-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-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.select-none{-webkit-user-select:none;user-select:none}.last\:mb-0:last-child{margin-bottom:calc(var(--spacing)*0)}@media (hover:hover){.hover\:bg-gray-200:hover{background-color:var(--color-gray-200)}.hover\:bg-redi-icon-bg:hover{background-color:var(--color-redi-icon-bg)}.hover\:bg-redi-link-bg:hover{background-color:var(--color-redi-link-bg)}.hover\:bg-redi-primary-bg-hover:hover{background-color:var(--color-redi-primary-bg-hover)}.hover\:bg-redi-secondary-bg-hover:hover{background-color:var(--color-redi-secondary-bg-hover)}.hover\:bg-redi-tertiary-bg-hover:hover{background-color:var(--color-redi-tertiary-bg-hover)}}.active\:border-\[1px\]:active{border-style:var(--tw-border-style);border-width:1px}.active\:border-solid:active{--tw-border-style:solid;border-style:solid}.active\:border-white:active{border-color:var(--color-white)}.active\:ring-2:active{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.active\:ring-redi-icon-bg-active:active{--tw-ring-color:var(--color-redi-icon-bg-active)}.active\:ring-redi-link-bg-active:active{--tw-ring-color:var(--color-redi-link-bg-active)}.active\:ring-redi-primary-bg-active:active{--tw-ring-color:var(--color-redi-primary-bg-active)}.active\:ring-redi-secondary-bg-active:active{--tw-ring-color:var(--color-redi-secondary-bg-active)}.active\:ring-redi-tertiary-bg-active:active{--tw-ring-color:var(--color-redi-tertiary-bg-active)}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:border-redi-disabled-border:disabled{border-color:var(--color-redi-disabled-border)}.disabled\:bg-redi-disabled-bg:disabled{background-color:var(--color-redi-disabled-bg)}.disabled\:text-redi-disabled-text:disabled{color:var(--color-redi-disabled-text)}@media (min-width:48rem){.md\:block{display:block}}}@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-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@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}@property --tw-duration{syntax:"*";inherits:false}._controls_1pwn9_1{background:#fafbfc;border-bottom:1px solid #e5e7eb;justify-content:space-between;align-items:center;padding:16px 24px;display:flex}._leftControls_1pwn9_10{align-items:center;gap:12px;display:flex}._rightControls_1pwn9_16{align-items:center;gap:8px;display:flex}._configButton_1pwn9_23{color:#374151;cursor:pointer;background:#fff;border:1px solid #d1d5db;border-radius:6px;align-items:center;gap:8px;padding:8px 12px;font-size:14px;font-weight:500;display:flex}._configButton_1pwn9_23:hover{background:#f9fafb;border-color:#9ca3af}._configIcon_1pwn9_42{fill:currentColor;width:16px;height:16px}._configSection_1pwn9_49{margin-bottom:16px}._configSection_1pwn9_49:last-child{margin-bottom:0}._configSectionTitle_1pwn9_57{color:#374151;text-transform:uppercase;letter-spacing:.025em;margin-bottom:8px;font-size:13px;font-weight:600}._configOptions_1pwn9_66{flex-direction:column;gap:8px;display:flex}._configOption_1pwn9_66{align-items:center;gap:8px;display:flex}._configOption_1pwn9_66 input[type=checkbox]{accent-color:#3b82f6;width:16px;height:16px}._configOption_1pwn9_66 label{color:#374151;cursor:pointer;font-size:14px}._actionButton_1pwn9_91{cursor:pointer;color:#6b7280;background:#fff;border:1px solid #d1d5db;border-radius:6px;justify-content:center;align-items:center;width:36px;height:36px;display:flex}._actionButton_1pwn9_91:hover{color:#374151;background:#f9fafb;border-color:#9ca3af}._actionButton_1pwn9_91._export_1pwn9_110{color:#059669}._actionButton_1pwn9_91._export_1pwn9_110:hover{color:#047857;background:#f0fdf4;border-color:#059669}._actionButton_1pwn9_91._reset_1pwn9_120{color:#dc2626}._actionButton_1pwn9_91._reset_1pwn9_120:hover{color:#b91c1c;background:#fef2f2;border-color:#dc2626}._buttonIcon_1pwn9_130{fill:currentColor;width:18px;height:18px}._filtersContainer_1pwn9_137{background:#f9fafb;border-bottom:1px solid #e5e7eb;padding:16px 24px;display:none}._filtersContainer_1pwn9_137._active_1pwn9_145{display:block}._filterDropdownButton_1pwn9_177{color:#374151;cursor:pointer;background:#fff;border:1px solid #d1d5db;border-radius:6px;justify-content:space-between;align-items:center;width:100%;padding:8px 12px;font-size:14px;display:flex}._filterDropdownButton_1pwn9_177:hover{border-color:#9ca3af}._filterDropdownIcon_1pwn9_200{fill:#6b7280;width:16px;height:16px}._filterModalHeader_1pwn9_212{border-bottom:1px solid #e5e7eb;padding:12px 16px}._filterOption_1pwn9_231{cursor:pointer;border-radius:4px;align-items:center;gap:8px;padding:8px 12px;display:flex}._filterOption_1pwn9_231._selected_1pwn9_250{background:#eff6ff}._filterOptionCheckbox_1pwn9_254{accent-color:#3b82f6;width:16px;height:16px}._filterOptionLabel_1pwn9_260{color:#374151;flex:1;font-size:14px}._filterApplyButton_1pwn9_285:hover{background:#2563eb}._tableWrapper_1pwn9_315{background:#fff;max-height:600px;position:relative;overflow:auto}._header_1pwn9_332{text-align:left;color:#374151;z-index:10;-webkit-user-select:none;user-select:none;background:#f9fafb;border-bottom:1px solid #e5e7eb;padding:0;font-weight:600;position:sticky;top:0}._header_1pwn9_332:hover{background:#f3f4f6}._header_1pwn9_332._dragging_1pwn9_349{opacity:.6;background:#e5e7eb}._header_1pwn9_332._dragOver_1pwn9_354{background:#dbeafe;border-left:2px solid #3b82f6}._headerContent_1pwn9_359{align-items:center;gap:8px;min-height:48px;padding:12px 16px;display:flex}._dragHandle_1pwn9_367{color:#9ca3af;cursor:grab;opacity:.7;font-size:14px}._dragHandle_1pwn9_367:hover{color:#6b7280;opacity:1}._header_1pwn9_332._dragging_1pwn9_349 ._dragHandle_1pwn9_367{cursor:grabbing;color:#3b82f6}._sortable_1pwn9_391{cursor:pointer;color:#374151;border-radius:4px;align-items:center;gap:6px;padding:4px 6px;font-size:14px;font-weight:600;display:flex}._filterButton_1pwn9_415{cursor:pointer;color:#6b7280;white-space:nowrap;background:0 0;border:1px solid #d1d5db;border-radius:4px;flex-shrink:0;align-items:center;gap:4px;min-width:0;padding:6px 10px;font-size:12px;display:flex;position:static}._filterButton_1pwn9_415:hover{color:#374151;background:#f9fafb;border-color:#9ca3af}._filterButton_1pwn9_415._active_1pwn9_145{color:#1d4ed8;background:#dbeafe;border-color:#3b82f6}._filterButton_1pwn9_415:focus{outline-offset:2px;background:#f9fafb;outline:2px solid #3b82f6}._filterButtonIcon_1pwn9_451{fill:currentColor;width:12px;height:12px}._filterModal_1pwn9_212{z-index:9999;background:#fff;border:1px solid #d1d5db;border-radius:6px;min-width:280px;margin-top:4px;display:block;position:absolute;top:100%;right:0;overflow:visible;box-shadow:0 10px 15px -3px #0000001a,0 4px 6px -2px #0000000d}._row_1pwn9_474{border-bottom:1px solid #f3f4f6}._row_1pwn9_474:nth-child(2n){background:#fafbfc}._row_1pwn9_474:nth-child(odd){background:#fff}._cell_1pwn9_486{color:#374151;vertical-align:middle;border-right:1px solid #f3f4f680;padding:12px 16px;font-weight:400;line-height:1.5;display:table-cell;position:static}._cell_1pwn9_486:last-child{border-right:none}._cell_1pwn9_486:first-child{color:#1f2937;font-weight:500}._statusBadge_1pwn9_507{text-transform:capitalize;border-radius:6px;align-items:center;padding:4px 8px;font-size:12px;font-weight:500;display:inline-flex}._pagination_1pwn9_543{justify-content:between;background:#fafbfc;border-top:1px solid #e5e7eb;align-items:center;gap:16px;padding:16px 24px;display:flex}._pageSizeSelect_1pwn9_575{cursor:pointer;background:#fff;border:1px solid #d1d5db;border-radius:4px;min-width:70px;padding:6px 10px;font-size:14px}._pageButtons_1pwn9_591{align-items:center;gap:4px;display:flex}._pageButton_1pwn9_591{cursor:pointer;color:#374151;background:#fff;border:1px solid #d1d5db;border-radius:4px;min-width:36px;padding:6px 12px;font-size:14px;font-weight:500}._pageButton_1pwn9_591:hover:not(:disabled){background:#f9fafb;border-color:#9ca3af}._pageButton_1pwn9_591._active_1pwn9_145:hover{background:#2563eb;border-color:#2563eb}@media (max-width:768px){._controls_1pwn9_1{flex-direction:column;align-items:stretch;gap:12px}._leftControls_1pwn9_10,._rightControls_1pwn9_16{justify-content:center}._filtersRow_1pwn9_149{flex-direction:column}._pagination_1pwn9_543{flex-direction:column;gap:12px}._pageButtons_1pwn9_591{justify-content:center}}._exportButton_1pwn9_659,._resetButton_1pwn9_660{cursor:pointer;letter-spacing:.025em;border:none;border-radius:10px;padding:10px 20px;font-size:14px;font-weight:600;position:relative;overflow:hidden}._exportButton_1pwn9_659{color:#fff;background:linear-gradient(135deg,#10b981 0%,#059669 100%);box-shadow:0 4px 14px #10b98166}._exportButton_1pwn9_659:hover{box-shadow:0 8px 25px #10b98199}._resetButton_1pwn9_660{color:#fff;background:linear-gradient(135deg,#ef4444 0%,#dc2626 100%);box-shadow:0 4px 14px #ef444466}._resetButton_1pwn9_660:hover{box-shadow:0 8px 25px #ef444499}._filtersContainer_1pwn9_137{background:linear-gradient(135deg,#f8fafc 0%,#e2e8f0 100%);border-bottom:1px solid #e2e8f0cc;padding:24px 32px;position:relative}._filtersContainer_1pwn9_137:before{content:"";background:linear-gradient(90deg,#0000 0%,#6366f14d 50%,#0000 100%);height:1px;position:absolute;top:0;left:0;right:0}._filtersRow_1pwn9_149{flex-wrap:wrap;align-items:flex-start;gap:20px;display:flex}._filterGroup_1pwn9_156{flex:1;min-width:200px;position:relative}._filterLabel_1pwn9_162{color:#374151;text-transform:uppercase;letter-spacing:.05em;margin-bottom:8px;font-size:13px;font-weight:600;display:block}._filterDropdown_1pwn9_172{width:100%;position:relative}._filterDropdownButton_1pwn9_177{color:#374151;cursor:pointer;background:#fff;border:2px solid #e5e7eb;border-radius:12px;justify-content:space-between;align-items:center;width:100%;padding:12px 16px;font-size:14px;display:flex;box-shadow:0 1px 3px #0000001a}._filterDropdownButton_1pwn9_177:hover{border-color:#6366f1;box-shadow:0 4px 12px #6366f126}._filterDropdownButton_1pwn9_177._active_1pwn9_145{border-color:#6366f1;box-shadow:0 0 0 3px #6366f11a}._filterDropdownIcon_1pwn9_200{width:16px;height:16px}._filterDropdownButton_1pwn9_177._active_1pwn9_145 ._filterDropdownIcon_1pwn9_200{transform:rotate(180deg)}._filterModal_1pwn9_212{z-index:1000;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);background:#fff;border:1px solid #e5e7eb;border-radius:16px;margin-top:8px;animation:.3s ease-out _filterModalSlideIn_1pwn9_1;position:absolute;top:100%;left:0;right:0;overflow:hidden;box-shadow:0 20px 25px -5px #0000001a,0 10px 10px -5px #0000000a}@keyframes _filterModalSlideIn_1pwn9_1{0%{opacity:0}to{opacity:1}}._filterModalHeader_1pwn9_212{background:linear-gradient(135deg,#f8fafc 0%,#f1f5f9 100%);border-bottom:1px solid #f3f4f6;padding:16px 20px}._filterSearchInput_1pwn9_217{border:1px solid #e5e7eb;border-radius:8px;outline:none;width:100%;padding:10px 12px;font-size:14px}._filterSearchInput_1pwn9_217:focus{border-color:#6366f1;box-shadow:0 0 0 3px #6366f11a}._filterOptions_1pwn9_231{max-height:240px;padding:8px;overflow-y:auto}._filterOption_1pwn9_231{cursor:pointer;border-radius:8px;align-items:center;gap:12px;margin-bottom:4px;padding:12px 16px;display:flex}._filterOption_1pwn9_231:hover{background:#f8fafc}._filterOption_1pwn9_231._selected_1pwn9_250{background:linear-gradient(135deg,#ede9fe 0%,#e0e7ff 100%);border:1px solid #c7d2fe}._filterOptionCheckbox_1pwn9_254{accent-color:#6366f1;cursor:pointer;width:16px;height:16px}._filterOptionLabel_1pwn9_260{color:#374151;cursor:pointer;flex:1;font-size:14px}._filterOptionCount_1pwn9_266{color:#6b7280;background:#f3f4f6;border-radius:12px;padding:2px 8px;font-size:12px;font-weight:500}._filterModalActions_1pwn9_275{background:#fafafa;border-top:1px solid #f3f4f6;justify-content:space-between;gap:12px;padding:16px 20px;display:flex}._filterClearButton_1pwn9_284,._filterApplyButton_1pwn9_285{cursor:pointer;border:none;border-radius:8px;padding:8px 16px;font-size:13px;font-weight:600}._filterClearButton_1pwn9_284{color:#6b7280;background:#f3f4f6}._filterClearButton_1pwn9_284:hover{color:#374151;background:#e5e7eb}._filterApplyButton_1pwn9_285{color:#fff;background:linear-gradient(135deg,#6366f1 0%,#4f46e5 100%);flex:1}._filterApplyButton_1pwn9_285:hover{box-shadow:0 4px 12px #6366f166}._tableWrapper_1pwn9_315{background:#fff;border-radius:0 0 16px 16px;max-height:600px;position:relative;overflow:auto}._tableWrapper_1pwn9_315:before{content:"";background:linear-gradient(90deg,#0000 0%,#e5e7eb 20% 80%,#0000 100%);height:1px;position:absolute;top:0;left:0;right:0}._table_1pwn9_315{border-collapse:collapse;table-layout:auto;width:100%;font-size:14px;position:relative}._pagination_1pwn9_543{background:#fafbfc;border-top:1px solid #e5e7eb;justify-content:space-between;align-items:center;gap:16px;padding:16px 24px;display:flex}._paginationInfo_1pwn9_553{color:#6b7280;font-size:14px;font-weight:500}._paginationControls_1pwn9_560 label{color:#374151;align-items:center;gap:8px;font-size:14px;display:flex}._pageSizeSelect_1pwn9_575{background:#fff;border:1px solid #d1d5db;border-radius:4px;padding:6px 10px;font-size:14px}._pageButton_1pwn9_591{color:#374151;cursor:pointer;background:#fff;border:1px solid #d1d5db;border-radius:4px;padding:8px 12px;font-size:14px;font-weight:500}._pageButton_1pwn9_591:hover{background:#f9fafb}._pageButton_1pwn9_591:disabled{color:#9ca3af;cursor:not-allowed;background:#f3f4f6}._pageButton_1pwn9_591._active_1pwn9_145{color:#fff;background:#3b82f6;border-color:#3b82f6}._columnTitle_1pwn9_384{flex:1;align-items:center;gap:8px;display:flex}._sortable_1pwn9_391{cursor:pointer;color:#1e293b;text-transform:uppercase;letter-spacing:.025em;border-radius:6px;align-items:center;gap:6px;padding:4px 8px;font-size:14px;font-weight:600;display:flex}._sortable_1pwn9_391:hover{color:#6366f1;background:#6366f11a}._sortIcon_1pwn9_408{color:#6366f1;font-size:16px;font-weight:700}._paginationInfo_1pwn9_553{color:#64748b;flex-shrink:0;font-size:14px;font-weight:500}._paginationControls_1pwn9_560{align-items:center;gap:20px;display:flex}._paginationControls_1pwn9_560 label{color:#374151;align-items:center;gap:12px;font-size:14px;font-weight:600;display:flex}._pageSizeSelect_1pwn9_575{cursor:pointer;background:#fff;border:2px solid #e5e7eb;border-radius:8px;min-width:80px;padding:8px 12px;font-size:14px;font-weight:500;box-shadow:0 1px 3px #0000001a}._pageSizeSelect_1pwn9_575:focus{border-color:#6366f1;outline:none;box-shadow:0 0 0 3px #6366f11a}._pageButton_1pwn9_591{cursor:pointer;color:#374151;background:#fff;border:2px solid #e5e7eb;border-radius:10px;min-width:44px;padding:10px 16px;font-size:14px;font-weight:600;position:relative;overflow:hidden}._pageButton_1pwn9_591:hover:not(:disabled){color:#6366f1;background:linear-gradient(135deg,#f0f4ff 0%,#e0f2fe 100%);border-color:#6366f1;box-shadow:0 4px 12px #6366f126}._pageButton_1pwn9_591:disabled{color:#d1d5db;cursor:not-allowed;opacity:.6;background:#f9fafb;border-color:#f3f4f6}._pageButton_1pwn9_591._active_1pwn9_145{color:#fff;background:linear-gradient(135deg,#6366f1 0%,#4f46e5 100%);border-color:#6366f1;box-shadow:0 4px 12px #6366f166}._pageButton_1pwn9_591._active_1pwn9_145:hover{background:linear-gradient(135deg,#4f46e5 0%,#4338ca 100%);border-color:#4f46e5;box-shadow:0 8px 25px #6366f199}._statusBadge_1pwn9_507{text-transform:uppercase;letter-spacing:.05em;border-radius:20px;align-items:center;padding:6px 12px;font-size:12px;font-weight:600;display:inline-flex;position:relative;overflow:hidden;box-shadow:0 2px 4px #0000001a}._statusBadge_1pwn9_507:before{content:"";background:linear-gradient(45deg,#fff3 0%,#0000 50%,#fff3 100%) 0 0/200% 200%;animation:2s infinite _shimmer_1pwn9_1;position:absolute;inset:0}@keyframes _shimmer_1pwn9_1{0%{background-position:-200% -200%}to{background-position:200% 200%}}._statusActive_1pwn9_517{color:#fff;background:linear-gradient(135deg,#10b981 0%,#059669 100%)}._statusInactive_1pwn9_522{color:#fff;background:linear-gradient(135deg,#ef4444 0%,#dc2626 100%)}._statusPending_1pwn9_527{color:#fff;background:linear-gradient(135deg,#f59e0b 0%,#d97706 100%)}._statusCompleted_1pwn9_532{color:#fff;background:linear-gradient(135deg,#8b5cf6 0%,#7c3aed 100%)}._statusDraft_1pwn9_537{color:#fff;background:linear-gradient(135deg,#6b7280 0%,#4b5563 100%)}@media (max-width:768px){._controls_1pwn9_1{flex-direction:column;align-items:stretch;gap:16px}._leftControls_1pwn9_10,._rightControls_1pwn9_16,._columnCheckboxes_1pwn9_1195{justify-content:center}._filtersRow_1pwn9_149{flex-direction:column}._pagination_1pwn9_543{flex-direction:column;gap:16px}._pageButtons_1pwn9_591{justify-content:center}}
|
|
3
|
+
/*$vite$:1*/
|
|
@@ -0,0 +1,747 @@
|
|
|
1
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
const DownloadIcon = ({ color: e, size: t = 24 }) => /* @__PURE__ */ jsx("svg", {
|
|
4
|
+
width: t,
|
|
5
|
+
height: t,
|
|
6
|
+
viewBox: "0 0 20 20",
|
|
7
|
+
fill: e,
|
|
8
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
9
|
+
fillRule: "evenodd",
|
|
10
|
+
d: "M3 17a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm3.293-7.707a1 1 0 011.414 0L9 10.586V3a1 1 0 112 0v7.586l1.293-1.293a1 1 0 111.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z",
|
|
11
|
+
clipRule: "evenodd",
|
|
12
|
+
fill: "currentColor"
|
|
13
|
+
})
|
|
14
|
+
}), EyeIcon = ({ color: e, size: t = 20 }) => /* @__PURE__ */ jsxs("svg", {
|
|
15
|
+
viewBox: "0 0 20 20",
|
|
16
|
+
fill: e,
|
|
17
|
+
width: t,
|
|
18
|
+
height: t,
|
|
19
|
+
children: [/* @__PURE__ */ jsx("path", {
|
|
20
|
+
d: "M10 12a2 2 0 100-4 2 2 0 000 4z",
|
|
21
|
+
fill: "currentColor"
|
|
22
|
+
}), /* @__PURE__ */ jsx("path", {
|
|
23
|
+
fillRule: "evenodd",
|
|
24
|
+
d: "M.458 10C1.732 5.943 5.522 3 10 3s8.268 2.943 9.542 7c-1.274 4.057-5.064 7-9.542 7S1.732 14.057.458 10zM14 10a4 4 0 11-8 0 4 4 0 018 0z",
|
|
25
|
+
clipRule: "evenodd",
|
|
26
|
+
fill: "currentColor"
|
|
27
|
+
})]
|
|
28
|
+
}), FilterIcon = ({ color: e, size: t = 24 }) => /* @__PURE__ */ jsx("svg", {
|
|
29
|
+
fill: e,
|
|
30
|
+
stroke: "currentColor",
|
|
31
|
+
viewBox: "0 0 24 24",
|
|
32
|
+
width: t,
|
|
33
|
+
height: t,
|
|
34
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
35
|
+
fillRule: "evenodd",
|
|
36
|
+
d: "M3 3a1 1 0 011-1h12a1 1 0 011 1v3a1 1 0 01-.293.707L12 11.414V15a1 1 0 01-.293.707l-2 2A1 1 0 018 17v-5.586L3.293 6.707A1 1 0 013 6V3z",
|
|
37
|
+
clipRule: "evenodd",
|
|
38
|
+
fill: "currentColor"
|
|
39
|
+
})
|
|
40
|
+
}), formatCellValue = (e) => e == null ? "" : typeof e == "boolean" ? e ? "Sí" : "No" : typeof e == "number" ? e.toLocaleString() : e instanceof Date ? e.toLocaleDateString() : String(e);
|
|
41
|
+
var Button_default = ({ level: e = "primary", size: t = "medium", type: n = "button", posIcon: r = "left", disabled: i = !1, label: c, icon: l, children: u,...d }) => {
|
|
42
|
+
let f = "disabled:text-redi-disabled-text disabled:border-redi-disabled-border disabled:cursor-not-allowed", p = {
|
|
43
|
+
primary: `bg-redi-primary-bg hover:bg-redi-primary-bg-hover text-redi-primary-text active:ring-2 active:ring-redi-primary-bg-active active:border-[1px] active:border-white active:border-solid disabled:bg-redi-disabled-bg ${f}`,
|
|
44
|
+
secondary: `bg-redi-secondary-bg hover:bg-redi-secondary-bg-hover text-redi-secondary-text active:ring-2 active:ring-redi-secondary-bg-active active:border-[1px] active:border-white active:border-solid border-1 border-solid disabled:bg-redi-disabled-bg ${f}`,
|
|
45
|
+
tertiary: `bg-redi-tertiary-bg hover:bg-redi-tertiary-bg-hover text-redi-tertiary-text active:ring-2 active:ring-redi-tertiary-bg-active active:border-[1px] active:border-white active:border-solid disabled:bg-redi-disabled-bg ${f}`,
|
|
46
|
+
link: `bg-transparent hover:bg-redi-link-bg text-redi-link-text active:ring-2 active:ring-redi-link-bg-active active:border-[1px] active:border-white active:border-solid underline underline-offset-4 ${f}`,
|
|
47
|
+
icon: `bg-transparent hover:bg-redi-icon-bg text-redi-icon-text active:ring-2 active:ring-redi-icon-bg-active active:border-[1px] active:border-white active:border-solid ${f}`
|
|
48
|
+
};
|
|
49
|
+
return /* @__PURE__ */ jsx("button", {
|
|
50
|
+
type: n,
|
|
51
|
+
name: `button-${c}`,
|
|
52
|
+
disabled: i,
|
|
53
|
+
className: `cursor-pointer rounded-lg font-family-base transition-all duration-200 ${p[e]} ${{
|
|
54
|
+
small: "px-3 py-1 text-sm",
|
|
55
|
+
medium: "px-4 py-2 text-xs",
|
|
56
|
+
large: "px-6 py-3 text-lg"
|
|
57
|
+
}[t]} flex gap-x-1 items-center justify-center`,
|
|
58
|
+
...d,
|
|
59
|
+
children: u || /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
60
|
+
l && r === "left" && l,
|
|
61
|
+
c && e !== "icon" && /* @__PURE__ */ jsx("span", { children: c }),
|
|
62
|
+
l && r === "right" && l
|
|
63
|
+
] })
|
|
64
|
+
});
|
|
65
|
+
}, AdvancedTable_module_default = {
|
|
66
|
+
controls: "_controls_1pwn9_1",
|
|
67
|
+
leftControls: "_leftControls_1pwn9_10",
|
|
68
|
+
rightControls: "_rightControls_1pwn9_16",
|
|
69
|
+
configButton: "_configButton_1pwn9_23",
|
|
70
|
+
configIcon: "_configIcon_1pwn9_42",
|
|
71
|
+
configSection: "_configSection_1pwn9_49",
|
|
72
|
+
configSectionTitle: "_configSectionTitle_1pwn9_57",
|
|
73
|
+
configOptions: "_configOptions_1pwn9_66",
|
|
74
|
+
configOption: "_configOption_1pwn9_66",
|
|
75
|
+
actionButton: "_actionButton_1pwn9_91",
|
|
76
|
+
export: "_export_1pwn9_110",
|
|
77
|
+
reset: "_reset_1pwn9_120",
|
|
78
|
+
buttonIcon: "_buttonIcon_1pwn9_130",
|
|
79
|
+
filtersContainer: "_filtersContainer_1pwn9_137",
|
|
80
|
+
active: "_active_1pwn9_145",
|
|
81
|
+
filtersRow: "_filtersRow_1pwn9_149",
|
|
82
|
+
filterGroup: "_filterGroup_1pwn9_156",
|
|
83
|
+
filterLabel: "_filterLabel_1pwn9_162",
|
|
84
|
+
filterDropdown: "_filterDropdown_1pwn9_172",
|
|
85
|
+
filterDropdownButton: "_filterDropdownButton_1pwn9_177",
|
|
86
|
+
filterDropdownIcon: "_filterDropdownIcon_1pwn9_200",
|
|
87
|
+
filterModalHeader: "_filterModalHeader_1pwn9_212",
|
|
88
|
+
filterSearchInput: "_filterSearchInput_1pwn9_217",
|
|
89
|
+
filterOptions: "_filterOptions_1pwn9_231",
|
|
90
|
+
filterOption: "_filterOption_1pwn9_231",
|
|
91
|
+
selected: "_selected_1pwn9_250",
|
|
92
|
+
filterOptionCheckbox: "_filterOptionCheckbox_1pwn9_254",
|
|
93
|
+
filterOptionLabel: "_filterOptionLabel_1pwn9_260",
|
|
94
|
+
filterOptionCount: "_filterOptionCount_1pwn9_266",
|
|
95
|
+
filterModalActions: "_filterModalActions_1pwn9_275",
|
|
96
|
+
filterClearButton: "_filterClearButton_1pwn9_284",
|
|
97
|
+
filterApplyButton: "_filterApplyButton_1pwn9_285",
|
|
98
|
+
tableWrapper: "_tableWrapper_1pwn9_315",
|
|
99
|
+
table: "_table_1pwn9_315",
|
|
100
|
+
header: "_header_1pwn9_332",
|
|
101
|
+
dragging: "_dragging_1pwn9_349",
|
|
102
|
+
dragOver: "_dragOver_1pwn9_354",
|
|
103
|
+
headerContent: "_headerContent_1pwn9_359",
|
|
104
|
+
dragHandle: "_dragHandle_1pwn9_367",
|
|
105
|
+
columnTitle: "_columnTitle_1pwn9_384",
|
|
106
|
+
sortable: "_sortable_1pwn9_391",
|
|
107
|
+
sortIcon: "_sortIcon_1pwn9_408",
|
|
108
|
+
filterButton: "_filterButton_1pwn9_415",
|
|
109
|
+
filterButtonIcon: "_filterButtonIcon_1pwn9_451",
|
|
110
|
+
filterModal: "_filterModal_1pwn9_212",
|
|
111
|
+
row: "_row_1pwn9_474",
|
|
112
|
+
cell: "_cell_1pwn9_486",
|
|
113
|
+
statusBadge: "_statusBadge_1pwn9_507",
|
|
114
|
+
statusActive: "_statusActive_1pwn9_517",
|
|
115
|
+
statusInactive: "_statusInactive_1pwn9_522",
|
|
116
|
+
statusPending: "_statusPending_1pwn9_527",
|
|
117
|
+
statusCompleted: "_statusCompleted_1pwn9_532",
|
|
118
|
+
statusDraft: "_statusDraft_1pwn9_537",
|
|
119
|
+
pagination: "_pagination_1pwn9_543",
|
|
120
|
+
paginationInfo: "_paginationInfo_1pwn9_553",
|
|
121
|
+
paginationControls: "_paginationControls_1pwn9_560",
|
|
122
|
+
pageSizeSelect: "_pageSizeSelect_1pwn9_575",
|
|
123
|
+
pageButtons: "_pageButtons_1pwn9_591",
|
|
124
|
+
pageButton: "_pageButton_1pwn9_591",
|
|
125
|
+
exportButton: "_exportButton_1pwn9_659",
|
|
126
|
+
resetButton: "_resetButton_1pwn9_660",
|
|
127
|
+
filterModalSlideIn: "_filterModalSlideIn_1pwn9_1",
|
|
128
|
+
shimmer: "_shimmer_1pwn9_1",
|
|
129
|
+
columnCheckboxes: "_columnCheckboxes_1pwn9_1195"
|
|
130
|
+
}, FilterOption = ({ option: e, selectedValues: t, handleOptionToggle: n }) => /* @__PURE__ */ jsxs("div", {
|
|
131
|
+
className: `${AdvancedTable_module_default.filterOption} ${t.includes(e.value) ? AdvancedTable_module_default.selected : ""}`,
|
|
132
|
+
onClick: () => n(e),
|
|
133
|
+
children: [
|
|
134
|
+
/* @__PURE__ */ jsx("input", {
|
|
135
|
+
type: "checkbox",
|
|
136
|
+
className: AdvancedTable_module_default.filterOptionCheckbox,
|
|
137
|
+
checked: t.includes(e.value),
|
|
138
|
+
onChange: () => n(e),
|
|
139
|
+
onClick: (e) => e.stopPropagation()
|
|
140
|
+
}),
|
|
141
|
+
/* @__PURE__ */ jsx("span", {
|
|
142
|
+
className: AdvancedTable_module_default.filterOptionLabel,
|
|
143
|
+
children: e.value
|
|
144
|
+
}),
|
|
145
|
+
/* @__PURE__ */ jsx("span", {
|
|
146
|
+
className: AdvancedTable_module_default.filterOptionCount,
|
|
147
|
+
children: e.count
|
|
148
|
+
})
|
|
149
|
+
]
|
|
150
|
+
}, e.value), AdvancedFilter_default = ({ label: e, options: n, textValue: a, selectedValues: c, onTextChange: l, onSelectionChange: u, onClose: d }) => {
|
|
151
|
+
let [h, g] = useState(""), _ = useRef(null), v = n.filter((e) => e.value.toLowerCase().includes(h.toLowerCase()) || e.label.toLowerCase().includes(h.toLowerCase())), y = (e) => {
|
|
152
|
+
let t = c.includes(e.value) ? c.filter((t) => t !== e.value) : [...c, e.value];
|
|
153
|
+
u(t);
|
|
154
|
+
}, b = () => {
|
|
155
|
+
let e = v.map((e) => e.value);
|
|
156
|
+
u(e);
|
|
157
|
+
}, x = () => {
|
|
158
|
+
u([]), l("");
|
|
159
|
+
};
|
|
160
|
+
return useEffect(() => {
|
|
161
|
+
let e = (e) => {
|
|
162
|
+
_.current && !_.current.contains(e.target) && d();
|
|
163
|
+
};
|
|
164
|
+
return document.addEventListener("mousedown", e), () => {
|
|
165
|
+
document.removeEventListener("mousedown", e);
|
|
166
|
+
};
|
|
167
|
+
}, [d]), /* @__PURE__ */ jsxs("div", {
|
|
168
|
+
className: AdvancedTable_module_default.filterModal,
|
|
169
|
+
ref: _,
|
|
170
|
+
children: [
|
|
171
|
+
/* @__PURE__ */ jsxs("div", {
|
|
172
|
+
className: AdvancedTable_module_default.filterModalHeader,
|
|
173
|
+
children: [/* @__PURE__ */ jsx("input", {
|
|
174
|
+
type: "text",
|
|
175
|
+
className: AdvancedTable_module_default.filterSearchInput,
|
|
176
|
+
placeholder: `Buscar texto en ${e.toLowerCase()}...`,
|
|
177
|
+
value: a,
|
|
178
|
+
onChange: (e) => l(e.target.value),
|
|
179
|
+
autoFocus: !0
|
|
180
|
+
}), /* @__PURE__ */ jsx("input", {
|
|
181
|
+
type: "text",
|
|
182
|
+
className: AdvancedTable_module_default.filterSearchInput,
|
|
183
|
+
placeholder: "Buscar opciones...",
|
|
184
|
+
value: h,
|
|
185
|
+
onChange: (e) => g(e.target.value),
|
|
186
|
+
style: { marginTop: "8px" }
|
|
187
|
+
})]
|
|
188
|
+
}),
|
|
189
|
+
/* @__PURE__ */ jsxs("div", {
|
|
190
|
+
className: AdvancedTable_module_default.filterOptions,
|
|
191
|
+
children: [
|
|
192
|
+
/* @__PURE__ */ jsxs("div", {
|
|
193
|
+
className: AdvancedTable_module_default.filterOption,
|
|
194
|
+
style: {
|
|
195
|
+
borderBottom: "1px solid #e5e7eb",
|
|
196
|
+
marginBottom: "4px",
|
|
197
|
+
paddingBottom: "8px"
|
|
198
|
+
},
|
|
199
|
+
children: [/* @__PURE__ */ jsx(Button_default, {
|
|
200
|
+
onClick: b,
|
|
201
|
+
size: "small",
|
|
202
|
+
level: "tertiary",
|
|
203
|
+
children: "Seleccionar todo"
|
|
204
|
+
}), /* @__PURE__ */ jsx(Button_default, {
|
|
205
|
+
onClick: x,
|
|
206
|
+
size: "small",
|
|
207
|
+
level: "tertiary",
|
|
208
|
+
children: "Limpiar todo"
|
|
209
|
+
})]
|
|
210
|
+
}),
|
|
211
|
+
v.map((e) => /* @__PURE__ */ jsx(FilterOption, {
|
|
212
|
+
option: e,
|
|
213
|
+
selectedValues: c,
|
|
214
|
+
handleOptionToggle: y
|
|
215
|
+
}, e.value)),
|
|
216
|
+
v.length === 0 && /* @__PURE__ */ jsx("div", {
|
|
217
|
+
className: AdvancedTable_module_default.filterOption,
|
|
218
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
219
|
+
className: AdvancedTable_module_default.filterOptionLabel,
|
|
220
|
+
children: "No se encontraron opciones"
|
|
221
|
+
})
|
|
222
|
+
})
|
|
223
|
+
]
|
|
224
|
+
}),
|
|
225
|
+
/* @__PURE__ */ jsxs("div", {
|
|
226
|
+
className: AdvancedTable_module_default.filterModalActions,
|
|
227
|
+
children: [/* @__PURE__ */ jsx(Button_default, {
|
|
228
|
+
onClick: x,
|
|
229
|
+
level: "tertiary",
|
|
230
|
+
children: "Limpiar todo"
|
|
231
|
+
}), /* @__PURE__ */ jsxs(Button_default, {
|
|
232
|
+
onClick: d,
|
|
233
|
+
level: "primary",
|
|
234
|
+
children: [
|
|
235
|
+
"Aplicar (",
|
|
236
|
+
c.length + (a ? 1 : 0),
|
|
237
|
+
")"
|
|
238
|
+
]
|
|
239
|
+
})]
|
|
240
|
+
})
|
|
241
|
+
]
|
|
242
|
+
});
|
|
243
|
+
};
|
|
244
|
+
/*! js-cookie v3.0.5 | MIT */
|
|
245
|
+
function assign(e) {
|
|
246
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
247
|
+
var n = arguments[t];
|
|
248
|
+
for (var r in n) e[r] = n[r];
|
|
249
|
+
}
|
|
250
|
+
return e;
|
|
251
|
+
}
|
|
252
|
+
var defaultConverter = {
|
|
253
|
+
read: function(e) {
|
|
254
|
+
return e[0] === "\"" && (e = e.slice(1, -1)), e.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
|
|
255
|
+
},
|
|
256
|
+
write: function(e) {
|
|
257
|
+
return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g, decodeURIComponent);
|
|
258
|
+
}
|
|
259
|
+
};
|
|
260
|
+
function init(e, t) {
|
|
261
|
+
function n(n, r, i) {
|
|
262
|
+
if (!(typeof document > "u")) {
|
|
263
|
+
i = assign({}, t, i), typeof i.expires == "number" && (i.expires = new Date(Date.now() + i.expires * 864e5)), i.expires &&= i.expires.toUTCString(), n = encodeURIComponent(n).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
|
|
264
|
+
var a = "";
|
|
265
|
+
for (var o in i) i[o] && (a += "; " + o, i[o] !== !0 && (a += "=" + i[o].split(";")[0]));
|
|
266
|
+
return document.cookie = n + "=" + e.write(r, n) + a;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
function r(t) {
|
|
270
|
+
if (!(typeof document > "u" || arguments.length && !t)) {
|
|
271
|
+
for (var n = document.cookie ? document.cookie.split("; ") : [], r = {}, i = 0; i < n.length; i++) {
|
|
272
|
+
var a = n[i].split("="), o = a.slice(1).join("=");
|
|
273
|
+
try {
|
|
274
|
+
var s = decodeURIComponent(a[0]);
|
|
275
|
+
if (r[s] = e.read(o, s), t === s) break;
|
|
276
|
+
} catch {}
|
|
277
|
+
}
|
|
278
|
+
return t ? r[t] : r;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
return Object.create({
|
|
282
|
+
set: n,
|
|
283
|
+
get: r,
|
|
284
|
+
remove: function(e, t) {
|
|
285
|
+
n(e, "", assign({}, t, { expires: -1 }));
|
|
286
|
+
},
|
|
287
|
+
withAttributes: function(e) {
|
|
288
|
+
return init(this.converter, assign({}, this.attributes, e));
|
|
289
|
+
},
|
|
290
|
+
withConverter: function(e) {
|
|
291
|
+
return init(assign({}, this.converter, e), this.attributes);
|
|
292
|
+
}
|
|
293
|
+
}, {
|
|
294
|
+
attributes: { value: Object.freeze(t) },
|
|
295
|
+
converter: { value: Object.freeze(e) }
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
var api = init(defaultConverter, { path: "/" }), COOKIE_EXPIRES = 30;
|
|
299
|
+
const useAdvancedTable = (r) => {
|
|
300
|
+
let { data: a, columns: o, defaultSort: s, defaultFilters: c = {}, defaultPageSize: l = 10, pageSizeOptions: u = [
|
|
301
|
+
10,
|
|
302
|
+
25,
|
|
303
|
+
50,
|
|
304
|
+
100,
|
|
305
|
+
200,
|
|
306
|
+
300,
|
|
307
|
+
400,
|
|
308
|
+
500
|
|
309
|
+
], persistConfig: d = !0, configKey: f = "advanced-table-config", onConfigChange: p } = r, m = useCallback(() => {
|
|
310
|
+
if (!d) return null;
|
|
311
|
+
try {
|
|
312
|
+
let e = api.get(f);
|
|
313
|
+
return e ? JSON.parse(e) : null;
|
|
314
|
+
} catch (e) {
|
|
315
|
+
return console.warn("Error loading table config from cookies:", e), null;
|
|
316
|
+
}
|
|
317
|
+
}, [d, f]), h = useCallback((e) => {
|
|
318
|
+
if (d) try {
|
|
319
|
+
api.set(f, JSON.stringify(e), { expires: COOKIE_EXPIRES });
|
|
320
|
+
} catch (e) {
|
|
321
|
+
console.warn("Error saving table config to cookies:", e);
|
|
322
|
+
}
|
|
323
|
+
}, [d, f]), g = m(), [_, v] = useState(g?.sortConfig || s || void 0), [x, S] = useState(g?.filters || c), [C, w] = useState(g?.columnOrder || o.map((e) => e.id)), [T, E] = useState(g?.hiddenColumns || []), [D, O] = useState({
|
|
324
|
+
page: 1,
|
|
325
|
+
pageSize: g?.pagination?.pageSize || l,
|
|
326
|
+
total: a.length
|
|
327
|
+
}), k = useMemo(() => {
|
|
328
|
+
let e = [...a];
|
|
329
|
+
return Object.entries(x).forEach(([t, n]) => {
|
|
330
|
+
let r = o.find((e) => e.id === t);
|
|
331
|
+
r && (e = e.filter((e) => {
|
|
332
|
+
let t = typeof r.accessor == "function" ? r.accessor(e) : e[r.accessor], i = String(t || "").toLowerCase(), a = !0;
|
|
333
|
+
return n.type === "text" && n.value && (a &&= i.includes(String(n.value).toLowerCase())), n.type === "select" && n.value && (a &&= i === String(n.value).toLowerCase()), n.type === "multiselect" && Array.isArray(n.value) && n.value.length > 0 && (a &&= n.value.some((e) => i === String(e).toLowerCase())), a;
|
|
334
|
+
}));
|
|
335
|
+
}), e;
|
|
336
|
+
}, [
|
|
337
|
+
a,
|
|
338
|
+
x,
|
|
339
|
+
o
|
|
340
|
+
]), A = useMemo(() => {
|
|
341
|
+
if (!_) return k;
|
|
342
|
+
let e = o.find((e) => e.id === _.column);
|
|
343
|
+
return e ? [...k].sort((t, n) => {
|
|
344
|
+
let r = typeof e.accessor == "function" ? e.accessor(t) : t[e.accessor], i = typeof e.accessor == "function" ? e.accessor(n) : n[e.accessor];
|
|
345
|
+
if (r == null) return 1;
|
|
346
|
+
if (i == null) return -1;
|
|
347
|
+
let a = 0;
|
|
348
|
+
if (typeof r == "number" && typeof i == "number") a = r - i;
|
|
349
|
+
else if (typeof r == "boolean" && typeof i == "boolean") a = r === i ? 0 : r ? 1 : -1;
|
|
350
|
+
else if (r instanceof Date && i instanceof Date) a = r.getTime() - i.getTime();
|
|
351
|
+
else {
|
|
352
|
+
let e = String(r).toLowerCase(), t = String(i).toLowerCase();
|
|
353
|
+
a = e.localeCompare(t);
|
|
354
|
+
}
|
|
355
|
+
return _.direction === "desc" ? a * -1 : a;
|
|
356
|
+
}) : k;
|
|
357
|
+
}, [
|
|
358
|
+
k,
|
|
359
|
+
_,
|
|
360
|
+
o
|
|
361
|
+
]), j = useMemo(() => {
|
|
362
|
+
let e = (D.page - 1) * D.pageSize, t = e + D.pageSize;
|
|
363
|
+
return A.slice(e, t);
|
|
364
|
+
}, [
|
|
365
|
+
A,
|
|
366
|
+
D.page,
|
|
367
|
+
D.pageSize
|
|
368
|
+
]);
|
|
369
|
+
useEffect(() => {
|
|
370
|
+
O((e) => ({
|
|
371
|
+
...e,
|
|
372
|
+
total: k.length,
|
|
373
|
+
page: Math.min(e.page, Math.ceil(k.length / e.pageSize) || 1)
|
|
374
|
+
}));
|
|
375
|
+
}, [k.length]), useEffect(() => {
|
|
376
|
+
let e = {
|
|
377
|
+
sort: _,
|
|
378
|
+
filters: x,
|
|
379
|
+
columnOrder: C,
|
|
380
|
+
hiddenColumns: T,
|
|
381
|
+
pageSize: D.pageSize
|
|
382
|
+
};
|
|
383
|
+
h(e), p?.({
|
|
384
|
+
sort: _,
|
|
385
|
+
filters: x,
|
|
386
|
+
pagination: D,
|
|
387
|
+
columnOrder: C,
|
|
388
|
+
hiddenColumns: T,
|
|
389
|
+
columns: o
|
|
390
|
+
});
|
|
391
|
+
}, [
|
|
392
|
+
_,
|
|
393
|
+
x,
|
|
394
|
+
C,
|
|
395
|
+
T,
|
|
396
|
+
D.pageSize,
|
|
397
|
+
h,
|
|
398
|
+
p,
|
|
399
|
+
D,
|
|
400
|
+
o
|
|
401
|
+
]);
|
|
402
|
+
let M = useCallback((e) => {
|
|
403
|
+
v((t) => t?.column === e ? t.direction === "asc" ? {
|
|
404
|
+
column: e,
|
|
405
|
+
direction: "desc"
|
|
406
|
+
} : void 0 : {
|
|
407
|
+
column: e,
|
|
408
|
+
direction: "asc"
|
|
409
|
+
});
|
|
410
|
+
}, []), N = useCallback((e, t, n = "text") => {
|
|
411
|
+
S((r) => ({
|
|
412
|
+
...r,
|
|
413
|
+
[e]: {
|
|
414
|
+
type: n,
|
|
415
|
+
value: t,
|
|
416
|
+
options: r[e]?.options
|
|
417
|
+
}
|
|
418
|
+
})), O((e) => ({
|
|
419
|
+
...e,
|
|
420
|
+
page: 1
|
|
421
|
+
}));
|
|
422
|
+
}, []), P = useCallback((e) => {
|
|
423
|
+
S((t) => {
|
|
424
|
+
let n = { ...t };
|
|
425
|
+
return delete n[e], n;
|
|
426
|
+
});
|
|
427
|
+
}, []), F = useCallback(() => {
|
|
428
|
+
S({});
|
|
429
|
+
}, []), I = useCallback((e) => {
|
|
430
|
+
O((t) => ({
|
|
431
|
+
...t,
|
|
432
|
+
page: e
|
|
433
|
+
}));
|
|
434
|
+
}, []), L = useCallback((e) => {
|
|
435
|
+
O((t) => ({
|
|
436
|
+
...t,
|
|
437
|
+
pageSize: e,
|
|
438
|
+
page: 1
|
|
439
|
+
}));
|
|
440
|
+
}, []), R = useCallback((e) => {
|
|
441
|
+
w(e);
|
|
442
|
+
}, []), z = useCallback((e) => {
|
|
443
|
+
E((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
|
|
444
|
+
}, []), B = useMemo(() => C.map((e) => o.find((t) => t.id === e)).filter(Boolean).filter((e) => !T.includes(e.id)), [
|
|
445
|
+
C,
|
|
446
|
+
o,
|
|
447
|
+
T
|
|
448
|
+
]);
|
|
449
|
+
return {
|
|
450
|
+
state: {
|
|
451
|
+
data: a,
|
|
452
|
+
filteredData: k,
|
|
453
|
+
paginatedData: j,
|
|
454
|
+
sortConfig: _,
|
|
455
|
+
filters: x,
|
|
456
|
+
pagination: D,
|
|
457
|
+
columnOrder: C,
|
|
458
|
+
hiddenColumns: T,
|
|
459
|
+
loading: !1
|
|
460
|
+
},
|
|
461
|
+
orderedColumns: B,
|
|
462
|
+
pageSizeOptions: u,
|
|
463
|
+
handleSort: M,
|
|
464
|
+
handleFilter: N,
|
|
465
|
+
clearFilter: P,
|
|
466
|
+
clearAllFilters: F,
|
|
467
|
+
handlePageChange: I,
|
|
468
|
+
handlePageSizeChange: L,
|
|
469
|
+
handleColumnReorder: R,
|
|
470
|
+
handleToggleColumn: z,
|
|
471
|
+
allColumns: o
|
|
472
|
+
};
|
|
473
|
+
};
|
|
474
|
+
var AdvancedTable_default = ({ data: e, columns: n, defaultSort: a, defaultFilters: m = {}, defaultPageSize: g = 10, pageSizeOptions: _ = [
|
|
475
|
+
10,
|
|
476
|
+
25,
|
|
477
|
+
50,
|
|
478
|
+
100,
|
|
479
|
+
200,
|
|
480
|
+
300,
|
|
481
|
+
400,
|
|
482
|
+
500
|
|
483
|
+
], enableSorting: v = !0, enableFiltering: y = !0, enablePagination: b = !0, enableExport: S = !0, persistConfig: C = !0, configKey: w = "advancedTable", className: T = "", labels: E = {
|
|
484
|
+
configuration: "Configuración",
|
|
485
|
+
columnVisibility: "Columnas visibles",
|
|
486
|
+
pagination: {
|
|
487
|
+
showingItems: "Mostrando",
|
|
488
|
+
to: "a",
|
|
489
|
+
of: "de",
|
|
490
|
+
items: "elementos",
|
|
491
|
+
showPerPage: "Mostrar",
|
|
492
|
+
perPageItems: "elementos"
|
|
493
|
+
}
|
|
494
|
+
} }) => {
|
|
495
|
+
let [D, O] = useState(null), [k, A] = useState(null), [j, M] = useState(!1), [N, P] = useState(null), F = useRef(null), { state: I, orderedColumns: L, handleSort: R, handleFilter: z, clearAllFilters: B, handlePageChange: V, handlePageSizeChange: H, handleColumnReorder: U, handleToggleColumn: W } = useAdvancedTable({
|
|
496
|
+
data: e,
|
|
497
|
+
columns: n,
|
|
498
|
+
defaultSort: a,
|
|
499
|
+
defaultFilters: m,
|
|
500
|
+
defaultPageSize: g,
|
|
501
|
+
pageSizeOptions: _,
|
|
502
|
+
persistConfig: C,
|
|
503
|
+
configKey: w
|
|
504
|
+
}), { paginatedData: G, sortConfig: K, filters: q, pagination: J, hiddenColumns: Y } = I, X = (e, t) => {
|
|
505
|
+
O(t), e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData("text/html", "");
|
|
506
|
+
}, Z = (e, t) => {
|
|
507
|
+
e.preventDefault(), e.dataTransfer.dropEffect = "move", A(t);
|
|
508
|
+
}, Q = () => {
|
|
509
|
+
A(null);
|
|
510
|
+
}, ee = (e, t) => {
|
|
511
|
+
if (e.preventDefault(), D !== null) {
|
|
512
|
+
if (D !== t) {
|
|
513
|
+
let e = [...I.columnOrder], [n] = e.splice(D, 1);
|
|
514
|
+
e.splice(t, 0, n), U(e);
|
|
515
|
+
}
|
|
516
|
+
O(null), A(null);
|
|
517
|
+
}
|
|
518
|
+
}, te = () => {
|
|
519
|
+
O(null), A(null);
|
|
520
|
+
}, ne = () => {}, re = (e) => {
|
|
521
|
+
P(N === e ? null : e);
|
|
522
|
+
}, ie = (t) => {
|
|
523
|
+
let r = n.find((e) => e.id === t);
|
|
524
|
+
if (!r) return [];
|
|
525
|
+
let i = /* @__PURE__ */ new Map();
|
|
526
|
+
return e.forEach((e) => {
|
|
527
|
+
let t = typeof r.accessor == "function" ? r.accessor(e) : e[r.accessor], n = formatCellValue(t);
|
|
528
|
+
i.set(n, (i.get(n) || 0) + 1);
|
|
529
|
+
}), Array.from(i.entries()).map(([e, t]) => ({
|
|
530
|
+
value: e,
|
|
531
|
+
count: t,
|
|
532
|
+
label: `${e} (${t})`
|
|
533
|
+
})).sort((e, t) => e.value.localeCompare(t.value));
|
|
534
|
+
}, ae = Object.values(q).some((e) => e.type === "text" && e.value || e.type === "select" && e.value || e.type === "multiselect" && Array.isArray(e.value) && e.value.length > 0);
|
|
535
|
+
useEffect(() => {
|
|
536
|
+
let e = (e) => {
|
|
537
|
+
F.current && !F.current.contains(e.target) && M(!1);
|
|
538
|
+
};
|
|
539
|
+
return j && document.addEventListener("mousedown", e), () => {
|
|
540
|
+
document.removeEventListener("mousedown", e);
|
|
541
|
+
};
|
|
542
|
+
}, [j]);
|
|
543
|
+
let $ = Math.ceil(J.total / J.pageSize);
|
|
544
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
545
|
+
className: `w-full bg-redi-background border border-solid border-gray-500 rounded-xl overflow-hidden font-family-base shadow ${T}`,
|
|
546
|
+
children: [
|
|
547
|
+
/* @__PURE__ */ jsxs("div", {
|
|
548
|
+
className: "flex items-center justify-between p-4 bg-transparent border-b border-solid border-gray-400",
|
|
549
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
550
|
+
className: "flex items-center gap-2",
|
|
551
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
552
|
+
className: "relative",
|
|
553
|
+
children: [/* @__PURE__ */ jsxs(Button_default, {
|
|
554
|
+
level: "secondary",
|
|
555
|
+
onClick: () => M(!j),
|
|
556
|
+
children: [/* @__PURE__ */ jsx(EyeIcon, {}), /* @__PURE__ */ jsx("span", {
|
|
557
|
+
className: "hidden md:block",
|
|
558
|
+
children: E.configuration
|
|
559
|
+
})]
|
|
560
|
+
}), j && /* @__PURE__ */ jsx("div", {
|
|
561
|
+
className: "absolute top-full left-0 bg-white border border-solid border-gray-300 rounded-md shadow-lg z-1000 mt-2 min-w-2xs max-w-xs opacity-100 visible p-4",
|
|
562
|
+
ref: F,
|
|
563
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
564
|
+
className: "mb-4 last:mb-0",
|
|
565
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
566
|
+
className: "text-sm font-semibold text-redi-text mb-2 uppercase",
|
|
567
|
+
children: E.columnVisibility
|
|
568
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
569
|
+
className: "flex flex-col gap-2",
|
|
570
|
+
children: n.map((e) => /* @__PURE__ */ jsxs("div", {
|
|
571
|
+
className: "flex items-center gap-2",
|
|
572
|
+
children: [/* @__PURE__ */ jsx("input", {
|
|
573
|
+
type: "checkbox",
|
|
574
|
+
className: "w-4 h-4 accent-redi-primary",
|
|
575
|
+
checked: !Y.includes(e.id),
|
|
576
|
+
onChange: () => W(e.id)
|
|
577
|
+
}), /* @__PURE__ */ jsx("label", { children: e.label })]
|
|
578
|
+
}, e.id))
|
|
579
|
+
})]
|
|
580
|
+
})
|
|
581
|
+
})]
|
|
582
|
+
}), y && ae && /* @__PURE__ */ jsx("button", {
|
|
583
|
+
onClick: B,
|
|
584
|
+
className: `${AdvancedTable_module_default.actionButton} ${AdvancedTable_module_default.reset}`,
|
|
585
|
+
title: "Limpiar todos los filtros",
|
|
586
|
+
children: /* @__PURE__ */ jsx("svg", {
|
|
587
|
+
className: AdvancedTable_module_default.buttonIcon,
|
|
588
|
+
viewBox: "0 0 20 20",
|
|
589
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
590
|
+
fillRule: "evenodd",
|
|
591
|
+
d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",
|
|
592
|
+
clipRule: "evenodd"
|
|
593
|
+
})
|
|
594
|
+
})
|
|
595
|
+
})]
|
|
596
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
597
|
+
className: AdvancedTable_module_default.rightControls,
|
|
598
|
+
children: S && /* @__PURE__ */ jsx(Button_default, {
|
|
599
|
+
level: "secondary",
|
|
600
|
+
onClick: ne,
|
|
601
|
+
children: /* @__PURE__ */ jsx(DownloadIcon, { size: 18 })
|
|
602
|
+
})
|
|
603
|
+
})]
|
|
604
|
+
}),
|
|
605
|
+
/* @__PURE__ */ jsx("div", {
|
|
606
|
+
className: "overflow-x-auto max-h-[600px] min-h-[500px] overflow-y-auto bg-white relative",
|
|
607
|
+
children: /* @__PURE__ */ jsxs("table", {
|
|
608
|
+
className: "w-full border-collapse table-auto text-sm relative",
|
|
609
|
+
children: [/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", { children: L.map((e, t) => /* @__PURE__ */ jsx("th", {
|
|
610
|
+
className: `bg-gray-50 border-b border-solid border-gray-200 text-left font-semibold text-redi-text p-0 sticky top-0 z-10 select-none hover:bg-gray-200 ${D === t ? "opacity-50 bg-gray-300" : ""} ${k === t ? "bg-redi-primary-bg border-l border-solid border-redi-primary" : ""}`,
|
|
611
|
+
draggable: !0,
|
|
612
|
+
onDragStart: (e) => X(e, t),
|
|
613
|
+
onDragOver: (e) => Z(e, t),
|
|
614
|
+
onDragLeave: Q,
|
|
615
|
+
onDrop: (e) => ee(e, t),
|
|
616
|
+
onDragEnd: te,
|
|
617
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
618
|
+
className: AdvancedTable_module_default.headerContent,
|
|
619
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
620
|
+
className: AdvancedTable_module_default.dragHandle,
|
|
621
|
+
children: "⋮⋮"
|
|
622
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
623
|
+
className: AdvancedTable_module_default.columnTitle,
|
|
624
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
625
|
+
className: v ? AdvancedTable_module_default.sortable : "",
|
|
626
|
+
onClick: (t) => {
|
|
627
|
+
t.stopPropagation(), v && R(e.id);
|
|
628
|
+
},
|
|
629
|
+
children: [e.label, v && K?.column === e.id && /* @__PURE__ */ jsx("span", {
|
|
630
|
+
className: AdvancedTable_module_default.sortIcon,
|
|
631
|
+
children: K.direction === "asc" ? " ↑" : " ↓"
|
|
632
|
+
})]
|
|
633
|
+
}), y && /* @__PURE__ */ jsxs("div", {
|
|
634
|
+
style: { position: "relative" },
|
|
635
|
+
children: [/* @__PURE__ */ jsx(Button_default, {
|
|
636
|
+
level: "icon",
|
|
637
|
+
onClick: (t) => {
|
|
638
|
+
t.stopPropagation(), re(e.id);
|
|
639
|
+
},
|
|
640
|
+
children: /* @__PURE__ */ jsx(FilterIcon, { size: 16 })
|
|
641
|
+
}), N === e.id && /* @__PURE__ */ jsx(AdvancedFilter_default, {
|
|
642
|
+
columnId: e.id,
|
|
643
|
+
label: e.label,
|
|
644
|
+
options: ie(e.id),
|
|
645
|
+
textValue: q[e.id]?.type === "text" ? String(q[e.id].value || "") : "",
|
|
646
|
+
selectedValues: q[e.id]?.type === "multiselect" && Array.isArray(q[e.id]?.value) ? q[e.id].value : [],
|
|
647
|
+
onTextChange: (t) => z(e.id, t, "text"),
|
|
648
|
+
onSelectionChange: (t) => z(e.id, t, "multiselect"),
|
|
649
|
+
onClose: () => P(null)
|
|
650
|
+
})]
|
|
651
|
+
})]
|
|
652
|
+
})]
|
|
653
|
+
})
|
|
654
|
+
}, e.id)) }) }), /* @__PURE__ */ jsx("tbody", { children: G.map((e, t) => /* @__PURE__ */ jsx("tr", {
|
|
655
|
+
className: AdvancedTable_module_default.row,
|
|
656
|
+
children: L.map((n) => {
|
|
657
|
+
let r = typeof n.accessor == "function" ? n.accessor(e) : e[n.accessor];
|
|
658
|
+
return n.render ? /* @__PURE__ */ jsx("td", {
|
|
659
|
+
className: AdvancedTable_module_default.cell,
|
|
660
|
+
children: n.render(r, e, t)
|
|
661
|
+
}, n.id) : /* @__PURE__ */ jsx("td", {
|
|
662
|
+
className: AdvancedTable_module_default.cell,
|
|
663
|
+
children: formatCellValue(r)
|
|
664
|
+
}, n.id);
|
|
665
|
+
})
|
|
666
|
+
}, t)) })]
|
|
667
|
+
})
|
|
668
|
+
}),
|
|
669
|
+
b && /* @__PURE__ */ jsxs("div", {
|
|
670
|
+
className: "flex items-center justify-between py-4 px-6 bg-white border-t-gray-300 border-solid border-t gap-4",
|
|
671
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
672
|
+
className: "text-redi-text text-base font-medium shrink-0",
|
|
673
|
+
children: /* @__PURE__ */ jsxs("span", { children: [
|
|
674
|
+
E.pagination?.showingItems,
|
|
675
|
+
" ",
|
|
676
|
+
(J.page - 1) * J.pageSize + 1,
|
|
677
|
+
" ",
|
|
678
|
+
E.pagination?.to,
|
|
679
|
+
" ",
|
|
680
|
+
Math.min(J.page * J.pageSize, J.total),
|
|
681
|
+
" ",
|
|
682
|
+
E.pagination?.of,
|
|
683
|
+
" ",
|
|
684
|
+
J.total,
|
|
685
|
+
" ",
|
|
686
|
+
E.pagination?.items
|
|
687
|
+
] })
|
|
688
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
689
|
+
className: "flex items-center gap-5",
|
|
690
|
+
children: [/* @__PURE__ */ jsxs("label", {
|
|
691
|
+
className: "flex items-center gap-3 text-sm font-semibold text-redi-text",
|
|
692
|
+
children: [
|
|
693
|
+
E.pagination?.showPerPage,
|
|
694
|
+
/* @__PURE__ */ jsx("select", {
|
|
695
|
+
value: J.pageSize,
|
|
696
|
+
onChange: (e) => H(Number(e.target.value)),
|
|
697
|
+
className: AdvancedTable_module_default.pageSizeSelect,
|
|
698
|
+
children: _.map((e) => /* @__PURE__ */ jsx("option", {
|
|
699
|
+
value: e,
|
|
700
|
+
children: e
|
|
701
|
+
}, e))
|
|
702
|
+
}),
|
|
703
|
+
E.pagination?.perPageItems
|
|
704
|
+
]
|
|
705
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
706
|
+
className: "flex gap-1 items-center",
|
|
707
|
+
children: [
|
|
708
|
+
/* @__PURE__ */ jsx(Button_default, {
|
|
709
|
+
level: "icon",
|
|
710
|
+
onClick: () => V(1),
|
|
711
|
+
disabled: J.page === 1,
|
|
712
|
+
children: "<<"
|
|
713
|
+
}),
|
|
714
|
+
/* @__PURE__ */ jsx(Button_default, {
|
|
715
|
+
level: "icon",
|
|
716
|
+
onClick: () => V(J.page - 1),
|
|
717
|
+
disabled: J.page === 1,
|
|
718
|
+
children: "<"
|
|
719
|
+
}),
|
|
720
|
+
Array.from({ length: Math.min(3, $) }, (e, t) => {
|
|
721
|
+
let n;
|
|
722
|
+
return n = $ <= 3 || J.page <= 2 ? t + 1 : J.page > $ - 2 ? $ - 2 + t : J.page - 1 + t, /* @__PURE__ */ jsx(Button_default, {
|
|
723
|
+
level: J.page === n ? "primary" : "secondary",
|
|
724
|
+
onClick: () => V(n),
|
|
725
|
+
children: n
|
|
726
|
+
}, n);
|
|
727
|
+
}),
|
|
728
|
+
/* @__PURE__ */ jsx(Button_default, {
|
|
729
|
+
level: "icon",
|
|
730
|
+
onClick: () => V(J.page + 1),
|
|
731
|
+
disabled: J.page === $,
|
|
732
|
+
children: ">"
|
|
733
|
+
}),
|
|
734
|
+
/* @__PURE__ */ jsx(Button_default, {
|
|
735
|
+
level: "icon",
|
|
736
|
+
onClick: () => V($),
|
|
737
|
+
disabled: J.page === $,
|
|
738
|
+
children: ">>"
|
|
739
|
+
})
|
|
740
|
+
]
|
|
741
|
+
})]
|
|
742
|
+
})]
|
|
743
|
+
})
|
|
744
|
+
]
|
|
745
|
+
});
|
|
746
|
+
};
|
|
747
|
+
export { AdvancedTable_default as AdvancedTable, Button_default as Button };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`react`),require(`react/jsx-runtime`)):typeof define==`function`&&define.amd?define([`exports`,`react`,`react/jsx-runtime`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e[`redi-components`]={},e.React,e[`react/jsxRuntime`]))})(this,function(e,t,n){var r=Object.create,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,l=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var s=o(t),l=0,u=s.length,d;l<u;l++)d=s[l],!c.call(e,d)&&d!==n&&i(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(r=a(t,d))||r.enumerable});return e},u=(e,t,n)=>(n=e==null?{}:r(s(e)),l(t||!e||!e.__esModule?i(n,`default`,{value:e,enumerable:!0}):n,e));t=u(t),n=u(n);let d=({color:e,size:t=24})=>(0,n.jsx)(`svg`,{width:t,height:t,viewBox:`0 0 20 20`,fill:e,children:(0,n.jsx)(`path`,{fillRule:`evenodd`,d:`M3 17a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm3.293-7.707a1 1 0 011.414 0L9 10.586V3a1 1 0 112 0v7.586l1.293-1.293a1 1 0 111.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z`,clipRule:`evenodd`,fill:`currentColor`})}),f=({color:e,size:t=20})=>(0,n.jsxs)(`svg`,{viewBox:`0 0 20 20`,fill:e,width:t,height:t,children:[(0,n.jsx)(`path`,{d:`M10 12a2 2 0 100-4 2 2 0 000 4z`,fill:`currentColor`}),(0,n.jsx)(`path`,{fillRule:`evenodd`,d:`M.458 10C1.732 5.943 5.522 3 10 3s8.268 2.943 9.542 7c-1.274 4.057-5.064 7-9.542 7S1.732 14.057.458 10zM14 10a4 4 0 11-8 0 4 4 0 018 0z`,clipRule:`evenodd`,fill:`currentColor`})]}),p=({color:e,size:t=24})=>(0,n.jsx)(`svg`,{fill:e,stroke:`currentColor`,viewBox:`0 0 24 24`,width:t,height:t,children:(0,n.jsx)(`path`,{fillRule:`evenodd`,d:`M3 3a1 1 0 011-1h12a1 1 0 011 1v3a1 1 0 01-.293.707L12 11.414V15a1 1 0 01-.293.707l-2 2A1 1 0 018 17v-5.586L3.293 6.707A1 1 0 013 6V3z`,clipRule:`evenodd`,fill:`currentColor`})}),m=e=>e==null?``:typeof e==`boolean`?e?`Sí`:`No`:typeof e==`number`?e.toLocaleString():e instanceof Date?e.toLocaleDateString():String(e);var h=({level:e=`primary`,size:t=`medium`,type:r=`button`,posIcon:i=`left`,disabled:a=!1,label:o,icon:s,children:c,...l})=>{let u=`disabled:text-redi-disabled-text disabled:border-redi-disabled-border disabled:cursor-not-allowed`,d={primary:`bg-redi-primary-bg hover:bg-redi-primary-bg-hover text-redi-primary-text active:ring-2 active:ring-redi-primary-bg-active active:border-[1px] active:border-white active:border-solid disabled:bg-redi-disabled-bg ${u}`,secondary:`bg-redi-secondary-bg hover:bg-redi-secondary-bg-hover text-redi-secondary-text active:ring-2 active:ring-redi-secondary-bg-active active:border-[1px] active:border-white active:border-solid border-1 border-solid disabled:bg-redi-disabled-bg ${u}`,tertiary:`bg-redi-tertiary-bg hover:bg-redi-tertiary-bg-hover text-redi-tertiary-text active:ring-2 active:ring-redi-tertiary-bg-active active:border-[1px] active:border-white active:border-solid disabled:bg-redi-disabled-bg ${u}`,link:`bg-transparent hover:bg-redi-link-bg text-redi-link-text active:ring-2 active:ring-redi-link-bg-active active:border-[1px] active:border-white active:border-solid underline underline-offset-4 ${u}`,icon:`bg-transparent hover:bg-redi-icon-bg text-redi-icon-text active:ring-2 active:ring-redi-icon-bg-active active:border-[1px] active:border-white active:border-solid ${u}`};return(0,n.jsx)(`button`,{type:r,name:`button-${o}`,disabled:a,className:`cursor-pointer rounded-lg font-family-base transition-all duration-200 ${d[e]} ${{small:`px-3 py-1 text-sm`,medium:`px-4 py-2 text-xs`,large:`px-6 py-3 text-lg`}[t]} flex gap-x-1 items-center justify-center`,...l,children:c||(0,n.jsxs)(n.Fragment,{children:[s&&i===`left`&&s,o&&e!==`icon`&&(0,n.jsx)(`span`,{children:o}),s&&i===`right`&&s]})})},g={controls:`_controls_1pwn9_1`,leftControls:`_leftControls_1pwn9_10`,rightControls:`_rightControls_1pwn9_16`,configButton:`_configButton_1pwn9_23`,configIcon:`_configIcon_1pwn9_42`,configSection:`_configSection_1pwn9_49`,configSectionTitle:`_configSectionTitle_1pwn9_57`,configOptions:`_configOptions_1pwn9_66`,configOption:`_configOption_1pwn9_66`,actionButton:`_actionButton_1pwn9_91`,export:`_export_1pwn9_110`,reset:`_reset_1pwn9_120`,buttonIcon:`_buttonIcon_1pwn9_130`,filtersContainer:`_filtersContainer_1pwn9_137`,active:`_active_1pwn9_145`,filtersRow:`_filtersRow_1pwn9_149`,filterGroup:`_filterGroup_1pwn9_156`,filterLabel:`_filterLabel_1pwn9_162`,filterDropdown:`_filterDropdown_1pwn9_172`,filterDropdownButton:`_filterDropdownButton_1pwn9_177`,filterDropdownIcon:`_filterDropdownIcon_1pwn9_200`,filterModalHeader:`_filterModalHeader_1pwn9_212`,filterSearchInput:`_filterSearchInput_1pwn9_217`,filterOptions:`_filterOptions_1pwn9_231`,filterOption:`_filterOption_1pwn9_231`,selected:`_selected_1pwn9_250`,filterOptionCheckbox:`_filterOptionCheckbox_1pwn9_254`,filterOptionLabel:`_filterOptionLabel_1pwn9_260`,filterOptionCount:`_filterOptionCount_1pwn9_266`,filterModalActions:`_filterModalActions_1pwn9_275`,filterClearButton:`_filterClearButton_1pwn9_284`,filterApplyButton:`_filterApplyButton_1pwn9_285`,tableWrapper:`_tableWrapper_1pwn9_315`,table:`_table_1pwn9_315`,header:`_header_1pwn9_332`,dragging:`_dragging_1pwn9_349`,dragOver:`_dragOver_1pwn9_354`,headerContent:`_headerContent_1pwn9_359`,dragHandle:`_dragHandle_1pwn9_367`,columnTitle:`_columnTitle_1pwn9_384`,sortable:`_sortable_1pwn9_391`,sortIcon:`_sortIcon_1pwn9_408`,filterButton:`_filterButton_1pwn9_415`,filterButtonIcon:`_filterButtonIcon_1pwn9_451`,filterModal:`_filterModal_1pwn9_212`,row:`_row_1pwn9_474`,cell:`_cell_1pwn9_486`,statusBadge:`_statusBadge_1pwn9_507`,statusActive:`_statusActive_1pwn9_517`,statusInactive:`_statusInactive_1pwn9_522`,statusPending:`_statusPending_1pwn9_527`,statusCompleted:`_statusCompleted_1pwn9_532`,statusDraft:`_statusDraft_1pwn9_537`,pagination:`_pagination_1pwn9_543`,paginationInfo:`_paginationInfo_1pwn9_553`,paginationControls:`_paginationControls_1pwn9_560`,pageSizeSelect:`_pageSizeSelect_1pwn9_575`,pageButtons:`_pageButtons_1pwn9_591`,pageButton:`_pageButton_1pwn9_591`,exportButton:`_exportButton_1pwn9_659`,resetButton:`_resetButton_1pwn9_660`,filterModalSlideIn:`_filterModalSlideIn_1pwn9_1`,shimmer:`_shimmer_1pwn9_1`,columnCheckboxes:`_columnCheckboxes_1pwn9_1195`},_=({option:e,selectedValues:t,handleOptionToggle:r})=>(0,n.jsxs)(`div`,{className:`${g.filterOption} ${t.includes(e.value)?g.selected:``}`,onClick:()=>r(e),children:[(0,n.jsx)(`input`,{type:`checkbox`,className:g.filterOptionCheckbox,checked:t.includes(e.value),onChange:()=>r(e),onClick:e=>e.stopPropagation()}),(0,n.jsx)(`span`,{className:g.filterOptionLabel,children:e.value}),(0,n.jsx)(`span`,{className:g.filterOptionCount,children:e.count})]},e.value),v=({label:e,options:r,textValue:i,selectedValues:a,onTextChange:o,onSelectionChange:s,onClose:c})=>{let[l,u]=(0,t.useState)(``),d=(0,t.useRef)(null),f=r.filter(e=>e.value.toLowerCase().includes(l.toLowerCase())||e.label.toLowerCase().includes(l.toLowerCase())),p=e=>{let t=a.includes(e.value)?a.filter(t=>t!==e.value):[...a,e.value];s(t)},m=()=>{let e=f.map(e=>e.value);s(e)},v=()=>{s([]),o(``)};return(0,t.useEffect)(()=>{let e=e=>{d.current&&!d.current.contains(e.target)&&c()};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[c]),(0,n.jsxs)(`div`,{className:g.filterModal,ref:d,children:[(0,n.jsxs)(`div`,{className:g.filterModalHeader,children:[(0,n.jsx)(`input`,{type:`text`,className:g.filterSearchInput,placeholder:`Buscar texto en ${e.toLowerCase()}...`,value:i,onChange:e=>o(e.target.value),autoFocus:!0}),(0,n.jsx)(`input`,{type:`text`,className:g.filterSearchInput,placeholder:`Buscar opciones...`,value:l,onChange:e=>u(e.target.value),style:{marginTop:`8px`}})]}),(0,n.jsxs)(`div`,{className:g.filterOptions,children:[(0,n.jsxs)(`div`,{className:g.filterOption,style:{borderBottom:`1px solid #e5e7eb`,marginBottom:`4px`,paddingBottom:`8px`},children:[(0,n.jsx)(h,{onClick:m,size:`small`,level:`tertiary`,children:`Seleccionar todo`}),(0,n.jsx)(h,{onClick:v,size:`small`,level:`tertiary`,children:`Limpiar todo`})]}),f.map(e=>(0,n.jsx)(_,{option:e,selectedValues:a,handleOptionToggle:p},e.value)),f.length===0&&(0,n.jsx)(`div`,{className:g.filterOption,children:(0,n.jsx)(`span`,{className:g.filterOptionLabel,children:`No se encontraron opciones`})})]}),(0,n.jsxs)(`div`,{className:g.filterModalActions,children:[(0,n.jsx)(h,{onClick:v,level:`tertiary`,children:`Limpiar todo`}),(0,n.jsxs)(h,{onClick:c,level:`primary`,children:[`Aplicar (`,a.length+(i?1:0),`)`]})]})]})};
|
|
2
|
+
/*! js-cookie v3.0.5 | MIT */
|
|
3
|
+
function y(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var b={read:function(e){return e[0]===`"`&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function x(e,t){function n(n,r,i){if(!(typeof document>`u`)){i=y({},t,i),typeof i.expires==`number`&&(i.expires=new Date(Date.now()+i.expires*864e5)),i.expires&&=i.expires.toUTCString(),n=encodeURIComponent(n).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a=``;for(var o in i)i[o]&&(a+=`; `+o,i[o]!==!0&&(a+=`=`+i[o].split(`;`)[0]));return document.cookie=n+`=`+e.write(r,n)+a}}function r(t){if(!(typeof document>`u`||arguments.length&&!t)){for(var n=document.cookie?document.cookie.split(`; `):[],r={},i=0;i<n.length;i++){var a=n[i].split(`=`),o=a.slice(1).join(`=`);try{var s=decodeURIComponent(a[0]);if(r[s]=e.read(o,s),t===s)break}catch{}}return t?r[t]:r}}return Object.create({set:n,get:r,remove:function(e,t){n(e,``,y({},t,{expires:-1}))},withAttributes:function(e){return x(this.converter,y({},this.attributes,e))},withConverter:function(e){return x(y({},this.converter,e),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var S=x(b,{path:`/`}),C=30;let w=e=>{let{data:n,columns:r,defaultSort:i,defaultFilters:a={},defaultPageSize:o=10,pageSizeOptions:s=[10,25,50,100,200,300,400,500],persistConfig:c=!0,configKey:l=`advanced-table-config`,onConfigChange:u}=e,d=(0,t.useCallback)(()=>{if(!c)return null;try{let e=S.get(l);return e?JSON.parse(e):null}catch(e){return console.warn(`Error loading table config from cookies:`,e),null}},[c,l]),f=(0,t.useCallback)(e=>{if(c)try{S.set(l,JSON.stringify(e),{expires:C})}catch(e){console.warn(`Error saving table config to cookies:`,e)}},[c,l]),p=d(),[m,h]=(0,t.useState)(p?.sortConfig||i||void 0),[g,_]=(0,t.useState)(p?.filters||a),[v,y]=(0,t.useState)(p?.columnOrder||r.map(e=>e.id)),[b,x]=(0,t.useState)(p?.hiddenColumns||[]),[w,T]=(0,t.useState)({page:1,pageSize:p?.pagination?.pageSize||o,total:n.length}),E=(0,t.useMemo)(()=>{let e=[...n];return Object.entries(g).forEach(([t,n])=>{let i=r.find(e=>e.id===t);i&&(e=e.filter(e=>{let t=typeof i.accessor==`function`?i.accessor(e):e[i.accessor],r=String(t||``).toLowerCase(),a=!0;return n.type===`text`&&n.value&&(a&&=r.includes(String(n.value).toLowerCase())),n.type===`select`&&n.value&&(a&&=r===String(n.value).toLowerCase()),n.type===`multiselect`&&Array.isArray(n.value)&&n.value.length>0&&(a&&=n.value.some(e=>r===String(e).toLowerCase())),a}))}),e},[n,g,r]),D=(0,t.useMemo)(()=>{if(!m)return E;let e=r.find(e=>e.id===m.column);return e?[...E].sort((t,n)=>{let r=typeof e.accessor==`function`?e.accessor(t):t[e.accessor],i=typeof e.accessor==`function`?e.accessor(n):n[e.accessor];if(r==null)return 1;if(i==null)return-1;let a=0;if(typeof r==`number`&&typeof i==`number`)a=r-i;else if(typeof r==`boolean`&&typeof i==`boolean`)a=r===i?0:r?1:-1;else if(r instanceof Date&&i instanceof Date)a=r.getTime()-i.getTime();else{let e=String(r).toLowerCase(),t=String(i).toLowerCase();a=e.localeCompare(t)}return m.direction===`desc`?a*-1:a}):E},[E,m,r]),O=(0,t.useMemo)(()=>{let e=(w.page-1)*w.pageSize,t=e+w.pageSize;return D.slice(e,t)},[D,w.page,w.pageSize]);(0,t.useEffect)(()=>{T(e=>({...e,total:E.length,page:Math.min(e.page,Math.ceil(E.length/e.pageSize)||1)}))},[E.length]),(0,t.useEffect)(()=>{let e={sort:m,filters:g,columnOrder:v,hiddenColumns:b,pageSize:w.pageSize};f(e),u?.({sort:m,filters:g,pagination:w,columnOrder:v,hiddenColumns:b,columns:r})},[m,g,v,b,w.pageSize,f,u,w,r]);let k=(0,t.useCallback)(e=>{h(t=>t?.column===e?t.direction===`asc`?{column:e,direction:`desc`}:void 0:{column:e,direction:`asc`})},[]),A=(0,t.useCallback)((e,t,n=`text`)=>{_(r=>({...r,[e]:{type:n,value:t,options:r[e]?.options}})),T(e=>({...e,page:1}))},[]),j=(0,t.useCallback)(e=>{_(t=>{let n={...t};return delete n[e],n})},[]),M=(0,t.useCallback)(()=>{_({})},[]),N=(0,t.useCallback)(e=>{T(t=>({...t,page:e}))},[]),P=(0,t.useCallback)(e=>{T(t=>({...t,pageSize:e,page:1}))},[]),F=(0,t.useCallback)(e=>{y(e)},[]),I=(0,t.useCallback)(e=>{x(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[]),L=(0,t.useMemo)(()=>v.map(e=>r.find(t=>t.id===e)).filter(Boolean).filter(e=>!b.includes(e.id)),[v,r,b]);return{state:{data:n,filteredData:E,paginatedData:O,sortConfig:m,filters:g,pagination:w,columnOrder:v,hiddenColumns:b,loading:!1},orderedColumns:L,pageSizeOptions:s,handleSort:k,handleFilter:A,clearFilter:j,clearAllFilters:M,handlePageChange:N,handlePageSizeChange:P,handleColumnReorder:F,handleToggleColumn:I,allColumns:r}};e.AdvancedTable=({data:e,columns:r,defaultSort:i,defaultFilters:a={},defaultPageSize:o=10,pageSizeOptions:s=[10,25,50,100,200,300,400,500],enableSorting:c=!0,enableFiltering:l=!0,enablePagination:u=!0,enableExport:_=!0,persistConfig:y=!0,configKey:b=`advancedTable`,className:x=``,labels:S={configuration:`Configuración`,columnVisibility:`Columnas visibles`,pagination:{showingItems:`Mostrando`,to:`a`,of:`de`,items:`elementos`,showPerPage:`Mostrar`,perPageItems:`elementos`}}})=>{let[C,T]=(0,t.useState)(null),[E,D]=(0,t.useState)(null),[O,k]=(0,t.useState)(!1),[A,j]=(0,t.useState)(null),M=(0,t.useRef)(null),{state:N,orderedColumns:P,handleSort:F,handleFilter:I,clearAllFilters:L,handlePageChange:R,handlePageSizeChange:z,handleColumnReorder:B,handleToggleColumn:V}=w({data:e,columns:r,defaultSort:i,defaultFilters:a,defaultPageSize:o,pageSizeOptions:s,persistConfig:y,configKey:b}),{paginatedData:H,sortConfig:U,filters:W,pagination:G,hiddenColumns:K}=N,q=(e,t)=>{T(t),e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/html`,``)},J=(e,t)=>{e.preventDefault(),e.dataTransfer.dropEffect=`move`,D(t)},Y=()=>{D(null)},X=(e,t)=>{if(e.preventDefault(),C!==null){if(C!==t){let e=[...N.columnOrder],[n]=e.splice(C,1);e.splice(t,0,n),B(e)}T(null),D(null)}},Z=()=>{T(null),D(null)},Q=()=>{},ee=e=>{j(A===e?null:e)},te=t=>{let n=r.find(e=>e.id===t);if(!n)return[];let i=new Map;return e.forEach(e=>{let t=typeof n.accessor==`function`?n.accessor(e):e[n.accessor],r=m(t);i.set(r,(i.get(r)||0)+1)}),Array.from(i.entries()).map(([e,t])=>({value:e,count:t,label:`${e} (${t})`})).sort((e,t)=>e.value.localeCompare(t.value))},ne=Object.values(W).some(e=>e.type===`text`&&e.value||e.type===`select`&&e.value||e.type===`multiselect`&&Array.isArray(e.value)&&e.value.length>0);(0,t.useEffect)(()=>{let e=e=>{M.current&&!M.current.contains(e.target)&&k(!1)};return O&&document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[O]);let $=Math.ceil(G.total/G.pageSize);return(0,n.jsxs)(`div`,{className:`w-full bg-redi-background border border-solid border-gray-500 rounded-xl overflow-hidden font-family-base shadow ${x}`,children:[(0,n.jsxs)(`div`,{className:`flex items-center justify-between p-4 bg-transparent border-b border-solid border-gray-400`,children:[(0,n.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,n.jsxs)(`div`,{className:`relative`,children:[(0,n.jsxs)(h,{level:`secondary`,onClick:()=>k(!O),children:[(0,n.jsx)(f,{}),(0,n.jsx)(`span`,{className:`hidden md:block`,children:S.configuration})]}),O&&(0,n.jsx)(`div`,{className:`absolute top-full left-0 bg-white border border-solid border-gray-300 rounded-md shadow-lg z-1000 mt-2 min-w-2xs max-w-xs opacity-100 visible p-4`,ref:M,children:(0,n.jsxs)(`div`,{className:`mb-4 last:mb-0`,children:[(0,n.jsx)(`div`,{className:`text-sm font-semibold text-redi-text mb-2 uppercase`,children:S.columnVisibility}),(0,n.jsx)(`div`,{className:`flex flex-col gap-2`,children:r.map(e=>(0,n.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,n.jsx)(`input`,{type:`checkbox`,className:`w-4 h-4 accent-redi-primary`,checked:!K.includes(e.id),onChange:()=>V(e.id)}),(0,n.jsx)(`label`,{children:e.label})]},e.id))})]})})]}),l&&ne&&(0,n.jsx)(`button`,{onClick:L,className:`${g.actionButton} ${g.reset}`,title:`Limpiar todos los filtros`,children:(0,n.jsx)(`svg`,{className:g.buttonIcon,viewBox:`0 0 20 20`,children:(0,n.jsx)(`path`,{fillRule:`evenodd`,d:`M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z`,clipRule:`evenodd`})})})]}),(0,n.jsx)(`div`,{className:g.rightControls,children:_&&(0,n.jsx)(h,{level:`secondary`,onClick:Q,children:(0,n.jsx)(d,{size:18})})})]}),(0,n.jsx)(`div`,{className:`overflow-x-auto max-h-[600px] min-h-[500px] overflow-y-auto bg-white relative`,children:(0,n.jsxs)(`table`,{className:`w-full border-collapse table-auto text-sm relative`,children:[(0,n.jsx)(`thead`,{children:(0,n.jsx)(`tr`,{children:P.map((e,t)=>(0,n.jsx)(`th`,{className:`bg-gray-50 border-b border-solid border-gray-200 text-left font-semibold text-redi-text p-0 sticky top-0 z-10 select-none hover:bg-gray-200 ${C===t?`opacity-50 bg-gray-300`:``} ${E===t?`bg-redi-primary-bg border-l border-solid border-redi-primary`:``}`,draggable:!0,onDragStart:e=>q(e,t),onDragOver:e=>J(e,t),onDragLeave:Y,onDrop:e=>X(e,t),onDragEnd:Z,children:(0,n.jsxs)(`div`,{className:g.headerContent,children:[(0,n.jsx)(`div`,{className:g.dragHandle,children:`⋮⋮`}),(0,n.jsxs)(`div`,{className:g.columnTitle,children:[(0,n.jsxs)(`span`,{className:c?g.sortable:``,onClick:t=>{t.stopPropagation(),c&&F(e.id)},children:[e.label,c&&U?.column===e.id&&(0,n.jsx)(`span`,{className:g.sortIcon,children:U.direction===`asc`?` ↑`:` ↓`})]}),l&&(0,n.jsxs)(`div`,{style:{position:`relative`},children:[(0,n.jsx)(h,{level:`icon`,onClick:t=>{t.stopPropagation(),ee(e.id)},children:(0,n.jsx)(p,{size:16})}),A===e.id&&(0,n.jsx)(v,{columnId:e.id,label:e.label,options:te(e.id),textValue:W[e.id]?.type===`text`?String(W[e.id].value||``):``,selectedValues:W[e.id]?.type===`multiselect`&&Array.isArray(W[e.id]?.value)?W[e.id].value:[],onTextChange:t=>I(e.id,t,`text`),onSelectionChange:t=>I(e.id,t,`multiselect`),onClose:()=>j(null)})]})]})]})},e.id))})}),(0,n.jsx)(`tbody`,{children:H.map((e,t)=>(0,n.jsx)(`tr`,{className:g.row,children:P.map(r=>{let i=typeof r.accessor==`function`?r.accessor(e):e[r.accessor];return r.render?(0,n.jsx)(`td`,{className:g.cell,children:r.render(i,e,t)},r.id):(0,n.jsx)(`td`,{className:g.cell,children:m(i)},r.id)})},t))})]})}),u&&(0,n.jsxs)(`div`,{className:`flex items-center justify-between py-4 px-6 bg-white border-t-gray-300 border-solid border-t gap-4`,children:[(0,n.jsx)(`div`,{className:`text-redi-text text-base font-medium shrink-0`,children:(0,n.jsxs)(`span`,{children:[S.pagination?.showingItems,` `,(G.page-1)*G.pageSize+1,` `,S.pagination?.to,` `,Math.min(G.page*G.pageSize,G.total),` `,S.pagination?.of,` `,G.total,` `,S.pagination?.items]})}),(0,n.jsxs)(`div`,{className:`flex items-center gap-5`,children:[(0,n.jsxs)(`label`,{className:`flex items-center gap-3 text-sm font-semibold text-redi-text`,children:[S.pagination?.showPerPage,(0,n.jsx)(`select`,{value:G.pageSize,onChange:e=>z(Number(e.target.value)),className:g.pageSizeSelect,children:s.map(e=>(0,n.jsx)(`option`,{value:e,children:e},e))}),S.pagination?.perPageItems]}),(0,n.jsxs)(`div`,{className:`flex gap-1 items-center`,children:[(0,n.jsx)(h,{level:`icon`,onClick:()=>R(1),disabled:G.page===1,children:`<<`}),(0,n.jsx)(h,{level:`icon`,onClick:()=>R(G.page-1),disabled:G.page===1,children:`<`}),Array.from({length:Math.min(3,$)},(e,t)=>{let r;return r=$<=3||G.page<=2?t+1:G.page>$-2?$-2+t:G.page-1+t,(0,n.jsx)(h,{level:G.page===r?`primary`:`secondary`,onClick:()=>R(r),children:r},r)}),(0,n.jsx)(h,{level:`icon`,onClick:()=>R(G.page+1),disabled:G.page===$,children:`>`}),(0,n.jsx)(h,{level:`icon`,onClick:()=>R($),disabled:G.page===$,children:`>>`})]})]})]})]})},e.Button=h});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const formatCellValue: <T>(value: T) => string;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redi.run/redi-components",
|
|
3
3
|
"description": "This project was created to define the style of the UI and improve the UX in all projects from REDI",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.7",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Jonathan Manchego Sosa",
|
|
@@ -98,4 +98,4 @@
|
|
|
98
98
|
"overrides": {
|
|
99
99
|
"vite": "npm:rolldown-vite@7.1.14"
|
|
100
100
|
}
|
|
101
|
-
}
|
|
101
|
+
}
|