intelicoreact 1.6.22 → 1.6.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Atomic/FormElements/ActionAlert/ActionAlert.js +98 -1
- package/dist/Atomic/FormElements/AdvancedStatus/AdvancedStatus.js +48 -1
- package/dist/Atomic/FormElements/Calendar/Calendar.js +249 -1
- package/dist/Atomic/FormElements/Calendar/Calendar.props.js +4 -1
- package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.js +65 -1
- package/dist/Atomic/FormElements/CheckboxesLine/CheckboxesLine.js +52 -1
- package/dist/Atomic/FormElements/Datepicker/Datepicker.js +424 -1
- package/dist/Atomic/FormElements/Datepicker/Datepicker.props.js +4 -1
- package/dist/Atomic/FormElements/Datepicker/components/DatepickerCalendar.js +173 -1
- package/dist/Atomic/FormElements/Datepicker/components/DatepickerCalendar.props.js +4 -1
- package/dist/Atomic/FormElements/Dropdown/Dropdown.js +735 -1
- package/dist/Atomic/FormElements/Dropdown/components/DropdownLoader.js +20 -1
- package/dist/Atomic/FormElements/DropdownLiveSearch/DropdownLiveSearch.js +529 -1
- package/dist/Atomic/FormElements/FileLoader/FileLoader.js +94 -1
- package/dist/Atomic/FormElements/FileLoader/partial/LoadZone.js +105 -1
- package/dist/Atomic/FormElements/FileLoader/partial/LoadedContent.js +67 -1
- package/dist/Atomic/FormElements/FileLoaderDescription/FileLoaderDescription.js +247 -1
- package/dist/Atomic/FormElements/FileLoaderLocal/FileLoaderLocal.js +160 -1
- package/dist/Atomic/FormElements/FileLoaderLocalGroup/FileLoaderLocalGroup.js +193 -1
- package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN.js +135 -1
- package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN_old.js +116 -1
- package/dist/Atomic/FormElements/Input/Input.js +467 -1
- package/dist/Atomic/FormElements/InputCalendar/InputCalendar.js +161 -1
- package/dist/Atomic/FormElements/InputColor/InputColor.js +64 -1
- package/dist/Atomic/FormElements/InputCurrency/InputCurrency.js +200 -1
- package/dist/Atomic/FormElements/InputDateRange/InputDateRange.js +354 -1
- package/dist/Atomic/FormElements/InputDateRange/components/DateInput.js +71 -1
- package/dist/Atomic/FormElements/InputDateRange/components/Datepicker.js +693 -1
- package/dist/Atomic/FormElements/InputDateRange/components/OpenedPart.js +254 -1
- package/dist/Atomic/FormElements/InputDateRange/components/SelectItem.js +32 -1
- package/dist/Atomic/FormElements/InputDateRange/dependencies.js +200 -1
- package/dist/Atomic/FormElements/InputLink/InputLink.js +99 -1
- package/dist/Atomic/FormElements/InputMask/InputCarretPosition.js +37 -1
- package/dist/Atomic/FormElements/InputMask/InputMask.js +1214 -1
- package/dist/Atomic/FormElements/InputMask/config.js +15 -1
- package/dist/Atomic/FormElements/InputMask/functions.js +58 -1
- package/dist/Atomic/FormElements/InputMask2/InputMask2.js +674 -1
- package/dist/Atomic/FormElements/InputMask2/config.js +15 -1
- package/dist/Atomic/FormElements/InputMask2/functions.js +58 -1
- package/dist/Atomic/FormElements/InputMask3/InputMask3.js +766 -1
- package/dist/Atomic/FormElements/InputMask3/config.js +15 -1
- package/dist/Atomic/FormElements/InputMask3/functions.js +58 -1
- package/dist/Atomic/FormElements/InputWithAction/InputWithAction.js +114 -1
- package/dist/Atomic/FormElements/InputsRow/InputsRow.js +140 -1
- package/dist/Atomic/FormElements/Label/Label.js +87 -1
- package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.js +506 -1
- package/dist/Atomic/FormElements/MultiSelect/MultiSelect.js +45 -1
- package/dist/Atomic/FormElements/NumericInput/NumericInput.js +331 -1
- package/dist/Atomic/FormElements/RadioGroup/RadioGroup.js +66 -1
- package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.js +80 -1
- package/dist/Atomic/FormElements/RadioInput/RadioInput.js +57 -1
- package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.js +54 -1
- package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.js +183 -1
- package/dist/Atomic/FormElements/RangeInputs/RangeInputs.js +222 -1
- package/dist/Atomic/FormElements/RangeList/RangeList.js +175 -1
- package/dist/Atomic/FormElements/RangeList/partial/RangeListRow.js +43 -1
- package/dist/Atomic/FormElements/RangeSlider/RangeSlider.js +443 -1
- package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.js +858 -1
- package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.js +39 -1
- package/dist/Atomic/FormElements/Switcher/Switcher.js +59 -1
- package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.js +50 -1
- package/dist/Atomic/FormElements/SwitcherHide/SwitcherHide.js +44 -1
- package/dist/Atomic/FormElements/SwitcherRadio/SwitcherRadio.js +100 -1
- package/dist/Atomic/FormElements/SwitcherRange/SwitcherRange.js +52 -1
- package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.js +64 -1
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.js +170 -1
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/partial/States.js +202 -1
- package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.js +67 -1
- package/dist/Atomic/FormElements/TagListToDropdown/TagListToDropdown.js +115 -1
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.interface.ts +2 -2
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.js +1110 -1
- package/dist/Atomic/FormElements/Text/Text.js +125 -1
- package/dist/Atomic/FormElements/TextSwitcher/TextSwitcher.js +49 -1
- package/dist/Atomic/FormElements/Textarea/Textarea.js +80 -1
- package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.js +176 -1
- package/dist/Atomic/FormElements/TieredCheckboxes/partial/AccordionWithCheckbox.js +62 -1
- package/dist/Atomic/FormElements/TimeRange/TimeRange.js +119 -1
- package/dist/Atomic/FormElements/UserContacts/UserContacts.js +188 -1
- package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.js +83 -1
- package/dist/Atomic/FormElements/VariantsListRadio/partials/VariantsListRadioItem.js +82 -1
- package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.js +101 -1
- package/dist/Atomic/FormElements/WidgetPseudoTable/partial/constructor.js +29 -1
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.js +113 -1
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/partial/constructor.js +30 -1
- package/dist/Atomic/Layout/Header/Header.js +85 -1
- package/dist/Atomic/Layout/Spinner/Spinner.js +44 -1
- package/dist/Atomic/UI/Accordion/Accordion.js +108 -1
- package/dist/Atomic/UI/Accordion/AccordionItem.js +176 -1
- package/dist/Atomic/UI/AccordionTable/AccordionTable.js +238 -1
- package/dist/Atomic/UI/AccordionText/AccordionText.js +69 -1
- package/dist/Atomic/UI/AdvancedTag/AdvTag.js +207 -1
- package/dist/Atomic/UI/AdvancedTag/AdvancedTags.js +56 -1
- package/dist/Atomic/UI/Alert/Alert.js +72 -1
- package/dist/Atomic/UI/Arrow/Arrow.js +132 -1
- package/dist/Atomic/UI/Box/Box.js +52 -1
- package/dist/Atomic/UI/Button/Button.js +47 -1
- package/dist/Atomic/UI/ButtonsBar/ButtonsBar.js +72 -1
- package/dist/Atomic/UI/Chart/Chart.js +172 -1
- package/dist/Atomic/UI/Chart/partial/Chart.constants.js +95 -1
- package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.js +80 -1
- package/dist/Atomic/UI/Chart/partial/datasetSetters.js +188 -1
- package/dist/Atomic/UI/Chart/partial/optionsConstructor.js +335 -1
- package/dist/Atomic/UI/Chart/partial/optionsSetters.js +43 -1
- package/dist/Atomic/UI/Chart/partial/utils.js +60 -1
- package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.js +109 -1
- package/dist/Atomic/UI/DateTime/DateTime.js +57 -1
- package/dist/Atomic/UI/DebugContainer/DebugContainer.js +44 -1
- package/dist/Atomic/UI/DebugContainer/useDebugContainer.js +15 -1
- package/dist/Atomic/UI/DoubleString/DoubleString.js +102 -1
- package/dist/Atomic/UI/DynamicIcon/DynamicIcon.js +70 -1
- package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.js +221 -1
- package/dist/Atomic/UI/ExampleChartIntegration/partial/utils.js +106 -1
- package/dist/Atomic/UI/Hint/Hint.js +256 -1
- package/dist/Atomic/UI/Hint/partials/_utils.js +64 -1
- package/dist/Atomic/UI/Modal/Modal.js +179 -1
- package/dist/Atomic/UI/Modal/ModalHOC.js +97 -1
- package/dist/Atomic/UI/Modal/partials/ModalFooter.js +71 -1
- package/dist/Atomic/UI/Modal/partials/ModalTitle.js +110 -1
- package/dist/Atomic/UI/Modal/partials/useMobileModal.js +192 -1
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion._test.js +75 -1
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion.js +80 -1
- package/dist/Atomic/UI/NavLine/NavLine.js +317 -1
- package/dist/Atomic/UI/PageTitle/PageTitle.js +77 -1
- package/dist/Atomic/UI/PieChart/PieChart.js +42 -1
- package/dist/Atomic/UI/Price/Price.js +31 -1
- package/dist/Atomic/UI/PriceRange/PriceRange.js +44 -1
- package/dist/Atomic/UI/ProgressLine/ProgressLine.js +98 -1
- package/dist/Atomic/UI/Status/Status.js +67 -1
- package/dist/Atomic/UI/Table/Partials/TdCell.js +87 -1
- package/dist/Atomic/UI/Table/Partials/TdHeader.js +38 -1
- package/dist/Atomic/UI/Table/Partials/TdRow.js +99 -1
- package/dist/Atomic/UI/Table/Partials/TdTitle.js +52 -1
- package/dist/Atomic/UI/Table/Table.js +63 -1
- package/dist/Atomic/UI/Table/TdTypes/TdActions.js +80 -1
- package/dist/Atomic/UI/Table/TdTypes/TdPriority.js +28 -1
- package/dist/Atomic/UI/Table/TdTypes/TdRange.js +13 -1
- package/dist/Atomic/UI/Table/TdTypes/TdWeight.js +53 -1
- package/dist/Atomic/UI/Tag/Tag.js +167 -1
- package/dist/Atomic/UI/TagList/TagList.js +251 -1
- package/dist/Atomic/UI/UserBox/UserBox.js +86 -1
- package/dist/Atomic/UI/WizardStepper/constructor.js +84 -1
- package/dist/Atomic/UI/WizardStepper/index.js +3 -1
- package/dist/Atomic/UI/WizardStepper/ui/StateIcon/StateIcon.js +37 -1
- package/dist/Atomic/UI/WizardStepper/ui/StateIcon/index.js +3 -1
- package/dist/Atomic/UI/WizardStepper/ui/StepRow/StepRow.js +61 -1
- package/dist/Atomic/UI/WizardStepper/ui/StepRow/index.js +3 -1
- package/dist/Atomic/UI/WizardStepper/ui/StepWrapper/StepWrapper.js +39 -1
- package/dist/Atomic/UI/WizardStepper/ui/StepWrapper/index.js +3 -1
- package/dist/Atomic/UI/WizardStepper/ui/icons.js +49 -1
- package/dist/Atomic/UI/WizardStepper/ui/index.js +3 -1
- package/dist/Classes/AbortableFetch.js +454 -1
- package/dist/Classes/AnimatedHandler.js +47 -1
- package/dist/Classes/RESTAPI/index.js +228 -1
- package/dist/Classes/RESTAPI/partials/AbortableFetch.js +457 -1
- package/dist/Classes/RESTAPI/partials/ApiBase.js +48 -1
- package/dist/Classes/RESTAPI/partials/ApiRequestCreators.js +112 -1
- package/dist/Classes/RESTAPI/partials/ApiUtils.js +189 -1
- package/dist/Classes/RESTAPI/partials/CredentialsProcessing.js +252 -1
- package/dist/Classes/RESTAPI/partials/Utils.js +92 -1
- package/dist/Classes/RESTAPI/partials/_outerDependencies.js +3 -1
- package/dist/Classes/RESTAPI/partials/_utils.js +197 -1
- package/dist/Constants/index.constants.js +78 -1
- package/dist/Functions/Portal.js +22 -1
- package/dist/Functions/customEventListener.js +96 -1
- package/dist/Functions/dateTime.js +149 -1
- package/dist/Functions/fieldValueFormatters.js +405 -1
- package/dist/Functions/guards/assertions.js +294 -1
- package/dist/Functions/guards/safeValue.js +75 -1
- package/dist/Functions/guards/typeGuards.js +373 -1
- package/dist/Functions/hooks/useFormFieldsChangesManager.js +95 -1
- package/dist/Functions/locale/createTranslator.js +32 -1
- package/dist/Functions/operations.js +130 -1
- package/dist/Functions/presets/inputMaskPresets.js +170 -1
- package/dist/Functions/presets/inputPresets.js +60 -1
- package/dist/Functions/presets/mobileKeyboardTypesPresets.js +45 -1
- package/dist/Functions/schemas.js +31 -1
- package/dist/Functions/useBodyScrollLock.js +17 -1
- package/dist/Functions/useClickOutside.js +15 -1
- package/dist/Functions/useDebounce.js +17 -1
- package/dist/Functions/useFieldFocus.js +84 -1
- package/dist/Functions/useFormTools/form-drivers/ArrayWithObjects.js +39 -1
- package/dist/Functions/useFormTools/form-drivers/ObjectWithIterableObjects.js +159 -1
- package/dist/Functions/useFormTools/form-drivers/ObjectWithNamedKeyObjects.js +78 -1
- package/dist/Functions/useFormTools/functions/General.js +134 -1
- package/dist/Functions/useFormTools/functions/RenderFields.js +111 -1
- package/dist/Functions/useFormTools/functions/usePrevious.js +12 -1
- package/dist/Functions/useFormTools/index.js +778 -1
- package/dist/Functions/useInputHighlightError.js +67 -1
- package/dist/Functions/useIsMobile/useIsMobile.js +33 -1
- package/dist/Functions/useKeyPress/useHandleKeyPress.js +52 -1
- package/dist/Functions/useKeyPress/useKeyPress.js +52 -1
- package/dist/Functions/useLocalStorage.js +34 -1
- package/dist/Functions/useLocationParams.js +27 -1
- package/dist/Functions/useMediaQuery.js +17 -1
- package/dist/Functions/useMetaInfo.js +43 -1
- package/dist/Functions/useMouseUpOutside.js +16 -1
- package/dist/Functions/useOnlineStatus.js +29 -1
- package/dist/Functions/usePasswordChecker.js +110 -1
- package/dist/Functions/usePrevious.js +12 -1
- package/dist/Functions/useResize.js +31 -1
- package/dist/Functions/useScrollTo.js +17 -1
- package/dist/Functions/useToggle.js +17 -1
- package/dist/Functions/utils.js +522 -1
- package/dist/Langs.js +168 -1
- package/dist/Molecular/CustomIcons/components/AffiliateNetworks.js +21 -1
- package/dist/Molecular/CustomIcons/components/AlertCircle.js +23 -1
- package/dist/Molecular/CustomIcons/components/AppStore.js +29 -1
- package/dist/Molecular/CustomIcons/components/Arrow.js +32 -1
- package/dist/Molecular/CustomIcons/components/ArrowDown.js +17 -1
- package/dist/Molecular/CustomIcons/components/ArrowLeft.js +22 -1
- package/dist/Molecular/CustomIcons/components/ArrowRight.js +22 -1
- package/dist/Molecular/CustomIcons/components/ArrowUp.js +17 -1
- package/dist/Molecular/CustomIcons/components/Bell.js +15 -1
- package/dist/Molecular/CustomIcons/components/Button.js +12 -1
- package/dist/Molecular/CustomIcons/components/Campaigns.js +16 -1
- package/dist/Molecular/CustomIcons/components/Check.js +14 -1
- package/dist/Molecular/CustomIcons/components/Check2.js +12 -1
- package/dist/Molecular/CustomIcons/components/ChevronDown.js +12 -1
- package/dist/Molecular/CustomIcons/components/ChevronDownDisabled.js +11 -1
- package/dist/Molecular/CustomIcons/components/ChevronLeft.js +11 -1
- package/dist/Molecular/CustomIcons/components/ChevronRight.js +11 -1
- package/dist/Molecular/CustomIcons/components/ChevronUp.js +11 -1
- package/dist/Molecular/CustomIcons/components/ChevronUpDown.js +27 -1
- package/dist/Molecular/CustomIcons/components/Close.js +14 -1
- package/dist/Molecular/CustomIcons/components/ColumnsOrder.js +17 -1
- package/dist/Molecular/CustomIcons/components/Delete.js +16 -1
- package/dist/Molecular/CustomIcons/components/Edit.js +15 -1
- package/dist/Molecular/CustomIcons/components/Email.js +31 -1
- package/dist/Molecular/CustomIcons/components/FinturfLogo.js +18 -1
- package/dist/Molecular/CustomIcons/components/FinturfLogo2.js +35 -1
- package/dist/Molecular/CustomIcons/components/Flows.js +15 -1
- package/dist/Molecular/CustomIcons/components/Gift.js +25 -1
- package/dist/Molecular/CustomIcons/components/GoogleAuth.js +29 -1
- package/dist/Molecular/CustomIcons/components/GooglePlay.js +29 -1
- package/dist/Molecular/CustomIcons/components/HelpCircle.js +19 -1
- package/dist/Molecular/CustomIcons/components/HelpCircle2.js +20 -1
- package/dist/Molecular/CustomIcons/components/HelpCircleFilled.js +19 -1
- package/dist/Molecular/CustomIcons/components/Home.js +16 -1
- package/dist/Molecular/CustomIcons/components/Home2.js +22 -1
- package/dist/Molecular/CustomIcons/components/Key.js +23 -1
- package/dist/Molecular/CustomIcons/components/Landers.js +20 -1
- package/dist/Molecular/CustomIcons/components/Lock.js +15 -1
- package/dist/Molecular/CustomIcons/components/Mail.js +26 -1
- package/dist/Molecular/CustomIcons/components/Mastercard.js +73 -1
- package/dist/Molecular/CustomIcons/components/Minus.js +25 -1
- package/dist/Molecular/CustomIcons/components/Offers.js +16 -1
- package/dist/Molecular/CustomIcons/components/Pause.js +28 -1
- package/dist/Molecular/CustomIcons/components/PayPal.js +41 -1
- package/dist/Molecular/CustomIcons/components/PayPalLightLarge.js +28 -1
- package/dist/Molecular/CustomIcons/components/Phone.js +30 -1
- package/dist/Molecular/CustomIcons/components/Play.js +25 -1
- package/dist/Molecular/CustomIcons/components/Plus.js +25 -1
- package/dist/Molecular/CustomIcons/components/Profile.js +16 -1
- package/dist/Molecular/CustomIcons/components/QRCode.js +29 -1
- package/dist/Molecular/CustomIcons/components/Rectangle.js +12 -1
- package/dist/Molecular/CustomIcons/components/Revert.js +13 -1
- package/dist/Molecular/CustomIcons/components/Star.js +14 -1
- package/dist/Molecular/CustomIcons/components/Star2.js +16 -1
- package/dist/Molecular/CustomIcons/components/TrafficSources.js +14 -1
- package/dist/Molecular/CustomIcons/components/Trash.js +15 -1
- package/dist/Molecular/CustomIcons/components/TrashRed.js +15 -1
- package/dist/Molecular/CustomIcons/components/Triggers.js +15 -1
- package/dist/Molecular/CustomIcons/components/User.js +25 -1
- package/dist/Molecular/CustomIcons/components/Visa.js +31 -1
- package/dist/Molecular/CustomIcons/components/X.js +12 -1
- package/dist/Molecular/CustomIcons/index.js +61 -1
- package/dist/Molecular/FormElement/FormElement.js +54 -1
- package/dist/Molecular/FormWithDependOn/FormWithDependOn.js +184 -1
- package/dist/Molecular/FormWithDependOn/partials/_utils.js +53 -1
- package/dist/Molecular/InputAddress/InputAddress.js +626 -1
- package/dist/Molecular/InputPassword/InputPassword.js +48 -1
- package/dist/index.js +104 -1
- package/package.json +1 -1
- package/dist/Molecular/InputAddress/InputAddress.d.ts +0 -26
- package/dist/Molecular/InputAddress/InputAddress.js.map +0 -1
|
@@ -1 +1,39 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
import cn from "classnames";
|
|
4
|
+
|
|
5
|
+
import Switcher from "../Switcher/Switcher";
|
|
6
|
+
|
|
7
|
+
import "./SwitchableRow.scss";
|
|
8
|
+
|
|
9
|
+
const RC_default = "switchable-row";
|
|
10
|
+
|
|
11
|
+
const SwitchableRow = (props) => {
|
|
12
|
+
const {
|
|
13
|
+
RC = RC_default,
|
|
14
|
+
className,
|
|
15
|
+
children,
|
|
16
|
+
isActive,
|
|
17
|
+
setIsActive,
|
|
18
|
+
switcherLabel,
|
|
19
|
+
isSwitcherLabelBold,
|
|
20
|
+
testId = RC_default,
|
|
21
|
+
} = props || {};
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<div className={cn(RC, className)} data-testid={testId}>
|
|
25
|
+
<div className={cn(`${RC}__cell`)}>
|
|
26
|
+
<Switcher
|
|
27
|
+
isActive={isActive}
|
|
28
|
+
onChange={setIsActive}
|
|
29
|
+
isLabelBold={isSwitcherLabelBold}
|
|
30
|
+
label={switcherLabel}
|
|
31
|
+
data-testid={`${testId}-switcher`}
|
|
32
|
+
/>
|
|
33
|
+
</div>
|
|
34
|
+
{children}
|
|
35
|
+
</div>
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export default SwitchableRow;
|
|
@@ -1 +1,59 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return _default;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
12
|
+
const _classnames = /*#__PURE__*/ _interop_require_default(require("classnames"));
|
|
13
|
+
const _react = /*#__PURE__*/ _interop_require_default(require("react"));
|
|
14
|
+
const _Hint = /*#__PURE__*/ _interop_require_default(require("../../UI/Hint/Hint"));
|
|
15
|
+
require("./Switcher.scss");
|
|
16
|
+
function _interop_require_default(obj) {
|
|
17
|
+
return obj && obj.__esModule ? obj : {
|
|
18
|
+
default: obj
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
const RC = 'switcher';
|
|
22
|
+
const Switcher = ({ label, className, isActive, disabled, onChange, isLabelBold, hint, hintSide, testId = 'switcher' })=>{
|
|
23
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
24
|
+
"data-testid": testId,
|
|
25
|
+
className: (0, _classnames.default)(RC, className, {
|
|
26
|
+
[`${RC}_disabled`]: disabled
|
|
27
|
+
}),
|
|
28
|
+
children: [
|
|
29
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)("button", {
|
|
30
|
+
"data-testid": `${testId}-button`,
|
|
31
|
+
className: (0, _classnames.default)(`${RC}__button`),
|
|
32
|
+
disabled: disabled,
|
|
33
|
+
onClick: (e)=>onChange(!isActive, e),
|
|
34
|
+
children: [
|
|
35
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
36
|
+
className: (0, _classnames.default)(`${RC}__button-content`, {
|
|
37
|
+
[`${RC}__button-content_active`]: isActive
|
|
38
|
+
}),
|
|
39
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
40
|
+
className: `${RC}__ball`
|
|
41
|
+
})
|
|
42
|
+
}),
|
|
43
|
+
label && /*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
|
|
44
|
+
className: (0, _classnames.default)(`${RC}__label`, {
|
|
45
|
+
[`${RC}__label_bold`]: isLabelBold
|
|
46
|
+
}),
|
|
47
|
+
children: label
|
|
48
|
+
})
|
|
49
|
+
]
|
|
50
|
+
}),
|
|
51
|
+
hint && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Hint.default, {
|
|
52
|
+
className: `${RC}__hint`,
|
|
53
|
+
hint: hint,
|
|
54
|
+
side: hintSide
|
|
55
|
+
})
|
|
56
|
+
]
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
const _default = Switcher;
|
|
@@ -1 +1,50 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
import cn from "classnames";
|
|
4
|
+
|
|
5
|
+
import CheckboxesLine from "../CheckboxesLine/CheckboxesLine";
|
|
6
|
+
import Switcher from "../Switcher/Switcher";
|
|
7
|
+
|
|
8
|
+
import "./SwitcherCheckbox.scss";
|
|
9
|
+
|
|
10
|
+
const RC = "switcher-hide";
|
|
11
|
+
|
|
12
|
+
const SwitcherCheckbox = ({
|
|
13
|
+
label,
|
|
14
|
+
hint,
|
|
15
|
+
items = [],
|
|
16
|
+
value = [],
|
|
17
|
+
className,
|
|
18
|
+
isLabelBold,
|
|
19
|
+
isActive,
|
|
20
|
+
hintSide,
|
|
21
|
+
disabled,
|
|
22
|
+
hideChildren = true,
|
|
23
|
+
onSwitcherChange = () => {},
|
|
24
|
+
onChange = () => {},
|
|
25
|
+
}) => {
|
|
26
|
+
const renderCheckboxes = () => {
|
|
27
|
+
return <CheckboxesLine items={items} value={value} onChange={onChange} />;
|
|
28
|
+
};
|
|
29
|
+
return (
|
|
30
|
+
<div
|
|
31
|
+
className={cn(RC, className, {
|
|
32
|
+
[`${RC}_closed`]: !isActive,
|
|
33
|
+
[`${RC}_disabled`]: disabled,
|
|
34
|
+
})}
|
|
35
|
+
>
|
|
36
|
+
<Switcher
|
|
37
|
+
className={`${RC}__switcher`}
|
|
38
|
+
hintSide={hintSide}
|
|
39
|
+
label={label}
|
|
40
|
+
isActive={isActive}
|
|
41
|
+
onChange={(value) => onSwitcherChange(value)}
|
|
42
|
+
isLabelBold={isLabelBold}
|
|
43
|
+
hint={hint}
|
|
44
|
+
/>
|
|
45
|
+
{isActive ? renderCheckboxes() : !hideChildren ? renderCheckboxes() : ""}
|
|
46
|
+
</div>
|
|
47
|
+
);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export default SwitcherCheckbox;
|
|
@@ -1 +1,44 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return _default;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
12
|
+
const _classnames = /*#__PURE__*/ _interop_require_default(require("classnames"));
|
|
13
|
+
const _react = /*#__PURE__*/ _interop_require_default(require("react"));
|
|
14
|
+
const _Switcher = /*#__PURE__*/ _interop_require_default(require("../Switcher/Switcher"));
|
|
15
|
+
require("./SwitcherHide.scss");
|
|
16
|
+
function _interop_require_default(obj) {
|
|
17
|
+
return obj && obj.__esModule ? obj : {
|
|
18
|
+
default: obj
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
const RC = 'switcher-hide';
|
|
22
|
+
const SwitcherHide = ({ children, label, hint, className, isLabelBold, isActive, hintSide, disabled, onChange = ()=>{}, testId = RC })=>{
|
|
23
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
24
|
+
"data-testid": testId,
|
|
25
|
+
className: (0, _classnames.default)(RC, className, {
|
|
26
|
+
[`${RC}_closed`]: !isActive,
|
|
27
|
+
[`${RC}_disabled`]: disabled
|
|
28
|
+
}),
|
|
29
|
+
children: [
|
|
30
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_Switcher.default, {
|
|
31
|
+
testId: `${testId}-switcher`,
|
|
32
|
+
className: `${RC}__switcher`,
|
|
33
|
+
hintSide: hintSide,
|
|
34
|
+
label: label,
|
|
35
|
+
isActive: isActive,
|
|
36
|
+
onChange: (value, e)=>onChange(value, e),
|
|
37
|
+
isLabelBold: isLabelBold,
|
|
38
|
+
hint: hint
|
|
39
|
+
}),
|
|
40
|
+
isActive && children
|
|
41
|
+
]
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
const _default = SwitcherHide;
|
|
@@ -1 +1,100 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return _default;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
13
|
+
const _classnames = /*#__PURE__*/ _interop_require_default(require("classnames"));
|
|
14
|
+
const _RadioInput = /*#__PURE__*/ _interop_require_default(require("../RadioInput/RadioInput"));
|
|
15
|
+
const _SwitcherHide = /*#__PURE__*/ _interop_require_default(require("../SwitcherHide/SwitcherHide"));
|
|
16
|
+
require("./SwitcherRadio.scss");
|
|
17
|
+
function _interop_require_default(obj) {
|
|
18
|
+
return obj && obj.__esModule ? obj : {
|
|
19
|
+
default: obj
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
23
|
+
if (typeof WeakMap !== "function") return null;
|
|
24
|
+
var cacheBabelInterop = new WeakMap();
|
|
25
|
+
var cacheNodeInterop = new WeakMap();
|
|
26
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
27
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
28
|
+
})(nodeInterop);
|
|
29
|
+
}
|
|
30
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
31
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
32
|
+
return obj;
|
|
33
|
+
}
|
|
34
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
35
|
+
return {
|
|
36
|
+
default: obj
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
40
|
+
if (cache && cache.has(obj)) {
|
|
41
|
+
return cache.get(obj);
|
|
42
|
+
}
|
|
43
|
+
var newObj = {
|
|
44
|
+
__proto__: null
|
|
45
|
+
};
|
|
46
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
47
|
+
for(var key in obj){
|
|
48
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
49
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
50
|
+
if (desc && (desc.get || desc.set)) {
|
|
51
|
+
Object.defineProperty(newObj, key, desc);
|
|
52
|
+
} else {
|
|
53
|
+
newObj[key] = obj[key];
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
newObj.default = obj;
|
|
58
|
+
if (cache) {
|
|
59
|
+
cache.set(obj, newObj);
|
|
60
|
+
}
|
|
61
|
+
return newObj;
|
|
62
|
+
}
|
|
63
|
+
const RC = 'switcher-radio';
|
|
64
|
+
const SwitcherRadio = ({ options, label, hint, hintSide, isLabelBold, direction, className, value, disabled, isHideSwitcher = false, onChange = ()=>{}, isActive = true, setIsActive = ()=>{}, testId = '' })=>{
|
|
65
|
+
var _options_;
|
|
66
|
+
const safelyValue = value || (options === null || options === void 0 ? void 0 : (_options_ = options[0]) === null || _options_ === void 0 ? void 0 : _options_.value) || '';
|
|
67
|
+
const renderRadioGroup = ()=>{
|
|
68
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
69
|
+
className: (0, _classnames.default)(`${RC}__wrap`, {
|
|
70
|
+
[`switcher-radio_${direction}`]: direction
|
|
71
|
+
}, {
|
|
72
|
+
disabled
|
|
73
|
+
}, className),
|
|
74
|
+
children: options === null || options === void 0 ? void 0 : options.map((option, index)=>// @ts-ignore
|
|
75
|
+
/*#__PURE__*/ (0, _react.createElement)(_RadioInput.default, {
|
|
76
|
+
...option,
|
|
77
|
+
key: option.id || index,
|
|
78
|
+
className: "switcher-radio__radio",
|
|
79
|
+
checked: safelyValue,
|
|
80
|
+
onChange: (val)=>onChange(val)
|
|
81
|
+
}))
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
const renderSwitcher = (body)=>{
|
|
85
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_SwitcherHide.default, {
|
|
86
|
+
testId: `switcher-radio--${testId}`,
|
|
87
|
+
isActive: isActive,
|
|
88
|
+
label: label,
|
|
89
|
+
hint: hint,
|
|
90
|
+
hintSide: hintSide,
|
|
91
|
+
onChange: setIsActive,
|
|
92
|
+
isLabelBold: isLabelBold,
|
|
93
|
+
className: (0, _classnames.default)(RC, className),
|
|
94
|
+
disabled: disabled,
|
|
95
|
+
children: body
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
return !isHideSwitcher ? renderSwitcher(renderRadioGroup()) : renderRadioGroup();
|
|
99
|
+
};
|
|
100
|
+
const _default = SwitcherRadio;
|
|
@@ -1 +1,52 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return _default;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_default(require("react"));
|
|
13
|
+
const _RangeInputs = /*#__PURE__*/ _interop_require_default(require("../RangeInputs/RangeInputs"));
|
|
14
|
+
const _SwitcherHide = /*#__PURE__*/ _interop_require_default(require("../SwitcherHide/SwitcherHide"));
|
|
15
|
+
function _interop_require_default(obj) {
|
|
16
|
+
return obj && obj.__esModule ? obj : {
|
|
17
|
+
default: obj
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
const RC = 'switcher-range';
|
|
21
|
+
const SwitcherRange = ({ label, isLabelBold, hint, isActive, setIsActive, value, onChange, isInputsColumn, validateErrors, withZero, isPrice, inputsType, testId = RC })=>{
|
|
22
|
+
// const [error, setError] = useState("");
|
|
23
|
+
// const rangeValidation = () => {
|
|
24
|
+
// if (inputFrom && inputTo && inputFrom > inputTo) {
|
|
25
|
+
// setError("Invalid range");
|
|
26
|
+
// } else {
|
|
27
|
+
// setError("");
|
|
28
|
+
// }
|
|
29
|
+
// };
|
|
30
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_SwitcherHide.default, {
|
|
31
|
+
testId: testId,
|
|
32
|
+
label: label,
|
|
33
|
+
hint: hint,
|
|
34
|
+
className: RC,
|
|
35
|
+
isActive: isActive,
|
|
36
|
+
onChange: setIsActive,
|
|
37
|
+
isLabelBold: isLabelBold,
|
|
38
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_RangeInputs.default, {
|
|
39
|
+
testId: testId,
|
|
40
|
+
className: "switcher-range__range-inputs",
|
|
41
|
+
type: inputsType,
|
|
42
|
+
onChange: onChange,
|
|
43
|
+
value: value,
|
|
44
|
+
setError: ()=>{},
|
|
45
|
+
isColumnPosition: isInputsColumn,
|
|
46
|
+
validateErrors: validateErrors,
|
|
47
|
+
withZero: withZero,
|
|
48
|
+
isPrice: isPrice
|
|
49
|
+
})
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
const _default = SwitcherRange;
|
|
@@ -1 +1,64 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
import cn from "classnames";
|
|
4
|
+
|
|
5
|
+
import RangeList from "../RangeList/RangeList";
|
|
6
|
+
import SwitcherHide from "../SwitcherHide/SwitcherHide";
|
|
7
|
+
|
|
8
|
+
import "./SwitcherRangeList.scss";
|
|
9
|
+
|
|
10
|
+
const RC = "switcher-range-list";
|
|
11
|
+
|
|
12
|
+
const SwitcherRangeList = (props) => {
|
|
13
|
+
const {
|
|
14
|
+
className,
|
|
15
|
+
label,
|
|
16
|
+
isLabelBold,
|
|
17
|
+
hint,
|
|
18
|
+
hintSide,
|
|
19
|
+
disabled,
|
|
20
|
+
isActive,
|
|
21
|
+
value,
|
|
22
|
+
validateErrors,
|
|
23
|
+
isFloatValues,
|
|
24
|
+
decimalPlaces,
|
|
25
|
+
error,
|
|
26
|
+
defaultErrorText,
|
|
27
|
+
nullValueText,
|
|
28
|
+
isOnlyOneRow,
|
|
29
|
+
setIsActive = () => {},
|
|
30
|
+
onChange = () => {},
|
|
31
|
+
testId,
|
|
32
|
+
} = props;
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<SwitcherHide
|
|
36
|
+
isActive={isActive}
|
|
37
|
+
onChange={setIsActive}
|
|
38
|
+
label={label}
|
|
39
|
+
isLabelBold={isLabelBold}
|
|
40
|
+
hint={hint}
|
|
41
|
+
hintSide={hintSide}
|
|
42
|
+
className={cn(RC, className)}
|
|
43
|
+
disabled={disabled}
|
|
44
|
+
>
|
|
45
|
+
<div className="switcher-range-list__row">
|
|
46
|
+
<RangeList
|
|
47
|
+
testId={testId}
|
|
48
|
+
className={`${RC}__range-list`}
|
|
49
|
+
value={value}
|
|
50
|
+
isOnlyOneRow={isOnlyOneRow}
|
|
51
|
+
onChange={onChange}
|
|
52
|
+
validateErrors={validateErrors}
|
|
53
|
+
isFloatValues={isFloatValues}
|
|
54
|
+
decimalPlaces={decimalPlaces}
|
|
55
|
+
error={error}
|
|
56
|
+
defaultErrorText={defaultErrorText}
|
|
57
|
+
nullValueText={nullValueText}
|
|
58
|
+
/>
|
|
59
|
+
</div>
|
|
60
|
+
</SwitcherHide>
|
|
61
|
+
);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export default SwitcherRangeList;
|
|
@@ -1 +1,170 @@
|
|
|
1
|
-
|
|
1
|
+
import React, { useEffect, useMemo, useState } from "react";
|
|
2
|
+
|
|
3
|
+
import cn from "classnames";
|
|
4
|
+
|
|
5
|
+
import Button from "../../UI/Button/Button";
|
|
6
|
+
import SwitcherHide from "../SwitcherHide/SwitcherHide";
|
|
7
|
+
import TagsDropdown from "../TagsDropdown/TagsDropdown";
|
|
8
|
+
import TextSwitcher from "../TextSwitcher/TextSwitcher";
|
|
9
|
+
import Textarea from "../Textarea/Textarea";
|
|
10
|
+
|
|
11
|
+
import "./SwitcherTagsDropdown.scss";
|
|
12
|
+
|
|
13
|
+
const RC = "switcher-tags-dropdown";
|
|
14
|
+
|
|
15
|
+
const SwitcherTagsDropdown = ({
|
|
16
|
+
className,
|
|
17
|
+
label,
|
|
18
|
+
isLabelBold,
|
|
19
|
+
isValuesInTags,
|
|
20
|
+
isActive,
|
|
21
|
+
isIncluded,
|
|
22
|
+
isAdvancedLabelSearch,
|
|
23
|
+
disabled,
|
|
24
|
+
options = [],
|
|
25
|
+
chosenOptions = [],
|
|
26
|
+
setIsActive = () => {},
|
|
27
|
+
setIsIncluded = () => {},
|
|
28
|
+
onChange = () => {},
|
|
29
|
+
}) => {
|
|
30
|
+
const [listView, setListView] = useState(false);
|
|
31
|
+
const [textValue, setTextValue] = useState();
|
|
32
|
+
|
|
33
|
+
const singleLevelOptions = useMemo(
|
|
34
|
+
() =>
|
|
35
|
+
options.reduce(
|
|
36
|
+
(acc, item) => [...acc, ...(item.groupName ? item.list : [item])],
|
|
37
|
+
[],
|
|
38
|
+
),
|
|
39
|
+
[options],
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
const apply = () => {
|
|
43
|
+
// вернет функциюю сравнения для метода filter с замкнутым массивом listValuesArr
|
|
44
|
+
// (по логике listValuesArr - массив полученный из строки textaria).
|
|
45
|
+
const getFilterFunction = (listValuesArr) => (item) => {
|
|
46
|
+
return listValuesArr.find((el) => {
|
|
47
|
+
const itemValue = item?.value.toString().toLowerCase();
|
|
48
|
+
const itemLabel = (item.title || item.label || item.name || item.value)
|
|
49
|
+
.toString()
|
|
50
|
+
.toLowerCase();
|
|
51
|
+
const chosenOption = el.toString().toLowerCase();
|
|
52
|
+
const isChosenOptionIncludedInLabel =
|
|
53
|
+
itemLabel.includes(chosenOption) &&
|
|
54
|
+
!chosenOptions.includes(item.value);
|
|
55
|
+
|
|
56
|
+
if (isValuesInTags)
|
|
57
|
+
return (
|
|
58
|
+
(chosenOption === itemValue || chosenOption === itemLabel) &&
|
|
59
|
+
!item.disabled
|
|
60
|
+
);
|
|
61
|
+
else if (isAdvancedLabelSearch)
|
|
62
|
+
return (
|
|
63
|
+
(chosenOption === itemLabel ||
|
|
64
|
+
chosenOption === itemValue ||
|
|
65
|
+
isChosenOptionIncludedInLabel) &&
|
|
66
|
+
!item.disabled
|
|
67
|
+
);
|
|
68
|
+
else
|
|
69
|
+
return (
|
|
70
|
+
(chosenOption === itemLabel || chosenOption === itemValue) &&
|
|
71
|
+
!item.disabled
|
|
72
|
+
);
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
const textToArray = textValue
|
|
77
|
+
?.split?.(",")
|
|
78
|
+
.map((item) => item.toString().trim())
|
|
79
|
+
.filter((item) => Boolean(item));
|
|
80
|
+
const newOptions = options
|
|
81
|
+
.filter(getFilterFunction(textToArray))
|
|
82
|
+
.map((option) => option.value);
|
|
83
|
+
|
|
84
|
+
onChange(newOptions, "chosenOptions");
|
|
85
|
+
setListView(false);
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
const enterHandler = (e, value) => {
|
|
89
|
+
if (e.keyCode === 13) {
|
|
90
|
+
const option = options?.find(
|
|
91
|
+
(item) =>
|
|
92
|
+
item?.title?.toLowerCase() === value?.toLowerCase() && !item.disabled,
|
|
93
|
+
);
|
|
94
|
+
const isOptionChecked = chosenOptions?.some(
|
|
95
|
+
(item) => item?.title?.toLowerCase() === option?.title?.toLowerCase(),
|
|
96
|
+
);
|
|
97
|
+
if (option && !isOptionChecked)
|
|
98
|
+
onChange([...chosenOptions, option], "chosenOptions");
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
useEffect(() => {
|
|
103
|
+
const getLabel = (el) => el.title || el.label || el.name || el.value;
|
|
104
|
+
const valuesArr = chosenOptions?.map((item) =>
|
|
105
|
+
isValuesInTags
|
|
106
|
+
? item
|
|
107
|
+
: getLabel(singleLevelOptions.find((option) => option.value === item)),
|
|
108
|
+
);
|
|
109
|
+
setTextValue(valuesArr.join(", "));
|
|
110
|
+
}, [chosenOptions, listView]);
|
|
111
|
+
|
|
112
|
+
return (
|
|
113
|
+
<SwitcherHide
|
|
114
|
+
isActive={isActive}
|
|
115
|
+
onChange={setIsActive}
|
|
116
|
+
label={label}
|
|
117
|
+
className={cn(RC, className)}
|
|
118
|
+
isLabelBold={isLabelBold}
|
|
119
|
+
disabled={disabled}
|
|
120
|
+
>
|
|
121
|
+
<div className={`${RC}__wrap switcher-hide__content`}>
|
|
122
|
+
<TextSwitcher
|
|
123
|
+
activeText="is"
|
|
124
|
+
inactiveText="is not"
|
|
125
|
+
isActive={isIncluded ?? true}
|
|
126
|
+
onChange={setIsIncluded}
|
|
127
|
+
className={`${RC}__text-switcher`}
|
|
128
|
+
/>
|
|
129
|
+
<div className="filter-select__wrap--buttons">
|
|
130
|
+
<button
|
|
131
|
+
onClick={() => setListView(!listView)}
|
|
132
|
+
className={`${RC}__btn`}
|
|
133
|
+
>
|
|
134
|
+
{listView ? "Close" : "List view"}
|
|
135
|
+
</button>
|
|
136
|
+
{listView && (
|
|
137
|
+
<Button
|
|
138
|
+
label="Apply"
|
|
139
|
+
className={`${RC}__apply`}
|
|
140
|
+
onClick={() => apply()}
|
|
141
|
+
/>
|
|
142
|
+
)}
|
|
143
|
+
<button
|
|
144
|
+
onClick={() => onChange([], "chosenOptions")}
|
|
145
|
+
className={`${RC}__btn`}
|
|
146
|
+
>
|
|
147
|
+
Clear
|
|
148
|
+
</button>
|
|
149
|
+
</div>
|
|
150
|
+
</div>
|
|
151
|
+
{listView ? (
|
|
152
|
+
<Textarea value={textValue} onChange={(value) => setTextValue(value)} />
|
|
153
|
+
) : (
|
|
154
|
+
<TagsDropdown
|
|
155
|
+
options={options}
|
|
156
|
+
chosenOptions={chosenOptions}
|
|
157
|
+
onChange={onChange}
|
|
158
|
+
className={`${RC}__tags-dropdown`}
|
|
159
|
+
onKeyPress={(e, value) => enterHandler(e, value)}
|
|
160
|
+
tagClassname={cn(`${RC}__tag`, {
|
|
161
|
+
[`${RC}__tag_inactive`]: !isIncluded,
|
|
162
|
+
})}
|
|
163
|
+
isValuesInTags={isValuesInTags}
|
|
164
|
+
/>
|
|
165
|
+
)}
|
|
166
|
+
</SwitcherHide>
|
|
167
|
+
);
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
export default SwitcherTagsDropdown;
|