@flatbiz/antd 4.2.106 → 4.2.108
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/ace-editor-groovy/index.css +0 -0
- package/esm/ace-editor-groovy/index.js +7 -0
- package/esm/ace-editor-groovy/index.js.map +1 -0
- package/esm/ace-editor-java/index.css +0 -0
- package/esm/ace-editor-java/index.js +7 -0
- package/esm/ace-editor-java/index.js.map +1 -0
- package/esm/ace-editor-json/index.css +0 -0
- package/esm/ace-editor-json/index.js +12 -0
- package/esm/ace-editor-json/index.js.map +1 -0
- package/esm/ace-editor-mysql/index.css +0 -0
- package/esm/ace-editor-mysql/index.js +12 -0
- package/esm/ace-editor-mysql/index.js.map +1 -0
- package/esm/ace-editor-xml/index.css +0 -0
- package/esm/ace-editor-xml/index.js +12 -0
- package/esm/ace-editor-xml/index.js.map +1 -0
- package/esm/fba-hooks/index.js +1 -1
- package/esm/fba-hooks/index.js.map +1 -1
- package/esm/index.js +17 -9
- package/esm/json-editor/index.js +1 -1
- package/esm/json-editor/index.js.map +1 -1
- package/esm/pdf/index.css +1 -0
- package/esm/pdf/index.js +6 -0
- package/esm/pdf/index.js.map +1 -0
- package/esm/pdf-preview/index.css +1 -0
- package/esm/pdf-preview/index.js +8 -0
- package/esm/pdf-preview/index.js.map +1 -0
- package/esm/svg-http-view/index.css +1 -0
- package/esm/svg-http-view/index.js +5 -0
- package/esm/svg-http-view/index.js.map +1 -0
- package/index.d.ts +251 -0
- package/package.json +5 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["@flatbiz/antd/src/pdf/context.ts","@flatbiz/antd/src/pdf/document.tsx","@flatbiz/antd/src/pdf/page.tsx","@flatbiz/antd/src/pdf/index.ts"],"sourcesContent":["import { createCtx } from '@wove/react';\n\ntype CtxProps = {\n getPdfInstance: () => any;\n};\n\nexport const [getCtx, CtxProvider] = createCtx<CtxProps>();\n","import { classNames } from '@dimjs/utils';\nimport { Result, Spin } from 'antd';\nimport { ReactElement, ReactNode, useState } from 'react';\nimport { fbaHooks } from '../fba-hooks';\nimport { CtxProvider } from './context';\nimport './style.less';\n\ntype PdfProps = {\n pdfUrl: string;\n onLoadError?: (error: any) => void;\n onLoadSuccess?: (pdfInstance: any) => void;\n children: ReactNode;\n error?: ReactElement | ((error) => ReactElement);\n className?: string;\n};\n\nexport const PdfDocument = (props: PdfProps) => {\n const [pdfInstance, setPdfInstance] = useState<any>();\n const [errorInst, setErrorInst] = useState<any>();\n\n fbaHooks.useEffectCustomAsync(async () => {\n var { pdfjsLib } = globalThis as any;\n pdfjsLib.GlobalWorkerOptions.workerSrc = '//file.40017.cn/tcsk/react/pdf@3.2.146/pdf.worker.min.js';\n try {\n var loadingTask = pdfjsLib.getDocument(props.pdfUrl);\n const pdfInstance = await loadingTask.promise;\n setPdfInstance(pdfInstance);\n props.onLoadSuccess?.(pdfInstance);\n } catch (error: any) {\n console.error(error);\n props.onLoadError?.(error);\n setErrorInst(error);\n }\n }, [props.pdfUrl]);\n\n const getPdfInstance = () => {\n return pdfInstance;\n };\n\n if (errorInst) {\n if (props.error) {\n return typeof props.error === 'function' ? props.error(errorInst) : props.error;\n }\n return <Result status=\"error\" title=\"PDF加载异常\" subTitle={errorInst?.message}></Result>;\n }\n\n if (pdfInstance) {\n return (\n <CtxProvider value={{ getPdfInstance }}>\n <div className={classNames('v-pdf-document', props.className)}>{props.children}</div>\n </CtxProvider>\n );\n }\n\n return (\n <div className=\"v-pdf-document-init-loading\">\n <Spin />\n </div>\n );\n};\n","import { classNames } from '@dimjs/utils';\nimport { hooks } from '@wove/react';\nimport { Spin } from 'antd';\nimport { CSSProperties, ReactNode, useState } from 'react';\nimport { fbaHooks } from '../fba-hooks';\nimport { getCtx } from './context';\nimport './style.less';\n\ntype PdfProps = {\n onRenderSuccess?: (pageInstance: any, pdfInstance: any) => void;\n onRenderError?: (error: any, pdfInstance: any) => void;\n /** pdf page宽度,高度根据比例适配 */\n width?: number;\n /** 缩放比例,默认值:1,配置此参数后 width 属性失效,例如:1、0.6、0.8 */\n scale?: number;\n /** pdf页面上下之间的间隙,默认值10 */\n gap?: number;\n /** 页码 */\n pageNumber: number;\n children?: ReactNode;\n onClick?: (e) => void;\n className?: string;\n style?: CSSProperties;\n};\n\nexport const PdfPage = (props: PdfProps) => {\n const ctx = getCtx();\n const pdfInstance = ctx.getPdfInstance();\n const id = hooks.useId(undefined, `v-pdf-page-${props.pageNumber}`);\n const [spinning, setSpinning] = useState(true);\n\n const numPages = pdfInstance.numPages as number;\n\n fbaHooks.useEffectCustom(() => {\n pdfInstance.getPage(props.pageNumber).then(function (page) {\n const scale = props.scale || 1;\n let viewport = page.getViewport({ scale: scale });\n const customWidth = props.width;\n\n // Prepare canvas using PDF page dimensions\n const canvas = document.getElementById(id) as any;\n const context = canvas.getContext('2d');\n\n if (customWidth && !props.scale) {\n const ratio = customWidth / viewport.width;\n viewport = page.getViewport({ scale: ratio });\n }\n\n canvas.width = viewport.width * 2;\n canvas.height = viewport.height * 2;\n\n canvas.style.width = viewport.width + 'px';\n canvas.style.height = viewport.height + 'px';\n // Render PDF page into canvas context\n const renderContext = {\n transform: [2, 0, 0, 2, 0, 0],\n canvasContext: context,\n viewport: viewport,\n };\n const renderTask = page.render(renderContext);\n renderTask.promise\n .then(function () {\n props.onRenderSuccess?.(\n {\n width: viewport.width,\n height: viewport.height,\n scale: scale,\n pageNumber: props.pageNumber,\n page,\n },\n pdfInstance,\n );\n setSpinning(false);\n })\n .catch((error: any) => {\n console.error(error?.message);\n props.onRenderError?.(error, pdfInstance);\n setSpinning(false);\n });\n });\n }, [pdfInstance, props.scale, props.pageNumber]);\n\n const gap = typeof props.gap === 'undefined' ? 10 : props.gap;\n\n const style = numPages !== props.pageNumber ? { marginBottom: gap } : {};\n\n return (\n <div\n className={classNames('v-pdf-page', props.className)}\n style={{\n ...style,\n ...props.style,\n }}\n onClick={props.onClick}\n >\n <Spin spinning={spinning}>\n <canvas id={id}></canvas>\n </Spin>\n {props.children}\n </div>\n );\n};\n","import { PdfDocument } from './document';\nimport { PdfPage } from './page';\n\n/**\n * pdf预览\n * ```\n * 使用方式:在cdn.ts中引入 '//file.40017.cn/tcsk/react/pdf@3.2.146/pdf.min.js'\n * Git: https://github.com/mozilla/pdfjs-dist/tree/master\n * Demo: https://fex.qa.tcshuke.com/docs/admin/main/file/pdf\n * Demo: https://fex.qa.tcshuke.com/docs/admin/main/file/pdf-seal\n * ```\n */\nexport const Pdf = {\n Document: PdfDocument,\n Page: PdfPage,\n};\n"],"names":["_createCtx","_createCtx2","getCtx","CtxProvider","PdfDocument","props","_useState","useState","pdfInstance","setPdfInstance","_useState2","errorInst","setErrorInst","fbaHooks","useEffectCustomAsync","Promise","$return","$error","_ref","pdfjsLib","loadingTask","_pdfInstance","globalThis","GlobalWorkerOptions","workerSrc","$Try_1_Post","$boundEx","$Try_1_Catch","error","console","onLoadError","getDocument","pdfUrl","resolve","promise","then","$await_2","onLoadSuccess","getPdfInstance","_jsx","Result","status","title","subTitle","message","value","children","className","_classNames","Spin","PdfPage","ctx","id","_hooks","useId","undefined","pageNumber","spinning","setSpinning","numPages","useEffectCustom","getPage","page","scale","viewport","getViewport","customWidth","width","canvas","document","getElementById","context","getContext","ratio","height","style","renderContext","transform","canvasContext","renderTask","render","onRenderSuccess","catch","onRenderError","gap","marginBottom","_jsxs","_extends","onClick","Pdf","Document","Page"],"mappings":";4eAMO,IAAAA,EAA8BC,IAAvBC,EAAMF,EAAA,GAAEG,EAAWH,EAAA,GCU1B,IAAMI,EAAc,SAAdA,EAAeC,GAC1B,IAAAC,EAAsCC,IAA/BC,EAAWF,EAAA,GAAEG,EAAcH,EAAA,GAClC,IAAAI,EAAkCH,IAA3BI,EAASD,EAAA,GAAEE,EAAYF,EAAA,GAE9BG,EAASC,sBAAqB,WAAA,OAAA,IAAAC,SAAA,SAAAC,EAAAC,GAAA,IAAAC,EAAAC,EAItBC,EACEC,EAJRH,EAAmBI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ACJ,GACF,GAAG,CAAClD,EAAaH,EAAM0D,MAAO1D,EAAMmD,aAEpC,IAAM4B,SAAa/E,EAAM+E,MAAQ,YAAc,GAAK/E,EAAM+E,IAE1D,IAAMT,EAAQhB,IAAatD,EAAMmD,WAAa,CAAE6B,aAAcD,GAAQ,GAEtE,OACEE,EAAA,MAAA,CACEvC,UAAWC,EAAW,aAAc3C,EAAM0C,WAC1C4B,MAAKY,EACAZ,CAAAA,EAAAA,EACAtE,EAAMsE,OAEXa,QAASnF,EAAMmF,QAAQ1C,SAAA,CAEvBP,EAACU,EAAI,CAACQ,SAAUA,EAASX,SACvBP,EAAA,SAAA,CAAQa,GAAIA,MAEb/C,EAAMyC,WAGb,ECzFO,IAAM2C,EAAM,CACjBC,SAAUtF,EACVuF,KAAMzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.v-pdf-preview-document{display:flex;height:100%;overflow:hidden}.v-pdf-preview-navigation{background-color:#ececec;border-radius:5px;overflow-y:auto;text-align:center}.v-pdf-preview-content{background-color:#fff;flex:1;overflow-y:auto}.v-pdf-page.v-pdf-preview-navigation-page{border:2px solid transparent;border-radius:5px;cursor:pointer;overflow:hidden}.v-pdf-page.v-pdf-preview-navigation-page canvas{box-shadow:none}.v-pdf-preview-navigation-active .v-pdf-preview-navigation-page{border:2px solid #1890ff;opacity:1}.v-pdf-preview-navigation-pagination{color:#858585;margin-bottom:15px;margin-top:6px}.v-pdf-preview-navigation>.roll-location-in-view{align-items:center;display:flex;flex-direction:column;height:calc(100% - 10px);margin-top:10px}.v-pdf-page canvas{box-shadow:0 10px 10px 10px rgba(0,0,0,.03)}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import './../pdf/index.css';
|
|
3
|
+
import './../fba-hooks/index.css';
|
|
4
|
+
import './../roll-location-in-view/index.css';
|
|
5
|
+
import './index.css';
|
|
6
|
+
/*! @flatjs/forge MIT @flatbiz/antd */
|
|
7
|
+
import{classNames as e}from"@dimjs/utils/cjs/class-names";import{hooks as a}from"@wove/react/cjs/hooks";import{generateIntArray as r}from"@flatbiz/utils";import{Result as i}from"antd";import{useState as n,useRef as t,useMemo as o}from"react";import{Pdf as c}from"../pdf/index.js";import{RollLocationInView as v}from"../roll-location-in-view/index.js";import{jsx as s,jsxs as l}from"react/jsx-runtime";import"../fba-hooks/index.js";import"../_rollupPluginBabelHelpers-a0769acd.js";import"@dimjs/lang/cjs/is-array";import"../use-responsive-point-21b8c601.js";import"@wove/react/cjs/create-ctx";import"ahooks";var p=function a(i){var n=typeof i.navigationWidth==="undefined"?200:i.navigationWidth;return s(v,{activeKey:""+i.activeNumber,behavior:"auto",style:{width:n},renderList:r(1,i.numPages+1).map((function(a){return{activeKey:""+a,render:l("div",{className:e("v-pdf-preview-navigation-content",{"v-pdf-preview-navigation-active":a===i.activeNumber}),children:[s(c.Page,{pageNumber:a,gap:0,scale:i.scale||.2,className:e("v-pdf-preview-navigation-page"),onClick:function e(){var r;i.onChangeActiveNumber(a);(r=document.querySelector(".v-pdf-preview-content-page-"+a))==null?void 0:r.scrollIntoView({behavior:"auto"})}}),s("div",{className:"v-pdf-preview-navigation-pagination",children:a})]},a)}}))})};var u=function v(u){var m=n(0),d=m[0],f=m[1];var g=t(null);var h=n(1),N=h[0],b=h[1];var w=n(0),j=w[0],y=w[1];var P=10;var x=a.useCallbackRef((function(e){f(e.numPages)}));var k=o((function(){if(!d)return[];var e=[];r(0,d).forEach((function(a){console.log(a);if(a===0){e.push([0,j])}else{var r=j*a+a*P;e.push([r,r+j])}}));return e}),[d,j]);var C=function e(a){var r;var i=a.target.scrollTop;var n=(r=g.current)==null?void 0:r.clientHeight;for(var t=0;t<k.length;t++){var o=k[t];if(o[1]-i>=n/2){b(t+1);break}}};return l(c.Document,{pdfUrl:u.pdfUrl,onLoadSuccess:x,error:s(i,{status:"500",title:"PDF加载异常",subTitle:"PDF地址:"+u.pdfUrl}),className:e("v-pdf-preview-document",u.className),children:[!u.hiddenNavigation?s("div",{className:"v-pdf-preview-navigation",children:s(p,{numPages:d,activeNumber:N,onChangeActiveNumber:b,scale:u.navigationScale,navigationWidth:u.navigationWidth})}):null,s("div",{className:"v-pdf-preview-content",onScroll:C,ref:g,children:d>0?r(1,d+1).map((function(a){return s(c.Page,{pageNumber:a,scale:u.scale,gap:P,className:e("v-pdf-preview-content-page-"+a),onRenderSuccess:function e(a){var r=Math.floor(a.height);y(r)},style:{display:"flex",justifyContent:"center"}},a)})):null})]})};export{u as PdfPreview};
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["@flatbiz/antd/src/pdf-preview/navigation.tsx","@flatbiz/antd/src/pdf-preview/preview.tsx"],"sourcesContent":["import { classNames } from '@dimjs/utils';\nimport { generateIntArray } from '@flatbiz/utils';\nimport { Pdf } from '../pdf';\nimport { RollLocationInView } from '../roll-location-in-view';\n\ntype NavigationProps = {\n numPages: number;\n activeNumber: number;\n onChangeActiveNumber: (active: number) => void;\n scale?: number;\n navigationWidth?: number;\n};\nexport const Navigation = (props: NavigationProps) => {\n const navigationWidth = typeof props.navigationWidth === 'undefined' ? 200 : props.navigationWidth;\n return (\n <RollLocationInView\n activeKey={`${props.activeNumber}`}\n behavior=\"auto\"\n style={{ width: navigationWidth }}\n renderList={generateIntArray(1, props.numPages + 1).map((item) => {\n return {\n activeKey: `${item}`,\n render: (\n <div\n key={item}\n className={classNames('v-pdf-preview-navigation-content', {\n 'v-pdf-preview-navigation-active': item === props.activeNumber,\n })}\n >\n <Pdf.Page\n pageNumber={item}\n gap={0}\n scale={props.scale || 0.2}\n className={classNames('v-pdf-preview-navigation-page')}\n onClick={() => {\n props.onChangeActiveNumber(item);\n document\n .querySelector(`.v-pdf-preview-content-page-${item}`)\n ?.scrollIntoView({ behavior: 'auto' });\n }}\n ></Pdf.Page>\n\n <div className=\"v-pdf-preview-navigation-pagination\">{item}</div>\n </div>\n ),\n };\n })}\n />\n );\n};\n","import { classNames } from '@dimjs/utils';\nimport { generateIntArray } from '@flatbiz/utils';\nimport { hooks } from '@wove/react';\nimport { Result } from 'antd';\nimport { useMemo, useRef, useState } from 'react';\nimport { Pdf } from '../pdf';\nimport { Navigation } from './navigation';\nimport './style.less';\n\nexport type PdfPreviewProps = {\n pdfUrl: string;\n /** 缩放比例,默认值:1 */\n scale?: number;\n className?: string;\n /** 导航pdf,缩放比例,默认值:0.2 */\n navigationScale?: number;\n /** 隐藏导航栏 */\n hiddenNavigation?: boolean;\n /** 导航栏宽度,默认值:200 */\n navigationWidth?: number;\n};\n\n/**\n * pdf预览\n * ```\n * 使用方式:在cdn.ts中引入 '//file.40017.cn/tcsk/react/pdf@3.2.146/pdf.min.js'\n * Git: https://github.com/mozilla/pdfjs-dist/tree/master\n * Demo: https://fex.qa.tcshuke.com/docs/admin/main/file/pdf\n * Demo: https://fex.qa.tcshuke.com/docs/admin/main/file/pdf-seal\n * ```\n */\nexport const PdfPreview = (props: PdfPreviewProps) => {\n const [numPages, setNumPages] = useState(0);\n const dpfDoucmentRef = useRef<HTMLDivElement>(null);\n const [activePagination, setActivePagination] = useState(1);\n const [pdfPageHeight, setPdfPageHeight] = useState(0);\n\n const pageGap = 10;\n\n const onDocumentLoadSuccess = hooks.useCallbackRef((inst) => {\n setNumPages(inst.numPages);\n });\n\n /** 计算 page 在文档流中的高度范围,包含竖直方向间距 */\n const pdfPageListHeightScope = useMemo(() => {\n if (!numPages) return [];\n let pageHeightScopeList: number[][] = [];\n generateIntArray(0, numPages).forEach((item) => {\n console.log(item);\n if (item === 0) {\n pageHeightScopeList.push([0, pdfPageHeight]);\n } else {\n const x = pdfPageHeight * item + item * pageGap;\n pageHeightScopeList.push([x, x + pdfPageHeight]);\n }\n });\n return pageHeightScopeList;\n }, [numPages, pdfPageHeight]);\n\n const onDocumentCenterScroll = (event) => {\n const scrollTop = event.target.scrollTop;\n const scrollHeight = dpfDoucmentRef.current?.clientHeight as number;\n for (let index = 0; index < pdfPageListHeightScope.length; index++) {\n const element = pdfPageListHeightScope[index];\n if (element[1] - scrollTop >= scrollHeight / 2) {\n setActivePagination(index + 1);\n break;\n }\n }\n };\n\n return (\n <Pdf.Document\n pdfUrl={props.pdfUrl}\n onLoadSuccess={onDocumentLoadSuccess}\n error={<Result status=\"500\" title=\"PDF加载异常\" subTitle={`PDF地址:${props.pdfUrl}`} />}\n className={classNames('v-pdf-preview-document', props.className)}\n >\n {!props.hiddenNavigation ? (\n <div className=\"v-pdf-preview-navigation\">\n <Navigation\n numPages={numPages}\n activeNumber={activePagination}\n onChangeActiveNumber={setActivePagination}\n scale={props.navigationScale}\n navigationWidth={props.navigationWidth}\n />\n </div>\n ) : null}\n\n <div className=\"v-pdf-preview-content\" onScroll={onDocumentCenterScroll} ref={dpfDoucmentRef}>\n {numPages > 0\n ? generateIntArray(1, numPages + 1).map((item) => {\n return (\n <Pdf.Page\n key={item}\n pageNumber={item}\n scale={props.scale}\n gap={pageGap}\n className={classNames(`v-pdf-preview-content-page-${item}`)}\n onRenderSuccess={(node) => {\n const h = Math.floor(node.height);\n setPdfPageHeight(h);\n }}\n style={{ display: 'flex', justifyContent: 'center' }}\n ></Pdf.Page>\n );\n })\n : null}\n </div>\n </Pdf.Document>\n );\n};\n"],"names":["Navigation","props","navigationWidth","_jsx","RollLocationInView","activeKey","activeNumber","behavior","style","width","renderList","generateIntArray","numPages","map","item","render","_jsxs","className","_classNames","children","Pdf","Page","pageNumber","gap","scale","onClick","_document$querySelect","onChangeActiveNumber","document","querySelector","scrollIntoView","PdfPreview","_useState","useState","setNumPages","dpfDoucmentRef","useRef","_useState2","activePagination","setActivePagination","_useState3","pdfPageHeight","setPdfPageHeight","pageGap","onDocumentLoadSuccess","_hooks","useCallbackRef","inst","pdfPageListHeightScope","useMemo","pageHeightScopeList","forEach","console","log","push","x","onDocumentCenterScroll","event","_dpfDoucmentRef$curre","scrollTop","target","scrollHeight","current","clientHeight","index","length","element","Document","pdfUrl","onLoadSuccess","error","Result","status","title","subTitle","hiddenNavigation","navigationScale","onScroll","ref","onRenderSuccess","node","h","Math","floor","height","display","justifyContent"],"mappings":";+lBAYO,IAAMA,EAAa,SAAbA,EAAcC,GACzB,IAAMC,SAAyBD,EAAMC,kBAAoB,YAAc,IAAMD,EAAMC,gBACnF,OACEC,EAACC,EAAkB,CACjBC,UAAS,GAAKJ,EAAMK,aACpBC,SAAS,OACTC,MAAO,CAAEC,MAAOP,GAChBQ,WAAYC,EAAiB,EAAGV,EAAMW,SAAW,GAAGC,KAAI,SAACC,GACvD,MAAO,CACLT,aAAcS,EACdC,OACEC,EAAA,MAAA,CAEEC,UAAWC,EAAW,mCAAoC,CACxD,kCAAmCJ,IAASb,EAAMK,eACjDa,SAEHhB,CAAAA,EAACiB,EAAIC,KAAI,CACPC,WAAYR,EACZS,IAAK,EACLC,MAAOvB,EAAMuB,OAAS,GACtBP,UAAWC,EAAW,iCACtBO,QAAS,SAAAA,IAAM,IAAAC,EACbzB,EAAM0B,qBAAqBb,IAC3BY,EAAAE,SACGC,cAAa,+BAAgCf,KADhDY,UAAAA,EAAAA,EAEII,eAAe,CAAEvB,SAAU,QACjC,IAGFJ,EAAA,MAAA,CAAKc,UAAU,sCAAqCE,SAAEL,MAlBjDA,QAyBnB,MClBaiB,EAAa,SAAbA,EAAc9B,GACzB,IAAA+B,EAAgCC,EAAS,GAAlCrB,EAAQoB,EAAA,GAAEE,EAAWF,EAAA,GAC5B,IAAMG,EAAiBC,EAAuB,MAC9C,IAAAC,EAAgDJ,EAAS,GAAlDK,EAAgBD,EAAA,GAAEE,EAAmBF,EAAA,GAC5C,IAAAG,EAA0CP,EAAS,GAA5CQ,EAAaD,EAAA,GAAEE,EAAgBF,EAAA,GAEtC,IAAMG,EAAU,GAEhB,IAAMC,EAAwBC,EAAMC,gBAAe,SAACC,GAClDb,EAAYa,EAAKnC,SACnB,IAGA,IAAMoC,EAAyBC,GAAQ,WACrC,IAAKrC,EAAU,MAAO,GACtB,IA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oB,EACL1B,UAAWC,EAAyCJ,8BAAAA,GACpDiE,gBAAiB,SAAAA,EAACC,GAChB,IAAMC,EAAIC,KAAKC,MAAMH,EAAKI,QAC1B1C,EAAiBuC,EACjB,EACFzE,MAAO,CAAE6E,QAAS,OAAQC,eAAgB,WATrCxE,EAYV,IACD,SAIZ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.http-svg-view{line-height:normal;margin:0 auto;overflow:hidden}.hsv-content{transform:translateX(-200px)}.hsv-content,.hsv-content img{height:100%;width:100%}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import './index.css';
|
|
3
|
+
/*! @flatjs/forge MIT @flatbiz/antd */
|
|
4
|
+
import{classNames as t}from"@dimjs/utils/cjs/class-names";import{isHttpUri as s}from"@flatbiz/utils";import{jsx as i}from"react/jsx-runtime";var r=function r(a){var e=a.color||"#555";var c=s(a.svgPath)?a.svgPath:"https://file.40017.cn/tcsk/alicon/"+a.svgPath+".svg";return i("div",{className:t("http-svg-view",a.className),style:{width:a.width||"100%",height:a.height||"100%"},children:i("div",{className:"hsv-content",style:{filter:"drop-shadow("+e+" 200px 0)"},children:i("img",{src:c})})})};export{r as SvgHttpView};
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["@flatbiz/antd/src/svg-http-view/svg.tsx"],"sourcesContent":["import { classNames } from '@dimjs/utils';\nimport { isHttpUri } from '@flatbiz/utils';\nimport './style.less';\nexport type SvgHttpViewProps = {\n /**\n * svg地址\n * ```\n * 1. 可传http绝对路径\n * 2. 可传ionic组图标,例如:ionic/alarm-outline\n * 3. 可传lucide组图标,例如:lucide/crosshair\n *\n * 查询ionic、lucide图标 https://fex.qa.tcshuke.com/docs/admin/resources/icons\n * ```\n */\n svgPath: string;\n /** 默认:100% */\n width?: number;\n /** 默认:100% */\n height?: number;\n /** svg 颜色, 默认:#555 */\n color?: string;\n className?: string;\n};\n\n/**\n * http svg地址解析,可自定义颜色\n * ```\n * 1. 内置ionic、lucide组图标基础路径\n * 2. 可传自定义http绝对路径svg数据\n * ```\n */\nexport const SvgHttpView = (props: SvgHttpViewProps) => {\n const color = props.color || '#555';\n\n const srcLink = isHttpUri(props.svgPath)\n ? props.svgPath\n : `https://file.40017.cn/tcsk/alicon/${props.svgPath}.svg`;\n\n return (\n <div\n className={classNames('http-svg-view', props.className)}\n style={{ width: props.width || '100%', height: props.height || '100%' }}\n >\n <div className=\"hsv-content\" style={{ filter: `drop-shadow(${color} 200px 0)` }}>\n <img src={srcLink} />\n </div>\n </div>\n );\n};\n"],"names":["SvgHttpView","props","color","srcLink","isHttpUri","svgPath","_jsx","className","_classNames","style","width","height","children","filter","src"],"mappings":";iJA+BaA,EAAc,SAAdA,EAAeC,GAC1B,IAAMC,EAAQD,EAAMC,OAAS,OAE7B,IAAMC,EAAUC,EAAUH,EAAMI,SAC5BJ,EAAMI,QAAO,qCACwBJ,EAAMI,QAAa,OAE5D,OACEC,EAAA,MAAA,CACEC,UAAWC,EAAW,gBAAiBP,EAAMM,WAC7CE,MAAO,CAAEC,MAAOT,EAAMS,OAAS,OAAQC,OAAQV,EAAMU,QAAU,QAASC,SAExEN,EAAA,MAAA,CAAKC,UAAU,cAAcE,MAAO,CAAEI,sBAAuBX,EAAK,aAAcU,SAC9EN,EAAA,MAAA,CAAKQ,IAAKX,OAIlB"}
|
package/index.d.ts
CHANGED
|
@@ -21,6 +21,175 @@ import { IAceEditorProps } from 'react-ace';
|
|
|
21
21
|
import { SplitProps } from 'react-split';
|
|
22
22
|
import { Editor as TinyMCEEditor } from 'tinymce';
|
|
23
23
|
|
|
24
|
+
export type AceEditorGroovyProps = Omit<IAceEditorProps, "mode" | "value" | "onChange" | "theme"> & {
|
|
25
|
+
/** 编辑器高度,默认值:100%,可输入值例如 300px、100% */
|
|
26
|
+
height?: string;
|
|
27
|
+
value?: string | TPlainObject | TPlainObject[];
|
|
28
|
+
onChange?: (value?: string | TPlainObject | TPlainObject[]) => void;
|
|
29
|
+
/** 配置输入自动提示关键字 */
|
|
30
|
+
autoCompleterList?: {
|
|
31
|
+
name: string;
|
|
32
|
+
desc?: string;
|
|
33
|
+
}[];
|
|
34
|
+
/**
|
|
35
|
+
* 编辑器主题配置,例如:github、terminal、xcode
|
|
36
|
+
* ```
|
|
37
|
+
* 1. 顶部引入 import 'ace-builds/src-noconflict/theme-xxxx';
|
|
38
|
+
* 2. 配置 theme = xxxx
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
theme?: string;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* groovy编辑器
|
|
45
|
+
* ```
|
|
46
|
+
* 1. 受控组件,需要使用value、onChange配合显示数据
|
|
47
|
+
* 2. heigth 默认为100%,如果外层无高度,需要自定义设置height属性
|
|
48
|
+
* 3. 通过 autoCompleterList 配置自动提示关键字
|
|
49
|
+
* 4. 通过 hiddenVerifyBtn、hiddenFormatterBtn可隐藏底部操作按钮
|
|
50
|
+
* 5. 通过 theme 配置编辑器主题,例如:
|
|
51
|
+
* 5.1 顶部引入 import 'ace-builds/src-noconflict/theme-xxxx';
|
|
52
|
+
* 5.2 配置 theme = xxxx
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export declare const AceEditorGroovy: (props: AceEditorGroovyProps) => import("react/jsx-runtime").JSX.Element;
|
|
56
|
+
export type AceEditorJavaProps = Omit<IAceEditorProps, "mode" | "value" | "onChange" | "theme"> & {
|
|
57
|
+
/** 编辑器高度,默认值:100%,可输入值例如 300px、100% */
|
|
58
|
+
height?: string;
|
|
59
|
+
value?: string | TPlainObject | TPlainObject[];
|
|
60
|
+
onChange?: (value?: string | TPlainObject | TPlainObject[]) => void;
|
|
61
|
+
/** 配置输入自动提示关键字 */
|
|
62
|
+
autoCompleterList?: {
|
|
63
|
+
name: string;
|
|
64
|
+
desc?: string;
|
|
65
|
+
}[];
|
|
66
|
+
/**
|
|
67
|
+
* 编辑器主题配置,例如:github、terminal、xcode
|
|
68
|
+
* ```
|
|
69
|
+
* 1. 顶部引入 import 'ace-builds/src-noconflict/theme-xxxx';
|
|
70
|
+
* 2. 配置 theme = xxxx
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
theme?: string;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* java编辑器
|
|
77
|
+
* ```
|
|
78
|
+
* 1. 受控组件,需要使用value、onChange配合显示数据
|
|
79
|
+
* 2. heigth 默认为100%,如果外层无高度,需要自定义设置height属性
|
|
80
|
+
* 3. 通过 autoCompleterList 配置自动提示关键字
|
|
81
|
+
* 4. 通过 hiddenVerifyBtn、hiddenFormatterBtn可隐藏底部操作按钮
|
|
82
|
+
* 5. 通过 theme 配置编辑器主题,例如:
|
|
83
|
+
* 5.1 顶部引入 import 'ace-builds/src-noconflict/theme-xxxx';
|
|
84
|
+
* 5.2 配置 theme = xxxx
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
export declare const AceEditorJava: (props: AceEditorJavaProps) => import("react/jsx-runtime").JSX.Element;
|
|
88
|
+
export type AceEditorJsonProps = Omit<IAceEditorProps, "mode" | "value" | "onChange" | "theme"> & {
|
|
89
|
+
/** 编辑器高度,默认值:100%,可输入值例如 300px、100% */
|
|
90
|
+
height?: string;
|
|
91
|
+
value?: string | TPlainObject | TPlainObject[];
|
|
92
|
+
onChange?: (value?: string | TPlainObject | TPlainObject[]) => void;
|
|
93
|
+
/** 配置输入自动提示关键字 */
|
|
94
|
+
autoCompleterList?: {
|
|
95
|
+
name: string;
|
|
96
|
+
desc?: string;
|
|
97
|
+
}[];
|
|
98
|
+
/** 是否隐藏【验证数据】按钮 */
|
|
99
|
+
hiddenVerifyBtn?: boolean;
|
|
100
|
+
/** 是否隐藏内部验证异常文案 */
|
|
101
|
+
hiddenErrorMsg?: boolean;
|
|
102
|
+
/**
|
|
103
|
+
* 编辑器主题配置,例如:github、terminal、xcode
|
|
104
|
+
* ```
|
|
105
|
+
* 1. 顶部引入 import 'ace-builds/src-noconflict/theme-xxxx';
|
|
106
|
+
* 2. 配置 theme = xxxx
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
109
|
+
theme?: string;
|
|
110
|
+
/** 底部额外布局 */
|
|
111
|
+
footerExtraRender?: (children: ReactElement) => ReactElement;
|
|
112
|
+
footerStyle?: CSSProperties;
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* Json编辑器
|
|
116
|
+
* ```
|
|
117
|
+
* 1. 受控组件,需要使用value、onChange配合显示数据
|
|
118
|
+
* 2. heigth 默认为100%,如果外层无高度,需要自定义设置height属性
|
|
119
|
+
* 3. 通过 autoCompleterList 配置自动提示关键字
|
|
120
|
+
* 4. 通过 hiddenVerifyBtn 配置隐藏底部操作按钮
|
|
121
|
+
* 5. 通过 theme 配置编辑器主题,例如:
|
|
122
|
+
* 5.1 顶部引入 import 'ace-builds/src-noconflict/theme-xxxx';
|
|
123
|
+
* 5.2 配置 theme = xxxx
|
|
124
|
+
* ```
|
|
125
|
+
*/
|
|
126
|
+
export declare const AceEditorJson: (props: AceEditorJsonProps) => import("react/jsx-runtime").JSX.Element;
|
|
127
|
+
export type AceEditorMysqlProps = Omit<IAceEditorProps, "theme" | "mode" | "value" | "onChange"> & {
|
|
128
|
+
/** 编辑器高度,默认值:100%,可输入值例如 300px、100% */
|
|
129
|
+
height?: string;
|
|
130
|
+
value?: string;
|
|
131
|
+
onChange?: (value?: string) => void;
|
|
132
|
+
/** 配置输入自动提示关键字 */
|
|
133
|
+
autoCompleterList?: {
|
|
134
|
+
name: string;
|
|
135
|
+
desc?: string;
|
|
136
|
+
}[];
|
|
137
|
+
/** 隐藏【美化】按钮 */
|
|
138
|
+
hiddenFormatterBtn?: boolean;
|
|
139
|
+
/**
|
|
140
|
+
* 编辑器主题配置,例如:github、terminal、xcode
|
|
141
|
+
* ```
|
|
142
|
+
* 1. 顶部引入 import 'ace-builds/src-noconflict/theme-xxxx';
|
|
143
|
+
* 2. 配置 theme = xxxx
|
|
144
|
+
* ```
|
|
145
|
+
*/
|
|
146
|
+
theme?: string;
|
|
147
|
+
/** 底部额外布局 */
|
|
148
|
+
footerExtraRender?: (children: ReactElement) => ReactElement;
|
|
149
|
+
footerStyle?: CSSProperties;
|
|
150
|
+
};
|
|
151
|
+
export declare const AceEditorMysql: (props: AceEditorMysqlProps) => import("react/jsx-runtime").JSX.Element;
|
|
152
|
+
export type AceEditorXmlProps = Omit<IAceEditorProps, "mode" | "value" | "onChange" | "theme"> & {
|
|
153
|
+
/** 编辑器高度,默认值:100%,可输入值例如 300px、100% */
|
|
154
|
+
height?: string;
|
|
155
|
+
value?: string | TPlainObject | TPlainObject[];
|
|
156
|
+
onChange?: (value?: string | TPlainObject | TPlainObject[]) => void;
|
|
157
|
+
/** 配置输入自动提示关键字 */
|
|
158
|
+
autoCompleterList?: {
|
|
159
|
+
name: string;
|
|
160
|
+
desc?: string;
|
|
161
|
+
}[];
|
|
162
|
+
/** 隐藏【验证数据】按钮 */
|
|
163
|
+
hiddenVerifyBtn?: boolean;
|
|
164
|
+
/** 是否隐藏内部验证异常文案 */
|
|
165
|
+
hiddenErrorMsg?: boolean;
|
|
166
|
+
/** 隐藏【美化】按钮 */
|
|
167
|
+
hiddenFormatterBtn?: boolean;
|
|
168
|
+
/**
|
|
169
|
+
* 编辑器主题配置,例如:github、terminal、xcode
|
|
170
|
+
* ```
|
|
171
|
+
* 1. 顶部引入 import 'ace-builds/src-noconflict/theme-xxxx';
|
|
172
|
+
* 2. 配置 theme = xxxx
|
|
173
|
+
* ```
|
|
174
|
+
*/
|
|
175
|
+
theme?: string;
|
|
176
|
+
/** 底部额外布局 */
|
|
177
|
+
footerExtraRender?: (children: ReactElement) => ReactElement;
|
|
178
|
+
footerStyle?: CSSProperties;
|
|
179
|
+
};
|
|
180
|
+
/**
|
|
181
|
+
* xml编辑器
|
|
182
|
+
* ```
|
|
183
|
+
* 1. 受控组件,需要使用value、onChange配合显示数据
|
|
184
|
+
* 2. heigth 默认为100%,如果外层无高度,需要自定义设置height属性
|
|
185
|
+
* 3. 通过 autoCompleterList 配置自动提示关键字
|
|
186
|
+
* 4. 通过 hiddenVerifyBtn、hiddenFormatterBtn可隐藏底部操作按钮
|
|
187
|
+
* 5. 通过 theme 配置编辑器主题,例如:
|
|
188
|
+
* 5.1 顶部引入 import 'ace-builds/src-noconflict/theme-xxxx';
|
|
189
|
+
* 5.2 配置 theme = xxxx
|
|
190
|
+
* ```
|
|
191
|
+
*/
|
|
192
|
+
export declare const AceEditorXml: (props: AceEditorXmlProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
193
|
export type AlertWrapperProps = AlertProps & {
|
|
25
194
|
size?: "small" | "default" | "large";
|
|
26
195
|
};
|
|
@@ -2475,6 +2644,7 @@ export type JsonEditorProps = Omit<IAceEditorProps, "onLoad" | "mode" | "value"
|
|
|
2475
2644
|
};
|
|
2476
2645
|
/**
|
|
2477
2646
|
* Json编辑器
|
|
2647
|
+
* @deprecated 已过期,请使用 AceEditorJson 组件
|
|
2478
2648
|
* ```
|
|
2479
2649
|
* 1. 受控组件,需要使用value、onChange配合显示数据
|
|
2480
2650
|
* 2. heigth 默认为100%,如果外层无高度,需要自定义设置height属性
|
|
@@ -2634,6 +2804,59 @@ export declare const Page404: (props: Page404Props) => import("react/jsx-runtime
|
|
|
2634
2804
|
* @returns
|
|
2635
2805
|
*/
|
|
2636
2806
|
export declare const PaginationWrapper: (props: PaginationProps) => import("react/jsx-runtime").JSX.Element;
|
|
2807
|
+
/**
|
|
2808
|
+
* pdf预览
|
|
2809
|
+
* ```
|
|
2810
|
+
* 使用方式:在cdn.ts中引入 '//file.40017.cn/tcsk/react/pdf@3.2.146/pdf.min.js'
|
|
2811
|
+
* Git: https://github.com/mozilla/pdfjs-dist/tree/master
|
|
2812
|
+
* Demo: https://fex.qa.tcshuke.com/docs/admin/main/file/pdf
|
|
2813
|
+
* Demo: https://fex.qa.tcshuke.com/docs/admin/main/file/pdf-seal
|
|
2814
|
+
* ```
|
|
2815
|
+
*/
|
|
2816
|
+
export declare const Pdf: {
|
|
2817
|
+
Document: (props: {
|
|
2818
|
+
pdfUrl: string;
|
|
2819
|
+
onLoadError?: ((error: any) => void) | undefined;
|
|
2820
|
+
onLoadSuccess?: ((pdfInstance: any) => void) | undefined;
|
|
2821
|
+
children: import("react").ReactNode;
|
|
2822
|
+
error?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | ((error: any) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) | undefined;
|
|
2823
|
+
className?: string | undefined;
|
|
2824
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
2825
|
+
Page: (props: {
|
|
2826
|
+
onRenderSuccess?: ((pageInstance: any, pdfInstance: any) => void) | undefined;
|
|
2827
|
+
onRenderError?: ((error: any, pdfInstance: any) => void) | undefined;
|
|
2828
|
+
width?: number | undefined;
|
|
2829
|
+
scale?: number | undefined;
|
|
2830
|
+
gap?: number | undefined;
|
|
2831
|
+
pageNumber: number;
|
|
2832
|
+
children?: import("react").ReactNode;
|
|
2833
|
+
onClick?: ((e: any) => void) | undefined;
|
|
2834
|
+
className?: string | undefined;
|
|
2835
|
+
style?: import("react").CSSProperties | undefined;
|
|
2836
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
2837
|
+
};
|
|
2838
|
+
export type PdfPreviewProps = {
|
|
2839
|
+
pdfUrl: string;
|
|
2840
|
+
/** 缩放比例,默认值:1 */
|
|
2841
|
+
scale?: number;
|
|
2842
|
+
className?: string;
|
|
2843
|
+
/** 导航pdf,缩放比例,默认值:0.2 */
|
|
2844
|
+
navigationScale?: number;
|
|
2845
|
+
/** 隐藏导航栏 */
|
|
2846
|
+
hiddenNavigation?: boolean;
|
|
2847
|
+
/** 导航栏宽度,默认值:200 */
|
|
2848
|
+
navigationWidth?: number;
|
|
2849
|
+
};
|
|
2850
|
+
/**
|
|
2851
|
+
* pdf预览
|
|
2852
|
+
* ```
|
|
2853
|
+
* 使用方式:在cdn.ts中引入 '//file.40017.cn/tcsk/react/pdf@3.2.146/pdf.min.js'
|
|
2854
|
+
* Git: https://github.com/mozilla/pdfjs-dist/tree/master
|
|
2855
|
+
* Demo: https://fex.qa.tcshuke.com/docs/admin/main/file/pdf
|
|
2856
|
+
* Demo: https://fex.qa.tcshuke.com/docs/admin/main/file/pdf-seal
|
|
2857
|
+
* ```
|
|
2858
|
+
*/
|
|
2859
|
+
export declare const PdfPreview: (props: PdfPreviewProps) => import("react/jsx-runtime").JSX.Element;
|
|
2637
2860
|
export interface PermissionProps {
|
|
2638
2861
|
name?: string;
|
|
2639
2862
|
children?: ReactNode | ReactNode[];
|
|
@@ -3209,6 +3432,34 @@ export type SplitWrapperProps = SplitProps & {
|
|
|
3209
3432
|
*/
|
|
3210
3433
|
export declare const SplitWrapper: (props: SplitWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
3211
3434
|
export declare const styles: () => void;
|
|
3435
|
+
export type SvgHttpViewProps = {
|
|
3436
|
+
/**
|
|
3437
|
+
* svg地址
|
|
3438
|
+
* ```
|
|
3439
|
+
* 1. 可传http绝对路径
|
|
3440
|
+
* 2. 可传ionic组图标,例如:ionic/alarm-outline
|
|
3441
|
+
* 3. 可传lucide组图标,例如:lucide/crosshair
|
|
3442
|
+
*
|
|
3443
|
+
* 查询ionic、lucide图标 https://fex.qa.tcshuke.com/docs/admin/resources/icons
|
|
3444
|
+
* ```
|
|
3445
|
+
*/
|
|
3446
|
+
svgPath: string;
|
|
3447
|
+
/** 默认:100% */
|
|
3448
|
+
width?: number;
|
|
3449
|
+
/** 默认:100% */
|
|
3450
|
+
height?: number;
|
|
3451
|
+
/** svg 颜色, 默认:#555 */
|
|
3452
|
+
color?: string;
|
|
3453
|
+
className?: string;
|
|
3454
|
+
};
|
|
3455
|
+
/**
|
|
3456
|
+
* http svg地址解析,可自定义颜色
|
|
3457
|
+
* ```
|
|
3458
|
+
* 1. 内置ionic、lucide组图标基础路径
|
|
3459
|
+
* 2. 可传自定义http绝对路径svg数据
|
|
3460
|
+
* ```
|
|
3461
|
+
*/
|
|
3462
|
+
export declare const SvgHttpView: (props: SvgHttpViewProps) => import("react/jsx-runtime").JSX.Element;
|
|
3212
3463
|
export type SwitchConfirmWrapperValue = string | number | boolean;
|
|
3213
3464
|
export type SwitchConfirmWrapperProps = Omit<SwitchProps, "defaultChecked" | "onChange"> & {
|
|
3214
3465
|
value?: SwitchConfirmWrapperValue;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flatbiz/antd",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.108",
|
|
4
4
|
"description": "flat-biz ui components",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"typings": "index.d.ts",
|
|
@@ -66,7 +66,10 @@
|
|
|
66
66
|
"use-intl": "3.0.0-rc.6",
|
|
67
67
|
"react-split": "2.0.14",
|
|
68
68
|
"react-is": "^18.2.0",
|
|
69
|
-
"react-ace": "^10.1.0"
|
|
69
|
+
"react-ace": "^10.1.0",
|
|
70
|
+
"ace-builds": "^1.32.2",
|
|
71
|
+
"sql-formatter": "^15.0.2",
|
|
72
|
+
"xml-formatter": "^3.6.2"
|
|
70
73
|
},
|
|
71
74
|
"gitHead": "4378d433b73ee28fd7cb4c64bed8571f993eb5a9"
|
|
72
75
|
}
|