bitys-react-components 0.1.9 → 0.1.10
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.
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
exports.injectDataGridViewStyles = injectDataGridViewStyles;
|
|
8
|
+
// Conteúdo do CSS em string para injeção no DOM (evita import de .css no build Babel)
|
|
9
|
+
var styleContent = "\nth.sortable {\n color: #2196F3;\n cursor: pointer;\n background-repeat: no-repeat;\n background-position: 95% 50%;\n background-size: 16px;\n}\n.as-react-table .input-group-text:empty{\n display: none;\n}\n.asrt-page-length{\n display: inline-block;\n}\n.asrt-page-length .input-group-addon{\n display: inline-block;\n width: auto;\n margin: 0;\n padding: 0;\n background: #fff;\n border: none;\n}\n.asrt-pagination {\n margin: 0;\n}\n.asrt-td-loading {\n background-color: #fff;\n}\n.asrt-loading-textwrap{\n padding: 5px 0px;\n}\n";
|
|
10
|
+
var STYLE_ID = 'bitys-datagridview-styles';
|
|
11
|
+
function injectDataGridViewStyles() {
|
|
12
|
+
if (typeof document === 'undefined') return;
|
|
13
|
+
if (document.getElementById(STYLE_ID)) return;
|
|
14
|
+
var el = document.createElement('style');
|
|
15
|
+
el.id = STYLE_ID;
|
|
16
|
+
el.textContent = styleContent;
|
|
17
|
+
document.head.appendChild(el);
|
|
18
|
+
}
|
|
19
|
+
var _default = exports["default"] = styleContent;
|
|
@@ -7,11 +7,11 @@ exports["default"] = void 0;
|
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _server = _interopRequireDefault(require("react-dom/server"));
|
|
9
9
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
10
|
-
require("./assets/css/
|
|
10
|
+
var _styleContent = require("./assets/css/styleContent");
|
|
11
11
|
var _TableHeader = _interopRequireDefault(require("./components/TableHeader"));
|
|
12
12
|
var _TableFooter = _interopRequireDefault(require("./components/TableFooter"));
|
|
13
13
|
var _InputCheck = _interopRequireDefault(require("../InputCheck"));
|
|
14
|
-
var
|
|
14
|
+
var _style = _interopRequireDefault(require("./style"));
|
|
15
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
16
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
17
17
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
@@ -257,6 +257,11 @@ var ReactDatatable = /*#__PURE__*/function (_Component) {
|
|
|
257
257
|
var pageNumber = e.target.value;
|
|
258
258
|
this.goToPage(e, pageNumber);
|
|
259
259
|
}
|
|
260
|
+
}, {
|
|
261
|
+
key: "componentDidMount",
|
|
262
|
+
value: function componentDidMount() {
|
|
263
|
+
(0, _styleContent.injectDataGridViewStyles)();
|
|
264
|
+
}
|
|
260
265
|
}, {
|
|
261
266
|
key: "strip",
|
|
262
267
|
value: function strip(html) {
|
|
@@ -573,7 +578,7 @@ var ReactDatatable = /*#__PURE__*/function (_Component) {
|
|
|
573
578
|
extraButtons: this.props.extraButtons
|
|
574
579
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
575
580
|
className: "row table-body asrt-table-body",
|
|
576
|
-
style:
|
|
581
|
+
style: _style["default"].table_body,
|
|
577
582
|
id: this.props.id ? this.props.id + '-table-body' : '',
|
|
578
583
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
579
584
|
className: "col-md-12",
|
|
@@ -592,7 +597,7 @@ var ReactDatatable = /*#__PURE__*/function (_Component) {
|
|
|
592
597
|
if (column.sortable && _this9.state.sort.column == column.key) {
|
|
593
598
|
sortOrder = _this9.state.sort.order;
|
|
594
599
|
classText += sortOrder ? ' ' + sortOrder : '';
|
|
595
|
-
columnStyle = sortOrder == 'asc' ?
|
|
600
|
+
columnStyle = sortOrder == 'asc' ? _style["default"].sort_asc : _style["default"].sort_desc;
|
|
596
601
|
}
|
|
597
602
|
classText += ' text-' + align;
|
|
598
603
|
if (column.TrOnlyClassName) classText += ' ' + column.TrOnlyClassName;
|
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
|
|
7
|
+
// SVGs inline para evitar dependência de assets no build (Babel não copia PNG/CSS)
|
|
8
|
+
var upArrowSvg = "data:image/svg+xml," + encodeURIComponent("<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='%232196F3' d='M8 4l-6 6h12L8 4z'/></svg>");
|
|
9
|
+
var downArrowSvg = "data:image/svg+xml," + encodeURIComponent("<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='%232196F3' d='M8 12l6-6H2l6 6z'/></svg>");
|
|
10
10
|
var _default = exports["default"] = {
|
|
11
11
|
table_body: {
|
|
12
12
|
marginTop: '12px'
|
|
@@ -37,9 +37,9 @@ var _default = exports["default"] = {
|
|
|
37
37
|
marginRight: '5px'
|
|
38
38
|
},
|
|
39
39
|
sort_asc: {
|
|
40
|
-
backgroundImage: "url(".concat(
|
|
40
|
+
backgroundImage: "url(".concat(upArrowSvg, ")")
|
|
41
41
|
},
|
|
42
42
|
sort_desc: {
|
|
43
|
-
backgroundImage: "url(".concat(
|
|
43
|
+
backgroundImage: "url(".concat(downArrowSvg, ")")
|
|
44
44
|
}
|
|
45
45
|
};
|