vexip-ui
Version:
A Vue 3 UI library, Highly customizability, full TypeScript, performance pretty good
1 lines • 2.77 kB
Source Map (JSON)
{"version":3,"file":"symbol.cjs","sources":["../../../components/viewer/symbol.ts"],"sourcesContent":["import type { ClassType, StyleType } from '@vexip-ui/config'\n\nexport type ViewerToolbarPlacement =\n | 'top'\n | 'top-start'\n | 'top-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'left'\n | 'left-start'\n | 'left-end'\n | 'right'\n | 'right-start'\n | 'right-end'\nexport type ViewerPresetAction =\n | 'rotate-right'\n | 'rotate-left'\n | 'flip-x'\n | 'flip-y'\n | 'zoom-in'\n | 'zoom-out'\n | 'full-screen'\n | 'full-screen-exit'\n | 'reset'\nexport type ViewerActionName = ViewerPresetAction | (string & {})\nexport type ViewerActionLayout = ViewerActionName[][]\n\nexport interface ViewerState {\n x: number,\n y: number,\n zoom: number,\n rotate: number,\n flipX: boolean,\n flipY: boolean,\n full: boolean,\n moving: boolean,\n [custom: string]: unknown,\n}\n\nexport interface ViewerToolbarAction {\n name: string,\n process: (state: ViewerState) => void,\n icon?: Record<string, any> | (() => any),\n iconRenderer?: (data: { state: ViewerState }) => any,\n class?: ClassType | ((state: ViewerState) => string),\n title?: string | ((state: ViewerState) => string),\n iconScale?: number | ((state: ViewerState) => number),\n iconStyle?: StyleType | ((state: ViewerState) => StyleType),\n /** @deprecated */\n divided?: boolean | ((state: ViewerState) => boolean),\n hidden?: boolean | ((state: ViewerState) => boolean),\n disabled?: boolean | ((state: ViewerState) => boolean),\n}\n\nexport const enum InternalActionName {\n RotateRight = 'rotate-right',\n RotateLeft = 'rotate-left',\n FlipX = 'flip-x',\n FlipY = 'flip-y',\n ZoomIn = 'zoom-in',\n ZoomOut = 'zoom-out',\n FullScreen = 'full-screen',\n Reset = 'reset',\n}\n\nconst defaultActionLayout: ViewerActionLayout = [\n ['rotate-right', 'rotate-left'],\n ['flip-x', 'flip-y'],\n ['zoom-in', 'zoom-out'],\n ['full-screen'],\n ['reset'],\n]\n\nfor (let i = 0, len = defaultActionLayout.length; i < len; ++i) {\n defaultActionLayout[i] = Object.freeze(defaultActionLayout[i]) as any\n}\n\nexport const viewerDefaultActionLayout = Object.freeze(defaultActionLayout) as ViewerActionLayout\n"],"names":["InternalActionName","defaultActionLayout","i","len","viewerDefaultActionLayout"],"mappings":"gFAuDkB,IAAAA,GAAAA,IAChBA,EAAA,YAAc,eACdA,EAAA,WAAa,cACbA,EAAA,MAAQ,SACRA,EAAA,MAAQ,SACRA,EAAA,OAAS,UACTA,EAAA,QAAU,WACVA,EAAA,WAAa,cACbA,EAAA,MAAQ,QARQA,IAAAA,GAAA,CAAA,CAAA,EAWlB,MAAMC,EAA0C,CAC9C,CAAC,eAAgB,aAAa,EAC9B,CAAC,SAAU,QAAQ,EACnB,CAAC,UAAW,UAAU,EACtB,CAAC,aAAa,EACd,CAAC,OAAO,CACV,EAEA,QAASC,EAAI,EAAGC,EAAMF,EAAoB,OAAQC,EAAIC,EAAK,EAAED,EAC3DD,EAAoBC,CAAC,EAAI,OAAO,OAAOD,EAAoBC,CAAC,CAAC,EAGlD,MAAAE,EAA4B,OAAO,OAAOH,CAAmB"}