Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dnn-elements and resolve file upload modal close refresh #141

Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"license": "MIT",
"devDependencies": {
"@dnncommunity/dnn-elements": "^0.15.0-beta.21",
"@dnncommunity/dnn-elements": "^0.15.0",
"@stencil/sass": "^1.5.2",
"@stencil/store": "^1.5.0"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,46 @@ export namespace Components {
interface DnnRmUploadFile {
}
}
export interface DnnActionUploadFileCustomEvent<T> extends CustomEvent<T> {
detail: T;
target: HTMLDnnActionUploadFileElement;
}
export interface DnnRmCreateFolderCustomEvent<T> extends CustomEvent<T> {
detail: T;
target: HTMLDnnRmCreateFolderElement;
}
export interface DnnRmDeleteItemsCustomEvent<T> extends CustomEvent<T> {
detail: T;
target: HTMLDnnRmDeleteItemsElement;
}
export interface DnnRmEditFileCustomEvent<T> extends CustomEvent<T> {
detail: T;
target: HTMLDnnRmEditFileElement;
}
export interface DnnRmEditFolderCustomEvent<T> extends CustomEvent<T> {
detail: T;
target: HTMLDnnRmEditFolderElement;
}
export interface DnnRmFolderListCustomEvent<T> extends CustomEvent<T> {
detail: T;
target: HTMLDnnRmFolderListElement;
}
export interface DnnRmFolderListItemCustomEvent<T> extends CustomEvent<T> {
detail: T;
target: HTMLDnnRmFolderListItemElement;
}
export interface DnnRmMoveItemsCustomEvent<T> extends CustomEvent<T> {
detail: T;
target: HTMLDnnRmMoveItemsElement;
}
export interface DnnRmUnlinkItemsCustomEvent<T> extends CustomEvent<T> {
detail: T;
target: HTMLDnnRmUnlinkItemsElement;
}
export interface DnnRmUploadFileCustomEvent<T> extends CustomEvent<T> {
detail: T;
target: HTMLDnnRmUploadFileElement;
}
declare global {
interface HTMLDnnActionCopyUrlElement extends Components.DnnActionCopyUrl, HTMLStencilElement {
}
Expand Down Expand Up @@ -398,6 +438,10 @@ declare namespace LocalJSX {
"items": Item[];
}
interface DnnActionUploadFile {
/**
* Fires when there is a possibility that some folders have changed. Can be used to force parts of the UI to refresh.
*/
"onDnnRmFoldersChanged"?: (event: DnnActionUploadFileCustomEvent<void>) => void;
"parentFolderId"?: number;
}
interface DnnResourceManager {
Expand All @@ -412,7 +456,7 @@ declare namespace LocalJSX {
/**
* Fires when there is a possibility that some folders have changed. Can be used to force parts of the UI to refresh.
*/
"onDnnRmFoldersChanged"?: (event: CustomEvent<void>) => void;
"onDnnRmFoldersChanged"?: (event: DnnRmCreateFolderCustomEvent<void>) => void;
}
interface DnnRmDeleteItems {
/**
Expand All @@ -422,7 +466,7 @@ declare namespace LocalJSX {
/**
* Fires when there is a possibility that some folders have changed. Can be used to force parts of the UI to refresh.
*/
"onDnnRmFoldersChanged"?: (event: CustomEvent<void>) => void;
"onDnnRmFoldersChanged"?: (event: DnnRmDeleteItemsCustomEvent<void>) => void;
}
interface DnnRmEditFile {
/**
Expand All @@ -432,7 +476,7 @@ declare namespace LocalJSX {
/**
* Fires when there is a possibility that some folders have changed. Can be used to force parts of the UI to refresh.
*/
"onDnnRmFoldersChanged"?: (event: CustomEvent<void>) => void;
"onDnnRmFoldersChanged"?: (event: DnnRmEditFileCustomEvent<void>) => void;
}
interface DnnRmEditFolder {
/**
Expand All @@ -442,7 +486,7 @@ declare namespace LocalJSX {
/**
* Fires when there is a possibility that some folders have changed. Can be used to force parts of the UI to refresh.
*/
"onDnnRmFoldersChanged"?: (event: CustomEvent<void>) => void;
"onDnnRmFoldersChanged"?: (event: DnnRmEditFolderCustomEvent<void>) => void;
}
interface DnnRmFileContextMenu {
/**
Expand All @@ -466,7 +510,7 @@ declare namespace LocalJSX {
/**
* Fires when a folder is picked.
*/
"onDnnRmFolderListFolderPicked"?: (event: CustomEvent<FolderTreeItem>) => void;
"onDnnRmFolderListFolderPicked"?: (event: DnnRmFolderListCustomEvent<FolderTreeItem>) => void;
}
interface DnnRmFolderListItem {
/**
Expand All @@ -480,11 +524,11 @@ declare namespace LocalJSX {
/**
* Fires when a folder is clicked.
*/
"onDnnRmFolderListItemClicked"?: (event: CustomEvent<FolderTreeItem>) => void;
"onDnnRmFolderListItemClicked"?: (event: DnnRmFolderListItemCustomEvent<FolderTreeItem>) => void;
/**
* Fires when a context menu is opened for this item. Emits the folder ID.
*/
"onDnnRmcontextMenuOpened"?: (event: CustomEvent<number>) => void;
"onDnnRmcontextMenuOpened"?: (event: DnnRmFolderListItemCustomEvent<number>) => void;
/**
* The ID of the parent folder.
*/
Expand Down Expand Up @@ -516,7 +560,7 @@ declare namespace LocalJSX {
/**
* Fires when there is a possibility that some folders have changed. Can be used to force parts of the UI to refresh.
*/
"onDnnRmFoldersChanged"?: (event: CustomEvent<void>) => void;
"onDnnRmFoldersChanged"?: (event: DnnRmMoveItemsCustomEvent<void>) => void;
}
interface DnnRmProgressBar {
/**
Expand Down Expand Up @@ -560,13 +604,13 @@ declare namespace LocalJSX {
/**
* Fires when there is a possibility that some folders have changed. Can be used to force parts of the UI to refresh.
*/
"onDnnRmFoldersChanged"?: (event: CustomEvent<void>) => void;
"onDnnRmFoldersChanged"?: (event: DnnRmUnlinkItemsCustomEvent<void>) => void;
}
interface DnnRmUploadFile {
/**
* Fires when there is a possibility that some folders have changed. Can be used to force parts of the UI to refresh.
*/
"onDnnRmFoldersChanged"?: (event: CustomEvent<void>) => void;
"onDnnRmFoldersChanged"?: (event: DnnRmUploadFileCustomEvent<void>) => void;
}
interface IntrinsicElements {
"dnn-action-copy-url": DnnActionCopyUrl;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, Host, h, Prop } from '@stencil/core';
import { Component, Host, h, Event, EventEmitter, Prop } from '@stencil/core';
import state from "../../../store/store";

@Component({
Expand All @@ -10,7 +10,13 @@ export class DnnActionUploadFile {

@Prop() parentFolderId: number;

private handleClick(): void {
/**
* Fires when there is a possibility that some folders have changed.
* Can be used to force parts of the UI to refresh.
*/
@Event() dnnRmFoldersChanged: EventEmitter<void>;

private handleClick(): void {
this.showModal();
}

Expand All @@ -26,6 +32,9 @@ export class DnnActionUploadFile {
modal.appendChild(container);
document.body.appendChild(modal);
modal.show();
modal.addEventListener('dismissed', () => {
this.dnnRmFoldersChanged.emit();
});
}

render() {
Expand Down
Loading