@tap-payments/os-micro-frontend-shared 0.0.36 → 0.0.39
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/OTPInput/OTPInput.d.ts +1 -1
- package/build/components/OTPInput/OTPInput.js +6 -3
- package/build/components/OTPInput/style.d.ts +0 -1
- package/build/components/OTPInput/style.js +0 -1
- package/build/components/SearchButton/styles.d.ts +1 -1
- package/build/components/TableCells/CustomCells/DestinationCell/DestinationCell.js +2 -2
- package/build/components/TableCells/CustomCells/DestinationCell/styled.js +9 -5
- package/build/components/TableHeader_V2/components/StatusButtons/StatusButton.js +2 -2
- package/build/components/TableHeader_V2/components/StatusButtons/style.d.ts +1 -1
- package/build/components/TableHeader_V2/components/StatusButtons/style.js +1 -1
- package/build/components/TableHeader_V2/index.d.ts +1 -2
- package/build/components/TableHeader_V2/index.js +1 -2
- package/build/components/VirtualTable/components/ColumnFilter/Inputs/Inputs.js +13 -77
- package/build/components/index.d.ts +2 -0
- package/build/components/index.js +2 -0
- package/build/constants/assets.d.ts +2 -0
- package/build/constants/assets.js +2 -0
- package/build/types/table.d.ts +1 -12
- package/build/utils/encrypt.d.ts +1 -0
- package/build/utils/encrypt.js +44 -0
- package/build/utils/freshdesk.d.ts +1 -0
- package/build/utils/freshdesk.js +7 -0
- package/build/utils/index.d.ts +1 -0
- package/build/utils/index.js +1 -0
- package/package.json +130 -130
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" | "style" | "color" | "content" | "translate" | "children" | "ref" | "form" | "slot" | "title" | "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" | "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" | "list" | "value" | "src" | "alt" | "size" | "multiple" | "accept" | "autoComplete" | "capture" | "checked" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "max" | "min" | "minLength" | "
|
|
18
|
+
}, "width" | "height" | "hidden" | "type" | "style" | "color" | "content" | "translate" | "children" | "ref" | "form" | "slot" | "title" | "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" | "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" | "list" | "value" | "name" | "src" | "alt" | "size" | "multiple" | "accept" | "autoComplete" | "capture" | "checked" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "max" | "min" | "minLength" | "readOnly" | "required"> & {
|
|
19
19
|
allowDecimals?: boolean | undefined;
|
|
20
20
|
allowNegativeValue?: boolean | undefined;
|
|
21
21
|
id?: string | undefined;
|
|
@@ -5,6 +5,6 @@ interface OTPInputProps extends Omit<OtpInputProps, 'numInputs' | 'onChange'> {
|
|
|
5
5
|
onChange?: (otp: string) => void;
|
|
6
6
|
onSubmitOtp?: (otp: string) => void;
|
|
7
7
|
}
|
|
8
|
-
declare function OTPInput({ numInputs, separateAfter, isInputSecure, isInputNum, onSubmitOtp, onChange, ...props }: OTPInputProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function OTPInput({ numInputs, separateAfter, isInputSecure, isInputNum, onSubmitOtp, onChange, inputProps, ...props }: OTPInputProps): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
declare const _default: import("react").MemoExoticComponent<typeof OTPInput>;
|
|
10
10
|
export default _default;
|
|
@@ -12,10 +12,10 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import { useState, memo } from 'react';
|
|
14
14
|
import Box from '@mui/material/Box';
|
|
15
|
-
import
|
|
15
|
+
import OtpInput from 'react18-input-otp';
|
|
16
16
|
import { inputFocusStyle, inputStyle, inputErrorStyle, Separator } from './style';
|
|
17
17
|
function OTPInput(_a) {
|
|
18
|
-
var { numInputs = 6, separateAfter = 3, isInputSecure = true, isInputNum = true, onSubmitOtp, onChange } = _a, props = __rest(_a, ["numInputs", "separateAfter", "isInputSecure", "isInputNum", "onSubmitOtp", "onChange"]);
|
|
18
|
+
var { numInputs = 6, separateAfter = 3, isInputSecure = true, isInputNum = true, onSubmitOtp, onChange, inputProps } = _a, props = __rest(_a, ["numInputs", "separateAfter", "isInputSecure", "isInputNum", "onSubmitOtp", "onChange", "inputProps"]);
|
|
19
19
|
const [otp, setOtp] = useState('');
|
|
20
20
|
const handleChange = (enteredOtp) => {
|
|
21
21
|
setOtp(enteredOtp);
|
|
@@ -28,6 +28,9 @@ function OTPInput(_a) {
|
|
|
28
28
|
'::selection': {
|
|
29
29
|
background: 'transparent',
|
|
30
30
|
},
|
|
31
|
-
} }, { children: _jsx(
|
|
31
|
+
} }, { children: _jsx(OtpInput, Object.assign({ inputStyle: Object.assign(Object.assign({}, inputStyle), inputProps), focusStyle: inputFocusStyle, errorStyle: inputErrorStyle, containerStyle: {
|
|
32
|
+
gap: '7px',
|
|
33
|
+
justifyContent: 'space-between',
|
|
34
|
+
}, value: otp, separator: _jsx(Separator, { children: "-" }), isInputNum: isInputNum, isInputSecure: isInputSecure, numInputs: numInputs, separateAfter: separateAfter, shouldAutoFocus: true, onChange: handleChange, autoComplete: "new-password", "aria-autocomplete": "none", inputProps: Object.assign({ autoComplete: 'new-password', 'aria-autocomplete': 'none', pattern: '[0-9]*' }, inputProps) }, props)) })));
|
|
32
35
|
}
|
|
33
36
|
export default memo(OTPInput);
|
|
@@ -269,6 +269,7 @@ export declare const StyledInput: import("@emotion/styled").StyledComponent<{
|
|
|
269
269
|
placeholder?: string | undefined;
|
|
270
270
|
list?: string | undefined;
|
|
271
271
|
value?: string | number | readonly string[] | undefined;
|
|
272
|
+
name?: string | undefined;
|
|
272
273
|
src?: string | undefined;
|
|
273
274
|
alt?: string | undefined;
|
|
274
275
|
size?: number | undefined;
|
|
@@ -286,7 +287,6 @@ export declare const StyledInput: import("@emotion/styled").StyledComponent<{
|
|
|
286
287
|
maxLength?: number | undefined;
|
|
287
288
|
min?: string | number | undefined;
|
|
288
289
|
minLength?: number | undefined;
|
|
289
|
-
name?: string | undefined;
|
|
290
290
|
readOnly?: boolean | undefined;
|
|
291
291
|
required?: boolean | undefined;
|
|
292
292
|
step?: string | number | undefined;
|
|
@@ -11,7 +11,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import Tooltip from '../../../Tooltip';
|
|
14
|
-
import {
|
|
14
|
+
import { destinationSolidIcon } from '../../../../constants/index.js';
|
|
15
15
|
import { formatAmount } from '../../../../utils/index.js';
|
|
16
16
|
import { DestinationCellContainer, DestinationCount, StyledDestinationCell, StyledDestinationIcon } from './styled';
|
|
17
17
|
import TableCell from '../../TableCell';
|
|
@@ -33,6 +33,6 @@ function DestinationCell(_a) {
|
|
|
33
33
|
return (_jsx(TableCell, Object.assign({ sx: {
|
|
34
34
|
width: 'fit-content',
|
|
35
35
|
overflow: 'visible',
|
|
36
|
-
} }, props, { children: _jsx(Tooltip, Object.assign({ title: destinationsTooltip }, { children: !isTextShown ? (_jsxs(StyledDestinationCell, { children: [_jsx(StyledDestinationIcon, { src:
|
|
36
|
+
} }, props, { children: _jsx(Tooltip, Object.assign({ title: destinationsTooltip }, { children: !isTextShown ? (_jsxs(StyledDestinationCell, { children: [_jsx(StyledDestinationIcon, { src: destinationSolidIcon, pointLeft: iconDirection === 'left' }), destinationsCount > 1 && (_jsx(DestinationCellContainer, Object.assign({ destinationsCount: 1 }, { children: _jsx(DestinationCount, { children: destinationsCount }) })))] })) : (textView) })) })));
|
|
37
37
|
}
|
|
38
38
|
export default DestinationCell;
|
|
@@ -10,19 +10,23 @@ export const DestinationCellContainer = styled('span')(({ theme, destinationsCou
|
|
|
10
10
|
}));
|
|
11
11
|
export const DestinationCount = styled('span')(({ theme }) => ({
|
|
12
12
|
fontSize: theme.typography.pxToRem(12),
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
backgroundColor: theme.palette.common.white,
|
|
13
|
+
color: theme.palette.info.dark,
|
|
14
|
+
fontWeight: 700,
|
|
16
15
|
paddingInline: theme.spacing(1),
|
|
17
16
|
borderRadius: theme.spacing(1),
|
|
17
|
+
display: 'flex',
|
|
18
|
+
alignItems: 'center',
|
|
19
|
+
justifyContent: 'center',
|
|
20
|
+
backgroundColor: `${theme.palette.info.dark}1A`,
|
|
18
21
|
}));
|
|
19
22
|
export const StyledDestinationCell = styled('span')(({ theme }) => ({
|
|
20
23
|
display: 'flex',
|
|
21
24
|
alignItems: 'center',
|
|
22
25
|
justifyContent: 'flex-start',
|
|
23
26
|
gap: theme.spacing(1),
|
|
24
|
-
backgroundColor:
|
|
25
|
-
|
|
27
|
+
backgroundColor: theme.palette.common.white,
|
|
28
|
+
border: `1px solid ${theme.palette.divider}`,
|
|
29
|
+
paddingInline: theme.spacing(1),
|
|
26
30
|
borderRadius: '56px',
|
|
27
31
|
height: '24px',
|
|
28
32
|
}));
|
|
@@ -15,7 +15,7 @@ import { useTranslation } from 'react-i18next';
|
|
|
15
15
|
import StyledBadge, { BadgeVariants } from '../../../CountBadge';
|
|
16
16
|
import { convertToNumber, formatNumber } from '../../../../utils/index.js';
|
|
17
17
|
import { ChevronIcon } from './ChevronIcon';
|
|
18
|
-
import { ChevronContainer, Label, LabelWrapper,
|
|
18
|
+
import { ChevronContainer, Label, LabelWrapper, StyledStatusIcon, StyledDropdown, statusButtonVariants } from './style';
|
|
19
19
|
import { statusButtonIcons } from './constant';
|
|
20
20
|
export const StatusButton = memo((props) => {
|
|
21
21
|
var _a, _b;
|
|
@@ -30,7 +30,7 @@ export const StatusButton = memo((props) => {
|
|
|
30
30
|
};
|
|
31
31
|
const Button = statusButtonVariants[variant];
|
|
32
32
|
const hasDropdown = dropdownOptions && dropdownOptions.length > 0;
|
|
33
|
-
const statusIcon = icon ? _jsx(
|
|
33
|
+
const statusIcon = icon ? _jsx(StyledStatusIcon, { icon: icon, variant: variant, src: statusButtonIcons[icon], alt: `${icon}-icon` }) : null;
|
|
34
34
|
const statusBadge = badgeCount && !Number.isNaN(convertToNumber(badgeCount)) ? (_jsx(StyledBadge, Object.assign({ variant: variant === 'active' ? BadgeVariants.ACTIVE : BadgeVariants.INACTIVE }, { children: formatNumber(Number(badgeCount)) }))) : null;
|
|
35
35
|
const dropdownIcon = hasDropdown ? _jsx(ChevronIcon, { isActive: variant === 'active' }) : null;
|
|
36
36
|
return (_jsxs(_Fragment, { children: [_jsx(Button, Object.assign({ "data-testid": "StatusButton" }, restProps, { ref: buttonRef, onClick: (e) => {
|
|
@@ -18,7 +18,7 @@ export declare const CountBadge: import("@emotion/styled").StyledComponent<impor
|
|
|
18
18
|
}, keyof import("@mui/system").BoxOwnProps<Theme>> & import("@mui/system").MUIStyledCommonProps<Theme> & {
|
|
19
19
|
variant: StatusButtonVariant;
|
|
20
20
|
}, {}, {}>;
|
|
21
|
-
export declare const
|
|
21
|
+
export declare const StyledStatusIcon: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<Theme> & {
|
|
22
22
|
variant: StatusButtonVariant;
|
|
23
23
|
icon?: "initiated" | "captured" | "unCaptured" | "inProgress" | "abandoned" | "cancelled" | "reversed" | "authorized" | "paidOut" | "unauthenticated" | "authenticated" | "scheduled" | "unSettled" | "search" | "view" | "reports" | "chevronDown" | "unAuthorized" | "openFlag" | "closedFlag" | "textView" | "trashBin" | undefined;
|
|
24
24
|
}, React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
@@ -26,7 +26,7 @@ export const CountBadge = styled(Box)(({ theme, variant }) => ({
|
|
|
26
26
|
fontWeight: 700,
|
|
27
27
|
lineHeight: '10px',
|
|
28
28
|
}));
|
|
29
|
-
export const
|
|
29
|
+
export const StyledStatusIcon = styled('img')(({ theme, variant, icon }) => {
|
|
30
30
|
var _a;
|
|
31
31
|
return (Object.assign(Object.assign({ fill: variant === 'active' ? theme.palette.common.white : theme.palette.text.primary, color: variant === 'active' ? theme.palette.common.white : theme.palette.text.primary }, (!(((_a = ['openFlag', 'closedFlag']) === null || _a === void 0 ? void 0 : _a.includes(icon !== null && icon !== void 0 ? icon : '')) && variant === 'inActive') &&
|
|
32
32
|
icon !== 'captured' && {
|
|
@@ -4,79 +4,30 @@ import Box from '@mui/material/Box';
|
|
|
4
4
|
import Collapse from '@mui/material/Collapse';
|
|
5
5
|
import lodashValues from 'lodash/values';
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
|
7
|
-
import { PhoneInputBase } from '../../../../InputBase';
|
|
8
7
|
import { grayCloseIcon, searchIcon } from '../../../../../constants/index.js';
|
|
9
8
|
import { Wrapper, Text, InputStyled, InputsWrapper, ClearButton, ClearWrapper } from './style';
|
|
10
9
|
import { CancelButton, Footer, OkayButton } from '../style';
|
|
11
10
|
function Inputs({ onCloseDropdown, filter: { options = [], onConfirm, data, isOnlyOneFilter } }) {
|
|
12
11
|
const [values, setValues] = useState({});
|
|
13
12
|
useEffect(() => {
|
|
14
|
-
setValues((options || []).reduce((acc, { apiKey,
|
|
15
|
-
var _a;
|
|
16
|
-
const optionData = data === null || data === void 0 ? void 0 : data[apiKey];
|
|
17
|
-
if (type === 'phone') {
|
|
18
|
-
const phoneData = optionData;
|
|
19
|
-
return Object.assign(Object.assign({}, acc), { [apiKey]: (_a = phoneData === null || phoneData === void 0 ? void 0 : phoneData.phone) !== null && _a !== void 0 ? _a : '', [`${apiKey}_country`]: phoneData === null || phoneData === void 0 ? void 0 : phoneData.country });
|
|
20
|
-
}
|
|
21
|
-
return Object.assign(Object.assign({}, acc), { [apiKey]: optionData !== null && optionData !== void 0 ? optionData : '' });
|
|
22
|
-
}, {}));
|
|
13
|
+
setValues((options || []).reduce((acc, { apiKey }) => { var _a; return (Object.assign(Object.assign({}, acc), { [apiKey]: (_a = data === null || data === void 0 ? void 0 : data[apiKey]) !== null && _a !== void 0 ? _a : '' })); }, {}));
|
|
23
14
|
}, []);
|
|
24
15
|
const { t } = useTranslation();
|
|
25
16
|
const onClickOkay = () => {
|
|
26
|
-
|
|
27
|
-
if (type === 'phone') {
|
|
28
|
-
const phoneValue = values[apiKey];
|
|
29
|
-
const countryValue = values[`${apiKey}_country`];
|
|
30
|
-
if (phoneValue || countryValue) {
|
|
31
|
-
acc[apiKey] = {
|
|
32
|
-
phone: phoneValue || '',
|
|
33
|
-
country: countryValue,
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
const value = values[apiKey];
|
|
39
|
-
if (value !== undefined && value !== '') {
|
|
40
|
-
acc[apiKey] = value;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return acc;
|
|
44
|
-
}, {});
|
|
45
|
-
onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm(transformedValues);
|
|
17
|
+
onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm(values);
|
|
46
18
|
onCloseDropdown();
|
|
47
19
|
};
|
|
48
20
|
const onClickCancel = () => {
|
|
49
21
|
onCloseDropdown();
|
|
50
22
|
};
|
|
51
23
|
const onClickClear = () => {
|
|
52
|
-
setValues(options.reduce((acc, { apiKey
|
|
53
|
-
if (type === 'phone') {
|
|
54
|
-
return Object.assign(Object.assign({}, acc), { [apiKey]: '', [`${apiKey}_country`]: undefined });
|
|
55
|
-
}
|
|
56
|
-
return Object.assign(Object.assign({}, acc), { [apiKey]: '' });
|
|
57
|
-
}, {}));
|
|
24
|
+
setValues(options.reduce((acc, { apiKey }) => (Object.assign(Object.assign({}, acc), { [apiKey]: '' })), {}));
|
|
58
25
|
};
|
|
59
|
-
const isInputHasValue = (key
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
};
|
|
65
|
-
const getInputValue = (key, type) => {
|
|
66
|
-
if (type === 'phone') {
|
|
67
|
-
return values[key] !== undefined && typeof values[key] === 'string' && values[key].length ? values[key] : '';
|
|
68
|
-
}
|
|
69
|
-
return values[key] !== undefined && typeof values[key] === 'string' && values[key].length ? values[key] : '';
|
|
70
|
-
};
|
|
71
|
-
const onClickResetInput = (key, type) => {
|
|
72
|
-
if (isInputHasValue(key, type)) {
|
|
73
|
-
if (type === 'phone') {
|
|
74
|
-
setValues(Object.assign(Object.assign({}, values), { [key]: '', [`${key}_country`]: undefined }));
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
setValues(Object.assign(Object.assign({}, values), { [key]: '' }));
|
|
78
|
-
}
|
|
79
|
-
}
|
|
26
|
+
const isInputHasValue = (key) => values[key] !== undefined && values[key].length > 0;
|
|
27
|
+
const getInputValue = (key) => (values[key] !== undefined && values[key].length ? values[key] : '');
|
|
28
|
+
const onClickResetInput = (key) => {
|
|
29
|
+
if (isInputHasValue(key))
|
|
30
|
+
setValues(Object.assign(Object.assign({}, values), { [key]: '' }));
|
|
80
31
|
};
|
|
81
32
|
const showClearButton = useMemo(() => lodashValues(values).some((x) => Boolean(x)), [values]);
|
|
82
33
|
const getFilterByApiKey = useCallback((apiKey) => {
|
|
@@ -87,29 +38,14 @@ function Inputs({ onCloseDropdown, filter: { options = [], onConfirm, data, isOn
|
|
|
87
38
|
const isAnyInputWithValue = Object.entries(values).some(([inputKey, val]) => { var _a; return Boolean(val) && (((_a = getFilterByApiKey(inputKey)) === null || _a === void 0 ? void 0 : _a.filterGroup) !== filterGroup || !filterGroup); });
|
|
88
39
|
return isOnlyOneFilter && !inputWithValue && isAnyInputWithValue;
|
|
89
40
|
}, [options, values, isOnlyOneFilter]);
|
|
90
|
-
return (_jsxs(Wrapper, Object.assign({ component: "article", "data-testid": "ColumnFilterInputs" }, { children: [_jsx(Text, Object.assign({ component: "header", "data-testid": "ColumnFilterInputs_title" }, { children: t('filterBy') })), _jsx(InputsWrapper, Object.assign({ "data-testid": "ColumnFilterInputs_inputs", component: "main" }, { children: options.map(({ placeholder, apiKey, isDisabled, filterGroup,
|
|
91
|
-
if (
|
|
92
|
-
return
|
|
93
|
-
key: apiKey,
|
|
94
|
-
value: values[apiKey],
|
|
95
|
-
setValue: (value) => {
|
|
96
|
-
setValues(Object.assign(Object.assign({}, values), { [apiKey]: value }));
|
|
97
|
-
},
|
|
98
|
-
isDisabled: isInputDisabled(apiKey, filterGroup),
|
|
99
|
-
getInputValue: (keyToGet) => getInputValue(keyToGet, type),
|
|
100
|
-
isInputHasValue: () => isInputHasValue(apiKey, type),
|
|
101
|
-
onClickReset: () => {
|
|
102
|
-
onClickResetInput(apiKey, type);
|
|
103
|
-
},
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
if (type === 'phone') {
|
|
107
|
-
return (_jsx(PhoneInputBase, { "data-testid": `ColumnFilterInputs_PhoneInput_${apiKey}`, phoneValue: getInputValue(apiKey, 'phone'), onPhoneChange: (val) => setValues(Object.assign(Object.assign({}, values), { [apiKey]: val, [`${apiKey}_country`]: values[`${apiKey}_country`] })), countryValue: values[`${apiKey}_country`], onCountryChange: (country) => setValues(Object.assign(Object.assign({}, values), { [`${apiKey}_country`]: country, [apiKey]: values[apiKey] })), countries: countries || [], isCountriesLoading: isCountriesLoading || false, hasError: false, disabled: isDisabled || isInputDisabled(apiKey, filterGroup), placeholder: placeholder }, apiKey));
|
|
41
|
+
return (_jsxs(Wrapper, Object.assign({ component: "article", "data-testid": "ColumnFilterInputs" }, { children: [_jsx(Text, Object.assign({ component: "header", "data-testid": "ColumnFilterInputs_title" }, { children: t('filterBy') })), _jsx(InputsWrapper, Object.assign({ "data-testid": "ColumnFilterInputs_inputs", component: "main" }, { children: options.map(({ placeholder, apiKey, isDisabled, filterGroup, render }) => {
|
|
42
|
+
if (render) {
|
|
43
|
+
return render();
|
|
108
44
|
}
|
|
109
45
|
return (_jsx(InputStyled, { className: "input", "data-testid": "ColumnFilterInputs_InputStyled", name: apiKey, placeholder: placeholder, onChange: (e) => {
|
|
110
46
|
setValues(Object.assign(Object.assign({}, values), { [apiKey]: e.target.value }));
|
|
111
|
-
}, disabled: isDisabled || isInputDisabled(apiKey, filterGroup), value: getInputValue(apiKey
|
|
112
|
-
onClickResetInput(apiKey
|
|
47
|
+
}, disabled: isDisabled || isInputDisabled(apiKey, filterGroup), value: getInputValue(apiKey), inputProps: { autoComplete: 'off', 'data-testid': 'ColumnFilterInputs_input' }, endAdornment: _jsx(Box, { component: "img", "data-testid": "ColumnFilterInputs_icon", "data-icon": isInputHasValue(apiKey) ? 'close' : 'search', src: isInputHasValue(apiKey) ? grayCloseIcon : searchIcon, alt: "search", className: "icon", sx: { cursor: isInputHasValue(apiKey) ? 'pointer' : 'default' }, onClick: () => {
|
|
48
|
+
onClickResetInput(apiKey);
|
|
113
49
|
} }) }, apiKey));
|
|
114
50
|
}) })), _jsx(Collapse, Object.assign({ in: showClearButton, component: "section", "data-testid": "ColumnFilterInputs_Collapse" }, { children: _jsx(ClearWrapper, Object.assign({ "data-testid": "ColumnFilterInputs_ClearWrapper" }, { children: _jsx(ClearButton, Object.assign({ type: "button", onClick: onClickClear, "data-testid": "ColumnFilterInputs_ClearButton" }, { children: t('clear') })) })) })), _jsxs(Footer, Object.assign({ component: "footer", "data-testid": "ColumnFilterInputs_footer" }, { children: [_jsx(CancelButton, Object.assign({ type: "button", onClick: onClickCancel, "data-testid": "ColumnFilterInputs_CancelButton" }, { children: t('cancel') })), _jsx(OkayButton, Object.assign({ type: "button", onClick: onClickOkay, "data-testid": "ColumnFilterInputs_OkayButton" }, { children: t('okay') }))] }))] })));
|
|
115
51
|
}
|
|
@@ -84,3 +84,5 @@ export { default as OTPInput } from './OTPInput';
|
|
|
84
84
|
export { default as FlagDetails } from './FlagDetails';
|
|
85
85
|
export { default as TapLoader } from './Loaders';
|
|
86
86
|
export { default as Error } from './Error';
|
|
87
|
+
export * from './Chip';
|
|
88
|
+
export * from './TableHeader_V2';
|
|
@@ -84,3 +84,5 @@ export { default as OTPInput } from './OTPInput';
|
|
|
84
84
|
export { default as FlagDetails } from './FlagDetails';
|
|
85
85
|
export { default as TapLoader } from './Loaders';
|
|
86
86
|
export { default as Error } from './Error';
|
|
87
|
+
export * from './Chip';
|
|
88
|
+
export * from './TableHeader_V2';
|
|
@@ -6,6 +6,7 @@ export declare const abandonedIcon: string;
|
|
|
6
6
|
export declare const abandonedYellowIcon: string;
|
|
7
7
|
export declare const chevronDownIcon: string;
|
|
8
8
|
export declare const reversedIcon: string;
|
|
9
|
+
export declare const destinationSolidIcon: string;
|
|
9
10
|
export declare const searchIcon: string;
|
|
10
11
|
export declare const unAuthorizedIcon: string;
|
|
11
12
|
export declare const viewIcon: string;
|
|
@@ -425,6 +426,7 @@ export declare const fileDownloadGreyIcon: string;
|
|
|
425
426
|
export declare const metaIcon: string;
|
|
426
427
|
export declare const darkFilterIcon: string;
|
|
427
428
|
export declare const homeIcon: string;
|
|
429
|
+
export declare const lockIcon: string;
|
|
428
430
|
export declare const autoCapturedIcon: string;
|
|
429
431
|
export declare const autoVoidIcon: string;
|
|
430
432
|
export declare const cancelledIcon: string;
|
|
@@ -7,6 +7,7 @@ export const abandonedIcon = `${lightUrl}/abandoned.svg`;
|
|
|
7
7
|
export const abandonedYellowIcon = `${lightUrl}/abandonedYellow.svg`;
|
|
8
8
|
export const chevronDownIcon = `${lightUrl}/chevron-down.svg`;
|
|
9
9
|
export const reversedIcon = `${lightUrl}/reversed.svg`;
|
|
10
|
+
export const destinationSolidIcon = `${lightUrl}/destinationSolid.svg`;
|
|
10
11
|
export const searchIcon = `${lightUrl}/search.svg`;
|
|
11
12
|
export const unAuthorizedIcon = `${lightUrl}/unauthorized.svg`;
|
|
12
13
|
export const viewIcon = `${lightUrl}/view.svg`;
|
|
@@ -429,6 +430,7 @@ export const fileDownloadGreyIcon = `${lightUrl}/other/fileDownloadGrey.svg`;
|
|
|
429
430
|
export const metaIcon = `${lightUrl}/meta.svg`;
|
|
430
431
|
export const darkFilterIcon = `${lightUrl}/darkFilterIcon.svg`;
|
|
431
432
|
export const homeIcon = `${lightUrl}/home.svg`;
|
|
433
|
+
export const lockIcon = `${lightUrl}/lockIcon.svg`;
|
|
432
434
|
export const autoCapturedIcon = `${lightUrl}/status-v2/autoCapturedNoBG.svg`;
|
|
433
435
|
export const autoVoidIcon = `${lightUrl}/status-v2/autoVoidNoBG.svg`;
|
|
434
436
|
export const cancelledIcon = `${lightUrl}/status-v2/cancelledNoBG.svg`;
|
package/build/types/table.d.ts
CHANGED
|
@@ -67,18 +67,7 @@ export interface IColumnFilterOption {
|
|
|
67
67
|
options?: IColumnFilterOption[];
|
|
68
68
|
isDisabled?: boolean;
|
|
69
69
|
filterGroup?: string;
|
|
70
|
-
|
|
71
|
-
key: string;
|
|
72
|
-
value: unknown;
|
|
73
|
-
setValue: (value: unknown) => void;
|
|
74
|
-
isDisabled?: boolean;
|
|
75
|
-
getInputValue: (key: string, type?: string) => string;
|
|
76
|
-
isInputHasValue: (key: string, type?: string) => boolean;
|
|
77
|
-
onClickReset: (key: string, type?: string) => void;
|
|
78
|
-
}) => React.ReactNode;
|
|
79
|
-
type?: 'text' | 'phone';
|
|
80
|
-
countries?: Country[];
|
|
81
|
-
isCountriesLoading?: boolean;
|
|
70
|
+
render?: () => React.ReactNode;
|
|
82
71
|
}
|
|
83
72
|
export type IColumnListFilterOption = Omit<IColumnFilterOption, 'apiKey' | 'options'> & {
|
|
84
73
|
value: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function encryptDataWithPublicKey(publicKeyPem: string, data: string): Promise<string>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
function encryptWithPublicKey(publicKeyPem, text) {
|
|
11
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
12
|
+
function importPublicKey(pem) {
|
|
13
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
14
|
+
const pemHeader = '-----BEGIN PUBLIC KEY-----';
|
|
15
|
+
const pemFooter = '-----END PUBLIC KEY-----';
|
|
16
|
+
const pemContents = pem.replace(pemHeader, '').replace(pemFooter, '').trim();
|
|
17
|
+
const binaryDerString = atob(pemContents);
|
|
18
|
+
const binaryDer = Uint8Array.from(binaryDerString, (c) => c.charCodeAt(0));
|
|
19
|
+
return yield window.crypto.subtle.importKey('spki', binaryDer.buffer, {
|
|
20
|
+
name: 'RSA-OAEP',
|
|
21
|
+
hash: 'SHA-1',
|
|
22
|
+
}, true, ['encrypt']);
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
const encoder = new TextEncoder();
|
|
26
|
+
const key = yield importPublicKey(publicKeyPem);
|
|
27
|
+
const encryptedBuffer = yield window.crypto.subtle.encrypt({
|
|
28
|
+
name: 'RSA-OAEP',
|
|
29
|
+
}, key, encoder.encode(text));
|
|
30
|
+
const bytes = new Uint8Array(encryptedBuffer);
|
|
31
|
+
let binary = '';
|
|
32
|
+
for (let i = 0; i < bytes.byteLength; i++) {
|
|
33
|
+
binary += String.fromCharCode(bytes[i]);
|
|
34
|
+
}
|
|
35
|
+
return btoa(binary);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
export function encryptDataWithPublicKey(publicKeyPem, data) {
|
|
39
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
+
if (typeof data !== 'string')
|
|
41
|
+
throw new Error('data should be from type string');
|
|
42
|
+
return yield encryptWithPublicKey(publicKeyPem, data);
|
|
43
|
+
});
|
|
44
|
+
}
|
package/build/utils/freshdesk.js
CHANGED
|
@@ -45,3 +45,10 @@ export const setFreshDeskProperties = ({ individualDetails, activeSegment, langu
|
|
|
45
45
|
cf_segment: segmentId,
|
|
46
46
|
});
|
|
47
47
|
};
|
|
48
|
+
export const openFreshDeskChat = () => {
|
|
49
|
+
const fcWidgetObj = window.fcWidget;
|
|
50
|
+
if (!fcWidgetObj) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
fcWidgetObj.open();
|
|
54
|
+
};
|
package/build/utils/index.d.ts
CHANGED
package/build/utils/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,130 +1,130 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@tap-payments/os-micro-frontend-shared",
|
|
3
|
-
"description": "Shared components and utilities for Tap Payments micro frontends",
|
|
4
|
-
"version": "0.0.
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "build/index.js",
|
|
7
|
-
"module": "build/index.js",
|
|
8
|
-
"types": "build/index.d.ts",
|
|
9
|
-
"exports": {
|
|
10
|
-
".": {
|
|
11
|
-
"import": "./build/index.js",
|
|
12
|
-
"require": "./build/index.js",
|
|
13
|
-
"types": "./build/index.d.ts"
|
|
14
|
-
},
|
|
15
|
-
"./constants": {
|
|
16
|
-
"import": "./build/constants/index.js",
|
|
17
|
-
"require": "./build/constants/index.js",
|
|
18
|
-
"types": "./build/constants/index.d.ts"
|
|
19
|
-
},
|
|
20
|
-
"./components": {
|
|
21
|
-
"import": "./build/components/index.js",
|
|
22
|
-
"require": "./build/components/index.js",
|
|
23
|
-
"types": "./build/components/index.d.ts"
|
|
24
|
-
},
|
|
25
|
-
"./components/*": {
|
|
26
|
-
"import": "./build/components/*/index.js",
|
|
27
|
-
"require": "./build/components/*/index.js",
|
|
28
|
-
"types": "./build/components/*/index.d.ts"
|
|
29
|
-
},
|
|
30
|
-
"./hooks": {
|
|
31
|
-
"import": "./build/hooks/index.js",
|
|
32
|
-
"require": "./build/hooks/index.js",
|
|
33
|
-
"types": "./build/hooks/index.d.ts"
|
|
34
|
-
},
|
|
35
|
-
"./utils": {
|
|
36
|
-
"import": "./build/utils/index.js",
|
|
37
|
-
"require": "./build/utils/index.js",
|
|
38
|
-
"types": "./build/utils/index.d.ts"
|
|
39
|
-
},
|
|
40
|
-
"./theme": {
|
|
41
|
-
"import": "./build/theme/index.js",
|
|
42
|
-
"require": "./build/theme/index.js",
|
|
43
|
-
"types": "./build/theme/index.d.ts"
|
|
44
|
-
},
|
|
45
|
-
"./types": {
|
|
46
|
-
"import": "./build/types/index.js",
|
|
47
|
-
"require": "./build/types/index.js",
|
|
48
|
-
"types": "./build/types/index.d.ts"
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
"license": "MIT",
|
|
52
|
-
"author": {
|
|
53
|
-
"name": "Ahmed Sharkawy",
|
|
54
|
-
"email": "a.elsharkawy@tap.company"
|
|
55
|
-
},
|
|
56
|
-
"files": [
|
|
57
|
-
"build",
|
|
58
|
-
"readme.md"
|
|
59
|
-
],
|
|
60
|
-
"scripts": {
|
|
61
|
-
"ts:build": "rm -rf build && tsc -p tsconfig.npm.json && tsc-alias -p tsconfig.npm.json",
|
|
62
|
-
"push": "npm version patch --no-git-tag-version && npm run ts:build && npm publish --access public",
|
|
63
|
-
"dev": "vite",
|
|
64
|
-
"build": "tsc -b && vite build ",
|
|
65
|
-
"prettier": "prettier --list-different \"src/**/*.{md,mdx,ts,js,tsx,jsx,json}\"",
|
|
66
|
-
"prettier:fix": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,md,css,json}\"",
|
|
67
|
-
"lint": "eslint . --color",
|
|
68
|
-
"lint:fix": "eslint src --fix --color",
|
|
69
|
-
"preview": "vite preview",
|
|
70
|
-
"prepare": "husky"
|
|
71
|
-
},
|
|
72
|
-
"dependencies": {
|
|
73
|
-
"@emotion/react": "^11.11.0",
|
|
74
|
-
"@emotion/styled": "^11.11.0",
|
|
75
|
-
"@hookform/resolvers": "^3.3.1",
|
|
76
|
-
"@mui/material": "^5.12.3",
|
|
77
|
-
"@uiw/react-json-view": "^2.0.0-alpha.16",
|
|
78
|
-
"axios": "^1.4.0",
|
|
79
|
-
"dayjs": "^1.11.8",
|
|
80
|
-
"framer-motion": "10.11.0",
|
|
81
|
-
"i18next": "^22.4.15",
|
|
82
|
-
"memoize-one": "^6.0.0",
|
|
83
|
-
"re-resizable": "^6.9.9",
|
|
84
|
-
"react": "^18.2.0",
|
|
85
|
-
"react-currency-input-field": "^3.6.11",
|
|
86
|
-
"react-dom": "^18.2.0",
|
|
87
|
-
"react-draggable": "^4.4.6",
|
|
88
|
-
"react-dropzone": "^14.2.3",
|
|
89
|
-
"react-hook-form": "^7.45.4",
|
|
90
|
-
"react-hot-toast": "^2.4.1",
|
|
91
|
-
"react-i18next": "^12.2.2",
|
|
92
|
-
"react-multi-date-picker": "^4.1.2",
|
|
93
|
-
"react-router-dom": "^6.14.2",
|
|
94
|
-
"react-virtualized-auto-sizer": "^1.0.20",
|
|
95
|
-
"react-window": "^1.8.9",
|
|
96
|
-
"react-window-infinite-loader": "^1.0.9",
|
|
97
|
-
"react18-input-otp": "^1.1.4",
|
|
98
|
-
"recharts": "^2.15.1"
|
|
99
|
-
},
|
|
100
|
-
"devDependencies": {
|
|
101
|
-
"@eslint/js": "^9.17.0",
|
|
102
|
-
"@testing-library/jest-dom": "^5.16.5",
|
|
103
|
-
"@types/lodash": "^4.17.15",
|
|
104
|
-
"@types/react": "^18.2.6",
|
|
105
|
-
"@types/react-dom": "^18.3.5",
|
|
106
|
-
"@types/react-virtualized-auto-sizer": "^1.0.8",
|
|
107
|
-
"@types/react-window": "^1.8.5",
|
|
108
|
-
"@types/react-window-infinite-loader": "^1.0.6",
|
|
109
|
-
"@vitejs/plugin-react": "^4.3.4",
|
|
110
|
-
"eslint": "^9.17.0",
|
|
111
|
-
"eslint-plugin-react-hooks": "^5.0.0",
|
|
112
|
-
"eslint-plugin-react-refresh": "^0.4.16",
|
|
113
|
-
"globals": "^15.14.0",
|
|
114
|
-
"husky": "^8.0.3",
|
|
115
|
-
"lint-staged": "^13.2.2",
|
|
116
|
-
"prettier": "^2.8.8",
|
|
117
|
-
"tsc-alias": "^1.8.16",
|
|
118
|
-
"typescript": "5.0.2",
|
|
119
|
-
"typescript-eslint": "^8.18.2",
|
|
120
|
-
"vite": "6.0.5",
|
|
121
|
-
"vite-plugin-svgr": "^4.3.0",
|
|
122
|
-
"vite-tsconfig-paths": "^4.2.0"
|
|
123
|
-
},
|
|
124
|
-
"lint-staged": {
|
|
125
|
-
"src/**/*.{ts,tsx,json,js,jsx}": [
|
|
126
|
-
"yarn run prettier:fix",
|
|
127
|
-
"yarn run lint"
|
|
128
|
-
]
|
|
129
|
-
}
|
|
130
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@tap-payments/os-micro-frontend-shared",
|
|
3
|
+
"description": "Shared components and utilities for Tap Payments micro frontends",
|
|
4
|
+
"version": "0.0.39",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "build/index.js",
|
|
7
|
+
"module": "build/index.js",
|
|
8
|
+
"types": "build/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./build/index.js",
|
|
12
|
+
"require": "./build/index.js",
|
|
13
|
+
"types": "./build/index.d.ts"
|
|
14
|
+
},
|
|
15
|
+
"./constants": {
|
|
16
|
+
"import": "./build/constants/index.js",
|
|
17
|
+
"require": "./build/constants/index.js",
|
|
18
|
+
"types": "./build/constants/index.d.ts"
|
|
19
|
+
},
|
|
20
|
+
"./components": {
|
|
21
|
+
"import": "./build/components/index.js",
|
|
22
|
+
"require": "./build/components/index.js",
|
|
23
|
+
"types": "./build/components/index.d.ts"
|
|
24
|
+
},
|
|
25
|
+
"./components/*": {
|
|
26
|
+
"import": "./build/components/*/index.js",
|
|
27
|
+
"require": "./build/components/*/index.js",
|
|
28
|
+
"types": "./build/components/*/index.d.ts"
|
|
29
|
+
},
|
|
30
|
+
"./hooks": {
|
|
31
|
+
"import": "./build/hooks/index.js",
|
|
32
|
+
"require": "./build/hooks/index.js",
|
|
33
|
+
"types": "./build/hooks/index.d.ts"
|
|
34
|
+
},
|
|
35
|
+
"./utils": {
|
|
36
|
+
"import": "./build/utils/index.js",
|
|
37
|
+
"require": "./build/utils/index.js",
|
|
38
|
+
"types": "./build/utils/index.d.ts"
|
|
39
|
+
},
|
|
40
|
+
"./theme": {
|
|
41
|
+
"import": "./build/theme/index.js",
|
|
42
|
+
"require": "./build/theme/index.js",
|
|
43
|
+
"types": "./build/theme/index.d.ts"
|
|
44
|
+
},
|
|
45
|
+
"./types": {
|
|
46
|
+
"import": "./build/types/index.js",
|
|
47
|
+
"require": "./build/types/index.js",
|
|
48
|
+
"types": "./build/types/index.d.ts"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"license": "MIT",
|
|
52
|
+
"author": {
|
|
53
|
+
"name": "Ahmed Sharkawy",
|
|
54
|
+
"email": "a.elsharkawy@tap.company"
|
|
55
|
+
},
|
|
56
|
+
"files": [
|
|
57
|
+
"build",
|
|
58
|
+
"readme.md"
|
|
59
|
+
],
|
|
60
|
+
"scripts": {
|
|
61
|
+
"ts:build": "rm -rf build && tsc -p tsconfig.npm.json && tsc-alias -p tsconfig.npm.json",
|
|
62
|
+
"push": "npm version patch --no-git-tag-version && npm run ts:build && npm publish --access public",
|
|
63
|
+
"dev": "vite",
|
|
64
|
+
"build": "tsc -b && vite build ",
|
|
65
|
+
"prettier": "prettier --list-different \"src/**/*.{md,mdx,ts,js,tsx,jsx,json}\"",
|
|
66
|
+
"prettier:fix": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,md,css,json}\"",
|
|
67
|
+
"lint": "eslint . --color",
|
|
68
|
+
"lint:fix": "eslint src --fix --color",
|
|
69
|
+
"preview": "vite preview",
|
|
70
|
+
"prepare": "husky"
|
|
71
|
+
},
|
|
72
|
+
"dependencies": {
|
|
73
|
+
"@emotion/react": "^11.11.0",
|
|
74
|
+
"@emotion/styled": "^11.11.0",
|
|
75
|
+
"@hookform/resolvers": "^3.3.1",
|
|
76
|
+
"@mui/material": "^5.12.3",
|
|
77
|
+
"@uiw/react-json-view": "^2.0.0-alpha.16",
|
|
78
|
+
"axios": "^1.4.0",
|
|
79
|
+
"dayjs": "^1.11.8",
|
|
80
|
+
"framer-motion": "10.11.0",
|
|
81
|
+
"i18next": "^22.4.15",
|
|
82
|
+
"memoize-one": "^6.0.0",
|
|
83
|
+
"re-resizable": "^6.9.9",
|
|
84
|
+
"react": "^18.2.0",
|
|
85
|
+
"react-currency-input-field": "^3.6.11",
|
|
86
|
+
"react-dom": "^18.2.0",
|
|
87
|
+
"react-draggable": "^4.4.6",
|
|
88
|
+
"react-dropzone": "^14.2.3",
|
|
89
|
+
"react-hook-form": "^7.45.4",
|
|
90
|
+
"react-hot-toast": "^2.4.1",
|
|
91
|
+
"react-i18next": "^12.2.2",
|
|
92
|
+
"react-multi-date-picker": "^4.1.2",
|
|
93
|
+
"react-router-dom": "^6.14.2",
|
|
94
|
+
"react-virtualized-auto-sizer": "^1.0.20",
|
|
95
|
+
"react-window": "^1.8.9",
|
|
96
|
+
"react-window-infinite-loader": "^1.0.9",
|
|
97
|
+
"react18-input-otp": "^1.1.4",
|
|
98
|
+
"recharts": "^2.15.1"
|
|
99
|
+
},
|
|
100
|
+
"devDependencies": {
|
|
101
|
+
"@eslint/js": "^9.17.0",
|
|
102
|
+
"@testing-library/jest-dom": "^5.16.5",
|
|
103
|
+
"@types/lodash": "^4.17.15",
|
|
104
|
+
"@types/react": "^18.2.6",
|
|
105
|
+
"@types/react-dom": "^18.3.5",
|
|
106
|
+
"@types/react-virtualized-auto-sizer": "^1.0.8",
|
|
107
|
+
"@types/react-window": "^1.8.5",
|
|
108
|
+
"@types/react-window-infinite-loader": "^1.0.6",
|
|
109
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
110
|
+
"eslint": "^9.17.0",
|
|
111
|
+
"eslint-plugin-react-hooks": "^5.0.0",
|
|
112
|
+
"eslint-plugin-react-refresh": "^0.4.16",
|
|
113
|
+
"globals": "^15.14.0",
|
|
114
|
+
"husky": "^8.0.3",
|
|
115
|
+
"lint-staged": "^13.2.2",
|
|
116
|
+
"prettier": "^2.8.8",
|
|
117
|
+
"tsc-alias": "^1.8.16",
|
|
118
|
+
"typescript": "5.0.2",
|
|
119
|
+
"typescript-eslint": "^8.18.2",
|
|
120
|
+
"vite": "6.0.5",
|
|
121
|
+
"vite-plugin-svgr": "^4.3.0",
|
|
122
|
+
"vite-tsconfig-paths": "^4.2.0"
|
|
123
|
+
},
|
|
124
|
+
"lint-staged": {
|
|
125
|
+
"src/**/*.{ts,tsx,json,js,jsx}": [
|
|
126
|
+
"yarn run prettier:fix",
|
|
127
|
+
"yarn run lint"
|
|
128
|
+
]
|
|
129
|
+
}
|
|
130
|
+
}
|