Commit 3153b72
Or Shemesh
Merged PR 320270: Add support of registering external components to SDK
Add support of registering external components to SDK
How does it work?
1. User creates a new embed component extending `Embed` in his project
2. User implements the necessary code in FE to support hosting of the new component and handling events
3. Needed code to embed the new component:
`powerbi.register(componentType, embedComponentFactory, routerEventUrls);`
`powerbi.embed(embedContainer, config);`
powerbi.register:
- `componentType`: string representing the component type in embed configuration interface
- `embedComponentFactory`: function that returns a new instance of the embed component.
- `routerEventUrls`: list of urls to register, must use uniqueId and eventName as keys. something like that: `/componentName/:uniqueId/events/:eventName`
Example of calling powerbi.register for metric-picker component:
```
this.register(
'metric_picker',
(service, element, config, phasedRender, isBootstrap) => new MetricPicker(service, element, config, phasedRender, isBootstrap),
['/metricPicker/:uniqueId/events/:eventName']
);
```1 parent 9e65b27 commit 3153b72
File tree
5 files changed
+577
-21
lines changed- dist
- src
- test
5 files changed
+577
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2137 | 2137 | | |
2138 | 2138 | | |
2139 | 2139 | | |
| 2140 | + | |
| 2141 | + | |
| 2142 | + | |
| 2143 | + | |
2140 | 2144 | | |
2141 | 2145 | | |
2142 | 2146 | | |
| |||
2162 | 2166 | | |
2163 | 2167 | | |
2164 | 2168 | | |
2165 | | - | |
| 2169 | + | |
2166 | 2170 | | |
2167 | 2171 | | |
2168 | 2172 | | |
| |||
2176 | 2180 | | |
2177 | 2181 | | |
2178 | 2182 | | |
| 2183 | + | |
| 2184 | + | |
| 2185 | + | |
| 2186 | + | |
2179 | 2187 | | |
2180 | 2188 | | |
2181 | 2189 | | |
| |||
2257 | 2265 | | |
2258 | 2266 | | |
2259 | 2267 | | |
| 2268 | + | |
| 2269 | + | |
2260 | 2270 | | |
2261 | 2271 | | |
2262 | 2272 | | |
2263 | 2273 | | |
| 2274 | + | |
| 2275 | + | |
| 2276 | + | |
| 2277 | + | |
| 2278 | + | |
| 2279 | + | |
| 2280 | + | |
| 2281 | + | |
| 2282 | + | |
| 2283 | + | |
| 2284 | + | |
| 2285 | + | |
| 2286 | + | |
2264 | 2287 | | |
2265 | 2288 | | |
2266 | 2289 | | |
| |||
2345 | 2368 | | |
2346 | 2369 | | |
2347 | 2370 | | |
| 2371 | + | |
| 2372 | + | |
| 2373 | + | |
| 2374 | + | |
| 2375 | + | |
| 2376 | + | |
| 2377 | + | |
| 2378 | + | |
| 2379 | + | |
2348 | 2380 | | |
2349 | 2381 | | |
2350 | 2382 | | |
| |||
0 commit comments