guestbell-forms 2.0.298 → 2.0.299
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/InputHeader/InputHeader.js +258 -323
- package/build/components/InputHeader/InputHeader.js.map +1 -1
- package/build/components/InputHeader/InputHeaderContext.js +6 -8
- package/build/components/InputHeader/InputHeaderContext.js.map +1 -1
- package/build/components/InputHeader/index.js +4 -6
- package/build/components/InputHeader/index.js.map +1 -1
- package/build/components/InputHeader/withInputHeaderContext.js +9 -13
- package/build/components/InputHeader/withInputHeaderContext.js.map +1 -1
- package/build/components/base/input/BaseInput.js +334 -418
- package/build/components/base/input/BaseInput.js.map +1 -1
- package/build/components/base/input/index.js +1 -1
- package/build/components/base/input/index.js.map +1 -1
- package/build/components/bookingCalendar/BookingCalendar.js +68 -85
- package/build/components/bookingCalendar/BookingCalendar.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarControls/BookingCalendarControls.js +40 -71
- package/build/components/bookingCalendar/bookingCalendarControls/BookingCalendarControls.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarControls/classes.js +1 -1
- package/build/components/bookingCalendar/bookingCalendarControls/classes.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarControls/index.js +2 -2
- package/build/components/bookingCalendar/bookingCalendarControls/index.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarDatePicker/BookingCalendarDatePicker.js +22 -41
- package/build/components/bookingCalendar/bookingCalendarDatePicker/BookingCalendarDatePicker.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarDatePicker/classes.js +1 -1
- package/build/components/bookingCalendar/bookingCalendarDatePicker/classes.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarDatePicker/index.js +2 -2
- package/build/components/bookingCalendar/bookingCalendarDatePicker/index.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarGrid/BookingCalendarGrid.js +20 -24
- package/build/components/bookingCalendar/bookingCalendarGrid/BookingCalendarGrid.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarGrid/classes.js +1 -1
- package/build/components/bookingCalendar/bookingCalendarGrid/classes.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarItem/BookingCalendarItem.js +9 -12
- package/build/components/bookingCalendar/bookingCalendarItem/BookingCalendarItem.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarItem/classes.js +1 -1
- package/build/components/bookingCalendar/bookingCalendarItem/classes.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarItem/index.js +2 -2
- package/build/components/bookingCalendar/bookingCalendarItem/index.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarLane/BookingCalendarLane.js +23 -28
- package/build/components/bookingCalendar/bookingCalendarLane/BookingCalendarLane.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarLane/classes.js +1 -1
- package/build/components/bookingCalendar/bookingCalendarLane/classes.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarLane/index.js +2 -2
- package/build/components/bookingCalendar/bookingCalendarLane/index.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarLaneHeader/BookingCalendarLaneHeader.js +6 -6
- package/build/components/bookingCalendar/bookingCalendarLaneHeader/BookingCalendarLaneHeader.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarLaneHeader/classes.js +1 -1
- package/build/components/bookingCalendar/bookingCalendarLaneHeader/classes.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarLaneHeader/index.js +1 -1
- package/build/components/bookingCalendar/bookingCalendarLaneHeader/index.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarLanesHeader/BookingCalendarLanesHeader.js +12 -16
- package/build/components/bookingCalendar/bookingCalendarLanesHeader/BookingCalendarLanesHeader.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarLanesHeader/BookingCalendarLanesHeaderRenderItem.js +27 -31
- package/build/components/bookingCalendar/bookingCalendarLanesHeader/BookingCalendarLanesHeaderRenderItem.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarLanesHeader/classes.js +1 -1
- package/build/components/bookingCalendar/bookingCalendarLanesHeader/classes.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarLanesHeader/index.js +2 -2
- package/build/components/bookingCalendar/bookingCalendarLanesHeader/index.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarRenderItem/BookingCalendarRenderItem.js +19 -19
- package/build/components/bookingCalendar/bookingCalendarRenderItem/BookingCalendarRenderItem.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarRenderItem/classes.js +1 -1
- package/build/components/bookingCalendar/bookingCalendarRenderItem/classes.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarRenderItem/index.js +1 -1
- package/build/components/bookingCalendar/bookingCalendarRenderItem/index.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarSelection/BookingCalendarSelection.js +133 -175
- package/build/components/bookingCalendar/bookingCalendarSelection/BookingCalendarSelection.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarTimeAxis/BookingCalendarTimeAxis.js +17 -19
- package/build/components/bookingCalendar/bookingCalendarTimeAxis/BookingCalendarTimeAxis.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarTimeAxis/classes.js +1 -1
- package/build/components/bookingCalendar/bookingCalendarTimeAxis/classes.js.map +1 -1
- package/build/components/bookingCalendar/classes.js +1 -1
- package/build/components/bookingCalendar/classes.js.map +1 -1
- package/build/components/bookingCalendar/common.js +5 -7
- package/build/components/bookingCalendar/common.js.map +1 -1
- package/build/components/bookingCalendar/index.js +3 -3
- package/build/components/bookingCalendar/index.js.map +1 -1
- package/build/components/bookingCalendar/utils.js +143 -205
- package/build/components/bookingCalendar/utils.js.map +1 -1
- package/build/components/button/Button.js +101 -123
- package/build/components/button/Button.js.map +1 -1
- package/build/components/button/index.js +4 -6
- package/build/components/button/index.js.map +1 -1
- package/build/components/checkbox/Checkbox.js +102 -145
- package/build/components/checkbox/Checkbox.js.map +1 -1
- package/build/components/checkbox/index.js +4 -6
- package/build/components/checkbox/index.js.map +1 -1
- package/build/components/dropdown/Dropdown.js +41 -57
- package/build/components/dropdown/Dropdown.js.map +1 -1
- package/build/components/dropdown/index.js +4 -6
- package/build/components/dropdown/index.js.map +1 -1
- package/build/components/dynamicSubmit/DynamicSubmit.js +81 -123
- package/build/components/dynamicSubmit/DynamicSubmit.js.map +1 -1
- package/build/components/dynamicSubmit/index.js +4 -6
- package/build/components/dynamicSubmit/index.js.map +1 -1
- package/build/components/form/Form.js +139 -193
- package/build/components/form/Form.js.map +1 -1
- package/build/components/form/FormContext.js +6 -8
- package/build/components/form/FormContext.js.map +1 -1
- package/build/components/form/FormValidationSummary.js +57 -105
- package/build/components/form/FormValidationSummary.js.map +1 -1
- package/build/components/form/index.js +5 -7
- package/build/components/form/index.js.map +1 -1
- package/build/components/form/withFormContext.js +9 -13
- package/build/components/form/withFormContext.js.map +1 -1
- package/build/components/inputGroup/InputGroup.js +16 -48
- package/build/components/inputGroup/InputGroup.js.map +1 -1
- package/build/components/inputGroup/index.js +4 -6
- package/build/components/inputGroup/index.js.map +1 -1
- package/build/components/money/Money.js +137 -211
- package/build/components/money/Money.js.map +1 -1
- package/build/components/money/index.js +4 -6
- package/build/components/money/index.js.map +1 -1
- package/build/components/numberInput/NumberInput.js +106 -144
- package/build/components/numberInput/NumberInput.js.map +1 -1
- package/build/components/numberInput/index.js +4 -6
- package/build/components/numberInput/index.js.map +1 -1
- package/build/components/openingHours/openingHoursDay/OpeningHoursDay.js +162 -220
- package/build/components/openingHours/openingHoursDay/OpeningHoursDay.js.map +1 -1
- package/build/components/openingHours/openingHoursDay/index.js +4 -6
- package/build/components/openingHours/openingHoursDay/index.js.map +1 -1
- package/build/components/openingHours/openingHoursSpecial/OpeningHoursSpecial.js +114 -191
- package/build/components/openingHours/openingHoursSpecial/OpeningHoursSpecial.js.map +1 -1
- package/build/components/openingHours/openingHoursSpecial/index.js +4 -6
- package/build/components/openingHours/openingHoursSpecial/index.js.map +1 -1
- package/build/components/openingHours/openingHoursWeek/OpeningHoursWeek.js +150 -209
- package/build/components/openingHours/openingHoursWeek/OpeningHoursWeek.js.map +1 -1
- package/build/components/openingHours/openingHoursWeek/index.js +4 -6
- package/build/components/openingHours/openingHoursWeek/index.js.map +1 -1
- package/build/components/openingHours/utils/OpeningHoursUtil.js +51 -76
- package/build/components/openingHours/utils/OpeningHoursUtil.js.map +1 -1
- package/build/components/radio/Radio.js +38 -75
- package/build/components/radio/Radio.js.map +1 -1
- package/build/components/radio/index.js +4 -6
- package/build/components/radio/index.js.map +1 -1
- package/build/components/radioContainer/RadioContainer.js +19 -49
- package/build/components/radioContainer/RadioContainer.js.map +1 -1
- package/build/components/radioContainer/index.js +4 -6
- package/build/components/radioContainer/index.js.map +1 -1
- package/build/components/select/Select.js +186 -264
- package/build/components/select/Select.js.map +1 -1
- package/build/components/select/index.js +4 -6
- package/build/components/select/index.js.map +1 -1
- package/build/components/submit/Submit.js +50 -87
- package/build/components/submit/Submit.js.map +1 -1
- package/build/components/submit/index.js +4 -6
- package/build/components/submit/index.js.map +1 -1
- package/build/components/submit/subComponents/SubmitValidationSummary.js +5 -7
- package/build/components/submit/subComponents/SubmitValidationSummary.js.map +1 -1
- package/build/components/tags/Tags.js +365 -565
- package/build/components/tags/Tags.js.map +1 -1
- package/build/components/tags/index.js +4 -6
- package/build/components/tags/index.js.map +1 -1
- package/build/components/tags/subComponents/TagsSuggestions.js +29 -30
- package/build/components/tags/subComponents/TagsSuggestions.js.map +1 -1
- package/build/components/text/Text.js +95 -138
- package/build/components/text/Text.js.map +1 -1
- package/build/components/text/index.js +4 -6
- package/build/components/text/index.js.map +1 -1
- package/build/components/textArea/TextArea.js +52 -91
- package/build/components/textArea/TextArea.js.map +1 -1
- package/build/components/textArea/index.js +4 -6
- package/build/components/textArea/index.js.map +1 -1
- package/build/components/themeProvider/ThemeContext.js +6 -8
- package/build/components/themeProvider/ThemeContext.js.map +1 -1
- package/build/components/themeProvider/ThemeProvider.js +3 -5
- package/build/components/themeProvider/ThemeProvider.js.map +1 -1
- package/build/components/themeProvider/index.js +4 -6
- package/build/components/themeProvider/index.js.map +1 -1
- package/build/components/themeProvider/withThemeContext.js +10 -14
- package/build/components/themeProvider/withThemeContext.js.map +1 -1
- package/build/components/time/Time.js +184 -228
- package/build/components/time/Time.js.map +1 -1
- package/build/components/time/index.js +4 -6
- package/build/components/time/index.js.map +1 -1
- package/build/components/timeSpan/TimeSpan.js +226 -280
- package/build/components/timeSpan/TimeSpan.js.map +1 -1
- package/build/components/timeSpan/index.js +4 -6
- package/build/components/timeSpan/index.js.map +1 -1
- package/build/components/utils/Guid.js +3 -5
- package/build/components/utils/Guid.js.map +1 -1
- package/build/components/utils/ShallowEqual.js +5 -11
- package/build/components/utils/ShallowEqual.js.map +1 -1
- package/build/components/utils/TimeUtil.js +8 -22
- package/build/components/utils/TimeUtil.js.map +1 -1
- package/build/components/utils/Typescript.js.map +1 -1
- package/build/dist/guestbell-forms.css +0 -6
- package/build/dist/guestbell-forms.css.map +1 -1
- package/build/dist/guestbell-forms.min.css +1 -1
- package/build/dist/guestbell-forms.min.js +1 -1
- package/build/dist/guestbell-forms.min.js.map +1 -1
- package/build/dist/report.html +2 -2
- package/build/index.js +23 -23
- package/build/index.js.map +1 -1
- package/build/types/ElementOverrideProp.js.map +1 -1
- package/build/types/Theme.js.map +1 -1
- package/build/types/ThemeOverrides.js.map +1 -1
- package/build/validators/EmailValidator.js +8 -22
- package/build/validators/EmailValidator.js.map +1 -1
- package/build/validators/LatitudeValidator.js +13 -27
- package/build/validators/LatitudeValidator.js.map +1 -1
- package/build/validators/LongitudeValidator.js +13 -27
- package/build/validators/LongitudeValidator.js.map +1 -1
- package/build/validators/NumberValidator.js +27 -39
- package/build/validators/NumberValidator.js.map +1 -1
- package/build/validators/UrlValidator.js +9 -23
- package/build/validators/UrlValidator.js.map +1 -1
- package/build/validators/base.js.map +1 -1
- package/build/validators/index.js +6 -6
- package/build/validators/index.js.map +1 -1
- package/package.json +8 -5
- package/tsconfig.json +0 -1
@@ -1,11 +1,9 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
4
|
-
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
6
4
|
value: true
|
7
5
|
});
|
8
|
-
exports.
|
6
|
+
exports.defaultMoneyTranslations = exports.default = exports.MoneyRaw = exports.Money = void 0;
|
9
7
|
|
10
8
|
var React = _interopRequireWildcard(require("react"));
|
11
9
|
|
@@ -15,7 +13,7 @@ var _Text = require("../text/Text");
|
|
15
13
|
|
16
14
|
var _InputGroup = _interopRequireDefault(require("../inputGroup/InputGroup"));
|
17
15
|
|
18
|
-
var
|
16
|
+
var _BaseInput = require("../base/input/BaseInput");
|
19
17
|
|
20
18
|
var _Button = require("../button/Button");
|
21
19
|
|
@@ -25,35 +23,15 @@ var _withThemeContext = require("../themeProvider/withThemeContext");
|
|
25
23
|
|
26
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
27
25
|
|
28
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function
|
29
|
-
|
30
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
31
|
-
|
32
|
-
function _extends() { _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; }; return _extends.apply(this, arguments); }
|
33
|
-
|
34
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
35
|
-
|
36
|
-
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); } }
|
37
|
-
|
38
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
39
|
-
|
40
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
41
|
-
|
42
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
26
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
43
27
|
|
44
|
-
function
|
28
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
45
29
|
|
46
|
-
function
|
30
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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; }; return _extends.apply(this, arguments); }
|
47
31
|
|
48
|
-
function
|
32
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
49
33
|
|
50
|
-
function
|
51
|
-
|
52
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
53
|
-
|
54
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
55
|
-
|
56
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
34
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
57
35
|
|
58
36
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
59
37
|
|
@@ -70,7 +48,7 @@ PlusIcon.defaultProps = {
|
|
70
48
|
viewBox: "0 0 24 24"
|
71
49
|
}; // Libs
|
72
50
|
|
73
|
-
|
51
|
+
const defaultMoneyTranslations = _objectSpread(_objectSpread({}, _BaseInput.defaultBaseTranslations), {}, {
|
74
52
|
cannotRemoveDefaultCurrency: 'Cannot remove default currency',
|
75
53
|
removePrice: 'Remove price',
|
76
54
|
addPrice: 'Add price',
|
@@ -79,32 +57,19 @@ var defaultMoneyTranslations = _objectSpread(_objectSpread({}, _BaseInput2.defau
|
|
79
57
|
|
80
58
|
exports.defaultMoneyTranslations = defaultMoneyTranslations;
|
81
59
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
var _super = _createSuper(MoneyRaw);
|
86
|
-
|
87
|
-
function MoneyRaw(props) {
|
88
|
-
var _this;
|
89
|
-
|
90
|
-
_classCallCheck(this, MoneyRaw);
|
91
|
-
|
92
|
-
_this = _super.call(this, props, false);
|
93
|
-
|
94
|
-
_defineProperty(_assertThisInitialized(_this), "onCurrencyChanged", function (index, currentCurrencies) {
|
95
|
-
return function (e) {
|
96
|
-
var newPrices = [].concat(_this.props.prices);
|
97
|
-
newPrices[index].currency = currentCurrencies.filter(function (cc) {
|
98
|
-
return cc.value.toString() === e.target.value;
|
99
|
-
})[0];
|
60
|
+
class MoneyRaw extends _BaseInput.BaseInput {
|
61
|
+
constructor(props) {
|
62
|
+
super(props, false);
|
100
63
|
|
101
|
-
|
102
|
-
|
64
|
+
_defineProperty(this, "onCurrencyChanged", (index, currentCurrencies) => e => {
|
65
|
+
let newPrices = [].concat(this.props.prices);
|
66
|
+
newPrices[index].currency = currentCurrencies.filter(cc => cc.value.toString() === e.target.value)[0];
|
67
|
+
this.props.onPricesChange(newPrices);
|
103
68
|
});
|
104
69
|
|
105
|
-
_defineProperty(
|
106
|
-
|
107
|
-
|
70
|
+
_defineProperty(this, "onTheFlightValidate", value => {
|
71
|
+
let num = Number(value);
|
72
|
+
const parts = value.split('.');
|
108
73
|
|
109
74
|
if (parts && parts.length > 1 && parts[parts.length - 1].length > 2) {
|
110
75
|
return false;
|
@@ -119,203 +84,164 @@ var MoneyRaw = /*#__PURE__*/function (_BaseInput) {
|
|
119
84
|
}
|
120
85
|
});
|
121
86
|
|
122
|
-
_defineProperty(
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
var num = Number(str);
|
87
|
+
_defineProperty(this, "onPriceChanged", index => e => {
|
88
|
+
let newPrices = [].concat(this.props.prices);
|
89
|
+
let str = e.target.value;
|
90
|
+
let num = Number(str);
|
127
91
|
|
128
|
-
|
129
|
-
|
130
|
-
|
92
|
+
if (!isNaN(num)) {
|
93
|
+
newPrices[index].value = num;
|
94
|
+
}
|
131
95
|
|
132
|
-
|
96
|
+
this.props.onPricesChange(newPrices);
|
133
97
|
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
};
|
98
|
+
if (!this.state.touched) {
|
99
|
+
this.touch();
|
100
|
+
}
|
138
101
|
});
|
139
102
|
|
140
|
-
_defineProperty(
|
141
|
-
|
142
|
-
|
143
|
-
return itemIndex !== index;
|
144
|
-
});
|
145
|
-
|
146
|
-
_this.props.onPricesChange(newPrices);
|
103
|
+
_defineProperty(this, "removePriceClick", index => () => {
|
104
|
+
const newPrices = this.props.prices.filter((price, itemIndex) => itemIndex !== index);
|
105
|
+
this.props.onPricesChange(newPrices);
|
147
106
|
|
148
|
-
|
149
|
-
|
150
|
-
|
107
|
+
if (newPrices.length === 0 && this.props.required) {
|
108
|
+
this.setInvalid([this.getTranslations(defaultMoneyTranslations).required]);
|
109
|
+
}
|
151
110
|
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
};
|
111
|
+
if (!this.state.touched) {
|
112
|
+
this.touch();
|
113
|
+
}
|
156
114
|
});
|
157
115
|
|
158
|
-
_defineProperty(
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
116
|
+
_defineProperty(this, "addPriceClick", unusedCurrencies => () => {
|
117
|
+
this.props.onPricesChange(this.props.prices.concat([{
|
118
|
+
value: 0,
|
119
|
+
currency: unusedCurrencies[0]
|
120
|
+
}]));
|
121
|
+
this.setValid();
|
164
122
|
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
_this.touch();
|
169
|
-
}
|
170
|
-
};
|
123
|
+
if (!this.state.touched) {
|
124
|
+
this.touch();
|
125
|
+
}
|
171
126
|
});
|
172
127
|
|
173
|
-
_defineProperty(
|
174
|
-
|
175
|
-
|
176
|
-
});
|
177
|
-
});
|
128
|
+
_defineProperty(this, "onFocus", () => this.setState({
|
129
|
+
focused: true
|
130
|
+
}));
|
178
131
|
|
179
|
-
_defineProperty(
|
180
|
-
|
181
|
-
|
182
|
-
});
|
183
|
-
});
|
132
|
+
_defineProperty(this, "onBlur", () => this.setState({
|
133
|
+
focused: false
|
134
|
+
}));
|
184
135
|
|
185
136
|
if (!props.currencies || !props.currencies.length) {
|
186
137
|
throw Error('No currencies supplied to money input');
|
187
138
|
}
|
188
139
|
|
189
|
-
|
140
|
+
this.state = Object.assign(this.state, {
|
190
141
|
isValid: props.required ? props.prices.length > 0 : true,
|
191
|
-
errors: props.required && props.prices.length === 0 ? [
|
142
|
+
errors: props.required && props.prices.length === 0 ? [this.getTranslations(defaultMoneyTranslations).required] : [],
|
192
143
|
handleValueChangeEnabled: false
|
193
144
|
});
|
194
|
-
|
195
|
-
|
196
|
-
});
|
197
|
-
var missingForced = forcedCurrencies.filter(function (c) {
|
198
|
-
return !props.prices.find(function (p) {
|
199
|
-
return p.currency.value === c.value;
|
200
|
-
});
|
201
|
-
});
|
145
|
+
const forcedCurrencies = props.currencies.filter(c => c.forceSelected);
|
146
|
+
const missingForced = forcedCurrencies.filter(c => !props.prices.find(p => p.currency.value === c.value));
|
202
147
|
|
203
148
|
if (missingForced.length > 0) {
|
204
|
-
props.onPricesChange(props.prices.concat(missingForced.map(
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
};
|
209
|
-
})));
|
149
|
+
props.onPricesChange(props.prices.concat(missingForced.map(c => ({
|
150
|
+
currency: c,
|
151
|
+
value: undefined
|
152
|
+
}))));
|
210
153
|
}
|
211
154
|
|
212
|
-
|
213
|
-
|
214
|
-
return _this;
|
155
|
+
this.subscribeSelf(props);
|
215
156
|
}
|
216
157
|
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
158
|
+
render() {
|
159
|
+
var _Button$defaultProps2;
|
160
|
+
|
161
|
+
let unusedCurrencies = this.props.currencies;
|
162
|
+
const translations = this.getTranslations(defaultMoneyTranslations);
|
163
|
+
return /*#__PURE__*/React.createElement(_InputGroup.default, {
|
164
|
+
title: this.props.title
|
165
|
+
}, /*#__PURE__*/React.createElement("div", _extends({}, this.props.id && {
|
166
|
+
id: this.props.id
|
167
|
+
}, {
|
168
|
+
className: 'input__base money-input ' + this.getValidationClass() + (this.props.className ? ' ' + this.props.className : ''),
|
169
|
+
ref: this.containerRef
|
170
|
+
}), this.props.prices && this.props.prices.map((item, index) => {
|
171
|
+
var _currentCurrencies$, _Button$defaultProps;
|
172
|
+
|
173
|
+
let currentCurrencies = this.props.currencies.filter(c => this.props.prices.filter((priceCurrency, priceIndex) => priceIndex !== index && priceCurrency.currency.value === c.value).length === 0);
|
174
|
+
const currency = this.props.currencies.find(c => c.value === item.currency.value);
|
175
|
+
let retComponents = currentCurrencies.length ? /*#__PURE__*/React.createElement("div", {
|
176
|
+
key: index
|
177
|
+
}, currentCurrencies.length > 1 ? /*#__PURE__*/React.createElement(_Select.Select, _extends({}, this.props.id && {
|
178
|
+
id: this.props.id + '-currency-select-' + index.toString()
|
179
|
+
}, {
|
180
|
+
onFocus: this.onFocus,
|
181
|
+
onBlur: this.onBlur,
|
182
|
+
className: 'money-input__select m-0',
|
183
|
+
values: currentCurrencies,
|
184
|
+
onChange: this.onCurrencyChanged(index, currentCurrencies),
|
185
|
+
value: item.currency.value.toString()
|
186
|
+
})) : currentCurrencies === null || currentCurrencies === void 0 ? void 0 : (_currentCurrencies$ = currentCurrencies[0]) === null || _currentCurrencies$ === void 0 ? void 0 : _currentCurrencies$.label, /*#__PURE__*/React.createElement(_Text.Text, _extends({}, this.props.id && {
|
187
|
+
id: this.props.id + '-amount-input-' + index.toString()
|
229
188
|
}, {
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
var currency = _this2.props.currencies.find(function (c) {
|
242
|
-
return c.value === item.currency.value;
|
243
|
-
});
|
244
|
-
|
245
|
-
var retComponents = currentCurrencies.length ? /*#__PURE__*/React.createElement("div", {
|
246
|
-
key: index
|
247
|
-
}, currentCurrencies.length > 1 ? /*#__PURE__*/React.createElement(_Select.Select, _extends({}, _this2.props.id && {
|
248
|
-
id: _this2.props.id + '-currency-select-' + index.toString()
|
249
|
-
}, {
|
250
|
-
onFocus: _this2.onFocus,
|
251
|
-
onBlur: _this2.onBlur,
|
252
|
-
className: 'money-input__select m-0',
|
253
|
-
values: currentCurrencies,
|
254
|
-
onChange: _this2.onCurrencyChanged(index, currentCurrencies),
|
255
|
-
value: item.currency.value.toString()
|
256
|
-
})) : currentCurrencies === null || currentCurrencies === void 0 ? void 0 : (_currentCurrencies$ = currentCurrencies[0]) === null || _currentCurrencies$ === void 0 ? void 0 : _currentCurrencies$.label, /*#__PURE__*/React.createElement(_Text.Text, _extends({}, _this2.props.id && {
|
257
|
-
id: _this2.props.id + '-amount-input-' + index.toString()
|
258
|
-
}, {
|
259
|
-
onFocus: _this2.onFocus,
|
260
|
-
onBlur: _this2.onBlur,
|
261
|
-
onTheFlightValidate: _this2.onTheFlightValidate,
|
262
|
-
placeholder: '0.00',
|
263
|
-
className: 'money-input__text m-0',
|
264
|
-
validators: ['number'],
|
265
|
-
value: item.value ? item.value.toString() : '',
|
266
|
-
onChange: _this2.onPriceChanged(index),
|
267
|
-
type: "number"
|
268
|
-
})), !_this2.props.disableDelete && _this2.props.prices.length > 0 && /*#__PURE__*/React.createElement(_Button.Button, _extends({}, _this2.props.id && {
|
269
|
-
id: _this2.props.id + '-remove-button-' + index.toString()
|
270
|
-
}, {
|
271
|
-
blank: true,
|
272
|
-
type: "error",
|
273
|
-
onClick: _this2.removePriceClick(index),
|
274
|
-
className: "transform-rotate--45 line-height--0",
|
275
|
-
buttonProps: _objectSpread(_objectSpread({}, (_Button$defaultProps = _Button.Button.defaultProps) === null || _Button$defaultProps === void 0 ? void 0 : _Button$defaultProps.buttonProps), {}, {
|
276
|
-
title: currency && currency.forceSelected ? translations.cannotRemoveDefaultCurrency : translations.removePrice
|
277
|
-
}),
|
278
|
-
circular: true,
|
279
|
-
disabled: currency && currency.forceSelected
|
280
|
-
}), /*#__PURE__*/React.createElement(PlusIcon, null))) : null;
|
281
|
-
unusedCurrencies = unusedCurrencies.filter(function (c) {
|
282
|
-
return c.value !== item.currency.value;
|
283
|
-
});
|
284
|
-
return retComponents;
|
285
|
-
}), (this.props.allowMultiple || this.props.prices && !this.props.prices.length) && unusedCurrencies.length ? /*#__PURE__*/React.createElement(_Button.Button, _extends({
|
286
|
-
blank: true
|
287
|
-
}, this.props.id && {
|
288
|
-
id: this.props.id + '-add-button'
|
189
|
+
onFocus: this.onFocus,
|
190
|
+
onBlur: this.onBlur,
|
191
|
+
onTheFlightValidate: this.onTheFlightValidate,
|
192
|
+
placeholder: '0.00',
|
193
|
+
className: 'money-input__text m-0',
|
194
|
+
validators: ['number'],
|
195
|
+
value: item.value ? item.value.toString() : '',
|
196
|
+
onChange: this.onPriceChanged(index),
|
197
|
+
type: "number"
|
198
|
+
})), !this.props.disableDelete && this.props.prices.length > 0 && /*#__PURE__*/React.createElement(_Button.Button, _extends({}, this.props.id && {
|
199
|
+
id: this.props.id + '-remove-button-' + index.toString()
|
289
200
|
}, {
|
290
|
-
|
291
|
-
|
292
|
-
onClick: this.
|
201
|
+
blank: true,
|
202
|
+
type: "error",
|
203
|
+
onClick: this.removePriceClick(index),
|
204
|
+
className: "transform-rotate--45 line-height--0",
|
205
|
+
buttonProps: _objectSpread(_objectSpread({}, (_Button$defaultProps = _Button.Button.defaultProps) === null || _Button$defaultProps === void 0 ? void 0 : _Button$defaultProps.buttonProps), {}, {
|
206
|
+
title: currency && currency.forceSelected ? translations.cannotRemoveDefaultCurrency : translations.removePrice
|
207
|
+
}),
|
293
208
|
circular: true,
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
209
|
+
disabled: currency && currency.forceSelected
|
210
|
+
}), /*#__PURE__*/React.createElement(PlusIcon, null))) : null;
|
211
|
+
unusedCurrencies = unusedCurrencies.filter(c => c.value !== item.currency.value);
|
212
|
+
return retComponents;
|
213
|
+
}), (this.props.allowMultiple || this.props.prices && !this.props.prices.length) && unusedCurrencies.length ? /*#__PURE__*/React.createElement(_Button.Button, _extends({
|
214
|
+
blank: true
|
215
|
+
}, this.props.id && {
|
216
|
+
id: this.props.id + '-add-button'
|
217
|
+
}, {
|
218
|
+
type: "primary",
|
219
|
+
className: "line-height--0 align-self-start",
|
220
|
+
onClick: this.addPriceClick(unusedCurrencies),
|
221
|
+
circular: true,
|
222
|
+
buttonProps: _objectSpread(_objectSpread({}, (_Button$defaultProps2 = _Button.Button.defaultProps) === null || _Button$defaultProps2 === void 0 ? void 0 : _Button$defaultProps2.buttonProps), {}, {
|
223
|
+
title: this.props.prices && this.props.prices.length === 0 ? translations.addPrice : translations.addNewCurrency
|
224
|
+
})
|
225
|
+
}), /*#__PURE__*/React.createElement(PlusIcon, null)) : null, /*#__PURE__*/React.createElement("span", {
|
226
|
+
className: "highlight"
|
227
|
+
}), /*#__PURE__*/React.createElement("span", {
|
228
|
+
className: 'bar ' + (this.state.focused ? 'focused' : '')
|
229
|
+
}), this.renderDefaultValidation(), this.props.label && /*#__PURE__*/React.createElement("label", {
|
230
|
+
className: this.props.prices && this.props.prices ? 'label--focused' : ''
|
231
|
+
}, this.renderLabel())));
|
232
|
+
}
|
306
233
|
|
307
|
-
|
308
|
-
}(_BaseInput2.BaseInput);
|
234
|
+
}
|
309
235
|
|
310
236
|
exports.MoneyRaw = MoneyRaw;
|
311
237
|
|
312
|
-
_defineProperty(MoneyRaw, "defaultProps", Object.assign({},
|
238
|
+
_defineProperty(MoneyRaw, "defaultProps", Object.assign({}, _BaseInput.BaseInput.defaultProps, {
|
313
239
|
type: 'money',
|
314
240
|
allowMultiple: false,
|
315
241
|
onChange: undefined
|
316
242
|
}));
|
317
243
|
|
318
|
-
|
244
|
+
const Money = (0, _withThemeContext.withThemeContext)((0, _withFormContext.withFormContext)(MoneyRaw), 'money');
|
319
245
|
exports.Money = Money;
|
320
246
|
var _default = Money;
|
321
247
|
exports.default = _default;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/components/money/Money.tsx"],"names":["PlusIcon","defaultMoneyTranslations","defaultBaseTranslations","cannotRemoveDefaultCurrency","removePrice","addPrice","addNewCurrency","MoneyRaw","props","index","currentCurrencies","e","newPrices","concat","prices","currency","filter","cc","value","toString","target","onPricesChange","num","Number","parts","split","length","isNaN","str","state","touched","touch","price","itemIndex","required","setInvalid","getTranslations","unusedCurrencies","setValid","setState","focused","currencies","Error","Object","assign","isValid","errors","handleValueChangeEnabled","forcedCurrencies","c","forceSelected","missingForced","find","p","map","undefined","subscribeSelf","translations","title","id","getValidationClass","className","containerRef","item","priceCurrency","priceIndex","retComponents","onFocus","onBlur","onCurrencyChanged","label","onTheFlightValidate","onPriceChanged","disableDelete","removePriceClick","Button","defaultProps","buttonProps","allowMultiple","addPriceClick","renderDefaultValidation","renderLabel","BaseInput","type","onChange","Money"],"mappings":";;;;;;;;;AAGA;;AAGA;;AACA;;AACA;;AACA;;AAMA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAjBaA,Q,YAAAA,Q;;;;;;AAAAA,Q;;;;;GAEb;;AAsBO,IAAMC,wBAAwB,mCAChCC,mCADgC;AAEnCC,EAAAA,2BAA2B,EAAE,gCAFM;AAGnCC,EAAAA,WAAW,EAAE,cAHsB;AAInCC,EAAAA,QAAQ,EAAE,WAJyB;AAKnCC,EAAAA,cAAc,EAAE;AALmB,EAA9B;;;;IAqBMC,Q;;;;;AAYX,oBAAYC,KAAZ,EAA+B;AAAA;;AAAA;;AAC7B,8BAAMA,KAAN,EAAa,KAAb;;AAD6B,wEAiKH,UAC1BC,KAD0B,EAE1BC,iBAF0B;AAAA,aAGvB,UAAAC,CAAC,EAAI;AACR,YAAIC,SAA8B,GAAG,GAAGC,MAAH,CAAU,MAAKL,KAAL,CAAWM,MAArB,CAArC;AACAF,QAAAA,SAAS,CAACH,KAAD,CAAT,CAAiBM,QAAjB,GAA4BL,iBAAiB,CAACM,MAAlB,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","sourcesContent":["import * as PlusIcon from 'material-design-icons/content/svg/production/ic_add_24px.svg';\r\n\r\n// Libs\r\nimport * as React from 'react';\r\n\r\n// Misc\r\nimport { Select, SelectValue } from '../select/Select';\r\nimport { Text } from '../text/Text';\r\nimport InputGroup from '../inputGroup/InputGroup';\r\nimport {\r\n BaseInputProps,\r\n BaseInputState,\r\n BaseInput,\r\n defaultBaseTranslations,\r\n} from '../base/input/BaseInput';\r\nimport { Button } from '../button/Button';\r\nimport { withFormContext } from '../form/withFormContext';\r\nimport { withThemeContext } from '../themeProvider/withThemeContext';\r\n\r\nexport interface MoneyWithCurrency {\r\n value: number;\r\n currency: SelectValue;\r\n}\r\n\r\nexport const defaultMoneyTranslations = {\r\n ...defaultBaseTranslations,\r\n cannotRemoveDefaultCurrency: 'Cannot remove default currency',\r\n removePrice: 'Remove price',\r\n addPrice: 'Add price',\r\n addNewCurrency: 'Add new currency',\r\n};\r\n\r\nexport type MoneyTranslations = Partial<typeof defaultMoneyTranslations>;\r\n\r\nexport interface MoneyProps extends BaseInputProps<never, MoneyTranslations> {\r\n onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;\r\n onPricesChange: (prices: MoneyWithCurrency[]) => void;\r\n allowMultiple?: boolean;\r\n currencies: SelectValue[];\r\n prices: MoneyWithCurrency[];\r\n disableDelete?: boolean;\r\n}\r\n\r\nexport interface MoneyState extends BaseInputState {}\r\n\r\nexport class MoneyRaw extends BaseInput<\r\n MoneyProps,\r\n MoneyState,\r\n never,\r\n MoneyTranslations\r\n> {\r\n public static defaultProps = Object.assign({}, BaseInput.defaultProps, {\r\n type: 'money',\r\n allowMultiple: false,\r\n onChange: undefined,\r\n });\r\n\r\n constructor(props: MoneyProps) {\r\n super(props, false);\r\n if (!props.currencies || !props.currencies.length) {\r\n throw Error('No currencies supplied to money input');\r\n }\r\n this.state = Object.assign(this.state, {\r\n isValid: props.required ? props.prices.length > 0 : true,\r\n errors:\r\n props.required && props.prices.length === 0\r\n ? [this.getTranslations(defaultMoneyTranslations).required]\r\n : [],\r\n handleValueChangeEnabled: false,\r\n });\r\n const forcedCurrencies = props.currencies.filter(c => c.forceSelected);\r\n const missingForced = forcedCurrencies.filter(\r\n c => !props.prices.find(p => p.currency.value === c.value)\r\n );\r\n if (missingForced.length > 0) {\r\n props.onPricesChange(\r\n props.prices.concat(\r\n missingForced.map(c => ({ currency: c, value: undefined }))\r\n )\r\n );\r\n }\r\n this.subscribeSelf(props);\r\n }\r\n\r\n public render() {\r\n let unusedCurrencies = this.props.currencies;\r\n const translations = this.getTranslations(defaultMoneyTranslations);\r\n return (\r\n <InputGroup title={this.props.title}>\r\n <div\r\n {...(this.props.id && { id: this.props.id })}\r\n className={\r\n 'input__base money-input ' +\r\n this.getValidationClass() +\r\n (this.props.className ? ' ' + this.props.className : '')\r\n }\r\n ref={this.containerRef}\r\n >\r\n {this.props.prices &&\r\n this.props.prices.map((item, index) => {\r\n let currentCurrencies = this.props.currencies.filter(\r\n c =>\r\n this.props.prices.filter(\r\n (priceCurrency, priceIndex) =>\r\n priceIndex !== index &&\r\n priceCurrency.currency.value === c.value\r\n ).length === 0\r\n );\r\n const currency = this.props.currencies.find(\r\n c => c.value === item.currency.value\r\n );\r\n let retComponents = currentCurrencies.length ? (\r\n <div key={index}>\r\n {currentCurrencies.length > 1 ? (\r\n <Select\r\n {...(this.props.id && {\r\n id:\r\n this.props.id +\r\n '-currency-select-' +\r\n index.toString(),\r\n })}\r\n onFocus={this.onFocus}\r\n onBlur={this.onBlur}\r\n className={'money-input__select m-0'}\r\n values={currentCurrencies}\r\n onChange={this.onCurrencyChanged(\r\n index,\r\n currentCurrencies\r\n )}\r\n value={item.currency.value.toString()}\r\n />\r\n ) : (\r\n currentCurrencies?.[0]?.label\r\n )}\r\n <Text\r\n {...(this.props.id && {\r\n id: this.props.id + '-amount-input-' + index.toString(),\r\n })}\r\n onFocus={this.onFocus}\r\n onBlur={this.onBlur}\r\n onTheFlightValidate={this.onTheFlightValidate}\r\n placeholder={'0.00'}\r\n className={'money-input__text m-0'}\r\n validators={['number']}\r\n value={item.value ? item.value.toString() : ''}\r\n onChange={this.onPriceChanged(index)}\r\n type=\"number\"\r\n />\r\n {!this.props.disableDelete && this.props.prices.length > 0 && (\r\n <Button\r\n {...(this.props.id && {\r\n id:\r\n this.props.id + '-remove-button-' + index.toString(),\r\n })}\r\n blank={true}\r\n type=\"error\"\r\n onClick={this.removePriceClick(index)}\r\n className=\"transform-rotate--45 line-height--0\"\r\n buttonProps={{\r\n ...Button.defaultProps?.buttonProps,\r\n title:\r\n currency && currency.forceSelected\r\n ? translations.cannotRemoveDefaultCurrency\r\n : translations.removePrice,\r\n }}\r\n circular={true}\r\n disabled={currency && currency.forceSelected}\r\n >\r\n <PlusIcon />\r\n </Button>\r\n )}\r\n </div>\r\n ) : null;\r\n unusedCurrencies = unusedCurrencies.filter(\r\n c => c.value !== item.currency.value\r\n );\r\n return retComponents;\r\n })}\r\n {(this.props.allowMultiple ||\r\n (this.props.prices && !this.props.prices.length)) &&\r\n unusedCurrencies.length ? (\r\n <Button\r\n blank={true}\r\n {...(this.props.id && {\r\n id: this.props.id + '-add-button',\r\n })}\r\n type=\"primary\"\r\n className=\"line-height--0 align-self-start\"\r\n onClick={this.addPriceClick(unusedCurrencies)}\r\n circular={true}\r\n buttonProps={{\r\n ...Button.defaultProps?.buttonProps,\r\n title:\r\n this.props.prices && this.props.prices.length === 0\r\n ? translations.addPrice\r\n : translations.addNewCurrency,\r\n }}\r\n >\r\n <PlusIcon />\r\n </Button>\r\n ) : null}\r\n <span className=\"highlight\" />\r\n <span className={'bar ' + (this.state.focused ? 'focused' : '')} />\r\n {this.renderDefaultValidation()}\r\n {this.props.label && (\r\n <label\r\n className={\r\n this.props.prices && this.props.prices ? 'label--focused' : ''\r\n }\r\n >\r\n {this.renderLabel()}\r\n </label>\r\n )}\r\n </div>\r\n </InputGroup>\r\n );\r\n }\r\n\r\n private onCurrencyChanged = (\r\n index: number,\r\n currentCurrencies: SelectValue[]\r\n ) => e => {\r\n let newPrices: MoneyWithCurrency[] = [].concat(this.props.prices);\r\n newPrices[index].currency = currentCurrencies.filter(\r\n cc => cc.value.toString() === e.target.value\r\n )[0];\r\n this.props.onPricesChange(newPrices);\r\n };\r\n\r\n private onTheFlightValidate = value => {\r\n let num = Number(value);\r\n const parts = value.split('.');\r\n if (parts && parts.length > 1 && parts[parts.length - 1].length > 2) {\r\n return false;\r\n }\r\n if (!isNaN(num)) {\r\n return true;\r\n }\r\n if (num) {\r\n return false;\r\n }\r\n };\r\n\r\n private onPriceChanged = (index: number) => (\r\n e: React.ChangeEvent<HTMLInputElement>\r\n ) => {\r\n let newPrices: MoneyWithCurrency[] = [].concat(this.props.prices);\r\n let str = e.target.value;\r\n let num = Number(str);\r\n if (!isNaN(num)) {\r\n newPrices[index].value = num;\r\n }\r\n this.props.onPricesChange(newPrices);\r\n if (!this.state.touched) {\r\n this.touch();\r\n }\r\n };\r\n\r\n private removePriceClick = (index: number) => () => {\r\n const newPrices = this.props.prices.filter(\r\n (price, itemIndex) => itemIndex !== index\r\n );\r\n this.props.onPricesChange(newPrices);\r\n if (newPrices.length === 0 && this.props.required) {\r\n this.setInvalid([\r\n this.getTranslations(defaultMoneyTranslations).required,\r\n ]);\r\n }\r\n if (!this.state.touched) {\r\n this.touch();\r\n }\r\n };\r\n\r\n private addPriceClick = (unusedCurrencies: SelectValue[]) => () => {\r\n this.props.onPricesChange(\r\n this.props.prices.concat([{ value: 0, currency: unusedCurrencies[0] }])\r\n );\r\n this.setValid();\r\n if (!this.state.touched) {\r\n this.touch();\r\n }\r\n };\r\n\r\n private onFocus = () => this.setState({ focused: true });\r\n\r\n private onBlur = () => this.setState({ focused: false });\r\n}\r\n\r\nexport const Money = withThemeContext<\r\n MoneyProps,\r\n InstanceType<typeof MoneyRaw>\r\n>(withFormContext<MoneyProps>(MoneyRaw), 'money');\r\n\r\nexport default Money;\r\n"],"file":"Money.js"}
|
1
|
+
{"version":3,"file":"Money.js","names":["PlusIcon","defaultMoneyTranslations","defaultBaseTranslations","cannotRemoveDefaultCurrency","removePrice","addPrice","addNewCurrency","MoneyRaw","BaseInput","constructor","props","index","currentCurrencies","e","newPrices","concat","prices","currency","filter","cc","value","toString","target","onPricesChange","num","Number","parts","split","length","isNaN","str","state","touched","touch","price","itemIndex","required","setInvalid","getTranslations","unusedCurrencies","setValid","setState","focused","currencies","Error","Object","assign","isValid","errors","handleValueChangeEnabled","forcedCurrencies","c","forceSelected","missingForced","find","p","map","undefined","subscribeSelf","render","translations","title","id","getValidationClass","className","containerRef","item","priceCurrency","priceIndex","retComponents","onFocus","onBlur","onCurrencyChanged","label","onTheFlightValidate","onPriceChanged","disableDelete","removePriceClick","Button","defaultProps","buttonProps","allowMultiple","addPriceClick","renderDefaultValidation","renderLabel","type","onChange","Money","withThemeContext","withFormContext"],"sources":["../../../src/lib/components/money/Money.tsx"],"sourcesContent":["import * as PlusIcon from 'material-design-icons/content/svg/production/ic_add_24px.svg';\r\n\r\n// Libs\r\nimport * as React from 'react';\r\n\r\n// Misc\r\nimport { Select, SelectValue } from '../select/Select';\r\nimport { Text } from '../text/Text';\r\nimport InputGroup from '../inputGroup/InputGroup';\r\nimport {\r\n BaseInputProps,\r\n BaseInputState,\r\n BaseInput,\r\n defaultBaseTranslations,\r\n} from '../base/input/BaseInput';\r\nimport { Button } from '../button/Button';\r\nimport { withFormContext } from '../form/withFormContext';\r\nimport { withThemeContext } from '../themeProvider/withThemeContext';\r\n\r\nexport interface MoneyWithCurrency {\r\n value: number;\r\n currency: SelectValue;\r\n}\r\n\r\nexport const defaultMoneyTranslations = {\r\n ...defaultBaseTranslations,\r\n cannotRemoveDefaultCurrency: 'Cannot remove default currency',\r\n removePrice: 'Remove price',\r\n addPrice: 'Add price',\r\n addNewCurrency: 'Add new currency',\r\n};\r\n\r\nexport type MoneyTranslations = Partial<typeof defaultMoneyTranslations>;\r\n\r\nexport interface MoneyProps extends BaseInputProps<never, MoneyTranslations> {\r\n onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;\r\n onPricesChange: (prices: MoneyWithCurrency[]) => void;\r\n allowMultiple?: boolean;\r\n currencies: SelectValue[];\r\n prices: MoneyWithCurrency[];\r\n disableDelete?: boolean;\r\n}\r\n\r\nexport interface MoneyState extends BaseInputState {}\r\n\r\nexport class MoneyRaw extends BaseInput<\r\n MoneyProps,\r\n MoneyState,\r\n never,\r\n MoneyTranslations\r\n> {\r\n public static defaultProps = Object.assign({}, BaseInput.defaultProps, {\r\n type: 'money',\r\n allowMultiple: false,\r\n onChange: undefined,\r\n });\r\n\r\n constructor(props: MoneyProps) {\r\n super(props, false);\r\n if (!props.currencies || !props.currencies.length) {\r\n throw Error('No currencies supplied to money input');\r\n }\r\n this.state = Object.assign(this.state, {\r\n isValid: props.required ? props.prices.length > 0 : true,\r\n errors:\r\n props.required && props.prices.length === 0\r\n ? [this.getTranslations(defaultMoneyTranslations).required]\r\n : [],\r\n handleValueChangeEnabled: false,\r\n });\r\n const forcedCurrencies = props.currencies.filter(c => c.forceSelected);\r\n const missingForced = forcedCurrencies.filter(\r\n c => !props.prices.find(p => p.currency.value === c.value)\r\n );\r\n if (missingForced.length > 0) {\r\n props.onPricesChange(\r\n props.prices.concat(\r\n missingForced.map(c => ({ currency: c, value: undefined }))\r\n )\r\n );\r\n }\r\n this.subscribeSelf(props);\r\n }\r\n\r\n public render() {\r\n let unusedCurrencies = this.props.currencies;\r\n const translations = this.getTranslations(defaultMoneyTranslations);\r\n return (\r\n <InputGroup title={this.props.title}>\r\n <div\r\n {...(this.props.id && { id: this.props.id })}\r\n className={\r\n 'input__base money-input ' +\r\n this.getValidationClass() +\r\n (this.props.className ? ' ' + this.props.className : '')\r\n }\r\n ref={this.containerRef}\r\n >\r\n {this.props.prices &&\r\n this.props.prices.map((item, index) => {\r\n let currentCurrencies = this.props.currencies.filter(\r\n c =>\r\n this.props.prices.filter(\r\n (priceCurrency, priceIndex) =>\r\n priceIndex !== index &&\r\n priceCurrency.currency.value === c.value\r\n ).length === 0\r\n );\r\n const currency = this.props.currencies.find(\r\n c => c.value === item.currency.value\r\n );\r\n let retComponents = currentCurrencies.length ? (\r\n <div key={index}>\r\n {currentCurrencies.length > 1 ? (\r\n <Select\r\n {...(this.props.id && {\r\n id:\r\n this.props.id +\r\n '-currency-select-' +\r\n index.toString(),\r\n })}\r\n onFocus={this.onFocus}\r\n onBlur={this.onBlur}\r\n className={'money-input__select m-0'}\r\n values={currentCurrencies}\r\n onChange={this.onCurrencyChanged(\r\n index,\r\n currentCurrencies\r\n )}\r\n value={item.currency.value.toString()}\r\n />\r\n ) : (\r\n currentCurrencies?.[0]?.label\r\n )}\r\n <Text\r\n {...(this.props.id && {\r\n id: this.props.id + '-amount-input-' + index.toString(),\r\n })}\r\n onFocus={this.onFocus}\r\n onBlur={this.onBlur}\r\n onTheFlightValidate={this.onTheFlightValidate}\r\n placeholder={'0.00'}\r\n className={'money-input__text m-0'}\r\n validators={['number']}\r\n value={item.value ? item.value.toString() : ''}\r\n onChange={this.onPriceChanged(index)}\r\n type=\"number\"\r\n />\r\n {!this.props.disableDelete && this.props.prices.length > 0 && (\r\n <Button\r\n {...(this.props.id && {\r\n id:\r\n this.props.id + '-remove-button-' + index.toString(),\r\n })}\r\n blank={true}\r\n type=\"error\"\r\n onClick={this.removePriceClick(index)}\r\n className=\"transform-rotate--45 line-height--0\"\r\n buttonProps={{\r\n ...Button.defaultProps?.buttonProps,\r\n title:\r\n currency && currency.forceSelected\r\n ? translations.cannotRemoveDefaultCurrency\r\n : translations.removePrice,\r\n }}\r\n circular={true}\r\n disabled={currency && currency.forceSelected}\r\n >\r\n <PlusIcon />\r\n </Button>\r\n )}\r\n </div>\r\n ) : null;\r\n unusedCurrencies = unusedCurrencies.filter(\r\n c => c.value !== item.currency.value\r\n );\r\n return retComponents;\r\n })}\r\n {(this.props.allowMultiple ||\r\n (this.props.prices && !this.props.prices.length)) &&\r\n unusedCurrencies.length ? (\r\n <Button\r\n blank={true}\r\n {...(this.props.id && {\r\n id: this.props.id + '-add-button',\r\n })}\r\n type=\"primary\"\r\n className=\"line-height--0 align-self-start\"\r\n onClick={this.addPriceClick(unusedCurrencies)}\r\n circular={true}\r\n buttonProps={{\r\n ...Button.defaultProps?.buttonProps,\r\n title:\r\n this.props.prices && this.props.prices.length === 0\r\n ? translations.addPrice\r\n : translations.addNewCurrency,\r\n }}\r\n >\r\n <PlusIcon />\r\n </Button>\r\n ) : null}\r\n <span className=\"highlight\" />\r\n <span className={'bar ' + (this.state.focused ? 'focused' : '')} />\r\n {this.renderDefaultValidation()}\r\n {this.props.label && (\r\n <label\r\n className={\r\n this.props.prices && this.props.prices ? 'label--focused' : ''\r\n }\r\n >\r\n {this.renderLabel()}\r\n </label>\r\n )}\r\n </div>\r\n </InputGroup>\r\n );\r\n }\r\n\r\n private onCurrencyChanged = (\r\n index: number,\r\n currentCurrencies: SelectValue[]\r\n ) => e => {\r\n let newPrices: MoneyWithCurrency[] = [].concat(this.props.prices);\r\n newPrices[index].currency = currentCurrencies.filter(\r\n cc => cc.value.toString() === e.target.value\r\n )[0];\r\n this.props.onPricesChange(newPrices);\r\n };\r\n\r\n private onTheFlightValidate = value => {\r\n let num = Number(value);\r\n const parts = value.split('.');\r\n if (parts && parts.length > 1 && parts[parts.length - 1].length > 2) {\r\n return false;\r\n }\r\n if (!isNaN(num)) {\r\n return true;\r\n }\r\n if (num) {\r\n return false;\r\n }\r\n };\r\n\r\n private onPriceChanged = (index: number) => (\r\n e: React.ChangeEvent<HTMLInputElement>\r\n ) => {\r\n let newPrices: MoneyWithCurrency[] = [].concat(this.props.prices);\r\n let str = e.target.value;\r\n let num = Number(str);\r\n if (!isNaN(num)) {\r\n newPrices[index].value = num;\r\n }\r\n this.props.onPricesChange(newPrices);\r\n if (!this.state.touched) {\r\n this.touch();\r\n }\r\n };\r\n\r\n private removePriceClick = (index: number) => () => {\r\n const newPrices = this.props.prices.filter(\r\n (price, itemIndex) => itemIndex !== index\r\n );\r\n this.props.onPricesChange(newPrices);\r\n if (newPrices.length === 0 && this.props.required) {\r\n this.setInvalid([\r\n this.getTranslations(defaultMoneyTranslations).required,\r\n ]);\r\n }\r\n if (!this.state.touched) {\r\n this.touch();\r\n }\r\n };\r\n\r\n private addPriceClick = (unusedCurrencies: SelectValue[]) => () => {\r\n this.props.onPricesChange(\r\n this.props.prices.concat([{ value: 0, currency: unusedCurrencies[0] }])\r\n );\r\n this.setValid();\r\n if (!this.state.touched) {\r\n this.touch();\r\n }\r\n };\r\n\r\n private onFocus = () => this.setState({ focused: true });\r\n\r\n private onBlur = () => this.setState({ focused: false });\r\n}\r\n\r\nexport const Money = withThemeContext<\r\n MoneyProps,\r\n InstanceType<typeof MoneyRaw>\r\n>(withFormContext<MoneyProps>(MoneyRaw), 'money');\r\n\r\nexport default Money;\r\n"],"mappings":";;;;;;;AAGA;;AAGA;;AACA;;AACA;;AACA;;AAMA;;AACA;;AACA;;;;;;;;;;;;;;;;IAjBaA,Q,YAAAA,Q;;;;;;AAAAA,Q;;;;;GAEb;;AAsBO,MAAMC,wBAAwB,mCAChCC,kCADgC;EAEnCC,2BAA2B,EAAE,gCAFM;EAGnCC,WAAW,EAAE,cAHsB;EAInCC,QAAQ,EAAE,WAJyB;EAKnCC,cAAc,EAAE;AALmB,EAA9B;;;;AAqBA,MAAMC,QAAN,SAAuBC,oBAAvB,CAKL;EAOAC,WAAW,CAACC,KAAD,EAAoB;IAC7B,MAAMA,KAAN,EAAa,KAAb;;IAD6B,2CAiKH,CAC1BC,KAD0B,EAE1BC,iBAF0B,KAGvBC,CAAC,IAAI;MACR,IAAIC,SAA8B,GAAG,GAAGC,MAAH,CAAU,KAAKL,KAAL,CAAWM,MAArB,CAArC;MACAF,SAAS,CAACH,KAAD,CAAT,CAAiBM,QAAjB,GAA4BL,iBAAiB,CAACM,MAAlB,CAC1BC,EAAE,IAAIA,EAAE,CAACC,KAAH,CAASC,QAAT,OAAwBR,CAAC,CAACS,MAAF,CAASF,KADb,EAE1B,CAF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tKD;;;;gBALW7E,Q,kBAMkBsC,MAAM,CAACC,MAAP,CAAc,EAAd,EAAkBtC,oBAAA,CAAUuE,YAA5B,EAA0C;EACrEM,IAAI,EAAE,OAD+D;EAErEJ,aAAa,EAAE,KAFsD;EAGrEK,QAAQ,EAAE7B;AAH2D,CAA1C,C;;AA6OxB,MAAM8B,KAAK,GAAG,IAAAC,kCAAA,EAGnB,IAAAC,gCAAA,EAA4BlF,QAA5B,CAHmB,EAGoB,OAHpB,CAAd;;eAKQgF,K"}
|
@@ -1,14 +1,12 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
4
|
-
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
6
4
|
value: true
|
7
5
|
});
|
8
6
|
var _exportNames = {};
|
9
7
|
Object.defineProperty(exports, "default", {
|
10
8
|
enumerable: true,
|
11
|
-
get: function
|
9
|
+
get: function () {
|
12
10
|
return _Money.default;
|
13
11
|
}
|
14
12
|
});
|
@@ -21,13 +19,13 @@ Object.keys(_Money).forEach(function (key) {
|
|
21
19
|
if (key in exports && exports[key] === _Money[key]) return;
|
22
20
|
Object.defineProperty(exports, key, {
|
23
21
|
enumerable: true,
|
24
|
-
get: function
|
22
|
+
get: function () {
|
25
23
|
return _Money[key];
|
26
24
|
}
|
27
25
|
});
|
28
26
|
});
|
29
27
|
|
30
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function
|
28
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
31
29
|
|
32
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null ||
|
30
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
33
31
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/components/money/index.tsx"],"
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/lib/components/money/index.tsx"],"sourcesContent":["export * from './Money';\r\nexport { default } from './Money';\r\n"],"mappings":";;;;;;;;;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|