{"version":3,"file":"interface.cjs","sources":["../../../../../../packages/vue-components/vc-trigger/src/interface.ts"],"sourcesContent":["import type { VueNode } from '@antdv/types';\nimport type { CSSProperties, ExtractPropTypes, PropType, TransitionProps } from 'vue';\nimport { PropTypes } from '@antdv/utils';\n\n/** Two char of 't' 'b' 'c' 'l' 'r'. Example: 'lt' */\nexport type AlignPoint = string;\n\nexport type OffsetType = number | `${number}%`;\nexport interface AlignType {\n  /**\n   * move point of source node to align with point of target node.\n   * Such as ['tr','cc'], align top right point of source node with center point of target node.\n   * Point can be 't'(top), 'b'(bottom), 'c'(center), 'l'(left), 'r'(right)\n   */\n  points?: Array<string | AlignPoint>;\n  /**\n   * offset source node by offset[0] in x and offset[1] in y.\n   * If offset contains percentage string value, it is relative to sourceNode region.\n   */\n  offset?: OffsetType[];\n  /**\n   * offset target node by offset[0] in x and offset[1] in y.\n   * If targetOffset contains percentage string value, it is relative to targetNode region.\n   */\n  targetOffset?: OffsetType[];\n  /**\n   * If adjustX field is true, will adjust source node in x direction if source node is invisible.\n   * If adjustY field is true, will adjust source node in y direction if source node is invisible.\n   */\n  overflow?: {\n    adjustX?: boolean | number;\n    adjustY?: boolean | number;\n    shiftX?: boolean | number;\n    shiftY?: boolean | number;\n  };\n  /** Auto adjust arrow position */\n  autoArrow?: boolean;\n  /**\n   * Config visible region check of html node. Default `visible`:\n   *  - `visible`:\n   *    The visible region of user browser window.\n   *    Use `clientHeight` for check.\n   *    If `visible` region not satisfy, fallback to `scroll`.\n   *  - `scroll`:\n   *    The whole region of the html scroll area.\n   *    Use `scrollHeight` for check.\n   *  - `visibleFirst`:\n   *    Similar to `visible`, but if `visible` region not satisfy, fallback to `scroll`.\n   */\n  htmlRegion?: 'visible' | 'scroll' | 'visibleFirst';\n  /**\n   * Whether use css right instead of left to position\n   */\n  useCssRight?: boolean;\n  /**\n   * Whether use css bottom instead of top to position\n   */\n  useCssBottom?: boolean;\n  /**\n   * Whether use css transform instead of left/top/right/bottom to position if browser supports.\n   * Defaults to false.\n   */\n  useCssTransform?: boolean;\n  ignoreShake?: boolean;\n}\n\nexport type BuildInPlacements = Record<string, AlignType>;\n\nexport type StretchType = string;\n\nexport type ActionType = string;\n\nexport type AnimationType = string;\n\nexport type TransitionNameType = string;\n\nexport interface Point {\n  pageX: number;\n  pageY: number;\n}\n\nexport interface CommonEventHandler {\n  remove: () => void;\n}\n\nexport interface MobileConfig {\n  /** Set popup motion. You can ref `rc-motion` for more info. */\n  popupMotion?: TransitionProps;\n  popupClassName?: string;\n  popupStyle?: CSSProperties;\n  popupRender?: (originNode: VueNode) => VueNode;\n}\n\nfunction returnEmptyString() {\n  return '';\n}\n\nfunction returnDocument(element) {\n  if (element)\n    return element.ownerDocument;\n\n  return window.document;\n}\n\nexport function noop() {}\n\nexport function triggerProps() {\n  return {\n    action: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]).def([]),\n    showAction: PropTypes.any.def([]),\n    hideAction: PropTypes.any.def([]),\n    getPopupClassNameFromAlign: PropTypes.any.def(returnEmptyString),\n    onPopupVisibleChange: Function as PropType<(open: boolean) => void>,\n    afterPopupVisibleChange: PropTypes.func.def(noop),\n    popup: PropTypes.any,\n    arrow: PropTypes.bool.def(true),\n    popupStyle: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },\n    prefixCls: PropTypes.string.def('rc-trigger-popup'),\n    popupClassName: PropTypes.string.def(''),\n    popupPlacement: String,\n    builtinPlacements: PropTypes.object,\n    popupTransitionName: String,\n    popupAnimation: PropTypes.any,\n    mouseEnterDelay: PropTypes.number.def(0),\n    mouseLeaveDelay: PropTypes.number.def(0.1),\n    zIndex: Number,\n    focusDelay: PropTypes.number.def(0),\n    blurDelay: PropTypes.number.def(0.15),\n    getPopupContainer: Function,\n    getDocument: PropTypes.func.def(returnDocument),\n    forceRender: { type: Boolean, default: undefined },\n    destroyPopupOnHide: { type: Boolean, default: false },\n    mask: { type: Boolean, default: false },\n    maskClosable: { type: Boolean, default: true },\n    // onPopupAlign: PropTypes.func.def(noop),\n    popupAlign: PropTypes.object.def(() => ({})),\n    popupVisible: { type: Boolean, default: undefined },\n    defaultPopupVisible: { type: Boolean, default: false },\n    maskTransitionName: String,\n    maskAnimation: String,\n    stretch: String,\n    alignPoint: { type: Boolean, default: undefined }, // Maybe we can support user pass position in the future\n    autoDestroy: { type: Boolean, default: false },\n    mobile: Object,\n    getTriggerDOMNode: Function as PropType<(d?: HTMLElement) => HTMLElement>,\n  };\n}\n\nexport type TriggerProps = Partial<ExtractPropTypes<ReturnType<typeof triggerProps>>>;\n"],"names":["PropTypes"],"mappings":";;;;;AA6FA,SAAS,iBAAoB,GAAA;AAC3B,EAAO,OAAA,EAAA,CAAA;AACT,CAAA;AAEA,SAAS,eAAe,OAAS,EAAA;AAC/B,EAAI,IAAA,OAAA;AACF,IAAA,OAAO,OAAQ,CAAA,aAAA,CAAA;AAEjB,EAAA,OAAO,MAAO,CAAA,QAAA,CAAA;AAChB,CAAA;AAEO,SAAS,IAAO,GAAA;AAAC,CAAA;AAEjB,SAAS,YAAe,GAAA;AAC7B,EAAO,OAAA;AAAA,IACL,MAAQ,EAAAA,gBAAA,CAAU,SAAU,CAAA,CAACA,iBAAU,MAAQ,EAAAA,gBAAA,CAAU,OAAQ,CAAAA,gBAAA,CAAU,MAAM,CAAC,CAAC,CAAE,CAAA,GAAA,CAAI,EAAE,CAAA;AAAA,IAC3F,UAAY,EAAAA,gBAAA,CAAU,GAAI,CAAA,GAAA,CAAI,EAAE,CAAA;AAAA,IAChC,UAAY,EAAAA,gBAAA,CAAU,GAAI,CAAA,GAAA,CAAI,EAAE,CAAA;AAAA,IAChC,0BAA4B,EAAAA,gBAAA,CAAU,GAAI,CAAA,GAAA,CAAI,iBAAiB,CAAA;AAAA,IAC/D,oBAAsB,EAAA,QAAA;AAAA,IACtB,uBAAyB,EAAAA,gBAAA,CAAU,IAAK,CAAA,GAAA,CAAI,IAAI,CAAA;AAAA,IAChD,OAAOA,gBAAU,CAAA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