oolib 2.17.8 → 2.17.11

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,7 +1,8 @@
1
- export function ActionMenu({ icon, invert, actions, align, sideEffect }: {
1
+ export function ActionMenu({ icon, invert, actions, align, iconSize, sideEffect }: {
2
2
  icon?: string;
3
3
  invert: any;
4
4
  actions: any;
5
5
  align?: string;
6
+ iconSize?: string;
6
7
  sideEffect: any;
7
8
  }): JSX.Element;
@@ -43,11 +43,11 @@ var styled_1 = require("./styled");
43
43
  var ActionMenu = function (_a) {
44
44
  var _b, _c;
45
45
  var _d = _a.icon, icon = _d === void 0 ? 'DotsThree' : _d, //most likely will never change
46
- invert = _a.invert, actions = _a.actions, _e = _a.align, align = _e === void 0 ? 'right' : _e, sideEffect = _a.sideEffect // if you want this click to trigger a sideeffect in parent. e.g in table elem we set table overflow to unset when action menu is open
46
+ invert = _a.invert, actions = _a.actions, _e = _a.align, align = _e === void 0 ? 'right' : _e, _f = _a.iconSize, iconSize = _f === void 0 ? 'S' : _f, sideEffect = _a.sideEffect // if you want this click to trigger a sideeffect in parent. e.g in table elem we set table overflow to unset when action menu is open
47
47
  ;
48
48
  var actionMenuRef = (0, react_1.useRef)(null);
49
49
  var optionsWrapperRef = (0, react_1.useRef)(null);
50
- var _f = (0, react_1.useState)(false), showActions = _f[0], setShowActions = _f[1];
50
+ var _g = (0, react_1.useState)(false), showActions = _g[0], setShowActions = _g[1];
51
51
  (0, utils_1.useTrackFocus)(actionMenuRef, setShowActions);
52
52
  (0, react_1.useEffect)(function () {
53
53
  sideEffect && sideEffect(showActions);
@@ -56,7 +56,7 @@ var ActionMenu = function (_a) {
56
56
  return null;
57
57
  var getOpsRect = function () { var _a; return (_a = optionsWrapperRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect(); };
58
58
  return (react_1.default.createElement(styled_1.StyledActionMenu, { ref: actionMenuRef },
59
- react_1.default.createElement(Buttons_1.ButtonGhost, { icon: icon, iconSize: 'M', invert: invert, onClick: function (e) {
59
+ react_1.default.createElement(Buttons_1.ButtonGhost, { icon: icon, iconSize: iconSize, invert: invert, onClick: function (e) {
60
60
  e.stopPropagation();
61
61
  setShowActions(!showActions);
62
62
  }, active: showActions }),
@@ -51,8 +51,10 @@ var ButtonStyledWrapper = function (_a) {
51
51
  var displayText = (link === null || link === void 0 ? void 0 : link.displayText) || children || value;
52
52
  var composition = (icon || iconAfter) && displayText
53
53
  ? "icon+text"
54
- : !displayText && "iconOnly";
55
- var size = composition === 'icon+text'
54
+ : !displayText
55
+ ? "iconOnly"
56
+ : "textOnly";
57
+ var size = ['icon+text', 'textOnly'].indexOf(composition) !== -1
56
58
  ? (S && 'S') || 'M' //icon+text defaults to 'M'
57
59
  : (M && 'M') || 'S'; //iconOnly defaults to 'S'
58
60
  /**
@@ -1,6 +1,13 @@
1
- export function Container({ children, className, style, noPadding }: {
1
+ export function Comp({ children, className, style, noPadding }: {
2
2
  children: any;
3
3
  className: any;
4
4
  style: any;
5
5
  noPadding: any;
6
- }): JSX.Element;
6
+ }, ref: any): JSX.Element;
7
+ export const Container: React.ForwardRefExoticComponent<{
8
+ children: any;
9
+ className: any;
10
+ style: any;
11
+ noPadding: any;
12
+ } & React.RefAttributes<any>>;
13
+ import React from "react";
@@ -10,15 +10,36 @@ var __assign = (this && this.__assign) || function () {
10
10
  };
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
- var __importDefault = (this && this.__importDefault) || function (mod) {
14
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ var desc = Object.getOwnPropertyDescriptor(m, k);
16
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
+ desc = { enumerable: true, get: function() { return m[k]; } };
18
+ }
19
+ Object.defineProperty(o, k2, desc);
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
26
+ }) : function(o, v) {
27
+ o["default"] = v;
28
+ });
29
+ var __importStar = (this && this.__importStar) || function (mod) {
30
+ if (mod && mod.__esModule) return mod;
31
+ var result = {};
32
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
33
+ __setModuleDefault(result, mod);
34
+ return result;
15
35
  };
16
36
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.Container = void 0;
18
- var react_1 = __importDefault(require("react"));
37
+ exports.Container = exports.Comp = void 0;
38
+ var react_1 = __importStar(require("react"));
19
39
  var index_styled_1 = require("./index.styled");
20
- var Container = function (_a) {
40
+ var Comp = function (_a, ref) {
21
41
  var children = _a.children, className = _a.className, style = _a.style, noPadding = _a.noPadding;
22
- return (react_1.default.createElement(index_styled_1.StyledContainer, { className: className || '', style: __assign(__assign({}, (noPadding ? { padding: 0 } : {})), style) }, children));
42
+ return (react_1.default.createElement(index_styled_1.StyledContainer, { ref: ref, className: className || '', style: __assign(__assign({}, (noPadding ? { padding: 0 } : {})), style) }, children));
23
43
  };
24
- exports.Container = Container;
44
+ exports.Comp = Comp;
45
+ exports.Container = (0, react_1.forwardRef)(exports.Comp);
@@ -124,7 +124,7 @@ var TextInput = function (props) {
124
124
  readOnly ? (react_1.default.createElement(Typo_1.SANS_3, { invert: invert }, type === 'password' ? '********' : value)) : (react_1.default.createElement(react_1.default.Fragment, null,
125
125
  react_1.default.createElement(index_styled_1.InputContainerStyled, { invert: invert, type: type, disabled: disabled, status: inputStatus === null || inputStatus === void 0 ? void 0 : inputStatus.type, eyeIcon: eyeIcon, composition: composition },
126
126
  icon && (react_1.default.createElement(DisplayIcon, { icon: icon, size: S ? 15 : 20, onClick: iconOnClick || null })),
127
- react_1.default.createElement(index_styled_1.InputStyled, { className: 'SANS_3', id: id, type: type, name: type, placeholder: placeholder, value: value, onChange: handleOnChange, maxLength: maxNumLimiter, onBlur: handleValidateOnBlur, onFocus: onFocus, size: size, autoComplete: 'off' }),
127
+ react_1.default.createElement(index_styled_1.InputStyled, { className: size === 'S' ? 'SANS_2' : 'SANS_3', id: id, type: type, name: type, placeholder: placeholder, value: value, onChange: handleOnChange, maxLength: maxNumLimiter, onBlur: handleValidateOnBlur, onFocus: onFocus, size: size, autoComplete: 'off' }),
128
128
  inputStatus === 'loading' && (react_1.default.createElement("div", { style: { padding: '1rem 0' } },
129
129
  react_1.default.createElement(Loader_1.Loader, { invert: invert, inline: true }))),
130
130
  actionBtn && (react_1.default.createElement(Buttons_1.ButtonPrimary, { value: actionBtn.text, invert: actionBtn.invert, onClick: actionBtnEnabaled && actionBtn.onClick, disabled: !actionBtnEnabaled, style: { marginRight: '-2rem' } }))),
@@ -40,7 +40,7 @@ var genFontStylingProps = function (props) {
40
40
  if (!type) {
41
41
  continue;
42
42
  }
43
- var value = props[i] ? fontSetting[i].value : false;
43
+ var value = props[i] ? fontSetting[i].value : undefined;
44
44
  newProps[type] = value;
45
45
  }
46
46
  return newProps;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oolib",
3
- "version": "2.17.8",
3
+ "version": "2.17.11",
4
4
  "description": " OKE Component Library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",