oolib 2.168.1 → 2.168.2
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.
|
@@ -80,8 +80,8 @@ exports.default = {
|
|
|
80
80
|
};
|
|
81
81
|
var TabBar_ = function (args) {
|
|
82
82
|
var options = [
|
|
83
|
-
{ display: "display 1", value: "value1" },
|
|
84
|
-
{ display: "display 2", value: "value2" },
|
|
83
|
+
{ display: "display 1", value: "value1", icon: 'Funnel' },
|
|
84
|
+
{ display: "display 2", value: "value2", icon: 'ListDashes' },
|
|
85
85
|
{ display: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", value: "value3" },
|
|
86
86
|
{ display: "display 3", value: "value4" },
|
|
87
87
|
{ display: "display 4", value: "value5" },
|
|
@@ -25,6 +25,7 @@ var mixins_1 = require("../../../themes/mixins");
|
|
|
25
25
|
var Typo2_1 = require("../Typo2");
|
|
26
26
|
var phosphor_react_1 = require("phosphor-react");
|
|
27
27
|
var colors_1 = require("../../themes/colors");
|
|
28
|
+
var icons_1 = require("../../../icons");
|
|
28
29
|
var Base = function (_a) {
|
|
29
30
|
var id = _a.id, options = _a.options, valueProp = _a.value, onChange = _a.onChange, style = _a.style, errorTabs = _a.errorTabs, disabledTabs = _a.disabledTabs, _b = _a.tabBarStyle, tabBarStyle = _b === void 0 ? '1' : _b, saveValueAsString = _a.saveValueAsString, _c = _a.black, black = _c === void 0 ? false : _c, M = _a.M, S = _a.S, _size = _a.size //use any one of these 3
|
|
30
31
|
;
|
|
@@ -34,6 +35,13 @@ var Base = function (_a) {
|
|
|
34
35
|
var handleClick = function (v) {
|
|
35
36
|
onChange && onChange(id, saveValueAsString ? v.value : v);
|
|
36
37
|
};
|
|
38
|
+
var genIconInTab = function (iconName) {
|
|
39
|
+
var IconComp = icons_1.icons[iconName];
|
|
40
|
+
if (!IconComp)
|
|
41
|
+
return null;
|
|
42
|
+
//else
|
|
43
|
+
return react_1.default.createElement(IconComp, { weight: 'bold', size: 16 });
|
|
44
|
+
};
|
|
37
45
|
return (react_1.default.createElement(index_styled_1.TabBarStyled, { size: size, style: style },
|
|
38
46
|
react_1.default.createElement(index_styled_1.TabBarContainerStyled, { id: id },
|
|
39
47
|
!scrollIsAtStart && (react_1.default.createElement(index_styled_1.StyledDirectionButtons, { left: true },
|
|
@@ -45,7 +53,9 @@ var Base = function (_a) {
|
|
|
45
53
|
var tabIsActive = value && op.value === value.value;
|
|
46
54
|
return (react_1.default.createElement(index_styled_1.TabBarTabWrapper, { tabBarStyle: tabBarStyle, key: op.value, active: tabIsActive, error: tabHasError, disabled: tabIsDisabled, black: black },
|
|
47
55
|
react_1.default.createElement(index_styled_1.TabBarTabStyled, { size: size, active: tabIsActive, error: tabHasError, disabled: tabIsDisabled, tabBarStyle: tabBarStyle, onClick: function () { return handleClick(op); }, black: black },
|
|
48
|
-
react_1.default.createElement(
|
|
56
|
+
react_1.default.createElement("div", { style: { display: 'flex', alignItems: 'center', gap: '0.4rem' } },
|
|
57
|
+
op.icon && genIconInTab(op.icon),
|
|
58
|
+
op.display && react_1.default.createElement(index_styled_1.STYLED_TYPO, { capitalize: true }, op.display)),
|
|
49
59
|
tabHasError && react_1.default.createElement(index_styled_1.StyledDot, { active: tabIsActive, error: tabHasError, tabBarStyle: tabBarStyle }))));
|
|
50
60
|
}))),
|
|
51
61
|
!scrollIsAtEnd && (react_1.default.createElement(index_styled_1.StyledDirectionButtons, { right: true },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oolib",
|
|
3
|
-
"version": "2.168.
|
|
3
|
+
"version": "2.168.2",
|
|
4
4
|
"description": " OKE Component Library",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -71,11 +71,11 @@
|
|
|
71
71
|
"typescript": "^5.4.3"
|
|
72
72
|
},
|
|
73
73
|
"peerDependencies": {
|
|
74
|
+
"date-fns": "^2.0.0",
|
|
74
75
|
"react": "^17.0.2",
|
|
75
76
|
"react-dom": "^17.0.2",
|
|
76
77
|
"react-router-dom": "^6.28.0",
|
|
77
|
-
"styled-components": "^5.3.3"
|
|
78
|
-
"date-fns": "^2.0.0"
|
|
78
|
+
"styled-components": "^5.3.3"
|
|
79
79
|
},
|
|
80
80
|
"config": {
|
|
81
81
|
"commitizen": {
|