repo_name
stringlengths
5
122
path
stringlengths
3
232
text
stringlengths
6
1.05M
YaroShkvorets/ant-design-vue
components/vc-trigger/utils/alignUtil.ts
<reponame>YaroShkvorets/ant-design-vue import type { AlignType, BuildInPlacements, AlignPoint } from '../interface'; function isPointsEq(a1: AlignPoint[], a2: AlignPoint[], isAlignPoint: boolean): boolean { if (isAlignPoint) { return a1[0] === a2[0]; } return a1[0] === a2[0] && a1[1] === a2[1]; } export fun...
YaroShkvorets/ant-design-vue
components/locale/nb_NO.tsx
<gh_stars>1000+ /* eslint-disable no-template-curly-in-string */ import Pagination from '../vc-pagination/locale/nb_NO'; import DatePicker from '../date-picker/locale/nb_NO'; import TimePicker from '../time-picker/locale/nb_NO'; import Calendar from '../calendar/locale/nb_NO'; import type { Locale } from '../locale-pro...
YaroShkvorets/ant-design-vue
components/vc-picker/PickerPanel.tsx
<reponame>YaroShkvorets/ant-design-vue /** * Logic: * When `mode` === `picker`, * click will trigger `onSelect` (if value changed trigger `onChange` also). * Panel change will not trigger `onSelect` but trigger `onPanelChange` */ import type { SharedTimeProps } from './panels/TimePanel'; import TimePanel from '...
YaroShkvorets/ant-design-vue
components/descriptions/index.tsx
<filename>components/descriptions/index.tsx<gh_stars>1000+ import type { Ref, App, PropType, VNode, HTMLAttributes, ExtractPropTypes, Plugin, CSSProperties, InjectionKey, } from 'vue'; import { ref, defineComponent, onMounted, onBeforeUnmount, provide, toRef, computed } from 'vue'; import warning from...
YaroShkvorets/ant-design-vue
components/transfer/search.tsx
import PropTypes from '../_util/vue-types'; import initDefaultProps from '../_util/props-util/initDefaultProps'; import CloseCircleFilled from '@ant-design/icons-vue/CloseCircleFilled'; import SearchOutlined from '@ant-design/icons-vue/SearchOutlined'; import Input from '../input'; import type { ExtractPropTypes } from...
YaroShkvorets/ant-design-vue
components/date-picker/generatePicker/index.tsx
<filename>components/date-picker/generatePicker/index.tsx import type { GenerateConfig } from '../../vc-picker/generate'; import type { SharedTimeProps } from '../../vc-picker/panels/TimePanel'; import type { PickerMode } from '../../vc-picker/interface'; import PickerButton from '../PickerButton'; import PickerTag fro...
YaroShkvorets/ant-design-vue
components/slider/SliderTooltip.tsx
<filename>components/slider/SliderTooltip.tsx import { onBeforeUnmount, watch, onActivated, defineComponent, ref } from 'vue'; import Tooltip, { tooltipProps } from '../tooltip'; import raf from '../_util/raf'; export default defineComponent({ name: 'SliderTooltip', inheritAttrs: false, props: tooltipProps(), ...
YaroShkvorets/ant-design-vue
components/_util/reactivePick.ts
<filename>components/_util/reactivePick.ts<gh_stars>1000+ import type { UnwrapRef } from 'vue'; import { reactive, toRef } from 'vue'; /** * Reactively pick fields from a reactive object * * @see https://vueuse.js.org/reactivePick */ export function reactivePick<T extends object, K extends keyof T>( obj: T, .....
YaroShkvorets/ant-design-vue
components/tabs/src/hooks/useSyncState.ts
<gh_stars>1000+ import type { Ref } from 'vue'; import { ref } from 'vue'; type Updater<T> = (prev: T) => T; export default function useSyncState<T>( defaultState: T, onChange: (newValue: T, prevValue: T) => void, ): [Ref<T>, (updater: T | Updater<T>) => void] { const stateRef = ref(defaultState); function s...
YaroShkvorets/ant-design-vue
components/rate/util.ts
function getScroll(w: Window) { let ret = w.pageXOffset; const method = 'scrollLeft'; if (typeof ret !== 'number') { const d = w.document; // ie6,7,8 standard mode ret = d.documentElement[method]; if (typeof ret !== 'number') { // quirks mode ret = d.body[method]; } } return re...
YaroShkvorets/ant-design-vue
components/_util/__mocks__/Portal.tsx
import { defineComponent } from 'vue'; export default defineComponent({ name: 'Portal', inheritAttrs: false, props: ['getContainer'], setup(_props, { slots }) { return () => { return slots.default?.(); }; }, });
YaroShkvorets/ant-design-vue
components/vc-drawer/src/DrawerChild.tsx
import { defineComponent, reactive, onMounted, computed, onUnmounted, nextTick, watch, ref, } from 'vue'; import classnames from '../../_util/classNames'; import getScrollBarSize from '../../_util/getScrollBarSize'; import KeyCode from '../../_util/KeyCode'; import omit from '../../_util/omit'; import s...
YaroShkvorets/ant-design-vue
components/vc-tree-select/TreeNode.tsx
<filename>components/vc-tree-select/TreeNode.tsx /* istanbul ignore file */ import type { FunctionalComponent } from 'vue'; import type { DataNode, Key } from './interface'; export interface TreeNodeProps extends Omit<DataNode, 'children'> { value: Key; } /** This is a placeholder, not real render in dom */ const ...
YaroShkvorets/ant-design-vue
components/vc-trigger/Popup/index.tsx
<filename>components/vc-trigger/Popup/index.tsx import { defineComponent, ref, watch } from 'vue'; import { popupProps } from './interface'; import Mask from './Mask'; import MobilePopupInner from './MobilePopupInner'; import PopupInner from './PopupInner'; export default defineComponent({ name: 'Popup', inheritAt...
YaroShkvorets/ant-design-vue
components/transfer/operation.tsx
<filename>components/transfer/operation.tsx import type { CSSProperties, FunctionalComponent } from 'vue'; import LeftOutlined from '@ant-design/icons-vue/LeftOutlined'; import RightOutlined from '@ant-design/icons-vue/RightOutlined'; import Button from '../button'; import type { Direction } from '../config-provider'; ...
YaroShkvorets/ant-design-vue
components/vc-picker/hooks/useMergeProps.ts
<filename>components/vc-picker/hooks/useMergeProps.ts import type { HTMLAttributes } from 'vue'; import { useAttrs } from 'vue'; // 仅用在函数式组件中,不用考虑响应式问题 export default function useMergeProps<T>(props: T) { const attrs: HTMLAttributes = useAttrs(); return { ...props, ...attrs }; }
YaroShkvorets/ant-design-vue
components/vc-trigger/index.ts
<filename>components/vc-trigger/index.ts // based on rc-trigger 5.2.10 import Trigger from './Trigger'; export default Trigger;
YaroShkvorets/ant-design-vue
components/vc-mentions/index.ts
// base rc-mentions .6.2 import Mentions from './src/Mentions'; import Option from './src/Option'; Mentions.Option = Option; export { Option }; export default Mentions;
YaroShkvorets/ant-design-vue
components/menu/src/placements.ts
<reponame>YaroShkvorets/ant-design-vue<filename>components/menu/src/placements.ts const autoAdjustOverflow = { adjustX: 1, adjustY: 1, }; export const placements = { topLeft: { points: ['bl', 'tl'], overflow: autoAdjustOverflow, offset: [0, -7], }, bottomLeft: { points: ['tl', 'bl'], over...
YaroShkvorets/ant-design-vue
components/vc-picker/hooks/useValueTexts.ts
<reponame>YaroShkvorets/ant-design-vue import type { ComputedRef, Ref } from 'vue'; import { computed } from 'vue'; import useMemo from '../../_util/hooks/useMemo'; import shallowequal from '../../_util/shallowequal'; import type { GenerateConfig } from '../generate'; import type { CustomFormat, Locale } from '../inter...
YaroShkvorets/ant-design-vue
components/pagination/index.ts
import Pagination from './Pagination'; import { withInstall } from '../_util/type'; export { paginationProps, paginationConfig } from './Pagination'; export type { PaginationProps, PaginationConfig } from './Pagination'; export default withInstall(Pagination);
YaroShkvorets/ant-design-vue
components/vc-tree-select/hooks/useSelectValues.ts
<reponame>YaroShkvorets/ant-design-vue<gh_stars>1000+ import type { RawValueType, FlattenDataNode, Key, LabelValueType } from '../interface'; import type { SkipType } from './useKeyValueMapping'; import { getRawValueLabeled } from '../utils/valueUtil'; import type { CheckedStrategy } from '../utils/strategyUtil'; impor...
YaroShkvorets/ant-design-vue
components/vc-image/src/Preview.tsx
import { computed, defineComponent, onMounted, onUnmounted, reactive, ref, watch } from 'vue'; import RotateLeftOutlined from '@ant-design/icons-vue/RotateLeftOutlined'; import RotateRightOutlined from '@ant-design/icons-vue/RotateRightOutlined'; import ZoomInOutlined from '@ant-design/icons-vue/ZoomInOutlined'; import...
YaroShkvorets/ant-design-vue
components/anchor/Anchor.tsx
import type { ExtractPropTypes } from 'vue'; import { defineComponent, nextTick, onBeforeUnmount, onMounted, onUpdated, reactive, ref, computed, } from 'vue'; import PropTypes from '../_util/vue-types'; import classNames from '../_util/classNames'; import addEventListener from '../vc-util/Dom/addEventLi...
YaroShkvorets/ant-design-vue
site/typings/shared.d.ts
<reponame>YaroShkvorets/ant-design-vue<filename>site/typings/shared.d.ts // types shared between server and client export interface LocaleConfig { lang: string; title?: string; description?: string; head?: HeadConfig[]; label?: string; selectText?: string; } export interface SiteData<ThemeConfig = any> { ...
YaroShkvorets/ant-design-vue
components/_util/omit.ts
<reponame>YaroShkvorets/ant-design-vue function omit<T extends object, K extends keyof T>(obj: T, fields: K[]): Omit<T, K> { // eslint-disable-next-line prefer-object-spread const shallowCopy = Object.assign({}, obj); for (let i = 0; i < fields.length; i += 1) { const key = fields[i]; delete shallowCopy[k...
YaroShkvorets/ant-design-vue
components/vc-mentions/src/DropdownMenu.tsx
import Menu, { Item as MenuItem } from '../../menu'; import type { PropType } from 'vue'; import { defineComponent, inject, ref } from 'vue'; import type { OptionProps } from './Option'; import MentionsContextKey from './MentionsContext'; import Spin from '../../spin'; function noop() {} export default defineComponent...
YaroShkvorets/ant-design-vue
components/_util/getScrollBarSize.ts
<filename>components/_util/getScrollBarSize.ts /* eslint-disable no-param-reassign */ let cached: number; export default function getScrollBarSize(fresh?: boolean) { if (typeof document === 'undefined') { return 0; } if (fresh || cached === undefined) { const inner = document.createElement('div'); ...
YaroShkvorets/ant-design-vue
components/vc-util/devWarning.ts
import devWarning, { resetWarned } from './warning'; export { resetWarned }; export default (valid: boolean, component: string, message: string): void => { devWarning(valid, `[ant-design-vue: ${component}] ${message}`); };
YaroShkvorets/ant-design-vue
components/transfer/index.tsx
<filename>components/transfer/index.tsx import type { CSSProperties, ExtractPropTypes, PropType } from 'vue'; import { watchEffect, defineComponent, ref, watch, toRaw } from 'vue'; import PropTypes from '../_util/vue-types'; import { getPropsSlot } from '../_util/props-util'; import classNames from '../_util/classNames...
YaroShkvorets/ant-design-vue
components/table/Column.tsx
import { defineComponent } from 'vue'; import type { ColumnType } from './interface'; export type ColumnProps<RecordType = unknown> = ColumnType<RecordType>; export default defineComponent<ColumnProps>({ name: 'ATableColumn', slots: ['title', 'filterIcon'], render() { return null; }, });
YaroShkvorets/ant-design-vue
components/vc-trigger/utils/motionUtil.ts
import type { AnimationType, TransitionNameType } from '../interface'; interface GetMotionProps { animation: AnimationType; transitionName: TransitionNameType; prefixCls: string; } export function getMotion({ prefixCls, animation, transitionName }: GetMotionProps) { if (animation) { return { name: `...
YaroShkvorets/ant-design-vue
components/vc-table/context/SummaryContext.tsx
<gh_stars>1000+ import type { InjectionKey } from 'vue'; import { inject, provide } from 'vue'; import type { ColumnType, StickyOffsets } from '../interface'; export type FlattenColumns<RecordType> = readonly (ColumnType<RecordType> & { scrollbar?: boolean; })[]; type SummaryContextProps = { stickyOffsets?: Sticky...
YaroShkvorets/ant-design-vue
antd-tools/generator-types/src/type.ts
<reponame>YaroShkvorets/ant-design-vue<gh_stars>1000+ import type { PathLike } from 'fs'; export type VueSlot = { name: string; description: string; }; export type VueEventArgument = { name: string; type: string; }; export type VueEvent = { name: string; description?: string; arguments?: VueEventArgume...
YaroShkvorets/ant-design-vue
components/input/Password.tsx
import classNames from '../_util/classNames'; import { getComponent, getOptionProps } from '../_util/props-util'; import { cloneElement } from '../_util/vnode'; import Input from './Input'; import EyeOutlined from '@ant-design/icons-vue/EyeOutlined'; import EyeInvisibleOutlined from '@ant-design/icons-vue/EyeInvisibleO...
YaroShkvorets/ant-design-vue
components/vc-table/utils/legacyUtil.ts
<gh_stars>1000+ import { warning } from '../../vc-util/warning'; import type { ExpandableConfig, LegacyExpandableProps } from '../interface'; export const INTERNAL_COL_DEFINE = 'RC_TABLE_INTERNAL_COL_DEFINE'; export function getExpandableProps<RecordType>( props: LegacyExpandableProps<RecordType> & { expandable...
YaroShkvorets/ant-design-vue
components/result/index.tsx
<reponame>YaroShkvorets/ant-design-vue<gh_stars>1000+ import type { App, VNodeTypes, Plugin, ExtractPropTypes } from 'vue'; import { defineComponent, computed } from 'vue'; import PropTypes from '../_util/vue-types'; import { tuple } from '../_util/type'; import CheckCircleFilled from '@ant-design/icons-vue/CheckCircle...
YaroShkvorets/ant-design-vue
components/vc-mentions/src/Option.tsx
import type { ExtractPropTypes } from 'vue'; import { defineComponent } from 'vue'; export const optionProps = { value: String, disabled: Boolean, label: [String, Number, Function], }; export type OptionProps = Partial<ExtractPropTypes<typeof optionProps>>; export default defineComponent({ name: 'Option', ...
YaroShkvorets/ant-design-vue
components/vc-picker/panels/DecadePanel/DecadeHeader.tsx
<reponame>YaroShkvorets/ant-design-vue<filename>components/vc-picker/panels/DecadePanel/DecadeHeader.tsx import Header from '../Header'; import type { GenerateConfig } from '../../generate'; import { DECADE_DISTANCE_COUNT } from '.'; import { useInjectPanel } from '../../PanelContext'; import useMergeProps from '../../...
YaroShkvorets/ant-design-vue
components/vc-picker/panels/TimePanel/TimeHeader.tsx
<reponame>YaroShkvorets/ant-design-vue import Header from '../Header'; import type { Locale } from '../../interface'; import type { GenerateConfig } from '../../generate'; import { useInjectPanel } from '../../PanelContext'; import { formatValue } from '../../utils/dateUtil'; import useMergeProps from '../../hooks/useM...
YaroShkvorets/ant-design-vue
components/input-number/index.tsx
<gh_stars>1000+ import type { PropType, ExtractPropTypes } from 'vue'; import { defineComponent, inject, nextTick, onMounted, ref } from 'vue'; import PropTypes from '../_util/vue-types'; import { getOptionProps } from '../_util/props-util'; import classNames from '../_util/classNames'; import UpOutlined from '@ant-des...
YaroShkvorets/ant-design-vue
components/tooltip/abstractTooltipProps.ts
<reponame>YaroShkvorets/ant-design-vue import PropTypes from '../_util/vue-types'; import { tuple } from '../_util/type'; export const triggerTypes = tuple('hover', 'focus', 'click', 'contextmenu'); export const placementTypes = tuple( 'top', 'left', 'right', 'bottom', 'topLeft', 'topRight', 'bottomLeft'...
YaroShkvorets/ant-design-vue
components/vc-trigger/Popup/Mask.tsx
<gh_stars>1000+ import { Transition } from 'vue'; import type { TransitionNameType, AnimationType } from '../interface'; import { getMotion } from '../utils/motionUtil'; export interface MaskProps { prefixCls: string; visible?: boolean; zIndex?: number; mask?: boolean; maskAnimation?: AnimationType; maskTr...
YaroShkvorets/ant-design-vue
components/input/ResizableTextArea.tsx
<filename>components/input/ResizableTextArea.tsx import type { PropType, VNode } from 'vue'; import { nextTick, defineComponent, withDirectives } from 'vue'; import ResizeObserver from '../vc-resize-observer'; import classNames from '../_util/classNames'; import calculateNodeHeight from './calculateNodeHeight'; import ...
YaroShkvorets/ant-design-vue
components/vc-drawer/index.ts
// base rc-drawer 4.4.2 import Drawer from './src/DrawerWrapper'; export default Drawer;
YaroShkvorets/ant-design-vue
components/vc-select/index.ts
import type { ExportedSelectProps } from './Select'; import Select, { selectProps } from './Select'; import Option from './Option'; import OptGroup from './OptGroup'; import { selectBaseProps } from './generate'; import type { ExtractPropTypes } from 'vue'; export type SelectProps<T = any> = Partial<ExtractPropTypes<E...
YaroShkvorets/ant-design-vue
components/list/contextKey.ts
<gh_stars>1000+ import type { InjectionKey, Ref } from 'vue'; export interface ListContext { grid?: Ref<any>; itemLayout?: Ref<string>; } export const ListContextKey: InjectionKey<ListContext> = Symbol('ListContextKey');
YaroShkvorets/ant-design-vue
components/_util/firstNotUndefined.ts
<reponame>YaroShkvorets/ant-design-vue<gh_stars>1000+ function firstNotUndefined<T>(arr: T[] = []): T { for (let i = 0, len = arr.length; i < len; i++) { if (arr[i] !== undefined) { return arr[i]; } } return undefined; } export default firstNotUndefined;
YaroShkvorets/ant-design-vue
components/calendar/index.tsx
<filename>components/calendar/index.tsx import Calendar from './dayjs'; export * from './dayjs'; export default Calendar;
YaroShkvorets/ant-design-vue
components/vc-slider/src/common/createSlider.tsx
<reponame>YaroShkvorets/ant-design-vue<filename>components/vc-slider/src/common/createSlider.tsx import { defineComponent } from 'vue'; import classNames from '../../../_util/classNames'; import PropTypes from '../../../_util/vue-types'; import addEventListener from '../../../vc-util/Dom/addEventListener'; import warni...
YaroShkvorets/ant-design-vue
components/_util/transButton.tsx
<reponame>YaroShkvorets/ant-design-vue<gh_stars>1000+ import type { CSSProperties } from 'vue'; import { defineComponent, ref, onMounted } from 'vue'; /** * Wrap of sub component which need use as Button capacity (like Icon component). * This helps accessibility reader to tread as a interactive button to operation. ...
YaroShkvorets/ant-design-vue
components/table/hooks/useColumns.tsx
import devWarning from '../../vc-util/devWarning'; import { renderSlot } from 'vue'; import type { Ref } from 'vue'; import type { ContextSlots } from '../context'; import type { TransformColumns, ColumnsType } from '../interface'; function fillSlots<RecordType>(columns: ColumnsType<RecordType>, contextSlots: Ref<Cont...
YaroShkvorets/ant-design-vue
components/comment/index.tsx
import type { ExtractPropTypes } from 'vue'; import { defineComponent } from 'vue'; import PropsTypes from '../_util/vue-types'; import { flattenChildren } from '../_util/props-util'; import type { VueNode } from '../_util/type'; import { withInstall } from '../_util/type'; import useConfigInject from '../_util/hooks/u...
YaroShkvorets/ant-design-vue
components/vc-picker/panels/TimePanel/index.tsx
<reponame>YaroShkvorets/ant-design-vue<gh_stars>1000+ import TimeHeader from './TimeHeader'; import type { BodyOperationRef } from './TimeBody'; import TimeBody from './TimeBody'; import type { PanelSharedProps, DisabledTimes } from '../../interface'; import { createKeydownHandler } from '../../utils/uiUtil'; import cl...
YaroShkvorets/ant-design-vue
components/vc-select/OptionList.tsx
<filename>components/vc-select/OptionList.tsx import TransBtn from './TransBtn'; import PropTypes from '../_util/vue-types'; import KeyCode from '../_util/KeyCode'; import classNames from '../_util/classNames'; import pickAttrs from '../_util/pickAttrs'; import { isValidElement } from '../_util/props-util'; import crea...
YaroShkvorets/ant-design-vue
components/table/hooks/useTitleColumns.tsx
import type { Ref } from 'vue'; import type { TransformColumns, ColumnTitleProps, ColumnsType } from '../interface'; import { renderColumnTitle } from '../util'; function fillTitle<RecordType>( columns: ColumnsType<RecordType>, columnTitleProps: ColumnTitleProps<RecordType>, ) { return columns.map(column => { ...
YaroShkvorets/ant-design-vue
components/vc-tree/DropIndicator.tsx
import type { CSSProperties } from 'vue'; export default function DropIndicator({ dropPosition, dropLevelOffset, indent, }: { dropPosition: -1 | 0 | 1; dropLevelOffset: number; indent: number; }) { const style: CSSProperties = { pointerEvents: 'none', position: 'absolute', right: 0, backg...
YaroShkvorets/ant-design-vue
components/vc-table/Footer/Row.tsx
<filename>components/vc-table/Footer/Row.tsx import { defineComponent } from 'vue'; export default defineComponent({ name: 'FooterRow', setup(_props, { slots }) { return () => <tr>{slots.default?.()}</tr>; }, });
YaroShkvorets/ant-design-vue
components/vc-table/index.ts
<gh_stars>1000+ // base rc-table@7.17.2 import Table from './Table'; import { FooterComponents as Summary, SummaryCell, SummaryRow } from './Footer'; import Column from './sugar/Column'; import ColumnGroup from './sugar/ColumnGroup'; import { INTERNAL_COL_DEFINE } from './utils/legacyUtil'; export { Summary, Column, C...
YaroShkvorets/ant-design-vue
components/skeleton/Paragraph.tsx
<reponame>YaroShkvorets/ant-design-vue<filename>components/skeleton/Paragraph.tsx import type { ExtractPropTypes, PropType } from 'vue'; import { defineComponent } from 'vue'; type widthUnit = number | string; export const skeletonParagraphProps = { prefixCls: String, width: { type: [Number, String, Array] as Prop...
YaroShkvorets/ant-design-vue
components/vc-picker/panels/WeekPanel/index.tsx
import DatePanel from '../DatePanel'; import type { PanelSharedProps } from '../../interface'; import { isSameWeek } from '../../utils/dateUtil'; import classNames from '../../../_util/classNames'; import useMergeProps from '../../hooks/useMergeProps'; export type WeekPanelProps<DateType> = PanelSharedProps<DateType>;...
YaroShkvorets/ant-design-vue
plugin/md/markdown/plugins/preWrapper.ts
// markdown-it plugin for wrapping <pre> ... </pre>. // // If your plugin was chained before preWrapper, you can add additional element directly. // If your plugin was chained after preWrapper, you can use these slots: // 1. <!--beforebegin--> // 2. <!--afterbegin--> // 3. <!--beforeend--> // 4. <!--afterend-->...
YaroShkvorets/ant-design-vue
components/collapse/commonProps.ts
import type { PropType } from 'vue'; import { tuple } from '../_util/type'; import PropTypes from '../_util/vue-types'; export type CollapsibleType = 'header' | 'disabled'; export type ActiveKeyType = Array<string | number> | string | number; const collapseProps = () => ({ prefixCls: PropTypes.string, activeKey: ...
YaroShkvorets/ant-design-vue
components/pagination/MiniSelect.tsx
import { defineComponent } from 'vue'; import VcSelect, { selectProps } from '../select'; export default defineComponent({ inheritAttrs: false, props: selectProps(), Option: VcSelect.Option, setup(props, { attrs, slots }) { return () => { const selelctProps: any = { ...props, size: 's...
YaroShkvorets/ant-design-vue
components/vc-table/Footer/index.tsx
import Summary from './Summary'; import SummaryRow from './Row'; import SummaryCell from './Cell'; import type { DefaultRecordType, StickyOffsets } from '../interface'; import { computed, defineComponent, reactive, toRef } from 'vue'; import type { FlattenColumns } from '../context/SummaryContext'; import { useProvideS...
YaroShkvorets/ant-design-vue
components/vc-virtual-list/interface.ts
import type { CSSProperties, VNodeTypes } from 'vue'; import type { Key } from '../_util/type'; export type RenderFunc<T> = ( item: T, index: number, props: { style?: CSSProperties }, ) => VNodeTypes; export interface SharedConfig<T> { getKey: (item: T) => Key; } export type GetKey<T = object> = (item: T) =>...
YaroShkvorets/ant-design-vue
components/vc-progress/index.ts
<filename>components/vc-progress/index.ts // based on rc-progress 3.1.4 import Progress, { Line, Circle } from './src'; import type { ProgressProps } from './src'; export { Line, Circle }; export type { ProgressProps }; export default Progress;
YaroShkvorets/ant-design-vue
components/_util/hooks/useMergedState.ts
import type { Ref, UnwrapRef } from 'vue'; import { toRaw, watchEffect, unref, watch, ref } from 'vue'; export default function useMergedState<T, R = Ref<T>>( defaultStateValue: T | (() => T), option?: { defaultValue?: T | (() => T); value?: Ref<T> | Ref<UnwrapRef<T>>; onChange?: (val: T, prevValue: T)...
YaroShkvorets/ant-design-vue
components/input/ClearableLabeledInput.tsx
import classNames from '../_util/classNames'; import CloseCircleFilled from '@ant-design/icons-vue/CloseCircleFilled'; import { getInputClassName } from './Input'; import PropTypes from '../_util/vue-types'; import { cloneElement } from '../_util/vnode'; import { getComponent } from '../_util/props-util'; import type {...
YaroShkvorets/ant-design-vue
components/button/button-group.tsx
import { computed, defineComponent } from 'vue'; import { flattenChildren } from '../_util/props-util'; import PropTypes from '../_util/vue-types'; import useConfigInject from '../_util/hooks/useConfigInject'; import type { ExtractPropTypes, PropType } from 'vue'; import type { SizeType } from '../config-provider'; c...
YaroShkvorets/ant-design-vue
components/vc-pagination/locale/lt_LT.ts
export default { // Options.jsx items_per_page: '/ psl.', jump_to: 'Pereiti', jump_to_confirm: 'patvirtinti', page: '', // Pagination.jsx prev_page: 'Atgal', next_page: 'Pirmyn', prev_5: 'Grįžti 5 pls.', next_5: 'Peršokti 5 pls.', prev_3: 'Grįžti 3 pls.', next_3: 'Peršokti 3 pls.', };
YaroShkvorets/ant-design-vue
components/statistic/index.ts
<filename>components/statistic/index.ts import type { App, Plugin } from 'vue'; import Statistic from './Statistic'; import Countdown from './Countdown'; export type { StatisticProps } from './Statistic'; Statistic.Countdown = Countdown; /* istanbul ignore next */ Statistic.install = function (app: App) { app.compo...
YaroShkvorets/ant-design-vue
components/vc-picker/hooks/useRangeViewDates.ts
<reponame>YaroShkvorets/ant-design-vue<filename>components/vc-picker/hooks/useRangeViewDates.ts import type { RangeValue, PickerMode } from '../interface'; import type { GenerateConfig } from '../generate'; import { getValue, updateValues } from '../utils/miscUtil'; import { getClosingViewDate, isSameYear, isSameMonth,...
YaroShkvorets/ant-design-vue
components/vc-trigger/Popup/MobilePopupInner.tsx
import type { CSSProperties } from 'vue'; import { defineComponent, ref, Transition } from 'vue'; import { flattenChildren } from '../../_util/props-util'; import classNames from '../../_util/classNames'; import type { MobilePopupProps } from './interface'; import { mobileProps } from './interface'; export default def...
YaroShkvorets/ant-design-vue
components/table/hooks/useFilter/FilterDropdown.tsx
import isEqual from 'lodash-es/isEqual'; import FilterFilled from '@ant-design/icons-vue/FilterFilled'; import Button from '../../../button'; import Menu from '../../../menu'; import Checkbox from '../../../checkbox'; import Radio from '../../../radio'; import Dropdown from '../../../dropdown'; import Empty from '../.....
YaroShkvorets/ant-design-vue
components/_util/debouncedWatch.ts
<reponame>YaroShkvorets/ant-design-vue // copy from https://github.dev/vueuse/vueuse import type { Ref, WatchOptions, WatchStopHandle } from 'vue'; import { unref, watch } from 'vue'; type MaybeRef<T> = T | Ref<T>; type Fn = () => void; export type FunctionArgs<Args extends any[] = any[], Return = void> = (...args:...
YaroShkvorets/ant-design-vue
components/vc-table/Footer/Summary.tsx
import { computed, defineComponent, onBeforeUnmount, watchEffect } from 'vue'; import { useInjectTable } from '../context/TableContext'; export interface SummaryProps { fixed?: boolean | 'top' | 'bottom'; } let indexGuid = 0; const Summary = defineComponent<SummaryProps>({ name: 'Summary', props: ['fixed'] as a...
YaroShkvorets/ant-design-vue
components/collapse/index.ts
<gh_stars>1000+ import type { App, Plugin } from 'vue'; import Collapse, { collapseProps } from './Collapse'; import CollapsePanel, { collapsePanelProps } from './CollapsePanel'; export type { CollapseProps } from './Collapse'; export type { CollapsePanelProps } from './CollapsePanel'; Collapse.Panel = CollapsePanel; ...
YaroShkvorets/ant-design-vue
plugin/md/utils/fetchCode.ts
<gh_stars>1000+ // import cheerio from 'cheerio'; const scriptRE = /<script[^>]*>([\s\S]*)<\/script>/; const scriptContentRE = /(?<=<script[^>]*>)([\s\S]*)(?=<\/script>)/; const templateRE = /<template[^>]*>([\s\S]*)<\/template>/; const styleRE = /<style[^>]*>([\s\S]*)<\/style>/; const docsRE = /(?<=<docs>)([\s\S]*)(?=...
YaroShkvorets/ant-design-vue
plugin/docs/index.ts
import { createVueToMarkdownRenderFn } from './vueToMarkdown'; import type { MarkdownOptions } from '../md/markdown/markdown'; import type { Plugin } from 'vite'; import { createMarkdownToVueRenderFn } from '../md/markdownToVue'; interface Options { root?: string; markdown?: MarkdownOptions; } export default (opt...
YaroShkvorets/ant-design-vue
components/vc-table/Panel/index.tsx
<gh_stars>1000+ function Panel(_, { slots }) { return <div>{slots.default?.()}</div>; } Panel.displayName = 'Panel'; export default Panel;
YaroShkvorets/ant-design-vue
components/vc-overflow/examples/basic.tsx
<reponame>YaroShkvorets/ant-design-vue import { defineComponent, ref } from 'vue'; import Overflow from '..'; import '../assets/index.less'; import './common.less'; interface ItemType { value: string | number; label: string; } function createData(count: number): ItemType[] { const data: ItemType[] = new Array(c...
YaroShkvorets/ant-design-vue
components/menu/src/hooks/useDirectionStyle.ts
<filename>components/menu/src/hooks/useDirectionStyle.ts import type { ComputedRef, CSSProperties } from 'vue'; import { computed } from 'vue'; import { useInjectMenu } from './useMenuContext'; export default function useDirectionStyle(level: ComputedRef<number>): ComputedRef<CSSProperties> { const { mode, rtl, inli...
YaroShkvorets/ant-design-vue
components/vc-picker/utils/getExtraFooter.tsx
<reponame>YaroShkvorets/ant-design-vue import type { PanelMode } from '../interface'; export default function getExtraFooter( prefixCls: string, mode: PanelMode, renderExtraFooter?: (mode: PanelMode) => any, ) { if (!renderExtraFooter) { return null; } return <div class={`${prefixCls}-footer-extra`}>{...
YaroShkvorets/ant-design-vue
components/modal/locale.ts
<filename>components/modal/locale.ts export interface ModalLocale { okText: string; cancelText: string; justOkText: string; }
YaroShkvorets/ant-design-vue
components/menu/index.tsx
import type { MenuProps } from './src/Menu'; import Menu from './src/Menu'; import type { MenuItemProps } from './src/MenuItem'; import MenuItem from './src/MenuItem'; import type { SubMenuProps } from './src/SubMenu'; import SubMenu from './src/SubMenu'; import type { MenuItemGroupProps } from './src/ItemGroup'; impor...
YaroShkvorets/ant-design-vue
components/collapse/PanelContent.tsx
<reponame>YaroShkvorets/ant-design-vue import { defineComponent, ref, watchEffect } from 'vue'; import { collapsePanelProps } from './commonProps'; import classNames from '../_util/classNames'; export default defineComponent({ name: 'PanelContent', props: collapsePanelProps(), setup(props, { slots }) { const...
YaroShkvorets/ant-design-vue
components/vc-slider/src/common/Track.tsx
<reponame>YaroShkvorets/ant-design-vue<filename>components/vc-slider/src/common/Track.tsx /* eslint-disable */ const Track = (_, { attrs }) => { const { included, vertical, style, class: className } = attrs; let { length, offset, reverse } = attrs; if (length < 0) { reverse = !reverse; length = Math.abs(l...
YaroShkvorets/ant-design-vue
components/tabs/src/TabContext.ts
<reponame>YaroShkvorets/ant-design-vue import type { Tab } from './interface'; import type { PropType, InjectionKey, Ref } from 'vue'; import { provide, inject, defineComponent, toRefs, ref } from 'vue'; export interface TabContextProps { tabs: Ref<Tab[]>; prefixCls: Ref<string>; } const TabsContextKey: Injection...
YaroShkvorets/ant-design-vue
components/vc-slider/src/common/Marks.tsx
<reponame>YaroShkvorets/ant-design-vue import supportsPassive from '../../../_util/supportsPassive'; import classNames from '../../../_util/classNames'; import { isValidElement } from '../../../_util/props-util'; const Marks = (_: any, { attrs, slots }: any) => { const { class: className, vertical, rever...
YaroShkvorets/ant-design-vue
components/vc-table/Body/ExpandedRow.tsx
import type { CustomizeComponent } from '../interface'; import Cell from '../Cell'; import { defineComponent } from 'vue'; import { useInjectTable } from '../context/TableContext'; export interface ExpandedRowProps { prefixCls: string; component: CustomizeComponent; cellComponent: CustomizeComponent; fixHeader...
YaroShkvorets/ant-design-vue
components/vc-mentions/src/mentionsProps.ts
import type { PropType } from 'vue'; import PropTypes from '../../_util/vue-types'; import { initDefaultProps } from '../../_util/props-util'; import { filterOption as defaultFilterOption, validateSearch as defaultValidateSearch, } from './util'; import { tuple } from '../../_util/type'; import type { OptionProps }...
YaroShkvorets/ant-design-vue
components/vc-trigger/Popup/useStretchStyle.ts
<reponame>YaroShkvorets/ant-design-vue<filename>components/vc-trigger/Popup/useStretchStyle.ts import type { ComputedRef, CSSProperties, Ref } from 'vue'; import { computed, ref } from 'vue'; import type { StretchType } from '../interface'; export default ( stretch?: Ref<StretchType>, ): [ComputedRef<CSSProperties>,...
YaroShkvorets/ant-design-vue
components/tabs/index.ts
<filename>components/tabs/index.ts import type { App, Plugin } from 'vue'; import Tabs, { TabPane } from './src'; export type { TabsProps, TabPaneProps } from './src'; Tabs.TabPane = { ...TabPane, name: 'ATabPane', __ANT_TAB_PANE: true }; /* istanbul ignore next */ Tabs.install = function (app: App) { app.component...
YaroShkvorets/ant-design-vue
components/vc-progress/src/types.ts
import type { PropType, ExtractPropTypes } from 'vue'; import PropTypes from '../../_util/vue-types'; export type StrokeColorType = string | string[] | object; export type GapPositionType = 'top' | 'right' | 'bottom' | 'left'; export type StrokeLinecapType = 'round' | 'butt' | 'square'; export const propTypes = { ...
YaroShkvorets/ant-design-vue
components/vc-tooltip/src/Content.tsx
import type { ExtractPropTypes } from 'vue'; import { defineComponent } from 'vue'; import PropTypes from '../../_util/vue-types'; const tooltipContentProps = { prefixCls: PropTypes.string, id: PropTypes.string, overlayInnerStyle: PropTypes.any, }; export type TooltipContentProps = Partial<ExtractPropTypes<type...
YaroShkvorets/ant-design-vue
components/dropdown/index.ts
<reponame>YaroShkvorets/ant-design-vue import type { App, Plugin } from 'vue'; import Dropdown from './dropdown'; import DropdownButton from './dropdown-button'; import { dropdownProps, dropdownButtonProps } from './props'; export type { DropdownProps } from './dropdown'; export type { DropdownButtonProps } from './dro...
YaroShkvorets/ant-design-vue
components/row/index.ts
<filename>components/row/index.ts import { Row } from '../grid'; import { withInstall } from '../_util/type'; export type { RowProps } from '../grid'; export default withInstall(Row);
YaroShkvorets/ant-design-vue
components/time-picker/index.tsx
<reponame>YaroShkvorets/ant-design-vue import TimePicker from './dayjs'; export * from './dayjs'; export interface TimePickerLocale { placeholder?: string; rangePlaceholder?: [string, string]; } export default TimePicker;
YaroShkvorets/ant-design-vue
components/time-picker/locale/lt_LT.tsx
<filename>components/time-picker/locale/lt_LT.tsx import type { TimePickerLocale } from '../index'; const locale: TimePickerLocale = { placeholder: 'Pasirinkite laiką', rangePlaceholder: ['Pradžios laikas', 'Pabaigos laikas'], }; export default locale;