@fixefy/fixefy-ui-components 0.3.22 → 0.3.24

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.
@@ -79,7 +79,10 @@ const PublicIcon = ({ icon, width, height, onClick, variant, fontSize, backgroun
79
79
  alt: "",
80
80
  width: width,
81
81
  height: height,
82
- loader: imageLoader,
82
+ loader: ()=>//@ts-ignore
83
+ (0, _fixefyuiutils.imageLoader)({
84
+ src: icon
85
+ }),
83
86
  src: icon,
84
87
  onLoad: ()=>handleError(false),
85
88
  onError: ()=>handleError(true),
@@ -109,9 +112,3 @@ const parseIconFromLibrary = ({ icon, width, height, onClick, variant, fontSize,
109
112
  background: background
110
113
  });
111
114
  };
112
- const imageLoader = ({ src })=>{
113
- const transformedSrc = src.split('/');
114
- transformedSrc.splice(transformedSrc.length - 1, 1, transformedSrc[transformedSrc.length - 1].split(/(?=[A-Z])/).join('_').toLowerCase());
115
- const url = transformedSrc.join('/');
116
- return `${process.env.NEXT_PUBLIC_ASSET_URL}/${url}`;
117
- };
@@ -1,8 +1,7 @@
1
1
  import React from 'react';
2
2
  import { SxProps } from '@mui/system';
3
- export declare const LazyIcon: ({ icon, root, width, height, }: {
3
+ export declare const LazyIcon: ({ icon, width, height, }: {
4
4
  icon: string;
5
- root?: string;
6
5
  width?: number | `${number}`;
7
6
  height?: number | `${number}`;
8
7
  sx?: SxProps;
@@ -13,19 +13,6 @@ const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
13
13
  const _material = require("@mui/material");
14
14
  const _fixefyuiutils = require("@fixefy/fixefy-ui-utils");
15
15
  const _image = /*#__PURE__*/ _interop_require_default(require("next/image"));
16
- function _define_property(obj, key, value) {
17
- if (key in obj) {
18
- Object.defineProperty(obj, key, {
19
- value: value,
20
- enumerable: true,
21
- configurable: true,
22
- writable: true
23
- });
24
- } else {
25
- obj[key] = value;
26
- }
27
- return obj;
28
- }
29
16
  function _interop_require_default(obj) {
30
17
  return obj && obj.__esModule ? obj : {
31
18
  default: obj
@@ -72,46 +59,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
72
59
  }
73
60
  return newObj;
74
61
  }
75
- function _object_spread(target) {
76
- for(var i = 1; i < arguments.length; i++){
77
- var source = arguments[i] != null ? arguments[i] : {};
78
- var ownKeys = Object.keys(source);
79
- if (typeof Object.getOwnPropertySymbols === "function") {
80
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
81
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
82
- }));
83
- }
84
- ownKeys.forEach(function(key) {
85
- _define_property(target, key, source[key]);
86
- });
87
- }
88
- return target;
89
- }
90
- function ownKeys(object, enumerableOnly) {
91
- var keys = Object.keys(object);
92
- if (Object.getOwnPropertySymbols) {
93
- var symbols = Object.getOwnPropertySymbols(object);
94
- if (enumerableOnly) {
95
- symbols = symbols.filter(function(sym) {
96
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
97
- });
98
- }
99
- keys.push.apply(keys, symbols);
100
- }
101
- return keys;
102
- }
103
- function _object_spread_props(target, source) {
104
- source = source != null ? source : {};
105
- if (Object.getOwnPropertyDescriptors) {
106
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
107
- } else {
108
- ownKeys(Object(source)).forEach(function(key) {
109
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
110
- });
111
- }
112
- return target;
113
- }
114
- const LazyIcon = ({ icon, root, width, height })=>{
62
+ const LazyIcon = ({ icon, width, height })=>{
115
63
  const [isError, setError] = (0, _react.useState)(false);
116
64
  const handleError = (isError)=>setError(isError);
117
65
  if (isError) {
@@ -127,9 +75,10 @@ const LazyIcon = ({ icon, root, width, height })=>{
127
75
  alt: icon,
128
76
  width: width,
129
77
  height: height,
130
- loader: (obj)=>(0, _fixefyuiutils.imageLoader)(_object_spread_props(_object_spread({}, obj), {
131
- root
132
- })),
78
+ //@ts-ignore
79
+ loader: (obj)=>(0, _fixefyuiutils.imageLoader)({
80
+ src: icon
81
+ }),
133
82
  src: icon,
134
83
  onLoad: ()=>handleError(false),
135
84
  onError: ()=>handleError(true)
@@ -121,7 +121,6 @@ function FxProgressCounter(_param) {
121
121
  width: 16,
122
122
  height: 16,
123
123
  loader: ()=>(0, _fixefyuiutils.imageLoader)({
124
- root: 'https://cdn-dev.fixefy.me/',
125
124
  src: 'invoices/approve-small-white.svg'
126
125
  }),
127
126
  src: 'invoices/approve-small-white.svg',
@@ -32,8 +32,8 @@ function FxTodo({ todo }) {
32
32
  alt: todo.title,
33
33
  width: 16,
34
34
  height: 16,
35
- loader: ()=>(0, _fixefyuiutils.imageLoader)({
36
- root: 'https://cdn-dev.fixefy.me/',
35
+ loader: ()=>//@ts-ignore
36
+ (0, _fixefyuiutils.imageLoader)({
37
37
  src: 'invoices/severity_low.svg'
38
38
  }),
39
39
  src: `invoices/severity_${todo.priority}.svg`,
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  },
6
6
  "dependencies": {
7
7
  "@apollo/client": "3.10.4",
8
- "@fixefy/fixefy-ui-utils": "0.2.46",
8
+ "@fixefy/fixefy-ui-utils": "0.2.47",
9
9
  "@mui/icons-material": "5.16.7",
10
10
  "@mui/lab": "6.0.0-beta.7",
11
11
  "@mui/material": "5.16.7",
@@ -67,5 +67,5 @@
67
67
  "require": "./dist/index.js"
68
68
  }
69
69
  },
70
- "version": "0.3.22"
70
+ "version": "0.3.24"
71
71
  }