@baishuyun/ai-design 2.0.4 → 2.0.6
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/CHANGELOG.md +18 -0
- package/dist/ai-design.css +68 -0
- package/dist/ai-design.js +5928 -5874
- package/dist/ai-design.js.map +1 -1
- package/dist/ai-design.umd.cjs +55 -55
- package/dist/ai-design.umd.cjs.map +1 -1
- package/dist/src/components/bs-entry-select/bs-entry-select.d.ts.map +1 -1
- package/dist/src/components/bs-entry-select/build-tree.d.ts +2 -0
- package/dist/src/components/bs-entry-select/build-tree.d.ts.map +1 -1
- package/dist/src/components/bs-entry-select/index.d.ts +2 -1
- package/dist/src/components/bs-entry-select/index.d.ts.map +1 -1
- package/dist/src/components/bs-entry-select/scroll-slider.d.ts +3 -2
- package/dist/src/components/bs-entry-select/scroll-slider.d.ts.map +1 -1
- package/dist/src/components/bs-entry-select/types.d.ts +2 -0
- package/dist/src/components/bs-entry-select/types.d.ts.map +1 -1
- package/dist/src/index.d.ts +6 -6
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/stories/BsEntrySelect.stories.d.ts +2 -0
- package/dist/src/stories/BsEntrySelect.stories.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/components/bs-entry-select/bs-entry-select.tsx +7 -1
- package/src/components/bs-entry-select/index.ts +5 -1
- package/src/components/bs-entry-select/scroll-slider.tsx +62 -15
- package/src/components/bs-entry-select/types.ts +3 -0
- package/src/index.ts +5 -1
- package/src/stories/BsEntrySelect.stories.tsx +29 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bs-entry-select.d.ts","sourceRoot":"","sources":["../../../../src/components/bs-entry-select/bs-entry-select.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAG7E,YAAY,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,CAAC;AAE9D,eAAO,MAAM,aAAa,+
|
|
1
|
+
{"version":3,"file":"bs-entry-select.d.ts","sourceRoot":"","sources":["../../../../src/components/bs-entry-select/bs-entry-select.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAG7E,YAAY,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,CAAC;AAE9D,eAAO,MAAM,aAAa,+GAmQzB,CAAC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { IAppDetail, IEntryDetail } from '@baishuyun/types';
|
|
2
2
|
import { EntryTreeItem, BsEntrySelectChangeResult } from './types';
|
|
3
|
+
import { FormSelectItem } from '../agent-helper/form-select';
|
|
3
4
|
export declare const DEPTH_PADDING: Record<number, string>;
|
|
4
5
|
export declare function getDepthPadding(depth: number): string;
|
|
5
6
|
export declare function getEntryIconClass(entry: IEntryDetail): string;
|
|
6
7
|
export declare function buildEntryTreeFromAliasMap(appDetail: IAppDetail, searchQuery: string): EntryTreeItem[];
|
|
8
|
+
export declare const getEntries: (appDetail: IAppDetail) => FormSelectItem[];
|
|
7
9
|
export declare function filterTreeBySearch(nodes: EntryTreeItem[], searchQuery: string): EntryTreeItem[];
|
|
8
10
|
export declare function findSelected(appDetails: Record<string, IAppDetail>, entryId: string, currentAppId?: string): BsEntrySelectChangeResult | null;
|
|
9
11
|
//# sourceMappingURL=build-tree.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-tree.d.ts","sourceRoot":"","sources":["../../../../src/components/bs-entry-select/build-tree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAmB,YAAY,
|
|
1
|
+
{"version":3,"file":"build-tree.d.ts","sourceRoot":"","sources":["../../../../src/components/bs-entry-select/build-tree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAmB,YAAY,EAAa,MAAM,kBAAkB,CAAC;AAC7F,OAAO,KAAK,EAAE,aAAa,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAOhD,CAAC;AAEF,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAErD;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CAI7D;AAED,wBAAgB,0BAA0B,CACxC,SAAS,EAAE,UAAU,EACrB,WAAW,EAAE,MAAM,GAClB,aAAa,EAAE,CAuFjB;AA8CD,eAAO,MAAM,UAAU,GAAI,WAAW,UAAU,KAAG,cAAc,EAgBhE,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,aAAa,EAAE,EAAE,WAAW,EAAE,MAAM,GAAG,aAAa,EAAE,CAoB/F;AAED,wBAAgB,YAAY,CAC1B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,EACtC,OAAO,EAAE,MAAM,EACf,YAAY,CAAC,EAAE,MAAM,GACpB,yBAAyB,GAAG,IAAI,CAWlC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { BsEntrySelect } from './bs-entry-select';
|
|
2
|
-
export type { BsEntrySelectProps, BsEntrySelectChangeResult } from './types';
|
|
2
|
+
export type { BsEntrySelectProps, BsEntrySelectChangeResult, BsEntrySelectSliderVariant, } from './types';
|
|
3
|
+
export { buildEntryTreeFromAliasMap, getEntries } from './build-tree';
|
|
3
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/bs-entry-select/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/bs-entry-select/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,YAAY,EACV,kBAAkB,EAClB,yBAAyB,EACzB,0BAA0B,GAC3B,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,0BAA0B,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { IAppDetail } from '@baishuyun/types';
|
|
2
|
-
import { BsEntrySelectChangeResult } from './types';
|
|
3
|
-
export declare function ScrollSlider({ appDetails, currentAppId, selectedEntryId, onSelect, onOverflowChange, showCurrentAppEntriesOnly, }: {
|
|
2
|
+
import { BsEntrySelectChangeResult, BsEntrySelectSliderVariant } from './types';
|
|
3
|
+
export declare function ScrollSlider({ appDetails, currentAppId, selectedEntryId, onSelect, onOverflowChange, showCurrentAppEntriesOnly, variant, }: {
|
|
4
4
|
appDetails: Record<string, IAppDetail>;
|
|
5
5
|
currentAppId?: string;
|
|
6
6
|
selectedEntryId?: string;
|
|
7
7
|
onSelect: (result: BsEntrySelectChangeResult) => void;
|
|
8
8
|
onOverflowChange?: (hasOverflow: boolean) => void;
|
|
9
9
|
showCurrentAppEntriesOnly?: boolean;
|
|
10
|
+
variant?: BsEntrySelectSliderVariant;
|
|
10
11
|
}): import("react").JSX.Element | null;
|
|
11
12
|
//# sourceMappingURL=scroll-slider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scroll-slider.d.ts","sourceRoot":"","sources":["../../../../src/components/bs-entry-select/scroll-slider.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"scroll-slider.d.ts","sourceRoot":"","sources":["../../../../src/components/bs-entry-select/scroll-slider.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAEV,yBAAyB,EACzB,0BAA0B,EAC3B,MAAM,SAAS,CAAC;AAYjB,wBAAgB,YAAY,CAAC,EAC3B,UAAU,EACV,YAAY,EACZ,eAAe,EACf,QAAQ,EACR,gBAAgB,EAChB,yBAAiC,EACjC,OAAmB,GACpB,EAAE;IACD,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACvC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,CAAC,MAAM,EAAE,yBAAyB,KAAK,IAAI,CAAC;IACtD,gBAAgB,CAAC,EAAE,CAAC,WAAW,EAAE,OAAO,KAAK,IAAI,CAAC;IAClD,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,OAAO,CAAC,EAAE,0BAA0B,CAAC;CACtC,sCAucA"}
|
|
@@ -4,6 +4,7 @@ export interface BsEntrySelectChangeResult {
|
|
|
4
4
|
appId: string;
|
|
5
5
|
section: 'current' | 'other';
|
|
6
6
|
}
|
|
7
|
+
export type BsEntrySelectSliderVariant = 'default' | 'tabs';
|
|
7
8
|
export interface BsEntrySelectProps {
|
|
8
9
|
appDetails: Record<string, IAppDetail>;
|
|
9
10
|
currentAppId?: string;
|
|
@@ -15,6 +16,7 @@ export interface BsEntrySelectProps {
|
|
|
15
16
|
className?: string;
|
|
16
17
|
showSlider?: boolean;
|
|
17
18
|
showCurrentAppEntriesOnly?: boolean;
|
|
19
|
+
sliderVariant?: BsEntrySelectSliderVariant;
|
|
18
20
|
}
|
|
19
21
|
export interface EntryTreeItem {
|
|
20
22
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/bs-entry-select/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEjE,MAAM,WAAW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M,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,aAAa,CAAC,EAAE,0BAA0B,CAAC;CAC5C;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,OAAO,CAAC;IACtB,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;CAC5B"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -25,8 +25,8 @@ export { AttachmentPart } from './components/attachment-part';
|
|
|
25
25
|
export type { FilePart } from './components/attachment-part';
|
|
26
26
|
export { AttachmentsPreviewer } from './components/attachments-previewer';
|
|
27
27
|
export { BaseButton } from './components/base-button';
|
|
28
|
-
export { BsEntrySelect } from './components/bs-entry-select';
|
|
29
|
-
export type { BsEntrySelectProps, BsEntrySelectChangeResult } from './components/bs-entry-select';
|
|
28
|
+
export { BsEntrySelect, buildEntryTreeFromAliasMap, getEntries, } from './components/bs-entry-select';
|
|
29
|
+
export type { BsEntrySelectProps, BsEntrySelectChangeResult, BsEntrySelectSliderVariant, } from './components/bs-entry-select';
|
|
30
30
|
export { BorderAnimation } from './components/border-animation';
|
|
31
31
|
export { BorderColorAnimation } from './components/border-color-animation';
|
|
32
32
|
export { BotAvatarAndName } from './components/bot-avatar-name';
|
|
@@ -54,7 +54,7 @@ export { AgentSortSelect } from './components/agent-helper/agent-sort-select';
|
|
|
54
54
|
export type { AgentSortSelectProps, SortOrder } from './components/agent-helper/agent-sort-select';
|
|
55
55
|
export type { ITriggerSelectProps, TriggerCardConfig, } from './components/agent-helper/trigger-select';
|
|
56
56
|
export { FormSelect } from './components/agent-helper/form-select';
|
|
57
|
-
export { AppSelect, groupsToAppTreeNodes, ALL_APPS_VALUE } from './components/agent-helper/app-select';
|
|
57
|
+
export { AppSelect, groupsToAppTreeNodes, ALL_APPS_VALUE, } from './components/agent-helper/app-select';
|
|
58
58
|
export type { AppSelectProps } from './components/agent-helper/app-select';
|
|
59
59
|
export type { FormSelectProps, FormSelectItem, FormSelectChangeResult, } from './components/agent-helper/form-select';
|
|
60
60
|
export { FormActionTriggerSelect } from './components/agent-helper/form-action-trigger-select';
|
|
@@ -67,13 +67,13 @@ export { TriggerTimePreferenceSelect } from './components/agent-helper/trigger-t
|
|
|
67
67
|
export type { TriggerTimePreferenceSelectProps } from './components/agent-helper/trigger-time-preference-select';
|
|
68
68
|
export { OffsetPreferenceSelect } from './components/agent-helper/offset-preference-select';
|
|
69
69
|
export type { OffsetPreferenceSelectProps } from './components/agent-helper/offset-preference-select';
|
|
70
|
-
export { RepeatPreferenceTypeSelect, RepeatPreferenceTypeOptions } from './components/agent-helper/repeat-preference-type-select';
|
|
70
|
+
export { RepeatPreferenceTypeSelect, RepeatPreferenceTypeOptions, } from './components/agent-helper/repeat-preference-type-select';
|
|
71
71
|
export type { RepeatPreferenceTypeOption, RepeatPreferenceTypeSelectProps, } from './components/agent-helper/repeat-preference-type-select';
|
|
72
72
|
export { WeekdaysSelect, WeekdaysOptions } from './components/agent-helper/weekdays-select';
|
|
73
73
|
export type { WeekdaysOption, WeekdaysSelectProps, } from './components/agent-helper/weekdays-select';
|
|
74
74
|
export { MonthdaysSelect, MonthdaysOptions } from './components/agent-helper/monthdays-select';
|
|
75
75
|
export type { MonthdaysOption, MonthdaysSelectProps, } from './components/agent-helper/monthdays-select';
|
|
76
|
-
export { RepeatByTypeSelect, RepeatByTypeOptions } from './components/agent-helper/repeat-by-type-select';
|
|
76
|
+
export { RepeatByTypeSelect, RepeatByTypeOptions, } from './components/agent-helper/repeat-by-type-select';
|
|
77
77
|
export type { RepeatByTypeOption, RepeatByTypeSelectProps, } from './components/agent-helper/repeat-by-type-select';
|
|
78
78
|
export { RepeatPreferenceSelect } from './components/agent-helper/repeat-preference-select';
|
|
79
79
|
export type { RepeatPreferenceSelectProps } from './components/agent-helper/repeat-preference-select';
|
|
@@ -147,7 +147,7 @@ export { DataTable } from './components/agent-helper/table';
|
|
|
147
147
|
export * from './components/agent-helper/table';
|
|
148
148
|
export type { DataTableProps } from './components/agent-helper/table';
|
|
149
149
|
export { DatePicker, DateInput } from './components/agent-helper/date-picker';
|
|
150
|
-
export type { DatePickerProps, DateInputProps, DateFormat } from './components/agent-helper/date-picker';
|
|
150
|
+
export type { DatePickerProps, DateInputProps, DateFormat, } from './components/agent-helper/date-picker';
|
|
151
151
|
export { DateRangePicker } from './components/date-range-picker';
|
|
152
152
|
export type { DateRangePickerProps } from './components/date-range-picker';
|
|
153
153
|
export { ExecLogFilter } from './components/agent-helper/exec-log-filter';
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,mBAAmB,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAG5F,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAG/C,OAAO,EACL,QAAQ,EACR,SAAS,EACT,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,YAAY,CAAC;AAGpB,YAAY,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAGlE,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAGhE,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cA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C,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAC;AAC9E,YAAY,EACV,eAAe,EACf,cAAc,EACd,UAAU,GACX,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,YAAY,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAC1E,YAAY,EACV,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,2CAA2C,CAAC"}
|
|
@@ -15,4 +15,6 @@ export declare const ScrollOverflow: Story;
|
|
|
15
15
|
export declare const NoOverflow: Story;
|
|
16
16
|
export declare const OnlyCurrentApp: Story;
|
|
17
17
|
export declare const OnlyCurrentAppEntries: Story;
|
|
18
|
+
export declare const TabsVariant: Story;
|
|
19
|
+
export declare const TabsVariantOverflow: Story;
|
|
18
20
|
//# sourceMappingURL=BsEntrySelect.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BsEntrySelect.stories.d.ts","sourceRoot":"","sources":["../../../src/stories/BsEntrySelect.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AA0I9D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,aAAa,CAgBpC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAMrB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAO3B,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,KAYlB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAMzB,CAAC;AAEF,eAAO,MAAM,KAAK,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AC;AAEF,eAAO,MAAM,WAAW,EAAE,KAazB,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,KAYjC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@baishuyun/ai-design",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.6",
|
|
4
4
|
"description": "AI 功能 UI 组件库 - 所有 AI 功能的 UI 表现唯一真相来源",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
"tw-animate-css": "^1.4.0",
|
|
61
61
|
"vaul": "^1.1.2",
|
|
62
62
|
"zod": "^4.1.13",
|
|
63
|
-
"@baishuyun/
|
|
64
|
-
"@baishuyun/
|
|
63
|
+
"@baishuyun/ai-feat-utils": "2.0.6",
|
|
64
|
+
"@baishuyun/types": "3.0.6"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
67
|
"react": "^19.0.0",
|
|
@@ -83,9 +83,9 @@
|
|
|
83
83
|
"typescript": "^5.5.0",
|
|
84
84
|
"vite": "^5.1.4",
|
|
85
85
|
"vite-plugin-dts": "^4.5.4",
|
|
86
|
-
"@baishuyun/tailwind-config": "3.0.
|
|
87
|
-
"@baishuyun/
|
|
88
|
-
"@baishuyun/
|
|
86
|
+
"@baishuyun/tailwind-config": "3.0.6",
|
|
87
|
+
"@baishuyun/types": "3.0.6",
|
|
88
|
+
"@baishuyun/typescript-config": "2.0.6"
|
|
89
89
|
},
|
|
90
90
|
"keywords": [],
|
|
91
91
|
"author": "",
|
|
@@ -30,6 +30,7 @@ export const BsEntrySelect = forwardRef<HTMLDivElement, BsEntrySelectProps>(
|
|
|
30
30
|
className,
|
|
31
31
|
showSlider = true,
|
|
32
32
|
showCurrentAppEntriesOnly = false,
|
|
33
|
+
sliderVariant = 'default',
|
|
33
34
|
},
|
|
34
35
|
ref,
|
|
35
36
|
) => {
|
|
@@ -181,8 +182,12 @@ export const BsEntrySelect = forwardRef<HTMLDivElement, BsEntrySelectProps>(
|
|
|
181
182
|
|
|
182
183
|
const hasSearch = searchQuery.trim().length > 0;
|
|
183
184
|
|
|
185
|
+
const isTabMode = sliderVariant === 'tabs';
|
|
186
|
+
|
|
187
|
+
const tabCls = isTabMode ? "h-full" : ""
|
|
188
|
+
|
|
184
189
|
return (
|
|
185
|
-
<div ref={ref} className={cn('relative inline-flex items-center gap-[10px] min-w-0', className)}>
|
|
190
|
+
<div ref={ref} className={cn('relative inline-flex items-center gap-[10px] min-w-0', tabCls ,className)}>
|
|
186
191
|
{/* Scroll slider — greedy width */}
|
|
187
192
|
{showSlider && (
|
|
188
193
|
<ScrollSlider
|
|
@@ -192,6 +197,7 @@ export const BsEntrySelect = forwardRef<HTMLDivElement, BsEntrySelectProps>(
|
|
|
192
197
|
onSelect={handleSelect}
|
|
193
198
|
onOverflowChange={handleOverflowChange}
|
|
194
199
|
showCurrentAppEntriesOnly={showCurrentAppEntriesOnly}
|
|
200
|
+
variant={sliderVariant}
|
|
195
201
|
/>
|
|
196
202
|
)}
|
|
197
203
|
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
export { BsEntrySelect } from './bs-entry-select';
|
|
2
|
-
export type {
|
|
2
|
+
export type {
|
|
3
|
+
BsEntrySelectProps,
|
|
4
|
+
BsEntrySelectChangeResult,
|
|
5
|
+
BsEntrySelectSliderVariant,
|
|
6
|
+
} from './types';
|
|
3
7
|
export { buildEntryTreeFromAliasMap, getEntries } from './build-tree';
|
|
@@ -18,7 +18,12 @@ import {
|
|
|
18
18
|
import { SearchInput } from './search-input';
|
|
19
19
|
import { TreeItemNode } from './tree-item-node';
|
|
20
20
|
import type { IAppDetail } from '@baishuyun/types';
|
|
21
|
-
import type {
|
|
21
|
+
import type {
|
|
22
|
+
EntryTreeItem,
|
|
23
|
+
BsEntrySelectChangeResult,
|
|
24
|
+
BsEntrySelectSliderVariant,
|
|
25
|
+
} from './types';
|
|
26
|
+
import classNames from 'classnames';
|
|
22
27
|
|
|
23
28
|
const ChevronRightIcon = ({ size }: { size?: number }) => (
|
|
24
29
|
<SolidArrowDownIcon className="-rotate-90" size={size} />
|
|
@@ -37,6 +42,7 @@ export function ScrollSlider({
|
|
|
37
42
|
onSelect,
|
|
38
43
|
onOverflowChange,
|
|
39
44
|
showCurrentAppEntriesOnly = false,
|
|
45
|
+
variant = 'default',
|
|
40
46
|
}: {
|
|
41
47
|
appDetails: Record<string, IAppDetail>;
|
|
42
48
|
currentAppId?: string;
|
|
@@ -44,6 +50,7 @@ export function ScrollSlider({
|
|
|
44
50
|
onSelect: (result: BsEntrySelectChangeResult) => void;
|
|
45
51
|
onOverflowChange?: (hasOverflow: boolean) => void;
|
|
46
52
|
showCurrentAppEntriesOnly?: boolean;
|
|
53
|
+
variant?: BsEntrySelectSliderVariant;
|
|
47
54
|
}) {
|
|
48
55
|
const scrollRef = useRef<HTMLDivElement>(null);
|
|
49
56
|
const [canScrollLeft, setCanScrollLeft] = useState(false);
|
|
@@ -57,6 +64,8 @@ export function ScrollSlider({
|
|
|
57
64
|
const groupPillRefs = useRef<Map<string, HTMLButtonElement>>(new Map());
|
|
58
65
|
const [groupPortalContainer, setGroupPortalContainer] = useState<HTMLElement | null>(null);
|
|
59
66
|
|
|
67
|
+
const isTabs = variant === 'tabs';
|
|
68
|
+
|
|
60
69
|
// Build first-level nodes from all apps (no search filter)
|
|
61
70
|
const flatNodes = useMemo<FlatNode[]>(() => {
|
|
62
71
|
const appIds = Object.keys(appDetails);
|
|
@@ -287,13 +296,13 @@ export function ScrollSlider({
|
|
|
287
296
|
|
|
288
297
|
const hasGroupSearch = groupSearchQuery.trim().length > 0;
|
|
289
298
|
|
|
290
|
-
|
|
291
|
-
|
|
299
|
+
const sliderBody = (
|
|
300
|
+
<>
|
|
292
301
|
{/* Left arrow: always in DOM, width transition */}
|
|
293
302
|
<span
|
|
294
303
|
className={cn(
|
|
295
304
|
transCls,
|
|
296
|
-
'inline-flex overflow-hidden',
|
|
305
|
+
'inline-flex overflow-hidden items-center',
|
|
297
306
|
canScrollLeft ? 'w-[26px] opacity-100 mr-2.5' : 'w-0 opacity-0 mr-0',
|
|
298
307
|
)}
|
|
299
308
|
>
|
|
@@ -306,13 +315,19 @@ export function ScrollSlider({
|
|
|
306
315
|
|
|
307
316
|
<div
|
|
308
317
|
ref={scrollRef}
|
|
309
|
-
className=
|
|
318
|
+
className={cn(
|
|
319
|
+
'flex-1 overflow-x-auto scrollbar-hide flex min-w-0',
|
|
320
|
+
isTabs
|
|
321
|
+
? 'items-end gap-0 overflow-y-hidden border-b-[#e0e0e0] before:content-[""] before:absolute before:bottom-[0px] before:left-[-200px] before:right-0 before:h-[1px] before:w-[100vw] before:bg-[#e0e0e0] h-full'
|
|
322
|
+
: 'items-center gap-2.5',
|
|
323
|
+
)}
|
|
310
324
|
>
|
|
311
325
|
{flatNodes.map((flatNode) => {
|
|
312
326
|
const { node, appId, section } = flatNode;
|
|
313
327
|
const isLeaf = node.isSelectable;
|
|
314
328
|
const isSelected = isLeaf && selectedEntryId === node.id;
|
|
315
|
-
const isGroupActive = activeGroup?.node.id === node.id
|
|
329
|
+
const isGroupActive = activeGroup?.node.id === node.id
|
|
330
|
+
|| node?.children.findIndex(c => c.id === selectedEntryId) >= 0;
|
|
316
331
|
|
|
317
332
|
const setPillRef = (el: HTMLButtonElement | null) => {
|
|
318
333
|
if (el) {
|
|
@@ -335,11 +350,20 @@ export function ScrollSlider({
|
|
|
335
350
|
}}
|
|
336
351
|
className={cn(
|
|
337
352
|
'flex items-center gap-[6px] shrink-0 max-w-[240px]',
|
|
338
|
-
'px-[10px] py-[7px] rounded-[4px]',
|
|
339
353
|
transCls,
|
|
340
|
-
|
|
341
|
-
?
|
|
342
|
-
|
|
354
|
+
isTabs
|
|
355
|
+
? [
|
|
356
|
+
'px-[16px] py-[8px] relative z-10 border-b-none h-full',
|
|
357
|
+
isSelected
|
|
358
|
+
? 'border-r border-t border-l border-[#e0e0e0] bg-[#f6f7fa] text-[#0265FF] rounded-t-[10px] rounded-b-none '
|
|
359
|
+
: 'text-[#030303] hover:bg-[#F0F6FF] rounded-t-[8px]',
|
|
360
|
+
]
|
|
361
|
+
: [
|
|
362
|
+
'px-[10px] py-[7px] rounded-[4px]',
|
|
363
|
+
isSelected
|
|
364
|
+
? 'border border-[#F0F6FF] bg-[#F0F6FF] text-[#0265FF]'
|
|
365
|
+
: 'border border-[#E0E0E0] text-[#030303] hover:bg-[#F0F6FF]',
|
|
366
|
+
],
|
|
343
367
|
)}
|
|
344
368
|
>
|
|
345
369
|
<i
|
|
@@ -367,11 +391,20 @@ export function ScrollSlider({
|
|
|
367
391
|
onClick={(e) => openGroupPopover(flatNode, e)}
|
|
368
392
|
className={cn(
|
|
369
393
|
'flex items-center gap-[10px] shrink-0 max-w-[240px]',
|
|
370
|
-
'px-[10px] py-[7px] rounded-[4px]',
|
|
371
394
|
transCls,
|
|
372
|
-
|
|
373
|
-
?
|
|
374
|
-
|
|
395
|
+
isTabs
|
|
396
|
+
? [
|
|
397
|
+
'px-[16px] py-[8px] relative z-10 h-full',
|
|
398
|
+
isGroupActive
|
|
399
|
+
? 'border-r border-t border-l border-[#e0e0e0] bg-[#f6f7fa] text-[#0265FF] rounded-t-[10px] rounded-b-none '
|
|
400
|
+
: 'text-[#030303] hover:bg-[#F0F6FF] rounded-t-[8px]',
|
|
401
|
+
]
|
|
402
|
+
: [
|
|
403
|
+
'px-[10px] py-[7px] rounded-[4px]',
|
|
404
|
+
isGroupActive
|
|
405
|
+
? 'border border-[#0265FF] text-[#030303]'
|
|
406
|
+
: 'border border-[#E0E0E0] text-[#030303] hover:bg-[#F0F6FF]',
|
|
407
|
+
],
|
|
375
408
|
)}
|
|
376
409
|
>
|
|
377
410
|
<span className="flex items-center gap-[6px] min-w-0 flex-1">
|
|
@@ -401,7 +434,7 @@ export function ScrollSlider({
|
|
|
401
434
|
<span
|
|
402
435
|
className={cn(
|
|
403
436
|
transCls,
|
|
404
|
-
'inline-flex overflow-hidden',
|
|
437
|
+
'inline-flex overflow-hidden items-center',
|
|
405
438
|
canScrollRight ? 'w-[26px] opacity-100 ml-2.5' : 'w-0 opacity-0 ml-0',
|
|
406
439
|
)}
|
|
407
440
|
>
|
|
@@ -415,6 +448,20 @@ export function ScrollSlider({
|
|
|
415
448
|
onClick={() => scroll('right')}
|
|
416
449
|
/>
|
|
417
450
|
</span>
|
|
451
|
+
</>
|
|
452
|
+
);
|
|
453
|
+
|
|
454
|
+
const tabCls = isTabs ? 'h-full px-[10px] items-end' : "items-center"
|
|
455
|
+
|
|
456
|
+
return (
|
|
457
|
+
<div className={classNames("flex flex-1 min-w-0", tabCls)}>
|
|
458
|
+
{isTabs ? (
|
|
459
|
+
<div className="relative flex items-stretch flex-1 min-w-0 h-full">
|
|
460
|
+
{sliderBody}
|
|
461
|
+
</div>
|
|
462
|
+
) : (
|
|
463
|
+
sliderBody
|
|
464
|
+
)}
|
|
418
465
|
|
|
419
466
|
{/* Group subtree popover */}
|
|
420
467
|
{activeGroup &&
|
|
@@ -6,6 +6,8 @@ export interface BsEntrySelectChangeResult {
|
|
|
6
6
|
section: 'current' | 'other';
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
+
export type BsEntrySelectSliderVariant = 'default' | 'tabs';
|
|
10
|
+
|
|
9
11
|
export interface BsEntrySelectProps {
|
|
10
12
|
appDetails: Record<string, IAppDetail>;
|
|
11
13
|
currentAppId?: string;
|
|
@@ -17,6 +19,7 @@ export interface BsEntrySelectProps {
|
|
|
17
19
|
className?: string;
|
|
18
20
|
showSlider?: boolean;
|
|
19
21
|
showCurrentAppEntriesOnly?: boolean;
|
|
22
|
+
sliderVariant?: BsEntrySelectSliderVariant;
|
|
20
23
|
}
|
|
21
24
|
|
|
22
25
|
export interface EntryTreeItem {
|
package/src/index.ts
CHANGED
|
@@ -51,7 +51,11 @@ export {
|
|
|
51
51
|
buildEntryTreeFromAliasMap,
|
|
52
52
|
getEntries,
|
|
53
53
|
} from './components/bs-entry-select';
|
|
54
|
-
export type {
|
|
54
|
+
export type {
|
|
55
|
+
BsEntrySelectProps,
|
|
56
|
+
BsEntrySelectChangeResult,
|
|
57
|
+
BsEntrySelectSliderVariant,
|
|
58
|
+
} from './components/bs-entry-select';
|
|
55
59
|
export { BorderAnimation } from './components/border-animation';
|
|
56
60
|
export { BorderColorAnimation } from './components/border-color-animation';
|
|
57
61
|
export { BotAvatarAndName } from './components/bot-avatar-name';
|
|
@@ -312,3 +312,32 @@ export const OnlyCurrentAppEntries: Story = {
|
|
|
312
312
|
showCurrentAppEntriesOnly: true,
|
|
313
313
|
},
|
|
314
314
|
};
|
|
315
|
+
|
|
316
|
+
export const TabsVariant: Story = {
|
|
317
|
+
render: (args) => (
|
|
318
|
+
<div style={{ padding: 16, background: '#E6F4F1', borderRadius: 8 }}>
|
|
319
|
+
<BsEntrySelect {...args} />
|
|
320
|
+
</div>
|
|
321
|
+
),
|
|
322
|
+
args: {
|
|
323
|
+
appDetails: mockAppDetails,
|
|
324
|
+
currentAppId: 'app1',
|
|
325
|
+
placeholder: '请选择表单',
|
|
326
|
+
defaultValue: 'entry1',
|
|
327
|
+
sliderVariant: 'tabs',
|
|
328
|
+
},
|
|
329
|
+
};
|
|
330
|
+
|
|
331
|
+
export const TabsVariantOverflow: Story = {
|
|
332
|
+
render: (args) => (
|
|
333
|
+
<div style={{ maxWidth: 300, padding: 16, background: '#E6F4F1', borderRadius: 8 }}>
|
|
334
|
+
<BsEntrySelect {...args} />
|
|
335
|
+
</div>
|
|
336
|
+
),
|
|
337
|
+
args: {
|
|
338
|
+
appDetails: mockAppDetails,
|
|
339
|
+
currentAppId: 'app1',
|
|
340
|
+
placeholder: '请选择表单',
|
|
341
|
+
sliderVariant: 'tabs',
|
|
342
|
+
},
|
|
343
|
+
};
|