@tap-payments/os-micro-frontend-shared 0.1.374 → 0.1.375-test.1-test.2

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 (95) hide show
  1. package/build/components/AnimatedSpinnerIcon/style.d.ts +0 -1
  2. package/build/components/Chip/style.d.ts +0 -1
  3. package/build/components/CountBadge/style.d.ts +0 -1
  4. package/build/components/Dialog/style.d.ts +0 -1
  5. package/build/components/FlippingCard/style.d.ts +0 -1
  6. package/build/components/ImageWrapper/ImageWrapper.d.ts +0 -1
  7. package/build/components/JSONViewer/style.d.ts +0 -1
  8. package/build/components/LeftPeekRightExpandingChip/style.d.ts +0 -1
  9. package/build/components/RightLeftExpandingCenterChip/style.d.ts +0 -1
  10. package/build/components/Sandbox/style.js +3 -2
  11. package/build/components/SearchButton/styles.d.ts +0 -1
  12. package/build/components/StatusIcons/AuthIcons/style.d.ts +0 -1
  13. package/build/components/StatusIcons/AuthorizationAutoIcons/style.d.ts +0 -1
  14. package/build/components/StatusIcons/ChargeStatusIcon/style.d.ts +0 -1
  15. package/build/components/StatusIcons/SourceIcons/style.d.ts +0 -1
  16. package/build/components/TableCells/CustomCells/ActionCell/style.d.ts +0 -1
  17. package/build/components/TableCells/CustomCells/AgreementCell/style.d.ts +0 -1
  18. package/build/components/TableCells/CustomCells/ApplicationStatusCell/style.d.ts +0 -1
  19. package/build/components/TableCells/CustomCells/AuthenticationCell/style.d.ts +0 -1
  20. package/build/components/TableCells/CustomCells/AuthenticationStatusCell/style.d.ts +0 -1
  21. package/build/components/TableCells/CustomCells/AuthenticationTypeCell/style.d.ts +0 -1
  22. package/build/components/TableCells/CustomCells/BalanceCell/style.d.ts +0 -1
  23. package/build/components/TableCells/CustomCells/ChannelsCell/style.d.ts +0 -1
  24. package/build/components/TableCells/CustomCells/CheckoutStatusCell/style.d.ts +0 -1
  25. package/build/components/TableCells/CustomCells/DestinationStatusCell/style.d.ts +0 -1
  26. package/build/components/TableCells/CustomCells/DueDateCell/style.d.ts +0 -1
  27. package/build/components/TableCells/CustomCells/IDButton/style.d.ts +0 -1
  28. package/build/components/TableCells/CustomCells/IntentsStatusCell/style.d.ts +0 -1
  29. package/build/components/TableCells/CustomCells/InvoiceStatusCell/style.d.ts +0 -1
  30. package/build/components/TableCells/CustomCells/PayoutReportCell/style.d.ts +0 -1
  31. package/build/components/TableCells/CustomCells/PayoutStatusCell/style.d.ts +0 -1
  32. package/build/components/TableCells/CustomCells/ProductsCell/style.d.ts +0 -1
  33. package/build/components/TableCells/CustomCells/ReferenceCell/style.d.ts +0 -1
  34. package/build/components/TableCells/CustomCells/RefundChargeCell/style.d.ts +0 -1
  35. package/build/components/TableCells/CustomCells/RefundStatusCell/style.d.ts +0 -1
  36. package/build/components/TableCells/CustomCells/SalesChannelCell/style.d.ts +0 -1
  37. package/build/components/TableCells/CustomCells/SegmentsCell/style.d.ts +0 -1
  38. package/build/components/TableCells/CustomCells/StatusCell/style.d.ts +0 -1
  39. package/build/components/TableCells/CustomCells/TokenStatusCell/style.d.ts +0 -1
  40. package/build/components/TableCells/CustomCells/style.d.ts +0 -1
  41. package/build/components/TableHeader/FiltersRow.d.ts +1 -1
  42. package/build/components/TableHeader/FiltersRow.js +4 -2
  43. package/build/components/TableHeader/TableHeader.d.ts +1 -1
  44. package/build/components/TableHeader/TableHeader.js +2 -2
  45. package/build/components/TableHeader/TableView/CreateViewDialog.d.ts +3 -0
  46. package/build/components/TableHeader/TableView/CreateViewDialog.js +91 -0
  47. package/build/components/TableHeader/TableView/CustomViews.js +1 -1
  48. package/build/components/TableHeader/TableView/TableView.js +0 -1
  49. package/build/components/TableHeader/TableView/ViewSelector.d.ts +5 -0
  50. package/build/components/TableHeader/TableView/ViewSelector.js +81 -0
  51. package/build/components/TableHeader/TableView/ViewsDropdown.d.ts +5 -0
  52. package/build/components/TableHeader/TableView/ViewsDropdown.js +198 -0
  53. package/build/components/TableHeader/TableView/components/ColumnList.d.ts +3 -0
  54. package/build/components/TableHeader/TableView/components/ColumnList.js +70 -0
  55. package/build/components/TableHeader/TableView/components/ViewsSubmenu.d.ts +3 -0
  56. package/build/components/TableHeader/TableView/components/ViewsSubmenu.js +71 -0
  57. package/build/components/TableHeader/TableView/components/index.d.ts +2 -0
  58. package/build/components/TableHeader/TableView/components/index.js +2 -0
  59. package/build/components/TableHeader/TableView/constants.d.ts +10 -0
  60. package/build/components/TableHeader/TableView/constants.js +10 -0
  61. package/build/components/TableHeader/TableView/data.d.ts +5 -0
  62. package/build/components/TableHeader/TableView/data.js +48 -0
  63. package/build/components/TableHeader/TableView/hooks/index.d.ts +6 -0
  64. package/build/components/TableHeader/TableView/hooks/index.js +6 -0
  65. package/build/components/TableHeader/TableView/hooks/useCreateViewDialog.d.ts +22 -0
  66. package/build/components/TableHeader/TableView/hooks/useCreateViewDialog.js +86 -0
  67. package/build/components/TableHeader/TableView/hooks/useDialogPosition.d.ts +8 -0
  68. package/build/components/TableHeader/TableView/hooks/useDialogPosition.js +16 -0
  69. package/build/components/TableHeader/TableView/hooks/useNestedSubmenu.d.ts +7 -0
  70. package/build/components/TableHeader/TableView/hooks/useNestedSubmenu.js +34 -0
  71. package/build/components/TableHeader/TableView/hooks/useOriginalColumns.d.ts +6 -0
  72. package/build/components/TableHeader/TableView/hooks/useOriginalColumns.js +18 -0
  73. package/build/components/TableHeader/TableView/hooks/useSubmenuHover.d.ts +8 -0
  74. package/build/components/TableHeader/TableView/hooks/useSubmenuHover.js +43 -0
  75. package/build/components/TableHeader/TableView/hooks/useViewSelector.d.ts +50 -0
  76. package/build/components/TableHeader/TableView/hooks/useViewSelector.js +239 -0
  77. package/build/components/TableHeader/TableView/hooks/useViewsManager.d.ts +20 -0
  78. package/build/components/TableHeader/TableView/hooks/useViewsManager.js +96 -0
  79. package/build/components/TableHeader/TableView/index.d.ts +12 -3
  80. package/build/components/TableHeader/TableView/index.js +13 -3
  81. package/build/components/TableHeader/TableView/styles.d.ts +127 -0
  82. package/build/components/TableHeader/TableView/styles.js +426 -0
  83. package/build/components/TableHeader/TableView/types.d.ts +183 -0
  84. package/build/components/TableHeader/TableView/types.js +1 -0
  85. package/build/components/TableHeader/TableView/utils.d.ts +121 -0
  86. package/build/components/TableHeader/TableView/utils.js +463 -0
  87. package/build/components/TableHeader/index.d.ts +1 -0
  88. package/build/components/TableHeader/type.d.ts +15 -1
  89. package/build/components/TableReports/components/DownloadButton/style.d.ts +0 -1
  90. package/build/components/TableReports/style.d.ts +0 -1
  91. package/build/components/VirtualTables/components/style.d.ts +0 -1
  92. package/build/constants/assets.d.ts +2 -0
  93. package/build/constants/assets.js +2 -0
  94. package/build/utils/date.js +5 -3
  95. package/package.json +4 -3
@@ -0,0 +1,183 @@
1
+ /// <reference types="react" />
2
+ import type { ColumnViewProps, TableMode } from '../../../types/index.js';
3
+ import type { TableHeaderProps, ViewOption } from '../type';
4
+ export interface ViewMenuItem {
5
+ label: string;
6
+ id: string;
7
+ templateId?: string;
8
+ columns?: string[];
9
+ submenu?: ColumnViewProps[];
10
+ isCustom?: boolean;
11
+ default?: boolean;
12
+ }
13
+ export interface FieldItem {
14
+ code: string;
15
+ name: {
16
+ text: string;
17
+ lang: string;
18
+ }[];
19
+ order?: number | null;
20
+ default?: boolean;
21
+ }
22
+ export interface ColumnItem {
23
+ code: string;
24
+ name: {
25
+ text: string;
26
+ lang: string;
27
+ }[];
28
+ order?: number;
29
+ default?: boolean;
30
+ fields?: FieldItem[];
31
+ }
32
+ export interface LayoutSection {
33
+ code: string;
34
+ columns: ColumnItem[];
35
+ }
36
+ export interface TemplateAPIMetadata {
37
+ segment: string;
38
+ app: string;
39
+ service: string;
40
+ user: {
41
+ id: string;
42
+ };
43
+ master_template_id?: string;
44
+ }
45
+ export interface CreateTemplatePayload extends TemplateAPIMetadata {
46
+ name: string;
47
+ layout: LayoutSection[];
48
+ }
49
+ export interface UpdateTemplatePayload extends TemplateAPIMetadata {
50
+ name: string;
51
+ layout: LayoutSection[];
52
+ }
53
+ export interface Template {
54
+ templateId: string;
55
+ segment: string;
56
+ app: string;
57
+ service: string;
58
+ name: string;
59
+ layout: LayoutSection[];
60
+ id: {
61
+ timestamp: number;
62
+ date: string;
63
+ };
64
+ masterTemplateId: string;
65
+ user: {
66
+ id: string;
67
+ };
68
+ created: number;
69
+ updated: number;
70
+ default: boolean;
71
+ }
72
+ export interface TemplatesList {
73
+ object: string;
74
+ live_mode: boolean;
75
+ api_version: string;
76
+ feature_version: string;
77
+ count: number;
78
+ has_more: boolean;
79
+ templates: Template[];
80
+ }
81
+ export interface CreateCustomViewDialogProps {
82
+ open: boolean;
83
+ onClose: () => void;
84
+ onCreate?: (data: {
85
+ name: string;
86
+ selectedColumns: ColumnViewProps[];
87
+ layout: LayoutSection;
88
+ }) => Promise<void>;
89
+ availableColumns?: ColumnViewProps[];
90
+ defaultColumns?: ColumnViewProps[];
91
+ editingView?: {
92
+ id: string;
93
+ label: string;
94
+ templateId?: string;
95
+ submenu?: ColumnViewProps[];
96
+ } | null;
97
+ onDelete?: (viewId: string) => Promise<void>;
98
+ tableViews?: ColumnViewProps[];
99
+ mode?: TableMode;
100
+ }
101
+ export interface ColumnCheckState {
102
+ checked: boolean;
103
+ indeterminate: boolean;
104
+ }
105
+ export interface ViewSelectorProps {
106
+ onViewChange?: TableHeaderProps['onViewChange'];
107
+ onCreateCustomView?: (data: {
108
+ name: string;
109
+ selectedColumns: ColumnViewProps[];
110
+ layout: LayoutSection;
111
+ }) => Promise<void>;
112
+ onEditCustomView?: (viewId: string, data: {
113
+ name: string;
114
+ selectedColumns: ColumnViewProps[];
115
+ layout: LayoutSection;
116
+ }) => Promise<void>;
117
+ onDeleteCustomView?: (viewId: string) => Promise<void>;
118
+ tableMode?: TableMode;
119
+ templates: Template[];
120
+ lang?: string;
121
+ }
122
+ export interface ViewsDropdownProps {
123
+ open: boolean;
124
+ selectedViewInfo: ViewOption;
125
+ setSelectedViewInfo: (selected: ViewOption, viewMenuItem?: ViewMenuItem) => void;
126
+ onSelect: (e: React.MouseEvent<HTMLDivElement>) => void;
127
+ setViews?: (views: string[]) => void;
128
+ anchorEl: Element | null;
129
+ onCreateCustomView?: (useCurrentState?: boolean) => void;
130
+ customViews?: ViewMenuItem[];
131
+ onEditCustomView?: (view: ViewMenuItem) => void;
132
+ onSaveDefaultColumns?: (columns: ColumnViewProps[]) => void;
133
+ defaultColumns?: ColumnViewProps[];
134
+ setDefaultColumns?: (columns: ColumnViewProps[]) => void;
135
+ updateSelectedView?: (view: ViewMenuItem) => void;
136
+ mode?: TableMode;
137
+ defaultTemplate?: ViewMenuItem;
138
+ }
139
+ export interface ColumnListProps {
140
+ selectedColumns: ColumnViewProps[];
141
+ columnNames: string[];
142
+ allSelected: boolean;
143
+ someSelected: boolean;
144
+ hoveredColumn: string | null;
145
+ anchorEl: HTMLElement | null;
146
+ onReorder: (reorderedNames: string[]) => void;
147
+ onColumnToggle: (columnName: string) => void;
148
+ onSubItemToggle: (columnName: string, subItemName: string) => void;
149
+ onSelectAll: () => void;
150
+ onResetToDefault: () => void;
151
+ onSubmenuEnter: (columnName: string, element: HTMLElement) => void;
152
+ onSubmenuLeave: () => void;
153
+ onCancelClose: () => void;
154
+ hasChanges?: boolean;
155
+ }
156
+ export interface ViewsSubmenuProps {
157
+ columns: ColumnViewProps[];
158
+ allCurrentSelected: boolean;
159
+ someCurrentSelected: boolean;
160
+ onSelectAll: () => void;
161
+ onReset: () => void;
162
+ onColumnToggle: (columnName: string) => void;
163
+ onNestedItemToggle: (columnName: string, subItemName: string) => void;
164
+ onReorder: (reorderedColumnNames: string[]) => void;
165
+ anchorEl: HTMLElement | null;
166
+ isModified?: boolean;
167
+ }
168
+ export interface UseCreateViewDialogProps {
169
+ open: boolean;
170
+ availableColumns: ColumnViewProps[];
171
+ defaultColumns: ColumnViewProps[];
172
+ editingView?: {
173
+ id: string;
174
+ label: string;
175
+ submenu?: ColumnViewProps[];
176
+ } | null;
177
+ tableViews?: ColumnViewProps[];
178
+ }
179
+ export interface UseViewsManagerProps {
180
+ tableMode: TableMode;
181
+ templates: Template[];
182
+ lang?: string;
183
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,121 @@
1
+ import type { ColumnViewProps, TableMode } from '../../../types/index.js';
2
+ import type { LayoutSection, ViewMenuItem, ColumnCheckState } from './types';
3
+ /**
4
+ * Transform API layout response to internal ColumnViewProps format
5
+ */
6
+ export declare const transformLayoutToColumns: (layout: LayoutSection[], lang?: string) => ColumnViewProps[];
7
+ export declare const getColumnsByMode: (mode: TableMode, layoutData?: LayoutSection[]) => ColumnViewProps[];
8
+ export declare const isDateColumn: (name: string) => boolean;
9
+ export declare const getColumnCheckState: (column: ColumnViewProps) => ColumnCheckState;
10
+ export declare const createCustomViewMenuItem: (name: string, selectedColumns: ColumnViewProps[], isDefault?: boolean) => ViewMenuItem;
11
+ /**
12
+ * Extract layout data from templates (combine all sections from all templates)
13
+ * This is used for the built-in "Default" view's layoutData prop
14
+ */
15
+ export declare const getLayoutDataFromTemplates: (templates: Array<{
16
+ layout: LayoutSection[];
17
+ }>) => LayoutSection[];
18
+ /**
19
+ * Set a view as default and ensure only one view is default at a time
20
+ */
21
+ export declare const setViewAsDefault: (views: ViewMenuItem[], viewId: string) => ViewMenuItem[];
22
+ /**
23
+ * Transform API templates response to ViewMenuItem array
24
+ * Filters templates by mode and only shows the section matching the current mode
25
+ * Separates default templates (to be merged into built-in Default view) from custom views
26
+ */
27
+ export declare const transformTemplatesToViewMenuItems: (templates: Array<{
28
+ id: string | {
29
+ timestamp: number;
30
+ date: string;
31
+ };
32
+ name: string;
33
+ default: boolean;
34
+ layout: LayoutSection[];
35
+ templateId: string;
36
+ }>, mode?: TableMode, lang?: string) => {
37
+ customViews: ViewMenuItem[];
38
+ defaultTemplateColumns?: ColumnViewProps[] | undefined;
39
+ defaultTemplate?: ViewMenuItem | undefined;
40
+ };
41
+ /**
42
+ * Convert ColumnViewProps back to LayoutSection format for API requests
43
+ */
44
+ export declare const convertColumnsToLayoutSection: (columns: ColumnViewProps[], mode: TableMode, lang?: string) => LayoutSection;
45
+ /**
46
+ * Initialize columns for editing mode
47
+ */
48
+ export declare const initializeEditingColumns: (editingColumns: ColumnViewProps[], availableColumns: ColumnViewProps[]) => ColumnViewProps[];
49
+ /**
50
+ * Initialize columns for create mode (all unchecked except date)
51
+ */
52
+ export declare const initializeCreateColumns: (availableColumns: ColumnViewProps[]) => ColumnViewProps[];
53
+ /**
54
+ * Initialize columns for create mode with current tableViews state (preserves checked/unchecked values)
55
+ */
56
+ export declare const initializeCreateColumnsWithCurrentState: (availableColumns: ColumnViewProps[], currentTableViews: ColumnViewProps[]) => ColumnViewProps[];
57
+ /**
58
+ * Reset columns to their default selection state
59
+ */
60
+ export declare const resetColumnsToDefault: (columns: ColumnViewProps[]) => ColumnViewProps[];
61
+ /**
62
+ * Toggle a column's selection (including all children if present)
63
+ */
64
+ export declare const toggleColumn: (columns: ColumnViewProps[], columnName: string) => ColumnViewProps[];
65
+ /**
66
+ * Toggle a sub-item's selection and update parent state
67
+ */
68
+ export declare const toggleSubItem: (columns: ColumnViewProps[], columnName: string, subItemName: string) => ColumnViewProps[];
69
+ /**
70
+ * Select or deselect all columns (except date)
71
+ */
72
+ export declare const toggleAllColumns: (columns: ColumnViewProps[], selectAll: boolean) => ColumnViewProps[];
73
+ /**
74
+ * Check if all non-date columns are selected
75
+ */
76
+ export declare const areAllColumnsSelected: (columns: ColumnViewProps[]) => boolean;
77
+ /**
78
+ * Check if some (but not all) non-date columns are selected
79
+ */
80
+ export declare const areSomeColumnsSelected: (columns: ColumnViewProps[], allSelected: boolean) => boolean;
81
+ /**
82
+ * Validate template name
83
+ */
84
+ export declare const isValidTemplateName: (name: string, maxLength: number) => boolean;
85
+ /**
86
+ * Deep clone columns array with all nested properties
87
+ */
88
+ export declare const deepCloneColumns: (columns: ColumnViewProps[]) => ColumnViewProps[];
89
+ /**
90
+ * Toggle a single column's selection state
91
+ */
92
+ export declare const toggleSingleColumn: (columns: ColumnViewProps[], columnName: string) => ColumnViewProps[];
93
+ /**
94
+ * Get submenu items for a view menu item
95
+ * Always includes the date column at the beginning
96
+ */
97
+ export declare const getSubmenuItems: (item: ViewMenuItem, defaultColumns: ColumnViewProps[]) => ColumnViewProps[];
98
+ /**
99
+ * Check if a view menu item has submenu
100
+ */
101
+ export declare const hasSubmenu: (item: ViewMenuItem, defaultColumns: ColumnViewProps[]) => boolean;
102
+ /**
103
+ * Check if all columns in current state are selected
104
+ */
105
+ export declare const areAllCurrentColumnsSelected: (columns: ColumnViewProps[]) => boolean;
106
+ /**
107
+ * Check if some (but not all) columns in current state are selected
108
+ */
109
+ export declare const areSomeCurrentColumnsSelected: (columns: ColumnViewProps[], allSelected: boolean) => boolean;
110
+ /**
111
+ * Toggle all columns selection (select all or unselect all)
112
+ */
113
+ export declare const toggleAllCurrentColumns: (columns: ColumnViewProps[], shouldSelect: boolean) => ColumnViewProps[];
114
+ /**
115
+ * Normalize columns by converting undefined selected values to false for consistent comparison
116
+ */
117
+ export declare const normalizeColumnsSelected: (columns: ColumnViewProps[]) => ColumnViewProps[];
118
+ /**
119
+ * Compare two columns arrays to check if they are equal (same order, same selection states)
120
+ */
121
+ export declare const areColumnsEqual: (cols1: ColumnViewProps[], cols2: ColumnViewProps[]) => boolean;