@councilbox/councilbox-ui 1.0.1 → 2.0.1
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/dist/HOCs/useDynamicStyles.js +99 -0
- package/dist/HOCs/useRipple.js +91 -0
- package/dist/build-index.js +8 -0
- package/dist/components/1.Introduction.stories.mdx +2 -1
- package/dist/components/2.Changelog.stories.mdx +3 -0
- package/dist/components/3.Guide.stories.mdx +56 -0
- package/dist/components/Accordion/Accordion.css +39 -1
- package/dist/components/Accordion/Accordion.js +84 -45
- package/dist/components/Accordion/Accordion.stories.js +4 -2
- package/dist/components/Accordion/AccordionOld.css +16 -0
- package/dist/components/Accordion/AccordionOld.js +115 -0
- package/dist/components/Accordion/DesignAccordion.stories.js +38 -0
- package/dist/components/Alert/Alert.css +5 -0
- package/dist/components/Alert/Alert.js +17 -6
- package/dist/components/Avatar/Avatar.css +3 -3
- package/dist/components/Avatar/Avatar.js +36 -20
- package/dist/components/Avatar/AvatarOld.js +138 -0
- package/dist/components/Avatar/DesignAvatar.stories.js +1 -1
- package/dist/components/Block/Block.js +17 -2
- package/dist/components/ButtonBasic/ButtonBasic.css +264 -20
- package/dist/components/ButtonBasic/ButtonBasic.js +85 -110
- package/dist/components/ButtonBasic/ButtonBasicOld.css +41 -0
- package/dist/components/ButtonBasic/ButtonBasicOld.js +231 -0
- package/dist/components/Checkbox/Checkbox.css +101 -22
- package/dist/components/Checkbox/Checkbox.js +119 -63
- package/dist/components/Checkbox/CheckboxOld.css +31 -0
- package/dist/components/Checkbox/CheckboxOld.js +112 -0
- package/dist/components/DragDrop/DragDrop.js +24 -9
- package/dist/components/DrawerPanel/DesignDrawerPanel.js +4 -2
- package/dist/components/DrawerPanel/DrawerPanel.css +76 -36
- package/dist/components/DrawerPanel/DrawerPanel.js +137 -115
- package/dist/components/DrawerPanel/DrawerPanelOld.css +56 -0
- package/dist/components/DrawerPanel/DrawerPanelOld.js +233 -0
- package/dist/components/DropDown/DesignDropDown.stories.js +146 -17
- package/dist/components/DropDown/DropDown.css +96 -1
- package/dist/components/DropDown/DropDown.js +308 -82
- package/dist/components/DropDown/DropDown.stories.js +1 -0
- package/dist/components/DropDown/DropDownOld.css +3 -0
- package/dist/components/DropDown/DropDownOld.js +186 -0
- package/dist/components/DropDown/PopoverPlayground.css +22 -0
- package/dist/components/DropDown/PopoverPlayground.js +235 -0
- package/dist/components/EnhancedTable/EnhancedTable.js +5 -6
- package/dist/components/FabButton/DesignFabButton.stories.js +3 -1
- package/dist/components/FabButton/FabButton.js +25 -5
- package/dist/components/Grid/DesignGrid.stories.js +9 -3
- package/dist/components/Grid/Grid.css +325 -0
- package/dist/components/Grid/Grid.js +57 -16
- package/dist/components/Grid/GridItem.js +31 -13
- package/dist/components/Grid/GridItemOld.js +43 -0
- package/dist/components/Grid/GridOld.css +0 -0
- package/dist/components/Grid/GridOld.js +53 -0
- package/dist/components/Header/Header.js +95 -116
- package/dist/components/IconButton/DesignIconButton.stories.js +22 -2
- package/dist/components/IconButton/IconButton.css +121 -1
- package/dist/components/IconButton/IconButton.js +98 -53
- package/dist/components/IconButton/IconButtonOld.css +0 -0
- package/dist/components/IconButton/IconButtonOld.js +138 -0
- package/dist/components/IconButtonSquare/IconButtonSquare.js +20 -90
- package/dist/components/IconButtonSquare/IconButtonSquareOld.css +43 -0
- package/dist/components/IconButtonSquare/IconButtonSquareOld.js +133 -0
- package/dist/components/InputAutocomplete/InputAutocomplete.css +109 -0
- package/dist/components/InputAutocomplete/InputAutocomplete.js +382 -76
- package/dist/components/InputAutocomplete/InputAutocomplete.stories.js +118 -6
- package/dist/components/InputAutocomplete/InputAutocompleteOld.css +5 -0
- package/dist/components/InputAutocomplete/InputAutocompleteOld.js +178 -0
- package/dist/components/InputPassword/InputPassword.js +10 -20
- package/dist/components/InputText/InputText.css +442 -1
- package/dist/components/InputText/InputText.js +298 -239
- package/dist/components/InputText/InputText.stories.js +12 -3
- package/dist/components/InputText/InputTextOld.css +10 -0
- package/dist/components/InputText/InputTextOld.js +340 -0
- package/dist/components/InputTextArea/DesignInputTextArea.stories.js +30 -4
- package/dist/components/InputTextArea/InputTextArea.js +13 -6
- package/dist/components/LoadingSection/LoadingSection.css +44 -2
- package/dist/components/LoadingSection/LoadingSection.js +63 -9
- package/dist/components/MenuItem/DesignMenuItem.stories.js +1 -0
- package/dist/components/MenuItem/MenuItem.css +35 -6
- package/dist/components/MenuItem/MenuItem.js +99 -50
- package/dist/components/MenuItem/MenuItemOld.js +139 -0
- package/dist/components/MenuLateralLeft/MenuLateralLeft.js +60 -40
- package/dist/components/MenuLateralRight/MenuLateralRight.js +23 -8
- package/dist/components/Modal/DesignModal.stories.js +54 -0
- package/dist/components/Modal/Modal.css +81 -2
- package/dist/components/Modal/Modal.js +112 -80
- package/dist/components/Modal/Modal.stories.js +13 -2
- package/dist/components/Modal/ModalOld.css +3 -0
- package/dist/components/Modal/ModalOld.js +230 -0
- package/dist/components/PaginationFooter/DesignPaginationFooter.stories.js +9 -1
- package/dist/components/PaginationFooter/PaginationFooter.css +73 -0
- package/dist/components/PaginationFooter/PaginationFooter.js +45 -87
- package/dist/components/RadioButton/Radio.css +115 -16
- package/dist/components/RadioButton/Radio.js +70 -94
- package/dist/components/RadioButton/Radio.stories.js +42 -18
- package/dist/components/RadioButton/RadioOld.css +31 -0
- package/dist/components/RadioButton/RadioOld.js +142 -0
- package/dist/components/Ripple/DesignRipple.js +77 -0
- package/dist/components/Ripple/Ripple.stories.js +45 -0
- package/dist/components/Scrollbar/Scrollbar.js +21 -6
- package/dist/components/SelectInput/DesignSelectInput.js +62 -23
- package/dist/components/SelectInput/SelectInput.css +128 -10
- package/dist/components/SelectInput/SelectInput.js +265 -244
- package/dist/components/SelectInput/SelectInputOld.css +17 -0
- package/dist/components/SelectInput/SelectInputOld.js +325 -0
- package/dist/components/Stars/Stars.css +28 -28
- package/dist/components/Stars/Stars.js +22 -12
- package/dist/components/Stepper/Stepper.css +1 -0
- package/dist/components/Stepper/Stepper.js +81 -24
- package/dist/components/Table/DesignTable.stories.js +1 -0
- package/dist/components/Table/Table.css +56 -53
- package/dist/components/Table/Table.js +55 -75
- package/dist/components/Table/TableOld.css +79 -0
- package/dist/components/Table/TableOld.js +165 -0
- package/dist/components/Tabs/DesignTabs.js +37 -12
- package/dist/components/Tabs/Tabs.css +39 -4
- package/dist/components/Tabs/Tabs.js +194 -30
- package/dist/components/Tabs/Tabs.stories.js +8 -1
- package/dist/components/Tabs/TabsOld.js +92 -0
- package/dist/components/Tag/Tag.js +19 -9
- package/dist/components/Toggle/Toggle.css +122 -3
- package/dist/components/Toggle/Toggle.js +95 -68
- package/dist/components/Tooltip/DesignTooltip.stories.js +48 -0
- package/dist/components/Tooltip/Tooltip.css +75 -0
- package/dist/components/Tooltip/Tooltip.js +126 -0
- package/dist/components/Tooltip/Tooltip.stories.js +40 -0
- package/dist/components/Typography/Typography.css +9 -0
- package/dist/components/Typography/Typography.js +30 -21
- package/dist/components/Typography/TypographyOld.js +132 -0
- package/dist/styles/colorConsts.css +24 -0
- package/dist/styles/main.css +41 -49
- package/dist/styles/scpacingConsts.css +26 -0
- package/dist/styles/zIndexConsts.css +9 -0
- package/dist/testing/TestAutocomplete.js +369 -0
- package/dist/testing/TestComponents.js +3 -114
- package/dist/testing/TestDropdown.js +225 -0
- package/dist/utils/autoDetectScroll.js +127 -0
- package/dist/utils/index.js +141 -0
- package/package.json +2 -1
|
@@ -19,12 +19,34 @@ var _Typography = _interopRequireDefault(require("../Typography/Typography"));
|
|
|
19
19
|
|
|
20
20
|
var _useWindowSize2 = _interopRequireDefault(require("../../HOCs/useWindowSize"));
|
|
21
21
|
|
|
22
|
-
var
|
|
22
|
+
var _useDynamicStyles2 = _interopRequireDefault(require("../../HOCs/useDynamicStyles"));
|
|
23
|
+
|
|
24
|
+
var _useRipple3 = _interopRequireDefault(require("../../HOCs/useRipple"));
|
|
25
|
+
|
|
26
|
+
var _excluded = ["items", "active", "onClick", "freeNavigation", "style", "sx"];
|
|
23
27
|
|
|
24
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
29
|
|
|
30
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
31
|
+
|
|
32
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
33
|
+
|
|
34
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
35
|
+
|
|
36
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
37
|
+
|
|
38
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
39
|
+
|
|
40
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
41
|
+
|
|
26
42
|
function _extends() { _extends = Object.assign || 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); }
|
|
27
43
|
|
|
44
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
45
|
+
|
|
46
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
47
|
+
|
|
48
|
+
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; }
|
|
49
|
+
|
|
28
50
|
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; }
|
|
29
51
|
|
|
30
52
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
@@ -35,20 +57,25 @@ var Stepper = function Stepper(_ref) {
|
|
|
35
57
|
_onClick = _ref.onClick,
|
|
36
58
|
_ref$freeNavigation = _ref.freeNavigation,
|
|
37
59
|
freeNavigation = _ref$freeNavigation === void 0 ? true : _ref$freeNavigation,
|
|
60
|
+
style = _ref.style,
|
|
61
|
+
sx = _ref.sx,
|
|
38
62
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
39
63
|
|
|
40
|
-
var
|
|
41
|
-
|
|
64
|
+
var _useDynamicStyles = (0, _useDynamicStyles2.default)(sx),
|
|
65
|
+
stylesInLine = _useDynamicStyles.stylesInLine,
|
|
66
|
+
prefixClass = _useDynamicStyles.prefixClass;
|
|
42
67
|
|
|
43
68
|
return /*#__PURE__*/_react.default.createElement("div", _extends({
|
|
44
|
-
className:
|
|
45
|
-
}, props
|
|
69
|
+
className: prefixClass('cbx-stepper-container')
|
|
70
|
+
}, props, {
|
|
71
|
+
style: _objectSpread(_objectSpread({}, style), stylesInLine)
|
|
72
|
+
}), items.map(function (item, index) {
|
|
46
73
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
47
74
|
onClick: function onClick() {
|
|
48
75
|
return freeNavigation && _onClick(item.name);
|
|
49
76
|
},
|
|
50
77
|
key: index,
|
|
51
|
-
className:
|
|
78
|
+
className: prefixClass('cbx-stepper-item'),
|
|
52
79
|
style: {
|
|
53
80
|
flex: items.length - 1 !== index && '1 1',
|
|
54
81
|
maxWidth: "".concat('100' / (items.length - 1), "%"),
|
|
@@ -56,34 +83,64 @@ var Stepper = function Stepper(_ref) {
|
|
|
56
83
|
}
|
|
57
84
|
}, /*#__PURE__*/_react.default.createElement(_Tooltip.default, {
|
|
58
85
|
title: item.text || ''
|
|
59
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
},
|
|
67
|
-
className:
|
|
68
|
-
}), innerWidth > 875 && item.text && /*#__PURE__*/_react.default.createElement("div", {
|
|
69
|
-
className: "cbx-stepper-item-text"
|
|
70
|
-
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
71
|
-
color: active === item.name || items.slice(index + 1).some(function (i) {
|
|
72
|
-
return i.name === active;
|
|
73
|
-
}) ? 'var(--primary)' : 'var(--gray4)'
|
|
74
|
-
}, item.text)))), items.length - 1 !== index && /*#__PURE__*/_react.default.createElement("div", {
|
|
75
|
-
className: "cbx-stepper-item-arrow-content",
|
|
86
|
+
}, /*#__PURE__*/_react.default.createElement(ItemStepper, {
|
|
87
|
+
items: items,
|
|
88
|
+
item: item,
|
|
89
|
+
prefixClass: prefixClass,
|
|
90
|
+
active: active,
|
|
91
|
+
index: index,
|
|
92
|
+
freeNavigation: freeNavigation
|
|
93
|
+
})), items.length - 1 !== index && /*#__PURE__*/_react.default.createElement("div", {
|
|
94
|
+
className: prefixClass('cbx-stepper-item-arrow-content'),
|
|
76
95
|
onClick: function onClick(e) {
|
|
77
96
|
e.stopPropagation();
|
|
78
97
|
e.preventDefault();
|
|
79
98
|
}
|
|
80
99
|
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
81
|
-
className: "cbx-stepper-item-arrow-icon ri-arrow-drop-right-line"
|
|
100
|
+
className: "".concat(prefixClass('cbx-stepper-item-arrow-icon'), " ri-arrow-drop-right-line")
|
|
82
101
|
})));
|
|
83
102
|
}));
|
|
84
103
|
};
|
|
85
104
|
|
|
86
105
|
Stepper.displayName = "Stepper";
|
|
106
|
+
|
|
107
|
+
var ItemStepper = function ItemStepper(_ref2) {
|
|
108
|
+
var items = _ref2.items,
|
|
109
|
+
item = _ref2.item,
|
|
110
|
+
prefixClass = _ref2.prefixClass,
|
|
111
|
+
active = _ref2.active,
|
|
112
|
+
index = _ref2.index,
|
|
113
|
+
freeNavigation = _ref2.freeNavigation;
|
|
114
|
+
|
|
115
|
+
var _useRipple = (0, _useRipple3.default)(),
|
|
116
|
+
_useRipple2 = _slicedToArray(_useRipple, 2),
|
|
117
|
+
addRipple = _useRipple2[0],
|
|
118
|
+
ripples = _useRipple2[1];
|
|
119
|
+
|
|
120
|
+
var _useWindowSize = (0, _useWindowSize2.default)(),
|
|
121
|
+
innerWidth = _useWindowSize.innerWidth;
|
|
122
|
+
|
|
123
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
124
|
+
onClick: freeNavigation ? addRipple : null,
|
|
125
|
+
className: prefixClass("cbx-ripple ".concat(innerWidth < 875 ? "cbx-stepper-item-contentText ".concat(active === item.name && 'cbx-stepper-item-active', " ").concat(freeNavigation && 'cbx-stepper-item-contentText-hover', " cbx-stepper-item-contentText-mobile") : "cbx-stepper-item-contentText ".concat(active === item.name && 'cbx-stepper-item-active', " ").concat(freeNavigation && 'cbx-stepper-item-contentText-hover'))),
|
|
126
|
+
style: {
|
|
127
|
+
color: active === item.name || items.slice(index + 1).some(function (i) {
|
|
128
|
+
return i.name === active;
|
|
129
|
+
}) ? 'var(--primary)' : 'var(--gray4)'
|
|
130
|
+
}
|
|
131
|
+
}, item.icon && /*#__PURE__*/_react.default.createElement("i", {
|
|
132
|
+
className: "".concat(prefixClass('cbx-stepper-item-text-icon'), " ").concat(item.icon)
|
|
133
|
+
}), innerWidth > 875 && item.text && /*#__PURE__*/_react.default.createElement("div", {
|
|
134
|
+
className: prefixClass('cbx-stepper-item-text')
|
|
135
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
136
|
+
prefixClass: prefixClass,
|
|
137
|
+
color: active === item.name || items.slice(index + 1).some(function (i) {
|
|
138
|
+
return i.name === active;
|
|
139
|
+
}) ? 'var(--primary)' : 'var(--gray4)'
|
|
140
|
+
}, item.text)), ripples);
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
ItemStepper.displayName = "ItemStepper";
|
|
87
144
|
Stepper.propTypes = {
|
|
88
145
|
items: _propTypes.default.array,
|
|
89
146
|
active: _propTypes.default.node,
|
|
@@ -13,6 +13,7 @@ var _Table = require("./Table");
|
|
|
13
13
|
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
|
|
16
|
+
// import { TableOld, TableBodyOld, TableCellOld, TableHeadOld, TableRowOld } from './TableOld';
|
|
16
17
|
var DesignTable = function DesignTable(_ref) {
|
|
17
18
|
var stickyHeader = _ref.stickyHeader,
|
|
18
19
|
lastResponsive = _ref.lastResponsive;
|
|
@@ -1,79 +1,82 @@
|
|
|
1
|
-
.cbx-table
|
|
1
|
+
.cbx-table {
|
|
2
|
+
display: table;
|
|
2
3
|
width: 100%;
|
|
4
|
+
border-collapse: collapse;
|
|
5
|
+
border-spacing: 0px;
|
|
3
6
|
}
|
|
4
7
|
|
|
5
|
-
.cbx-table-
|
|
6
|
-
|
|
8
|
+
.cbx-table-thead {
|
|
9
|
+
display: table-header-group;
|
|
7
10
|
}
|
|
8
11
|
|
|
9
|
-
.cbx-table
|
|
10
|
-
padding: 0.625rem 0.75rem !important;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.cbx-table td {
|
|
14
|
-
padding: var(--spacing12) !important;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.cbx-table thead tr {
|
|
12
|
+
.cbx-table-thead tr {
|
|
18
13
|
height: var(--spacing52);
|
|
19
14
|
position: relative;
|
|
15
|
+
color: inherit;
|
|
16
|
+
display: table-row;
|
|
17
|
+
vertical-align: middle;
|
|
18
|
+
outline: 0px;
|
|
20
19
|
}
|
|
21
20
|
|
|
22
|
-
.cbx-table
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
width: 4.438rem;
|
|
35
|
-
position: sticky;
|
|
36
|
-
right: 0;
|
|
37
|
-
text-align: center;
|
|
38
|
-
background: white;
|
|
39
|
-
padding: 0;
|
|
40
|
-
margin: 0;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.lastResponsive tr>td:last-child {
|
|
44
|
-
min-height: 3.938rem;
|
|
21
|
+
.cbx-table-thead tr th,
|
|
22
|
+
.cbx-table-thead tr td {
|
|
23
|
+
font-family: var(--font-primary);
|
|
24
|
+
font-weight: 500;
|
|
25
|
+
font-size: 1rem;
|
|
26
|
+
line-height: 1.71429rem;
|
|
27
|
+
display: table-cell;
|
|
28
|
+
vertical-align: inherit;
|
|
29
|
+
border-bottom: 1px solid rgb(224, 224, 224);
|
|
30
|
+
text-align: left;
|
|
31
|
+
color: var(--gray3);
|
|
32
|
+
padding: 0.625rem 0.75rem !important;
|
|
45
33
|
}
|
|
46
34
|
|
|
47
|
-
.
|
|
48
|
-
|
|
35
|
+
.cbx-table-tbody {
|
|
36
|
+
display: table-row-group;
|
|
49
37
|
}
|
|
50
38
|
|
|
51
|
-
.
|
|
52
|
-
|
|
53
|
-
|
|
39
|
+
.cbx-table-tbody tr {
|
|
40
|
+
height: var(--spacing64);
|
|
41
|
+
color: inherit;
|
|
42
|
+
display: table-row;
|
|
43
|
+
vertical-align: middle;
|
|
44
|
+
outline: 0px;
|
|
54
45
|
}
|
|
55
46
|
|
|
56
|
-
.
|
|
57
|
-
|
|
47
|
+
.cbx-table-tbody tr td {
|
|
48
|
+
font-family: var(--font-primary);
|
|
49
|
+
font-weight: 400;
|
|
50
|
+
font-size: 1rem;
|
|
51
|
+
line-height: 1.43;
|
|
52
|
+
display: table-cell;
|
|
53
|
+
vertical-align: inherit;
|
|
54
|
+
border-bottom: 1px solid rgb(224, 224, 224);
|
|
55
|
+
text-align: left;
|
|
56
|
+
color: var(--gray3);
|
|
57
|
+
padding: var(--spacing12) !important;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
.
|
|
61
|
-
.lastResponsive tr>th:last-child div {
|
|
62
|
-
box-shadow: -4px 0px 4px rgba(0, 0, 0, 0.25);
|
|
63
|
-
width: 4rem;
|
|
60
|
+
.sort-label {
|
|
64
61
|
display: flex;
|
|
65
62
|
align-items: center;
|
|
66
|
-
justify-content: center;
|
|
67
63
|
}
|
|
68
64
|
|
|
69
|
-
.
|
|
70
|
-
|
|
65
|
+
.sort-icon {
|
|
66
|
+
margin-left: 5px;
|
|
67
|
+
display: inline-block;
|
|
71
68
|
}
|
|
72
69
|
|
|
73
|
-
.
|
|
74
|
-
|
|
70
|
+
.cbx-table {
|
|
71
|
+
width: 100%;
|
|
72
|
+
border-collapse: collapse;
|
|
75
73
|
}
|
|
76
74
|
|
|
77
|
-
.
|
|
78
|
-
|
|
75
|
+
.cbx-table.sticky-header thead tr {
|
|
76
|
+
position: sticky;
|
|
77
|
+
top: 0;
|
|
78
|
+
background-color: white;
|
|
79
|
+
/* Asegúrate de que tenga un fondo */
|
|
80
|
+
z-index: 1;
|
|
81
|
+
/* Asegúrate de que el encabezado esté por encima de las filas */
|
|
79
82
|
}
|
|
@@ -5,37 +5,30 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.TableSortLabel = exports.TableRow = exports.TableHead = exports.TableContainer = exports.TableCell = exports.TableBody = exports.Table = void 0;
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var _TableCell = _interopRequireDefault(require("@mui/material/TableCell"));
|
|
13
|
-
|
|
14
|
-
var _TableContainer = _interopRequireDefault(require("@mui/material/TableContainer"));
|
|
15
|
-
|
|
16
|
-
var _TableHead = _interopRequireDefault(require("@mui/material/TableHead"));
|
|
10
|
+
require("./Table.css");
|
|
17
11
|
|
|
18
|
-
var
|
|
12
|
+
var _excluded = ["lastResponsive", "stickyHeader", "children"],
|
|
13
|
+
_excluded2 = ["children", "hover", "selected", "onClick", "className"],
|
|
14
|
+
_excluded3 = ["children"],
|
|
15
|
+
_excluded4 = ["children"],
|
|
16
|
+
_excluded5 = ["children", "align"],
|
|
17
|
+
_excluded6 = ["children"];
|
|
19
18
|
|
|
20
|
-
|
|
19
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
20
|
|
|
22
|
-
|
|
21
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
23
22
|
|
|
24
|
-
|
|
25
|
-
_excluded2 = ["children", "component", "hover", "selected", "onClick", "className"],
|
|
26
|
-
_excluded3 = ["children", "component"],
|
|
27
|
-
_excluded4 = ["children", "component"],
|
|
28
|
-
_excluded5 = ["children", "active", "direction", "onClick", "hideSortIcon", "IconComponent"],
|
|
29
|
-
_excluded6 = ["children", "component", "padding", "scope", "size", "sortDirection", "variant", "align", "sx"],
|
|
30
|
-
_excluded7 = ["children", "component"];
|
|
23
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
31
24
|
|
|
32
|
-
function
|
|
25
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
33
26
|
|
|
34
|
-
function
|
|
27
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
35
28
|
|
|
36
|
-
function
|
|
29
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
37
30
|
|
|
38
|
-
function
|
|
31
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
39
32
|
|
|
40
33
|
function _extends() { _extends = Object.assign || 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); }
|
|
41
34
|
|
|
@@ -45,11 +38,13 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
45
38
|
|
|
46
39
|
var Table = function Table(_ref) {
|
|
47
40
|
var lastResponsive = _ref.lastResponsive,
|
|
41
|
+
stickyHeader = _ref.stickyHeader,
|
|
42
|
+
children = _ref.children,
|
|
48
43
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
49
44
|
|
|
50
|
-
return /*#__PURE__*/
|
|
51
|
-
className: lastResponsive ? 'cbx-table lastResponsive' : 'cbx-table'
|
|
52
|
-
}, props));
|
|
45
|
+
return /*#__PURE__*/_react.default.createElement("table", _extends({
|
|
46
|
+
className: "".concat(lastResponsive ? 'cbx-table lastResponsive' : 'cbx-table', " ").concat(stickyHeader ? 'sticky-header' : '')
|
|
47
|
+
}, props), children);
|
|
53
48
|
};
|
|
54
49
|
|
|
55
50
|
exports.Table = Table;
|
|
@@ -57,18 +52,14 @@ Table.displayName = "Table";
|
|
|
57
52
|
|
|
58
53
|
var TableRow = function TableRow(_ref2) {
|
|
59
54
|
var children = _ref2.children,
|
|
60
|
-
component = _ref2.component,
|
|
61
55
|
hover = _ref2.hover,
|
|
62
56
|
selected = _ref2.selected,
|
|
63
57
|
onClick = _ref2.onClick,
|
|
64
58
|
className = _ref2.className,
|
|
65
59
|
props = _objectWithoutProperties(_ref2, _excluded2);
|
|
66
60
|
|
|
67
|
-
return /*#__PURE__*/
|
|
68
|
-
className: className,
|
|
69
|
-
component: component,
|
|
70
|
-
hover: hover,
|
|
71
|
-
selected: selected,
|
|
61
|
+
return /*#__PURE__*/_react.default.createElement("tr", _extends({
|
|
62
|
+
className: "".concat(className || '', " ").concat(hover ? 'hover' : '', " ").concat(selected ? 'selected' : ''),
|
|
72
63
|
onClick: onClick
|
|
73
64
|
}, props), children);
|
|
74
65
|
};
|
|
@@ -78,11 +69,10 @@ TableRow.displayName = "TableRow";
|
|
|
78
69
|
|
|
79
70
|
var TableBody = function TableBody(_ref3) {
|
|
80
71
|
var children = _ref3.children,
|
|
81
|
-
component = _ref3.component,
|
|
82
72
|
props = _objectWithoutProperties(_ref3, _excluded3);
|
|
83
73
|
|
|
84
|
-
return /*#__PURE__*/
|
|
85
|
-
|
|
74
|
+
return /*#__PURE__*/_react.default.createElement("tbody", _extends({
|
|
75
|
+
className: "cbx-table-tbody"
|
|
86
76
|
}, props), children);
|
|
87
77
|
};
|
|
88
78
|
|
|
@@ -91,11 +81,10 @@ TableBody.displayName = "TableBody";
|
|
|
91
81
|
|
|
92
82
|
var TableHead = function TableHead(_ref4) {
|
|
93
83
|
var children = _ref4.children,
|
|
94
|
-
component = _ref4.component,
|
|
95
84
|
props = _objectWithoutProperties(_ref4, _excluded4);
|
|
96
85
|
|
|
97
|
-
return /*#__PURE__*/
|
|
98
|
-
|
|
86
|
+
return /*#__PURE__*/_react.default.createElement("thead", _extends({
|
|
87
|
+
className: "cbx-table-thead"
|
|
99
88
|
}, props), children);
|
|
100
89
|
};
|
|
101
90
|
|
|
@@ -104,20 +93,26 @@ TableHead.displayName = "TableHead";
|
|
|
104
93
|
|
|
105
94
|
var TableSortLabel = function TableSortLabel(_ref5) {
|
|
106
95
|
var children = _ref5.children,
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
96
|
+
onSort = _ref5.onSort;
|
|
97
|
+
|
|
98
|
+
var _React$useState = _react.default.useState('asc'),
|
|
99
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
100
|
+
direction = _React$useState2[0],
|
|
101
|
+
setDirection = _React$useState2[1];
|
|
102
|
+
|
|
103
|
+
var handleSort = function handleSort() {
|
|
104
|
+
var newDirection = direction === 'asc' ? 'desc' : 'asc';
|
|
105
|
+
setDirection(newDirection);
|
|
106
|
+
|
|
107
|
+
if (onSort) {
|
|
108
|
+
onSort(newDirection);
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
return /*#__PURE__*/_react.default.createElement("span", {
|
|
113
|
+
className: "sort-label",
|
|
114
|
+
onClick: handleSort
|
|
115
|
+
}, children, direction === 'asc' ? '↑' : '↓');
|
|
121
116
|
};
|
|
122
117
|
|
|
123
118
|
exports.TableSortLabel = TableSortLabel;
|
|
@@ -125,27 +120,13 @@ TableSortLabel.displayName = "TableSortLabel";
|
|
|
125
120
|
|
|
126
121
|
var TableCell = function TableCell(_ref6) {
|
|
127
122
|
var children = _ref6.children,
|
|
128
|
-
component = _ref6.component,
|
|
129
|
-
padding = _ref6.padding,
|
|
130
|
-
scope = _ref6.scope,
|
|
131
|
-
size = _ref6.size,
|
|
132
|
-
sortDirection = _ref6.sortDirection,
|
|
133
|
-
variant = _ref6.variant,
|
|
134
123
|
align = _ref6.align,
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
scope: scope,
|
|
142
|
-
size: size,
|
|
143
|
-
sortDirection: sortDirection,
|
|
144
|
-
variant: variant,
|
|
145
|
-
align: align,
|
|
146
|
-
sx: _objectSpread({
|
|
147
|
-
color: 'var(--gray3)'
|
|
148
|
-
}, sx)
|
|
124
|
+
props = _objectWithoutProperties(_ref6, _excluded5);
|
|
125
|
+
|
|
126
|
+
return /*#__PURE__*/_react.default.createElement("td", _extends({
|
|
127
|
+
style: {
|
|
128
|
+
textAlign: align
|
|
129
|
+
}
|
|
149
130
|
}, props), children);
|
|
150
131
|
};
|
|
151
132
|
|
|
@@ -154,11 +135,10 @@ TableCell.displayName = "TableCell";
|
|
|
154
135
|
|
|
155
136
|
var TableContainer = function TableContainer(_ref7) {
|
|
156
137
|
var children = _ref7.children,
|
|
157
|
-
|
|
158
|
-
props = _objectWithoutProperties(_ref7, _excluded7);
|
|
138
|
+
props = _objectWithoutProperties(_ref7, _excluded6);
|
|
159
139
|
|
|
160
|
-
return /*#__PURE__*/
|
|
161
|
-
|
|
140
|
+
return /*#__PURE__*/_react.default.createElement("div", _extends({
|
|
141
|
+
className: "table-container"
|
|
162
142
|
}, props), children);
|
|
163
143
|
};
|
|
164
144
|
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
.cbx-table-container {
|
|
2
|
+
width: 100%;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.cbx-table-container-loadingSection {
|
|
6
|
+
margin-top: 3rem;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.cbx-table th {
|
|
10
|
+
padding: 0.625rem 0.75rem !important;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.cbx-table td {
|
|
14
|
+
padding: var(--spacing12) !important;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.cbx-table thead tr {
|
|
18
|
+
height: var(--spacing52);
|
|
19
|
+
position: relative;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.cbx-table tbody tr {
|
|
23
|
+
height: var(--spacing64);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.lastResponsive th,
|
|
27
|
+
.lastResponsive td {
|
|
28
|
+
padding: 0 !important;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.lastResponsive tr>td:last-child,
|
|
32
|
+
.lastResponsive tr>th:last-child {
|
|
33
|
+
min-width: 4.438rem;
|
|
34
|
+
width: 4.438rem;
|
|
35
|
+
position: sticky;
|
|
36
|
+
right: 0;
|
|
37
|
+
text-align: center;
|
|
38
|
+
background: white;
|
|
39
|
+
padding: 0;
|
|
40
|
+
margin: 0;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.lastResponsive tr>td:last-child {
|
|
44
|
+
min-height: 3.938rem;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.lastResponsive tr>th:last-child {
|
|
48
|
+
height: var(--spacing52);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.lastResponsive tr>td:last-child {
|
|
52
|
+
display: flex;
|
|
53
|
+
justify-content: flex-end;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.lastResponsive tr>th:last-child div {
|
|
57
|
+
float: right;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.lastResponsive tr>td:last-child div,
|
|
61
|
+
.lastResponsive tr>th:last-child div {
|
|
62
|
+
box-shadow: -4px 0px 4px rgba(0, 0, 0, 0.25);
|
|
63
|
+
width: 4rem;
|
|
64
|
+
display: flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
justify-content: center;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.lastResponsive tr>td:last-child div{
|
|
70
|
+
min-height: 3.938rem;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.lastResponsive tr>th:last-child div {
|
|
74
|
+
height: 3.188rem;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.lastResponsive tr>th:last-child {
|
|
78
|
+
z-index: 20 !important;
|
|
79
|
+
}
|