x25 2.9.2 → 3.0.0
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/.eslintignore +2 -0
- package/.eslintrc.json +275 -0
- package/.flowconfig +23 -0
- package/conf/dev.js +19 -0
- package/conf/dist.js +19 -0
- package/conf/polyfills/tempPolyfills.js +7 -0
- package/package.json +16 -16
- package/src/Account/Load.jsx +79 -0
- package/src/Account/actions.js +10 -0
- package/src/Account/index.js +11 -0
- package/src/Account/reducer.js +139 -0
- package/src/Account/request.js +36 -0
- package/src/Async/InitModule.jsx +114 -0
- package/src/Async/RouteLoading.jsx +52 -0
- package/src/Async/SimulatedException.jsx +19 -0
- package/src/Async/index.jsx +75 -0
- package/src/Async/types.js +39 -0
- package/src/Company/Load.jsx +84 -0
- package/src/Company/actions.js +10 -0
- package/src/Company/index.js +11 -0
- package/src/Company/reducer.js +201 -0
- package/src/Company/request.js +30 -0
- package/src/Company/util.js +7 -0
- package/src/Header/AccountOptionsContainer.jsx +124 -0
- package/src/Header/AdminSelectCompany.jsx +101 -0
- package/src/Header/ClientSelectCompany.jsx +90 -0
- package/src/Header/Header.jsx +120 -0
- package/src/Header/HeaderContainer.jsx +30 -0
- package/src/Header/Logo.jsx +16 -0
- package/src/Header/LogoutButton.jsx +34 -0
- package/src/Header/index.jsx +9 -0
- package/src/Header/request.js +28 -0
- package/src/Header/types.js +6 -0
- package/src/Header/util.jsx +61 -0
- package/src/Inputs/Business/BankAccount.jsx +39 -0
- package/src/Inputs/Business/BankName.jsx +40 -0
- package/src/Inputs/Business/CifField.jsx +93 -0
- package/src/Inputs/Business/CifFieldContainer.jsx +142 -0
- package/src/Inputs/Business/Email.jsx +23 -0
- package/src/Inputs/Business/NidField.jsx +77 -0
- package/src/Inputs/Business/Phone.jsx +23 -0
- package/src/Inputs/Business/index.js +16 -0
- package/src/Inputs/Business/request.js +39 -0
- package/src/Inputs/CaptchaBox.jsx +131 -0
- package/src/Inputs/DateInput.jsx +188 -0
- package/src/Inputs/DateTemplate.jsx +213 -0
- package/src/Inputs/DelayInputChange.jsx +130 -0
- package/src/Inputs/FocusTemplate.jsx +41 -0
- package/src/Inputs/InputTemplate.jsx +79 -0
- package/src/Inputs/LabelTemplate.jsx +47 -0
- package/src/Inputs/NumericInput.jsx +142 -0
- package/src/Inputs/NumericTemplate.jsx +155 -0
- package/src/Inputs/Selects/County.jsx +19 -0
- package/src/Inputs/Selects/Custom.jsx +55 -0
- package/src/Inputs/Selects/Simple.jsx +73 -0
- package/src/Inputs/Selects/index.jsx +37 -0
- package/src/Inputs/SimpleInput.jsx +40 -0
- package/src/Inputs/SimpleTextarea.jsx +55 -0
- package/src/Inputs/TextareaTemplate.jsx +57 -0
- package/src/Inputs/Tooltip.jsx +61 -0
- package/src/Inputs/index.js +22 -0
- package/src/Messages/Error.jsx +83 -0
- package/src/Messages/Loading.jsx +43 -0
- package/src/Messages/index.jsx +4 -0
- package/src/Modal/Delete.jsx +237 -0
- package/src/Modal/Root.jsx +57 -0
- package/src/Modal/SimpleModal.jsx +47 -0
- package/src/Modal/actions.js +7 -0
- package/src/Modal/getComponent.jsx +32 -0
- package/src/Modal/index.jsx +12 -0
- package/src/Modal/reducer.js +40 -0
- package/src/Modal/types.js +6 -0
- package/src/Modal/util.js +15 -0
- package/src/Payment/EstimatePrice/Description.jsx +101 -0
- package/src/Payment/EstimatePrice/PayBox.jsx +173 -0
- package/src/Payment/EstimatePrice/index.jsx +63 -0
- package/src/Payment/EstimatePrice/util.js +15 -0
- package/src/Payment/MobilpayForm.jsx +77 -0
- package/src/Payment/Modal/BankTransfer.jsx +129 -0
- package/src/Payment/Modal/CompanyValability.jsx +14 -0
- package/src/Payment/Modal/DoneForm.jsx +209 -0
- package/src/Payment/Modal/PaymentDone.jsx +27 -0
- package/src/Payment/Modal/index.js +13 -0
- package/src/Payment/actions.jsx +22 -0
- package/{Payment → src/Payment}/codes.js +16 -19
- package/src/Payment/index.jsx +124 -0
- package/src/Payment/request.js +50 -0
- package/src/Payment/types.js +14 -0
- package/src/Payment/util.jsx +52 -0
- package/src/Payment/validate.js +25 -0
- package/src/Sidebar.jsx +158 -0
- package/src/Things.jsx +35 -0
- package/src/actions.js +36 -0
- package/src/config.js +7 -0
- package/src/dev/ErrorBoundary.jsx +98 -0
- package/src/dev/TheError.jsx +87 -0
- package/src/dev/index.js +127 -0
- package/src/dev/types.js +10 -0
- package/src/prod/SentryErrorBoundary.jsx +98 -0
- package/src/reducer/captchas.js +44 -0
- package/src/reducer/counties.js +46 -0
- package/src/reducer/index.js +25 -0
- package/src/reducer/module.jsx +43 -0
- package/src/style/.sass-lint.yml +84 -0
- package/src/style/.stylelintrc.json +161 -0
- package/src/style/_fancy-text.scss +37 -0
- package/src/style/_fix_bootstrap_placeholder_color.scss +14 -0
- package/src/style/_header-company.scss +69 -0
- package/src/style/_inputs.scss +12 -0
- package/src/style/_minimal.scss +31 -0
- package/src/style/_navigation.scss +24 -0
- package/src/style/_others.scss +79 -0
- package/src/style/index.scss +7 -0
- package/src/style/sidebar/_animations.scss +21 -0
- package/src/style/sidebar/_dark-theme.scss +77 -0
- package/src/style/sidebar/_scroll.scss +37 -0
- package/src/style/sidebar/_structure.scss +299 -0
- package/src/style/sidebar.scss +4 -0
- package/src/types.js +31 -0
- package/src/utility/calendar.js +39 -0
- package/src/utility/date.js +100 -0
- package/src/utility/index.js +12 -0
- package/src/utility/language.js +17 -0
- package/src/utility/mql.js +3 -0
- package/src/utility/normalize-test.js +58 -0
- package/src/utility/normalize.js +119 -0
- package/src/utility/numbers.js +87 -0
- package/src/utility/numeric.js +114 -0
- package/src/utility/others.jsx +160 -0
- package/src/utility/strings-test.js +136 -0
- package/src/utility/strings.js +80 -0
- package/src/utility/validation/common.js +360 -0
- package/src/utility/validation/index.js +70 -0
- package/src/utility/validation/specific.js +9 -0
- package/src/utility/validation/validate/bank-test.js +129 -0
- package/src/utility/validation/validate/bank.js +176 -0
- package/src/utility/validation/validate/cif-test.js +105 -0
- package/src/utility/validation/validate/cif.js +44 -0
- package/src/utility/validation/validate/cnp-test.js +216 -0
- package/src/utility/validation/validate/cnp.js +261 -0
- package/{utility → src/utility}/validation/validate/date.js +73 -61
- package/src/utility/validation/validate/email-test.js +36 -0
- package/src/utility/validation/validate/email.js +6 -0
- package/src/utility/validation/validate/index.js +7 -0
- package/webpack.config.js +90 -0
- package/x25.wiki/Account.md +41 -0
- package/x25.wiki/Company.md +39 -0
- package/x25.wiki/Header.md +21 -0
- package/x25.wiki/Home.md +1 -0
- package/x25.wiki/Inputs.md +33 -0
- package/x25.wiki/Messages.md +27 -0
- package/x25.wiki/Payment.md +42 -0
- package/Account/Load.js +0 -75
- package/Account/actions.js +0 -15
- package/Account/index.js +0 -20
- package/Account/reducer.js +0 -122
- package/Account/request.js +0 -44
- package/Async/InitModule.js +0 -190
- package/Async/RouteLoading.js +0 -64
- package/Async/SimulatedException.js +0 -44
- package/Async/index.js +0 -95
- package/Async/types.js +0 -1
- package/Company/Load.js +0 -82
- package/Company/actions.js +0 -15
- package/Company/index.js +0 -20
- package/Company/reducer.js +0 -165
- package/Company/request.js +0 -36
- package/Company/util.js +0 -10
- package/Header/AccountOptionsContainer.js +0 -144
- package/Header/AdminSelectCompany.js +0 -109
- package/Header/ClientSelectCompany.js +0 -104
- package/Header/Header.js +0 -127
- package/Header/HeaderContainer.js +0 -39
- package/Header/Logo.js +0 -30
- package/Header/LogoutButton.js +0 -39
- package/Header/index.js +0 -19
- package/Header/request.js +0 -26
- package/Header/types.js +0 -1
- package/Header/util.js +0 -58
- package/Inputs/Business/BankAccount.js +0 -48
- package/Inputs/Business/BankName.js +0 -49
- package/Inputs/Business/CifField.js +0 -112
- package/Inputs/Business/CifFieldContainer.js +0 -157
- package/Inputs/Business/Email.js +0 -37
- package/Inputs/Business/NidField.js +0 -91
- package/Inputs/Business/Phone.js +0 -37
- package/Inputs/Business/index.js +0 -34
- package/Inputs/Business/request.js +0 -39
- package/Inputs/CaptchaBox.js +0 -151
- package/Inputs/DateInput.js +0 -172
- package/Inputs/DateTemplate.js +0 -200
- package/Inputs/DelayInputChange.js +0 -135
- package/Inputs/FocusTemplate.js +0 -47
- package/Inputs/InputTemplate.js +0 -78
- package/Inputs/LabelTemplate.js +0 -59
- package/Inputs/NumericInput.js +0 -139
- package/Inputs/NumericTemplate.js +0 -148
- package/Inputs/Selects/County.js +0 -29
- package/Inputs/Selects/Custom.js +0 -56
- package/Inputs/Selects/Simple.js +0 -75
- package/Inputs/Selects/index.js +0 -52
- package/Inputs/SimpleInput.js +0 -42
- package/Inputs/SimpleTextarea.js +0 -47
- package/Inputs/TextareaTemplate.js +0 -55
- package/Inputs/Tooltip.js +0 -82
- package/Inputs/index.js +0 -185
- package/Messages/Error.js +0 -106
- package/Messages/Loading.js +0 -68
- package/Messages/index.js +0 -29
- package/Modal/Delete.js +0 -240
- package/Modal/Root.js +0 -81
- package/Modal/SimpleModal.js +0 -57
- package/Modal/actions.js +0 -10
- package/Modal/getComponent.js +0 -42
- package/Modal/index.js +0 -22
- package/Modal/reducer.js +0 -53
- package/Modal/types.js +0 -7
- package/Modal/util.js +0 -17
- package/Payment/EstimatePrice/Description.js +0 -92
- package/Payment/EstimatePrice/PayBox.js +0 -220
- package/Payment/EstimatePrice/index.js +0 -92
- package/Payment/EstimatePrice/util.js +0 -21
- package/Payment/MobilpayForm.js +0 -86
- package/Payment/Modal/BankTransfer.js +0 -233
- package/Payment/Modal/CompanyValability.js +0 -28
- package/Payment/Modal/DoneForm.js +0 -222
- package/Payment/Modal/PaymentDone.js +0 -53
- package/Payment/Modal/index.js +0 -27
- package/Payment/actions.js +0 -23
- package/Payment/index.js +0 -141
- package/Payment/request.js +0 -49
- package/Payment/types.js +0 -1
- package/Payment/util.js +0 -50
- package/Payment/validate.js +0 -23
- package/Sidebar.js +0 -156
- package/Things.js +0 -53
- package/actions.js +0 -73
- package/config.js +0 -10
- package/dev/ErrorBoundary.js +0 -109
- package/dev/TheError.js +0 -113
- package/dev/index.js +0 -132
- package/dev/types.js +0 -1
- package/prod/SentryErrorBoundary.js +0 -150
- package/reducer/captchas.js +0 -51
- package/reducer/counties.js +0 -57
- package/reducer/index.js +0 -38
- package/reducer/module.js +0 -48
- package/style/index.css +0 -1
- package/style/sidebar.css +0 -1
- package/types.js +0 -1
- package/utility/calendar.js +0 -45
- package/utility/date.js +0 -111
- package/utility/index.js +0 -125
- package/utility/language.js +0 -20
- package/utility/mql.js +0 -6
- package/utility/normalize-test.js +0 -54
- package/utility/normalize.js +0 -108
- package/utility/numbers.js +0 -93
- package/utility/numeric.js +0 -103
- package/utility/others.js +0 -142
- package/utility/strings-test.js +0 -216
- package/utility/strings.js +0 -85
- package/utility/validation/common.js +0 -278
- package/utility/validation/index.js +0 -110
- package/utility/validation/specific.js +0 -14
- package/utility/validation/validate/bank-test.js +0 -41
- package/utility/validation/validate/bank.js +0 -176
- package/utility/validation/validate/cif-test.js +0 -37
- package/utility/validation/validate/cif.js +0 -44
- package/utility/validation/validate/cnp-test.js +0 -68
- package/utility/validation/validate/cnp.js +0 -193
- package/utility/validation/validate/email-test.js +0 -30
- package/utility/validation/validate/email.js +0 -11
- package/utility/validation/validate/index.js +0 -65
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
|
|
2
|
+
.dark-theme {
|
|
3
|
+
.sidebar-wrapper {
|
|
4
|
+
background: #31353d;
|
|
5
|
+
|
|
6
|
+
.sidebar-brand {
|
|
7
|
+
i {
|
|
8
|
+
color: #b8bfce;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.sidebar-footer {
|
|
13
|
+
background: #3a3f48;
|
|
14
|
+
box-shadow: 0 -1px 5px #282c33;
|
|
15
|
+
border-top: 1px solid #464a52;
|
|
16
|
+
|
|
17
|
+
a {
|
|
18
|
+
color: #818896;
|
|
19
|
+
|
|
20
|
+
i {
|
|
21
|
+
color: #b8bfce;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.sidebar-menu {
|
|
27
|
+
ul li {
|
|
28
|
+
a {
|
|
29
|
+
color: #818896;
|
|
30
|
+
|
|
31
|
+
i {
|
|
32
|
+
background: #3a3f48;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&:hover > a {
|
|
37
|
+
color: #b8bfce;
|
|
38
|
+
|
|
39
|
+
i {
|
|
40
|
+
color: #16c7ff;
|
|
41
|
+
text-shadow: 0 0 10px rgba(22, 199, 255, 0.5);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
border-top: 1px solid #3a3f48;
|
|
47
|
+
|
|
48
|
+
.one-page a.active i,
|
|
49
|
+
.sidebar-dropdown.active a i {
|
|
50
|
+
color: #16c7ff;
|
|
51
|
+
text-shadow: 0 0 10px rgba(22, 199, 255, 0.5);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.sidebar-dropdown div {
|
|
55
|
+
background: #3a3f48;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.header-menu span {
|
|
59
|
+
color: #6c7b88;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.sidebar-dropdown.active > a {
|
|
63
|
+
color: #b8bfce;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.sidebar-dropdown .sidebar-submenu li a:hover::before {
|
|
68
|
+
color: #16c7ff;
|
|
69
|
+
text-shadow: 0 0 10px rgba(22, 199, 255, 0.5);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.one-page a.active,
|
|
73
|
+
.sidebar-dropdown .sidebar-submenu li a.active {
|
|
74
|
+
color: #bdbdbd;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
::-webkit-scrollbar {
|
|
2
|
+
width: 5px;
|
|
3
|
+
height: 7px;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
::-webkit-scrollbar-corner {
|
|
7
|
+
background: transparent;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
::-webkit-scrollbar-button {
|
|
11
|
+
width: 0;
|
|
12
|
+
height: 0;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
::-webkit-scrollbar-thumb {
|
|
16
|
+
background: #c7c7c7;
|
|
17
|
+
border: 0 none #fff;
|
|
18
|
+
border-radius: 10px;
|
|
19
|
+
|
|
20
|
+
&:hover,
|
|
21
|
+
&:active {
|
|
22
|
+
background: #525965;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// stylelint-disable-next-line
|
|
27
|
+
::-webkit-scrollbar-track {
|
|
28
|
+
background: transparent;
|
|
29
|
+
border: 0 none #fff;
|
|
30
|
+
border-radius: 50px;
|
|
31
|
+
border-radius: 10px;
|
|
32
|
+
|
|
33
|
+
&:hover,
|
|
34
|
+
&:active {
|
|
35
|
+
background: transparent;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
%animated {
|
|
2
|
+
-webkit-transition: all 0.3s ease;
|
|
3
|
+
-moz-transition: all 0.3s ease;
|
|
4
|
+
-ms-transition: all 0.3s ease;
|
|
5
|
+
-o-transition: all 0.3s ease;
|
|
6
|
+
transition: all 0.3s ease;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
@keyframes swing {
|
|
10
|
+
0% {
|
|
11
|
+
transform: rotate(0deg);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
10% {
|
|
15
|
+
transform: rotate(10deg);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
30% {
|
|
19
|
+
transform: rotate(0deg);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
40% {
|
|
23
|
+
transform: rotate(-10deg);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
50% {
|
|
27
|
+
transform: rotate(0deg);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
60% {
|
|
31
|
+
transform: rotate(5deg);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
70% {
|
|
35
|
+
transform: rotate(0deg);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
80% {
|
|
39
|
+
transform: rotate(-5deg);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
100% {
|
|
43
|
+
transform: rotate(0deg);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@keyframes sonar {
|
|
48
|
+
0% {
|
|
49
|
+
transform: scale(0.9);
|
|
50
|
+
opacity: 1;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
100% {
|
|
54
|
+
transform: scale(2);
|
|
55
|
+
opacity: 0;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.page-wrapper {
|
|
60
|
+
height: 100vh;
|
|
61
|
+
|
|
62
|
+
.theme {
|
|
63
|
+
width: 40px;
|
|
64
|
+
height: 40px;
|
|
65
|
+
display: inline-block;
|
|
66
|
+
border-radius: 4px;
|
|
67
|
+
margin: 2px;
|
|
68
|
+
|
|
69
|
+
&.dark-theme {
|
|
70
|
+
background: #1e2229;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.sidebar-wrapper {
|
|
75
|
+
width: 240px;
|
|
76
|
+
height: 100%;
|
|
77
|
+
max-height: 100%;
|
|
78
|
+
position: fixed;
|
|
79
|
+
top: 0;
|
|
80
|
+
z-index: 999;
|
|
81
|
+
|
|
82
|
+
.sidebar-footer {
|
|
83
|
+
position: absolute;
|
|
84
|
+
width: 100%;
|
|
85
|
+
bottom: 0;
|
|
86
|
+
display: flex;
|
|
87
|
+
|
|
88
|
+
> a {
|
|
89
|
+
flex-grow: 1;
|
|
90
|
+
text-align: center;
|
|
91
|
+
height: 30px;
|
|
92
|
+
line-height: 30px;
|
|
93
|
+
position: relative;
|
|
94
|
+
|
|
95
|
+
.notification {
|
|
96
|
+
position: absolute;
|
|
97
|
+
top: 0;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.sidebar-content {
|
|
103
|
+
max-height: calc(100% - 30px);
|
|
104
|
+
height: calc(100% - 30px);
|
|
105
|
+
overflow-y: auto;
|
|
106
|
+
position: relative;
|
|
107
|
+
|
|
108
|
+
.sidebar-brand {
|
|
109
|
+
padding: 10px 20px;
|
|
110
|
+
display: flex;
|
|
111
|
+
align-items: center;
|
|
112
|
+
|
|
113
|
+
.sidework {
|
|
114
|
+
text-transform: uppercase;
|
|
115
|
+
font-weight: bold;
|
|
116
|
+
flex-grow: 1;
|
|
117
|
+
|
|
118
|
+
@extend %animated;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
#close-sidebar {
|
|
122
|
+
cursor: pointer;
|
|
123
|
+
font-size: 20px;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
ul {
|
|
128
|
+
list-style-type: none;
|
|
129
|
+
padding: 0;
|
|
130
|
+
margin: 0;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
a {
|
|
134
|
+
text-decoration: none;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.sidebar-menu {
|
|
138
|
+
padding-bottom: 10px;
|
|
139
|
+
|
|
140
|
+
ul li a {
|
|
141
|
+
font-size: 15px;
|
|
142
|
+
font-weight: 500;
|
|
143
|
+
-webkit-transition: all 0.3s ease;
|
|
144
|
+
-moz-transition: all 0.3s ease;
|
|
145
|
+
-ms-transition: all 0.3s ease;
|
|
146
|
+
-o-transition: all 0.3s ease;
|
|
147
|
+
transition: all 0.3s ease;
|
|
148
|
+
display: inline-block;
|
|
149
|
+
width: 100%;
|
|
150
|
+
text-decoration: none;
|
|
151
|
+
position: relative;
|
|
152
|
+
padding: 8px 30px 8px 20px;
|
|
153
|
+
|
|
154
|
+
span {
|
|
155
|
+
&.label,
|
|
156
|
+
&.badge {
|
|
157
|
+
float: right;
|
|
158
|
+
margin-top: 8px;
|
|
159
|
+
margin-left: 5px;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
i {
|
|
164
|
+
@extend %animated;
|
|
165
|
+
|
|
166
|
+
margin-right: 10px;
|
|
167
|
+
font-size: 12px;
|
|
168
|
+
width: 30px;
|
|
169
|
+
height: 30px;
|
|
170
|
+
line-height: 30px;
|
|
171
|
+
text-align: center;
|
|
172
|
+
border-radius: 4px;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
&:hover > i::before {
|
|
176
|
+
display: inline-block;
|
|
177
|
+
animation: swing ease-in-out 0.5s 1 alternate;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.badge-sonar {
|
|
181
|
+
display: inline-block;
|
|
182
|
+
background: #980303;
|
|
183
|
+
border-radius: 50%;
|
|
184
|
+
height: 8px;
|
|
185
|
+
width: 8px;
|
|
186
|
+
position: absolute;
|
|
187
|
+
top: 0;
|
|
188
|
+
|
|
189
|
+
&::after {
|
|
190
|
+
content: "";
|
|
191
|
+
position: absolute;
|
|
192
|
+
top: 0;
|
|
193
|
+
left: 0;
|
|
194
|
+
border: 2px solid #980303;
|
|
195
|
+
opacity: 0;
|
|
196
|
+
border-radius: 50%;
|
|
197
|
+
width: 100%;
|
|
198
|
+
height: 100%;
|
|
199
|
+
animation: sonar 1.5s infinite;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.header-menu span {
|
|
205
|
+
font-weight: bold;
|
|
206
|
+
font-size: 14px;
|
|
207
|
+
padding: 15px 20px 5px 20px;
|
|
208
|
+
display: inline-block;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.sidebar-dropdown {
|
|
212
|
+
font-weight: 500;
|
|
213
|
+
font-size: 15px;
|
|
214
|
+
|
|
215
|
+
> a::after {
|
|
216
|
+
@extend %animated;
|
|
217
|
+
|
|
218
|
+
font-family: "FontAwesome", sans-serif;
|
|
219
|
+
font-weight: 900;
|
|
220
|
+
content: "\f105";
|
|
221
|
+
font-style: normal;
|
|
222
|
+
display: inline-block;
|
|
223
|
+
font-variant: normal;
|
|
224
|
+
text-rendering: auto;
|
|
225
|
+
-webkit-font-smoothing: antialiased;
|
|
226
|
+
-moz-osx-font-smoothing: grayscale;
|
|
227
|
+
text-align: center;
|
|
228
|
+
background: 0 0;
|
|
229
|
+
position: absolute;
|
|
230
|
+
right: 15px;
|
|
231
|
+
top: 14px;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.sidebar-submenu {
|
|
235
|
+
display: none;
|
|
236
|
+
|
|
237
|
+
li a {
|
|
238
|
+
.badge,
|
|
239
|
+
.label {
|
|
240
|
+
float: right;
|
|
241
|
+
margin-top: 0;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
ul {
|
|
246
|
+
padding: 5px 0;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
li {
|
|
250
|
+
padding-left: 25px;
|
|
251
|
+
font-size: 12px;
|
|
252
|
+
|
|
253
|
+
a::before {
|
|
254
|
+
@extend %animated;
|
|
255
|
+
|
|
256
|
+
content: "\f1db";
|
|
257
|
+
font-family: "FontAwesome", sans-serif;
|
|
258
|
+
font-weight: 400;
|
|
259
|
+
font-style: normal;
|
|
260
|
+
display: inline-block;
|
|
261
|
+
text-align: center;
|
|
262
|
+
text-decoration: none;
|
|
263
|
+
-webkit-font-smoothing: antialiased;
|
|
264
|
+
-moz-osx-font-smoothing: grayscale;
|
|
265
|
+
margin-right: 10px;
|
|
266
|
+
font-size: 10px;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
a.active::before {
|
|
270
|
+
content: "\f111";
|
|
271
|
+
font-family: "FontAwesome", sans-serif;
|
|
272
|
+
font-weight: 400;
|
|
273
|
+
font-style: normal;
|
|
274
|
+
display: inline-block;
|
|
275
|
+
text-align: center;
|
|
276
|
+
text-decoration: none;
|
|
277
|
+
-webkit-font-smoothing: antialiased;
|
|
278
|
+
-moz-osx-font-smoothing: grayscale;
|
|
279
|
+
margin-right: 10px;
|
|
280
|
+
font-size: 10px;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
&.active > a::after {
|
|
286
|
+
transform: rotate(90deg);
|
|
287
|
+
right: 17px;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
-webkit-transition: all 0.3s ease;
|
|
293
|
+
-moz-transition: all 0.3s ease;
|
|
294
|
+
-ms-transition: all 0.3s ease;
|
|
295
|
+
-o-transition: all 0.3s ease;
|
|
296
|
+
transition: all 0.3s ease;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
package/src/types.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// @flow
|
|
2
|
+
/* eslint-disable no-use-before-define */
|
|
3
|
+
|
|
4
|
+
import type { List as ListType, Map as MapType } from "immutable";
|
|
5
|
+
|
|
6
|
+
export type State = any;
|
|
7
|
+
|
|
8
|
+
export type Action = any;
|
|
9
|
+
|
|
10
|
+
export type ErrorType = string;
|
|
11
|
+
export type ThunkAction = (dispatch: Dispatch, getState: GetState) => any;
|
|
12
|
+
export type Dispatch = (action: any | ThunkAction | PromiseAction) => any;
|
|
13
|
+
export type GetState = () => State;
|
|
14
|
+
export type PromiseAction = Promise<any>;
|
|
15
|
+
|
|
16
|
+
export type ModalActionType = string;
|
|
17
|
+
|
|
18
|
+
export type NullUInt = {
|
|
19
|
+
Valid: bool;
|
|
20
|
+
UInt: number;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export type ModalPayload = {
|
|
24
|
+
modalType: ModalActionType;
|
|
25
|
+
modalProps: any;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export type NormalizedResult = {
|
|
29
|
+
entities : MapType<string, any>;
|
|
30
|
+
result : ListType<string>;
|
|
31
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// @flow
|
|
2
|
+
|
|
3
|
+
import moment from "moment";
|
|
4
|
+
import { toTitle } from "./strings";
|
|
5
|
+
|
|
6
|
+
const
|
|
7
|
+
now = new Date(),
|
|
8
|
+
currentMonth = now.getMonth(),
|
|
9
|
+
currentYear = now.getFullYear();
|
|
10
|
+
|
|
11
|
+
export const calendar = {
|
|
12
|
+
month : currentMonth,
|
|
13
|
+
year : currentYear,
|
|
14
|
+
|
|
15
|
+
currentMonth: {
|
|
16
|
+
firstDay: new Date(Date.UTC(currentYear,
|
|
17
|
+
currentMonth,
|
|
18
|
+
1)).toISOString(),
|
|
19
|
+
lastDay: new Date(Date.UTC(currentYear,
|
|
20
|
+
currentMonth + 1,
|
|
21
|
+
0)).toISOString(),
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const newDate = (year : any, month: any, day? : any = 1) => (
|
|
26
|
+
new Date(Date.UTC(Number(year),
|
|
27
|
+
Number(month),
|
|
28
|
+
day))
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
export const monthYearToDate = (data : { Year : string, Month : string }) => ({
|
|
32
|
+
...data,
|
|
33
|
+
Date: newDate(data.Year,
|
|
34
|
+
data.Month),
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
export const getMonthName = (data : Date) => (
|
|
38
|
+
toTitle(moment.months(data.getMonth()))
|
|
39
|
+
);
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
// @flow
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
type MonthAndYear = { year: string, month: string };
|
|
5
|
+
|
|
6
|
+
import { isValidDate } from "./validation/validate";
|
|
7
|
+
|
|
8
|
+
const ten = 10;
|
|
9
|
+
|
|
10
|
+
export const getPreviousMonth = (year : string, month: string) => {
|
|
11
|
+
if (month === "0") {
|
|
12
|
+
return {
|
|
13
|
+
previousMonth : "11",
|
|
14
|
+
previousYear : String(Number(year) - 1),
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return {
|
|
19
|
+
previousMonth : String(Number(month) - 1),
|
|
20
|
+
previousYear : String(year),
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const getLastMonthAndYear = () : MonthAndYear => {
|
|
25
|
+
const
|
|
26
|
+
currentDate = new Date(),
|
|
27
|
+
currentYear = String(currentDate.getFullYear()),
|
|
28
|
+
currentMonth = String(currentDate.getMonth()),
|
|
29
|
+
{ previousMonth, previousYear } = getPreviousMonth(currentYear, currentMonth);
|
|
30
|
+
|
|
31
|
+
return {
|
|
32
|
+
month: previousMonth,
|
|
33
|
+
year: previousYear,
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
// new Date("2016-08-25T00:00:00Z") ---> 25.08.2016
|
|
38
|
+
export const formatDateObject = (date : Date) : string => {
|
|
39
|
+
|
|
40
|
+
const dd = date.getDate(),
|
|
41
|
+
mm = date.getMonth() + 1,
|
|
42
|
+
yyyy = date.getFullYear(),
|
|
43
|
+
addZero = (value) => {
|
|
44
|
+
if (value < ten) {
|
|
45
|
+
return `0${value}`;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return value;
|
|
49
|
+
},
|
|
50
|
+
newDD = addZero(dd),
|
|
51
|
+
newMM = addZero(mm);
|
|
52
|
+
|
|
53
|
+
return `${newDD}.${newMM}.${yyyy}`;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
// "2016-08-25T00:00:00Z" ---> 25.08.2016
|
|
57
|
+
export const formatDate = (normalizedValue : string) : string => {
|
|
58
|
+
|
|
59
|
+
const parts = normalizedValue.split("T");
|
|
60
|
+
|
|
61
|
+
if (parts.length !== 2) {
|
|
62
|
+
return normalizedValue;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const dateParts = parts[0].split("-"),
|
|
66
|
+
nrOfParts = 3;
|
|
67
|
+
|
|
68
|
+
if (dateParts.length !== nrOfParts) {
|
|
69
|
+
return normalizedValue;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const [yyyy, mm, dd] = dateParts;
|
|
73
|
+
|
|
74
|
+
if (!isValidDate(`${dd}.${mm}.${yyyy}`)) {
|
|
75
|
+
return normalizedValue;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const date = new Date(Number(yyyy), Number(mm) - 1, Number(dd), 0, 0, 0, 0);
|
|
79
|
+
|
|
80
|
+
return formatDateObject(date);
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
// 25.08.2016 ---> 2016-08-25T00:00:00Z
|
|
84
|
+
export const normalizeDate = (currentValue : string) : string => {
|
|
85
|
+
|
|
86
|
+
const normalizeCurrent = () : string => {
|
|
87
|
+
const parts = currentValue.split("."),
|
|
88
|
+
dd = parts[0],
|
|
89
|
+
mm = parts[1],
|
|
90
|
+
yyyy = parts[2];
|
|
91
|
+
|
|
92
|
+
return `${yyyy}-${mm}-${dd}T00:00:00Z`;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
if (isValidDate(currentValue)) {
|
|
96
|
+
return normalizeCurrent();
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return currentValue;
|
|
100
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// @flow
|
|
2
|
+
|
|
3
|
+
export * from "./calendar";
|
|
4
|
+
export * from "./date";
|
|
5
|
+
export * from "./language";
|
|
6
|
+
export * from "./normalize";
|
|
7
|
+
export * from "./numbers";
|
|
8
|
+
export * from "./numeric";
|
|
9
|
+
export * from "./others";
|
|
10
|
+
export * from "./strings";
|
|
11
|
+
export * from "./mql";
|
|
12
|
+
export * from "./validation";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// @flow
|
|
2
|
+
|
|
3
|
+
export const language = {
|
|
4
|
+
message: {
|
|
5
|
+
failPerform : "Nu am putut îndeplini sarcina",
|
|
6
|
+
confirmDelete : "Am șters cu succes",
|
|
7
|
+
confirmAdd : "Am adăugat cu succes",
|
|
8
|
+
confirmUpdate : "Am actualizat datele",
|
|
9
|
+
},
|
|
10
|
+
label: {
|
|
11
|
+
modify : "Modifică",
|
|
12
|
+
add : "Adaugă",
|
|
13
|
+
remove : "Șterge",
|
|
14
|
+
confirmation : "Confirmare",
|
|
15
|
+
cancel : "Renunță",
|
|
16
|
+
},
|
|
17
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
|
|
2
|
+
import { normalizeArray } from "./normalize";
|
|
3
|
+
|
|
4
|
+
import * as Immutable from "immutable";
|
|
5
|
+
import * as matchers from "jest-immutable-matchers";
|
|
6
|
+
|
|
7
|
+
describe("test util/normalize",
|
|
8
|
+
() => {
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
jest.addMatchers(matchers);
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
const input = [
|
|
14
|
+
{
|
|
15
|
+
ID : 1,
|
|
16
|
+
Name : "BlaBla 1",
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
ID : 2,
|
|
20
|
+
Name : "BlaBla 2",
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
ID : 3,
|
|
24
|
+
Name : "BlaBla 3",
|
|
25
|
+
},
|
|
26
|
+
];
|
|
27
|
+
|
|
28
|
+
describe("given an array",
|
|
29
|
+
() => {
|
|
30
|
+
const result = normalizeArray(input);
|
|
31
|
+
|
|
32
|
+
it("normalizes the entities",
|
|
33
|
+
() => {
|
|
34
|
+
expect(result.entities).toEqualImmutable(Immutable.Map({
|
|
35
|
+
"1": Immutable.Map({
|
|
36
|
+
ID : 1,
|
|
37
|
+
Name : "BlaBla 1",
|
|
38
|
+
}),
|
|
39
|
+
"2": Immutable.Map({
|
|
40
|
+
ID : 2,
|
|
41
|
+
Name : "BlaBla 2",
|
|
42
|
+
}),
|
|
43
|
+
"3": Immutable.Map({
|
|
44
|
+
ID : 3,
|
|
45
|
+
Name : "BlaBla 3",
|
|
46
|
+
}),
|
|
47
|
+
}));
|
|
48
|
+
});
|
|
49
|
+
it("normalizes the result",
|
|
50
|
+
() => {
|
|
51
|
+
expect(result.result).toEqualImmutable(Immutable.List([
|
|
52
|
+
"1",
|
|
53
|
+
"2",
|
|
54
|
+
"3",
|
|
55
|
+
]));
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
});
|