@central-design-system/components 3.0.0-alpha.11 → 3.0.0-alpha.12
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/dist/cds.css +1 -1
- package/dist/cds.d.ts +3 -1
- package/dist/cds.es.js +5329 -4822
- package/dist/cds.umd.js +3 -3
- package/dist/components/CdsButton/CdsButton.vue.d.ts +10 -10
- package/dist/components/CdsCombobox/CdsCombobox.vue.d.ts +58 -58
- package/dist/components/CdsContainer/CdsContainer.vue.d.ts +220 -0
- package/dist/components/CdsContainer/CdsContainerItem.vue.d.ts +69 -0
- package/dist/components/CdsContainer/index.d.ts +2 -0
- package/dist/components/CdsDatePicker/CdsDatePicker.vue.d.ts +1 -1
- package/dist/components/CdsDropdown/CdsDropdown.vue.d.ts +58 -58
- package/dist/components/CdsIcon/CdsIcon.vue.d.ts +3 -3
- package/dist/components/CdsInput/CdsInput.vue.d.ts +10 -10
- package/dist/components/CdsList/CdsListGroup.vue.d.ts +7 -7
- package/dist/components/CdsList/CdsListItem.vue.d.ts +10 -10
- package/dist/components/CdsSelect/CdsSelect.vue.d.ts +34 -34
- package/dist/components/CdsTable/CdsTable.vue.d.ts +1 -1
- package/dist/components/CdsTable/components/Table/InternalTable.d.ts +1 -1
- package/dist/components/CdsTable/components/TableProvider.d.ts +1 -1
- package/dist/components/CdsTextArea/CdsTextArea.vue.d.ts +34 -34
- package/dist/components/CdsTextInput/CdsTextInput.vue.d.ts +34 -34
- package/dist/components/CdsTimePicker/CdsTimePicker.vue.d.ts +1 -1
- package/dist/components/index.d.ts +4 -1
- package/dist/composable/field.d.ts +2 -2
- package/dist/composable/group.d.ts +113 -0
- package/dist/composable/icon.d.ts +2 -2
- package/dist/composable/index.d.ts +2 -0
- package/dist/composable/ssrBoot.d.ts +6 -0
- package/dist/directives/index.d.ts +1 -0
- package/dist/directives/touch/index.d.ts +46 -0
- package/dist/globals.d.ts +5 -0
- package/dist/locale/index.d.ts +4 -0
- package/dist/utils/dom/anchor.d.ts +1 -1
- package/dist/utils/helpers.d.ts +6 -1
- package/package.json +1 -1
- package/src/scss/themes/index.ts +1 -1
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import type { ComponentInternalInstance, ComputedRef, ExtractPropTypes, InjectionKey, PropType, Ref } from 'vue';
|
|
2
|
+
import type { IDisabledProps } from '../composable';
|
|
3
|
+
export interface IGroupItem {
|
|
4
|
+
id: number;
|
|
5
|
+
value: Ref<unknown>;
|
|
6
|
+
disabled: Ref<boolean | undefined>;
|
|
7
|
+
}
|
|
8
|
+
export interface IGroupProps {
|
|
9
|
+
disabled: boolean;
|
|
10
|
+
modelValue: unknown;
|
|
11
|
+
multiple?: boolean;
|
|
12
|
+
required?: boolean | 'force';
|
|
13
|
+
max?: number;
|
|
14
|
+
selectedClass: string | undefined;
|
|
15
|
+
}
|
|
16
|
+
export interface IGroupProvide {
|
|
17
|
+
selected: Ref<Readonly<number[]>>;
|
|
18
|
+
selectedClass: Ref<string | undefined>;
|
|
19
|
+
items: ComputedRef<{
|
|
20
|
+
id: number;
|
|
21
|
+
value: unknown;
|
|
22
|
+
disabled: boolean | undefined;
|
|
23
|
+
}[]>;
|
|
24
|
+
disabled: Ref<boolean | undefined>;
|
|
25
|
+
register: (item: IGroupItem, instance: ComponentInternalInstance) => void;
|
|
26
|
+
unregister: (id: number) => void;
|
|
27
|
+
select: (id: number, value: boolean) => void;
|
|
28
|
+
isSelected: (id: number) => boolean;
|
|
29
|
+
prev: () => void;
|
|
30
|
+
next: () => void;
|
|
31
|
+
getItemIndex: (value: unknown) => number;
|
|
32
|
+
}
|
|
33
|
+
export interface IGroupItemProvide {
|
|
34
|
+
id: number;
|
|
35
|
+
isSelected: Ref<boolean>;
|
|
36
|
+
selectedClass: Ref<(string | undefined)[] | false>;
|
|
37
|
+
value: Ref<unknown>;
|
|
38
|
+
disabled: Ref<boolean | undefined>;
|
|
39
|
+
group: IGroupProvide;
|
|
40
|
+
select: (value: boolean) => void;
|
|
41
|
+
toggle: () => void;
|
|
42
|
+
}
|
|
43
|
+
export declare const makeGroupProps: <Defaults extends {
|
|
44
|
+
modelValue?: unknown;
|
|
45
|
+
multiple?: unknown;
|
|
46
|
+
required?: unknown;
|
|
47
|
+
max?: unknown;
|
|
48
|
+
selectedClass?: unknown;
|
|
49
|
+
} = {}>(defaults?: Defaults | undefined) => import('../utils').AppendDefault<{
|
|
50
|
+
/**
|
|
51
|
+
* Значение v-model
|
|
52
|
+
*/
|
|
53
|
+
modelValue: {
|
|
54
|
+
type: PropType<unknown>;
|
|
55
|
+
default: undefined;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Множественный выбор
|
|
59
|
+
*/
|
|
60
|
+
multiple: {
|
|
61
|
+
type: BooleanConstructor;
|
|
62
|
+
default: boolean;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Обязательно должен быть выбран хотя бы один элемент
|
|
66
|
+
*/
|
|
67
|
+
required: {
|
|
68
|
+
type: PropType<boolean | "force">;
|
|
69
|
+
default: boolean;
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Максимально допустимое количество выбранных элементов
|
|
73
|
+
*/
|
|
74
|
+
max: {
|
|
75
|
+
type: NumberConstructor;
|
|
76
|
+
default: undefined;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Классы для выбранных элементов
|
|
80
|
+
*/
|
|
81
|
+
selectedClass: {
|
|
82
|
+
type: PropType<string>;
|
|
83
|
+
default: undefined;
|
|
84
|
+
};
|
|
85
|
+
}, Defaults>;
|
|
86
|
+
export interface IGroupItemProps extends ExtractPropTypes<ReturnType<typeof makeGroupItemProps>> {
|
|
87
|
+
disabled: IDisabledProps['disabled'];
|
|
88
|
+
'onGroup:selected': ((value: {
|
|
89
|
+
value: boolean;
|
|
90
|
+
}) => void) | undefined;
|
|
91
|
+
}
|
|
92
|
+
export declare const makeGroupItemProps: <Defaults extends {
|
|
93
|
+
value?: unknown;
|
|
94
|
+
selectedClass?: unknown;
|
|
95
|
+
} = {}>(defaults?: Defaults | undefined) => import('../utils').AppendDefault<{
|
|
96
|
+
/**
|
|
97
|
+
* Значение элемента
|
|
98
|
+
*/
|
|
99
|
+
value: {
|
|
100
|
+
type: null;
|
|
101
|
+
default: null;
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* Классы для выбранных элементов
|
|
105
|
+
*/
|
|
106
|
+
selectedClass: {
|
|
107
|
+
type: PropType<string>;
|
|
108
|
+
default: undefined;
|
|
109
|
+
};
|
|
110
|
+
}, Defaults>;
|
|
111
|
+
export declare function useGroupItem(props: IGroupItemProps, injectKey: InjectionKey<IGroupProvide>, required?: true): IGroupItemProvide;
|
|
112
|
+
export declare function useGroupItem(props: IGroupItemProps, injectKey: InjectionKey<IGroupProvide>, required: false): IGroupItemProvide | null;
|
|
113
|
+
export declare function useGroup(props: IGroupProps, injectKey: InjectionKey<IGroupProvide>): IGroupProvide;
|
|
@@ -22,7 +22,7 @@ export declare const makeIconProps: <Defaults extends {
|
|
|
22
22
|
* Иконка в начале элемента
|
|
23
23
|
*/
|
|
24
24
|
prependIcon: {
|
|
25
|
-
type: PropType<"link" | "filters" | "search" | "add" | "alert-fill" | "alert" | "analog" | "arrow-down" | "arrow-left-bottom" | "arrow-left-top" | "arrow-left" | "arrow-right-bottom" | "arrow-right-top" | "arrow-right" | "arrow-up" | "arrows-vertical" | "calendar" | "card-bank" | "category" | "check-fill" | "check" | "chevron-down" | "chevron-left" | "chevron-right" | "chevron-up" | "chocolate-menu" | "clock" | "comment" | "company" | "compare" | "copy" | "data-cards" | "delete" | "directory" | "doc-download" | "doc" | "download" | "draggable" | "edit" | "enter" | "error-fill" | "error" | "external" | "facebook-fill" | "facebook" | "flag" | "funnel" | "globe" | "infinity" | "info-fill" | "info" | "list-search" | "list" | "loader" | "location" | "locked" | "login" | "logout" | "menu" | "minus" | "notification" | "overflow-menu-horizontal" | "overflow-menu-vertical" | "password" | "pin" | "plus" | "printer" | "question-fill" | "question" | "refresh" | "remove" | "sandglass" | "save" | "settings" | "shopping-cart" | "sort-date" | "star-fill" | "star" | "telegram" | "timer" | "tool" | "truck" | "unlocked" | "upload" | "user-avatar" | "user-group" | "visibility-off" | "visibility-on" | "vk" | "winner" | "workspace" | "youtube">;
|
|
25
|
+
type: PropType<"link" | "filters" | "search" | "add" | "alert-fill" | "alert" | "analog" | "arrow-down" | "arrow-left-bottom" | "arrow-left-top" | "arrow-left" | "arrow-right-bottom" | "arrow-right-top" | "arrow-right" | "arrow-up" | "arrows-vertical" | "calendar" | "card-bank" | "category" | "check-fill" | "check" | "checkbox-fill" | "checkbox" | "chevron-down" | "chevron-left" | "chevron-right" | "chevron-up" | "chocolate-menu" | "clock" | "comment" | "company" | "compare" | "copy" | "data-cards" | "delete" | "directory" | "doc-download" | "doc" | "download" | "draggable" | "edit" | "enter" | "error-fill" | "error" | "external" | "facebook-fill" | "facebook" | "flag" | "funnel" | "globe" | "infinity" | "info-fill" | "info" | "list-search" | "list" | "loader" | "location" | "locked" | "login" | "logout" | "menu" | "minus" | "notification" | "overflow-menu-horizontal" | "overflow-menu-vertical" | "password" | "pin" | "plus" | "printer" | "question-fill" | "question" | "refresh" | "remove" | "sandglass" | "save" | "settings" | "shopping-cart" | "sort-date" | "star-fill" | "star" | "telegram" | "timer" | "tool" | "truck" | "unlocked" | "upload" | "user-avatar" | "user-group" | "visibility-off" | "visibility-on" | "vk" | "winner" | "workspace" | "youtube">;
|
|
26
26
|
default: undefined;
|
|
27
27
|
validator: (value: TCdsIconsName) => boolean;
|
|
28
28
|
};
|
|
@@ -30,7 +30,7 @@ export declare const makeIconProps: <Defaults extends {
|
|
|
30
30
|
* Иконка в конце элемента
|
|
31
31
|
*/
|
|
32
32
|
appendIcon: {
|
|
33
|
-
type: PropType<"link" | "filters" | "search" | "add" | "alert-fill" | "alert" | "analog" | "arrow-down" | "arrow-left-bottom" | "arrow-left-top" | "arrow-left" | "arrow-right-bottom" | "arrow-right-top" | "arrow-right" | "arrow-up" | "arrows-vertical" | "calendar" | "card-bank" | "category" | "check-fill" | "check" | "chevron-down" | "chevron-left" | "chevron-right" | "chevron-up" | "chocolate-menu" | "clock" | "comment" | "company" | "compare" | "copy" | "data-cards" | "delete" | "directory" | "doc-download" | "doc" | "download" | "draggable" | "edit" | "enter" | "error-fill" | "error" | "external" | "facebook-fill" | "facebook" | "flag" | "funnel" | "globe" | "infinity" | "info-fill" | "info" | "list-search" | "list" | "loader" | "location" | "locked" | "login" | "logout" | "menu" | "minus" | "notification" | "overflow-menu-horizontal" | "overflow-menu-vertical" | "password" | "pin" | "plus" | "printer" | "question-fill" | "question" | "refresh" | "remove" | "sandglass" | "save" | "settings" | "shopping-cart" | "sort-date" | "star-fill" | "star" | "telegram" | "timer" | "tool" | "truck" | "unlocked" | "upload" | "user-avatar" | "user-group" | "visibility-off" | "visibility-on" | "vk" | "winner" | "workspace" | "youtube">;
|
|
33
|
+
type: PropType<"link" | "filters" | "search" | "add" | "alert-fill" | "alert" | "analog" | "arrow-down" | "arrow-left-bottom" | "arrow-left-top" | "arrow-left" | "arrow-right-bottom" | "arrow-right-top" | "arrow-right" | "arrow-up" | "arrows-vertical" | "calendar" | "card-bank" | "category" | "check-fill" | "check" | "checkbox-fill" | "checkbox" | "chevron-down" | "chevron-left" | "chevron-right" | "chevron-up" | "chocolate-menu" | "clock" | "comment" | "company" | "compare" | "copy" | "data-cards" | "delete" | "directory" | "doc-download" | "doc" | "download" | "draggable" | "edit" | "enter" | "error-fill" | "error" | "external" | "facebook-fill" | "facebook" | "flag" | "funnel" | "globe" | "infinity" | "info-fill" | "info" | "list-search" | "list" | "loader" | "location" | "locked" | "login" | "logout" | "menu" | "minus" | "notification" | "overflow-menu-horizontal" | "overflow-menu-vertical" | "password" | "pin" | "plus" | "printer" | "question-fill" | "question" | "refresh" | "remove" | "sandglass" | "save" | "settings" | "shopping-cart" | "sort-date" | "star-fill" | "star" | "telegram" | "timer" | "tool" | "truck" | "unlocked" | "upload" | "user-avatar" | "user-group" | "visibility-off" | "visibility-on" | "vk" | "winner" | "workspace" | "youtube">;
|
|
34
34
|
default: undefined;
|
|
35
35
|
validator: (value: TCdsIconsName) => boolean;
|
|
36
36
|
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { DirectiveBinding } from 'vue';
|
|
2
|
+
export interface ITouchHandlers {
|
|
3
|
+
start?: (wrapperEvent: {
|
|
4
|
+
originalEvent: TouchEvent;
|
|
5
|
+
} & ITouchData) => void;
|
|
6
|
+
end?: (wrapperEvent: {
|
|
7
|
+
originalEvent: TouchEvent;
|
|
8
|
+
} & ITouchData) => void;
|
|
9
|
+
move?: (wrapperEvent: {
|
|
10
|
+
originalEvent: TouchEvent;
|
|
11
|
+
} & ITouchData) => void;
|
|
12
|
+
left?: (wrapper: ITouchData) => void;
|
|
13
|
+
right?: (wrapper: ITouchData) => void;
|
|
14
|
+
up?: (wrapper: ITouchData) => void;
|
|
15
|
+
down?: (wrapper: ITouchData) => void;
|
|
16
|
+
}
|
|
17
|
+
export interface ITouchData {
|
|
18
|
+
touchstartX: number;
|
|
19
|
+
touchstartY: number;
|
|
20
|
+
touchmoveX: number;
|
|
21
|
+
touchmoveY: number;
|
|
22
|
+
touchendX: number;
|
|
23
|
+
touchendY: number;
|
|
24
|
+
offsetX: number;
|
|
25
|
+
offsetY: number;
|
|
26
|
+
}
|
|
27
|
+
export declare type TTouchWrapper = ITouchHandlers & ITouchData;
|
|
28
|
+
export interface ITouchValue extends ITouchHandlers {
|
|
29
|
+
parent?: boolean;
|
|
30
|
+
options?: AddEventListenerOptions;
|
|
31
|
+
}
|
|
32
|
+
export interface ITouchStoredHandlers {
|
|
33
|
+
touchstart: (event: TouchEvent) => void;
|
|
34
|
+
touchend: (event: TouchEvent) => void;
|
|
35
|
+
touchmove: (event: TouchEvent) => void;
|
|
36
|
+
}
|
|
37
|
+
export interface ITouchDirectiveBinding extends Omit<DirectiveBinding, 'value'> {
|
|
38
|
+
value?: ITouchValue;
|
|
39
|
+
}
|
|
40
|
+
declare function mounted(el: HTMLElement, binding: ITouchDirectiveBinding): void;
|
|
41
|
+
declare function unmounted(el: HTMLElement, binding: ITouchDirectiveBinding): void;
|
|
42
|
+
export declare const Touch: {
|
|
43
|
+
mounted: typeof mounted;
|
|
44
|
+
unmounted: typeof unmounted;
|
|
45
|
+
};
|
|
46
|
+
export default Touch;
|
package/dist/globals.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { ITouchStoredHandlers } from './directives/touch';
|
|
2
|
+
|
|
1
3
|
declare global {
|
|
2
4
|
interface HTMLCollection {
|
|
3
5
|
[Symbol.iterator](): IterableIterator<Element>;
|
|
@@ -12,6 +14,9 @@ declare global {
|
|
|
12
14
|
}
|
|
13
15
|
| undefined
|
|
14
16
|
> & { lastMousedownWasOutside: boolean };
|
|
17
|
+
_touchHandlers?: {
|
|
18
|
+
[_uid: number]: ITouchStoredHandlers;
|
|
19
|
+
};
|
|
15
20
|
}
|
|
16
21
|
|
|
17
22
|
export const __VUE_OPTIONS_API__: boolean | undefined;
|
package/dist/locale/index.d.ts
CHANGED
|
@@ -3,6 +3,10 @@ import type { TDateLocale } from '../utils';
|
|
|
3
3
|
export interface ILocale {
|
|
4
4
|
table: NTable.ILocale;
|
|
5
5
|
date: TDateLocale;
|
|
6
|
+
container: {
|
|
7
|
+
prev?: string;
|
|
8
|
+
next?: string;
|
|
9
|
+
};
|
|
6
10
|
}
|
|
7
11
|
export declare const availableLocale: readonly ["ru", "en"];
|
|
8
12
|
export declare type TAvailableLocale = typeof availableLocale[number];
|
|
@@ -19,5 +19,5 @@ export declare function toPhysical(str: 'center' | Tblock | Tinline): "top" | "b
|
|
|
19
19
|
export declare function flipSide(anchor: ParsedAnchor): ParsedAnchor;
|
|
20
20
|
export declare function flipAlign(anchor: ParsedAnchor): ParsedAnchor;
|
|
21
21
|
export declare function flipCorner(anchor: ParsedAnchor): ParsedAnchor;
|
|
22
|
-
export declare function getAxis(anchor: ParsedAnchor): "
|
|
22
|
+
export declare function getAxis(anchor: ParsedAnchor): "y" | "x";
|
|
23
23
|
export {};
|
package/dist/utils/helpers.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ComponentPublicInstance, ComputedGetter, PropType, Ref, ToRefs, VNodeProps, AllowedComponentProps, Component } from 'vue';
|
|
1
|
+
import type { ComponentPublicInstance, ComponentInternalInstance, ComputedGetter, InjectionKey, PropType, Ref, ToRefs, VNodeProps, VNodeChild, AllowedComponentProps, Component } from 'vue';
|
|
2
2
|
import type { TItemKey } from '../composable';
|
|
3
3
|
export declare const keyNames: Readonly<{
|
|
4
4
|
enter: "Enter";
|
|
@@ -33,6 +33,8 @@ export declare const classesStates: Readonly<{
|
|
|
33
33
|
readonly: "cds-state-readonly";
|
|
34
34
|
dragging: "cds-state-dragging";
|
|
35
35
|
}>;
|
|
36
|
+
export declare function keys<O extends {}>(o: O): (keyof O)[];
|
|
37
|
+
export declare function has<T extends string>(obj: object, key: T[]): obj is Record<T, unknown>;
|
|
36
38
|
export declare function isString(value: any): boolean;
|
|
37
39
|
export declare function isArray(value: any): boolean;
|
|
38
40
|
export declare function isSymbol(value: any): boolean;
|
|
@@ -141,6 +143,9 @@ export declare function padStart(string: number | string, targetLength: number,
|
|
|
141
143
|
export declare function pad(n: string | number, length?: number): string;
|
|
142
144
|
export declare function refElement<T extends Record<string, any> | undefined>(obj: T): Exclude<T, ComponentPublicInstance> | HTMLElement;
|
|
143
145
|
export declare function omit<T extends object, K extends keyof T>(obj: T, fields: K[]): Omit<T, K>;
|
|
146
|
+
export declare function findChildrenWithProvide(key: InjectionKey<any> | symbol, vnode?: VNodeChild | {
|
|
147
|
+
[key: string]: any;
|
|
148
|
+
}): ComponentInternalInstance[];
|
|
144
149
|
/**
|
|
145
150
|
* Types
|
|
146
151
|
*/
|
package/package.json
CHANGED