@tap-payments/os-micro-frontend-shared 0.1.82 → 0.1.84
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/LazyImage/LazyImage.d.ts +3 -0
- package/build/components/LazyImage/LazyImage.js +39 -0
- package/build/components/LazyImage/index.d.ts +3 -0
- package/build/components/LazyImage/index.js +3 -0
- package/build/components/index.d.ts +2 -0
- package/build/components/index.js +2 -0
- package/build/constants/table/cell/terminalsTableCellWidth.d.ts +3 -3
- package/build/constants/table/cell/terminalsTableCellWidth.js +3 -3
- package/package.json +3 -1
|
@@ -0,0 +1,39 @@
|
|
|
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 { useEffect, useState } from 'react';
|
|
14
|
+
import { LazyLoadImage as RawLazyLoadImage } from 'react-lazy-load-image-component';
|
|
15
|
+
const LazyLoadImage = RawLazyLoadImage;
|
|
16
|
+
const EFFECT_ASSETS_MAPPER = {
|
|
17
|
+
opacity: () => import('react-lazy-load-image-component/src/effects/opacity.css'),
|
|
18
|
+
blur: () => import('react-lazy-load-image-component/src/effects/blur.css'),
|
|
19
|
+
'black-and-white': () => import('react-lazy-load-image-component/src/effects/black-and-white.css'),
|
|
20
|
+
};
|
|
21
|
+
const LazyImage = (props) => {
|
|
22
|
+
const { wrapperProps } = props, rest = __rest(props, ["wrapperProps"]);
|
|
23
|
+
const { effect } = rest;
|
|
24
|
+
const { style } = wrapperProps || {};
|
|
25
|
+
const [cssEffectAssetsLoading, setCssEffectAssetsLoading] = useState(!!effect);
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
if (!effect || !(effect in EFFECT_ASSETS_MAPPER))
|
|
28
|
+
return;
|
|
29
|
+
const getResources = EFFECT_ASSETS_MAPPER[effect];
|
|
30
|
+
setCssEffectAssetsLoading(true);
|
|
31
|
+
getResources().finally(() => {
|
|
32
|
+
setCssEffectAssetsLoading(false);
|
|
33
|
+
});
|
|
34
|
+
}, [effect]);
|
|
35
|
+
if (cssEffectAssetsLoading)
|
|
36
|
+
return null;
|
|
37
|
+
return (_jsx(LazyLoadImage, Object.assign({}, rest, { wrapperProps: Object.assign(Object.assign({}, wrapperProps), { style: Object.assign({ display: 'flex', justifyContent: 'center', alignItems: 'center' }, style) }) })));
|
|
38
|
+
};
|
|
39
|
+
export default LazyImage;
|
|
@@ -104,3 +104,5 @@ export * from './RadioGroup';
|
|
|
104
104
|
export * from './LeftPeekRightExpandingChip';
|
|
105
105
|
export { default as ColorPicker } from './ColorPicker';
|
|
106
106
|
export { default as WindowBackdrop } from './WindowBackdrop';
|
|
107
|
+
export { default as LazyImage } from './LazyImage';
|
|
108
|
+
export * from './LazyImage';
|
|
@@ -104,3 +104,5 @@ export * from './RadioGroup';
|
|
|
104
104
|
export * from './LeftPeekRightExpandingChip';
|
|
105
105
|
export { default as ColorPicker } from './ColorPicker';
|
|
106
106
|
export { default as WindowBackdrop } from './WindowBackdrop';
|
|
107
|
+
export { default as LazyImage } from './LazyImage';
|
|
108
|
+
export * from './LazyImage';
|
|
@@ -30,9 +30,9 @@ export declare const terminalsTableCellWidth: {
|
|
|
30
30
|
readonly sheet: "80px";
|
|
31
31
|
};
|
|
32
32
|
readonly features: {
|
|
33
|
-
readonly default: "
|
|
34
|
-
readonly text: "
|
|
35
|
-
readonly sheet: "
|
|
33
|
+
readonly default: "100px";
|
|
34
|
+
readonly text: "100px";
|
|
35
|
+
readonly sheet: "100px";
|
|
36
36
|
};
|
|
37
37
|
readonly acceptance: {
|
|
38
38
|
readonly default: "80px";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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.
|
|
4
|
+
"version": "0.1.84",
|
|
5
5
|
"testVersion": 1,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
@@ -94,6 +94,7 @@
|
|
|
94
94
|
"react-hook-form": "^7.45.4",
|
|
95
95
|
"react-hot-toast": "^2.4.1",
|
|
96
96
|
"react-i18next": "^12.2.2",
|
|
97
|
+
"react-lazy-load-image-component": "^1.6.3",
|
|
97
98
|
"react-multi-date-picker": "^4.1.2",
|
|
98
99
|
"react-router-dom": "^7.7.0",
|
|
99
100
|
"react-virtualized-auto-sizer": "^1.0.20",
|
|
@@ -108,6 +109,7 @@
|
|
|
108
109
|
"@types/lodash": "^4.17.15",
|
|
109
110
|
"@types/react": "^18.2.6",
|
|
110
111
|
"@types/react-dom": "^18.3.5",
|
|
112
|
+
"@types/react-lazy-load-image-component": "^1.6.4",
|
|
111
113
|
"@types/react-virtualized-auto-sizer": "^1.0.8",
|
|
112
114
|
"@types/react-window": "^1.8.5",
|
|
113
115
|
"@types/react-window-infinite-loader": "^1.0.6",
|