kr-elements 0.0.1-alpha.7 → 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.
|
@@ -126,71 +126,88 @@ interface ComboboxEventMap extends HTMLElementEventMap {
|
|
|
126
126
|
"selectstart": ComboboxEvent;
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
// Add to tag name map
|
|
130
129
|
declare global {
|
|
131
130
|
interface HTMLElementTagNameMap {
|
|
132
131
|
'combo-box': HTMLComboboxElement;
|
|
133
132
|
'box-option': HTMLComboboxOptionElement;
|
|
134
133
|
'box-tag': HTMLComboboxTagElement;
|
|
135
134
|
}
|
|
136
|
-
}
|
|
137
135
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
/** The value of internal input
|
|
147
|
-
*
|
|
148
|
-
* Internal input is visible when either "searchable" or "filterable" attribute is presented */
|
|
149
|
-
query?: string;
|
|
150
|
-
|
|
151
|
-
/** When is true, the internal input is shown.
|
|
152
|
-
*
|
|
153
|
-
* When user type something, available options are filtered by this query.
|
|
154
|
-
*
|
|
155
|
-
* Setting both "filterable" and "searchable" make no sense, the "searchable" will have priority
|
|
156
|
-
* */
|
|
157
|
-
filterable?: boolean;
|
|
158
|
-
|
|
159
|
-
/** When is true, the internal input is shown.
|
|
160
|
-
*
|
|
161
|
-
* When user type something, available options are not filtered by this query.
|
|
162
|
-
* You have to set an "input" listener to the <combo-box> and filter options by yourself
|
|
163
|
-
*
|
|
164
|
-
* Setting both "searchable" and "filterable" make no sense, the "searchable" will have priority
|
|
165
|
-
* */
|
|
166
|
-
searchable?: boolean;
|
|
167
|
-
|
|
168
|
-
/** When is true, the clear-all-button is shown in the <combo-box> itself,
|
|
169
|
-
* and the clear-button is shown for each selected tag.
|
|
170
|
-
*
|
|
171
|
-
* If multiple attribute is set to "true", this is also enabled.
|
|
172
|
-
*
|
|
173
|
-
* If multiple attribute is set to "false", i.e. the <combo-box> is used as a <select>,
|
|
174
|
-
* then setting this attribute to "true" will make the clear-button of selected tag visible
|
|
175
|
-
* */
|
|
176
|
-
clearable?: boolean;
|
|
177
|
-
|
|
178
|
-
/** The placeholder of internal input
|
|
179
|
-
*
|
|
180
|
-
* Internal input is visible when either "searchable" or "filterable" attribute is presented
|
|
181
|
-
*
|
|
182
|
-
* When <combo-box> is empty, this value is also shown as <combo-box> placeholder itself
|
|
183
|
-
* */
|
|
184
|
-
placeholder?: string;
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
multiple?: boolean
|
|
188
|
-
|
|
189
|
-
// Events
|
|
190
|
-
onChange?: (event: React.SyntheticEvent<HTMLComboboxElement>) => void;
|
|
191
|
-
onInput?: (event: React.FormEvent<HTMLComboboxElement>) => void;
|
|
192
|
-
onInvalid?: (event: React.FormEvent<HTMLComboboxElement>) => void;
|
|
193
|
-
|
|
194
|
-
};
|
|
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
|
+
}
|
|
195
143
|
}
|
|
196
|
-
}
|
|
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
|
+
// }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kr-elements",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.9",
|
|
4
4
|
"description": "Custom elements",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@espcom/eslint-config": "latest",
|
|
22
22
|
"@types/node": "22.8.6",
|
|
23
|
+
"@types/react": "^19.2.14",
|
|
23
24
|
"c8": "10.1.2",
|
|
24
25
|
"esbuild": "0.25.5",
|
|
25
26
|
"husky": "9.1.5",
|
|
@@ -40,7 +41,7 @@
|
|
|
40
41
|
],
|
|
41
42
|
"exports": {
|
|
42
43
|
"./combobox": {
|
|
43
|
-
"types": "./dist/types/combobox/
|
|
44
|
+
"types": "./dist/types/combobox/index.d.ts",
|
|
44
45
|
"require": "./dist/cjs/combobox/index.js",
|
|
45
46
|
"import": "./dist/esm/combobox/index.js"
|
|
46
47
|
}
|
|
@@ -126,71 +126,88 @@ interface ComboboxEventMap extends HTMLElementEventMap {
|
|
|
126
126
|
"selectstart": ComboboxEvent;
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
// Add to tag name map
|
|
130
129
|
declare global {
|
|
131
130
|
interface HTMLElementTagNameMap {
|
|
132
131
|
'combo-box': HTMLComboboxElement;
|
|
133
132
|
'box-option': HTMLComboboxOptionElement;
|
|
134
133
|
'box-tag': HTMLComboboxTagElement;
|
|
135
134
|
}
|
|
136
|
-
}
|
|
137
135
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
/** The value of internal input
|
|
147
|
-
*
|
|
148
|
-
* Internal input is visible when either "searchable" or "filterable" attribute is presented */
|
|
149
|
-
query?: string;
|
|
150
|
-
|
|
151
|
-
/** When is true, the internal input is shown.
|
|
152
|
-
*
|
|
153
|
-
* When user type something, available options are filtered by this query.
|
|
154
|
-
*
|
|
155
|
-
* Setting both "filterable" and "searchable" make no sense, the "searchable" will have priority
|
|
156
|
-
* */
|
|
157
|
-
filterable?: boolean;
|
|
158
|
-
|
|
159
|
-
/** When is true, the internal input is shown.
|
|
160
|
-
*
|
|
161
|
-
* When user type something, available options are not filtered by this query.
|
|
162
|
-
* You have to set an "input" listener to the <combo-box> and filter options by yourself
|
|
163
|
-
*
|
|
164
|
-
* Setting both "searchable" and "filterable" make no sense, the "searchable" will have priority
|
|
165
|
-
* */
|
|
166
|
-
searchable?: boolean;
|
|
167
|
-
|
|
168
|
-
/** When is true, the clear-all-button is shown in the <combo-box> itself,
|
|
169
|
-
* and the clear-button is shown for each selected tag.
|
|
170
|
-
*
|
|
171
|
-
* If multiple attribute is set to "true", this is also enabled.
|
|
172
|
-
*
|
|
173
|
-
* If multiple attribute is set to "false", i.e. the <combo-box> is used as a <select>,
|
|
174
|
-
* then setting this attribute to "true" will make the clear-button of selected tag visible
|
|
175
|
-
* */
|
|
176
|
-
clearable?: boolean;
|
|
177
|
-
|
|
178
|
-
/** The placeholder of internal input
|
|
179
|
-
*
|
|
180
|
-
* Internal input is visible when either "searchable" or "filterable" attribute is presented
|
|
181
|
-
*
|
|
182
|
-
* When <combo-box> is empty, this value is also shown as <combo-box> placeholder itself
|
|
183
|
-
* */
|
|
184
|
-
placeholder?: string;
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
multiple?: boolean
|
|
188
|
-
|
|
189
|
-
// Events
|
|
190
|
-
onChange?: (event: React.SyntheticEvent<HTMLComboboxElement>) => void;
|
|
191
|
-
onInput?: (event: React.FormEvent<HTMLComboboxElement>) => void;
|
|
192
|
-
onInvalid?: (event: React.FormEvent<HTMLComboboxElement>) => void;
|
|
193
|
-
|
|
194
|
-
};
|
|
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
|
+
}
|
|
195
143
|
}
|
|
196
|
-
}
|
|
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
|
+
// }
|