@olenbetong/appframe-core 2.11.9 → 2.12.0
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/dist/esm/af.common.js +1979 -609
- package/dist/esm/af.common.legacy.js +1933 -609
- package/dist/esm/af.common.legacy.min.js +4 -3
- package/dist/esm/af.common.legacy.min.js.map +1 -7
- package/dist/esm/af.common.min.js +4 -3
- package/dist/esm/af.common.min.js.map +1 -7
- package/dist/iife/af.common.js +2140 -694
- package/dist/iife/af.common.legacy.js +2094 -694
- package/dist/iife/af.common.legacy.min.js +4 -3
- package/dist/iife/af.common.legacy.min.js.map +1 -7
- package/dist/iife/af.common.min.js +4 -3
- package/dist/iife/af.common.min.js.map +1 -7
- package/es/alert.js +16 -1
- package/es/filter/convertFilter.d.ts +23 -0
- package/es/filter/convertFilter.js +26 -0
- package/es/filter/describeFilter.d.ts +13 -0
- package/es/filter/describeFilter.js +60 -0
- package/es/filter/describeFilter.test.d.ts +1 -0
- package/es/filter/describeFilter.test.js +68 -0
- package/es/filter/fields.d.ts +28 -0
- package/es/filter/fields.js +37 -0
- package/es/filter/fields.test.d.ts +1 -0
- package/es/filter/fields.test.js +49 -0
- package/es/filter/index.d.ts +8 -0
- package/es/filter/index.js +7 -0
- package/es/filter/operators.d.ts +37 -0
- package/es/filter/operators.js +229 -0
- package/es/filter/operators.test.d.ts +1 -0
- package/es/filter/operators.test.js +106 -0
- package/es/filter/savedFilters.d.ts +111 -0
- package/es/filter/savedFilters.js +118 -0
- package/es/filter/savedFilters.test.d.ts +1 -0
- package/es/filter/savedFilters.test.js +108 -0
- package/es/filter/standardLayout.d.ts +18 -0
- package/es/filter/standardLayout.js +55 -0
- package/es/filter/standardLayout.test.d.ts +1 -0
- package/es/filter/standardLayout.test.js +66 -0
- package/es/filter/tree.d.ts +70 -0
- package/es/filter/tree.js +185 -0
- package/es/filter/tree.test.d.ts +1 -0
- package/es/filter/tree.test.js +184 -0
- package/es/filter/types.d.ts +73 -0
- package/es/filter/types.js +1 -0
- package/es/index.d.ts +2 -0
- package/es/index.js +4 -2
- package/es/parseFunc.js +19 -2
- package/es/parseFunc.test.js +48 -4
- package/es/report/index.d.ts +6 -0
- package/es/report/index.js +5 -0
- package/es/report/parameterDefaults.d.ts +26 -0
- package/es/report/parameterDefaults.js +77 -0
- package/es/report/parameters.d.ts +46 -0
- package/es/report/parameters.js +188 -0
- package/es/report/parameters.test.d.ts +1 -0
- package/es/report/parameters.test.js +161 -0
- package/es/report/recordSource.d.ts +30 -0
- package/es/report/recordSource.js +105 -0
- package/es/report/render.d.ts +81 -0
- package/es/report/render.js +219 -0
- package/es/report/render.test.d.ts +1 -0
- package/es/report/render.test.js +144 -0
- package/es/report/report.d.ts +16 -0
- package/es/report/report.js +50 -0
- package/es/report/report.test.d.ts +1 -0
- package/es/report/report.test.js +86 -0
- package/es/report/types.d.ts +124 -0
- package/es/report/types.js +8 -0
- package/package.json +7 -7
- package/src/alert.ts +16 -1
- package/src/filter/convertFilter.ts +47 -0
- package/src/filter/describeFilter.test.ts +103 -0
- package/src/filter/describeFilter.ts +79 -0
- package/src/filter/fields.test.ts +58 -0
- package/src/filter/fields.ts +56 -0
- package/src/filter/index.ts +62 -0
- package/src/filter/operators.test.ts +136 -0
- package/src/filter/operators.ts +252 -0
- package/src/filter/savedFilters.test.ts +145 -0
- package/src/filter/savedFilters.ts +192 -0
- package/src/filter/standardLayout.test.ts +88 -0
- package/src/filter/standardLayout.ts +65 -0
- package/src/filter/tree.test.ts +258 -0
- package/src/filter/tree.ts +238 -0
- package/src/filter/types.ts +146 -0
- package/src/index.ts +3 -1
- package/src/parseFunc.test.ts +61 -4
- package/src/parseFunc.ts +29 -2
- package/src/report/index.ts +37 -0
- package/src/report/parameterDefaults.ts +101 -0
- package/src/report/parameters.test.ts +218 -0
- package/src/report/parameters.ts +230 -0
- package/src/report/recordSource.ts +123 -0
- package/src/report/render.test.ts +230 -0
- package/src/report/render.ts +269 -0
- package/src/report/report.test.ts +104 -0
- package/src/report/report.ts +51 -0
- package/src/report/types.ts +135 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Report metadata — the shape of a report and its parameters, as the Windows
|
|
3
|
+
* report launcher understands them.
|
|
4
|
+
*
|
|
5
|
+
* The loading lives in `useReport` in `@olenbetong/appframe-react`; everything
|
|
6
|
+
* here is pure.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The parameter types `sviw_WinClient_ReportsParameters.DataType` uses. The
|
|
11
|
+
* Windows launcher creates a text edit, a numeric edit, a date edit or a check
|
|
12
|
+
* edit from this, unless the parameter has a lookup or a fixed item list.
|
|
13
|
+
*/
|
|
14
|
+
export type ReportParameterType = "String" | "Integer" | "Double" | "Date" | "Boolean";
|
|
15
|
+
|
|
16
|
+
/** How a parameter should be edited. Derived from the metadata, not stored. */
|
|
17
|
+
export type ReportParameterEditor = "text" | "number" | "date" | "boolean" | "select" | "lookup";
|
|
18
|
+
|
|
19
|
+
/** A column selected by an `afRecordSource`. */
|
|
20
|
+
export type ReportRecordSourceColumn = {
|
|
21
|
+
name: string;
|
|
22
|
+
/** The field type the web data API expects, mapped from the CLR type. */
|
|
23
|
+
type: "string" | "number" | "boolean" | "date";
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/** A lookup source parsed out of a parameter's `afRecordSource` XML. */
|
|
27
|
+
export type ReportRecordSource = {
|
|
28
|
+
viewName: string;
|
|
29
|
+
/** The columns the record source selects, in order. */
|
|
30
|
+
columns: ReportRecordSourceColumn[];
|
|
31
|
+
whereClause: string | null;
|
|
32
|
+
filterString: string | null;
|
|
33
|
+
maxRecords: number | null;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/** A report parameter, ready to be rendered. */
|
|
37
|
+
export type ReportParameter = {
|
|
38
|
+
name: string;
|
|
39
|
+
/** Label shown next to the editor. Falls back to the name. */
|
|
40
|
+
label: string;
|
|
41
|
+
/** Help text for the editor. */
|
|
42
|
+
description: string | null;
|
|
43
|
+
type: ReportParameterType;
|
|
44
|
+
editor: ReportParameterEditor;
|
|
45
|
+
/**
|
|
46
|
+
* The raw default. A value matching `^[a-z]stp_` names a stored procedure
|
|
47
|
+
* that produces the default; see `isProcedureDefault`.
|
|
48
|
+
*/
|
|
49
|
+
defaultValue: string | null;
|
|
50
|
+
/** Fixed list of choices, one per line in `Items`. */
|
|
51
|
+
items: string[];
|
|
52
|
+
/** Lookup source, when the parameter is backed by a view. */
|
|
53
|
+
recordSource: ReportRecordSource | null;
|
|
54
|
+
/** The lookup column holding the value to send to the report. */
|
|
55
|
+
valueMember: string | null;
|
|
56
|
+
/** The lookup column to show. The first column that is not the value member. */
|
|
57
|
+
displayMember: string | null;
|
|
58
|
+
sortOrder: number;
|
|
59
|
+
/** Preferred size of the lookup popup, in pixels. */
|
|
60
|
+
lookupWidth: number | null;
|
|
61
|
+
lookupHeight: number | null;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
/** A raw `sviw_WinClient_ReportsParameters` record. */
|
|
65
|
+
export type ReportParameterRecord = {
|
|
66
|
+
Name?: string | null;
|
|
67
|
+
Label?: string | null;
|
|
68
|
+
Description?: string | null;
|
|
69
|
+
DataType?: string | null;
|
|
70
|
+
DefaultValue?: string | null;
|
|
71
|
+
Items?: string | null;
|
|
72
|
+
RecordSource?: string | null;
|
|
73
|
+
ValueMember?: string | null;
|
|
74
|
+
ValueListViewName?: string | null;
|
|
75
|
+
SortOrder?: number | null;
|
|
76
|
+
LookupWidth?: number | null;
|
|
77
|
+
LookupHeight?: number | null;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
/** Output formats a report can be rendered to. */
|
|
81
|
+
export type ReportFormat = "PDF" | "XLSX" | "XLS" | "CSV" | "HTML" | "RTF" | "MHT" | "TEXT" | "IMAGE";
|
|
82
|
+
|
|
83
|
+
/** A report, as the launcher needs it. */
|
|
84
|
+
export type Report = {
|
|
85
|
+
reportId: string;
|
|
86
|
+
/**
|
|
87
|
+
* The report's number, which is what users refer to a report by — it is
|
|
88
|
+
* printed in the footer of every report.
|
|
89
|
+
*/
|
|
90
|
+
shortId: number | null;
|
|
91
|
+
title: string | null;
|
|
92
|
+
description: string | null;
|
|
93
|
+
/** The view the report reads, resolved from its record source. */
|
|
94
|
+
viewName: string | null;
|
|
95
|
+
/**
|
|
96
|
+
* The filter the report is designed with. Used unless the launcher is opened
|
|
97
|
+
* with an explicit filter.
|
|
98
|
+
*/
|
|
99
|
+
initialFilter: string | null;
|
|
100
|
+
/** True when the report has a title band the user may override. */
|
|
101
|
+
hasTitle: boolean;
|
|
102
|
+
/** True when the report has a header band the user may fill in. */
|
|
103
|
+
hasHeader: boolean;
|
|
104
|
+
/** The formats the report may be rendered to, in the order they are offered. */
|
|
105
|
+
formats: ReportFormat[];
|
|
106
|
+
timeout: number | null;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* A raw `sviw_WinClient_MyReports` record, optionally merged with the
|
|
111
|
+
* `HasTitle` / `HasHeader` columns from `sviw_WinClient_ReportsWeb`.
|
|
112
|
+
*/
|
|
113
|
+
export type ReportRecord = {
|
|
114
|
+
ReportID?: string | null;
|
|
115
|
+
ShortID?: number | null;
|
|
116
|
+
Title?: string | null;
|
|
117
|
+
Description?: string | null;
|
|
118
|
+
RecordSource?: string | null;
|
|
119
|
+
FormatPDF?: boolean | number | null;
|
|
120
|
+
FormatCSV?: boolean | number | null;
|
|
121
|
+
FormatHTML?: boolean | number | null;
|
|
122
|
+
FormatRTF?: boolean | number | null;
|
|
123
|
+
FormatMHT?: boolean | number | null;
|
|
124
|
+
FormatTEXT?: boolean | number | null;
|
|
125
|
+
FormatIMAGE?: boolean | number | null;
|
|
126
|
+
HasTitle?: boolean | number | null;
|
|
127
|
+
HasHeader?: boolean | number | null;
|
|
128
|
+
Timeout?: number | null;
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
/** A parameter value, as sent to the render endpoint. */
|
|
132
|
+
export type ReportParameterValue = string | number | boolean | null;
|
|
133
|
+
|
|
134
|
+
/** Parameter values by parameter name. */
|
|
135
|
+
export type ReportParameterValues = Record<string, ReportParameterValue>;
|