@clayui/table 3.56.0 → 3.105.1-alpha.8
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/lib/Body.d.ts +0 -0
- package/lib/Body.js +1 -1
- package/lib/Body.js.map +1 -0
- package/lib/Cell.d.ts +0 -0
- package/lib/Cell.js +1 -1
- package/lib/Cell.js.map +1 -0
- package/lib/Head.d.ts +0 -0
- package/lib/Head.js +1 -1
- package/lib/Head.js.map +1 -0
- package/lib/Row.d.ts +0 -0
- package/lib/Row.js +1 -1
- package/lib/Row.js.map +1 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -0
- package/lib/types.d.ts +0 -0
- package/lib/types.js.map +1 -0
- package/package.json +3 -4
- package/src/Body.tsx +0 -21
- package/src/Cell.tsx +0 -120
- package/src/Head.tsx +0 -21
- package/src/Row.tsx +0 -59
- package/src/__tests__/__snapshots__/index.tsx.snap +0 -443
- package/src/__tests__/index.tsx +0 -268
- package/src/index.tsx +0 -142
- package/src/types.ts +0 -6
package/lib/Body.d.ts
CHANGED
|
File without changes
|
package/lib/Body.js
CHANGED
|
@@ -11,7 +11,7 @@ var _excluded = ["children"];
|
|
|
11
11
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
|
|
14
|
-
function _extends() { _extends = Object.assign
|
|
14
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
15
15
|
|
|
16
16
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
17
17
|
|
package/lib/Body.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Body.js","names":["_react","_interopRequireDefault","require","_excluded","obj","__esModule","default","_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","_objectWithoutProperties","excluded","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","indexOf","propertyIsEnumerable","sourceKeys","keys","ClayTableBody","React","forwardRef","_ref","ref","children","otherProps","createElement","displayName","_default","exports"],"sources":["../src/Body.tsx"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: © 2019 Liferay, Inc. <https://liferay.com>\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport React from 'react';\n\nconst ClayTableBody = React.forwardRef<\n\tHTMLTableSectionElement,\n\tReact.TableHTMLAttributes<HTMLTableSectionElement>\n>(({children, ...otherProps}, ref) => {\n\treturn (\n\t\t<tbody {...otherProps} ref={ref}>\n\t\t\t{children}\n\t\t</tbody>\n\t);\n});\n\nClayTableBody.displayName = 'ClayTableBody';\n\nexport default ClayTableBody;\n"],"mappings":";;;;;;AAKA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0B,IAAAC,SAAA;AAL1B;AACA;AACA;AACA;AAHA,SAAAF,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,SAAA,IAAAA,QAAA,GAAAC,MAAA,CAAAC,MAAA,GAAAD,MAAA,CAAAC,MAAA,CAAAC,IAAA,eAAAC,MAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAF,CAAA,UAAAG,MAAA,GAAAF,SAAA,CAAAD,CAAA,YAAAI,GAAA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IAAKC,UAAU,GAAAf,wBAAA,CAAAY,IAAA,EAAA9B,SAAA;EAC1B,oBACCH,MAAA,CAAAM,OAAA,CAAA+B,aAAA,UAAA9B,QAAA,KAAW6B,UAAU;IAAEF,GAAG,EAAEA;EAAI,IAC9BC,QACK,CAAC;AAEV,CAAC,CAAC;AAEFL,aAAa,CAACQ,WAAW,GAAG,eAAe;AAAC,IAAAC,QAAA,GAE7BT,aAAa;AAAAU,OAAA,CAAAlC,OAAA,GAAAiC,QAAA"}
|
package/lib/Cell.d.ts
CHANGED
|
File without changes
|
package/lib/Cell.js
CHANGED
|
@@ -13,7 +13,7 @@ var _excluded = ["align", "cellDelimiter", "children", "className", "columnTextA
|
|
|
13
13
|
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
|
|
16
|
-
function _extends() { _extends = Object.assign
|
|
16
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
17
17
|
|
|
18
18
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
19
19
|
|
package/lib/Cell.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Cell.js","names":["_classnames","_interopRequireDefault","require","_react","_excluded","obj","__esModule","default","_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","_defineProperty","value","_toPropertyKey","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","_typeof","String","input","hint","prim","Symbol","toPrimitive","undefined","res","TypeError","Number","_objectWithoutProperties","excluded","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","indexOf","propertyIsEnumerable","sourceKeys","keys","ClayTableCell","React","forwardRef","_ref","ref","_classNames","align","cellDelimiter","children","className","columnTextAlignment","expanded","_ref$headingCell","headingCell","_ref$headingTitle","headingTitle","_ref$noWrap","noWrap","_ref$truncate","truncate","otherProps","TagName","createElement","classNames","concat","Children","map","child","displayName","_default","exports"],"sources":["../src/Cell.tsx"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: © 2019 Liferay, Inc. <https://liferay.com>\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport classNames from 'classnames';\nimport React from 'react';\n\nimport {TDelimiter} from './types';\n\ntype ColumnTextAlignmentType = 'center' | 'end' | 'start';\n\ntype TableCellBaseProps = React.ThHTMLAttributes<HTMLTableHeaderCellElement> &\n\tReact.TdHTMLAttributes<HTMLTableDataCellElement>;\n\ntype TextCellAlignmentType = 'center' | 'left' | 'right';\n\nexport interface ICellProps extends TableCellBaseProps {\n\t/**\n\t * Aligns the text inside the Cell.\n\t */\n\talign?: TextCellAlignmentType;\n\n\t/**\n\t * Sometimes we are unable to remove specific table columns from the DOM\n\t * and need to hide it using CSS. This property can be added to the \"new\"\n\t * first or last cell to maintain table styles on the left and right side.\n\t */\n\tcellDelimiter?: TDelimiter;\n\n\t/**\n\t * Aligns horizontally contents inside the Cell.\n\t */\n\tcolumnTextAlignment?: ColumnTextAlignmentType;\n\n\t/**\n\t * Fills out the remaining space inside a Cell.\n\t */\n\texpanded?: boolean;\n\n\t/**\n\t * Defines the type of the Cell element, if true,\n\t * cell element will be a `<th>`, otherwise `<td>`.\n\t */\n\theadingCell?: boolean;\n\n\t/**\n\t * Applies a style of heading inside a child of table\n\t * header cell element.\n\t */\n\theadingTitle?: boolean;\n\n\t/*\n\t * Keep cells on one line.\n\t */\n\tnoWrap?: boolean;\n\n\t/**\n\t * Truncates the text inside a Cell. Requires `expanded`\n\t * property value set to true.\n\t */\n\ttruncate?: boolean;\n}\n\nconst ClayTableCell = React.forwardRef<\n\tHTMLTableHeaderCellElement | HTMLTableDataCellElement,\n\tICellProps\n>(\n\t(\n\t\t{\n\t\t\talign,\n\t\t\tcellDelimiter,\n\t\t\tchildren,\n\t\t\tclassName,\n\t\t\tcolumnTextAlignment,\n\t\t\texpanded,\n\t\t\theadingCell = false,\n\t\t\theadingTitle = false,\n\t\t\tnoWrap = false,\n\t\t\ttruncate = false,\n\t\t\t...otherProps\n\t\t}: ICellProps,\n\t\tref\n\t) => {\n\t\tconst TagName = headingCell ? 'th' : 'td';\n\n\t\treturn (\n\t\t\t<TagName\n\t\t\t\t{...otherProps}\n\t\t\t\tclassName={classNames(className, {\n\t\t\t\t\t'table-cell-expand': expanded || truncate,\n\t\t\t\t\t[`table-cell-${cellDelimiter}`]: cellDelimiter,\n\t\t\t\t\t[`table-column-text-${columnTextAlignment}`]:\n\t\t\t\t\t\tcolumnTextAlignment,\n\t\t\t\t\t[`text-${align}`]: align,\n\t\t\t\t\t'table-cell-ws-nowrap': noWrap,\n\t\t\t\t})}\n\t\t\t\tref={ref}\n\t\t\t>\n\t\t\t\t{headingTitle ? (\n\t\t\t\t\tReact.Children.map(children, (child, i) => (\n\t\t\t\t\t\t<p className=\"table-list-title\" key={i}>\n\t\t\t\t\t\t\t{child}\n\t\t\t\t\t\t</p>\n\t\t\t\t\t))\n\t\t\t\t) : truncate && typeof children === 'string' ? (\n\t\t\t\t\t<span className=\"text-truncate-inline\">\n\t\t\t\t\t\t<span className=\"text-truncate\">{children}</span>\n\t\t\t\t\t</span>\n\t\t\t\t) : (\n\t\t\t\t\tchildren\n\t\t\t\t)}\n\t\t\t</TagName>\n\t\t);\n\t}\n);\n\nClayTableCell.displayName = 'ClayTableCell';\n\nexport default ClayTableCell;\n"],"mappings":";;;;;;;AAKA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AAA0B,IAAAE,SAAA;AAN1B;AACA;AACA;AACA;AAHA,SAAAH,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,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MAAGb,SAAS,EAAC,kBAAkB;MAAC3C,GAAG,EAAEJ;IAAE,GACrCiE,KACC,CAAC;EAAA,CACJ,CAAC,GACCR,QAAQ,IAAI,OAAOX,QAAQ,KAAK,QAAQ,gBAC3CxD,MAAA,CAAAI,OAAA,CAAAkE,aAAA;IAAMb,SAAS,EAAC;EAAsB,gBACrCzD,MAAA,CAAAI,OAAA,CAAAkE,aAAA;IAAMb,SAAS,EAAC;EAAe,GAAED,QAAe,CAC3C,CAAC,GAEPA,QAEO,CAAC;AAEZ,CACD,CAAC;AAEDR,aAAa,CAAC4B,WAAW,GAAG,eAAe;AAAC,IAAAC,QAAA,GAE7B7B,aAAa;AAAA8B,OAAA,CAAA1E,OAAA,GAAAyE,QAAA"}
|
package/lib/Head.d.ts
CHANGED
|
File without changes
|
package/lib/Head.js
CHANGED
|
@@ -11,7 +11,7 @@ var _excluded = ["children"];
|
|
|
11
11
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
|
|
14
|
-
function _extends() { _extends = Object.assign
|
|
14
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
15
15
|
|
|
16
16
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
17
17
|
|
package/lib/Head.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Head.js","names":["_react","_interopRequireDefault","require","_excluded","obj","__esModule","default","_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","_objectWithoutProperties","excluded","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","indexOf","propertyIsEnumerable","sourceKeys","keys","ClayTableHead","React","forwardRef","_ref","ref","children","otherProps","createElement","displayName","_default","exports"],"sources":["../src/Head.tsx"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: © 2019 Liferay, Inc. <https://liferay.com>\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport React from 'react';\n\nconst ClayTableHead = React.forwardRef<\n\tHTMLTableSectionElement,\n\tReact.TableHTMLAttributes<HTMLTableSectionElement>\n>(({children, ...otherProps}, ref) => {\n\treturn (\n\t\t<thead {...otherProps} ref={ref}>\n\t\t\t{children}\n\t\t</thead>\n\t);\n});\n\nClayTableHead.displayName = 'ClayTableHead';\n\nexport default ClayTableHead;\n"],"mappings":";;;;;;AAKA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0B,IAAAC,SAAA;AAL1B;AACA;AACA;AACA;AAHA,SAAAF,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,SAAA,IAAAA,QAAA,GAAAC,MAAA,CAAAC,MAAA,GAAAD,MAAA,CAAAC,MAAA,CAAAC,IAAA,eAAAC,MAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAF,CAAA,UAAAG,MAAA,GAAAF,SAAA,CAAAD,CAAA,YAAAI,GAAA,IAAAD,MAAA,QAAAP,MAAA,CAAAS,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAJ,MAAA,EAAAC,GAAA,KAAAL,MAAA,CAAAK,GAAA,IAAAD,MAAA,CAAAC,GAAA,gBAAAL,MAAA,YAAAJ,QAAA,CAAAa,KAAA,OAAAP,SAAA;AAAA,S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AACQ,WAAW,GAAG,eAAe;AAAC,IAAAC,QAAA,GAE7BT,aAAa;AAAAU,OAAA,CAAAlC,OAAA,GAAAiC,QAAA"}
|
package/lib/Row.d.ts
CHANGED
|
File without changes
|
package/lib/Row.js
CHANGED
|
@@ -13,7 +13,7 @@ var _excluded = ["active", "children", "className", "divider", "rowDelimiter"];
|
|
|
13
13
|
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
|
|
16
|
-
function _extends() { _extends = Object.assign
|
|
16
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
17
17
|
|
|
18
18
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
19
19
|
|
package/lib/Row.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Row.js","names":["_classnames","_interopRequireDefault","require","_react","_excluded","obj","__esModule","default","_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","_defineProperty","value","_toPropertyKey","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","_typeof","String","input","hint","prim","Symbol","toPrimitive","undefined","res","TypeError","Number","_objectWithoutProperties","excluded","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","indexOf","propertyIsEnumerable","sourceKeys","keys","ClayTableRow","React","forwardRef","_ref","ref","_ref$active","active","children","className","_ref$divider","divider","rowDelimiter","otherProps","createElement","classNames","concat","displayName","_default","exports"],"sources":["../src/Row.tsx"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: © 2019 Liferay, Inc. <https://liferay.com>\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport classNames from 'classnames';\nimport React from 'react';\n\nimport {TDelimiter} from './types';\n\nexport interface IRowProps extends React.HTMLAttributes<HTMLTableRowElement> {\n\t/**\n\t * Forces the active state inside the row.\n\t */\n\tactive?: boolean;\n\n\t/**\n\t * Applies a divider style inside the row.\n\t */\n\tdivider?: boolean;\n\n\t/**\n\t * This property can be added to the \"new\" first\n\t * or last ClayTable.Row to maintain table styles on the top and bottom sides.\n\t */\n\trowDelimiter?: TDelimiter;\n}\n\nconst ClayTableRow = React.forwardRef<HTMLTableRowElement, IRowProps>(\n\t(\n\t\t{\n\t\t\tactive = false,\n\t\t\tchildren,\n\t\t\tclassName,\n\t\t\tdivider = false,\n\t\t\trowDelimiter,\n\t\t\t...otherProps\n\t\t}: IRowProps,\n\t\tref\n\t) => {\n\t\treturn (\n\t\t\t<tr\n\t\t\t\t{...otherProps}\n\t\t\t\tclassName={classNames(className, {\n\t\t\t\t\t'table-active': active,\n\t\t\t\t\t'table-divider': divider,\n\t\t\t\t\t[`table-row-${rowDelimiter}`]: rowDelimiter,\n\t\t\t\t})}\n\t\t\t\tref={ref}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</tr>\n\t\t);\n\t}\n);\n\nClayTableRow.displayName = 'ClayTableRow';\n\nexport default ClayTableRow;\n"],"mappings":";;;;;;;AAKA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AAA0B,IAAAE,SAAA;AAN1B;AACA;AACA;AACA;AAHA,SAAAH,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,SAAA,IAAAA,QAAA,GAAAC,MAAA,CAAAC,MAAA,GAAAD,MAAA,CAAAC,MAAA,CAAAC,IAAA,eAAAC,MAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAF,CAAA,UAAAG,MA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D,UAAU;IACdJ,SAAS,EAAE,IAAAM,mBAAU,EAACN,SAAS,EAAArC,eAAA;MAC9B,cAAc,EAAEmC,MAAM;MACtB,eAAe,EAAEI;IAAO,gBAAAK,MAAA,CACVJ,YAAY,GAAKA,YAAY,CAC3C,CAAE;IACHP,GAAG,EAAEA;EAAI,IAERG,QACE,CAAC;AAEP,CACD,CAAC;AAEDP,YAAY,CAACgB,WAAW,GAAG,cAAc;AAAC,IAAAC,QAAA,GAE3BjB,YAAY;AAAAkB,OAAA,CAAA9D,OAAA,GAAA6D,QAAA"}
|
package/lib/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
declare type ResposiveSizeType = 'lg' | 'md' | 'sm' | 'xl';
|
|
7
7
|
declare type VerticalAlignmentType = 'bottom' | 'middle' | 'top';
|
|
8
|
-
interface IProps extends React.HTMLAttributes<HTMLTableElement> {
|
|
8
|
+
export interface IProps extends React.HTMLAttributes<HTMLTableElement> {
|
|
9
9
|
/**
|
|
10
10
|
* This property vertically align the contents
|
|
11
11
|
* inside the table body according a given position.
|
package/lib/index.js
CHANGED
|
@@ -21,7 +21,7 @@ var _excluded = ["bodyVerticalAlignment", "borderedColumns", "borderless", "chil
|
|
|
21
21
|
|
|
22
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
23
|
|
|
24
|
-
function _extends() { _extends = Object.assign
|
|
24
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
25
25
|
|
|
26
26
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
27
27
|
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_classnames","_interopRequireDefault","require","_react","_Body","_Cell","_Head","_Row","_excluded","obj","__esModule","default","_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","_defineProperty","value","_toPropertyKey","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","_typeof","String","input","hint","prim","Symbol","toPrimitive","undefined","res","TypeError","Number","_objectWithoutProperties","excluded","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","indexOf","propertyIsEnumerable","sourceKeys","keys","ClayTable","React","forwardRef","_ref","ref","_classNames2","bodyVerticalAlignment","borderedColumns","borderless","children","className","headVerticalAlignment","headingNoWrap","_ref$hover","hover","noWrap","_ref$responsive","responsive","responsiveSize","striped","tableVerticalAlignment","otherProps","createElement","classNames","concat","displayName","_default","Body","Cell","Head","Row","exports"],"sources":["../src/index.tsx"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: © 2019 Liferay, Inc. <https://liferay.com>\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport classNames from 'classnames';\nimport React from 'react';\n\nimport Body from './Body';\nimport Cell from './Cell';\nimport Head from './Head';\nimport Row from './Row';\n\ntype ResposiveSizeType = 'lg' | 'md' | 'sm' | 'xl';\n\ntype VerticalAlignmentType = 'bottom' | 'middle' | 'top';\n\ninterface IProps extends React.HTMLAttributes<HTMLTableElement> {\n\t/**\n\t * This property vertically align the contents\n\t * inside the table body according a given position.\n\t */\n\tbodyVerticalAlignment?: VerticalAlignmentType;\n\n\t/**\n\t * Applies a Bordered style on Table's columns.\n\t */\n\tborderedColumns?: boolean;\n\n\t/**\n\t * Removes the default border and rounded corners from table.\n\t */\n\tborderless?: boolean;\n\n\t/**\n\t * This property keeps all the headings on one line.\n\t */\n\theadingNoWrap?: boolean;\n\n\t/**\n\t * This property vertically align the contents\n\t * inside the table header according a given position.\n\t */\n\theadVerticalAlignment?: VerticalAlignmentType;\n\n\t/**\n\t * Applies a Hover style on Table.\n\t */\n\thover?: boolean;\n\n\t/**\n\t * This property enables keeping everything on one line.\n\t */\n\tnoWrap?: boolean;\n\n\t/**\n\t * Turns the table responsive.\n\t */\n\tresponsive?: boolean;\n\n\t/**\n\t * Defines the responsive sizing.\n\t */\n\tresponsiveSize?: ResposiveSizeType;\n\n\t/**\n\t * Applies a Striped style on Table.\n\t */\n\tstriped?: boolean;\n\n\t/**\n\t * This property vertically align the contents\n\t * inside the table according a given position.\n\t */\n\ttableVerticalAlignment?: VerticalAlignmentType;\n}\n\nconst ClayTable = React.forwardRef<HTMLDivElement, IProps>(\n\t(\n\t\t{\n\t\t\tbodyVerticalAlignment,\n\t\t\tborderedColumns,\n\t\t\tborderless,\n\t\t\tchildren,\n\t\t\tclassName,\n\t\t\theadVerticalAlignment,\n\t\t\theadingNoWrap,\n\t\t\thover = true,\n\t\t\tnoWrap,\n\t\t\tresponsive = true,\n\t\t\tresponsiveSize,\n\t\t\tstriped,\n\t\t\ttableVerticalAlignment,\n\t\t\t...otherProps\n\t\t}: IProps,\n\t\tref\n\t) => {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclassName={classNames({\n\t\t\t\t\t'table-responsive': responsive,\n\t\t\t\t\t[`table-responsive-${responsiveSize}`]: responsiveSize,\n\t\t\t\t})}\n\t\t\t\tref={ref}\n\t\t\t>\n\t\t\t\t<table\n\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t'table table-autofit',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'show-quick-actions-on-hover': hover,\n\t\t\t\t\t\t\t'table-bordered': borderedColumns,\n\t\t\t\t\t\t\t'table-heading-nowrap': headingNoWrap,\n\t\t\t\t\t\t\t'table-hover': hover,\n\t\t\t\t\t\t\t'table-list': !borderless,\n\t\t\t\t\t\t\t'table-nowrap': noWrap,\n\t\t\t\t\t\t\t'table-striped': striped,\n\t\t\t\t\t\t\t[`tbody-valign-${bodyVerticalAlignment}`]:\n\t\t\t\t\t\t\t\tbodyVerticalAlignment,\n\t\t\t\t\t\t\t[`thead-valign-${headVerticalAlignment}`]:\n\t\t\t\t\t\t\t\theadVerticalAlignment,\n\t\t\t\t\t\t\t[`table-valign-${tableVerticalAlignment}`]:\n\t\t\t\t\t\t\t\ttableVerticalAlignment,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tclassName\n\t\t\t\t\t)}\n\t\t\t\t\t{...otherProps}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</table>\n\t\t\t</div>\n\t\t);\n\t}\n);\n\nClayTable.displayName = 'ClayTable';\n\nexport default Object.assign(ClayTable, {\n\tBody,\n\tCell,\n\tHead,\n\tRow,\n});\n"],"mappings":";;;;;;;AAKA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,KAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,KAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,KAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,IAAA,GAAAN,sBAAA,CAAAC,OAAA;AAAwB,IAAAM,SAAA;AAXxB;AACA;AACA;AACA;AAHA,SAAAP,uBAAAQ,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,SAAA,IAAAA,QAAA,GAAAC,MAAA,CAAAC,MAAA,GAAAD,MAAA,CAAAC,MAAA,CAAAC,IAAA,eAAAC,MAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAF,CAAA,UAAAG,MAAA,GAAAF,SAAA,CAAAD,CAAA,YAAAI,GAAA,IAAAD,MAAA,QAAAP,MAAA,CAAAS,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAJ,MAAA,EAAAC,GAAA,KAAAL,MAAA,CAAAK,GAAA,IAAAD,MAAA,CAA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/types.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../src/types.ts"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: © 2019 Liferay, Inc. <https://liferay.com>\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nexport type TDelimiter = 'start' | 'end';\n"],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clayui/table",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.105.1-alpha.8+41563f2b8",
|
|
4
4
|
"description": "ClayTable component",
|
|
5
5
|
"license": "BSD-3-Clause",
|
|
6
6
|
"repository": "https://github.com/liferay/clay",
|
|
@@ -12,8 +12,7 @@
|
|
|
12
12
|
"types": "lib/index.d.ts",
|
|
13
13
|
"ts:main": "src/index.tsx",
|
|
14
14
|
"files": [
|
|
15
|
-
"lib"
|
|
16
|
-
"src"
|
|
15
|
+
"lib"
|
|
17
16
|
],
|
|
18
17
|
"scripts": {
|
|
19
18
|
"build": "cross-env NODE_ENV=production babel src --root-mode upward --out-dir lib --extensions .ts,.tsx",
|
|
@@ -36,5 +35,5 @@
|
|
|
36
35
|
"browserslist": [
|
|
37
36
|
"extends browserslist-config-clay"
|
|
38
37
|
],
|
|
39
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "41563f2b8f5a330f313a25b5eb6a56a014cdec2c"
|
|
40
39
|
}
|
package/src/Body.tsx
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SPDX-FileCopyrightText: © 2019 Liferay, Inc. <https://liferay.com>
|
|
3
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import React from 'react';
|
|
7
|
-
|
|
8
|
-
const ClayTableBody = React.forwardRef<
|
|
9
|
-
HTMLTableSectionElement,
|
|
10
|
-
React.TableHTMLAttributes<HTMLTableSectionElement>
|
|
11
|
-
>(({children, ...otherProps}, ref) => {
|
|
12
|
-
return (
|
|
13
|
-
<tbody {...otherProps} ref={ref}>
|
|
14
|
-
{children}
|
|
15
|
-
</tbody>
|
|
16
|
-
);
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
ClayTableBody.displayName = 'ClayTableBody';
|
|
20
|
-
|
|
21
|
-
export default ClayTableBody;
|
package/src/Cell.tsx
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SPDX-FileCopyrightText: © 2019 Liferay, Inc. <https://liferay.com>
|
|
3
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import classNames from 'classnames';
|
|
7
|
-
import React from 'react';
|
|
8
|
-
|
|
9
|
-
import {TDelimiter} from './types';
|
|
10
|
-
|
|
11
|
-
type ColumnTextAlignmentType = 'center' | 'end' | 'start';
|
|
12
|
-
|
|
13
|
-
type TableCellBaseProps = React.ThHTMLAttributes<HTMLTableHeaderCellElement> &
|
|
14
|
-
React.TdHTMLAttributes<HTMLTableDataCellElement>;
|
|
15
|
-
|
|
16
|
-
type TextCellAlignmentType = 'center' | 'left' | 'right';
|
|
17
|
-
|
|
18
|
-
export interface ICellProps extends TableCellBaseProps {
|
|
19
|
-
/**
|
|
20
|
-
* Aligns the text inside the Cell.
|
|
21
|
-
*/
|
|
22
|
-
align?: TextCellAlignmentType;
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Sometimes we are unable to remove specific table columns from the DOM
|
|
26
|
-
* and need to hide it using CSS. This property can be added to the "new"
|
|
27
|
-
* first or last cell to maintain table styles on the left and right side.
|
|
28
|
-
*/
|
|
29
|
-
cellDelimiter?: TDelimiter;
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Aligns horizontally contents inside the Cell.
|
|
33
|
-
*/
|
|
34
|
-
columnTextAlignment?: ColumnTextAlignmentType;
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Fills out the remaining space inside a Cell.
|
|
38
|
-
*/
|
|
39
|
-
expanded?: boolean;
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Defines the type of the Cell element, if true,
|
|
43
|
-
* cell element will be a `<th>`, otherwise `<td>`.
|
|
44
|
-
*/
|
|
45
|
-
headingCell?: boolean;
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Applies a style of heading inside a child of table
|
|
49
|
-
* header cell element.
|
|
50
|
-
*/
|
|
51
|
-
headingTitle?: boolean;
|
|
52
|
-
|
|
53
|
-
/*
|
|
54
|
-
* Keep cells on one line.
|
|
55
|
-
*/
|
|
56
|
-
noWrap?: boolean;
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Truncates the text inside a Cell. Requires `expanded`
|
|
60
|
-
* property value set to true.
|
|
61
|
-
*/
|
|
62
|
-
truncate?: boolean;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
const ClayTableCell = React.forwardRef<
|
|
66
|
-
HTMLTableHeaderCellElement | HTMLTableDataCellElement,
|
|
67
|
-
ICellProps
|
|
68
|
-
>(
|
|
69
|
-
(
|
|
70
|
-
{
|
|
71
|
-
align,
|
|
72
|
-
cellDelimiter,
|
|
73
|
-
children,
|
|
74
|
-
className,
|
|
75
|
-
columnTextAlignment,
|
|
76
|
-
expanded,
|
|
77
|
-
headingCell = false,
|
|
78
|
-
headingTitle = false,
|
|
79
|
-
noWrap = false,
|
|
80
|
-
truncate = false,
|
|
81
|
-
...otherProps
|
|
82
|
-
}: ICellProps,
|
|
83
|
-
ref
|
|
84
|
-
) => {
|
|
85
|
-
const TagName = headingCell ? 'th' : 'td';
|
|
86
|
-
|
|
87
|
-
return (
|
|
88
|
-
<TagName
|
|
89
|
-
{...otherProps}
|
|
90
|
-
className={classNames(className, {
|
|
91
|
-
'table-cell-expand': expanded || truncate,
|
|
92
|
-
[`table-cell-${cellDelimiter}`]: cellDelimiter,
|
|
93
|
-
[`table-column-text-${columnTextAlignment}`]:
|
|
94
|
-
columnTextAlignment,
|
|
95
|
-
[`text-${align}`]: align,
|
|
96
|
-
'table-cell-ws-nowrap': noWrap,
|
|
97
|
-
})}
|
|
98
|
-
ref={ref}
|
|
99
|
-
>
|
|
100
|
-
{headingTitle ? (
|
|
101
|
-
React.Children.map(children, (child, i) => (
|
|
102
|
-
<p className="table-list-title" key={i}>
|
|
103
|
-
{child}
|
|
104
|
-
</p>
|
|
105
|
-
))
|
|
106
|
-
) : truncate && typeof children === 'string' ? (
|
|
107
|
-
<span className="text-truncate-inline">
|
|
108
|
-
<span className="text-truncate">{children}</span>
|
|
109
|
-
</span>
|
|
110
|
-
) : (
|
|
111
|
-
children
|
|
112
|
-
)}
|
|
113
|
-
</TagName>
|
|
114
|
-
);
|
|
115
|
-
}
|
|
116
|
-
);
|
|
117
|
-
|
|
118
|
-
ClayTableCell.displayName = 'ClayTableCell';
|
|
119
|
-
|
|
120
|
-
export default ClayTableCell;
|
package/src/Head.tsx
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SPDX-FileCopyrightText: © 2019 Liferay, Inc. <https://liferay.com>
|
|
3
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import React from 'react';
|
|
7
|
-
|
|
8
|
-
const ClayTableHead = React.forwardRef<
|
|
9
|
-
HTMLTableSectionElement,
|
|
10
|
-
React.TableHTMLAttributes<HTMLTableSectionElement>
|
|
11
|
-
>(({children, ...otherProps}, ref) => {
|
|
12
|
-
return (
|
|
13
|
-
<thead {...otherProps} ref={ref}>
|
|
14
|
-
{children}
|
|
15
|
-
</thead>
|
|
16
|
-
);
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
ClayTableHead.displayName = 'ClayTableHead';
|
|
20
|
-
|
|
21
|
-
export default ClayTableHead;
|
package/src/Row.tsx
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SPDX-FileCopyrightText: © 2019 Liferay, Inc. <https://liferay.com>
|
|
3
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import classNames from 'classnames';
|
|
7
|
-
import React from 'react';
|
|
8
|
-
|
|
9
|
-
import {TDelimiter} from './types';
|
|
10
|
-
|
|
11
|
-
export interface IRowProps extends React.HTMLAttributes<HTMLTableRowElement> {
|
|
12
|
-
/**
|
|
13
|
-
* Forces the active state inside the row.
|
|
14
|
-
*/
|
|
15
|
-
active?: boolean;
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Applies a divider style inside the row.
|
|
19
|
-
*/
|
|
20
|
-
divider?: boolean;
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* This property can be added to the "new" first
|
|
24
|
-
* or last ClayTable.Row to maintain table styles on the top and bottom sides.
|
|
25
|
-
*/
|
|
26
|
-
rowDelimiter?: TDelimiter;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const ClayTableRow = React.forwardRef<HTMLTableRowElement, IRowProps>(
|
|
30
|
-
(
|
|
31
|
-
{
|
|
32
|
-
active = false,
|
|
33
|
-
children,
|
|
34
|
-
className,
|
|
35
|
-
divider = false,
|
|
36
|
-
rowDelimiter,
|
|
37
|
-
...otherProps
|
|
38
|
-
}: IRowProps,
|
|
39
|
-
ref
|
|
40
|
-
) => {
|
|
41
|
-
return (
|
|
42
|
-
<tr
|
|
43
|
-
{...otherProps}
|
|
44
|
-
className={classNames(className, {
|
|
45
|
-
'table-active': active,
|
|
46
|
-
'table-divider': divider,
|
|
47
|
-
[`table-row-${rowDelimiter}`]: rowDelimiter,
|
|
48
|
-
})}
|
|
49
|
-
ref={ref}
|
|
50
|
-
>
|
|
51
|
-
{children}
|
|
52
|
-
</tr>
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
);
|
|
56
|
-
|
|
57
|
-
ClayTableRow.displayName = 'ClayTableRow';
|
|
58
|
-
|
|
59
|
-
export default ClayTableRow;
|
|
@@ -1,443 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`ClayTable renders 1`] = `
|
|
4
|
-
<div>
|
|
5
|
-
<div
|
|
6
|
-
class="table-responsive"
|
|
7
|
-
>
|
|
8
|
-
<table
|
|
9
|
-
class="table table-autofit show-quick-actions-on-hover table-hover table-list"
|
|
10
|
-
/>
|
|
11
|
-
</div>
|
|
12
|
-
</div>
|
|
13
|
-
`;
|
|
14
|
-
|
|
15
|
-
exports[`ClayTable renders a Cell delimited 1`] = `
|
|
16
|
-
<div>
|
|
17
|
-
<div
|
|
18
|
-
class="table-responsive"
|
|
19
|
-
>
|
|
20
|
-
<table
|
|
21
|
-
class="table table-autofit show-quick-actions-on-hover table-hover table-list table-striped"
|
|
22
|
-
>
|
|
23
|
-
<thead>
|
|
24
|
-
<tr
|
|
25
|
-
class=""
|
|
26
|
-
>
|
|
27
|
-
<th
|
|
28
|
-
class="table-cell-start"
|
|
29
|
-
>
|
|
30
|
-
Start
|
|
31
|
-
</th>
|
|
32
|
-
<th
|
|
33
|
-
class=""
|
|
34
|
-
>
|
|
35
|
-
<button
|
|
36
|
-
type="button"
|
|
37
|
-
>
|
|
38
|
-
Dummy
|
|
39
|
-
</button>
|
|
40
|
-
</th>
|
|
41
|
-
<th
|
|
42
|
-
class=""
|
|
43
|
-
>
|
|
44
|
-
<button
|
|
45
|
-
type="button"
|
|
46
|
-
>
|
|
47
|
-
Dummy
|
|
48
|
-
</button>
|
|
49
|
-
</th>
|
|
50
|
-
<th
|
|
51
|
-
class="table-cell-end"
|
|
52
|
-
>
|
|
53
|
-
End
|
|
54
|
-
</th>
|
|
55
|
-
</tr>
|
|
56
|
-
</thead>
|
|
57
|
-
</table>
|
|
58
|
-
</div>
|
|
59
|
-
</div>
|
|
60
|
-
`;
|
|
61
|
-
|
|
62
|
-
exports[`ClayTable renders a Cell with text alignment set to center 1`] = `
|
|
63
|
-
<div>
|
|
64
|
-
<div
|
|
65
|
-
class="table-responsive"
|
|
66
|
-
>
|
|
67
|
-
<table
|
|
68
|
-
class="table table-autofit show-quick-actions-on-hover table-hover table-list table-striped"
|
|
69
|
-
>
|
|
70
|
-
<thead>
|
|
71
|
-
<tr
|
|
72
|
-
class=""
|
|
73
|
-
>
|
|
74
|
-
<th
|
|
75
|
-
class="text-center"
|
|
76
|
-
>
|
|
77
|
-
<a
|
|
78
|
-
href="#1"
|
|
79
|
-
>
|
|
80
|
-
Link
|
|
81
|
-
</a>
|
|
82
|
-
</th>
|
|
83
|
-
</tr>
|
|
84
|
-
</thead>
|
|
85
|
-
<tbody />
|
|
86
|
-
</table>
|
|
87
|
-
</div>
|
|
88
|
-
</div>
|
|
89
|
-
`;
|
|
90
|
-
|
|
91
|
-
exports[`ClayTable renders a full bottom vertical aligned table 1`] = `
|
|
92
|
-
<div>
|
|
93
|
-
<div
|
|
94
|
-
class="table-responsive"
|
|
95
|
-
>
|
|
96
|
-
<table
|
|
97
|
-
class="table table-autofit show-quick-actions-on-hover table-hover table-list thead-valign-bottom table-valign-bottom"
|
|
98
|
-
>
|
|
99
|
-
<thead />
|
|
100
|
-
<tbody />
|
|
101
|
-
</table>
|
|
102
|
-
</div>
|
|
103
|
-
</div>
|
|
104
|
-
`;
|
|
105
|
-
|
|
106
|
-
exports[`ClayTable renders a no wrapped table 1`] = `
|
|
107
|
-
<div>
|
|
108
|
-
<div
|
|
109
|
-
class="table-responsive"
|
|
110
|
-
>
|
|
111
|
-
<table
|
|
112
|
-
class="table table-autofit show-quick-actions-on-hover table-heading-nowrap table-hover table-list table-nowrap"
|
|
113
|
-
>
|
|
114
|
-
<thead />
|
|
115
|
-
<tbody />
|
|
116
|
-
</table>
|
|
117
|
-
</div>
|
|
118
|
-
</div>
|
|
119
|
-
`;
|
|
120
|
-
|
|
121
|
-
exports[`ClayTable renders a responsive table 1`] = `
|
|
122
|
-
<div>
|
|
123
|
-
<div
|
|
124
|
-
class="table-responsive table-responsive-sm"
|
|
125
|
-
>
|
|
126
|
-
<table
|
|
127
|
-
class="table table-autofit show-quick-actions-on-hover table-hover table-list"
|
|
128
|
-
>
|
|
129
|
-
<thead />
|
|
130
|
-
<tbody />
|
|
131
|
-
</table>
|
|
132
|
-
</div>
|
|
133
|
-
</div>
|
|
134
|
-
`;
|
|
135
|
-
|
|
136
|
-
exports[`ClayTable renders a responsive table 2`] = `
|
|
137
|
-
<div>
|
|
138
|
-
<div
|
|
139
|
-
class="table-responsive table-responsive-sm"
|
|
140
|
-
>
|
|
141
|
-
<table
|
|
142
|
-
class="table table-autofit show-quick-actions-on-hover table-hover table-list"
|
|
143
|
-
>
|
|
144
|
-
<thead />
|
|
145
|
-
<tbody />
|
|
146
|
-
</table>
|
|
147
|
-
</div>
|
|
148
|
-
</div>
|
|
149
|
-
`;
|
|
150
|
-
|
|
151
|
-
exports[`ClayTable renders a table hover 1`] = `
|
|
152
|
-
<div>
|
|
153
|
-
<div
|
|
154
|
-
class="table-responsive"
|
|
155
|
-
>
|
|
156
|
-
<table
|
|
157
|
-
class="table table-autofit show-quick-actions-on-hover table-hover table-list"
|
|
158
|
-
>
|
|
159
|
-
<thead />
|
|
160
|
-
<tbody />
|
|
161
|
-
</table>
|
|
162
|
-
</div>
|
|
163
|
-
</div>
|
|
164
|
-
`;
|
|
165
|
-
|
|
166
|
-
exports[`ClayTable renders a table striped 1`] = `
|
|
167
|
-
<div>
|
|
168
|
-
<div
|
|
169
|
-
class="table-responsive"
|
|
170
|
-
>
|
|
171
|
-
<table
|
|
172
|
-
class="table table-autofit show-quick-actions-on-hover table-hover table-list table-striped"
|
|
173
|
-
>
|
|
174
|
-
<thead />
|
|
175
|
-
<tbody />
|
|
176
|
-
</table>
|
|
177
|
-
</div>
|
|
178
|
-
</div>
|
|
179
|
-
`;
|
|
180
|
-
|
|
181
|
-
exports[`ClayTable renders a table with a Body 1`] = `
|
|
182
|
-
<div>
|
|
183
|
-
<div
|
|
184
|
-
class="table-responsive"
|
|
185
|
-
>
|
|
186
|
-
<table
|
|
187
|
-
class="table table-autofit show-quick-actions-on-hover table-hover table-list"
|
|
188
|
-
>
|
|
189
|
-
<tbody />
|
|
190
|
-
</table>
|
|
191
|
-
</div>
|
|
192
|
-
</div>
|
|
193
|
-
`;
|
|
194
|
-
|
|
195
|
-
exports[`ClayTable renders a table with a Head 1`] = `
|
|
196
|
-
<div>
|
|
197
|
-
<div
|
|
198
|
-
class="table-responsive"
|
|
199
|
-
>
|
|
200
|
-
<table
|
|
201
|
-
class="table table-autofit show-quick-actions-on-hover table-hover table-list"
|
|
202
|
-
>
|
|
203
|
-
<thead />
|
|
204
|
-
</table>
|
|
205
|
-
</div>
|
|
206
|
-
</div>
|
|
207
|
-
`;
|
|
208
|
-
|
|
209
|
-
exports[`ClayTable renders a table with a Head and Body 1`] = `
|
|
210
|
-
<div>
|
|
211
|
-
<div
|
|
212
|
-
class="table-responsive"
|
|
213
|
-
>
|
|
214
|
-
<table
|
|
215
|
-
class="table table-autofit show-quick-actions-on-hover table-hover table-list"
|
|
216
|
-
>
|
|
217
|
-
<thead />
|
|
218
|
-
<tbody />
|
|
219
|
-
</table>
|
|
220
|
-
</div>
|
|
221
|
-
</div>
|
|
222
|
-
`;
|
|
223
|
-
|
|
224
|
-
exports[`ClayTable renders a table with an active row 1`] = `
|
|
225
|
-
<div>
|
|
226
|
-
<div
|
|
227
|
-
class="table-responsive"
|
|
228
|
-
>
|
|
229
|
-
<table
|
|
230
|
-
class="table table-autofit show-quick-actions-on-hover table-hover table-list"
|
|
231
|
-
>
|
|
232
|
-
<tbody>
|
|
233
|
-
<tr
|
|
234
|
-
class="table-active"
|
|
235
|
-
/>
|
|
236
|
-
</tbody>
|
|
237
|
-
</table>
|
|
238
|
-
</div>
|
|
239
|
-
</div>
|
|
240
|
-
`;
|
|
241
|
-
|
|
242
|
-
exports[`ClayTable renders a table with columns bordered 1`] = `
|
|
243
|
-
<div>
|
|
244
|
-
<div
|
|
245
|
-
class="table-responsive"
|
|
246
|
-
>
|
|
247
|
-
<table
|
|
248
|
-
class="table table-autofit show-quick-actions-on-hover table-bordered table-hover table-list"
|
|
249
|
-
>
|
|
250
|
-
<thead />
|
|
251
|
-
<tbody />
|
|
252
|
-
</table>
|
|
253
|
-
</div>
|
|
254
|
-
</div>
|
|
255
|
-
`;
|
|
256
|
-
|
|
257
|
-
exports[`ClayTable renders a table with multiple Cells into Row 1`] = `
|
|
258
|
-
<div>
|
|
259
|
-
<div
|
|
260
|
-
class="table-responsive"
|
|
261
|
-
>
|
|
262
|
-
<table
|
|
263
|
-
class="table table-autofit show-quick-actions-on-hover table-hover table-list"
|
|
264
|
-
>
|
|
265
|
-
<tbody>
|
|
266
|
-
<tr
|
|
267
|
-
class=""
|
|
268
|
-
>
|
|
269
|
-
<td
|
|
270
|
-
class=""
|
|
271
|
-
>
|
|
272
|
-
One
|
|
273
|
-
</td>
|
|
274
|
-
<td
|
|
275
|
-
class=""
|
|
276
|
-
>
|
|
277
|
-
<button
|
|
278
|
-
type="button"
|
|
279
|
-
>
|
|
280
|
-
Two
|
|
281
|
-
</button>
|
|
282
|
-
</td>
|
|
283
|
-
<td
|
|
284
|
-
class=""
|
|
285
|
-
>
|
|
286
|
-
Three
|
|
287
|
-
</td>
|
|
288
|
-
</tr>
|
|
289
|
-
</tbody>
|
|
290
|
-
</table>
|
|
291
|
-
</div>
|
|
292
|
-
</div>
|
|
293
|
-
`;
|
|
294
|
-
|
|
295
|
-
exports[`ClayTable renders a table with multiple rows into Body 1`] = `
|
|
296
|
-
<div>
|
|
297
|
-
<div
|
|
298
|
-
class="table-responsive"
|
|
299
|
-
>
|
|
300
|
-
<table
|
|
301
|
-
class="table table-autofit show-quick-actions-on-hover table-hover table-list"
|
|
302
|
-
>
|
|
303
|
-
<tbody>
|
|
304
|
-
<tr
|
|
305
|
-
class=""
|
|
306
|
-
/>
|
|
307
|
-
<tr
|
|
308
|
-
class=""
|
|
309
|
-
/>
|
|
310
|
-
<tr
|
|
311
|
-
class=""
|
|
312
|
-
/>
|
|
313
|
-
</tbody>
|
|
314
|
-
</table>
|
|
315
|
-
</div>
|
|
316
|
-
</div>
|
|
317
|
-
`;
|
|
318
|
-
|
|
319
|
-
exports[`ClayTable renders a table with multiple rows into Head 1`] = `
|
|
320
|
-
<div>
|
|
321
|
-
<div
|
|
322
|
-
class="table-responsive"
|
|
323
|
-
>
|
|
324
|
-
<table
|
|
325
|
-
class="table table-autofit show-quick-actions-on-hover table-hover table-list"
|
|
326
|
-
>
|
|
327
|
-
<thead>
|
|
328
|
-
<tr
|
|
329
|
-
class=""
|
|
330
|
-
/>
|
|
331
|
-
<tr
|
|
332
|
-
class=""
|
|
333
|
-
/>
|
|
334
|
-
<tr
|
|
335
|
-
class=""
|
|
336
|
-
/>
|
|
337
|
-
</thead>
|
|
338
|
-
</table>
|
|
339
|
-
</div>
|
|
340
|
-
</div>
|
|
341
|
-
`;
|
|
342
|
-
|
|
343
|
-
exports[`ClayTable renders with a headingTitle 1`] = `
|
|
344
|
-
<div>
|
|
345
|
-
<div
|
|
346
|
-
class="table-responsive"
|
|
347
|
-
>
|
|
348
|
-
<table
|
|
349
|
-
class="table table-autofit show-quick-actions-on-hover table-hover table-list"
|
|
350
|
-
>
|
|
351
|
-
<tbody>
|
|
352
|
-
<tr
|
|
353
|
-
class="table-divider"
|
|
354
|
-
>
|
|
355
|
-
<td
|
|
356
|
-
class=""
|
|
357
|
-
colspan="8"
|
|
358
|
-
>
|
|
359
|
-
Recipes
|
|
360
|
-
</td>
|
|
361
|
-
</tr>
|
|
362
|
-
<tr
|
|
363
|
-
class=""
|
|
364
|
-
>
|
|
365
|
-
<td
|
|
366
|
-
class="table-cell-expand"
|
|
367
|
-
>
|
|
368
|
-
<p
|
|
369
|
-
class="table-list-title"
|
|
370
|
-
>
|
|
371
|
-
Hamburger
|
|
372
|
-
</p>
|
|
373
|
-
</td>
|
|
374
|
-
<td
|
|
375
|
-
class=""
|
|
376
|
-
/>
|
|
377
|
-
<td
|
|
378
|
-
class=""
|
|
379
|
-
>
|
|
380
|
-
U.S.A
|
|
381
|
-
</td>
|
|
382
|
-
<td
|
|
383
|
-
class="text-right"
|
|
384
|
-
>
|
|
385
|
-
10 min.
|
|
386
|
-
</td>
|
|
387
|
-
</tr>
|
|
388
|
-
</tbody>
|
|
389
|
-
</table>
|
|
390
|
-
</div>
|
|
391
|
-
</div>
|
|
392
|
-
`;
|
|
393
|
-
|
|
394
|
-
exports[`ClayTable renders with non wrapped cells 1`] = `
|
|
395
|
-
<div>
|
|
396
|
-
<div
|
|
397
|
-
class="table-responsive"
|
|
398
|
-
>
|
|
399
|
-
<table
|
|
400
|
-
class="table table-autofit show-quick-actions-on-hover table-hover table-list"
|
|
401
|
-
>
|
|
402
|
-
<tbody>
|
|
403
|
-
<tr
|
|
404
|
-
class="table-divider"
|
|
405
|
-
>
|
|
406
|
-
<td
|
|
407
|
-
class=""
|
|
408
|
-
colspan="8"
|
|
409
|
-
>
|
|
410
|
-
Recipes
|
|
411
|
-
</td>
|
|
412
|
-
</tr>
|
|
413
|
-
<tr
|
|
414
|
-
class=""
|
|
415
|
-
>
|
|
416
|
-
<td
|
|
417
|
-
class="table-cell-expand"
|
|
418
|
-
>
|
|
419
|
-
<p
|
|
420
|
-
class="table-list-title"
|
|
421
|
-
>
|
|
422
|
-
Hamburger
|
|
423
|
-
</p>
|
|
424
|
-
</td>
|
|
425
|
-
<td
|
|
426
|
-
class=""
|
|
427
|
-
/>
|
|
428
|
-
<td
|
|
429
|
-
class="table-cell-ws-nowrap"
|
|
430
|
-
>
|
|
431
|
-
Originally from the U.S.A. but available anywhere around the world
|
|
432
|
-
</td>
|
|
433
|
-
<td
|
|
434
|
-
class="text-right"
|
|
435
|
-
>
|
|
436
|
-
10 min.
|
|
437
|
-
</td>
|
|
438
|
-
</tr>
|
|
439
|
-
</tbody>
|
|
440
|
-
</table>
|
|
441
|
-
</div>
|
|
442
|
-
</div>
|
|
443
|
-
`;
|
package/src/__tests__/index.tsx
DELETED
|
@@ -1,268 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SPDX-FileCopyrightText: © 2019 Liferay, Inc. <https://liferay.com>
|
|
3
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import ClayTable from '..';
|
|
7
|
-
import {cleanup, render} from '@testing-library/react';
|
|
8
|
-
import React from 'react';
|
|
9
|
-
|
|
10
|
-
describe('ClayTable', () => {
|
|
11
|
-
afterEach(cleanup);
|
|
12
|
-
|
|
13
|
-
it('renders', () => {
|
|
14
|
-
const {container} = render(<ClayTable />);
|
|
15
|
-
|
|
16
|
-
expect(container).toMatchSnapshot();
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
it('renders a table with a Body', () => {
|
|
20
|
-
const {container} = render(
|
|
21
|
-
<ClayTable>
|
|
22
|
-
<ClayTable.Body />
|
|
23
|
-
</ClayTable>
|
|
24
|
-
);
|
|
25
|
-
|
|
26
|
-
expect(container).toMatchSnapshot();
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
it('renders a table with a Head', () => {
|
|
30
|
-
const {container} = render(
|
|
31
|
-
<ClayTable>
|
|
32
|
-
<ClayTable.Head />
|
|
33
|
-
</ClayTable>
|
|
34
|
-
);
|
|
35
|
-
|
|
36
|
-
expect(container).toMatchSnapshot();
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
it('renders a table with a Head and Body', () => {
|
|
40
|
-
const {container} = render(
|
|
41
|
-
<ClayTable>
|
|
42
|
-
<ClayTable.Head />
|
|
43
|
-
<ClayTable.Body />
|
|
44
|
-
</ClayTable>
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
expect(container).toMatchSnapshot();
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
it('renders a table with multiple rows into Head', () => {
|
|
51
|
-
const {container} = render(
|
|
52
|
-
<ClayTable>
|
|
53
|
-
<ClayTable.Head>
|
|
54
|
-
<ClayTable.Row />
|
|
55
|
-
<ClayTable.Row />
|
|
56
|
-
<ClayTable.Row />
|
|
57
|
-
</ClayTable.Head>
|
|
58
|
-
</ClayTable>
|
|
59
|
-
);
|
|
60
|
-
|
|
61
|
-
expect(container).toMatchSnapshot();
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
it('renders a table with multiple rows into Body', () => {
|
|
65
|
-
const {container} = render(
|
|
66
|
-
<ClayTable>
|
|
67
|
-
<ClayTable.Body>
|
|
68
|
-
<ClayTable.Row />
|
|
69
|
-
<ClayTable.Row />
|
|
70
|
-
<ClayTable.Row />
|
|
71
|
-
</ClayTable.Body>
|
|
72
|
-
</ClayTable>
|
|
73
|
-
);
|
|
74
|
-
|
|
75
|
-
expect(container).toMatchSnapshot();
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
it('renders a table with multiple Cells into Row', () => {
|
|
79
|
-
const {container} = render(
|
|
80
|
-
<ClayTable>
|
|
81
|
-
<ClayTable.Body>
|
|
82
|
-
<ClayTable.Row>
|
|
83
|
-
<ClayTable.Cell>One</ClayTable.Cell>
|
|
84
|
-
<ClayTable.Cell>
|
|
85
|
-
<button type="button">Two</button>
|
|
86
|
-
</ClayTable.Cell>
|
|
87
|
-
<ClayTable.Cell>Three</ClayTable.Cell>
|
|
88
|
-
</ClayTable.Row>
|
|
89
|
-
</ClayTable.Body>
|
|
90
|
-
</ClayTable>
|
|
91
|
-
);
|
|
92
|
-
|
|
93
|
-
expect(container).toMatchSnapshot();
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
it('renders a table with an active row', () => {
|
|
97
|
-
const {container} = render(
|
|
98
|
-
<ClayTable>
|
|
99
|
-
<ClayTable.Body>
|
|
100
|
-
<ClayTable.Row active />
|
|
101
|
-
</ClayTable.Body>
|
|
102
|
-
</ClayTable>
|
|
103
|
-
);
|
|
104
|
-
|
|
105
|
-
expect(container).toMatchSnapshot();
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
it('renders a table with columns bordered', () => {
|
|
109
|
-
const {container} = render(
|
|
110
|
-
<ClayTable borderedColumns>
|
|
111
|
-
<ClayTable.Head />
|
|
112
|
-
<ClayTable.Body />
|
|
113
|
-
</ClayTable>
|
|
114
|
-
);
|
|
115
|
-
|
|
116
|
-
expect(container).toMatchSnapshot();
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
it('renders a table hover', () => {
|
|
120
|
-
const {container} = render(
|
|
121
|
-
<ClayTable hover>
|
|
122
|
-
<ClayTable.Head />
|
|
123
|
-
<ClayTable.Body />
|
|
124
|
-
</ClayTable>
|
|
125
|
-
);
|
|
126
|
-
expect(container).toMatchSnapshot();
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
it('renders a no wrapped table', () => {
|
|
130
|
-
const {container} = render(
|
|
131
|
-
<ClayTable headingNoWrap noWrap>
|
|
132
|
-
<ClayTable.Head />
|
|
133
|
-
<ClayTable.Body />
|
|
134
|
-
</ClayTable>
|
|
135
|
-
);
|
|
136
|
-
expect(container).toMatchSnapshot();
|
|
137
|
-
});
|
|
138
|
-
|
|
139
|
-
it('renders a table striped', () => {
|
|
140
|
-
const {container} = render(
|
|
141
|
-
<ClayTable striped>
|
|
142
|
-
<ClayTable.Head />
|
|
143
|
-
<ClayTable.Body />
|
|
144
|
-
</ClayTable>
|
|
145
|
-
);
|
|
146
|
-
expect(container).toMatchSnapshot();
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
it('renders a responsive table', () => {
|
|
150
|
-
const {container} = render(
|
|
151
|
-
<ClayTable responsive responsiveSize="sm">
|
|
152
|
-
<ClayTable.Head />
|
|
153
|
-
<ClayTable.Body />
|
|
154
|
-
</ClayTable>
|
|
155
|
-
);
|
|
156
|
-
expect(container).toMatchSnapshot();
|
|
157
|
-
});
|
|
158
|
-
|
|
159
|
-
it('renders a responsive table', () => {
|
|
160
|
-
const {container} = render(
|
|
161
|
-
<ClayTable responsive responsiveSize="sm">
|
|
162
|
-
<ClayTable.Head />
|
|
163
|
-
<ClayTable.Body />
|
|
164
|
-
</ClayTable>
|
|
165
|
-
);
|
|
166
|
-
expect(container).toMatchSnapshot();
|
|
167
|
-
});
|
|
168
|
-
|
|
169
|
-
it('renders a full bottom vertical aligned table', () => {
|
|
170
|
-
const {container} = render(
|
|
171
|
-
<ClayTable
|
|
172
|
-
headVerticalAlignment="bottom"
|
|
173
|
-
tableVerticalAlignment="bottom"
|
|
174
|
-
>
|
|
175
|
-
<ClayTable.Head />
|
|
176
|
-
<ClayTable.Body />
|
|
177
|
-
</ClayTable>
|
|
178
|
-
);
|
|
179
|
-
expect(container).toMatchSnapshot();
|
|
180
|
-
});
|
|
181
|
-
|
|
182
|
-
it('renders a Cell with text alignment set to center', () => {
|
|
183
|
-
const {container} = render(
|
|
184
|
-
<ClayTable striped>
|
|
185
|
-
<ClayTable.Head>
|
|
186
|
-
<ClayTable.Row>
|
|
187
|
-
<ClayTable.Cell align="center" headingCell>
|
|
188
|
-
<a href="#1">Link</a>
|
|
189
|
-
</ClayTable.Cell>
|
|
190
|
-
</ClayTable.Row>
|
|
191
|
-
</ClayTable.Head>
|
|
192
|
-
<ClayTable.Body />
|
|
193
|
-
</ClayTable>
|
|
194
|
-
);
|
|
195
|
-
expect(container).toMatchSnapshot();
|
|
196
|
-
});
|
|
197
|
-
|
|
198
|
-
it('renders a Cell delimited', () => {
|
|
199
|
-
const {container} = render(
|
|
200
|
-
<ClayTable striped>
|
|
201
|
-
<ClayTable.Head>
|
|
202
|
-
<ClayTable.Row>
|
|
203
|
-
<ClayTable.Cell cellDelimiter="start" headingCell>
|
|
204
|
-
Start
|
|
205
|
-
</ClayTable.Cell>
|
|
206
|
-
<ClayTable.Cell headingCell>
|
|
207
|
-
<button type="button">Dummy</button>
|
|
208
|
-
</ClayTable.Cell>
|
|
209
|
-
<ClayTable.Cell headingCell>
|
|
210
|
-
<button type="button">Dummy</button>
|
|
211
|
-
</ClayTable.Cell>
|
|
212
|
-
<ClayTable.Cell cellDelimiter="end" headingCell>
|
|
213
|
-
End
|
|
214
|
-
</ClayTable.Cell>
|
|
215
|
-
</ClayTable.Row>
|
|
216
|
-
</ClayTable.Head>
|
|
217
|
-
</ClayTable>
|
|
218
|
-
);
|
|
219
|
-
expect(container).toMatchSnapshot();
|
|
220
|
-
});
|
|
221
|
-
|
|
222
|
-
it('renders with a headingTitle', () => {
|
|
223
|
-
const {container} = render(
|
|
224
|
-
<ClayTable>
|
|
225
|
-
<ClayTable.Body>
|
|
226
|
-
<ClayTable.Row divider>
|
|
227
|
-
<ClayTable.Cell colSpan={8}>Recipes</ClayTable.Cell>
|
|
228
|
-
</ClayTable.Row>
|
|
229
|
-
|
|
230
|
-
<ClayTable.Row>
|
|
231
|
-
<ClayTable.Cell expanded headingTitle>
|
|
232
|
-
Hamburger
|
|
233
|
-
</ClayTable.Cell>
|
|
234
|
-
<ClayTable.Cell />
|
|
235
|
-
<ClayTable.Cell>U.S.A</ClayTable.Cell>
|
|
236
|
-
<ClayTable.Cell align="right">10 min.</ClayTable.Cell>
|
|
237
|
-
</ClayTable.Row>
|
|
238
|
-
</ClayTable.Body>
|
|
239
|
-
</ClayTable>
|
|
240
|
-
);
|
|
241
|
-
expect(container).toMatchSnapshot();
|
|
242
|
-
});
|
|
243
|
-
|
|
244
|
-
it('renders with non wrapped cells', () => {
|
|
245
|
-
const {container} = render(
|
|
246
|
-
<ClayTable>
|
|
247
|
-
<ClayTable.Body>
|
|
248
|
-
<ClayTable.Row divider>
|
|
249
|
-
<ClayTable.Cell colSpan={8}>Recipes</ClayTable.Cell>
|
|
250
|
-
</ClayTable.Row>
|
|
251
|
-
|
|
252
|
-
<ClayTable.Row>
|
|
253
|
-
<ClayTable.Cell expanded headingTitle>
|
|
254
|
-
Hamburger
|
|
255
|
-
</ClayTable.Cell>
|
|
256
|
-
<ClayTable.Cell />
|
|
257
|
-
<ClayTable.Cell noWrap>
|
|
258
|
-
Originally from the U.S.A. but available anywhere
|
|
259
|
-
around the world
|
|
260
|
-
</ClayTable.Cell>
|
|
261
|
-
<ClayTable.Cell align="right">10 min.</ClayTable.Cell>
|
|
262
|
-
</ClayTable.Row>
|
|
263
|
-
</ClayTable.Body>
|
|
264
|
-
</ClayTable>
|
|
265
|
-
);
|
|
266
|
-
expect(container).toMatchSnapshot();
|
|
267
|
-
});
|
|
268
|
-
});
|
package/src/index.tsx
DELETED
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SPDX-FileCopyrightText: © 2019 Liferay, Inc. <https://liferay.com>
|
|
3
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import classNames from 'classnames';
|
|
7
|
-
import React from 'react';
|
|
8
|
-
|
|
9
|
-
import Body from './Body';
|
|
10
|
-
import Cell from './Cell';
|
|
11
|
-
import Head from './Head';
|
|
12
|
-
import Row from './Row';
|
|
13
|
-
|
|
14
|
-
type ResposiveSizeType = 'lg' | 'md' | 'sm' | 'xl';
|
|
15
|
-
|
|
16
|
-
type VerticalAlignmentType = 'bottom' | 'middle' | 'top';
|
|
17
|
-
|
|
18
|
-
interface IProps extends React.HTMLAttributes<HTMLTableElement> {
|
|
19
|
-
/**
|
|
20
|
-
* This property vertically align the contents
|
|
21
|
-
* inside the table body according a given position.
|
|
22
|
-
*/
|
|
23
|
-
bodyVerticalAlignment?: VerticalAlignmentType;
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Applies a Bordered style on Table's columns.
|
|
27
|
-
*/
|
|
28
|
-
borderedColumns?: boolean;
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Removes the default border and rounded corners from table.
|
|
32
|
-
*/
|
|
33
|
-
borderless?: boolean;
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* This property keeps all the headings on one line.
|
|
37
|
-
*/
|
|
38
|
-
headingNoWrap?: boolean;
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* This property vertically align the contents
|
|
42
|
-
* inside the table header according a given position.
|
|
43
|
-
*/
|
|
44
|
-
headVerticalAlignment?: VerticalAlignmentType;
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Applies a Hover style on Table.
|
|
48
|
-
*/
|
|
49
|
-
hover?: boolean;
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* This property enables keeping everything on one line.
|
|
53
|
-
*/
|
|
54
|
-
noWrap?: boolean;
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Turns the table responsive.
|
|
58
|
-
*/
|
|
59
|
-
responsive?: boolean;
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Defines the responsive sizing.
|
|
63
|
-
*/
|
|
64
|
-
responsiveSize?: ResposiveSizeType;
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Applies a Striped style on Table.
|
|
68
|
-
*/
|
|
69
|
-
striped?: boolean;
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* This property vertically align the contents
|
|
73
|
-
* inside the table according a given position.
|
|
74
|
-
*/
|
|
75
|
-
tableVerticalAlignment?: VerticalAlignmentType;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
const ClayTable = React.forwardRef<HTMLDivElement, IProps>(
|
|
79
|
-
(
|
|
80
|
-
{
|
|
81
|
-
bodyVerticalAlignment,
|
|
82
|
-
borderedColumns,
|
|
83
|
-
borderless,
|
|
84
|
-
children,
|
|
85
|
-
className,
|
|
86
|
-
headVerticalAlignment,
|
|
87
|
-
headingNoWrap,
|
|
88
|
-
hover = true,
|
|
89
|
-
noWrap,
|
|
90
|
-
responsive = true,
|
|
91
|
-
responsiveSize,
|
|
92
|
-
striped,
|
|
93
|
-
tableVerticalAlignment,
|
|
94
|
-
...otherProps
|
|
95
|
-
}: IProps,
|
|
96
|
-
ref
|
|
97
|
-
) => {
|
|
98
|
-
return (
|
|
99
|
-
<div
|
|
100
|
-
className={classNames({
|
|
101
|
-
'table-responsive': responsive,
|
|
102
|
-
[`table-responsive-${responsiveSize}`]: responsiveSize,
|
|
103
|
-
})}
|
|
104
|
-
ref={ref}
|
|
105
|
-
>
|
|
106
|
-
<table
|
|
107
|
-
className={classNames(
|
|
108
|
-
'table table-autofit',
|
|
109
|
-
{
|
|
110
|
-
'show-quick-actions-on-hover': hover,
|
|
111
|
-
'table-bordered': borderedColumns,
|
|
112
|
-
'table-heading-nowrap': headingNoWrap,
|
|
113
|
-
'table-hover': hover,
|
|
114
|
-
'table-list': !borderless,
|
|
115
|
-
'table-nowrap': noWrap,
|
|
116
|
-
'table-striped': striped,
|
|
117
|
-
[`tbody-valign-${bodyVerticalAlignment}`]:
|
|
118
|
-
bodyVerticalAlignment,
|
|
119
|
-
[`thead-valign-${headVerticalAlignment}`]:
|
|
120
|
-
headVerticalAlignment,
|
|
121
|
-
[`table-valign-${tableVerticalAlignment}`]:
|
|
122
|
-
tableVerticalAlignment,
|
|
123
|
-
},
|
|
124
|
-
className
|
|
125
|
-
)}
|
|
126
|
-
{...otherProps}
|
|
127
|
-
>
|
|
128
|
-
{children}
|
|
129
|
-
</table>
|
|
130
|
-
</div>
|
|
131
|
-
);
|
|
132
|
-
}
|
|
133
|
-
);
|
|
134
|
-
|
|
135
|
-
ClayTable.displayName = 'ClayTable';
|
|
136
|
-
|
|
137
|
-
export default Object.assign(ClayTable, {
|
|
138
|
-
Body,
|
|
139
|
-
Cell,
|
|
140
|
-
Head,
|
|
141
|
-
Row,
|
|
142
|
-
});
|