@fluid-topics/ft-text-input 1.3.44 → 1.3.46

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.
@@ -11,18 +11,23 @@ export declare class FtdsTextInput extends FtdsTextInput_base implements FtdsTex
11
11
  static styles: import("lit").CSSResult[];
12
12
  type: FtdsTextInputType;
13
13
  clearable: boolean;
14
+ autocomplete?: string;
14
15
  private showClearPassword;
15
16
  private input?;
16
17
  constructor();
17
18
  get inputType(): FtdsTextInputType;
18
19
  onInput(): void;
19
- connectedCallback(): void;
20
20
  focus(): void;
21
- protected willUpdate(props: PropertyValues): void;
22
21
  get appendIcon(): FtIcons.EYE_SLASH | FtIcons.X_MARK | FtIcons.EYE | undefined;
23
22
  get appendIconLabel(): string;
24
23
  protected render(): import("lit-html").TemplateResult<1>;
25
24
  private onAppendedIconClick;
25
+ protected willUpdate(props: PropertyValues): void;
26
+ private watchAutofillInterval?;
27
+ private setupWatchAutofill;
28
+ private clearWatchAutofill;
29
+ connectedCallback(): void;
30
+ disconnectedCallback(): void;
26
31
  private updateTypeBasedAdditionalRules;
27
32
  }
28
33
  export {};
@@ -43,20 +43,10 @@ class FtdsTextInput extends withI18n(toFtInput(FtdsBase)) {
43
43
  this.value = ((_a = this.input) === null || _a === void 0 ? void 0 : _a.value) || "";
44
44
  super.onInput();
45
45
  }
46
- connectedCallback() {
47
- this.updateTypeBasedAdditionalRules(this.type);
48
- super.connectedCallback();
49
- }
50
46
  focus() {
51
47
  var _a;
52
48
  (_a = this.input) === null || _a === void 0 ? void 0 : _a.focus();
53
49
  }
54
- willUpdate(props) {
55
- super.willUpdate(props);
56
- if (props.has("type")) {
57
- this.updateTypeBasedAdditionalRules(this.type);
58
- }
59
- }
60
50
  get appendIcon() {
61
51
  if (this.disabled) {
62
52
  return undefined;
@@ -108,6 +98,7 @@ class FtdsTextInput extends withI18n(toFtInput(FtdsBase)) {
108
98
  name="${this.name}"
109
99
  .value=${this.value}
110
100
  .type=${this.inputType}
101
+ autocomplete="${ifDefined(this.autocomplete)}"
111
102
  ?disabled=${this.disabled}
112
103
  @input=${this.onInput}
113
104
  @focus=${this.onFocus}
@@ -129,6 +120,38 @@ class FtdsTextInput extends withI18n(toFtInput(FtdsBase)) {
129
120
  this.dispatchEvent(new ClearEvent());
130
121
  }
131
122
  }
123
+ willUpdate(props) {
124
+ super.willUpdate(props);
125
+ if (props.has("type")) {
126
+ this.updateTypeBasedAdditionalRules(this.type);
127
+ }
128
+ }
129
+ setupWatchAutofill() {
130
+ var _a;
131
+ this.clearWatchAutofill();
132
+ if (((_a = this.autocomplete) !== null && _a !== void 0 ? _a : "off") !== "off") {
133
+ this.watchAutofillInterval = setInterval(() => {
134
+ var _a, _b;
135
+ if (((_a = this.input) === null || _a === void 0 ? void 0 : _a.matches(":autofill")) && this.value !== ((_b = this.input) === null || _b === void 0 ? void 0 : _b.value)) {
136
+ this.onInput();
137
+ }
138
+ }, 200);
139
+ }
140
+ }
141
+ clearWatchAutofill() {
142
+ if (this.watchAutofillInterval) {
143
+ clearInterval(this.watchAutofillInterval);
144
+ }
145
+ }
146
+ connectedCallback() {
147
+ super.connectedCallback();
148
+ this.setupWatchAutofill();
149
+ this.updateTypeBasedAdditionalRules(this.type);
150
+ }
151
+ disconnectedCallback() {
152
+ super.disconnectedCallback();
153
+ this.clearWatchAutofill();
154
+ }
132
155
  updateTypeBasedAdditionalRules(type) {
133
156
  this.additionalErrorRules = (() => {
134
157
  switch (type) {
@@ -162,6 +185,9 @@ __decorate([
162
185
  __decorate([
163
186
  property({ type: Boolean })
164
187
  ], FtdsTextInput.prototype, "clearable", void 0);
188
+ __decorate([
189
+ property()
190
+ ], FtdsTextInput.prototype, "autocomplete", void 0);
165
191
  __decorate([
166
192
  state()
167
193
  ], FtdsTextInput.prototype, "showClearPassword", void 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-text-input",
3
- "version": "1.3.44",
3
+ "version": "1.3.46",
4
4
  "description": "Text Input",
5
5
  "keywords": [
6
6
  "Lit"
@@ -19,17 +19,17 @@
19
19
  "url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
20
20
  },
21
21
  "dependencies": {
22
- "@fluid-topics/ft-base-input": "1.3.44",
23
- "@fluid-topics/ft-i18n": "1.3.44",
24
- "@fluid-topics/ft-icon": "1.3.44",
25
- "@fluid-topics/ft-input-helper-text": "1.3.44",
26
- "@fluid-topics/ft-input-label": "1.3.44",
27
- "@fluid-topics/ft-tooltip": "1.3.44",
28
- "@fluid-topics/ft-wc-utils": "1.3.44",
22
+ "@fluid-topics/ft-base-input": "1.3.46",
23
+ "@fluid-topics/ft-i18n": "1.3.46",
24
+ "@fluid-topics/ft-icon": "1.3.46",
25
+ "@fluid-topics/ft-input-helper-text": "1.3.46",
26
+ "@fluid-topics/ft-input-label": "1.3.46",
27
+ "@fluid-topics/ft-tooltip": "1.3.46",
28
+ "@fluid-topics/ft-wc-utils": "1.3.46",
29
29
  "lit": "3.1.0"
30
30
  },
31
31
  "devDependencies": {
32
- "@fluid-topics/ft-wc-test-utils": "1.3.44"
32
+ "@fluid-topics/ft-wc-test-utils": "1.3.46"
33
33
  },
34
- "gitHead": "a65783a64db6d2d22420bbcb424cf5d51e0483c6"
34
+ "gitHead": "d6cf25d6ed0dead8c7aff4f94a493c35d12f1392"
35
35
  }