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,139 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.NumericInput = undefined;
7
+
8
+ 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; }; }();
9
+
10
+ var _react = require("react");
11
+
12
+ var _react2 = _interopRequireDefault(_react);
13
+
14
+ var _classnames = require("classnames");
15
+
16
+ var _classnames2 = _interopRequireDefault(_classnames);
17
+
18
+ var _utility = require("../utility");
19
+
20
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
+
22
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
23
+
24
+ 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; }
25
+
26
+ 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; } /* eslint-disable */
27
+
28
+
29
+ var NumericInput = exports.NumericInput = function (_React$Component) {
30
+ _inherits(NumericInput, _React$Component);
31
+
32
+ function NumericInput(props) {
33
+ _classCallCheck(this, NumericInput);
34
+
35
+ var _this = _possibleConstructorReturn(this, (NumericInput.__proto__ || Object.getPrototypeOf(NumericInput)).call(this));
36
+
37
+ _this.state = {
38
+ value: props.input.value
39
+ };
40
+
41
+ _this.handleKeyDown = function (event) {
42
+ if (event.key === "Enter") {
43
+ _this.handleBlur();
44
+ }
45
+ };
46
+
47
+ _this.handleBlur = function () {
48
+ (0, _utility.handleBlur)(_this);
49
+ };
50
+
51
+ _this.handleChange = function (_ref) {
52
+ var value = _ref.target.value;
53
+
54
+ _this.props.input.onChange();
55
+
56
+ /*
57
+ * Update the internal state to trigger a re-render
58
+ * using the formatted value
59
+ */
60
+ _this.setState({ value: value });
61
+ };
62
+ return _this;
63
+ }
64
+
65
+ _createClass(NumericInput, [{
66
+ key: "UNSAFE_componentWillReceiveProps",
67
+ value: function UNSAFE_componentWillReceiveProps(nextProps) {
68
+ (0, _utility.cwrp)(this, nextProps);
69
+ }
70
+ }, {
71
+ key: "render",
72
+ value: function render() {
73
+ var _props = this.props,
74
+ customClass = _props.customClass,
75
+ input = _props.input,
76
+ label = _props.label,
77
+ currency = _props.currency,
78
+ tabIndex = _props.tabIndex,
79
+ onRegisterRef = _props.onRegisterRef,
80
+ _props$meta = _props.meta,
81
+ submitting = _props$meta.submitting,
82
+ touched = _props$meta.touched,
83
+ error = _props$meta.error,
84
+ formatValue = _props.formatValue,
85
+ size = _props.size,
86
+ placeholder = _props.placeholder;
87
+
88
+
89
+ var inputComponent = _react2.default.createElement("input", {
90
+ "aria-label": label,
91
+ className: (0, _classnames2.default)("form-control " + (customClass || ""), {
92
+ "is-invalid": touched && error
93
+ }),
94
+ disabled: submitting,
95
+ id: input.name,
96
+ maxLength: size,
97
+ onBlur: this.handleBlur,
98
+ onChange: this.handleChange,
99
+ onFocus: input.onFocus,
100
+ onKeyDown: this.handleKeyDown,
101
+ placeholder: placeholder || label,
102
+ ref: onRegisterRef,
103
+ tabIndex: tabIndex,
104
+ type: "text",
105
+ value: formatValue(this.state.value, this.props.optional)
106
+ });
107
+
108
+ if (typeof currency === "undefined" || currency === false) {
109
+ return _react2.default.createElement(
110
+ "div",
111
+ { className: "form-group-inline" },
112
+ inputComponent
113
+ );
114
+ }
115
+
116
+ return _react2.default.createElement(
117
+ "div",
118
+ { className: "input-group" },
119
+ inputComponent,
120
+ _react2.default.createElement(
121
+ "div",
122
+ { className: "input-group-append" },
123
+ _react2.default.createElement(
124
+ "span",
125
+ { className: "input-group-text" },
126
+ currency
127
+ )
128
+ )
129
+ );
130
+ }
131
+ }]);
132
+
133
+ return NumericInput;
134
+ }(_react2.default.Component);
135
+
136
+ NumericInput.defaultProps = {
137
+ formatValue: _utility.formatZeroValue,
138
+ normalizeValue: _utility.normalizeFloat
139
+ };
@@ -0,0 +1,148 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.NumericTemplate = undefined;
7
+
8
+ 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; }; }();
9
+
10
+ var _react = require("react");
11
+
12
+ var _react2 = _interopRequireDefault(_react);
13
+
14
+ var _classnames = require("classnames");
15
+
16
+ var _classnames2 = _interopRequireDefault(_classnames);
17
+
18
+ var _utility = require("../utility");
19
+
20
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
+
22
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
23
+
24
+ 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; }
25
+
26
+ 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; } /* eslint-disable */
27
+
28
+
29
+ var NumericTemplate = exports.NumericTemplate = function (_React$Component) {
30
+ _inherits(NumericTemplate, _React$Component);
31
+
32
+ function NumericTemplate(props) {
33
+ _classCallCheck(this, NumericTemplate);
34
+
35
+ var _this = _possibleConstructorReturn(this, (NumericTemplate.__proto__ || Object.getPrototypeOf(NumericTemplate)).call(this));
36
+
37
+ _this.state = {
38
+ value: props.input.value
39
+ };
40
+
41
+ _this.handleKeyDown = function (event) {
42
+ if (event.key === "Enter") {
43
+ _this.handleBlur();
44
+ }
45
+ };
46
+
47
+ _this.handleBlur = function () {
48
+ (0, _utility.handleBlur)(_this);
49
+ };
50
+
51
+ _this.handleChange = function (_ref) {
52
+ var value = _ref.target.value;
53
+
54
+ _this.props.input.onChange();
55
+
56
+ /*
57
+ * Update the internal state to trigger a re-render
58
+ * using the formatted value
59
+ */
60
+ _this.setState({ value: value });
61
+ };
62
+ return _this;
63
+ }
64
+
65
+ _createClass(NumericTemplate, [{
66
+ key: "UNSAFE_componentWillReceiveProps",
67
+ value: function UNSAFE_componentWillReceiveProps(nextProps) {
68
+ (0, _utility.cwrp)(this, nextProps);
69
+ }
70
+ }, {
71
+ key: "render",
72
+ value: function render() {
73
+ var _props = this.props,
74
+ input = _props.input,
75
+ label = _props.label,
76
+ onRegisterRef = _props.onRegisterRef,
77
+ _props$meta = _props.meta,
78
+ submitting = _props$meta.submitting,
79
+ touched = _props$meta.touched,
80
+ error = _props$meta.error,
81
+ formatValue = _props.formatValue,
82
+ type = _props.type,
83
+ autoFocus = _props.autoFocus,
84
+ inputClass = _props.inputClass,
85
+ placeholder = _props.placeholder,
86
+ left = _props.left,
87
+ size = _props.size,
88
+ right = _props.right,
89
+ tabIndex = _props.tabIndex,
90
+ divClass = _props.divClass;
91
+
92
+
93
+ var warningClass = "" + (touched && error ? " is-invalid" : ""),
94
+ customClass = "" + (inputClass ? " " + inputClass : ""),
95
+ classForInput = "form-control " + warningClass + customClass,
96
+ classForDiv = "form-group row " + (divClass ? divClass : "");
97
+
98
+ return _react2.default.createElement(
99
+ "div",
100
+ { className: (0, _classnames2.default)(classForDiv, { "is-invalid": touched && error }) },
101
+ _react2.default.createElement(
102
+ "label",
103
+ {
104
+ className: (left ? left : "col-md-4 text-md-right") + " form-control-label",
105
+ htmlFor: input.name },
106
+ label
107
+ ),
108
+ _react2.default.createElement(
109
+ "div",
110
+ { className: right ? right : "col-md-8" },
111
+ _react2.default.createElement("input", {
112
+ "aria-label": label,
113
+ autoFocus: autoFocus,
114
+ className: classForInput,
115
+ disabled: submitting,
116
+ id: input.name,
117
+ maxLength: size,
118
+ onBlur: this.handleBlur,
119
+ onChange: this.handleChange,
120
+ onFocus: input.onFocus,
121
+ onKeyDown: this.handleKeyDown,
122
+ placeholder: placeholder,
123
+ ref: onRegisterRef,
124
+ tabIndex: tabIndex,
125
+ type: type,
126
+ value: formatValue(this.state.value, this.props.optional)
127
+ }),
128
+ _react2.default.createElement(
129
+ "div",
130
+ { className: "invalid-feedback" },
131
+ touched && error && _react2.default.createElement(
132
+ "span",
133
+ null,
134
+ error
135
+ )
136
+ )
137
+ )
138
+ );
139
+ }
140
+ }]);
141
+
142
+ return NumericTemplate;
143
+ }(_react2.default.Component);
144
+
145
+ NumericTemplate.defaultProps = {
146
+ formatValue: _utility.formatZeroValue,
147
+ normalizeValue: _utility.normalizeFloat
148
+ };
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ var _reactRedux = require("react-redux");
8
+
9
+ var _reducer = require("../../reducer");
10
+
11
+ var _Custom = require("./Custom");
12
+
13
+ var _Custom2 = _interopRequireDefault(_Custom);
14
+
15
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
+
17
+ // ;
18
+
19
+ var mapStateToProps = function mapStateToProps(state) {
20
+ return {
21
+ data: _reducer.selectors.getCountiesSorted(state),
22
+ label: "Județ",
23
+ isImmutable: true,
24
+ nameKey: "Name",
25
+ valueKey: "Short"
26
+ };
27
+ };
28
+
29
+ exports.default = (0, _reactRedux.connect)(mapStateToProps)(_Custom2.default);
@@ -0,0 +1,56 @@
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 _Simple = require("./Simple");
12
+
13
+ var _Simple2 = _interopRequireDefault(_Simple);
14
+
15
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
+
17
+ var CustomSelect = function CustomSelect(props) {
18
+ var input = props.input,
19
+ _props$meta = props.meta,
20
+ touched = _props$meta.touched,
21
+ error = _props$meta.error,
22
+ left = props.left,
23
+ right = props.right,
24
+ label = props.label,
25
+ id = props.id;
26
+
27
+ var customID = "custom-select-" + input.name + (id || "");
28
+
29
+ return _react2.default.createElement(
30
+ "div",
31
+ { className: "form-group row" },
32
+ _react2.default.createElement(
33
+ "label",
34
+ {
35
+ className: (left ? left : "col-md-4 text-md-right") + " form-control-label",
36
+ htmlFor: customID },
37
+ label
38
+ ),
39
+ _react2.default.createElement(
40
+ "div",
41
+ { className: right ? right : "col-md-8" },
42
+ _react2.default.createElement(_Simple2.default, props),
43
+ _react2.default.createElement(
44
+ "div",
45
+ { className: "invalid-feedback" },
46
+ touched && error && _react2.default.createElement(
47
+ "span",
48
+ null,
49
+ error
50
+ )
51
+ )
52
+ )
53
+ );
54
+ };
55
+
56
+ exports.default = CustomSelect;
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
8
+
9
+ var _react = require("react");
10
+
11
+ var _react2 = _interopRequireDefault(_react);
12
+
13
+ var _classnames = require("classnames");
14
+
15
+ var _classnames2 = _interopRequireDefault(_classnames);
16
+
17
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18
+
19
+ var SimpleCustomSelect = function SimpleCustomSelect(_ref) {
20
+ var autoFocus = _ref.autoFocus,
21
+ isImmutable = _ref.isImmutable,
22
+ showEmptyOption = _ref.showEmptyOption,
23
+ _ref$valueKey = _ref.valueKey,
24
+ valueKey = _ref$valueKey === undefined ? "value" : _ref$valueKey,
25
+ _ref$nameKey = _ref.nameKey,
26
+ nameKey = _ref$nameKey === undefined ? "name" : _ref$nameKey,
27
+ data = _ref.data,
28
+ _ref$meta = _ref.meta,
29
+ submitting = _ref$meta.submitting,
30
+ touched = _ref$meta.touched,
31
+ error = _ref$meta.error,
32
+ tabIndex = _ref.tabIndex,
33
+ input = _ref.input,
34
+ id = _ref.id,
35
+ inputClass = _ref.inputClass;
36
+
37
+ var customID = "custom-select-" + input.name + (id || "");
38
+
39
+ return _react2.default.createElement(
40
+ "select",
41
+ _extends({}, input, {
42
+ autoFocus: autoFocus,
43
+ className: (0, _classnames2.default)("custom-select " + (inputClass || ""), {
44
+ "is-invalid": touched && error
45
+ }),
46
+ disabled: submitting,
47
+ id: customID,
48
+ tabIndex: tabIndex }),
49
+ showEmptyOption ? _react2.default.createElement(
50
+ "option",
51
+ { value: "" },
52
+ "Selectează"
53
+ ) : null,
54
+ isImmutable ? data.map(function (current) {
55
+ var value = current.get(valueKey),
56
+ name = current.get(nameKey);
57
+
58
+ return _react2.default.createElement(
59
+ "option",
60
+ { key: value, value: value },
61
+ name
62
+ );
63
+ }) : data.map(function (_ref2) {
64
+ var value = _ref2[valueKey],
65
+ name = _ref2[nameKey];
66
+ return _react2.default.createElement(
67
+ "option",
68
+ { key: value, value: value },
69
+ name
70
+ );
71
+ })
72
+ );
73
+ };
74
+
75
+ exports.default = SimpleCustomSelect;
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.SimpleCustomSelect = exports.CustomSelect = exports.SelectCounty = exports.SelectYear = exports.SelectMonth = undefined;
7
+
8
+ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
9
+
10
+ var _County = require("./County");
11
+
12
+ var _County2 = _interopRequireDefault(_County);
13
+
14
+ var _Custom = require("./Custom");
15
+
16
+ var _Custom2 = _interopRequireDefault(_Custom);
17
+
18
+ var _Simple = require("./Simple");
19
+
20
+ var _Simple2 = _interopRequireDefault(_Simple);
21
+
22
+ var _utility = require("../../utility");
23
+
24
+ var _immutable = require("redux-form/immutable");
25
+
26
+ var _react = require("react");
27
+
28
+ var _react2 = _interopRequireDefault(_react);
29
+
30
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
31
+
32
+ var SelectMonth = function SelectMonth(props) {
33
+ return _react2.default.createElement(_immutable.Field, _extends({}, props, {
34
+ component: props.simple ? _Simple2.default : _Custom2.default,
35
+ data: _utility.months,
36
+ normalize: _utility.normalizeSelectNumeric
37
+ }));
38
+ };
39
+
40
+ var SelectYear = function SelectYear(props) {
41
+ return _react2.default.createElement(_immutable.Field, _extends({}, props, {
42
+ component: props.simple ? _Simple2.default : _Custom2.default,
43
+ data: _utility.years,
44
+ normalize: _utility.normalizeSelectNumeric
45
+ }));
46
+ };
47
+
48
+ exports.SelectMonth = SelectMonth;
49
+ exports.SelectYear = SelectYear;
50
+ exports.SelectCounty = _County2.default;
51
+ exports.CustomSelect = _Custom2.default;
52
+ exports.SimpleCustomSelect = _Simple2.default;
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.SimpleInput = undefined;
7
+
8
+ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
9
+
10
+ var _react = require("react");
11
+
12
+ var _react2 = _interopRequireDefault(_react);
13
+
14
+ var _classnames = require("classnames");
15
+
16
+ var _classnames2 = _interopRequireDefault(_classnames);
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
+
20
+ var SimpleInput = exports.SimpleInput = function SimpleInput(_ref) {
21
+ var customClass = _ref.customClass,
22
+ input = _ref.input,
23
+ label = _ref.label,
24
+ tabIndex = _ref.tabIndex,
25
+ _ref$meta = _ref.meta,
26
+ submitting = _ref$meta.submitting,
27
+ touched = _ref$meta.touched,
28
+ error = _ref$meta.error,
29
+ placeholder = _ref.placeholder;
30
+ return _react2.default.createElement("input", _extends({}, input, {
31
+ "aria-label": label,
32
+ autoComplete: input.name,
33
+ className: (0, _classnames2.default)("form-control " + (customClass || ""), {
34
+ "is-invalid": touched && error
35
+ }),
36
+ disabled: submitting,
37
+ id: input.name,
38
+ placeholder: placeholder || label,
39
+ tabIndex: tabIndex,
40
+ type: "text"
41
+ }));
42
+ };
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.SimpleTextarea = undefined;
7
+
8
+ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
9
+
10
+ var _react = require("react");
11
+
12
+ var _react2 = _interopRequireDefault(_react);
13
+
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+
16
+ var SimpleTextarea = exports.SimpleTextarea = function SimpleTextarea(_ref) {
17
+ var input = _ref.input,
18
+ type = _ref.type,
19
+ label = _ref.label,
20
+ onRegisterRef = _ref.onRegisterRef,
21
+ autoFocus = _ref.autoFocus,
22
+ inputClass = _ref.inputClass,
23
+ placeholder = _ref.placeholder,
24
+ tabIndex = _ref.tabIndex,
25
+ rows = _ref.rows,
26
+ _ref$meta = _ref.meta,
27
+ submitting = _ref$meta.submitting,
28
+ touched = _ref$meta.touched,
29
+ error = _ref$meta.error;
30
+
31
+ var warningClass = "" + (touched && error ? " is-invalid" : ""),
32
+ customClass = "" + (inputClass ? " " + inputClass : ""),
33
+ classForInput = "form-control " + warningClass + customClass;
34
+
35
+ return _react2.default.createElement("textarea", _extends({}, input, {
36
+ "aria-label": label,
37
+ autoFocus: autoFocus,
38
+ className: classForInput,
39
+ disabled: submitting,
40
+ id: input.name,
41
+ placeholder: placeholder,
42
+ ref: onRegisterRef ? onRegisterRef : null,
43
+ rows: rows,
44
+ tabIndex: tabIndex,
45
+ type: type
46
+ }));
47
+ };
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.TextareaTemplate = undefined;
7
+
8
+ var _react = require("react");
9
+
10
+ var _react2 = _interopRequireDefault(_react);
11
+
12
+ var _classnames = require("classnames");
13
+
14
+ var _classnames2 = _interopRequireDefault(_classnames);
15
+
16
+ var _SimpleTextarea = require("./SimpleTextarea");
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
+
20
+ var TextareaTemplate = exports.TextareaTemplate = function TextareaTemplate(props) {
21
+ var input = props.input,
22
+ label = props.label,
23
+ left = props.left,
24
+ right = props.right,
25
+ _props$meta = props.meta,
26
+ touched = _props$meta.touched,
27
+ error = _props$meta.error;
28
+
29
+
30
+ return _react2.default.createElement(
31
+ "div",
32
+ { className: (0, _classnames2.default)("form-group row", { "is-invalid": touched && error }) },
33
+ _react2.default.createElement(
34
+ "label",
35
+ {
36
+ className: (left ? left : "col-md-4") + " text-md-right form-control-label",
37
+ htmlFor: input.name },
38
+ label
39
+ ),
40
+ _react2.default.createElement(
41
+ "div",
42
+ { className: right ? right : "col-md-8" },
43
+ _react2.default.createElement(_SimpleTextarea.SimpleTextarea, props),
44
+ _react2.default.createElement(
45
+ "div",
46
+ { className: "invalid-feedback" },
47
+ touched && error && _react2.default.createElement(
48
+ "span",
49
+ null,
50
+ error
51
+ )
52
+ )
53
+ )
54
+ );
55
+ };