@fusion.dev/helix-headless 0.104.1 → 0.106.0
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/custom-elements.json +10386 -3813
- package/dist/accordion/item/accordion-item.d.ts +17 -16
- package/dist/accordion/root/accordion-root.d.ts +13 -17
- package/dist/announcement/root/announcement-root.d.ts +24 -31
- package/dist/app-header/root/app-header-root.d.ts +14 -14
- package/dist/area-chart/root/area-chart-root.d.ts +29 -48
- package/dist/avatar/group/avatar-group.d.ts +6 -8
- package/dist/avatar/root/avatar-root.d.ts +11 -11
- package/dist/badge/root/badge-root.d.ts +14 -15
- package/dist/bar-chart/root/bar-chart-root.d.ts +40 -44
- package/dist/blockquote/root/blockquote-root.d.ts +5 -7
- package/dist/breadcrumbs/breadcrumb/breadcrumb.d.ts +25 -33
- package/dist/breadcrumbs/root/breadcrumbs-root.d.ts +12 -11
- package/dist/button/root/button-root.d.ts +16 -17
- package/dist/button-group/root/button-group-root.d.ts +9 -10
- package/dist/callout/root/callout-root.d.ts +10 -15
- package/dist/canvas/edge/canvas-edge.d.ts +21 -21
- package/dist/canvas/node/canvas-node.d.ts +43 -45
- package/dist/canvas/root/canvas-root.d.ts +100 -99
- package/dist/card/root/card-root.d.ts +10 -12
- package/dist/carousel/root/carousel-root.d.ts +32 -33
- package/dist/chat/composer/chat-composer.d.ts +24 -26
- package/dist/chat/message/chat-message.d.ts +30 -33
- package/dist/chat/root/chat-root.d.ts +63 -80
- package/dist/checkbox/root/checkbox-root.d.ts +30 -32
- package/dist/checkbox-group/root/checkbox-group-root.d.ts +25 -25
- package/dist/code/root/code-root.d.ts +6 -10
- package/dist/code-block/root/code-block-root.d.ts +35 -48
- package/dist/color-input/root/color-input-root.d.ts +62 -56
- package/dist/color-input/root/color-input-root.js +3 -0
- package/dist/color-picker/root/color-picker-root.d.ts +61 -49
- package/dist/color-picker/root/color-picker-root.js +4 -0
- package/dist/combobox/root/combobox-root.d.ts +52 -53
- package/dist/command/root/command-root.d.ts +40 -40
- package/dist/command/root/command-root.js +1 -0
- package/dist/copy-button/root/copy-button-root.d.ts +24 -26
- package/dist/data-table/root/data-table-root.d.ts +106 -107
- package/dist/date-input/root/date-input-root.d.ts +54 -53
- package/dist/date-picker/root/date-picker-root.d.ts +25 -21
- package/dist/description-list/item/description-list-item.d.ts +7 -7
- package/dist/description-list/root/description-list-root.d.ts +10 -15
- package/dist/dialog/root/dialog-root.d.ts +22 -19
- package/dist/divider/root/divider-root.d.ts +12 -13
- package/dist/donut-chart/root/donut-chart-root.d.ts +19 -20
- package/dist/drawer/root/drawer-root.d.ts +19 -18
- package/dist/drilldown/item/drilldown-item.d.ts +28 -28
- package/dist/drilldown/root/drilldown-root.d.ts +22 -28
- package/dist/element-events.generated.js +19 -1
- package/dist/empty/root/empty-root.d.ts +16 -19
- package/dist/file-input/root/file-input-root.d.ts +32 -32
- package/dist/filter-input/chip/filter-chip.d.ts +36 -39
- package/dist/filter-input/field/filter-field.d.ts +25 -31
- package/dist/filter-input/menu/filter-menu.d.ts +50 -47
- package/dist/filter-input/operator/filter-operator.d.ts +15 -20
- package/dist/filter-input/root/filter-input-root.d.ts +80 -98
- package/dist/format-date/root/format-date-root.d.ts +19 -27
- package/dist/heatmap/root/heatmap-root.d.ts +40 -41
- package/dist/icon/root/icon-root.d.ts +21 -23
- package/dist/icon-button/root/icon-button-root.d.ts +12 -14
- package/dist/image/root/image-root.d.ts +30 -30
- package/dist/input/root/input-root.d.ts +36 -35
- package/dist/kbd/root/kbd-root.d.ts +13 -15
- package/dist/legend/root/legend-root.d.ts +18 -16
- package/dist/lightbox/item/lightbox-item.d.ts +13 -15
- package/dist/lightbox/root/lightbox-root.d.ts +40 -41
- package/dist/line-chart/root/line-chart-root.d.ts +20 -29
- package/dist/list/item/list-item.d.ts +17 -22
- package/dist/list/root/list-root.d.ts +6 -7
- package/dist/listbox/root/listbox-root.d.ts +42 -41
- package/dist/loader/root/loader-root.d.ts +16 -20
- package/dist/map/area/map-area.d.ts +48 -0
- package/dist/map/area/map-area.js +40 -0
- package/dist/map/buildings/map-buildings.d.ts +45 -0
- package/dist/map/buildings/map-buildings.js +37 -0
- package/dist/map/contours/map-contours.d.ts +61 -0
- package/dist/map/contours/map-contours.js +54 -0
- package/dist/map/index.d.ts +14 -0
- package/dist/map/index.js +10 -0
- package/dist/map/landcover/map-landcover.d.ts +47 -0
- package/dist/map/landcover/map-landcover.js +37 -0
- package/dist/map/marker/map-marker.d.ts +120 -0
- package/dist/map/marker/map-marker.js +109 -0
- package/dist/map/points/map-points.d.ts +139 -0
- package/dist/map/points/map-points.js +161 -0
- package/dist/map/position/map-position.d.ts +70 -0
- package/dist/map/position/map-position.js +89 -0
- package/dist/map/raster/map-raster.d.ts +84 -0
- package/dist/map/raster/map-raster.js +96 -0
- package/dist/map/root/map-root.d.ts +269 -52
- package/dist/map/root/map-root.js +473 -5
- package/dist/map/route/map-route.d.ts +73 -0
- package/dist/map/route/map-route.js +52 -0
- package/dist/map/terrain/map-terrain.d.ts +68 -0
- package/dist/map/terrain/map-terrain.js +58 -0
- package/dist/megamenu/root/megamenu-root.d.ts +27 -25
- package/dist/menu/item/menu-item.d.ts +30 -31
- package/dist/menu/root/menu-root.d.ts +25 -29
- package/dist/meter/root/meter-root.d.ts +22 -21
- package/dist/navigation/root/navigation-root.d.ts +13 -16
- package/dist/notifications/group/notification-group.d.ts +27 -28
- package/dist/notifications/notification/notification.d.ts +35 -42
- package/dist/notifications/root/notifications-root.d.ts +22 -24
- package/dist/number-input/root/number-input-root.d.ts +46 -50
- package/dist/object-inspector/root/object-inspector-root.d.ts +46 -58
- package/dist/option/group/option-group.d.ts +11 -11
- package/dist/option/root/option-root.d.ts +28 -33
- package/dist/outline/root/outline-root.d.ts +18 -17
- package/dist/pagination/root/pagination-root.d.ts +37 -39
- package/dist/pagination/size/pagination-size.d.ts +37 -43
- package/dist/pagination/summary/pagination-summary.d.ts +12 -14
- package/dist/pin-input/root/pin-input-root.d.ts +32 -38
- package/dist/popover/root/popover-root.d.ts +16 -21
- package/dist/progress/root/progress-root.d.ts +16 -14
- package/dist/qr-code/root/qr-code-root.d.ts +22 -25
- package/dist/quote/root/quote-root.d.ts +5 -6
- package/dist/radio/group/radio-group.d.ts +26 -28
- package/dist/radio/root/radio-root.d.ts +24 -28
- package/dist/rating/root/rating-root.d.ts +27 -30
- package/dist/scatter-chart/root/scatter-chart-root.d.ts +43 -55
- package/dist/scroll-area/root/scroll-area-root.d.ts +15 -21
- package/dist/select/root/select-root.d.ts +41 -44
- package/dist/skeleton/root/skeleton-root.d.ts +7 -8
- package/dist/skip-link/root/skip-link-root.d.ts +21 -28
- package/dist/slider/root/slider-root.d.ts +36 -39
- package/dist/sparkline/root/sparkline-root.d.ts +22 -28
- package/dist/speed-dial/item/speed-dial-item.d.ts +21 -21
- package/dist/speed-dial/root/speed-dial-root.d.ts +25 -27
- package/dist/splitter/root/splitter-root.d.ts +37 -41
- package/dist/stat/group/stat-group.d.ts +4 -4
- package/dist/stat/root/stat-root.d.ts +8 -9
- package/dist/steps/root/steps-root.d.ts +11 -14
- package/dist/steps/step/step.d.ts +22 -29
- package/dist/switch/root/switch-root.d.ts +20 -24
- package/dist/table/cell/table-cell.d.ts +18 -8
- package/dist/table/cell/table-cell.js +5 -1
- package/dist/table/column/table-column.d.ts +62 -55
- package/dist/table/root/table-root.d.ts +16 -17
- package/dist/table/row/table-row.d.ts +3 -3
- package/dist/tabs/panel/tab-panel.d.ts +3 -3
- package/dist/tabs/root/tabs-root.d.ts +19 -17
- package/dist/tabs/tab/tab.d.ts +6 -6
- package/dist/tag/root/tag-root.d.ts +11 -12
- package/dist/textarea/root/textarea-root.d.ts +29 -32
- package/dist/time-input/root/time-input-root.d.ts +70 -69
- package/dist/time-picker/root/time-picker-root.d.ts +58 -66
- package/dist/timeline/item/timeline-item.d.ts +18 -24
- package/dist/timeline/root/timeline-root.d.ts +13 -21
- package/dist/toast/item/toast-item.d.ts +21 -22
- package/dist/toast/root/toast-root.d.ts +18 -23
- package/dist/toggle/group/toggle-group.d.ts +23 -25
- package/dist/toggle/root/toggle-root.d.ts +8 -8
- package/dist/toolbar/root/toolbar-root.d.ts +7 -10
- package/dist/tooltip/root/tooltip-root.d.ts +41 -47
- package/dist/tour/root/tour-root.d.ts +24 -26
- package/dist/tour/stop/tour-stop.d.ts +39 -48
- package/dist/tree/item/tree-item.d.ts +23 -25
- package/dist/tree/root/tree-root.d.ts +13 -12
- package/dist/trend/root/trend-root.d.ts +18 -19
- package/dist/video/root/video-root.d.ts +108 -101
- package/dist/video-playlist/item/video-playlist-item.d.ts +23 -28
- package/dist/video-playlist/menu/video-playlist-menu.d.ts +17 -21
- package/dist/video-playlist/root/video-playlist-root.d.ts +21 -25
- package/dist/virtual-list/root/virtual-list-root.d.ts +27 -26
- package/package.json +5 -5
- package/types/jsx.d.ts +14011 -11983
- package/types/svelte.d.ts +10 -0
- package/types/vue.d.ts +2143 -1497
|
@@ -4,13 +4,12 @@ import type { HelixHeadlessOption } from '../../option/index.js';
|
|
|
4
4
|
import { type FilterGrammarField } from '../grammar.js';
|
|
5
5
|
import type { HelixHeadlessFilterOperator } from '../operator/filter-operator.js';
|
|
6
6
|
/**
|
|
7
|
-
* @summary
|
|
7
|
+
* @summary A field that a filter can apply to, with its comparisons and values.
|
|
8
8
|
*
|
|
9
9
|
* @description
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* menu:
|
|
10
|
+
* Declares a filter field. It renders nothing. Write one per field, with the
|
|
11
|
+
* operators that field supports and its values, and the filter input reads them
|
|
12
|
+
* to build its menu:
|
|
14
13
|
*
|
|
15
14
|
* ```html
|
|
16
15
|
* <helix-headless-filter-field name="disposition" label="Disposition">
|
|
@@ -22,25 +21,19 @@ import type { HelixHeadlessFilterOperator } from '../operator/filter-operator.js
|
|
|
22
21
|
* </helix-headless-filter-field>
|
|
23
22
|
* ```
|
|
24
23
|
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* chooser at all. A global list would offer every field every word and leave the
|
|
28
|
-
* component deciding which of them made sense, which is the domain question it
|
|
29
|
-
* declines to answer.
|
|
24
|
+
* Operators are declared per field. `is after` fits a date and `has all of`
|
|
25
|
+
* fits a set. A field with one operator shows no operator chooser.
|
|
30
26
|
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* them: see `vocabulary`, which is where that is decided once for the menu and
|
|
37
|
-
* the grammar together.
|
|
27
|
+
* A field that declares no operators gets two: `is any of` and `is none of`,
|
|
28
|
+
* which match the typed forms `field:a,b` and `-field:a,b`. Declare operators,
|
|
29
|
+
* as in the example above, when you want to set the words. Declaring any
|
|
30
|
+
* operator replaces both defaults. `vocabulary` defines this once for both the
|
|
31
|
+
* menu and the grammar.
|
|
38
32
|
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
* what fills a chip then is whatever the consumer types.
|
|
33
|
+
* Values are `Option` elements, with a value, a label, and a disabled state, so
|
|
34
|
+
* a picker built on `Menu` or `Listbox` can render them directly. A field whose
|
|
35
|
+
* values cannot be listed declares none, and a chip for it holds whatever you
|
|
36
|
+
* type.
|
|
44
37
|
*
|
|
45
38
|
* @since 0.23.0
|
|
46
39
|
* @status stable
|
|
@@ -48,16 +41,17 @@ import type { HelixHeadlessFilterOperator } from '../operator/filter-operator.js
|
|
|
48
41
|
* @aliases Facet, Dimension
|
|
49
42
|
* @documentation https://fusion.dev/helix/components/filter-input
|
|
50
43
|
*
|
|
51
|
-
* @slot - The
|
|
52
|
-
*
|
|
44
|
+
* @slot - The field's comparisons, as `FilterOperator`s, and its values, as
|
|
45
|
+
* `Option`s. The filter input reads them and does not render them.
|
|
53
46
|
*/
|
|
54
47
|
export declare class HelixHeadlessFilterField extends HelixElement {
|
|
55
48
|
/**
|
|
56
|
-
*
|
|
49
|
+
* The field's name as shown in the menu and on every chip built from the
|
|
50
|
+
* field.
|
|
57
51
|
*/
|
|
58
52
|
label: string;
|
|
59
53
|
/**
|
|
60
|
-
*
|
|
54
|
+
* The field's name in your data model.
|
|
61
55
|
*
|
|
62
56
|
* Never shown, and what arrives in the filter this helps build.
|
|
63
57
|
*
|
|
@@ -66,7 +60,7 @@ export declare class HelixHeadlessFilterField extends HelixElement {
|
|
|
66
60
|
*/
|
|
67
61
|
name?: string;
|
|
68
62
|
/**
|
|
69
|
-
* The comparisons declared
|
|
63
|
+
* The comparisons declared in the field, in source order.
|
|
70
64
|
*
|
|
71
65
|
* Read from the light DOM rather than from a slot, because there is no slot:
|
|
72
66
|
* this element renders nothing, so nothing is ever assigned. Order is the
|
|
@@ -78,8 +72,8 @@ export declare class HelixHeadlessFilterField extends HelixElement {
|
|
|
78
72
|
*/
|
|
79
73
|
get operators(): HelixHeadlessFilterOperator[];
|
|
80
74
|
/**
|
|
81
|
-
* The comparison a chip
|
|
82
|
-
*
|
|
75
|
+
* The comparison a chip does not show, or `null` when no operator is marked
|
|
76
|
+
* `default`.
|
|
83
77
|
*
|
|
84
78
|
* **The first one marked, and a second is reported rather than resolved.** Two
|
|
85
79
|
* defaults on one field is a consumer saying two different things, and picking
|
|
@@ -90,7 +84,7 @@ export declare class HelixHeadlessFilterField extends HelixElement {
|
|
|
90
84
|
*/
|
|
91
85
|
get defaultOperator(): HelixHeadlessFilterOperator | null;
|
|
92
86
|
/**
|
|
93
|
-
* The values declared
|
|
87
|
+
* The values declared in the field, in source order.
|
|
94
88
|
*
|
|
95
89
|
* Empty is meaningful rather than missing: a field whose values cannot be
|
|
96
90
|
* listed, a free text search or an open ended number, declares none and the
|
|
@@ -98,7 +92,7 @@ export declare class HelixHeadlessFilterField extends HelixElement {
|
|
|
98
92
|
*/
|
|
99
93
|
get values(): HelixHeadlessOption[];
|
|
100
94
|
/**
|
|
101
|
-
*
|
|
95
|
+
* The field as flat data, for the menu to render and the grammar to read.
|
|
102
96
|
*
|
|
103
97
|
* **The one place the defaults are applied.** A field that declares no
|
|
104
98
|
* comparisons supports `is any of` and `is none of`, which is what the typed
|
|
@@ -5,13 +5,12 @@ import type { FilterGrammarOperator } from '../grammar.js';
|
|
|
5
5
|
import '../../divider/index.js';
|
|
6
6
|
import '../../menu/index.js';
|
|
7
7
|
/**
|
|
8
|
-
* @summary
|
|
8
|
+
* @summary A menu for building a filter by picking a field and checking its values.
|
|
9
9
|
*
|
|
10
10
|
* @description
|
|
11
|
-
*
|
|
12
|
-
* fields
|
|
13
|
-
*
|
|
14
|
-
* knows what a field means, which is the line `FilterField` already draws.
|
|
11
|
+
* Reads the `FilterField` declarations inside it and renders a two-level menu:
|
|
12
|
+
* the fields, and under each field its operators and values. The menu does not
|
|
13
|
+
* interpret what a field means.
|
|
15
14
|
*
|
|
16
15
|
* ```html
|
|
17
16
|
* <helix-headless-filter-menu label="Filter">
|
|
@@ -21,33 +20,36 @@ import '../../menu/index.js';
|
|
|
21
20
|
* </helix-headless-filter-menu>
|
|
22
21
|
* ```
|
|
23
22
|
*
|
|
24
|
-
* That field declares no
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
23
|
+
* That field declares no operators, so it offers `is any of` and `is none of`,
|
|
24
|
+
* the two the typed grammar supports. The menu and the typed text offer the
|
|
25
|
+
* same filters because both read `FilterField.vocabulary`. Declare other
|
|
26
|
+
* operators on the field when you need them.
|
|
28
27
|
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
28
|
+
* Ticking a value applies the filter immediately. There is no Apply button.
|
|
29
|
+
* Each tick fires `helix-facet` with the field's whole set of values, so
|
|
30
|
+
* results narrow as the user works. Unticking the last value fires an empty
|
|
31
|
+
* set, which is your cue to remove the chip.
|
|
33
32
|
*
|
|
34
|
-
*
|
|
35
|
-
* `operatorLabel`
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
33
|
+
* The operator is chosen in the menu. `helix-facet` carries an empty
|
|
34
|
+
* `operatorLabel` when the operator is the field's default, which is the value
|
|
35
|
+
* a chip's `operator-label` expects, so the operator segment appears only for a
|
|
36
|
+
* non-default choice. The menu decides this because it is the only element that
|
|
37
|
+
* reads both the field and its operators.
|
|
39
38
|
*
|
|
40
|
-
*
|
|
41
|
-
* whose comparison is `arity="none"`, `is empty` or `is set`, is offered no
|
|
42
|
-
* values at all and gives back any that were ticked: the comparison is the whole
|
|
43
|
-
* filter. One at `arity="one"` offers its values as a single choice, so pressing
|
|
44
|
-
* another replaces it and pressing the one already on clears it. Both announce
|
|
45
|
-
* `arity` in the facet, which is what lets a consumer tell an empty filter from
|
|
46
|
-
* no filter at all.
|
|
39
|
+
* An operator's `arity` sets what appears under it:
|
|
47
40
|
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
41
|
+
* - `arity="none"`, such as `is empty` or `is set`, offers no values and clears
|
|
42
|
+
* any that were ticked. The operator is the whole filter.
|
|
43
|
+
* - `arity="one"` offers the values as a single choice. Pressing another value
|
|
44
|
+
* replaces the choice, and pressing the chosen value clears it.
|
|
45
|
+
*
|
|
46
|
+
* `helix-facet` includes `arity`, so you can tell an empty filter from no
|
|
47
|
+
* filter.
|
|
48
|
+
*
|
|
49
|
+
* The menu applies nothing. The chips are your markup and the rows are your
|
|
50
|
+
* data, so the menu fires the event and leaves the change to you, as
|
|
51
|
+
* `Notification` does for a read. Call `preventDefault()` on `helix-facet` to
|
|
52
|
+
* cancel the change.
|
|
51
53
|
*
|
|
52
54
|
* @since 0.25.0
|
|
53
55
|
* @status stable
|
|
@@ -55,31 +57,31 @@ import '../../menu/index.js';
|
|
|
55
57
|
* @aliases FacetPicker, FilterBuilder
|
|
56
58
|
* @documentation https://fusion.dev/helix/components/filter-input
|
|
57
59
|
*
|
|
58
|
-
* @slot - The fields
|
|
59
|
-
* @slot trigger - The control that opens the menu
|
|
60
|
+
* @slot - The fields the menu can filter by, as `FilterField`s. The menu reads them and does not render them.
|
|
61
|
+
* @slot trigger - The control that opens the menu, usually a `Button`.
|
|
60
62
|
*
|
|
61
|
-
* @event {HelixFacetEvent} helix-facet - Fired when a field's values change. Cancelable:
|
|
63
|
+
* @event {HelixFacetEvent} helix-facet - Fired when a field's values change. Cancelable: call `preventDefault()` to keep the previous values.
|
|
62
64
|
*
|
|
63
|
-
* @csspart divider - The
|
|
64
|
-
* @csspart divider-content -
|
|
65
|
-
* @csspart divider-line - The
|
|
66
|
-
* @csspart entry - One row: a field, its comparison, an operator or a value.
|
|
65
|
+
* @csspart divider - The line between a field's comparisons and its values.
|
|
66
|
+
* @csspart divider-content - The content set into the line.
|
|
67
|
+
* @csspart divider-line - The line itself.
|
|
68
|
+
* @csspart entry - One row: a field, its comparison, an operator, or a value.
|
|
67
69
|
* @csspart entry-item - The row itself.
|
|
68
|
-
* @csspart entry-mark - The
|
|
70
|
+
* @csspart entry-mark - The mark at the end of a row: a check mark on a chosen value, and a caret on a field.
|
|
69
71
|
* @csspart entry-start - The leading column.
|
|
70
72
|
* @csspart menu - The menu the fields are offered in.
|
|
71
|
-
* @csspart menu-back - The
|
|
72
|
-
* @csspart menu-back-mark - The
|
|
73
|
+
* @csspart menu-back - The button that goes back from a field's page.
|
|
74
|
+
* @csspart menu-back-mark - The icon on the back button.
|
|
73
75
|
* @csspart menu-empty - Shown when there are no fields to offer.
|
|
74
|
-
* @csspart menu-header - The bar above a field's page,
|
|
75
|
-
* @csspart menu-live - The inner menu's `live
|
|
76
|
-
* @csspart menu-loading - Shown while the fields are
|
|
76
|
+
* @csspart menu-header - The bar above a field's page, with the back button and the field's name.
|
|
77
|
+
* @csspart menu-live - The inner menu's `live` part: the region that screen readers announce the empty and loading messages from.
|
|
78
|
+
* @csspart menu-loading - Shown while the fields are loading.
|
|
77
79
|
* @csspart menu-surface - The floating panel the menu is drawn on.
|
|
78
80
|
* @csspart menu-title - The name of the field whose page is showing.
|
|
79
81
|
*/
|
|
80
82
|
export declare class HelixHeadlessFilterMenu extends HelixElement {
|
|
81
83
|
/**
|
|
82
|
-
*
|
|
84
|
+
* The menu's name, read by screen readers.
|
|
83
85
|
*/
|
|
84
86
|
label: string;
|
|
85
87
|
/**
|
|
@@ -94,7 +96,7 @@ export declare class HelixHeadlessFilterMenu extends HelixElement {
|
|
|
94
96
|
/** Which comparison each field is using, where the reader chose one. */
|
|
95
97
|
private readonly comparisons;
|
|
96
98
|
/**
|
|
97
|
-
* The fields declared inside
|
|
99
|
+
* The fields declared inside the menu, in source order.
|
|
98
100
|
*
|
|
99
101
|
* What a render may know of them: none on a server, whose shim has no tree
|
|
100
102
|
* and threw here, and none while hydrating what one sent.
|
|
@@ -107,11 +109,11 @@ export declare class HelixHeadlessFilterMenu extends HelixElement {
|
|
|
107
109
|
*/
|
|
108
110
|
get fields(): HelixHeadlessFilterField[];
|
|
109
111
|
protected firstUpdated(changed: PropertyValues): void;
|
|
110
|
-
/**
|
|
112
|
+
/** The values checked for one field. */
|
|
111
113
|
valuesFor(field: string): readonly string[];
|
|
112
114
|
/**
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
+
* The comparison a field uses: the one the user chose, or the field's
|
|
116
|
+
* `default`, or the first one the field supports, in that order.
|
|
115
117
|
*
|
|
116
118
|
* **The last of those is not a fallback for nothing, it is the scalar case.**
|
|
117
119
|
* A date supports `after` and nothing else and marks no default, because there
|
|
@@ -135,7 +137,8 @@ export declare class HelixHeadlessFilterMenu extends HelixElement {
|
|
|
135
137
|
*/
|
|
136
138
|
private announce;
|
|
137
139
|
/**
|
|
138
|
-
* Filters a field by
|
|
140
|
+
* Filters a field by the given values and sends `helix-facet`, as checking a
|
|
141
|
+
* value does.
|
|
139
142
|
*
|
|
140
143
|
* **The one way this element's state changes**, whether the move came from a
|
|
141
144
|
* row here, from a filter typed into the field around it, or from a chip
|
|
@@ -4,23 +4,18 @@ import { nothing, type PropertyValues } from 'lit';
|
|
|
4
4
|
* @summary One way a filter can compare a field to its values.
|
|
5
5
|
*
|
|
6
6
|
* @description
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* force; the menu offers the rest.
|
|
7
|
+
* Declares one operator a field supports. It renders nothing. Write operators
|
|
8
|
+
* in markup beside the field's values. `FilterField` reads them, the chip shows the
|
|
9
|
+
* one in use, and the menu offers the rest.
|
|
11
10
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* and owns the interaction that builds one. What the words mean is the domain's,
|
|
17
|
-
* which is the same line `FilterInput` already draws when it declines to learn a
|
|
18
|
-
* grammar.
|
|
11
|
+
* Helix defines the shape of a filter, which is a field, an operator, and
|
|
12
|
+
* values, and the interaction that builds one. The meaning of each operator
|
|
13
|
+
* belongs to your domain: the element compares nothing and does not interpret
|
|
14
|
+
* `name`.
|
|
19
15
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* consumer bug and the field reports it rather than guessing.
|
|
16
|
+
* Mark the field's usual operator `default`. A chip with the default operator
|
|
17
|
+
* shows only the field and the values. Marking a second operator `default` on
|
|
18
|
+
* one field is an error, and the field reports it.
|
|
24
19
|
*
|
|
25
20
|
* @since 0.23.0
|
|
26
21
|
* @status stable
|
|
@@ -30,7 +25,7 @@ import { nothing, type PropertyValues } from 'lit';
|
|
|
30
25
|
*/
|
|
31
26
|
export declare class HelixHeadlessFilterOperator extends HelixElement {
|
|
32
27
|
/**
|
|
33
|
-
* How many values
|
|
28
|
+
* How many values the comparison takes.
|
|
34
29
|
*
|
|
35
30
|
* `none` is a comparison that is complete on its own, which is what `is empty`
|
|
36
31
|
* and `is set` are: a chip drawn for one shows no values because there are
|
|
@@ -60,8 +55,8 @@ export declare class HelixHeadlessFilterOperator extends HelixElement {
|
|
|
60
55
|
*/
|
|
61
56
|
arity?: 'many' | 'none' | 'one';
|
|
62
57
|
/**
|
|
63
|
-
*
|
|
64
|
-
*
|
|
58
|
+
* Marks the comparison as the field's usual one, used unless the user picks
|
|
59
|
+
* another.
|
|
65
60
|
*
|
|
66
61
|
* The chip leaves a default operator unwritten, so the common filter reads as
|
|
67
62
|
* a field and its values and nothing else, and the word only appears once
|
|
@@ -69,7 +64,7 @@ export declare class HelixHeadlessFilterOperator extends HelixElement {
|
|
|
69
64
|
*/
|
|
70
65
|
default: boolean;
|
|
71
66
|
/**
|
|
72
|
-
*
|
|
67
|
+
* The comparison's text, shown on the chip and in the menu that changes it.
|
|
73
68
|
*
|
|
74
69
|
* Words rather than symbols, and the reason is that a set has more than one
|
|
75
70
|
* negation: `!=` cannot tell "is none of" from "is not all of", and both are
|
|
@@ -78,7 +73,7 @@ export declare class HelixHeadlessFilterOperator extends HelixElement {
|
|
|
78
73
|
*/
|
|
79
74
|
label: string;
|
|
80
75
|
/**
|
|
81
|
-
*
|
|
76
|
+
* The comparison's name in your data model.
|
|
82
77
|
*
|
|
83
78
|
* Never shown. It is what arrives in the filter this element helps build, so
|
|
84
79
|
* a consumer matches on it rather than on the words a reader sees, and
|
|
@@ -3,83 +3,64 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
3
3
|
import type { HelixHeadlessFilterField } from '../field/filter-field.js';
|
|
4
4
|
declare const HelixHeadlessFilterInput_base: (new (...args: any[]) => import("@fusion.dev/helix-core").MixinControllerOpenInterface) & (new (...args: any[]) => import("@fusion.dev/helix-core").MixinTokensInterface) & (new (...args: any[]) => import("@fusion.dev/helix-core").MixinControllerValueInterface) & (new (...args: any[]) => import("@fusion.dev/helix-core").MixinFieldInterface) & typeof HelixFormElement;
|
|
5
5
|
/**
|
|
6
|
-
* @summary A field
|
|
6
|
+
* @summary A text field for filters, with the active filters shown in it as tokens.
|
|
7
7
|
*
|
|
8
8
|
* @description
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* difference between the two: its tokens are a view of a selection it owns,
|
|
15
|
-
* drawn from options it was handed.
|
|
9
|
+
* Tokens are your own elements, slotted in. A filter can be a facet with a
|
|
10
|
+
* prefix, a saved query, or a range, and these belong to your model, so the
|
|
11
|
+
* element does not render tokens from a list of strings. Removing a token is a
|
|
12
|
+
* request the element fires, and you apply it. Combobox works the other way:
|
|
13
|
+
* its tokens show a selection it owns, drawn from the options it was given.
|
|
16
14
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
15
|
+
* `value` is the typed text. Every keystroke fires `input` with the text on the
|
|
16
|
+
* element, so a table can narrow as the user types. Tokens are not reported,
|
|
17
|
+
* because they are markup you already hold. Backspace in an empty field fires
|
|
18
|
+
* `helix-dismiss` on the last token, the same event its remove control fires,
|
|
19
|
+
* so one handler covers the pointer and the keyboard.
|
|
21
20
|
*
|
|
22
|
-
*
|
|
23
|
-
* `
|
|
24
|
-
*
|
|
21
|
+
* **Typed filters.** The field parses only the fields you declare. Write
|
|
22
|
+
* `FilterField` elements, usually inside the `FilterMenu` slotted into `start`,
|
|
23
|
+
* so the picker and the text share one set. On Enter, the field reads the text
|
|
24
|
+
* against them. `disposition:refunded,settled` and `-disposition:refunded` fire
|
|
25
|
+
* `helix-facet` exactly as ticking those values in the picker would, and the
|
|
26
|
+
* parsed text is removed. Everything else stays, so `refund tuesday
|
|
27
|
+
* disposition:settled` is a filter and a search at once. Helix defines the
|
|
28
|
+
* punctuation and you define every word. `grammar.ts` has the full rule, so
|
|
29
|
+
* read it before you rely on it. A field with no `FilterField` in it parses
|
|
30
|
+
* nothing.
|
|
25
31
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* `helix-facet`, exactly as ticking those values in the picker would, and the
|
|
31
|
-
* text they were read from goes. Everything else stays where it was typed, so
|
|
32
|
-
* `refund tuesday disposition:settled` is a filter and a search at once.
|
|
33
|
-
* `grammar.ts` carries the whole rule and is worth reading before relying on it;
|
|
34
|
-
* the short version is that Helix owns the punctuation and the consumer owns
|
|
35
|
-
* every word in it. A field with no `FilterField` in it parses nothing, which is
|
|
36
|
-
* the behavior this had before it could.
|
|
32
|
+
* A field whose values cannot be listed, such as `assignee:ada`, goes directly
|
|
33
|
+
* inside this element, outside the menu. It is not assigned to a slot, so
|
|
34
|
+
* nothing draws it and the menu has no page for it, and the grammar still reads
|
|
35
|
+
* it.
|
|
37
36
|
*
|
|
38
|
-
* **
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
37
|
+
* **Suggestions.** Slot options into `suggestions` and the field shows them,
|
|
38
|
+
* moves through them with the arrow keys, and presses one on Enter. The option
|
|
39
|
+
* fires its own `helix-select`, and you decide what choosing it means. Keys
|
|
40
|
+
* before a colon and values after it use the same panel with different
|
|
41
|
+
* contents. `readFilterText` is exported so you can narrow the panel against
|
|
42
|
+
* partly typed text. The panel opens when it has options and closes when it has
|
|
43
|
+
* none, and a choice does not close it, so after picking a key you see its
|
|
44
|
+
* values next. Use `selectionStart` and `setSelectionRange` to write a
|
|
45
|
+
* completion back and put the caret after it, or the next parse reads the wrong
|
|
46
|
+
* term.
|
|
44
47
|
*
|
|
45
|
-
* **
|
|
46
|
-
* consumer's.** Slot options into `suggestions` and the field shows them, moves
|
|
47
|
-
* through them with the arrows, and lets Enter press one; the option fires its
|
|
48
|
-
* own `helix-select` and the consumer decides what choosing meant. Keys before
|
|
49
|
-
* a colon and values after it are the same panel with different contents, and
|
|
50
|
-
* `readFilterText` is exported for a consumer narrowing that panel against what
|
|
51
|
-
* a reader has half typed.
|
|
48
|
+
* **State.** Three things have three different owners:
|
|
52
49
|
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
* worth saying out loud here because the property looks like React's.
|
|
68
|
-
* `default-value` seeds the field without claiming anything.
|
|
69
|
-
*
|
|
70
|
-
* `open` is the suggestions panel, and it is the ordinary pair: refuse
|
|
71
|
-
* `helix-before-open` or `helix-before-close` to take the decision, and
|
|
72
|
-
* `default-open` to seed it.
|
|
73
|
-
*
|
|
74
|
-
* The tokens are neither, because they are not state. They are the consumer's
|
|
75
|
-
* own elements in a slot, so there is nothing for this to own and nothing to
|
|
76
|
-
* report back: a token goes when the consumer removes it from their markup,
|
|
77
|
-
* having been asked by `helix-dismiss`. **A `FilterChip` naming a declared field
|
|
78
|
-
* is asked differently**, and it has to be: the picker holds what is ticked, so
|
|
79
|
-
* a chip that removed itself without telling it left the value ticked in a list
|
|
80
|
-
* nobody could see was wrong. That dismissal is answered as the field being
|
|
81
|
-
* filtered by nothing, so it arrives as `helix-facet` like every other change
|
|
82
|
-
* and the chip goes because the filter went.
|
|
50
|
+
* - `value` is the text. The user types, the element applies it, and `input`
|
|
51
|
+
* reports it. Setting `value` seeds or corrects the text, and the next
|
|
52
|
+
* keystroke overwrites it, even in React. To control the value, cancel
|
|
53
|
+
* `helix-before-change` and write the value you want, as with every field in
|
|
54
|
+
* this library. `default-value` seeds the field.
|
|
55
|
+
* - `open` is the suggestions panel. Cancel `helix-before-open` or
|
|
56
|
+
* `helix-before-close` to control it, and use `default-open` to seed it.
|
|
57
|
+
* - Tokens are your elements in a slot and hold no state. A token goes when you
|
|
58
|
+
* remove it from your markup after `helix-dismiss`. A `FilterChip` naming a
|
|
59
|
+
* declared field works differently, because the picker holds what is ticked
|
|
60
|
+
* and removing the chip alone would leave its value ticked in the hidden
|
|
61
|
+
* menu. Its dismissal is treated as the field being filtered by nothing, so
|
|
62
|
+
* it fires `helix-facet` like every other change, and the chip goes when the
|
|
63
|
+
* filter goes.
|
|
83
64
|
*
|
|
84
65
|
* @since 0.1.0
|
|
85
66
|
* @status stable
|
|
@@ -87,41 +68,41 @@ declare const HelixHeadlessFilterInput_base: (new (...args: any[]) => import("@f
|
|
|
87
68
|
* @aliases SearchField, FacetInput, TokenInput
|
|
88
69
|
* @documentation https://fusion.dev/helix/components/filter-input
|
|
89
70
|
*
|
|
90
|
-
* @slot end -
|
|
91
|
-
* @slot start -
|
|
92
|
-
* @slot suggestions -
|
|
93
|
-
* @slot tags -
|
|
71
|
+
* @slot end - Content after the text, such as a count or a control.
|
|
72
|
+
* @slot start - Content before the text, such as a search icon.
|
|
73
|
+
* @slot suggestions - Suggestions for what to type next, as `Option`s and `Option.Group`s.
|
|
74
|
+
* @slot tags - The active filters, as `FilterChip`s or `Tag`s.
|
|
94
75
|
*
|
|
95
|
-
* @event {Event} change -
|
|
96
|
-
* @event {HelixBeforeChangeEvent} helix-before-change - Fired as the text changes
|
|
97
|
-
* @event {HelixBeforeCloseEvent} helix-before-close - Fired before the suggestions
|
|
98
|
-
* @event {HelixBeforeOpenEvent} helix-before-open - Fired before the suggestions
|
|
99
|
-
* @event {HelixDismissEvent} helix-dismiss -
|
|
100
|
-
* @event {HelixFacetEvent} helix-facet - Fired when a filter changes, whether
|
|
101
|
-
* @event {HelixSelectEvent} helix-select -
|
|
102
|
-
* @event {Event} input -
|
|
103
|
-
* @event {Event} toggle -
|
|
76
|
+
* @event {Event} change - Fired from the input when the user finishes editing the text.
|
|
77
|
+
* @event {HelixBeforeChangeEvent} helix-before-change - Fired as the text changes. Cancelable: call `preventDefault()` to keep the current text.
|
|
78
|
+
* @event {HelixBeforeCloseEvent} helix-before-close - Fired before the suggestions close. Cancelable: call `preventDefault()` to keep them open.
|
|
79
|
+
* @event {HelixBeforeOpenEvent} helix-before-open - Fired before the suggestions open. Cancelable: call `preventDefault()` to keep them closed.
|
|
80
|
+
* @event {HelixDismissEvent} helix-dismiss - Fired when the user removes a token with its remove button or with Backspace in an empty field. A `FilterChip` that names a declared field sends `helix-facet` instead. Cancelable: call `preventDefault()` to keep the token.
|
|
81
|
+
* @event {HelixFacetEvent} helix-facet - Fired when a filter changes, whether it was typed, picked, or removed. Cancelable: call `preventDefault()` to leave the text and the chip as they were.
|
|
82
|
+
* @event {HelixSelectEvent} helix-select - Fired by an option in `suggestions` when it is chosen, and bubbles out of the field. Cancelable: call `preventDefault()` to stop other listeners acting on it. The field takes no action on a choice; you decide what it does.
|
|
83
|
+
* @event {Event} input - Fired when the text changes.
|
|
84
|
+
* @event {Event} toggle - Fired when the suggestions panel opens or closes, with `newState` and `oldState`.
|
|
104
85
|
*
|
|
105
86
|
* @csspart clear - The button that empties the field.
|
|
106
87
|
* @csspart control - The input itself.
|
|
107
|
-
* @csspart feedback -
|
|
108
|
-
* @csspart field - The box
|
|
109
|
-
* @csspart hint -
|
|
110
|
-
* @csspart label - The
|
|
111
|
-
* @csspart lead - The box before the text
|
|
112
|
-
* @csspart rest -
|
|
88
|
+
* @csspart feedback - The error message under the field.
|
|
89
|
+
* @csspart field - The box that holds everything.
|
|
90
|
+
* @csspart hint - The help text under the field, shown while there is no error.
|
|
91
|
+
* @csspart label - The label above the field.
|
|
92
|
+
* @csspart lead - The box before the text that holds the `start` slot.
|
|
93
|
+
* @csspart rest - The count of tokens that did not fit. It is a `<button>` with `expandable` and a `<span>` without it.
|
|
113
94
|
* @csspart surface - The floating panel the suggestions sit in.
|
|
114
95
|
* @csspart tags - The row the tokens sit in.
|
|
115
96
|
*
|
|
116
|
-
* @cssstate invalid -
|
|
117
|
-
* @cssstate open -
|
|
97
|
+
* @cssstate invalid - The field has an error to show, from the browser's validation or from your `feedback`.
|
|
98
|
+
* @cssstate open - The suggestions are open.
|
|
118
99
|
*/
|
|
119
100
|
export declare class HelixHeadlessFilterInput extends HelixHeadlessFilterInput_base {
|
|
120
101
|
protected readonly aria: AriaForwardController;
|
|
121
102
|
/** Typed, so every keystroke is announced. See `announcesInput`. */
|
|
122
103
|
protected readonly announcesInput = true;
|
|
123
104
|
/**
|
|
124
|
-
*
|
|
105
|
+
* Shows a button that empties the field.
|
|
125
106
|
*
|
|
126
107
|
* The text only. The tokens are the consumer's markup and this element is not
|
|
127
108
|
* entitled to take them out of the document, which is the same reason
|
|
@@ -130,11 +111,12 @@ export declare class HelixHeadlessFilterInput extends HelixHeadlessFilterInput_b
|
|
|
130
111
|
*/
|
|
131
112
|
clearable: boolean;
|
|
132
113
|
/**
|
|
133
|
-
*
|
|
114
|
+
* The name of the clear button, read by screen readers. The button shows only
|
|
115
|
+
* an icon.
|
|
134
116
|
*/
|
|
135
117
|
clearLabel: string;
|
|
136
118
|
/**
|
|
137
|
-
*
|
|
119
|
+
* The text shown while the field is empty.
|
|
138
120
|
*
|
|
139
121
|
* Not a label: it goes when typing starts.
|
|
140
122
|
*/
|
|
@@ -214,7 +196,7 @@ export declare class HelixHeadlessFilterInput extends HelixHeadlessFilterInput_b
|
|
|
214
196
|
*/
|
|
215
197
|
private get suggestions();
|
|
216
198
|
/**
|
|
217
|
-
* The
|
|
199
|
+
* The direction of the selection, named as on `<input>`.
|
|
218
200
|
*
|
|
219
201
|
* **Published for the reason `Input` publishes them, and this element needs
|
|
220
202
|
* them more.** The `<input>` is inside this shadow root, so a consumer has no
|
|
@@ -228,9 +210,9 @@ export declare class HelixHeadlessFilterInput extends HelixHeadlessFilterInput_b
|
|
|
228
210
|
* be anyway.
|
|
229
211
|
*/
|
|
230
212
|
get selectionDirection(): 'backward' | 'forward' | 'none';
|
|
231
|
-
/** Where the selection ends,
|
|
213
|
+
/** Where the selection ends. With nothing selected, it is the caret position. */
|
|
232
214
|
get selectionEnd(): number;
|
|
233
|
-
/** Where the selection starts,
|
|
215
|
+
/** Where the selection starts. With nothing selected, it is the caret position. */
|
|
234
216
|
get selectionStart(): number;
|
|
235
217
|
/** Moves the caret, or selects a run of the text. */
|
|
236
218
|
setSelectionRange(start: number, end: number, direction?: 'backward' | 'forward' | 'none'): void;
|
|
@@ -245,7 +227,7 @@ export declare class HelixHeadlessFilterInput extends HelixHeadlessFilterInput_b
|
|
|
245
227
|
/** Relayed, because `change` does not cross a shadow boundary on its own. */
|
|
246
228
|
private readonly handleChange;
|
|
247
229
|
/**
|
|
248
|
-
* The fields
|
|
230
|
+
* The fields the input can filter by, declared anywhere inside it.
|
|
249
231
|
*
|
|
250
232
|
* Descendants rather than children, because the usual place to write them is
|
|
251
233
|
* inside the `FilterMenu` slotted into `start`: the picker and the text are
|
|
@@ -392,7 +374,7 @@ export declare class HelixHeadlessFilterInput extends HelixHeadlessFilterInput_b
|
|
|
392
374
|
* and the highlight is still drawn.
|
|
393
375
|
*/
|
|
394
376
|
private markActive;
|
|
395
|
-
/** Puts the caret in the field
|
|
377
|
+
/** Puts the caret in the text field. */
|
|
396
378
|
focus(options?: FocusOptions): void;
|
|
397
379
|
protected render(): TemplateResult;
|
|
398
380
|
}
|