diff --git a/README.md b/README.md index 35ea6e8..f16e684 100644 --- a/README.md +++ b/README.md @@ -26,8 +26,9 @@ This module will help you to work with modal dialogs in your project [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fyariksav%2Fvuetify-dialog.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fyariksav%2Fvuetify-dialog?ref=badge_large) -## Documentation -======= +## Vuedl module documentation + +This module uses vuedl for automatically work with dialogs and DOM [See docs here](https://github.com/yariksav/vuedl#readme) ## Setup @@ -260,8 +261,8 @@ Props: { ... actions: { - 'false': 'No', - 'true': 'Yes' + false: 'No', + true: 'Yes' } } // result will be true, false, or undefigned diff --git a/package.json b/package.json index 5e753ea..2d30abd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vuetify-dialog", - "version": "2.0.8", + "version": "2.0.9", "description": "Dialog helper for vuetify.js", "scripts": { "build": "npm run build:umd & npm run build:es & npm run build:unpkg", @@ -69,7 +69,7 @@ "vue-asyncable": "^0.2.0", "vue-jest": "^3.0.4", "vue-template-compiler": "^2.5.22", - "vuedl": "^0.3.9", + "vuedl": "^0.3.10", "vuetify": "^2.3.4" }, "jest": { diff --git a/src/components/Alert.vue b/src/components/Alert.vue index 31a3116..1807280 100644 --- a/src/components/Alert.vue +++ b/src/components/Alert.vue @@ -49,22 +49,10 @@ export default { type: Boolean, default: true }, - flat: { - type: Boolean, - default: false - }, - border: { - type: String, - default: undefined - }, - tile: { - type: Boolean, - default: false - }, - dense: { - type: Boolean, - default: false - }, + flat: Boolean, + border: String, + tile: Boolean, + dense: Boolean } } diff --git a/src/components/DialogCard.vue b/src/components/DialogCard.vue index 8adc82b..e3a96ed 100644 --- a/src/components/DialogCard.vue +++ b/src/components/DialogCard.vue @@ -19,8 +19,9 @@ ref="actions" :actions="actions" v-bind="actionOptions" - :handle="handle" + :handler="handler || handle" /> + @@ -50,7 +51,13 @@ export default { flat: true }) }, - handle: Function + handle: Function, // todo: remove this parameter in next version + handler: Function + }, + created () { + if (this.handle) { + console.warn('DEPRECATED: "handle" prop will be deprecated, please use "handler" instead') + } }, methods: { trigger (name) { diff --git a/src/components/Prompt.vue b/src/components/Prompt.vue index 693b5ed..946dcf0 100644 --- a/src/components/Prompt.vue +++ b/src/components/Prompt.vue @@ -3,7 +3,7 @@ @@ -58,7 +58,7 @@ export default { onEnter () { this.$refs.card.$refs.actions.trigger(true) }, - handleClick (res, action) { + handlerClick (res, action) { if (!action.key) { this.$emit('submit', action.key) } diff --git a/src/components/SnackbarLayout.vue b/src/components/SnackbarLayout.vue index 2174ba1..74c946b 100644 --- a/src/components/SnackbarLayout.vue +++ b/src/components/SnackbarLayout.vue @@ -5,7 +5,6 @@ :color="getColor" v-model="isActive" class="application" - :text="false" :top="top" :left="left" :right="right" @@ -13,6 +12,11 @@ :multi-line="multiLine" :vertical="vertical" :elevation="elevation" + :text="flat" + :centered="centered" + :rounded="rounded" + :outlined="outlined" + :shaped="shaped" @click="dismiss" > `; -exports[`manager Check confirm with handle functions 1`] = ` +exports[`manager Check confirm with handler functions 1`] = `
diff --git a/test/__snapshots__/prompt.spec.js.snap b/test/__snapshots__/prompt.spec.js.snap index 5da8a4c..a29042b 100644 --- a/test/__snapshots__/prompt.spec.js.snap +++ b/test/__snapshots__/prompt.spec.js.snap @@ -137,6 +137,7 @@ exports[`manager Prompt confirm 2`] = `
+ @@ -249,6 +250,7 @@ exports[`manager Prompt confirm 2`] = ` + @@ -394,6 +396,7 @@ exports[`manager Test default prompt 2`] = ` + diff --git a/test/confirm.spec.js b/test/confirm.spec.js index dc82b18..56c5a5c 100644 --- a/test/confirm.spec.js +++ b/test/confirm.spec.js @@ -115,7 +115,7 @@ describe('manager', () => { expect(document.body.innerHTML).toBe('') }) - test('Check confirm with handle functions', async () => { + test('Check confirm with handler functions', async () => { const dlg = await manager.confirm({ text: 'test', actions: { @@ -123,7 +123,7 @@ describe('manager', () => { true: { text: 'Yes', class: 'action-true', - handle: () => { + handler: () => { return new Promise((resolve) => { setTimeout(() => resolve({ msg: 'foo' }), 5) }) diff --git a/types/index.d.ts b/types/index.d.ts index fd52843..ac998b4 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -23,11 +23,13 @@ export interface DialogAction { rounded? : boolean disabled?: boolean handle? (action: any): Promise + handler? (action: any): Promise } interface DialogActionable { actions?: object | Array | Array handle? (action: any): Promise + handler? (action: any): Promise } export interface DialogObject { @@ -43,6 +45,14 @@ export interface DialogMessageOptions extends DialogActionable { position?: string timeout?: number type?: string + outlined?: boolean + prominent?: boolean + dismissible?: boolean + flat?: boolean + centered?: boolean + border?: string + tile?: boolean + dense?: boolean } export interface DialogNotifyOptions extends DialogActionable { @@ -54,6 +64,10 @@ export interface DialogNotifyOptions extends DialogActionable { verticalOffset?: number width?: number zIndex?: number + flat?: boolean + rounded?: boolean + outlined?: boolean + shaped?: boolean } export interface DialogConfirmOptions extends DialogActionable {