@digital-realty/ix-textbox 2.0.5 → 2.1.2
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/LICENSE +20 -20
- package/README.md +68 -68
- package/dist/src/IxTextbox.d.ts +111 -111
- package/dist/src/IxTextbox.js +250 -250
- package/dist/src/IxTextbox.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/ix-textbox-styles.d.ts +1 -1
- package/dist/src/ix-textbox-styles.js +58 -58
- package/dist/src/ix-textbox-styles.js.map +1 -1
- package/dist/src/ix-textbox.d.ts +1 -1
- package/dist/src/ix-textbox.js +2 -2
- package/dist/src/ix-textbox.js.map +1 -1
- package/dist/src/react/IxTextbox.d.ts +2 -2
- package/dist/src/react/IxTextbox.js +9 -9
- package/dist/src/react/IxTextbox.js.map +1 -1
- package/dist/src/types/index.d.ts +14 -14
- package/dist/src/types/index.js +1 -1
- package/dist/src/types/index.js.map +1 -1
- package/dist/test/ix-textbox.test.d.ts +1 -1
- package/dist/test/ix-textbox.test.js +22 -22
- package/dist/test/ix-textbox.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +95 -94
- package/src/IxTextbox.ts +216 -216
- package/src/index.ts +1 -1
- package/src/ix-textbox-styles.ts +59 -59
- package/src/ix-textbox.ts +3 -3
- package/src/react/IxTextbox.ts +11 -11
- package/src/types/index.ts +29 -29
- package/test/ix-textbox.test.ts +32 -32
- package/tsconfig.json +22 -22
- package/web-dev-server.config.mjs +27 -27
- package/web-test-runner.config.mjs +43 -41
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2023 ix-textbox
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 ix-textbox
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
# \<ix-textbox>
|
|
2
|
-
|
|
3
|
-
This webcomponent follows the [open-wc](https://github.com/open-wc/open-wc) recommendation.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm i @digital-realty/ix-textbox
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Usage
|
|
12
|
-
|
|
13
|
-
```html
|
|
14
|
-
<script type="module">
|
|
15
|
-
import '@digital-realty/ix-textbox.js';
|
|
16
|
-
</script>
|
|
17
|
-
|
|
18
|
-
<ix-textbox></ix-textbox>
|
|
19
|
-
```
|
|
20
|
-
### In React
|
|
21
|
-
```html
|
|
22
|
-
<script type="module">
|
|
23
|
-
import { IxTextbox } from '@digital-realty/ix-textbox/IxTextbox'
|
|
24
|
-
</script>
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## Linting and formatting
|
|
28
|
-
|
|
29
|
-
To scan the project for linting and formatting errors, run
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
npm run lint
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
To automatically fix linting and formatting errors, run
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
npm run format
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
## Testing with Web Test Runner
|
|
42
|
-
|
|
43
|
-
To execute a single test run:
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
npm run test
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
To run the tests in interactive watch mode run:
|
|
50
|
-
|
|
51
|
-
```bash
|
|
52
|
-
npm run test:watch
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
## Tooling configs
|
|
57
|
-
|
|
58
|
-
For most of the tools, the configuration is in the `package.json` to reduce the amount of files in your project.
|
|
59
|
-
|
|
60
|
-
If you customize the configuration a lot, you can consider moving them to individual files.
|
|
61
|
-
|
|
62
|
-
## Local Demo with `web-dev-server`
|
|
63
|
-
|
|
64
|
-
```bash
|
|
65
|
-
npm start
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
To run a local development server that serves the basic demo located in `demo/index.html`
|
|
1
|
+
# \<ix-textbox>
|
|
2
|
+
|
|
3
|
+
This webcomponent follows the [open-wc](https://github.com/open-wc/open-wc) recommendation.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm i @digital-realty/ix-textbox
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```html
|
|
14
|
+
<script type="module">
|
|
15
|
+
import '@digital-realty/ix-textbox.js';
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<ix-textbox></ix-textbox>
|
|
19
|
+
```
|
|
20
|
+
### In React
|
|
21
|
+
```html
|
|
22
|
+
<script type="module">
|
|
23
|
+
import { IxTextbox } from '@digital-realty/ix-textbox/IxTextbox'
|
|
24
|
+
</script>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Linting and formatting
|
|
28
|
+
|
|
29
|
+
To scan the project for linting and formatting errors, run
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npm run lint
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
To automatically fix linting and formatting errors, run
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npm run format
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Testing with Web Test Runner
|
|
42
|
+
|
|
43
|
+
To execute a single test run:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
npm run test
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
To run the tests in interactive watch mode run:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
npm run test:watch
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
## Tooling configs
|
|
57
|
+
|
|
58
|
+
For most of the tools, the configuration is in the `package.json` to reduce the amount of files in your project.
|
|
59
|
+
|
|
60
|
+
If you customize the configuration a lot, you can consider moving them to individual files.
|
|
61
|
+
|
|
62
|
+
## Local Demo with `web-dev-server`
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
npm start
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
To run a local development server that serves the basic demo located in `demo/index.html`
|
package/dist/src/IxTextbox.d.ts
CHANGED
|
@@ -1,111 +1,111 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
2
|
-
import '@material/web/textfield/filled-text-field.js';
|
|
3
|
-
import '@material/web/textfield/outlined-text-field.js';
|
|
4
|
-
import { TextFieldType, UnsupportedTextFieldType } from './types/index.js';
|
|
5
|
-
export declare class IxTextbox extends LitElement {
|
|
6
|
-
outlined: boolean;
|
|
7
|
-
type: TextFieldType | UnsupportedTextFieldType;
|
|
8
|
-
disabled: boolean;
|
|
9
|
-
/**
|
|
10
|
-
* Gets or sets whether or not the text field is in a visually invalid state.
|
|
11
|
-
*
|
|
12
|
-
* Calling `reportValidity()` will automatically update `error`.
|
|
13
|
-
*/
|
|
14
|
-
error: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* The error message that replaces supporting text when `error` is true. If
|
|
17
|
-
* `errorText` is an empty string, then the supporting text will continue to
|
|
18
|
-
* show.
|
|
19
|
-
*
|
|
20
|
-
* Calling `reportValidity()` will automatically update `errorText` to the
|
|
21
|
-
* native `validationMessage`.
|
|
22
|
-
*/
|
|
23
|
-
errorText: string;
|
|
24
|
-
label: string;
|
|
25
|
-
required: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* The current value of the text field. It is always a string.
|
|
28
|
-
*/
|
|
29
|
-
value: string;
|
|
30
|
-
/**
|
|
31
|
-
* An optional prefix to display before the input value.
|
|
32
|
-
*/
|
|
33
|
-
prefixText: string;
|
|
34
|
-
/**
|
|
35
|
-
* An optional suffix to display after the input value.
|
|
36
|
-
*/
|
|
37
|
-
suffixText: string;
|
|
38
|
-
/**
|
|
39
|
-
* Whether or not the text field has a leading icon. Used for SSR.
|
|
40
|
-
*/
|
|
41
|
-
hasLeadingIcon: boolean;
|
|
42
|
-
/**
|
|
43
|
-
* Whether or not the text field has a trailing icon. Used for SSR.
|
|
44
|
-
*/
|
|
45
|
-
hasTrailingIcon: boolean;
|
|
46
|
-
/**
|
|
47
|
-
* Conveys additional information below the text field, such as how it should
|
|
48
|
-
* be used.
|
|
49
|
-
*/
|
|
50
|
-
supportingText: string;
|
|
51
|
-
/**
|
|
52
|
-
* Override the input text CSS `direction`. Useful for RTL languages that use
|
|
53
|
-
* LTR notation for fractions.
|
|
54
|
-
*/
|
|
55
|
-
textDirection: string;
|
|
56
|
-
/**
|
|
57
|
-
* The number of rows to display for a `type="textarea"` text field.
|
|
58
|
-
* Defaults to 2.
|
|
59
|
-
*/
|
|
60
|
-
rows: number;
|
|
61
|
-
/**
|
|
62
|
-
* Defines the greatest value in the range of permitted values.
|
|
63
|
-
*
|
|
64
|
-
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#max
|
|
65
|
-
*/
|
|
66
|
-
max: string;
|
|
67
|
-
/**
|
|
68
|
-
* The maximum number of characters a user can enter into the text field. Set
|
|
69
|
-
* to -1 for none.
|
|
70
|
-
*
|
|
71
|
-
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#maxlength
|
|
72
|
-
*/
|
|
73
|
-
maxLength: number;
|
|
74
|
-
/**
|
|
75
|
-
* Defines the most negative value in the range of permitted values.
|
|
76
|
-
*
|
|
77
|
-
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#min
|
|
78
|
-
*/
|
|
79
|
-
min: string;
|
|
80
|
-
/**
|
|
81
|
-
* The minimum number of characters a user can enter into the text field. Set
|
|
82
|
-
* to -1 for none.
|
|
83
|
-
*
|
|
84
|
-
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#minlength
|
|
85
|
-
*/
|
|
86
|
-
minLength: number;
|
|
87
|
-
/**
|
|
88
|
-
* A regular expression that the text field's value must match to pass
|
|
89
|
-
* constraint validation.
|
|
90
|
-
*
|
|
91
|
-
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#pattern
|
|
92
|
-
*/
|
|
93
|
-
pattern: string;
|
|
94
|
-
placeholder: string;
|
|
95
|
-
/**
|
|
96
|
-
* Indicates whether or not a user should be able to edit the text field's
|
|
97
|
-
* value.
|
|
98
|
-
*
|
|
99
|
-
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#readonly
|
|
100
|
-
*/
|
|
101
|
-
readOnly: boolean;
|
|
102
|
-
mdTextfield: HTMLInputElement;
|
|
103
|
-
handleChange(e: Event): void;
|
|
104
|
-
getValidityStatus(): boolean;
|
|
105
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
106
|
-
}
|
|
107
|
-
declare global {
|
|
108
|
-
interface HTMLElementTagNameMap {
|
|
109
|
-
'ix-textbox': IxTextbox;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import '@material/web/textfield/filled-text-field.js';
|
|
3
|
+
import '@material/web/textfield/outlined-text-field.js';
|
|
4
|
+
import { TextFieldType, UnsupportedTextFieldType } from './types/index.js';
|
|
5
|
+
export declare class IxTextbox extends LitElement {
|
|
6
|
+
outlined: boolean;
|
|
7
|
+
type: TextFieldType | UnsupportedTextFieldType;
|
|
8
|
+
disabled: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Gets or sets whether or not the text field is in a visually invalid state.
|
|
11
|
+
*
|
|
12
|
+
* Calling `reportValidity()` will automatically update `error`.
|
|
13
|
+
*/
|
|
14
|
+
error: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* The error message that replaces supporting text when `error` is true. If
|
|
17
|
+
* `errorText` is an empty string, then the supporting text will continue to
|
|
18
|
+
* show.
|
|
19
|
+
*
|
|
20
|
+
* Calling `reportValidity()` will automatically update `errorText` to the
|
|
21
|
+
* native `validationMessage`.
|
|
22
|
+
*/
|
|
23
|
+
errorText: string;
|
|
24
|
+
label: string;
|
|
25
|
+
required: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* The current value of the text field. It is always a string.
|
|
28
|
+
*/
|
|
29
|
+
value: string;
|
|
30
|
+
/**
|
|
31
|
+
* An optional prefix to display before the input value.
|
|
32
|
+
*/
|
|
33
|
+
prefixText: string;
|
|
34
|
+
/**
|
|
35
|
+
* An optional suffix to display after the input value.
|
|
36
|
+
*/
|
|
37
|
+
suffixText: string;
|
|
38
|
+
/**
|
|
39
|
+
* Whether or not the text field has a leading icon. Used for SSR.
|
|
40
|
+
*/
|
|
41
|
+
hasLeadingIcon: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Whether or not the text field has a trailing icon. Used for SSR.
|
|
44
|
+
*/
|
|
45
|
+
hasTrailingIcon: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Conveys additional information below the text field, such as how it should
|
|
48
|
+
* be used.
|
|
49
|
+
*/
|
|
50
|
+
supportingText: string;
|
|
51
|
+
/**
|
|
52
|
+
* Override the input text CSS `direction`. Useful for RTL languages that use
|
|
53
|
+
* LTR notation for fractions.
|
|
54
|
+
*/
|
|
55
|
+
textDirection: string;
|
|
56
|
+
/**
|
|
57
|
+
* The number of rows to display for a `type="textarea"` text field.
|
|
58
|
+
* Defaults to 2.
|
|
59
|
+
*/
|
|
60
|
+
rows: number;
|
|
61
|
+
/**
|
|
62
|
+
* Defines the greatest value in the range of permitted values.
|
|
63
|
+
*
|
|
64
|
+
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#max
|
|
65
|
+
*/
|
|
66
|
+
max: string;
|
|
67
|
+
/**
|
|
68
|
+
* The maximum number of characters a user can enter into the text field. Set
|
|
69
|
+
* to -1 for none.
|
|
70
|
+
*
|
|
71
|
+
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#maxlength
|
|
72
|
+
*/
|
|
73
|
+
maxLength: number;
|
|
74
|
+
/**
|
|
75
|
+
* Defines the most negative value in the range of permitted values.
|
|
76
|
+
*
|
|
77
|
+
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#min
|
|
78
|
+
*/
|
|
79
|
+
min: string;
|
|
80
|
+
/**
|
|
81
|
+
* The minimum number of characters a user can enter into the text field. Set
|
|
82
|
+
* to -1 for none.
|
|
83
|
+
*
|
|
84
|
+
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#minlength
|
|
85
|
+
*/
|
|
86
|
+
minLength: number;
|
|
87
|
+
/**
|
|
88
|
+
* A regular expression that the text field's value must match to pass
|
|
89
|
+
* constraint validation.
|
|
90
|
+
*
|
|
91
|
+
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#pattern
|
|
92
|
+
*/
|
|
93
|
+
pattern: string;
|
|
94
|
+
placeholder: string;
|
|
95
|
+
/**
|
|
96
|
+
* Indicates whether or not a user should be able to edit the text field's
|
|
97
|
+
* value.
|
|
98
|
+
*
|
|
99
|
+
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#readonly
|
|
100
|
+
*/
|
|
101
|
+
readOnly: boolean;
|
|
102
|
+
mdTextfield: HTMLInputElement;
|
|
103
|
+
handleChange(e: Event): void;
|
|
104
|
+
getValidityStatus(): boolean;
|
|
105
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
106
|
+
}
|
|
107
|
+
declare global {
|
|
108
|
+
interface HTMLElementTagNameMap {
|
|
109
|
+
'ix-textbox': IxTextbox;
|
|
110
|
+
}
|
|
111
|
+
}
|