bhd-components 0.7.34 → 0.7.35

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 (34) hide show
  1. package/README.md +1 -1
  2. package/dist/{8f785a2d.esm.es5.development.js → 051147c0.esm.es5.development.js} +256 -256
  3. package/dist/{e6319651.esm.es5.production.js → 56407e62.esm.es5.production.js} +10 -10
  4. package/dist/index.esm.es5.development.css +0 -3
  5. package/dist/index.esm.es5.development.js +127 -48
  6. package/dist/index.esm.es5.production.css +1 -1
  7. package/dist/index.esm.es5.production.js +1 -1
  8. package/es2017/bhdAppLayout/components/BhdTableSimple/index.js +24 -35
  9. package/es2017/bhdAppLayout/components/BhdTableSimple/index.less +0 -6
  10. package/es2017/bhdAppLayout/components/BhdTableSimple/index/347/232/204/345/211/257/346/234/254.js +120 -0
  11. package/es2017/bhdTipModal/index.js +4 -1
  12. package/es2017/bhdTipModal/modal.d.ts +6 -0
  13. package/es2017/bhdTipModal/modal.js +15 -0
  14. package/es2017/index.d.ts +1 -0
  15. package/es2017/index.js +1 -0
  16. package/es2017/message/index.d.ts +12 -14
  17. package/es2017/message/index.js +14 -4
  18. package/es2017/provider/config.d.ts +7 -1
  19. package/es2017/provider/config.js +7 -1
  20. package/es2017/provider/index.js +21 -4
  21. package/esm/bhdAppLayout/components/BhdTableSimple/index.js +24 -37
  22. package/esm/bhdAppLayout/components/BhdTableSimple/index.less +0 -6
  23. package/esm/bhdAppLayout/components/BhdTableSimple/index/347/232/204/345/211/257/346/234/254.js +122 -0
  24. package/esm/bhdTipModal/index.js +4 -1
  25. package/esm/bhdTipModal/modal.d.ts +6 -0
  26. package/esm/bhdTipModal/modal.js +15 -0
  27. package/esm/index.d.ts +1 -0
  28. package/esm/index.js +1 -0
  29. package/esm/message/index.d.ts +12 -14
  30. package/esm/message/index.js +60 -3
  31. package/esm/provider/config.d.ts +7 -1
  32. package/esm/provider/config.js +7 -1
  33. package/esm/provider/index.js +21 -4
  34. package/package.json +1 -1
@@ -0,0 +1,122 @@
1
+ import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
2
+ import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
3
+ import { jsx as _jsx, jsxs as _jsxs } from "@ice/jsx-runtime/jsx-runtime";
4
+ import * as React from "react";
5
+ import "./index.less";
6
+ import Table from "../../../table";
7
+ import { Loading, NotData, ServerError } from "../../../images";
8
+ import i18Conversion from "../../../i18n";
9
+ /*
10
+ 参数与Table一致
11
+
12
+ ajaxErr:接口是否报错
13
+ notDataText:无数据时,显示的文案
14
+ borderBottom: 是否显示下边框线
15
+ loading:是否加载中
16
+ className
17
+ 超长内容 出现滚动条 需在管理列定义好width 没有定义的max-width:300
18
+ */ var BhdTableSimple = function(props) {
19
+ var _props_className = props.className, className = _props_className === void 0 ? "" : _props_className, locale = props.locale, _props_borderBottom = props.borderBottom, borderBottom = _props_borderBottom === void 0 ? false : _props_borderBottom, rowSelection = props.rowSelection, ajaxErr = props.ajaxErr, dataSource = props.dataSource, _props_kind = props.kind, kind = _props_kind === void 0 ? "simple" : _props_kind, loading = props.loading, _props_notDataText = props.notDataText, notDataText = _props_notDataText === void 0 ? i18Conversion("noData") : _props_notDataText, _props_components = props.components, components = _props_components === void 0 ? {
20
+ table: null,
21
+ header: {
22
+ wrapper: null,
23
+ row: null,
24
+ cell: null
25
+ },
26
+ body: {
27
+ wrapper: null,
28
+ row: null,
29
+ cell: null
30
+ }
31
+ } : _props_components;
32
+ var renderTableText = function() {
33
+ if (ajaxErr) {
34
+ return /*#__PURE__*/ _jsxs("div", {
35
+ className: "app_BhdTableSimple_errorTable",
36
+ children: [
37
+ /*#__PURE__*/ _jsx("img", {
38
+ src: ServerError,
39
+ alt: ""
40
+ }),
41
+ /*#__PURE__*/ _jsx("p", {
42
+ children: i18Conversion("系统繁忙,稍后重试!")
43
+ })
44
+ ]
45
+ });
46
+ }
47
+ if (loading) {
48
+ return /*#__PURE__*/ _jsx("div", {
49
+ className: "app_BhdTableSimple_noTable",
50
+ style: {
51
+ minHeight: "150px"
52
+ }
53
+ });
54
+ }
55
+ return /*#__PURE__*/ _jsxs("div", {
56
+ className: "app_BhdTableSimple_noTable",
57
+ style: {
58
+ width: "100%"
59
+ },
60
+ children: [
61
+ /*#__PURE__*/ _jsx("img", {
62
+ src: NotData,
63
+ alt: ""
64
+ }),
65
+ /*#__PURE__*/ _jsx("div", {
66
+ children: notDataText
67
+ })
68
+ ]
69
+ });
70
+ };
71
+ var loadingTable = /*#__PURE__*/ _jsxs("div", {
72
+ className: "app_BhdTableSimple_noTable app_BhdTableSimple_noTable_loadingTable",
73
+ children: [
74
+ /*#__PURE__*/ _jsx("img", {
75
+ src: Loading,
76
+ alt: "",
77
+ style: {
78
+ width: "48px",
79
+ height: "48px"
80
+ }
81
+ }),
82
+ /*#__PURE__*/ _jsx("p", {
83
+ children: i18Conversion("Load")
84
+ })
85
+ ]
86
+ });
87
+ if (kind === "simple") {
88
+ className += " app_BhdTableSimple_simple";
89
+ }
90
+ if (loading) {
91
+ if (!components.body) {
92
+ components.body = {
93
+ wrapper: null,
94
+ row: null,
95
+ cell: null
96
+ };
97
+ }
98
+ components = _object_spread_props(_object_spread({}, components.body), {
99
+ body: {
100
+ wrapper: function() {
101
+ return loadingTable;
102
+ }
103
+ }
104
+ });
105
+ }
106
+ var tableProps = _object_spread_props(_object_spread({
107
+ style: {
108
+ width: "100%"
109
+ }
110
+ }, props), {
111
+ loading: false,
112
+ components: components,
113
+ dataSource: ajaxErr ? [] : dataSource,
114
+ className: "app_BhdTableSimple ".concat(className || " ", " ").concat(rowSelection ? "app_BhdTableSimple_rowSelection" : ""),
115
+ locale: {
116
+ emptyText: renderTableText()
117
+ },
118
+ scroll: props.scroll
119
+ });
120
+ return /*#__PURE__*/ _jsx(Table, _object_spread({}, tableProps));
121
+ };
122
+ export default BhdTableSimple;
@@ -2,7 +2,7 @@ import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
2
2
  import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
3
3
  import { jsx as _jsx, jsxs as _jsxs } from "@ice/jsx-runtime/jsx-runtime";
4
4
  import * as React from "react";
5
- import { Modal } from "antd";
5
+ import { Modal } from "./modal";
6
6
  import { Confirm, Success, Info } from "../images/index";
7
7
  import styles from "./index.module.less";
8
8
  var initConFirmModal = function(obj) {
@@ -182,6 +182,7 @@ var initWarnModal = function(obj) {
182
182
  };
183
183
  var BhdTipModal = {
184
184
  confirm: function(obj) {
185
+ console.log("Modal", Modal);
185
186
  var modal = Modal.confirm(initConFirmModal(obj));
186
187
  modal.updateModal = function() {
187
188
  var updateObj = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
@@ -190,6 +191,7 @@ var BhdTipModal = {
190
191
  return modal;
191
192
  },
192
193
  success: function(obj) {
194
+ console.log("Modal", Modal);
193
195
  var modal = Modal.confirm(initSuccessModal(obj));
194
196
  modal.updateModal = function() {
195
197
  var updateObj = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
@@ -198,6 +200,7 @@ var BhdTipModal = {
198
200
  return modal;
199
201
  },
200
202
  custom: function(obj) {
203
+ console.log("Modal", Modal);
201
204
  var modal = Modal.confirm(initCustomModal(obj));
202
205
  modal.updateModal = function() {
203
206
  var updateObj = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
@@ -0,0 +1,6 @@
1
+ declare let Modal: any;
2
+ declare let message: any;
3
+ declare let notification: any;
4
+ declare const _default: () => null;
5
+ export default _default;
6
+ export { Modal, message, notification };
@@ -0,0 +1,15 @@
1
+ import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
2
+ import * as React from "react";
3
+ import { App, message as AntdMessage, Modal as AntdModal, notification as AntdNotification } from "antd";
4
+ var Modal = {};
5
+ var message = {};
6
+ var notification = {};
7
+ export default function() {
8
+ var staticFunction = App.useApp();
9
+ message = _object_spread({}, AntdMessage, staticFunction.message);
10
+ Modal = _object_spread({}, AntdModal, staticFunction.modal);
11
+ notification = _object_spread({}, AntdNotification, staticFunction.notification);
12
+ console.log("mess1", staticFunction, message);
13
+ return null;
14
+ };
15
+ export { Modal, message, notification };
package/esm/index.d.ts CHANGED
@@ -64,6 +64,7 @@ export { default as Upload } from "antd/es/upload";
64
64
  export { default as Watermark } from "antd/es/watermark";
65
65
  export { default as QRCode } from "antd/es/qrcode";
66
66
  export { default as version } from "antd/es/version";
67
+ export { default as AntdMessage } from "antd/es/message";
67
68
  export { default as Provider } from "./provider";
68
69
  export { default as TextTootip } from "./textTootip";
69
70
  export { default as zh_CN } from "antd/locale/zh_CN";
package/esm/index.js CHANGED
@@ -69,6 +69,7 @@ export { default as Upload } from "antd/es/upload";
69
69
  export { default as Watermark } from "antd/es/watermark";
70
70
  export { default as QRCode } from "antd/es/qrcode";
71
71
  export { default as version } from "antd/es/version";
72
+ export { default as AntdMessage } from "antd/es/message";
72
73
  /* 自定义修改 */ export { default as Provider } from "./provider/index";
73
74
  export { default as TextTootip } from "./textTootip/index";
74
75
  export { default as zh_CN } from "antd/locale/zh_CN";
@@ -1,18 +1,16 @@
1
- import * as React from "react";
2
1
  import type { ArgsProps } from "antd/es/message";
3
2
  declare const BhdMessage: {
4
- customSuccess: (config: ArgsProps | string) => import("antd/es/message/interface").MessageType;
5
- customWarning: (config: ArgsProps | string) => import("antd/es/message/interface").MessageType;
6
- customError: (config: ArgsProps | string) => import("antd/es/message/interface").MessageType;
7
- info: import("antd/es/message/interface").TypeOpen;
8
- success: import("antd/es/message/interface").TypeOpen;
9
- error: import("antd/es/message/interface").TypeOpen;
10
- warning: import("antd/es/message/interface").TypeOpen;
11
- loading: import("antd/es/message/interface").TypeOpen;
12
- open: (config: ArgsProps) => import("antd/es/message/interface").MessageType;
13
- destroy: (key?: React.Key) => void;
14
- config: (config: import("antd/es/message/interface").ConfigOptions) => void;
15
- useMessage: typeof import("antd/es/message/useMessage").default;
16
- _InternalPanelDoNotUseOrYouWillBeFired: typeof import("antd/es/message/PurePanel").default;
3
+ customSuccess: (config: ArgsProps | string) => any;
4
+ customWarning: (config: ArgsProps | string) => any;
5
+ customError: (config: ArgsProps | string) => any;
6
+ open: (...arg: any) => any;
7
+ destroy: (...arg: any) => any;
8
+ error: (...arg: any) => any;
9
+ info: (...arg: any) => any;
10
+ loading: (...arg: any) => any;
11
+ success: (...arg: any) => any;
12
+ useMessage: (...arg: any) => any;
13
+ warning: (...arg: any) => any;
14
+ _InternalPanelDoNotUseOrYouWillBeFired: (...arg: any) => any;
17
15
  };
18
16
  export default BhdMessage;
@@ -1,13 +1,16 @@
1
1
  import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
2
2
  import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
3
+ import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array";
4
+ var _message, _message1, _message2, _message3, _message4, _message5, _message6, _message7, _message8;
3
5
  import { jsx as _jsx } from "@ice/jsx-runtime/jsx-runtime";
4
6
  import * as React from "react";
5
7
  import styles from "./index.module.less";
6
- import { message } from "antd";
8
+ import { message } from "../bhdTipModal/modal";
7
9
  import { ExclamationCircleFilled } from "../icons/index";
8
- var BhdMessage = _object_spread_props(_object_spread({}, message), {
10
+ var BhdMessage = {
9
11
  customSuccess: function(config) {
10
12
  var className = styles.customSuccess;
13
+ console.log("customSuccess", message);
11
14
  if (typeof config === "string") {
12
15
  return message.success({
13
16
  content: config,
@@ -43,6 +46,60 @@ var BhdMessage = _object_spread_props(_object_spread({}, message), {
43
46
  className: "".concat(className, " ").concat(config.className || ""),
44
47
  icon: config.icon || /*#__PURE__*/ _jsx(ExclamationCircleFilled, {})
45
48
  }));
49
+ },
50
+ open: function() {
51
+ for(var _len = arguments.length, arg = new Array(_len), _key = 0; _key < _len; _key++){
52
+ arg[_key] = arguments[_key];
53
+ }
54
+ return (_message = message).open.apply(_message, _to_consumable_array(arg));
55
+ },
56
+ destroy: function() {
57
+ for(var _len = arguments.length, arg = new Array(_len), _key = 0; _key < _len; _key++){
58
+ arg[_key] = arguments[_key];
59
+ }
60
+ return (_message1 = message).destroy.apply(_message1, _to_consumable_array(arg));
61
+ },
62
+ error: function() {
63
+ for(var _len = arguments.length, arg = new Array(_len), _key = 0; _key < _len; _key++){
64
+ arg[_key] = arguments[_key];
65
+ }
66
+ return (_message2 = message).error.apply(_message2, _to_consumable_array(arg));
67
+ },
68
+ info: function() {
69
+ for(var _len = arguments.length, arg = new Array(_len), _key = 0; _key < _len; _key++){
70
+ arg[_key] = arguments[_key];
71
+ }
72
+ return (_message3 = message).info.apply(_message3, _to_consumable_array(arg));
73
+ },
74
+ loading: function() {
75
+ for(var _len = arguments.length, arg = new Array(_len), _key = 0; _key < _len; _key++){
76
+ arg[_key] = arguments[_key];
77
+ }
78
+ return (_message4 = message).loading.apply(_message4, _to_consumable_array(arg));
79
+ },
80
+ success: function() {
81
+ for(var _len = arguments.length, arg = new Array(_len), _key = 0; _key < _len; _key++){
82
+ arg[_key] = arguments[_key];
83
+ }
84
+ return (_message5 = message).success.apply(_message5, _to_consumable_array(arg));
85
+ },
86
+ useMessage: function() {
87
+ for(var _len = arguments.length, arg = new Array(_len), _key = 0; _key < _len; _key++){
88
+ arg[_key] = arguments[_key];
89
+ }
90
+ return (_message6 = message).useMessage.apply(_message6, _to_consumable_array(arg));
91
+ },
92
+ warning: function() {
93
+ for(var _len = arguments.length, arg = new Array(_len), _key = 0; _key < _len; _key++){
94
+ arg[_key] = arguments[_key];
95
+ }
96
+ return (_message7 = message).warning.apply(_message7, _to_consumable_array(arg));
97
+ },
98
+ _InternalPanelDoNotUseOrYouWillBeFired: function() {
99
+ for(var _len = arguments.length, arg = new Array(_len), _key = 0; _key < _len; _key++){
100
+ arg[_key] = arguments[_key];
101
+ }
102
+ return (_message8 = message)._InternalPanelDoNotUseOrYouWillBeFired.apply(_message8, _to_consumable_array(arg));
46
103
  }
47
- });
104
+ };
48
105
  export default BhdMessage;
@@ -1,3 +1,9 @@
1
1
  import type { ConfigProviderProps } from "antd/es/config-provider";
2
- declare const config: ConfigProviderProps;
2
+ import type { ConfigOptions } from "antd/es/message/interface";
3
+ import type { NotificationConfig } from "antd/es/notification/interface";
4
+ interface IConfigProviderProps extends ConfigProviderProps {
5
+ message: ConfigOptions;
6
+ notification: NotificationConfig;
7
+ }
8
+ declare const config: IConfigProviderProps;
3
9
  export default config;
@@ -42,6 +42,12 @@ var config = {
42
42
  }
43
43
  }
44
44
  },
45
- locale: zhCN
45
+ locale: zhCN,
46
+ message: {
47
+ top: 100,
48
+ duration: 3,
49
+ maxCount: 1
50
+ },
51
+ notification: {}
46
52
  };
47
53
  export default config;
@@ -2,15 +2,17 @@ import { _ as _extends } from "@swc/helpers/_/_extends";
2
2
  import { _ as _object_destructuring_empty } from "@swc/helpers/_/_object_destructuring_empty";
3
3
  import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
4
4
  import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
5
- import { jsx as _jsx } from "@ice/jsx-runtime/jsx-runtime";
5
+ import { jsx as _jsx, jsxs as _jsxs } from "@ice/jsx-runtime/jsx-runtime";
6
6
  import * as React from "react";
7
- import { ConfigProvider } from "antd";
7
+ import { ConfigProvider, App } from "antd";
8
8
  import config from "./config";
9
9
  import "../theme/variable.less";
10
10
  import { StyleProvider, legacyLogicalPropertiesTransformer } from "@ant-design/cssinjs";
11
+ import BhdTipModal from "../bhdTipModal/modal";
11
12
  var Provider = function(Component) {
12
13
  var customConfig = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
13
14
  var AppConfig = Object.assign(config, customConfig);
15
+ var _AppConfig_message = AppConfig.message, message = _AppConfig_message === void 0 ? {} : _AppConfig_message, _AppConfig_notification = AppConfig.notification, notification = _AppConfig_notification === void 0 ? {} : _AppConfig_notification;
14
16
  ConfigProvider.config(AppConfig);
15
17
  ConfigProvider.__proto__.lang = AppConfig.locale.locale;
16
18
  return function(_param) {
@@ -21,7 +23,14 @@ var Provider = function(Component) {
21
23
  transformers: [
22
24
  legacyLogicalPropertiesTransformer
23
25
  ],
24
- children: /*#__PURE__*/ _jsx(Component, _object_spread({}, props))
26
+ children: /*#__PURE__*/ _jsxs(App, {
27
+ message: message,
28
+ notification: notification,
29
+ children: [
30
+ /*#__PURE__*/ _jsx(BhdTipModal, {}),
31
+ /*#__PURE__*/ _jsx(Component, _object_spread({}, props))
32
+ ]
33
+ })
25
34
  })
26
35
  }));
27
36
  };
@@ -30,13 +39,21 @@ Provider.Component = function(props) {
30
39
  var AppConfig = Object.assign(config, props);
31
40
  ConfigProvider.__proto__.lang = AppConfig.locale.locale;
32
41
  ConfigProvider.config(AppConfig);
42
+ var _AppConfig_message = AppConfig.message, message = _AppConfig_message === void 0 ? {} : _AppConfig_message, _AppConfig_notification = AppConfig.notification, notification = _AppConfig_notification === void 0 ? {} : _AppConfig_notification;
33
43
  return /*#__PURE__*/ _jsx(ConfigProvider, _object_spread_props(_object_spread({}, AppConfig), {
34
44
  children: /*#__PURE__*/ _jsx(StyleProvider, {
35
45
  hashPriority: "high",
36
46
  transformers: [
37
47
  legacyLogicalPropertiesTransformer
38
48
  ],
39
- children: props.children
49
+ children: /*#__PURE__*/ _jsxs(App, {
50
+ message: message,
51
+ notification: notification,
52
+ children: [
53
+ /*#__PURE__*/ _jsx(BhdTipModal, {}),
54
+ props.children
55
+ ]
56
+ })
40
57
  })
41
58
  }));
42
59
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bhd-components",
3
- "version": "0.7.34",
3
+ "version": "0.7.35",
4
4
  "description": "组件功能描述",
5
5
  "files": [
6
6
  "esm",