dibk-design 0.4.30 → 0.4.34
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 +127 -77
- 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,54 +27,105 @@ 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
|
-
|
|
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')
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
}, {
|
|
84
|
+
key: "getThemeErrorMessageStyle",
|
|
85
|
+
value: function getThemeErrorMessageStyle(theme) {
|
|
86
|
+
return {
|
|
87
|
+
color: (0, _theme.getThemePaletteBackgroundColor)(theme, 'warning')
|
|
88
|
+
};
|
|
89
|
+
}
|
|
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: "getInputElementProps",
|
|
104
|
+
value: function getInputElementProps(defaultValue, styleRules) {
|
|
105
|
+
var _ref;
|
|
62
106
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
107
|
+
return _ref = {
|
|
108
|
+
name: this.props.name,
|
|
109
|
+
readOnly: this.props.readOnly,
|
|
110
|
+
disabled: this.props.disabled,
|
|
111
|
+
type: this.props.type,
|
|
112
|
+
id: this.props.id,
|
|
113
|
+
key: "".concat(this.props.id).concat(defaultValue ? '-' + defaultValue : ''),
|
|
114
|
+
onChange: this.props.onChange,
|
|
115
|
+
onBlur: this.props.onBlur
|
|
116
|
+
}, _defineProperty(_ref, defaultValue ? 'defaultValue' : 'value', defaultValue || this.props.value), _defineProperty(_ref, "placeholder", this.props.placeholder), _defineProperty(_ref, "className", this.props.hasErrors ? _InputFieldModule.default.hasErrors : ''), _defineProperty(_ref, 'aria-required', this.props.mandatory), _defineProperty(_ref, "style", styleRules), _ref;
|
|
117
|
+
}
|
|
118
|
+
}, {
|
|
119
|
+
key: "getDatePickerElementProps",
|
|
120
|
+
value: function getDatePickerElementProps(defaultValue) {
|
|
121
|
+
var _this = this;
|
|
68
122
|
|
|
69
|
-
|
|
70
|
-
const value = this.props.defaultValue ? this.props.defaultValue : this.props.value || null;
|
|
71
|
-
const props = {
|
|
123
|
+
return {
|
|
72
124
|
name: this.props.name,
|
|
73
125
|
readOnly: this.props.readOnly,
|
|
74
126
|
disabled: this.props.disabled,
|
|
75
127
|
id: this.props.id,
|
|
128
|
+
key: "".concat(this.props.id).concat(defaultValue ? '-' + defaultValue : ''),
|
|
76
129
|
dateFormat: this.props.dateFormat,
|
|
77
130
|
locale: 'nb',
|
|
78
131
|
selectsStart: this.props.selectsStart,
|
|
@@ -81,58 +134,55 @@ class InputField extends _react.default.Component {
|
|
|
81
134
|
endDate: this.props.endDate ? new Date(this.props.endDate) : null,
|
|
82
135
|
minDate: this.props.minDate || null,
|
|
83
136
|
maxDate: this.props.maxDate || null,
|
|
84
|
-
onChange: this.props.onChange ?
|
|
85
|
-
|
|
86
|
-
|
|
137
|
+
onChange: this.props.onChange ? function (date) {
|
|
138
|
+
return _this.props.onChange(date);
|
|
139
|
+
} : console.log("Missing onChange handler for date picker with id: ".concat(this.props.id)),
|
|
140
|
+
onBlur: this.props.onBlur ? function (date) {
|
|
141
|
+
return _this.props.onBlur(date);
|
|
142
|
+
} : null,
|
|
143
|
+
selected: defaultValue ? new Date(defaultValue) : null,
|
|
87
144
|
placeholderText: this.props.placeholder,
|
|
88
145
|
className: this.props.hasErrors ? _InputFieldModule.default.hasErrors : ''
|
|
89
146
|
};
|
|
147
|
+
}
|
|
148
|
+
}, {
|
|
149
|
+
key: "render",
|
|
150
|
+
value: function render() {
|
|
151
|
+
var _this$props$width,
|
|
152
|
+
_this2 = this;
|
|
153
|
+
|
|
154
|
+
var defaultValue = this.props.defaultValue ? this.props.defaultValue : this.props.value || null;
|
|
155
|
+
|
|
156
|
+
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) && {
|
|
157
|
+
maxWidth: this.props.width
|
|
158
|
+
});
|
|
159
|
+
|
|
90
160
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
161
|
+
className: "".concat(_InputFieldModule.default.inputField, " ").concat(_InputFieldModule.default[this.props.type])
|
|
162
|
+
}, /*#__PURE__*/_react.default.createElement(_Label.default, {
|
|
163
|
+
htmlFor: this.props.id
|
|
164
|
+
}, this.props.label, this.props.type === 'file' ? /*#__PURE__*/_react.default.createElement("div", {
|
|
165
|
+
className: _InputFieldModule.default.fileInputContainer
|
|
166
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
167
|
+
className: _InputFieldModule.default.input
|
|
168
|
+
}, this.props.selectedFileName), this.props.buttonContent ? /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
169
|
+
color: this.props.buttonColor,
|
|
170
|
+
onClick: function onClick() {
|
|
171
|
+
document.getElementById(_this2.props.id).click();
|
|
172
|
+
},
|
|
173
|
+
content: this.props.buttonContent,
|
|
174
|
+
theme: this.props.theme
|
|
175
|
+
}) : '') : ''), !this.props.contentOnly ? this.props.type === 'date' ? /*#__PURE__*/_react.default.createElement("div", {
|
|
91
176
|
style: styleRules
|
|
92
|
-
}, /*#__PURE__*/_react.default.createElement(_reactDatepicker.default, props))
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
name: this.props.name,
|
|
97
|
-
readOnly: this.props.readOnly,
|
|
98
|
-
disabled: this.props.disabled,
|
|
99
|
-
type: this.props.type,
|
|
100
|
-
id: this.props.id,
|
|
101
|
-
onChange: this.props.onChange,
|
|
102
|
-
onBlur: this.props.onBlur,
|
|
103
|
-
[defaultValue ? 'defaultValue' : 'value']: defaultValue || this.props.value,
|
|
104
|
-
placeholder: this.props.placeholder,
|
|
105
|
-
className: this.props.hasErrors ? _InputFieldModule.default.hasErrors : '',
|
|
106
|
-
'aria-required': this.props.mandatory,
|
|
107
|
-
style: styleRules
|
|
108
|
-
};
|
|
109
|
-
return /*#__PURE__*/_react.default.createElement("input", props);
|
|
177
|
+
}, /*#__PURE__*/_react.default.createElement(_reactDatepicker.default, this.getDatePickerElementProps(defaultValue))) : /*#__PURE__*/_react.default.createElement("input", this.getInputElementProps(defaultValue, styleRules)) : /*#__PURE__*/_react.default.createElement("span", null, this.renderValueAsText(this.props.value || this.props.defaultValue, this.props.defaultContent)), /*#__PURE__*/_react.default.createElement("span", {
|
|
178
|
+
className: _InputFieldModule.default.errorMessage,
|
|
179
|
+
style: this.getThemeErrorMessageStyle(this.props.theme)
|
|
180
|
+
}, this.props.errorMessage ? this.props.errorMessage : ''));
|
|
110
181
|
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
render() {
|
|
114
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
115
|
-
className: "".concat(_InputFieldModule.default.inputField, " ").concat(_InputFieldModule.default[this.props.type])
|
|
116
|
-
}, /*#__PURE__*/_react.default.createElement(_Label.default, {
|
|
117
|
-
htmlFor: this.props.id
|
|
118
|
-
}, this.props.label, this.props.type === 'file' ? /*#__PURE__*/_react.default.createElement("div", {
|
|
119
|
-
className: _InputFieldModule.default.fileInputContainer
|
|
120
|
-
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
121
|
-
className: _InputFieldModule.default.input
|
|
122
|
-
}, this.props.selectedFileName), this.props.buttonContent ? /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
123
|
-
color: this.props.buttonColor,
|
|
124
|
-
onClick: () => {
|
|
125
|
-
document.getElementById(this.props.id).click();
|
|
126
|
-
},
|
|
127
|
-
content: this.props.buttonContent,
|
|
128
|
-
theme: this.props.theme
|
|
129
|
-
}) : '') : ''), !this.props.contentOnly ? this.renderInputField() : /*#__PURE__*/_react.default.createElement("span", null, this.renderValueAsText(this.props.value || this.props.defaultValue, this.props.defaultContent)), /*#__PURE__*/_react.default.createElement("span", {
|
|
130
|
-
className: _InputFieldModule.default.errorMessage,
|
|
131
|
-
style: this.getThemeErrorMessageStyle(this.props.theme)
|
|
132
|
-
}, this.props.errorMessage ? this.props.errorMessage : ''));
|
|
133
|
-
}
|
|
182
|
+
}]);
|
|
134
183
|
|
|
135
|
-
|
|
184
|
+
return InputField;
|
|
185
|
+
}(_react.default.Component);
|
|
136
186
|
|
|
137
187
|
InputField.propTypes = {
|
|
138
188
|
/** Text content inside list item */
|
|
@@ -169,7 +219,7 @@ InputField.defaultProps = {
|
|
|
169
219
|
hasErrors: false,
|
|
170
220
|
errorMessage: '',
|
|
171
221
|
mandatory: false,
|
|
172
|
-
onChange: ()
|
|
222
|
+
onChange: function onChange() {
|
|
173
223
|
return false;
|
|
174
224
|
}
|
|
175
225
|
};
|
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,
|