UNPKG

lml-main

Version:

This is now a mono repository published into many standalone packages.

103 lines 3.65 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const React = require("react"); const cosmoui_1 = require("cosmoui"); const title_1 = require("./title"); const listStyles = require('./job-list.scss'); // currently this is the only field that is sortable // but eventually all the fields will be sortable const CollectFromTitle = title_1.mkSortableTitle('COLLECT FROM', 'stopField'); const ItemsTitle = title_1.mkUnsortableTitle('ITEMS', 'itemsField'); const TagTitle = title_1.mkUnsortableTitle('TAG', 'tagField'); const SmartTitle = title_1.mkUnsortableTitle('SM.', 'smartField'); const CollectByTitle = title_1.mkUnsortableTitle('COLLECT', 'timeField'); const DeliverByTitle = title_1.mkUnsortableTitle('DELIVER', 'timeField'); const CompletedAtTitle = title_1.mkUnsortableTitle('DEL AT', 'timeField'); const CourierTitle = title_1.mkUnsortableTitle('COURIER', 'courierField'); class AbstractHeaderComponent extends cosmoui_1.StylableComponent { constructor() { super(...arguments); this.bgColor = () => this.gray(100); } render() { // console.log('RENDER JOBS HEADER', this) return (React.createElement(cosmoui_1.Row, { style: this.styles(), className: listStyles.header, align: "flex-end" }, title_1.mkUnsortableTitle('FREQ', 'frequencyField'), title_1.mkUnsortableTitle('CUSTOMER', 'customerField'), CollectFromTitle, title_1.mkUnsortableTitle('DELIVER TO', 'stopField'), this.props.ItemsTitle, this.props.TimeTitle, this.props.TagTitle, this.props.SmartTitle, this.props.CourierTitle, React.createElement(cosmoui_1.Spacer, { width: 5 }))); } styles() { // console.log('AbstractHeaderComponent styles', this.secondary(100)) return { backgroundColor: this.bgColor(), paddingBottom: this.padding(200), }; } } exports.AbstractHeaderComponent = AbstractHeaderComponent; class LiveHeaderComponent extends AbstractHeaderComponent { constructor() { super(...arguments); this.bgColor = () => this.success(100); } } LiveHeaderComponent.defaultProps = { ItemsTitle, TimeTitle: CollectByTitle, TagTitle, SmartTitle, CourierTitle: null, }; exports.LiveHeaderComponent = LiveHeaderComponent; class AllocatedHeaderComponent extends AbstractHeaderComponent { constructor() { super(...arguments); this.bgColor = () => this.warning(100); } } AllocatedHeaderComponent.defaultProps = { ItemsTitle, TimeTitle: CollectByTitle, TagTitle: null, SmartTitle: null, CourierTitle, }; exports.AllocatedHeaderComponent = AllocatedHeaderComponent; class AcceptedHeaderComponent extends AbstractHeaderComponent { } AcceptedHeaderComponent.defaultProps = { ItemsTitle, TimeTitle: CollectByTitle, TagTitle: null, SmartTitle: null, CourierTitle, }; exports.AcceptedHeaderComponent = AcceptedHeaderComponent; class InProgressHeaderComponent extends AbstractHeaderComponent { } InProgressHeaderComponent.defaultProps = { ItemsTitle, TimeTitle: DeliverByTitle, TagTitle: null, SmartTitle: null, CourierTitle, }; exports.InProgressHeaderComponent = InProgressHeaderComponent; class CompletedHeaderComponent extends AbstractHeaderComponent { } CompletedHeaderComponent.defaultProps = { ItemsTitle, TimeTitle: CompletedAtTitle, TagTitle: null, SmartTitle: null, CourierTitle, }; exports.CompletedHeaderComponent = CompletedHeaderComponent; //# sourceMappingURL=list-header.js.map