@gravionlabs/helix-ui 22.2.6 → 22.2.8
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/README.md +18 -1
- package/chart/package.json +4 -0
- package/core.css +4082 -0
- package/fesm2022/gravionlabs-helix-ui-chart.mjs +446 -0
- package/fesm2022/gravionlabs-helix-ui-chart.mjs.map +1 -0
- package/fesm2022/gravionlabs-helix-ui.mjs +464 -466
- package/fesm2022/gravionlabs-helix-ui.mjs.map +1 -1
- package/package.json +6 -1
- package/styles.css +91 -0
- package/types/gravionlabs-helix-ui-chart.d.ts +134 -0
- package/types/gravionlabs-helix-ui.d.ts +252 -237
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gravionlabs/helix-ui",
|
|
3
|
-
"version": "22.2.
|
|
3
|
+
"version": "22.2.8",
|
|
4
4
|
"description": "Helix UI: vanilla Angular components on the Helix design tokens — plain CSS, no runtime styling engine.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -47,11 +47,16 @@
|
|
|
47
47
|
"types": "./types/gravionlabs-helix-ui.d.ts",
|
|
48
48
|
"default": "./fesm2022/gravionlabs-helix-ui.mjs"
|
|
49
49
|
},
|
|
50
|
+
"./chart": {
|
|
51
|
+
"types": "./types/gravionlabs-helix-ui-chart.d.ts",
|
|
52
|
+
"default": "./fesm2022/gravionlabs-helix-ui-chart.mjs"
|
|
53
|
+
},
|
|
50
54
|
"./validators": {
|
|
51
55
|
"types": "./types/gravionlabs-helix-ui-validators.d.ts",
|
|
52
56
|
"default": "./fesm2022/gravionlabs-helix-ui-validators.mjs"
|
|
53
57
|
},
|
|
54
58
|
"./styles.css": "./styles.css",
|
|
59
|
+
"./core.css": "./core.css",
|
|
55
60
|
"./tokens.css": "./tokens.css"
|
|
56
61
|
},
|
|
57
62
|
"type": "module"
|
package/styles.css
CHANGED
|
@@ -1753,6 +1753,83 @@
|
|
|
1753
1753
|
height: 2.5rem;
|
|
1754
1754
|
}
|
|
1755
1755
|
|
|
1756
|
+
/* a header with extra content: the label (or sort button) and the content side by side */
|
|
1757
|
+
.hx-data-table-header-content {
|
|
1758
|
+
display: flex;
|
|
1759
|
+
align-items: center;
|
|
1760
|
+
gap: var(--h-datatable-header-cell-gap);
|
|
1761
|
+
}
|
|
1762
|
+
|
|
1763
|
+
.hx-data-table-header-content > .hx-data-table-sort {
|
|
1764
|
+
flex: 1 1 auto;
|
|
1765
|
+
width: auto;
|
|
1766
|
+
}
|
|
1767
|
+
|
|
1768
|
+
.hx-data-table-align-center .hx-data-table-header-content {
|
|
1769
|
+
justify-content: center;
|
|
1770
|
+
}
|
|
1771
|
+
|
|
1772
|
+
.hx-data-table-align-right .hx-data-table-header-content {
|
|
1773
|
+
justify-content: flex-end;
|
|
1774
|
+
}
|
|
1775
|
+
|
|
1776
|
+
/* the filter button of filterDisplay="menu": an icon button beside the label, marked when the column is filtered */
|
|
1777
|
+
.hx-data-table-filter-button {
|
|
1778
|
+
display: inline-flex;
|
|
1779
|
+
flex: none;
|
|
1780
|
+
align-items: center;
|
|
1781
|
+
margin: 0;
|
|
1782
|
+
position: relative;
|
|
1783
|
+
padding: 0.125rem;
|
|
1784
|
+
border: 0;
|
|
1785
|
+
background: transparent;
|
|
1786
|
+
color: var(--h-datatable-sort-icon-color);
|
|
1787
|
+
cursor: pointer;
|
|
1788
|
+
border-radius: 2px;
|
|
1789
|
+
outline-color: transparent;
|
|
1790
|
+
}
|
|
1791
|
+
|
|
1792
|
+
.hx-data-table-filter-icon {
|
|
1793
|
+
display: inline-block;
|
|
1794
|
+
flex: none;
|
|
1795
|
+
width: var(--h-datatable-sort-icon-size);
|
|
1796
|
+
height: var(--h-datatable-sort-icon-size);
|
|
1797
|
+
background: currentcolor;
|
|
1798
|
+
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5h16l-6 7.5V19l-4 1.5v-8L4 5Z'/%3E%3C/svg%3E") center/contain no-repeat;
|
|
1799
|
+
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5h16l-6 7.5V19l-4 1.5v-8L4 5Z'/%3E%3C/svg%3E") center/contain no-repeat;
|
|
1800
|
+
}
|
|
1801
|
+
|
|
1802
|
+
.hx-data-table-filter-button:hover {
|
|
1803
|
+
color: var(--h-datatable-sort-icon-hover-color);
|
|
1804
|
+
}
|
|
1805
|
+
|
|
1806
|
+
.hx-data-table-filter-button:focus-visible {
|
|
1807
|
+
outline: var(--h-datatable-header-cell-focus-ring-width) var(--h-datatable-header-cell-focus-ring-style) var(--h-datatable-header-cell-focus-ring-color);
|
|
1808
|
+
outline-offset: var(--h-datatable-header-cell-focus-ring-offset);
|
|
1809
|
+
box-shadow: var(--h-datatable-header-cell-focus-ring-shadow);
|
|
1810
|
+
}
|
|
1811
|
+
|
|
1812
|
+
.hx-data-table-filter-button.hx-data-table-filter-active {
|
|
1813
|
+
color: var(--h-datatable-header-cell-selected-color);
|
|
1814
|
+
}
|
|
1815
|
+
|
|
1816
|
+
.hx-data-table-filter-button.hx-data-table-filter-active::after {
|
|
1817
|
+
content: "";
|
|
1818
|
+
position: absolute;
|
|
1819
|
+
top: 0;
|
|
1820
|
+
right: 0;
|
|
1821
|
+
width: 0.375rem;
|
|
1822
|
+
height: 0.375rem;
|
|
1823
|
+
border-radius: 50%;
|
|
1824
|
+
background: currentcolor;
|
|
1825
|
+
}
|
|
1826
|
+
|
|
1827
|
+
.hx-data-table-filter-menu {
|
|
1828
|
+
display: flex;
|
|
1829
|
+
align-items: center;
|
|
1830
|
+
gap: var(--h-datatable-header-cell-gap);
|
|
1831
|
+
}
|
|
1832
|
+
|
|
1756
1833
|
/* sortable headers: a button that fills the header cell */
|
|
1757
1834
|
.hx-data-table-sort {
|
|
1758
1835
|
display: inline-flex;
|
|
@@ -2452,6 +2529,13 @@
|
|
|
2452
2529
|
.hx-date-time-range-picker-popup {
|
|
2453
2530
|
max-width: calc(100vw - 2rem);
|
|
2454
2531
|
overflow: auto;
|
|
2532
|
+
/* the presets row and the body sit inside the popup, so the popup carries the outer border */
|
|
2533
|
+
border: 1px solid var(--h-datepicker-panel-border-color);
|
|
2534
|
+
}
|
|
2535
|
+
|
|
2536
|
+
/* the popup border already closes the button bar */
|
|
2537
|
+
.hx-date-time-range-picker-popup .hx-date-picker-buttonbar {
|
|
2538
|
+
border: 0;
|
|
2455
2539
|
}
|
|
2456
2540
|
|
|
2457
2541
|
.hx-date-time-range-picker-body {
|
|
@@ -2508,6 +2592,13 @@
|
|
|
2508
2592
|
font-weight: var(--h-datepicker-title-font-weight);
|
|
2509
2593
|
}
|
|
2510
2594
|
|
|
2595
|
+
.hx-date-time-range-picker-presets {
|
|
2596
|
+
display: flex;
|
|
2597
|
+
flex-wrap: wrap;
|
|
2598
|
+
gap: var(--h-datepicker-title-gap);
|
|
2599
|
+
padding: var(--h-datepicker-panel-padding) var(--h-datepicker-panel-padding) 0;
|
|
2600
|
+
}
|
|
2601
|
+
|
|
2511
2602
|
/* dialog */
|
|
2512
2603
|
/*
|
|
2513
2604
|
* Dialog: `<hx-dialog>` and the dialogs of `HxDialogService`. The box (`.hx-dialog`) is a grid of the title, the
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { InjectionToken } from "@angular/core";
|
|
3
|
+
type HxChartType = 'bar' | 'line' | 'scatter' | 'bubble' | 'pie' | 'doughnut' | 'polarArea' | 'radar';
|
|
4
|
+
/** What `(dataSelect)` carries: the click and what chart.js found under it. */
|
|
5
|
+
interface HxChartSelectEvent {
|
|
6
|
+
originalEvent: Event;
|
|
7
|
+
/** The nearest element under the pointer (chart.js `{ datasetIndex, index, element }`). */
|
|
8
|
+
element: unknown;
|
|
9
|
+
/** The elements of that dataset. */
|
|
10
|
+
dataset: unknown[];
|
|
11
|
+
}
|
|
12
|
+
/** The part of chart.js this component uses; the real module is `chart.js/auto`. */
|
|
13
|
+
interface HxChartModule {
|
|
14
|
+
default: new (canvas: HTMLCanvasElement, config: unknown) => HxChartInstance;
|
|
15
|
+
}
|
|
16
|
+
interface HxChartInstance {
|
|
17
|
+
data: unknown;
|
|
18
|
+
options: unknown;
|
|
19
|
+
update(mode?: string): void;
|
|
20
|
+
destroy(): void;
|
|
21
|
+
getElementsAtEventForMode(event: Event, mode: string, options: object, useFinalPosition: boolean): unknown[];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Loads chart.js. The default is a dynamic `import('chart.js/auto')`, so chart.js is only fetched by apps that show
|
|
25
|
+
* a chart; provide another function to register a smaller set of chart.js parts or to replace it in tests.
|
|
26
|
+
*/
|
|
27
|
+
export declare const HX_CHART_LOADER: InjectionToken<() => Promise<HxChartModule>>;
|
|
28
|
+
type Json = Record<string, unknown>;
|
|
29
|
+
/** The parts of chart.js data and datasets that are read here; everything else is passed on untouched. */
|
|
30
|
+
interface ChartDataLike extends Json {
|
|
31
|
+
datasets?: unknown;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* A chart.js chart whose colours, grid and font come from the Helix tokens.
|
|
35
|
+
*
|
|
36
|
+
* ```html
|
|
37
|
+
* <hx-chart type="bar" [data]="data" [options]="options" height="20rem" ariaLabel="Sales per month">
|
|
38
|
+
* <table hxChartFallback>…the same numbers as text…</table>
|
|
39
|
+
* </hx-chart>
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* chart.js is an optional peer dependency, loaded with a dynamic import (see `HX_CHART_LOADER`) the first time a
|
|
43
|
+
* chart is shown. Datasets without colours get the Helix palette; text, grid and legend colours come from
|
|
44
|
+
* `--h-text-muted-color` and `--h-content-border-color` of the element. Your `options` win over these defaults.
|
|
45
|
+
* The chart is redrawn when `class` or `style` of `<html>` change (dark mode, the primary colour).
|
|
46
|
+
*
|
|
47
|
+
* The canvas is an `img` named by `ariaLabel` / `ariaLabelledBy`; content marked `hxChartFallback` becomes the
|
|
48
|
+
* canvas fallback content, which assistive technology reads: put the numbers there as text or as a table.
|
|
49
|
+
*/
|
|
50
|
+
export declare class HxChart {
|
|
51
|
+
#private;
|
|
52
|
+
private readonly canvas;
|
|
53
|
+
readonly type: import("@angular/core").InputSignal<HxChartType>;
|
|
54
|
+
/** chart.js data: `{ labels, datasets }`. Pass a new object to update the chart. */
|
|
55
|
+
readonly data: import("@angular/core").InputSignal<ChartDataLike>;
|
|
56
|
+
/** chart.js options, on top of the token defaults. Pass a new object to update the chart. */
|
|
57
|
+
readonly options: import("@angular/core").InputSignal<Json>;
|
|
58
|
+
/** Extra chart.js plugins for this chart. */
|
|
59
|
+
readonly plugins: import("@angular/core").InputSignal<readonly unknown[]>;
|
|
60
|
+
/** CSS width of the frame, e.g. `30rem`; the chart fills its container by default. */
|
|
61
|
+
readonly width: import("@angular/core").InputSignal<string | undefined>;
|
|
62
|
+
/** CSS height of the frame; without it chart.js keeps its aspect ratio. */
|
|
63
|
+
readonly height: import("@angular/core").InputSignal<string | undefined>;
|
|
64
|
+
/** Resize with the container. */
|
|
65
|
+
readonly responsive: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
66
|
+
readonly ariaLabel: import("@angular/core").InputSignal<string | undefined>;
|
|
67
|
+
readonly ariaLabelledBy: import("@angular/core").InputSignal<string | undefined>;
|
|
68
|
+
/** Delay of a redraw after the theme changed, in ms; the style change is usually followed by more. */
|
|
69
|
+
readonly themeDelay: import("@angular/core").InputSignalWithTransform<number, unknown>;
|
|
70
|
+
/** A data point or dataset was clicked. */
|
|
71
|
+
readonly dataSelect: import("@angular/core").OutputEmitterRef<HxChartSelectEvent>;
|
|
72
|
+
constructor();
|
|
73
|
+
/** The chart.js instance, once it exists; `undefined` before chart.js has loaded. */
|
|
74
|
+
get chart(): HxChartInstance | undefined;
|
|
75
|
+
/** Redraws the chart, e.g. after the theme changed in a way the component cannot see. */
|
|
76
|
+
refresh(): void;
|
|
77
|
+
protected onClick(event: MouseEvent): void;
|
|
78
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HxChart, never>;
|
|
79
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HxChart, "hx-chart", never, {
|
|
80
|
+
"type": {
|
|
81
|
+
"alias": "type";
|
|
82
|
+
"required": false;
|
|
83
|
+
"isSignal": true;
|
|
84
|
+
};
|
|
85
|
+
"data": {
|
|
86
|
+
"alias": "data";
|
|
87
|
+
"required": false;
|
|
88
|
+
"isSignal": true;
|
|
89
|
+
};
|
|
90
|
+
"options": {
|
|
91
|
+
"alias": "options";
|
|
92
|
+
"required": false;
|
|
93
|
+
"isSignal": true;
|
|
94
|
+
};
|
|
95
|
+
"plugins": {
|
|
96
|
+
"alias": "plugins";
|
|
97
|
+
"required": false;
|
|
98
|
+
"isSignal": true;
|
|
99
|
+
};
|
|
100
|
+
"width": {
|
|
101
|
+
"alias": "width";
|
|
102
|
+
"required": false;
|
|
103
|
+
"isSignal": true;
|
|
104
|
+
};
|
|
105
|
+
"height": {
|
|
106
|
+
"alias": "height";
|
|
107
|
+
"required": false;
|
|
108
|
+
"isSignal": true;
|
|
109
|
+
};
|
|
110
|
+
"responsive": {
|
|
111
|
+
"alias": "responsive";
|
|
112
|
+
"required": false;
|
|
113
|
+
"isSignal": true;
|
|
114
|
+
};
|
|
115
|
+
"ariaLabel": {
|
|
116
|
+
"alias": "ariaLabel";
|
|
117
|
+
"required": false;
|
|
118
|
+
"isSignal": true;
|
|
119
|
+
};
|
|
120
|
+
"ariaLabelledBy": {
|
|
121
|
+
"alias": "ariaLabelledBy";
|
|
122
|
+
"required": false;
|
|
123
|
+
"isSignal": true;
|
|
124
|
+
};
|
|
125
|
+
"themeDelay": {
|
|
126
|
+
"alias": "themeDelay";
|
|
127
|
+
"required": false;
|
|
128
|
+
"isSignal": true;
|
|
129
|
+
};
|
|
130
|
+
}, {
|
|
131
|
+
"dataSelect": "dataSelect";
|
|
132
|
+
}, never, ["[hxChartFallback]"], true, never>;
|
|
133
|
+
}
|
|
134
|
+
export type { HxChartInstance, HxChartModule, HxChartSelectEvent, HxChartType };
|