@extclp/vexip-ui
Version:
A Vue 3 UI library, Highly customizability, full TypeScript, performance pretty good
1 lines • 2.96 kB
Source Map (JSON)
{"version":3,"file":"symbol.mjs","sources":["../../../components/viewer/symbol.ts"],"sourcesContent":["import type { ClassType, StyleType } from '@vexip-ui/config'\r\n\r\nexport type ViewerToolbarPlacement =\r\n | 'top'\r\n | 'top-start'\r\n | 'top-end'\r\n | 'bottom'\r\n | 'bottom-start'\r\n | 'bottom-end'\r\n | 'left'\r\n | 'left-start'\r\n | 'left-end'\r\n | 'right'\r\n | 'right-start'\r\n | 'right-end'\r\nexport type ViewerPresetAction =\r\n | 'rotate-right'\r\n | 'rotate-left'\r\n | 'flip-x'\r\n | 'flip-y'\r\n | 'zoom-in'\r\n | 'zoom-out'\r\n | 'full-screen'\r\n | 'full-screen-exit'\r\n | 'reset'\r\nexport type ViewerActionName = ViewerPresetAction | (string & {})\r\nexport type ViewerActionLayout = ViewerActionName[][]\r\n\r\nexport interface ViewerState {\r\n x: number,\r\n y: number,\r\n zoom: number,\r\n rotate: number,\r\n flipX: boolean,\r\n flipY: boolean,\r\n full: boolean,\r\n moving: boolean,\r\n [custom: string]: unknown,\r\n}\r\n\r\nexport interface ViewerToolbarAction {\r\n name: string,\r\n process: (state: ViewerState) => void,\r\n icon?: Record<string, any> | (() => any),\r\n iconRenderer?: (data: { state: ViewerState }) => any,\r\n class?: ClassType | ((state: ViewerState) => string),\r\n title?: string | ((state: ViewerState) => string),\r\n iconScale?: number | ((state: ViewerState) => number),\r\n iconStyle?: StyleType | ((state: ViewerState) => StyleType),\r\n /** @deprecated */\r\n divided?: boolean | ((state: ViewerState) => boolean),\r\n hidden?: boolean | ((state: ViewerState) => boolean),\r\n disabled?: boolean | ((state: ViewerState) => boolean),\r\n}\r\n\r\nexport const enum InternalActionName {\r\n RotateRight = 'rotate-right',\r\n RotateLeft = 'rotate-left',\r\n FlipX = 'flip-x',\r\n FlipY = 'flip-y',\r\n ZoomIn = 'zoom-in',\r\n ZoomOut = 'zoom-out',\r\n FullScreen = 'full-screen',\r\n Reset = 'reset',\r\n}\r\n\r\nconst defaultActionLayout: ViewerActionLayout = [\r\n ['rotate-right', 'rotate-left'],\r\n ['flip-x', 'flip-y'],\r\n ['zoom-in', 'zoom-out'],\r\n ['full-screen'],\r\n ['reset'],\r\n]\r\n\r\nfor (let i = 0, len = defaultActionLayout.length; i < len; ++i) {\r\n defaultActionLayout[i] = Object.freeze(defaultActionLayout[i]) as any\r\n}\r\n\r\nexport const viewerDefaultActionLayout = Object.freeze(defaultActionLayout) as ViewerActionLayout\r\n"],"names":["InternalActionName","defaultActionLayout","i","len","viewerDefaultActionLayout"],"mappings":"AAuDkB,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;"}