@umbraco-ui/uui-input-file 1.7.1 → 1.8.0-rc.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.
@@ -25,7 +25,7 @@
25
25
  },
26
26
  {
27
27
  "name": "value",
28
- "description": "Value of this form control.",
28
+ "description": "Value of this form control.\nIf you dont want the setFormValue to be called on the ElementInternals, then prevent calling this method, by not calling super.value = newValue in your implementation of the value setter method.",
29
29
  "type": "string",
30
30
  "default": "\"''\""
31
31
  },
@@ -96,7 +96,7 @@
96
96
  {
97
97
  "name": "value",
98
98
  "attribute": "value",
99
- "description": "Value of this form control.",
99
+ "description": "Value of this form control.\nIf you dont want the setFormValue to be called on the ElementInternals, then prevent calling this method, by not calling super.value = newValue in your implementation of the value setter method.",
100
100
  "type": "string",
101
101
  "default": "\"''\""
102
102
  },
@@ -140,7 +140,8 @@
140
140
  "type": "ValidityState"
141
141
  },
142
142
  {
143
- "name": "validationMessage"
143
+ "name": "validationMessage",
144
+ "type": "string"
144
145
  }
145
146
  ]
146
147
  }
package/lib/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { defineElement } from '@umbraco-ui/uui-base/lib/registration';
2
2
  import { query, property, state } from 'lit/decorators.js';
3
3
  import { LitElement, html, nothing, css } from 'lit';
4
- import { FormControlMixin } from '@umbraco-ui/uui-base/lib/mixins';
4
+ import { UUIFormControlMixin } from '@umbraco-ui/uui-base/lib/mixins';
5
5
  import { demandCustomElement } from '@umbraco-ui/uui-base/lib/utils';
6
6
  import { iconDelete } from '@umbraco-ui/uui-icon-registry-essential/lib/svgs';
7
7
  import { repeat } from 'lit/directives/repeat.js';
@@ -17,7 +17,7 @@ var __decorateClass = (decorators, target, key, kind) => {
17
17
  __defProp(target, key, result);
18
18
  return result;
19
19
  };
20
- let UUIInputFileElement = class extends FormControlMixin(LitElement) {
20
+ let UUIInputFileElement = class extends UUIFormControlMixin(LitElement, null) {
21
21
  constructor() {
22
22
  super();
23
23
  this.accept = "";
@@ -39,7 +39,7 @@ let UUIInputFileElement = class extends FormControlMixin(LitElement) {
39
39
  this.addEventListener("drop", () => this._setShowDropzone(false));
40
40
  }
41
41
  get value() {
42
- return this._value;
42
+ return super.value;
43
43
  }
44
44
  set value(newValue) {
45
45
  super.value = newValue;
@@ -64,6 +64,24 @@ let UUIInputFileElement = class extends FormControlMixin(LitElement) {
64
64
  getFormElement() {
65
65
  return this._dropZone;
66
66
  }
67
+ /**
68
+ * Removes focus from the input.
69
+ */
70
+ async blur() {
71
+ await this.updateComplete;
72
+ this._dropzone.blur();
73
+ }
74
+ /**
75
+ * This method enables <label for="..."> to focus the input
76
+ */
77
+ async focus() {
78
+ await this.updateComplete;
79
+ this._dropzone.focus();
80
+ }
81
+ async click() {
82
+ await this.updateComplete;
83
+ this._dropzone.browse();
84
+ }
67
85
  _handleClick(e) {
68
86
  e.stopImmediatePropagation();
69
87
  this._dropzone.browse();
@@ -1,9 +1,9 @@
1
1
  import { LitElement } from 'lit';
2
- declare const UUIInputFileElement_base: (new (...args: any[]) => import("@umbraco-ui/uui-base/lib/mixins").FormControlMixinInterface) & typeof LitElement;
2
+ declare const UUIInputFileElement_base: (new (...args: any[]) => import("@umbraco-ui/uui-base/lib/mixins").UUIFormControlMixinInterface<FormDataEntryValue | FormData, null>) & typeof LitElement;
3
3
  /**
4
4
  * @element uui-input-file
5
5
  * @description - A form associated file input that supports multiple files.
6
- * @extends FormControlMixin
6
+ * @extends UUIFormControlMixin
7
7
  */
8
8
  export declare class UUIInputFileElement extends UUIInputFileElement_base {
9
9
  private _dropzone;
@@ -22,12 +22,21 @@ export declare class UUIInputFileElement extends UUIInputFileElement_base {
22
22
  * @default false
23
23
  */
24
24
  multiple: boolean;
25
- get value(): FormDataEntryValue | FormData;
26
- set value(newValue: FormDataEntryValue | FormData);
25
+ get value(): FormDataEntryValue | FormData | null;
26
+ set value(newValue: FormDataEntryValue | FormData | null);
27
27
  private _files;
28
28
  constructor();
29
29
  connectedCallback(): void;
30
30
  protected getFormElement(): HTMLElement;
31
+ /**
32
+ * Removes focus from the input.
33
+ */
34
+ blur(): Promise<void>;
35
+ /**
36
+ * This method enables <label for="..."> to focus the input
37
+ */
38
+ focus(): Promise<void>;
39
+ click(): Promise<void>;
31
40
  private _handleClick;
32
41
  private _updateFileWrappers;
33
42
  private _handleFilesChange;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umbraco-ui/uui-input-file",
3
- "version": "1.7.1",
3
+ "version": "1.8.0-rc.0",
4
4
  "license": "MIT",
5
5
  "keywords": [
6
6
  "Umbraco",
@@ -30,12 +30,12 @@
30
30
  "custom-elements.json"
31
31
  ],
32
32
  "dependencies": {
33
- "@umbraco-ui/uui-action-bar": "1.7.0",
34
- "@umbraco-ui/uui-base": "1.7.0",
35
- "@umbraco-ui/uui-button": "1.7.1",
36
- "@umbraco-ui/uui-file-dropzone": "1.7.0",
37
- "@umbraco-ui/uui-icon": "1.7.0",
38
- "@umbraco-ui/uui-icon-registry-essential": "1.7.0"
33
+ "@umbraco-ui/uui-action-bar": "1.8.0-rc.0",
34
+ "@umbraco-ui/uui-base": "1.8.0-rc.0",
35
+ "@umbraco-ui/uui-button": "1.8.0-rc.0",
36
+ "@umbraco-ui/uui-file-dropzone": "1.8.0-rc.0",
37
+ "@umbraco-ui/uui-icon": "1.8.0-rc.0",
38
+ "@umbraco-ui/uui-icon-registry-essential": "1.8.0-rc.0"
39
39
  },
40
40
  "scripts": {
41
41
  "build": "npm run analyze && tsc --build && rollup -c rollup.config.js",
@@ -46,5 +46,5 @@
46
46
  "access": "public"
47
47
  },
48
48
  "homepage": "https://uui.umbraco.com/?path=/story/uui-input-file",
49
- "gitHead": "48b40b1f5a550f89e731051c78f2c5aea9412c47"
49
+ "gitHead": "46d444c66217c9a3c74518d8ce4badc7f121bfdf"
50
50
  }