@fluid-topics/ft-text-field 1.0.58 → 1.0.60

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.
@@ -5,23 +5,23 @@ import { FtInputLabelCssVariables } from "@fluid-topics/ft-input-label/build/ft-
5
5
  import { FtRippleCssVariables } from "@fluid-topics/ft-ripple/build/ft-ripple.css";
6
6
  import { FtIconCssVariables } from "@fluid-topics/ft-icon/build/ft-icon.css";
7
7
  export const FtTextFieldCssVariables = {
8
- fontSize: FtCssVariableFactory.create("--ft-text-field-font-size", "SIZE", "14px"),
9
- labelSize: FtCssVariableFactory.create("--ft-text-field-label-size", "SIZE", "11px"),
10
- verticalSpacing: FtCssVariableFactory.create("--ft-text-field-vertical-spacing", "SIZE", "4px"),
11
- horizontalSpacing: FtCssVariableFactory.create("--ft-text-field-horizontal-spacing", "SIZE", "16px"),
12
- helperColor: FtCssVariableFactory.extend("--ft-text-field-helper-color", designSystemVariables.colorOnSurfaceMedium),
8
+ fontSize: FtCssVariableFactory.create("--ft-text-field-font-size", "", "SIZE", "14px"),
9
+ labelSize: FtCssVariableFactory.create("--ft-text-field-label-size", "", "SIZE", "11px"),
10
+ verticalSpacing: FtCssVariableFactory.create("--ft-text-field-vertical-spacing", "", "SIZE", "4px"),
11
+ horizontalSpacing: FtCssVariableFactory.create("--ft-text-field-horizontal-spacing", "", "SIZE", "16px"),
12
+ helperColor: FtCssVariableFactory.extend("--ft-text-field-helper-color", "", designSystemVariables.colorOnSurfaceMedium),
13
13
  colorPrimary: FtCssVariableFactory.external(designSystemVariables.colorPrimary, "Design system"),
14
14
  colorOnSurface: FtCssVariableFactory.external(designSystemVariables.colorOnSurface, "Design system"),
15
15
  colorOnSurfaceDisabled: FtCssVariableFactory.external(designSystemVariables.colorOnSurfaceDisabled, "Design system"),
16
16
  borderRadiusS: FtCssVariableFactory.external(designSystemVariables.borderRadiusS, "Design system"),
17
17
  colorError: FtCssVariableFactory.external(designSystemVariables.colorError, "Design system"),
18
- prefixColor: FtCssVariableFactory.extend("--ft-text-field-prefix-color", designSystemVariables.colorOnSurfaceMedium),
19
- iconColor: FtCssVariableFactory.extend("--ft-text-field-icon-color", designSystemVariables.colorOnSurfaceMedium),
20
- floatingZIndex: FtCssVariableFactory.create("--ft-text-field-floating-components-z-index", "NUMBER", "3"),
18
+ prefixColor: FtCssVariableFactory.extend("--ft-text-field-prefix-color", "", designSystemVariables.colorOnSurfaceMedium),
19
+ iconColor: FtCssVariableFactory.extend("--ft-text-field-icon-color", "", designSystemVariables.colorOnSurfaceMedium),
20
+ floatingZIndex: FtCssVariableFactory.create("--ft-text-field-floating-components-z-index", "", "NUMBER", "3"),
21
21
  colorSurface: FtCssVariableFactory.external(designSystemVariables.colorSurface, "Design system"),
22
22
  colorOutline: FtCssVariableFactory.external(designSystemVariables.colorOutline, "Design system"),
23
23
  elevation02: FtCssVariableFactory.external(designSystemVariables.elevation02, "Design system"),
24
- suggestSize: FtCssVariableFactory.create("--ft-text-field-suggest-size", "SIZE", "300px"),
24
+ suggestSize: FtCssVariableFactory.create("--ft-text-field-suggest-size", "", "SIZE", "300px"),
25
25
  };
26
26
  // language=CSS
27
27
  export const styles = css `
@@ -2,7 +2,8 @@ import { PropertyValues } from "lit";
2
2
  import { ElementDefinitionsMap, FtLitElement } from "@fluid-topics/ft-wc-utils";
3
3
  import { FtTextFieldProperties } from "./ft-text-field.properties";
4
4
  import type { FtTextFieldSuggestion } from "./ft-text-field-suggestion";
5
- export declare class FtTextField extends FtLitElement implements FtTextFieldProperties {
5
+ declare const FtTextField_base: import("@fluid-topics/ft-wc-utils").FtFormComponentType<typeof FtLitElement>;
6
+ export declare class FtTextField extends FtTextField_base implements FtTextFieldProperties {
6
7
  static elementDefinitions: ElementDefinitionsMap;
7
8
  static styles: import("lit").CSSResult[];
8
9
  label?: string;
@@ -48,3 +49,4 @@ export declare class FtTextField extends FtLitElement implements FtTextFieldProp
48
49
  private onMainPanelBlur;
49
50
  private togglePasswordVisibility;
50
51
  }
52
+ export {};
@@ -8,13 +8,13 @@ import { html, nothing } from "lit";
8
8
  import { property, query, queryAssignedElements, state } from "lit/decorators.js";
9
9
  import { classMap } from "lit/directives/class-map.js";
10
10
  import { ifDefined } from "lit/directives/if-defined.js";
11
- import { FtLitElement } from "@fluid-topics/ft-wc-utils";
11
+ import { FtLitElement, toFtFormComponent } from "@fluid-topics/ft-wc-utils";
12
12
  import { FtTypography, FtTypographyBody1 } from "@fluid-topics/ft-typography";
13
13
  import { FtInputLabel } from "@fluid-topics/ft-input-label";
14
14
  import { FtRipple } from "@fluid-topics/ft-ripple";
15
15
  import { FtIcon, FtIcons } from "@fluid-topics/ft-icon";
16
16
  import { styles } from "./ft-text-field.css";
17
- class FtTextField extends FtLitElement {
17
+ class FtTextField extends toFtFormComponent(FtLitElement, "textbox") {
18
18
  constructor() {
19
19
  super(...arguments);
20
20
  this._value = "";
@@ -50,6 +50,7 @@ class FtTextField extends FtLitElement {
50
50
  setInternalValue(value) {
51
51
  const oldValue = this._value;
52
52
  this._value = value || "";
53
+ this.setFormValue(this._value);
53
54
  this.requestUpdate("value", oldValue);
54
55
  }
55
56
  focus() {
@@ -86,10 +87,10 @@ class FtTextField extends FtLitElement {
86
87
  <ft-ripple ?disabled=${this.disabled} activated></ft-ripple>
87
88
  `}
88
89
  ${this.prefix ? html `
89
- <ft-typography class="ft-text-field--prefix" vaiant="body1">
90
- ${this.prefix}
91
- </ft-typography>
92
- ` : nothing}
90
+ <ft-typography class="ft-text-field--prefix" vaiant="body1">
91
+ ${this.prefix}
92
+ </ft-typography>
93
+ ` : nothing}
93
94
  <input type=${(this.password && this.hidePassword) ? "password" : "text"}
94
95
  maxlength=${ifDefined(this.maxLength || undefined)}
95
96
  aria-label="${this.label}"