@digital-realty/ix-textbox 2.0.1 → 2.0.5

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.
Files changed (40) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +68 -62
  3. package/dist/src/IxTextbox.d.ts +111 -105
  4. package/dist/src/IxTextbox.js +250 -239
  5. package/dist/src/IxTextbox.js.map +1 -1
  6. package/dist/src/index.d.ts +1 -1
  7. package/dist/src/index.js +1 -1
  8. package/dist/src/index.js.map +1 -1
  9. package/dist/src/ix-textbox-styles.d.ts +1 -1
  10. package/dist/src/ix-textbox-styles.js +58 -58
  11. package/dist/src/ix-textbox-styles.js.map +1 -1
  12. package/dist/src/ix-textbox.d.ts +1 -1
  13. package/dist/src/ix-textbox.js +2 -2
  14. package/dist/src/ix-textbox.js.map +1 -1
  15. package/dist/src/react/IxTextbox.d.ts +2 -0
  16. package/dist/src/react/IxTextbox.js +10 -0
  17. package/dist/src/react/IxTextbox.js.map +1 -0
  18. package/dist/src/types/index.d.ts +14 -8
  19. package/dist/src/types/index.js +1 -1
  20. package/dist/src/types/index.js.map +1 -1
  21. package/dist/test/ix-textbox.test.d.ts +1 -1
  22. package/dist/test/ix-textbox.test.js +22 -22
  23. package/dist/test/ix-textbox.test.js.map +1 -1
  24. package/dist/tsconfig.tsbuildinfo +1 -1
  25. package/package.json +94 -91
  26. package/src/IxTextbox.ts +216 -194
  27. package/src/index.ts +1 -1
  28. package/src/ix-textbox-styles.ts +59 -59
  29. package/src/ix-textbox.ts +3 -3
  30. package/src/react/IxTextbox.ts +11 -0
  31. package/src/types/index.ts +29 -24
  32. package/test/ix-textbox.test.ts +32 -32
  33. package/tsconfig.json +22 -22
  34. package/web-dev-server.config.mjs +27 -27
  35. package/web-test-runner.config.mjs +41 -41
  36. package/.editorconfig +0 -29
  37. package/demo/index.html +0 -29
  38. package/dist/stories/index.stories.d.ts +0 -33
  39. package/dist/stories/index.stories.js +0 -37
  40. package/dist/stories/index.stories.js.map +0 -1
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,62 +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
-
21
- ## Linting and formatting
22
-
23
- To scan the project for linting and formatting errors, run
24
-
25
- ```bash
26
- npm run lint
27
- ```
28
-
29
- To automatically fix linting and formatting errors, run
30
-
31
- ```bash
32
- npm run format
33
- ```
34
-
35
- ## Testing with Web Test Runner
36
-
37
- To execute a single test run:
38
-
39
- ```bash
40
- npm run test
41
- ```
42
-
43
- To run the tests in interactive watch mode run:
44
-
45
- ```bash
46
- npm run test:watch
47
- ```
48
-
49
-
50
- ## Tooling configs
51
-
52
- For most of the tools, the configuration is in the `package.json` to reduce the amount of files in your project.
53
-
54
- If you customize the configuration a lot, you can consider moving them to individual files.
55
-
56
- ## Local Demo with `web-dev-server`
57
-
58
- ```bash
59
- npm start
60
- ```
61
-
62
- 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`
@@ -1,105 +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
- onChange: Function;
103
- _handleChange(e: Event): void;
104
- render(): import("lit-html").TemplateResult<1>;
105
- }
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
+ }