@thecb/components 10.12.0-beta.0 → 10.12.1-beta.0
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.cjs.js +573 -396
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +9 -6
- package/dist/index.esm.js +573 -396
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/card/Card.js +0 -9
- package/src/components/atoms/card/CardText.js +11 -34
- package/src/components/atoms/card/index.d.ts +0 -6
- package/src/components/atoms/form-layouts/FormInput.js +6 -4
- package/src/components/atoms/form-layouts/FormInput.stories.js +33 -0
- package/src/components/atoms/form-layouts/index.d.ts +5 -0
- package/src/components/atoms/form-select/FormSelect.js +5 -3
- package/src/components/atoms/form-select/index.d.ts +3 -0
- package/src/components/molecules/editable-list/EditableList.js +3 -1
- package/src/components/molecules/multiple-select-filter/MultipleSelectFilter.js +53 -279
- package/src/components/molecules/multiple-select-filter/MultipleSelectFilter.stories.js +1 -1
- package/src/components/molecules/multiple-select-filter/MultipleSelectFilter.styled.js +4 -4
- package/src/components/molecules/multiple-select-filter/__private__/ActionLinkButton.js +24 -0
- package/src/components/molecules/multiple-select-filter/__private__/FilterButton.js +85 -0
- package/src/components/molecules/multiple-select-filter/__private__/FilterDropdown.js +23 -0
- package/src/components/molecules/multiple-select-filter/__private__/FilterableList.js +144 -0
- package/src/components/molecules/multiple-select-filter/__private__/FilterableListItem.js +67 -0
- package/src/components/molecules/multiple-select-filter/__private__/SearchBox.js +38 -0
- package/src/components/molecules/multiple-select-filter/__private__/useKeyboardNavigation.js +84 -0
- package/src/components/molecules/multiple-select-filter/__private__/util.js +31 -0
- package/src/components/molecules/radio-group/RadioGroup.js +8 -3
- package/src/components/molecules/radio-group/index.d.ts +1 -0
- package/src/components/atoms/.DS_Store +0 -0
package/dist/index.cjs.js
CHANGED
|
@@ -6249,7 +6249,7 @@ return numeral;
|
|
|
6249
6249
|
}));
|
|
6250
6250
|
});
|
|
6251
6251
|
|
|
6252
|
-
var noop = function noop() {};
|
|
6252
|
+
var noop$1 = function noop() {};
|
|
6253
6253
|
var formatMoneyString = function formatMoneyString(s) {
|
|
6254
6254
|
return numeral(s).format("$0,0.00");
|
|
6255
6255
|
};
|
|
@@ -6383,7 +6383,7 @@ var wrapIndex = function wrapIndex(index, length) {
|
|
|
6383
6383
|
|
|
6384
6384
|
var general = /*#__PURE__*/Object.freeze({
|
|
6385
6385
|
__proto__: null,
|
|
6386
|
-
noop: noop,
|
|
6386
|
+
noop: noop$1,
|
|
6387
6387
|
displayCurrency: displayCurrency,
|
|
6388
6388
|
convertCentsToMoneyInt: convertCentsToMoneyInt,
|
|
6389
6389
|
formatPercent: formatPercent,
|
|
@@ -10575,7 +10575,7 @@ var isRefObject = function (ref) {
|
|
|
10575
10575
|
return typeof ref === "object" && ref.hasOwnProperty("current");
|
|
10576
10576
|
};
|
|
10577
10577
|
|
|
10578
|
-
var noop$
|
|
10578
|
+
var noop$2 = function (v) { return v; };
|
|
10579
10579
|
var ComponentDragControls = /** @class */ (function () {
|
|
10580
10580
|
function ComponentDragControls(_a) {
|
|
10581
10581
|
var ref = _a.ref, values = _a.values, controls = _a.controls;
|
|
@@ -10603,7 +10603,7 @@ var ComponentDragControls = /** @class */ (function () {
|
|
|
10603
10603
|
* @internal
|
|
10604
10604
|
*/
|
|
10605
10605
|
this.props = {
|
|
10606
|
-
transformPagePoint: noop$
|
|
10606
|
+
transformPagePoint: noop$2,
|
|
10607
10607
|
};
|
|
10608
10608
|
/**
|
|
10609
10609
|
* References to the MotionValues used for tracking the current dragged point.
|
|
@@ -13033,7 +13033,7 @@ var Spinner = function Spinner(_ref) {
|
|
|
13033
13033
|
|
|
13034
13034
|
var ButtonWithAction = /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
|
|
13035
13035
|
var _ref2$action = _ref2.action,
|
|
13036
|
-
action = _ref2$action === void 0 ? noop : _ref2$action,
|
|
13036
|
+
action = _ref2$action === void 0 ? noop$1 : _ref2$action,
|
|
13037
13037
|
_ref2$variant = _ref2.variant,
|
|
13038
13038
|
variant = _ref2$variant === void 0 ? "primary" : _ref2$variant,
|
|
13039
13039
|
text = _ref2.text,
|
|
@@ -13075,7 +13075,7 @@ var ButtonWithAction = /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
|
|
|
13075
13075
|
disabledStyles: disabledStyles,
|
|
13076
13076
|
"aria-disabled": disabled,
|
|
13077
13077
|
as: "button",
|
|
13078
|
-
onClick: isLoading || disabled ? noop : action,
|
|
13078
|
+
onClick: isLoading || disabled ? noop$1 : action,
|
|
13079
13079
|
borderRadius: "2px",
|
|
13080
13080
|
theme: themeContext,
|
|
13081
13081
|
extraStyles: "margin: 0.5rem; ".concat(extraStyles),
|
|
@@ -23248,7 +23248,7 @@ var Checkbox = /*#__PURE__*/React.forwardRef(function (_ref5, ref) {
|
|
|
23248
23248
|
name = _ref5.name,
|
|
23249
23249
|
checked = _ref5.checked,
|
|
23250
23250
|
_ref5$onChange = _ref5.onChange,
|
|
23251
|
-
onChange = _ref5$onChange === void 0 ? noop : _ref5$onChange,
|
|
23251
|
+
onChange = _ref5$onChange === void 0 ? noop$1 : _ref5$onChange,
|
|
23252
23252
|
_ref5$disabled = _ref5.disabled,
|
|
23253
23253
|
disabled = _ref5$disabled === void 0 ? false : _ref5$disabled,
|
|
23254
23254
|
themeValues = _ref5.themeValues,
|
|
@@ -23447,7 +23447,7 @@ var CheckboxListItem = function CheckboxListItem(_ref) {
|
|
|
23447
23447
|
padding: "0.875rem",
|
|
23448
23448
|
borderRadius: "4px",
|
|
23449
23449
|
minWidth: "30%",
|
|
23450
|
-
onClick: disabled ? noop : onSelect,
|
|
23450
|
+
onClick: disabled ? noop$1 : onSelect,
|
|
23451
23451
|
borderColor: borderColor,
|
|
23452
23452
|
borderSize: "1px",
|
|
23453
23453
|
color: color,
|
|
@@ -23462,8 +23462,8 @@ var CheckboxListItem = function CheckboxListItem(_ref) {
|
|
|
23462
23462
|
name: name,
|
|
23463
23463
|
"aria-label": name,
|
|
23464
23464
|
htmlFor: "checkbox-".concat(name, "-").concat(index),
|
|
23465
|
-
onClick: disabled ? noop : onSelect,
|
|
23466
|
-
onKeyDown: disabled ? noop : onSelect,
|
|
23465
|
+
onClick: disabled ? noop$1 : onSelect,
|
|
23466
|
+
onKeyDown: disabled ? noop$1 : onSelect,
|
|
23467
23467
|
tabIndex: 0
|
|
23468
23468
|
}, /*#__PURE__*/React__default.createElement(styled.ThemeProvider, {
|
|
23469
23469
|
theme: {
|
|
@@ -23691,7 +23691,7 @@ var SortableTableHeading = function SortableTableHeading(_ref) {
|
|
|
23691
23691
|
disabled: disabled,
|
|
23692
23692
|
extraStyles: "cursor: pointer; ".concat(extraStyles),
|
|
23693
23693
|
onClick: function onClick(event) {
|
|
23694
|
-
return disabled ? noop : onSortChange(event);
|
|
23694
|
+
return disabled ? noop$1 : onSortChange(event);
|
|
23695
23695
|
},
|
|
23696
23696
|
"aria-controls": ariaControlsId
|
|
23697
23697
|
}, /*#__PURE__*/React__default.createElement(Cluster, {
|
|
@@ -25121,7 +25121,7 @@ var Dropdown = function Dropdown(_ref13) {
|
|
|
25121
25121
|
_ref13$disabledValues = _ref13.disabledValues,
|
|
25122
25122
|
disabledValues = _ref13$disabledValues === void 0 ? [] : _ref13$disabledValues,
|
|
25123
25123
|
_ref13$onClick = _ref13.onClick,
|
|
25124
|
-
_onClick = _ref13$onClick === void 0 ? noop : _ref13$onClick,
|
|
25124
|
+
_onClick = _ref13$onClick === void 0 ? noop$1 : _ref13$onClick,
|
|
25125
25125
|
themeValues = _ref13.themeValues,
|
|
25126
25126
|
maxHeight = _ref13.maxHeight,
|
|
25127
25127
|
_ref13$widthFitOption = _ref13.widthFitOptions,
|
|
@@ -25550,7 +25550,11 @@ var FormSelect = function FormSelect(_ref) {
|
|
|
25550
25550
|
_ref$widthFitOptions = _ref.widthFitOptions,
|
|
25551
25551
|
widthFitOptions = _ref$widthFitOptions === void 0 ? false : _ref$widthFitOptions,
|
|
25552
25552
|
_ref$isRequired = _ref.isRequired,
|
|
25553
|
-
isRequired = _ref$isRequired === void 0 ? false : _ref$isRequired
|
|
25553
|
+
isRequired = _ref$isRequired === void 0 ? false : _ref$isRequired,
|
|
25554
|
+
_ref$labelTextVariant = _ref.labelTextVariant,
|
|
25555
|
+
labelTextVariant = _ref$labelTextVariant === void 0 ? "pS" : _ref$labelTextVariant,
|
|
25556
|
+
_ref$errorLabelTextVa = _ref.errorLabelTextVariant,
|
|
25557
|
+
errorLabelTextVariant = _ref$errorLabelTextVa === void 0 ? "pXS" : _ref$errorLabelTextVa;
|
|
25554
25558
|
var _useState = React.useState(false),
|
|
25555
25559
|
_useState2 = _slicedToArray(_useState, 2),
|
|
25556
25560
|
open = _useState2[0],
|
|
@@ -25580,7 +25584,7 @@ var FormSelect = function FormSelect(_ref) {
|
|
|
25580
25584
|
align: "center"
|
|
25581
25585
|
}, /*#__PURE__*/React__default.createElement(Text$1, {
|
|
25582
25586
|
as: "label",
|
|
25583
|
-
variant:
|
|
25587
|
+
variant: labelTextVariant,
|
|
25584
25588
|
color: themeValues.labelColor,
|
|
25585
25589
|
weight: themeValues.fontWeight,
|
|
25586
25590
|
extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }",
|
|
@@ -25615,7 +25619,7 @@ var FormSelect = function FormSelect(_ref) {
|
|
|
25615
25619
|
justify: "space-between"
|
|
25616
25620
|
}, field.hasErrors && field.dirty || field.hasErrors && showErrors ? /*#__PURE__*/React__default.createElement(Text$1, {
|
|
25617
25621
|
color: ERROR_COLOR,
|
|
25618
|
-
variant:
|
|
25622
|
+
variant: errorLabelTextVariant,
|
|
25619
25623
|
weight: themeValues.fontWeight,
|
|
25620
25624
|
extraStyles: "\n word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }\n ",
|
|
25621
25625
|
id: createIdFromString(labelTextWhenNoError, "error message"),
|
|
@@ -26762,7 +26766,7 @@ var Popover = function Popover(_ref) {
|
|
|
26762
26766
|
extraStyles: "position: relative; ".concat(extraStyles)
|
|
26763
26767
|
}, /*#__PURE__*/React__default.createElement(ButtonWithAction, {
|
|
26764
26768
|
action: function action() {
|
|
26765
|
-
return noop;
|
|
26769
|
+
return noop$1;
|
|
26766
26770
|
},
|
|
26767
26771
|
onFocus: function onFocus() {
|
|
26768
26772
|
handleTogglePopover(true);
|
|
@@ -27092,83 +27096,79 @@ var createFormat = function createFormat(formats, formatChar) {
|
|
|
27092
27096
|
var FormattedInput = function FormattedInput(_ref) {
|
|
27093
27097
|
var value = _ref.value,
|
|
27094
27098
|
formatter = _ref.formatter,
|
|
27095
|
-
|
|
27099
|
+
_onChange = _ref.onChange,
|
|
27096
27100
|
props = _objectWithoutProperties$1(_ref, ["value", "formatter", "onChange"]);
|
|
27097
27101
|
|
|
27098
|
-
var _useState = React.useState(format$1(formatter)(value)),
|
|
27099
|
-
_useState2 = _slicedToArray$1(_useState, 2),
|
|
27100
|
-
formattedValue = _useState2[0],
|
|
27101
|
-
setFormattedValue = _useState2[1];
|
|
27102
|
-
|
|
27103
27102
|
var inputEl = React.useRef(null);
|
|
27104
|
-
|
|
27103
|
+
|
|
27104
|
+
var _useState = React.useState({
|
|
27105
27105
|
selectionStart: 0,
|
|
27106
27106
|
selectionEnd: 0,
|
|
27107
|
-
|
|
27108
|
-
|
|
27109
|
-
|
|
27107
|
+
rawValue: value,
|
|
27108
|
+
"delete": false,
|
|
27109
|
+
formattedValue: format$1(formatter)(value)
|
|
27110
|
+
}),
|
|
27111
|
+
_useState2 = _slicedToArray$1(_useState, 2),
|
|
27112
|
+
state = _useState2[0],
|
|
27113
|
+
setState = _useState2[1];
|
|
27114
|
+
|
|
27110
27115
|
React.useLayoutEffect(function () {
|
|
27111
27116
|
// A lot of the work here is cursor manipulation
|
|
27112
27117
|
if (inputEl.current && inputEl.current === document.activeElement) {
|
|
27113
|
-
inputEl.current.setSelectionRange(
|
|
27114
|
-
}
|
|
27115
|
-
}, [stateRefs]);
|
|
27116
|
-
|
|
27117
|
-
var handleChange = function handleChange(event) {
|
|
27118
|
-
var deleteKeyPressed = stateRefs.current.isDelete;
|
|
27119
|
-
var maxFormatExceeded = stateRefs.current.rawValue.length >= formatter.formats.length - 1;
|
|
27120
|
-
|
|
27121
|
-
if (maxFormatExceeded && !deleteKeyPressed) {
|
|
27122
|
-
return;
|
|
27118
|
+
inputEl.current.setSelectionRange(state.selectionStart, state.selectionEnd);
|
|
27123
27119
|
}
|
|
27124
|
-
|
|
27125
|
-
* and an unformatted injection at the start, end, or in the middle (maybe a deletion). To prepare
|
|
27126
|
-
* the unformatted value for the user's onChange, the formatted string and unformatted injection need
|
|
27127
|
-
* to be separated, then unformat the formatted string, then insert (or delete) the injection from the
|
|
27128
|
-
* old unformatted value.
|
|
27129
|
-
*/
|
|
27130
|
-
|
|
27131
|
-
|
|
27132
|
-
var injectionLength = event.target.value.length - formattedValue.length;
|
|
27133
|
-
var end = stateRefs.current.selectionStart === stateRefs.current.selectionEnd ? stateRefs.current.selectionStart + injectionLength : stateRefs.current.selectionEnd - 1;
|
|
27134
|
-
var injection = event.target.value.substring(stateRefs.current.selectionStart, end); // Injection is the new unformatted piece of the input
|
|
27135
|
-
// Need to find where to put it
|
|
27136
|
-
|
|
27137
|
-
var rawInjectionPointStart = formattedToUnformattedIndex(stateRefs.current.selectionStart, stateRefs.current.rawValue, formatter);
|
|
27138
|
-
var rawInjectionPointEnd = formattedToUnformattedIndex(stateRefs.current.selectionEnd, stateRefs.current.rawValue, formatter); // Unformat the previous formatted value for injection
|
|
27139
|
-
// Using the relevant format string, strips away chars not marked with the formatChar
|
|
27140
|
-
|
|
27141
|
-
var unformattedOldValue = unformat(formatter)(formattedValue, stateRefs.current.rawValue.length); // Edit the previous unformatted value (either add, update or delete)
|
|
27142
|
-
|
|
27143
|
-
var injectIntoOldValue = inject(unformattedOldValue);
|
|
27144
|
-
var unformattedNewValue = deleteKeyPressed ? rawInjectionPointStart === rawInjectionPointEnd ? injectIntoOldValue(rawInjectionPointStart - 1, rawInjectionPointStart, "") : injectIntoOldValue(rawInjectionPointStart, rawInjectionPointEnd, "") : injectIntoOldValue(rawInjectionPointStart, rawInjectionPointEnd, injection);
|
|
27145
|
-
var lengthDifference = unformattedNewValue.length - stateRefs.current.rawValue.length;
|
|
27146
|
-
var rawIndex = formattedToUnformattedIndex(stateRefs.current.selectionStart, stateRefs.current.rawValue, formatter) + lengthDifference; // Find the new cursor position for the potential formatted value
|
|
27147
|
-
// Applied by useLayoutEffect
|
|
27148
|
-
|
|
27149
|
-
var newFormattedCursorPosition = stateRefs.current.selectionStart === stateRefs.current.selectionEnd ? unformattedToFormattedIndex(rawIndex, unformattedNewValue, formatter, deleteKeyPressed) : deleteKeyPressed ? stateRefs.current.selectionStart : stateRefs.current.selectionEnd;
|
|
27150
|
-
var formattedNewValue = format$1(formatter)(unformattedNewValue);
|
|
27151
|
-
setFormattedValue(formattedNewValue); // Apply the external onChange function to the raw underlying string
|
|
27152
|
-
// This is where the user generally updates the input value
|
|
27153
|
-
|
|
27154
|
-
if (onChange) {
|
|
27155
|
-
onChange(unformattedNewValue);
|
|
27156
|
-
}
|
|
27157
|
-
};
|
|
27158
|
-
|
|
27120
|
+
});
|
|
27159
27121
|
return React__default.createElement("input", _extends$2({}, props, {
|
|
27160
27122
|
ref: inputEl,
|
|
27161
27123
|
value: format$1(formatter)(value),
|
|
27162
27124
|
onKeyDown: function onKeyDown(event) {
|
|
27163
|
-
// Keep track of the state of the input before onChange
|
|
27164
|
-
|
|
27165
|
-
|
|
27125
|
+
// Keep track of the state of the input before onChange, including if user is hitting delete
|
|
27126
|
+
setState({
|
|
27127
|
+
rawValue: value,
|
|
27166
27128
|
selectionStart: event.target.selectionStart,
|
|
27167
27129
|
selectionEnd: event.target.selectionEnd,
|
|
27168
|
-
|
|
27169
|
-
|
|
27130
|
+
"delete": event.key === "Backspace" || event.key === "Delete",
|
|
27131
|
+
formattedValue: event.target.value
|
|
27132
|
+
});
|
|
27170
27133
|
},
|
|
27171
|
-
onChange:
|
|
27134
|
+
onChange: function onChange(event) {
|
|
27135
|
+
/* At the beginning of onChange, event.target.value is a concat of the previous formatted value
|
|
27136
|
+
* and an unformatted injection at the start, end, or in the middle (maybe a deletion). To prepare
|
|
27137
|
+
* the unformatted value for the user's onChange, the formatted string and unformatted injection need
|
|
27138
|
+
* to be separated, then unformat the formatted string, then insert (or delete) the injection from the
|
|
27139
|
+
* old unformatted value.
|
|
27140
|
+
*/
|
|
27141
|
+
var injectionLength = event.target.value.length - state.formattedValue.length;
|
|
27142
|
+
var end = state.selectionStart === state.selectionEnd ? state.selectionStart + injectionLength : state.selectionEnd - 1;
|
|
27143
|
+
var injection = event.target.value.substring(state.selectionStart, end); // Injection is the new unformatted piece of the input
|
|
27144
|
+
// Need to find where to put it
|
|
27145
|
+
|
|
27146
|
+
var rawInjectionPointStart = formattedToUnformattedIndex(state.selectionStart, state.rawValue, formatter);
|
|
27147
|
+
var rawInjectionPointEnd = formattedToUnformattedIndex(state.selectionEnd, state.rawValue, formatter); // Unformat the previous formatted value for injection
|
|
27148
|
+
// Using the relevant format string, strips away chars not marked with the formatChar
|
|
27149
|
+
|
|
27150
|
+
var unformattedOldValue = unformat(formatter)(state.formattedValue, state.rawValue.length); // Edit the previous unformatted value (either add, update or delete)
|
|
27151
|
+
|
|
27152
|
+
var injectIntoOldValue = inject(unformattedOldValue);
|
|
27153
|
+
var unformattedNewValue = state["delete"] ? rawInjectionPointStart === rawInjectionPointEnd ? injectIntoOldValue(rawInjectionPointStart - 1, rawInjectionPointStart, "") : injectIntoOldValue(rawInjectionPointStart, rawInjectionPointEnd, "") : injectIntoOldValue(rawInjectionPointStart, rawInjectionPointEnd, injection);
|
|
27154
|
+
var lengthDifference = unformattedNewValue.length - state.rawValue.length;
|
|
27155
|
+
var rawIndex = formattedToUnformattedIndex(state.selectionStart, state.rawValue, formatter) + lengthDifference; // Find the new cursor position for the potential formatted value
|
|
27156
|
+
// Applied by useLayoutEffect
|
|
27157
|
+
|
|
27158
|
+
var newFormattedCursorPosition = state.selectionStart == state.selectionEnd ? unformattedToFormattedIndex(rawIndex, unformattedNewValue, formatter, state["delete"]) : state["delete"] ? state.selectionStart : state.selectionEnd;
|
|
27159
|
+
setState({
|
|
27160
|
+
selectionStart: newFormattedCursorPosition,
|
|
27161
|
+
selectionEnd: newFormattedCursorPosition,
|
|
27162
|
+
rawValue: state.rawValue,
|
|
27163
|
+
"delete": false,
|
|
27164
|
+
formattedValue: state.formattedValue
|
|
27165
|
+
}); // Apply the external onChange function to the raw underlying string
|
|
27166
|
+
// This is where the user generally updates the input value
|
|
27167
|
+
|
|
27168
|
+
if (_onChange) {
|
|
27169
|
+
_onChange(unformattedNewValue);
|
|
27170
|
+
}
|
|
27171
|
+
}
|
|
27172
27172
|
}));
|
|
27173
27173
|
};
|
|
27174
27174
|
|
|
@@ -27237,7 +27237,7 @@ var fallbackValues$n = {
|
|
|
27237
27237
|
};
|
|
27238
27238
|
|
|
27239
27239
|
var _excluded$v = ["showErrors", "themeValues"],
|
|
27240
|
-
_excluded2 = ["type", "labelTextWhenNoError", "errorMessages", "isNum", "isEmail", "helperModal", "field", "fieldActions", "showErrors", "formatter", "decorator", "themeValues", "background", "customHeight", "autocompleteValue", "extraStyles", "removeFromValue", "dataQa", "isRequired", "errorFieldExtraStyles", "showFieldErrorRow"];
|
|
27240
|
+
_excluded2 = ["type", "labelTextWhenNoError", "errorMessages", "isNum", "isEmail", "helperModal", "field", "fieldActions", "showErrors", "formatter", "decorator", "themeValues", "background", "customHeight", "autocompleteValue", "extraStyles", "removeFromValue", "dataQa", "isRequired", "errorFieldExtraStyles", "showFieldErrorRow", "labelTextVariant", "errorTextVariant"];
|
|
27241
27241
|
var InputField = styled__default.input.withConfig({
|
|
27242
27242
|
displayName: "FormInput__InputField",
|
|
27243
27243
|
componentId: "sc-l094r1-0"
|
|
@@ -27328,6 +27328,10 @@ var FormInput = function FormInput(_ref15) {
|
|
|
27328
27328
|
errorFieldExtraStyles = _ref15.errorFieldExtraStyles,
|
|
27329
27329
|
_ref15$showFieldError = _ref15.showFieldErrorRow,
|
|
27330
27330
|
showFieldErrorRow = _ref15$showFieldError === void 0 ? true : _ref15$showFieldError,
|
|
27331
|
+
_ref15$labelTextVaria = _ref15.labelTextVariant,
|
|
27332
|
+
labelTextVariant = _ref15$labelTextVaria === void 0 ? "pS" : _ref15$labelTextVaria,
|
|
27333
|
+
_ref15$errorTextVaria = _ref15.errorTextVariant,
|
|
27334
|
+
errorTextVariant = _ref15$errorTextVaria === void 0 ? "pXS" : _ref15$errorTextVaria,
|
|
27331
27335
|
props = _objectWithoutProperties(_ref15, _excluded2);
|
|
27332
27336
|
var _useState = React.useState(false),
|
|
27333
27337
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -27362,7 +27366,7 @@ var FormInput = function FormInput(_ref15) {
|
|
|
27362
27366
|
}, /*#__PURE__*/React__default.createElement(Text$1, {
|
|
27363
27367
|
as: "label",
|
|
27364
27368
|
color: themeValues.labelColor,
|
|
27365
|
-
variant:
|
|
27369
|
+
variant: labelTextVariant,
|
|
27366
27370
|
weight: themeValues.fontWeight,
|
|
27367
27371
|
extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }",
|
|
27368
27372
|
id: createIdFromString(labelTextWhenNoError)
|
|
@@ -27375,12 +27379,12 @@ var FormInput = function FormInput(_ref15) {
|
|
|
27375
27379
|
}, /*#__PURE__*/React__default.createElement(Text$1, {
|
|
27376
27380
|
as: "label",
|
|
27377
27381
|
color: themeValues.labelColor,
|
|
27378
|
-
variant:
|
|
27382
|
+
variant: labelTextVariant,
|
|
27379
27383
|
fontWeight: themeValues.fontWeight,
|
|
27380
27384
|
extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }",
|
|
27381
27385
|
id: createIdFromString(labelTextWhenNoError)
|
|
27382
27386
|
}, labelTextWhenNoError), type === "password" && /*#__PURE__*/React__default.createElement(Text$1, {
|
|
27383
|
-
variant:
|
|
27387
|
+
variant: labelTextVariant,
|
|
27384
27388
|
color: themeValues.linkColor,
|
|
27385
27389
|
weight: themeValues.fontWeight,
|
|
27386
27390
|
hoverStyles: themeValues.hoverFocusStyles,
|
|
@@ -27460,7 +27464,7 @@ var FormInput = function FormInput(_ref15) {
|
|
|
27460
27464
|
"aria-atomic": true
|
|
27461
27465
|
}, field.hasErrors && field.dirty || field.hasErrors && showErrors ? /*#__PURE__*/React__default.createElement(Text$1, {
|
|
27462
27466
|
color: ERROR_COLOR,
|
|
27463
|
-
variant:
|
|
27467
|
+
variant: errorTextVariant,
|
|
27464
27468
|
weight: themeValues.fontWeight,
|
|
27465
27469
|
extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }\n ".concat(errorFieldExtraStyles, ";"),
|
|
27466
27470
|
id: createIdFromString(labelTextWhenNoError, "error message")
|
|
@@ -27761,7 +27765,7 @@ var HamburgerButton = function HamburgerButton(_ref4) {
|
|
|
27761
27765
|
inactiveColor = _ref4.inactiveColor,
|
|
27762
27766
|
isActive = _ref4.isActive,
|
|
27763
27767
|
_ref4$onClick = _ref4.onClick,
|
|
27764
|
-
onClick = _ref4$onClick === void 0 ? noop : _ref4$onClick,
|
|
27768
|
+
onClick = _ref4$onClick === void 0 ? noop$1 : _ref4$onClick,
|
|
27765
27769
|
controls = _ref4.controls;
|
|
27766
27770
|
return /*#__PURE__*/React__default.createElement(Hamburger, {
|
|
27767
27771
|
className: isActive === true ? "active" : "",
|
|
@@ -28652,7 +28656,7 @@ var RadioButtonWithLabel = function RadioButtonWithLabel(_ref5) {
|
|
|
28652
28656
|
themeValues = _ref5.themeValues,
|
|
28653
28657
|
index = _ref5.index,
|
|
28654
28658
|
_ref5$handleChange = _ref5.handleChange,
|
|
28655
|
-
handleChange = _ref5$handleChange === void 0 ? noop : _ref5$handleChange,
|
|
28659
|
+
handleChange = _ref5$handleChange === void 0 ? noop$1 : _ref5$handleChange,
|
|
28656
28660
|
field = _ref5.field,
|
|
28657
28661
|
config = _ref5.config;
|
|
28658
28662
|
var getDefaultChecked = function getDefaultChecked(value, idx) {
|
|
@@ -28869,7 +28873,7 @@ var Search = function Search(_ref) {
|
|
|
28869
28873
|
"aria-controls": ariaControlsId,
|
|
28870
28874
|
extraStyles: "border-radius: 4px 0 0 4px; border: none; box-shadow: 0px 1px 2px 0px ".concat(CHARADE_GREY, "1A; font-size: 0.875rem;"),
|
|
28871
28875
|
onKeyDown: function onKeyDown(e) {
|
|
28872
|
-
return searchOnKeypress || e.key === "Enter" ? handleSubmit() : noop;
|
|
28876
|
+
return searchOnKeypress || e.key === "Enter" ? handleSubmit() : noop$1;
|
|
28873
28877
|
},
|
|
28874
28878
|
field: field,
|
|
28875
28879
|
fieldActions: fieldActions,
|
|
@@ -39657,7 +39661,7 @@ var ToggleSwitch = function ToggleSwitch(_ref10) {
|
|
|
39657
39661
|
_ref10$isOn = _ref10.isOn,
|
|
39658
39662
|
isOn = _ref10$isOn === void 0 ? false : _ref10$isOn,
|
|
39659
39663
|
_ref10$onToggle = _ref10.onToggle,
|
|
39660
|
-
onToggle = _ref10$onToggle === void 0 ? noop : _ref10$onToggle,
|
|
39664
|
+
onToggle = _ref10$onToggle === void 0 ? noop$1 : _ref10$onToggle,
|
|
39661
39665
|
_ref10$disabled = _ref10.disabled,
|
|
39662
39666
|
disabled = _ref10$disabled === void 0 ? false : _ref10$disabled,
|
|
39663
39667
|
_ref10$name = _ref10.name,
|
|
@@ -39757,13 +39761,13 @@ var ToggleSwitch = function ToggleSwitch(_ref10) {
|
|
|
39757
39761
|
"aria-labelledby": label ? "".concat(nameId, "-label") : null,
|
|
39758
39762
|
"aria-describedby": ariaDescribedBy ? ariaDescribedBy : null,
|
|
39759
39763
|
checked: isOn,
|
|
39760
|
-
onChange: disabled ? noop : onToggle,
|
|
39764
|
+
onChange: disabled ? noop$1 : onToggle,
|
|
39761
39765
|
disabled: disabled,
|
|
39762
39766
|
id: "#".concat(nameId),
|
|
39763
39767
|
isMobile: isMobile
|
|
39764
39768
|
}), /*#__PURE__*/React__default.createElement(VisibleSwitch, {
|
|
39765
|
-
onClick: disabled ? noop : onToggle,
|
|
39766
|
-
onKeyDown: disabled ? noop : handleKeyDown,
|
|
39769
|
+
onClick: disabled ? noop$1 : onToggle,
|
|
39770
|
+
onKeyDown: disabled ? noop$1 : handleKeyDown,
|
|
39767
39771
|
pose: isOn ? "on" : "off",
|
|
39768
39772
|
tabIndex: disabled ? -1 : 0,
|
|
39769
39773
|
disabled: disabled,
|
|
@@ -39857,40 +39861,20 @@ var fallbackValues$E = {
|
|
|
39857
39861
|
};
|
|
39858
39862
|
|
|
39859
39863
|
var CardText = function CardText(_ref) {
|
|
39860
|
-
var
|
|
39861
|
-
onQuitClick = _ref.onQuitClick,
|
|
39862
|
-
titleAs = _ref.titleAs,
|
|
39863
|
-
padding = _ref.padding,
|
|
39864
|
+
var padding = _ref.padding,
|
|
39864
39865
|
text = _ref.text,
|
|
39865
|
-
_ref$textAs = _ref.textAs,
|
|
39866
|
-
textAs = _ref$textAs === void 0 ? "p" : _ref$textAs,
|
|
39867
39866
|
titleText = _ref.titleText,
|
|
39868
39867
|
_ref$titleVariant = _ref.titleVariant,
|
|
39869
39868
|
titleVariant = _ref$titleVariant === void 0 ? "small" : _ref$titleVariant,
|
|
39870
39869
|
themeValues = _ref.themeValues;
|
|
39871
39870
|
return /*#__PURE__*/React__default.createElement(Box, {
|
|
39872
39871
|
padding: padding
|
|
39873
|
-
}, /*#__PURE__*/React__default.createElement(Cover, null, /*#__PURE__*/React__default.createElement(Stack, null, /*#__PURE__*/React__default.createElement(
|
|
39874
|
-
|
|
39875
|
-
align: "center",
|
|
39876
|
-
overflow: true
|
|
39877
|
-
}, titleText && /*#__PURE__*/React__default.createElement(Title$1, {
|
|
39878
|
-
as: titleAs,
|
|
39872
|
+
}, /*#__PURE__*/React__default.createElement(Cover, null, /*#__PURE__*/React__default.createElement(Stack, null, titleText && /*#__PURE__*/React__default.createElement(Title$1, {
|
|
39873
|
+
as: "p",
|
|
39879
39874
|
variant: titleVariant,
|
|
39880
39875
|
color: themeValues.titleColor,
|
|
39881
39876
|
weight: themeValues.titleWeight
|
|
39882
|
-
}, titleText),
|
|
39883
|
-
padding: "0",
|
|
39884
|
-
onClick: onQuitClick,
|
|
39885
|
-
onKeyDown: function onKeyDown(e) {
|
|
39886
|
-
return e.key === "Enter" && onQuitClick();
|
|
39887
|
-
},
|
|
39888
|
-
role: "button",
|
|
39889
|
-
tabIndex: 0,
|
|
39890
|
-
"aria-label": "Close Card: ".concat(titleText),
|
|
39891
|
-
extraStyles: "cursor: pointer;"
|
|
39892
|
-
}, /*#__PURE__*/React__default.createElement(IconQuitLarge, null))), /*#__PURE__*/React__default.createElement(Paragraph$1, {
|
|
39893
|
-
as: textAs,
|
|
39877
|
+
}, titleText), /*#__PURE__*/React__default.createElement(Paragraph$1, {
|
|
39894
39878
|
color: themeValues.textColor
|
|
39895
39879
|
}, text))));
|
|
39896
39880
|
};
|
|
@@ -39931,17 +39915,9 @@ var Card = function Card(_ref) {
|
|
|
39931
39915
|
_ref$imgObjectFit = _ref.imgObjectFit,
|
|
39932
39916
|
imgObjectFit = _ref$imgObjectFit === void 0 ? "none" : _ref$imgObjectFit,
|
|
39933
39917
|
imgAltText = _ref.imgAltText,
|
|
39934
|
-
_ref$onQuitClick = _ref.onQuitClick,
|
|
39935
|
-
onQuitClick = _ref$onQuitClick === void 0 ? noop : _ref$onQuitClick,
|
|
39936
39918
|
_ref$padding = _ref.padding,
|
|
39937
39919
|
padding = _ref$padding === void 0 ? "24px" : _ref$padding,
|
|
39938
|
-
_ref$showQuitLink = _ref.showQuitLink,
|
|
39939
|
-
showQuitLink = _ref$showQuitLink === void 0 ? false : _ref$showQuitLink,
|
|
39940
39920
|
text = _ref.text,
|
|
39941
|
-
_ref$textAs = _ref.textAs,
|
|
39942
|
-
textAs = _ref$textAs === void 0 ? "p" : _ref$textAs,
|
|
39943
|
-
_ref$titleAs = _ref.titleAs,
|
|
39944
|
-
titleAs = _ref$titleAs === void 0 ? "h2" : _ref$titleAs,
|
|
39945
39921
|
titleText = _ref.titleText,
|
|
39946
39922
|
_ref$titleVariant = _ref.titleVariant,
|
|
39947
39923
|
titleVariant = _ref$titleVariant === void 0 ? "small" : _ref$titleVariant,
|
|
@@ -39998,13 +39974,9 @@ var Card = function Card(_ref) {
|
|
|
39998
39974
|
width: "100%",
|
|
39999
39975
|
extraStyles: "flex-basis: 100%;"
|
|
40000
39976
|
}, text && /*#__PURE__*/React__default.createElement(CardText$1, {
|
|
40001
|
-
onQuitClick: onQuitClick,
|
|
40002
39977
|
padding: padding,
|
|
40003
|
-
showQuitLink: showQuitLink,
|
|
40004
|
-
titleAs: titleAs,
|
|
40005
39978
|
titleText: titleText,
|
|
40006
39979
|
text: text,
|
|
40007
|
-
textAs: textAs,
|
|
40008
39980
|
titleVariant: titleVariant
|
|
40009
39981
|
}), children)))));
|
|
40010
39982
|
};
|
|
@@ -40965,7 +40937,7 @@ var AddressForm = function AddressForm(_ref) {
|
|
|
40965
40937
|
clearOnDismount = _ref.clearOnDismount,
|
|
40966
40938
|
showErrors = _ref.showErrors,
|
|
40967
40939
|
_ref$handleSubmit = _ref.handleSubmit,
|
|
40968
|
-
handleSubmit = _ref$handleSubmit === void 0 ? noop : _ref$handleSubmit,
|
|
40940
|
+
handleSubmit = _ref$handleSubmit === void 0 ? noop$1 : _ref$handleSubmit,
|
|
40969
40941
|
showWalletCheckbox = _ref.showWalletCheckbox,
|
|
40970
40942
|
saveToWallet = _ref.saveToWallet,
|
|
40971
40943
|
walletCheckboxMarked = _ref.walletCheckboxMarked,
|
|
@@ -41165,7 +41137,7 @@ var ChangePasswordForm = function ChangePasswordForm(_ref) {
|
|
|
41165
41137
|
fields = _ref.fields,
|
|
41166
41138
|
actions = _ref.actions,
|
|
41167
41139
|
_ref$handleSubmit = _ref.handleSubmit,
|
|
41168
|
-
handleSubmit = _ref$handleSubmit === void 0 ? noop : _ref$handleSubmit,
|
|
41140
|
+
handleSubmit = _ref$handleSubmit === void 0 ? noop$1 : _ref$handleSubmit,
|
|
41169
41141
|
showErrors = _ref.showErrors,
|
|
41170
41142
|
isMobile = _ref.isMobile,
|
|
41171
41143
|
revenueManagement = _ref.revenueManagement,
|
|
@@ -41376,8 +41348,8 @@ var CollapsibleSection = function CollapsibleSection(_ref) {
|
|
|
41376
41348
|
}, /*#__PURE__*/React__default.createElement(Box, {
|
|
41377
41349
|
padding: customPadding ? customPadding : "0",
|
|
41378
41350
|
background: themeValues.headingBackgroundColor,
|
|
41379
|
-
onClick: isMobile && supportsTouch ? noop : toggleSection,
|
|
41380
|
-
onTouchEnd: isMobile && supportsTouch ? toggleSection : noop,
|
|
41351
|
+
onClick: isMobile && supportsTouch ? noop$1 : toggleSection,
|
|
41352
|
+
onTouchEnd: isMobile && supportsTouch ? toggleSection : noop$1,
|
|
41381
41353
|
key: "header",
|
|
41382
41354
|
hoverStyles: "cursor: pointer;",
|
|
41383
41355
|
tabIndex: "0",
|
|
@@ -41595,7 +41567,7 @@ var EditNameForm = function EditNameForm(_ref) {
|
|
|
41595
41567
|
clearOnDismount = _ref.clearOnDismount,
|
|
41596
41568
|
showErrors = _ref.showErrors,
|
|
41597
41569
|
_ref$handleSubmit = _ref.handleSubmit,
|
|
41598
|
-
handleSubmit = _ref$handleSubmit === void 0 ? noop : _ref$handleSubmit;
|
|
41570
|
+
handleSubmit = _ref$handleSubmit === void 0 ? noop$1 : _ref$handleSubmit;
|
|
41599
41571
|
if (clearOnDismount) {
|
|
41600
41572
|
React.useEffect(function () {
|
|
41601
41573
|
return function () {
|
|
@@ -41738,7 +41710,7 @@ var EditableList = function EditableList(_ref) {
|
|
|
41738
41710
|
}, /*#__PURE__*/React__default.createElement(Text$1, {
|
|
41739
41711
|
variant: "p",
|
|
41740
41712
|
color: CHARADE_GREY
|
|
41741
|
-
}, renderItem(item)), /*#__PURE__*/React__default.createElement(EditableListItemControls, null, item.isPrimary && /*#__PURE__*/React__default.createElement(Text$1, {
|
|
41713
|
+
}, !!renderItem && typeof renderItem === "function" && renderItem(item)), /*#__PURE__*/React__default.createElement(EditableListItemControls, null, item.isPrimary && /*#__PURE__*/React__default.createElement(Text$1, {
|
|
41742
41714
|
variant: "p",
|
|
41743
41715
|
color: STORM_GREY,
|
|
41744
41716
|
extraStyles: "font-style: italic;",
|
|
@@ -41938,7 +41910,7 @@ var EmailForm = function EmailForm(_ref) {
|
|
|
41938
41910
|
showErrors = _ref.showErrors,
|
|
41939
41911
|
guestCheckout = _ref.guestCheckout,
|
|
41940
41912
|
_ref$handleSubmit = _ref.handleSubmit,
|
|
41941
|
-
handleSubmit = _ref$handleSubmit === void 0 ? noop : _ref$handleSubmit,
|
|
41913
|
+
handleSubmit = _ref$handleSubmit === void 0 ? noop$1 : _ref$handleSubmit,
|
|
41942
41914
|
showWalletCheckbox = _ref.showWalletCheckbox,
|
|
41943
41915
|
saveToWallet = _ref.saveToWallet,
|
|
41944
41916
|
walletCheckboxMarked = _ref.walletCheckboxMarked,
|
|
@@ -42036,7 +42008,7 @@ var ForgotPasswordForm = function ForgotPasswordForm(_ref) {
|
|
|
42036
42008
|
clearOnDismount = _ref.clearOnDismount,
|
|
42037
42009
|
showErrors = _ref.showErrors,
|
|
42038
42010
|
_ref$handleSubmit = _ref.handleSubmit,
|
|
42039
|
-
handleSubmit = _ref$handleSubmit === void 0 ? noop : _ref$handleSubmit;
|
|
42011
|
+
handleSubmit = _ref$handleSubmit === void 0 ? noop$1 : _ref$handleSubmit;
|
|
42040
42012
|
if (clearOnDismount) {
|
|
42041
42013
|
React.useEffect(function () {
|
|
42042
42014
|
return function () {
|
|
@@ -42630,7 +42602,7 @@ var LinkCard = function LinkCard(_ref) {
|
|
|
42630
42602
|
extraStyles: extraStyles,
|
|
42631
42603
|
hoverStyles: extraHoverStyles,
|
|
42632
42604
|
activeStyles: extraActiveStyles,
|
|
42633
|
-
onClick: disabled ? noop : onClick,
|
|
42605
|
+
onClick: disabled ? noop$1 : onClick,
|
|
42634
42606
|
"aria-disabled": disabled,
|
|
42635
42607
|
isDisabled: disabled,
|
|
42636
42608
|
role: "group",
|
|
@@ -42679,7 +42651,7 @@ var LoginForm = function LoginForm(_ref) {
|
|
|
42679
42651
|
actions = _ref.actions,
|
|
42680
42652
|
showErrors = _ref.showErrors,
|
|
42681
42653
|
_ref$handleSubmit = _ref.handleSubmit,
|
|
42682
|
-
handleSubmit = _ref$handleSubmit === void 0 ? noop : _ref$handleSubmit;
|
|
42654
|
+
handleSubmit = _ref$handleSubmit === void 0 ? noop$1 : _ref$handleSubmit;
|
|
42683
42655
|
if (clearOnDismount) {
|
|
42684
42656
|
React.useEffect(function () {
|
|
42685
42657
|
return function () {
|
|
@@ -46349,13 +46321,13 @@ var CancelButton = function CancelButton(_ref) {
|
|
|
46349
46321
|
var _ref$buttonExtraStyle = _ref.buttonExtraStyles,
|
|
46350
46322
|
buttonExtraStyles = _ref$buttonExtraStyle === void 0 ? "" : _ref$buttonExtraStyle,
|
|
46351
46323
|
_ref$cancelAction = _ref.cancelAction,
|
|
46352
|
-
cancelAction = _ref$cancelAction === void 0 ? noop : _ref$cancelAction,
|
|
46324
|
+
cancelAction = _ref$cancelAction === void 0 ? noop$1 : _ref$cancelAction,
|
|
46353
46325
|
_ref$cancelButtonText = _ref.cancelButtonText,
|
|
46354
46326
|
cancelButtonText = _ref$cancelButtonText === void 0 ? "" : _ref$cancelButtonText,
|
|
46355
46327
|
_ref$cancelButtonVari = _ref.cancelButtonVariant,
|
|
46356
46328
|
cancelButtonVariant = _ref$cancelButtonVari === void 0 ? "secondary" : _ref$cancelButtonVari,
|
|
46357
46329
|
_ref$hideModal = _ref.hideModal,
|
|
46358
|
-
hideModal = _ref$hideModal === void 0 ? noop : _ref$hideModal,
|
|
46330
|
+
hideModal = _ref$hideModal === void 0 ? noop$1 : _ref$hideModal,
|
|
46359
46331
|
_ref$isMobile = _ref.isMobile,
|
|
46360
46332
|
isMobile = _ref$isMobile === void 0 ? false : _ref$isMobile;
|
|
46361
46333
|
var fontSize = "font-size: ".concat(isMobile ? FONT_SIZE.XS : FONT_SIZE.SM, ";");
|
|
@@ -46382,7 +46354,7 @@ var CloseButton = function CloseButton(_ref) {
|
|
|
46382
46354
|
_ref$closeButtonVaria = _ref.closeButtonVariant,
|
|
46383
46355
|
closeButtonVariant = _ref$closeButtonVaria === void 0 ? "primary" : _ref$closeButtonVaria,
|
|
46384
46356
|
_ref$hideModal = _ref.hideModal,
|
|
46385
|
-
hideModal = _ref$hideModal === void 0 ? noop : _ref$hideModal,
|
|
46357
|
+
hideModal = _ref$hideModal === void 0 ? noop$1 : _ref$hideModal,
|
|
46386
46358
|
_ref$isMobile = _ref.isMobile,
|
|
46387
46359
|
isMobile = _ref$isMobile === void 0 ? false : _ref$isMobile;
|
|
46388
46360
|
var fontSize = "font-size: ".concat(isMobile ? FONT_SIZE.XS : FONT_SIZE.SM, ";");
|
|
@@ -46404,7 +46376,7 @@ var CloseButton = function CloseButton(_ref) {
|
|
|
46404
46376
|
var CloseIconButton = function CloseIconButton(_ref) {
|
|
46405
46377
|
var _ref$buttonExtraStyle = _ref.buttonExtraStyles,
|
|
46406
46378
|
_ref$hideModal = _ref.hideModal,
|
|
46407
|
-
hideModal = _ref$hideModal === void 0 ? noop : _ref$hideModal,
|
|
46379
|
+
hideModal = _ref$hideModal === void 0 ? noop$1 : _ref$hideModal,
|
|
46408
46380
|
_ref$iconWidth = _ref.iconWidth,
|
|
46409
46381
|
iconWidth = _ref$iconWidth === void 0 ? "24px" : _ref$iconWidth,
|
|
46410
46382
|
_ref$iconHeight = _ref.iconHeight,
|
|
@@ -46429,7 +46401,7 @@ var ContinueButton = function ContinueButton(_ref) {
|
|
|
46429
46401
|
var _ref$buttonExtraStyle = _ref.buttonExtraStyles,
|
|
46430
46402
|
buttonExtraStyles = _ref$buttonExtraStyle === void 0 ? "" : _ref$buttonExtraStyle,
|
|
46431
46403
|
_ref$continueAction = _ref.continueAction,
|
|
46432
|
-
continueAction = _ref$continueAction === void 0 ? noop : _ref$continueAction,
|
|
46404
|
+
continueAction = _ref$continueAction === void 0 ? noop$1 : _ref$continueAction,
|
|
46433
46405
|
_ref$continueButtonTe = _ref.continueButtonText,
|
|
46434
46406
|
continueButtonText = _ref$continueButtonTe === void 0 ? "" : _ref$continueButtonTe,
|
|
46435
46407
|
_ref$continueURL = _ref.continueURL,
|
|
@@ -46484,7 +46456,7 @@ var Modal$2 = function Modal(_ref) {
|
|
|
46484
46456
|
_ref$buttonExtraStyle = _ref.buttonExtraStyles,
|
|
46485
46457
|
buttonExtraStyles = _ref$buttonExtraStyle === void 0 ? "" : _ref$buttonExtraStyle,
|
|
46486
46458
|
_ref$cancelAction = _ref.cancelAction,
|
|
46487
|
-
cancelAction = _ref$cancelAction === void 0 ? noop : _ref$cancelAction,
|
|
46459
|
+
cancelAction = _ref$cancelAction === void 0 ? noop$1 : _ref$cancelAction,
|
|
46488
46460
|
_ref$cancelButtonText = _ref.cancelButtonText,
|
|
46489
46461
|
cancelButtonText = _ref$cancelButtonText === void 0 ? "Cancel" : _ref$cancelButtonText,
|
|
46490
46462
|
_ref$cancelButtonVari = _ref.cancelButtonVariant,
|
|
@@ -46496,7 +46468,7 @@ var Modal$2 = function Modal(_ref) {
|
|
|
46496
46468
|
_ref$closeButtonVaria = _ref.closeButtonVariant,
|
|
46497
46469
|
closeButtonVariant = _ref$closeButtonVaria === void 0 ? "primary" : _ref$closeButtonVaria,
|
|
46498
46470
|
_ref$continueAction = _ref.continueAction,
|
|
46499
|
-
continueAction = _ref$continueAction === void 0 ? noop : _ref$continueAction,
|
|
46471
|
+
continueAction = _ref$continueAction === void 0 ? noop$1 : _ref$continueAction,
|
|
46500
46472
|
_ref$continueButtonTe = _ref.continueButtonText,
|
|
46501
46473
|
continueButtonText = _ref$continueButtonTe === void 0 ? "Continue" : _ref$continueButtonTe,
|
|
46502
46474
|
_ref$continueButtonVa = _ref.continueButtonVariant,
|
|
@@ -46510,7 +46482,7 @@ var Modal$2 = function Modal(_ref) {
|
|
|
46510
46482
|
_ref$defaultWrapper = _ref.defaultWrapper,
|
|
46511
46483
|
defaultWrapper = _ref$defaultWrapper === void 0 ? true : _ref$defaultWrapper,
|
|
46512
46484
|
_ref$hideModal = _ref.hideModal,
|
|
46513
|
-
hideModal = _ref$hideModal === void 0 ? noop : _ref$hideModal,
|
|
46485
|
+
hideModal = _ref$hideModal === void 0 ? noop$1 : _ref$hideModal,
|
|
46514
46486
|
_ref$initialFocusSele = _ref.initialFocusSelector,
|
|
46515
46487
|
initialFocusSelector = _ref$initialFocusSele === void 0 ? "" : _ref$initialFocusSele,
|
|
46516
46488
|
_ref$isContinueAction = _ref.isContinueActionDisabled,
|
|
@@ -46991,13 +46963,13 @@ var AmountModule = function AmountModule(_ref) {
|
|
|
46991
46963
|
subDescription: subDescription,
|
|
46992
46964
|
allowedPaymentInstruments: allowedPaymentInstruments,
|
|
46993
46965
|
disableActions: disableActions,
|
|
46994
|
-
action: disableActions ? noop : function () {
|
|
46966
|
+
action: disableActions ? noop$1 : function () {
|
|
46995
46967
|
return toggleModal(true);
|
|
46996
46968
|
},
|
|
46997
|
-
onClick: disableActions ? noop : function () {
|
|
46969
|
+
onClick: disableActions ? noop$1 : function () {
|
|
46998
46970
|
toggleModal(true);
|
|
46999
46971
|
},
|
|
47000
|
-
onKeyPress: disableActions ? noop : function (e) {
|
|
46972
|
+
onKeyPress: disableActions ? noop$1 : function (e) {
|
|
47001
46973
|
e.key === "Enter" && toggleModal(true);
|
|
47002
46974
|
}
|
|
47003
46975
|
})));
|
|
@@ -47127,7 +47099,7 @@ var PaymentDetailsActions = function PaymentDetailsActions(_ref) {
|
|
|
47127
47099
|
padding: "0"
|
|
47128
47100
|
}, /*#__PURE__*/React__default.createElement(ButtonWithAction, {
|
|
47129
47101
|
isLoading: isLoading,
|
|
47130
|
-
action: disableActions ? noop : function () {
|
|
47102
|
+
action: disableActions ? noop$1 : function () {
|
|
47131
47103
|
return handleClick(obligations);
|
|
47132
47104
|
},
|
|
47133
47105
|
text: "Pay Now",
|
|
@@ -47139,7 +47111,7 @@ var PaymentDetailsActions = function PaymentDetailsActions(_ref) {
|
|
|
47139
47111
|
width: "100%"
|
|
47140
47112
|
}, /*#__PURE__*/React__default.createElement(ButtonWithAction, {
|
|
47141
47113
|
isLoading: isLoading,
|
|
47142
|
-
action: disableActions ? noop : function () {
|
|
47114
|
+
action: disableActions ? noop$1 : function () {
|
|
47143
47115
|
return handleClick(obligations);
|
|
47144
47116
|
},
|
|
47145
47117
|
text: "Pay Now",
|
|
@@ -47194,7 +47166,7 @@ var RemoveAccountModalModule = function RemoveAccountModalModule(_ref) {
|
|
|
47194
47166
|
}, /*#__PURE__*/React__default.createElement(ButtonWithAction, {
|
|
47195
47167
|
text: "Remove",
|
|
47196
47168
|
variant: "secondary",
|
|
47197
|
-
action: disableActions ? noop : function () {
|
|
47169
|
+
action: disableActions ? noop$1 : function () {
|
|
47198
47170
|
return setModalIsOpen(true);
|
|
47199
47171
|
},
|
|
47200
47172
|
dataQa: "Remove Account",
|
|
@@ -47266,7 +47238,7 @@ var InactiveControlsModule = function InactiveControlsModule(_ref) {
|
|
|
47266
47238
|
extraStyles: "flex-grow: 1;"
|
|
47267
47239
|
}, /*#__PURE__*/React__default.createElement(RemoveAccountModalModule, {
|
|
47268
47240
|
agencyName: agencyName,
|
|
47269
|
-
removeAccount: disableActions ? noop : handleRemoveAccount,
|
|
47241
|
+
removeAccount: disableActions ? noop$1 : handleRemoveAccount,
|
|
47270
47242
|
accountType: configType === "ACCOUNT" ? "Account" : "Property",
|
|
47271
47243
|
isMobile: isMobile,
|
|
47272
47244
|
disableActions: disableActions
|
|
@@ -47827,7 +47799,7 @@ var Pagination = function Pagination(_ref3) {
|
|
|
47827
47799
|
return setCurrentPage({
|
|
47828
47800
|
pageNumber: item.index
|
|
47829
47801
|
});
|
|
47830
|
-
} : noop,
|
|
47802
|
+
} : noop$1,
|
|
47831
47803
|
textExtraStyles: "font-size: ".concat(fontSize, "; font-weight: ").concat(fontWeight, ";"),
|
|
47832
47804
|
extraStyles: "".concat(extraStyles).concat(item.active ? currentPageStyles : ""),
|
|
47833
47805
|
dataQa: index
|
|
@@ -48190,7 +48162,7 @@ var PaymentDetails = function PaymentDetails(_ref4) {
|
|
|
48190
48162
|
_ref4$voidableTransac = _ref4.voidableTransactionDetails,
|
|
48191
48163
|
voidableTransactionDetails = _ref4$voidableTransac === void 0 ? [] : _ref4$voidableTransac,
|
|
48192
48164
|
_ref4$partialVoidActi = _ref4.partialVoidAction,
|
|
48193
|
-
partialVoidAction = _ref4$partialVoidActi === void 0 ? noop : _ref4$partialVoidActi,
|
|
48165
|
+
partialVoidAction = _ref4$partialVoidActi === void 0 ? noop$1 : _ref4$partialVoidActi,
|
|
48194
48166
|
_ref4$voidableAmountP = _ref4.voidableAmountPaid,
|
|
48195
48167
|
voidableAmountPaid = _ref4$voidableAmountP === void 0 ? 0 : _ref4$voidableAmountP,
|
|
48196
48168
|
_ref4$remainingBalanc = _ref4.remainingBalance,
|
|
@@ -48667,7 +48639,7 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
|
|
|
48667
48639
|
actions = _ref.actions,
|
|
48668
48640
|
showErrors = _ref.showErrors,
|
|
48669
48641
|
_ref$handleSubmit = _ref.handleSubmit,
|
|
48670
|
-
handleSubmit = _ref$handleSubmit === void 0 ? noop : _ref$handleSubmit,
|
|
48642
|
+
handleSubmit = _ref$handleSubmit === void 0 ? noop$1 : _ref$handleSubmit,
|
|
48671
48643
|
showWalletCheckbox = _ref.showWalletCheckbox,
|
|
48672
48644
|
saveToWallet = _ref.saveToWallet,
|
|
48673
48645
|
walletCheckboxMarked = _ref.walletCheckboxMarked,
|
|
@@ -48869,7 +48841,7 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
|
|
|
48869
48841
|
actions = _ref.actions,
|
|
48870
48842
|
showErrors = _ref.showErrors,
|
|
48871
48843
|
_ref$handleSubmit = _ref.handleSubmit,
|
|
48872
|
-
handleSubmit = _ref$handleSubmit === void 0 ? noop : _ref$handleSubmit,
|
|
48844
|
+
handleSubmit = _ref$handleSubmit === void 0 ? noop$1 : _ref$handleSubmit,
|
|
48873
48845
|
showWalletCheckbox = _ref.showWalletCheckbox,
|
|
48874
48846
|
saveToWallet = _ref.saveToWallet,
|
|
48875
48847
|
walletCheckboxMarked = _ref.walletCheckboxMarked,
|
|
@@ -49174,7 +49146,7 @@ var PhoneForm = function PhoneForm(_ref) {
|
|
|
49174
49146
|
clearOnDismount = _ref.clearOnDismount,
|
|
49175
49147
|
showErrors = _ref.showErrors,
|
|
49176
49148
|
_ref$handleSubmit = _ref.handleSubmit,
|
|
49177
|
-
handleSubmit = _ref$handleSubmit === void 0 ? noop : _ref$handleSubmit,
|
|
49149
|
+
handleSubmit = _ref$handleSubmit === void 0 ? noop$1 : _ref$handleSubmit,
|
|
49178
49150
|
showWalletCheckbox = _ref.showWalletCheckbox,
|
|
49179
49151
|
saveToWallet = _ref.saveToWallet,
|
|
49180
49152
|
walletCheckboxMarked = _ref.walletCheckboxMarked,
|
|
@@ -49234,27 +49206,33 @@ PhoneForm.mapDispatchToProps = mapDispatchToProps$8;
|
|
|
49234
49206
|
var DefaultHeading = styled__default.div.withConfig({
|
|
49235
49207
|
displayName: "RadioGroup__DefaultHeading",
|
|
49236
49208
|
componentId: "sc-7lqrl8-0"
|
|
49237
|
-
})(["
|
|
49209
|
+
})(["", " color:", ";margin:0;padding:8px 0px;"], function (_ref) {
|
|
49210
|
+
var fontSize = _ref.fontSize;
|
|
49211
|
+
return "font-size: ".concat(fontSize, ";");
|
|
49212
|
+
}, CHARADE_GREY);
|
|
49238
49213
|
var StyledFieldset = styled__default.fieldset.withConfig({
|
|
49239
49214
|
displayName: "RadioGroup__StyledFieldset",
|
|
49240
49215
|
componentId: "sc-7lqrl8-1"
|
|
49241
49216
|
})(["", ""], function (props) {
|
|
49242
49217
|
return props.$extraStyles;
|
|
49243
49218
|
});
|
|
49244
|
-
var RadioGroup = function RadioGroup(
|
|
49245
|
-
var headingText =
|
|
49246
|
-
groupName =
|
|
49247
|
-
|
|
49248
|
-
|
|
49219
|
+
var RadioGroup = function RadioGroup(_ref2) {
|
|
49220
|
+
var headingText = _ref2.headingText,
|
|
49221
|
+
groupName = _ref2.groupName,
|
|
49222
|
+
_ref2$headingFontSize = _ref2.headingFontSize,
|
|
49223
|
+
headingFontSize = _ref2$headingFontSize === void 0 ? "0.875rem" : _ref2$headingFontSize,
|
|
49224
|
+
_ref2$heading = _ref2.heading,
|
|
49225
|
+
Heading = _ref2$heading === void 0 ? /*#__PURE__*/React__default.createElement(DefaultHeading, {
|
|
49249
49226
|
role: "heading",
|
|
49250
|
-
id: "radio-group-".concat(groupName, "-heading")
|
|
49251
|
-
|
|
49252
|
-
|
|
49253
|
-
|
|
49254
|
-
|
|
49255
|
-
handleChange =
|
|
49256
|
-
|
|
49257
|
-
|
|
49227
|
+
id: "radio-group-".concat(groupName, "-heading"),
|
|
49228
|
+
fontSize: headingFontSize
|
|
49229
|
+
}, headingText) : _ref2$heading,
|
|
49230
|
+
config = _ref2.config,
|
|
49231
|
+
extraStyles = _ref2.extraStyles,
|
|
49232
|
+
_ref2$handleChange = _ref2.handleChange,
|
|
49233
|
+
handleChange = _ref2$handleChange === void 0 ? noop$1 : _ref2$handleChange,
|
|
49234
|
+
field = _ref2.field,
|
|
49235
|
+
fieldActions = _ref2.fieldActions;
|
|
49258
49236
|
var setValue = function setValue(value) {
|
|
49259
49237
|
return fieldActions.set(value);
|
|
49260
49238
|
};
|
|
@@ -49317,7 +49295,7 @@ var InnerRadioSection = function InnerRadioSection(_ref) {
|
|
|
49317
49295
|
ariaLabelledBy = _ref.ariaLabelledBy,
|
|
49318
49296
|
isLastGroupedItemInSection = _ref.isLastGroupedItemInSection,
|
|
49319
49297
|
_ref$onKeyDown = _ref.onKeyDown,
|
|
49320
|
-
onKeyDown = _ref$onKeyDown === void 0 ? noop : _ref$onKeyDown;
|
|
49298
|
+
onKeyDown = _ref$onKeyDown === void 0 ? noop$1 : _ref$onKeyDown;
|
|
49321
49299
|
var wrapper = {
|
|
49322
49300
|
open: {
|
|
49323
49301
|
height: openHeight,
|
|
@@ -49374,12 +49352,12 @@ var InnerRadioSection = function InnerRadioSection(_ref) {
|
|
|
49374
49352
|
"aria-required": section.required,
|
|
49375
49353
|
"aria-labelledby": ariaLabelledBy,
|
|
49376
49354
|
"aria-describedby": ariaDescribedBy,
|
|
49377
|
-
onClick: isMobile && supportsTouch || section.disabled || section.id === openSection ? noop : function () {
|
|
49355
|
+
onClick: isMobile && supportsTouch || section.disabled || section.id === openSection ? noop$1 : function () {
|
|
49378
49356
|
return toggleOpenSection(section.id);
|
|
49379
49357
|
},
|
|
49380
49358
|
onTouchEnd: isMobile && supportsTouch && !section.disabled && section.id !== openSection ? function () {
|
|
49381
49359
|
return toggleOpenSection(section.id);
|
|
49382
|
-
} : noop,
|
|
49360
|
+
} : noop$1,
|
|
49383
49361
|
id: "inner-radio-section-".concat(sectionIndex),
|
|
49384
49362
|
"data-qa": section.dataQa ? section.dataQa : section.id || "inner-radio-section-".concat(sectionIndex)
|
|
49385
49363
|
}, /*#__PURE__*/React__default.createElement(Stack, {
|
|
@@ -49409,7 +49387,7 @@ var InnerRadioSection = function InnerRadioSection(_ref) {
|
|
|
49409
49387
|
ariaDescribedBy: ariaDescribedBy,
|
|
49410
49388
|
radioOn: openSection === section.id,
|
|
49411
49389
|
radioFocused: focused === section.id,
|
|
49412
|
-
toggleRadio: section.disabled ? noop : function () {
|
|
49390
|
+
toggleRadio: section.disabled ? noop$1 : function () {
|
|
49413
49391
|
return toggleOpenSection(section.id);
|
|
49414
49392
|
},
|
|
49415
49393
|
tabIndex: "-1",
|
|
@@ -49594,7 +49572,7 @@ var RegistrationForm = function RegistrationForm(_ref) {
|
|
|
49594
49572
|
fields = _ref.fields,
|
|
49595
49573
|
actions = _ref.actions,
|
|
49596
49574
|
_ref$handleSubmit = _ref.handleSubmit,
|
|
49597
|
-
handleSubmit = _ref$handleSubmit === void 0 ? noop : _ref$handleSubmit,
|
|
49575
|
+
handleSubmit = _ref$handleSubmit === void 0 ? noop$1 : _ref$handleSubmit,
|
|
49598
49576
|
showErrors = _ref.showErrors,
|
|
49599
49577
|
isMobile = _ref.isMobile;
|
|
49600
49578
|
if (clearOnDismount) {
|
|
@@ -49761,7 +49739,7 @@ var ResetConfirmationForm$1 = withWindowSize(ResetConfirmationForm);
|
|
|
49761
49739
|
|
|
49762
49740
|
var ResetPasswordForm = function ResetPasswordForm(_ref) {
|
|
49763
49741
|
var _ref$handleSubmit = _ref.handleSubmit,
|
|
49764
|
-
handleSubmit = _ref$handleSubmit === void 0 ? noop : _ref$handleSubmit,
|
|
49742
|
+
handleSubmit = _ref$handleSubmit === void 0 ? noop$1 : _ref$handleSubmit,
|
|
49765
49743
|
clearOnDismount = _ref.clearOnDismount,
|
|
49766
49744
|
fields = _ref.fields,
|
|
49767
49745
|
actions = _ref.actions,
|
|
@@ -50455,6 +50433,58 @@ var fallbackValues$_ = {
|
|
|
50455
50433
|
secondaryColor: secondaryColor
|
|
50456
50434
|
};
|
|
50457
50435
|
|
|
50436
|
+
var StyledFilterContainer = styled__default(Box).withConfig({
|
|
50437
|
+
displayName: "MultipleSelectFilterstyled__StyledFilterContainer",
|
|
50438
|
+
componentId: "sc-126xgc2-0"
|
|
50439
|
+
})(["position:relative;box-sizing:border-box;padding:0;", ""], function (_ref) {
|
|
50440
|
+
var extraStyles = _ref.extraStyles;
|
|
50441
|
+
return extraStyles;
|
|
50442
|
+
});
|
|
50443
|
+
var FilterContainer = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
50444
|
+
return /*#__PURE__*/React__default.createElement(StyledFilterContainer, _extends({
|
|
50445
|
+
ref: ref
|
|
50446
|
+
}, props));
|
|
50447
|
+
});
|
|
50448
|
+
var StyledFilterDropdown = styled__default(Box).withConfig({
|
|
50449
|
+
displayName: "MultipleSelectFilterstyled__StyledFilterDropdown",
|
|
50450
|
+
componentId: "sc-126xgc2-1"
|
|
50451
|
+
})(["position:absolute;top:calc(100% + 0.5rem);left:0;width:100%;background-color:white;z-index:1000;border-radius:0.25rem;box-shadow:0px 1px 0px 0px rgba(41,42,51,0.1),0px 2px 4px 0px rgba(41,42,51,0.2),0px 1px 2px 0px rgba(41,42,51,0.1);padding:0;max-width:18.625rem;"]);
|
|
50452
|
+
var FilterDropdownContainer = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
50453
|
+
return /*#__PURE__*/React__default.createElement(StyledFilterDropdown, _extends({
|
|
50454
|
+
ref: ref
|
|
50455
|
+
}, props));
|
|
50456
|
+
});
|
|
50457
|
+
var FilterButton = styled__default(ButtonWithAction).withConfig({
|
|
50458
|
+
displayName: "MultipleSelectFilterstyled__FilterButton",
|
|
50459
|
+
componentId: "sc-126xgc2-2"
|
|
50460
|
+
})(["min-width:auto;min-height:2.3125rem;margin:0;padding:0.5rem;border-radius:0.25rem;box-shadow:0px 1px 2px 0px rgba(41,42,51,0.1);", " ", ""], function (_ref2) {
|
|
50461
|
+
var textColor = _ref2.textColor;
|
|
50462
|
+
return "\n color: ".concat(textColor, ";\n ");
|
|
50463
|
+
}, function (_ref3) {
|
|
50464
|
+
var backgroundColor = _ref3.backgroundColor;
|
|
50465
|
+
return "\n background-color: ".concat(backgroundColor, ";\n :hover,\n :active,\n :focus {\n background-color: ").concat(backgroundColor, ";\n }\n ");
|
|
50466
|
+
});
|
|
50467
|
+
var StyledFilterButton = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
50468
|
+
return /*#__PURE__*/React__default.createElement(FilterButton, _extends({
|
|
50469
|
+
ref: ref
|
|
50470
|
+
}, props));
|
|
50471
|
+
});
|
|
50472
|
+
|
|
50473
|
+
var ActionLinkButton = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
50474
|
+
var action = _ref.action,
|
|
50475
|
+
text = _ref.text,
|
|
50476
|
+
dataQa = _ref.dataQa;
|
|
50477
|
+
return /*#__PURE__*/React__default.createElement(ButtonWithAction, {
|
|
50478
|
+
ref: ref,
|
|
50479
|
+
action: action,
|
|
50480
|
+
variant: "tertiary",
|
|
50481
|
+
extraStyles: "\n padding: 0.2rem; \n margin: 0.5rem; \n min-height: auto; \n min-width: auto;\n ",
|
|
50482
|
+
textExtraStyles: "font-weight: ".concat(FONT_WEIGHT_REGULAR, ";"),
|
|
50483
|
+
text: text,
|
|
50484
|
+
dataQa: dataQa
|
|
50485
|
+
});
|
|
50486
|
+
});
|
|
50487
|
+
|
|
50458
50488
|
var _excluded$J = ["width", "height", "color"];
|
|
50459
50489
|
var DropdownIconV2 = function DropdownIconV2(_ref) {
|
|
50460
50490
|
var _ref$width = _ref.width,
|
|
@@ -50503,205 +50533,385 @@ var DropdownIconV2 = function DropdownIconV2(_ref) {
|
|
|
50503
50533
|
}))));
|
|
50504
50534
|
};
|
|
50505
50535
|
|
|
50506
|
-
var
|
|
50507
|
-
|
|
50508
|
-
|
|
50509
|
-
|
|
50510
|
-
|
|
50511
|
-
|
|
50512
|
-
|
|
50513
|
-
|
|
50514
|
-
|
|
50515
|
-
|
|
50516
|
-
|
|
50517
|
-
|
|
50518
|
-
|
|
50519
|
-
|
|
50520
|
-
|
|
50521
|
-
|
|
50522
|
-
|
|
50523
|
-
|
|
50524
|
-
|
|
50525
|
-
|
|
50536
|
+
var FilterButton$1 = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
50537
|
+
var btnContentOverride = _ref.btnContentOverride,
|
|
50538
|
+
_ref$action = _ref.action,
|
|
50539
|
+
action = _ref$action === void 0 ? noop$1 : _ref$action,
|
|
50540
|
+
opened = _ref.opened,
|
|
50541
|
+
backgroundColor = _ref.backgroundColor,
|
|
50542
|
+
contentColor = _ref.contentColor,
|
|
50543
|
+
name = _ref.name,
|
|
50544
|
+
filterDropdownID = _ref.filterDropdownID,
|
|
50545
|
+
_ref$hasIcon = _ref.hasIcon,
|
|
50546
|
+
hasIcon = _ref$hasIcon === void 0 ? false : _ref$hasIcon,
|
|
50547
|
+
Icon = _ref.icon,
|
|
50548
|
+
truncateBtnTextWidth = _ref.truncateBtnTextWidth,
|
|
50549
|
+
filterLabel = _ref.filterLabel,
|
|
50550
|
+
selectedOptions = _ref.selectedOptions;
|
|
50551
|
+
return /*#__PURE__*/React__default.createElement(StyledFilterButton, {
|
|
50552
|
+
ref: ref,
|
|
50553
|
+
variant: "tertiary",
|
|
50554
|
+
action: action,
|
|
50555
|
+
"aria-haspopup": "listbox",
|
|
50556
|
+
"aria-expanded": opened,
|
|
50557
|
+
"aria-controls": filterDropdownID,
|
|
50558
|
+
backgroundColor: backgroundColor,
|
|
50559
|
+
dataQa: "".concat(name, "-filter-button"),
|
|
50560
|
+
contentOverride: true
|
|
50561
|
+
}, btnContentOverride ? btnContentOverride : /*#__PURE__*/React__default.createElement(Center, {
|
|
50562
|
+
as: "span",
|
|
50563
|
+
style: {
|
|
50564
|
+
display: "flex",
|
|
50565
|
+
flexDirection: "row"
|
|
50566
|
+
},
|
|
50567
|
+
intrinsic: true
|
|
50568
|
+
}, hasIcon && /*#__PURE__*/React__default.createElement(Icon, {
|
|
50569
|
+
color: contentColor
|
|
50570
|
+
}), /*#__PURE__*/React__default.createElement(Center, {
|
|
50571
|
+
as: "span",
|
|
50572
|
+
style: {
|
|
50573
|
+
display: "flex",
|
|
50574
|
+
flexDirection: "row",
|
|
50575
|
+
padding: "0 0.5rem 0 0.25rem"
|
|
50576
|
+
},
|
|
50577
|
+
intrinsic: true
|
|
50578
|
+
}, /*#__PURE__*/React__default.createElement(Text$1, {
|
|
50579
|
+
variant: "pS",
|
|
50580
|
+
color: contentColor,
|
|
50581
|
+
extraStyles: "\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n ".concat(truncateBtnTextWidth && "max-width:" + truncateBtnTextWidth, "\n ")
|
|
50582
|
+
}, selectedOptions !== null && selectedOptions !== void 0 && selectedOptions.length ? "".concat(filterLabel ? filterLabel + ": " : "").concat(selectedOptions[0].name) : "".concat(filterLabel ? filterLabel : "")), /*#__PURE__*/React__default.createElement(Text$1, {
|
|
50583
|
+
color: contentColor,
|
|
50584
|
+
variant: "pS"
|
|
50585
|
+
}, selectedOptions !== null && selectedOptions !== void 0 && selectedOptions.length && (selectedOptions === null || selectedOptions === void 0 ? void 0 : selectedOptions.length) > 1 ? ", +".concat((selectedOptions === null || selectedOptions === void 0 ? void 0 : selectedOptions.length) - 1, " More") : "")), /*#__PURE__*/React__default.createElement(DropdownIconV2, {
|
|
50586
|
+
color: contentColor
|
|
50587
|
+
})));
|
|
50526
50588
|
});
|
|
50527
|
-
|
|
50528
|
-
|
|
50529
|
-
|
|
50530
|
-
|
|
50531
|
-
|
|
50532
|
-
|
|
50533
|
-
|
|
50534
|
-
|
|
50535
|
-
|
|
50589
|
+
|
|
50590
|
+
var FilterDropdown = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
50591
|
+
var id = _ref.id,
|
|
50592
|
+
ariaOwns = _ref.ariaOwns,
|
|
50593
|
+
opened = _ref.opened,
|
|
50594
|
+
children = _ref.children;
|
|
50595
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, opened && /*#__PURE__*/React__default.createElement(FilterDropdownContainer, {
|
|
50596
|
+
ref: ref,
|
|
50597
|
+
id: id,
|
|
50598
|
+
role: "combobox",
|
|
50599
|
+
"aria-expanded": opened,
|
|
50600
|
+
"aria-haspopup": "listbox",
|
|
50601
|
+
"aria-owns": ariaOwns
|
|
50602
|
+
}, children));
|
|
50536
50603
|
});
|
|
50537
|
-
|
|
50538
|
-
|
|
50539
|
-
|
|
50540
|
-
|
|
50604
|
+
|
|
50605
|
+
var SearchBox = function SearchBox(_ref) {
|
|
50606
|
+
var autocompleteValue = _ref.autocompleteValue,
|
|
50607
|
+
fields = _ref.fields,
|
|
50608
|
+
actions = _ref.actions,
|
|
50609
|
+
placeholder = _ref.placeholder,
|
|
50610
|
+
disabled = _ref.disabled,
|
|
50611
|
+
showSearchBox = _ref.showSearchBox;
|
|
50612
|
+
return /*#__PURE__*/React__default.createElement(Box, {
|
|
50613
|
+
padding: "0 0 0.5rem"
|
|
50614
|
+
}, showSearchBox && /*#__PURE__*/React__default.createElement(FormInput$1, {
|
|
50615
|
+
autocompleteValue: autocompleteValue,
|
|
50616
|
+
showFieldErrorRow: false,
|
|
50617
|
+
errorMessages: {},
|
|
50618
|
+
field: fields.searchTerm,
|
|
50619
|
+
fieldActions: actions.fields.searchTerm,
|
|
50620
|
+
placeholder: placeholder,
|
|
50621
|
+
disabled: disabled,
|
|
50622
|
+
extraStyles: "\n height: 2.875rem;\n border: 0; \n border-radius: 0;\n padding: 0.45rem;\n font-size: 0.875rem;\n border-bottom: 1px solid ".concat(GHOST_GREY, ";\n ")
|
|
50623
|
+
}));
|
|
50624
|
+
};
|
|
50625
|
+
|
|
50626
|
+
var FilterableListItem = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
50627
|
+
var index = _ref.index,
|
|
50628
|
+
option = _ref.option,
|
|
50629
|
+
checked = _ref.checked,
|
|
50630
|
+
selectOption = _ref.selectOption,
|
|
50631
|
+
disabled = _ref.disabled,
|
|
50632
|
+
tabIndex = _ref.tabIndex,
|
|
50633
|
+
name = _ref.name,
|
|
50634
|
+
themeValues = _ref.themeValues;
|
|
50635
|
+
return /*#__PURE__*/React__default.createElement(Box, {
|
|
50636
|
+
padding: "0",
|
|
50637
|
+
key: index,
|
|
50638
|
+
extraStyles: "\n :hover,\n :active,\n :focus {\n background-color: ".concat(themeValues.primaryColor, ";\n }\n ")
|
|
50639
|
+
}, /*#__PURE__*/React__default.createElement(Checkbox$1, {
|
|
50640
|
+
ref: ref,
|
|
50641
|
+
title: option.name,
|
|
50642
|
+
name: option.name,
|
|
50643
|
+
checked: checked,
|
|
50644
|
+
onChange: function onChange() {
|
|
50645
|
+
return selectOption(option);
|
|
50646
|
+
},
|
|
50647
|
+
textExtraStyles: "font-size: 0.875rem; margin: 0;",
|
|
50648
|
+
disabled: disabled,
|
|
50649
|
+
extraStyles: "\n padding: 0.075rem 0.325rem; \n margin: 0;\n :hover,\n :active,\n :focus {\n background-color: ".concat(themeValues.primaryColor, ";\n }\n "),
|
|
50650
|
+
checkboxMargin: "0.3rem",
|
|
50651
|
+
role: "option",
|
|
50652
|
+
checkboxExtraStyles: "\n width: 1.375rem; \n height: 1.375rem;\n ".concat(checked && !disabled ? "background: " + themeValues.secondaryColor + ";" : "", "\n "),
|
|
50653
|
+
tabIndex: tabIndex,
|
|
50654
|
+
dataQa: "".concat(name, "-option-").concat(index)
|
|
50655
|
+
}));
|
|
50541
50656
|
});
|
|
50542
50657
|
|
|
50543
|
-
var
|
|
50544
|
-
|
|
50545
|
-
|
|
50658
|
+
var filterItemsList = function filterItemsList(list, searchTerm) {
|
|
50659
|
+
return list.filter(function (item) {
|
|
50660
|
+
var _item$name;
|
|
50661
|
+
return item === null || item === void 0 || (_item$name = item.name) === null || _item$name === void 0 ? void 0 : _item$name.toLowerCase().includes(searchTerm === null || searchTerm === void 0 ? void 0 : searchTerm.toLowerCase());
|
|
50662
|
+
});
|
|
50663
|
+
};
|
|
50664
|
+
var sortItemsList = function sortItemsList(list) {
|
|
50665
|
+
return list.slice().sort(function (a, b) {
|
|
50666
|
+
return a.name.toLowerCase().localeCompare(b.name.toLowerCase());
|
|
50667
|
+
});
|
|
50668
|
+
};
|
|
50669
|
+
var isMaxSelectionReached = function isMaxSelectionReached(maxSelection, selectedOptions) {
|
|
50670
|
+
return maxSelection && maxSelection === (selectedOptions === null || selectedOptions === void 0 ? void 0 : selectedOptions.length);
|
|
50671
|
+
};
|
|
50672
|
+
var isChecked = function isChecked(option, selectedOptions) {
|
|
50673
|
+
return selectedOptions === null || selectedOptions === void 0 ? void 0 : selectedOptions.some(function (selectedOption) {
|
|
50674
|
+
return (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.name) === (option === null || option === void 0 ? void 0 : option.name);
|
|
50675
|
+
});
|
|
50676
|
+
};
|
|
50677
|
+
var selectValues = function selectValues(items) {
|
|
50678
|
+
return items.map(function (item) {
|
|
50679
|
+
return item.value;
|
|
50680
|
+
});
|
|
50681
|
+
};
|
|
50682
|
+
var selectOption = function selectOption(option, selectedOptions, setSelectedOptions) {
|
|
50683
|
+
if (selectValues(selectedOptions).includes(option.value)) {
|
|
50684
|
+
var fewerOptions = selectedOptions.filter(function (selectedOption) {
|
|
50685
|
+
return selectedOption.value !== option.value;
|
|
50686
|
+
});
|
|
50687
|
+
setSelectedOptions(fewerOptions);
|
|
50688
|
+
} else {
|
|
50689
|
+
var moreOptions = selectedOptions.concat(option);
|
|
50690
|
+
setSelectedOptions(moreOptions);
|
|
50691
|
+
}
|
|
50692
|
+
};
|
|
50693
|
+
|
|
50694
|
+
var useKeyboardNavigation = function useKeyboardNavigation(_ref) {
|
|
50695
|
+
var options = _ref.options,
|
|
50696
|
+
appliedOptions = _ref.appliedOptions,
|
|
50546
50697
|
selectedOptions = _ref.selectedOptions,
|
|
50547
|
-
|
|
50548
|
-
selectOption = _ref.selectOption,
|
|
50549
|
-
maxSelections = _ref.maxSelections,
|
|
50550
|
-
name = _ref.name;
|
|
50698
|
+
maxSelections = _ref.maxSelections;
|
|
50551
50699
|
var _useState = React.useState(-1),
|
|
50552
50700
|
_useState2 = _slicedToArray(_useState, 2),
|
|
50553
50701
|
focusedIndex = _useState2[0],
|
|
50554
50702
|
setFocusedIndex = _useState2[1];
|
|
50555
|
-
var
|
|
50556
|
-
var
|
|
50557
|
-
var
|
|
50558
|
-
|
|
50559
|
-
|
|
50703
|
+
var itemRefs = React.useRef([]);
|
|
50704
|
+
var totalItemsLength = options.length + appliedOptions.length;
|
|
50705
|
+
var handleArrowUp = function handleArrowUp(event) {
|
|
50706
|
+
event.preventDefault();
|
|
50707
|
+
setFocusedIndex(function (prevIndex) {
|
|
50708
|
+
return prevIndex > 0 ? prevIndex - 1 : totalItemsLength - 1;
|
|
50560
50709
|
});
|
|
50561
50710
|
};
|
|
50562
|
-
|
|
50563
|
-
|
|
50564
|
-
|
|
50711
|
+
var handleArrowDown = function handleArrowDown(event) {
|
|
50712
|
+
event.preventDefault();
|
|
50713
|
+
setFocusedIndex(function (prevIndex) {
|
|
50714
|
+
return prevIndex < totalItemsLength - 1 ? prevIndex + 1 : 0;
|
|
50715
|
+
});
|
|
50716
|
+
};
|
|
50717
|
+
var handleSpacebar = function handleSpacebar(event) {
|
|
50718
|
+
event.preventDefault();
|
|
50719
|
+
var validFocusedIndex = focusedIndex < 0 ? 0 : focusedIndex;
|
|
50720
|
+
// Select option on spacebar press if the maximum selection hasn't been reached.
|
|
50721
|
+
if (!isMaxSelectionReached(maxSelections, selectedOptions) && itemRefs.current && itemRefs.current[validFocusedIndex]) {
|
|
50722
|
+
var nestedInput = itemRefs.current[validFocusedIndex].querySelector("input");
|
|
50723
|
+
if (nestedInput) {
|
|
50724
|
+
nestedInput.click();
|
|
50725
|
+
}
|
|
50565
50726
|
}
|
|
50566
|
-
}
|
|
50727
|
+
};
|
|
50728
|
+
var handleTab = function handleTab(event) {
|
|
50729
|
+
// Reset focus when tabbing out of the list.
|
|
50730
|
+
setFocusedIndex(-1);
|
|
50731
|
+
};
|
|
50732
|
+
var keyActions = {
|
|
50733
|
+
" ": function _(event) {
|
|
50734
|
+
return handleSpacebar(event);
|
|
50735
|
+
},
|
|
50736
|
+
Space: function Space(event) {
|
|
50737
|
+
return handleSpacebar(event);
|
|
50738
|
+
},
|
|
50739
|
+
Tab: function Tab(event) {
|
|
50740
|
+
return handleTab();
|
|
50741
|
+
},
|
|
50742
|
+
ArrowUp: function ArrowUp(event) {
|
|
50743
|
+
return handleArrowUp(event);
|
|
50744
|
+
},
|
|
50745
|
+
ArrowDown: function ArrowDown(event) {
|
|
50746
|
+
return handleArrowDown(event);
|
|
50747
|
+
}
|
|
50748
|
+
};
|
|
50567
50749
|
var handleKeyDown = function handleKeyDown(event) {
|
|
50568
|
-
|
|
50569
|
-
|
|
50570
|
-
|
|
50571
|
-
|
|
50572
|
-
|
|
50573
|
-
|
|
50574
|
-
|
|
50575
|
-
|
|
50576
|
-
|
|
50577
|
-
});
|
|
50578
|
-
} else if (event.key === " ") {
|
|
50579
|
-
event.preventDefault();
|
|
50580
|
-
// Select option on spacebar press if the maximum selection hasn't been reached.
|
|
50581
|
-
var validFocusedIndex = focusedIndex < 0 ? 0 : focusedIndex;
|
|
50582
|
-
if (!isMaxSelectionReached || focusedIndex !== -1 && isChecked(optionsList[validFocusedIndex])) {
|
|
50583
|
-
selectOption(optionsList[validFocusedIndex]);
|
|
50584
|
-
}
|
|
50585
|
-
} else if (event.key === "Tab") {
|
|
50586
|
-
// Reset focus when tabbing out of the list.
|
|
50587
|
-
setTimeout(function () {
|
|
50588
|
-
setFocusedIndex(-1);
|
|
50589
|
-
}, 500);
|
|
50750
|
+
var eventKey = event.code || event.key;
|
|
50751
|
+
var action = keyActions[eventKey];
|
|
50752
|
+
if (action) {
|
|
50753
|
+
action(event);
|
|
50754
|
+
}
|
|
50755
|
+
};
|
|
50756
|
+
React.useEffect(function () {
|
|
50757
|
+
if (focusedIndex !== -1 && itemRefs.current && itemRefs.current[focusedIndex]) {
|
|
50758
|
+
itemRefs.current[focusedIndex].focus(); // move focus to the active option
|
|
50590
50759
|
}
|
|
50760
|
+
}, [focusedIndex]);
|
|
50761
|
+
return {
|
|
50762
|
+
itemRefs: itemRefs,
|
|
50763
|
+
focusedIndex: focusedIndex,
|
|
50764
|
+
handleKeyDown: handleKeyDown
|
|
50591
50765
|
};
|
|
50766
|
+
};
|
|
50767
|
+
|
|
50768
|
+
var FilterableList = function FilterableList(_ref) {
|
|
50769
|
+
var id = _ref.id,
|
|
50770
|
+
options = _ref.options,
|
|
50771
|
+
appliedOptions = _ref.appliedOptions,
|
|
50772
|
+
selectedOptions = _ref.selectedOptions,
|
|
50773
|
+
maxSelections = _ref.maxSelections,
|
|
50774
|
+
name = _ref.name,
|
|
50775
|
+
setSelectedOptions = _ref.setSelectedOptions,
|
|
50776
|
+
searchTerm = _ref.searchTerm,
|
|
50777
|
+
themeValues = _ref.themeValues;
|
|
50778
|
+
var _useState = React.useState([]),
|
|
50779
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
50780
|
+
filteredOptions = _useState2[0],
|
|
50781
|
+
setFilteredOptions = _useState2[1];
|
|
50782
|
+
var _useState3 = React.useState([]),
|
|
50783
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
50784
|
+
filteredAppliedOptions = _useState4[0],
|
|
50785
|
+
setFilteredAppliedOptions = _useState4[1];
|
|
50786
|
+
React.useEffect(function () {
|
|
50787
|
+
setFilteredOptions(options);
|
|
50788
|
+
setFilteredAppliedOptions(appliedOptions);
|
|
50789
|
+
}, [options, appliedOptions]);
|
|
50790
|
+
React.useEffect(function () {
|
|
50791
|
+
var filteredOptionItems = filterItemsList(options, searchTerm === null || searchTerm === void 0 ? void 0 : searchTerm.rawValue);
|
|
50792
|
+
var filteredAppliedItems = filterItemsList(appliedOptions, searchTerm === null || searchTerm === void 0 ? void 0 : searchTerm.rawValue);
|
|
50793
|
+
setFilteredOptions(filteredOptionItems.length ? filteredOptionItems : filteredOptions);
|
|
50794
|
+
setFilteredAppliedOptions(filteredAppliedItems);
|
|
50795
|
+
}, [searchTerm.rawValue]);
|
|
50796
|
+
var handleSelectOption = function handleSelectOption(option) {
|
|
50797
|
+
return selectOption(option, selectedOptions, setSelectedOptions);
|
|
50798
|
+
};
|
|
50799
|
+
var isAppliedOption = function isAppliedOption(option) {
|
|
50800
|
+
return filteredAppliedOptions === null || filteredAppliedOptions === void 0 ? void 0 : filteredAppliedOptions.some(function (appliedItem) {
|
|
50801
|
+
return (appliedItem === null || appliedItem === void 0 ? void 0 : appliedItem.name) === (option === null || option === void 0 ? void 0 : option.name);
|
|
50802
|
+
});
|
|
50803
|
+
};
|
|
50804
|
+
var currentFilteredOptions = filteredOptions.filter(function (option) {
|
|
50805
|
+
return !isAppliedOption(option);
|
|
50806
|
+
});
|
|
50807
|
+
var sortedOptions = sortItemsList(currentFilteredOptions);
|
|
50808
|
+
var sortedAppliedOptions = sortItemsList(filteredAppliedOptions);
|
|
50809
|
+
var _useKeyboardNavigatio = useKeyboardNavigation({
|
|
50810
|
+
options: sortedOptions,
|
|
50811
|
+
appliedOptions: sortedAppliedOptions,
|
|
50812
|
+
selectedOptions: selectedOptions,
|
|
50813
|
+
maxSelections: maxSelections
|
|
50814
|
+
}),
|
|
50815
|
+
itemRefs = _useKeyboardNavigatio.itemRefs,
|
|
50816
|
+
focusedIndex = _useKeyboardNavigatio.focusedIndex,
|
|
50817
|
+
handleKeyDown = _useKeyboardNavigatio.handleKeyDown;
|
|
50592
50818
|
return /*#__PURE__*/React__default.createElement(Box, {
|
|
50593
50819
|
id: id,
|
|
50594
50820
|
role: "listbox",
|
|
50595
50821
|
padding: "0",
|
|
50596
|
-
extraStyles: "\n overflow-y: auto
|
|
50822
|
+
extraStyles: "\n overflow-y: auto;\n max-height: 250px;\n display: flex;\n flex-flow: column;\n ",
|
|
50597
50823
|
onKeyDown: handleKeyDown
|
|
50598
|
-
},
|
|
50599
|
-
|
|
50600
|
-
|
|
50824
|
+
}, (sortedAppliedOptions === null || sortedAppliedOptions === void 0 ? void 0 : sortedAppliedOptions.length) > 0 && /*#__PURE__*/React__default.createElement(Box, {
|
|
50825
|
+
padding: "0",
|
|
50826
|
+
extraStyles: sortedOptions.length > 0 && "border-bottom: 1px solid ".concat(GHOST_GREY)
|
|
50827
|
+
}, sortedAppliedOptions.map(function (option, index) {
|
|
50828
|
+
var checked = isChecked(option, selectedOptions);
|
|
50601
50829
|
var tabIndex = index === focusedIndex || index === 0 && focusedIndex === -1 ? "0" : "-1";
|
|
50602
|
-
return /*#__PURE__*/React__default.createElement(
|
|
50603
|
-
padding: "0",
|
|
50830
|
+
return /*#__PURE__*/React__default.createElement(FilterableListItem, {
|
|
50604
50831
|
key: index,
|
|
50605
|
-
extraStyles: "\n :hover,\n :active,\n :focus {\n background-color: ".concat(themeValues.primaryColor, ";\n }\n ")
|
|
50606
|
-
}, /*#__PURE__*/React__default.createElement(Checkbox$1, {
|
|
50607
50832
|
ref: function ref(el) {
|
|
50608
|
-
return
|
|
50833
|
+
return itemRefs.current[index] = el;
|
|
50609
50834
|
},
|
|
50610
|
-
|
|
50611
|
-
|
|
50835
|
+
index: index,
|
|
50836
|
+
option: option,
|
|
50612
50837
|
checked: checked,
|
|
50613
|
-
|
|
50614
|
-
|
|
50838
|
+
selectOption: handleSelectOption,
|
|
50839
|
+
tabIndex: tabIndex,
|
|
50840
|
+
name: name,
|
|
50841
|
+
themeValues: themeValues
|
|
50842
|
+
});
|
|
50843
|
+
})), sortedOptions.map(function (option, index) {
|
|
50844
|
+
var checked = isChecked(option, selectedOptions);
|
|
50845
|
+
var isDisabled = isMaxSelectionReached(maxSelections, selectedOptions) && !checked;
|
|
50846
|
+
var indexOffset = sortedAppliedOptions !== null && sortedAppliedOptions !== void 0 && sortedAppliedOptions.length ? sortedAppliedOptions === null || sortedAppliedOptions === void 0 ? void 0 : sortedAppliedOptions.length : 0;
|
|
50847
|
+
var currentIndex = index === 0 ? indexOffset : index + indexOffset;
|
|
50848
|
+
var tabIndex = currentIndex === focusedIndex || indexOffset === 0 && currentIndex === indexOffset && focusedIndex === -1 ? "0" : "-1";
|
|
50849
|
+
return /*#__PURE__*/React__default.createElement(FilterableListItem, {
|
|
50850
|
+
key: currentIndex,
|
|
50851
|
+
ref: function ref(el) {
|
|
50852
|
+
return itemRefs.current[currentIndex] = el;
|
|
50615
50853
|
},
|
|
50616
|
-
|
|
50854
|
+
index: currentIndex,
|
|
50855
|
+
option: option,
|
|
50856
|
+
checked: checked,
|
|
50857
|
+
selectOption: isDisabled ? noop : handleSelectOption,
|
|
50617
50858
|
disabled: isDisabled,
|
|
50618
|
-
extraStyles: "\n padding: 0.075rem 0.325rem; \n margin: 0;\n :hover,\n :active,\n :focus {\n background-color: ".concat(themeValues.primaryColor, ";\n }\n "),
|
|
50619
|
-
checkboxMargin: "0.3rem",
|
|
50620
|
-
role: "option",
|
|
50621
|
-
checkboxExtraStyles: "\n width: 1.375rem; \n height: 1.375rem; \n ".concat(checked && !isDisabled ? "background: " + themeValues.secondaryColor + ";" : ""),
|
|
50622
50859
|
tabIndex: tabIndex,
|
|
50623
|
-
|
|
50624
|
-
|
|
50860
|
+
name: name,
|
|
50861
|
+
themeValues: themeValues
|
|
50862
|
+
});
|
|
50625
50863
|
}));
|
|
50626
50864
|
};
|
|
50627
|
-
var
|
|
50628
|
-
|
|
50629
|
-
|
|
50630
|
-
|
|
50631
|
-
|
|
50632
|
-
|
|
50633
|
-
|
|
50634
|
-
|
|
50635
|
-
|
|
50636
|
-
|
|
50637
|
-
|
|
50638
|
-
|
|
50639
|
-
|
|
50640
|
-
|
|
50641
|
-
|
|
50642
|
-
|
|
50643
|
-
|
|
50644
|
-
|
|
50645
|
-
|
|
50646
|
-
|
|
50647
|
-
|
|
50648
|
-
|
|
50649
|
-
|
|
50650
|
-
|
|
50651
|
-
|
|
50652
|
-
|
|
50653
|
-
|
|
50654
|
-
|
|
50865
|
+
var FilterableList$1 = /*#__PURE__*/React__default.memo(FilterableList);
|
|
50866
|
+
|
|
50867
|
+
var MultipleSelectFilter = function MultipleSelectFilter(_ref) {
|
|
50868
|
+
var actions = _ref.actions,
|
|
50869
|
+
autocompleteValue = _ref.autocompleteValue,
|
|
50870
|
+
btnContentOverride = _ref.btnContentOverride,
|
|
50871
|
+
disabled = _ref.disabled,
|
|
50872
|
+
extraStyles = _ref.extraStyles,
|
|
50873
|
+
fields = _ref.fields,
|
|
50874
|
+
filterLabel = _ref.filterLabel,
|
|
50875
|
+
_ref$hasIcon = _ref.hasIcon,
|
|
50876
|
+
hasIcon = _ref$hasIcon === void 0 ? false : _ref$hasIcon,
|
|
50877
|
+
Icon = _ref.icon,
|
|
50878
|
+
maxSelections = _ref.maxSelections,
|
|
50879
|
+
_ref$name = _ref.name,
|
|
50880
|
+
name = _ref$name === void 0 ? "MultipleSelectFilter" : _ref$name,
|
|
50881
|
+
_ref$onApply = _ref.onApply,
|
|
50882
|
+
onApply = _ref$onApply === void 0 ? noop$1 : _ref$onApply,
|
|
50883
|
+
_ref$onClear = _ref.onClear,
|
|
50884
|
+
onClear = _ref$onClear === void 0 ? noop$1 : _ref$onClear,
|
|
50885
|
+
options = _ref.options,
|
|
50886
|
+
_ref$placeholder = _ref.placeholder,
|
|
50887
|
+
placeholder = _ref$placeholder === void 0 ? "Search" : _ref$placeholder,
|
|
50888
|
+
_ref$searchable = _ref.searchable,
|
|
50889
|
+
searchable = _ref$searchable === void 0 ? true : _ref$searchable,
|
|
50890
|
+
selectedOptions = _ref.selectedOptions,
|
|
50891
|
+
setSelectedOptions = _ref.setSelectedOptions,
|
|
50892
|
+
themeValues = _ref.themeValues,
|
|
50893
|
+
_ref$truncateBtnTextW = _ref.truncateBtnTextWidth,
|
|
50894
|
+
truncateBtnTextWidth = _ref$truncateBtnTextW === void 0 ? "15rem" : _ref$truncateBtnTextW;
|
|
50895
|
+
var _useState = React.useState(false),
|
|
50896
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
50897
|
+
opened = _useState2[0],
|
|
50898
|
+
setOpened = _useState2[1];
|
|
50655
50899
|
var _useState3 = React.useState([]),
|
|
50656
50900
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
50657
|
-
|
|
50658
|
-
|
|
50659
|
-
var _useState5 = React.useState(false),
|
|
50660
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
50661
|
-
opened = _useState6[0],
|
|
50662
|
-
setOpened = _useState6[1];
|
|
50901
|
+
appliedOptions = _useState4[0],
|
|
50902
|
+
setAppliedOptions = _useState4[1];
|
|
50663
50903
|
var containerRef = React.useRef(null);
|
|
50664
50904
|
var dropdownRef = React.useRef(null);
|
|
50665
50905
|
var filterButtonRef = React.useRef(null);
|
|
50666
50906
|
var applyFilterButtonRef = React.useRef(null);
|
|
50667
50907
|
var filterDropdownID = "".concat(name, "-filter-dropdown");
|
|
50668
50908
|
var checkboxListID = "".concat(name, "-checkbox-list");
|
|
50669
|
-
var backgroundColor = opened ? themeValues.primaryColor : selectedOptions !== null && selectedOptions !== void 0 && selectedOptions.length ? themeValues.secondaryColor : WHITE;
|
|
50670
|
-
var contentColor = !opened && selectedOptions !== null && selectedOptions !== void 0 && selectedOptions.length ? WHITE : "#292A33";
|
|
50671
|
-
var completeOptionsList = itemList.slice().sort(function (a, b) {
|
|
50672
|
-
return a.name.toLowerCase().localeCompare(b.name.toLowerCase());
|
|
50673
|
-
});
|
|
50674
|
-
var selectValues = function selectValues(items) {
|
|
50675
|
-
return items.map(function (item) {
|
|
50676
|
-
return item.value;
|
|
50677
|
-
});
|
|
50678
|
-
};
|
|
50679
|
-
var selectOption = function selectOption(selectedOption) {
|
|
50680
|
-
if (selectValues(selectedOptions).includes(selectedOption.value)) {
|
|
50681
|
-
var fewerOptions = selectedOptions.filter(function (option) {
|
|
50682
|
-
return option.value !== selectedOption.value;
|
|
50683
|
-
});
|
|
50684
|
-
setSelectedOptions(fewerOptions);
|
|
50685
|
-
} else {
|
|
50686
|
-
var moreOptions = selectedOptions.concat(selectedOption);
|
|
50687
|
-
setSelectedOptions(moreOptions);
|
|
50688
|
-
}
|
|
50689
|
-
};
|
|
50690
|
-
React.useEffect(function () {
|
|
50691
|
-
return setItemList(options);
|
|
50692
|
-
}, [options]);
|
|
50693
50909
|
React.useEffect(function () {
|
|
50694
|
-
|
|
50695
|
-
|
|
50696
|
-
|
|
50697
|
-
});
|
|
50698
|
-
// If no items are filtered, display the entire list of options.
|
|
50699
|
-
if (filteredItems !== null && filteredItems !== void 0 && filteredItems.length) {
|
|
50700
|
-
setItemList(filteredItems);
|
|
50701
|
-
} else {
|
|
50702
|
-
setItemList(options);
|
|
50910
|
+
if (!opened) {
|
|
50911
|
+
onApply(selectedOptions);
|
|
50912
|
+
setAppliedOptions(selectedOptions);
|
|
50703
50913
|
}
|
|
50704
|
-
}, [
|
|
50914
|
+
}, [opened]);
|
|
50705
50915
|
React.useEffect(function () {
|
|
50706
50916
|
var handleKeyDown = function handleKeyDown(event) {
|
|
50707
50917
|
if (event.key === "Escape") {
|
|
@@ -50735,97 +50945,64 @@ var MultipleSelectFilter = function MultipleSelectFilter(_ref2) {
|
|
|
50735
50945
|
return /*#__PURE__*/React__default.createElement(FilterContainer, {
|
|
50736
50946
|
ref: containerRef,
|
|
50737
50947
|
extraStyles: "".concat(extraStyles)
|
|
50738
|
-
}, /*#__PURE__*/React__default.createElement(FilterButton, {
|
|
50948
|
+
}, /*#__PURE__*/React__default.createElement(FilterButton$1, {
|
|
50739
50949
|
ref: filterButtonRef,
|
|
50740
|
-
|
|
50950
|
+
btnContentOverride: btnContentOverride,
|
|
50741
50951
|
action: function action() {
|
|
50742
50952
|
actions.fields.searchTerm.set("");
|
|
50743
50953
|
setOpened(!opened);
|
|
50744
50954
|
},
|
|
50745
|
-
|
|
50746
|
-
|
|
50747
|
-
"
|
|
50748
|
-
|
|
50749
|
-
|
|
50750
|
-
|
|
50751
|
-
|
|
50752
|
-
|
|
50753
|
-
|
|
50754
|
-
|
|
50755
|
-
|
|
50756
|
-
},
|
|
50757
|
-
intrinsic: true
|
|
50758
|
-
}, hasIcon && /*#__PURE__*/React__default.createElement(Icon, {
|
|
50759
|
-
color: contentColor
|
|
50760
|
-
}), /*#__PURE__*/React__default.createElement(Center, {
|
|
50761
|
-
as: "span",
|
|
50762
|
-
style: {
|
|
50763
|
-
display: "flex",
|
|
50764
|
-
flexDirection: "row",
|
|
50765
|
-
padding: "0 0.5rem 0 0.25rem"
|
|
50766
|
-
},
|
|
50767
|
-
intrinsic: true
|
|
50768
|
-
}, /*#__PURE__*/React__default.createElement(Text$1, {
|
|
50769
|
-
variant: "pS",
|
|
50770
|
-
color: contentColor,
|
|
50771
|
-
extraStyles: "\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n ".concat(truncateBtnTextWidth && "max-width:" + truncateBtnTextWidth, "\n ")
|
|
50772
|
-
}, selectedOptions !== null && selectedOptions !== void 0 && selectedOptions.length ? "".concat(filterLabel ? filterLabel + ": " : "").concat(selectedOptions[0].name) : "".concat(filterLabel ? filterLabel : "")), /*#__PURE__*/React__default.createElement(Text$1, {
|
|
50773
|
-
color: contentColor,
|
|
50774
|
-
variant: "pS"
|
|
50775
|
-
}, selectedOptions !== null && selectedOptions !== void 0 && selectedOptions.length && (selectedOptions === null || selectedOptions === void 0 ? void 0 : selectedOptions.length) > 1 ? ", +".concat((selectedOptions === null || selectedOptions === void 0 ? void 0 : selectedOptions.length) - 1, " More") : "")), /*#__PURE__*/React__default.createElement(DropdownIconV2, {
|
|
50776
|
-
color: contentColor
|
|
50777
|
-
}))), /*#__PURE__*/React__default.createElement(FilterDropdown, {
|
|
50955
|
+
opened: opened,
|
|
50956
|
+
backgroundColor: opened ? themeValues.primaryColor : selectedOptions !== null && selectedOptions !== void 0 && selectedOptions.length ? themeValues.secondaryColor : WHITE,
|
|
50957
|
+
contentColor: !opened && selectedOptions !== null && selectedOptions !== void 0 && selectedOptions.length ? WHITE : "#292A33",
|
|
50958
|
+
name: name,
|
|
50959
|
+
filterDropdownID: filterDropdownID,
|
|
50960
|
+
hasIcon: hasIcon,
|
|
50961
|
+
icon: Icon,
|
|
50962
|
+
truncateBtnTextWidth: truncateBtnTextWidth,
|
|
50963
|
+
filterLabel: filterLabel,
|
|
50964
|
+
selectedOptions: selectedOptions
|
|
50965
|
+
}), /*#__PURE__*/React__default.createElement(FilterDropdown, {
|
|
50778
50966
|
id: filterDropdownID,
|
|
50779
50967
|
ref: dropdownRef,
|
|
50780
|
-
|
|
50781
|
-
|
|
50782
|
-
|
|
50783
|
-
|
|
50784
|
-
"aria-owns": checkboxListID
|
|
50785
|
-
}, /*#__PURE__*/React__default.createElement(Box, {
|
|
50786
|
-
padding: "0 0 0.5rem"
|
|
50787
|
-
}, searchable && (options === null || options === void 0 ? void 0 : options.length) > 8 && /*#__PURE__*/React__default.createElement(FormInput$1, {
|
|
50968
|
+
ariaOwns: checkboxListID,
|
|
50969
|
+
opened: opened
|
|
50970
|
+
}, /*#__PURE__*/React__default.createElement(SearchBox, {
|
|
50971
|
+
showSearchBox: searchable && (options === null || options === void 0 ? void 0 : options.length) > 8,
|
|
50788
50972
|
autocompleteValue: autocompleteValue,
|
|
50789
|
-
|
|
50790
|
-
|
|
50791
|
-
field: fields.searchTerm,
|
|
50792
|
-
fieldActions: actions.fields.searchTerm,
|
|
50973
|
+
fields: fields,
|
|
50974
|
+
actions: actions,
|
|
50793
50975
|
placeholder: placeholder,
|
|
50794
|
-
disabled: disabled
|
|
50795
|
-
|
|
50796
|
-
})), /*#__PURE__*/React__default.createElement(ScrollableOptionsList, {
|
|
50976
|
+
disabled: disabled
|
|
50977
|
+
}), /*#__PURE__*/React__default.createElement(FilterableList$1, {
|
|
50797
50978
|
id: checkboxListID,
|
|
50798
|
-
|
|
50799
|
-
|
|
50979
|
+
options: options,
|
|
50980
|
+
appliedOptions: appliedOptions,
|
|
50800
50981
|
themeValues: themeValues,
|
|
50801
|
-
|
|
50982
|
+
selectedOptions: selectedOptions,
|
|
50802
50983
|
maxSelections: maxSelections,
|
|
50803
|
-
name: name
|
|
50984
|
+
name: name,
|
|
50985
|
+
setSelectedOptions: setSelectedOptions,
|
|
50986
|
+
searchTerm: fields === null || fields === void 0 ? void 0 : fields.searchTerm
|
|
50804
50987
|
}), /*#__PURE__*/React__default.createElement(Box, {
|
|
50805
50988
|
padding: "0 0.5rem 0.0625rem 0.5rem",
|
|
50806
50989
|
extraStyles: "\n max-height: 100px; \n display: flex; \n flex-flow: row; \n justify-content: space-between;\n border-top: 1px solid ".concat(GHOST_GREY, ";\n ")
|
|
50807
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
50990
|
+
}, /*#__PURE__*/React__default.createElement(ActionLinkButton, {
|
|
50808
50991
|
action: function action() {
|
|
50809
50992
|
setOpened(false);
|
|
50810
50993
|
setSelectedOptions([]);
|
|
50811
50994
|
actions.fields.searchTerm.set("");
|
|
50812
50995
|
onClear();
|
|
50813
50996
|
},
|
|
50814
|
-
variant: "tertiary",
|
|
50815
|
-
extraStyles: "\n padding: 0.2rem; \n margin: 0.5rem; \n min-height: auto; \n min-width: auto;\n ",
|
|
50816
|
-
textExtraStyles: "font-weight: ".concat(FONT_WEIGHT_REGULAR, ";"),
|
|
50817
50997
|
text: "Clear",
|
|
50818
50998
|
dataQa: "".concat(name, "-clear-filters")
|
|
50819
|
-
}), /*#__PURE__*/React__default.createElement(
|
|
50999
|
+
}), /*#__PURE__*/React__default.createElement(ActionLinkButton, {
|
|
50820
51000
|
ref: applyFilterButtonRef,
|
|
50821
51001
|
action: function action() {
|
|
50822
51002
|
setOpened(false);
|
|
50823
51003
|
actions.fields.searchTerm.set("");
|
|
50824
51004
|
onApply(selectedOptions);
|
|
50825
51005
|
},
|
|
50826
|
-
variant: "tertiary",
|
|
50827
|
-
extraStyles: "\n padding: 0.2rem; \n margin: 0.5rem; \n min-height: auto; \n min-width: auto;\n ",
|
|
50828
|
-
textExtraStyles: "font-weight: ".concat(FONT_WEIGHT_REGULAR, ";"),
|
|
50829
51006
|
text: "Apply",
|
|
50830
51007
|
dataQa: "".concat(name, "-apply-filters")
|
|
50831
51008
|
}))));
|