@duskmoon-dev/components 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +61 -2
- package/dist/{chunk-r9wkv7xd.js → chunk-fwjzvsrx.js} +3 -3
- package/dist/classes/chat.d.ts +43 -0
- package/dist/classes/console-page.d.ts +16 -0
- package/dist/classes/dropdown.d.ts +5 -5
- package/dist/classes/fab.d.ts +11 -0
- package/dist/classes/index.d.ts +6 -0
- package/dist/classes/index.js +1443 -1210
- package/dist/classes/megamenu.d.ts +10 -0
- package/dist/classes/otp-input.d.ts +12 -0
- package/dist/classes/popover.d.ts +1 -3
- package/dist/classes/swap.d.ts +12 -0
- package/dist/classes/tree-select.d.ts +6 -6
- package/dist/components/anchor/index.js +2 -2
- package/dist/components/app/index.js +211 -151
- package/dist/components/avatar/Avatar.types.d.ts +1 -1
- package/dist/components/avatar/index.js +2 -1
- package/dist/components/badge/index.js +1 -1
- package/dist/components/button/Button.d.ts +1 -1
- package/dist/components/button/Button.types.d.ts +8 -0
- package/dist/components/button/index.js +253 -24
- package/dist/components/calendar/index.js +44 -19
- package/dist/components/cascader/index.js +2 -2
- package/dist/components/chat/Chat.d.ts +22 -0
- package/dist/components/chat/Chat.types.d.ts +73 -0
- package/dist/components/chat/index.d.ts +2 -0
- package/dist/components/chat/index.js +309 -0
- package/dist/components/color-picker/ColorPicker.types.d.ts +2 -1
- package/dist/components/color-picker/index.js +210 -13
- package/dist/components/config-provider/index.js +2 -2
- package/dist/components/console-page/ConsolePage.d.ts +2 -0
- package/dist/components/console-page/ConsolePage.types.d.ts +29 -0
- package/dist/components/console-page/index.d.ts +2 -0
- package/dist/components/console-page/index.js +205 -0
- package/dist/components/date-picker/DatePicker.types.d.ts +1 -0
- package/dist/components/date-picker/index.js +537 -35
- package/dist/components/date-picker/usePickerDropdown.d.ts +17 -0
- package/dist/components/dm-breadcrumb/index.js +18 -18
- package/dist/components/dm-date-picker/index.js +635 -133
- package/dist/components/dm-drawer/index.js +269 -40
- package/dist/components/dm-layout/index.js +575 -208
- package/dist/components/dm-menu/index.js +399 -32
- package/dist/components/dm-message/index.js +18 -18
- package/dist/components/dm-page-header/index.js +537 -247
- package/dist/components/dm-pagination/index.js +39 -39
- package/dist/components/dm-pro-table/index.js +2374 -1559
- package/dist/components/dm-provider/index.js +94 -94
- package/dist/components/dm-query/DmQuery.types.d.ts +1 -1
- package/dist/components/dm-query/index.js +955 -210
- package/dist/components/dm-search/DmSearch.types.d.ts +4 -0
- package/dist/components/dm-search/index.js +937 -183
- package/dist/components/dm-splitter/index.js +32 -32
- package/dist/components/dm-status/index.js +25 -25
- package/dist/components/dm-table/index.js +1430 -676
- package/dist/components/dm-tabs/index.js +34 -34
- package/dist/components/dm-toolbar/index.js +423 -133
- package/dist/components/dm-tree/index.js +92 -92
- package/dist/components/dm-truncate/index.js +145 -65
- package/dist/components/dropdown/Dropdown.types.d.ts +1 -1
- package/dist/components/dropdown/index.js +467 -177
- package/dist/components/fab/Fab.d.ts +4 -0
- package/dist/components/fab/Fab.types.d.ts +25 -0
- package/dist/components/fab/index.d.ts +2 -0
- package/dist/components/fab/index.js +480 -0
- package/dist/components/form/Form.types.d.ts +1 -0
- package/dist/components/form/index.js +16 -5
- package/dist/components/grid/index.js +2 -2
- package/dist/components/input/index.js +4 -4
- package/dist/components/markdown/index.js +1 -1
- package/dist/components/megamenu/Megamenu.d.ts +2 -0
- package/dist/components/megamenu/Megamenu.types.d.ts +32 -0
- package/dist/components/megamenu/index.d.ts +2 -0
- package/dist/components/megamenu/index.js +214 -0
- package/dist/components/message/index.js +5 -5
- package/dist/components/modal/index.js +128 -68
- package/dist/components/notification/index.js +2 -2
- package/dist/components/otp-input/OtpInput.d.ts +2 -0
- package/dist/components/otp-input/OtpInput.types.d.ts +16 -0
- package/dist/components/otp-input/index.d.ts +2 -0
- package/dist/components/otp-input/index.js +112 -0
- package/dist/components/popconfirm/index.js +297 -68
- package/dist/components/popover/index.js +24 -4
- package/dist/components/skeleton/index.js +5 -5
- package/dist/components/spin/index.js +2 -2
- package/dist/components/steps/index.js +2 -2
- package/dist/components/swap/Swap.d.ts +3 -0
- package/dist/components/swap/Swap.types.d.ts +22 -0
- package/dist/components/swap/index.d.ts +2 -0
- package/dist/components/swap/index.js +109 -0
- package/dist/components/table/index.js +2 -2
- package/dist/components/tabs/index.js +2 -2
- package/dist/components/tag/index.js +2 -2
- package/dist/components/time-picker/TimePicker.types.d.ts +1 -0
- package/dist/components/time-picker/index.js +167 -29
- package/dist/components/tooltip/Tooltip.types.d.ts +4 -0
- package/dist/components/tooltip/index.js +107 -27
- package/dist/components/tour/index.js +315 -86
- package/dist/components/tree-select/index.js +8 -8
- package/dist/components/typography/index.js +4 -4
- package/dist/components/upload/Upload.types.d.ts +1 -0
- package/dist/components/upload/index.js +7 -5
- package/dist/generated/version.d.ts +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.js +4023 -2134
- package/dist/infrastructure.js +11 -11
- package/dist/styles.css +13677 -9811
- package/dist/theme/index.js +3 -3
- package/dist/utils/index.js +5 -5
- package/package.json +30 -6
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
// src/components/
|
|
4
|
-
import
|
|
3
|
+
// src/components/dm-provider/DmProvider.tsx
|
|
4
|
+
import { forwardRef as forwardRef2, useEffect, useState as useState2 } from "react";
|
|
5
5
|
|
|
6
6
|
// ../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
7
7
|
function r(e) {
|
|
@@ -28,6 +28,93 @@ function clsx() {
|
|
|
28
28
|
function cn(...inputs) {
|
|
29
29
|
return clsx(inputs);
|
|
30
30
|
}
|
|
31
|
+
// src/classes/dm-provider.ts
|
|
32
|
+
var dmProviderClass = "dm-provider";
|
|
33
|
+
function getDmProviderClasses({ className }) {
|
|
34
|
+
return cn(dmProviderClass, className);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// src/infrastructure.ts
|
|
38
|
+
import { useCallback, useState } from "react";
|
|
39
|
+
var primaryColor = "#0065ff";
|
|
40
|
+
var prefixCls = "dm";
|
|
41
|
+
var datePickerLocale = "en";
|
|
42
|
+
var themeUpdateCallbacks = new Set;
|
|
43
|
+
function emitThemeUpdate() {
|
|
44
|
+
for (const callback of themeUpdateCallbacks) {
|
|
45
|
+
callback();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function setDmPrefixCls(nextPrefixCls) {
|
|
49
|
+
prefixCls = nextPrefixCls;
|
|
50
|
+
emitThemeUpdate();
|
|
51
|
+
}
|
|
52
|
+
function setDmPrimaryColor(color) {
|
|
53
|
+
primaryColor = color;
|
|
54
|
+
emitThemeUpdate();
|
|
55
|
+
}
|
|
56
|
+
function onDmThemeUpdate(callback) {
|
|
57
|
+
themeUpdateCallbacks.add(callback);
|
|
58
|
+
return () => {
|
|
59
|
+
themeUpdateCallbacks.delete(callback);
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
function getDmTheme() {
|
|
63
|
+
return {
|
|
64
|
+
prefixCls,
|
|
65
|
+
token: {
|
|
66
|
+
colorInfo: primaryColor,
|
|
67
|
+
colorPrimary: primaryColor,
|
|
68
|
+
colorLink: primaryColor
|
|
69
|
+
},
|
|
70
|
+
components: {
|
|
71
|
+
Table: {
|
|
72
|
+
cellFontSizeSM: 12,
|
|
73
|
+
cellPaddingBlockSM: 10,
|
|
74
|
+
headerColor: "#5a607f"
|
|
75
|
+
},
|
|
76
|
+
Breadcrumb: {
|
|
77
|
+
linkColor: "#5a607f",
|
|
78
|
+
linkHoverColor: "#5a607f",
|
|
79
|
+
itemColor: "#5a607f",
|
|
80
|
+
lastItemColor: "#2f2e3f",
|
|
81
|
+
separatorColor: "#5a607f"
|
|
82
|
+
},
|
|
83
|
+
Menu: {
|
|
84
|
+
collapsedWidth: 60,
|
|
85
|
+
itemMarginBlock: 8,
|
|
86
|
+
itemMarginInline: 10,
|
|
87
|
+
itemPaddingInline: 10
|
|
88
|
+
},
|
|
89
|
+
Input: {
|
|
90
|
+
activeBorderColor: primaryColor
|
|
91
|
+
},
|
|
92
|
+
Tabs: {
|
|
93
|
+
inkBarColor: primaryColor,
|
|
94
|
+
itemSelectedColor: primaryColor
|
|
95
|
+
},
|
|
96
|
+
DatePicker: {
|
|
97
|
+
activeBorderColor: primaryColor
|
|
98
|
+
},
|
|
99
|
+
Tree: {
|
|
100
|
+
directoryNodeSelectedBg: primaryColor
|
|
101
|
+
},
|
|
102
|
+
Radio: {
|
|
103
|
+
buttonSolidCheckedBg: primaryColor
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
function setDmDatePickerLocale(locale) {
|
|
109
|
+
datePickerLocale = locale;
|
|
110
|
+
}
|
|
111
|
+
function getDmDatePickerLocale() {
|
|
112
|
+
return datePickerLocale;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// src/components/config-provider/ConfigProvider.tsx
|
|
116
|
+
import React, { createContext, forwardRef, useContext, useMemo } from "react";
|
|
117
|
+
|
|
31
118
|
// src/classes/config-provider.ts
|
|
32
119
|
var configProviderClass = "config-provider";
|
|
33
120
|
var configProviderRtlClass = "config-provider-rtl";
|
|
@@ -121,93 +208,6 @@ ConfigProvider.useConfig = () => {
|
|
|
121
208
|
ConfigProvider.config = (config) => {
|
|
122
209
|
globalConfig = { ...globalConfig, ...config };
|
|
123
210
|
};
|
|
124
|
-
// src/components/dm-provider/DmProvider.tsx
|
|
125
|
-
import { forwardRef as forwardRef2, useEffect, useState as useState2 } from "react";
|
|
126
|
-
|
|
127
|
-
// src/classes/dm-provider.ts
|
|
128
|
-
var dmProviderClass = "dm-provider";
|
|
129
|
-
function getDmProviderClasses({ className }) {
|
|
130
|
-
return cn(dmProviderClass, className);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
// src/infrastructure.ts
|
|
134
|
-
import { useCallback, useState } from "react";
|
|
135
|
-
var primaryColor = "#0065ff";
|
|
136
|
-
var prefixCls = "dm";
|
|
137
|
-
var datePickerLocale = "en";
|
|
138
|
-
var themeUpdateCallbacks = new Set;
|
|
139
|
-
function emitThemeUpdate() {
|
|
140
|
-
for (const callback of themeUpdateCallbacks) {
|
|
141
|
-
callback();
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
function setDmPrefixCls(nextPrefixCls) {
|
|
145
|
-
prefixCls = nextPrefixCls;
|
|
146
|
-
emitThemeUpdate();
|
|
147
|
-
}
|
|
148
|
-
function setDmPrimaryColor(color) {
|
|
149
|
-
primaryColor = color;
|
|
150
|
-
emitThemeUpdate();
|
|
151
|
-
}
|
|
152
|
-
function onDmThemeUpdate(callback) {
|
|
153
|
-
themeUpdateCallbacks.add(callback);
|
|
154
|
-
return () => {
|
|
155
|
-
themeUpdateCallbacks.delete(callback);
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
function getDmTheme() {
|
|
159
|
-
return {
|
|
160
|
-
prefixCls,
|
|
161
|
-
token: {
|
|
162
|
-
colorInfo: primaryColor,
|
|
163
|
-
colorPrimary: primaryColor,
|
|
164
|
-
colorLink: primaryColor
|
|
165
|
-
},
|
|
166
|
-
components: {
|
|
167
|
-
Table: {
|
|
168
|
-
cellFontSizeSM: 12,
|
|
169
|
-
cellPaddingBlockSM: 10,
|
|
170
|
-
headerColor: "#5a607f"
|
|
171
|
-
},
|
|
172
|
-
Breadcrumb: {
|
|
173
|
-
linkColor: "#5a607f",
|
|
174
|
-
linkHoverColor: "#5a607f",
|
|
175
|
-
itemColor: "#5a607f",
|
|
176
|
-
lastItemColor: "#2f2e3f",
|
|
177
|
-
separatorColor: "#5a607f"
|
|
178
|
-
},
|
|
179
|
-
Menu: {
|
|
180
|
-
collapsedWidth: 60,
|
|
181
|
-
itemMarginBlock: 8,
|
|
182
|
-
itemMarginInline: 10,
|
|
183
|
-
itemPaddingInline: 10
|
|
184
|
-
},
|
|
185
|
-
Input: {
|
|
186
|
-
activeBorderColor: primaryColor
|
|
187
|
-
},
|
|
188
|
-
Tabs: {
|
|
189
|
-
inkBarColor: primaryColor,
|
|
190
|
-
itemSelectedColor: primaryColor
|
|
191
|
-
},
|
|
192
|
-
DatePicker: {
|
|
193
|
-
activeBorderColor: primaryColor
|
|
194
|
-
},
|
|
195
|
-
Tree: {
|
|
196
|
-
directoryNodeSelectedBg: primaryColor
|
|
197
|
-
},
|
|
198
|
-
Radio: {
|
|
199
|
-
buttonSolidCheckedBg: primaryColor
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
function setDmDatePickerLocale(locale) {
|
|
205
|
-
datePickerLocale = locale;
|
|
206
|
-
}
|
|
207
|
-
function getDmDatePickerLocale() {
|
|
208
|
-
return datePickerLocale;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
211
|
// src/components/dm-provider/DmProvider.tsx
|
|
212
212
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
213
213
|
var DmProvider = forwardRef2(({
|
|
@@ -216,7 +216,7 @@ var DmProvider = forwardRef2(({
|
|
|
216
216
|
component = "div",
|
|
217
217
|
direction,
|
|
218
218
|
locale,
|
|
219
|
-
prefixCls
|
|
219
|
+
prefixCls,
|
|
220
220
|
theme,
|
|
221
221
|
...props
|
|
222
222
|
}, ref) => {
|
|
@@ -227,10 +227,10 @@ var DmProvider = forwardRef2(({
|
|
|
227
227
|
});
|
|
228
228
|
}, []);
|
|
229
229
|
useEffect(() => {
|
|
230
|
-
if (
|
|
231
|
-
setDmPrefixCls(
|
|
230
|
+
if (prefixCls) {
|
|
231
|
+
setDmPrefixCls(prefixCls);
|
|
232
232
|
}
|
|
233
|
-
}, [
|
|
233
|
+
}, [prefixCls]);
|
|
234
234
|
useEffect(() => {
|
|
235
235
|
const colorPrimary = theme?.token?.colorPrimary;
|
|
236
236
|
if (typeof colorPrimary === "string") {
|
|
@@ -244,7 +244,7 @@ var DmProvider = forwardRef2(({
|
|
|
244
244
|
className: getDmProviderClasses({ className }),
|
|
245
245
|
direction,
|
|
246
246
|
locale,
|
|
247
|
-
prefixCls:
|
|
247
|
+
prefixCls: prefixCls ?? currentTheme.prefixCls,
|
|
248
248
|
theme: theme ?? currentTheme,
|
|
249
249
|
children
|
|
250
250
|
});
|
|
@@ -7,6 +7,7 @@ export type DmQueryItem = {
|
|
|
7
7
|
name: string;
|
|
8
8
|
extraProps?: Record<string, unknown>;
|
|
9
9
|
customProps?: Record<string, unknown>;
|
|
10
|
+
render?: DmSearchItem["search"]["render"];
|
|
10
11
|
};
|
|
11
12
|
export interface DmQueryRef extends DmSearchRef {
|
|
12
13
|
retractChange: (value: string, data?: DmQueryItem[]) => void;
|
|
@@ -16,5 +17,4 @@ export interface DmQueryProps extends Omit<DmSearchProps, "items" | "fastFilterI
|
|
|
16
17
|
fastFilterItem?: DmQueryItem;
|
|
17
18
|
collapsed?: boolean;
|
|
18
19
|
form?: unknown;
|
|
19
|
-
onReset?: () => void;
|
|
20
20
|
}
|