oolib 2.11.0 → 2.11.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.
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
export
|
|
1
|
+
export function TabBar({ id, options, value, onChange, updateUrl, style, emptyTabs, }: {
|
|
2
2
|
id: any;
|
|
3
|
-
options
|
|
3
|
+
options: any;
|
|
4
4
|
value: any;
|
|
5
5
|
onChange: any;
|
|
6
|
-
className: any;
|
|
7
6
|
updateUrl: any;
|
|
8
7
|
style: any;
|
|
9
8
|
emptyTabs: any;
|
|
@@ -3,12 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.TabBar = void 0;
|
|
6
7
|
var react_1 = __importDefault(require("react"));
|
|
7
8
|
var Typo_1 = require("../Typo");
|
|
8
|
-
var
|
|
9
|
+
var index_styled_1 = require("./index.styled");
|
|
9
10
|
var react_router_dom_1 = require("react-router-dom");
|
|
10
|
-
function
|
|
11
|
-
var id = _a.id,
|
|
11
|
+
var TabBar = function (_a) {
|
|
12
|
+
var id = _a.id, options = _a.options, value = _a.value, onChange = _a.onChange, updateUrl = _a.updateUrl, style = _a.style, emptyTabs = _a.emptyTabs;
|
|
12
13
|
var history = (0, react_router_dom_1.useHistory)();
|
|
13
14
|
var location = (0, react_router_dom_1.useLocation)();
|
|
14
15
|
var handleClick = function (value) {
|
|
@@ -21,14 +22,14 @@ function TabBar(_a) {
|
|
|
21
22
|
}
|
|
22
23
|
onChange(null, value);
|
|
23
24
|
};
|
|
24
|
-
return (react_1.default.createElement(
|
|
25
|
-
react_1.default.createElement(
|
|
26
|
-
react_1.default.createElement(
|
|
25
|
+
return (react_1.default.createElement(index_styled_1.TabBarStyled, null,
|
|
26
|
+
react_1.default.createElement(index_styled_1.TabBarContainerStyled, { id: id },
|
|
27
|
+
react_1.default.createElement(index_styled_1.TabBarRowStyled, { id: id }, options.map(function (op) {
|
|
27
28
|
var tabHasError = emptyTabs && emptyTabs.includes(op.value);
|
|
28
29
|
var tabIsActive = value && op.value === value.value;
|
|
29
|
-
return (react_1.default.createElement(
|
|
30
|
-
react_1.default.createElement(
|
|
30
|
+
return (react_1.default.createElement(index_styled_1.TabBarTabWrapper, { style1: style === "1", key: op.value, active: tabIsActive, error: tabHasError },
|
|
31
|
+
react_1.default.createElement(index_styled_1.TabBarTabStyled, { active: tabIsActive, error: tabHasError, style1: style === "1", onClick: function () { return handleClick(op); } },
|
|
31
32
|
react_1.default.createElement(Typo_1.SANS_2, { semibold: style === "1" }, op.display))));
|
|
32
33
|
})))));
|
|
33
|
-
}
|
|
34
|
-
exports.
|
|
34
|
+
};
|
|
35
|
+
exports.TabBar = TabBar;
|
|
File without changes
|
|
File without changes
|