@rufous/ui 0.2.74 → 0.2.76
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/main.cjs +40 -3
- package/dist/main.d.cts +13 -1
- package/dist/main.d.ts +13 -1
- package/dist/main.js +40 -3
- package/package.json +1 -1
package/dist/main.cjs
CHANGED
|
@@ -1740,6 +1740,25 @@ var Checkbox = ({
|
|
|
1740
1740
|
|
|
1741
1741
|
// lib/TextFields/TextField.tsx
|
|
1742
1742
|
var import_react17 = __toESM(require("react"), 1);
|
|
1743
|
+
var NUMBER_BLOCKED_KEYS = ["e", "E", "+", "-"];
|
|
1744
|
+
var BLOCKED_KEYS_BY_VARIANT = {
|
|
1745
|
+
"integer": [...NUMBER_BLOCKED_KEYS, ".", ","],
|
|
1746
|
+
"decimal": [...NUMBER_BLOCKED_KEYS],
|
|
1747
|
+
"positive-integer": [...NUMBER_BLOCKED_KEYS, ".", ","],
|
|
1748
|
+
"positive-decimal": [...NUMBER_BLOCKED_KEYS]
|
|
1749
|
+
};
|
|
1750
|
+
var STEP_BY_VARIANT = {
|
|
1751
|
+
"integer": 1,
|
|
1752
|
+
"decimal": 0.1,
|
|
1753
|
+
"positive-integer": 1,
|
|
1754
|
+
"positive-decimal": 0.1
|
|
1755
|
+
};
|
|
1756
|
+
var MIN_BY_VARIANT = {
|
|
1757
|
+
"integer": void 0,
|
|
1758
|
+
"decimal": void 0,
|
|
1759
|
+
"positive-integer": 0,
|
|
1760
|
+
"positive-decimal": 0
|
|
1761
|
+
};
|
|
1743
1762
|
var TextField = (0, import_react17.forwardRef)(({
|
|
1744
1763
|
label,
|
|
1745
1764
|
name,
|
|
@@ -1761,6 +1780,7 @@ var TextField = (0, import_react17.forwardRef)(({
|
|
|
1761
1780
|
fullWidth = false,
|
|
1762
1781
|
slotProps,
|
|
1763
1782
|
InputProps,
|
|
1783
|
+
numberVariant,
|
|
1764
1784
|
...props
|
|
1765
1785
|
}, ref) => {
|
|
1766
1786
|
const sxClass = useSx(sx);
|
|
@@ -1816,6 +1836,11 @@ var TextField = (0, import_react17.forwardRef)(({
|
|
|
1816
1836
|
};
|
|
1817
1837
|
const handleKeyDown = (e) => {
|
|
1818
1838
|
if (type === "number") {
|
|
1839
|
+
const blockedKeys = numberVariant ? BLOCKED_KEYS_BY_VARIANT[numberVariant] : NUMBER_BLOCKED_KEYS;
|
|
1840
|
+
if (blockedKeys.includes(e.key)) {
|
|
1841
|
+
e.preventDefault();
|
|
1842
|
+
return;
|
|
1843
|
+
}
|
|
1819
1844
|
if (e.key === "ArrowUp") {
|
|
1820
1845
|
e.preventDefault();
|
|
1821
1846
|
if (internalRef.current) {
|
|
@@ -1849,6 +1874,8 @@ var TextField = (0, import_react17.forwardRef)(({
|
|
|
1849
1874
|
required,
|
|
1850
1875
|
disabled,
|
|
1851
1876
|
readOnly,
|
|
1877
|
+
step: type === "number" && numberVariant ? STEP_BY_VARIANT[numberVariant] : void 0,
|
|
1878
|
+
min: type === "number" && numberVariant ? MIN_BY_VARIANT[numberVariant] : void 0,
|
|
1852
1879
|
...slotProps?.input,
|
|
1853
1880
|
...props
|
|
1854
1881
|
}
|
|
@@ -3987,7 +4014,9 @@ var getOperatorsForType = (type) => {
|
|
|
3987
4014
|
];
|
|
3988
4015
|
return [
|
|
3989
4016
|
{ value: "contains", label: "contains" },
|
|
4017
|
+
{ value: "does not contain", label: "does not contain" },
|
|
3990
4018
|
{ value: "equals", label: "equals" },
|
|
4019
|
+
{ value: "is not equal to", label: "is not equal to" },
|
|
3991
4020
|
{ value: "starts with", label: "starts with" },
|
|
3992
4021
|
{ value: "ends with", label: "ends with" },
|
|
3993
4022
|
{ value: "is empty", label: "is empty" },
|
|
@@ -4207,8 +4236,12 @@ function DataGrid({
|
|
|
4207
4236
|
switch (f.operator) {
|
|
4208
4237
|
case "contains":
|
|
4209
4238
|
return itemVal.includes(val);
|
|
4239
|
+
case "does not contain":
|
|
4240
|
+
return !itemVal.includes(val);
|
|
4210
4241
|
case "equals":
|
|
4211
4242
|
return itemVal === val;
|
|
4243
|
+
case "is not equal to":
|
|
4244
|
+
return itemVal !== val;
|
|
4212
4245
|
case "starts with":
|
|
4213
4246
|
return itemVal.startsWith(val);
|
|
4214
4247
|
case "ends with":
|
|
@@ -4254,10 +4287,14 @@ function DataGrid({
|
|
|
4254
4287
|
return sortedData.slice(start, start + pageSize);
|
|
4255
4288
|
}, [sortedData, currentPage, pageSize]);
|
|
4256
4289
|
const handleExport = () => {
|
|
4257
|
-
const
|
|
4258
|
-
const headers =
|
|
4290
|
+
const exportableCols = resolvedColumns.filter((c) => !c.hidden && c.isExportable !== false);
|
|
4291
|
+
const headers = exportableCols.map((c) => c.headerName).join(",");
|
|
4259
4292
|
const rows = sortedData.map(
|
|
4260
|
-
(item) =>
|
|
4293
|
+
(item) => exportableCols.map((c) => {
|
|
4294
|
+
const raw = item[c.field];
|
|
4295
|
+
const val = raw === null || raw === void 0 ? "" : String(raw).replace(/"/g, '""');
|
|
4296
|
+
return `"${val}"`;
|
|
4297
|
+
}).join(",")
|
|
4261
4298
|
);
|
|
4262
4299
|
const csv = [headers, ...rows].join("\n");
|
|
4263
4300
|
const blob = new Blob([csv], { type: "text/csv;charset=utf-8;" });
|
package/dist/main.d.cts
CHANGED
|
@@ -518,6 +518,7 @@ interface CheckboxProps {
|
|
|
518
518
|
|
|
519
519
|
declare const Checkbox: React.FC<CheckboxProps>;
|
|
520
520
|
|
|
521
|
+
type NumberVariant = 'integer' | 'decimal' | 'positive-integer' | 'positive-decimal';
|
|
521
522
|
interface TextFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> {
|
|
522
523
|
/** Label text shown for the input */
|
|
523
524
|
label?: string;
|
|
@@ -525,6 +526,16 @@ interface TextFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'si
|
|
|
525
526
|
variant?: 'outlined' | 'filled' | 'standard';
|
|
526
527
|
/** The size of the component */
|
|
527
528
|
size?: 'small' | 'medium';
|
|
529
|
+
/**
|
|
530
|
+
* Sub-variant for number inputs. Only applies when `type="number"`.
|
|
531
|
+
* - `integer`: whole numbers (blocks `.`)
|
|
532
|
+
* - `decimal`: floating point numbers
|
|
533
|
+
* - `positive-integer`: whole numbers ≥ 0
|
|
534
|
+
* - `positive-decimal`: floating point numbers ≥ 0
|
|
535
|
+
*
|
|
536
|
+
* All number variants block `e`, `E`, `+`, `-`.
|
|
537
|
+
*/
|
|
538
|
+
numberVariant?: NumberVariant;
|
|
528
539
|
/** The color of the component */
|
|
529
540
|
color?: 'primary' | 'secondary' | 'error' | 'success' | 'info' | 'warning';
|
|
530
541
|
/** If true, the label is displayed in an error state. */
|
|
@@ -789,6 +800,7 @@ interface Column<T> {
|
|
|
789
800
|
cellClassName?: string;
|
|
790
801
|
hideable?: boolean;
|
|
791
802
|
disableColumnMenu?: boolean;
|
|
803
|
+
isExportable?: boolean;
|
|
792
804
|
}
|
|
793
805
|
interface Action<T> {
|
|
794
806
|
label: string;
|
|
@@ -1714,4 +1726,4 @@ interface MentionItemData {
|
|
|
1714
1726
|
shortName?: string;
|
|
1715
1727
|
}
|
|
1716
1728
|
|
|
1717
|
-
export { APP_THEMES, Accordion, AccordionDetails, type AccordionDetailsProps, type AccordionProps, AccordionSummary, type AccordionSummaryProps, type Action, ActivateUserIcon, AddButton, AddressLookup, ArchivedIcon, AssignGroupIcon, Autocomplete, type AutocompleteProps, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, BaseDialog, Box, type BoxProps, Breadcrumbs, type BreadcrumbsProps, Button, type ButtonProps, CameraIcon, CancelButton, Card, CardActions, type CardActionsProps, CardContent, type CardContentProps, CardHeader, type CardHeaderProps, CardMedia, type CardMediaProps, type CardProps, Checkbox, type CheckboxProps, Chip, type ChipProps, CircularProgress, CircularProgressIcon, type CircularProgressIconProps, CloseIcon, Collapse, type CollapseProps, type Column, CopyIcon, DataGrid, type DataGridProps, DateField, type DateFieldProps, type DateFormatString, DateRangeField, type DateRangeFieldProps, type DateRangeValue, DifficultyAllIcon, DifficultyEasyIcon, DifficultyHardIcon, DifficultyMediumIcon, Divider, type DividerProps, DollarIcon, DownloadIcon, DownloadPdfIcon, Drawer, type DrawerProps, EditChatIcon, EditIcon, EngagementIcon, Fade, type FadeProps, FunctionIcon, Grid, type GridProps, Grow, type GrowProps, HelpOutlinedIcon, HierarchyIcon, IconButton, type IconButtonProps, ImageField, type ImageFieldProps, InactiveGroupIcon, IndustryIcon, InvoiceIcon, Link, type LinkProps, List, ListItem, ListItemButton, type ListItemButtonProps, ListItemIcon, type ListItemIconProps, type ListItemProps, ListItemText, type ListItemTextProps, type ListProps, ListSubheader, type ListSubheaderProps, LocationPinIcon, LogsIcon, Menu, MenuDivider, MenuItem, type MenuItemProps, MenuList, type MenuListProps, type MenuProps, MinExperienceIcon, NineDotMenuIcon, NotificationIcon, Paper, type PaperProps, PhoneField, type PhoneFieldProps, Popover, type PopoverProps, Popper, type PopperProps, ProjectIcon, QualificationsIcon, QuestionStatusAllIcon, QuestionStatusPrivateIcon, QuestionStatusPublicIcon, QuestionTypeAllIcon, QuestionTypeCodingIcon, QuestionTypeDescriptiveIcon, QuestionTypeMultipleIcon, QuestionTypeSingleIcon, Radio, RadioGroup, type RadioGroupProps, type RadioProps, Rating, type RatingProps, RefreshIcon, ResendInviteIcon, RolesIcon, RufousAiIcon, RufousBirdIcon, RufousLauncherIcon, RufousLogoLoader, type RufousLogoLoaderProps, RufousTextContent, type RufousTextContentProps, RufousTextEditor, type MentionItemData as RufousTextEditorMentionItem, type RufousTextEditorProps, RufousThemeProvider, Select, type SelectProps, SidebarIcon, Skeleton, type SkeletonProps, Slide, type SlideProps, Slider, type SliderProps, Snackbar, type SnackbarProps, SoftSkillsIcon, type SortDirection, Stack, type StackProps, StandardButton, Step, StepButton, type StepButtonProps, StepContent, type StepContentProps, StepLabel, type StepLabelProps, type StepProps, Stepper, type StepperProps, SubmitButton, SubscribeIcon, SuspendUserIcon, Switch, type SwitchProps, type SxProp, Tab, TabPanel, type TabPanelProps, type TabProps, Tabs, type TabsProps, TechnicalSkillsIcon, TextField, type TextFieldProps, TickIcon, TimerIcon, ToggleButton, ToggleButtonGroup, type ToggleButtonGroupProps, type ToggleButtonProps, Tooltip, type TooltipProps, TrashIcon, Typography, type TypographyProps, UnArchivedIcon, UnsubscribeIcon, UploadIcon, UserAssignIcon, ViewIcon, WorkItemIcon, Zoom, type ZoomProps, transformLegacyTodos, useRufousTheme };
|
|
1729
|
+
export { APP_THEMES, Accordion, AccordionDetails, type AccordionDetailsProps, type AccordionProps, AccordionSummary, type AccordionSummaryProps, type Action, ActivateUserIcon, AddButton, AddressLookup, ArchivedIcon, AssignGroupIcon, Autocomplete, type AutocompleteProps, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, BaseDialog, Box, type BoxProps, Breadcrumbs, type BreadcrumbsProps, Button, type ButtonProps, CameraIcon, CancelButton, Card, CardActions, type CardActionsProps, CardContent, type CardContentProps, CardHeader, type CardHeaderProps, CardMedia, type CardMediaProps, type CardProps, Checkbox, type CheckboxProps, Chip, type ChipProps, CircularProgress, CircularProgressIcon, type CircularProgressIconProps, CloseIcon, Collapse, type CollapseProps, type Column, CopyIcon, DataGrid, type DataGridProps, DateField, type DateFieldProps, type DateFormatString, DateRangeField, type DateRangeFieldProps, type DateRangeValue, DifficultyAllIcon, DifficultyEasyIcon, DifficultyHardIcon, DifficultyMediumIcon, Divider, type DividerProps, DollarIcon, DownloadIcon, DownloadPdfIcon, Drawer, type DrawerProps, EditChatIcon, EditIcon, EngagementIcon, Fade, type FadeProps, FunctionIcon, Grid, type GridProps, Grow, type GrowProps, HelpOutlinedIcon, HierarchyIcon, IconButton, type IconButtonProps, ImageField, type ImageFieldProps, InactiveGroupIcon, IndustryIcon, InvoiceIcon, Link, type LinkProps, List, ListItem, ListItemButton, type ListItemButtonProps, ListItemIcon, type ListItemIconProps, type ListItemProps, ListItemText, type ListItemTextProps, type ListProps, ListSubheader, type ListSubheaderProps, LocationPinIcon, LogsIcon, Menu, MenuDivider, MenuItem, type MenuItemProps, MenuList, type MenuListProps, type MenuProps, MinExperienceIcon, NineDotMenuIcon, NotificationIcon, type NumberVariant, Paper, type PaperProps, PhoneField, type PhoneFieldProps, Popover, type PopoverProps, Popper, type PopperProps, ProjectIcon, QualificationsIcon, QuestionStatusAllIcon, QuestionStatusPrivateIcon, QuestionStatusPublicIcon, QuestionTypeAllIcon, QuestionTypeCodingIcon, QuestionTypeDescriptiveIcon, QuestionTypeMultipleIcon, QuestionTypeSingleIcon, Radio, RadioGroup, type RadioGroupProps, type RadioProps, Rating, type RatingProps, RefreshIcon, ResendInviteIcon, RolesIcon, RufousAiIcon, RufousBirdIcon, RufousLauncherIcon, RufousLogoLoader, type RufousLogoLoaderProps, RufousTextContent, type RufousTextContentProps, RufousTextEditor, type MentionItemData as RufousTextEditorMentionItem, type RufousTextEditorProps, RufousThemeProvider, Select, type SelectProps, SidebarIcon, Skeleton, type SkeletonProps, Slide, type SlideProps, Slider, type SliderProps, Snackbar, type SnackbarProps, SoftSkillsIcon, type SortDirection, Stack, type StackProps, StandardButton, Step, StepButton, type StepButtonProps, StepContent, type StepContentProps, StepLabel, type StepLabelProps, type StepProps, Stepper, type StepperProps, SubmitButton, SubscribeIcon, SuspendUserIcon, Switch, type SwitchProps, type SxProp, Tab, TabPanel, type TabPanelProps, type TabProps, Tabs, type TabsProps, TechnicalSkillsIcon, TextField, type TextFieldProps, TickIcon, TimerIcon, ToggleButton, ToggleButtonGroup, type ToggleButtonGroupProps, type ToggleButtonProps, Tooltip, type TooltipProps, TrashIcon, Typography, type TypographyProps, UnArchivedIcon, UnsubscribeIcon, UploadIcon, UserAssignIcon, ViewIcon, WorkItemIcon, Zoom, type ZoomProps, transformLegacyTodos, useRufousTheme };
|
package/dist/main.d.ts
CHANGED
|
@@ -518,6 +518,7 @@ interface CheckboxProps {
|
|
|
518
518
|
|
|
519
519
|
declare const Checkbox: React.FC<CheckboxProps>;
|
|
520
520
|
|
|
521
|
+
type NumberVariant = 'integer' | 'decimal' | 'positive-integer' | 'positive-decimal';
|
|
521
522
|
interface TextFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> {
|
|
522
523
|
/** Label text shown for the input */
|
|
523
524
|
label?: string;
|
|
@@ -525,6 +526,16 @@ interface TextFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'si
|
|
|
525
526
|
variant?: 'outlined' | 'filled' | 'standard';
|
|
526
527
|
/** The size of the component */
|
|
527
528
|
size?: 'small' | 'medium';
|
|
529
|
+
/**
|
|
530
|
+
* Sub-variant for number inputs. Only applies when `type="number"`.
|
|
531
|
+
* - `integer`: whole numbers (blocks `.`)
|
|
532
|
+
* - `decimal`: floating point numbers
|
|
533
|
+
* - `positive-integer`: whole numbers ≥ 0
|
|
534
|
+
* - `positive-decimal`: floating point numbers ≥ 0
|
|
535
|
+
*
|
|
536
|
+
* All number variants block `e`, `E`, `+`, `-`.
|
|
537
|
+
*/
|
|
538
|
+
numberVariant?: NumberVariant;
|
|
528
539
|
/** The color of the component */
|
|
529
540
|
color?: 'primary' | 'secondary' | 'error' | 'success' | 'info' | 'warning';
|
|
530
541
|
/** If true, the label is displayed in an error state. */
|
|
@@ -789,6 +800,7 @@ interface Column<T> {
|
|
|
789
800
|
cellClassName?: string;
|
|
790
801
|
hideable?: boolean;
|
|
791
802
|
disableColumnMenu?: boolean;
|
|
803
|
+
isExportable?: boolean;
|
|
792
804
|
}
|
|
793
805
|
interface Action<T> {
|
|
794
806
|
label: string;
|
|
@@ -1714,4 +1726,4 @@ interface MentionItemData {
|
|
|
1714
1726
|
shortName?: string;
|
|
1715
1727
|
}
|
|
1716
1728
|
|
|
1717
|
-
export { APP_THEMES, Accordion, AccordionDetails, type AccordionDetailsProps, type AccordionProps, AccordionSummary, type AccordionSummaryProps, type Action, ActivateUserIcon, AddButton, AddressLookup, ArchivedIcon, AssignGroupIcon, Autocomplete, type AutocompleteProps, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, BaseDialog, Box, type BoxProps, Breadcrumbs, type BreadcrumbsProps, Button, type ButtonProps, CameraIcon, CancelButton, Card, CardActions, type CardActionsProps, CardContent, type CardContentProps, CardHeader, type CardHeaderProps, CardMedia, type CardMediaProps, type CardProps, Checkbox, type CheckboxProps, Chip, type ChipProps, CircularProgress, CircularProgressIcon, type CircularProgressIconProps, CloseIcon, Collapse, type CollapseProps, type Column, CopyIcon, DataGrid, type DataGridProps, DateField, type DateFieldProps, type DateFormatString, DateRangeField, type DateRangeFieldProps, type DateRangeValue, DifficultyAllIcon, DifficultyEasyIcon, DifficultyHardIcon, DifficultyMediumIcon, Divider, type DividerProps, DollarIcon, DownloadIcon, DownloadPdfIcon, Drawer, type DrawerProps, EditChatIcon, EditIcon, EngagementIcon, Fade, type FadeProps, FunctionIcon, Grid, type GridProps, Grow, type GrowProps, HelpOutlinedIcon, HierarchyIcon, IconButton, type IconButtonProps, ImageField, type ImageFieldProps, InactiveGroupIcon, IndustryIcon, InvoiceIcon, Link, type LinkProps, List, ListItem, ListItemButton, type ListItemButtonProps, ListItemIcon, type ListItemIconProps, type ListItemProps, ListItemText, type ListItemTextProps, type ListProps, ListSubheader, type ListSubheaderProps, LocationPinIcon, LogsIcon, Menu, MenuDivider, MenuItem, type MenuItemProps, MenuList, type MenuListProps, type MenuProps, MinExperienceIcon, NineDotMenuIcon, NotificationIcon, Paper, type PaperProps, PhoneField, type PhoneFieldProps, Popover, type PopoverProps, Popper, type PopperProps, ProjectIcon, QualificationsIcon, QuestionStatusAllIcon, QuestionStatusPrivateIcon, QuestionStatusPublicIcon, QuestionTypeAllIcon, QuestionTypeCodingIcon, QuestionTypeDescriptiveIcon, QuestionTypeMultipleIcon, QuestionTypeSingleIcon, Radio, RadioGroup, type RadioGroupProps, type RadioProps, Rating, type RatingProps, RefreshIcon, ResendInviteIcon, RolesIcon, RufousAiIcon, RufousBirdIcon, RufousLauncherIcon, RufousLogoLoader, type RufousLogoLoaderProps, RufousTextContent, type RufousTextContentProps, RufousTextEditor, type MentionItemData as RufousTextEditorMentionItem, type RufousTextEditorProps, RufousThemeProvider, Select, type SelectProps, SidebarIcon, Skeleton, type SkeletonProps, Slide, type SlideProps, Slider, type SliderProps, Snackbar, type SnackbarProps, SoftSkillsIcon, type SortDirection, Stack, type StackProps, StandardButton, Step, StepButton, type StepButtonProps, StepContent, type StepContentProps, StepLabel, type StepLabelProps, type StepProps, Stepper, type StepperProps, SubmitButton, SubscribeIcon, SuspendUserIcon, Switch, type SwitchProps, type SxProp, Tab, TabPanel, type TabPanelProps, type TabProps, Tabs, type TabsProps, TechnicalSkillsIcon, TextField, type TextFieldProps, TickIcon, TimerIcon, ToggleButton, ToggleButtonGroup, type ToggleButtonGroupProps, type ToggleButtonProps, Tooltip, type TooltipProps, TrashIcon, Typography, type TypographyProps, UnArchivedIcon, UnsubscribeIcon, UploadIcon, UserAssignIcon, ViewIcon, WorkItemIcon, Zoom, type ZoomProps, transformLegacyTodos, useRufousTheme };
|
|
1729
|
+
export { APP_THEMES, Accordion, AccordionDetails, type AccordionDetailsProps, type AccordionProps, AccordionSummary, type AccordionSummaryProps, type Action, ActivateUserIcon, AddButton, AddressLookup, ArchivedIcon, AssignGroupIcon, Autocomplete, type AutocompleteProps, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, BaseDialog, Box, type BoxProps, Breadcrumbs, type BreadcrumbsProps, Button, type ButtonProps, CameraIcon, CancelButton, Card, CardActions, type CardActionsProps, CardContent, type CardContentProps, CardHeader, type CardHeaderProps, CardMedia, type CardMediaProps, type CardProps, Checkbox, type CheckboxProps, Chip, type ChipProps, CircularProgress, CircularProgressIcon, type CircularProgressIconProps, CloseIcon, Collapse, type CollapseProps, type Column, CopyIcon, DataGrid, type DataGridProps, DateField, type DateFieldProps, type DateFormatString, DateRangeField, type DateRangeFieldProps, type DateRangeValue, DifficultyAllIcon, DifficultyEasyIcon, DifficultyHardIcon, DifficultyMediumIcon, Divider, type DividerProps, DollarIcon, DownloadIcon, DownloadPdfIcon, Drawer, type DrawerProps, EditChatIcon, EditIcon, EngagementIcon, Fade, type FadeProps, FunctionIcon, Grid, type GridProps, Grow, type GrowProps, HelpOutlinedIcon, HierarchyIcon, IconButton, type IconButtonProps, ImageField, type ImageFieldProps, InactiveGroupIcon, IndustryIcon, InvoiceIcon, Link, type LinkProps, List, ListItem, ListItemButton, type ListItemButtonProps, ListItemIcon, type ListItemIconProps, type ListItemProps, ListItemText, type ListItemTextProps, type ListProps, ListSubheader, type ListSubheaderProps, LocationPinIcon, LogsIcon, Menu, MenuDivider, MenuItem, type MenuItemProps, MenuList, type MenuListProps, type MenuProps, MinExperienceIcon, NineDotMenuIcon, NotificationIcon, type NumberVariant, Paper, type PaperProps, PhoneField, type PhoneFieldProps, Popover, type PopoverProps, Popper, type PopperProps, ProjectIcon, QualificationsIcon, QuestionStatusAllIcon, QuestionStatusPrivateIcon, QuestionStatusPublicIcon, QuestionTypeAllIcon, QuestionTypeCodingIcon, QuestionTypeDescriptiveIcon, QuestionTypeMultipleIcon, QuestionTypeSingleIcon, Radio, RadioGroup, type RadioGroupProps, type RadioProps, Rating, type RatingProps, RefreshIcon, ResendInviteIcon, RolesIcon, RufousAiIcon, RufousBirdIcon, RufousLauncherIcon, RufousLogoLoader, type RufousLogoLoaderProps, RufousTextContent, type RufousTextContentProps, RufousTextEditor, type MentionItemData as RufousTextEditorMentionItem, type RufousTextEditorProps, RufousThemeProvider, Select, type SelectProps, SidebarIcon, Skeleton, type SkeletonProps, Slide, type SlideProps, Slider, type SliderProps, Snackbar, type SnackbarProps, SoftSkillsIcon, type SortDirection, Stack, type StackProps, StandardButton, Step, StepButton, type StepButtonProps, StepContent, type StepContentProps, StepLabel, type StepLabelProps, type StepProps, Stepper, type StepperProps, SubmitButton, SubscribeIcon, SuspendUserIcon, Switch, type SwitchProps, type SxProp, Tab, TabPanel, type TabPanelProps, type TabProps, Tabs, type TabsProps, TechnicalSkillsIcon, TextField, type TextFieldProps, TickIcon, TimerIcon, ToggleButton, ToggleButtonGroup, type ToggleButtonGroupProps, type ToggleButtonProps, Tooltip, type TooltipProps, TrashIcon, Typography, type TypographyProps, UnArchivedIcon, UnsubscribeIcon, UploadIcon, UserAssignIcon, ViewIcon, WorkItemIcon, Zoom, type ZoomProps, transformLegacyTodos, useRufousTheme };
|
package/dist/main.js
CHANGED
|
@@ -1574,6 +1574,25 @@ var Checkbox = ({
|
|
|
1574
1574
|
|
|
1575
1575
|
// lib/TextFields/TextField.tsx
|
|
1576
1576
|
import React68, { forwardRef as forwardRef3 } from "react";
|
|
1577
|
+
var NUMBER_BLOCKED_KEYS = ["e", "E", "+", "-"];
|
|
1578
|
+
var BLOCKED_KEYS_BY_VARIANT = {
|
|
1579
|
+
"integer": [...NUMBER_BLOCKED_KEYS, ".", ","],
|
|
1580
|
+
"decimal": [...NUMBER_BLOCKED_KEYS],
|
|
1581
|
+
"positive-integer": [...NUMBER_BLOCKED_KEYS, ".", ","],
|
|
1582
|
+
"positive-decimal": [...NUMBER_BLOCKED_KEYS]
|
|
1583
|
+
};
|
|
1584
|
+
var STEP_BY_VARIANT = {
|
|
1585
|
+
"integer": 1,
|
|
1586
|
+
"decimal": 0.1,
|
|
1587
|
+
"positive-integer": 1,
|
|
1588
|
+
"positive-decimal": 0.1
|
|
1589
|
+
};
|
|
1590
|
+
var MIN_BY_VARIANT = {
|
|
1591
|
+
"integer": void 0,
|
|
1592
|
+
"decimal": void 0,
|
|
1593
|
+
"positive-integer": 0,
|
|
1594
|
+
"positive-decimal": 0
|
|
1595
|
+
};
|
|
1577
1596
|
var TextField = forwardRef3(({
|
|
1578
1597
|
label,
|
|
1579
1598
|
name,
|
|
@@ -1595,6 +1614,7 @@ var TextField = forwardRef3(({
|
|
|
1595
1614
|
fullWidth = false,
|
|
1596
1615
|
slotProps,
|
|
1597
1616
|
InputProps,
|
|
1617
|
+
numberVariant,
|
|
1598
1618
|
...props
|
|
1599
1619
|
}, ref) => {
|
|
1600
1620
|
const sxClass = useSx(sx);
|
|
@@ -1650,6 +1670,11 @@ var TextField = forwardRef3(({
|
|
|
1650
1670
|
};
|
|
1651
1671
|
const handleKeyDown = (e) => {
|
|
1652
1672
|
if (type === "number") {
|
|
1673
|
+
const blockedKeys = numberVariant ? BLOCKED_KEYS_BY_VARIANT[numberVariant] : NUMBER_BLOCKED_KEYS;
|
|
1674
|
+
if (blockedKeys.includes(e.key)) {
|
|
1675
|
+
e.preventDefault();
|
|
1676
|
+
return;
|
|
1677
|
+
}
|
|
1653
1678
|
if (e.key === "ArrowUp") {
|
|
1654
1679
|
e.preventDefault();
|
|
1655
1680
|
if (internalRef.current) {
|
|
@@ -1683,6 +1708,8 @@ var TextField = forwardRef3(({
|
|
|
1683
1708
|
required,
|
|
1684
1709
|
disabled,
|
|
1685
1710
|
readOnly,
|
|
1711
|
+
step: type === "number" && numberVariant ? STEP_BY_VARIANT[numberVariant] : void 0,
|
|
1712
|
+
min: type === "number" && numberVariant ? MIN_BY_VARIANT[numberVariant] : void 0,
|
|
1686
1713
|
...slotProps?.input,
|
|
1687
1714
|
...props
|
|
1688
1715
|
}
|
|
@@ -3852,7 +3879,9 @@ var getOperatorsForType = (type) => {
|
|
|
3852
3879
|
];
|
|
3853
3880
|
return [
|
|
3854
3881
|
{ value: "contains", label: "contains" },
|
|
3882
|
+
{ value: "does not contain", label: "does not contain" },
|
|
3855
3883
|
{ value: "equals", label: "equals" },
|
|
3884
|
+
{ value: "is not equal to", label: "is not equal to" },
|
|
3856
3885
|
{ value: "starts with", label: "starts with" },
|
|
3857
3886
|
{ value: "ends with", label: "ends with" },
|
|
3858
3887
|
{ value: "is empty", label: "is empty" },
|
|
@@ -4072,8 +4101,12 @@ function DataGrid({
|
|
|
4072
4101
|
switch (f.operator) {
|
|
4073
4102
|
case "contains":
|
|
4074
4103
|
return itemVal.includes(val);
|
|
4104
|
+
case "does not contain":
|
|
4105
|
+
return !itemVal.includes(val);
|
|
4075
4106
|
case "equals":
|
|
4076
4107
|
return itemVal === val;
|
|
4108
|
+
case "is not equal to":
|
|
4109
|
+
return itemVal !== val;
|
|
4077
4110
|
case "starts with":
|
|
4078
4111
|
return itemVal.startsWith(val);
|
|
4079
4112
|
case "ends with":
|
|
@@ -4119,10 +4152,14 @@ function DataGrid({
|
|
|
4119
4152
|
return sortedData.slice(start, start + pageSize);
|
|
4120
4153
|
}, [sortedData, currentPage, pageSize]);
|
|
4121
4154
|
const handleExport = () => {
|
|
4122
|
-
const
|
|
4123
|
-
const headers =
|
|
4155
|
+
const exportableCols = resolvedColumns.filter((c) => !c.hidden && c.isExportable !== false);
|
|
4156
|
+
const headers = exportableCols.map((c) => c.headerName).join(",");
|
|
4124
4157
|
const rows = sortedData.map(
|
|
4125
|
-
(item) =>
|
|
4158
|
+
(item) => exportableCols.map((c) => {
|
|
4159
|
+
const raw = item[c.field];
|
|
4160
|
+
const val = raw === null || raw === void 0 ? "" : String(raw).replace(/"/g, '""');
|
|
4161
|
+
return `"${val}"`;
|
|
4162
|
+
}).join(",")
|
|
4126
4163
|
);
|
|
4127
4164
|
const csv = [headers, ...rows].join("\n");
|
|
4128
4165
|
const blob = new Blob([csv], { type: "text/csv;charset=utf-8;" });
|