mirror of
https://github.com/element-plus/element-plus.git
synced 2025-02-23 11:59:34 +08:00
fix(project): node is not exporting issue (#2827)
- Fix issue that caused ts definition file not generating
This commit is contained in:
parent
57b1ccf85b
commit
7c97bc5283
@ -58,6 +58,8 @@ import type {
|
||||
ElCascaderPanelContext,
|
||||
} from './types'
|
||||
|
||||
type Nullable<T> = null | T
|
||||
|
||||
export default defineComponent({
|
||||
name: 'ElCascaderPanel',
|
||||
|
||||
|
@ -49,6 +49,8 @@ import {
|
||||
|
||||
import type { PropType } from 'vue'
|
||||
|
||||
type Nullable<T> = null | T
|
||||
|
||||
export default defineComponent({
|
||||
name: 'ElCascaderMenu',
|
||||
|
||||
|
@ -7,6 +7,8 @@ import type {
|
||||
CascaderConfig,
|
||||
} from './types'
|
||||
|
||||
export type Nullable<T> = null | T
|
||||
|
||||
type ChildrenData = CascaderOption[] | undefined
|
||||
|
||||
let uid = 0
|
||||
|
@ -7,6 +7,8 @@ import type {
|
||||
CascaderConfig,
|
||||
} from './types'
|
||||
|
||||
export type Nullable<T> = null | T
|
||||
|
||||
const flatNodes = (nodes: Node[], leafOnly: boolean) => {
|
||||
return nodes.reduce((res, node) => {
|
||||
if (node.isLeaf) {
|
||||
|
@ -2,6 +2,8 @@
|
||||
import type { VNode, InjectionKey } from 'vue'
|
||||
import type { default as CascaderNode } from './node'
|
||||
|
||||
export type Nullable<T> = null | T
|
||||
|
||||
export type { CascaderNode }
|
||||
|
||||
export type CascaderNodeValue = string | number
|
||||
|
@ -1,6 +1,8 @@
|
||||
|
||||
import type { CascaderNode } from './types'
|
||||
|
||||
export type Nullable<T> = null | T
|
||||
|
||||
export const isLeaf = (el: HTMLElement) => !el.getAttribute('aria-owns')
|
||||
|
||||
export const getSibling = (el: HTMLElement, distance: number): Nullable<Element> => {
|
||||
|
@ -2,6 +2,8 @@ import { mount } from '@vue/test-utils'
|
||||
import { ComponentPublicInstance, defineComponent, nextTick } from 'vue'
|
||||
import ColorPicker from '../src/index.vue'
|
||||
|
||||
type Nullable<T> = null | T
|
||||
|
||||
const _mount = (template: string, data: () => ({[key:string]: any;})) => {
|
||||
const Component = defineComponent({
|
||||
components: {
|
||||
|
@ -26,6 +26,8 @@ import { defineComponent, watch, ref, onMounted, getCurrentInstance, PropType }
|
||||
import type Color from '../color'
|
||||
import draggable from '../draggable'
|
||||
|
||||
type Nullable<T> = null | T
|
||||
|
||||
export default defineComponent({
|
||||
name: 'ElColorAlphaSlider',
|
||||
props: {
|
||||
|
@ -2,6 +2,7 @@ import { on } from '@element-plus/utils/dom'
|
||||
import isServer from '@element-plus/utils/isServer'
|
||||
import type { ComponentPublicInstance, DirectiveBinding, ObjectDirective } from 'vue'
|
||||
|
||||
type Nullable<T> = null | T
|
||||
|
||||
type DocumentHandler = <T extends MouseEvent>(mouseup: T, mousedown: T) => void;
|
||||
|
||||
|
@ -4,6 +4,8 @@ import {
|
||||
Ref,
|
||||
} from 'vue'
|
||||
|
||||
export type Nullable<T> = null | T
|
||||
|
||||
export interface IElDropdownInstance {
|
||||
instance?: ComponentInternalInstance
|
||||
dropdownSize?: ComputedRef<string>
|
||||
|
@ -68,6 +68,8 @@ import ElPopper from '@element-plus/popper'
|
||||
import { useDropdown } from './useDropdown'
|
||||
import { addUnit } from '@element-plus/utils/util'
|
||||
|
||||
type Nullable<T> = null | T
|
||||
|
||||
export default defineComponent({
|
||||
name: 'ElDropdown',
|
||||
components: {
|
||||
|
@ -4,6 +4,8 @@ import { EVENT_CODE } from '@element-plus/utils/aria'
|
||||
import { on, addClass } from '@element-plus/utils/dom'
|
||||
import type { IElDropdownInstance } from './dropdown'
|
||||
|
||||
export type Nullable<T> = null | T
|
||||
|
||||
export const useDropdown = () => {
|
||||
const ELEMENT = useGlobalConfig()
|
||||
const elDropdown = inject<IElDropdownInstance>('elDropdown', {})
|
||||
|
@ -5,6 +5,8 @@ import { addResizeListener, removeResizeListener, ResizableElement } from '@elem
|
||||
|
||||
import type { CSSProperties } from 'vue'
|
||||
|
||||
export type Nullable<T> = null | T
|
||||
|
||||
export default defineComponent({
|
||||
name: 'ElLabelWrap',
|
||||
props: {
|
||||
|
@ -48,6 +48,7 @@ import type { Trigger } from './use-target-events'
|
||||
|
||||
export type Effect = 'light' | 'dark'
|
||||
export type Offset = [number, number] | number
|
||||
export type Nullable<T> = null | T
|
||||
|
||||
type ElementType = ComponentPublicInstance | HTMLElement
|
||||
|
||||
|
@ -2,6 +2,8 @@ import { createVNode, h, reactive, ref, render, toRefs, Transition, VNode, vShow
|
||||
import { removeClass } from '@element-plus/utils/dom'
|
||||
import type { ILoadingCreateComponentParams, ILoadingInstance } from './loading.type'
|
||||
|
||||
export type Nullable<T> = null | T
|
||||
|
||||
export function createLoadingComponent({
|
||||
options,
|
||||
globalLoadingOption,
|
||||
|
@ -26,6 +26,8 @@ import { useLocaleInject } from '@element-plus/hooks'
|
||||
import ElInput from '@element-plus/input'
|
||||
import { usePagination } from './usePagination'
|
||||
|
||||
type Nullable<T> = null | T
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
ElInput,
|
||||
|
@ -25,6 +25,8 @@ import { useLocaleInject } from '@element-plus/hooks'
|
||||
import isEqual from 'lodash/isEqual'
|
||||
import { usePagination } from './usePagination'
|
||||
|
||||
export type Nullable<T> = null | T
|
||||
|
||||
export default defineComponent({
|
||||
name: 'Sizes',
|
||||
components: {
|
||||
|
@ -6,6 +6,8 @@ export enum Effect {
|
||||
LIGHT = 'light'
|
||||
}
|
||||
|
||||
export type Nullable<T> = null | T
|
||||
|
||||
export type RefElement = Nullable<HTMLElement>
|
||||
export type Offset = [number, number] | number
|
||||
|
||||
|
@ -32,6 +32,8 @@ export interface PopperEvents {
|
||||
onBlur?: (e: Event) => void
|
||||
}
|
||||
|
||||
export type Nullable<T> = null | T
|
||||
|
||||
export const DEFAULT_TRIGGER = ['hover']
|
||||
export const UPDATE_VISIBLE_EVENT = 'update:visible'
|
||||
export default function(
|
||||
|
@ -21,6 +21,8 @@ import { computed, defineComponent, inject, onBeforeUnmount, onMounted, ref, Ref
|
||||
import { off, on } from '@element-plus/utils/dom'
|
||||
import { BAR_MAP, renderThumbStyle } from './util'
|
||||
|
||||
type Nullable<T> = null | T
|
||||
|
||||
export default defineComponent({
|
||||
name: 'Bar',
|
||||
props: {
|
||||
|
@ -105,6 +105,8 @@ import { useStops } from './useStops'
|
||||
|
||||
import type { PropType } from 'vue'
|
||||
|
||||
type Nullable<T> = null | T
|
||||
|
||||
export default defineComponent({
|
||||
name: 'ElSlider',
|
||||
|
||||
|
@ -21,6 +21,8 @@ export interface ISliderProps {
|
||||
marks?: Record<number, any>
|
||||
}
|
||||
|
||||
export type Nullable<T> = null | T
|
||||
|
||||
export interface ISliderInitData {
|
||||
firstValue: Nullable<number>
|
||||
secondValue: Nullable<number>
|
||||
|
@ -5,6 +5,8 @@ import { ButtonRefs, ISliderInitData, ISliderProps } from './slider.type'
|
||||
|
||||
import type { ElFormContext, ElFormItemContext } from '@element-plus/form'
|
||||
|
||||
export type Nullable<T> = null | T
|
||||
|
||||
export const useSlide = (props: ISliderProps, initData: ISliderInitData, emit) => {
|
||||
const elForm = inject(elFormKey, {} as ElFormContext)
|
||||
const elFormItem = inject(elFormItemKey, {} as ElFormItemContext)
|
||||
|
@ -4,6 +4,7 @@ import { TableColumnCtx } from '../table-column/defaults'
|
||||
import type TableLayout from '../table-layout'
|
||||
|
||||
export type DefaultRow = any
|
||||
export type Nullable<T> = null | T
|
||||
|
||||
interface TableRefs {
|
||||
headerWrapper: HTMLElement
|
||||
|
@ -6,6 +6,8 @@ import { createPopper } from '@popperjs/core'
|
||||
import PopupManager from '@element-plus/utils/popup-manager'
|
||||
import { TableColumnCtx } from './table-column/defaults'
|
||||
|
||||
export type Nullable<T> = null | T
|
||||
|
||||
export const getCell = function(event: Event): HTMLElement {
|
||||
let cell = event.target as HTMLElement
|
||||
|
||||
|
@ -8,6 +8,7 @@ import TabBar from './tab-bar.vue'
|
||||
import { NOOP, capitalize } from '@vue/shared'
|
||||
import { RootTabs, Pane, ITabType } from './tabs.vue'
|
||||
|
||||
export type Nullable<T> = null | T
|
||||
type RefElement = Nullable<HTMLElement>
|
||||
|
||||
interface Scrollable {
|
||||
|
@ -91,3 +91,4 @@
|
||||
@import './descriptions';
|
||||
@import './descriptions-item';
|
||||
@import './result.scss';
|
||||
@import './config-provider.scss';
|
||||
|
@ -69,6 +69,8 @@ import { RepeatClick } from '@element-plus/directives'
|
||||
import ElScrollbar from '@element-plus/scrollbar'
|
||||
import { getTimeLists } from './useTimePicker'
|
||||
|
||||
export type Nullable<T> = null | T
|
||||
|
||||
export default defineComponent({
|
||||
|
||||
directives: {
|
||||
|
@ -12,6 +12,8 @@ import {
|
||||
TreeNodeChildState,
|
||||
} from '../tree.type'
|
||||
|
||||
type Nullable<T> = null | T
|
||||
|
||||
export const getChildState = (node: Node[]): TreeNodeChildState => {
|
||||
let all = true
|
||||
let none = true
|
||||
@ -72,7 +74,7 @@ const getPropertyFromData = function(node: Node, prop: string): any {
|
||||
|
||||
let nodeIdSeed = 0
|
||||
|
||||
export default class Node {
|
||||
class Node {
|
||||
id: number;
|
||||
text: string;
|
||||
checked: boolean;
|
||||
@ -515,3 +517,5 @@ export default class Node {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default Node
|
||||
|
@ -3,6 +3,8 @@ import { EVENT_CODE } from '@element-plus/utils/aria'
|
||||
import { on, off } from '@element-plus/utils/dom'
|
||||
import TreeStore from './tree-store'
|
||||
|
||||
export type Nullable<T> = null | T
|
||||
|
||||
interface UseKeydownOption {
|
||||
el$: Ref<HTMLElement>
|
||||
}
|
||||
|
@ -87,6 +87,8 @@ import { useDragNodeEmitter } from './model/useDragNode'
|
||||
import Node from './model/node'
|
||||
import { TreeOptionProps, TreeNodeData, RootTreeType } from './tree.type'
|
||||
|
||||
type Nullable<T> = null | T
|
||||
|
||||
export default defineComponent({
|
||||
name: 'ElTreeNode',
|
||||
components: {
|
||||
|
@ -50,6 +50,8 @@ import {
|
||||
RootTreeType,
|
||||
} from './tree.type'
|
||||
|
||||
type Nullable<T> = null | T
|
||||
|
||||
export default defineComponent({
|
||||
name: 'ElTree',
|
||||
components: { ElTreeNode },
|
||||
|
@ -28,6 +28,7 @@ import type {
|
||||
|
||||
type PFileHandler<T> = PropType<FileHandler<T>>
|
||||
type PFileResultHandler<T = any> = PropType<FileResultHandler<T>>
|
||||
type Nullable<T> = null | T
|
||||
|
||||
export default defineComponent({
|
||||
name: 'ElUpload',
|
||||
|
@ -35,6 +35,8 @@ import UploadDragger from './upload-dragger.vue'
|
||||
import type { PropType } from 'vue'
|
||||
import type { ListType, UploadFile, ElFile } from './upload.type'
|
||||
|
||||
type Nullable<T> = null | T
|
||||
|
||||
type IFileHanlder = (
|
||||
file: Nullable<ElFile[]>,
|
||||
fileList?: UploadFile[],
|
||||
|
@ -1,6 +1,8 @@
|
||||
import isServer from './isServer'
|
||||
import { camelize, isObject } from './util'
|
||||
|
||||
export type Nullable<T> = null | T
|
||||
|
||||
/* istanbul ignore next */
|
||||
const trim = function(s: string) {
|
||||
return (s || '').replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, '')
|
||||
|
@ -7,6 +7,8 @@ import { warn } from './error'
|
||||
import type { ComponentPublicInstance, Ref } from 'vue'
|
||||
import type { AnyFunction } from './types'
|
||||
|
||||
export type Nullable<T> = null | T
|
||||
|
||||
// type polyfill for compat isIE method
|
||||
declare global {
|
||||
interface Document {
|
||||
|
Loading…
Reference in New Issue
Block a user