@tylertech/forge 3.6.4 → 3.8.0-dev.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 +435 -350
- package/dist/button/forge-button.css +3 -2
- package/dist/dialog/forge-dialog.css +3 -0
- package/dist/lib.js +23 -15
- package/dist/lib.js.map +4 -4
- package/dist/list/forge-list.css +5 -1
- package/dist/switch/forge-switch.css +1 -1
- package/dist/vscode.css-custom-data.json +36 -20
- package/dist/vscode.html-custom-data.json +27 -48
- package/esm/app-bar/notification-button/app-bar-notification-button-adapter.js +4 -5
- package/esm/app-bar/notification-button/app-bar-notification-button.js +6 -3
- package/esm/app-bar/profile-button/app-bar-profile-button.js +1 -1
- package/esm/autocomplete/autocomplete-adapter.js +1 -1
- package/esm/avatar/avatar-constants.d.ts +1 -0
- package/esm/avatar/avatar-constants.js +1 -0
- package/esm/avatar/avatar.d.ts +1 -1
- package/esm/avatar/avatar.js +1 -1
- package/esm/badge/badge-component-delegate.js +1 -2
- package/esm/badge/badge-constants.d.ts +1 -0
- package/esm/badge/badge-constants.js +1 -0
- package/esm/badge/badge.d.ts +20 -23
- package/esm/badge/badge.js +57 -47
- package/esm/badge/index.js +3 -3
- package/esm/bottom-sheet/bottom-sheet-constants.d.ts +1 -1
- package/esm/bottom-sheet/bottom-sheet.d.ts +3 -1
- package/esm/button/button.js +1 -1
- package/esm/button-toggle/button-toggle-group/button-toggle-group-adapter.js +1 -2
- package/esm/button-toggle/button-toggle-group/button-toggle-group.d.ts +6 -6
- package/esm/button-toggle/button-toggle-group/button-toggle-group.js +6 -6
- package/esm/card/card-constants.d.ts +1 -0
- package/esm/card/card-constants.js +1 -0
- package/esm/card/card.d.ts +12 -13
- package/esm/card/card.js +25 -34
- package/esm/card/index.js +3 -3
- package/esm/checkbox/checkbox.d.ts +5 -1
- package/esm/chips/chip/chip-constants.d.ts +1 -1
- package/esm/core/delegates/base-component-delegate.d.ts +1 -1
- package/esm/core/mask/date-input-mask.d.ts +3 -3
- package/esm/core/mask/date-input-mask.js +7 -8
- package/esm/core/mask/intermediate-time-parser.d.ts +2 -2
- package/esm/core/mask/intermediate-time-parser.js +2 -3
- package/esm/core/mask/time-input-mask.d.ts +3 -3
- package/esm/core/mask/time-input-mask.js +4 -5
- package/esm/core/mixins/label/with-label-aware.d.ts +4 -1
- package/esm/core/utils/a11y-utils.d.ts +0 -8
- package/esm/core/utils/a11y-utils.js +5 -25
- package/esm/core/utils/dismissible-stack.d.ts +7 -0
- package/esm/core/utils/position-utils.d.ts +1 -2
- package/esm/core/utils/position-utils.js +7 -22
- package/esm/core/utils/utils.d.ts +14 -0
- package/esm/core/utils/utils.js +44 -1
- package/esm/date-picker/base/base-date-picker-constants.d.ts +2 -2
- package/esm/deprecated/button/deprecated-button.js +1 -1
- package/esm/dialog/dialog-core.js +2 -2
- package/esm/dialog/dialog.d.ts +2 -0
- package/esm/dialog/dialog.js +1 -1
- package/esm/expansion-panel/expansion-panel-adapter.d.ts +31 -0
- package/esm/expansion-panel/expansion-panel-adapter.js +60 -1
- package/esm/expansion-panel/expansion-panel-constants.d.ts +4 -0
- package/esm/expansion-panel/expansion-panel-constants.js +4 -1
- package/esm/expansion-panel/expansion-panel-core.d.ts +13 -1
- package/esm/expansion-panel/expansion-panel-core.js +63 -1
- package/esm/expansion-panel/expansion-panel.d.ts +9 -0
- package/esm/expansion-panel/expansion-panel.js +14 -0
- package/esm/field/base/base-field.d.ts +1 -0
- package/esm/field/base/base-field.js +1 -0
- package/esm/field/field-constants.d.ts +1 -0
- package/esm/field/field-constants.js +1 -0
- package/esm/field/field.d.ts +1 -0
- package/esm/field/field.js +3 -2
- package/esm/floating-action-button/floating-action-button-constants.d.ts +1 -1
- package/esm/icon/icon-constants.d.ts +1 -1
- package/esm/icon/icon-registry.d.ts +6 -0
- package/esm/icon-button/icon-button-constants.d.ts +1 -1
- package/esm/label/label-adapter.js +1 -1
- package/esm/list/list-item/list-item.js +1 -1
- package/esm/list-dropdown/list-dropdown-constants.d.ts +11 -0
- package/esm/list-dropdown/list-dropdown-utils.js +18 -0
- package/esm/menu/menu-constants.d.ts +0 -1
- package/esm/menu/menu-constants.js +1 -2
- package/esm/menu/menu-core.js +1 -1
- package/esm/menu/menu.js +2 -1
- package/esm/meter/meter/meter.js +2 -1
- package/esm/meter/meter-group/meter-group.js +2 -1
- package/esm/overlay/base/base-overlay-core.d.ts +3 -3
- package/esm/overlay/base/base-overlay.d.ts +3 -3
- package/esm/overlay/base/base-overlay.js +11 -1
- package/esm/overlay/base/overlay-aware-core.d.ts +3 -3
- package/esm/overlay/base/overlay-aware-core.js +2 -1
- package/esm/overlay/overlay-adapter.d.ts +2 -2
- package/esm/overlay/overlay-adapter.js +6 -14
- package/esm/overlay/overlay-constants.d.ts +2 -5
- package/esm/overlay/overlay-constants.js +2 -23
- package/esm/overlay/overlay-core.d.ts +3 -3
- package/esm/overlay/overlay-core.js +13 -3
- package/esm/overlay/overlay.d.ts +2 -2
- package/esm/overlay/overlay.js +2 -2
- package/esm/popover/popover-adapter.js +2 -2
- package/esm/popover/popover.js +1 -1
- package/esm/profile-card/profile-card-core.js +4 -4
- package/esm/radio/core/radio-group-manager.d.ts +2 -1
- package/esm/radio/radio/radio.d.ts +1 -0
- package/esm/select/core/base-select-adapter.js +2 -1
- package/esm/select/option/option-constants.d.ts +1 -0
- package/esm/select/option/option-constants.js +1 -0
- package/esm/select/option/option-core.d.ts +4 -1
- package/esm/select/option/option-core.js +8 -0
- package/esm/select/option/option.d.ts +5 -1
- package/esm/select/option/option.js +8 -1
- package/esm/select/select/select-core.js +1 -3
- package/esm/select/select/select.d.ts +1 -0
- package/esm/select/select/select.js +1 -0
- package/esm/split-button/split-button-constants.d.ts +2 -2
- package/esm/split-view/split-view-panel/split-view-panel.js +1 -1
- package/esm/stepper/stepper/stepper-constants.d.ts +15 -1
- package/esm/switch/switch.d.ts +6 -2
- package/esm/switch/switch.js +1 -1
- package/esm/table/table-core.js +10 -2
- package/esm/table/table-utils.js +8 -4
- package/esm/tabs/tab-bar/tab-bar-core.js +3 -0
- package/esm/text-field/text-field.d.ts +1 -0
- package/esm/text-field/text-field.js +1 -0
- package/esm/time-picker/time-picker-adapter.js +0 -1
- package/esm/time-picker/time-picker-constants.d.ts +2 -2
- package/esm/toast/toast-constants.d.ts +1 -1
- package/esm/tooltip/tooltip-constants.d.ts +1 -1
- package/package.json +4 -4
- package/sass/badge/badge.scss +10 -10
- package/sass/button/_core.scss +1 -0
- package/sass/calendar/_variables.scss +3 -2
- package/sass/card/card.scss +1 -1
- package/sass/core/styles/tokens/button/_tokens.scss +2 -2
- package/sass/core/styles/tokens/slider/_tokens.scss +10 -4
- package/sass/core/styles/tokens/switch/_tokens.scss +1 -1
- package/sass/dialog/dialog.scss +8 -0
- package/sass/dialog/forge-dialog.scss +4 -0
- package/sass/field/_core.scss +1 -1
- package/sass/field/field.scss +1 -1
- package/sass/linear-progress/linear-progress.scss +7 -3
- package/sass/list/list-item/_core.scss +9 -1
- package/sass/list/list-item/list-item.scss +5 -1
- package/sass/popover/popover.scss +0 -1
- package/sass/slider/_core.scss +2 -3
|
@@ -99,7 +99,11 @@ export declare class CheckboxComponent extends CheckboxComponent_base implements
|
|
|
99
99
|
labelClickedCallback(): void;
|
|
100
100
|
labelChangedCallback(value: string | null): void;
|
|
101
101
|
/** @ignore */
|
|
102
|
-
setFormValue(value: FormValue
|
|
102
|
+
setFormValue(value: (FormValue & {
|
|
103
|
+
[key: string]: any;
|
|
104
|
+
}) | null, state?: (FormValue & {
|
|
105
|
+
[key: string]: any;
|
|
106
|
+
}) | null | undefined): void;
|
|
103
107
|
/**
|
|
104
108
|
* Gets/sets whether the checkbox is checked.
|
|
105
109
|
* @default false
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export type BaseComponentDelegateProps<T extends HTMLElement> = Partial<T>;
|
|
7
7
|
export interface IBaseComponentDelegateOptions {
|
|
8
|
-
style?: Partial<CSSStyleDeclaration>
|
|
8
|
+
style?: Partial<CSSStyleDeclaration> & {
|
|
9
9
|
[key: string]: string;
|
|
10
10
|
};
|
|
11
11
|
attributes?: {
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
* Copyright Tyler Technologies, Inc.
|
|
4
4
|
* License: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import
|
|
6
|
+
import { InputMask, type AppendFlags, type FactoryArg, type Masked } from 'imask';
|
|
7
7
|
export interface IDateInputMaskOptions {
|
|
8
8
|
showMaskFormat?: boolean;
|
|
9
9
|
pattern?: string;
|
|
10
10
|
useBlockCharPlaceholder?: boolean;
|
|
11
|
-
prepareCallback?: (value: string, masked: Masked<string>, flags:
|
|
11
|
+
prepareCallback?: (value: string, masked: Masked<string>, flags: AppendFlags, maskInstance: InputMask<FactoryArg>) => string;
|
|
12
12
|
onChange?: (value: string) => void;
|
|
13
13
|
}
|
|
14
14
|
export declare const DEFAULT_DATE_MASK = "0`0{/}`0`0{/}`0`0`0`0";
|
|
@@ -20,7 +20,7 @@ export declare class DateInputMask {
|
|
|
20
20
|
private _acceptListener;
|
|
21
21
|
constructor(_element: HTMLInputElement, _options?: IDateInputMaskOptions);
|
|
22
22
|
destroy(): void;
|
|
23
|
-
resolve(value: string):
|
|
23
|
+
resolve(value: string): void;
|
|
24
24
|
private _onAccept;
|
|
25
25
|
private get _isDefaultMask();
|
|
26
26
|
private _createOptions;
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* Copyright Tyler Technologies, Inc.
|
|
4
4
|
* License: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { InputMask, createMask, MaskedRange } from 'imask';
|
|
7
6
|
import { isNumeric } from '@tylertech/forge-core';
|
|
7
|
+
import { InputMask, MaskedRange, createMask } from 'imask';
|
|
8
8
|
export const DEFAULT_DATE_MASK = '0`0{/}`0`0{/}`0`0`0`0';
|
|
9
9
|
export class DateInputMask {
|
|
10
10
|
constructor(_element, _options = {}) {
|
|
@@ -25,7 +25,7 @@ export class DateInputMask {
|
|
|
25
25
|
}
|
|
26
26
|
resolve(value) {
|
|
27
27
|
const masked = createMask(this._maskOptions);
|
|
28
|
-
|
|
28
|
+
masked.resolve(value);
|
|
29
29
|
}
|
|
30
30
|
_onAccept() {
|
|
31
31
|
if (typeof this._options.onChange === 'function') {
|
|
@@ -36,11 +36,11 @@ export class DateInputMask {
|
|
|
36
36
|
return this._options.pattern === DEFAULT_DATE_MASK;
|
|
37
37
|
}
|
|
38
38
|
_createOptions() {
|
|
39
|
-
|
|
39
|
+
return {
|
|
40
40
|
mask: this._options.pattern || DEFAULT_DATE_MASK,
|
|
41
41
|
lazy: this._options.showMaskFormat === undefined ? false : !this._options.showMaskFormat,
|
|
42
42
|
overwrite: true,
|
|
43
|
-
|
|
43
|
+
prepareChar: (value, masked, flags) => this._prepare(value, masked, flags, this._mask),
|
|
44
44
|
blocks: {
|
|
45
45
|
MM: {
|
|
46
46
|
mask: MaskedRange,
|
|
@@ -65,7 +65,6 @@ export class DateInputMask {
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
|
-
return options;
|
|
69
68
|
}
|
|
70
69
|
_prepare(value, masked, flags, maskInstance) {
|
|
71
70
|
if (typeof this._options.prepareCallback === 'function') {
|
|
@@ -77,8 +76,8 @@ export class DateInputMask {
|
|
|
77
76
|
if (!flags.input || !value.length || !maskInstance) {
|
|
78
77
|
return value;
|
|
79
78
|
}
|
|
80
|
-
|
|
81
|
-
const isAllSelected =
|
|
79
|
+
const maskInstanceWithSelection = maskInstance;
|
|
80
|
+
const isAllSelected = maskInstanceWithSelection._selection && maskInstanceWithSelection._selection.end === 10;
|
|
82
81
|
const currentValue = isAllSelected ? '' : maskInstance.value;
|
|
83
82
|
if (!isNumeric(value)) {
|
|
84
83
|
// Before we ignore this character let's do some checks for common scenarios where the user enters a slash to help with coercion
|
|
@@ -135,7 +134,7 @@ export class DateInputMask {
|
|
|
135
134
|
}
|
|
136
135
|
_setMaskedValueAdjusted(value, position) {
|
|
137
136
|
this._mask.unmaskedValue = value;
|
|
138
|
-
|
|
137
|
+
this._mask.updateCursor(this._mask.cursorPos + position);
|
|
139
138
|
}
|
|
140
139
|
updateMask() {
|
|
141
140
|
this._mask.updateValue();
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright Tyler Technologies, Inc.
|
|
4
4
|
* License: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { InputMask } from 'imask';
|
|
6
|
+
import { InputMask, type FactoryArg } from 'imask';
|
|
7
7
|
import { TimeSegmentType } from './time-segment-parser';
|
|
8
8
|
export declare const SEGMENT_CURSOR_POSITION: {
|
|
9
9
|
'hours-start': number;
|
|
@@ -19,7 +19,7 @@ export declare class IntermediateTimeParser {
|
|
|
19
19
|
private _char;
|
|
20
20
|
private _mask;
|
|
21
21
|
private _segmentParser;
|
|
22
|
-
constructor(_char: string, _mask: InputMask<
|
|
22
|
+
constructor(_char: string, _mask: InputMask<FactoryArg>);
|
|
23
23
|
get value(): string;
|
|
24
24
|
get numChar(): number;
|
|
25
25
|
get asPaddedChar(): string;
|
|
@@ -39,8 +39,7 @@ export class IntermediateTimeParser {
|
|
|
39
39
|
return value;
|
|
40
40
|
}
|
|
41
41
|
get isAllSelected() {
|
|
42
|
-
|
|
43
|
-
const { start, end } = this._mask['_selection'];
|
|
42
|
+
const { start, end } = this._mask._selection;
|
|
44
43
|
return start === 0 && end > 0 && end === this._mask.value.length;
|
|
45
44
|
}
|
|
46
45
|
/** Determines if this is the first non-zero hours character being entered. */
|
|
@@ -100,7 +99,7 @@ export class IntermediateTimeParser {
|
|
|
100
99
|
applyValue(value, cursorPos) {
|
|
101
100
|
this._mask.unmaskedValue = value;
|
|
102
101
|
if (cursorPos !== undefined) {
|
|
103
|
-
|
|
102
|
+
this._mask.updateCursor(SEGMENT_CURSOR_POSITION[cursorPos]);
|
|
104
103
|
}
|
|
105
104
|
}
|
|
106
105
|
}
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
* Copyright Tyler Technologies, Inc.
|
|
4
4
|
* License: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import
|
|
6
|
+
import { FactoryArg, InputMask, type AppendFlags, type Masked } from 'imask';
|
|
7
7
|
export interface ITimeInputMaskOptions {
|
|
8
8
|
showMaskFormat?: boolean;
|
|
9
9
|
use24HourTime?: boolean;
|
|
10
10
|
showSeconds?: boolean;
|
|
11
11
|
onChange?: (value: string) => void;
|
|
12
|
-
prepareCallback?: (value: string, masked: Masked<string>, flags:
|
|
12
|
+
prepareCallback?: (value: string, masked: Masked<string>, flags: AppendFlags, maskInstance: InputMask<FactoryArg>) => string;
|
|
13
13
|
}
|
|
14
14
|
export declare const TWELVE_HOUR_TIME_MASK = "0`0{:}`0`0 `AM";
|
|
15
15
|
export declare const TWELVE_HOUR_TIME_MASK_WITH_SECONDS = "0`0{:}`0`0{:}`0`0 `AM";
|
|
@@ -23,7 +23,7 @@ export declare class TimeInputMask {
|
|
|
23
23
|
private _acceptListener;
|
|
24
24
|
constructor(_element: HTMLInputElement, _options?: ITimeInputMaskOptions);
|
|
25
25
|
destroy(): void;
|
|
26
|
-
resolve(value: string):
|
|
26
|
+
resolve(value: string): void;
|
|
27
27
|
update(): void;
|
|
28
28
|
private _onAccept;
|
|
29
29
|
private _createOptions;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* License: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { isNumeric } from '@tylertech/forge-core';
|
|
7
|
-
import {
|
|
7
|
+
import { InputMask, MaskedEnum, createMask } from 'imask';
|
|
8
8
|
import { IntermediateTimeParser } from './intermediate-time-parser';
|
|
9
9
|
export const TWELVE_HOUR_TIME_MASK = '0`0{:}`0`0 `AM';
|
|
10
10
|
export const TWELVE_HOUR_TIME_MASK_WITH_SECONDS = '0`0{:}`0`0{:}`0`0 `AM';
|
|
@@ -29,7 +29,7 @@ export class TimeInputMask {
|
|
|
29
29
|
}
|
|
30
30
|
resolve(value) {
|
|
31
31
|
const masked = createMask(this._maskOptions);
|
|
32
|
-
|
|
32
|
+
masked.resolve(value);
|
|
33
33
|
}
|
|
34
34
|
update() {
|
|
35
35
|
this._mask.updateValue();
|
|
@@ -44,7 +44,7 @@ export class TimeInputMask {
|
|
|
44
44
|
mask: this._getMaskFormat(),
|
|
45
45
|
overwrite: true,
|
|
46
46
|
lazy: !this._options.showMaskFormat,
|
|
47
|
-
|
|
47
|
+
prepareChar: (value, masked, flags) => this._prepare(value, masked, flags, this._mask),
|
|
48
48
|
blocks: {
|
|
49
49
|
A: {
|
|
50
50
|
mask: MaskedEnum,
|
|
@@ -66,8 +66,7 @@ export class TimeInputMask {
|
|
|
66
66
|
}
|
|
67
67
|
// Whenever we paste text we don't care to send it through our custom prepare logic,
|
|
68
68
|
// so just return the character being processed.
|
|
69
|
-
|
|
70
|
-
if (maskInstance['_inputEvent']?.inputType !== 'insertText') {
|
|
69
|
+
if (maskInstance._inputEvent?.inputType !== 'insertText') {
|
|
71
70
|
return value;
|
|
72
71
|
}
|
|
73
72
|
return this._prepareDefault(value, maskInstance).toUpperCase();
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright Tyler Technologies, Inc.
|
|
4
4
|
* License: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { AbstractConstructor, MixinBase } from '../../../constants';
|
|
6
|
+
import { AbstractConstructor, MixinBase, forgeLabelRef, updateTarget } from '../../../constants';
|
|
7
7
|
import { IBaseComponent } from '../../base/base-component';
|
|
8
8
|
/**
|
|
9
9
|
* An element that can be associated with a Forge label component.
|
|
@@ -20,6 +20,9 @@ export interface IWithLabelAwareness extends IBaseComponent {
|
|
|
20
20
|
* A callback for when the associated label is clicked.
|
|
21
21
|
*/
|
|
22
22
|
labelClickedCallback?(): void;
|
|
23
|
+
[forgeLabelRef]?: {
|
|
24
|
+
[updateTarget](target: HTMLElement): boolean;
|
|
25
|
+
};
|
|
23
26
|
}
|
|
24
27
|
export declare abstract class WithLabelAwarenessContract {
|
|
25
28
|
connectedCallback(): void;
|
|
@@ -135,11 +135,3 @@ export type DefaultAriaOptions = {
|
|
|
135
135
|
* }
|
|
136
136
|
*/
|
|
137
137
|
export declare function setDefaultAria(element: HTMLElement, internals: ElementInternals, properties: Partial<ARIAMixinStrict>, { setAttribute }?: DefaultAriaOptions): void;
|
|
138
|
-
/**
|
|
139
|
-
* Adds or removes a state from an element's custom state set.
|
|
140
|
-
*
|
|
141
|
-
* @param internals - The element's internals object.
|
|
142
|
-
* @param state - The name of the custom state to toggle.
|
|
143
|
-
* @param value - Whether to add or remove the state.
|
|
144
|
-
*/
|
|
145
|
-
export declare function toggleState(internals: ElementInternals, state: string, value: boolean): void;
|
|
@@ -63,10 +63,13 @@ export const ARIA_PROPERTIES = [
|
|
|
63
63
|
const ARIA_ATTRIBUTES_TO_PROPERTIES = {
|
|
64
64
|
'aria-atomic': 'ariaAtomic',
|
|
65
65
|
'aria-autocomplete': 'ariaAutoComplete',
|
|
66
|
+
'aria-braillelabel': 'ariaBrailleLabel',
|
|
67
|
+
'aria-brailleroledescription': 'ariaBrailleRoleDescription',
|
|
66
68
|
'aria-busy': 'ariaBusy',
|
|
67
69
|
'aria-checked': 'ariaChecked',
|
|
68
70
|
'aria-colcount': 'ariaColCount',
|
|
69
71
|
'aria-colindex': 'ariaColIndex',
|
|
72
|
+
'aria-colindextext': 'ariaColIndexText',
|
|
70
73
|
'aria-colspan': 'ariaColSpan',
|
|
71
74
|
'aria-current': 'ariaCurrent',
|
|
72
75
|
'aria-description': 'ariaDescription',
|
|
@@ -87,10 +90,12 @@ const ARIA_ATTRIBUTES_TO_PROPERTIES = {
|
|
|
87
90
|
'aria-posinset': 'ariaPosInSet',
|
|
88
91
|
'aria-pressed': 'ariaPressed',
|
|
89
92
|
'aria-readonly': 'ariaReadOnly',
|
|
93
|
+
'aria-relevant': 'ariaRelevant',
|
|
90
94
|
'aria-required': 'ariaRequired',
|
|
91
95
|
'aria-roledescription': 'ariaRoleDescription',
|
|
92
96
|
'aria-rowcount': 'ariaRowCount',
|
|
93
97
|
'aria-rowindex': 'ariaRowIndex',
|
|
98
|
+
'aria-rowindextext': 'ariaRowIndexText',
|
|
94
99
|
'aria-rowspan': 'ariaRowSpan',
|
|
95
100
|
'aria-selected': 'ariaSelected',
|
|
96
101
|
'aria-setsize': 'ariaSetSize',
|
|
@@ -166,28 +171,3 @@ export function setDefaultAria(element, internals, properties, { setAttribute }
|
|
|
166
171
|
}
|
|
167
172
|
});
|
|
168
173
|
}
|
|
169
|
-
/**
|
|
170
|
-
* Adds or removes a state from an element's custom state set.
|
|
171
|
-
*
|
|
172
|
-
* @param internals - The element's internals object.
|
|
173
|
-
* @param state - The name of the custom state to toggle.
|
|
174
|
-
* @param value - Whether to add or remove the state.
|
|
175
|
-
*/
|
|
176
|
-
export function toggleState(internals, state, value) {
|
|
177
|
-
if (value) {
|
|
178
|
-
try {
|
|
179
|
-
internals.states.add(state);
|
|
180
|
-
}
|
|
181
|
-
catch {
|
|
182
|
-
internals.states.add(`--${state}`);
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
else {
|
|
186
|
-
try {
|
|
187
|
-
internals.states.delete(state);
|
|
188
|
-
}
|
|
189
|
-
catch {
|
|
190
|
-
internals.states.delete(`--${state}`);
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
}
|
|
@@ -4,12 +4,18 @@
|
|
|
4
4
|
* License: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
export declare const tryDismiss: unique symbol;
|
|
7
|
+
declare const DISMISSIBLE_STACK_INSTANCE_KEY: unique symbol;
|
|
7
8
|
export interface IDismissibleStackState<T = string> {
|
|
8
9
|
[key: string]: T;
|
|
9
10
|
}
|
|
10
11
|
export interface IDismissible {
|
|
11
12
|
[tryDismiss](state?: IDismissibleStackState): boolean;
|
|
12
13
|
}
|
|
14
|
+
declare global {
|
|
15
|
+
interface Window {
|
|
16
|
+
[DISMISSIBLE_STACK_INSTANCE_KEY]: DismissibleStack<IDismissible>;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
13
19
|
export declare class DismissibleStack<T extends IDismissible> {
|
|
14
20
|
private _deferredDismiss;
|
|
15
21
|
/**
|
|
@@ -78,3 +84,4 @@ export declare class DismissibleStack<T extends IDismissible> {
|
|
|
78
84
|
*/
|
|
79
85
|
isMostRecent(el: T): boolean;
|
|
80
86
|
}
|
|
87
|
+
export {};
|
|
@@ -3,10 +3,9 @@
|
|
|
3
3
|
* Copyright Tyler Technologies, Inc.
|
|
4
4
|
* License: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
6
|
+
import { ArrowOptions, FlipOptions, HideOptions, MiddlewareData, OffsetOptions, Placement, ShiftOptions, Strategy } from '@floating-ui/dom';
|
|
7
7
|
export type PositionPlacement = Placement;
|
|
8
8
|
export type PositionStrategy = Strategy;
|
|
9
|
-
export declare const DEFAULT_FALLBACK_PLACEMENTS: PositionPlacement[];
|
|
10
9
|
export interface IPositionElementResult {
|
|
11
10
|
x: number;
|
|
12
11
|
y: number;
|
|
@@ -3,19 +3,8 @@
|
|
|
3
3
|
* Copyright Tyler Technologies, Inc.
|
|
4
4
|
* License: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { computePosition, flip as flipMiddleware, hide as hideMiddleware,
|
|
6
|
+
import { arrow as arrowMiddleware, computePosition, flip as flipMiddleware, hide as hideMiddleware, offset as offsetMiddleware, shift as shiftMiddleware } from '@floating-ui/dom';
|
|
7
7
|
import { roundByDPR } from './utils';
|
|
8
|
-
export const DEFAULT_FALLBACK_PLACEMENTS = [
|
|
9
|
-
'top-start',
|
|
10
|
-
'top',
|
|
11
|
-
'top-end',
|
|
12
|
-
'left-start',
|
|
13
|
-
'left',
|
|
14
|
-
'left-end',
|
|
15
|
-
'right-start',
|
|
16
|
-
'right',
|
|
17
|
-
'right-end'
|
|
18
|
-
];
|
|
19
8
|
export class VirtualElement {
|
|
20
9
|
constructor(x, y, height = 0, width = 0) {
|
|
21
10
|
this.x = x;
|
|
@@ -57,10 +46,7 @@ export class VirtualElement {
|
|
|
57
46
|
* @param {IPositionElementConfig} config Configuration to provide when positioning the element.
|
|
58
47
|
* @returns {IPositionElementResult} The result of the positioning logic.
|
|
59
48
|
*/
|
|
60
|
-
export async function positionElementAsync({ element, anchorElement, placement = 'bottom', offset = false, offsetOptions, strategy = 'fixed', apply = true, flip = true, flipOptions = {
|
|
61
|
-
fallbackPlacements: DEFAULT_FALLBACK_PLACEMENTS,
|
|
62
|
-
fallbackStrategy: 'initialPlacement'
|
|
63
|
-
}, shift = true, shiftOptions, hide = false, hideOptions, arrowElement, arrowOptions = {} }) {
|
|
49
|
+
export async function positionElementAsync({ element, anchorElement, placement = 'bottom', offset = false, offsetOptions, strategy = 'fixed', apply = true, flip = true, flipOptions, shift = true, shiftOptions, hide = false, hideOptions, arrowElement, arrowOptions = {} }) {
|
|
64
50
|
const middleware = [];
|
|
65
51
|
//
|
|
66
52
|
// Order of the following middleware is **important**
|
|
@@ -68,12 +54,12 @@ export async function positionElementAsync({ element, anchorElement, placement =
|
|
|
68
54
|
if (offset) {
|
|
69
55
|
middleware.push(offsetMiddleware(offsetOptions));
|
|
70
56
|
}
|
|
71
|
-
if (shift) {
|
|
72
|
-
middleware.push(shiftMiddleware(shiftOptions));
|
|
73
|
-
}
|
|
74
57
|
if (flip) {
|
|
75
58
|
middleware.push(flipMiddleware(flipOptions));
|
|
76
59
|
}
|
|
60
|
+
if (shift) {
|
|
61
|
+
middleware.push(shiftMiddleware(shiftOptions));
|
|
62
|
+
}
|
|
77
63
|
if (hide) {
|
|
78
64
|
middleware.push(hideMiddleware(hideOptions));
|
|
79
65
|
}
|
|
@@ -90,12 +76,11 @@ export async function positionElementAsync({ element, anchorElement, placement =
|
|
|
90
76
|
translate: `${roundByDPR(x)}px ${roundByDPR(y)}px`
|
|
91
77
|
};
|
|
92
78
|
Object.assign(element.style, styles);
|
|
93
|
-
// We use `display` here to ensure that any child overlays are also hidden
|
|
94
79
|
if (middlewareData.hide?.referenceHidden) {
|
|
95
|
-
element.style.
|
|
80
|
+
element.style.visibility = 'hidden';
|
|
96
81
|
}
|
|
97
82
|
else {
|
|
98
|
-
element.style.removeProperty('
|
|
83
|
+
element.style.removeProperty('visibility');
|
|
99
84
|
}
|
|
100
85
|
}
|
|
101
86
|
return {
|
|
@@ -154,3 +154,17 @@ export declare function frame(): Promise<void>;
|
|
|
154
154
|
* @returns `true` if the object is an instance of the type, otherwise `false`.
|
|
155
155
|
*/
|
|
156
156
|
export declare function isInstanceOf<T>(obj: any, name: string): obj is T;
|
|
157
|
+
/**
|
|
158
|
+
* Determines if an element is visible based on its computed styles.
|
|
159
|
+
* @param element The element to check.
|
|
160
|
+
* @returns `true` if the element is visible, otherwise `false`.
|
|
161
|
+
*/
|
|
162
|
+
export declare function checkVisibility(element: HTMLElement): boolean;
|
|
163
|
+
/**
|
|
164
|
+
* Adds or removes a state from an element's custom state set.
|
|
165
|
+
*
|
|
166
|
+
* @param internals - The element's internals object.
|
|
167
|
+
* @param state - The name of the custom state to toggle.
|
|
168
|
+
* @param value - Whether to add or remove the state.
|
|
169
|
+
*/
|
|
170
|
+
export declare function toggleState(internals: ElementInternals, state: string, value: boolean): void;
|
package/esm/core/utils/utils.js
CHANGED
|
@@ -276,7 +276,7 @@ export function tryCreateAriaControlsPlaceholder() {
|
|
|
276
276
|
*/
|
|
277
277
|
export function setAriaControls(component) {
|
|
278
278
|
const placeholderDiv = document.getElementById(ARIA_CONTROLS_PLACEHOLDER_ID);
|
|
279
|
-
if (placeholderDiv) {
|
|
279
|
+
if (placeholderDiv && component) {
|
|
280
280
|
component.setAttribute('aria-controls', placeholderDiv.id);
|
|
281
281
|
}
|
|
282
282
|
}
|
|
@@ -305,3 +305,46 @@ export function frame() {
|
|
|
305
305
|
export function isInstanceOf(obj, name) {
|
|
306
306
|
return Object.prototype.toString.call(obj) === `[object ${name}]`;
|
|
307
307
|
}
|
|
308
|
+
/**
|
|
309
|
+
* Determines if an element is visible based on its computed styles.
|
|
310
|
+
* @param element The element to check.
|
|
311
|
+
* @returns `true` if the element is visible, otherwise `false`.
|
|
312
|
+
*/
|
|
313
|
+
export function checkVisibility(element) {
|
|
314
|
+
// Use the `checkVisibility()` method on the element if available
|
|
315
|
+
if (typeof element.checkVisibility === 'function') {
|
|
316
|
+
return element.checkVisibility();
|
|
317
|
+
}
|
|
318
|
+
// Fall back to computed styles on older browsers
|
|
319
|
+
const style = window.getComputedStyle(element);
|
|
320
|
+
return (style.display !== 'none' &&
|
|
321
|
+
style.visibility !== 'hidden' &&
|
|
322
|
+
style.visibility !== 'collapse' &&
|
|
323
|
+
style.opacity !== '0' &&
|
|
324
|
+
style.getPropertyValue('content-visibility') !== 'hidden');
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Adds or removes a state from an element's custom state set.
|
|
328
|
+
*
|
|
329
|
+
* @param internals - The element's internals object.
|
|
330
|
+
* @param state - The name of the custom state to toggle.
|
|
331
|
+
* @param value - Whether to add or remove the state.
|
|
332
|
+
*/
|
|
333
|
+
export function toggleState(internals, state, value) {
|
|
334
|
+
if (value) {
|
|
335
|
+
try {
|
|
336
|
+
internals.states.add(state);
|
|
337
|
+
}
|
|
338
|
+
catch {
|
|
339
|
+
internals.states.add(`--${state}`);
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
else {
|
|
343
|
+
try {
|
|
344
|
+
internals.states.delete(state);
|
|
345
|
+
}
|
|
346
|
+
catch {
|
|
347
|
+
internals.states.delete(`--${state}`);
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
}
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
* Copyright Tyler Technologies, Inc.
|
|
4
4
|
* License: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import
|
|
6
|
+
import { Masked, InputMask, type AppendFlags, type FactoryArg } from 'imask';
|
|
7
7
|
import { DayOfWeek, ICalendarDateSelectEventData } from '../../calendar';
|
|
8
8
|
export declare type DatePickerParseCallback = (value: string) => Date | null;
|
|
9
9
|
export declare type DatePickerFormatCallback = (value: Date | null) => string;
|
|
10
|
-
export declare type DatePickerPrepareMaskCallback = (value: string, masked: Masked<string>, flags:
|
|
10
|
+
export declare type DatePickerPrepareMaskCallback = (value: string, masked: Masked<string>, flags: AppendFlags, maskInstance: InputMask<FactoryArg>) => string;
|
|
11
11
|
export declare type DatePickerValueMode = 'object' | 'string' | 'iso-string';
|
|
12
12
|
export interface IDatePickerCalendarDropdownConfig<T> {
|
|
13
13
|
value?: T | null;
|
|
@@ -10,7 +10,7 @@ import { StateLayerComponent, STATE_LAYER_CONSTANTS } from '../../state-layer';
|
|
|
10
10
|
import { DEPRECATED_BUTTON_CONSTANTS } from './deprecated-button-constants';
|
|
11
11
|
import { BaseComponent } from '../../core/base/base-component';
|
|
12
12
|
const template = '<template><slot></slot><forge-focus-indicator part=\"focus-indicator\"></forge-focus-indicator><forge-state-layer exportparts=\"surface:state-layer\"></forge-state-layer></template>';
|
|
13
|
-
const styles = ':host{--_button-primary-color:var(--forge-button-primary-color, var(--forge-theme-primary, #3f51b5));--_button-text-color:var(--forge-button-text-color, var(--_button-primary-color));--_button-disabled-color:var(--forge-button-disabled-color, var(--forge-theme-surface-container, #e0e0e0));--_button-padding:var(--forge-button-padding, var(--forge-spacing-medium, 16px));--_button-display:var(--forge-button-display, inline-flex);--_button-justify:var(--forge-button-justify, center);--_button-shape:var(--forge-button-shape, calc(var(--forge-shape-medium, 4px) * var(--forge-shape-factor, 1)));--_button-height:var(--forge-button-height, 36px);--_button-min-width:var(--forge-button-min-width, 64px);--_button-spacing:var(--forge-button-spacing, var(--forge-spacing-xsmall, 8px));--_button-border-width:var(--forge-button-border-width, medium);--_button-border-style:var(--forge-button-border-style, none);--_button-border-color:var(--forge-button-border-color, currentColor);--_button-shape-start-start-radius:var(--forge-button-shape-start-start-radius, var(--_button-shape));--_button-shape-start-end-radius:var(--forge-button-shape-start-end-radius, var(--_button-shape));--_button-shape-end-start-radius:var(--forge-button-shape-end-start-radius, var(--_button-shape));--_button-shape-end-end-radius:var(--forge-button-shape-end-end-radius, var(--_button-shape));--_button-padding-block:var(--forge-button-padding-block, var(--_button-padding));--_button-padding-inline:var(--forge-button-padding-inline, var(--_button-padding));--_button-background:var(--forge-button-background, transparent);--_button-hover-background:var(--forge-button-hover-background, var(--_button-background));--_button-active-background:var(--forge-button-active-background, var(--_button-background));--_button-color:var(--forge-button-color, var(--_button-text-color));--_button-icon-size:var(--forge-button-icon-size, calc(var(--forge-typography-font-size, 1rem) * 1.125));--_button-shadow:var(--forge-button-shadow, none);--_button-hover-shadow:var(--forge-button-hover-shadow, none);--_button-active-shadow:var(--forge-button-active-shadow, none);--_button-cursor:var(--forge-button-cursor, pointer);--_button-transition-duration:var(--forge-button-transition-duration, var(--forge-animation-duration-short3, 150ms));--_button-transition-timing:var(--forge-button-transition-timing, var(--forge-animation-easing-standard, cubic-bezier(0.2, 0, 0, 1)));--_button-text-padding-inline:var(--forge-button-text-padding-inline, var(--forge-spacing-xsmall, 8px));--_button-outlined-background:var(--forge-button-outlined-background, transparent);--_button-outlined-color:var(--forge-button-outlined-color, var(--_button-primary-color));--_button-outlined-border-width:var(--forge-button-outlined-border-width, var(--forge-border-thin, 1px));--_button-outlined-border-style:var(--forge-button-outlined-border-style, solid);--_button-outlined-border-color:var(--forge-button-outlined-border-color, var(--_button-primary-color));--_button-tonal-background:var(--forge-button-tonal-background, var(--forge-theme-primary-container, #d1d5ed));--_button-tonal-disabled-background:var(--forge-button-tonal-disabled-background, var(--_button-disabled-color));--_button-tonal-color:var(--forge-button-tonal-color, var(--forge-theme-on-primary-container, #222c62));--_button-tonal-disabled-color:var(--forge-button-tonal-disabled-color, var(--_button-disabled-text-color));--_button-filled-background:var(--forge-button-filled-background, var(--_button-primary-color));--_button-filled-disabled-background:var(--forge-button-filled-disabled-background, var(--_button-disabled-color));--_button-filled-color:var(--forge-button-filled-color, var(--forge-theme-on-primary, #ffffff));--_button-filled-disabled-color:var(--forge-button-filled-disabled-color, var(--_button-disabled-text-color));--_button-raised-background:var(--forge-button-raised-background, var(--_button-primary-color));--_button-raised-disabled-background:var(--forge-button-raised-disabled-background, var(--_button-disabled-color));--_button-raised-color:var(--forge-button-raised-color, var(--forge-theme-on-primary, #ffffff));--_button-raised-disabled-color:var(--forge-button-raised-disabled-color, var(--_button-disabled-text-color));--_button-raised-shadow:var(--forge-button-raised-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12));--_button-raised-hover-shadow:var(--forge-button-raised-hover-shadow, 0px 2px 4px -1px rgba(0, 0, 0, 0.2), 0px 4px 5px 0px rgba(0, 0, 0, 0.14), 0px 1px 10px 0px rgba(0, 0, 0, 0.12));--_button-raised-active-shadow:var(--forge-button-raised-active-shadow, 0px 5px 5px -3px rgba(0, 0, 0, 0.2), 0px 8px 10px 1px rgba(0, 0, 0, 0.14), 0px 3px 14px 2px rgba(0, 0, 0, 0.12));--_button-raised-disabled-shadow:var(--forge-button-raised-disabled-shadow, none);--_button-link-color:var(--forge-button-link-color, var(--_button-primary-color));--_button-link-text-decoration:var(--forge-button-link-text-decoration, underline);--_button-link-height:var(--forge-button-link-height, auto);--_button-link-padding:var(--forge-button-link-padding, 0);--_button-link-line-height:var(--forge-button-link-line-height, normal);--_button-link-width:var(--forge-button-link-width, auto);--_button-link-hover-text-decoration:var(--forge-button-link-hover-text-decoration, none);--_button-link-active-opacity:var(--forge-button-link-active-opacity, 0.65);--_button-link-transition-duration:var(--forge-button-link-transition-duration, var(--forge-animation-duration-short3, 150ms));--_button-link-transition-timing:var(--forge-button-link-transition-timing, var(--forge-animation-easing-standard, cubic-bezier(0.2, 0, 0, 1)));--_button-disabled-cursor:var(--forge-button-disabled-cursor, not-allowed);--_button-disabled-text-color:var(--forge-button-disabled-text-color, var(--forge-theme-text-low, rgba(0, 0, 0, 0.38)));--_button-disabled-background:var(--forge-button-disabled-background, transparent);--_button-disabled-border-color:var(--forge-button-disabled-border-color, var(--_button-disabled-color));--_button-disabled-shadow:var(--forge-button-disabled-shadow, none);--_button-dense-height:var(--forge-button-dense-height, 24px);--_button-pill-shape:var(--forge-button-pill-shape, calc(var(--forge-shape-full, 9999px) * var(--forge-shape-factor, 1)));--_button-pill-padding-inline:var(--forge-button-pill-padding-inline, var(--forge-spacing-small, 12px));--_button-focus-indicator-offset:var(--forge-button-focus-indicator-offset, 4px);--_button-text-focus-indicator-offset:var(--forge-button-text-focus-indicator-offset, 0px);--_button-link-focus-indicator-offset:var(--forge-button-link-focus-indicator-offset, 2px);--_button-popover-icon-transition-duration:var(--forge-button-popover-icon-transition-duration, var(--forge-animation-duration-short3, 150ms));--_button-popover-icon-transition-timing:var(--forge-button-popover-icon-transition-timing, var(--forge-animation-easing-standard, cubic-bezier(0.2, 0, 0, 1)));--_button-popover-icon-open-rotation:var(--forge-button-popover-icon-open-rotation, 180deg)}:host{display:var(--_button-display);position:relative;outline:0;vertical-align:middle;-webkit-tap-highlight-color:transparent;border-radius:var(--_button-shape)}:host([hidden]){display:none}::slotted(:is(button,a)){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--forge-typography-button-font-family, var(--forge-typography-font-family, \"Roboto\", sans-serif));font-size:var(--forge-typography-button-font-size, calc(var(--forge-typography-font-size, 1rem) * var(--forge-typography-button-font-size-scale, .875)));font-weight:var(--forge-typography-button-font-weight,500);line-height:var(--forge-typography-button-line-height, normal);letter-spacing:var(--forge-typography-button-letter-spacing, .0714285714em);text-transform:var(--forge-typography-button-text-transform,inherit);text-decoration:var(--forge-typography-button-text-decoration,inherit);position:relative;display:var(--_button-display);align-items:center;justify-content:var(--_button-justify);gap:var(--_button-spacing);z-index:0;box-sizing:border-box;min-inline-size:var(--_button-min-width);height:var(--_button-height);inline-size:100%;border-width:var(--_button-border-width);border-style:var(--_button-border-style);border-color:var(--_button-border-color);border-start-start-radius:var(--_button-shape-start-start-radius);border-start-end-radius:var(--_button-shape-start-end-radius);border-end-start-radius:var(--_button-shape-end-start-radius);border-end-end-radius:var(--_button-shape-end-end-radius);padding-block:var(--_button-padding-block);padding-inline:var(--_button-padding-inline);box-shadow:var(--_button-shadow);outline:0;user-select:none;-webkit-appearance:none;vertical-align:middle;text-decoration:none;white-space:nowrap;background:var(--_button-background);color:var(--_button-color);cursor:var(--_button-cursor);transition-property:box-shadow,background;transition-duration:var(--_button-transition-duration);transition-timing-function:var(--_button-transition-timing);--forge-icon-font-size:1.25em}::slotted(:is(button,a))::-moz-focus-inner{padding:0;border:0}::slotted(:is(button,a)):hover{--_button-shadow:var(--_button-hover-shadow);background:var(--_button-hover-background)}::slotted(:is(button,a)):active{--_button-shadow:var(--_button-active-shadow);background:var(--_button-active-background)}::slotted(a){text-decoration:none;--forge-typography-link-text-decoration:none}forge-state-layer{--forge-state-layer-color:var(--_button-color)}forge-focus-indicator{--forge-focus-indicator-color:var(--_button-primary-color);--forge-focus-indicator-outward-offset:var(--_button-focus-indicator-offset)}:host(:is([type*=unelevated],[type*=raised])) ::slotted(:is(button,a)){--_button-background:var(--_button-filled-background);--_button-color:var(--_button-filled-color)}:host(:is([type*=unelevated],[type*=raised])) forge-state-layer{--forge-state-layer-color:var(--_button-filled-color)}:host([type*=raised]) ::slotted(:is(button,a)){--_button-background:var(--_button-raised-background);--_button-color:var(--_button-raised-color);--_button-shadow:var(--_button-raised-shadow)}:host([type*=raised]) ::slotted(:is(button,a)):hover{--_button-shadow:var(--_button-raised-hover-shadow)}:host([type*=raised]) ::slotted(:is(button,a)):active{--_button-shadow:var(--_button-raised-active-shadow)}:host([type*=outlined]) ::slotted(:is(button,a)){--_button-background:var(--_button-outlined-background);--_button-color:var(--_button-outlined-color);--_button-border-width:var(--_button-outlined-border-width);--_button-border-style:var(--_button-outlined-border-style);--_button-border-color:var(--_button-outlined-border-color)}:host([full-width]){width:100%}:host(:is([dense],[type*=dense])) ::slotted(:is(button,a)){--_button-height:var(--_button-dense-height)}:host([disabled]){cursor:var(--_button-disabled-cursor)}:host([disabled]) ::slotted(button[disabled]){--_button-background:var(--_button-disabled-background);--_button-color:var(--_button-disabled-text-color);--_button-shadow:var(--_button-disabled-shadow);pointer-events:none}:host([type*=outlined][disabled]) ::slotted(button[disabled]){--_button-border-color:var(--_button-disabled-border-color)}:host(:is([type*=unelevated],[type*=raised])[disabled]) ::slotted(button[disabled]){--_button-background:var(--_button-filled-disabled-background);--_button-color:var(--_button-filled-disabled-color)}:host([type*=raised][disabled]) ::slotted(button[disabled]){--_button-background:var(--_button-raised-disabled-background);--_button-color:var(--_button-raised-disabled-color);--_button-shadow:var(--_button-raised-disabled-shadow)}';
|
|
13
|
+
const styles = ':host{--_button-primary-color:var(--forge-button-primary-color, var(--forge-theme-primary, #3f51b5));--_button-text-color:var(--forge-button-text-color, var(--_button-primary-color));--_button-disabled-color:var(--forge-button-disabled-color, var(--forge-theme-surface-container, #e0e0e0));--_button-padding:var(--forge-button-padding, var(--forge-spacing-medium, 16px));--_button-display:var(--forge-button-display, inline-grid);--_button-justify:var(--forge-button-justify, center);--_button-shape:var(--forge-button-shape, calc(var(--forge-shape-medium, 4px) * var(--forge-shape-factor, 1)));--_button-height:var(--forge-button-height, 36px);--_button-min-width:var(--forge-button-min-width, 64px);--_button-spacing:var(--forge-button-spacing, var(--forge-spacing-xsmall, 8px));--_button-border-width:var(--forge-button-border-width, medium);--_button-border-style:var(--forge-button-border-style, none);--_button-border-color:var(--forge-button-border-color, currentColor);--_button-shape-start-start-radius:var(--forge-button-shape-start-start-radius, var(--_button-shape));--_button-shape-start-end-radius:var(--forge-button-shape-start-end-radius, var(--_button-shape));--_button-shape-end-start-radius:var(--forge-button-shape-end-start-radius, var(--_button-shape));--_button-shape-end-end-radius:var(--forge-button-shape-end-end-radius, var(--_button-shape));--_button-padding-block:var(--forge-button-padding-block, var(--_button-0));--_button-padding-inline:var(--forge-button-padding-inline, var(--_button-padding));--_button-background:var(--forge-button-background, transparent);--_button-hover-background:var(--forge-button-hover-background, var(--_button-background));--_button-active-background:var(--forge-button-active-background, var(--_button-background));--_button-color:var(--forge-button-color, var(--_button-text-color));--_button-icon-size:var(--forge-button-icon-size, calc(var(--forge-typography-font-size, 1rem) * 1.125));--_button-shadow:var(--forge-button-shadow, none);--_button-hover-shadow:var(--forge-button-hover-shadow, none);--_button-active-shadow:var(--forge-button-active-shadow, none);--_button-cursor:var(--forge-button-cursor, pointer);--_button-transition-duration:var(--forge-button-transition-duration, var(--forge-animation-duration-short3, 150ms));--_button-transition-timing:var(--forge-button-transition-timing, var(--forge-animation-easing-standard, cubic-bezier(0.2, 0, 0, 1)));--_button-text-padding-inline:var(--forge-button-text-padding-inline, var(--forge-spacing-xsmall, 8px));--_button-outlined-background:var(--forge-button-outlined-background, transparent);--_button-outlined-color:var(--forge-button-outlined-color, var(--_button-primary-color));--_button-outlined-border-width:var(--forge-button-outlined-border-width, var(--forge-border-thin, 1px));--_button-outlined-border-style:var(--forge-button-outlined-border-style, solid);--_button-outlined-border-color:var(--forge-button-outlined-border-color, var(--_button-primary-color));--_button-tonal-background:var(--forge-button-tonal-background, var(--forge-theme-primary-container, #d1d5ed));--_button-tonal-disabled-background:var(--forge-button-tonal-disabled-background, var(--_button-disabled-color));--_button-tonal-color:var(--forge-button-tonal-color, var(--forge-theme-on-primary-container, #222c62));--_button-tonal-disabled-color:var(--forge-button-tonal-disabled-color, var(--_button-disabled-text-color));--_button-filled-background:var(--forge-button-filled-background, var(--_button-primary-color));--_button-filled-disabled-background:var(--forge-button-filled-disabled-background, var(--_button-disabled-color));--_button-filled-color:var(--forge-button-filled-color, var(--forge-theme-on-primary, #ffffff));--_button-filled-disabled-color:var(--forge-button-filled-disabled-color, var(--_button-disabled-text-color));--_button-raised-background:var(--forge-button-raised-background, var(--_button-primary-color));--_button-raised-disabled-background:var(--forge-button-raised-disabled-background, var(--_button-disabled-color));--_button-raised-color:var(--forge-button-raised-color, var(--forge-theme-on-primary, #ffffff));--_button-raised-disabled-color:var(--forge-button-raised-disabled-color, var(--_button-disabled-text-color));--_button-raised-shadow:var(--forge-button-raised-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12));--_button-raised-hover-shadow:var(--forge-button-raised-hover-shadow, 0px 2px 4px -1px rgba(0, 0, 0, 0.2), 0px 4px 5px 0px rgba(0, 0, 0, 0.14), 0px 1px 10px 0px rgba(0, 0, 0, 0.12));--_button-raised-active-shadow:var(--forge-button-raised-active-shadow, 0px 5px 5px -3px rgba(0, 0, 0, 0.2), 0px 8px 10px 1px rgba(0, 0, 0, 0.14), 0px 3px 14px 2px rgba(0, 0, 0, 0.12));--_button-raised-disabled-shadow:var(--forge-button-raised-disabled-shadow, none);--_button-link-color:var(--forge-button-link-color, var(--_button-primary-color));--_button-link-text-decoration:var(--forge-button-link-text-decoration, underline);--_button-link-height:var(--forge-button-link-height, auto);--_button-link-padding:var(--forge-button-link-padding, 0);--_button-link-line-height:var(--forge-button-link-line-height, normal);--_button-link-width:var(--forge-button-link-width, auto);--_button-link-hover-text-decoration:var(--forge-button-link-hover-text-decoration, none);--_button-link-active-opacity:var(--forge-button-link-active-opacity, 0.65);--_button-link-transition-duration:var(--forge-button-link-transition-duration, var(--forge-animation-duration-short3, 150ms));--_button-link-transition-timing:var(--forge-button-link-transition-timing, var(--forge-animation-easing-standard, cubic-bezier(0.2, 0, 0, 1)));--_button-disabled-cursor:var(--forge-button-disabled-cursor, not-allowed);--_button-disabled-text-color:var(--forge-button-disabled-text-color, var(--forge-theme-text-low, rgba(0, 0, 0, 0.38)));--_button-disabled-background:var(--forge-button-disabled-background, transparent);--_button-disabled-border-color:var(--forge-button-disabled-border-color, var(--_button-disabled-color));--_button-disabled-shadow:var(--forge-button-disabled-shadow, none);--_button-dense-height:var(--forge-button-dense-height, 24px);--_button-pill-shape:var(--forge-button-pill-shape, calc(var(--forge-shape-full, 9999px) * var(--forge-shape-factor, 1)));--_button-pill-padding-inline:var(--forge-button-pill-padding-inline, var(--forge-spacing-small, 12px));--_button-focus-indicator-offset:var(--forge-button-focus-indicator-offset, 4px);--_button-text-focus-indicator-offset:var(--forge-button-text-focus-indicator-offset, 0px);--_button-link-focus-indicator-offset:var(--forge-button-link-focus-indicator-offset, 2px);--_button-popover-icon-transition-duration:var(--forge-button-popover-icon-transition-duration, var(--forge-animation-duration-short3, 150ms));--_button-popover-icon-transition-timing:var(--forge-button-popover-icon-transition-timing, var(--forge-animation-easing-standard, cubic-bezier(0.2, 0, 0, 1)));--_button-popover-icon-open-rotation:var(--forge-button-popover-icon-open-rotation, 180deg)}:host{display:var(--_button-display);position:relative;outline:0;vertical-align:middle;-webkit-tap-highlight-color:transparent;border-radius:var(--_button-shape)}:host([hidden]){display:none}::slotted(:is(button,a)){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--forge-typography-button-font-family, var(--forge-typography-font-family, \"Roboto\", sans-serif));font-size:var(--forge-typography-button-font-size, calc(var(--forge-typography-font-size, 1rem) * var(--forge-typography-button-font-size-scale, .875)));font-weight:var(--forge-typography-button-font-weight,500);line-height:var(--forge-typography-button-line-height, normal);letter-spacing:var(--forge-typography-button-letter-spacing, .0714285714em);text-transform:var(--forge-typography-button-text-transform,inherit);text-decoration:var(--forge-typography-button-text-decoration,inherit);position:relative;display:var(--_button-display);grid-auto-flow:column;align-items:center;justify-content:var(--_button-justify);gap:var(--_button-spacing);z-index:0;box-sizing:border-box;min-inline-size:var(--_button-min-width);height:var(--_button-height);inline-size:100%;border-width:var(--_button-border-width);border-style:var(--_button-border-style);border-color:var(--_button-border-color);border-start-start-radius:var(--_button-shape-start-start-radius);border-start-end-radius:var(--_button-shape-start-end-radius);border-end-start-radius:var(--_button-shape-end-start-radius);border-end-end-radius:var(--_button-shape-end-end-radius);padding-block:var(--_button-padding-block);padding-inline:var(--_button-padding-inline);box-shadow:var(--_button-shadow);outline:0;user-select:none;-webkit-appearance:none;vertical-align:middle;text-decoration:none;white-space:nowrap;background:var(--_button-background);color:var(--_button-color);cursor:var(--_button-cursor);transition-property:box-shadow,background;transition-duration:var(--_button-transition-duration);transition-timing-function:var(--_button-transition-timing);--forge-icon-font-size:1.25em}::slotted(:is(button,a))::-moz-focus-inner{padding:0;border:0}::slotted(:is(button,a)):hover{--_button-shadow:var(--_button-hover-shadow);background:var(--_button-hover-background)}::slotted(:is(button,a)):active{--_button-shadow:var(--_button-active-shadow);background:var(--_button-active-background)}::slotted(a){text-decoration:none;--forge-typography-link-text-decoration:none}forge-state-layer{--forge-state-layer-color:var(--_button-color)}forge-focus-indicator{--forge-focus-indicator-color:var(--_button-primary-color);--forge-focus-indicator-outward-offset:var(--_button-focus-indicator-offset)}:host(:is([type*=unelevated],[type*=raised])) ::slotted(:is(button,a)){--_button-background:var(--_button-filled-background);--_button-color:var(--_button-filled-color)}:host(:is([type*=unelevated],[type*=raised])) forge-state-layer{--forge-state-layer-color:var(--_button-filled-color)}:host([type*=raised]) ::slotted(:is(button,a)){--_button-background:var(--_button-raised-background);--_button-color:var(--_button-raised-color);--_button-shadow:var(--_button-raised-shadow)}:host([type*=raised]) ::slotted(:is(button,a)):hover{--_button-shadow:var(--_button-raised-hover-shadow)}:host([type*=raised]) ::slotted(:is(button,a)):active{--_button-shadow:var(--_button-raised-active-shadow)}:host([type*=outlined]) ::slotted(:is(button,a)){--_button-background:var(--_button-outlined-background);--_button-color:var(--_button-outlined-color);--_button-border-width:var(--_button-outlined-border-width);--_button-border-style:var(--_button-outlined-border-style);--_button-border-color:var(--_button-outlined-border-color)}:host([full-width]){width:100%}:host(:is([dense],[type*=dense])) ::slotted(:is(button,a)){--_button-height:var(--_button-dense-height)}:host([disabled]){cursor:var(--_button-disabled-cursor)}:host([disabled]) ::slotted(button[disabled]){--_button-background:var(--_button-disabled-background);--_button-color:var(--_button-disabled-text-color);--_button-shadow:var(--_button-disabled-shadow);pointer-events:none}:host([type*=outlined][disabled]) ::slotted(button[disabled]){--_button-border-color:var(--_button-disabled-border-color)}:host(:is([type*=unelevated],[type*=raised])[disabled]) ::slotted(button[disabled]){--_button-background:var(--_button-filled-disabled-background);--_button-color:var(--_button-filled-disabled-color)}:host([type*=raised][disabled]) ::slotted(button[disabled]){--_button-background:var(--_button-raised-disabled-background);--_button-color:var(--_button-raised-disabled-color);--_button-shadow:var(--_button-raised-disabled-shadow)}';
|
|
14
14
|
/**
|
|
15
15
|
* @tag forge-deprecated-button
|
|
16
16
|
*
|
|
@@ -73,7 +73,7 @@ export class DialogCore {
|
|
|
73
73
|
this._adapter.addDialogFormSubmitListener(this._dialogFormSubmitListener);
|
|
74
74
|
DismissibleStack.instance.add(this._adapter.hostElement);
|
|
75
75
|
if (this._mode === 'modal' || this._mode === 'inline-modal') {
|
|
76
|
-
this._adapter.addDocumentListener('keydown', this._escapeDismissListener);
|
|
76
|
+
this._adapter.addDocumentListener('keydown', this._escapeDismissListener, { capture: true });
|
|
77
77
|
}
|
|
78
78
|
if (!this._persistent) {
|
|
79
79
|
this._adapter.addBackdropDismissListener(this._backdropDismissListener);
|
|
@@ -99,7 +99,7 @@ export class DialogCore {
|
|
|
99
99
|
}
|
|
100
100
|
_release() {
|
|
101
101
|
this._adapter.removeDialogFormSubmitListener(this._dialogFormSubmitListener);
|
|
102
|
-
this._adapter.removeDocumentListener('keydown', this._escapeDismissListener);
|
|
102
|
+
this._adapter.removeDocumentListener('keydown', this._escapeDismissListener, { capture: true });
|
|
103
103
|
this._adapter.removeBackdropDismissListener(this._backdropDismissListener);
|
|
104
104
|
DismissibleStack.instance.remove(this._adapter.hostElement);
|
|
105
105
|
}
|
package/esm/dialog/dialog.d.ts
CHANGED
|
@@ -25,6 +25,8 @@ export interface IDialogProperties {
|
|
|
25
25
|
moveable: boolean;
|
|
26
26
|
label: string;
|
|
27
27
|
description: string;
|
|
28
|
+
[showBackdrop](): void;
|
|
29
|
+
[hideBackdrop](): void;
|
|
28
30
|
}
|
|
29
31
|
export interface IDialogComponent extends IDialogProperties, IWithDefaultAria, IWithElementInternals, IDismissible {
|
|
30
32
|
show(): void;
|