frappe-ui 0.1.148 → 0.1.149
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/Help/HelpModal.vue +1 -1
- package/frappe/HelpCenter/HelpCenter.vue +1 -1
- package/frappe/Onboarding/IntermediateStepModal.vue +1 -1
- package/frappe/Onboarding/OnboardingSteps.vue +1 -1
- package/package.json +1 -1
- package/src/components/{Alert.vue → Alert/Alert.vue} +1 -5
- package/src/components/Alert/index.ts +2 -0
- package/src/components/Alert/types.ts +4 -0
- package/src/components/{Autocomplete.vue → Autocomplete/Autocomplete.vue} +10 -43
- package/src/components/Autocomplete/index.ts +2 -0
- package/src/components/Autocomplete/types.ts +38 -0
- package/src/components/{Avatar.vue → Avatar/Avatar.vue} +1 -7
- package/src/components/Avatar/index.ts +2 -0
- package/src/components/Avatar/types.ts +6 -0
- package/src/components/{Badge.vue → Badge/Badge.vue} +1 -11
- package/src/components/Badge/index.ts +2 -0
- package/src/components/Badge/types.ts +10 -0
- package/src/components/{Breadcrumbs.vue → Breadcrumbs/Breadcrumbs.vue} +4 -14
- package/src/components/Breadcrumbs/index.ts +2 -0
- package/src/components/Breadcrumbs/types.ts +12 -0
- package/src/components/Button/Button.vue +3 -22
- package/src/components/Button/index.ts +2 -1
- package/src/components/Button/types.ts +23 -0
- package/src/components/{Calendar.story.md → Calendar/Calendar.story.md} +38 -91
- package/src/components/{Calendar.story.vue → Calendar/Calendar.story.vue} +2 -2
- package/src/components/Calendar/Calendar.vue +1 -1
- package/src/components/Calendar/NewEventModal.vue +3 -3
- package/src/components/{Checkbox.vue → Checkbox/Checkbox.vue} +2 -10
- package/src/components/Checkbox/index.ts +2 -0
- package/src/components/Checkbox/types.ts +9 -0
- package/src/components/{CircularProgressBar.vue → CircularProgressBar/CircularProgressBar.vue} +3 -22
- package/src/components/CircularProgressBar/index.ts +2 -0
- package/src/components/CircularProgressBar/types.ts +25 -0
- package/src/components/ConfirmDialog.vue +1 -1
- package/src/components/DatePicker/DatePicker.vue +3 -3
- package/src/components/DatePicker/DateRangePicker.vue +3 -3
- package/src/components/DatePicker/DateTimePicker.vue +3 -3
- package/src/components/{Dialog.story.vue → Dialog/Dialog.story.vue} +1 -1
- package/src/components/{Dialog.vue → Dialog/Dialog.vue} +3 -42
- package/src/components/Dialog/index.ts +2 -0
- package/src/components/Dialog/types.ts +41 -0
- package/src/components/{Divider.vue → Divider/Divider.vue} +2 -14
- package/src/components/Divider/index.ts +2 -0
- package/src/components/Divider/types.ts +12 -0
- package/src/components/{Dropdown.story.vue → Dropdown/Dropdown.story.vue} +2 -2
- package/src/components/{Dropdown.vue → Dropdown/Dropdown.vue} +9 -28
- package/src/components/Dropdown/index.ts +2 -0
- package/src/components/Dropdown/types.ts +26 -0
- package/src/components/{ErrorMessage.vue → ErrorMessage/ErrorMessage.vue} +2 -3
- package/src/components/ErrorMessage/index.ts +2 -0
- package/src/components/ErrorMessage/types.ts +3 -0
- package/src/components/{FileUploader.story.vue → FileUploader/FileUploader.story.vue} +1 -1
- package/src/components/{FileUploader.vue → FileUploader/FileUploader.vue} +1 -1
- package/src/components/FileUploader/index.ts +1 -0
- package/src/components/{FormControl.story.vue → FormControl/FormControl.story.vue} +2 -2
- package/src/components/{FormControl.vue → FormControl/FormControl.vue} +13 -17
- package/src/components/FormControl/index.ts +2 -0
- package/src/components/FormControl/types.ts +9 -0
- package/src/components/ListView/ListFooter.vue +1 -1
- package/src/components/ListView/ListHeader.vue +1 -1
- package/src/components/ListView/ListRow.vue +3 -3
- package/src/components/ListView/ListSelectBanner.vue +1 -1
- package/src/components/ListView/ListView.story.vue +2 -2
- package/src/components/{Popover.story.vue → Popover/Popover.story.vue} +1 -1
- package/src/components/Popover/index.ts +1 -0
- package/src/components/{Progress.vue → Progress/Progress.vue} +1 -9
- package/src/components/Progress/index.ts +2 -0
- package/src/components/Progress/types.ts +8 -0
- package/src/components/Rating/Rating.vue +1 -8
- package/src/components/Rating/index.ts +2 -0
- package/src/components/Rating/types.ts +7 -0
- package/src/components/{Select.vue → Select/Select.vue} +1 -18
- package/src/components/Select/index.ts +2 -0
- package/src/components/Select/types.ts +17 -0
- package/src/components/Spinner/index.ts +1 -0
- package/src/components/{Switch.vue → Switch/Switch.vue} +1 -8
- package/src/components/Switch/index.ts +2 -0
- package/src/components/Switch/types.ts +7 -0
- package/src/components/{TabButtons.vue → TabButtons/TabButtons.vue} +1 -1
- package/src/components/TabButtons/index.ts +1 -0
- package/src/components/TextEditor/EditLink.vue +1 -1
- package/src/components/TextEditor/FontColor.vue +1 -1
- package/src/components/TextEditor/InsertVideo.vue +2 -2
- package/src/components/TextEditor/Menu.vue +1 -1
- package/src/components/TextEditor/extensions/image/ImageNodeView.vue +1 -1
- package/src/components/{TextInput.story.vue → TextInput/TextInput.story.vue} +2 -2
- package/src/components/{TextInput.vue → TextInput/TextInput.vue} +2 -14
- package/src/components/TextInput/index.ts +2 -0
- package/src/components/TextInput/types.ts +13 -0
- package/src/components/{Textarea.vue → Textarea/Textarea.vue} +2 -13
- package/src/components/Textarea/index.ts +2 -0
- package/src/components/Textarea/types.ts +11 -0
- package/src/components/Tooltip/Tooltip.vue +8 -18
- package/src/components/Tooltip/index.ts +2 -0
- package/src/components/Tooltip/types.ts +10 -0
- package/src/components/Tree/Tree.vue +8 -15
- package/src/components/Tree/index.ts +2 -0
- package/src/components/{types/Tree.ts → Tree/types.ts} +6 -0
- package/src/index.ts +24 -24
- /package/src/components/{Autocomplete.story.vue → Autocomplete/Autocomplete.story.vue} +0 -0
- /package/src/components/{Avatar.story.vue → Avatar/Avatar.story.vue} +0 -0
- /package/src/components/{Badge.story.vue → Badge/Badge.story.vue} +0 -0
- /package/src/components/{Breadcrumbs.story.vue → Breadcrumbs/Breadcrumbs.story.vue} +0 -0
- /package/src/components/{Checkbox.story.vue → Checkbox/Checkbox.story.vue} +0 -0
- /package/src/components/{CircularProgressBar.story.md → CircularProgressBar/CircularProgressBar.story.md} +0 -0
- /package/src/components/{CircularProgressBar.story.vue → CircularProgressBar/CircularProgressBar.story.vue} +0 -0
- /package/src/components/DatePicker/{DatePicker.ts → types.ts} +0 -0
- /package/src/components/{ErrorMessage.story.vue → ErrorMessage/ErrorMessage.story.vue} +0 -0
- /package/src/components/{Popover.vue → Popover/Popover.vue} +0 -0
- /package/src/components/{Progress.story.vue → Progress/Progress.story.vue} +0 -0
- /package/src/components/{Select.story.vue → Select/Select.story.vue} +0 -0
- /package/src/components/{Spinner.story.vue → Spinner/Spinner.story.vue} +0 -0
- /package/src/components/{Spinner.vue → Spinner/Spinner.vue} +0 -0
- /package/src/components/{Switch.story.vue → Switch/Switch.story.vue} +0 -0
- /package/src/components/{TabButtons.story.vue → TabButtons/TabButtons.story.vue} +0 -0
- /package/src/components/{Textarea.story.vue → Textarea/Textarea.story.vue} +0 -0
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
</div>
|
|
54
54
|
</template>
|
|
55
55
|
<script setup>
|
|
56
|
-
import Dropdown from '../../src/components/Dropdown.vue'
|
|
56
|
+
import Dropdown from '../../src/components/Dropdown/Dropdown.vue'
|
|
57
57
|
import Button from '../../src/components/Button/Button.vue'
|
|
58
58
|
import StepsIcon from '../Icons/StepsIcon.vue'
|
|
59
59
|
import MinimizeIcon from '../Icons/MinimizeIcon.vue'
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
<script setup>
|
|
65
65
|
import Button from '../../src/components/Button/Button.vue'
|
|
66
66
|
import FeatherIcon from '../../src/components/FeatherIcon.vue'
|
|
67
|
-
import TextInput from '../../src/components/TextInput.vue'
|
|
67
|
+
import TextInput from '../../src/components/TextInput/TextInput.vue'
|
|
68
68
|
import { ref, computed, onMounted } from 'vue'
|
|
69
69
|
|
|
70
70
|
const props = defineProps({
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
import { useOnboarding } from './onboarding'
|
|
80
80
|
import Tooltip from '../../src/components/Tooltip/Tooltip.vue'
|
|
81
81
|
import Button from '../../src/components/Button/Button.vue'
|
|
82
|
-
import Badge from '../../src/components/Badge.vue'
|
|
82
|
+
import Badge from '../../src/components/Badge/Badge.vue'
|
|
83
83
|
|
|
84
84
|
const props = defineProps({
|
|
85
85
|
appName: {
|
package/package.json
CHANGED
|
@@ -38,11 +38,7 @@
|
|
|
38
38
|
|
|
39
39
|
<script setup lang="ts">
|
|
40
40
|
import { computed } from 'vue'
|
|
41
|
-
|
|
42
|
-
interface AlertProps {
|
|
43
|
-
title?: string
|
|
44
|
-
type?: 'warning'
|
|
45
|
-
}
|
|
41
|
+
import type { AlertProps } from './types'
|
|
46
42
|
|
|
47
43
|
const props = withDefaults(defineProps<AlertProps>(), {
|
|
48
44
|
type: 'warning',
|
|
@@ -206,49 +206,16 @@ import {
|
|
|
206
206
|
ComboboxOptions,
|
|
207
207
|
} from '@headlessui/vue'
|
|
208
208
|
import { computed, nextTick, ref, watch } from 'vue'
|
|
209
|
-
import Popover from '
|
|
210
|
-
import { Button } from '
|
|
211
|
-
import FeatherIcon from '
|
|
212
|
-
import LoadingIndicator from '
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
type OptionValue = string | number | boolean
|
|
222
|
-
|
|
223
|
-
type AutocompleteOption = OptionValue | Option
|
|
224
|
-
|
|
225
|
-
type AutocompleteOptionGroup = {
|
|
226
|
-
group: string
|
|
227
|
-
items: AutocompleteOption[]
|
|
228
|
-
hideLabel?: boolean
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
type AutocompleteOptions = AutocompleteOption[] | AutocompleteOptionGroup[]
|
|
232
|
-
|
|
233
|
-
type AutocompleteProps = {
|
|
234
|
-
label?: string
|
|
235
|
-
options: AutocompleteOptions
|
|
236
|
-
hideSearch?: boolean
|
|
237
|
-
placeholder?: string
|
|
238
|
-
bodyClasses?: string | string[]
|
|
239
|
-
loading?: boolean
|
|
240
|
-
placement?: string
|
|
241
|
-
showFooter?: boolean
|
|
242
|
-
} & (
|
|
243
|
-
| {
|
|
244
|
-
multiple: true
|
|
245
|
-
modelValue?: AutocompleteOption[] | null
|
|
246
|
-
}
|
|
247
|
-
| {
|
|
248
|
-
multiple?: false
|
|
249
|
-
modelValue?: AutocompleteOption | null
|
|
250
|
-
}
|
|
251
|
-
)
|
|
209
|
+
import { Popover } from '../Popover'
|
|
210
|
+
import { Button } from '../Button'
|
|
211
|
+
import FeatherIcon from '../FeatherIcon.vue'
|
|
212
|
+
import LoadingIndicator from '../LoadingIndicator.vue'
|
|
213
|
+
import type {
|
|
214
|
+
AutocompleteOptionGroup,
|
|
215
|
+
AutocompleteOption,
|
|
216
|
+
AutocompleteProps,
|
|
217
|
+
Option,
|
|
218
|
+
} from './types'
|
|
252
219
|
|
|
253
220
|
const props = withDefaults(defineProps<AutocompleteProps>(), {
|
|
254
221
|
multiple: false,
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
type OptionValue = string | number | boolean
|
|
2
|
+
|
|
3
|
+
export type Option = {
|
|
4
|
+
label: string
|
|
5
|
+
value: OptionValue
|
|
6
|
+
description?: string
|
|
7
|
+
[key: string]: any
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export type AutocompleteOption = OptionValue | Option
|
|
11
|
+
|
|
12
|
+
export type AutocompleteOptionGroup = {
|
|
13
|
+
group: string
|
|
14
|
+
items: AutocompleteOption[]
|
|
15
|
+
hideLabel?: boolean
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
type AutocompleteOptions = AutocompleteOption[] | AutocompleteOptionGroup[]
|
|
19
|
+
|
|
20
|
+
export type AutocompleteProps = {
|
|
21
|
+
label?: string
|
|
22
|
+
options: AutocompleteOptions
|
|
23
|
+
hideSearch?: boolean
|
|
24
|
+
placeholder?: string
|
|
25
|
+
bodyClasses?: string | string[]
|
|
26
|
+
loading?: boolean
|
|
27
|
+
placement?: string
|
|
28
|
+
showFooter?: boolean
|
|
29
|
+
} & (
|
|
30
|
+
| {
|
|
31
|
+
multiple: true
|
|
32
|
+
modelValue?: AutocompleteOption[] | null
|
|
33
|
+
}
|
|
34
|
+
| {
|
|
35
|
+
multiple?: false
|
|
36
|
+
modelValue?: AutocompleteOption | null
|
|
37
|
+
}
|
|
38
|
+
)
|
|
@@ -38,16 +38,10 @@
|
|
|
38
38
|
|
|
39
39
|
<script setup lang="ts">
|
|
40
40
|
import { ref, computed } from 'vue'
|
|
41
|
+
import type { AvatarProps } from './types'
|
|
41
42
|
|
|
42
43
|
const imgFetchError = ref(false)
|
|
43
44
|
|
|
44
|
-
interface AvatarProps {
|
|
45
|
-
image?: string
|
|
46
|
-
label?: string
|
|
47
|
-
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl'
|
|
48
|
-
shape?: 'circle' | 'square'
|
|
49
|
-
}
|
|
50
|
-
|
|
51
45
|
const props = withDefaults(defineProps<AvatarProps>(), {
|
|
52
46
|
size: 'md',
|
|
53
47
|
shape: 'circle',
|
|
@@ -21,17 +21,7 @@
|
|
|
21
21
|
|
|
22
22
|
<script lang="ts" setup>
|
|
23
23
|
import { computed } from 'vue'
|
|
24
|
-
|
|
25
|
-
interface Label {
|
|
26
|
-
toString(): string
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
interface BadgeProps {
|
|
30
|
-
theme?: 'gray' | 'blue' | 'green' | 'orange' | 'red'
|
|
31
|
-
size?: 'sm' | 'md' | 'lg'
|
|
32
|
-
variant?: 'solid' | 'subtle' | 'outline' | 'ghost'
|
|
33
|
-
label?: Label | string | number
|
|
34
|
-
}
|
|
24
|
+
import type { BadgeProps } from './types'
|
|
35
25
|
|
|
36
26
|
const props = withDefaults(defineProps<BadgeProps>(), {
|
|
37
27
|
theme: 'gray',
|
|
@@ -78,20 +78,10 @@
|
|
|
78
78
|
<script setup lang="ts">
|
|
79
79
|
import { useWindowSize } from '@vueuse/core'
|
|
80
80
|
import { computed } from 'vue'
|
|
81
|
-
import {
|
|
82
|
-
import Dropdown from '../
|
|
83
|
-
import { Button } from '
|
|
84
|
-
|
|
85
|
-
interface BreadcrumbItem {
|
|
86
|
-
label: string
|
|
87
|
-
route?: RouterLinkProps['to']
|
|
88
|
-
onClick?: () => void
|
|
89
|
-
[key: string]: any
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
interface BreadcrumbsProps {
|
|
93
|
-
items: BreadcrumbItem[]
|
|
94
|
-
}
|
|
81
|
+
import { useRouter } from 'vue-router'
|
|
82
|
+
import { Dropdown } from '../Dropdown'
|
|
83
|
+
import { Button } from '../Button'
|
|
84
|
+
import type { BreadcrumbsProps } from './types'
|
|
95
85
|
|
|
96
86
|
const props = defineProps<BreadcrumbsProps>()
|
|
97
87
|
|
|
@@ -52,29 +52,11 @@
|
|
|
52
52
|
</button>
|
|
53
53
|
</template>
|
|
54
54
|
<script lang="ts" setup>
|
|
55
|
-
import { computed, useSlots
|
|
55
|
+
import { computed, useSlots } from 'vue'
|
|
56
56
|
import FeatherIcon from '../FeatherIcon.vue'
|
|
57
57
|
import LoadingIndicator from '../LoadingIndicator.vue'
|
|
58
|
-
import { useRouter
|
|
59
|
-
|
|
60
|
-
type Theme = 'gray' | 'blue' | 'green' | 'red'
|
|
61
|
-
type Size = 'sm' | 'md' | 'lg' | 'xl' | '2xl'
|
|
62
|
-
type Variant = 'solid' | 'subtle' | 'outline' | 'ghost'
|
|
63
|
-
|
|
64
|
-
export interface ButtonProps {
|
|
65
|
-
theme?: Theme
|
|
66
|
-
size?: Size
|
|
67
|
-
variant?: Variant
|
|
68
|
-
label?: string
|
|
69
|
-
icon?: string | Component
|
|
70
|
-
iconLeft?: string | Component
|
|
71
|
-
iconRight?: string | Component
|
|
72
|
-
loading?: boolean
|
|
73
|
-
loadingText?: string
|
|
74
|
-
disabled?: boolean
|
|
75
|
-
route?: RouteLocation
|
|
76
|
-
link?: string
|
|
77
|
-
}
|
|
58
|
+
import { useRouter } from 'vue-router'
|
|
59
|
+
import type { ButtonProps, ThemeVariant } from './types'
|
|
78
60
|
|
|
79
61
|
const props = withDefaults(defineProps<ButtonProps>(), {
|
|
80
62
|
theme: 'gray',
|
|
@@ -134,7 +116,6 @@ const buttonClasses = computed(() => {
|
|
|
134
116
|
ghost: ghostClasses,
|
|
135
117
|
}[props.variant]
|
|
136
118
|
|
|
137
|
-
type ThemeVariant = `${Theme}-${Variant}`
|
|
138
119
|
let themeVariant: ThemeVariant = `${props.theme}-${props.variant}`
|
|
139
120
|
|
|
140
121
|
let disabledClassesMap: Record<ThemeVariant, string> = {
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { default as Button
|
|
1
|
+
export { default as Button } from './Button.vue'
|
|
2
|
+
export type { ButtonProps } from './types'
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type RouteLocation } from 'vue-router'
|
|
2
|
+
import { type Component } from 'vue'
|
|
3
|
+
|
|
4
|
+
type Theme = 'gray' | 'blue' | 'green' | 'red'
|
|
5
|
+
type Size = 'sm' | 'md' | 'lg' | 'xl' | '2xl'
|
|
6
|
+
type Variant = 'solid' | 'subtle' | 'outline' | 'ghost'
|
|
7
|
+
|
|
8
|
+
export interface ButtonProps {
|
|
9
|
+
theme?: Theme
|
|
10
|
+
size?: Size
|
|
11
|
+
variant?: Variant
|
|
12
|
+
label?: string
|
|
13
|
+
icon?: string | Component
|
|
14
|
+
iconLeft?: string | Component
|
|
15
|
+
iconRight?: string | Component
|
|
16
|
+
loading?: boolean
|
|
17
|
+
loadingText?: string
|
|
18
|
+
disabled?: boolean
|
|
19
|
+
route?: RouteLocation
|
|
20
|
+
link?: string
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export type ThemeVariant = `${Theme}-${Variant}`
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
### events
|
|
4
4
|
|
|
5
|
-
`events` is an array of objects, where each object consists of a single event.
|
|
6
|
-
By default the value of events props is an empty array `[]`
|
|
5
|
+
`events` is an array of objects, where each object consists of a single event. By default the value of events props is an empty array `[]`
|
|
7
6
|
|
|
8
7
|
A single event can be of 2 types
|
|
9
8
|
|
|
@@ -25,9 +24,7 @@ Event object looks like:
|
|
|
25
24
|
|
|
26
25
|
- `id` should be unique for each event.
|
|
27
26
|
|
|
28
|
-
- `fromDate` and `toDate` should be in the above format or can be a date object.
|
|
29
|
-
Currently Single date event is created and it is taken from fromDate. In
|
|
30
|
-
future multiple day events will also be introduced.
|
|
27
|
+
- `fromDate` and `toDate` should be in the above format or can be a date object. Currently Single date event is created and it is taken from fromDate. In future multiple day events will also be introduced.
|
|
31
28
|
|
|
32
29
|
- `color` can be from a list of
|
|
33
30
|
|
|
@@ -69,31 +66,17 @@ The object for this kind of event looks like:
|
|
|
69
66
|
|
|
70
67
|
}
|
|
71
68
|
|
|
72
|
-
- `disableModes`: This is an array of strings which consists of the modes which
|
|
73
|
-
are to be disabled. The default value is an empty array. If the value is
|
|
74
|
-
['Day'] then the Day mode will be disabled and the user will not be able to
|
|
75
|
-
switch to the Day mode. Only the Week and Month mode will be available.
|
|
69
|
+
- `disableModes`: This is an array of strings which consists of the modes which are to be disabled. The default value is an empty array. If the value is ['Day'] then the Day mode will be disabled and the user will not be able to switch to the Day mode. Only the Week and Month mode will be available.
|
|
76
70
|
|
|
77
|
-
- `defaultMode`: This is the default mode in which the calendar will be loaded.
|
|
78
|
-
The default value is 'Month'. It can be one of the following values:
|
|
71
|
+
- `defaultMode`: This is the default mode in which the calendar will be loaded. The default value is 'Month'. It can be one of the following values:
|
|
79
72
|
|
|
80
73
|
- Day
|
|
81
74
|
- Week
|
|
82
75
|
- Month
|
|
83
76
|
|
|
84
|
-
- `isEditMode`: This is a boolean value which is used to enable or disable the
|
|
85
|
-
edit mode. The default value is false. So by default the calendar is in
|
|
86
|
-
read-only mode. If it is set to true then the user can perform actions like
|
|
87
|
-
adding, editing, and deleting the events.
|
|
77
|
+
- `isEditMode`: This is a boolean value which is used to enable or disable the edit mode. The default value is false. So by default the calendar is in read-only mode. If it is set to true then the user can perform actions like adding, editing, and deleting the events.
|
|
88
78
|
|
|
89
|
-
- `eventIcons`: This is an object which consists of the icons which are to be
|
|
90
|
-
displayed for the events. The default value is an empty object. This objects
|
|
91
|
-
changes the icon of the event on the basis of the type of event. If the type
|
|
92
|
-
of event is not present in the object then the default icon will be displayed.
|
|
93
|
-
`type_of_event` property can be set in the event object to display the icon.
|
|
94
|
-
The icon of the event will be taken from this object. So if your event has an
|
|
95
|
-
event type of "Call" then the icon will be taken from this object. The object
|
|
96
|
-
should be in the following format:
|
|
79
|
+
- `eventIcons`: This is an object which consists of the icons which are to be displayed for the events. The default value is an empty object. This objects changes the icon of the event on the basis of the type of event. If the type of event is not present in the object then the default icon will be displayed. `type_of_event` property can be set in the event object to display the icon. The icon of the event will be taken from this object. So if your event has an event type of "Call" then the icon will be taken from this object. The object should be in the following format:
|
|
97
80
|
|
|
98
81
|
{
|
|
99
82
|
'type_of_event1': 'icon_component1',
|
|
@@ -107,42 +90,27 @@ e.g.
|
|
|
107
90
|
'Meeting': <MeetingIcon />,
|
|
108
91
|
}
|
|
109
92
|
|
|
110
|
-
- `redundantCellHeight`: The height of the cell to display full day events. This
|
|
111
|
-
|
|
112
|
-
- `
|
|
113
|
-
|
|
114
|
-
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
- Navigating inside a view: By pressing right arrow(→) or left arrow(←) key on
|
|
122
|
-
your keyboard you can navigate inside a view.
|
|
123
|
-
- Delete: When an event is focused you can press the delete button to delete
|
|
124
|
-
the event.
|
|
125
|
-
|
|
126
|
-
- `showIcon`: Boolean value which determines whether the icon will be displayed
|
|
127
|
-
or not in the Event. By default the value is true i.e. icon will be displayed,
|
|
128
|
-
can be disabled by setting it to false.
|
|
129
|
-
|
|
130
|
-
- Many functional props are also there which will be discussed in the below
|
|
131
|
-
sections.
|
|
93
|
+
- `redundantCellHeight`: The height of the cell to display full day events. This value is in Pixel, by default the value is `50px`.
|
|
94
|
+
- `hourHeight`: The height of each cell below the full day events cell. This value is in pixel, by default the value is `50px`.
|
|
95
|
+
- `enableShortcuts`: Boolean value which determines whether shortcuts will be enabled or not. By default the value is true i.e. shortcuts will be enabled, can be disabled by setting it to false, currently the calendar supports shortcuts like
|
|
96
|
+
|
|
97
|
+
- Navigating between views: By pressing M(monthly), W(weekly), D(daily), you can navigate between the views.
|
|
98
|
+
- Navigating inside a view: By pressing right arrow(→) or left arrow(←) key on your keyboard you can navigate inside a view.
|
|
99
|
+
- Delete: When an event is focused you can press the delete button to delete the event.
|
|
100
|
+
|
|
101
|
+
- `showIcon`: Boolean value which determines whether the icon will be displayed or not in the Event. By default the value is true i.e. icon will be displayed, can be disabled by setting it to false.
|
|
102
|
+
|
|
103
|
+
- Many functional props are also there which will be discussed in the below sections.
|
|
132
104
|
|
|
133
105
|
## Custom API Integrations
|
|
134
106
|
|
|
135
|
-
To integrate the calendar with your API, you need to pass the following
|
|
136
|
-
functions as emits to the Calendar component:
|
|
107
|
+
To integrate the calendar with your API, you need to pass the following functions as emits to the Calendar component:
|
|
137
108
|
|
|
138
|
-
- create: This function is called when a new event is created from the UI. The
|
|
139
|
-
first argument in the function is the new event created.
|
|
109
|
+
- create: This function is called when a new event is created from the UI. The first argument in the function is the new event created.
|
|
140
110
|
|
|
141
|
-
- update: This function is called when an existing event is updated. The first
|
|
142
|
-
argument in the function is an object which has the updated event.
|
|
111
|
+
- update: This function is called when an existing event is updated. The first argument in the function is an object which has the updated event.
|
|
143
112
|
|
|
144
|
-
- delete: This function is called when an existing event is deleted. The first
|
|
145
|
-
argument in the function is the id of the event to be deleted.
|
|
113
|
+
- delete: This function is called when an existing event is deleted. The first argument in the function is the id of the event to be deleted.
|
|
146
114
|
|
|
147
115
|
e.g.
|
|
148
116
|
|
|
@@ -154,23 +122,19 @@ e.g.
|
|
|
154
122
|
@delete="(eventID) => console.log('deleteEvent', eventID)"
|
|
155
123
|
/>
|
|
156
124
|
|
|
157
|
-
In these functions, you can set up your API calls to create, update, and delete
|
|
158
|
-
events.
|
|
125
|
+
In these functions, you can set up your API calls to create, update, and delete events.
|
|
159
126
|
|
|
160
127
|
## Calendar Click Events
|
|
161
128
|
|
|
162
|
-
1. Single Click any event to get additional data of the event via Popover,
|
|
163
|
-
edit/delete the event from the popover.
|
|
129
|
+
1. Single Click any event to get additional data of the event via Popover, edit/delete the event from the popover.
|
|
164
130
|
|
|
165
131
|
2. Double Click any cell to create a new event.
|
|
166
132
|
|
|
167
|
-
3. Double Click any Event to edit an event. When an event is updated the update
|
|
168
|
-
function is called (mentioned above)
|
|
133
|
+
3. Double Click any Event to edit an event. When an event is updated the update function is called (mentioned above)
|
|
169
134
|
|
|
170
135
|
## Custom Calendar Click Events
|
|
171
136
|
|
|
172
|
-
If you wish to handle clicks on your own, the Calendar provides 3 functions to
|
|
173
|
-
handle clicks via props.
|
|
137
|
+
If you wish to handle clicks on your own, the Calendar provides 3 functions to handle clicks via props.
|
|
174
138
|
|
|
175
139
|
<Calendar
|
|
176
140
|
:config="config"
|
|
@@ -182,8 +146,7 @@ handle clicks via props.
|
|
|
182
146
|
|
|
183
147
|
`Note: while using custom click events, the create, update & delete prop functions will not be triggered.`
|
|
184
148
|
|
|
185
|
-
- `onClick`: The function is triggered when an event is clicked. In the callback
|
|
186
|
-
function you receive an argument which is an object and it looks like this:
|
|
149
|
+
- `onClick`: The function is triggered when an event is clicked. In the callback function you receive an argument which is an object and it looks like this:
|
|
187
150
|
|
|
188
151
|
{
|
|
189
152
|
e:MouseEvent,
|
|
@@ -191,12 +154,9 @@ handle clicks via props.
|
|
|
191
154
|
}
|
|
192
155
|
|
|
193
156
|
- e: this key represent the MouseEvent.
|
|
194
|
-
- calendarEvent: This key is an object, the object of calendarEvent is
|
|
195
|
-
displayed above
|
|
157
|
+
- calendarEvent: This key is an object, the object of calendarEvent is displayed above
|
|
196
158
|
|
|
197
|
-
- `onDblClick`: The function is triggered when an event is double clicked. In
|
|
198
|
-
the callback function you receive an argument which is an object and it looks
|
|
199
|
-
like this:
|
|
159
|
+
- `onDblClick`: The function is triggered when an event is double clicked. In the callback function you receive an argument which is an object and it looks like this:
|
|
200
160
|
|
|
201
161
|
{
|
|
202
162
|
e:MouseEvent,
|
|
@@ -204,12 +164,9 @@ handle clicks via props.
|
|
|
204
164
|
}
|
|
205
165
|
|
|
206
166
|
- e: this key represent the MouseEvent.
|
|
207
|
-
- calendarEvent: This key is an object, the object of calendarEvent is
|
|
208
|
-
displayed above
|
|
167
|
+
- calendarEvent: This key is an object, the object of calendarEvent is displayed above
|
|
209
168
|
|
|
210
|
-
- `onCellDblClick`: The function is triggered when a cell is double clicked. In
|
|
211
|
-
the callback function you receive an argument which is an object and it looks
|
|
212
|
-
like this:
|
|
169
|
+
- `onCellDblClick`: The function is triggered when a cell is double clicked. In the callback function you receive an argument which is an object and it looks like this:
|
|
213
170
|
|
|
214
171
|
{
|
|
215
172
|
e:MouseEvent,
|
|
@@ -220,16 +177,12 @@ handle clicks via props.
|
|
|
220
177
|
|
|
221
178
|
- e: this key represent the MouseEvent.
|
|
222
179
|
- date: Date Object, which has the date of the cell which was double clicked.
|
|
223
|
-
- time: String, ranges from "00:00" to "23:00", where the cell was clicked in
|
|
224
|
-
the grid that time value will be displayed over here. (Note, this will be
|
|
225
|
-
empty in Month view)
|
|
180
|
+
- time: String, ranges from "00:00" to "23:00", where the cell was clicked in the grid that time value will be displayed over here. (Note, this will be empty in Month view)
|
|
226
181
|
- view: String, shows the view in which the event was triggered.
|
|
227
182
|
|
|
228
183
|
## Custom Header
|
|
229
184
|
|
|
230
|
-
If you wish to create your own header instead of the default header, you can use
|
|
231
|
-
a slot called "header". It can be implemented in a way shown in the story with
|
|
232
|
-
variant "custom-header".
|
|
185
|
+
If you wish to create your own header instead of the default header, you can use a slot called "header". It can be implemented in a way shown in the story with variant "custom-header".
|
|
233
186
|
|
|
234
187
|
```
|
|
235
188
|
<template #header="{ currentMonthYear, enabledModes, activeView, decrement, increment, updateActiveView }">
|
|
@@ -238,15 +191,9 @@ variant "custom-header".
|
|
|
238
191
|
|
|
239
192
|
The header slot return 6 props:
|
|
240
193
|
|
|
241
|
-
1. `currentMonthYear`: String, returns the current month and the current year.
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
4. `increment`: Function, returns a function which allows user to navigate to
|
|
248
|
-
next month/week/day in the current view.
|
|
249
|
-
5. `activeView`: String, returns the current view of the calendar. This can be
|
|
250
|
-
used as modelValue.
|
|
251
|
-
6. `updateActiveView`: Function, this function can be used to update the current
|
|
252
|
-
view of the calendar.
|
|
194
|
+
1. `currentMonthYear`: String, returns the current month and the current year. e.g. August, 2024
|
|
195
|
+
2. `enabledModes`: Array of Objects, returns the enabled modes which can be configured using "config" prop.
|
|
196
|
+
3. `decrement`: Function, returns a function which allows user to navigate to previous month/week/day in the current view.
|
|
197
|
+
4. `increment`: Function, returns a function which allows user to navigate to next month/week/day in the current view.
|
|
198
|
+
5. `activeView`: String, returns the current view of the calendar. This can be used as modelValue.
|
|
199
|
+
6. `updateActiveView`: Function, this function can be used to update the current view of the calendar.
|
|
@@ -63,9 +63,9 @@
|
|
|
63
63
|
</template>
|
|
64
64
|
<script setup>
|
|
65
65
|
import { ref } from 'vue'
|
|
66
|
-
import Calendar from './Calendar
|
|
66
|
+
import Calendar from './Calendar.vue'
|
|
67
67
|
import { logEvent } from 'histoire/client'
|
|
68
|
-
import TabButtons from '
|
|
68
|
+
import { TabButtons } from '../TabButtons'
|
|
69
69
|
|
|
70
70
|
const config = {
|
|
71
71
|
defaultMode: 'Month',
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
<script setup>
|
|
86
86
|
import { computed, onMounted, onUnmounted, provide, ref } from 'vue'
|
|
87
87
|
import { Button } from '../Button'
|
|
88
|
-
import TabButtons from '../TabButtons
|
|
88
|
+
import { TabButtons } from '../TabButtons'
|
|
89
89
|
import {
|
|
90
90
|
getCalendarDates,
|
|
91
91
|
monthList,
|
|
@@ -97,9 +97,9 @@
|
|
|
97
97
|
</template>
|
|
98
98
|
<script setup>
|
|
99
99
|
import { computed, inject, reactive, ref } from 'vue'
|
|
100
|
-
import Dialog from '../Dialog
|
|
101
|
-
import FormControl from '../FormControl
|
|
102
|
-
import ErrorMessage from '../ErrorMessage
|
|
100
|
+
import { Dialog } from '../Dialog'
|
|
101
|
+
import { FormControl } from '../FormControl'
|
|
102
|
+
import { ErrorMessage } from '../ErrorMessage'
|
|
103
103
|
import { Button } from '../Button'
|
|
104
104
|
|
|
105
105
|
import { calculateDiff, colorMap, handleSeconds } from './calendarUtils'
|
|
@@ -28,17 +28,9 @@
|
|
|
28
28
|
</template>
|
|
29
29
|
<script lang="ts" setup>
|
|
30
30
|
import { computed, useAttrs } from 'vue'
|
|
31
|
-
import { useId } from '
|
|
31
|
+
import { useId } from '../../utils/useId'
|
|
32
|
+
import type { CheckboxProps } from './types'
|
|
32
33
|
|
|
33
|
-
interface CheckboxProps {
|
|
34
|
-
size?: 'sm' | 'md'
|
|
35
|
-
label?: string
|
|
36
|
-
checked?: boolean
|
|
37
|
-
disabled?: boolean
|
|
38
|
-
padding?: boolean
|
|
39
|
-
modelValue?: boolean | 1 | 0
|
|
40
|
-
id?: string
|
|
41
|
-
}
|
|
42
34
|
const props = withDefaults(defineProps<CheckboxProps>(), {
|
|
43
35
|
size: 'sm',
|
|
44
36
|
padding: false,
|