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