@ichicraft/widgets-widget-base 1.10.0 → 1.10.2

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/README.md CHANGED
@@ -9,6 +9,17 @@ All notable changes to this project will be documented here.
9
9
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
10
10
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
11
11
 
12
+ ## 1.10.2 - 2024-07-19
13
+
14
+ - Added `registerTabs` function to the `WidgetInstanceContext` interface, to allow rendering of tabs in the widget header.
15
+ - Added `setSelectedTab` function to the `WidgetInstanceContext` interface, to allow setting the current selected tab in the widget header.
16
+ - Added `CommandBarTab` interface.
17
+ - Added `CommandBarTabOptions` interface.
18
+
19
+ ## 1.10.1 - 2024-07-08
20
+
21
+ - Added `widget-administrator` role to the `UserRole` type.
22
+
12
23
  ## 1.10.0 - 2024-06-25
13
24
 
14
25
  - Added optional `updateDataAccess()` function to the `BaseWidget` class, used to update access to widget-specific data.
@@ -323,6 +323,14 @@ export interface WidgetInstanceContext {
323
323
  * If no id was specified, it removes all items.
324
324
  */
325
325
  unregisterCustomCommandBarItem?: (id?: string) => void;
326
+ /**
327
+ * Allows registration of tabs (pivots) in the widget header.
328
+ */
329
+ registerTabs?: (options: CommandBarTabOptions) => void;
330
+ /**
331
+ * Allows setting the current selected tab in the widget header.
332
+ */
333
+ setSelectedTab?: (tabId: string) => void;
326
334
  /**
327
335
  * Raises an event to be handled by the Time-based Events feature of Ichicraft Boards.
328
336
  * @param object The object this event concerns (e.g. app, report, newsArticle, ...). Use camelCase.
@@ -669,6 +677,16 @@ export interface CommandBarItemProps {
669
677
  */
670
678
  onClick?: () => void;
671
679
  }
680
+ export interface CommandBarTabOptions {
681
+ tabs: CommandBarTab[];
682
+ onTabSelect: (tabId: string) => void;
683
+ }
684
+ export interface CommandBarTab {
685
+ id: string;
686
+ label: string;
687
+ iconName?: string;
688
+ tooltip?: string;
689
+ }
672
690
  /**
673
691
  * Options to pass to the openIFrameDialog function. Use this to configure how the dialog is rendered, and to handle events (e.g. onDismissed)
674
692
  */
@@ -776,7 +794,7 @@ export interface FilePickerFileProps {
776
794
  siteId: string;
777
795
  }
778
796
  export type BoardType = 'shared' | 'personal';
779
- export type UserRole = 'administrator' | 'board-owner';
797
+ export type UserRole = 'administrator' | 'board-owner' | 'widget-administrator';
780
798
  export interface ExportData {
781
799
  data: object[];
782
800
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ichicraft/widgets-widget-base",
3
- "version": "1.10.0",
3
+ "version": "1.10.2",
4
4
  "description": "Part of the Widget Development Kit for building widgets for Ichicraft Boards",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",