intelicoreact 1.8.8 → 1.8.10

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.
Files changed (128) hide show
  1. package/dist/Atomic/FormElements/Dropdown/components/DropdownLoader.jsx +18 -1
  2. package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN_old.jsx +121 -1
  3. package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.jsx +507 -1
  4. package/dist/Atomic/FormElements/MultiSelect/MultiSelect.jsx +46 -1
  5. package/dist/Atomic/FormElements/NumericInput/NumericInput.jsx +337 -1
  6. package/dist/Atomic/FormElements/RadioGroup/RadioGroup.jsx +66 -1
  7. package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.jsx +78 -1
  8. package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.jsx +54 -1
  9. package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.jsx +183 -1
  10. package/dist/Atomic/FormElements/RangeList/RangeList.jsx +181 -1
  11. package/dist/Atomic/FormElements/RangeList/partial/RangeListRow.jsx +41 -1
  12. package/dist/Atomic/FormElements/RangeSlider/RangeSlider.jsx +449 -1
  13. package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.jsx +865 -1
  14. package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.jsx +37 -1
  15. package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.jsx +48 -1
  16. package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.jsx +62 -1
  17. package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.jsx +175 -1
  18. package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.jsx +65 -1
  19. package/dist/Atomic/FormElements/TagListToDropdown/TagListToDropdown.jsx +118 -1
  20. package/dist/Atomic/FormElements/Text/Text.jsx +126 -1
  21. package/dist/Atomic/FormElements/Textarea/Textarea.jsx +61 -1
  22. package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.jsx +181 -1
  23. package/dist/Atomic/FormElements/TieredCheckboxes/partial/AccordionWithCheckbox.jsx +60 -1
  24. package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.jsx +83 -1
  25. package/dist/Atomic/FormElements/VariantsListRadio/partials/VariantsListRadioItem.jsx +80 -1
  26. package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.jsx +103 -1
  27. package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.jsx +115 -1
  28. package/dist/Atomic/Layout/Header/Header.jsx +86 -1
  29. package/dist/Atomic/Layout/MainMenu/MainMenu.jsx +164 -1
  30. package/dist/Atomic/UI/AccordionTable/AccordionTable.jsx +250 -1
  31. package/dist/Atomic/UI/AccordionText/AccordionText.jsx +68 -1
  32. package/dist/Atomic/UI/Arrow/Arrow.jsx +134 -1
  33. package/dist/Atomic/UI/Box/Box.jsx +53 -1
  34. package/dist/Atomic/UI/Chart/Chart.jsx +178 -1
  35. package/dist/Atomic/UI/Chart/partial/ChartTypeSwitcherIcon/ChartTypeSwitcherIcon.jsx +78 -1
  36. package/dist/Atomic/UI/Chart/partial/optionsConstructor.jsx +334 -1
  37. package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.jsx +111 -1
  38. package/dist/Atomic/UI/DateTime/DateTime.jsx +57 -1
  39. package/dist/Atomic/UI/DebugContainer/DebugContainer.jsx +44 -1
  40. package/dist/Atomic/UI/DebugContainer/useDebugContainer.jsx +15 -1
  41. package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.jsx +223 -1
  42. package/dist/Atomic/UI/MonoAccordion/MonoAccordion._test.jsx +75 -1
  43. package/dist/Atomic/UI/MonoAccordion/MonoAccordion.jsx +86 -1
  44. package/dist/Atomic/UI/PieChart/PieChart.jsx +41 -1
  45. package/dist/Atomic/UI/Table/Partials/TdCell.jsx +87 -1
  46. package/dist/Atomic/UI/Table/Partials/TdHeader.jsx +36 -1
  47. package/dist/Atomic/UI/Table/Partials/TdRow.jsx +103 -1
  48. package/dist/Atomic/UI/Table/Partials/TdTitle.jsx +55 -1
  49. package/dist/Atomic/UI/Table/Table.jsx +63 -1
  50. package/dist/Atomic/UI/Table/TdTypes/TdActions.jsx +80 -1
  51. package/dist/Atomic/UI/Table/TdTypes/TdPriority.jsx +26 -1
  52. package/dist/Atomic/UI/Table/TdTypes/TdRange.jsx +13 -1
  53. package/dist/Atomic/UI/Table/TdTypes/TdWeight.jsx +56 -1
  54. package/dist/Atomic/UI/TagList/TagList.jsx +256 -1
  55. package/dist/Atomic/UI/WizardStepper/constructor.jsx +86 -1
  56. package/dist/Classes/RESTAPI/partials/CredentialsProcessing.jsx +254 -1
  57. package/dist/Functions/customEventListener.jsx +96 -1
  58. package/dist/Functions/operations.jsx +138 -1
  59. package/dist/Functions/useFormTools/functions/RenderFields.jsx +108 -1
  60. package/dist/Functions/useFormTools/index.jsx +777 -1
  61. package/dist/Functions/usePasswordChecker.jsx +128 -1
  62. package/dist/Functions/utils.jsx +492 -1
  63. package/dist/Molecular/CustomIcons/components/AffiliateNetworks.jsx +22 -1
  64. package/dist/Molecular/CustomIcons/components/AlertCircle.jsx +24 -1
  65. package/dist/Molecular/CustomIcons/components/AppStore.jsx +30 -1
  66. package/dist/Molecular/CustomIcons/components/Arrow.jsx +33 -1
  67. package/dist/Molecular/CustomIcons/components/ArrowDown.jsx +18 -1
  68. package/dist/Molecular/CustomIcons/components/ArrowLeft.jsx +23 -1
  69. package/dist/Molecular/CustomIcons/components/ArrowRight.jsx +23 -1
  70. package/dist/Molecular/CustomIcons/components/ArrowUp.jsx +18 -1
  71. package/dist/Molecular/CustomIcons/components/Bell.jsx +16 -1
  72. package/dist/Molecular/CustomIcons/components/Button.jsx +13 -1
  73. package/dist/Molecular/CustomIcons/components/Campaigns.jsx +17 -1
  74. package/dist/Molecular/CustomIcons/components/Check.jsx +15 -1
  75. package/dist/Molecular/CustomIcons/components/Check2.jsx +13 -1
  76. package/dist/Molecular/CustomIcons/components/ChevronDown.jsx +13 -1
  77. package/dist/Molecular/CustomIcons/components/ChevronDownDisabled.jsx +12 -1
  78. package/dist/Molecular/CustomIcons/components/ChevronLeft.jsx +12 -1
  79. package/dist/Molecular/CustomIcons/components/ChevronRight.jsx +12 -1
  80. package/dist/Molecular/CustomIcons/components/ChevronUp.jsx +12 -1
  81. package/dist/Molecular/CustomIcons/components/ChevronUpDown.jsx +28 -1
  82. package/dist/Molecular/CustomIcons/components/Close.jsx +15 -1
  83. package/dist/Molecular/CustomIcons/components/ColumnsOrder.jsx +18 -1
  84. package/dist/Molecular/CustomIcons/components/Delete.jsx +17 -1
  85. package/dist/Molecular/CustomIcons/components/Edit.jsx +16 -1
  86. package/dist/Molecular/CustomIcons/components/Email.jsx +32 -1
  87. package/dist/Molecular/CustomIcons/components/FinturfLogo.jsx +19 -1
  88. package/dist/Molecular/CustomIcons/components/FinturfLogo2.jsx +36 -1
  89. package/dist/Molecular/CustomIcons/components/Flows.jsx +16 -1
  90. package/dist/Molecular/CustomIcons/components/Gift.jsx +26 -1
  91. package/dist/Molecular/CustomIcons/components/GoogleAuth.jsx +30 -1
  92. package/dist/Molecular/CustomIcons/components/GooglePlay.jsx +30 -1
  93. package/dist/Molecular/CustomIcons/components/HelpCircle.jsx +20 -1
  94. package/dist/Molecular/CustomIcons/components/HelpCircle2.jsx +21 -1
  95. package/dist/Molecular/CustomIcons/components/HelpCircleFilled.jsx +20 -1
  96. package/dist/Molecular/CustomIcons/components/Home.jsx +17 -1
  97. package/dist/Molecular/CustomIcons/components/Home2.jsx +23 -1
  98. package/dist/Molecular/CustomIcons/components/Key.jsx +24 -1
  99. package/dist/Molecular/CustomIcons/components/Landers.jsx +21 -1
  100. package/dist/Molecular/CustomIcons/components/Lock.jsx +16 -1
  101. package/dist/Molecular/CustomIcons/components/Mail.jsx +27 -1
  102. package/dist/Molecular/CustomIcons/components/Mastercard.jsx +74 -1
  103. package/dist/Molecular/CustomIcons/components/Minus.jsx +26 -1
  104. package/dist/Molecular/CustomIcons/components/Offers.jsx +17 -1
  105. package/dist/Molecular/CustomIcons/components/Pause.jsx +29 -1
  106. package/dist/Molecular/CustomIcons/components/PayPal.jsx +42 -1
  107. package/dist/Molecular/CustomIcons/components/PayPalLightLarge.jsx +29 -1
  108. package/dist/Molecular/CustomIcons/components/Phone.jsx +31 -1
  109. package/dist/Molecular/CustomIcons/components/Play.jsx +26 -1
  110. package/dist/Molecular/CustomIcons/components/Plus.jsx +26 -1
  111. package/dist/Molecular/CustomIcons/components/Profile.jsx +17 -1
  112. package/dist/Molecular/CustomIcons/components/QRCode.jsx +30 -1
  113. package/dist/Molecular/CustomIcons/components/Rectangle.jsx +13 -1
  114. package/dist/Molecular/CustomIcons/components/Revert.jsx +14 -1
  115. package/dist/Molecular/CustomIcons/components/Star.jsx +15 -1
  116. package/dist/Molecular/CustomIcons/components/Star2.jsx +17 -1
  117. package/dist/Molecular/CustomIcons/components/TrafficSources.jsx +15 -1
  118. package/dist/Molecular/CustomIcons/components/Trash.jsx +16 -1
  119. package/dist/Molecular/CustomIcons/components/TrashRed.jsx +16 -1
  120. package/dist/Molecular/CustomIcons/components/Triggers.jsx +16 -1
  121. package/dist/Molecular/CustomIcons/components/User.jsx +26 -1
  122. package/dist/Molecular/CustomIcons/components/Visa.jsx +32 -1
  123. package/dist/Molecular/CustomIcons/components/X.jsx +13 -1
  124. package/dist/Molecular/FormElement/FormElement.jsx +52 -1
  125. package/dist/Molecular/FormWithDependOn/FormWithDependOn.jsx +161 -1
  126. package/dist/Molecular/InputAddress/InputAddress.jsx +641 -1
  127. package/dist/Molecular/InputPassword/InputPassword.jsx +50 -1
  128. package/package.json +1 -1
@@ -1 +1,61 @@
1
- import{jsx as t}from"react/jsx-runtime";import e from"classnames";import{useEffect as a,useRef as o}from"react";import{formatToOnlyASCIICodeText as n}from"../../../Functions/fieldValueFormatters";import"./Textarea.scss";var r="textarea";export default function(i){var l=i.ref,c=i.id,s=i.value,u=i.onChange,d=i.onFocus,f=i.onBlur,m=i.placeholder,h=i.disabled,v=i.className,p=i.isNotValidateASCII,x=void 0!==p&&p,g=i.testId,w=void 0===g?r:g,y=i.withAutoGrow,F=i.onKeyDown,N=o(),C=l||N,I=function(t){var e=t;x||(e=n(e)),u(e)},b=function(t){t.style.height="5px",t.style.height="".concat(t.scrollHeight,"px")};return a(function(){y&&b(null==C?void 0:C.current)},[s,y]),t("div",{"data-testid":w,className:e("".concat(r),v),children:t("textarea",{id:null!=c?c:Math.random().toString(16).slice(2),"data-testid":"".concat(w,"-textarea"),className:"".concat(r,"__textarea"),value:s,onChange:function(t){return I(t.target.value)},placeholder:m,disabled:h,onKeyDown:void 0===F?function(){}:F,ref:C,onFocus:function(t){null==d||d(t)},onBlur:function(t){null==f||f(t)}})})}
1
+ import cn from 'classnames';
2
+
3
+ import { useEffect, useRef } from 'react';
4
+
5
+ import { formatToOnlyASCIICodeText } from '../../../Functions/fieldValueFormatters';
6
+
7
+ import './Textarea.scss';
8
+
9
+ const RC = 'textarea';
10
+
11
+ function Textarea({ ref, id, value, onChange, onFocus, onBlur, placeholder, disabled, className, isNotValidateASCII = false, testId = RC, withAutoGrow, onKeyDown = () => {} }) {
12
+ const internalRef = useRef();
13
+ const textareaRef = ref || internalRef;
14
+
15
+ const handle = {
16
+ change: (val) => {
17
+ let inputValue = val;
18
+ if (!isNotValidateASCII)
19
+ inputValue = formatToOnlyASCIICodeText(inputValue);
20
+
21
+ onChange(inputValue);
22
+ },
23
+ focus: (e) => {
24
+ onFocus?.(e);
25
+ },
26
+ blur: (e) => {
27
+ onBlur?.(e);
28
+ },
29
+ };
30
+
31
+ const autoGrow = (el) => {
32
+ el.style.height = '5px';
33
+ el.style.height = `${el.scrollHeight}px`;
34
+ };
35
+
36
+ useEffect(() => {
37
+ if (withAutoGrow) {
38
+ autoGrow(textareaRef?.current);
39
+ }
40
+ }, [value, withAutoGrow]);
41
+
42
+ return (
43
+ <div data-testid={testId} className={cn(`${RC}`, className)}>
44
+ <textarea
45
+ id={id ?? Math.random().toString(16).slice(2)}
46
+ data-testid={`${testId}-textarea`}
47
+ className={`${RC}__textarea`}
48
+ value={value}
49
+ onChange={e => handle.change(e.target.value)}
50
+ placeholder={placeholder}
51
+ disabled={disabled}
52
+ onKeyDown={onKeyDown}
53
+ ref={textareaRef}
54
+ onFocus={handle.focus}
55
+ onBlur={handle.blur}
56
+ />
57
+ </div>
58
+ );
59
+ }
60
+
61
+ export default Textarea;
@@ -1 +1,181 @@
1
- function e(e,n){(null==n||n>e.length)&&(n=e.length);for(var r=0,t=Array(n);r<n;r++)t[r]=e[r];return t}function n(e,n,r){return n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function r(n){return function(n){if(Array.isArray(n))return e(n)}(n)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||function(n,r){if(n){if("string"==typeof n)return e(n,void 0);var t=Object.prototype.toString.call(n).slice(8,-1);if("Object"===t&&n.constructor&&(t=n.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return e(n,r)}}(n)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}import{jsx as t}from"react/jsx-runtime";import{createElement as i}from"react";import o from"classnames";import{useMemo as a}from"react";import{compareAlphabetical as c}from"../../../Functions/utils";import l from"../CheckboxInput/CheckboxInput";import u from"./partial/AccordionWithCheckbox";import"./TieredCheckboxes.scss";var s="tiered-checkboxes";export default function(e){var d=e.items,f=void 0===d?{}:d,p=e.className,v=e.onChange,y=e.isUseParentsClassesAsDataset,b=e.isUseAccordionForGroup,h=e.accordionIcons,m=e.isOnlyOne,O=void 0!==m&&m,k=e.sortGroups,g=void 0!==k&&k,j=e.sortGroupItems,P=void 0!==j&&j,C={changeParent:function(e,n,t){var i=f.find(function(e){return e.key===n});t?i[t]=e:i.value=e,t||(e?i.children.filter(function(e){return!e.disabled}).forEach(function(e){return e.value=!0}):i.children.filter(function(e){return!e.disabled}).forEach(function(e){return e.value=!1})),v(r(f))},changeChild:function(e,n,t){if(O){var i=f.find(function(e){return e.key===t});i.children.find(function(e){return e.key===n}).value=e,i.children.map(function(r){return r.key!==n&&!0===e?(r.disabled=!0,i.disabled=!0):r.key!==n&&!1===e?(r.disabled=!1,i.disabled=!1):r.disabled=!1,r}),i.disabled=!0}else{var o=f.find(function(e){return e.key===t});o.children.find(function(e){return e.key===n}).value=e,o.children.every(function(e){return e.value})?o.value=!0:o.value=!1}v(r(f))},isAllChecked:function(e){return(null==e?void 0:e.children.some(function(e){return e.value}))&&!(null==e?void 0:e.children.every(function(e){return e.value}))}},A=a(function(){var e=r(f);return g&&(e=null==e?void 0:e.sort(c)),P&&(e=null==e?void 0:e.map(function(e){if(null==e?void 0:e.children){var n;e.children=null==e||null==(n=e.children)?void 0:n.sort(c)}return e})),e},[f]),w=function(e){return e.children&&e.children.map(function(n){return t("div",{className:"".concat(s,"__children"),children:t(l,{testId:n.key,label:n.label,value:n.value,disabled:null==n?void 0:n.disabled,onChange:function(r){return C.changeChild(r,n.key,e.key)}})},n.key)})};return t("div",{className:o(s,p),children:A.map(function(e){var r,a,c=y&&(null==e?void 0:e.className)?{"data-key":null==e?void 0:e.className}:{};return b?t(u,{RC:s,parent:e,datasetProp:c,isUseParentsClassesAsDataset:y,className:"".concat(s,"__mono-accordion"),setIsOpen:function(){return C.changeParent(!e.isOpen,e.key,"isOpen")},onChange:function(n){return C.changeParent(n,e.key)},icon:e.isOpen?(null==h?void 0:h[1])||null:(null==h?void 0:h[0])||null,children:w(e)},e.key):i("div",(r=function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},i=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.forEach(function(r){n(e,r,t[r])})}return e}({},c),a=a={key:e.key,className:o("".concat(s,"__parents"),n({},"".concat(e.className),!y)),children:[t(l,{isStark:C.isAllChecked(e),label:e.label,value:e.value,onChange:function(n){return C.changeParent(n,e.key)},disabled:e.children.every(function(e){return!0===e.disabled})||e.disabled}),t("div",{className:o("".concat(s,"__parent__children")),children:w(e)})]},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(a)):(function(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r})(Object(a)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(a,e))}),r))})})}
1
+ import cn from 'classnames';
2
+
3
+ import { useMemo } from 'react';
4
+
5
+ import { compareAlphabetical } from '../../../Functions/utils';
6
+ import CheckboxInput from '../CheckboxInput/CheckboxInput';
7
+
8
+ import AccordionWithCheckbox from './partial/AccordionWithCheckbox';
9
+
10
+ import './TieredCheckboxes.scss';
11
+
12
+ const RC = 'tiered-checkboxes';
13
+
14
+ function TieredCheckboxes({
15
+ items = {},
16
+ className,
17
+ onChange,
18
+ isUseParentsClassesAsDataset,
19
+ isUseAccordionForGroup,
20
+ accordionIcons,
21
+ isOnlyOne = false,
22
+ sortGroups = false,
23
+ sortGroupItems = false,
24
+ }) {
25
+ const handle = {
26
+ changeParent: (value, key, prop) => {
27
+ const parent = items.find(item => item.key === key);
28
+ if (prop) parent[prop] = value;
29
+ else parent.value = value;
30
+
31
+ if (!prop) {
32
+ if (value) {
33
+ parent.children
34
+ .filter(({ disabled }) => !disabled)
35
+ .forEach(item => (item.value = true));
36
+ }
37
+ else {
38
+ parent.children
39
+ .filter(({ disabled }) => !disabled)
40
+ .forEach(item => (item.value = false));
41
+ }
42
+ }
43
+ onChange([...items]);
44
+ },
45
+ changeChild: (value, key, parentKey) => {
46
+ if (isOnlyOne) {
47
+ const parent = items.find(item => item.key === parentKey);
48
+ parent.children.find(item => item.key === key).value = value;
49
+
50
+ parent.children.map((item) => {
51
+ if (item.key !== key && value === true) {
52
+ item.disabled = true;
53
+ parent.disabled = true;
54
+ }
55
+ else if (item.key !== key && value === false) {
56
+ item.disabled = false;
57
+ parent.disabled = false;
58
+ }
59
+ else {
60
+ item.disabled = false;
61
+ }
62
+ return item;
63
+ });
64
+
65
+ parent.disabled = true;
66
+ }
67
+ else {
68
+ const parent = items.find(item => item.key === parentKey);
69
+ parent.children.find(item => item.key === key).value = value;
70
+
71
+ if (parent.children.every(item => item.value)) parent.value = true;
72
+ else parent.value = false;
73
+ }
74
+
75
+ onChange([...items]);
76
+ },
77
+ isAllChecked: (item) => {
78
+ return (
79
+ item?.children.some(item => item.value)
80
+ && !item?.children.every(item => item.value)
81
+ );
82
+ },
83
+ };
84
+
85
+ const preparedItems = useMemo(() => {
86
+ let newItems = [...items];
87
+
88
+ if (sortGroups) {
89
+ newItems = newItems?.sort(compareAlphabetical);
90
+ }
91
+
92
+ if (sortGroupItems) {
93
+ newItems = newItems?.map((parent) => {
94
+ if (parent?.children) {
95
+ parent.children = parent?.children?.sort(compareAlphabetical);
96
+ }
97
+
98
+ return parent;
99
+ });
100
+ }
101
+
102
+ return newItems;
103
+ }, [items]);
104
+
105
+ const renderInner = (parent) => {
106
+ return (
107
+ parent.children
108
+ && parent.children.map(child => (
109
+ <div key={child.key} className={`${RC}__children`}>
110
+ <CheckboxInput
111
+ testId={child.key}
112
+ label={child.label}
113
+ value={child.value}
114
+ disabled={child?.disabled}
115
+ onChange={value =>
116
+ handle.changeChild(value, child.key, parent.key)}
117
+ />
118
+ </div>
119
+ ))
120
+ );
121
+ };
122
+
123
+ return (
124
+ <div className={cn(RC, className)}>
125
+ {preparedItems.map((parent) => {
126
+ const datasetProp
127
+ = isUseParentsClassesAsDataset && parent?.className
128
+ ? { 'data-key': parent?.className }
129
+ : {};
130
+ if (isUseAccordionForGroup) {
131
+ return (
132
+ <AccordionWithCheckbox
133
+ key={parent.key}
134
+ RC={RC}
135
+ parent={parent}
136
+ datasetProp={datasetProp}
137
+ isUseParentsClassesAsDataset={isUseParentsClassesAsDataset}
138
+ className={`${RC}__mono-accordion`}
139
+ setIsOpen={() =>
140
+ handle.changeParent(!parent.isOpen, parent.key, 'isOpen')}
141
+ onChange={value => handle.changeParent(value, parent.key)}
142
+ icon={
143
+ !parent.isOpen
144
+ ? accordionIcons?.[0] || null
145
+ : accordionIcons?.[1] || null
146
+ }
147
+ // disabled={parent.children?.every?.((child) => child.disabled)}
148
+ >
149
+ {renderInner(parent)}
150
+ </AccordionWithCheckbox>
151
+ );
152
+ }
153
+ return (
154
+ <div
155
+ {...datasetProp}
156
+ key={parent.key}
157
+ className={cn(`${RC}__parents`, {
158
+ [`${parent.className}`]: !isUseParentsClassesAsDataset,
159
+ })}
160
+ >
161
+ <CheckboxInput
162
+ isStark={handle.isAllChecked(parent)}
163
+ label={parent.label}
164
+ value={parent.value}
165
+ onChange={value => handle.changeParent(value, parent.key)}
166
+ disabled={
167
+ parent.children.every(({ disabled }) => disabled === true)
168
+ || parent.disabled
169
+ }
170
+ />
171
+ <div className={cn(`${RC}__parent__children`)}>
172
+ {renderInner(parent)}
173
+ </div>
174
+ </div>
175
+ );
176
+ })}
177
+ </div>
178
+ );
179
+ }
180
+
181
+ export default TieredCheckboxes;
@@ -1 +1,60 @@
1
- import{jsx as e,jsxs as n,Fragment as l}from"react/jsx-runtime";import a from"classnames";import c from"../../../UI/MonoAccordion/MonoAccordion";import r from"../../CheckboxInput/CheckboxInput";import"../TieredCheckboxes.scss";export default function(i){var t,o,s,d,u,h,m,p,b,f=i.children,v=i.parent,x=i.onChange,C=i.className,g=i.RC,k=i.setIsOpen,N=i.icon,j=i.disabled,I=i.datasetProp,O=i.isUseParentsClassesAsDataset;return e(c,{datasetProp:I,className:a(C,(t={},o="".concat(v.className),s=!O,o in t?Object.defineProperty(t,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[o]=s,t)),isOpen:v.isOpen,onClick:k,icon:N,disabled:j,titleJSX:n(l,{children:[e(r,{className:"".concat(g,"__checkbox-input"),isStark:(null==v||null==(u=v.children)||null==(d=u.some)?void 0:d.call(u,function(e){return e.value}))&&!(null==v||null==(m=v.children)||null==(h=m.every)?void 0:h.call(m,function(e){return e.value})),label:v.label,value:v.value,onChange:x,disabled:v.children.every(function(e){return!0===e.disabled})||v.disabled}),e("span",{className:"".concat(g,"__description-checked"),children:(null==v||null==(p=v.children)?void 0:p.length)?"Selected ".concat(v.children.filter(function(e){return e.value}).length," from ").concat(null==(b=v.children)?void 0:b.length):null})]}),children:f})}
1
+ import cn from 'classnames';
2
+
3
+ import MonoAccordion from '../../../UI/MonoAccordion/MonoAccordion';
4
+ import CheckboxInput from '../../CheckboxInput/CheckboxInput';
5
+
6
+ import '../TieredCheckboxes.scss';
7
+
8
+ function AccordionWithCheckbox({
9
+ children,
10
+ parent,
11
+ onChange,
12
+ className,
13
+ RC,
14
+ setIsOpen,
15
+ icon,
16
+ disabled,
17
+ datasetProp,
18
+ isUseParentsClassesAsDataset,
19
+ }) {
20
+ return (
21
+ <MonoAccordion
22
+ datasetProp={datasetProp}
23
+ className={cn(className, {
24
+ [`${parent.className}`]: !isUseParentsClassesAsDataset,
25
+ })}
26
+ isOpen={parent.isOpen}
27
+ onClick={setIsOpen}
28
+ icon={icon}
29
+ disabled={disabled}
30
+ // disabled={parent.children?.every?.((child) => child.disabled)}
31
+ titleJSX={(
32
+ <>
33
+ <CheckboxInput
34
+ className={`${RC}__checkbox-input`}
35
+ isStark={
36
+ parent?.children?.some?.(item => item.value)
37
+ && !parent?.children?.every?.(item => item.value)
38
+ }
39
+ label={parent.label}
40
+ value={parent.value}
41
+ onChange={onChange}
42
+ disabled={
43
+ parent.children.every(({ disabled }) => disabled === true)
44
+ || parent.disabled
45
+ }
46
+ />
47
+ <span className={`${RC}__description-checked`}>
48
+ {parent?.children?.length
49
+ ? `Selected ${parent.children.filter(child => child.value).length} from ${parent.children?.length}`
50
+ : null}
51
+ </span>
52
+ </>
53
+ )}
54
+ >
55
+ {children}
56
+ </MonoAccordion>
57
+ );
58
+ }
59
+
60
+ export default AccordionWithCheckbox;
@@ -1 +1,83 @@
1
- function t(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}function r(t,r,e){return r in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}function e(r,e){return function(t){if(Array.isArray(t))return t}(r)||function(t,r){var e,n,i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var o=[],a=!0,s=!1;try{for(i=i.call(t);!(a=(e=i.next()).done)&&(o.push(e.value),!r||o.length!==r);a=!0);}catch(t){s=!0,n=t}finally{try{a||null==i.return||i.return()}finally{if(s)throw n}}return o}}(r,e)||function(r,e){if(r){if("string"==typeof r)return t(r,e);var n=Object.prototype.toString.call(r).slice(8,-1);if("Object"===n&&r.constructor&&(n=r.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return t(r,e)}}(r,e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}import{jsx as n}from"react/jsx-runtime";import i from"classnames";import{useEffect as o,useState as a}from"react";import{compare as s}from"../../../Functions/utils";import c from"./partials/VariantsListRadioItem";import"./VariantsListRadio.scss";var l="variants-list-radio";export default function(t){var u,f=t.items,d=t.value,p=t.onChange,b=void 0===p?function(){}:p,m=t.isWithBorders,y=t.itemsContentRenderMode,v=t.isRadioPositionReverse,O=t.isUseAsOptionsList,h=t.disabled,j=t.isDisabled,g=t.id,P=t.className,w=t.testId,A=t.attributesOfNativeInput,S=t.isMixWithPersonalAttributes,D=e(a(f),2),I=D[0],R=D[1],x=e(a(d),2),C=x[0],L=x[1],M=g||"variantsListRadio",N=h||j,E=function(t){L(t),b(t)};return o(function(){s(f,I)||R(f)},[f]),o(function(){C!==d&&L(d)},[d]),n("div",{id:M,"data-testid":void 0===w?"variants-list-radio":w,className:i(l,"".concat(l,"_items-content-").concat("col"===y?"col":"row"),P,(r(u={},"".concat(l,"_with-borders"),m&&!O),r(u,"".concat(l,"_radio-position-reverse"),v),u)),children:I.map(function(t){var e,i;return n(c,{RC:l,parentId:M,item:(e=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),i.forEach(function(e){r(t,e,n[e])})}return t}({},t),i=i={isDisabled:t.disabled||t.isDisabled||N||!1},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):(function(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e.push.apply(e,n)}return e})(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}),e),value:C,onChange:E,attributesOfNativeInput:A,isMixWithPersonalAttributes:S,parentDisabled:h,isUseAsOptionsList:O},"variants-list-radio-id-".concat(M,"-item-id-").concat(t.value))})})}
1
+ import cn from 'classnames';
2
+
3
+ import { useEffect, useState } from 'react';
4
+
5
+ import { compare } from '../../../Functions/utils';
6
+
7
+ import VariantsListRadioItem from './partials/VariantsListRadioItem';
8
+
9
+ import './VariantsListRadio.scss';
10
+
11
+ const RC = 'variants-list-radio';
12
+
13
+ function VariantsListRadio({
14
+ items: outerItems,
15
+ value: outerValue,
16
+ onChange = () => {},
17
+
18
+ isWithBorders,
19
+ itemsContentRenderMode,
20
+ isRadioPositionReverse,
21
+ isUseAsOptionsList,
22
+ disabled,
23
+ isDisabled,
24
+
25
+ id,
26
+ className,
27
+ testId = 'variants-list-radio',
28
+
29
+ attributesOfNativeInput,
30
+ isMixWithPersonalAttributes,
31
+ }) {
32
+ const [items, setItems] = useState(outerItems);
33
+ const [value, setValue] = useState(outerValue);
34
+
35
+ const componentnId = id || 'variantsListRadio';
36
+ const mode = itemsContentRenderMode === 'col' ? 'col' : 'row';
37
+ const isElementDisabled = disabled || isDisabled;
38
+
39
+ const handleChange = (newValue) => {
40
+ setValue(newValue);
41
+ onChange(newValue);
42
+ };
43
+
44
+ useEffect(() => {
45
+ if (!compare(outerItems, items)) setItems(outerItems);
46
+ }, [outerItems]);
47
+
48
+ useEffect(() => {
49
+ if (value !== outerValue) setValue(outerValue);
50
+ }, [outerValue]);
51
+
52
+ return (
53
+ <div
54
+ id={componentnId}
55
+ data-testid={testId}
56
+ className={cn(RC, `${RC}_items-content-${mode}`, className, {
57
+ [`${RC}_with-borders`]: isWithBorders && !isUseAsOptionsList,
58
+ [`${RC}_radio-position-reverse`]: isRadioPositionReverse,
59
+ })}
60
+ >
61
+ {items.map(item => (
62
+ <VariantsListRadioItem
63
+ key={`variants-list-radio-id-${componentnId}-item-id-${item.value}`}
64
+ RC={RC}
65
+ parentId={componentnId}
66
+ item={{
67
+ ...item,
68
+ isDisabled:
69
+ item.disabled || item.isDisabled || isElementDisabled || false,
70
+ }}
71
+ value={value}
72
+ onChange={handleChange}
73
+ attributesOfNativeInput={attributesOfNativeInput}
74
+ isMixWithPersonalAttributes={isMixWithPersonalAttributes}
75
+ parentDisabled={disabled}
76
+ isUseAsOptionsList={isUseAsOptionsList}
77
+ />
78
+ ))}
79
+ </div>
80
+ );
81
+ }
82
+
83
+ export default VariantsListRadio;
@@ -1 +1,80 @@
1
- function t(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function e(e){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{},a=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),a.forEach(function(i){t(e,i,n[i])})}return e}import{jsx as i,jsxs as n}from"react/jsx-runtime";import a from"classnames";import{getIsOnlyAnObject as c}from"../../../../Functions/utils";export default function(r){var o,s=r.RC,l=r.parentId,d=r.item,m=r.value,u=r.onChange,_=void 0===u?function(){}:u,p=r.attributesOfNativeInput,v=void 0===p?{}:p,f=r.isMixWithPersonalAttributes,b=r.isUseAsOptionsList,h=r.testId,N=void 0===h?"variants-list-radio-item":h;if(!l||!c(d))return null;var O=d.value,g=d.label,y=d.description,j=d.isDisabled,w=d.attributesOfNativeInput,x="".concat(l.toString(),"--item-").concat(O),P=l.toString(),I=m===O,S=f?e({},v,w):w||v||{};return n("label",{"data-testid":N,className:a("".concat(s,"__item"),(t(o={},"".concat(s,"__item_disabled"),j),t(o,"".concat(s,"__item_active"),I),t(o,"".concat(s,"__item_as-option"),b),o)),htmlFor:x,children:[i("div",{className:a("".concat(s,"__item-radio-container")),children:n("div",{className:a("".concat(s,"__item-radio")),children:[i("input",e({id:x,"data-testid":"".concat(N,"-input"),type:"radio",checked:I,className:"".concat(s,"__item-radio-input"),onChange:function(){return _(O)},name:P,disabled:j},S)),i("div",{className:"".concat(s,"__item-radio-mark")})]})}),n("div",{className:a("".concat(s,"__item-content")),children:[g&&i("div",{className:a("".concat(s,"__item-content-wrapper")),children:i("div",{className:a("".concat(s,"__item-content-label")),children:g})}),y&&!b&&i("div",{className:a("".concat(s,"__item-content-wrapper")),children:i("div",{className:a("".concat(s,"__item-content-description")),children:y})})]})]})}
1
+ import cn from 'classnames';
2
+
3
+ import { getIsOnlyAnObject } from '../../../../Functions/utils';
4
+
5
+ function VariantsListRadioItem({
6
+ RC,
7
+ parentId,
8
+ item,
9
+ value: actualValue,
10
+ onChange = () => {},
11
+
12
+ attributesOfNativeInput = {},
13
+ isMixWithPersonalAttributes,
14
+
15
+ isUseAsOptionsList,
16
+ testId = 'variants-list-radio-item',
17
+ }) {
18
+ // ? Для корректной работы нужны parentId и item(объект)
19
+ if (!parentId || !getIsOnlyAnObject(item)) return null;
20
+
21
+ const {
22
+ value,
23
+ label,
24
+ description,
25
+ isDisabled,
26
+ attributesOfNativeInput: personalAttributesOfNativeInput,
27
+ } = item;
28
+ const id = `${parentId.toString()}--item-${value}`;
29
+ const name = parentId.toString();
30
+ const isActive = actualValue === value;
31
+ const addAtributesObj = isMixWithPersonalAttributes
32
+ ? { ...attributesOfNativeInput, ...personalAttributesOfNativeInput }
33
+ : personalAttributesOfNativeInput || attributesOfNativeInput || {};
34
+
35
+ return (
36
+ <label
37
+ data-testid={testId}
38
+ className={cn(`${RC}__item`, {
39
+ [`${RC}__item_disabled`]: isDisabled,
40
+ [`${RC}__item_active`]: isActive,
41
+ [`${RC}__item_as-option`]: isUseAsOptionsList,
42
+ })}
43
+ htmlFor={id}
44
+ >
45
+ <div className={cn(`${RC}__item-radio-container`)}>
46
+ <div className={cn(`${RC}__item-radio`)}>
47
+ <input
48
+ id={id}
49
+ data-testid={`${testId}-input`}
50
+ type="radio"
51
+ checked={isActive}
52
+ className={`${RC}__item-radio-input`}
53
+ onChange={() => onChange(value)}
54
+ name={name}
55
+ disabled={isDisabled}
56
+ {...addAtributesObj}
57
+ />
58
+ <div className={`${RC}__item-radio-mark`}></div>
59
+ </div>
60
+ </div>
61
+
62
+ <div className={cn(`${RC}__item-content`)}>
63
+ {label && (
64
+ <div className={cn(`${RC}__item-content-wrapper`)}>
65
+ <div className={cn(`${RC}__item-content-label`)}>{label}</div>
66
+ </div>
67
+ )}
68
+ {description && !isUseAsOptionsList && (
69
+ <div className={cn(`${RC}__item-content-wrapper`)}>
70
+ <div className={cn(`${RC}__item-content-description`)}>
71
+ {description}
72
+ </div>
73
+ </div>
74
+ )}
75
+ </div>
76
+ </label>
77
+ );
78
+ }
79
+
80
+ export default VariantsListRadioItem;
@@ -1 +1,103 @@
1
- function e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function t(t){for(var n=1;n<arguments.length;n++){var c=null!=arguments[n]?arguments[n]:{},a=Object.keys(c);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(c).filter(function(e){return Object.getOwnPropertyDescriptor(c,e).enumerable}))),a.forEach(function(n){e(t,n,c[n])})}return t}function n(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);n.push.apply(n,c)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}import{jsx as c,jsxs as a}from"react/jsx-runtime";import r from"classnames";import"./WidgetPseudoTable.scss";var o="widget-pseudo-table";export default function(l){var i=l||{},s=i.className,d=i.title,u=i.rightHeaderContent,m=i.nullContentData,p=i.isNotRenderThead,h=i.isNoHeader,b=i.columns,_=void 0===b?[]:b,f=i.rows,y=i.CellComponent,v=i.CellComponentProps,O=i.onChange;return a("div",{className:r(o,s),children:[!(void 0!==h&&h)&&a("div",{className:r("".concat(o,"__header")),children:[c("div",{className:r("".concat(o,"__title-block")),children:d}),c("div",{className:r("".concat(o,"__right-header-content-block")),children:u})]}),a("div",{className:r("".concat(o,"__body"),e({},"".concat(o,"__body_no-content"),!(null==f?void 0:f.length))),children:[!!(null==f?void 0:f.length)&&!(void 0!==p&&p)&&c("div",{className:r("".concat(o,"__thead")),children:_.map(function(t){return c("div",{className:r("".concat(o,"__thead-cell"),t.theadCellClassName,t.columnClassName,e({},"".concat(o,"__thead-cell_reqiured"),t.isRequired)),"data-key":t.key,children:t.label},"thead-".concat(t.key))})}),c("div",{className:r("".concat(o,"__table")),children:(null==f?void 0:f.length)?f.map(function(e){return c("div",{className:r("".concat(o,"__row")),"data-id":e.id,children:_.map(function(a){return c("div",{className:r("".concat(o,"__cell"),a.cellClassName,a.columnClassName),children:c(y,n(t({},v),{field:n(t({},a),{value:e[a.key],rowData:e}),onChange:function(t,n){return O(n,a.key,e.id)}}))},"row-".concat(e.id,"-cell-").concat(a.key))})},"row-".concat(e.id))}):c("div",{className:r("".concat(o,"__row")),"data-id":"empty-row",children:c("span",{className:r("".concat(o,"__no-data-content")),children:null!=m?m:"No data"})})})]})]})}
1
+ import cn from 'classnames';
2
+
3
+ import './WidgetPseudoTable.scss';
4
+
5
+ const RC = 'widget-pseudo-table';
6
+
7
+ function WidgetPseudoTable(props) {
8
+ const {
9
+ className,
10
+ title,
11
+ rightHeaderContent,
12
+ nullContentData,
13
+ isNotRenderThead = false,
14
+ isNoHeader = false,
15
+ columns = [],
16
+ rows,
17
+ CellComponent,
18
+ CellComponentProps,
19
+ onChange,
20
+ } = props || {};
21
+
22
+ return (
23
+ <div className={cn(RC, className)}>
24
+ {!isNoHeader && (
25
+ <div className={cn(`${RC}__header`)}>
26
+ <div className={cn(`${RC}__title-block`)}>{title}</div>
27
+ <div className={cn(`${RC}__right-header-content-block`)}>
28
+ {rightHeaderContent}
29
+ </div>
30
+ </div>
31
+ )}
32
+ <div
33
+ className={cn(`${RC}__body`, {
34
+ [`${RC}__body_no-content`]: !rows?.length,
35
+ })}
36
+ >
37
+ {Boolean(rows?.length) && !isNotRenderThead && (
38
+ <div className={cn(`${RC}__thead`)}>
39
+ {columns.map(field => (
40
+ <div
41
+ key={`thead-${field.key}`}
42
+ className={cn(
43
+ `${RC}__thead-cell`,
44
+ field.theadCellClassName,
45
+ field.columnClassName,
46
+ {
47
+ [`${RC}__thead-cell_reqiured`]: field.isRequired,
48
+ },
49
+ )}
50
+ data-key={field.key}
51
+ >
52
+ {field.label}
53
+ </div>
54
+ ))}
55
+ </div>
56
+ )}
57
+
58
+ <div className={cn(`${RC}__table`)}>
59
+ {rows?.length
60
+ ? (
61
+ rows.map(row => (
62
+ <div
63
+ key={`row-${row.id}`}
64
+ className={cn(`${RC}__row`)}
65
+ data-id={row.id}
66
+ >
67
+ {columns.map(cell => (
68
+ <div
69
+ key={`row-${row.id}-cell-${cell.key}`}
70
+ className={cn(
71
+ `${RC}__cell`,
72
+ cell.cellClassName,
73
+ cell.columnClassName,
74
+ )}
75
+ >
76
+ <CellComponent
77
+ {...CellComponentProps}
78
+ field={{
79
+ ...cell,
80
+ value: row[cell.key],
81
+ rowData: row,
82
+ }}
83
+ onChange={(key, val) => onChange(val, cell.key, row.id)}
84
+ />
85
+ </div>
86
+ ))}
87
+ </div>
88
+ ))
89
+ )
90
+ : (
91
+ <div className={cn(`${RC}__row`)} data-id="empty-row">
92
+ <span className={cn(`${RC}__no-data-content`)}>
93
+ {nullContentData ?? 'No data'}
94
+ </span>
95
+ </div>
96
+ )}
97
+ </div>
98
+ </div>
99
+ </div>
100
+ );
101
+ }
102
+
103
+ export default WidgetPseudoTable;