@codezee/sixtify-brahma 0.2.175 → 0.2.177

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 (64) hide show
  1. package/package.json +2 -1
  2. package/packages/shared-components/dist/FormFields/Autocomplete/Autocomplete.d.ts +6 -1
  3. package/packages/shared-components/dist/FormFields/Autocomplete/Autocomplete.d.ts.map +1 -1
  4. package/packages/shared-components/dist/FormFields/Autocomplete/Autocomplete.js +146 -11
  5. package/packages/shared-components/dist/FormFields/CheckBox/CheckBox.d.ts +3 -1
  6. package/packages/shared-components/dist/FormFields/CheckBox/CheckBox.d.ts.map +1 -1
  7. package/packages/shared-components/dist/FormFields/CheckBox/CheckBox.js +23 -6
  8. package/packages/shared-components/dist/FormFields/DatePicker/DatePicker.d.ts +3 -1
  9. package/packages/shared-components/dist/FormFields/DatePicker/DatePicker.d.ts.map +1 -1
  10. package/packages/shared-components/dist/FormFields/DatePicker/DatePicker.js +14 -5
  11. package/packages/shared-components/dist/FormFields/DateTimePicker/DateTimePicker.d.ts +3 -1
  12. package/packages/shared-components/dist/FormFields/DateTimePicker/DateTimePicker.d.ts.map +1 -1
  13. package/packages/shared-components/dist/FormFields/DateTimePicker/DateTimePicker.js +14 -5
  14. package/packages/shared-components/dist/FormFields/DecimalTextField/DecimalTextField.d.ts +18 -0
  15. package/packages/shared-components/dist/FormFields/DecimalTextField/DecimalTextField.d.ts.map +1 -0
  16. package/packages/shared-components/dist/FormFields/DecimalTextField/DecimalTextField.js +227 -0
  17. package/packages/shared-components/dist/FormFields/DecimalTextField/index.d.ts +2 -0
  18. package/packages/shared-components/dist/FormFields/DecimalTextField/index.d.ts.map +1 -0
  19. package/packages/shared-components/dist/FormFields/DecimalTextField/index.js +17 -0
  20. package/packages/shared-components/dist/FormFields/FileUpload/FileUpload.js +1 -1
  21. package/packages/shared-components/dist/FormFields/ImageUpload/ImageUpload.d.ts.map +1 -1
  22. package/packages/shared-components/dist/FormFields/ImageUpload/ImageUpload.js +3 -1
  23. package/packages/shared-components/dist/FormFields/PhoneInputField/PhoneInputField.d.ts +3 -1
  24. package/packages/shared-components/dist/FormFields/PhoneInputField/PhoneInputField.d.ts.map +1 -1
  25. package/packages/shared-components/dist/FormFields/PhoneInputField/PhoneInputField.js +7 -3
  26. package/packages/shared-components/dist/FormFields/RadioGroupField/RadioGroupField.d.ts +3 -1
  27. package/packages/shared-components/dist/FormFields/RadioGroupField/RadioGroupField.d.ts.map +1 -1
  28. package/packages/shared-components/dist/FormFields/RadioGroupField/RadioGroupField.js +34 -14
  29. package/packages/shared-components/dist/FormFields/Rating/Ratting.js +1 -1
  30. package/packages/shared-components/dist/FormFields/Select/Select.d.ts +3 -1
  31. package/packages/shared-components/dist/FormFields/Select/Select.d.ts.map +1 -1
  32. package/packages/shared-components/dist/FormFields/Select/Select.js +12 -6
  33. package/packages/shared-components/dist/FormFields/SwitchField/SwitchField.d.ts +3 -1
  34. package/packages/shared-components/dist/FormFields/SwitchField/SwitchField.d.ts.map +1 -1
  35. package/packages/shared-components/dist/FormFields/SwitchField/SwitchField.js +10 -4
  36. package/packages/shared-components/dist/FormFields/TextField/TextField.d.ts +3 -1
  37. package/packages/shared-components/dist/FormFields/TextField/TextField.d.ts.map +1 -1
  38. package/packages/shared-components/dist/FormFields/TextField/TextField.js +7 -6
  39. package/packages/shared-components/dist/FormFields/TimeField/TimeField.d.ts +3 -1
  40. package/packages/shared-components/dist/FormFields/TimeField/TimeField.d.ts.map +1 -1
  41. package/packages/shared-components/dist/FormFields/TimeField/TimeField.js +6 -3
  42. package/packages/shared-components/dist/FormFields/TimePicker/TimePicker.d.ts +3 -1
  43. package/packages/shared-components/dist/FormFields/TimePicker/TimePicker.d.ts.map +1 -1
  44. package/packages/shared-components/dist/FormFields/TimePicker/TimePicker.js +51 -3
  45. package/packages/shared-components/dist/FormFields/index.d.ts +1 -0
  46. package/packages/shared-components/dist/FormFields/index.d.ts.map +1 -1
  47. package/packages/shared-components/dist/FormFields/index.js +1 -0
  48. package/packages/shared-components/dist/RichTextEditor/RichTextEditor.d.ts +1 -1
  49. package/packages/shared-components/dist/SmartGrid/Components/TableRowComponent.js +2 -2
  50. package/packages/shared-components/dist/utils/context/NavigationKeyContext.d.ts +13 -0
  51. package/packages/shared-components/dist/utils/context/NavigationKeyContext.d.ts.map +1 -0
  52. package/packages/shared-components/dist/utils/context/NavigationKeyContext.js +15 -0
  53. package/packages/shared-components/dist/utils/context/index.d.ts +2 -0
  54. package/packages/shared-components/dist/utils/context/index.d.ts.map +1 -0
  55. package/packages/shared-components/dist/utils/context/index.js +6 -0
  56. package/packages/shared-components/dist/utils/hooks/useFormFieldFocus.d.ts +8 -1
  57. package/packages/shared-components/dist/utils/hooks/useFormFieldFocus.d.ts.map +1 -1
  58. package/packages/shared-components/dist/utils/hooks/useFormFieldFocus.js +94 -2
  59. package/packages/shared-components/dist/utils/index.d.ts +3 -2
  60. package/packages/shared-components/dist/utils/index.d.ts.map +1 -1
  61. package/packages/shared-components/dist/utils/index.js +3 -2
  62. package/packages/shared-components/dist/utils/regex.d.ts +1 -0
  63. package/packages/shared-components/dist/utils/regex.d.ts.map +1 -1
  64. package/packages/shared-components/dist/utils/regex.js +2 -1
@@ -6,7 +6,7 @@ const material_1 = require("@mui/material");
6
6
  const react_hook_form_1 = require("react-hook-form");
7
7
  const icons_material_1 = require("@mui/icons-material");
8
8
  const Tooltip_1 = require("../../Tooltip");
9
- const hooks_1 = require("../../utils/hooks");
9
+ const useFormFieldFocus_1 = require("../../utils/hooks/useFormFieldFocus");
10
10
  const commonStyles_1 = require("../commonStyles");
11
11
  const Skeleton_1 = require("./Skeleton");
12
12
  const characterTypeMessages = {
@@ -20,13 +20,14 @@ const characterTypeMessages = {
20
20
  function TextField({ control, name, defaultValue, label = "", rules, type, required, disabled, loading = false, placeholder = "", isCapitalize = false, isTrimStartDisabled = false, rows, characterType = "string-number-special", letterCase = "mixed", setError, containerProps, styling = "custom", infoMessage, regexExpression = {
21
21
  message: null,
22
22
  regex: /^[\s\S]*$/,
23
- }, customOnChange, multiline, ...inputFieldProps }) {
23
+ }, navigationKey = "tab", customOnChange, ...inputFieldProps }) {
24
24
  const { field: { value, onChange, ...restField }, fieldState: { error }, } = (0, react_hook_form_1.useController)({ name, control, defaultValue, rules });
25
- const { inputRef, maintainFocus } = (0, hooks_1.useFormFieldFocus)();
25
+ const { inputRef, maintainFocus, handleKeyDown: handleNavigationKeyDown, } = (0, useFormFieldFocus_1.useFormFieldFocus)({ navigationKey });
26
26
  const handleKeyDown = (event) => {
27
27
  if (event.key === "-" && type === "number") {
28
28
  event.preventDefault();
29
29
  }
30
+ handleNavigationKeyDown(event, undefined, false);
30
31
  };
31
32
  const getCharacterRegex = (type) => {
32
33
  switch (type) {
@@ -68,9 +69,9 @@ function TextField({ control, name, defaultValue, label = "", rules, type, requi
68
69
  ? characterTypeMessages[characterType]
69
70
  : message;
70
71
  if (loading) {
71
- return ((0, jsx_runtime_1.jsx)(Skeleton_1.Skeleton, { label: label, rows: multiline && !rows ? 2 : rows, styling: styling }));
72
+ return (0, jsx_runtime_1.jsx)(Skeleton_1.Skeleton, { label: label, rows: rows, styling: styling });
72
73
  }
73
- return ((0, jsx_runtime_1.jsxs)(material_1.Stack, { ...containerProps, gap: "5px", children: [label && styling === "custom" && ((0, jsx_runtime_1.jsxs)(material_1.Stack, { direction: "row", children: [(0, jsx_runtime_1.jsx)(material_1.InputLabel, { required: required, disabled: disabled, children: label }), infoMessage && ((0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { toolTipLabel: infoMessage, children: (0, jsx_runtime_1.jsx)(icons_material_1.InfoOutlined, { sx: {
74
+ return ((0, jsx_runtime_1.jsxs)(material_1.Stack, { ...containerProps, gap: "5px", children: [label && styling === "custom" && ((0, jsx_runtime_1.jsxs)(material_1.Stack, { direction: "row", children: [(0, jsx_runtime_1.jsx)(material_1.InputLabel, { sx: { fontSize: { xs: "14px", md: "16px" } }, required: required, disabled: disabled, children: label }), infoMessage && ((0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { toolTipLabel: infoMessage, children: (0, jsx_runtime_1.jsx)(icons_material_1.InfoOutlined, { sx: {
74
75
  fontSize: 13,
75
76
  } }) }))] })), (0, jsx_runtime_1.jsx)(material_1.TextField, { disabled: disabled, required: required, fullWidth: true, inputRef: inputRef, onKeyDown: handleKeyDown, placeholder: styling === "default" ? placeholder : placeholder || label, type: type, label: styling === "default" ? label : undefined, sx: (0, commonStyles_1.getDefaultTextFieldSx)(styling), InputLabelProps: (0, commonStyles_1.getDefaultInputLabelProps)(styling), inputProps: {
76
77
  min: 0,
@@ -108,5 +109,5 @@ function TextField({ control, name, defaultValue, label = "", rules, type, requi
108
109
  }
109
110
  maintainFocus();
110
111
  });
111
- }, value: typeof value === "string" ? value.trimStart() : (value ?? ""), multiline: multiline, ...restField, ...inputFieldProps })] }));
112
+ }, value: typeof value === "string" ? value.trimStart() : (value ?? ""), ...restField, ...inputFieldProps })] }));
112
113
  }
@@ -1,6 +1,7 @@
1
1
  import type { PickerValidDate } from "@mui/x-date-pickers/models";
2
2
  import { type TimeFieldProps as MuiTimeFieldProps } from "@mui/x-date-pickers/TimeField";
3
3
  import type { FieldValues, UseControllerProps } from "react-hook-form";
4
+ import { type NavigationKey } from "../../utils/hooks/useFormFieldFocus";
4
5
  export type TimeFieldProps<P extends FieldValues> = UseControllerProps<P> & MuiTimeFieldProps<PickerValidDate> & Partial<{
5
6
  label: string;
6
7
  required: boolean;
@@ -12,6 +13,7 @@ export type TimeFieldProps<P extends FieldValues> = UseControllerProps<P> & MuiT
12
13
  isReturnLocalTime: boolean;
13
14
  isReturnDateWithTime: boolean;
14
15
  styling?: "custom" | "default";
16
+ navigationKey?: NavigationKey;
15
17
  }>;
16
- export declare function TimeField<P extends FieldValues>({ control, defaultValue, disabled, label, name, error, helperText, loading, required, rules, format, isReturnLocalTime, isReturnDateWithTime, styling, ...restProps }: TimeFieldProps<P>): import("react/jsx-runtime").JSX.Element;
18
+ export declare function TimeField<P extends FieldValues>({ control, defaultValue, disabled, label, name, error, helperText, loading, required, rules, format, isReturnLocalTime, isReturnDateWithTime, styling, navigationKey, ...restProps }: TimeFieldProps<P>): import("react/jsx-runtime").JSX.Element;
17
19
  //# sourceMappingURL=TimeField.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TimeField.d.ts","sourceRoot":"","sources":["../../../src/FormFields/TimeField/TimeField.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAEL,KAAK,cAAc,IAAI,iBAAiB,EACzC,MAAM,+BAA+B,CAAC;AAEvC,OAAO,KAAK,EACV,WAAW,EAGX,kBAAkB,EACnB,MAAM,iBAAiB,CAAC;AASzB,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,WAAW,IAAI,kBAAkB,CAAC,CAAC,CAAC,GACvE,iBAAiB,CAAC,eAAe,CAAC,GAClC,OAAO,CAAC;IACN,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,EAAE,OAAO,CAAC;IAC3B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,OAAO,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;CAChC,CAAC,CAAC;AAEL,wBAAgB,SAAS,CAAC,CAAC,SAAS,WAAW,EAAE,EAC/C,OAAO,EACP,YAAY,EACZ,QAAgB,EAChB,KAAK,EACL,IAAI,EACJ,KAAK,EACL,UAAU,EACV,OAAe,EACf,QAAgB,EAChB,KAAK,EACL,MAAgB,EAChB,iBAAyB,EACzB,oBAA4B,EAC5B,OAAkB,EAClB,GAAG,SAAS,EACb,EAAE,cAAc,CAAC,CAAC,CAAC,2CAyFnB"}
1
+ {"version":3,"file":"TimeField.d.ts","sourceRoot":"","sources":["../../../src/FormFields/TimeField/TimeField.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAEL,KAAK,cAAc,IAAI,iBAAiB,EACzC,MAAM,+BAA+B,CAAC;AAEvC,OAAO,KAAK,EACV,WAAW,EAGX,kBAAkB,EACnB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAEL,KAAK,aAAa,EACnB,MAAM,qCAAqC,CAAC;AAO7C,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,WAAW,IAAI,kBAAkB,CAAC,CAAC,CAAC,GACvE,iBAAiB,CAAC,eAAe,CAAC,GAClC,OAAO,CAAC;IACN,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,EAAE,OAAO,CAAC;IAC3B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,OAAO,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC/B,aAAa,CAAC,EAAE,aAAa,CAAC;CAC/B,CAAC,CAAC;AAEL,wBAAgB,SAAS,CAAC,CAAC,SAAS,WAAW,EAAE,EAC/C,OAAO,EACP,YAAY,EACZ,QAAgB,EAChB,KAAK,EACL,IAAI,EACJ,KAAK,EACL,UAAU,EACV,OAAe,EACf,QAAgB,EAChB,KAAK,EACL,MAAgB,EAChB,iBAAyB,EACzB,oBAA4B,EAC5B,OAAkB,EAClB,aAAqB,EACrB,GAAG,SAAS,EACb,EAAE,cAAc,CAAC,CAAC,CAAC,2CAgGnB"}
@@ -6,12 +6,12 @@ const material_1 = require("@mui/material");
6
6
  const TimeField_1 = require("@mui/x-date-pickers/TimeField");
7
7
  const luxon_1 = require("luxon");
8
8
  const react_hook_form_1 = require("react-hook-form");
9
- const hooks_1 = require("../../utils/hooks");
9
+ const useFormFieldFocus_1 = require("../../utils/hooks/useFormFieldFocus");
10
10
  const commonStyles_1 = require("../commonStyles");
11
11
  const Skeleton_1 = require("./Skeleton");
12
- function TimeField({ control, defaultValue, disabled = false, label, name, error, helperText, loading = false, required = false, rules, format = "HH:mm", isReturnLocalTime = false, isReturnDateWithTime = false, styling = "custom", ...restProps }) {
12
+ function TimeField({ control, defaultValue, disabled = false, label, name, error, helperText, loading = false, required = false, rules, format = "HH:mm", isReturnLocalTime = false, isReturnDateWithTime = false, styling = "custom", navigationKey = "tab", ...restProps }) {
13
13
  const { field: { value, onChange, ...restField }, } = (0, react_hook_form_1.useController)({ name, control, defaultValue, rules });
14
- const { inputRef, maintainFocus } = (0, hooks_1.useFormFieldFocus)();
14
+ const { inputRef, maintainFocus, handleKeyDown: handleNavigationKeyDown, } = (0, useFormFieldFocus_1.useFormFieldFocus)({ navigationKey });
15
15
  const theme = (0, material_1.useTheme)();
16
16
  const { butterflyBlue } = theme.palette.app.color;
17
17
  if (error && value && typeof value === "object") {
@@ -51,6 +51,9 @@ function TimeField({ control, defaultValue, disabled = false, label, name, error
51
51
  required: styling === "default" ? required : undefined,
52
52
  inputRef,
53
53
  InputLabelProps: (0, commonStyles_1.getDefaultInputLabelProps)(styling),
54
+ onKeyDown: (event) => {
55
+ handleNavigationKeyDown(event, undefined, false);
56
+ },
54
57
  sx: {
55
58
  ...(0, commonStyles_1.getDefaultTextFieldSx)(styling),
56
59
  backgroundColor: "white",
@@ -3,6 +3,7 @@ import type { TimePickerProps as MuiTimePickerProps } from "@mui/x-date-pickers/
3
3
  import type { PickerValidDate } from "@mui/x-date-pickers/models";
4
4
  import { type ReactElement } from "react";
5
5
  import type { FieldValues, UseControllerProps } from "react-hook-form";
6
+ import { type NavigationKey } from "../../utils/hooks/useFormFieldFocus";
6
7
  export type TimePickerProps<P extends FieldValues> = UseControllerProps<P> & MuiTimePickerProps<PickerValidDate> & Partial<{
7
8
  label: string;
8
9
  required: boolean;
@@ -18,6 +19,7 @@ export type TimePickerProps<P extends FieldValues> = UseControllerProps<P> & Mui
18
19
  timeStepsMinutes?: number;
19
20
  containerProps?: StackProps;
20
21
  styling?: "custom" | "default";
22
+ navigationKey?: NavigationKey;
21
23
  }>;
22
- export declare function TimePicker<P extends FieldValues>({ control, defaultValue, disabled, label, readOnly, name, error, helperText, loading, required, rules, format, isReturnLocalTime, isReturnDateWithTime, timeStepsMinutes, helperIcon, toolTipText, containerProps, styling, ...restProps }: TimePickerProps<P>): import("react/jsx-runtime").JSX.Element;
24
+ export declare function TimePicker<P extends FieldValues>({ control, defaultValue, disabled, label, readOnly, name, error, helperText, loading, required, rules, format, isReturnLocalTime, isReturnDateWithTime, timeStepsMinutes, helperIcon, toolTipText, containerProps, styling, navigationKey, ...restProps }: TimePickerProps<P>): import("react/jsx-runtime").JSX.Element;
23
25
  //# sourceMappingURL=TimePicker.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TimePicker.d.ts","sourceRoot":"","sources":["../../../src/FormFields/TimePicker/TimePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,OAAO,KAAK,EAAE,eAAe,IAAI,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAE5F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElE,OAAO,EAAE,KAAK,YAAY,EAAY,MAAM,OAAO,CAAC;AACpD,OAAO,KAAK,EACV,WAAW,EAGX,kBAAkB,EACnB,MAAM,iBAAiB,CAAC;AASzB,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,WAAW,IAAI,kBAAkB,CAAC,CAAC,CAAC,GACxE,kBAAkB,CAAC,eAAe,CAAC,GACnC,OAAO,CAAC;IACN,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,UAAU,CAAC,EAAE,YAAY,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,cAAc,CAAC,EAAE,UAAU,CAAC;IAC5B,OAAO,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;CAChC,CAAC,CAAC;AAEL,wBAAgB,UAAU,CAAC,CAAC,SAAS,WAAW,EAAE,EAChD,OAAO,EACP,YAAY,EACZ,QAAgB,EAChB,KAAK,EACL,QAAgB,EAChB,IAAI,EACJ,KAAa,EACb,UAAU,EACV,OAAe,EACf,QAAgB,EAChB,KAAK,EACL,MAAgB,EAChB,iBAAyB,EACzB,oBAA4B,EAC5B,gBAAoB,EACpB,UAAU,EACV,WAAW,EACX,cAAc,EACd,OAAkB,EAClB,GAAG,SAAS,EACb,EAAE,eAAe,CAAC,CAAC,CAAC,2CA2IpB"}
1
+ {"version":3,"file":"TimePicker.d.ts","sourceRoot":"","sources":["../../../src/FormFields/TimePicker/TimePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,OAAO,KAAK,EAAE,eAAe,IAAI,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAE5F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElE,OAAO,EAAY,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,KAAK,EACV,WAAW,EAGX,kBAAkB,EACnB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAEL,KAAK,aAAa,EACnB,MAAM,qCAAqC,CAAC;AAO7C,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,WAAW,IAAI,kBAAkB,CAAC,CAAC,CAAC,GACxE,kBAAkB,CAAC,eAAe,CAAC,GACnC,OAAO,CAAC;IACN,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,UAAU,CAAC,EAAE,YAAY,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,cAAc,CAAC,EAAE,UAAU,CAAC;IAC5B,OAAO,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC/B,aAAa,CAAC,EAAE,aAAa,CAAC;CAC/B,CAAC,CAAC;AAEL,wBAAgB,UAAU,CAAC,CAAC,SAAS,WAAW,EAAE,EAChD,OAAO,EACP,YAAY,EACZ,QAAgB,EAChB,KAAK,EACL,QAAgB,EAChB,IAAI,EACJ,KAAa,EACb,UAAU,EACV,OAAe,EACf,QAAgB,EAChB,KAAK,EACL,MAAgB,EAChB,iBAAyB,EACzB,oBAA4B,EAC5B,gBAAoB,EACpB,UAAU,EACV,WAAW,EACX,cAAc,EACd,OAAkB,EAClB,aAAqB,EACrB,GAAG,SAAS,EACb,EAAE,eAAe,CAAC,CAAC,CAAC,2CAwMpB"}
@@ -7,13 +7,13 @@ const TimePicker_1 = require("@mui/x-date-pickers/TimePicker");
7
7
  const luxon_1 = require("luxon");
8
8
  const react_1 = require("react");
9
9
  const react_hook_form_1 = require("react-hook-form");
10
- const hooks_1 = require("../../utils/hooks");
10
+ const useFormFieldFocus_1 = require("../../utils/hooks/useFormFieldFocus");
11
11
  const commonStyles_1 = require("../commonStyles");
12
12
  const Skeleton_1 = require("./Skeleton");
13
- function TimePicker({ control, defaultValue, disabled = false, label, readOnly = false, name, error = false, helperText, loading = false, required = false, rules, format = "HH:mm", isReturnLocalTime = false, isReturnDateWithTime = false, timeStepsMinutes = 1, helperIcon, toolTipText, containerProps, styling = "custom", ...restProps }) {
13
+ function TimePicker({ control, defaultValue, disabled = false, label, readOnly = false, name, error = false, helperText, loading = false, required = false, rules, format = "HH:mm", isReturnLocalTime = false, isReturnDateWithTime = false, timeStepsMinutes = 1, helperIcon, toolTipText, containerProps, styling = "custom", navigationKey = "tab", ...restProps }) {
14
14
  const { field: { value, onChange, ...restField }, } = (0, react_hook_form_1.useController)({ name, control, defaultValue, rules });
15
15
  const [open, setOpen] = (0, react_1.useState)(false);
16
- const { setInputRef, maintainFocus, maintainFocusAfterClose, handleKeyDown } = (0, hooks_1.useFormFieldFocus)(open);
16
+ const { setInputRef, maintainFocus, maintainFocusAfterClose, handleKeyDown, handleEnterNavigation, } = (0, useFormFieldFocus_1.useFormFieldFocus)({ isOpen: open, navigationKey });
17
17
  if (error && value && typeof value === "object") {
18
18
  helperText = "Invalid time";
19
19
  }
@@ -46,9 +46,46 @@ function TimePicker({ control, defaultValue, disabled = false, label, readOnly =
46
46
  },
47
47
  },
48
48
  onKeyDown: (event) => {
49
+ if (navigationKey === "enter") {
50
+ if (event.key === " " && !open && !disabled && !readOnly) {
51
+ event.preventDefault();
52
+ event.stopPropagation();
53
+ setOpen(true);
54
+ return;
55
+ }
56
+ if (event.key === "Enter" && !open) {
57
+ event.preventDefault();
58
+ event.stopPropagation();
59
+ handleEnterNavigation(event);
60
+ return;
61
+ }
62
+ if (event.key === "Enter" && open) {
63
+ event.preventDefault();
64
+ event.stopPropagation();
65
+ setOpen(false);
66
+ maintainFocusAfterClose();
67
+ requestAnimationFrame(() => {
68
+ handleEnterNavigation(event);
69
+ });
70
+ return;
71
+ }
72
+ }
49
73
  handleKeyDown(event, () => setOpen(false), open);
50
74
  },
51
75
  },
76
+ openPickerButton: {
77
+ ...(navigationKey === "enter"
78
+ ? {
79
+ onKeyDown: (event) => {
80
+ if (event.key === "Enter") {
81
+ event.preventDefault();
82
+ event.stopPropagation();
83
+ handleEnterNavigation(event);
84
+ }
85
+ },
86
+ }
87
+ : {}),
88
+ },
52
89
  popper: {
53
90
  sx: {
54
91
  "& .MuiMultiSectionDigitalClockSection-root::after": {
@@ -81,6 +118,17 @@ function TimePicker({ control, defaultValue, disabled = false, label, readOnly =
81
118
  borderRadius: "5px",
82
119
  },
83
120
  },
121
+ onKeyDown: (event) => {
122
+ if (navigationKey === "enter" && event.key === "Enter" && open) {
123
+ event.preventDefault();
124
+ event.stopPropagation();
125
+ setOpen(false);
126
+ maintainFocusAfterClose();
127
+ requestAnimationFrame(() => {
128
+ handleEnterNavigation(event);
129
+ });
130
+ }
131
+ },
84
132
  },
85
133
  }, onChange: (value) => {
86
134
  if (value?.isValid) {
@@ -4,6 +4,7 @@ export * from "./DatePicker";
4
4
  export * from "./DateRangePicker";
5
5
  export * from "./DateRangeSelector";
6
6
  export * from "./DateTimePicker";
7
+ export * from "./DecimalTextField";
7
8
  export * from "./FileUpload";
8
9
  export * from "./ImageUpload";
9
10
  export * from "./ListItemButton";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/FormFields/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/FormFields/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
@@ -20,6 +20,7 @@ __exportStar(require("./DatePicker"), exports);
20
20
  __exportStar(require("./DateRangePicker"), exports);
21
21
  __exportStar(require("./DateRangeSelector"), exports);
22
22
  __exportStar(require("./DateTimePicker"), exports);
23
+ __exportStar(require("./DecimalTextField"), exports);
23
24
  __exportStar(require("./FileUpload"), exports);
24
25
  __exportStar(require("./ImageUpload"), exports);
25
26
  __exportStar(require("./ListItemButton"), exports);
@@ -15,5 +15,5 @@ export declare const RichTextEditor: import("react").ForwardRefExoticComponent<{
15
15
  children?: (editor: import("@tiptap/core").Editor | null) => React.ReactNode;
16
16
  editorDependencies?: import("react").DependencyList;
17
17
  className?: string;
18
- } & import("react").RefAttributes<RichTextEditorRef>, "content" | "ref" | "editable" | "extensions"> & import("react").RefAttributes<RichTextEditorRef>>;
18
+ } & import("react").RefAttributes<RichTextEditorRef>, "ref" | "content" | "editable" | "extensions"> & import("react").RefAttributes<RichTextEditorRef>>;
19
19
  //# sourceMappingURL=RichTextEditor.d.ts.map
@@ -65,7 +65,7 @@ const TableRowComponent = ({ columnWidths, exportActions, exportData, index, isS
65
65
  }
66
66
  }, [activePopupRowId]);
67
67
  const isPopupOpen = activePopupRowId === row.id;
68
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("tr", { ref: trRef, style: {
68
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("tr", { className: "sg-tbody-tr-row", ref: trRef, style: {
69
69
  backgroundColor: getRowBackgroundColor(),
70
70
  borderTop: `1px solid ${iron[700]}`,
71
71
  display: "flex",
@@ -110,7 +110,7 @@ const TableRowComponent = ({ columnWidths, exportActions, exportData, index, isS
110
110
  ? butterflyBlue[600]
111
111
  : getRowBackgroundColor()
112
112
  : cellBackgroundColor;
113
- return ((0, jsx_runtime_1.jsx)("td", { className: "sg-tbody-td-cell", onMouseDown: handleMouseDown, onMouseEnter: handleMouseEnter, style: {
113
+ return ((0, jsx_runtime_1.jsx)("td", { onMouseDown: handleMouseDown, onMouseEnter: handleMouseEnter, style: {
114
114
  animation: cellAnimation,
115
115
  backgroundColor: finalBackgroundColor,
116
116
  boxSizing: "border-box",
@@ -0,0 +1,13 @@
1
+ import { type ReactNode } from "react";
2
+ import type { NavigationKey } from "../hooks/useFormFieldFocus";
3
+ type NavigationKeyContextValue = {
4
+ navigationKey: NavigationKey;
5
+ };
6
+ type NavigationKeyProviderProps = {
7
+ children: ReactNode;
8
+ navigationKey?: NavigationKey;
9
+ };
10
+ export declare function NavigationKeyProvider({ children, navigationKey, }: Readonly<NavigationKeyProviderProps>): import("react/jsx-runtime").JSX.Element;
11
+ export declare function useNavigationKeyContext(): NavigationKeyContextValue;
12
+ export {};
13
+ //# sourceMappingURL=NavigationKeyContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NavigationKeyContext.d.ts","sourceRoot":"","sources":["../../../src/utils/context/NavigationKeyContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAEhE,KAAK,yBAAyB,GAAG;IAC/B,aAAa,EAAE,aAAa,CAAC;CAC9B,CAAC;AAMF,KAAK,0BAA0B,GAAG;IAChC,QAAQ,EAAE,SAAS,CAAC;IACpB,aAAa,CAAC,EAAE,aAAa,CAAC;CAC/B,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,EACpC,QAAQ,EACR,aAAqB,GACtB,EAAE,QAAQ,CAAC,0BAA0B,CAAC,2CAQtC;AAED,wBAAgB,uBAAuB,IAAI,yBAAyB,CAEnE"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NavigationKeyProvider = NavigationKeyProvider;
4
+ exports.useNavigationKeyContext = useNavigationKeyContext;
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const react_1 = require("react");
7
+ const NavigationKeyContext = (0, react_1.createContext)({
8
+ navigationKey: "tab",
9
+ });
10
+ function NavigationKeyProvider({ children, navigationKey = "tab", }) {
11
+ return ((0, jsx_runtime_1.jsx)(NavigationKeyContext.Provider, { value: (0, react_1.useMemo)(() => ({ navigationKey }), [navigationKey]), children: children }));
12
+ }
13
+ function useNavigationKeyContext() {
14
+ return (0, react_1.useContext)(NavigationKeyContext);
15
+ }
@@ -0,0 +1,2 @@
1
+ export { NavigationKeyProvider, useNavigationKeyContext, } from "./NavigationKeyContext";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/context/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,wBAAwB,CAAC"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useNavigationKeyContext = exports.NavigationKeyProvider = void 0;
4
+ var NavigationKeyContext_1 = require("./NavigationKeyContext");
5
+ Object.defineProperty(exports, "NavigationKeyProvider", { enumerable: true, get: function () { return NavigationKeyContext_1.NavigationKeyProvider; } });
6
+ Object.defineProperty(exports, "useNavigationKeyContext", { enumerable: true, get: function () { return NavigationKeyContext_1.useNavigationKeyContext; } });
@@ -1,8 +1,15 @@
1
- export declare function useFormFieldFocus(isOpen?: boolean | undefined): {
1
+ export type NavigationKey = "tab" | "enter";
2
+ type UseFormFieldFocusArgs = {
3
+ isOpen?: boolean;
4
+ navigationKey?: NavigationKey;
5
+ };
6
+ export declare function useFormFieldFocus({ isOpen, navigationKey: navigationKeyProp, }: UseFormFieldFocusArgs): {
2
7
  inputRef: import("react").MutableRefObject<HTMLInputElement | null>;
3
8
  setInputRef: (ref: HTMLDivElement | HTMLInputElement | null) => void;
4
9
  maintainFocus: () => void;
5
10
  maintainFocusAfterClose: () => void;
6
11
  handleKeyDown: <T extends HTMLElement = HTMLElement>(event: React.KeyboardEvent<T>, onClose?: () => void, isPopupOpen?: boolean) => void;
12
+ handleEnterNavigation: <T extends HTMLElement = HTMLElement>(event: React.KeyboardEvent<T>) => void;
7
13
  };
14
+ export {};
8
15
  //# sourceMappingURL=useFormFieldFocus.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useFormFieldFocus.d.ts","sourceRoot":"","sources":["../../../src/utils/hooks/useFormFieldFocus.ts"],"names":[],"mappings":"AAEA,wBAAgB,iBAAiB,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS;;uBAgHpD,cAAc,GAAG,gBAAgB,GAAG,IAAI;;;oBAhB7C,CAAC,SAAS,WAAW,uBACb,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,YACnB,MAAM,IAAI,gBACN,OAAO;EAsD1B"}
1
+ {"version":3,"file":"useFormFieldFocus.d.ts","sourceRoot":"","sources":["../../../src/utils/hooks/useFormFieldFocus.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,OAAO,CAAC;AAE5C,KAAK,qBAAqB,GAAG;IAC3B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,aAAa,CAAC;CAC/B,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,EAChC,MAAM,EACN,aAAa,EAAE,iBAAiB,GACjC,EAAE,qBAAqB;;uBAgPd,cAAc,GAAG,gBAAgB,GAAG,IAAI;;;oBAtB7C,CAAC,SAAS,WAAW,uBACb,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,YACnB,MAAM,IAAI,gBACN,OAAO;4BA5EtB,CAAC,SAAS,WAAW,uBAAuB,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;EAyItE"}
@@ -2,7 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useFormFieldFocus = useFormFieldFocus;
4
4
  const react_1 = require("react");
5
- function useFormFieldFocus(isOpen) {
5
+ const NavigationKeyContext_1 = require("../context/NavigationKeyContext");
6
+ function useFormFieldFocus({ isOpen, navigationKey: navigationKeyProp, }) {
7
+ const { navigationKey: navigationKeyFromContext } = (0, NavigationKeyContext_1.useNavigationKeyContext)();
8
+ const navigationKey = navigationKeyProp ?? navigationKeyFromContext;
6
9
  const inputRef = (0, react_1.useRef)(null);
7
10
  const shouldMaintainFocusRef = (0, react_1.useRef)(false);
8
11
  const wasFocusedRef = (0, react_1.useRef)(false);
@@ -75,14 +78,102 @@ function useFormFieldFocus(isOpen) {
75
78
  const maintainFocusAfterClose = (0, react_1.useCallback)(() => {
76
79
  shouldMaintainFocusRef.current = true;
77
80
  }, []);
81
+ const getFocusableElements = (0, react_1.useCallback)(() => {
82
+ const selector = [
83
+ "a[href]",
84
+ "button:not([disabled])",
85
+ "textarea:not([disabled])",
86
+ "input:not([disabled])",
87
+ "select:not([disabled])",
88
+ "[tabindex]:not([tabindex='-1'])",
89
+ ].join(", ");
90
+ return Array.from(document.querySelectorAll(selector)).filter((el) => {
91
+ const style = window.getComputedStyle(el);
92
+ return (style.display !== "none" &&
93
+ style.visibility !== "hidden" &&
94
+ !el.hasAttribute("disabled") &&
95
+ (el.getAttribute("tabindex") === null ||
96
+ el.getAttribute("tabindex") !== "-1"));
97
+ });
98
+ }, []);
99
+ const findActualInputElement = (0, react_1.useCallback)((element) => {
100
+ if (element.tagName === "INPUT" ||
101
+ element.tagName === "TEXTAREA" ||
102
+ element.tagName === "SELECT") {
103
+ return element;
104
+ }
105
+ const input = element.querySelector("input, textarea, select");
106
+ return input || element;
107
+ }, []);
108
+ const handleEnterNavigation = (0, react_1.useCallback)(
109
+ // eslint-disable-next-line sonarjs/cognitive-complexity
110
+ (event) => {
111
+ const target = event.target;
112
+ if (target.tagName === "TEXTAREA") {
113
+ return;
114
+ }
115
+ if (event.ctrlKey || event.metaKey || event.altKey) {
116
+ return;
117
+ }
118
+ event.preventDefault();
119
+ event.stopPropagation();
120
+ const activeElement = document.activeElement || inputRef.current || target;
121
+ if (!activeElement) {
122
+ return;
123
+ }
124
+ const focusableElements = getFocusableElements();
125
+ const findWrapperElement = (input) => {
126
+ for (const el of focusableElements) {
127
+ if (el === input || el.contains(input)) {
128
+ return el;
129
+ }
130
+ }
131
+ return null;
132
+ };
133
+ const currentWrapper = findWrapperElement(activeElement);
134
+ if (!currentWrapper) {
135
+ return;
136
+ }
137
+ const currentIndex = focusableElements.indexOf(currentWrapper);
138
+ if (currentIndex === -1) {
139
+ return;
140
+ }
141
+ let targetWrapper = null;
142
+ if (event.shiftKey) {
143
+ if (currentIndex > 0) {
144
+ targetWrapper = focusableElements[currentIndex - 1] || null;
145
+ }
146
+ }
147
+ else if (currentIndex < focusableElements.length - 1) {
148
+ targetWrapper = focusableElements[currentIndex + 1] || null;
149
+ }
150
+ if (targetWrapper) {
151
+ const targetInput = findActualInputElement(targetWrapper);
152
+ if (targetInput) {
153
+ setTimeout(() => {
154
+ targetInput.focus();
155
+ }, 0);
156
+ }
157
+ else {
158
+ targetWrapper.focus();
159
+ }
160
+ }
161
+ else {
162
+ activeElement.blur();
163
+ }
164
+ }, [getFocusableElements, findActualInputElement]);
78
165
  const handleKeyDown = (0, react_1.useCallback)((event, onClose, isPopupOpen) => {
79
166
  if (isPopupOpen && (event.key === "Tab" || event.key === "Escape")) {
80
167
  event.preventDefault();
81
168
  event.stopPropagation();
82
169
  onClose?.();
83
170
  maintainFocusAfterClose();
171
+ return;
172
+ }
173
+ if (navigationKey === "enter" && event.key === "Enter" && !isPopupOpen) {
174
+ handleEnterNavigation(event);
84
175
  }
85
- }, [maintainFocusAfterClose]);
176
+ }, [maintainFocusAfterClose, navigationKey, handleEnterNavigation]);
86
177
  const setInputRef = (0, react_1.useCallback)((ref) => {
87
178
  if (ref) {
88
179
  const wasInputFocused = document.activeElement === ref ||
@@ -115,5 +206,6 @@ function useFormFieldFocus(isOpen) {
115
206
  maintainFocus,
116
207
  maintainFocusAfterClose,
117
208
  handleKeyDown,
209
+ handleEnterNavigation,
118
210
  };
119
211
  }
@@ -1,14 +1,15 @@
1
+ export * from "./CheckboxInput";
1
2
  export * from "./colorVariant";
3
+ export * from "./context";
2
4
  export * from "./date";
3
5
  export * from "./download";
4
6
  export * from "./downloadPrintHtml";
5
7
  export * from "./file";
6
8
  export * from "./helper";
9
+ export * from "./hooks";
7
10
  export * from "./regex";
8
11
  export * from "./theme/colorPaletteUI";
9
12
  export * from "./theme/theme";
10
13
  export * from "./types";
11
14
  export * from "./urlToNestedObject";
12
- export * from "./hooks";
13
- export * from "./CheckboxInput";
14
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,wBAAwB,CAAC;AACvC,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,qBAAqB,CAAC;AACpC,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,wBAAwB,CAAC;AACvC,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,qBAAqB,CAAC"}
@@ -14,16 +14,17 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./CheckboxInput"), exports);
17
18
  __exportStar(require("./colorVariant"), exports);
19
+ __exportStar(require("./context"), exports);
18
20
  __exportStar(require("./date"), exports);
19
21
  __exportStar(require("./download"), exports);
20
22
  __exportStar(require("./downloadPrintHtml"), exports);
21
23
  __exportStar(require("./file"), exports);
22
24
  __exportStar(require("./helper"), exports);
25
+ __exportStar(require("./hooks"), exports);
23
26
  __exportStar(require("./regex"), exports);
24
27
  __exportStar(require("./theme/colorPaletteUI"), exports);
25
28
  __exportStar(require("./theme/theme"), exports);
26
29
  __exportStar(require("./types"), exports);
27
30
  __exportStar(require("./urlToNestedObject"), exports);
28
- __exportStar(require("./hooks"), exports);
29
- __exportStar(require("./CheckboxInput"), exports);
@@ -6,4 +6,5 @@ export declare const timeRegex: RegExp;
6
6
  export declare const accessorFnRegex: RegExp;
7
7
  export declare const hslaRegex: RegExp;
8
8
  export declare const highlightWordsRegex: RegExp;
9
+ export declare const numericRegex: RegExp;
9
10
  //# sourceMappingURL=regex.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"regex.d.ts","sourceRoot":"","sources":["../../src/utils/regex.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,cAAc,QAAkB,CAAC;AAE9C,eAAO,MAAM,YAAY,QAAwB,CAAC;AAElD,eAAO,MAAM,uBAAuB,QAAoB,CAAC;AAEzD,eAAO,MAAM,UAAU,QACmvB,CAAC;AAE3wB,eAAO,MAAM,SAAS,QAA6B,CAAC;AAEpD,eAAO,MAAM,eAAe,QACqD,CAAC;AAElF,eAAO,MAAM,SAAS,QAAqD,CAAC;AAE5E,eAAO,MAAM,mBAAmB,QAAwB,CAAC"}
1
+ {"version":3,"file":"regex.d.ts","sourceRoot":"","sources":["../../src/utils/regex.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,cAAc,QAAkB,CAAC;AAE9C,eAAO,MAAM,YAAY,QAAwB,CAAC;AAElD,eAAO,MAAM,uBAAuB,QAAoB,CAAC;AAEzD,eAAO,MAAM,UAAU,QACmvB,CAAC;AAE3wB,eAAO,MAAM,SAAS,QAA6B,CAAC;AAEpD,eAAO,MAAM,eAAe,QACqD,CAAC;AAElF,eAAO,MAAM,SAAS,QAAqD,CAAC;AAE5E,eAAO,MAAM,mBAAmB,QAAwB,CAAC;AAEzD,eAAO,MAAM,YAAY,QAAkB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.highlightWordsRegex = exports.hslaRegex = exports.accessorFnRegex = exports.timeRegex = exports.emailRegex = exports.noSpecialCharacterRegex = exports.isoDateRegex = exports.monthYearRegex = void 0;
3
+ exports.numericRegex = exports.highlightWordsRegex = exports.hslaRegex = exports.accessorFnRegex = exports.timeRegex = exports.emailRegex = exports.noSpecialCharacterRegex = exports.isoDateRegex = exports.monthYearRegex = void 0;
4
4
  /* eslint-disable sonarjs/unnecessary-character-escapes */
5
5
  /* eslint-disable no-useless-escape */
6
6
  /* eslint-disable sonarjs/single-character-alternation */
@@ -17,3 +17,4 @@ exports.timeRegex = /^\d{1,3}:\d{2}(:\d{2})?$/;
17
17
  exports.accessorFnRegex = /([a-zA-Z0-9_$.\[\]]+)\s*!==\s*null\s*&&\s*\1\s*!==\s*void 0\s*\?\s*\1\s*:\s*/g;
18
18
  exports.hslaRegex = /hsla?\((\d+),\s*(\d+)%,\s*(\d+)%,?\s*([\d.]+)?\)/;
19
19
  exports.highlightWordsRegex = /[.*+?^${}()|[\]\\]/g;
20
+ exports.numericRegex = /^-?\d*\.?\d*$/;