polymatica-widget 2.1.13 → 2.1.14
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 +15 -15
- package/README.md +1 -1
- package/__internal__/constants.d.ts +1 -1
- package/__internal__/constants.js +4 -4
- package/__internal__/widget-options-tools.d.ts +4 -4
- package/__internal__/widget-options-tools.js +63 -63
- package/__internal__/widget-options.d.ts +68 -68
- package/__internal__/widget-options.js +31 -31
- package/config.d.ts +183 -183
- package/config.js +119 -119
- package/dataset.d.ts +35 -35
- package/dataset.js +13 -13
- package/index.d.ts +6 -6
- package/index.js +22 -22
- package/locale.d.ts +2 -2
- package/locale.js +2 -2
- package/package.json +2 -2
- package/provide-data.d.ts +11 -11
- package/provide-data.js +2 -2
- package/theme.d.ts +18 -14
- package/theme.js +2 -2
- package/tsconfig.json +15 -15
- package/widget.d.ts +26 -26
- package/widget.js +29 -29
package/config.d.ts
CHANGED
|
@@ -1,183 +1,183 @@
|
|
|
1
|
-
import { Text } from "./locale";
|
|
2
|
-
import { Options } from "./widget";
|
|
3
|
-
export declare enum Size {
|
|
4
|
-
Small = "small",
|
|
5
|
-
Medium = "medium",
|
|
6
|
-
Large = "large"
|
|
7
|
-
}
|
|
8
|
-
export declare enum Method {
|
|
9
|
-
Aggregate = "aggregate",
|
|
10
|
-
Table = "table",
|
|
11
|
-
PivotTable = "pivot"
|
|
12
|
-
}
|
|
13
|
-
export interface WidgetConfig {
|
|
14
|
-
label: Text;
|
|
15
|
-
icon: string;
|
|
16
|
-
size: Size | [Size, Size];
|
|
17
|
-
useTranslations?: boolean;
|
|
18
|
-
}
|
|
19
|
-
export interface SingleData {
|
|
20
|
-
data: DataConfig | (DataConfig & Repeatable);
|
|
21
|
-
}
|
|
22
|
-
export declare type MultiData<DataItemKeys extends string> = {
|
|
23
|
-
data: {
|
|
24
|
-
[Key in DataItemKeys]: DataConfig | (DataConfig & Repeatable);
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
export interface Repeatable {
|
|
28
|
-
repeatable: true | {
|
|
29
|
-
min?: number;
|
|
30
|
-
max?: number;
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
export interface DataConfig {
|
|
34
|
-
method: Method;
|
|
35
|
-
blocks: Block[];
|
|
36
|
-
validation?: {
|
|
37
|
-
requiredSome?: string[];
|
|
38
|
-
requiredEvery?: string[];
|
|
39
|
-
};
|
|
40
|
-
drilldown?: {
|
|
41
|
-
sources: string[];
|
|
42
|
-
};
|
|
43
|
-
heatmap?: {
|
|
44
|
-
targets: string[];
|
|
45
|
-
};
|
|
46
|
-
type?: string;
|
|
47
|
-
hideSort?: boolean;
|
|
48
|
-
hideCounter?: boolean;
|
|
49
|
-
}
|
|
50
|
-
export interface Block {
|
|
51
|
-
key: string;
|
|
52
|
-
label: Text;
|
|
53
|
-
icon?: string;
|
|
54
|
-
aggregation?: boolean;
|
|
55
|
-
max?: number;
|
|
56
|
-
}
|
|
57
|
-
interface CommonOptionsConfig {
|
|
58
|
-
change?(options: Options): void;
|
|
59
|
-
onAction?(target: string): void;
|
|
60
|
-
default: Options;
|
|
61
|
-
defaultInvalid?: boolean;
|
|
62
|
-
validators?: OptionsValidation;
|
|
63
|
-
}
|
|
64
|
-
export interface OptionsConfig {
|
|
65
|
-
options: (CommonOptionsConfig & {
|
|
66
|
-
render(options: Options): void;
|
|
67
|
-
dataDependent?: false;
|
|
68
|
-
}) | (CommonOptionsConfig & {
|
|
69
|
-
render(options: Options, data: unknown): void;
|
|
70
|
-
dataDependent: true;
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
export interface OptionsValidation {
|
|
74
|
-
[key: string]: OptionsValidator;
|
|
75
|
-
}
|
|
76
|
-
export interface OptionsValidator {
|
|
77
|
-
(value: any): Text | null;
|
|
78
|
-
}
|
|
79
|
-
export declare const STEP = 24;
|
|
80
|
-
export declare function title(label: Text, hint?: Text): void;
|
|
81
|
-
export declare function label(label: Text, hint?: Text): void;
|
|
82
|
-
export declare function spacer(span: number): void;
|
|
83
|
-
export declare function line(): void;
|
|
84
|
-
export declare function tabs(params: {
|
|
85
|
-
labels: {
|
|
86
|
-
label: Text;
|
|
87
|
-
value: string;
|
|
88
|
-
}[];
|
|
89
|
-
}): void;
|
|
90
|
-
export declare function tabPanels(params: {
|
|
91
|
-
items: Record<string, () => void>;
|
|
92
|
-
}): void;
|
|
93
|
-
export declare function text(params: {
|
|
94
|
-
key: string;
|
|
95
|
-
label: Text;
|
|
96
|
-
span?: number;
|
|
97
|
-
}): void;
|
|
98
|
-
export declare function number(params: {
|
|
99
|
-
key: string;
|
|
100
|
-
label: Text;
|
|
101
|
-
span?: number;
|
|
102
|
-
}): void;
|
|
103
|
-
export declare function integer(params: {
|
|
104
|
-
key: string;
|
|
105
|
-
label: Text;
|
|
106
|
-
span?: number;
|
|
107
|
-
}): void;
|
|
108
|
-
export declare function range(params: {
|
|
109
|
-
key: string;
|
|
110
|
-
label: Text;
|
|
111
|
-
span?: number;
|
|
112
|
-
}): void;
|
|
113
|
-
export declare function interval(params: {
|
|
114
|
-
key: string;
|
|
115
|
-
label: Text;
|
|
116
|
-
span?: number;
|
|
117
|
-
}): void;
|
|
118
|
-
export declare function date(params: {
|
|
119
|
-
key: string;
|
|
120
|
-
label: Text;
|
|
121
|
-
span?: number;
|
|
122
|
-
}): void;
|
|
123
|
-
export declare function time(params: {
|
|
124
|
-
key: string;
|
|
125
|
-
label: Text;
|
|
126
|
-
span?: number;
|
|
127
|
-
}): void;
|
|
128
|
-
export declare function dateTime(params: {
|
|
129
|
-
key: string;
|
|
130
|
-
label: Text;
|
|
131
|
-
span?: number;
|
|
132
|
-
}): void;
|
|
133
|
-
export declare function checkbox(params: {
|
|
134
|
-
key: string;
|
|
135
|
-
label: Text;
|
|
136
|
-
span?: number;
|
|
137
|
-
}): void;
|
|
138
|
-
export declare function radio(params: {
|
|
139
|
-
key: string;
|
|
140
|
-
label: Text;
|
|
141
|
-
options: {
|
|
142
|
-
label: Text;
|
|
143
|
-
value: string;
|
|
144
|
-
}[];
|
|
145
|
-
span?: number;
|
|
146
|
-
}): void;
|
|
147
|
-
export declare function radioButton(params: {
|
|
148
|
-
key: string;
|
|
149
|
-
label: Text;
|
|
150
|
-
options: {
|
|
151
|
-
label: Text;
|
|
152
|
-
value: string;
|
|
153
|
-
}[];
|
|
154
|
-
span?: number;
|
|
155
|
-
}): void;
|
|
156
|
-
export declare function select(params: {
|
|
157
|
-
key: string;
|
|
158
|
-
label: Text;
|
|
159
|
-
options: {
|
|
160
|
-
label: Text;
|
|
161
|
-
value: string;
|
|
162
|
-
}[];
|
|
163
|
-
span?: number;
|
|
164
|
-
}): void;
|
|
165
|
-
export declare function suggestion(params: {
|
|
166
|
-
key: string;
|
|
167
|
-
label: Text;
|
|
168
|
-
options: {
|
|
169
|
-
label: Text;
|
|
170
|
-
value: string;
|
|
171
|
-
}[];
|
|
172
|
-
span?: number;
|
|
173
|
-
}): void;
|
|
174
|
-
export declare function colorPicker(params: {
|
|
175
|
-
key: string;
|
|
176
|
-
label: Text;
|
|
177
|
-
span?: number;
|
|
178
|
-
}): void;
|
|
179
|
-
export declare function button(params: {
|
|
180
|
-
label: Text;
|
|
181
|
-
target: string;
|
|
182
|
-
}): void;
|
|
183
|
-
export {};
|
|
1
|
+
import { Text } from "./locale";
|
|
2
|
+
import { Options } from "./widget";
|
|
3
|
+
export declare enum Size {
|
|
4
|
+
Small = "small",
|
|
5
|
+
Medium = "medium",
|
|
6
|
+
Large = "large"
|
|
7
|
+
}
|
|
8
|
+
export declare enum Method {
|
|
9
|
+
Aggregate = "aggregate",
|
|
10
|
+
Table = "table",
|
|
11
|
+
PivotTable = "pivot"
|
|
12
|
+
}
|
|
13
|
+
export interface WidgetConfig {
|
|
14
|
+
label: Text;
|
|
15
|
+
icon: string;
|
|
16
|
+
size: Size | [Size, Size];
|
|
17
|
+
useTranslations?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface SingleData {
|
|
20
|
+
data: DataConfig | (DataConfig & Repeatable);
|
|
21
|
+
}
|
|
22
|
+
export declare type MultiData<DataItemKeys extends string> = {
|
|
23
|
+
data: {
|
|
24
|
+
[Key in DataItemKeys]: DataConfig | (DataConfig & Repeatable);
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export interface Repeatable {
|
|
28
|
+
repeatable: true | {
|
|
29
|
+
min?: number;
|
|
30
|
+
max?: number;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export interface DataConfig {
|
|
34
|
+
method: Method;
|
|
35
|
+
blocks: Block[];
|
|
36
|
+
validation?: {
|
|
37
|
+
requiredSome?: string[];
|
|
38
|
+
requiredEvery?: string[];
|
|
39
|
+
};
|
|
40
|
+
drilldown?: {
|
|
41
|
+
sources: string[];
|
|
42
|
+
};
|
|
43
|
+
heatmap?: {
|
|
44
|
+
targets: string[];
|
|
45
|
+
};
|
|
46
|
+
type?: string;
|
|
47
|
+
hideSort?: boolean;
|
|
48
|
+
hideCounter?: boolean;
|
|
49
|
+
}
|
|
50
|
+
export interface Block {
|
|
51
|
+
key: string;
|
|
52
|
+
label: Text;
|
|
53
|
+
icon?: string;
|
|
54
|
+
aggregation?: boolean;
|
|
55
|
+
max?: number;
|
|
56
|
+
}
|
|
57
|
+
interface CommonOptionsConfig {
|
|
58
|
+
change?(options: Options): void;
|
|
59
|
+
onAction?(target: string): void;
|
|
60
|
+
default: Options;
|
|
61
|
+
defaultInvalid?: boolean;
|
|
62
|
+
validators?: OptionsValidation;
|
|
63
|
+
}
|
|
64
|
+
export interface OptionsConfig {
|
|
65
|
+
options: (CommonOptionsConfig & {
|
|
66
|
+
render(options: Options): void;
|
|
67
|
+
dataDependent?: false;
|
|
68
|
+
}) | (CommonOptionsConfig & {
|
|
69
|
+
render(options: Options, data: unknown): void;
|
|
70
|
+
dataDependent: true;
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
export interface OptionsValidation {
|
|
74
|
+
[key: string]: OptionsValidator;
|
|
75
|
+
}
|
|
76
|
+
export interface OptionsValidator {
|
|
77
|
+
(value: any): Text | null;
|
|
78
|
+
}
|
|
79
|
+
export declare const STEP = 24;
|
|
80
|
+
export declare function title(label: Text, hint?: Text): void;
|
|
81
|
+
export declare function label(label: Text, hint?: Text): void;
|
|
82
|
+
export declare function spacer(span: number): void;
|
|
83
|
+
export declare function line(): void;
|
|
84
|
+
export declare function tabs(params: {
|
|
85
|
+
labels: {
|
|
86
|
+
label: Text;
|
|
87
|
+
value: string;
|
|
88
|
+
}[];
|
|
89
|
+
}): void;
|
|
90
|
+
export declare function tabPanels(params: {
|
|
91
|
+
items: Record<string, () => void>;
|
|
92
|
+
}): void;
|
|
93
|
+
export declare function text(params: {
|
|
94
|
+
key: string;
|
|
95
|
+
label: Text;
|
|
96
|
+
span?: number;
|
|
97
|
+
}): void;
|
|
98
|
+
export declare function number(params: {
|
|
99
|
+
key: string;
|
|
100
|
+
label: Text;
|
|
101
|
+
span?: number;
|
|
102
|
+
}): void;
|
|
103
|
+
export declare function integer(params: {
|
|
104
|
+
key: string;
|
|
105
|
+
label: Text;
|
|
106
|
+
span?: number;
|
|
107
|
+
}): void;
|
|
108
|
+
export declare function range(params: {
|
|
109
|
+
key: string;
|
|
110
|
+
label: Text;
|
|
111
|
+
span?: number;
|
|
112
|
+
}): void;
|
|
113
|
+
export declare function interval(params: {
|
|
114
|
+
key: string;
|
|
115
|
+
label: Text;
|
|
116
|
+
span?: number;
|
|
117
|
+
}): void;
|
|
118
|
+
export declare function date(params: {
|
|
119
|
+
key: string;
|
|
120
|
+
label: Text;
|
|
121
|
+
span?: number;
|
|
122
|
+
}): void;
|
|
123
|
+
export declare function time(params: {
|
|
124
|
+
key: string;
|
|
125
|
+
label: Text;
|
|
126
|
+
span?: number;
|
|
127
|
+
}): void;
|
|
128
|
+
export declare function dateTime(params: {
|
|
129
|
+
key: string;
|
|
130
|
+
label: Text;
|
|
131
|
+
span?: number;
|
|
132
|
+
}): void;
|
|
133
|
+
export declare function checkbox(params: {
|
|
134
|
+
key: string;
|
|
135
|
+
label: Text;
|
|
136
|
+
span?: number;
|
|
137
|
+
}): void;
|
|
138
|
+
export declare function radio(params: {
|
|
139
|
+
key: string;
|
|
140
|
+
label: Text;
|
|
141
|
+
options: {
|
|
142
|
+
label: Text;
|
|
143
|
+
value: string;
|
|
144
|
+
}[];
|
|
145
|
+
span?: number;
|
|
146
|
+
}): void;
|
|
147
|
+
export declare function radioButton(params: {
|
|
148
|
+
key: string;
|
|
149
|
+
label: Text;
|
|
150
|
+
options: {
|
|
151
|
+
label: Text;
|
|
152
|
+
value: string;
|
|
153
|
+
}[];
|
|
154
|
+
span?: number;
|
|
155
|
+
}): void;
|
|
156
|
+
export declare function select(params: {
|
|
157
|
+
key: string;
|
|
158
|
+
label: Text;
|
|
159
|
+
options: {
|
|
160
|
+
label: Text;
|
|
161
|
+
value: string;
|
|
162
|
+
}[];
|
|
163
|
+
span?: number;
|
|
164
|
+
}): void;
|
|
165
|
+
export declare function suggestion(params: {
|
|
166
|
+
key: string;
|
|
167
|
+
label: Text;
|
|
168
|
+
options: {
|
|
169
|
+
label: Text;
|
|
170
|
+
value: string;
|
|
171
|
+
}[];
|
|
172
|
+
span?: number;
|
|
173
|
+
}): void;
|
|
174
|
+
export declare function colorPicker(params: {
|
|
175
|
+
key: string;
|
|
176
|
+
label: Text;
|
|
177
|
+
span?: number;
|
|
178
|
+
}): void;
|
|
179
|
+
export declare function button(params: {
|
|
180
|
+
label: Text;
|
|
181
|
+
target: string;
|
|
182
|
+
}): void;
|
|
183
|
+
export {};
|
package/config.js
CHANGED
|
@@ -1,119 +1,119 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.button = exports.colorPicker = exports.suggestion = exports.select = exports.radioButton = exports.radio = exports.checkbox = exports.dateTime = exports.time = exports.date = exports.interval = exports.range = exports.integer = exports.number = exports.text = exports.tabPanels = exports.tabs = exports.line = exports.spacer = exports.label = exports.title = exports.STEP = exports.Method = exports.Size = void 0;
|
|
4
|
-
const constants_1 = require("./__internal__/constants");
|
|
5
|
-
const widget_options_1 = require("./__internal__/widget-options");
|
|
6
|
-
// enums
|
|
7
|
-
var Size;
|
|
8
|
-
(function (Size) {
|
|
9
|
-
Size["Small"] = "small";
|
|
10
|
-
Size["Medium"] = "medium";
|
|
11
|
-
Size["Large"] = "large";
|
|
12
|
-
})(Size = exports.Size || (exports.Size = {}));
|
|
13
|
-
var Method;
|
|
14
|
-
(function (Method) {
|
|
15
|
-
Method["Aggregate"] = "aggregate";
|
|
16
|
-
Method["Table"] = "table";
|
|
17
|
-
Method["PivotTable"] = "pivot";
|
|
18
|
-
})(Method = exports.Method || (exports.Method = {}));
|
|
19
|
-
// widget options
|
|
20
|
-
exports.STEP = 24;
|
|
21
|
-
// layout
|
|
22
|
-
function title(label, hint) {
|
|
23
|
-
push({
|
|
24
|
-
type: widget_options_1.WidgetOptionType.Title,
|
|
25
|
-
label,
|
|
26
|
-
hint,
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
exports.title = title;
|
|
30
|
-
function label(label, hint) {
|
|
31
|
-
push({
|
|
32
|
-
type: widget_options_1.WidgetOptionType.Label,
|
|
33
|
-
label,
|
|
34
|
-
hint,
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
exports.label = label;
|
|
38
|
-
function spacer(span) {
|
|
39
|
-
push({ type: widget_options_1.WidgetOptionType.Spacer, span });
|
|
40
|
-
}
|
|
41
|
-
exports.spacer = spacer;
|
|
42
|
-
function line() {
|
|
43
|
-
push({ type: widget_options_1.WidgetOptionType.LineHorizontal });
|
|
44
|
-
}
|
|
45
|
-
exports.line = line;
|
|
46
|
-
function tabs(params) {
|
|
47
|
-
push(Object.assign(Object.assign({}, params), { type: widget_options_1.WidgetOptionType.Tabs }));
|
|
48
|
-
}
|
|
49
|
-
exports.tabs = tabs;
|
|
50
|
-
function tabPanels(params) {
|
|
51
|
-
push(Object.assign(Object.assign({}, params), { type: widget_options_1.WidgetOptionType.TabPanels }));
|
|
52
|
-
}
|
|
53
|
-
exports.tabPanels = tabPanels;
|
|
54
|
-
// controls
|
|
55
|
-
function text(params) {
|
|
56
|
-
push(Object.assign(Object.assign({}, params), { type: widget_options_1.WidgetOptionType.Text }));
|
|
57
|
-
}
|
|
58
|
-
exports.text = text;
|
|
59
|
-
function number(params) {
|
|
60
|
-
push(Object.assign(Object.assign({}, params), { type: widget_options_1.WidgetOptionType.Number }));
|
|
61
|
-
}
|
|
62
|
-
exports.number = number;
|
|
63
|
-
function integer(params) {
|
|
64
|
-
push(Object.assign(Object.assign({}, params), { type: widget_options_1.WidgetOptionType.Integer }));
|
|
65
|
-
}
|
|
66
|
-
exports.integer = integer;
|
|
67
|
-
function range(params) {
|
|
68
|
-
push(Object.assign(Object.assign({}, params), { type: widget_options_1.WidgetOptionType.Range }));
|
|
69
|
-
}
|
|
70
|
-
exports.range = range;
|
|
71
|
-
function interval(params) {
|
|
72
|
-
push(Object.assign(Object.assign({}, params), { type: widget_options_1.WidgetOptionType.Interval }));
|
|
73
|
-
}
|
|
74
|
-
exports.interval = interval;
|
|
75
|
-
function date(params) {
|
|
76
|
-
push(Object.assign(Object.assign({}, params), { type: widget_options_1.WidgetOptionType.Date }));
|
|
77
|
-
}
|
|
78
|
-
exports.date = date;
|
|
79
|
-
function time(params) {
|
|
80
|
-
push(Object.assign(Object.assign({}, params), { type: widget_options_1.WidgetOptionType.Time }));
|
|
81
|
-
}
|
|
82
|
-
exports.time = time;
|
|
83
|
-
function dateTime(params) {
|
|
84
|
-
push(Object.assign(Object.assign({}, params), { type: widget_options_1.WidgetOptionType.DateTime }));
|
|
85
|
-
}
|
|
86
|
-
exports.dateTime = dateTime;
|
|
87
|
-
function checkbox(params) {
|
|
88
|
-
push(Object.assign(Object.assign({}, params), { type: widget_options_1.WidgetOptionType.Checkbox }));
|
|
89
|
-
}
|
|
90
|
-
exports.checkbox = checkbox;
|
|
91
|
-
function radio(params) {
|
|
92
|
-
push(Object.assign(Object.assign({}, params), { type: widget_options_1.WidgetOptionType.Radio }));
|
|
93
|
-
}
|
|
94
|
-
exports.radio = radio;
|
|
95
|
-
function radioButton(params) {
|
|
96
|
-
push(Object.assign(Object.assign({}, params), { type: widget_options_1.WidgetOptionType.RadioButtons }));
|
|
97
|
-
}
|
|
98
|
-
exports.radioButton = radioButton;
|
|
99
|
-
function select(params) {
|
|
100
|
-
push(Object.assign(Object.assign({}, params), { type: widget_options_1.WidgetOptionType.Select }));
|
|
101
|
-
}
|
|
102
|
-
exports.select = select;
|
|
103
|
-
function suggestion(params) {
|
|
104
|
-
push(Object.assign(Object.assign({}, params), { type: widget_options_1.WidgetOptionType.Select }));
|
|
105
|
-
}
|
|
106
|
-
exports.suggestion = suggestion;
|
|
107
|
-
function colorPicker(params) {
|
|
108
|
-
push(Object.assign(Object.assign({}, params), { type: widget_options_1.WidgetOptionType.ColorPicker }));
|
|
109
|
-
}
|
|
110
|
-
exports.colorPicker = colorPicker;
|
|
111
|
-
// actions
|
|
112
|
-
function button(params) {
|
|
113
|
-
push(Object.assign(Object.assign({}, params), { type: widget_options_1.WidgetOptionType.Button }));
|
|
114
|
-
}
|
|
115
|
-
exports.button = button;
|
|
116
|
-
function push(option) {
|
|
117
|
-
const target = globalThis[constants_1.widgetOptionsTargetKey];
|
|
118
|
-
target.push(option);
|
|
119
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.button = exports.colorPicker = exports.suggestion = exports.select = exports.radioButton = exports.radio = exports.checkbox = exports.dateTime = exports.time = exports.date = exports.interval = exports.range = exports.integer = exports.number = exports.text = exports.tabPanels = exports.tabs = exports.line = exports.spacer = exports.label = exports.title = exports.STEP = exports.Method = exports.Size = void 0;
|
|
4
|
+
const constants_1 = require("./__internal__/constants");
|
|
5
|
+
const widget_options_1 = require("./__internal__/widget-options");
|
|
6
|
+
// enums
|
|
7
|
+
var Size;
|
|
8
|
+
(function (Size) {
|
|
9
|
+
Size["Small"] = "small";
|
|
10
|
+
Size["Medium"] = "medium";
|
|
11
|
+
Size["Large"] = "large";
|
|
12
|
+
})(Size = exports.Size || (exports.Size = {}));
|
|
13
|
+
var Method;
|
|
14
|
+
(function (Method) {
|
|
15
|
+
Method["Aggregate"] = "aggregate";
|
|
16
|
+
Method["Table"] = "table";
|
|
17
|
+
Method["PivotTable"] = "pivot";
|
|
18
|
+
})(Method = exports.Method || (exports.Method = {}));
|
|
19
|
+
// widget options
|
|
20
|
+
exports.STEP = 24;
|
|
21
|
+
// layout
|
|
22
|
+
function title(label, hint) {
|
|
23
|
+
push({
|
|
24
|
+
type: widget_options_1.WidgetOptionType.Title,
|
|
25
|
+
label,
|
|
26
|
+
hint,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
exports.title = title;
|
|
30
|
+
function label(label, hint) {
|
|
31
|
+
push({
|
|
32
|
+
type: widget_options_1.WidgetOptionType.Label,
|
|
33
|
+
label,
|
|
34
|
+
hint,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
exports.label = label;
|
|
38
|
+
function spacer(span) {
|
|
39
|
+
push({ type: widget_options_1.WidgetOptionType.Spacer, span });
|
|
40
|
+
}
|
|
41
|
+
exports.spacer = spacer;
|
|
42
|
+
function line() {
|
|
43
|
+
push({ type: widget_options_1.WidgetOptionType.LineHorizontal });
|
|
44
|
+
}
|
|
45
|
+
exports.line = line;
|
|
46
|
+
function tabs(params) {
|
|
47
|
+
push(Object.assign(Object.assign({}, params), { type: widget_options_1.WidgetOptionType.Tabs }));
|
|
48
|
+
}
|
|
49
|
+
exports.tabs = tabs;
|
|
50
|
+
function tabPanels(params) {
|
|
51
|
+
push(Object.assign(Object.assign({}, params), { type: widget_options_1.WidgetOptionType.TabPanels }));
|
|
52
|
+
}
|
|
53
|
+
exports.tabPanels = tabPanels;
|
|
54
|
+
// controls
|
|
55
|
+
function text(params) {
|
|
56
|
+
push(Object.assign(Object.assign({}, params), { type: widget_options_1.WidgetOptionType.Text }));
|
|
57
|
+
}
|
|
58
|
+
exports.text = text;
|
|
59
|
+
function number(params) {
|
|
60
|
+
push(Object.assign(Object.assign({}, params), { type: widget_options_1.WidgetOptionType.Number }));
|
|
61
|
+
}
|
|
62
|
+
exports.number = number;
|
|
63
|
+
function integer(params) {
|
|
64
|
+
push(Object.assign(Object.assign({}, params), { type: widget_options_1.WidgetOptionType.Integer }));
|
|
65
|
+
}
|
|
66
|
+
exports.integer = integer;
|
|
67
|
+
function range(params) {
|
|
68
|
+
push(Object.assign(Object.assign({}, params), { type: widget_options_1.WidgetOptionType.Range }));
|
|
69
|
+
}
|
|
70
|
+
exports.range = range;
|
|
71
|
+
function interval(params) {
|
|
72
|
+
push(Object.assign(Object.assign({}, params), { type: widget_options_1.WidgetOptionType.Interval }));
|
|
73
|
+
}
|
|
74
|
+
exports.interval = interval;
|
|
75
|
+
function date(params) {
|
|
76
|
+
push(Object.assign(Object.assign({}, params), { type: widget_options_1.WidgetOptionType.Date }));
|
|
77
|
+
}
|
|
78
|
+
exports.date = date;
|
|
79
|
+
function time(params) {
|
|
80
|
+
push(Object.assign(Object.assign({}, params), { type: widget_options_1.WidgetOptionType.Time }));
|
|
81
|
+
}
|
|
82
|
+
exports.time = time;
|
|
83
|
+
function dateTime(params) {
|
|
84
|
+
push(Object.assign(Object.assign({}, params), { type: widget_options_1.WidgetOptionType.DateTime }));
|
|
85
|
+
}
|
|
86
|
+
exports.dateTime = dateTime;
|
|
87
|
+
function checkbox(params) {
|
|
88
|
+
push(Object.assign(Object.assign({}, params), { type: widget_options_1.WidgetOptionType.Checkbox }));
|
|
89
|
+
}
|
|
90
|
+
exports.checkbox = checkbox;
|
|
91
|
+
function radio(params) {
|
|
92
|
+
push(Object.assign(Object.assign({}, params), { type: widget_options_1.WidgetOptionType.Radio }));
|
|
93
|
+
}
|
|
94
|
+
exports.radio = radio;
|
|
95
|
+
function radioButton(params) {
|
|
96
|
+
push(Object.assign(Object.assign({}, params), { type: widget_options_1.WidgetOptionType.RadioButtons }));
|
|
97
|
+
}
|
|
98
|
+
exports.radioButton = radioButton;
|
|
99
|
+
function select(params) {
|
|
100
|
+
push(Object.assign(Object.assign({}, params), { type: widget_options_1.WidgetOptionType.Select }));
|
|
101
|
+
}
|
|
102
|
+
exports.select = select;
|
|
103
|
+
function suggestion(params) {
|
|
104
|
+
push(Object.assign(Object.assign({}, params), { type: widget_options_1.WidgetOptionType.Select }));
|
|
105
|
+
}
|
|
106
|
+
exports.suggestion = suggestion;
|
|
107
|
+
function colorPicker(params) {
|
|
108
|
+
push(Object.assign(Object.assign({}, params), { type: widget_options_1.WidgetOptionType.ColorPicker }));
|
|
109
|
+
}
|
|
110
|
+
exports.colorPicker = colorPicker;
|
|
111
|
+
// actions
|
|
112
|
+
function button(params) {
|
|
113
|
+
push(Object.assign(Object.assign({}, params), { type: widget_options_1.WidgetOptionType.Button }));
|
|
114
|
+
}
|
|
115
|
+
exports.button = button;
|
|
116
|
+
function push(option) {
|
|
117
|
+
const target = globalThis[constants_1.widgetOptionsTargetKey];
|
|
118
|
+
target.push(option);
|
|
119
|
+
}
|
package/dataset.d.ts
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
export declare enum ColumnType {
|
|
2
|
-
String = "string",
|
|
3
|
-
Number = "number",
|
|
4
|
-
Date = "date",
|
|
5
|
-
Array = "array",
|
|
6
|
-
Object = "object",
|
|
7
|
-
Boolean = "boolean"
|
|
8
|
-
}
|
|
9
|
-
export interface Dataset {
|
|
10
|
-
readonly name: string;
|
|
11
|
-
readonly columns: Column[];
|
|
12
|
-
readonly columnsByBlock: {
|
|
13
|
-
[blockKey: string]: Column[];
|
|
14
|
-
};
|
|
15
|
-
readonly rows: DatasetRow[];
|
|
16
|
-
readonly heatmap: {
|
|
17
|
-
[path: Column["path"]]: Heatmap;
|
|
18
|
-
};
|
|
19
|
-
readonly events: {
|
|
20
|
-
onHighlight: (rowIndexArray: number[]) => void;
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
export interface Heatmap {
|
|
24
|
-
getColor(value: number): string;
|
|
25
|
-
}
|
|
26
|
-
export interface DatasetRow {
|
|
27
|
-
[path: string]: any;
|
|
28
|
-
}
|
|
29
|
-
export interface Column {
|
|
30
|
-
readonly type: ColumnType;
|
|
31
|
-
readonly name: string;
|
|
32
|
-
readonly path: string;
|
|
33
|
-
interact(rowIndex: number): void;
|
|
34
|
-
format(value: any): string;
|
|
35
|
-
}
|
|
1
|
+
export declare enum ColumnType {
|
|
2
|
+
String = "string",
|
|
3
|
+
Number = "number",
|
|
4
|
+
Date = "date",
|
|
5
|
+
Array = "array",
|
|
6
|
+
Object = "object",
|
|
7
|
+
Boolean = "boolean"
|
|
8
|
+
}
|
|
9
|
+
export interface Dataset {
|
|
10
|
+
readonly name: string;
|
|
11
|
+
readonly columns: Column[];
|
|
12
|
+
readonly columnsByBlock: {
|
|
13
|
+
[blockKey: string]: Column[];
|
|
14
|
+
};
|
|
15
|
+
readonly rows: DatasetRow[];
|
|
16
|
+
readonly heatmap: {
|
|
17
|
+
[path: Column["path"]]: Heatmap;
|
|
18
|
+
};
|
|
19
|
+
readonly events: {
|
|
20
|
+
onHighlight: (rowIndexArray: number[]) => void;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export interface Heatmap {
|
|
24
|
+
getColor(value: number): string;
|
|
25
|
+
}
|
|
26
|
+
export interface DatasetRow {
|
|
27
|
+
[path: string]: any;
|
|
28
|
+
}
|
|
29
|
+
export interface Column {
|
|
30
|
+
readonly type: ColumnType;
|
|
31
|
+
readonly name: string;
|
|
32
|
+
readonly path: string;
|
|
33
|
+
interact(rowIndex: number): void;
|
|
34
|
+
format(value: any): string;
|
|
35
|
+
}
|