frappe-ui 1.0.0-beta.39 → 1.0.0-beta.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/frappe/DataImport/DataImportList.vue +9 -11
- package/frappe/DataImport/TemplateModal.vue +2 -5
- package/frappe/Onboarding/IntermediateStepModal.vue +2 -5
- package/frappe/drive/components/InfoDialog.vue +2 -2
- package/frappe/drive/components/MoveDialog.vue +2 -2
- package/frappe/drive/components/RenameDialog.vue +11 -13
- package/frappe/drive/components/ShareDialog.vue +2 -2
- package/package.json +1 -1
- package/src/components/Calendar/NewEventModal.vue +2 -10
- package/src/components/Checkbox/Checkbox.api.md +0 -8
- package/src/components/Checkbox/Checkbox.cy.ts +26 -16
- package/src/components/Checkbox/Checkbox.vue +2 -22
- package/src/components/Checkbox/types.ts +0 -6
- package/src/components/Combobox/stories/InDialog.vue +2 -2
- package/src/components/CommandPalette/CommandPalette.vue +4 -2
- package/src/components/ContextMenu/ContextMenu.cy.ts +61 -0
- package/src/components/ContextMenu/index.ts +19 -1
- package/src/components/ContextMenu/types.ts +0 -1
- package/src/components/Dialog/Dialog.api.md +4 -46
- package/src/components/Dialog/Dialog.cy.ts +130 -75
- package/src/components/Dialog/Dialog.vue +58 -162
- package/src/components/Dialog/index.ts +1 -3
- package/src/components/Dialog/types.ts +1 -44
- package/src/components/Dialogs.vue +4 -15
- package/src/components/Dropdown/Dropdown.api.md +2 -8
- package/src/components/Dropdown/Dropdown.cy.ts +139 -10
- package/src/components/Dropdown/Dropdown.md +1 -1
- package/src/components/Dropdown/Dropdown.vue +13 -8
- package/src/components/Dropdown/index.ts +22 -1
- package/src/components/Dropdown/types.ts +0 -13
- package/src/components/Duration/Duration.cy.ts +29 -0
- package/src/components/Duration/Duration.vue +7 -5
- package/src/components/Duration/types.ts +2 -2
- package/src/components/FormControl/FormControl.cy.ts +21 -0
- package/src/components/FormLabel/FormLabel.api.md +38 -0
- package/src/components/FormLabel/FormLabel.cy.ts +49 -0
- package/src/components/FormLabel/FormLabel.md +16 -0
- package/src/components/FormLabel/FormLabel.playground.vue +42 -0
- package/src/components/{FormLabel.vue → FormLabel/FormLabel.vue} +2 -8
- package/src/components/FormLabel/index.ts +2 -0
- package/src/components/FormLabel/stories/Default.vue +7 -0
- package/src/components/FormLabel/stories/Required.vue +7 -0
- package/src/components/FormLabel/types.ts +13 -0
- package/src/components/ItemListRow/ItemListRow.cy.ts +26 -0
- package/src/components/ItemListRow/index.ts +1 -1
- package/src/components/Menu/Menu.vue +0 -14
- package/src/components/Menu/MenuItemContent.vue +1 -2
- package/src/components/Menu/types.ts +6 -32
- package/src/components/Menu/utils.ts +21 -10
- package/src/components/Password/Password.api.md +0 -7
- package/src/components/Password/Password.cy.ts +68 -19
- package/src/components/Password/Password.md +0 -8
- package/src/components/Password/Password.vue +20 -16
- package/src/components/Password/types.ts +0 -6
- package/src/components/Rating/Rating.api.md +0 -14
- package/src/components/Rating/Rating.cy.ts +0 -26
- package/src/components/Rating/Rating.md +0 -7
- package/src/components/Rating/Rating.playground.vue +3 -3
- package/src/components/Rating/Rating.vue +3 -13
- package/src/components/Rating/index.ts +6 -1
- package/src/components/Rating/types.ts +0 -12
- package/src/components/Slider/Slider.cy.ts +29 -0
- package/src/components/Slider/index.ts +1 -0
- package/src/components/Switch/Switch.api.md +0 -8
- package/src/components/Switch/Switch.cy.ts +32 -34
- package/src/components/Switch/Switch.vue +1 -24
- package/src/components/Switch/types.ts +0 -6
- package/src/components/TextEditor/components/LinkPopup.vue +3 -3
- package/src/components/TextEditor/extensions/iframe/InsertIframe.vue +4 -7
- package/src/components/TextEditor/extensions/image-group/ImageGroupUploadDialog.vue +4 -6
- package/src/components/TextInput/TextInput.cy.ts +53 -5
- package/src/components/TextInput/TextInput.vue +16 -3
- package/src/components/TextInput/index.ts +1 -1
- package/src/components/TextInput/types.ts +17 -0
- package/src/components/Textarea/Textarea.cy.ts +52 -1
- package/src/components/Textarea/Textarea.vue +14 -2
- package/src/components/TimePicker/TimePicker.vue +6 -6
- package/src/components/shared/picker/PickerShell.vue +4 -4
- package/src/index.ts +6 -10
- package/src/molecules/editor/extensions/iframe/IframeInsertDialog.vue +5 -8
- package/src/molecules/editor/extensions/image-group/ImageGroupUploadDialog.vue +4 -6
- package/src/molecules/editor/extensions/link/LinkEditorPopup.vue +2 -2
- package/src/components/CircularProgressBar/CircularProgressBar.api.md +0 -62
- package/src/components/CircularProgressBar/CircularProgressBar.md +0 -5
- package/src/components/CircularProgressBar/CircularProgressBar.story.vue +0 -65
- package/src/components/CircularProgressBar/CircularProgressBar.vue +0 -175
- package/src/components/CircularProgressBar/index.ts +0 -2
- package/src/components/CircularProgressBar/types.ts +0 -39
- package/src/components/ConfirmDialog.vue +0 -82
- package/src/components/Input.cy.ts +0 -19
- package/src/components/Input.vue +0 -218
- package/src/components/Password/stories/LegacyValue.vue +0 -16
- package/src/utils/confirmDialog.d.ts +0 -17
- package/src/utils/confirmDialog.js +0 -25
|
@@ -71,18 +71,16 @@
|
|
|
71
71
|
</div>
|
|
72
72
|
<Dialog
|
|
73
73
|
v-model="showModal"
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}]
|
|
83
|
-
}"
|
|
74
|
+
title="New Data Import"
|
|
75
|
+
:actions="[{
|
|
76
|
+
label: 'Continue',
|
|
77
|
+
variant: 'solid',
|
|
78
|
+
onClick({ close }) {
|
|
79
|
+
createDataImport(close)
|
|
80
|
+
}
|
|
81
|
+
}]"
|
|
84
82
|
>
|
|
85
|
-
<template #
|
|
83
|
+
<template #default>
|
|
86
84
|
<div>
|
|
87
85
|
<Link
|
|
88
86
|
v-model="doctypeForImport"
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<Dialog v-model="show"
|
|
3
|
-
|
|
4
|
-
size: '2xl',
|
|
5
|
-
}">
|
|
6
|
-
<template #body-content>
|
|
2
|
+
<Dialog v-model="show" title="Export Data" size="2xl">
|
|
3
|
+
<template #default>
|
|
7
4
|
<div class="text-base space-y-5">
|
|
8
5
|
<div class="grid grid-cols-2 gap-5">
|
|
9
6
|
<FormControl
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<Dialog v-model="show" :options="options">
|
|
3
|
-
<template #
|
|
4
|
-
<slot name="body-header"></slot>
|
|
5
|
-
</template>
|
|
6
|
-
<template #body-content>
|
|
2
|
+
<Dialog v-model="show" :title="options.title" :size="options.size" :actions="options.actions">
|
|
3
|
+
<template #default>
|
|
7
4
|
<slot>
|
|
8
5
|
<div class="flex flex-col gap-2 text-ink-gray-9 text-base">
|
|
9
6
|
<div v-if="currentStep.message">{{ currentStep.message }}</div>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<Dialog v-model="open" @close="dialogType = ''">
|
|
3
|
-
<template #
|
|
3
|
+
<template #title>
|
|
4
4
|
<h3 class="text-xl font-semibold leading-6 text-ink-gray-9 cursor-pointer pr-2" @click="emitter.emit('rename')">
|
|
5
5
|
{{ entity.title }}
|
|
6
6
|
</h3>
|
|
7
7
|
</template>
|
|
8
|
-
<template #
|
|
8
|
+
<template #default>
|
|
9
9
|
<ul class="space-y-3 text-sm mb-4 text-ink-gray-8">
|
|
10
10
|
<span class="text-base font-semibold">Information</span>
|
|
11
11
|
<li>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<Dialog v-model="open"
|
|
3
|
-
<template #
|
|
2
|
+
<Dialog v-model="open" size="lg" bare @close="dialogType = ''">
|
|
3
|
+
<template #default>
|
|
4
4
|
<div class="p-4 sm:px-6">
|
|
5
5
|
<div class="flex w-full justify-between gap-x-15 mb-4">
|
|
6
6
|
<div class="font-semibold text-xl flex text-nowrap overflow-hidden">
|
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<Dialog
|
|
3
3
|
v-model="open"
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
],
|
|
15
|
-
}"
|
|
4
|
+
title="Rename"
|
|
5
|
+
size="xs"
|
|
6
|
+
:actions="[
|
|
7
|
+
{
|
|
8
|
+
label: 'Confirm',
|
|
9
|
+
variant: 'solid',
|
|
10
|
+
disabled: !newTitle || newTitle === entity.title || rename.loading,
|
|
11
|
+
onClick: submit,
|
|
12
|
+
},
|
|
13
|
+
]"
|
|
16
14
|
@close="dialogType = ''"
|
|
17
15
|
>
|
|
18
|
-
<template #
|
|
16
|
+
<template #default>
|
|
19
17
|
<div class="flex gap-3">
|
|
20
18
|
<FormControl
|
|
21
19
|
v-model="newTitle"
|
package/package.json
CHANGED
|
@@ -1,18 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<Dialog
|
|
3
3
|
v-model="show"
|
|
4
|
-
:
|
|
5
|
-
title: props.event.hasOwnProperty('id') ? 'Edit Event' : 'New Event',
|
|
6
|
-
actions: [
|
|
7
|
-
{
|
|
8
|
-
label: 'Submit',
|
|
9
|
-
variant: 'solid',
|
|
10
|
-
},
|
|
11
|
-
],
|
|
12
|
-
}"
|
|
4
|
+
:title="props.event.hasOwnProperty('id') ? 'Edit Event' : 'New Event'"
|
|
13
5
|
class="z-50"
|
|
14
6
|
>
|
|
15
|
-
<template #
|
|
7
|
+
<template #default>
|
|
16
8
|
<div>
|
|
17
9
|
<div class="grid grid-cols-1 gap-4">
|
|
18
10
|
<FormControl
|
|
@@ -25,14 +25,6 @@
|
|
|
25
25
|
required: false,
|
|
26
26
|
type: 'boolean'
|
|
27
27
|
},
|
|
28
|
-
{
|
|
29
|
-
name: 'padding',
|
|
30
|
-
description: 'Adds padding around the checkbox.',
|
|
31
|
-
required: false,
|
|
32
|
-
type: 'boolean',
|
|
33
|
-
default: 'false',
|
|
34
|
-
deprecated: 'Use `padded` instead.'
|
|
35
|
-
},
|
|
36
28
|
{
|
|
37
29
|
name: 'indeterminate',
|
|
38
30
|
description: 'Renders the mixed "—" state (e.g. a select-all that\'s partially selected).\nPurely visual — the native `indeterminate` DOM property is not reflected as\nan attribute, so it must be set via this prop, not markup.',
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
+
import { h } from 'vue'
|
|
1
2
|
import Checkbox from './Checkbox.vue'
|
|
2
|
-
import { _resetWarnDeprecated } from '../../utils/warnDeprecated'
|
|
3
3
|
|
|
4
4
|
describe('Checkbox', () => {
|
|
5
|
-
beforeEach(() => {
|
|
6
|
-
_resetWarnDeprecated()
|
|
7
|
-
})
|
|
8
|
-
|
|
9
5
|
it('renders', () => {
|
|
10
6
|
cy.mount(Checkbox, { props: { label: 'abc' } })
|
|
11
7
|
|
|
@@ -36,6 +32,31 @@ describe('Checkbox', () => {
|
|
|
36
32
|
.and('not.have.class', 'text-ink-gray-5')
|
|
37
33
|
})
|
|
38
34
|
|
|
35
|
+
it('toggles with the space key', () => {
|
|
36
|
+
cy.mount(Checkbox, {
|
|
37
|
+
props: {
|
|
38
|
+
label: 'Accept',
|
|
39
|
+
'onUpdate:modelValue': cy.spy().as('onUpdate'),
|
|
40
|
+
},
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
cy.get('input[type="checkbox"]').focus().type(' ')
|
|
44
|
+
cy.get('@onUpdate').should('have.been.calledWith', true)
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
it('renders the label and description slots', () => {
|
|
48
|
+
cy.mount(Checkbox, {
|
|
49
|
+
props: { label: 'prop label', description: 'prop description' },
|
|
50
|
+
slots: {
|
|
51
|
+
label: () => h('span', 'slot label'),
|
|
52
|
+
description: () => h('span', 'slot description'),
|
|
53
|
+
},
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
cy.contains('slot label').should('exist')
|
|
57
|
+
cy.contains('slot description').should('exist')
|
|
58
|
+
})
|
|
59
|
+
|
|
39
60
|
it('test v-model', () => {
|
|
40
61
|
cy.mount(Checkbox, {
|
|
41
62
|
props: {
|
|
@@ -99,17 +120,6 @@ describe('Checkbox', () => {
|
|
|
99
120
|
})
|
|
100
121
|
cy.get('input').should('have.attr', 'data-disabled', 'true')
|
|
101
122
|
})
|
|
102
|
-
|
|
103
|
-
it('warns once when the deprecated `padding` prop is used', () => {
|
|
104
|
-
cy.window().then((win) => {
|
|
105
|
-
cy.spy(win.console, 'warn').as('consoleWarn')
|
|
106
|
-
})
|
|
107
|
-
cy.mount(Checkbox, { props: { label: 'abc', padding: true } })
|
|
108
|
-
cy.get('@consoleWarn').should(
|
|
109
|
-
'have.been.calledWithMatch',
|
|
110
|
-
/Checkbox\.padding is deprecated/,
|
|
111
|
-
)
|
|
112
|
-
})
|
|
113
123
|
})
|
|
114
124
|
|
|
115
125
|
describe('padded', () => {
|
|
@@ -4,10 +4,7 @@
|
|
|
4
4
|
:class="[props.padded ? 'flex' : 'inline-flex', containerClasses]"
|
|
5
5
|
@click="onContainerClick"
|
|
6
6
|
>
|
|
7
|
-
<div
|
|
8
|
-
class="inline-flex items-center gap-2 rounded transition"
|
|
9
|
-
:class="rowClasses"
|
|
10
|
-
>
|
|
7
|
+
<div class="inline-flex items-center gap-2 rounded transition">
|
|
11
8
|
<input
|
|
12
9
|
ref="inputRef"
|
|
13
10
|
class="rounded-sm mt-[1px]"
|
|
@@ -58,7 +55,6 @@
|
|
|
58
55
|
<script lang="ts" setup>
|
|
59
56
|
import { computed, ref, useAttrs, watchEffect } from 'vue'
|
|
60
57
|
import { useInputLabeling } from '../../composables/useInputLabeling'
|
|
61
|
-
import { warnDeprecated } from '../../utils/warnDeprecated'
|
|
62
58
|
import InputLabel from '../InputLabeling/InputLabel.vue'
|
|
63
59
|
import InputDescription from '../InputLabeling/InputDescription.vue'
|
|
64
60
|
import InputError from '../InputLabeling/InputError.vue'
|
|
@@ -67,19 +63,12 @@ import type { CheckboxBaseProps } from './types'
|
|
|
67
63
|
const props = withDefaults(defineProps<CheckboxBaseProps>(), {
|
|
68
64
|
size: 'sm',
|
|
69
65
|
padded: false,
|
|
70
|
-
padding: false,
|
|
71
66
|
indeterminate: false,
|
|
72
67
|
})
|
|
73
68
|
|
|
74
69
|
const model = defineModel<boolean | 1 | 0>()
|
|
75
70
|
const attrs = useAttrs()
|
|
76
71
|
|
|
77
|
-
watchEffect(() => {
|
|
78
|
-
if (props.padding) {
|
|
79
|
-
warnDeprecated('Checkbox.padding', 'padded')
|
|
80
|
-
}
|
|
81
|
-
})
|
|
82
|
-
|
|
83
72
|
const checked = computed(() => Boolean(model.value))
|
|
84
73
|
|
|
85
74
|
// The `indeterminate` state can only be set via the DOM property, not HTML attribute.
|
|
@@ -129,15 +118,6 @@ const labelClasses = computed(() => {
|
|
|
129
118
|
]
|
|
130
119
|
})
|
|
131
120
|
|
|
132
|
-
const rowClasses = computed(() => {
|
|
133
|
-
return {
|
|
134
|
-
'px-2.5 py-1.5': props.padding && props.size === 'sm',
|
|
135
|
-
'px-3 py-2': props.padding && props.size === 'md',
|
|
136
|
-
'focus-within:bg-surface-gray-2 focus-within:ring-2 focus-within:ring-outline-gray-3 hover:bg-surface-gray-3 active:bg-surface-gray-4':
|
|
137
|
-
props.padding && !props.disabled,
|
|
138
|
-
}
|
|
139
|
-
})
|
|
140
|
-
|
|
141
121
|
// When padded, the whole row is a clickable surface. Mirrors Switch's padded
|
|
142
122
|
// rows: fixed-height compact rows (24/28/32px) with hover,
|
|
143
123
|
// active and keyboard-only focus states wrapping the control and label.
|
|
@@ -201,7 +181,7 @@ const inputClasses = computed(() => {
|
|
|
201
181
|
}
|
|
202
182
|
|
|
203
183
|
// When padded the row drives hover; otherwise the control does.
|
|
204
|
-
const padded = props.
|
|
184
|
+
const padded = props.padded
|
|
205
185
|
return [
|
|
206
186
|
sizeClasses,
|
|
207
187
|
'cursor-pointer transition focus:ring-0 focus:ring-offset-0',
|
|
@@ -11,12 +11,6 @@ export interface CheckboxBaseProps extends InputLabelingProps {
|
|
|
11
11
|
/** Disables the checkbox interaction */
|
|
12
12
|
disabled?: boolean
|
|
13
13
|
|
|
14
|
-
/**
|
|
15
|
-
* Adds padding around the checkbox.
|
|
16
|
-
* @deprecated Use `padded` instead.
|
|
17
|
-
*/
|
|
18
|
-
padding?: boolean
|
|
19
|
-
|
|
20
14
|
/**
|
|
21
15
|
* Renders the mixed "—" state (e.g. a select-all that's partially selected).
|
|
22
16
|
* Purely visual — the native `indeterminate` DOM property is not reflected as
|
|
@@ -42,13 +42,13 @@ const emojis = [
|
|
|
42
42
|
<Button @click="open = true">Open dialog</Button>
|
|
43
43
|
|
|
44
44
|
<Dialog v-model="open">
|
|
45
|
-
<template #
|
|
45
|
+
<template #title>
|
|
46
46
|
<h3 class="text-3xl-semibold text-ink-gray-9">
|
|
47
47
|
Combobox inside Dialog
|
|
48
48
|
</h3>
|
|
49
49
|
</template>
|
|
50
50
|
|
|
51
|
-
<template #
|
|
51
|
+
<template #default>
|
|
52
52
|
<div class="space-y-4">
|
|
53
53
|
<div class="flex flex-col gap-1">
|
|
54
54
|
<label class="text-sm text-ink-gray-7">Repository</label>
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
<template>
|
|
3
3
|
<Dialog
|
|
4
4
|
v-model="show"
|
|
5
|
-
|
|
5
|
+
size="xl"
|
|
6
|
+
position="top"
|
|
7
|
+
bare
|
|
6
8
|
@after-leave="searchQuery = ''"
|
|
7
9
|
>
|
|
8
|
-
<template #
|
|
10
|
+
<template #default>
|
|
9
11
|
<div>
|
|
10
12
|
<Combobox nullable @update:model-value="select">
|
|
11
13
|
<div class="relative">
|
|
@@ -204,4 +204,65 @@ describe('ContextMenu', () => {
|
|
|
204
204
|
expect(event.defaultPrevented).to.be.false
|
|
205
205
|
})
|
|
206
206
|
})
|
|
207
|
+
|
|
208
|
+
it('disabled items do not fire onClick', () => {
|
|
209
|
+
const onClick = cy.stub().as('onClick')
|
|
210
|
+
|
|
211
|
+
cy.mount(ContextMenu, {
|
|
212
|
+
props: { options: [{ label: 'Delete', disabled: true, onClick }] },
|
|
213
|
+
slots: { default: trigger },
|
|
214
|
+
})
|
|
215
|
+
|
|
216
|
+
cy.get('[data-cy=trigger]').rightclick()
|
|
217
|
+
cy.get('[role=menuitem]').should('have.attr', 'data-disabled')
|
|
218
|
+
cy.get('[role=menuitem]').click({ force: true })
|
|
219
|
+
cy.get('@onClick').should('not.have.been.called')
|
|
220
|
+
})
|
|
221
|
+
|
|
222
|
+
it('supports arrow keys, Enter, and Escape', () => {
|
|
223
|
+
const onClick = cy.stub().as('onClick')
|
|
224
|
+
|
|
225
|
+
cy.mount(ContextMenu, {
|
|
226
|
+
props: {
|
|
227
|
+
options: [
|
|
228
|
+
{ label: 'Open', onClick: () => {} },
|
|
229
|
+
{ label: 'Rename', onClick },
|
|
230
|
+
],
|
|
231
|
+
},
|
|
232
|
+
slots: { default: trigger },
|
|
233
|
+
})
|
|
234
|
+
|
|
235
|
+
cy.get('[data-cy=trigger]').rightclick()
|
|
236
|
+
cy.get('[role=menu]').type('{downarrow}{downarrow}')
|
|
237
|
+
cy.contains('[role=menuitem]', 'Rename').should(
|
|
238
|
+
'have.attr',
|
|
239
|
+
'data-highlighted',
|
|
240
|
+
)
|
|
241
|
+
cy.focused().type('{enter}')
|
|
242
|
+
cy.get('@onClick').should('have.been.called')
|
|
243
|
+
cy.get('[role=menu]').should('not.exist')
|
|
244
|
+
|
|
245
|
+
cy.get('[data-cy=trigger]').rightclick()
|
|
246
|
+
cy.get('[role=menu]').type('{esc}')
|
|
247
|
+
cy.get('[role=menu]').should('not.exist')
|
|
248
|
+
})
|
|
249
|
+
|
|
250
|
+
it('renders the empty state, and #empty replaces it', () => {
|
|
251
|
+
cy.mount(ContextMenu, {
|
|
252
|
+
props: { options: [] },
|
|
253
|
+
slots: { default: trigger },
|
|
254
|
+
})
|
|
255
|
+
cy.get('[data-cy=trigger]').rightclick()
|
|
256
|
+
cy.get('[data-slot=empty]').should('contain.text', 'No options')
|
|
257
|
+
|
|
258
|
+
cy.mount(ContextMenu, {
|
|
259
|
+
props: { options: [] },
|
|
260
|
+
slots: {
|
|
261
|
+
default: trigger,
|
|
262
|
+
empty: () => h('span', {}, 'Nothing here'),
|
|
263
|
+
},
|
|
264
|
+
})
|
|
265
|
+
cy.get('[data-cy=trigger]').rightclick()
|
|
266
|
+
cy.get('[data-slot=empty]').should('contain.text', 'Nothing here')
|
|
267
|
+
})
|
|
207
268
|
})
|
|
@@ -1,2 +1,20 @@
|
|
|
1
1
|
export { default as ContextMenu } from './ContextMenu.vue'
|
|
2
|
-
export
|
|
2
|
+
export type {
|
|
3
|
+
ContextMenuActionOption,
|
|
4
|
+
ContextMenuBaseOption,
|
|
5
|
+
ContextMenuGroupOption,
|
|
6
|
+
ContextMenuGroupSlotProps,
|
|
7
|
+
ContextMenuItem,
|
|
8
|
+
ContextMenuItemSlotProps,
|
|
9
|
+
ContextMenuItemSlots,
|
|
10
|
+
ContextMenuOption,
|
|
11
|
+
ContextMenuOptions,
|
|
12
|
+
ContextMenuProps,
|
|
13
|
+
ContextMenuSlotFn,
|
|
14
|
+
ContextMenuSlotProps,
|
|
15
|
+
ContextMenuSlots,
|
|
16
|
+
ContextMenuSubmenuOption,
|
|
17
|
+
ContextMenuSwitchOption,
|
|
18
|
+
ContextMenuTheme,
|
|
19
|
+
ContextMenuTriggerSlotProps,
|
|
20
|
+
} from './types'
|
|
@@ -8,7 +8,6 @@ export type {
|
|
|
8
8
|
MenuActionOption as ContextMenuActionOption,
|
|
9
9
|
MenuSwitchOption as ContextMenuSwitchOption,
|
|
10
10
|
MenuSubmenuOption as ContextMenuSubmenuOption,
|
|
11
|
-
MenuComponentOption as ContextMenuComponentOption,
|
|
12
11
|
MenuGroupOption as ContextMenuGroupOption,
|
|
13
12
|
MenuOption as ContextMenuOption,
|
|
14
13
|
MenuItem as ContextMenuItem,
|
|
@@ -39,13 +39,15 @@
|
|
|
39
39
|
name: 'size',
|
|
40
40
|
description: 'Max-width size of the dialog. Default `\'lg\'`.',
|
|
41
41
|
required: false,
|
|
42
|
-
type: 'DialogSize'
|
|
42
|
+
type: 'DialogSize',
|
|
43
|
+
default: '"lg"'
|
|
43
44
|
},
|
|
44
45
|
{
|
|
45
46
|
name: 'position',
|
|
46
47
|
description: 'Vertical placement. Default `\'center\'`.',
|
|
47
48
|
required: false,
|
|
48
|
-
type: 'DialogPosition'
|
|
49
|
+
type: 'DialogPosition',
|
|
50
|
+
default: '"center"'
|
|
49
51
|
},
|
|
50
52
|
{
|
|
51
53
|
name: 'paddingTop',
|
|
@@ -79,20 +81,6 @@
|
|
|
79
81
|
required: false,
|
|
80
82
|
type: 'boolean',
|
|
81
83
|
default: 'false'
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
name: 'disableOutsideClickToClose',
|
|
85
|
-
description: '',
|
|
86
|
-
required: false,
|
|
87
|
-
type: 'boolean',
|
|
88
|
-
deprecated: 'Use `dismissible` (inverted) instead.'
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
name: 'options',
|
|
92
|
-
description: '',
|
|
93
|
-
required: false,
|
|
94
|
-
type: 'DialogOptions',
|
|
95
|
-
deprecated: 'Use flat top-level props instead.'
|
|
96
84
|
}
|
|
97
85
|
]
|
|
98
86
|
|
|
@@ -111,36 +99,6 @@
|
|
|
111
99
|
name: 'actions',
|
|
112
100
|
description: 'Footer override; exposes `{ close, actions }`.',
|
|
113
101
|
type: 'DialogActionsSlotProps'
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
name: 'body',
|
|
117
|
-
description: '',
|
|
118
|
-
type: 'any',
|
|
119
|
-
deprecated: 'Use `#default` + `bare` prop.'
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
name: 'body-main',
|
|
123
|
-
description: '',
|
|
124
|
-
type: 'any',
|
|
125
|
-
deprecated: 'Use `#default`.'
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
name: 'body-header',
|
|
129
|
-
description: '',
|
|
130
|
-
type: 'any',
|
|
131
|
-
deprecated: 'Use `#title` for extras (no direct replacement).'
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
name: 'body-title',
|
|
135
|
-
description: '',
|
|
136
|
-
type: 'any',
|
|
137
|
-
deprecated: 'Use `#title`.'
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
name: 'body-content',
|
|
141
|
-
description: '',
|
|
142
|
-
type: 'any',
|
|
143
|
-
deprecated: 'Use `#default`.'
|
|
144
102
|
}
|
|
145
103
|
]
|
|
146
104
|
|