// noinspection ES6UnusedImports import * as Surplus from 'surplus'; import { bindNumber, bindString } from '../../utils/surplus'; import { ContributorCtrl } from './contributor-ctrl'; import { ContributorKind } from './contributor-model'; export const MAX_PERSONS_PER_CONTRIBUTORS = 100; export const MAX_HOURS_PER_WEEK = 7 * 24; export const DRAGGABLE_HANDLE_CLASS = 'draggable-handle'; const PLAINTEXT_CLASS = 'form-control-plaintext form-control-sm w-100'; const INPUT_CLASS = 'form-control form-control-sm w-100'; const INPUT_CLASS_RIGHT = 'form-control form-control-sm text-right'; // Unfortunately, Firefox does not automatically resize element of type number to the maximum required width. // https://stackoverflow.com/questions/22590483/why-does-adding-min-max-properties-change-the-width-of-a-numeric-html5-input-ele // As a workaround, we set the width relative to the width of digit '0'. We include some extra digits to account for: // Padding on the left, padding on the right, and spin buttons. export const INPUT_WIDTH_3_DIGITS: string = `${4 + Math.ceil(Math.log(MAX_HOURS_PER_WEEK) / Math.LN10)}ch`; export function ContributorView({ctrl}: {ctrl: ContributorCtrl}): HTMLElement { return
  • {ctrl.contributor.type === ContributorKind.EXTERNAL ? : }
    {ctrl.contributor.type === ContributorKind.EXTERNAL &&
    👤
    }
    h/week
  • ; }