@tylertech/forge 3.12.1 → 3.13.1
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/custom-elements.json +1788 -231
- package/dist/lib.js +90 -22
- package/dist/lib.js.map +4 -4
- package/dist/vscode.css-custom-data.json +2 -1
- package/dist/vscode.html-custom-data.json +85 -1
- package/esm/autocomplete/autocomplete-constants.d.ts +1 -0
- package/esm/autocomplete/autocomplete-constants.js +1 -0
- package/esm/autocomplete/autocomplete-core.d.ts +6 -0
- package/esm/autocomplete/autocomplete-core.js +49 -12
- package/esm/autocomplete/autocomplete.d.ts +7 -0
- package/esm/autocomplete/autocomplete.js +7 -0
- package/esm/calendar/calendar-core.d.ts +2 -0
- package/esm/calendar/calendar-core.js +20 -14
- package/esm/core/utils/index.d.ts +1 -0
- package/esm/core/utils/index.js +1 -0
- package/esm/core/utils/key-action.d.ts +102 -0
- package/esm/core/utils/key-action.js +109 -0
- package/esm/expansion-panel/expansion-panel-adapter.d.ts +9 -0
- package/esm/expansion-panel/expansion-panel-adapter.js +31 -3
- package/esm/expansion-panel/expansion-panel-constants.d.ts +2 -0
- package/esm/expansion-panel/expansion-panel-constants.js +2 -1
- package/esm/expansion-panel/expansion-panel-core.d.ts +7 -0
- package/esm/expansion-panel/expansion-panel-core.js +30 -0
- package/esm/expansion-panel/expansion-panel.d.ts +11 -3
- package/esm/expansion-panel/expansion-panel.js +16 -3
- package/esm/index.d.ts +1 -0
- package/esm/index.js +4 -0
- package/esm/paginator/paginator-adapter.d.ts +1 -0
- package/esm/paginator/paginator-adapter.js +15 -4
- package/esm/split-view/split-view-panel/split-view-panel.js +1 -1
- package/esm/tree/index.d.ts +7 -0
- package/esm/tree/index.js +7 -0
- package/esm/tree/tree/index.d.ts +7 -0
- package/esm/tree/tree/index.js +11 -0
- package/esm/tree/tree/tree-selection-controller.d.ts +104 -0
- package/esm/tree/tree/tree-selection-controller.js +375 -0
- package/esm/tree/tree/tree.d.ts +141 -0
- package/esm/tree/tree/tree.js +488 -0
- package/esm/tree/tree-item/index.d.ts +7 -0
- package/esm/tree/tree-item/index.js +11 -0
- package/esm/tree/tree-item/tree-item.d.ts +112 -0
- package/esm/tree/tree-item/tree-item.js +378 -0
- package/esm/tree/tree-utils.d.ts +154 -0
- package/esm/tree/tree-utils.js +315 -0
- package/package.json +2 -1
- package/sass/core/styles/tokens/tree/tree/_tokens.scss +24 -0
- package/sass/core/styles/tokens/tree/tree-item/_tokens.scss +39 -0
- package/sass/tree/tree/_core.scss +31 -0
- package/sass/tree/tree/_token-utils.scss +30 -0
- package/sass/tree/tree/index.scss +6 -0
- package/sass/tree/tree/tree.scss +44 -0
- package/sass/tree/tree-item/_core.scss +121 -0
- package/sass/tree/tree-item/_token-utils.scss +30 -0
- package/sass/tree/tree-item/index.scss +6 -0
- package/sass/tree/tree-item/tree-item.scss +199 -0
|
@@ -4,9 +4,11 @@
|
|
|
4
4
|
* License: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { BaseAdapter, IBaseAdapter } from '../core/base/base-adapter';
|
|
7
|
+
import { IOpenIconComponent } from '../open-icon';
|
|
7
8
|
import { IExpansionPanelComponent } from './expansion-panel';
|
|
8
9
|
export interface IExpansionPanelAdapter extends IBaseAdapter {
|
|
9
10
|
readonly triggerElement?: HTMLElement | null;
|
|
11
|
+
readonly openIcon?: IOpenIconComponent | null;
|
|
10
12
|
setAnimationCompleteListener(listener: () => void): void;
|
|
11
13
|
addContentSlotListener(listener: EventListener): void;
|
|
12
14
|
addHeaderListener(type: keyof HTMLElementEventMap, listener: EventListener): void;
|
|
@@ -20,6 +22,8 @@ export interface IExpansionPanelAdapter extends IBaseAdapter {
|
|
|
20
22
|
animationEnd(): void;
|
|
21
23
|
setTriggerElementById(id: string): void;
|
|
22
24
|
setTriggerElement(el?: HTMLElement | null): void;
|
|
25
|
+
setOpenIconById(id: string): void;
|
|
26
|
+
setOpenIcon(openIcon?: IOpenIconComponent | null): void;
|
|
23
27
|
setContentId(): void;
|
|
24
28
|
updateAriaControls(): void;
|
|
25
29
|
updateAriaExpanded(open: boolean): void;
|
|
@@ -32,15 +36,18 @@ export declare class ExpansionPanelAdapter extends BaseAdapter<IExpansionPanelCo
|
|
|
32
36
|
private _defaultSlotElement;
|
|
33
37
|
private _triggerListenerController;
|
|
34
38
|
private _triggerElement?;
|
|
39
|
+
private _openIcon?;
|
|
35
40
|
private _transitionStartListener;
|
|
36
41
|
private _transitionEndListener;
|
|
37
42
|
private _transitionCompleteListener;
|
|
38
43
|
constructor(component: IExpansionPanelComponent);
|
|
39
44
|
get triggerElement(): HTMLElement | null | undefined;
|
|
45
|
+
get openIcon(): IOpenIconComponent | null | undefined;
|
|
40
46
|
private get _slottedContentElement();
|
|
41
47
|
private set _slottedContentId(value);
|
|
42
48
|
private get _slottedContentId();
|
|
43
49
|
setTriggerElementById(id: string): void;
|
|
50
|
+
setOpenIconById(id: string): void;
|
|
44
51
|
setAnimationCompleteListener(listener: () => void): void;
|
|
45
52
|
addContentSlotListener(listener: EventListener): void;
|
|
46
53
|
addHeaderListener(type: keyof HTMLElementEventMap, listener: EventListener): void;
|
|
@@ -55,9 +62,11 @@ export declare class ExpansionPanelAdapter extends BaseAdapter<IExpansionPanelCo
|
|
|
55
62
|
animationStart(): void;
|
|
56
63
|
animationEnd(): void;
|
|
57
64
|
setTriggerElement(el: HTMLElement | null): void;
|
|
65
|
+
setOpenIcon(openIcon: IOpenIconComponent | null): void;
|
|
58
66
|
setContentId(): void;
|
|
59
67
|
updateAriaControls(): void;
|
|
60
68
|
updateAriaExpanded(open: boolean): void;
|
|
61
69
|
detachTriggerAria(): void;
|
|
62
70
|
private _getTriggerElementById;
|
|
71
|
+
private _getOpenIconElementById;
|
|
63
72
|
}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { getShadowElement, randomChars, toggleAttribute } from '@tylertech/forge-core';
|
|
7
7
|
import { BaseAdapter } from '../core/base/base-adapter';
|
|
8
|
+
import { OPEN_ICON_CONSTANTS } from '../open-icon';
|
|
8
9
|
import { EXPANSION_PANEL_CONSTANTS } from './expansion-panel-constants';
|
|
9
10
|
export class ExpansionPanelAdapter extends BaseAdapter {
|
|
10
11
|
constructor(component) {
|
|
@@ -19,6 +20,9 @@ export class ExpansionPanelAdapter extends BaseAdapter {
|
|
|
19
20
|
get triggerElement() {
|
|
20
21
|
return this._triggerElement;
|
|
21
22
|
}
|
|
23
|
+
get openIcon() {
|
|
24
|
+
return this._openIcon;
|
|
25
|
+
}
|
|
22
26
|
get _slottedContentElement() {
|
|
23
27
|
return this._defaultSlotElement.assignedElements({ flatten: true })[0];
|
|
24
28
|
}
|
|
@@ -31,6 +35,9 @@ export class ExpansionPanelAdapter extends BaseAdapter {
|
|
|
31
35
|
setTriggerElementById(id) {
|
|
32
36
|
this._triggerElement = this._getTriggerElementById(id);
|
|
33
37
|
}
|
|
38
|
+
setOpenIconById(id) {
|
|
39
|
+
this._openIcon = this._getOpenIconElementById(id);
|
|
40
|
+
}
|
|
34
41
|
setAnimationCompleteListener(listener) {
|
|
35
42
|
this._transitionCompleteListener = listener;
|
|
36
43
|
this._contentElement.addEventListener('transitionstart', this._transitionStartListener);
|
|
@@ -52,9 +59,14 @@ export class ExpansionPanelAdapter extends BaseAdapter {
|
|
|
52
59
|
this._triggerElement?.addEventListener(type, listener, { signal: this._triggerListenerController.signal });
|
|
53
60
|
}
|
|
54
61
|
tryToggleOpenIcon(value) {
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
62
|
+
const internalOpenIcon = this._component.querySelector(EXPANSION_PANEL_CONSTANTS.selectors.OPEN_ICON);
|
|
63
|
+
const triggerOpenIcon = this._triggerElement?.querySelector(OPEN_ICON_CONSTANTS.elementName);
|
|
64
|
+
const externalOpenIcon = this._openIcon;
|
|
65
|
+
const openIcons = [internalOpenIcon, triggerOpenIcon, externalOpenIcon];
|
|
66
|
+
for (const openIcon of openIcons) {
|
|
67
|
+
if (openIcon) {
|
|
68
|
+
openIcon.open = value;
|
|
69
|
+
}
|
|
58
70
|
}
|
|
59
71
|
}
|
|
60
72
|
setContentVisibility(visible) {
|
|
@@ -80,6 +92,9 @@ export class ExpansionPanelAdapter extends BaseAdapter {
|
|
|
80
92
|
setTriggerElement(el) {
|
|
81
93
|
this._triggerElement = el;
|
|
82
94
|
}
|
|
95
|
+
setOpenIcon(openIcon) {
|
|
96
|
+
this._openIcon = openIcon;
|
|
97
|
+
}
|
|
83
98
|
setContentId() {
|
|
84
99
|
if (!this._slottedContentId) {
|
|
85
100
|
this._slottedContentId = `forge-expansion-panel-content-${randomChars()}`;
|
|
@@ -108,4 +123,17 @@ export class ExpansionPanelAdapter extends BaseAdapter {
|
|
|
108
123
|
return null;
|
|
109
124
|
}
|
|
110
125
|
}
|
|
126
|
+
_getOpenIconElementById(id) {
|
|
127
|
+
if (id && this.isConnected) {
|
|
128
|
+
const rootNode = this._component.getRootNode();
|
|
129
|
+
const el = rootNode.getElementById(id);
|
|
130
|
+
if (el?.tagName.toLocaleLowerCase() === OPEN_ICON_CONSTANTS.elementName) {
|
|
131
|
+
return el;
|
|
132
|
+
}
|
|
133
|
+
return null;
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
111
139
|
}
|
|
@@ -10,6 +10,7 @@ export declare const EXPANSION_PANEL_CONSTANTS: {
|
|
|
10
10
|
ORIENTATION: string;
|
|
11
11
|
ANIMATION_TYPE: string;
|
|
12
12
|
TRIGGER: string;
|
|
13
|
+
OPEN_ICON: string;
|
|
13
14
|
};
|
|
14
15
|
attributes: {
|
|
15
16
|
OPENING: string;
|
|
@@ -17,6 +18,7 @@ export declare const EXPANSION_PANEL_CONSTANTS: {
|
|
|
17
18
|
ORIENTATION: string;
|
|
18
19
|
ANIMATION_TYPE: string;
|
|
19
20
|
TRIGGER: string;
|
|
21
|
+
OPEN_ICON: string;
|
|
20
22
|
};
|
|
21
23
|
classes: {
|
|
22
24
|
HIDDEN: string;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Copyright Tyler Technologies, Inc.
|
|
4
4
|
* License: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
+
import { IOpenIconComponent } from '../open-icon';
|
|
6
7
|
import { IExpansionPanelAdapter } from './expansion-panel-adapter';
|
|
7
8
|
import { ExpansionPanelAnimationType, ExpansionPanelOrientation } from './expansion-panel-constants';
|
|
8
9
|
export interface IExpansionPanelCore {
|
|
@@ -19,6 +20,7 @@ export declare class ExpansionPanelCore implements IExpansionPanelCore {
|
|
|
19
20
|
private _orientation;
|
|
20
21
|
private _animationType;
|
|
21
22
|
private _trigger;
|
|
23
|
+
private _openIcon;
|
|
22
24
|
private _clickListener;
|
|
23
25
|
private _keydownListener;
|
|
24
26
|
private _keyupListener;
|
|
@@ -30,6 +32,7 @@ export declare class ExpansionPanelCore implements IExpansionPanelCore {
|
|
|
30
32
|
private _handleContentSlotChange;
|
|
31
33
|
private _clearTrigger;
|
|
32
34
|
private _syncTrigger;
|
|
35
|
+
private _syncOpenIcon;
|
|
33
36
|
private _onClick;
|
|
34
37
|
private _onKeydown;
|
|
35
38
|
private _onKeyup;
|
|
@@ -49,4 +52,8 @@ export declare class ExpansionPanelCore implements IExpansionPanelCore {
|
|
|
49
52
|
set trigger(value: string);
|
|
50
53
|
get triggerElement(): HTMLElement | null | undefined;
|
|
51
54
|
set triggerElement(el: HTMLElement | null | undefined);
|
|
55
|
+
get openIcon(): string;
|
|
56
|
+
set openIcon(value: string);
|
|
57
|
+
get openIconElement(): IOpenIconComponent | null | undefined;
|
|
58
|
+
set openIconElement(openIcon: IOpenIconComponent | null | undefined);
|
|
52
59
|
}
|
|
@@ -12,6 +12,7 @@ export class ExpansionPanelCore {
|
|
|
12
12
|
this._orientation = 'vertical';
|
|
13
13
|
this._animationType = 'default';
|
|
14
14
|
this._trigger = '';
|
|
15
|
+
this._openIcon = '';
|
|
15
16
|
this._clickListener = this._onClick.bind(this);
|
|
16
17
|
this._keydownListener = this._onKeydown.bind(this);
|
|
17
18
|
this._keyupListener = this._onKeyup.bind(this);
|
|
@@ -27,11 +28,13 @@ export class ExpansionPanelCore {
|
|
|
27
28
|
this._adapter.setContentId();
|
|
28
29
|
await frame();
|
|
29
30
|
this._syncTrigger();
|
|
31
|
+
this._syncOpenIcon();
|
|
30
32
|
}
|
|
31
33
|
destroy() {
|
|
32
34
|
this._adapter.detachTriggerAria();
|
|
33
35
|
this._adapter.removeTriggerListeners();
|
|
34
36
|
this._adapter.setTriggerElement(undefined);
|
|
37
|
+
this._adapter.setOpenIcon(undefined);
|
|
35
38
|
}
|
|
36
39
|
_handleContentSlotChange() {
|
|
37
40
|
this._adapter.setContentId();
|
|
@@ -58,6 +61,16 @@ export class ExpansionPanelCore {
|
|
|
58
61
|
this._adapter.addTriggerListener('keydown', this._keydownListener);
|
|
59
62
|
this._adapter.addTriggerListener('keyup', this._keyupListener);
|
|
60
63
|
}
|
|
64
|
+
_syncOpenIcon() {
|
|
65
|
+
if (!this._adapter.openIcon?.isConnected) {
|
|
66
|
+
if (this._openIcon) {
|
|
67
|
+
this._adapter.setOpenIconById(this._openIcon);
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
this._adapter.setOpenIcon(undefined);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
61
74
|
_onClick(evt) {
|
|
62
75
|
this._tryToggle(evt);
|
|
63
76
|
}
|
|
@@ -162,4 +175,21 @@ export class ExpansionPanelCore {
|
|
|
162
175
|
this._syncTrigger();
|
|
163
176
|
}
|
|
164
177
|
}
|
|
178
|
+
get openIcon() {
|
|
179
|
+
return this._openIcon;
|
|
180
|
+
}
|
|
181
|
+
set openIcon(value) {
|
|
182
|
+
if (this._openIcon !== value) {
|
|
183
|
+
this._openIcon = value;
|
|
184
|
+
this._syncOpenIcon();
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
get openIconElement() {
|
|
188
|
+
return this._adapter.openIcon;
|
|
189
|
+
}
|
|
190
|
+
set openIconElement(openIcon) {
|
|
191
|
+
if (this._adapter.openIcon !== openIcon) {
|
|
192
|
+
this._adapter.setOpenIcon(openIcon);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
165
195
|
}
|
|
@@ -5,12 +5,15 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { BaseComponent, IBaseComponent } from '../core/base/base-component';
|
|
7
7
|
import { ExpansionPanelAnimationType, ExpansionPanelOrientation, emulateUserToggle } from './expansion-panel-constants';
|
|
8
|
+
import { IOpenIconComponent } from '../open-icon';
|
|
8
9
|
export interface IExpansionPanelComponent extends IBaseComponent {
|
|
9
10
|
open: boolean;
|
|
10
11
|
orientation: ExpansionPanelOrientation;
|
|
11
12
|
animationType: ExpansionPanelAnimationType;
|
|
12
13
|
trigger: string;
|
|
13
14
|
triggerElement: HTMLElement | null;
|
|
15
|
+
openIcon: string;
|
|
16
|
+
openIconElement: IOpenIconComponent | null;
|
|
14
17
|
toggle(): void;
|
|
15
18
|
[emulateUserToggle](open: boolean): void;
|
|
16
19
|
}
|
|
@@ -31,13 +34,16 @@ declare global {
|
|
|
31
34
|
* @property {boolean} [open=false] - Whether the panel is open or closed.
|
|
32
35
|
* @property {ExpansionPanelOrientation} [orientation="vertical"] - The orientation of the panel.
|
|
33
36
|
* @property {ExpansionPanelAnimationType} [animationType="default"] - The type of animation to use when opening/closing the panel.
|
|
34
|
-
* @property {string} trigger - The id of the
|
|
35
|
-
* @property {HTMLElement | null} triggerElement - The
|
|
37
|
+
* @property {string} trigger - The id of the button that the expansion panel should be toggled by.
|
|
38
|
+
* @property {HTMLElement | null} triggerElement - The button that the expansion panel should be toggled by.
|
|
39
|
+
* @property {string} openIcon - The id of the `<forge-open-icon>` that the expansion panel should toggle.
|
|
40
|
+
* @property {IOpenIconComponent | null} openIconElement - The `<forge-open-icon>` that the expansion panel should toggle.
|
|
36
41
|
*
|
|
37
42
|
* @attribute {boolean} [open=false] - Whether the panel is open or closed.
|
|
38
43
|
* @attribute {ExpansionPanelOrientation} [orientation="vertical"] - The orientation of the panel.
|
|
39
44
|
* @attribute {ExpansionPanelAnimationType} [animation-type="default"] - The type of animation to use when opening/closing the panel.
|
|
40
|
-
* @attribute {string} [trigger] - The id of the button that the expansion panel
|
|
45
|
+
* @attribute {string} [trigger] - The id of the button that the expansion panel should be toggled by.
|
|
46
|
+
* @attribute {string} [open-icon] - The id of the `<forge-open-icon>` that the expansion panel should toggle.
|
|
41
47
|
*
|
|
42
48
|
* @fires {CustomEvent<boolean>} forge-expansion-panel-toggle - Event fired when the panel is toggled open or closed.
|
|
43
49
|
* @fires {CustomEvent<boolean>} forge-expansion-panel-animation-complete - Event fired when the panel has finished animating when toggling.
|
|
@@ -68,6 +74,8 @@ export declare class ExpansionPanelComponent extends BaseComponent implements IE
|
|
|
68
74
|
animationType: ExpansionPanelAnimationType;
|
|
69
75
|
trigger: string;
|
|
70
76
|
triggerElement: HTMLElement | null;
|
|
77
|
+
openIcon: string;
|
|
78
|
+
openIconElement: IOpenIconComponent | null;
|
|
71
79
|
/**
|
|
72
80
|
* Toggles the open state of the panel.
|
|
73
81
|
*/
|
|
@@ -19,13 +19,16 @@ const styles = ':host{display:block}:host([hidden]){display:none}.forge-expansio
|
|
|
19
19
|
* @property {boolean} [open=false] - Whether the panel is open or closed.
|
|
20
20
|
* @property {ExpansionPanelOrientation} [orientation="vertical"] - The orientation of the panel.
|
|
21
21
|
* @property {ExpansionPanelAnimationType} [animationType="default"] - The type of animation to use when opening/closing the panel.
|
|
22
|
-
* @property {string} trigger - The id of the
|
|
23
|
-
* @property {HTMLElement | null} triggerElement - The
|
|
22
|
+
* @property {string} trigger - The id of the button that the expansion panel should be toggled by.
|
|
23
|
+
* @property {HTMLElement | null} triggerElement - The button that the expansion panel should be toggled by.
|
|
24
|
+
* @property {string} openIcon - The id of the `<forge-open-icon>` that the expansion panel should toggle.
|
|
25
|
+
* @property {IOpenIconComponent | null} openIconElement - The `<forge-open-icon>` that the expansion panel should toggle.
|
|
24
26
|
*
|
|
25
27
|
* @attribute {boolean} [open=false] - Whether the panel is open or closed.
|
|
26
28
|
* @attribute {ExpansionPanelOrientation} [orientation="vertical"] - The orientation of the panel.
|
|
27
29
|
* @attribute {ExpansionPanelAnimationType} [animation-type="default"] - The type of animation to use when opening/closing the panel.
|
|
28
|
-
* @attribute {string} [trigger] - The id of the button that the expansion panel
|
|
30
|
+
* @attribute {string} [trigger] - The id of the button that the expansion panel should be toggled by.
|
|
31
|
+
* @attribute {string} [open-icon] - The id of the `<forge-open-icon>` that the expansion panel should toggle.
|
|
29
32
|
*
|
|
30
33
|
* @fires {CustomEvent<boolean>} forge-expansion-panel-toggle - Event fired when the panel is toggled open or closed.
|
|
31
34
|
* @fires {CustomEvent<boolean>} forge-expansion-panel-animation-complete - Event fired when the panel has finished animating when toggling.
|
|
@@ -72,6 +75,10 @@ let ExpansionPanelComponent = class ExpansionPanelComponent extends BaseComponen
|
|
|
72
75
|
break;
|
|
73
76
|
case EXPANSION_PANEL_CONSTANTS.observedAttributes.TRIGGER:
|
|
74
77
|
this.trigger = newValue;
|
|
78
|
+
break;
|
|
79
|
+
case EXPANSION_PANEL_CONSTANTS.observedAttributes.OPEN_ICON:
|
|
80
|
+
this.openIcon = newValue;
|
|
81
|
+
break;
|
|
75
82
|
}
|
|
76
83
|
}
|
|
77
84
|
/**
|
|
@@ -108,6 +115,12 @@ __decorate([
|
|
|
108
115
|
__decorate([
|
|
109
116
|
coreProperty()
|
|
110
117
|
], ExpansionPanelComponent.prototype, "triggerElement", void 0);
|
|
118
|
+
__decorate([
|
|
119
|
+
coreProperty()
|
|
120
|
+
], ExpansionPanelComponent.prototype, "openIcon", void 0);
|
|
121
|
+
__decorate([
|
|
122
|
+
coreProperty()
|
|
123
|
+
], ExpansionPanelComponent.prototype, "openIconElement", void 0);
|
|
111
124
|
ExpansionPanelComponent = __decorate([
|
|
112
125
|
customElement({
|
|
113
126
|
name: EXPANSION_PANEL_CONSTANTS.elementName
|
package/esm/index.d.ts
CHANGED
package/esm/index.js
CHANGED
|
@@ -73,6 +73,7 @@ import { defineTimePickerComponent } from './time-picker';
|
|
|
73
73
|
import { defineToastComponent } from './toast';
|
|
74
74
|
import { defineToolbarComponent } from './toolbar';
|
|
75
75
|
import { defineTooltipComponent } from './tooltip';
|
|
76
|
+
import { defineTreeComponent, defineTreeItemComponent } from './tree';
|
|
76
77
|
import { defineViewComponent, defineViewSwitcherComponent } from './view-switcher';
|
|
77
78
|
/**
|
|
78
79
|
* Deprecated imports
|
|
@@ -144,6 +145,7 @@ export * from './time-picker';
|
|
|
144
145
|
export * from './toast';
|
|
145
146
|
export * from './toolbar';
|
|
146
147
|
export * from './tooltip';
|
|
148
|
+
export * from './tree';
|
|
147
149
|
export * from './utils';
|
|
148
150
|
export * from './view-switcher';
|
|
149
151
|
/**
|
|
@@ -236,6 +238,8 @@ export function defineComponents() {
|
|
|
236
238
|
defineToastComponent();
|
|
237
239
|
defineToolbarComponent();
|
|
238
240
|
defineTooltipComponent();
|
|
241
|
+
defineTreeComponent();
|
|
242
|
+
defineTreeItemComponent();
|
|
239
243
|
defineViewComponent();
|
|
240
244
|
defineViewSwitcherComponent();
|
|
241
245
|
}
|
|
@@ -73,16 +73,16 @@ export class PaginatorAdapter extends BaseAdapter {
|
|
|
73
73
|
this._lastPageButton.addEventListener('click', listener);
|
|
74
74
|
}
|
|
75
75
|
setFirstPageButtonEnabled(enabled) {
|
|
76
|
-
this._firstPageButton
|
|
76
|
+
this._setButtonEnabled(this._firstPageButton, enabled);
|
|
77
77
|
}
|
|
78
78
|
setPreviousPageButtonEnabled(enabled) {
|
|
79
|
-
this._previousPageButton
|
|
79
|
+
this._setButtonEnabled(this._previousPageButton, enabled);
|
|
80
80
|
}
|
|
81
81
|
setNextPageButtonEnabled(enabled) {
|
|
82
|
-
this._nextPageButton
|
|
82
|
+
this._setButtonEnabled(this._nextPageButton, enabled);
|
|
83
83
|
}
|
|
84
84
|
setLastPageButtonEnabled(enabled) {
|
|
85
|
-
this._lastPageButton
|
|
85
|
+
this._setButtonEnabled(this._lastPageButton, enabled);
|
|
86
86
|
}
|
|
87
87
|
setPageSizeSelectEnabled(enabled) {
|
|
88
88
|
this._pageSizeSelect.disabled = !enabled;
|
|
@@ -111,4 +111,15 @@ export class PaginatorAdapter extends BaseAdapter {
|
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
|
+
_setButtonEnabled(btn, enabled) {
|
|
115
|
+
if (enabled) {
|
|
116
|
+
btn.removeAttribute('disabled');
|
|
117
|
+
btn.setAttribute('tabindex', '0');
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
btn.setAttribute('disabled', 'true');
|
|
121
|
+
btn.setAttribute('tabindex', '-1');
|
|
122
|
+
btn.blur();
|
|
123
|
+
}
|
|
124
|
+
}
|
|
114
125
|
}
|
|
@@ -14,7 +14,7 @@ import { IconComponent, IconRegistry } from '../../icon';
|
|
|
14
14
|
import { StateLayerComponent } from '../../state-layer';
|
|
15
15
|
import { FocusIndicatorComponent } from '../../focus-indicator';
|
|
16
16
|
const template = '<template><div class=\"forge-split-view-panel\" id=\"root\" part=\"root\"><div class=\"forge-split-view-panel__handle\" id=\"handle\" part=\"handle\" role=\"separator\" aria-controls=\"content\" aria-grabbed=\"false\" tabindex=\"0\"><forge-icon class=\"forge-split-view-panel__icon\" id=\"icon\" part=\"icon\"></forge-icon><forge-state-layer target=\"handle\" id=\"state-layer\" exportparts=\"surface:state-layer\"></forge-state-layer><forge-focus-indicator inward target=\"handle\" part=\"focus-indicator\"></forge-focus-indicator></div><div class=\"forge-split-view-panel__content\" id=\"content\" part=\"content\" role=\"group\"><slot></slot></div></div></template>';
|
|
17
|
-
const styles = '.forge-split-view-panel{display:flex;width:100%;height:100%;overflow:hidden}.forge-split-view-panel__handle{color:var(--forge-theme-text-medium,rgba(0,0,0,.6));background-color:var(--forge-theme-outline,#e0e0e0);position:relative;display:flex;flex-shrink:0;justify-content:center;align-items:center;outline:0}.forge-split-view-panel__content{flex:1;overflow:hidden}.forge-split-view-panel--closed{display:none}.forge-split-view-panel--disabled #handle{pointer-events:none}.forge-split-view-panel--disabled .forge-split-view-panel__icon{display:none}.forge-split-view-panel[orientation=horizontal]{min-width:var(--forge-split-view-handle-width,8px);width:calc(var(--forge-split-view-panel-size,unset) + var(--forge-split-view-handle-width,8px));flex-direction:row}.forge-split-view-panel[orientation=horizontal] .forge-split-view-panel__handle{width:var(--forge-split-view-handle-width,8px);cursor:var(--forge-split-view-panel-cursor)}.forge-split-view-panel[orientation=horizontal].forge-split-view-panel--closing[resizable=end]{position:absolute;top:0;left:0;animation-name:
|
|
17
|
+
const styles = '.forge-split-view-panel{display:flex;width:100%;height:100%;overflow:hidden}.forge-split-view-panel__handle{color:var(--forge-theme-text-medium,rgba(0,0,0,.6));background-color:var(--forge-theme-outline,#e0e0e0);position:relative;display:flex;flex-shrink:0;justify-content:center;align-items:center;outline:0}.forge-split-view-panel__content{flex:1;overflow:hidden}.forge-split-view-panel--closed{display:none}.forge-split-view-panel--disabled #handle{pointer-events:none}.forge-split-view-panel--disabled .forge-split-view-panel__icon{display:none}.forge-split-view-panel[orientation=horizontal]{min-width:var(--forge-split-view-handle-width,8px);width:calc(var(--forge-split-view-panel-size,unset) + var(--forge-split-view-handle-width,8px));flex-direction:row}.forge-split-view-panel[orientation=horizontal] .forge-split-view-panel__handle{width:var(--forge-split-view-handle-width,8px);cursor:var(--forge-split-view-panel-cursor)}.forge-split-view-panel[orientation=horizontal].forge-split-view-panel--closing[resizable=end]{position:absolute;top:0;left:0;animation-name:ub0puv4;animation-duration:var(--forge-animation-duration-medium2, 300ms);animation-timing-function:var(--forge-animation-easing-standard,cubic-bezier(0.2,0,0,1))}@keyframes ub0puv4{from{transform:none}to{transform:translateX(-100%)}}.forge-split-view-panel[orientation=horizontal].forge-split-view-panel--closing[resizable=start]{position:absolute;top:0;right:0;animation-name:ub0puvk;animation-duration:var(--forge-animation-duration-medium2, 300ms);animation-timing-function:var(--forge-animation-easing-standard,cubic-bezier(0.2,0,0,1))}@keyframes ub0puvk{from{transform:none}to{transform:translateX(100%)}}.forge-split-view-panel[orientation=horizontal].forge-split-view-panel--opening[resizable=end]{position:absolute;top:0;left:0;animation-name:ub0puvr;animation-duration:var(--forge-animation-duration-medium2, 300ms);animation-timing-function:var(--forge-animation-easing-standard,cubic-bezier(0.2,0,0,1))}@keyframes ub0puvr{from{transform:none}to{transform:translateX(-100%)}}.forge-split-view-panel[orientation=horizontal].forge-split-view-panel--opening[resizable=end]{animation-direction:reverse}.forge-split-view-panel[orientation=horizontal].forge-split-view-panel--opening[resizable=start]{position:absolute;top:0;right:0;animation-name:ub0puw1;animation-duration:var(--forge-animation-duration-medium2, 300ms);animation-timing-function:var(--forge-animation-easing-standard,cubic-bezier(0.2,0,0,1))}@keyframes ub0puw1{from{transform:none}to{transform:translateX(100%)}}.forge-split-view-panel[orientation=horizontal].forge-split-view-panel--opening[resizable=start]{animation-direction:reverse}.forge-split-view-panel[orientation=vertical]{min-height:var(--forge-split-view-handle-width,8px);height:calc(var(--forge-split-view-panel-size,unset) + var(--forge-split-view-handle-width,8px));flex-direction:column}.forge-split-view-panel[orientation=vertical] .forge-split-view-panel__handle{height:var(--forge-split-view-handle-width,8px);cursor:var(--forge-split-view-panel-cursor)}.forge-split-view-panel[orientation=vertical].forge-split-view-panel--closing[resizable=end]{position:absolute;top:0;left:0;animation-name:ub0puwd;animation-duration:var(--forge-animation-duration-medium2, 300ms);animation-timing-function:var(--forge-animation-easing-standard,cubic-bezier(0.2,0,0,1))}@keyframes ub0puwd{from{transform:none}to{transform:translateY(-100%)}}.forge-split-view-panel[orientation=vertical].forge-split-view-panel--closing[resizable=start]{position:absolute;bottom:0;left:0;animation-name:ub0puwx;animation-duration:var(--forge-animation-duration-medium2, 300ms);animation-timing-function:var(--forge-animation-easing-standard,cubic-bezier(0.2,0,0,1))}@keyframes ub0puwx{from{transform:none}to{transform:translateY(100%)}}.forge-split-view-panel[orientation=vertical].forge-split-view-panel--opening[resizable=end]{position:absolute;top:0;left:0;animation-name:ub0puxl;animation-duration:var(--forge-animation-duration-medium2, 300ms);animation-timing-function:var(--forge-animation-easing-standard,cubic-bezier(0.2,0,0,1))}@keyframes ub0puxl{from{transform:none}to{transform:translateY(-100%)}}.forge-split-view-panel[orientation=vertical].forge-split-view-panel--opening[resizable=end]{animation-direction:reverse}.forge-split-view-panel[orientation=vertical].forge-split-view-panel--opening[resizable=start]{position:absolute;bottom:0;left:0;animation-name:ub0puxv;animation-duration:var(--forge-animation-duration-medium2, 300ms);animation-timing-function:var(--forge-animation-easing-standard,cubic-bezier(0.2,0,0,1))}@keyframes ub0puxv{from{transform:none}to{transform:translateY(100%)}}.forge-split-view-panel[orientation=vertical].forge-split-view-panel--opening[resizable=start]{animation-direction:reverse}:host{z-index:var(--forge-split-view-animating-layer)!important;display:block;position:relative;height:100%;width:100%;flex:0}:host([hidden]){display:none}:host(:not([resizable=start],[resizable=end])){flex:1}:host(:not([resizable=start],[resizable=end])) .forge-split-view-panel{width:100%;height:100%;min-width:0;min-height:0}:host(:not([resizable=start],[resizable=end])) .forge-split-view-panel__handle{display:none}forge-focus-indicator{--forge-focus-indicator-active-width:2px}';
|
|
18
18
|
/**
|
|
19
19
|
* @tag forge-split-view-panel
|
|
20
20
|
*
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Tyler Technologies, Inc.
|
|
4
|
+
* License: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { tryDefine } from '@tylertech/forge-core';
|
|
7
|
+
import { TreeComponent } from './tree';
|
|
8
|
+
export * from './tree';
|
|
9
|
+
export function defineTreeComponent() {
|
|
10
|
+
tryDefine('forge-tree', TreeComponent);
|
|
11
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Tyler Technologies, Inc.
|
|
4
|
+
* License: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { ReactiveController } from 'lit';
|
|
7
|
+
import { TreeItemComponent } from '../tree-item';
|
|
8
|
+
import { TreeComponent } from './tree';
|
|
9
|
+
export interface ITreeItemSnapshot {
|
|
10
|
+
el: TreeItemComponent;
|
|
11
|
+
indeterminate: boolean;
|
|
12
|
+
open: boolean;
|
|
13
|
+
selected: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare class TreeSelectionController implements ReactiveController {
|
|
16
|
+
/**
|
|
17
|
+
* The tree component that the controller is attached to.
|
|
18
|
+
*/
|
|
19
|
+
host: TreeComponent;
|
|
20
|
+
/**
|
|
21
|
+
* An array containing all selected tree items.
|
|
22
|
+
*/
|
|
23
|
+
items: TreeItemComponent[];
|
|
24
|
+
/**
|
|
25
|
+
* An array containing the values of all selected tree items.
|
|
26
|
+
*/
|
|
27
|
+
get value(): unknown[];
|
|
28
|
+
set value(value: unknown[]);
|
|
29
|
+
private _itemsBeingToggled;
|
|
30
|
+
private _updateListener;
|
|
31
|
+
constructor(host: TreeComponent);
|
|
32
|
+
hostConnected(): void;
|
|
33
|
+
hostDisconnected(): void;
|
|
34
|
+
/**
|
|
35
|
+
* Deselects items that are not allowed for a given selection mode
|
|
36
|
+
*/
|
|
37
|
+
cleanup(): void;
|
|
38
|
+
/**
|
|
39
|
+
* Selects or deselects a tree item.
|
|
40
|
+
* @param item The tree item to toggle.
|
|
41
|
+
* @param force If true, the item will be selected. If false, the item will be deselected.
|
|
42
|
+
*/
|
|
43
|
+
toggle(item: TreeItemComponent, force?: boolean): void;
|
|
44
|
+
/**
|
|
45
|
+
* Selects all tree items between the last selected item and the given item.
|
|
46
|
+
* @param item The end item to extend the selection to.
|
|
47
|
+
*/
|
|
48
|
+
extend(item: TreeItemComponent): void;
|
|
49
|
+
/**
|
|
50
|
+
* Selects all tree items.
|
|
51
|
+
*/
|
|
52
|
+
selectAll(): void;
|
|
53
|
+
/**
|
|
54
|
+
* Updates other items when an item is updated outside of the tree's interaction handlers.
|
|
55
|
+
* @param evt The update event emitted from a tree item.
|
|
56
|
+
*/
|
|
57
|
+
private _handleUpdateEvent;
|
|
58
|
+
/**
|
|
59
|
+
* Selects or deselects the given tree item and updates the list of selected items to reflect
|
|
60
|
+
* the change.
|
|
61
|
+
* @param item The item to select or deselect.
|
|
62
|
+
* @param changes The original state of all changed tree items.
|
|
63
|
+
*/
|
|
64
|
+
private _updateSelectionsFromItem;
|
|
65
|
+
/**
|
|
66
|
+
* Sets the selected state of all children of the given item.
|
|
67
|
+
* @param item The item that was selected or deselected.
|
|
68
|
+
* @param changes The original state of all changed tree items.
|
|
69
|
+
* @returns The updated snapshot of all changed tree items.
|
|
70
|
+
*/
|
|
71
|
+
private _updateDescendentSelections;
|
|
72
|
+
/**
|
|
73
|
+
* Sets ancestor items of the given item to selected, deselected, or indeterminate based on the
|
|
74
|
+
* state of the item.
|
|
75
|
+
* @param item The item that was selected or deselected.
|
|
76
|
+
* @param changes The original state of all changed tree items.
|
|
77
|
+
* @return The updated snapshot of all changed tree items.
|
|
78
|
+
*/
|
|
79
|
+
private _updateAncestorSelections;
|
|
80
|
+
/**
|
|
81
|
+
* Adds a tree item to a snapshot of all changed tree items.
|
|
82
|
+
* @param item The tree item.
|
|
83
|
+
* @param snapshot The snapshot of all changed tree items.
|
|
84
|
+
* @param options Properties of the tree item to change if it already exists in the snapshot.
|
|
85
|
+
*/
|
|
86
|
+
private _addToSnapshot;
|
|
87
|
+
/**
|
|
88
|
+
* Restores the state of all changed tree items from a snapshot.
|
|
89
|
+
* @param snapshot An array containing the original state of all changed tree items.
|
|
90
|
+
*/
|
|
91
|
+
private _restoreSnapshot;
|
|
92
|
+
/**
|
|
93
|
+
* Clears the indeterminate state of all tree items.
|
|
94
|
+
* @param items An optional array of items to clear the indeterminate state of.
|
|
95
|
+
*/
|
|
96
|
+
private _clearIndeterminate;
|
|
97
|
+
/**
|
|
98
|
+
* Sets a tree item's selected state and adds it to the set of items being toggled to prevent the
|
|
99
|
+
* event from being handled twice.
|
|
100
|
+
* @param item The item to select or deselect.
|
|
101
|
+
* @param force If true, the item will be selected. If false, the item will be deselected.
|
|
102
|
+
*/
|
|
103
|
+
private _selectItem;
|
|
104
|
+
}
|