@dspworkplace/ui 2.0.0 → 2.0.2
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/index.es.js +569 -174
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +569 -173
- package/dist/index.js.map +1 -1
- package/package.json +4 -2
package/dist/index.es.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React, { forwardRef, useState, Fragment, useCallback, useEffect, useRef, Children } from 'react';
|
|
2
2
|
import styled, { keyframes } from 'styled-components';
|
|
3
|
+
import { createPortal } from 'react-dom';
|
|
3
4
|
import { supercomplete, useCombobox } from '@szhsin/react-autocomplete';
|
|
5
|
+
import { usePopper } from 'react-popper';
|
|
4
6
|
|
|
5
7
|
var defaultRadius = '4px';
|
|
6
8
|
var colors = {
|
|
@@ -15,8 +17,8 @@ var colors = {
|
|
|
15
17
|
white: '#FFFFFF'
|
|
16
18
|
},
|
|
17
19
|
warnings: {
|
|
18
|
-
border: '#
|
|
19
|
-
text: '#
|
|
20
|
+
border: '#e7a73b',
|
|
21
|
+
text: '#9c6505',
|
|
20
22
|
shadow: '#FAE0B5',
|
|
21
23
|
bg: '#FEF8F0'
|
|
22
24
|
},
|
|
@@ -380,7 +382,7 @@ function _templateObject3() {
|
|
|
380
382
|
}
|
|
381
383
|
|
|
382
384
|
function _templateObject2() {
|
|
383
|
-
var data = taggedTemplateLiteral(["\n font-size:", ";\n font-weight:normal;\n font-family:\"Huninn\", sans-serif;\n display:block;\n padding-bottom:
|
|
385
|
+
var data = taggedTemplateLiteral(["\n font-size:", ";\n line-height: ", ";\n font-weight:normal;\n font-family:\"Huninn\", sans-serif;\n display:block;\n padding-bottom:4px;\n color: ", ";\n\n >.requiredField {\n color:", ";\n }\n\n"]);
|
|
384
386
|
|
|
385
387
|
_templateObject2 = function _templateObject2() {
|
|
386
388
|
return data;
|
|
@@ -416,7 +418,7 @@ var handleSize = function handleSize(sizeType) {
|
|
|
416
418
|
};
|
|
417
419
|
|
|
418
420
|
var Frag = styled.div(_templateObject$1());
|
|
419
|
-
var Label = styled.label(_templateObject2(), theme.font.medium.size, theme.colors.error.text);
|
|
421
|
+
var Label = styled.label(_templateObject2(), theme.font.medium.size, theme.font.medium.lineHeight, theme.colors.neutrals.medium, theme.colors.error.text);
|
|
420
422
|
var borderDefault = "\n border-width:1px;\n border-style:solid;\n";
|
|
421
423
|
var InputBase = styled.input(_templateObject3(), theme.colors.neutrals.white, theme.colors.neutrals.silver, theme.form.input.radius, theme.font.small.size, theme.font.small.lineHeight, theme.form.input.padding, theme.colors.neutrals.gray, function (_ref) {
|
|
422
424
|
var size = _ref.size;
|
|
@@ -460,7 +462,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
460
462
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
461
463
|
|
|
462
464
|
function _templateObject4$1() {
|
|
463
|
-
var data = taggedTemplateLiteral(["\n width:", "\n display:inline-block;\n vertical-align:top;\n"]);
|
|
465
|
+
var data = taggedTemplateLiteral(["\n width:", "\n display:inline-block;\n vertical-align:top;\n\n svg path {\n fill: ", ";\n }\n"]);
|
|
464
466
|
|
|
465
467
|
_templateObject4$1 = function _templateObject4() {
|
|
466
468
|
return data;
|
|
@@ -512,7 +514,7 @@ var handleSize$1 = function handleSize(sizeType) {
|
|
|
512
514
|
return '460px';
|
|
513
515
|
|
|
514
516
|
default:
|
|
515
|
-
return '
|
|
517
|
+
return '100%';
|
|
516
518
|
}
|
|
517
519
|
};
|
|
518
520
|
|
|
@@ -555,7 +557,7 @@ var SpanError$1 = styled(Span)(_templateObject3$1(), theme.colors.error.text);
|
|
|
555
557
|
var Frag$1 = styled.div(_templateObject4$1(), function (_ref2) {
|
|
556
558
|
var size = _ref2.size;
|
|
557
559
|
return handleSize$1(size);
|
|
558
|
-
});
|
|
560
|
+
}, theme.colors.secondary);
|
|
559
561
|
var Input = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
560
562
|
var name = _ref3.name,
|
|
561
563
|
label = _ref3.label,
|
|
@@ -4196,7 +4198,7 @@ function _templateObject3$2() {
|
|
|
4196
4198
|
}
|
|
4197
4199
|
|
|
4198
4200
|
function _templateObject2$2() {
|
|
4199
|
-
var data = taggedTemplateLiteral(["\n font-family: \"Huninn\", sans-serif;\n font-weight: bold;\n font-size:
|
|
4201
|
+
var data = taggedTemplateLiteral(["\n font-family: \"Huninn\", sans-serif;\n font-weight: bold;\n font-size: 24px;\n line-height: 28px;\n color: ", ";\n"]);
|
|
4200
4202
|
|
|
4201
4203
|
_templateObject2$2 = function _templateObject2() {
|
|
4202
4204
|
return data;
|
|
@@ -4222,6 +4224,10 @@ var Text = styled.p(_templateObject4$2(), theme.colors.neutrals.gray, function (
|
|
|
4222
4224
|
return subtle && "\n color:".concat(theme.colors.neutrals.medium, ";\n ");
|
|
4223
4225
|
});
|
|
4224
4226
|
|
|
4227
|
+
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
4228
|
+
|
|
4229
|
+
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$1(Object(source), true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
4230
|
+
|
|
4225
4231
|
function _templateObject14() {
|
|
4226
4232
|
var data = taggedTemplateLiteral(["\n border: 0;\n padding-right: 8px;\n background: transparent;\n cursor: inherit;\n display: flex;\n align-items: center;\n height: 100%;\n"]);
|
|
4227
4233
|
|
|
@@ -4353,7 +4359,7 @@ function _templateObject2$3() {
|
|
|
4353
4359
|
}
|
|
4354
4360
|
|
|
4355
4361
|
function _templateObject$6() {
|
|
4356
|
-
var data = taggedTemplateLiteral(["\n display: inline-block;\n vertical-align: top;\n"]);
|
|
4362
|
+
var data = taggedTemplateLiteral(["\n display: inline-block;\n vertical-align: top;\n ", "\n"]);
|
|
4357
4363
|
|
|
4358
4364
|
_templateObject$6 = function _templateObject() {
|
|
4359
4365
|
return data;
|
|
@@ -4361,7 +4367,10 @@ function _templateObject$6() {
|
|
|
4361
4367
|
|
|
4362
4368
|
return data;
|
|
4363
4369
|
}
|
|
4364
|
-
var Frag$2 = styled.div(_templateObject$6())
|
|
4370
|
+
var Frag$2 = styled.div(_templateObject$6(), function (_ref) {
|
|
4371
|
+
var fullWidth = _ref.fullWidth;
|
|
4372
|
+
return fullWidth && 'width: 100%;';
|
|
4373
|
+
});
|
|
4365
4374
|
|
|
4366
4375
|
var handleSize$2 = function handleSize(sizeType) {
|
|
4367
4376
|
switch (sizeType) {
|
|
@@ -4375,12 +4384,12 @@ var handleSize$2 = function handleSize(sizeType) {
|
|
|
4375
4384
|
return '460px';
|
|
4376
4385
|
|
|
4377
4386
|
default:
|
|
4378
|
-
return '
|
|
4387
|
+
return '100%';
|
|
4379
4388
|
}
|
|
4380
4389
|
};
|
|
4381
4390
|
|
|
4382
|
-
var SelectUi$1 = styled.div(_templateObject2$3(), function (
|
|
4383
|
-
var size =
|
|
4391
|
+
var SelectUi$1 = styled.div(_templateObject2$3(), function (_ref2) {
|
|
4392
|
+
var size = _ref2.size;
|
|
4384
4393
|
return handleSize$2(size);
|
|
4385
4394
|
}, theme.defaultRadius, theme.colors.neutrals.silver, theme.colors.info.border, theme.colors.secondary, theme.colors.action, theme.colors.error.border, theme.colors.error.border, theme.colors.error.shadow, theme.colors.success.border, theme.colors.success.border, theme.colors.success.shadow, theme.colors.extra.whiteSmoke, theme.colors.neutrals.silver, theme.colors.neutrals.medium);
|
|
4386
4395
|
var Value$1 = styled(Text).attrs(function (props) {
|
|
@@ -4450,36 +4459,70 @@ var optionText = function optionText(node) {
|
|
|
4450
4459
|
if (typeof node === 'string' || typeof node === 'number') return node.toString();
|
|
4451
4460
|
if (Array.isArray(node)) return node.map(optionText).join('');
|
|
4452
4461
|
return node.props ? optionText(node.props.children) : '';
|
|
4453
|
-
};
|
|
4462
|
+
}; // rendered in document.body so overflow on any ancestor cannot clip it; popper flips and shifts it to stay in the viewport
|
|
4463
|
+
// eslint-disable-next-line react/prop-types
|
|
4454
4464
|
|
|
4455
|
-
var keepInViewport = function keepInViewport(node) {
|
|
4456
|
-
if (node && node.getBoundingClientRect().right > window.innerWidth) {
|
|
4457
|
-
node.style.left = 'unset';
|
|
4458
|
-
node.style.right = '0px';
|
|
4459
|
-
}
|
|
4460
|
-
}; // eslint-disable-next-line react/prop-types
|
|
4461
4465
|
|
|
4466
|
+
var FloatingOptions = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
4467
|
+
var anchor = _ref3.anchor,
|
|
4468
|
+
openTo = _ref3.openTo,
|
|
4469
|
+
style = _ref3.style,
|
|
4470
|
+
props = objectWithoutProperties(_ref3, ["anchor", "openTo", "style"]);
|
|
4462
4471
|
|
|
4463
|
-
var
|
|
4464
|
-
var options = _ref2.options,
|
|
4465
|
-
selectedOpt = _ref2.selectedOpt,
|
|
4466
|
-
setSelected = _ref2.setSelected,
|
|
4467
|
-
onChange = _ref2.onChange,
|
|
4468
|
-
onSelect = _ref2.onSelect,
|
|
4469
|
-
placeholder = _ref2.placeholder,
|
|
4470
|
-
error = _ref2.error,
|
|
4471
|
-
valid = _ref2.valid,
|
|
4472
|
-
noOptions = _ref2.noOptions,
|
|
4473
|
-
visibleOptionsQty = _ref2.visibleOptionsQty,
|
|
4474
|
-
openTo = _ref2.openTo,
|
|
4475
|
-
startOpen = _ref2.startOpen,
|
|
4476
|
-
resetCallback = _ref2.resetCallback,
|
|
4477
|
-
props = objectWithoutProperties(_ref2, ["options", "selectedOpt", "setSelected", "onChange", "onSelect", "placeholder", "error", "valid", "noOptions", "visibleOptionsQty", "openTo", "startOpen", "resetCallback"]);
|
|
4478
|
-
|
|
4479
|
-
var _useState = useState(),
|
|
4472
|
+
var _useState = useState(null),
|
|
4480
4473
|
_useState2 = slicedToArray(_useState, 2),
|
|
4481
|
-
|
|
4482
|
-
|
|
4474
|
+
list = _useState2[0],
|
|
4475
|
+
setList = _useState2[1];
|
|
4476
|
+
|
|
4477
|
+
var listRef = useCallback(mergeRefs([setList, ref]), [ref]);
|
|
4478
|
+
|
|
4479
|
+
var _usePopper = usePopper(anchor, list, {
|
|
4480
|
+
strategy: 'fixed',
|
|
4481
|
+
placement: openTo === 'top' ? 'top-start' : 'bottom-start',
|
|
4482
|
+
modifiers: [{
|
|
4483
|
+
name: 'offset',
|
|
4484
|
+
options: {
|
|
4485
|
+
offset: [0, 4]
|
|
4486
|
+
}
|
|
4487
|
+
}]
|
|
4488
|
+
}),
|
|
4489
|
+
styles = _usePopper.styles,
|
|
4490
|
+
attributes = _usePopper.attributes;
|
|
4491
|
+
|
|
4492
|
+
return /*#__PURE__*/createPortal( /*#__PURE__*/React.createElement(Options$1, _extends_1({
|
|
4493
|
+
ref: listRef,
|
|
4494
|
+
style: _objectSpread$1(_objectSpread$1(_objectSpread$1({}, style), styles.popper), {}, {
|
|
4495
|
+
margin: 0,
|
|
4496
|
+
zIndex: 1000000
|
|
4497
|
+
})
|
|
4498
|
+
}, attributes.popper, props)), document.body);
|
|
4499
|
+
}); // eslint-disable-next-line react/prop-types
|
|
4500
|
+
|
|
4501
|
+
var AutocompleteSelect = function AutocompleteSelect(_ref4) {
|
|
4502
|
+
var options = _ref4.options,
|
|
4503
|
+
selectedOpt = _ref4.selectedOpt,
|
|
4504
|
+
setSelected = _ref4.setSelected,
|
|
4505
|
+
onChange = _ref4.onChange,
|
|
4506
|
+
onSelect = _ref4.onSelect,
|
|
4507
|
+
placeholder = _ref4.placeholder,
|
|
4508
|
+
error = _ref4.error,
|
|
4509
|
+
valid = _ref4.valid,
|
|
4510
|
+
noOptions = _ref4.noOptions,
|
|
4511
|
+
visibleOptionsQty = _ref4.visibleOptionsQty,
|
|
4512
|
+
openTo = _ref4.openTo,
|
|
4513
|
+
startOpen = _ref4.startOpen,
|
|
4514
|
+
resetCallback = _ref4.resetCallback,
|
|
4515
|
+
props = objectWithoutProperties(_ref4, ["options", "selectedOpt", "setSelected", "onChange", "onSelect", "placeholder", "error", "valid", "noOptions", "visibleOptionsQty", "openTo", "startOpen", "resetCallback"]);
|
|
4516
|
+
|
|
4517
|
+
var _useState3 = useState(),
|
|
4518
|
+
_useState4 = slicedToArray(_useState3, 2),
|
|
4519
|
+
search = _useState4[0],
|
|
4520
|
+
setSearch = _useState4[1];
|
|
4521
|
+
|
|
4522
|
+
var _useState5 = useState(null),
|
|
4523
|
+
_useState6 = slicedToArray(_useState5, 2),
|
|
4524
|
+
anchor = _useState6[0],
|
|
4525
|
+
setAnchor = _useState6[1];
|
|
4483
4526
|
|
|
4484
4527
|
var rows = flattenOptions(options);
|
|
4485
4528
|
var selectable = rows.filter(function (row) {
|
|
@@ -4522,8 +4565,8 @@ var AutocompleteSelect = function AutocompleteSelect(_ref2) {
|
|
|
4522
4565
|
},
|
|
4523
4566
|
disabled: props.disabled,
|
|
4524
4567
|
feature: supercomplete({
|
|
4525
|
-
onRequestItem: function onRequestItem(
|
|
4526
|
-
var value =
|
|
4568
|
+
onRequestItem: function onRequestItem(_ref5, res) {
|
|
4569
|
+
var value = _ref5.value;
|
|
4527
4570
|
var matches = filterItems(value);
|
|
4528
4571
|
if (matches.length > 0) res({
|
|
4529
4572
|
index: 0,
|
|
@@ -4547,6 +4590,7 @@ var AutocompleteSelect = function AutocompleteSelect(_ref2) {
|
|
|
4547
4590
|
}, []);
|
|
4548
4591
|
var index = -1;
|
|
4549
4592
|
return /*#__PURE__*/React.createElement(SelectUi$1, _extends_1({
|
|
4593
|
+
ref: setAnchor,
|
|
4550
4594
|
className: [open && 'open', error && 'error', valid && 'valid'].filter(Boolean).join(' ')
|
|
4551
4595
|
}, props, {
|
|
4552
4596
|
title: selectedText
|
|
@@ -4559,10 +4603,10 @@ var AutocompleteSelect = function AutocompleteSelect(_ref2) {
|
|
|
4559
4603
|
}) : /*#__PURE__*/React.createElement(Icons.ArrowDown, {
|
|
4560
4604
|
size: "15px",
|
|
4561
4605
|
color: theme.colors.info.border
|
|
4562
|
-
})), open && /*#__PURE__*/React.createElement(
|
|
4606
|
+
})), open && /*#__PURE__*/React.createElement(FloatingOptions, _extends_1({
|
|
4607
|
+
anchor: anchor,
|
|
4563
4608
|
visibleOptionsQty: visibleOptionsQty,
|
|
4564
|
-
openTo: openTo
|
|
4565
|
-
ref: keepInViewport
|
|
4609
|
+
openTo: openTo
|
|
4566
4610
|
}, getListProps()), items.length === 0 && /*#__PURE__*/React.createElement("li", {
|
|
4567
4611
|
style: {
|
|
4568
4612
|
paddingRight: '8px'
|
|
@@ -4572,9 +4616,9 @@ var AutocompleteSelect = function AutocompleteSelect(_ref2) {
|
|
|
4572
4616
|
item: item,
|
|
4573
4617
|
depth: 0
|
|
4574
4618
|
};
|
|
4575
|
-
}) : rows).map(function (
|
|
4576
|
-
var item =
|
|
4577
|
-
depth =
|
|
4619
|
+
}) : rows).map(function (_ref6, key) {
|
|
4620
|
+
var item = _ref6.item,
|
|
4621
|
+
depth = _ref6.depth;
|
|
4578
4622
|
|
|
4579
4623
|
if (!isOption(item)) {
|
|
4580
4624
|
return /*#__PURE__*/React.createElement(OptionGroup$1, {
|
|
@@ -4605,31 +4649,292 @@ var AutocompleteSelect = function AutocompleteSelect(_ref2) {
|
|
|
4605
4649
|
})));
|
|
4606
4650
|
};
|
|
4607
4651
|
|
|
4608
|
-
var
|
|
4609
|
-
|
|
4610
|
-
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
|
|
4617
|
-
|
|
4618
|
-
|
|
4619
|
-
|
|
4620
|
-
|
|
4621
|
-
|
|
4622
|
-
|
|
4652
|
+
var summarizeSelection = function summarizeSelection(names) {
|
|
4653
|
+
if (names.length <= 2) return names.join(', ');
|
|
4654
|
+
var others = names.length - 2;
|
|
4655
|
+
return "".concat(names[0], ", ").concat(names[1], " and ").concat(others, " other").concat(others > 1 ? 's' : '');
|
|
4656
|
+
}; // eslint-disable-next-line react/prop-types
|
|
4657
|
+
|
|
4658
|
+
|
|
4659
|
+
var MultiAutocompleteSelect = function MultiAutocompleteSelect(_ref7) {
|
|
4660
|
+
var options = _ref7.options,
|
|
4661
|
+
selectedValues = _ref7.selectedValues,
|
|
4662
|
+
onToggle = _ref7.onToggle,
|
|
4663
|
+
placeholder = _ref7.placeholder,
|
|
4664
|
+
error = _ref7.error,
|
|
4665
|
+
valid = _ref7.valid,
|
|
4666
|
+
noOptions = _ref7.noOptions,
|
|
4667
|
+
visibleOptionsQty = _ref7.visibleOptionsQty,
|
|
4668
|
+
openTo = _ref7.openTo,
|
|
4669
|
+
startOpen = _ref7.startOpen,
|
|
4670
|
+
props = objectWithoutProperties(_ref7, ["options", "selectedValues", "onToggle", "placeholder", "error", "valid", "noOptions", "visibleOptionsQty", "openTo", "startOpen"]);
|
|
4671
|
+
|
|
4672
|
+
var _useState7 = useState(''),
|
|
4673
|
+
_useState8 = slicedToArray(_useState7, 2),
|
|
4674
|
+
search = _useState8[0],
|
|
4675
|
+
setSearch = _useState8[1];
|
|
4676
|
+
|
|
4677
|
+
var _useState9 = useState(startOpen),
|
|
4678
|
+
_useState10 = slicedToArray(_useState9, 2),
|
|
4679
|
+
open = _useState10[0],
|
|
4680
|
+
setOpen = _useState10[1];
|
|
4681
|
+
|
|
4682
|
+
var _useState11 = useState(null),
|
|
4683
|
+
_useState12 = slicedToArray(_useState11, 2),
|
|
4684
|
+
anchor = _useState12[0],
|
|
4685
|
+
setAnchor = _useState12[1];
|
|
4686
|
+
|
|
4687
|
+
var nodeRef = useRef();
|
|
4688
|
+
var listRef = useRef();
|
|
4689
|
+
var setNode = useCallback(mergeRefs([nodeRef, setAnchor]), []);
|
|
4690
|
+
useEffect(function () {
|
|
4691
|
+
var closeOnOutsideClick = function closeOnOutsideClick(e) {
|
|
4692
|
+
var inList = listRef.current && listRef.current.contains(e.target);
|
|
4693
|
+
|
|
4694
|
+
if (nodeRef.current && !nodeRef.current.contains(e.target) && !inList) {
|
|
4695
|
+
setOpen(false);
|
|
4696
|
+
setSearch('');
|
|
4697
|
+
}
|
|
4698
|
+
};
|
|
4699
|
+
|
|
4700
|
+
document.addEventListener('mousedown', closeOnOutsideClick);
|
|
4701
|
+
return function () {
|
|
4702
|
+
return document.removeEventListener('mousedown', closeOnOutsideClick);
|
|
4703
|
+
};
|
|
4704
|
+
}, []);
|
|
4705
|
+
var rows = flattenOptions(options);
|
|
4706
|
+
var selectable = rows.filter(function (row) {
|
|
4707
|
+
return isOption(row.item);
|
|
4708
|
+
}).map(function (row) {
|
|
4709
|
+
return row.item;
|
|
4710
|
+
});
|
|
4711
|
+
var items = search ? selectable.filter(function (item) {
|
|
4712
|
+
return optionText(item.name).toLowerCase().startsWith(search.toLowerCase());
|
|
4713
|
+
}) : selectable;
|
|
4714
|
+
var summary = summarizeSelection(selectable.filter(function (item) {
|
|
4715
|
+
return selectedValues.includes(item.value.toString());
|
|
4716
|
+
}).map(function (item) {
|
|
4717
|
+
return optionText(item.name);
|
|
4718
|
+
}));
|
|
4719
|
+
return /*#__PURE__*/React.createElement(SelectUi$1, _extends_1({
|
|
4720
|
+
ref: setNode,
|
|
4721
|
+
className: [open && 'open', error && 'error', valid && 'valid'].filter(Boolean).join(' ')
|
|
4722
|
+
}, props, {
|
|
4723
|
+
title: summary,
|
|
4724
|
+
onClick: function onClick() {
|
|
4725
|
+
return !props.disabled && setOpen(true);
|
|
4726
|
+
}
|
|
4727
|
+
}), /*#__PURE__*/React.createElement(SearchInput, {
|
|
4728
|
+
value: search,
|
|
4729
|
+
placeholder: summary || placeholder,
|
|
4730
|
+
hasSelection: summary.length > 0,
|
|
4731
|
+
disabled: props.disabled,
|
|
4732
|
+
onChange: function onChange(e) {
|
|
4733
|
+
setSearch(e.target.value);
|
|
4734
|
+
setOpen(true);
|
|
4735
|
+
},
|
|
4736
|
+
onKeyDown: function onKeyDown(e) {
|
|
4737
|
+
if (e.key === 'Escape') {
|
|
4738
|
+
setOpen(false);
|
|
4739
|
+
setSearch('');
|
|
4740
|
+
}
|
|
4741
|
+
}
|
|
4742
|
+
}), /*#__PURE__*/React.createElement(ToggleButton, {
|
|
4743
|
+
type: "button",
|
|
4744
|
+
tabIndex: -1,
|
|
4745
|
+
onClick: function onClick(e) {
|
|
4746
|
+
e.stopPropagation();
|
|
4747
|
+
if (!props.disabled) setOpen(!open);
|
|
4748
|
+
}
|
|
4749
|
+
}, open ? /*#__PURE__*/React.createElement(Icons.ArrowUp, {
|
|
4750
|
+
size: "15px",
|
|
4751
|
+
color: theme.colors.info.border
|
|
4752
|
+
}) : /*#__PURE__*/React.createElement(Icons.ArrowDown, {
|
|
4753
|
+
size: "15px",
|
|
4754
|
+
color: theme.colors.info.border
|
|
4755
|
+
})), open && /*#__PURE__*/React.createElement(FloatingOptions, {
|
|
4756
|
+
anchor: anchor,
|
|
4757
|
+
visibleOptionsQty: visibleOptionsQty,
|
|
4758
|
+
openTo: openTo,
|
|
4759
|
+
ref: listRef
|
|
4760
|
+
}, items.length === 0 && /*#__PURE__*/React.createElement("li", {
|
|
4761
|
+
style: {
|
|
4762
|
+
paddingRight: '8px'
|
|
4763
|
+
}
|
|
4764
|
+
}, noOptions || 'No data found'), (search ? items.map(function (item) {
|
|
4765
|
+
return {
|
|
4766
|
+
item: item,
|
|
4767
|
+
depth: 0
|
|
4768
|
+
};
|
|
4769
|
+
}) : rows).map(function (_ref8, key) {
|
|
4770
|
+
var item = _ref8.item,
|
|
4771
|
+
depth = _ref8.depth;
|
|
4772
|
+
|
|
4773
|
+
if (!isOption(item)) {
|
|
4774
|
+
return /*#__PURE__*/React.createElement(OptionGroup$1, {
|
|
4775
|
+
key: key,
|
|
4776
|
+
style: {
|
|
4777
|
+
paddingLeft: 8 + depth * 16
|
|
4778
|
+
}
|
|
4779
|
+
}, item.name);
|
|
4780
|
+
}
|
|
4781
|
+
|
|
4782
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
4783
|
+
key: key,
|
|
4784
|
+
style: {
|
|
4785
|
+
paddingLeft: 8 + depth * 16,
|
|
4786
|
+
justifyContent: 'flex-start'
|
|
4787
|
+
},
|
|
4788
|
+
onMouseDown: function onMouseDown(e) {
|
|
4789
|
+
return e.preventDefault();
|
|
4790
|
+
},
|
|
4791
|
+
onClick: function onClick(e) {
|
|
4792
|
+
e.stopPropagation();
|
|
4793
|
+
onToggle(item);
|
|
4794
|
+
}
|
|
4795
|
+
}, /*#__PURE__*/React.createElement(CustomCheckBox, null, selectedValues.includes(item.value.toString()) && /*#__PURE__*/React.createElement(Icons.Check, {
|
|
4796
|
+
size: "17px"
|
|
4797
|
+
})), /*#__PURE__*/React.createElement(Value$1, {
|
|
4798
|
+
option: true,
|
|
4799
|
+
style: {
|
|
4800
|
+
marginRight: 4
|
|
4801
|
+
}
|
|
4802
|
+
}, item.name));
|
|
4803
|
+
})));
|
|
4804
|
+
};
|
|
4805
|
+
|
|
4806
|
+
var MultiDropdown = /*#__PURE__*/forwardRef(function (_ref9, ref) {
|
|
4807
|
+
var name = _ref9.name,
|
|
4808
|
+
label = _ref9.label,
|
|
4809
|
+
help = _ref9.help,
|
|
4810
|
+
error = _ref9.error,
|
|
4811
|
+
valid = _ref9.valid,
|
|
4812
|
+
options = _ref9.options,
|
|
4813
|
+
placeholder = _ref9.placeholder,
|
|
4814
|
+
onChange = _ref9.onChange,
|
|
4815
|
+
defaultValue = _ref9.defaultValue,
|
|
4816
|
+
visibleOptionsQty = _ref9.visibleOptionsQty,
|
|
4817
|
+
openTo = _ref9.openTo,
|
|
4818
|
+
_ref9$startOpen = _ref9.startOpen,
|
|
4819
|
+
startOpen = _ref9$startOpen === void 0 ? false : _ref9$startOpen,
|
|
4820
|
+
resetCallback = _ref9.resetCallback,
|
|
4821
|
+
props = objectWithoutProperties(_ref9, ["name", "label", "help", "error", "valid", "options", "placeholder", "onChange", "defaultValue", "visibleOptionsQty", "openTo", "startOpen", "resetCallback"]);
|
|
4822
|
+
|
|
4823
|
+
var _useState13 = useState([]),
|
|
4824
|
+
_useState14 = slicedToArray(_useState13, 2),
|
|
4825
|
+
selectedValues = _useState14[0],
|
|
4826
|
+
setSelectedValues = _useState14[1];
|
|
4827
|
+
|
|
4828
|
+
var valueRef = useRef();
|
|
4829
|
+
var selectable = flattenOptions(options).filter(function (row) {
|
|
4830
|
+
return isOption(row.item);
|
|
4831
|
+
}).map(function (row) {
|
|
4832
|
+
return row.item;
|
|
4833
|
+
});
|
|
4834
|
+
|
|
4835
|
+
if (resetCallback) {
|
|
4836
|
+
resetCallback(function () {
|
|
4837
|
+
return setSelectedValues([]);
|
|
4838
|
+
});
|
|
4839
|
+
}
|
|
4840
|
+
|
|
4841
|
+
var hasDefaultValue = defaultValue !== undefined && defaultValue !== null && defaultValue !== '';
|
|
4842
|
+
var defaults = (Array.isArray(defaultValue) ? defaultValue : hasDefaultValue ? [defaultValue] : selectable.filter(function (item) {
|
|
4843
|
+
return item.selected;
|
|
4844
|
+
}).map(function (item) {
|
|
4845
|
+
return item.value;
|
|
4846
|
+
})).map(String);
|
|
4847
|
+
var defaultsKey = defaults.join("\0");
|
|
4848
|
+
useEffect(function () {
|
|
4849
|
+
setSelectedValues(defaults);
|
|
4850
|
+
}, [defaultsKey]);
|
|
4851
|
+
useEffect(function () {
|
|
4852
|
+
if (!valueRef.current) return;
|
|
4853
|
+
Array.from(valueRef.current.options).forEach(function (opt) {
|
|
4854
|
+
opt.selected = selectedValues.includes(opt.value);
|
|
4855
|
+
});
|
|
4856
|
+
valueRef.current.dispatchEvent(new Event('blur'));
|
|
4857
|
+
}, [selectedValues, options]);
|
|
4858
|
+
|
|
4859
|
+
var toggle = function toggle(item) {
|
|
4860
|
+
var value = item.value.toString();
|
|
4861
|
+
var next = selectedValues.includes(value) ? selectedValues.filter(function (v) {
|
|
4862
|
+
return v !== value;
|
|
4863
|
+
}) : [].concat(toConsumableArray(selectedValues), [value]);
|
|
4864
|
+
setSelectedValues(next);
|
|
4865
|
+
if (onChange) onChange(selectable.filter(function (opt) {
|
|
4866
|
+
return next.includes(opt.value.toString());
|
|
4867
|
+
}));
|
|
4868
|
+
};
|
|
4869
|
+
|
|
4870
|
+
var useIcon = false;
|
|
4871
|
+
if (props.Required) useIcon = /*#__PURE__*/React.createElement(RequiredText, null);
|
|
4872
|
+
|
|
4873
|
+
if (valid) {
|
|
4874
|
+
useIcon = /*#__PURE__*/React.createElement("img", {
|
|
4875
|
+
src: Check
|
|
4876
|
+
});
|
|
4877
|
+
}
|
|
4878
|
+
|
|
4879
|
+
return /*#__PURE__*/React.createElement(Frag$2, {
|
|
4880
|
+
fullWidth: !props.size
|
|
4881
|
+
}, label && !useIcon && /*#__PURE__*/React.createElement(Label, {
|
|
4882
|
+
htmlFor: name
|
|
4883
|
+
}, label), label && useIcon && /*#__PURE__*/React.createElement(Label, {
|
|
4884
|
+
htmlFor: name
|
|
4885
|
+
}, label, " ", useIcon), /*#__PURE__*/React.createElement(MultiAutocompleteSelect, _extends_1({
|
|
4886
|
+
options: options,
|
|
4887
|
+
selectedValues: selectedValues,
|
|
4888
|
+
onToggle: toggle,
|
|
4889
|
+
placeholder: placeholder,
|
|
4890
|
+
error: error,
|
|
4891
|
+
valid: valid,
|
|
4892
|
+
visibleOptionsQty: visibleOptionsQty,
|
|
4893
|
+
openTo: openTo,
|
|
4894
|
+
startOpen: startOpen
|
|
4895
|
+
}, props)), help && /*#__PURE__*/React.createElement(Span$1, null, help), error && /*#__PURE__*/React.createElement(SpanError$2, null, /*#__PURE__*/React.createElement("img", {
|
|
4896
|
+
src: Ex,
|
|
4897
|
+
style: {
|
|
4898
|
+
marginRight: '6px'
|
|
4899
|
+
}
|
|
4900
|
+
}), " ", error), /*#__PURE__*/React.createElement(SelectHidden, {
|
|
4901
|
+
name: name,
|
|
4902
|
+
multiple: true,
|
|
4903
|
+
ref: mergeRefs([valueRef, ref]),
|
|
4904
|
+
tabIndex: -1,
|
|
4905
|
+
disabled: props.disabled
|
|
4906
|
+
}, selectable.map(function (item, k) {
|
|
4907
|
+
return /*#__PURE__*/React.createElement("option", {
|
|
4908
|
+
value: item.value,
|
|
4909
|
+
key: k
|
|
4910
|
+
}, optionText(item.name));
|
|
4911
|
+
})));
|
|
4912
|
+
});
|
|
4913
|
+
var SingleDropdown = /*#__PURE__*/forwardRef(function (_ref10, ref) {
|
|
4914
|
+
var name = _ref10.name,
|
|
4915
|
+
label = _ref10.label,
|
|
4916
|
+
help = _ref10.help,
|
|
4917
|
+
error = _ref10.error,
|
|
4918
|
+
valid = _ref10.valid,
|
|
4919
|
+
options = _ref10.options,
|
|
4920
|
+
placeholder = _ref10.placeholder,
|
|
4921
|
+
onChange = _ref10.onChange,
|
|
4922
|
+
defaultValue = _ref10.defaultValue,
|
|
4923
|
+
visibleOptionsQty = _ref10.visibleOptionsQty,
|
|
4924
|
+
openTo = _ref10.openTo,
|
|
4925
|
+
_ref10$startOpen = _ref10.startOpen,
|
|
4926
|
+
startOpen = _ref10$startOpen === void 0 ? false : _ref10$startOpen,
|
|
4927
|
+
props = objectWithoutProperties(_ref10, ["name", "label", "help", "error", "valid", "options", "placeholder", "onChange", "defaultValue", "visibleOptionsQty", "openTo", "startOpen"]);
|
|
4623
4928
|
|
|
4624
4929
|
var defaultSelected = {
|
|
4625
4930
|
value: '',
|
|
4626
4931
|
desc: ''
|
|
4627
4932
|
};
|
|
4628
4933
|
|
|
4629
|
-
var
|
|
4630
|
-
|
|
4631
|
-
selectedOpt =
|
|
4632
|
-
setSelected =
|
|
4934
|
+
var _useState15 = useState(defaultSelected),
|
|
4935
|
+
_useState16 = slicedToArray(_useState15, 2),
|
|
4936
|
+
selectedOpt = _useState16[0],
|
|
4937
|
+
setSelected = _useState16[1];
|
|
4633
4938
|
|
|
4634
4939
|
var valueRef = useRef();
|
|
4635
4940
|
|
|
@@ -4682,7 +4987,9 @@ var Dropdown = /*#__PURE__*/forwardRef(function (_ref5, ref) {
|
|
|
4682
4987
|
});
|
|
4683
4988
|
}
|
|
4684
4989
|
|
|
4685
|
-
return /*#__PURE__*/React.createElement(Frag$2,
|
|
4990
|
+
return /*#__PURE__*/React.createElement(Frag$2, {
|
|
4991
|
+
fullWidth: !props.size
|
|
4992
|
+
}, label && !useIcon && /*#__PURE__*/React.createElement(Label, {
|
|
4686
4993
|
htmlFor: name
|
|
4687
4994
|
}, label), label && useIcon && /*#__PURE__*/React.createElement(Label, {
|
|
4688
4995
|
htmlFor: name
|
|
@@ -4708,19 +5015,29 @@ var Dropdown = /*#__PURE__*/forwardRef(function (_ref5, ref) {
|
|
|
4708
5015
|
ref: mergeRefs([valueRef, ref]),
|
|
4709
5016
|
disabled: props.disabled
|
|
4710
5017
|
}));
|
|
5018
|
+
});
|
|
5019
|
+
var Dropdown = /*#__PURE__*/forwardRef(function (_ref11, ref) {
|
|
5020
|
+
var multiple = _ref11.multiple,
|
|
5021
|
+
props = objectWithoutProperties(_ref11, ["multiple"]);
|
|
5022
|
+
|
|
5023
|
+
return multiple ? /*#__PURE__*/React.createElement(MultiDropdown, _extends_1({
|
|
5024
|
+
ref: ref
|
|
5025
|
+
}, props)) : /*#__PURE__*/React.createElement(SingleDropdown, _extends_1({
|
|
5026
|
+
ref: ref
|
|
5027
|
+
}, props));
|
|
4711
5028
|
}); // eslint-disable-next-line react/prop-types
|
|
4712
5029
|
|
|
4713
|
-
var BoxOptions = function BoxOptions(
|
|
4714
|
-
var options =
|
|
4715
|
-
isChild =
|
|
4716
|
-
setSelected =
|
|
4717
|
-
onChange =
|
|
4718
|
-
noOptions =
|
|
4719
|
-
selectedOpt =
|
|
4720
|
-
setOpen =
|
|
4721
|
-
onSelect =
|
|
4722
|
-
visibleOptionsQty =
|
|
4723
|
-
openTo =
|
|
5030
|
+
var BoxOptions = function BoxOptions(_ref12) {
|
|
5031
|
+
var options = _ref12.options,
|
|
5032
|
+
isChild = _ref12.isChild,
|
|
5033
|
+
setSelected = _ref12.setSelected,
|
|
5034
|
+
onChange = _ref12.onChange,
|
|
5035
|
+
noOptions = _ref12.noOptions,
|
|
5036
|
+
selectedOpt = _ref12.selectedOpt,
|
|
5037
|
+
setOpen = _ref12.setOpen,
|
|
5038
|
+
onSelect = _ref12.onSelect,
|
|
5039
|
+
visibleOptionsQty = _ref12.visibleOptionsQty,
|
|
5040
|
+
openTo = _ref12.openTo;
|
|
4724
5041
|
|
|
4725
5042
|
if (!options) {
|
|
4726
5043
|
return /*#__PURE__*/React.createElement(Options$1, null, /*#__PURE__*/React.createElement("li", {
|
|
@@ -4792,32 +5109,32 @@ var BoxOptions = function BoxOptions(_ref6) {
|
|
|
4792
5109
|
})) : /*#__PURE__*/React.createElement(OptionGroup$1, null, item.name));
|
|
4793
5110
|
}));
|
|
4794
5111
|
};
|
|
4795
|
-
var CustomDropdown = /*#__PURE__*/forwardRef(function (
|
|
4796
|
-
var name =
|
|
4797
|
-
label =
|
|
4798
|
-
help =
|
|
4799
|
-
error =
|
|
4800
|
-
valid =
|
|
4801
|
-
options =
|
|
4802
|
-
placeholder =
|
|
4803
|
-
defaultValue =
|
|
4804
|
-
multiple =
|
|
4805
|
-
type =
|
|
4806
|
-
tooltip =
|
|
4807
|
-
onChange =
|
|
4808
|
-
visibleOptionsQty =
|
|
4809
|
-
openTo =
|
|
4810
|
-
props = objectWithoutProperties(
|
|
4811
|
-
|
|
4812
|
-
var
|
|
4813
|
-
|
|
4814
|
-
open =
|
|
4815
|
-
setOpen =
|
|
4816
|
-
|
|
4817
|
-
var
|
|
4818
|
-
|
|
4819
|
-
selectedOpt =
|
|
4820
|
-
setSelected =
|
|
5112
|
+
var CustomDropdown = /*#__PURE__*/forwardRef(function (_ref13, ref) {
|
|
5113
|
+
var name = _ref13.name,
|
|
5114
|
+
label = _ref13.label,
|
|
5115
|
+
help = _ref13.help,
|
|
5116
|
+
error = _ref13.error,
|
|
5117
|
+
valid = _ref13.valid,
|
|
5118
|
+
options = _ref13.options,
|
|
5119
|
+
placeholder = _ref13.placeholder,
|
|
5120
|
+
defaultValue = _ref13.defaultValue,
|
|
5121
|
+
multiple = _ref13.multiple,
|
|
5122
|
+
type = _ref13.type,
|
|
5123
|
+
tooltip = _ref13.tooltip,
|
|
5124
|
+
onChange = _ref13.onChange,
|
|
5125
|
+
visibleOptionsQty = _ref13.visibleOptionsQty,
|
|
5126
|
+
openTo = _ref13.openTo,
|
|
5127
|
+
props = objectWithoutProperties(_ref13, ["name", "label", "help", "error", "valid", "options", "placeholder", "defaultValue", "multiple", "type", "tooltip", "onChange", "visibleOptionsQty", "openTo"]);
|
|
5128
|
+
|
|
5129
|
+
var _useState17 = useState(false),
|
|
5130
|
+
_useState18 = slicedToArray(_useState17, 2),
|
|
5131
|
+
open = _useState18[0],
|
|
5132
|
+
setOpen = _useState18[1];
|
|
5133
|
+
|
|
5134
|
+
var _useState19 = useState([]),
|
|
5135
|
+
_useState20 = slicedToArray(_useState19, 2),
|
|
5136
|
+
selectedOpt = _useState20[0],
|
|
5137
|
+
setSelected = _useState20[1];
|
|
4821
5138
|
|
|
4822
5139
|
var nodeSelect = useRef();
|
|
4823
5140
|
var valueRef = useRef();
|
|
@@ -4946,7 +5263,9 @@ var CustomDropdown = /*#__PURE__*/forwardRef(function (_ref7, ref) {
|
|
|
4946
5263
|
});
|
|
4947
5264
|
}
|
|
4948
5265
|
|
|
4949
|
-
return /*#__PURE__*/React.createElement(Frag$2,
|
|
5266
|
+
return /*#__PURE__*/React.createElement(Frag$2, {
|
|
5267
|
+
fullWidth: !props.size
|
|
5268
|
+
}, label && !useIcon && /*#__PURE__*/React.createElement(Label, {
|
|
4950
5269
|
htmlFor: name
|
|
4951
5270
|
}, label, " ", tooltip && /*#__PURE__*/React.createElement(App, {
|
|
4952
5271
|
text: tooltip
|
|
@@ -5041,16 +5360,16 @@ var HandleState = function HandleState(index, setSelected, selectedOpt, multiple
|
|
|
5041
5360
|
setSelected(ret);
|
|
5042
5361
|
};
|
|
5043
5362
|
|
|
5044
|
-
var SelectOption = function SelectOption(
|
|
5045
|
-
var options =
|
|
5046
|
-
setSelected =
|
|
5047
|
-
selectedOpt =
|
|
5048
|
-
multiple =
|
|
5049
|
-
type =
|
|
5050
|
-
onChange =
|
|
5051
|
-
noOptions =
|
|
5052
|
-
visibleOptionsQty =
|
|
5053
|
-
openTo =
|
|
5363
|
+
var SelectOption = function SelectOption(_ref14) {
|
|
5364
|
+
var options = _ref14.options,
|
|
5365
|
+
setSelected = _ref14.setSelected,
|
|
5366
|
+
selectedOpt = _ref14.selectedOpt,
|
|
5367
|
+
multiple = _ref14.multiple,
|
|
5368
|
+
type = _ref14.type,
|
|
5369
|
+
onChange = _ref14.onChange,
|
|
5370
|
+
noOptions = _ref14.noOptions,
|
|
5371
|
+
visibleOptionsQty = _ref14.visibleOptionsQty,
|
|
5372
|
+
openTo = _ref14.openTo;
|
|
5054
5373
|
|
|
5055
5374
|
if (!options) {
|
|
5056
5375
|
return /*#__PURE__*/React.createElement(OptionsPeople, null, /*#__PURE__*/React.createElement("li", null, noOptions || 'No data found'));
|
|
@@ -5085,9 +5404,9 @@ var SelectOption = function SelectOption(_ref8) {
|
|
|
5085
5404
|
}));
|
|
5086
5405
|
};
|
|
5087
5406
|
|
|
5088
|
-
var PhotoComponent = function PhotoComponent(
|
|
5089
|
-
var profile =
|
|
5090
|
-
index =
|
|
5407
|
+
var PhotoComponent = function PhotoComponent(_ref15) {
|
|
5408
|
+
var profile = _ref15.profile,
|
|
5409
|
+
index = _ref15.index;
|
|
5091
5410
|
var customStyle = {
|
|
5092
5411
|
position: 'relative',
|
|
5093
5412
|
display: 'inline-flex',
|
|
@@ -5111,11 +5430,11 @@ var PhotoComponent = function PhotoComponent(_ref9) {
|
|
|
5111
5430
|
}));
|
|
5112
5431
|
};
|
|
5113
5432
|
|
|
5114
|
-
var SelectValueRender = function SelectValueRender(
|
|
5115
|
-
var options =
|
|
5116
|
-
selectedOpt =
|
|
5117
|
-
type =
|
|
5118
|
-
noOptions =
|
|
5433
|
+
var SelectValueRender = function SelectValueRender(_ref16) {
|
|
5434
|
+
var options = _ref16.options,
|
|
5435
|
+
selectedOpt = _ref16.selectedOpt,
|
|
5436
|
+
type = _ref16.type,
|
|
5437
|
+
noOptions = _ref16.noOptions;
|
|
5119
5438
|
|
|
5120
5439
|
if (!options) {
|
|
5121
5440
|
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
@@ -5551,9 +5870,77 @@ var Password = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
5551
5870
|
})));
|
|
5552
5871
|
});
|
|
5553
5872
|
|
|
5554
|
-
function
|
|
5873
|
+
function _templateObject$9() {
|
|
5874
|
+
var data = taggedTemplateLiteral(["\n display: block;\n height: auto;\n min-height: 80px;\n resize: vertical;\n font-family: inherit;\n"]);
|
|
5555
5875
|
|
|
5556
|
-
|
|
5876
|
+
_templateObject$9 = function _templateObject() {
|
|
5877
|
+
return data;
|
|
5878
|
+
};
|
|
5879
|
+
|
|
5880
|
+
return data;
|
|
5881
|
+
}
|
|
5882
|
+
var TextAreaBase = styled(InputBase$1).attrs({
|
|
5883
|
+
as: 'textarea'
|
|
5884
|
+
})(_templateObject$9());
|
|
5885
|
+
var Textarea = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
5886
|
+
var name = _ref.name,
|
|
5887
|
+
label = _ref.label,
|
|
5888
|
+
help = _ref.help,
|
|
5889
|
+
invalid = _ref.invalid,
|
|
5890
|
+
valid = _ref.valid,
|
|
5891
|
+
error = _ref.error,
|
|
5892
|
+
_ref$rows = _ref.rows,
|
|
5893
|
+
rows = _ref$rows === void 0 ? 4 : _ref$rows,
|
|
5894
|
+
props = objectWithoutProperties(_ref, ["name", "label", "help", "invalid", "valid", "error", "rows"]);
|
|
5895
|
+
|
|
5896
|
+
var validationType = null;
|
|
5897
|
+
var useIcon = false;
|
|
5898
|
+
|
|
5899
|
+
if (invalid) {
|
|
5900
|
+
useIcon = /*#__PURE__*/React.createElement("span", {
|
|
5901
|
+
className: "requiredField"
|
|
5902
|
+
}, "*");
|
|
5903
|
+
validationType = 'error';
|
|
5904
|
+
}
|
|
5905
|
+
|
|
5906
|
+
if (props.Required) useIcon = /*#__PURE__*/React.createElement(RequiredText, null);
|
|
5907
|
+
|
|
5908
|
+
if (error) {
|
|
5909
|
+
validationType = 'error';
|
|
5910
|
+
}
|
|
5911
|
+
|
|
5912
|
+
if (valid) {
|
|
5913
|
+
useIcon = /*#__PURE__*/React.createElement("img", {
|
|
5914
|
+
src: Check
|
|
5915
|
+
});
|
|
5916
|
+
validationType = 'valid';
|
|
5917
|
+
}
|
|
5918
|
+
|
|
5919
|
+
return /*#__PURE__*/React.createElement(Frag$1, {
|
|
5920
|
+
size: props.size,
|
|
5921
|
+
className: "formAligner"
|
|
5922
|
+
}, label && !useIcon && /*#__PURE__*/React.createElement(Label, {
|
|
5923
|
+
htmlFor: name
|
|
5924
|
+
}, label), label && useIcon && /*#__PURE__*/React.createElement(Label, {
|
|
5925
|
+
htmlFor: name
|
|
5926
|
+
}, label, " ", useIcon), /*#__PURE__*/React.createElement(TextAreaBase, _extends_1({
|
|
5927
|
+
name: name,
|
|
5928
|
+
id: name,
|
|
5929
|
+
rows: rows
|
|
5930
|
+
}, props, {
|
|
5931
|
+
validation: validationType,
|
|
5932
|
+
ref: ref
|
|
5933
|
+
})), help && /*#__PURE__*/React.createElement(Span, null, help), error && /*#__PURE__*/React.createElement(SpanError$1, null, /*#__PURE__*/React.createElement("img", {
|
|
5934
|
+
src: Ex,
|
|
5935
|
+
style: {
|
|
5936
|
+
marginRight: '6px'
|
|
5937
|
+
}
|
|
5938
|
+
}), " ", error));
|
|
5939
|
+
});
|
|
5940
|
+
|
|
5941
|
+
function ownKeys$2(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
5942
|
+
|
|
5943
|
+
function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$2(Object(source), true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
5557
5944
|
|
|
5558
5945
|
function _templateObject7$3() {
|
|
5559
5946
|
var data = taggedTemplateLiteral(["\n position: absolute;\n height: 1px;\n width: 1px;\n z-index: -1;\n opacity: 0;\n"]);
|
|
@@ -5615,16 +6002,16 @@ function _templateObject2$5() {
|
|
|
5615
6002
|
return data;
|
|
5616
6003
|
}
|
|
5617
6004
|
|
|
5618
|
-
function _templateObject$
|
|
6005
|
+
function _templateObject$a() {
|
|
5619
6006
|
var data = taggedTemplateLiteral(["\n display:inline-block;\n vertical-align: top;\n"]);
|
|
5620
6007
|
|
|
5621
|
-
_templateObject$
|
|
6008
|
+
_templateObject$a = function _templateObject() {
|
|
5622
6009
|
return data;
|
|
5623
6010
|
};
|
|
5624
6011
|
|
|
5625
6012
|
return data;
|
|
5626
6013
|
}
|
|
5627
|
-
var Frag$3 = styled.div(_templateObject$
|
|
6014
|
+
var Frag$3 = styled.div(_templateObject$a());
|
|
5628
6015
|
var Span$3 = styled.span(_templateObject2$5(), theme.font.extraSmall.size);
|
|
5629
6016
|
var SpanError$4 = styled(Span$3)(_templateObject3$5(), theme.colors.error.text);
|
|
5630
6017
|
var Select = styled(InputBase)(_templateObject4$5(), theme.colors.neutrals.white, theme.colors.action, theme.colors.secondary, theme.colors.error.border);
|
|
@@ -5820,7 +6207,7 @@ var Tag = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
5820
6207
|
};
|
|
5821
6208
|
|
|
5822
6209
|
var addNewOption = function addNewOption(newObj) {
|
|
5823
|
-
newObj = _objectSpread$
|
|
6210
|
+
newObj = _objectSpread$2(_objectSpread$2({}, newObj), {}, {
|
|
5824
6211
|
value: newObj.name,
|
|
5825
6212
|
"new": true
|
|
5826
6213
|
});
|
|
@@ -6094,16 +6481,16 @@ function _templateObject2$6() {
|
|
|
6094
6481
|
return data;
|
|
6095
6482
|
}
|
|
6096
6483
|
|
|
6097
|
-
function _templateObject$
|
|
6484
|
+
function _templateObject$b() {
|
|
6098
6485
|
var data = taggedTemplateLiteral(["\n display:inline-block;\n vertical-align: top;\n"]);
|
|
6099
6486
|
|
|
6100
|
-
_templateObject$
|
|
6487
|
+
_templateObject$b = function _templateObject() {
|
|
6101
6488
|
return data;
|
|
6102
6489
|
};
|
|
6103
6490
|
|
|
6104
6491
|
return data;
|
|
6105
6492
|
}
|
|
6106
|
-
var Frag$4 = styled.div(_templateObject$
|
|
6493
|
+
var Frag$4 = styled.div(_templateObject$b());
|
|
6107
6494
|
var Field = styled.div(_templateObject2$6());
|
|
6108
6495
|
var WraperBucket = styled.div(_templateObject3$6(), function (props) {
|
|
6109
6496
|
return props.background ? props.background : theme.colors.info.shadow;
|
|
@@ -6987,10 +7374,10 @@ function _templateObject2$7() {
|
|
|
6987
7374
|
return data;
|
|
6988
7375
|
}
|
|
6989
7376
|
|
|
6990
|
-
function _templateObject$
|
|
6991
|
-
var data = taggedTemplateLiteral(["\n font-family
|
|
7377
|
+
function _templateObject$c() {
|
|
7378
|
+
var data = taggedTemplateLiteral(["\n font-family: ", ";\n font-weight:bold;\n border-radius:", ";\n cursor:pointer;\n display:inline-flex;\n background:", "\n color:", "\n height:40px;\n line-height:40px;\n padding:0 16px;\n font-size: ", ";\n align-items: center;\n gap: 4px;\n white-space: nowrap;\n justify-content: center;\n text-align: center;\n\n > * {\n border-color: ", ";\n }\n\n svg path {\n fill: currentColor;\n }\n\n &:hover,\n &.hover {\n background:", ";\n }\n\n &:focus,\n &.focus {\n background:", ";\n box-shadow:", ";\n }\n\n &:active,\n &.active {\n background:", ";\n box-shadow:", ";\n }\n\n &.selected {\n outline: 1px solid ", ";\n position: relative;\n z-index: 1;\n }\n\n &[disabled] {\n opacity: .5;\n cursor: not-allowed;\n }\n"]);
|
|
6992
7379
|
|
|
6993
|
-
_templateObject$
|
|
7380
|
+
_templateObject$c = function _templateObject() {
|
|
6994
7381
|
return data;
|
|
6995
7382
|
};
|
|
6996
7383
|
|
|
@@ -7001,7 +7388,7 @@ var defaultShadow = function defaultShadow(color) {
|
|
|
7001
7388
|
return "0px 0px 6px ".concat(color);
|
|
7002
7389
|
};
|
|
7003
7390
|
|
|
7004
|
-
var Base = styled.button(_templateObject$
|
|
7391
|
+
var Base = styled.button(_templateObject$c(), theme.font.main, theme.defaultRadius, theme.colors.info.bg, theme.colors.secondary, theme.font.medium.size, theme.colors.info.shadow, theme.colors.info.shadow, theme.colors.info.bg, defaultShadow(theme.form.button.secondary.bg), theme.colors.info.shadow, defaultShadow(theme.form.button.secondary.bg), theme.colors.secondary);
|
|
7005
7392
|
var Primary = "\n background:".concat(theme.form.button.primary.bg, ";\n color:").concat(theme.colors.neutrals.white, ";\n\n > * {\n border-color: ").concat(theme.colors.neutrals.white, ";\n }\n\n svg path {\n fill: ").concat(theme.colors.neutrals.white, ";\n }\n\n &:hover,\n &.hover {\n background:").concat(theme.form.button.primary.hover, "\n }\n\n &:focus,\n &.focus {\n background:").concat(theme.form.button.primary.bg, ";\n box-shadow:").concat(defaultShadow(theme.form.button.primary.bg), ";\n }\n\n &:active,\n &.active {\n background:").concat(theme.form.button.primary.hover, "\n box-shadow:").concat(defaultShadow(theme.form.button.primary.bg), ";\n }\n\n &.selected {\n border: 1px solid ").concat(theme.colors.neutrals.white, ";\n }\n");
|
|
7006
7393
|
var Secondary = "\n background:".concat(theme.form.button.secondary.bg, ";\n color:").concat(theme.colors.neutrals.white, ";\n\n > * {\n border-color: ").concat(theme.colors.neutrals.white, ";\n }\n\n svg path {\n fill: ").concat(theme.colors.neutrals.white, ";\n }\n\n &:hover {\n background:").concat(theme.form.button.secondary.hover, "\n }\n\n &:focus {\n background:").concat(theme.form.button.secondary.bg, ";\n box-shadow:").concat(defaultShadow(theme.form.button.secondary.bg), ";\n }\n\n &:active,\n &.active {\n background:").concat(theme.form.button.secondary.hover, "\n box-shadow:").concat(defaultShadow(theme.form.button.secondary.bg), ";\n }\n\n &.selected {\n border: 1px solid ").concat(theme.colors.neutrals.white, ";\n }\n");
|
|
7007
7394
|
var Cancel = "\n background:transparent;\n color:".concat(theme.form.button.secondary.bg, ";\n\n > * {\n border-color: ").concat(theme.colors.info.shadow, ";\n }\n\n svg path {\n fill: ").concat(theme.colors.secondary, ";\n }\n\n &:hover {\n background:transparent;\n text-decoration:underline;\n }\n\n &:focus {\n background:").concat(theme.colors.neutrals.white, ";\n box-shadow:").concat(defaultShadow(theme.form.button.secondary.bg), ";\n }\n\n &:active,\n &.active {\n background:").concat(theme.colors.neutrals.white, ";\n box-shadow:").concat(defaultShadow(theme.form.button.secondary.bg), ";\n text-decoration:underline;\n }\n\n &.selected {\n border: 1px solid ").concat(theme.form.button.secondary.bg, ";\n }\n");
|
|
@@ -7097,16 +7484,16 @@ function _templateObject2$8() {
|
|
|
7097
7484
|
return data;
|
|
7098
7485
|
}
|
|
7099
7486
|
|
|
7100
|
-
function _templateObject$
|
|
7487
|
+
function _templateObject$d() {
|
|
7101
7488
|
var data = taggedTemplateLiteral(["\n display:inline-block;\n vertical-align: top;\n"]);
|
|
7102
7489
|
|
|
7103
|
-
_templateObject$
|
|
7490
|
+
_templateObject$d = function _templateObject() {
|
|
7104
7491
|
return data;
|
|
7105
7492
|
};
|
|
7106
7493
|
|
|
7107
7494
|
return data;
|
|
7108
7495
|
}
|
|
7109
|
-
var Frag$5 = styled.div(_templateObject$
|
|
7496
|
+
var Frag$5 = styled.div(_templateObject$d());
|
|
7110
7497
|
var Wrapper$1 = styled.label(_templateObject2$8(), theme.colors.info.bg, theme.colors.secondary, theme.colors.action, theme.colors.secondary, theme.colors.success.border, theme.colors.success.border, theme.colors.error.border, theme.colors.error.border);
|
|
7111
7498
|
var Input$1 = styled(InputBase)(_templateObject3$7());
|
|
7112
7499
|
var Profile = styled.div(_templateObject4$7(), theme.colors.neutrals.silver);
|
|
@@ -7479,7 +7866,7 @@ var DropUploader = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
|
7479
7866
|
});
|
|
7480
7867
|
|
|
7481
7868
|
function _templateObject5$6() {
|
|
7482
|
-
var data = taggedTemplateLiteral(["\n display: inline-block;\n color: ", ";\n font-size: ", ";\n vertical-align: top;\n
|
|
7869
|
+
var data = taggedTemplateLiteral(["\n display: inline-block;\n color: ", ";\n font-size: ", ";\n line-height: ", ";\n font-weight: normal;\n font-family: \"Huninn\", sans-serif;\n vertical-align: top;\n padding-left: 8px;\n outline: none;\n cursor: pointer;\n"]);
|
|
7483
7870
|
|
|
7484
7871
|
_templateObject5$6 = function _templateObject5() {
|
|
7485
7872
|
return data;
|
|
@@ -7489,7 +7876,7 @@ function _templateObject5$6() {
|
|
|
7489
7876
|
}
|
|
7490
7877
|
|
|
7491
7878
|
function _templateObject4$8() {
|
|
7492
|
-
var data = taggedTemplateLiteral(["\n width: 0;\n height: 0;\n margin: 0;\n visibility: hidden;\n pointer-events: none;\n\n &:checked + ", " {\n background: ", ";\n border: 1px solid ", ";\n\n &::after {\n background:", ";\n margin-left:
|
|
7879
|
+
var data = taggedTemplateLiteral(["\n width: 0;\n height: 0;\n margin: 0;\n visibility: hidden;\n pointer-events: none;\n\n &:checked + ", " {\n background: ", ";\n border: 1px solid ", ";\n\n &::after {\n background:", ";\n margin-left: 19px;\n }\n }\n"]);
|
|
7493
7880
|
|
|
7494
7881
|
_templateObject4$8 = function _templateObject4() {
|
|
7495
7882
|
return data;
|
|
@@ -7499,7 +7886,7 @@ function _templateObject4$8() {
|
|
|
7499
7886
|
}
|
|
7500
7887
|
|
|
7501
7888
|
function _templateObject3$8() {
|
|
7502
|
-
var data = taggedTemplateLiteral(["\n width: 36px;\n height: 20px;\n border-radius: 100px;\n background: ", ";\n cursor: pointer;\n border: 1px solid ", ";\n box-sizing: border-box;\n\n &:focus {\n box-shadow: 0px 0px 6px ", ";\n border: 1px solid ", ";\n outline: none;\n }\n\n &::after {\n content: \"\";\n display: block;\n border-radius: 100%;\n width: 12px;\n height: 12px;\n margin: 3px;\n background:
|
|
7889
|
+
var data = taggedTemplateLiteral(["\n width: 36px;\n height: 20px;\n border-radius: 100px;\n background: ", ";\n cursor: pointer;\n border: 1px solid ", ";\n box-sizing: border-box;\n transition: 0.2s;\n\n &:focus {\n box-shadow: 0px 0px 6px ", ";\n border: 1px solid ", ";\n outline: none;\n }\n\n &::after {\n content: \"\";\n display: block;\n border-radius: 100%;\n width: 12px;\n height: 12px;\n margin: 3px;\n background: ", ";\n transition: 0.2s;\n }\n"]);
|
|
7503
7890
|
|
|
7504
7891
|
_templateObject3$8 = function _templateObject3() {
|
|
7505
7892
|
return data;
|
|
@@ -7518,20 +7905,20 @@ function _templateObject2$9() {
|
|
|
7518
7905
|
return data;
|
|
7519
7906
|
}
|
|
7520
7907
|
|
|
7521
|
-
function _templateObject$
|
|
7908
|
+
function _templateObject$e() {
|
|
7522
7909
|
var data = taggedTemplateLiteral(["\n display:inline-block;\n vertical-align: top;\n"]);
|
|
7523
7910
|
|
|
7524
|
-
_templateObject$
|
|
7911
|
+
_templateObject$e = function _templateObject() {
|
|
7525
7912
|
return data;
|
|
7526
7913
|
};
|
|
7527
7914
|
|
|
7528
7915
|
return data;
|
|
7529
7916
|
}
|
|
7530
|
-
var Frag$6 = styled.div(_templateObject$
|
|
7917
|
+
var Frag$6 = styled.div(_templateObject$e());
|
|
7531
7918
|
var CheckBoxWrapper = styled.div(_templateObject2$9());
|
|
7532
|
-
var CheckBoxLabel = styled.label(_templateObject3$8(), theme.colors.neutrals.white, theme.colors.
|
|
7533
|
-
var CheckBox$1 = styled.input(_templateObject4$8(), CheckBoxLabel, theme.colors.info.
|
|
7534
|
-
var ToggleLabel = styled.label(_templateObject5$6(), theme.colors.neutrals.medium, theme.font.
|
|
7919
|
+
var CheckBoxLabel = styled.label(_templateObject3$8(), theme.colors.neutrals.white, theme.colors.info.border, theme.colors.action, theme.colors.secondary, theme.colors.info.border);
|
|
7920
|
+
var CheckBox$1 = styled.input(_templateObject4$8(), CheckBoxLabel, theme.colors.info.text, theme.colors.info.border, theme.colors.neutrals.white);
|
|
7921
|
+
var ToggleLabel = styled.label(_templateObject5$6(), theme.colors.neutrals.medium, theme.font.medium.size, theme.font.medium.lineHeight);
|
|
7535
7922
|
var Toggle = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
7536
7923
|
var name = _ref.name,
|
|
7537
7924
|
label = _ref.label,
|
|
@@ -7589,17 +7976,17 @@ var Toggle = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
7589
7976
|
}), /*#__PURE__*/React.createElement(ToggleLabel, {
|
|
7590
7977
|
htmlFor: id,
|
|
7591
7978
|
tabIndex: -1
|
|
7592
|
-
}, singleText
|
|
7979
|
+
}, singleText || (value ? textOn : textOff))), help && /*#__PURE__*/React.createElement(SpanHelp, null, help));
|
|
7593
7980
|
});
|
|
7594
7981
|
|
|
7595
|
-
function ownKeys$
|
|
7982
|
+
function ownKeys$3(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
7596
7983
|
|
|
7597
|
-
function _objectSpread$
|
|
7984
|
+
function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$3(Object(source), true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$3(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
7598
7985
|
|
|
7599
|
-
function _templateObject$
|
|
7986
|
+
function _templateObject$f() {
|
|
7600
7987
|
var data = taggedTemplateLiteral(["\n position: relative;\n\n ", " {\n left: 0;\n top: -21px;\n height: 192px;\n overflow: auto;\n\n li {\n padding-right: 8px;\n }\n }\n\n ", " {\n font-size: ", ";\n line-height: ", ";\n position: sticky;\n top: 0;\n z-index: 1;\n background: ", ";\n\n &:hover {\n background: ", ";\n }\n }\n"]);
|
|
7601
7988
|
|
|
7602
|
-
_templateObject$
|
|
7989
|
+
_templateObject$f = function _templateObject() {
|
|
7603
7990
|
return data;
|
|
7604
7991
|
};
|
|
7605
7992
|
|
|
@@ -7750,7 +8137,7 @@ var fromMilliseconds = function fromMilliseconds(milliseconds) {
|
|
|
7750
8137
|
};
|
|
7751
8138
|
};
|
|
7752
8139
|
|
|
7753
|
-
var TimePickerOptionsStyle = styled.div(_templateObject$
|
|
8140
|
+
var TimePickerOptionsStyle = styled.div(_templateObject$f(), Options, OptionGroup, theme.font.extraSmall.size, theme.font.extraSmall.lineHeight, theme.colors.neutrals.white, theme.colors.neutrals.white);
|
|
7754
8141
|
|
|
7755
8142
|
var TimePickerOptions = function TimePickerOptions(_ref5) {
|
|
7756
8143
|
var time = _ref5.time,
|
|
@@ -7789,7 +8176,7 @@ var TimePickerOptions = function TimePickerOptions(_ref5) {
|
|
|
7789
8176
|
}
|
|
7790
8177
|
|
|
7791
8178
|
var handleSelect = function handleSelect(what, value) {
|
|
7792
|
-
var newTime = _objectSpread$
|
|
8179
|
+
var newTime = _objectSpread$3({}, time);
|
|
7793
8180
|
|
|
7794
8181
|
newTime[what] = value;
|
|
7795
8182
|
setTime(newTime);
|
|
@@ -8002,10 +8389,10 @@ function _templateObject2$a() {
|
|
|
8002
8389
|
return data;
|
|
8003
8390
|
}
|
|
8004
8391
|
|
|
8005
|
-
function _templateObject$
|
|
8392
|
+
function _templateObject$g() {
|
|
8006
8393
|
var data = taggedTemplateLiteral(["\n display: inline-flex;\n align-items: stretch;\n padding: 0;\n\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\n ", "\n"]);
|
|
8007
8394
|
|
|
8008
|
-
_templateObject$
|
|
8395
|
+
_templateObject$g = function _templateObject() {
|
|
8009
8396
|
return data;
|
|
8010
8397
|
};
|
|
8011
8398
|
|
|
@@ -8015,7 +8402,7 @@ var Container = styled(Base).attrs(function (props) {
|
|
|
8015
8402
|
return {
|
|
8016
8403
|
as: 'div'
|
|
8017
8404
|
};
|
|
8018
|
-
})(_templateObject$
|
|
8405
|
+
})(_templateObject$g(), function (props) {
|
|
8019
8406
|
return props.type === 'primary' && Primary;
|
|
8020
8407
|
}, function (props) {
|
|
8021
8408
|
return props.type === 'secondary' && Secondary;
|
|
@@ -8110,20 +8497,20 @@ var Dropdown$1 = function Dropdown$$1(_ref) {
|
|
|
8110
8497
|
})));
|
|
8111
8498
|
};
|
|
8112
8499
|
|
|
8113
|
-
function ownKeys$
|
|
8500
|
+
function ownKeys$4(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
8114
8501
|
|
|
8115
|
-
function _objectSpread$
|
|
8502
|
+
function _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$4(Object(source), true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$4(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
8116
8503
|
|
|
8117
|
-
function _templateObject$
|
|
8118
|
-
var data = taggedTemplateLiteral(["\n display: inline-flex;\n flex-wrap: nowrap;\n\n >
|
|
8504
|
+
function _templateObject$h() {
|
|
8505
|
+
var data = taggedTemplateLiteral(["\n display: inline-flex;\n flex-wrap: nowrap;\n border: 1px solid ", ";\n border-radius: ", ";\n\n > *:not(.selected) {\n border-radius: 0;\n\n &:first-child {\n border-top-left-radius: ", ";\n border-bottom-left-radius: ", ";\n }\n\n &:last-child {\n border-top-right-radius: ", ";\n border-bottom-right-radius: ", ";\n }\n }\n"]);
|
|
8119
8506
|
|
|
8120
|
-
_templateObject$
|
|
8507
|
+
_templateObject$h = function _templateObject() {
|
|
8121
8508
|
return data;
|
|
8122
8509
|
};
|
|
8123
8510
|
|
|
8124
8511
|
return data;
|
|
8125
8512
|
}
|
|
8126
|
-
var BtnGroup = styled.div(_templateObject$
|
|
8513
|
+
var BtnGroup = styled.div(_templateObject$h(), theme.colors.neutrals.silver, theme.defaultRadius, theme.defaultRadius, theme.defaultRadius, theme.defaultRadius, theme.defaultRadius);
|
|
8127
8514
|
|
|
8128
8515
|
var ButtonGroup = function ButtonGroup(_ref) {
|
|
8129
8516
|
var children = _ref.children,
|
|
@@ -8132,12 +8519,16 @@ var ButtonGroup = function ButtonGroup(_ref) {
|
|
|
8132
8519
|
var generateClassName = function generateClassName(btnProps) {
|
|
8133
8520
|
var cn = btnProps.className || '';
|
|
8134
8521
|
var track = btnProps.track;
|
|
8135
|
-
|
|
8522
|
+
|
|
8523
|
+
if (props.active === track) {
|
|
8524
|
+
cn += ' selected ';
|
|
8525
|
+
}
|
|
8526
|
+
|
|
8136
8527
|
return cn;
|
|
8137
8528
|
};
|
|
8138
8529
|
|
|
8139
8530
|
return /*#__PURE__*/React.createElement(BtnGroup, null, children.map(function (btn, k) {
|
|
8140
|
-
return btn.type(_objectSpread$
|
|
8531
|
+
return btn.type(_objectSpread$4(_objectSpread$4(_objectSpread$4({}, props), btn.props), {}, {
|
|
8141
8532
|
key: k,
|
|
8142
8533
|
className: generateClassName(btn.props)
|
|
8143
8534
|
}));
|
|
@@ -8174,16 +8565,16 @@ function _templateObject2$b() {
|
|
|
8174
8565
|
return data;
|
|
8175
8566
|
}
|
|
8176
8567
|
|
|
8177
|
-
function _templateObject$
|
|
8568
|
+
function _templateObject$i() {
|
|
8178
8569
|
var data = taggedTemplateLiteral(["\n 0% {\n opacity:0;\n visibility: hidden;\n transform: scale(0.6) translateY(-8px);\n }\n\n 100% {\n visibility: visible;\n opacity:1;\n }\n"]);
|
|
8179
8570
|
|
|
8180
|
-
_templateObject$
|
|
8571
|
+
_templateObject$i = function _templateObject() {
|
|
8181
8572
|
return data;
|
|
8182
8573
|
};
|
|
8183
8574
|
|
|
8184
8575
|
return data;
|
|
8185
8576
|
}
|
|
8186
|
-
var listAnimation = keyframes(_templateObject$
|
|
8577
|
+
var listAnimation = keyframes(_templateObject$i());
|
|
8187
8578
|
var POSITION_LIST = '100%';
|
|
8188
8579
|
var POSITION_LIST_DISTANCE = '10%';
|
|
8189
8580
|
|
|
@@ -8440,16 +8831,16 @@ function _templateObject2$c() {
|
|
|
8440
8831
|
return data;
|
|
8441
8832
|
}
|
|
8442
8833
|
|
|
8443
|
-
function _templateObject$
|
|
8834
|
+
function _templateObject$j() {
|
|
8444
8835
|
var data = taggedTemplateLiteral(["\n padding: 7px;\n border-radius: ", ";\n border-width:1px;\n border-style:solid;\n display:flex;\n align-items:center;\n position:relative;\n\n ", "\n\n svg {\n margin-right: 8px;\n display: block;\n }\n"]);
|
|
8445
8836
|
|
|
8446
|
-
_templateObject$
|
|
8837
|
+
_templateObject$j = function _templateObject() {
|
|
8447
8838
|
return data;
|
|
8448
8839
|
};
|
|
8449
8840
|
|
|
8450
8841
|
return data;
|
|
8451
8842
|
}
|
|
8452
|
-
var Div = styled.div(_templateObject$
|
|
8843
|
+
var Div = styled.div(_templateObject$j(), theme.defaultRadius, function (props) {
|
|
8453
8844
|
return props.useClose && "\n padding-right: 32px;\n ";
|
|
8454
8845
|
});
|
|
8455
8846
|
var Title$2 = styled.h5(_templateObject2$c(), theme.font.main, theme.font.medium.size, theme.font.big.lineHeight);
|
|
@@ -8463,7 +8854,11 @@ var Close = styled.button.attrs(function (props) {
|
|
|
8463
8854
|
|
|
8464
8855
|
var solveContent = function solveContent(size, title, content) {
|
|
8465
8856
|
var isSmall = size === 'small';
|
|
8466
|
-
|
|
8857
|
+
|
|
8858
|
+
if (isSmall) {
|
|
8859
|
+
return /*#__PURE__*/React.createElement(Title$2, null, /*#__PURE__*/React.createElement(SmallContent, null, title));
|
|
8860
|
+
}
|
|
8861
|
+
|
|
8467
8862
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Title$2, null, title), /*#__PURE__*/React.createElement(Content, null, content));
|
|
8468
8863
|
};
|
|
8469
8864
|
|
|
@@ -8540,5 +8935,5 @@ var index = {
|
|
|
8540
8935
|
Error: AlertError
|
|
8541
8936
|
};
|
|
8542
8937
|
|
|
8543
|
-
export { theme as Theme, ButtonIcon, Exported as Button, Dropdown$1 as ButtonDropdown, ButtonGroup, Form, Input, Password, CheckBox, RadioBox, Dropdown, CustomDropdown, Tag as TagInput, InputColor, Uploader, Toggle, TimePicker, DropUploader, Title, SubTitle, ThirdTitle, Text, index as Alert, Spacer, Icons as Icon, logo as Logo, dspwLoading as Loading };
|
|
8938
|
+
export { theme as Theme, ButtonIcon, Exported as Button, Dropdown$1 as ButtonDropdown, ButtonGroup, Form, Input, Textarea, Password, CheckBox, RadioBox, Dropdown, CustomDropdown, Tag as TagInput, InputColor, Uploader, Toggle, TimePicker, DropUploader, Title, SubTitle, ThirdTitle, Text, index as Alert, Spacer, Icons as Icon, logo as Logo, dspwLoading as Loading };
|
|
8544
8939
|
//# sourceMappingURL=index.es.js.map
|