@next-bricks/data-view 1.8.0 → 1.9.1

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.
@@ -1 +0,0 @@
1
- {"version":3,"file":"chunks/3035.c14dd436.js","mappings":"wLAMO,SAASA,EAAiBC,GAaf,IAZhBC,MAAOC,EACPC,OAAQC,EAAU,KAClBC,EAAI,SACJC,EAAQ,SACRC,GAQDP,EACC,MAAOQ,EAAOC,IAAYC,EAAAA,EAAAA,UAAwB,MAsBlD,OApBAC,EAAAA,EAAAA,YAAU,KACR,GAAIJ,EAEF,YADAE,EAAS,MAIX,MAAMG,EAAW,IAAIC,EAAAA,GAAgBC,IACnC,IAAK,MAAMC,KAASD,EAClB,GAAIC,EAAMC,SAAWX,EAAM,CACzB,MAAM,MAAEJ,EAAK,OAAEE,GAAWY,EAAME,YAChCR,EACES,KAAKC,IAAIb,QAAAA,EAAY,EAAGL,EAAQC,EAAWC,EAASC,GAExD,CACF,IAGF,OADAQ,EAASQ,QAAQf,GACV,IAAMO,EAASS,YAAY,GACjC,CAACjB,EAAYF,EAAWK,EAAUD,EAAUD,IAExCG,CACT,C,kGCvCIc,EAAgC,IAAIC,IAAI,cACxCC,EAA0B,IAA4B,KACtDC,EAAqC,IAAgCH,GAEzEE,EAAwBE,KAAK,CAACC,EAAOC,GAAI,4OAA4OH,onBAAspB,KAE36B,QAAeD,EAAwBK,U","sources":["webpack:///./src/shared/useContainerScale.ts","webpack:///./src/china-map-chart/styles.shadow.css"],"sourcesContent":["import { useEffect, useState } from \"react\";\nimport ResizeObserver from \"resize-observer-polyfill\";\n\n/**\n * 根据容器尺寸进行缩放\n */\nexport function useContainerScale({\n width: baseWidth,\n height: baseHeight,\n root,\n maxScale,\n disabled,\n}: {\n width: number;\n height: number;\n root: HTMLElement;\n /** 最大缩放比例,默认为 1 */\n maxScale?: number;\n disabled?: boolean;\n}): number | null {\n const [scale, setScale] = useState<number | null>(null);\n\n useEffect(() => {\n if (disabled) {\n setScale(null);\n return;\n }\n // 当容器宽高低于预设值时,图形会自动缩小\n const observer = new ResizeObserver((entries) => {\n for (const entry of entries) {\n if (entry.target === root) {\n const { width, height } = entry.contentRect;\n setScale(\n Math.min(maxScale ?? 1, width / baseWidth, height / baseHeight)\n );\n }\n }\n });\n observer.observe(root);\n return () => observer.disconnect();\n }, [baseHeight, baseWidth, disabled, maxScale, root]);\n\n return scale;\n}\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nimport ___CSS_LOADER_GET_URL_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/getUrl.js\";\nvar ___CSS_LOADER_URL_IMPORT_0___ = new URL(\"./assets/label.svg\", import.meta.url);\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\nvar ___CSS_LOADER_URL_REPLACEMENT_0___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_0___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `:host{display:inline-block}:host([fill-container]){display:block;height:100%;position:relative;overflow:hidden}:host([hidden]){display:none}.text{position:absolute;z-index:6;height:22px;line-height:22px;font-size:12px;background:url(${___CSS_LOADER_URL_REPLACEMENT_0___}) no-repeat center left;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);transform:translate(20px,-150%)!important;color:rgba(255,255,255,1);text-indent:10px}.iconImg{position:absolute;z-index:5;src:\"./assets/default.png\";-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}.detailContent{position:absolute;opacity:0.8;z-index:20}:host(:not([fill-container])) .map{position:absolute;top:0;left:0;right:0;bottom:0}:host([fill-container]) .map{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%)}.leftText{margin-left:-20px;transform:translate(-100%,-150%)!important}.topText{margin-top:-10px}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___.toString();\n"],"names":["useContainerScale","_ref","width","baseWidth","height","baseHeight","root","maxScale","disabled","scale","setScale","useState","useEffect","observer","ResizeObserver","entries","entry","target","contentRect","Math","min","observe","disconnect","___CSS_LOADER_URL_IMPORT_0___","URL","___CSS_LOADER_EXPORT___","___CSS_LOADER_URL_REPLACEMENT_0___","push","module","id","toString"],"sourceRoot":""}