pimelon-ui 0.1.171 → 0.1.192
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/package.json +32 -26
- package/src/components/Button/Button.story.vue +1 -0
- package/src/components/Button/Button.vue +86 -53
- package/src/components/Button/types.ts +3 -2
- package/src/components/Calendar/Calendar.vue +3 -11
- package/src/components/Charts/NumberChart.vue +40 -34
- package/src/components/Charts/donutChartOptions.ts +4 -4
- package/src/components/Charts/eChartOptions.ts +24 -14
- package/src/components/DatePicker/DatePicker.vue +2 -2
- package/src/components/Dialog/Dialog.story.vue +188 -16
- package/src/components/Dialog/Dialog.vue +134 -85
- package/src/components/Dialog/index.ts +14 -2
- package/src/components/Dialog/types.ts +2 -2
- package/src/components/Dropdown/Dropdown.story.vue +171 -73
- package/src/components/Dropdown/Dropdown.vue +288 -79
- package/src/components/Dropdown/types.ts +8 -3
- package/src/components/KeyboardShortcut.vue +33 -0
- package/src/components/Password/Password.story.vue +14 -0
- package/src/components/Password/Password.vue +58 -0
- package/src/components/Password/index.ts +2 -0
- package/src/components/Password/types.ts +4 -0
- package/src/components/Popover/Popover.vue +256 -264
- package/src/components/Popover/types.ts +24 -0
- package/src/components/Sidebar/Sidebar.story.vue +1 -0
- package/src/components/Sidebar/Sidebar.vue +22 -13
- package/src/components/Sidebar/SidebarHeader.vue +29 -15
- package/src/components/Sidebar/SidebarItem.vue +1 -0
- package/src/components/Sidebar/SidebarSection.vue +6 -4
- package/src/components/Sidebar/types.ts +2 -0
- package/src/components/TabButtons/TabButtons.vue +2 -0
- package/src/components/TextEditor/Menu.vue +19 -8
- package/src/components/TextEditor/TextEditor.vue +59 -11
- package/src/components/TextEditor/TextEditorBubbleMenu.vue +2 -0
- package/src/components/TextEditor/TextEditorFixedMenu.vue +1 -0
- package/src/components/TextEditor/TextEditorFloatingMenu.vue +1 -0
- package/src/components/TextEditor/commands.js +14 -0
- package/src/components/TextEditor/extensions/content-paste-extension.ts +1 -1
- package/src/components/TextEditor/extensions/emoji/emoji-extension.ts +1 -1
- package/src/components/TextEditor/extensions/image/image-extension.ts +2 -2
- package/src/components/TextEditor/extensions/mention/index.ts +1 -0
- package/src/components/TextEditor/extensions/mention/mention-extension.ts +180 -0
- package/src/components/TextEditor/extensions/mention/style.css +7 -0
- package/src/components/TextEditor/extensions/slash-commands/slash-commands-extension.ts +10 -2
- package/src/components/TextEditor/extensions/suggestion/createSuggestionExtension.ts +1 -1
- package/src/components/TextEditor/extensions/tag/tag-extension.ts +1 -1
- package/src/components/TextEditor/icons/list-task.vue +20 -0
- package/src/components/TextEditor/image-viewer-extension.ts +1 -1
- package/src/components/TextEditor/link-extension.ts +2 -2
- package/src/components/TextEditor/types.ts +11 -1
- package/src/components/TextEditor/video-extension.ts +1 -1
- package/src/components/Tooltip/Tooltip.vue +2 -2
- package/src/components/Tree/Tree.vue +2 -1
- package/src/components/Tree/types.ts +1 -0
- package/src/data-fetching/useCall/useCall.test.ts +2 -2
- package/src/data-fetching/useCall/useCall.ts +57 -59
- package/src/data-fetching/useDoc/useDoc.ts +12 -6
- package/src/data-fetching/useList/listStore.ts +6 -3
- package/src/data-fetching/useList/types.ts +3 -5
- package/src/data-fetching/useList/useList.ts +46 -74
- package/src/data-fetching/useMelonFetch.ts +39 -5
- package/src/data-fetching/utils.ts +9 -6
- package/src/index.ts +13 -13
- package/src/tailwind/colorPalette.js +1 -1
- package/src/tailwind/plugin.js +1 -1
- package/src/utils/useFileUpload.ts +6 -0
- package/vite/lucideIcons.js +11 -8
- package/vite/melonProxy.js +11 -3
- /package/src/components/TextEditor/{index.js → index.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pimelon-ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.192",
|
|
4
4
|
"description": "A set of components and utilities for rapid UI development",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -35,27 +35,29 @@
|
|
|
35
35
|
"@popperjs/core": "^2.11.2",
|
|
36
36
|
"@tailwindcss/forms": "^0.5.3",
|
|
37
37
|
"@tailwindcss/typography": "^0.5.16",
|
|
38
|
-
"@tiptap/core": "^2.
|
|
39
|
-
"@tiptap/extension-code-block": "^2.
|
|
40
|
-
"@tiptap/extension-code-block-lowlight": "^2.
|
|
41
|
-
"@tiptap/extension-color": "^2.
|
|
42
|
-
"@tiptap/extension-heading": "^2.
|
|
43
|
-
"@tiptap/extension-highlight": "^2.
|
|
44
|
-
"@tiptap/extension-image": "^2.
|
|
45
|
-
"@tiptap/extension-link": "^2.
|
|
46
|
-
"@tiptap/extension-mention": "^2.
|
|
47
|
-
"@tiptap/extension-placeholder": "^2.
|
|
48
|
-
"@tiptap/extension-table": "^2.
|
|
49
|
-
"@tiptap/extension-table-cell": "^2.
|
|
50
|
-
"@tiptap/extension-table-header": "^2.
|
|
51
|
-
"@tiptap/extension-table-row": "^2.
|
|
52
|
-
"@tiptap/extension-
|
|
53
|
-
"@tiptap/extension-
|
|
54
|
-
"@tiptap/extension-
|
|
55
|
-
"@tiptap/
|
|
56
|
-
"@tiptap/
|
|
57
|
-
"@tiptap/
|
|
58
|
-
"@tiptap/
|
|
38
|
+
"@tiptap/core": "^2.26.1",
|
|
39
|
+
"@tiptap/extension-code-block": "^2.26.1",
|
|
40
|
+
"@tiptap/extension-code-block-lowlight": "^2.26.1",
|
|
41
|
+
"@tiptap/extension-color": "^2.26.1",
|
|
42
|
+
"@tiptap/extension-heading": "^2.26.1",
|
|
43
|
+
"@tiptap/extension-highlight": "^2.26.1",
|
|
44
|
+
"@tiptap/extension-image": "^2.26.1",
|
|
45
|
+
"@tiptap/extension-link": "^2.26.1",
|
|
46
|
+
"@tiptap/extension-mention": "^2.26.1",
|
|
47
|
+
"@tiptap/extension-placeholder": "^2.26.1",
|
|
48
|
+
"@tiptap/extension-table": "^2.26.1",
|
|
49
|
+
"@tiptap/extension-table-cell": "^2.26.1",
|
|
50
|
+
"@tiptap/extension-table-header": "^2.26.1",
|
|
51
|
+
"@tiptap/extension-table-row": "^2.26.1",
|
|
52
|
+
"@tiptap/extension-task-item": "^2.26.1",
|
|
53
|
+
"@tiptap/extension-task-list": "^2.26.1",
|
|
54
|
+
"@tiptap/extension-text-align": "^2.26.1",
|
|
55
|
+
"@tiptap/extension-text-style": "^2.26.1",
|
|
56
|
+
"@tiptap/extension-typography": "^2.26.1",
|
|
57
|
+
"@tiptap/pm": "^2.26.1",
|
|
58
|
+
"@tiptap/starter-kit": "^2.26.1",
|
|
59
|
+
"@tiptap/suggestion": "^2.26.1",
|
|
60
|
+
"@tiptap/vue-3": "^2.26.1",
|
|
59
61
|
"@vueuse/core": "^10.4.1",
|
|
60
62
|
"dayjs": "^1.11.13",
|
|
61
63
|
"dompurify": "^3.2.6",
|
|
@@ -66,18 +68,16 @@
|
|
|
66
68
|
"husky": "^9.1.7",
|
|
67
69
|
"idb-keyval": "^6.2.0",
|
|
68
70
|
"lowlight": "^3.3.0",
|
|
69
|
-
"lucide-static": "^0.
|
|
71
|
+
"lucide-static": "^0.535.0",
|
|
70
72
|
"marked": "^15.0.12",
|
|
71
73
|
"ora": "5.4.1",
|
|
72
74
|
"prettier": "^3.3.2",
|
|
73
|
-
"prosemirror-model": "^1.25.1",
|
|
74
|
-
"prosemirror-state": "^1.4.3",
|
|
75
|
-
"prosemirror-view": "^1.39.2",
|
|
76
75
|
"radix-vue": "^1.5.3",
|
|
77
76
|
"reka-ui": "^2.0.2",
|
|
78
77
|
"socket.io-client": "^4.5.1",
|
|
79
78
|
"tippy.js": "^6.3.7",
|
|
80
79
|
"typescript": "^5.0.2",
|
|
80
|
+
"unplugin-auto-import": "^19.3.0",
|
|
81
81
|
"unplugin-icons": "^22.1.0",
|
|
82
82
|
"unplugin-vue-components": "^28.4.1"
|
|
83
83
|
},
|
|
@@ -100,6 +100,12 @@
|
|
|
100
100
|
"vue": "^3.3.0",
|
|
101
101
|
"vue-router": "^4.1.6"
|
|
102
102
|
},
|
|
103
|
+
"resolutions": {
|
|
104
|
+
"prosemirror-model": "1.25.2",
|
|
105
|
+
"prosemirror-state": "1.4.3",
|
|
106
|
+
"prosemirror-view": "1.40.0",
|
|
107
|
+
"prosemirror-transform": "1.10.4"
|
|
108
|
+
},
|
|
103
109
|
"lint-staged": {
|
|
104
110
|
"*.{js,css,md,vue}": "prettier --write"
|
|
105
111
|
}
|
|
@@ -1,62 +1,75 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
<FeatherIcon
|
|
20
|
-
v-if="iconLeft && typeof iconLeft === 'string'"
|
|
21
|
-
:name="iconLeft"
|
|
22
|
-
:class="slotClasses"
|
|
23
|
-
aria-hidden="true"
|
|
2
|
+
<Tooltip :text="tooltip" :disabled="!tooltip?.length">
|
|
3
|
+
<button
|
|
4
|
+
v-bind="$attrs"
|
|
5
|
+
:class="buttonClasses"
|
|
6
|
+
@click="handleClick"
|
|
7
|
+
:disabled="isDisabled"
|
|
8
|
+
:ariaLabel="ariaLabel"
|
|
9
|
+
ref="rootRef"
|
|
10
|
+
>
|
|
11
|
+
<LoadingIndicator
|
|
12
|
+
v-if="loading"
|
|
13
|
+
:class="{
|
|
14
|
+
'h-3 w-3': size == 'sm',
|
|
15
|
+
'h-[13.5px] w-[13.5px]': size == 'md',
|
|
16
|
+
'h-[15px] w-[15px]': size == 'lg',
|
|
17
|
+
'h-4.5 w-4.5': size == 'xl' || size == '2xl',
|
|
18
|
+
}"
|
|
24
19
|
/>
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
<
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
v-if="
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
20
|
+
<slot name="prefix" v-else-if="$slots['prefix'] || iconLeft">
|
|
21
|
+
<FeatherIcon
|
|
22
|
+
v-if="iconLeft && typeof iconLeft === 'string'"
|
|
23
|
+
:name="iconLeft"
|
|
24
|
+
:class="slotClasses"
|
|
25
|
+
aria-hidden="true"
|
|
26
|
+
/>
|
|
27
|
+
<component v-else-if="iconLeft" :is="iconLeft" :class="slotClasses" />
|
|
28
|
+
</slot>
|
|
29
|
+
|
|
30
|
+
<template v-if="loading && loadingText">{{ loadingText }}</template>
|
|
31
|
+
<template v-else-if="isIconButton && !loading">
|
|
32
|
+
<FeatherIcon
|
|
33
|
+
v-if="icon && typeof icon === 'string'"
|
|
34
|
+
:name="icon"
|
|
35
|
+
:class="slotClasses"
|
|
36
|
+
:aria-label="label"
|
|
37
|
+
/>
|
|
38
|
+
<component v-else-if="icon" :is="icon" :class="slotClasses" />
|
|
39
|
+
<slot name="icon" v-else-if="$slots.icon" />
|
|
40
|
+
<div v-else-if="hasLucideIconInDefaultSlot" :class="slotClasses">
|
|
41
|
+
<slot>{{ label }}</slot>
|
|
42
|
+
</div>
|
|
43
|
+
</template>
|
|
44
|
+
<span v-else :class="{ 'sr-only': isIconButton }" class="truncate">
|
|
45
|
+
<slot>{{ label }}</slot>
|
|
46
|
+
</span>
|
|
47
|
+
|
|
48
|
+
<slot name="suffix">
|
|
49
|
+
<FeatherIcon
|
|
50
|
+
v-if="iconRight && typeof iconRight === 'string'"
|
|
51
|
+
:name="iconRight"
|
|
52
|
+
:class="slotClasses"
|
|
53
|
+
aria-hidden="true"
|
|
54
|
+
/>
|
|
55
|
+
<component
|
|
56
|
+
v-else-if="iconRight"
|
|
57
|
+
:is="iconRight"
|
|
58
|
+
:class="slotClasses"
|
|
59
|
+
/>
|
|
60
|
+
</slot>
|
|
61
|
+
</button>
|
|
62
|
+
</Tooltip>
|
|
53
63
|
</template>
|
|
54
64
|
<script lang="ts" setup>
|
|
55
|
-
import { computed, useSlots } from 'vue'
|
|
65
|
+
import { computed, useSlots, ref } from 'vue'
|
|
56
66
|
import FeatherIcon from '../FeatherIcon.vue'
|
|
57
67
|
import LoadingIndicator from '../LoadingIndicator.vue'
|
|
58
68
|
import { useRouter } from 'vue-router'
|
|
59
69
|
import type { ButtonProps, ThemeVariant } from './types'
|
|
70
|
+
import Tooltip from '../Tooltip/Tooltip.vue'
|
|
71
|
+
|
|
72
|
+
defineOptions({ inheritAttrs: false })
|
|
60
73
|
|
|
61
74
|
const props = withDefaults(defineProps<ButtonProps>(), {
|
|
62
75
|
theme: 'gray',
|
|
@@ -164,7 +177,7 @@ const buttonClasses = computed(() => {
|
|
|
164
177
|
}
|
|
165
178
|
|
|
166
179
|
return [
|
|
167
|
-
'inline-flex items-center justify-center gap-2 transition-colors focus:outline-none',
|
|
180
|
+
'inline-flex items-center justify-center gap-2 transition-colors focus:outline-none shrink-0',
|
|
168
181
|
isDisabled.value ? disabledClasses : variantClasses,
|
|
169
182
|
focusClasses,
|
|
170
183
|
sizeClasses,
|
|
@@ -192,7 +205,24 @@ const ariaLabel = computed(() => {
|
|
|
192
205
|
})
|
|
193
206
|
|
|
194
207
|
const isIconButton = computed(() => {
|
|
195
|
-
return props.icon || slots.icon
|
|
208
|
+
return props.icon || slots.icon || hasLucideIconInDefaultSlot.value
|
|
209
|
+
})
|
|
210
|
+
|
|
211
|
+
const hasLucideIconInDefaultSlot = computed(() => {
|
|
212
|
+
if (!slots.default) return false
|
|
213
|
+
|
|
214
|
+
const slotContent = slots.default()
|
|
215
|
+
if (!Array.isArray(slotContent)) return false
|
|
216
|
+
// if the slot contains only one element and it's a lucide icon
|
|
217
|
+
// render it as an icon button
|
|
218
|
+
let firstVNode = slotContent[0]
|
|
219
|
+
if (
|
|
220
|
+
typeof firstVNode.type?.name == 'string' &&
|
|
221
|
+
firstVNode.type?.name?.startsWith('lucide-')
|
|
222
|
+
) {
|
|
223
|
+
return true
|
|
224
|
+
}
|
|
225
|
+
return false
|
|
196
226
|
})
|
|
197
227
|
|
|
198
228
|
const handleClick = () => {
|
|
@@ -202,4 +232,7 @@ const handleClick = () => {
|
|
|
202
232
|
return window.open(props.link, '_blank')
|
|
203
233
|
}
|
|
204
234
|
}
|
|
235
|
+
|
|
236
|
+
const rootRef = ref()
|
|
237
|
+
defineExpose({ rootRef })
|
|
205
238
|
</script>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type RouterLinkProps } from 'vue-router'
|
|
2
2
|
import { type Component } from 'vue'
|
|
3
3
|
|
|
4
4
|
type Theme = 'gray' | 'blue' | 'green' | 'red'
|
|
@@ -13,10 +13,11 @@ export interface ButtonProps {
|
|
|
13
13
|
icon?: string | Component
|
|
14
14
|
iconLeft?: string | Component
|
|
15
15
|
iconRight?: string | Component
|
|
16
|
+
tooltip?: string
|
|
16
17
|
loading?: boolean
|
|
17
18
|
loadingText?: string
|
|
18
19
|
disabled?: boolean
|
|
19
|
-
route?:
|
|
20
|
+
route?: RouterLinkProps['to']
|
|
20
21
|
link?: string
|
|
21
22
|
}
|
|
22
23
|
|
|
@@ -89,9 +89,9 @@ import { TabButtons } from '../TabButtons'
|
|
|
89
89
|
import {
|
|
90
90
|
getCalendarDates,
|
|
91
91
|
monthList,
|
|
92
|
-
handleSeconds,
|
|
93
92
|
parseDate,
|
|
94
93
|
} from './calendarUtils'
|
|
94
|
+
import { dayjs } from "../../utils/dayjs"
|
|
95
95
|
import CalendarMonthly from './CalendarMonthly.vue'
|
|
96
96
|
import CalendarWeekly from './CalendarWeekly.vue'
|
|
97
97
|
import CalendarDaily from './CalendarDaily.vue'
|
|
@@ -178,8 +178,8 @@ const parseEvents = computed(() => {
|
|
|
178
178
|
props.events?.map((event) => {
|
|
179
179
|
const { fromDate, toDate, ...rest } = event
|
|
180
180
|
const date = parseDate(fromDate)
|
|
181
|
-
const from_time =
|
|
182
|
-
const to_time =
|
|
181
|
+
const from_time = dayjs(fromDate).format("HH:mm:ss")
|
|
182
|
+
const to_time = dayjs(toDate).format("HH:mm:ss")
|
|
183
183
|
if (event.isFullDay) {
|
|
184
184
|
return { ...rest, date }
|
|
185
185
|
}
|
|
@@ -193,14 +193,6 @@ function reloadEvents() {
|
|
|
193
193
|
events.value = parseEvents.value
|
|
194
194
|
}
|
|
195
195
|
|
|
196
|
-
events.value.forEach((event) => {
|
|
197
|
-
if (!event.from_time || !event.to_time) {
|
|
198
|
-
return
|
|
199
|
-
}
|
|
200
|
-
event.from_time = handleSeconds(event.from_time)
|
|
201
|
-
event.to_time = handleSeconds(event.to_time)
|
|
202
|
-
})
|
|
203
|
-
|
|
204
196
|
const { showEventModal, newEvent, openNewEventModal } = useEventModal()
|
|
205
197
|
|
|
206
198
|
provide('calendarActions', {
|
|
@@ -3,46 +3,52 @@
|
|
|
3
3
|
class="flex max-h-[140px] items-center gap-2 overflow-hidden bg-surface-white text-ink-gray-8 px-6 pt-5"
|
|
4
4
|
:class="config.delta ? 'pb-6' : 'pb-3'"
|
|
5
5
|
>
|
|
6
|
-
<
|
|
7
|
-
<
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
<slot name="body">
|
|
7
|
+
<div class="flex w-full flex-col">
|
|
8
|
+
<slot name="title">
|
|
9
|
+
<span class="truncate text-sm font-medium text-ink-gray-5">
|
|
10
|
+
{{ config.title }}
|
|
11
|
+
</span>
|
|
12
|
+
</slot>
|
|
13
|
+
<slot name="subtitle" v-bind="{ formatValue }">
|
|
14
|
+
<div
|
|
15
|
+
class="flex-1 flex-shrink-0 truncate text-[24px] text-ink-gray-6 font-semibold leading-10"
|
|
16
|
+
>
|
|
17
|
+
{{ config.prefix }}{{ formatValue(config.value, 1, true)
|
|
18
|
+
}}{{ config.suffix }}
|
|
19
|
+
</div>
|
|
20
|
+
</slot>
|
|
21
|
+
<slot name="delta" v-bind="{ formatValue }">
|
|
22
|
+
<div
|
|
23
|
+
v-if="config.delta"
|
|
24
|
+
class="flex items-center gap-0.5 text-xs font-medium"
|
|
25
|
+
:class="[
|
|
26
|
+
config.negativeIsBetter
|
|
27
|
+
? config.delta >= 0
|
|
28
|
+
? 'text-ink-red-4'
|
|
29
|
+
: 'text-ink-green-3'
|
|
30
|
+
: config.delta >= 0
|
|
31
|
+
? 'text-ink-green-3'
|
|
32
|
+
: 'text-ink-red-4',
|
|
33
|
+
]"
|
|
34
|
+
>
|
|
35
|
+
<span class="">
|
|
36
|
+
{{ config.delta >= 0 ? '↑' : '↓' }}
|
|
37
|
+
</span>
|
|
38
|
+
<span>
|
|
39
|
+
{{ config.deltaPrefix }}{{ formatValue(config.delta, 1, true)
|
|
40
|
+
}}{{ config.deltaSuffix }}
|
|
41
|
+
</span>
|
|
42
|
+
</div>
|
|
43
|
+
</slot>
|
|
15
44
|
</div>
|
|
16
|
-
|
|
17
|
-
v-if="config.delta"
|
|
18
|
-
class="flex items-center gap-0.5 text-xs font-medium"
|
|
19
|
-
:class="[
|
|
20
|
-
config.negativeIsBetter
|
|
21
|
-
? config.delta >= 0
|
|
22
|
-
? 'text-red-500'
|
|
23
|
-
: 'text-green-500'
|
|
24
|
-
: config.delta >= 0
|
|
25
|
-
? 'text-green-500'
|
|
26
|
-
: 'text-red-500',
|
|
27
|
-
]"
|
|
28
|
-
>
|
|
29
|
-
<span class="">
|
|
30
|
-
{{ config.delta >= 0 ? '↑' : '↓' }}
|
|
31
|
-
</span>
|
|
32
|
-
<span>
|
|
33
|
-
{{ config.deltaPrefix }}{{ formatValue(config.delta, 1, true)
|
|
34
|
-
}}{{ config.deltaSuffix }}
|
|
35
|
-
</span>
|
|
36
|
-
</div>
|
|
37
|
-
</div>
|
|
45
|
+
</slot>
|
|
38
46
|
</div>
|
|
39
47
|
</template>
|
|
40
48
|
|
|
41
49
|
<script setup lang="ts">
|
|
42
|
-
import { ref } from 'vue'
|
|
43
50
|
import { formatValue } from './helpers'
|
|
44
51
|
import { NumberChartConfig } from './types'
|
|
45
52
|
|
|
46
|
-
|
|
47
|
-
const error = ref('')
|
|
53
|
+
defineProps<{ config: NumberChartConfig }>()
|
|
48
54
|
</script>
|
|
@@ -94,7 +94,7 @@ export default function useDonutChartOptions(config: DonutChartConfig) {
|
|
|
94
94
|
},
|
|
95
95
|
textStyle: {
|
|
96
96
|
padding: [0, 0, 0, -5],
|
|
97
|
-
color: '
|
|
97
|
+
color: 'var(--ink-gray-8)',
|
|
98
98
|
},
|
|
99
99
|
icon: 'circle',
|
|
100
100
|
pageIcons: {
|
|
@@ -103,11 +103,11 @@ export default function useDonutChartOptions(config: DonutChartConfig) {
|
|
|
103
103
|
'M 12 27 h -2 c -0.386 0 -0.738 -0.223 -0.904 -0.572 s -0.115 -0.762 0.13 -1.062 L 17.708 15 L 9.226 4.633 c -0.245 -0.299 -0.295 -0.712 -0.13 -1.062 S 9.614 3 10 3 h 2 c 0.3 0 0.584 0.135 0.774 0.367 l 9 11 c 0.301 0.369 0.301 0.898 0 1.267 l -9 11 C 12.584 26.865 12.3 27 12 27 Z',
|
|
104
104
|
],
|
|
105
105
|
},
|
|
106
|
-
pageIconColor: '
|
|
107
|
-
pageInactiveColor: '
|
|
106
|
+
pageIconColor: 'var(--ink-gray-6)',
|
|
107
|
+
pageInactiveColor: 'var(--ink-gray-4)',
|
|
108
108
|
pageIconSize: 10,
|
|
109
109
|
pageTextStyle: {
|
|
110
|
-
color: '
|
|
110
|
+
color: 'var(--ink-gray-6)',
|
|
111
111
|
},
|
|
112
112
|
animationDurationUpdate: 300,
|
|
113
113
|
}
|
|
@@ -110,7 +110,7 @@ export default function useEchartsOptions(config: AxisChartConfig) {
|
|
|
110
110
|
},
|
|
111
111
|
textStyle: {
|
|
112
112
|
padding: [0, 0, 0, -5],
|
|
113
|
-
color: '
|
|
113
|
+
color: 'var(--ink-gray-8)',
|
|
114
114
|
},
|
|
115
115
|
icon: 'circle',
|
|
116
116
|
pageIcons: {
|
|
@@ -119,11 +119,11 @@ export default function useEchartsOptions(config: AxisChartConfig) {
|
|
|
119
119
|
'M 12 27 h -2 c -0.386 0 -0.738 -0.223 -0.904 -0.572 s -0.115 -0.762 0.13 -1.062 L 17.708 15 L 9.226 4.633 c -0.245 -0.299 -0.295 -0.712 -0.13 -1.062 S 9.614 3 10 3 h 2 c 0.3 0 0.584 0.135 0.774 0.367 l 9 11 c 0.301 0.369 0.301 0.898 0 1.267 l -9 11 C 12.584 26.865 12.3 27 12 27 Z',
|
|
120
120
|
],
|
|
121
121
|
},
|
|
122
|
-
pageIconColor: '
|
|
123
|
-
pageInactiveColor: '
|
|
122
|
+
pageIconColor: 'var(--ink-gray-6)',
|
|
123
|
+
pageInactiveColor: 'var(--ink-gray-4)',
|
|
124
124
|
pageIconSize: 10,
|
|
125
125
|
pageTextStyle: {
|
|
126
|
-
color: '
|
|
126
|
+
color: 'var(--ink-gray-6)',
|
|
127
127
|
},
|
|
128
128
|
animationDurationUpdate: 300,
|
|
129
129
|
},
|
|
@@ -142,13 +142,13 @@ export function getTitleOptions(title: string, subtitle?: string) {
|
|
|
142
142
|
fontSize: 14,
|
|
143
143
|
fontWeight: 500,
|
|
144
144
|
lineHeight: 24,
|
|
145
|
-
|
|
145
|
+
color: 'var(--ink-gray-8)',
|
|
146
146
|
},
|
|
147
147
|
subtextStyle: {
|
|
148
148
|
fontSize: 13,
|
|
149
149
|
fontWeight: 400,
|
|
150
150
|
lineHeight: 20,
|
|
151
|
-
|
|
151
|
+
color: 'var(--ink-gray-6)',
|
|
152
152
|
},
|
|
153
153
|
}
|
|
154
154
|
}
|
|
@@ -169,14 +169,17 @@ function getXAxisOptions(config: AxisChartConfig) {
|
|
|
169
169
|
align: 'right',
|
|
170
170
|
verticalAlign: 'bottom',
|
|
171
171
|
padding: [0, 0, 26, 0],
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
172
|
+
backgroundColor: 'var(--surface-white)',
|
|
173
|
+
borderColor: 'var(--surface-white)',
|
|
174
|
+
color: 'var(--ink-gray-8)',
|
|
175
175
|
borderWidth: 4,
|
|
176
176
|
},
|
|
177
177
|
splitLine: {
|
|
178
178
|
show: true,
|
|
179
179
|
width: 1,
|
|
180
|
+
lineStyle: {
|
|
181
|
+
color: 'var(--ink-gray-3)',
|
|
182
|
+
},
|
|
180
183
|
},
|
|
181
184
|
axisLine: {
|
|
182
185
|
show: false,
|
|
@@ -261,14 +264,17 @@ function getYAxisOptions(config: AxisChartConfig) {
|
|
|
261
264
|
align: 'left',
|
|
262
265
|
verticalAlign: 'top',
|
|
263
266
|
padding: [0, 0, 0, -2],
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
+
backgroundColor: 'var(--surface-white)',
|
|
268
|
+
borderColor: 'var(--surface-white)',
|
|
269
|
+
color: 'var(--ink-gray-8)',
|
|
267
270
|
borderWidth: 4,
|
|
268
271
|
},
|
|
269
272
|
splitLine: {
|
|
270
273
|
show: true,
|
|
271
274
|
width: 1,
|
|
275
|
+
lineStyle: {
|
|
276
|
+
color: 'var(--ink-gray-3)',
|
|
277
|
+
},
|
|
272
278
|
},
|
|
273
279
|
axisLine: {
|
|
274
280
|
show: false,
|
|
@@ -308,13 +314,17 @@ function getYAxisOptions(config: AxisChartConfig) {
|
|
|
308
314
|
align: 'right',
|
|
309
315
|
verticalAlign: 'top',
|
|
310
316
|
padding: [0, 5, 0, 0],
|
|
311
|
-
|
|
312
|
-
|
|
317
|
+
backgroundColor: 'var(--surface-white)',
|
|
318
|
+
borderColor: 'var(--surface-white)',
|
|
319
|
+
color: 'var(--ink-gray-8)',
|
|
313
320
|
},
|
|
314
321
|
nameGap: 6,
|
|
315
322
|
splitLine: {
|
|
316
323
|
show: true,
|
|
317
324
|
width: 1,
|
|
325
|
+
lineStyle: {
|
|
326
|
+
color: 'var(--ink-gray-3)',
|
|
327
|
+
},
|
|
318
328
|
},
|
|
319
329
|
axisLine: {
|
|
320
330
|
show: false,
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<label v-if="props.label" class="block text-xs text-ink-gray-5">
|
|
10
10
|
{{ props.label }}
|
|
11
11
|
</label>
|
|
12
|
-
|
|
12
|
+
<TextInput
|
|
13
13
|
readonly
|
|
14
14
|
type="text"
|
|
15
15
|
:placeholder="placeholder"
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
<TextInput
|
|
58
58
|
class="text-sm"
|
|
59
59
|
type="text"
|
|
60
|
-
:value="dateValue"
|
|
60
|
+
:value="dateValue && formatter ? formatter(dateValue) : dateValue"
|
|
61
61
|
@change="selectDate(getDate($event.target.value))"
|
|
62
62
|
/>
|
|
63
63
|
<Button
|