ttm-react-library
Advanced tools
Comparing version 1.0.2 to 1.0.6
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } | ||
var React = _interopDefault(require('react')); | ||
var React$1 = require('react'); | ||
var React$1__default = _interopDefault(React$1); | ||
var styles = {"test":"_3ybTi"}; | ||
function _extends() { | ||
_extends = Object.assign || function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i]; | ||
var ExampleComponent = function ExampleComponent(_ref) { | ||
var text = _ref.text; | ||
return /*#__PURE__*/React.createElement("div", { | ||
className: styles.test | ||
}, "Example Component: ", text); | ||
for (var key in source) { | ||
if (Object.prototype.hasOwnProperty.call(source, key)) { | ||
target[key] = source[key]; | ||
} | ||
} | ||
} | ||
return target; | ||
}; | ||
return _extends.apply(this, arguments); | ||
} | ||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
if (source == null) return {}; | ||
var target = {}; | ||
var sourceKeys = Object.keys(source); | ||
var key, i; | ||
for (i = 0; i < sourceKeys.length; i++) { | ||
key = sourceKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
target[key] = source[key]; | ||
} | ||
return target; | ||
} | ||
var access = function access(accesses, pages) { | ||
return accesses.findIndex(function (item) { | ||
return item === pages; | ||
}) < 0; | ||
}; | ||
exports.ExampleComponent = ExampleComponent; | ||
var React = require('react'); | ||
var ReactDOM = require('react-dom'); | ||
var globalStyle = {"intercom-lightweight-app":"_1vskv","page__wrapper":"_35Y-6","small-text":"_27KVU","medium-text":"_1XO0z","big-text":"_rbeME","close-button":"_gL_Wx","button-link-table":"_I5ecV","autocomplete_hack":"_2xaJP","gfs-h1":"_3GABt","gfs-h2":"_3SIK8","gfs-caps":"_1Tdp9","gfs-status-symbol":"_3ysMx","gfs-bold":"_23LvJ","gfs-body":"_2hT_r","gfs-link":"_2q1U_","gfs-small":"_3O5N1","gfs-code":"_1D3OF","gfs-tiny":"_38nE9","add-button":"_1Itd6"}; | ||
var style = {"form-button":"_3gVBO","small":"_2lQhD","white":"_31MXM","light-grey":"_2otjh","grey":"_S5L8a","dark-grey":"_3-ady","black":"_3oQqh"}; | ||
var _excluded = ["onClick", "type", "customClass", "children", "small", "color", "checkAccess", "accesses"]; | ||
var FormButton = React$1__default.memo(function (_ref) { | ||
var onClick = _ref.onClick, | ||
_ref$type = _ref.type, | ||
type = _ref$type === void 0 ? 'button' : _ref$type, | ||
_ref$customClass = _ref.customClass, | ||
customClass = _ref$customClass === void 0 ? '' : _ref$customClass, | ||
children = _ref.children, | ||
small = _ref.small, | ||
color = _ref.color, | ||
checkAccess = _ref.checkAccess, | ||
accesses = _ref.accesses, | ||
props = _objectWithoutPropertiesLoose(_ref, _excluded); | ||
return /*#__PURE__*/React$1__default.createElement("button", _extends({}, props, { | ||
type: type, | ||
disabled: checkAccess && access(accesses, checkAccess), | ||
onClick: onClick, | ||
className: style['form-button'] + " " + globalStyle['gfs-bold'] + " " + style[color] + " " + customClass + " " + (small ? style.small : '') | ||
}), children); | ||
}); | ||
var style$1 = {"row-button":"_2YPYa","tooltip":"_kmdM_"}; | ||
var ButtonWithTooltip = function ButtonWithTooltip(_ref) { | ||
var children = _ref.children, | ||
tooltip = _ref.tooltip; | ||
return /*#__PURE__*/React$1__default.createElement("div", { | ||
className: style$1['row-button'] | ||
}, children, tooltip ? /*#__PURE__*/React$1__default.createElement("div", { | ||
className: style$1.tooltip + " " + style$1['gfs-body'] | ||
}, tooltip) : null); | ||
}; | ||
var style$2 = {"form-button":"_3BYUG","disabled":"_PhUIE"}; | ||
var ToolButton = React$1__default.memo(function (_ref) { | ||
var tooltip = _ref.tooltip, | ||
icon = _ref.icon, | ||
click = _ref.click, | ||
active = _ref.active, | ||
customClass = _ref.customClass, | ||
text = _ref.text, | ||
disabled = _ref.disabled; | ||
return /*#__PURE__*/React$1__default.createElement(ButtonWithTooltip, { | ||
tooltip: tooltip, | ||
key: icon | ||
}, /*#__PURE__*/React$1__default.createElement("button", { | ||
className: style$2['form-button'] + " " + style$2.white + " " + (disabled ? style$2.disabled : '') + " " + (customClass ? "" + customClass : style$2['waiting-button']) + " " + (active ? style$2.black : ''), | ||
type: "button", | ||
onClick: click, | ||
disabled: disabled | ||
}, text, icon ? /*#__PURE__*/React$1__default.createElement("i", { | ||
className: icon | ||
}) : null)); | ||
}); | ||
exports.ButtonWithTooltip = ButtonWithTooltip; | ||
exports.FormButton = FormButton; | ||
exports.ToolButton = ToolButton; | ||
//# sourceMappingURL=index.js.map |
@@ -1,13 +0,108 @@ | ||
import React from 'react'; | ||
import React$1 from 'react'; | ||
var styles = {"test":"_3ybTi"}; | ||
function _extends() { | ||
_extends = Object.assign || function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i]; | ||
var ExampleComponent = function ExampleComponent(_ref) { | ||
var text = _ref.text; | ||
return /*#__PURE__*/React.createElement("div", { | ||
className: styles.test | ||
}, "Example Component: ", text); | ||
for (var key in source) { | ||
if (Object.prototype.hasOwnProperty.call(source, key)) { | ||
target[key] = source[key]; | ||
} | ||
} | ||
} | ||
return target; | ||
}; | ||
return _extends.apply(this, arguments); | ||
} | ||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
if (source == null) return {}; | ||
var target = {}; | ||
var sourceKeys = Object.keys(source); | ||
var key, i; | ||
for (i = 0; i < sourceKeys.length; i++) { | ||
key = sourceKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
target[key] = source[key]; | ||
} | ||
return target; | ||
} | ||
var access = function access(accesses, pages) { | ||
return accesses.findIndex(function (item) { | ||
return item === pages; | ||
}) < 0; | ||
}; | ||
export { ExampleComponent }; | ||
var React = require('react'); | ||
var ReactDOM = require('react-dom'); | ||
var globalStyle = {"intercom-lightweight-app":"_1vskv","page__wrapper":"_35Y-6","small-text":"_27KVU","medium-text":"_1XO0z","big-text":"_rbeME","close-button":"_gL_Wx","button-link-table":"_I5ecV","autocomplete_hack":"_2xaJP","gfs-h1":"_3GABt","gfs-h2":"_3SIK8","gfs-caps":"_1Tdp9","gfs-status-symbol":"_3ysMx","gfs-bold":"_23LvJ","gfs-body":"_2hT_r","gfs-link":"_2q1U_","gfs-small":"_3O5N1","gfs-code":"_1D3OF","gfs-tiny":"_38nE9","add-button":"_1Itd6"}; | ||
var style = {"form-button":"_3gVBO","small":"_2lQhD","white":"_31MXM","light-grey":"_2otjh","grey":"_S5L8a","dark-grey":"_3-ady","black":"_3oQqh"}; | ||
var _excluded = ["onClick", "type", "customClass", "children", "small", "color", "checkAccess", "accesses"]; | ||
var FormButton = React$1.memo(function (_ref) { | ||
var onClick = _ref.onClick, | ||
_ref$type = _ref.type, | ||
type = _ref$type === void 0 ? 'button' : _ref$type, | ||
_ref$customClass = _ref.customClass, | ||
customClass = _ref$customClass === void 0 ? '' : _ref$customClass, | ||
children = _ref.children, | ||
small = _ref.small, | ||
color = _ref.color, | ||
checkAccess = _ref.checkAccess, | ||
accesses = _ref.accesses, | ||
props = _objectWithoutPropertiesLoose(_ref, _excluded); | ||
return /*#__PURE__*/React$1.createElement("button", _extends({}, props, { | ||
type: type, | ||
disabled: checkAccess && access(accesses, checkAccess), | ||
onClick: onClick, | ||
className: style['form-button'] + " " + globalStyle['gfs-bold'] + " " + style[color] + " " + customClass + " " + (small ? style.small : '') | ||
}), children); | ||
}); | ||
var style$1 = {"row-button":"_2YPYa","tooltip":"_kmdM_"}; | ||
var ButtonWithTooltip = function ButtonWithTooltip(_ref) { | ||
var children = _ref.children, | ||
tooltip = _ref.tooltip; | ||
return /*#__PURE__*/React$1.createElement("div", { | ||
className: style$1['row-button'] | ||
}, children, tooltip ? /*#__PURE__*/React$1.createElement("div", { | ||
className: style$1.tooltip + " " + style$1['gfs-body'] | ||
}, tooltip) : null); | ||
}; | ||
var style$2 = {"form-button":"_3BYUG","disabled":"_PhUIE"}; | ||
var ToolButton = React$1.memo(function (_ref) { | ||
var tooltip = _ref.tooltip, | ||
icon = _ref.icon, | ||
click = _ref.click, | ||
active = _ref.active, | ||
customClass = _ref.customClass, | ||
text = _ref.text, | ||
disabled = _ref.disabled; | ||
return /*#__PURE__*/React$1.createElement(ButtonWithTooltip, { | ||
tooltip: tooltip, | ||
key: icon | ||
}, /*#__PURE__*/React$1.createElement("button", { | ||
className: style$2['form-button'] + " " + style$2.white + " " + (disabled ? style$2.disabled : '') + " " + (customClass ? "" + customClass : style$2['waiting-button']) + " " + (active ? style$2.black : ''), | ||
type: "button", | ||
onClick: click, | ||
disabled: disabled | ||
}, text, icon ? /*#__PURE__*/React$1.createElement("i", { | ||
className: icon | ||
}) : null)); | ||
}); | ||
export { ButtonWithTooltip, FormButton, ToolButton }; | ||
//# sourceMappingURL=index.modern.js.map |
{ | ||
"name": "ttm-react-library", | ||
"version": "1.0.2", | ||
"version": "1.0.6", | ||
"description": "Made with create-react-library", | ||
@@ -48,3 +48,9 @@ "author": "apavlovspb", | ||
"react-dom": "^16.13.1", | ||
"react-scripts": "^3.4.1" | ||
"react-scripts": "^3.4.1", | ||
"sass": "^1.42.1", | ||
"sass-loader": "^7.1.0", | ||
"style-loader": "^0.23.1", | ||
"node-sass": "^4.12.0", | ||
"postcss-scss": "^2.0.0", | ||
"css-loader": "^2.1.1" | ||
}, | ||
@@ -51,0 +57,0 @@ "files": [ |
@@ -10,3 +10,4 @@ # ttm-react-library | ||
```bash | ||
npm install --save ttm-react-library | ||
npm install --save ttm-react-library-test | ||
yarn add ttm-react-library-test | ||
``` | ||
@@ -16,17 +17,4 @@ | ||
```jsx | ||
import React, { Component } from 'react' | ||
import MyComponent from 'ttm-react-library' | ||
import 'ttm-react-library/dist/index.css' | ||
class Example extends Component { | ||
render() { | ||
return <MyComponent /> | ||
} | ||
} | ||
``` | ||
## License | ||
MIT © [apavlovspb](https://github.com/apavlovspb) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
29671
400
25
19
1