react-native-week-schedule-1
Version:
49 lines (48 loc) • 1.24 kB
JavaScript
"use strict";
import { DEFAULT_COLORS } from "../DEFAULT_COLORS.js";
import { scaleHorizontal, size } from "./Utils.js";
;
class Grid {
_diff = scaleHorizontal(13);
_offset = scaleHorizontal(5);
_numberOfColumns = 8;
_hours = ["12 am", "1 am", "2 am", "3 am", "4 am", "5 am", "6 am", "7 am", "8 am", "9 am", "10 am", "11 am", "12 pm", "1 pm", "2 pm", "3 pm", "4 pm", "5 pm", "6 pm", "7 pm", "8 pm", "9 pm", "10 pm", "11 pm"];
_weekDays = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
_colors = DEFAULT_COLORS;
get cellWight() {
return size.width / this._numberOfColumns - this._offset;
}
get cellHeight() {
return size.width / this._numberOfColumns + this._diff - this._offset;
}
get hours() {
return this._hours ?? [];
}
set hours(value) {
this._hours = value;
}
get weekDays() {
return this._weekDays;
}
set weekDays(value) {
this._weekDays = value ?? [];
}
set diff(value) {
this._diff = value;
}
set offset(value) {
this._offset = value;
}
get colors() {
return this._colors;
}
updateColors(value) {
this._colors = {
...DEFAULT_COLORS,
...value
};
}
}
;
export const grid = new Grid();
//# sourceMappingURL=grid.js.map