@coveord/plasma-mantine
Version:
A Plasma flavoured Mantine theme
64 lines (63 loc) • 2.69 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "EditableDateRangePicker", {
enumerable: true,
get: function() {
return EditableDateRangePicker;
}
});
var _interop_require_default = require("@swc/helpers/_/_interop_require_default");
var _object_spread = require("@swc/helpers/_/_object_spread");
var _jsxruntime = require("react/jsx-runtime");
var _dates = require("@mantine/dates");
var _dayjs = /*#__PURE__*/ _interop_require_default._(require("dayjs"));
var EditableDateRangePicker = function EditableDateRangePicker(param) {
var value = param.value, onChange = param.onChange, onFocus = param.onFocus, _param_startProps = param.startProps, startProps = _param_startProps === void 0 ? {} : _param_startProps, _param_endProps = param.endProps, endProps = _param_endProps === void 0 ? {} : _param_endProps;
var onChangeStart = function onChangeStart(date) {
onChange === null || onChange === void 0 ? void 0 : onChange([
(0, _dayjs.default)(date).startOf('day').toISOString(),
value === null || value === void 0 ? void 0 : value[1]
]);
};
var onChangeEnd = function onChangeEnd(date) {
onChange === null || onChange === void 0 ? void 0 : onChange([
value === null || value === void 0 ? void 0 : value[0],
(0, _dayjs.default)(date).endOf('day').toISOString()
]);
};
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
children: [
/*#__PURE__*/ (0, _jsxruntime.jsx)(_dates.DateInput, _object_spread._({
clearable: false,
label: "Start",
value: value === null || value === void 0 ? void 0 : value[0],
onChange: onChangeStart,
onFocus: onFocus,
popoverProps: {
styles: {
dropdown: {
display: 'none'
}
}
}
}, startProps)),
/*#__PURE__*/ (0, _jsxruntime.jsx)(_dates.DateInput, _object_spread._({
clearable: false,
label: "End",
value: value === null || value === void 0 ? void 0 : value[1],
onChange: onChangeEnd,
onFocus: onFocus,
popoverProps: {
styles: {
dropdown: {
display: 'none'
}
}
}
}, endProps))
]
});
};
//# sourceMappingURL=EditableDateRangePicker.js.map