@extclp/vexip-ui
Version:
A Vue 3 UI library, Highly customizability, full TypeScript, performance pretty good
1 lines • 2.85 kB
Source Map (JSON)
{"version":3,"file":"symbol.mjs","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'\n// eslint-disable-next-line @typescript-eslint/ban-types\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":"AAwDkB,IAAAA,sBAAAA,OAChBA,EAAA,cAAc,gBACdA,EAAA,aAAa,eACbA,EAAA,QAAQ,UACRA,EAAA,QAAQ,UACRA,EAAA,SAAS,WACTA,EAAA,UAAU,YACVA,EAAA,aAAa,eACbA,EAAA,QAAQ,SARQA,IAAAA,KAAA,CAAA,CAAA;AAWlB,MAAMC,IAA0C;AAAA,EAC9C,CAAC,gBAAgB,aAAa;AAAA,EAC9B,CAAC,UAAU,QAAQ;AAAA,EACnB,CAAC,WAAW,UAAU;AAAA,EACtB,CAAC,aAAa;AAAA,EACd,CAAC,OAAO;AACV;AAEA,SAASC,IAAI,GAAGC,IAAMF,EAAoB,QAAQC,IAAIC,GAAK,EAAED;AAC3D,EAAAD,EAAoBC,CAAC,IAAI,OAAO,OAAOD,EAAoBC,CAAC,CAAC;AAGlD,MAAAE,IAA4B,OAAO,OAAOH,CAAmB;"}