bright-components 10.2.7 → 10.2.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. package/circle.yml +1 -2
  2. package/deploy.sh +6 -0
  3. package/dist/components/DayPicker/NewDayPicker/index.js +0 -28
  4. package/dist/components/DayPicker/index.js +2 -20
  5. package/dist/components/DayPickerPanel/HeaderDayPickerPanel/index.js +1 -18
  6. package/dist/components/DayPickerPanel/HeaderMonthPanel/index.js +0 -14
  7. package/dist/components/DayPickerPanel/HeaderYearPanel/index.js +2 -15
  8. package/dist/components/DayPickerPanel/Shortcuts/index.js +2 -16
  9. package/dist/components/DayPickerPanel/index.js +2 -74
  10. package/dist/components/EmployeeCard/index.js +1 -14
  11. package/dist/components/EmployeePicker/FilterBar/index.js +1 -28
  12. package/dist/components/EmployeePicker/Group/index.js +1 -41
  13. package/dist/components/FilterRadioGroup/index.js +2 -14
  14. package/dist/components/Form/index.js +4 -47
  15. package/dist/components/Modal/index.js +1 -23
  16. package/dist/components/RadioBlock/index.js +10 -41
  17. package/dist/components/Snackbar/index.js +1 -17
  18. package/dist/components/Time/OverlayBase/index.js +2 -25
  19. package/dist/components/Time/TimePicker/TimeOverlay/index.js +3 -26
  20. package/dist/components/TimePicker/Time/TimeOverlay/index.js +1 -58
  21. package/dist/setupTests.js +0 -7
  22. package/package.json +6 -8
  23. package/src/components/DayPicker/NewDayPicker/index.js +0 -21
  24. package/src/components/DayPicker/index.js +1 -16
  25. package/src/components/DayPicker/test.js +0 -85
  26. package/src/components/DayPickerPanel/HeaderDayPickerPanel/index.js +2 -22
  27. package/src/components/DayPickerPanel/HeaderDayPickerPanel/test.js +0 -34
  28. package/src/components/DayPickerPanel/HeaderMonthPanel/index.js +0 -10
  29. package/src/components/DayPickerPanel/HeaderMonthPanel/test.js +0 -25
  30. package/src/components/DayPickerPanel/HeaderYearPanel/index.js +3 -12
  31. package/src/components/DayPickerPanel/HeaderYearPanel/test.js +0 -17
  32. package/src/components/DayPickerPanel/Shortcuts/index.js +3 -17
  33. package/src/components/DayPickerPanel/Shortcuts/test.js +0 -39
  34. package/src/components/DayPickerPanel/index.js +1 -69
  35. package/src/components/DayPickerPanel/test.js +0 -177
  36. package/src/components/EmployeeCard/index.js +1 -15
  37. package/src/components/EmployeeCard/test.js +0 -20
  38. package/src/components/EmployeePicker/FilterBar/index.js +2 -26
  39. package/src/components/EmployeePicker/FilterBar/test.js +0 -29
  40. package/src/components/EmployeePicker/Group/index.js +1 -42
  41. package/src/components/EmployeePicker/Group/test.js +0 -21
  42. package/src/components/FilterRadioGroup/index.js +2 -14
  43. package/src/components/FilterRadioGroup/test.js +0 -13
  44. package/src/components/Form/index.js +1 -49
  45. package/src/components/Form/test.js +0 -73
  46. package/src/components/Modal/index.js +1 -22
  47. package/src/components/Modal/test.js +9 -9
  48. package/src/components/RadioBlock/index.js +14 -33
  49. package/src/components/RadioBlock/test.js +35 -155
  50. package/src/components/ResponsiveTabs/test.js +49 -86
  51. package/src/components/Snackbar/index.js +1 -16
  52. package/src/components/Time/OverlayBase/index.js +3 -21
  53. package/src/components/Time/OverlayBase/test.js +0 -50
  54. package/src/components/Time/TimePicker/TimeOverlay/index.js +4 -30
  55. package/src/components/Time/TimePicker/TimeOverlay/test.js +0 -24
  56. package/src/components/TimePicker/DayPart/test.js +1 -1
  57. package/src/components/TimePicker/Time/TimeOverlay/index.js +2 -50
  58. package/src/components/TimePicker/Time/TimeOverlay/test.js +1 -220
  59. package/src/index.js +1 -1
  60. package/src/setupTests.js +0 -2
  61. package/dist/components/TimePicker/utils/PickerGA/index.js +0 -24
  62. package/dist/utils/trackForm/index.js +0 -48
  63. package/src/components/TimePicker/utils/PickerGA/index.js +0 -6
  64. package/src/components/TimePicker/utils/PickerGA/test.js +0 -29
  65. package/src/utils/trackForm/index.js +0 -36
  66. package/src/utils/trackForm/test.js +0 -110
@@ -1,48 +0,0 @@
1
- "use strict";
2
-
3
- exports.__esModule = true;
4
- exports.default = void 0;
5
-
6
- var _reactGa = _interopRequireDefault(require("react-ga"));
7
-
8
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
-
10
- const trackForm = category => e => {
11
- const {
12
- type,
13
- checked,
14
- value,
15
- name
16
- } = e.target || e;
17
-
18
- const getAttribute = attr => e.target && e.target.getAttribute(attr);
19
-
20
- const isPassword = type === 'password';
21
- const trackValue = getAttribute('data-track-value') === 'on' ? value : undefined;
22
- const label = getAttribute('data-track-label') || trackValue;
23
- let action = getAttribute('data-track-action') || name;
24
-
25
- if (type === 'checkbox') {
26
- action += checked ? ' on' : ' off';
27
- } // will be turned on when all react forms are updated
28
- // if (!action || action === 'null') {
29
- // return;
30
- // }
31
-
32
-
33
- if (isPassword || !label) {
34
- return _reactGa.default.event({
35
- category,
36
- action
37
- });
38
- }
39
-
40
- _reactGa.default.event({
41
- category,
42
- action,
43
- label
44
- });
45
- };
46
-
47
- var _default = trackForm;
48
- exports.default = _default;
@@ -1,6 +0,0 @@
1
- import ReactGA from 'react-ga';
2
-
3
- const PickerGA = ({ action, category, label }) =>
4
- category && ReactGA.event({ category, action, label });
5
-
6
- export default PickerGA;
@@ -1,29 +0,0 @@
1
- import ReactGA from 'react-ga';
2
- import PickerGA from '.';
3
-
4
- jest.mock('react-ga');
5
-
6
- describe('PickerGA', () => {
7
- it('should call ReactGA.event if category is defined', () => {
8
- expect(ReactGA.event).not.toHaveBeenCalled();
9
- PickerGA({
10
- category: 'test-category',
11
- action: 'test-action',
12
- label: 'test-action'
13
- });
14
- expect(ReactGA.event).toHaveBeenCalledWith({
15
- action: 'test-action',
16
- category: 'test-category',
17
- label: 'test-action'
18
- });
19
- });
20
-
21
- it('should NOT call ReactGA.event if category is defined', () => {
22
- expect(ReactGA.event).not.toHaveBeenCalled();
23
- PickerGA({
24
- action: 'test-action',
25
- label: 'test-action'
26
- });
27
- expect(ReactGA.event).not.toHaveBeenCalled();
28
- });
29
- });
@@ -1,36 +0,0 @@
1
- import ReactGA from 'react-ga';
2
-
3
- const trackForm = category => e => {
4
- const { type, checked, value, name } = e.target || e;
5
- const getAttribute = attr => e.target && e.target.getAttribute(attr);
6
- const isPassword = type === 'password';
7
- const trackValue =
8
- getAttribute('data-track-value') === 'on' ? value : undefined;
9
- const label = getAttribute('data-track-label') || trackValue;
10
-
11
- let action = getAttribute('data-track-action') || name;
12
-
13
- if (type === 'checkbox') {
14
- action += checked ? ' on' : ' off';
15
- }
16
-
17
- // will be turned on when all react forms are updated
18
- // if (!action || action === 'null') {
19
- // return;
20
- // }
21
-
22
- if (isPassword || !label) {
23
- return ReactGA.event({
24
- category,
25
- action
26
- });
27
- }
28
-
29
- ReactGA.event({
30
- category,
31
- action,
32
- label
33
- });
34
- };
35
-
36
- export default trackForm;
@@ -1,110 +0,0 @@
1
- import ReactGA from 'react-ga';
2
-
3
- import trackForm from '.';
4
-
5
- jest.mock('react-ga');
6
- jest.mock('debounce', () => fn => e => fn(e));
7
-
8
- const trackEvent = trackForm('form-name');
9
-
10
- it('should not track value password fields', () => {
11
- trackEvent({
12
- target: {
13
- getAttribute() {
14
- return 'input-name';
15
- },
16
- name: 'input-name',
17
- value: 'input-value',
18
- type: 'password'
19
- }
20
- });
21
-
22
- expect(ReactGA.event).toHaveBeenLastCalledWith({
23
- action: 'input-name',
24
- category: 'form-name'
25
- });
26
- });
27
- it('should not track value password fields with no target', () => {
28
- trackEvent({
29
- name: 'input-name',
30
- value: 'input-value',
31
- type: 'password'
32
- });
33
-
34
- expect(ReactGA.event).toHaveBeenLastCalledWith({
35
- action: 'input-name',
36
- category: 'form-name'
37
- });
38
- });
39
-
40
- it('should track change events', () => {
41
- trackEvent({
42
- target: {
43
- getAttribute() {
44
- return undefined;
45
- },
46
- name: 'input-name',
47
- value: 'input-value'
48
- }
49
- });
50
-
51
- expect(ReactGA.event).toHaveBeenLastCalledWith({
52
- action: 'input-name',
53
- category: 'form-name'
54
- });
55
- });
56
-
57
- it('should track change events - with overrides', () => {
58
- trackEvent({
59
- target: {
60
- getAttribute(name) {
61
- return `override ${name}`;
62
- },
63
- name: 'input-name',
64
- value: 'input-value'
65
- }
66
- });
67
-
68
- expect(ReactGA.event).toHaveBeenLastCalledWith({
69
- action: 'override data-track-action',
70
- category: 'form-name',
71
- label: 'override data-track-label'
72
- });
73
- });
74
-
75
- it('should report if checkbox has been checked', () => {
76
- trackEvent({
77
- target: {
78
- getAttribute: () => 'checkboxy',
79
- name: 'input-name',
80
- value: 'input-value',
81
- type: 'checkbox',
82
- checked: true
83
- }
84
- });
85
-
86
- expect(ReactGA.event).toHaveBeenLastCalledWith({
87
- action: 'checkboxy on',
88
- category: 'form-name',
89
- label: 'checkboxy'
90
- });
91
- });
92
-
93
- it('should report if checkbox has been unchecked', () => {
94
- trackEvent({
95
- target: {
96
- getAttribute: attr =>
97
- attr === 'data-track-value' ? 'on' : undefined,
98
- name: 'input-name',
99
- value: 'input-value',
100
- type: 'checkbox',
101
- checked: false
102
- }
103
- });
104
-
105
- expect(ReactGA.event).toHaveBeenLastCalledWith({
106
- action: 'input-name off',
107
- category: 'form-name',
108
- label: 'input-value'
109
- });
110
- });