fix(project): node is not exporting issue (#2827)

- Fix issue that caused ts definition file not generating
This commit is contained in:
jeremywu 2021-08-04 18:28:08 +08:00 committed by GitHub
parent 57b1ccf85b
commit 7c97bc5283
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
36 changed files with 69 additions and 1 deletions

View File

@ -58,6 +58,8 @@ import type {
ElCascaderPanelContext,
} from './types'
type Nullable<T> = null | T
export default defineComponent({
name: 'ElCascaderPanel',

View File

@ -49,6 +49,8 @@ import {
import type { PropType } from 'vue'
type Nullable<T> = null | T
export default defineComponent({
name: 'ElCascaderMenu',

View File

@ -7,6 +7,8 @@ import type {
CascaderConfig,
} from './types'
export type Nullable<T> = null | T
type ChildrenData = CascaderOption[] | undefined
let uid = 0

View File

@ -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) {

View File

@ -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

View File

@ -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> => {

View File

@ -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: {

View File

@ -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: {

View File

@ -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;

View File

@ -4,6 +4,8 @@ import {
Ref,
} from 'vue'
export type Nullable<T> = null | T
export interface IElDropdownInstance {
instance?: ComponentInternalInstance
dropdownSize?: ComputedRef<string>

View File

@ -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: {

View File

@ -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', {})

View File

@ -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: {

View File

@ -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

View File

@ -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,

View File

@ -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,

View File

@ -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: {

View File

@ -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

View File

@ -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(

View File

@ -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: {

View File

@ -105,6 +105,8 @@ import { useStops } from './useStops'
import type { PropType } from 'vue'
type Nullable<T> = null | T
export default defineComponent({
name: 'ElSlider',

View File

@ -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>

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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 {

View File

@ -91,3 +91,4 @@
@import './descriptions';
@import './descriptions-item';
@import './result.scss';
@import './config-provider.scss';

View File

@ -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: {

View File

@ -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

View File

@ -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>
}

View File

@ -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: {

View File

@ -50,6 +50,8 @@ import {
RootTreeType,
} from './tree.type'
type Nullable<T> = null | T
export default defineComponent({
name: 'ElTree',
components: { ElTreeNode },

View File

@ -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',

View File

@ -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[],

View File

@ -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, '')

View File

@ -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 {