@hestia-earth/ui-components 0.31.1 → 0.31.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/chart/index.d.ts CHANGED
@@ -2,3 +2,4 @@ export * from './bar-chart/bar-chart.component';
2
2
  export * from './line-chart/line-chart.component';
3
3
  export * from './chart.component';
4
4
  export * from './chart-configuration.directive';
5
+ export * from './plugins';
@@ -0,0 +1,14 @@
1
+ import { ChartPlugin } from './models';
2
+ export declare const defaultBarDrawSettings: {
3
+ xPosFn: (x: number, index: number, width: number) => number;
4
+ yPosFn: (y: number, index: number) => number;
5
+ colorFn: (m: any, index: number) => string;
6
+ textFn: (m: {
7
+ label: string;
8
+ data: number;
9
+ }, index: number) => string | [string, string];
10
+ font: string;
11
+ maxWidth: number;
12
+ };
13
+ export type BarDrawSettings = Partial<typeof defaultBarDrawSettings>;
14
+ export declare const afterBarDrawPlugin: (settings?: BarDrawSettings) => ChartPlugin;
@@ -0,0 +1,2 @@
1
+ export * from './lollipopChart.plugin';
2
+ export * from './afterBarDraw.plugin';
@@ -0,0 +1,8 @@
1
+ import { ChartPlugin, DatasetModel } from './models';
2
+ export declare const defaultLollipopSettings: {
3
+ circleRadius: number;
4
+ colorFn: (m: DatasetModel, index: number) => string;
5
+ isMouseInsideLollipopFn: (fn: (x: number, y: number) => number) => void | null;
6
+ };
7
+ export type LollipopPluginSettings = Partial<typeof defaultLollipopSettings>;
8
+ export declare const lollipopChartPlugin: (settings?: LollipopPluginSettings) => ChartPlugin;
@@ -0,0 +1,3 @@
1
+ import Chart from 'chart.js';
2
+ export type ChartPlugin = Chart.PluginServiceGlobalRegistration & Partial<Chart.PluginServiceRegistrationOptions>;
3
+ export type DatasetModel = ReturnType<Chart['getDatasetMeta']>['data'][0]['_model'];
package/common/index.d.ts CHANGED
@@ -33,7 +33,6 @@ export * from './shell/shell.component';
33
33
  export { SkeletonTextComponent } from './skeleton-text/skeleton-text.component';
34
34
  export { SocialTagsComponent } from './social-tags/social-tags.component';
35
35
  export { ToastComponent } from './toast/toast.component';
36
- export { UnitConverterComponent } from './unit-converter/unit-converter.component';
37
36
  export { ApplyPurePipe } from './apply-pure.pipe';
38
37
  export { CapitalizePipe } from './capitalize.pipe';
39
38
  export { ClickOutsideDirective } from './click-outside.directive';
@@ -1,10 +1,21 @@
1
1
  import { Term, ICycleJSONLD, ISiteJSONLD, IImpactAssessmentJSONLD, EmissionMethodTier, ITermJSONLD, Indicator, Animal, Transformation, blankNodesType, blankNodesKey } from '@hestia-earth/schema';
2
2
  import { propertyValueType } from '@hestia-earth/utils/dist/term';
3
+ interface IDates {
4
+ /**
5
+ * The end date in iso format.
6
+ */
7
+ end: string;
8
+ /**
9
+ * The start date in iso format.
10
+ * If not provided, use the end date 1 month before.
11
+ */
12
+ start?: string;
13
+ }
3
14
  export declare const formatDate: (date: string, isStart?: boolean) => Date;
4
15
  export declare const getDatesBetween: (startDate: Date, endDate: Date) => Date[];
5
16
  export declare const sortedDates: (dates: Date[]) => Date[];
6
17
  export declare const uniqueDatesBetween: (dates: Date[]) => Date[];
7
- export declare const isDateBetween: (date: string | Date, startDate?: string, endDate?: string) => boolean;
18
+ export declare const isDateBetween: (date: string | Date, dates: IDates) => boolean;
8
19
  export declare const filterBlankNode: (filterTerm: string) => ({ term }: blankNodesType) => boolean;
9
20
  export declare const ignoreKeys: string[];
10
21
  export declare const isValidKey: (key: string) => boolean;
@@ -64,3 +75,4 @@ export declare const grouppedKeys: <T>(values: {
64
75
  export declare const methodTierOrder: (methodTier: EmissionMethodTier) => number;
65
76
  export declare const grouppedValueKeys: string[];
66
77
  export declare const groupNodesByTerm: <T extends ICycleJSONLD | IImpactAssessmentJSONLD | ISiteJSONLD | Animal | Transformation, R>(nodes: T[], key: blankNodesKey, originalValues?: T[], includeNode?: (_node: any) => boolean) => IGroupedNodes<R>;
78
+ export {};
@@ -3,7 +3,7 @@ export declare class EngineModelsVersionLinkComponent {
3
3
  protected readonly faExternalLinkAlt: import("@fortawesome/fontawesome-common-types").IconDefinition;
4
4
  protected readonly node: import("@angular/core").InputSignal<any>;
5
5
  protected readonly showDetails: import("@angular/core").InputSignal<boolean>;
6
- protected readonly ENGINE_VERSION = "0.65.10";
6
+ protected readonly ENGINE_VERSION = "0.65.11";
7
7
  protected readonly version: import("@angular/core").Signal<string>;
8
8
  protected readonly url: import("@angular/core").Signal<string>;
9
9
  static ɵfac: i0.ɵɵFactoryDeclaration<EngineModelsVersionLinkComponent, never>;