intelicoreact 1.4.76 → 1.4.78
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 +9 -1
- package/dist/Atomic/FormElements/AdvancedStatus/AdvancedStatus.js +10 -1
- package/dist/Atomic/FormElements/Calendar/Calendar.js +24 -4
- package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.js +10 -1
- package/dist/Atomic/FormElements/CheckboxesLine/CheckboxesLine.js +14 -2
- package/dist/Atomic/FormElements/Datepicker/Datepicker.js +54 -5
- package/dist/Atomic/FormElements/Datepicker/components/Calendar.js +21 -3
- package/dist/Atomic/FormElements/Dropdown/Dropdown.js +145 -52
- package/dist/Atomic/FormElements/Dropdown/components/DropdownLoader.js +7 -1
- package/dist/Atomic/FormElements/DropdownLiveSearch/DropdownLiveSearch.js +91 -25
- package/dist/Atomic/FormElements/FileLoader/FileLoader.js +15 -3
- package/dist/Atomic/FormElements/FileLoader/partial/LoadZone.js +29 -15
- package/dist/Atomic/FormElements/FileLoader/partial/LoadedContent.js +15 -5
- package/dist/Atomic/FormElements/FileLoaderDescription/FileLoaderDescription.js +23 -4
- package/dist/Atomic/FormElements/FileLoaderLocal/FileLoaderLocal.js +26 -6
- package/dist/Atomic/FormElements/FileLoaderLocalGroup/FileLoaderLocalGroup.js +38 -19
- package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN.js +38 -9
- package/dist/Atomic/FormElements/Input/Input.js +60 -25
- package/dist/Atomic/FormElements/InputCalendar/InputCalendar.js +31 -4
- package/dist/Atomic/FormElements/InputColor/InputColor.js +14 -4
- package/dist/Atomic/FormElements/InputCurrency/InputCurrency.js +29 -6
- package/dist/Atomic/FormElements/InputDateRange/InputDateRange.js +43 -8
- package/dist/Atomic/FormElements/InputDateRange/components/DateInput.js +21 -3
- package/dist/Atomic/FormElements/InputDateRange/components/Datepicker.js +81 -58
- package/dist/Atomic/FormElements/InputDateRange/components/OpenedPart.js +41 -6
- package/dist/Atomic/FormElements/InputDateRange/components/SelectItem.js +8 -1
- package/dist/Atomic/FormElements/InputDateRange/dependencies.js +46 -16
- package/dist/Atomic/FormElements/InputLink/InputLink.js +23 -6
- package/dist/Atomic/FormElements/InputMask/InputCarretPosition.js +4 -0
- package/dist/Atomic/FormElements/InputMask/InputMask.js +208 -77
- package/dist/Atomic/FormElements/InputMask/functions.js +28 -2
- package/dist/Atomic/FormElements/InputMask2/InputMask2.js +119 -43
- package/dist/Atomic/FormElements/InputMask2/functions.js +28 -2
- package/dist/Atomic/FormElements/InputMask3/InputMask3.js +137 -44
- package/dist/Atomic/FormElements/InputMask3/functions.js +28 -2
- package/dist/Atomic/FormElements/InputWithAction/InputWithAction.js +17 -3
- package/dist/Atomic/FormElements/InputsRow/InputsRow.js +24 -5
- package/dist/Atomic/FormElements/Label/Label.js +9 -1
- package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.js +73 -35
- package/dist/Atomic/FormElements/MultiSelect/MultiSelect.js +15 -3
- package/dist/Atomic/FormElements/NumericInput/NumericInput.js +44 -23
- package/dist/Atomic/FormElements/RadioGroup/RadioGroup.js +17 -7
- package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.js +14 -3
- package/dist/Atomic/FormElements/RadioInput/RadioInput.js +10 -1
- package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.js +14 -3
- package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.js +23 -3
- package/dist/Atomic/FormElements/RangeInputs/RangeInputs.js +34 -17
- package/dist/Atomic/FormElements/RangeList/RangeList.js +25 -6
- package/dist/Atomic/FormElements/RangeList/partial/RangeListRow.js +11 -1
- package/dist/Atomic/FormElements/RangeSlider/RangeSlider.js +85 -14
- package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.js +132 -43
- package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.js +10 -1
- package/dist/Atomic/FormElements/Switcher/Switcher.js +10 -1
- package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.js +13 -1
- package/dist/Atomic/FormElements/SwitcherHide/SwitcherHide.js +10 -1
- package/dist/Atomic/FormElements/SwitcherRadio/SwitcherRadio.js +17 -2
- package/dist/Atomic/FormElements/SwitcherRange/SwitcherRange.js +17 -3
- package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.js +11 -1
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.js +29 -6
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/partial/States.js +3 -2
- package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.js +12 -1
- package/dist/Atomic/FormElements/TagListToDropdown/TagListToDropdown.js +23 -6
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.js +223 -105
- package/dist/Atomic/FormElements/Text/Text.js +16 -10
- package/dist/Atomic/FormElements/TextSwitcher/TextSwitcher.js +9 -1
- package/dist/Atomic/FormElements/Textarea/Textarea.js +16 -5
- package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.js +35 -6
- package/dist/Atomic/FormElements/TieredCheckboxes/partial/AccordionWithCheckbox.js +13 -4
- package/dist/Atomic/FormElements/TimeRange/TimeRange.js +21 -7
- package/dist/Atomic/FormElements/UserContacts/UserContacts.js +35 -8
- package/dist/Atomic/FormElements/UserContacts/partial/defaultIcons.js +91 -0
- package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.js +18 -5
- package/dist/Atomic/FormElements/VariantsListRadio/partials/VariantsListRadioItem.js +10 -3
- package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.js +11 -3
- package/dist/Atomic/FormElements/WidgetPseudoTable/partial/constructor.js +2 -1
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.js +12 -5
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/partial/constructor.js +3 -3
- package/dist/Atomic/Layout/Header/Header.js +15 -3
- package/dist/Atomic/Layout/MainMenu/MainMenu.js +20 -3
- package/dist/Atomic/Layout/Spinner/Spinner.js +8 -1
- package/dist/Atomic/UI/Accordion/Accordion.js +19 -3
- package/dist/Atomic/UI/Accordion/AccordionItem.js +23 -9
- package/dist/Atomic/UI/AccordionTable/AccordionTable.js +32 -7
- package/dist/Atomic/UI/AccordionText/AccordionText.js +17 -3
- package/dist/Atomic/UI/AdvancedTag/AdvTag.js +21 -4
- package/dist/Atomic/UI/AdvancedTag/AdvancedTags.js +15 -3
- package/dist/Atomic/UI/Alert/Alert.js +19 -3
- package/dist/Atomic/UI/Arrow/Arrow.js +16 -3
- package/dist/Atomic/UI/Box/Box.js +9 -3
- package/dist/Atomic/UI/Button/Button.js +11 -2
- package/dist/Atomic/UI/ButtonsBar/ButtonsBar.js +10 -1
- package/dist/Atomic/UI/Chart/Chart.js +29 -4
- package/dist/Atomic/UI/Chart/partial/Chart.constants.js +19 -11
- package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.js +12 -1
- package/dist/Atomic/UI/Chart/partial/datasetSetters.js +34 -11
- package/dist/Atomic/UI/Chart/partial/optionsConstructor.js +56 -82
- package/dist/Atomic/UI/Chart/partial/optionsSetters.js +19 -15
- package/dist/Atomic/UI/Chart/partial/utils.js +20 -6
- package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.js +13 -3
- package/dist/Atomic/UI/DateTime/DateTime.js +14 -3
- package/dist/Atomic/UI/DebugContainer/DebugContainer.js +16 -4
- package/dist/Atomic/UI/DebugContainer/useDebugContainer.js +11 -3
- package/dist/Atomic/UI/DoubleString/DoubleString.js +17 -5
- package/dist/Atomic/UI/DynamicIcon/DynamicIcon.js +10 -3
- package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.js +52 -17
- package/dist/Atomic/UI/ExampleChartIntegration/partial/utils.js +29 -1
- package/dist/Atomic/UI/Hint/Hint.js +39 -13
- package/dist/Atomic/UI/Hint/partials/_utils.js +19 -4
- package/dist/Atomic/UI/Modal/Modal.js +28 -6
- package/dist/Atomic/UI/Modal/ModalHOC.js +9 -1
- package/dist/Atomic/UI/Modal/partials/ModalFooter.js +7 -1
- package/dist/Atomic/UI/Modal/partials/ModalTitle.js +8 -1
- package/dist/Atomic/UI/Modal/partials/useMobileModal.js +49 -32
- package/dist/Atomic/UI/ModalBackup/Modal.js +174 -0
- package/dist/Atomic/UI/ModalBackup/Modal.scss +333 -0
- package/dist/Atomic/UI/ModalBackup/ModalHOC.js +51 -0
- package/dist/Atomic/UI/ModalBackup/partials/ModalFooter.js +24 -0
- package/dist/Atomic/UI/ModalBackup/partials/ModalTitle.js +41 -0
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion.js +21 -6
- package/dist/Atomic/UI/NavLine/NavLine.js +55 -26
- package/dist/Atomic/UI/NavLine/Tabs.js +3 -2
- package/dist/Atomic/UI/PageTitle/PageTitle.js +10 -2
- package/dist/Atomic/UI/PieChart/PieChart.js +10 -1
- package/dist/Atomic/UI/Price/Price.js +8 -3
- package/dist/Atomic/UI/PriceRange/PriceRange.js +7 -1
- package/dist/Atomic/UI/ProgressLine/ProgressLine.js +16 -1
- package/dist/Atomic/UI/Status/Status.js +8 -1
- package/dist/Atomic/UI/Table/Partials/TdCell.js +29 -5
- package/dist/Atomic/UI/Table/Partials/TdHeader.js +11 -1
- package/dist/Atomic/UI/Table/Partials/TdRow.js +17 -5
- package/dist/Atomic/UI/Table/Partials/TdTitle.js +14 -3
- package/dist/Atomic/UI/Table/Table.js +12 -1
- package/dist/Atomic/UI/Table/TdTypes/TdActions.js +18 -2
- package/dist/Atomic/UI/Table/TdTypes/TdPriority.js +9 -1
- package/dist/Atomic/UI/Table/TdTypes/TdRange.js +4 -1
- package/dist/Atomic/UI/Table/TdTypes/TdWeight.js +13 -1
- package/dist/Atomic/UI/Tag/Tag.js +26 -11
- package/dist/Atomic/UI/TagList/TagList.js +52 -21
- package/dist/Atomic/UI/TagList/TagList.scss +3 -2
- package/dist/Atomic/UI/UserBox/UserBox.js +13 -1
- package/dist/Atomic/UI/WizardStepper/constructor.js +11 -3
- package/dist/Atomic/UI/WizardStepper/index.js +5 -1
- package/dist/Atomic/UI/WizardStepper/ui/StateIcon/StateIcon.js +10 -0
- package/dist/Atomic/UI/WizardStepper/ui/StateIcon/index.js +4 -1
- package/dist/Atomic/UI/WizardStepper/ui/StepRow/StepRow.js +17 -2
- package/dist/Atomic/UI/WizardStepper/ui/StepRow/index.js +5 -1
- package/dist/Atomic/UI/WizardStepper/ui/StepWrapper/StepWrapper.js +15 -1
- package/dist/Atomic/UI/WizardStepper/ui/StepWrapper/index.js +5 -1
- package/dist/Atomic/UI/WizardStepper/ui/icons.js +9 -2
- package/dist/Atomic/UI/WizardStepper/ui/index.js +5 -1
- package/dist/Classes/AbortableFetch.js +93 -36
- package/dist/Classes/AnimatedHandler.js +7 -3
- package/dist/Classes/RESTAPI/index.js +43 -39
- package/dist/Classes/RESTAPI/partials/AbortableFetch.js +93 -35
- package/dist/Classes/RESTAPI/partials/ApiBase.js +9 -1
- package/dist/Classes/RESTAPI/partials/ApiRequestCreators.js +32 -24
- package/dist/Classes/RESTAPI/partials/ApiUtils.js +41 -34
- package/dist/Classes/RESTAPI/partials/CredentialsProcessing.js +46 -21
- package/dist/Classes/RESTAPI/partials/Utils.js +19 -6
- package/dist/Classes/RESTAPI/partials/_outerDependencies.js +6 -2
- package/dist/Classes/RESTAPI/partials/_utils.js +39 -16
- package/dist/Constants/index.constants.js +15 -8
- package/dist/Functions/Portal.js +16 -5
- package/dist/Functions/customEventListener.js +17 -4
- package/dist/Functions/fieldValueFormatters.js +83 -43
- package/dist/Functions/hooks/useFormFieldsChangesManager.js +26 -23
- package/dist/Functions/locale/createTranslator.js +9 -4
- package/dist/Functions/operations.js +22 -12
- package/dist/Functions/presets/inputMaskPresets.js +11 -9
- package/dist/Functions/presets/inputPresets.js +11 -8
- package/dist/Functions/presets/mobileKeyboardTypesPresets.js +9 -7
- package/dist/Functions/schemas.js +13 -6
- package/dist/Functions/useBodyScrollLock.js +6 -1
- package/dist/Functions/useClickOutside.js +4 -0
- package/dist/Functions/useDebounce.js +7 -2
- package/dist/Functions/useFieldFocus.js +18 -6
- package/dist/Functions/useFormTools/form-drivers/ArrayWithObjects.js +9 -0
- package/dist/Functions/useFormTools/form-drivers/ObjectWithIterableObjects.js +23 -12
- package/dist/Functions/useFormTools/form-drivers/ObjectWithNamedKeyObjects.js +15 -6
- package/dist/Functions/useFormTools/functions/General.js +28 -18
- package/dist/Functions/useFormTools/functions/RenderFields.js +11 -2
- package/dist/Functions/useFormTools/functions/usePrevious.js +5 -1
- package/dist/Functions/useFormTools/index.js +144 -85
- package/dist/Functions/useInputHighlightError.js +12 -3
- package/dist/Functions/useIsMobile.js +13 -7
- package/dist/Functions/useKeyPress/useHandleKeyPress.js +7 -1
- package/dist/Functions/useKeyPress/useKeyPress.js +9 -1
- package/dist/Functions/useLocalStorage.js +9 -1
- package/dist/Functions/useLocationParams.js +5 -4
- package/dist/Functions/useMediaQuery.js +9 -3
- package/dist/Functions/useMetaInfo.js +10 -3
- package/dist/Functions/useMouseUpOutside.js +3 -0
- package/dist/Functions/useOnlineStatus.js +9 -1
- package/dist/Functions/usePasswordChecker.js +20 -4
- package/dist/Functions/usePrevious.js +5 -1
- package/dist/Functions/useResize.js +10 -2
- package/dist/Functions/useScrollTo.js +7 -2
- package/dist/Functions/useToggle.js +5 -1
- package/dist/Functions/utils.js +131 -56
- package/dist/Molecular/CustomIcons/components/AffiliateNetworks.js +9 -2
- package/dist/Molecular/CustomIcons/components/AlertCircle.js +9 -2
- package/dist/Molecular/CustomIcons/components/AppStore.js +9 -2
- package/dist/Molecular/CustomIcons/components/Arrow.js +9 -2
- package/dist/Molecular/CustomIcons/components/ArrowDown.js +9 -2
- package/dist/Molecular/CustomIcons/components/ArrowLeft.js +9 -2
- package/dist/Molecular/CustomIcons/components/ArrowRight.js +9 -2
- package/dist/Molecular/CustomIcons/components/ArrowUp.js +9 -2
- package/dist/Molecular/CustomIcons/components/Bell.js +9 -2
- package/dist/Molecular/CustomIcons/components/Button.js +9 -2
- package/dist/Molecular/CustomIcons/components/Campaigns.js +9 -2
- package/dist/Molecular/CustomIcons/components/Check.js +9 -2
- package/dist/Molecular/CustomIcons/components/Check2.js +9 -2
- package/dist/Molecular/CustomIcons/components/ChevronDown.js +9 -2
- package/dist/Molecular/CustomIcons/components/ChevronDownDisabled.js +9 -2
- package/dist/Molecular/CustomIcons/components/ChevronLeft.js +9 -2
- package/dist/Molecular/CustomIcons/components/ChevronRight.js +9 -2
- package/dist/Molecular/CustomIcons/components/ChevronUp.js +9 -2
- package/dist/Molecular/CustomIcons/components/ChevronUpDown.js +9 -2
- package/dist/Molecular/CustomIcons/components/Close.js +9 -2
- package/dist/Molecular/CustomIcons/components/ColumnsOrder.js +9 -2
- package/dist/Molecular/CustomIcons/components/Delete.js +9 -2
- package/dist/Molecular/CustomIcons/components/Edit.js +9 -2
- package/dist/Molecular/CustomIcons/components/Email.js +9 -2
- package/dist/Molecular/CustomIcons/components/FinturfLogo.js +9 -2
- package/dist/Molecular/CustomIcons/components/FinturfLogo2.js +9 -2
- package/dist/Molecular/CustomIcons/components/Flows.js +9 -2
- package/dist/Molecular/CustomIcons/components/Gift.js +9 -2
- package/dist/Molecular/CustomIcons/components/GoogleAuth.js +9 -2
- package/dist/Molecular/CustomIcons/components/GooglePlay.js +9 -2
- package/dist/Molecular/CustomIcons/components/HelpCircle.js +9 -2
- package/dist/Molecular/CustomIcons/components/HelpCircle2.js +9 -2
- package/dist/Molecular/CustomIcons/components/HelpCircleFilled.js +9 -2
- package/dist/Molecular/CustomIcons/components/Home.js +9 -2
- package/dist/Molecular/CustomIcons/components/Home2.js +9 -2
- package/dist/Molecular/CustomIcons/components/Key.js +9 -2
- package/dist/Molecular/CustomIcons/components/Landers.js +9 -2
- package/dist/Molecular/CustomIcons/components/Lock.js +9 -2
- package/dist/Molecular/CustomIcons/components/Mail.js +9 -2
- package/dist/Molecular/CustomIcons/components/Mastercard.js +9 -2
- package/dist/Molecular/CustomIcons/components/Minus.js +9 -2
- package/dist/Molecular/CustomIcons/components/Offers.js +9 -2
- package/dist/Molecular/CustomIcons/components/Pause.js +9 -2
- package/dist/Molecular/CustomIcons/components/PayPal.js +9 -2
- package/dist/Molecular/CustomIcons/components/PayPalLightLarge.js +9 -2
- package/dist/Molecular/CustomIcons/components/Phone.js +9 -2
- package/dist/Molecular/CustomIcons/components/Play.js +9 -2
- package/dist/Molecular/CustomIcons/components/Plus.js +9 -2
- package/dist/Molecular/CustomIcons/components/Profile.js +9 -2
- package/dist/Molecular/CustomIcons/components/QRCode.js +9 -2
- package/dist/Molecular/CustomIcons/components/Rectangle.js +9 -2
- package/dist/Molecular/CustomIcons/components/Revert.js +9 -2
- package/dist/Molecular/CustomIcons/components/Star.js +9 -2
- package/dist/Molecular/CustomIcons/components/Star2.js +9 -2
- package/dist/Molecular/CustomIcons/components/TrafficSources.js +9 -2
- package/dist/Molecular/CustomIcons/components/Trash.js +9 -2
- package/dist/Molecular/CustomIcons/components/TrashRed.js +9 -2
- package/dist/Molecular/CustomIcons/components/Triggers.js +9 -2
- package/dist/Molecular/CustomIcons/components/User.js +9 -2
- package/dist/Molecular/CustomIcons/components/Visa.js +9 -2
- package/dist/Molecular/CustomIcons/components/X.js +9 -2
- package/dist/Molecular/CustomIcons/index.js +122 -0
- package/dist/Molecular/FormElement/FormElement.js +12 -1
- package/dist/Molecular/FormWithDependOn/FormWithDependOn.js +31 -30
- package/dist/Molecular/FormWithDependOn/partials/_utils.js +12 -9
- package/dist/Molecular/InputAddress/InputAddress.js +114 -65
- package/dist/Molecular/InputPassword/InputPassword.js +19 -5
- package/dist/index.js +2 -0
- package/package.json +1 -1
- package/dist/Atomic/UI/Hint/partial/_utils.js +0 -52
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.default = void 0;
|
|
9
|
+
|
|
8
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
|
|
9
12
|
var _react = _interopRequireDefault(require("react"));
|
|
13
|
+
|
|
10
14
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
|
+
|
|
11
16
|
require("./Text.scss");
|
|
12
|
-
const RC = "text";
|
|
13
17
|
|
|
18
|
+
const RC = "text";
|
|
14
19
|
/**
|
|
15
20
|
*
|
|
16
21
|
* @param value
|
|
@@ -23,7 +28,6 @@ const RC = "text";
|
|
|
23
28
|
* @return {JSX.Element|null}
|
|
24
29
|
* @constructor
|
|
25
30
|
*/
|
|
26
|
-
|
|
27
31
|
//? Прототип лежит на проекте кабинета src\JS\Components\Atomic\FormElements\Text\Text.js
|
|
28
32
|
//? Что поменял?
|
|
29
33
|
//? - в верстке убрал дополнительную вложенность
|
|
@@ -35,18 +39,13 @@ const RC = "text";
|
|
|
35
39
|
//? - переработал пропу link, может быть строкой или объектом
|
|
36
40
|
//? если это объект, то у него могут быть свойства
|
|
37
41
|
//? - path - значение для href
|
|
38
|
-
|
|
39
42
|
//? - target - значение для атрибута target, имеет смысл передавать, если не передаются onClick или redirect
|
|
40
|
-
|
|
41
43
|
//? - onClick - альтернативный обработчик нажатия, если он есть то он будет ипользован в приоритете,
|
|
42
44
|
//? ф-я будет вызвана с 1 аргументом - props, в объекте props будет свойство ev (event) и все содержание link,
|
|
43
45
|
//? по умолчанию до использования onClick будут вызваны e.preventDefault() и e.stopPropagation
|
|
44
|
-
|
|
45
46
|
//? - redirect - альтернативный исполнитель редиректа (например history.push),
|
|
46
47
|
//? если есть и нет onClick - будет вызван с одним аргументом (link.path)
|
|
47
|
-
|
|
48
48
|
//? - isNoPreventDefault - отключает вызов e.preventDefault перед вызовом onClick или redirect
|
|
49
|
-
|
|
50
49
|
//? - isNoStopPropagation - отключает вызов e.preventDefault перед вызовом onClick или redirect
|
|
51
50
|
|
|
52
51
|
const Text = _ref => {
|
|
@@ -72,17 +71,19 @@ const Text = _ref => {
|
|
|
72
71
|
isNoPreventDefault,
|
|
73
72
|
isNoStopPropagation
|
|
74
73
|
} = linkObj;
|
|
74
|
+
|
|
75
75
|
const preparedPath = (() => {
|
|
76
76
|
if (!isLink) return "";
|
|
77
77
|
return isLinkAsObj ? path : link;
|
|
78
78
|
})();
|
|
79
|
+
|
|
79
80
|
const atributes = {};
|
|
81
|
+
|
|
80
82
|
if (typeof onClickInner === "function" || typeof redirect === "function") {
|
|
81
83
|
atributes.onClick = function onClick(ev) {
|
|
82
84
|
if (!isNoPreventDefault) ev.preventDefault();
|
|
83
|
-
if (!isNoStopPropagation) ev.stopPropagation();
|
|
85
|
+
if (!isNoStopPropagation) ev.stopPropagation(); //? если переданы и onClick, и redirect, то onClick считается приоритетнее redirect
|
|
84
86
|
|
|
85
|
-
//? если переданы и onClick, и redirect, то onClick считается приоритетнее redirect
|
|
86
87
|
if (onClickInner) {
|
|
87
88
|
onClickInner({
|
|
88
89
|
ev,
|
|
@@ -90,12 +91,15 @@ const Text = _ref => {
|
|
|
90
91
|
});
|
|
91
92
|
return;
|
|
92
93
|
}
|
|
94
|
+
|
|
93
95
|
redirect(preparedPath);
|
|
94
96
|
};
|
|
95
97
|
}
|
|
98
|
+
|
|
96
99
|
const mainInner = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, icon && /*#__PURE__*/_react.default.createElement("div", {
|
|
97
100
|
className: "".concat(RC, "__icon-container")
|
|
98
101
|
}, icon), value);
|
|
102
|
+
|
|
99
103
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
100
104
|
"data-testid": "text--".concat(testId),
|
|
101
105
|
className: (0, _classnames.default)(RC, className, {
|
|
@@ -111,4 +115,6 @@ const Text = _ref => {
|
|
|
111
115
|
rel: "noreferrer"
|
|
112
116
|
}), mainInner) : mainInner);
|
|
113
117
|
};
|
|
114
|
-
|
|
118
|
+
|
|
119
|
+
var _default = Text;
|
|
120
|
+
exports.default = _default;
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.default = void 0;
|
|
9
|
+
|
|
8
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
9
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
|
|
10
14
|
require("./TextSwitcher.scss");
|
|
15
|
+
|
|
11
16
|
const RC = "text-switcher";
|
|
17
|
+
|
|
12
18
|
const TextSwitcher = _ref => {
|
|
13
19
|
let {
|
|
14
20
|
isActive,
|
|
@@ -37,4 +43,6 @@ const TextSwitcher = _ref => {
|
|
|
37
43
|
})
|
|
38
44
|
}));
|
|
39
45
|
};
|
|
40
|
-
|
|
46
|
+
|
|
47
|
+
var _default = TextSwitcher;
|
|
48
|
+
exports.default = _default;
|
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.default = void 0;
|
|
9
|
+
|
|
8
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
9
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
|
|
10
14
|
var _fieldValueFormatters = require("../../../Functions/fieldValueFormatters");
|
|
15
|
+
|
|
11
16
|
require("./Textarea.scss");
|
|
12
|
-
|
|
13
|
-
function
|
|
17
|
+
|
|
18
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
|
+
|
|
20
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
|
+
|
|
14
22
|
const RC = "textarea";
|
|
15
23
|
const Textarea = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
16
24
|
let {
|
|
@@ -36,16 +44,18 @@ const Textarea = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
36
44
|
onChange(inputValue);
|
|
37
45
|
},
|
|
38
46
|
focus: e => {
|
|
39
|
-
onFocus === null || onFocus === void 0
|
|
47
|
+
onFocus === null || onFocus === void 0 ? void 0 : onFocus(e);
|
|
40
48
|
},
|
|
41
49
|
blur: e => {
|
|
42
|
-
onBlur === null || onBlur === void 0
|
|
50
|
+
onBlur === null || onBlur === void 0 ? void 0 : onBlur(e);
|
|
43
51
|
}
|
|
44
52
|
};
|
|
53
|
+
|
|
45
54
|
const autoGrow = el => {
|
|
46
55
|
el.style.height = "5px";
|
|
47
56
|
el.style.height = el.scrollHeight + "px";
|
|
48
57
|
};
|
|
58
|
+
|
|
49
59
|
(0, _react.useEffect)(() => {
|
|
50
60
|
if (withAutoGrow) {
|
|
51
61
|
autoGrow(textareaRef === null || textareaRef === void 0 ? void 0 : textareaRef.current);
|
|
@@ -67,4 +77,5 @@ const Textarea = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
67
77
|
onBlur: handle.blur
|
|
68
78
|
}));
|
|
69
79
|
});
|
|
70
|
-
var _default =
|
|
80
|
+
var _default = Textarea;
|
|
81
|
+
exports.default = _default;
|
|
@@ -1,20 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.default = void 0;
|
|
9
|
+
|
|
8
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
|
|
9
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
+
|
|
10
14
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
|
+
|
|
11
16
|
var _utils = require("../../../Functions/utils");
|
|
17
|
+
|
|
12
18
|
var _CheckboxInput = _interopRequireDefault(require("../CheckboxInput/CheckboxInput"));
|
|
19
|
+
|
|
13
20
|
var _AccordionWithCheckbox = _interopRequireDefault(require("./partial/AccordionWithCheckbox"));
|
|
21
|
+
|
|
14
22
|
require("./TieredCheckboxes.scss");
|
|
15
|
-
|
|
16
|
-
function
|
|
23
|
+
|
|
24
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
25
|
+
|
|
26
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
|
+
|
|
17
28
|
const RC = "tiered-checkboxes";
|
|
29
|
+
|
|
18
30
|
const TieredCheckboxes = _ref => {
|
|
19
31
|
let {
|
|
20
32
|
items = {},
|
|
@@ -31,6 +43,7 @@ const TieredCheckboxes = _ref => {
|
|
|
31
43
|
changeParent: (value, key, prop) => {
|
|
32
44
|
const parent = items.find(item => item.key === key);
|
|
33
45
|
if (prop) parent[prop] = value;else parent.value = value;
|
|
46
|
+
|
|
34
47
|
if (!prop) {
|
|
35
48
|
if (value) parent.children.filter(_ref2 => {
|
|
36
49
|
let {
|
|
@@ -44,6 +57,7 @@ const TieredCheckboxes = _ref => {
|
|
|
44
57
|
return !disabled;
|
|
45
58
|
}).forEach(item => item.value = false);
|
|
46
59
|
}
|
|
60
|
+
|
|
47
61
|
onChange([...items]);
|
|
48
62
|
},
|
|
49
63
|
changeChild: (value, key, parentKey) => {
|
|
@@ -58,6 +72,7 @@ const TieredCheckboxes = _ref => {
|
|
|
58
72
|
item.disabled = false;
|
|
59
73
|
parent.disabled = false;
|
|
60
74
|
} else item.disabled = false;
|
|
75
|
+
|
|
61
76
|
return item;
|
|
62
77
|
});
|
|
63
78
|
parent.disabled = true;
|
|
@@ -66,6 +81,7 @@ const TieredCheckboxes = _ref => {
|
|
|
66
81
|
parent.children.find(item => item.key === key).value = value;
|
|
67
82
|
if (parent.children.every(item => item.value)) parent.value = true;else parent.value = false;
|
|
68
83
|
}
|
|
84
|
+
|
|
69
85
|
onChange([...items]);
|
|
70
86
|
},
|
|
71
87
|
isAllChecked: item => {
|
|
@@ -74,22 +90,30 @@ const TieredCheckboxes = _ref => {
|
|
|
74
90
|
};
|
|
75
91
|
const preparedItems = (0, _react.useMemo)(() => {
|
|
76
92
|
let newItems = [...items];
|
|
93
|
+
|
|
77
94
|
if (sortGroups) {
|
|
78
95
|
var _newItems;
|
|
96
|
+
|
|
79
97
|
newItems = (_newItems = newItems) === null || _newItems === void 0 ? void 0 : _newItems.sort(_utils.compareAlphabetical);
|
|
80
98
|
}
|
|
99
|
+
|
|
81
100
|
if (sortGroupItems) {
|
|
82
101
|
var _newItems2;
|
|
102
|
+
|
|
83
103
|
newItems = (_newItems2 = newItems) === null || _newItems2 === void 0 ? void 0 : _newItems2.map(parent => {
|
|
84
104
|
if (parent !== null && parent !== void 0 && parent.children) {
|
|
85
105
|
var _parent$children;
|
|
86
|
-
|
|
106
|
+
|
|
107
|
+
parent.children = parent === null || parent === void 0 ? void 0 : (_parent$children = parent.children) === null || _parent$children === void 0 ? void 0 : _parent$children.sort(_utils.compareAlphabetical);
|
|
87
108
|
}
|
|
109
|
+
|
|
88
110
|
return parent;
|
|
89
111
|
});
|
|
90
112
|
}
|
|
113
|
+
|
|
91
114
|
return newItems;
|
|
92
115
|
}, [items]);
|
|
116
|
+
|
|
93
117
|
const renderInner = parent => {
|
|
94
118
|
return parent.children && parent.children.map(child => /*#__PURE__*/_react.default.createElement("div", {
|
|
95
119
|
key: child.key,
|
|
@@ -102,12 +126,14 @@ const TieredCheckboxes = _ref => {
|
|
|
102
126
|
onChange: value => handle.changeChild(value, child.key, parent.key)
|
|
103
127
|
})));
|
|
104
128
|
};
|
|
129
|
+
|
|
105
130
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
106
131
|
className: (0, _classnames.default)(RC, className)
|
|
107
132
|
}, preparedItems.map(parent => {
|
|
108
133
|
const datasetProp = isUseParentsClassesAsDataset && parent !== null && parent !== void 0 && parent.className ? {
|
|
109
134
|
"data-key": parent === null || parent === void 0 ? void 0 : parent.className
|
|
110
135
|
} : {};
|
|
136
|
+
|
|
111
137
|
if (isUseAccordionForGroup) {
|
|
112
138
|
return /*#__PURE__*/_react.default.createElement(_AccordionWithCheckbox.default, {
|
|
113
139
|
key: parent.key,
|
|
@@ -118,10 +144,11 @@ const TieredCheckboxes = _ref => {
|
|
|
118
144
|
className: "".concat(RC, "__mono-accordion"),
|
|
119
145
|
setIsOpen: () => handle.changeParent(!parent.isOpen, parent.key, "isOpen"),
|
|
120
146
|
onChange: value => handle.changeParent(value, parent.key),
|
|
121
|
-
icon: !parent.isOpen ? (accordionIcons === null || accordionIcons === void 0 ? void 0 : accordionIcons[0]) || null : (accordionIcons === null || accordionIcons === void 0 ? void 0 : accordionIcons[1]) || null
|
|
122
|
-
|
|
147
|
+
icon: !parent.isOpen ? (accordionIcons === null || accordionIcons === void 0 ? void 0 : accordionIcons[0]) || null : (accordionIcons === null || accordionIcons === void 0 ? void 0 : accordionIcons[1]) || null // disabled={parent.children?.every?.((child) => child.disabled)}
|
|
148
|
+
|
|
123
149
|
}, renderInner(parent));
|
|
124
150
|
}
|
|
151
|
+
|
|
125
152
|
return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({}, datasetProp, {
|
|
126
153
|
key: parent.key,
|
|
127
154
|
className: (0, _classnames.default)("".concat(RC, "__parents"), {
|
|
@@ -143,4 +170,6 @@ const TieredCheckboxes = _ref => {
|
|
|
143
170
|
}, renderInner(parent)));
|
|
144
171
|
}));
|
|
145
172
|
};
|
|
146
|
-
|
|
173
|
+
|
|
174
|
+
var _default = TieredCheckboxes;
|
|
175
|
+
exports.default = _default;
|
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.default = void 0;
|
|
9
|
+
|
|
8
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
9
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
|
|
10
14
|
var _MonoAccordion = _interopRequireDefault(require("../../../UI/MonoAccordion/MonoAccordion"));
|
|
15
|
+
|
|
11
16
|
var _CheckboxInput = _interopRequireDefault(require("../../CheckboxInput/CheckboxInput"));
|
|
17
|
+
|
|
12
18
|
require("../TieredCheckboxes.scss");
|
|
19
|
+
|
|
13
20
|
const AccordionWithCheckbox = _ref => {
|
|
14
21
|
var _parent$children, _parent$children$some, _parent$children2, _parent$children2$eve, _parent$children3, _parent$children4;
|
|
22
|
+
|
|
15
23
|
let {
|
|
16
24
|
children,
|
|
17
25
|
parent,
|
|
@@ -32,12 +40,11 @@ const AccordionWithCheckbox = _ref => {
|
|
|
32
40
|
isOpen: parent.isOpen,
|
|
33
41
|
onClick: setIsOpen,
|
|
34
42
|
icon: icon,
|
|
35
|
-
disabled: disabled
|
|
36
|
-
// disabled={parent.children?.every?.((child) => child.disabled)}
|
|
43
|
+
disabled: disabled // disabled={parent.children?.every?.((child) => child.disabled)}
|
|
37
44
|
,
|
|
38
45
|
titleJSX: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_CheckboxInput.default, {
|
|
39
46
|
className: "".concat(RC, "__checkbox-input"),
|
|
40
|
-
isStark: (parent === null || parent === void 0
|
|
47
|
+
isStark: (parent === null || parent === void 0 ? void 0 : (_parent$children = parent.children) === null || _parent$children === void 0 ? void 0 : (_parent$children$some = _parent$children.some) === null || _parent$children$some === void 0 ? void 0 : _parent$children$some.call(_parent$children, item => item.value)) && !(parent !== null && parent !== void 0 && (_parent$children2 = parent.children) !== null && _parent$children2 !== void 0 && (_parent$children2$eve = _parent$children2.every) !== null && _parent$children2$eve !== void 0 && _parent$children2$eve.call(_parent$children2, item => item.value)),
|
|
41
48
|
label: parent.label,
|
|
42
49
|
value: parent.value,
|
|
43
50
|
onChange: onChange,
|
|
@@ -52,4 +59,6 @@ const AccordionWithCheckbox = _ref => {
|
|
|
52
59
|
}, parent !== null && parent !== void 0 && (_parent$children3 = parent.children) !== null && _parent$children3 !== void 0 && _parent$children3.length ? "Selected ".concat(parent.children.filter(child => child.value).length, " from ").concat((_parent$children4 = parent.children) === null || _parent$children4 === void 0 ? void 0 : _parent$children4.length) : null))
|
|
53
60
|
}, children);
|
|
54
61
|
};
|
|
55
|
-
|
|
62
|
+
|
|
63
|
+
var _default = AccordionWithCheckbox;
|
|
64
|
+
exports.default = _default;
|
|
@@ -1,19 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.default = void 0;
|
|
9
|
+
|
|
8
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
9
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
|
|
10
14
|
var _moment = _interopRequireDefault(require("moment"));
|
|
15
|
+
|
|
11
16
|
var _useToggle = _interopRequireDefault(require("../../../Functions/useToggle"));
|
|
17
|
+
|
|
12
18
|
var _Input = _interopRequireDefault(require("../Input/Input"));
|
|
19
|
+
|
|
13
20
|
var _Label = _interopRequireDefault(require("../Label/Label"));
|
|
21
|
+
|
|
14
22
|
require("./TimeRange.scss");
|
|
15
|
-
|
|
16
|
-
function
|
|
23
|
+
|
|
24
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
25
|
+
|
|
26
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
|
+
|
|
17
28
|
const TimeRange = _ref => {
|
|
18
29
|
let {
|
|
19
30
|
className,
|
|
@@ -23,24 +34,25 @@ const TimeRange = _ref => {
|
|
|
23
34
|
labelTo
|
|
24
35
|
} = _ref;
|
|
25
36
|
const [startTime, setStartTime] = (0, _react.useState)(from);
|
|
26
|
-
const [endTime, setEndTime] = (0, _react.useState)(to);
|
|
37
|
+
const [endTime, setEndTime] = (0, _react.useState)(to); // eslint-disable-next-line no-unused-vars
|
|
27
38
|
|
|
28
|
-
// eslint-disable-next-line no-unused-vars
|
|
29
39
|
const {
|
|
30
40
|
isToggled: isStartTimeValidate,
|
|
31
41
|
toggleOn: setIsStartTimeValidate
|
|
32
|
-
} = (0, _useToggle.default)();
|
|
33
|
-
|
|
42
|
+
} = (0, _useToggle.default)(); // eslint-disable-next-line no-unused-vars
|
|
43
|
+
|
|
34
44
|
const {
|
|
35
45
|
isToggled: isEndTimeValidate,
|
|
36
46
|
toggleOn: setIsEndTimeValidate
|
|
37
47
|
} = (0, _useToggle.default)();
|
|
38
48
|
const isStartTimeValid = (0, _react.useMemo)(() => (0, _moment.default)(startTime, "HH:mm", true).isValid(), [startTime]);
|
|
39
49
|
const isEndTimeValid = (0, _react.useMemo)(() => (0, _moment.default)(endTime, "HH:mm", true).isValid(), [endTime]);
|
|
50
|
+
|
|
40
51
|
const blurTimeHandler = (time, setFunc) => {
|
|
41
52
|
const formattedTime = time ? (0, _moment.default)(time, "HH:mm").format("HH:mm") : "";
|
|
42
53
|
setFunc(formattedTime);
|
|
43
54
|
};
|
|
55
|
+
|
|
44
56
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
45
57
|
className: (0, _classnames.default)(className, "time-range")
|
|
46
58
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -65,4 +77,6 @@ const TimeRange = _ref => {
|
|
|
65
77
|
error: isEndTimeValidate || !isEndTimeValid ? "HH:MM format" : ""
|
|
66
78
|
})));
|
|
67
79
|
};
|
|
68
|
-
|
|
80
|
+
|
|
81
|
+
var _default = TimeRange;
|
|
82
|
+
exports.default = _default;
|
|
@@ -1,19 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.default = void 0;
|
|
9
|
+
|
|
8
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
9
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
|
|
10
14
|
var _CustomIcons = require("../../../Molecular/CustomIcons");
|
|
15
|
+
|
|
11
16
|
require("./UserContacts.scss");
|
|
12
|
-
|
|
13
|
-
function
|
|
17
|
+
|
|
18
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
|
+
|
|
20
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
|
+
|
|
14
22
|
const RC = "user-contacts";
|
|
23
|
+
|
|
15
24
|
const UserContacts = props => {
|
|
16
25
|
var _otherContacts$map, _otherContacts$map2;
|
|
26
|
+
|
|
17
27
|
const {
|
|
18
28
|
className,
|
|
19
29
|
email,
|
|
@@ -32,10 +42,9 @@ const UserContacts = props => {
|
|
|
32
42
|
//!По задумке оно соберет в себе только свойства соответствующии контактам
|
|
33
43
|
...mainContacts
|
|
34
44
|
} = props || {};
|
|
35
|
-
const PRIMARY_TEXT = Lng("Primary");
|
|
36
|
-
|
|
37
|
-
//? В случае появления новых типов контактов добавлять их сюда по аналогии,
|
|
45
|
+
const PRIMARY_TEXT = Lng("Primary"); //? В случае появления новых типов контактов добавлять их сюда по аналогии,
|
|
38
46
|
//? или на крайний случай в массив otherContacts (otherContacts - массив строк)
|
|
47
|
+
|
|
39
48
|
const mainContactsDescriptions = {
|
|
40
49
|
isDisputeContact: "Dispute",
|
|
41
50
|
isSalesContact: "Sales",
|
|
@@ -43,6 +52,7 @@ const UserContacts = props => {
|
|
|
43
52
|
isBusinessContact: "Business",
|
|
44
53
|
isTechnicalContact: "Technical"
|
|
45
54
|
};
|
|
55
|
+
|
|
46
56
|
const getContact = key => {
|
|
47
57
|
const {
|
|
48
58
|
prefix,
|
|
@@ -50,8 +60,9 @@ const UserContacts = props => {
|
|
|
50
60
|
} = typeof mainContacts[key] === "object" ? mainContacts[key] : {};
|
|
51
61
|
return "".concat(prefix ? Lng(prefix.toString()) + " " : "").concat(Lng(mainContactsDescriptions[key])).concat(postfix ? " " + Lng(postfix.toString()) : "");
|
|
52
62
|
};
|
|
63
|
+
|
|
53
64
|
let mainContactsStructure = Object.keys(mainContacts).reduce((acc, key) => mainContacts[key] && key in mainContactsDescriptions ? [...acc, getContact(key)] : acc, []);
|
|
54
|
-
mainContactsStructure = isOtherTogetherMainContacts ? [...mainContactsStructure, ...(Array.isArray(otherContacts) ? otherContacts === null || otherContacts === void 0
|
|
65
|
+
mainContactsStructure = isOtherTogetherMainContacts ? [...mainContactsStructure, ...(Array.isArray(otherContacts) ? otherContacts === null || otherContacts === void 0 ? void 0 : (_otherContacts$map = otherContacts.map) === null || _otherContacts$map === void 0 ? void 0 : _otherContacts$map.call(otherContacts, contact => Lng(contact)) : [])] : mainContactsStructure;
|
|
55
66
|
let mainContactsCount = mainContactsStructure.length;
|
|
56
67
|
let otherContactsCount = (otherContacts === null || otherContacts === void 0 ? void 0 : otherContacts.length) || 0;
|
|
57
68
|
const isContacts = Boolean(mainContactsCount) || Boolean(otherContactsCount);
|
|
@@ -62,48 +73,62 @@ const UserContacts = props => {
|
|
|
62
73
|
const contactsRef = (0, _react.useRef)(null);
|
|
63
74
|
const [isIconMode, setIconMode] = (0, _react.useState)(false);
|
|
64
75
|
const [isRunTask, setIsRunTask] = (0, _react.useState)(null);
|
|
76
|
+
|
|
65
77
|
const getSeparator = type => {
|
|
66
78
|
const separator = isUseCommaSeparator ? ", " : " ";
|
|
79
|
+
|
|
67
80
|
switch (type) {
|
|
68
81
|
case "main":
|
|
69
82
|
return mainContactsCount-- > 1 ? separator : "";
|
|
83
|
+
|
|
70
84
|
case "other":
|
|
71
85
|
return otherContactsCount-- > 1 ? separator : "";
|
|
86
|
+
|
|
72
87
|
default:
|
|
73
88
|
return separator;
|
|
74
89
|
}
|
|
75
90
|
};
|
|
91
|
+
|
|
76
92
|
const firstKey = isFirstPhone ? "phone" : "email";
|
|
77
93
|
const secondKey = isFirstPhone ? "email" : "phone";
|
|
94
|
+
|
|
78
95
|
const getIcon = key => {
|
|
79
96
|
switch (key) {
|
|
80
97
|
case "email":
|
|
81
98
|
return EmalIcon || /*#__PURE__*/_react.default.createElement(_CustomIcons.Email, null);
|
|
99
|
+
|
|
82
100
|
case "phone":
|
|
83
101
|
return PhoneIcon || /*#__PURE__*/_react.default.createElement(_CustomIcons.Phone, null);
|
|
102
|
+
|
|
84
103
|
default:
|
|
85
104
|
return null;
|
|
86
105
|
}
|
|
87
106
|
};
|
|
107
|
+
|
|
88
108
|
const getProtocol = key => {
|
|
89
109
|
switch (key) {
|
|
90
110
|
case "email":
|
|
91
111
|
return "mailto:";
|
|
112
|
+
|
|
92
113
|
case "phone":
|
|
93
114
|
return "tel:";
|
|
115
|
+
|
|
94
116
|
default:
|
|
95
117
|
return "https://";
|
|
96
118
|
}
|
|
97
119
|
};
|
|
120
|
+
|
|
98
121
|
const getClasses = isFirst => (0, _classnames.default)("no-wrap", "".concat(RC, "__").concat(isFirst ? firstKey : secondKey), {
|
|
99
122
|
["".concat(RC, "__").concat(isFirst ? firstKey : secondKey, "_icon-mode")]: isIconMode
|
|
100
123
|
});
|
|
124
|
+
|
|
101
125
|
const checkWidth = () => {
|
|
102
126
|
if (mainRef.current && firstRef.current && secondRef.current && contactsRef.current) {
|
|
103
127
|
const measure = maxWidth && typeof maxWidth === "number" ? maxWidth : mainRef.current.clientWidth;
|
|
104
128
|
if (firstRef.current.clientWidth + secondRef.current.clientWidth + contactsRef.current.clientWidth > measure) setIconMode(true);else setIconMode(false);
|
|
105
129
|
}
|
|
106
130
|
};
|
|
131
|
+
|
|
107
132
|
(0, _react.useLayoutEffect)(checkWidth, [isRunTask]);
|
|
108
133
|
(0, _react.useEffect)(() => {
|
|
109
134
|
setIsRunTask({});
|
|
@@ -127,6 +152,8 @@ const UserContacts = props => {
|
|
|
127
152
|
}, isIconMode ? getIcon(secondKey) : "".concat(props[secondKey]).concat(isContacts ? getSeparator() : "")), isContacts && /*#__PURE__*/_react.default.createElement("span", {
|
|
128
153
|
ref: contactsRef,
|
|
129
154
|
className: (0, _classnames.default)("no-wrap", "".concat(RC, "__contacts"))
|
|
130
|
-
}, isMainContacts ? mainContactsStructure.map(contact => "".concat(contact).concat(getSeparator("main"))) : null, isMainContacts && generalizingWord && !isNotRenderGeneralizingWord ? " ".concat(Lng(generalizingWord)) : "", isMainContacts && Boolean(otherContacts) && Boolean(otherContacts === null || otherContacts === void 0 ? void 0 : otherContacts.length) && !isOtherTogetherMainContacts ? getSeparator() : "", Boolean(otherContacts) && Boolean(otherContacts === null || otherContacts === void 0 ? void 0 : otherContacts.length) && !isOtherTogetherMainContacts ? otherContacts === null || otherContacts === void 0
|
|
155
|
+
}, isMainContacts ? mainContactsStructure.map(contact => "".concat(contact).concat(getSeparator("main"))) : null, isMainContacts && generalizingWord && !isNotRenderGeneralizingWord ? " ".concat(Lng(generalizingWord)) : "", isMainContacts && Boolean(otherContacts) && Boolean(otherContacts === null || otherContacts === void 0 ? void 0 : otherContacts.length) && !isOtherTogetherMainContacts ? getSeparator() : "", Boolean(otherContacts) && Boolean(otherContacts === null || otherContacts === void 0 ? void 0 : otherContacts.length) && !isOtherTogetherMainContacts ? otherContacts === null || otherContacts === void 0 ? void 0 : (_otherContacts$map2 = otherContacts.map) === null || _otherContacts$map2 === void 0 ? void 0 : _otherContacts$map2.call(otherContacts, contact => "".concat(contact).concat(getSeparator("other"))) : null));
|
|
131
156
|
};
|
|
132
|
-
|
|
157
|
+
|
|
158
|
+
var _default = UserContacts;
|
|
159
|
+
exports.default = _default;
|