@para-ui/core 4.0.61 → 4.0.62
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/Anchor/index.js +2 -1
- package/Argv/index.js +3 -2
- package/AutoButton/index.js +3 -2
- package/AutoTips/index.js +248 -7
- package/Breadcrumbs/index.js +2 -1
- package/Button/index.js +3 -2
- package/ButtonGroup/index.js +3 -2
- package/Card/index.js +33 -23
- package/Cascader/index.js +4 -3
- package/ComboSelect/index.js +4 -3
- package/CopyText/index.js +2 -1
- package/CycleSelector/index.js +3 -2
- package/DatePicker/index.js +6 -5
- package/Descriptions/index.js +3 -2
- package/Desktop/index.js +6 -5
- package/Drawer/index.js +3 -2
- package/DynamicMultiBox/index.js +4 -3
- package/Form/index.js +5 -4
- package/FormItem/index.js +5 -4
- package/FunctionModal/index.js +5 -4
- package/InputCode/index.js +3 -2
- package/InputLang/index.d.ts +2 -0
- package/InputLang/index.js +12 -3
- package/Menu/index.js +2 -1
- package/Modal/index.js +3 -2
- package/MultiBox/index.js +6 -5
- package/OperateBtn/index.js +3 -2
- package/PageHeader/index.js +3 -2
- package/Pagination/index.js +3 -2
- package/PopConfirm/index.js +3 -2
- package/PopMenu/index.js +2 -1
- package/QuickReply/index.js +3 -2
- package/README.md +6 -0
- package/Result/index.js +2 -1
- package/Search/index.js +2 -1
- package/Select/index.js +2 -1
- package/SelectInput/index.js +2 -1
- package/Selector/index.js +2 -1
- package/SelectorPicker/index.js +2 -1
- package/SingleBox/index.js +6 -5
- package/Stepper/index.js +2 -1
- package/Table/index.js +3 -2
- package/Tabs/index.js +6 -5
- package/Tag/index.js +2 -1
- package/TextField/index.js +2 -1
- package/TimePicker/index.js +6 -5
- package/Title/index.js +2 -1
- package/ToggleButton/index.js +3 -2
- package/Transfer/index.js +3 -2
- package/Tree/index.js +4 -3
- package/Upload/index.js +3 -2
- package/Utils/Hooks/useResizeObserver.d.ts +2 -0
- package/_verture/{index-7d115f38.js → index-0163a7b0.js} +2 -2
- package/_verture/{index-2055d357.js → index-09404080.js} +1 -1
- package/_verture/{index-3f811a6c.js → index-78f0f0e7.js} +1 -1
- package/_verture/{index-6bbcdc7f.js → index-98ae8a30.js} +1 -1
- package/_verture/useResizeObserver-edda059a.js +69 -0
- package/index.js +7 -6
- package/package.json +1 -1
- package/umd/AutoButton.js +1 -1
- package/umd/AutoTips.js +1 -1
- package/umd/Breadcrumbs.js +1 -1
- package/umd/Card.js +1 -1
- package/umd/ComboSelect.js +3 -3
- package/umd/DynamicMultiBox.js +1 -1
- package/umd/Form.js +1 -1
- package/umd/FormItem.js +1 -1
- package/umd/InputLang.js +1 -1
- package/umd/Selector.js +1 -1
- package/umd/SelectorPicker.js +1 -1
- package/umd/Table.js +1 -1
- package/_verture/index-f62daef9.js +0 -298
- /package/_verture/{modalContext-15114682.js → modalContext-e3beaf4b.js} +0 -0
package/umd/Card.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r(require("react"),require("@paraview/lib")):"function"==typeof define&&define.amd?define(["react","@paraview/lib"],r):"object"==typeof exports?exports.ParaUI=r(require("react"),require("@paraview/lib")):e.ParaUI=r(e.react,e["@paraview/lib"])}(self,((e,r)=>(()=>{var t={79855:(e,r,t)=>{(r=t(76314)(!1)).push([e.id,".paraui-v4-card{width:100%;height:100%;overflow:auto}.paraui-v4-card>.card-list{display:flex;flex-wrap:wrap}.paraui-v4-card>.card-list>.card-item{border-radius:4px;overflow:auto}.paraui-v4-card>.more{text-align:center}.paraui-v4-card>.more>.more-content{font-size:14px;text-align:center;color:#a1a8b3;display:inline-block}.paraui-v4-card.paraui-v4-card-more>.more>.more-content{cursor:pointer}.paraui-v4-card.paraui-v4-card-more>.more>.more-content:hover{color:#2e65e6}",""]),e.exports=r},76314:e=>{"use strict";e.exports=function(e){var r=[];return r.toString=function(){return this.map((function(r){var t=function(e,r){var t=e[1]||"",n=e[3];if(!n)return t;if(r&&"function"==typeof btoa){var o=(a=n,c=btoa(unescape(encodeURIComponent(JSON.stringify(a)))),u="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(c),"/*# ".concat(u," */")),i=n.sources.map((function(e){return"/*# sourceURL=".concat(n.sourceRoot||"").concat(e," */")}));return[t].concat(i).concat([o]).join("\n")}var a,c,u;return[t].join("\n")}(r,e);return r[2]?"@media ".concat(r[2]," {").concat(t,"}"):t})).join("")},r.i=function(e,t,n){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(n)for(var i=0;i<this.length;i++){var a=this[i][0];null!=a&&(o[a]=!0)}for(var c=0;c<e.length;c++){var u=[].concat(e[c]);n&&o[u[0]]||(t&&(u[2]?u[2]="".concat(t," and ").concat(u[2]):u[2]=t),r.push(u))}},r}},43706:(e,r,t)=>{var n=t(85072),o=t(79855);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};n(o,i);e.exports=o.locals||{}},85072:(e,r,t)=>{"use strict";var n,o=function(){return void 0===n&&(n=Boolean(window&&document&&document.all&&!window.atob)),n},i=function(){var e={};return function(r){if(void 0===e[r]){var t=document.querySelector(r);if(window.HTMLIFrameElement&&t instanceof window.HTMLIFrameElement)try{t=t.contentDocument.head}catch(e){t=null}e[r]=t}return e[r]}}(),a=[];function c(e){for(var r=-1,t=0;t<a.length;t++)if(a[t].identifier===e){r=t;break}return r}function u(e,r){for(var t={},n=[],o=0;o<e.length;o++){var i=e[o],u=r.base?i[0]+r.base:i[0],l=t[u]||0,s="".concat(u," ").concat(l);t[u]=l+1;var f=c(s),d={css:i[1],media:i[2],sourceMap:i[3]};-1!==f?(a[f].references++,a[f].updater(d)):a.push({identifier:s,updater:h(d,r),references:1}),n.push(s)}return n}function l(e){var r=document.createElement("style"),n=e.attributes||{};if(void 0===n.nonce){var o=t.nc;o&&(n.nonce=o)}if(Object.keys(n).forEach((function(e){r.setAttribute(e,n[e])})),"function"==typeof e.insert)e.insert(r);else{var a=i(e.insert||"head");if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(r)}return r}var s,f=(s=[],function(e,r){return s[e]=r,s.filter(Boolean).join("\n")});function d(e,r,t,n){var o=t?"":n.media?"@media ".concat(n.media," {").concat(n.css,"}"):n.css;if(e.styleSheet)e.styleSheet.cssText=f(r,o);else{var i=document.createTextNode(o),a=e.childNodes;a[r]&&e.removeChild(a[r]),a.length?e.insertBefore(i,a[r]):e.appendChild(i)}}function p(e,r,t){var n=t.css,o=t.media,i=t.sourceMap;if(o?e.setAttribute("media",o):e.removeAttribute("media"),i&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}var v=null,m=0;function h(e,r){var t,n,o;if(r.singleton){var i=m++;t=v||(v=l(r)),n=d.bind(null,t,i,!1),o=d.bind(null,t,i,!0)}else t=l(r),n=p.bind(null,t,r),o=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)};return n(e),function(r){if(r){if(r.css===e.css&&r.media===e.media&&r.sourceMap===e.sourceMap)return;n(e=r)}else o()}}e.exports=function(e,r){(r=r||{}).singleton||"boolean"==typeof r.singleton||(r.singleton=o());var t=u(e=e||[],r);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var n=0;n<t.length;n++){var o=c(t[n]);a[o].references--}for(var i=u(e,r),l=0;l<t.length;l++){var s=c(t[l]);0===a[s].references&&(a[s].updater(),a.splice(s,1))}t=i}}}},4205:(e,r,t)=>{"use strict";t.d(r,{default:()=>s});var n=t(39155),o=t.n(n),i=t(16217),a=t(32663);function c(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function u(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),n.forEach((function(r){c(e,r,t[r])}))}return e}u({},t(89601).A.zh);var l=o().createContext({language:(0,a.GetLanguage)(),intlFormat:function(e,r){return function(e,t){var n=(0,a.GetLanguage)();return(0,i.Is)({ops:e,i18nData:{},lang:n,params:t,defI18nData:r})}},componentsProps:{}});const s=l},16217:(e,r,t)=>{"use strict";t.d(r,{Is:()=>o});t(39155);var n=function(e,r){if(!r)return e;e=e.replace(/\"/g,'\\"');var t=/({[^{}]+})/g;return e.split(t).map((function(e){if(e.match(t)){var n=e.replace(/({|})/g,""),o=function(e,r,t){var n=r.replace(/\[(\d+)\]/g,".$1").split("."),o=e,i=!0,a=!1,c=void 0;try{for(var u,l=n[Symbol.iterator]();!(i=(u=l.next()).done);i=!0){var s=u.value;if(void 0===(o=Object(o)[s]))return t}}catch(e){a=!0,c=e}finally{try{i||null==l.return||l.return()}finally{if(a)throw c}}return o}(r,n);return void 0===o?n:o}return e}))},o=function(e){var r,t,o,i,a=e.ops,c=e.i18nData,u=e.lang,l=e.params,s=e.defI18nData;if("string"==typeof a)t=a;else if("object"==typeof a){if("string"!=typeof a.id)return'i18n intl object "id" is missing';t=a.id}void 0!==t&&(void 0===(r=null===(o=c[u])||void 0===o?void 0:o[t])&&s&&(r=null===(i=s[u])||void 0===i?void 0:i[t]));return"string"!=typeof r?"{".concat(t,"}"):n(r,l)}},89601:(e,r,t)=>{"use strict";t.d(r,{A:()=>i});const n={cancel:"Cancel",ok:"Ok"},o={cancel:"取 消",ok:"确 定"},i={zh:o,en:n,"zh-CN":o,"en-US":n}},32663:e=>{"use strict";e.exports=r},39155:r=>{"use strict";r.exports=e}},n={};function o(e){var r=n[e];if(void 0!==r)return r.exports;var i=n[e]={id:e,exports:{}};return t[e](i,i.exports,o),i.exports}o.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return o.d(r,{a:r}),r},o.d=(e,r)=>{for(var t in r)o.o(r,t)&&!o.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},o.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nc=void 0;var i={};return(()=>{"use strict";o.r(i),o.d(i,{Card:()=>m,default:()=>h});var e=o(39155),r=o.n(e),t="paraui-v4";function n(e){var r,t,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e))for(r=0;r<e.length;r++)e[r]&&(t=n(e[r]))&&(o&&(o+=" "),o+=t);else for(r in e)e[r]&&(o&&(o+=" "),o+=r);return o}function a(){for(var e,r,t=0,o="";t<arguments.length;)(e=arguments[t++])&&(r=n(e))&&(o&&(o+=" "),o+=r);return o}var c=o(4205);const u=function(e,t){var n=r().useContext(c.default).intlFormat;return t.zh_CN=t.zh,t["zh-CN"]=t.zh,t.en_US=t.en,t["en-US"]=t.en,n&&n(e,t)},l={zh:{more:"鼠标滚动,加载更多数据",loadingMore:"数据正在加载中…"},en:{more:"Mouse scrolling to load more data",loadingMore:"Loading..."}};o(43706);function s(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function f(e,r,t,n,o,i,a){try{var c=e[i](a),u=c.value}catch(e){return void t(e)}c.done?r(u):Promise.resolve(u).then(n,o)}function d(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function p(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,i=[],a=!0,c=!1;try{for(t=t.call(e);!(a=(n=t.next()).done)&&(i.push(n.value),!r||i.length!==r);a=!0);}catch(e){c=!0,o=e}finally{try{a||null==t.return||t.return()}finally{if(c)throw o}}return i}}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return s(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return s(e,r)}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e,r){var t,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(t)throw new TypeError("Generator is already executing.");for(;a;)try{if(t=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=r.call(e,a)}catch(e){i=[6,e],n=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}var m=function(n){var o=n.className,i=n.style,c=n.list,s=n.boxShadow,m=n.border,h=n.backgroundImage,g=n.width,y=void 0===g?"300px":g,b=n.height,w=void 0===b?"140px":b,x=n.lineNum,S=n.marginRight,j=void 0===S?"20px":S,O=n.marginBottom,C=void 0===O?"20px":O,M=n.showMore,E=void 0!==M&&M,N=n.moreRender,k=n.loadingMoreRender,R=n.onMore,P=u("Card",l),T=p((0,e.useState)(),2),z=(T[0],T[1]),A=p((0,e.useState)(!1),2),I=A[0],L=A[1],H=(0,e.useRef)({}),U=(0,e.useRef)(null);(0,e.useEffect)((function(){var e,r;return window.removeEventListener("resize",_),null===(e=U.current)||void 0===e||e.removeEventListener("scroll",D),window.addEventListener("resize",_),null===(r=U.current)||void 0===r||r.addEventListener("scroll",D),function(){var e;window.removeEventListener("resize",_),null===(e=U.current)||void 0===e||e.removeEventListener("scroll",D)}}),[E,R]),(0,e.useEffect)((function(){_()}),[c,x]);var q,B,_=function(){if(U.current){var e=U.current.getBoundingClientRect(),r=U.current.querySelector(".card-list").getBoundingClientRect(),t=U.current.querySelector(".card-list > .card-item"),o=t.getBoundingClientRect(),i=parseFloat(t.style.marginRight),a=e.width-r.width,c=0!==a?e.width-a-4:e.width,u=Math.floor((c+i)/(o.width+i));if(void 0===n.width&&n.lineNum){if("number"==typeof x)u=x;else for(var l=n.lineNum.sort((function(e,r){return e.width-r.width})),s=0,f=l.length;s<f;s++){var d=l[s];if(d.width>e.width){u=d.size;break}s===l.length-1&&(u=d.size)}var p=(u-1)*i;a&&(p+=4);var v=p/u+"px";H.current.itemWidth="calc(".concat(1/u*100,"% - ").concat(v,")"),U.current.querySelectorAll(".card-list > .card-item").forEach((function(e){e.style.width=H.current.itemWidth}))}u!==H.current.lineNumCom&&(H.current.lineNumCom=u,z(u))}},D=function(){if(E&&U.current&&n.onMore&&!H.current.loadingMore&&U.current.scrollHeight-(U.current.clientHeight+U.current.scrollTop)<1){var e,r,t;if((null===(e=H.current.pos)||void 0===e?void 0:e.clientHeight)===U.current.clientHeight&&(null===(r=H.current.pos)||void 0===r?void 0:r.scrollTop)===U.current.scrollTop&&(null===(t=H.current.pos)||void 0===t?void 0:t.scrollHeight)===U.current.scrollHeight)return void(H.current.pos={});H.current.pos={clientHeight:U.current.clientHeight,scrollTop:U.current.scrollTop,scrollHeight:U.current.scrollHeight},F()}},F=(q=function(){return v(this,(function(e){switch(e.label){case 0:return H.current.loadingMore?[2]:(H.current.loadingMore=!0,L(!0),[4,n.onMore()]);case 1:return e.sent(),L(!1),H.current.loadingMore=!1,[2]}}))},B=function(){var e=this,r=arguments;return new Promise((function(t,n){var o=q.apply(e,r);function i(e){f(o,t,n,i,a,"next",e)}function a(e){f(o,t,n,i,a,"throw",e)}i(void 0)}))},function(){return B.apply(this,arguments)}),G=function(e,r){var t={height:w,marginBottom:C,marginRight:j};return s&&(t.boxShadow=!0===s?"1px 1px 10px 2px rgba(212,218,227,0.40)":s),m&&(t.border=!0===m?"1px solid rgba(212, 218, 227, 0.4)":m),h&&(t.backgroundImage=h,t.backgroundSize="100% 100%",t.backgroundRepeat="no-repeat"),void 0===x&&(t.width=y),H.current.lineNumCom&&(r+1)%H.current.lineNumCom==0&&(t.marginRight=0),function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),n.forEach((function(r){d(e,r,t[r])}))}return e}({},t,e.style)};return r().createElement("div",{className:a(o,"".concat(t,"-card"),d({},"".concat(t,"-card-more"),E&&!I)),style:i,ref:U},r().createElement("div",{className:"card-list"},null==c?void 0:c.map((function(e,t){return r().createElement("div",{className:"card-item",style:G(e,t),key:t},e.render)}))),E&&r().createElement("div",{className:"more"},r().createElement("div",{className:"more-content",onClick:F},I?k||P({id:"loadingMore"}):N||P({id:"more"}))))};const h=m})(),i})()));
|
|
1
|
+
!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r(require("react"),require("@paraview/lib")):"function"==typeof define&&define.amd?define(["react","@paraview/lib"],r):"object"==typeof exports?exports.ParaUI=r(require("react"),require("@paraview/lib")):e.ParaUI=r(e.react,e["@paraview/lib"])}(self,((e,r)=>(()=>{var t={79855:(e,r,t)=>{(r=t(76314)(!1)).push([e.id,".paraui-v4-card{width:100%;height:100%;overflow:auto}.paraui-v4-card>.card-list{display:flex;flex-wrap:wrap;width:100%}.paraui-v4-card>.card-list>.card-item{border-radius:4px;overflow:auto}.paraui-v4-card>.more{text-align:center}.paraui-v4-card>.more>.more-content{font-size:14px;text-align:center;color:#a1a8b3;display:inline-block}.paraui-v4-card.paraui-v4-card-more>.more>.more-content{cursor:pointer}.paraui-v4-card.paraui-v4-card-more>.more>.more-content:hover{color:#2e65e6}",""]),e.exports=r},76314:e=>{"use strict";e.exports=function(e){var r=[];return r.toString=function(){return this.map((function(r){var t=function(e,r){var t=e[1]||"",n=e[3];if(!n)return t;if(r&&"function"==typeof btoa){var o=(a=n,c=btoa(unescape(encodeURIComponent(JSON.stringify(a)))),u="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(c),"/*# ".concat(u," */")),i=n.sources.map((function(e){return"/*# sourceURL=".concat(n.sourceRoot||"").concat(e," */")}));return[t].concat(i).concat([o]).join("\n")}var a,c,u;return[t].join("\n")}(r,e);return r[2]?"@media ".concat(r[2]," {").concat(t,"}"):t})).join("")},r.i=function(e,t,n){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(n)for(var i=0;i<this.length;i++){var a=this[i][0];null!=a&&(o[a]=!0)}for(var c=0;c<e.length;c++){var u=[].concat(e[c]);n&&o[u[0]]||(t&&(u[2]?u[2]="".concat(t," and ").concat(u[2]):u[2]=t),r.push(u))}},r}},43706:(e,r,t)=>{var n=t(85072),o=t(79855);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};n(o,i);e.exports=o.locals||{}},85072:(e,r,t)=>{"use strict";var n,o=function(){return void 0===n&&(n=Boolean(window&&document&&document.all&&!window.atob)),n},i=function(){var e={};return function(r){if(void 0===e[r]){var t=document.querySelector(r);if(window.HTMLIFrameElement&&t instanceof window.HTMLIFrameElement)try{t=t.contentDocument.head}catch(e){t=null}e[r]=t}return e[r]}}(),a=[];function c(e){for(var r=-1,t=0;t<a.length;t++)if(a[t].identifier===e){r=t;break}return r}function u(e,r){for(var t={},n=[],o=0;o<e.length;o++){var i=e[o],u=r.base?i[0]+r.base:i[0],l=t[u]||0,s="".concat(u," ").concat(l);t[u]=l+1;var f=c(s),d={css:i[1],media:i[2],sourceMap:i[3]};-1!==f?(a[f].references++,a[f].updater(d)):a.push({identifier:s,updater:h(d,r),references:1}),n.push(s)}return n}function l(e){var r=document.createElement("style"),n=e.attributes||{};if(void 0===n.nonce){var o=t.nc;o&&(n.nonce=o)}if(Object.keys(n).forEach((function(e){r.setAttribute(e,n[e])})),"function"==typeof e.insert)e.insert(r);else{var a=i(e.insert||"head");if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(r)}return r}var s,f=(s=[],function(e,r){return s[e]=r,s.filter(Boolean).join("\n")});function d(e,r,t,n){var o=t?"":n.media?"@media ".concat(n.media," {").concat(n.css,"}"):n.css;if(e.styleSheet)e.styleSheet.cssText=f(r,o);else{var i=document.createTextNode(o),a=e.childNodes;a[r]&&e.removeChild(a[r]),a.length?e.insertBefore(i,a[r]):e.appendChild(i)}}function p(e,r,t){var n=t.css,o=t.media,i=t.sourceMap;if(o?e.setAttribute("media",o):e.removeAttribute("media"),i&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}var v=null,m=0;function h(e,r){var t,n,o;if(r.singleton){var i=m++;t=v||(v=l(r)),n=d.bind(null,t,i,!1),o=d.bind(null,t,i,!0)}else t=l(r),n=p.bind(null,t,r),o=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)};return n(e),function(r){if(r){if(r.css===e.css&&r.media===e.media&&r.sourceMap===e.sourceMap)return;n(e=r)}else o()}}e.exports=function(e,r){(r=r||{}).singleton||"boolean"==typeof r.singleton||(r.singleton=o());var t=u(e=e||[],r);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var n=0;n<t.length;n++){var o=c(t[n]);a[o].references--}for(var i=u(e,r),l=0;l<t.length;l++){var s=c(t[l]);0===a[s].references&&(a[s].updater(),a.splice(s,1))}t=i}}}},4205:(e,r,t)=>{"use strict";t.d(r,{default:()=>s});var n=t(39155),o=t.n(n),i=t(16217),a=t(32663);function c(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function u(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),n.forEach((function(r){c(e,r,t[r])}))}return e}u({},t(89601).A.zh);var l=o().createContext({language:(0,a.GetLanguage)(),intlFormat:function(e,r){return function(e,t){var n=(0,a.GetLanguage)();return(0,i.Is)({ops:e,i18nData:{},lang:n,params:t,defI18nData:r})}},componentsProps:{}});const s=l},16217:(e,r,t)=>{"use strict";t.d(r,{Is:()=>o});t(39155);var n=function(e,r){if(!r)return e;e=e.replace(/\"/g,'\\"');var t=/({[^{}]+})/g;return e.split(t).map((function(e){if(e.match(t)){var n=e.replace(/({|})/g,""),o=function(e,r,t){var n=r.replace(/\[(\d+)\]/g,".$1").split("."),o=e,i=!0,a=!1,c=void 0;try{for(var u,l=n[Symbol.iterator]();!(i=(u=l.next()).done);i=!0){var s=u.value;if(void 0===(o=Object(o)[s]))return t}}catch(e){a=!0,c=e}finally{try{i||null==l.return||l.return()}finally{if(a)throw c}}return o}(r,n);return void 0===o?n:o}return e}))},o=function(e){var r,t,o,i,a=e.ops,c=e.i18nData,u=e.lang,l=e.params,s=e.defI18nData;if("string"==typeof a)t=a;else if("object"==typeof a){if("string"!=typeof a.id)return'i18n intl object "id" is missing';t=a.id}void 0!==t&&(void 0===(r=null===(o=c[u])||void 0===o?void 0:o[t])&&s&&(r=null===(i=s[u])||void 0===i?void 0:i[t]));return"string"!=typeof r?"{".concat(t,"}"):n(r,l)}},89601:(e,r,t)=>{"use strict";t.d(r,{A:()=>i});const n={cancel:"Cancel",ok:"Ok"},o={cancel:"取 消",ok:"确 定"},i={zh:o,en:n,"zh-CN":o,"en-US":n}},32663:e=>{"use strict";e.exports=r},39155:r=>{"use strict";r.exports=e}},n={};function o(e){var r=n[e];if(void 0!==r)return r.exports;var i=n[e]={id:e,exports:{}};return t[e](i,i.exports,o),i.exports}o.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return o.d(r,{a:r}),r},o.d=(e,r)=>{for(var t in r)o.o(r,t)&&!o.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},o.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nc=void 0;var i={};return(()=>{"use strict";o.r(i),o.d(i,{Card:()=>h,default:()=>g});var e=o(39155),r=o.n(e),t="paraui-v4";function n(e){var r,t,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e))for(r=0;r<e.length;r++)e[r]&&(t=n(e[r]))&&(o&&(o+=" "),o+=t);else for(r in e)e[r]&&(o&&(o+=" "),o+=r);return o}function a(){for(var e,r,t=0,o="";t<arguments.length;)(e=arguments[t++])&&(r=n(e))&&(o&&(o+=" "),o+=r);return o}var c=o(4205);const u=function(e,t){var n=r().useContext(c.default).intlFormat;return t.zh_CN=t.zh,t["zh-CN"]=t.zh,t.en_US=t.en,t["en-US"]=t.en,n&&n(e,t)},l={zh:{more:"鼠标滚动,加载更多数据",loadingMore:"数据正在加载中…"},en:{more:"Mouse scrolling to load more data",loadingMore:"Loading..."}};const s=function(r){var t=(0,e.useRef)({});(0,e.useEffect)((function(){return o(),function(){clearInterval(t.current.resizeTimer),clearTimeout(t.current.resizeLimit)}}),[r.dom]);var n=function(e){var n=e.width,o=e.height;if(n!==t.current.width||o!==t.current.height){var i=!0;if(r.resizeType&&("width"===r.resizeType&&n===t.current.width&&(i=!1),"height"===r.resizeType&&o===t.current.height&&(i=!1)),i)if(t.current.width=n,t.current.height=o,0!==r.timer){clearTimeout(t.current.resizeLimit);var a=void 0!==r.timer?r.timer:100;t.current.resizeLimit=setTimeout((function(){r.cb()}),a)}else r.cb()}},o=function(){var e=r.dom;e&&(void 0===window.ResizeObserver?(clearInterval(t.current.resizeTimer),t.current.resizeTimer=setInterval((function(){var r=e.getBoundingClientRect();n(r)}))):new ResizeObserver((function(e){var r,t=null===(r=e[0])||void 0===r?void 0:r.contentRect;n(t)})).observe(e))}};o(43706);function f(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function d(e,r,t,n,o,i,a){try{var c=e[i](a),u=c.value}catch(e){return void t(e)}c.done?r(u):Promise.resolve(u).then(n,o)}function p(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function v(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,i=[],a=!0,c=!1;try{for(t=t.call(e);!(a=(n=t.next()).done)&&(i.push(n.value),!r||i.length!==r);a=!0);}catch(e){c=!0,o=e}finally{try{a||null==t.return||t.return()}finally{if(c)throw o}}return i}}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return f(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return f(e,r)}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,r){var t,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(t)throw new TypeError("Generator is already executing.");for(;a;)try{if(t=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=r.call(e,a)}catch(e){i=[6,e],n=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}var h=function(n){var o=n.className,i=n.style,c=n.list,f=n.boxShadow,h=n.border,g=n.backgroundImage,b=n.width,y=void 0===b?"300px":b,w=n.height,x=void 0===w?"140px":w,S=n.lineNum,j=n.marginRight,C=void 0===j?"20px":j,O=n.marginBottom,M=void 0===O?"20px":O,N=n.showMore,T=void 0!==N&&N,z=n.moreRender,R=n.loadingMoreRender,E=n.onMore,k=u("Card",l),I=v((0,e.useState)(),2),P=(I[0],I[1]),A=v((0,e.useState)(!1),2),H=A[0],L=A[1],U=(0,e.useRef)({}),q=(0,e.useRef)(null);U.current.onMore=E,s({dom:q.current,cb:function(){return D()},timer:0}),(0,e.useEffect)((function(){var e;return null===(e=q.current)||void 0===e||e.addEventListener("scroll",F),function(){var e;null===(e=q.current)||void 0===e||e.removeEventListener("scroll",F)}}),[]),(0,e.useEffect)((function(){D()}),[c,S]);var B,_,D=function(){if(q.current){var e=q.current.getBoundingClientRect(),r=q.current.querySelector(".card-list"),t=q.current.querySelector(".card-list > .card-item"),o=t.getBoundingClientRect(),i=parseFloat(t.style.marginRight),a=q.current.scrollHeight>q.current.clientHeight,c=Math.floor((r.clientWidth+i)/(o.width+i));if(void 0===n.width&&n.lineNum){if("number"==typeof S)c=S;else for(var u=n.lineNum.sort((function(e,r){return e.width-r.width})),l=0,s=u.length;l<s;l++){var f=u[l];if(f.width>e.width){c=f.size;break}l===u.length-1&&(c=f.size)}var d=(c-1)*i;a&&(d+=4);var p=d/c+"px";U.current.itemWidth="calc(".concat(1/c*100,"% - ").concat(p,")"),q.current.querySelectorAll(".card-list > .card-item").forEach((function(e){e.style.width=U.current.itemWidth}))}c!==U.current.lineNumCom&&(U.current.lineNumCom=c,P(c))}},F=function(){if(T&&q.current&&U.current.onMore&&!U.current.loadingMore&&q.current.scrollHeight-(q.current.clientHeight+q.current.scrollTop)<1){var e,r,t;if((null===(e=U.current.pos)||void 0===e?void 0:e.clientHeight)===q.current.clientHeight&&(null===(r=U.current.pos)||void 0===r?void 0:r.scrollTop)===q.current.scrollTop&&(null===(t=U.current.pos)||void 0===t?void 0:t.scrollHeight)===q.current.scrollHeight)return void(U.current.pos={});U.current.pos={clientHeight:q.current.clientHeight,scrollTop:q.current.scrollTop,scrollHeight:q.current.scrollHeight},W()}},W=(B=function(){return m(this,(function(e){switch(e.label){case 0:return U.current.loadingMore?[2]:(U.current.loadingMore=!0,L(!0),[4,U.current.onMore()]);case 1:return e.sent(),L(!1),U.current.loadingMore=!1,[2]}}))},_=function(){var e=this,r=arguments;return new Promise((function(t,n){var o=B.apply(e,r);function i(e){d(o,t,n,i,a,"next",e)}function a(e){d(o,t,n,i,a,"throw",e)}i(void 0)}))},function(){return _.apply(this,arguments)}),G=function(e,r){var t={height:x,marginBottom:M,marginRight:C};if(f&&(t.boxShadow=!0===f?"1px 1px 10px 2px rgba(212,218,227,0.40)":f),h&&(t.border=!0===h?"1px solid rgba(212, 218, 227, 0.4)":h),g&&(t.backgroundImage=g,t.backgroundSize="100% 100%",t.backgroundRepeat="no-repeat"),void 0===S&&(t.width=y),n.width){if(q.current){var o=q.current.querySelector(".card-list").clientWidth,i=parseFloat(C),a=parseFloat(n.width);o-(U.current.lineNumCom*(a+i)-i)<=a&&U.current.lineNumCom&&(r+1)%U.current.lineNumCom==0&&(t.marginRight=0)}}else U.current.lineNumCom&&(r+1)%U.current.lineNumCom==0&&(t.marginRight=0);return function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),n.forEach((function(r){p(e,r,t[r])}))}return e}({},t,e.style)};return r().createElement("div",{className:a(o,"".concat(t,"-card"),p({},"".concat(t,"-card-more"),T&&!H)),style:i,ref:q},r().createElement("div",{className:"card-list"},null==c?void 0:c.map((function(e,t){return r().createElement("div",{className:"card-item",style:G(e,t),key:t},e.render)}))),T&&r().createElement("div",{className:"more"},r().createElement("div",{className:"more-content",onClick:W},H?R||k({id:"loadingMore"}):z||k({id:"more"}))))};const g=h})(),i})()));
|