@fvc/drawer 1.0.0 → 1.1.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.
- package/dist/lib/drawer/src/ChildWrapper.d.ts +1 -1
- package/dist/lib/drawer/src/Drawer.d.ts +8 -7
- package/dist/lib/drawer/src/helpers/createChildWrapper.d.ts +1 -1
- package/dist/lib/drawer/src/helpers/getChildByType.d.ts +1 -1
- package/dist/lib/drawer/src/types/index.d.ts +1 -0
- package/dist/lib/index.js +2 -2
- package/package.json +9 -3
- /package/dist/lib/drawer/src/{Drawer.types.d.ts → types/Drawer.types.d.ts} +0 -0
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { DrawerProps } from './
|
|
2
|
+
import { DrawerProps } from './types';
|
|
3
|
+
import './Drawer.scss';
|
|
3
4
|
export declare const prefixCls = "fvc-drawer";
|
|
4
5
|
export declare const Drawer: {
|
|
5
6
|
({ children, placement, width, height, maskClosable, mask, push, testId, ...props }: DrawerProps): React.JSX.Element;
|
|
6
7
|
Header: {
|
|
7
|
-
(props: import("./
|
|
8
|
-
displayName: import("./
|
|
8
|
+
(props: import("./types").ChildWrapperProps): React.JSX.Element;
|
|
9
|
+
displayName: import("./types").ChildTypes;
|
|
9
10
|
};
|
|
10
11
|
Footer: {
|
|
11
|
-
(props: import("./
|
|
12
|
-
displayName: import("./
|
|
12
|
+
(props: import("./types").ChildWrapperProps): React.JSX.Element;
|
|
13
|
+
displayName: import("./types").ChildTypes;
|
|
13
14
|
};
|
|
14
15
|
Content: {
|
|
15
|
-
(props: import("./
|
|
16
|
-
displayName: import("./
|
|
16
|
+
(props: import("./types").ChildWrapperProps): React.JSX.Element;
|
|
17
|
+
displayName: import("./types").ChildTypes;
|
|
17
18
|
};
|
|
18
19
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ChildTypes, ChildWrapperProps } from '../
|
|
2
|
+
import { ChildTypes, ChildWrapperProps } from '../types';
|
|
3
3
|
export declare const createChildWrapper: (type: ChildTypes) => {
|
|
4
4
|
(props: ChildWrapperProps): React.JSX.Element;
|
|
5
5
|
displayName: ChildTypes;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ChildTypes, ChildWrapperProps } from '../
|
|
2
|
+
import { ChildTypes, ChildWrapperProps } from '../types';
|
|
3
3
|
export declare const getChildByType: (children: React.ReactNode, type: ChildTypes) => React.ReactElement<ChildWrapperProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Drawer.types';
|
package/dist/lib/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import{Drawer as e}from"antd";import r from"react";function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}"function"==typeof SuppressedError&&SuppressedError;var n,o={exports:{}};
|
|
2
2
|
/*!
|
|
3
3
|
Copyright (c) 2018 Jed Watson.
|
|
4
4
|
Licensed under the MIT License (MIT), see
|
|
5
5
|
http://jedwatson.github.io/classnames
|
|
6
|
-
*/var d
|
|
6
|
+
*/var a,d=(n||(n=1,a=o,function(){var e={}.hasOwnProperty;function r(){for(var e="",r=0;r<arguments.length;r++){var o=arguments[r];o&&(e=n(e,t(o)))}return e}function t(t){if("string"==typeof t||"number"==typeof t)return t;if("object"!=typeof t)return"";if(Array.isArray(t))return r.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var o="";for(var a in t)e.call(t,a)&&t[a]&&(o=n(o,a));return o}function n(e,r){return r?e?e+" "+r:e+r:e}a.exports?(r.default=r,a.exports=r):window.classNames=r}()),o.exports),i=t(d);function c({children:e,testId:t,testIdPostfix:n}){return r.createElement("div",{"data-testid":t?`${t}-${n}`:void 0},e)}const l=e=>{const t=t=>r.createElement(c,Object.assign({},t,{testIdPostfix:null==e?void 0:e.toLowerCase()}));return t.displayName=e,t},s=(e,t)=>r.Children.toArray(e).find(e=>!!(e=>r.isValidElement(e)&&"function"==typeof e.type&&"displayName"in e.type)(e)&&e.type.displayName===t);!function(e,r){void 0===r&&(r={});var t=r.insertAt;if("undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===t&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(".fvc-drawer-content-wrapper > .fvc-drawer-content {\n z-index: 1;\n overflow: auto;\n background-clip: padding-box;\n background: var(--card-bg-color-20);\n border: 0;\n}\n.fvc-drawer-content > .fvc-drawer-footer {\n border-top: none;\n}\n.fvc-drawer-content > .fvc-drawer-body {\n word-wrap: break-word;\n flex-grow: 1;\n padding: 0 16px;\n font-size: 14px;\n line-height: 1.5715;\n overflow: auto;\n}\n.fvc-drawer-placement-right .fvc-drawer-close {\n left: -50px;\n}\n.fvc-drawer-placement-left .fvc-drawer-close {\n right: -40px;\n}\n.fvc-drawer .fvc-drawer-header {\n padding: 16px 32px;\n border-bottom: none;\n}\n.fvc-drawer .fvc-drawer-header-title {\n margin: 0;\n font-size: 16px;\n font-weight: 500;\n line-height: 22px;\n}\n.fvc-drawer .fvc-drawer-close {\n position: absolute;\n display: block;\n top: 0;\n padding: 20px;\n font-weight: 700;\n color: var(--white-icon-color-0);\n background: transparent;\n border: 0;\n outline: 0;\n cursor: pointer;\n}\n.fvc-drawer .fvc-drawer-close svg {\n width: 20px;\n height: 20px;\n}\n.fvc-drawer .fvc-drawer-close:focus, .fvc-drawer .fvc-drawer-close:hover {\n color: var(--white-icon-color-0);\n background: transparent;\n}\n.fvc-drawer-header-no-title .fvc-drawer .fvc-drawer-close {\n margin-right: 5px;\n padding-right: 22px;\n}");const p="fvc-drawer",f=t=>{var{children:n,placement:o="right",width:a=256,height:d=256,maskClosable:c=!0,mask:l=!0,push:f={distance:180},testId:u="drawer"}=t,v=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}(t,["children","placement","width","height","maskClosable","mask","push","testId"]);const w=s(n,"Footer"),h=s(n,"Header"),g=s(n,"Content"),m=i(p,{[`${p}-placement-${o}`]:o});return r.createElement(e,Object.assign({"data-testid":u,prefixCls:p,title:h,footer:w,placement:o,width:a,height:d,maskClosable:c,mask:l,push:f,rootClassName:m,styles:{header:null==h?void 0:h.props.style,footer:null==w?void 0:w.props.style,content:null==g?void 0:g.props.style}},v),g)};f.Header=l("Header"),f.Footer=l("Footer"),f.Content=l("Content");export{f as Drawer};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fvc/drawer",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"main": "./dist/lib/index.js",
|
|
5
5
|
"types": "./dist/lib/drawer/src/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -16,9 +16,15 @@
|
|
|
16
16
|
"./types/*": "./dist/lib/drawer/src/types/*"
|
|
17
17
|
},
|
|
18
18
|
"scripts": {
|
|
19
|
-
"build": "
|
|
19
|
+
"build": "rollup -c ./rollup.config.mjs",
|
|
20
|
+
"clean": "rm -rf dist && rm -rf .rollup.cache && rm -rf .turbo",
|
|
21
|
+
"lint": "eslint --config ../../eslint.config.js \"src/**/*.{ts,tsx}\"",
|
|
22
|
+
"lint:fix": "eslint --config ../../eslint.config.js \"src/**/*.{ts,tsx}\" --fix",
|
|
23
|
+
"format": "prettier --write \"src/**/*.{ts,tsx}\"",
|
|
24
|
+
"type-check": "tsc --noEmit",
|
|
25
|
+
"test": "bun test --preload ../../tests/happydom.ts --preload ../../tests/testing-library.tsx"
|
|
20
26
|
},
|
|
21
|
-
"
|
|
27
|
+
"peerDependencies": {
|
|
22
28
|
"react": "^18.0.0",
|
|
23
29
|
"antd": "^5.0.0"
|
|
24
30
|
}
|
|
File without changes
|