intelicoreact 1.5.40 → 1.5.41
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/package.json +1 -1
- package/dist/Atomic/FormElements/ActionAlert/ActionAlert.interface.js +0 -4
- package/dist/Atomic/FormElements/ActionAlert/ActionAlert.stories.js +0 -89
- package/dist/Atomic/FormElements/ActionAlert/ActionAlert.test.js +0 -130
- package/dist/Atomic/FormElements/ActionAlert/index.js +0 -17
- package/dist/Atomic/FormElements/AdvancedStatus/AdvancedStatus.interface.js +0 -4
- package/dist/Atomic/FormElements/AdvancedStatus/AdvancedStatus.stories.js +0 -81
- package/dist/Atomic/FormElements/AdvancedStatus/AdvancedStatus.test.js +0 -104
- package/dist/Atomic/FormElements/AdvancedStatus/index.js +0 -17
- package/dist/Atomic/FormElements/Calendar/Calendar.props.js +0 -4
- package/dist/Atomic/FormElements/Calendar/Calendar.stories.js +0 -108
- package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.interface.js +0 -4
- package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.stories.js +0 -100
- package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.test.js +0 -143
- package/dist/Atomic/FormElements/CheckboxInput/index.js +0 -17
- package/dist/Atomic/FormElements/CheckboxesLine/CheckboxesLine.interface.js +0 -4
- package/dist/Atomic/FormElements/CheckboxesLine/CheckboxesLine.stories.js +0 -94
- package/dist/Atomic/FormElements/CheckboxesLine/CheckboxesLine.test.js +0 -177
- package/dist/Atomic/FormElements/CheckboxesLine/index.js +0 -17
- package/dist/Atomic/FormElements/Datepicker/Datepicker.stories.js +0 -51
- package/dist/Atomic/FormElements/Dropdown/Dropdown.stories.js +0 -596
- package/dist/Atomic/FormElements/DropdownLiveSearch/DropdownLiveSearch.stories.js +0 -272
- package/dist/Atomic/FormElements/FileLoader/FileLoader.stories.js +0 -182
- package/dist/Atomic/FormElements/FileLoaderDescription/FileLoaderDescription.stories.js +0 -327
- package/dist/Atomic/FormElements/FileLoaderLocal/FileLoaderLocal.stories.js +0 -186
- package/dist/Atomic/FormElements/FileLoaderLocalGroup/FileLoaderLocalGroup.stories.js +0 -84
- package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN.stories.js +0 -107
- package/dist/Atomic/FormElements/Input/Input.stories.js +0 -251
- package/dist/Atomic/FormElements/InputCalendar/InputCalendar.stories.js +0 -115
- package/dist/Atomic/FormElements/InputColor/InputColor.stories.js +0 -119
- package/dist/Atomic/FormElements/InputCurrency/InputCurrency.interface.js +0 -4
- package/dist/Atomic/FormElements/InputCurrency/InputCurrency.stories.js +0 -178
- package/dist/Atomic/FormElements/InputCurrency/InputCurrency.test.js +0 -129
- package/dist/Atomic/FormElements/InputCurrency/index.js +0 -16
- package/dist/Atomic/FormElements/InputDateRange/InputDateRange.stories.js +0 -123
- package/dist/Atomic/FormElements/InputLink/InputLink.stories.js +0 -140
- package/dist/Atomic/FormElements/InputMask/InputMask.stories.js +0 -303
- package/dist/Atomic/FormElements/InputMask2/InputMask2.stories.js +0 -314
- package/dist/Atomic/FormElements/InputMask3/InputMask3.stories.js +0 -335
- package/dist/Atomic/FormElements/InputWithAction/InputWithAction.stories.js +0 -276
- package/dist/Atomic/FormElements/InputsRow/InputsRow.stories.js +0 -56
- package/dist/Atomic/FormElements/Label/Label.interface.js +0 -4
- package/dist/Atomic/FormElements/Label/Label.stories.js +0 -47
- package/dist/Atomic/FormElements/Label/Label.test.js +0 -167
- package/dist/Atomic/FormElements/Label/index.js +0 -17
- package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.stories.js +0 -172
- package/dist/Atomic/FormElements/MultiSelect/MultiSelect.stories.js +0 -121
- package/dist/Atomic/FormElements/NumericInput/NumericInput.stories.js +0 -184
- package/dist/Atomic/FormElements/RadioGroup/RadioGroup.stories.js +0 -79
- package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.stories.js +0 -151
- package/dist/Atomic/FormElements/RadioInput/RadioInput.stories.js +0 -67
- package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.stories.js +0 -116
- package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.stories.js +0 -107
- package/dist/Atomic/FormElements/RangeInputs/RangeInputs.stories.js +0 -92
- package/dist/Atomic/FormElements/RangeList/RangeList.stories.js +0 -169
- package/dist/Atomic/FormElements/RangeSlider/RangeSlider.stories.js +0 -401
- package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.stories.js +0 -314
- package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.stories.js +0 -137
- package/dist/Atomic/FormElements/Switcher/Switcher.stories.js +0 -91
- package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.stories.js +0 -104
- package/dist/Atomic/FormElements/SwitcherHide/SwitcherHide.stories.js +0 -96
- package/dist/Atomic/FormElements/SwitcherRadio/SwitcherRadio.stories.js +0 -140
- package/dist/Atomic/FormElements/SwitcherRange/SwitcherRange.stories.js +0 -112
- package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.stories.js +0 -145
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.stories.js +0 -158
- package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.stories.js +0 -101
- package/dist/Atomic/FormElements/TagListToDropdown/TagListToDropdown.stories.js +0 -131
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.stories.js +0 -357
- package/dist/Atomic/FormElements/Text/Text.stories.js +0 -80
- package/dist/Atomic/FormElements/TextSwitcher/TextSwitcher.stories.js +0 -106
- package/dist/Atomic/FormElements/TextSwitcher/TextSwitcher.test.js +0 -93
- package/dist/Atomic/FormElements/Textarea/Textarea.stories.js +0 -103
- package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.stories.js +0 -174
- package/dist/Atomic/FormElements/TimeRange/TimeRange.interface.js +0 -4
- package/dist/Atomic/FormElements/TimeRange/TimeRange.stories.js +0 -40
- package/dist/Atomic/FormElements/TimeRange/TimeRange.test.js +0 -163
- package/dist/Atomic/FormElements/TimeRange/index.js +0 -17
- package/dist/Atomic/FormElements/UserContacts/UserContact.test.js +0 -381
- package/dist/Atomic/FormElements/UserContacts/UserContacts.interface.js +0 -4
- package/dist/Atomic/FormElements/UserContacts/UserContacts.stories.js +0 -74
- package/dist/Atomic/FormElements/UserContacts/index.js +0 -17
- package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.stories.js +0 -193
- package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.stories.js +0 -147
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.stories.js +0 -151
- package/dist/Atomic/Layout/Header/Header.stories.js +0 -71
- package/dist/Atomic/Layout/MainMenu/MainMenu.stories.js +0 -115
- package/dist/Atomic/Layout/Spinner/Spinner.interface.js +0 -4
- package/dist/Atomic/Layout/Spinner/Spinner.stories.js +0 -46
- package/dist/Atomic/Layout/Spinner/Spinner.test.js +0 -54
- package/dist/Atomic/Layout/Spinner/index.js +0 -17
- package/dist/Atomic/UI/Accordion/Accordion.interface.js +0 -4
- package/dist/Atomic/UI/Accordion/Accordion.stories.js +0 -168
- package/dist/Atomic/UI/Accordion/Accordion.test.js +0 -54
- package/dist/Atomic/UI/Accordion/AccordionItem.test.js +0 -50
- package/dist/Atomic/UI/Accordion/index.js +0 -17
- package/dist/Atomic/UI/AccordionTable/AccordionTable.stories.js +0 -268
- package/dist/Atomic/UI/AccordionText/AccordionText.stories.js +0 -125
- package/dist/Atomic/UI/AdvancedTag/AdvancedTags.stories.js +0 -115
- package/dist/Atomic/UI/Alert/Alert.stories.js +0 -81
- package/dist/Atomic/UI/Arrow/Arrow.stories.js +0 -62
- package/dist/Atomic/UI/Box/Box.stories.js +0 -114
- package/dist/Atomic/UI/Button/Button.stories.js +0 -105
- package/dist/Atomic/UI/Button/Button.test.js +0 -147
- package/dist/Atomic/UI/ButtonsBar/ButtonsBar.stories.js +0 -129
- package/dist/Atomic/UI/Chart/Chart.stories.js +0 -93
- package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.stories.js +0 -85
- package/dist/Atomic/UI/DateTime/DateTime.stories.js +0 -50
- package/dist/Atomic/UI/DoubleString/DoubleString.stories.js +0 -79
- package/dist/Atomic/UI/DynamicIcon/DynamicIcon.interface.js +0 -4
- package/dist/Atomic/UI/DynamicIcon/DynamicIcon.stories.js +0 -98
- package/dist/Atomic/UI/DynamicIcon/DynamicIcon.test.js +0 -51
- package/dist/Atomic/UI/DynamicIcon/index.js +0 -17
- package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.stories.js +0 -98
- package/dist/Atomic/UI/Hint/Hint.stories.js +0 -101
- package/dist/Atomic/UI/Hint/index.js +0 -16
- package/dist/Atomic/UI/Modal/Modal.interface.js +0 -4
- package/dist/Atomic/UI/Modal/Modal.stories.js +0 -370
- package/dist/Atomic/UI/Modal/ModalHOC.stories.js +0 -191
- package/dist/Atomic/UI/Modal/ModalHOC.test.js +0 -187
- package/dist/Atomic/UI/Modal/index.js +0 -26
- package/dist/Atomic/UI/Modal/partials/ModalFooter.test.js +0 -118
- package/dist/Atomic/UI/Modal/partials/ModalTitle.test.js +0 -126
- package/dist/Atomic/UI/Modal/partials/useMobileModal.test.js +0 -133
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion.interface.js +0 -4
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion.stories.js +0 -513
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion.test.js +0 -84
- package/dist/Atomic/UI/MonoAccordion/index.js +0 -17
- package/dist/Atomic/UI/NavLine/NavLine.interface.js +0 -4
- package/dist/Atomic/UI/NavLine/NavLine.stories.js +0 -434
- package/dist/Atomic/UI/NavLine/NavLine.test.js +0 -311
- package/dist/Atomic/UI/NavLine/index.js +0 -17
- package/dist/Atomic/UI/PageTitle/PageTitle.interface.js +0 -4
- package/dist/Atomic/UI/PageTitle/PageTitle.stories.js +0 -62
- package/dist/Atomic/UI/PageTitle/PageTitle.test.js +0 -181
- package/dist/Atomic/UI/PageTitle/index.js +0 -17
- package/dist/Atomic/UI/PieChart/PieChar.interface.js +0 -4
- package/dist/Atomic/UI/PieChart/PieChart.stories.js +0 -82
- package/dist/Atomic/UI/PieChart/PieChart.test.js +0 -142
- package/dist/Atomic/UI/PieChart/index.js +0 -26
- package/dist/Atomic/UI/Price/Price.interface.js +0 -4
- package/dist/Atomic/UI/Price/Price.stories.js +0 -52
- package/dist/Atomic/UI/Price/Price.test.js +0 -83
- package/dist/Atomic/UI/Price/index.js +0 -17
- package/dist/Atomic/UI/PriceRange/PriceRange.interface.js +0 -4
- package/dist/Atomic/UI/PriceRange/PriceRange.stories.js +0 -51
- package/dist/Atomic/UI/PriceRange/PriceRange.test.js +0 -72
- package/dist/Atomic/UI/PriceRange/index.js +0 -17
- package/dist/Atomic/UI/ProgressLine/ProgressLine.interface.js +0 -4
- package/dist/Atomic/UI/ProgressLine/ProgressLine.stories.js +0 -163
- package/dist/Atomic/UI/ProgressLine/ProgressLine.test.js +0 -60
- package/dist/Atomic/UI/ProgressLine/index.js +0 -17
- package/dist/Atomic/UI/Status/Status.interface.js +0 -4
- package/dist/Atomic/UI/Status/Status.stories.js +0 -79
- package/dist/Atomic/UI/Status/Status.test.js +0 -103
- package/dist/Atomic/UI/Status/index.js +0 -17
- package/dist/Atomic/UI/Table/Table.stories.js +0 -250
- package/dist/Atomic/UI/Tag/Tag.interface.js +0 -4
- package/dist/Atomic/UI/Tag/Tag.stories.js +0 -108
- package/dist/Atomic/UI/Tag/Tag.test.js +0 -75
- package/dist/Atomic/UI/Tag/index.js +0 -17
- package/dist/Atomic/UI/TagList/TagList.stories.js +0 -169
- package/dist/Atomic/UI/UserBox/UserBox.interface.js +0 -4
- package/dist/Atomic/UI/UserBox/UserBox.stories.js +0 -57
- package/dist/Atomic/UI/UserBox/UserBox.test.js +0 -136
- package/dist/Atomic/UI/UserBox/index.js +0 -17
- package/dist/Atomic/UI/WizardStepper/WizardStepper.stories.js +0 -70
- package/dist/Functions/useIsMobile/index.js +0 -17
- package/dist/Functions/useIsMobile/useIsMobile.js +0 -33
- package/dist/Functions/useIsMobile/useIsMobile.test.js +0 -104
- package/dist/Functions/useKeyPress/useHandleKeyPress.test.js +0 -96
- package/dist/Functions/useKeyPress/useKeyPress.test.js +0 -87
- package/dist/Molecular/FormElement/FormElement.stories.js +0 -92
- package/dist/Molecular/FormWithDependOn/FormWithDependOn.stories.js +0 -301
- package/dist/Molecular/InputAddress/InputAddress.stories.js +0 -541
- package/dist/Molecular/InputPassword/InputPassword.stories.js +0 -86
- package/dist/types/base.interface.js +0 -4
- package/dist/types/base.types.js +0 -4
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
6
|
-
const _react = require("@testing-library/react");
|
|
7
|
-
const _Tag = /*#__PURE__*/ _interop_require_default(require("./Tag"));
|
|
8
|
-
function _interop_require_default(obj) {
|
|
9
|
-
return obj && obj.__esModule ? obj : {
|
|
10
|
-
default: obj
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
describe('tag', ()=>{
|
|
14
|
-
const defaultProps = {
|
|
15
|
-
value: 'test',
|
|
16
|
-
label: 'Test Label',
|
|
17
|
-
id: '1',
|
|
18
|
-
onClick: jest.fn()
|
|
19
|
-
};
|
|
20
|
-
it('renders with default props', ()=>{
|
|
21
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_Tag.default, {
|
|
22
|
-
...defaultProps
|
|
23
|
-
}));
|
|
24
|
-
expect(_react.screen.getByTestId('tag')).toBeInTheDocument();
|
|
25
|
-
expect(_react.screen.getByText('Test Label')).toBeInTheDocument();
|
|
26
|
-
});
|
|
27
|
-
it('renders with warning', ()=>{
|
|
28
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_Tag.default, {
|
|
29
|
-
...defaultProps,
|
|
30
|
-
warning: "Warning message"
|
|
31
|
-
}));
|
|
32
|
-
_react.fireEvent.mouseEnter(_react.screen.getByTestId('tag'));
|
|
33
|
-
expect(_react.screen.getByText('Warning message')).toBeInTheDocument();
|
|
34
|
-
});
|
|
35
|
-
it('calls onClick when tag is clicked', ()=>{
|
|
36
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_Tag.default, {
|
|
37
|
-
...defaultProps
|
|
38
|
-
}));
|
|
39
|
-
_react.fireEvent.click(_react.screen.getByTestId('tag'));
|
|
40
|
-
expect(defaultProps.onClick).toHaveBeenCalledWith('1');
|
|
41
|
-
});
|
|
42
|
-
it('renders remove button and calls removeItem when clicked', ()=>{
|
|
43
|
-
const removeItem = jest.fn();
|
|
44
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_Tag.default, {
|
|
45
|
-
...defaultProps,
|
|
46
|
-
removeItem: removeItem,
|
|
47
|
-
isNoDismiss: false
|
|
48
|
-
}));
|
|
49
|
-
_react.fireEvent.click(_react.screen.getByRole('button'));
|
|
50
|
-
expect(removeItem).toHaveBeenCalledWith('test');
|
|
51
|
-
});
|
|
52
|
-
it('opens and closes popup on click', ()=>{
|
|
53
|
-
const appDiv = document.createElement('div');
|
|
54
|
-
appDiv.setAttribute('id', 'app');
|
|
55
|
-
document.body.appendChild(appDiv);
|
|
56
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_Tag.default, {
|
|
57
|
-
...defaultProps,
|
|
58
|
-
isPopup: true,
|
|
59
|
-
popupInfoContent: /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
60
|
-
children: "Popup Content"
|
|
61
|
-
})
|
|
62
|
-
}));
|
|
63
|
-
_react.fireEvent.click(_react.screen.getByTestId('tag'));
|
|
64
|
-
expect(_react.screen.getByText('Popup Content')).toBeInTheDocument();
|
|
65
|
-
_react.fireEvent.click(document);
|
|
66
|
-
expect(_react.screen.queryByText('Popup Content')).not.toBeInTheDocument();
|
|
67
|
-
});
|
|
68
|
-
it('applies custom className', ()=>{
|
|
69
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_Tag.default, {
|
|
70
|
-
...defaultProps,
|
|
71
|
-
className: "custom-class"
|
|
72
|
-
}));
|
|
73
|
-
expect(_react.screen.getByTestId('tag')).toHaveClass('custom-class');
|
|
74
|
-
});
|
|
75
|
-
});
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "default", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return _default;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _Tag = /*#__PURE__*/ _interop_require_default(require("./Tag"));
|
|
12
|
-
function _interop_require_default(obj) {
|
|
13
|
-
return obj && obj.__esModule ? obj : {
|
|
14
|
-
default: obj
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
const _default = _Tag.default;
|
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
function _export(target, all) {
|
|
6
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: all[name]
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
TagListTemplate: function() {
|
|
13
|
-
return TagListTemplate;
|
|
14
|
-
},
|
|
15
|
-
default: function() {
|
|
16
|
-
return _default;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
20
|
-
const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
21
|
-
require("../../../../../scss/main.scss");
|
|
22
|
-
const _TagList = /*#__PURE__*/ _interop_require_default(require("./TagList"));
|
|
23
|
-
require("./TagListStories.scss");
|
|
24
|
-
function _interop_require_default(obj) {
|
|
25
|
-
return obj && obj.__esModule ? obj : {
|
|
26
|
-
default: obj
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
function _getRequireWildcardCache(nodeInterop) {
|
|
30
|
-
if (typeof WeakMap !== "function") return null;
|
|
31
|
-
var cacheBabelInterop = new WeakMap();
|
|
32
|
-
var cacheNodeInterop = new WeakMap();
|
|
33
|
-
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
34
|
-
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
35
|
-
})(nodeInterop);
|
|
36
|
-
}
|
|
37
|
-
function _interop_require_wildcard(obj, nodeInterop) {
|
|
38
|
-
if (!nodeInterop && obj && obj.__esModule) {
|
|
39
|
-
return obj;
|
|
40
|
-
}
|
|
41
|
-
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
42
|
-
return {
|
|
43
|
-
default: obj
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
var cache = _getRequireWildcardCache(nodeInterop);
|
|
47
|
-
if (cache && cache.has(obj)) {
|
|
48
|
-
return cache.get(obj);
|
|
49
|
-
}
|
|
50
|
-
var newObj = {
|
|
51
|
-
__proto__: null
|
|
52
|
-
};
|
|
53
|
-
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
54
|
-
for(var key in obj){
|
|
55
|
-
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
56
|
-
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
57
|
-
if (desc && (desc.get || desc.set)) {
|
|
58
|
-
Object.defineProperty(newObj, key, desc);
|
|
59
|
-
} else {
|
|
60
|
-
newObj[key] = obj[key];
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
newObj.default = obj;
|
|
65
|
-
if (cache) {
|
|
66
|
-
cache.set(obj, newObj);
|
|
67
|
-
}
|
|
68
|
-
return newObj;
|
|
69
|
-
}
|
|
70
|
-
global.lng = "en";
|
|
71
|
-
const _default = {
|
|
72
|
-
title: "UI/TagList",
|
|
73
|
-
component: _TagList.default
|
|
74
|
-
};
|
|
75
|
-
const renderPopupContent = ()=>{
|
|
76
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
77
|
-
children: [
|
|
78
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
|
|
79
|
-
children: '"ADDED"'
|
|
80
|
-
}),
|
|
81
|
-
/*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
82
|
-
children: [
|
|
83
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
|
|
84
|
-
children: '"FL Name" '
|
|
85
|
-
}),
|
|
86
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
|
|
87
|
-
children: '"Admin" '
|
|
88
|
-
}),
|
|
89
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
|
|
90
|
-
children: '"date"'
|
|
91
|
-
})
|
|
92
|
-
]
|
|
93
|
-
})
|
|
94
|
-
]
|
|
95
|
-
});
|
|
96
|
-
};
|
|
97
|
-
const Template = (args)=>{
|
|
98
|
-
const { options } = args;
|
|
99
|
-
const [tags, setTags] = (0, _react.useState)(options);
|
|
100
|
-
const removeTagHandler = (value)=>{
|
|
101
|
-
const newArray = tags.filter((item)=>item.value !== value);
|
|
102
|
-
setTags(newArray);
|
|
103
|
-
};
|
|
104
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_TagList.default, {
|
|
105
|
-
...args,
|
|
106
|
-
items: tags
|
|
107
|
-
});
|
|
108
|
-
};
|
|
109
|
-
const TagListTemplate = Template.bind({});
|
|
110
|
-
TagListTemplate.args = {
|
|
111
|
-
options: [
|
|
112
|
-
{
|
|
113
|
-
id: 1,
|
|
114
|
-
label: "Label test 1 1 1",
|
|
115
|
-
value: "check1",
|
|
116
|
-
color: "#FBF4E2",
|
|
117
|
-
isPopup: true,
|
|
118
|
-
popupInfoContent: renderPopupContent()
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
id: 2,
|
|
122
|
-
label: "Label test 2",
|
|
123
|
-
value: "check2",
|
|
124
|
-
color: "#FCE2E8"
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
id: 3,
|
|
128
|
-
label: "Label test 3",
|
|
129
|
-
value: "check3",
|
|
130
|
-
color: "#FBF4E2"
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
id: 4,
|
|
134
|
-
label: "Label test 3 dasd",
|
|
135
|
-
value: "check4",
|
|
136
|
-
color: "#FCE2E8"
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
id: 5,
|
|
140
|
-
label: "Label test 3 adsdasfgas",
|
|
141
|
-
value: "check5",
|
|
142
|
-
color: "#FBF4E2"
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
id: 6,
|
|
146
|
-
label: "Label test 3dasd",
|
|
147
|
-
value: "check6",
|
|
148
|
-
color: "#FCE2E8"
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
id: 7,
|
|
152
|
-
label: "Label test 3 dasd",
|
|
153
|
-
value: "check7",
|
|
154
|
-
color: "#FBF4E2"
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
id: 8,
|
|
158
|
-
label: "Label test 3asd",
|
|
159
|
-
value: "check8",
|
|
160
|
-
color: "#FCE2E8"
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
id: 9,
|
|
164
|
-
label: "Label test 3 dasfs",
|
|
165
|
-
value: "check9",
|
|
166
|
-
color: "#FBF4E2"
|
|
167
|
-
}
|
|
168
|
-
]
|
|
169
|
-
};
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
function _export(target, all) {
|
|
6
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: all[name]
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
UserBoxTemplate: function() {
|
|
13
|
-
return UserBoxTemplate;
|
|
14
|
-
},
|
|
15
|
-
default: function() {
|
|
16
|
-
return _default;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
20
|
-
const _UserBox = /*#__PURE__*/ _interop_require_default(require("./UserBox"));
|
|
21
|
-
require("../../../../../scss/main.scss");
|
|
22
|
-
function _interop_require_default(obj) {
|
|
23
|
-
return obj && obj.__esModule ? obj : {
|
|
24
|
-
default: obj
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
const _default = {
|
|
28
|
-
title: 'UI/UserBox',
|
|
29
|
-
component: _UserBox.default,
|
|
30
|
-
argTypes: {
|
|
31
|
-
id: {
|
|
32
|
-
description: 'string',
|
|
33
|
-
control: {
|
|
34
|
-
type: 'select',
|
|
35
|
-
options: [
|
|
36
|
-
'dd499a40-4a02-4597-8353-0fd0fb49b8ec',
|
|
37
|
-
'407dcedf-7713-4e2b-ba29-6989968c70c4',
|
|
38
|
-
'7e034243-426f-40a6-8e85-71b719385404',
|
|
39
|
-
'3f03007a-4cf0-4a23-8774-c232ad922d7a'
|
|
40
|
-
]
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
args: {
|
|
45
|
-
name: 'Username',
|
|
46
|
-
id: 'dd499a40-4a02-4597-8353-0fd0fb49b8ec',
|
|
47
|
-
onClick: ()=>{},
|
|
48
|
-
isModal: true,
|
|
49
|
-
className: '',
|
|
50
|
-
colors: [],
|
|
51
|
-
role: 'Admin'
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
const Template = (args)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_UserBox.default, {
|
|
55
|
-
...args
|
|
56
|
-
});
|
|
57
|
-
const UserBoxTemplate = Template.bind({});
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
6
|
-
const _react = require("@testing-library/react");
|
|
7
|
-
const _utils = /*#__PURE__*/ _interop_require_wildcard(require("../../../Functions/utils"));
|
|
8
|
-
const _UserBox = /*#__PURE__*/ _interop_require_default(require("./UserBox"));
|
|
9
|
-
function _interop_require_default(obj) {
|
|
10
|
-
return obj && obj.__esModule ? obj : {
|
|
11
|
-
default: obj
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
function _getRequireWildcardCache(nodeInterop) {
|
|
15
|
-
if (typeof WeakMap !== "function") return null;
|
|
16
|
-
var cacheBabelInterop = new WeakMap();
|
|
17
|
-
var cacheNodeInterop = new WeakMap();
|
|
18
|
-
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
19
|
-
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
20
|
-
})(nodeInterop);
|
|
21
|
-
}
|
|
22
|
-
function _interop_require_wildcard(obj, nodeInterop) {
|
|
23
|
-
if (!nodeInterop && obj && obj.__esModule) {
|
|
24
|
-
return obj;
|
|
25
|
-
}
|
|
26
|
-
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
27
|
-
return {
|
|
28
|
-
default: obj
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
var cache = _getRequireWildcardCache(nodeInterop);
|
|
32
|
-
if (cache && cache.has(obj)) {
|
|
33
|
-
return cache.get(obj);
|
|
34
|
-
}
|
|
35
|
-
var newObj = {
|
|
36
|
-
__proto__: null
|
|
37
|
-
};
|
|
38
|
-
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
39
|
-
for(var key in obj){
|
|
40
|
-
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
41
|
-
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
42
|
-
if (desc && (desc.get || desc.set)) {
|
|
43
|
-
Object.defineProperty(newObj, key, desc);
|
|
44
|
-
} else {
|
|
45
|
-
newObj[key] = obj[key];
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
newObj.default = obj;
|
|
50
|
-
if (cache) {
|
|
51
|
-
cache.set(obj, newObj);
|
|
52
|
-
}
|
|
53
|
-
return newObj;
|
|
54
|
-
}
|
|
55
|
-
jest.mock('../../../Functions/utils', ()=>({
|
|
56
|
-
getColorById: jest.fn()
|
|
57
|
-
}));
|
|
58
|
-
describe('userBox', ()=>{
|
|
59
|
-
const defaultProps = {
|
|
60
|
-
name: 'Test User',
|
|
61
|
-
id: '1',
|
|
62
|
-
onClick: jest.fn(),
|
|
63
|
-
isModal: false
|
|
64
|
-
};
|
|
65
|
-
it('renders with default props', ()=>{
|
|
66
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_UserBox.default, {
|
|
67
|
-
...defaultProps
|
|
68
|
-
}));
|
|
69
|
-
expect(_react.screen.getByTestId('userbox')).toBeInTheDocument();
|
|
70
|
-
expect(_react.screen.getByText('Test User')).toBeInTheDocument();
|
|
71
|
-
});
|
|
72
|
-
it('renders with role', ()=>{
|
|
73
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_UserBox.default, {
|
|
74
|
-
...defaultProps,
|
|
75
|
-
role: "Admin"
|
|
76
|
-
}));
|
|
77
|
-
expect(_react.screen.getByText('Admin')).toBeInTheDocument();
|
|
78
|
-
});
|
|
79
|
-
it('calls onClick when button is clicked in modal mode', ()=>{
|
|
80
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_UserBox.default, {
|
|
81
|
-
...defaultProps,
|
|
82
|
-
isModal: true
|
|
83
|
-
}));
|
|
84
|
-
_react.fireEvent.click(_react.screen.getByText('Test User'));
|
|
85
|
-
expect(defaultProps.onClick).toHaveBeenCalled();
|
|
86
|
-
});
|
|
87
|
-
it('renders with custom className', ()=>{
|
|
88
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_UserBox.default, {
|
|
89
|
-
...defaultProps,
|
|
90
|
-
className: "custom-class"
|
|
91
|
-
}));
|
|
92
|
-
// Updated: Now checking directly on the element with testId
|
|
93
|
-
expect(_react.screen.getByTestId('userbox')).toHaveClass('custom-class');
|
|
94
|
-
});
|
|
95
|
-
it('renders with colors', ()=>{
|
|
96
|
-
const colors = [
|
|
97
|
-
'#ff0000',
|
|
98
|
-
'#00ff00',
|
|
99
|
-
'#0000ff'
|
|
100
|
-
];
|
|
101
|
-
_utils.getColorById.mockReturnValue('#00ff00');
|
|
102
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_UserBox.default, {
|
|
103
|
-
...defaultProps,
|
|
104
|
-
colors: colors
|
|
105
|
-
}));
|
|
106
|
-
expect(_react.screen.getByTestId('userbox').querySelector('.td-user-box__avatar')).toHaveStyle({
|
|
107
|
-
backgroundColor: '#00ff00'
|
|
108
|
-
});
|
|
109
|
-
});
|
|
110
|
-
it('renders modal content correctly', ()=>{
|
|
111
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_UserBox.default, {
|
|
112
|
-
...defaultProps,
|
|
113
|
-
isModal: true
|
|
114
|
-
}));
|
|
115
|
-
expect(_react.screen.getByTestId('userbox')).toBeInTheDocument();
|
|
116
|
-
expect(_react.screen.getByText('Test User')).toBeInTheDocument();
|
|
117
|
-
});
|
|
118
|
-
// Adding new tests for accessibility attributes
|
|
119
|
-
it('renders with correct ARIA attributes', ()=>{
|
|
120
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_UserBox.default, {
|
|
121
|
-
...defaultProps,
|
|
122
|
-
role: "Admin"
|
|
123
|
-
}));
|
|
124
|
-
const userBox = _react.screen.getByTestId('userbox');
|
|
125
|
-
expect(userBox).toHaveAttribute('role', 'region');
|
|
126
|
-
expect(userBox).toHaveAttribute('aria-label', 'User box for Test User');
|
|
127
|
-
expect(_react.screen.getByText('Admin')).toHaveAttribute('aria-label', 'User role: Admin');
|
|
128
|
-
});
|
|
129
|
-
it('renders with custom testId', ()=>{
|
|
130
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_UserBox.default, {
|
|
131
|
-
...defaultProps,
|
|
132
|
-
testId: "custom-testid"
|
|
133
|
-
}));
|
|
134
|
-
expect(_react.screen.getByTestId('custom-testid')).toBeInTheDocument();
|
|
135
|
-
});
|
|
136
|
-
});
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "default", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return _default;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _UserBox = /*#__PURE__*/ _interop_require_default(require("./UserBox"));
|
|
12
|
-
function _interop_require_default(obj) {
|
|
13
|
-
return obj && obj.__esModule ? obj : {
|
|
14
|
-
default: obj
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
const _default = _UserBox.default;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
function _export(target, all) {
|
|
6
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: all[name]
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
Default: function() {
|
|
13
|
-
return Default;
|
|
14
|
-
},
|
|
15
|
-
default: function() {
|
|
16
|
-
return _default;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
20
|
-
const _react = /*#__PURE__*/ _interop_require_default(require("react"));
|
|
21
|
-
const _index = /*#__PURE__*/ _interop_require_default(require("./index"));
|
|
22
|
-
require("../../../../../scss/main.scss");
|
|
23
|
-
const _constructor = require("./constructor");
|
|
24
|
-
function _interop_require_default(obj) {
|
|
25
|
-
return obj && obj.__esModule ? obj : {
|
|
26
|
-
default: obj
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
global.lng = 'en';
|
|
30
|
-
const _default = {
|
|
31
|
-
title: 'UI/WizardStepper',
|
|
32
|
-
component: _index.default,
|
|
33
|
-
argTypes: {
|
|
34
|
-
steps: {
|
|
35
|
-
array: true
|
|
36
|
-
},
|
|
37
|
-
variant: {
|
|
38
|
-
options: [
|
|
39
|
-
'default',
|
|
40
|
-
'cardActive',
|
|
41
|
-
'ghost'
|
|
42
|
-
],
|
|
43
|
-
control: {
|
|
44
|
-
type: 'radio'
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
// - BASE VARIANT -
|
|
50
|
-
const Template = (args)=>/*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
|
|
51
|
-
children: [
|
|
52
|
-
" ",
|
|
53
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_index.default, {
|
|
54
|
-
...args
|
|
55
|
-
}),
|
|
56
|
-
" "
|
|
57
|
-
]
|
|
58
|
-
});
|
|
59
|
-
const Default = Template.bind({});
|
|
60
|
-
Default.args = {
|
|
61
|
-
steps: _constructor.mockData,
|
|
62
|
-
// вариант ghost и cardActive активирует пресет других иконок сами по себе
|
|
63
|
-
variant: undefined,
|
|
64
|
-
// опционально
|
|
65
|
-
customIcons: {
|
|
66
|
-
activeIcon: undefined,
|
|
67
|
-
doneIcon: undefined,
|
|
68
|
-
defaultIcon: undefined
|
|
69
|
-
}
|
|
70
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "default", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return _default;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _useIsMobile = /*#__PURE__*/ _interop_require_default(require("./useIsMobile"));
|
|
12
|
-
function _interop_require_default(obj) {
|
|
13
|
-
return obj && obj.__esModule ? obj : {
|
|
14
|
-
default: obj
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
const _default = _useIsMobile.default;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "default", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return _default;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _react = require("react");
|
|
12
|
-
/**
|
|
13
|
-
* Hook to detect if the current device is a mobile device
|
|
14
|
-
* @param props - Configuration options
|
|
15
|
-
* @param props.isWithoutWidthCheck - If true, only checks user agent without width verification
|
|
16
|
-
* @returns Object containing isMobile flag
|
|
17
|
-
*/ function useIsMobile({ isWithoutWidthCheck = false } = {}) {
|
|
18
|
-
const getIsMobile = ()=>{
|
|
19
|
-
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
|
20
|
-
};
|
|
21
|
-
const [isMobile, setIsMobile] = (0, _react.useState)(getIsMobile());
|
|
22
|
-
(0, _react.useEffect)(()=>{
|
|
23
|
-
if (getIsMobile()) {
|
|
24
|
-
setIsMobile(true);
|
|
25
|
-
}
|
|
26
|
-
}, [
|
|
27
|
-
navigator.userAgent
|
|
28
|
-
]);
|
|
29
|
-
return {
|
|
30
|
-
isMobile: isMobile && (isWithoutWidthCheck || window.screen.width <= 768)
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
const _default = useIsMobile;
|