@finema/core 1.4.34 → 1.4.36
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/README.md +63 -63
- package/dist/module.d.mts +4 -4
- package/dist/module.d.ts +4 -4
- package/dist/module.json +1 -1
- package/dist/module.mjs +7 -4
- package/dist/runtime/components/Alert.vue +49 -49
- package/dist/runtime/components/Avatar.vue +27 -27
- package/dist/runtime/components/Badge.vue +54 -54
- package/dist/runtime/components/Breadcrumb.vue +45 -45
- package/dist/runtime/components/Button/Group.vue +37 -37
- package/dist/runtime/components/Button/index.vue +77 -77
- package/dist/runtime/components/Card.vue +38 -38
- package/dist/runtime/components/Core.vue +13 -13
- package/dist/runtime/components/Dialog/index.vue +108 -108
- package/dist/runtime/components/Dropdown/index.vue +71 -71
- package/dist/runtime/components/Form/FieldWrapper.vue +23 -23
- package/dist/runtime/components/Form/Fields.vue +147 -136
- package/dist/runtime/components/Form/InputCheckbox/index.vue +21 -21
- package/dist/runtime/components/Form/InputDateTime/index.vue +51 -51
- package/dist/runtime/components/Form/InputRadio/index.vue +27 -27
- package/dist/runtime/components/Form/InputSelect/index.vue +37 -37
- package/dist/runtime/components/Form/InputStatic/index.vue +16 -16
- package/dist/runtime/components/Form/InputText/index.vue +27 -27
- package/dist/runtime/components/Form/InputTextarea/index.vue +25 -25
- package/dist/runtime/components/Form/InputToggle/index.vue +14 -14
- package/dist/runtime/components/Form/InputUploadDropzone/index.vue +170 -0
- package/dist/runtime/components/Form/InputUploadDropzone/types.d.ts +11 -0
- package/dist/runtime/components/Form/InputUploadDropzone/types.mjs +0 -0
- package/dist/runtime/components/Form/InputUploadFileClassic/index.vue +36 -36
- package/dist/runtime/components/Form/InputUploadFileClassicAuto/index.vue +160 -152
- package/dist/runtime/components/Form/index.vue +6 -6
- package/dist/runtime/components/Form/types.d.ts +4 -2
- package/dist/runtime/components/Form/types.mjs +1 -0
- package/dist/runtime/components/Icon.vue +23 -23
- package/dist/runtime/components/Image.vue +36 -36
- package/dist/runtime/components/Loader.vue +14 -14
- package/dist/runtime/components/Modal/index.vue +146 -146
- package/dist/runtime/components/SimplePagination.vue +96 -96
- package/dist/runtime/components/Slideover/index.vue +110 -110
- package/dist/runtime/components/Table/Base.vue +132 -132
- package/dist/runtime/components/Table/ColumnDate.vue +16 -16
- package/dist/runtime/components/Table/ColumnDateTime.vue +30 -30
- package/dist/runtime/components/Table/ColumnImage.vue +13 -13
- package/dist/runtime/components/Table/ColumnNumber.vue +14 -14
- package/dist/runtime/components/Table/Simple.vue +57 -57
- package/dist/runtime/components/Table/index.vue +52 -52
- package/dist/runtime/components/Tabs/index.vue +65 -65
- package/dist/runtime/lib/Requester.d.ts +2 -0
- package/dist/runtime/lib/Requester.mjs +3 -0
- package/dist/runtime/plugin.mjs +4 -2
- package/dist/runtime/types/config.d.ts +1 -1
- package/dist/runtime/types/utils.d.ts +29 -29
- package/dist/runtime/ui.config/breadcrumb.mjs +1 -1
- package/dist/runtime/ui.config/button.mjs +1 -1
- package/dist/runtime/ui.config/index.d.ts +1 -0
- package/dist/runtime/ui.config/index.mjs +1 -0
- package/dist/runtime/ui.config/uploadFileDropzone.d.ts +31 -0
- package/dist/runtime/ui.config/uploadFileDropzone.mjs +31 -0
- package/dist/runtime/ui.css +32 -32
- package/package.json +86 -86
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<Base
|
|
3
|
-
v-bind="$attrs"
|
|
4
|
-
:columns="options.columns"
|
|
5
|
-
:raw-data="itemsByPage"
|
|
6
|
-
:status="options.status"
|
|
7
|
-
:page-options="pageOptions"
|
|
8
|
-
@page-change="onPageChange"
|
|
9
|
-
>
|
|
10
|
-
<template v-for="(_, slot) of $slots" #[slot]="slotProps">
|
|
11
|
-
<slot :name="slot" v-bind="slotProps || {}" />
|
|
12
|
-
</template>
|
|
13
|
-
</Base>
|
|
14
|
-
</template>
|
|
15
|
-
<script lang="ts" setup>
|
|
16
|
-
import { computed, type PropType, ref } from 'vue'
|
|
17
|
-
import { type ISimpleTableOptions } from '#core/components/Table/types'
|
|
18
|
-
import Base from '#core/components/Table/Base.vue'
|
|
19
|
-
import { initPageOptions } from '#core/composables/loaderPage'
|
|
20
|
-
|
|
21
|
-
const props = defineProps({
|
|
22
|
-
options: { type: Object as PropType<ISimpleTableOptions>, required: true },
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
const currentPage = ref(1)
|
|
26
|
-
|
|
27
|
-
const pageOptions = computed(() => {
|
|
28
|
-
if (!props.options?.limit) {
|
|
29
|
-
return undefined
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
return {
|
|
33
|
-
...initPageOptions({
|
|
34
|
-
limit: props.options.limit,
|
|
35
|
-
primary: props.options.primary,
|
|
36
|
-
}),
|
|
37
|
-
totalCount: props.options.rawData.length,
|
|
38
|
-
totalPage: Math.ceil(props.options.rawData.length / props.options.limit),
|
|
39
|
-
currentPage: currentPage.value,
|
|
40
|
-
}
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
const onPageChange = (page: number) => {
|
|
44
|
-
currentPage.value = page
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
const itemsByPage = computed(() => {
|
|
48
|
-
if (!pageOptions.value) {
|
|
49
|
-
return props.options?.rawData
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
const start = (pageOptions.value.currentPage - 1) * pageOptions.value.limit
|
|
53
|
-
const end = start + pageOptions.value.limit
|
|
54
|
-
|
|
55
|
-
return props.options?.rawData.slice(start, end)
|
|
56
|
-
})
|
|
57
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<Base
|
|
3
|
+
v-bind="$attrs"
|
|
4
|
+
:columns="options.columns"
|
|
5
|
+
:raw-data="itemsByPage"
|
|
6
|
+
:status="options.status"
|
|
7
|
+
:page-options="pageOptions"
|
|
8
|
+
@page-change="onPageChange"
|
|
9
|
+
>
|
|
10
|
+
<template v-for="(_, slot) of $slots" #[slot]="slotProps">
|
|
11
|
+
<slot :name="slot" v-bind="slotProps || {}" />
|
|
12
|
+
</template>
|
|
13
|
+
</Base>
|
|
14
|
+
</template>
|
|
15
|
+
<script lang="ts" setup>
|
|
16
|
+
import { computed, type PropType, ref } from 'vue'
|
|
17
|
+
import { type ISimpleTableOptions } from '#core/components/Table/types'
|
|
18
|
+
import Base from '#core/components/Table/Base.vue'
|
|
19
|
+
import { initPageOptions } from '#core/composables/loaderPage'
|
|
20
|
+
|
|
21
|
+
const props = defineProps({
|
|
22
|
+
options: { type: Object as PropType<ISimpleTableOptions>, required: true },
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
const currentPage = ref(1)
|
|
26
|
+
|
|
27
|
+
const pageOptions = computed(() => {
|
|
28
|
+
if (!props.options?.limit) {
|
|
29
|
+
return undefined
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return {
|
|
33
|
+
...initPageOptions({
|
|
34
|
+
limit: props.options.limit,
|
|
35
|
+
primary: props.options.primary,
|
|
36
|
+
}),
|
|
37
|
+
totalCount: props.options.rawData.length,
|
|
38
|
+
totalPage: Math.ceil(props.options.rawData.length / props.options.limit),
|
|
39
|
+
currentPage: currentPage.value,
|
|
40
|
+
}
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
const onPageChange = (page: number) => {
|
|
44
|
+
currentPage.value = page
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const itemsByPage = computed(() => {
|
|
48
|
+
if (!pageOptions.value) {
|
|
49
|
+
return props.options?.rawData
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const start = (pageOptions.value.currentPage - 1) * pageOptions.value.limit
|
|
53
|
+
const end = start + pageOptions.value.limit
|
|
54
|
+
|
|
55
|
+
return props.options?.rawData.slice(start, end)
|
|
56
|
+
})
|
|
57
|
+
</script>
|
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<div v-if="options.isEnabledSearch" class="mb-4 flex justify-end">
|
|
4
|
-
<UInput
|
|
5
|
-
v-model="q"
|
|
6
|
-
icon="i-heroicons-magnifying-glass"
|
|
7
|
-
:placeholder="options.searchPlaceholder || 'ค้นหา...'"
|
|
8
|
-
/>
|
|
9
|
-
</div>
|
|
10
|
-
<Base
|
|
11
|
-
v-bind="$attrs"
|
|
12
|
-
:columns="options.columns"
|
|
13
|
-
:raw-data="options.rawData"
|
|
14
|
-
:status="options.status"
|
|
15
|
-
:page-options="options.pageOptions"
|
|
16
|
-
:is-simple-pagination="options.isSimplePagination"
|
|
17
|
-
@page-change="onPageChange"
|
|
18
|
-
>
|
|
19
|
-
<template v-for="(_, slot) of $slots" #[slot]="slotProps">
|
|
20
|
-
<slot :name="slot" v-bind="slotProps || {}" />
|
|
21
|
-
</template>
|
|
22
|
-
</Base>
|
|
23
|
-
</div>
|
|
24
|
-
</template>
|
|
25
|
-
<script lang="ts" setup>
|
|
26
|
-
import { type PropType } from 'vue'
|
|
27
|
-
import { type ITableOptions } from '#core/components/Table/types'
|
|
28
|
-
import { _debounce, ref, watch } from '#imports'
|
|
29
|
-
import Base from '#core/components/Table/Base.vue'
|
|
30
|
-
|
|
31
|
-
const emits = defineEmits<{
|
|
32
|
-
(event: 'pageChange', page: number): void
|
|
33
|
-
(event: 'search', q: string): void
|
|
34
|
-
}>()
|
|
35
|
-
|
|
36
|
-
const props = defineProps({
|
|
37
|
-
options: { type: Object as PropType<ITableOptions>, required: true },
|
|
38
|
-
})
|
|
39
|
-
|
|
40
|
-
const q = ref(props.options?.pageOptions.search ?? '')
|
|
41
|
-
|
|
42
|
-
watch(
|
|
43
|
-
q,
|
|
44
|
-
_debounce((value) => {
|
|
45
|
-
emits('search', value)
|
|
46
|
-
}, 500)
|
|
47
|
-
)
|
|
48
|
-
|
|
49
|
-
const onPageChange = (page: number) => {
|
|
50
|
-
emits('pageChange', page)
|
|
51
|
-
}
|
|
52
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<div v-if="options.isEnabledSearch" class="mb-4 flex justify-end">
|
|
4
|
+
<UInput
|
|
5
|
+
v-model="q"
|
|
6
|
+
icon="i-heroicons-magnifying-glass"
|
|
7
|
+
:placeholder="options.searchPlaceholder || 'ค้นหา...'"
|
|
8
|
+
/>
|
|
9
|
+
</div>
|
|
10
|
+
<Base
|
|
11
|
+
v-bind="$attrs"
|
|
12
|
+
:columns="options.columns"
|
|
13
|
+
:raw-data="options.rawData"
|
|
14
|
+
:status="options.status"
|
|
15
|
+
:page-options="options.pageOptions"
|
|
16
|
+
:is-simple-pagination="options.isSimplePagination"
|
|
17
|
+
@page-change="onPageChange"
|
|
18
|
+
>
|
|
19
|
+
<template v-for="(_, slot) of $slots" #[slot]="slotProps">
|
|
20
|
+
<slot :name="slot" v-bind="slotProps || {}" />
|
|
21
|
+
</template>
|
|
22
|
+
</Base>
|
|
23
|
+
</div>
|
|
24
|
+
</template>
|
|
25
|
+
<script lang="ts" setup>
|
|
26
|
+
import { type PropType } from 'vue'
|
|
27
|
+
import { type ITableOptions } from '#core/components/Table/types'
|
|
28
|
+
import { _debounce, ref, watch } from '#imports'
|
|
29
|
+
import Base from '#core/components/Table/Base.vue'
|
|
30
|
+
|
|
31
|
+
const emits = defineEmits<{
|
|
32
|
+
(event: 'pageChange', page: number): void
|
|
33
|
+
(event: 'search', q: string): void
|
|
34
|
+
}>()
|
|
35
|
+
|
|
36
|
+
const props = defineProps({
|
|
37
|
+
options: { type: Object as PropType<ITableOptions>, required: true },
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
const q = ref(props.options?.pageOptions.search ?? '')
|
|
41
|
+
|
|
42
|
+
watch(
|
|
43
|
+
q,
|
|
44
|
+
_debounce((value) => {
|
|
45
|
+
emits('search', value)
|
|
46
|
+
}, 500)
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
const onPageChange = (page: number) => {
|
|
50
|
+
emits('pageChange', page)
|
|
51
|
+
}
|
|
52
|
+
</script>
|
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<UTabs
|
|
3
|
-
v-bind="attrs"
|
|
4
|
-
:model-value="modelValue"
|
|
5
|
-
:class="$props.class"
|
|
6
|
-
:items="items"
|
|
7
|
-
:orientation="orientation"
|
|
8
|
-
:default-index="defaultIndex"
|
|
9
|
-
:ui="ui"
|
|
10
|
-
@change="change"
|
|
11
|
-
>
|
|
12
|
-
<template #default="{ item, index, selected }">
|
|
13
|
-
<slot name="default" :item="item" :index="index" :selected="selected" />
|
|
14
|
-
</template>
|
|
15
|
-
|
|
16
|
-
<template #item="{ item, index, selected }">
|
|
17
|
-
<slot name="item" :item="item" :index="index" :selected="selected" />
|
|
18
|
-
</template>
|
|
19
|
-
</UTabs>
|
|
20
|
-
</template>
|
|
21
|
-
|
|
22
|
-
<script setup lang="ts">
|
|
23
|
-
import { useUiConfig, type PropType, useUI, toRef } from '#imports'
|
|
24
|
-
import { type TabItem } from '#ui/types'
|
|
25
|
-
import type { Strategy } from '#core/types/utils'
|
|
26
|
-
import { tabs } from '#core/ui.config'
|
|
27
|
-
|
|
28
|
-
const config = useUiConfig<typeof tabs>(tabs, 'tabs')
|
|
29
|
-
|
|
30
|
-
const props = defineProps({
|
|
31
|
-
modelValue: {
|
|
32
|
-
type: Number,
|
|
33
|
-
default: undefined,
|
|
34
|
-
},
|
|
35
|
-
items: {
|
|
36
|
-
type: Array as PropType<TabItem[]>,
|
|
37
|
-
default: () => [],
|
|
38
|
-
},
|
|
39
|
-
orientation: {
|
|
40
|
-
type: String as PropType<'horizontal' | 'vertical'>,
|
|
41
|
-
default: 'horizontal',
|
|
42
|
-
validator: (value: string) => ['horizontal', 'vertical'].includes(value),
|
|
43
|
-
},
|
|
44
|
-
defaultIndex: {
|
|
45
|
-
type: Number,
|
|
46
|
-
default: 0,
|
|
47
|
-
},
|
|
48
|
-
class: {
|
|
49
|
-
type: [String, Object, Array] as PropType<any>,
|
|
50
|
-
default: () => '',
|
|
51
|
-
},
|
|
52
|
-
ui: {
|
|
53
|
-
type: Object as PropType<Partial<typeof config> & { strategy?: Strategy }>,
|
|
54
|
-
default: () => ({}),
|
|
55
|
-
},
|
|
56
|
-
})
|
|
57
|
-
|
|
58
|
-
const emits = defineEmits(['update:modelValue', 'change'])
|
|
59
|
-
|
|
60
|
-
const change = (index: number) => {
|
|
61
|
-
emits('change', index)
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
const { ui, attrs } = useUI('tabs', toRef(props, 'ui'), config, toRef(props, 'class'))
|
|
65
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<UTabs
|
|
3
|
+
v-bind="attrs"
|
|
4
|
+
:model-value="modelValue"
|
|
5
|
+
:class="$props.class"
|
|
6
|
+
:items="items"
|
|
7
|
+
:orientation="orientation"
|
|
8
|
+
:default-index="defaultIndex"
|
|
9
|
+
:ui="ui"
|
|
10
|
+
@change="change"
|
|
11
|
+
>
|
|
12
|
+
<template #default="{ item, index, selected }">
|
|
13
|
+
<slot name="default" :item="item" :index="index" :selected="selected" />
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<template #item="{ item, index, selected }">
|
|
17
|
+
<slot name="item" :item="item" :index="index" :selected="selected" />
|
|
18
|
+
</template>
|
|
19
|
+
</UTabs>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<script setup lang="ts">
|
|
23
|
+
import { useUiConfig, type PropType, useUI, toRef } from '#imports'
|
|
24
|
+
import { type TabItem } from '#ui/types'
|
|
25
|
+
import type { Strategy } from '#core/types/utils'
|
|
26
|
+
import { tabs } from '#core/ui.config'
|
|
27
|
+
|
|
28
|
+
const config = useUiConfig<typeof tabs>(tabs, 'tabs')
|
|
29
|
+
|
|
30
|
+
const props = defineProps({
|
|
31
|
+
modelValue: {
|
|
32
|
+
type: Number,
|
|
33
|
+
default: undefined,
|
|
34
|
+
},
|
|
35
|
+
items: {
|
|
36
|
+
type: Array as PropType<TabItem[]>,
|
|
37
|
+
default: () => [],
|
|
38
|
+
},
|
|
39
|
+
orientation: {
|
|
40
|
+
type: String as PropType<'horizontal' | 'vertical'>,
|
|
41
|
+
default: 'horizontal',
|
|
42
|
+
validator: (value: string) => ['horizontal', 'vertical'].includes(value),
|
|
43
|
+
},
|
|
44
|
+
defaultIndex: {
|
|
45
|
+
type: Number,
|
|
46
|
+
default: 0,
|
|
47
|
+
},
|
|
48
|
+
class: {
|
|
49
|
+
type: [String, Object, Array] as PropType<any>,
|
|
50
|
+
default: () => '',
|
|
51
|
+
},
|
|
52
|
+
ui: {
|
|
53
|
+
type: Object as PropType<Partial<typeof config> & { strategy?: Strategy }>,
|
|
54
|
+
default: () => ({}),
|
|
55
|
+
},
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
const emits = defineEmits(['update:modelValue', 'change'])
|
|
59
|
+
|
|
60
|
+
const change = (index: number) => {
|
|
61
|
+
emits('change', index)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const { ui, attrs } = useUI('tabs', toRef(props, 'ui'), config, toRef(props, 'class'))
|
|
65
|
+
</script>
|
|
@@ -12,6 +12,7 @@ export interface IRequester {
|
|
|
12
12
|
put: <T>(path: string, payload: any, options?: AxiosRequestConfig) => Promise<IResponse<T>>;
|
|
13
13
|
delete: <T>(path: string, options?: AxiosRequestConfig) => Promise<IResponse<T>>;
|
|
14
14
|
post: <T>(path: string, payload: any, options?: AxiosRequestConfig) => Promise<IResponse<T>>;
|
|
15
|
+
postForm: <T>(path: string, payload: any, options?: AxiosRequestConfig) => Promise<IResponse<T>>;
|
|
15
16
|
create: <T>(method: Method, path: string, payload: any, options?: AxiosRequestConfig) => Promise<IResponse<T>>;
|
|
16
17
|
}
|
|
17
18
|
export declare class Requester {
|
|
@@ -25,6 +26,7 @@ export declare class Requester {
|
|
|
25
26
|
put<T>(path: string, payload: any, options?: AxiosRequestConfig): Promise<IResponse<T>>;
|
|
26
27
|
delete<T>(path: string, options?: AxiosRequestConfig): Promise<IResponse<T>>;
|
|
27
28
|
post<T>(path: string, payload: any, options?: AxiosRequestConfig): Promise<IResponse<T>>;
|
|
29
|
+
postForm<T>(path: string, payload: any, options?: AxiosRequestConfig): Promise<IResponse<T>>;
|
|
28
30
|
create<T>(method: Method, path: string, payload: any, options?: AxiosRequestConfig): Promise<IResponse<T>>;
|
|
29
31
|
}
|
|
30
32
|
export declare const NewRequester: IRequester;
|
|
@@ -24,6 +24,9 @@ export class Requester {
|
|
|
24
24
|
async post(path, payload, options = {}) {
|
|
25
25
|
return this.service.post(path, payload, options);
|
|
26
26
|
}
|
|
27
|
+
async postForm(path, payload, options = {}) {
|
|
28
|
+
return this.service.postForm(path, payload, options);
|
|
29
|
+
}
|
|
27
30
|
async create(method, path, payload, options = {}) {
|
|
28
31
|
return this.service({
|
|
29
32
|
method,
|
package/dist/runtime/plugin.mjs
CHANGED
|
@@ -123,7 +123,8 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|
|
123
123
|
},
|
|
124
124
|
custom: {
|
|
125
125
|
invalid_file_type: "\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E44\u0E1F\u0E25\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
126
|
-
|
|
126
|
+
invalid_file_size_kb: "\u0E02\u0E19\u0E32\u0E14\u0E44\u0E1F\u0E25\u0E4C\u0E40\u0E01\u0E34\u0E19\u0E01\u0E27\u0E48\u0E32\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 {{size}} Kb",
|
|
127
|
+
invalid_file_size_mb: "\u0E02\u0E19\u0E32\u0E14\u0E44\u0E1F\u0E25\u0E4C\u0E40\u0E01\u0E34\u0E19\u0E01\u0E27\u0E48\u0E32\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 {{size}} Mb"
|
|
127
128
|
},
|
|
128
129
|
en
|
|
129
130
|
},
|
|
@@ -133,7 +134,8 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|
|
133
134
|
},
|
|
134
135
|
custom: {
|
|
135
136
|
invalid_file_type: "Invalid file type",
|
|
136
|
-
|
|
137
|
+
invalid_file_size_kb: "Invalid exceed of file size {{size}} Kb",
|
|
138
|
+
invalid_file_size_mb: "Invalid exceed of file size {{size}} Mb"
|
|
137
139
|
}
|
|
138
140
|
}
|
|
139
141
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type UIComponentList = 'modal' | 'slideover' | 'dropdown' | 'icon' | 'button' | 'buttonGroup' | 'tabs' | 'card' | 'breadcrumb' | 'badge' | 'input' | 'pagination' | 'notification' | 'uploadFileInputClassicAuto';
|
|
1
|
+
export type UIComponentList = 'modal' | 'slideover' | 'dropdown' | 'icon' | 'button' | 'buttonGroup' | 'tabs' | 'card' | 'breadcrumb' | 'badge' | 'input' | 'pagination' | 'notification' | 'uploadFileInputClassicAuto' | 'uploadFileDropzone';
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
export type Strategy = 'merge' | 'override'
|
|
2
|
-
|
|
3
|
-
export type NestedKeyOf<ObjectType extends object> = {
|
|
4
|
-
[Key in keyof ObjectType]: ObjectType[Key] extends object ? NestedKeyOf<ObjectType[Key]> : Key
|
|
5
|
-
}[keyof ObjectType]
|
|
6
|
-
|
|
7
|
-
export type DeepPartial<T> = Partial<{
|
|
8
|
-
[P in keyof T]: DeepPartial<T[P]> | Record<string, string>
|
|
9
|
-
}>
|
|
10
|
-
|
|
11
|
-
type DeepKey<T, Keys extends string[]> = Keys extends [infer First, ...infer Rest]
|
|
12
|
-
? First extends keyof T
|
|
13
|
-
? Rest extends string[]
|
|
14
|
-
? DeepKey<T[First], Rest>
|
|
15
|
-
: never
|
|
16
|
-
: never
|
|
17
|
-
: T
|
|
18
|
-
|
|
19
|
-
export type ExtractDeepKey<T, Path extends string[]> = DeepKey<T, Path> extends infer Result
|
|
20
|
-
? Result extends Record<string, any>
|
|
21
|
-
? keyof Result
|
|
22
|
-
: never
|
|
23
|
-
: never
|
|
24
|
-
|
|
25
|
-
export type ExtractDeepObject<T, Path extends string[]> = DeepKey<T, Path> extends infer Result
|
|
26
|
-
? Result extends Record<string, any>
|
|
27
|
-
? Result
|
|
28
|
-
: never
|
|
29
|
-
: never
|
|
1
|
+
export type Strategy = 'merge' | 'override'
|
|
2
|
+
|
|
3
|
+
export type NestedKeyOf<ObjectType extends object> = {
|
|
4
|
+
[Key in keyof ObjectType]: ObjectType[Key] extends object ? NestedKeyOf<ObjectType[Key]> : Key
|
|
5
|
+
}[keyof ObjectType]
|
|
6
|
+
|
|
7
|
+
export type DeepPartial<T> = Partial<{
|
|
8
|
+
[P in keyof T]: DeepPartial<T[P]> | Record<string, string>
|
|
9
|
+
}>
|
|
10
|
+
|
|
11
|
+
type DeepKey<T, Keys extends string[]> = Keys extends [infer First, ...infer Rest]
|
|
12
|
+
? First extends keyof T
|
|
13
|
+
? Rest extends string[]
|
|
14
|
+
? DeepKey<T[First], Rest>
|
|
15
|
+
: never
|
|
16
|
+
: never
|
|
17
|
+
: T
|
|
18
|
+
|
|
19
|
+
export type ExtractDeepKey<T, Path extends string[]> = DeepKey<T, Path> extends infer Result
|
|
20
|
+
? Result extends Record<string, any>
|
|
21
|
+
? keyof Result
|
|
22
|
+
: never
|
|
23
|
+
: never
|
|
24
|
+
|
|
25
|
+
export type ExtractDeepObject<T, Path extends string[]> = DeepKey<T, Path> extends infer Result
|
|
26
|
+
? Result extends Record<string, any>
|
|
27
|
+
? Result
|
|
28
|
+
: never
|
|
29
|
+
: never
|
|
@@ -2,6 +2,6 @@ import { breadcrumb as inheritBreadcrumb } from "#ui/ui.config";
|
|
|
2
2
|
export const breadcrumb = {
|
|
3
3
|
...inheritBreadcrumb,
|
|
4
4
|
default: {
|
|
5
|
-
divider: "i-heroicons-chevron-right-20-solid
|
|
5
|
+
divider: "i-heroicons-chevron-right-20-solid"
|
|
6
6
|
}
|
|
7
7
|
};
|
|
@@ -10,3 +10,4 @@ export { modal } from "./modal.mjs";
|
|
|
10
10
|
export { slideover } from "./slideover.mjs";
|
|
11
11
|
export { breadcrumb } from "./breadcrumb.mjs";
|
|
12
12
|
export { uploadFileInputClassicAuto } from "./uploadFileInputClassicAuto.mjs";
|
|
13
|
+
export { uploadFileDropzone } from "./uploadFileDropzone.mjs";
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export declare const uploadFileDropzone: {
|
|
2
|
+
base: string;
|
|
3
|
+
wrapper: string;
|
|
4
|
+
disabled: string;
|
|
5
|
+
placeholderWrapper: string;
|
|
6
|
+
placeholder: string;
|
|
7
|
+
labelWrapper: string;
|
|
8
|
+
preview: {
|
|
9
|
+
wrapper: string;
|
|
10
|
+
icon: string;
|
|
11
|
+
image: {
|
|
12
|
+
wrapper: string;
|
|
13
|
+
img: string;
|
|
14
|
+
};
|
|
15
|
+
filename: string;
|
|
16
|
+
fileInfo: string;
|
|
17
|
+
};
|
|
18
|
+
background: {
|
|
19
|
+
default: string;
|
|
20
|
+
dragover: string;
|
|
21
|
+
};
|
|
22
|
+
button: {
|
|
23
|
+
delete: string;
|
|
24
|
+
};
|
|
25
|
+
labelIcon: string;
|
|
26
|
+
default: {
|
|
27
|
+
closeIcon: string;
|
|
28
|
+
filePreviewIcon: string;
|
|
29
|
+
uploadIcon: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export const uploadFileDropzone = {
|
|
2
|
+
base: "relative w-full p-8 transition rounded-lg flex items-center justify-center border-2 ring-0 min-h-[250px]",
|
|
3
|
+
wrapper: "flex flex-col items-center w-full",
|
|
4
|
+
disabled: "bg-gray-disabled cursor-not-allowed",
|
|
5
|
+
placeholderWrapper: "flex flex-col items-center justify-center",
|
|
6
|
+
placeholder: "text-gray-400 text-center font-light text-sm truncate",
|
|
7
|
+
labelWrapper: "flex items-center space-x-2 text-gray-400 text-center",
|
|
8
|
+
preview: {
|
|
9
|
+
wrapper: "flex flex-col items-center w-full",
|
|
10
|
+
icon: "mb-2 h-10 w-10 text-gray-400",
|
|
11
|
+
image: {
|
|
12
|
+
wrapper: "flex justify-center mb-2 rounded overflow-hidden",
|
|
13
|
+
img: "max-w-[300px]"
|
|
14
|
+
},
|
|
15
|
+
filename: "flex items-center justify-center w-full font-semibold truncate",
|
|
16
|
+
fileInfo: "text-center text-gray-400 mt-1 text-sm font-light"
|
|
17
|
+
},
|
|
18
|
+
background: {
|
|
19
|
+
default: "bg-white border-gray-border",
|
|
20
|
+
dragover: "bg-gray-100 border-primary"
|
|
21
|
+
},
|
|
22
|
+
button: {
|
|
23
|
+
delete: "cursor-pointer w-5 h-5 ml-2 text-gray-400 hover:text-gray-300 absolute top-6 right-6 "
|
|
24
|
+
},
|
|
25
|
+
labelIcon: "w-6 h-6 text-gray-400 text-center mb-4",
|
|
26
|
+
default: {
|
|
27
|
+
closeIcon: "i-heroicons:trash-solid",
|
|
28
|
+
filePreviewIcon: "i-heroicons:document-text-solid",
|
|
29
|
+
uploadIcon: "i-ph:cloud-arrow-up"
|
|
30
|
+
}
|
|
31
|
+
};
|
package/dist/runtime/ui.css
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
:root {
|
|
2
|
-
--dp-font-family: inherit !important;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.dp__theme_light {
|
|
6
|
-
--dp-primary-color: rgb(var(--color-primary-DEFAULT)) !important;
|
|
7
|
-
--dp-primary-disabled-color: rgb(var(--color-primary-200)) !important;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
::-webkit-scrollbar {
|
|
11
|
-
-webkit-appearance: none;
|
|
12
|
-
width: 10px;
|
|
13
|
-
height: 10px;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
::-webkit-scrollbar-thumb {
|
|
17
|
-
border-radius: 4px;
|
|
18
|
-
background-color: rgb(0 0 0 / 30%);
|
|
19
|
-
box-shadow: 0 0 1px rgb(255 255 255 / 50%);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
html,
|
|
24
|
-
body,
|
|
25
|
-
#__nuxt,
|
|
26
|
-
#__layout,
|
|
27
|
-
.root-container {
|
|
28
|
-
height: 100%;
|
|
29
|
-
display: flex;
|
|
30
|
-
flex-direction: column;
|
|
31
|
-
}
|
|
32
|
-
|
|
1
|
+
:root {
|
|
2
|
+
--dp-font-family: inherit !important;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.dp__theme_light {
|
|
6
|
+
--dp-primary-color: rgb(var(--color-primary-DEFAULT)) !important;
|
|
7
|
+
--dp-primary-disabled-color: rgb(var(--color-primary-200)) !important;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
::-webkit-scrollbar {
|
|
11
|
+
-webkit-appearance: none;
|
|
12
|
+
width: 10px;
|
|
13
|
+
height: 10px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
::-webkit-scrollbar-thumb {
|
|
17
|
+
border-radius: 4px;
|
|
18
|
+
background-color: rgb(0 0 0 / 30%);
|
|
19
|
+
box-shadow: 0 0 1px rgb(255 255 255 / 50%);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
html,
|
|
24
|
+
body,
|
|
25
|
+
#__nuxt,
|
|
26
|
+
#__layout,
|
|
27
|
+
.root-container {
|
|
28
|
+
height: 100%;
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
}
|
|
32
|
+
|