@sustaina/shared-ui 1.2.0 → 1.4.0
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/index.d.mts +18 -3
- package/dist/index.d.ts +18 -3
- package/dist/index.js +131 -85
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +80 -37
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -3,10 +3,10 @@ import * as React$1 from 'react';
|
|
|
3
3
|
import React__default, { CSSProperties, ReactNode } from 'react';
|
|
4
4
|
import { FieldValues, FieldPath, ControllerProps, UseFormGetFieldState } from 'react-hook-form';
|
|
5
5
|
import { Header, RowData as RowData$1, Column as Column$1, Table as Table$1, ColumnDef, ColumnFiltersState, OnChangeFn, FilterFnOption, SortingState, ColumnOrderState, VisibilityState, ColumnPinningState, GroupingState, GroupingOptions, ColumnResizeMode, RowSelectionState, Row, ExpandedState, HeaderGroup, Cell, HeaderContext } from '@tanstack/react-table';
|
|
6
|
+
import * as zustand from 'zustand';
|
|
6
7
|
import * as class_variance_authority_dist_types from 'class-variance-authority/dist/types';
|
|
7
8
|
import { VariantProps } from 'class-variance-authority';
|
|
8
9
|
import { ClassValue } from 'clsx';
|
|
9
|
-
import * as zustand from 'zustand';
|
|
10
10
|
|
|
11
11
|
type FormErrorMessageProps = React__default.ComponentProps<"p"> & {
|
|
12
12
|
errorClassName?: string;
|
|
@@ -259,6 +259,19 @@ type HeaderCellProps<TData = any, TValue = any> = {
|
|
|
259
259
|
};
|
|
260
260
|
declare const HeaderCell: ({ rootClassName, labelClassName, context, label, sorterProps }: HeaderCellProps) => react_jsx_runtime.JSX.Element;
|
|
261
261
|
|
|
262
|
+
declare const PreventPageLeave: ({ children }: React__default.PropsWithChildren) => React__default.ReactNode;
|
|
263
|
+
|
|
264
|
+
type PreventPageLeaveStore = {
|
|
265
|
+
isPreventing: boolean;
|
|
266
|
+
setPreventing: (value: boolean) => void;
|
|
267
|
+
};
|
|
268
|
+
declare const usePreventPageLeaveStore: zustand.UseBoundStore<zustand.StoreApi<PreventPageLeaveStore>>;
|
|
269
|
+
|
|
270
|
+
type UsePreventPageLeaveOptions = {
|
|
271
|
+
isPrevening: boolean;
|
|
272
|
+
};
|
|
273
|
+
declare const usePreventPageLeave: ({ isPrevening }: UsePreventPageLeaveOptions) => void;
|
|
274
|
+
|
|
262
275
|
declare const buttonVariants: (props?: ({
|
|
263
276
|
variant?: "link" | "default" | "outline" | "cancel" | "destructive" | "secondary" | "ghost" | "defaultSelect" | "defaultOutline" | null | undefined;
|
|
264
277
|
size?: "default" | "option" | "icon" | "sm" | "lg" | "icon-xs" | "icon-sm" | "icon-md" | "icon-lg" | null | undefined;
|
|
@@ -317,9 +330,10 @@ type NavbarBaseProps = {
|
|
|
317
330
|
onMainButtonClick?: () => void;
|
|
318
331
|
onSubButtonClick?: () => void;
|
|
319
332
|
searchButton?: React__default.ReactNode;
|
|
333
|
+
separatorDisable?: boolean;
|
|
320
334
|
};
|
|
321
335
|
type NavbarProps = RequireAtLeastOne<NavbarBaseProps, "title" | "headImageURL">;
|
|
322
|
-
declare const _default: React__default.MemoExoticComponent<({ className, title, subTitle, headImageURL, headImageURLClassName, tooltipTitle, tooltipIcon, tooltipdescription, mainButtonText, mainButtonClassName, mainButtonDisable, subButtonText, subButtonClassName, subButtonDisable, onMainButtonClick, onSubButtonClick, searchButton }: NavbarProps) => react_jsx_runtime.JSX.Element>;
|
|
336
|
+
declare const _default: React__default.MemoExoticComponent<({ className, title, subTitle, headImageURL, headImageURLClassName, tooltipTitle, tooltipIcon, tooltipdescription, mainButtonText, mainButtonClassName, mainButtonDisable, subButtonText, subButtonClassName, subButtonDisable, onMainButtonClick, onSubButtonClick, separatorDisable, searchButton }: NavbarProps) => react_jsx_runtime.JSX.Element>;
|
|
323
337
|
|
|
324
338
|
type FieldType = "text" | "number" | "date" | "datetime" | "checkbox" | "dropdown" | "lookup";
|
|
325
339
|
type Option = {
|
|
@@ -347,6 +361,7 @@ interface AdvanceSearchProps {
|
|
|
347
361
|
limitRows?: number;
|
|
348
362
|
iconColor?: string;
|
|
349
363
|
onSearch?: (param: Record<string, unknown>) => void;
|
|
364
|
+
onClear?: () => void;
|
|
350
365
|
}
|
|
351
366
|
|
|
352
367
|
declare const AdvanceSearch: React__default.FC<AdvanceSearchProps>;
|
|
@@ -471,4 +486,4 @@ type Breakpoints = {
|
|
|
471
486
|
};
|
|
472
487
|
declare const useScreenSize: (breakpoints?: Breakpoints) => UseScreenSizeResult;
|
|
473
488
|
|
|
474
|
-
export { AdvanceSearch, type Breakpoints, Button, type Column, type ContentSlot, DataTable, type DataTableChildrenKeyHandler, type DataTableColumnFilter, type DataTableColumnFilterProps, type DataTableColumnGrouping, type DataTableColumnOrdering, type DataTableColumnPinning, type DataTableColumnSorting, type DataTableColumnVisibility, type DataTableComponentProps, type DataTableFilterConfig, type DataTableFilters, type DataTableGlobalFilter, type DataTableHeaderCell, type DataTableProps, type DataTableRenderHeaderHandler, type DataTableRenderHeaderProps, type DataTableRenderRowHandler, type DataTableRenderRowProps, type DataTableRowCell, type DataTableRowClickHandler, type DataTableRowExpansion, type DataTableRowIdKeyHandler, type DataTableRowSelection, type DataTableScrollFetch, type DataTableStatusContent, type DatatableColumnResizing, ConfirmDialog as Dialog, type FieldSchema, FormErrorMessage, type FormErrorMessageProps, FormField, FormFieldContext, type FormFieldContextValue, type FormFieldProps, FormItem, FormItemContext, type FormItemContextValue, type FormItemProps, FormLabel, type FormLabelProps, type GridPayload, GridSettingsModal, type GridSettingsModalProps, HeaderCell, type HeaderCellProps, _default as Navbar, type NavbarProps, NumberInput, type NumberInputProps, type SorterProps, TextInput, type TextInputProps, type UseFormFieldOptions, type UseFormFieldReturn, type UseHoverResult, type UseMediaQueryOptions, type UseMediaQueryResult, type UseScreenSizeResult, booleanToSelectValue, buttonVariants, cn, compareAlphanumeric, getColumnIdFromTable, renderContentSlot, selectValueToBoolean, useFormField, useGridSettingsStore, useHover, useIntersectionObserver, useMediaQuery, useScreenSize };
|
|
489
|
+
export { AdvanceSearch, type Breakpoints, Button, type Column, type ContentSlot, DataTable, type DataTableChildrenKeyHandler, type DataTableColumnFilter, type DataTableColumnFilterProps, type DataTableColumnGrouping, type DataTableColumnOrdering, type DataTableColumnPinning, type DataTableColumnSorting, type DataTableColumnVisibility, type DataTableComponentProps, type DataTableFilterConfig, type DataTableFilters, type DataTableGlobalFilter, type DataTableHeaderCell, type DataTableProps, type DataTableRenderHeaderHandler, type DataTableRenderHeaderProps, type DataTableRenderRowHandler, type DataTableRenderRowProps, type DataTableRowCell, type DataTableRowClickHandler, type DataTableRowExpansion, type DataTableRowIdKeyHandler, type DataTableRowSelection, type DataTableScrollFetch, type DataTableStatusContent, type DatatableColumnResizing, ConfirmDialog as Dialog, type FieldSchema, FormErrorMessage, type FormErrorMessageProps, FormField, FormFieldContext, type FormFieldContextValue, type FormFieldProps, FormItem, FormItemContext, type FormItemContextValue, type FormItemProps, FormLabel, type FormLabelProps, type GridPayload, GridSettingsModal, type GridSettingsModalProps, HeaderCell, type HeaderCellProps, _default as Navbar, type NavbarProps, NumberInput, type NumberInputProps, PreventPageLeave, type SorterProps, TextInput, type TextInputProps, type UseFormFieldOptions, type UseFormFieldReturn, type UseHoverResult, type UseMediaQueryOptions, type UseMediaQueryResult, type UsePreventPageLeaveOptions, type UseScreenSizeResult, booleanToSelectValue, buttonVariants, cn, compareAlphanumeric, getColumnIdFromTable, renderContentSlot, selectValueToBoolean, useFormField, useGridSettingsStore, useHover, useIntersectionObserver, useMediaQuery, usePreventPageLeave, usePreventPageLeaveStore, useScreenSize };
|
package/dist/index.d.ts
CHANGED
|
@@ -3,10 +3,10 @@ import * as React$1 from 'react';
|
|
|
3
3
|
import React__default, { CSSProperties, ReactNode } from 'react';
|
|
4
4
|
import { FieldValues, FieldPath, ControllerProps, UseFormGetFieldState } from 'react-hook-form';
|
|
5
5
|
import { Header, RowData as RowData$1, Column as Column$1, Table as Table$1, ColumnDef, ColumnFiltersState, OnChangeFn, FilterFnOption, SortingState, ColumnOrderState, VisibilityState, ColumnPinningState, GroupingState, GroupingOptions, ColumnResizeMode, RowSelectionState, Row, ExpandedState, HeaderGroup, Cell, HeaderContext } from '@tanstack/react-table';
|
|
6
|
+
import * as zustand from 'zustand';
|
|
6
7
|
import * as class_variance_authority_dist_types from 'class-variance-authority/dist/types';
|
|
7
8
|
import { VariantProps } from 'class-variance-authority';
|
|
8
9
|
import { ClassValue } from 'clsx';
|
|
9
|
-
import * as zustand from 'zustand';
|
|
10
10
|
|
|
11
11
|
type FormErrorMessageProps = React__default.ComponentProps<"p"> & {
|
|
12
12
|
errorClassName?: string;
|
|
@@ -259,6 +259,19 @@ type HeaderCellProps<TData = any, TValue = any> = {
|
|
|
259
259
|
};
|
|
260
260
|
declare const HeaderCell: ({ rootClassName, labelClassName, context, label, sorterProps }: HeaderCellProps) => react_jsx_runtime.JSX.Element;
|
|
261
261
|
|
|
262
|
+
declare const PreventPageLeave: ({ children }: React__default.PropsWithChildren) => React__default.ReactNode;
|
|
263
|
+
|
|
264
|
+
type PreventPageLeaveStore = {
|
|
265
|
+
isPreventing: boolean;
|
|
266
|
+
setPreventing: (value: boolean) => void;
|
|
267
|
+
};
|
|
268
|
+
declare const usePreventPageLeaveStore: zustand.UseBoundStore<zustand.StoreApi<PreventPageLeaveStore>>;
|
|
269
|
+
|
|
270
|
+
type UsePreventPageLeaveOptions = {
|
|
271
|
+
isPrevening: boolean;
|
|
272
|
+
};
|
|
273
|
+
declare const usePreventPageLeave: ({ isPrevening }: UsePreventPageLeaveOptions) => void;
|
|
274
|
+
|
|
262
275
|
declare const buttonVariants: (props?: ({
|
|
263
276
|
variant?: "link" | "default" | "outline" | "cancel" | "destructive" | "secondary" | "ghost" | "defaultSelect" | "defaultOutline" | null | undefined;
|
|
264
277
|
size?: "default" | "option" | "icon" | "sm" | "lg" | "icon-xs" | "icon-sm" | "icon-md" | "icon-lg" | null | undefined;
|
|
@@ -317,9 +330,10 @@ type NavbarBaseProps = {
|
|
|
317
330
|
onMainButtonClick?: () => void;
|
|
318
331
|
onSubButtonClick?: () => void;
|
|
319
332
|
searchButton?: React__default.ReactNode;
|
|
333
|
+
separatorDisable?: boolean;
|
|
320
334
|
};
|
|
321
335
|
type NavbarProps = RequireAtLeastOne<NavbarBaseProps, "title" | "headImageURL">;
|
|
322
|
-
declare const _default: React__default.MemoExoticComponent<({ className, title, subTitle, headImageURL, headImageURLClassName, tooltipTitle, tooltipIcon, tooltipdescription, mainButtonText, mainButtonClassName, mainButtonDisable, subButtonText, subButtonClassName, subButtonDisable, onMainButtonClick, onSubButtonClick, searchButton }: NavbarProps) => react_jsx_runtime.JSX.Element>;
|
|
336
|
+
declare const _default: React__default.MemoExoticComponent<({ className, title, subTitle, headImageURL, headImageURLClassName, tooltipTitle, tooltipIcon, tooltipdescription, mainButtonText, mainButtonClassName, mainButtonDisable, subButtonText, subButtonClassName, subButtonDisable, onMainButtonClick, onSubButtonClick, separatorDisable, searchButton }: NavbarProps) => react_jsx_runtime.JSX.Element>;
|
|
323
337
|
|
|
324
338
|
type FieldType = "text" | "number" | "date" | "datetime" | "checkbox" | "dropdown" | "lookup";
|
|
325
339
|
type Option = {
|
|
@@ -347,6 +361,7 @@ interface AdvanceSearchProps {
|
|
|
347
361
|
limitRows?: number;
|
|
348
362
|
iconColor?: string;
|
|
349
363
|
onSearch?: (param: Record<string, unknown>) => void;
|
|
364
|
+
onClear?: () => void;
|
|
350
365
|
}
|
|
351
366
|
|
|
352
367
|
declare const AdvanceSearch: React__default.FC<AdvanceSearchProps>;
|
|
@@ -471,4 +486,4 @@ type Breakpoints = {
|
|
|
471
486
|
};
|
|
472
487
|
declare const useScreenSize: (breakpoints?: Breakpoints) => UseScreenSizeResult;
|
|
473
488
|
|
|
474
|
-
export { AdvanceSearch, type Breakpoints, Button, type Column, type ContentSlot, DataTable, type DataTableChildrenKeyHandler, type DataTableColumnFilter, type DataTableColumnFilterProps, type DataTableColumnGrouping, type DataTableColumnOrdering, type DataTableColumnPinning, type DataTableColumnSorting, type DataTableColumnVisibility, type DataTableComponentProps, type DataTableFilterConfig, type DataTableFilters, type DataTableGlobalFilter, type DataTableHeaderCell, type DataTableProps, type DataTableRenderHeaderHandler, type DataTableRenderHeaderProps, type DataTableRenderRowHandler, type DataTableRenderRowProps, type DataTableRowCell, type DataTableRowClickHandler, type DataTableRowExpansion, type DataTableRowIdKeyHandler, type DataTableRowSelection, type DataTableScrollFetch, type DataTableStatusContent, type DatatableColumnResizing, ConfirmDialog as Dialog, type FieldSchema, FormErrorMessage, type FormErrorMessageProps, FormField, FormFieldContext, type FormFieldContextValue, type FormFieldProps, FormItem, FormItemContext, type FormItemContextValue, type FormItemProps, FormLabel, type FormLabelProps, type GridPayload, GridSettingsModal, type GridSettingsModalProps, HeaderCell, type HeaderCellProps, _default as Navbar, type NavbarProps, NumberInput, type NumberInputProps, type SorterProps, TextInput, type TextInputProps, type UseFormFieldOptions, type UseFormFieldReturn, type UseHoverResult, type UseMediaQueryOptions, type UseMediaQueryResult, type UseScreenSizeResult, booleanToSelectValue, buttonVariants, cn, compareAlphanumeric, getColumnIdFromTable, renderContentSlot, selectValueToBoolean, useFormField, useGridSettingsStore, useHover, useIntersectionObserver, useMediaQuery, useScreenSize };
|
|
489
|
+
export { AdvanceSearch, type Breakpoints, Button, type Column, type ContentSlot, DataTable, type DataTableChildrenKeyHandler, type DataTableColumnFilter, type DataTableColumnFilterProps, type DataTableColumnGrouping, type DataTableColumnOrdering, type DataTableColumnPinning, type DataTableColumnSorting, type DataTableColumnVisibility, type DataTableComponentProps, type DataTableFilterConfig, type DataTableFilters, type DataTableGlobalFilter, type DataTableHeaderCell, type DataTableProps, type DataTableRenderHeaderHandler, type DataTableRenderHeaderProps, type DataTableRenderRowHandler, type DataTableRenderRowProps, type DataTableRowCell, type DataTableRowClickHandler, type DataTableRowExpansion, type DataTableRowIdKeyHandler, type DataTableRowSelection, type DataTableScrollFetch, type DataTableStatusContent, type DatatableColumnResizing, ConfirmDialog as Dialog, type FieldSchema, FormErrorMessage, type FormErrorMessageProps, FormField, FormFieldContext, type FormFieldContextValue, type FormFieldProps, FormItem, FormItemContext, type FormItemContextValue, type FormItemProps, FormLabel, type FormLabelProps, type GridPayload, GridSettingsModal, type GridSettingsModalProps, HeaderCell, type HeaderCellProps, _default as Navbar, type NavbarProps, NumberInput, type NumberInputProps, PreventPageLeave, type SorterProps, TextInput, type TextInputProps, type UseFormFieldOptions, type UseFormFieldReturn, type UseHoverResult, type UseMediaQueryOptions, type UseMediaQueryResult, type UsePreventPageLeaveOptions, type UseScreenSizeResult, booleanToSelectValue, buttonVariants, cn, compareAlphanumeric, getColumnIdFromTable, renderContentSlot, selectValueToBoolean, useFormField, useGridSettingsStore, useHover, useIntersectionObserver, useMediaQuery, usePreventPageLeave, usePreventPageLeaveStore, useScreenSize };
|