caplink-saas-ui-shared-component-library 1.36.2 → 1.37.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.
Files changed (30) hide show
  1. package/dist/components/input/input.d.ts +2 -0
  2. package/dist/components/numeric-input/index.d.ts +1 -0
  3. package/dist/components/numeric-input/lib/index.d.ts +29 -0
  4. package/dist/components/numeric-input/model/index.d.ts +8 -0
  5. package/dist/components/numeric-input/numeric-input.d.ts +19 -0
  6. package/dist/components/select/index.d.ts +1 -0
  7. package/dist/components/select/select.d.ts +13 -0
  8. package/dist/components/select/select.primitives.d.ts +13 -0
  9. package/dist/features/spreadsheet/model/context.d.ts +1 -1
  10. package/dist/features/spreadsheet/model/spreadsheet.d.ts +9 -0
  11. package/dist/features/spreadsheet/ui/fields/boolean-field.d.ts +2 -0
  12. package/dist/features/spreadsheet/ui/fields/date-field.d.ts +2 -0
  13. package/dist/features/spreadsheet/ui/fields/dropdown-field.d.ts +2 -0
  14. package/dist/features/spreadsheet/ui/fields/field-element.d.ts +2 -0
  15. package/dist/features/spreadsheet/ui/fields/field.d.ts +9 -0
  16. package/dist/features/spreadsheet/ui/fields/numeric-field-instance.d.ts +2 -0
  17. package/dist/features/spreadsheet/ui/fields/string-field.d.ts +2 -0
  18. package/dist/features/spreadsheet/ui/fields/string-masked-field.d.ts +2 -0
  19. package/dist/features/spreadsheet/ui/view-type/index.d.ts +1 -0
  20. package/dist/features/spreadsheet/ui/view-type/line-by-line.d.ts +1 -0
  21. package/dist/features/spreadsheet/ui/view-type/table.d.ts +1 -0
  22. package/dist/index.d.ts +5 -2
  23. package/dist/index.es.js +14874 -14343
  24. package/dist/index.es.js.map +1 -1
  25. package/dist/index.umd.js +135 -125
  26. package/dist/index.umd.js.map +1 -1
  27. package/dist/package.json +1 -1
  28. package/dist/shared/lib/use-autosize-textarea.d.ts +1 -0
  29. package/dist/types.d.ts +2 -1
  30. package/package.json +1 -1
@@ -3,9 +3,11 @@ import { VariantProps } from 'class-variance-authority';
3
3
  import { ReactNode, InputHTMLAttributes } from 'react';
4
4
  export type InputProps = {
5
5
  leftAdornment?: ReactNode;
6
+ containerClassName?: string;
6
7
  } & InputHTMLAttributes<HTMLInputElement> & VariantProps<typeof inputVariants>;
7
8
  export declare const Input: import('react').ForwardRefExoticComponent<{
8
9
  leftAdornment?: ReactNode;
10
+ containerClassName?: string | undefined;
9
11
  } & InputHTMLAttributes<HTMLInputElement> & VariantProps<(props?: ({
10
12
  variant?: "default" | "success" | "warning" | "danger" | null | undefined;
11
13
  } & import('class-variance-authority/types').ClassProp) | undefined) => string> & import('react').RefAttributes<HTMLInputElement>>;
@@ -0,0 +1 @@
1
+ export { NumericInput, type NumericInputProps } from './numeric-input';
@@ -0,0 +1,29 @@
1
+ import { NumberType } from '../model';
2
+ export declare const percentageRatio = 100;
3
+ export declare const percentageScaleToBeDisregarded = 2;
4
+ interface NumToStrFormatter {
5
+ numValue?: number;
6
+ decimalScale: number;
7
+ type: NumberType;
8
+ currency?: string;
9
+ }
10
+ export type RoundingRule = 'TRUNCATE' | 'ROUND';
11
+ export declare function numToStrFormatter(params: NumToStrFormatter): string;
12
+ interface GetDecimalScale {
13
+ type: NumberType;
14
+ decimalScale?: number;
15
+ }
16
+ export declare function getDecimalScale(params: GetDecimalScale): number | undefined;
17
+ interface GetPercentageOutput {
18
+ decimalScale: number;
19
+ numValue: number;
20
+ roundingRule: RoundingRule;
21
+ }
22
+ export declare function convertPercentageToInput(params: GetPercentageOutput): number;
23
+ interface GetPercentageInput {
24
+ decimalScale: number;
25
+ numValue: number;
26
+ roundingRule: RoundingRule;
27
+ }
28
+ export declare function convertPercentageToOutput(params: GetPercentageInput): number;
29
+ export {};
@@ -0,0 +1,8 @@
1
+ export type NumberType = 'integer' | 'float' | 'decimal' | 'percentage' | 'currency';
2
+ export interface NumericInputSettings {
3
+ min?: number;
4
+ max?: number;
5
+ decimalScale?: number;
6
+ allowNegative?: boolean;
7
+ currency?: string;
8
+ }
@@ -0,0 +1,19 @@
1
+ import { ClipboardEvent, FocusEvent, MouseEvent } from 'react';
2
+ import { NumberType, NumericInputSettings } from './model';
3
+ export interface NumericInputProps {
4
+ value?: string;
5
+ onChange?: (value?: string) => void;
6
+ onBlur?: () => void;
7
+ onFocus?: (e: FocusEvent<HTMLInputElement>) => void;
8
+ onClick?: (e: MouseEvent<HTMLInputElement>) => void;
9
+ onPaste?: (e: ClipboardEvent<HTMLInputElement>) => void;
10
+ tabIndex?: number;
11
+ type: NumberType;
12
+ settings?: Partial<NumericInputSettings>;
13
+ disabled?: boolean;
14
+ testid?: string;
15
+ className?: string;
16
+ dataCypress?: string;
17
+ dataFieldInstanceInput?: string;
18
+ }
19
+ export declare function NumericInput(props: NumericInputProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export { Select } from './select';
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ export declare const Select: {
3
+ Root: import('react').FC<import('@radix-ui/react-select').SelectProps>;
4
+ Content: import('react').ForwardRefExoticComponent<Omit<import('@radix-ui/react-select').SelectContentProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
5
+ Group: import('react').ForwardRefExoticComponent<import('@radix-ui/react-select').SelectGroupProps & import('react').RefAttributes<HTMLDivElement>>;
6
+ Item: import('react').ForwardRefExoticComponent<Omit<import('@radix-ui/react-select').SelectItemProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
7
+ Label: import('react').ForwardRefExoticComponent<Omit<import('@radix-ui/react-select').SelectLabelProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
8
+ Separator: import('react').ForwardRefExoticComponent<Omit<import('@radix-ui/react-select').SelectSeparatorProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
9
+ Trigger: import('react').ForwardRefExoticComponent<Omit<import('@radix-ui/react-select').SelectTriggerProps & import('react').RefAttributes<HTMLButtonElement>, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
10
+ Value: import('react').ForwardRefExoticComponent<import('@radix-ui/react-select').SelectValueProps & import('react').RefAttributes<HTMLSpanElement>>;
11
+ ScrollDownButton: import('react').ForwardRefExoticComponent<Omit<import('@radix-ui/react-select').SelectScrollDownButtonProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
12
+ ScrollUpButton: import('react').ForwardRefExoticComponent<Omit<import('@radix-ui/react-select').SelectScrollUpButtonProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
13
+ };
@@ -0,0 +1,13 @@
1
+ import * as SelectPrimitive from '@radix-ui/react-select';
2
+ import * as React from 'react';
3
+ declare const Select: React.FC<SelectPrimitive.SelectProps>;
4
+ declare const SelectGroup: React.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React.RefAttributes<HTMLDivElement>>;
5
+ declare const SelectValue: React.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React.RefAttributes<HTMLSpanElement>>;
6
+ declare const SelectTrigger: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
7
+ declare const SelectScrollUpButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
8
+ declare const SelectScrollDownButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollDownButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
9
+ declare const SelectContent: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
10
+ declare const SelectLabel: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
11
+ declare const SelectItem: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
12
+ declare const SelectSeparator: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
13
+ export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, SelectScrollUpButton, SelectScrollDownButton, };
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
- import type * as Spreadsheet from './spreadsheet';
2
+ import * as Spreadsheet from './spreadsheet';
3
3
  export declare const SpreadsheetContext: import('react').Context<Spreadsheet.Context | null>;
4
4
  export declare function SpreadsheetContextProvider({ children, startingColumns, matrix: startingMatrix, staticRows, onMatrixChange, onExportData, }: Spreadsheet.ContextProvider): import("react/jsx-runtime").JSX.Element;
@@ -83,6 +83,9 @@ export type ColumnState = {
83
83
  width: number;
84
84
  };
85
85
  export type ColumnSettings = {
86
+ lineByLine?: {
87
+ span?: number;
88
+ };
86
89
  select?: {
87
90
  items: Array<SelectItem>;
88
91
  };
@@ -121,6 +124,10 @@ export type Column = {
121
124
  counter: ColumnCounterEnum;
122
125
  filter: ColumnFilter;
123
126
  };
127
+ export declare enum SpreadsheetViewType {
128
+ DEFAULT = "DEFAULT",
129
+ LINE_BY_LINE = "LINE_BY_LINE"
130
+ }
124
131
  /** Spreadsheet Cell component */
125
132
  export type Cell = {
126
133
  /** The cell value */
@@ -177,5 +184,7 @@ export type Context = {
177
184
  }): void;
178
185
  onRestoreColumnsVisibility: () => void;
179
186
  onExportData?: () => void;
187
+ viewType: SpreadsheetViewType;
188
+ setViewType: (viewType: SpreadsheetViewType) => void;
180
189
  };
181
190
  export type ContextProvider = Omit<PropsWithChildren<SpreadsheetProps>, 'className'>;
@@ -0,0 +1,2 @@
1
+ import { FieldProps } from './field';
2
+ export declare function BooleanField({ value, onValueChange, isDisabled }: FieldProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { FieldProps } from './field';
2
+ export declare function DateField({ value, onValueChange, isDisabled }: FieldProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { FieldProps } from './field';
2
+ export declare function DropdownField({ value, onValueChange, isDisabled, settings }: FieldProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { FieldProps } from './field';
2
+ export declare function FieldElement(props: FieldProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,9 @@
1
+ import { ColumnSettings, DataEditorType } from '../../model/spreadsheet';
2
+ export type FieldProps = {
3
+ value: string;
4
+ onValueChange: (value: string) => void;
5
+ isDisabled: boolean;
6
+ type: DataEditorType;
7
+ settings?: ColumnSettings;
8
+ };
9
+ export declare function Field(props: FieldProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { FieldProps } from './field';
2
+ export declare function NumericFieldInstance({ value, onValueChange, isDisabled, type }: FieldProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { FieldProps } from './field';
2
+ export declare function StringField({ value, onValueChange, isDisabled, settings }: FieldProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { FieldProps } from './field';
2
+ export declare function StringMaskedField({ value, onValueChange, isDisabled, settings }: FieldProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function ViewType(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function LineByLineViewType(): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1 @@
1
+ export declare function TableViewType(): import("react/jsx-runtime").JSX.Element;
package/dist/index.d.ts CHANGED
@@ -28,6 +28,8 @@ import { DownloadFileButton, DownloadFileButtonProps, DownloadFileButtonVariant
28
28
  import { UploadImageInput, UploadImageInputProps, UploadImageInputVariant } from './components/upload-image-input';
29
29
  import { DocumentFolder, DocumentFolderCellProps, DataEditorCellProps, DataViewerProps, DocumentFolderDataEditor } from './components/document-folder';
30
30
  import { Table, TablePaginationProps } from './components/table';
31
+ import { NumericInput } from './components/numeric-input';
32
+ import { Select } from './components/select';
31
33
  import { ImageUploader, ImageUploaderProps } from './features/image-uploader/ui';
32
34
  import { Spreadsheet } from './features/spreadsheet/ui';
33
35
  import { useGetAdjacentNodesProps } from './features/dag/hooks';
@@ -41,6 +43,7 @@ import { ContentSplit, ContentSplitProps, Sidebar, SidebarHeader, SidebarProps }
41
43
  import { EmptySearchIcon } from './svg/empty-search-icon';
42
44
  import { EmptyFolderIcon } from './svg/empty-folder-icon';
43
45
  import { FloatButton, FloatButtonProps } from './components/float-button/float-button';
46
+ import { InitialColumn } from './features/spreadsheet/lib/setup-columns';
44
47
  import { MatrixTypes, SpreadsheetTypes } from './types';
45
48
  import { Position, Connection, DagProps, DefaultNodeDataProps, Edge, EdgePosition, EdgeProps, Node, NodeProps, UseDagProps } from './features/dag/model';
46
49
  import { GetLayoutedElementsProps } from './features/dag/utils/get-layout-elements';
@@ -48,7 +51,7 @@ import { CapLinkProvider } from './providers';
48
51
  import { IconTextButtonProps } from './components/icon-text-button';
49
52
  import { Badge, BadgeProps } from './components/badge';
50
53
  import { CustomPaginationProps } from './components/pagination';
51
- export { Accordion, accordionVariants, Tabs, Status, Switch, Tooltip, Popover, Radio, Checkbox, InputOTP, Card, Input, Breadcrumb, Alert, alertVariants, ProgressBar, Button, buttonVariants, AlertBanner, Sheet, CopyTextButton, Textarea, textareaVariants, Dialog, ToastProvider, Toaster, useToast, IconButton, iconButtonVariants, AlertDialog, DownloadFileButton, UploadImageInput, InputPassword, Searchbar, RichText, DocumentFolder, DocumentFolderDataEditor, Table, };
54
+ export { Accordion, accordionVariants, Tabs, Status, Switch, Tooltip, Popover, Radio, Checkbox, InputOTP, Card, Input, Breadcrumb, Alert, alertVariants, ProgressBar, Button, buttonVariants, AlertBanner, Sheet, CopyTextButton, Textarea, textareaVariants, Dialog, ToastProvider, Toaster, useToast, IconButton, iconButtonVariants, AlertDialog, DownloadFileButton, UploadImageInput, InputPassword, Searchbar, RichText, DocumentFolder, DocumentFolderDataEditor, Table, NumericInput, Select, };
52
55
  export type { AccordionProps, CardProps, InputProps, TextareaProps, AlertProps, ProgressBarProps, ButtonProps, AlertBannerProps, SheetProps, SheetContentProps, CopyTextButtonProps, DialogProps, DialogContentProps, ToastFnProps, IconButtonProps, AlertDialogProps, AlertDialogContentProps, DownloadFileButtonProps, DownloadFileButtonVariant, UploadImageInputProps, UploadImageInputVariant, SearchbarProps, RichTextViewerProps, RichTextEditorProps, DocumentFolderCellProps, DataEditorCellProps, DataViewerProps, TablePaginationProps, };
53
56
  /** ----------- Updated Components ----------- */
54
57
  /** ----------- SVG Icons & Components ----------- */
@@ -268,4 +271,4 @@ export declare const CapLink: {
268
271
  DropdownMenuTrigger: import('react').ForwardRefExoticComponent<import('@radix-ui/react-dropdown-menu').DropdownMenuTriggerProps & import('react').RefAttributes<HTMLButtonElement>>;
269
272
  };
270
273
  export { CapLinkProvider };
271
- export type { ImageUploaderProps, MatrixTypes, SpreadsheetTypes, SearchNodeProps, FloatButtonProps, ContentSplitProps, SidebarProps, useGetAdjacentNodesProps, AdjacentNodesProps, ButtonChangeOrientationProps, FloatMenuProps, Connection, DagProps, DefaultNodeDataProps, Edge, EdgePosition, EdgeProps, Node, NodeProps, UseDagProps, Position, GetLayoutedElementsProps, BadgeProps, CustomPaginationProps, IconTextButtonProps, };
274
+ export type { ImageUploaderProps, MatrixTypes, SpreadsheetTypes, InitialColumn, SearchNodeProps, FloatButtonProps, ContentSplitProps, SidebarProps, useGetAdjacentNodesProps, AdjacentNodesProps, ButtonChangeOrientationProps, FloatMenuProps, Connection, DagProps, DefaultNodeDataProps, Edge, EdgePosition, EdgeProps, Node, NodeProps, UseDagProps, Position, GetLayoutedElementsProps, BadgeProps, CustomPaginationProps, IconTextButtonProps, };