dendelion-ui 0.0.1
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/LICENSE +21 -0
- package/README.md +5 -0
- package/dist/dendelion-ui.cjs.js +5 -0
- package/dist/dendelion-ui.es.js +452 -0
- package/dist/dendelion-ui.umd.js +5 -0
- package/dist/types/components/button/Button.vue.d.ts +22 -0
- package/dist/types/components/button/index.d.ts +2 -0
- package/dist/types/components/button/interface.d.ts +8 -0
- package/dist/types/components/card/Card.vue.d.ts +23 -0
- package/dist/types/components/card/CardBody.vue.d.ts +17 -0
- package/dist/types/components/card/CardTitle.vue.d.ts +10 -0
- package/dist/types/components/card/index.d.ts +4 -0
- package/dist/types/components/card/interface.d.ts +8 -0
- package/dist/types/components/container/Container.vue.d.ts +21 -0
- package/dist/types/components/container/index.d.ts +2 -0
- package/dist/types/components/container/interface.d.ts +4 -0
- package/dist/types/components/modal/Modal.vue.d.ts +31 -0
- package/dist/types/components/modal/index.d.ts +2 -0
- package/dist/types/components/modal/interface.d.ts +6 -0
- package/dist/types/components/stepper/Step.vue.d.ts +18 -0
- package/dist/types/components/stepper/StepList.vue.d.ts +17 -0
- package/dist/types/components/stepper/StepPanel.vue.d.ts +22 -0
- package/dist/types/components/stepper/StepPanels.vue.d.ts +20 -0
- package/dist/types/components/stepper/Stepper.vue.d.ts +26 -0
- package/dist/types/components/stepper/index.d.ts +6 -0
- package/dist/types/components/stepper/interface.d.ts +3 -0
- package/dist/types/components/table/Table.vue.d.ts +11 -0
- package/dist/types/components/table/index.d.ts +2 -0
- package/dist/types/components/table/interface.d.ts +24 -0
- package/dist/types/components.d.ts +6 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/types/color.d.ts +25 -0
- package/dist/types/types/index.d.ts +2 -0
- package/dist/types/types/size.d.ts +12 -0
- package/dist/vite.svg +1 -0
- package/package.json +72 -0
- package/src/components/button/Button.vue +24 -0
- package/src/components/button/index.ts +2 -0
- package/src/components/button/interface.ts +10 -0
- package/src/components/card/Card.vue +25 -0
- package/src/components/card/CardBody.vue +9 -0
- package/src/components/card/CardTitle.vue +18 -0
- package/src/components/card/index.ts +4 -0
- package/src/components/card/interface.ts +9 -0
- package/src/components/container/Container.vue +21 -0
- package/src/components/container/index.ts +2 -0
- package/src/components/container/interface.ts +5 -0
- package/src/components/modal/Modal.vue +36 -0
- package/src/components/modal/index.ts +2 -0
- package/src/components/modal/interface.ts +8 -0
- package/src/components/stepper/Step.vue +35 -0
- package/src/components/stepper/StepList.vue +8 -0
- package/src/components/stepper/StepPanel.vue +30 -0
- package/src/components/stepper/StepPanels.vue +17 -0
- package/src/components/stepper/Stepper.vue +33 -0
- package/src/components/stepper/index.ts +6 -0
- package/src/components/stepper/interface.ts +4 -0
- package/src/components/table/Table.vue +27 -0
- package/src/components/table/index.ts +2 -0
- package/src/components/table/interface.ts +28 -0
- package/src/components.ts +6 -0
- package/src/index.ts +91 -0
- package/src/shims-vue.d.ts +12 -0
- package/src/types/color.ts +72 -0
- package/src/types/index.ts +2 -0
- package/src/types/size.ts +32 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<slot :updateValue="updateValue"></slot>
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script setup lang="ts">
|
|
6
|
+
import { provide, ref, watch } from 'vue';
|
|
7
|
+
import { StepperProps } from './interface';
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
const props = defineProps<StepperProps>()
|
|
11
|
+
|
|
12
|
+
const stepperStep = ref(props.value);
|
|
13
|
+
|
|
14
|
+
const emit = defineEmits(['update:value'])
|
|
15
|
+
|
|
16
|
+
const updateValue = (value: string) => {
|
|
17
|
+
stepperStep.value = value;
|
|
18
|
+
emit('update:value', value)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
provide('stepper', {
|
|
22
|
+
value: stepperStep,
|
|
23
|
+
updateValue
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
watch(() => props.value, (value) => {
|
|
27
|
+
stepperStep.value = value;
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
defineExpose({
|
|
31
|
+
updateValue
|
|
32
|
+
})
|
|
33
|
+
</script>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as Stepper } from './Stepper.vue';
|
|
2
|
+
export { default as Step } from './Step.vue';
|
|
3
|
+
export { default as StepList } from './StepList.vue';
|
|
4
|
+
export { default as StepPanels } from './StepPanels.vue';
|
|
5
|
+
export { default as StepPanel } from './StepPanel.vue';
|
|
6
|
+
export type { StepperProps } from './interface';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<table ref="table" :class="tableClasses">
|
|
3
|
+
|
|
4
|
+
</table>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup lang="ts">
|
|
8
|
+
import { ref } from 'vue';
|
|
9
|
+
import { TableProps } from './interface';
|
|
10
|
+
import classNames from 'classnames';
|
|
11
|
+
import { Size, SizeUtils } from '@/types';
|
|
12
|
+
|
|
13
|
+
const table = ref<HTMLTableElement | null>(null)
|
|
14
|
+
|
|
15
|
+
const props = withDefaults(defineProps<TableProps>(), {
|
|
16
|
+
size: Size.MD,
|
|
17
|
+
zebra: false,
|
|
18
|
+
pinRows: false,
|
|
19
|
+
pinCols: false,
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const tableClasses = ref(classNames('table', `table-${SizeUtils.toClassName(props.size)}`, {
|
|
23
|
+
'table-zebra': props.zebra,
|
|
24
|
+
'table-pin-rows': props.pinRows,
|
|
25
|
+
'table-pin-cols ': props.pinCols,
|
|
26
|
+
}));
|
|
27
|
+
</script>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Size } from "@/types";
|
|
2
|
+
|
|
3
|
+
export type TableProps = {
|
|
4
|
+
zebra?: boolean;
|
|
5
|
+
pinRows?: boolean;
|
|
6
|
+
pinCols?: boolean;
|
|
7
|
+
size: Size
|
|
8
|
+
columns: Column[];
|
|
9
|
+
dataSource: Record<string, unknown>[];
|
|
10
|
+
ajax?: (params: object) => Promise<object>;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type Column = {
|
|
14
|
+
title: string;
|
|
15
|
+
data: string;
|
|
16
|
+
render?: (text: string, record?: Record<string, unknown>) => string;
|
|
17
|
+
extraClasses?: ExtraClasses;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type ExtraClasses = {
|
|
21
|
+
header?: string[];
|
|
22
|
+
cell?: CellClasses;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export type CellClasses = {
|
|
26
|
+
index: number;
|
|
27
|
+
classes: string[];
|
|
28
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
export * from './components'
|
|
2
|
+
|
|
3
|
+
export * from './types/index'
|
|
4
|
+
|
|
5
|
+
const dendelionSafeList = [
|
|
6
|
+
'bg-primary',
|
|
7
|
+
'bg-primary-content',
|
|
8
|
+
'bg-secondary',
|
|
9
|
+
'bg-secondary-content',
|
|
10
|
+
'bg-accent',
|
|
11
|
+
'bg-accent-content',
|
|
12
|
+
'bg-neutral',
|
|
13
|
+
'bg-neutral-content',
|
|
14
|
+
'bg-base-100',
|
|
15
|
+
'bg-base-200',
|
|
16
|
+
'bg-base-300',
|
|
17
|
+
'bg-base-content',
|
|
18
|
+
'bg-info',
|
|
19
|
+
'bg-info-content',
|
|
20
|
+
'bg-success',
|
|
21
|
+
'bg-success-content',
|
|
22
|
+
'bg-warning',
|
|
23
|
+
'bg-warning-content',
|
|
24
|
+
'bg-error',
|
|
25
|
+
'bg-error-content',
|
|
26
|
+
'btn-primary',
|
|
27
|
+
'btn-primary-content',
|
|
28
|
+
'btn-secondary',
|
|
29
|
+
'btn-secondary-content',
|
|
30
|
+
'btn-accent',
|
|
31
|
+
'btn-accent-content',
|
|
32
|
+
'btn-neutral',
|
|
33
|
+
'btn-neutral-content',
|
|
34
|
+
'btn-base-100',
|
|
35
|
+
'btn-base-200',
|
|
36
|
+
'btn-base-300',
|
|
37
|
+
'btn-base-content',
|
|
38
|
+
'btn-info',
|
|
39
|
+
'btn-info-content',
|
|
40
|
+
'btn-success',
|
|
41
|
+
'btn-success-content',
|
|
42
|
+
'btn-warning',
|
|
43
|
+
'btn-warning-content',
|
|
44
|
+
'btn-error',
|
|
45
|
+
'btn-error-content',
|
|
46
|
+
'text-primary',
|
|
47
|
+
'text-primary-content',
|
|
48
|
+
'text-secondary',
|
|
49
|
+
'text-secondary-content',
|
|
50
|
+
'text-accent',
|
|
51
|
+
'text-accent-content',
|
|
52
|
+
'text-neutral',
|
|
53
|
+
'text-neutral-content',
|
|
54
|
+
'text-base-100',
|
|
55
|
+
'text-base-200',
|
|
56
|
+
'text-base-300',
|
|
57
|
+
'text-base-content',
|
|
58
|
+
'text-info',
|
|
59
|
+
'text-info-content',
|
|
60
|
+
'text-success',
|
|
61
|
+
'text-success-content',
|
|
62
|
+
'text-warning',
|
|
63
|
+
'text-warning-content',
|
|
64
|
+
'text-error',
|
|
65
|
+
'text-error-content',
|
|
66
|
+
'text-transparent',
|
|
67
|
+
'step',
|
|
68
|
+
'steps',
|
|
69
|
+
'modal',
|
|
70
|
+
'modal-box',
|
|
71
|
+
'btn',
|
|
72
|
+
'btn-sm',
|
|
73
|
+
'btn-circle',
|
|
74
|
+
'btn-ghost',
|
|
75
|
+
'absolute',
|
|
76
|
+
'right-2',
|
|
77
|
+
'top-2',
|
|
78
|
+
'shadow-lg',
|
|
79
|
+
'w-full',
|
|
80
|
+
'rounded-xs',
|
|
81
|
+
'rounded-sm',
|
|
82
|
+
'rounded-md',
|
|
83
|
+
'rounded-lg',
|
|
84
|
+
'rounded-xl',
|
|
85
|
+
'rounded-2xl',
|
|
86
|
+
'rounded-3xl',
|
|
87
|
+
'hidden',
|
|
88
|
+
'block',
|
|
89
|
+
];
|
|
90
|
+
|
|
91
|
+
export { dendelionSafeList };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// shims-vue.d.ts
|
|
2
|
+
declare module '*.vue' {
|
|
3
|
+
import type { DefineComponent } from 'vue'
|
|
4
|
+
|
|
5
|
+
const component: DefineComponent<
|
|
6
|
+
Record<string, unknown>,
|
|
7
|
+
Record<string, unknown>,
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9
|
+
any
|
|
10
|
+
>
|
|
11
|
+
export default component
|
|
12
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
export enum Color {
|
|
2
|
+
Primary,
|
|
3
|
+
PrimaryContent,
|
|
4
|
+
Secondary,
|
|
5
|
+
SecondaryContent,
|
|
6
|
+
Accent,
|
|
7
|
+
AccentContent,
|
|
8
|
+
Neutral,
|
|
9
|
+
NeutralContent,
|
|
10
|
+
Base100,
|
|
11
|
+
Base200,
|
|
12
|
+
Base300,
|
|
13
|
+
BaseContent,
|
|
14
|
+
Info,
|
|
15
|
+
InfoContent,
|
|
16
|
+
Success,
|
|
17
|
+
SuccessContent,
|
|
18
|
+
Warning,
|
|
19
|
+
WarningContent,
|
|
20
|
+
Error,
|
|
21
|
+
ErrorContent,
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export class ColorUtils {
|
|
25
|
+
public static toClassName(color: Color): string {
|
|
26
|
+
switch (color) {
|
|
27
|
+
case Color.Primary:
|
|
28
|
+
return 'primary'
|
|
29
|
+
case Color.PrimaryContent:
|
|
30
|
+
return 'primary-content'
|
|
31
|
+
case Color.Secondary:
|
|
32
|
+
return 'secondary'
|
|
33
|
+
case Color.SecondaryContent:
|
|
34
|
+
return 'secondary-content'
|
|
35
|
+
case Color.Accent:
|
|
36
|
+
return 'accent'
|
|
37
|
+
case Color.AccentContent:
|
|
38
|
+
return 'accent-content'
|
|
39
|
+
case Color.Neutral:
|
|
40
|
+
return 'neutral'
|
|
41
|
+
case Color.NeutralContent:
|
|
42
|
+
return 'neutral-content'
|
|
43
|
+
case Color.Base100:
|
|
44
|
+
return 'base-100'
|
|
45
|
+
case Color.Base200:
|
|
46
|
+
return 'base-200'
|
|
47
|
+
case Color.Base300:
|
|
48
|
+
return 'base-300'
|
|
49
|
+
case Color.BaseContent:
|
|
50
|
+
return 'base-content'
|
|
51
|
+
case Color.Info:
|
|
52
|
+
return 'info'
|
|
53
|
+
case Color.InfoContent:
|
|
54
|
+
return 'info-content'
|
|
55
|
+
case Color.Success:
|
|
56
|
+
return 'success'
|
|
57
|
+
case Color.SuccessContent:
|
|
58
|
+
return 'success-content'
|
|
59
|
+
case Color.Warning:
|
|
60
|
+
return 'warning'
|
|
61
|
+
case Color.WarningContent:
|
|
62
|
+
return 'warning-content'
|
|
63
|
+
case Color.Error:
|
|
64
|
+
return 'error'
|
|
65
|
+
case Color.ErrorContent:
|
|
66
|
+
return 'error-content'
|
|
67
|
+
default:
|
|
68
|
+
return 'primary'
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export enum Size {
|
|
2
|
+
XS,
|
|
3
|
+
SM,
|
|
4
|
+
MD,
|
|
5
|
+
LG,
|
|
6
|
+
XL,
|
|
7
|
+
TWOXL,
|
|
8
|
+
THREEXL
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export class SizeUtils {
|
|
12
|
+
public static toClassName(size: Size): string {
|
|
13
|
+
switch (size) {
|
|
14
|
+
case Size.XS:
|
|
15
|
+
return 'xs'
|
|
16
|
+
case Size.SM:
|
|
17
|
+
return 'sm'
|
|
18
|
+
case Size.MD:
|
|
19
|
+
return 'md'
|
|
20
|
+
case Size.LG:
|
|
21
|
+
return 'lg'
|
|
22
|
+
case Size.XL:
|
|
23
|
+
return 'xl'
|
|
24
|
+
case Size.TWOXL:
|
|
25
|
+
return '2xl'
|
|
26
|
+
case Size.THREEXL:
|
|
27
|
+
return '3xl'
|
|
28
|
+
default:
|
|
29
|
+
return 'md'
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|