Skip to content

Commit b1b6108

Browse files
authored
ItemFlagsSelection type correction. (#31)
* correct type for ItemFlagsSelection for a better representation of bitwise operations intended for this feature. Added JSDoc comments. * expand ItemFlagsSelection type to support existing visuals without issues * bumped version and updated changelog * clarification of JSDoc for AutoFlagsSelection * clarification of JSDoc for AutoFlagsSelection
1 parent 3c96484 commit b1b6108

File tree

4 files changed

+20
-5
lines changed

4 files changed

+20
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11

2+
## 6.2.1
3+
* Improved type definitions and JSDoc documentation for `ItemFlagsSelection` and `AutoFlagsSelection` components
4+
* Added clarification that both flag selection components require bitwise values (powers of 2) for proper flag functionality
5+
26
## 6.2.0
37
* All *Slices*, *Groups* and *Cards* now can be `disabled` and provided with `disabledReason` or `disabledReasonKey` for localized version.
48
* *Container* card can have `Groups` inside

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "powerbi-visuals-utils-formattingmodel",
3-
"version": "6.2.0",
3+
"version": "6.2.1",
44
"description": "",
55
"main": "lib/index.js",
66
"module": "lib/index.js",

src/FormattingSettingsComponents.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,12 @@ export class FieldPicker extends SimpleSlice<data.ISQExpr[]> {
371371
}
372372
}
373373

374-
export class ItemFlagsSelection extends SimpleSlice<string> {
374+
/**
375+
* Allows selecting multiple flags from a predefined list of items with bitwise values.
376+
* The selected flags are stored as a single number using bitwise representation,
377+
* where each flag corresponds to a specific bit position.
378+
*/
379+
export class ItemFlagsSelection extends SimpleSlice<powerbi.EnumMemberValue> {
375380
items: powerbi.IEnumMember[] | ILocalizedItemMember[];
376381

377382
type?= visuals.FormattingComponent.FlagsSelection;
@@ -397,7 +402,13 @@ export class ItemFlagsSelection extends SimpleSlice<string> {
397402
}
398403
}
399404

400-
export class AutoFlagsSelection extends SimpleSlice<powerbi.EnumMemberValue> {
405+
/**
406+
* Multiple flags selection component with enumeration values defined in capabilities.json,
407+
* using bitwise number values in a string representation.
408+
* The selected flags are stored as a single number using bitwise representation,
409+
* where each flag corresponds to a specific bit position.
410+
*/
411+
export class AutoFlagsSelection extends SimpleSlice<string> {
401412
type?= visuals.FormattingComponent.FlagsSelection;
402413
}
403414

0 commit comments

Comments
 (0)