@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
|
@@ -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:ugnd22r;animation-duration:var(--forge-animation-duration-medium2, 300ms);animation-timing-function:var(--forge-animation-easing-standard,cubic-bezier(0.2,0,0,1))}@keyframes ugnd22r{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:ugnd23p;animation-duration:var(--forge-animation-duration-medium2, 300ms);animation-timing-function:var(--forge-animation-easing-standard,cubic-bezier(0.2,0,0,1))}@keyframes ugnd23p{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:ugnd24k;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 ugnd24k{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:ugnd24o;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 ugnd24o{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:ugnd250;animation-duration:var(--forge-animation-duration-medium2, 300ms);animation-timing-function:var(--forge-animation-easing-standard,cubic-bezier(0.2,0,0,1))}@keyframes ugnd250{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:ugnd25a;animation-duration:var(--forge-animation-duration-medium2, 300ms);animation-timing-function:var(--forge-animation-easing-standard,cubic-bezier(0.2,0,0,1))}@keyframes ugnd25a{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:ugnd25j;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 ugnd25j{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:ugnd25q;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 ugnd25q{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
|
/**
|
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
* Copyright Tyler Technologies, Inc.
|
|
4
4
|
* License: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
+
declare const numbers: {
|
|
7
|
+
ARROW_LEFT_KEYCODE: number;
|
|
8
|
+
ARROW_RIGHT_KEYCODE: number;
|
|
9
|
+
END_KEYCODE: number;
|
|
10
|
+
HOME_KEYCODE: number;
|
|
11
|
+
ENTER_KEYCODE: number;
|
|
12
|
+
SPACE_KEYCODE: number;
|
|
13
|
+
};
|
|
6
14
|
export declare const STEPPER_CONSTANTS: {
|
|
7
15
|
elementName: "forge-stepper";
|
|
8
16
|
classes: {
|
|
@@ -50,7 +58,12 @@ export declare const STEPPER_CONSTANTS: {
|
|
|
50
58
|
};
|
|
51
59
|
ACCEPTABLE_KEYS: string[];
|
|
52
60
|
KEYCODE_MAP: {
|
|
53
|
-
[
|
|
61
|
+
[numbers.ARROW_LEFT_KEYCODE]: string;
|
|
62
|
+
[numbers.ARROW_RIGHT_KEYCODE]: string;
|
|
63
|
+
[numbers.END_KEYCODE]: string;
|
|
64
|
+
[numbers.HOME_KEYCODE]: string;
|
|
65
|
+
[numbers.ENTER_KEYCODE]: string;
|
|
66
|
+
[numbers.SPACE_KEYCODE]: string;
|
|
54
67
|
};
|
|
55
68
|
};
|
|
56
69
|
export interface IStepConfiguration {
|
|
@@ -75,3 +88,4 @@ export interface IStepperConfiguration {
|
|
|
75
88
|
}
|
|
76
89
|
export type StepperLayoutMode = 'fixed' | 'clustered';
|
|
77
90
|
export type StepperLayoutAlign = 'left' | 'center' | 'right';
|
|
91
|
+
export {};
|
package/esm/switch/switch.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export interface ISwitchComponent extends IWithFormAssociation, IWithFocusable,
|
|
|
16
16
|
checked: boolean;
|
|
17
17
|
/** @deprecated use `checked` instead */
|
|
18
18
|
on: boolean;
|
|
19
|
-
/** @deprecated use `
|
|
19
|
+
/** @deprecated use `checked` instead */
|
|
20
20
|
selected: boolean;
|
|
21
21
|
defaultChecked: boolean;
|
|
22
22
|
/** @deprecated use `defaultChecked` instead */
|
|
@@ -150,7 +150,11 @@ export declare class SwitchComponent extends SwitchComponent_base implements ISw
|
|
|
150
150
|
labelClickedCallback(): void;
|
|
151
151
|
labelChangedCallback(value: string | null): void;
|
|
152
152
|
/** @ignore */
|
|
153
|
-
setFormValue(value: FormValue
|
|
153
|
+
setFormValue(value: (FormValue & {
|
|
154
|
+
[key: string]: any;
|
|
155
|
+
}) | null, state?: (FormValue & {
|
|
156
|
+
[key: string]: any;
|
|
157
|
+
}) | null | undefined): void;
|
|
154
158
|
/**
|
|
155
159
|
* Gets/sets whether the switch is checked or not.
|
|
156
160
|
* @default false
|
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-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([checked]) .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([checked]) .handle{translate:calc(var(--_switch-track-width) - calc(var(--_switch-track-height)/ 2) * 2)}:host([checked]) .handle::before{scale:var(--_switch-handle-on-scale);box-shadow:var(--_switch-handle-on-elevation);background-color:var(--_switch-handle-on-color)}:host([checked]) .handle .icon__on{opacity:1;scale:var(--_switch-icon-on-scale)}:host([checked]) .handle .icon__off{opacity:0;scale:0.4}:host([checked]) 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])[checked]) .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])[checked]) .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])[checked]) .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.54);--_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([checked]) .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([checked]) .handle{translate:calc(var(--_switch-track-width) - calc(var(--_switch-track-height)/ 2) * 2)}:host([checked]) .handle::before{scale:var(--_switch-handle-on-scale);box-shadow:var(--_switch-handle-on-elevation);background-color:var(--_switch-handle-on-color)}:host([checked]) .handle .icon__on{opacity:1;scale:var(--_switch-icon-on-scale)}:host([checked]) .handle .icon__off{opacity:0;scale:0.4}:host([checked]) 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])[checked]) .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])[checked]) .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])[checked]) .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
|
*
|
package/esm/table/table-core.js
CHANGED
|
@@ -532,8 +532,6 @@ export class TableCore {
|
|
|
532
532
|
this._adapter.setSelectedRows(this._adapter.getTableElement(), this._selectKey, this._data, this._selectionManager.getItems(), preserveExisting);
|
|
533
533
|
if (isAllSelected !== this._isAllSelected || this._isIndeterminate(isAllSelected)) {
|
|
534
534
|
this._isAllSelected = isAllSelected;
|
|
535
|
-
// (derek.moss): while writting test it seemed like this could never be false.
|
|
536
|
-
// maybe an unneeded check
|
|
537
535
|
if (this._multiselect) {
|
|
538
536
|
this._adapter.updateSelectAllState(this._adapter.getTableElement(), this._isAllSelected, this._isIndeterminate(this._isAllSelected));
|
|
539
537
|
}
|
|
@@ -575,6 +573,15 @@ export class TableCore {
|
|
|
575
573
|
* Handles a row being selected/deselected.
|
|
576
574
|
*/
|
|
577
575
|
_onRowSelected(evt) {
|
|
576
|
+
// We handle row selection manually with either a pointerdown or keydown event (space key), so we listen
|
|
577
|
+
// for the change event as well to prevent checking the checkbox being checked by the time the event reaches us
|
|
578
|
+
if (evt.type === 'change') {
|
|
579
|
+
evt.preventDefault();
|
|
580
|
+
return;
|
|
581
|
+
}
|
|
582
|
+
if (evt.type === 'keydown' && evt.key !== ' ') {
|
|
583
|
+
return;
|
|
584
|
+
}
|
|
578
585
|
const rowSelectedInfo = this._getSelectedRowFromEvent(evt);
|
|
579
586
|
// Deselect the previously selected row(s) when not in multiselect mode (only if it's different than the newly selected row)
|
|
580
587
|
if (!this._multiselect) {
|
|
@@ -605,6 +612,7 @@ export class TableCore {
|
|
|
605
612
|
if (this._multiselect) {
|
|
606
613
|
const shift = evt.shiftKey;
|
|
607
614
|
if (shift && this._previouslyClickedRow) {
|
|
615
|
+
document.getSelection()?.removeAllRanges();
|
|
608
616
|
selectionIndexes = this._shiftSelectRows(rowSelectedInfo);
|
|
609
617
|
if (selectionIndexes.includes(this._previouslyClickedRow.index)) {
|
|
610
618
|
const idx = selectionIndexes.indexOf(this._previouslyClickedRow.index);
|
package/esm/table/table-utils.js
CHANGED
|
@@ -500,19 +500,23 @@ export class TableUtils {
|
|
|
500
500
|
const nonExpandedRows = TableUtils._getNonExpandedRows(tbodyElement.rows);
|
|
501
501
|
nonExpandedRows.forEach(row => TableUtils._attachRowSelectListener(row, clickListener));
|
|
502
502
|
}
|
|
503
|
-
static _attachRowSelectListener(row,
|
|
503
|
+
static _attachRowSelectListener(row, listener) {
|
|
504
504
|
const checkboxElement = TableUtils._getCheckboxElement(row);
|
|
505
|
-
checkboxElement?.addEventListener('
|
|
505
|
+
checkboxElement?.addEventListener('change', listener);
|
|
506
|
+
checkboxElement?.addEventListener('keydown', listener);
|
|
507
|
+
checkboxElement?.addEventListener('pointerdown', listener);
|
|
506
508
|
}
|
|
507
509
|
/**
|
|
508
510
|
* Removes the select listeners from every table row.
|
|
509
511
|
* @param tbodyElement The table body element.
|
|
510
512
|
* @param listener The click listener.
|
|
511
513
|
*/
|
|
512
|
-
static _detachRowSelectListeners(tbodyElement,
|
|
514
|
+
static _detachRowSelectListeners(tbodyElement, listener) {
|
|
513
515
|
Array.from(tbodyElement.rows).forEach(row => {
|
|
514
516
|
const checkboxElement = TableUtils._getCheckboxElement(row);
|
|
515
|
-
checkboxElement?.removeEventListener('
|
|
517
|
+
checkboxElement?.removeEventListener('change', listener);
|
|
518
|
+
checkboxElement?.removeEventListener('keydown', listener);
|
|
519
|
+
checkboxElement?.removeEventListener('pointerdown', listener);
|
|
516
520
|
});
|
|
517
521
|
}
|
|
518
522
|
/**
|
|
@@ -49,6 +49,9 @@ export class TabBarCore {
|
|
|
49
49
|
async _onTabsChanged() {
|
|
50
50
|
this._tabs = this._adapter.getTabs();
|
|
51
51
|
this._syncTabState();
|
|
52
|
+
if (this._scrollButtons) {
|
|
53
|
+
this._detectScrollableStatus();
|
|
54
|
+
}
|
|
52
55
|
this._tryScrollActiveTabIntoView();
|
|
53
56
|
}
|
|
54
57
|
_onTabSelected(evt) {
|
|
@@ -47,6 +47,7 @@ declare global {
|
|
|
47
47
|
* @csspart support-text - The support text element.
|
|
48
48
|
* @csspart support-text - The element containing the support text slot.
|
|
49
49
|
* @csspart support-text-end - The element containing the support text end slot.
|
|
50
|
+
* @csspart outline - The element containing the forge-focus-indicator element.
|
|
50
51
|
* @csspart focus-indicator - The focus indicator element.
|
|
51
52
|
*
|
|
52
53
|
* @slot - The default/unnamed slot for the field's input.
|
|
@@ -46,6 +46,7 @@ const styles = ':host{display:block}:host([hidden]){display:none}forge-field{dis
|
|
|
46
46
|
* @csspart support-text - The support text element.
|
|
47
47
|
* @csspart support-text - The element containing the support text slot.
|
|
48
48
|
* @csspart support-text-end - The element containing the support text end slot.
|
|
49
|
+
* @csspart outline - The element containing the forge-focus-indicator element.
|
|
49
50
|
* @csspart focus-indicator - The focus indicator element.
|
|
50
51
|
*
|
|
51
52
|
* @slot - The default/unnamed slot for the field's input.
|
|
@@ -85,7 +85,6 @@ export class TimePickerAdapter extends BaseAdapter {
|
|
|
85
85
|
iconButtonElement.density = 'medium';
|
|
86
86
|
iconButtonElement.type = 'button';
|
|
87
87
|
iconButtonElement.tabIndex = -1;
|
|
88
|
-
iconButtonElement.style.marginRight = '4px'; // Override default trailing slot margin in text-field
|
|
89
88
|
iconButtonElement.setAttribute('aria-label', 'Toggle time dropdown');
|
|
90
89
|
const iconElement = document.createElement(ICON_CONSTANTS.elementName);
|
|
91
90
|
iconElement.name = 'clock_outline';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* License: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { IListDropdownOption } from '../list-dropdown/list-dropdown-constants';
|
|
7
|
-
import
|
|
7
|
+
import { Masked, InputMask, type FactoryArg, type AppendFlags } from 'imask';
|
|
8
8
|
export declare const TIME_PICKER_CONSTANTS: {
|
|
9
9
|
elementName: "forge-time-picker";
|
|
10
10
|
attributes: {
|
|
@@ -48,7 +48,7 @@ export type TimePickerParseCallback = (time: string) => number | null;
|
|
|
48
48
|
export type TimePickerFormatCallback = (value: number | null) => string;
|
|
49
49
|
export type TimePickerCustomOptionCallback<T> = (value: T, use24HourTime: boolean, allowSeconds: boolean) => number;
|
|
50
50
|
export type TimePickerCoercionCallback = (rawValue: string, coercedValue: string, allowSeconds: boolean) => string;
|
|
51
|
-
export type TimePickerPrepareMaskCallback = (value: string, masked: Masked<string>, flags:
|
|
51
|
+
export type TimePickerPrepareMaskCallback = (value: string, masked: Masked<string>, flags: AppendFlags, maskInstance: InputMask<FactoryArg>) => string;
|
|
52
52
|
export interface ITimePickerOption<T = any> extends IListDropdownOption<T> {
|
|
53
53
|
toMilliseconds: TimePickerCustomOptionCallback<T>;
|
|
54
54
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tylertech/forge",
|
|
3
3
|
"description": "Tyler Forge™ Web Components library",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.8.0-dev.0",
|
|
5
5
|
"author": "Tyler Technologies, Inc.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": {
|
|
@@ -13,12 +13,12 @@
|
|
|
13
13
|
"typings": "esm/index.d.ts",
|
|
14
14
|
"sideEffects": false,
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@floating-ui/dom": "^1.6.
|
|
16
|
+
"@floating-ui/dom": "^1.6.13",
|
|
17
17
|
"@tylertech/forge-core": "^3.1.0",
|
|
18
18
|
"@tylertech/tyler-icons": "^1.12.0",
|
|
19
|
-
"imask": "^
|
|
19
|
+
"imask": "^7.6.1",
|
|
20
20
|
"lit": "^3.2.1",
|
|
21
21
|
"tslib": "^2.8.1"
|
|
22
22
|
},
|
|
23
23
|
"customElements": "custom-elements.json"
|
|
24
|
-
}
|
|
24
|
+
}
|
package/sass/badge/badge.scss
CHANGED
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
// Hide
|
|
47
47
|
//
|
|
48
48
|
|
|
49
|
-
:host([hide]) {
|
|
49
|
+
:host(:where([hide], :state(hidden))) {
|
|
50
50
|
.forge-badge {
|
|
51
51
|
@include hide;
|
|
52
52
|
}
|
|
@@ -56,12 +56,12 @@
|
|
|
56
56
|
// Dot
|
|
57
57
|
//
|
|
58
58
|
|
|
59
|
-
:host([dot]) {
|
|
59
|
+
:host(:where([dot], :state(dot))) {
|
|
60
60
|
.forge-badge {
|
|
61
61
|
@include dot;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
.
|
|
64
|
+
.content > slot {
|
|
65
65
|
display: none;
|
|
66
66
|
}
|
|
67
67
|
}
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
:host([strong][theme='#{$theme}']) {
|
|
82
|
+
:host(:where([strong], :state(strong))[theme='#{$theme}']) {
|
|
83
83
|
.forge-badge {
|
|
84
84
|
@include override(background, theme.variable($theme), value);
|
|
85
85
|
@include override(color, theme.variable(on-#{$theme}), value);
|
|
@@ -88,13 +88,13 @@
|
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
// Map both "error" and "danger" for backwards compatibility with legacy "danger" theme
|
|
91
|
-
:host(:not([strong]):is([theme='error'], [theme='danger'])) {
|
|
91
|
+
:host(:not(:where([strong], :state(strong))):is([theme='error'], [theme='danger'])) {
|
|
92
92
|
.forge-badge {
|
|
93
93
|
@include override(background, theme.variable(error-container-low), value);
|
|
94
94
|
@include override(color, theme.variable(error), value);
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
-
:host([strong]:is([theme='error'], [theme='danger'])) {
|
|
97
|
+
:host(:where([strong], :state(strong)):is([theme='error'], [theme='danger'])) {
|
|
98
98
|
.forge-badge {
|
|
99
99
|
@include override(background, theme.variable(error), value);
|
|
100
100
|
@include override(color, theme.variable(on-error), value);
|
|
@@ -102,13 +102,13 @@
|
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
// Map both "info" and "info-primary" for backwards compatibility with "info" theme
|
|
105
|
-
:host(:not([strong]):is([theme='info'], [theme='info-primary'])) {
|
|
105
|
+
:host(:not(:where([strong], :state(strong))):is([theme='info'], [theme='info-primary'])) {
|
|
106
106
|
.forge-badge {
|
|
107
107
|
@include override(background, theme.variable(info-container), value);
|
|
108
108
|
@include override(color, theme.variable(on-info-container), value);
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
|
-
:host([strong]:is([theme='info'], [theme='info-primary'])) {
|
|
111
|
+
:host(:where([strong], :state(strong)):is([theme='info'], [theme='info-primary'])) {
|
|
112
112
|
.forge-badge {
|
|
113
113
|
@include override(background, theme.variable(info), value);
|
|
114
114
|
@include override(color, theme.variable(on-info), value);
|
|
@@ -116,13 +116,13 @@
|
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
// Support "info-secondary" separately since it is not a core theme
|
|
119
|
-
:host(:not([strong])[theme='info-secondary']) {
|
|
119
|
+
:host(:not(:where([strong], :state(strong)))[theme='info-secondary']) {
|
|
120
120
|
.forge-badge {
|
|
121
121
|
@include override(background, theme.variable(surface-container-low), value);
|
|
122
122
|
@include override(color, theme.variable(on-surface-container-low), value);
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
|
-
:host([strong][theme='info-secondary']) {
|
|
125
|
+
:host(:where([strong], :state(strong))[theme='info-secondary']) {
|
|
126
126
|
.forge-badge {
|
|
127
127
|
@include override(background, theme.variable(surface-inverse), value);
|
|
128
128
|
@include override(color, theme.variable(on-surface-inverse), value);
|
package/sass/button/_core.scss
CHANGED
|
@@ -10,8 +10,9 @@ $row-gap: 2px;
|
|
|
10
10
|
$date-gap: 2px;
|
|
11
11
|
$today-border-width: 1px;
|
|
12
12
|
$event-dot-size: 12px;
|
|
13
|
-
$theme-base-strings:
|
|
14
|
-
|
|
13
|
+
$theme-base-strings:
|
|
14
|
+
primary, secondary, blue, light-green, cyan, teal, orange, blue-grey, grey, red, pink, purple, light-blue, deep-purple, green, lime, yellow, brown,
|
|
15
|
+
deep-orange;
|
|
15
16
|
$theme-values: (
|
|
16
17
|
// primary theme
|
|
17
18
|
event-primary-background: material-color-palette.$indigo-100,
|
package/sass/card/card.scss
CHANGED
|
@@ -19,7 +19,7 @@ $tokens: (
|
|
|
19
19
|
text-color: utils.module-ref(button, text-color, primary-color),
|
|
20
20
|
disabled-color: utils.module-val(button, disabled-color, theme.variable(surface-container)),
|
|
21
21
|
padding: utils.module-val(button, padding, spacing.variable(medium)),
|
|
22
|
-
display: utils.module-val(button, display, inline-
|
|
22
|
+
display: utils.module-val(button, display, inline-grid),
|
|
23
23
|
justify: utils.module-val(button, justify, center),
|
|
24
24
|
shape: utils.module-val(button, shape, shape.variable(medium)),
|
|
25
25
|
// Base
|
|
@@ -33,7 +33,7 @@ $tokens: (
|
|
|
33
33
|
shape-start-end-radius: utils.module-ref(button, shape-start-end-radius, shape),
|
|
34
34
|
shape-end-start-radius: utils.module-ref(button, shape-end-start-radius, shape),
|
|
35
35
|
shape-end-end-radius: utils.module-ref(button, shape-end-end-radius, shape),
|
|
36
|
-
padding-block: utils.module-ref(button, padding-block,
|
|
36
|
+
padding-block: utils.module-ref(button, padding-block, 0),
|
|
37
37
|
padding-inline: utils.module-ref(button, padding-inline, padding),
|
|
38
38
|
background: utils.module-val(button, background, transparent),
|
|
39
39
|
hover-background: utils.module-ref(button, hover-background, background),
|
|
@@ -37,10 +37,16 @@ $tokens: (
|
|
|
37
37
|
with-overlap-handle-outline-width: utils.module-val(slider, with-overlap-handle-outline-width, 1px),
|
|
38
38
|
with-tick-marks-active-container-color: utils.module-val(slider, with-tick-marks-active-container-color, theme.variable(on-primary)),
|
|
39
39
|
with-tick-marks-container-size: utils.module-val(slider, with-tick-marks-container-size, 2px),
|
|
40
|
-
with-tick-marks-disabled-active-container-color:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
with-tick-marks-disabled-active-container-color: utils.module-val(
|
|
41
|
+
slider,
|
|
42
|
+
with-tick-marks-disabled-active-container-color,
|
|
43
|
+
theme.variable(on-surface-container-high)
|
|
44
|
+
),
|
|
45
|
+
with-tick-marks-disabled-inactive-container-color: utils.module-val(
|
|
46
|
+
slider,
|
|
47
|
+
with-tick-marks-disabled-inactive-container-color,
|
|
48
|
+
theme.variable(on-surface-container-high)
|
|
49
|
+
),
|
|
44
50
|
with-tick-marks-inactive-container-color: utils.module-val(slider, with-tick-marks-inactive-container-color, theme.variable(primary))
|
|
45
51
|
) !default;
|
|
46
52
|
|
|
@@ -63,7 +63,7 @@ $tokens: (
|
|
|
63
63
|
state-layer-dense-width: utils.module-ref(switch, state-layer-dense-width, state-layer-dense-size),
|
|
64
64
|
state-layer-dense-height: utils.module-ref(switch, state-layer-dense-height, state-layer-dense-size),
|
|
65
65
|
// Disabled
|
|
66
|
-
disabled-opacity: utils.module-val(switch, disabled-opacity, theme.emphasis(medium
|
|
66
|
+
disabled-opacity: utils.module-val(switch, disabled-opacity, theme.emphasis(medium)),
|
|
67
67
|
// Active
|
|
68
68
|
handle-active-on-color: utils.module-ref(switch, handle-active-on-color, handle-on-color),
|
|
69
69
|
handle-active-off-color: utils.module-ref(switch, handle-active-off-color, handle-off-color),
|
package/sass/dialog/dialog.scss
CHANGED
package/sass/field/_core.scss
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
@mixin base {
|
|
26
26
|
/* Internal custom properties */
|
|
27
|
-
@include override(disableable-cursor,
|
|
27
|
+
@include override(disableable-cursor, auto, value);
|
|
28
28
|
@include override(disableable-opacity, 1, value);
|
|
29
29
|
@include override(inner-border-block-size, 100%, value);
|
|
30
30
|
@include override(inner-border-color, #{token(outline-color, custom)}, value);
|
package/sass/field/field.scss
CHANGED
|
@@ -35,9 +35,13 @@ $_host-tokens: [track-height];
|
|
|
35
35
|
// State vars
|
|
36
36
|
#{declare(track-dot-size)}: calc(#{token(track-height)} / 2);
|
|
37
37
|
#{declare(track-background-width)}: calc(#{token(track-dot-size, custom)} * 5);
|
|
38
|
-
#{declare(track-background)}: 0 / #{token(track-background-width, custom)} 100%
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
#{declare(track-background)}: 0 / #{token(track-background-width, custom)} 100%
|
|
39
|
+
radial-gradient(
|
|
40
|
+
circle at calc(#{token(track-dot-size, custom)} * 2),
|
|
41
|
+
#{token(track-color)} 0,
|
|
42
|
+
#{token(track-color)} #{token(track-dot-size, custom)},
|
|
43
|
+
transparent #{token(track-dot-size, custom)}
|
|
44
|
+
);
|
|
41
45
|
}
|
|
42
46
|
|
|
43
47
|
.forge-linear-progress {
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
padding-inline: 0;
|
|
44
44
|
margin: 0;
|
|
45
45
|
box-sizing: border-box;
|
|
46
|
+
width: 100%;
|
|
46
47
|
|
|
47
48
|
background: transparent;
|
|
48
49
|
color: inherit;
|
|
@@ -53,8 +54,15 @@
|
|
|
53
54
|
text-align: inherit;
|
|
54
55
|
letter-spacing: inherit;
|
|
55
56
|
word-spacing: inherit;
|
|
57
|
+
white-space: nowrap;
|
|
58
|
+
text-overflow: ellipsis;
|
|
59
|
+
overflow: hidden;
|
|
56
60
|
|
|
57
|
-
display:
|
|
61
|
+
display: block;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
@mixin button-wrap {
|
|
65
|
+
white-space: normal;
|
|
58
66
|
}
|
|
59
67
|
|
|
60
68
|
@mixin anchor {
|
|
@@ -157,7 +157,7 @@ slot[name='tertiary-text'] {
|
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
// Button slotted elements
|
|
160
|
-
::slotted(:is(button
|
|
160
|
+
::slotted(:is(button:not([slot]), [forge-list-item-button])) {
|
|
161
161
|
@include button;
|
|
162
162
|
}
|
|
163
163
|
|
|
@@ -216,6 +216,10 @@ slot[name='tertiary-text'] {
|
|
|
216
216
|
@include text-container-wrap;
|
|
217
217
|
}
|
|
218
218
|
|
|
219
|
+
::slotted(:is(button, [role='button'][tabindex], [forge-list-item-button])) {
|
|
220
|
+
@include button-wrap;
|
|
221
|
+
}
|
|
222
|
+
|
|
219
223
|
slot[name='secondary-text'],
|
|
220
224
|
slot[name='tertiary-text'] {
|
|
221
225
|
&::slotted(*) {
|
package/sass/slider/_core.scss
CHANGED
|
@@ -45,9 +45,8 @@ $_active-track-end-clip: calc(#{$_active-track-end-offset} + #{$_active-track-ma
|
|
|
45
45
|
// Clip the inputs to the space left/right of the center point between the
|
|
46
46
|
// values so the right input gets pointer events.
|
|
47
47
|
$_clip-to-start: calc(
|
|
48
|
-
#{token(state-layer-size)} / 2 + (100% - #{token(state-layer-size)}) *
|
|
49
|
-
|
|
50
|
-
) / 2))
|
|
48
|
+
#{token(state-layer-size)} / 2 + (100% - #{token(state-layer-size)}) *
|
|
49
|
+
(#{token(start-fraction, custom)} + ((#{token(end-fraction, custom)} - #{token(start-fraction, custom)}) / 2))
|
|
51
50
|
);
|
|
52
51
|
|
|
53
52
|
$_clip-to-end: calc(100% - $_clip-to-start);
|