Skip to content

Commit d8bddba

Browse files
authored
update va-report-components v2.6.0 doc and changelog (#61)
1 parent 7158a6d commit d8bddba

File tree

4 files changed

+209
-0
lines changed

4 files changed

+209
-0
lines changed

sdk/va-report-components/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## 2.6.0 (January 18, 2024)
2+
3+
### Added
4+
- SAS Viya 2024.01 support (Report Package version 42)
5+
- `readyState` property on `ObjectHandle`
6+
- `readyStateChanged` event type on `ObjectHandle`
7+
- `hideLoadImage` attribute on `sas-report-object`
8+
19
## 2.5.0 (December 14, 2023)
210

311
### Added
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
---
2+
id: version-2.6.0-ObjectHandle
3+
title: ObjectHandle
4+
original_id: ObjectHandle
5+
---
6+
7+
An `ObjectHandle` is used to perform actions on a single object in an open
8+
report. An object's handle can be obtained using the `getObjectHandle` method
9+
on a [`ReportHandle`](ReportHandle.md).
10+
11+
When a report element is assigned new attribute values or removed from the DOM,
12+
any `ObjectHandles` obtained from that element are invalidated and should be
13+
discarded.
14+
15+
## Properties
16+
17+
### readyState: string
18+
The ready state of the report object. When this value changes, a `readyStateChanged` event is fired on the ObjectHandle.
19+
20+
This value can be one of the following:
21+
- `"contentLoading"` when the report object is still loading its content.
22+
- `"complete"` when the report object has finished loading.
23+
- `"error"` when the report object encountered an error and could not load.
24+
25+
## Methods
26+
27+
### exportData(format: string, options?: ExportDataOptions): Promise\<string>
28+
Exports a file that contains the object's data, and returns a URL to the file.
29+
30+
`format` defines the format of the data output file.
31+
Supported formats:
32+
- `"XLSX"`
33+
- `"CSV"`
34+
- `"TSV"`
35+
36+
`options` is an [`ExportDataOptions`](ExportDataOptions.md) bundle that modifies properties of the exported data file.
37+
38+
If no `options` parameter is supplied, the data will be exported using the default option values.
39+
40+
### exportPDF(options?: ExportPDFOptions): Promise\<string>
41+
42+
Exports a PDF of the report object and returns a URL to the PDF document.
43+
44+
`options` is an [`ExportPDFOptions`](ExportPDFOptions.md) that controls the format of the exported PDF document. The option `includedReportObjects` does not apply when exporting a report object.
45+
46+
If no `options` parameter is supplied, the report is exported using the default options values.
47+
48+
### refreshData(): void
49+
50+
Refreshes the data for the report object that is controlled by the
51+
`ObjectHandle`.
52+
53+
### getData(options?: Object): ReportObjectResultData[]
54+
55+
Returns all of the data from the report object. This data matches what appears in the report object, including any filters that have been applied.
56+
57+
#### Arguments
58+
59+
`options` is an optional options bundle for customizing the returned data. The following options are supported:
60+
61+
- `formatData` specifies the format of the returned data.
62+
- `true` returns all formatted data.
63+
- `false` returns all unformatted data.
64+
- `"datesOnly"` `default` returns SAS date values as formatted data and returns all other values as unformatted data.
65+
66+
#### Return value
67+
68+
Returns an array of [`ReportObjectResultData`](ReportObjectResultData.md) objects, where each object is associated with one data set.
69+
70+
### getSelectedData(options?: Object): ReportObjectResultData[]
71+
72+
Returns a user's selection data from the report object. Returns an empty array if the object has no selections.
73+
74+
#### Arguments
75+
76+
`options` is an optional options bundle for customizing the returned data. The following options are supported:
77+
78+
- `formatData` specifies the format of the returned data.
79+
- `true` returns all formatted data.
80+
- `false` returns all unformatted data.
81+
- `"datesOnly"` `default` returns SAS date values as formatted data and returns all other values as unformatted data.
82+
83+
#### Return value
84+
85+
Returns an array of [`ReportObjectResultData`](ReportObjectResultData.md) objects, where each object is associated with one data set.
86+
87+
For user selection data, the ReportObjectResultData property `columns` will never include values for `usage`, `aggregation`, or `format`.
88+
89+
### addEventListener(eventType: string, listener: (event: Object) => void)
90+
91+
Adds an event listener to the `ObjectHandle` to call the supplied listener when the specified event occurs.
92+
93+
#### Arguments
94+
95+
`eventType` is a string that represents the event type to listen for. These event types are supported:
96+
- `"selectionChanged"` for listening for selection changes in the object.
97+
- `"readyStateChanged"` for listening to changes on the `readyState` property.
98+
99+
`listener` is an event listener callback function. When the event occurs, `listener` is called and passed an event object containing the following properties:
100+
- `type` is a string that matches the event type.
101+
- `target` refers to the ObjectHandle that the event occurred on.
102+
103+
### removeEventListener(eventType: string, listener: (event: Object) => void)
104+
105+
Removes the previously registered event listener from the `ObjectHandle`.
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
---
2+
id: version-2.6.0-SASReportObjectElement
3+
title: SASReportObjectElement
4+
original_id: SASReportObjectElement
5+
---
6+
7+
`SASReportObjectElement` is a custom HTML element that renders a report object. This could be a single object or a
8+
container of multiple objects. This element extends <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement">`HTMLElement`</a>.
9+
10+
To find the correct values for `url`, `reportUri`, and `objectName`, see [the Getting Started page](getting-started.md#create-a-custom-html-tag).
11+
12+
## Custom Element Tag
13+
14+
```html
15+
<sas-report-object
16+
authenticationType="guest"
17+
url="http://my-viya-server.com"
18+
reportUri="/reports/reports/c3c6befb-3981-4c9e-b011-7dc11dec5e37"
19+
objectName="ve27"
20+
></sas-report-object>
21+
```
22+
23+
## Attributes
24+
25+
### `authenticationType: string`
26+
27+
Choose the method to authenticate requests to the SAS Viya server.
28+
29+
- `'guest'` automatically signs in to the SAS Viya server as the guest user.
30+
- `'credentials'` uses SAS Logon to establish an authenticated session.
31+
32+
default value: `'credentials'`
33+
34+
### `url: string`
35+
36+
Specify the URL of the SAS Viya server that hosts the report. This is the full context root, including the protocol,
37+
optional port, and host.
38+
39+
### `reportUri: string`
40+
41+
Specify the report URI.
42+
43+
### `packageUri: string`
44+
45+
Specify the base location of the SAS report package that was exported from SAS Visual Analytics. This can be absolute or relative to the page. `authenticationType`, `url`, and `reportUri` are ignored when you set this property.
46+
47+
See [Export Report Package](guides/export-report-package.md)
48+
49+
### `objectName: string`
50+
51+
Specify the name of the object from the report to display.
52+
53+
### `restrictViewportGestures: boolean`
54+
55+
When `true`, report objects that support zooming require a modifier key be used in addition to the scroll wheel. Enable restrictViewportGestures when embedding elements in a layout that causes overflow. This reserves the scroll-wheel action for page scrolling.
56+
57+
default value: `true`
58+
59+
### `reportContextKey: string`
60+
61+
`reportContextKey` controls the sharing of report contexts between different `SASReportObjectElement` and `SASReportPageElement` elements that originate from the same report. A shared report context allows for report actions, like filtering and linked selections, to occur between objects. Objects that are a report context also have the same shared instance of a `ReportHandle` and all report parameters are shared. In contrast, unique report contexts do not allow for actions across elements and result in a unique `Report Handle`. Unique report contexts also allow for multiple instances of the same report object to be shown at one time, which is not possible when using a shared report context. By default, `SASReportObjectElement`s share a report context with other elements using the same `reportUri` or `packageUri`. Setting different `reportContextKey` values on elements from the same report will result in separate report contexts.
62+
63+
default value: `undefined`<br>
64+
default behavior: use a shared report context per report
65+
66+
### `hideLoadImage: boolean`
67+
68+
When `false`, report objects display a placeholder static image of the report object while it is loading. `true` hides this placeholder and displays a loading indicator.
69+
70+
default value: `false`
71+
72+
73+
## Properties
74+
75+
### `menuItemProvider: MenuItemProvider`
76+
77+
A [`MenuItemProvider`](MenuItemProvider.md) function that generates custom menu content for this element.
78+
79+
## Methods
80+
81+
### `getReportHandle(): Promise<ReportHandle>`
82+
83+
Get a [ReportHandle](ReportHandle.md) for controlling the state of the
84+
current report.
85+
86+
If called before the element is added to the DOM, the promise will resolve
87+
after the object begins to load.
88+
89+
The [ReportHandle](ReportHandle.md) is invalidated when attributes on the
90+
`SASReportObjectElement` are changed and when the element is removed from the
91+
DOM. To obtain another [ReportHandle](ReportHandle.md), discard the previous
92+
result and call `getReportHandle` again.
93+
94+
[ReportHandles](ReportHandle.md) from `SASReportObjectElement` are shared
95+
between objects from the same report.

sdk/va-report-components/documentation/website/versions.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[
2+
"2.6.0",
23
"2.5.0",
34
"2.4.0",
45
"2.3.0",

0 commit comments

Comments
 (0)