From ee6cb7424ab0b0b3d08bdd51aaf18f9b9dac0026 Mon Sep 17 00:00:00 2001 From: Yusuf Kandemir Date: Mon, 24 Jul 2023 16:44:46 +0300 Subject: [PATCH] fix(ui): list actions in quasarConfOptions for Notify (#16102) --- ui/build/build.api.js | 2 +- ui/src/plugins/Notify.json | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/ui/build/build.api.js b/ui/build/build.api.js index e0869fa2b63..0f2e897a4ed 100644 --- a/ui/build/build.api.js +++ b/ui/build/build.api.js @@ -176,7 +176,7 @@ function isClassStyleType (type) { return hits === 3 } -const serializableTypes = [ 'Boolean', 'Number', 'String', 'Array', 'Object' ] +const serializableTypes = [ 'Any', 'Boolean', 'Number', 'String', 'Array', 'Object' ] function isSerializable (value) { const types = Array.isArray(value.type) ? value.type : [ value.type ] diff --git a/ui/src/plugins/Notify.json b/ui/src/plugins/Notify.json index 36312b31e70..7ca66a1e3c2 100644 --- a/ui/src/plugins/Notify.json +++ b/ui/src/plugins/Notify.json @@ -169,6 +169,26 @@ "default": 5000 }, + "actions": { + "type": "Array", + "tsType": "QNotifyAction", + "desc": "Notification actions (buttons); Unless 'noDismiss' is true, clicking/tapping on the button will close the notification; Also check 'closeBtn' convenience prop", + "definition": { + "noDismiss": { + "type": "Boolean", + "desc": "Do not dismiss the notification when the button is clicked/tapped" + }, + "...": { + "type": "Any", + "desc": "Any other QBtn prop expect 'onClick' (use 'handler' instead)", + "examples": [ "label: 'Learn more'", "color: 'primary'" ] + } + }, + "examples": [ + "[ { label: 'Show', handler: () => {}, 'aria-label': 'Button label' }, { icon: 'map', handler: () => {}, color: 'yellow' }, { label: 'Learn more', noDismiss: true, handler: () => {} } ]" + ] + }, + "closeBtn": { "type": [ "Boolean", "String" ], "desc": "Convenient way to add a dismiss button with a specific label, without using the 'actions' prop; If set to true, it uses a label according to the current Quasar language",