@para-ui/core 2.0.18 → 2.0.19

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/Tag/index.d.ts ADDED
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @author Hanz
3
+ * @date 2022/1/11 上午10:15
4
+ * @description tag
5
+ */
6
+ import React, { PropsWithChildren } from 'react';
7
+ export interface TagProps {
8
+ prefixCls?: string;
9
+ className?: string;
10
+ color?: string;
11
+ closable?: boolean;
12
+ closeIcon?: React.ReactNode;
13
+ visible?: boolean;
14
+ onClose?: (e: React.MouseEvent<HTMLElement>) => void;
15
+ style?: React.CSSProperties;
16
+ icon?: React.ReactNode;
17
+ }
18
+ declare type TagPropsWithChild = PropsWithChildren<TagProps>;
19
+ declare const Tag: React.FC<TagPropsWithChild>;
20
+ export default Tag;
package/Tag/index.js ADDED
@@ -0,0 +1,19 @@
1
+ !function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r(require("react"),require("@para-ui/icons/Close")):"function"==typeof define&&define.amd?define(["react","@para-ui/icons/Close"],r):"object"==typeof exports?exports.ParaUI=r(require("react"),require("@para-ui/icons/Close")):e.ParaUI=r(e.react,e["@para-ui/icons/Close"])}(self,(function(e,r){return function(){var t={9713:function(e){e.exports=function(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e},e.exports.__esModule=!0,e.exports.default=e.exports},2398:function(e){e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},1109:function(e,r,t){var n=t(9713);function o(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}e.exports=function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?o(Object(t),!0).forEach((function(r){n(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):o(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e},e.exports.__esModule=!0,e.exports.default=e.exports},4184:function(e,r){var t;
2
+ /*!
3
+ Copyright (c) 2018 Jed Watson.
4
+ Licensed under the MIT License (MIT), see
5
+ http://jedwatson.github.io/classnames
6
+ */!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],r=0;r<arguments.length;r++){var t=arguments[r];if(t){var i=typeof t;if("string"===i||"number"===i)e.push(t);else if(Array.isArray(t)){if(t.length){var a=o.apply(null,t);a&&e.push(a)}}else if("object"===i)if(t.toString===Object.prototype.toString)for(var c in t)n.call(t,c)&&t[c]&&e.push(c);else e.push(t.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(t=function(){return o}.apply(r,[]))||(e.exports=t)}()},7418:function(e){"use strict";
7
+ /*
8
+ object-assign
9
+ (c) Sindre Sorhus
10
+ @license MIT
11
+ */var r=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var r={},t=0;t<10;t++)r["_"+String.fromCharCode(t)]=t;if("0123456789"!==Object.getOwnPropertyNames(r).map((function(e){return r[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,i){for(var a,c,s=o(e),u=1;u<arguments.length;u++){for(var l in a=Object(arguments[u]))t.call(a,l)&&(s[l]=a[l]);if(r){c=r(a);for(var f=0;f<c.length;f++)n.call(a,c[f])&&(s[c[f]]=a[c[f]])}}return s}},8475:function(e,r,t){"use strict";var n=t(2398);r.Z=function(e,r){var t=(0,o.default)({},e);Array.isArray(r)&&r.forEach((function(e){delete t[e]}));return t};var o=n(t(1109))},5251:function(e,r,t){"use strict";
12
+ /** @license React v17.0.2
13
+ * react-jsx-runtime.production.min.js
14
+ *
15
+ * Copyright (c) Facebook, Inc. and its affiliates.
16
+ *
17
+ * This source code is licensed under the MIT license found in the
18
+ * LICENSE file in the root directory of this source tree.
19
+ */t(7418);var n=t(9297),o=60103;if(r.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var i=Symbol.for;o=i("react.element"),r.Fragment=i("react.fragment")}var a=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c=Object.prototype.hasOwnProperty,s={key:!0,ref:!0,__self:!0,__source:!0};function u(e,r,t){var n,i={},u=null,l=null;for(n in void 0!==t&&(u=""+t),void 0!==r.key&&(u=""+r.key),void 0!==r.ref&&(l=r.ref),r)c.call(r,n)&&!s.hasOwnProperty(n)&&(i[n]=r[n]);if(e&&e.defaultProps)for(n in r=e.defaultProps)void 0===i[n]&&(i[n]=r[n]);return{$$typeof:o,type:e,key:u,ref:l,props:i,_owner:a.current}}r.jsx=u,r.jsxs=u},5893:function(e,r,t){"use strict";e.exports=t(5251)},19:function(e){"use strict";e.exports=r},9297:function(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]={exports:{}};return t[e](i,i.exports,o),i.exports}o.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(r,{a:r}),r},o.d=function(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=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return function(){"use strict";o.r(i);var e=o(5893),r=o(9297),t=o.n(r),n=o(4184),a=o.n(n),c=o(8475),s=o(19),u=o.n(s),l=function(){return l=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},l.apply(this,arguments)},f=function(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)r.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(t[n[o]]=e[n[o]])}return t},p=function(n){n.prefixCls;var o,i=n.className,s=n.style,p=n.children,y=n.icon,b=n.color,d=n.onClose,v=n.closeIcon,O=n.closable,j=void 0!==O&&O,g=(f(n,["prefixCls","className","style","children","icon","color","onClose","closeIcon","closable"]),t().useState(!0)),h=g[0],x=g[1];(0,r.useEffect)((function(){"visible"in n&&x(n.visible)}),[n.visible]);var m=l({backgroundColor:b||void 0},s),P=a()("paraui-tag",((o={})["paraui-tag-has-color"]=b,o["paraui-tag-hidden"]=!h,o),i),_=function(e){e.stopPropagation(),null==d||d(e),e.defaultPrevented||"visible"in n||x(!1)},w=(0,c.Z)(n,["visible"]),S=y||null,C=S?(0,e.jsxs)(e.Fragment,{children:[S,(0,e.jsx)("span",{children:p},void 0)]},void 0):p;return(0,e.jsxs)("span",l({},w,{className:P,style:m},{children:[C,j?v?(0,e.jsx)("span",l({className:"paraui-tag-close-icon",onClick:_},{children:v}),void 0):(0,e.jsx)(u(),{className:"paraui-tag-close-icon",onClick:_},void 0):null]}),void 0)};i.default=p}(),i}()}));
package/index.d.ts CHANGED
@@ -42,6 +42,7 @@ export * from './Stepper';
42
42
  export * from './Switch';
43
43
  export * from './Table';
44
44
  export * from './Tabs';
45
+ export * from './Tag';
45
46
  export * from './TextField';
46
47
  export * from './TimePicker';
47
48
  export * from './Timeline';