@mosaicajs/components 0.3.0 → 0.4.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.
Files changed (52) hide show
  1. package/README.md +2 -0
  2. package/dist/aggregate.d.ts +4 -10
  3. package/dist/aggregate.js +7 -13
  4. package/dist/artifact-card.d.ts +21 -7
  5. package/dist/artifact-card.js +136 -79
  6. package/dist/base.d.ts +44 -5
  7. package/dist/base.js +54 -5
  8. package/dist/cluster-filter.d.ts +29 -25
  9. package/dist/cluster-filter.js +123 -106
  10. package/dist/colour-editor.d.ts +15 -4
  11. package/dist/colour-editor.js +107 -34
  12. package/dist/colour-picker.d.ts +12 -5
  13. package/dist/colour-picker.js +119 -32
  14. package/dist/display.js +77 -9
  15. package/dist/events.d.ts +21 -7
  16. package/dist/explorer.d.ts +116 -37
  17. package/dist/explorer.js +476 -210
  18. package/dist/field-card.d.ts +304 -48
  19. package/dist/field-card.js +1364 -244
  20. package/dist/filter-panel.d.ts +54 -10
  21. package/dist/filter-panel.js +242 -42
  22. package/dist/filter.d.ts +22 -4
  23. package/dist/filter.js +113 -34
  24. package/dist/hierarchy.d.ts +68 -45
  25. package/dist/hierarchy.js +320 -243
  26. package/dist/item-card.d.ts +47 -16
  27. package/dist/item-card.js +241 -108
  28. package/dist/key-picker.d.ts +2 -1
  29. package/dist/key-picker.js +4 -3
  30. package/dist/layer-picker.d.ts +4 -2
  31. package/dist/layer-picker.js +16 -7
  32. package/dist/lineage.d.ts +132 -0
  33. package/dist/lineage.js +307 -0
  34. package/dist/map.d.ts +135 -24
  35. package/dist/map.js +387 -117
  36. package/dist/mosaica-components.js +1837 -833
  37. package/dist/mosaica-components.js.sri +1 -1
  38. package/dist/mosaica-components.json +2 -2
  39. package/dist/parts.d.ts +4 -4
  40. package/dist/parts.js +18 -4
  41. package/dist/paths.d.ts +34 -12
  42. package/dist/paths.js +84 -46
  43. package/dist/selection.d.ts +22 -3
  44. package/dist/selection.js +125 -59
  45. package/dist/states.d.ts +72 -0
  46. package/dist/states.js +135 -26
  47. package/dist/status.d.ts +63 -5
  48. package/dist/status.js +215 -36
  49. package/dist/tokens.d.ts +8 -4
  50. package/dist/tokens.js +144 -14
  51. package/dist/view-picker.js +5 -0
  52. package/package.json +4 -3
@@ -6,8 +6,16 @@ import './field-card.js';
6
6
  export declare function clusterFieldLayers(meta: Meta, view: string): Layer[];
7
7
  /**
8
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.
9
+ * in its sidebar. Each filter or highlight in force shows as a chip above the cards, a highlight's
10
+ * with a pen on it, and pressing a chip opens its field's card. When a chip is removed, focus
11
+ * moves to the × of the chip after it, else of the one before, else to Add field. Under
12
+ * `chips-only` there is no Add field, so when the last chip is removed the panel shows the words
13
+ * No filters, which take focus and go as focus leaves them; a chip that arrives while they hold
14
+ * focus takes it on its ×.
15
+ *
16
+ * A region selected in another view keeps filtering after the viewer switches away from it, and
17
+ * shows as a chip naming its view, such as "Lasso in Topics". Pressing the chip switches back to
18
+ * that view, where the region is selected again, and its × removes it.
11
19
  *
12
20
  * The row at the top says what the cards' solid bars count. That is the items in view that the
13
21
  * filters match, or the highlighted items while there is a highlight. The pale bars count
@@ -17,6 +25,10 @@ export declare function clusterFieldLayers(meta: Meta, view: string): Layer[];
17
25
  * highlight, and for the field the map is coloured by. Viewers add other fields with Add field.
18
26
  * Taking a card off clears that field's filters and highlights.
19
27
  *
28
+ * The panel sets `hide-chips` on the cards it shows, so that a layer's card does not repeat the
29
+ * chips the panel shows for its clauses. Under `controls-only` the panel shows no chips, and the
30
+ * cards keep theirs.
31
+ *
20
32
  * Set `chips-only` on one panel and `controls-only` on another when you want the chips apart from
21
33
  * the cards.
22
34
  *
@@ -27,6 +39,10 @@ export declare function clusterFieldLayers(meta: Meta, view: string): Layer[];
27
39
  * column's chip was removed, Clear all was pressed, the highlight was cleared from the subject
28
40
  * row, or a card was taken off in Add field. Removing a `member_of` chip fires nothing. Each card
29
41
  * fires its own as well.
42
+ * @fires {CustomEvent<MosaicaEventDetails['mosaica-selectchange']>} mosaica-selectchange - The chip
43
+ * of a region held in another view was removed, or Clear all removed one, with that `view`.
44
+ * @fires {CustomEvent<MosaicaEventDetails['mosaica-viewswitch']>} mosaica-viewswitch - The chip of
45
+ * a region held in another view was pressed, and the panel switched to that view.
30
46
  * @fires {CustomEvent<MosaicaEventDetails['mosaica-chipopen']>} mosaica-chipopen - A column's chip
31
47
  * was pressed while `chips-only` is set, so you can show its card.
32
48
  * @csspart state - The state line, with `data-state`.
@@ -39,15 +55,18 @@ export declare function clusterFieldLayers(meta: Meta, view: string): Layer[];
39
55
  * @csspart clear-highlight - The × beside Highlighted, which clears the highlight.
40
56
  * @csspart all - All matching and its number.
41
57
  * @csspart all-count - The number matching.
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
44
- * `data-artifact`.
45
- * @csspart edit - A column chip's text, a button that opens its card.
58
+ * @csspart chips - The line of chips, while any filter or highlight is in force, and under
59
+ * `chips-only` the words that stand in it after the last chip is removed.
60
+ * @csspart chip - One chip, with `data-verb` (`filter` or `highlight`) and `data-column`,
61
+ * `data-artifact`, or `data-view` for a region held in another view.
62
+ * @csspart edit - A column chip's text, a button that opens its card; on a held region's chip, a
63
+ * button that switches to its view.
46
64
  * @csspart clear - The Clear all button.
47
65
  * @csspart card - One `<mosaica-field-card>`, with `data-field`.
48
66
  * @csspart add - The Add field button, with `aria-expanded`.
49
67
  * @csspart add-note - How many fields are not listed.
50
- * @csspart add-list - The list of fields to add, while it is open.
68
+ * @csspart add-list - The list of fields to add, while it is open. A press outside it, or focus
69
+ * leaving it, closes it.
51
70
  * @csspart add-search - The search box over that list.
52
71
  * @csspart add-option - One field in that list, with `data-column` or `data-layer`, `aria-checked`
53
72
  * while its card is shown, and `aria-disabled` if it is pinned and cannot be taken off.
@@ -68,8 +87,12 @@ export declare class MosaicaFilterPanel extends MosaicaElement {
68
87
  accessor pinned: string;
69
88
  /** Keeps one card open at a time, and shortens the subject row's figures. */
70
89
  accessor compact: boolean;
71
- /** The level that cards for layers with levels count at. `null` is the coarsest level. */
72
- accessor clusterLevel: number | null;
90
+ /**
91
+ * The level each card for a `stacked` or `tiered` layer counts at, keyed by layer name. A layer
92
+ * with no entry counts at the level the map draws it at, which follows the zoom where its levels
93
+ * declare no zoom range. Set it as a property; it has no attribute.
94
+ */
95
+ accessor clusterLevels: ReadonlyMap<string, number>;
73
96
  /** The fields the user added, which stay listed. @internal */
74
97
  accessor opened: ReadonlySet<string>;
75
98
  /** The cards the user folded, outside the compact layout. @internal */
@@ -87,6 +110,12 @@ export declare class MosaicaFilterPanel extends MosaicaElement {
87
110
  private readonly matching;
88
111
  /** The card to open, scroll to and focus once the cards are drawn. */
89
112
  private editing;
113
+ /** A pressed control that its own action removes, and the control that takes focus once it has gone. */
114
+ private leaving;
115
+ /** Whether the last chip was removed from a panel with nothing else to focus, which then says so. @internal */
116
+ accessor emptied: boolean;
117
+ /** Whether those words held focus as a render began. */
118
+ private wordsHeld;
90
119
  /** The keys of the fields shown, in the order they were first shown. */
91
120
  private listOrder;
92
121
  private readonly floating;
@@ -100,6 +129,18 @@ export declare class MosaicaFilterPanel extends MosaicaElement {
100
129
  protected onStoreChange(): void;
101
130
  protected onStoreAdopted(): void;
102
131
  disconnectedCallback(): void;
132
+ /** A press outside the open Add field list closes it, as Escape does. */
133
+ private onPressOutsideAdd;
134
+ /**
135
+ * Before an action that removes the pressed control `gone`, note where focus goes once it has.
136
+ * From a chip's ×, to the × of the chip after it, else of the chip before, as each stands then.
137
+ * From there, and from Clear all and the clear-highlight ×, to Add field: a × that took focus
138
+ * unasked would remove a filter on the next press. Under `chips-only`, which has no Add field, to
139
+ * the words that say no filter is left.
140
+ */
141
+ private leave;
142
+ /** Move focus as {@link leave} noted, once the pressed control has gone and taken focus with it. */
143
+ private settleFocus;
103
144
  /** Show `field`'s card, open it, and scroll to and focus it. Call it after `mosaica-chipopen` to show the chip's card. */
104
145
  show(field: string): void;
105
146
  /** Moves focus to the first card's search box or plot, else Add field. */
@@ -114,9 +155,12 @@ export declare class MosaicaFilterPanel extends MosaicaElement {
114
155
  private chipText;
115
156
  /**
116
157
  * A `member_of` chip's text: the clause's own label (the only name a filter layer's artifact has,
117
- * since it is not served), else the served name, else unnamed.
158
+ * since it is not served), else the served name or key, else unnamed.
118
159
  */
119
160
  private memberText;
161
+ /** Switch to the view a held region is in, where the store selects it again. */
162
+ private showRegion;
163
+ private clearRegion;
120
164
  private clearMember;
121
165
  private clearColumn;
122
166
  private clearAll;