@globalbrain/sefirot 3.50.0 → 4.0.0-0
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/config/nuxt.d.ts +4 -0
- package/config/nuxt.js +31 -0
- package/config/vite.d.ts +8 -0
- package/config/vite.js +69 -0
- package/lib/components/SActionList.vue +0 -1
- package/lib/components/SActionListItem.vue +3 -11
- package/lib/components/SAlert.vue +8 -13
- package/lib/components/SButton.vue +9 -10
- package/lib/components/SCardBlock.vue +0 -6
- package/lib/components/SControlActionBarClose.vue +1 -1
- package/lib/components/SControlActionBarCollapse.vue +2 -2
- package/lib/components/SControlInputSearch.vue +2 -2
- package/lib/components/SDescAvatar.vue +1 -2
- package/lib/components/SDescFile.vue +4 -6
- package/lib/components/SDescPill.vue +1 -2
- package/lib/components/SDescText.vue +1 -1
- package/lib/components/SDropdownSectionDateRange.vue +2 -2
- package/lib/components/SDropdownSectionDateRangeDateFromTo.vue +2 -2
- package/lib/components/SDropdownSectionDateRangeYear.vue +2 -2
- package/lib/components/SDropdownSectionDateRangeYearHalf.vue +2 -2
- package/lib/components/SDropdownSectionDateRangeYearQuarter.vue +2 -2
- package/lib/components/SDropdownSectionFilter.vue +4 -6
- package/lib/components/SIndicator.vue +10 -16
- package/lib/components/SInputAddon.vue +6 -8
- package/lib/components/SInputBase.vue +6 -8
- package/lib/components/SInputCheckbox.vue +7 -11
- package/lib/components/SInputCheckboxes.vue +3 -4
- package/lib/components/SInputDate.vue +3 -4
- package/lib/components/SInputDropdown.vue +10 -13
- package/lib/components/SInputDropdownItemAvatar.vue +2 -3
- package/lib/components/SInputDropdownItemText.vue +2 -3
- package/lib/components/SInputFile.vue +3 -4
- package/lib/components/SInputHMS.vue +4 -5
- package/lib/components/SInputImage.vue +5 -7
- package/lib/components/SInputNumber.vue +10 -11
- package/lib/components/SInputRadio.vue +3 -4
- package/lib/components/SInputRadios.vue +3 -4
- package/lib/components/SInputSegments.vue +3 -4
- package/lib/components/SInputSelect.vue +7 -9
- package/lib/components/SInputSwitch.vue +3 -4
- package/lib/components/SInputSwitches.vue +3 -4
- package/lib/components/SInputText.vue +7 -9
- package/lib/components/SInputTextarea.vue +3 -4
- package/lib/components/SInputYMD.vue +4 -5
- package/lib/components/SLink.vue +1 -1
- package/lib/components/SLocalNavMenu.vue +3 -4
- package/lib/components/SLoginPage.vue +3 -3
- package/lib/components/SLoginPagePasswordDialog.vue +4 -4
- package/lib/components/SPagination.vue +2 -2
- package/lib/components/SPill.vue +1 -5
- package/lib/components/SSnackbar.vue +2 -3
- package/lib/components/SStep.vue +4 -5
- package/lib/components/STable.vue +1 -2
- package/lib/components/STableCell.vue +5 -13
- package/lib/components/STableCellAvatar.vue +10 -27
- package/lib/components/STableCellAvatars.vue +6 -19
- package/lib/components/STableCellDay.vue +4 -11
- package/lib/components/STableCellNumber.vue +8 -9
- package/lib/components/STableCellPill.vue +5 -33
- package/lib/components/STableCellPills.vue +4 -14
- package/lib/components/STableCellState.vue +3 -3
- package/lib/components/STableCellText.vue +22 -50
- package/lib/components/STableColumn.vue +4 -6
- package/lib/components/STableFooter.vue +4 -5
- package/lib/components/STableHeader.vue +2 -19
- package/lib/components/STableHeaderMenu.vue +1 -2
- package/lib/components/STableHeaderMenuItem.vue +2 -3
- package/lib/components/STableItem.vue +1 -1
- package/lib/composables/Data.ts +8 -102
- package/lib/composables/Error.ts +3 -3
- package/lib/composables/Table.ts +17 -22
- package/lib/composables/Utils.ts +2 -2
- package/lib/composables/Validation.ts +76 -14
- package/lib/http/Http.ts +27 -10
- package/lib/mixins/Card.ts +0 -27
- package/lib/mixins/Fundamental.ts +0 -3
- package/lib/support/Day.ts +5 -5
- package/lib/support/Utils.ts +35 -14
- package/lib/validation/validators/maxLength.ts +2 -2
- package/lib/validation/validators/maxValue.ts +2 -2
- package/lib/validation/validators/minLength.ts +2 -2
- package/lib/validation/validators/minValue.ts +2 -2
- package/lib/validation/validators/required.ts +4 -4
- package/package.json +40 -40
- package/lib/components/SCardFooter.vue +0 -22
- package/lib/components/SCardFooterAction.vue +0 -31
- package/lib/components/SCardFooterActions.vue +0 -18
- package/lib/components/SCardHeader.vue +0 -15
- package/lib/components/SCardHeaderAction.vue +0 -28
- package/lib/components/SCardHeaderActionClose.vue +0 -27
- package/lib/components/SCardHeaderActionCollapse.vue +0 -47
- package/lib/components/SCardHeaderActions.vue +0 -13
- package/lib/components/SCardHeaderTitle.vue +0 -29
- package/lib/components/SIcon.vue +0 -13
- package/lib/components/SSheet.vue +0 -87
- package/lib/components/SSheetFooter.vue +0 -16
- package/lib/components/SSheetFooterAction.vue +0 -34
- package/lib/components/SSheetFooterActions.vue +0 -14
- package/lib/components/SSheetForm.vue +0 -15
- package/lib/components/SSheetMedium.vue +0 -72
- package/lib/components/SSheetTitle.vue +0 -13
- package/lib/components/STableHeaderActions.vue +0 -20
- package/lib/composables/D.ts +0 -21
- package/lib/composables/Form.ts +0 -109
- package/lib/composables/V.ts +0 -97
- package/lib/mixins/Sheet.ts +0 -30
package/config/nuxt.d.ts
ADDED
package/config/nuxt.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
import { fileURLToPath } from 'node:url'
|
|
4
|
+
import icons from 'unplugin-icons/nuxt'
|
|
5
|
+
import { mergeConfig } from 'vite'
|
|
6
|
+
import { baseConfig as baseViteConfig } from './vite.js'
|
|
7
|
+
|
|
8
|
+
delete baseViteConfig.plugins
|
|
9
|
+
delete baseViteConfig.resolve?.alias
|
|
10
|
+
|
|
11
|
+
export const baseConfig = {
|
|
12
|
+
alias: { sefirot: fileURLToPath(new URL('../lib', import.meta.url)) },
|
|
13
|
+
app: { teleportId: 'sefirot-modals' },
|
|
14
|
+
modules: [
|
|
15
|
+
/**
|
|
16
|
+
* @param {any} _
|
|
17
|
+
* @param {any} nuxt
|
|
18
|
+
*/
|
|
19
|
+
function (_, nuxt) {
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-invalid-this
|
|
21
|
+
return icons.bind(this, { scale: 1 }, nuxt)()
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
postcss: { plugins: { 'postcss-nested': {} } },
|
|
25
|
+
telemetry: false,
|
|
26
|
+
vite: baseViteConfig
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function defineConfig(config = {}) {
|
|
30
|
+
return mergeConfig(baseConfig, config)
|
|
31
|
+
}
|
package/config/vite.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
declare const baseConfig: import('vite').UserConfig
|
|
2
|
+
|
|
3
|
+
declare function defineConfig(config?: import('vite').UserConfig): import('vite').UserConfig
|
|
4
|
+
declare function defineConfig(config?: Promise<import('vite').UserConfig>): Promise<import('vite').UserConfig>
|
|
5
|
+
declare function defineConfig(config?: import('vite').UserConfigFnObject): import('vite').UserConfigFnObject
|
|
6
|
+
declare function defineConfig(config?: import('vite').UserConfigExport): import('vite').UserConfigExport
|
|
7
|
+
|
|
8
|
+
export { baseConfig, defineConfig }
|
package/config/vite.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Adapted from
|
|
5
|
+
* @see https://github.com/unplugin/unplugin-icons/blob/67fd9b7791dc1754cb8dc46b854b22c8bb4cf380/src/core/compilers/vue3.ts
|
|
6
|
+
* @see https://github.com/unplugin/unplugin-icons/blob/639ec9691e022e52c641d0f96f585dbf04dab095/src/core/svgId.ts
|
|
7
|
+
*
|
|
8
|
+
* Original licenses:
|
|
9
|
+
*
|
|
10
|
+
* Copyright (c) 2020 Anthony Fu <https://github.com/antfu>
|
|
11
|
+
* @license MIT
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { fileURLToPath } from 'node:url'
|
|
15
|
+
import icons from 'unplugin-icons/vite'
|
|
16
|
+
import { mergeConfig } from 'vite'
|
|
17
|
+
|
|
18
|
+
/** @type {import('vite').UserConfig} */
|
|
19
|
+
export const baseConfig = {
|
|
20
|
+
plugins: [icons({ scale: 1 })],
|
|
21
|
+
|
|
22
|
+
resolve: {
|
|
23
|
+
alias: { 'sefirot/': fileURLToPath(new URL('../lib/', import.meta.url)) },
|
|
24
|
+
|
|
25
|
+
dedupe: [
|
|
26
|
+
'@sentry/browser',
|
|
27
|
+
'@tanstack/vue-virtual',
|
|
28
|
+
'@tinyhttp/content-disposition',
|
|
29
|
+
'@tinyhttp/cookie',
|
|
30
|
+
'@vue/reactivity',
|
|
31
|
+
'@vuelidate/core',
|
|
32
|
+
'@vuelidate/validators',
|
|
33
|
+
'@vueuse/core',
|
|
34
|
+
'body-scroll-lock',
|
|
35
|
+
'dayjs',
|
|
36
|
+
'file-saver',
|
|
37
|
+
'fuse.js',
|
|
38
|
+
'lodash-es',
|
|
39
|
+
'markdown-it',
|
|
40
|
+
'normalize.css',
|
|
41
|
+
'ofetch',
|
|
42
|
+
'pinia',
|
|
43
|
+
'qs',
|
|
44
|
+
'v-calendar',
|
|
45
|
+
'vue-router',
|
|
46
|
+
'vue'
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
ssr: { noExternal: [/sentry/] },
|
|
51
|
+
|
|
52
|
+
optimizeDeps: {
|
|
53
|
+
include: [
|
|
54
|
+
'dayjs',
|
|
55
|
+
'dayjs/plugin/relativeTime',
|
|
56
|
+
'dayjs/plugin/timezone',
|
|
57
|
+
'dayjs/plugin/utc',
|
|
58
|
+
'markdown-it'
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* @param {import('vite').UserConfigExport} config
|
|
65
|
+
*/
|
|
66
|
+
export function defineConfig(config = {}) {
|
|
67
|
+
return async (/** @type {import("vite").ConfigEnv} */ configEnv) =>
|
|
68
|
+
mergeConfig(baseConfig, await (typeof config === 'function' ? config(configEnv) : config))
|
|
69
|
+
}
|
|
@@ -1,26 +1,18 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { type
|
|
3
|
-
import { computed } from 'vue'
|
|
2
|
+
import { type Component, computed } from 'vue'
|
|
4
3
|
import SButton, { type Tooltip } from './SButton.vue'
|
|
5
4
|
|
|
6
5
|
export interface ActionListItem {
|
|
7
|
-
leadIcon?:
|
|
6
|
+
leadIcon?: Component
|
|
8
7
|
link?: string
|
|
9
8
|
label?: string
|
|
10
9
|
disabled?: boolean
|
|
11
10
|
tooltip?: Tooltip
|
|
12
11
|
onClick?: () => void
|
|
13
|
-
|
|
14
|
-
/** @deprecated Use `:label` instead. */
|
|
15
|
-
text?: string
|
|
16
12
|
}
|
|
17
13
|
|
|
18
14
|
const props = defineProps<ActionListItem>()
|
|
19
15
|
|
|
20
|
-
const _label = computed(() => {
|
|
21
|
-
return props.label ?? props.text
|
|
22
|
-
})
|
|
23
|
-
|
|
24
16
|
const _tooltip = computed<Tooltip | undefined>(() => {
|
|
25
17
|
return props.tooltip ? { display: 'block', ...props.tooltip } : undefined
|
|
26
18
|
})
|
|
@@ -33,7 +25,7 @@ const _tooltip = computed<Tooltip | undefined>(() => {
|
|
|
33
25
|
size="small"
|
|
34
26
|
type="text"
|
|
35
27
|
:icon="leadIcon"
|
|
36
|
-
:label="
|
|
28
|
+
:label="label"
|
|
37
29
|
:href="link"
|
|
38
30
|
:disabled="disabled"
|
|
39
31
|
:tooltip="_tooltip"
|
|
@@ -1,28 +1,23 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import
|
|
3
|
-
import IconInfo from '
|
|
4
|
-
import IconWarning from '
|
|
5
|
-
import
|
|
6
|
-
import SIcon from './SIcon.vue'
|
|
2
|
+
import IconCheck from '~icons/ph/check-bold'
|
|
3
|
+
import IconInfo from '~icons/ph/info-bold'
|
|
4
|
+
import IconWarning from '~icons/ph/warning-bold'
|
|
5
|
+
import IconWarningOctagon from '~icons/ph/warning-octagon-bold'
|
|
7
6
|
|
|
8
7
|
withDefaults(defineProps<{
|
|
9
8
|
mode?: 'info' | 'success' | 'warning' | 'danger'
|
|
10
9
|
}>(), {
|
|
11
10
|
mode: 'info'
|
|
12
11
|
})
|
|
13
|
-
|
|
14
|
-
const iconDict = {
|
|
15
|
-
info: IconInfo,
|
|
16
|
-
success: IconSuccess,
|
|
17
|
-
warning: IconWarning,
|
|
18
|
-
danger: IconDanger
|
|
19
|
-
} as const
|
|
20
12
|
</script>
|
|
21
13
|
|
|
22
14
|
<template>
|
|
23
15
|
<div class="SAlert" :class="[mode]">
|
|
24
16
|
<div class="icon">
|
|
25
|
-
<
|
|
17
|
+
<IconInfo v-if="mode === 'info'" class="icon-svg" />
|
|
18
|
+
<IconCheck v-if="mode === 'success'" class="icon-svg" />
|
|
19
|
+
<IconWarning v-if="mode === 'warning'" class="icon-svg" />
|
|
20
|
+
<IconWarningOctagon v-if="mode === 'danger'" class="icon-svg" />
|
|
26
21
|
</div>
|
|
27
22
|
<div class="content">
|
|
28
23
|
<slot />
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { type MaybeRef, computed, unref, useSlots } from 'vue'
|
|
2
|
+
import { type Component, type MaybeRef, computed, unref, useSlots } from 'vue'
|
|
3
3
|
import { type Position } from '../composables/Tooltip'
|
|
4
4
|
import SFragment from './SFragment.vue'
|
|
5
|
-
import SIcon from './SIcon.vue'
|
|
6
5
|
import SLink from './SLink.vue'
|
|
7
6
|
import SSpinner from './SSpinner.vue'
|
|
8
7
|
import STooltip from './STooltip.vue'
|
|
@@ -37,9 +36,9 @@ const props = defineProps<{
|
|
|
37
36
|
size?: Size
|
|
38
37
|
type?: Type
|
|
39
38
|
mode?: Mode
|
|
40
|
-
icon?:
|
|
41
|
-
leadIcon?:
|
|
42
|
-
trailIcon?:
|
|
39
|
+
icon?: Component
|
|
40
|
+
leadIcon?: Component
|
|
41
|
+
trailIcon?: Component
|
|
43
42
|
iconMode?: Mode
|
|
44
43
|
label?: string
|
|
45
44
|
labelMode?: Mode
|
|
@@ -62,9 +61,9 @@ const classes = computed(() => [
|
|
|
62
61
|
props.size ?? 'medium',
|
|
63
62
|
props.type ?? 'fill',
|
|
64
63
|
props.mode ?? 'default',
|
|
65
|
-
{ 'has-label': props.label },
|
|
66
|
-
{ 'has-lead-icon': _leadIcon.value },
|
|
67
|
-
{ 'has-trail-icon': props.trailIcon },
|
|
64
|
+
{ 'has-label': !!props.label },
|
|
65
|
+
{ 'has-lead-icon': !!_leadIcon.value },
|
|
66
|
+
{ 'has-trail-icon': !!props.trailIcon },
|
|
68
67
|
{ loading: props.loading },
|
|
69
68
|
{ rounded: props.rounded },
|
|
70
69
|
{ block: props.block },
|
|
@@ -115,13 +114,13 @@ function handleClick(): void {
|
|
|
115
114
|
>
|
|
116
115
|
<span class="content">
|
|
117
116
|
<span v-if="_leadIcon" class="icon" :class="iconMode">
|
|
118
|
-
<
|
|
117
|
+
<component :is="_leadIcon" class="icon-svg" />
|
|
119
118
|
</span>
|
|
120
119
|
<span v-if="label" class="label" :class="labelMode">
|
|
121
120
|
{{ label }}
|
|
122
121
|
</span>
|
|
123
122
|
<span v-if="trailIcon" class="icon" :class="iconMode">
|
|
124
|
-
<
|
|
123
|
+
<component :is="trailIcon" class="icon-svg" />
|
|
125
124
|
</span>
|
|
126
125
|
</span>
|
|
127
126
|
|
|
@@ -11,15 +11,9 @@ export type Bg =
|
|
|
11
11
|
| 'elv-4'
|
|
12
12
|
| 'none'
|
|
13
13
|
|
|
14
|
-
// @deprecated Use CSS utility classes instead.
|
|
15
|
-
export type Space = 'compact' | 'wide' | 'xwide'
|
|
16
|
-
|
|
17
14
|
const props = withDefaults(defineProps<{
|
|
18
15
|
size?: CardBlockSize
|
|
19
16
|
bg?: Bg
|
|
20
|
-
|
|
21
|
-
// @deprecated Use CSS utility classes instead.
|
|
22
|
-
space?: Space
|
|
23
17
|
}>(), {
|
|
24
18
|
bg: 'elv-3'
|
|
25
19
|
})
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import IconArrowsInLineVertical from '@iconify-icons/ph/arrows-in-line-vertical-bold'
|
|
3
|
-
import IconArrowsOutLineVertical from '@iconify-icons/ph/arrows-out-line-vertical-bold'
|
|
4
2
|
import { computed, shallowRef } from 'vue'
|
|
5
3
|
import { useCardState } from '../composables/Card'
|
|
6
4
|
import SControlActionBarButton from './SControlActionBarButton.vue'
|
|
5
|
+
import IconArrowsInLineVertical from '~icons/ph/arrows-in-line-vertical-bold'
|
|
6
|
+
import IconArrowsOutLineVertical from '~icons/ph/arrows-out-line-vertical-bold'
|
|
7
7
|
|
|
8
8
|
const props = defineProps<{
|
|
9
9
|
as?: string
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import IconMagnifyingGlass from '@iconify-icons/ph/magnifying-glass-bold'
|
|
3
2
|
import { computed } from 'vue'
|
|
4
3
|
import { useControlSize } from '../composables/Control'
|
|
5
4
|
import { useTrans } from '../composables/Lang'
|
|
6
|
-
import { type Validatable } from '../composables/
|
|
5
|
+
import { type Validatable } from '../composables/Validation'
|
|
7
6
|
import SInputText, { type Align, type TextColor } from './SInputText.vue'
|
|
7
|
+
import IconMagnifyingGlass from '~icons/ph/magnifying-glass-bold'
|
|
8
8
|
|
|
9
9
|
const props = defineProps<{
|
|
10
10
|
placeholder?: string
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed } from 'vue'
|
|
3
|
-
import { isArray } from '../support/Utils'
|
|
4
3
|
import SAvatar from './SAvatar.vue'
|
|
5
4
|
import SDescEmpty from './SDescEmpty.vue'
|
|
6
5
|
|
|
@@ -21,7 +20,7 @@ const _avatar = computed(() => {
|
|
|
21
20
|
return null
|
|
22
21
|
}
|
|
23
22
|
|
|
24
|
-
return isArray(props.avatar) ? props.avatar : [props.avatar]
|
|
23
|
+
return Array.isArray(props.avatar) ? props.avatar : [props.avatar]
|
|
25
24
|
})
|
|
26
25
|
</script>
|
|
27
26
|
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import IconDownloadSimple from '@iconify-icons/ph/download-simple-bold'
|
|
3
|
-
import IconFileText from '@iconify-icons/ph/file-text-bold'
|
|
4
2
|
import { computed } from 'vue'
|
|
5
|
-
import { isArray } from '../support/Utils'
|
|
6
3
|
import SButton from './SButton.vue'
|
|
7
4
|
import SDescEmpty from './SDescEmpty.vue'
|
|
8
|
-
import
|
|
5
|
+
import IconDownloadSimple from '~icons/ph/download-simple-bold'
|
|
6
|
+
import IconFileText from '~icons/ph/file-text-bold'
|
|
9
7
|
|
|
10
8
|
export interface Item {
|
|
11
9
|
name: string
|
|
@@ -18,7 +16,7 @@ const props = defineProps<{
|
|
|
18
16
|
|
|
19
17
|
const items = computed(() => {
|
|
20
18
|
return props.item
|
|
21
|
-
? isArray(props.item) ? props.item : [props.item]
|
|
19
|
+
? Array.isArray(props.item) ? props.item : [props.item]
|
|
22
20
|
: null
|
|
23
21
|
})
|
|
24
22
|
</script>
|
|
@@ -28,7 +26,7 @@ const items = computed(() => {
|
|
|
28
26
|
<div class="value">
|
|
29
27
|
<div v-for="item, index in items" :key="index" class="item">
|
|
30
28
|
<div class="data">
|
|
31
|
-
<div class="icon"><
|
|
29
|
+
<div class="icon"><IconFileText class="icon-svg" /></div>
|
|
32
30
|
<div class="name">{{ item.name }}</div>
|
|
33
31
|
</div>
|
|
34
32
|
<div class="actions">
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed } from 'vue'
|
|
3
|
-
import { isArray } from '../support/Utils'
|
|
4
3
|
import SDescEmpty from './SDescEmpty.vue'
|
|
5
4
|
import SPill, { type Mode } from './SPill.vue'
|
|
6
5
|
|
|
@@ -15,7 +14,7 @@ const props = defineProps<{
|
|
|
15
14
|
|
|
16
15
|
const pills = computed(() => {
|
|
17
16
|
return props.pill
|
|
18
|
-
? isArray(props.pill) ? props.pill : [props.pill]
|
|
17
|
+
? Array.isArray(props.pill) ? props.pill : [props.pill]
|
|
19
18
|
: null
|
|
20
19
|
})
|
|
21
20
|
</script>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { type MaybeRefOrGetter, computed, shallowRef, toValue } from 'vue'
|
|
3
3
|
import { type DropdownSectionActionsOption } from '../composables/Dropdown'
|
|
4
4
|
import { useTrans } from '../composables/Lang'
|
|
5
|
-
import {
|
|
5
|
+
import { useValidation } from '../composables/Validation'
|
|
6
6
|
import { DateRange, type DateRangePreset, type DateRangePresetType } from '../support/DateRange'
|
|
7
7
|
import SDropdownSectionActions from './SDropdownSectionActions.vue'
|
|
8
8
|
import SDropdownSectionDateRangeDateFromTo from './SDropdownSectionDateRangeDateFromTo.vue'
|
|
@@ -50,7 +50,7 @@ const actions: DropdownSectionActionsOption[] = [
|
|
|
50
50
|
{ label: t.a_apply, mode: 'info', onClick: onApply }
|
|
51
51
|
]
|
|
52
52
|
|
|
53
|
-
const { validate } =
|
|
53
|
+
const { validate } = useValidation()
|
|
54
54
|
|
|
55
55
|
function onPresetChange(value: any) {
|
|
56
56
|
_range.value = new DateRange().setPreset(value as DateRangePresetType)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { useValidation } from '../composables/Validation'
|
|
3
3
|
import { DateFromTo } from '../support/DateRange'
|
|
4
4
|
import { type Day } from '../support/Day'
|
|
5
5
|
import { required } from '../validation/rules'
|
|
@@ -13,7 +13,7 @@ const emit = defineEmits<{
|
|
|
13
13
|
(e: 'change', value: DateFromTo): void
|
|
14
14
|
}>()
|
|
15
15
|
|
|
16
|
-
const { validation } =
|
|
16
|
+
const { validation } = useValidation(() => ({
|
|
17
17
|
from: props.preset.from,
|
|
18
18
|
to: props.preset.to
|
|
19
19
|
}), {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { useValidation } from '../composables/Validation'
|
|
3
3
|
import { Year } from '../support/DateRange'
|
|
4
4
|
import { maxValue, minValue, required } from '../validation/rules'
|
|
5
5
|
import SInputNumber from './SInputNumber.vue'
|
|
@@ -12,7 +12,7 @@ const emit = defineEmits<{
|
|
|
12
12
|
(e: 'change', value: Year): void
|
|
13
13
|
}>()
|
|
14
14
|
|
|
15
|
-
const { validation } =
|
|
15
|
+
const { validation } = useValidation(() => ({
|
|
16
16
|
year: props.preset.year
|
|
17
17
|
}), {
|
|
18
18
|
year: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { useValidation } from '../composables/Validation'
|
|
3
3
|
import { YearHalf } from '../support/DateRange'
|
|
4
4
|
import { maxValue, minValue, required } from '../validation/rules'
|
|
5
5
|
import SInputNumber from './SInputNumber.vue'
|
|
@@ -13,7 +13,7 @@ const emit = defineEmits<{
|
|
|
13
13
|
(e: 'change', value: YearHalf): void
|
|
14
14
|
}>()
|
|
15
15
|
|
|
16
|
-
const { validation } =
|
|
16
|
+
const { validation } = useValidation(() => ({
|
|
17
17
|
year: props.preset.year
|
|
18
18
|
}), {
|
|
19
19
|
year: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { useValidation } from '../composables/Validation'
|
|
3
3
|
import { YearQuarter } from '../support/DateRange'
|
|
4
4
|
import { maxValue, minValue, required } from '../validation/rules'
|
|
5
5
|
import SInputNumber from './SInputNumber.vue'
|
|
@@ -13,7 +13,7 @@ const emit = defineEmits<{
|
|
|
13
13
|
(e: 'change', value: YearQuarter): void
|
|
14
14
|
}>()
|
|
15
15
|
|
|
16
|
-
const { validation } =
|
|
16
|
+
const { validation } = useValidation(() => ({
|
|
17
17
|
year: props.preset.year
|
|
18
18
|
}), {
|
|
19
19
|
year: {
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import IconCheck from '@iconify-icons/ph/check'
|
|
3
2
|
import Fuse from 'fuse.js'
|
|
4
3
|
import { type MaybeRef, computed, onMounted, ref, unref } from 'vue'
|
|
5
4
|
import { type DropdownSectionFilterOption, type DropdownSectionFilterSelectedValue } from '../composables/Dropdown'
|
|
6
5
|
import { useTrans } from '../composables/Lang'
|
|
7
|
-
import { isArray } from '../support/Utils'
|
|
8
6
|
import SDropdownSectionFilterItem from './SDropdownSectionFilterItem.vue'
|
|
9
|
-
import
|
|
7
|
+
import IconCheck from '~icons/ph/check'
|
|
10
8
|
|
|
11
9
|
const props = defineProps<{
|
|
12
10
|
search?: boolean
|
|
@@ -50,7 +48,7 @@ onMounted(() => {
|
|
|
50
48
|
function isActive(value: any) {
|
|
51
49
|
const selected = unref(props.selected)
|
|
52
50
|
|
|
53
|
-
return isArray(selected)
|
|
51
|
+
return Array.isArray(selected)
|
|
54
52
|
? selected.includes(value)
|
|
55
53
|
: selected === value
|
|
56
54
|
}
|
|
@@ -85,9 +83,9 @@ function handleClick(option: DropdownSectionFilterOption, value: any) {
|
|
|
85
83
|
@keyup.down.prevent="focusNext"
|
|
86
84
|
@click="handleClick(option, option.value)"
|
|
87
85
|
>
|
|
88
|
-
<span v-if="isArray(unref(selected))" class="checkbox">
|
|
86
|
+
<span v-if="Array.isArray(unref(selected))" class="checkbox">
|
|
89
87
|
<span class="checkbox-box">
|
|
90
|
-
<
|
|
88
|
+
<IconCheck class="checkbox-icon" />
|
|
91
89
|
</span>
|
|
92
90
|
</span>
|
|
93
91
|
<span v-else class="radio">
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import IconCheckCircleFill from '@iconify-icons/ph/check-circle-fill'
|
|
3
|
-
import IconCircle from '@iconify-icons/ph/circle-bold'
|
|
4
|
-
import IconCircleDashed from '@iconify-icons/ph/circle-dashed-bold'
|
|
5
|
-
import IconCircleNotch from '@iconify-icons/ph/circle-notch-bold'
|
|
6
|
-
import IconXCircle from '@iconify-icons/ph/x-circle-bold'
|
|
7
2
|
import { computed } from 'vue'
|
|
8
|
-
import
|
|
3
|
+
import IconCheckCircleFill from '~icons/ph/check-circle-fill'
|
|
4
|
+
import IconCircle from '~icons/ph/circle-bold'
|
|
5
|
+
import IconCircleDashed from '~icons/ph/circle-dashed-bold'
|
|
6
|
+
import IconCircleNotch from '~icons/ph/circle-notch-bold'
|
|
7
|
+
import IconXCircle from '~icons/ph/x-circle-bold'
|
|
9
8
|
|
|
10
9
|
export type Size = 'nano' | 'mini' | 'small' | 'medium' | 'large' | 'jumbo'
|
|
11
10
|
export type State = 'pending' | 'ready' | 'queued' | 'running' | 'completed' | 'failed'
|
|
@@ -25,20 +24,15 @@ const classes = computed(() => [
|
|
|
25
24
|
props.state,
|
|
26
25
|
props.mode
|
|
27
26
|
])
|
|
28
|
-
|
|
29
|
-
const stateIconDict = {
|
|
30
|
-
pending: IconCircle,
|
|
31
|
-
ready: IconCircle,
|
|
32
|
-
queued: IconCircleDashed,
|
|
33
|
-
running: IconCircleNotch,
|
|
34
|
-
completed: IconCheckCircleFill,
|
|
35
|
-
failed: IconXCircle
|
|
36
|
-
}
|
|
37
27
|
</script>
|
|
38
28
|
|
|
39
29
|
<template>
|
|
40
30
|
<div class="SIndicator" :class="classes">
|
|
41
|
-
<
|
|
31
|
+
<IconCircle v-if="props.state === 'pending' || props.state === 'ready'" class="icon" />
|
|
32
|
+
<IconCircleDashed v-if="props.state === 'queued'" class="icon" />
|
|
33
|
+
<IconCircleNotch v-if="props.state === 'running'" class="icon" />
|
|
34
|
+
<IconCheckCircleFill v-if="props.state === 'completed'" class="icon" />
|
|
35
|
+
<IconXCircle v-if="props.state === 'failed'" class="icon" />
|
|
42
36
|
</div>
|
|
43
37
|
</template>
|
|
44
38
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import
|
|
3
|
-
import { computed, ref } from 'vue'
|
|
2
|
+
import { type Component, computed, ref } from 'vue'
|
|
4
3
|
import {
|
|
5
4
|
type DropdownSection,
|
|
6
5
|
getSelectedOption,
|
|
@@ -9,10 +8,10 @@ import {
|
|
|
9
8
|
import { useFlyout } from '../composables/Flyout'
|
|
10
9
|
import { isString } from '../support/Utils'
|
|
11
10
|
import SDropdown from './SDropdown.vue'
|
|
12
|
-
import
|
|
11
|
+
import IconCaretDown from '~icons/ph/caret-down-bold'
|
|
13
12
|
|
|
14
13
|
const props = withDefaults(defineProps<{
|
|
15
|
-
label?:
|
|
14
|
+
label?: Component | string
|
|
16
15
|
clickable?: boolean
|
|
17
16
|
dropdown?: DropdownSection[]
|
|
18
17
|
dropdownCaret?: boolean
|
|
@@ -80,20 +79,19 @@ function handleClickButton() {
|
|
|
80
79
|
@click="handleClickButton"
|
|
81
80
|
>
|
|
82
81
|
<span class="action-label">
|
|
83
|
-
<
|
|
82
|
+
<component
|
|
84
83
|
v-if="props.label && !isString(props.label)"
|
|
84
|
+
:is="props.label"
|
|
85
85
|
class="action-icon"
|
|
86
|
-
:icon="props.label"
|
|
87
86
|
/>
|
|
88
87
|
<span v-else>
|
|
89
88
|
{{ props.label ?? selectedOptionLabel }}
|
|
90
89
|
</span>
|
|
91
90
|
</span>
|
|
92
91
|
|
|
93
|
-
<
|
|
92
|
+
<IconCaretDown
|
|
94
93
|
v-if="props.dropdown.length && props.dropdownCaret"
|
|
95
94
|
class="caret"
|
|
96
|
-
:icon="IconCaretDown"
|
|
97
95
|
/>
|
|
98
96
|
</component>
|
|
99
97
|
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { type
|
|
3
|
-
import
|
|
4
|
-
import { type DefineComponent, computed, unref, useSlots } from 'vue'
|
|
5
|
-
import { type Validatable } from '../composables/V'
|
|
6
|
-
import SIcon from './SIcon.vue'
|
|
2
|
+
import { type Component, computed, unref, useSlots } from 'vue'
|
|
3
|
+
import { type Validatable } from '../composables/Validation'
|
|
7
4
|
import STooltip from './STooltip.vue'
|
|
5
|
+
import IconQuestion from '~icons/ph/question'
|
|
8
6
|
|
|
9
7
|
type Color = 'neutral' | 'mute' | 'info' | 'success' | 'warning' | 'danger'
|
|
10
8
|
|
|
@@ -14,7 +12,7 @@ const props = defineProps<{
|
|
|
14
12
|
info?: string
|
|
15
13
|
note?: string
|
|
16
14
|
help?: string
|
|
17
|
-
checkIcon?:
|
|
15
|
+
checkIcon?: Component
|
|
18
16
|
checkText?: string
|
|
19
17
|
checkColor?: Color
|
|
20
18
|
validation?: Validatable
|
|
@@ -61,7 +59,7 @@ function getErrorMsg(validation: Validatable) {
|
|
|
61
59
|
|
|
62
60
|
<STooltip v-if="hasInfo" :text="info" trigger="focus" @click.prevent>
|
|
63
61
|
<div class="label-info">
|
|
64
|
-
<
|
|
62
|
+
<IconQuestion class="label-info-icon" />
|
|
65
63
|
</div>
|
|
66
64
|
<template v-if="$slots.info" #text><slot name="info" /></template>
|
|
67
65
|
</STooltip>
|
|
@@ -69,7 +67,7 @@ function getErrorMsg(validation: Validatable) {
|
|
|
69
67
|
<span class="label-note" :class="{ 'has-info': hasInfo }">{{ note }}</span>
|
|
70
68
|
|
|
71
69
|
<span v-if="checkIcon || checkText" class="check" :class="checkColor || 'neutral'">
|
|
72
|
-
<
|
|
70
|
+
<component v-if="checkIcon" :is="checkIcon" class="check-icon" />
|
|
73
71
|
<span v-if="checkText" class="check-text">{{ checkText }}</span>
|
|
74
72
|
</span>
|
|
75
73
|
</label>
|