@tylertech/forge 3.5.1 → 3.6.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 +1171 -1128
- package/dist/checkbox/forge-checkbox.css +1 -0
- package/dist/lib.js +27 -19
- package/dist/lib.js.map +4 -4
- package/dist/radio/forge-radio.css +2 -0
- package/dist/switch/forge-switch.css +2 -0
- package/dist/vscode.css-custom-data.json +15 -0
- package/dist/vscode.html-custom-data.json +81 -106
- package/esm/app-bar/profile-button/app-bar-profile-button.js +5 -2
- package/esm/avatar/avatar-constants.d.ts +0 -7
- package/esm/avatar/avatar-constants.js +1 -10
- package/esm/avatar/avatar.d.ts +24 -21
- package/esm/avatar/avatar.js +68 -45
- package/esm/avatar/index.d.ts +1 -3
- package/esm/avatar/index.js +4 -6
- package/esm/button/base/base-button-adapter.js +1 -1
- package/esm/button-area/button-area.js +1 -1
- package/esm/checkbox/checkbox.d.ts +1 -0
- package/esm/checkbox/checkbox.js +2 -1
- package/esm/dialog/dialog-adapter.d.ts +7 -0
- package/esm/dialog/dialog-adapter.js +43 -19
- package/esm/dialog/dialog-constants.d.ts +6 -0
- package/esm/dialog/dialog-constants.js +6 -2
- package/esm/dialog/dialog-core.d.ts +8 -0
- package/esm/dialog/dialog-core.js +20 -0
- package/esm/dialog/dialog.d.ts +14 -0
- package/esm/dialog/dialog.js +13 -1
- package/esm/icon-button/icon-button-constants.d.ts +4 -0
- package/esm/icon-button/icon-button-constants.js +2 -0
- package/esm/icon-button/icon-button-core.d.ts +4 -4
- package/esm/icon-button/icon-button-core.js +16 -14
- package/esm/icon-button/icon-button.d.ts +32 -29
- package/esm/icon-button/icon-button.js +5 -30
- package/esm/profile-card/profile-card.js +5 -2
- package/esm/radio/radio/radio.d.ts +1 -0
- package/esm/radio/radio/radio.js +2 -1
- package/esm/split-view/split-view/split-view-adapter.js +1 -0
- package/esm/split-view/split-view-panel/split-view-panel.js +1 -1
- package/esm/switch/switch.d.ts +1 -0
- package/esm/switch/switch.js +2 -1
- package/esm/table/table-utils.js +6 -6
- package/esm/tabs/tab-bar/tab-bar-adapter.d.ts +0 -5
- package/esm/tabs/tab-bar/tab-bar-adapter.js +3 -11
- package/esm/tabs/tab-bar/tab-bar-constants.d.ts +0 -3
- package/esm/tabs/tab-bar/tab-bar-constants.js +0 -4
- package/esm/tabs/tab-bar/tab-bar-core.js +7 -7
- package/esm/tabs/tab-bar/tab-bar.d.ts +6 -3
- package/esm/tabs/tab-bar/tab-bar.js +6 -3
- package/package.json +2 -2
- package/sass/button-area/_core.scss +3 -0
- package/sass/checkbox/_core.scss +2 -2
- package/sass/core/styles/tokens/checkbox/_tokens.scss +1 -0
- package/sass/core/styles/tokens/radio/_tokens.scss +1 -0
- package/sass/core/styles/tokens/switch/_tokens.scss +1 -0
- package/sass/dialog/dialog.scss +5 -0
- package/sass/radio/radio/_core.scss +2 -2
- package/sass/switch/_core.scss +2 -2
- package/esm/avatar/avatar-adapter.d.ts +0 -36
- package/esm/avatar/avatar-adapter.js +0 -55
- package/esm/avatar/avatar-core.d.ts +0 -38
- package/esm/avatar/avatar-core.js +0 -101
|
@@ -7,6 +7,8 @@ import { COMPONENT_NAME_PREFIX } from '../constants';
|
|
|
7
7
|
const elementName = `${COMPONENT_NAME_PREFIX}icon-button`;
|
|
8
8
|
const observedAttributes = {
|
|
9
9
|
TOGGLE: 'toggle',
|
|
10
|
+
PRESSED: 'pressed',
|
|
11
|
+
/** @deprecated use `PRESSED` instead. */
|
|
10
12
|
ON: 'on',
|
|
11
13
|
VARIANT: 'variant',
|
|
12
14
|
THEME: 'theme',
|
|
@@ -8,7 +8,7 @@ import { IIconButtonAdapter } from './icon-button-adapter';
|
|
|
8
8
|
import { IconButtonDensity, IconButtonShape, IconButtonTheme, IconButtonVariant } from './icon-button-constants';
|
|
9
9
|
export interface IIconButtonCore extends IBaseButtonCore {
|
|
10
10
|
toggle: boolean;
|
|
11
|
-
|
|
11
|
+
pressed: boolean;
|
|
12
12
|
variant: IconButtonVariant;
|
|
13
13
|
theme: IconButtonTheme;
|
|
14
14
|
shape: IconButtonShape;
|
|
@@ -16,7 +16,7 @@ export interface IIconButtonCore extends IBaseButtonCore {
|
|
|
16
16
|
}
|
|
17
17
|
export declare class IconButtonCore extends BaseButtonCore<IIconButtonAdapter> implements IIconButtonCore {
|
|
18
18
|
private _toggle;
|
|
19
|
-
private
|
|
19
|
+
private _pressed;
|
|
20
20
|
private _variant;
|
|
21
21
|
private _theme;
|
|
22
22
|
private _shape;
|
|
@@ -27,8 +27,8 @@ export declare class IconButtonCore extends BaseButtonCore<IIconButtonAdapter> i
|
|
|
27
27
|
private _onToggle;
|
|
28
28
|
get toggle(): boolean;
|
|
29
29
|
set toggle(value: boolean);
|
|
30
|
-
get
|
|
31
|
-
set
|
|
30
|
+
get pressed(): boolean;
|
|
31
|
+
set pressed(value: boolean);
|
|
32
32
|
get variant(): IconButtonVariant;
|
|
33
33
|
set variant(value: IconButtonVariant);
|
|
34
34
|
get theme(): IconButtonTheme;
|
|
@@ -9,7 +9,7 @@ export class IconButtonCore extends BaseButtonCore {
|
|
|
9
9
|
constructor(adapter) {
|
|
10
10
|
super(adapter);
|
|
11
11
|
this._toggle = false;
|
|
12
|
-
this.
|
|
12
|
+
this._pressed = false;
|
|
13
13
|
this._variant = ICON_BUTTON_CONSTANTS.defaults.DEFAULT_VARIANT;
|
|
14
14
|
this._theme = ICON_BUTTON_CONSTANTS.defaults.DEFAULT_THEME;
|
|
15
15
|
this._shape = ICON_BUTTON_CONSTANTS.defaults.DEFAULT_SHAPE;
|
|
@@ -27,14 +27,14 @@ export class IconButtonCore extends BaseButtonCore {
|
|
|
27
27
|
}
|
|
28
28
|
_onToggle() {
|
|
29
29
|
// Update internal state first so listeners can access the new state
|
|
30
|
-
const
|
|
31
|
-
this.
|
|
32
|
-
const cancelled = !this._adapter.emitHostEvent(ICON_BUTTON_CONSTANTS.events.TOGGLE, this.
|
|
33
|
-
this.
|
|
30
|
+
const originalPressed = this._pressed;
|
|
31
|
+
this._pressed = !this._pressed;
|
|
32
|
+
const cancelled = !this._adapter.emitHostEvent(ICON_BUTTON_CONSTANTS.events.TOGGLE, this.pressed, true, true);
|
|
33
|
+
this._pressed = originalPressed;
|
|
34
34
|
if (cancelled) {
|
|
35
35
|
return;
|
|
36
36
|
}
|
|
37
|
-
this.
|
|
37
|
+
this.pressed = !originalPressed;
|
|
38
38
|
}
|
|
39
39
|
get toggle() {
|
|
40
40
|
return this._toggle;
|
|
@@ -43,24 +43,26 @@ export class IconButtonCore extends BaseButtonCore {
|
|
|
43
43
|
value = !!value;
|
|
44
44
|
if (this._toggle !== value) {
|
|
45
45
|
this._toggle = value;
|
|
46
|
-
this._adapter.toggleHostAttribute(ICON_BUTTON_CONSTANTS.attributes.ARIA_PRESSED, this._toggle, `${this.
|
|
46
|
+
this._adapter.toggleHostAttribute(ICON_BUTTON_CONSTANTS.attributes.ARIA_PRESSED, this._toggle, `${this._pressed}`);
|
|
47
47
|
this._adapter.toggleHostAttribute(ICON_BUTTON_CONSTANTS.attributes.TOGGLE, this._toggle);
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
get
|
|
51
|
-
return this.
|
|
50
|
+
get pressed() {
|
|
51
|
+
return this._pressed;
|
|
52
52
|
}
|
|
53
|
-
set
|
|
53
|
+
set pressed(value) {
|
|
54
54
|
value = !!value;
|
|
55
|
-
if (this.
|
|
56
|
-
this.
|
|
55
|
+
if (this._pressed !== value) {
|
|
56
|
+
this._pressed = value;
|
|
57
57
|
if (this._toggle) {
|
|
58
|
-
this._adapter.setHostAttribute(ICON_BUTTON_CONSTANTS.attributes.ARIA_PRESSED, `${this.
|
|
58
|
+
this._adapter.setHostAttribute(ICON_BUTTON_CONSTANTS.attributes.ARIA_PRESSED, `${this._pressed}`);
|
|
59
59
|
}
|
|
60
60
|
else {
|
|
61
61
|
this._adapter.removeHostAttribute(ICON_BUTTON_CONSTANTS.attributes.ARIA_PRESSED);
|
|
62
62
|
}
|
|
63
|
-
this._adapter.toggleHostAttribute(ICON_BUTTON_CONSTANTS.attributes.
|
|
63
|
+
this._adapter.toggleHostAttribute(ICON_BUTTON_CONSTANTS.attributes.PRESSED, this._pressed);
|
|
64
|
+
// Deprecated but left for legacy support
|
|
65
|
+
this._adapter.toggleHostAttribute(ICON_BUTTON_CONSTANTS.attributes.ON, this._pressed);
|
|
64
66
|
}
|
|
65
67
|
}
|
|
66
68
|
get variant() {
|
|
@@ -8,6 +8,8 @@ import { IconButtonDensity, IconButtonShape, IconButtonTheme, IconButtonVariant
|
|
|
8
8
|
import { IconButtonCore } from './icon-button-core';
|
|
9
9
|
export interface IIconButtonComponent extends IBaseButton {
|
|
10
10
|
toggle: boolean;
|
|
11
|
+
pressed: boolean;
|
|
12
|
+
/** @deprecated use `pressed` instead. */
|
|
11
13
|
on: boolean;
|
|
12
14
|
variant: IconButtonVariant;
|
|
13
15
|
theme: IconButtonTheme;
|
|
@@ -25,39 +27,10 @@ declare global {
|
|
|
25
27
|
/**
|
|
26
28
|
* @tag forge-icon-button
|
|
27
29
|
*
|
|
28
|
-
* @summary Icons buttons are used to trigger an action or event.
|
|
29
|
-
*
|
|
30
|
-
* @property {boolean} [toggle=false] - Whether or not the icon button can be toggled.
|
|
31
|
-
* @property {boolean} [on=false] - Whether or not the button is on. Only applies when `toggle` is `true`.
|
|
32
|
-
* @property {IconButtonVariant} [variant="icon"] - The variant of the button. Valid values are `text`, `outlined`, `filled`, and `raised`.
|
|
33
|
-
* @property {IconButtonTheme} [theme="default"] - The theme of the button. Valid values are `default`, `primary`, `secondary`, `tertiary`, `success`, `error`, `warning`, `info`.
|
|
34
|
-
* @property {string} [shape="circular"] - The shape of the button. Valid values are `circular` and `squared`.
|
|
35
|
-
* @property {IconButtonDensity} [density="large"] - The density of the button. Valid values are `small`, `medium`, and `large`.
|
|
36
|
-
* @property {string} [type="button"] - The type of button. Defaults to `button`. Valid values are `button`, `submit`, and `reset`.
|
|
37
|
-
* @property {boolean} [disabled=false] - Whether or not the button is disabled.
|
|
38
|
-
* @property {boolean} [popoverIcon=false] - Whether or not the button shows a built-in popover icon.
|
|
39
|
-
* @property {boolean} [dense=false] - Whether or not the button is dense.
|
|
40
|
-
* @property {string} name - The name of the button.
|
|
41
|
-
* @property {string} value - The form value of the button.
|
|
42
|
-
* @property {HTMLFormElement | null} form - The form reference of the button if within a `<form>` element.
|
|
43
|
-
*
|
|
44
30
|
* @globalconfig variant
|
|
45
31
|
* @globalconfig shape
|
|
46
32
|
* @globalconfig density
|
|
47
33
|
*
|
|
48
|
-
* @attribute {boolean} [toggle=false] - Whether or not the icon button can be toggled.
|
|
49
|
-
* @attribute {boolean} [on=false] - Whether or not the button is on. Only applies when `toggle` is `true`.
|
|
50
|
-
* @attribute {IconButtonVariant} [variant="icon"] - The variant of the button. Valid values are `text`, `outlined`, `filled`, and `raised`.
|
|
51
|
-
* @attribute {IconButtonTheme} [theme="default"] - The theme of the button. Valid values are `default`, `primary`, `secondary`, `tertiary`, `success`, `error`, `warning`, `info`.
|
|
52
|
-
* @attribute {string} [shape="circular"] - The shape of the button. Valid values are `circular` and `squared`.
|
|
53
|
-
* @attribute {IconButtonDensity} [density="large"] - The density of the button. Valid values are `small`, `medium`, and `large`.
|
|
54
|
-
* @attribute {string} [type="button"] - The type of button. Defaults to `button`. Valid values are `button`, `submit`, and `reset`.
|
|
55
|
-
* @attribute {boolean} [disabled=false] - Whether or not the button is disabled.
|
|
56
|
-
* @attribute {boolean} [popover-icon=false] - Whether or not the button shows a built-in popover icon.
|
|
57
|
-
* @attribute {boolean} [dense=false] - Whether or not the button is dense.
|
|
58
|
-
* @attribute {string} name - The name of the button.
|
|
59
|
-
* @attribute {string} value - The form value of the button.
|
|
60
|
-
*
|
|
61
34
|
* @event {PointerEvent} click - Fires when the button is clicked.
|
|
62
35
|
* @event {CustomEvent<boolean>} forge-icon-button-toggle - Fires when the icon button is toggled. Only applies in `toggle` mode.
|
|
63
36
|
*
|
|
@@ -136,10 +109,40 @@ export declare class IconButtonComponent extends BaseButton<IconButtonCore> impl
|
|
|
136
109
|
protected readonly _core: IconButtonCore;
|
|
137
110
|
constructor();
|
|
138
111
|
attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
|
|
112
|
+
/**
|
|
113
|
+
* Whether or not the icon button can be toggled.
|
|
114
|
+
* @default false
|
|
115
|
+
*/
|
|
139
116
|
toggle: boolean;
|
|
117
|
+
/**
|
|
118
|
+
* Whether or not the toggle button is pressed. Only applies when `toggle` is `true`.
|
|
119
|
+
* @default false
|
|
120
|
+
*/
|
|
121
|
+
pressed: boolean;
|
|
122
|
+
/**
|
|
123
|
+
* Alias for `pressed` _(deprecated)_. Whether or not the toggle button is pressed. Only applies when `toggle` is `true`.
|
|
124
|
+
* @default false
|
|
125
|
+
* @deprecated Use `pressed` instead.
|
|
126
|
+
*/
|
|
140
127
|
on: boolean;
|
|
128
|
+
/**
|
|
129
|
+
* The variant of the button. Valid values are `text`, `outlined`, `filled`, and `raised`.
|
|
130
|
+
* @default "default"
|
|
131
|
+
*/
|
|
141
132
|
theme: IconButtonTheme;
|
|
133
|
+
/**
|
|
134
|
+
* The variant of the button. Valid values are `text`, `outlined`, `filled`, and `raised`.
|
|
135
|
+
* @default "icon"
|
|
136
|
+
*/
|
|
142
137
|
variant: IconButtonVariant;
|
|
138
|
+
/**
|
|
139
|
+
* The shape of the button. Valid values are `circular` and `squared`.
|
|
140
|
+
* @default "circular"
|
|
141
|
+
*/
|
|
143
142
|
shape: IconButtonShape;
|
|
143
|
+
/**
|
|
144
|
+
* The density of the button. Valid values are `small`, `medium`, and `large`.
|
|
145
|
+
* @default "large"
|
|
146
|
+
*/
|
|
144
147
|
density: IconButtonDensity;
|
|
145
148
|
}
|
|
@@ -18,39 +18,10 @@ const styles = ':host{--_icon-button-display:var(--forge-icon-button-display, in
|
|
|
18
18
|
/**
|
|
19
19
|
* @tag forge-icon-button
|
|
20
20
|
*
|
|
21
|
-
* @summary Icons buttons are used to trigger an action or event.
|
|
22
|
-
*
|
|
23
|
-
* @property {boolean} [toggle=false] - Whether or not the icon button can be toggled.
|
|
24
|
-
* @property {boolean} [on=false] - Whether or not the button is on. Only applies when `toggle` is `true`.
|
|
25
|
-
* @property {IconButtonVariant} [variant="icon"] - The variant of the button. Valid values are `text`, `outlined`, `filled`, and `raised`.
|
|
26
|
-
* @property {IconButtonTheme} [theme="default"] - The theme of the button. Valid values are `default`, `primary`, `secondary`, `tertiary`, `success`, `error`, `warning`, `info`.
|
|
27
|
-
* @property {string} [shape="circular"] - The shape of the button. Valid values are `circular` and `squared`.
|
|
28
|
-
* @property {IconButtonDensity} [density="large"] - The density of the button. Valid values are `small`, `medium`, and `large`.
|
|
29
|
-
* @property {string} [type="button"] - The type of button. Defaults to `button`. Valid values are `button`, `submit`, and `reset`.
|
|
30
|
-
* @property {boolean} [disabled=false] - Whether or not the button is disabled.
|
|
31
|
-
* @property {boolean} [popoverIcon=false] - Whether or not the button shows a built-in popover icon.
|
|
32
|
-
* @property {boolean} [dense=false] - Whether or not the button is dense.
|
|
33
|
-
* @property {string} name - The name of the button.
|
|
34
|
-
* @property {string} value - The form value of the button.
|
|
35
|
-
* @property {HTMLFormElement | null} form - The form reference of the button if within a `<form>` element.
|
|
36
|
-
*
|
|
37
21
|
* @globalconfig variant
|
|
38
22
|
* @globalconfig shape
|
|
39
23
|
* @globalconfig density
|
|
40
24
|
*
|
|
41
|
-
* @attribute {boolean} [toggle=false] - Whether or not the icon button can be toggled.
|
|
42
|
-
* @attribute {boolean} [on=false] - Whether or not the button is on. Only applies when `toggle` is `true`.
|
|
43
|
-
* @attribute {IconButtonVariant} [variant="icon"] - The variant of the button. Valid values are `text`, `outlined`, `filled`, and `raised`.
|
|
44
|
-
* @attribute {IconButtonTheme} [theme="default"] - The theme of the button. Valid values are `default`, `primary`, `secondary`, `tertiary`, `success`, `error`, `warning`, `info`.
|
|
45
|
-
* @attribute {string} [shape="circular"] - The shape of the button. Valid values are `circular` and `squared`.
|
|
46
|
-
* @attribute {IconButtonDensity} [density="large"] - The density of the button. Valid values are `small`, `medium`, and `large`.
|
|
47
|
-
* @attribute {string} [type="button"] - The type of button. Defaults to `button`. Valid values are `button`, `submit`, and `reset`.
|
|
48
|
-
* @attribute {boolean} [disabled=false] - Whether or not the button is disabled.
|
|
49
|
-
* @attribute {boolean} [popover-icon=false] - Whether or not the button shows a built-in popover icon.
|
|
50
|
-
* @attribute {boolean} [dense=false] - Whether or not the button is dense.
|
|
51
|
-
* @attribute {string} name - The name of the button.
|
|
52
|
-
* @attribute {string} value - The form value of the button.
|
|
53
|
-
*
|
|
54
25
|
* @event {PointerEvent} click - Fires when the button is clicked.
|
|
55
26
|
* @event {CustomEvent<boolean>} forge-icon-button-toggle - Fires when the icon button is toggled. Only applies in `toggle` mode.
|
|
56
27
|
*
|
|
@@ -138,8 +109,9 @@ let IconButtonComponent = class IconButtonComponent extends BaseButton {
|
|
|
138
109
|
case ICON_BUTTON_CONSTANTS.attributes.TOGGLE:
|
|
139
110
|
this.toggle = coerceBoolean(newValue);
|
|
140
111
|
break;
|
|
112
|
+
case ICON_BUTTON_CONSTANTS.attributes.PRESSED:
|
|
141
113
|
case ICON_BUTTON_CONSTANTS.attributes.ON:
|
|
142
|
-
this.
|
|
114
|
+
this.pressed = coerceBoolean(newValue);
|
|
143
115
|
break;
|
|
144
116
|
case ICON_BUTTON_CONSTANTS.attributes.VARIANT:
|
|
145
117
|
this.variant = newValue;
|
|
@@ -162,6 +134,9 @@ __decorate([
|
|
|
162
134
|
], IconButtonComponent.prototype, "toggle", void 0);
|
|
163
135
|
__decorate([
|
|
164
136
|
coreProperty()
|
|
137
|
+
], IconButtonComponent.prototype, "pressed", void 0);
|
|
138
|
+
__decorate([
|
|
139
|
+
coreProperty({ name: 'pressed' })
|
|
165
140
|
], IconButtonComponent.prototype, "on", void 0);
|
|
166
141
|
__decorate([
|
|
167
142
|
coreProperty()
|
|
@@ -9,7 +9,7 @@ import { ProfileCardAdapter } from './profile-card-adapter';
|
|
|
9
9
|
import { ProfileCardCore } from './profile-card-core';
|
|
10
10
|
import { PROFILE_CARD_CONSTANTS } from './profile-card-constants';
|
|
11
11
|
import { ButtonComponent } from '../button';
|
|
12
|
-
import {
|
|
12
|
+
import { defineAvatarComponent } from '../avatar';
|
|
13
13
|
import { IconComponent } from '../icon/icon';
|
|
14
14
|
import { ToolbarComponent } from '../toolbar';
|
|
15
15
|
import { BaseComponent } from '../core/base/base-component';
|
|
@@ -79,6 +79,9 @@ let ProfileCardComponent = class ProfileCardComponent extends BaseComponent {
|
|
|
79
79
|
this._core.focus(options);
|
|
80
80
|
}
|
|
81
81
|
};
|
|
82
|
+
(() => {
|
|
83
|
+
defineAvatarComponent();
|
|
84
|
+
})();
|
|
82
85
|
__decorate([
|
|
83
86
|
coreProperty()
|
|
84
87
|
], ProfileCardComponent.prototype, "fullName", void 0);
|
|
@@ -112,7 +115,7 @@ __decorate([
|
|
|
112
115
|
ProfileCardComponent = __decorate([
|
|
113
116
|
customElement({
|
|
114
117
|
name: PROFILE_CARD_CONSTANTS.elementName,
|
|
115
|
-
dependencies: [ToolbarComponent, ButtonComponent, IconComponent
|
|
118
|
+
dependencies: [ToolbarComponent, ButtonComponent, IconComponent]
|
|
116
119
|
})
|
|
117
120
|
], ProfileCardComponent);
|
|
118
121
|
export { ProfileCardComponent };
|
|
@@ -48,6 +48,7 @@ declare const RadioComponent_base: import("../../constants").AbstractConstructor
|
|
|
48
48
|
* @cssproperty --forge-radio-mark-color - The color of the radio button's mark.
|
|
49
49
|
* @cssproperty --forge-radio-gap - The gap between the radio button and its label.
|
|
50
50
|
* @cssproperty --forge-radio-justify - The alignment of the radio button and its label in the inline direction.
|
|
51
|
+
* @cssproperty --forge-radio-align - The alignment of the radio button and its label in the block direction.
|
|
51
52
|
* @cssproperty --forge-radio-direction - The direction of the radio button and its label.
|
|
52
53
|
* @cssproperty --forge-radio-state-layer-size - The size of the radio button's state layer in the inline and block directions.
|
|
53
54
|
* @cssproperty --forge-radio-state-layer-width - The width of the radio button's state layer.
|
package/esm/radio/radio/radio.js
CHANGED
|
@@ -19,7 +19,7 @@ import { RadioAdapter } from './radio-adapter';
|
|
|
19
19
|
import { RADIO_CONSTANTS, tryCheck } from './radio-constants';
|
|
20
20
|
import { RadioCore } from './radio-core';
|
|
21
21
|
const template = '<template><div id=\"radio\" class=\"forge-radio\" part=\"root\"><div id=\"container\" class=\"container\" aria-hidden=\"true\"><div id=\"background\" class=\"background\" part=\"background\"></div><forge-focus-indicator target=\":host\" part=\"focus-indicator\"></forge-focus-indicator><forge-state-layer exportparts=\"surface:state-layer\"></forge-state-layer></div><span id=\"label\" class=\"label\" for=\"input\" part=\"label\"><slot></slot></span></div></template>';
|
|
22
|
-
const styles = ':host{display:inline-block;-webkit-tap-highlight-color:transparent}:host([hidden]){display:none}:host(:focus){outline:0}.forge-radio{--_radio-primary-color:var(--forge-radio-primary-color, var(--forge-theme-tertiary, #3d5afe));--_radio-inactive-color:var(--forge-radio-inactive-color, var(--forge-theme-surface-container-high, #9e9e9e));--_radio-size:var(--forge-radio-size, 20px);--_radio-mark-size:var(--forge-radio-mark-size, 75%);--_radio-state-layer-size:var(--forge-radio-state-layer-size, 40px);--_radio-state-layer-dense-size:var(--forge-radio-state-layer-dense-size, 24px);--_radio-width:var(--forge-radio-width, var(--_radio-size));--_radio-height:var(--forge-radio-height, var(--_radio-size));--_radio-border-width:var(--forge-radio-border-width, var(--forge-border-medium, 2px));--_radio-unchecked-border-color:var(--forge-radio-unchecked-border-color, var(--_radio-inactive-color));--_radio-checked-border-color:var(--forge-radio-checked-border-color, var(--_radio-primary-color));--_radio-background:var(--forge-radio-background, transparent);--_radio-shape:var(--forge-radio-shape, calc(var(--forge-shape-round, 50%) * var(--forge-shape-factor, 1)));--_radio-mark-width:var(--forge-radio-mark-width, var(--_radio-mark-size));--_radio-mark-height:var(--forge-radio-mark-height, var(--_radio-mark-size));--_radio-mark-color:var(--forge-radio-mark-color, var(--_radio-primary-color));--_radio-gap:var(--forge-radio-gap, 0);--_radio-justify:var(--forge-radio-justify, start);--_radio-direction:var(--forge-radio-direction, initial);--_radio-state-layer-width:var(--forge-radio-state-layer-width, var(--_radio-state-layer-size));--_radio-state-layer-height:var(--forge-radio-state-layer-height, var(--_radio-state-layer-size));--_radio-state-layer-unchecked-color:var(--forge-radio-state-layer-unchecked-color, var(--_radio-color));--_radio-state-layer-checked-color:var(--forge-radio-state-layer-checked-color, var(--_radio-primary-color));--_radio-state-layer-shape:var(--forge-radio-state-layer-shape, var(--_radio-shape));--_radio-state-layer-dense-width:var(--forge-radio-state-layer-dense-width, var(--_radio-state-layer-dense-size));--_radio-state-layer-dense-height:var(--forge-radio-state-layer-dense-height, var(--_radio-state-layer-dense-size));--_radio-disabled-opacity:var(--forge-radio-disabled-opacity, 0.38);--_radio-animation-duration:var(--forge-radio-animation-duration, var(--forge-animation-duration-short4, 200ms));--_radio-animation-timing-function:var(--forge-radio-animation-timing-function, var(--forge-animation-easing-decelerate, cubic-bezier(0, 0, 0, 1)));--_radio-animation-delay:var(--forge-radio-animation-delay, 0ms)}.forge-radio{position:relative;flex-direction:var(--_radio-direction);
|
|
22
|
+
const styles = ':host{display:inline-block;-webkit-tap-highlight-color:transparent}:host([hidden]){display:none}:host(:focus){outline:0}.forge-radio{--_radio-primary-color:var(--forge-radio-primary-color, var(--forge-theme-tertiary, #3d5afe));--_radio-inactive-color:var(--forge-radio-inactive-color, var(--forge-theme-surface-container-high, #9e9e9e));--_radio-size:var(--forge-radio-size, 20px);--_radio-mark-size:var(--forge-radio-mark-size, 75%);--_radio-state-layer-size:var(--forge-radio-state-layer-size, 40px);--_radio-state-layer-dense-size:var(--forge-radio-state-layer-dense-size, 24px);--_radio-width:var(--forge-radio-width, var(--_radio-size));--_radio-height:var(--forge-radio-height, var(--_radio-size));--_radio-border-width:var(--forge-radio-border-width, var(--forge-border-medium, 2px));--_radio-unchecked-border-color:var(--forge-radio-unchecked-border-color, var(--_radio-inactive-color));--_radio-checked-border-color:var(--forge-radio-checked-border-color, var(--_radio-primary-color));--_radio-background:var(--forge-radio-background, transparent);--_radio-shape:var(--forge-radio-shape, calc(var(--forge-shape-round, 50%) * var(--forge-shape-factor, 1)));--_radio-mark-width:var(--forge-radio-mark-width, var(--_radio-mark-size));--_radio-mark-height:var(--forge-radio-mark-height, var(--_radio-mark-size));--_radio-mark-color:var(--forge-radio-mark-color, var(--_radio-primary-color));--_radio-gap:var(--forge-radio-gap, 0);--_radio-justify:var(--forge-radio-justify, start);--_radio-align:var(--forge-radio-align, center);--_radio-direction:var(--forge-radio-direction, initial);--_radio-state-layer-width:var(--forge-radio-state-layer-width, var(--_radio-state-layer-size));--_radio-state-layer-height:var(--forge-radio-state-layer-height, var(--_radio-state-layer-size));--_radio-state-layer-unchecked-color:var(--forge-radio-state-layer-unchecked-color, var(--_radio-color));--_radio-state-layer-checked-color:var(--forge-radio-state-layer-checked-color, var(--_radio-primary-color));--_radio-state-layer-shape:var(--forge-radio-state-layer-shape, var(--_radio-shape));--_radio-state-layer-dense-width:var(--forge-radio-state-layer-dense-width, var(--_radio-state-layer-dense-size));--_radio-state-layer-dense-height:var(--forge-radio-state-layer-dense-height, var(--_radio-state-layer-dense-size));--_radio-disabled-opacity:var(--forge-radio-disabled-opacity, 0.38);--_radio-animation-duration:var(--forge-radio-animation-duration, var(--forge-animation-duration-short4, 200ms));--_radio-animation-timing-function:var(--forge-radio-animation-timing-function, var(--forge-animation-easing-decelerate, cubic-bezier(0, 0, 0, 1)));--_radio-animation-delay:var(--forge-radio-animation-delay, 0ms)}.forge-radio{position:relative;flex-direction:var(--_radio-direction);align-items:var(--_radio-align);justify-content:var(--_radio-justify);gap:var(--_radio-gap);display:flex}.forge-radio .container{position:relative;align-items:center;justify-content:center;display:flex;flex-shrink:0;border-radius:var(--_radio-shape);inline-size:var(--_radio-state-layer-width);block-size:var(--_radio-state-layer-height);cursor:pointer}.forge-radio .background{position:relative;display:inline block;overflow:hidden;transition-duration:var(--_radio-animation-duration);transition-delay:var(--_radio-animation-delay);transition-timing-function:var(--_radio-animation-timing-function);transition-property:border-color;box-sizing:border-box;border-radius:var(--_radio-shape);border-width:var(--_radio-border-width);border-style:solid;border-color:var(--_radio-unchecked-border-color);inline-size:var(--_radio-width);block-size:var(--_radio-height);background:var(--_radio-background)}.forge-radio .background::after{content:\"\";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:top left;transition-duration:var(--_radio-animation-duration);transition-delay:var(--_radio-animation-delay);transition-timing-function:var(--_radio-animation-timing-function);transition-property:opacity,scale;border-radius:var(--_radio-shape);inline-size:var(--_radio-mark-width);block-size:var(--_radio-mark-height);background:var(--_radio-mark-color);scale:0.5;opacity:0}.forge-radio .label{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--forge-typography-label2-font-family, var(--forge-typography-font-family, \"Roboto\", sans-serif));font-size:var(--forge-typography-label2-font-size, calc(var(--forge-typography-font-size, 1rem) * var(--forge-typography-label-font-size-scale, .8125)));font-weight:var(--forge-typography-label2-font-weight,400);line-height:var(--forge-typography-label2-line-height, calc(var(--forge-typography-font-size, 1rem) * var(--forge-typography-label-line-height-scale, 1.25)));letter-spacing:var(--forge-typography-label2-letter-spacing, .0096153846em);text-transform:var(--forge-typography-label2-text-transform,inherit);text-decoration:var(--forge-typography-label2-text-decoration,inherit);cursor:default}.forge-radio .label:empty{display:none}:host([checked]) .forge-radio .background{border-color:var(--_radio-checked-border-color)}:host([checked]) .forge-radio .background::after{scale:1;opacity:1}:host([checked]) forge-state-layer{--forge-state-layer-color:var(--_radio-state-layer-checked-color)}:host([dense]) .forge-radio .container{inline-size:var(--_radio-state-layer-dense-width);block-size:var(--_radio-state-layer-dense-height)}:host([disabled]) .forge-radio .container{opacity:var(--_radio-disabled-opacity);cursor:not-allowed}:host([readonly]) .forge-radio .container{cursor:not-allowed}forge-focus-indicator{--forge-focus-indicator-color:var(--_radio-primary-color);--forge-focus-indicator-outward-offset:0px;--forge-focus-indicator-shape:var(--_radio-state-layer-shape)}forge-state-layer{--forge-state-layer-color:var(--_radio-state-layer-unchecked-color)}';
|
|
23
23
|
/**
|
|
24
24
|
* @tag forge-radio
|
|
25
25
|
*
|
|
@@ -42,6 +42,7 @@ const styles = ':host{display:inline-block;-webkit-tap-highlight-color:transpare
|
|
|
42
42
|
* @cssproperty --forge-radio-mark-color - The color of the radio button's mark.
|
|
43
43
|
* @cssproperty --forge-radio-gap - The gap between the radio button and its label.
|
|
44
44
|
* @cssproperty --forge-radio-justify - The alignment of the radio button and its label in the inline direction.
|
|
45
|
+
* @cssproperty --forge-radio-align - The alignment of the radio button and its label in the block direction.
|
|
45
46
|
* @cssproperty --forge-radio-direction - The direction of the radio button and its label.
|
|
46
47
|
* @cssproperty --forge-radio-state-layer-size - The size of the radio button's state layer in the inline and block directions.
|
|
47
48
|
* @cssproperty --forge-radio-state-layer-width - The width of the radio button's state layer.
|
|
@@ -13,7 +13,7 @@ import { SplitViewPanelCore } from './split-view-panel-core';
|
|
|
13
13
|
import { SplitViewPanelAdapter } from './split-view-panel-adapter';
|
|
14
14
|
import { IconComponent, IconRegistry } from '../../icon';
|
|
15
15
|
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>';
|
|
16
|
-
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:
|
|
16
|
+
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:utgfdhj;animation-duration:var(--forge-animation-duration-medium2, 300ms);animation-timing-function:var(--forge-animation-easing-standard,cubic-bezier(0.2,0,0,1))}@keyframes utgfdhj{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:utgfdif;animation-duration:var(--forge-animation-duration-medium2, 300ms);animation-timing-function:var(--forge-animation-easing-standard,cubic-bezier(0.2,0,0,1))}@keyframes utgfdif{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:utgfdiv;animation-duration:var(--forge-animation-duration-medium2, 300ms);animation-timing-function:var(--forge-animation-easing-standard,cubic-bezier(0.2,0,0,1));animation-direction:reverse}@keyframes utgfdiv{from{transform:none}to{transform:translateX(-100%)}}.forge-split-view-panel[orientation=horizontal].forge-split-view-panel--opening[resizable=start]{position:absolute;top:0;right:0;animation-name:utgfdiz;animation-duration:var(--forge-animation-duration-medium2, 300ms);animation-timing-function:var(--forge-animation-easing-standard,cubic-bezier(0.2,0,0,1));animation-direction:reverse}@keyframes utgfdiz{from{transform:none}to{transform:translateX(100%)}}.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:utgfdjk;animation-duration:var(--forge-animation-duration-medium2, 300ms);animation-timing-function:var(--forge-animation-easing-standard,cubic-bezier(0.2,0,0,1))}@keyframes utgfdjk{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:utgfdkb;animation-duration:var(--forge-animation-duration-medium2, 300ms);animation-timing-function:var(--forge-animation-easing-standard,cubic-bezier(0.2,0,0,1))}@keyframes utgfdkb{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:utgfdkq;animation-duration:var(--forge-animation-duration-medium2, 300ms);animation-timing-function:var(--forge-animation-easing-standard,cubic-bezier(0.2,0,0,1));animation-direction:reverse}@keyframes utgfdkq{from{transform:none}to{transform:translateY(-100%)}}.forge-split-view-panel[orientation=vertical].forge-split-view-panel--opening[resizable=start]{position:absolute;bottom:0;left:0;animation-name:utgfdlo;animation-duration:var(--forge-animation-duration-medium2, 300ms);animation-timing-function:var(--forge-animation-easing-standard,cubic-bezier(0.2,0,0,1));animation-direction:reverse}@keyframes utgfdlo{from{transform:none}to{transform:translateY(100%)}}: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}';
|
|
17
17
|
import { StateLayerComponent } from '../../state-layer';
|
|
18
18
|
import { FocusIndicatorComponent } from '../../focus-indicator';
|
|
19
19
|
/**
|
package/esm/switch/switch.d.ts
CHANGED
|
@@ -103,6 +103,7 @@ declare const SwitchComponent_base: import("../constants").AbstractConstructor<i
|
|
|
103
103
|
* @cssproperty --forge-switch-icon-active-off-scale - The scale transformation applied to the handle icons when the switch is active (pressed) in its off state.
|
|
104
104
|
* @cssproperty --forge-switch-gap - The space between the switch and label.
|
|
105
105
|
* @cssproperty --forge-switch-justify - How the switch and label are distributed along their main axis.
|
|
106
|
+
* @cssproperty --forge-switch-align - How the switch and label are distributed along their cross axis.
|
|
106
107
|
* @cssproperty --forge-switch-direction - Whether the switch and label are arranged along the inline or block axis.
|
|
107
108
|
* @cssproperty --forge-switch-state-layer-size - The inline and block size of the handle's state layer.
|
|
108
109
|
* @cssproperty --forge-switch-state-layer-width - The inline size of the handle's state layer.
|
package/esm/switch/switch.js
CHANGED
|
@@ -18,7 +18,7 @@ import { SwitchAdapter } from './switch-adapter';
|
|
|
18
18
|
import { SWITCH_CONSTANTS } from './switch-constants';
|
|
19
19
|
import { SwitchCore } from './switch-core';
|
|
20
20
|
const template = '<template><div class=\"forge-switch\" part=\"switch\"><div id=\"container\" class=\"container\"><div class=\"track\" part=\"track\"></div><div class=\"handle\" part=\"handle\"><div id=\"icon-off\" class=\"icon icon__off\" part=\"icon-off\"><slot name=\"icon-off\"><svg aria-hidden=\"true\" viewBox=\"0 0 24 24\"><path d=\"M20 13H4v-2h16v2z\"/></svg></slot></div><div id=\"icon-on\" class=\"icon icon__on\" part=\"icon-on\"><slot name=\"icon-on\"><svg aria-hidden=\"true\" viewBox=\"0 0 24 24\"><path d=\"M19.69,5.23L8.96,15.96l-4.23-4.23L2.96,13.5l6,6L21.46,7L19.69,5.23z\"/></svg></slot></div><forge-state-layer target=\":host\" exportparts=\"surface:state-layer\"></forge-state-layer></div><forge-focus-indicator target=\":host\" part=\"focus-indicator\"></forge-focus-indicator></div><label id=\"label\" class=\"label\" part=\"label\"><slot></slot></label></div></template>';
|
|
21
|
-
const styles = ':host{display:inline-block;outline:0;-webkit-tap-highlight-color:transparent}:host([hidden]){display:none}.forge-switch{--_switch-handle-size:var(--forge-switch-handle-size, 20px);--_switch-handle-scale:var(--forge-switch-handle-scale, 1);--_switch-handle-elevation:var(--forge-switch-handle-elevation, 0px 2px 1px -1px rgba(0, 0, 0, 0.2), 0px 1px 1px 0px rgba(0, 0, 0, 0.14), 0px 1px 3px 0px rgba(0, 0, 0, 0.12));--_switch-track-border-width:var(--forge-switch-track-border-width, 0);--_switch-track-border-color:var(--forge-switch-track-border-color, transparent);--_switch-icon-color:var(--forge-switch-icon-color, var(--forge-theme-on-tertiary, #ffffff));--_switch-icon-size:var(--forge-switch-icon-size, 16px);--_switch-icon-scale:var(--forge-switch-icon-scale, 1);--_switch-state-layer-size:var(--forge-switch-state-layer-size, 40px);--_switch-state-layer-dense-size:var(--forge-switch-state-layer-dense-size, 28px);--_switch-handle-on-color:var(--forge-switch-handle-on-color, var(--forge-theme-tertiary, #3d5afe));--_switch-handle-off-color:var(--forge-switch-handle-off-color, var(--forge-theme-surface-container-high, #9e9e9e));--_switch-handle-width:var(--forge-switch-handle-width, var(--_switch-handle-size));--_switch-handle-height:var(--forge-switch-handle-height, var(--_switch-handle-size));--_switch-handle-on-scale:var(--forge-switch-handle-on-scale, var(--_switch-handle-scale));--_switch-handle-off-scale:var(--forge-switch-handle-off-scale, var(--_switch-handle-scale));--_switch-handle-shape:var(--forge-switch-handle-shape, calc(var(--forge-shape-round, 50%) * var(--forge-shape-factor, 1)));--_switch-handle-on-elevation:var(--forge-switch-handle-on-elevation, var(--_switch-handle-elevation));--_switch-handle-off-elevation:var(--forge-switch-handle-off-elevation, var(--_switch-handle-elevation));--_switch-track-on-color:var(--forge-switch-track-on-color, var(--forge-theme-tertiary-container, #d0d7ff));--_switch-track-off-color:var(--forge-switch-track-off-color, var(--forge-theme-surface-container, #e0e0e0));--_switch-track-width:var(--forge-switch-track-width, 36px);--_switch-track-height:var(--forge-switch-track-height, 14px);--_switch-track-shape:var(--forge-switch-track-shape, calc(var(--forge-shape-full, 9999px) * var(--forge-shape-factor, 1)));--_switch-track-on-border-width:var(--forge-switch-track-on-border-width, var(--_switch-track-border-width));--_switch-track-off-border-width:var(--forge-switch-track-off-border-width, var(--_switch-track-border-width));--_switch-track-on-border-color:var(--forge-switch-track-on-border-color, var(--_switch-track-border-color));--_switch-track-off-border-color:var(--forge-switch-track-off-border-color, var(--_switch-track-border-color));--_switch-icon-on-color:var(--forge-switch-icon-on-color, var(--_switch-icon-color));--_switch-icon-off-color:var(--forge-switch-icon-off-color, var(--_switch-icon-color));--_switch-icon-on-size:var(--forge-switch-icon-on-size, var(--_switch-icon-size));--_switch-icon-off-size:var(--forge-switch-icon-off-size, var(--_switch-icon-size));--_switch-icon-on-scale:var(--forge-switch-icon-on-scale, var(--_switch-icon-scale));--_switch-icon-off-scale:var(--forge-switch-icon-off-scale, var(--_switch-icon-scale));--_switch-gap:var(--forge-switch-gap, 0);--_switch-justify:var(--forge-switch-justify, start);--_switch-direction:var(--forge-switch-direction, initial);--_switch-state-layer-width:var(--forge-switch-state-layer-width, var(--_switch-state-layer-size));--_switch-state-layer-height:var(--forge-switch-state-layer-height, var(--_switch-state-layer-size));--_switch-state-layer-on-color:var(--forge-switch-state-layer-on-color, var(--_switch-handle-on-color));--_switch-state-layer-off-color:var(--forge-switch-state-layer-off-color, var(--_switch-color));--_switch-state-layer-dense-width:var(--forge-switch-state-layer-dense-width, var(--_switch-state-layer-dense-size));--_switch-state-layer-dense-height:var(--forge-switch-state-layer-dense-height, var(--_switch-state-layer-dense-size));--_switch-disabled-opacity:var(--forge-switch-disabled-opacity, 0.38);--_switch-handle-active-on-color:var(--forge-switch-handle-active-on-color, var(--_switch-handle-on-color));--_switch-handle-active-off-color:var(--forge-switch-handle-active-off-color, var(--_switch-handle-off-color));--_switch-handle-active-scale:var(--forge-switch-handle-active-scale, 1.2);--_switch-handle-active-on-scale:var(--forge-switch-handle-active-on-scale, var(--_switch-handle-active-scale));--_switch-handle-active-off-scale:var(--forge-switch-handle-active-off-scale, var(--_switch-handle-active-scale));--_switch-handle-active-elevation:var(--forge-switch-handle-active-elevation, var(--_switch-handle-elevation));--_switch-handle-active-on-elevation:var(--forge-switch-handle-active-on-elevation, var(--_switch-handle-active-elevation));--_switch-handle-active-off-elevation:var(--forge-switch-handle-active-off-elevation, var(--_switch-handle-active-elevation));--_switch-track-active-on-color:var(--forge-switch-track-active-on-color, var(--_switch-track-on-color));--_switch-track-active-off-color:var(--forge-switch-track-active-off-color, var(--_switch-track-off-color));--_switch-track-active-on-border-width:var(--forge-switch-track-active-on-border-width, var(--_switch-track-on-border-width));--_switch-track-active-off-border-width:var(--forge-switch-track-active-off-border-width, var(--_switch-track-off-border-width));--_switch-track-active-on-border-color:var(--forge-switch-track-active-on-border-color, var(--_switch-track-on-border-color));--_switch-track-active-off-border-color:var(--forge-switch-track-active-off-border-color, var(--_switch-track-off-border-color));--_switch-icon-active-on-color:var(--forge-switch-icon-active-on-color, var(--_switch-icon-on-color));--_switch-icon-active-off-color:var(--forge-switch-icon-active-off-color, var(--_switch-icon-off-color));--_switch-icon-active-on-scale:var(--forge-switch-icon-active-on-scale, var(--_switch-icon-on-scale));--_switch-icon-active-off-scale:var(--forge-switch-icon-active-off-scale, var(--_switch-icon-off-scale));--_switch-animation-duration:var(--forge-switch-animation-duration, var(--forge-animation-duration-short2, 100ms));--_switch-animation-timing:var(--forge-switch-animation-timing, var(--forge-animation-easing-standard, cubic-bezier(0.2, 0, 0, 1)));--_switch-active-animation-timing:var(--forge-switch-active-animation-timing, var(--forge-animation-easing-linear, cubic-bezier(0, 0, 1, 1)))}.forge-switch{display:flex;position:relative;flex-direction:var(--_switch-direction);flex-shrink:0;align-items:center;justify-content:var(--_switch-justify);gap:var(--_switch-gap);--_switch-current-state-layer-width:var(--_switch-state-layer-width);--_switch-current-state-layer-height:var(--_switch-state-layer-height)}.forge-switch .container{position:relative;align-items:center;display:flex;block-size:max(var(--_switch-handle-height),var(--_switch-track-height),var(--_switch-current-state-layer-height));cursor:pointer}.forge-switch .input{position:absolute;z-index:1;appearance:none;outline:0;margin:0;inline-size:100%;block-size:100%;cursor:unset}.forge-switch .track{transition-property:background-color,border-color,border-width;transition-duration:var(--_switch-animation-duration);transition-timing-function:var(--_switch-animation-timing);box-sizing:border-box;margin-inline:calc(max(var(--_switch-handle-width),var(--_switch-current-state-layer-width))/ 2 - calc(var(--_switch-track-height)/ 2));border-width:var(--_switch-track-off-border-width);border-color:var(--_switch-track-off-border-color);border-style:solid;border-radius:var(--_switch-track-shape);inline-size:var(--_switch-track-width);block-size:var(--_switch-track-height);background-color:var(--_switch-track-off-color)}.forge-switch .handle{position:absolute;justify-content:center;align-items:center;display:flex;transition-property:translate;transition-duration:var(--_switch-animation-duration);transition-timing-function:var(--_switch-animation-timing);border-radius:var(--_switch-handle-shape);inline-size:var(--_switch-current-state-layer-width);block-size:var(--_switch-current-state-layer-height)}.forge-switch .handle::before{content:\"\";position:relative;display:block;scale:var(--_switch-handle-off-scale);transition:background-color var(--_switch-animation-duration) var(--_switch-animation-timing),box-shadow var(--_switch-animation-duration) var(--_switch-animation-timing),scale var(--_switch-animation-duration) var(--_switch-active-animation-timing);box-shadow:var(--_switch-handle-off-elevation);border-radius:var(--_switch-handle-shape);inline-size:var(--_switch-handle-width);block-size:var(--_switch-handle-height);background-color:var(--_switch-handle-off-color)}.forge-switch .icon{position:absolute;align-items:center;justify-content:center;display:flex;transition-property:opacity,scale;transition-duration:var(--_switch-animation-duration);transition-timing-function:var(--_switch-animation-timing);inline-size:var(--_switch-icon-off-size);block-size:var(--_switch-icon-off-size);color:var(--_switch-icon-off-color);fill:var(--_switch-icon-off-color);font-size:var(--_switch-icon-off-size);--forge-icon-font-size:var(--_switch-icon-off-size)}.forge-switch .icon__on{--forge-icon-font-size:var(--_switch-icon-on-size);inline-size:var(--_switch-icon-on-size);block-size:var(--_switch-icon-on-size);color:var(--_switch-icon-on-color);fill:var(--_switch-icon-on-color);font-size:var(--_switch-icon-on-size);opacity:0;scale:0.4}.forge-switch .icon__off{opacity:1;scale:var(--_switch-icon-off-scale)}.forge-switch .label{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--forge-typography-label2-font-family, var(--forge-typography-font-family, \"Roboto\", sans-serif));font-size:var(--forge-typography-label2-font-size, calc(var(--forge-typography-font-size, 1rem) * var(--forge-typography-label-font-size-scale, .8125)));font-weight:var(--forge-typography-label2-font-weight,400);line-height:var(--forge-typography-label2-line-height, calc(var(--forge-typography-font-size, 1rem) * var(--forge-typography-label-line-height-scale, 1.25)));letter-spacing:var(--forge-typography-label2-letter-spacing, .0096153846em);text-transform:var(--forge-typography-label2-text-transform,inherit);text-decoration:var(--forge-typography-label2-text-decoration,inherit)}.forge-switch .label:empty{display:none}.forge-switch .hidden{display:none}.forge-switch ::slotted([slot=input]){position:absolute;z-index:1;appearance:none;outline:0;margin:0;inline-size:100%;block-size:100%;cursor:unset}:host([on]) .track{border-width:var(--_switch-track-on-border-width);border-color:var(--_switch-track-on-border-color);background-color:var(--_switch-track-on-color)}:host([on]) .handle{translate:calc(var(--_switch-track-width) - calc(var(--_switch-track-height)/ 2) * 2)}:host([on]) .handle::before{scale:var(--_switch-handle-on-scale);box-shadow:var(--_switch-handle-on-elevation);background-color:var(--_switch-handle-on-color)}:host([on]) .handle .icon__on{opacity:1;scale:var(--_switch-icon-on-scale)}:host([on]) .handle .icon__off{opacity:0;scale:0.4}:host([on]) forge-state-layer{--forge-state-layer-color:var(--_switch-state-layer-on-color)}:host(:not([disabled]):not([readonly])) .forge-switch .container:active .track{border-width:var(--_switch-track-active-off-border-width);border-color:var(--_switch-track-active-off-border-color);background-color:var(--_switch-track-active-off-color)}:host(:not([disabled]):not([readonly])) .forge-switch .container:active .handle::before{scale:var(--_switch-handle-active-off-scale);box-shadow:var(--_switch-handle-active-off-elevation);background-color:var(--_switch-handle-active-off-color)}:host(:not([disabled]):not([readonly])) .forge-switch .container:active .handle .icon{scale:var(--_switch-icon-active-off-scale);color:var(--_switch-icon-active-off-color);fill:var(--_switch-icon-active-off-color)}:host(:not([disabled]):not([readonly])[on]) .forge-switch .container:active .track{border-width:var(--_switch-track-active-on-border-width);border-color:var(--_switch-track-active-on-border-color);background-color:var(--_switch-track-active-on-color)}:host(:not([disabled]):not([readonly])[on]) .forge-switch .container:active .handle::before{scale:var(--_switch-handle-active-on-scale);box-shadow:var(--_switch-handle-active-on-elevation);background-color:var(--_switch-handle-active-on-color)}:host(:not([disabled]):not([readonly])[on]) .forge-switch .container:active .handle .icon{scale:var(--_switch-icon-active-on-scale);color:var(--_switch-icon-active-on-color);fill:var(--_switch-icon-active-on-color)}:host([dense]) .forge-switch{--_switch-current-state-layer-width:var(--_switch-state-layer-dense-width);--_switch-current-state-layer-height:var(--_switch-state-layer-dense-height)}:host([disabled]) .forge-switch .container{opacity:var(--_switch-disabled-opacity);cursor:not-allowed}:host([disabled]) .forge-switch .handle::before{box-shadow:none}:host([readonly]) .forge-switch .container{cursor:not-allowed}@media (prefers-reduced-motion){.switch{--_switch-animation-duration:var(--forge-switch-animation-duration, 0s)}}forge-state-layer{--forge-state-layer-color:var(--_switch-state-layer-off-color)}forge-focus-indicator{--forge-focus-indicator-shape:var(--_switch-track-shape);--forge-focus-indicator-outward-offset:0px}';
|
|
21
|
+
const styles = ':host{display:inline-block;outline:0;-webkit-tap-highlight-color:transparent}:host([hidden]){display:none}.forge-switch{--_switch-handle-size:var(--forge-switch-handle-size, 20px);--_switch-handle-scale:var(--forge-switch-handle-scale, 1);--_switch-handle-elevation:var(--forge-switch-handle-elevation, 0px 2px 1px -1px rgba(0, 0, 0, 0.2), 0px 1px 1px 0px rgba(0, 0, 0, 0.14), 0px 1px 3px 0px rgba(0, 0, 0, 0.12));--_switch-track-border-width:var(--forge-switch-track-border-width, 0);--_switch-track-border-color:var(--forge-switch-track-border-color, transparent);--_switch-icon-color:var(--forge-switch-icon-color, var(--forge-theme-on-tertiary, #ffffff));--_switch-icon-size:var(--forge-switch-icon-size, 16px);--_switch-icon-scale:var(--forge-switch-icon-scale, 1);--_switch-state-layer-size:var(--forge-switch-state-layer-size, 40px);--_switch-state-layer-dense-size:var(--forge-switch-state-layer-dense-size, 28px);--_switch-handle-on-color:var(--forge-switch-handle-on-color, var(--forge-theme-tertiary, #3d5afe));--_switch-handle-off-color:var(--forge-switch-handle-off-color, var(--forge-theme-surface-container-high, #9e9e9e));--_switch-handle-width:var(--forge-switch-handle-width, var(--_switch-handle-size));--_switch-handle-height:var(--forge-switch-handle-height, var(--_switch-handle-size));--_switch-handle-on-scale:var(--forge-switch-handle-on-scale, var(--_switch-handle-scale));--_switch-handle-off-scale:var(--forge-switch-handle-off-scale, var(--_switch-handle-scale));--_switch-handle-shape:var(--forge-switch-handle-shape, calc(var(--forge-shape-round, 50%) * var(--forge-shape-factor, 1)));--_switch-handle-on-elevation:var(--forge-switch-handle-on-elevation, var(--_switch-handle-elevation));--_switch-handle-off-elevation:var(--forge-switch-handle-off-elevation, var(--_switch-handle-elevation));--_switch-track-on-color:var(--forge-switch-track-on-color, var(--forge-theme-tertiary-container, #d0d7ff));--_switch-track-off-color:var(--forge-switch-track-off-color, var(--forge-theme-surface-container, #e0e0e0));--_switch-track-width:var(--forge-switch-track-width, 36px);--_switch-track-height:var(--forge-switch-track-height, 14px);--_switch-track-shape:var(--forge-switch-track-shape, calc(var(--forge-shape-full, 9999px) * var(--forge-shape-factor, 1)));--_switch-track-on-border-width:var(--forge-switch-track-on-border-width, var(--_switch-track-border-width));--_switch-track-off-border-width:var(--forge-switch-track-off-border-width, var(--_switch-track-border-width));--_switch-track-on-border-color:var(--forge-switch-track-on-border-color, var(--_switch-track-border-color));--_switch-track-off-border-color:var(--forge-switch-track-off-border-color, var(--_switch-track-border-color));--_switch-icon-on-color:var(--forge-switch-icon-on-color, var(--_switch-icon-color));--_switch-icon-off-color:var(--forge-switch-icon-off-color, var(--_switch-icon-color));--_switch-icon-on-size:var(--forge-switch-icon-on-size, var(--_switch-icon-size));--_switch-icon-off-size:var(--forge-switch-icon-off-size, var(--_switch-icon-size));--_switch-icon-on-scale:var(--forge-switch-icon-on-scale, var(--_switch-icon-scale));--_switch-icon-off-scale:var(--forge-switch-icon-off-scale, var(--_switch-icon-scale));--_switch-gap:var(--forge-switch-gap, 0);--_switch-justify:var(--forge-switch-justify, start);--_switch-align:var(--forge-switch-align, center);--_switch-direction:var(--forge-switch-direction, initial);--_switch-state-layer-width:var(--forge-switch-state-layer-width, var(--_switch-state-layer-size));--_switch-state-layer-height:var(--forge-switch-state-layer-height, var(--_switch-state-layer-size));--_switch-state-layer-on-color:var(--forge-switch-state-layer-on-color, var(--_switch-handle-on-color));--_switch-state-layer-off-color:var(--forge-switch-state-layer-off-color, var(--_switch-color));--_switch-state-layer-dense-width:var(--forge-switch-state-layer-dense-width, var(--_switch-state-layer-dense-size));--_switch-state-layer-dense-height:var(--forge-switch-state-layer-dense-height, var(--_switch-state-layer-dense-size));--_switch-disabled-opacity:var(--forge-switch-disabled-opacity, 0.38);--_switch-handle-active-on-color:var(--forge-switch-handle-active-on-color, var(--_switch-handle-on-color));--_switch-handle-active-off-color:var(--forge-switch-handle-active-off-color, var(--_switch-handle-off-color));--_switch-handle-active-scale:var(--forge-switch-handle-active-scale, 1.2);--_switch-handle-active-on-scale:var(--forge-switch-handle-active-on-scale, var(--_switch-handle-active-scale));--_switch-handle-active-off-scale:var(--forge-switch-handle-active-off-scale, var(--_switch-handle-active-scale));--_switch-handle-active-elevation:var(--forge-switch-handle-active-elevation, var(--_switch-handle-elevation));--_switch-handle-active-on-elevation:var(--forge-switch-handle-active-on-elevation, var(--_switch-handle-active-elevation));--_switch-handle-active-off-elevation:var(--forge-switch-handle-active-off-elevation, var(--_switch-handle-active-elevation));--_switch-track-active-on-color:var(--forge-switch-track-active-on-color, var(--_switch-track-on-color));--_switch-track-active-off-color:var(--forge-switch-track-active-off-color, var(--_switch-track-off-color));--_switch-track-active-on-border-width:var(--forge-switch-track-active-on-border-width, var(--_switch-track-on-border-width));--_switch-track-active-off-border-width:var(--forge-switch-track-active-off-border-width, var(--_switch-track-off-border-width));--_switch-track-active-on-border-color:var(--forge-switch-track-active-on-border-color, var(--_switch-track-on-border-color));--_switch-track-active-off-border-color:var(--forge-switch-track-active-off-border-color, var(--_switch-track-off-border-color));--_switch-icon-active-on-color:var(--forge-switch-icon-active-on-color, var(--_switch-icon-on-color));--_switch-icon-active-off-color:var(--forge-switch-icon-active-off-color, var(--_switch-icon-off-color));--_switch-icon-active-on-scale:var(--forge-switch-icon-active-on-scale, var(--_switch-icon-on-scale));--_switch-icon-active-off-scale:var(--forge-switch-icon-active-off-scale, var(--_switch-icon-off-scale));--_switch-animation-duration:var(--forge-switch-animation-duration, var(--forge-animation-duration-short2, 100ms));--_switch-animation-timing:var(--forge-switch-animation-timing, var(--forge-animation-easing-standard, cubic-bezier(0.2, 0, 0, 1)));--_switch-active-animation-timing:var(--forge-switch-active-animation-timing, var(--forge-animation-easing-linear, cubic-bezier(0, 0, 1, 1)))}.forge-switch{display:flex;position:relative;flex-direction:var(--_switch-direction);align-items:var(--_switch-align);justify-content:var(--_switch-justify);gap:var(--_switch-gap);--_switch-current-state-layer-width:var(--_switch-state-layer-width);--_switch-current-state-layer-height:var(--_switch-state-layer-height)}.forge-switch .container{position:relative;align-items:center;display:flex;flex-shrink:0;block-size:max(var(--_switch-handle-height),var(--_switch-track-height),var(--_switch-current-state-layer-height));cursor:pointer}.forge-switch .input{position:absolute;z-index:1;appearance:none;outline:0;margin:0;inline-size:100%;block-size:100%;cursor:unset}.forge-switch .track{transition-property:background-color,border-color,border-width;transition-duration:var(--_switch-animation-duration);transition-timing-function:var(--_switch-animation-timing);box-sizing:border-box;margin-inline:calc(max(var(--_switch-handle-width),var(--_switch-current-state-layer-width))/ 2 - calc(var(--_switch-track-height)/ 2));border-width:var(--_switch-track-off-border-width);border-color:var(--_switch-track-off-border-color);border-style:solid;border-radius:var(--_switch-track-shape);inline-size:var(--_switch-track-width);block-size:var(--_switch-track-height);background-color:var(--_switch-track-off-color)}.forge-switch .handle{position:absolute;justify-content:center;align-items:center;display:flex;transition-property:translate;transition-duration:var(--_switch-animation-duration);transition-timing-function:var(--_switch-animation-timing);border-radius:var(--_switch-handle-shape);inline-size:var(--_switch-current-state-layer-width);block-size:var(--_switch-current-state-layer-height)}.forge-switch .handle::before{content:\"\";position:relative;display:block;scale:var(--_switch-handle-off-scale);transition:background-color var(--_switch-animation-duration) var(--_switch-animation-timing),box-shadow var(--_switch-animation-duration) var(--_switch-animation-timing),scale var(--_switch-animation-duration) var(--_switch-active-animation-timing);box-shadow:var(--_switch-handle-off-elevation);border-radius:var(--_switch-handle-shape);inline-size:var(--_switch-handle-width);block-size:var(--_switch-handle-height);background-color:var(--_switch-handle-off-color)}.forge-switch .icon{position:absolute;align-items:center;justify-content:center;display:flex;transition-property:opacity,scale;transition-duration:var(--_switch-animation-duration);transition-timing-function:var(--_switch-animation-timing);inline-size:var(--_switch-icon-off-size);block-size:var(--_switch-icon-off-size);color:var(--_switch-icon-off-color);fill:var(--_switch-icon-off-color);font-size:var(--_switch-icon-off-size);--forge-icon-font-size:var(--_switch-icon-off-size)}.forge-switch .icon__on{--forge-icon-font-size:var(--_switch-icon-on-size);inline-size:var(--_switch-icon-on-size);block-size:var(--_switch-icon-on-size);color:var(--_switch-icon-on-color);fill:var(--_switch-icon-on-color);font-size:var(--_switch-icon-on-size);opacity:0;scale:0.4}.forge-switch .icon__off{opacity:1;scale:var(--_switch-icon-off-scale)}.forge-switch .label{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--forge-typography-label2-font-family, var(--forge-typography-font-family, \"Roboto\", sans-serif));font-size:var(--forge-typography-label2-font-size, calc(var(--forge-typography-font-size, 1rem) * var(--forge-typography-label-font-size-scale, .8125)));font-weight:var(--forge-typography-label2-font-weight,400);line-height:var(--forge-typography-label2-line-height, calc(var(--forge-typography-font-size, 1rem) * var(--forge-typography-label-line-height-scale, 1.25)));letter-spacing:var(--forge-typography-label2-letter-spacing, .0096153846em);text-transform:var(--forge-typography-label2-text-transform,inherit);text-decoration:var(--forge-typography-label2-text-decoration,inherit)}.forge-switch .label:empty{display:none}.forge-switch .hidden{display:none}.forge-switch ::slotted([slot=input]){position:absolute;z-index:1;appearance:none;outline:0;margin:0;inline-size:100%;block-size:100%;cursor:unset}:host([on]) .track{border-width:var(--_switch-track-on-border-width);border-color:var(--_switch-track-on-border-color);background-color:var(--_switch-track-on-color)}:host([on]) .handle{translate:calc(var(--_switch-track-width) - calc(var(--_switch-track-height)/ 2) * 2)}:host([on]) .handle::before{scale:var(--_switch-handle-on-scale);box-shadow:var(--_switch-handle-on-elevation);background-color:var(--_switch-handle-on-color)}:host([on]) .handle .icon__on{opacity:1;scale:var(--_switch-icon-on-scale)}:host([on]) .handle .icon__off{opacity:0;scale:0.4}:host([on]) forge-state-layer{--forge-state-layer-color:var(--_switch-state-layer-on-color)}:host(:not([disabled]):not([readonly])) .forge-switch .container:active .track{border-width:var(--_switch-track-active-off-border-width);border-color:var(--_switch-track-active-off-border-color);background-color:var(--_switch-track-active-off-color)}:host(:not([disabled]):not([readonly])) .forge-switch .container:active .handle::before{scale:var(--_switch-handle-active-off-scale);box-shadow:var(--_switch-handle-active-off-elevation);background-color:var(--_switch-handle-active-off-color)}:host(:not([disabled]):not([readonly])) .forge-switch .container:active .handle .icon{scale:var(--_switch-icon-active-off-scale);color:var(--_switch-icon-active-off-color);fill:var(--_switch-icon-active-off-color)}:host(:not([disabled]):not([readonly])[on]) .forge-switch .container:active .track{border-width:var(--_switch-track-active-on-border-width);border-color:var(--_switch-track-active-on-border-color);background-color:var(--_switch-track-active-on-color)}:host(:not([disabled]):not([readonly])[on]) .forge-switch .container:active .handle::before{scale:var(--_switch-handle-active-on-scale);box-shadow:var(--_switch-handle-active-on-elevation);background-color:var(--_switch-handle-active-on-color)}:host(:not([disabled]):not([readonly])[on]) .forge-switch .container:active .handle .icon{scale:var(--_switch-icon-active-on-scale);color:var(--_switch-icon-active-on-color);fill:var(--_switch-icon-active-on-color)}:host([dense]) .forge-switch{--_switch-current-state-layer-width:var(--_switch-state-layer-dense-width);--_switch-current-state-layer-height:var(--_switch-state-layer-dense-height)}:host([disabled]) .forge-switch .container{opacity:var(--_switch-disabled-opacity);cursor:not-allowed}:host([disabled]) .forge-switch .handle::before{box-shadow:none}:host([readonly]) .forge-switch .container{cursor:not-allowed}@media (prefers-reduced-motion){.switch{--_switch-animation-duration:var(--forge-switch-animation-duration, 0s)}}forge-state-layer{--forge-state-layer-color:var(--_switch-state-layer-off-color)}forge-focus-indicator{--forge-focus-indicator-shape:var(--_switch-track-shape);--forge-focus-indicator-outward-offset:0px}';
|
|
22
22
|
/**
|
|
23
23
|
* @tag forge-switch
|
|
24
24
|
*
|
|
@@ -86,6 +86,7 @@ const styles = ':host{display:inline-block;outline:0;-webkit-tap-highlight-color
|
|
|
86
86
|
* @cssproperty --forge-switch-icon-active-off-scale - The scale transformation applied to the handle icons when the switch is active (pressed) in its off state.
|
|
87
87
|
* @cssproperty --forge-switch-gap - The space between the switch and label.
|
|
88
88
|
* @cssproperty --forge-switch-justify - How the switch and label are distributed along their main axis.
|
|
89
|
+
* @cssproperty --forge-switch-align - How the switch and label are distributed along their cross axis.
|
|
89
90
|
* @cssproperty --forge-switch-direction - Whether the switch and label are arranged along the inline or block axis.
|
|
90
91
|
* @cssproperty --forge-switch-state-layer-size - The inline and block size of the handle's state layer.
|
|
91
92
|
* @cssproperty --forge-switch-state-layer-width - The inline size of the handle's state layer.
|
package/esm/table/table-utils.js
CHANGED
|
@@ -177,12 +177,6 @@ export class TableUtils {
|
|
|
177
177
|
Object.assign(th.style, columnConfig.headerCellStyle);
|
|
178
178
|
Object.assign(cellContainer.style, columnConfig.headerCellStyle);
|
|
179
179
|
}
|
|
180
|
-
const span = document.createElement('span');
|
|
181
|
-
span.classList.add(TABLE_CONSTANTS.classes.TABLE_HEAD_CELL_TEXT);
|
|
182
|
-
span.textContent = columnConfig.header && typeof columnConfig.header === 'string' ? columnConfig.header.trim() : '';
|
|
183
|
-
if (span.textContent.trim().length === 0) {
|
|
184
|
-
th.setAttribute('aria-hidden', 'true');
|
|
185
|
-
}
|
|
186
180
|
// Add the sort icon if this column is sortable
|
|
187
181
|
if (columnConfig.sortable) {
|
|
188
182
|
th.classList.add(TABLE_CONSTANTS.classes.TABLE_HEAD_CELL_SORTABLE);
|
|
@@ -231,6 +225,12 @@ export class TableUtils {
|
|
|
231
225
|
});
|
|
232
226
|
}
|
|
233
227
|
else {
|
|
228
|
+
const span = document.createElement('span');
|
|
229
|
+
span.classList.add(TABLE_CONSTANTS.classes.TABLE_HEAD_CELL_TEXT);
|
|
230
|
+
span.textContent = columnConfig.header && typeof columnConfig.header === 'string' ? columnConfig.header.trim() : '';
|
|
231
|
+
if (span.textContent.trim().length === 0) {
|
|
232
|
+
th.setAttribute('aria-hidden', 'true');
|
|
233
|
+
}
|
|
234
234
|
TableUtils._prepend(span, cellContainer);
|
|
235
235
|
}
|
|
236
236
|
th.appendChild(cellContainer);
|
|
@@ -7,8 +7,6 @@ import { BaseAdapter, IBaseAdapter } from '../../core/base/base-adapter';
|
|
|
7
7
|
import { ITabComponent } from '../tab/tab';
|
|
8
8
|
import { ITabBarComponent } from './tab-bar';
|
|
9
9
|
export interface ITabBarAdapter extends IBaseAdapter {
|
|
10
|
-
initialize(): void;
|
|
11
|
-
destroy(): void;
|
|
12
10
|
initializeContainerSizeObserver(listener: () => void): void;
|
|
13
11
|
destroyContainerSizeObserver(): void;
|
|
14
12
|
initializeScrollObserver(listener: EventListener): void;
|
|
@@ -41,10 +39,7 @@ export declare class TabBarAdapter extends BaseAdapter<ITabBarComponent> impleme
|
|
|
41
39
|
private _resizeObserver;
|
|
42
40
|
private _backwardScrollButton;
|
|
43
41
|
private _forwardScrollButton;
|
|
44
|
-
private _forwardObserver?;
|
|
45
42
|
constructor(component: ITabBarComponent);
|
|
46
|
-
initialize(): void;
|
|
47
|
-
destroy(): void;
|
|
48
43
|
initializeContainerSizeObserver(listener: () => void): void;
|
|
49
44
|
initializeScrollObserver(listener: EventListener): void;
|
|
50
45
|
destroyContainerSizeObserver(): void;
|
|
@@ -8,7 +8,6 @@ import { tylIconKeyboardArrowLeft, tylIconKeyboardArrowRight, tylIconKeyboardArr
|
|
|
8
8
|
import { BaseAdapter } from '../../core/base/base-adapter';
|
|
9
9
|
import { TAB_CONSTANTS } from '../tab/tab-constants';
|
|
10
10
|
import { TAB_BAR_CONSTANTS } from './tab-bar-constants';
|
|
11
|
-
import { forwardAttributes } from '../../core/utils/reflect-utils';
|
|
12
11
|
export class TabBarAdapter extends BaseAdapter {
|
|
13
12
|
constructor(component) {
|
|
14
13
|
super(component);
|
|
@@ -16,15 +15,6 @@ export class TabBarAdapter extends BaseAdapter {
|
|
|
16
15
|
this._rootElement = getShadowElement(this._component, TAB_BAR_CONSTANTS.selectors.ROOT);
|
|
17
16
|
this._scrollContainer = getShadowElement(this._component, TAB_BAR_CONSTANTS.selectors.SCROLL_CONTAINER);
|
|
18
17
|
}
|
|
19
|
-
initialize() {
|
|
20
|
-
this._forwardObserver = forwardAttributes(this._component, Object.keys(TAB_BAR_CONSTANTS.forwardedAttributes), (name, value) => {
|
|
21
|
-
toggleAttribute(this._scrollContainer, !!value, TAB_BAR_CONSTANTS.forwardedAttributes[name], value ?? undefined);
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
destroy() {
|
|
25
|
-
this._forwardObserver?.disconnect();
|
|
26
|
-
this._forwardObserver = undefined;
|
|
27
|
-
}
|
|
28
18
|
initializeContainerSizeObserver(listener) {
|
|
29
19
|
this._resizeObserver = new ResizeObserver(() => listener());
|
|
30
20
|
this._resizeObserver.observe(this._component);
|
|
@@ -40,7 +30,7 @@ export class TabBarAdapter extends BaseAdapter {
|
|
|
40
30
|
this._scrollContainer.removeEventListener('scroll', listener, { passive: true });
|
|
41
31
|
}
|
|
42
32
|
setVertical(value) {
|
|
43
|
-
toggleAttribute(this.
|
|
33
|
+
toggleAttribute(this._component, !!value, 'aria-orientation', 'vertical');
|
|
44
34
|
}
|
|
45
35
|
setScrollBackwardButtonListener(listener) {
|
|
46
36
|
this._backwardScrollButton?.addEventListener('click', listener);
|
|
@@ -109,6 +99,7 @@ export class TabBarAdapter extends BaseAdapter {
|
|
|
109
99
|
this._forwardScrollButton?.focus();
|
|
110
100
|
}
|
|
111
101
|
this._backwardScrollButton.disabled = disabled;
|
|
102
|
+
this._backwardScrollButton.tabIndex = -1;
|
|
112
103
|
}
|
|
113
104
|
if (this._forwardScrollButton) {
|
|
114
105
|
const disabled = !forwardEnabled;
|
|
@@ -116,6 +107,7 @@ export class TabBarAdapter extends BaseAdapter {
|
|
|
116
107
|
this._backwardScrollButton?.focus();
|
|
117
108
|
}
|
|
118
109
|
this._forwardScrollButton.disabled = disabled;
|
|
110
|
+
this._forwardScrollButton.tabIndex = -1;
|
|
119
111
|
}
|
|
120
112
|
}
|
|
121
113
|
scroll(which) {
|
|
@@ -19,9 +19,6 @@ const observedAttributes = {
|
|
|
19
19
|
const attributes = {
|
|
20
20
|
...observedAttributes
|
|
21
21
|
};
|
|
22
|
-
const forwardedAttributes = {
|
|
23
|
-
'data-aria-label': 'aria-label'
|
|
24
|
-
};
|
|
25
22
|
const selectors = {
|
|
26
23
|
ROOT: '.forge-tab-bar',
|
|
27
24
|
SCROLL_CONTAINER: '.scroll-container',
|
|
@@ -40,7 +37,6 @@ export const TAB_BAR_CONSTANTS = {
|
|
|
40
37
|
elementName,
|
|
41
38
|
observedAttributes,
|
|
42
39
|
attributes,
|
|
43
|
-
forwardedAttributes,
|
|
44
40
|
events,
|
|
45
41
|
selectors,
|
|
46
42
|
classes,
|