@tylertech/forge 3.1.2 → 3.2.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 +161 -37
- package/dist/lib.js +1 -1
- package/dist/lib.js.map +4 -4
- package/dist/vscode.html-custom-data.json +16 -1
- package/esm/calendar/calendar-adapter.d.ts +6 -6
- package/esm/calendar/calendar-adapter.js +45 -11
- package/esm/calendar/calendar-constants.d.ts +20 -0
- package/esm/calendar/calendar-constants.js +22 -0
- package/esm/calendar/calendar-core.d.ts +3 -3
- package/esm/calendar/calendar-core.js +5 -17
- package/esm/calendar/calendar-dom-utils.js +10 -4
- package/esm/calendar/calendar-dropdown/calendar-dropdown-constants.d.ts +2 -0
- package/esm/calendar/calendar.d.ts +9 -0
- package/esm/calendar/calendar.js +9 -0
- package/esm/chips/chip/chip-core.js +0 -1
- package/esm/date-picker/base/base-date-picker-adapter.d.ts +3 -0
- package/esm/date-picker/base/base-date-picker-adapter.js +56 -0
- package/esm/date-picker/base/base-date-picker-constants.d.ts +11 -0
- package/esm/date-picker/base/base-date-picker-constants.js +2 -1
- package/esm/date-picker/base/base-date-picker-core.d.ts +4 -1
- package/esm/date-picker/base/base-date-picker-core.js +12 -1
- package/esm/date-picker/base/base-date-picker.d.ts +5 -1
- package/esm/date-picker/base/base-date-picker.js +8 -0
- package/esm/date-range-picker/date-range-picker-adapter.js +4 -2
- package/esm/list/list-item/list-item-constants.d.ts +6 -0
- package/esm/list/list-item/list-item-constants.js +7 -2
- package/esm/list/list-item/list-item-core.d.ts +5 -0
- package/esm/list/list-item/list-item-core.js +17 -2
- package/esm/list/list-item/list-item.d.ts +5 -1
- package/esm/list/list-item/list-item.js +8 -0
- package/esm/list-dropdown/list-dropdown-utils.js +1 -0
- package/package.json +1 -1
|
@@ -9,6 +9,7 @@ import { BaseComponent } from '../../core/base/base-component';
|
|
|
9
9
|
import { BASE_DATE_PICKER_CONSTANTS } from './base-date-picker-constants';
|
|
10
10
|
/**
|
|
11
11
|
* @property {boolean} [allowInvalidDate=false] - Whether to allow an invalid date to be input. When true, the date picker will not clear out the value of the input if the date was invalid (i.e. could not be parsed).
|
|
12
|
+
* @property {DatePickerCalendarDropdownText} calendarText - Customized strings to display in the calendar dropdown UI.
|
|
12
13
|
* @property {boolean} [disabled=false] - Whether the date picker is disabled or not.
|
|
13
14
|
* @property {(date: Date) => boolean} disableDayCallback - The callback to use for testing whether a specific date should be disabled or not.
|
|
14
15
|
* @property {Date | Date[] | null | undefined} disabledDates - The dates that are restricted from being selected.
|
|
@@ -32,6 +33,7 @@ import { BASE_DATE_PICKER_CONSTANTS } from './base-date-picker-constants';
|
|
|
32
33
|
* @property {string} yearRange - The year range.
|
|
33
34
|
*
|
|
34
35
|
* @attribute {boolean} [allow-invalid-date=false] - Whether to allow an invalid date to be input. When true, the date picker will not clear out the value of the input if the date was invalid (i.e. could not be parsed).
|
|
36
|
+
* @attribute {DatePickerCalendarDropdownText} [calendar-text] - Customized strings to display in the calendar dropdown UI.
|
|
35
37
|
* @attribute {boolean} [disabled=false] - Whether the date picker is disabled or not.
|
|
36
38
|
* @attribute {string} [disabled-days-of-week] - The days of the week to disable from selection.
|
|
37
39
|
* @attribute {string} [locale] - The locale to use.
|
|
@@ -111,6 +113,9 @@ export class BaseDatePickerComponent extends BaseComponent {
|
|
|
111
113
|
case BASE_DATE_PICKER_CONSTANTS.observedAttributes.LOCALE:
|
|
112
114
|
this.locale = newValue;
|
|
113
115
|
break;
|
|
116
|
+
case BASE_DATE_PICKER_CONSTANTS.observedAttributes.CALENDAR_TEXT:
|
|
117
|
+
this.calendarText = JSON.parse(newValue);
|
|
118
|
+
break;
|
|
114
119
|
}
|
|
115
120
|
}
|
|
116
121
|
}
|
|
@@ -180,3 +185,6 @@ __decorate([
|
|
|
180
185
|
__decorate([
|
|
181
186
|
coreProperty()
|
|
182
187
|
], BaseDatePickerComponent.prototype, "locale", void 0);
|
|
188
|
+
__decorate([
|
|
189
|
+
coreProperty()
|
|
190
|
+
], BaseDatePickerComponent.prototype, "calendarText", void 0);
|
|
@@ -22,8 +22,10 @@ export class DateRangePickerAdapter extends BaseDatePickerAdapter {
|
|
|
22
22
|
if (!this._fromInputElement || !this._fromInputElement) {
|
|
23
23
|
throw new Error(`The ${DATE_RANGE_PICKER_CONSTANTS.elementName} requires two inputs`);
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
if (!this._component.querySelector(`[${FIELD_CONSTANTS.attributes.MULTI_INPUT_SEPARATOR}]`)) {
|
|
26
|
+
const separator = this._createInputSeparator();
|
|
27
|
+
this._fromInputElement.insertAdjacentElement('afterend', separator);
|
|
28
|
+
}
|
|
27
29
|
}
|
|
28
30
|
_initializeCalendarDropdown() {
|
|
29
31
|
const targetElement = this._getDefaultTargetElement();
|
|
@@ -15,6 +15,7 @@ export declare const LIST_ITEM_CONSTANTS: {
|
|
|
15
15
|
THREE_LINE: string;
|
|
16
16
|
WRAP: string;
|
|
17
17
|
NONINTERACTIVE: string;
|
|
18
|
+
FOCUS_PROPAGATION: string;
|
|
18
19
|
};
|
|
19
20
|
attributes: {
|
|
20
21
|
SELECTED: string;
|
|
@@ -26,6 +27,7 @@ export declare const LIST_ITEM_CONSTANTS: {
|
|
|
26
27
|
THREE_LINE: string;
|
|
27
28
|
WRAP: string;
|
|
28
29
|
NONINTERACTIVE: string;
|
|
30
|
+
FOCUS_PROPAGATION: string;
|
|
29
31
|
};
|
|
30
32
|
classes: {
|
|
31
33
|
ROOT: string;
|
|
@@ -47,7 +49,11 @@ export declare const LIST_ITEM_CONSTANTS: {
|
|
|
47
49
|
events: {
|
|
48
50
|
SELECT: string;
|
|
49
51
|
};
|
|
52
|
+
defaults: {
|
|
53
|
+
FOCUS_PROPAGATION: ListItemFocusPropagation;
|
|
54
|
+
};
|
|
50
55
|
};
|
|
51
56
|
export interface IListItemSelectEventData<T = any> {
|
|
52
57
|
value: T;
|
|
53
58
|
}
|
|
59
|
+
export type ListItemFocusPropagation = 'allow' | 'off';
|
|
@@ -14,7 +14,8 @@ const observedAttributes = {
|
|
|
14
14
|
TWO_LINE: 'two-line',
|
|
15
15
|
THREE_LINE: 'three-line',
|
|
16
16
|
WRAP: 'wrap',
|
|
17
|
-
NONINTERACTIVE: 'noninteractive'
|
|
17
|
+
NONINTERACTIVE: 'noninteractive',
|
|
18
|
+
FOCUS_PROPAGATION: 'focus-propagation'
|
|
18
19
|
};
|
|
19
20
|
const attributes = {
|
|
20
21
|
...observedAttributes
|
|
@@ -39,6 +40,9 @@ const selectors = {
|
|
|
39
40
|
const events = {
|
|
40
41
|
SELECT: `${elementName}-select`
|
|
41
42
|
};
|
|
43
|
+
const defaults = {
|
|
44
|
+
FOCUS_PROPAGATION: 'allow'
|
|
45
|
+
};
|
|
42
46
|
export const LIST_ITEM_CONSTANTS = {
|
|
43
47
|
elementName,
|
|
44
48
|
observedAttributes,
|
|
@@ -46,5 +50,6 @@ export const LIST_ITEM_CONSTANTS = {
|
|
|
46
50
|
classes,
|
|
47
51
|
selectors,
|
|
48
52
|
ids,
|
|
49
|
-
events
|
|
53
|
+
events,
|
|
54
|
+
defaults
|
|
50
55
|
};
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* License: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { IListItemAdapter } from './list-item-adapter';
|
|
7
|
+
import { ListItemFocusPropagation } from './list-item-constants';
|
|
7
8
|
export interface IListItemCore {
|
|
8
9
|
selected: boolean;
|
|
9
10
|
active: boolean;
|
|
@@ -14,6 +15,7 @@ export interface IListItemCore {
|
|
|
14
15
|
threeLine: boolean;
|
|
15
16
|
wrap: boolean;
|
|
16
17
|
noninteractive: boolean;
|
|
18
|
+
focusPropagation: ListItemFocusPropagation;
|
|
17
19
|
}
|
|
18
20
|
export declare class ListItemCore implements IListItemCore {
|
|
19
21
|
private _adapter;
|
|
@@ -26,6 +28,7 @@ export declare class ListItemCore implements IListItemCore {
|
|
|
26
28
|
private _threeLine;
|
|
27
29
|
private _wrap;
|
|
28
30
|
private _noninteractive;
|
|
31
|
+
private _focusPropagation;
|
|
29
32
|
private _interactiveStateChangeListener;
|
|
30
33
|
private _mousedownListener;
|
|
31
34
|
private _clickListener;
|
|
@@ -57,4 +60,6 @@ export declare class ListItemCore implements IListItemCore {
|
|
|
57
60
|
set wrap(value: boolean);
|
|
58
61
|
get noninteractive(): boolean;
|
|
59
62
|
set noninteractive(value: boolean);
|
|
63
|
+
get focusPropagation(): ListItemFocusPropagation;
|
|
64
|
+
set focusPropagation(value: ListItemFocusPropagation);
|
|
60
65
|
}
|
|
@@ -15,6 +15,7 @@ export class ListItemCore {
|
|
|
15
15
|
this._threeLine = false;
|
|
16
16
|
this._wrap = false;
|
|
17
17
|
this._noninteractive = false;
|
|
18
|
+
this._focusPropagation = LIST_ITEM_CONSTANTS.defaults.FOCUS_PROPAGATION;
|
|
18
19
|
this._interactiveStateChangeListener = this._onInteractiveStateChange.bind(this);
|
|
19
20
|
this._mousedownListener = this._onMousedown.bind(this);
|
|
20
21
|
this._clickListener = this._onClick.bind(this);
|
|
@@ -35,7 +36,7 @@ export class ListItemCore {
|
|
|
35
36
|
_onMousedown(evt) {
|
|
36
37
|
const composedElements = evt.composedPath().filter((el) => el.nodeType === Node.ELEMENT_NODE);
|
|
37
38
|
const fromInteractiveElement = composedElements.some(el => el === this._adapter.interactiveElement);
|
|
38
|
-
if (!fromInteractiveElement) {
|
|
39
|
+
if (this._focusPropagation === 'off' || !fromInteractiveElement) {
|
|
39
40
|
evt.preventDefault();
|
|
40
41
|
}
|
|
41
42
|
}
|
|
@@ -104,7 +105,9 @@ export class ListItemCore {
|
|
|
104
105
|
this._dispatchSelectEvent();
|
|
105
106
|
}
|
|
106
107
|
_clickInteractiveElement() {
|
|
107
|
-
this.
|
|
108
|
+
if (this._focusPropagation === 'allow') {
|
|
109
|
+
this._adapter.interactiveElement?.focus();
|
|
110
|
+
}
|
|
108
111
|
this._adapter.tempDeactivateFocusIndicator(); // Workaround until we can call `focus({ focusVisible: false })` to prevent focus ring from showing
|
|
109
112
|
this._adapter.interactiveElement?.click();
|
|
110
113
|
}
|
|
@@ -227,4 +230,16 @@ export class ListItemCore {
|
|
|
227
230
|
this._adapter.toggleHostAttribute(LIST_ITEM_CONSTANTS.attributes.NONINTERACTIVE, this._noninteractive);
|
|
228
231
|
}
|
|
229
232
|
}
|
|
233
|
+
get focusPropagation() {
|
|
234
|
+
return this._focusPropagation;
|
|
235
|
+
}
|
|
236
|
+
set focusPropagation(value) {
|
|
237
|
+
if (!['allow', 'off'].includes(value)) {
|
|
238
|
+
value = LIST_ITEM_CONSTANTS.defaults.FOCUS_PROPAGATION;
|
|
239
|
+
}
|
|
240
|
+
if (this._focusPropagation !== value) {
|
|
241
|
+
this._focusPropagation = value;
|
|
242
|
+
this._adapter.toggleHostAttribute(LIST_ITEM_CONSTANTS.attributes.FOCUS_PROPAGATION, this._focusPropagation !== LIST_ITEM_CONSTANTS.defaults.FOCUS_PROPAGATION, this._focusPropagation);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
230
245
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright Tyler Technologies, Inc.
|
|
4
4
|
* License: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { IListItemSelectEventData } from './list-item-constants';
|
|
6
|
+
import { IListItemSelectEventData, ListItemFocusPropagation } from './list-item-constants';
|
|
7
7
|
import { IWithElementInternals } from '../../core/mixins/internals/with-element-internals';
|
|
8
8
|
import { IWithDefaultAria } from '../../core/mixins/internals/with-default-aria';
|
|
9
9
|
import { BaseComponent } from '../../core/base/base-component';
|
|
@@ -17,6 +17,7 @@ export interface IListItemProperties<T = unknown> {
|
|
|
17
17
|
threeLine: boolean;
|
|
18
18
|
wrap: boolean;
|
|
19
19
|
noninteractive: boolean;
|
|
20
|
+
focusPropagation: ListItemFocusPropagation;
|
|
20
21
|
}
|
|
21
22
|
export interface IListItemComponent<T = unknown> extends IListItemProperties<T>, IWithElementInternals, IWithDefaultAria {
|
|
22
23
|
}
|
|
@@ -43,6 +44,7 @@ declare const ListItemComponent_base: import("../..").AbstractConstructor<import
|
|
|
43
44
|
* @property {boolean} [threeLine=false] - Sets the list item height to support at least three lines of text.
|
|
44
45
|
* @property {boolean} [wrap=false] - Sets the list item to wrap its text content.
|
|
45
46
|
* @property {boolean} [noninteractive=false] - Controls whether the list item will automatically attach itself to interactive slotted elements or not.
|
|
47
|
+
* @property {boolean} [focusPropagation="allow"] - Controls whether the interactive element will receive focus if a non-interactive element is clicked within the list item.
|
|
46
48
|
*
|
|
47
49
|
* @attribute {boolean} [selected=false] - Applies the selected state to the list item.
|
|
48
50
|
* @attribute {boolean} [active=false] - Applies the active state to the list item by emulating its focused state.
|
|
@@ -53,6 +55,7 @@ declare const ListItemComponent_base: import("../..").AbstractConstructor<import
|
|
|
53
55
|
* @attribute {boolean} [three-line=false] - Sets the list item height to support at least three lines of text.
|
|
54
56
|
* @attribute {boolean} [wrap=false] - Sets the list item to wrap its text content.
|
|
55
57
|
* @attribute {boolean} [noninteractive=false] - Controls whether the list item will automatically attach itself to interactive slotted elements or not.
|
|
58
|
+
* @attribute {boolean} [focus-propagation="allow"] - Controls whether the interactive element will receive focus if a non-interactive element is clicked within the list item.
|
|
56
59
|
*
|
|
57
60
|
* @event {CustomEvent<IListItemSelectEventData>} forge-list-item-select - Fires when the list item is selected.
|
|
58
61
|
*
|
|
@@ -128,5 +131,6 @@ export declare class ListItemComponent extends ListItemComponent_base implements
|
|
|
128
131
|
threeLine: boolean;
|
|
129
132
|
wrap: boolean;
|
|
130
133
|
noninteractive: boolean;
|
|
134
|
+
focusPropagation: ListItemFocusPropagation;
|
|
131
135
|
}
|
|
132
136
|
export {};
|
|
@@ -29,6 +29,7 @@ const styles = ':host{--_list-item-indent:var(--forge-list-item-indent, var(--fo
|
|
|
29
29
|
* @property {boolean} [threeLine=false] - Sets the list item height to support at least three lines of text.
|
|
30
30
|
* @property {boolean} [wrap=false] - Sets the list item to wrap its text content.
|
|
31
31
|
* @property {boolean} [noninteractive=false] - Controls whether the list item will automatically attach itself to interactive slotted elements or not.
|
|
32
|
+
* @property {boolean} [focusPropagation="allow"] - Controls whether the interactive element will receive focus if a non-interactive element is clicked within the list item.
|
|
32
33
|
*
|
|
33
34
|
* @attribute {boolean} [selected=false] - Applies the selected state to the list item.
|
|
34
35
|
* @attribute {boolean} [active=false] - Applies the active state to the list item by emulating its focused state.
|
|
@@ -39,6 +40,7 @@ const styles = ':host{--_list-item-indent:var(--forge-list-item-indent, var(--fo
|
|
|
39
40
|
* @attribute {boolean} [three-line=false] - Sets the list item height to support at least three lines of text.
|
|
40
41
|
* @attribute {boolean} [wrap=false] - Sets the list item to wrap its text content.
|
|
41
42
|
* @attribute {boolean} [noninteractive=false] - Controls whether the list item will automatically attach itself to interactive slotted elements or not.
|
|
43
|
+
* @attribute {boolean} [focus-propagation="allow"] - Controls whether the interactive element will receive focus if a non-interactive element is clicked within the list item.
|
|
42
44
|
*
|
|
43
45
|
* @event {CustomEvent<IListItemSelectEventData>} forge-list-item-select - Fires when the list item is selected.
|
|
44
46
|
*
|
|
@@ -142,6 +144,9 @@ let ListItemComponent = class ListItemComponent extends WithElementInternals(Wit
|
|
|
142
144
|
case LIST_ITEM_CONSTANTS.observedAttributes.NONINTERACTIVE:
|
|
143
145
|
this.noninteractive = coerceBoolean(newValue);
|
|
144
146
|
break;
|
|
147
|
+
case LIST_ITEM_CONSTANTS.observedAttributes.FOCUS_PROPAGATION:
|
|
148
|
+
this.focusPropagation = newValue;
|
|
149
|
+
break;
|
|
145
150
|
}
|
|
146
151
|
}
|
|
147
152
|
};
|
|
@@ -172,6 +177,9 @@ __decorate([
|
|
|
172
177
|
__decorate([
|
|
173
178
|
coreProperty()
|
|
174
179
|
], ListItemComponent.prototype, "noninteractive", void 0);
|
|
180
|
+
__decorate([
|
|
181
|
+
coreProperty()
|
|
182
|
+
], ListItemComponent.prototype, "focusPropagation", void 0);
|
|
175
183
|
ListItemComponent = __decorate([
|
|
176
184
|
customElement({
|
|
177
185
|
name: LIST_ITEM_CONSTANTS.elementName,
|
|
@@ -152,6 +152,7 @@ export function createListItems(config, listElement, options, startIndex = 0, re
|
|
|
152
152
|
}
|
|
153
153
|
let listItemElement = document.createElement('forge-list-item');
|
|
154
154
|
listItemElement.value = option.value;
|
|
155
|
+
listItemElement.focusPropagation = 'off';
|
|
155
156
|
listItemElement.setAttribute('role', 'presentation');
|
|
156
157
|
const buttonElement = document.createElement('button');
|
|
157
158
|
buttonElement.type = 'button';
|