@tap-payments/os-micro-frontend-shared 0.3.285 → 0.3.287

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 (56) hide show
  1. package/README.md +2 -2
  2. package/build/_chunks/chunk-2IOTEGXO.js +2 -0
  3. package/build/_chunks/{chunk-R7AVLGCS.js → chunk-CZZIV6U2.js} +1 -1
  4. package/build/_chunks/chunk-QT55YVEL.js +2 -0
  5. package/build/_chunks/{chunk-CKJ63TJ5.js → chunk-XYGYT5QV.js} +1 -1
  6. package/build/components/ColumnViews/index.js +1 -1
  7. package/build/components/DateFilter/index.js +1 -1
  8. package/build/components/FilterDropdown/components/MerchantsFilterItem/type.d.ts +4 -0
  9. package/build/components/FilterDropdown/components/MerchantsFilterItem/utils.d.ts +15 -2
  10. package/build/components/FilterDropdown/index.js +1 -1
  11. package/build/components/ListColumnFilter/index.js +1 -1
  12. package/build/components/ListHeader/index.js +1 -1
  13. package/build/components/MultiLevelMenu/MultiLevelMenu.d.ts +10 -0
  14. package/build/components/MultiLevelMenu/MultiLevelMenuItem.d.ts +6 -0
  15. package/build/components/MultiLevelMenu/MultiLevelMenuPanel.d.ts +6 -0
  16. package/build/components/MultiLevelMenu/constants.d.ts +56 -0
  17. package/build/components/MultiLevelMenu/hooks/useMultiLevelMenuContext.d.ts +24 -0
  18. package/build/components/MultiLevelMenu/hooks/useMultiLevelMenuSearch.d.ts +11 -0
  19. package/build/components/MultiLevelMenu/hooks/useMultiLevelMenuSelection.d.ts +25 -0
  20. package/build/components/MultiLevelMenu/hooks/useSubmenu.d.ts +12 -0
  21. package/build/components/MultiLevelMenu/icons.d.ts +7 -0
  22. package/build/components/MultiLevelMenu/index.d.ts +3 -0
  23. package/build/components/MultiLevelMenu/index.js +1 -0
  24. package/build/components/MultiLevelMenu/style.d.ts +58 -0
  25. package/build/components/MultiLevelMenu/type.d.ts +239 -0
  26. package/build/components/MultiLevelMenu/utils.d.ts +122 -0
  27. package/build/components/PhoneFilter/index.js +1 -1
  28. package/build/components/StatusFilter/index.js +1 -1
  29. package/build/components/StatusIcons/index.js +1 -1
  30. package/build/components/TableCells/index.js +1 -1
  31. package/build/components/index.d.ts +2 -2
  32. package/build/components/index.js +1 -1
  33. package/build/components/modules/JSONViewWindow/index.js +1 -1
  34. package/build/components/modules/WindowShell/index.js +1 -1
  35. package/build/components/modules/index.js +1 -1
  36. package/build/datetime/components/index.js +1 -1
  37. package/build/index.js +1 -1
  38. package/package.json +1 -5
  39. package/build/_chunks/chunk-E6SXZOXX.js +0 -2
  40. package/build/_chunks/chunk-Z2ELLNWM.js +0 -1
  41. package/build/components/TreeDropdown/TreeDropdown.d.ts +0 -4
  42. package/build/components/TreeDropdown/TreeNodeItem/SelectionControl.d.ts +0 -8
  43. package/build/components/TreeDropdown/TreeNodeItem/TreeNodeItem.d.ts +0 -13
  44. package/build/components/TreeDropdown/TreeNodeItem/index.d.ts +0 -2
  45. package/build/components/TreeDropdown/TreeNodeItem/style.d.ts +0 -18
  46. package/build/components/TreeDropdown/TreeNodeList/List.d.ts +0 -6
  47. package/build/components/TreeDropdown/TreeNodeList/TreeNodeList.d.ts +0 -17
  48. package/build/components/TreeDropdown/TreeNodeList/style.d.ts +0 -6
  49. package/build/components/TreeDropdown/context/TreeDropdownProvider.d.ts +0 -15
  50. package/build/components/TreeDropdown/hooks/useSearch.d.ts +0 -18
  51. package/build/components/TreeDropdown/hooks/useTreeDropdown.d.ts +0 -12
  52. package/build/components/TreeDropdown/index.d.ts +0 -4
  53. package/build/components/TreeDropdown/index.js +0 -1
  54. package/build/components/TreeDropdown/style.d.ts +0 -13
  55. package/build/components/TreeDropdown/type.d.ts +0 -96
  56. package/build/components/TreeDropdown/utils.d.ts +0 -36
@@ -1,18 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const StyledCheckbox: import("@emotion/styled").StyledComponent<Omit<Omit<import("../../primitives").CheckboxProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>, "ref"> & {
3
- ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
4
- } & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
5
- export declare const StyledRadioButton: import("@emotion/styled").StyledComponent<Omit<Omit<import("../../primitives").RadioButtonProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>, "ref"> & {
6
- ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
7
- } & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
8
- export declare const Content: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
9
- ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
10
- }, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
11
- export declare const Label: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material/Typography").TypographyTypeMap<{}, "span">>;
12
- export declare const HintText: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material/Typography").TypographyTypeMap<{}, "span">>;
13
- export declare const ChildrenCount: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
14
- ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
15
- }, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
16
- isOneDigit?: boolean | undefined;
17
- }, {}, {}>;
18
- export declare const ArrowIcon: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- declare const List: ({ children, onScroll }: {
3
- children: React.ReactNode;
4
- onScroll: (e: React.UIEvent<HTMLElement, UIEvent>) => void;
5
- }) => React.JSX.Element;
6
- export default List;
@@ -1,17 +0,0 @@
1
- /// <reference types="react" />
2
- import { PopperProps } from '@mui/material/Popper';
3
- import { SxProps, Theme } from '@mui/material/styles';
4
- import { TreeNode } from '../type';
5
- type TreeNodeListProps = {
6
- menuItems: TreeNode[];
7
- anchorEl: HTMLElement | null;
8
- sx?: SxProps<Theme>;
9
- header?: React.ReactNode;
10
- footer?: React.ReactNode;
11
- levelIndex?: number;
12
- levelKey?: TreeNode['levelKey'];
13
- searchProps?: TreeNode['searchProps'];
14
- placement?: PopperProps['placement'];
15
- };
16
- declare const TreeNodeList: (props: TreeNodeListProps) => import("react").JSX.Element;
17
- export default TreeNodeList;
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const Root: import("@emotion/styled").StyledComponent<Omit<Omit<import("../../primitives").MenuProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
3
- ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
4
- } & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
5
- export declare const ListOuterContainer: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
6
- export declare const ListInnerContainer: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, {}>;
@@ -1,15 +0,0 @@
1
- import { type PropsWithChildren } from 'react';
2
- import { TreeMapper, TreeNode } from '../type';
3
- type TreeDropdownContextType = {
4
- treeMapper: TreeMapper;
5
- handleSelect: (isChecked: boolean, targetNode: TreeNode) => void;
6
- multiple?: boolean;
7
- IconComponent?: React.ComponentType<{
8
- fileId: string;
9
- width?: number | string;
10
- height?: number | string;
11
- }>;
12
- };
13
- export declare const TreeDropdownContext: import("react").Context<TreeDropdownContextType>;
14
- declare const TreeDropdownProvider: ({ children, treeMapper, handleSelect, multiple, IconComponent }: PropsWithChildren<TreeDropdownContextType>) => import("react").JSX.Element;
15
- export default TreeDropdownProvider;
@@ -1,18 +0,0 @@
1
- import React from 'react';
2
- import { TreeNode } from '../type';
3
- type UseSearchProps = {
4
- initialValue?: string;
5
- getValues?: (item: TreeNode) => string[];
6
- filterItem?: (item: TreeNode, searchText: string) => TreeNode | null;
7
- onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
8
- items: TreeNode[];
9
- debounceMs?: number;
10
- enabled?: boolean;
11
- };
12
- declare const useSearch: (props: UseSearchProps) => {
13
- searchText: string;
14
- filteredItems: TreeNode[];
15
- handleSearch: (e: React.ChangeEvent<HTMLInputElement>) => void;
16
- handleReset: () => void;
17
- };
18
- export default useSearch;
@@ -1,12 +0,0 @@
1
- /// <reference types="react" />
2
- declare const useTreeDropdown: () => {
3
- treeMapper: import("..").TreeMapper;
4
- handleSelect: (isChecked: boolean, targetNode: import("..").TreeNode) => void;
5
- multiple?: boolean | undefined;
6
- IconComponent?: import("react").ComponentType<{
7
- fileId: string;
8
- width?: string | number | undefined;
9
- height?: string | number | undefined;
10
- }> | undefined;
11
- };
12
- export default useTreeDropdown;
@@ -1,4 +0,0 @@
1
- import TreeDropdown from './TreeDropdown';
2
- export default TreeDropdown;
3
- export { TreeManager } from './utils';
4
- export * from './type';
@@ -1 +0,0 @@
1
- export{a as SelectedState,b as TreeManager,c as default}from'../../_chunks/chunk-Z2ELLNWM.js';import'../../_chunks/chunk-MZBS2I4P.js';import'../../_chunks/chunk-6GZFEPN6.js';import'../../_chunks/chunk-JKW2LY7R.js';import'../../_chunks/chunk-Z2DUFVI5.js';import'../../_chunks/chunk-3M2GZVQW.js';import'../../_chunks/chunk-LS57WE6K.js';
@@ -1,13 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const CollapseIcon: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
3
- expanded: boolean;
4
- }, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
5
- export declare const LoadingRow: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
6
- ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
7
- }, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
8
- export declare const StyledMenuItem: import("@emotion/styled").StyledComponent<Omit<Omit<import("../primitives").MenuItemProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
9
- ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
10
- } & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
11
- export declare const Section: import("@emotion/styled").StyledComponent<Omit<Omit<import("../primitives").MenuItemProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
12
- ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
13
- } & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
@@ -1,96 +0,0 @@
1
- /// <reference types="react" />
2
- import { Input } from '../index.js';
3
- import { MenuItem } from '../primitives';
4
- import { type SxProps, type Theme } from '@mui/material/styles';
5
- import { PopperProps } from '@mui/material/Popper';
6
- export type TreeNodeIcon = {
7
- fileId: string;
8
- width?: number | string;
9
- height?: number | string;
10
- };
11
- export type ExtendableObject<T> = T extends Record<string, any> ? T & Record<string, any> : never;
12
- export type OnTreeMountedParams = {
13
- state: TreeMapper;
14
- tree: TreeNode[];
15
- selectedTree: TreeNode[];
16
- };
17
- export type TreeDropdownProps = {
18
- onMounted?: (params: OnTreeMountedParams) => void;
19
- onChange?: (tree: TreeNode[]) => void;
20
- multiple?: boolean;
21
- anchorEl: HTMLElement | null;
22
- placement?: PopperProps['placement'];
23
- sx?: SxProps<Theme>;
24
- treeDefinition: TreeDefinition;
25
- exposeOnlySelectedTree?: boolean;
26
- IconComponent?: React.ComponentType<{
27
- fileId: string;
28
- width?: number | string;
29
- height?: number | string;
30
- }>;
31
- };
32
- export type TreeDropdownRef = {
33
- treeMapper: TreeMapper;
34
- getFullTree: () => TreeNode[];
35
- getSelectedTree: () => TreeNode[];
36
- toggleAll: (selected: boolean) => void;
37
- };
38
- export type TreeNode = ExtendableObject<{
39
- id: string;
40
- label?: React.ReactNode;
41
- hintText?: React.ReactNode;
42
- icon?: TreeNodeIcon;
43
- iconComponent?: React.ReactNode;
44
- itemProps?: React.ComponentProps<typeof MenuItem>;
45
- renderItem?: (params: {
46
- nodeProps: TreeNode;
47
- checked?: boolean;
48
- indeterminate?: boolean;
49
- onSelect: (e: React.ChangeEvent<HTMLInputElement>) => void;
50
- }) => React.ReactNode;
51
- }> & TreeDefinition;
52
- export type TreeDefinition = {
53
- header?: React.ReactNode;
54
- footer?: React.ReactNode;
55
- /**
56
- * [Optional] Used to determine the level of the node in the tree
57
- * It will appear as data attribute over the list element.
58
- * ```
59
- * <div ... data-level-key="some-unique-key"> ... </div>
60
- * ```
61
- */
62
- levelKey?: string;
63
- searchProps?: {
64
- /**
65
- * ### [Required For Search, unless `filterItem` is provided]
66
- * The function to get the value of the item for the search
67
- */
68
- getValues?: (item: TreeNode) => string[];
69
- /**
70
- * [Optional] Advanced filtering hook. Given an item and the (lowercased) search
71
- * text, return the item (optionally with a pruned subtree) to keep it, or `null`
72
- * to drop it. Takes precedence over `getValues` when provided.
73
- */
74
- filterItem?: (item: TreeNode, searchText: string) => TreeNode | null;
75
- onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
76
- noResultsText?: React.ReactNode;
77
- inputProps?: React.ComponentProps<typeof Input>;
78
- };
79
- children?: TreeNode[];
80
- disablePromotion?: boolean;
81
- status?: `${SelectedState}`;
82
- };
83
- export declare enum SelectedState {
84
- CHECKED = "CHECKED",
85
- UNCHECKED = "UNCHECKED",
86
- INDETERMINATE = "INDETERMINATE"
87
- }
88
- export type SelectedItems = {
89
- [key: string]: `${SelectedState}`;
90
- };
91
- export type TreeMapper = {
92
- [nodeKey: string]: {
93
- status: `${SelectedState}`;
94
- _parents?: string[];
95
- };
96
- };
@@ -1,36 +0,0 @@
1
- import { TreeMapper, TreeNode, TreeDefinition } from './type';
2
- export declare function promoteSingleChild(items: TreeNode[]): TreeNode[];
3
- export declare const getAncestorIdsByNodeId: (nodeId: string, nodes: TreeNode[], path?: TreeNode[]) => TreeNode[] | null;
4
- export declare function collectCheckedIds(nodes: TreeNode[], multiple: boolean, acc?: string[]): string[];
5
- export declare function normalizeStructure(nodes: TreeNode[], parents?: string[], acc?: TreeMapper, isParentSelected?: boolean): TreeMapper;
6
- export declare function initializeTreeMapper(nodes: TreeNode[], multiple: boolean): TreeMapper;
7
- export declare function denormalizeTree(nodes: TreeNode[], state: TreeMapper): TreeNode[];
8
- export declare function updateTreeSelection(tree: TreeMapper, targetNodeId: string, isChecked: boolean): TreeMapper;
9
- export declare function extractSelectedBranches(nodes: TreeNode[]): TreeNode[];
10
- export declare function resetTreeState(tree: TreeMapper): TreeMapper;
11
- export declare function updateSelection(tree: TreeMapper, targetNode: string, isChecked: boolean, multiple: boolean): TreeMapper;
12
- export type GetNodesByLevelOptions = {
13
- filter?: (node: TreeNode) => boolean;
14
- includeChildren?: boolean;
15
- };
16
- export declare function filterNodesByLevelKey(nodes: TreeNode[], levelKey: string): TreeNode[];
17
- export declare const TreeManager: {
18
- denormalizeTree: import("memoize-one").MemoizedFn<(tree: TreeNode[], mapper: TreeMapper) => TreeNode[]>;
19
- extractSelectedBranches: import("memoize-one").MemoizedFn<(nodes: TreeNode[]) => TreeNode[]>;
20
- filterNodesByLevelKey: import("memoize-one").MemoizedFn<(nodes: TreeNode[], levelKey: string) => TreeNode[]>;
21
- };
22
- /**
23
- * Applies the same single-child promotion logic as `promoteSingleChild` but
24
- * also handles the **root level** of a `TreeDefinition`. When the root has
25
- * exactly one child (and that child has its own children), the child is
26
- * dissolved and its grandchildren become the new root items — cascading
27
- * recursively until a level with more than one child is reached.
28
- *
29
- * The header / footer / searchProps of the dissolved node are inherited by
30
- * the promoted level so the panel still displays the correct title.
31
- *
32
- * Only the **rendered** definition should use this. The original
33
- * `treeDefinition.children` must be kept for state management so that
34
- * selection propagation remains correct across the full tree.
35
- */
36
- export declare function promoteDefinition(definition: TreeDefinition): TreeDefinition;