@kubex/zinc 1.1.123 → 1.1.124
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/dist/custom-elements.json +80 -79
- package/dist/vscode.html-custom-data.json +12 -12
- package/dist/web-types.json +25 -25
- package/dist/zn.d.ts +4 -1
- package/dist/zn.min.js +80 -76
- package/docs/pages/components/data-table-search.md +4 -3
- package/package.json +1 -1
- package/src/components/data-table/data-table.scss +2 -6
- package/src/components/data-table-search/data-table-search.component.ts +9 -2
- package/src/components/data-table-search/data-table-search.scss +28 -4
- package/src/components/header/header.scss +2 -0
- package/src/components/input/input.component.ts +1 -1
- package/src/components/select/select.component.ts +1 -1
|
@@ -29,7 +29,8 @@ Use the `placeholder` attribute to customize the input placeholder text.
|
|
|
29
29
|
|
|
30
30
|
### Help Text
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
Use the `help-text` attribute to explain what can be searched. It shows an information icon inside the search field,
|
|
33
|
+
before the search icon, and reads out as a tooltip on hover or focus.
|
|
33
34
|
|
|
34
35
|
```html:preview
|
|
35
36
|
<zn-data-table-search
|
|
@@ -404,7 +405,7 @@ The component is built with accessibility in mind:
|
|
|
404
405
|
- Includes a visible trailing search icon for visual recognition
|
|
405
406
|
- Supports keyboard navigation and clearing via the clearable input
|
|
406
407
|
- Integrates with form validation and submission
|
|
407
|
-
-
|
|
408
|
+
- Explains what is searchable through the help-text attribute, shown from an information icon
|
|
408
409
|
|
|
409
410
|
## Properties
|
|
410
411
|
|
|
@@ -413,7 +414,7 @@ The component is built with accessibility in mind:
|
|
|
413
414
|
| `name` | `name` | `string` | `'search'` | The name of the search input field for form submission |
|
|
414
415
|
| `value` | `value` | `string` | `''` | The current search value |
|
|
415
416
|
| `placeholder` | `placeholder` | `string` | `'Search...'`| The placeholder text for the search input |
|
|
416
|
-
| `helpText` | `help-text` | `string` | `''` | Help text
|
|
417
|
+
| `helpText` | `help-text` | `string` | `''` | Help text, shown from an information icon inside the search input |
|
|
417
418
|
| `searchUri` | `search-uri` | `string` | `undefined` | Optional URI to use for search operations |
|
|
418
419
|
| `debounceDelay`| `debounce-delay` | `number` | `350` | The delay in milliseconds before triggering a search after the user stops typing |
|
|
419
420
|
|
package/package.json
CHANGED
|
@@ -227,7 +227,7 @@ table {
|
|
|
227
227
|
display: flex;
|
|
228
228
|
flex-direction: row;
|
|
229
229
|
justify-content: space-between;
|
|
230
|
-
align-items:
|
|
230
|
+
align-items: center;
|
|
231
231
|
padding: var(--zn-spacing-x-small) var(--zn-spacing-medium);
|
|
232
232
|
gap: var(--zn-spacing-small);
|
|
233
233
|
|
|
@@ -246,20 +246,16 @@ table {
|
|
|
246
246
|
&__caption {
|
|
247
247
|
@include wc.text-style(h1);
|
|
248
248
|
|
|
249
|
-
// Sits on the same 36px line as the controls opposite it
|
|
250
|
-
line-height: 36px;
|
|
251
249
|
margin: 0;
|
|
252
250
|
overflow: hidden;
|
|
253
251
|
white-space: nowrap;
|
|
254
252
|
text-overflow: ellipsis;
|
|
255
253
|
}
|
|
256
254
|
|
|
257
|
-
// Controls are a uniform 36px, so topping them out keeps them on one line while
|
|
258
|
-
// a search's help text grows the header downwards
|
|
259
255
|
&__right {
|
|
260
256
|
display: flex;
|
|
261
257
|
flex-direction: row;
|
|
262
|
-
align-items:
|
|
258
|
+
align-items: center;
|
|
263
259
|
gap: var(--zn-spacing-x-small);
|
|
264
260
|
margin-left: auto;
|
|
265
261
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {type CSSResultGroup, html, type PropertyValues, unsafeCSS} from 'lit';
|
|
1
|
+
import {type CSSResultGroup, html, nothing, type PropertyValues, unsafeCSS} from 'lit';
|
|
2
2
|
import {FormControlController, validValidityState} from "../../internal/form";
|
|
3
3
|
import {property} from 'lit/decorators.js';
|
|
4
4
|
import ZincElement, {type ZincFormControl} from '../../internal/zinc-element';
|
|
5
5
|
import ZnInput from "../input";
|
|
6
|
+
import ZnTooltip from "../tooltip";
|
|
6
7
|
import type ZnDataSelect from "../data-select";
|
|
7
8
|
import type ZnQueryBuilder from "../query-builder";
|
|
8
9
|
import type ZnSelect from "../select";
|
|
@@ -25,6 +26,7 @@ type AllowedInputElement =
|
|
|
25
26
|
* @since 1.0
|
|
26
27
|
*
|
|
27
28
|
* @dependency zn-input
|
|
29
|
+
* @dependency zn-tooltip
|
|
28
30
|
*
|
|
29
31
|
* @event zn-search-change - Emitted when the search value changes (debounced).
|
|
30
32
|
*
|
|
@@ -35,7 +37,7 @@ type AllowedInputElement =
|
|
|
35
37
|
* @property {string} name - The name of the search input field (default: "search").
|
|
36
38
|
* @property {string} value - The current search value.
|
|
37
39
|
* @property {string} placeholder - The placeholder text for the search input (default: "Search...").
|
|
38
|
-
* @property {string} helpText - Help text
|
|
40
|
+
* @property {string} helpText - Help text, shown from an information icon inside the search input.
|
|
39
41
|
* @property {string} searchUri - Optional URI to use for search operations.
|
|
40
42
|
* @property {number} debounceDelay - The delay in milliseconds before triggering a search (default: 500).
|
|
41
43
|
*/
|
|
@@ -43,6 +45,7 @@ export default class ZnDataTableSearch extends ZincElement implements ZincFormCo
|
|
|
43
45
|
static styles: CSSResultGroup = unsafeCSS(styles);
|
|
44
46
|
static dependencies = {
|
|
45
47
|
'zn-input': ZnInput,
|
|
48
|
+
'zn-tooltip': ZnTooltip,
|
|
46
49
|
};
|
|
47
50
|
|
|
48
51
|
private _formController: FormControlController = new FormControlController(this, {});
|
|
@@ -187,6 +190,10 @@ export default class ZnDataTableSearch extends ZincElement implements ZincFormCo
|
|
|
187
190
|
clearable
|
|
188
191
|
@zn-input="${this.handleInput}"
|
|
189
192
|
@zn-clear="${this.handleClear}">
|
|
193
|
+
${this.helpText ? html`
|
|
194
|
+
<zn-tooltip slot="suffix" class="data-table-search__tooltip" content="${this.helpText}">
|
|
195
|
+
<zn-icon src="info@lu" size="20"></zn-icon>
|
|
196
|
+
</zn-tooltip>` : nothing}
|
|
190
197
|
<zn-icon slot="suffix" src="search@lu" size="20"></zn-icon>
|
|
191
198
|
</zn-input>
|
|
192
199
|
<slot style="display: none"></slot>
|
|
@@ -11,12 +11,36 @@
|
|
|
11
11
|
min-width: 200px;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
//
|
|
14
|
+
// Keeps the focus ring inside the component's own box, so a toolbar or header that
|
|
15
|
+
// hugs the input can't clip it
|
|
15
16
|
zn-input::part(form-control-input) {
|
|
16
|
-
margin:
|
|
17
|
+
margin: var(--zn-focus-ring-width);
|
|
17
18
|
}
|
|
18
19
|
|
|
20
|
+
// The help text is shown from the info icon instead, but zn-input still points the
|
|
21
|
+
// input's aria-describedby at it, so hide it rather than dropping it
|
|
19
22
|
zn-input::part(form-control-help-text) {
|
|
20
|
-
|
|
21
|
-
|
|
23
|
+
position: absolute;
|
|
24
|
+
width: 1px;
|
|
25
|
+
height: 1px;
|
|
26
|
+
overflow: hidden;
|
|
27
|
+
clip-path: inset(50%);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// zn-input pads the clear button out to 1em + 2 * --zn-input-spacing-medium, which
|
|
31
|
+
// leaves it sitting further from its neighbour than the suffix icons are from theirs
|
|
32
|
+
zn-input::part(clear-button) {
|
|
33
|
+
width: auto;
|
|
34
|
+
margin-inline-end: var(--zn-spacing-small);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Slotted into the input's suffix, out of reach of zn-input's own icon rules
|
|
38
|
+
.data-table-search__tooltip {
|
|
39
|
+
display: flex;
|
|
40
|
+
align-items: center;
|
|
41
|
+
|
|
42
|
+
zn-icon {
|
|
43
|
+
color: var(--zn-input-icon-color);
|
|
44
|
+
cursor: help;
|
|
45
|
+
}
|
|
22
46
|
}
|
|
@@ -1064,7 +1064,7 @@ export default class ZnInput extends ZincElement implements ZincFormControl {
|
|
|
1064
1064
|
@click=${this.handleClearClick}
|
|
1065
1065
|
tabindex="-1">
|
|
1066
1066
|
<slot name="clear-icon">
|
|
1067
|
-
<zn-icon src="
|
|
1067
|
+
<zn-icon src="circle-x@lu" size="20"></zn-icon>
|
|
1068
1068
|
</slot>
|
|
1069
1069
|
</button>`
|
|
1070
1070
|
: ''}
|
|
@@ -1934,7 +1934,7 @@ export default class ZnSelect extends ZincElement implements ZincFormControl {
|
|
|
1934
1934
|
@click=${this.handleClearClick}
|
|
1935
1935
|
tabindex="-1">
|
|
1936
1936
|
<slot name="clear-icon">
|
|
1937
|
-
<zn-icon src="
|
|
1937
|
+
<zn-icon src="circle-x@lu" size="20"></zn-icon>
|
|
1938
1938
|
</slot>
|
|
1939
1939
|
</button>`
|
|
1940
1940
|
: ''}
|