@tylertech/forge 3.12.0 → 3.13.0
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 +1792 -231
- package/dist/lib.js +12 -12
- 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/testing/test-harness.d.ts +11 -0
- package/esm/core/testing/test-harness.js +14 -0
- package/esm/core/testing/utils.d.ts +7 -0
- package/esm/core/testing/utils.js +14 -0
- 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/list-dropdown/list-dropdown-core.js +1 -1
- package/esm/list-dropdown/list-dropdown-utils.js +1 -1
- package/esm/list-dropdown/list-dropdown.js +1 -1
- 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
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Tyler Technologies, Inc.
|
|
4
|
+
* License: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* A Lit controller for attaching key down actions to a component host.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* class ExampleComponent extends LitElement {
|
|
11
|
+
* private _keyActionController = new KeyActionController(this, {
|
|
12
|
+
* actions: [
|
|
13
|
+
* {
|
|
14
|
+
* key: ['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'],
|
|
15
|
+
* handler: this._handleArrowKey.bind(this),
|
|
16
|
+
* allowRepeat: true
|
|
17
|
+
* },
|
|
18
|
+
* { key: 'Enter', handler: this._handleEnterKey.bind(this) },
|
|
19
|
+
* { key: { key: 'a', modifier: 'shift' }, handler: this._handleAKey.bind(this) }
|
|
20
|
+
* ],
|
|
21
|
+
* searchHandler: this.handleSearch.bind(this)
|
|
22
|
+
* });
|
|
23
|
+
*
|
|
24
|
+
* private _handleArrowKey(evt: KeyboardEvent): void {
|
|
25
|
+
* console.log(evt.key);
|
|
26
|
+
* }
|
|
27
|
+
*
|
|
28
|
+
* private _handleEnterKey(evt: KeyboardEvent): void {
|
|
29
|
+
* console.log(evt.key);
|
|
30
|
+
* }
|
|
31
|
+
*
|
|
32
|
+
* private _handleAKey(evt: KeyboardEvent): void {
|
|
33
|
+
* console.log(evt.key);
|
|
34
|
+
* }
|
|
35
|
+
*
|
|
36
|
+
* private _handleSearch(searchString: string): void {
|
|
37
|
+
* console.log(searchString);
|
|
38
|
+
* }
|
|
39
|
+
*/
|
|
40
|
+
export class KeyActionController {
|
|
41
|
+
constructor(host, config) {
|
|
42
|
+
this._searchString = '';
|
|
43
|
+
this._keyDownListener = (event) => this._handleKeyDown(event);
|
|
44
|
+
this.host = host;
|
|
45
|
+
this.actions = config?.actions ?? [];
|
|
46
|
+
this.searchHandler = config?.searchHandler;
|
|
47
|
+
host.addController(this);
|
|
48
|
+
}
|
|
49
|
+
hostConnected() {
|
|
50
|
+
this.host.addEventListener('keydown', this._keyDownListener);
|
|
51
|
+
}
|
|
52
|
+
hostDisconnected() {
|
|
53
|
+
this.host.removeEventListener('keydown', this._keyDownListener);
|
|
54
|
+
}
|
|
55
|
+
_handleKeyDown(evt) {
|
|
56
|
+
// Attempt to match the event to each action sequentially.
|
|
57
|
+
for (const action of this.actions) {
|
|
58
|
+
// Check if the event matches any of the action's keys. If not continue to the next action.
|
|
59
|
+
const keys = Array.isArray(action.key) ? action.key : [action.key];
|
|
60
|
+
if (!keys.some(key => this._eventMatchesKey(evt, key))) {
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
// Exit if the key is repeated and the action does not allow it.
|
|
64
|
+
if (!action.allowRepeat && evt.repeat) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
// Prevent default behavior, call the handler function, and return if the handler does not allow fallthrough.
|
|
68
|
+
evt.preventDefault();
|
|
69
|
+
if (!action.handler(evt)) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
// If no keys matched or fallthrough was allowed, attempt to handle the event as a search.
|
|
74
|
+
if (this.searchHandler) {
|
|
75
|
+
this._handleSearch(evt);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
_handleSearch(evt) {
|
|
79
|
+
// Ignore the event if it includes a modifier key.
|
|
80
|
+
if (evt.altKey || evt.ctrlKey || evt.metaKey || evt.shiftKey) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
// Only accept single character keys that are not whitespace.
|
|
84
|
+
if (evt.key.length !== 1 || !evt.key.match(/\S/)) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
evt.preventDefault();
|
|
88
|
+
// Clear the previous timeout and start a new one that resets the search string after a delay.
|
|
89
|
+
clearTimeout(this._searchTimeout);
|
|
90
|
+
this._searchTimeout = window.setTimeout(() => (this._searchString = ''), KeyActionController._searchTimeout);
|
|
91
|
+
// Append the pressed key to the search string and run the handler.
|
|
92
|
+
this._searchString += evt.key;
|
|
93
|
+
this.searchHandler?.(this._searchString, evt);
|
|
94
|
+
}
|
|
95
|
+
_eventMatchesKey(evt, key) {
|
|
96
|
+
const keyName = typeof key === 'string' ? key : key.key;
|
|
97
|
+
if (evt.key !== keyName) {
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
// If the key is a string it already matches.
|
|
101
|
+
if (typeof key === 'string') {
|
|
102
|
+
return true;
|
|
103
|
+
}
|
|
104
|
+
// Return false if any required modifier keys are not pressed.
|
|
105
|
+
const modifiers = key.modifier ? (Array.isArray(key.modifier) ? key.modifier : [key.modifier]) : [];
|
|
106
|
+
return modifiers.every(modifier => evt[`${modifier}Key`]);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
KeyActionController._searchTimeout = 500;
|
|
@@ -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
|
|
@@ -135,7 +135,7 @@ export class ListDropdownCore {
|
|
|
135
135
|
get dropdownElement() {
|
|
136
136
|
return this._adapter.dropdownElement;
|
|
137
137
|
}
|
|
138
|
-
scrollSelectedOptionIntoView(animate
|
|
138
|
+
scrollSelectedOptionIntoView(animate) {
|
|
139
139
|
this._adapter.scrollSelectedOptionIntoView(animate);
|
|
140
140
|
}
|
|
141
141
|
setScrollBottomListener(listener, threshold) {
|
|
@@ -346,7 +346,7 @@ export function createListItemTooltip(tooltip, configId, optionIdIndex, listItem
|
|
|
346
346
|
export async function asyncCreateListItemTooltipIfTextOverflows(tooltip, configId, optionIdIndex, listItemElement, buttonElement, secondaryLabelElement) {
|
|
347
347
|
await frame();
|
|
348
348
|
// Only append the tooltip if the button or secondary label overflow the width of the parent list item.
|
|
349
|
-
if (buttonElement.scrollWidth >
|
|
349
|
+
if (buttonElement.scrollWidth > buttonElement.clientWidth || secondaryLabelElement.scrollWidth > secondaryLabelElement.clientWidth) {
|
|
350
350
|
const tooltipElement = createListItemTooltip(tooltip, configId, optionIdIndex, listItemElement, buttonElement);
|
|
351
351
|
listItemElement.appendChild(tooltipElement);
|
|
352
352
|
}
|
|
@@ -69,7 +69,7 @@ export class ListDropdown {
|
|
|
69
69
|
this._core.appendOptions(options);
|
|
70
70
|
}
|
|
71
71
|
scrollSelectedOptionIntoView(animate) {
|
|
72
|
-
this._core.scrollSelectedOptionIntoView();
|
|
72
|
+
this._core.scrollSelectedOptionIntoView(animate);
|
|
73
73
|
}
|
|
74
74
|
setScrollBottomListener(listener, threshold) {
|
|
75
75
|
this._core.setScrollBottomListener(listener, threshold);
|
|
@@ -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:ub5nje0;animation-duration:var(--forge-animation-duration-medium2, 300ms);animation-timing-function:var(--forge-animation-easing-standard,cubic-bezier(0.2,0,0,1))}@keyframes ub5nje0{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:ub5njf0;animation-duration:var(--forge-animation-duration-medium2, 300ms);animation-timing-function:var(--forge-animation-easing-standard,cubic-bezier(0.2,0,0,1))}@keyframes ub5njf0{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:ub5njg0;animation-duration:var(--forge-animation-duration-medium2, 300ms);animation-timing-function:var(--forge-animation-easing-standard,cubic-bezier(0.2,0,0,1))}@keyframes ub5njg0{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:ub5njgl;animation-duration:var(--forge-animation-duration-medium2, 300ms);animation-timing-function:var(--forge-animation-easing-standard,cubic-bezier(0.2,0,0,1))}@keyframes ub5njgl{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:ub5njhb;animation-duration:var(--forge-animation-duration-medium2, 300ms);animation-timing-function:var(--forge-animation-easing-standard,cubic-bezier(0.2,0,0,1))}@keyframes ub5njhb{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:ub5nji7;animation-duration:var(--forge-animation-duration-medium2, 300ms);animation-timing-function:var(--forge-animation-easing-standard,cubic-bezier(0.2,0,0,1))}@keyframes ub5nji7{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:ub5njiw;animation-duration:var(--forge-animation-duration-medium2, 300ms);animation-timing-function:var(--forge-animation-easing-standard,cubic-bezier(0.2,0,0,1))}@keyframes ub5njiw{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:ub5njjh;animation-duration:var(--forge-animation-duration-medium2, 300ms);animation-timing-function:var(--forge-animation-easing-standard,cubic-bezier(0.2,0,0,1))}@keyframes ub5njjh{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
|
+
}
|