@duskmoon-dev/components 0.1.2 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/classes/app.d.ts +2 -2
- package/dist/classes/auto-complete.d.ts +4 -2
- package/dist/classes/checkbox.d.ts +9 -5
- package/dist/classes/color-picker.d.ts +2 -1
- package/dist/classes/dm-drawer.d.ts +1 -1
- package/dist/classes/dm-toolbar.d.ts +1 -1
- package/dist/classes/index.d.ts +0 -1
- package/dist/classes/index.js +49 -38
- package/dist/components/alert/index.js +3 -3
- package/dist/components/app/index.js +3 -10
- package/dist/components/auto-complete/AutoComplete.types.d.ts +2 -0
- package/dist/components/auto-complete/index.js +14 -8
- package/dist/components/cascader/index.js +10 -1
- package/dist/components/checkbox/index.js +10 -21
- package/dist/components/col/index.d.ts +1 -1
- package/dist/components/collapse/index.js +3 -1
- package/dist/components/color-picker/index.js +6 -2
- package/dist/components/date-picker/DatePicker.types.d.ts +4 -1
- package/dist/components/date-picker/index.js +1 -2
- package/dist/components/descriptions/index.js +10 -1
- package/dist/components/dm-date-picker/index.js +1 -2
- package/dist/components/dm-drawer/index.js +1 -3
- package/dist/components/dm-page-header/index.js +1 -3
- package/dist/components/dm-pro-table/DmProTable.d.ts +1 -1
- package/dist/components/dm-pro-table/DmProTable.types.d.ts +3 -2
- package/dist/components/dm-pro-table/index.js +14 -26
- package/dist/components/dm-query/index.js +11 -4
- package/dist/components/dm-search/index.js +5 -3
- package/dist/components/dm-table/index.js +5 -3
- package/dist/components/dm-toolbar/index.js +1 -3
- package/dist/components/dm-tree/index.js +3 -1
- package/dist/components/mentions/index.js +1 -7
- package/dist/components/popover/index.d.ts +1 -1
- package/dist/components/tour/index.js +4 -1
- package/dist/components/transfer/index.js +7 -6
- package/dist/components/typography/index.js +1 -7
- package/dist/generated/version.d.ts +1 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.js +441 -440
- package/dist/infrastructure.d.ts +1 -1
- package/dist/infrastructure.js +5 -1
- package/dist/styles.css +5442 -0
- package/package.json +33 -12
- package/dist/classes/dm-pro-table-inner.d.ts +0 -1
- package/dist/components/dm-pro-table-inner/DmProTableInner.d.ts +0 -7
- package/dist/components/dm-pro-table-inner/DmProTableInner.types.d.ts +0 -5
- package/dist/components/dm-pro-table-inner/index.d.ts +0 -2
- package/dist/components/dm-pro-table-inner/index.js +0 -2620
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { TableRecord } from "../table/Table.types";
|
|
3
3
|
import type { DmProTableProps } from "./DmProTable.types";
|
|
4
|
-
export declare function DmProTable<T extends TableRecord = TableRecord>({ headerTitle, toolBarRender, toolbarItems, showTitleBar, columnSettingVisible, className, ...props }: DmProTableProps<T>): React.JSX.Element;
|
|
4
|
+
export declare function DmProTable<T extends TableRecord = TableRecord>({ headerTitle, toolBarRender, toolbarItems, showTitleBar, columnSettingVisible, className, rowData, ...props }: DmProTableProps<T>): React.JSX.Element;
|
|
5
5
|
export declare namespace DmProTable {
|
|
6
6
|
var displayName: string;
|
|
7
7
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
|
-
import type {
|
|
2
|
+
import type { DmTableProps } from "../dm-table";
|
|
3
3
|
import type { DmToolbarItem } from "../dm-toolbar";
|
|
4
4
|
import type { TableRecord } from "../table/Table.types";
|
|
5
|
-
export interface DmProTableProps<T = TableRecord> extends
|
|
5
|
+
export interface DmProTableProps<T = TableRecord> extends Omit<DmTableProps<T>, "dataSource"> {
|
|
6
|
+
rowData?: T[];
|
|
6
7
|
headerTitle?: ReactNode;
|
|
7
8
|
toolBarRender?: (() => ReactNode[] | ReactNode) | ReactNode[] | ReactNode;
|
|
8
9
|
toolbarItems?: DmToolbarItem[];
|
|
@@ -334,8 +334,7 @@ var DatePickerRoot = forwardRef(({
|
|
|
334
334
|
}) : null,
|
|
335
335
|
/* @__PURE__ */ jsx3("span", {
|
|
336
336
|
className: datePickerIconClass,
|
|
337
|
-
"aria-hidden": "true"
|
|
338
|
-
children: "calendar"
|
|
337
|
+
"aria-hidden": "true"
|
|
339
338
|
}),
|
|
340
339
|
(presetItems.length > 0 || showNow) && visible ? /* @__PURE__ */ jsxs2("div", {
|
|
341
340
|
className: getDatePickerDropdownClasses({ open: visible }),
|
|
@@ -747,9 +746,7 @@ var dmToolbarItemClass = "dm-toolbar-item";
|
|
|
747
746
|
var dmToolbarPrimaryItemClass = "dm-toolbar-primary-item";
|
|
748
747
|
var dmToolbarSecondaryItemClass = "dm-toolbar-secondary-item";
|
|
749
748
|
var dmToolbarMoreClass = "dm-toolbar-more";
|
|
750
|
-
function getDmToolbarClasses({
|
|
751
|
-
className
|
|
752
|
-
}) {
|
|
749
|
+
function getDmToolbarClasses({ className }) {
|
|
753
750
|
return cn(dmToolbarBaseClass, className);
|
|
754
751
|
}
|
|
755
752
|
function getDmToolbarItemClasses({
|
|
@@ -2099,7 +2096,10 @@ var DmSearch = forwardRef7(({
|
|
|
2099
2096
|
value: values[item.dataIndex],
|
|
2100
2097
|
loading,
|
|
2101
2098
|
enableDefaultPlaceHolder,
|
|
2102
|
-
setValue: (value) => setValues((current) => ({
|
|
2099
|
+
setValue: (value) => setValues((current) => ({
|
|
2100
|
+
...current,
|
|
2101
|
+
[item.dataIndex]: value
|
|
2102
|
+
}))
|
|
2103
2103
|
})
|
|
2104
2104
|
]
|
|
2105
2105
|
}, item.key))
|
|
@@ -2996,20 +2996,6 @@ function DmTable({
|
|
|
2996
2996
|
});
|
|
2997
2997
|
}
|
|
2998
2998
|
DmTable.displayName = "DmTable";
|
|
2999
|
-
// src/components/dm-pro-table-inner/DmProTableInner.tsx
|
|
3000
|
-
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
3001
|
-
function DmProTableInner({
|
|
3002
|
-
rowData,
|
|
3003
|
-
className,
|
|
3004
|
-
...props
|
|
3005
|
-
}) {
|
|
3006
|
-
return /* @__PURE__ */ jsx13(DmTable, {
|
|
3007
|
-
...props,
|
|
3008
|
-
className: getDmTableClasses({ className }),
|
|
3009
|
-
dataSource: rowData
|
|
3010
|
-
});
|
|
3011
|
-
}
|
|
3012
|
-
DmProTableInner.displayName = "DmProTableInner";
|
|
3013
2999
|
// src/classes/dm-pro-table.ts
|
|
3014
3000
|
var dmProTableBaseClass = "dm-pro-table";
|
|
3015
3001
|
var dmProTableHeaderClass = "dm-pro-table-header";
|
|
@@ -3021,7 +3007,7 @@ function getDmProTableClasses({ className }) {
|
|
|
3021
3007
|
}
|
|
3022
3008
|
|
|
3023
3009
|
// src/components/dm-pro-table/DmProTable.tsx
|
|
3024
|
-
import { jsx as
|
|
3010
|
+
import { jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
3025
3011
|
function renderToolbar(toolBarRender) {
|
|
3026
3012
|
if (typeof toolBarRender === "function")
|
|
3027
3013
|
return toolBarRender();
|
|
@@ -3034,6 +3020,7 @@ function DmProTable({
|
|
|
3034
3020
|
showTitleBar = true,
|
|
3035
3021
|
columnSettingVisible,
|
|
3036
3022
|
className,
|
|
3023
|
+
rowData,
|
|
3037
3024
|
...props
|
|
3038
3025
|
}) {
|
|
3039
3026
|
return /* @__PURE__ */ jsxs12("div", {
|
|
@@ -3042,17 +3029,17 @@ function DmProTable({
|
|
|
3042
3029
|
showTitleBar ? /* @__PURE__ */ jsxs12("div", {
|
|
3043
3030
|
className: dmProTableHeaderClass,
|
|
3044
3031
|
children: [
|
|
3045
|
-
/* @__PURE__ */
|
|
3032
|
+
/* @__PURE__ */ jsx13("div", {
|
|
3046
3033
|
className: dmProTableTitleClass,
|
|
3047
3034
|
children: headerTitle
|
|
3048
3035
|
}),
|
|
3049
3036
|
/* @__PURE__ */ jsxs12("div", {
|
|
3050
3037
|
className: dmProTableToolbarClass,
|
|
3051
3038
|
children: [
|
|
3052
|
-
toolbarItems?.length ? /* @__PURE__ */
|
|
3039
|
+
toolbarItems?.length ? /* @__PURE__ */ jsx13(DmToolbar, {
|
|
3053
3040
|
items: toolbarItems
|
|
3054
3041
|
}) : renderToolbar(toolBarRender),
|
|
3055
|
-
columnSettingVisible ? /* @__PURE__ */
|
|
3042
|
+
columnSettingVisible ? /* @__PURE__ */ jsx13(Button, {
|
|
3056
3043
|
type: "button",
|
|
3057
3044
|
color: "secondary",
|
|
3058
3045
|
appearance: "outline",
|
|
@@ -3063,9 +3050,10 @@ function DmProTable({
|
|
|
3063
3050
|
})
|
|
3064
3051
|
]
|
|
3065
3052
|
}) : null,
|
|
3066
|
-
/* @__PURE__ */
|
|
3053
|
+
/* @__PURE__ */ jsx13(DmTable, {
|
|
3067
3054
|
...props,
|
|
3068
|
-
columnSettingVisible: showTitleBar ? false : columnSettingVisible
|
|
3055
|
+
columnSettingVisible: showTitleBar ? false : columnSettingVisible,
|
|
3056
|
+
dataSource: rowData
|
|
3069
3057
|
})
|
|
3070
3058
|
]
|
|
3071
3059
|
});
|
|
@@ -291,8 +291,7 @@ var DatePickerRoot = forwardRef(({
|
|
|
291
291
|
}) : null,
|
|
292
292
|
/* @__PURE__ */ jsx2("span", {
|
|
293
293
|
className: datePickerIconClass,
|
|
294
|
-
"aria-hidden": "true"
|
|
295
|
-
children: "calendar"
|
|
294
|
+
"aria-hidden": "true"
|
|
296
295
|
}),
|
|
297
296
|
(presetItems.length > 0 || showNow) && visible ? /* @__PURE__ */ jsxs2("div", {
|
|
298
297
|
className: getDatePickerDropdownClasses({ open: visible }),
|
|
@@ -1222,7 +1221,10 @@ var DmSearch = forwardRef4(({
|
|
|
1222
1221
|
value: values[item.dataIndex],
|
|
1223
1222
|
loading,
|
|
1224
1223
|
enableDefaultPlaceHolder,
|
|
1225
|
-
setValue: (value) => setValues((current) => ({
|
|
1224
|
+
setValue: (value) => setValues((current) => ({
|
|
1225
|
+
...current,
|
|
1226
|
+
[item.dataIndex]: value
|
|
1227
|
+
}))
|
|
1226
1228
|
})
|
|
1227
1229
|
]
|
|
1228
1230
|
}, item.key))
|
|
@@ -1260,7 +1262,12 @@ var DmSearch = forwardRef4(({
|
|
|
1260
1262
|
});
|
|
1261
1263
|
DmSearch.displayName = "DmSearch";
|
|
1262
1264
|
// src/components/dm-query/DmQuery.tsx
|
|
1263
|
-
import {
|
|
1265
|
+
import {
|
|
1266
|
+
forwardRef as forwardRef5,
|
|
1267
|
+
useImperativeHandle as useImperativeHandle3,
|
|
1268
|
+
useRef as useRef2,
|
|
1269
|
+
useState as useState5
|
|
1270
|
+
} from "react";
|
|
1264
1271
|
import { jsx as jsx6, jsxs as jsxs6, Fragment } from "react/jsx-runtime";
|
|
1265
1272
|
function toSearchItem(item) {
|
|
1266
1273
|
return {
|
|
@@ -291,8 +291,7 @@ var DatePickerRoot = forwardRef(({
|
|
|
291
291
|
}) : null,
|
|
292
292
|
/* @__PURE__ */ jsx2("span", {
|
|
293
293
|
className: datePickerIconClass,
|
|
294
|
-
"aria-hidden": "true"
|
|
295
|
-
children: "calendar"
|
|
294
|
+
"aria-hidden": "true"
|
|
296
295
|
}),
|
|
297
296
|
(presetItems.length > 0 || showNow) && visible ? /* @__PURE__ */ jsxs2("div", {
|
|
298
297
|
className: getDatePickerDropdownClasses({ open: visible }),
|
|
@@ -1222,7 +1221,10 @@ var DmSearch = forwardRef4(({
|
|
|
1222
1221
|
value: values[item.dataIndex],
|
|
1223
1222
|
loading,
|
|
1224
1223
|
enableDefaultPlaceHolder,
|
|
1225
|
-
setValue: (value) => setValues((current) => ({
|
|
1224
|
+
setValue: (value) => setValues((current) => ({
|
|
1225
|
+
...current,
|
|
1226
|
+
[item.dataIndex]: value
|
|
1227
|
+
}))
|
|
1226
1228
|
})
|
|
1227
1229
|
]
|
|
1228
1230
|
}, item.key))
|
|
@@ -334,8 +334,7 @@ var DatePickerRoot = forwardRef(({
|
|
|
334
334
|
}) : null,
|
|
335
335
|
/* @__PURE__ */ jsx3("span", {
|
|
336
336
|
className: datePickerIconClass,
|
|
337
|
-
"aria-hidden": "true"
|
|
338
|
-
children: "calendar"
|
|
337
|
+
"aria-hidden": "true"
|
|
339
338
|
}),
|
|
340
339
|
(presetItems.length > 0 || showNow) && visible ? /* @__PURE__ */ jsxs2("div", {
|
|
341
340
|
className: getDatePickerDropdownClasses({ open: visible }),
|
|
@@ -1704,7 +1703,10 @@ var DmSearch = forwardRef6(({
|
|
|
1704
1703
|
value: values[item.dataIndex],
|
|
1705
1704
|
loading,
|
|
1706
1705
|
enableDefaultPlaceHolder,
|
|
1707
|
-
setValue: (value) => setValues((current) => ({
|
|
1706
|
+
setValue: (value) => setValues((current) => ({
|
|
1707
|
+
...current,
|
|
1708
|
+
[item.dataIndex]: value
|
|
1709
|
+
}))
|
|
1708
1710
|
})
|
|
1709
1711
|
]
|
|
1710
1712
|
}, item.key))
|
|
@@ -415,9 +415,7 @@ var dmToolbarItemClass = "dm-toolbar-item";
|
|
|
415
415
|
var dmToolbarPrimaryItemClass = "dm-toolbar-primary-item";
|
|
416
416
|
var dmToolbarSecondaryItemClass = "dm-toolbar-secondary-item";
|
|
417
417
|
var dmToolbarMoreClass = "dm-toolbar-more";
|
|
418
|
-
function getDmToolbarClasses({
|
|
419
|
-
className
|
|
420
|
-
}) {
|
|
418
|
+
function getDmToolbarClasses({ className }) {
|
|
421
419
|
return cn(dmToolbarBaseClass, className);
|
|
422
420
|
}
|
|
423
421
|
function getDmToolbarItemClasses({
|
|
@@ -1699,7 +1699,9 @@ function CommonDmTree({
|
|
|
1699
1699
|
const titleField = fieldName(fieldNames, "title");
|
|
1700
1700
|
const title = source[titleField] ?? source.title;
|
|
1701
1701
|
const actions = typeof itemToolbar === "function" ? itemToolbar(source) : Array.isArray(itemToolbar) ? /* @__PURE__ */ jsx8("span", {
|
|
1702
|
-
className: getDmTreeItemToolbarClasses({
|
|
1702
|
+
className: getDmTreeItemToolbarClasses({
|
|
1703
|
+
alwaysShow: itemToolbarAlwaysShow
|
|
1704
|
+
}),
|
|
1703
1705
|
children: itemToolbar.filter((action) => shouldShowAction(action, source)).map((action, index) => {
|
|
1704
1706
|
const disabled = isActionDisabled(action, source);
|
|
1705
1707
|
return /* @__PURE__ */ jsx8("button", {
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
// src/components/mentions/Mentions.tsx
|
|
4
|
-
import React, {
|
|
5
|
-
forwardRef,
|
|
6
|
-
useId,
|
|
7
|
-
useMemo,
|
|
8
|
-
useRef,
|
|
9
|
-
useState
|
|
10
|
-
} from "react";
|
|
4
|
+
import React, { forwardRef, useId, useMemo, useRef, useState } from "react";
|
|
11
5
|
|
|
12
6
|
// ../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
13
7
|
function r(e) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { Popover } from "./Popover";
|
|
2
|
-
export type { PopoverPlacement, PopoverProps, PopoverTrigger } from "./Popover.types";
|
|
2
|
+
export type { PopoverPlacement, PopoverProps, PopoverTrigger, } from "./Popover.types";
|
|
@@ -335,7 +335,10 @@ var Tour = forwardRef(({
|
|
|
335
335
|
const descriptionId = `${rootId}-description`;
|
|
336
336
|
const lastStep = mergedCurrent >= steps.length - 1;
|
|
337
337
|
const showHighlight = hasMask && (targetRect.width > 0 || targetRect.height > 0);
|
|
338
|
-
const rootStyle = {
|
|
338
|
+
const rootStyle = {
|
|
339
|
+
...style,
|
|
340
|
+
...zIndex !== undefined ? { zIndex } : undefined
|
|
341
|
+
};
|
|
339
342
|
const currentCloseIcon = step.closeIcon ?? closeIcon;
|
|
340
343
|
const currentNextButtonProps = mergeButtonProps(nextButtonProps, step.nextButtonProps);
|
|
341
344
|
const currentPrevButtonProps = mergeButtonProps(prevButtonProps, step.prevButtonProps);
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
// src/components/transfer/Transfer.tsx
|
|
4
|
-
import {
|
|
5
|
-
forwardRef,
|
|
6
|
-
useMemo,
|
|
7
|
-
useState
|
|
8
|
-
} from "react";
|
|
4
|
+
import { forwardRef, useMemo, useState } from "react";
|
|
9
5
|
|
|
10
6
|
// ../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
11
7
|
function r(e) {
|
|
@@ -148,7 +144,12 @@ function splitSelectedKeys(keys, targetKeySet) {
|
|
|
148
144
|
return groups;
|
|
149
145
|
}, { source: [], target: [] });
|
|
150
146
|
}
|
|
151
|
-
var TransferSearch = forwardRef(({
|
|
147
|
+
var TransferSearch = forwardRef(({
|
|
148
|
+
className,
|
|
149
|
+
placeholder = defaultLocale.searchPlaceholder,
|
|
150
|
+
onChange,
|
|
151
|
+
...props
|
|
152
|
+
}, ref) => /* @__PURE__ */ jsx("input", {
|
|
152
153
|
...props,
|
|
153
154
|
ref,
|
|
154
155
|
type: "search",
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
// src/components/typography/Typography.tsx
|
|
4
|
-
import React, {
|
|
5
|
-
forwardRef,
|
|
6
|
-
useEffect,
|
|
7
|
-
useMemo,
|
|
8
|
-
useRef,
|
|
9
|
-
useState
|
|
10
|
-
} from "react";
|
|
4
|
+
import React, { forwardRef, useEffect, useMemo, useRef, useState } from "react";
|
|
11
5
|
|
|
12
6
|
// ../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
13
7
|
function r(e) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const version = "0.2.1";
|
package/dist/index.d.ts
CHANGED
|
@@ -39,7 +39,6 @@ export * from "./components/dm-infinite-scroll";
|
|
|
39
39
|
export * from "./components/dm-page-header";
|
|
40
40
|
export * from "./components/dm-pagination";
|
|
41
41
|
export * from "./components/dm-pro-table";
|
|
42
|
-
export * from "./components/dm-pro-table-inner";
|
|
43
42
|
export * from "./components/dm-provider";
|
|
44
43
|
export * from "./components/dm-query";
|
|
45
44
|
export * from "./components/dm-search";
|