x25 3.0.0 → 17.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.
Files changed (274) hide show
  1. package/Account/Load.js +75 -0
  2. package/Account/actions.js +15 -0
  3. package/Account/index.js +20 -0
  4. package/Account/reducer.js +122 -0
  5. package/Account/request.js +44 -0
  6. package/Async/InitModule.js +190 -0
  7. package/Async/RouteLoading.js +64 -0
  8. package/Async/SimulatedException.js +44 -0
  9. package/Async/index.js +95 -0
  10. package/Async/types.js +1 -0
  11. package/Company/Load.js +82 -0
  12. package/Company/actions.js +15 -0
  13. package/Company/index.js +20 -0
  14. package/Company/reducer.js +165 -0
  15. package/Company/request.js +36 -0
  16. package/Company/util.js +10 -0
  17. package/Header/AccountOptionsContainer.js +144 -0
  18. package/Header/AdminSelectCompany.js +109 -0
  19. package/Header/ClientSelectCompany.js +104 -0
  20. package/Header/Header.js +127 -0
  21. package/Header/HeaderContainer.js +39 -0
  22. package/Header/Logo.js +30 -0
  23. package/Header/LogoutButton.js +39 -0
  24. package/Header/index.js +19 -0
  25. package/Header/request.js +26 -0
  26. package/Header/types.js +1 -0
  27. package/Header/util.js +58 -0
  28. package/Inputs/Business/BankAccount.js +48 -0
  29. package/Inputs/Business/BankName.js +49 -0
  30. package/Inputs/Business/CifField.js +112 -0
  31. package/Inputs/Business/CifFieldContainer.js +157 -0
  32. package/Inputs/Business/Email.js +37 -0
  33. package/Inputs/Business/NidField.js +91 -0
  34. package/Inputs/Business/Phone.js +37 -0
  35. package/Inputs/Business/index.js +34 -0
  36. package/Inputs/Business/request.js +39 -0
  37. package/Inputs/CaptchaBox.js +151 -0
  38. package/Inputs/DateInput.js +172 -0
  39. package/Inputs/DateTemplate.js +200 -0
  40. package/Inputs/DelayInputChange.js +135 -0
  41. package/Inputs/FocusTemplate.js +47 -0
  42. package/Inputs/InputTemplate.js +78 -0
  43. package/Inputs/LabelTemplate.js +59 -0
  44. package/Inputs/NumericInput.js +139 -0
  45. package/Inputs/NumericTemplate.js +148 -0
  46. package/Inputs/Selects/County.js +29 -0
  47. package/Inputs/Selects/Custom.js +56 -0
  48. package/Inputs/Selects/Simple.js +75 -0
  49. package/Inputs/Selects/index.js +52 -0
  50. package/Inputs/SimpleInput.js +42 -0
  51. package/Inputs/SimpleTextarea.js +47 -0
  52. package/Inputs/TextareaTemplate.js +55 -0
  53. package/Inputs/Tooltip.js +82 -0
  54. package/Inputs/index.js +185 -0
  55. package/Messages/Error.js +106 -0
  56. package/Messages/Loading.js +68 -0
  57. package/Messages/index.js +29 -0
  58. package/Modal/Delete.js +240 -0
  59. package/Modal/Root.js +81 -0
  60. package/Modal/SimpleModal.js +57 -0
  61. package/Modal/actions.js +10 -0
  62. package/Modal/getComponent.js +42 -0
  63. package/Modal/index.js +22 -0
  64. package/Modal/reducer.js +53 -0
  65. package/Modal/types.js +7 -0
  66. package/Modal/util.js +17 -0
  67. package/Payment/EstimatePrice/Description.js +92 -0
  68. package/Payment/EstimatePrice/PayBox.js +220 -0
  69. package/Payment/EstimatePrice/index.js +92 -0
  70. package/Payment/EstimatePrice/util.js +21 -0
  71. package/Payment/MobilpayForm.js +86 -0
  72. package/Payment/Modal/BankTransfer.js +233 -0
  73. package/Payment/Modal/CompanyValability.js +28 -0
  74. package/Payment/Modal/DoneForm.js +222 -0
  75. package/Payment/Modal/PaymentDone.js +53 -0
  76. package/Payment/Modal/index.js +27 -0
  77. package/Payment/actions.js +23 -0
  78. package/{src/Payment → Payment}/codes.js +19 -16
  79. package/Payment/index.js +141 -0
  80. package/Payment/request.js +49 -0
  81. package/Payment/types.js +1 -0
  82. package/Payment/util.js +50 -0
  83. package/Payment/validate.js +23 -0
  84. package/Sidebar.js +156 -0
  85. package/Things.js +53 -0
  86. package/actions.js +73 -0
  87. package/config.js +10 -0
  88. package/dev/ErrorBoundary.js +109 -0
  89. package/dev/TheError.js +113 -0
  90. package/dev/index.js +132 -0
  91. package/dev/types.js +1 -0
  92. package/package.json +13 -13
  93. package/prod/SentryErrorBoundary.js +150 -0
  94. package/reducer/captchas.js +51 -0
  95. package/reducer/counties.js +57 -0
  96. package/reducer/index.js +38 -0
  97. package/reducer/module.js +48 -0
  98. package/style/index.css +1 -0
  99. package/style/sidebar.css +1 -0
  100. package/types.js +1 -0
  101. package/utility/calendar.js +45 -0
  102. package/utility/date.js +111 -0
  103. package/utility/index.js +125 -0
  104. package/utility/language.js +20 -0
  105. package/utility/mql.js +6 -0
  106. package/utility/normalize-test.js +54 -0
  107. package/utility/normalize.js +108 -0
  108. package/utility/numbers.js +93 -0
  109. package/utility/numeric.js +103 -0
  110. package/utility/others.js +142 -0
  111. package/utility/strings-test.js +216 -0
  112. package/utility/strings.js +85 -0
  113. package/utility/validation/common.js +278 -0
  114. package/utility/validation/index.js +110 -0
  115. package/utility/validation/specific.js +14 -0
  116. package/utility/validation/validate/bank-test.js +41 -0
  117. package/utility/validation/validate/bank.js +176 -0
  118. package/utility/validation/validate/cif-test.js +37 -0
  119. package/utility/validation/validate/cif.js +44 -0
  120. package/utility/validation/validate/cnp-test.js +68 -0
  121. package/utility/validation/validate/cnp.js +193 -0
  122. package/{src/utility → utility}/validation/validate/date.js +61 -73
  123. package/utility/validation/validate/email-test.js +30 -0
  124. package/utility/validation/validate/email.js +11 -0
  125. package/utility/validation/validate/index.js +65 -0
  126. package/.eslintignore +0 -2
  127. package/.eslintrc.json +0 -275
  128. package/.flowconfig +0 -23
  129. package/conf/dev.js +0 -19
  130. package/conf/dist.js +0 -19
  131. package/conf/polyfills/tempPolyfills.js +0 -7
  132. package/src/Account/Load.jsx +0 -79
  133. package/src/Account/actions.js +0 -10
  134. package/src/Account/index.js +0 -11
  135. package/src/Account/reducer.js +0 -139
  136. package/src/Account/request.js +0 -36
  137. package/src/Async/InitModule.jsx +0 -114
  138. package/src/Async/RouteLoading.jsx +0 -52
  139. package/src/Async/SimulatedException.jsx +0 -19
  140. package/src/Async/index.jsx +0 -75
  141. package/src/Async/types.js +0 -39
  142. package/src/Company/Load.jsx +0 -84
  143. package/src/Company/actions.js +0 -10
  144. package/src/Company/index.js +0 -11
  145. package/src/Company/reducer.js +0 -201
  146. package/src/Company/request.js +0 -30
  147. package/src/Company/util.js +0 -7
  148. package/src/Header/AccountOptionsContainer.jsx +0 -124
  149. package/src/Header/AdminSelectCompany.jsx +0 -101
  150. package/src/Header/ClientSelectCompany.jsx +0 -90
  151. package/src/Header/Header.jsx +0 -120
  152. package/src/Header/HeaderContainer.jsx +0 -30
  153. package/src/Header/Logo.jsx +0 -16
  154. package/src/Header/LogoutButton.jsx +0 -34
  155. package/src/Header/index.jsx +0 -9
  156. package/src/Header/request.js +0 -28
  157. package/src/Header/types.js +0 -6
  158. package/src/Header/util.jsx +0 -61
  159. package/src/Inputs/Business/BankAccount.jsx +0 -39
  160. package/src/Inputs/Business/BankName.jsx +0 -40
  161. package/src/Inputs/Business/CifField.jsx +0 -93
  162. package/src/Inputs/Business/CifFieldContainer.jsx +0 -142
  163. package/src/Inputs/Business/Email.jsx +0 -23
  164. package/src/Inputs/Business/NidField.jsx +0 -77
  165. package/src/Inputs/Business/Phone.jsx +0 -23
  166. package/src/Inputs/Business/index.js +0 -16
  167. package/src/Inputs/Business/request.js +0 -39
  168. package/src/Inputs/CaptchaBox.jsx +0 -131
  169. package/src/Inputs/DateInput.jsx +0 -188
  170. package/src/Inputs/DateTemplate.jsx +0 -213
  171. package/src/Inputs/DelayInputChange.jsx +0 -130
  172. package/src/Inputs/FocusTemplate.jsx +0 -41
  173. package/src/Inputs/InputTemplate.jsx +0 -79
  174. package/src/Inputs/LabelTemplate.jsx +0 -47
  175. package/src/Inputs/NumericInput.jsx +0 -142
  176. package/src/Inputs/NumericTemplate.jsx +0 -155
  177. package/src/Inputs/Selects/County.jsx +0 -19
  178. package/src/Inputs/Selects/Custom.jsx +0 -55
  179. package/src/Inputs/Selects/Simple.jsx +0 -73
  180. package/src/Inputs/Selects/index.jsx +0 -37
  181. package/src/Inputs/SimpleInput.jsx +0 -40
  182. package/src/Inputs/SimpleTextarea.jsx +0 -55
  183. package/src/Inputs/TextareaTemplate.jsx +0 -57
  184. package/src/Inputs/Tooltip.jsx +0 -61
  185. package/src/Inputs/index.js +0 -22
  186. package/src/Messages/Error.jsx +0 -83
  187. package/src/Messages/Loading.jsx +0 -43
  188. package/src/Messages/index.jsx +0 -4
  189. package/src/Modal/Delete.jsx +0 -237
  190. package/src/Modal/Root.jsx +0 -57
  191. package/src/Modal/SimpleModal.jsx +0 -47
  192. package/src/Modal/actions.js +0 -7
  193. package/src/Modal/getComponent.jsx +0 -32
  194. package/src/Modal/index.jsx +0 -12
  195. package/src/Modal/reducer.js +0 -40
  196. package/src/Modal/types.js +0 -6
  197. package/src/Modal/util.js +0 -15
  198. package/src/Payment/EstimatePrice/Description.jsx +0 -101
  199. package/src/Payment/EstimatePrice/PayBox.jsx +0 -173
  200. package/src/Payment/EstimatePrice/index.jsx +0 -63
  201. package/src/Payment/EstimatePrice/util.js +0 -15
  202. package/src/Payment/MobilpayForm.jsx +0 -77
  203. package/src/Payment/Modal/BankTransfer.jsx +0 -129
  204. package/src/Payment/Modal/CompanyValability.jsx +0 -14
  205. package/src/Payment/Modal/DoneForm.jsx +0 -209
  206. package/src/Payment/Modal/PaymentDone.jsx +0 -27
  207. package/src/Payment/Modal/index.js +0 -13
  208. package/src/Payment/actions.jsx +0 -22
  209. package/src/Payment/index.jsx +0 -124
  210. package/src/Payment/request.js +0 -50
  211. package/src/Payment/types.js +0 -14
  212. package/src/Payment/util.jsx +0 -52
  213. package/src/Payment/validate.js +0 -25
  214. package/src/Sidebar.jsx +0 -158
  215. package/src/Things.jsx +0 -35
  216. package/src/actions.js +0 -36
  217. package/src/config.js +0 -7
  218. package/src/dev/ErrorBoundary.jsx +0 -98
  219. package/src/dev/TheError.jsx +0 -87
  220. package/src/dev/index.js +0 -127
  221. package/src/dev/types.js +0 -10
  222. package/src/prod/SentryErrorBoundary.jsx +0 -98
  223. package/src/reducer/captchas.js +0 -44
  224. package/src/reducer/counties.js +0 -46
  225. package/src/reducer/index.js +0 -25
  226. package/src/reducer/module.jsx +0 -43
  227. package/src/style/.sass-lint.yml +0 -84
  228. package/src/style/.stylelintrc.json +0 -161
  229. package/src/style/_fancy-text.scss +0 -37
  230. package/src/style/_fix_bootstrap_placeholder_color.scss +0 -14
  231. package/src/style/_header-company.scss +0 -69
  232. package/src/style/_inputs.scss +0 -12
  233. package/src/style/_minimal.scss +0 -31
  234. package/src/style/_navigation.scss +0 -24
  235. package/src/style/_others.scss +0 -79
  236. package/src/style/index.scss +0 -7
  237. package/src/style/sidebar/_animations.scss +0 -21
  238. package/src/style/sidebar/_dark-theme.scss +0 -77
  239. package/src/style/sidebar/_scroll.scss +0 -37
  240. package/src/style/sidebar/_structure.scss +0 -299
  241. package/src/style/sidebar.scss +0 -4
  242. package/src/types.js +0 -31
  243. package/src/utility/calendar.js +0 -39
  244. package/src/utility/date.js +0 -100
  245. package/src/utility/index.js +0 -12
  246. package/src/utility/language.js +0 -17
  247. package/src/utility/mql.js +0 -3
  248. package/src/utility/normalize-test.js +0 -58
  249. package/src/utility/normalize.js +0 -119
  250. package/src/utility/numbers.js +0 -87
  251. package/src/utility/numeric.js +0 -114
  252. package/src/utility/others.jsx +0 -160
  253. package/src/utility/strings-test.js +0 -136
  254. package/src/utility/strings.js +0 -80
  255. package/src/utility/validation/common.js +0 -360
  256. package/src/utility/validation/index.js +0 -70
  257. package/src/utility/validation/specific.js +0 -9
  258. package/src/utility/validation/validate/bank-test.js +0 -129
  259. package/src/utility/validation/validate/bank.js +0 -176
  260. package/src/utility/validation/validate/cif-test.js +0 -105
  261. package/src/utility/validation/validate/cif.js +0 -44
  262. package/src/utility/validation/validate/cnp-test.js +0 -216
  263. package/src/utility/validation/validate/cnp.js +0 -261
  264. package/src/utility/validation/validate/email-test.js +0 -36
  265. package/src/utility/validation/validate/email.js +0 -6
  266. package/src/utility/validation/validate/index.js +0 -7
  267. package/webpack.config.js +0 -90
  268. package/x25.wiki/Account.md +0 -41
  269. package/x25.wiki/Company.md +0 -39
  270. package/x25.wiki/Header.md +0 -21
  271. package/x25.wiki/Home.md +0 -1
  272. package/x25.wiki/Inputs.md +0 -33
  273. package/x25.wiki/Messages.md +0 -27
  274. package/x25.wiki/Payment.md +0 -42
@@ -1,261 +0,0 @@
1
- // @flow
2
- /* eslint-disable no-magic-numbers, max-statements */
3
-
4
- export const isValidCNP = (rawValue : string) : boolean => {
5
-
6
- type CNP = Array<number>;
7
-
8
- type PositionPropTypes = {
9
- [key: string]: number;
10
- };
11
-
12
- const decimalSystem = 10,
13
- position : PositionPropTypes = {
14
- yearMillenium : 0,
15
- sex : 0,
16
-
17
- yearDecades : 1,
18
- yearUnits : 2,
19
-
20
- monthDecimals : 3,
21
- monthUnits : 4,
22
-
23
- dayDecimals : 5,
24
- dayUnits : 6,
25
-
26
- countyDecimals : 7,
27
- countyUnits : 8,
28
-
29
- numberHundreds : 9,
30
- numberDecimals : 10,
31
- numberUnits : 11,
32
-
33
- controlDigit: 12,
34
- },
35
- getCNP = (raw : string) : CNP => {
36
-
37
- let hashResult = 0;
38
-
39
- const hashTable = [
40
- 2,
41
- 7,
42
- 9,
43
- 1,
44
- 4,
45
- 6,
46
- 3,
47
- 5,
48
- 8,
49
- 2,
50
- 7,
51
- 9,
52
- ],
53
- normalLength = 13,
54
- cnp = [];
55
-
56
- const reduceHash = (rawHash : number) : number => {
57
- const
58
- nrOfDigits = 11,
59
- reduced = parseInt(rawHash % nrOfDigits,
60
- decimalSystem);
61
-
62
- if (reduced === 10) {
63
- return 1;
64
- }
65
-
66
- return reduced;
67
- };
68
-
69
- if (raw.length !== normalLength) {
70
- throw new Error(`The length [actual:${raw.length}]
71
- should be ${normalLength} characters`);
72
- }
73
-
74
- if (raw[0] === "0") {
75
- throw new Error("The sex can not be 0");
76
- }
77
-
78
- const controlDigit = parseInt(
79
- raw.charAt(position.controlDigit),
80
- decimalSystem,
81
- );
82
-
83
- if (isNaN(controlDigit)) {
84
- throw new Error("The control digit should be number");
85
- }
86
-
87
- for (let index = 0; index < 12; index += 1) {
88
-
89
- const rawChar = raw.charAt(index),
90
- parsedValue = parseInt(rawChar,
91
- decimalSystem),
92
- correspondingHashNumber = hashTable[index];
93
-
94
- if (isNaN(parsedValue)) {
95
- throw new Error(`The char at position ${index} should be numeric`);
96
- }
97
-
98
- cnp[index] = parsedValue;
99
- hashResult += (parsedValue * correspondingHashNumber);
100
- }
101
-
102
- if (controlDigit !== reduceHash(hashResult)) {
103
- throw new Error(`
104
- The control digit is not good
105
- [${controlDigit} === ${reduceHash(hashResult)}]
106
- `);
107
- }
108
-
109
- return cnp;
110
- },
111
- validate = (cnp : CNP) => {
112
- const getCNPDigit = (currentPosition : number) : number => cnp[currentPosition],
113
- isValidDate = () => {
114
- const getYear = () : number => {
115
- const computeYear = () : number => {
116
- const {
117
- yearMillenium,
118
- yearDecades,
119
- yearUnits,
120
- } = position;
121
-
122
- let year = (
123
- (getCNPDigit(yearDecades) * 10) +
124
- getCNPDigit(yearUnits)
125
- );
126
-
127
- switch (getCNPDigit(yearMillenium)) {
128
- case 1:
129
- case 2:
130
- year += 1900;
131
- break;
132
- case 3:
133
- case 4:
134
- year += 1800;
135
- break;
136
- case 5:
137
- case 6:
138
- year += 2000;
139
- break;
140
-
141
- // 7,8,9
142
- default: {
143
- year += 2000;
144
-
145
- const today : any = new Date(),
146
- tempYear = parseInt(today.getYear(),
147
- 10) - 14;
148
-
149
- if (year > tempYear) {
150
- year -= 100;
151
- }
152
- }
153
- break;
154
- }
155
-
156
- return year;
157
- },
158
- year : number = computeYear();
159
-
160
- if (year < 1800 || year > 2099) {
161
- throw new Error(`
162
- Year [actual: ${String(year)}] is not valid.
163
- It should be between 1800 and 2099
164
- `);
165
- }
166
-
167
- return year;
168
- };
169
-
170
- const year : number = getYear();
171
-
172
- const {
173
- monthDecimals,
174
- monthUnits,
175
- dayDecimals,
176
- dayUnits,
177
- } = position,
178
- month = (
179
- (getCNPDigit(monthDecimals) * 10) +
180
- getCNPDigit(monthUnits)
181
- ),
182
- day = (
183
- (getCNPDigit(dayDecimals) * 10) +
184
- getCNPDigit(dayUnits)
185
- ),
186
- // js months are starting from 0 -> 11
187
- jsMonth = month - 1,
188
- date = new Date(year,
189
- jsMonth,
190
- day,
191
- 0,
192
- 0,
193
- 0,
194
- 0);
195
-
196
- if (
197
- (date.getFullYear() !== year) ||
198
- (date.getMonth() !== jsMonth) ||
199
- (date.getDate() !== day)
200
- ) {
201
- throw new Error(`
202
- The given date
203
- [
204
- year -> ${String(year)}
205
- month -> ${String(month)}
206
- day -> ${String(day)}
207
- ]`);
208
- }
209
- },
210
- isValidCounty = () => {
211
- const {
212
- countyDecimals,
213
- countyUnits,
214
- } = position,
215
- lowerLimit = 1,
216
- upperLimit = 52,
217
- code = (
218
- (getCNPDigit(countyDecimals) * 10) +
219
- getCNPDigit(countyUnits)
220
- );
221
-
222
- if (
223
- code < lowerLimit ||
224
- code > upperLimit
225
- ) {
226
- throw new Error(`
227
- The country code is invalid [actual: ${code}],
228
- should be between: ${lowerLimit} <= ${code} >= ${upperLimit}
229
- `);
230
- }
231
- },
232
- isValidNumber = () => {
233
- const {
234
- numberHundreds,
235
- numberDecimals,
236
- numberUnits,
237
- } = position,
238
- number = (
239
- (getCNPDigit(numberHundreds) * 100) +
240
- (getCNPDigit(numberDecimals) * 10) +
241
- getCNPDigit(numberUnits)
242
- );
243
-
244
- if (number === 0) {
245
- throw new Error("The number should not be 0");
246
- }
247
- };
248
-
249
- isValidDate();
250
- isValidCounty();
251
- isValidNumber();
252
- };
253
-
254
- try {
255
- validate(getCNP(rawValue));
256
-
257
- return true;
258
- } catch (error) {
259
- return false;
260
- }
261
- };
@@ -1,36 +0,0 @@
1
- import { isValidEmail } from "./email";
2
-
3
- const valid = true,
4
- notValid = false;
5
-
6
- describe("given an email without @ [email]",
7
- () => {
8
- it("should not be valid",
9
- () => {
10
- expect(isValidEmail("email")).toBe(notValid);
11
- });
12
- });
13
-
14
- describe("given an email without the user [email@]",
15
- () => {
16
- it("should not be valid",
17
- () => {
18
- expect(isValidEmail("email@")).toBe(notValid);
19
- });
20
- });
21
-
22
- describe("given an email without domain [email@email]",
23
- () => {
24
- it("should not be valid",
25
- () => {
26
- expect(isValidEmail("email@email")).toBe(notValid);
27
- });
28
- });
29
-
30
- describe("given a good email (email@email.ro)",
31
- () => {
32
- it("should be valid",
33
- () => {
34
- expect(isValidEmail("email@email.ro")).toBe(valid);
35
- });
36
- });
@@ -1,6 +0,0 @@
1
- // @flow
2
-
3
- export const isValidEmail = (value : string) : boolean => (
4
- /* eslint-disable-next-line */
5
- new RegExp(/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/igm).test(value)
6
- );
@@ -1,7 +0,0 @@
1
- // @flow
2
-
3
- export * from "./date";
4
- export * from "./email";
5
- export * from "./cif";
6
- export * from "./cnp";
7
- export * from "./bank";
package/webpack.config.js DELETED
@@ -1,90 +0,0 @@
1
- 'use strict'
2
-
3
- var webpack = require('webpack')
4
- var env = process.env.NODE_ENV
5
-
6
- var config = {
7
- module: {
8
- loaders: [
9
- {
10
- test : /\.jsx?$/u,
11
- use : ["babel-loader"],
12
- exclude: /node_modules/
13
- },
14
- {
15
- test : /\.scss$/u,
16
- use : [
17
- "style-loader",
18
- "css-loader",
19
- "sass-loader",
20
- ],
21
- },
22
- {
23
- test : /\.css$/u,
24
- use : [
25
- "style-loader",
26
- "css-loader",
27
- ],
28
- },
29
- {
30
- test : /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/u,
31
- use : "url-loader?limit=10000&minetype=application/font-woff",
32
- },
33
- {
34
- test : /\.jpe?g$|\.gif$|\.png$/u,
35
- use : "url-loader",
36
- },
37
- {
38
- test : /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/u,
39
- use : "file-loader",
40
- }
41
- ]
42
- },
43
- resolve: {
44
- extensions: [
45
- ".js",
46
- ".jsx",
47
- ],
48
- modules: [
49
- "client",
50
- "node_modules",
51
- ],
52
- },
53
- output: {
54
- library: 'ReactPaginator',
55
- libraryTarget: 'umd'
56
- },
57
- plugins: [
58
- new webpack.DefinePlugin({
59
- "process.env": {
60
- "NODE_ENV": JSON.stringify("development"),
61
- },
62
- }),
63
- new webpack.DefinePlugin({
64
- "process.env": {
65
- "BABEL_ENV": JSON.stringify("developmentTime"),
66
- },
67
- })
68
- ]
69
- }
70
-
71
- if (env === 'production') {
72
- config.plugins.push(
73
- new webpack.DefinePlugin({
74
- "process.env": {
75
- "NODE_ENV": JSON.stringify("production"),
76
- },
77
- }),
78
- new webpack.DefinePlugin({
79
- "process.env": {
80
- "BABEL_ENV": JSON.stringify("production"),
81
- },
82
- }),
83
- new webpack.ContextReplacementPlugin(/moment[\/\\]locale$/, /ro/),
84
- new webpack.optimize.UglifyJsPlugin({
85
- mangle: false,
86
- }),
87
- )
88
- }
89
-
90
- module.exports = config
@@ -1,41 +0,0 @@
1
- Contains all information about the current account.
2
-
3
- The module `x25/Account` has:
4
- - `<LoadAccount appName="auto" />`
5
- - `accountSelectors`
6
- - `accountReducer`
7
-
8
- # LoadAccount
9
-
10
- It loads the account. The `appName` is the application for which is done the init-session
11
-
12
- Example:
13
- ```jsx
14
-
15
- import { LoadAccount } from "x25/Account";
16
-
17
- <LoadAccount appName="auto">
18
- <div />
19
- </LoadAccount>
20
- ```
21
-
22
- It does not display `<div />` until the account is loaded
23
-
24
-
25
- # accountSelectors
26
-
27
-
28
- ```jsx
29
- export const selectors = {
30
- getCurrentAccount,
31
- getCurrentAccountIsFetching,
32
- getCurrentAccountShouldFetch,
33
- getCurrentAccountIsFetched,
34
- getCurrentAccountHasError,
35
-
36
- getIsCurrentAccountAdministrator,
37
-
38
- getCurrentAccountCompanies,
39
- };
40
-
41
- ```
@@ -1,39 +0,0 @@
1
- Contains all information about the current company.
2
-
3
- The module `x25/Company` has:
4
- - `<LoadCompany />`
5
- - `companySelectors`
6
- - `companyReducer`
7
-
8
- # LoadCompany
9
-
10
- It loads the company
11
-
12
- Example:
13
- ```jsx
14
-
15
- import { LoadCompany } from "x25/Company";
16
-
17
- <LoadCompany>
18
- <div />
19
- </LoadCompany>
20
- ```
21
-
22
- It does not display `<div />` until the company is loaded
23
-
24
-
25
- # companySelectors
26
-
27
-
28
- ```jsx
29
- export const selectors = {
30
- getCurrentCompany,
31
- getCurrentCompanyIsFetched,
32
- getCurrentCompanyIsFetching,
33
- getCurrentCompanyHasError,
34
- getCurrentCompanyShouldFetch,
35
- getCompanyModules,
36
- getCurrentCompanyID,
37
- };
38
-
39
- ```
@@ -1,21 +0,0 @@
1
- The module `x25/Header` exports:
2
- - `<SideworkLogo />`
3
- - `<Header ...props />`
4
-
5
- ## `<Header ...props />`
6
-
7
- ```jsx
8
- type HeaderPropTypes = {
9
- brand : string;
10
- accountName : string;
11
- isAdmin: bool;
12
- sidebarDocked: boolean;
13
- ui: {
14
- showNavbar: boolean;
15
- };
16
-
17
- toggleNavbar: () => void;
18
-
19
- showSidebar: () => void;
20
- };
21
- ```
package/x25.wiki/Home.md DELETED
@@ -1 +0,0 @@
1
- Welcome to the x25 wiki!
@@ -1,33 +0,0 @@
1
- The module `x25/Inputs` exports:
2
-
3
- ```jsx
4
- export {
5
- SimpleInput,
6
- DelayInputChange,
7
- FocusTemplate,
8
- InputTemplate,
9
- DateTemplate,
10
- DateInput,
11
- NumericInput,
12
- NumericTemplate,
13
- TextareaTemplate,
14
- SimpleTextarea,
15
- CaptchaBox,
16
- LabelTemplate,
17
- Tooltip,
18
-
19
- // business
20
- EmailInput,
21
- PhoneInput,
22
- BankAccountInput,
23
- BankNameField,
24
- CifFieldContainer,
25
-
26
- // selects
27
- SelectMonth,
28
- SelectYear,
29
- SelectCounty,
30
- CustomSelect,
31
- SimpleCustomSelect,
32
- };
33
- ```
@@ -1,27 +0,0 @@
1
-
2
- The module `x25/Messages` has:
3
- - `<LoadingMessage ...props />`
4
- - `<ErrorMessage ...props />`
5
- - `<LargeErrorMessage ...props />`
6
-
7
- ## `<LoadingMessage ...props />`
8
-
9
- ```jsx
10
- type LoadingMessagePropTypes = {
11
- className? : string;
12
- message? : string;
13
- sm?: bool;
14
- };
15
- ```
16
-
17
- ## `<LargeErrorMessage ...props />`, `<ErrorMessage ...props />`
18
-
19
- ```jsx
20
- type ErrorMessageProps = {
21
- message: string;
22
- details?: string;
23
- itemNotFound?: boolean;
24
-
25
- onRetry?: () => void;
26
- };
27
- ```
@@ -1,42 +0,0 @@
1
- Use to create payments
2
-
3
- # Example
4
-
5
- ```jsx
6
- <Payment application="smsalert">
7
- <PayBoxForm
8
- credits={creditsPerMonth}
9
- current={formValues}
10
- />
11
- </Payment>
12
- ```
13
-
14
- Notes:
15
- 1. It accepts only one child
16
- 2. It inserts the following props into its children:
17
- - `companyID` - number
18
- - `createPayment` - function to call to create the payment request
19
- - `payUsingBankTransfer`
20
-
21
- ```jsx
22
- type Options = Immutable.Map({
23
- ...any other data
24
- companyID: number;
25
- amount: number;
26
- })
27
-
28
-
29
- type payUsingBankTransfer = (application: string, options : Options) => () => void;
30
- ```
31
-
32
- # Full example
33
-
34
- ```jsx
35
-
36
- <Payment application="smsalert">
37
- <PayBoxForm
38
- credits={creditsPerMonth}
39
- current={formValues}
40
- />
41
- </Payment>
42
- ```