diff --git a/README.md b/README.md index 81b30f6698dfb74012c97f3c1fd079bd6d554221..f813be409b5d1b97060bf7f323ddfecb4179ee51 100644 --- a/README.md +++ b/README.md @@ -29,14 +29,15 @@ the version number in its `package.json` is higher than the version number on np ## Reserved attributes -| Attribute | Description | -| ------------------------ | ------------------------------------------------------------------- | -| `subscribe` | Used in all components to subscribe to attributes set by a provider | -| `unsubscribe` | Reserved for future use | -| `auth` | Authentication information, set by the authentication component | -| `lang` | Currently selected language, set by the language selector | -| `entry-point-url` | Entry point url for all api requests | -| `requested-login-status` | Used by the login buttons to trigger a login in auth components | +| Attribute | Description | +| ----------------------------- | --------------------------------------------------------------------------------- | +| `subscribe` | Used in all components to subscribe to attributes set by a provider | +| `unsubscribe` | Reserved for future use | +| `auth` | Authentication information, set by the authentication component | +| `lang` | Currently selected language, set by the language selector | +| `entry-point-url` | Entry point url for all api requests | +| `requested-login-status` | Used by the login buttons to trigger a login in auth components | +| `initial-file-handling-state` | Used by the file-handling component to sync file source/sink at first time open | ## Reserved events diff --git a/packages/file-handling/README.md b/packages/file-handling/README.md index cbf852612cc1c53ec2100d2f844c0bdf6ef654e5..2cc9224bc597dc921371db8326eda3aa102f5b53 100644 --- a/packages/file-handling/README.md +++ b/packages/file-handling/README.md @@ -79,6 +79,10 @@ files from a [Nextcloud](https://nextcloud.com/) instance. - example `<dbp-file-source text="Please select some files"></dbp-file-source>` - `button-label` (optional): the text that is shown on the button to select files - example `<dbp-file-source button-label="Select files"></dbp-file-source>` +- `initial-file-handling-state` (optional): An object: `initial-file-handling-state' = {target: "", path: ""}` for initial opening behaviour. + This is supported by the provider! Use this object to sync file source and file sink on one page at first time open. + - example `<dbp-file-source initial-file-handling-state="{target: 'local', path:'nextcloudpath'}"></dbp-file-source>` + - example provider `<dbp-file-source subscribe="initial-file-handling-state:initial-file-handling-state"></dbp-file-source>` ### Outgoing Events @@ -120,6 +124,11 @@ files to a [Nextcloud](https://nextcloud.com/) instance. - example `<dbp-file-sink text="Download files as ZIP-file"></dbp-file-sink>` - `button-label` (optional): the text that is shown on the button to download the zip file - example `<dbp-file-sink button-label="Download files"></dbp-file-sink>` +- `initial-file-handling-state` (optional): An object: `initial-file-handling-state' = {target: "", path: ""}` for initial opening behaviour. + This is supported by the provider! Use this object to sync file source and file sink on one page at first time open. + - example `<dbp-file-source initial-file-handling-state="{target: 'local', path:'nextcloudpath'}"></dbp-file-source>` + - example provider `<dbp-file-source subscribe="initial-file-handling-state:initial-file-handling-state"></dbp-file-source>` + ### Properties diff --git a/packages/file-handling/src/file-sink.js b/packages/file-handling/src/file-sink.js index d0b8bdf02c089df41cba8dac1f7601a5c88485d8..af96a92f843420b995fe41a4dd9aedef63cef430 100644 --- a/packages/file-handling/src/file-sink.js +++ b/packages/file-handling/src/file-sink.js @@ -178,8 +178,6 @@ export class FileSink extends ScopedElementsMixin(DBPLitElement) { data = {"target": this.activeTarget}; } this.sendSetPropertyEvent('initial-file-handling-state', data); - //const event = new CustomEvent("dbp-file-sink-switched", { "detail": data, bubbles: true, composed: true }); - //this.dispatchEvent(event); } diff --git a/packages/file-handling/src/file-source.js b/packages/file-handling/src/file-source.js index 6fda9a3f715a3d39bda09b7c4f7dca74dd943d65..63e6e2289078906589b0d1e70c74d41ad9862e86 100644 --- a/packages/file-handling/src/file-source.js +++ b/packages/file-handling/src/file-source.js @@ -241,8 +241,6 @@ export class FileSource extends ScopedElementsMixin(DBPLitElement) { } this.sendSetPropertyEvent('initial-file-handling-state', data); - //const event = new CustomEvent("initial-file-handling-state", { "detail": data, bubbles: true, composed: true }); - //this.dispatchEvent(event); } checkFileType(file) {