@unbxd-ui/unbxd-react-components 0.3.3-beta.3 → 0.3.3-beta.4

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.
@@ -4,19 +4,30 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = void 0;
7
- var _react = _interopRequireDefault(require("react"));
8
7
  var _propTypes = _interopRequireDefault(require("prop-types"));
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _lazyLoadImage = _interopRequireDefault(require("../../core/lazyLoadImage"));
9
10
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
10
11
  var NoDataPlaceholder = function NoDataPlaceholder(props) {
11
12
  var className = props.className,
12
13
  image = props.image,
14
+ _props$imageUrl = props.imageUrl,
15
+ imageUrl = _props$imageUrl === void 0 ? "" : _props$imageUrl,
16
+ _props$imageAlt = props.imageAlt,
17
+ imageAlt = _props$imageAlt === void 0 ? "" : _props$imageAlt,
18
+ _props$imageClassname = props.imageClassname,
19
+ imageClassname = _props$imageClassname === void 0 ? "" : _props$imageClassname,
13
20
  title = props.title,
14
21
  description = props.description;
15
22
  return /*#__PURE__*/_react["default"].createElement("div", {
16
23
  className: "RCB-no-data-placeholder ".concat(className)
17
- }, image && /*#__PURE__*/_react["default"].createElement("div", {
24
+ }, (image || imageUrl) && /*#__PURE__*/_react["default"].createElement("div", {
18
25
  className: "RCB-no-data-image"
19
- }, image), title && /*#__PURE__*/_react["default"].createElement("div", {
26
+ }, imageUrl ? /*#__PURE__*/_react["default"].createElement(_lazyLoadImage["default"], {
27
+ src: imageUrl,
28
+ alt: imageAlt || "No data",
29
+ className: imageClassname
30
+ }) : image), title && /*#__PURE__*/_react["default"].createElement("div", {
20
31
  className: "RCB-no-data-title"
21
32
  }, title), description && /*#__PURE__*/_react["default"].createElement("div", {
22
33
  className: "RCB-no-data-description"
@@ -27,6 +38,12 @@ NoDataPlaceholder.propTypes = {
27
38
  className: _propTypes["default"].string,
28
39
  /** React element (typically an image or icon) to display */
29
40
  image: _propTypes["default"].element,
41
+ /** Image URL string for lazy loading */
42
+ imageUrl: _propTypes["default"].string,
43
+ /** Alt text for the lazy loaded image */
44
+ imageAlt: _propTypes["default"].string,
45
+ /** Class name for the lazy loaded image */
46
+ imageClassname: _propTypes["default"].string,
30
47
  /** Title text to display */
31
48
  title: _propTypes["default"].string,
32
49
  /** Description text to display */
@@ -36,6 +36,9 @@ var Default = exports.Default = {
36
36
  src: "https://placehold.co/100",
37
37
  alt: "No Data"
38
38
  }),
39
+ imageUrl: "https://placehold.co/100",
40
+ imageAlt: "No Data Image",
41
+ imageClassname: "",
39
42
  title: 'No Data Available',
40
43
  description: 'There is no data to display at the moment.'
41
44
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unbxd-ui/unbxd-react-components",
3
- "version": "0.3.3-beta.3",
3
+ "version": "0.3.3-beta.4",
4
4
  "description": "React components library",
5
5
  "keywords": [
6
6
  "react components",