@pareto-engineering/design-system 4.0.0-alpha.73 → 4.0.0-alpha.75
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/cjs/a/DatePicker/DatePicker.js +162 -0
- package/dist/cjs/a/DatePicker/index.js +13 -0
- package/dist/cjs/a/DatePicker/styles.scss +380 -0
- package/dist/cjs/a/XMLEditor/XMLEditor.js +5 -0
- package/dist/cjs/a/index.js +8 -1
- package/dist/cjs/f/fields/SelectInput/SelectInput.js +33 -42
- package/dist/cjs/f/fields/SelectInput/common/Menu/Menu.js +83 -0
- package/dist/cjs/f/fields/SelectInput/common/Menu/index.js +13 -0
- package/dist/cjs/f/fields/SelectInput/common/Multiple/Multiple.js +244 -0
- package/dist/cjs/f/fields/SelectInput/common/Multiple/index.js +13 -0
- package/dist/cjs/f/fields/SelectInput/common/Single/Single.js +104 -0
- package/dist/cjs/f/fields/SelectInput/common/Single/index.js +13 -0
- package/dist/cjs/f/fields/SelectInput/common/index.js +26 -0
- package/dist/cjs/f/fields/SelectInput/styles.scss +149 -45
- package/dist/es/a/DatePicker/DatePicker.js +154 -0
- package/dist/es/a/DatePicker/index.js +2 -0
- package/dist/es/a/DatePicker/styles.scss +380 -0
- package/dist/es/a/XMLEditor/XMLEditor.js +5 -0
- package/dist/es/a/index.js +2 -1
- package/dist/es/f/fields/SelectInput/SelectInput.js +31 -42
- package/dist/es/f/fields/SelectInput/common/Menu/Menu.js +73 -0
- package/dist/es/f/fields/SelectInput/common/Menu/index.js +2 -0
- package/dist/es/f/fields/SelectInput/common/Multiple/Multiple.js +235 -0
- package/dist/es/f/fields/SelectInput/common/Multiple/index.js +2 -0
- package/dist/es/f/fields/SelectInput/common/Single/Single.js +96 -0
- package/dist/es/f/fields/SelectInput/common/Single/index.js +2 -0
- package/dist/es/f/fields/SelectInput/common/index.js +3 -0
- package/dist/es/f/fields/SelectInput/styles.scss +149 -45
- package/package.json +3 -2
- package/src/stories/a/DatePicker.stories.jsx +88 -0
- package/src/stories/f/SelectInput.stories.jsx +15 -0
- package/src/ui/a/DatePicker/DatePicker.jsx +201 -0
- package/src/ui/a/DatePicker/index.js +2 -0
- package/src/ui/a/DatePicker/styles.scss +380 -0
- package/src/ui/a/XMLEditor/XMLEditor.jsx +6 -0
- package/src/ui/a/index.js +1 -0
- package/src/ui/f/fields/SelectInput/SelectInput.jsx +34 -47
- package/src/ui/f/fields/SelectInput/common/Menu/Menu.jsx +103 -0
- package/src/ui/f/fields/SelectInput/common/Menu/index.js +2 -0
- package/src/ui/f/fields/SelectInput/common/Multiple/Multiple.jsx +288 -0
- package/src/ui/f/fields/SelectInput/common/Multiple/index.js +2 -0
- package/src/ui/f/fields/SelectInput/common/Single/Single.jsx +125 -0
- package/src/ui/f/fields/SelectInput/common/Single/index.js +2 -0
- package/src/ui/f/fields/SelectInput/common/index.js +3 -0
- package/src/ui/f/fields/SelectInput/styles.scss +149 -45
- package/tests/__snapshots__/Storyshots.test.js.snap +7559 -398
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var React = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactDayPicker = require("react-day-picker");
|
|
9
|
+
var _dateFns = require("date-fns");
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
var _exports = _interopRequireDefault(require("@pareto-engineering/bem/exports"));
|
|
12
|
+
require("./styles.scss");
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
15
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
16
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); } /* @pareto-engineering/generator-front 1.0.12 */
|
|
17
|
+
// Local Definitions
|
|
18
|
+
|
|
19
|
+
const baseClassName = _exports.default.base;
|
|
20
|
+
const componentClassName = 'date-picker';
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* This is the component description.
|
|
24
|
+
*/
|
|
25
|
+
const DatePickerWrapper = _ref => {
|
|
26
|
+
let {
|
|
27
|
+
id,
|
|
28
|
+
className: userClassName,
|
|
29
|
+
style,
|
|
30
|
+
mode,
|
|
31
|
+
selected,
|
|
32
|
+
setSelection,
|
|
33
|
+
fromMonth,
|
|
34
|
+
toDate,
|
|
35
|
+
customFooter,
|
|
36
|
+
timeFrom,
|
|
37
|
+
setTimeFrom,
|
|
38
|
+
timeTo,
|
|
39
|
+
setTimeTo,
|
|
40
|
+
dateFormat,
|
|
41
|
+
showDebugger,
|
|
42
|
+
...otherProps
|
|
43
|
+
} = _ref;
|
|
44
|
+
const convertFooterText = selection => {
|
|
45
|
+
if (mode === 'single') {
|
|
46
|
+
return (0, _dateFns.format)(selection, dateFormat);
|
|
47
|
+
}
|
|
48
|
+
if (mode === 'multiple') {
|
|
49
|
+
return selection.map(date => (0, _dateFns.format)(date, dateFormat)).join(', ');
|
|
50
|
+
}
|
|
51
|
+
if (mode === 'range') {
|
|
52
|
+
return selection.from && selection.to ? `${(0, _dateFns.format)(selection.from, dateFormat)} - ${(0, _dateFns.format)(selection.to, dateFormat)}` : 'Please pick an additional day.';
|
|
53
|
+
}
|
|
54
|
+
return null;
|
|
55
|
+
};
|
|
56
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
57
|
+
id: id,
|
|
58
|
+
className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
|
|
59
|
+
style: style
|
|
60
|
+
}, /*#__PURE__*/React.createElement(_reactDayPicker.DayPicker, _extends({
|
|
61
|
+
mode: mode,
|
|
62
|
+
selected: selected,
|
|
63
|
+
onSelect: setSelection,
|
|
64
|
+
fromMonth: fromMonth,
|
|
65
|
+
toDate: toDate,
|
|
66
|
+
showOutsideDays: true,
|
|
67
|
+
footer: customFooter || /*#__PURE__*/React.createElement("div", {
|
|
68
|
+
className: "default-footer"
|
|
69
|
+
}, timeFrom && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("p", {
|
|
70
|
+
className: "time-label s-1"
|
|
71
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
72
|
+
className: "icon"
|
|
73
|
+
}, "C"), "\xA0 Time"), /*#__PURE__*/React.createElement("div", {
|
|
74
|
+
className: `time-inputs${timeTo ? ' multiple' : ''}`
|
|
75
|
+
}, /*#__PURE__*/React.createElement("input", {
|
|
76
|
+
className: "s-1",
|
|
77
|
+
type: "time",
|
|
78
|
+
value: timeFrom,
|
|
79
|
+
onChange: e => setTimeFrom(e.target.value)
|
|
80
|
+
}), timeTo && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
81
|
+
className: "icon s-2"
|
|
82
|
+
}, "r"), /*#__PURE__*/React.createElement("input", {
|
|
83
|
+
className: "s-1",
|
|
84
|
+
type: "time",
|
|
85
|
+
value: timeTo,
|
|
86
|
+
onChange: e => setTimeTo(e.target.value)
|
|
87
|
+
})))), /*#__PURE__*/React.createElement("p", {
|
|
88
|
+
className: "s-1 footer-text"
|
|
89
|
+
}, selected && convertFooterText(selected)))
|
|
90
|
+
}, otherProps)), showDebugger && /*#__PURE__*/React.createElement("div", {
|
|
91
|
+
className: "debugger"
|
|
92
|
+
}, /*#__PURE__*/React.createElement("pre", null, JSON.stringify(selected, null, 2))));
|
|
93
|
+
};
|
|
94
|
+
DatePickerWrapper.propTypes = {
|
|
95
|
+
/**
|
|
96
|
+
* The HTML id for this element
|
|
97
|
+
*/
|
|
98
|
+
id: _propTypes.default.string,
|
|
99
|
+
/**
|
|
100
|
+
* The HTML class names for this element
|
|
101
|
+
*/
|
|
102
|
+
className: _propTypes.default.string,
|
|
103
|
+
/**
|
|
104
|
+
* The React-written, css properties for this element.
|
|
105
|
+
*/
|
|
106
|
+
style: _propTypes.default.objectOf(_propTypes.default.string),
|
|
107
|
+
/**
|
|
108
|
+
* The mode for this date picker.
|
|
109
|
+
*/
|
|
110
|
+
mode: _propTypes.default.oneOf(['single', 'multiple', 'range']),
|
|
111
|
+
/**
|
|
112
|
+
* The current selection.
|
|
113
|
+
*/
|
|
114
|
+
// eslint-disable-next-line react/forbid-prop-types
|
|
115
|
+
selected: _propTypes.default.objectOf(_propTypes.default.any).isRequired,
|
|
116
|
+
/**
|
|
117
|
+
* The function to update the selection.
|
|
118
|
+
*/
|
|
119
|
+
setSelection: _propTypes.default.func.isRequired,
|
|
120
|
+
/**
|
|
121
|
+
* The earliest month to display.
|
|
122
|
+
*/
|
|
123
|
+
fromMonth: _propTypes.default.instanceOf(Date),
|
|
124
|
+
/**
|
|
125
|
+
* The latest month to display.
|
|
126
|
+
*/
|
|
127
|
+
toDate: _propTypes.default.instanceOf(Date),
|
|
128
|
+
/**
|
|
129
|
+
* Custom footer component.
|
|
130
|
+
*/
|
|
131
|
+
customFooter: _propTypes.default.node,
|
|
132
|
+
/**
|
|
133
|
+
* The start time.
|
|
134
|
+
*/
|
|
135
|
+
timeFrom: _propTypes.default.string,
|
|
136
|
+
/**
|
|
137
|
+
* The function to update the start time.
|
|
138
|
+
*/
|
|
139
|
+
setTimeFrom: _propTypes.default.func,
|
|
140
|
+
/**
|
|
141
|
+
* The end time.
|
|
142
|
+
*/
|
|
143
|
+
timeTo: _propTypes.default.string,
|
|
144
|
+
/**
|
|
145
|
+
* The function to update the end time.
|
|
146
|
+
*/
|
|
147
|
+
setTimeTo: _propTypes.default.func,
|
|
148
|
+
/**
|
|
149
|
+
* The date format.
|
|
150
|
+
*/
|
|
151
|
+
dateFormat: _propTypes.default.string,
|
|
152
|
+
/**
|
|
153
|
+
* Show the debugger.
|
|
154
|
+
*/
|
|
155
|
+
showDebugger: _propTypes.default.bool
|
|
156
|
+
};
|
|
157
|
+
DatePickerWrapper.defaultProps = {
|
|
158
|
+
mode: 'single',
|
|
159
|
+
dateFormat: 'PPP',
|
|
160
|
+
showDebugger: false
|
|
161
|
+
};
|
|
162
|
+
var _default = exports.default = DatePickerWrapper;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "DatePicker", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _DatePicker.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _DatePicker = _interopRequireDefault(require("./DatePicker"));
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
/* stylelint-disable max-nesting-depth -- needed here */
|
|
3
|
+
/* stylelint-disable selector-class-pattern -- needed here */
|
|
4
|
+
/* stylelint-disable selector-max-compound-selectors -- needed here */
|
|
5
|
+
/* stylelint-disable declaration-no-important -- needed here */
|
|
6
|
+
/* stylelint-disable font-weight-notation -- needed here */
|
|
7
|
+
/* stylelint-disable declaration-block-no-duplicate-properties -- needed here */
|
|
8
|
+
|
|
9
|
+
@use "@pareto-engineering/bem";
|
|
10
|
+
|
|
11
|
+
$default-background: var(--background-far);
|
|
12
|
+
$default-border: var(--theme-default-input-border);
|
|
13
|
+
$default-input-border-radius: var(--theme-default-input-border-radius);
|
|
14
|
+
$default-padding: .55em .75em;
|
|
15
|
+
$default-spacing-size: calc(var(--gap) / 2);
|
|
16
|
+
$rdp-cell-size: 40px;
|
|
17
|
+
$rdp-caption-font-size: 1em;
|
|
18
|
+
$rdp-accent-color: var(--hard-interactive);
|
|
19
|
+
$rdp-outline: 2px solid var(--hard-interactive);
|
|
20
|
+
$rdp-selected-color: var(--on-interactive);
|
|
21
|
+
|
|
22
|
+
.#{bem.$base}.date-picker {
|
|
23
|
+
/* Hide elements for devices that are not screen readers */
|
|
24
|
+
.rdp-vhidden {
|
|
25
|
+
appearance: none;
|
|
26
|
+
appearance: none;
|
|
27
|
+
appearance: none;
|
|
28
|
+
background: transparent;
|
|
29
|
+
border: 0;
|
|
30
|
+
border: 0 !important;
|
|
31
|
+
box-sizing: border-box;
|
|
32
|
+
clip: rect(1px, 1px, 1px, 1px) !important;
|
|
33
|
+
height: 1px !important;
|
|
34
|
+
margin: 0;
|
|
35
|
+
overflow: hidden !important;
|
|
36
|
+
padding: 0;
|
|
37
|
+
padding: 0 !important;
|
|
38
|
+
position: absolute !important;
|
|
39
|
+
top: 0;
|
|
40
|
+
width: 1px !important;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* Buttons */
|
|
44
|
+
.rdp-button_reset {
|
|
45
|
+
appearance: none;
|
|
46
|
+
appearance: none;
|
|
47
|
+
appearance: none;
|
|
48
|
+
background: none;
|
|
49
|
+
color: inherit;
|
|
50
|
+
cursor: default;
|
|
51
|
+
font: inherit;
|
|
52
|
+
margin: 0;
|
|
53
|
+
padding: 0;
|
|
54
|
+
position: relative;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.rdp-button_reset:focus-visible {
|
|
58
|
+
/* Make sure to reset outline only when :focus-visible is supported */
|
|
59
|
+
outline: none;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.rdp-button {
|
|
63
|
+
border: 2px solid transparent;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.rdp-button[disabled]:not(.rdp-day_selected) {
|
|
67
|
+
opacity: .25;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.rdp-button:not([disabled]) {
|
|
71
|
+
cursor: pointer;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.rdp-button:focus-visible:not([disabled]) {
|
|
75
|
+
background-color: $default-background;
|
|
76
|
+
border: $rdp-outline;
|
|
77
|
+
color: inherit;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.rdp-button:hover:not([disabled]):not(.rdp-day_selected) {
|
|
81
|
+
background-color: $default-background;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.rdp-months {
|
|
85
|
+
display: flex;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.rdp-month {
|
|
89
|
+
margin: 0 1em;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.rdp-month:first-child {
|
|
93
|
+
margin-left: 0;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.rdp-month:last-child {
|
|
97
|
+
margin-right: 0;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.rdp-table {
|
|
101
|
+
background-color: $default-background;
|
|
102
|
+
border-collapse: collapse;
|
|
103
|
+
margin: 0;
|
|
104
|
+
max-width: calc($rdp-cell-size * 7);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.rdp-with_weeknumber .rdp-table {
|
|
108
|
+
border-collapse: collapse;
|
|
109
|
+
max-width: calc($rdp-cell-size * 8);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.rdp-caption {
|
|
113
|
+
align-items: center;
|
|
114
|
+
background-color: $default-background;
|
|
115
|
+
display: flex;
|
|
116
|
+
justify-content: space-between;
|
|
117
|
+
padding: 0;
|
|
118
|
+
text-align: left;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.rdp-multiple_months .rdp-caption {
|
|
122
|
+
display: block;
|
|
123
|
+
position: relative;
|
|
124
|
+
text-align: center;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.rdp-caption_dropdowns {
|
|
128
|
+
display: inline-flex;
|
|
129
|
+
position: relative;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.rdp-caption_label {
|
|
133
|
+
align-items: center;
|
|
134
|
+
border: 0;
|
|
135
|
+
border: 2px solid transparent;
|
|
136
|
+
color: var(--heading);
|
|
137
|
+
display: inline-flex;
|
|
138
|
+
font-family: inherit;
|
|
139
|
+
font-size: $rdp-caption-font-size;
|
|
140
|
+
font-weight: bold;
|
|
141
|
+
margin: 0;
|
|
142
|
+
padding: 0 .25em;
|
|
143
|
+
position: relative;
|
|
144
|
+
white-space: nowrap;
|
|
145
|
+
z-index: 1;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.rdp-nav {
|
|
149
|
+
white-space: nowrap;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.rdp-multiple_months .rdp-caption_start .rdp-nav {
|
|
153
|
+
left: 0;
|
|
154
|
+
position: absolute;
|
|
155
|
+
top: 50%;
|
|
156
|
+
transform: translateY(-50%);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.rdp-multiple_months .rdp-caption_end .rdp-nav {
|
|
160
|
+
position: absolute;
|
|
161
|
+
right: 0;
|
|
162
|
+
top: 50%;
|
|
163
|
+
transform: translateY(-50%);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.rdp-nav_button {
|
|
167
|
+
align-items: center;
|
|
168
|
+
border-radius: 100%;
|
|
169
|
+
display: inline-flex;
|
|
170
|
+
height: $rdp-cell-size;
|
|
171
|
+
justify-content: center;
|
|
172
|
+
padding: .25em;
|
|
173
|
+
width: $rdp-cell-size;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/* ---------- */
|
|
177
|
+
|
|
178
|
+
/* Dropdowns */
|
|
179
|
+
|
|
180
|
+
/* ---------- */
|
|
181
|
+
|
|
182
|
+
.rdp-dropdown_year,
|
|
183
|
+
.rdp-dropdown_month {
|
|
184
|
+
align-items: center;
|
|
185
|
+
display: inline-flex;
|
|
186
|
+
position: relative;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.rdp-dropdown {
|
|
190
|
+
appearance: none;
|
|
191
|
+
background-color: transparent;
|
|
192
|
+
border: none;
|
|
193
|
+
bottom: 0;
|
|
194
|
+
cursor: inherit;
|
|
195
|
+
font-family: inherit;
|
|
196
|
+
font-size: inherit;
|
|
197
|
+
left: 0;
|
|
198
|
+
line-height: inherit;
|
|
199
|
+
margin: 0;
|
|
200
|
+
opacity: 0;
|
|
201
|
+
padding: 0;
|
|
202
|
+
position: absolute;
|
|
203
|
+
top: 0;
|
|
204
|
+
width: 100%;
|
|
205
|
+
z-index: 2;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.rdp-dropdown[disabled] {
|
|
209
|
+
color: unset;
|
|
210
|
+
opacity: unset;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.rdp-dropdown:focus-visible:not([disabled]) + .rdp-caption_label {
|
|
214
|
+
background-color: $default-background;
|
|
215
|
+
border: $rdp-outline;
|
|
216
|
+
border-radius: 6px;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.rdp-dropdown_icon {
|
|
220
|
+
margin: 0 0 0 5px;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.rdp-head {
|
|
224
|
+
border: 0;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.rdp-head_row,
|
|
228
|
+
.rdp-row {
|
|
229
|
+
height: 100%;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.rdp-head_cell {
|
|
233
|
+
font-size: .75em;
|
|
234
|
+
font-weight: 700;
|
|
235
|
+
height: 100%;
|
|
236
|
+
height: $rdp-cell-size;
|
|
237
|
+
padding: 0;
|
|
238
|
+
text-align: center;
|
|
239
|
+
text-transform: uppercase;
|
|
240
|
+
vertical-align: middle;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.rdp-tbody {
|
|
244
|
+
border: 0;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.rdp-tfoot {
|
|
248
|
+
margin: .5em;
|
|
249
|
+
|
|
250
|
+
.default-footer {
|
|
251
|
+
display: flex;
|
|
252
|
+
flex-direction: column;
|
|
253
|
+
|
|
254
|
+
>.footer-text {
|
|
255
|
+
align-self: center;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
>.time-label {
|
|
259
|
+
align-items: center;
|
|
260
|
+
align-self: first baseline;
|
|
261
|
+
color: var(--heading);
|
|
262
|
+
display: flex;
|
|
263
|
+
margin: 0;
|
|
264
|
+
padding: $default-spacing-size;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
>.time-inputs {
|
|
268
|
+
:not(.multiple) {
|
|
269
|
+
margin-left: $default-spacing-size;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
&.multiple {
|
|
273
|
+
align-items: center;
|
|
274
|
+
align-self: center;
|
|
275
|
+
display: flex;
|
|
276
|
+
gap: $default-spacing-size;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
>input[type="time"] {
|
|
280
|
+
background-color: $default-background;
|
|
281
|
+
border: $default-border;
|
|
282
|
+
border-radius: $default-input-border-radius;
|
|
283
|
+
color: var(--paragraph);
|
|
284
|
+
outline: none;
|
|
285
|
+
padding: $default-padding;
|
|
286
|
+
|
|
287
|
+
&::-webkit-calendar-picker-indicator {
|
|
288
|
+
background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMTIiIHZpZXdCb3g9IjAgMCAyMCAxMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTE5IDEuNUwxMCAxMC41TDEgMS41IiBzdHJva2U9IiM0QzRENTMiIHN0cm9rZS13aWR0aD0iMiIvPgo8L3N2Zz4=");
|
|
289
|
+
background-position: calc(100% - $default-spacing-size / 2);
|
|
290
|
+
background-repeat: no-repeat;
|
|
291
|
+
background-size: $default-spacing-size;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
.rdp-cell {
|
|
299
|
+
height: 100%;
|
|
300
|
+
height: $rdp-cell-size;
|
|
301
|
+
padding: 0;
|
|
302
|
+
text-align: center;
|
|
303
|
+
width: $rdp-cell-size;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
.rdp-weeknumber {
|
|
307
|
+
font-size: .75em;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
.rdp-weeknumber,
|
|
311
|
+
.rdp-day {
|
|
312
|
+
align-items: center;
|
|
313
|
+
border: 2px solid transparent;
|
|
314
|
+
border-radius: 100%;
|
|
315
|
+
box-sizing: border-box;
|
|
316
|
+
display: flex;
|
|
317
|
+
height: $rdp-cell-size;
|
|
318
|
+
justify-content: center;
|
|
319
|
+
margin: 0;
|
|
320
|
+
max-width: $rdp-cell-size;
|
|
321
|
+
overflow: hidden;
|
|
322
|
+
width: $rdp-cell-size;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
.rdp-day_today:not(.rdp-day_outside) {
|
|
326
|
+
font-weight: bold;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.rdp-day_selected,
|
|
330
|
+
.rdp-day_selected:focus-visible,
|
|
331
|
+
.rdp-day_selected:hover {
|
|
332
|
+
background-color: $rdp-accent-color;
|
|
333
|
+
color: $rdp-selected-color;
|
|
334
|
+
opacity: 1;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
.rdp-day_outside {
|
|
338
|
+
opacity: .5;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.rdp-day_selected:focus-visible {
|
|
342
|
+
/* Since the background is the same use again the outline */
|
|
343
|
+
outline: $rdp-outline;
|
|
344
|
+
outline-offset: 2px;
|
|
345
|
+
z-index: 1;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
.rdp:not([dir="rtl"]) .rdp-day_range_start:not(.rdp-day_range_end) {
|
|
349
|
+
border-bottom-right-radius: 0;
|
|
350
|
+
border-top-right-radius: 0;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
.rdp:not([dir="rtl"]) .rdp-day_range_end:not(.rdp-day_range_start) {
|
|
354
|
+
border-bottom-left-radius: 0;
|
|
355
|
+
border-top-left-radius: 0;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
.rdp[dir="rtl"] .rdp-day_range_start:not(.rdp-day_range_end) {
|
|
359
|
+
border-bottom-left-radius: 0;
|
|
360
|
+
border-top-left-radius: 0;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
.rdp[dir="rtl"] .rdp-day_range_end:not(.rdp-day_range_start) {
|
|
364
|
+
border-bottom-right-radius: 0;
|
|
365
|
+
border-top-right-radius: 0;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
.rdp-day_range_end.rdp-day_range_start {
|
|
369
|
+
border-radius: 100%;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
.rdp-day_range_middle {
|
|
373
|
+
background-color: var(--interactive);
|
|
374
|
+
border-radius: 0;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
.rdp-nav_icon {
|
|
378
|
+
color: var(--ui-icons);
|
|
379
|
+
}
|
|
380
|
+
}
|
|
@@ -38,6 +38,7 @@ const XMLEditor = _ref => {
|
|
|
38
38
|
gutterWidth,
|
|
39
39
|
config,
|
|
40
40
|
onChange,
|
|
41
|
+
onBlur,
|
|
41
42
|
stopPropagationKeys
|
|
42
43
|
} = _ref;
|
|
43
44
|
const editorRef = (0, _react.useRef)();
|
|
@@ -47,6 +48,10 @@ const XMLEditor = _ref => {
|
|
|
47
48
|
extensions: [_view.keymap.of(_commands.defaultKeymap), (0, _language.indentOnInput)(), (0, _view.lineNumbers)(), (0, _language.bracketMatching)(), (0, _language.foldGutter)(), (0, _view.drawSelection)(), (0, _view.highlightActiveLine)(), (0, _view.highlightActiveLineGutter)(), (0, _view.highlightSpecialChars)(), (0, _view.dropCursor)(), (0, _view.rectangularSelection)(), (0, _view.crosshairCursor)(), (0, _langXml.xml)(), _common.theme, _state.EditorState.readOnly.of(readOnly), _view.EditorView.updateListener.of(view => {
|
|
48
49
|
onChange(view);
|
|
49
50
|
// view.state.doc.toString() to receive the current content in the editor.
|
|
51
|
+
}), _view.EditorView.focusChangeEffect.of((state, focused) => {
|
|
52
|
+
if (!focused) {
|
|
53
|
+
onBlur?.(state);
|
|
54
|
+
}
|
|
50
55
|
}), _view.EditorView.domEventHandlers({
|
|
51
56
|
keydown(e) {
|
|
52
57
|
if (stopPropagationKeys?.includes(e.key)) {
|
package/dist/cjs/a/index.js
CHANGED
|
@@ -45,6 +45,12 @@ Object.defineProperty(exports, "Conversation", {
|
|
|
45
45
|
return _Conversation.Conversation;
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
|
+
Object.defineProperty(exports, "DatePicker", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function () {
|
|
51
|
+
return _DatePicker.DatePicker;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
48
54
|
Object.defineProperty(exports, "DotInfo", {
|
|
49
55
|
enumerable: true,
|
|
50
56
|
get: function () {
|
|
@@ -209,4 +215,5 @@ var _TextSteps = require("./TextSteps");
|
|
|
209
215
|
var _Removable = require("./Removable");
|
|
210
216
|
var _ToggleSwitch = require("./ToggleSwitch");
|
|
211
217
|
var _XMLEditor = require("./XMLEditor");
|
|
212
|
-
var _LexicalPreview = require("./LexicalPreview");
|
|
218
|
+
var _LexicalPreview = require("./LexicalPreview");
|
|
219
|
+
var _DatePicker = require("./DatePicker");
|
|
@@ -6,16 +6,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var React = _react;
|
|
9
|
-
var _formik = require("formik");
|
|
10
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
10
|
var _exports = _interopRequireDefault(require("@pareto-engineering/bem/exports"));
|
|
12
|
-
var _a = require("../../../a");
|
|
13
|
-
var _common = require("../../common");
|
|
14
11
|
require("./styles.scss");
|
|
12
|
+
var _common = require("./common");
|
|
15
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
14
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
17
15
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
18
|
-
|
|
16
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
17
|
+
|
|
19
18
|
// Local Definitions
|
|
20
19
|
|
|
21
20
|
const baseClassName = _exports.default.base;
|
|
@@ -39,49 +38,33 @@ const SelectInput = _ref => {
|
|
|
39
38
|
description,
|
|
40
39
|
disabled,
|
|
41
40
|
isLoading,
|
|
42
|
-
autoComplete
|
|
41
|
+
autoComplete,
|
|
42
|
+
placeholder,
|
|
43
|
+
getTagColor,
|
|
44
|
+
multiple
|
|
43
45
|
// ...otherProps
|
|
44
46
|
} = _ref;
|
|
45
|
-
const
|
|
47
|
+
const inputProps = {
|
|
46
48
|
name,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
+
label,
|
|
50
|
+
labelColor,
|
|
51
|
+
color,
|
|
52
|
+
options,
|
|
53
|
+
validate,
|
|
54
|
+
optional,
|
|
55
|
+
description,
|
|
56
|
+
disabled,
|
|
57
|
+
isLoading,
|
|
58
|
+
placeholder,
|
|
59
|
+
getTagColor,
|
|
60
|
+
autoComplete
|
|
61
|
+
};
|
|
62
|
+
const Input = multiple ? _common.Multiple : _common.Single;
|
|
49
63
|
return /*#__PURE__*/React.createElement("div", {
|
|
50
64
|
id: id,
|
|
51
65
|
className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
|
|
52
66
|
style: style
|
|
53
|
-
}, /*#__PURE__*/React.createElement(
|
|
54
|
-
name: name,
|
|
55
|
-
color: labelColor,
|
|
56
|
-
optional: optional
|
|
57
|
-
// {...otherProps}
|
|
58
|
-
}, label), /*#__PURE__*/React.createElement("div", {
|
|
59
|
-
className: `select-wrapper${disabled ? ' disabled' : ''}`
|
|
60
|
-
}, /*#__PURE__*/React.createElement("select", _extends({
|
|
61
|
-
className: `input y-${color}`
|
|
62
|
-
}, field, {
|
|
63
|
-
value: field.value || '',
|
|
64
|
-
id: name,
|
|
65
|
-
disabled: disabled,
|
|
66
|
-
autoComplete: autoComplete
|
|
67
|
-
}), options.map(option => {
|
|
68
|
-
// i.e if option is a string like "blah", return { value: "blah", label: "blah" }
|
|
69
|
-
const newOption = typeof option === 'string' ? {
|
|
70
|
-
value: option,
|
|
71
|
-
label: option
|
|
72
|
-
} : option;
|
|
73
|
-
return /*#__PURE__*/React.createElement("option", {
|
|
74
|
-
key: newOption.value,
|
|
75
|
-
value: newOption.value,
|
|
76
|
-
disabled: newOption?.disabled || false
|
|
77
|
-
}, newOption.label);
|
|
78
|
-
})), isLoading && /*#__PURE__*/React.createElement(_a.LoadingCircle, {
|
|
79
|
-
className: "x-main"
|
|
80
|
-
})), /*#__PURE__*/React.createElement(_common.FormDescription, {
|
|
81
|
-
className: "s-1",
|
|
82
|
-
description: description,
|
|
83
|
-
name: name
|
|
84
|
-
}));
|
|
67
|
+
}, /*#__PURE__*/React.createElement(Input, inputProps));
|
|
85
68
|
};
|
|
86
69
|
SelectInput.propTypes = {
|
|
87
70
|
/**
|
|
@@ -143,10 +126,18 @@ SelectInput.propTypes = {
|
|
|
143
126
|
/**
|
|
144
127
|
* Whether the input is optional or not
|
|
145
128
|
*/
|
|
146
|
-
optional: _propTypes.default.bool
|
|
129
|
+
optional: _propTypes.default.bool,
|
|
130
|
+
/**
|
|
131
|
+
* Whether the select input should allow multiple selections
|
|
132
|
+
*/
|
|
133
|
+
multiple: _propTypes.default.bool,
|
|
134
|
+
/**
|
|
135
|
+
* The placeholder of the select input
|
|
136
|
+
*/
|
|
137
|
+
placeholder: _propTypes.default.string
|
|
147
138
|
};
|
|
148
139
|
SelectInput.defaultProps = {
|
|
149
140
|
disabled: false,
|
|
150
|
-
|
|
141
|
+
multiple: false
|
|
151
142
|
};
|
|
152
143
|
var _default = exports.default = /*#__PURE__*/(0, _react.memo)(SelectInput);
|