@tap-payments/os-micro-frontend-shared 0.1.226-test.1 → 0.1.226-test.3
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/build/components/Autocomplete/Autocomplete.d.ts +10 -0
- package/build/components/Autocomplete/Autocomplete.js +33 -0
- package/build/components/Autocomplete/index.d.ts +2 -0
- package/build/components/Autocomplete/index.js +1 -0
- package/build/components/Autocomplete/style.d.ts +4 -0
- package/build/components/Autocomplete/style.js +47 -0
- package/build/types/appEvents.d.ts +4 -4
- package/build/types/apps.d.ts +7 -6
- package/build/types/index.d.ts +1 -0
- package/build/types/index.js +1 -0
- package/build/types/tsUtils.d.ts +4 -0
- package/build/types/tsUtils.js +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AutocompleteRenderInputParams, AutocompleteProps as MuiAutocompleteProps } from '@mui/material/Autocomplete';
|
|
3
|
+
import { TextFieldProps } from '@mui/material/TextField';
|
|
4
|
+
import { MakeOptional } from 'src/types/tsUtils';
|
|
5
|
+
export type AutocompleteProps<Value = string, Multiple extends boolean | undefined = false, DisableClearable extends boolean | undefined = false, FreeSolo extends boolean | undefined = false, ChipComponent extends React.ElementType = 'div'> = {
|
|
6
|
+
label?: TextFieldProps['label'];
|
|
7
|
+
textFieldProps?: TextFieldProps | ((params: AutocompleteRenderInputParams) => TextFieldProps);
|
|
8
|
+
} & MakeOptional<MuiAutocompleteProps<Value, Multiple, DisableClearable, FreeSolo, ChipComponent>, 'renderInput'>;
|
|
9
|
+
declare const Autocomplete: <Value = string, Multiple extends boolean | undefined = false, DisableClearable extends boolean | undefined = false, FreeSolo extends boolean | undefined = false, ChipComponent extends React.ElementType<any, keyof React.JSX.IntrinsicElements> = "div">(props: AutocompleteProps<Value, Multiple, DisableClearable, FreeSolo, ChipComponent>) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export default Autocomplete;
|
|
@@ -0,0 +1,33 @@
|
|
|
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 { useCallback } from 'react';
|
|
14
|
+
import MuiAutocomplete from '@mui/material/Autocomplete';
|
|
15
|
+
import Box from '@mui/material/Box';
|
|
16
|
+
import { PopperStyled, AutocompleteTextFieldStyled as TextField } from './style';
|
|
17
|
+
import { blackRightArrowIcon } from '../../constants/index.js';
|
|
18
|
+
const Autocomplete = (props) => {
|
|
19
|
+
const { options, value, onChange, label, renderInput, slotProps, textFieldProps } = props, rest = __rest(props, ["options", "value", "onChange", "label", "renderInput", "slotProps", "textFieldProps"]);
|
|
20
|
+
const defaultRenderInput = useCallback((params) => {
|
|
21
|
+
const fieldProps = typeof textFieldProps === 'function' ? textFieldProps(params) : textFieldProps;
|
|
22
|
+
return _jsx(TextField, Object.assign({}, params, fieldProps, { label: label }));
|
|
23
|
+
}, [textFieldProps, label]);
|
|
24
|
+
return (_jsx(MuiAutocomplete, Object.assign({ options: options, value: value, onChange: onChange, popupIcon: _jsx(Box, { component: "img", src: blackRightArrowIcon, sx: { transform: 'rotate(90deg)' }, width: 8, alt: "close" }), renderInput: renderInput || defaultRenderInput, PopperComponent: PopperStyled }, rest, { slotProps: Object.assign(Object.assign({}, slotProps), { popper: Object.assign({ modifiers: [
|
|
25
|
+
{
|
|
26
|
+
name: 'offset',
|
|
27
|
+
options: {
|
|
28
|
+
offset: [0, 4],
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
] }, slotProps === null || slotProps === void 0 ? void 0 : slotProps.popper) }) })));
|
|
32
|
+
};
|
|
33
|
+
export default Autocomplete;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Autocomplete } from './Autocomplete';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import TextField from '@mui/material/TextField';
|
|
3
|
+
export declare const AutocompleteTextFieldStyled: typeof TextField;
|
|
4
|
+
export declare const PopperStyled: import("react").ForwardRefExoticComponent<import("@mui/material/Popper").PopperProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { styled } from '@mui/material/styles';
|
|
2
|
+
import { autocompleteClasses } from '@mui/material/Autocomplete';
|
|
3
|
+
import TextField from '@mui/material/TextField';
|
|
4
|
+
import Popper from '@mui/material/Popper';
|
|
5
|
+
export const AutocompleteTextFieldStyled = styled(TextField)({
|
|
6
|
+
'& .MuiInputBase-root': {
|
|
7
|
+
paddingTop: 13,
|
|
8
|
+
paddingBottom: 13,
|
|
9
|
+
borderRadius: 4,
|
|
10
|
+
'& .MuiOutlinedInput-notchedOutline': {
|
|
11
|
+
borderWidth: 1,
|
|
12
|
+
borderStyle: 'solid',
|
|
13
|
+
borderColor: '#F2F2F2',
|
|
14
|
+
},
|
|
15
|
+
'&:hover': {
|
|
16
|
+
'& .MuiOutlinedInput-notchedOutline': {
|
|
17
|
+
borderColor: '#F2F2F2',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
'&.Mui-focused': {
|
|
21
|
+
'& .MuiOutlinedInput-notchedOutline': {
|
|
22
|
+
borderColor: '#1F88D0',
|
|
23
|
+
boxShadow: '0px 0px 4px 0px #1F88D080',
|
|
24
|
+
},
|
|
25
|
+
'&:hover': {
|
|
26
|
+
'& .MuiOutlinedInput-notchedOutline': {
|
|
27
|
+
borderColor: '#1F88D0',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
[`& .${autocompleteClasses.input}`]: {
|
|
32
|
+
fontSize: 11,
|
|
33
|
+
paddingTop: 0,
|
|
34
|
+
paddingBottom: 0,
|
|
35
|
+
paddingLeft: 0,
|
|
36
|
+
},
|
|
37
|
+
[`& .${autocompleteClasses.endAdornment}`]: {
|
|
38
|
+
marginRight: 8,
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
export const PopperStyled = styled(Popper)({
|
|
43
|
+
fontSize: 11,
|
|
44
|
+
borderRadius: '8px',
|
|
45
|
+
border: '1px solid #F2F2F2',
|
|
46
|
+
boxShadow: '0px 2px 56px 0px #20232B24',
|
|
47
|
+
});
|
|
@@ -17,14 +17,14 @@ export type CustomEventMap = {
|
|
|
17
17
|
payload?: object;
|
|
18
18
|
};
|
|
19
19
|
}) => void;
|
|
20
|
-
'modify-remote-payload': (params: {
|
|
21
|
-
instanceId: string;
|
|
22
|
-
payload: object;
|
|
23
|
-
}) => void;
|
|
24
20
|
'on-toggle-table-mode': () => void;
|
|
25
21
|
'on-change-table-mode': (tableMode: TableMode) => void;
|
|
26
22
|
'on-change-calender-mode': (calenderMode: CalenderMode) => void;
|
|
27
23
|
'on-change-timezone': (timezone: Timezone) => void;
|
|
28
24
|
'on-navigate': NavigateFunction;
|
|
29
25
|
'on-start-drag': (...args: Parameters<DragControls['start']>) => void;
|
|
26
|
+
'on-modify-remote-payload': (params: {
|
|
27
|
+
windowId: string;
|
|
28
|
+
payload: object;
|
|
29
|
+
}) => void;
|
|
30
30
|
};
|
package/build/types/apps.d.ts
CHANGED
|
@@ -69,15 +69,14 @@ export interface UserApp {
|
|
|
69
69
|
app_services: AppService[];
|
|
70
70
|
}
|
|
71
71
|
export type NavigateFunction = (params: {
|
|
72
|
-
|
|
73
|
-
appId?: string;
|
|
72
|
+
windowId?: string;
|
|
74
73
|
appCode: string;
|
|
75
74
|
serviceCode: string;
|
|
76
75
|
sandboxMode?: boolean;
|
|
77
76
|
state?: any;
|
|
78
77
|
}) => void;
|
|
79
78
|
export type MFWidgetBaseProps = {
|
|
80
|
-
|
|
79
|
+
windowId: string;
|
|
81
80
|
i18n?: i18n;
|
|
82
81
|
app: UserApp;
|
|
83
82
|
appWindow: {
|
|
@@ -96,6 +95,8 @@ export type MFWidgetBaseProps = {
|
|
|
96
95
|
initialPayload?: Record<string, any> & AppPayload;
|
|
97
96
|
};
|
|
98
97
|
segment: {
|
|
98
|
+
code: string;
|
|
99
|
+
type: string;
|
|
99
100
|
brands: Brand[];
|
|
100
101
|
countries: SegmentCountry[];
|
|
101
102
|
defaultCountry: SegmentCountry;
|
|
@@ -104,10 +105,10 @@ export type MFWidgetBaseProps = {
|
|
|
104
105
|
isBusinessSegment: boolean;
|
|
105
106
|
isAnyMerchantHasMarketplace: boolean;
|
|
106
107
|
};
|
|
107
|
-
|
|
108
|
+
selectedSegment: {
|
|
108
109
|
id: string;
|
|
109
|
-
|
|
110
|
-
|
|
110
|
+
selectedBrands: SelectedBrand[];
|
|
111
|
+
selectedCountries: SelectedCountry[];
|
|
111
112
|
};
|
|
112
113
|
ui: {
|
|
113
114
|
theme: Theme;
|
package/build/types/index.d.ts
CHANGED
package/build/types/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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.226-test.
|
|
5
|
-
"testVersion":
|
|
4
|
+
"version": "0.1.226-test.3",
|
|
5
|
+
"testVersion": 3,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|