dtable-ui-component 6.0.113-atd.1 → 6.0.113-gtm.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.
@@ -0,0 +1,239 @@
1
+ .dtable-custom-button {
2
+ display: inline-flex !important;
3
+ align-items: center;
4
+ justify-content: center;
5
+ gap: 8px;
6
+ padding: 0 12px !important;
7
+ min-height: 32px;
8
+ font-size: 14px;
9
+ font-weight: 500;
10
+ border-radius: 4px;
11
+ cursor: pointer;
12
+ transition: all 0.3s ease;
13
+ white-space: nowrap;
14
+ outline: none;
15
+ font-family: inherit;
16
+ border: 1px solid transparent !important;
17
+ }
18
+
19
+ .dtable-custom-button:focus {
20
+ outline: none;
21
+ box-shadow: none !important;
22
+ }
23
+
24
+ .dtable-custom-button:active:focus {
25
+ box-shadow: none !important;
26
+ }
27
+
28
+ .dtable-custom-button__text {
29
+ display: inline-block;
30
+ }
31
+
32
+ .dtable-custom-button__icon {
33
+ display: inline-block;
34
+ font-size: 14px;
35
+ line-height: 1;
36
+ margin: 0;
37
+ }
38
+
39
+ /* ============ Size Variants ============ */
40
+
41
+ .dtable-custom-button--max {
42
+ min-height: 40px !important;
43
+ padding: 0 16px !important;
44
+ font-size: 14px;
45
+ }
46
+
47
+ .dtable-custom-button--max .dtable-custom-button__icon {
48
+ font-size: 14px;
49
+ }
50
+
51
+ .dtable-custom-button--large {
52
+ min-height: 38px !important;
53
+ padding: 0 16px !important;
54
+ font-size: 14px;
55
+ }
56
+
57
+ .dtable-custom-button--large .dtable-custom-button__icon {
58
+ font-size: 14px;
59
+ }
60
+
61
+ .dtable-custom-button--middle {
62
+ min-height: 32px !important;
63
+ padding: 0 12px !important;
64
+ font-size: 14px;
65
+ }
66
+
67
+ .dtable-custom-button--middle .dtable-custom-button__icon {
68
+ font-size: 14px;
69
+ }
70
+
71
+ .dtable-custom-button--small {
72
+ min-height: 26px !important;
73
+ padding: 0 8px !important;
74
+ font-size: 12px;
75
+ gap: 4px !important;
76
+ }
77
+
78
+ .dtable-custom-button--small .dtable-custom-button__icon {
79
+ font-size: 12px;
80
+ }
81
+
82
+ /* ============ Color Variants - Primary ============ */
83
+
84
+ .dtable-custom-button--primary {
85
+ background-color: #FF8000 !important;
86
+ color: #FFFFFF !important;
87
+ border: 1px solid #FF8000 !important;
88
+ }
89
+
90
+ .dtable-custom-button--primary:hover:not(:disabled) {
91
+ background-color: #ED7109 !important;
92
+ border-color: #ED7109 !important;
93
+ }
94
+
95
+ .dtable-custom-button--primary:active:not(:disabled) {
96
+ background-color: #E16B09 !important;
97
+ border-color: #E16B09 !important;
98
+ }
99
+
100
+ /* ============ Color Variants - Default ============ */
101
+
102
+ .dtable-custom-button--default {
103
+ background-color: #FFFFFF !important;
104
+ color: #ED7109 !important;
105
+ border: 1px solid #ED7109 !important;
106
+ }
107
+
108
+ .dtable-custom-button--default:hover:not(:disabled) {
109
+ background-color: #ED7109 !important;
110
+ color: #FFFFFF !important;
111
+ border-color: #ED7109 !important;
112
+ }
113
+
114
+ .dtable-custom-button--default:active:not(:disabled) {
115
+ background-color: #E16B09 !important;
116
+ color: #FFFFFF !important;
117
+ border-color: #E16B09 !important;
118
+ }
119
+
120
+ /* ============ Color Variants - Secondary ============ */
121
+
122
+ .dtable-custom-button--secondary {
123
+ background-color: #FFFFFF !important;
124
+ color: #212529 !important;
125
+ border: 1px solid rgba(0, 40, 100, 0.12) !important;
126
+ }
127
+
128
+ .dtable-custom-button--secondary:hover:not(:disabled) {
129
+ background-color: rgba(0, 0, 0, 0.04) !important;
130
+ border-color: rgba(0, 40, 100, 0.12) !important;
131
+ }
132
+
133
+ .dtable-custom-button--secondary:active:not(:disabled) {
134
+ background-color: #E9E9E9 !important;
135
+ border-color: rgba(0, 40, 100, 0.12) !important;
136
+ }
137
+
138
+ /* ============ Color Variants - Secondary Filled ============ */
139
+
140
+ .dtable-custom-button--secondary-filled {
141
+ background-color: #F5F5F5 !important;
142
+ color: #212529 !important;
143
+ border: none !important;
144
+ }
145
+
146
+ .dtable-custom-button--secondary-filled:hover:not(:disabled) {
147
+ background-color: #EBEBEB !important;
148
+ }
149
+
150
+ .dtable-custom-button--secondary-filled:active:not(:disabled) {
151
+ background-color: #DDDDDD !important;
152
+ }
153
+
154
+ /* ============ State: Disabled ============ */
155
+
156
+ .dtable-custom-button:disabled {
157
+ opacity: 0.65 !important;
158
+ cursor: not-allowed !important;
159
+ }
160
+
161
+ /* ============ Block Mode ============ */
162
+
163
+ .dtable-custom-button--block {
164
+ display: flex !important;
165
+ width: 100%;
166
+ }
167
+
168
+ /* ============ Inline Mode ============ */
169
+
170
+ .dtable-custom-button--inline {
171
+ height: 32px !important;
172
+ display: inline-flex !important;
173
+ padding: 0 8px !important;
174
+ font-size: 14px;
175
+ border-radius: 2px;
176
+ border: 1px solid rgba(0, 40, 100, 0.12) !important;
177
+ background-color: #FFFFFF !important;
178
+ color: #212529 !important;
179
+ gap: 4px;
180
+ }
181
+
182
+ .dtable-custom-button--inline:hover:not(:disabled) {
183
+ background-color: rgba(0, 0, 0, 0.04) !important;
184
+ }
185
+
186
+ .dtable-custom-button--inline:active:not(:disabled) {
187
+ background-color: rgba(0, 0, 0, 0.08) !important;
188
+ }
189
+
190
+ /* ============ With Icon ============ */
191
+
192
+ .dtable-custom-button--with-icon {
193
+ gap: 8px;
194
+ }
195
+
196
+ /* Icon color adjustments for different variants(default,secondary,secondary-filled) */
197
+ .dtable-custom-button--default.dtable-custom-button--with-icon .dtable-custom-button__icon {
198
+ color: #ED7109;
199
+ }
200
+
201
+ .dtable-custom-button--default:hover:not(:disabled).dtable-custom-button--with-icon .dtable-custom-button__icon {
202
+ color: #FFFFFF;
203
+ }
204
+
205
+ .dtable-custom-button--default:active:not(:disabled).dtable-custom-button--with-icon .dtable-custom-button__icon {
206
+ color: #FFFFFF;
207
+ }
208
+
209
+ .dtable-custom-button--default:disabled.dtable-custom-button--with-icon .dtable-custom-button__icon {
210
+ color: #ED7109;
211
+ opacity: 0.65;
212
+ }
213
+
214
+ .dtable-custom-button--secondary.dtable-custom-button--with-icon .dtable-custom-button__icon,
215
+ .dtable-custom-button--secondary-filled.dtable-custom-button--with-icon .dtable-custom-button__icon,
216
+ .dtable-custom-button--secondary:active:not(:disabled).dtable-custom-button--with-icon .dtable-custom-button__icon,
217
+ .dtable-custom-button--secondary-filled:active:not(:disabled).dtable-custom-button--with-icon .dtable-custom-button__icon,
218
+ .dtable-custom-button--secondary:hover:not(:disabled).dtable-custom-button--with-icon .dtable-custom-button__icon,
219
+ .dtable-custom-button--secondary-filled:hover:not(:disabled).dtable-custom-button--with-icon .dtable-custom-button__icon {
220
+ color: #666666;
221
+ }
222
+
223
+ .secondary-filled-dtable,
224
+ .secondary-filled-dtable .dtable-custom-button__text,
225
+ .secondary-filled-dtable:hover:not(:disabled).dtable-custom-button--with-icon .dtable-custom-button__icon,
226
+ .secondary-filled-dtable:active:not(:disabled).dtable-custom-button--with-icon .dtable-custom-button__icon {
227
+ color: #ED7109 !important;
228
+ }
229
+
230
+ .secondary-filled-dtable:disabled.dtable-custom-button--with-icon .dtable-custom-button__icon {
231
+ color: #ED7109 !important;
232
+ opacity: 0.65;
233
+ }
234
+
235
+ .dtable-custom-button--secondary:disabled.dtable-custom-button--with-icon .dtable-custom-button__icon,
236
+ .dtable-custom-button--secondary-filled:disabled.dtable-custom-button--with-icon .dtable-custom-button__icon {
237
+ color: #666666;
238
+ opacity: 0.65;
239
+ }
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = void 0;
8
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
9
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
10
+ var _react = _interopRequireDefault(require("react"));
11
+ var _reactstrap = require("reactstrap");
12
+ var _classnames = _interopRequireDefault(require("classnames"));
13
+ require("./index.css");
14
+ var _jsxRuntime = require("react/jsx-runtime");
15
+ const _excluded = ["variant", "size", "block", "inline", "disabled", "icon", "iconPosition", "className", "children", "outline", "fillColor"];
16
+ const DtableCustomButton = _ref => {
17
+ let {
18
+ variant = 'default',
19
+ size = 'middle',
20
+ block = false,
21
+ inline = false,
22
+ disabled = false,
23
+ icon = null,
24
+ iconPosition = 'left',
25
+ className = '',
26
+ children,
27
+ outline = false,
28
+ fillColor = false
29
+ } = _ref,
30
+ otherProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
31
+ const getReactstrapColor = variant => {
32
+ const colorMap = {
33
+ 'primary': 'warning',
34
+ 'default': 'light',
35
+ 'secondary': 'light',
36
+ 'secondary-filled': 'light'
37
+ };
38
+ return colorMap[variant] || 'light';
39
+ };
40
+ const btnClassNames = (0, _classnames.default)('dtable-custom-button', "dtable-custom-button--".concat(variant), "dtable-custom-button--".concat(size), "".concat(fillColor && variant === 'secondary-filled' ? 'secondary-filled-dtable' : ''), {
41
+ 'dtable-custom-button--block': block,
42
+ 'dtable-custom-button--inline': inline,
43
+ 'dtable-custom-button--with-icon': icon,
44
+ 'dtable-custom-button--icon-right': icon && iconPosition === 'right'
45
+ }, className);
46
+ const iconElement = icon && /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
47
+ className: (0, _classnames.default)('seatable-icon dtable-font dtable-custom-button__icon', "dtable-icon-".concat(icon)),
48
+ "aria-hidden": "true"
49
+ });
50
+ const isOutline = outline || ['default', 'secondary'].includes(variant);
51
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactstrap.Button, (0, _objectSpread2.default)((0, _objectSpread2.default)({
52
+ className: btnClassNames,
53
+ color: getReactstrapColor(variant),
54
+ outline: isOutline,
55
+ disabled: disabled,
56
+ block: block
57
+ }, otherProps), {}, {
58
+ children: [icon && iconPosition === 'left' && iconElement, children && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
59
+ className: "dtable-custom-button__text",
60
+ children: children
61
+ }), icon && iconPosition === 'right' && iconElement]
62
+ }));
63
+ };
64
+ var _default = exports.default = DtableCustomButton;
@@ -0,0 +1,103 @@
1
+ .dtable-icon-button {
2
+ display: inline-flex !important;
3
+ align-items: center;
4
+ justify-content: center;
5
+ padding: 0 !important;
6
+ border: none !important;
7
+ background-color: transparent !important;
8
+ color: #666666 !important;
9
+ cursor: pointer;
10
+ transition: all 0.3s ease;
11
+ outline: none;
12
+ border-radius: 4px;
13
+ }
14
+
15
+ .dtable-icon-button:focus {
16
+ outline: none;
17
+ box-shadow: none !important;
18
+ }
19
+
20
+ .dtable-icon-button__icon {
21
+ display: inline-block;
22
+ line-height: 1;
23
+ margin: 0;
24
+ }
25
+
26
+ .dtable-icon-button--16px {
27
+ min-width: 24px;
28
+ min-height: 24px;
29
+ width: 24px;
30
+ height: 24px;
31
+ }
32
+
33
+ .dtable-icon-button--16px .dtable-icon-button__icon {
34
+ font-size: 16px;
35
+ }
36
+
37
+ .dtable-icon-button--14px {
38
+ min-width: 24px;
39
+ min-height: 24px;
40
+ width: 24px;
41
+ height: 24px;
42
+ }
43
+
44
+ .dtable-icon-button--14px .dtable-icon-button__icon {
45
+ font-size: 14px;
46
+ }
47
+
48
+ .dtable-icon-button--12px {
49
+ min-width: 24px;
50
+ min-height: 24px;
51
+ width: 24px;
52
+ height: 24px;
53
+ }
54
+
55
+ .dtable-icon-button--12px .dtable-icon-button__icon {
56
+ font-size: 12px;
57
+ }
58
+
59
+ .dtable-icon-button--32px {
60
+ min-width: 32px;
61
+ min-height: 32px;
62
+ width: 32px;
63
+ height: 32px;
64
+ }
65
+
66
+ .dtable-icon-button--32px .dtable-icon-button__icon {
67
+ font-size: 32px;
68
+ }
69
+
70
+ .dtable-icon-button--solid {
71
+ background-color: transparent !important;
72
+ }
73
+
74
+ .dtable-icon-button--solid:hover:not(:disabled) {
75
+ background-color: rgba(0, 0, 0, 0.04) !important;
76
+ }
77
+
78
+ .dtable-icon-button--solid:active:not(:disabled) {
79
+ background-color: rgba(0, 0, 0, 0.08) !important;
80
+ }
81
+
82
+ /* ============ Outlined Style ============ */
83
+
84
+ .dtable-icon-button--outlined {
85
+ background-color: #FFFFFF !important;
86
+ border: 1px solid rgba(0, 40, 100, 0.12) !important;
87
+ color: #666666 !important;
88
+ }
89
+
90
+ .dtable-icon-button--outlined:hover:not(:disabled) {
91
+ background-color: rgba(0, 0, 0, 0.04) !important;
92
+ border-color: rgba(0, 40, 100, 0.12) !important;
93
+ }
94
+
95
+ .dtable-icon-button--outlined:active:not(:disabled) {
96
+ background-color: rgba(0, 0, 0, 0.08) !important;
97
+ border-color: rgba(0, 40, 100, 0.12) !important;
98
+ }
99
+
100
+ .dtable-icon-button:disabled {
101
+ opacity: 0.65 !important;
102
+ cursor: not-allowed !important;
103
+ }
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
10
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
11
+ var _react = _interopRequireWildcard(require("react"));
12
+ var _reactstrap = require("reactstrap");
13
+ var _classnames = _interopRequireDefault(require("classnames"));
14
+ var _DTableIcon = _interopRequireDefault(require("../DTableIcon"));
15
+ var _DTableToolTip = _interopRequireDefault(require("../DTableToolTip"));
16
+ require("./index.css");
17
+ var _jsxRuntime = require("react/jsx-runtime");
18
+ const _excluded = ["size", "style", "disabled", "className", "symbol", "tooltip", "tooltipPlacement"];
19
+ const DtableIconButton = _ref => {
20
+ let {
21
+ size = 'large',
22
+ style = 'solid',
23
+ disabled = false,
24
+ className = '',
25
+ symbol,
26
+ tooltip,
27
+ tooltipPlacement
28
+ } = _ref,
29
+ otherProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
30
+ const buttonRef = (0, _react.useRef)(null);
31
+ const sizeMap = {
32
+ 'large': '16px',
33
+ 'middle': '14px',
34
+ 'small': '12px',
35
+ 'largest': '32px'
36
+ };
37
+ const normalizedSize = sizeMap[size] || size;
38
+ const iconElement = symbol && /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableIcon.default, {
39
+ symbol: symbol,
40
+ className: "dtable-icon-button__icon",
41
+ ariaHidden: true
42
+ });
43
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
44
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.Button, (0, _objectSpread2.default)((0, _objectSpread2.default)({
45
+ ref: buttonRef,
46
+ className: (0, _classnames.default)('dtable-icon-button', "dtable-icon-button--".concat(normalizedSize), "dtable-icon-button--".concat(style), className),
47
+ outline: style === 'outlined',
48
+ disabled: disabled,
49
+ id: "dtable-icon-button-tooltip"
50
+ }, otherProps), {}, {
51
+ children: iconElement
52
+ })), tooltip && buttonRef.current && /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableToolTip.default, {
53
+ target: "dtable-icon-button-tooltip",
54
+ placement: tooltipPlacement || 'bottom',
55
+ children: tooltip
56
+ })]
57
+ });
58
+ };
59
+ var _default = exports.default = DtableIconButton;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "6.0.113atd.1",
3
+ "version": "6.0.113gtm.1",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "^5.0.6",