Skip to content

Commit 88b1e7b

Browse files
committed
fix: missing public API exports - calendar resources, placement, tree args
1 parent ebfa052 commit 88b1e7b

File tree

10 files changed

+42
-27
lines changed

10 files changed

+42
-27
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1010

1111
### Fixed
1212
- Setting validation properties on a pristine non-dirty form associated element does not apply invalid styles [#1632](https://github.com/IgniteUI/igniteui-webcomponents/issues/1632)
13+
- Exposed `IgcCalendarResourceStrings`, `PopoverPlacement` (Dropdown and Select) and `IgcTreeSelectionEventArgs` from the public API
1314

1415
## [5.3.0] - 2025-03-13
1516
### Added

src/components/common/util.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,3 +334,8 @@ export function roundByDPR(value: number): number {
334334
const dpr = globalThis.devicePixelRatio || 1;
335335
return Math.round(value * dpr) / dpr;
336336
}
337+
338+
/** Required utility type for specific props */
339+
export type RequiredProps<T, K extends keyof T> = T & {
340+
[P in K]-?: T[P];
341+
};

src/components/dropdown/dropdown.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ import {
3434
getElementByIdFromRoot,
3535
isString,
3636
} from '../common/util.js';
37-
import IgcPopoverComponent, { type IgcPlacement } from '../popover/popover.js';
37+
import IgcPopoverComponent, {
38+
type PopoverPlacement,
39+
} from '../popover/popover.js';
3840
import IgcDropdownGroupComponent from './dropdown-group.js';
3941
import IgcDropdownHeaderComponent from './dropdown-header.js';
4042
import IgcDropdownItemComponent from './dropdown-item.js';
@@ -123,7 +125,7 @@ export default class IgcDropdownComponent extends EventEmitterMixin<
123125
* @attr
124126
*/
125127
@property()
126-
public placement: IgcPlacement = 'bottom-start';
128+
public placement: PopoverPlacement = 'bottom-start';
127129

128130
/**
129131
* Determines the behavior of the component during scrolling of the parent container.

src/components/popover/popover.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import { styles } from './themes/light/popover.base.css.js';
2424
/**
2525
* Describes the preferred placement of a toggle component.
2626
*/
27-
export type IgcPlacement =
27+
export type PopoverPlacement =
2828
| 'top'
2929
| 'top-start'
3030
| 'top-end'
@@ -95,7 +95,7 @@ export default class IgcPopoverComponent extends LitElement {
9595
* Where to place the floating element relative to the parent anchor element.
9696
*/
9797
@property()
98-
public placement: IgcPlacement = 'bottom-start';
98+
public placement: PopoverPlacement = 'bottom-start';
9999

100100
/**
101101
* When enabled the floating element will match the width of its parent anchor element.

src/components/select/select.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ import {
4949
} from '../common/util.js';
5050
import IgcIconComponent from '../icon/icon.js';
5151
import IgcInputComponent from '../input/input.js';
52-
import IgcPopoverComponent, { type IgcPlacement } from '../popover/popover.js';
52+
import IgcPopoverComponent, {
53+
type PopoverPlacement,
54+
} from '../popover/popover.js';
5355
import IgcValidationContainerComponent from '../validation-container/validation-container.js';
5456
import IgcSelectGroupComponent from './select-group.js';
5557
import IgcSelectHeaderComponent from './select-header.js';
@@ -225,7 +227,7 @@ export default class IgcSelectComponent extends FormAssociatedRequiredMixin(
225227
* @attr
226228
*/
227229
@property()
228-
public placement: IgcPlacement = 'bottom-start';
230+
public placement: PopoverPlacement = 'bottom-start';
229231

230232
/**
231233
* Determines the behavior of the component during scrolling of the parent container.

src/components/tree/tree-navigation.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { spy } from 'sinon';
44
import { defineComponents } from '../../index.js';
55
import IgcTreeItemComponent from './tree-item.js';
66
import { SLOTS, TreeTestFunctions, navigationTree } from './tree-utils.spec.js';
7-
import type { IgcSelectionEventArgs } from './tree.common.js';
7+
import type { TreeSelectionEventInit } from './tree.common.js';
88
import IgcTreeComponent from './tree.js';
99
import type { IgcTreeNavigationService } from './tree.navigation.js';
1010

@@ -437,7 +437,7 @@ describe('Tree Navigation', () => {
437437
expect(topLevelItems[0].active).to.be.true;
438438
expect(topLevelItems[0].selected).to.be.true;
439439

440-
let args: IgcSelectionEventArgs = {
440+
let args: TreeSelectionEventInit = {
441441
detail: {
442442
newSelection: [topLevelItems[0]],
443443
},
@@ -510,7 +510,7 @@ describe('Tree Navigation', () => {
510510
expect(treeNavService.activeItem).to.equal(topLevelItems[1]);
511511
expect(treeNavService.focusedItem).to.equal(topLevelItems[1]);
512512

513-
const args: IgcSelectionEventArgs = {
513+
const args: TreeSelectionEventInit = {
514514
detail: {
515515
newSelection: [topLevelItems[1]],
516516
},
@@ -543,7 +543,7 @@ describe('Tree Navigation', () => {
543543
expect(treeNavService.activeItem).to.equal(topLevelItems[0]);
544544
expect(treeNavService.focusedItem).to.equal(topLevelItems[0]);
545545

546-
let args: IgcSelectionEventArgs = {
546+
let args: TreeSelectionEventInit = {
547547
detail: {
548548
newSelection: [topLevelItems[0]],
549549
},

src/components/tree/tree-selection.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
selectedItemsTree,
1111
simpleTree,
1212
} from './tree-utils.spec.js';
13-
import type { IgcSelectionEventArgs } from './tree.common.js';
13+
import type { TreeSelectionEventInit } from './tree.common.js';
1414
import IgcTreeComponent from './tree.js';
1515
import type { IgcTreeSelectionService } from './tree.selection.js';
1616

@@ -218,7 +218,7 @@ describe('Tree Selection', () => {
218218
initialSelection.shift();
219219

220220
// Should emit igcSelection event w/ correct args when an item is deselected
221-
let args: IgcSelectionEventArgs = {
221+
let args: TreeSelectionEventInit = {
222222
detail: {
223223
newSelection: initialSelection,
224224
},
@@ -268,7 +268,7 @@ describe('Tree Selection', () => {
268268
expect(cb.checked).to.be.false;
269269
expect(cb.indeterminate).to.be.false;
270270

271-
const args: IgcSelectionEventArgs = {
271+
const args: TreeSelectionEventInit = {
272272
detail: {
273273
newSelection: [...initialSelection, item12],
274274
},
@@ -300,7 +300,7 @@ describe('Tree Selection', () => {
300300
topLevelItems[1].getChildren()[1],
301301
];
302302

303-
let args: IgcSelectionEventArgs = {
303+
let args: TreeSelectionEventInit = {
304304
detail: {
305305
newSelection: [topLevelItems[0]],
306306
},
@@ -362,7 +362,7 @@ describe('Tree Selection', () => {
362362
tree.deselect();
363363
await elementUpdated(tree);
364364

365-
const args: IgcSelectionEventArgs = {
365+
const args: TreeSelectionEventInit = {
366366
detail: {
367367
newSelection: [topLevelItems[2]],
368368
},
@@ -707,7 +707,7 @@ describe('Tree Selection', () => {
707707
expect(cb.checked).to.be.false;
708708
expect(cb.indeterminate).to.be.false;
709709

710-
const args: IgcSelectionEventArgs = {
710+
const args: TreeSelectionEventInit = {
711711
detail: {
712712
newSelection: [...initialSelection, item211],
713713
},

src/components/tree/tree.common.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
1+
import type { RequiredProps } from '../common/util.js';
12
import type IgcTreeItemComponent from './tree-item.js';
23

34
export interface IgcTreeComponentEventMap {
45
/* alternateName: selectionChanged */
5-
igcSelection: CustomEvent<TreeSelectionChange>;
6+
igcSelection: CustomEvent<IgcTreeSelectionEventArgs>;
67
igcItemExpanding: CustomEvent<IgcTreeItemComponent>;
78
igcItemExpanded: CustomEvent<IgcTreeItemComponent>;
89
igcItemCollapsing: CustomEvent<IgcTreeItemComponent>;
910
igcItemCollapsed: CustomEvent<IgcTreeItemComponent>;
1011
igcActiveItem: CustomEvent<IgcTreeItemComponent>;
1112
}
12-
export interface IgcSelectionEventArgs {
13-
detail: TreeSelectionChange;
14-
cancelable: boolean;
15-
}
13+
export type TreeSelectionEventInit = RequiredProps<
14+
CustomEventInit<IgcTreeSelectionEventArgs>,
15+
'detail' | 'cancelable'
16+
>;
1617

17-
export interface TreeSelectionChange {
18+
export interface IgcTreeSelectionEventArgs {
1819
newSelection: IgcTreeItemComponent[];
1920
}

src/components/tree/tree.selection.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { isEmpty } from '../common/util.js';
22
import type IgcTreeItemComponent from './tree-item.js';
3-
import type { IgcSelectionEventArgs } from './tree.common.js';
3+
import type { TreeSelectionEventInit } from './tree.common.js';
44
import type IgcTreeComponent from './tree.js';
55

66
/* blazorSuppress */
@@ -113,7 +113,7 @@ export class IgcTreeSelectionService {
113113
return;
114114
}
115115

116-
const args: IgcSelectionEventArgs = {
116+
const args: TreeSelectionEventInit = {
117117
detail: {
118118
newSelection,
119119
},
@@ -182,7 +182,7 @@ export class IgcTreeSelectionService {
182182

183183
this.calculateItemsNewSelectionState(currSelection, added, removed);
184184

185-
const args: IgcSelectionEventArgs = {
185+
const args: TreeSelectionEventInit = {
186186
detail: {
187187
newSelection: Array.from(this.itemsToBeSelected),
188188
},

src/index.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,10 @@ export {
8383
export { configureTheme } from './theming/config.js';
8484

8585
// localization objects
86-
export { IgcCalendarResourceStringEN } from './components/common/i18n/calendar.resources.js';
86+
export {
87+
IgcCalendarResourceStringEN,
88+
type IgcCalendarResourceStrings,
89+
} from './components/common/i18n/calendar.resources.js';
8790

8891
// Event maps
8992
export type { IgcBannerComponentEventMap } from './components/banner/banner.js';
@@ -131,18 +134,19 @@ export { DateRangeType } from './components/calendar/types.js';
131134
export type { CheckboxChangeEventArgs } from './components/checkbox/checkbox-base.js';
132135
export { DatePart } from './components/date-time-input/date-util.js';
133136
export type { DatePartDeltas } from './components/date-time-input/date-util.js';
137+
export type { PopoverPlacement } from './components/popover/popover.js';
134138
export type { RadioChangeEventArgs } from './components/radio/radio.js';
135139
export type { IgcRangeSliderValue } from './components/slider/range-slider.js';
136140
export type {
137141
IgcActiveStepChangingArgs,
138142
IgcActiveStepChangedArgs,
139143
} from './components/stepper/stepper.common.js';
144+
export type { IgcTreeSelectionEventArgs } from './components/tree/tree.common.js';
140145
export type {
141146
ComboItemTemplate,
142147
ComboTemplateProps,
143148
FilteringOptions,
144149
GroupingDirection,
145-
GroupingOptions,
146150
IgcComboChangeEventArgs,
147151
} from './components/combo/types.js';
148152
export type { IconMeta } from './components/icon/registry/types.js';

0 commit comments

Comments
 (0)