bhd-components 0.2.2 → 0.2.4

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.
Files changed (46) hide show
  1. package/README.md +0 -10
  2. package/dist/table.esm.es5.development.css +113 -23
  3. package/dist/table.esm.es5.development.js +14 -9
  4. package/dist/table.esm.es5.production.css +1 -1
  5. package/dist/table.esm.es5.production.js +1 -1
  6. package/es2017/index.d.ts +72 -68
  7. package/es2017/index.js +9 -2
  8. package/es2017/message/index.d.ts +18 -0
  9. package/es2017/message/index.js +42 -0
  10. package/es2017/message/index.module.less +91 -0
  11. package/es2017/pagination/index.d.ts +4 -0
  12. package/es2017/pagination/index.js +13 -0
  13. package/es2017/pagination/index.module.less +49 -0
  14. package/es2017/table/index.js +12 -8
  15. package/es2017/table/index.module.less +128 -5
  16. package/es2017/tableSelect/index.d.ts +3 -0
  17. package/es2017/tableSelect/index.js +74 -0
  18. package/es2017/tableSelect/index.module.less +21 -0
  19. package/es2017/theme/variable.less +625 -0
  20. package/es2017/titleBar/index.d.ts +11 -0
  21. package/es2017/titleBar/index.js +51 -0
  22. package/es2017/titleBar/index.module.less +44 -0
  23. package/es2017/viewImage/index.d.ts +3 -0
  24. package/es2017/viewImage/index.js +180 -0
  25. package/es2017/viewImage/index.module.less +170 -0
  26. package/esm/index.d.ts +72 -68
  27. package/esm/index.js +9 -2
  28. package/esm/message/index.d.ts +18 -0
  29. package/esm/message/index.js +42 -0
  30. package/esm/message/index.module.less +91 -0
  31. package/esm/pagination/index.d.ts +4 -0
  32. package/esm/pagination/index.js +13 -0
  33. package/esm/pagination/index.module.less +49 -0
  34. package/esm/table/index.js +12 -8
  35. package/esm/table/index.module.less +128 -5
  36. package/esm/tableSelect/index.d.ts +3 -0
  37. package/esm/tableSelect/index.js +74 -0
  38. package/esm/tableSelect/index.module.less +21 -0
  39. package/esm/theme/variable.less +625 -0
  40. package/esm/titleBar/index.d.ts +11 -0
  41. package/esm/titleBar/index.js +51 -0
  42. package/esm/titleBar/index.module.less +44 -0
  43. package/esm/viewImage/index.d.ts +3 -0
  44. package/esm/viewImage/index.js +185 -0
  45. package/esm/viewImage/index.module.less +170 -0
  46. package/package.json +6 -5
@@ -0,0 +1,44 @@
1
+ .titleBar {
2
+ width: 100%;
3
+ display: flex;
4
+ align-items: center;
5
+ justify-content: space-between;
6
+ .left {
7
+ margin-right: 40px;
8
+ display: flex;
9
+ width: 100%;
10
+ overflow: hidden;
11
+ .leftIcon {
12
+ margin-right: 16px;
13
+ flex-shrink: 0;
14
+ }
15
+ .leftContent {
16
+ width: 100%;
17
+ overflow: hidden;
18
+ .leftTitle {
19
+ font-weight: 500;
20
+ font-size: 20px;
21
+ line-height: 24px;
22
+ color: rgba(0, 0, 0, 0.85);
23
+ white-space: nowrap;
24
+ overflow: hidden;
25
+ text-overflow: ellipsis;
26
+ width: 100%;
27
+ }
28
+ .leftSubTitle {
29
+ margin-top: 8px;
30
+ color: rgba(0, 0, 0, 0.45);
31
+ font-weight: 400;
32
+ font-size: 12px;
33
+ line-height: 1.5;
34
+ white-space: nowrap;
35
+ overflow: hidden;
36
+ text-overflow: ellipsis;
37
+ width: 100%;
38
+ }
39
+ }
40
+ }
41
+ .right {
42
+ flex: 0 0 auto;
43
+ }
44
+ }
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const AppViewImage: (props: any) => JSX.Element;
3
+ export default AppViewImage;
@@ -0,0 +1,185 @@
1
+ import _object_spread from "@swc/helpers/src/_object_spread.mjs";
2
+ import _object_spread_props from "@swc/helpers/src/_object_spread_props.mjs";
3
+ import _sliced_to_array from "@swc/helpers/src/_sliced_to_array.mjs";
4
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@ice/jsx-runtime/jsx-runtime";
5
+ import * as React from "react";
6
+ import { useState, useEffect, useImperativeHandle, useRef } from "react";
7
+ import styles from "./index.module.less";
8
+ import { Modal } from "antd";
9
+ var ViewImage = function(props) {
10
+ var _useState = _sliced_to_array(useState(100), 2), scaleValue = _useState[0], setScaleValue = _useState[1];
11
+ var _useState1 = _sliced_to_array(useState(500), 2), maxScale = _useState1[0], setMaxScale = _useState1[1];
12
+ var _useState2 = _sliced_to_array(useState(1), 2), minScale = _useState2[0], setMinScale = _useState2[1];
13
+ var _useState3 = _sliced_to_array(useState(""), 2), imgSrc = _useState3[0], setImgSrc = _useState3[1];
14
+ var _useState4 = _sliced_to_array(useState("left"), 2), imgLeft = _useState4[0], setImgLeft = _useState4[1];
15
+ var _useState5 = _sliced_to_array(useState("right"), 2), imgTop = _useState5[0], setImgTop = _useState5[1];
16
+ var _useState6 = _sliced_to_array(useState(0), 2), rotateValue = _useState6[0], setRotateValue = _useState6[1];
17
+ var _useState7 = _sliced_to_array(useState(false), 2), loading = _useState7[0], setLoading = _useState7[1];
18
+ var _useState8 = _sliced_to_array(useState(0), 2), curIndex = _useState8[0], setCurIndex = _useState8[1];
19
+ var _useState9 = _sliced_to_array(useState(props.multiSelect || false), 2), multiSelect = _useState9[0], setMultiSelect = _useState9[1]; //是否多张图片 切换
20
+ var _useState10 = _sliced_to_array(useState(false), 2), imgError = _useState10[0], setImgError = _useState10[1]; //图片是否加载出错
21
+ var event_contextmenu = function() {
22
+ return false;
23
+ };
24
+ var getSrc = function() {};
25
+ var rotate = function() {};
26
+ var downloadUrl = function() {};
27
+ var close = function() {};
28
+ var reset = function() {};
29
+ var imgLoad = function() {};
30
+ var imgErr = function() {};
31
+ var preChange = function() {};
32
+ var nextChange = function() {};
33
+ var moveImg = function(ev) {
34
+ // ev.preventDefault();
35
+ // if (imgLeft == "auto") {
36
+ // imgLeft = parseFloat($(".appSelf_viewImage_body_pic").css("left"));
37
+ // }
38
+ // if (imgTop == "auto") {
39
+ // imgTop = parseFloat($(".appSelf_viewImage_body_pic").css("top"));
40
+ // }
41
+ };
42
+ useEffect(function() {
43
+ if (multiSelect) getSrc(0);
44
+ else getSrc();
45
+ document.addEventListener("contextmenu", event_contextmenu);
46
+ return function() {
47
+ document.removeEventListener("contextmenu", event_contextmenu);
48
+ };
49
+ }, []);
50
+ return /*#__PURE__*/ _jsxs("div", {
51
+ className: styles.viewBody,
52
+ children: [
53
+ /*#__PURE__*/ _jsxs("div", {
54
+ className: styles.viewContent,
55
+ children: [
56
+ /*#__PURE__*/ _jsxs("div", {
57
+ className: styles.viewAction,
58
+ children: [
59
+ /*#__PURE__*/ _jsx("span", {
60
+ title: "旋转",
61
+ onClick: rotate,
62
+ children: /*#__PURE__*/ _jsx("i", {
63
+ className: "iconxuanzhuan iconfont"
64
+ })
65
+ }),
66
+ props.download && !imgError && /*#__PURE__*/ _jsx("span", {
67
+ title: "下载",
68
+ onClick: downloadUrl,
69
+ children: /*#__PURE__*/ _jsx("i", {
70
+ className: "iconfont iconxiazai1"
71
+ })
72
+ }),
73
+ /*#__PURE__*/ _jsx("span", {
74
+ title: "关闭",
75
+ onClick: close,
76
+ children: /*#__PURE__*/ _jsx("i", {
77
+ className: "iconfont iconcuo"
78
+ })
79
+ })
80
+ ]
81
+ }),
82
+ /*#__PURE__*/ _jsxs("div", {
83
+ className: styles.viewPicBody,
84
+ children: [
85
+ loading ? /*#__PURE__*/ _jsx("img", {
86
+ // src="/new_yun/images/accountManage/loading.png"
87
+ className: styles.viewLoad
88
+ }, "load") : imgError ? /*#__PURE__*/ _jsx("div", {
89
+ style: {
90
+ color: "#FFFFFF"
91
+ },
92
+ children: imgSrc ? "图片加载错误" : "暂无内容"
93
+ }) : /*#__PURE__*/ _jsx("img", {
94
+ src: imgSrc,
95
+ alt: "图片加载错误",
96
+ draggable: "false",
97
+ onMouseDown: moveImg,
98
+ style: {
99
+ transform: "scale(".concat(scaleValue / 100, ",").concat(scaleValue / 100, ") rotate(").concat(rotateValue, "deg)"),
100
+ left: imgLeft == "auto" ? "auto" : imgLeft + "px",
101
+ top: imgTop == "auto" ? "auto" : imgTop + "px"
102
+ },
103
+ className: styles.viewPic,
104
+ onLoad: imgLoad,
105
+ onError: imgErr
106
+ }, "img"),
107
+ multiSelect && /*#__PURE__*/ _jsxs(_Fragment, {
108
+ children: [
109
+ /*#__PURE__*/ _jsx("div", {
110
+ className: styles.viewPrev,
111
+ onClick: preChange
112
+ }),
113
+ /*#__PURE__*/ _jsx("div", {
114
+ className: styles.viewNext,
115
+ onClick: nextChange
116
+ })
117
+ ]
118
+ })
119
+ ]
120
+ }),
121
+ /*#__PURE__*/ _jsxs("div", {
122
+ className: styles.viewScale,
123
+ children: [
124
+ /*#__PURE__*/ _jsx("span", {
125
+ className: styles.scaleMinus,
126
+ onClick: function() {
127
+ // scaleValue = scaleValue - 10;
128
+ // this.scaleChange(scaleValue);
129
+ }
130
+ }),
131
+ /*#__PURE__*/ _jsxs("span", {
132
+ className: styles.scaleValue,
133
+ onClick: reset,
134
+ children: [
135
+ scaleValue,
136
+ "%"
137
+ ]
138
+ }),
139
+ /*#__PURE__*/ _jsx("span", {
140
+ className: styles.scaleAdd,
141
+ onClick: function() {
142
+ // scaleValue = scaleValue + 10;
143
+ // this.scaleChange(scaleValue);
144
+ }
145
+ })
146
+ ]
147
+ })
148
+ ]
149
+ }),
150
+ props.content && /*#__PURE__*/ _jsx("div", {
151
+ className: styles.viewInfoMain,
152
+ children: props.content()
153
+ })
154
+ ]
155
+ });
156
+ };
157
+ var AppViewImage = function(props) {
158
+ var visible = props.visible, wraperClassName = props.wraperClassName;
159
+ var viewRef = useRef(null);
160
+ useImperativeHandle(props.viewImageRef, function() {
161
+ return {
162
+ updateSrc: function() {
163
+ viewRef.current.getSrc();
164
+ }
165
+ };
166
+ });
167
+ return /*#__PURE__*/ _jsx(Modal, {
168
+ transitionName: "",
169
+ maskTransitionName: "",
170
+ title: null,
171
+ footer: null,
172
+ closable: false,
173
+ centered: true,
174
+ open: visible,
175
+ keyboard: false,
176
+ maskStyle: {
177
+ background: "rgba(0, 0, 0, 0.65)"
178
+ },
179
+ wrapClassName: "".concat(styles.viewImageRoot, " ").concat(wraperClassName || ""),
180
+ children: /*#__PURE__*/ _jsx(ViewImage, _object_spread_props(_object_spread({}, props), {
181
+ ref: viewRef
182
+ }))
183
+ });
184
+ };
185
+ export default AppViewImage;
@@ -0,0 +1,170 @@
1
+ .viewImageRoot {
2
+ :global {
3
+ .ant-modal {
4
+ width: 100% !important;
5
+ height: 100% !important;
6
+ min-height: 600px;
7
+ margin: 0;
8
+ padding: 0;
9
+ overflow: hidden;
10
+ .ant-modal-content {
11
+ width: 100%;
12
+ height: 100%;
13
+ background: transparent;
14
+ box-shadow: none;
15
+ border-radius: none;
16
+ .ant-modal-body {
17
+ width: 100%;
18
+ height: 100%;
19
+ padding: 0px;
20
+ }
21
+ }
22
+ }
23
+ }
24
+ .viewBody {
25
+ display: flex;
26
+ width: 100%;
27
+ height: 100%;
28
+ .viewContent {
29
+ width: 100%;
30
+ height: 100%;
31
+ position: relative;
32
+ .viewAction {
33
+ width: 100%;
34
+ display: flex;
35
+ position: absolute;
36
+ top: 40px;
37
+ justify-content: flex-end;
38
+ padding-right: 40px;
39
+ box-sizing: border-box;
40
+ z-index: 10;
41
+ & > span {
42
+ display: flex;
43
+ width: 40px;
44
+ height: 40px;
45
+ background: rgba(0, 0, 0, 0.45);
46
+ align-items: center;
47
+ justify-content: center;
48
+ font-size: 16px;
49
+ color: #ffffff;
50
+ cursor: pointer;
51
+ border-radius: 8px;
52
+ margin-left: 24px;
53
+ &:first-child {
54
+ margin-left: 0;
55
+ }
56
+ }
57
+ }
58
+
59
+ .viewScale {
60
+ width: 100%;
61
+ padding-right: 40px;
62
+ box-sizing: border-box;
63
+ position: absolute;
64
+ bottom: 40px;
65
+ display: flex;
66
+ align-items: center;
67
+ justify-content: flex-end;
68
+ user-select: none;
69
+ z-index: 10;
70
+ .scaleMinus,
71
+ .scaleAdd {
72
+ width: 40px;
73
+ height: 40px;
74
+ display: flex;
75
+ align-items: center;
76
+ justify-content: center;
77
+ font-size: 16px;
78
+ color: #ffffff;
79
+ background-color: rgba(0, 0, 0, 0.45);
80
+ cursor: pointer;
81
+ }
82
+
83
+ .scaleMinus {
84
+ border-radius: 4px 0 0 4px;
85
+ }
86
+ .scaleAdd {
87
+ border-radius: 0 4px 4px 0;
88
+ }
89
+ .scaleValue {
90
+ width: 80px;
91
+ height: 40px;
92
+ border-left: 1px solid rgba(255, 255, 255, 0.25);
93
+ border-right: 1px solid rgba(255, 255, 255, 0.25);
94
+ box-sizing: border-box;
95
+ background: rgba(0, 0, 0, 0.45);
96
+ display: flex;
97
+ align-items: center;
98
+ justify-content: center;
99
+ color: #ffffff;
100
+ cursor: pointer;
101
+ user-select: none;
102
+ }
103
+ }
104
+
105
+ .viewPicBody {
106
+ width: 100%;
107
+ height: 100%;
108
+ display: flex;
109
+ align-items: center;
110
+ justify-content: center;
111
+ .viewPic {
112
+ max-width: 80%;
113
+ max-height: 80%;
114
+ cursor: move;
115
+ position: absolute;
116
+ }
117
+ .viewLoad {
118
+ width: 80px;
119
+ height: 80px;
120
+ }
121
+ .viewPrev {
122
+ position: absolute;
123
+ width: 40px;
124
+ height: 40px;
125
+ border-left: 1px solid rgba(255, 255, 255, 0.25);
126
+ border-right: 1px solid rgba(255, 255, 255, 0.25);
127
+ box-sizing: border-box;
128
+ background: rgba(0, 0, 0, 0.45);
129
+ display: flex;
130
+ align-items: center;
131
+ justify-content: center;
132
+ color: #ffffff;
133
+ cursor: pointer;
134
+ user-select: none;
135
+ top: 50%;
136
+ transform: translateY(-50%);
137
+ left: 40px;
138
+ border-radius: 50%;
139
+ }
140
+ .viewNext {
141
+ position: absolute;
142
+ width: 40px;
143
+ height: 40px;
144
+ border-left: 1px solid rgba(255, 255, 255, 0.25);
145
+ border-right: 1px solid rgba(255, 255, 255, 0.25);
146
+ box-sizing: border-box;
147
+ background: rgba(0, 0, 0, 0.45);
148
+ display: flex;
149
+ align-items: center;
150
+ justify-content: center;
151
+ color: #ffffff;
152
+ cursor: pointer;
153
+ user-select: none;
154
+ top: 50%;
155
+ transform: translateY(-50%);
156
+ right: 40px;
157
+ border-radius: 50%;
158
+ }
159
+ }
160
+ }
161
+ .viewInfoMain {
162
+ height: 100%;
163
+ flex-shrink: 0;
164
+ background: #ffffff;
165
+ position: relative;
166
+ z-index: 1001;
167
+ min-height: 600px;
168
+ }
169
+ }
170
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bhd-components",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "组件功能描述",
5
5
  "files": [
6
6
  "esm",
@@ -47,20 +47,21 @@
47
47
  "dependencies": {
48
48
  "@ant-design/icons": "^5.0.1",
49
49
  "@ice/jsx-runtime": "^0.2.0",
50
- "@swc/helpers": "^0.4.14",
50
+ "@swc/helpers": "^0.5.1",
51
51
  "antd": "^5.4.6",
52
52
  "less": "^4.1.3",
53
- "less-loader": "^11.1.0"
53
+ "less-loader": "^11.1.0",
54
+ "raw-loader": "^4.0.2"
54
55
  },
55
56
  "devDependencies": {
56
57
  "@ice/pkg": "^1.0.0",
57
58
  "@ice/pkg-plugin-docusaurus": "^1.0.0",
58
59
  "@iceworks/spec": "^1.0.0",
60
+ "@types/react": "^18.0.0",
61
+ "@types/react-dom": "^18.0.0",
59
62
  "eslint": "^7.0.0",
60
63
  "react": "^18.0.0",
61
64
  "react-dom": "^18.0.0",
62
- "@types/react": "^18.0.0",
63
- "@types/react-dom": "^18.0.0",
64
65
  "stylelint": "^13.7.2"
65
66
  },
66
67
  "peerDependencies": {