Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"default": "./dist/utils/*.js"
},
"./styles/ember-drag-sort.css": "./dist/styles/ember-drag-sort.css",
"./dist/_app_/*": "./dist/_app_/*.js"
"./_app_/*": "./dist/_app_/*"
},
"files": [
"addon-main.cjs",
Expand Down
2 changes: 1 addition & 1 deletion rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default {
!process.env.SKIP_DECLARATIONS &&
addon.declarations(
'declarations',
`pnpm tsc --declaration --project ${tsConfig}`,
`pnpm ember-tsc --declaration --project ${tsConfig}`,
),

// addons are allowed to contain imports of .css files, which we want rollup
Expand Down
9 changes: 7 additions & 2 deletions src/components/drag-sort-item.gts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ function getComputedStyleInt(element: HTMLElement, cssProp: string) {
}

interface DragSortItemSignature<Item extends object> {
Element: HTMLElement;
Args: {
additionalArgs?: object;
determineForeignPositionAction?: unknown;
Expand All @@ -27,14 +28,18 @@ interface DragSortItemSignature<Item extends object> {
element: HTMLElement;
draggedItem: Item;
}) => void;
group: string;
group?: string;
handle?: string;
index: number;
isHorizontal: boolean;
isHorizontal?: boolean;
isRtl?: boolean;
item: Item;
items: Array<Item>;
sourceOnly: boolean;
tagName?: string;
};
Blocks: {
default: [];
};
}

Expand Down
7 changes: 6 additions & 1 deletion src/components/drag-sort-list.gts
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,18 @@ interface DragSortListSignature<Item extends object> {
}) => number;
draggingEnabled?: boolean;
dragEndAction?: unknown;
dragStartAction?: unknown;
dragStartAction?: (args: {
event: DragEvent;
element: HTMLElement;
draggedItem: Item;
}) => void;
handle?: string;
items: Array<Item>;
isHorizontal?: boolean;
isRtl?: boolean;
group?: string;
sourceOnly?: boolean;
tagName?: string;
};
Blocks: {
default: [item: Item, index: number];
Expand Down
1 change: 0 additions & 1 deletion src/index.js → src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Public API
export { default as DragSortList } from './components/drag-sort-list.gts';
export { default as DragSortItem } from './components/drag-sort-item.gts';
export { default as DragSortService } from './services/drag-sort.ts';
4 changes: 2 additions & 2 deletions src/services/drag-sort.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ export default class DragSort<Item extends object> extends Service {
item: Item;
index: number;
items: Array<Item>;
group: string;
isHorizontal: boolean;
group?: string;
isHorizontal?: boolean;
}) {
setProperties(this, {
isDragging: true,
Expand Down
Loading