@easyquery/ui 7.4.2 → 7.5.0-rc01
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/LICENSE.md +162 -162
- package/README.md +39 -39
- package/dist/assets/css/aggr-settings.css +240 -240
- package/dist/assets/css/easychart.css +71 -71
- package/dist/assets/css/easyquery-mobile.css +270 -270
- package/dist/assets/css/easyquery.css +1452 -1452
- package/dist/assets/css/easyquery.ui.css +2874 -2806
- package/dist/assets/css/eq-icons.css +114 -114
- package/dist/assets/css/themes.css +11 -11
- package/dist/assets/css/upgrade.css +486 -454
- package/dist/easyquery.ui.cjs.js +385 -75
- package/dist/easyquery.ui.esm.js +385 -75
- package/dist/types/utils/column_key_utils.d.ts +20 -0
- package/dist/types/utils/popup_menu_utils.d.ts +27 -0
- package/dist/types/views/view_options.d.ts +9 -0
- package/dist/types/widgets/charts/chart_widget.d.ts +8 -0
- package/dist/types/widgets/charts/chart_widget_chartjs.d.ts +9 -0
- package/dist/types/widgets/columns_panel.d.ts +4 -3
- package/dist/types/widgets/easy_grid_widget.d.ts +22 -0
- package/dist/types/widgets/entities_panel.d.ts +4 -2
- package/dist/types/widgets/sorting_bar.d.ts +3 -2
- package/package.json +4 -3
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** The parts of a query column the key computation relies on. */
|
|
2
|
+
export interface ColumnKeyQueryColumn {
|
|
3
|
+
expr: {
|
|
4
|
+
saveToData(): any;
|
|
5
|
+
};
|
|
6
|
+
}
|
|
7
|
+
/** The parts of a result-set data column the key computation relies on. */
|
|
8
|
+
export interface ColumnKeyDataColumn {
|
|
9
|
+
originAttrId?: string | null;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Computes a stable per-column identity used to persist column widths:
|
|
13
|
+
* the query column's expression (attribute id, else the serialized expression),
|
|
14
|
+
* falling back to the server-provided origin attribute id when the query has
|
|
15
|
+
* no matching column (e.g. a data-filtering fetch with an empty column list,
|
|
16
|
+
* where the server reflects all entity properties into auto-columns).
|
|
17
|
+
* Returns null when the column has no stable identity — such columns are not
|
|
18
|
+
* persisted (transient ids would only pollute the store).
|
|
19
|
+
*/
|
|
20
|
+
export declare function stableColumnKey(qcol: ColumnKeyQueryColumn | null | undefined, dataColumn: ColumnKeyDataColumn | null | undefined): string | null;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface MenuPlacementInput {
|
|
2
|
+
/** Document-absolute top of the anchor: the root anchor element or the parent item. */
|
|
3
|
+
anchorY: number;
|
|
4
|
+
/** Height of the anchor element / parent item; 0 if unknown. */
|
|
5
|
+
anchorHeight: number;
|
|
6
|
+
/** Natural levelDiv height (measured with maxHeight unset). */
|
|
7
|
+
menuHeight: number;
|
|
8
|
+
/** Natural scrollDiv height (measured with maxHeight unset). */
|
|
9
|
+
scrollDivHeight: number;
|
|
10
|
+
/** Window vertical scroll (document offset of the viewport top). */
|
|
11
|
+
scrollY: number;
|
|
12
|
+
viewportHeight: number;
|
|
13
|
+
levelIndex: number;
|
|
14
|
+
useMaxSpace: boolean;
|
|
15
|
+
/** Edge padding; defaults to 15. */
|
|
16
|
+
minOffset?: number;
|
|
17
|
+
/** Menu padding nudge for side-attached sub-levels so the first/last
|
|
18
|
+
* sub-item lines up with the parent item; defaults to 0. */
|
|
19
|
+
alignOffset?: number;
|
|
20
|
+
}
|
|
21
|
+
export interface MenuPlacement {
|
|
22
|
+
/** Document-absolute CSS top for the levelDiv. */
|
|
23
|
+
top: number;
|
|
24
|
+
/** Pixels for scrollDiv.maxHeight; null = leave unset. */
|
|
25
|
+
maxHeight: number | null;
|
|
26
|
+
}
|
|
27
|
+
export declare function computeMenuPlacement(input: MenuPlacementInput): MenuPlacement;
|
|
@@ -95,6 +95,15 @@ export interface EqViewOptions extends EqContextOptions {
|
|
|
95
95
|
fetchDataOnChange?: boolean;
|
|
96
96
|
disableConfirmationOnQueryChange?: boolean;
|
|
97
97
|
queryFileExtensions?: string;
|
|
98
|
+
/**
|
|
99
|
+
* DataFilterView only: fill an empty query with the root entity's own
|
|
100
|
+
* result-ready attributes once the model is loaded, so the "show the whole
|
|
101
|
+
* entity" fetch runs as an ordinary query with explicit columns
|
|
102
|
+
* (server-side sorting, column-width persistence, etc. work through their
|
|
103
|
+
* normal path). Enabled by default; set to false to send an empty column
|
|
104
|
+
* list and rely on server-side auto-columns instead.
|
|
105
|
+
*/
|
|
106
|
+
autoFillColumns?: boolean;
|
|
98
107
|
}
|
|
99
108
|
/**
|
|
100
109
|
* [[ReportView]] options
|
|
@@ -60,6 +60,14 @@ export declare abstract class ChartWidget extends Widget {
|
|
|
60
60
|
protected abstract hasChartTypes: ChartType[];
|
|
61
61
|
getSupportedChartTypes(): ChartType[];
|
|
62
62
|
getCurrentChartType(): ChartType;
|
|
63
|
+
/**
|
|
64
|
+
* Changes the current chart type and redraws the chart in place.
|
|
65
|
+
* Deliberately avoids a full re-render: emptying the widget (even for
|
|
66
|
+
* the drawing delay) shrinks the scrollable parent, so the browser
|
|
67
|
+
* clamps - and loses - its scroll position.
|
|
68
|
+
* @param type The new chart type.
|
|
69
|
+
*/
|
|
70
|
+
changeChartType(type: ChartType): void;
|
|
63
71
|
protected abstract canDraw(): boolean;
|
|
64
72
|
protected abstract initChart(): void;
|
|
65
73
|
private render;
|
|
@@ -10,13 +10,22 @@ export declare class ChartJsWidget extends ChartWidget {
|
|
|
10
10
|
getWidgetType(): string;
|
|
11
11
|
private chartLabels;
|
|
12
12
|
private chartColumns;
|
|
13
|
+
private chart;
|
|
13
14
|
protected hasChartTypes: ChartType[];
|
|
14
15
|
static hasChartJs(): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Returns the major version of the Chart.js library loaded on the page.
|
|
18
|
+
* `Chart.version` was introduced in 3.0, so its absence means 2.x.
|
|
19
|
+
*/
|
|
20
|
+
static getChartJsMajorVersion(): number;
|
|
15
21
|
protected canDraw(): boolean;
|
|
16
22
|
protected initChart(): void;
|
|
17
23
|
protected drawCore(): void;
|
|
24
|
+
protected destroyCore(): void;
|
|
25
|
+
private destroyChart;
|
|
18
26
|
protected updateChartColumns(): void;
|
|
19
27
|
private getChartCanvas;
|
|
20
28
|
private generateConfig;
|
|
29
|
+
private generateOptions;
|
|
21
30
|
private getChartType;
|
|
22
31
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EqContext, QueryColumn, Widget } from '@easyquery/core';
|
|
1
|
+
import { EqContext, Query, QueryColumn, Widget } from '@easyquery/core';
|
|
2
2
|
import { ColumnsEditMode, ColumnsPanelOptions } from './widget_options';
|
|
3
3
|
import { PopupMenu } from '../utils/popup_menu';
|
|
4
4
|
export declare class ColumnsPanel extends Widget {
|
|
@@ -11,8 +11,9 @@ export declare class ColumnsPanel extends Widget {
|
|
|
11
11
|
sortMenu: PopupMenu;
|
|
12
12
|
moveMenu: PopupMenu;
|
|
13
13
|
private queryEventCallbackId;
|
|
14
|
+
private customQuery;
|
|
14
15
|
protected get cssPrefix(): string;
|
|
15
|
-
constructor(slot: HTMLElement);
|
|
16
|
+
constructor(slot: HTMLElement, customQuery?: Query);
|
|
16
17
|
getWidgetType(): string;
|
|
17
18
|
/**
|
|
18
19
|
* Gets or sets the current edit mode. When setting, automatically refreshes the widget.
|
|
@@ -24,7 +25,7 @@ export declare class ColumnsPanel extends Widget {
|
|
|
24
25
|
protected destroyCore(): void;
|
|
25
26
|
private attachQueryObserver;
|
|
26
27
|
private detachQueryObserver;
|
|
27
|
-
|
|
28
|
+
getQuery(): Query;
|
|
28
29
|
private landingSlot;
|
|
29
30
|
private landingIndex;
|
|
30
31
|
private showLandingSlot;
|
|
@@ -6,6 +6,10 @@ export declare class EasyGridWidget extends Grid {
|
|
|
6
6
|
private entitiesMenu;
|
|
7
7
|
private queryEventCallbackId;
|
|
8
8
|
private hasCustomTotalsSettings;
|
|
9
|
+
private columnWidthCache;
|
|
10
|
+
private columnWidthScope;
|
|
11
|
+
private columnWidthsEnabled;
|
|
12
|
+
private loadedWidthScopeKey;
|
|
9
13
|
protected options: any;
|
|
10
14
|
/**
|
|
11
15
|
* The default constructor.
|
|
@@ -32,4 +36,22 @@ export declare class EasyGridWidget extends Grid {
|
|
|
32
36
|
protected addColumnClickHandler(ev: AddColumnClickEvent): void;
|
|
33
37
|
protected columnMovedHandler(ev: ColumnMovedEvent): void;
|
|
34
38
|
addNewColumn(attrId: string): QueryColumn;
|
|
39
|
+
private toGridSort;
|
|
40
|
+
private fromGridSort;
|
|
41
|
+
/** Reflects the query's current sorting in the grid header indicator. */
|
|
42
|
+
private syncGridColumn;
|
|
43
|
+
/** Handles a header-sort click: multi-column server-side sort, then reload. */
|
|
44
|
+
private columnSortHandler;
|
|
45
|
+
/** Computes the storage scope key for the current model/query. */
|
|
46
|
+
private columnWidthScopeKey;
|
|
47
|
+
/** Stable per-column identity: the query column's expression, else the
|
|
48
|
+
* server-provided originAttrId (covers the data-filtering scenario where
|
|
49
|
+
* the query has no columns and the server auto-generates them). */
|
|
50
|
+
private columnKey;
|
|
51
|
+
/** Applies a cached width to a grid column (called from onSyncGridColumn). */
|
|
52
|
+
private applyColumnWidth;
|
|
53
|
+
/** Persists a width when the user finishes a resize drag. */
|
|
54
|
+
private columnResizeHandler;
|
|
55
|
+
/** Loads the width map once per scope key, then refreshes to apply. */
|
|
56
|
+
private loadColumnWidths;
|
|
35
57
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EqContext, Widget } from '@easyquery/core';
|
|
1
|
+
import { EqContext, Widget, Query } from '@easyquery/core';
|
|
2
2
|
import { EntitiesPanelOptions } from './widget_options';
|
|
3
3
|
/**
|
|
4
4
|
* The entities panel wiget, implemented without JQuery.
|
|
@@ -11,12 +11,13 @@ export declare class EntitiesPanel extends Widget {
|
|
|
11
11
|
private filterBoxBlock;
|
|
12
12
|
private filterBoxInput;
|
|
13
13
|
private options;
|
|
14
|
+
private customQuery;
|
|
14
15
|
protected get cssPrefix(): string;
|
|
15
16
|
/**
|
|
16
17
|
* The default constructor.
|
|
17
18
|
* @param slot The html element.
|
|
18
19
|
*/
|
|
19
|
-
constructor(slot: HTMLElement);
|
|
20
|
+
constructor(slot: HTMLElement, customQuery?: Query);
|
|
20
21
|
getWidgetType(): string;
|
|
21
22
|
/**
|
|
22
23
|
* Initialize widget.
|
|
@@ -24,6 +25,7 @@ export declare class EntitiesPanel extends Widget {
|
|
|
24
25
|
* @param options The options.
|
|
25
26
|
*/
|
|
26
27
|
init(context: EqContext, options?: EntitiesPanelOptions): void;
|
|
28
|
+
getQuery(): Query;
|
|
27
29
|
/**
|
|
28
30
|
* Refresh widget implementation
|
|
29
31
|
*/
|
|
@@ -5,17 +5,18 @@ export declare class SortingBar extends Widget {
|
|
|
5
5
|
protected get cssPrefix(): string;
|
|
6
6
|
options: SortingBarOptions;
|
|
7
7
|
private queryEventCallbackId?;
|
|
8
|
+
private customQuery;
|
|
8
9
|
private columnsBlock;
|
|
9
10
|
private addRowButton;
|
|
10
11
|
sortMenu: PopupMenu;
|
|
11
12
|
private entitiesMenu;
|
|
12
|
-
constructor(slot: HTMLElement);
|
|
13
|
+
constructor(slot: HTMLElement, customQuery?: Query);
|
|
13
14
|
getWidgetType(): string;
|
|
14
15
|
init(context: EqContext, options?: SortingBarOptions): void;
|
|
15
16
|
private setOptions;
|
|
16
17
|
private attachQueryObserver;
|
|
17
18
|
private detachQueryObserver;
|
|
18
|
-
|
|
19
|
+
getQuery(): Query;
|
|
19
20
|
protected getModel(): DataModel;
|
|
20
21
|
protected destroyCore(): void;
|
|
21
22
|
protected refreshCore(): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@easyquery/ui",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.5.0-rc01",
|
|
4
4
|
"description": "EasyQuery.JS Community UI widgets",
|
|
5
5
|
"types": "./dist/types/public_api.d.ts",
|
|
6
6
|
"main": "./dist/easyquery.ui.cjs.js",
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"build": "npm run clear && rollup -c",
|
|
12
12
|
"watch": "rollup -c -w",
|
|
13
13
|
"dev": "npm run watch",
|
|
14
|
-
"docs": "typedoc src/public_api.ts --out ./docs"
|
|
14
|
+
"docs": "typedoc src/public_api.ts --out ./docs",
|
|
15
|
+
"test": "vitest run"
|
|
15
16
|
},
|
|
16
17
|
"author": "Korzh.com",
|
|
17
18
|
"homepage": "https://korzh.com/easyquery/javascript",
|
|
@@ -30,7 +31,7 @@
|
|
|
30
31
|
"bugs": "https://korzh.com/support",
|
|
31
32
|
"license": "LGPL-3.0",
|
|
32
33
|
"peerDependencies": {
|
|
33
|
-
"@easyquery/core": "^7.
|
|
34
|
+
"@easyquery/core": "^7.5.0-rc01"
|
|
34
35
|
},
|
|
35
36
|
"files": [
|
|
36
37
|
"dist",
|