skandha-facets 0.5.0 → 0.8.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/Addition.d.ts CHANGED
@@ -1,10 +1,11 @@
1
- import { AdditionCbs, GenericObjectT } from "./AdditionCbs";
2
- export type { AdditionCbs } from "./AdditionCbs";
1
+ import { AdditionCbs, GenericObjectT } from './AdditionCbs';
2
+ export type { AdditionCbs } from './AdditionCbs';
3
3
  export declare class Addition<ValueT = any> {
4
+ static className: () => string;
4
5
  item?: ValueT;
5
6
  parentId?: string;
6
- add(values: GenericObjectT): (cbs: AdditionCbs<ValueT>["add"]) => void;
7
- confirm(): (cbs: AdditionCbs<ValueT>["confirm"]) => void;
8
- cancel(): (cbs: AdditionCbs<ValueT>["cancel"]) => void;
7
+ add(values: GenericObjectT): (cbs: AdditionCbs<ValueT>['add']) => void;
8
+ confirm(): (cbs: AdditionCbs<ValueT>['confirm']) => void;
9
+ cancel(): (cbs: AdditionCbs<ValueT>['cancel']) => void;
9
10
  _reset(): void;
10
11
  }
package/Addition.js CHANGED
@@ -4,8 +4,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
4
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
- import { operation, data } from "skandha";
8
- import { host, maybe } from "aspiration";
7
+ import { host, maybe } from 'aspiration';
8
+ import { data, operation } from 'skandha';
9
9
  export class Addition {
10
10
  constructor() {
11
11
  Object.defineProperty(this, "item", {
@@ -45,6 +45,12 @@ export class Addition {
45
45
  this.parentId = undefined;
46
46
  }
47
47
  }
48
+ Object.defineProperty(Addition, "className", {
49
+ enumerable: true,
50
+ configurable: true,
51
+ writable: true,
52
+ value: () => 'Addition'
53
+ });
48
54
  __decorate([
49
55
  data
50
56
  ], Addition.prototype, "item", void 0);
@@ -53,7 +59,7 @@ __decorate([
53
59
  ], Addition.prototype, "parentId", void 0);
54
60
  __decorate([
55
61
  operation,
56
- host
62
+ host(['values'])
57
63
  ], Addition.prototype, "add", null);
58
64
  __decorate([
59
65
  operation,
package/Deletion.d.ts CHANGED
@@ -1,5 +1,6 @@
1
- import { DeletionCbs } from "./DeletionCbs";
2
- export type { DeletionCbs } from "./DeletionCbs";
1
+ import { DeletionCbs } from './DeletionCbs';
2
+ export type { DeletionCbs } from './DeletionCbs';
3
3
  export declare class Deletion {
4
- delete(itemIds: string[]): (cbs: DeletionCbs["delete"]) => void;
4
+ static className: () => string;
5
+ delete(itemIds: string[]): (cbs: DeletionCbs['delete']) => any;
5
6
  }
package/Deletion.js CHANGED
@@ -4,16 +4,22 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
4
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
- import { operation } from "skandha";
8
- import { host } from "aspiration";
7
+ import { host } from 'aspiration';
8
+ import { operation } from 'skandha';
9
9
  export class Deletion {
10
10
  delete(itemIds) {
11
11
  return (cbs) => {
12
- cbs.deleteItems();
12
+ return cbs.deleteItems();
13
13
  };
14
14
  }
15
15
  }
16
+ Object.defineProperty(Deletion, "className", {
17
+ enumerable: true,
18
+ configurable: true,
19
+ writable: true,
20
+ value: () => 'Deletion'
21
+ });
16
22
  __decorate([
17
23
  operation,
18
- host
24
+ host(['itemIds'])
19
25
  ], Deletion.prototype, "delete", null);
package/DeletionCbs.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { Cbs } from "aspiration";
1
+ import { Cbs } from 'aspiration';
2
2
  export declare class Deletion_delete extends Cbs {
3
3
  itemIds: string[];
4
- deleteItems(): void;
4
+ deleteItems(): any;
5
5
  }
6
6
  export declare type DeletionCbs = {
7
7
  delete: Deletion_delete;
package/DeletionCbs.js CHANGED
@@ -1,4 +1,4 @@
1
- import { stub, Cbs } from "aspiration";
1
+ import { Cbs, stub } from 'aspiration';
2
2
  export class Deletion_delete extends Cbs {
3
3
  constructor() {
4
4
  super(...arguments);
package/DragAndDrop.d.ts CHANGED
@@ -1,9 +1,10 @@
1
- import { DropPositionT } from "./Insertion";
2
- import { DragAndDropCbs } from "./DragAndDropCbs";
3
- export type { DragAndDropCbs } from "./DragAndDropCbs";
1
+ import { DragAndDropCbs } from './DragAndDropCbs';
2
+ import { DropPositionT } from './Insertion';
3
+ export type { DragAndDropCbs } from './DragAndDropCbs';
4
4
  export declare class DragAndDrop {
5
+ static className: () => string;
5
6
  hoverPosition?: DropPositionT;
6
- drop(dropPosition: DropPositionT): (cbs: DragAndDropCbs["drop"]) => void;
7
+ drop(dropPosition: DropPositionT): (cbs: DragAndDropCbs['drop']) => void;
7
8
  setHoverPosition(x?: DropPositionT): void;
8
9
  handle(itemId: string): {
9
10
  draggable: boolean;
package/DragAndDrop.js CHANGED
@@ -4,9 +4,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
4
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
- import { data, operation } from "skandha";
8
- import { isBefore } from "./internal/utils";
9
- import { host } from "aspiration";
7
+ import { host } from 'aspiration';
8
+ import { data, operation } from 'skandha';
9
+ import { isBefore } from './internal/utils';
10
10
  export class DragAndDrop {
11
11
  constructor() {
12
12
  Object.defineProperty(this, "hoverPosition", {
@@ -47,12 +47,18 @@ export class DragAndDrop {
47
47
  };
48
48
  }
49
49
  }
50
+ Object.defineProperty(DragAndDrop, "className", {
51
+ enumerable: true,
52
+ configurable: true,
53
+ writable: true,
54
+ value: () => 'DragAndDrop'
55
+ });
50
56
  __decorate([
51
57
  data
52
58
  ], DragAndDrop.prototype, "hoverPosition", void 0);
53
59
  __decorate([
54
60
  operation,
55
- host
61
+ host(['dropPosition'])
56
62
  ], DragAndDrop.prototype, "drop", null);
57
63
  __decorate([
58
64
  operation({ log: false })
package/Editing.d.ts CHANGED
@@ -1,8 +1,9 @@
1
- import { EditingCbs } from "./EditingCbs";
2
- export type { EditingCbs } from "./EditingCbs";
1
+ import { EditingCbs } from './EditingCbs';
2
+ export type { EditingCbs } from './EditingCbs';
3
3
  export declare class Editing {
4
+ static className: () => string;
4
5
  isEditing: boolean;
5
- save(values: any): (cbs: EditingCbs["save"]) => void;
6
- cancel(): (cbs: EditingCbs["cancel"]) => void;
7
- enable(): (cbs: EditingCbs["enable"]) => void;
6
+ save(values: any): (cbs: EditingCbs['save']) => void;
7
+ cancel(): (cbs: EditingCbs['cancel']) => void;
8
+ enable(): (cbs: EditingCbs['enable']) => void;
8
9
  }
package/Editing.js CHANGED
@@ -4,8 +4,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
4
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
- import { data, operation } from "skandha";
8
- import { host, maybe } from "aspiration";
7
+ import { host, maybe } from 'aspiration';
8
+ import { data, operation } from 'skandha';
9
9
  export class Editing {
10
10
  constructor() {
11
11
  Object.defineProperty(this, "isEditing", {
@@ -33,12 +33,18 @@ export class Editing {
33
33
  };
34
34
  }
35
35
  }
36
+ Object.defineProperty(Editing, "className", {
37
+ enumerable: true,
38
+ configurable: true,
39
+ writable: true,
40
+ value: () => 'Editing'
41
+ });
36
42
  __decorate([
37
43
  data
38
44
  ], Editing.prototype, "isEditing", void 0);
39
45
  __decorate([
40
46
  operation,
41
- host
47
+ host(['values'])
42
48
  ], Editing.prototype, "save", null);
43
49
  __decorate([
44
50
  operation,
package/Filtering.d.ts CHANGED
@@ -1,12 +1,13 @@
1
- import { GetterT } from "skandha";
2
- import { FilteringCbs, FilterT } from "./FilteringCbs";
3
- export type { FilteringCbs } from "./FilteringCbs";
1
+ import { GetterT } from 'skandha';
2
+ import { FilteringCbs, FilterT } from './FilteringCbs';
3
+ export type { FilteringCbs } from './FilteringCbs';
4
4
  export declare class Filtering<ValueT = any> {
5
+ static className: () => string;
5
6
  isEnabled: boolean;
6
7
  filter: FilterT;
7
8
  inputItems?: Array<ValueT>;
8
9
  get filteredItems(): any[] | undefined;
9
- apply(filter: FilterT): (cbs: FilteringCbs["apply"]) => void;
10
- setEnabled(flag: boolean): (cbs: FilteringCbs["setEnabled"]) => void;
10
+ apply(filter: FilterT): (cbs: FilteringCbs['apply']) => void;
11
+ setEnabled(flag: boolean): (cbs: FilteringCbs['setEnabled']) => void;
11
12
  }
12
- export declare const filteringUsesInputItems: (getItems: GetterT, transform?: Function | undefined) => (ctr: any) => void;
13
+ export declare const filteringUsesInputItems: (getItems: GetterT, transform?: Function) => (ctr: any) => void;
package/Filtering.js CHANGED
@@ -4,8 +4,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
4
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
- import { mapDataToFacet, data, operation } from "skandha";
8
- import { host } from "aspiration";
7
+ import { host } from 'aspiration';
8
+ import { data, mapDataToFacet, operation } from 'skandha';
9
9
  export class Filtering {
10
10
  constructor() {
11
11
  Object.defineProperty(this, "isEnabled", {
@@ -42,6 +42,12 @@ export class Filtering {
42
42
  };
43
43
  }
44
44
  }
45
+ Object.defineProperty(Filtering, "className", {
46
+ enumerable: true,
47
+ configurable: true,
48
+ writable: true,
49
+ value: () => 'Filtering'
50
+ });
45
51
  __decorate([
46
52
  data
47
53
  ], Filtering.prototype, "isEnabled", void 0);
@@ -56,10 +62,10 @@ __decorate([
56
62
  ], Filtering.prototype, "filteredItems", null);
57
63
  __decorate([
58
64
  operation,
59
- host
65
+ host(['filter'])
60
66
  ], Filtering.prototype, "apply", null);
61
67
  __decorate([
62
68
  operation,
63
- host
69
+ host(['flag'])
64
70
  ], Filtering.prototype, "setEnabled", null);
65
- export const filteringUsesInputItems = (getItems, transform) => mapDataToFacet([Filtering, "inputItems"], getItems, transform);
71
+ export const filteringUsesInputItems = (getItems, transform) => mapDataToFacet([Filtering, 'inputItems'], getItems, transform);
package/Highlight.d.ts CHANGED
@@ -1,9 +1,10 @@
1
- import { GetterT } from "skandha";
2
- import { HighlightCbs } from "./HighlightCbs";
3
- export type { HighlightCbs } from "./HighlightCbs";
1
+ import { GetterT } from 'skandha';
2
+ import { HighlightCbs } from './HighlightCbs';
3
+ export type { HighlightCbs } from './HighlightCbs';
4
4
  export declare class Highlight<ValueT = any> {
5
+ static className: () => string;
5
6
  id: string | undefined;
6
7
  item?: ValueT;
7
- highlightItem(id: string): (cbs: HighlightCbs["highlightItem"]) => void;
8
+ highlightItem(id: string): (cbs: HighlightCbs['highlightItem']) => void;
8
9
  }
9
10
  export declare const highlightUsesItemLookUpTable: (getItemById: GetterT) => (ctr: any) => void;
package/Highlight.js CHANGED
@@ -4,8 +4,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
4
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
- import { host, maybe } from "aspiration";
8
- import { data, getm, mapDatasToFacet, operation, output, } from "skandha";
7
+ import { host, maybe } from 'aspiration';
8
+ import { data, getm, mapDatasToFacet, operation, output, } from 'skandha';
9
9
  export class Highlight {
10
10
  constructor() {
11
11
  Object.defineProperty(this, "id", {
@@ -28,6 +28,12 @@ export class Highlight {
28
28
  };
29
29
  }
30
30
  }
31
+ Object.defineProperty(Highlight, "className", {
32
+ enumerable: true,
33
+ configurable: true,
34
+ writable: true,
35
+ value: () => 'Highlight'
36
+ });
31
37
  __decorate([
32
38
  data
33
39
  ], Highlight.prototype, "id", void 0);
@@ -36,12 +42,12 @@ __decorate([
36
42
  ], Highlight.prototype, "item", void 0);
37
43
  __decorate([
38
44
  operation,
39
- host
45
+ host(['id'])
40
46
  ], Highlight.prototype, "highlightItem", null);
41
- export const highlightUsesItemLookUpTable = (getItemById) => mapDatasToFacet([Highlight, "item"], [
47
+ export const highlightUsesItemLookUpTable = (getItemById) => mapDatasToFacet([Highlight, 'item'], [
42
48
  //
43
49
  getItemById,
44
- getm([Highlight, "id"]),
50
+ getm([Highlight, 'id']),
45
51
  ], (itemById, id) => {
46
52
  return itemById[id];
47
53
  });
package/Insertion.d.ts CHANGED
@@ -1,10 +1,11 @@
1
- import { GetterT } from "skandha";
2
- import { DragT, InsertionCbs } from "./InsertionCbs";
3
- export type { DragT, DropPositionT, InsertionCbs } from "./InsertionCbs";
1
+ import { GetterT } from 'skandha';
2
+ import { DragT, InsertionCbs } from './InsertionCbs';
3
+ export type { DragT, DropPositionT, InsertionCbs } from './InsertionCbs';
4
4
  export declare type DragSourceT = (ctr: any) => DragT | undefined;
5
5
  export declare class Insertion<ValueT = any> {
6
+ static className: () => string;
6
7
  inputItems?: Array<ValueT>;
7
8
  preview?: Array<ValueT>;
8
- insertItems(drag: DragT): (cbs: InsertionCbs["insertItems"]) => void;
9
+ insertItems(drag: DragT): (cbs: InsertionCbs['insertItems']) => void;
9
10
  }
10
- export declare const insertionUsesInputItems: (getItems: GetterT, transform?: Function | undefined) => (ctr: any) => void;
11
+ export declare const insertionUsesInputItems: (getItems: GetterT, transform?: Function) => (ctr: any) => void;
package/Insertion.js CHANGED
@@ -4,9 +4,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
4
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
- import { host } from "aspiration";
8
- import { input, mapDataToFacet, operation, output } from "skandha";
9
- import { getPreview } from "./lib/getPreview";
7
+ import { host } from 'aspiration';
8
+ import { input, mapDataToFacet, operation, output } from 'skandha';
9
+ import { getPreview } from './lib/getPreview';
10
10
  export class Insertion {
11
11
  constructor() {
12
12
  Object.defineProperty(this, "inputItems", {
@@ -31,6 +31,12 @@ export class Insertion {
31
31
  };
32
32
  }
33
33
  }
34
+ Object.defineProperty(Insertion, "className", {
35
+ enumerable: true,
36
+ configurable: true,
37
+ writable: true,
38
+ value: () => 'Insertion'
39
+ });
34
40
  __decorate([
35
41
  input
36
42
  ], Insertion.prototype, "inputItems", void 0);
@@ -39,6 +45,6 @@ __decorate([
39
45
  ], Insertion.prototype, "preview", void 0);
40
46
  __decorate([
41
47
  operation,
42
- host
48
+ host(['drag'])
43
49
  ], Insertion.prototype, "insertItems", null);
44
- export const insertionUsesInputItems = (getItems, transform) => mapDataToFacet([Insertion, "inputItems"], getItems, transform);
50
+ export const insertionUsesInputItems = (getItems, transform) => mapDataToFacet([Insertion, 'inputItems'], getItems, transform);
package/Labelling.d.ts CHANGED
@@ -1,10 +1,11 @@
1
- import { GetterT } from "skandha";
2
- import { IdsByLabelT, ItemsByLabelT, LabelValueT, LabellingCbs } from "./LabellingCbs";
3
- export type { LabellingCbs } from "./LabellingCbs";
1
+ import { GetterT } from 'skandha';
2
+ import { IdsByLabelT, ItemsByLabelT, LabellingCbs, LabelValueT } from './LabellingCbs';
3
+ export type { LabellingCbs } from './LabellingCbs';
4
4
  export declare class Labelling {
5
+ static className: () => string;
5
6
  idsByLabel: IdsByLabelT;
6
7
  ids: (label: string) => any[];
7
8
  itemsByLabel?: ItemsByLabelT;
8
- setLabel(labelValue: LabelValueT): (cbs: LabellingCbs["setLabel"]) => void;
9
+ setLabel(labelValue: LabelValueT): (cbs: LabellingCbs['setLabel']) => void;
9
10
  }
10
11
  export declare const labellingActsOnItems: (getItemById: GetterT) => (ctr: any) => void;
package/Labelling.js CHANGED
@@ -4,10 +4,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
4
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
- import { data, input, operation } from "skandha";
8
- import { getm, mapDatasToFacet } from "skandha";
9
- import { host } from "aspiration";
10
- import { lookUp } from "./internal/utils";
7
+ import { host } from 'aspiration';
8
+ import { data, getm, input, mapDatasToFacet, operation, } from 'skandha';
9
+ import { lookUp } from './internal/utils';
11
10
  export class Labelling {
12
11
  constructor() {
13
12
  Object.defineProperty(this, "idsByLabel", {
@@ -44,6 +43,12 @@ export class Labelling {
44
43
  };
45
44
  }
46
45
  }
46
+ Object.defineProperty(Labelling, "className", {
47
+ enumerable: true,
48
+ configurable: true,
49
+ writable: true,
50
+ value: () => 'Labelling'
51
+ });
47
52
  __decorate([
48
53
  data
49
54
  ], Labelling.prototype, "idsByLabel", void 0);
@@ -52,12 +57,12 @@ __decorate([
52
57
  ], Labelling.prototype, "itemsByLabel", void 0);
53
58
  __decorate([
54
59
  operation,
55
- host
60
+ host(['labelValue'])
56
61
  ], Labelling.prototype, "setLabel", null);
57
62
  export const labellingActsOnItems = (getItemById) => {
58
- return mapDatasToFacet([Labelling, "itemsByLabel"], [
63
+ return mapDatasToFacet([Labelling, 'itemsByLabel'], [
59
64
  //
60
65
  getItemById,
61
- getm([Labelling, "idsByLabel"]),
66
+ getm([Labelling, 'idsByLabel']),
62
67
  ], (itemById, idsByLabel) => Object.fromEntries(Object.entries(idsByLabel).map(([label, ids]) => lookUp(ids, itemById))));
63
68
  };
package/Selection.d.ts CHANGED
@@ -1,12 +1,13 @@
1
- import { GetterT } from "skandha";
2
- import { SelectionParamsT, SelectionCbs } from "./SelectionCbs";
3
- export type { SelectionParamsT, SelectionCbs } from "./SelectionCbs";
1
+ import { GetterT } from 'skandha';
2
+ import { SelectionCbs, SelectionParamsT } from './SelectionCbs';
3
+ export type { SelectionCbs, SelectionParamsT } from './SelectionCbs';
4
4
  export declare class Selection<ValueT = any> {
5
+ static className: () => string;
5
6
  selectableIds?: Array<string>;
6
7
  ids: Array<string>;
7
8
  anchorId?: string;
8
9
  items?: Array<ValueT>;
9
- selectItem(selectionParams: SelectionParamsT): (cbs: SelectionCbs["selectItem"]) => void;
10
+ selectItem(selectionParams: SelectionParamsT): (cbs: SelectionCbs['selectItem']) => void;
10
11
  }
11
12
  export declare function handleSelectItem(facet: Selection, { itemId, isShift, isCtrl }: SelectionParamsT): void;
12
13
  export declare const selectionUsesItemLookUpTable: (getItemById: GetterT) => (ctr: any) => void;
package/Selection.js CHANGED
@@ -4,9 +4,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
4
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
- import { host } from "aspiration";
8
- import { getm, mapDatasToFacet, mapDataToFacet, data, input, operation, output, } from "skandha";
9
- import { lookUp, range } from "./internal/utils";
7
+ import { host } from 'aspiration';
8
+ import { data, getm, input, mapDatasToFacet, mapDataToFacet, operation, output, } from 'skandha';
9
+ import { lookUp, range } from './internal/utils';
10
10
  const selectItemDefaultCbs = (selection) => ({
11
11
  selectItem: function () {
12
12
  handleSelectItem(selection, this.selectionParams);
@@ -45,6 +45,12 @@ export class Selection {
45
45
  };
46
46
  }
47
47
  }
48
+ Object.defineProperty(Selection, "className", {
49
+ enumerable: true,
50
+ configurable: true,
51
+ writable: true,
52
+ value: () => 'Selection'
53
+ });
48
54
  __decorate([
49
55
  input
50
56
  ], Selection.prototype, "selectableIds", void 0);
@@ -59,13 +65,18 @@ __decorate([
59
65
  ], Selection.prototype, "items", void 0);
60
66
  __decorate([
61
67
  operation,
62
- host(selectItemDefaultCbs)
68
+ host(['selectionParams'], selectItemDefaultCbs)
63
69
  ], Selection.prototype, "selectItem", null);
64
70
  export function handleSelectItem(facet, { itemId, isShift, isCtrl }) {
71
+ if (itemId === undefined) {
72
+ facet.ids = [];
73
+ facet.anchorId = undefined;
74
+ return;
75
+ }
65
76
  const hasItem = facet.ids.includes(itemId);
66
77
  const selectableIds = facet.selectableIds;
67
78
  if (!selectableIds) {
68
- throw Error("logical error");
79
+ throw Error('logical error');
69
80
  }
70
81
  if (isShift) {
71
82
  const startItemId = facet.anchorId || itemId;
@@ -87,11 +98,11 @@ export function handleSelectItem(facet, { itemId, isShift, isCtrl }) {
87
98
  facet.anchorId = itemId;
88
99
  }
89
100
  }
90
- export const selectionUsesItemLookUpTable = (getItemById) => mapDatasToFacet([Selection, "items"], [
101
+ export const selectionUsesItemLookUpTable = (getItemById) => mapDatasToFacet([Selection, 'items'], [
91
102
  //
92
103
  getItemById,
93
- getm([Selection, "ids"]),
104
+ getm([Selection, 'ids']),
94
105
  ], (itemById, ids) => {
95
106
  return lookUp(ids, itemById);
96
107
  });
97
- export const selectionUsesSelectableIds = (getIds, transform) => mapDataToFacet([Selection, "selectableIds"], getIds, transform);
108
+ export const selectionUsesSelectableIds = (getIds, transform) => mapDataToFacet([Selection, 'selectableIds'], getIds, transform);
package/SelectionCbs.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Cbs } from "aspiration";
2
2
  export declare type SelectionParamsT = {
3
- itemId: string;
3
+ itemId: string | undefined;
4
4
  isShift?: boolean;
5
5
  isCtrl?: boolean;
6
6
  context?: any;
@@ -1,4 +1,4 @@
1
- import { Selection } from "../Selection";
1
+ import { Selection } from '../Selection';
2
2
  export declare type PropsT = {
3
3
  selection: Selection;
4
4
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skandha-facets",
3
- "version": "0.5.0",
3
+ "version": "0.8.0",
4
4
  "description": "Facets for use with the skandha library",
5
5
  "main": "index.js",
6
6
  "repository": "https://github.com/mnieber/skandha-facets.git",
@@ -9,8 +9,8 @@
9
9
  "types": "index.d.ts",
10
10
  "prepublish": "tsc",
11
11
  "peerDependencies": {
12
- "skandha": ">=0.5.0",
13
- "aspiration": ">=0.1.1"
12
+ "skandha": ">=0.7.0",
13
+ "aspiration": ">=0.3.0"
14
14
  },
15
15
  "devDependencies": {
16
16
  "typescript": "^4.0.3"