kr-elements 0.0.1-alpha.8 → 0.0.1-alpha.9

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.
@@ -1,6 +1,3 @@
1
- import type React from 'react';
2
-
3
-
4
1
  interface HTMLComboboxTagElement extends HTMLElement {}
5
2
 
6
3
  interface HTMLComboboxOptionElement extends HTMLOptionElement {
@@ -129,71 +126,88 @@ interface ComboboxEventMap extends HTMLElementEventMap {
129
126
  "selectstart": ComboboxEvent;
130
127
  }
131
128
 
132
- // Add to tag name map
133
129
  declare global {
134
130
  interface HTMLElementTagNameMap {
135
131
  'combo-box': HTMLComboboxElement;
136
132
  'box-option': HTMLComboboxOptionElement;
137
133
  'box-tag': HTMLComboboxTagElement;
138
134
  }
139
- }
140
135
 
141
- declare namespace JSX {
142
- interface IntrinsicElements {
143
- 'combo-box': React.DetailedHTMLProps<React.HTMLAttributes<HTMLComboboxElement>, HTMLComboboxElement> & {
144
- /** The value of internal input
145
- *
146
- * Internal input is visible when either "searchable" or "filterable" attribute is presented */
147
- value?: string;
148
-
149
- /** The value of internal input
150
- *
151
- * Internal input is visible when either "searchable" or "filterable" attribute is presented */
152
- query?: string;
153
-
154
- /** When is true, the internal input is shown.
155
- *
156
- * When user type something, available options are filtered by this query.
157
- *
158
- * Setting both "filterable" and "searchable" make no sense, the "searchable" will have priority
159
- * */
160
- filterable?: boolean;
161
-
162
- /** When is true, the internal input is shown.
163
- *
164
- * When user type something, available options are not filtered by this query.
165
- * You have to set an "input" listener to the <combo-box> and filter options by yourself
166
- *
167
- * Setting both "searchable" and "filterable" make no sense, the "searchable" will have priority
168
- * */
169
- searchable?: boolean;
170
-
171
- /** When is true, the clear-all-button is shown in the <combo-box> itself,
172
- * and the clear-button is shown for each selected tag.
173
- *
174
- * If multiple attribute is set to "true", this is also enabled.
175
- *
176
- * If multiple attribute is set to "false", i.e. the <combo-box> is used as a <select>,
177
- * then setting this attribute to "true" will make the clear-button of selected tag visible
178
- * */
179
- clearable?: boolean;
180
-
181
- /** The placeholder of internal input
182
- *
183
- * Internal input is visible when either "searchable" or "filterable" attribute is presented
184
- *
185
- * When <combo-box> is empty, this value is also shown as <combo-box> placeholder itself
186
- * */
187
- placeholder?: string;
188
-
189
-
190
- multiple?: boolean
191
-
192
- // Events
193
- onChange?: (event: React.SyntheticEvent<HTMLComboboxElement>) => void;
194
- onInput?: (event: React.FormEvent<HTMLComboboxElement>) => void;
195
- onInvalid?: (event: React.FormEvent<HTMLComboboxElement>) => void;
196
-
197
- };
136
+ // This makes it work in any framework's JSX
137
+ namespace JSX {
138
+ interface IntrinsicElements {
139
+ 'combo-box': any; // Just tell TS it exists, framework handles the rest
140
+ 'box-option': any;
141
+ 'box-tag': any;
142
+ }
198
143
  }
199
- }
144
+ }
145
+
146
+ // // Add to tag name map
147
+ // declare global {
148
+ // interface HTMLElementTagNameMap {
149
+ // 'combo-box': HTMLComboboxElement;
150
+ // 'box-option': HTMLComboboxOptionElement;
151
+ // 'box-tag': HTMLComboboxTagElement;
152
+ // }
153
+ // }
154
+ //
155
+ // declare namespace JSX {
156
+ // interface IntrinsicElements {
157
+ // 'combo-box': React.DetailedHTMLProps<React.HTMLAttributes<HTMLComboboxElement>, HTMLComboboxElement> & {
158
+ // /** The value of internal input
159
+ // *
160
+ // * Internal input is visible when either "searchable" or "filterable" attribute is presented */
161
+ // value?: string;
162
+ //
163
+ // /** The value of internal input
164
+ // *
165
+ // * Internal input is visible when either "searchable" or "filterable" attribute is presented */
166
+ // query?: string;
167
+ //
168
+ // /** When is true, the internal input is shown.
169
+ // *
170
+ // * When user type something, available options are filtered by this query.
171
+ // *
172
+ // * Setting both "filterable" and "searchable" make no sense, the "searchable" will have priority
173
+ // * */
174
+ // filterable?: boolean;
175
+ //
176
+ // /** When is true, the internal input is shown.
177
+ // *
178
+ // * When user type something, available options are not filtered by this query.
179
+ // * You have to set an "input" listener to the <combo-box> and filter options by yourself
180
+ // *
181
+ // * Setting both "searchable" and "filterable" make no sense, the "searchable" will have priority
182
+ // * */
183
+ // searchable?: boolean;
184
+ //
185
+ // /** When is true, the clear-all-button is shown in the <combo-box> itself,
186
+ // * and the clear-button is shown for each selected tag.
187
+ // *
188
+ // * If multiple attribute is set to "true", this is also enabled.
189
+ // *
190
+ // * If multiple attribute is set to "false", i.e. the <combo-box> is used as a <select>,
191
+ // * then setting this attribute to "true" will make the clear-button of selected tag visible
192
+ // * */
193
+ // clearable?: boolean;
194
+ //
195
+ // /** The placeholder of internal input
196
+ // *
197
+ // * Internal input is visible when either "searchable" or "filterable" attribute is presented
198
+ // *
199
+ // * When <combo-box> is empty, this value is also shown as <combo-box> placeholder itself
200
+ // * */
201
+ // placeholder?: string;
202
+ //
203
+ //
204
+ // multiple?: boolean
205
+ //
206
+ // // Events
207
+ // onChange?: (event: React.SyntheticEvent<HTMLComboboxElement>) => void;
208
+ // onInput?: (event: React.FormEvent<HTMLComboboxElement>) => void;
209
+ // onInvalid?: (event: React.FormEvent<HTMLComboboxElement>) => void;
210
+ //
211
+ // };
212
+ // }
213
+ // }
@@ -1,2 +1 @@
1
- /// <reference types="src/combobox/combobox.js" />
2
1
  export * from './HTML.combobox.element.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kr-elements",
3
- "version": "0.0.1-alpha.8",
3
+ "version": "0.0.1-alpha.9",
4
4
  "description": "Custom elements",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -41,7 +41,7 @@
41
41
  ],
42
42
  "exports": {
43
43
  "./combobox": {
44
- "types": "./dist/types/combobox/combobox.d.ts",
44
+ "types": "./dist/types/combobox/index.d.ts",
45
45
  "require": "./dist/cjs/combobox/index.js",
46
46
  "import": "./dist/esm/combobox/index.js"
47
47
  }
@@ -1,6 +1,3 @@
1
- import type React from 'react';
2
-
3
-
4
1
  interface HTMLComboboxTagElement extends HTMLElement {}
5
2
 
6
3
  interface HTMLComboboxOptionElement extends HTMLOptionElement {
@@ -129,71 +126,88 @@ interface ComboboxEventMap extends HTMLElementEventMap {
129
126
  "selectstart": ComboboxEvent;
130
127
  }
131
128
 
132
- // Add to tag name map
133
129
  declare global {
134
130
  interface HTMLElementTagNameMap {
135
131
  'combo-box': HTMLComboboxElement;
136
132
  'box-option': HTMLComboboxOptionElement;
137
133
  'box-tag': HTMLComboboxTagElement;
138
134
  }
139
- }
140
135
 
141
- declare namespace JSX {
142
- interface IntrinsicElements {
143
- 'combo-box': React.DetailedHTMLProps<React.HTMLAttributes<HTMLComboboxElement>, HTMLComboboxElement> & {
144
- /** The value of internal input
145
- *
146
- * Internal input is visible when either "searchable" or "filterable" attribute is presented */
147
- value?: string;
148
-
149
- /** The value of internal input
150
- *
151
- * Internal input is visible when either "searchable" or "filterable" attribute is presented */
152
- query?: string;
153
-
154
- /** When is true, the internal input is shown.
155
- *
156
- * When user type something, available options are filtered by this query.
157
- *
158
- * Setting both "filterable" and "searchable" make no sense, the "searchable" will have priority
159
- * */
160
- filterable?: boolean;
161
-
162
- /** When is true, the internal input is shown.
163
- *
164
- * When user type something, available options are not filtered by this query.
165
- * You have to set an "input" listener to the <combo-box> and filter options by yourself
166
- *
167
- * Setting both "searchable" and "filterable" make no sense, the "searchable" will have priority
168
- * */
169
- searchable?: boolean;
170
-
171
- /** When is true, the clear-all-button is shown in the <combo-box> itself,
172
- * and the clear-button is shown for each selected tag.
173
- *
174
- * If multiple attribute is set to "true", this is also enabled.
175
- *
176
- * If multiple attribute is set to "false", i.e. the <combo-box> is used as a <select>,
177
- * then setting this attribute to "true" will make the clear-button of selected tag visible
178
- * */
179
- clearable?: boolean;
180
-
181
- /** The placeholder of internal input
182
- *
183
- * Internal input is visible when either "searchable" or "filterable" attribute is presented
184
- *
185
- * When <combo-box> is empty, this value is also shown as <combo-box> placeholder itself
186
- * */
187
- placeholder?: string;
188
-
189
-
190
- multiple?: boolean
191
-
192
- // Events
193
- onChange?: (event: React.SyntheticEvent<HTMLComboboxElement>) => void;
194
- onInput?: (event: React.FormEvent<HTMLComboboxElement>) => void;
195
- onInvalid?: (event: React.FormEvent<HTMLComboboxElement>) => void;
196
-
197
- };
136
+ // This makes it work in any framework's JSX
137
+ namespace JSX {
138
+ interface IntrinsicElements {
139
+ 'combo-box': any; // Just tell TS it exists, framework handles the rest
140
+ 'box-option': any;
141
+ 'box-tag': any;
142
+ }
198
143
  }
199
- }
144
+ }
145
+
146
+ // // Add to tag name map
147
+ // declare global {
148
+ // interface HTMLElementTagNameMap {
149
+ // 'combo-box': HTMLComboboxElement;
150
+ // 'box-option': HTMLComboboxOptionElement;
151
+ // 'box-tag': HTMLComboboxTagElement;
152
+ // }
153
+ // }
154
+ //
155
+ // declare namespace JSX {
156
+ // interface IntrinsicElements {
157
+ // 'combo-box': React.DetailedHTMLProps<React.HTMLAttributes<HTMLComboboxElement>, HTMLComboboxElement> & {
158
+ // /** The value of internal input
159
+ // *
160
+ // * Internal input is visible when either "searchable" or "filterable" attribute is presented */
161
+ // value?: string;
162
+ //
163
+ // /** The value of internal input
164
+ // *
165
+ // * Internal input is visible when either "searchable" or "filterable" attribute is presented */
166
+ // query?: string;
167
+ //
168
+ // /** When is true, the internal input is shown.
169
+ // *
170
+ // * When user type something, available options are filtered by this query.
171
+ // *
172
+ // * Setting both "filterable" and "searchable" make no sense, the "searchable" will have priority
173
+ // * */
174
+ // filterable?: boolean;
175
+ //
176
+ // /** When is true, the internal input is shown.
177
+ // *
178
+ // * When user type something, available options are not filtered by this query.
179
+ // * You have to set an "input" listener to the <combo-box> and filter options by yourself
180
+ // *
181
+ // * Setting both "searchable" and "filterable" make no sense, the "searchable" will have priority
182
+ // * */
183
+ // searchable?: boolean;
184
+ //
185
+ // /** When is true, the clear-all-button is shown in the <combo-box> itself,
186
+ // * and the clear-button is shown for each selected tag.
187
+ // *
188
+ // * If multiple attribute is set to "true", this is also enabled.
189
+ // *
190
+ // * If multiple attribute is set to "false", i.e. the <combo-box> is used as a <select>,
191
+ // * then setting this attribute to "true" will make the clear-button of selected tag visible
192
+ // * */
193
+ // clearable?: boolean;
194
+ //
195
+ // /** The placeholder of internal input
196
+ // *
197
+ // * Internal input is visible when either "searchable" or "filterable" attribute is presented
198
+ // *
199
+ // * When <combo-box> is empty, this value is also shown as <combo-box> placeholder itself
200
+ // * */
201
+ // placeholder?: string;
202
+ //
203
+ //
204
+ // multiple?: boolean
205
+ //
206
+ // // Events
207
+ // onChange?: (event: React.SyntheticEvent<HTMLComboboxElement>) => void;
208
+ // onInput?: (event: React.FormEvent<HTMLComboboxElement>) => void;
209
+ // onInvalid?: (event: React.FormEvent<HTMLComboboxElement>) => void;
210
+ //
211
+ // };
212
+ // }
213
+ // }