@central-design-system/components 3.0.0-alpha.1 → 3.0.0-alpha.11
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 +54 -41
- package/dist/cds.es.js +11775 -4017
- package/dist/cds.umd.js +18 -1
- package/dist/components/CdsBadge/index.d.ts +1 -0
- package/dist/components/CdsBreadcrumbs/CdsBreadcrumbs.vue.d.ts +64 -0
- package/dist/components/CdsBreadcrumbs/CdsBreadcrumbsItem.vue.d.ts +54 -0
- package/dist/components/CdsBreadcrumbs/index.d.ts +2 -0
- package/dist/components/CdsButton/CdsButton.vue.d.ts +28 -18
- package/dist/components/CdsButton/index.d.ts +1 -0
- package/dist/components/CdsCheckbox/CdsCheckbox.vue.d.ts +68 -36
- package/dist/components/CdsCheckbox/CdsCheckboxGroup.vue.d.ts +51 -29
- package/dist/components/CdsCheckbox/index.d.ts +2 -0
- package/dist/components/CdsCombobox/CdsCombobox.vue.d.ts +2457 -0
- package/dist/components/CdsCombobox/composable/highlight.d.ts +12 -0
- package/dist/components/CdsCombobox/index.d.ts +1 -0
- package/dist/components/CdsDatePicker/CdsDatePicker.vue.d.ts +249 -0
- package/dist/components/CdsDatePicker/composable/calendar.d.ts +317 -0
- package/dist/components/CdsDatePicker/composable/index.d.ts +1 -0
- package/dist/components/CdsDatePicker/index.d.ts +1 -0
- package/dist/components/CdsDrawer/CdsDrawer.vue.d.ts +22 -6
- package/dist/components/CdsDrawer/index.d.ts +1 -0
- package/dist/components/CdsDropdown/CdsDropdown.vue.d.ts +2413 -0
- package/dist/components/CdsDropdown/index.d.ts +1 -0
- package/dist/components/CdsEmptyState/CdsEmptyState.vue.d.ts +54 -0
- package/dist/components/CdsEmptyState/index.d.ts +1 -0
- package/dist/components/CdsForm/CdsForm.vue.d.ts +14 -4
- package/dist/components/CdsForm/index.d.ts +1 -0
- package/dist/components/CdsGrid/CdsCol.vue.d.ts +1 -1
- package/dist/components/CdsGrid/composable/grid.d.ts +2 -1
- package/dist/components/CdsGrid/index.d.ts +3 -0
- package/dist/components/CdsIcon/CdsIcon.vue.d.ts +3 -3
- package/dist/components/CdsInput/CdsInput.vue.d.ts +54 -34
- package/dist/components/CdsLink/CdsLink.vue.d.ts +10 -3
- package/dist/components/CdsLink/index.d.ts +1 -0
- package/dist/components/CdsList/CdsList.vue.d.ts +47 -6
- package/dist/components/CdsList/CdsListGroup.vue.d.ts +8 -8
- package/dist/components/CdsList/CdsListItem.vue.d.ts +28 -25
- package/dist/components/CdsLoader/CdsLoader.vue.d.ts +1 -1
- package/dist/components/CdsMenu/CdsMenu.vue.d.ts +142 -37
- package/dist/components/CdsMenu/index.d.ts +1 -0
- package/dist/components/CdsOverlay/CdsOverlay.vue.d.ts +49 -30
- package/dist/components/CdsOverlay/composable/locationStrategies.d.ts +3 -0
- package/dist/components/CdsOverlay/index.d.ts +1 -0
- package/dist/components/CdsPagination/CdsPagination.vue.d.ts +142 -0
- package/dist/components/CdsPagination/index.d.ts +1 -0
- package/dist/components/CdsRadioButton/CdsRadio.vue.d.ts +60 -31
- package/dist/components/CdsRadioButton/CdsRadioButton.vue.d.ts +59 -31
- package/dist/components/CdsRadioButton/index.d.ts +2 -0
- package/dist/components/CdsSelect/CdsSelect.vue.d.ts +227 -116
- package/dist/components/CdsSelect/index.d.ts +1 -0
- package/dist/components/CdsSidebar/CdsSidebar.vue.d.ts +23 -18
- package/dist/components/CdsSidebar/index.d.ts +1 -0
- package/dist/components/CdsStages/CdsStages.vue.d.ts +2 -2
- package/dist/components/CdsStages/index.d.ts +1 -0
- package/dist/components/CdsStatus/index.d.ts +1 -0
- package/dist/components/CdsTable/CdsTable.vue.d.ts +1147 -0
- package/dist/components/CdsTable/CdsTableColumn.vue.d.ts +10 -0
- package/dist/components/CdsTable/CdsTableColumnGroup.vue.d.ts +10 -0
- package/dist/components/CdsTable/components/Body/Body.d.ts +12 -0
- package/dist/components/CdsTable/components/Body/BodyRow.d.ts +22 -0
- package/dist/components/CdsTable/components/Body/ExpandedRow.d.ts +13 -0
- package/dist/components/CdsTable/components/Body/index.d.ts +1 -0
- package/dist/components/CdsTable/components/Cell/Cell.d.ts +34 -0
- package/dist/components/CdsTable/components/Cell/MeasureCell.d.ts +7 -0
- package/dist/components/CdsTable/components/Cell/index.d.ts +2 -0
- package/dist/components/CdsTable/components/ColGroup/ColGroup.d.ts +8 -0
- package/dist/components/CdsTable/components/ColGroup/index.d.ts +1 -0
- package/dist/components/CdsTable/components/Filter/FilterDropdown.d.ts +14 -0
- package/dist/components/CdsTable/components/Filter/FilterSearch.d.ts +9 -0
- package/dist/components/CdsTable/components/Filter/FilterWrapper.d.ts +4 -0
- package/dist/components/CdsTable/components/Filter/index.d.ts +1 -0
- package/dist/components/CdsTable/components/FixedHolder/FixedHolder.d.ts +21 -0
- package/dist/components/CdsTable/components/FixedHolder/index.d.ts +1 -0
- package/dist/components/CdsTable/components/Footer/Footer.d.ts +8 -0
- package/dist/components/CdsTable/components/Footer/index.d.ts +1 -0
- package/dist/components/CdsTable/components/Header/DragHandle.d.ts +44 -0
- package/dist/components/CdsTable/components/Header/Header.d.ts +11 -0
- package/dist/components/CdsTable/components/Header/HeaderRow.d.ts +15 -0
- package/dist/components/CdsTable/components/Header/index.d.ts +1 -0
- package/dist/components/CdsTable/components/Icons/ExpandIcon.d.ts +12 -0
- package/dist/components/CdsTable/components/Panel/Panel.d.ts +4 -0
- package/dist/components/CdsTable/components/Panel/index.d.ts +1 -0
- package/dist/components/CdsTable/components/ResizeObserver/ResizeObserver.d.ts +11 -0
- package/dist/components/CdsTable/components/ResizeObserver/index.d.ts +1 -0
- package/dist/components/CdsTable/components/StickyScrollbar/StickyScrollbar.d.ts +15 -0
- package/dist/components/CdsTable/components/StickyScrollbar/index.d.ts +1 -0
- package/dist/components/CdsTable/components/Table/InternalTable.d.ts +1139 -0
- package/dist/components/CdsTable/components/TableProvider.d.ts +1132 -0
- package/dist/components/CdsTable/composable/columns.d.ts +28 -0
- package/dist/components/CdsTable/composable/filter.d.ts +16 -0
- package/dist/components/CdsTable/composable/flat.d.ts +17 -0
- package/dist/components/CdsTable/composable/frame.d.ts +6 -0
- package/dist/components/CdsTable/composable/index.d.ts +10 -0
- package/dist/components/CdsTable/composable/pagination.d.ts +18 -0
- package/dist/components/CdsTable/composable/selection.d.ts +23 -0
- package/dist/components/CdsTable/composable/sorter.d.ts +21 -0
- package/dist/components/CdsTable/composable/sticky.d.ts +12 -0
- package/dist/components/CdsTable/composable/table.d.ts +640 -0
- package/dist/components/CdsTable/constants.d.ts +2 -0
- package/dist/components/CdsTable/context/body.d.ts +19 -0
- package/dist/components/CdsTable/context/expandedRow.d.ts +10 -0
- package/dist/components/CdsTable/context/hover.d.ts +9 -0
- package/dist/components/CdsTable/context/index.d.ts +8 -0
- package/dist/components/CdsTable/context/resize.d.ts +9 -0
- package/dist/components/CdsTable/context/slots.d.ts +17 -0
- package/dist/components/CdsTable/context/sticky.d.ts +2 -0
- package/dist/components/CdsTable/context/summary.d.ts +14 -0
- package/dist/components/CdsTable/context/table.d.ts +20 -0
- package/dist/components/CdsTable/index.d.ts +6 -0
- package/dist/components/CdsTable/interface.d.ts +323 -0
- package/dist/components/CdsTable/utils/column.d.ts +7 -0
- package/dist/components/CdsTable/utils/expand.d.ts +2 -0
- package/dist/components/CdsTable/utils/fixed.d.ts +13 -0
- package/dist/components/CdsTable/utils/index.d.ts +5 -0
- package/dist/components/CdsTable/utils/listener.d.ts +5 -0
- package/dist/components/CdsTable/utils/value.d.ts +10 -0
- package/dist/components/CdsTag/CdsTag.vue.d.ts +11 -6
- package/dist/components/CdsTag/index.d.ts +1 -0
- package/dist/components/CdsTextArea/CdsTextArea.vue.d.ts +224 -123
- package/dist/components/CdsTextArea/index.d.ts +1 -0
- package/dist/components/CdsTextInput/CdsTextInput.vue.d.ts +239 -104
- package/dist/components/CdsTextInput/index.d.ts +1 -0
- package/dist/components/CdsTimePicker/CdsTimePicker.vue.d.ts +144 -0
- package/dist/components/CdsTimePicker/composable/index.d.ts +1 -0
- package/dist/components/CdsTimePicker/composable/time.d.ts +134 -0
- package/dist/components/CdsTimePicker/index.d.ts +1 -0
- package/dist/components/CdsTooltip/CdsTooltip.vue.d.ts +765 -0
- package/dist/components/CdsTooltip/index.d.ts +1 -0
- package/dist/components/CdsTree/composable/index.d.ts +1 -0
- package/dist/components/CdsTree/composable/tree.d.ts +6 -0
- package/dist/components/CdsTree/interface.d.ts +60 -0
- package/dist/components/CdsTree/utils/conduct.d.ts +11 -0
- package/dist/components/CdsTree/utils/data.d.ts +36 -0
- package/dist/components/CdsTree/utils/index.d.ts +2 -0
- package/dist/components/index.d.ts +43 -1
- package/dist/composable/color.d.ts +4 -2
- package/dist/composable/datetime.d.ts +45 -0
- package/dist/composable/delay.d.ts +1 -1
- package/dist/composable/dimensions.d.ts +23 -5
- package/dist/composable/display.d.ts +59 -0
- package/dist/composable/field.d.ts +4 -3
- package/dist/composable/filter.d.ts +52 -0
- package/dist/composable/form.d.ts +2 -0
- package/dist/composable/hidration.d.ts +2 -1
- package/dist/composable/icon.d.ts +2 -2
- package/dist/composable/index.d.ts +12 -0
- package/dist/composable/input.d.ts +6 -4
- package/dist/composable/items.d.ts +2 -0
- package/dist/composable/lazy.d.ts +12 -2
- package/dist/composable/locale.d.ts +18 -0
- package/dist/composable/menu.d.ts +37 -0
- package/dist/composable/overlay.d.ts +9 -10
- package/dist/composable/readonly.d.ts +19 -0
- package/dist/composable/refs.d.ts +6 -0
- package/dist/composable/resizeObserver.d.ts +7 -0
- package/dist/composable/router.d.ts +3 -0
- package/dist/composable/select.d.ts +86 -0
- package/dist/composable/state.d.ts +13 -0
- package/dist/composable/title.d.ts +21 -0
- package/dist/composable/validation.d.ts +0 -24
- package/dist/create.d.ts +23 -0
- package/dist/globals.d.ts +2 -0
- package/dist/locale/en.d.ts +3 -0
- package/dist/locale/index.d.ts +13 -0
- package/dist/locale/ru.d.ts +3 -0
- package/dist/transitions/index.d.ts +150 -0
- package/dist/utils/date/date.d.ts +190 -0
- package/dist/utils/{anchor.d.ts → dom/anchor.d.ts} +2 -2
- package/dist/utils/dom/classNames.d.ts +1 -0
- package/dist/utils/dom/dom.d.ts +10 -0
- package/dist/utils/dom/getScrollParent.d.ts +12 -0
- package/dist/utils/dom/scrollTo.d.ts +10 -0
- package/dist/utils/dom/warn.d.ts +1 -0
- package/dist/utils/dom/wrapperRaf.d.ts +4 -0
- package/dist/utils/helpers.d.ts +109 -20
- package/dist/utils/index.d.ts +16 -7
- package/dist/utils/use/cache.d.ts +4 -0
- package/dist/utils/use/eagerComputed.d.ts +3 -0
- package/dist/utils/use/pickAttrs.d.ts +11 -0
- package/dist/utils/use/reactiveComputed.d.ts +4 -0
- package/dist/utils/use/reactivePick.d.ts +8 -0
- package/dist/utils/use/toReactive.d.ts +8 -0
- package/dist/utils/use/toValue.d.ts +5 -0
- package/package.json +7 -4
- package/src/scss/modules/_transition.scss +102 -0
- package/src/scss/themes/index.ts +1 -1
- package/src/scss/utility/lists.scss +1 -0
- package/dist/types/CdsOptions.d.ts +0 -3
- package/dist/utils/dom.d.ts +0 -6
- package/dist/utils/getScrollParent.d.ts +0 -3
- /package/dist/utils/{animation.d.ts → dom/animation.d.ts} +0 -0
- /package/dist/utils/{box.d.ts → dom/box.d.ts} +0 -0
- /package/dist/utils/{globals.d.ts → dom/globals.d.ts} +0 -0
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
export interface IRawDate {
|
|
2
|
+
year?: number;
|
|
3
|
+
month?: number;
|
|
4
|
+
day?: number;
|
|
5
|
+
hour?: number;
|
|
6
|
+
minute?: number;
|
|
7
|
+
second?: number;
|
|
8
|
+
millisecond?: number;
|
|
9
|
+
timezoneOffset?: number;
|
|
10
|
+
dateHash?: string;
|
|
11
|
+
timeHash?: string;
|
|
12
|
+
date?: number;
|
|
13
|
+
changed?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare type TDateLocale = {
|
|
16
|
+
days: string[];
|
|
17
|
+
daysShort: string[];
|
|
18
|
+
months: string[];
|
|
19
|
+
monthsLong: string[];
|
|
20
|
+
monthsShort: string[];
|
|
21
|
+
firstDayOfWeek: number;
|
|
22
|
+
format24h: boolean;
|
|
23
|
+
pluralDay: (day?: number) => string;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Format date by mask
|
|
27
|
+
* @param value
|
|
28
|
+
* @param mask
|
|
29
|
+
* @param dateLocale
|
|
30
|
+
* @param __forcedYear
|
|
31
|
+
* @param __forcedTimezoneOffset
|
|
32
|
+
*/
|
|
33
|
+
export declare function formatDate(value: any, mask: string, dateLocale: TDateLocale, __forcedYear: number, __forcedTimezoneOffset: number): string | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Set a specific year, month and day to a date.
|
|
36
|
+
* @param date
|
|
37
|
+
* @param rawModified
|
|
38
|
+
* @param utc
|
|
39
|
+
*/
|
|
40
|
+
export declare function adjustDate(date: Date, rawModified: IRawDate, utc: boolean): Date;
|
|
41
|
+
/**
|
|
42
|
+
* Parse any string into a date object based on the format passed.
|
|
43
|
+
* @param str
|
|
44
|
+
* @param mask
|
|
45
|
+
* @param dateLocale
|
|
46
|
+
*/
|
|
47
|
+
export declare function extractDate(str: string, mask: string, dateLocale: TDateLocale): Date;
|
|
48
|
+
/**
|
|
49
|
+
* Split date by mask.
|
|
50
|
+
* @param str
|
|
51
|
+
* @param mask
|
|
52
|
+
* @param dateLocale
|
|
53
|
+
* @param defaultModel
|
|
54
|
+
*/
|
|
55
|
+
export declare function splitDate(str?: string | any, mask?: string, dateLocale?: TDateLocale, defaultModel?: IRawDate): IRawDate;
|
|
56
|
+
/**
|
|
57
|
+
* Check a date string for validity.
|
|
58
|
+
* @param date
|
|
59
|
+
*/
|
|
60
|
+
export declare function isValid(date: any): boolean;
|
|
61
|
+
/**
|
|
62
|
+
* The following method is just a wrapper to help you in cases where you just need current time but with a different year, or month, or second etc.
|
|
63
|
+
* @param modified
|
|
64
|
+
* @param utc
|
|
65
|
+
*/
|
|
66
|
+
export declare function buildDate(modified: IRawDate, utc: boolean): Date;
|
|
67
|
+
/**
|
|
68
|
+
* Get the day number in week for a given date.
|
|
69
|
+
* @param date
|
|
70
|
+
*/
|
|
71
|
+
export declare function getDayOfWeek(date: Date): number;
|
|
72
|
+
/**
|
|
73
|
+
* Get the week number in year for a given date.
|
|
74
|
+
* @param date
|
|
75
|
+
*/
|
|
76
|
+
export declare function getWeekOfYear(date: Date): number;
|
|
77
|
+
/**
|
|
78
|
+
* Get the day of the year from a given date.
|
|
79
|
+
* @param date
|
|
80
|
+
*/
|
|
81
|
+
export declare function getDayOfYear(date: Date): number | undefined;
|
|
82
|
+
/**
|
|
83
|
+
* Check a date is in a given date/time range.
|
|
84
|
+
* @param date
|
|
85
|
+
* @param from
|
|
86
|
+
* @param to
|
|
87
|
+
* @param opts
|
|
88
|
+
*/
|
|
89
|
+
export declare function isBetweenDates(date: Date, from: Date, to: Date, opts: {
|
|
90
|
+
onlyDate: boolean;
|
|
91
|
+
inclusiveFrom: boolean;
|
|
92
|
+
inclusiveTo: boolean;
|
|
93
|
+
}): boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Add a given date/time unit from a given date.
|
|
96
|
+
* @param date
|
|
97
|
+
* @param modified
|
|
98
|
+
*/
|
|
99
|
+
export declare function addToDate(date: Date, modified: IRawDate): Date;
|
|
100
|
+
/**
|
|
101
|
+
* Subtract a given date/time unit from a given date.
|
|
102
|
+
* @param date
|
|
103
|
+
* @param modified
|
|
104
|
+
*/
|
|
105
|
+
export declare function subtractFromDate(date: Date, modified: IRawDate): Date;
|
|
106
|
+
/**
|
|
107
|
+
* Beginning of a given date/time unit for a given date.
|
|
108
|
+
* @param date
|
|
109
|
+
* @param unit
|
|
110
|
+
* @param utc
|
|
111
|
+
*/
|
|
112
|
+
export declare function startOfDate(date: Date, unit: string, utc?: boolean): Date;
|
|
113
|
+
/**
|
|
114
|
+
* End of a given date/time unit for a given date.
|
|
115
|
+
* @param date
|
|
116
|
+
* @param unit
|
|
117
|
+
* @param utc
|
|
118
|
+
*/
|
|
119
|
+
export declare function endOfDate(date: Date, unit: string, utc: boolean): Date;
|
|
120
|
+
/**
|
|
121
|
+
* Get the maximum date from a given date and other dates.
|
|
122
|
+
* @param date
|
|
123
|
+
* @param args
|
|
124
|
+
*/
|
|
125
|
+
export declare function getMaxDate(date: Date, ...args: Date[]): Date;
|
|
126
|
+
/**
|
|
127
|
+
* Get the minimum date from a given date and other dates.
|
|
128
|
+
* @param date
|
|
129
|
+
* @param args
|
|
130
|
+
*/
|
|
131
|
+
export declare function getMinDate(date: Date, ...args: Date[]): Date;
|
|
132
|
+
/**
|
|
133
|
+
* Get the difference between two dates.
|
|
134
|
+
* @param date
|
|
135
|
+
* @param subtract
|
|
136
|
+
* @param unit
|
|
137
|
+
*/
|
|
138
|
+
export declare function getDateDiff(date: Date, subtract: Date, unit?: string): number;
|
|
139
|
+
/**
|
|
140
|
+
* Get date format
|
|
141
|
+
* @param date
|
|
142
|
+
*/
|
|
143
|
+
export declare function inferDateFormat(date: Date | any): 'date' | 'number' | 'string';
|
|
144
|
+
/**
|
|
145
|
+
* Normalize a date in a given date/time range.
|
|
146
|
+
* @param date
|
|
147
|
+
* @param min
|
|
148
|
+
* @param max
|
|
149
|
+
*/
|
|
150
|
+
export declare function getDateBetween(date: Date, min: Date, max: Date): Date;
|
|
151
|
+
/**
|
|
152
|
+
* Check of two dates unit are equal.
|
|
153
|
+
* @param date1
|
|
154
|
+
* @param date2
|
|
155
|
+
* @param unit
|
|
156
|
+
*/
|
|
157
|
+
export declare function isSameDate(date1: Date, date2: Date, unit: string): boolean;
|
|
158
|
+
/**
|
|
159
|
+
* Get the number of days in a month.
|
|
160
|
+
* @param date
|
|
161
|
+
*/
|
|
162
|
+
export declare function daysInMonth(date: Date): number;
|
|
163
|
+
/**
|
|
164
|
+
* Cloning date object.
|
|
165
|
+
* @param date
|
|
166
|
+
*/
|
|
167
|
+
export declare function clone(date: Date): Date;
|
|
168
|
+
declare const _default: {
|
|
169
|
+
formatDate: typeof formatDate;
|
|
170
|
+
clone: typeof clone;
|
|
171
|
+
isValid: typeof isValid;
|
|
172
|
+
buildDate: typeof buildDate;
|
|
173
|
+
getDayOfWeek: typeof getDayOfWeek;
|
|
174
|
+
getWeekOfYear: typeof getWeekOfYear;
|
|
175
|
+
isBetweenDates: typeof isBetweenDates;
|
|
176
|
+
addToDate: typeof addToDate;
|
|
177
|
+
subtractFromDate: typeof subtractFromDate;
|
|
178
|
+
adjustDate: typeof adjustDate;
|
|
179
|
+
startOfDate: typeof startOfDate;
|
|
180
|
+
endOfDate: typeof endOfDate;
|
|
181
|
+
getMaxDate: typeof getMaxDate;
|
|
182
|
+
getMinDate: typeof getMinDate;
|
|
183
|
+
getDateDiff: typeof getDateDiff;
|
|
184
|
+
getDayOfYear: typeof getDayOfYear;
|
|
185
|
+
inferDateFormat: typeof inferDateFormat;
|
|
186
|
+
getDateBetween: typeof getDateBetween;
|
|
187
|
+
isSameDate: typeof isSameDate;
|
|
188
|
+
daysInMonth: typeof daysInMonth;
|
|
189
|
+
};
|
|
190
|
+
export default _default;
|
|
@@ -15,9 +15,9 @@ export declare type ParsedAnchor = {
|
|
|
15
15
|
};
|
|
16
16
|
/** Parse a raw anchor string into an object */
|
|
17
17
|
export declare function parseAnchor(anchor: TAnchor): ParsedAnchor;
|
|
18
|
-
export declare function toPhysical(str: 'center' | Tblock | Tinline): "
|
|
18
|
+
export declare function toPhysical(str: 'center' | Tblock | Tinline): "top" | "bottom" | "left" | "right" | "center";
|
|
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): "x" | "y";
|
|
23
23
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function classNames(...args: any[]): any;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns:
|
|
3
|
+
* - 'null' if the node is not attached to the DOM
|
|
4
|
+
* - the root node (HTMLDocument | ShadowRoot) otherwise
|
|
5
|
+
*/
|
|
6
|
+
export declare function attachedRoot(node: Node): null | HTMLDocument | ShadowRoot;
|
|
7
|
+
export declare function isVisible(element: HTMLElement | SVGGraphicsElement): boolean;
|
|
8
|
+
export declare function isStyleSupport(styleName: string | string[], styleValue?: any): boolean;
|
|
9
|
+
export declare function parseStyleText(cssText?: string, camel?: boolean): Record<string, any>;
|
|
10
|
+
export declare function findDOMNodeByInstance(instance: any): any;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare function getScrollParent(el?: HTMLElement): HTMLElement;
|
|
2
|
+
export declare function getScrollParents(el?: Element | null, stopAt?: Element | null): HTMLElement[];
|
|
3
|
+
export declare function hasScrollbar(el?: Element | null): boolean;
|
|
4
|
+
export declare function getScrollBarSize(fresh?: boolean): number;
|
|
5
|
+
export declare function getTargetScrollBarSize(target: HTMLElement): {
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
};
|
|
9
|
+
export declare function getOffset(node: any): {
|
|
10
|
+
left: number;
|
|
11
|
+
top: number;
|
|
12
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface IScrollToOptions {
|
|
2
|
+
/** Scroll container, default as window */
|
|
3
|
+
getContainer?: () => HTMLElement | Window | Document;
|
|
4
|
+
/** Scroll end callback */
|
|
5
|
+
callback?: () => void;
|
|
6
|
+
/** Animation duration, default as 450 */
|
|
7
|
+
duration?: number;
|
|
8
|
+
}
|
|
9
|
+
export declare function scrollTo(y: number, options?: IScrollToOptions): void;
|
|
10
|
+
export declare function easeInOutCubic(t: number, b: number, c: number, d: number): number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function warn(component: string, msg: string): void;
|
package/dist/utils/helpers.d.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import type { ComponentPublicInstance, ComputedGetter, PropType, Ref, ToRefs } from 'vue';
|
|
1
|
+
import type { ComponentPublicInstance, ComputedGetter, PropType, Ref, ToRefs, VNodeProps, AllowedComponentProps, Component } from 'vue';
|
|
2
2
|
import type { TItemKey } from '../composable';
|
|
3
|
-
export declare const
|
|
4
|
-
enter:
|
|
5
|
-
tab:
|
|
6
|
-
delete:
|
|
7
|
-
esc:
|
|
8
|
-
space:
|
|
9
|
-
up:
|
|
10
|
-
down:
|
|
11
|
-
left:
|
|
12
|
-
right:
|
|
13
|
-
end:
|
|
14
|
-
home:
|
|
15
|
-
del:
|
|
16
|
-
backspace:
|
|
17
|
-
insert:
|
|
18
|
-
pageup:
|
|
19
|
-
pagedown:
|
|
20
|
-
shift:
|
|
3
|
+
export declare const keyNames: Readonly<{
|
|
4
|
+
enter: "Enter";
|
|
5
|
+
tab: "Tab";
|
|
6
|
+
delete: "Delete";
|
|
7
|
+
esc: "Escape";
|
|
8
|
+
space: " ";
|
|
9
|
+
up: "ArrowUp";
|
|
10
|
+
down: "ArrowDown";
|
|
11
|
+
left: "ArrowLeft";
|
|
12
|
+
right: "ArrowRight";
|
|
13
|
+
end: "End";
|
|
14
|
+
home: "Home";
|
|
15
|
+
del: "Del";
|
|
16
|
+
backspace: "Backspace";
|
|
17
|
+
insert: "Insert";
|
|
18
|
+
pageup: "PageUp";
|
|
19
|
+
pagedown: "PageDown";
|
|
20
|
+
shift: "Shift";
|
|
21
21
|
}>;
|
|
22
22
|
export declare const classesStates: Readonly<{
|
|
23
23
|
hover: "cds-state-hover";
|
|
@@ -30,17 +30,78 @@ export declare const classesStates: Readonly<{
|
|
|
30
30
|
invalid: "cds-state-invalid";
|
|
31
31
|
empty: "cds-state-empty";
|
|
32
32
|
loading: "cds-state-loading";
|
|
33
|
+
readonly: "cds-state-readonly";
|
|
34
|
+
dragging: "cds-state-dragging";
|
|
33
35
|
}>;
|
|
36
|
+
export declare function isString(value: any): boolean;
|
|
37
|
+
export declare function isArray(value: any): boolean;
|
|
38
|
+
export declare function isSymbol(value: any): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Check if value is a object.
|
|
41
|
+
* @param obj
|
|
42
|
+
*/
|
|
34
43
|
export declare function isObject(obj: any): obj is object;
|
|
44
|
+
/**
|
|
45
|
+
* Check if value is a Date.
|
|
46
|
+
* @param value
|
|
47
|
+
*/
|
|
48
|
+
export declare function isDate(value: any): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Check if value is a Window object.
|
|
51
|
+
* @param obj
|
|
52
|
+
*/
|
|
53
|
+
export declare function isWindow(obj: any): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Add item from array if not exists.
|
|
56
|
+
* @param array
|
|
57
|
+
* @param value
|
|
58
|
+
*/
|
|
59
|
+
export declare function addItemToArray<T>(array: T[], value: T): T[];
|
|
60
|
+
/**
|
|
61
|
+
* Remove item from array if exists.
|
|
62
|
+
* @param array
|
|
63
|
+
* @param value
|
|
64
|
+
*/
|
|
65
|
+
export declare function removeItemFromArray<T>(array: T[], value: T): T[];
|
|
66
|
+
/**
|
|
67
|
+
* Deep merge two objects.
|
|
68
|
+
* @param source
|
|
69
|
+
* @param target
|
|
70
|
+
* @param arrayFn
|
|
71
|
+
*/
|
|
35
72
|
export declare function mergeDeep(source?: Record<string, any>, target?: Record<string, any>, arrayFn?: (a: unknown[], b: unknown[]) => unknown[]): Record<string, any>;
|
|
73
|
+
/**
|
|
74
|
+
* Deep compare two values to determine if they are equivalent.
|
|
75
|
+
* @param a
|
|
76
|
+
* @param b
|
|
77
|
+
*/
|
|
78
|
+
export declare function deepEqual(a: any, b: any): boolean;
|
|
36
79
|
/**
|
|
37
80
|
* Wrap value in array if it's not already an array
|
|
38
81
|
* @param value
|
|
39
82
|
*/
|
|
40
83
|
export declare function wrapInArray<T>(value: T | T[] | null | undefined): T[];
|
|
84
|
+
/**
|
|
85
|
+
* Get the nested value of an object at a given path.
|
|
86
|
+
* @param obj
|
|
87
|
+
* @param path
|
|
88
|
+
* @param fallback
|
|
89
|
+
*/
|
|
41
90
|
export declare function getNestedValue(obj: any, path: (string | number)[], fallback?: any): any;
|
|
91
|
+
/**
|
|
92
|
+
* Get the value of an object at a given path.
|
|
93
|
+
* @param obj
|
|
94
|
+
* @param path
|
|
95
|
+
* @param fallback
|
|
96
|
+
*/
|
|
42
97
|
export declare function getObjectValueByPath(obj: any, path: string, fallback?: any): any;
|
|
43
98
|
export declare function getPropertyFromItem(item: any, property: SelectItemKey, fallback?: any): any;
|
|
99
|
+
/**
|
|
100
|
+
* This function is used to return the scroll position of the given element.
|
|
101
|
+
* @param target
|
|
102
|
+
* @param top
|
|
103
|
+
*/
|
|
104
|
+
export declare function getScroll(target: HTMLElement | Window | Document | null, top: boolean): number;
|
|
44
105
|
/**
|
|
45
106
|
* @description This function is used to return a copy of the object that is composed of the picked object properties.
|
|
46
107
|
* @param obj
|
|
@@ -52,15 +113,34 @@ export declare function pick<T extends object, U extends Extract<keyof T, string
|
|
|
52
113
|
* The getter function must always return an object with the same keys.
|
|
53
114
|
*/
|
|
54
115
|
export declare function destructComputed<T extends object>(getter: ComputedGetter<T & NotAUnion<T>>): ToRefs<T>;
|
|
55
|
-
/**
|
|
116
|
+
/**
|
|
117
|
+
* Array.includes but value can be any type
|
|
118
|
+
* @param arr
|
|
119
|
+
* @param val
|
|
120
|
+
*/
|
|
56
121
|
export declare function includes(arr: readonly any[], val: any): boolean;
|
|
57
122
|
export declare function convertToUnit(str: number, unit?: string): string;
|
|
58
123
|
export declare function convertToUnit(str: string | number | null | undefined, unit?: string): string | undefined;
|
|
124
|
+
/**
|
|
125
|
+
* Clamp a value between a min and max
|
|
126
|
+
* @param value
|
|
127
|
+
* @param min
|
|
128
|
+
* @param max
|
|
129
|
+
*/
|
|
59
130
|
export declare function clamp(value: number, min?: number, max?: number): number;
|
|
131
|
+
export declare function createRange(length: number, start?: number): number[];
|
|
132
|
+
/**
|
|
133
|
+
* Is value an like event
|
|
134
|
+
* @param key
|
|
135
|
+
*/
|
|
60
136
|
export declare const isOn: (key: string) => boolean;
|
|
61
137
|
export declare const EventProp: PropType<(...args: any[]) => any>;
|
|
62
138
|
export declare function isComponentInstance(obj: any): obj is ComponentPublicInstance;
|
|
63
139
|
export declare function isFixedPosition(el?: HTMLElement): boolean;
|
|
140
|
+
export declare function padStart(string: number | string, targetLength: number, padString: string): string;
|
|
141
|
+
export declare function pad(n: string | number, length?: number): string;
|
|
142
|
+
export declare function refElement<T extends Record<string, any> | undefined>(obj: T): Exclude<T, ComponentPublicInstance> | HTMLElement;
|
|
143
|
+
export declare function omit<T extends object, K extends keyof T>(obj: T, fields: K[]): Omit<T, K>;
|
|
64
144
|
/**
|
|
65
145
|
* Types
|
|
66
146
|
*/
|
|
@@ -70,4 +150,13 @@ export declare type MaybePick<T extends object, U extends Extract<keyof T, strin
|
|
|
70
150
|
export declare type EventProp<T = (...args: any[]) => any> = T;
|
|
71
151
|
declare type NotAUnion<T> = [T] extends [infer U] ? _NotAUnion<U, U> : never;
|
|
72
152
|
declare type _NotAUnion<T, U> = U extends any ? ([T] extends [U] ? unknown : never) : never;
|
|
153
|
+
export declare type ComponentProps<C extends Component> = C extends new (...args: any) => any ? Omit<InstanceType<C>['$props'], keyof VNodeProps | keyof AllowedComponentProps> : never;
|
|
154
|
+
/**
|
|
155
|
+
* Maybe it's a ref, or a plain value, or a getter function
|
|
156
|
+
*
|
|
157
|
+
* ```ts
|
|
158
|
+
* type MaybeRefOrGetter<T> = (() => T) | T | Ref<T> | ComputedRef<T>
|
|
159
|
+
* ```
|
|
160
|
+
*/
|
|
161
|
+
export declare type MaybeRefOrGetter<T> = MaybeRef<T> | (() => T);
|
|
73
162
|
export {};
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,13 +1,22 @@
|
|
|
1
|
-
export * from './propsFactory';
|
|
2
1
|
export * from './helpers';
|
|
2
|
+
export * from './propsFactory';
|
|
3
3
|
export * from './getCurrentInstance';
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './
|
|
7
|
-
export * from './
|
|
8
|
-
export * from './box';
|
|
9
|
-
export * from './animation';
|
|
4
|
+
export * from './use/reactivePick';
|
|
5
|
+
export * from './use/eagerComputed';
|
|
6
|
+
export * from './use/pickAttrs';
|
|
7
|
+
export * from './use/cache';
|
|
10
8
|
export * from './changeCase/noCase';
|
|
11
9
|
export * from './changeCase/lowerCase';
|
|
12
10
|
export * from './changeCase/pascalCase';
|
|
13
11
|
export * from './changeCase/paramCase';
|
|
12
|
+
export * from './date/date';
|
|
13
|
+
export * from './dom/globals';
|
|
14
|
+
export * from './dom/getScrollParent';
|
|
15
|
+
export * from './dom/dom';
|
|
16
|
+
export * from './dom/anchor';
|
|
17
|
+
export * from './dom/box';
|
|
18
|
+
export * from './dom/animation';
|
|
19
|
+
export * from './dom/scrollTo';
|
|
20
|
+
export * from './dom/wrapperRaf';
|
|
21
|
+
export * from './dom/warn';
|
|
22
|
+
export * from './dom/classNames';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface IAttrsPickConfig {
|
|
2
|
+
aria?: boolean;
|
|
3
|
+
data?: boolean;
|
|
4
|
+
attr?: boolean;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Picker props from exist props with filter
|
|
8
|
+
* @param props Passed props
|
|
9
|
+
* @param ariaOnly boolean | { aria?: boolean; data?: boolean; attr?: boolean; } filter config
|
|
10
|
+
*/
|
|
11
|
+
export declare function pickAttrs(props: Record<string, any>, ariaOnly?: boolean | IAttrsPickConfig): Record<string, any>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { UnwrapRef } from 'vue';
|
|
2
|
+
export declare type ReactivePickPredicate<T> = (value: T[keyof T], key: keyof T) => boolean;
|
|
3
|
+
export declare function reactivePick<T extends object, K extends keyof T>(obj: T, ...keys: (K | K[])[]): {
|
|
4
|
+
[S in K]: UnwrapRef<T[S]>;
|
|
5
|
+
};
|
|
6
|
+
export declare function reactivePick<T extends object>(obj: T, predicate: ReactivePickPredicate<T>): {
|
|
7
|
+
[S in keyof T]?: UnwrapRef<T[S]>;
|
|
8
|
+
};
|
package/package.json
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@central-design-system/components",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.11",
|
|
4
4
|
"description": "Central Design System on the Vue 3.0 and TypeScript",
|
|
5
5
|
"author": "magersoft",
|
|
6
6
|
"license": "ISC",
|
|
7
7
|
"main": "./dist/cds.umd.js",
|
|
8
8
|
"module": "./dist/cds.es.js",
|
|
9
|
+
"type": "module",
|
|
9
10
|
"engines": {
|
|
10
11
|
"node": ">= 16"
|
|
11
12
|
},
|
|
12
13
|
"exports": {
|
|
13
14
|
".": {
|
|
14
15
|
"import": "./dist/cds.es.js",
|
|
15
|
-
"require": "./dist/cds.umd.js"
|
|
16
|
+
"require": "./dist/cds.umd.js",
|
|
17
|
+
"types": "./dist/cds.d.ts"
|
|
16
18
|
},
|
|
17
19
|
"./nuxt": "./nuxt.js",
|
|
18
20
|
"./dist/cds.css": "./dist/cds.css"
|
|
@@ -26,10 +28,11 @@
|
|
|
26
28
|
"scripts": {
|
|
27
29
|
"build": "rimraf dist && vue-tsc --noEmit && vite build",
|
|
28
30
|
"type-check": "npx vue-tsc --noEmit -p tsconfig.json --composite false",
|
|
29
|
-
"bump": "npx bumpp"
|
|
31
|
+
"bump": "npx bumpp",
|
|
32
|
+
"publish:alpha": "npm publish --tag next"
|
|
30
33
|
},
|
|
31
34
|
"peerDependencies": {
|
|
32
|
-
"vue": "3.2.
|
|
35
|
+
"vue": "^3.2.0"
|
|
33
36
|
},
|
|
34
37
|
"devDependencies": {
|
|
35
38
|
"@types/node": "16.18.3",
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
$standard-easing: map-get(map-get($easing, 'ease-in-out'), 'basic');
|
|
4
4
|
$standard-duration: $cds-duration-fast + ms;
|
|
5
|
+
$accent-easting: map-get(map-get($easing, 'ease-in-out'), 'accent');
|
|
6
|
+
$accent-duration: $cds-duration-normal + ms;
|
|
5
7
|
|
|
6
8
|
@mixin transition-default() {
|
|
7
9
|
&-enter-active {
|
|
@@ -17,10 +19,23 @@ $standard-duration: $cds-duration-fast + ms;
|
|
|
17
19
|
}
|
|
18
20
|
}
|
|
19
21
|
|
|
22
|
+
@mixin fade-out() {
|
|
23
|
+
&-leave-to {
|
|
24
|
+
opacity: 0;
|
|
25
|
+
}
|
|
26
|
+
&-leave-active {
|
|
27
|
+
transition-duration: 100ms !important;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
20
31
|
// Generic transitions
|
|
21
32
|
.fade-transition {
|
|
22
33
|
@include transition-default();
|
|
23
34
|
|
|
35
|
+
&-leave-active {
|
|
36
|
+
position: absolute;
|
|
37
|
+
}
|
|
38
|
+
|
|
24
39
|
&-enter-from, &-leave-to {
|
|
25
40
|
opacity: 0 !important;
|
|
26
41
|
}
|
|
@@ -52,3 +67,90 @@ $standard-duration: $cds-duration-fast + ms;
|
|
|
52
67
|
}
|
|
53
68
|
}
|
|
54
69
|
|
|
70
|
+
.slide-transition-right {
|
|
71
|
+
&-enter-active,
|
|
72
|
+
&-leave-active {
|
|
73
|
+
transition: transform $accent-duration $accent-easting;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
&-leave-active {
|
|
77
|
+
position: absolute;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&-enter-from {
|
|
81
|
+
transform: translate3d(-100%, 0, 0);
|
|
82
|
+
}
|
|
83
|
+
&-leave-to {
|
|
84
|
+
transform: translate3d(100%, 0, 0);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.slide-transition-left {
|
|
89
|
+
&-enter-active,
|
|
90
|
+
&-leave-active {
|
|
91
|
+
transition: transform $accent-duration $accent-easting;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&-leave-active {
|
|
95
|
+
position: absolute;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&-enter-from {
|
|
99
|
+
transform: translate3d(100%, 0, 0);
|
|
100
|
+
}
|
|
101
|
+
&-leave-to {
|
|
102
|
+
transform: translate3d(-100%, 0, 0);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.jump-transition {
|
|
107
|
+
&-left, &-right {
|
|
108
|
+
&-enter-active,
|
|
109
|
+
&-leave-active {
|
|
110
|
+
transition: opacity $accent-duration, transform $accent-duration;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
&-enter-from,
|
|
114
|
+
&-leave-to {
|
|
115
|
+
opacity: 0
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
&-leave-active {
|
|
119
|
+
position: absolute;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
&-right {
|
|
124
|
+
&-enter-from {
|
|
125
|
+
transform: translate3d(-15px, 0, 0);
|
|
126
|
+
}
|
|
127
|
+
&-leave-to {
|
|
128
|
+
transform: translate3d(15px, 0, 0);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
&-left {
|
|
133
|
+
&-enter-from {
|
|
134
|
+
transform: translate3d(15px, 0, 0);
|
|
135
|
+
}
|
|
136
|
+
&-leave-to {
|
|
137
|
+
transform: translate3d(-15px, 0, 0);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.scale-transition {
|
|
143
|
+
@include transition-default();
|
|
144
|
+
@include fade-out();
|
|
145
|
+
|
|
146
|
+
&-enter-from {
|
|
147
|
+
opacity: 0;
|
|
148
|
+
transform: scale(0);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
&-enter-active,
|
|
152
|
+
&-leave-active {
|
|
153
|
+
transition-property: transform, opacity !important;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|