dibk-design 0.3.24
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/LICENSE +674 -0
- package/README.md +3 -0
- package/dist/components/Accordion.js +120 -0
- package/dist/components/Accordion.md +15 -0
- package/dist/components/Accordion.module.scss +180 -0
- package/dist/components/Button.js +104 -0
- package/dist/components/Button.md +48 -0
- package/dist/components/Button.module.scss +141 -0
- package/dist/components/CheckBoxIcon.js +97 -0
- package/dist/components/CheckBoxIcon.md +23 -0
- package/dist/components/CheckBoxIcon.module.scss +39 -0
- package/dist/components/CheckBoxInput.js +91 -0
- package/dist/components/CheckBoxInput.md +39 -0
- package/dist/components/CheckBoxInput.module.scss +18 -0
- package/dist/components/CheckBoxListItem.js +85 -0
- package/dist/components/CheckBoxListItem.md +35 -0
- package/dist/components/CheckBoxListItem.module.scss +59 -0
- package/dist/components/ContentBox.js +106 -0
- package/dist/components/ContentBox.md +46 -0
- package/dist/components/ContentBox.module.scss +105 -0
- package/dist/components/DragAndDropFileInput.js +196 -0
- package/dist/components/DragAndDropFileInput.md +7 -0
- package/dist/components/DragAndDropFileInput.module.scss +36 -0
- package/dist/components/Footer.js +62 -0
- package/dist/components/Footer.md +7 -0
- package/dist/components/Footer.module.scss +11 -0
- package/dist/components/Header.js +75 -0
- package/dist/components/Header.md +7 -0
- package/dist/components/Header.module.scss +30 -0
- package/dist/components/InputField.js +201 -0
- package/dist/components/InputField.md +36 -0
- package/dist/components/InputField.module.scss +91 -0
- package/dist/components/List.js +106 -0
- package/dist/components/List.md +10 -0
- package/dist/components/List.module.scss +19 -0
- package/dist/components/LoadingAnimation.js +74 -0
- package/dist/components/LoadingAnimation.md +5 -0
- package/dist/components/LoadingAnimation.module.scss +26 -0
- package/dist/components/NavigationBar.js +229 -0
- package/dist/components/NavigationBar.md +31 -0
- package/dist/components/NavigationBar.module.scss +176 -0
- package/dist/components/NavigationBarListItem.js +85 -0
- package/dist/components/NavigationBarListItem.md +16 -0
- package/dist/components/Paper.js +71 -0
- package/dist/components/Paper.md +9 -0
- package/dist/components/Paper.module.scss +17 -0
- package/dist/components/RadioButtonIcon.js +92 -0
- package/dist/components/RadioButtonIcon.md +23 -0
- package/dist/components/RadioButtonIcon.module.scss +21 -0
- package/dist/components/RadioButtonInput.js +89 -0
- package/dist/components/RadioButtonInput.md +22 -0
- package/dist/components/RadioButtonInput.module.scss +15 -0
- package/dist/components/RadioButtonListItem.js +86 -0
- package/dist/components/RadioButtonListItem.md +24 -0
- package/dist/components/RadioButtonListItem.module.scss +59 -0
- package/dist/components/Select.js +188 -0
- package/dist/components/Select.md +26 -0
- package/dist/components/Select.module.scss +84 -0
- package/dist/components/Theme.js +131 -0
- package/dist/components/Theme.md +12 -0
- package/dist/components/Theme.module.scss +76 -0
- package/dist/components/WizardNavigation/Step.js +104 -0
- package/dist/components/WizardNavigation/Step.module.scss +75 -0
- package/dist/components/WizardNavigation.js +95 -0
- package/dist/components/WizardNavigation.md +84 -0
- package/dist/components/WizardNavigation.module.scss +4 -0
- package/dist/fonts/Altis-Light.eot +0 -0
- package/dist/fonts/Altis-Light.svg +326 -0
- package/dist/fonts/Altis-Light.ttf +0 -0
- package/dist/fonts/Altis-Light.woff +0 -0
- package/dist/functions/theme.js +60 -0
- package/dist/images/dibk-logo-mobile.svg +91 -0
- package/dist/images/dibk-logo.svg +991 -0
- package/dist/images/spinner.svg +57 -0
- package/dist/index.js +185 -0
- package/dist/style/abstracts/_all.scss +2 -0
- package/dist/style/abstracts/mixins/_all.scss +12 -0
- package/dist/style/abstracts/mixins/_animation.scss +6 -0
- package/dist/style/abstracts/mixins/_appearance.scss +5 -0
- package/dist/style/abstracts/mixins/_border-radius.scss +31 -0
- package/dist/style/abstracts/mixins/_box-shadow.scss +5 -0
- package/dist/style/abstracts/mixins/_box-sizing.scss +5 -0
- package/dist/style/abstracts/mixins/_calc.scss +5 -0
- package/dist/style/abstracts/mixins/_keyframes.scss +14 -0
- package/dist/style/abstracts/mixins/_opacity.scss +5 -0
- package/dist/style/abstracts/mixins/_placeholder.scss +17 -0
- package/dist/style/abstracts/mixins/_scrollbar.scss +26 -0
- package/dist/style/abstracts/mixins/_transform.scss +6 -0
- package/dist/style/abstracts/mixins/_transition.scss +34 -0
- package/dist/style/abstracts/variables/_all.scss +3 -0
- package/dist/style/abstracts/variables/_colors.scss +35 -0
- package/dist/style/abstracts/variables/_typography.scss +1 -0
- package/dist/style/abstracts/variables/_viewports.scss +11 -0
- package/dist/style/base/_all.scss +2 -0
- package/dist/style/base/_reset.scss +15 -0
- package/dist/style/base/_typography.scss +6 -0
- package/dist/style/base/fonts.css +6 -0
- package/dist/style/global.scss +3 -0
- package/dist/style/layout/_all.scss +1 -0
- package/dist/style/layout/_containers.scss +9 -0
- package/package.json +43 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
Select example:
|
|
2
|
+
|
|
3
|
+
```js
|
|
4
|
+
<Select id="select1" onChange={()=>{console.log('onchange')}} options={['option 1', 'option 2', {key: 'option 3', value: 'value 3'}]} />
|
|
5
|
+
<Select id="select2" onChange={()=>{console.log('onchange')}} label="Select with label" options={['option 1', 'option 2', {key: 'option 3', value: 'value 3'}]} />
|
|
6
|
+
<Select id="select3" onChange={()=>{console.log('onchange')}} label="Select with label and selected value" value="value 3" options={['option 1', 'option 2', {key: 'option 3', value: 'value 3'}]} />
|
|
7
|
+
<Select id="select4" onChange={()=>{console.log('onchange')}} label="Select with label, selected value, errors and error message" value="value 3" options={['option 1', 'option 2', {key: 'option 3', value: 'value 3'}]} hasErrors={true} errorMessage="Wrong value selected" />
|
|
8
|
+
<Select id="select5" onChange={()=>{console.log('onchange')}} label={['Select with ', <a key="labelLink" href="#">link</a>, ' in label']} value="value 3" options={['option 1', 'option 2', {key: 'option 3', value: 'value 3'}]} />
|
|
9
|
+
<Select id="select6" onChange={()=>{console.log('onchange')}} label="Select with label and placeholder" placeholder="Select from list" options={['option 1', 'option 2', {key: 'option 3', value: 'value 3'}]} />
|
|
10
|
+
<Select id="select7" onChange={()=>{console.log('onchange')}} label="Select with label, placeholder and placeholderValue" placeholder="Select from list" placeholderValue="notSelected" value="notSelected" options={['option 1', 'option 2', {key: 'option 3', value: 'value 3'}]} />
|
|
11
|
+
<Select id="select8" onChange={()=>{console.log('onchange')}} label="Select with label, selected value and contentOnly set to true" value="value 3" options={['option 1', 'option 2', {key: 'option 3', value: 'value 3'}]} contentOnly={true} />
|
|
12
|
+
<Select id="select9" onChange={()=>{console.log('onchange')}} label="Select with label, selected value, contentOnly set to true and keyAsContent set to true" value="value 3" options={['option 1', 'option 2', {key: 'option 3', value: 'value 3'}]} contentOnly={true} keyAsContent={true} />
|
|
13
|
+
<Select id="select10" onChange={()=>{console.log('onchange')}} label="Select with label, selected value is string, contentOnly set to true and keyAsContent set to true" value="option 2" options={['option 1', 'option 2', {key: 'option 3', value: 'value 3'}]} contentOnly={true} keyAsContent={true} />
|
|
14
|
+
<Select id="select11" onChange={()=>{console.log('onchange')}} label="Select with label, contentOnly set to true, no value and defaultContent" contentOnly={true} defaultContent="No value selected" options={['option 1', 'option 2', {key: 'option 3', value: 'value 3'}]} />
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Themed select example:
|
|
18
|
+
|
|
19
|
+
```js
|
|
20
|
+
import customTheme from 'data/customTheme';
|
|
21
|
+
<React.Fragment>
|
|
22
|
+
<Select id="themedSelect3" onChange={()=>{console.log('onchange')}} label="Select with label and selected value" value="value 3" options={['option 1', 'option 2', {key: 'option 3', value: 'value 3'}]} theme={customTheme} />
|
|
23
|
+
<Select id="themedSelect4" onChange={()=>{console.log('onchange')}} label="Select with label, selected value, errors and error message" value="value 3" options={['option 1', 'option 2', {key: 'option 3', value: 'value 3'}]} hasErrors={true} errorMessage="Wrong value selected" theme={customTheme} />
|
|
24
|
+
<Select id="themedSelect5" onChange={()=>{console.log('onchange')}} label={['Select with ', <a key="labelLink" href="#">link</a>, ' in label']} value="value 3" options={['option 1', 'option 2', {key: 'option 3', value: 'value 3'}]} theme={customTheme} />
|
|
25
|
+
</React.Fragment>
|
|
26
|
+
```
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
@import "../style/global.scss";
|
|
2
|
+
|
|
3
|
+
:local(.select) {
|
|
4
|
+
label {
|
|
5
|
+
cursor: pointer;
|
|
6
|
+
font-size: 18px;
|
|
7
|
+
margin: 0 0 4px;
|
|
8
|
+
font-family: "Open Sans", arial, sans-serif;
|
|
9
|
+
line-height: 1.3;
|
|
10
|
+
font-weight: bold;
|
|
11
|
+
font-style: normal;
|
|
12
|
+
display: block;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
:local(.selectContainer) {
|
|
16
|
+
position: relative;
|
|
17
|
+
|
|
18
|
+
:local(.selectListArrow) {
|
|
19
|
+
position: absolute;
|
|
20
|
+
display: block;
|
|
21
|
+
content: "";
|
|
22
|
+
top: 14px;
|
|
23
|
+
right: 14px;
|
|
24
|
+
height: 0;
|
|
25
|
+
width: 0;
|
|
26
|
+
border-left: 6px solid transparent;
|
|
27
|
+
border-right: 6px solid transparent;
|
|
28
|
+
border-top: 12px solid $color-primary;
|
|
29
|
+
pointer-events: none;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
select {
|
|
33
|
+
@include border-radius(0);
|
|
34
|
+
@include transition(border-color 0.15s linear);
|
|
35
|
+
@include appearance(none);
|
|
36
|
+
@include box-shadow(none);
|
|
37
|
+
color: rgba(0, 0, 0, 0.75);
|
|
38
|
+
width: 100%;
|
|
39
|
+
font-family: inherit;
|
|
40
|
+
font-size: 1.125rem;
|
|
41
|
+
padding: 10px 40px 10px 10px;
|
|
42
|
+
border: 1px solid #afaba8;
|
|
43
|
+
border-radius: 0;
|
|
44
|
+
line-height: normal;
|
|
45
|
+
background: white;
|
|
46
|
+
cursor: pointer;
|
|
47
|
+
|
|
48
|
+
&:hover {
|
|
49
|
+
border-color: $color-dark-blue;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&:focus {
|
|
53
|
+
border-color: $color-dark-blue;
|
|
54
|
+
outline-color: #54acb8;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&[disabled],
|
|
58
|
+
&[readonly] {
|
|
59
|
+
background-color: #ddd;
|
|
60
|
+
cursor: default;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&:local(.hasErrors) {
|
|
64
|
+
border-color: $color-warning;
|
|
65
|
+
@include box-shadow(0 0 3px $color-warning);
|
|
66
|
+
&:focus {
|
|
67
|
+
border-color: $color-warning-hover;
|
|
68
|
+
outline-color: #b8565d;
|
|
69
|
+
}
|
|
70
|
+
&[disabled],
|
|
71
|
+
&[readonly] {
|
|
72
|
+
background-color: #ddd;
|
|
73
|
+
cursor: default;
|
|
74
|
+
border-color: #afaba8;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
:local(.errorMessage) {
|
|
80
|
+
color: $color-warning;
|
|
81
|
+
font-weight: 300;
|
|
82
|
+
font-style: italic;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
|
|
14
|
+
var _theme = require("../functions/theme");
|
|
15
|
+
|
|
16
|
+
var _dibkLogoMobile = _interopRequireDefault(require("../images/dibk-logo-mobile.svg"));
|
|
17
|
+
|
|
18
|
+
var _ThemeModule = _interopRequireDefault(require("./Theme.module.scss"));
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
|
|
22
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
23
|
+
|
|
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); } }
|
|
25
|
+
|
|
26
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
27
|
+
|
|
28
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
29
|
+
|
|
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); }
|
|
35
|
+
|
|
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);
|
|
51
|
+
}
|
|
52
|
+
|
|
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);
|
|
125
|
+
|
|
126
|
+
Theme.propTypes = {
|
|
127
|
+
theme: _propTypes.default.object
|
|
128
|
+
};
|
|
129
|
+
Theme.defaultProps = {};
|
|
130
|
+
var _default = Theme;
|
|
131
|
+
exports.default = _default;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
@import "../style/global.scss";
|
|
2
|
+
|
|
3
|
+
* {
|
|
4
|
+
color: $color-default-text;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
a {
|
|
8
|
+
color: $color-link;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
img {
|
|
12
|
+
max-width: 200px;
|
|
13
|
+
max-height: 150px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
:local(.colorPalette) {
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-wrap: wrap;
|
|
19
|
+
|
|
20
|
+
:local(.color) {
|
|
21
|
+
width: 20%;
|
|
22
|
+
min-width: 120px;
|
|
23
|
+
text-align: center;
|
|
24
|
+
line-height: 3em;
|
|
25
|
+
|
|
26
|
+
&:local(.default) {
|
|
27
|
+
background-color: $color-default;
|
|
28
|
+
color: #000;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&:local(.primary) {
|
|
32
|
+
background-color: $color-primary;
|
|
33
|
+
color: #fff;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&:local(.success) {
|
|
37
|
+
background-color: $color-success;
|
|
38
|
+
color: #fff;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&:local(.warning) {
|
|
42
|
+
background-color: $color-warning;
|
|
43
|
+
color: #fff;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&:local(.info) {
|
|
47
|
+
background-color: $color-info;
|
|
48
|
+
color: #000;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&:local(.lightCyan) {
|
|
52
|
+
background-color: $color-light-cyan;
|
|
53
|
+
color: #000;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&:local(.orange) {
|
|
57
|
+
background-color: $color-orange;
|
|
58
|
+
color: #fff;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&:local(.lightOrange) {
|
|
62
|
+
background-color: $color-light-orange;
|
|
63
|
+
color: #000;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&:local(.lime) {
|
|
67
|
+
background-color: $color-lime;
|
|
68
|
+
color: #fff;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&:local(.lightLime) {
|
|
72
|
+
background-color: $color-light-lime;
|
|
73
|
+
color: #000;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
|
|
14
|
+
var _reactRouterDom = require("react-router-dom");
|
|
15
|
+
|
|
16
|
+
var _StepModule = _interopRequireDefault(require("./Step.module.scss"));
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
|
|
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); 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"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); 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); }
|
|
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 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);
|
|
53
|
+
}
|
|
54
|
+
|
|
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);
|
|
97
|
+
|
|
98
|
+
Step.propTypes = {
|
|
99
|
+
step: _propTypes.default.object.isRequired,
|
|
100
|
+
activeStepId: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]).isRequired,
|
|
101
|
+
index: _propTypes.default.number.isRequired
|
|
102
|
+
};
|
|
103
|
+
var _default = Step;
|
|
104
|
+
exports.default = _default;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
@import "../../style/global.scss";
|
|
2
|
+
|
|
3
|
+
.wizard-topnav .wizard-topnav-item.finished .wizard-topnav-item-content:before {
|
|
4
|
+
background-color: $color-primary;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
:local(.wizardTopnavItem) {
|
|
8
|
+
flex: 1;
|
|
9
|
+
text-decoration: none;
|
|
10
|
+
:local(.wizardTopnavItemContent) {
|
|
11
|
+
&:before {
|
|
12
|
+
display: inline-block;
|
|
13
|
+
content: " ";
|
|
14
|
+
height: 15px;
|
|
15
|
+
background-color: #e2e1e0;
|
|
16
|
+
width: 100%;
|
|
17
|
+
left: 50%;
|
|
18
|
+
position: relative;
|
|
19
|
+
margin-bottom: -30px;
|
|
20
|
+
}
|
|
21
|
+
:local(.stepNumber) {
|
|
22
|
+
border-radius: 50%;
|
|
23
|
+
width: 35px;
|
|
24
|
+
height: 35px;
|
|
25
|
+
display: block;
|
|
26
|
+
text-align: center;
|
|
27
|
+
background-color: #e2e1e0;
|
|
28
|
+
color: $color-default-text;
|
|
29
|
+
margin: auto;
|
|
30
|
+
position: relative;
|
|
31
|
+
font-size: 20px;
|
|
32
|
+
line-height: 1.75em;
|
|
33
|
+
}
|
|
34
|
+
:local(.stepName) {
|
|
35
|
+
display: block;
|
|
36
|
+
text-align: center;
|
|
37
|
+
color: $color-default-text;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
&:local(.active) {
|
|
41
|
+
:local(.stepNumber) {
|
|
42
|
+
background-color: $color-dark-blue;
|
|
43
|
+
color: #fff;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
&:local(.finished) {
|
|
47
|
+
:local(.wizardTopnavItemContent) {
|
|
48
|
+
&:before {
|
|
49
|
+
background-color: $color-primary;
|
|
50
|
+
}
|
|
51
|
+
:local(.stepNumber) {
|
|
52
|
+
background-color: $color-primary;
|
|
53
|
+
color: #fff;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
&:local(.hasErrors) {
|
|
58
|
+
:local(.wizardTopnavItemContent) {
|
|
59
|
+
&:before {
|
|
60
|
+
background-color: $color-warning;
|
|
61
|
+
}
|
|
62
|
+
:local(.stepNumber) {
|
|
63
|
+
background-color: $color-warning;
|
|
64
|
+
color: #fff;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
&:last-child {
|
|
69
|
+
:local(.wizardTopnavItemContent) {
|
|
70
|
+
&:before {
|
|
71
|
+
width: 0;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|