nectiasw 0.0.17 → 0.0.18

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.
@@ -14,6 +14,6 @@ declare class Builder {
14
14
  tailwind: string;
15
15
  headings: string[];
16
16
  constructor(props: Partial<TableProps>);
17
- buildStyle(headers: string[] | Heading[]): string[];
17
+ buildStyle(headers: string[] | Heading[]): any[];
18
18
  }
19
19
  export { Builder };
@@ -1,12 +1,12 @@
1
1
  import { default as React } from 'react';
2
- import { ButtonProps } from '@nectiasw/components/Button';
2
+ import { TableProps, TableRowProps, TableDataProps, TableStatusProps } from './types';
3
3
 
4
4
  /**
5
5
  * @description
6
6
  * This file contains the Table component for the Tailwind CSS framework.
7
7
  * @param props The properties of the Table component.
8
8
  */
9
- export declare const Table: React.FunctionComponent<TableProps>;
9
+ export declare const TwTable: React.FunctionComponent<TableProps>;
10
10
  /**
11
11
  * @description
12
12
  * This file contains the TableData component for the Tailwind CSS framework.
@@ -28,120 +28,6 @@ export declare const TableRow: React.FunctionComponent<TableRowProps>;
28
28
  * @description
29
29
  * This file contains the TableWrapper component for the Tailwind CSS framework.
30
30
  */
31
- export declare const TableWrapper: React.FunctionComponent;
32
- type StyledTheadProps = {
33
- fixedHeader?: boolean;
34
- theadColor?: string;
35
- index?: number;
36
- };
37
- export declare const Table: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<React.DetailedHTMLProps<React.TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, Partial<TableProps>>> & string;
38
- export declare const StyledThead: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, StyledTheadProps>> & string;
39
- export declare const StyledTableHead: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<React.DetailedHTMLProps<React.ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement>, Partial<Heading<{}> & {
40
- index?: number;
41
- fixedHeader?: boolean;
42
- }>>> & string;
43
- export declare const StyledTableRow: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>, Partial<TableRowProps>>> & string;
44
- export declare const StyledTableData: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<React.DetailedHTMLProps<React.TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>, Partial<TableDataProps & {
45
- index?: number;
46
- isFixed?: boolean;
47
- right?: string;
48
- }>>> & string;
49
- export declare const Col: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<React.DetailedHTMLProps<React.ColHTMLAttributes<HTMLTableColElement>, HTMLTableColElement>, Partial<TableColProps>>> & string;
50
- /**
51
- * @description
52
- * StatusColor is a styled component that renders a div with a background color.
53
- */
54
- export declare const StatusColor: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
55
- color?: string;
56
- }>> & string;
57
- export declare const HeaderContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
58
- sortable?: boolean | undefined;
59
- }>> & string;
60
- export type Heading<T = {}> = {
61
- title: string;
62
- tooltip?: string;
63
- width?: string;
64
- align?: "left" | "center" | "right";
65
- className?: string;
66
- color?: string;
67
- size?: "xs" | "sm" | "md" | "lg" | "xl";
68
- sort?: "ASC" | "DESC" | "DEFAULT";
69
- sortabled?: boolean;
70
- clear?: boolean;
71
- alias?: keyof T;
72
- };
73
- /**
74
- * @description
75
- * This file contains the types for the Table component.
76
- */
77
- export type TableProps = {
78
- auto?: boolean;
79
- onSort?: (field: string, index?: number) => void;
80
- onReset?: () => void;
81
- fixedHeader?: boolean;
82
- index?: number;
83
- headers: string[] | Heading[];
84
- widths?: number[];
85
- children: React.ReactNode;
86
- cellSpacing?: number;
87
- cellPadding?: number;
88
- className?: string;
89
- filter?: string;
90
- unit?: "%" | "px" | "rem";
91
- checked?: boolean;
92
- hasCheckbox?: boolean;
93
- onChangeCheckbox?: (checked: boolean) => void;
94
- headerClassName?: string;
95
- };
96
- export type TableDataProps = {
97
- last?: boolean;
98
- asError?: boolean;
99
- first?: boolean;
100
- overflow?: boolean;
101
- innerText?: string;
102
- className?: string;
103
- formatAsCLP?: boolean;
104
- formatAsRut?: boolean;
105
- formatAsDate?: boolean;
106
- overflowWrap?: boolean;
107
- formatAsNumber?: boolean;
108
- formatAsStatus?: boolean;
109
- formatAsPercentage?: boolean;
110
- formatAsDigits?: boolean;
111
- children?: React.ReactNode;
112
- color?: string;
113
- dataId?: number;
114
- checked?: boolean;
115
- hasCheckbox?: boolean;
116
- icons?: React.ReactNode[];
117
- align?: "left" | "center" | "right";
118
- iconJustify?: "center" | "start" | "end" | "between" | "around";
119
- onClickDetail?: () => void;
120
- onChangeCheckbox?: (checked: boolean, dataId?: number) => void;
121
- detailText?: string;
122
- detailDisabled?: boolean;
123
- detailVariant?: ButtonProps["variant"];
124
- indexed?: boolean;
125
- hasRadioButton?: boolean;
126
- onChangeRadioButton?: (value: string | undefined) => void;
127
- isFixed?: boolean;
128
- right?: string;
129
- };
130
- export type TableRowProps = {
31
+ export declare const TableWrapper: React.FunctionComponent<{
131
32
  children: React.ReactNode;
132
- align?: "left" | "center" | "right";
133
- };
134
- export type TableStatusProps = {
135
- id?: number;
136
- color?: string;
137
- onClick?: () => void;
138
- text?: TableDataProps["detailText"];
139
- disabled?: TableDataProps["detailDisabled"];
140
- variant?: ButtonProps["variant"];
141
- value: "Normal" | "Cerrado" | "Crítico" | "Por emisión OC";
142
- };
143
- export type TableColProps = {
144
- width?: number;
145
- unit?: "%" | "px" | "rem";
146
- };
147
- export {};
33
+ }>;
@@ -0,0 +1,31 @@
1
+ import { Heading, TableProps, TableRowProps, TableColProps, TableDataProps } from './types';
2
+
3
+ type StyledTheadProps = {
4
+ fixedHeader?: boolean;
5
+ theadColor?: string;
6
+ index?: number;
7
+ };
8
+ export declare const Table: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, Partial<TableProps>>> & string;
9
+ export declare const StyledThead: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, StyledTheadProps>> & string;
10
+ export declare const StyledTableHead: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement>, Partial<Heading & {
11
+ index?: number;
12
+ fixedHeader?: boolean;
13
+ }>>> & string;
14
+ export declare const StyledTableRow: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>, TableRowProps>> & string;
15
+ export declare const StyledTableData: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>, Partial<TableDataProps & {
16
+ index?: number;
17
+ isFixed?: boolean;
18
+ right?: string;
19
+ }>>> & string;
20
+ export declare const Col: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').ColHTMLAttributes<HTMLTableColElement>, HTMLTableColElement>, Partial<TableColProps>>> & string;
21
+ /**
22
+ * @description
23
+ * StatusColor is a styled component that renders a div with a background color.
24
+ */
25
+ export declare const StatusColor: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
26
+ color?: string;
27
+ }>> & string;
28
+ export declare const HeaderContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
29
+ sortable?: boolean | undefined;
30
+ }>> & string;
31
+ export {};
@@ -0,0 +1,92 @@
1
+ import { ButtonProps } from '@nectiasw/components/Button/types';
2
+ import { default as React } from 'react';
3
+
4
+ export type Heading<T = {}> = {
5
+ title: string;
6
+ tooltip?: string;
7
+ width?: string;
8
+ align?: "left" | "center" | "right";
9
+ className?: string;
10
+ color?: string;
11
+ size?: "xs" | "sm" | "md" | "lg" | "xl";
12
+ sort?: "ASC" | "DESC" | "DEFAULT";
13
+ sortabled?: boolean;
14
+ clear?: boolean;
15
+ alias?: keyof T;
16
+ };
17
+ /**
18
+ * @description
19
+ * This file contains the types for the Table component.
20
+ */
21
+ export type TableProps = {
22
+ auto?: boolean;
23
+ onSort?: (field: string, index?: number) => void;
24
+ onReset?: () => void;
25
+ fixedHeader?: boolean;
26
+ index?: number;
27
+ headers: string[] | Heading[];
28
+ widths?: number[];
29
+ children: React.ReactNode;
30
+ cellSpacing?: number;
31
+ cellPadding?: number;
32
+ className?: string;
33
+ filter?: string;
34
+ unit?: "%" | "px" | "rem";
35
+ checked?: boolean;
36
+ hasCheckbox?: boolean;
37
+ onChangeCheckbox?: (checked: boolean) => void;
38
+ headerClassName?: string;
39
+ };
40
+ export type TableDataProps = {
41
+ last?: boolean;
42
+ asError?: boolean;
43
+ first?: boolean;
44
+ overflow?: boolean;
45
+ innerText?: string;
46
+ className?: string;
47
+ formatAsCLP?: boolean;
48
+ formatAsRut?: boolean;
49
+ formatAsDate?: boolean;
50
+ overflowWrap?: boolean;
51
+ formatAsNumber?: boolean;
52
+ formatAsStatus?: boolean;
53
+ formatAsPercentage?: boolean;
54
+ formatAsDigits?: boolean;
55
+ children?: React.ReactNode;
56
+ color?: string;
57
+ dataId?: number;
58
+ checked?: boolean;
59
+ hasCheckbox?: boolean;
60
+ icons?: React.ReactNode[];
61
+ align?: "left" | "center" | "right";
62
+ iconJustify?: "center" | "start" | "end" | "between" | "around";
63
+ onClickDetail?: () => void;
64
+ onChangeCheckbox?: (checked: boolean, dataId?: number) => void;
65
+ detailText?: string;
66
+ detailDisabled?: boolean;
67
+ detailVariant?: ButtonProps["variant"];
68
+ indexed?: boolean;
69
+ hasRadioButton?: boolean;
70
+ onChangeRadioButton?: (value: string | undefined) => void;
71
+ isFixed?: boolean;
72
+ right?: string;
73
+ };
74
+ export type TableRowProps = {
75
+ children: React.ReactNode;
76
+ align?: "left" | "center" | "right";
77
+ disabled?: boolean;
78
+ };
79
+ export type TableStatusProps = {
80
+ id?: number;
81
+ color?: string;
82
+ onClick?: () => void;
83
+ children?: React.ReactNode;
84
+ text?: TableDataProps["detailText"];
85
+ disabled?: TableDataProps["detailDisabled"];
86
+ variant?: ButtonProps["variant"];
87
+ value: "Normal" | "Cerrado" | "Crítico" | "Por emisión OC";
88
+ };
89
+ export type TableColProps = {
90
+ width?: number;
91
+ unit?: "%" | "px" | "rem";
92
+ };
package/dist/index.d.ts CHANGED
@@ -49,10 +49,12 @@ export type { CollapseProps } from './components/Collapse';
49
49
  export type { BadgeProps } from './components/Badge';
50
50
  export { Badge } from './components/Badge';
51
51
  export { BadgeStatus } from './components/Badge/types';
52
- export { Navbar } from './components/Navbar';
53
52
  export { Footer } from './components/Footer';
54
53
  export { Layout } from './components/Layout';
54
+ export { Navbar } from './components/Navbar';
55
55
  export { Sidebar } from './components/Sidebar';
56
+ export { TwTable as Table, TableRow, TableData, TableWrapper, } from './components/Table';
57
+ export type { TableProps, TableRowProps, TableColProps, TableDataProps, TableStatusProps, } from './components/Table/types';
56
58
  export type { NavbarProps } from './components/Navbar';
57
59
  export type { SidebarProps } from './components/Sidebar/types';
58
60
  export { Search } from './components/Search';
@@ -92,3 +94,14 @@ export type { GrantArgs, PrivateProps } from './providers/private';
92
94
  export { useCache } from './hooks/usecache';
93
95
  export { useToggle } from './hooks/usetoggle';
94
96
  export { useCheckbox } from './hooks/usecheckbox';
97
+ export { defaultConfig } from './hooks/usecache/config';
98
+ export { defaultCacheQueryOptions } from './utils/cache';
99
+ export { sort } from './utils/sort';
100
+ export { stack } from './utils/stack';
101
+ export { bearer } from './utils/bearer';
102
+ export { revert } from './utils/revert';
103
+ export { mapping } from './utils/mapping';
104
+ export { download } from './utils/download';
105
+ export { capitalize } from './utils/capitalize';
106
+ export { formatHourTime, removeHourFormat } from './utils/time';
107
+ export { createTimeSlots, createHalfTimeSlots } from './utils/slots';