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
|
});
|
|
@@ -17,66 +19,103 @@ var _TextareaModule = _interopRequireDefault(require("./Textarea.module.scss"));
|
|
|
17
19
|
|
|
18
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
21
|
|
|
20
|
-
|
|
21
|
-
getThemeErrorInputStyle(theme) {
|
|
22
|
-
return {
|
|
23
|
-
boxShadow: "0 0 3px ".concat((0, _theme.getThemePaletteBackgroundColor)(theme, 'warning')),
|
|
24
|
-
borderColor: (0, _theme.getThemePaletteBackgroundColor)(theme, 'warning')
|
|
25
|
-
};
|
|
26
|
-
}
|
|
22
|
+
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; }
|
|
27
23
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
24
|
+
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; }
|
|
25
|
+
|
|
26
|
+
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; }
|
|
27
|
+
|
|
28
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
29
|
+
|
|
30
|
+
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); } }
|
|
31
|
+
|
|
32
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
33
|
+
|
|
34
|
+
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); }
|
|
35
|
+
|
|
36
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
37
|
+
|
|
38
|
+
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); }; }
|
|
33
39
|
|
|
34
|
-
|
|
35
|
-
|
|
40
|
+
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); }
|
|
41
|
+
|
|
42
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
43
|
+
|
|
44
|
+
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; } }
|
|
45
|
+
|
|
46
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
47
|
+
|
|
48
|
+
var Textarea = /*#__PURE__*/function (_React$Component) {
|
|
49
|
+
_inherits(Textarea, _React$Component);
|
|
50
|
+
|
|
51
|
+
var _super = _createSuper(Textarea);
|
|
52
|
+
|
|
53
|
+
function Textarea() {
|
|
54
|
+
_classCallCheck(this, Textarea);
|
|
55
|
+
|
|
56
|
+
return _super.apply(this, arguments);
|
|
36
57
|
}
|
|
37
58
|
|
|
38
|
-
|
|
39
|
-
|
|
59
|
+
_createClass(Textarea, [{
|
|
60
|
+
key: "getThemeErrorInputStyle",
|
|
61
|
+
value: function getThemeErrorInputStyle(theme) {
|
|
62
|
+
return {
|
|
63
|
+
boxShadow: "0 0 3px ".concat((0, _theme.getThemePaletteBackgroundColor)(theme, 'warning')),
|
|
64
|
+
borderColor: (0, _theme.getThemePaletteBackgroundColor)(theme, 'warning')
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
}, {
|
|
68
|
+
key: "getThemeErrorMessageStyle",
|
|
69
|
+
value: function getThemeErrorMessageStyle(theme) {
|
|
70
|
+
return {
|
|
71
|
+
color: (0, _theme.getThemePaletteBackgroundColor)(theme, 'warning')
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
}, {
|
|
75
|
+
key: "renderValueAsText",
|
|
76
|
+
value: function renderValueAsText(value, defaultContent) {
|
|
77
|
+
return value ? value : defaultContent;
|
|
78
|
+
}
|
|
79
|
+
}, {
|
|
80
|
+
key: "renderInputField",
|
|
81
|
+
value: function renderInputField() {
|
|
82
|
+
var _this$props$width, _this$props$resize, _props;
|
|
83
|
+
|
|
84
|
+
var defaultValue = !this.props.value && this.props.defaultValue ? this.props.defaultValue : false;
|
|
40
85
|
|
|
41
|
-
|
|
42
|
-
const styleRules = { ...(this.props.hasErrors ? this.getThemeErrorInputStyle(this.props.theme) : null),
|
|
43
|
-
...(((_this$props$width = this.props.width) === null || _this$props$width === void 0 ? void 0 : _this$props$width.length) && {
|
|
86
|
+
var styleRules = _objectSpread(_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) && {
|
|
44
87
|
maxWidth: this.props.width
|
|
45
|
-
}),
|
|
46
|
-
...(((_this$props$resize = this.props.resize) === null || _this$props$resize === void 0 ? void 0 : _this$props$resize.length) && {
|
|
88
|
+
}), ((_this$props$resize = this.props.resize) === null || _this$props$resize === void 0 ? void 0 : _this$props$resize.length) && {
|
|
47
89
|
resize: this.props.resize
|
|
48
|
-
})
|
|
49
|
-
};
|
|
50
|
-
const props = {
|
|
51
|
-
name: this.props.name,
|
|
52
|
-
readOnly: this.props.readOnly,
|
|
53
|
-
disabled: this.props.disabled,
|
|
54
|
-
type: this.props.type,
|
|
55
|
-
id: this.props.id,
|
|
56
|
-
onChange: this.props.onChange,
|
|
57
|
-
onBlur: this.props.onBlur,
|
|
58
|
-
[defaultValue ? 'defaultValue' : 'value']: defaultValue || this.props.value,
|
|
59
|
-
placeholder: this.props.placeholder,
|
|
60
|
-
rows: this.props.rows,
|
|
61
|
-
className: this.props.hasErrors ? _TextareaModule.default.hasErrors : '',
|
|
62
|
-
'aria-required': this.props.mandatory,
|
|
63
|
-
style: styleRules
|
|
64
|
-
};
|
|
65
|
-
return /*#__PURE__*/_react.default.createElement("textarea", props);
|
|
66
|
-
}
|
|
90
|
+
});
|
|
67
91
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
92
|
+
var props = (_props = {
|
|
93
|
+
name: this.props.name,
|
|
94
|
+
readOnly: this.props.readOnly,
|
|
95
|
+
disabled: this.props.disabled,
|
|
96
|
+
type: this.props.type,
|
|
97
|
+
id: this.props.id,
|
|
98
|
+
onChange: this.props.onChange,
|
|
99
|
+
onBlur: this.props.onBlur
|
|
100
|
+
}, _defineProperty(_props, defaultValue ? 'defaultValue' : 'value', defaultValue || this.props.value), _defineProperty(_props, "placeholder", this.props.placeholder), _defineProperty(_props, "rows", this.props.rows), _defineProperty(_props, "className", this.props.hasErrors ? _TextareaModule.default.hasErrors : ''), _defineProperty(_props, 'aria-required', this.props.mandatory), _defineProperty(_props, "style", styleRules), _props);
|
|
101
|
+
return /*#__PURE__*/_react.default.createElement("textarea", props);
|
|
102
|
+
}
|
|
103
|
+
}, {
|
|
104
|
+
key: "render",
|
|
105
|
+
value: function render() {
|
|
106
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
107
|
+
className: _TextareaModule.default.textarea
|
|
108
|
+
}, /*#__PURE__*/_react.default.createElement(_Label.default, {
|
|
109
|
+
htmlFor: this.props.id
|
|
110
|
+
}, this.props.label), !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", {
|
|
111
|
+
className: _TextareaModule.default.errorMessage,
|
|
112
|
+
style: this.getThemeErrorMessageStyle(this.props.theme)
|
|
113
|
+
}, this.props.errorMessage ? this.props.errorMessage : ''));
|
|
114
|
+
}
|
|
115
|
+
}]);
|
|
78
116
|
|
|
79
|
-
|
|
117
|
+
return Textarea;
|
|
118
|
+
}(_react.default.Component);
|
|
80
119
|
|
|
81
120
|
Textarea.propTypes = {
|
|
82
121
|
/** Text content inside list item */
|
|
@@ -109,7 +148,7 @@ Textarea.defaultProps = {
|
|
|
109
148
|
hasErrors: false,
|
|
110
149
|
errorMessage: '',
|
|
111
150
|
mandatory: false,
|
|
112
|
-
onChange: ()
|
|
151
|
+
onChange: function onChange() {
|
|
113
152
|
return false;
|
|
114
153
|
}
|
|
115
154
|
};
|
package/dist/components/Theme.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
|
});
|
|
@@ -17,68 +19,109 @@ var _ThemeModule = _interopRequireDefault(require("./Theme.module.scss"));
|
|
|
17
19
|
|
|
18
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
21
|
|
|
20
|
-
class
|
|
21
|
-
getThemeColorPaletteStyle(theme, color) {
|
|
22
|
-
return {
|
|
23
|
-
backgroundColor: (0, _theme.getThemePaletteBackgroundColor)(theme, color),
|
|
24
|
-
color: (0, _theme.getThemePaletteTextColor)(theme, color)
|
|
25
|
-
};
|
|
26
|
-
}
|
|
22
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
27
23
|
|
|
28
|
-
|
|
29
|
-
return {
|
|
30
|
-
color: (0, _theme.getThemeTextColor)(theme)
|
|
31
|
-
};
|
|
32
|
-
}
|
|
24
|
+
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); } }
|
|
33
25
|
|
|
34
|
-
|
|
35
|
-
return {
|
|
36
|
-
color: (0, _theme.getThemeLinkColor)(theme)
|
|
37
|
-
};
|
|
38
|
-
}
|
|
26
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
39
27
|
|
|
40
|
-
|
|
41
|
-
const colors = ['default', 'primary', 'success', 'warning', 'info', 'lightCyan', 'orange', 'lightOrange', 'lime', 'lightLime'];
|
|
42
|
-
return colors.map(color => {
|
|
43
|
-
const colorClassName = _ThemeModule.default[color];
|
|
44
|
-
const colorPaletteStyle = this.props.theme ? this.getThemeColorPaletteStyle(this.props.theme, color) : null;
|
|
45
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
46
|
-
key: color,
|
|
47
|
-
className: "".concat(_ThemeModule.default.color, " ").concat(colorClassName),
|
|
48
|
-
style: colorPaletteStyle
|
|
49
|
-
}, color);
|
|
50
|
-
});
|
|
51
|
-
}
|
|
28
|
+
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); }
|
|
52
29
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
src: themeLogo
|
|
59
|
-
}) : /*#__PURE__*/_react.default.createElement("img", {
|
|
60
|
-
alt: "DIBK logo",
|
|
61
|
-
src: _dibkLogoMobile.default
|
|
62
|
-
});
|
|
63
|
-
return logoLink && logoLink.length ? /*#__PURE__*/_react.default.createElement("a", {
|
|
64
|
-
href: logoLink
|
|
65
|
-
}, logoElement) : logoElement;
|
|
66
|
-
}
|
|
30
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
31
|
+
|
|
32
|
+
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); }; }
|
|
33
|
+
|
|
34
|
+
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); }
|
|
67
35
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
36
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
37
|
+
|
|
38
|
+
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; } }
|
|
39
|
+
|
|
40
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
41
|
+
|
|
42
|
+
var Theme = /*#__PURE__*/function (_React$Component) {
|
|
43
|
+
_inherits(Theme, _React$Component);
|
|
44
|
+
|
|
45
|
+
var _super = _createSuper(Theme);
|
|
46
|
+
|
|
47
|
+
function Theme() {
|
|
48
|
+
_classCallCheck(this, Theme);
|
|
49
|
+
|
|
50
|
+
return _super.apply(this, arguments);
|
|
79
51
|
}
|
|
80
52
|
|
|
81
|
-
|
|
53
|
+
_createClass(Theme, [{
|
|
54
|
+
key: "getThemeColorPaletteStyle",
|
|
55
|
+
value: function getThemeColorPaletteStyle(theme, color) {
|
|
56
|
+
return {
|
|
57
|
+
backgroundColor: (0, _theme.getThemePaletteBackgroundColor)(theme, color),
|
|
58
|
+
color: (0, _theme.getThemePaletteTextColor)(theme, color)
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
}, {
|
|
62
|
+
key: "getThemeTextStyle",
|
|
63
|
+
value: function getThemeTextStyle(theme) {
|
|
64
|
+
return {
|
|
65
|
+
color: (0, _theme.getThemeTextColor)(theme)
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
}, {
|
|
69
|
+
key: "getThemeLinkStyle",
|
|
70
|
+
value: function getThemeLinkStyle(theme) {
|
|
71
|
+
return {
|
|
72
|
+
color: (0, _theme.getThemeLinkColor)(theme)
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
}, {
|
|
76
|
+
key: "renderColors",
|
|
77
|
+
value: function renderColors(theme) {
|
|
78
|
+
var _this = this;
|
|
79
|
+
|
|
80
|
+
var colors = ['default', 'primary', 'success', 'warning', 'info', 'lightCyan', 'orange', 'lightOrange', 'lime', 'lightLime'];
|
|
81
|
+
return colors.map(function (color) {
|
|
82
|
+
var colorClassName = _ThemeModule.default[color];
|
|
83
|
+
var colorPaletteStyle = _this.props.theme ? _this.getThemeColorPaletteStyle(_this.props.theme, color) : null;
|
|
84
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
85
|
+
key: color,
|
|
86
|
+
className: "".concat(_ThemeModule.default.color, " ").concat(colorClassName),
|
|
87
|
+
style: colorPaletteStyle
|
|
88
|
+
}, color);
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}, {
|
|
92
|
+
key: "renderLogo",
|
|
93
|
+
value: function renderLogo(logoLink) {
|
|
94
|
+
var themeLogo = (0, _theme.getThemeLogo)(this.props.theme);
|
|
95
|
+
var themeAppName = (0, _theme.getThemeAppName)(this.props.theme);
|
|
96
|
+
var logoElement = themeLogo && themeAppName ? /*#__PURE__*/_react.default.createElement("img", {
|
|
97
|
+
alt: "".concat(themeAppName, " logo"),
|
|
98
|
+
src: themeLogo
|
|
99
|
+
}) : /*#__PURE__*/_react.default.createElement("img", {
|
|
100
|
+
alt: "DIBK logo",
|
|
101
|
+
src: _dibkLogoMobile.default
|
|
102
|
+
});
|
|
103
|
+
return logoLink && logoLink.length ? /*#__PURE__*/_react.default.createElement("a", {
|
|
104
|
+
href: logoLink
|
|
105
|
+
}, logoElement) : logoElement;
|
|
106
|
+
}
|
|
107
|
+
}, {
|
|
108
|
+
key: "render",
|
|
109
|
+
value: function render() {
|
|
110
|
+
var themeTextStyle = this.props.theme ? this.getThemeTextStyle(this.props.theme) : null;
|
|
111
|
+
var themeLinkStyle = this.props.theme ? this.getThemeLinkStyle(this.props.theme) : null;
|
|
112
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
113
|
+
className: _ThemeModule.default.colorPalette
|
|
114
|
+
}, this.renderColors(this.props.theme)), /*#__PURE__*/_react.default.createElement("p", {
|
|
115
|
+
style: themeTextStyle
|
|
116
|
+
}, "The is default text"), /*#__PURE__*/_react.default.createElement("p", null, /*#__PURE__*/_react.default.createElement("a", {
|
|
117
|
+
style: themeLinkStyle,
|
|
118
|
+
href: "#theme"
|
|
119
|
+
}, "This is a hyperlink")), this.renderLogo(this.props.theme));
|
|
120
|
+
}
|
|
121
|
+
}]);
|
|
122
|
+
|
|
123
|
+
return Theme;
|
|
124
|
+
}(_react.default.Component);
|
|
82
125
|
|
|
83
126
|
Theme.propTypes = {
|
|
84
127
|
theme: _propTypes.default.object
|
|
@@ -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,48 +17,83 @@ var _StepModule = _interopRequireDefault(require("./Step.module.scss"));
|
|
|
15
17
|
|
|
16
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
19
|
|
|
18
|
-
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); }
|
|
20
|
+
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); }
|
|
19
21
|
|
|
20
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null ||
|
|
22
|
+
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; }
|
|
21
23
|
|
|
22
|
-
|
|
23
|
-
// Stylesheets
|
|
24
|
-
class Step extends _react.Component {
|
|
25
|
-
getActiveClass() {
|
|
26
|
-
return this.props.activeStepId === this.props.step.id ? _StepModule.default.active : '';
|
|
27
|
-
}
|
|
24
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
28
25
|
|
|
29
|
-
|
|
30
|
-
return this.props.step.finished ? _StepModule.default.finished : '';
|
|
31
|
-
}
|
|
26
|
+
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); } }
|
|
32
27
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
28
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
29
|
+
|
|
30
|
+
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); }
|
|
31
|
+
|
|
32
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
33
|
+
|
|
34
|
+
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); }; }
|
|
35
|
+
|
|
36
|
+
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); }
|
|
36
37
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
53
|
-
className: _StepModule.default.stepNumber
|
|
54
|
-
}, this.props.index + 1), /*#__PURE__*/_react.default.createElement("span", {
|
|
55
|
-
className: _StepModule.default.stepName
|
|
56
|
-
}, this.props.step.name)));
|
|
38
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
39
|
+
|
|
40
|
+
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; } }
|
|
41
|
+
|
|
42
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
43
|
+
|
|
44
|
+
var Step = /*#__PURE__*/function (_Component) {
|
|
45
|
+
_inherits(Step, _Component);
|
|
46
|
+
|
|
47
|
+
var _super = _createSuper(Step);
|
|
48
|
+
|
|
49
|
+
function Step() {
|
|
50
|
+
_classCallCheck(this, Step);
|
|
51
|
+
|
|
52
|
+
return _super.apply(this, arguments);
|
|
57
53
|
}
|
|
58
54
|
|
|
59
|
-
|
|
55
|
+
_createClass(Step, [{
|
|
56
|
+
key: "getActiveClass",
|
|
57
|
+
value: function getActiveClass() {
|
|
58
|
+
return this.props.activeStepId === this.props.step.id ? _StepModule.default.active : '';
|
|
59
|
+
}
|
|
60
|
+
}, {
|
|
61
|
+
key: "getFinishedClass",
|
|
62
|
+
value: function getFinishedClass() {
|
|
63
|
+
return this.props.step.finished ? _StepModule.default.finished : '';
|
|
64
|
+
}
|
|
65
|
+
}, {
|
|
66
|
+
key: "getErrorClass",
|
|
67
|
+
value: function getErrorClass() {
|
|
68
|
+
return this.props.step.hasErrors ? _StepModule.default.hasErrors : '';
|
|
69
|
+
}
|
|
70
|
+
}, {
|
|
71
|
+
key: "render",
|
|
72
|
+
value: function render() {
|
|
73
|
+
var step = this.props.step;
|
|
74
|
+
return step.link && Object.keys(step.link).length ? /*#__PURE__*/_react.default.createElement(_reactRouterDom.Link, {
|
|
75
|
+
to: step.link,
|
|
76
|
+
className: "".concat(_StepModule.default.wizardTopnavItem, " ").concat(this.getActiveClass(), " ").concat(this.getFinishedClass(), " ").concat(this.getErrorClass())
|
|
77
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
78
|
+
className: _StepModule.default.wizardTopnavItemContent
|
|
79
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
80
|
+
className: _StepModule.default.stepNumber
|
|
81
|
+
}, this.props.index + 1), /*#__PURE__*/_react.default.createElement("span", {
|
|
82
|
+
className: _StepModule.default.stepName
|
|
83
|
+
}, this.props.step.name))) : /*#__PURE__*/_react.default.createElement("div", {
|
|
84
|
+
className: "".concat(_StepModule.default.wizardTopnavItem, " ").concat(this.getActiveClass(), " ").concat(this.getFinishedClass(), " ").concat(this.getErrorClass())
|
|
85
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
86
|
+
className: _StepModule.default.wizardTopnavItemContent
|
|
87
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
88
|
+
className: _StepModule.default.stepNumber
|
|
89
|
+
}, this.props.index + 1), /*#__PURE__*/_react.default.createElement("span", {
|
|
90
|
+
className: _StepModule.default.stepName
|
|
91
|
+
}, this.props.step.name)));
|
|
92
|
+
}
|
|
93
|
+
}]);
|
|
94
|
+
|
|
95
|
+
return Step;
|
|
96
|
+
}(_react.Component);
|
|
60
97
|
|
|
61
98
|
Step.propTypes = {
|
|
62
99
|
step: _propTypes.default.object.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
|
});
|
|
@@ -15,34 +17,66 @@ var _WizardNavigationModule = _interopRequireDefault(require("./WizardNavigation
|
|
|
15
17
|
|
|
16
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
19
|
|
|
18
|
-
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); }
|
|
19
|
-
|
|
20
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null ||
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
index: stepIndex,
|
|
34
|
-
key: stepKey
|
|
35
|
-
});
|
|
36
|
-
}) : '';
|
|
37
|
-
}
|
|
20
|
+
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); }
|
|
21
|
+
|
|
22
|
+
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; }
|
|
23
|
+
|
|
24
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
25
|
+
|
|
26
|
+
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); } }
|
|
27
|
+
|
|
28
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
29
|
+
|
|
30
|
+
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); }
|
|
31
|
+
|
|
32
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
33
|
+
|
|
34
|
+
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); }; }
|
|
38
35
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
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); }
|
|
37
|
+
|
|
38
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
39
|
+
|
|
40
|
+
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; } }
|
|
41
|
+
|
|
42
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
43
|
+
|
|
44
|
+
var WizardNavigation = /*#__PURE__*/function (_Component) {
|
|
45
|
+
_inherits(WizardNavigation, _Component);
|
|
46
|
+
|
|
47
|
+
var _super = _createSuper(WizardNavigation);
|
|
48
|
+
|
|
49
|
+
function WizardNavigation() {
|
|
50
|
+
_classCallCheck(this, WizardNavigation);
|
|
51
|
+
|
|
52
|
+
return _super.apply(this, arguments);
|
|
43
53
|
}
|
|
44
54
|
|
|
45
|
-
|
|
55
|
+
_createClass(WizardNavigation, [{
|
|
56
|
+
key: "renderSteps",
|
|
57
|
+
value: function renderSteps(steps, activeStepId) {
|
|
58
|
+
var hasSteps = steps && Object.keys(steps).length;
|
|
59
|
+
return hasSteps ? Object.keys(steps).map(function (stepKey, stepIndex) {
|
|
60
|
+
var step = steps[stepKey];
|
|
61
|
+
return /*#__PURE__*/_react.default.createElement(_Step.default, {
|
|
62
|
+
step: step,
|
|
63
|
+
activeStepId: activeStepId,
|
|
64
|
+
index: stepIndex,
|
|
65
|
+
key: stepKey
|
|
66
|
+
});
|
|
67
|
+
}) : '';
|
|
68
|
+
}
|
|
69
|
+
}, {
|
|
70
|
+
key: "render",
|
|
71
|
+
value: function render() {
|
|
72
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
73
|
+
className: _WizardNavigationModule.default.wizardTopnav
|
|
74
|
+
}, this.renderSteps(this.props.steps, this.props.activeStepId));
|
|
75
|
+
}
|
|
76
|
+
}]);
|
|
77
|
+
|
|
78
|
+
return WizardNavigation;
|
|
79
|
+
}(_react.Component);
|
|
46
80
|
|
|
47
81
|
WizardNavigation.propTypes = {
|
|
48
82
|
steps: _propTypes.default.shape({
|