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,47 +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
|
-
LabelTemplate: function() {
|
|
13
|
-
return LabelTemplate;
|
|
14
|
-
},
|
|
15
|
-
default: function() {
|
|
16
|
-
return _default;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
20
|
-
const _Label = /*#__PURE__*/ _interop_require_default(require("./Label"));
|
|
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: 'Form Elements/Label',
|
|
29
|
-
component: _Label.default,
|
|
30
|
-
args: {
|
|
31
|
-
label: 'Loooooooooooooooooooooooooooooooooooooooooooooooong label',
|
|
32
|
-
note: '(Note text)',
|
|
33
|
-
isRequired: true,
|
|
34
|
-
className: 'test-label',
|
|
35
|
-
hint: {
|
|
36
|
-
text: 'Hint text',
|
|
37
|
-
hintSide: 'bottom'
|
|
38
|
-
},
|
|
39
|
-
onClickHintCallback: ()=>console.log('onclick callback')
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
function Template(args) {
|
|
43
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_Label.default, {
|
|
44
|
-
...args
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
const LabelTemplate = Template.bind({});
|
|
@@ -1,167 +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 _Label = /*#__PURE__*/ _interop_require_default(require("./Label"));
|
|
8
|
-
function _interop_require_default(obj) {
|
|
9
|
-
return obj && obj.__esModule ? obj : {
|
|
10
|
-
default: obj
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
// Мок для компонента Hint
|
|
14
|
-
jest.mock('../../UI/Hint/Hint', ()=>{
|
|
15
|
-
return function MockHint({ hint, className }) {
|
|
16
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
17
|
-
className: className,
|
|
18
|
-
"data-testid": "mock-hint",
|
|
19
|
-
children: hint
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
});
|
|
23
|
-
describe('label Component', ()=>{
|
|
24
|
-
const defaultProps = {
|
|
25
|
-
label: 'Test Label'
|
|
26
|
-
};
|
|
27
|
-
it('renders without crashing', ()=>{
|
|
28
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_Label.default, {
|
|
29
|
-
...defaultProps
|
|
30
|
-
}));
|
|
31
|
-
expect(_react.screen.getByTestId('label')).toBeInTheDocument();
|
|
32
|
-
});
|
|
33
|
-
it('renders label text correctly', ()=>{
|
|
34
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_Label.default, {
|
|
35
|
-
...defaultProps
|
|
36
|
-
}));
|
|
37
|
-
expect(_react.screen.getByText('Test Label')).toBeInTheDocument();
|
|
38
|
-
});
|
|
39
|
-
it('renders with required asterisk', ()=>{
|
|
40
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_Label.default, {
|
|
41
|
-
...defaultProps,
|
|
42
|
-
isRequired: true
|
|
43
|
-
}));
|
|
44
|
-
expect(_react.screen.getByText('*')).toBeInTheDocument();
|
|
45
|
-
});
|
|
46
|
-
it('renders with note', ()=>{
|
|
47
|
-
const note = '(optional)';
|
|
48
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_Label.default, {
|
|
49
|
-
...defaultProps,
|
|
50
|
-
note: note
|
|
51
|
-
}));
|
|
52
|
-
expect(_react.screen.getByText(note)).toBeInTheDocument();
|
|
53
|
-
});
|
|
54
|
-
it('renders with hint', ()=>{
|
|
55
|
-
const hint = {
|
|
56
|
-
text: 'Hint text',
|
|
57
|
-
icon: 'info',
|
|
58
|
-
variant: 'filled',
|
|
59
|
-
hintSide: 'right'
|
|
60
|
-
};
|
|
61
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_Label.default, {
|
|
62
|
-
...defaultProps,
|
|
63
|
-
hint: hint
|
|
64
|
-
}));
|
|
65
|
-
expect(_react.screen.getByTestId('mock-hint')).toBeInTheDocument();
|
|
66
|
-
});
|
|
67
|
-
it('applies bold class when isLabelBolt is true', ()=>{
|
|
68
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_Label.default, {
|
|
69
|
-
...defaultProps,
|
|
70
|
-
isLabelBolt: true
|
|
71
|
-
}));
|
|
72
|
-
expect(_react.screen.getByTestId('label')).toHaveClass('label_bold');
|
|
73
|
-
});
|
|
74
|
-
it('applies error class when error prop is provided', ()=>{
|
|
75
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_Label.default, {
|
|
76
|
-
...defaultProps,
|
|
77
|
-
error: "Error message"
|
|
78
|
-
}));
|
|
79
|
-
expect(_react.screen.getByTestId('label')).toHaveClass('error');
|
|
80
|
-
});
|
|
81
|
-
it('applies custom className', ()=>{
|
|
82
|
-
const customClass = 'custom-label';
|
|
83
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_Label.default, {
|
|
84
|
-
...defaultProps,
|
|
85
|
-
className: customClass
|
|
86
|
-
}));
|
|
87
|
-
expect(_react.screen.getByTestId('label')).toHaveClass(customClass);
|
|
88
|
-
});
|
|
89
|
-
it('sets correct tabIndex for accessibility', ()=>{
|
|
90
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_Label.default, {
|
|
91
|
-
...defaultProps,
|
|
92
|
-
isAccessability: true
|
|
93
|
-
}));
|
|
94
|
-
expect(_react.screen.getByTestId('label')).toHaveAttribute('tabIndex', '0');
|
|
95
|
-
});
|
|
96
|
-
it('sets default tabIndex when isAccessability is false', ()=>{
|
|
97
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_Label.default, {
|
|
98
|
-
...defaultProps
|
|
99
|
-
}));
|
|
100
|
-
expect(_react.screen.getByTestId('label')).toHaveAttribute('tabIndex', '-1');
|
|
101
|
-
});
|
|
102
|
-
it('calls onClickHintCallback when hint is clicked', ()=>{
|
|
103
|
-
const onClickHintCallback = jest.fn();
|
|
104
|
-
const hint = {
|
|
105
|
-
text: 'Hint text',
|
|
106
|
-
icon: 'info',
|
|
107
|
-
variant: 'warning',
|
|
108
|
-
hintSide: 'right'
|
|
109
|
-
};
|
|
110
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_Label.default, {
|
|
111
|
-
...defaultProps,
|
|
112
|
-
hint: hint,
|
|
113
|
-
onClickHintCallback: onClickHintCallback
|
|
114
|
-
}));
|
|
115
|
-
_react.fireEvent.click(_react.screen.getByTestId('mock-hint'));
|
|
116
|
-
// Примечание: этот тест может не сработать, так как мы замокали Hint
|
|
117
|
-
// В реальном приложении нужно убедиться, что Hint правильно обрабатывает клики
|
|
118
|
-
});
|
|
119
|
-
describe('compound Rendering', ()=>{
|
|
120
|
-
it('renders required label with note and hint', ()=>{
|
|
121
|
-
const props = {
|
|
122
|
-
label: 'Test Label',
|
|
123
|
-
isRequired: true,
|
|
124
|
-
note: '(required)',
|
|
125
|
-
hint: {
|
|
126
|
-
text: 'Hint text',
|
|
127
|
-
icon: 'info',
|
|
128
|
-
variant: 'outlined',
|
|
129
|
-
hintSide: 'right'
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_Label.default, {
|
|
133
|
-
...props
|
|
134
|
-
}));
|
|
135
|
-
expect(_react.screen.getByText('Test Label')).toBeInTheDocument();
|
|
136
|
-
expect(_react.screen.getByText('*')).toBeInTheDocument();
|
|
137
|
-
expect(_react.screen.getByText('(required)')).toBeInTheDocument();
|
|
138
|
-
expect(_react.screen.getByTestId('mock-hint')).toBeInTheDocument();
|
|
139
|
-
});
|
|
140
|
-
it('renders all accessibility attributes correctly', ()=>{
|
|
141
|
-
const props = {
|
|
142
|
-
label: 'Test Label',
|
|
143
|
-
isAccessability: true,
|
|
144
|
-
isAccessabilityHint: true
|
|
145
|
-
};
|
|
146
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_Label.default, {
|
|
147
|
-
...props
|
|
148
|
-
}));
|
|
149
|
-
const labelElement = _react.screen.getByTestId('label');
|
|
150
|
-
expect(labelElement).toHaveAttribute('tabIndex', '0');
|
|
151
|
-
expect(labelElement).toHaveAttribute('aria-label', 'Test Label');
|
|
152
|
-
});
|
|
153
|
-
});
|
|
154
|
-
describe('error Handling', ()=>{
|
|
155
|
-
it('handles empty label', ()=>{
|
|
156
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_Label.default, {}));
|
|
157
|
-
expect(_react.screen.getByTestId('label-text')).toBeInTheDocument();
|
|
158
|
-
});
|
|
159
|
-
it('handles null error prop', ()=>{
|
|
160
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_Label.default, {
|
|
161
|
-
...defaultProps,
|
|
162
|
-
error: null
|
|
163
|
-
}));
|
|
164
|
-
expect(_react.screen.getByTestId('label')).not.toHaveClass('error');
|
|
165
|
-
});
|
|
166
|
-
});
|
|
167
|
-
});
|
|
@@ -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 _Label = /*#__PURE__*/ _interop_require_default(require("./Label"));
|
|
12
|
-
function _interop_require_default(obj) {
|
|
13
|
-
return obj && obj.__esModule ? obj : {
|
|
14
|
-
default: obj
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
const _default = _Label.default;
|
|
@@ -1,172 +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
|
-
CalendarTemplate: function() {
|
|
13
|
-
return CalendarTemplate;
|
|
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
|
-
const _MobileCalendar = /*#__PURE__*/ _interop_require_default(require("./MobileCalendar"));
|
|
22
|
-
require("../../../../../scss/main.scss");
|
|
23
|
-
function _interop_require_default(obj) {
|
|
24
|
-
return obj && obj.__esModule ? obj : {
|
|
25
|
-
default: obj
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
function _getRequireWildcardCache(nodeInterop) {
|
|
29
|
-
if (typeof WeakMap !== "function") return null;
|
|
30
|
-
var cacheBabelInterop = new WeakMap();
|
|
31
|
-
var cacheNodeInterop = new WeakMap();
|
|
32
|
-
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
33
|
-
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
34
|
-
})(nodeInterop);
|
|
35
|
-
}
|
|
36
|
-
function _interop_require_wildcard(obj, nodeInterop) {
|
|
37
|
-
if (!nodeInterop && obj && obj.__esModule) {
|
|
38
|
-
return obj;
|
|
39
|
-
}
|
|
40
|
-
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
41
|
-
return {
|
|
42
|
-
default: obj
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
var cache = _getRequireWildcardCache(nodeInterop);
|
|
46
|
-
if (cache && cache.has(obj)) {
|
|
47
|
-
return cache.get(obj);
|
|
48
|
-
}
|
|
49
|
-
var newObj = {
|
|
50
|
-
__proto__: null
|
|
51
|
-
};
|
|
52
|
-
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
53
|
-
for(var key in obj){
|
|
54
|
-
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
55
|
-
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
56
|
-
if (desc && (desc.get || desc.set)) {
|
|
57
|
-
Object.defineProperty(newObj, key, desc);
|
|
58
|
-
} else {
|
|
59
|
-
newObj[key] = obj[key];
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
newObj.default = obj;
|
|
64
|
-
if (cache) {
|
|
65
|
-
cache.set(obj, newObj);
|
|
66
|
-
}
|
|
67
|
-
return newObj;
|
|
68
|
-
}
|
|
69
|
-
global.lng = 'en';
|
|
70
|
-
const _default = {
|
|
71
|
-
title: 'Form Elements/Mobile Calendar',
|
|
72
|
-
component: _MobileCalendar.default,
|
|
73
|
-
argTypes: {
|
|
74
|
-
min: {
|
|
75
|
-
description: 'Min Date',
|
|
76
|
-
control: {
|
|
77
|
-
type: 'date'
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
max: {
|
|
81
|
-
description: 'Max Date',
|
|
82
|
-
control: {
|
|
83
|
-
type: 'date'
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
value: {
|
|
87
|
-
description: 'Value',
|
|
88
|
-
control: {
|
|
89
|
-
type: 'date'
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
rows: {
|
|
93
|
-
description: 'Calendar Rows',
|
|
94
|
-
control: {
|
|
95
|
-
type: 'number'
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
label: {
|
|
99
|
-
description: 'Calendar Label',
|
|
100
|
-
control: {
|
|
101
|
-
type: 'text'
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
timeout: {
|
|
105
|
-
description: 'Scroll Timeout',
|
|
106
|
-
control: {
|
|
107
|
-
type: 'number'
|
|
108
|
-
}
|
|
109
|
-
},
|
|
110
|
-
isMobile: {
|
|
111
|
-
description: 'Touch Scroll Switcher'
|
|
112
|
-
},
|
|
113
|
-
showSelectedDate: {
|
|
114
|
-
description: 'Selected Date Block Visibility'
|
|
115
|
-
},
|
|
116
|
-
listItemHeight: {
|
|
117
|
-
description: 'List Item Height For Scroll Calculate',
|
|
118
|
-
control: {
|
|
119
|
-
type: 'number'
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
|
-
classes: {
|
|
123
|
-
description: 'Style Classes'
|
|
124
|
-
},
|
|
125
|
-
onChange: {
|
|
126
|
-
description: 'On Change Callback'
|
|
127
|
-
},
|
|
128
|
-
onMinDateReached: {
|
|
129
|
-
description: 'On Min Date Reached Callback'
|
|
130
|
-
},
|
|
131
|
-
onMaxDateReached: {
|
|
132
|
-
description: 'On Max Date Reached Callback'
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
};
|
|
136
|
-
const Template = (args)=>{
|
|
137
|
-
const [date, setDate] = (0, _react.useState)('');
|
|
138
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_jsxruntime.Fragment, {
|
|
139
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_MobileCalendar.default, {
|
|
140
|
-
...args
|
|
141
|
-
})
|
|
142
|
-
});
|
|
143
|
-
};
|
|
144
|
-
const CalendarTemplate = Template.bind({});
|
|
145
|
-
CalendarTemplate.args = {
|
|
146
|
-
min: '',
|
|
147
|
-
max: '',
|
|
148
|
-
value: '',
|
|
149
|
-
rows: 5,
|
|
150
|
-
label: '',
|
|
151
|
-
timeout: 75,
|
|
152
|
-
isMobile: true,
|
|
153
|
-
showSelectedDate: false,
|
|
154
|
-
listItemHeight: 32,
|
|
155
|
-
classes: {
|
|
156
|
-
wrapper: '',
|
|
157
|
-
label: '',
|
|
158
|
-
body: '',
|
|
159
|
-
yearsBlock: '',
|
|
160
|
-
yearsList: '',
|
|
161
|
-
yearsListItem: '',
|
|
162
|
-
monthsBlock: '',
|
|
163
|
-
monthsList: '',
|
|
164
|
-
monthsListItem: '',
|
|
165
|
-
daysBlock: '',
|
|
166
|
-
daysList: '',
|
|
167
|
-
daysListItem: '',
|
|
168
|
-
prevItem: '',
|
|
169
|
-
nextItem: '',
|
|
170
|
-
activeItem: ''
|
|
171
|
-
}
|
|
172
|
-
};
|
|
@@ -1,121 +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
|
-
MultiDropdownTemplate: function() {
|
|
13
|
-
return MultiDropdownTemplate;
|
|
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
|
-
const _MultiSelect = /*#__PURE__*/ _interop_require_default(require("./MultiSelect"));
|
|
22
|
-
require("../../../../../scss/main.scss");
|
|
23
|
-
function _interop_require_default(obj) {
|
|
24
|
-
return obj && obj.__esModule ? obj : {
|
|
25
|
-
default: obj
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
function _getRequireWildcardCache(nodeInterop) {
|
|
29
|
-
if (typeof WeakMap !== "function") return null;
|
|
30
|
-
var cacheBabelInterop = new WeakMap();
|
|
31
|
-
var cacheNodeInterop = new WeakMap();
|
|
32
|
-
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
33
|
-
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
34
|
-
})(nodeInterop);
|
|
35
|
-
}
|
|
36
|
-
function _interop_require_wildcard(obj, nodeInterop) {
|
|
37
|
-
if (!nodeInterop && obj && obj.__esModule) {
|
|
38
|
-
return obj;
|
|
39
|
-
}
|
|
40
|
-
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
41
|
-
return {
|
|
42
|
-
default: obj
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
var cache = _getRequireWildcardCache(nodeInterop);
|
|
46
|
-
if (cache && cache.has(obj)) {
|
|
47
|
-
return cache.get(obj);
|
|
48
|
-
}
|
|
49
|
-
var newObj = {
|
|
50
|
-
__proto__: null
|
|
51
|
-
};
|
|
52
|
-
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
53
|
-
for(var key in obj){
|
|
54
|
-
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
55
|
-
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
56
|
-
if (desc && (desc.get || desc.set)) {
|
|
57
|
-
Object.defineProperty(newObj, key, desc);
|
|
58
|
-
} else {
|
|
59
|
-
newObj[key] = obj[key];
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
newObj.default = obj;
|
|
64
|
-
if (cache) {
|
|
65
|
-
cache.set(obj, newObj);
|
|
66
|
-
}
|
|
67
|
-
return newObj;
|
|
68
|
-
}
|
|
69
|
-
global.lng = 'en';
|
|
70
|
-
const _default = {
|
|
71
|
-
title: 'Form Elements/MultiSelect',
|
|
72
|
-
component: _MultiSelect.default
|
|
73
|
-
};
|
|
74
|
-
const MultiTemplate = (args)=>{
|
|
75
|
-
const options = [
|
|
76
|
-
{
|
|
77
|
-
id: 1,
|
|
78
|
-
label: 'label test 1',
|
|
79
|
-
value: 'check1'
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
id: 2,
|
|
83
|
-
label: 'label test 2',
|
|
84
|
-
value: 'check2'
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
id: 3,
|
|
88
|
-
label: 'label test 3',
|
|
89
|
-
value: 'check3'
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
id: 4,
|
|
93
|
-
label: 'label test 4',
|
|
94
|
-
value: 'check4'
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
id: 5,
|
|
98
|
-
label: 'label test 5',
|
|
99
|
-
value: 'check5'
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
id: 6,
|
|
103
|
-
label: 'label test 6',
|
|
104
|
-
value: 'check6'
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
id: 7,
|
|
108
|
-
label: 'label test 7',
|
|
109
|
-
value: 'check7'
|
|
110
|
-
}
|
|
111
|
-
];
|
|
112
|
-
const [value, setValue] = (0, _react.useState)([]);
|
|
113
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_MultiSelect.default, {
|
|
114
|
-
...args,
|
|
115
|
-
options: options,
|
|
116
|
-
chosenOptions: value,
|
|
117
|
-
onChange: setValue
|
|
118
|
-
});
|
|
119
|
-
};
|
|
120
|
-
const MultiDropdownTemplate = MultiTemplate.bind({});
|
|
121
|
-
MultiDropdownTemplate.args = {};
|