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
@@ -0,0 +1,220 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
8
+
9
+ var _react = require("react");
10
+
11
+ var _react2 = _interopRequireDefault(_react);
12
+
13
+ var _immutable = require("redux-form/immutable");
14
+
15
+ var _Messages = require("../../Messages");
16
+
17
+ var _Inputs = require("../../Inputs");
18
+
19
+ var _utility = require("../../utility");
20
+
21
+ var _codes = require("../codes");
22
+
23
+ var _immutable2 = require("immutable");
24
+
25
+ var Immutable = _interopRequireWildcard(_immutable2);
26
+
27
+ var _util = require("./util");
28
+
29
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
30
+
31
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
32
+
33
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
34
+
35
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
36
+
37
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
38
+ /* eslint-disable no-magic-numbers*/
39
+
40
+ // type PayBox = {
41
+ // };
42
+
43
+ var createOption = function createOption(text, months) {
44
+ return {
45
+ name: "" + text,
46
+ value: months
47
+ };
48
+ };
49
+
50
+ var selectOptions = function selectOptions() {
51
+ return [createOption("1 lună", 1), createOption("3 luni", 3), createOption("6 luni", 6), createOption("1 an", 12), createOption("2 ani", 24)];
52
+ };
53
+
54
+ var PayBox = function (_React$Component) {
55
+ _inherits(PayBox, _React$Component);
56
+
57
+ function PayBox() {
58
+ _classCallCheck(this, PayBox);
59
+
60
+ return _possibleConstructorReturn(this, (PayBox.__proto__ || Object.getPrototypeOf(PayBox)).apply(this, arguments));
61
+ }
62
+
63
+ _createClass(PayBox, [{
64
+ key: "shouldComponentUpdate",
65
+ value: function shouldComponentUpdate() {
66
+ return true;
67
+ }
68
+ }, {
69
+ key: "render",
70
+ value: function render() {
71
+ var _props = this.props,
72
+ current = _props.current,
73
+ companyID = _props.companyID,
74
+ error = _props.error,
75
+ submitting = _props.submitting,
76
+ pristine = _props.pristine,
77
+ payUsingBankTransfer = _props.payUsingBankTransfer;
78
+
79
+
80
+ if (typeof current === "undefined") {
81
+ return null;
82
+ }
83
+
84
+ var Months = current.get("Months");
85
+
86
+ var amount = (0, _util.getPrice)(Months);
87
+
88
+ return _react2.default.createElement(
89
+ "form",
90
+ {
91
+ onSubmit: this.props.handleSubmit(this.props.createPayment) },
92
+ error ? _react2.default.createElement(
93
+ "div",
94
+ { className: "alert alert-danger" },
95
+ error
96
+ ) : null,
97
+ _react2.default.createElement(
98
+ "div",
99
+ { className: "container" },
100
+ _react2.default.createElement(
101
+ "div",
102
+ { className: "row" },
103
+ _react2.default.createElement(
104
+ "div",
105
+ { className: "col" },
106
+ _react2.default.createElement(
107
+ "div",
108
+ { className: "card mb-2 mt-2 shadow-sm" },
109
+ _react2.default.createElement(
110
+ "div",
111
+ { className: "card-header" },
112
+ _react2.default.createElement(
113
+ "h5",
114
+ { className: "my-0 font-weight-normal" },
115
+ "Serviciu facturare online"
116
+ )
117
+ ),
118
+ _react2.default.createElement(
119
+ "div",
120
+ { className: "card-body" },
121
+ _react2.default.createElement(_immutable.Field, {
122
+ component: _Inputs.CustomSelect,
123
+ data: selectOptions(),
124
+ disable: submitting,
125
+ label: "Durat\u0103",
126
+ name: "Months"
127
+ }),
128
+ _react2.default.createElement(
129
+ "h1",
130
+ { className: "card-title pricing-card-title" },
131
+ (0, _utility.plainNumberToLocale)(amount) + " lei"
132
+ ),
133
+ _react2.default.createElement(
134
+ "ul",
135
+ { className: "list-unstyled mt-3 mb-4" },
136
+ _react2.default.createElement(
137
+ "li",
138
+ null,
139
+ _react2.default.createElement("i", { className: "fa fa-check me-1 text-success" }),
140
+ "Emite facturi simplu online"
141
+ ),
142
+ _react2.default.createElement(
143
+ "li",
144
+ null,
145
+ _react2.default.createElement("i", { className: "fa fa-check me-1 text-success" }),
146
+ "Trimite facturi pe e-mail"
147
+ ),
148
+ _react2.default.createElement(
149
+ "li",
150
+ null,
151
+ _react2.default.createElement("i", { className: "fa fa-check me-1 text-success" }),
152
+ "Scapă de stresul facturilor tipizate"
153
+ )
154
+ ),
155
+ _react2.default.createElement(
156
+ "div",
157
+ { className: "container mb-3 small" },
158
+ _react2.default.createElement(
159
+ "div",
160
+ { className: "row" },
161
+ _react2.default.createElement(
162
+ "div",
163
+ { className: "form-control-label" },
164
+ _react2.default.createElement(_immutable.Field, {
165
+ component: _Inputs.LabelTemplate,
166
+ label: _react2.default.createElement(
167
+ "span",
168
+ null,
169
+ "Sunt de acord cu ",
170
+ _react2.default.createElement(
171
+ "a",
172
+ { href: "/settings/termeni-si-conditii/gestiune", target: "_blank" },
173
+ "termenii și condițiile"
174
+ )
175
+ ),
176
+ left: "",
177
+ name: "AcceptPolicy",
178
+ normalize: _utility.normalizeBoolean,
179
+ type: "checkbox"
180
+ })
181
+ )
182
+ )
183
+ ),
184
+ submitting ? _react2.default.createElement(_Messages.LoadingMessage, { sm: true }) : _react2.default.createElement(
185
+ "button",
186
+ {
187
+ "aria-label": "Trimite",
188
+ className: "btn btn-lg btn-block btn-primary",
189
+ disabled: submitting || pristine,
190
+ type: "submit" },
191
+ _react2.default.createElement("i", { className: "fa fa-credit-card me-1" }),
192
+ "Achiziționez online"
193
+ ),
194
+ _react2.default.createElement("hr", null),
195
+ _react2.default.createElement(
196
+ "button",
197
+ {
198
+ className: "btn btn-text text-muted curson-pointer m-0 p-0",
199
+ disabled: submitting,
200
+ onClick: payUsingBankTransfer(_codes.ApplicationCodeInvoiceService, Immutable.Map({
201
+ Months: Months,
202
+ companyID: companyID,
203
+ amount: amount
204
+ })),
205
+ type: "button" },
206
+ "Plătesc prin transfer bancar"
207
+ )
208
+ )
209
+ )
210
+ )
211
+ )
212
+ )
213
+ );
214
+ }
215
+ }]);
216
+
217
+ return PayBox;
218
+ }(_react2.default.Component);
219
+
220
+ exports.default = PayBox;
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ var _reactRedux = require("react-redux");
8
+
9
+ var _immutable = require("redux-form/immutable");
10
+
11
+ var _react = require("react");
12
+
13
+ var _react2 = _interopRequireDefault(_react);
14
+
15
+ var _immutable2 = require("immutable");
16
+
17
+ var Immutable = _interopRequireWildcard(_immutable2);
18
+
19
+ var _Description = require("./Description");
20
+
21
+ var _Description2 = _interopRequireDefault(_Description);
22
+
23
+ var _PayBox = require("./PayBox");
24
+
25
+ var _PayBox2 = _interopRequireDefault(_PayBox);
26
+
27
+ var _ = require("../");
28
+
29
+ var _2 = _interopRequireDefault(_);
30
+
31
+ var _codes = require("../codes");
32
+
33
+ var _validate = require("../validate");
34
+
35
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
36
+
37
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
38
+
39
+ var formID = "PAY_FOR_COMPANY_INVOICES";
40
+ /* eslint-disable no-magic-numbers */
41
+
42
+ var PayBoxForm = (0, _immutable.reduxForm)({
43
+ form: formID,
44
+ validate: _validate.validate
45
+ })(_PayBox2.default);
46
+
47
+ var formValuesSelector = (0, _immutable.getFormValues)(formID);
48
+
49
+ var mapStateToProps = function mapStateToProps(state) {
50
+ return {
51
+ formValues: formValuesSelector(state)
52
+ };
53
+ };
54
+
55
+ var EstimateBox = function EstimateBox(props) {
56
+ var id = props.id,
57
+ formValues = props.formValues;
58
+
59
+
60
+ return _react2.default.createElement(
61
+ "div",
62
+ { className: "container mt-2" },
63
+ _react2.default.createElement(
64
+ "div",
65
+ { className: "row" },
66
+ _react2.default.createElement(
67
+ "div",
68
+ { className: "col-lg" },
69
+ _react2.default.createElement(_Description2.default, null)
70
+ ),
71
+ _react2.default.createElement(
72
+ "div",
73
+ { className: "col-lg" },
74
+ _react2.default.createElement(
75
+ _2.default,
76
+ {
77
+ application: _codes.ApplicationCodeInvoiceService,
78
+ companyID: id },
79
+ _react2.default.createElement(PayBoxForm, {
80
+ companyID: id,
81
+ current: formValues,
82
+ initialValues: Immutable.Map({
83
+ Months: 6
84
+ })
85
+ })
86
+ )
87
+ )
88
+ )
89
+ );
90
+ };
91
+
92
+ exports.default = (0, _reactRedux.connect)(mapStateToProps)(EstimateBox);
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getPrice = exports.pricePerMonth = undefined;
7
+
8
+ var _big = require("big.js");
9
+
10
+ var _big2 = _interopRequireDefault(_big);
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+
14
+ var up = 3;
15
+
16
+ var
17
+ // in LEI 16.01.2019
18
+ pricePerMonth = exports.pricePerMonth = 10.99,
19
+ getPrice = exports.getPrice = function getPrice(months) {
20
+ return parseFloat(new _big2.default(months).times(new _big2.default(pricePerMonth)).round(0, up));
21
+ };
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
8
+
9
+ var _react = require("react");
10
+
11
+ var _react2 = _interopRequireDefault(_react);
12
+
13
+ var _Messages = require("../Messages");
14
+
15
+ var _config = require("../config");
16
+
17
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18
+
19
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
20
+
21
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
22
+
23
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
24
+
25
+ var delay = 1200;
26
+
27
+ var MobilpayForm = function (_React$Component) {
28
+ _inherits(MobilpayForm, _React$Component);
29
+
30
+ function MobilpayForm(props) {
31
+ _classCallCheck(this, MobilpayForm);
32
+
33
+ var _this = _possibleConstructorReturn(this, (MobilpayForm.__proto__ || Object.getPrototypeOf(MobilpayForm)).call(this, props));
34
+
35
+ _this.registerForm = function (form) {
36
+ _this.form = form;
37
+ };
38
+
39
+ _this.submit = function () {
40
+ _this.form.submit();
41
+ };
42
+
43
+ _this.startWaiting = function () {
44
+ _this.timeout = setTimeout(function () {
45
+ _this.submit();
46
+ }, delay);
47
+ };
48
+
49
+ _this.stopWaiting = function () {
50
+ clearTimeout(_this.timeout);
51
+ };
52
+ return _this;
53
+ }
54
+
55
+ _createClass(MobilpayForm, [{
56
+ key: "componentDidMount",
57
+ value: function componentDidMount() {
58
+ this.startWaiting();
59
+ }
60
+ }, {
61
+ key: "shouldComponentUpdate",
62
+ value: function shouldComponentUpdate(nextProps) {
63
+ return this.props.envKey !== nextProps.envKey || this.props.data !== nextProps.data;
64
+ }
65
+ }, {
66
+ key: "componentWillUnmount",
67
+ value: function componentWillUnmount() {
68
+ this.stopWaiting();
69
+ }
70
+ }, {
71
+ key: "render",
72
+ value: function render() {
73
+ return _react2.default.createElement(
74
+ "form",
75
+ { action: _config.config.MobilPayURL, method: "POST", ref: this.registerForm },
76
+ _react2.default.createElement("input", { name: "env_key", type: "hidden", value: this.props.envKey }),
77
+ _react2.default.createElement("input", { name: "data", type: "hidden", value: this.props.data }),
78
+ _react2.default.createElement(_Messages.LoadingMessage, { className: "mt-5", message: "Se ini\u021Biaz\u0103 conexiunea..." })
79
+ );
80
+ }
81
+ }]);
82
+
83
+ return MobilpayForm;
84
+ }(_react2.default.Component);
85
+
86
+ exports.default = MobilpayForm;
@@ -0,0 +1,233 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
8
+
9
+ var _react = require("react");
10
+
11
+ var _react2 = _interopRequireDefault(_react);
12
+
13
+ var _Modal = require("../../Modal");
14
+
15
+ var _util = require("../util");
16
+
17
+ var _utility = require("../../utility");
18
+
19
+ var _DoneForm = require("./DoneForm");
20
+
21
+ var _DoneForm2 = _interopRequireDefault(_DoneForm);
22
+
23
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
24
+
25
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
26
+
27
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
28
+
29
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
30
+
31
+ var BankTransfer = function (_React$Component) {
32
+ _inherits(BankTransfer, _React$Component);
33
+
34
+ function BankTransfer(props) {
35
+ _classCallCheck(this, BankTransfer);
36
+
37
+ var _this = _possibleConstructorReturn(this, (BankTransfer.__proto__ || Object.getPrototypeOf(BankTransfer)).call(this, props));
38
+
39
+ _this.state = {
40
+ done: false
41
+ };
42
+
43
+ _this.transferIsDone = function () {
44
+ _this.setState({
45
+ done: true
46
+ });
47
+ };
48
+ return _this;
49
+ }
50
+
51
+ _createClass(BankTransfer, [{
52
+ key: "shouldComponentUpdate",
53
+ value: function shouldComponentUpdate() {
54
+ return true;
55
+ }
56
+ }, {
57
+ key: "render",
58
+ value: function render() {
59
+ var _props = this.props,
60
+ application = _props.application,
61
+ options = _props.options;
62
+
63
+
64
+ var details = (0, _util.getDetails)(application, options);
65
+
66
+ if (this.state.done) {
67
+ return _react2.default.createElement(_DoneForm2.default, { details: details });
68
+ }
69
+
70
+ return _react2.default.createElement(
71
+ _react2.default.Fragment,
72
+ null,
73
+ _react2.default.createElement(
74
+ "div",
75
+ null,
76
+ "Te rugăm să operezi următorul transfer bancar."
77
+ ),
78
+ _react2.default.createElement(
79
+ "div",
80
+ { className: "container mt-3" },
81
+ _react2.default.createElement(
82
+ "div",
83
+ { className: "row" },
84
+ _react2.default.createElement(
85
+ "div",
86
+ { className: "col-lg-8 offset-lg-2 card" },
87
+ _react2.default.createElement(
88
+ "div",
89
+ { className: "container card-body" },
90
+ _react2.default.createElement(
91
+ "div",
92
+ { className: "row" },
93
+ _react2.default.createElement(
94
+ "div",
95
+ { className: "col-md-4 text-md-right" },
96
+ "Către"
97
+ ),
98
+ _react2.default.createElement(
99
+ "div",
100
+ { className: "col-md-8 font-weight-bold" },
101
+ _util.info.to
102
+ )
103
+ ),
104
+ _react2.default.createElement(
105
+ "div",
106
+ { className: "row" },
107
+ _react2.default.createElement(
108
+ "div",
109
+ { className: "col-md-4 text-md-right" },
110
+ ""
111
+ ),
112
+ _react2.default.createElement(
113
+ "div",
114
+ { className: "col-md-8 small" },
115
+ "C.I.F. " + _util.info.cif + " \u0219i Reg. Com. " + _util.info.regCom
116
+ )
117
+ ),
118
+ _react2.default.createElement(
119
+ "div",
120
+ { className: "row" },
121
+ _react2.default.createElement(
122
+ "div",
123
+ { className: "col-md-4 text-md-right" },
124
+ "Din"
125
+ ),
126
+ _react2.default.createElement(
127
+ "div",
128
+ { className: "col-md-8 small" },
129
+ _util.info.address
130
+ )
131
+ ),
132
+ _react2.default.createElement("hr", null),
133
+ _react2.default.createElement(
134
+ "div",
135
+ { className: "row" },
136
+ _react2.default.createElement(
137
+ "div",
138
+ { className: "col-md-4 text-md-right" },
139
+ "Numele băncii"
140
+ ),
141
+ _react2.default.createElement(
142
+ "div",
143
+ { className: "col-md-8" },
144
+ _util.info.bankName
145
+ )
146
+ ),
147
+ _react2.default.createElement(
148
+ "div",
149
+ { className: "row" },
150
+ _react2.default.createElement(
151
+ "div",
152
+ { className: "col-md-4 text-md-right" },
153
+ "IBAN"
154
+ ),
155
+ _react2.default.createElement(
156
+ "div",
157
+ { className: "col-md-8 font-weight-bold" },
158
+ _util.info.bankAccount
159
+ )
160
+ ),
161
+ _react2.default.createElement(
162
+ "div",
163
+ { className: "row" },
164
+ _react2.default.createElement(
165
+ "div",
166
+ { className: "col-md-4 text-md-right" },
167
+ "Suma"
168
+ ),
169
+ _react2.default.createElement(
170
+ "div",
171
+ { className: "col-md-8 font-weight-bold" },
172
+ (0, _utility.numberToLocale)(options.amount),
173
+ " lei"
174
+ )
175
+ ),
176
+ _react2.default.createElement(
177
+ "div",
178
+ { className: "row" },
179
+ _react2.default.createElement(
180
+ "div",
181
+ { className: "col-md-4 text-md-right" },
182
+ "Referință"
183
+ ),
184
+ _react2.default.createElement(
185
+ "div",
186
+ { className: "col-md-8 font-weight-bold" },
187
+ _react2.default.createElement(
188
+ "code",
189
+ null,
190
+ details
191
+ )
192
+ )
193
+ )
194
+ )
195
+ )
196
+ )
197
+ ),
198
+ _react2.default.createElement(
199
+ "div",
200
+ { className: "alert alert-warning mt-3" },
201
+ _react2.default.createElement("i", { className: "fa fa-exclamation-circle me-1" }),
202
+ "Este foarte important să scrii cu atenție câmpul \"Referință\""
203
+ ),
204
+ _react2.default.createElement(
205
+ "div",
206
+ { className: "mt-4" },
207
+ "După ce ai efectuat transferul bancar, apasă următorul buton:"
208
+ ),
209
+ _react2.default.createElement(
210
+ "button",
211
+ {
212
+ className: "btn btn-block btn-primary mt-4 me-1 ms-1 mb-3",
213
+ onClick: this.transferIsDone,
214
+ type: "button" },
215
+ _react2.default.createElement("i", { className: "fa fa-check me-1" }),
216
+ "Am efectuat transferul bancar"
217
+ )
218
+ );
219
+ }
220
+ }]);
221
+
222
+ return BankTransfer;
223
+ }(_react2.default.Component);
224
+
225
+ var ModalBankTransfer = function ModalBankTransfer(props) {
226
+ return _react2.default.createElement(
227
+ _Modal.SimpleModal,
228
+ { size: "lg", title: "Transfer bancar" },
229
+ _react2.default.createElement(BankTransfer, props)
230
+ );
231
+ };
232
+
233
+ exports.default = ModalBankTransfer;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ var _react = require("react");
8
+
9
+ var _react2 = _interopRequireDefault(_react);
10
+
11
+ var _Modal = require("../../Modal");
12
+
13
+ var _EstimatePrice = require("../EstimatePrice");
14
+
15
+ var _EstimatePrice2 = _interopRequireDefault(_EstimatePrice);
16
+
17
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18
+
19
+ var ModalWrap = function ModalWrap(_ref) {
20
+ var id = _ref.id;
21
+ return _react2.default.createElement(
22
+ _Modal.SimpleModal,
23
+ { size: "lg", title: "Re\xEEnnoie\u0219te abonamentul" },
24
+ _react2.default.createElement(_EstimatePrice2.default, { id: id })
25
+ );
26
+ };
27
+
28
+ exports.default = ModalWrap;