@ichicraft/widgets-widget-base 1.9.1 → 1.9.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 +8 -0
- package/lib/types/index.d.ts +54 -13
- package/lib/types/index.js +10 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,6 +9,14 @@ 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.9.2 - 2024-03-21
|
|
13
|
+
|
|
14
|
+
- Added `CommandBarIcon` interface, to allow rendering a `CustomCommandBarItem` as a single icon or an icon button.
|
|
15
|
+
- Added `CommandBarLink` interface, to allow rendering a `CustomCommandBarItem` as a clickable link.
|
|
16
|
+
- Added `CommandBarItemBase` interface, to act as a base for different types of `CustomCommandBarItem`.
|
|
17
|
+
- Added `elementBorderRadius` property to the `WidgetContext` interface, to allow styling widgets according to the configured design preferences.
|
|
18
|
+
- Changed `CustomCommandBarItemProps` type to accept either a `CommandBarIcon` or a `CommandBarLink`.
|
|
19
|
+
|
|
12
20
|
## 1.9.1 - 2023-10-20
|
|
13
21
|
|
|
14
22
|
- Added `WidgetInstanceContext` interface, to allow typing the `instance` property of the `WidgetContext` interface.
|
package/lib/types/index.d.ts
CHANGED
|
@@ -127,6 +127,10 @@ export interface WidgetContext {
|
|
|
127
127
|
*/
|
|
128
128
|
isCurrent?: boolean;
|
|
129
129
|
}[];
|
|
130
|
+
/**
|
|
131
|
+
* Preferred border radius of UI elements as configured in Widget Board configuration
|
|
132
|
+
*/
|
|
133
|
+
elementBorderRadius: number;
|
|
130
134
|
/**
|
|
131
135
|
* MS Graph Client Factory class as provided by the WebPartContext object.
|
|
132
136
|
*/
|
|
@@ -550,49 +554,86 @@ export declare enum CustomCommandBarItemSeverity {
|
|
|
550
554
|
Warning = 1
|
|
551
555
|
}
|
|
552
556
|
/**
|
|
553
|
-
*
|
|
554
|
-
|
|
557
|
+
* Tells how to render the command bar item, e.g. as an icon button or as a link.
|
|
558
|
+
*/
|
|
559
|
+
export declare enum CommandBarItemType {
|
|
560
|
+
/** Normal severity, displays just like all the other command bar items */
|
|
561
|
+
Icon = "icon",
|
|
562
|
+
/** Warning severity, displays the item with a more noticable warning color */
|
|
563
|
+
Link = "link"
|
|
564
|
+
}
|
|
565
|
+
/**
|
|
566
|
+
* Properties to pass to the registerCommandBarItems function, resulting in the
|
|
567
|
+
* rendering of a command bar item.
|
|
568
|
+
*/
|
|
569
|
+
export declare type CustomCommandBarItemProps = CommandBarIcon | CommandBarLink;
|
|
570
|
+
/**
|
|
571
|
+
* Base properties of a custom CommandBarItem.
|
|
555
572
|
*/
|
|
556
|
-
export interface
|
|
573
|
+
export interface CommandBarItemBase {
|
|
557
574
|
/**
|
|
558
575
|
* Optional identifier for the icon.
|
|
559
576
|
*/
|
|
560
577
|
id?: string;
|
|
561
578
|
/**
|
|
562
|
-
*
|
|
563
|
-
* https://developer.microsoft.com/en-us/fluentui#/styles/web/icons
|
|
579
|
+
* Type of item, (e.g. 'icon' or 'link')
|
|
564
580
|
*/
|
|
565
|
-
|
|
581
|
+
itemType: CommandBarItemType;
|
|
566
582
|
/**
|
|
567
|
-
* Optional content to show as a tooltip above the item
|
|
583
|
+
* Optional content to show as a tooltip above the item.
|
|
568
584
|
*/
|
|
569
585
|
tooltipContent?: string;
|
|
570
586
|
/**
|
|
571
|
-
* Optionally tells the tooltip to be shown automatically
|
|
587
|
+
* Optionally tells the tooltip to be shown automatically.
|
|
572
588
|
*/
|
|
573
589
|
showTooltipAutomatically?: boolean;
|
|
574
590
|
/**
|
|
575
|
-
*
|
|
591
|
+
* Optionally tells the Widget Header that this item should always be visible, even when not hovering.
|
|
576
592
|
*/
|
|
577
|
-
|
|
593
|
+
pinned?: boolean;
|
|
594
|
+
}
|
|
595
|
+
/**
|
|
596
|
+
* Properties to render a custom CommandBarItem either as a single Icon or an Icon Button.
|
|
597
|
+
*/
|
|
598
|
+
export interface CommandBarIcon extends CommandBarItemBase {
|
|
599
|
+
itemType: CommandBarItemType.Icon;
|
|
578
600
|
/**
|
|
579
|
-
*
|
|
601
|
+
* Name of the icon, as specified and available in Fluent UI Iconography:
|
|
602
|
+
* https://developer.microsoft.com/en-us/fluentui#/styles/web/icons
|
|
580
603
|
*/
|
|
581
|
-
|
|
604
|
+
iconName: string;
|
|
582
605
|
/**
|
|
583
606
|
* Optionally display a red notification icon badge in the top-right corner of the button.
|
|
584
607
|
*/
|
|
585
608
|
showNotificationBadge?: boolean;
|
|
609
|
+
/**
|
|
610
|
+
* Optional severity to specify how the item should render
|
|
611
|
+
*/
|
|
612
|
+
severity?: CustomCommandBarItemSeverity;
|
|
586
613
|
/**
|
|
587
614
|
* Optionally provide an order in which this button should appear, when registering multiple custom buttons.
|
|
588
615
|
*/
|
|
589
616
|
order?: number;
|
|
590
617
|
/**
|
|
591
618
|
* Optional onClick event, which is triggered on user click and makes the command
|
|
592
|
-
* bar item render as a button instead of a non-clickable icon
|
|
619
|
+
* bar item render as a button instead of a non-clickable icon.
|
|
593
620
|
*/
|
|
594
621
|
onClick?: () => void;
|
|
595
622
|
}
|
|
623
|
+
/**
|
|
624
|
+
* Properties to render a custom CommandBarItem as a Link Button.
|
|
625
|
+
*/
|
|
626
|
+
export interface CommandBarLink extends CommandBarItemBase {
|
|
627
|
+
itemType: CommandBarItemType.Link;
|
|
628
|
+
/**
|
|
629
|
+
* Required label to display the clickable link.
|
|
630
|
+
*/
|
|
631
|
+
label: string;
|
|
632
|
+
/**
|
|
633
|
+
* Required onClick event, which is triggered on user click.
|
|
634
|
+
*/
|
|
635
|
+
onClick: () => void;
|
|
636
|
+
}
|
|
596
637
|
/**
|
|
597
638
|
* Options to pass to the openIFrameDialog function. Use this to configure how the dialog is rendered, and to handle events (e.g. onDismissed)
|
|
598
639
|
*/
|
package/lib/types/index.js
CHANGED
|
@@ -30,3 +30,13 @@ var CustomCommandBarItemSeverity;
|
|
|
30
30
|
/** Warning severity, displays the item with a more noticable warning color */
|
|
31
31
|
CustomCommandBarItemSeverity[CustomCommandBarItemSeverity["Warning"] = 1] = "Warning";
|
|
32
32
|
})(CustomCommandBarItemSeverity = exports.CustomCommandBarItemSeverity || (exports.CustomCommandBarItemSeverity = {}));
|
|
33
|
+
/**
|
|
34
|
+
* Tells how to render the command bar item, e.g. as an icon button or as a link.
|
|
35
|
+
*/
|
|
36
|
+
var CommandBarItemType;
|
|
37
|
+
(function (CommandBarItemType) {
|
|
38
|
+
/** Normal severity, displays just like all the other command bar items */
|
|
39
|
+
CommandBarItemType["Icon"] = "icon";
|
|
40
|
+
/** Warning severity, displays the item with a more noticable warning color */
|
|
41
|
+
CommandBarItemType["Link"] = "link";
|
|
42
|
+
})(CommandBarItemType = exports.CommandBarItemType || (exports.CommandBarItemType = {}));
|
package/package.json
CHANGED