Bundled output for commit 76788efaba

Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
This commit is contained in:
flarum-bot 2022-09-29 11:17:55 +00:00
parent 76788efaba
commit 8c0a14aff2
4 changed files with 47 additions and 2 deletions

View File

@ -1,4 +1,5 @@
import DashboardWidget, { IDashboardWidgetAttrs } from 'flarum/admin/components/DashboardWidget';
import { IDateSelection } from './StatisticsWidgetDateSelectionModal';
import type Mithril from 'mithril';
interface IPeriodDeclaration {
start: number;
@ -9,10 +10,14 @@ export default class StatisticsWidget extends DashboardWidget {
entities: string[];
periods: undefined | Record<string, IPeriodDeclaration>;
chart: any;
customPeriod: IDateSelection | null;
timedData: Record<string, undefined | any>;
lifetimeData: any;
customPeriodData: Record<string, undefined | any>;
noData: boolean;
loadingLifetime: boolean;
loadingTimed: Record<string, 'unloaded' | 'loading' | 'loaded' | 'fail'>;
loadingCustom: Record<string, 'unloaded' | 'loading' | 'loaded' | 'fail'>;
selectedEntity: string;
selectedPeriod: undefined | string;
chartEntity?: string;
@ -20,6 +25,7 @@ export default class StatisticsWidget extends DashboardWidget {
oncreate(vnode: Mithril.VnodeDOM<IDashboardWidgetAttrs, this>): void;
loadLifetimeData(): Promise<void>;
loadTimedData(model: string): Promise<void>;
loadCustomRangeData(model: string): Promise<void>;
className(): string;
content(): JSX.Element;
drawChart(vnode: Mithril.VnodeDOM<any, any>): void;

View File

@ -0,0 +1,39 @@
import ItemList from 'flarum/common/utils/ItemList';
import Modal, { IInternalModalAttrs } from 'flarum/common/components/Modal';
import Mithril from 'mithril';
export interface IDateSelection {
/**
* Timestamp (seconds, not ms) for start date
*/
start: number;
/**
* Timestamp (seconds, not ms) for end date
*/
end: number;
}
export interface IStatisticsWidgetDateSelectionModalAttrs extends IInternalModalAttrs {
onModalSubmit: (dates: IDateSelection) => void;
value?: IDateSelection;
}
interface IStatisticsWidgetDateSelectionModalState {
inputs: {
startDateVal: string;
endDateVal: string;
};
ids: {
startDate: string;
endDate: string;
};
}
export default class StatisticsWidgetDateSelectionModal extends Modal<IStatisticsWidgetDateSelectionModalAttrs> {
state: IStatisticsWidgetDateSelectionModalState;
oninit(vnode: Mithril.Vnode<IStatisticsWidgetDateSelectionModalAttrs, this>): void;
className(): string;
title(): Mithril.Children;
content(): Mithril.Children;
items(): ItemList<Mithril.Children>;
updateState(field: keyof IStatisticsWidgetDateSelectionModalState['inputs']): (e: InputEvent) => void;
submitData(): IDateSelection;
onsubmit(e: SubmitEvent): void;
}
export {};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long