guestbell-forms 3.0.18 → 3.0.19
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/.babelrc.js +1 -1
- package/build/components/base/input/BaseInput.js +8 -96
- package/build/components/base/input/BaseInput.js.map +1 -1
- package/build/components/base/input/index.js +0 -2
- package/build/components/base/input/index.js.map +1 -1
- package/build/components/bookingCalendar/BookingCalendar.js +7 -30
- package/build/components/bookingCalendar/BookingCalendar.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarControls/BookingCalendarControls.js +2 -22
- package/build/components/bookingCalendar/bookingCalendarControls/BookingCalendarControls.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarControls/classes.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarControls/index.js +0 -4
- package/build/components/bookingCalendar/bookingCalendarControls/index.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarDatePicker/BookingCalendarDatePicker.js +6 -19
- package/build/components/bookingCalendar/bookingCalendarDatePicker/BookingCalendarDatePicker.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarDatePicker/classes.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarDatePicker/index.js +0 -4
- package/build/components/bookingCalendar/bookingCalendarDatePicker/index.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarGrid/BookingCalendarGrid.d.ts +2 -1
- package/build/components/bookingCalendar/bookingCalendarGrid/BookingCalendarGrid.js +11 -10
- package/build/components/bookingCalendar/bookingCalendarGrid/BookingCalendarGrid.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarGrid/classes.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarItem/BookingCalendarItem.js +0 -9
- package/build/components/bookingCalendar/bookingCalendarItem/BookingCalendarItem.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarItem/classes.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarItem/index.js +0 -4
- package/build/components/bookingCalendar/bookingCalendarItem/index.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarLane/BookingCalendarLane.js +0 -10
- package/build/components/bookingCalendar/bookingCalendarLane/BookingCalendarLane.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarLane/classes.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarLane/index.js +0 -4
- package/build/components/bookingCalendar/bookingCalendarLane/index.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarLaneHeader/BookingCalendarLaneHeader.js +0 -7
- package/build/components/bookingCalendar/bookingCalendarLaneHeader/BookingCalendarLaneHeader.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarLaneHeader/classes.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarLaneHeader/index.js +0 -2
- package/build/components/bookingCalendar/bookingCalendarLaneHeader/index.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarLanesHeader/BookingCalendarLanesHeader.js +0 -12
- package/build/components/bookingCalendar/bookingCalendarLanesHeader/BookingCalendarLanesHeader.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarLanesHeader/BookingCalendarLanesHeaderRenderItem.js +0 -9
- package/build/components/bookingCalendar/bookingCalendarLanesHeader/BookingCalendarLanesHeaderRenderItem.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarLanesHeader/classes.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarLanesHeader/index.js +0 -4
- package/build/components/bookingCalendar/bookingCalendarLanesHeader/index.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarRenderItem/BookingCalendarRenderItem.js +0 -9
- package/build/components/bookingCalendar/bookingCalendarRenderItem/BookingCalendarRenderItem.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarRenderItem/classes.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarRenderItem/index.js +0 -2
- package/build/components/bookingCalendar/bookingCalendarRenderItem/index.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarSelection/BookingCalendarSelection.js +0 -30
- package/build/components/bookingCalendar/bookingCalendarSelection/BookingCalendarSelection.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarTimeAxis/BookingCalendarTimeAxis.js +0 -7
- package/build/components/bookingCalendar/bookingCalendarTimeAxis/BookingCalendarTimeAxis.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarTimeAxis/classes.js.map +1 -1
- package/build/components/bookingCalendar/classes.js.map +1 -1
- package/build/components/bookingCalendar/common.js +0 -9
- package/build/components/bookingCalendar/common.js.map +1 -1
- package/build/components/bookingCalendar/index.js +0 -6
- package/build/components/bookingCalendar/index.js.map +1 -1
- package/build/components/bookingCalendar/utils.js +5 -50
- package/build/components/bookingCalendar/utils.js.map +1 -1
- package/build/components/button/Button.js +9 -37
- package/build/components/button/Button.js.map +1 -1
- package/build/components/button/index.js +0 -4
- package/build/components/button/index.js.map +1 -1
- package/build/components/checkbox/Checkbox.js +5 -35
- package/build/components/checkbox/Checkbox.js.map +1 -1
- package/build/components/checkbox/index.js +0 -4
- package/build/components/checkbox/index.js.map +1 -1
- package/build/components/dropdown/Dropdown.js +1 -15
- package/build/components/dropdown/Dropdown.js.map +1 -1
- package/build/components/dropdown/index.js +0 -4
- package/build/components/dropdown/index.js.map +1 -1
- package/build/components/dynamicSubmit/DynamicSubmit.js +7 -39
- package/build/components/dynamicSubmit/DynamicSubmit.js.map +1 -1
- package/build/components/dynamicSubmit/index.js +0 -4
- package/build/components/dynamicSubmit/index.js.map +1 -1
- package/build/components/externalValidationComponent/ExternalValidationComponent.js +6 -17
- package/build/components/externalValidationComponent/ExternalValidationComponent.js.map +1 -1
- package/build/components/externalValidationComponent/index.js +0 -4
- package/build/components/externalValidationComponent/index.js.map +1 -1
- package/build/components/form/Form.js +8 -46
- package/build/components/form/Form.js.map +1 -1
- package/build/components/form/FormContext.js +0 -4
- package/build/components/form/FormContext.js.map +1 -1
- package/build/components/form/FormValidationSummary.js +3 -25
- package/build/components/form/FormValidationSummary.js.map +1 -1
- package/build/components/form/index.js +0 -10
- package/build/components/form/index.js.map +1 -1
- package/build/components/form/withFormContext.js +0 -6
- package/build/components/form/withFormContext.js.map +1 -1
- package/build/components/inputGroup/InputGroup.js +5 -15
- package/build/components/inputGroup/InputGroup.js.map +1 -1
- package/build/components/inputGroup/index.js +0 -4
- package/build/components/inputGroup/index.js.map +1 -1
- package/build/components/inputHeader/InputHeader.js +16 -75
- package/build/components/inputHeader/InputHeader.js.map +1 -1
- package/build/components/inputHeader/InputHeaderContext.js +0 -4
- package/build/components/inputHeader/InputHeaderContext.js.map +1 -1
- package/build/components/inputHeader/index.js +0 -4
- package/build/components/inputHeader/index.js.map +1 -1
- package/build/components/inputHeader/withInputHeaderContext.js +0 -6
- package/build/components/inputHeader/withInputHeaderContext.js.map +1 -1
- package/build/components/money/Money.js +20 -64
- package/build/components/money/Money.js.map +1 -1
- package/build/components/money/index.js +0 -4
- package/build/components/money/index.js.map +1 -1
- package/build/components/numberInput/NumberInput.js +13 -44
- package/build/components/numberInput/NumberInput.js.map +1 -1
- package/build/components/numberInput/index.js +0 -4
- package/build/components/numberInput/index.js.map +1 -1
- package/build/components/openingHours/openingHoursDay/OpeningHoursDay.js +13 -62
- package/build/components/openingHours/openingHoursDay/OpeningHoursDay.js.map +1 -1
- package/build/components/openingHours/openingHoursDay/index.js +0 -4
- package/build/components/openingHours/openingHoursDay/index.js.map +1 -1
- package/build/components/openingHours/openingHoursSpecial/OpeningHoursSpecial.js +18 -49
- package/build/components/openingHours/openingHoursSpecial/OpeningHoursSpecial.js.map +1 -1
- package/build/components/openingHours/openingHoursSpecial/index.js +0 -4
- package/build/components/openingHours/openingHoursSpecial/index.js.map +1 -1
- package/build/components/openingHours/openingHoursWeek/OpeningHoursWeek.js +16 -53
- package/build/components/openingHours/openingHoursWeek/OpeningHoursWeek.js.map +1 -1
- package/build/components/openingHours/openingHoursWeek/index.js +0 -4
- package/build/components/openingHours/openingHoursWeek/index.js.map +1 -1
- package/build/components/openingHours/utils/OpeningHoursUtil.js +3 -21
- package/build/components/openingHours/utils/OpeningHoursUtil.js.map +1 -1
- package/build/components/radio/Radio.js +4 -19
- package/build/components/radio/Radio.js.map +1 -1
- package/build/components/radio/index.js +0 -4
- package/build/components/radio/index.js.map +1 -1
- package/build/components/radioContainer/RadioContainer.js +2 -13
- package/build/components/radioContainer/RadioContainer.js.map +1 -1
- package/build/components/radioContainer/index.js +0 -4
- package/build/components/radioContainer/index.js.map +1 -1
- package/build/components/select/Select.js +6 -53
- package/build/components/select/Select.js.map +1 -1
- package/build/components/select/index.js +0 -4
- package/build/components/select/index.js.map +1 -1
- package/build/components/submit/Submit.js +5 -28
- package/build/components/submit/Submit.js.map +1 -1
- package/build/components/submit/index.js +0 -4
- package/build/components/submit/index.js.map +1 -1
- package/build/components/submit/subComponents/SubmitValidationSummary.js +0 -9
- package/build/components/submit/subComponents/SubmitValidationSummary.js.map +1 -1
- package/build/components/tags/Tags.js +34 -119
- package/build/components/tags/Tags.js.map +1 -1
- package/build/components/tags/index.js +0 -4
- package/build/components/tags/index.js.map +1 -1
- package/build/components/tags/subComponents/TagsSuggestions.js +0 -14
- package/build/components/tags/subComponents/TagsSuggestions.js.map +1 -1
- package/build/components/text/Text.js +10 -42
- package/build/components/text/Text.js.map +1 -1
- package/build/components/text/index.js +0 -4
- package/build/components/text/index.js.map +1 -1
- package/build/components/textArea/TextArea.js +8 -31
- package/build/components/textArea/TextArea.js.map +1 -1
- package/build/components/textArea/index.js +0 -4
- package/build/components/textArea/index.js.map +1 -1
- package/build/components/themeProvider/ThemeContext.js +0 -4
- package/build/components/themeProvider/ThemeContext.js.map +1 -1
- package/build/components/themeProvider/ThemeProvider.js +2 -6
- package/build/components/themeProvider/ThemeProvider.js.map +1 -1
- package/build/components/themeProvider/index.js +0 -8
- package/build/components/themeProvider/index.js.map +1 -1
- package/build/components/themeProvider/withThemeContext.js +0 -8
- package/build/components/themeProvider/withThemeContext.js.map +1 -1
- package/build/components/time/Time.js +17 -73
- package/build/components/time/Time.js.map +1 -1
- package/build/components/time/index.js +0 -4
- package/build/components/time/index.js.map +1 -1
- package/build/components/timeSpan/TimeSpan.js +17 -99
- package/build/components/timeSpan/TimeSpan.js.map +1 -1
- package/build/components/timeSpan/index.js +0 -4
- package/build/components/timeSpan/index.js.map +1 -1
- package/build/components/utils/Guid.js +0 -3
- package/build/components/utils/Guid.js.map +1 -1
- package/build/components/utils/ShallowEqual.js +5 -10
- package/build/components/utils/ShallowEqual.js.map +1 -1
- package/build/components/utils/TimeUtil.js +1 -3
- package/build/components/utils/TimeUtil.js.map +1 -1
- package/build/dist/guestbell-forms.css.map +1 -1
- package/build/dist/guestbell-forms.js +21 -84
- package/build/dist/guestbell-forms.js.map +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 +13 -41
- package/build/index.js +0 -48
- package/build/index.js.map +1 -1
- package/build/validators/EmailValidator.js +0 -4
- package/build/validators/EmailValidator.js.map +1 -1
- package/build/validators/LatitudeValidator.js +0 -8
- package/build/validators/LatitudeValidator.js.map +1 -1
- package/build/validators/LongitudeValidator.js +0 -8
- package/build/validators/LongitudeValidator.js.map +1 -1
- package/build/validators/NumberValidator.js +0 -15
- package/build/validators/NumberValidator.js.map +1 -1
- package/build/validators/UrlValidator.js +2 -5
- package/build/validators/UrlValidator.js.map +1 -1
- package/build/validators/index.js +0 -7
- package/build/validators/index.js.map +1 -1
- package/package.json +19 -19
@@ -10,9 +10,7 @@ Object.defineProperty(exports, "default", {
|
|
10
10
|
return _Text.default;
|
11
11
|
}
|
12
12
|
});
|
13
|
-
|
14
13
|
var _Text = _interopRequireWildcard(require("./Text"));
|
15
|
-
|
16
14
|
Object.keys(_Text).forEach(function (key) {
|
17
15
|
if (key === "default" || key === "__esModule") return;
|
18
16
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
@@ -24,8 +22,6 @@ Object.keys(_Text).forEach(function (key) {
|
|
24
22
|
}
|
25
23
|
});
|
26
24
|
});
|
27
|
-
|
28
25
|
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); }
|
29
|
-
|
30
26
|
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
27
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/lib/components/text/index.tsx"],"sourcesContent":["export * from './Text';\r\nexport { default } from './Text';\r\n"],"mappings":"
|
1
|
+
{"version":3,"file":"index.js","names":["_Text","_interopRequireWildcard","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","newObj","hasPropertyDescriptor","getOwnPropertyDescriptor","desc","set"],"sources":["../../../src/lib/components/text/index.tsx"],"sourcesContent":["export * from './Text';\r\nexport { default } from './Text';\r\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAJ,KAAA,EAAAK,OAAA,WAAAC,GA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S,cAAA,CAAAa,MAAA,EAAAnB,GAAA,EAAAsB,IAAA,YAAAH,MAAA,CAAAnB,GAAA,IAAAc,GAAA,CAAAd,GAAA,SAAAmB,MAAA,CAAAH,OAAA,GAAAF,GAAA,MAAAG,KAAA,IAAAA,KAAA,CAAAM,GAAA,CAAAT,GAAA,EAAAK,MAAA,YAAAA,MAAA"}
|
@@ -4,45 +4,27 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.default = exports.TextAreaRaw = exports.TextArea = void 0;
|
7
|
-
|
8
7
|
var React = _interopRequireWildcard(require("react"));
|
9
|
-
|
10
8
|
var _InputGroup = _interopRequireDefault(require("../inputGroup/InputGroup"));
|
11
|
-
|
12
9
|
var _BaseInput = require("../base/input/BaseInput");
|
13
|
-
|
14
10
|
var _withFormContext = require("../form/withFormContext");
|
15
|
-
|
16
11
|
var _TextareaAutosize = _interopRequireDefault(require("@mui/material/TextareaAutosize"));
|
17
|
-
|
18
12
|
var _withThemeContext = require("../themeProvider/withThemeContext");
|
19
|
-
|
20
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
21
|
-
|
22
14
|
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); }
|
23
|
-
|
24
15
|
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; }
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
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; }
|
29
|
-
|
16
|
+
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); } // Libs
|
17
|
+
// Misc
|
30
18
|
class TextAreaRaw extends _BaseInput.BaseInput {
|
31
19
|
constructor(props) {
|
32
20
|
super(props);
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
_defineProperty(this, "onKeyDown", e => this.props.onKeyDown && this.props.onKeyDown(e));
|
37
|
-
|
38
|
-
_defineProperty(this, "elemRef", elem => {
|
21
|
+
this.onKeyDown = e => this.props.onKeyDown && this.props.onKeyDown(e);
|
22
|
+
this.elemRef = elem => {
|
39
23
|
this.elem = elem;
|
40
24
|
this.props.inputRef && this.props.inputRef(elem);
|
41
|
-
}
|
42
|
-
|
43
|
-
_defineProperty(this, "onContainerClick", e => this.props.stopClickPropagation && e.stopPropagation());
|
25
|
+
};
|
26
|
+
this.onContainerClick = e => this.props.stopClickPropagation && e.stopPropagation();
|
44
27
|
}
|
45
|
-
|
46
28
|
render() {
|
47
29
|
return /*#__PURE__*/React.createElement(_InputGroup.default, {
|
48
30
|
title: this.props.title,
|
@@ -77,22 +59,17 @@ class TextAreaRaw extends _BaseInput.BaseInput {
|
|
77
59
|
className: "bar"
|
78
60
|
}), this.renderDefaultValidation(), this.props.label && /*#__PURE__*/React.createElement("label", null, this.renderLabel())));
|
79
61
|
}
|
80
|
-
|
81
62
|
focus() {
|
82
63
|
this.elem && this.elem.focus();
|
83
64
|
}
|
84
|
-
|
85
65
|
}
|
86
|
-
|
87
66
|
exports.TextAreaRaw = TextAreaRaw;
|
88
|
-
|
89
|
-
_defineProperty(TextAreaRaw, "defaultProps", Object.assign({}, _BaseInput.BaseInput.defaultProps, {
|
67
|
+
TextAreaRaw.defaultProps = Object.assign({}, _BaseInput.BaseInput.defaultProps, {
|
90
68
|
type: 'text',
|
91
69
|
placeholder: '',
|
92
70
|
stopClickPropagation: true,
|
93
71
|
readOnly: false
|
94
|
-
})
|
95
|
-
|
72
|
+
});
|
96
73
|
const TextArea = (0, _withThemeContext.withThemeContext)((0, _withFormContext.withFormContext)(TextAreaRaw), 'textArea');
|
97
74
|
exports.TextArea = TextArea;
|
98
75
|
var _default = TextArea;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"TextArea.js","names":["TextAreaRaw","BaseInput","constructor","props","e","
|
1
|
+
{"version":3,"file":"TextArea.js","names":["React","_interopRequireWildcard","require","_InputGroup","_interopRequireDefault","_BaseInput","_withFormContext","_TextareaAutosize","_withThemeContext","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","TextAreaRaw","BaseInput","constructor","props","onKeyDown","e","elemRef","elem","inputRef","onContainerClick","stopClickPropagation","stopPropagation","render","createElement","title","className","inputGroupClassName","tooltip","getValidationClass","readOnly","onClick","ref","containerRef","id","placeholder","disabled","getDisabled","required","state","value","onChange","handleChange","onBlur","handleBlur","onFocus","handleFocus","minRows","maxRows","maxLength","renderDefaultValidation","label","renderLabel","focus","exports","defaultProps","type","TextArea","withThemeContext","withFormContext","_default"],"sources":["../../../src/lib/components/textArea/TextArea.tsx"],"sourcesContent":["// Libs\r\nimport * as React from 'react';\r\n\r\n// Misc\r\nimport InputGroup from '../inputGroup/InputGroup';\r\nimport {\r\n BaseInputProps,\r\n BaseInputState,\r\n BaseInput,\r\n} from '../base/input/BaseInput';\r\nimport { withFormContext } from '../form/withFormContext';\r\nimport TextareaAutosize from '@mui/material/TextareaAutosize';\r\nimport { withThemeContext } from '../themeProvider/withThemeContext';\r\n\r\nexport interface TextAreaProps extends BaseInputProps<HTMLTextAreaElement> {\r\n mask?: string;\r\n reverse?: boolean;\r\n placeholder?: string;\r\n stopClickPropagation?: boolean;\r\n inputRef?: (input: HTMLTextAreaElement) => void;\r\n readOnly?: boolean;\r\n type?: 'number' | 'text';\r\n minRows?: number;\r\n maxRows?: number;\r\n maxLength?: number;\r\n}\r\n\r\nexport interface TextAreaState extends BaseInputState {}\r\n\r\nexport class TextAreaRaw extends BaseInput<\r\n TextAreaProps,\r\n TextAreaState,\r\n HTMLTextAreaElement\r\n> {\r\n public static defaultProps = (Object.assign({}, BaseInput.defaultProps, {\r\n type: 'text',\r\n placeholder: '',\r\n stopClickPropagation: true,\r\n readOnly: false,\r\n }) as unknown) as TextAreaProps;\r\n private elem: HTMLTextAreaElement;\r\n\r\n constructor(props: TextAreaProps) {\r\n super(props);\r\n }\r\n\r\n public render() {\r\n return (\r\n <InputGroup\r\n title={this.props.title}\r\n className={this.props.inputGroupClassName}\r\n tooltip={this.props.tooltip}\r\n >\r\n <div\r\n className={`input__base textArea-input ${this.getValidationClass()} \r\n ${this.props.readOnly ? 'textArea-input--readOnly' : ''} \r\n ${this.props.className ? this.props.className : ''}`}\r\n onClick={this.onContainerClick}\r\n ref={this.containerRef}\r\n >\r\n <TextareaAutosize\r\n {...(this.props.id && {\r\n id: this.props.id,\r\n })}\r\n ref={this.elemRef}\r\n placeholder={this.props.placeholder}\r\n disabled={this.getDisabled()}\r\n required={this.props.required}\r\n className={this.state.value ? 'filled' : ''}\r\n onChange={this.handleChange}\r\n value={this.state.value}\r\n onBlur={this.handleBlur}\r\n onFocus={this.handleFocus}\r\n readOnly={this.props.readOnly}\r\n onKeyDown={this.onKeyDown}\r\n minRows={this.props.minRows}\r\n maxRows={this.props.maxRows}\r\n maxLength={this.props.maxLength}\r\n />\r\n <span className=\"highlight\" />\r\n <span className=\"bar\" />\r\n {this.renderDefaultValidation()}\r\n {this.props.label && <label>{this.renderLabel()}</label>}\r\n </div>\r\n </InputGroup>\r\n );\r\n }\r\n\r\n public focus() {\r\n this.elem && this.elem.focus();\r\n }\r\n\r\n private onKeyDown = e => this.props.onKeyDown && this.props.onKeyDown(e);\r\n\r\n private elemRef = (elem: HTMLTextAreaElement) => {\r\n this.elem = elem;\r\n this.props.inputRef && this.props.inputRef(elem);\r\n };\r\n\r\n private onContainerClick = e =>\r\n this.props.stopClickPropagation && e.stopPropagation();\r\n}\r\n\r\nexport const TextArea = withThemeContext<\r\n TextAreaProps,\r\n InstanceType<typeof TextAreaRaw>\r\n>(withFormContext<TextAreaProps>(TextAreaRaw), 'textArea');\r\n\r\nexport default TextArea;\r\n"],"mappings":";;;;;;AACA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAGA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AAKA,IAAAI,gBAAA,GAAAJ,OAAA;AACA,IAAAK,iBAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,iBAAA,GAAAN,OAAA;AAAqE,SAAAE,uBAAAK,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAZ,wBAAAQ,GAAA,EAAAI,WAAA,SAAAA,WAAA,IAAAJ,GAAA,IAAAA,GA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AWF;AAACC,OAAA,CAAA3C,WAAA,GAAAA,WAAA;AAxEYA,WAAW,CAKR4C,YAAY,GAAI9D,MAAM,CAACU,MAAM,CAAC,CAAC,CAAC,EAAES,oBAAS,CAAC2C,YAAY,EAAE;EACtEC,IAAI,EAAE,MAAM;EACZrB,WAAW,EAAE,EAAE;EACfd,oBAAoB,EAAE,IAAI;EAC1BS,QAAQ,EAAE;AACZ,CAAC,CAAC;AAgEG,MAAM2B,QAAQ,GAAG,IAAAC,kCAAgB,EAGtC,IAAAC,gCAAe,EAAgBhD,WAAW,CAAC,EAAE,UAAU,CAAC;AAAC2C,OAAA,CAAAG,QAAA,GAAAA,QAAA;AAAA,IAAAG,QAAA,GAE5CH,QAAQ;AAAAH,OAAA,CAAAxE,OAAA,GAAA8E,QAAA"}
|
@@ -10,9 +10,7 @@ Object.defineProperty(exports, "default", {
|
|
10
10
|
return _TextArea.default;
|
11
11
|
}
|
12
12
|
});
|
13
|
-
|
14
13
|
var _TextArea = _interopRequireWildcard(require("./TextArea"));
|
15
|
-
|
16
14
|
Object.keys(_TextArea).forEach(function (key) {
|
17
15
|
if (key === "default" || key === "__esModule") return;
|
18
16
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
@@ -24,8 +22,6 @@ Object.keys(_TextArea).forEach(function (key) {
|
|
24
22
|
}
|
25
23
|
});
|
26
24
|
});
|
27
|
-
|
28
25
|
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); }
|
29
|
-
|
30
26
|
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
27
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/lib/components/textArea/index.tsx"],"sourcesContent":["export * from './TextArea';\r\nexport { default } from './TextArea';\r\n"],"mappings":"
|
1
|
+
{"version":3,"file":"index.js","names":["_TextArea","_interopRequireWildcard","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","newObj","hasPropertyDescriptor","getOwnPropertyDescriptor","desc","set"],"sources":["../../../src/lib/components/textArea/index.tsx"],"sourcesContent":["export * from './TextArea';\r\nexport { default } from './TextArea';\r\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,SAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAJ,SAAA,EAAAK,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAN,SAAA,CAAAM,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAd,SAAA,CAAAM,GAAA;IAAA;EAAA;AAAA;AAA2B,SAAAS,y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
var React = _interopRequireWildcard(require("react"));
|
9
|
-
|
10
8
|
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); }
|
11
|
-
|
12
9
|
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; }
|
13
|
-
|
14
10
|
const ThemeContext = /*#__PURE__*/React.createContext(undefined);
|
15
11
|
const ThemeContextProvider = ThemeContext.Provider;
|
16
12
|
exports.ThemeContextProvider = ThemeContextProvider;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ThemeContext.js","names":["
|
1
|
+
{"version":3,"file":"ThemeContext.js","names":["React","_interopRequireWildcard","require","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ThemeContext","createContext","undefined","ThemeContextProvider","Provider","exports","ThemeContextConsumer","Consumer"],"sources":["../../../src/lib/components/themeProvider/ThemeContext.ts"],"sourcesContent":["import * as React from 'react';\r\nimport { PartialBy } from '../utils/Typescript';\r\nimport { Theme } from '../../types/Theme';\r\n\r\nexport type OmitThemeContext<P extends ThemeContextProps> = PartialBy<\r\n P,\r\n 'theme'\r\n>;\r\n\r\nexport interface ThemeContextProps {\r\n theme?: Theme;\r\n}\r\n\r\nconst ThemeContext = React.createContext<Theme | undefined>(undefined);\r\nexport const ThemeContextProvider = ThemeContext.Provider;\r\nexport const ThemeContextConsumer = ThemeContext.Consumer;\r\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAA+B,SAAAC,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAH,wBAAAO,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CAAAC,cAAA,CAAAH,MAAA,EAAAK,GAAA,EAAAI,IAAA,YAAAT,MAAA,CAAAK,GAAA,IAAAX,GAAA,CAAAW,GAAA,SAAAL,MAAA,CAAAJ,OAAA,GAAAF,GAAA,MAAAG,KAAA,IAAAA,KAAA,CAAAa,GAAA,CAAAhB,GAAA,EAAAM,MAAA,YAAAA,MAAA;AAa/B,MAAMW,YAAY,gBAAGzB,KAAK,CAAC0B,aAAa,CAAoBC,SAAS,CAAC;AAC/D,MAAMC,oBAAoB,GAAGH,YAAY,CAACI,QAAQ;AAACC,OAAA,CAAAF,oBAAA,GAAAA,oBAAA;AACnD,MAAMG,oBAAoB,GAAGN,YAAY,CAACO,QAAQ;AAACF,OAAA,CAAAC,oBAAA,GAAAA,oBAAA"}
|
@@ -4,23 +4,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.default = exports.ThemeProvider = void 0;
|
7
|
-
|
8
7
|
var React = _interopRequireWildcard(require("react"));
|
9
|
-
|
10
8
|
var _ThemeContext = require("./ThemeContext");
|
11
|
-
|
12
9
|
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); }
|
13
|
-
|
14
10
|
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; }
|
15
|
-
|
16
11
|
// Libs
|
12
|
+
|
17
13
|
// Misc
|
14
|
+
|
18
15
|
const ThemeProvider = props => {
|
19
16
|
return /*#__PURE__*/React.createElement(_ThemeContext.ThemeContextProvider, {
|
20
17
|
value: props.theme
|
21
18
|
}, props.children);
|
22
19
|
};
|
23
|
-
|
24
20
|
exports.ThemeProvider = ThemeProvider;
|
25
21
|
var _default = ThemeProvider;
|
26
22
|
exports.default = _default;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ThemeProvider.js","names":["ThemeProvider","props","theme","children"],"sources":["../../../src/lib/components/themeProvider/ThemeProvider.tsx"],"sourcesContent":["// Libs\r\nimport * as React from 'react';\r\nimport { Theme } from '../../types/Theme';\r\n\r\n// Misc\r\nimport { ThemeContextProvider } from './ThemeContext';\r\n\r\nexport interface ThemeProviderProps {\r\n theme: Theme;\r\n}\r\n\r\nexport const ThemeProvider: React.FC<ThemeProviderProps> = props => {\r\n return (\r\n <ThemeContextProvider value={props.theme}>\r\n {props.children}\r\n </ThemeContextProvider>\r\n );\r\n};\r\n\r\nexport default ThemeProvider;\r\n"],"mappings":"
|
1
|
+
{"version":3,"file":"ThemeProvider.js","names":["React","_interopRequireWildcard","require","_ThemeContext","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ThemeProvider","props","createElement","ThemeContextProvider","value","theme","children","exports","_default"],"sources":["../../../src/lib/components/themeProvider/ThemeProvider.tsx"],"sourcesContent":["// Libs\r\nimport * as React from 'react';\r\nimport { Theme } from '../../types/Theme';\r\n\r\n// Misc\r\nimport { ThemeContextProvider } from './ThemeContext';\r\n\r\nexport interface ThemeProviderProps {\r\n theme: Theme;\r\n}\r\n\r\nexport const ThemeProvider: React.FC<ThemeProviderProps> = props => {\r\n return (\r\n <ThemeContextProvider value={props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AAA,EAAAM,MAAA,YAAAA,MAAA;AALrD;;AAID;;AAOO,MAAMW,aAA2C,GAAGC,KAAK,IAAI;EAClE,oBACE3B,KAAA,CAAA4B,aAAA,CAACzB,aAAA,CAAA0B,oBAAoB;IAACC,KAAK,EAAEH,KAAK,CAACI;EAAM,GACtCJ,KAAK,CAACK,QACa,CAAC;AAE3B,CAAC;AAACC,OAAA,CAAAP,aAAA,GAAAA,aAAA;AAAA,IAAAQ,QAAA,GAEaR,aAAa;AAAAO,OAAA,CAAAtB,OAAA,GAAAuB,QAAA"}
|
@@ -10,9 +10,7 @@ Object.defineProperty(exports, "default", {
|
|
10
10
|
return _ThemeProvider.default;
|
11
11
|
}
|
12
12
|
});
|
13
|
-
|
14
13
|
var _ThemeContext = require("./ThemeContext");
|
15
|
-
|
16
14
|
Object.keys(_ThemeContext).forEach(function (key) {
|
17
15
|
if (key === "default" || key === "__esModule") return;
|
18
16
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
@@ -24,9 +22,7 @@ Object.keys(_ThemeContext).forEach(function (key) {
|
|
24
22
|
}
|
25
23
|
});
|
26
24
|
});
|
27
|
-
|
28
25
|
var _withThemeContext = require("./withThemeContext");
|
29
|
-
|
30
26
|
Object.keys(_withThemeContext).forEach(function (key) {
|
31
27
|
if (key === "default" || key === "__esModule") return;
|
32
28
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
@@ -38,9 +34,7 @@ Object.keys(_withThemeContext).forEach(function (key) {
|
|
38
34
|
}
|
39
35
|
});
|
40
36
|
});
|
41
|
-
|
42
37
|
var _ThemeProvider = _interopRequireWildcard(require("./ThemeProvider"));
|
43
|
-
|
44
38
|
Object.keys(_ThemeProvider).forEach(function (key) {
|
45
39
|
if (key === "default" || key === "__esModule") return;
|
46
40
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
@@ -52,8 +46,6 @@ Object.keys(_ThemeProvider).forEach(function (key) {
|
|
52
46
|
}
|
53
47
|
});
|
54
48
|
});
|
55
|
-
|
56
49
|
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); }
|
57
|
-
|
58
50
|
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; }
|
59
51
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/lib/components/themeProvider/index.tsx"],"sourcesContent":["export * from './ThemeContext';\r\nexport * from './withThemeContext';\r\nexport * from './ThemeProvider';\r\nexport { default } from './ThemeProvider';\r\n"],"mappings":"
|
1
|
+
{"version":3,"file":"index.js","names":["_ThemeContext","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_withThemeContext","_ThemeProvider","_interopRequireWildcard","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","newObj","hasPropertyDescriptor","getOwnPropertyDescriptor","desc","set"],"sources":["../../../src/lib/components/themeProvider/index.tsx"],"sourcesContent":["export * from './ThemeContext';\r\nexport * from './withThemeContext';\r\nexport * from './ThemeProvider';\r\nexport { default } from './Them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GAAA,CAAAT,GAAA,EAAAK,MAAA,YAAAA,MAAA"}
|
@@ -4,23 +4,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.withThemeContext = withThemeContext;
|
7
|
-
|
8
7
|
var React = _interopRequireWildcard(require("react"));
|
9
|
-
|
10
8
|
var _ThemeContext = require("./ThemeContext");
|
11
|
-
|
12
9
|
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); }
|
13
|
-
|
14
10
|
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; }
|
15
|
-
|
16
11
|
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); }
|
17
|
-
|
18
12
|
const getOverrideProps = (theme, key) => {
|
19
13
|
var _theme$overrides, _theme$overrides$key;
|
20
|
-
|
21
14
|
return key && (theme === null || theme === void 0 ? void 0 : (_theme$overrides = theme.overrides) === null || _theme$overrides === void 0 ? void 0 : (_theme$overrides$key = _theme$overrides[key]) === null || _theme$overrides$key === void 0 ? void 0 : _theme$overrides$key.props);
|
22
15
|
};
|
23
|
-
|
24
16
|
function withThemeContext(Component, componentName) {
|
25
17
|
const WithThemeContext = /*#__PURE__*/React.forwardRef((props, ref) => {
|
26
18
|
return /*#__PURE__*/React.createElement(_ThemeContext.ThemeContextConsumer, null, value => /*#__PURE__*/React.createElement(Component, _extends({
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"withThemeContext.js","names":["getOverrideProps","theme","key","overrides","props","withThemeContext","Component","componentName","WithThemeContext","
|
1
|
+
{"version":3,"file":"withThemeContext.js","names":["React","_interopRequireWildcard","require","_ThemeContext","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","getOverrideProps","theme","_theme$overrides","_theme$overrides$key","overrides","props","withThemeContext","Component","componentName","WithThemeContext","forwardRef","ref","createElement","ThemeContextConsumer","value"],"sources":["../../../src/lib/components/themeProvider/withThemeContext.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport { ThemeContextConsumer, ThemeContextProps } from './ThemeContext';\r\nimport { ThemeOverrides } from '../../types/ThemeOverrides';\r\nimport { Theme } from '../../types/Theme';\r\n\r\nconst getOverrideProps = (theme: Theme, key: keyof ThemeOverrides) =>\r\n key && theme?.overrides?.[key]?.props;\r\n\r\nexport function withThemeContext<P extends ThemeContextProps, ComponentType>(\r\n Component: React.ForwardRefExoticComponent<P> | React.ComponentType<P>,\r\n componentName?: keyof ThemeOverrides\r\n): React.ForwardRefExoticComponent<\r\n React.PropsWithoutRef<P> & React.RefAttributes<ComponentType>\r\n> {\r\n const WithThemeContext = React.forwardRef<ComponentType, P>((props, ref) => {\r\n return (\r\n <ThemeContextConsumer>\r\n {value => (\r\n <Component\r\n ref={ref}\r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AC,CAAC;EACF,OAAOL,gBAAgB;AACzB"}
|
@@ -4,143 +4,104 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.default = exports.TimeRaw = exports.Time = void 0;
|
7
|
-
|
8
7
|
var React = _interopRequireWildcard(require("react"));
|
9
|
-
|
10
8
|
var _InputGroup = _interopRequireDefault(require("../inputGroup/InputGroup"));
|
11
|
-
|
12
9
|
var _BaseInput = require("../base/input/BaseInput");
|
13
|
-
|
14
10
|
var _withFormContext = require("../form/withFormContext");
|
15
|
-
|
16
11
|
var _TimeUtil = _interopRequireDefault(require("../utils/TimeUtil"));
|
17
|
-
|
18
12
|
var _moment = require("moment");
|
19
|
-
|
20
13
|
var _withThemeContext = require("../themeProvider/withThemeContext");
|
21
|
-
|
22
14
|
var _classnames = _interopRequireDefault(require("classnames"));
|
23
|
-
|
24
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
25
|
-
|
26
16
|
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); }
|
27
|
-
|
28
17
|
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; }
|
29
|
-
|
30
18
|
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); }
|
31
|
-
|
32
|
-
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; }
|
33
|
-
|
34
19
|
var ArrowIcon = function ArrowIcon(props) {
|
35
20
|
return /*#__PURE__*/React.createElement("svg", props, /*#__PURE__*/React.createElement("path", {
|
36
21
|
d: "M7.41 7.84L12 12.42l4.59-4.58L18 9.25l-6 6-6-6z"
|
37
22
|
}));
|
38
23
|
};
|
39
|
-
|
40
24
|
ArrowIcon.defaultProps = {
|
41
25
|
xmlns: "http://www.w3.org/2000/svg",
|
42
26
|
width: "24",
|
43
27
|
height: "24",
|
44
28
|
viewBox: "0 0 24 24"
|
45
29
|
}; // Libs
|
46
|
-
|
30
|
+
// Misc
|
47
31
|
class TimeRaw extends _BaseInput.BaseInput {
|
48
32
|
constructor(props) {
|
49
33
|
super(props);
|
50
|
-
|
51
|
-
_defineProperty(this, "onBlur", () => {
|
34
|
+
this.onBlur = () => {
|
52
35
|
if (this.state.hoursText) {
|
53
36
|
this.handleHoursChange(this.state.hoursText);
|
54
37
|
}
|
55
|
-
|
56
38
|
if (this.state.minutesText) {
|
57
39
|
this.handleMinutesChange(this.state.minutesText);
|
58
40
|
}
|
59
|
-
|
60
41
|
this.setState({
|
61
42
|
minutesText: undefined,
|
62
43
|
hoursText: undefined
|
63
44
|
}, () => this.handleBlur());
|
64
|
-
}
|
65
|
-
|
66
|
-
_defineProperty(this, "onMinutesChanged", e => {
|
45
|
+
};
|
46
|
+
this.onMinutesChanged = e => {
|
67
47
|
// this.handleMinutesChange(e.target.value);
|
68
48
|
this.setState({
|
69
49
|
minutesText: e.target.value
|
70
50
|
});
|
71
|
-
}
|
72
|
-
|
73
|
-
_defineProperty(this, "removeMinuteClick", e => {
|
51
|
+
};
|
52
|
+
this.removeMinuteClick = e => {
|
74
53
|
var _this$props$time, _this$props$time$minu;
|
75
|
-
|
76
54
|
e.preventDefault();
|
77
55
|
this.handleMinutesChange(((((_this$props$time = this.props.time) === null || _this$props$time === void 0 ? void 0 : (_this$props$time$minu = _this$props$time.minutes) === null || _this$props$time$minu === void 0 ? void 0 : _this$props$time$minu.call(_this$props$time)) ?? 0) - 1).toString());
|
78
|
-
}
|
79
|
-
|
80
|
-
_defineProperty(this, "addMinuteClick", e => {
|
56
|
+
};
|
57
|
+
this.addMinuteClick = e => {
|
81
58
|
var _this$props$time2, _this$props$time2$min;
|
82
|
-
|
83
59
|
e.preventDefault();
|
84
60
|
this.handleMinutesChange(((((_this$props$time2 = this.props.time) === null || _this$props$time2 === void 0 ? void 0 : (_this$props$time2$min = _this$props$time2.minutes) === null || _this$props$time2$min === void 0 ? void 0 : _this$props$time2$min.call(_this$props$time2)) ?? 0) + 1).toString());
|
85
|
-
}
|
86
|
-
|
87
|
-
_defineProperty(this, "removeHourClick", e => {
|
61
|
+
};
|
62
|
+
this.removeHourClick = e => {
|
88
63
|
var _this$props$time3, _this$props$time3$hou;
|
89
|
-
|
90
64
|
e.preventDefault();
|
91
65
|
this.handleHoursChange(((((_this$props$time3 = this.props.time) === null || _this$props$time3 === void 0 ? void 0 : (_this$props$time3$hou = _this$props$time3.hours) === null || _this$props$time3$hou === void 0 ? void 0 : _this$props$time3$hou.call(_this$props$time3)) ?? 0) - 1).toString());
|
92
|
-
}
|
93
|
-
|
94
|
-
_defineProperty(this, "onHoursChanged", e => {
|
66
|
+
};
|
67
|
+
this.onHoursChanged = e => {
|
95
68
|
// this.handleHoursChange(e.target.value);
|
96
69
|
this.setState({
|
97
70
|
hoursText: e.target.value
|
98
71
|
});
|
99
|
-
}
|
100
|
-
|
101
|
-
_defineProperty(this, "addHourClick", e => {
|
72
|
+
};
|
73
|
+
this.addHourClick = e => {
|
102
74
|
var _this$props$time4, _this$props$time4$hou;
|
103
|
-
|
104
75
|
e.preventDefault();
|
105
76
|
this.handleHoursChange(((((_this$props$time4 = this.props.time) === null || _this$props$time4 === void 0 ? void 0 : (_this$props$time4$hou = _this$props$time4.hours) === null || _this$props$time4$hou === void 0 ? void 0 : _this$props$time4$hou.call(_this$props$time4)) ?? 0) + 1).toString());
|
106
|
-
}
|
107
|
-
|
77
|
+
};
|
108
78
|
this.handleHoursChange = this.handleHoursChange.bind(this);
|
109
79
|
this.handleMinutesChange = this.handleMinutesChange.bind(this);
|
110
80
|
}
|
111
|
-
|
112
81
|
render() {
|
113
82
|
var _this$props$time5, _this$props$time5$hou, _this$props$time6, _this$props$time6$min;
|
114
|
-
|
115
83
|
let hours = ((_this$props$time5 = this.props.time) === null || _this$props$time5 === void 0 ? void 0 : (_this$props$time5$hou = _this$props$time5.hours) === null || _this$props$time5$hou === void 0 ? void 0 : _this$props$time5$hou.call(_this$props$time5)) ?? 0;
|
116
84
|
let minutes = ((_this$props$time6 = this.props.time) === null || _this$props$time6 === void 0 ? void 0 : (_this$props$time6$min = _this$props$time6.minutes) === null || _this$props$time6$min === void 0 ? void 0 : _this$props$time6$min.call(_this$props$time6)) ?? 0;
|
117
|
-
|
118
85
|
if (minutes < 0) {
|
119
86
|
hours--;
|
120
87
|
}
|
121
|
-
|
122
88
|
minutes = (minutes + 60) % 60;
|
123
89
|
hours = (hours + 24) % 24;
|
124
90
|
var mid = 'AM';
|
125
|
-
|
126
91
|
if (hours % 24 >= 12) {
|
127
92
|
hours = hours % 12;
|
128
93
|
mid = 'PM';
|
129
94
|
}
|
130
|
-
|
131
95
|
if (hours % 12 === 0) {
|
132
96
|
// At 00 hours we need to show 12 am
|
133
97
|
hours = 12;
|
134
98
|
}
|
135
|
-
|
136
99
|
if (this.props.showDateDiff && this.props.min) {
|
137
100
|
const diffDays = _TimeUtil.default.dayDiff(this.props.min, this.props.time);
|
138
|
-
|
139
101
|
if (diffDays > 0) {
|
140
102
|
mid += ' +' + diffDays.toString();
|
141
103
|
}
|
142
104
|
}
|
143
|
-
|
144
105
|
return /*#__PURE__*/React.createElement(_InputGroup.default, {
|
145
106
|
title: this.props.title,
|
146
107
|
tooltip: this.props.tooltip,
|
@@ -228,68 +189,51 @@ class TimeRaw extends _BaseInput.BaseInput {
|
|
228
189
|
className: (0, _classnames.default)('time-input__label label--focused')
|
229
190
|
}, this.renderLabel())));
|
230
191
|
}
|
231
|
-
|
232
192
|
handleLimits(time) {
|
233
193
|
if (this.props.min) {
|
234
194
|
var _time$asMilliseconds;
|
235
|
-
|
236
195
|
if (((time === null || time === void 0 ? void 0 : (_time$asMilliseconds = time.asMilliseconds) === null || _time$asMilliseconds === void 0 ? void 0 : _time$asMilliseconds.call(time)) ?? 0) - this.props.min.asMilliseconds() <= 0) {
|
237
196
|
this.props.timeChange(this.props.min.clone());
|
238
197
|
return;
|
239
198
|
}
|
240
199
|
}
|
241
|
-
|
242
200
|
if (this.props.max) {
|
243
201
|
var _time$asMilliseconds2;
|
244
|
-
|
245
202
|
if (this.props.max.asMilliseconds() - ((time === null || time === void 0 ? void 0 : (_time$asMilliseconds2 = time.asMilliseconds) === null || _time$asMilliseconds2 === void 0 ? void 0 : _time$asMilliseconds2.call(time)) ?? 0) <= 0) {
|
246
203
|
this.props.timeChange(this.props.max.clone());
|
247
204
|
return;
|
248
205
|
}
|
249
206
|
}
|
250
|
-
|
251
207
|
this.props.timeChange(time);
|
252
208
|
}
|
253
|
-
|
254
209
|
handleHoursChange(hoursString) {
|
255
210
|
let num = Number(hoursString);
|
256
|
-
|
257
211
|
if (hoursString === '') {
|
258
212
|
num = 0;
|
259
213
|
}
|
260
|
-
|
261
214
|
if (!isNaN(num)) {
|
262
215
|
var _this$props$time7, _this$props$time7$asM, _this$props$time8, _this$props$time8$hou;
|
263
|
-
|
264
216
|
let newTime = (0, _moment.duration)(((_this$props$time7 = this.props.time) === null || _this$props$time7 === void 0 ? void 0 : (_this$props$time7$asM = _this$props$time7.asMilliseconds) === null || _this$props$time7$asM === void 0 ? void 0 : _this$props$time7$asM.call(_this$props$time7)) ?? 0, 'milliseconds').subtract(((_this$props$time8 = this.props.time) === null || _this$props$time8 === void 0 ? void 0 : (_this$props$time8$hou = _this$props$time8.hours) === null || _this$props$time8$hou === void 0 ? void 0 : _this$props$time8$hou.call(_this$props$time8)) ?? 0, 'hours').add(num, 'hours');
|
265
217
|
this.handleLimits(newTime);
|
266
218
|
}
|
267
219
|
}
|
268
|
-
|
269
220
|
handleMinutesChange(minutesString) {
|
270
221
|
let num = Number(minutesString);
|
271
|
-
|
272
222
|
if (minutesString === '') {
|
273
223
|
num = 0;
|
274
224
|
}
|
275
|
-
|
276
225
|
if (!isNaN(num)) {
|
277
226
|
var _this$props$time9, _this$props$time9$asM, _this$props$time10, _this$props$time10$mi;
|
278
|
-
|
279
227
|
let newTime = (0, _moment.duration)(((_this$props$time9 = this.props.time) === null || _this$props$time9 === void 0 ? void 0 : (_this$props$time9$asM = _this$props$time9.asMilliseconds) === null || _this$props$time9$asM === void 0 ? void 0 : _this$props$time9$asM.call(_this$props$time9)) ?? 0, 'milliseconds').subtract(((_this$props$time10 = this.props.time) === null || _this$props$time10 === void 0 ? void 0 : (_this$props$time10$mi = _this$props$time10.minutes) === null || _this$props$time10$mi === void 0 ? void 0 : _this$props$time10$mi.call(_this$props$time10)) ?? 0, 'minutes').add(num, 'minutes');
|
280
228
|
this.handleLimits(newTime);
|
281
229
|
}
|
282
230
|
}
|
283
|
-
|
284
231
|
}
|
285
|
-
|
286
232
|
exports.TimeRaw = TimeRaw;
|
287
|
-
|
288
|
-
_defineProperty(TimeRaw, "defaultProps", Object.assign({}, _BaseInput.BaseInput.defaultProps, {
|
233
|
+
TimeRaw.defaultProps = Object.assign({}, _BaseInput.BaseInput.defaultProps, {
|
289
234
|
type: 'time',
|
290
235
|
placeholder: ''
|
291
|
-
})
|
292
|
-
|
236
|
+
});
|
293
237
|
const Time = (0, _withThemeContext.withThemeContext)((0, _withFormContext.withFormContext)(TimeRaw), 'time');
|
294
238
|
exports.Time = Time;
|
295
239
|
var _default = Time;
|