@ichicraft/widgets-widget-base 1.10.2 → 1.10.4
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 +12 -0
- package/lib/types/index.d.ts +42 -3
- package/lib/types/index.js +2 -0
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -9,6 +9,18 @@ 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.4 - 2024-07-23
|
|
13
|
+
|
|
14
|
+
- Added `SearchBar` value to the `CommandBarItemType` enum, to allow rendering a command bar item as a search bar.
|
|
15
|
+
- Added `CommandBarSearchItem` interface, to allow passing extra search-related props to a CommandBarItem of type `SearchBar`.
|
|
16
|
+
- Added optional `overflowButtonIconName` and `overflowButtonTooltip` properties to the `CommandBarTabOptions` interface, to allow customization of the overflow menu button.
|
|
17
|
+
- Added optional `itemCount` property to the `CommandBarTab` interface.
|
|
18
|
+
- Added summaries to functions and interfaces related to widget command bar tabs.
|
|
19
|
+
|
|
20
|
+
## 1.10.3 - 2024-07-22
|
|
21
|
+
|
|
22
|
+
- Added override in package.json to use version `2.3.7` instead of `2.3.6` of `requirejs` because the latter has vulnerability CVE-2024-38999
|
|
23
|
+
|
|
12
24
|
## 1.10.2 - 2024-07-19
|
|
13
25
|
|
|
14
26
|
- Added `registerTabs` function to the `WidgetInstanceContext` interface, to allow rendering of tabs in the widget header.
|
package/lib/types/index.d.ts
CHANGED
|
@@ -324,7 +324,7 @@ export interface WidgetInstanceContext {
|
|
|
324
324
|
*/
|
|
325
325
|
unregisterCustomCommandBarItem?: (id?: string) => void;
|
|
326
326
|
/**
|
|
327
|
-
* Allows registration of tabs (pivots) in the widget header.
|
|
327
|
+
* Allows registration of tabs (pivots) in the widget header. To unregister the tabs, provide 'undefined' options.
|
|
328
328
|
*/
|
|
329
329
|
registerTabs?: (options: CommandBarTabOptions) => void;
|
|
330
330
|
/**
|
|
@@ -610,6 +610,8 @@ export declare enum CommandBarItemType {
|
|
|
610
610
|
Icon = "icon",
|
|
611
611
|
/** Renders the item as a clickable link */
|
|
612
612
|
Link = "link",
|
|
613
|
+
/** Renders the item as a search bar */
|
|
614
|
+
SearchBar = "search-bar",
|
|
613
615
|
/** Renders the item in the overflow menu */
|
|
614
616
|
Overflow = "overflow"
|
|
615
617
|
}
|
|
@@ -654,11 +656,11 @@ export interface CommandBarItemProps {
|
|
|
654
656
|
* See the available icon names in Fluent UI Iconography:
|
|
655
657
|
* https://developer.microsoft.com/en-us/fluentui#/styles/web/icons
|
|
656
658
|
*/
|
|
657
|
-
iconName
|
|
659
|
+
iconName?: string;
|
|
658
660
|
/**
|
|
659
661
|
* Displayed label when rendered as a link, or in the overflow menu.
|
|
660
662
|
*/
|
|
661
|
-
label
|
|
663
|
+
label?: string;
|
|
662
664
|
/**
|
|
663
665
|
* Optionally display a red notification icon badge in the top-right corner of the button.
|
|
664
666
|
*/
|
|
@@ -677,14 +679,51 @@ export interface CommandBarItemProps {
|
|
|
677
679
|
*/
|
|
678
680
|
onClick?: () => void;
|
|
679
681
|
}
|
|
682
|
+
/**
|
|
683
|
+
* Base properties of a CommandBarItem, rendered in the widget header.
|
|
684
|
+
*/
|
|
685
|
+
export interface CommandBarSearchItem extends CommandBarItemProps {
|
|
686
|
+
searchTerms: string;
|
|
687
|
+
onSearchTermsChange: (value: string) => void;
|
|
688
|
+
}
|
|
680
689
|
export interface CommandBarTabOptions {
|
|
690
|
+
/**
|
|
691
|
+
* The tabs to display in the widget command bar.
|
|
692
|
+
*/
|
|
681
693
|
tabs: CommandBarTab[];
|
|
694
|
+
/**
|
|
695
|
+
* Override the icon that is displayed in the overflow menu button.
|
|
696
|
+
*/
|
|
697
|
+
overflowButtonIconName?: string;
|
|
698
|
+
/**
|
|
699
|
+
* Optional tooltip to display when hovering over the overflow menu button.
|
|
700
|
+
*/
|
|
701
|
+
overflowButtonTooltip?: string;
|
|
702
|
+
/**
|
|
703
|
+
* Callback function that triggers when a new tab is selected.
|
|
704
|
+
*/
|
|
682
705
|
onTabSelect: (tabId: string) => void;
|
|
683
706
|
}
|
|
684
707
|
export interface CommandBarTab {
|
|
708
|
+
/**
|
|
709
|
+
* Unique id for this tab.
|
|
710
|
+
*/
|
|
685
711
|
id: string;
|
|
712
|
+
/**
|
|
713
|
+
* The text displayed in the tab. Leave this empty if you don't want to display any text.
|
|
714
|
+
*/
|
|
686
715
|
label: string;
|
|
716
|
+
/**
|
|
717
|
+
* Optional item count displayed after the label between parantheses. Example: Test label (5)
|
|
718
|
+
*/
|
|
719
|
+
itemCount?: string | number;
|
|
720
|
+
/**
|
|
721
|
+
* Optional icon to display before the label.
|
|
722
|
+
*/
|
|
687
723
|
iconName?: string;
|
|
724
|
+
/**
|
|
725
|
+
* Optional tooltip to display when hovering over the tab.
|
|
726
|
+
*/
|
|
688
727
|
tooltip?: string;
|
|
689
728
|
}
|
|
690
729
|
/**
|
package/lib/types/index.js
CHANGED
|
@@ -40,6 +40,8 @@ var CommandBarItemType;
|
|
|
40
40
|
CommandBarItemType["Icon"] = "icon";
|
|
41
41
|
/** Renders the item as a clickable link */
|
|
42
42
|
CommandBarItemType["Link"] = "link";
|
|
43
|
+
/** Renders the item as a search bar */
|
|
44
|
+
CommandBarItemType["SearchBar"] = "search-bar";
|
|
43
45
|
/** Renders the item in the overflow menu */
|
|
44
46
|
CommandBarItemType["Overflow"] = "overflow";
|
|
45
47
|
})(CommandBarItemType || (exports.CommandBarItemType = CommandBarItemType = {}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ichicraft/widgets-widget-base",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.4",
|
|
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",
|
|
@@ -18,6 +18,9 @@
|
|
|
18
18
|
"files": [
|
|
19
19
|
"lib/**/*"
|
|
20
20
|
],
|
|
21
|
+
"overrides": {
|
|
22
|
+
"requirejs": "2.3.7"
|
|
23
|
+
},
|
|
21
24
|
"dependencies": {
|
|
22
25
|
"@microsoft/sp-http": "1.18.2",
|
|
23
26
|
"@pnp/sp": "4.0.1"
|