Skip to content
This repository has been archived by the owner on Dec 7, 2019. It is now read-only.

Commit

Permalink
feat(core): Click strategy now controls selection
Browse files Browse the repository at this point in the history
BREAKING CHANGE: If you are redefining the "strategies" prop,
you now have to use click: ["select"] to enable element selection on click.
Otherwise, clicking on an item won't trigger selection.
  • Loading branch information
elbywan committed Oct 9, 2017
1 parent b84cf50 commit 6ae798b
Show file tree
Hide file tree
Showing 58 changed files with 138 additions and 118 deletions.
2 changes: 1 addition & 1 deletion build/angular/bundle/angular.umd.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/core/bundle/core.umd.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/core/bundle/core.umd.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/core/defaults.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/core/defaults.js.flow
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// @flow

declare export var defaults: {async: (_: Function) => any, css: {TreeView: string, async: string, category: string, depth: string, disabled: string, dragover: string, folded: string, item: string, loading: string, nodrop: string, opener: string, search: string, selected: string}, display: (_: Object) => any, dragndrop: {draggable: boolean, droppable: boolean}, labels: {search.placeholder: string}, openerOpts: {position: string}, strategies: {click: [], fold: [string, string], selection: [string]}};
declare export var defaults: {async: (_: Function) => any, css: {TreeView: string, async: string, category: string, depth: string, disabled: string, dragover: string, folded: string, item: string, loading: string, nodrop: string, opener: string, search: string, selected: string}, display: (_: Object) => any, dragndrop: {draggable: boolean, droppable: boolean}, labels: {search.placeholder: string}, openerOpts: {position: string}, strategies: {click: [string], fold: [string, string], selection: [string]}};
2 changes: 1 addition & 1 deletion build/core/defaults.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions build/core/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ declare export class TreeNode extends Class0<mixed /* UNEXPECTED TYPE: ExistsT *
onOpener(item: Object): (event: Class2) => void;
}
export type TreeNodeInput = {ancestors: Array<Object>, async?: (_: (_: mixed) => Promise<Array<Object>>) => Promise<Array<Object>>, category: string, css: {[key: string]: string}, depth?: number, disabled?: (_: Object) => boolean, dragndrop: Object, model: Array<Object>, onSelect: (item: Object, ancestors: Array<Object>, neighbours: Array<Object>) => void, selection: Array<Object>, strategies?: Object};
declare export var clickStrategies: {[key: string]: (item: Object, event: Class2, ancestors: Array<Object>, neighbours: Array<Object>) => void};
declare export var defaults: {async: (_: Function) => any, css: {TreeView: string, async: string, category: string, depth: string, disabled: string, dragover: string, folded: string, item: string, loading: string, nodrop: string, opener: string, search: string, selected: string}, display: (_: Object) => any, dragndrop: {draggable: boolean, droppable: boolean}, labels: {search.placeholder: string}, openerOpts: {position: string}, strategies: {click: [], fold: [string, string], selection: [string]}};
declare export var clickStrategies: {[key: string]: (item: Object, event: Class2, inputs: Object) => void};
declare export var defaults: {async: (_: Function) => any, css: {TreeView: string, async: string, category: string, depth: string, disabled: string, dragover: string, folded: string, item: string, loading: string, nodrop: string, opener: string, search: string, selected: string}, display: (_: Object) => any, dragndrop: {draggable: boolean, droppable: boolean}, labels: {search.placeholder: string}, openerOpts: {position: string}, strategies: {click: [string], fold: [string, string], selection: [string]}};
declare export var dragndrop: {paste: (model: (_: void) => Array<Object>, cb: (_: Array<Object>) => void) => {drop: (target: Object, event: Class3, inputs: Object) => void, droppable: boolean}, pluck: (model: (_: void) => Array<Object>, cb: (_: Array<Object>) => void) => {backup: [], cancel: () => void, drag: (item: Object, event: Class3, inputs: Object) => void, draggable: boolean}, selection: (model: (_: void) => Array<Object>, cb: (_: Array<Object>) => void) => {drag: (item: Object, event: Class3, inputs: Object) => void, draggable: boolean, drop: (target: ?Object, event: Class3, inputs: Object) => void, droppable: boolean, guard: (target: ?Object, event: Class3, inputs: Object) => any | any | boolean | boolean}};
declare export var foldStrategies: {[key: string]: (item: Object, folded: boolean) => boolean};
declare export var nodeEvents: {onDragEnd: (item: ?Object) => (event: Class3) => void, onDragEnter: (item: ?Object) => (event: Class3) => void, onDragLeave: (item: ?Object) => (event: Class3) => void, onDragOver: (item: ?Object) => (event: Class3) => void, onDragStart: (item: ?Object) => (event: Class3) => void, onDrop: (item: ?Object) => (event: Class3) => void};
Expand Down
2 changes: 1 addition & 1 deletion build/core/logic.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/core/logic.js.map

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions build/core/strategies.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/core/strategies.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ declare class Class0 extends UIEvent {
constructor(typeArg: string, mouseEventInit?: {altKey?: boolean, button?: number, buttons?: number, clientX?: number, clientY?: number, ctrlKey?: boolean, metaKey?: boolean, region?: string | null, relatedTarget?: string | null, screenX?: number, screenY?: number, shiftKey?: boolean}): void;
getModifierState(keyArg: string): boolean;
}
declare export var clickStrategies: {[key: string]: (item: Object, event: Class0, ancestors: Array<Object>, neighbours: Array<Object>) => void};
declare export var clickStrategies: {[key: string]: (item: Object, event: Class0, inputs: Object) => void};
declare export var foldStrategies: {[key: string]: (item: Object, folded: boolean) => boolean};
declare export var selectionStrategies: {[key: string]: (item: Object, selection: Array<Object>, neighbours: Array<Object>, ancestors: Array<Object>) => Array<Object>};
Loading

0 comments on commit 6ae798b

Please sign in to comment.