@nanoporetech-digital/components 4.9.4 → 5.0.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/CHANGELOG.md +51 -0
- package/dist/cjs/drag-777bd8dd.js +74 -0
- package/dist/cjs/drag-777bd8dd.js.map +1 -0
- package/dist/cjs/{form-control-2e900f54.js → form-control-443e90bf.js} +2 -3
- package/dist/cjs/form-control-443e90bf.js.map +1 -0
- package/dist/cjs/index-71f899a7.js +10 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/nano-components.cjs.js +1 -1
- package/dist/cjs/nano-global-nav-user-profile_3.cjs.entry.js +6 -6
- package/dist/cjs/nano-global-nav-user-profile_3.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-grid-item.cjs.entry.js +29 -0
- package/dist/cjs/nano-grid-item.cjs.entry.js.map +1 -0
- package/dist/cjs/nano-grid_2.cjs.entry.js +436 -0
- package/dist/cjs/nano-grid_2.cjs.entry.js.map +1 -0
- package/dist/cjs/nano-hero.cjs.entry.js +4 -10
- package/dist/cjs/nano-hero.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-icon-button_2.cjs.entry.js +40 -3
- package/dist/cjs/nano-icon-button_2.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-input.cjs.entry.js +2 -2
- package/dist/cjs/nano-input.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-range.cjs.entry.js +1 -1
- package/dist/cjs/nano-range.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-sortable.cjs.entry.js +654 -0
- package/dist/cjs/nano-sortable.cjs.entry.js.map +1 -0
- package/dist/cjs/nano-split-pane.cjs.entry.js +30 -45
- package/dist/cjs/nano-split-pane.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-tab-group.cjs.entry.js +39 -43
- package/dist/cjs/nano-tab-group.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-tab.cjs.entry.js +3 -3
- package/dist/cjs/nano-tab.cjs.entry.js.map +1 -1
- package/dist/cjs/{nano-table-54a4ba34.js → nano-table-11052a34.js} +52 -172
- package/dist/cjs/nano-table-11052a34.js.map +1 -0
- package/dist/cjs/nano-table.cjs.entry.js +1 -1
- package/dist/cjs/{table.worker-20ed37a5.js → table.worker-83433a8b.js} +3 -3
- package/dist/cjs/table.worker-83433a8b.js.map +1 -0
- package/dist/cjs/{table.worker-f820b411.js → table.worker-bd51e29f.js} +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/form-control/form-control.js +1 -2
- package/dist/collection/components/form-control/form-control.js.map +1 -1
- package/dist/collection/components/grid/grid-item.js +11 -136
- package/dist/collection/components/grid/grid-item.js.map +1 -1
- package/dist/collection/components/grid/grid.css +9 -242
- package/dist/collection/components/grid/grid.js +248 -240
- package/dist/collection/components/grid/grid.js.map +1 -1
- package/dist/collection/components/hero/hero.css +42 -89
- package/dist/collection/components/hero/hero.js +4 -11
- package/dist/collection/components/hero/hero.js.map +1 -1
- package/dist/collection/components/icon-button/icon-button.css +18 -4
- package/dist/collection/components/icon-button/icon-button.js +83 -4
- package/dist/collection/components/icon-button/icon-button.js.map +1 -1
- package/dist/collection/components/input/input.css +8 -9
- package/dist/collection/components/nav-item/nav-item.js +4 -4
- package/dist/collection/components/nav-item/nav-item.js.map +1 -1
- package/dist/collection/components/range/range.css +0 -3
- package/dist/collection/components/select/select.css +8 -9
- package/dist/collection/components/sortable/sortable.css +28 -0
- package/dist/collection/components/sortable/sortable.js +1181 -0
- package/dist/collection/components/sortable/sortable.js.map +1 -0
- package/dist/collection/components/split-pane/split-pane.js +29 -27
- package/dist/collection/components/split-pane/split-pane.js.map +1 -1
- package/dist/collection/components/table/table-interface.js.map +1 -1
- package/dist/collection/components/table/table.css +18 -38
- package/dist/collection/components/table/table.header.js +3 -86
- package/dist/collection/components/table/table.header.js.map +1 -1
- package/dist/collection/components/table/table.js +27 -108
- package/dist/collection/components/table/table.js.map +1 -1
- package/dist/collection/components/table/table.row.js +7 -7
- package/dist/collection/components/table/table.row.js.map +1 -1
- package/dist/collection/components/table/table.store.js +1 -1
- package/dist/collection/components/table/table.store.js.map +1 -1
- package/dist/collection/components/table/table.worker.js +3 -3
- package/dist/collection/components/table/table.worker.js.map +1 -1
- package/dist/collection/components/tabs/tab-group.css +9 -13
- package/dist/collection/components/tabs/tab-group.js +39 -43
- package/dist/collection/components/tabs/tab-group.js.map +1 -1
- package/dist/collection/components/tabs/tab.css +53 -14
- package/dist/collection/components/tabs/tab.js +8 -2
- package/dist/collection/components/tabs/tab.js.map +1 -1
- package/dist/collection/utils/constructible-style.js +129 -0
- package/dist/collection/utils/constructible-style.js.map +1 -0
- package/dist/collection/utils/drag.js +52 -4
- package/dist/collection/utils/drag.js.map +1 -1
- package/dist/components/drag.js +72 -0
- package/dist/components/drag.js.map +1 -0
- package/dist/components/form-control.js +1 -2
- package/dist/components/form-control.js.map +1 -1
- package/dist/components/grid.js +268 -183
- package/dist/components/grid.js.map +1 -1
- package/dist/components/icon-button.js +45 -5
- package/dist/components/icon-button.js.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/input.js +1 -1
- package/dist/components/input.js.map +1 -1
- package/dist/components/nano-grid-item.js +33 -1
- package/dist/components/nano-grid-item.js.map +1 -1
- package/dist/components/nano-hero.js +6 -19
- package/dist/components/nano-hero.js.map +1 -1
- package/dist/components/nano-range.js +1 -1
- package/dist/components/nano-range.js.map +1 -1
- package/dist/components/nano-sortable.d.ts +11 -0
- package/dist/components/nano-sortable.js +692 -0
- package/dist/components/nano-sortable.js.map +1 -0
- package/dist/components/nano-split-pane.js +30 -45
- package/dist/components/nano-split-pane.js.map +1 -1
- package/dist/components/nano-tab-group.js +40 -44
- package/dist/components/nano-tab-group.js.map +1 -1
- package/dist/components/nano-tab.js +3 -3
- package/dist/components/nano-tab.js.map +1 -1
- package/dist/components/nav-item.js +4 -4
- package/dist/components/nav-item.js.map +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/select.js.map +1 -1
- package/dist/components/table.js +52 -173
- package/dist/components/table.js.map +1 -1
- package/dist/components/table.worker.js +1 -1
- package/dist/esm/drag-1723a4cc.js +72 -0
- package/dist/esm/drag-1723a4cc.js.map +1 -0
- package/dist/esm/{form-control-269ba84f.js → form-control-e8739b2e.js} +2 -3
- package/dist/esm/form-control-e8739b2e.js.map +1 -0
- package/dist/esm/index-dad5627b.js +10 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/nano-components.js +1 -1
- package/dist/esm/nano-global-nav-user-profile_3.entry.js +6 -6
- package/dist/esm/nano-global-nav-user-profile_3.entry.js.map +1 -1
- package/dist/esm/nano-grid-item.entry.js +25 -0
- package/dist/esm/nano-grid-item.entry.js.map +1 -0
- package/dist/esm/nano-grid_2.entry.js +431 -0
- package/dist/esm/nano-grid_2.entry.js.map +1 -0
- package/dist/esm/nano-hero.entry.js +4 -10
- package/dist/esm/nano-hero.entry.js.map +1 -1
- package/dist/esm/nano-icon-button_2.entry.js +41 -4
- package/dist/esm/nano-icon-button_2.entry.js.map +1 -1
- package/dist/esm/nano-input.entry.js +2 -2
- package/dist/esm/nano-input.entry.js.map +1 -1
- package/dist/esm/nano-range.entry.js +1 -1
- package/dist/esm/nano-range.entry.js.map +1 -1
- package/dist/esm/nano-sortable.entry.js +650 -0
- package/dist/esm/nano-sortable.entry.js.map +1 -0
- package/dist/esm/nano-split-pane.entry.js +30 -45
- package/dist/esm/nano-split-pane.entry.js.map +1 -1
- package/dist/esm/nano-tab-group.entry.js +39 -43
- package/dist/esm/nano-tab-group.entry.js.map +1 -1
- package/dist/esm/nano-tab.entry.js +3 -3
- package/dist/esm/nano-tab.entry.js.map +1 -1
- package/dist/esm/{nano-table-929ac4d9.js → nano-table-ba637f26.js} +53 -173
- package/dist/esm/nano-table-ba637f26.js.map +1 -0
- package/dist/esm/nano-table.entry.js +1 -1
- package/dist/esm/{table.worker-2425382a.js → table.worker-1cae39c9.js} +3 -3
- package/dist/esm/table.worker-1cae39c9.js.map +1 -0
- package/dist/{nano-components/p-f820b411.js → esm/table.worker-bd51e29f.js} +1 -1
- package/dist/nano-components/nano-components.css +1 -1
- package/dist/nano-components/nano-components.esm.js +1 -1
- package/dist/nano-components/nano-components.esm.js.map +1 -1
- package/dist/nano-components/p-00cf8021.entry.js +5 -0
- package/dist/nano-components/p-00cf8021.entry.js.map +1 -0
- package/dist/nano-components/{p-906de5a2.entry.js → p-158c73b0.entry.js} +2 -2
- package/dist/nano-components/p-365c997a.js +5 -0
- package/dist/nano-components/p-553acf24.entry.js +5 -0
- package/dist/nano-components/p-553acf24.entry.js.map +1 -0
- package/dist/nano-components/p-6975f110.entry.js +5 -0
- package/dist/nano-components/p-6975f110.entry.js.map +1 -0
- package/dist/nano-components/p-71057181.js +5 -0
- package/dist/nano-components/p-71057181.js.map +1 -0
- package/dist/nano-components/p-842cf127.js +5 -0
- package/dist/nano-components/p-842cf127.js.map +1 -0
- package/dist/nano-components/p-ad6209ec.entry.js +5 -0
- package/dist/nano-components/p-ad6209ec.entry.js.map +1 -0
- package/dist/nano-components/p-b8e76fdf.entry.js +5 -0
- package/dist/nano-components/p-b8e76fdf.entry.js.map +1 -0
- package/dist/{esm/table.worker-f820b411.js → nano-components/p-bd51e29f.js} +1 -1
- package/dist/nano-components/p-bdef618c.entry.js +5 -0
- package/dist/nano-components/p-bdef618c.entry.js.map +1 -0
- package/dist/nano-components/p-d79c6862.entry.js +5 -0
- package/dist/nano-components/p-d79c6862.entry.js.map +1 -0
- package/dist/nano-components/p-deb0799c.entry.js +5 -0
- package/dist/nano-components/{p-6a3a29c6.entry.js.map → p-deb0799c.entry.js.map} +1 -1
- package/dist/nano-components/p-ebb98a9e.entry.js +5 -0
- package/dist/nano-components/p-ebb98a9e.entry.js.map +1 -0
- package/dist/nano-components/p-f60fe933.entry.js +5 -0
- package/dist/nano-components/p-f60fe933.entry.js.map +1 -0
- package/dist/nano-components/p-f7535f45.entry.js +5 -0
- package/dist/nano-components/p-f7535f45.entry.js.map +1 -0
- package/dist/nano-components/p-fc585ea2.js +5 -0
- package/dist/nano-components/p-fc585ea2.js.map +1 -0
- package/dist/types/components/grid/grid-item.d.ts +3 -11
- package/dist/types/components/grid/grid.d.ts +44 -68
- package/dist/types/components/hero/hero.d.ts +1 -3
- package/dist/types/components/icon-button/icon-button.d.ts +14 -0
- package/dist/types/components/sortable/sortable.d.ts +204 -0
- package/dist/types/components/table/table-interface.d.ts +2 -4
- package/dist/types/components/table/table.d.ts +5 -30
- package/dist/types/components/table/table.header.d.ts +0 -3
- package/dist/types/components/tabs/tab-group.d.ts +0 -1
- package/dist/types/components/tabs/tab.d.ts +6 -0
- package/dist/types/components.d.ts +333 -89
- package/dist/types/utils/constructible-style.d.ts +31 -0
- package/dist/types/utils/drag.d.ts +21 -1
- package/docs-json.json +743 -168
- package/docs-vscode.json +102 -26
- package/hydrate/index.js +1210 -552
- package/package.json +2 -2
- package/dist/cjs/form-control-2e900f54.js.map +0 -1
- package/dist/cjs/nano-grid_3.cjs.entry.js +0 -431
- package/dist/cjs/nano-grid_3.cjs.entry.js.map +0 -1
- package/dist/cjs/nano-table-54a4ba34.js.map +0 -1
- package/dist/cjs/table.worker-20ed37a5.js.map +0 -1
- package/dist/collection/components/grid/grid-item.css +0 -15
- package/dist/components/grid-item.js +0 -107
- package/dist/components/grid-item.js.map +0 -1
- package/dist/esm/form-control-269ba84f.js.map +0 -1
- package/dist/esm/nano-grid_3.entry.js +0 -425
- package/dist/esm/nano-grid_3.entry.js.map +0 -1
- package/dist/esm/nano-table-929ac4d9.js.map +0 -1
- package/dist/esm/table.worker-2425382a.js.map +0 -1
- package/dist/nano-components/p-068bdd89.entry.js +0 -5
- package/dist/nano-components/p-068bdd89.entry.js.map +0 -1
- package/dist/nano-components/p-107d4549.entry.js +0 -5
- package/dist/nano-components/p-107d4549.entry.js.map +0 -1
- package/dist/nano-components/p-239d343a.entry.js +0 -5
- package/dist/nano-components/p-239d343a.entry.js.map +0 -1
- package/dist/nano-components/p-4f260028.js +0 -5
- package/dist/nano-components/p-4f260028.js.map +0 -1
- package/dist/nano-components/p-5381c118.js +0 -5
- package/dist/nano-components/p-58b53239.entry.js +0 -5
- package/dist/nano-components/p-58b53239.entry.js.map +0 -1
- package/dist/nano-components/p-5ac74848.js +0 -5
- package/dist/nano-components/p-5ac74848.js.map +0 -1
- package/dist/nano-components/p-64b56ee6.entry.js +0 -5
- package/dist/nano-components/p-64b56ee6.entry.js.map +0 -1
- package/dist/nano-components/p-6a3a29c6.entry.js +0 -5
- package/dist/nano-components/p-a5a560e7.entry.js +0 -5
- package/dist/nano-components/p-a5a560e7.entry.js.map +0 -1
- package/dist/nano-components/p-a761ac89.entry.js +0 -5
- package/dist/nano-components/p-a761ac89.entry.js.map +0 -1
- package/dist/nano-components/p-d792f692.entry.js +0 -5
- package/dist/nano-components/p-d792f692.entry.js.map +0 -1
- /package/dist/nano-components/{p-5381c118.js.map → p-158c73b0.entry.js.map} +0 -0
- /package/dist/nano-components/{p-906de5a2.entry.js.map → p-365c997a.js.map} +0 -0
@@ -0,0 +1,204 @@
|
|
1
|
+
import { Element, EventEmitter, ComponentInterface } from '../../stencil-public-runtime';
|
2
|
+
/**
|
3
|
+
* An accessible and flexible re-order / sort utility component.
|
4
|
+
*
|
5
|
+
*- Drag and drop via mouse, touch or keyboard
|
6
|
+
*- Live announcements for screen readers
|
7
|
+
*- Works with or without an explicit handle (although with is preferable)
|
8
|
+
|
9
|
+
* @part announcements - the a11y, live region. Visually hidden by default
|
10
|
+
*
|
11
|
+
* @slot - The default slot containing any items you might want to sort
|
12
|
+
*/
|
13
|
+
export declare class Sortable implements ComponentInterface {
|
14
|
+
/** A css query selector which matches a set of elements that should be sortable. e.g. `<li>` or `<tr>` */
|
15
|
+
itemSelector: string;
|
16
|
+
handleItemSelectorChange(): void;
|
17
|
+
/** A css query selector which matches an element *within* the `itemSelector` element
|
18
|
+
* which will act like a drag handle. **Note** For keyboard a11y it's recommended
|
19
|
+
* to use `handleSelector` when possible. Alternatively, the `createKeyboardHandle` prop will be used */
|
20
|
+
handleSelector?: string;
|
21
|
+
handleHandleSelectorChange(): void;
|
22
|
+
/** When dragging between grouped collections of items, it is possible to drag all sortable items from one group to another.
|
23
|
+
* At that point, you will not be able to drag items back to the original group.
|
24
|
+
* A `dropzoneSelector` allows you to define a placeholder area where items can always be dropped.
|
25
|
+
*/
|
26
|
+
dropzoneSelector?: string;
|
27
|
+
/** Accessibility helper text applied to handle controls */
|
28
|
+
helperText: string;
|
29
|
+
/**
|
30
|
+
* As a sortable element is interacted with, announcements are made to screen readers
|
31
|
+
* - informing the user what is changing.
|
32
|
+
* By default, the text from the element is extracted to describe the interacted with element.
|
33
|
+
* Use this function to provide a more meaningful, concise item descriptor
|
34
|
+
* @param el the element being interacted with
|
35
|
+
* @returns a string, describing the element being interacted with
|
36
|
+
*/
|
37
|
+
itemDescriptor: (el: Element) => string;
|
38
|
+
/**
|
39
|
+
* Used to generate a screen reader live update, informing the user of the current element being grabbed.
|
40
|
+
* @param el the element that has been grabbed by the user
|
41
|
+
* @returns a string, describing the element being grabbed
|
42
|
+
*/
|
43
|
+
grabbedHelperText: (el: Element) => string;
|
44
|
+
/**
|
45
|
+
* Used to generate a screen reader live update, informing the user of the current element being dropped.
|
46
|
+
* @param el the element that has been dropped by the user
|
47
|
+
* @returns a string, describing the element that has been dropped
|
48
|
+
*/
|
49
|
+
droppedHelperText: (el: Element) => string;
|
50
|
+
/**
|
51
|
+
* Used to generate a screen reader live update, informing the user when items have been reordered.
|
52
|
+
* @param el the element that has been reordered by the user
|
53
|
+
* @param elements the elements in the sortable list
|
54
|
+
* @param position the new position of the dropped element
|
55
|
+
* @returns a string, describing the element being dropped
|
56
|
+
*/
|
57
|
+
reorderHelperText: (el: Element, elements: Element[], position: number) => string;
|
58
|
+
/**
|
59
|
+
* A function that should attach a keyboard accessible control.
|
60
|
+
* When a `handleSelector` is not used - to allow keyboard accessibility -
|
61
|
+
* `createKeyboardHandle` should render a focusable element.
|
62
|
+
*
|
63
|
+
* If your sortable item is itself focusable,
|
64
|
+
* you must use this function to render a control *outside* of the focusable element.
|
65
|
+
* @param _number
|
66
|
+
* @param _element
|
67
|
+
* @returns a function that attaches a keyboard accessible handle control element.
|
68
|
+
* The function itself *must* return the handle element.
|
69
|
+
*/
|
70
|
+
createKeyboardHandle: (_number: number, _element: Element) => HTMLElement;
|
71
|
+
handleCreateKeyboardHandleChange(): void;
|
72
|
+
/** use `sortableHostElement` to watch a sortable list without needing to wrap in `nano-sortable`.
|
73
|
+
* Note that the `sortableHostElement` element css `position` will be set to `relative` */
|
74
|
+
sortableHostElement?: HTMLElement;
|
75
|
+
handleSortableHostElement(_newVal?: any, oldVal?: HTMLElement): void;
|
76
|
+
/** Items being sorted will animate into place */
|
77
|
+
animationEnabled: boolean;
|
78
|
+
/** Use this class to change how the element looks whilst being sorted */
|
79
|
+
draggedClass: string;
|
80
|
+
/** Use this class to change how the handle looks whilst being sorted */
|
81
|
+
handleDraggedClass: string;
|
82
|
+
/** Use this class to change how the element looks when acting as a placeholder */
|
83
|
+
placeholderClass: string;
|
84
|
+
/** Used in-conjunction with `dropzoneSelector`, applied when a dropzone is dragged over */
|
85
|
+
dropzoneActiveClass?: string;
|
86
|
+
/** The css animation timing applied when `animationEnabled` is `true` */
|
87
|
+
animationTiming: any;
|
88
|
+
/** The axis to lock dragging elements to. `undefined` means any axis */
|
89
|
+
orientation?: 'horizontal' | 'vertical';
|
90
|
+
/** Dragged items by default, will take whatever default css is applied in situ.
|
91
|
+
* When sortable items' dimensions are dynamic (i.e they can shrink / grow via the space allowed) dragging items can look 'wrong'.
|
92
|
+
* Apply `dragResize` to read & recreate the dragged items current dimensions when dragged. */
|
93
|
+
dragResize: boolean;
|
94
|
+
/** Fired when an the order changes. Use this to update any underlying data model.
|
95
|
+
* `event.preventDefault()` to prevent the element being moved; will revert to original position. */
|
96
|
+
nanoOrderChange: EventEmitter<{
|
97
|
+
element: HTMLElement;
|
98
|
+
originalIndex: number;
|
99
|
+
targetIndex: number;
|
100
|
+
}>;
|
101
|
+
/** Fired when a sortable element is picked-up; via keyboard, mouse or touch.
|
102
|
+
* `event.preventDefault()` to prevent the element being picked-up. */
|
103
|
+
nanoGrabbed: EventEmitter<{
|
104
|
+
element: HTMLElement;
|
105
|
+
index: number;
|
106
|
+
}>;
|
107
|
+
/** Fired when a sortable element is dropped after having been picked up. */
|
108
|
+
nanoDropped: EventEmitter<{
|
109
|
+
element: HTMLElement;
|
110
|
+
}>;
|
111
|
+
/** If sortable elements change dynamically, use this method to add handle controls to new elements */
|
112
|
+
refreshKeyboardHandles(): Promise<void>;
|
113
|
+
host: HTMLNanoSortableElement;
|
114
|
+
private dragRequestPending;
|
115
|
+
private draggedElement?;
|
116
|
+
private draggedElementClone?;
|
117
|
+
private draggedElementOrigin?;
|
118
|
+
private sortableNodes;
|
119
|
+
private dropzoneNodes;
|
120
|
+
private animatedElements;
|
121
|
+
private animationPromise?;
|
122
|
+
private keyboardHandleMap;
|
123
|
+
private sortableId;
|
124
|
+
private mouseDownTimer;
|
125
|
+
private mutationObserver;
|
126
|
+
keyboardSortActive: boolean;
|
127
|
+
ariaTextList: string[];
|
128
|
+
/**
|
129
|
+
* Get instance of sortable host.
|
130
|
+
* By default it is `nano-sortable` which can be overridden by property `sortableHostElement`
|
131
|
+
*/
|
132
|
+
get sortableHost(): HTMLElement;
|
133
|
+
/**
|
134
|
+
* Queues aria messages which are then displayed in a 'live' region.
|
135
|
+
* Messages are cleared after 10s
|
136
|
+
* @param msg aria message to announce
|
137
|
+
*/
|
138
|
+
private addAriaMsg;
|
139
|
+
/**
|
140
|
+
* Try to stop text highlight whilst dragging
|
141
|
+
* @param userSelect
|
142
|
+
*/
|
143
|
+
private updateUserSelectStyle;
|
144
|
+
/**
|
145
|
+
* Fast and simple hit test to check whether the center of a node intersects with the rectangle of any of the
|
146
|
+
* given targets. Returns an array of matches.
|
147
|
+
* @param node
|
148
|
+
* @param targets
|
149
|
+
* @returns all the items that currently intersect with the target node
|
150
|
+
*/
|
151
|
+
private hitTest;
|
152
|
+
/**
|
153
|
+
* Returns a boolean indicating whether the node is currently in an animation.
|
154
|
+
* @param node
|
155
|
+
* @returns whether a node is currently animating or not
|
156
|
+
*/
|
157
|
+
private isAnimating;
|
158
|
+
/**
|
159
|
+
* Triggers a CSS animation on a node with the given dx and dy. Used following dom updates to make it appear as
|
160
|
+
* if nodes animate from their old to their new position in the dom. */
|
161
|
+
private animateNode;
|
162
|
+
/**
|
163
|
+
* Inserts node at target to update sibling sorting. If the node precedes the target, it is inserted after it;
|
164
|
+
* If it follows the target, it is inserted before it. This ensures any node can be dragged from the very
|
165
|
+
* beginning to the very end and vice versa. The animateNode function is called for all nodes that moved because
|
166
|
+
* of this dom update */
|
167
|
+
private insertAtTarget;
|
168
|
+
private reset;
|
169
|
+
/**
|
170
|
+
* Clones a given node to visually drag around. The original node is left in the same flow as its siblings.
|
171
|
+
* Clone styles are added onto the style object directly, since the ::slotted()
|
172
|
+
* selector can't universally target nodes that may be nested an unknown amount of shadow dom levels deep
|
173
|
+
* @param node html node to clone
|
174
|
+
* @returns the cloned html node
|
175
|
+
*/
|
176
|
+
private createClone;
|
177
|
+
private removeEventHandlers;
|
178
|
+
private addEventHandlers;
|
179
|
+
/**
|
180
|
+
* Watch for any changes in grab-able handle elements.
|
181
|
+
*/
|
182
|
+
private attachMutationObserver;
|
183
|
+
private handleKeydown;
|
184
|
+
/**
|
185
|
+
* Tracks a pointer from touchstart/mousedown to touchend/mouseup. Note that the start state is fired following
|
186
|
+
* the first actual move event following a touchstart/mousedown */
|
187
|
+
private handleTrack;
|
188
|
+
/**
|
189
|
+
* Initialized a drag and drop sequence if a child node was clicked that matches the itemSelector property.
|
190
|
+
* OR If a handleSelector is defined, a node matching this selector must be clicked instead
|
191
|
+
* @returns boolean - whether tracking for this event should continue or not
|
192
|
+
*/
|
193
|
+
private trackStart;
|
194
|
+
/** Ends re-ordering */
|
195
|
+
private finishOrder;
|
196
|
+
/**
|
197
|
+
* Moves the active node's clone to follow the pointer. The node that the clone intersects with (via hitTest) is
|
198
|
+
* the insert point for updated sorting */
|
199
|
+
private trackMove;
|
200
|
+
constructor();
|
201
|
+
connectedCallback(): void;
|
202
|
+
disconnectedCallback(): void;
|
203
|
+
render(): any;
|
204
|
+
}
|
@@ -125,9 +125,9 @@ export declare namespace TableTypes {
|
|
125
125
|
*/
|
126
126
|
interface ColumnConfig<T = RowData> {
|
127
127
|
/** The title of the column. Displayed in the table header `th` */
|
128
|
-
title
|
128
|
+
title?: string;
|
129
129
|
/** The row's data property to retrieve per cell render */
|
130
|
-
prop
|
130
|
+
prop?: keyof T;
|
131
131
|
/** The type of data. Will affect how it is sorted and the available
|
132
132
|
* filter operations ('text' uses browser locale to compare).
|
133
133
|
* If none supplied, it will be derived by default using the first row of data retrieved. */
|
@@ -152,8 +152,6 @@ export declare namespace TableTypes {
|
|
152
152
|
searchable?: boolean;
|
153
153
|
/** Current filters applied to this column */
|
154
154
|
filter?: string | boolean;
|
155
|
-
/** Whether this column can be dragged to change column order */
|
156
|
-
draggable?: boolean;
|
157
155
|
/**
|
158
156
|
* A cell render function, called during any cell's render to the dom.
|
159
157
|
* It can be used to add any markup within a table cell.
|
@@ -8,7 +8,6 @@ import { TableTypes } from '../../interface';
|
|
8
8
|
*- Built-in column sort
|
9
9
|
*- Easily swap in API / async based search / filter & sort
|
10
10
|
*- Pin headers, footers, rows, columns
|
11
|
-
*- Drag-&-Drop columns to re-order
|
12
11
|
*- Add custom rendering at every level
|
13
12
|
*- Add custom properties at every level
|
14
13
|
*
|
@@ -78,12 +77,6 @@ export declare class Table implements ComponentInterface {
|
|
78
77
|
* `false` will disable column sorting unless you set `sortable: true` on a column
|
79
78
|
*/
|
80
79
|
defaultSort: boolean;
|
81
|
-
/**
|
82
|
-
* The default draggable option for all columns.
|
83
|
-
* `true` will enable column drag-to-reorder unless you set `draggable: false` on a column
|
84
|
-
* `false` will disable column drag-to-reorder unless you set `draggable: true` on a column
|
85
|
-
*/
|
86
|
-
defaultColDraggable: boolean;
|
87
80
|
handleSearchTermChange(): void;
|
88
81
|
/** Use this to render the table with roughly the correct dimensions.
|
89
82
|
* a use-case might be; fetch a small initial dataset to minimise load-time,
|
@@ -112,18 +105,6 @@ export declare class Table implements ComponentInterface {
|
|
112
105
|
column: TableTypes.Prop;
|
113
106
|
order: TableTypes.Order;
|
114
107
|
}>;
|
115
|
-
/** Fired when a column has started dragging */
|
116
|
-
nanoTblColDrag: EventEmitter<{
|
117
|
-
column: TableTypes.Prop;
|
118
|
-
}>;
|
119
|
-
/** Fired when a column has been dropped (after dragging)
|
120
|
-
* `event.preventDefault()` to stop column re-order. */
|
121
|
-
nanoTblColDrop: EventEmitter<{
|
122
|
-
fromCol: TableTypes.Prop;
|
123
|
-
toCol: TableTypes.Prop;
|
124
|
-
fromIndex: number;
|
125
|
-
toIndex: number;
|
126
|
-
}>;
|
127
108
|
/** Fired before a column is filtered.
|
128
109
|
* `event.preventDefault()` to stop filtering. */
|
129
110
|
nanoTblBeforeFilter: EventEmitter<{
|
@@ -204,17 +185,6 @@ export declare class Table implements ComponentInterface {
|
|
204
185
|
private set isReady(value);
|
205
186
|
private _isReady;
|
206
187
|
private handleReady;
|
207
|
-
/**
|
208
|
-
* Fired when a column is dragged
|
209
|
-
* @param column
|
210
|
-
*/
|
211
|
-
private colDrag;
|
212
|
-
/**
|
213
|
-
* Fired when a column is dropped after being dragged
|
214
|
-
* @param fromCol
|
215
|
-
* @param toCol
|
216
|
-
*/
|
217
|
-
private colDrop;
|
218
188
|
/**
|
219
189
|
* Start a sort - can be cancelled by `preventDefault`
|
220
190
|
* @param order - column order
|
@@ -257,6 +227,11 @@ export declare class Table implements ComponentInterface {
|
|
257
227
|
private getBlockHeight;
|
258
228
|
/** cache the height for all active blocks for later renders */
|
259
229
|
private setBlockHeight;
|
230
|
+
/**
|
231
|
+
* On scroll, loop through all blocks' heights and cumulatively, add them together.
|
232
|
+
* When we find that the scroll position is less than this cumulative block height -
|
233
|
+
* stop loop - it's on the current active block.
|
234
|
+
*/
|
260
235
|
private scrollHandler;
|
261
236
|
/** Process slotted content */
|
262
237
|
private processSlots;
|
@@ -5,10 +5,7 @@ type TableColHeadProps = {
|
|
5
5
|
headRenderer: TableTypes.HeadFootRenderer;
|
6
6
|
onColumnSortClick?: (order: TableTypes.Order, column: TableTypes.Prop, el: HTMLTableCellElement) => void;
|
7
7
|
onColumnPinned?: TableTypes.PinnedCb;
|
8
|
-
onColumnDrag?: (column: TableTypes.Prop, el: HTMLTableCellElement) => void;
|
9
|
-
onColumnDrop?: (fromColumn: TableTypes.Prop, toColumn: TableTypes.Prop, el: HTMLTableCellElement) => void;
|
10
8
|
defaults: {
|
11
|
-
draggable?: boolean;
|
12
9
|
sortable?: boolean;
|
13
10
|
};
|
14
11
|
};
|
@@ -1,6 +1,12 @@
|
|
1
1
|
import { ComponentInterface, EventEmitter } from '../../stencil-public-runtime';
|
2
2
|
/**
|
3
|
+
* @slot start - start of the tab, content. Outside of the focusable element
|
4
|
+
* @slot end - end of the tab, content. Outside of the focusable element
|
3
5
|
* @slot - The tab's label.
|
6
|
+
*
|
7
|
+
* @part base - the wrapper around the whole control
|
8
|
+
* @part tab - the main tab control that controls the active state
|
9
|
+
* @part close-btn - the close button of the tab (if `closable=true`)
|
4
10
|
*/
|
5
11
|
export declare class Tab implements ComponentInterface {
|
6
12
|
private tabId;
|