dibk-design 1.0.11 → 1.0.14
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,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
@@ -15,72 +13,35 @@ var _HeaderModule = _interopRequireDefault(require("./Header.module.scss"));
|
|
|
15
13
|
|
|
16
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
21
|
-
|
|
22
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
23
|
-
|
|
24
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
25
|
-
|
|
26
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
27
|
-
|
|
28
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
29
|
-
|
|
30
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
31
|
-
|
|
32
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
33
|
-
|
|
34
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
16
|
+
var Header = function Header(props) {
|
|
17
|
+
var _props$htmlTag, _props$content;
|
|
35
18
|
|
|
36
|
-
|
|
19
|
+
var bigClass = props.big ? _HeaderModule.default.bigHeader : "";
|
|
20
|
+
var themeClass = props.theme ? _HeaderModule.default.hasTheme : "";
|
|
21
|
+
var htmlTag = (_props$htmlTag = props.htmlTag) !== null && _props$htmlTag !== void 0 && _props$htmlTag.length ? props.htmlTag : "h".concat(props.size);
|
|
22
|
+
var headerClass = _HeaderModule.default.header;
|
|
37
23
|
|
|
38
|
-
var
|
|
39
|
-
_inherits(Header, _React$Component);
|
|
24
|
+
var headerSizeClass = _HeaderModule.default["size-".concat(props.size)];
|
|
40
25
|
|
|
41
|
-
var
|
|
26
|
+
var headerElement = /*#__PURE__*/_react.default.createElement(htmlTag, {
|
|
27
|
+
className: "".concat(headerClass, " ").concat(headerSizeClass, " ").concat(bigClass, " ").concat(themeClass)
|
|
28
|
+
}, !!((_props$content = props.content) !== null && _props$content !== void 0 && _props$content.length) ? props.content : props.children // prps.content for backward compatibility
|
|
29
|
+
);
|
|
42
30
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
_createClass(Header, [{
|
|
50
|
-
key: "render",
|
|
51
|
-
value: function render() {
|
|
52
|
-
var _this$props$htmlTag;
|
|
53
|
-
|
|
54
|
-
var bigClass = this.props.big ? _HeaderModule.default.bigHeader : '';
|
|
55
|
-
var themeClass = this.props.theme ? _HeaderModule.default.hasTheme : '';
|
|
56
|
-
var htmlTag = (_this$props$htmlTag = this.props.htmlTag) !== null && _this$props$htmlTag !== void 0 && _this$props$htmlTag.length ? this.props.htmlTag : "h".concat(this.props.size);
|
|
57
|
-
var headerClass = _HeaderModule.default.header;
|
|
58
|
-
|
|
59
|
-
var headerSizeClass = _HeaderModule.default["size-".concat(this.props.size)];
|
|
60
|
-
|
|
61
|
-
var headerElement = /*#__PURE__*/_react.default.createElement(htmlTag, {
|
|
62
|
-
className: "".concat(headerClass, " ").concat(headerSizeClass, " ").concat(bigClass, " ").concat(themeClass)
|
|
63
|
-
}, this.props.content);
|
|
64
|
-
|
|
65
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
66
|
-
className: _HeaderModule.default.headerContainer
|
|
67
|
-
}, " ", headerElement, " ");
|
|
68
|
-
}
|
|
69
|
-
}]);
|
|
70
|
-
|
|
71
|
-
return Header;
|
|
72
|
-
}(_react.default.Component);
|
|
31
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
32
|
+
className: _HeaderModule.default.headerContainer
|
|
33
|
+
}, " ", headerElement, " ");
|
|
34
|
+
};
|
|
73
35
|
|
|
74
36
|
Header.propTypes = {
|
|
75
37
|
/** Text content inside button */
|
|
76
|
-
content: _propTypes.default.string
|
|
38
|
+
content: _propTypes.default.string,
|
|
77
39
|
size: _propTypes.default.oneOf([1, 2, 3, 4, 5]),
|
|
78
40
|
big: _propTypes.default.bool,
|
|
79
41
|
htmlTag: _propTypes.default.string,
|
|
80
42
|
theme: _propTypes.default.object
|
|
81
43
|
};
|
|
82
44
|
Header.defaultProps = {
|
|
83
|
-
content: '',
|
|
84
45
|
size: 1
|
|
85
46
|
};
|
|
86
47
|
var _default = Header;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Title examples:
|
|
2
2
|
|
|
3
3
|
```js
|
|
4
|
-
<Header
|
|
5
|
-
<Header
|
|
6
|
-
<Header
|
|
7
|
-
<Header
|
|
8
|
-
<Header
|
|
9
|
-
<Header
|
|
10
|
-
<Header
|
|
4
|
+
<Header>Title with size 1</Header>
|
|
5
|
+
<Header size={2}>Title with size 2</Header>
|
|
6
|
+
<Header size={3}>Title with size 3</Header>
|
|
7
|
+
<Header size={4}>Title with size 4</Header>
|
|
8
|
+
<Header size={5}>Title with size 5</Header>
|
|
9
|
+
<Header big>Big title with size 1</Header>
|
|
10
|
+
<Header size={2} htmlTag="h1">Title with size 2 and htmlTag h1</Header>
|
|
11
11
|
|
|
12
12
|
```
|
|
@@ -105,6 +105,7 @@ var InputField = /*#__PURE__*/function (_React$Component) {
|
|
|
105
105
|
readOnly: this.props.readOnly,
|
|
106
106
|
disabled: this.props.disabled,
|
|
107
107
|
type: this.props.type,
|
|
108
|
+
role: this.props.role,
|
|
108
109
|
id: this.props.id,
|
|
109
110
|
key: defaultKey || "".concat(this.props.id, "-").concat((0, _generators.generateRandomString)(6)),
|
|
110
111
|
min: this.props.min || null,
|
|
@@ -7,11 +7,19 @@ exports.default = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
|
|
10
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
13
|
|
|
12
14
|
var ListItem = function ListItem(props) {
|
|
13
|
-
|
|
15
|
+
var elementProps = {
|
|
16
|
+
key: props.elementKey || null
|
|
17
|
+
};
|
|
18
|
+
return /*#__PURE__*/_react.default.createElement("li", elementProps, props.children, props.elementKey);
|
|
14
19
|
};
|
|
15
20
|
|
|
21
|
+
ListItem.propTypes = {
|
|
22
|
+
elementKey: _propTypes.default.string
|
|
23
|
+
};
|
|
16
24
|
var _default = ListItem;
|
|
17
25
|
exports.default = _default;
|
|
@@ -148,7 +148,7 @@ var Select = /*#__PURE__*/function (_React$Component) {
|
|
|
148
148
|
var props = (_props = {
|
|
149
149
|
name: this.props.name,
|
|
150
150
|
multiple: this.props.multiple
|
|
151
|
-
}, _defineProperty(_props, defaultValue ? 'defaultValue' : 'value', defaultValue || this.props.value), _defineProperty(_props, "onChange", this.props.onChange), _defineProperty(_props, "id", this.props.id), _defineProperty(_props, "key", "".concat(this.props.id, "-").concat((0, _generators.generateRandomString)(6))), _defineProperty(_props, "className", this.props.hasErrors ? _SelectModule.default.hasErrors : ''), _defineProperty(_props, "style", styleRules), _props);
|
|
151
|
+
}, _defineProperty(_props, defaultValue ? 'defaultValue' : 'value', defaultValue || this.props.value), _defineProperty(_props, "onChange", this.props.onChange), _defineProperty(_props, "id", this.props.id), _defineProperty(_props, "role", this.props.role), _defineProperty(_props, "key", "".concat(this.props.id, "-").concat((0, _generators.generateRandomString)(6))), _defineProperty(_props, "className", this.props.hasErrors ? _SelectModule.default.hasErrors : ''), _defineProperty(_props, "style", styleRules), _props);
|
|
152
152
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
153
153
|
className: _SelectModule.default.select
|
|
154
154
|
}, /*#__PURE__*/_react.default.createElement(_Label.default, {
|