@nextcloud/dialogs
Advanced tools
Comparing version 2.0.1 to 3.0.0
@@ -5,2 +5,6 @@ # Changelog | ||
## 2.0.1 - 2020-08-27 | ||
### Fixed | ||
- Fix timeout of showUndo to 10 seconds | ||
## 2.0.0 - 2020-08-17 | ||
@@ -10,2 +14,3 @@ ### Added | ||
### Changed | ||
- Timeout value for permanent must be -1 now instead of 0 | ||
- Build process with rollup | ||
@@ -50,2 +55,1 @@ - Dependency updates | ||
- Toasts | ||
export { FilePicker, FilePickerBuilder, getFilePickerBuilder } from './filepicker'; | ||
export { TOAST_UNDO_TIMEOUT, TOAST_DEFAULT_TIMEOUT, TOAST_PERMANENT_TIMEOUT } from './toast'; | ||
export { showMessage, showSuccess, showWarning, showInfo, showError, showUndo } from './toast'; |
@@ -30,5 +30,8 @@ /** | ||
} | ||
export declare const TOAST_UNDO_TIMEOUT = 10000; | ||
export declare const TOAST_DEFAULT_TIMEOUT = 7000; | ||
export declare const TOAST_PERMANENT_TIMEOUT = -1; | ||
export interface ToastOptions { | ||
/** | ||
* Defines the timeout after which the toast is closed. Set to -1 to have a persistent toast. | ||
* Defines the timeout in milliseconds after which the toast is closed. Set to -1 to have a persistent toast. | ||
*/ | ||
@@ -35,0 +38,0 @@ timeout?: number; |
/// <reference types="@nextcloud/typings" /> | ||
declare const OC: Nextcloud.v16.OC | Nextcloud.v17.OC | Nextcloud.v18.OC | Nextcloud.v19.OC; | ||
declare const OC: Nextcloud.v16.OC | Nextcloud.v17.OC | Nextcloud.v18.OC | Nextcloud.v19.OC | Nextcloud.v20.OC; | ||
@@ -5,0 +5,0 @@ export enum FilePickerType { |
export { FilePicker, FilePickerBuilder, getFilePickerBuilder } from './filepicker' | ||
export { TOAST_UNDO_TIMEOUT, TOAST_DEFAULT_TIMEOUT, TOAST_PERMANENT_TIMEOUT } from './toast' | ||
export { showMessage, showSuccess, showWarning, showInfo, showError, showUndo } from './toast' |
@@ -35,5 +35,9 @@ /** | ||
export const TOAST_UNDO_TIMEOUT = 10000 | ||
export const TOAST_DEFAULT_TIMEOUT = 7000 | ||
export const TOAST_PERMANENT_TIMEOUT = -1 | ||
export interface ToastOptions { | ||
/** | ||
* Defines the timeout after which the toast is closed. Set to -1 to have a persistent toast. | ||
* Defines the timeout in milliseconds after which the toast is closed. Set to -1 to have a persistent toast. | ||
*/ | ||
@@ -82,3 +86,3 @@ timeout?: number | ||
options = Object.assign({ | ||
timeout: 7, | ||
timeout: TOAST_DEFAULT_TIMEOUT, | ||
isHTML: false, | ||
@@ -107,10 +111,5 @@ type: undefined, | ||
let timeout = null | ||
if (options.timeout) { | ||
timeout = options.timeout === -1 ? -1 : options.timeout * 1000 | ||
} | ||
const toast = Toastify({ | ||
[!isNode ? 'text' : 'node']: data, | ||
duration: timeout, | ||
duration: options.timeout, | ||
callback: options.onRemove, | ||
@@ -186,3 +185,3 @@ onClick: options.onClick, | ||
// force 10 seconds of timeout | ||
timeout: 10000, | ||
timeout: TOAST_UNDO_TIMEOUT, | ||
// remove close button | ||
@@ -189,0 +188,0 @@ close: false |
{ | ||
"name": "@nextcloud/dialogs", | ||
"version": "2.0.1", | ||
"version": "3.0.0", | ||
"description": "", | ||
@@ -29,3 +29,3 @@ "main": "dist/index.js", | ||
"@nextcloud/l10n": "^1.3.0", | ||
"@nextcloud/typings": "^0.2.2", | ||
"@nextcloud/typings": "^1.0.0", | ||
"core-js": "^3.6.4", | ||
@@ -51,3 +51,3 @@ "toastify-js": "^1.9.1" | ||
"tslib": "^2.0.1", | ||
"typedoc": "^0.18.0", | ||
"typedoc": "^0.19.0", | ||
"typescript": "^4.0.2" | ||
@@ -54,0 +54,0 @@ }, |
@@ -20,3 +20,3 @@ # @nextcloud/dialogs | ||
Make sure that the `@nextcloud/dialogs/styles/toast` file is included in your app to make sure that the toasts have a proper styling applied. | ||
Make sure that the `@nextcloud/dialogs/styles/toast.scss` file is included in your app to make sure that the toasts have a proper styling applied. | ||
@@ -23,0 +23,0 @@ There are different toast styles available, that are exposed in separate functions: |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1316130
56
12844
+ Added@nextcloud/typings@1.9.1(transitive)
+ Added@types/jquery@3.5.16(transitive)
+ Added@types/sizzle@2.3.9(transitive)
- Removed@nextcloud/typings@0.2.4(transitive)
- Removed@types/jquery@2.0.54(transitive)
Updated@nextcloud/typings@^1.0.0