@daoyi/nmtl-ui 1.1.43-beta.62 → 1.1.43-beta.65
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 +1 @@
|
|
|
1
|
-
import e,{useState as o,useEffect as
|
|
1
|
+
import e,{useState as o,useEffect as r}from"react";import t from"prop-types";import{c as n}from"./index-11391ca3.js";import{i,a,r as l,M as d}from"./createSvgIcon-fd7bb768.js";import{Typography as s}from"@material-ui/core";import{u as c,c as m,s as k}from"./style-inject.es-c875d022.js";import"@material-ui/icons";import"./withStyles-12e04256.js";import"@material-ui/styles";import"react-dom";var _=c(m((function(o,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var t=i(e),n=(0,a(l).default)(t.createElement("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreHoriz");r.default=n})));k(".keywordList {\n display: flex;\n flex-wrap: wrap;\n margin-top: 0.8rem; }\n .keywordList__item {\n font-size: 1.125rem !important;\n border-radius: 5px;\n margin-right: 0.5rem !important;\n margin-bottom: 0.5rem !important;\n cursor: pointer; }\n .keywordList__item__hover {\n border-radius: 5px;\n line-height: normal;\n padding: 0.125rem 0.625rem;\n background: transparent;\n transition: 0.3s background ease-in-out; }\n .keywordList__item__hover:hover {\n background: rgba(0, 0, 0, 0.1); }\n .keywordList__icon svg {\n font-size: 1rem;\n line-height: 1rem; }\n .keywordList__icon .keywordList__item__hover {\n display: flex;\n align-items: center;\n height: 100%;\n padding: 0.125rem 0.875rem; }\n\n@media screen and (max-width: 484px) {\n .keywordList__item {\n font-size: 0.75rem !important; } }\n");const y=({className:o,keywords:r,backgroundColor:t,textColor:i,limit:a,onMoreClick:l,onKeywordClick:d})=>Array.isArray(r)&&e.createElement("div",{className:n("keywordList",o)},(a?r.slice(0,a):r).map(((o,r)=>e.createElement(s,{color:"textSecondary",className:"keywordList__item",key:r.toString(),onClick:()=>d(o)},e.createElement("div",{style:{color:i,background:t},className:"keywordList__item__hover"},o)))),a&&r.length>a&&e.createElement("div",{className:n("keywordList__item","keywordList__icon"),style:{backgroundColor:t},onClick:l},e.createElement("div",{className:"keywordList__item__hover"},e.createElement(_,null))));y.defaultProps={className:void 0,keywords:void 0,backgroundColor:void 0,textColor:void 0,limit:void 0,onMoreClick:()=>{},onKeywordClick:()=>{}},y.propTypes={className:t.string,backgroundColor:t.string,textColor:t.string,keywords:t.arrayOf(t.any),limit:t.number,onMoreClick:t.func,onKeywordClick:t.func};k(".keywordModal__content {\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n border-radius: 5px; }\n .keywordModal__content__image {\n display: flex;\n justify-content: center;\n width: 100%; }\n .keywordModal__content__image__img {\n height: 7.75rem;\n object-fit: scale-down; }\n .keywordModal__content__detail {\n width: 100%;\n padding: 1rem 1.25rem;\n border-radius: 5px; }\n .keywordModal__content__detail__title {\n font-weight: bold;\n font-size: 1.5rem;\n text-decoration: underline;\n cursor: pointer; }\n .keywordModal__content__detail__desc {\n margin-top: 0.8rem;\n font-size: 1rem;\n display: -webkit-box;\n overflow: hidden;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical; }\n .keywordModal__content__detail__author {\n margin-top: 0.8rem;\n font-size: 1.25rem;\n cursor: pointer; }\n .keywordModal__content__detail__author:hover {\n text-decoration: underline; }\n\n.keywordModal p {\n font-family: 'Noto Sans TC', 'Arial', sans-serif !important; }\n\n.keywordModal .MuiPaper-root {\n min-width: initial !important; }\n");const u=o=>{const{visible:r,setVisible:t,cardData:n}=o,{titleColor:i,imageBackgroundColor:a,backgroundColor:l,textColor:s,onKeywordClick:c,onAuthorClick:m}=o,{author:k,imgUrl:_,title:u}=n||{},w=n&&n.keywords&&n.keywords.split("\n")||[];return e.createElement(d,{transparent:!0,size:"small",className:"keywordModal",visible:r,footer:null,onCancel:()=>t(!1)},e.createElement("div",{className:"keywordModal__content",style:{backgroundColor:l}},_&&e.createElement("div",{className:"keywordModal__content__image",style:{backgroundColor:a}},e.createElement("img",{className:"keywordModal__content__image__img",src:_,alt:""})),e.createElement("div",{className:"keywordModal__content__detail"},e.createElement("div",{title:u,className:"keywordModal__content__detail__title",style:{color:i||s}},u),k&&e.createElement("div",{className:"keywordModal__content__detail__author",title:k,onClick:m,style:{color:s}},k),e.createElement(y,{keywords:w,textColor:s,backgroundColor:a,onKeywordClick:c}))))};u.defaultProps={visible:void 0,setVisible:()=>{},titleColor:void 0,imageBackgroundColor:void 0,backgroundColor:void 0,textColor:void 0,cardData:void 0,onKeywordClick:()=>{},onAuthorClick:()=>{}},u.propTypes={visible:t.bool,setVisible:t.func,cardData:t.objectOf(t.any),titleColor:t.string,imageBackgroundColor:t.string,backgroundColor:t.string,textColor:t.string,onKeywordClick:t.func,onAuthorClick:t.func};k(".keywords p {\n font-family: 'Noto Sans TC', 'Arial', sans-serif !important; }\n");const w=t=>{const{className:i,keywords:a,cardData:l,limit:d}=t,{titleColor:s,imageBackgroundColor:c,backgroundColor:m,textColor:k}=t,{onKeywordClick:_,onMoreClick:w,onAuthorClick:g}=t,C=l&&l.keywords&&l.keywords.split("\n")||a||[];if(0===C.filter((e=>e&&e.length>0)).length)return null;const[p,f]=o(),v=(()=>{const[e,t]=o("PC"),n=()=>{window.innerWidth>768?t("PC"):window.innerWidth>576?t("tablet"):t("mobile")};return r((()=>(n(),window.addEventListener("resize",n),()=>{window.removeEventListener("resize",n)})),[]),e})();return e.createElement("div",{className:n("keywords",i)},e.createElement(y,{limit:d||("mobile"===v?1:void 0),keywords:C,backgroundColor:c,textColor:k,onMoreClick:()=>l?f(!0):w(),onKeywordClick:_}),e.createElement(u,{visible:p,setVisible:f,cardData:l,titleColor:s,imageBackgroundColor:c,backgroundColor:m,textColor:k,onKeywordClick:_,onAuthorClick:g}))};w.defaultProps={className:void 0,keywords:void 0,cardData:void 0,limit:void 0,titleColor:void 0,imageBackgroundColor:void 0,backgroundColor:void 0,textColor:void 0,onKeywordClick:()=>{},onMoreClick:()=>{},onAuthorClick:()=>{}},w.propTypes={className:t.string,keywords:t.arrayOf(t.any),cardData:t.objectOf(t.any),limit:t.number,titleColor:t.string,imageBackgroundColor:t.string,backgroundColor:t.string,textColor:t.string,onKeywordClick:t.func,onMoreClick:t.func,onAuthorClick:t.func};export{w as default};
|
package/package.json
CHANGED