@fibrae/semi-ui-svelte 0.6.0 → 0.7.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/dist/components/auto-complete/auto-complete.svelte +12 -21
- package/dist/components/auto-complete/interface.d.ts +3 -2
- package/dist/components/badge/badge.svelte +4 -4
- package/dist/components/badge/interface.d.ts +4 -3
- package/dist/components/button/button.svelte +3 -2
- package/dist/components/button/interface.d.ts +4 -2
- package/dist/components/card/card.svelte +9 -10
- package/dist/components/card/interface.d.ts +4 -4
- package/dist/components/cascader/cascader.svelte +11 -18
- package/dist/components/cascader/interface.d.ts +3 -2
- package/dist/components/cascader/item.svelte +1 -1
- package/dist/components/color-picker/color-picker.svelte +16 -1
- package/dist/components/cropper/cropper.svelte +4 -4
- package/dist/components/cropper/interface.d.ts +4 -3
- package/dist/components/date-picker/date-input.svelte +3 -1
- package/dist/components/date-picker/date-picker.svelte +9 -10
- package/dist/components/date-picker/interface.d.ts +5 -4
- package/dist/components/date-picker/internal.d.ts +2 -0
- package/dist/components/descriptions/descriptions.svelte +2 -2
- package/dist/components/descriptions/interface.d.ts +4 -2
- package/dist/components/dropdown/dropdown-popup.svelte +2 -1
- package/dist/components/dropdown/dropdown-popup.svelte.d.ts +2 -1
- package/dist/components/dropdown/dropdown.svelte +4 -5
- package/dist/components/dropdown/interface.d.ts +6 -4
- package/dist/components/empty/empty.svelte +2 -2
- package/dist/components/empty/interface.d.ts +4 -3
- package/dist/components/feedback/feedback.svelte +6 -0
- package/dist/components/feedback/interface.d.ts +5 -0
- package/dist/components/highlight/highlight.svelte +6 -7
- package/dist/components/highlight/interface.d.ts +4 -3
- package/dist/components/icon-button/icon-button.svelte +4 -3
- package/dist/components/image/image.svelte +4 -4
- package/dist/components/image/interface.d.ts +6 -5
- package/dist/components/image/preview/preview-image.svelte +1 -1
- package/dist/components/image/preview/preview-inner.svelte +10 -18
- package/dist/components/image/preview/preview.svelte +4 -4
- package/dist/components/input/input.svelte +4 -2
- package/dist/components/input/interface.d.ts +6 -5
- package/dist/components/input/textarea.svelte +6 -6
- package/dist/components/input-number/input-number.svelte +4 -2
- package/dist/components/input-number/interface.d.ts +5 -1
- package/dist/components/modal/interface.d.ts +5 -3
- package/dist/components/modal/modal-content.svelte +26 -32
- package/dist/components/modal/modal-content.svelte.d.ts +5 -4
- package/dist/components/modal/modal.svelte +4 -4
- package/dist/components/navigation/interface.d.ts +8 -4
- package/dist/components/navigation/nav-items.svelte +1 -1
- package/dist/components/navigation/nav.svelte +3 -2
- package/dist/components/navigation/sub-nav.svelte +5 -4
- package/dist/components/overflow-list/interface.d.ts +4 -3
- package/dist/components/overflow-list/overflow-list.svelte +3 -3
- package/dist/components/pagination/interface.d.ts +1 -1
- package/dist/components/pagination/pagination.svelte +63 -61
- package/dist/components/popconfirm/interface.d.ts +3 -0
- package/dist/components/popconfirm/popconfirm.svelte +4 -4
- package/dist/components/popover/arrow.svelte +2 -2
- package/dist/components/popover/interface.d.ts +8 -3
- package/dist/components/popover/popover.svelte +4 -4
- package/dist/components/radio/interface.d.ts +6 -5
- package/dist/components/radio/radio-group.svelte +2 -2
- package/dist/components/radio/radio.svelte +4 -4
- package/dist/components/select/interface.d.ts +3 -2
- package/dist/components/select/option.svelte +1 -1
- package/dist/components/select/select.svelte +9 -14
- package/dist/components/side-sheet/interface.d.ts +6 -5
- package/dist/components/side-sheet/side-sheet.svelte +31 -29
- package/dist/components/slider/interface.d.ts +4 -2
- package/dist/components/slider/slider.svelte +3 -2
- package/dist/components/spin/interface.d.ts +4 -3
- package/dist/components/spin/spin.svelte +2 -3
- package/dist/components/switch/switch.svelte +1 -1
- package/dist/components/table/context.d.ts +2 -1
- package/dist/components/table/interface.d.ts +4 -3
- package/dist/components/table/table-header/table-header-row.svelte +2 -1
- package/dist/components/table/table.svelte +7 -3
- package/dist/components/tabs/interface.d.ts +8 -7
- package/dist/components/tabs/tab-bar.svelte +12 -2
- package/dist/components/tabs/tabs.svelte +7 -8
- package/dist/components/time-picker/interface.d.ts +4 -4
- package/dist/components/time-picker/time-input.svelte +2 -2
- package/dist/components/time-picker/time-picker.svelte +10 -11
- package/dist/components/tooltip/interface.d.ts +5 -2
- package/dist/components/tooltip/tooltip.svelte +13 -38
- package/dist/components/tree/interface.d.ts +4 -3
- package/dist/components/tree/node-arrow.svelte +1 -1
- package/dist/components/tree/tree-node.svelte +1 -1
- package/dist/components/tree/tree.svelte +23 -74
- package/dist/components/tree-select/interface.d.ts +4 -5
- package/dist/components/tree-select/tree-select.svelte +28 -67
- package/dist/components/typography/base.svelte +1 -1
- package/dist/components/upload/file-card.svelte +1 -1
- package/dist/components/upload/interface.d.ts +5 -3
- package/dist/components/upload/upload.svelte +6 -4
- package/dist/components/user-guide/user-guide.svelte +15 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/use-overlay-resources.svelte.d.ts +13 -0
- package/dist/hooks/use-overlay-resources.svelte.js +20 -0
- package/dist/styles.css +1 -1
- package/package.json +3 -3
- package/dist/components/tree/use-tree-keyboard.svelte.d.ts +0 -29
- package/dist/components/tree/use-tree-keyboard.svelte.js +0 -61
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
let {
|
|
33
33
|
bordered = defaults('bordered', false),
|
|
34
34
|
childrenRecordName = defaults('childrenRecordName', 'children'),
|
|
35
|
+
classNames = defaults('classNames'),
|
|
35
36
|
clickGroupedRowToExpand = defaults('clickGroupedRowToExpand', false),
|
|
36
37
|
columns = defaults('columns'),
|
|
37
38
|
components = defaults('components'),
|
|
@@ -49,7 +50,6 @@
|
|
|
49
50
|
footer = defaults('footer'),
|
|
50
51
|
groupBy = defaults('groupBy'),
|
|
51
52
|
groupSectionColumn = defaults('groupSectionColumn'),
|
|
52
|
-
headerStyle = defaults('headerStyle'),
|
|
53
53
|
hideExpandedColumn = defaults('hideExpandedColumn', true),
|
|
54
54
|
indentSize = defaults('indentSize', 20),
|
|
55
55
|
keepDOM = defaults('keepDOM', false),
|
|
@@ -65,6 +65,7 @@
|
|
|
65
65
|
showHeader = defaults('showHeader', true),
|
|
66
66
|
size = defaults('size', 'default'),
|
|
67
67
|
sticky = defaults('sticky'),
|
|
68
|
+
styles = defaults('styles'),
|
|
68
69
|
title = defaults('title'),
|
|
69
70
|
virtualized = defaults('virtualized'),
|
|
70
71
|
onChange,
|
|
@@ -391,8 +392,11 @@
|
|
|
391
392
|
get headWidths() {
|
|
392
393
|
return view.headWidths ?? [];
|
|
393
394
|
},
|
|
394
|
-
get
|
|
395
|
-
return
|
|
395
|
+
get classNames() {
|
|
396
|
+
return classNames;
|
|
397
|
+
},
|
|
398
|
+
get styles() {
|
|
399
|
+
return styles;
|
|
396
400
|
},
|
|
397
401
|
get rowSpanHover() {
|
|
398
402
|
return rowSpanHover;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
|
-
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
+
import type { ClassValue, HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
import type { TabsPart } from '@fibrae/semi-foundation/components/tabs/constants';
|
|
3
4
|
import type { DropdownProps } from '../dropdown/index.js';
|
|
4
5
|
export type TabType = 'line' | 'card' | 'button' | 'slash';
|
|
5
6
|
export type TabSize = 'small' | 'medium' | 'large';
|
|
@@ -41,9 +42,11 @@ export interface TabBarProps {
|
|
|
41
42
|
showRestInDropdown: boolean;
|
|
42
43
|
more?: number | TabsMore;
|
|
43
44
|
arrowPosition: 'both' | 'start' | 'end';
|
|
44
|
-
|
|
45
|
+
/** Only `visibleTabs` is read: the scroll wrapper that holds the visible tabs */
|
|
46
|
+
classNames?: Partial<Record<'visibleTabs', ClassValue>>;
|
|
47
|
+
styles?: Partial<Record<'visibleTabs', string>>;
|
|
45
48
|
dropdownProps?: TabsDropdownProps;
|
|
46
|
-
class?:
|
|
49
|
+
class?: ClassValue;
|
|
47
50
|
style?: string;
|
|
48
51
|
}
|
|
49
52
|
export interface TabsTabBarSnippetProps {
|
|
@@ -64,7 +67,7 @@ export interface TabsProps extends Omit<HTMLAttributes<HTMLDivElement>, 'childre
|
|
|
64
67
|
activeKey?: string | null;
|
|
65
68
|
arrowPosition?: 'both' | 'start' | 'end';
|
|
66
69
|
collapsible?: boolean | 'auto';
|
|
67
|
-
|
|
70
|
+
classNames?: Partial<Record<TabsPart, ClassValue>>;
|
|
68
71
|
dropdownProps?: TabsDropdownProps;
|
|
69
72
|
keepDOM?: boolean;
|
|
70
73
|
lazyRender?: boolean;
|
|
@@ -72,13 +75,11 @@ export interface TabsProps extends Omit<HTMLAttributes<HTMLDivElement>, 'childre
|
|
|
72
75
|
preventScroll?: boolean;
|
|
73
76
|
showRestInDropdown?: boolean;
|
|
74
77
|
size?: TabSize;
|
|
75
|
-
|
|
76
|
-
tabBarStyle?: string;
|
|
78
|
+
styles?: Partial<Record<TabsPart, string>>;
|
|
77
79
|
tabList?: PlainTab[];
|
|
78
80
|
tabPaneMotion?: boolean;
|
|
79
81
|
tabPosition?: TabPosition;
|
|
80
82
|
type?: TabType;
|
|
81
|
-
visibleTabsStyle?: string;
|
|
82
83
|
onChange?: (activeKey: string) => void;
|
|
83
84
|
onTabClick?: (activeKey: string, event: MouseEvent | KeyboardEvent) => void;
|
|
84
85
|
onTabClose?: (tabKey: string) => void;
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
onVisibleTabsChange?: (visibleState: Map<string, boolean>) => void;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
let { activeKey, list, type, size, tabPosition, collapsible, showRestInDropdown, more, arrowPosition,
|
|
28
|
+
let { activeKey, list, type, size, tabPosition, collapsible, showRestInDropdown, more, arrowPosition, classNames, styles, dropdownProps, tablistAttrs, class: className, style, tab, icon, arrow, moreTrigger, moreContent, extra, onVisibleTabsChange }: Props = $props();
|
|
29
29
|
|
|
30
30
|
const ctx = requireTabsContext('TabBar');
|
|
31
31
|
const locale = useLocale('Tabs');
|
|
@@ -167,7 +167,17 @@
|
|
|
167
167
|
{style}
|
|
168
168
|
>
|
|
169
169
|
{#if collapsed}
|
|
170
|
-
<OverflowList
|
|
170
|
+
<OverflowList
|
|
171
|
+
class="{prefix}-overflow-list"
|
|
172
|
+
classNames={{ wrapper: classNames?.visibleTabs }}
|
|
173
|
+
itemKey="key"
|
|
174
|
+
items={overflowItems}
|
|
175
|
+
onVisibleStateChange={foundation.handleVisibleStateChange}
|
|
176
|
+
overflowRenderDirection={arrowPosition}
|
|
177
|
+
renderMode="scroll"
|
|
178
|
+
styles={{ wrapper: styles?.visibleTabs }}
|
|
179
|
+
wrapperProps={tablistProps}
|
|
180
|
+
>
|
|
171
181
|
{#snippet item({ item: overflowItem, index })}
|
|
172
182
|
{@render tabItem(list[index] ?? overflowItem, index)}
|
|
173
183
|
{/snippet}
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
activeKey = $bindable(),
|
|
24
24
|
arrowPosition = defaults('arrowPosition', 'both'),
|
|
25
25
|
collapsible = defaults('collapsible', false),
|
|
26
|
-
|
|
26
|
+
classNames = defaults('classNames'),
|
|
27
27
|
dropdownProps = defaults('dropdownProps'),
|
|
28
28
|
keepDOM = defaults('keepDOM', true),
|
|
29
29
|
lazyRender = defaults('lazyRender', false),
|
|
@@ -31,13 +31,11 @@
|
|
|
31
31
|
preventScroll = defaults('preventScroll'),
|
|
32
32
|
showRestInDropdown = defaults('showRestInDropdown', true),
|
|
33
33
|
size = defaults('size', 'large'),
|
|
34
|
-
|
|
35
|
-
tabBarStyle = defaults('tabBarStyle'),
|
|
34
|
+
styles = defaults('styles'),
|
|
36
35
|
tabList = defaults('tabList', []),
|
|
37
36
|
tabPaneMotion = defaults('tabPaneMotion', true),
|
|
38
37
|
tabPosition = defaults('tabPosition', 'top'),
|
|
39
38
|
type = defaults('type', 'line'),
|
|
40
|
-
visibleTabsStyle = defaults('visibleTabsStyle'),
|
|
41
39
|
onChange,
|
|
42
40
|
onTabClick,
|
|
43
41
|
onTabClose,
|
|
@@ -136,10 +134,11 @@
|
|
|
136
134
|
showRestInDropdown,
|
|
137
135
|
more,
|
|
138
136
|
arrowPosition,
|
|
139
|
-
|
|
137
|
+
classNames: { visibleTabs: classNames?.visibleTabs },
|
|
138
|
+
styles: { visibleTabs: styles?.visibleTabs },
|
|
140
139
|
dropdownProps,
|
|
141
|
-
class:
|
|
142
|
-
style:
|
|
140
|
+
class: classNames?.tabBar,
|
|
141
|
+
style: styles?.tabBar,
|
|
143
142
|
});
|
|
144
143
|
|
|
145
144
|
// Without `panel` the content area is the single panel; without a matching tab it has nothing to be labelled by
|
|
@@ -178,7 +177,7 @@
|
|
|
178
177
|
{:else}
|
|
179
178
|
{@render defaultBar()}
|
|
180
179
|
{/if}
|
|
181
|
-
<div {...contentPanelAttrs} class={[cssClasses.TABS_CONTENT, `${cssClasses.TABS_CONTENT}-${tabPosition}
|
|
180
|
+
<div {...contentPanelAttrs} class={[cssClasses.TABS_CONTENT, `${cssClasses.TABS_CONTENT}-${tabPosition}`, classNames?.content]} style={styles?.content}>
|
|
182
181
|
{#if panel}
|
|
183
182
|
{#each tabList as item, index (item.itemKey)}
|
|
184
183
|
{#if keepDOM || item.itemKey === current}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
2
|
import type { ClassValue, HTMLInputAttributes } from 'svelte/elements';
|
|
3
3
|
import type { TimeStamp } from '@fibrae/semi-foundation/components/time-picker/combobox-options';
|
|
4
|
-
import type { PanelType } from '@fibrae/semi-foundation/components/time-picker/constants';
|
|
4
|
+
import type { PanelType, TimePickerPart } from '@fibrae/semi-foundation/components/time-picker/constants';
|
|
5
5
|
import type { DisabledTimeFns } from '@fibrae/semi-foundation/components/time-picker/foundation';
|
|
6
6
|
import type { InputProps, InputSize, ValidateStatus } from '../input/index.js';
|
|
7
7
|
import type { ScrollItemProps } from '../scroll-list/index.js';
|
|
@@ -49,7 +49,9 @@ export interface TimePickerProps extends Omit<HTMLInputAttributes, NativeInputKe
|
|
|
49
49
|
inputReadOnly?: boolean;
|
|
50
50
|
validateStatus?: ValidateStatus;
|
|
51
51
|
insetLabelId?: string;
|
|
52
|
-
|
|
52
|
+
/** `dropdown` is the panel card; `input` is the Input's root element */
|
|
53
|
+
classNames?: Partial<Record<TimePickerPart, ClassValue>>;
|
|
54
|
+
styles?: Partial<Record<TimePickerPart, string>>;
|
|
53
55
|
autofocus?: boolean;
|
|
54
56
|
/** Focuses and selects the input once mounted */
|
|
55
57
|
focusOnOpen?: boolean;
|
|
@@ -57,8 +59,6 @@ export interface TimePickerProps extends Omit<HTMLInputAttributes, NativeInputKe
|
|
|
57
59
|
motion?: boolean;
|
|
58
60
|
autoAdjustOverflow?: boolean;
|
|
59
61
|
position?: Position;
|
|
60
|
-
popupClassName?: ClassValue;
|
|
61
|
-
popupStyle?: string;
|
|
62
62
|
stopPropagation?: boolean;
|
|
63
63
|
/** Falls back to ConfigProvider's timeZone */
|
|
64
64
|
timeZone?: string | number;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
type Foundation = TimeInputFoundation<TimeInputProps, FocusEvent>;
|
|
10
10
|
type Adapter = TimeInputAdapter<TimeInputProps, FocusEvent>;
|
|
11
11
|
|
|
12
|
-
let { value, inputReadOnly = false, invalid = false, validateStatus, focusOnOpen = false, preventScroll, onChange, onFocus, onBlur, ...rest }: TimeInputProps = $props();
|
|
12
|
+
let { class: className, value, inputReadOnly = false, invalid = false, validateStatus, focusOnOpen = false, preventScroll, onChange, onFocus, onBlur, ...rest }: TimeInputProps = $props();
|
|
13
13
|
|
|
14
14
|
let input = $state<Input>();
|
|
15
15
|
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
bind:this={input}
|
|
45
45
|
{...rest}
|
|
46
46
|
bind:value={() => value, (next) => foundation.handleChange(String(next ?? ''))}
|
|
47
|
-
class={[`${prefix}-input`, { [`${prefix}-input-invalid`]: invalid, [`${prefix}-input-readonly`]: inputReadOnly }]}
|
|
47
|
+
class={[`${prefix}-input`, { [`${prefix}-input-invalid`]: invalid, [`${prefix}-input-readonly`]: inputReadOnly }, className]}
|
|
48
48
|
hideSuffix
|
|
49
49
|
onBlur={foundation.handleBlur}
|
|
50
50
|
onFocus={foundation.handleFocus}
|
|
@@ -52,15 +52,14 @@
|
|
|
52
52
|
inputReadOnly = defaults('inputReadOnly', false),
|
|
53
53
|
validateStatus = defaults('validateStatus'),
|
|
54
54
|
insetLabelId,
|
|
55
|
-
|
|
55
|
+
classNames = defaults('classNames'),
|
|
56
|
+
styles = defaults('styles'),
|
|
56
57
|
autofocus = defaults('autofocus', false),
|
|
57
58
|
focusOnOpen = defaults('focusOnOpen', false),
|
|
58
59
|
preventScroll = defaults('preventScroll'),
|
|
59
60
|
motion = defaults('motion', true),
|
|
60
61
|
autoAdjustOverflow = defaults('autoAdjustOverflow', true),
|
|
61
62
|
position = defaults('position'),
|
|
62
|
-
popupClassName = defaults('popupClassName'),
|
|
63
|
-
popupStyle = defaults('popupStyle'),
|
|
64
63
|
stopPropagation = defaults('stopPropagation', true),
|
|
65
64
|
// read below: ConfigProvider's timeZone comes before the global default
|
|
66
65
|
timeZone,
|
|
@@ -178,7 +177,7 @@
|
|
|
178
177
|
|
|
179
178
|
// class and style size the root; every other attribute names and identifies the input
|
|
180
179
|
const attrs = $derived(trigger ? { root: rest as Record<string, unknown>, control: {} } : splitControlAttrs(rest, (key) => key !== 'class' && key !== 'style'));
|
|
181
|
-
const panelClass = $derived([...TimePickerFoundation.getPanelClassNames({ prefixCls, format, use12Hours, type }), `${prefixCls}-panel-${size}`,
|
|
180
|
+
const panelClass = $derived([...TimePickerFoundation.getPanelClassNames({ prefixCls, format, use12Hours, type }), `${prefixCls}-panel-${size}`, classNames?.dropdown]);
|
|
182
181
|
|
|
183
182
|
const triggerProps: TimePickerTriggerRenderProps = $derived({
|
|
184
183
|
value: states().value,
|
|
@@ -208,15 +207,12 @@
|
|
|
208
207
|
inputReadOnly,
|
|
209
208
|
validateStatus,
|
|
210
209
|
insetLabelId,
|
|
211
|
-
inputStyle,
|
|
212
210
|
autofocus,
|
|
213
211
|
focusOnOpen,
|
|
214
212
|
preventScroll,
|
|
215
213
|
motion,
|
|
216
214
|
autoAdjustOverflow,
|
|
217
215
|
position,
|
|
218
|
-
popupClassName,
|
|
219
|
-
popupStyle,
|
|
220
216
|
stopPropagation,
|
|
221
217
|
timeZone,
|
|
222
218
|
scrollItemProps,
|
|
@@ -264,6 +260,8 @@
|
|
|
264
260
|
}
|
|
265
261
|
</script>
|
|
266
262
|
|
|
263
|
+
<svelte:document onfocusin={(event) => foundation.handleDocumentFocusIn(event, root)} />
|
|
264
|
+
|
|
267
265
|
{#snippet content()}
|
|
268
266
|
<div bind:this={panelElement} class={{ [cssClasses.RANGE_PANEL_LISTS]: isRange }} id={panelId}>
|
|
269
267
|
{#each isRange ? [0, 1] : [0] as index (index)}
|
|
@@ -292,14 +290,14 @@
|
|
|
292
290
|
{/snippet}
|
|
293
291
|
|
|
294
292
|
<div bind:this={root} {...attrs.root} class={[prefixCls, rest.class]} role={trigger && (rest['aria-label'] || rest['aria-labelledby']) ? 'group' : undefined} onclick={handleRootClick}>
|
|
295
|
-
<Popover aria-label={locale().locale.panel[type]} {autoAdjustOverflow} {content}
|
|
293
|
+
<Popover aria-label={locale().locale.panel[type]} {autoAdjustOverflow} classNames={{ content: panelClass }} {content} {motion} onEscKeyDown={foundation.handleEscKeyDown} position={popupPosition} {stopPropagation} styles={{ content: styles?.dropdown }} trigger="custom" visible={shown}>
|
|
296
294
|
{#snippet child({ props })}
|
|
297
295
|
{#if trigger}
|
|
298
296
|
<!-- the wrapper is the Tab stop and the button only while the trigger has no focus target of its own -->
|
|
299
297
|
<div
|
|
300
298
|
bind:this={triggerWrapper}
|
|
301
299
|
{...props}
|
|
302
|
-
aria-controls={isTriggerButton ? panelId : undefined}
|
|
300
|
+
aria-controls={isTriggerButton && shown ? panelId : undefined}
|
|
303
301
|
aria-disabled={isTriggerButton ? disabled : undefined}
|
|
304
302
|
aria-expanded={isTriggerButton ? shown : undefined}
|
|
305
303
|
aria-haspopup={isTriggerButton ? 'dialog' : undefined}
|
|
@@ -314,11 +312,12 @@
|
|
|
314
312
|
<span {...props} class={`${prefixCls}-header`} tabindex="-1">
|
|
315
313
|
<TimeInput
|
|
316
314
|
{...attrs.control}
|
|
317
|
-
aria-controls={panelId}
|
|
315
|
+
aria-controls={shown ? panelId : undefined}
|
|
318
316
|
aria-expanded={shown}
|
|
319
317
|
aria-haspopup="dialog"
|
|
320
318
|
{autofocus}
|
|
321
319
|
{borderless}
|
|
320
|
+
class={classNames?.input}
|
|
322
321
|
{clearIcon}
|
|
323
322
|
{disabled}
|
|
324
323
|
{focusOnOpen}
|
|
@@ -335,7 +334,7 @@
|
|
|
335
334
|
role="combobox"
|
|
336
335
|
showClear={disabled ? false : showClear}
|
|
337
336
|
{size}
|
|
338
|
-
style={
|
|
337
|
+
style={styles?.input}
|
|
339
338
|
{validateStatus}
|
|
340
339
|
value={states().inputValue}
|
|
341
340
|
/>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
2
|
import type { Attachment } from 'svelte/attachments';
|
|
3
|
-
import type {
|
|
3
|
+
import type { ClassValue } from 'svelte/elements';
|
|
4
|
+
import type { strings, TooltipPart } from '@fibrae/semi-foundation/components/tooltip/constants';
|
|
4
5
|
import type { Position, TooltipBaseProps } from '@fibrae/semi-foundation/components/tooltip/foundation';
|
|
5
6
|
import type { POPUP_ID_ATTRIBUTE } from '@fibrae/semi-foundation/utils';
|
|
6
7
|
export type { Position } from '@fibrae/semi-foundation/components/tooltip/foundation';
|
|
@@ -52,7 +53,9 @@ export interface TooltipProps extends TooltipBaseProps {
|
|
|
52
53
|
'aria-describedby'?: string;
|
|
53
54
|
arrowPointAtCenter?: boolean;
|
|
54
55
|
stopPropagation?: boolean;
|
|
55
|
-
|
|
56
|
+
/** `wrapper` exists only when the trigger is wrapped: text, several nodes, or a disabled or loading trigger */
|
|
57
|
+
classNames?: Partial<Record<TooltipPart, ClassValue>>;
|
|
58
|
+
styles?: Partial<Record<TooltipPart, string>>;
|
|
56
59
|
wrapperId?: string;
|
|
57
60
|
/**
|
|
58
61
|
* Whether a disabled or loading Semi Button, Switch or Checkbox that fills the default span gets its pointer events
|
|
@@ -52,7 +52,8 @@
|
|
|
52
52
|
preventScroll = defaults('preventScroll'),
|
|
53
53
|
// an id shared by every Tooltip would break the popup's references, so the global default is not read
|
|
54
54
|
wrapperId,
|
|
55
|
-
|
|
55
|
+
classNames = defaults('classNames'),
|
|
56
|
+
styles = defaults('styles'),
|
|
56
57
|
wrapWhenSpecial = defaults('wrapWhenSpecial', true),
|
|
57
58
|
'aria-label': ariaLabel = defaults('aria-label'),
|
|
58
59
|
'aria-labelledby': ariaLabelledby = defaults('aria-labelledby'),
|
|
@@ -80,7 +81,6 @@
|
|
|
80
81
|
let focusableInside = $state(false);
|
|
81
82
|
let textOnly = $state(false);
|
|
82
83
|
let initialFocus: FocusTarget | undefined;
|
|
83
|
-
let clickOutside: AbortController | undefined;
|
|
84
84
|
let warnedFocusable = false;
|
|
85
85
|
|
|
86
86
|
// The value this Tooltip last wrote to an uncontrolled `visible`: the foundation still sees it as uncontrolled, so
|
|
@@ -177,20 +177,6 @@
|
|
|
177
177
|
removePortal: () => {
|
|
178
178
|
contentShown = false;
|
|
179
179
|
},
|
|
180
|
-
showPopover: () => {
|
|
181
|
-
if (!container?.matches(':popover-open')) {
|
|
182
|
-
container?.showPopover();
|
|
183
|
-
}
|
|
184
|
-
},
|
|
185
|
-
hidePopover: () => container?.hidePopover(),
|
|
186
|
-
// shortcut: a leave set by a prop reaction (handlePropsChange runs in a host effect created before the
|
|
187
|
-
// phase effect) reaches syncPopup before the template drops the show class, so the animations are read
|
|
188
|
-
// after tick(). Read them at once again when the host runs prop reactions after the component's effects.
|
|
189
|
-
waitAnimations: () =>
|
|
190
|
-
tick().then(() => {
|
|
191
|
-
const animations = container?.getAnimations() ?? [];
|
|
192
|
-
return animations.length ? Promise.allSettled(animations.map((animation) => animation.finished)) : undefined;
|
|
193
|
-
}),
|
|
194
180
|
notifyAfterOpen: () => afterOpen?.(),
|
|
195
181
|
notifyAfterClose: () => afterClose?.(),
|
|
196
182
|
notifyVisibleChange: (next) => {
|
|
@@ -203,17 +189,9 @@
|
|
|
203
189
|
selfWritten = uncontrolled && visible === next ? next : undefined;
|
|
204
190
|
onVisibleChange?.(next);
|
|
205
191
|
},
|
|
206
|
-
registerClickOutsideHandler: (handler) => {
|
|
207
|
-
clickOutside?.abort();
|
|
208
|
-
clickOutside = new AbortController();
|
|
209
|
-
window.addEventListener('mousedown', handler, { signal: clickOutside.signal });
|
|
210
|
-
},
|
|
211
|
-
unregisterClickOutsideHandler: () => {
|
|
212
|
-
clickOutside?.abort();
|
|
213
|
-
clickOutside = undefined;
|
|
214
|
-
},
|
|
215
192
|
isEventInTrigger: (event) => isEventInside(event, triggerElement),
|
|
216
|
-
|
|
193
|
+
getNestedPopups: () => nestedPopups(),
|
|
194
|
+
batch: (fn) => fn(),
|
|
217
195
|
notifyClickOutSide: (event) => onClickOutSide?.(event),
|
|
218
196
|
getPortalContainer: () => container,
|
|
219
197
|
getTriggerNode: () => triggerElement,
|
|
@@ -274,6 +252,9 @@
|
|
|
274
252
|
// A loading Button keeps the description itself, as do components that route aria-describedby to their own control
|
|
275
253
|
const describes = $derived(status === strings.STATUS_LOADING || Boolean(triggerState?.describes));
|
|
276
254
|
const blockTrigger = $derived(Boolean(triggerState?.block || (inner && isBlockDisplay(inner.style.display))));
|
|
255
|
+
|
|
256
|
+
// one string rather than style: directives, which would beat the caller's styles.wrapper
|
|
257
|
+
const wrapperStyle = $derived([status === strings.STATUS_DISABLED && wrapsSpecial && 'cursor: not-allowed', !textOnly && 'display: inline-block', blockTrigger && 'width: 100%', styles?.wrapper].filter(Boolean).join('; ') || undefined);
|
|
277
258
|
const spanTabindex = $derived(focusableInside || status === strings.STATUS_LOADING ? -1 : 0);
|
|
278
259
|
|
|
279
260
|
// Popover and Dropdown hand their class prefix to this Tooltip only, not to Tooltips rendered in its trigger or content
|
|
@@ -434,8 +415,11 @@
|
|
|
434
415
|
$effect(() => {
|
|
435
416
|
void phase;
|
|
436
417
|
void container;
|
|
437
|
-
// only the phase and the popup element drive it; what the sync reads (layout, props) must not
|
|
438
|
-
|
|
418
|
+
// only the phase and the popup element drive it; what the sync reads (layout, props) must not.
|
|
419
|
+
// shortcut: a leave set by a prop reaction (handlePropsChange runs in a host effect created before this one)
|
|
420
|
+
// reaches the sync before the template drops the show class, so the animations are read after tick(). Read
|
|
421
|
+
// them at once again when the host runs prop reactions after the component's effects.
|
|
422
|
+
untrack(() => foundation.syncPopup(tick()));
|
|
439
423
|
});
|
|
440
424
|
|
|
441
425
|
// showPopover() ran its autofocus step before the content mounted; syncPopup measured the popup without its
|
|
@@ -504,16 +488,7 @@
|
|
|
504
488
|
{#if child}
|
|
505
489
|
{@render child({ props: triggerProps })}
|
|
506
490
|
{:else}
|
|
507
|
-
<span
|
|
508
|
-
{@attach attachTrigger}
|
|
509
|
-
{...{ [POPUP_ID_ATTRIBUTE]: popupId }}
|
|
510
|
-
aria-describedby={describes ? undefined : describedBy}
|
|
511
|
-
class={[`${cssClasses.PREFIX}-trigger-wrapper`, wrapperClassName]}
|
|
512
|
-
style:cursor={status === strings.STATUS_DISABLED && wrapsSpecial ? 'not-allowed' : undefined}
|
|
513
|
-
style:display={textOnly ? undefined : 'inline-block'}
|
|
514
|
-
style:width={blockTrigger ? '100%' : undefined}
|
|
515
|
-
tabindex={spanTabindex}
|
|
516
|
-
>
|
|
491
|
+
<span {@attach attachTrigger} {...{ [POPUP_ID_ATTRIBUTE]: popupId }} aria-describedby={describes ? undefined : describedBy} class={[`${cssClasses.PREFIX}-trigger-wrapper`, classNames?.wrapper]} style={wrapperStyle} tabindex={spanTabindex}>
|
|
517
492
|
{@render children?.()}
|
|
518
493
|
</span>
|
|
519
494
|
{/if}{#if portalTarget}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
|
-
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
+
import type { ClassValue, HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
import type { TreePart } from '@fibrae/semi-foundation/components/tree/constants';
|
|
3
4
|
import type { BasicExpandedOtherProps, BasicFlattenNode, BasicOnDragProps, BasicTreeNodeData, BasicTreeNodeProps, CheckRelation, ExpandAction, KeyMapProps, ScrollAlign, TreeDataSimpleJson, TreeMotionType, Virtualize } from '@fibrae/semi-foundation/components/tree/foundation';
|
|
4
5
|
export type { TreeDataSimpleJson } from '@fibrae/semi-foundation/components/tree/foundation';
|
|
5
6
|
export type TreeKeyMapProps = KeyMapProps;
|
|
@@ -129,9 +130,9 @@ export interface TreeProps extends Omit<HTMLAttributes<HTMLDivElement>, NativeKe
|
|
|
129
130
|
/** On by default for a virtualized tree */
|
|
130
131
|
labelEllipsis?: boolean;
|
|
131
132
|
virtualize?: TreeVirtualize;
|
|
132
|
-
|
|
133
|
+
classNames?: Partial<Record<TreePart, ClassValue>>;
|
|
134
|
+
styles?: Partial<Record<TreePart, string>>;
|
|
133
135
|
searchPlaceholder?: string;
|
|
134
|
-
searchStyle?: string;
|
|
135
136
|
filterTreeNode?: boolean | ((inputValue: string, treeNodeString: string, data?: TreeNodeData) => boolean);
|
|
136
137
|
/** Loads a node's children; a node without `isLeaf` shows the expand arrow while it is set */
|
|
137
138
|
loadData?: (treeNode?: TreeNodeData) => Promise<void>;
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
|
|
26
26
|
<!-- the row carries aria-busy; the spinner's own name would join the row's name -->
|
|
27
27
|
{#if row.loading}
|
|
28
|
-
<Spin aria-hidden="true"
|
|
28
|
+
<Spin aria-hidden="true" class="{prefix}-spin-icon" />
|
|
29
29
|
{:else if !isLeaf}
|
|
30
30
|
{#if expandIcon}
|
|
31
31
|
{@render expandIcon({ onClick: onExpand, class: iconClass, expanded: Boolean(row.expanded) })}
|
|
@@ -206,7 +206,7 @@
|
|
|
206
206
|
{#if label}
|
|
207
207
|
{@render label({ item: row.data, label: row.label, searchWord: row.keyword })}
|
|
208
208
|
{:else if highlighted}
|
|
209
|
-
<Highlight
|
|
209
|
+
<Highlight classNames={{ highlight: `${prefix}-highlight` }} component="span" searchWords={[row.keyword]} sourceString={String(row.label)} />
|
|
210
210
|
{:else}
|
|
211
211
|
{row.label}
|
|
212
212
|
{/if}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { isEqual } from 'es-toolkit';
|
|
4
4
|
import { cssClasses } from '@fibrae/semi-foundation/components/tree/constants';
|
|
5
5
|
import TreeFoundation, { type BasicTreeInnerData, type BasicTreeNodeData, type BasicTreeProps, type TreeAdapter } from '@fibrae/semi-foundation/components/tree/foundation';
|
|
6
|
-
import { buildRowProps, getClearedSelection, nodeId } from '@fibrae/semi-foundation/components/tree/shared';
|
|
6
|
+
import { buildRowProps, getClearedSelection, handleTreeFocusIn, nodeId } from '@fibrae/semi-foundation/components/tree/shared';
|
|
7
7
|
import '@fibrae/semi-foundation/components/tree/tree.css';
|
|
8
8
|
import { IconSearch } from '@fibrae/semi-icons-svelte';
|
|
9
9
|
import { useDefaultProps, useFoundation } from '../../base/index.js';
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
import type { FlattenNode, TreeExpandedOtherProps, TreeNodeData, TreeProps, TreeRowProps, TreeScrollData, TreeValue } from './interface.js';
|
|
18
18
|
import NodeList from './node-list.svelte';
|
|
19
19
|
import TreeNode from './tree-node.svelte';
|
|
20
|
-
import useTreeKeyboard from './use-tree-keyboard.svelte.js';
|
|
21
20
|
|
|
22
21
|
type Foundation = TreeFoundation<MouseEvent>;
|
|
23
22
|
type Adapter = TreeAdapter<MouseEvent>;
|
|
@@ -56,9 +55,9 @@
|
|
|
56
55
|
treeNodeFilterProp = defaults('treeNodeFilterProp', 'label'),
|
|
57
56
|
labelEllipsis = defaults('labelEllipsis'),
|
|
58
57
|
virtualize = defaults('virtualize'),
|
|
59
|
-
|
|
58
|
+
classNames = defaults('classNames'),
|
|
60
59
|
searchPlaceholder = defaults('searchPlaceholder'),
|
|
61
|
-
|
|
60
|
+
styles = defaults('styles'),
|
|
62
61
|
filterTreeNode = defaults('filterTreeNode', false),
|
|
63
62
|
loadData = defaults('loadData'),
|
|
64
63
|
onChange,
|
|
@@ -232,33 +231,22 @@
|
|
|
232
231
|
nodeList?.scrollToItem(index, align);
|
|
233
232
|
}
|
|
234
233
|
}),
|
|
235
|
-
|
|
234
|
+
revealRow: (index, key) => {
|
|
235
|
+
if (!nodeList?.scrollToItem(index)) {
|
|
236
|
+
// inside the tree, not the document: a tree in a ShadowRoot is out of document.getElementById's reach
|
|
237
|
+
treeRoot?.querySelector(`#${CSS.escape(nodeId(treeId, key))}`)?.scrollIntoView({ block: 'nearest' });
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
}),
|
|
241
|
+
{ context: () => ({ direction: config.direction }) }
|
|
236
242
|
);
|
|
237
243
|
|
|
238
|
-
const keyboard = useTreeKeyboard({
|
|
239
|
-
rows: () => view.flattenNodes as FlattenNode[],
|
|
240
|
-
defaultIndex: () =>
|
|
241
|
-
Math.max(
|
|
242
|
-
view.flattenNodes.findIndex((node) => view.selectedKeys.includes(node.key!)),
|
|
243
|
-
0
|
|
244
|
-
),
|
|
245
|
-
rowProps: (node) => rowProps(node),
|
|
246
|
-
hasLoadData: () => Boolean(loadData),
|
|
247
|
-
rtl: () => config.direction === 'rtl',
|
|
248
|
-
select: foundation.handleNodeSelect,
|
|
249
|
-
expand: foundation.handleNodeExpand,
|
|
250
|
-
reveal: (index, key) => {
|
|
251
|
-
if (!nodeList?.scrollToItem(index)) {
|
|
252
|
-
// inside the tree, not the document: a tree in a ShadowRoot is out of document.getElementById's reach
|
|
253
|
-
treeRoot?.querySelector(`#${CSS.escape(nodeId(treeId, key))}`)?.scrollIntoView({ block: 'nearest' });
|
|
254
|
-
}
|
|
255
|
-
},
|
|
256
|
-
});
|
|
257
|
-
|
|
258
244
|
// State implied by new props renders with them; the pre-effect writes it back for the handlers before render
|
|
259
245
|
// not named `derived`: a local of that name turns the `$derived` rune into a store subscription
|
|
260
246
|
const implied = $derived(TreeFoundation.deriveState(foundationProps, states()));
|
|
261
247
|
const view = $derived<BasicTreeInnerData>(implied ? { ...states(), ...implied } : states());
|
|
248
|
+
const activeIndex = $derived(TreeFoundation.getActiveIndex(view));
|
|
249
|
+
const activeKey = $derived(view.flattenNodes[activeIndex]?.key);
|
|
262
250
|
|
|
263
251
|
const noData = $derived.by(() => {
|
|
264
252
|
const { keyEntities, inputValue, filteredKeys } = view;
|
|
@@ -294,26 +282,11 @@
|
|
|
294
282
|
get dropPosition() {
|
|
295
283
|
return view.dropPosition;
|
|
296
284
|
},
|
|
297
|
-
onNodeExpand:
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
keyboard.activate(row.key);
|
|
303
|
-
foundation.handleNodeSelect(event, row);
|
|
304
|
-
},
|
|
305
|
-
onNodeCheck: (event, row) => {
|
|
306
|
-
keyboard.activate(row.key);
|
|
307
|
-
foundation.handleNodeSelect(event, row);
|
|
308
|
-
},
|
|
309
|
-
onNodeRightClick: (event, row) => {
|
|
310
|
-
keyboard.activate(row.key);
|
|
311
|
-
foundation.handleNodeRightClick(event, row);
|
|
312
|
-
},
|
|
313
|
-
onNodeDoubleClick: (event, row) => {
|
|
314
|
-
keyboard.activate(row.key);
|
|
315
|
-
foundation.handleNodeDoubleClick(event, row);
|
|
316
|
-
},
|
|
285
|
+
onNodeExpand: foundation.handleNodeExpand,
|
|
286
|
+
onNodeSelect: foundation.handleNodeSelect,
|
|
287
|
+
onNodeCheck: foundation.handleNodeSelect,
|
|
288
|
+
onNodeRightClick: foundation.handleNodeRightClick,
|
|
289
|
+
onNodeDoubleClick: foundation.handleNodeDoubleClick,
|
|
317
290
|
onNodeDragStart: foundation.handleNodeDragStart,
|
|
318
291
|
onNodeDragEnter: foundation.handleNodeDragEnter,
|
|
319
292
|
onNodeDragOver: foundation.handleNodeDragOver,
|
|
@@ -338,31 +311,7 @@
|
|
|
338
311
|
|
|
339
312
|
const handleSearch = (input: string) => foundation.handleInputChange(input);
|
|
340
313
|
|
|
341
|
-
const
|
|
342
|
-
// a tabbable control inside a row handles its own keys
|
|
343
|
-
if (event.target !== event.currentTarget && event.target instanceof HTMLElement && event.target.tabIndex >= 0) {
|
|
344
|
-
return;
|
|
345
|
-
}
|
|
346
|
-
keyboard.handleKeyDown(event);
|
|
347
|
-
};
|
|
348
|
-
|
|
349
|
-
const handleTreeFocus = (event: FocusEvent & { currentTarget: HTMLElement }) => {
|
|
350
|
-
const tree = event.currentTarget;
|
|
351
|
-
const target = event.target;
|
|
352
|
-
if (target !== tree) {
|
|
353
|
-
// A click focuses the tabindex=-1 element it lands on (the virtual scroller, a row's checkbox); the tree takes
|
|
354
|
-
// focus back, so aria-activedescendant and the row's focus ring keep working.
|
|
355
|
-
if (target instanceof HTMLElement && target.tabIndex < 0) {
|
|
356
|
-
tree.focus({ preventScroll: true });
|
|
357
|
-
}
|
|
358
|
-
return;
|
|
359
|
-
}
|
|
360
|
-
// A virtual list may not have rendered the active descendant yet. Pointer focus is skipped: mousedown focuses the
|
|
361
|
-
// tree before click, and scrolling back to the stale active row would unmount the clicked row.
|
|
362
|
-
if (tree.matches(':focus-visible')) {
|
|
363
|
-
nodeList?.scrollToItem(keyboard.activeIndex);
|
|
364
|
-
}
|
|
365
|
-
};
|
|
314
|
+
const handleTreeFocus = (event: FocusEvent & { currentTarget: HTMLElement }) => handleTreeFocusIn(event, () => nodeList?.scrollToItem(activeIndex));
|
|
366
315
|
|
|
367
316
|
$effect.pre(() => {
|
|
368
317
|
if (implied) {
|
|
@@ -399,7 +348,7 @@
|
|
|
399
348
|
|
|
400
349
|
<div {...attrs.root} class={[`${prefixCls}-wrapper`, rest.class]}>
|
|
401
350
|
{#if filterTreeNode && searchBox !== false}
|
|
402
|
-
<div class={[`${prefixCls}-search-wrapper`,
|
|
351
|
+
<div class={[`${prefixCls}-search-wrapper`, classNames?.search]} style={styles?.search}>
|
|
403
352
|
{#if searchBox}
|
|
404
353
|
{@render searchBox({ class: `${prefixCls}-input`, value: view.inputValue, placeholder, showClear, onChange: handleSearch })}
|
|
405
354
|
{:else}
|
|
@@ -427,19 +376,19 @@
|
|
|
427
376
|
<ul
|
|
428
377
|
bind:this={treeRoot}
|
|
429
378
|
{...attrs.control}
|
|
430
|
-
aria-activedescendant={
|
|
379
|
+
aria-activedescendant={activeKey === undefined ? undefined : nodeId(treeId, activeKey)}
|
|
431
380
|
aria-multiselectable={multiple}
|
|
432
381
|
class={listClass}
|
|
433
382
|
role="tree"
|
|
434
383
|
tabindex={(attrs.control.tabindex as number | undefined) ?? 0}
|
|
435
384
|
onfocusin={handleTreeFocus}
|
|
436
|
-
onkeydown={
|
|
385
|
+
onkeydown={foundation.handleKeyDown}
|
|
437
386
|
>
|
|
438
387
|
<NodeList bind:this={nodeList} flattenList={view.cachedFlattenNodes} flattenNodes={view.flattenNodes} {motion} motionKeys={view.motionKeys} motionType={view.motionType} {virtualize}>
|
|
439
388
|
{#snippet children({ node, style })}
|
|
440
389
|
{@const row = rowProps(node)}
|
|
441
390
|
{#if row}
|
|
442
|
-
<TreeNode {expandIcon} focused={row.key ===
|
|
391
|
+
<TreeNode {expandIcon} focused={row.key === activeKey} {fullLabel} {icon} id={nodeId(treeId, row.key)} {label} {row} rowStyle={style} {showLine} />
|
|
443
392
|
{/if}
|
|
444
393
|
{/snippet}
|
|
445
394
|
</NodeList>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
|
-
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
+
import type { ClassValue, HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
import type { TreeSelectPart } from '@fibrae/semi-foundation/components/tree-select/constants';
|
|
3
4
|
import type { CheckRelation, ExpandAction } from '@fibrae/semi-foundation/components/tree/foundation';
|
|
4
5
|
import type { Size } from '@fibrae/semi-foundation/utils';
|
|
5
6
|
import type { ValidateStatus } from '../input/index.js';
|
|
@@ -122,11 +123,9 @@ export interface TreeSelectProps extends Omit<HTMLAttributes<HTMLDivElement>, Na
|
|
|
122
123
|
autoAdjustOverflow?: boolean;
|
|
123
124
|
position?: Position;
|
|
124
125
|
stopPropagation?: boolean | string;
|
|
125
|
-
|
|
126
|
-
|
|
126
|
+
classNames?: Partial<Record<TreeSelectPart, ClassValue>>;
|
|
127
|
+
styles?: Partial<Record<TreeSelectPart, string>>;
|
|
127
128
|
dropdownMatchSelectWidth?: boolean;
|
|
128
|
-
/** Goes on the `role="tree"` element */
|
|
129
|
-
optionListStyle?: string;
|
|
130
129
|
preventScroll?: boolean;
|
|
131
130
|
triggerTagWrap?: boolean;
|
|
132
131
|
/** With `onChangeWithObject` the value and the node are both the node */
|