@aloudata/aloudata-design 1.9.10 → 1.9.11

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.
@@ -1,3 +1,8 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
4
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
5
+ import classnames from 'classnames';
1
6
  import _ from 'lodash';
2
7
  import React from 'react';
3
8
  export function getTableColumns(_ref) {
@@ -11,14 +16,14 @@ export function getTableColumns(_ref) {
11
16
  accessor: col.dataIndex,
12
17
  Header: typeof col.title === 'string' ? /*#__PURE__*/React.createElement("div", {
13
18
  key: col.dataIndex,
14
- className: prefixCls('th-default')
19
+ className: classnames(prefixCls('th-default'), prefixCls("align-".concat(col.align || 'left')), _defineProperty({}, prefixCls('td-ellipsis-content'), col.ellipsis))
15
20
  }, col.title) : col.title,
16
21
  Cell: function Cell(_ref2) {
17
22
  var row = _ref2.row;
18
23
  var colValue = _.get(row.original, col.dataIndex || '');
19
24
  var node = col.render ? col.render(colValue, row.original, row.index) : colValue;
20
25
  return /*#__PURE__*/React.createElement("div", {
21
- className: prefixCls('td-default')
26
+ className: classnames(prefixCls('td-default'), prefixCls("align-".concat(col.align || 'left')))
22
27
  }, col.ellipsis ? /*#__PURE__*/React.createElement("div", {
23
28
  className: prefixCls('td-ellipsis-content')
24
29
  }, node) : node);
@@ -28,7 +28,11 @@ function AldTable(props) {
28
28
  pagination = props.pagination,
29
29
  _props$scroll = props.scroll,
30
30
  scroll = _props$scroll === void 0 ? {} : _props$scroll,
31
- emptyComponent = props.empty;
31
+ emptyComponent = props.empty,
32
+ _props$rowClassName = props.rowClassName,
33
+ rowClassName = _props$rowClassName === void 0 ? function () {
34
+ return '';
35
+ } : _props$rowClassName;
32
36
  var _useState = useState(null),
33
37
  _useState2 = _slicedToArray(_useState, 2),
34
38
  totalSize = _useState2[0],
@@ -98,10 +102,10 @@ function AldTable(props) {
98
102
  }, /*#__PURE__*/React.createElement(Empty, {
99
103
  title: "No Data",
100
104
  image: Empty.PRESENTED_IMAGE_SEARCH
101
- })) : _.map(rows, function (row) {
105
+ })) : _.map(rows, function (row, rowIndex) {
102
106
  prepareRow(row);
103
107
  return /*#__PURE__*/React.createElement("div", _extends({
104
- className: prefixCls('tr')
108
+ className: classnames(prefixCls('tr'), rowClassName(row.original, rowIndex))
105
109
  }, row.getRowProps()), _.map(row.cells, function (cell) {
106
110
  return /*#__PURE__*/React.createElement("div", _extends({
107
111
  className: prefixCls('td')
@@ -44,7 +44,6 @@
44
44
  position: relative;
45
45
  overflow: hidden;
46
46
  border-bottom: 1px solid #e8e8e8;
47
- background-color: #fff;
48
47
  }
49
48
 
50
49
  .ald-tmp-table-th {
@@ -63,12 +62,12 @@
63
62
  height: 100%;
64
63
  font-size: 13px;
65
64
  min-height: 48px;
65
+ }
66
66
 
67
- .ald-tmp-table-td-ellipsis-content {
68
- overflow: hidden;
69
- text-overflow: ellipsis;
70
- white-space: nowrap;
71
- }
67
+ .ald-tmp-table-td-ellipsis-content {
68
+ overflow: hidden;
69
+ text-overflow: ellipsis;
70
+ white-space: nowrap;
72
71
  }
73
72
 
74
73
  .ald-tmp-table-sticky {
@@ -80,6 +79,27 @@
80
79
 
81
80
  .ald-tmp-table-body {
82
81
  min-height: 200px;
82
+
83
+ .ald-tmp-table-tr:hover {
84
+ background-color: #f4f4f4;
85
+ }
86
+ }
87
+ }
88
+
89
+ .ald-tmp-table-align {
90
+ &-left {
91
+ text-align: left;
92
+ justify-content: left;
93
+ }
94
+
95
+ &-right {
96
+ text-align: right;
97
+ justify-content: right;
98
+ }
99
+
100
+ &-center {
101
+ text-align: center;
102
+ justify-content: center;
83
103
  }
84
104
  }
85
105
 
@@ -15,6 +15,7 @@ export interface ITableProps<TDataItem extends object> {
15
15
  };
16
16
  pagination?: IPaginationProps;
17
17
  empty?: React.ReactNode;
18
+ rowClassName?: (record: TDataItem, index: number) => string;
18
19
  }
19
20
  export interface ITableColumn<TDataItem = unknown> {
20
21
  title: string | React.ReactNode;
@@ -23,4 +24,5 @@ export interface ITableColumn<TDataItem = unknown> {
23
24
  render?: (text: any, record: TDataItem, rowIndex: number) => React.ReactNode;
24
25
  ellipsis?: boolean;
25
26
  noPadding?: boolean;
27
+ align?: 'left' | 'center' | 'right';
26
28
  }
@@ -15,7 +15,7 @@ var CancelCircleDuotone = function CancelCircleDuotone(_ref, ref) {
15
15
  width: props.width || props.size || 16,
16
16
  height: props.height || props.size || 16,
17
17
  fill: "none",
18
- viewBox: "0 0 80 80",
18
+ viewBox: "0 0 24 24",
19
19
  ref: ref,
20
20
  "aria-labelledby": titleId,
21
21
  "aria-describedby": descId
@@ -25,12 +25,12 @@ var CancelCircleDuotone = function CancelCircleDuotone(_ref, ref) {
25
25
  id: titleId
26
26
  }, title) : null, /*#__PURE__*/React.createElement("path", {
27
27
  fill: props.color || 'currentColor',
28
- d: "M40 6.66669C21.4285 6.66669 6.66663 21.4286 6.66663 40C6.66663 58.5715 21.4285 73.3334 40 73.3334C58.5714 73.3334 73.3333 58.5715 73.3333 40C73.3333 21.4286 58.5714 6.66669 40 6.66669Z"
28
+ d: "M12 2C6.429 2 2 6.429 2 12s4.429 10 10 10 10-4.429 10-10S17.571 2 12 2Z"
29
29
  }), /*#__PURE__*/React.createElement("path", {
30
+ fill: props.fill || 'currentColor',
30
31
  fillRule: "evenodd",
31
- clipRule: "evenodd",
32
- d: "M40 37.6431L50.6066 27.0365L52.9636 29.3935L42.357 40.0001L52.9636 50.6067L50.6066 52.9637L40 42.3571L29.3934 52.9637L27.0364 50.6067L37.643 40.0001L27.0364 29.3935L29.3934 27.0365L40 37.6431Z",
33
- fill: props.fill || 'currentColor'
32
+ d: "m17.854 8.854-7 7a.5.5 0 0 1-.708 0l-4-4 .708-.708 3.646 3.647 6.646-6.647.708.708Z",
33
+ clipRule: "evenodd"
34
34
  }));
35
35
  };
36
36
  var ForwardRef = /*#__PURE__*/forwardRef(CancelCircleDuotone);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aloudata/aloudata-design",
3
- "version": "1.9.10",
3
+ "version": "1.9.11",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",