Blame view

天文台pc/tianwentai-ui/node_modules/@mui/material/Tabs/Tabs.d.ts 9.69 KB
bc518174   王天杨   提交两个项目文件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
  import * as React from 'react';
  import { SxProps } from '@mui/system';
  import { OverridableStringUnion } from '@mui/types';
  import { CreateSlotsAndSlotProps, SlotProps } from "../utils/types.js";
  import { Theme } from "../styles/index.js";
  import TabScrollButton, { TabScrollButtonProps } from "../TabScrollButton/index.js";
  import { OverridableComponent, OverrideProps } from "../OverridableComponent/index.js";
  import { TabsClasses } from "./tabsClasses.js";
  import SvgIcon from "../SvgIcon/index.js";
  export interface TabsPropsIndicatorColorOverrides {}
  export interface TabsRootSlotPropsOverrides {}
  export interface TabsScrollerSlotPropsOverrides {}
  export interface TabsListSlotPropsOverrides {}
  export interface TabsScrollbarSlotPropsOverrides {}
  export interface TabsIndicatorSlotPropsOverrides {}
  export interface TabsScrollButtonsSlotPropsOverrides {}
  export interface TabsStartScrollButtonIconSlotPropsOverrides {}
  export interface TabsEndScrollButtonIconSlotPropsOverrides {}
  export interface TabsSlots {
    /**
     * The component used for the popper.
     * @default div
     */
    root: React.ElementType;
    /**
     * The component used for the scroller.
     * @default div
     */
    scroller: React.ElementType;
    /**
     * The component used for the flex container.
     * @default div
     */
    list: React.ElementType;
    /**
     * The component used for the scroller.
     * @default ScrollbarSize
     */
    scrollbar: React.ElementType;
    /**
     * The component used for the tab indicator.
     * @default span
     */
    indicator: React.ElementType;
    /**
     * The component used for the scroll button.
     * @default TabScrollButton
     */
    scrollButtons: React.ElementType;
    /**
     * The component used for the start scroll button icon.
     * @default KeyboardArrowLeft
     */
    startScrollButtonIcon: React.ElementType;
    /**
     * The component used for the end scroll button icon.
     * @default KeyboardArrowRight
     */
    endScrollButtonIcon: React.ElementType;
  }
  export type TabsSlotsAndSlotProps = CreateSlotsAndSlotProps<TabsSlots, {
    /**
     * Props forwarded to the root slot.
     * By default, the available props are based on the div element.
     */
    root: SlotProps<'div', TabsRootSlotPropsOverrides, TabsOwnerState>;
    /**
     * Props forwarded to the scroller slot.
     * By default, the available props are based on the div element.
     */
    scroller: SlotProps<'div', TabsScrollerSlotPropsOverrides, TabsOwnerState>;
    /**
     * Props forwarded to the list slot.
     * By default, the available props are based on the div element.
     */
    list: SlotProps<'div', TabsListSlotPropsOverrides, TabsOwnerState>;
    /**
     * Props forwarded to the scrollbar slot.
     * By default, the available props are based on the div element.
     */
    scrollbar: SlotProps<'div', {
      onChange?: (scrollbarWidth: undefined | number) => void;
    } & TabsScrollbarSlotPropsOverrides, TabsOwnerState>;
    /**
     * Props forwarded to the indicator slot.
     * By default, the available props are based on the span element.
     */
    indicator: SlotProps<'span', TabsIndicatorSlotPropsOverrides, TabsOwnerState>;
    /**
     * Props forwarded to the scrollButton slot.
     * By default, the available props are based on the [TabScrollButton](https://mui.com/material-ui/api/tab-scroll-button/#props) component.
     */
    scrollButtons: SlotProps<typeof TabScrollButton, TabsScrollButtonsSlotPropsOverrides, TabsOwnerState>;
    /**
     * Props forwarded to the startScrollButtonIcon slot.
     * By default, the available props are based on the [SvgIcon](https://mui.com/material-ui/api/svg-icon/#props) component.
     */
    startScrollButtonIcon: SlotProps<typeof SvgIcon, TabsStartScrollButtonIconSlotPropsOverrides, TabsOwnerState>;
    /**
     * Props forwarded to the endScrollButtonIcon slot.
     * By default, the available props are based on the [SvgIcon](https://mui.com/material-ui/api/svg-icon/#props) component.
     */
    endScrollButtonIcon: SlotProps<typeof SvgIcon, TabsEndScrollButtonIconSlotPropsOverrides, TabsOwnerState>;
  }> & {
    slots?: {
      /**
       * @deprecated Use `slots.startScrollButtonIcon` instead.
       */
      StartScrollButtonIcon?: React.ElementType;
      /**
       * @deprecated Use `slots.endScrollButtonIcon` instead.
       */
      EndScrollButtonIcon?: React.ElementType;
    };
  };
  export interface TabsOwnerState extends Omit<TabsProps, 'slots' | 'slotProps'> {
    vertical: boolean;
    fixed: boolean;
    hideScrollbar: boolean;
    scrollableX: boolean;
    scrollableY: boolean;
    centered: boolean;
    scrollButtonsHideMobile: boolean;
  }
  export interface TabsOwnProps extends TabsSlotsAndSlotProps {
    /**
     * Callback fired when the component mounts.
     * This is useful when you want to trigger an action programmatically.
     * It supports two actions: `updateIndicator()` and `updateScrollButtons()`
     *
     * @param {object} actions This object contains all possible actions
     * that can be triggered programmatically.
     */
    action?: React.Ref<TabsActions>;
    /**
     * If `true`, the scroll buttons aren't forced hidden on mobile.
     * By default the scroll buttons are hidden on mobile and takes precedence over `scrollButtons`.
     * @default false
     */
    allowScrollButtonsMobile?: boolean;
    /**
     * The label for the Tabs as a string.
     */
    'aria-label'?: string;
    /**
     * An id or list of ids separated by a space that label the Tabs.
     */
    'aria-labelledby'?: string;
    /**
     * If `true`, the tabs are centered.
     * This prop is intended for large views.
     * @default false
     */
    centered?: boolean;
    /**
     * The content of the component.
     */
    children?: React.ReactNode;
    /**
     * Override or extend the styles applied to the component.
     */
    classes?: Partial<TabsClasses>;
    /**
     * Determines the color of the indicator.
     * @default 'primary'
     */
    indicatorColor?: OverridableStringUnion<'secondary' | 'primary', TabsPropsIndicatorColorOverrides>;
    /**
     * Callback fired when the value changes.
     *
     * @param {React.SyntheticEvent} event The event source of the callback. **Warning**: This is a generic event not a change event.
     * @param {any} value We default to the index of the child (number)
     */
    onChange?: (event: React.SyntheticEvent, value: any) => void;
    /**
     * The component orientation (layout flow direction).
     * @default 'horizontal'
     */
    orientation?: 'horizontal' | 'vertical';
    /**
     * The component used to render the scroll buttons.
     * @deprecated use the `slots.scrollButtons` prop instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
     * @default TabScrollButton
     */
    ScrollButtonComponent?: React.ElementType;
    /**
     * Determine behavior of scroll buttons when tabs are set to scroll:
     *
     * - `auto` will only present them when not all the items are visible.
     * - `true` will always present them.
     * - `false` will never present them.
     *
     * By default the scroll buttons are hidden on mobile.
     * This behavior can be disabled with `allowScrollButtonsMobile`.
     * @default 'auto'
     */
    scrollButtons?: 'auto' | true | false;
    /**
     * If `true` the selected tab changes on focus. Otherwise it only
     * changes on activation.
     */
    selectionFollowsFocus?: boolean;
    /**
     * Props applied to the tab indicator element.
     * @deprecated use the `slotProps.indicator` prop instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
     * @default  {}
     */
    TabIndicatorProps?: React.HTMLAttributes<HTMLDivElement> & {
      sx?: SxProps<Theme>;
    };
    /**
     * Props applied to the [`TabScrollButton`](https://mui.com/material-ui/api/tab-scroll-button/) element.
     * @deprecated use the `slotProps.scrollButtons` prop instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
     * @default {}
     */
    TabScrollButtonProps?: Partial<TabScrollButtonProps>;
    /**
     * Determines the color of the `Tab`.
     * @default 'primary'
     */
    textColor?: 'secondary' | 'primary' | 'inherit';
    /**
     * The value of the currently selected `Tab`.
     * If you don't want any selected `Tab`, you can set this prop to `false`.
     */
    value?: any;
    /**
     *  Determines additional display behavior of the tabs:
     *
     *  - `scrollable` will invoke scrolling properties and allow for horizontally
     *  scrolling (or swiping) of the tab bar.
     *  - `fullWidth` will make the tabs grow to use all the available space,
     *  which should be used for small views, like on mobile.
     *  - `standard` will render the default state.
     * @default 'standard'
     */
    variant?: 'standard' | 'scrollable' | 'fullWidth';
    /**
     * If `true`, the scrollbar is visible. It can be useful when displaying
     * a long vertical list of tabs.
     * @default false
     */
    visibleScrollbar?: boolean;
    /**
     * The system prop that allows defining system overrides as well as additional CSS styles.
     */
    sx?: SxProps<Theme>;
  }
  export interface TabsTypeMap<AdditionalProps = {}, RootComponent extends React.ElementType = 'div'> {
    props: AdditionalProps & TabsOwnProps;
    defaultComponent: RootComponent;
  }
  
  /**
   *
   * Demos:
   *
   * - [Tabs](https://mui.com/material-ui/react-tabs/)
   *
   * API:
   *
   * - [Tabs API](https://mui.com/material-ui/api/tabs/)
   */
  declare const Tabs: OverridableComponent<TabsTypeMap>;
  export interface TabsActions {
    updateIndicator(): void;
    updateScrollButtons(): void;
  }
  export type TabsProps<RootComponent extends React.ElementType = TabsTypeMap['defaultComponent'], AdditionalProps = {}> = OverrideProps<TabsTypeMap<AdditionalProps, RootComponent>, RootComponent> & {
    component?: React.ElementType;
  };
  export default Tabs;