zaravand-ui 3.0.1 → 3.0.3

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.
@@ -10,8 +10,8 @@ export declare const deleteButtonLabel = "\u062D\u0630\u0641";
10
10
  export declare const actionIconClassName = "zui:size-4";
11
11
  export declare const pagingToggleIconClassName = "zui:size-6";
12
12
  export declare const rowActionButtonClassName = "zui:cursor-pointer zui:border-0 zui:bg-transparent zui:shadow-none zui:hover:bg-transparent zui:hover:shadow-none zui:active:bg-transparent zui:focus-visible:ring-0 zui:disabled:cursor-not-allowed";
13
- export declare const actionsColumnClassName = "zui:px-3 zui:text-center";
14
- export declare const rowNumberColumnClassName = "zui:px-3 zui:text-center";
13
+ export declare const actionsColumnClassName = "zui:px-3";
14
+ export declare const rowNumberColumnClassName = "zui:px-3";
15
15
  export declare const searchInputPlaceholder = "\u062C\u0633\u062A\u062C\u0648 \u06A9\u0646\u06CC\u062F";
16
16
  export declare const searchInputAriaLabel = "\u062C\u0633\u062A\u062C\u0648\u06CC \u062C\u062F\u0648\u0644";
17
17
  export declare const switchToInfiniteModeLabel = "\u062A\u063A\u06CC\u06CC\u0631 \u0628\u0647 \u067E\u06CC\u0645\u0627\u06CC\u0634 \u0628\u06CC\u200C\u0646\u0647\u0627\u06CC\u062A";
@@ -23,10 +23,12 @@ declare const TableRow: React.ForwardRefExoticComponent<{
23
23
  declare const TableHead: React.ForwardRefExoticComponent<{
24
24
  className?: string;
25
25
  children?: React.ReactNode;
26
+ align?: import("./Table.interface").TableColumnAlign;
26
27
  } & React.RefAttributes<HTMLTableCellElement>>;
27
28
  declare const TableCell: React.ForwardRefExoticComponent<{
28
29
  className?: string;
29
30
  children?: React.ReactNode;
31
+ align?: import("./Table.interface").TableColumnAlign;
30
32
  } & React.RefAttributes<HTMLTableCellElement>>;
31
33
  export { TableBody, TableCell, TableFooter, TableHead, TableHeader, TableRow, };
32
34
  export default Table;
@@ -1,6 +1,6 @@
1
1
  import type * as React from "react";
2
2
  import type { SelectProps } from "../Select/Select.interface";
3
- export type TableFieldType = 'text' | 'number' | 'textarea' | 'select' | 'checkbox' | 'radio' | 'date';
3
+ export type TableFieldType = 'text' | 'number' | 'textarea' | 'select' | 'checkbox' | 'radio' | 'date' | 'money';
4
4
  type TableFieldValueByType = {
5
5
  text: string;
6
6
  number: number;
@@ -9,7 +9,9 @@ type TableFieldValueByType = {
9
9
  checkbox: boolean;
10
10
  radio: string;
11
11
  date: Date | string;
12
+ money: number | string;
12
13
  };
14
+ export type TableColumnAlign = 'start' | 'center' | 'end';
13
15
  export type TableFieldValue = TableFieldValueByType[TableFieldType];
14
16
  export type DynamicTableRow = Record<string, TableFieldValue | null | undefined>;
15
17
  export type TableRowId = string | number;
@@ -63,6 +65,12 @@ export type TableSchemaColumn = {
63
65
  * with the other un-sized columns.
64
66
  */
65
67
  width?: number | string;
68
+ /**
69
+ * Text alignment applied to both the column's header and its body cells.
70
+ * Defaults to `"start"` (right in RTL). Has no effect on the row-number or
71
+ * actions columns, which are always center-aligned.
72
+ */
73
+ align?: TableColumnAlign;
66
74
  };
67
75
  export type TableSchemaPagination = {
68
76
  page: number;
@@ -134,6 +142,7 @@ export type TableRowProps = TableSectionProps & {
134
142
  type TableCellElementProps = {
135
143
  className?: string;
136
144
  children?: React.ReactNode;
145
+ align?: TableColumnAlign;
137
146
  };
138
147
  export type TableHeadProps = TableCellElementProps;
139
148
  export type TableCellProps = TableCellElementProps;
@@ -9,6 +9,8 @@ export declare function resolveLoadingRowsCount(pageSize: number | undefined, da
9
9
  export declare function resolveLoadingCellSkeletonClassName(column: TableSchemaColumn, rowIndex: number): string;
10
10
  export declare function buildPaginationTokens(currentPage: number, totalPages: number): TablePaginationToken[];
11
11
  export declare function isEmptyCellValue(value: unknown): boolean;
12
+ export declare function resolveMoneyValue(value: unknown): number | null;
13
+ export declare function formatMoneyValue(value: number): string;
12
14
  export declare function resolveDateValue(value: unknown): Date | null;
13
15
  export declare function resolvePlaceholder(column: TableSchemaColumn): string;
14
16
  export declare function formatCellValue(value: unknown, column: TableSchemaColumn): string;
@@ -10,5 +10,9 @@ export declare const tableHeaderVariants: (props?: import("class-variance-author
10
10
  export declare const tableBodyVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
11
11
  export declare const tableFooterVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
12
12
  export declare const tableRowVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
13
- export declare const tableHeadVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
14
- export declare const tableCellVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
13
+ export declare const tableHeadVariants: (props?: ({
14
+ align?: "center" | "end" | "start" | null | undefined;
15
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
16
+ export declare const tableCellVariants: (props?: ({
17
+ align?: "center" | "end" | "start" | null | undefined;
18
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;