@mosaicajs/components 0.1.0-rc.4 → 0.1.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/dist/artifact-card.d.ts +20 -26
- package/dist/artifact-card.js +20 -26
- package/dist/base.d.ts +21 -29
- package/dist/base.js +18 -26
- package/dist/basemap.d.ts +2 -2
- package/dist/cluster-filter.d.ts +19 -25
- package/dist/cluster-filter.js +19 -25
- package/dist/colour-editor.d.ts +16 -36
- package/dist/colour-editor.js +16 -36
- package/dist/context.d.ts +4 -4
- package/dist/context.js +4 -4
- package/dist/count.d.ts +16 -15
- package/dist/count.js +16 -15
- package/dist/events.d.ts +63 -68
- package/dist/explorer.d.ts +76 -119
- package/dist/explorer.js +76 -121
- package/dist/field-card.d.ts +24 -56
- package/dist/field-card.js +24 -56
- package/dist/filter-panel.d.ts +31 -45
- package/dist/filter-panel.js +31 -45
- package/dist/filter.d.ts +20 -28
- package/dist/filter.js +20 -28
- package/dist/hierarchy.d.ts +35 -36
- package/dist/hierarchy.js +35 -36
- package/dist/index.d.ts +5 -4
- package/dist/index.js +5 -4
- package/dist/item-card.d.ts +34 -55
- package/dist/item-card.js +34 -55
- package/dist/key-picker.d.ts +5 -5
- package/dist/key-picker.js +5 -5
- package/dist/layer-picker.d.ts +11 -9
- package/dist/layer-picker.js +11 -9
- package/dist/map.d.ts +134 -172
- package/dist/map.js +136 -188
- package/dist/mosaica-components.js +5599 -1594
- package/dist/mosaica-components.js.LICENSE.txt +80 -16
- package/dist/mosaica-components.js.sri +1 -1
- package/dist/mosaica-components.json +2 -2
- package/dist/parts.d.ts +3 -4
- package/dist/parts.js +3 -4
- package/dist/selection.d.ts +21 -27
- package/dist/selection.js +21 -27
- package/dist/states.d.ts +15 -20
- package/dist/status.d.ts +26 -38
- package/dist/status.js +26 -38
- package/dist/store-element.d.ts +8 -7
- package/dist/store-element.js +8 -7
- package/dist/tokens.d.ts +12 -13
- package/dist/tokens.js +12 -13
- package/dist/view-picker.d.ts +10 -6
- package/dist/view-picker.js +10 -6
- package/package.json +6 -6
package/dist/field-card.js
CHANGED
|
@@ -100,59 +100,27 @@ function binsOf(table, timestamp) {
|
|
|
100
100
|
return out;
|
|
101
101
|
}
|
|
102
102
|
/**
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
* can be filtered by.
|
|
103
|
+
* Use a field card on its own when you want one field's chart in a place of your choosing.
|
|
104
|
+
* `<mosaica-filter-panel>` shows one for each field. Set `field` to a column `meta.filterOperands`
|
|
105
|
+
* lists, or to `cluster:<layer>` for a layer's clusters.
|
|
107
106
|
*
|
|
108
|
-
* The
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
* its clause excludes keeps its count. The card keeps three aggregates registered with the store
|
|
112
|
-
* while it is drawn (`Store.setAggregate`): the subject's counts (`subject: 'view'` with
|
|
113
|
-
* `highlighted`), the whole match's, and for a number or a date its figures over everything the
|
|
114
|
-
* viewer may see (`subject: 'visible'`). A folded card asks for the subject's alone.
|
|
107
|
+
* The solid bars count the items in view that the filters match, or the highlighted items while
|
|
108
|
+
* there is a highlight. The pale bars count every item the filters match. Neither count applies the
|
|
109
|
+
* card's own filter, so a value the viewer has filtered out keeps its count.
|
|
115
110
|
*
|
|
116
|
-
*
|
|
117
|
-
* its own clauses name, with "N more" opening it to twenty. Each row has its name (a cluster's
|
|
118
|
-
* parents in grey after it), a solid bar for its share of the subject and a pale bar for its share
|
|
119
|
-
* of the whole match, each a share of its own total, and the two counts. Under a filter on the
|
|
120
|
-
* field, the values it leaves out are greyed and show only how many items they would add, and the
|
|
121
|
-
* shares are of what the filter keeps. Hovering or focusing a row shows Highlight and Filter, which
|
|
122
|
-
* put the value in or out of the field's clause in that position. A click or tap on the row does
|
|
123
|
-
* what its Filter button does and shows its buttons; the row takes no focus, and the keyboard
|
|
124
|
-
* reaches the buttons. Over the rows is the field's search box, the typeahead of
|
|
125
|
-
* `<mosaica-filter>` or `<mosaica-cluster-filter>`, whose choice joins the filter. A levelled
|
|
126
|
-
* layer's card has a Level choice in its heading, the top (coarsest) level by default, which fires
|
|
127
|
-
* `mosaica-levelchange`. A cluster card ranks a `nested` or `dag` layer's clusters at the cut the
|
|
128
|
-
* map draws (`cut: 'drawn'`), and a flat or levelled layer's at its level.
|
|
129
|
-
* A cluster is named as the aggregate's table names it, which is the name the layer's browse pages
|
|
130
|
-
* give the same viewer. On a `nested` or `dag` layer its path is named from a browse page of its
|
|
131
|
-
* parents and one of its first parent's.
|
|
111
|
+
* What the card shows depends on the kind of field:
|
|
132
112
|
*
|
|
133
|
-
* A
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
* on the field is outlined on the plot. The heading gives the field's figures: how many items hold
|
|
140
|
-
* a value and their mean, or their range while folded.
|
|
113
|
+
* - A category or cluster card lists the values with most items in view, each with Highlight and
|
|
114
|
+
* Filter buttons.
|
|
115
|
+
* - A number or date card draws a histogram, and the viewer drags across it to pick a range to
|
|
116
|
+
* filter or highlight by. From the keyboard, they press Shift and the arrow keys on the focused
|
|
117
|
+
* plot, then Enter. Counts over about 100,000 items come from a sample, so they are marked "≈".
|
|
118
|
+
* - A text or keyword field's card is a search box, `<mosaica-filter>`.
|
|
141
119
|
*
|
|
142
|
-
*
|
|
120
|
+
* While the paint button colours the map by the field, clicking a value's colour opens a picker
|
|
121
|
+
* that changes the colour on the map.
|
|
143
122
|
*
|
|
144
|
-
*
|
|
145
|
-
* (`Store.setColourBy`), and is pressed while it does. Then a category or cluster card shows each
|
|
146
|
-
* value's colour beside it, and a number or date card the ramp under its plot. Each colour is a
|
|
147
|
-
* button that opens a colour picker: the palette's colours and a lighter row, a custom area with a
|
|
148
|
-
* hue bar and a hex field, and Reset, which gives the value or the cluster its palette colour back.
|
|
149
|
-
* A choice applies at once and fires `mosaica-valuecolour` for a category value, written to the
|
|
150
|
-
* colour choices every element over the store shares, or `mosaica-clustercolour` for a cluster,
|
|
151
|
-
* set on the store with its other chosen colours (`Store.setArtifactColours`).
|
|
152
|
-
*
|
|
153
|
-
* `folded` draws the heading alone, with a small chart of the subject's counts.
|
|
154
|
-
*
|
|
155
|
-
* @summary One field's counts in view and overall, with its filter and highlight.
|
|
123
|
+
* @summary A card that charts one field's values and filters or highlights by them.
|
|
156
124
|
* @tagname mosaica-field-card
|
|
157
125
|
* @category Elements
|
|
158
126
|
* @fires {CustomEvent<MosaicaEventDetails['mosaica-filterchange']>} mosaica-filterchange - A row's
|
|
@@ -177,11 +145,11 @@ function binsOf(table, timestamp) {
|
|
|
177
145
|
* @csspart paint - The paint button, with `aria-pressed`.
|
|
178
146
|
* @csspart fold - The fold button, with `aria-expanded`.
|
|
179
147
|
* @csspart rows - A category or cluster card's rows.
|
|
180
|
-
* @csspart row - One row, with `data-key` and `data-state`: `in`
|
|
181
|
-
*
|
|
182
|
-
* @csspart swatch - A row's colour, while the map is coloured by the field
|
|
183
|
-
* colour picker
|
|
184
|
-
* drawn yet and so has given
|
|
148
|
+
* @csspart row - One row, with `data-key` and `data-state`: `in` if the field's filter keeps the
|
|
149
|
+
* value, `out` if it leaves it out, `lit` if it is highlighted, otherwise empty.
|
|
150
|
+
* @csspart swatch - A row's colour button, while the map is coloured by the field. It opens the
|
|
151
|
+
* colour picker. It carries `data-unmet`, and is drawn as an outline, for a value the map has not
|
|
152
|
+
* drawn yet and so has not given a colour.
|
|
185
153
|
* @csspart name - A row's name, with `data-unnamed` for a cluster that has none.
|
|
186
154
|
* @csspart path - A cluster row's parents.
|
|
187
155
|
* @csspart bar-match - A row's or a bin's pale bar, its share of the whole match.
|
|
@@ -664,15 +632,15 @@ let MosaicaFieldCard = (() => {
|
|
|
664
632
|
get field() { return this.#field_accessor_storage; }
|
|
665
633
|
set field(value) { this.#field_accessor_storage = value; }
|
|
666
634
|
#folded_accessor_storage = (__runInitializers(this, _field_extraInitializers), __runInitializers(this, _folded_initializers, false));
|
|
667
|
-
/**
|
|
635
|
+
/** Shows the heading alone, with a small chart of the counts in view. */
|
|
668
636
|
get folded() { return this.#folded_accessor_storage; }
|
|
669
637
|
set folded(value) { this.#folded_accessor_storage = value; }
|
|
670
638
|
#compact_accessor_storage = (__runInitializers(this, _folded_extraInitializers), __runInitializers(this, _compact_initializers, false));
|
|
671
|
-
/** Draws
|
|
639
|
+
/** Draws a folded card in the compact style the explorer uses in narrow containers. */
|
|
672
640
|
get compact() { return this.#compact_accessor_storage; }
|
|
673
641
|
set compact(value) { this.#compact_accessor_storage = value; }
|
|
674
642
|
#level_accessor_storage = (__runInitializers(this, _compact_extraInitializers), __runInitializers(this, _level_initializers, null));
|
|
675
|
-
/** The level a
|
|
643
|
+
/** The level a card for a layer with levels counts at. `null` is the coarsest level. */
|
|
676
644
|
get level() { return this.#level_accessor_storage; }
|
|
677
645
|
set level(value) { this.#level_accessor_storage = value; }
|
|
678
646
|
#expanded_accessor_storage = (__runInitializers(this, _level_extraInitializers), __runInitializers(this, _expanded_initializers, false));
|
package/dist/filter-panel.d.ts
CHANGED
|
@@ -5,59 +5,44 @@ import './field-card.js';
|
|
|
5
5
|
/** The layers whose clusters a viewer can filter by in `view`: those `meta` lists for it that attach to no other. */
|
|
6
6
|
export declare function clusterFieldLayers(meta: Meta, view: string): Layer[];
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
8
|
+
* Use the filter panel as the place where viewers narrow the map down, as `<mosaica-explorer>` does
|
|
9
|
+
* in its sidebar. Each filter or highlight in force shows as a chip above the cards, and pressing a
|
|
10
|
+
* chip opens its field's card.
|
|
10
11
|
*
|
|
11
|
-
* The
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* the pale bars count: every item the filters admit, from an aggregate the panel keeps registered.
|
|
12
|
+
* The row at the top says what the cards' solid bars count. That is the items in view that the
|
|
13
|
+
* filters match, or the highlighted items while there is a highlight. The pale bars count
|
|
14
|
+
* everything the filters match, so that viewers can compare what is in view with the whole.
|
|
15
15
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* empties that clause, leaving the other position's alone. Clear all empties every clause in both
|
|
20
|
-
* positions and drops every `member_of` clause.
|
|
16
|
+
* The panel shows a card for each field in `pinned`, for each field that holds a filter or
|
|
17
|
+
* highlight, and for the field the map is coloured by. Viewers add other fields with Add field.
|
|
18
|
+
* Taking a card off clears that field's filters and highlights.
|
|
21
19
|
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* fields in `pinned` (a layer's as `cluster:<layer>`), the fields holding a clause in either
|
|
25
|
-
* position, the field the map is coloured by, and any field added, in `meta`'s order, the columns
|
|
26
|
-
* then the layers; a field joins the end of the list, so the cards shown do not move. Add field lists every field, the columns then the layers, with a search box,
|
|
27
|
-
* and the listed ones are checked and say Shown; its list opens under the column, as wide as it.
|
|
28
|
-
* Choosing an unchecked field adds its card. Choosing a checked one takes the card off and empties
|
|
29
|
-
* the field's clauses in both positions; a column in `pinned` stays, since the host lists it. Enter
|
|
30
|
-
* in the search box adds the first match not yet listed and never takes one off. Beside Add field,
|
|
31
|
-
* how many fields are not listed.
|
|
20
|
+
* Set `chips-only` on one panel and `controls-only` on another when you want the chips apart from
|
|
21
|
+
* the cards.
|
|
32
22
|
*
|
|
33
|
-
* A
|
|
34
|
-
* opening one folds the one open before. `chips-only` renders the line of clauses alone, and
|
|
35
|
-
* nothing while none is applied; `controls-only` leaves the subject row and the clauses out.
|
|
36
|
-
*
|
|
37
|
-
* @summary The field cards, what they count, and the clauses applied.
|
|
23
|
+
* @summary A panel of field cards for filtering and highlighting the map by any field.
|
|
38
24
|
* @tagname mosaica-filter-panel
|
|
39
25
|
* @category Elements
|
|
40
26
|
* @fires {CustomEvent<MosaicaEventDetails['mosaica-filterchange']>} mosaica-filterchange - A
|
|
41
|
-
* column's chip was removed
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* card fires its own as well.
|
|
27
|
+
* column's chip was removed, Clear all was pressed, the highlight was cleared from the subject
|
|
28
|
+
* row, or a card was taken off in Add field. Removing a `member_of` chip fires nothing. Each card
|
|
29
|
+
* fires its own as well.
|
|
45
30
|
* @fires {CustomEvent<MosaicaEventDetails['mosaica-chipopen']>} mosaica-chipopen - A column's chip
|
|
46
|
-
* was pressed
|
|
31
|
+
* was pressed while `chips-only` is set, so you can show its card.
|
|
47
32
|
* @csspart state - The state line, with `data-state`.
|
|
48
33
|
* @csspart refusal - The words "View refused", with `data-code`, in the refused state.
|
|
49
|
-
* @csspart reason - The server's reason for a refusal,
|
|
34
|
+
* @csspart reason - The server's reason for a refusal, under "View refused".
|
|
50
35
|
* @csspart subject - The subject row.
|
|
51
|
-
* @csspart subject-key - The subject's
|
|
36
|
+
* @csspart subject-key - The colour of the subject's bars.
|
|
52
37
|
* @csspart subject-name - In view, or Highlighted while a highlight is set.
|
|
53
38
|
* @csspart subject-count - The number in view, or highlighted.
|
|
54
39
|
* @csspart clear-highlight - The × beside Highlighted, which clears the highlight.
|
|
55
40
|
* @csspart all - All matching and its number.
|
|
56
41
|
* @csspart all-count - The number matching.
|
|
57
|
-
* @csspart chips - The line of
|
|
58
|
-
* @csspart chip - One
|
|
42
|
+
* @csspart chips - The line of chips, while any filter or highlight is in force.
|
|
43
|
+
* @csspart chip - One chip, with `data-verb` (`filter` or `highlight`) and `data-column` or
|
|
59
44
|
* `data-artifact`.
|
|
60
|
-
* @csspart edit -
|
|
45
|
+
* @csspart edit - A column chip's text, a button that opens its card.
|
|
61
46
|
* @csspart clear - The Clear all button.
|
|
62
47
|
* @csspart card - One `<mosaica-field-card>`, with `data-field`.
|
|
63
48
|
* @csspart add - The Add field button, with `aria-expanded`.
|
|
@@ -65,24 +50,25 @@ export declare function clusterFieldLayers(meta: Meta, view: string): Layer[];
|
|
|
65
50
|
* @csspart add-list - The list of fields to add, while it is open.
|
|
66
51
|
* @csspart add-search - The search box over that list.
|
|
67
52
|
* @csspart add-option - One field in that list, with `data-column` or `data-layer`, `aria-checked`
|
|
68
|
-
* while
|
|
69
|
-
* @csspart field-card-<part> - A part of a card
|
|
53
|
+
* while its card is shown, and `aria-disabled` if it is pinned and cannot be taken off.
|
|
54
|
+
* @csspart field-card-<part> - A part of a card.
|
|
70
55
|
* @csspart filter-<part> - A part of a card's `<mosaica-filter>` search box.
|
|
71
56
|
* @csspart cluster-filter-<part> - A part of a card's `<mosaica-cluster-filter>` search box.
|
|
72
57
|
*/
|
|
73
58
|
export declare class MosaicaFilterPanel extends MosaicaElement {
|
|
74
|
-
/**
|
|
59
|
+
/** Shows only the chips, and nothing while no filter or highlight is in force. */
|
|
75
60
|
accessor chipsOnly: boolean;
|
|
76
|
-
/**
|
|
61
|
+
/** Shows the cards and Add field without the subject row and the chips. */
|
|
77
62
|
accessor controlsOnly: boolean;
|
|
78
63
|
/**
|
|
79
|
-
* The columns whose cards
|
|
80
|
-
*
|
|
64
|
+
* The columns whose cards always show, even when they hold no filter, separated by spaces or
|
|
65
|
+
* commas. Write a layer as `cluster:<layer>`. Unset, a card shows only once its field is filtered
|
|
66
|
+
* or the viewer adds it.
|
|
81
67
|
*/
|
|
82
68
|
accessor pinned: string;
|
|
83
|
-
/**
|
|
69
|
+
/** Keeps one card open at a time, and shortens the subject row's figures. */
|
|
84
70
|
accessor compact: boolean;
|
|
85
|
-
/** The level
|
|
71
|
+
/** The level that cards for layers with levels count at. `null` is the coarsest level. */
|
|
86
72
|
accessor clusterLevel: number | null;
|
|
87
73
|
/** The fields the user added, which stay listed. @internal */
|
|
88
74
|
accessor opened: ReadonlySet<string>;
|
|
@@ -114,7 +100,7 @@ export declare class MosaicaFilterPanel extends MosaicaElement {
|
|
|
114
100
|
protected onStoreChange(): void;
|
|
115
101
|
protected onStoreAdopted(): void;
|
|
116
102
|
disconnectedCallback(): void;
|
|
117
|
-
/**
|
|
103
|
+
/** Show `field`'s card, open it, and scroll to and focus it. Call it after `mosaica-chipopen` to show the chip's card. */
|
|
118
104
|
show(field: string): void;
|
|
119
105
|
/** Moves focus to the first card's search box or plot, else Add field. */
|
|
120
106
|
focus(options?: FocusOptions): void;
|
package/dist/filter-panel.js
CHANGED
|
@@ -58,59 +58,44 @@ const VERBS = ['filter', 'highlight'];
|
|
|
58
58
|
/** A figure in the subject row: whole, or shortened in the compact layout. */
|
|
59
59
|
const figure = (n, compact) => (compact ? shortCount(n) : countText(n));
|
|
60
60
|
/**
|
|
61
|
-
*
|
|
62
|
-
*
|
|
61
|
+
* Use the filter panel as the place where viewers narrow the map down, as `<mosaica-explorer>` does
|
|
62
|
+
* in its sidebar. Each filter or highlight in force shows as a chip above the cards, and pressing a
|
|
63
|
+
* chip opens its field's card.
|
|
63
64
|
*
|
|
64
|
-
* The
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
* the pale bars count: every item the filters admit, from an aggregate the panel keeps registered.
|
|
65
|
+
* The row at the top says what the cards' solid bars count. That is the items in view that the
|
|
66
|
+
* filters match, or the highlighted items while there is a highlight. The pale bars count
|
|
67
|
+
* everything the filters match, so that viewers can compare what is in view with the whole.
|
|
68
68
|
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
* empties that clause, leaving the other position's alone. Clear all empties every clause in both
|
|
73
|
-
* positions and drops every `member_of` clause.
|
|
69
|
+
* The panel shows a card for each field in `pinned`, for each field that holds a filter or
|
|
70
|
+
* highlight, and for the field the map is coloured by. Viewers add other fields with Add field.
|
|
71
|
+
* Taking a card off clears that field's filters and highlights.
|
|
74
72
|
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
* fields in `pinned` (a layer's as `cluster:<layer>`), the fields holding a clause in either
|
|
78
|
-
* position, the field the map is coloured by, and any field added, in `meta`'s order, the columns
|
|
79
|
-
* then the layers; a field joins the end of the list, so the cards shown do not move. Add field lists every field, the columns then the layers, with a search box,
|
|
80
|
-
* and the listed ones are checked and say Shown; its list opens under the column, as wide as it.
|
|
81
|
-
* Choosing an unchecked field adds its card. Choosing a checked one takes the card off and empties
|
|
82
|
-
* the field's clauses in both positions; a column in `pinned` stays, since the host lists it. Enter
|
|
83
|
-
* in the search box adds the first match not yet listed and never takes one off. Beside Add field,
|
|
84
|
-
* how many fields are not listed.
|
|
73
|
+
* Set `chips-only` on one panel and `controls-only` on another when you want the chips apart from
|
|
74
|
+
* the cards.
|
|
85
75
|
*
|
|
86
|
-
* A
|
|
87
|
-
* opening one folds the one open before. `chips-only` renders the line of clauses alone, and
|
|
88
|
-
* nothing while none is applied; `controls-only` leaves the subject row and the clauses out.
|
|
89
|
-
*
|
|
90
|
-
* @summary The field cards, what they count, and the clauses applied.
|
|
76
|
+
* @summary A panel of field cards for filtering and highlighting the map by any field.
|
|
91
77
|
* @tagname mosaica-filter-panel
|
|
92
78
|
* @category Elements
|
|
93
79
|
* @fires {CustomEvent<MosaicaEventDetails['mosaica-filterchange']>} mosaica-filterchange - A
|
|
94
|
-
* column's chip was removed
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
* card fires its own as well.
|
|
80
|
+
* column's chip was removed, Clear all was pressed, the highlight was cleared from the subject
|
|
81
|
+
* row, or a card was taken off in Add field. Removing a `member_of` chip fires nothing. Each card
|
|
82
|
+
* fires its own as well.
|
|
98
83
|
* @fires {CustomEvent<MosaicaEventDetails['mosaica-chipopen']>} mosaica-chipopen - A column's chip
|
|
99
|
-
* was pressed
|
|
84
|
+
* was pressed while `chips-only` is set, so you can show its card.
|
|
100
85
|
* @csspart state - The state line, with `data-state`.
|
|
101
86
|
* @csspart refusal - The words "View refused", with `data-code`, in the refused state.
|
|
102
|
-
* @csspart reason - The server's reason for a refusal,
|
|
87
|
+
* @csspart reason - The server's reason for a refusal, under "View refused".
|
|
103
88
|
* @csspart subject - The subject row.
|
|
104
|
-
* @csspart subject-key - The subject's
|
|
89
|
+
* @csspart subject-key - The colour of the subject's bars.
|
|
105
90
|
* @csspart subject-name - In view, or Highlighted while a highlight is set.
|
|
106
91
|
* @csspart subject-count - The number in view, or highlighted.
|
|
107
92
|
* @csspart clear-highlight - The × beside Highlighted, which clears the highlight.
|
|
108
93
|
* @csspart all - All matching and its number.
|
|
109
94
|
* @csspart all-count - The number matching.
|
|
110
|
-
* @csspart chips - The line of
|
|
111
|
-
* @csspart chip - One
|
|
95
|
+
* @csspart chips - The line of chips, while any filter or highlight is in force.
|
|
96
|
+
* @csspart chip - One chip, with `data-verb` (`filter` or `highlight`) and `data-column` or
|
|
112
97
|
* `data-artifact`.
|
|
113
|
-
* @csspart edit -
|
|
98
|
+
* @csspart edit - A column chip's text, a button that opens its card.
|
|
114
99
|
* @csspart clear - The Clear all button.
|
|
115
100
|
* @csspart card - One `<mosaica-field-card>`, with `data-field`.
|
|
116
101
|
* @csspart add - The Add field button, with `aria-expanded`.
|
|
@@ -118,8 +103,8 @@ const figure = (n, compact) => (compact ? shortCount(n) : countText(n));
|
|
|
118
103
|
* @csspart add-list - The list of fields to add, while it is open.
|
|
119
104
|
* @csspart add-search - The search box over that list.
|
|
120
105
|
* @csspart add-option - One field in that list, with `data-column` or `data-layer`, `aria-checked`
|
|
121
|
-
* while
|
|
122
|
-
* @csspart field-card-<part> - A part of a card
|
|
106
|
+
* while its card is shown, and `aria-disabled` if it is pinned and cannot be taken off.
|
|
107
|
+
* @csspart field-card-<part> - A part of a card.
|
|
123
108
|
* @csspart filter-<part> - A part of a card's `<mosaica-filter>` search box.
|
|
124
109
|
* @csspart cluster-filter-<part> - A part of a card's `<mosaica-cluster-filter>` search box.
|
|
125
110
|
*/
|
|
@@ -186,26 +171,27 @@ let MosaicaFilterPanel = (() => {
|
|
|
186
171
|
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
187
172
|
}
|
|
188
173
|
#chipsOnly_accessor_storage = __runInitializers(this, _chipsOnly_initializers, false);
|
|
189
|
-
/**
|
|
174
|
+
/** Shows only the chips, and nothing while no filter or highlight is in force. */
|
|
190
175
|
get chipsOnly() { return this.#chipsOnly_accessor_storage; }
|
|
191
176
|
set chipsOnly(value) { this.#chipsOnly_accessor_storage = value; }
|
|
192
177
|
#controlsOnly_accessor_storage = (__runInitializers(this, _chipsOnly_extraInitializers), __runInitializers(this, _controlsOnly_initializers, false));
|
|
193
|
-
/**
|
|
178
|
+
/** Shows the cards and Add field without the subject row and the chips. */
|
|
194
179
|
get controlsOnly() { return this.#controlsOnly_accessor_storage; }
|
|
195
180
|
set controlsOnly(value) { this.#controlsOnly_accessor_storage = value; }
|
|
196
181
|
#pinned_accessor_storage = (__runInitializers(this, _controlsOnly_extraInitializers), __runInitializers(this, _pinned_initializers, ''));
|
|
197
182
|
/**
|
|
198
|
-
* The columns whose cards
|
|
199
|
-
*
|
|
183
|
+
* The columns whose cards always show, even when they hold no filter, separated by spaces or
|
|
184
|
+
* commas. Write a layer as `cluster:<layer>`. Unset, a card shows only once its field is filtered
|
|
185
|
+
* or the viewer adds it.
|
|
200
186
|
*/
|
|
201
187
|
get pinned() { return this.#pinned_accessor_storage; }
|
|
202
188
|
set pinned(value) { this.#pinned_accessor_storage = value; }
|
|
203
189
|
#compact_accessor_storage = (__runInitializers(this, _pinned_extraInitializers), __runInitializers(this, _compact_initializers, false));
|
|
204
|
-
/**
|
|
190
|
+
/** Keeps one card open at a time, and shortens the subject row's figures. */
|
|
205
191
|
get compact() { return this.#compact_accessor_storage; }
|
|
206
192
|
set compact(value) { this.#compact_accessor_storage = value; }
|
|
207
193
|
#clusterLevel_accessor_storage = (__runInitializers(this, _compact_extraInitializers), __runInitializers(this, _clusterLevel_initializers, null));
|
|
208
|
-
/** The level
|
|
194
|
+
/** The level that cards for layers with levels count at. `null` is the coarsest level. */
|
|
209
195
|
get clusterLevel() { return this.#clusterLevel_accessor_storage; }
|
|
210
196
|
set clusterLevel(value) { this.#clusterLevel_accessor_storage = value; }
|
|
211
197
|
#opened_accessor_storage = (__runInitializers(this, _clusterLevel_extraInitializers), __runInitializers(this, _opened_initializers, new Set()));
|
|
@@ -440,7 +426,7 @@ let MosaicaFilterPanel = (() => {
|
|
|
440
426
|
this.matching.set(null, null);
|
|
441
427
|
super.disconnectedCallback();
|
|
442
428
|
}
|
|
443
|
-
/**
|
|
429
|
+
/** Show `field`'s card, open it, and scroll to and focus it. Call it after `mosaica-chipopen` to show the chip's card. */
|
|
444
430
|
show(field) {
|
|
445
431
|
this.opened = new Set([...this.opened, field]);
|
|
446
432
|
this.unfold(field);
|
package/dist/filter.d.ts
CHANGED
|
@@ -7,54 +7,46 @@ type KeywordOperator = (typeof KEYWORD_OPERATORS)[number];
|
|
|
7
7
|
/** Each operator as the menu and a chip say it. */
|
|
8
8
|
export declare const OPERATOR_WORDS: Record<KeywordOperator, string>;
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
10
|
+
* Use `<mosaica-filter>` when you want a search box for one column without the field card around
|
|
11
|
+
* it. Set `column` to a column `meta.filterOperands` lists. The box takes the form that the
|
|
12
|
+
* column's kind needs:
|
|
12
13
|
*
|
|
13
|
-
* A text column
|
|
14
|
-
*
|
|
15
|
-
*
|
|
14
|
+
* - A text column takes words that an item must all contain. Double quotes match a phrase where the
|
|
15
|
+
* column supports phrases, and `OR` between terms matches either.
|
|
16
|
+
* - A category column suggests values as the viewer types. The arrow keys move through the
|
|
17
|
+
* suggestions, Enter chooses or removes one, and Escape clears what was typed.
|
|
18
|
+
* - A keyword column has a menu for choosing how to match, by `contains`, `prefix` or `eq`.
|
|
16
19
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* the current view among the items passing the filter without the column's own clause, so a value
|
|
20
|
-
* counts what choosing it as well would add, and a bar, its share of the total the server counted
|
|
21
|
-
* over. The arrow keys move through the suggestions, and Enter chooses the one reached, the first
|
|
22
|
-
* by default, or takes it out where it is chosen; text that suggests nothing chooses nothing.
|
|
23
|
-
* Emptying the box, or removing the control, has the store stop asking for the column.
|
|
20
|
+
* The box sets the filter 350 ms after the last keystroke, so that the map does not redraw for
|
|
21
|
+
* every letter. If your code sets a text filter the box cannot express, the box shows it read-only.
|
|
24
22
|
*
|
|
25
|
-
* A
|
|
26
|
-
*
|
|
27
|
-
* Typing is sent 350 ms after the last keystroke; a choice is sent at once. Each change replaces
|
|
28
|
-
* the column's control in the filter position of the store's draft.
|
|
29
|
-
*
|
|
30
|
-
* @summary A field card's search box.
|
|
23
|
+
* @summary A search box that filters the map by one column.
|
|
31
24
|
* @tagname mosaica-filter
|
|
32
25
|
* @category Elements
|
|
33
26
|
* @fires {CustomEvent<MosaicaEventDetails['mosaica-filterchange']>} mosaica-filterchange - The box
|
|
34
|
-
* changed the column's filter
|
|
27
|
+
* changed the column's filter.
|
|
35
28
|
* @csspart entry - The box.
|
|
36
29
|
* @csspart mode - The keyword column's operator button, which opens its menu.
|
|
37
30
|
* @csspart operators - The menu of a keyword column's operators.
|
|
38
31
|
* @csspart operator - One operator in the menu, with `aria-checked`.
|
|
39
32
|
* @csspart values - The typeahead's suggestions.
|
|
40
33
|
* @csspart tick - One suggested value, with `aria-selected`.
|
|
41
|
-
* @csspart bar - A suggested value's share of the items
|
|
34
|
+
* @csspart bar - A bar for a suggested value's share of the items counted.
|
|
42
35
|
* @csspart value-count - A suggested value's count.
|
|
43
|
-
* @csspart more - The note under the box
|
|
44
|
-
*
|
|
45
|
-
* @csspart refusal - The words "Values unavailable"
|
|
36
|
+
* @csspart more - The note under the box when nothing matches, or when more values match than are
|
|
37
|
+
* listed.
|
|
38
|
+
* @csspart refusal - The words "Values unavailable" if the values could not be listed, with
|
|
46
39
|
* `data-code` set to the refusal's code.
|
|
47
40
|
*/
|
|
48
41
|
export declare class MosaicaFilter extends MosaicaElement {
|
|
49
42
|
static styles: import("lit").CSSResult[];
|
|
50
|
-
/** The column this box filters, a name `meta.filterOperands` lists. Unset or unknown,
|
|
43
|
+
/** The column this box filters, a name `meta.filterOperands` lists. Unset or unknown, the box shows nothing. */
|
|
51
44
|
accessor column: string;
|
|
52
|
-
/**
|
|
45
|
+
/** Placeholder text for the box, in place of the default. */
|
|
53
46
|
accessor placeholder: string;
|
|
54
47
|
/**
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
* suggestion shows as chosen.
|
|
48
|
+
* Turns a category box into a value picker. Choosing a suggestion calls this with its key and
|
|
49
|
+
* title and empties the box, and no filter changes.
|
|
58
50
|
*/
|
|
59
51
|
accessor choose: ((value: {
|
|
60
52
|
key: string;
|
package/dist/filter.js
CHANGED
|
@@ -50,42 +50,35 @@ const TYPING_DEBOUNCE_MS = 350;
|
|
|
50
50
|
/** The narrowest bar a suggested value with any items draws, as a percentage, so it still shows. */
|
|
51
51
|
const BAR_FLOOR = 2;
|
|
52
52
|
/**
|
|
53
|
-
*
|
|
54
|
-
*
|
|
53
|
+
* Use `<mosaica-filter>` when you want a search box for one column without the field card around
|
|
54
|
+
* it. Set `column` to a column `meta.filterOperands` lists. The box takes the form that the
|
|
55
|
+
* column's kind needs:
|
|
55
56
|
*
|
|
56
|
-
* A text column
|
|
57
|
-
*
|
|
58
|
-
*
|
|
57
|
+
* - A text column takes words that an item must all contain. Double quotes match a phrase where the
|
|
58
|
+
* column supports phrases, and `OR` between terms matches either.
|
|
59
|
+
* - A category column suggests values as the viewer types. The arrow keys move through the
|
|
60
|
+
* suggestions, Enter chooses or removes one, and Escape clears what was typed.
|
|
61
|
+
* - A keyword column has a menu for choosing how to match, by `contains`, `prefix` or `eq`.
|
|
59
62
|
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
* the current view among the items passing the filter without the column's own clause, so a value
|
|
63
|
-
* counts what choosing it as well would add, and a bar, its share of the total the server counted
|
|
64
|
-
* over. The arrow keys move through the suggestions, and Enter chooses the one reached, the first
|
|
65
|
-
* by default, or takes it out where it is chosen; text that suggests nothing chooses nothing.
|
|
66
|
-
* Emptying the box, or removing the control, has the store stop asking for the column.
|
|
63
|
+
* The box sets the filter 350 ms after the last keystroke, so that the map does not redraw for
|
|
64
|
+
* every letter. If your code sets a text filter the box cannot express, the box shows it read-only.
|
|
67
65
|
*
|
|
68
|
-
* A
|
|
69
|
-
*
|
|
70
|
-
* Typing is sent 350 ms after the last keystroke; a choice is sent at once. Each change replaces
|
|
71
|
-
* the column's control in the filter position of the store's draft.
|
|
72
|
-
*
|
|
73
|
-
* @summary A field card's search box.
|
|
66
|
+
* @summary A search box that filters the map by one column.
|
|
74
67
|
* @tagname mosaica-filter
|
|
75
68
|
* @category Elements
|
|
76
69
|
* @fires {CustomEvent<MosaicaEventDetails['mosaica-filterchange']>} mosaica-filterchange - The box
|
|
77
|
-
* changed the column's filter
|
|
70
|
+
* changed the column's filter.
|
|
78
71
|
* @csspart entry - The box.
|
|
79
72
|
* @csspart mode - The keyword column's operator button, which opens its menu.
|
|
80
73
|
* @csspart operators - The menu of a keyword column's operators.
|
|
81
74
|
* @csspart operator - One operator in the menu, with `aria-checked`.
|
|
82
75
|
* @csspart values - The typeahead's suggestions.
|
|
83
76
|
* @csspart tick - One suggested value, with `aria-selected`.
|
|
84
|
-
* @csspart bar - A suggested value's share of the items
|
|
77
|
+
* @csspart bar - A bar for a suggested value's share of the items counted.
|
|
85
78
|
* @csspart value-count - A suggested value's count.
|
|
86
|
-
* @csspart more - The note under the box
|
|
87
|
-
*
|
|
88
|
-
* @csspart refusal - The words "Values unavailable"
|
|
79
|
+
* @csspart more - The note under the box when nothing matches, or when more values match than are
|
|
80
|
+
* listed.
|
|
81
|
+
* @csspart refusal - The words "Values unavailable" if the values could not be listed, with
|
|
89
82
|
* `data-code` set to the refusal's code.
|
|
90
83
|
*/
|
|
91
84
|
let MosaicaFilter = (() => {
|
|
@@ -308,18 +301,17 @@ let MosaicaFilter = (() => {
|
|
|
308
301
|
`
|
|
309
302
|
];
|
|
310
303
|
#column_accessor_storage = __runInitializers(this, _column_initializers, '');
|
|
311
|
-
/** The column this box filters, a name `meta.filterOperands` lists. Unset or unknown,
|
|
304
|
+
/** The column this box filters, a name `meta.filterOperands` lists. Unset or unknown, the box shows nothing. */
|
|
312
305
|
get column() { return this.#column_accessor_storage; }
|
|
313
306
|
set column(value) { this.#column_accessor_storage = value; }
|
|
314
307
|
#placeholder_accessor_storage = (__runInitializers(this, _column_extraInitializers), __runInitializers(this, _placeholder_initializers, ''));
|
|
315
|
-
/**
|
|
308
|
+
/** Placeholder text for the box, in place of the default. */
|
|
316
309
|
get placeholder() { return this.#placeholder_accessor_storage; }
|
|
317
310
|
set placeholder(value) { this.#placeholder_accessor_storage = value; }
|
|
318
311
|
#choose_accessor_storage = (__runInitializers(this, _placeholder_extraInitializers), __runInitializers(this, _choose_initializers, null));
|
|
319
312
|
/**
|
|
320
|
-
*
|
|
321
|
-
*
|
|
322
|
-
* suggestion shows as chosen.
|
|
313
|
+
* Turns a category box into a value picker. Choosing a suggestion calls this with its key and
|
|
314
|
+
* title and empties the box, and no filter changes.
|
|
323
315
|
*/
|
|
324
316
|
get choose() { return this.#choose_accessor_storage; }
|
|
325
317
|
set choose(value) { this.#choose_accessor_storage = value; }
|