@tap-payments/os-micro-frontend-shared 0.1.96-test.1 → 0.1.96-test.12
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/LICENSE +21 -21
- package/README.md +12 -12
- package/build/components/ActionMenu/style.d.ts +1 -1
- package/build/components/AppServices/AppServices.d.ts +10 -5
- package/build/components/AppServices/AppServices.js +16 -18
- package/build/components/AppServices/ServiceItem.d.ts +2 -4
- package/build/components/AppServices/ServiceItem.js +2 -4
- package/build/components/AppServicesBar/AppServicesBar.d.ts +25 -0
- package/build/components/AppServicesBar/AppServicesBar.js +18 -0
- package/build/components/AppServicesBar/index.d.ts +3 -0
- package/build/components/AppServicesBar/index.js +3 -0
- package/build/components/AppServicesBar/style.d.ts +4 -0
- package/build/components/AppServicesBar/style.js +6 -0
- package/build/components/ListLayout/ListLayout.d.ts +10 -0
- package/build/components/ListLayout/ListLayout.js +20 -0
- package/build/components/ListLayout/index.d.ts +2 -0
- package/build/components/ListLayout/index.js +2 -0
- package/build/components/ListLayout/styles.d.ts +4 -0
- package/build/components/ListLayout/styles.js +9 -0
- package/build/components/SearchButton/styles.d.ts +1 -1
- package/build/components/ToggleView/ToggleView.d.ts +16 -0
- package/build/components/ToggleView/ToggleView.js +32 -0
- package/build/components/ToggleView/ToggleWrapper.d.ts +4 -0
- package/build/components/ToggleView/ToggleWrapper.js +8 -0
- package/build/components/ToggleView/index.d.ts +3 -0
- package/build/components/ToggleView/index.js +3 -0
- package/build/components/ToggleView/style.d.ts +14 -0
- package/build/components/ToggleView/style.js +31 -0
- package/build/components/ToggleView/types.d.ts +6 -0
- package/build/components/ToggleView/types.js +6 -0
- package/build/components/Toolbar/style.d.ts +6 -0
- package/build/components/Toolbar/style.js +5 -0
- package/build/components/VirtualTables/SheetViewVirtualTable/SheetViewVirtualTable.d.ts +1 -1
- package/build/components/VirtualTables/SheetViewVirtualTable/SheetViewVirtualTable.js +2 -2
- package/build/components/VirtualTables/VirtualTable/VirtualTable.d.ts +1 -1
- package/build/components/VirtualTables/VirtualTable/VirtualTable.js +2 -2
- package/build/components/VirtualTables/VirtualTableWithCard/VirtualTableWithCard.d.ts +1 -1
- package/build/components/VirtualTables/VirtualTableWithCard/VirtualTableWithCard.js +2 -2
- package/build/components/VirtualTables/components/style.js +1 -1
- package/build/components/index.d.ts +6 -0
- package/build/components/index.js +6 -0
- package/build/constants/apps.d.ts +3 -0
- package/build/constants/apps.js +3 -0
- package/build/types/apps.d.ts +50 -1
- package/build/types/table.d.ts +1 -1
- package/build/utils/style.js +4 -0
- package/package.json +29 -2
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Tap Payments
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Tap Payments
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
# os-micro-frontend-shared
|
|
2
|
-
|
|
3
|
-
## Publishing Workflow
|
|
4
|
-
|
|
5
|
-
1. Update version in package.json
|
|
6
|
-
2. Commit changes
|
|
7
|
-
3. Create and push a tag:
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npm version patch # or minor, major
|
|
11
|
-
git push origin main --tags
|
|
12
|
-
```
|
|
1
|
+
# os-micro-frontend-shared
|
|
2
|
+
|
|
3
|
+
## Publishing Workflow
|
|
4
|
+
|
|
5
|
+
1. Update version in package.json
|
|
6
|
+
2. Commit changes
|
|
7
|
+
3. Create and push a tag:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm version patch # or minor, major
|
|
11
|
+
git push origin main --tags
|
|
12
|
+
```
|
|
@@ -15,7 +15,7 @@ export declare const Charge: import("@emotion/styled").StyledComponent<import("@
|
|
|
15
15
|
export declare const DropDownChargeGapColumn: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
16
16
|
export declare const StyledAmount: import("@emotion/styled").StyledComponent<Pick<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & {
|
|
17
17
|
ref?: ((instance: HTMLInputElement | null) => void) | import("react").RefObject<HTMLInputElement> | null | undefined;
|
|
18
|
-
}, "width" | "height" | "hidden" | "type" | "color" | "content" | "translate" | "value" | "list" | "form" | "slot" | "style" | "title" | "
|
|
18
|
+
}, "width" | "height" | "hidden" | "type" | "color" | "content" | "translate" | "name" | "value" | "list" | "form" | "slot" | "style" | "title" | "ref" | "pattern" | "key" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "exportparts" | "part" | "children" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "size" | "multiple" | "autoComplete" | "readOnly" | "required" | "max" | "src" | "alt" | "formAction" | "formMethod" | "formNoValidate" | "formTarget" | "min" | "accept" | "capture" | "checked" | "formEncType" | "minLength"> & {
|
|
19
19
|
allowDecimals?: boolean | undefined;
|
|
20
20
|
allowNegativeValue?: boolean | undefined;
|
|
21
21
|
id?: string | undefined;
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { AppService } from '../../types/index.js';
|
|
3
3
|
import { ServiceItemProps } from './ServiceItem';
|
|
4
4
|
interface AppServicesProps extends Pick<ServiceItemProps, 'onClickServiceItem'> {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
serviceCode: string;
|
|
6
|
+
services: AppService[];
|
|
7
|
+
isMaximized: boolean;
|
|
8
|
+
appCode: string;
|
|
9
|
+
dimensions: {
|
|
10
|
+
width: string | number;
|
|
11
|
+
};
|
|
12
|
+
onChangeServiceCode?: (serviceCode: string) => void;
|
|
8
13
|
}
|
|
9
|
-
declare function AppServices({
|
|
14
|
+
declare function AppServices({ isMaximized, serviceCode, dimensions, appCode, services, onChangeServiceCode, onClickServiceItem, }: Readonly<AppServicesProps>): import("react/jsx-runtime").JSX.Element;
|
|
10
15
|
declare const _default: React.MemoExoticComponent<typeof AppServices>;
|
|
11
16
|
export default _default;
|
|
@@ -2,7 +2,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import React, { memo, useEffect, useRef, useState, useMemo } from 'react';
|
|
3
3
|
import { Box } from '@mui/material';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
|
-
import { useLocation } from 'react-router';
|
|
6
5
|
import { StyledIconForDropDown, StyledMenuTitle, StyledOption, StyledSelect, StyledSelectComponent } from '../index.js';
|
|
7
6
|
import { APP_CODES, blackHeadingDownArrow, blueHeadingDropdownArrow } from '../../constants/index.js';
|
|
8
7
|
import { getNameText } from '../../utils/index.js';
|
|
@@ -11,21 +10,20 @@ import { Wrapper } from './style';
|
|
|
11
10
|
const selectedIcon = (props) => {
|
|
12
11
|
return (_jsx(StyledIconForDropDown, { src: props.className.includes('MuiSelect-iconOpen') ? blueHeadingDropdownArrow : blackHeadingDownArrow, alt: "dropdown" }));
|
|
13
12
|
};
|
|
14
|
-
function AppServices({
|
|
13
|
+
function AppServices({ isMaximized, serviceCode, dimensions, appCode, services, onChangeServiceCode, onClickServiceItem, }) {
|
|
15
14
|
const [initServicesWidth, setInitServicesWidth] = useState(0);
|
|
16
15
|
const [isDropdown, setIsDropdown] = useState(false);
|
|
17
16
|
const [selectedOption, setSelectedOption] = useState('');
|
|
18
17
|
const servicesRef = useRef(null);
|
|
19
18
|
const [openDropdown, setOpenDropdown] = React.useState(false);
|
|
20
|
-
const pathname = useLocation();
|
|
21
19
|
const { i18n } = useTranslation();
|
|
22
|
-
const
|
|
23
|
-
var _a
|
|
24
|
-
if (
|
|
25
|
-
return (_a =
|
|
20
|
+
const servicesList = useMemo(() => {
|
|
21
|
+
var _a;
|
|
22
|
+
if (appCode === APP_CODES.account.code) {
|
|
23
|
+
return (_a = services.filter((service) => service.code === APP_CODES.account.services.account.code)) !== null && _a !== void 0 ? _a : [];
|
|
26
24
|
}
|
|
27
|
-
return
|
|
28
|
-
}, [
|
|
25
|
+
return services !== null && services !== void 0 ? services : [];
|
|
26
|
+
}, [appCode, services]);
|
|
29
27
|
const handleChange = (event) => {
|
|
30
28
|
setSelectedOption(event.target.value);
|
|
31
29
|
};
|
|
@@ -34,8 +32,8 @@ function AppServices({ appInfo, userApp, onChangeAppServiceCode, onClickServiceI
|
|
|
34
32
|
};
|
|
35
33
|
const activeTabTitle = useMemo(() => {
|
|
36
34
|
var _a, _b;
|
|
37
|
-
return getNameText((_b = (_a =
|
|
38
|
-
}, [
|
|
35
|
+
return getNameText((_b = (_a = servicesList.filter((service) => service.code.toLowerCase() === decodeURIComponent(serviceCode).toLowerCase())) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.name, i18n.language);
|
|
36
|
+
}, [servicesList, i18n.language, serviceCode]);
|
|
39
37
|
useEffect(() => {
|
|
40
38
|
setSelectedOption(activeTabTitle);
|
|
41
39
|
}, [activeTabTitle]);
|
|
@@ -47,14 +45,14 @@ function AppServices({ appInfo, userApp, onChangeAppServiceCode, onClickServiceI
|
|
|
47
45
|
setInitServicesWidth(((_a = servicesRef.current) === null || _a === void 0 ? void 0 : _a.offsetWidth) + iconSize + iconGap + iconMargin);
|
|
48
46
|
}, []);
|
|
49
47
|
useEffect(() => {
|
|
50
|
-
setIsDropdown(Number(
|
|
51
|
-
}, [
|
|
52
|
-
const navigateToService = (
|
|
53
|
-
|
|
48
|
+
setIsDropdown(Number(dimensions.width) < initServicesWidth + 10);
|
|
49
|
+
}, [dimensions.width, initServicesWidth]);
|
|
50
|
+
const navigateToService = (newServiceCode) => {
|
|
51
|
+
onChangeServiceCode === null || onChangeServiceCode === void 0 ? void 0 : onChangeServiceCode(newServiceCode);
|
|
54
52
|
setOpenDropdown(false);
|
|
55
53
|
};
|
|
56
54
|
const renderValue = (selected) => _jsx(StyledSelectComponent, { children: selected });
|
|
57
|
-
return (_jsxs(Wrapper, Object.assign({ maximized:
|
|
55
|
+
return (_jsxs(Wrapper, Object.assign({ maximized: isMaximized }, { children: [!!services.length && !isDropdown && (_jsx(Box, Object.assign({ ref: servicesRef, display: "flex", gap: "8px", flexDirection: "row", sx: { userSelect: 'none' } }, { children: services.map((service, idx) => (_jsx(ServiceItem, { activeCode: serviceCode, onClickServiceItem: onClickServiceItem, navigateToMenuItem: navigateToService, name: getNameText(service.name, i18n.language) || '', code: service.code }, `service-item-${service.code}-${idx}`))) }))), !!services.length && isDropdown && (_jsx(StyledSelect, Object.assign({ open: openDropdown, onClick: handleOpenDropdown, displayEmpty: true, inputProps: { 'aria-label': 'Without label' }, MenuProps: {
|
|
58
56
|
anchorOrigin: {
|
|
59
57
|
vertical: 40,
|
|
60
58
|
horizontal: 83,
|
|
@@ -74,7 +72,7 @@ function AppServices({ appInfo, userApp, onChangeAppServiceCode, onClickServiceI
|
|
|
74
72
|
paddingTop: '0px !important',
|
|
75
73
|
paddingBottom: '0px !important',
|
|
76
74
|
},
|
|
77
|
-
} }, { children: services.map((service) => {
|
|
75
|
+
} }, { children: services.map((service, idx) => {
|
|
78
76
|
var _a;
|
|
79
77
|
if (((_a = getNameText(service.name, i18n.language)) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.toLowerCase())) {
|
|
80
78
|
return null;
|
|
@@ -83,7 +81,7 @@ function AppServices({ appInfo, userApp, onChangeAppServiceCode, onClickServiceI
|
|
|
83
81
|
e.preventDefault();
|
|
84
82
|
e.stopPropagation();
|
|
85
83
|
navigateToService(service.code);
|
|
86
|
-
} }, { children: _jsx(StyledMenuTitle, { children: getNameText(service.name, i18n.language) }) })));
|
|
84
|
+
} }, { children: _jsx(StyledMenuTitle, { children: getNameText(service.name, i18n.language) }) }), `option-${service.code}-${idx}`));
|
|
87
85
|
}) })))] })));
|
|
88
86
|
}
|
|
89
87
|
export default memo(AppServices);
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { AppDetails } from '../../types/index.js';
|
|
3
2
|
export interface ServiceItemProps {
|
|
4
|
-
|
|
3
|
+
activeCode: string;
|
|
5
4
|
isDropdown?: boolean;
|
|
6
5
|
name: string;
|
|
7
6
|
code: string;
|
|
8
|
-
onDropdownClick?: () => void;
|
|
9
7
|
navigateToMenuItem: (serviceCode: string) => void;
|
|
10
8
|
onClickServiceItem?: (code: string) => void;
|
|
11
9
|
}
|
|
12
|
-
declare function ServiceItem({ isDropdown, name, code,
|
|
10
|
+
declare function ServiceItem({ isDropdown, name, code, activeCode, navigateToMenuItem, onClickServiceItem }: Readonly<ServiceItemProps>): import("react/jsx-runtime").JSX.Element;
|
|
13
11
|
declare const _default: import("react").MemoExoticComponent<typeof ServiceItem>;
|
|
14
12
|
export default _default;
|
|
@@ -5,7 +5,7 @@ import { DropdownMenu, Icon } from '../index.js';
|
|
|
5
5
|
import { isInsightService } from '../../utils/index.js';
|
|
6
6
|
import { homeIcon, newWindowIcon } from '../../constants/index.js';
|
|
7
7
|
import { ServiceItemStyled } from './style';
|
|
8
|
-
function ServiceItem({ isDropdown = false, name, code,
|
|
8
|
+
function ServiceItem({ isDropdown = false, name, code, activeCode, navigateToMenuItem, onClickServiceItem }) {
|
|
9
9
|
const [anchorEl, setAnchorEl] = useState(null);
|
|
10
10
|
const { t } = useTranslation();
|
|
11
11
|
const open = Boolean(anchorEl);
|
|
@@ -13,7 +13,7 @@ function ServiceItem({ isDropdown = false, name, code, appInfo, onDropdownClick,
|
|
|
13
13
|
setAnchorEl(null);
|
|
14
14
|
};
|
|
15
15
|
const isHomeService = isInsightService(code);
|
|
16
|
-
return (_jsxs(_Fragment, { children: [_jsx(ServiceItemStyled, Object.assign({ isDropdown: isDropdown, className:
|
|
16
|
+
return (_jsxs(_Fragment, { children: [_jsx(ServiceItemStyled, Object.assign({ isDropdown: isDropdown, className: activeCode.toLowerCase() === code.toLowerCase() ? 'active' : '', onClick: (e) => {
|
|
17
17
|
e.preventDefault();
|
|
18
18
|
e.stopPropagation();
|
|
19
19
|
navigateToMenuItem(code);
|
|
@@ -31,8 +31,6 @@ function ServiceItem({ isDropdown = false, name, code, appInfo, onDropdownClick,
|
|
|
31
31
|
e.stopPropagation();
|
|
32
32
|
onClickServiceItem === null || onClickServiceItem === void 0 ? void 0 : onClickServiceItem(code);
|
|
33
33
|
handleClose();
|
|
34
|
-
if (onDropdownClick)
|
|
35
|
-
onDropdownClick();
|
|
36
34
|
},
|
|
37
35
|
},
|
|
38
36
|
] })] }));
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DragControls } from 'framer-motion';
|
|
3
|
+
import { SxProps, Theme } from '@mui/material/styles';
|
|
4
|
+
import { AppService } from '../../types/index.js';
|
|
5
|
+
export interface AppServicesBarProps {
|
|
6
|
+
appCode: string;
|
|
7
|
+
services: AppService[];
|
|
8
|
+
isMaximized: boolean;
|
|
9
|
+
dimensions: {
|
|
10
|
+
width: number | string;
|
|
11
|
+
};
|
|
12
|
+
features: {
|
|
13
|
+
sandboxMode: boolean;
|
|
14
|
+
initialServiceCode?: string;
|
|
15
|
+
};
|
|
16
|
+
ui: {
|
|
17
|
+
onStartDrag: DragControls['start'];
|
|
18
|
+
};
|
|
19
|
+
onChangeServiceCode: (serviceCode: string) => void;
|
|
20
|
+
onClickServiceItem: (code: string) => void;
|
|
21
|
+
sx?: SxProps<Theme>;
|
|
22
|
+
}
|
|
23
|
+
declare function AppServicesBar({ appCode, services, isMaximized, dimensions, features: { initialServiceCode }, ui: { onStartDrag }, onChangeServiceCode, onClickServiceItem, sx, }: Readonly<AppServicesBarProps>): import("react/jsx-runtime").JSX.Element | null;
|
|
24
|
+
declare const _default: import("react").MemoExoticComponent<typeof AppServicesBar>;
|
|
25
|
+
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { memo, useCallback, useState } from 'react';
|
|
3
|
+
import { AppServices } from '../index.js';
|
|
4
|
+
import { StyledAppHeaderWrapper } from '../Toolbar/style';
|
|
5
|
+
function AppServicesBar({ appCode, services, isMaximized, dimensions, features: { initialServiceCode }, ui: { onStartDrag }, onChangeServiceCode, onClickServiceItem, sx, }) {
|
|
6
|
+
const [isDragging, setIsDragging] = useState(false);
|
|
7
|
+
const onPointerDown = useCallback((e) => {
|
|
8
|
+
onStartDrag === null || onStartDrag === void 0 ? void 0 : onStartDrag(e);
|
|
9
|
+
setIsDragging(true);
|
|
10
|
+
}, [onStartDrag, setIsDragging]);
|
|
11
|
+
const onPointerUp = () => {
|
|
12
|
+
setIsDragging(false);
|
|
13
|
+
};
|
|
14
|
+
if (!appCode || !services.length)
|
|
15
|
+
return null;
|
|
16
|
+
return (_jsx(StyledAppHeaderWrapper, Object.assign({ id: "app-header-wrapper", onPointerDown: onPointerDown, onPointerUp: onPointerUp, isDragging: isDragging, sx: sx }, { children: _jsx(AppServices, { onClickServiceItem: onClickServiceItem, dimensions: { width: dimensions.width }, serviceCode: initialServiceCode !== null && initialServiceCode !== void 0 ? initialServiceCode : '', services: services, isMaximized: isMaximized, appCode: appCode, onChangeServiceCode: onChangeServiceCode }) })));
|
|
17
|
+
}
|
|
18
|
+
export default memo(AppServicesBar);
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const AppContainerHeader: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
3
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
4
|
+
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
import { ListLayoutStyled } from './styles';
|
|
3
|
+
interface ListLayoutProps extends ComponentPropsWithoutRef<typeof ListLayoutStyled> {
|
|
4
|
+
}
|
|
5
|
+
declare function ListLayout({ children, ...props }: Readonly<ListLayoutProps>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare namespace ListLayout {
|
|
7
|
+
var displayName: string;
|
|
8
|
+
}
|
|
9
|
+
declare const _default: import("react").MemoExoticComponent<typeof ListLayout>;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { memo } from 'react';
|
|
14
|
+
import { ListLayoutStyled } from './styles';
|
|
15
|
+
function ListLayout(_a) {
|
|
16
|
+
var { children } = _a, props = __rest(_a, ["children"]);
|
|
17
|
+
return (_jsx(ListLayoutStyled, Object.assign({ component: 'article', "data-testid": 'ListLayout' }, props, { children: children })));
|
|
18
|
+
}
|
|
19
|
+
ListLayout.displayName = 'ListLayout';
|
|
20
|
+
export default memo(ListLayout);
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const ListLayoutStyled: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
3
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
4
|
+
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
@@ -9,12 +9,12 @@ export declare const StyledInput: import("@emotion/styled").StyledComponent<{
|
|
|
9
9
|
color?: string | undefined;
|
|
10
10
|
content?: string | undefined;
|
|
11
11
|
translate?: "yes" | "no" | undefined;
|
|
12
|
+
name?: string | undefined;
|
|
12
13
|
value?: string | number | readonly string[] | undefined;
|
|
13
14
|
list?: string | undefined;
|
|
14
15
|
form?: string | undefined;
|
|
15
16
|
slot?: string | undefined;
|
|
16
17
|
title?: string | undefined;
|
|
17
|
-
name?: string | undefined;
|
|
18
18
|
className?: string | undefined;
|
|
19
19
|
pattern?: string | undefined;
|
|
20
20
|
defaultChecked?: boolean | undefined;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ToggleViews, ToggleViewsValues } from './types';
|
|
3
|
+
declare const DEFAULT_TOGGLE_VIEWS: {
|
|
4
|
+
icon: import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
value: ToggleViews;
|
|
6
|
+
}[];
|
|
7
|
+
export interface ToggleViewProps {
|
|
8
|
+
onToggleClick: (view: ToggleViewsValues) => void;
|
|
9
|
+
currentView: ToggleViewsValues;
|
|
10
|
+
getOverrideViews?: (defaultViews: typeof DEFAULT_TOGGLE_VIEWS) => {
|
|
11
|
+
icon: React.ReactNode;
|
|
12
|
+
value: ToggleViewsValues;
|
|
13
|
+
}[];
|
|
14
|
+
}
|
|
15
|
+
declare const ToggleView: (props: ToggleViewProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
16
|
+
export default ToggleView;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cardViewButtonIcon, listViewButtonIcon } from '../../constants/index.js';
|
|
3
|
+
import { ActiveOverlay, ViewButton } from './style';
|
|
4
|
+
import { ToggleViews } from './types';
|
|
5
|
+
import { useMemo } from 'react';
|
|
6
|
+
import ToggleWrapper from './ToggleWrapper';
|
|
7
|
+
const DEFAULT_TOGGLE_VIEWS = [
|
|
8
|
+
{
|
|
9
|
+
icon: _jsx("img", { src: cardViewButtonIcon, alt: "card" }),
|
|
10
|
+
value: ToggleViews.CARDS,
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
icon: _jsx("img", { src: listViewButtonIcon, alt: ToggleViews.LIST }),
|
|
14
|
+
value: ToggleViews.LIST,
|
|
15
|
+
},
|
|
16
|
+
];
|
|
17
|
+
const ToggleView = (props) => {
|
|
18
|
+
const { currentView, onToggleClick, getOverrideViews } = props;
|
|
19
|
+
const views = useMemo(() => {
|
|
20
|
+
if (getOverrideViews)
|
|
21
|
+
return getOverrideViews(DEFAULT_TOGGLE_VIEWS);
|
|
22
|
+
return DEFAULT_TOGGLE_VIEWS;
|
|
23
|
+
}, [getOverrideViews]);
|
|
24
|
+
const viewIndex = useMemo(() => views.findIndex((view) => view.value === currentView), [views, currentView]);
|
|
25
|
+
if (!onToggleClick)
|
|
26
|
+
return null;
|
|
27
|
+
return (_jsxs(ToggleWrapper, { children: [views.map((view) => (_jsx(ViewButton, Object.assign({ onClick: () => onToggleClick(view.value), sx: {
|
|
28
|
+
height: '11.6px',
|
|
29
|
+
width: '11.6px',
|
|
30
|
+
}, isActive: currentView === view.value }, { children: view.icon }), view.value))), _jsx(ActiveOverlay, { activeIndex: viewIndex })] }));
|
|
31
|
+
};
|
|
32
|
+
export default ToggleView;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { ToggleWrapperStyled } from './style';
|
|
4
|
+
const ToggleWrapper = (props) => {
|
|
5
|
+
const viewTogglers = React.Children.count(props.children) - 1;
|
|
6
|
+
return _jsx(ToggleWrapperStyled, Object.assign({}, props, { sx: { width: viewTogglers * 30 + 2 } }));
|
|
7
|
+
};
|
|
8
|
+
export default ToggleWrapper;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const ToggleWrapperStyled: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
3
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
4
|
+
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
5
|
+
export declare const ViewButton: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").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").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
8
|
+
isActive: boolean;
|
|
9
|
+
}, {}, {}>;
|
|
10
|
+
export declare const ActiveOverlay: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
11
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
12
|
+
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
13
|
+
activeIndex: number;
|
|
14
|
+
}, {}, {}>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Box, styled } from '@mui/material';
|
|
2
|
+
export const ToggleWrapperStyled = styled(Box)(({ theme }) => ({
|
|
3
|
+
height: '32px',
|
|
4
|
+
borderRadius: '4px',
|
|
5
|
+
backgroundColor: theme.palette.action.hover,
|
|
6
|
+
padding: '2px',
|
|
7
|
+
display: 'flex',
|
|
8
|
+
alignItems: 'center',
|
|
9
|
+
position: 'relative',
|
|
10
|
+
cursor: 'pointer'
|
|
11
|
+
}));
|
|
12
|
+
export const ViewButton = styled(Box, { shouldForwardProp: (props) => props !== 'isActive' })(({ isActive }) => ({
|
|
13
|
+
flex: 1,
|
|
14
|
+
display: 'flex',
|
|
15
|
+
justifyContent: 'center',
|
|
16
|
+
alignItems: 'center',
|
|
17
|
+
position: 'relative',
|
|
18
|
+
zIndex: 2,
|
|
19
|
+
opacity: isActive ? 1 : 0.5
|
|
20
|
+
}));
|
|
21
|
+
export const ActiveOverlay = styled(Box, { shouldForwardProp: (props) => props !== 'activeIndex' })(({ theme, activeIndex }) => ({
|
|
22
|
+
position: 'absolute',
|
|
23
|
+
top: 2,
|
|
24
|
+
left: activeIndex * 30 + 2,
|
|
25
|
+
transition: 'all 0.25s ease-in-out',
|
|
26
|
+
width: '28px',
|
|
27
|
+
height: '28px',
|
|
28
|
+
backgroundColor: theme.palette.common.white,
|
|
29
|
+
borderRadius: '2px',
|
|
30
|
+
boxShadow: '0px 0px 4px 0px rgba(0, 0, 0, 0.20)'
|
|
31
|
+
}));
|
|
@@ -13,6 +13,12 @@ export declare const StyledHeaderWrapper: import("@emotion/styled").StyledCompon
|
|
|
13
13
|
maximized?: boolean | undefined;
|
|
14
14
|
isDragging?: boolean | undefined;
|
|
15
15
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
16
|
+
export declare const StyledAppHeaderWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
17
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
18
|
+
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
|
|
19
|
+
sandboxMode?: boolean | undefined;
|
|
20
|
+
isDragging?: boolean | undefined;
|
|
21
|
+
}, {}, {}>;
|
|
16
22
|
export declare const ToolbarStyled: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
17
23
|
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
18
24
|
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
|
|
@@ -44,6 +44,11 @@ export const StyledHeaderWrapper = styled('div', {
|
|
|
44
44
|
})), (isDragging && {
|
|
45
45
|
cursor: 'move',
|
|
46
46
|
})), { margin: 0 })));
|
|
47
|
+
export const StyledAppHeaderWrapper = styled(Box, {
|
|
48
|
+
shouldForwardProp: (prop) => prop !== 'maximized' && prop !== 'isDragging',
|
|
49
|
+
})(({ isDragging }) => (Object.assign(Object.assign({}, (isDragging && {
|
|
50
|
+
cursor: 'move',
|
|
51
|
+
})), { margin: 0 })));
|
|
47
52
|
export const ToolbarStyled = styled(Box, {
|
|
48
53
|
shouldForwardProp: (props) => props !== 'maximized' && props !== 'isHovered',
|
|
49
54
|
})(({ theme, maximized }) => (Object.assign(Object.assign({ height: 32, position: 'relative', display: 'flex', width: '100%', justifyContent: 'center', transition: 'all 0.5s ease-in-out', borderTopLeftRadius: '12px', borderTopRightRadius: '12px' }, (maximized && {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ISheetViewVirtualTable } from './types';
|
|
3
|
-
declare function SheetViewVirtualTable({ columns, rows, threshold, showHeader, headerProps, rowProps, footerProps, rowHeight, isLoading, error, columnsSorting, onColumnSort, loadMoreItems, isFetchingNextPage, triggerDataRefetch, scrollToIndex, areAllRowsLoaded, tableBodyStyles, tableTitle,
|
|
3
|
+
declare function SheetViewVirtualTable({ columns, rows, threshold, showHeader, headerProps, rowProps, footerProps, rowHeight, isLoading, error, columnsSorting, onColumnSort, loadMoreItems, isFetchingNextPage, triggerDataRefetch, scrollToIndex, areAllRowsLoaded, tableBodyStyles, tableTitle, onStartDrag, onColumnPin, clearBackdropVisibilityTimeout, isPinnable, tableMode, overscanCount, }: Readonly<ISheetViewVirtualTable>): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
declare const _default: import("react").MemoExoticComponent<typeof SheetViewVirtualTable>;
|
|
5
5
|
export default _default;
|
|
@@ -6,7 +6,7 @@ import { SheetViewTableContainer } from '../components/style';
|
|
|
6
6
|
import { SheetViewVirtualTableWrapper } from './style';
|
|
7
7
|
import { usePinnedColumns, useSynchronizedScroll, useTableState, useTableData, useVirtualTableContainer, usePinnedColumnsWidths } from './hooks';
|
|
8
8
|
import { PinnedColumn, MainTable, LoadingMainTable, NoDataView, VirtualTable } from './components';
|
|
9
|
-
function SheetViewVirtualTable({ columns, rows, threshold = SHEET_VIEW_TABLE_THRESHOLD, showHeader, headerProps, rowProps, footerProps, rowHeight = 28, isLoading, error, columnsSorting, onColumnSort, loadMoreItems, isFetchingNextPage, triggerDataRefetch, scrollToIndex, areAllRowsLoaded = false, tableBodyStyles, tableTitle,
|
|
9
|
+
function SheetViewVirtualTable({ columns, rows, threshold = SHEET_VIEW_TABLE_THRESHOLD, showHeader, headerProps, rowProps, footerProps, rowHeight = 28, isLoading, error, columnsSorting, onColumnSort, loadMoreItems, isFetchingNextPage, triggerDataRefetch, scrollToIndex, areAllRowsLoaded = false, tableBodyStyles, tableTitle, onStartDrag, onColumnPin, clearBackdropVisibilityTimeout = 100, isPinnable = false, tableMode, overscanCount, }) {
|
|
10
10
|
const { selectedCell, selectedColumn, selectedRow, showBackDrop, setShowBackdrop, handleCellClick, handleColumnClick, handleChipClick, selectedChip, } = useTableState();
|
|
11
11
|
const { isError, tableLoading, tableError, tableEmpty, hasTimeoutError, showNoDataView, lastItemIndex, areTotalRowsNotFillingHeight, itemsCount, isDelayedFetchingNextPage, } = useTableData({
|
|
12
12
|
rows,
|
|
@@ -35,7 +35,7 @@ function SheetViewVirtualTable({ columns, rows, threshold = SHEET_VIEW_TABLE_THR
|
|
|
35
35
|
handleChipClick,
|
|
36
36
|
});
|
|
37
37
|
const onPointerDown = (e) => {
|
|
38
|
-
|
|
38
|
+
onStartDrag === null || onStartDrag === void 0 ? void 0 : onStartDrag(e);
|
|
39
39
|
};
|
|
40
40
|
const createVirtualTableContainer = useCallback((columnsData, containerKey, isPinned = false, fixedWidth) => {
|
|
41
41
|
const listRef = containerKey === 'pinnedStart' ? pinnedStartVirtualListRef : containerKey === 'pinnedEnd' ? pinnedEndVirtualListRef : scrollableVirtualListRef;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { IVirtualTable } from '../../../types/index.js';
|
|
3
|
-
declare function VirtualTable({ columns, rows, threshold, showHeader, headerProps, rowProps, footerProps, isLoading, error, columnsSorting, onColumnSort, loadMoreItems, isFetchingNextPage, triggerDataRefetch, scrollToIndex, areAllRowsLoaded, tableBodyStyles, tableMode, tableTitle,
|
|
3
|
+
declare function VirtualTable({ columns, rows, threshold, showHeader, headerProps, rowProps, footerProps, isLoading, error, columnsSorting, onColumnSort, loadMoreItems, isFetchingNextPage, triggerDataRefetch, scrollToIndex, areAllRowsLoaded, tableBodyStyles, tableMode, tableTitle, onStartDrag, isSheetView, isMinimized, }: Readonly<IVirtualTable>): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
declare const _default: import("react").MemoExoticComponent<typeof VirtualTable>;
|
|
5
5
|
export default _default;
|
|
@@ -34,11 +34,11 @@ const createItemData = memoize((columns, isLoading, rows, rowProps, scrollToInde
|
|
|
34
34
|
areAllRowsLoaded,
|
|
35
35
|
isSheetView,
|
|
36
36
|
}));
|
|
37
|
-
function VirtualTable({ columns, rows, threshold = TABLE_THRESHOLD, showHeader, headerProps, rowProps, footerProps, isLoading, error, columnsSorting, onColumnSort, loadMoreItems, isFetchingNextPage, triggerDataRefetch, scrollToIndex, areAllRowsLoaded = false, tableBodyStyles, tableMode, tableTitle,
|
|
37
|
+
function VirtualTable({ columns, rows, threshold = TABLE_THRESHOLD, showHeader, headerProps, rowProps, footerProps, isLoading, error, columnsSorting, onColumnSort, loadMoreItems, isFetchingNextPage, triggerDataRefetch, scrollToIndex, areAllRowsLoaded = false, tableBodyStyles, tableMode, tableTitle, onStartDrag, isSheetView = false, isMinimized, }) {
|
|
38
38
|
var _a;
|
|
39
39
|
const theme = useTheme();
|
|
40
40
|
const onPointerDown = (e) => {
|
|
41
|
-
|
|
41
|
+
onStartDrag === null || onStartDrag === void 0 ? void 0 : onStartDrag(e);
|
|
42
42
|
};
|
|
43
43
|
const isDelayedFetchingNextPage = useDelayToSetValue({
|
|
44
44
|
value: isFetchingNextPage,
|
|
@@ -8,6 +8,6 @@ export interface VirtualTableWithCardProps extends Omit<IVirtualTable, 'showHead
|
|
|
8
8
|
tableHeight: number;
|
|
9
9
|
tableHeaderHeight?: number;
|
|
10
10
|
}
|
|
11
|
-
declare function VirtualTableWithCard({ rows, threshold, rowProps, footerProps, rowHeight, isLoading, error, tableHeader, loadMoreItems, isFetchingNextPage, triggerDataRefetch, scrollToIndex, areAllRowsLoaded, tableBodyStyles, tableMode, tableTitle, renderCardComponent, cardLoadingComponent, tableHeight, tableHeaderHeight, noDataComponent,
|
|
11
|
+
declare function VirtualTableWithCard({ rows, threshold, rowProps, footerProps, rowHeight, isLoading, error, tableHeader, loadMoreItems, isFetchingNextPage, triggerDataRefetch, scrollToIndex, areAllRowsLoaded, tableBodyStyles, tableMode, tableTitle, renderCardComponent, cardLoadingComponent, tableHeight, tableHeaderHeight, noDataComponent, onStartDrag, }: Readonly<VirtualTableWithCardProps>): import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
declare const _default: import("react").MemoExoticComponent<typeof VirtualTableWithCard>;
|
|
13
13
|
export default _default;
|
|
@@ -32,11 +32,11 @@ const createItemData = memoize((isLoading, rows, rowProps, scrollToIndex, lastIt
|
|
|
32
32
|
areAllRowsLoaded,
|
|
33
33
|
renderCardComponent,
|
|
34
34
|
}));
|
|
35
|
-
function VirtualTableWithCard({ rows, threshold = TABLE_THRESHOLD, rowProps, footerProps, rowHeight = TABLE_ROW_HEIGHT, isLoading, error, tableHeader, loadMoreItems, isFetchingNextPage, triggerDataRefetch, scrollToIndex, areAllRowsLoaded = false, tableBodyStyles, tableMode, tableTitle, renderCardComponent, cardLoadingComponent, tableHeight, tableHeaderHeight, noDataComponent,
|
|
35
|
+
function VirtualTableWithCard({ rows, threshold = TABLE_THRESHOLD, rowProps, footerProps, rowHeight = TABLE_ROW_HEIGHT, isLoading, error, tableHeader, loadMoreItems, isFetchingNextPage, triggerDataRefetch, scrollToIndex, areAllRowsLoaded = false, tableBodyStyles, tableMode, tableTitle, renderCardComponent, cardLoadingComponent, tableHeight, tableHeaderHeight, noDataComponent, onStartDrag, }) {
|
|
36
36
|
var _a;
|
|
37
37
|
const theme = useTheme();
|
|
38
38
|
const onPointerDown = (e) => {
|
|
39
|
-
|
|
39
|
+
onStartDrag === null || onStartDrag === void 0 ? void 0 : onStartDrag(e);
|
|
40
40
|
};
|
|
41
41
|
const isDelayedFetchingNextPage = useDelayToSetValue({
|
|
42
42
|
value: isFetchingNextPage,
|
|
@@ -146,7 +146,7 @@ export const SheetViewTableContainer = styled(Box)(() => ({
|
|
|
146
146
|
position: 'relative',
|
|
147
147
|
display: 'flex',
|
|
148
148
|
flexDirection: 'column',
|
|
149
|
-
height: '
|
|
149
|
+
height: 'calc(100vh - 300px)',
|
|
150
150
|
paddingInline: '28px',
|
|
151
151
|
borderRadius: '8px',
|
|
152
152
|
marginBottom: '16px !important',
|
|
@@ -97,6 +97,10 @@ export { default as AppServices } from './AppServices';
|
|
|
97
97
|
export { default as ScrollLoader } from './ScrollLoader';
|
|
98
98
|
export * from './ScrollLoader';
|
|
99
99
|
export * from './TooltipChip';
|
|
100
|
+
export { default as ListLayout } from './ListLayout';
|
|
101
|
+
export * from './ListLayout';
|
|
102
|
+
export { default as ToggleView } from './ToggleView';
|
|
103
|
+
export * from './ToggleView';
|
|
100
104
|
export * from './RightLeftExpandingCenterChip';
|
|
101
105
|
export { default as StatusChipWithCopy } from './StatusChipWithCopy';
|
|
102
106
|
export * from './RadioButton';
|
|
@@ -106,3 +110,5 @@ export { default as ColorPicker } from './ColorPicker';
|
|
|
106
110
|
export { default as WindowBackdrop } from './WindowBackdrop';
|
|
107
111
|
export { default as LazyImage } from './LazyImage';
|
|
108
112
|
export * from './LazyImage';
|
|
113
|
+
export { default as AppServicesBar } from './AppServicesBar';
|
|
114
|
+
export * from './AppServicesBar';
|
|
@@ -97,6 +97,10 @@ export { default as AppServices } from './AppServices';
|
|
|
97
97
|
export { default as ScrollLoader } from './ScrollLoader';
|
|
98
98
|
export * from './ScrollLoader';
|
|
99
99
|
export * from './TooltipChip';
|
|
100
|
+
export { default as ListLayout } from './ListLayout';
|
|
101
|
+
export * from './ListLayout';
|
|
102
|
+
export { default as ToggleView } from './ToggleView';
|
|
103
|
+
export * from './ToggleView';
|
|
100
104
|
export * from './RightLeftExpandingCenterChip';
|
|
101
105
|
export { default as StatusChipWithCopy } from './StatusChipWithCopy';
|
|
102
106
|
export * from './RadioButton';
|
|
@@ -106,3 +110,5 @@ export { default as ColorPicker } from './ColorPicker';
|
|
|
106
110
|
export { default as WindowBackdrop } from './WindowBackdrop';
|
|
107
111
|
export { default as LazyImage } from './LazyImage';
|
|
108
112
|
export * from './LazyImage';
|
|
113
|
+
export { default as AppServicesBar } from './AppServicesBar';
|
|
114
|
+
export * from './AppServicesBar';
|
package/build/constants/apps.js
CHANGED
package/build/types/apps.d.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { ColumnsView } from './column';
|
|
2
|
-
import { TextAndLang } from './user';
|
|
2
|
+
import { Segment, SegmentCountry, TextAndLang } from './user';
|
|
3
3
|
import { BusinessMerchant } from './merchant';
|
|
4
|
+
import type { i18n } from 'i18next';
|
|
5
|
+
import type { DragControls } from 'framer-motion';
|
|
6
|
+
import { Theme } from '@mui/material';
|
|
7
|
+
import { CalenderMode } from './theme';
|
|
8
|
+
import { Timezone } from './appConfig';
|
|
4
9
|
export interface AccountAppPayload {
|
|
5
10
|
disabledAccountDataFetching?: boolean;
|
|
6
11
|
isAccountDetailsOpen: boolean;
|
|
@@ -63,3 +68,47 @@ export interface UserApp {
|
|
|
63
68
|
name: TextAndLang[];
|
|
64
69
|
app_services: AppService[];
|
|
65
70
|
}
|
|
71
|
+
export type MFWidgetBaseProps = {
|
|
72
|
+
id: string;
|
|
73
|
+
i18n?: i18n;
|
|
74
|
+
app?: UserApp;
|
|
75
|
+
appWindow: {
|
|
76
|
+
isMinimized: boolean;
|
|
77
|
+
isMaximized: boolean;
|
|
78
|
+
order: number;
|
|
79
|
+
dimensions: Pick<AppDetails['dimensions'], 'width' | 'height'>;
|
|
80
|
+
};
|
|
81
|
+
features: {
|
|
82
|
+
hasReportsApp: boolean;
|
|
83
|
+
hasHeader: boolean;
|
|
84
|
+
sandboxMode: boolean;
|
|
85
|
+
initialServiceCode?: string;
|
|
86
|
+
};
|
|
87
|
+
segment: Pick<Segment, 'id' | 'brands' | 'countries'> & {
|
|
88
|
+
defaultCountry?: SegmentCountry;
|
|
89
|
+
};
|
|
90
|
+
ui: {
|
|
91
|
+
theme: Theme;
|
|
92
|
+
onStartDrag: DragControls['start'];
|
|
93
|
+
};
|
|
94
|
+
calendar: {
|
|
95
|
+
mode: CalenderMode;
|
|
96
|
+
onSwitch: (mode: CalenderMode) => void;
|
|
97
|
+
};
|
|
98
|
+
navigation: {
|
|
99
|
+
openAppService: (navigation: {
|
|
100
|
+
id?: string;
|
|
101
|
+
appCode: string;
|
|
102
|
+
serviceCode: string;
|
|
103
|
+
}) => void;
|
|
104
|
+
openApp: (app: Pick<AppDetails, 'appCode' | 'serviceCode' | 'payload'> & {
|
|
105
|
+
sandboxMode?: boolean;
|
|
106
|
+
}) => void;
|
|
107
|
+
};
|
|
108
|
+
timezone: {
|
|
109
|
+
current?: Timezone | null;
|
|
110
|
+
default?: Timezone;
|
|
111
|
+
onChange: (timezone: Timezone) => void;
|
|
112
|
+
onChangeHistory: (timezone: Timezone) => void;
|
|
113
|
+
};
|
|
114
|
+
};
|
package/build/types/table.d.ts
CHANGED
package/build/utils/style.js
CHANGED
|
@@ -31,6 +31,10 @@ export const getSelectionStyles = ({ isSelected, isCellSelected, isColumnSelecte
|
|
|
31
31
|
const getRowSelectionStyles = () => ({
|
|
32
32
|
backgroundColor: SELECTION_COLORS.background,
|
|
33
33
|
color: SELECTION_COLORS.primary,
|
|
34
|
+
border: 'none',
|
|
35
|
+
'&:before': {
|
|
36
|
+
border: 'none',
|
|
37
|
+
},
|
|
34
38
|
});
|
|
35
39
|
const getSingleCellSelectionStyles = () => ({
|
|
36
40
|
border: `${BORDER_STYLES.thin} solid ${SELECTION_COLORS.primary}`,
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tap-payments/os-micro-frontend-shared",
|
|
3
3
|
"description": "Shared components and utilities for Tap Payments micro frontends",
|
|
4
|
-
"version": "0.1.96-test.
|
|
5
|
-
"testVersion":
|
|
4
|
+
"version": "0.1.96-test.12",
|
|
5
|
+
"testVersion": 12,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|
|
9
9
|
"types": "build/index.d.ts",
|
|
10
10
|
"exports": {
|
|
11
|
+
"./package.json": "./package.json",
|
|
11
12
|
".": {
|
|
12
13
|
"types": "./build/index.d.ts",
|
|
13
14
|
"import": "./build/index.js",
|
|
@@ -127,6 +128,32 @@
|
|
|
127
128
|
"vite": "6.0.5",
|
|
128
129
|
"vite-tsconfig-paths": "^4.2.0"
|
|
129
130
|
},
|
|
131
|
+
"peerDependencies": {
|
|
132
|
+
"react": "^18",
|
|
133
|
+
"react-dom": "^18",
|
|
134
|
+
"@mui/material": "^5",
|
|
135
|
+
"@emotion/react": "^11",
|
|
136
|
+
"@emotion/styled": "^11",
|
|
137
|
+
"framer-motion": "^10",
|
|
138
|
+
"react-hook-form": "^7",
|
|
139
|
+
"@hookform/resolvers": "^3",
|
|
140
|
+
"react-router-dom": "^7",
|
|
141
|
+
"i18next": "^22",
|
|
142
|
+
"react-i18next": "^12",
|
|
143
|
+
"react-multi-date-picker": "^4",
|
|
144
|
+
"dayjs": "^1",
|
|
145
|
+
"react-dropzone": "^14",
|
|
146
|
+
"react-hot-toast": "^2",
|
|
147
|
+
"recharts": "^2",
|
|
148
|
+
"react-window": "^1.8",
|
|
149
|
+
"react-window-infinite-loader": "^1",
|
|
150
|
+
"react-virtualized-auto-sizer": "^1",
|
|
151
|
+
"re-resizable": "^6",
|
|
152
|
+
"react-draggable": "^4",
|
|
153
|
+
"react-currency-input-field": "^3",
|
|
154
|
+
"react18-input-otp": "^1",
|
|
155
|
+
"@uiw/react-json-view": "^2.0.0-alpha"
|
|
156
|
+
},
|
|
130
157
|
"lint-staged": {
|
|
131
158
|
"src/**/*.{ts,tsx,json,js,jsx}": [
|
|
132
159
|
"yarn run prettier:fix",
|