@zoobzio/nuxt 0.1.0 → 0.1.2

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/README.md CHANGED
@@ -141,15 +141,18 @@ one, and the wrapper's default fills in while it does not. A fixed role
141
141
  draws its alias: `expand` after a select's, multi select's, or
142
142
  accordion's trigger and as a tree branch's toggle; `prev` and `next` on
143
143
  the calendars and pickers and `calendar` on a picker's trigger; `search`
144
- before a command's filter; `remove` on a tag's and a file's remove
144
+ before a command's filter and before an autocomplete literal option that
145
+ names no icon of its own (the text literal, the one that opens the quote
146
+ free text is typed in); `remove` on a tag's and a file's remove
145
147
  button and after an autocomplete chip's label; `close` on a toast's; `top` on a scroller's back-to-top; `check`
146
148
  in a checkbox; the editor's and rich text's tools by key (`bold`,
147
149
  `heading`, `bullet-list`, `undo`, …, see `EDITOR_TOOL_ICONS`); and on
148
150
  the table and browser, `refresh`, `columns`, `actions`, `drag`,
149
151
  `sort-asc` or `sort-desc` after a sorted header, `folder` before a
150
152
  folder, `magic` before the table's search, `next` after an autocomplete
151
- option that enters a stage (a field or an operator) and `expand` after the
152
- active trail option whose stage is open, and the pagination's `first`,
153
+ option that enters a stage (a field or an operator; a literal option is
154
+ terminal and draws none) and
155
+ `expand` after the active trail option whose stage is open, and the pagination's `first`,
153
156
  `prev`, `next`, and `last`. The table's search renders through the
154
157
  layer's `TableSearch`: its Autocomplete with the `magic` icon in
155
158
  `inputPrepend` at the front of the field, before its chips, the search
@@ -165,7 +168,7 @@ An item draws its own `icon`. The vue item types (`Option`, which the
165
168
  tabs, segmented control, accordion, select, and command options extend,
166
169
  plus `MenuItem`, `BreadcrumbItem`, `DirectoryItem`, and `FacetItem`), the
167
170
  action descriptors of `@zoobzio/table` and `@zoobzio/browser`, and the
168
- `Field` and `Option` of `@zoobzio/query` are
171
+ `Field`, `Literal`, and `Option` of `@zoobzio/query` are
169
172
  interfaces, and `app/app.d.ts` widens each with an optional
170
173
  `icon: IconAlias` by declaration merging, so the one type the package,
171
174
  the layer, and the app share carries the field, and the wrapper draws it
@@ -173,7 +176,8 @@ in the item's `prepend` slot. A row, file, folder, or bulk action given to
173
176
  `createTable` or `createBrowser` with an `icon` draws it the same way,
174
177
  since the layer's `Menu` renders those actions. A query field with an
175
178
  `icon` draws it before its option in the autocomplete's panel and trail,
176
- since the query service carries it onto the field's option.
179
+ and a literal with one before its option in the panel, since the query
180
+ service carries it onto the option.
177
181
 
178
182
  ```vue
179
183
  <script setup lang="ts">
package/app/app.d.ts CHANGED
@@ -56,12 +56,16 @@ declare module "@zoobzio/table" {
56
56
  }
57
57
  }
58
58
 
59
- // A query field's `icon` is carried onto its option by the service, so the
60
- // autocomplete draws it before the field's label in the panel and the trail.
59
+ // A query field's or literal's `icon` is carried onto its option by the
60
+ // service, so the autocomplete draws it before the label in the panel, and
61
+ // a field's in the trail. A literal that names none draws `search`.
61
62
  declare module "@zoobzio/query" {
62
63
  interface Field {
63
64
  icon?: IconAlias;
64
65
  }
66
+ interface Literal {
67
+ icon?: IconAlias;
68
+ }
65
69
  interface Option {
66
70
  icon?: IconAlias;
67
71
  }
@@ -1,11 +1,13 @@
1
1
  // The vue autocomplete with the layer's Scroller as the viewport of its
2
2
  // first panel (the active panel renders with no scroller once a group has
3
3
  // an option set), the `remove` icon after each chip's label (the chip is the
4
- // button that removes its entry), an option's `icon` before its label, and
4
+ // button that removes its entry), an option's `icon` before its label, with
5
+ // `search` before a literal option that names none (a literal is a value
6
+ // typed between its own characters, free text in quotes by default), and
5
7
  // an arrow after an option that branches: `next` on a field or operator
6
8
  // option, as selecting it enters a stage, and `expand` on an active trail
7
- // option, as its stage is the one open. A value option commits, so it
8
- // draws no arrow.
9
+ // option, as its stage is the one open. A value option commits and a
10
+ // literal option is terminal, so neither draws an arrow.
9
11
  import type { QueryOption } from "@zoobzio/vue/types/components/autocomplete";
10
12
  import type { VNode } from "vue";
11
13
 
@@ -15,8 +17,11 @@ import { icon, iconOf } from "./icon";
15
17
  import { wrap } from "@zoobzio/vue/utils/wrap";
16
18
  import Scroller from "./scroller";
17
19
 
20
+ const lead = (option: QueryOption): VNode[] =>
21
+ iconOf(option.icon ?? (option.stage === "literal" ? "search" : undefined));
22
+
18
23
  const arrow = (option: QueryOption): VNode[] => {
19
- if (option.stage === "value") return [];
24
+ if (option.stage === "value" || option.stage === "literal") return [];
20
25
  return [icon(option.active ? "expand" : "next")];
21
26
  };
22
27
 
@@ -24,7 +29,7 @@ export default wrap(Core, {
24
29
  pt: { viewport: { as: Scroller } },
25
30
  slots: {
26
31
  chipAppend: () => [icon("remove")],
27
- itemPrepend: ({ option }) => iconOf(option.icon),
32
+ itemPrepend: ({ option }) => lead(option),
28
33
  itemArrow: ({ option }) => arrow(option),
29
34
  },
30
35
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zoobzio/nuxt",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Nuxt layer for the foundation design system: the Nuxt wiring over @zoobzio/vue and the headless services (useState stores, hook-bus factories, app shell).",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -44,15 +44,15 @@
44
44
  "objectively": "^0.3.0",
45
45
  "reka-ui": "^2.6.0",
46
46
  "untheme": "^0.6.1",
47
- "@zoobzio/browser": "0.1.0",
48
- "@zoobzio/editor": "0.1.0",
49
- "@zoobzio/form": "0.1.0",
50
- "@zoobzio/icons": "0.1.0",
51
- "@zoobzio/code": "0.1.0",
52
- "@zoobzio/query": "0.1.0",
53
- "@zoobzio/theme": "0.1.0",
54
- "@zoobzio/table": "0.1.0",
55
- "@zoobzio/vue": "0.1.0"
47
+ "@zoobzio/browser": "0.1.2",
48
+ "@zoobzio/editor": "0.1.2",
49
+ "@zoobzio/form": "0.1.2",
50
+ "@zoobzio/code": "0.1.2",
51
+ "@zoobzio/icons": "0.1.2",
52
+ "@zoobzio/query": "0.1.2",
53
+ "@zoobzio/theme": "0.1.2",
54
+ "@zoobzio/vue": "0.1.2",
55
+ "@zoobzio/table": "0.1.2"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@codemirror/state": "^6.7.6",