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.
Files changed (177) hide show
  1. package/package.json +1 -1
  2. package/dist/Atomic/FormElements/ActionAlert/ActionAlert.interface.js +0 -4
  3. package/dist/Atomic/FormElements/ActionAlert/ActionAlert.stories.js +0 -89
  4. package/dist/Atomic/FormElements/ActionAlert/ActionAlert.test.js +0 -130
  5. package/dist/Atomic/FormElements/ActionAlert/index.js +0 -17
  6. package/dist/Atomic/FormElements/AdvancedStatus/AdvancedStatus.interface.js +0 -4
  7. package/dist/Atomic/FormElements/AdvancedStatus/AdvancedStatus.stories.js +0 -81
  8. package/dist/Atomic/FormElements/AdvancedStatus/AdvancedStatus.test.js +0 -104
  9. package/dist/Atomic/FormElements/AdvancedStatus/index.js +0 -17
  10. package/dist/Atomic/FormElements/Calendar/Calendar.props.js +0 -4
  11. package/dist/Atomic/FormElements/Calendar/Calendar.stories.js +0 -108
  12. package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.interface.js +0 -4
  13. package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.stories.js +0 -100
  14. package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.test.js +0 -143
  15. package/dist/Atomic/FormElements/CheckboxInput/index.js +0 -17
  16. package/dist/Atomic/FormElements/CheckboxesLine/CheckboxesLine.interface.js +0 -4
  17. package/dist/Atomic/FormElements/CheckboxesLine/CheckboxesLine.stories.js +0 -94
  18. package/dist/Atomic/FormElements/CheckboxesLine/CheckboxesLine.test.js +0 -177
  19. package/dist/Atomic/FormElements/CheckboxesLine/index.js +0 -17
  20. package/dist/Atomic/FormElements/Datepicker/Datepicker.stories.js +0 -51
  21. package/dist/Atomic/FormElements/Dropdown/Dropdown.stories.js +0 -596
  22. package/dist/Atomic/FormElements/DropdownLiveSearch/DropdownLiveSearch.stories.js +0 -272
  23. package/dist/Atomic/FormElements/FileLoader/FileLoader.stories.js +0 -182
  24. package/dist/Atomic/FormElements/FileLoaderDescription/FileLoaderDescription.stories.js +0 -327
  25. package/dist/Atomic/FormElements/FileLoaderLocal/FileLoaderLocal.stories.js +0 -186
  26. package/dist/Atomic/FormElements/FileLoaderLocalGroup/FileLoaderLocalGroup.stories.js +0 -84
  27. package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN.stories.js +0 -107
  28. package/dist/Atomic/FormElements/Input/Input.stories.js +0 -251
  29. package/dist/Atomic/FormElements/InputCalendar/InputCalendar.stories.js +0 -115
  30. package/dist/Atomic/FormElements/InputColor/InputColor.stories.js +0 -119
  31. package/dist/Atomic/FormElements/InputCurrency/InputCurrency.interface.js +0 -4
  32. package/dist/Atomic/FormElements/InputCurrency/InputCurrency.stories.js +0 -178
  33. package/dist/Atomic/FormElements/InputCurrency/InputCurrency.test.js +0 -129
  34. package/dist/Atomic/FormElements/InputCurrency/index.js +0 -16
  35. package/dist/Atomic/FormElements/InputDateRange/InputDateRange.stories.js +0 -123
  36. package/dist/Atomic/FormElements/InputLink/InputLink.stories.js +0 -140
  37. package/dist/Atomic/FormElements/InputMask/InputMask.stories.js +0 -303
  38. package/dist/Atomic/FormElements/InputMask2/InputMask2.stories.js +0 -314
  39. package/dist/Atomic/FormElements/InputMask3/InputMask3.stories.js +0 -335
  40. package/dist/Atomic/FormElements/InputWithAction/InputWithAction.stories.js +0 -276
  41. package/dist/Atomic/FormElements/InputsRow/InputsRow.stories.js +0 -56
  42. package/dist/Atomic/FormElements/Label/Label.interface.js +0 -4
  43. package/dist/Atomic/FormElements/Label/Label.stories.js +0 -47
  44. package/dist/Atomic/FormElements/Label/Label.test.js +0 -167
  45. package/dist/Atomic/FormElements/Label/index.js +0 -17
  46. package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.stories.js +0 -172
  47. package/dist/Atomic/FormElements/MultiSelect/MultiSelect.stories.js +0 -121
  48. package/dist/Atomic/FormElements/NumericInput/NumericInput.stories.js +0 -184
  49. package/dist/Atomic/FormElements/RadioGroup/RadioGroup.stories.js +0 -79
  50. package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.stories.js +0 -151
  51. package/dist/Atomic/FormElements/RadioInput/RadioInput.stories.js +0 -67
  52. package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.stories.js +0 -116
  53. package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.stories.js +0 -107
  54. package/dist/Atomic/FormElements/RangeInputs/RangeInputs.stories.js +0 -92
  55. package/dist/Atomic/FormElements/RangeList/RangeList.stories.js +0 -169
  56. package/dist/Atomic/FormElements/RangeSlider/RangeSlider.stories.js +0 -401
  57. package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.stories.js +0 -314
  58. package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.stories.js +0 -137
  59. package/dist/Atomic/FormElements/Switcher/Switcher.stories.js +0 -91
  60. package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.stories.js +0 -104
  61. package/dist/Atomic/FormElements/SwitcherHide/SwitcherHide.stories.js +0 -96
  62. package/dist/Atomic/FormElements/SwitcherRadio/SwitcherRadio.stories.js +0 -140
  63. package/dist/Atomic/FormElements/SwitcherRange/SwitcherRange.stories.js +0 -112
  64. package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.stories.js +0 -145
  65. package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.stories.js +0 -158
  66. package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.stories.js +0 -101
  67. package/dist/Atomic/FormElements/TagListToDropdown/TagListToDropdown.stories.js +0 -131
  68. package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.stories.js +0 -357
  69. package/dist/Atomic/FormElements/Text/Text.stories.js +0 -80
  70. package/dist/Atomic/FormElements/TextSwitcher/TextSwitcher.stories.js +0 -106
  71. package/dist/Atomic/FormElements/TextSwitcher/TextSwitcher.test.js +0 -93
  72. package/dist/Atomic/FormElements/Textarea/Textarea.stories.js +0 -103
  73. package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.stories.js +0 -174
  74. package/dist/Atomic/FormElements/TimeRange/TimeRange.interface.js +0 -4
  75. package/dist/Atomic/FormElements/TimeRange/TimeRange.stories.js +0 -40
  76. package/dist/Atomic/FormElements/TimeRange/TimeRange.test.js +0 -163
  77. package/dist/Atomic/FormElements/TimeRange/index.js +0 -17
  78. package/dist/Atomic/FormElements/UserContacts/UserContact.test.js +0 -381
  79. package/dist/Atomic/FormElements/UserContacts/UserContacts.interface.js +0 -4
  80. package/dist/Atomic/FormElements/UserContacts/UserContacts.stories.js +0 -74
  81. package/dist/Atomic/FormElements/UserContacts/index.js +0 -17
  82. package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.stories.js +0 -193
  83. package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.stories.js +0 -147
  84. package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.stories.js +0 -151
  85. package/dist/Atomic/Layout/Header/Header.stories.js +0 -71
  86. package/dist/Atomic/Layout/MainMenu/MainMenu.stories.js +0 -115
  87. package/dist/Atomic/Layout/Spinner/Spinner.interface.js +0 -4
  88. package/dist/Atomic/Layout/Spinner/Spinner.stories.js +0 -46
  89. package/dist/Atomic/Layout/Spinner/Spinner.test.js +0 -54
  90. package/dist/Atomic/Layout/Spinner/index.js +0 -17
  91. package/dist/Atomic/UI/Accordion/Accordion.interface.js +0 -4
  92. package/dist/Atomic/UI/Accordion/Accordion.stories.js +0 -168
  93. package/dist/Atomic/UI/Accordion/Accordion.test.js +0 -54
  94. package/dist/Atomic/UI/Accordion/AccordionItem.test.js +0 -50
  95. package/dist/Atomic/UI/Accordion/index.js +0 -17
  96. package/dist/Atomic/UI/AccordionTable/AccordionTable.stories.js +0 -268
  97. package/dist/Atomic/UI/AccordionText/AccordionText.stories.js +0 -125
  98. package/dist/Atomic/UI/AdvancedTag/AdvancedTags.stories.js +0 -115
  99. package/dist/Atomic/UI/Alert/Alert.stories.js +0 -81
  100. package/dist/Atomic/UI/Arrow/Arrow.stories.js +0 -62
  101. package/dist/Atomic/UI/Box/Box.stories.js +0 -114
  102. package/dist/Atomic/UI/Button/Button.stories.js +0 -105
  103. package/dist/Atomic/UI/Button/Button.test.js +0 -147
  104. package/dist/Atomic/UI/ButtonsBar/ButtonsBar.stories.js +0 -129
  105. package/dist/Atomic/UI/Chart/Chart.stories.js +0 -93
  106. package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.stories.js +0 -85
  107. package/dist/Atomic/UI/DateTime/DateTime.stories.js +0 -50
  108. package/dist/Atomic/UI/DoubleString/DoubleString.stories.js +0 -79
  109. package/dist/Atomic/UI/DynamicIcon/DynamicIcon.interface.js +0 -4
  110. package/dist/Atomic/UI/DynamicIcon/DynamicIcon.stories.js +0 -98
  111. package/dist/Atomic/UI/DynamicIcon/DynamicIcon.test.js +0 -51
  112. package/dist/Atomic/UI/DynamicIcon/index.js +0 -17
  113. package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.stories.js +0 -98
  114. package/dist/Atomic/UI/Hint/Hint.stories.js +0 -101
  115. package/dist/Atomic/UI/Hint/index.js +0 -16
  116. package/dist/Atomic/UI/Modal/Modal.interface.js +0 -4
  117. package/dist/Atomic/UI/Modal/Modal.stories.js +0 -370
  118. package/dist/Atomic/UI/Modal/ModalHOC.stories.js +0 -191
  119. package/dist/Atomic/UI/Modal/ModalHOC.test.js +0 -187
  120. package/dist/Atomic/UI/Modal/index.js +0 -26
  121. package/dist/Atomic/UI/Modal/partials/ModalFooter.test.js +0 -118
  122. package/dist/Atomic/UI/Modal/partials/ModalTitle.test.js +0 -126
  123. package/dist/Atomic/UI/Modal/partials/useMobileModal.test.js +0 -133
  124. package/dist/Atomic/UI/MonoAccordion/MonoAccordion.interface.js +0 -4
  125. package/dist/Atomic/UI/MonoAccordion/MonoAccordion.stories.js +0 -513
  126. package/dist/Atomic/UI/MonoAccordion/MonoAccordion.test.js +0 -84
  127. package/dist/Atomic/UI/MonoAccordion/index.js +0 -17
  128. package/dist/Atomic/UI/NavLine/NavLine.interface.js +0 -4
  129. package/dist/Atomic/UI/NavLine/NavLine.stories.js +0 -434
  130. package/dist/Atomic/UI/NavLine/NavLine.test.js +0 -311
  131. package/dist/Atomic/UI/NavLine/index.js +0 -17
  132. package/dist/Atomic/UI/PageTitle/PageTitle.interface.js +0 -4
  133. package/dist/Atomic/UI/PageTitle/PageTitle.stories.js +0 -62
  134. package/dist/Atomic/UI/PageTitle/PageTitle.test.js +0 -181
  135. package/dist/Atomic/UI/PageTitle/index.js +0 -17
  136. package/dist/Atomic/UI/PieChart/PieChar.interface.js +0 -4
  137. package/dist/Atomic/UI/PieChart/PieChart.stories.js +0 -82
  138. package/dist/Atomic/UI/PieChart/PieChart.test.js +0 -142
  139. package/dist/Atomic/UI/PieChart/index.js +0 -26
  140. package/dist/Atomic/UI/Price/Price.interface.js +0 -4
  141. package/dist/Atomic/UI/Price/Price.stories.js +0 -52
  142. package/dist/Atomic/UI/Price/Price.test.js +0 -83
  143. package/dist/Atomic/UI/Price/index.js +0 -17
  144. package/dist/Atomic/UI/PriceRange/PriceRange.interface.js +0 -4
  145. package/dist/Atomic/UI/PriceRange/PriceRange.stories.js +0 -51
  146. package/dist/Atomic/UI/PriceRange/PriceRange.test.js +0 -72
  147. package/dist/Atomic/UI/PriceRange/index.js +0 -17
  148. package/dist/Atomic/UI/ProgressLine/ProgressLine.interface.js +0 -4
  149. package/dist/Atomic/UI/ProgressLine/ProgressLine.stories.js +0 -163
  150. package/dist/Atomic/UI/ProgressLine/ProgressLine.test.js +0 -60
  151. package/dist/Atomic/UI/ProgressLine/index.js +0 -17
  152. package/dist/Atomic/UI/Status/Status.interface.js +0 -4
  153. package/dist/Atomic/UI/Status/Status.stories.js +0 -79
  154. package/dist/Atomic/UI/Status/Status.test.js +0 -103
  155. package/dist/Atomic/UI/Status/index.js +0 -17
  156. package/dist/Atomic/UI/Table/Table.stories.js +0 -250
  157. package/dist/Atomic/UI/Tag/Tag.interface.js +0 -4
  158. package/dist/Atomic/UI/Tag/Tag.stories.js +0 -108
  159. package/dist/Atomic/UI/Tag/Tag.test.js +0 -75
  160. package/dist/Atomic/UI/Tag/index.js +0 -17
  161. package/dist/Atomic/UI/TagList/TagList.stories.js +0 -169
  162. package/dist/Atomic/UI/UserBox/UserBox.interface.js +0 -4
  163. package/dist/Atomic/UI/UserBox/UserBox.stories.js +0 -57
  164. package/dist/Atomic/UI/UserBox/UserBox.test.js +0 -136
  165. package/dist/Atomic/UI/UserBox/index.js +0 -17
  166. package/dist/Atomic/UI/WizardStepper/WizardStepper.stories.js +0 -70
  167. package/dist/Functions/useIsMobile/index.js +0 -17
  168. package/dist/Functions/useIsMobile/useIsMobile.js +0 -33
  169. package/dist/Functions/useIsMobile/useIsMobile.test.js +0 -104
  170. package/dist/Functions/useKeyPress/useHandleKeyPress.test.js +0 -96
  171. package/dist/Functions/useKeyPress/useKeyPress.test.js +0 -87
  172. package/dist/Molecular/FormElement/FormElement.stories.js +0 -92
  173. package/dist/Molecular/FormWithDependOn/FormWithDependOn.stories.js +0 -301
  174. package/dist/Molecular/InputAddress/InputAddress.stories.js +0 -541
  175. package/dist/Molecular/InputPassword/InputPassword.stories.js +0 -86
  176. package/dist/types/base.interface.js +0 -4
  177. package/dist/types/base.types.js +0 -4
@@ -1,106 +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
- TextSwitcherTemplate: function() {
13
- return TextSwitcherTemplate;
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 _TextSwitcher = /*#__PURE__*/ _interop_require_default(require("./TextSwitcher"));
22
- require("./partial/AnyOuterClass.scss");
23
- require("../../../../../scss/main.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: 'Form Elements/TextSwitcher',
73
- component: _TextSwitcher.default,
74
- argTypes: {
75
- disabled: {
76
- description: 'boolean'
77
- },
78
- activeText: {
79
- description: 'left text. string'
80
- },
81
- inactiveText: {
82
- description: 'right text. string'
83
- },
84
- className: {
85
- description: 'string'
86
- }
87
- }
88
- };
89
- const Template = (args)=>{
90
- const { isIncludeOuterStyles, ...restArgs } = args;
91
- const [isActive, setIsActive] = (0, _react.useState)(true);
92
- return /*#__PURE__*/ (0, _jsxruntime.jsx)(_TextSwitcher.default, {
93
- ...restArgs,
94
- className: isIncludeOuterStyles ? 'any-outer-class__text-switcher' : null,
95
- isActive: isActive,
96
- onChange: setIsActive
97
- });
98
- };
99
- const TextSwitcherTemplate = Template.bind({});
100
- TextSwitcherTemplate.args = {
101
- isIncludeOuterStyles: false,
102
- disabled: false,
103
- activeText: 'is',
104
- inactiveText: 'some long text',
105
- className: ''
106
- };
@@ -1,93 +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
- require("@testing-library/jest-dom");
8
- const _TextSwitcher = /*#__PURE__*/ _interop_require_default(require("./TextSwitcher"));
9
- function _interop_require_default(obj) {
10
- return obj && obj.__esModule ? obj : {
11
- default: obj
12
- };
13
- }
14
- describe('textSwitcher Component', ()=>{
15
- it('renders with active text when isActive is true', ()=>{
16
- (0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_TextSwitcher.default, {
17
- isActive: true,
18
- onChange: ()=>{},
19
- activeText: "is",
20
- inactiveText: "is not"
21
- }));
22
- expect(_react.screen.getByText('is')).toBeInTheDocument();
23
- });
24
- it('renders with inactive text when isActive is false', ()=>{
25
- (0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_TextSwitcher.default, {
26
- isActive: false,
27
- onChange: ()=>{},
28
- activeText: "is",
29
- inactiveText: "is not"
30
- }));
31
- expect(_react.screen.getByText('is not')).toBeInTheDocument();
32
- });
33
- it('does not render inactive text when isActive is true and inactiveText is not provided', ()=>{
34
- (0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_TextSwitcher.default, {
35
- isActive: true,
36
- onChange: ()=>{},
37
- activeText: "is",
38
- inactiveText: ""
39
- }));
40
- expect(_react.screen.queryByText('is not')).not.toBeInTheDocument();
41
- });
42
- it('calls onChange when clicked', ()=>{
43
- const onChangeMock = jest.fn();
44
- (0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_TextSwitcher.default, {
45
- isActive: true,
46
- onChange: onChangeMock,
47
- activeText: "is",
48
- inactiveText: "is not"
49
- }));
50
- _react.fireEvent.click(_react.screen.getByTestId('text-switcher'));
51
- expect(onChangeMock).toHaveBeenCalledWith(false);
52
- });
53
- it('applies disabled class when disabled is true', ()=>{
54
- const { container } = (0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_TextSwitcher.default, {
55
- isActive: true,
56
- onChange: ()=>{},
57
- disabled: true,
58
- activeText: "is",
59
- inactiveText: "is not"
60
- }));
61
- expect(container.firstChild).toHaveClass('text-switcher_disabled');
62
- });
63
- it('does not trigger onChange when disabled is true', ()=>{
64
- const onChangeMock = jest.fn();
65
- (0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_TextSwitcher.default, {
66
- isActive: true,
67
- onChange: onChangeMock,
68
- disabled: true,
69
- activeText: "is",
70
- inactiveText: "is not"
71
- }));
72
- _react.fireEvent.click(_react.screen.getByTestId('text-switcher'));
73
- expect(onChangeMock).not.toHaveBeenCalled();
74
- });
75
- it('applies active class when isActive is true', ()=>{
76
- const { container } = (0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_TextSwitcher.default, {
77
- isActive: true,
78
- onChange: ()=>{},
79
- activeText: "is",
80
- inactiveText: "is not"
81
- }));
82
- expect(container.firstChild).toHaveClass('text-switcher_active');
83
- });
84
- it('applies inactive class when isActive is false', ()=>{
85
- const { container } = (0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_TextSwitcher.default, {
86
- isActive: false,
87
- onChange: ()=>{},
88
- activeText: "is",
89
- inactiveText: "is not"
90
- }));
91
- expect(container.firstChild).not.toHaveClass('text-switcher_active');
92
- });
93
- });
@@ -1,103 +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
- TextareaTemplate: function() {
13
- return TextareaTemplate;
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 _Textarea = /*#__PURE__*/ _interop_require_default(require("./Textarea"));
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/Textarea',
72
- component: _Textarea.default
73
- };
74
- const Template = (args)=>{
75
- const [value, setValue] = (0, _react.useState)('');
76
- const handleFocus = (e)=>console.log('Focused', e.target.tagName.toLowerCase() === 'textarea');
77
- const handleBlur = (e)=>console.log('Blured', e.target.tagName.toLowerCase() === 'textarea');
78
- const areaRef = (0, _react.useRef)();
79
- (0, _react.useEffect)(()=>{
80
- if (areaRef.current) {
81
- const isFocused = areaRef.current === document.activeElement;
82
- console.log("Textarea is focused:", isFocused);
83
- }
84
- }, [
85
- areaRef.current,
86
- document.activeElement
87
- ]);
88
- return /*#__PURE__*/ (0, _jsxruntime.jsx)(_Textarea.default, {
89
- ...args,
90
- value: value,
91
- ref: areaRef,
92
- onFocus: handleFocus,
93
- onBlur: handleBlur,
94
- onChange: setValue
95
- });
96
- };
97
- const TextareaTemplate = Template.bind({});
98
- TextareaTemplate.args = {
99
- disabled: false,
100
- placeholder: 'Placeholder',
101
- className: 'any-class',
102
- isNotValidateASCII: false
103
- };
@@ -1,174 +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
- TieredCheckboxesTemplate: function() {
13
- return TieredCheckboxesTemplate;
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 _reactfeather = require("react-feather");
22
- const _TieredCheckboxes = /*#__PURE__*/ _interop_require_default(require("./TieredCheckboxes"));
23
- require("../../../../../scss/main.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: 'Form Elements/TieredCheckboxes',
73
- component: _TieredCheckboxes.default,
74
- argTypes: {
75
- isUseAccordionForGroup: {
76
- description: 'set items in accordions by group. boolean. optional'
77
- },
78
- accordionIcons: {
79
- description: 'icons for accordions. array. optional'
80
- },
81
- items: {
82
- description: 'array'
83
- },
84
- className: {
85
- description: 'string. optional'
86
- }
87
- }
88
- };
89
- const Template = (args)=>{
90
- const [state, setState] = (0, _react.useState)([
91
- ...args.items
92
- ]);
93
- return /*#__PURE__*/ (0, _jsxruntime.jsx)(_TieredCheckboxes.default, {
94
- ...args,
95
- onChange: (items)=>setState(items)
96
- });
97
- };
98
- const TieredCheckboxesTemplate = Template.bind({});
99
- TieredCheckboxesTemplate.args = {
100
- isUseParentsClassesAsDataset: true,
101
- isUseAccordionForGroup: true,
102
- accordionIcons: [
103
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactfeather.ChevronDown, {}),
104
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactfeather.ChevronUp, {})
105
- ],
106
- items: [
107
- {
108
- key: 1,
109
- label: 'BLevel 1',
110
- value: false,
111
- className: 'parent-custom-class',
112
- children: [
113
- {
114
- key: 11,
115
- label: 'CLevel 2',
116
- value: true
117
- },
118
- {
119
- key: 12,
120
- label: 'BLevel 2',
121
- value: false
122
- },
123
- {
124
- key: 13,
125
- label: 'ALevel 2',
126
- value: false
127
- }
128
- ]
129
- },
130
- {
131
- key: 2,
132
- label: 'CLevel 1',
133
- value: false,
134
- children: [
135
- {
136
- key: 21,
137
- label: 'GLevel 2',
138
- value: false
139
- },
140
- {
141
- key: 22,
142
- label: 'ELevel 2',
143
- value: true
144
- },
145
- {
146
- key: 23,
147
- label: 'FLevel 2',
148
- value: true,
149
- disabled: true
150
- }
151
- ]
152
- },
153
- {
154
- key: 3,
155
- label: 'ALevel 1',
156
- value: false,
157
- children: [
158
- {
159
- key: 31,
160
- label: 'Level 2',
161
- value: false,
162
- disabled: true
163
- },
164
- {
165
- key: 32,
166
- label: 'Level 2',
167
- value: true,
168
- disabled: true
169
- }
170
- ]
171
- }
172
- ],
173
- className: ''
174
- };
@@ -1,4 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
@@ -1,40 +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
- TimeRangeTemplate: function() {
13
- return TimeRangeTemplate;
14
- },
15
- default: function() {
16
- return _default;
17
- }
18
- });
19
- const _jsxruntime = require("react/jsx-runtime");
20
- const _TimeRange = /*#__PURE__*/ _interop_require_default(require("./TimeRange"));
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/TimeRange',
29
- component: _TimeRange.default
30
- };
31
- const Template = (args)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_TimeRange.default, {
32
- ...args
33
- });
34
- const TimeRangeTemplate = Template.bind({});
35
- TimeRangeTemplate.args = {
36
- from: '12:00',
37
- to: '13:00',
38
- labelFrom: '',
39
- labelTo: ''
40
- };
@@ -1,163 +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 _userevent = /*#__PURE__*/ _interop_require_default(require("@testing-library/user-event"));
8
- const _TimeRange = /*#__PURE__*/ _interop_require_default(require("./TimeRange"));
9
- function _interop_require_default(obj) {
10
- return obj && obj.__esModule ? obj : {
11
- default: obj
12
- };
13
- }
14
- describe('timeRange', ()=>{
15
- const defaultProps = {
16
- from: '09:00',
17
- to: '17:00',
18
- labelFrom: 'Start',
19
- labelTo: 'End'
20
- };
21
- it('renders without crashing', ()=>{
22
- (0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_TimeRange.default, {}));
23
- expect(_react.screen.getByTestId('time-range')).toBeInTheDocument();
24
- });
25
- it('renders with default labels when no labels provided', ()=>{
26
- (0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_TimeRange.default, {}));
27
- expect(_react.screen.getByText('Between')).toBeInTheDocument();
28
- expect(_react.screen.getByText('and')).toBeInTheDocument();
29
- });
30
- it('renders with custom labels', ()=>{
31
- (0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_TimeRange.default, {
32
- ...defaultProps
33
- }));
34
- expect(_react.screen.getByText('Start')).toBeInTheDocument();
35
- expect(_react.screen.getByText('End')).toBeInTheDocument();
36
- });
37
- it('displays initial time values', ()=>{
38
- (0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_TimeRange.default, {
39
- ...defaultProps
40
- }));
41
- const startInputWrapper = _react.screen.getByTestId('start-time-input');
42
- const startInput = startInputWrapper.querySelector('input');
43
- const endInputWrapper = _react.screen.getByTestId('end-time-input');
44
- const endInput = endInputWrapper.querySelector('input');
45
- expect(startInput.value).toBe('09:00');
46
- expect(endInput.value).toBe('17:00');
47
- });
48
- it('handles time input changes', async ()=>{
49
- (0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_TimeRange.default, {}));
50
- const startInputWrapper = _react.screen.getByTestId('start-time-input');
51
- const startInput = startInputWrapper.querySelector('input');
52
- const endInputWrapper = _react.screen.getByTestId('end-time-input');
53
- const endInput = endInputWrapper.querySelector('input');
54
- await _userevent.default.type(startInput, '10:30');
55
- await _userevent.default.type(endInput, '18:30');
56
- expect(startInput).toHaveValue('10:30');
57
- expect(endInput).toHaveValue('18:30');
58
- });
59
- it('validates time format on blur', ()=>{
60
- (0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_TimeRange.default, {}));
61
- const startInputWrapper = _react.screen.getByTestId('start-time-input');
62
- const startInput = startInputWrapper.querySelector('input');
63
- _react.fireEvent.change(startInput, {
64
- target: {
65
- value: 'invalid'
66
- }
67
- });
68
- _react.fireEvent.blur(startInput);
69
- expect(_react.screen.getByText('Between')).toBeInTheDocument();
70
- });
71
- it('formats valid time on blur', ()=>{
72
- (0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_TimeRange.default, {}));
73
- const startInputWrapper = _react.screen.getByTestId('start-time-input');
74
- const startInput = startInputWrapper.querySelector('input');
75
- _react.fireEvent.change(startInput, {
76
- target: {
77
- value: '9:00'
78
- }
79
- });
80
- _react.fireEvent.blur(startInput);
81
- expect(startInput).toHaveValue('9:00');
82
- });
83
- it('applies custom className', ()=>{
84
- const customClass = 'custom-time-range';
85
- (0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_TimeRange.default, {
86
- className: customClass
87
- }));
88
- expect(_react.screen.getByTestId('time-range')).toHaveClass(customClass);
89
- });
90
- it('handles empty time values', ()=>{
91
- (0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_TimeRange.default, {}));
92
- const startInputWrapper = _react.screen.getByTestId('start-time-input');
93
- const startInput = startInputWrapper.querySelector('input');
94
- const endInputWrapper = _react.screen.getByTestId('end-time-input');
95
- const endInput = endInputWrapper.querySelector('input');
96
- _react.fireEvent.change(startInput, {
97
- target: {
98
- value: ''
99
- }
100
- });
101
- _react.fireEvent.change(endInput, {
102
- target: {
103
- value: ''
104
- }
105
- });
106
- _react.fireEvent.blur(startInput);
107
- _react.fireEvent.blur(endInput);
108
- expect(startInput).toHaveValue('');
109
- expect(endInput).toHaveValue('');
110
- });
111
- describe('time validation', ()=>{
112
- it('validates correct time format', ()=>{
113
- (0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_TimeRange.default, {}));
114
- const startInputWrapper = _react.screen.getByTestId('start-time-input');
115
- const startInput = startInputWrapper.querySelector('input');
116
- // Valid time
117
- _react.fireEvent.change(startInput, {
118
- target: {
119
- value: '13:45'
120
- }
121
- });
122
- _react.fireEvent.blur(startInput);
123
- expect(_react.screen.queryByText('HH:MM format')).not.toBeInTheDocument();
124
- // Invalid time
125
- _react.fireEvent.change(startInput, {
126
- target: {
127
- value: '25:70'
128
- }
129
- });
130
- _react.fireEvent.blur(startInput);
131
- expect(_react.screen.getByText('Between')).toBeInTheDocument();
132
- });
133
- it('handles various time input formats', ()=>{
134
- (0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_TimeRange.default, {}));
135
- const startInputWrapper = _react.screen.getByTestId('start-time-input');
136
- const startInput = startInputWrapper.querySelector('input');
137
- // Test different valid formats
138
- const testCases = [
139
- {
140
- input: '9:30',
141
- expected: '9:30'
142
- },
143
- {
144
- input: '14:00',
145
- expected: '14:00'
146
- },
147
- {
148
- input: '23:59',
149
- expected: '23:59'
150
- }
151
- ];
152
- testCases.forEach(({ input, expected })=>{
153
- _react.fireEvent.change(startInput, {
154
- target: {
155
- value: input
156
- }
157
- });
158
- _react.fireEvent.blur(startInput);
159
- expect(startInput).toHaveValue(expected);
160
- });
161
- });
162
- });
163
- });