x25 2.9.2 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (274) hide show
  1. package/.eslintignore +2 -0
  2. package/.eslintrc.json +275 -0
  3. package/.flowconfig +23 -0
  4. package/conf/dev.js +19 -0
  5. package/conf/dist.js +19 -0
  6. package/conf/polyfills/tempPolyfills.js +7 -0
  7. package/package.json +16 -16
  8. package/src/Account/Load.jsx +79 -0
  9. package/src/Account/actions.js +10 -0
  10. package/src/Account/index.js +11 -0
  11. package/src/Account/reducer.js +139 -0
  12. package/src/Account/request.js +36 -0
  13. package/src/Async/InitModule.jsx +114 -0
  14. package/src/Async/RouteLoading.jsx +52 -0
  15. package/src/Async/SimulatedException.jsx +19 -0
  16. package/src/Async/index.jsx +75 -0
  17. package/src/Async/types.js +39 -0
  18. package/src/Company/Load.jsx +84 -0
  19. package/src/Company/actions.js +10 -0
  20. package/src/Company/index.js +11 -0
  21. package/src/Company/reducer.js +201 -0
  22. package/src/Company/request.js +30 -0
  23. package/src/Company/util.js +7 -0
  24. package/src/Header/AccountOptionsContainer.jsx +124 -0
  25. package/src/Header/AdminSelectCompany.jsx +101 -0
  26. package/src/Header/ClientSelectCompany.jsx +90 -0
  27. package/src/Header/Header.jsx +120 -0
  28. package/src/Header/HeaderContainer.jsx +30 -0
  29. package/src/Header/Logo.jsx +16 -0
  30. package/src/Header/LogoutButton.jsx +34 -0
  31. package/src/Header/index.jsx +9 -0
  32. package/src/Header/request.js +28 -0
  33. package/src/Header/types.js +6 -0
  34. package/src/Header/util.jsx +61 -0
  35. package/src/Inputs/Business/BankAccount.jsx +39 -0
  36. package/src/Inputs/Business/BankName.jsx +40 -0
  37. package/src/Inputs/Business/CifField.jsx +93 -0
  38. package/src/Inputs/Business/CifFieldContainer.jsx +142 -0
  39. package/src/Inputs/Business/Email.jsx +23 -0
  40. package/src/Inputs/Business/NidField.jsx +77 -0
  41. package/src/Inputs/Business/Phone.jsx +23 -0
  42. package/src/Inputs/Business/index.js +16 -0
  43. package/src/Inputs/Business/request.js +39 -0
  44. package/src/Inputs/CaptchaBox.jsx +131 -0
  45. package/src/Inputs/DateInput.jsx +188 -0
  46. package/src/Inputs/DateTemplate.jsx +213 -0
  47. package/src/Inputs/DelayInputChange.jsx +130 -0
  48. package/src/Inputs/FocusTemplate.jsx +41 -0
  49. package/src/Inputs/InputTemplate.jsx +79 -0
  50. package/src/Inputs/LabelTemplate.jsx +47 -0
  51. package/src/Inputs/NumericInput.jsx +142 -0
  52. package/src/Inputs/NumericTemplate.jsx +155 -0
  53. package/src/Inputs/Selects/County.jsx +19 -0
  54. package/src/Inputs/Selects/Custom.jsx +55 -0
  55. package/src/Inputs/Selects/Simple.jsx +73 -0
  56. package/src/Inputs/Selects/index.jsx +37 -0
  57. package/src/Inputs/SimpleInput.jsx +40 -0
  58. package/src/Inputs/SimpleTextarea.jsx +55 -0
  59. package/src/Inputs/TextareaTemplate.jsx +57 -0
  60. package/src/Inputs/Tooltip.jsx +61 -0
  61. package/src/Inputs/index.js +22 -0
  62. package/src/Messages/Error.jsx +83 -0
  63. package/src/Messages/Loading.jsx +43 -0
  64. package/src/Messages/index.jsx +4 -0
  65. package/src/Modal/Delete.jsx +237 -0
  66. package/src/Modal/Root.jsx +57 -0
  67. package/src/Modal/SimpleModal.jsx +47 -0
  68. package/src/Modal/actions.js +7 -0
  69. package/src/Modal/getComponent.jsx +32 -0
  70. package/src/Modal/index.jsx +12 -0
  71. package/src/Modal/reducer.js +40 -0
  72. package/src/Modal/types.js +6 -0
  73. package/src/Modal/util.js +15 -0
  74. package/src/Payment/EstimatePrice/Description.jsx +101 -0
  75. package/src/Payment/EstimatePrice/PayBox.jsx +173 -0
  76. package/src/Payment/EstimatePrice/index.jsx +63 -0
  77. package/src/Payment/EstimatePrice/util.js +15 -0
  78. package/src/Payment/MobilpayForm.jsx +77 -0
  79. package/src/Payment/Modal/BankTransfer.jsx +129 -0
  80. package/src/Payment/Modal/CompanyValability.jsx +14 -0
  81. package/src/Payment/Modal/DoneForm.jsx +209 -0
  82. package/src/Payment/Modal/PaymentDone.jsx +27 -0
  83. package/src/Payment/Modal/index.js +13 -0
  84. package/src/Payment/actions.jsx +22 -0
  85. package/{Payment → src/Payment}/codes.js +16 -19
  86. package/src/Payment/index.jsx +124 -0
  87. package/src/Payment/request.js +50 -0
  88. package/src/Payment/types.js +14 -0
  89. package/src/Payment/util.jsx +52 -0
  90. package/src/Payment/validate.js +25 -0
  91. package/src/Sidebar.jsx +158 -0
  92. package/src/Things.jsx +35 -0
  93. package/src/actions.js +36 -0
  94. package/src/config.js +7 -0
  95. package/src/dev/ErrorBoundary.jsx +98 -0
  96. package/src/dev/TheError.jsx +87 -0
  97. package/src/dev/index.js +127 -0
  98. package/src/dev/types.js +10 -0
  99. package/src/prod/SentryErrorBoundary.jsx +98 -0
  100. package/src/reducer/captchas.js +44 -0
  101. package/src/reducer/counties.js +46 -0
  102. package/src/reducer/index.js +25 -0
  103. package/src/reducer/module.jsx +43 -0
  104. package/src/style/.sass-lint.yml +84 -0
  105. package/src/style/.stylelintrc.json +161 -0
  106. package/src/style/_fancy-text.scss +37 -0
  107. package/src/style/_fix_bootstrap_placeholder_color.scss +14 -0
  108. package/src/style/_header-company.scss +69 -0
  109. package/src/style/_inputs.scss +12 -0
  110. package/src/style/_minimal.scss +31 -0
  111. package/src/style/_navigation.scss +24 -0
  112. package/src/style/_others.scss +79 -0
  113. package/src/style/index.scss +7 -0
  114. package/src/style/sidebar/_animations.scss +21 -0
  115. package/src/style/sidebar/_dark-theme.scss +77 -0
  116. package/src/style/sidebar/_scroll.scss +37 -0
  117. package/src/style/sidebar/_structure.scss +299 -0
  118. package/src/style/sidebar.scss +4 -0
  119. package/src/types.js +31 -0
  120. package/src/utility/calendar.js +39 -0
  121. package/src/utility/date.js +100 -0
  122. package/src/utility/index.js +12 -0
  123. package/src/utility/language.js +17 -0
  124. package/src/utility/mql.js +3 -0
  125. package/src/utility/normalize-test.js +58 -0
  126. package/src/utility/normalize.js +119 -0
  127. package/src/utility/numbers.js +87 -0
  128. package/src/utility/numeric.js +114 -0
  129. package/src/utility/others.jsx +160 -0
  130. package/src/utility/strings-test.js +136 -0
  131. package/src/utility/strings.js +80 -0
  132. package/src/utility/validation/common.js +360 -0
  133. package/src/utility/validation/index.js +70 -0
  134. package/src/utility/validation/specific.js +9 -0
  135. package/src/utility/validation/validate/bank-test.js +129 -0
  136. package/src/utility/validation/validate/bank.js +176 -0
  137. package/src/utility/validation/validate/cif-test.js +105 -0
  138. package/src/utility/validation/validate/cif.js +44 -0
  139. package/src/utility/validation/validate/cnp-test.js +216 -0
  140. package/src/utility/validation/validate/cnp.js +261 -0
  141. package/{utility → src/utility}/validation/validate/date.js +73 -61
  142. package/src/utility/validation/validate/email-test.js +36 -0
  143. package/src/utility/validation/validate/email.js +6 -0
  144. package/src/utility/validation/validate/index.js +7 -0
  145. package/webpack.config.js +90 -0
  146. package/x25.wiki/Account.md +41 -0
  147. package/x25.wiki/Company.md +39 -0
  148. package/x25.wiki/Header.md +21 -0
  149. package/x25.wiki/Home.md +1 -0
  150. package/x25.wiki/Inputs.md +33 -0
  151. package/x25.wiki/Messages.md +27 -0
  152. package/x25.wiki/Payment.md +42 -0
  153. package/Account/Load.js +0 -75
  154. package/Account/actions.js +0 -15
  155. package/Account/index.js +0 -20
  156. package/Account/reducer.js +0 -122
  157. package/Account/request.js +0 -44
  158. package/Async/InitModule.js +0 -190
  159. package/Async/RouteLoading.js +0 -64
  160. package/Async/SimulatedException.js +0 -44
  161. package/Async/index.js +0 -95
  162. package/Async/types.js +0 -1
  163. package/Company/Load.js +0 -82
  164. package/Company/actions.js +0 -15
  165. package/Company/index.js +0 -20
  166. package/Company/reducer.js +0 -165
  167. package/Company/request.js +0 -36
  168. package/Company/util.js +0 -10
  169. package/Header/AccountOptionsContainer.js +0 -144
  170. package/Header/AdminSelectCompany.js +0 -109
  171. package/Header/ClientSelectCompany.js +0 -104
  172. package/Header/Header.js +0 -127
  173. package/Header/HeaderContainer.js +0 -39
  174. package/Header/Logo.js +0 -30
  175. package/Header/LogoutButton.js +0 -39
  176. package/Header/index.js +0 -19
  177. package/Header/request.js +0 -26
  178. package/Header/types.js +0 -1
  179. package/Header/util.js +0 -58
  180. package/Inputs/Business/BankAccount.js +0 -48
  181. package/Inputs/Business/BankName.js +0 -49
  182. package/Inputs/Business/CifField.js +0 -112
  183. package/Inputs/Business/CifFieldContainer.js +0 -157
  184. package/Inputs/Business/Email.js +0 -37
  185. package/Inputs/Business/NidField.js +0 -91
  186. package/Inputs/Business/Phone.js +0 -37
  187. package/Inputs/Business/index.js +0 -34
  188. package/Inputs/Business/request.js +0 -39
  189. package/Inputs/CaptchaBox.js +0 -151
  190. package/Inputs/DateInput.js +0 -172
  191. package/Inputs/DateTemplate.js +0 -200
  192. package/Inputs/DelayInputChange.js +0 -135
  193. package/Inputs/FocusTemplate.js +0 -47
  194. package/Inputs/InputTemplate.js +0 -78
  195. package/Inputs/LabelTemplate.js +0 -59
  196. package/Inputs/NumericInput.js +0 -139
  197. package/Inputs/NumericTemplate.js +0 -148
  198. package/Inputs/Selects/County.js +0 -29
  199. package/Inputs/Selects/Custom.js +0 -56
  200. package/Inputs/Selects/Simple.js +0 -75
  201. package/Inputs/Selects/index.js +0 -52
  202. package/Inputs/SimpleInput.js +0 -42
  203. package/Inputs/SimpleTextarea.js +0 -47
  204. package/Inputs/TextareaTemplate.js +0 -55
  205. package/Inputs/Tooltip.js +0 -82
  206. package/Inputs/index.js +0 -185
  207. package/Messages/Error.js +0 -106
  208. package/Messages/Loading.js +0 -68
  209. package/Messages/index.js +0 -29
  210. package/Modal/Delete.js +0 -240
  211. package/Modal/Root.js +0 -81
  212. package/Modal/SimpleModal.js +0 -57
  213. package/Modal/actions.js +0 -10
  214. package/Modal/getComponent.js +0 -42
  215. package/Modal/index.js +0 -22
  216. package/Modal/reducer.js +0 -53
  217. package/Modal/types.js +0 -7
  218. package/Modal/util.js +0 -17
  219. package/Payment/EstimatePrice/Description.js +0 -92
  220. package/Payment/EstimatePrice/PayBox.js +0 -220
  221. package/Payment/EstimatePrice/index.js +0 -92
  222. package/Payment/EstimatePrice/util.js +0 -21
  223. package/Payment/MobilpayForm.js +0 -86
  224. package/Payment/Modal/BankTransfer.js +0 -233
  225. package/Payment/Modal/CompanyValability.js +0 -28
  226. package/Payment/Modal/DoneForm.js +0 -222
  227. package/Payment/Modal/PaymentDone.js +0 -53
  228. package/Payment/Modal/index.js +0 -27
  229. package/Payment/actions.js +0 -23
  230. package/Payment/index.js +0 -141
  231. package/Payment/request.js +0 -49
  232. package/Payment/types.js +0 -1
  233. package/Payment/util.js +0 -50
  234. package/Payment/validate.js +0 -23
  235. package/Sidebar.js +0 -156
  236. package/Things.js +0 -53
  237. package/actions.js +0 -73
  238. package/config.js +0 -10
  239. package/dev/ErrorBoundary.js +0 -109
  240. package/dev/TheError.js +0 -113
  241. package/dev/index.js +0 -132
  242. package/dev/types.js +0 -1
  243. package/prod/SentryErrorBoundary.js +0 -150
  244. package/reducer/captchas.js +0 -51
  245. package/reducer/counties.js +0 -57
  246. package/reducer/index.js +0 -38
  247. package/reducer/module.js +0 -48
  248. package/style/index.css +0 -1
  249. package/style/sidebar.css +0 -1
  250. package/types.js +0 -1
  251. package/utility/calendar.js +0 -45
  252. package/utility/date.js +0 -111
  253. package/utility/index.js +0 -125
  254. package/utility/language.js +0 -20
  255. package/utility/mql.js +0 -6
  256. package/utility/normalize-test.js +0 -54
  257. package/utility/normalize.js +0 -108
  258. package/utility/numbers.js +0 -93
  259. package/utility/numeric.js +0 -103
  260. package/utility/others.js +0 -142
  261. package/utility/strings-test.js +0 -216
  262. package/utility/strings.js +0 -85
  263. package/utility/validation/common.js +0 -278
  264. package/utility/validation/index.js +0 -110
  265. package/utility/validation/specific.js +0 -14
  266. package/utility/validation/validate/bank-test.js +0 -41
  267. package/utility/validation/validate/bank.js +0 -176
  268. package/utility/validation/validate/cif-test.js +0 -37
  269. package/utility/validation/validate/cif.js +0 -44
  270. package/utility/validation/validate/cnp-test.js +0 -68
  271. package/utility/validation/validate/cnp.js +0 -193
  272. package/utility/validation/validate/email-test.js +0 -30
  273. package/utility/validation/validate/email.js +0 -11
  274. package/utility/validation/validate/index.js +0 -65
@@ -1,139 +0,0 @@
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
- };
@@ -1,148 +0,0 @@
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
- };
@@ -1,29 +0,0 @@
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);
@@ -1,56 +0,0 @@
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;
@@ -1,75 +0,0 @@
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;
@@ -1,52 +0,0 @@
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;
@@ -1,42 +0,0 @@
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
- };
@@ -1,47 +0,0 @@
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
- };
@@ -1,55 +0,0 @@
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
- };