dtable-ui-component 6.0.113-mba.9 → 6.0.113-mzn.2

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.
@@ -193,10 +193,11 @@ var _jsxRuntime = require("react/jsx-runtime");
193
193
  className: "filter-popover-footer",
194
194
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.Button, {
195
195
  disabled: readOnly,
196
- className: "mr-2",
196
+ className: "dtable-button mr-2",
197
197
  onClick: this.onClosePopover,
198
198
  children: (0, _lang.getLocale)('Cancel')
199
199
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.Button, {
200
+ className: "dtable-button",
200
201
  disabled: this.state.isSubmitDisabled || readOnly,
201
202
  color: "primary",
202
203
  onClick: this.onSubmitFilters,
@@ -10,6 +10,7 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
10
10
  var _react = _interopRequireDefault(require("react"));
11
11
  var _reactstrap = require("reactstrap");
12
12
  var _IconButton = _interopRequireDefault(require("../IconButton"));
13
+ var _lang = require("../lang");
13
14
  require("./index.css");
14
15
  var _jsxRuntime = require("react/jsx-runtime");
15
16
  const _excluded = ["children"];
@@ -26,7 +27,8 @@ const DTableModalHeader = _ref => {
26
27
  onClick: props.toggle,
27
28
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
28
29
  icon: "x",
29
- className: "dtable-modal-close-inner"
30
+ className: "dtable-modal-close-inner",
31
+ title: (0, _lang.getLocale)('Close')
30
32
  })
31
33
  });
32
34
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.ModalHeader, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
@@ -1,10 +1,11 @@
1
1
  .dtable-tooltip {
2
2
  position: absolute;
3
- z-index: 1070;
3
+ z-index: 99999;
4
4
  }
5
5
 
6
6
  .dtable-tooltip .tooltip {
7
7
  max-width: 242px;
8
+ min-width: max-content;
8
9
  opacity: 1;
9
10
  }
10
11
 
@@ -17,7 +18,6 @@
17
18
  padding: 4px 8px;
18
19
  line-height: 20px;
19
20
  font-weight: normal;
20
- white-space: normal;
21
21
  }
22
22
 
23
23
  .dtable-tooltip-shortcut-inner {
@@ -9,6 +9,7 @@ var _react = _interopRequireDefault(require("react"));
9
9
  var _ClickOutside = _interopRequireDefault(require("../ClickOutside"));
10
10
  var _ModalPortal = _interopRequireDefault(require("../ModalPortal"));
11
11
  var _lang = require("../lang");
12
+ var _reactstrap = require("reactstrap");
12
13
  require("./index.css");
13
14
  var _jsxRuntime = require("react/jsx-runtime");
14
15
  class DeleteTip extends _react.default.Component {
@@ -42,12 +43,13 @@ class DeleteTip extends _react.default.Component {
42
43
  children: deleteTip
43
44
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
44
45
  className: "d-flex justify-content-end",
45
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
46
- className: "btn btn-secondary mr-2",
46
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.Button, {
47
+ className: "dtable-button mr-2",
47
48
  onClick: toggle,
48
49
  children: (0, _lang.getLocale)('Cancel')
49
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
50
- className: "btn btn-primary",
50
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.Button, {
51
+ className: "dtable-button",
52
+ color: "primary",
51
53
  onClick: handleDelete,
52
54
  children: (0, _lang.getLocale)('Delete')
53
55
  })]
@@ -180,11 +180,13 @@ class PCDigitalSignEditor extends _react.Component {
180
180
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.Button, {
181
181
  onClick: this.props.onCommitCancel,
182
182
  color: "secondary",
183
+ className: "dtable-button",
183
184
  children: (0, _lang.getLocale)('Cancel')
184
185
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.Button, {
185
186
  onClick: this.saveSignature,
186
187
  color: "primary",
187
188
  disabled: saving,
189
+ className: "dtable-button",
188
190
  children: (0, _lang.getLocale)(saving ? 'Saving' : 'Save')
189
191
  })]
190
192
  })]
@@ -340,10 +340,12 @@ class LocationEditor extends _react.Component {
340
340
  children: this.state.errMessage
341
341
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_DTableCustomFooter.default, {
342
342
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.Button, {
343
+ className: "dtable-button",
343
344
  onClick: this.props.onCancel,
344
345
  color: "secondary",
345
346
  children: (0, _lang.getLocale)('Cancel')
346
347
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.Button, {
348
+ className: "dtable-button",
347
349
  onClick: this.onSubmit,
348
350
  color: "primary",
349
351
  children: (0, _lang.getLocale)('Submit')
@@ -261,10 +261,12 @@ class ProvinceCityEditor extends _react.Component {
261
261
  children: this.state.errMessage
262
262
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_DTableCustomFooter.default, {
263
263
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.Button, {
264
+ className: "dtable-button",
264
265
  onClick: this.props.onCancel,
265
266
  color: "secondary",
266
267
  children: (0, _lang.getLocale)('Cancel')
267
268
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.Button, {
269
+ className: "dtable-button",
268
270
  onClick: this.onSubmit,
269
271
  color: "primary",
270
272
  autoFocus: true,
@@ -1,33 +1,56 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
7
8
  exports.default = void 0;
8
9
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
9
10
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
10
- var _react = _interopRequireDefault(require("react"));
11
+ var _react = _interopRequireWildcard(require("react"));
11
12
  var _classnames = _interopRequireDefault(require("classnames"));
13
+ var _DTableToolTip = _interopRequireDefault(require("../DTableToolTip"));
14
+ var _dtableUtils = require("dtable-utils");
15
+ require("../css/icon-button-styles.css");
12
16
  var _jsxRuntime = require("react/jsx-runtime");
13
- const _excluded = ["disabled", "className", "icon", "children"];
17
+ const _excluded = ["disabled", "className", "icon", "color", "children", "title", "tooltipPlacement", "outline", "noBackground"];
14
18
  const IconButton = _ref => {
15
19
  let {
16
20
  disabled,
17
21
  className,
18
22
  icon,
19
- children
23
+ color,
24
+ children,
25
+ title,
26
+ tooltipPlacement,
27
+ outline,
28
+ noBackground
20
29
  } = _ref,
21
30
  otherProperties = (0, _objectWithoutProperties2.default)(_ref, _excluded);
22
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", (0, _objectSpread2.default)((0, _objectSpread2.default)({
23
- className: (0, _classnames.default)('seatable-icon-btn', className, {
24
- 'disabled': disabled
25
- })
26
- }, otherProperties), {}, {
27
- children: [icon && /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
28
- className: (0, _classnames.default)('seatable-icon dtable-font', "dtable-icon-".concat(icon)),
29
- "aria-hidden": "true"
30
- }), children]
31
- }));
31
+ const buttonIdRef = (0, _react.useRef)("dtable-icon-button-".concat((0, _dtableUtils.generatorBase64Code)(8)));
32
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
33
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", (0, _objectSpread2.default)((0, _objectSpread2.default)({
34
+ id: buttonIdRef.current,
35
+ className: (0, _classnames.default)('dtable-icon-btn', className, {
36
+ 'disabled': disabled,
37
+ 'outline': outline,
38
+ 'no-background': noBackground
39
+ }),
40
+ "aria-label": title
41
+ }, otherProperties), {}, {
42
+ children: [icon && /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
43
+ className: (0, _classnames.default)('seatable-icon dtable-font', "dtable-icon-".concat(icon)),
44
+ "aria-hidden": "true",
45
+ style: color ? {
46
+ color
47
+ } : undefined
48
+ }), children]
49
+ })), title && /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableToolTip.default, {
50
+ placement: tooltipPlacement || 'bottom',
51
+ target: buttonIdRef.current,
52
+ children: title
53
+ })]
54
+ });
32
55
  };
33
56
  var _default = exports.default = IconButton;
@@ -8,6 +8,7 @@ exports.default = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
  var _reactstrap = require("reactstrap");
10
10
  var _IconButton = _interopRequireDefault(require("../IconButton"));
11
+ var _lang = require("../lang");
11
12
  require("./index.css");
12
13
  var _jsxRuntime = require("react/jsx-runtime");
13
14
  class NotificationPopover extends _react.default.Component {
@@ -61,6 +62,7 @@ class NotificationPopover extends _react.default.Component {
61
62
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
62
63
  className: "notification-header",
63
64
  children: [headerText, /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
65
+ title: (0, _lang.getLocale)('Close'),
64
66
  icon: "x",
65
67
  onClick: this.props.onNotificationListToggle
66
68
  })]
@@ -223,10 +223,12 @@ const RowExpandDialog = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
223
223
  children: children[1]
224
224
  })), (!saveImmediately || isInsertingRow) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactstrap.ModalFooter, {
225
225
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.Button, {
226
+ className: "dtable-button",
226
227
  onClick: toggle,
227
228
  color: "secondary",
228
229
  children: (0, _lang.getLocale)('Cancel')
229
230
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.Button, {
231
+ className: "dtable-button",
230
232
  onClick: onSubmit,
231
233
  disabled: isSaving || !isChangedRef.current,
232
234
  color: "primary",
@@ -0,0 +1,152 @@
1
+ .dtable-button {
2
+ display: inline-flex !important;
3
+ align-items: center !important;
4
+ justify-content: center !important;
5
+ gap: 6px !important;
6
+ padding: 0 12px !important;
7
+ min-height: 32px !important;
8
+ font-size: 14px !important;
9
+ font-weight: normal !important;
10
+ border-radius: 3px !important;
11
+ cursor: pointer !important;
12
+ transition: all 0.2s ease !important;
13
+ white-space: nowrap !important;
14
+ outline: none !important;
15
+ font-family: inherit !important;
16
+ border: 1px solid transparent !important;
17
+ }
18
+
19
+ .dtable-button:focus {
20
+ outline: none !important;
21
+ box-shadow: none !important;
22
+ }
23
+
24
+ .dtable-button:active:focus {
25
+ box-shadow: none !important;
26
+ }
27
+
28
+ .btn-sm.dtable-button,
29
+ .dtable-button.btn-sm {
30
+ min-height: 26px !important;
31
+ padding: 0 8px !important;
32
+ font-size: 12px !important;
33
+ gap: 4px !important;
34
+ }
35
+
36
+ .btn-lg.dtable-button,
37
+ .dtable-button.btn-lg {
38
+ min-height: 38px !important;
39
+ padding: 0 16px !important;
40
+ font-size: 14px !important;
41
+ }
42
+
43
+ .dtable-button.btn-warning,
44
+ .btn-warning.dtable-button {
45
+ background-color: #FF8000 !important;
46
+ color: #FFFFFF !important;
47
+ border-color: #FF8000 !important;
48
+ }
49
+
50
+ .dtable-button.btn-warning:hover:not(:disabled),
51
+ .btn-warning.dtable-button:hover:not(:disabled) {
52
+ background-color: #ED7109 !important;
53
+ border-color: #ED7109 !important;
54
+ color: #FFFFFF !important;
55
+ }
56
+
57
+ .dtable-button.btn-warning:active:not(:disabled),
58
+ .btn-warning.dtable-button:active:not(:disabled) {
59
+ background-color: #E16B09 !important;
60
+ border-color: #E16B09 !important;
61
+ color: #FFFFFF !important;
62
+ }
63
+
64
+ /* light color - 映射到 DTable 默认样式 */
65
+ .dtable-button.btn-light,
66
+ .btn-light.dtable-button {
67
+ background-color: #FFFFFF !important;
68
+ color: #ED7109 !important;
69
+ border-color: #ED7109 !important;
70
+ }
71
+
72
+ .dtable-button.btn-light:hover:not(:disabled),
73
+ .btn-light.dtable-button:hover:not(:disabled) {
74
+ background-color: #ED7109 !important;
75
+ color: #FFFFFF !important;
76
+ border-color: #ED7109 !important;
77
+ }
78
+
79
+ .dtable-button.btn-light:active:not(:disabled),
80
+ .btn-light.dtable-button:active:not(:disabled) {
81
+ background-color: #E16B09 !important;
82
+ color: #FFFFFF !important;
83
+ border-color: #E16B09 !important;
84
+ }
85
+
86
+ .dtable-button.btn-secondary,
87
+ .btn-secondary.dtable-button {
88
+ background-color: #FFFFFF !important;
89
+ color: #212529 !important;
90
+ border-color: rgba(0, 40, 100, 0.12) !important;
91
+ }
92
+
93
+ .dtable-button.btn-secondary:hover:not(:disabled),
94
+ .btn-secondary.dtable-button:hover:not(:disabled) {
95
+ background-color: rgba(0, 0, 0, 0.04) !important;
96
+ border-color: rgba(0, 40, 100, 0.12) !important;
97
+ color: #212529 !important;
98
+ }
99
+
100
+ .dtable-button.btn-secondary:active:not(:disabled),
101
+ .btn-secondary.dtable-button:active:not(:disabled) {
102
+ background-color: #E9E9E9 !important;
103
+ border-color: rgba(0, 40, 100, 0.12) !important;
104
+ color: #212529 !important;
105
+ }
106
+
107
+ .dtable-button.btn-primary,
108
+ .btn-primary.dtable-button {
109
+ background-color: #FF8000 !important;
110
+ color: #FFFFFF !important;
111
+ border-color: #FF8000 !important;
112
+ }
113
+
114
+ .dtable-button.btn-primary:hover:not(:disabled),
115
+ .btn-primary.dtable-button:hover:not(:disabled) {
116
+ background-color: #ED7109 !important;
117
+ border-color: #ED7109 !important;
118
+ color: #FFFFFF !important;
119
+ }
120
+
121
+ .dtable-button.btn-primary:active:not(:disabled),
122
+ .btn-primary.dtable-button:active:not(:disabled) {
123
+ background-color: #E16B09 !important;
124
+ border-color: #E16B09 !important;
125
+ color: #FFFFFF !important;
126
+ }
127
+
128
+ .dtable-button:disabled,
129
+ .dtable-button.disabled {
130
+ opacity: 0.65 !important;
131
+ cursor: not-allowed !important;
132
+ }
133
+
134
+ .dtable-button.block {
135
+ display: flex !important;
136
+ width: 100% !important;
137
+ }
138
+
139
+ .dtable-button i,
140
+ .dtable-button svg,
141
+ .dtable-button .icon {
142
+ display: inline-block;
143
+ font-size: 14px;
144
+ line-height: 1;
145
+ margin: 0;
146
+ }
147
+
148
+ .btn-sm.dtable-button i,
149
+ .btn-sm.dtable-button svg,
150
+ .btn-sm.dtable-button .icon {
151
+ font-size: 12px;
152
+ }
@@ -0,0 +1,141 @@
1
+ .dtable-icon-btn {
2
+ display: inline-flex !important;
3
+ align-items: center !important;
4
+ justify-content: center !important;
5
+ padding: 0 !important;
6
+ border: none !important;
7
+ background-color: transparent !important;
8
+ color: #666666 !important;
9
+ cursor: pointer;
10
+ transition: all 0.2s ease !important;
11
+ outline: none !important;
12
+ border-radius: 3px !important;
13
+ min-width: 32px;
14
+ min-height: 32px;
15
+ }
16
+
17
+ .dtable-icon-btn:focus {
18
+ outline: none !important;
19
+ box-shadow: none !important;
20
+ }
21
+
22
+ .dtable-icon-btn:active:focus {
23
+ box-shadow: none !important;
24
+ }
25
+
26
+ .dtable-icon-btn.btn-lg,
27
+ .dtable-icon-btn.size-lg {
28
+ min-width: 40px !important;
29
+ min-height: 40px !important;
30
+ }
31
+
32
+ .dtable-icon-btn.btn-lg .dtable-icon-btn__icon,
33
+ .dtable-icon-btn.size-lg .dtable-icon-btn__icon {
34
+ font-size: 20px !important;
35
+ }
36
+
37
+ .dtable-icon-btn .dtable-icon-btn__icon {
38
+ font-size: 16px !important;
39
+ }
40
+
41
+ .dtable-icon-btn.btn-sm,
42
+ .dtable-icon-btn.size-sm {
43
+ min-width: 24px !important;
44
+ min-height: 24px !important;
45
+ }
46
+
47
+ .dtable-icon-btn.btn-sm .dtable-icon-btn__icon,
48
+ .dtable-icon-btn.size-sm .dtable-icon-btn__icon {
49
+ font-size: 14px !important;
50
+ }
51
+
52
+ .dtable-icon-btn.size-xs {
53
+ min-width: 20px !important;
54
+ min-height: 20px !important;
55
+ }
56
+
57
+ .dtable-icon-btn.size-xs .dtable-icon-btn__icon {
58
+ font-size: 12px !important;
59
+ }
60
+
61
+ .dtable-icon-btn:hover:not(:disabled) {
62
+ background-color: rgba(0, 0, 0, 0.04) !important;
63
+ }
64
+
65
+ .dtable-icon-btn:active:not(:disabled) {
66
+ background-color: rgba(0, 0, 0, 0.08) !important;
67
+ }
68
+
69
+ .dtable-icon-btn.outline,
70
+ .dtable-icon-btn.outlined {
71
+ background-color: #FFFFFF !important;
72
+ border: 1px solid rgba(0, 40, 100, 0.12) !important;
73
+ color: #666666 !important;
74
+ }
75
+
76
+ .dtable-icon-btn.outline:hover:not(:disabled),
77
+ .dtable-icon-btn.outlined:hover:not(:disabled) {
78
+ background-color: rgba(0, 0, 0, 0.04) !important;
79
+ border-color: rgba(0, 40, 100, 0.12) !important;
80
+ }
81
+
82
+ .dtable-icon-btn.outline:active:not(:disabled),
83
+ .dtable-icon-btn.outlined:active:not(:disabled) {
84
+ background-color: rgba(0, 0, 0, 0.08) !important;
85
+ border-color: rgba(0, 40, 100, 0.12) !important;
86
+ }
87
+
88
+ .dtable-icon-btn.no-background,
89
+ .dtable-icon-btn.no-display-bac {
90
+ background-color: transparent !important;
91
+ }
92
+
93
+ .dtable-icon-btn.no-background:hover:not(:disabled),
94
+ .dtable-icon-btn.no-display-bac:hover:not(:disabled) {
95
+ background-color: transparent !important;
96
+ }
97
+
98
+ .dtable-icon-btn.no-background:active:not(:disabled),
99
+ .dtable-icon-btn.no-display-bac:active:not(:disabled) {
100
+ background-color: transparent !important;
101
+ }
102
+
103
+ .dtable-icon-btn:disabled,
104
+ .dtable-icon-btn.disabled {
105
+ opacity: 0.65 !important;
106
+ cursor: not-allowed !important;
107
+ }
108
+
109
+ .dtable-icon-btn__icon {
110
+ display: inline-block;
111
+ line-height: 1;
112
+ margin: 0;
113
+ font-weight: normal;
114
+ }
115
+
116
+ .dtable-icon-btn.btn-primary,
117
+ .dtable-icon-btn.color-primary {
118
+ color: #FF8000 !important;
119
+ }
120
+
121
+ .dtable-icon-btn.btn-primary:hover:not(:disabled),
122
+ .dtable-icon-btn.color-primary:hover:not(:disabled) {
123
+ color: #ED7109 !important;
124
+ background-color: rgba(255, 128, 0, 0.1) !important;
125
+ }
126
+
127
+ .dtable-icon-btn.btn-secondary,
128
+ .dtable-icon-btn.color-secondary {
129
+ color: #212529 !important;
130
+ }
131
+
132
+ .dtable-icon-btn.btn-danger,
133
+ .dtable-icon-btn.color-danger {
134
+ color: #dc3545 !important;
135
+ }
136
+
137
+ .dtable-icon-btn.btn-danger:hover:not(:disabled),
138
+ .dtable-icon-btn.color-danger:hover:not(:disabled) {
139
+ color: #c82333 !important;
140
+ background-color: rgba(220, 53, 69, 0.1) !important;
141
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "6.0.113mba.9",
3
+ "version": "6.0.113mzn.2",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "^5.0.6",
@@ -134,6 +134,7 @@
134
134
  "storybook": "^9.1.19",
135
135
  "style-loader": "^3.3.1",
136
136
  "terser-webpack-plugin": "^5.2.5",
137
+ "url": "^0.11.4",
137
138
  "url-loader": "^4.1.1",
138
139
  "webpack": "^5.105.4",
139
140
  "webpack-dev-server": "^5.2.3",