@tylertech/forge 3.2.0 → 3.3.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 +104 -27
- package/dist/chips/forge-chips.css +1 -0
- package/dist/field/forge-field.css +2 -0
- package/dist/inline-message/forge-inline-message.css +2 -0
- package/dist/lib.js +1 -1
- package/dist/lib.js.map +3 -3
- package/dist/vscode.css-custom-data.json +5 -0
- package/dist/vscode.html-custom-data.json +11 -1
- package/esm/app-bar/app-bar/app-bar.d.ts +2 -0
- package/esm/app-bar/app-bar/app-bar.js +2 -0
- package/esm/autocomplete/autocomplete-adapter.js +1 -7
- package/esm/button/base/base-button-adapter.js +1 -1
- package/esm/chip-field/chip-field.js +1 -1
- package/esm/chips/chip/chip.d.ts +1 -0
- package/esm/chips/chip/chip.js +2 -1
- package/esm/circular-progress/circular-progress.js +1 -1
- package/esm/field/field-adapter.d.ts +2 -0
- package/esm/field/field-adapter.js +4 -0
- package/esm/field/field-core.js +1 -0
- package/esm/field/field.js +1 -1
- package/esm/inline-message/inline-message.js +1 -1
- package/esm/paginator/paginator.js +1 -1
- package/esm/select/select/select.js +1 -1
- package/esm/skip-link/skip-link-constants.d.ts +2 -0
- package/esm/skip-link/skip-link-constants.js +2 -1
- package/esm/skip-link/skip-link.d.ts +36 -12
- package/esm/skip-link/skip-link.js +55 -12
- package/esm/tabs/tab/tab-constants.d.ts +1 -3
- package/esm/tabs/tab/tab-constants.js +1 -3
- package/esm/tabs/tab/tab.d.ts +1 -1
- package/esm/tabs/tab/tab.js +1 -1
- package/esm/tabs/tab-bar/tab-bar-core.js +2 -1
- package/esm/tabs/tab-bar/tab-bar.d.ts +1 -1
- package/esm/tabs/tab-bar/tab-bar.js +1 -1
- package/esm/text-field/text-field-adapter.d.ts +8 -4
- package/esm/text-field/text-field-adapter.js +9 -4
- package/esm/text-field/text-field-constants.d.ts +2 -0
- package/esm/text-field/text-field-constants.js +2 -0
- package/esm/text-field/text-field-core.d.ts +2 -0
- package/esm/text-field/text-field-core.js +10 -3
- package/package.json +1 -1
- package/sass/chip-field/chip-field.scss +2 -1
- package/sass/chips/chip/chip.scss +1 -1
- package/sass/circular-progress/_core.scss +2 -2
- package/sass/core/styles/tokens/chips/chip/_tokens.scss +1 -0
- package/sass/field/_core.scss +1 -0
- package/sass/field/field.scss +1 -1
- package/sass/field/forge-field.scss +3 -1
- package/sass/inline-message/_core.scss +2 -0
|
@@ -8,7 +8,7 @@ import { customElement, attachShadowTemplate, toggleAttribute } from '@tylertech
|
|
|
8
8
|
import { BaseComponent } from '../core/base/base-component';
|
|
9
9
|
import { INLINE_MESSAGE_CONSTANTS } from './inline-message-constants';
|
|
10
10
|
const template = '<template><div class=\"forge-inline-message\" part=\"root\"><slot name=\"icon\"></slot><div class=\"container\" part=\"container\"><slot name=\"title\"></slot><slot></slot></div></div></template>';
|
|
11
|
-
const styles = ':host{display:block}:host([hidden]){display:none}.forge-inline-message{--_inline-message-background:var(--forge-inline-message-background, var(--forge-theme-info-container-low, #e3edf7));--_inline-message-color:var(--forge-inline-message-color, var(--forge-theme-text-high, rgba(0, 0, 0, 0.87)));--_inline-message-shape:var(--forge-inline-message-shape, calc(var(--forge-shape-medium, 4px) * var(--forge-shape-factor, 1)));--_inline-message-padding:var(--forge-inline-message-padding, var(--forge-spacing-small, 12px));--_inline-message-padding-inline:var(--forge-inline-message-padding-inline, var(--_inline-message-padding));--_inline-message-padding-block:var(--forge-inline-message-padding-block, var(--_inline-message-padding));--_inline-message-border-width:var(--forge-inline-message-border-width, var(--forge-border-thin, 1px));--_inline-message-border-style:var(--forge-inline-message-border-style, none);--_inline-message-border-color:var(--forge-inline-message-border-color, var(--forge-theme-info-container, #c7daf0));--_inline-message-gap:var(--forge-inline-message-gap, var(--forge-spacing-small, 12px));--_inline-message-icon-gap:var(--forge-inline-message-icon-gap, var(--_inline-message-gap));--_inline-message-content-gap:var(--forge-inline-message-content-gap, var(--_inline-message-gap));--_inline-message-icon-color:var(--forge-inline-message-icon-color, var(--forge-theme-on-info-container-low, #0b3768))}.forge-inline-message{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--forge-typography-body1-font-family, var(--forge-typography-font-family, \"Roboto\", sans-serif));font-size:var(--forge-typography-body1-font-size, calc(var(--forge-typography-font-size, 1rem) * var(--forge-typography-body-font-size-scale, .875)));font-weight:var(--forge-typography-body1-font-weight,400);line-height:var(--forge-typography-body1-line-height, calc(var(--forge-typography-font-size, 1rem) * var(--forge-typography-body-line-height-scale, 1.125)));letter-spacing:var(--forge-typography-body1-letter-spacing, .0357142857em);text-transform:var(--forge-typography-body1-text-transform,inherit);text-decoration:var(--forge-typography-body1-text-decoration,inherit);background:var(--_inline-message-background);color:var(--_inline-message-color);border-radius:var(--_inline-message-shape);border-width:var(--_inline-message-border-width);border-style:var(--_inline-message-border-style);border-color:var(--_inline-message-border-color);display:flex;gap:var(--_inline-message-icon-gap);box-sizing:border-box;padding-inline:var(--_inline-message-padding-inline);padding-block:var(--_inline-message-padding-block)}.forge-inline-message .container{display:flex;flex-direction:column;gap:var(--_inline-message-content-gap)}::slotted(*){margin:0}::slotted([slot=title]){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--forge-typography-heading1-font-family, var(--forge-typography-font-family, \"Roboto\", sans-serif));font-size:var(--forge-typography-heading1-font-size, calc(var(--forge-typography-font-size, 1rem) * var(--forge-typography-heading1-font-size-scale, .875)));font-weight:var(--forge-typography-heading1-font-weight,500);line-height:var(--forge-typography-heading1-line-height, calc(var(--forge-typography-font-size, 1rem) * var(--forge-typography-heading1-line-height-scale, 1.125)));letter-spacing:var(--forge-typography-heading1-letter-spacing, .0178571429em);text-transform:var(--forge-typography-heading1-text-transform,inherit);text-decoration:var(--forge-typography-heading1-text-decoration,inherit)}::slotted([slot=icon]){color:var(--_inline-message-icon-color)}:host([theme=primary]) .forge-inline-message{--_inline-message-background:var(--forge-inline-message-background, var(--forge-theme-primary-container-low, #e8eaf6));--_inline-message-icon-color:var(--forge-inline-message-icon-color, var(--forge-theme-on-primary-container-low, #222c62));--_inline-message-border-color:var(--forge-inline-message-border-color, var(--forge-theme-primary-container, #d1d5ed))}:host([theme=secondary]) .forge-inline-message{--_inline-message-background:var(--forge-inline-message-background, var(--forge-theme-secondary-container, #fff0c3));--_inline-message-icon-color:var(--forge-inline-message-icon-color, var(--forge-theme-on-secondary-container, #8a6804));--_inline-message-border-color:var(--forge-inline-message-border-color, var(--forge-theme-secondary, #ffc107))}:host([theme=tertiary]) .forge-inline-message{--_inline-message-background:var(--forge-inline-message-background, var(--forge-theme-tertiary-container-low, #e8ebff));--_inline-message-icon-color:var(--forge-inline-message-icon-color, var(--forge-theme-on-tertiary-container-low, #213189));--_inline-message-border-color:var(--forge-inline-message-border-color, var(--forge-theme-tertiary-container, #d0d7ff))}:host([theme=success]) .forge-inline-message{--_inline-message-background:var(--forge-inline-message-background, var(--forge-theme-success-container-low, #e6efe6));--_inline-message-icon-color:var(--forge-inline-message-icon-color, var(--forge-theme-on-success-container-low, #19441b));--_inline-message-border-color:var(--forge-inline-message-border-color, var(--forge-theme-success-container, #cde0ce))}:host([theme=warning]) .forge-inline-message{--_inline-message-background:var(--forge-inline-message-background, var(--forge-theme-warning-container-low, #f9e9e0));--_inline-message-icon-color:var(--forge-inline-message-icon-color, var(--forge-theme-on-warning-container-low, #712700));--_inline-message-border-color:var(--forge-inline-message-border-color, var(--forge-theme-warning-container, #f4d3c2))}:host(:is([theme=error],[theme=danger])) .forge-inline-message{--_inline-message-background:var(--forge-inline-message-background, var(--forge-theme-error-container-low, #f6e0e4));--_inline-message-icon-color:var(--forge-inline-message-icon-color, var(--forge-theme-on-error-container-low, #5f0011));--_inline-message-border-color:var(--forge-inline-message-border-color, var(--forge-theme-error-container, #ecc2c9))}:host([theme=info-secondary]) .forge-inline-message{--_inline-message-background:var(--forge-inline-message-background, var(--forge-theme-surface-container-low, #ebebeb));--_inline-message-icon-color:var(--forge-inline-message-icon-color, var(--forge-theme-on-surface-container-low, #000000));--_inline-message-border-color:var(--forge-inline-message-border-color, var(--forge-theme-surface-container, #e0e0e0))}';
|
|
11
|
+
const styles = ':host{display:block}:host([hidden]){display:none}.forge-inline-message{--_inline-message-background:var(--forge-inline-message-background, var(--forge-theme-info-container-low, #e3edf7));--_inline-message-color:var(--forge-inline-message-color, var(--forge-theme-text-high, rgba(0, 0, 0, 0.87)));--_inline-message-shape:var(--forge-inline-message-shape, calc(var(--forge-shape-medium, 4px) * var(--forge-shape-factor, 1)));--_inline-message-padding:var(--forge-inline-message-padding, var(--forge-spacing-small, 12px));--_inline-message-padding-inline:var(--forge-inline-message-padding-inline, var(--_inline-message-padding));--_inline-message-padding-block:var(--forge-inline-message-padding-block, var(--_inline-message-padding));--_inline-message-border-width:var(--forge-inline-message-border-width, var(--forge-border-thin, 1px));--_inline-message-border-style:var(--forge-inline-message-border-style, none);--_inline-message-border-color:var(--forge-inline-message-border-color, var(--forge-theme-info-container, #c7daf0));--_inline-message-gap:var(--forge-inline-message-gap, var(--forge-spacing-small, 12px));--_inline-message-icon-gap:var(--forge-inline-message-icon-gap, var(--_inline-message-gap));--_inline-message-content-gap:var(--forge-inline-message-content-gap, var(--_inline-message-gap));--_inline-message-icon-color:var(--forge-inline-message-icon-color, var(--forge-theme-on-info-container-low, #0b3768))}.forge-inline-message{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--forge-typography-body1-font-family, var(--forge-typography-font-family, \"Roboto\", sans-serif));font-size:var(--forge-typography-body1-font-size, calc(var(--forge-typography-font-size, 1rem) * var(--forge-typography-body-font-size-scale, .875)));font-weight:var(--forge-typography-body1-font-weight,400);line-height:var(--forge-typography-body1-line-height, calc(var(--forge-typography-font-size, 1rem) * var(--forge-typography-body-line-height-scale, 1.125)));letter-spacing:var(--forge-typography-body1-letter-spacing, .0357142857em);text-transform:var(--forge-typography-body1-text-transform,inherit);text-decoration:var(--forge-typography-body1-text-decoration,inherit);background:var(--_inline-message-background);color:var(--_inline-message-color);border-radius:var(--_inline-message-shape);border-width:var(--_inline-message-border-width);border-style:var(--_inline-message-border-style);border-color:var(--_inline-message-border-color);display:flex;align-items:center;gap:var(--_inline-message-icon-gap);box-sizing:border-box;padding-inline:var(--_inline-message-padding-inline);padding-block:var(--_inline-message-padding-block)}.forge-inline-message .container{display:flex;flex-direction:column;gap:var(--_inline-message-content-gap)}::slotted(*){margin:0}::slotted([slot=title]){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--forge-typography-heading1-font-family, var(--forge-typography-font-family, \"Roboto\", sans-serif));font-size:var(--forge-typography-heading1-font-size, calc(var(--forge-typography-font-size, 1rem) * var(--forge-typography-heading1-font-size-scale, .875)));font-weight:var(--forge-typography-heading1-font-weight,500);line-height:var(--forge-typography-heading1-line-height, calc(var(--forge-typography-font-size, 1rem) * var(--forge-typography-heading1-line-height-scale, 1.125)));letter-spacing:var(--forge-typography-heading1-letter-spacing, .0178571429em);text-transform:var(--forge-typography-heading1-text-transform,inherit);text-decoration:var(--forge-typography-heading1-text-decoration,inherit)}::slotted([slot=icon]){color:var(--_inline-message-icon-color);align-self:start}:host([theme=primary]) .forge-inline-message{--_inline-message-background:var(--forge-inline-message-background, var(--forge-theme-primary-container-low, #e8eaf6));--_inline-message-icon-color:var(--forge-inline-message-icon-color, var(--forge-theme-on-primary-container-low, #222c62));--_inline-message-border-color:var(--forge-inline-message-border-color, var(--forge-theme-primary-container, #d1d5ed))}:host([theme=secondary]) .forge-inline-message{--_inline-message-background:var(--forge-inline-message-background, var(--forge-theme-secondary-container, #fff0c3));--_inline-message-icon-color:var(--forge-inline-message-icon-color, var(--forge-theme-on-secondary-container, #8a6804));--_inline-message-border-color:var(--forge-inline-message-border-color, var(--forge-theme-secondary, #ffc107))}:host([theme=tertiary]) .forge-inline-message{--_inline-message-background:var(--forge-inline-message-background, var(--forge-theme-tertiary-container-low, #e8ebff));--_inline-message-icon-color:var(--forge-inline-message-icon-color, var(--forge-theme-on-tertiary-container-low, #213189));--_inline-message-border-color:var(--forge-inline-message-border-color, var(--forge-theme-tertiary-container, #d0d7ff))}:host([theme=success]) .forge-inline-message{--_inline-message-background:var(--forge-inline-message-background, var(--forge-theme-success-container-low, #e6efe6));--_inline-message-icon-color:var(--forge-inline-message-icon-color, var(--forge-theme-on-success-container-low, #19441b));--_inline-message-border-color:var(--forge-inline-message-border-color, var(--forge-theme-success-container, #cde0ce))}:host([theme=warning]) .forge-inline-message{--_inline-message-background:var(--forge-inline-message-background, var(--forge-theme-warning-container-low, #f9e9e0));--_inline-message-icon-color:var(--forge-inline-message-icon-color, var(--forge-theme-on-warning-container-low, #712700));--_inline-message-border-color:var(--forge-inline-message-border-color, var(--forge-theme-warning-container, #f4d3c2))}:host(:is([theme=error],[theme=danger])) .forge-inline-message{--_inline-message-background:var(--forge-inline-message-background, var(--forge-theme-error-container-low, #f6e0e4));--_inline-message-icon-color:var(--forge-inline-message-icon-color, var(--forge-theme-on-error-container-low, #5f0011));--_inline-message-border-color:var(--forge-inline-message-border-color, var(--forge-theme-error-container, #ecc2c9))}:host([theme=info-secondary]) .forge-inline-message{--_inline-message-background:var(--forge-inline-message-background, var(--forge-theme-surface-container-low, #ebebeb));--_inline-message-icon-color:var(--forge-inline-message-icon-color, var(--forge-theme-on-surface-container-low, #000000));--_inline-message-border-color:var(--forge-inline-message-border-color, var(--forge-theme-surface-container, #e0e0e0))}';
|
|
12
12
|
/**
|
|
13
13
|
* @tag forge-inline-message
|
|
14
14
|
*
|
|
@@ -14,7 +14,7 @@ import { SelectComponent } from '../select/select';
|
|
|
14
14
|
import { IconRegistry } from '../icon/icon-registry';
|
|
15
15
|
import { BaseComponent } from '../core/base/base-component';
|
|
16
16
|
import { TooltipComponent } from '../tooltip/tooltip';
|
|
17
|
-
const template = '<template><div class=\"forge-paginator\" part=\"root\"><div class=\"container\" part=\"container\"><div class=\"label\" part=\"label\" id=\"label\"><slot name=\"label\"></slot></div><forge-select class=\"page-size-options\" aria-labelledby=\"label\" label-position=\"none\" density=\"extra-small\" part=\"page-size-options\"></forge-select><div class=\"range-label\" part=\"range-label\"><slot name=\"range-label\"></slot></div></div><div class=\"actions\" part=\"actions\"><div id=\"first-page-container\"><forge-icon-button class=\"first-page\" part=\"first-page-button\" part=\"first-page-button-element\"><forge-icon name=\"first_page\" part=\"first-page-icon\"></forge-icon></forge-icon-button><forge-tooltip type=\"label\" placement=\"top\"><slot name=\"first-page-tooltip\">Go to the first page</slot></forge-tooltip></div><div id=\"previous-page-container\"><forge-icon-button class=\"previous-page\" part=\"previous-page-button\" part=\"previous-page-button-element\"><forge-icon name=\"keyboard_arrow_left\" part=\"previous-page-button-icon\"></forge-icon></forge-icon-button><forge-tooltip type=\"label\" placement=\"top\"><slot name=\"previous-page-tooltip\">Go to the previous page</slot></forge-tooltip></div><div class=\"alternative-range-label\" part=\"alternative-range-label\"><slot name=\"alternative-range-label\"></slot></div><div id=\"next-page-container\"><forge-icon-button class=\"next-page\" part=\"next-page-button\" part=\"next-page-button-element\"><forge-icon name=\"keyboard_arrow_right\" part=\"next-page-icon\"></forge-icon></forge-icon-button><forge-tooltip type=\"label\" placement=\"top\"><slot name=\"next-page-tooltip\">Go to the next page</slot></forge-tooltip></div><div id=\"last-page-container\"><forge-icon-button class=\"last-page\" part=\"last-page-button\" part=\"last-page-button-element\"><forge-icon name=\"last_page\" part=\"last-page-icon\"></forge-icon></forge-icon-button><forge-tooltip type=\"label\" placement=\"top\"><slot name=\"last-page-tooltip\">Go to the last page</slot></forge-tooltip></div></div></div></template>';
|
|
17
|
+
const template = '<template><div class=\"forge-paginator\" part=\"root\" forge-popover-host><div class=\"container\" part=\"container\"><div class=\"label\" part=\"label\" id=\"label\"><slot name=\"label\"></slot></div><forge-select class=\"page-size-options\" aria-labelledby=\"label\" label-position=\"none\" density=\"extra-small\" part=\"page-size-options\"></forge-select><div class=\"range-label\" part=\"range-label\"><slot name=\"range-label\"></slot></div></div><div class=\"actions\" part=\"actions\"><div id=\"first-page-container\"><forge-icon-button class=\"first-page\" part=\"first-page-button\" part=\"first-page-button-element\"><forge-icon name=\"first_page\" part=\"first-page-icon\"></forge-icon></forge-icon-button><forge-tooltip type=\"label\" placement=\"top\"><slot name=\"first-page-tooltip\">Go to the first page</slot></forge-tooltip></div><div id=\"previous-page-container\"><forge-icon-button class=\"previous-page\" part=\"previous-page-button\" part=\"previous-page-button-element\"><forge-icon name=\"keyboard_arrow_left\" part=\"previous-page-button-icon\"></forge-icon></forge-icon-button><forge-tooltip type=\"label\" placement=\"top\"><slot name=\"previous-page-tooltip\">Go to the previous page</slot></forge-tooltip></div><div class=\"alternative-range-label\" part=\"alternative-range-label\"><slot name=\"alternative-range-label\"></slot></div><div id=\"next-page-container\"><forge-icon-button class=\"next-page\" part=\"next-page-button\" part=\"next-page-button-element\"><forge-icon name=\"keyboard_arrow_right\" part=\"next-page-icon\"></forge-icon></forge-icon-button><forge-tooltip type=\"label\" placement=\"top\"><slot name=\"next-page-tooltip\">Go to the next page</slot></forge-tooltip></div><div id=\"last-page-container\"><forge-icon-button class=\"last-page\" part=\"last-page-button\" part=\"last-page-button-element\"><forge-icon name=\"last_page\" part=\"last-page-icon\"></forge-icon></forge-icon-button><forge-tooltip type=\"label\" placement=\"top\"><slot name=\"last-page-tooltip\">Go to the last page</slot></forge-tooltip></div></div></div></template>';
|
|
18
18
|
const styles = ':host{display:block}:host([hidden]){display:none}.forge-paginator{display:flex;gap:var(--forge-spacing-xsmall,8px)}.container{display:flex;gap:var(--forge-spacing-medium,16px);align-items:center}.alternative-range-label,.label,.range-label{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--forge-typography-label1-font-family, var(--forge-typography-font-family, \"Roboto\", sans-serif));font-size:var(--forge-typography-label1-font-size, calc(var(--forge-typography-font-size, 1rem) * var(--forge-typography-label-font-size-scale, .75)));font-weight:var(--forge-typography-label1-font-weight,400);line-height:var(--forge-typography-label1-line-height, calc(var(--forge-typography-font-size, 1rem) * var(--forge-typography-label-line-height-scale, 1.25)));letter-spacing:var(--forge-typography-label1-letter-spacing, .0357142857em);text-transform:var(--forge-typography-label1-text-transform,inherit);text-decoration:var(--forge-typography-label1-text-decoration,inherit)}.actions{display:flex;align-items:center}.alternative-range-label{display:none}:host([alternative]) .alternative-range-label{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--forge-typography-body1-font-family, var(--forge-typography-font-family, \"Roboto\", sans-serif));font-size:var(--forge-typography-body1-font-size, calc(var(--forge-typography-font-size, 1rem) * var(--forge-typography-body-font-size-scale, .875)));font-weight:var(--forge-typography-body1-font-weight,400);line-height:var(--forge-typography-body1-line-height, calc(var(--forge-typography-font-size, 1rem) * var(--forge-typography-body-line-height-scale, 1.125)));letter-spacing:var(--forge-typography-body1-letter-spacing, .0357142857em);text-transform:var(--forge-typography-body1-text-transform,inherit);text-decoration:var(--forge-typography-body1-text-decoration,inherit);display:inline-block}:host([alternative]) .container{display:none}:host([alternative]) .actions{width:100%;justify-content:var(--forge-paginator-alternative-alignment,start)}';
|
|
19
19
|
/**
|
|
20
20
|
* @tag forge-paginator
|
|
@@ -27,7 +27,7 @@ import { OptionGroupComponent } from '../option-group';
|
|
|
27
27
|
import { SelectAdapter } from './select-adapter';
|
|
28
28
|
import { SELECT_CONSTANTS } from './select-constants';
|
|
29
29
|
import { SelectCore } from './select-core';
|
|
30
|
-
const template = '<template><forge-field id=\"field\" popover-icon focus-indicator-allow-focus focus-indicator-focus-mode=\"focus\"><label id=\"select-label\" aria-hidden=\"true\" part=\"label\"></label><slot slot=\"start\" name=\"start\"></slot><div data-forge-field-input class=\"selected-text-container\" part=\"text-container\" aria-live=\"assertive\" aria-atomic=\"true\"><slot name=\"value\"><span id=\"selected-text\" class=\"selected-text\" part=\"text\"></span></slot></div><slot slot=\"end\" name=\"end\"></slot><slot slot=\"accessory\" name=\"accessory\"></slot><slot slot=\"support-text\" name=\"support-text\"></slot><slot slot=\"support-text-end\" name=\"support-text-end\"></slot><slot slot=\"start\" name=\"leading\"></slot><slot slot=\"end\" name=\"trailing\"></slot><slot slot=\"accessory\" name=\"addon-end\"></slot><slot slot=\"support-text\" name=\"helper-text\"></slot></forge-field></template>';
|
|
30
|
+
const template = '<template><forge-field id=\"field\" popover-icon focus-indicator-allow-focus focus-indicator-focus-mode=\"focus\"><label id=\"select-label\" aria-hidden=\"true\" part=\"label\" slot=\"label\"></label><slot slot=\"start\" name=\"start\"></slot><div data-forge-field-input class=\"selected-text-container\" part=\"text-container\" aria-live=\"assertive\" aria-atomic=\"true\"><slot name=\"value\"><span id=\"selected-text\" class=\"selected-text\" part=\"text\"></span></slot></div><slot slot=\"end\" name=\"end\"></slot><slot slot=\"accessory\" name=\"accessory\"></slot><slot slot=\"support-text\" name=\"support-text\"></slot><slot slot=\"support-text-end\" name=\"support-text-end\"></slot><slot slot=\"start\" name=\"leading\"></slot><slot slot=\"end\" name=\"trailing\"></slot><slot slot=\"accessory\" name=\"addon-end\"></slot><slot slot=\"support-text\" name=\"helper-text\"></slot></forge-field></template>';
|
|
31
31
|
const styles = ':host{display:block;outline:0}:host([hidden]){display:none}forge-field{--_select-placeholder-color:var(--forge-select-placeholder-color, var(--forge-field-placeholder-color, var(--forge-theme-text-medium, rgba(0, 0, 0, 0.6))))}.selected-text-container{display:grid;align-items:center;cursor:pointer}.selected-text,::slotted([slot=value]){white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.selected-text:empty::before{content:attr(placeholder);color:var(--_select-placeholder-color);font-size:inherit}:host([disabled]) .selected-text-container{cursor:not-allowed}forge-field{display:contents}';
|
|
32
32
|
/**
|
|
33
33
|
* @tag forge-select
|
|
@@ -12,6 +12,7 @@ export declare const SKIP_LINK_CONSTANTS: {
|
|
|
12
12
|
MUTED: string;
|
|
13
13
|
PERSISTENT: string;
|
|
14
14
|
INLINE: string;
|
|
15
|
+
SKIP_URL_CHANGE: string;
|
|
15
16
|
};
|
|
16
17
|
attributes: {
|
|
17
18
|
TARGET: string;
|
|
@@ -19,6 +20,7 @@ export declare const SKIP_LINK_CONSTANTS: {
|
|
|
19
20
|
MUTED: string;
|
|
20
21
|
PERSISTENT: string;
|
|
21
22
|
INLINE: string;
|
|
23
|
+
SKIP_URL_CHANGE: string;
|
|
22
24
|
};
|
|
23
25
|
selectors: {
|
|
24
26
|
ANCHOR: string;
|
|
@@ -11,6 +11,7 @@ export interface ISkipLinkComponent extends IBaseComponent {
|
|
|
11
11
|
muted: boolean;
|
|
12
12
|
persistent: boolean;
|
|
13
13
|
inline: boolean;
|
|
14
|
+
skipUrlChange: boolean;
|
|
14
15
|
}
|
|
15
16
|
declare global {
|
|
16
17
|
interface HTMLElementTagNameMap {
|
|
@@ -22,18 +23,6 @@ declare global {
|
|
|
22
23
|
*
|
|
23
24
|
* @summary The Forge Skip Link component is used to provide a way for users to skip repetitive content and navigate directly to a section of the page.
|
|
24
25
|
*
|
|
25
|
-
* @property {string} [target=''] - The IDREF of the element to which the skip link should navigate.
|
|
26
|
-
* @property {SkipLinkTheme} [theme='default'] - The theme applied to the skip link.
|
|
27
|
-
* @property {boolean} [muted=false] - Whether or not the skip link uses a muted color scheme.
|
|
28
|
-
* @property {boolean} [persistent=false] - Whether or not the skip link should remain visible when not focused.
|
|
29
|
-
* @property {boolean} [inline=false] - Whether or not the skip link renders within its container.
|
|
30
|
-
*
|
|
31
|
-
* @attribute {string} [target=''] - The IDREF of the element to which the skip link should navigate.
|
|
32
|
-
* @attribute {SkipLinkTheme} [theme='default'] - The theme applied to the skip link.
|
|
33
|
-
* @attribute {boolean} [muted=false] - Whether or not the skip link uses a muted color scheme.
|
|
34
|
-
* @attribute {boolean} [persistent=false] - Whether or not the skip link should remain visible when not focused.
|
|
35
|
-
* @attribute {boolean} [inline=false] - Whether or not the skip link renders within its container.
|
|
36
|
-
*
|
|
37
26
|
* @cssproperty --forge-skip-link-background - The background color of the skip link.
|
|
38
27
|
* @cssproperty --forge-skip-link-color - The text color of the skip link.
|
|
39
28
|
* @cssproperty --forge-skip-link-shape - The border radius of the skip link.
|
|
@@ -62,17 +51,52 @@ export declare class SkipLinkComponent extends BaseComponent implements ISkipLin
|
|
|
62
51
|
private _muted;
|
|
63
52
|
private _persistent;
|
|
64
53
|
private _inline;
|
|
54
|
+
private _skipUrlChange;
|
|
65
55
|
private _anchorElement;
|
|
56
|
+
private _clickListener;
|
|
66
57
|
constructor();
|
|
67
58
|
attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
|
|
59
|
+
/**
|
|
60
|
+
* The IDREF of the element to which the skip link should navigate.
|
|
61
|
+
* @default ''
|
|
62
|
+
* @attribute
|
|
63
|
+
*/
|
|
68
64
|
get target(): string;
|
|
69
65
|
set target(value: string);
|
|
66
|
+
/**
|
|
67
|
+
* The theme applied to the skip link.
|
|
68
|
+
* @default 'default'
|
|
69
|
+
* @attribute
|
|
70
|
+
*/
|
|
70
71
|
get theme(): SkipLinkTheme;
|
|
71
72
|
set theme(value: SkipLinkTheme);
|
|
73
|
+
/**
|
|
74
|
+
* Whether or not the skip link uses a muted color scheme.
|
|
75
|
+
* @default false
|
|
76
|
+
* @attribute
|
|
77
|
+
*/
|
|
72
78
|
get muted(): boolean;
|
|
73
79
|
set muted(value: boolean);
|
|
80
|
+
/**
|
|
81
|
+
* Whether or not the skip link should remain visible when not focused.
|
|
82
|
+
* @default false
|
|
83
|
+
* @attribute
|
|
84
|
+
*/
|
|
74
85
|
get persistent(): boolean;
|
|
75
86
|
set persistent(value: boolean);
|
|
87
|
+
/**
|
|
88
|
+
* Whether or not the skip link renders within its container.
|
|
89
|
+
* @default false
|
|
90
|
+
* @attribute
|
|
91
|
+
*/
|
|
76
92
|
get inline(): boolean;
|
|
77
93
|
set inline(value: boolean);
|
|
94
|
+
/**
|
|
95
|
+
* Sets the skip link to skip browser navigation and scroll to the target element.
|
|
96
|
+
* @default false
|
|
97
|
+
* @attribute
|
|
98
|
+
*/
|
|
99
|
+
get skipUrlChange(): boolean;
|
|
100
|
+
set skipUrlChange(value: boolean);
|
|
101
|
+
private _handleClick;
|
|
78
102
|
}
|
|
@@ -16,18 +16,6 @@ const style = ':host{--_skip-link-inset:var(--forge-skip-link-inset, var(--forge
|
|
|
16
16
|
*
|
|
17
17
|
* @summary The Forge Skip Link component is used to provide a way for users to skip repetitive content and navigate directly to a section of the page.
|
|
18
18
|
*
|
|
19
|
-
* @property {string} [target=''] - The IDREF of the element to which the skip link should navigate.
|
|
20
|
-
* @property {SkipLinkTheme} [theme='default'] - The theme applied to the skip link.
|
|
21
|
-
* @property {boolean} [muted=false] - Whether or not the skip link uses a muted color scheme.
|
|
22
|
-
* @property {boolean} [persistent=false] - Whether or not the skip link should remain visible when not focused.
|
|
23
|
-
* @property {boolean} [inline=false] - Whether or not the skip link renders within its container.
|
|
24
|
-
*
|
|
25
|
-
* @attribute {string} [target=''] - The IDREF of the element to which the skip link should navigate.
|
|
26
|
-
* @attribute {SkipLinkTheme} [theme='default'] - The theme applied to the skip link.
|
|
27
|
-
* @attribute {boolean} [muted=false] - Whether or not the skip link uses a muted color scheme.
|
|
28
|
-
* @attribute {boolean} [persistent=false] - Whether or not the skip link should remain visible when not focused.
|
|
29
|
-
* @attribute {boolean} [inline=false] - Whether or not the skip link renders within its container.
|
|
30
|
-
*
|
|
31
19
|
* @cssproperty --forge-skip-link-background - The background color of the skip link.
|
|
32
20
|
* @cssproperty --forge-skip-link-color - The text color of the skip link.
|
|
33
21
|
* @cssproperty --forge-skip-link-shape - The border radius of the skip link.
|
|
@@ -60,6 +48,8 @@ let SkipLinkComponent = class SkipLinkComponent extends BaseComponent {
|
|
|
60
48
|
this._muted = false;
|
|
61
49
|
this._persistent = false;
|
|
62
50
|
this._inline = false;
|
|
51
|
+
this._skipUrlChange = false;
|
|
52
|
+
this._clickListener = (evt) => this._handleClick(evt);
|
|
63
53
|
attachShadowTemplate(this, template, style);
|
|
64
54
|
this._anchorElement = getShadowElement(this, SKIP_LINK_CONSTANTS.selectors.ANCHOR);
|
|
65
55
|
}
|
|
@@ -80,8 +70,16 @@ let SkipLinkComponent = class SkipLinkComponent extends BaseComponent {
|
|
|
80
70
|
case SKIP_LINK_CONSTANTS.observedAttributes.INLINE:
|
|
81
71
|
this.inline = coerceBoolean(newValue);
|
|
82
72
|
break;
|
|
73
|
+
case SKIP_LINK_CONSTANTS.observedAttributes.SKIP_URL_CHANGE:
|
|
74
|
+
this.skipUrlChange = coerceBoolean(newValue);
|
|
75
|
+
break;
|
|
83
76
|
}
|
|
84
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* The IDREF of the element to which the skip link should navigate.
|
|
80
|
+
* @default ''
|
|
81
|
+
* @attribute
|
|
82
|
+
*/
|
|
85
83
|
get target() {
|
|
86
84
|
return this._target;
|
|
87
85
|
}
|
|
@@ -92,6 +90,11 @@ let SkipLinkComponent = class SkipLinkComponent extends BaseComponent {
|
|
|
92
90
|
this._anchorElement.href = `#${this._target}`;
|
|
93
91
|
}
|
|
94
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* The theme applied to the skip link.
|
|
95
|
+
* @default 'default'
|
|
96
|
+
* @attribute
|
|
97
|
+
*/
|
|
95
98
|
get theme() {
|
|
96
99
|
return this._theme;
|
|
97
100
|
}
|
|
@@ -101,6 +104,11 @@ let SkipLinkComponent = class SkipLinkComponent extends BaseComponent {
|
|
|
101
104
|
this.setAttribute(SKIP_LINK_CONSTANTS.attributes.THEME, this._theme);
|
|
102
105
|
}
|
|
103
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* Whether or not the skip link uses a muted color scheme.
|
|
109
|
+
* @default false
|
|
110
|
+
* @attribute
|
|
111
|
+
*/
|
|
104
112
|
get muted() {
|
|
105
113
|
return this._muted;
|
|
106
114
|
}
|
|
@@ -110,6 +118,11 @@ let SkipLinkComponent = class SkipLinkComponent extends BaseComponent {
|
|
|
110
118
|
this.toggleAttribute(SKIP_LINK_CONSTANTS.attributes.MUTED, this._muted);
|
|
111
119
|
}
|
|
112
120
|
}
|
|
121
|
+
/**
|
|
122
|
+
* Whether or not the skip link should remain visible when not focused.
|
|
123
|
+
* @default false
|
|
124
|
+
* @attribute
|
|
125
|
+
*/
|
|
113
126
|
get persistent() {
|
|
114
127
|
return this._persistent;
|
|
115
128
|
}
|
|
@@ -119,6 +132,11 @@ let SkipLinkComponent = class SkipLinkComponent extends BaseComponent {
|
|
|
119
132
|
this.toggleAttribute(SKIP_LINK_CONSTANTS.attributes.PERSISTENT, this._persistent);
|
|
120
133
|
}
|
|
121
134
|
}
|
|
135
|
+
/**
|
|
136
|
+
* Whether or not the skip link renders within its container.
|
|
137
|
+
* @default false
|
|
138
|
+
* @attribute
|
|
139
|
+
*/
|
|
122
140
|
get inline() {
|
|
123
141
|
return this._inline;
|
|
124
142
|
}
|
|
@@ -128,6 +146,31 @@ let SkipLinkComponent = class SkipLinkComponent extends BaseComponent {
|
|
|
128
146
|
this.toggleAttribute(SKIP_LINK_CONSTANTS.attributes.INLINE, this._inline);
|
|
129
147
|
}
|
|
130
148
|
}
|
|
149
|
+
/**
|
|
150
|
+
* Sets the skip link to skip browser navigation and scroll to the target element.
|
|
151
|
+
* @default false
|
|
152
|
+
* @attribute
|
|
153
|
+
*/
|
|
154
|
+
get skipUrlChange() {
|
|
155
|
+
return this._skipUrlChange;
|
|
156
|
+
}
|
|
157
|
+
set skipUrlChange(value) {
|
|
158
|
+
if (this._skipUrlChange !== value) {
|
|
159
|
+
this._skipUrlChange = value;
|
|
160
|
+
this.toggleAttribute(SKIP_LINK_CONSTANTS.attributes.SKIP_URL_CHANGE, this._skipUrlChange);
|
|
161
|
+
if (this._skipUrlChange) {
|
|
162
|
+
this._anchorElement.addEventListener('click', this._clickListener);
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
this._anchorElement.removeEventListener('click', this._clickListener);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
_handleClick(evt) {
|
|
169
|
+
evt.preventDefault();
|
|
170
|
+
const targetElement = document.getElementById(this._target);
|
|
171
|
+
targetElement?.focus();
|
|
172
|
+
targetElement?.scrollIntoView({ behavior: 'smooth' });
|
|
173
|
+
}
|
|
131
174
|
};
|
|
132
175
|
SkipLinkComponent = __decorate([
|
|
133
176
|
customElement({
|
package/esm/tabs/tab/tab.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ declare global {
|
|
|
26
26
|
* @dependency forge-focus-indicator
|
|
27
27
|
* @dependency forge-state-layer
|
|
28
28
|
*
|
|
29
|
-
* @property {boolean} [disabled=false] - The disabled state of the tab.
|
|
29
|
+
* @property {boolean} [disabled=false] - The disabled state of the tab. Should not be set if using the disabled property on `forge-tab-bar`.
|
|
30
30
|
* @property {boolean} [selected=false] - The selected state of the tab.
|
|
31
31
|
* @property {boolean} [vertical=false] - Controls whether the tab is vertical or horizontal.
|
|
32
32
|
* @property {boolean} [stacked=false] - Controls whether the tab is taller to allow for slotted leading/trailing elements.
|
package/esm/tabs/tab/tab.js
CHANGED
|
@@ -19,7 +19,7 @@ const styles = ':host{display:inline-flex;outline:0;-webkit-tap-highlight-color:
|
|
|
19
19
|
* @dependency forge-focus-indicator
|
|
20
20
|
* @dependency forge-state-layer
|
|
21
21
|
*
|
|
22
|
-
* @property {boolean} [disabled=false] - The disabled state of the tab.
|
|
22
|
+
* @property {boolean} [disabled=false] - The disabled state of the tab. Should not be set if using the disabled property on `forge-tab-bar`.
|
|
23
23
|
* @property {boolean} [selected=false] - The selected state of the tab.
|
|
24
24
|
* @property {boolean} [vertical=false] - Controls whether the tab is vertical or horizontal.
|
|
25
25
|
* @property {boolean} [stacked=false] - Controls whether the tab is taller to allow for slotted leading/trailing elements.
|
|
@@ -139,7 +139,8 @@ export class TabBarCore {
|
|
|
139
139
|
_syncTabState() {
|
|
140
140
|
this._tabs.forEach((tab, index) => {
|
|
141
141
|
tab.selected = index === this._activeTab;
|
|
142
|
-
|
|
142
|
+
if (this._disabled)
|
|
143
|
+
tab.disabled = this._disabled;
|
|
143
144
|
tab.vertical = this._vertical;
|
|
144
145
|
tab.stacked = this._stacked;
|
|
145
146
|
tab.secondary = this._secondary;
|
|
@@ -38,7 +38,7 @@ declare global {
|
|
|
38
38
|
* @dependency forge-icon-button
|
|
39
39
|
* @dependency forge-icon
|
|
40
40
|
*
|
|
41
|
-
* @property {boolean} [disabled=false] -
|
|
41
|
+
* @property {boolean} [disabled=false] - Sets the disabled state of all child tabs. If true, any new tabs added to the DOM will be disabled by default. This can be used instead of setting individual tab disabled properties, mixing the two methods of disabling is not supported.
|
|
42
42
|
* @property {number} [activeTab=null] - The index of the active tab.
|
|
43
43
|
* @property {boolean} [vertical=false] - Controls whether the tab bar is vertical or horizontal.
|
|
44
44
|
* @property {boolean} [clustered=false] - Controls whether the tabs stretch the full width of their container or cluster together at their minimum width.
|
|
@@ -29,7 +29,7 @@ const styles = ':host{position:relative;display:block}:host([hidden]){display:no
|
|
|
29
29
|
* @dependency forge-icon-button
|
|
30
30
|
* @dependency forge-icon
|
|
31
31
|
*
|
|
32
|
-
* @property {boolean} [disabled=false] -
|
|
32
|
+
* @property {boolean} [disabled=false] - Sets the disabled state of all child tabs. If true, any new tabs added to the DOM will be disabled by default. This can be used instead of setting individual tab disabled properties, mixing the two methods of disabling is not supported.
|
|
33
33
|
* @property {number} [activeTab=null] - The index of the active tab.
|
|
34
34
|
* @property {boolean} [vertical=false] - Controls whether the tab bar is vertical or horizontal.
|
|
35
35
|
* @property {boolean} [clustered=false] - Controls whether the tabs stretch the full width of their container or cluster together at their minimum width.
|
|
@@ -12,19 +12,22 @@ export interface ITextFieldAdapter extends IBaseFieldAdapter {
|
|
|
12
12
|
addRootListener(name: keyof HTMLElementEventMap, listener: EventListener): void;
|
|
13
13
|
removeRootListener(name: keyof HTMLElementEventMap, listener: EventListener): void;
|
|
14
14
|
disableInput(disabled: boolean): void;
|
|
15
|
-
handleDefaultSlotChange(
|
|
15
|
+
handleDefaultSlotChange(listener: TextFieldInputAttributeObserver): void;
|
|
16
16
|
tryAddValueChangeListener(context: unknown, listener: TextFieldValueChangeListener): void;
|
|
17
17
|
removeValueChangeListener(): void;
|
|
18
18
|
tryFloatLabel(force?: boolean): void;
|
|
19
|
-
tryConnectSlottedLabel(
|
|
19
|
+
tryConnectSlottedLabel(): void;
|
|
20
20
|
connectClearButton(listener: EventListener): void;
|
|
21
21
|
disconnectClearButton(listener: EventListener): void;
|
|
22
22
|
toggleClearButtonVisibility(visible: boolean): void;
|
|
23
23
|
clearInput(): void;
|
|
24
|
+
getAllSlotElements(): HTMLSlotElement[];
|
|
24
25
|
}
|
|
25
26
|
export declare class TextFieldAdapter extends BaseFieldAdapter implements ITextFieldAdapter {
|
|
26
27
|
protected readonly _fieldElement: IFieldComponent;
|
|
27
28
|
private readonly _clearButtonSlotElement;
|
|
29
|
+
private readonly _defaultSlotElement;
|
|
30
|
+
private readonly _labelSlotElement;
|
|
28
31
|
private _popoverTargetElement;
|
|
29
32
|
private _inputElements;
|
|
30
33
|
private _inputMutationObserver?;
|
|
@@ -39,13 +42,14 @@ export declare class TextFieldAdapter extends BaseFieldAdapter implements ITextF
|
|
|
39
42
|
inputIsDisabled(): boolean;
|
|
40
43
|
click(): void;
|
|
41
44
|
applyLabel(value: string | null): void;
|
|
42
|
-
handleDefaultSlotChange(
|
|
45
|
+
handleDefaultSlotChange(listener: TextFieldInputAttributeObserver): void;
|
|
43
46
|
tryAddValueChangeListener(context: unknown, listener: TextFieldValueChangeListener): void;
|
|
44
47
|
removeValueChangeListener(): void;
|
|
45
48
|
tryFloatLabel(force?: boolean): void;
|
|
46
|
-
tryConnectSlottedLabel(
|
|
49
|
+
tryConnectSlottedLabel(): void;
|
|
47
50
|
connectClearButton(listener: EventListener): void;
|
|
48
51
|
disconnectClearButton(listener: EventListener): void;
|
|
49
52
|
toggleClearButtonVisibility(visible: boolean): void;
|
|
50
53
|
clearInput(): void;
|
|
54
|
+
getAllSlotElements(): HTMLSlotElement[];
|
|
51
55
|
}
|
|
@@ -26,6 +26,8 @@ export class TextFieldAdapter extends BaseFieldAdapter {
|
|
|
26
26
|
this._destroyValueChangerListeners = [];
|
|
27
27
|
this._fieldElement = getShadowElement(component, TEXT_FIELD_CONSTANTS.selectors.FIELD);
|
|
28
28
|
this._clearButtonSlotElement = getShadowElement(component, TEXT_FIELD_CONSTANTS.selectors.CLEAR_BUTTON_SLOT);
|
|
29
|
+
this._defaultSlotElement = getShadowElement(component, TEXT_FIELD_CONSTANTS.selectors.DEFAULT_SLOT);
|
|
30
|
+
this._labelSlotElement = getShadowElement(component, TEXT_FIELD_CONSTANTS.selectors.LABEL_SLOT);
|
|
29
31
|
this._fieldElement.setAttribute('exportparts', Object.values(FIELD_CONSTANTS.parts).join(', '));
|
|
30
32
|
this._clearButtonSlotElement.remove();
|
|
31
33
|
}
|
|
@@ -49,11 +51,11 @@ export class TextFieldAdapter extends BaseFieldAdapter {
|
|
|
49
51
|
toggleAttribute(inputElement, !!value, 'aria-label', value ?? '');
|
|
50
52
|
});
|
|
51
53
|
}
|
|
52
|
-
handleDefaultSlotChange(
|
|
54
|
+
handleDefaultSlotChange(listener) {
|
|
53
55
|
// Destroy the mutation observer if it exists
|
|
54
56
|
this._inputMutationObserver?.disconnect();
|
|
55
57
|
// If there are no assigned elements, return
|
|
56
|
-
const assignedElements =
|
|
58
|
+
const assignedElements = this._defaultSlotElement.assignedElements();
|
|
57
59
|
if (!assignedElements.length) {
|
|
58
60
|
return;
|
|
59
61
|
}
|
|
@@ -106,14 +108,14 @@ export class TextFieldAdapter extends BaseFieldAdapter {
|
|
|
106
108
|
// Float the label if no input has a value or a placeholder
|
|
107
109
|
this._fieldElement.floatLabel = this.hasValue || this.hasPlaceholder;
|
|
108
110
|
}
|
|
109
|
-
tryConnectSlottedLabel(
|
|
111
|
+
tryConnectSlottedLabel() {
|
|
110
112
|
// Only one input can be automatically connected to a label, return if there are no or more
|
|
111
113
|
// than one inputs or if the input is already labelled
|
|
112
114
|
if (this._inputElements.length !== 1 || this._inputElements[0].labels?.length) {
|
|
113
115
|
return;
|
|
114
116
|
}
|
|
115
117
|
const inputElement = this._inputElements[0];
|
|
116
|
-
const elements =
|
|
118
|
+
const elements = this._labelSlotElement.assignedElements({ flatten: true });
|
|
117
119
|
// Attempt to find and connect a `<forge-label>` element
|
|
118
120
|
const forgeLabel = elements.find(el => el.matches(TEXT_FIELD_CONSTANTS.selectors.FORGE_LABEL));
|
|
119
121
|
if (forgeLabel) {
|
|
@@ -151,4 +153,7 @@ export class TextFieldAdapter extends BaseFieldAdapter {
|
|
|
151
153
|
this._inputElements.forEach(el => (el.value = ''));
|
|
152
154
|
this._inputElements[0].focus();
|
|
153
155
|
}
|
|
156
|
+
getAllSlotElements() {
|
|
157
|
+
return Array.from(this._component.shadowRoot?.querySelectorAll('slot') ?? []);
|
|
158
|
+
}
|
|
154
159
|
}
|
|
@@ -14,6 +14,8 @@ const attributes = {
|
|
|
14
14
|
};
|
|
15
15
|
const selectors = {
|
|
16
16
|
FIELD: '#field',
|
|
17
|
+
DEFAULT_SLOT: 'slot:not([name])',
|
|
18
|
+
LABEL_SLOT: 'slot[name=label]',
|
|
17
19
|
CLEAR_BUTTON_SLOT: 'slot[name=clear-button]',
|
|
18
20
|
FORGE_LABEL: LABEL_CONSTANTS.elementName,
|
|
19
21
|
INPUT: ':where(input:not([type=button], [type=checkbox], [type=color], [type=hidden], [type=image], [type=radio], [type=range], [type=reset], [type=submit]), textarea)'
|
|
@@ -22,7 +22,9 @@ export declare class TextFieldCore extends BaseFieldCore<ITextFieldAdapter> impl
|
|
|
22
22
|
initialize(): void;
|
|
23
23
|
destroy(): void;
|
|
24
24
|
get popoverTargetElement(): HTMLElement;
|
|
25
|
+
private _initializeSlots;
|
|
25
26
|
private _onSlotChange;
|
|
27
|
+
private _handleSlotChange;
|
|
26
28
|
private _onInputAttributeChange;
|
|
27
29
|
private _onClearButtonClick;
|
|
28
30
|
private _onValueChange;
|
|
@@ -21,6 +21,7 @@ export class TextFieldCore extends BaseFieldCore {
|
|
|
21
21
|
this._adapter.tryApplyGlobalConfiguration(['labelPosition', 'variant']);
|
|
22
22
|
this._adapter.addRootListener('slotchange', this._slotChangeListener);
|
|
23
23
|
this._adapter.addRootListener('input', this._inputListener);
|
|
24
|
+
this._initializeSlots();
|
|
24
25
|
}
|
|
25
26
|
destroy() {
|
|
26
27
|
this._adapter.removeRootListener('slotchange', this._slotChangeListener);
|
|
@@ -30,14 +31,20 @@ export class TextFieldCore extends BaseFieldCore {
|
|
|
30
31
|
get popoverTargetElement() {
|
|
31
32
|
return this._adapter.popoverTargetElement;
|
|
32
33
|
}
|
|
34
|
+
_initializeSlots() {
|
|
35
|
+
this._adapter.getAllSlotElements().forEach(slot => this._handleSlotChange(slot.name));
|
|
36
|
+
}
|
|
33
37
|
_onSlotChange(evt) {
|
|
34
38
|
const target = evt.target;
|
|
35
|
-
|
|
39
|
+
this._handleSlotChange(target.name);
|
|
40
|
+
}
|
|
41
|
+
_handleSlotChange(name) {
|
|
42
|
+
switch (name) {
|
|
36
43
|
case 'label':
|
|
37
|
-
this._adapter.tryConnectSlottedLabel(
|
|
44
|
+
this._adapter.tryConnectSlottedLabel();
|
|
38
45
|
break;
|
|
39
46
|
case '':
|
|
40
|
-
this._adapter.handleDefaultSlotChange(
|
|
47
|
+
this._adapter.handleDefaultSlotChange(this._inputAttributeListener);
|
|
41
48
|
this._adapter.tryAddValueChangeListener(this, this._valueChangeListener);
|
|
42
49
|
this._tryFloatLabel();
|
|
43
50
|
break;
|
package/package.json
CHANGED
|
@@ -77,7 +77,8 @@ $themes: (primary, secondary, tertiary, success, warning, error, info);
|
|
|
77
77
|
@include chip.provide-theme(
|
|
78
78
|
(
|
|
79
79
|
field-background: theme.variable($theme),
|
|
80
|
-
field-color: theme.variable(on-#{$theme})
|
|
80
|
+
field-color: theme.variable(on-#{$theme}),
|
|
81
|
+
focus-indicator-color: theme.variable($theme)
|
|
81
82
|
)
|
|
82
83
|
);
|
|
83
84
|
}
|
|
@@ -14,8 +14,8 @@ $_cycle-duration: calc(4 * #{token(arc-duration)});
|
|
|
14
14
|
@mixin container {
|
|
15
15
|
display: inline-flex;
|
|
16
16
|
vertical-align: middle;
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
block-size: #{token(size)};
|
|
18
|
+
inline-size: #{token(size)};
|
|
19
19
|
position: relative;
|
|
20
20
|
align-items: center;
|
|
21
21
|
justify-content: center;
|
|
@@ -22,6 +22,7 @@ $tokens: (
|
|
|
22
22
|
padding-block: utils.module-val(chip, padding-block, 0),
|
|
23
23
|
cursor: utils.module-val(chip, cursor, pointer),
|
|
24
24
|
icon-font-size: utils.module-val(chip, icon-font-size, 1.5rem),
|
|
25
|
+
focus-indicator-color: utils.module-ref(chip, focus-indicator-color, color),
|
|
25
26
|
// Disabled
|
|
26
27
|
disabled-opacity: utils.module-val(chip, disabled-opacity, theme.emphasis(medium-low)),
|
|
27
28
|
disabled-cursor: utils.module-val(chip, disabled-cursor, not-allowed),
|
package/sass/field/_core.scss
CHANGED
package/sass/field/field.scss
CHANGED
|
@@ -676,7 +676,7 @@ forge-focus-indicator {
|
|
|
676
676
|
@include focus-indicator.provide-theme(
|
|
677
677
|
(
|
|
678
678
|
color: #{token(focus-indicator-color, custom)},
|
|
679
|
-
outward-offset:
|
|
679
|
+
outward-offset: calc(#{token(outline-width)} * -1),
|
|
680
680
|
shape: #{token(shape)},
|
|
681
681
|
width: #{token(focus-indicator-width)}
|
|
682
682
|
)
|
|
@@ -46,6 +46,7 @@ $_input-selector: ':where(input, textarea, select, .forge-field__input)';
|
|
|
46
46
|
outline-style: #{token(outline-style)};
|
|
47
47
|
outline-width: #{token(outline-width)};
|
|
48
48
|
outline-color: #{theme.variable(outline-low)};
|
|
49
|
+
outline-offset: calc(#{token(outline-width)} * -1);
|
|
49
50
|
|
|
50
51
|
background: #{token(background)};
|
|
51
52
|
|
|
@@ -329,7 +330,8 @@ $_input-selector: ':where(input, textarea, select, .forge-field__input)';
|
|
|
329
330
|
&.forge-field:has(#{$_input-selector}:focus) {
|
|
330
331
|
@include focus-indicator.provide-theme(
|
|
331
332
|
(
|
|
332
|
-
color: #{theme.variable(error)}
|
|
333
|
+
color: #{theme.variable(error)},
|
|
334
|
+
outward-offset: calc(#{token(outline-width)} * -1)
|
|
333
335
|
)
|
|
334
336
|
);
|
|
335
337
|
}
|