dibk-design 0.4.28 → 0.4.32
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.
- package/dist/components/Accordion.js +77 -39
- package/dist/components/Button.js +75 -31
- package/dist/components/CheckBoxIcon.js +64 -20
- package/dist/components/CheckBoxIcon.md +13 -4
- package/dist/components/CheckBoxIcon.module.scss +7 -0
- package/dist/components/CheckBoxInput.js +63 -22
- package/dist/components/CheckBoxInput.md +14 -8
- package/dist/components/CheckBoxInput.module.scss +4 -1
- package/dist/components/CheckBoxListItem.js +55 -16
- package/dist/components/CheckBoxListItem.md +20 -5
- package/dist/components/CheckBoxListItem.module.scss +8 -2
- package/dist/components/ContentBox.js +67 -30
- package/dist/components/Dialog.js +98 -57
- package/dist/components/DragAndDropFileInput.js +140 -90
- package/dist/components/Footer.js +44 -8
- package/dist/components/Header.js +47 -11
- package/dist/components/InputField.js +142 -92
- package/dist/components/Label.js +53 -11
- package/dist/components/List.js +72 -21
- package/dist/components/LoadingAnimation.js +42 -6
- package/dist/components/NavigationBar.js +179 -126
- package/dist/components/NavigationBarListItem.js +59 -22
- package/dist/components/Paper.js +42 -6
- package/dist/components/RadioButtonIcon.js +63 -19
- package/dist/components/RadioButtonIcon.md +7 -1
- package/dist/components/RadioButtonIcon.module.scss +9 -1
- package/dist/components/RadioButtonInput.js +56 -17
- package/dist/components/RadioButtonInput.md +8 -0
- package/dist/components/RadioButtonInput.module.scss +7 -0
- package/dist/components/RadioButtonListItem.js +52 -13
- package/dist/components/RadioButtonListItem.md +21 -3
- package/dist/components/RadioButtonListItem.module.scss +8 -2
- package/dist/components/Select.js +142 -100
- package/dist/components/Textarea.js +91 -52
- package/dist/components/Theme.js +98 -55
- package/dist/components/WizardNavigation/Step.js +72 -35
- package/dist/components/WizardNavigation.js +59 -25
- package/dist/functions/theme.js +10 -10
- package/dist/index.js +24 -24
- package/package.json +1 -1
|
@@ -1,5 +1,7 @@
|
|
|
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
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
@@ -25,113 +27,161 @@ require("react-datepicker/dist/react-datepicker.css");
|
|
|
25
27
|
|
|
26
28
|
var _InputFieldModule = _interopRequireDefault(require("./InputField.module.scss"));
|
|
27
29
|
|
|
28
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
30
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
29
31
|
|
|
30
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null ||
|
|
32
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
31
33
|
|
|
32
34
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
35
|
|
|
36
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
37
|
+
|
|
38
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
39
|
+
|
|
40
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
41
|
+
|
|
42
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
43
|
+
|
|
44
|
+
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); } }
|
|
45
|
+
|
|
46
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
47
|
+
|
|
48
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } Object.defineProperty(subClass, "prototype", { value: Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }), writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
49
|
+
|
|
50
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
51
|
+
|
|
52
|
+
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); }; }
|
|
53
|
+
|
|
54
|
+
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); }
|
|
55
|
+
|
|
56
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
57
|
+
|
|
58
|
+
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; } }
|
|
59
|
+
|
|
60
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
61
|
+
|
|
34
62
|
(0, _reactDatepicker.registerLocale)('nb', _nb.default);
|
|
35
63
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
return {
|
|
39
|
-
boxShadow: "0 0 3px ".concat((0, _theme.getThemePaletteBackgroundColor)(theme, 'warning')),
|
|
40
|
-
borderColor: (0, _theme.getThemePaletteBackgroundColor)(theme, 'warning')
|
|
41
|
-
};
|
|
42
|
-
}
|
|
64
|
+
var InputField = /*#__PURE__*/function (_React$Component) {
|
|
65
|
+
_inherits(InputField, _React$Component);
|
|
43
66
|
|
|
44
|
-
|
|
45
|
-
return {
|
|
46
|
-
color: (0, _theme.getThemePaletteBackgroundColor)(theme, 'warning')
|
|
47
|
-
};
|
|
48
|
-
}
|
|
67
|
+
var _super = _createSuper(InputField);
|
|
49
68
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
locale: _nb.default
|
|
53
|
-
}) : '';
|
|
54
|
-
}
|
|
69
|
+
function InputField() {
|
|
70
|
+
_classCallCheck(this, InputField);
|
|
55
71
|
|
|
56
|
-
|
|
57
|
-
return this.props.type === 'date' ? value ? this.convertDateToString(value) : defaultContent : value ? value : defaultContent;
|
|
72
|
+
return _super.apply(this, arguments);
|
|
58
73
|
}
|
|
59
74
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
})
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
if (this.props.type === 'date') {
|
|
70
|
-
const value = this.props.defaultValue ? this.props.defaultValue : this.props.value || null;
|
|
71
|
-
const props = {
|
|
72
|
-
name: this.props.name,
|
|
73
|
-
readOnly: this.props.readOnly,
|
|
74
|
-
disabled: this.props.disabled,
|
|
75
|
-
id: this.props.id,
|
|
76
|
-
dateFormat: this.props.dateFormat,
|
|
77
|
-
locale: 'nb',
|
|
78
|
-
selectsStart: this.props.selectsStart,
|
|
79
|
-
selectsEnd: this.props.selectsEnd,
|
|
80
|
-
startDate: this.props.startDate ? new Date(this.props.startDate) : null,
|
|
81
|
-
endDate: this.props.endDate ? new Date(this.props.endDate) : null,
|
|
82
|
-
minDate: this.props.minDate || null,
|
|
83
|
-
maxDate: this.props.maxDate || null,
|
|
84
|
-
onChange: this.props.onChange ? date => this.props.onChange(date) : console.log("Missing onChange handler for date picker with id: ".concat(this.props.id)),
|
|
85
|
-
onBlur: this.props.onBlur ? date => this.props.onBlur(date) : null,
|
|
86
|
-
selected: value ? new Date(value) : null,
|
|
87
|
-
placeholderText: this.props.placeholder,
|
|
88
|
-
className: this.props.hasErrors ? _InputFieldModule.default.hasErrors : '',
|
|
89
|
-
style: styleRules
|
|
75
|
+
_createClass(InputField, [{
|
|
76
|
+
key: "getThemeErrorInputStyle",
|
|
77
|
+
value: function getThemeErrorInputStyle(theme) {
|
|
78
|
+
return {
|
|
79
|
+
boxShadow: "0 0 3px ".concat((0, _theme.getThemePaletteBackgroundColor)(theme, 'warning')),
|
|
80
|
+
borderColor: (0, _theme.getThemePaletteBackgroundColor)(theme, 'warning')
|
|
90
81
|
};
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
disabled: this.props.disabled,
|
|
98
|
-
type: this.props.type,
|
|
99
|
-
id: this.props.id,
|
|
100
|
-
onChange: this.props.onChange,
|
|
101
|
-
onBlur: this.props.onBlur,
|
|
102
|
-
[defaultValue ? 'defaultValue' : 'value']: defaultValue || this.props.value,
|
|
103
|
-
placeholder: this.props.placeholder,
|
|
104
|
-
className: this.props.hasErrors ? _InputFieldModule.default.hasErrors : '',
|
|
105
|
-
'aria-required': this.props.mandatory,
|
|
106
|
-
style: styleRules
|
|
82
|
+
}
|
|
83
|
+
}, {
|
|
84
|
+
key: "getThemeErrorMessageStyle",
|
|
85
|
+
value: function getThemeErrorMessageStyle(theme) {
|
|
86
|
+
return {
|
|
87
|
+
color: (0, _theme.getThemePaletteBackgroundColor)(theme, 'warning')
|
|
107
88
|
};
|
|
108
|
-
return /*#__PURE__*/_react.default.createElement("input", props);
|
|
109
89
|
}
|
|
110
|
-
}
|
|
90
|
+
}, {
|
|
91
|
+
key: "convertDateToString",
|
|
92
|
+
value: function convertDateToString(date) {
|
|
93
|
+
return date ? (0, _dateFns.format)(new Date(date), this.props.dateFormat, {
|
|
94
|
+
locale: _nb.default
|
|
95
|
+
}) : '';
|
|
96
|
+
}
|
|
97
|
+
}, {
|
|
98
|
+
key: "renderValueAsText",
|
|
99
|
+
value: function renderValueAsText(value, defaultContent) {
|
|
100
|
+
return this.props.type === 'date' ? value ? this.convertDateToString(value) : defaultContent : value ? value : defaultContent;
|
|
101
|
+
}
|
|
102
|
+
}, {
|
|
103
|
+
key: "renderInputField",
|
|
104
|
+
value: function renderInputField(defaultValue) {
|
|
105
|
+
var _this$props$width,
|
|
106
|
+
_this = this;
|
|
111
107
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
108
|
+
var styleRules = _objectSpread(_objectSpread({}, this.props.hasErrors ? this.getThemeErrorInputStyle(this.props.theme) : null), ((_this$props$width = this.props.width) === null || _this$props$width === void 0 ? void 0 : _this$props$width.length) && {
|
|
109
|
+
maxWidth: this.props.width
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
if (this.props.type === 'date') {
|
|
113
|
+
var props = {
|
|
114
|
+
name: this.props.name,
|
|
115
|
+
readOnly: this.props.readOnly,
|
|
116
|
+
disabled: this.props.disabled,
|
|
117
|
+
id: this.props.id,
|
|
118
|
+
dateFormat: this.props.dateFormat,
|
|
119
|
+
locale: 'nb',
|
|
120
|
+
selectsStart: this.props.selectsStart,
|
|
121
|
+
selectsEnd: this.props.selectsEnd,
|
|
122
|
+
startDate: this.props.startDate ? new Date(this.props.startDate) : null,
|
|
123
|
+
endDate: this.props.endDate ? new Date(this.props.endDate) : null,
|
|
124
|
+
minDate: this.props.minDate || null,
|
|
125
|
+
maxDate: this.props.maxDate || null,
|
|
126
|
+
onChange: this.props.onChange ? function (date) {
|
|
127
|
+
return _this.props.onChange(date);
|
|
128
|
+
} : console.log("Missing onChange handler for date picker with id: ".concat(this.props.id)),
|
|
129
|
+
onBlur: this.props.onBlur ? function (date) {
|
|
130
|
+
return _this.props.onBlur(date);
|
|
131
|
+
} : null,
|
|
132
|
+
selected: defaultValue ? new Date(defaultValue) : null,
|
|
133
|
+
placeholderText: this.props.placeholder,
|
|
134
|
+
className: this.props.hasErrors ? _InputFieldModule.default.hasErrors : ''
|
|
135
|
+
};
|
|
136
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
137
|
+
style: styleRules
|
|
138
|
+
}, /*#__PURE__*/_react.default.createElement(_reactDatepicker.default, props));
|
|
139
|
+
} else {
|
|
140
|
+
var _props2;
|
|
141
|
+
|
|
142
|
+
var _props = (_props2 = {
|
|
143
|
+
name: this.props.name,
|
|
144
|
+
readOnly: this.props.readOnly,
|
|
145
|
+
disabled: this.props.disabled,
|
|
146
|
+
type: this.props.type,
|
|
147
|
+
id: this.props.id,
|
|
148
|
+
onChange: this.props.onChange,
|
|
149
|
+
onBlur: this.props.onBlur
|
|
150
|
+
}, _defineProperty(_props2, defaultValue ? 'defaultValue' : 'value', defaultValue || this.props.value), _defineProperty(_props2, "placeholder", this.props.placeholder), _defineProperty(_props2, "className", this.props.hasErrors ? _InputFieldModule.default.hasErrors : ''), _defineProperty(_props2, 'aria-required', this.props.mandatory), _defineProperty(_props2, "style", styleRules), _props2);
|
|
151
|
+
|
|
152
|
+
return /*#__PURE__*/_react.default.createElement("input", _props);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}, {
|
|
156
|
+
key: "render",
|
|
157
|
+
value: function render() {
|
|
158
|
+
var _this2 = this;
|
|
159
|
+
|
|
160
|
+
var defaultValue = this.props.defaultValue ? this.props.defaultValue : this.props.value || null;
|
|
161
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
162
|
+
className: "".concat(_InputFieldModule.default.inputField, " ").concat(_InputFieldModule.default[this.props.type])
|
|
163
|
+
}, /*#__PURE__*/_react.default.createElement(_Label.default, {
|
|
164
|
+
htmlFor: this.props.id
|
|
165
|
+
}, this.props.label, this.props.type === 'file' ? /*#__PURE__*/_react.default.createElement("div", {
|
|
166
|
+
className: _InputFieldModule.default.fileInputContainer
|
|
167
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
168
|
+
className: _InputFieldModule.default.input
|
|
169
|
+
}, this.props.selectedFileName), this.props.buttonContent ? /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
170
|
+
color: this.props.buttonColor,
|
|
171
|
+
onClick: function onClick() {
|
|
172
|
+
document.getElementById(_this2.props.id).click();
|
|
173
|
+
},
|
|
174
|
+
content: this.props.buttonContent,
|
|
175
|
+
theme: this.props.theme
|
|
176
|
+
}) : '') : ''), !this.props.contentOnly ? this.renderInputField(defaultValue) : /*#__PURE__*/_react.default.createElement("span", null, this.renderValueAsText(this.props.value || this.props.defaultValue, this.props.defaultContent)), /*#__PURE__*/_react.default.createElement("span", {
|
|
177
|
+
className: _InputFieldModule.default.errorMessage,
|
|
178
|
+
style: this.getThemeErrorMessageStyle(this.props.theme)
|
|
179
|
+
}, this.props.errorMessage ? this.props.errorMessage : ''));
|
|
180
|
+
}
|
|
181
|
+
}]);
|
|
133
182
|
|
|
134
|
-
|
|
183
|
+
return InputField;
|
|
184
|
+
}(_react.default.Component);
|
|
135
185
|
|
|
136
186
|
InputField.propTypes = {
|
|
137
187
|
/** Text content inside list item */
|
|
@@ -168,7 +218,7 @@ InputField.defaultProps = {
|
|
|
168
218
|
hasErrors: false,
|
|
169
219
|
errorMessage: '',
|
|
170
220
|
mandatory: false,
|
|
171
|
-
onChange: ()
|
|
221
|
+
onChange: function onChange() {
|
|
172
222
|
return false;
|
|
173
223
|
}
|
|
174
224
|
};
|
package/dist/components/Label.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
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
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
@@ -15,19 +17,59 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
15
17
|
|
|
16
18
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
17
19
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
21
|
+
|
|
22
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
23
|
+
|
|
24
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
25
|
+
|
|
26
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
27
|
+
|
|
28
|
+
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); } }
|
|
29
|
+
|
|
30
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
31
|
+
|
|
32
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } Object.defineProperty(subClass, "prototype", { value: Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }), writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
33
|
+
|
|
34
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
35
|
+
|
|
36
|
+
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); }; }
|
|
37
|
+
|
|
38
|
+
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); }
|
|
39
|
+
|
|
40
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
41
|
+
|
|
42
|
+
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; } }
|
|
43
|
+
|
|
44
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
45
|
+
|
|
46
|
+
var Label = /*#__PURE__*/function (_React$Component) {
|
|
47
|
+
_inherits(Label, _React$Component);
|
|
48
|
+
|
|
49
|
+
var _super = _createSuper(Label);
|
|
50
|
+
|
|
51
|
+
function Label() {
|
|
52
|
+
_classCallCheck(this, Label);
|
|
53
|
+
|
|
54
|
+
return _super.apply(this, arguments);
|
|
28
55
|
}
|
|
29
56
|
|
|
30
|
-
|
|
57
|
+
_createClass(Label, [{
|
|
58
|
+
key: "render",
|
|
59
|
+
value: function render() {
|
|
60
|
+
var labelProps = _objectSpread({}, this.props);
|
|
61
|
+
|
|
62
|
+
delete labelProps.inline;
|
|
63
|
+
delete labelProps.normalCursor;
|
|
64
|
+
var className = "".concat(_LabelModule.default.label, " ").concat(this.props.inline ? _LabelModule.default.inline : '', " ").concat(this.props.normalCursor ? _LabelModule.default.normalCursor : '');
|
|
65
|
+
return /*#__PURE__*/_react.default.createElement("label", _extends({}, labelProps, {
|
|
66
|
+
className: className
|
|
67
|
+
}), this.props.children);
|
|
68
|
+
}
|
|
69
|
+
}]);
|
|
70
|
+
|
|
71
|
+
return Label;
|
|
72
|
+
}(_react.default.Component);
|
|
31
73
|
|
|
32
74
|
Label.propTypes = {
|
|
33
75
|
inline: _propTypes.default.bool,
|
package/dist/components/List.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
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
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
@@ -13,35 +15,84 @@ var _ListModule = _interopRequireDefault(require("./List.module.scss"));
|
|
|
13
15
|
|
|
14
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
17
|
|
|
16
|
-
class
|
|
17
|
-
render() {
|
|
18
|
-
return /*#__PURE__*/_react.default.createElement("li", null, this.props.listItem);
|
|
19
|
-
}
|
|
18
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
20
19
|
|
|
21
|
-
}
|
|
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); } }
|
|
22
21
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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"); } Object.defineProperty(subClass, "prototype", { value: Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }), 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; } }
|
|
35
|
+
|
|
36
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
37
|
+
|
|
38
|
+
var ListItem = /*#__PURE__*/function (_React$Component) {
|
|
39
|
+
_inherits(ListItem, _React$Component);
|
|
32
40
|
|
|
33
|
-
|
|
34
|
-
className: _ListModule.default.list
|
|
35
|
-
}, listItems);
|
|
41
|
+
var _super = _createSuper(ListItem);
|
|
36
42
|
|
|
37
|
-
|
|
43
|
+
function ListItem() {
|
|
44
|
+
_classCallCheck(this, ListItem);
|
|
45
|
+
|
|
46
|
+
return _super.apply(this, arguments);
|
|
38
47
|
}
|
|
39
48
|
|
|
40
|
-
|
|
41
|
-
|
|
49
|
+
_createClass(ListItem, [{
|
|
50
|
+
key: "render",
|
|
51
|
+
value: function render() {
|
|
52
|
+
return /*#__PURE__*/_react.default.createElement("li", null, this.props.listItem);
|
|
53
|
+
}
|
|
54
|
+
}]);
|
|
55
|
+
|
|
56
|
+
return ListItem;
|
|
57
|
+
}(_react.default.Component);
|
|
58
|
+
|
|
59
|
+
var List = /*#__PURE__*/function (_React$Component2) {
|
|
60
|
+
_inherits(List, _React$Component2);
|
|
61
|
+
|
|
62
|
+
var _super2 = _createSuper(List);
|
|
63
|
+
|
|
64
|
+
function List() {
|
|
65
|
+
_classCallCheck(this, List);
|
|
66
|
+
|
|
67
|
+
return _super2.apply(this, arguments);
|
|
42
68
|
}
|
|
43
69
|
|
|
44
|
-
|
|
70
|
+
_createClass(List, [{
|
|
71
|
+
key: "renderList",
|
|
72
|
+
value: function renderList() {
|
|
73
|
+
var listItems = this.props.listItems.map(function (listItem, i) {
|
|
74
|
+
return /*#__PURE__*/_react.default.createElement(ListItem, {
|
|
75
|
+
listItem: listItem,
|
|
76
|
+
key: i
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
var listType = this.props.ordered ? 'ol' : 'ul';
|
|
80
|
+
|
|
81
|
+
var listElement = /*#__PURE__*/_react.default.createElement(listType, {
|
|
82
|
+
className: _ListModule.default.list
|
|
83
|
+
}, listItems);
|
|
84
|
+
|
|
85
|
+
return listElement;
|
|
86
|
+
}
|
|
87
|
+
}, {
|
|
88
|
+
key: "render",
|
|
89
|
+
value: function render() {
|
|
90
|
+
return /*#__PURE__*/_react.default.createElement("div", null, this.renderList());
|
|
91
|
+
}
|
|
92
|
+
}]);
|
|
93
|
+
|
|
94
|
+
return List;
|
|
95
|
+
}(_react.default.Component);
|
|
45
96
|
|
|
46
97
|
List.propTypes = {
|
|
47
98
|
listItems: _propTypes.default.arrayOf(_propTypes.default.string).isRequired,
|
|
@@ -1,5 +1,7 @@
|
|
|
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
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
@@ -13,14 +15,48 @@ var _LoadingAnimationModule = _interopRequireDefault(require("./LoadingAnimation
|
|
|
13
15
|
|
|
14
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
17
|
|
|
16
|
-
class
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
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"); } Object.defineProperty(subClass, "prototype", { value: Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }), 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; } }
|
|
35
|
+
|
|
36
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
37
|
+
|
|
38
|
+
var LoadingAnimation = /*#__PURE__*/function (_React$Component) {
|
|
39
|
+
_inherits(LoadingAnimation, _React$Component);
|
|
40
|
+
|
|
41
|
+
var _super = _createSuper(LoadingAnimation);
|
|
42
|
+
|
|
43
|
+
function LoadingAnimation() {
|
|
44
|
+
_classCallCheck(this, LoadingAnimation);
|
|
45
|
+
|
|
46
|
+
return _super.apply(this, arguments);
|
|
21
47
|
}
|
|
22
48
|
|
|
23
|
-
|
|
49
|
+
_createClass(LoadingAnimation, [{
|
|
50
|
+
key: "render",
|
|
51
|
+
value: function render() {
|
|
52
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
53
|
+
className: this.props.fixed ? _LoadingAnimationModule.default.loadingAnimation + ' ' + _LoadingAnimationModule.default.fixed : _LoadingAnimationModule.default.loadingAnimation
|
|
54
|
+
}, this.props.message);
|
|
55
|
+
}
|
|
56
|
+
}]);
|
|
57
|
+
|
|
58
|
+
return LoadingAnimation;
|
|
59
|
+
}(_react.default.Component);
|
|
24
60
|
|
|
25
61
|
LoadingAnimation.propTypes = {
|
|
26
62
|
fixed: _propTypes.default.bool,
|