oolib 2.12.2 → 2.12.3

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.
@@ -46,13 +46,14 @@ var DisplayIcon = function (_a) {
46
46
  };
47
47
  var ButtonStyledWrapper = function (_a) {
48
48
  var props = _a.props, variant = _a.variant;
49
- var id = props.id, link = props.link, children = props.children, value = props.value, submit = props.submit, icon = props.icon, onClick = props.onClick, onMouseDown = props.onMouseDown, active = props.active, S = props.S, disabled = props.disabled, invert = props.invert, theme = props.theme, width = props.width, onMouseEnter = props.onMouseEnter, onMouseLeave = props.onMouseLeave, color = props.color, style = props.style, className = props.className;
49
+ var id = props.id, link = props.link, children = props.children, value = props.value, submit = props.submit, icon = props.icon, iconAfter = props.iconAfter, onClick = props.onClick, onMouseDown = props.onMouseDown, active = props.active, S = props.S, disabled = props.disabled, invert = props.invert, theme = props.theme, width = props.width, onMouseEnter = props.onMouseEnter, onMouseLeave = props.onMouseLeave, color = props.color, style = props.style, className = props.className;
50
50
  var displayText = (link === null || link === void 0 ? void 0 : link.displayText) || children || value;
51
51
  var size = (S && "S") || 'M';
52
- var composition = icon && displayText ? 'icon+text' : !displayText && 'iconOnly';
52
+ var composition = (icon || iconAfter) && displayText ? 'icon+text' : !displayText && 'iconOnly';
53
53
  return (react_1.default.createElement(index_styled_1.ButtonStyled, { id: id, style: style, className: className, variant: variant, size: size, active: active, invert: invert, disabled: disabled, theme: theme, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, type: submit ? 'submit' : 'button', onClick: onClick, onMouseDown: onMouseDown, composition: composition, width: width, color: color },
54
54
  icon && react_1.default.createElement(DisplayIcon, { icon: icon, size: S ? 15 : 20 }),
55
- displayText && react_1.default.createElement(Typo_1.SANS_3, { semibold: true }, displayText)));
55
+ displayText && react_1.default.createElement(Typo_1.SANS_3, { semibold: true }, displayText),
56
+ iconAfter && react_1.default.createElement(DisplayIcon, { icon: iconAfter, size: S ? 15 : 20 })));
56
57
  };
57
58
  var Button = function (_a) {
58
59
  var props = _a.props, variant = _a.variant;
@@ -1,10 +1,2 @@
1
- export function TabBar({ id, options, value, onChange, updateUrl, style, emptyTabs, queryParamKey }: {
2
- id: any;
3
- options: any;
4
- value: any;
5
- onChange: any;
6
- updateUrl: any;
7
- style: any;
8
- emptyTabs: any;
9
- queryParamKey?: string;
10
- }): JSX.Element;
1
+ export function TabBarStyle1(props: any): JSX.Element;
2
+ export function TabBarStyle2(props: any): JSX.Element;
@@ -1,34 +1,40 @@
1
1
  "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
2
13
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
14
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
15
  };
5
16
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.TabBar = void 0;
17
+ exports.TabBarStyle2 = exports.TabBarStyle1 = void 0;
7
18
  var react_1 = __importDefault(require("react"));
8
19
  var Typo_1 = require("../Typo");
9
20
  var index_styled_1 = require("./index.styled");
10
- var react_router_dom_1 = require("react-router-dom");
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, _b = _a.queryParamKey, queryParamKey = _b === void 0 ? 'activeTab' : _b;
13
- var history = (0, react_router_dom_1.useHistory)();
14
- var location = (0, react_router_dom_1.useLocation)();
15
- var handleClick = function (value) {
16
- if (updateUrl) {
17
- var params = new URLSearchParams(location.search);
18
- params.set(queryParamKey, JSON.stringify(value));
19
- history.push({
20
- search: params.toString(),
21
- });
22
- }
23
- onChange && onChange(null, value);
21
+ var Base = function (_a) {
22
+ var id = _a.id, options = _a.options, valueProp = _a.value, onChange = _a.onChange, style = _a.style, emptyTabs = _a.emptyTabs, _b = _a.tabBarStyle, tabBarStyle = _b === void 0 ? '1' : _b, saveValueAsString = _a.saveValueAsString;
23
+ var value = saveValueAsString ? options.find(function (d) { return d.value === valueProp; }) : valueProp;
24
+ var handleClick = function (v) {
25
+ onChange && onChange(id, saveValueAsString ? v.value : v);
24
26
  };
25
- return (react_1.default.createElement(index_styled_1.TabBarContainerStyled, { id: id },
26
- react_1.default.createElement(index_styled_1.TabBarRowStyled, { id: id }, options.map(function (op) {
27
- var tabHasError = emptyTabs && emptyTabs.includes(op.value);
28
- var tabIsActive = value && op.value === value.value;
29
- return (react_1.default.createElement(index_styled_1.TabBarTabWrapper, { style1: style === "1", key: op.value, active: tabIsActive, error: tabHasError },
30
- react_1.default.createElement(index_styled_1.TabBarTabStyled, { active: tabIsActive, error: tabHasError, style1: style === "1", onClick: function () { return handleClick(op); } },
31
- react_1.default.createElement(Typo_1.SANS_2, { semibold: style === "1" }, op.display))));
32
- }))));
27
+ return (react_1.default.createElement(index_styled_1.TabBarStyled, { style: style },
28
+ react_1.default.createElement(index_styled_1.TabBarContainerStyled, { id: id },
29
+ react_1.default.createElement(index_styled_1.TabBarRowStyled, { id: id }, options.map(function (op) {
30
+ var tabHasError = emptyTabs && emptyTabs.includes(op.value);
31
+ var tabIsActive = value && op.value === value.value;
32
+ return (react_1.default.createElement(index_styled_1.TabBarTabWrapper, { tabBarStyle: tabBarStyle, key: op.value, active: tabIsActive, error: tabHasError },
33
+ react_1.default.createElement(index_styled_1.TabBarTabStyled, { active: tabIsActive, error: tabHasError, tabBarStyle: tabBarStyle, onClick: function () { return handleClick(op); } },
34
+ react_1.default.createElement(Typo_1.SANS_2, { semibold: tabBarStyle === "1" }, op.display))));
35
+ })))));
33
36
  };
34
- exports.TabBar = TabBar;
37
+ var TabBarStyle1 = function (props) { return react_1.default.createElement(Base, __assign({}, props, { tabBarStyle: "1" })); };
38
+ exports.TabBarStyle1 = TabBarStyle1;
39
+ var TabBarStyle2 = function (props) { return react_1.default.createElement(Base, __assign({}, props, { tabBarStyle: "2" })); };
40
+ exports.TabBarStyle2 = TabBarStyle2;
@@ -1,3 +1,4 @@
1
+ export const TabBarStyled: any;
1
2
  export const TabBarContainerStyled: any;
2
3
  export const TabBarRowStyled: any;
3
4
  export const TabBarTabWrapper: any;
@@ -27,7 +27,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
27
27
  return result;
28
28
  };
29
29
  Object.defineProperty(exports, "__esModule", { value: true });
30
- exports.TabBarTabStyled = exports.TabBarTabWrapper = exports.TabBarRowStyled = exports.TabBarContainerStyled = void 0;
30
+ exports.TabBarTabStyled = exports.TabBarTabWrapper = exports.TabBarRowStyled = exports.TabBarContainerStyled = exports.TabBarStyled = void 0;
31
31
  var styled_components_1 = __importStar(require("styled-components"));
32
32
  var themes_1 = require("../../themes");
33
33
  var mixins_1 = require("../../themes/mixins");
@@ -64,14 +64,21 @@ var tabBarTabStyle2 = (0, styled_components_1.css)(templateObject_9 || (template
64
64
  // border-top: ${({ top }) => top && `0.1rem solid ${greyColor5}`};
65
65
  // border-bottom: ${({ bottom }) => bottom && `0.1rem solid ${greyColor5}`};
66
66
  // `;
67
- exports.TabBarContainerStyled = styled_components_1.default.div(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n width: fit-content;\n"], ["\n width: fit-content;\n"])));
68
- exports.TabBarRowStyled = styled_components_1.default.div(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n display: flex;\n"], ["\n display: flex;\n"])));
69
- exports.TabBarTabWrapper = styled_components_1.default.div(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
70
- var style1 = _a.style1;
71
- return (style1 ? tabBarWrapperStyle1 : tabBarWrapperStyle2);
67
+ exports.TabBarStyled = styled_components_1.default.div(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n background-color: ", ";\n z-index: 1000;\n"], ["\n background-color: ", ";\n z-index: 1000;\n"])), white);
68
+ exports.TabBarContainerStyled = styled_components_1.default.div(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n width: fit-content;\n"], ["\n width: fit-content;\n"])));
69
+ exports.TabBarRowStyled = styled_components_1.default.div(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n display: flex;\n"], ["\n display: flex;\n"])));
70
+ exports.TabBarTabWrapper = styled_components_1.default.div(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
71
+ var tabBarStyle = _a.tabBarStyle;
72
+ return (tabBarStyle === '1'
73
+ ? tabBarWrapperStyle1
74
+ : tabBarStyle === '2'
75
+ && tabBarWrapperStyle2);
72
76
  });
73
- exports.TabBarTabStyled = styled_components_1.default.button(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n padding: 0.8rem 2rem;\n cursor: pointer;\n color: ", ";\n background-color: ", ";\n\n border: 0;\n :hover {\n background-color: ", ";\n }\n\n ", "\n"], ["\n padding: 0.8rem 2rem;\n cursor: pointer;\n color: ", ";\n background-color: ", ";\n\n border: 0;\n :hover {\n background-color: ", ";\n }\n\n ", "\n"])), greyColor100, none, none, function (_a) {
74
- var style1 = _a.style1;
75
- return (style1 ? tabBarTabStyle1 : tabBarTabStyle2);
77
+ exports.TabBarTabStyled = styled_components_1.default.button(templateObject_14 || (templateObject_14 = __makeTemplateObject(["\n padding: 0.8rem 2rem;\n cursor: pointer;\n color: ", ";\n background-color: ", ";\n\n border: 0;\n :hover {\n background-color: ", ";\n }\n\n ", "\n"], ["\n padding: 0.8rem 2rem;\n cursor: pointer;\n color: ", ";\n background-color: ", ";\n\n border: 0;\n :hover {\n background-color: ", ";\n }\n\n ", "\n"])), greyColor100, none, none, function (_a) {
78
+ var tabBarStyle = _a.tabBarStyle;
79
+ return (tabBarStyle === '1'
80
+ ? tabBarTabStyle1
81
+ : tabBarStyle === '2'
82
+ && tabBarTabStyle2);
76
83
  });
77
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13;
84
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oolib",
3
- "version": "2.12.2",
3
+ "version": "2.12.3",
4
4
  "description": " OKE Component Library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",