element-book 3.0.0 → 3.0.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.
@@ -8,7 +8,7 @@ export function extractSearchQuery(paths) {
8
8
  return '';
9
9
  }
10
10
  else {
11
- return decodeURIComponent(paths[1]);
11
+ return paths[1] ? decodeURIComponent(paths[1]) : '';
12
12
  }
13
13
  }
14
14
  export const defaultElementBookFullRoute = {
@@ -4,7 +4,7 @@ import { assign, css, html, listen, renderIf } from 'element-vir';
4
4
  import { isElementBookEntry } from '../../../data/element-book-entry/element-book-entry';
5
5
  import { ElementBookEntryTypeEnum } from '../../../data/element-book-entry/element-book-entry-type';
6
6
  import { isEntryNode, listBreadcrumbs, } from '../../../data/element-book-entry/entry-tree/entry-tree';
7
- import { ElementBookMainRoute, extractSearchQuery, } from '../../../routing/element-book-routing';
7
+ import { ElementBookMainRoute, defaultElementBookFullRoute, extractSearchQuery, } from '../../../routing/element-book-routing';
8
8
  import { colorThemeCssVars } from '../../color-theme/color-theme';
9
9
  import { ChangeRouteEvent } from '../../events/change-route.event';
10
10
  import { Element24Icon } from '../../icons/element-24.icon';
@@ -130,12 +130,17 @@ export const ElementBookEntryDisplay = defineElementBookElement()({
130
130
  if (inputElement.value !== preThrottleValue) {
131
131
  return;
132
132
  }
133
- dispatch(new ChangeRouteEvent({
134
- paths: [
135
- ElementBookMainRoute.Search,
136
- encodeURIComponent(inputElement.value),
137
- ],
138
- }));
133
+ if (inputElement.value) {
134
+ dispatch(new ChangeRouteEvent({
135
+ paths: [
136
+ ElementBookMainRoute.Search,
137
+ encodeURIComponent(inputElement.value),
138
+ ],
139
+ }));
140
+ }
141
+ else {
142
+ dispatch(new ChangeRouteEvent(defaultElementBookFullRoute));
143
+ }
139
144
  })}
140
145
  />
141
146
  </div>
@@ -1 +1 @@
1
- export declare const ChangeRouteEvent: import("element-vir").DefinedTypedEvent<"change-route", Partial<Required<Readonly<import("spa-router-vir").FullRoute<import("../../routing/element-book-routing").ValidElementBookPaths, Record<string, string> | undefined, undefined>>>>>;
1
+ export declare const ChangeRouteEvent: import("element-vir").DefinedTypedEvent<"element-book-change-route", Partial<Required<Readonly<import("spa-router-vir").FullRoute<import("../../routing/element-book-routing").ValidElementBookPaths, Record<string, string> | undefined, undefined>>>>>;
@@ -1,2 +1,2 @@
1
1
  import { defineTypedEvent } from 'element-vir';
2
- export const ChangeRouteEvent = defineTypedEvent()('change-route');
2
+ export const ChangeRouteEvent = defineTypedEvent()('element-book-change-route');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "element-book",
3
- "version": "3.0.0",
3
+ "version": "3.0.2",
4
4
  "keywords": [
5
5
  "book",
6
6
  "design system",