@flatbiz/antd 4.4.33 → 4.4.34
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-xml/index.js +1 -1
- package/esm/ace-editor-xml/index.js.map +1 -1
- package/esm/anchor-steps/index.js +1 -1
- package/esm/anchor-steps/index.js.map +1 -1
- package/esm/easy-table/index.css +1 -1
- package/esm/easy-table/index.js +1 -1
- package/esm/easy-table/index.js.map +1 -1
- package/esm/form-grid/index.js +1 -1
- package/esm/form-grid/index.js.map +1 -1
- package/esm/index.js +1 -1
- package/esm/label-value-render/index.js +1 -1
- package/esm/label-value-render/index.js.map +1 -1
- package/esm/mention-editor/index.js +1 -1
- package/esm/mention-editor/index.js.map +1 -1
- package/esm/mentions-wrapper/index.js.map +1 -1
- package/esm/pdf/index.js +1 -1
- package/esm/pdf/index.js.map +1 -1
- package/esm/pdf-preview/index.css +1 -1
- package/esm/pdf-preview/index.js +1 -1
- package/esm/pdf-preview/index.js.map +1 -1
- package/index.d.ts +3 -3
- package/package.json +1 -1
|
@@ -1 +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((
|
|
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 pdfPageListHeightScope: number[][];\n pdfContentNodeId: string;\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((pageNumer) => {\n return {\n activeKey: `${pageNumer}`,\n render: (\n <div\n key={pageNumer}\n className={classNames('v-pdf-preview-navigation-content', {\n 'v-pdf-preview-navigation-active': pageNumer === props.activeNumber,\n })}\n >\n <Pdf.Page\n pageNumber={pageNumer}\n gap={0}\n scale={props.scale || 0.2}\n className={classNames('v-pdf-preview-navigation-page')}\n onClick={() => {\n props.onChangeActiveNumber(pageNumer);\n const scroll = document.querySelector(`#${props.pdfContentNodeId}`) as HTMLDivElement;\n if (scroll) {\n if (pageNumer === 1) {\n scroll.scrollTo(0, 0);\n } else {\n const top = props.pdfPageListHeightScope[pageNumer - 1][0];\n scroll.scrollTo(0, top);\n }\n }\n }}\n ></Pdf.Page>\n\n <div className=\"v-pdf-preview-navigation-pagination\">- {pageNumer} -</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 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 const pdfContentNodeId = hooks.useId(undefined, 'pdf-content-node');\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 pdfPageListHeightScope={pdfPageListHeightScope}\n pdfContentNodeId={pdfContentNodeId}\n />\n </div>\n ) : null}\n\n <div\n className=\"v-pdf-preview-content\"\n onScroll={onDocumentCenterScroll}\n ref={dpfDoucmentRef}\n id={pdfContentNodeId}\n >\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 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","pageNumer","render","_jsxs","className","_classNames","children","Pdf","Page","pageNumber","gap","scale","onClick","onChangeActiveNumber","scroll","document","querySelector","pdfContentNodeId","scrollTo","top","pdfPageListHeightScope","PdfPreview","_useState","useState","setNumPages","dpfDoucmentRef","useRef","_useState2","activePagination","setActivePagination","_useState3","pdfPageHeight","setPdfPageHeight","pageGap","onDocumentLoadSuccess","_hooks","useCallbackRef","inst","useMemo","pageHeightScopeList","forEach","item","push","x","onDocumentCenterScroll","event","_dpfDoucmentRef$curre","scrollTop","target","scrollHeight","current","clientHeight","index","length","element","useId","undefined","Document","pdfUrl","onLoadSuccess","error","Result","status","title","subTitle","hiddenNavigation","navigationScale","onScroll","ref","id","onRenderSuccess","node","h","Math","floor","height","display","justifyContent"],"mappings":";+lBAcO,IAAMA,EAAa,SAAbA,EAAcC,GACzB,IAAMC,SAAyBD,EAA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D,EAACiB,EAAIC,KAAI,CAEPC,WAAYgC,EACZ9B,MAAOvB,EAAMuB,MACbD,IAAKuB,EACLqC,gBAAiB,SAAAA,EAACC,GAChB,IAAMC,EAAIC,KAAKC,MAAMH,EAAKI,QAC1B3C,EAAiBwC,EACjB,EACF7E,MAAO,CAAEiF,QAAS,OAAQC,eAAgB,WARrCpC,EAWV,IACD,SAIZ"}
|
package/index.d.ts
CHANGED
|
@@ -3447,7 +3447,7 @@ export type OperationPresetProps = {
|
|
|
3447
3447
|
/** 自定义生成模版参数code */
|
|
3448
3448
|
codeAdapter?: () => string | undefined;
|
|
3449
3449
|
};
|
|
3450
|
-
export type
|
|
3450
|
+
export type MentionEditorProps = Omit<MentionsWrapperProps, "prefix"> & {
|
|
3451
3451
|
/**
|
|
3452
3452
|
* onChange
|
|
3453
3453
|
* @item 点击的预设模版参数
|
|
@@ -3461,14 +3461,14 @@ export type MetionEditorProps = Omit<MentionsWrapperProps, "prefix"> & {
|
|
|
3461
3461
|
params?: ParamItem[] | undefined;
|
|
3462
3462
|
};
|
|
3463
3463
|
/**
|
|
3464
|
-
* 基于
|
|
3464
|
+
* 基于MentionWrapper封装的模版字符串配置组件
|
|
3465
3465
|
* 1. 提供变量,数字,链接等可选的模版参数
|
|
3466
3466
|
* 2. 不同类型模版参数可配置多个
|
|
3467
3467
|
* 3. mention 会根据 传入的params自动推断出关键字
|
|
3468
3468
|
* 4. 模版参数建议都以${_xxx}为格式
|
|
3469
3469
|
* 5. Demo: https://fex.qa.tcshuke.com/docs/admin/main/widget?key=mention-editor
|
|
3470
3470
|
*/
|
|
3471
|
-
export declare const
|
|
3471
|
+
export declare const MentionEditor: (props: MentionEditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
3472
3472
|
export interface ModalActionProps {
|
|
3473
3473
|
children: ReactElement | ((data: {
|
|
3474
3474
|
onClose: () => void;
|