intelicoreact 1.6.20 → 1.6.21
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 +1 -102
- package/dist/Atomic/FormElements/AdvancedStatus/AdvancedStatus.js +1 -89
- package/dist/Atomic/FormElements/Calendar/Calendar.js +1 -232
- package/dist/Atomic/FormElements/Calendar/Calendar.props.js +1 -3
- package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.js +1 -101
- package/dist/Atomic/FormElements/CheckboxesLine/CheckboxesLine.js +1 -70
- package/dist/Atomic/FormElements/Datepicker/Datepicker.js +1 -350
- package/dist/Atomic/FormElements/Datepicker/Datepicker.props.js +1 -3
- package/dist/Atomic/FormElements/Datepicker/components/DatepickerCalendar.js +1 -177
- package/dist/Atomic/FormElements/Datepicker/components/DatepickerCalendar.props.js +1 -3
- package/dist/Atomic/FormElements/Dropdown/Dropdown.js +1 -561
- package/dist/Atomic/FormElements/Dropdown/components/DropdownLoader.js +1 -20
- package/dist/Atomic/FormElements/DropdownLiveSearch/DropdownLiveSearch.js +1 -405
- package/dist/Atomic/FormElements/FileLoader/FileLoader.js +1 -94
- package/dist/Atomic/FormElements/FileLoader/partial/LoadZone.js +1 -105
- package/dist/Atomic/FormElements/FileLoader/partial/LoadedContent.js +1 -67
- package/dist/Atomic/FormElements/FileLoaderDescription/FileLoaderDescription.js +1 -247
- package/dist/Atomic/FormElements/FileLoaderLocal/FileLoaderLocal.js +1 -160
- package/dist/Atomic/FormElements/FileLoaderLocalGroup/FileLoaderLocalGroup.js +1 -193
- package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN.js +1 -135
- package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN_old.js +1 -116
- package/dist/Atomic/FormElements/Input/Input.js +1 -467
- package/dist/Atomic/FormElements/InputCalendar/InputCalendar.js +1 -161
- package/dist/Atomic/FormElements/InputColor/InputColor.js +1 -64
- package/dist/Atomic/FormElements/InputCurrency/InputCurrency.js +1 -166
- package/dist/Atomic/FormElements/InputDateRange/InputDateRange.js +1 -354
- package/dist/Atomic/FormElements/InputDateRange/components/DateInput.js +1 -71
- package/dist/Atomic/FormElements/InputDateRange/components/Datepicker.js +1 -693
- package/dist/Atomic/FormElements/InputDateRange/components/OpenedPart.js +1 -254
- package/dist/Atomic/FormElements/InputDateRange/components/SelectItem.js +1 -32
- package/dist/Atomic/FormElements/InputDateRange/dependencies.js +1 -200
- package/dist/Atomic/FormElements/InputLink/InputLink.js +1 -99
- package/dist/Atomic/FormElements/InputMask/InputCarretPosition.js +1 -37
- package/dist/Atomic/FormElements/InputMask/InputMask.js +1 -1214
- package/dist/Atomic/FormElements/InputMask/config.js +1 -15
- package/dist/Atomic/FormElements/InputMask/functions.js +1 -58
- package/dist/Atomic/FormElements/InputMask2/InputMask2.js +1 -674
- package/dist/Atomic/FormElements/InputMask2/config.js +1 -15
- package/dist/Atomic/FormElements/InputMask2/functions.js +1 -58
- package/dist/Atomic/FormElements/InputMask3/InputMask3.js +1 -766
- package/dist/Atomic/FormElements/InputMask3/config.js +1 -15
- package/dist/Atomic/FormElements/InputMask3/functions.js +1 -58
- package/dist/Atomic/FormElements/InputWithAction/InputWithAction.js +1 -114
- package/dist/Atomic/FormElements/InputsRow/InputsRow.js +1 -140
- package/dist/Atomic/FormElements/Label/Label.js +1 -82
- package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.js +1 -506
- package/dist/Atomic/FormElements/MultiSelect/MultiSelect.js +1 -45
- package/dist/Atomic/FormElements/NumericInput/NumericInput.js +1 -331
- package/dist/Atomic/FormElements/RadioGroup/RadioGroup.js +1 -66
- package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.js +1 -80
- package/dist/Atomic/FormElements/RadioInput/RadioInput.js +1 -64
- package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.js +1 -54
- package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.js +1 -183
- package/dist/Atomic/FormElements/RangeInputs/RangeInputs.js +1 -209
- package/dist/Atomic/FormElements/RangeList/RangeList.js +1 -175
- package/dist/Atomic/FormElements/RangeList/partial/RangeListRow.js +1 -43
- package/dist/Atomic/FormElements/RangeSlider/RangeSlider.js +1 -443
- package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.js +1 -858
- package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.js +1 -39
- package/dist/Atomic/FormElements/Switcher/Switcher.js +1 -59
- package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.js +1 -50
- package/dist/Atomic/FormElements/SwitcherHide/SwitcherHide.js +1 -47
- package/dist/Atomic/FormElements/SwitcherRadio/SwitcherRadio.js +1 -96
- package/dist/Atomic/FormElements/SwitcherRange/SwitcherRange.js +1 -40
- package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.js +1 -64
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.js +1 -170
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/partial/States.js +1 -202
- package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.js +1 -67
- package/dist/Atomic/FormElements/TagListToDropdown/TagListToDropdown.js +1 -115
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.js +1 -826
- package/dist/Atomic/FormElements/Text/Text.js +1 -125
- package/dist/Atomic/FormElements/TextSwitcher/TextSwitcher.js +1 -45
- package/dist/Atomic/FormElements/Textarea/Textarea.js +1 -80
- package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.js +1 -176
- package/dist/Atomic/FormElements/TieredCheckboxes/partial/AccordionWithCheckbox.js +1 -62
- package/dist/Atomic/FormElements/TimeRange/TimeRange.js +1 -127
- package/dist/Atomic/FormElements/UserContacts/UserContacts.js +1 -220
- package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.js +1 -83
- package/dist/Atomic/FormElements/VariantsListRadio/partials/VariantsListRadioItem.js +1 -82
- package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.js +1 -101
- package/dist/Atomic/FormElements/WidgetPseudoTable/partial/constructor.js +1 -29
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.js +1 -113
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/partial/constructor.js +1 -30
- package/dist/Atomic/Layout/Header/Header.js +1 -85
- package/dist/Atomic/Layout/Spinner/Spinner.js +1 -39
- package/dist/Atomic/UI/Accordion/Accordion.js +1 -118
- package/dist/Atomic/UI/Accordion/AccordionItem.js +1 -181
- package/dist/Atomic/UI/AccordionTable/AccordionTable.js +1 -238
- package/dist/Atomic/UI/AccordionText/AccordionText.js +1 -69
- package/dist/Atomic/UI/AdvancedTag/AdvTag.js +1 -207
- package/dist/Atomic/UI/AdvancedTag/AdvancedTags.js +1 -56
- package/dist/Atomic/UI/Alert/Alert.js +1 -72
- package/dist/Atomic/UI/Arrow/Arrow.js +1 -132
- package/dist/Atomic/UI/Box/Box.js +1 -52
- package/dist/Atomic/UI/Button/Button.js +1 -89
- package/dist/Atomic/UI/ButtonsBar/ButtonsBar.js +1 -72
- package/dist/Atomic/UI/Chart/Chart.js +1 -172
- package/dist/Atomic/UI/Chart/partial/Chart.constants.js +1 -95
- package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.js +1 -80
- package/dist/Atomic/UI/Chart/partial/datasetSetters.js +1 -188
- package/dist/Atomic/UI/Chart/partial/optionsConstructor.js +1 -335
- package/dist/Atomic/UI/Chart/partial/optionsSetters.js +1 -43
- package/dist/Atomic/UI/Chart/partial/utils.js +1 -60
- package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.js +1 -109
- package/dist/Atomic/UI/DateTime/DateTime.js +1 -57
- package/dist/Atomic/UI/DebugContainer/DebugContainer.js +1 -44
- package/dist/Atomic/UI/DebugContainer/useDebugContainer.js +1 -15
- package/dist/Atomic/UI/DoubleString/DoubleString.js +1 -102
- package/dist/Atomic/UI/DynamicIcon/DynamicIcon.js +1 -226
- package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.js +1 -221
- package/dist/Atomic/UI/ExampleChartIntegration/partial/utils.js +1 -106
- package/dist/Atomic/UI/Hint/Hint.js +1 -193
- package/dist/Atomic/UI/Hint/partials/_utils.js +1 -51
- package/dist/Atomic/UI/Modal/Modal.js +1 -188
- package/dist/Atomic/UI/Modal/ModalHOC.js +1 -72
- package/dist/Atomic/UI/Modal/partials/ModalFooter.js +1 -46
- package/dist/Atomic/UI/Modal/partials/ModalTitle.js +1 -83
- package/dist/Atomic/UI/Modal/partials/useMobileModal.js +1 -200
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion._test.js +1 -75
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion.js +1 -80
- package/dist/Atomic/UI/NavLine/NavLine.js +1 -293
- package/dist/Atomic/UI/PageTitle/PageTitle.js +1 -75
- package/dist/Atomic/UI/PieChart/PieChart.js +1 -42
- package/dist/Atomic/UI/Price/Price.js +1 -22
- package/dist/Atomic/UI/PriceRange/PriceRange.js +1 -36
- package/dist/Atomic/UI/ProgressLine/ProgressLine.js +1 -71
- package/dist/Atomic/UI/Status/Status.js +1 -59
- package/dist/Atomic/UI/Table/Partials/TdCell.js +1 -87
- package/dist/Atomic/UI/Table/Partials/TdHeader.js +1 -38
- package/dist/Atomic/UI/Table/Partials/TdRow.js +1 -99
- package/dist/Atomic/UI/Table/Partials/TdTitle.js +1 -52
- package/dist/Atomic/UI/Table/Table.js +1 -63
- package/dist/Atomic/UI/Table/TdTypes/TdActions.js +1 -80
- package/dist/Atomic/UI/Table/TdTypes/TdPriority.js +1 -28
- package/dist/Atomic/UI/Table/TdTypes/TdRange.js +1 -13
- package/dist/Atomic/UI/Table/TdTypes/TdWeight.js +1 -53
- package/dist/Atomic/UI/Tag/Tag.js +1 -160
- package/dist/Atomic/UI/TagList/TagList.js +1 -251
- package/dist/Atomic/UI/UserBox/UserBox.js +1 -73
- package/dist/Atomic/UI/WizardStepper/constructor.js +1 -84
- package/dist/Atomic/UI/WizardStepper/index.js +1 -3
- package/dist/Atomic/UI/WizardStepper/ui/StateIcon/StateIcon.js +1 -37
- package/dist/Atomic/UI/WizardStepper/ui/StateIcon/index.js +1 -3
- package/dist/Atomic/UI/WizardStepper/ui/StepRow/StepRow.js +1 -61
- package/dist/Atomic/UI/WizardStepper/ui/StepRow/index.js +1 -3
- package/dist/Atomic/UI/WizardStepper/ui/StepWrapper/StepWrapper.js +1 -39
- package/dist/Atomic/UI/WizardStepper/ui/StepWrapper/index.js +1 -3
- package/dist/Atomic/UI/WizardStepper/ui/icons.js +1 -49
- package/dist/Atomic/UI/WizardStepper/ui/index.js +1 -3
- package/dist/Classes/AbortableFetch.js +1 -454
- package/dist/Classes/AnimatedHandler.js +1 -47
- package/dist/Classes/RESTAPI/index.js +1 -228
- package/dist/Classes/RESTAPI/partials/AbortableFetch.js +1 -457
- package/dist/Classes/RESTAPI/partials/ApiBase.js +1 -48
- package/dist/Classes/RESTAPI/partials/ApiRequestCreators.js +1 -112
- package/dist/Classes/RESTAPI/partials/ApiUtils.js +1 -189
- package/dist/Classes/RESTAPI/partials/CredentialsProcessing.js +1 -252
- package/dist/Classes/RESTAPI/partials/Utils.js +1 -92
- package/dist/Classes/RESTAPI/partials/_outerDependencies.js +1 -3
- package/dist/Classes/RESTAPI/partials/_utils.js +1 -197
- package/dist/Constants/index.constants.js +1 -78
- package/dist/Functions/Portal.js +1 -22
- package/dist/Functions/customEventListener.js +1 -96
- package/dist/Functions/dateTime.js +1 -149
- package/dist/Functions/fieldValueFormatters.js +1 -405
- package/dist/Functions/guards/assertions.js +1 -66
- package/dist/Functions/guards/safeValue.js +1 -30
- package/dist/Functions/guards/typeGuards.js +1 -116
- package/dist/Functions/hooks/useFormFieldsChangesManager.js +1 -95
- package/dist/Functions/locale/createTranslator.js +1 -32
- package/dist/Functions/operations.js +1 -130
- package/dist/Functions/presets/inputMaskPresets.js +1 -170
- package/dist/Functions/presets/inputPresets.js +1 -60
- package/dist/Functions/presets/mobileKeyboardTypesPresets.js +1 -45
- package/dist/Functions/schemas.js +1 -31
- package/dist/Functions/useBodyScrollLock.js +1 -17
- package/dist/Functions/useClickOutside.js +1 -15
- package/dist/Functions/useDebounce.js +1 -17
- package/dist/Functions/useFieldFocus.js +1 -84
- package/dist/Functions/useFormTools/form-drivers/ArrayWithObjects.js +1 -39
- package/dist/Functions/useFormTools/form-drivers/ObjectWithIterableObjects.js +1 -159
- package/dist/Functions/useFormTools/form-drivers/ObjectWithNamedKeyObjects.js +1 -78
- package/dist/Functions/useFormTools/functions/General.js +1 -134
- package/dist/Functions/useFormTools/functions/RenderFields.js +1 -111
- package/dist/Functions/useFormTools/functions/usePrevious.js +1 -12
- package/dist/Functions/useFormTools/index.js +1 -778
- package/dist/Functions/useInputHighlightError.js +1 -67
- package/dist/Functions/useIsMobile/useIsMobile.js +1 -53
- package/dist/Functions/useKeyPress/useHandleKeyPress.js +1 -21
- package/dist/Functions/useKeyPress/useKeyPress.js +1 -75
- package/dist/Functions/useLocalStorage.js +1 -34
- package/dist/Functions/useLocationParams.js +1 -27
- package/dist/Functions/useMediaQuery.js +1 -17
- package/dist/Functions/useMetaInfo.js +1 -43
- package/dist/Functions/useMouseUpOutside.js +1 -16
- package/dist/Functions/useOnlineStatus.js +1 -29
- package/dist/Functions/usePasswordChecker.js +1 -110
- package/dist/Functions/usePrevious.js +1 -12
- package/dist/Functions/useResize.js +1 -31
- package/dist/Functions/useScrollTo.js +1 -17
- package/dist/Functions/useToggle.js +1 -17
- package/dist/Functions/utils.js +1 -522
- package/dist/Langs.js +1 -168
- package/dist/Molecular/CustomIcons/components/AffiliateNetworks.js +1 -21
- package/dist/Molecular/CustomIcons/components/AlertCircle.js +1 -23
- package/dist/Molecular/CustomIcons/components/AppStore.js +1 -29
- package/dist/Molecular/CustomIcons/components/Arrow.js +1 -32
- package/dist/Molecular/CustomIcons/components/ArrowDown.js +1 -17
- package/dist/Molecular/CustomIcons/components/ArrowLeft.js +1 -22
- package/dist/Molecular/CustomIcons/components/ArrowRight.js +1 -22
- package/dist/Molecular/CustomIcons/components/ArrowUp.js +1 -17
- package/dist/Molecular/CustomIcons/components/Bell.js +1 -15
- package/dist/Molecular/CustomIcons/components/Button.js +1 -12
- package/dist/Molecular/CustomIcons/components/Campaigns.js +1 -16
- package/dist/Molecular/CustomIcons/components/Check.js +1 -14
- package/dist/Molecular/CustomIcons/components/Check2.js +1 -12
- package/dist/Molecular/CustomIcons/components/ChevronDown.js +1 -12
- package/dist/Molecular/CustomIcons/components/ChevronDownDisabled.js +1 -11
- package/dist/Molecular/CustomIcons/components/ChevronLeft.js +1 -11
- package/dist/Molecular/CustomIcons/components/ChevronRight.js +1 -11
- package/dist/Molecular/CustomIcons/components/ChevronUp.js +1 -11
- package/dist/Molecular/CustomIcons/components/ChevronUpDown.js +1 -27
- package/dist/Molecular/CustomIcons/components/Close.js +1 -14
- package/dist/Molecular/CustomIcons/components/ColumnsOrder.js +1 -17
- package/dist/Molecular/CustomIcons/components/Delete.js +1 -16
- package/dist/Molecular/CustomIcons/components/Edit.js +1 -15
- package/dist/Molecular/CustomIcons/components/Email.js +1 -31
- package/dist/Molecular/CustomIcons/components/FinturfLogo.js +1 -18
- package/dist/Molecular/CustomIcons/components/FinturfLogo2.js +1 -35
- package/dist/Molecular/CustomIcons/components/Flows.js +1 -15
- package/dist/Molecular/CustomIcons/components/Gift.js +1 -25
- package/dist/Molecular/CustomIcons/components/GoogleAuth.js +1 -29
- package/dist/Molecular/CustomIcons/components/GooglePlay.js +1 -29
- package/dist/Molecular/CustomIcons/components/HelpCircle.js +1 -19
- package/dist/Molecular/CustomIcons/components/HelpCircle2.js +1 -20
- package/dist/Molecular/CustomIcons/components/HelpCircleFilled.js +1 -19
- package/dist/Molecular/CustomIcons/components/Home.js +1 -16
- package/dist/Molecular/CustomIcons/components/Home2.js +1 -22
- package/dist/Molecular/CustomIcons/components/Key.js +1 -23
- package/dist/Molecular/CustomIcons/components/Landers.js +1 -20
- package/dist/Molecular/CustomIcons/components/Lock.js +1 -15
- package/dist/Molecular/CustomIcons/components/Mail.js +1 -26
- package/dist/Molecular/CustomIcons/components/Mastercard.js +1 -73
- package/dist/Molecular/CustomIcons/components/Minus.js +1 -25
- package/dist/Molecular/CustomIcons/components/Offers.js +1 -16
- package/dist/Molecular/CustomIcons/components/Pause.js +1 -28
- package/dist/Molecular/CustomIcons/components/PayPal.js +1 -41
- package/dist/Molecular/CustomIcons/components/PayPalLightLarge.js +1 -28
- package/dist/Molecular/CustomIcons/components/Phone.js +1 -30
- package/dist/Molecular/CustomIcons/components/Play.js +1 -25
- package/dist/Molecular/CustomIcons/components/Plus.js +1 -25
- package/dist/Molecular/CustomIcons/components/Profile.js +1 -16
- package/dist/Molecular/CustomIcons/components/QRCode.js +1 -29
- package/dist/Molecular/CustomIcons/components/Rectangle.js +1 -12
- package/dist/Molecular/CustomIcons/components/Revert.js +1 -13
- package/dist/Molecular/CustomIcons/components/Star.js +1 -14
- package/dist/Molecular/CustomIcons/components/Star2.js +1 -16
- package/dist/Molecular/CustomIcons/components/TrafficSources.js +1 -14
- package/dist/Molecular/CustomIcons/components/Trash.js +1 -15
- package/dist/Molecular/CustomIcons/components/TrashRed.js +1 -15
- package/dist/Molecular/CustomIcons/components/Triggers.js +1 -15
- package/dist/Molecular/CustomIcons/components/User.js +1 -25
- package/dist/Molecular/CustomIcons/components/Visa.js +1 -31
- package/dist/Molecular/CustomIcons/components/X.js +1 -12
- package/dist/Molecular/CustomIcons/index.js +1 -61
- package/dist/Molecular/FormElement/FormElement.js +1 -54
- package/dist/Molecular/FormWithDependOn/FormWithDependOn.js +1 -184
- package/dist/Molecular/FormWithDependOn/partials/_utils.js +1 -53
- package/dist/Molecular/InputAddress/InputAddress.js +1 -620
- package/dist/Molecular/InputPassword/InputPassword.js +1 -48
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,53 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import cn from "classnames";
|
|
4
|
-
|
|
5
|
-
import { useOutsideToggle } from "../../../../Functions/utils";
|
|
6
|
-
import { KEY_CODE } from "../../Modal/Modal";
|
|
7
|
-
|
|
8
|
-
import "../Table.scss";
|
|
9
|
-
|
|
10
|
-
const TdWeight = ({ value, percent, onChange, className }) => {
|
|
11
|
-
const [state, setState] = useState(value);
|
|
12
|
-
const {
|
|
13
|
-
isToggled: isEdited,
|
|
14
|
-
toggleOff: unsetIsEdited,
|
|
15
|
-
toggleOn: setIsEdited,
|
|
16
|
-
} = useOutsideToggle(false);
|
|
17
|
-
|
|
18
|
-
useEffect(() => {
|
|
19
|
-
setState(value);
|
|
20
|
-
}, [value, isEdited]);
|
|
21
|
-
|
|
22
|
-
const handleKeyUp = ({ keyCode, target }) => {
|
|
23
|
-
if (keyCode === KEY_CODE.ENTER) {
|
|
24
|
-
const newValue = Number(target.value) || 1;
|
|
25
|
-
onChange(newValue);
|
|
26
|
-
unsetIsEdited();
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
return (
|
|
31
|
-
<>
|
|
32
|
-
{isEdited ? (
|
|
33
|
-
<Input
|
|
34
|
-
value={state}
|
|
35
|
-
onChange={(e) => setState(e)}
|
|
36
|
-
onBlur={unsetIsEdited}
|
|
37
|
-
onKeyUp={handleKeyUp}
|
|
38
|
-
autoFocus
|
|
39
|
-
/>
|
|
40
|
-
) : (
|
|
41
|
-
<div className={cn("td-weight", className)} onClick={setIsEdited}>
|
|
42
|
-
<span>{value}</span>
|
|
43
|
-
<span className="ml2 color--grey-gull">
|
|
44
|
-
({percent}
|
|
45
|
-
%)
|
|
46
|
-
</span>
|
|
47
|
-
</div>
|
|
48
|
-
)}
|
|
49
|
-
</>
|
|
50
|
-
);
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
export default TdWeight;
|
|
1
|
+
function r(r,t){(null==t||t>r.length)&&(t=r.length);for(var n=0,e=Array(t);n<t;n++)e[n]=r[n];return e}import{jsx as t,jsxs as n,Fragment as e}from"react/jsx-runtime";import{useEffect as o,useState as a}from"react";import l from"classnames";import{useOutsideToggle as i}from"../../../../Functions/utils";import{KEY_CODE as u}from"../../Modal/Modal";import"../Table.scss";export default function(c){var s,f=c.value,m=c.percent,p=c.onChange,y=c.className,d=(s=a(f),function(r){if(Array.isArray(r))return r}(s)||function(r,t){var n,e,o=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=o){var a=[],l=!0,i=!1;try{for(o=o.call(r);!(l=(n=o.next()).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(r){i=!0,e=r}finally{try{l||null==o.return||o.return()}finally{if(i)throw e}}return a}}(s,2)||function(t,n){if(t){if("string"==typeof t)return r(t,2);var e=Object.prototype.toString.call(t).slice(8,-1);if("Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e)return Array.from(e);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return r(t,n)}}(s,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),g=d[0],h=d[1],v=i(!1),b=v.isToggled,j=v.toggleOff,A=v.toggleOn;return o(function(){h(f)},[f,b]),t(e,{children:b?t(Input,{value:g,onChange:function(r){return h(r)},onBlur:j,onKeyUp:function(r){var t=r.keyCode,n=r.target;t===u.ENTER&&(p(Number(n.value)||1),j())},autoFocus:!0}):n("div",{className:l("td-weight",y),onClick:A,children:[t("span",{children:f}),n("span",{className:"ml2 color--grey-gull",children:["(",m,"%)"]})]})})}
|
|
@@ -1,160 +1 @@
|
|
|
1
|
-
function e(e, t) {
|
|
2
|
-
(null == t || t > e.length) && (t = e.length);
|
|
3
|
-
for(var n = 0, r = Array(t); n < t; n++)r[n] = e[n];
|
|
4
|
-
return r;
|
|
5
|
-
}
|
|
6
|
-
function t(t, n) {
|
|
7
|
-
return function(e) {
|
|
8
|
-
if (Array.isArray(e)) return e;
|
|
9
|
-
}(t) || function(e, t) {
|
|
10
|
-
var n, r, o = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
|
|
11
|
-
if (null != o) {
|
|
12
|
-
var a = [], l = !0, u = !1;
|
|
13
|
-
try {
|
|
14
|
-
for(o = o.call(e); !(l = (n = o.next()).done) && (a.push(n.value), !t || a.length !== t); l = !0);
|
|
15
|
-
} catch (e) {
|
|
16
|
-
u = !0, r = e;
|
|
17
|
-
} finally{
|
|
18
|
-
try {
|
|
19
|
-
l || null == o.return || o.return();
|
|
20
|
-
} finally{
|
|
21
|
-
if (u) throw r;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
return a;
|
|
25
|
-
}
|
|
26
|
-
}(t, n) || function(t, n) {
|
|
27
|
-
if (t) {
|
|
28
|
-
if ("string" == typeof t) return e(t, n);
|
|
29
|
-
var r = Object.prototype.toString.call(t).slice(8, -1);
|
|
30
|
-
if ("Object" === r && t.constructor && (r = t.constructor.name), "Map" === r || "Set" === r) return Array.from(r);
|
|
31
|
-
if ("Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return e(t, n);
|
|
32
|
-
}
|
|
33
|
-
}(t, n) || function() {
|
|
34
|
-
throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
35
|
-
}();
|
|
36
|
-
}
|
|
37
|
-
Object.defineProperty(exports, "__esModule", {
|
|
38
|
-
value: !0
|
|
39
|
-
}), Object.defineProperty(exports, "default", {
|
|
40
|
-
enumerable: !0,
|
|
41
|
-
get: function() {
|
|
42
|
-
return f;
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
var n = require("react/jsx-runtime"), r = i(require("classnames")), o = function(e, t) {
|
|
46
|
-
if (e && e.__esModule) return e;
|
|
47
|
-
if (null === e || (void 0 === e ? "undefined" : e && "undefined" != typeof Symbol && e.constructor === Symbol ? "symbol" : typeof e) != "object" && "function" != typeof e) return {
|
|
48
|
-
default: e
|
|
49
|
-
};
|
|
50
|
-
var n = c(t);
|
|
51
|
-
if (n && n.has(e)) return n.get(e);
|
|
52
|
-
var r = {
|
|
53
|
-
__proto__: null
|
|
54
|
-
}, o = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
55
|
-
for(var a in e)if ("default" !== a && Object.prototype.hasOwnProperty.call(e, a)) {
|
|
56
|
-
var l = o ? Object.getOwnPropertyDescriptor(e, a) : null;
|
|
57
|
-
l && (l.get || l.set) ? Object.defineProperty(r, a, l) : r[a] = e[a];
|
|
58
|
-
}
|
|
59
|
-
return r.default = e, n && n.set(e, r), r;
|
|
60
|
-
}(require("react")), a = require("react-dom"), l = require("react-feather"), u = i(require("../../Layout/Spinner"));
|
|
61
|
-
function i(e) {
|
|
62
|
-
return e && e.__esModule ? e : {
|
|
63
|
-
default: e
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
function c(e) {
|
|
67
|
-
if ("function" != typeof WeakMap) return null;
|
|
68
|
-
var t = new WeakMap(), n = new WeakMap();
|
|
69
|
-
return (c = function(e) {
|
|
70
|
-
return e ? n : t;
|
|
71
|
-
})(e);
|
|
72
|
-
}
|
|
73
|
-
function s() {}
|
|
74
|
-
require("./Tag.scss");
|
|
75
|
-
var f = function(e) {
|
|
76
|
-
var i, c, f = e.value, d = e.className, p = e.style, m = e.label, y = e.warning, v = e.removeItem, g = e.name, b = e.isPopup, h = e.popupInfoContent, j = e.popupClassName, w = e.id, x = e.isNoDismiss, _ = e.onClick, O = void 0 === _ ? s : _, P = e.testId, M = (0, o.useRef)(null), N = t((0, o.useState)(!1), 2), S = N[0], E = N[1], k = t((0, o.useState)(!1), 2), C = k[0], q = k[1], A = null != (c = null == M || null == (i = M.current) ? void 0 : i.getBoundingClientRect()) ? c : {}, I = A.x, L = A.y, D = A.height, R = A.width, T = window.scrollY, W = (0, o.useMemo)(function() {
|
|
77
|
-
if (!C || !(null == M ? void 0 : M.current)) return {};
|
|
78
|
-
var e, t = null == M || null == (e = M.current) ? void 0 : e.getBoundingClientRect(), n = t.x, r = t.y, o = t.height, a = t.width;
|
|
79
|
-
return {
|
|
80
|
-
left: "".concat(n, "px"),
|
|
81
|
-
top: "".concat(r + T, "px"),
|
|
82
|
-
transform: "translate(calc(-1 * calc(100% - ".concat(a / 2 + 22, "px)), ").concat(o + 10, "px)")
|
|
83
|
-
};
|
|
84
|
-
}, [
|
|
85
|
-
C,
|
|
86
|
-
I,
|
|
87
|
-
L,
|
|
88
|
-
R,
|
|
89
|
-
D,
|
|
90
|
-
T
|
|
91
|
-
]), B = function() {
|
|
92
|
-
b && q(!C), O(w);
|
|
93
|
-
}, z = function() {
|
|
94
|
-
q(!1);
|
|
95
|
-
};
|
|
96
|
-
return (0, o.useEffect)(function() {
|
|
97
|
-
return document.addEventListener('click', z, !0), function() {
|
|
98
|
-
document.removeEventListener('click', z, !0);
|
|
99
|
-
};
|
|
100
|
-
}, []), (0, o.useEffect)(function() {
|
|
101
|
-
var e = function() {
|
|
102
|
-
q(!1);
|
|
103
|
-
};
|
|
104
|
-
return window.addEventListener('scroll', e, !0), function() {
|
|
105
|
-
window.removeEventListener('scroll', e, !0);
|
|
106
|
-
};
|
|
107
|
-
}, []), (0, n.jsxs)("div", {
|
|
108
|
-
onMouseEnter: function() {
|
|
109
|
-
return E(!0);
|
|
110
|
-
},
|
|
111
|
-
onMouseLeave: function() {
|
|
112
|
-
return E(!1);
|
|
113
|
-
},
|
|
114
|
-
"data-testid": void 0 === P ? 'tag' : P,
|
|
115
|
-
role: "listitem",
|
|
116
|
-
"aria-label": "Tag: ".concat(m || g),
|
|
117
|
-
className: (0, r.default)('tag', d, {
|
|
118
|
-
'tag-warn': y
|
|
119
|
-
}),
|
|
120
|
-
style: null != p ? p : {},
|
|
121
|
-
onClick: function() {
|
|
122
|
-
return B();
|
|
123
|
-
},
|
|
124
|
-
ref: M,
|
|
125
|
-
children: [
|
|
126
|
-
y && 'string' == typeof y && (0, n.jsx)(l.AlertTriangle, {
|
|
127
|
-
className: "advanced-tags--warning-icon mr5",
|
|
128
|
-
"aria-label": "Warning"
|
|
129
|
-
}),
|
|
130
|
-
y && 'string' == typeof y && S && (0, n.jsx)("div", {
|
|
131
|
-
className: "tag__warn-hint",
|
|
132
|
-
role: "tooltip",
|
|
133
|
-
children: y
|
|
134
|
-
}),
|
|
135
|
-
(0, n.jsx)("span", {
|
|
136
|
-
className: "tag__label",
|
|
137
|
-
children: m || g
|
|
138
|
-
}),
|
|
139
|
-
v && !(void 0 === x || x) && (0, n.jsx)("button", {
|
|
140
|
-
type: "button",
|
|
141
|
-
onClick: function(e) {
|
|
142
|
-
null == e || e.preventDefault(), null == e || e.stopPropagation(), v(f);
|
|
143
|
-
},
|
|
144
|
-
"aria-label": "Remove ".concat(m || g),
|
|
145
|
-
className: "tag__button",
|
|
146
|
-
children: (0, n.jsx)(l.X, {
|
|
147
|
-
className: "color--text"
|
|
148
|
-
})
|
|
149
|
-
}),
|
|
150
|
-
C && (0, a.createPortal)((0, n.jsx)("div", {
|
|
151
|
-
id: "tagPopup".concat(f),
|
|
152
|
-
className: (0, r.default)('tag__popup', j),
|
|
153
|
-
style: W,
|
|
154
|
-
children: h || (0, n.jsx)(u.default, {
|
|
155
|
-
size: "small"
|
|
156
|
-
})
|
|
157
|
-
}), document.getElementById('app'))
|
|
158
|
-
]
|
|
159
|
-
});
|
|
160
|
-
};
|
|
1
|
+
function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function t(t,n){return function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],l=!0,u=!1;try{for(o=o.call(e);!(l=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);l=!0);}catch(e){u=!0,r=e}finally{try{l||null==o.return||o.return()}finally{if(u)throw r}}return a}}(t,n)||function(t,n){if(t){if("string"==typeof t)return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);if("Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return e(t,n)}}(t,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return f}});var n=require("react/jsx-runtime"),r=i(require("classnames")),o=function(e,t){if(e&&e.__esModule)return e;if(null===e||(void 0===e?"undefined":e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e)!="object"&&"function"!=typeof e)return{default:e};var n=c(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var l=o?Object.getOwnPropertyDescriptor(e,a):null;l&&(l.get||l.set)?Object.defineProperty(r,a,l):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(require("react")),a=require("react-dom"),l=require("react-feather"),u=i(require("../../Layout/Spinner"));function i(e){return e&&e.__esModule?e:{default:e}}function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(c=function(e){return e?n:t})(e)}function s(){}require("./Tag.scss");var f=function(e){var i,c,f=e.value,d=e.className,p=e.style,m=e.label,y=e.warning,v=e.removeItem,g=e.name,b=e.isPopup,h=e.popupInfoContent,j=e.popupClassName,w=e.id,x=e.isNoDismiss,_=e.onClick,O=void 0===_?s:_,P=e.testId,M=(0,o.useRef)(null),N=t((0,o.useState)(!1),2),S=N[0],E=N[1],k=t((0,o.useState)(!1),2),C=k[0],q=k[1],A=null!=(c=null==M||null==(i=M.current)?void 0:i.getBoundingClientRect())?c:{},I=A.x,L=A.y,D=A.height,R=A.width,T=window.scrollY,W=(0,o.useMemo)(function(){if(!C||!(null==M?void 0:M.current))return{};var e,t=null==M||null==(e=M.current)?void 0:e.getBoundingClientRect(),n=t.x,r=t.y,o=t.height,a=t.width;return{left:"".concat(n,"px"),top:"".concat(r+T,"px"),transform:"translate(calc(-1 * calc(100% - ".concat(a/2+22,"px)), ").concat(o+10,"px)")}},[C,I,L,R,D,T]),B=function(){b&&q(!C),O(w)},z=function(){q(!1)};return(0,o.useEffect)(function(){return document.addEventListener("click",z,!0),function(){document.removeEventListener("click",z,!0)}},[]),(0,o.useEffect)(function(){var e=function(){q(!1)};return window.addEventListener("scroll",e,!0),function(){window.removeEventListener("scroll",e,!0)}},[]),(0,n.jsxs)("div",{onMouseEnter:function(){return E(!0)},onMouseLeave:function(){return E(!1)},"data-testid":void 0===P?"tag":P,role:"listitem","aria-label":"Tag: ".concat(m||g),className:(0,r.default)("tag",d,{"tag-warn":y}),style:null!=p?p:{},onClick:function(){return B()},ref:M,children:[y&&"string"==typeof y&&(0,n.jsx)(l.AlertTriangle,{className:"advanced-tags--warning-icon mr5","aria-label":"Warning"}),y&&"string"==typeof y&&S&&(0,n.jsx)("div",{className:"tag__warn-hint",role:"tooltip",children:y}),(0,n.jsx)("span",{className:"tag__label",children:m||g}),v&&!(void 0===x||x)&&(0,n.jsx)("button",{type:"button",onClick:function(e){null==e||e.preventDefault(),null==e||e.stopPropagation(),v(f)},"aria-label":"Remove ".concat(m||g),className:"tag__button",children:(0,n.jsx)(l.X,{className:"color--text"})}),C&&(0,a.createPortal)((0,n.jsx)("div",{id:"tagPopup".concat(f),className:(0,r.default)("tag__popup",j),style:W,children:h||(0,n.jsx)(u.default,{size:"small"})}),document.getElementById("app"))]})};
|
|
@@ -1,251 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
createRef,
|
|
3
|
-
useEffect,
|
|
4
|
-
useLayoutEffect,
|
|
5
|
-
useRef,
|
|
6
|
-
useState,
|
|
7
|
-
} from "react";
|
|
8
|
-
|
|
9
|
-
import cn from "classnames";
|
|
10
|
-
import { Edit3 } from "react-feather";
|
|
11
|
-
|
|
12
|
-
import { checkedRef } from "../../../Functions/utils";
|
|
13
|
-
import Tag from "../Tag/Tag";
|
|
14
|
-
|
|
15
|
-
import "./TagList.scss";
|
|
16
|
-
|
|
17
|
-
const TagList = ({
|
|
18
|
-
disabled,
|
|
19
|
-
className,
|
|
20
|
-
onTagClick,
|
|
21
|
-
removeItem = null,
|
|
22
|
-
items = [],
|
|
23
|
-
withToggle = true,
|
|
24
|
-
disableShowMore = false,
|
|
25
|
-
shownItemsCount = "auto",
|
|
26
|
-
testId = "test-taglist",
|
|
27
|
-
refProp,
|
|
28
|
-
|
|
29
|
-
renderOrder,
|
|
30
|
-
|
|
31
|
-
onEditClick,
|
|
32
|
-
onToggleRenderAll,
|
|
33
|
-
}) => {
|
|
34
|
-
const wrapperRef = useRef(null);
|
|
35
|
-
const [tagList, setTagList] = useState([]);
|
|
36
|
-
|
|
37
|
-
const [staticTagsCount, setStaticTagsCount] = useState(-1);
|
|
38
|
-
const [renderItemsCount, setRenderItemsCount] = useState(-1);
|
|
39
|
-
const [renderAll, setRenderAll] = useState(!withToggle);
|
|
40
|
-
|
|
41
|
-
const wrapperWidth =
|
|
42
|
-
wrapperRef?.current?.getBoundingClientRect()?.width ?? -1;
|
|
43
|
-
|
|
44
|
-
const setRenderAllInterceptor = (v) => {
|
|
45
|
-
setRenderAll(v);
|
|
46
|
-
onToggleRenderAll?.(v);
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
const getStaticTagsCount = (computedWidth) => {
|
|
50
|
-
if (typeof shownItemsCount === "number") return shownItemsCount;
|
|
51
|
-
|
|
52
|
-
const delta = typeof onEditClick === "function" ? 60 : 32;
|
|
53
|
-
|
|
54
|
-
const result = tagList.reduce(
|
|
55
|
-
(result, { itemRef }, index) => {
|
|
56
|
-
if (result.skip) return result;
|
|
57
|
-
|
|
58
|
-
const itemStyle =
|
|
59
|
-
itemRef?.current && window.getComputedStyle(itemRef.current);
|
|
60
|
-
|
|
61
|
-
const itemWidth = [
|
|
62
|
-
parseInt(itemRef.current?.getBoundingClientRect()?.width, 10),
|
|
63
|
-
parseInt(itemStyle?.marginLeft, 10),
|
|
64
|
-
parseInt(itemStyle?.marginRight, 10),
|
|
65
|
-
].reduce((result, item) => {
|
|
66
|
-
if (!isNaN(item)) result += item;
|
|
67
|
-
return result;
|
|
68
|
-
}, 0);
|
|
69
|
-
|
|
70
|
-
if (
|
|
71
|
-
(!isNaN(itemWidth) &&
|
|
72
|
-
itemWidth > 0 &&
|
|
73
|
-
itemWidth + result.width < computedWidth - delta) ||
|
|
74
|
-
index === 0
|
|
75
|
-
) {
|
|
76
|
-
result = {
|
|
77
|
-
count: result.count + 1,
|
|
78
|
-
width: result.width + itemWidth,
|
|
79
|
-
items: [...result.items, { w: itemWidth, r: itemRef?.current }],
|
|
80
|
-
};
|
|
81
|
-
} else {
|
|
82
|
-
result.skip = true;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
return result;
|
|
86
|
-
},
|
|
87
|
-
{ count: 0, width: 0, items: [], skip: false },
|
|
88
|
-
);
|
|
89
|
-
|
|
90
|
-
if (result?.items?.length === 1 && tagList.length > 1) {
|
|
91
|
-
result.items[0].r.style.maxWidth = `${computedWidth - delta - 8}px`;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
return result?.count;
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
const cancelDefault = (e, cb = () => {}) => {
|
|
98
|
-
e?.preventDefault();
|
|
99
|
-
e?.stopPropagation();
|
|
100
|
-
|
|
101
|
-
cb(e);
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
const renderTags = () => {
|
|
105
|
-
const tagsRenderOrder =
|
|
106
|
-
renderOrder ?? tagList.map(({ value, id }) => value ?? id);
|
|
107
|
-
|
|
108
|
-
return tagsRenderOrder.map((v, i) => {
|
|
109
|
-
const item = tagList.find(({ value, id }) => (value ?? id) === v);
|
|
110
|
-
|
|
111
|
-
if (!item) return null;
|
|
112
|
-
|
|
113
|
-
const isHidden =
|
|
114
|
-
renderItemsCount !== -1 && staticTagsCount !== -1
|
|
115
|
-
? i >= renderItemsCount
|
|
116
|
-
: false;
|
|
117
|
-
|
|
118
|
-
return (
|
|
119
|
-
<div
|
|
120
|
-
className={`tag-list_wrapper_item ${isHidden ? "tag-list_wrapper_item--hidden" : ""}`}
|
|
121
|
-
key={`tag-list-item-${item?.id ?? item?.value}`}
|
|
122
|
-
ref={checkedRef(item?.itemRef)}
|
|
123
|
-
>
|
|
124
|
-
<Tag
|
|
125
|
-
testId={`test-taglist-item-${item?.id ?? item?.value}`}
|
|
126
|
-
{...item}
|
|
127
|
-
onClick={onTagClick}
|
|
128
|
-
removeItem={removeItem}
|
|
129
|
-
/>
|
|
130
|
-
</div>
|
|
131
|
-
);
|
|
132
|
-
});
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
const renderMoreTags = () => {
|
|
136
|
-
if (
|
|
137
|
-
tagList?.length < shownItemsCount ||
|
|
138
|
-
!tagList?.length ||
|
|
139
|
-
disableShowMore
|
|
140
|
-
)
|
|
141
|
-
return null;
|
|
142
|
-
const restItems = tagList.length - renderItemsCount;
|
|
143
|
-
|
|
144
|
-
if (restItems === 0 || !withToggle || staticTagsCount === -1) return null;
|
|
145
|
-
|
|
146
|
-
return (
|
|
147
|
-
<Tag
|
|
148
|
-
label={`+${restItems}`}
|
|
149
|
-
className="tag-list_wrapper_render-more"
|
|
150
|
-
onClick={
|
|
151
|
-
disableShowMore
|
|
152
|
-
? () => {}
|
|
153
|
-
: (e) => cancelDefault(e, () => setRenderAllInterceptor(true))
|
|
154
|
-
}
|
|
155
|
-
/>
|
|
156
|
-
);
|
|
157
|
-
};
|
|
158
|
-
const renderHideTags = () => {
|
|
159
|
-
if (
|
|
160
|
-
renderItemsCount !== tagList?.length ||
|
|
161
|
-
!withToggle ||
|
|
162
|
-
staticTagsCount === -1 ||
|
|
163
|
-
staticTagsCount === tagList?.length
|
|
164
|
-
)
|
|
165
|
-
return null;
|
|
166
|
-
|
|
167
|
-
return (
|
|
168
|
-
<Tag
|
|
169
|
-
label="..."
|
|
170
|
-
className="tag-list_wrapper_hide-more"
|
|
171
|
-
onClick={(e) => cancelDefault(e, () => setRenderAllInterceptor(false))}
|
|
172
|
-
/>
|
|
173
|
-
);
|
|
174
|
-
};
|
|
175
|
-
|
|
176
|
-
// Set TagList Items
|
|
177
|
-
useEffect(() => {
|
|
178
|
-
setStaticTagsCount(-1);
|
|
179
|
-
setRenderItemsCount(-1);
|
|
180
|
-
setRenderAllInterceptor(false);
|
|
181
|
-
setTagList(items.map((item) => ({ ...item, itemRef: createRef() })));
|
|
182
|
-
}, [items]);
|
|
183
|
-
|
|
184
|
-
// Count Row Tags
|
|
185
|
-
useLayoutEffect(() => {
|
|
186
|
-
if (withToggle && wrapperWidth !== -1 && staticTagsCount === -1) {
|
|
187
|
-
let computedWidth = wrapperWidth;
|
|
188
|
-
|
|
189
|
-
if (computedWidth === 0) {
|
|
190
|
-
computedWidth = parseInt(
|
|
191
|
-
wrapperRef?.current
|
|
192
|
-
? window.getComputedStyle(wrapperRef?.current)?.width
|
|
193
|
-
: 0,
|
|
194
|
-
);
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
if (!isNaN(computedWidth)) {
|
|
198
|
-
setStaticTagsCount(getStaticTagsCount(computedWidth));
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
}, [tagList, wrapperWidth, wrapperRef?.current]);
|
|
202
|
-
|
|
203
|
-
//
|
|
204
|
-
useLayoutEffect(() => {
|
|
205
|
-
setRenderItemsCount(staticTagsCount);
|
|
206
|
-
}, [staticTagsCount]);
|
|
207
|
-
|
|
208
|
-
// Toggle Show/Hide More Tags
|
|
209
|
-
useEffect(() => {
|
|
210
|
-
setRenderItemsCount(renderAll ? tagList?.length : staticTagsCount);
|
|
211
|
-
}, [renderAll]);
|
|
212
|
-
|
|
213
|
-
useEffect(() => {
|
|
214
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
215
|
-
if (wrapperRef?.current && refProp) refProp.current = wrapperRef?.current;
|
|
216
|
-
}, [wrapperRef?.current]);
|
|
217
|
-
|
|
218
|
-
return (
|
|
219
|
-
<div
|
|
220
|
-
className={cn(
|
|
221
|
-
"tag-list_wrapper",
|
|
222
|
-
`${
|
|
223
|
-
renderItemsCount !== tagList?.length ||
|
|
224
|
-
!withToggle ||
|
|
225
|
-
staticTagsCount === -1 ||
|
|
226
|
-
staticTagsCount === tagList?.length
|
|
227
|
-
? "tag-list_wrapper--only-static-items"
|
|
228
|
-
: "tag-list_wrapper--all-items"
|
|
229
|
-
}`,
|
|
230
|
-
className,
|
|
231
|
-
{ "tag-list_wrapper--disabled": disabled },
|
|
232
|
-
)}
|
|
233
|
-
style={{
|
|
234
|
-
visibility: staticTagsCount === -1 ? "hidden" : "visible",
|
|
235
|
-
zIndex: staticTagsCount === -1 ? "-1" : "auto",
|
|
236
|
-
}}
|
|
237
|
-
ref={wrapperRef}
|
|
238
|
-
>
|
|
239
|
-
{renderTags()}
|
|
240
|
-
{renderMoreTags()}
|
|
241
|
-
{renderHideTags()}
|
|
242
|
-
{typeof onEditClick === "function" && (
|
|
243
|
-
<div className="tag-list__edit-trigger">
|
|
244
|
-
<Edit3 onClick={onEditClick} />
|
|
245
|
-
</div>
|
|
246
|
-
)}
|
|
247
|
-
</div>
|
|
248
|
-
);
|
|
249
|
-
};
|
|
250
|
-
|
|
251
|
-
export default TagList;
|
|
1
|
+
function t(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=Array(n);e<n;e++)r[e]=t[e];return r}function n(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{},r=Object.keys(e);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(e).filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.forEach(function(n){var r;r=e[n],n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r})}return t}function e(t,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e.push.apply(e,r)}return e})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t}function r(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var e,r,i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var l=[],o=!0,u=!1;try{for(i=i.call(t);!(o=(e=i.next()).done)&&(l.push(e.value),!n||l.length!==n);o=!0);}catch(t){u=!0,r=t}finally{try{o||null==i.return||i.return()}finally{if(u)throw r}}return l}}(t,n)||i(t,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(n,e){if(n){if("string"==typeof n)return t(n,e);var r=Object.prototype.toString.call(n).slice(8,-1);if("Object"===r&&n.constructor&&(r=n.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return t(n,e)}}import{jsx as l,jsxs as o}from"react/jsx-runtime";import{createRef as u,useEffect as a,useLayoutEffect as c,useRef as s,useState as d}from"react";import f from"classnames";import{Edit3 as p}from"react-feather";import{checkedRef as m}from"../../../Functions/utils";import v from"../Tag/Tag";import"./TagList.scss";export default function(g){var y,b,h,w=g.disabled,O=g.className,j=g.onTagClick,I=g.removeItem,S=void 0===I?null:I,_=g.items,P=void 0===_?[]:_,C=g.withToggle,N=void 0===C||C,k=g.disableShowMore,A=void 0!==k&&k,x=g.shownItemsCount,T=void 0===x?"auto":x,R=(g.testId,g.refProp),D=g.renderOrder,E=g.onEditClick,B=g.onToggleRenderAll,L=s(null),M=r(d([]),2),z=M[0],F=M[1],U=r(d(-1),2),W=U[0],$=U[1],q=r(d(-1),2),G=q[0],H=q[1],J=r(d(!N),2),K=J[0],Q=J[1],V=null!=(h=null==L||null==(b=L.current)||null==(y=b.getBoundingClientRect())?void 0:y.width)?h:-1,X=function(t){Q(t),null==B||B(t)},Y=function(n){if("number"==typeof T)return T;var e,r="function"==typeof E?60:32,l=z.reduce(function(e,l,o){var u,a,c,s=l.itemRef;if(e.skip)return e;var d=(null==s?void 0:s.current)&&window.getComputedStyle(s.current),f=[parseInt(null==(c=s.current)||null==(a=c.getBoundingClientRect())?void 0:a.width,10),parseInt(null==d?void 0:d.marginLeft,10),parseInt(null==d?void 0:d.marginRight,10)].reduce(function(t,n){return isNaN(n)||(t+=n),t},0);return!isNaN(f)&&f>0&&f+e.width<n-r||0===o?e={count:e.count+1,width:e.width+f,items:((function(n){if(Array.isArray(n))return t(n)})(u=e.items)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(u)||i(u)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat([{w:f,r:null==s?void 0:s.current}])}:e.skip=!0,e},{count:0,width:0,items:[],skip:!1});return(null==l||null==(e=l.items)?void 0:e.length)===1&&z.length>1&&(l.items[0].r.style.maxWidth="".concat(n-r-8,"px")),null==l?void 0:l.count},Z=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};null==t||t.preventDefault(),null==t||t.stopPropagation(),n(t)};return a(function(){$(-1),H(-1),X(!1),F(P.map(function(t){return e(n({},t),{itemRef:u()})}))},[P]),c(function(){if(N&&-1!==V&&-1===W){var t,n=V;0===n&&(n=parseInt((null==L?void 0:L.current)?null==(t=window.getComputedStyle(null==L?void 0:L.current))?void 0:t.width:0)),isNaN(n)||$(Y(n))}},[z,V,null==L?void 0:L.current]),c(function(){H(W)},[W]),a(function(){H(K?null==z?void 0:z.length:W)},[K]),a(function(){(null==L?void 0:L.current)&&R&&(R.current=null==L?void 0:L.current)},[null==L?void 0:L.current]),o("div",{className:f("tag-list_wrapper","".concat(G===(null==z?void 0:z.length)&&N&&-1!==W&&W!==(null==z?void 0:z.length)?"tag-list_wrapper--all-items":"tag-list_wrapper--only-static-items"),O,{"tag-list_wrapper--disabled":w}),style:{visibility:-1===W?"hidden":"visible",zIndex:-1===W?"-1":"auto"},ref:L,children:[(null!=D?D:z.map(function(t){var n=t.value,e=t.id;return null!=n?n:e})).map(function(t,r){var i,o,u=z.find(function(n){var e=n.value,r=n.id;return(null!=e?e:r)===t});if(!u)return null;var a=-1!==G&&-1!==W&&r>=G;return l("div",{className:"tag-list_wrapper_item ".concat(a?"tag-list_wrapper_item--hidden":""),ref:m(null==u?void 0:u.itemRef),children:l(v,e(n({testId:"test-taglist-item-".concat(null!=(i=null==u?void 0:u.id)?i:null==u?void 0:u.value)},u),{onClick:j,removeItem:S}))},"tag-list-item-".concat(null!=(o=null==u?void 0:u.id)?o:null==u?void 0:u.value))}),function(){if((null==z?void 0:z.length)<T||!(null==z?void 0:z.length)||A)return null;var t=z.length-G;return 0!==t&&N&&-1!==W?l(v,{label:"+".concat(t),className:"tag-list_wrapper_render-more",onClick:A?function(){}:function(t){return Z(t,function(){return X(!0)})}}):null}(),G===(null==z?void 0:z.length)&&N&&-1!==W&&W!==(null==z?void 0:z.length)?l(v,{label:"...",className:"tag-list_wrapper_hide-more",onClick:function(t){return Z(t,function(){return X(!1)})}}):null,"function"==typeof E&&l("div",{className:"tag-list__edit-trigger",children:l(p,{onClick:E})})]})}
|
|
@@ -1,73 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports, "__esModule", {
|
|
2
|
-
value: !0
|
|
3
|
-
}), Object.defineProperty(exports, "default", {
|
|
4
|
-
enumerable: !0,
|
|
5
|
-
get: function() {
|
|
6
|
-
return o;
|
|
7
|
-
}
|
|
8
|
-
});
|
|
9
|
-
var e = require("react/jsx-runtime"), r = l(require("classnames"));
|
|
10
|
-
require("react");
|
|
11
|
-
var a = require("../../../Functions/utils"), s = l(require("../../FormElements/Label/Label")), t = l(require("../Button/Button"));
|
|
12
|
-
function l(e) {
|
|
13
|
-
return e && e.__esModule ? e : {
|
|
14
|
-
default: e
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
require("./UserBox.scss");
|
|
18
|
-
var o = function(l) {
|
|
19
|
-
var o = l.name, n = void 0 === o ? 'Username' : o, d = l.role, i = l.id, u = l.onClick, c = l.isModal, x = l.className, b = l.colors, m = l.testId, v = n.charAt(0).toUpperCase();
|
|
20
|
-
return (0, e.jsx)("div", {
|
|
21
|
-
"data-testid": void 0 === m ? 'userbox' : m,
|
|
22
|
-
className: (0, r.default)('td-user-box', x),
|
|
23
|
-
role: "region",
|
|
24
|
-
"aria-label": "User box for ".concat(n),
|
|
25
|
-
children: c ? (0, e.jsxs)(e.Fragment, {
|
|
26
|
-
children: [
|
|
27
|
-
(0, e.jsx)("div", {
|
|
28
|
-
style: {
|
|
29
|
-
backgroundColor: (0, a.getColorById)(i, b)
|
|
30
|
-
},
|
|
31
|
-
className: "td-user-box__avatar",
|
|
32
|
-
children: v
|
|
33
|
-
}),
|
|
34
|
-
(0, e.jsxs)("div", {
|
|
35
|
-
className: "td-user-box__user-data",
|
|
36
|
-
children: [
|
|
37
|
-
(0, e.jsx)(t.default, {
|
|
38
|
-
className: "p0 no-shadow",
|
|
39
|
-
onClick: u,
|
|
40
|
-
label: n,
|
|
41
|
-
variant: "link"
|
|
42
|
-
}),
|
|
43
|
-
d && (0, e.jsx)("span", {
|
|
44
|
-
children: d
|
|
45
|
-
})
|
|
46
|
-
]
|
|
47
|
-
})
|
|
48
|
-
]
|
|
49
|
-
}) : (0, e.jsxs)(e.Fragment, {
|
|
50
|
-
children: [
|
|
51
|
-
(0, e.jsx)("div", {
|
|
52
|
-
style: {
|
|
53
|
-
backgroundColor: (0, a.getColorById)(i)
|
|
54
|
-
},
|
|
55
|
-
className: "td-user-box__avatar",
|
|
56
|
-
children: v
|
|
57
|
-
}),
|
|
58
|
-
(0, e.jsxs)("div", {
|
|
59
|
-
className: "td-user-box__user-data",
|
|
60
|
-
children: [
|
|
61
|
-
(0, e.jsx)(s.default, {
|
|
62
|
-
label: n
|
|
63
|
-
}),
|
|
64
|
-
d && (0, e.jsx)("span", {
|
|
65
|
-
"aria-label": "User role: ".concat(d),
|
|
66
|
-
children: d
|
|
67
|
-
})
|
|
68
|
-
]
|
|
69
|
-
})
|
|
70
|
-
]
|
|
71
|
-
})
|
|
72
|
-
});
|
|
73
|
-
};
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return o}});var e=require("react/jsx-runtime"),r=l(require("classnames"));require("react");var a=require("../../../Functions/utils"),s=l(require("../../FormElements/Label/Label")),t=l(require("../Button/Button"));function l(e){return e&&e.__esModule?e:{default:e}}require("./UserBox.scss");var o=function(l){var o=l.name,n=void 0===o?"Username":o,d=l.role,i=l.id,u=l.onClick,c=l.isModal,x=l.className,b=l.colors,m=l.testId,v=n.charAt(0).toUpperCase();return(0,e.jsx)("div",{"data-testid":void 0===m?"userbox":m,className:(0,r.default)("td-user-box",x),role:"region","aria-label":"User box for ".concat(n),children:c?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{style:{backgroundColor:(0,a.getColorById)(i,b)},className:"td-user-box__avatar",children:v}),(0,e.jsxs)("div",{className:"td-user-box__user-data",children:[(0,e.jsx)(t.default,{className:"p0 no-shadow",onClick:u,label:n,variant:"link"}),d&&(0,e.jsx)("span",{children:d})]})]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{style:{backgroundColor:(0,a.getColorById)(i)},className:"td-user-box__avatar",children:v}),(0,e.jsxs)("div",{className:"td-user-box__user-data",children:[(0,e.jsx)(s.default,{label:n}),d&&(0,e.jsx)("span",{"aria-label":"User role: ".concat(d),children:d})]})]})})};
|
|
@@ -1,84 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import Status from '../Status/Status';
|
|
3
|
-
export const WIZARD_STEP_VARIANTS = Object.freeze({
|
|
4
|
-
DEFAULT: 'default',
|
|
5
|
-
DONE: 'done',
|
|
6
|
-
ACTIVE: 'active',
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
const JSXMockComponent = () => {
|
|
10
|
-
const arr = [
|
|
11
|
-
{ title: 'Requested Amont', value: '$15,000' },
|
|
12
|
-
{ title: 'Repayment Amount', value: '$15,001' },
|
|
13
|
-
{ title: 'Repayment Date', value: '12/12/2021' },
|
|
14
|
-
]
|
|
15
|
-
|
|
16
|
-
const textStyles = {
|
|
17
|
-
fontSize: '14px',
|
|
18
|
-
fontWeight: 400,
|
|
19
|
-
lineHeight: '20px',
|
|
20
|
-
letterSpacing: '0.2px'
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
return arr.map(row => {
|
|
24
|
-
return <div style={{ display: 'flex', justifyContent: 'space-between', maxWidth: '250px'}}>
|
|
25
|
-
<span style={textStyles}>{row.title}</span>
|
|
26
|
-
<span style={textStyles}>{row.value}</span>
|
|
27
|
-
</div>
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export const mockData = [
|
|
32
|
-
{
|
|
33
|
-
key: 'businessInfo',
|
|
34
|
-
label: 'Provide Business Info',
|
|
35
|
-
description: 'This information will help us to evaluate your application',
|
|
36
|
-
isFinished: true,
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
key: 'principal',
|
|
40
|
-
label: 'Add Principal Information',
|
|
41
|
-
description: 'A principal is essentially another name for a company owner. At some corporations, the principal is also the founder, CEO, or even the chief investor',
|
|
42
|
-
isFinished: true,
|
|
43
|
-
isOptional: true,
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
key: 'coOwners',
|
|
47
|
-
label: 'Add Co-Owners',
|
|
48
|
-
description: '{merchantName} will receive that amount from {lenderNmae}',
|
|
49
|
-
isActive: true,
|
|
50
|
-
titleSlot: <span className='custom-title-slot'>$15,001</span>,
|
|
51
|
-
contentSlot: <JSXMockComponent />,
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
key: 'bankAccount',
|
|
55
|
-
label: 'Add a Bank Account',
|
|
56
|
-
description: 'Your bank account information will be used to securely and automatically transfer the funds',
|
|
57
|
-
titleSlot: <Status label="Some JSX" status="draft" />,
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
key: 'documents',
|
|
61
|
-
label: 'Upload Documents',
|
|
62
|
-
description: 'Please upload the required documents',
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
key: 'review',
|
|
66
|
-
label: 'Review & Submit',
|
|
67
|
-
description: 'Please review the information and submit your application',
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
key: 'success',
|
|
71
|
-
label: 'Success',
|
|
72
|
-
description: 'Your application has been submitted successfully',
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
key: 'failure',
|
|
76
|
-
label: 'Failure',
|
|
77
|
-
description: 'Your application has been failed',
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
key: 'pending',
|
|
81
|
-
label: 'Pending',
|
|
82
|
-
description: 'Your application is under review',
|
|
83
|
-
},
|
|
84
|
-
]
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import"react";import i from"../Status/Status";export var WIZARD_STEP_VARIANTS=Object.freeze({DEFAULT:"default",DONE:"done",ACTIVE:"active"});export var mockData=[{key:"businessInfo",label:"Provide Business Info",description:"This information will help us to evaluate your application",isFinished:!0},{key:"principal",label:"Add Principal Information",description:"A principal is essentially another name for a company owner. At some corporations, the principal is also the founder, CEO, or even the chief investor",isFinished:!0,isOptional:!0},{key:"coOwners",label:"Add Co-Owners",description:"{merchantName} will receive that amount from {lenderNmae}",isActive:!0,titleSlot:e("span",{className:"custom-title-slot",children:"$15,001"}),contentSlot:e(function(){var i={fontSize:"14px",fontWeight:400,lineHeight:"20px",letterSpacing:"0.2px"};return[{title:"Requested Amont",value:"$15,000"},{title:"Repayment Amount",value:"$15,001"},{title:"Repayment Date",value:"12/12/2021"}].map(function(a){return t("div",{style:{display:"flex",justifyContent:"space-between",maxWidth:"250px"},children:[e("span",{style:i,children:a.title}),e("span",{style:i,children:a.value})]})})},{})},{key:"bankAccount",label:"Add a Bank Account",description:"Your bank account information will be used to securely and automatically transfer the funds",titleSlot:e(i,{label:"Some JSX",status:"draft"})},{key:"documents",label:"Upload Documents",description:"Please upload the required documents"},{key:"review",label:"Review & Submit",description:"Please review the information and submit your application"},{key:"success",label:"Success",description:"Your application has been submitted successfully"},{key:"failure",label:"Failure",description:"Your application has been failed"},{key:"pending",label:"Pending",description:"Your application is under review"}];
|