intelicoreact 0.0.96 → 0.0.99

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 (160) hide show
  1. package/dist/Atomic/FormElements/Dropdown/Dropdown.js +5 -3
  2. package/dist/Atomic/FormElements/Dropdown/Dropdown.stories.js +2 -1
  3. package/dist/Atomic/FormElements/Input/Input.js +3 -1
  4. package/dist/Atomic/FormElements/Input/Input.stories.js +5 -1
  5. package/dist/Atomic/FormElements/InputDateRange/InputDateRange.js +4 -4
  6. package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.js +179 -70
  7. package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.scss +23 -23
  8. package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.stories.js +87 -12
  9. package/dist/Atomic/FormElements/Spinner/Spinner.js +21 -0
  10. package/{src/Atomic/FormElements/Dropdown/components/DropdownLoader.scss → dist/Atomic/FormElements/Spinner/Spinner.scss} +8 -5
  11. package/dist/Atomic/FormElements/Spinner/Spinner.stories.js +34 -0
  12. package/dist/Functions/inputExecutor.js +7 -1
  13. package/package.json +3 -2
  14. package/.babelrc +0 -12
  15. package/.eslintignore +0 -10
  16. package/.eslintrc.json +0 -93
  17. package/src/Atomic/FormElements/CheckboxInput/CheckboxInput.js +0 -28
  18. package/src/Atomic/FormElements/CheckboxInput/CheckboxInput.scss +0 -107
  19. package/src/Atomic/FormElements/CheckboxInput/CheckboxInput.stories.js +0 -26
  20. package/src/Atomic/FormElements/DateTime/DateTime.js +0 -18
  21. package/src/Atomic/FormElements/DateTime/DateTime.scss +0 -12
  22. package/src/Atomic/FormElements/DateTime/DateTime.stories.js +0 -17
  23. package/src/Atomic/FormElements/DoubleString/DoubleString.js +0 -13
  24. package/src/Atomic/FormElements/DoubleString/DoubleString.scss +0 -20
  25. package/src/Atomic/FormElements/DoubleString/DoubleString.stories.js +0 -18
  26. package/src/Atomic/FormElements/Dropdown/Dropdown.js +0 -178
  27. package/src/Atomic/FormElements/Dropdown/Dropdown.scss +0 -192
  28. package/src/Atomic/FormElements/Dropdown/Dropdown.stories.js +0 -87
  29. package/src/Atomic/FormElements/Dropdown/components/DropdownLoader.js +0 -17
  30. package/src/Atomic/FormElements/Header/Header.js +0 -67
  31. package/src/Atomic/FormElements/Header/Header.scss +0 -93
  32. package/src/Atomic/FormElements/Header/Header.stories.js +0 -30
  33. package/src/Atomic/FormElements/Input/Input.js +0 -186
  34. package/src/Atomic/FormElements/Input/Input.scss +0 -136
  35. package/src/Atomic/FormElements/Input/Input.stories.js +0 -94
  36. package/src/Atomic/FormElements/InputCalendar/InputCalendar.js +0 -104
  37. package/src/Atomic/FormElements/InputCalendar/InputCalendar.scss +0 -23
  38. package/src/Atomic/FormElements/InputCalendar/InputCalendar.stories.js +0 -39
  39. package/src/Atomic/FormElements/InputDateRange/InputDateRange.js +0 -254
  40. package/src/Atomic/FormElements/InputDateRange/InputDateRange.scss +0 -624
  41. package/src/Atomic/FormElements/InputDateRange/InputDateRange.stories.js +0 -65
  42. package/src/Atomic/FormElements/InputDateRange/components/Datepicker.js +0 -432
  43. package/src/Atomic/FormElements/InputDateRange/components/OpenedPart.js +0 -126
  44. package/src/Atomic/FormElements/InputDateRange/components/SelectItem.js +0 -24
  45. package/src/Atomic/FormElements/InputDateRange/dependencies.js +0 -161
  46. package/src/Atomic/FormElements/InputsRow/InputsRow.js +0 -112
  47. package/src/Atomic/FormElements/InputsRow/InputsRow.scss +0 -45
  48. package/src/Atomic/FormElements/InputsRow/InputsRow.stories.js +0 -34
  49. package/src/Atomic/FormElements/Label/Label.js +0 -13
  50. package/src/Atomic/FormElements/Label/Label.scss +0 -20
  51. package/src/Atomic/FormElements/Label/Label.stories.js +0 -23
  52. package/src/Atomic/FormElements/MobileCalendar/MobileCalendar.js +0 -315
  53. package/src/Atomic/FormElements/MobileCalendar/MobileCalendar.scss +0 -120
  54. package/src/Atomic/FormElements/MobileCalendar/MobileCalendar.stories.js +0 -30
  55. package/src/Atomic/FormElements/Modal/Modal.js +0 -69
  56. package/src/Atomic/FormElements/Modal/Modal.scss +0 -230
  57. package/src/Atomic/FormElements/Modal/Modal.stories.js +0 -116
  58. package/src/Atomic/FormElements/MultiSelect/MultiSelect.js +0 -39
  59. package/src/Atomic/FormElements/MultiSelect/MultiSelect.scss +0 -16
  60. package/src/Atomic/FormElements/MultiSelect/MultiSelect.stories.js +0 -28
  61. package/src/Atomic/FormElements/NavLine/NavLine.js +0 -67
  62. package/src/Atomic/FormElements/NavLine/NavLine.scss +0 -108
  63. package/src/Atomic/FormElements/NavLine/NavLine.stories.js +0 -108
  64. package/src/Atomic/FormElements/NumericInput/NumericInput.js +0 -263
  65. package/src/Atomic/FormElements/NumericInput/NumericInput.scss +0 -135
  66. package/src/Atomic/FormElements/NumericInput/NumericInput.stories.js +0 -78
  67. package/src/Atomic/FormElements/RadioInput/RadioInput.js +0 -28
  68. package/src/Atomic/FormElements/RadioInput/RadioInput.scss +0 -63
  69. package/src/Atomic/FormElements/RadioInput/RadioInput.stories.js +0 -23
  70. package/src/Atomic/FormElements/RangeCalendar/RangeCalendar.js +0 -152
  71. package/src/Atomic/FormElements/RangeCalendar/RangeCalendar.scss +0 -101
  72. package/src/Atomic/FormElements/RangeCalendar/RangeCalendar.stories.js +0 -54
  73. package/src/Atomic/FormElements/RangeInputs/RangeInputs.js +0 -41
  74. package/src/Atomic/FormElements/RangeInputs/RangeInputs.scss +0 -20
  75. package/src/Atomic/FormElements/RangeInputs/RangeInputs.stories.js +0 -23
  76. package/src/Atomic/FormElements/Switcher/Switcher.js +0 -24
  77. package/src/Atomic/FormElements/Switcher/Switcher.scss +0 -56
  78. package/src/Atomic/FormElements/Switcher/Switcher.stories.js +0 -22
  79. package/src/Atomic/FormElements/Table/Partials/TdCell.js +0 -47
  80. package/src/Atomic/FormElements/Table/Partials/TdHeader.js +0 -33
  81. package/src/Atomic/FormElements/Table/Partials/TdRow.js +0 -84
  82. package/src/Atomic/FormElements/Table/Partials/TdTitle.js +0 -38
  83. package/src/Atomic/FormElements/Table/Table.js +0 -50
  84. package/src/Atomic/FormElements/Table/Table.scss +0 -78
  85. package/src/Atomic/FormElements/Table/Table.stories.js +0 -102
  86. package/src/Atomic/FormElements/Table/TdTypes/TdActions.js +0 -59
  87. package/src/Atomic/FormElements/Table/TdTypes/TdPriority.js +0 -20
  88. package/src/Atomic/FormElements/Table/TdTypes/TdRange.js +0 -15
  89. package/src/Atomic/FormElements/Table/TdTypes/TdTypes.scss +0 -35
  90. package/src/Atomic/FormElements/Table/TdTypes/TdWeight.js +0 -43
  91. package/src/Atomic/FormElements/Tag/Tag.js +0 -24
  92. package/src/Atomic/FormElements/Tag/Tag.scss +0 -38
  93. package/src/Atomic/FormElements/Tag/Tag.stories.js +0 -30
  94. package/src/Atomic/FormElements/TagsDropdown/TagsDropdown.js +0 -108
  95. package/src/Atomic/FormElements/TagsDropdown/TagsDropdown.scss +0 -131
  96. package/src/Atomic/FormElements/TagsDropdown/TagsDropdown.stories.js +0 -44
  97. package/src/Atomic/FormElements/TextSwitcher/TextSwitcher.js +0 -18
  98. package/src/Atomic/FormElements/TextSwitcher/TextSwitcher.scss +0 -50
  99. package/src/Atomic/FormElements/TextSwitcher/TextSwitcher.stories.js +0 -21
  100. package/src/Atomic/FormElements/Textarea/Textarea.js +0 -19
  101. package/src/Atomic/FormElements/Textarea/Textarea.scss +0 -35
  102. package/src/Atomic/FormElements/Textarea/Textarea.stories.js +0 -24
  103. package/src/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.js +0 -66
  104. package/src/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.scss +0 -10
  105. package/src/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.stories.js +0 -57
  106. package/src/Atomic/FormElements/TimeRange/TimeRange.js +0 -55
  107. package/src/Atomic/FormElements/TimeRange/TimeRange.scss +0 -17
  108. package/src/Atomic/FormElements/TimeRange/TimeRange.stories.js +0 -21
  109. package/src/Atomic/MainMenu/MainMenu.js +0 -112
  110. package/src/Atomic/MainMenu/MainMenu.scss +0 -176
  111. package/src/Atomic/MainMenu/MainMenu.stories.js +0 -91
  112. package/src/Atomic/UI/Accordion/Accordion.js +0 -45
  113. package/src/Atomic/UI/Accordion/Accordion.scss +0 -73
  114. package/src/Atomic/UI/Accordion/Accordion.stories.js +0 -78
  115. package/src/Atomic/UI/Accordion/AccordionItem.js +0 -92
  116. package/src/Atomic/UI/AdvancedTag/AdvTag.js +0 -81
  117. package/src/Atomic/UI/AdvancedTag/AdvancedTags.js +0 -32
  118. package/src/Atomic/UI/AdvancedTag/AdvancedTags.scss +0 -72
  119. package/src/Atomic/UI/AdvancedTag/AdvancedTags.stories.js +0 -49
  120. package/src/Atomic/UI/Alert/Alert.js +0 -23
  121. package/src/Atomic/UI/Alert/Alert.scss +0 -65
  122. package/src/Atomic/UI/Alert/Alert.stories.js +0 -34
  123. package/src/Atomic/UI/Arrow/Arrow.js +0 -41
  124. package/src/Atomic/UI/Arrow/Arrow.scss +0 -19
  125. package/src/Atomic/UI/Arrow/Arrow.stories.js +0 -32
  126. package/src/Atomic/UI/Button/Button.js +0 -17
  127. package/src/Atomic/UI/Button/Button.scss +0 -108
  128. package/src/Atomic/UI/Button/Button.stories.js +0 -49
  129. package/src/Atomic/UI/Calendar/Calendar.js +0 -190
  130. package/src/Atomic/UI/Calendar/Calendar.scss +0 -607
  131. package/src/Atomic/UI/Calendar/Calendar.stories.js +0 -26
  132. package/src/Atomic/UI/Header/partials/default_ava.png +0 -0
  133. package/src/Atomic/UI/Hint/Hint.js +0 -34
  134. package/src/Atomic/UI/Hint/Hint.scss +0 -92
  135. package/src/Atomic/UI/Hint/Hint.stories.js +0 -34
  136. package/src/Atomic/UI/Price/Price.js +0 -20
  137. package/src/Atomic/UI/Price/Price.stories.js +0 -30
  138. package/src/Atomic/UI/Status/Status.js +0 -38
  139. package/src/Atomic/UI/Status/Status.scss +0 -69
  140. package/src/Atomic/UI/Status/Status.stories.js +0 -47
  141. package/src/Constants/index.constants.js +0 -41
  142. package/src/Functions/customEventListener.js +0 -58
  143. package/src/Functions/inputExecutor.js +0 -53
  144. package/src/Functions/schemas.js +0 -31
  145. package/src/Functions/useClickOutside.js +0 -15
  146. package/src/Functions/useMouseUpOutside.js +0 -16
  147. package/src/Functions/useToggle.js +0 -17
  148. package/src/Functions/utils.js +0 -51
  149. package/src/Molecular/Datepicker/Datepicker.js +0 -346
  150. package/src/Molecular/Datepicker/Datepicker.scss +0 -8
  151. package/src/Molecular/Datepicker/Datepicker.stories.js +0 -27
  152. package/src/Molecular/Datepicker/components/Calendar.js +0 -118
  153. package/src/Molecular/FormElements/FormElement.js +0 -18
  154. package/src/Molecular/FormElements/FormElement.scss +0 -8
  155. package/src/Molecular/FormElements/FormElement.stories.js +0 -59
  156. package/src/index.js +0 -3
  157. package/src/scss/_fonts.scss +0 -109
  158. package/src/scss/_vars.scss +0 -48
  159. package/src/scss/main.scss +0 -40
  160. package/webpack.config.js +0 -61
@@ -1,92 +0,0 @@
1
- .hint {
2
- position: relative;
3
- display: inline-block;
4
- font-size: 0;
5
-
6
- &__button {
7
- display: flex;
8
- cursor: pointer;
9
-
10
- svg {
11
- width: 16px;
12
- height: 16px;
13
- margin-right: 5px;
14
- }
15
-
16
- &:hover,
17
- &_active {
18
- color: #6b81dd;
19
-
20
- svg {
21
- color: #6b81dd;
22
- }
23
- }
24
- }
25
-
26
- &__text {
27
- position: absolute;
28
- background-color: #6b81dd;
29
- color: #fff;
30
- font-size: 10px;
31
- line-height: 16px;
32
- border-radius: 4px;
33
- max-width: 250px;
34
- min-width: 80px;
35
- padding: 8px;
36
- z-index: 1;
37
-
38
- a {
39
- color: #fff;
40
- text-decoration: underline;
41
- }
42
-
43
- &:before {
44
- content: "";
45
- position: absolute;
46
- width: 8.5px;
47
- height: 8.5px;
48
- background-color: #6b81dd;
49
- transform: rotate(45deg);
50
- }
51
-
52
- &_bottom {
53
- top: 26px;
54
- left: -4px;
55
- &:before {
56
- left: 8px;
57
- top: -4.25px;
58
- }
59
- }
60
-
61
- &_right {
62
- top: -4px;
63
- left: 24px;
64
- &:before {
65
- top: 8px;
66
- left: -4.25px;
67
- }
68
- }
69
-
70
- &_left {
71
- top: -2px;
72
- right: 24px;
73
- &:before {
74
- top: 8px;
75
- right: -4.25px;
76
- }
77
- }
78
-
79
- &_top {
80
- bottom: 26px;
81
- left: -4px;
82
- &:before {
83
- left: 8px;
84
- bottom: -4.25px;
85
- }
86
- }
87
- }
88
-
89
- &__icon {
90
- color: #9aa0b9;
91
- }
92
- }
@@ -1,34 +0,0 @@
1
- import React from 'react';
2
- import Hint from './Hint';
3
-
4
- global.lng = 'en';
5
-
6
- export default {
7
- title: 'UI/Hint',
8
- component: Hint,
9
- argTypes: {
10
- side: {
11
- description: 'string: ["right", "bottom", "top", "left"]',
12
- control: {
13
- type: 'select',
14
- options: ['right', 'bottom', 'top', 'left']
15
- }
16
- },
17
- hint: {
18
- description: 'string'
19
- }
20
- }
21
- };
22
-
23
- const Template = args => {
24
- return <Hint {...args} />;
25
- };
26
-
27
- export const HintTemplate = Template.bind({});
28
-
29
- HintTemplate.args = {
30
- hint: ' hint text hint text hint text hint text hint text hint text hint text hint text',
31
- side: 'right',
32
- label: ''
33
- // isIconOutline: false
34
- };
@@ -1,20 +0,0 @@
1
- import React from 'react';
2
- const Price = ({ value, unit = '$', unitAfter, className }) => {
3
- if (value === undefined || value === null) return null;
4
- let formatted;
5
- if (value.length <= 3) {
6
- formatted = parseFloat(value).toFixed(2);
7
- } else {
8
- formatted = Number(value.toString().replace(/[+*?$^(,)]/g, '')).toLocaleString('en-US');
9
- }
10
-
11
- return (
12
- <div className={`price ${className}`}>
13
- {!unitAfter && unit}
14
- {formatted}
15
- {unitAfter && unit}
16
- </div>
17
- );
18
- };
19
-
20
- export default Price;
@@ -1,30 +0,0 @@
1
- import React from 'react';
2
- import Price from './Price';
3
-
4
- global.lng = 'en';
5
-
6
- export default {
7
- title: 'UI/Price',
8
- component: Price,
9
- argTypes: {
10
- value: {
11
- description: 'string',
12
- },
13
- unit: {
14
- description: 'string'
15
- },
16
- unitAfter: {
17
- description: 'boolean'
18
- }
19
- }
20
- };
21
-
22
- const Template = args => <Price {...args} />;
23
-
24
- export const PriceTemplate = Template.bind({});
25
-
26
- PriceTemplate.args = {
27
- value: '15000',
28
- unit: '$',
29
- unitAfter: false
30
- };
@@ -1,38 +0,0 @@
1
- import React from 'react';
2
- import cn from 'classnames';
3
-
4
- import './Status.scss';
5
-
6
- const Status = ({ label, status, disabled, type, active = 0, pause = 0, className, noBackground, children }) => {
7
- return (
8
- <div className={cn({ disabled }, className)}>
9
- {type === 'number' ? (
10
- <div>
11
- {active === 0 && pause === 0 ? (
12
- <div className="status status--error">
13
- <span>{active}</span>
14
- </div>
15
- ) : (
16
- <div className="status status--warning">
17
- <span className="status--number-active">{active}</span>
18
- <span className="color--gray-gull"> / </span>
19
- <span className={`${pause > 0 ? 'color--froly' : 'color--gray-gull'}`}>{pause}</span>
20
- </div>
21
- )}
22
- </div>
23
- ) : (
24
- <div
25
- className={cn(
26
- `status status--${status} ${className || ''}`,
27
- { 'status--no-bg': noBackground },
28
- { 'color--gray-gull': noBackground && status === 'pause' && !className }
29
- )}
30
- >
31
- {children || label}
32
- </div>
33
- )}
34
- </div>
35
- );
36
- };
37
-
38
- export default Status;
@@ -1,69 +0,0 @@
1
- @import "~anme/scss/anme-vars";
2
-
3
- .status {
4
- display: inline-flex;
5
- align-items: center;
6
- justify-content: center;
7
- font-size: 11px;
8
- font-weight: 400;
9
- border-radius: 15px;
10
- padding: 0 8px;
11
- height: 20px;
12
-
13
- &--number {
14
- display: flex;
15
- align-items: center;
16
- justify-content: center;
17
- font-size: 10px;
18
- border-radius: 15px;
19
- height: 20px;
20
- }
21
- &--active,
22
- &--approved {
23
- color: $color--green-haze;
24
- background-color: $color--panache;
25
- }
26
-
27
- &--error {
28
- color: #ffff;
29
- background-color: #9aa0b9;
30
- }
31
-
32
- &--pause,
33
- &--reject,
34
- &--No,
35
- &--declined {
36
- color: $color--froly;
37
- background-color: #fce2e8;
38
- }
39
-
40
- &--processing {
41
- color: #9aa0b9;
42
- background-color: #e2e6f8;
43
- }
44
-
45
- &--new,
46
- &--preApproved {
47
- color: $color--primary;
48
- background-color: #e2e6f8;
49
- }
50
-
51
- &--warning {
52
- background-color: $color--sandy-beach;
53
- }
54
-
55
- &--number-active,
56
- &--Yes {
57
- color: $color--green-haze;
58
- }
59
-
60
- &--no-bg {
61
- background: none;
62
- font-size: 13px;
63
- }
64
-
65
- &--disabled {
66
- background-color: $color--border;
67
- color: #777;
68
- }
69
- }
@@ -1,47 +0,0 @@
1
- import React from 'react';
2
- import Status from './Status';
3
-
4
- global.lng = 'en';
5
-
6
- export default {
7
- title: 'UI/Status',
8
- component: Status,
9
- argTypes: {
10
- status: {
11
- description: 'string: ["active", "pause", "error", "processing"]',
12
- control: {
13
- type: 'select',
14
- options: ['active', 'pause', 'error', 'processing']
15
- }
16
- },
17
- label: {
18
- description: 'string'
19
- },
20
- disabled: {
21
- description: 'boolean'
22
- },
23
- children: {
24
- description: 'any rect children'
25
- }
26
- }
27
- };
28
-
29
- const Template = args => <Status {...args} />;
30
-
31
- export const StatusTemplate = Template.bind({});
32
- export const StatusNumberTemplate = Template.bind({});
33
-
34
- StatusTemplate.args = {
35
- label: '',
36
- status: 'active',
37
- disabled: false,
38
- noBackground: false
39
- };
40
-
41
- StatusNumberTemplate.args = {
42
- active: 0,
43
- pause: 0,
44
- status: 'active',
45
- disabled: false,
46
- type: 'number'
47
- };
@@ -1,41 +0,0 @@
1
-
2
- export const KEYBOARD_SERVICE_KEYS = [
3
- 'Escape',
4
- 'F1',
5
- 'F2',
6
- 'F3',
7
- 'F4',
8
- 'F5',
9
- 'F6',
10
- 'F7',
11
- 'F8',
12
- 'F9',
13
- 'F10',
14
- 'F11',
15
- 'F12',
16
- 'Tab',
17
- 'CapsLock',
18
- 'Shift',
19
- 'Control',
20
- 'Meta',
21
- 'Option',
22
- 'Alt',
23
- 'ContextMenu',
24
- 'ArrowLeft',
25
- 'ArrowRight',
26
- 'ArrowUp',
27
- 'ArrowDown',
28
- 'NumLock',
29
- 'Backspace',
30
- 'Delete',
31
- 'Enter',
32
- 'Return',
33
- 'Insert',
34
- 'Home',
35
- 'End',
36
- 'PageUp',
37
- 'PageDown',
38
- 'PrintScreen',
39
- 'ScrollLock',
40
- 'Pause'
41
- ];
@@ -1,58 +0,0 @@
1
- (function() {
2
- Element.prototype._addEventListener = Element.prototype.addEventListener;
3
- Element.prototype.addEventListener = function(a,b,c) {
4
- if(c==undefined)
5
- c=false;
6
- this._addEventListener(a,b,c);
7
- if(!this.eventListenerList)
8
- this.eventListenerList = {};
9
- if(!this.eventListenerList[a])
10
- this.eventListenerList[a] = [];
11
- //this.removeEventListener(a,b,c); // TODO - handle duplicates..
12
- this.eventListenerList[a].push({listener:b,useCapture:c});
13
- };
14
-
15
- Element.prototype.getEventListeners = function(a){
16
- if(!this.eventListenerList)
17
- this.eventListenerList = {};
18
- if(a==undefined)
19
- return this.eventListenerList;
20
- return this.eventListenerList[a];
21
- };
22
- Element.prototype.clearEventListeners = function(a){
23
- if(!this.eventListenerList)
24
- this.eventListenerList = {};
25
- if(a==undefined){
26
- for(var x in (this.getEventListeners())) this.clearEventListeners(x);
27
- return;
28
- }
29
- var el = this.getEventListeners(a);
30
- if(el==undefined)
31
- return;
32
- for(var i = el.length - 1; i >= 0; --i) {
33
- var ev = el[i];
34
- this.removeEventListener(a, ev.listener, ev.useCapture);
35
- }
36
- };
37
-
38
- Element.prototype._removeEventListener = Element.prototype.removeEventListener;
39
- Element.prototype.removeEventListener = function(a,b,c) {
40
- if(c==undefined)
41
- c=false;
42
- this._removeEventListener(a,b,c);
43
- if(!this.eventListenerList)
44
- this.eventListenerList = {};
45
- if(!this.eventListenerList[a])
46
- this.eventListenerList[a] = [];
47
-
48
- // Find the event in the list
49
- for(var i=0;i<this.eventListenerList[a].length;i++){
50
- if(this.eventListenerList[a][i].listener==b, this.eventListenerList[a][i].useCapture==c){ // Hmm..
51
- this.eventListenerList[a].splice(i, 1);
52
- break;
53
- }
54
- }
55
- if(this.eventListenerList[a].length==0)
56
- delete this.eventListenerList[a];
57
- };
58
- })();
@@ -1,53 +0,0 @@
1
- export const formatInput = {
2
- priceInput: {
3
- addCommas: (value) => {
4
- value = value.toString();
5
- const isFraction = value.includes('.');
6
-
7
- const valueBeforeDot = isFraction ? value.slice(0, value.indexOf('.')) : value;
8
-
9
- const intPart = valueBeforeDot
10
- .split('')
11
- .reverse()
12
- .reduce((acc, item, idx) => (idx % 3 === 0 && idx !== 0 ? [...acc, ',', item] : [...acc, item]), [])
13
- .reverse()
14
- .join('');
15
-
16
- return isFraction ? intPart + value.slice(value.indexOf('.')) : intPart;
17
- },
18
- removeComma: (value) => {
19
- return parseInt(value.toString().replace(/\,/g, ''));
20
- },
21
- },
22
- onlyNumbers: (value, isDot = false) => {
23
- const val = value.slice(0, 1) !== '0' && value.slice(0, 1) !== '.' ? value : value.slice(1);
24
- if (isDot) return twoDigitAfterDot(val.replace(/[^0-9.]/g, ''));
25
- else return +val.toString().replace(/\D/g, '');
26
- },
27
- onlyString: (value) => {
28
- return value.toString().replace(/[^a-z]/gi, '');
29
- },
30
- };
31
-
32
- //обрезает числа после точки до 2х
33
- // 342.23423432 -> 342.23
34
- const twoDigitAfterDot = (value) => {
35
- if (value.includes('.')) {
36
- const valueAfterDot = value.slice(0, value.indexOf('.') + 3);
37
- let rest = value.slice(value.indexOf('.') + 1, value.indexOf('.') + 3);
38
-
39
- return allButTheFirstDotCutter(valueAfterDot);
40
- } else {
41
- return value;
42
- }
43
- };
44
-
45
- //обрезает все точки кроме первой.
46
- //для фомата "2 цифры после точки"
47
- // нельзя = 123...
48
- // можно 123.99
49
- function allButTheFirstDotCutter(str) {
50
- return str.replace(/^([^.]*\.)(.*)$/, function (a, b, c) {
51
- return b + c.replace(/\./g, '');
52
- });
53
- }
@@ -1,31 +0,0 @@
1
- import * as yup from 'yup';
2
-
3
- export const forgotSchema = yup.object().shape({
4
- email: yup.string().email('Invalid email').required('E-mail is required')
5
- });
6
-
7
- export const loginSchema = yup.object().shape({
8
- email: yup.string().email('Invalid email').required('E-mail is required'),
9
- password: yup
10
- .string()
11
- .required('No password provided')
12
- .min(8, 'Password is too short - should be 8 chars minimum')
13
- .matches(/[a-zA-Z]/, 'Password can only contain Latin letters'),
14
- remember: yup.bool()
15
- });
16
-
17
- export const registerSchema = yup.object().shape({
18
- name: yup.string().required('Name is required'),
19
- email: yup.string().email('Invalid email').required('E-mail is required'),
20
- password: yup
21
- .string()
22
- .required('No password provided')
23
- .min(8, 'Password is too short - should be 8 chars minimum')
24
- .matches(/[a-zA-Z]/, 'Password can only contain Latin letters'),
25
- confirmPassword: yup
26
- .string()
27
- .required('Confirm password')
28
- .oneOf([yup.ref('password')], 'Passwords must match'),
29
- promo: yup.string(),
30
- recaptcha: yup.bool().oneOf([true], 'Field must be checked')
31
- });
@@ -1,15 +0,0 @@
1
- import { useEffect } from 'react';
2
-
3
- export const useClickOutside = (ref, setOut, open) => {
4
- function handleClickOutside(event) {
5
- if (ref.current && !ref.current.contains(event.target)) {
6
- setOut(open);
7
- }
8
- }
9
- useEffect(() => {
10
- document.addEventListener('mousedown', handleClickOutside);
11
- return () => {
12
- document.removeEventListener('mousedown', handleClickOutside);
13
- };
14
- }, [ref]);
15
- };
@@ -1,16 +0,0 @@
1
- import { useEffect } from 'react'
2
-
3
- export default function useMouseUpOutside(ref, setOut, open) {
4
- function handleMouseUpOutside(event) {
5
- if (ref.current && !ref.current.contains(event.target)) {
6
- setOut(open);
7
- }
8
- }
9
-
10
- useEffect(() => {
11
- document.addEventListener('mouseup', handleMouseUpOutside);
12
- return () => {
13
- document.removeEventListener('mouseup', handleMouseUpOutside);
14
- };
15
- }, [ref]);
16
- }
@@ -1,17 +0,0 @@
1
- import { useCallback, useState } from 'react';
2
-
3
- const useToggle = initialState => {
4
- const [isToggled, setToggle] = useState(!!initialState);
5
- const toggle = useCallback(() => setToggle(isOn => !isOn), []);
6
- const toggleOn = useCallback(() => setToggle(true), []);
7
- const toggleOff = useCallback(() => setToggle(false), []);
8
-
9
- return {
10
- isToggled,
11
- toggle,
12
- toggleOn,
13
- toggleOff
14
- };
15
- };
16
-
17
- export default useToggle;
@@ -1,51 +0,0 @@
1
- import { useEffect } from 'react';
2
- /* eslint-disable guard-for-in, no-unused-vars */
3
- export const handleObjectChange =
4
- (updateObject, updateFunction) =>
5
- (data, prop = '', isNumber) => {
6
- let value;
7
- if (data?.target) {
8
- value =
9
- data.target.type === 'checkbox'
10
- ? data.target.checked
11
- : data.target.value;
12
- } else value = data;
13
-
14
- value = isNumber ? +value : value;
15
-
16
- const props = prop.split('.');
17
- const currentObject = props.reduce((res, chapter, index) => {
18
- if (props.length !== index + 1) res = res[chapter];
19
- return res;
20
- }, updateObject);
21
-
22
- currentObject[props.pop()] = value;
23
- updateFunction();
24
- };
25
-
26
- export const useOutsideToggle = (ref, setOut, open) => {
27
- function handleClickOutside(event) {
28
- if (ref.current && !ref.current.contains(event.target)) {
29
- setOut(open);
30
- }
31
- }
32
- useEffect(() => {
33
- document.addEventListener('mouseup', handleClickOutside);
34
- return () => {
35
- // Unbind the event listener on clean up
36
- document.removeEventListener('mouseup', handleClickOutside);
37
- };
38
- }, [ref]);
39
- };
40
-
41
- export const logout = () => {
42
- window.localStorage.removeItem('accessToken');
43
- window.localStorage.removeItem('tokenExpires');
44
- window.location.reload();
45
- };
46
-
47
- export const getStyles = (el, prop) => {
48
- if (!el) return null;
49
- if (!prop) return window.getComputedStyle(el);
50
- return window.getComputedStyle(el).getPropertyValue(prop);
51
- };