cosey 0.6.12 → 0.6.13

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.
Files changed (30) hide show
  1. package/components/index.js +3 -1
  2. package/components/media-card-group/index.d.ts +25 -6
  3. package/components/media-card-group/index.js +2 -1
  4. package/components/media-card-group/media-card-group.api.d.ts +19 -0
  5. package/components/media-card-group/media-card-group.api.js +11 -0
  6. package/components/media-card-group/media-card-group.d.ts +16 -11
  7. package/components/media-card-group/media-card-group.js +51 -0
  8. package/components/{panel/style/index.d.ts → media-card-group/media-card-group.style.d.ts} +1 -1
  9. package/components/media-card-group/{style/index.js → media-card-group.style.js} +1 -1
  10. package/components/number-format/index.d.ts +105 -23
  11. package/components/number-format/index.js +2 -2
  12. package/components/number-format/number-format.api.d.ts +41 -0
  13. package/components/number-format/number-format.api.js +34 -0
  14. package/components/number-format/number-format.d.ts +69 -18
  15. package/components/number-format/number-format.js +38 -8
  16. package/components/panel/index.d.ts +25 -6
  17. package/components/panel/index.js +2 -1
  18. package/components/panel/panel.api.d.ts +18 -0
  19. package/components/panel/panel.api.js +11 -0
  20. package/components/panel/panel.d.ts +16 -8
  21. package/components/panel/panel.js +36 -0
  22. package/components/{media-card-group/style/index.d.ts → panel/panel.style.d.ts} +1 -1
  23. package/components/panel/{style/index.js → panel.style.js} +1 -1
  24. package/package.json +1 -1
  25. package/components/media-card-group/media-card-group.vue.d.ts +0 -10
  26. package/components/media-card-group/media-card-group.vue.js +0 -71
  27. package/components/number-format/number-format.vue.d.ts +0 -19
  28. package/components/number-format/number-format.vue.js +0 -79
  29. package/components/panel/panel.vue.d.ts +0 -10
  30. package/components/panel/panel.vue.js +0 -53
@@ -83,8 +83,10 @@ export { defaultInputNumberRangeProps } from './input-number-range/input-number-
83
83
  export { defaultLongTextProps } from './long-text/long-text.js';
84
84
  export { maskEmits } from './mask/mask.api.js';
85
85
  export { mediaCardBaseProps, mediaCardProps, mediaCardSlots } from './media-card/media-card.api.js';
86
+ export { mediaCardGroupProps, mediaCardGroupSlots } from './media-card-group/media-card-group.api.js';
86
87
  export { mediaViewerBaseEmits, mediaViewerBaseProps, mediaViewerEmits, mediaViewerProps } from './media-viewer/media-viewer.api.js';
87
- export { defaultNumberFormatProps } from './number-format/number-format.js';
88
+ export { numberFormatProps, numberFormatSlots } from './number-format/number-format.api.js';
89
+ export { panelProps, panelSlots } from './panel/panel.api.js';
88
90
  export { remoteSelectEmits, remoteSelectProps, remoteSelectSlots } from './remote-select/remote-select.api.js';
89
91
  export { defaultBreakpoints, defaultRowProps, generateAlgorithms, rowColumns, rowContextSymbol, rowSizes } from './row/row.js';
90
92
  export { snugMenuContextSymbol } from './snug-menu/snug-menu.js';
@@ -1,18 +1,37 @@
1
- export * from './media-card-group';
1
+ export * from './media-card-group.api';
2
2
  declare const _MediaCardGroup: {
3
- new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("./media-card-group").MediaCardGroupProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {}, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
3
+ new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
4
+ srcset: {
5
+ type: import("vue").PropType<string | (import("..").MediaCardBaseProps | string)[]>;
6
+ };
7
+ size: {
8
+ type: import("vue").PropType<import("..").MediaCardBaseProps["size"]>;
9
+ };
10
+ }>> & Readonly<{}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {}, true, {}, import("vue").SlotsType<import("./media-card-group.api").MediaCardGroupSlots>, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
4
11
  P: {};
5
12
  B: {};
6
13
  D: {};
7
14
  C: {};
8
15
  M: {};
9
16
  Defaults: {};
10
- }, Readonly<import("./media-card-group").MediaCardGroupProps> & Readonly<{}>, {}, {}, {}, {}, {}>;
17
+ }, Readonly<import("vue").ExtractPropTypes<{
18
+ srcset: {
19
+ type: import("vue").PropType<string | (import("..").MediaCardBaseProps | string)[]>;
20
+ };
21
+ size: {
22
+ type: import("vue").PropType<import("..").MediaCardBaseProps["size"]>;
23
+ };
24
+ }>> & Readonly<{}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, {}>;
11
25
  __isFragment?: never;
12
26
  __isTeleport?: never;
13
27
  __isSuspense?: never;
14
- } & import("vue").ComponentOptionsBase<Readonly<import("./media-card-group").MediaCardGroupProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
15
- $slots: import("./media-card-group").MediaCardGroupSlots;
16
- }) & import("vue").Plugin;
28
+ } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
29
+ srcset: {
30
+ type: import("vue").PropType<string | (import("..").MediaCardBaseProps | string)[]>;
31
+ };
32
+ size: {
33
+ type: import("vue").PropType<import("..").MediaCardBaseProps["size"]>;
34
+ };
35
+ }>> & Readonly<{}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}, {}, string, import("vue").SlotsType<import("./media-card-group.api").MediaCardGroupSlots>, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & import("vue").Plugin;
17
36
  export { _MediaCardGroup as MediaCardGroup };
18
37
  export default _MediaCardGroup;
@@ -1,5 +1,6 @@
1
1
  import { withInstall } from '../utils.js';
2
- import stdin_default$1 from './media-card-group.vue.js';
2
+ import stdin_default$1 from './media-card-group.js';
3
+ export { mediaCardGroupProps, mediaCardGroupSlots } from './media-card-group.api.js';
3
4
 
4
5
  const _MediaCardGroup = withInstall(stdin_default$1);
5
6
  var stdin_default = _MediaCardGroup;
@@ -0,0 +1,19 @@
1
+ import type { ExtractPropTypes, PropType, SlotsType } from 'vue';
2
+ import { type MediaCardBaseProps } from '../media-card/media-card.api';
3
+ export declare const mediaCardGroupProps: {
4
+ srcset: {
5
+ type: PropType<string | (MediaCardBaseProps | string)[]>;
6
+ };
7
+ size: {
8
+ type: PropType<MediaCardBaseProps["size"]>;
9
+ };
10
+ };
11
+ export type MediaCardGroupProps = ExtractPropTypes<typeof mediaCardGroupProps>;
12
+ export interface MediaCardGroupSlots {
13
+ default: {};
14
+ }
15
+ export declare const mediaCardGroupSlots: SlotsType<MediaCardGroupSlots>;
16
+ export interface MediaCardGroupEmits {
17
+ }
18
+ export interface MediaCardGroupExpose {
19
+ }
@@ -0,0 +1,11 @@
1
+ const mediaCardGroupProps = {
2
+ srcset: {
3
+ type: [String, Array]
4
+ },
5
+ size: {
6
+ type: String
7
+ }
8
+ };
9
+ const mediaCardGroupSlots = {};
10
+
11
+ export { mediaCardGroupProps, mediaCardGroupSlots };
@@ -1,12 +1,17 @@
1
1
  import { type MediaCardBaseProps } from '../media-card/media-card.api';
2
- export interface MediaCardGroupProps {
3
- srcset?: string | (MediaCardBaseProps | string)[];
4
- size?: MediaCardBaseProps['size'];
5
- }
6
- export interface MediaCardGroupSlots {
7
- default?: (props: Record<string, never>) => any;
8
- }
9
- export interface MediaCardGroupEmits {
10
- }
11
- export interface MediaCardGroupExpose {
12
- }
2
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
3
+ srcset: {
4
+ type: import("vue").PropType<string | (MediaCardBaseProps | string)[]>;
5
+ };
6
+ size: {
7
+ type: import("vue").PropType<MediaCardBaseProps["size"]>;
8
+ };
9
+ }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
10
+ srcset: {
11
+ type: import("vue").PropType<string | (MediaCardBaseProps | string)[]>;
12
+ };
13
+ size: {
14
+ type: import("vue").PropType<MediaCardBaseProps["size"]>;
15
+ };
16
+ }>> & Readonly<{}>, {}, import("vue").SlotsType<import("./media-card-group.api").MediaCardGroupSlots>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
17
+ export default _default;
@@ -1 +1,52 @@
1
+ import { defineComponent, computed, createVNode, mergeProps } from 'vue';
2
+ import { mediaCardGroupSlots, mediaCardGroupProps } from './media-card-group.api.js';
3
+ import stdin_default$1 from './media-card-group.style.js';
4
+ import stdin_default$2 from '../media-card/media-card.js';
5
+ import { useComponentConfig } from '../config-provider/config-provider.api.js';
6
+ import { isString } from '../../utils/is.js';
1
7
 
8
+ var stdin_default = defineComponent({
9
+ name: "CoMediaCardGroup",
10
+ props: mediaCardGroupProps,
11
+ slots: mediaCardGroupSlots,
12
+ setup(props) {
13
+ const {
14
+ prefixCls
15
+ } = useComponentConfig("media-card-group", props);
16
+ const {
17
+ hashId
18
+ } = stdin_default$1(prefixCls);
19
+ const mergedSrcset = computed(() => {
20
+ if (isString(props.srcset)) {
21
+ return [{
22
+ src: props.srcset
23
+ }];
24
+ }
25
+ if (Array.isArray(props.srcset)) {
26
+ return props.srcset.map(item => {
27
+ if (isString(item)) {
28
+ return {
29
+ src: item
30
+ };
31
+ }
32
+ return item;
33
+ });
34
+ }
35
+ return [];
36
+ });
37
+ const srcList = computed(() => mergedSrcset.value.map(item => item.src).filter(Boolean));
38
+ return () => {
39
+ return createVNode("div", {
40
+ "class": [hashId.value, prefixCls.value]
41
+ }, [mergedSrcset.value.map(item => {
42
+ return createVNode(stdin_default$2, mergeProps(item, {
43
+ "key": item.src,
44
+ "size": props.size,
45
+ "srcList": srcList.value
46
+ }), null);
47
+ })]);
48
+ };
49
+ }
50
+ });
51
+
52
+ export { stdin_default as default };
@@ -1,4 +1,4 @@
1
- declare const _default: (_prefixCls?: import("vue").ComputedRef<string> | string, themeManager?: import("../../theme/theme-context").ThemeManager) => {
1
+ declare const _default: (_prefixCls?: import("vue").ComputedRef<string> | string, themeManager?: import("../theme/theme-context").ThemeManager) => {
2
2
  hashId: import("vue").Ref<string, string>;
3
3
  };
4
4
  export default _default;
@@ -1,4 +1,4 @@
1
- import { getSimpleStyleHook } from '../../theme/getSimpleStyleHook.js';
1
+ import { getSimpleStyleHook } from '../theme/getSimpleStyleHook.js';
2
2
 
3
3
  var stdin_default = getSimpleStyleHook("CoMediaCardGroup", (token) => {
4
4
  const { componentCls } = token;
@@ -1,45 +1,127 @@
1
- export * from './number-format';
1
+ export * from './number-format.api';
2
2
  declare const _NumberFormat: {
3
- new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("./number-format").NumberFormatProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
4
- value: number | string;
5
- type: "currency" | "decimal" | "percent";
3
+ new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
4
+ value: {
5
+ type: (NumberConstructor | StringConstructor)[];
6
+ };
7
+ precision: {
8
+ type: NumberConstructor;
9
+ default: number;
10
+ };
11
+ animate: {
12
+ type: BooleanConstructor;
13
+ };
14
+ duration: {
15
+ type: NumberConstructor;
16
+ default: number;
17
+ };
18
+ locales: {
19
+ type: import("vue").PropType<"zh-Hans" | "en-US" | (string & {})>;
20
+ default: string;
21
+ };
22
+ type: {
23
+ type: import("vue").PropType<"currency" | "decimal" | "percent">;
24
+ default: string;
25
+ };
26
+ currency: {
27
+ type: import("vue").PropType<"CNY" | "USD" | (string & {})>;
28
+ default: string;
29
+ };
30
+ beforeDisplay: {
31
+ type: import("vue").PropType<(value: string) => string>;
32
+ };
33
+ }>> & Readonly<{}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
34
+ type: "decimal" | "percent" | "currency";
6
35
  animate: boolean;
7
36
  duration: number;
8
37
  precision: number;
9
- currency: "CNY" | "USD" | (string & {});
10
- locales: "zh-Hans" | "en-US" | (string & {});
11
- beforeDisplay: (value: string) => string;
12
- }, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
38
+ currency: (string & {}) | "CNY" | "USD";
39
+ locales: (string & {}) | "zh-Hans" | "en-US";
40
+ }, true, {}, import("vue").SlotsType<import("./number-format.api").NumberFormatSlots>, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
13
41
  P: {};
14
42
  B: {};
15
43
  D: {};
16
44
  C: {};
17
45
  M: {};
18
46
  Defaults: {};
19
- }, Readonly<import("./number-format").NumberFormatProps> & Readonly<{}>, {}, {}, {}, {}, {
20
- value: number | string;
21
- type: "currency" | "decimal" | "percent";
47
+ }, Readonly<import("vue").ExtractPropTypes<{
48
+ value: {
49
+ type: (NumberConstructor | StringConstructor)[];
50
+ };
51
+ precision: {
52
+ type: NumberConstructor;
53
+ default: number;
54
+ };
55
+ animate: {
56
+ type: BooleanConstructor;
57
+ };
58
+ duration: {
59
+ type: NumberConstructor;
60
+ default: number;
61
+ };
62
+ locales: {
63
+ type: import("vue").PropType<"zh-Hans" | "en-US" | (string & {})>;
64
+ default: string;
65
+ };
66
+ type: {
67
+ type: import("vue").PropType<"currency" | "decimal" | "percent">;
68
+ default: string;
69
+ };
70
+ currency: {
71
+ type: import("vue").PropType<"CNY" | "USD" | (string & {})>;
72
+ default: string;
73
+ };
74
+ beforeDisplay: {
75
+ type: import("vue").PropType<(value: string) => string>;
76
+ };
77
+ }>> & Readonly<{}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, {
78
+ type: "decimal" | "percent" | "currency";
22
79
  animate: boolean;
23
80
  duration: number;
24
81
  precision: number;
25
- currency: "CNY" | "USD" | (string & {});
26
- locales: "zh-Hans" | "en-US" | (string & {});
27
- beforeDisplay: (value: string) => string;
82
+ currency: (string & {}) | "CNY" | "USD";
83
+ locales: (string & {}) | "zh-Hans" | "en-US";
28
84
  }>;
29
85
  __isFragment?: never;
30
86
  __isTeleport?: never;
31
87
  __isSuspense?: never;
32
- } & import("vue").ComponentOptionsBase<Readonly<import("./number-format").NumberFormatProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
33
- value: number | string;
34
- type: "currency" | "decimal" | "percent";
88
+ } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
89
+ value: {
90
+ type: (NumberConstructor | StringConstructor)[];
91
+ };
92
+ precision: {
93
+ type: NumberConstructor;
94
+ default: number;
95
+ };
96
+ animate: {
97
+ type: BooleanConstructor;
98
+ };
99
+ duration: {
100
+ type: NumberConstructor;
101
+ default: number;
102
+ };
103
+ locales: {
104
+ type: import("vue").PropType<"zh-Hans" | "en-US" | (string & {})>;
105
+ default: string;
106
+ };
107
+ type: {
108
+ type: import("vue").PropType<"currency" | "decimal" | "percent">;
109
+ default: string;
110
+ };
111
+ currency: {
112
+ type: import("vue").PropType<"CNY" | "USD" | (string & {})>;
113
+ default: string;
114
+ };
115
+ beforeDisplay: {
116
+ type: import("vue").PropType<(value: string) => string>;
117
+ };
118
+ }>> & Readonly<{}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
119
+ type: "decimal" | "percent" | "currency";
35
120
  animate: boolean;
36
121
  duration: number;
37
122
  precision: number;
38
- currency: "CNY" | "USD" | (string & {});
39
- locales: "zh-Hans" | "en-US" | (string & {});
40
- beforeDisplay: (value: string) => string;
41
- }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
42
- $slots: import("./number-format").NumberFormatSlots;
43
- }) & import("vue").Plugin;
123
+ currency: (string & {}) | "CNY" | "USD";
124
+ locales: (string & {}) | "zh-Hans" | "en-US";
125
+ }, {}, string, import("vue").SlotsType<import("./number-format.api").NumberFormatSlots>, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & import("vue").Plugin;
44
126
  export { _NumberFormat as NumberFormat };
45
127
  export default _NumberFormat;
@@ -1,6 +1,6 @@
1
1
  import { withInstall } from '../utils.js';
2
- import stdin_default$1 from './number-format.vue.js';
3
- export { defaultNumberFormatProps } from './number-format.js';
2
+ import stdin_default$1 from './number-format.js';
3
+ export { numberFormatProps, numberFormatSlots } from './number-format.api.js';
4
4
 
5
5
  const _NumberFormat = withInstall(stdin_default$1);
6
6
  var stdin_default = _NumberFormat;
@@ -0,0 +1,41 @@
1
+ import type { ExtractPropTypes, PropType, SlotsType } from 'vue';
2
+ export declare const numberFormatProps: {
3
+ value: {
4
+ type: (NumberConstructor | StringConstructor)[];
5
+ };
6
+ precision: {
7
+ type: NumberConstructor;
8
+ default: number;
9
+ };
10
+ animate: {
11
+ type: BooleanConstructor;
12
+ };
13
+ duration: {
14
+ type: NumberConstructor;
15
+ default: number;
16
+ };
17
+ locales: {
18
+ type: PropType<"zh-Hans" | "en-US" | (string & {})>;
19
+ default: string;
20
+ };
21
+ type: {
22
+ type: PropType<"currency" | "decimal" | "percent">;
23
+ default: string;
24
+ };
25
+ currency: {
26
+ type: PropType<"CNY" | "USD" | (string & {})>;
27
+ default: string;
28
+ };
29
+ beforeDisplay: {
30
+ type: PropType<(value: string) => string>;
31
+ };
32
+ };
33
+ export type NumberFormatProps = ExtractPropTypes<typeof numberFormatProps>;
34
+ export interface NumberFormatSlots {
35
+ default: {};
36
+ }
37
+ export declare const numberFormatSlots: SlotsType<NumberFormatSlots>;
38
+ export interface NumberFormatEmits {
39
+ }
40
+ export interface NumberFormatExpose {
41
+ }
@@ -0,0 +1,34 @@
1
+ const numberFormatProps = {
2
+ value: {
3
+ type: [Number, String]
4
+ },
5
+ precision: {
6
+ type: Number,
7
+ default: 0
8
+ },
9
+ animate: {
10
+ type: Boolean
11
+ },
12
+ duration: {
13
+ type: Number,
14
+ default: 1500
15
+ },
16
+ locales: {
17
+ type: String,
18
+ default: "zh-Hans"
19
+ },
20
+ type: {
21
+ type: String,
22
+ default: "decimal"
23
+ },
24
+ currency: {
25
+ type: String,
26
+ default: "CNY"
27
+ },
28
+ beforeDisplay: {
29
+ type: Function
30
+ }
31
+ };
32
+ const numberFormatSlots = {};
33
+
34
+ export { numberFormatProps, numberFormatSlots };
@@ -1,18 +1,69 @@
1
- export interface NumberFormatProps {
2
- value?: number | string;
3
- precision?: number;
4
- animate?: boolean;
5
- duration?: number;
6
- locales?: 'zh-Hans' | 'en-US' | (string & {});
7
- type?: 'currency' | 'decimal' | 'percent';
8
- currency?: 'CNY' | 'USD' | (string & {});
9
- beforeDisplay?: (value: string) => string;
10
- }
11
- export declare const defaultNumberFormatProps: NumberFormatProps;
12
- export interface NumberFormatSlots {
13
- default?: (props: Record<string, never>) => any;
14
- }
15
- export interface NumberFormatEmits {
16
- }
17
- export interface NumberFormatExpose {
18
- }
1
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
+ value: {
3
+ type: (NumberConstructor | StringConstructor)[];
4
+ };
5
+ precision: {
6
+ type: NumberConstructor;
7
+ default: number;
8
+ };
9
+ animate: {
10
+ type: BooleanConstructor;
11
+ };
12
+ duration: {
13
+ type: NumberConstructor;
14
+ default: number;
15
+ };
16
+ locales: {
17
+ type: import("vue").PropType<"zh-Hans" | "en-US" | (string & {})>;
18
+ default: string;
19
+ };
20
+ type: {
21
+ type: import("vue").PropType<"currency" | "decimal" | "percent">;
22
+ default: string;
23
+ };
24
+ currency: {
25
+ type: import("vue").PropType<"CNY" | "USD" | (string & {})>;
26
+ default: string;
27
+ };
28
+ beforeDisplay: {
29
+ type: import("vue").PropType<(value: string) => string>;
30
+ };
31
+ }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
32
+ value: {
33
+ type: (NumberConstructor | StringConstructor)[];
34
+ };
35
+ precision: {
36
+ type: NumberConstructor;
37
+ default: number;
38
+ };
39
+ animate: {
40
+ type: BooleanConstructor;
41
+ };
42
+ duration: {
43
+ type: NumberConstructor;
44
+ default: number;
45
+ };
46
+ locales: {
47
+ type: import("vue").PropType<"zh-Hans" | "en-US" | (string & {})>;
48
+ default: string;
49
+ };
50
+ type: {
51
+ type: import("vue").PropType<"currency" | "decimal" | "percent">;
52
+ default: string;
53
+ };
54
+ currency: {
55
+ type: import("vue").PropType<"CNY" | "USD" | (string & {})>;
56
+ default: string;
57
+ };
58
+ beforeDisplay: {
59
+ type: import("vue").PropType<(value: string) => string>;
60
+ };
61
+ }>> & Readonly<{}>, {
62
+ type: "decimal" | "percent" | "currency";
63
+ animate: boolean;
64
+ duration: number;
65
+ precision: number;
66
+ currency: (string & {}) | "CNY" | "USD";
67
+ locales: (string & {}) | "zh-Hans" | "en-US";
68
+ }, import("vue").SlotsType<import("./number-format.api").NumberFormatSlots>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
69
+ export default _default;
@@ -1,9 +1,39 @@
1
- const defaultNumberFormatProps = {
2
- precision: 0,
3
- duration: 1500,
4
- locales: "zh-Hans",
5
- type: "decimal",
6
- currency: "CNY"
7
- };
1
+ import { defineComponent, ref, watch, nextTick, reactive, toRef, computed, createVNode } from 'vue';
2
+ import { numberFormatSlots, numberFormatProps } from './number-format.api.js';
3
+ import { useTransition, TransitionPresets } from '@vueuse/core';
8
4
 
9
- export { defaultNumberFormatProps };
5
+ var stdin_default = defineComponent({
6
+ name: "CoNumberFormat",
7
+ props: numberFormatProps,
8
+ slots: numberFormatSlots,
9
+ setup(props) {
10
+ const numValue = ref(0);
11
+ watch(() => props.value, () => {
12
+ nextTick(() => {
13
+ numValue.value = Number(props.value) || 0;
14
+ });
15
+ }, {
16
+ immediate: true
17
+ });
18
+ const animatedValue = useTransition(numValue, reactive({
19
+ duration: toRef(() => props.duration),
20
+ disabled: toRef(() => !props.animate),
21
+ transition: TransitionPresets.easeInOutQuint
22
+ }));
23
+ const displayValue = computed(() => {
24
+ let value = Intl.NumberFormat(props.locales, {
25
+ style: props.type,
26
+ currency: props.currency
27
+ }).format(animatedValue.value);
28
+ const [integer, decimal = ""] = value.split(".");
29
+ const _decimal = decimal.padEnd(props.precision, "0").slice(0, props.precision);
30
+ value = [integer, _decimal].join(_decimal ? "." : "");
31
+ return props.beforeDisplay ? props.beforeDisplay(value) : value;
32
+ });
33
+ return () => {
34
+ return createVNode("span", null, [displayValue.value]);
35
+ };
36
+ }
37
+ });
38
+
39
+ export { stdin_default as default };
@@ -1,18 +1,37 @@
1
- export * from './panel';
1
+ export * from './panel.api';
2
2
  declare const _Panel: {
3
- new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("./panel").PanelProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {}, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
3
+ new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
4
+ maxHeight: {
5
+ type: (NumberConstructor | StringConstructor)[];
6
+ };
7
+ header: {
8
+ type: (NumberConstructor | StringConstructor)[];
9
+ };
10
+ }>> & Readonly<{}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {}, true, {}, import("vue").SlotsType<import("./panel.api").PanelSlots>, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
4
11
  P: {};
5
12
  B: {};
6
13
  D: {};
7
14
  C: {};
8
15
  M: {};
9
16
  Defaults: {};
10
- }, Readonly<import("./panel").PanelProps> & Readonly<{}>, {}, {}, {}, {}, {}>;
17
+ }, Readonly<import("vue").ExtractPropTypes<{
18
+ maxHeight: {
19
+ type: (NumberConstructor | StringConstructor)[];
20
+ };
21
+ header: {
22
+ type: (NumberConstructor | StringConstructor)[];
23
+ };
24
+ }>> & Readonly<{}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, {}>;
11
25
  __isFragment?: never;
12
26
  __isTeleport?: never;
13
27
  __isSuspense?: never;
14
- } & import("vue").ComponentOptionsBase<Readonly<import("./panel").PanelProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
15
- $slots: import("./panel").PanelSlots;
16
- }) & import("vue").Plugin;
28
+ } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
29
+ maxHeight: {
30
+ type: (NumberConstructor | StringConstructor)[];
31
+ };
32
+ header: {
33
+ type: (NumberConstructor | StringConstructor)[];
34
+ };
35
+ }>> & Readonly<{}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}, {}, string, import("vue").SlotsType<import("./panel.api").PanelSlots>, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & import("vue").Plugin;
17
36
  export { _Panel as Panel };
18
37
  export default _Panel;
@@ -1,5 +1,6 @@
1
1
  import { withInstall } from '../utils.js';
2
- import stdin_default$1 from './panel.vue.js';
2
+ import stdin_default$1 from './panel.js';
3
+ export { panelProps, panelSlots } from './panel.api.js';
3
4
 
4
5
  const _Panel = withInstall(stdin_default$1);
5
6
  var stdin_default = _Panel;
@@ -0,0 +1,18 @@
1
+ import type { SlotsType } from 'vue';
2
+ export interface PanelProps {
3
+ maxHeight?: string | number;
4
+ header?: string | number;
5
+ }
6
+ export declare const panelProps: {
7
+ maxHeight: {
8
+ type: (NumberConstructor | StringConstructor)[];
9
+ };
10
+ header: {
11
+ type: (NumberConstructor | StringConstructor)[];
12
+ };
13
+ };
14
+ export interface PanelSlots {
15
+ default?: {};
16
+ header?: {};
17
+ }
18
+ export declare const panelSlots: SlotsType<PanelSlots>;
@@ -0,0 +1,11 @@
1
+ const panelProps = {
2
+ maxHeight: {
3
+ type: [String, Number]
4
+ },
5
+ header: {
6
+ type: [String, Number]
7
+ }
8
+ };
9
+ const panelSlots = {};
10
+
11
+ export { panelProps, panelSlots };
@@ -1,8 +1,16 @@
1
- export interface PanelProps {
2
- maxHeight?: string | number;
3
- header?: string | number;
4
- }
5
- export interface PanelSlots {
6
- default?: (props: Record<string, never>) => any;
7
- header?: (props: Record<string, never>) => any;
8
- }
1
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
+ maxHeight: {
3
+ type: (NumberConstructor | StringConstructor)[];
4
+ };
5
+ header: {
6
+ type: (NumberConstructor | StringConstructor)[];
7
+ };
8
+ }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
9
+ maxHeight: {
10
+ type: (NumberConstructor | StringConstructor)[];
11
+ };
12
+ header: {
13
+ type: (NumberConstructor | StringConstructor)[];
14
+ };
15
+ }>> & Readonly<{}>, {}, import("vue").SlotsType<import("./panel.api").PanelSlots>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
16
+ export default _default;
@@ -1 +1,37 @@
1
+ import { defineComponent, createVNode } from 'vue';
2
+ import { ElScrollbar } from 'element-plus';
3
+ import { panelSlots, panelProps } from './panel.api.js';
4
+ import stdin_default$1 from './panel.style.js';
5
+ import { useComponentConfig } from '../config-provider/config-provider.api.js';
1
6
 
7
+ var stdin_default = defineComponent({
8
+ name: "CoPanel",
9
+ props: panelProps,
10
+ slots: panelSlots,
11
+ setup(props, {
12
+ slots
13
+ }) {
14
+ const {
15
+ prefixCls
16
+ } = useComponentConfig("panel", props);
17
+ const {
18
+ hashId
19
+ } = stdin_default$1(prefixCls);
20
+ return () => {
21
+ return createVNode("div", {
22
+ "class": [hashId.value, prefixCls.value]
23
+ }, [(slots.header || props.header) && createVNode("div", {
24
+ "class": `${prefixCls.value}-header`
25
+ }, [slots.header ? slots.header() : props.header]), createVNode(ElScrollbar, {
26
+ "always": true,
27
+ "maxHeight": props.maxHeight
28
+ }, {
29
+ default: () => [createVNode("div", {
30
+ "class": `${prefixCls.value}-body`
31
+ }, [slots.default?.()])]
32
+ })]);
33
+ };
34
+ }
35
+ });
36
+
37
+ export { stdin_default as default };
@@ -1,4 +1,4 @@
1
- declare const _default: (_prefixCls?: import("vue").ComputedRef<string> | string, themeManager?: import("../../theme/theme-context").ThemeManager) => {
1
+ declare const _default: (_prefixCls?: import("vue").ComputedRef<string> | string, themeManager?: import("../theme/theme-context").ThemeManager) => {
2
2
  hashId: import("vue").Ref<string, string>;
3
3
  };
4
4
  export default _default;
@@ -1,4 +1,4 @@
1
- import { getSimpleStyleHook } from '../../theme/getSimpleStyleHook.js';
1
+ import { getSimpleStyleHook } from '../theme/getSimpleStyleHook.js';
2
2
 
3
3
  var stdin_default = getSimpleStyleHook("CoPanel", (token) => {
4
4
  const { componentCls } = token;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cosey",
3
- "version": "0.6.12",
3
+ "version": "0.6.13",
4
4
  "description": "基于 Vue3 + vite 的后台管理系统框架",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -1,10 +0,0 @@
1
- import { type MediaCardGroupProps, type MediaCardGroupSlots } from './media-card-group';
2
- type __VLS_Slots = MediaCardGroupSlots;
3
- declare const __VLS_component: import("vue").DefineComponent<MediaCardGroupProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MediaCardGroupProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
4
- declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
5
- export default _default;
6
- type __VLS_WithSlots<T, S> = T & {
7
- new (): {
8
- $slots: S;
9
- };
10
- };
@@ -1,71 +0,0 @@
1
- import { defineComponent, computed, createElementBlock, openBlock, normalizeClass, unref, Fragment, renderList, createBlock, mergeProps } from 'vue';
2
- import stdin_default$1 from './style/index.js';
3
- import stdin_default$2 from '../media-card/media-card.js';
4
- import { useComponentConfig } from '../config-provider/config-provider.api.js';
5
- import { isString } from '../../utils/is.js';
6
-
7
- var stdin_default = /* @__PURE__ */defineComponent({
8
- ...{
9
- name: "CoMediaCardGroup"
10
- },
11
- __name: "media-card-group",
12
- props: {
13
- srcset: {
14
- type: [String, Array],
15
- required: false
16
- },
17
- size: {
18
- type: null,
19
- required: false
20
- }
21
- },
22
- setup(__props, {
23
- expose: __expose
24
- }) {
25
- const props = __props;
26
- const {
27
- prefixCls
28
- } = useComponentConfig("media-card-group", props);
29
- const {
30
- hashId
31
- } = stdin_default$1(prefixCls);
32
- const mergedSrcset = computed(() => {
33
- if (isString(props.srcset)) {
34
- return [{
35
- src: props.srcset
36
- }];
37
- }
38
- if (Array.isArray(props.srcset)) {
39
- return props.srcset.map(item => {
40
- if (isString(item)) {
41
- return {
42
- src: item
43
- };
44
- }
45
- return item;
46
- });
47
- }
48
- return [];
49
- });
50
- const srcList = computed(() => mergedSrcset.value.map(item => item.src).filter(Boolean));
51
- __expose();
52
- return (_ctx, _cache) => {
53
- return openBlock(), createElementBlock("div", {
54
- class: normalizeClass([unref(hashId), unref(prefixCls)])
55
- }, [(openBlock(true), createElementBlock(Fragment, null, renderList(mergedSrcset.value, item => {
56
- return openBlock(), createBlock(unref(stdin_default$2), mergeProps({
57
- key: item.src
58
- }, {
59
- ref_for: true
60
- }, item, {
61
- size: _ctx.size,
62
- "src-list": srcList.value
63
- }), null, 16, ["size", "src-list"]);
64
- }), 128
65
- /* KEYED_FRAGMENT */))], 2
66
- /* CLASS */);
67
- };
68
- }
69
- });
70
-
71
- export { stdin_default as default };
@@ -1,19 +0,0 @@
1
- import { type NumberFormatProps, type NumberFormatSlots } from './number-format';
2
- type __VLS_Slots = NumberFormatSlots;
3
- declare const __VLS_component: import("vue").DefineComponent<NumberFormatProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NumberFormatProps> & Readonly<{}>, {
4
- value: number | string;
5
- type: "currency" | "decimal" | "percent";
6
- animate: boolean;
7
- duration: number;
8
- precision: number;
9
- currency: "CNY" | "USD" | (string & {});
10
- locales: "zh-Hans" | "en-US" | (string & {});
11
- beforeDisplay: (value: string) => string;
12
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
- declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
14
- export default _default;
15
- type __VLS_WithSlots<T, S> = T & {
16
- new (): {
17
- $slots: S;
18
- };
19
- };
@@ -1,79 +0,0 @@
1
- import { defineComponent, mergeDefaults, ref, watch, nextTick, reactive, toRef, computed, createElementBlock, openBlock, toDisplayString } from 'vue';
2
- import { defaultNumberFormatProps } from './number-format.js';
3
- import { useTransition, TransitionPresets } from '@vueuse/core';
4
-
5
- var stdin_default = /* @__PURE__ */defineComponent({
6
- ...{
7
- name: "CoNumberFormat"
8
- },
9
- __name: "number-format",
10
- props: /* @__PURE__ */mergeDefaults({
11
- value: {
12
- type: [Number, String],
13
- required: false
14
- },
15
- precision: {
16
- type: Number,
17
- required: false
18
- },
19
- animate: {
20
- type: Boolean,
21
- required: false
22
- },
23
- duration: {
24
- type: Number,
25
- required: false
26
- },
27
- locales: {
28
- type: [String, Object],
29
- required: false
30
- },
31
- type: {
32
- type: String,
33
- required: false
34
- },
35
- currency: {
36
- type: [String, Object],
37
- required: false
38
- },
39
- beforeDisplay: {
40
- type: Function,
41
- required: false
42
- }
43
- }, defaultNumberFormatProps),
44
- setup(__props, {
45
- expose: __expose
46
- }) {
47
- const props = __props;
48
- const numValue = ref(0);
49
- watch(() => props.value, () => {
50
- nextTick(() => {
51
- numValue.value = Number(props.value) || 0;
52
- });
53
- }, {
54
- immediate: true
55
- });
56
- const animatedValue = useTransition(numValue, reactive({
57
- duration: toRef(() => props.duration),
58
- disabled: toRef(() => !props.animate),
59
- transition: TransitionPresets.easeInOutQuint
60
- }));
61
- const displayValue = computed(() => {
62
- let value = Intl.NumberFormat(props.locales, {
63
- style: props.type,
64
- currency: props.currency
65
- }).format(animatedValue.value);
66
- let [integer, decimal = ""] = value.split(".");
67
- decimal = decimal.padEnd(props.precision, "0").slice(0, props.precision);
68
- value = [integer, decimal].join(decimal ? "." : "");
69
- return props.beforeDisplay ? props.beforeDisplay(value) : value;
70
- });
71
- __expose();
72
- return (_ctx, _cache) => {
73
- return openBlock(), createElementBlock("span", null, toDisplayString(displayValue.value), 1
74
- /* TEXT */);
75
- };
76
- }
77
- });
78
-
79
- export { stdin_default as default };
@@ -1,10 +0,0 @@
1
- import { type PanelProps, type PanelSlots } from './panel';
2
- type __VLS_Slots = PanelSlots;
3
- declare const __VLS_component: import("vue").DefineComponent<PanelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<PanelProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
4
- declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
5
- export default _default;
6
- type __VLS_WithSlots<T, S> = T & {
7
- new (): {
8
- $slots: S;
9
- };
10
- };
@@ -1,53 +0,0 @@
1
- import { defineComponent, resolveComponent, createElementBlock, openBlock, normalizeClass, unref, createCommentVNode, createVNode, renderSlot, createTextVNode, toDisplayString, withCtx, createElementVNode } from 'vue';
2
- import stdin_default$1 from './style/index.js';
3
- import { useComponentConfig } from '../config-provider/config-provider.api.js';
4
-
5
- var stdin_default = /* @__PURE__ */defineComponent({
6
- ...{
7
- name: "CoPanel"
8
- },
9
- __name: "panel",
10
- props: {
11
- maxHeight: {
12
- type: [String, Number],
13
- required: false
14
- },
15
- header: {
16
- type: [String, Number],
17
- required: false
18
- }
19
- },
20
- setup(__props) {
21
- const props = __props;
22
- const {
23
- prefixCls
24
- } = useComponentConfig("panel", props);
25
- const {
26
- hashId
27
- } = stdin_default$1(prefixCls);
28
- return (_ctx, _cache) => {
29
- const _component_el_scrollbar = resolveComponent("el-scrollbar");
30
- return openBlock(), createElementBlock("div", {
31
- class: normalizeClass([unref(hashId), unref(prefixCls)])
32
- }, [_ctx.$slots.header || _ctx.header ? (openBlock(), createElementBlock("div", {
33
- key: 0,
34
- class: normalizeClass(`${unref(prefixCls)}-header`)
35
- }, [renderSlot(_ctx.$slots, "header", {}, () => [createTextVNode(toDisplayString(_ctx.header), 1
36
- /* TEXT */)])], 2
37
- /* CLASS */)) : createCommentVNode("v-if", true), createVNode(_component_el_scrollbar, {
38
- always: "",
39
- "max-height": _ctx.maxHeight
40
- }, {
41
- default: withCtx(() => [createElementVNode("div", {
42
- class: normalizeClass(`${unref(prefixCls)}-body`)
43
- }, [renderSlot(_ctx.$slots, "default")], 2
44
- /* CLASS */)]),
45
- _: 3
46
- /* FORWARDED */
47
- }, 8, ["max-height"])], 2
48
- /* CLASS */);
49
- };
50
- }
51
- });
52
-
53
- export { stdin_default as default };