@up-group/react-controls
Version:
We know that there are a ton of react UI library projects to choose from. Our hope with this one is to provide the next generation of react components that you can use to bootstrap your next project, or as a reference for building a UIKit. Read on to get
85 lines • 3.92 kB
JavaScript
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __assign = (this && this.__assign) || Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
Object.defineProperty(exports, "__esModule", { value: true });
var React = require("react");
var themedComponents_1 = require("../../../Common/theming/themedComponents");
var datetime_1 = require("@blueprintjs/datetime");
var UpLocaleUtils = (function () {
function UpLocaleUtils() {
}
UpLocaleUtils.prototype.formatDay = function (day, locale) {
return "jour";
};
UpLocaleUtils.prototype.formatMonthTitle = function (month, locale) {
return "";
};
UpLocaleUtils.prototype.formatWeekdayShort = function (weekday, locale) {
return "";
};
UpLocaleUtils.prototype.formatWeekdayLong = function (weekday, locale) {
return "";
};
UpLocaleUtils.prototype.getFirstDayOfWeek = function (locale) {
return 1;
};
UpLocaleUtils.prototype.getMonths = function (locale) {
return ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet",
"Août", "Septembre", "Octobre", "Novembre", "Décembre"];
};
return UpLocaleUtils;
}());
var locale = new UpLocaleUtils();
var BaseDate = function (props) {
var value = props.value, className = props.className, format = props.format, onChangeDate = props.onChangeDate, disabled = props.disabled, minDate = props.minDate, maxDate = props.maxDate, innerRef = props.innerRef, onChangeTime = props.onChangeTime;
var picker = (React.createElement("span", { className: "pt-icon pt-icon-calendar" }));
return (React.createElement("div", null,
React.createElement(datetime_1.DateInput, { className: className, locale: "fr", ref: innerRef, invalidDateMessage: "", localeUtils: locale, rightElement: picker, canClearSelection: true, closeOnSelection: true, disabled: disabled, minDate: minDate, maxDate: maxDate, value: value, onChange: onChangeDate, format: format }),
React.createElement(datetime_1.TimePicker, { value: value, onChange: onChangeTime })));
};
exports.NormalDate = (_a = ["\n"], _a.raw = ["\n"], themedComponents_1.default(BaseDate)(_a));
var UpDateStyle = (function (_super) {
__extends(UpDateStyle, _super);
function UpDateStyle() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.setInput = function (input) {
if (_this.dateInput == undefined) {
_this.dateInput = input;
}
};
return _this;
}
UpDateStyle.prototype.componentDidMount = function () {
var _props = this.props;
if (_props.dataFor && this.dateInput) {
this.dateInput.inputRef.setAttribute('data-tip', 'tooltip');
this.dateInput.inputRef.setAttribute('data-for', _props.dataFor);
}
};
UpDateStyle.prototype.render = function () {
return (React.createElement(exports.NormalDate, __assign({ innerRef: this.setInput }, this.props)));
};
UpDateStyle.defaultProps = {
value: null
};
return UpDateStyle;
}(React.Component));
exports.default = UpDateStyle;
var _a;
//# sourceMappingURL=styles.js.map
;