vanjs-jsf 0.3.2 → 0.4.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.
@@ -12,6 +12,7 @@ const { div, p, input, label, textarea, legend, link, fieldset, span, select, op
12
12
  var FieldType;
13
13
  (function (FieldType) {
14
14
  FieldType["text"] = "text";
15
+ FieldType["password"] = "password";
15
16
  FieldType["code"] = "code";
16
17
  FieldType["number"] = "number";
17
18
  FieldType["textarea"] = "textarea";
@@ -184,6 +185,21 @@ export class VanJsfField extends VanJSComponent {
184
185
  oninput: (e) => this.handleChange(this, e.target.value),
185
186
  }), this.renderError());
186
187
  break;
188
+ case FieldType.password:
189
+ // Password is rendered with type="password" so the user agent
190
+ // masks the value as it is typed. Otherwise behaves identically
191
+ // to a text input — same theme.input class, same oninput
192
+ // wiring. autocomplete="new-password" hints to browsers that
193
+ // this is a credential entry form, not a "remember me" field.
194
+ el = div(props, this.renderLabel(), this.renderDescription(), input({
195
+ id: this.name,
196
+ type: "password",
197
+ autocomplete: "new-password",
198
+ class: resolve(this.class, this.theme.input),
199
+ value: this.iniVal,
200
+ oninput: (e) => this.handleChange(this, e.target.value),
201
+ }), this.renderError());
202
+ break;
187
203
  case FieldType.textarea:
188
204
  el = div(props, this.renderLabel(), this.renderDescription(), textarea({
189
205
  id: this.name,