@vtx/components 3.0.0 → 3.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/lib/_util/getComponentProps.js +1 -1
- package/lib/_util/useColSize.js +38 -0
- package/lib/_util/useColSize.js.map +1 -0
- package/lib/_util/useSet.js +2 -2
- package/lib/index.js +46 -38
- package/lib/index.js.map +1 -1
- package/lib/vtx-color-picker/index.js +1 -1
- package/lib/vtx-combogrid/Combogrid.js +3 -3
- package/lib/vtx-combogrid/index.js +1 -1
- package/lib/vtx-datagrid/ColumnSetting.js +1 -1
- package/lib/vtx-datagrid/index.js +3 -3
- package/lib/vtx-datagrid/renderColumnButtons.js +5 -3
- package/lib/vtx-datagrid/renderColumnButtons.js.map +1 -1
- package/lib/vtx-datagrid/style/index.css +0 -3
- package/lib/vtx-datagrid/style/index.less +4 -3
- package/lib/vtx-date-picker/QdatePicker.js +1 -1
- package/lib/vtx-date-picker/generatePicker.js +6 -6
- package/lib/vtx-editor/index.js +1 -1
- package/lib/vtx-ellipsis-text/index.js +61 -0
- package/lib/vtx-ellipsis-text/index.js.map +1 -0
- package/lib/vtx-ellipsis-text/style/css.js +6 -0
- package/lib/vtx-ellipsis-text/style/css.js.map +1 -0
- package/lib/vtx-ellipsis-text/style/index.css +13 -0
- package/lib/vtx-ellipsis-text/style/index.js +6 -0
- package/lib/vtx-ellipsis-text/style/index.js.map +1 -0
- package/lib/vtx-ellipsis-text/style/index.less +13 -0
- package/lib/vtx-form-layout/Card.js +1 -1
- package/lib/vtx-form-layout/Divider.js +12 -2
- package/lib/vtx-form-layout/Divider.js.map +1 -1
- package/lib/vtx-form-layout/FormItem.js +9 -5
- package/lib/vtx-form-layout/FormItem.js.map +1 -1
- package/lib/vtx-form-layout/style/index.css +41 -2
- package/lib/vtx-form-layout/style/index.less +35 -2
- package/lib/vtx-image/Image.js +1 -1
- package/lib/vtx-image/Preview.js +3 -3
- package/lib/vtx-image/PreviewGroup.js +2 -2
- package/lib/vtx-image/index.js +1 -1
- package/lib/vtx-import/index.js +2 -2
- package/lib/vtx-input/TextArea.js +1 -1
- package/lib/vtx-input/index.js +3 -3
- package/lib/vtx-input/style/index.css +3 -0
- package/lib/vtx-input/style/index.less +3 -1
- package/lib/vtx-modal/index.js +3 -3
- package/lib/vtx-page-layout/Content.js +2 -2
- package/lib/vtx-page-layout/TableLayout.js +3 -3
- package/lib/vtx-page-layout/TableWrap.js +2 -2
- package/lib/vtx-page-layout/container.js +6 -6
- package/lib/vtx-rps-frame/index.js +3 -3
- package/lib/vtx-scrollable-row/index.js +4 -4
- package/lib/vtx-search/VtxCol.js +2 -2
- package/lib/vtx-search/index.js +25 -15
- package/lib/vtx-search/index.js.map +1 -1
- package/lib/vtx-search/style/index.css +5 -1
- package/lib/vtx-search/style/index.less +2 -1
- package/lib/vtx-search-map-input/index.js +1 -1
- package/lib/vtx-select/index.js +15 -15
- package/lib/vtx-select/index.js.map +1 -1
- package/lib/vtx-signature/index.js +1 -1
- package/lib/vtx-split-pane/Pane.js +3 -3
- package/lib/vtx-split-pane/Resizer.js +3 -3
- package/lib/vtx-split-pane/SplitPane.js +1 -1
- package/lib/vtx-statistics-column/Item.js +3 -3
- package/lib/vtx-statistics-column/Total.js +3 -3
- package/lib/vtx-upload/FilePreview.js +2 -2
- package/lib/vtx-upload/index.js +4 -4
- package/lib/vtx-upload/index.js.map +1 -1
- package/lib/vtx-ztree/index.js +6 -6
- package/lib/vtx-ztree-select/index.js +6 -6
- package/package.json +5 -4
- package/CHANGELOG.md +0 -896
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = getComponentProps;
|
|
7
7
|
|
|
8
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
8
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
9
9
|
|
|
10
10
|
function getComponentProps(prop) {
|
|
11
11
|
if (prop && _typeof(prop) === 'object') {
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _useSize = _interopRequireDefault(require("ahooks/lib/useSize"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
+
|
|
12
|
+
var COL_SIZE = {
|
|
13
|
+
lg: 'lg',
|
|
14
|
+
md: 'md',
|
|
15
|
+
sm: 'sm'
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
var _default = function _default(ref) {
|
|
19
|
+
var dom = (ref === null || ref === void 0 ? void 0 : ref.current) || document.querySelector('body');
|
|
20
|
+
|
|
21
|
+
var _ref = (0, _useSize["default"])(dom) || {},
|
|
22
|
+
width = _ref.width;
|
|
23
|
+
|
|
24
|
+
var size = COL_SIZE.lg;
|
|
25
|
+
|
|
26
|
+
if (width >= 1370) {
|
|
27
|
+
size = COL_SIZE.lg;
|
|
28
|
+
} else if (width >= 992) {
|
|
29
|
+
size = COL_SIZE.md;
|
|
30
|
+
} else {
|
|
31
|
+
size = COL_SIZE.sm;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return size;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
exports["default"] = _default;
|
|
38
|
+
//# sourceMappingURL=useColSize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["_util/useColSize.js"],"names":["COL_SIZE","lg","md","sm","ref","dom","current","document","querySelector","width","size"],"mappings":";;;;;;;AAAA;;;;AAEA,IAAMA,QAAQ,GAAG;AACbC,EAAAA,EAAE,EAAE,IADS;AAEbC,EAAAA,EAAE,EAAE,IAFS;AAGbC,EAAAA,EAAE,EAAE;AAHS,CAAjB;;eAMe,kBAAAC,GAAG,EAAI;AAClB,MAAMC,GAAG,GAAG,CAAAD,GAAG,SAAH,IAAAA,GAAG,WAAH,YAAAA,GAAG,CAAEE,OAAL,KAAgBC,QAAQ,CAACC,aAAT,CAAuB,MAAvB,CAA5B;;AACA,aAAkB,yBAAQH,GAAR,KAAgB,EAAlC;AAAA,MAAQI,KAAR,QAAQA,KAAR;;AACA,MAAIC,IAAI,GAAGV,QAAQ,CAACC,EAApB;;AACA,MAAIQ,KAAK,IAAI,IAAb,EAAmB;AACfC,IAAAA,IAAI,GAAGV,QAAQ,CAACC,EAAhB;AACH,GAFD,MAEO,IAAIQ,KAAK,IAAI,GAAb,EAAkB;AACrBC,IAAAA,IAAI,GAAGV,QAAQ,CAACE,EAAhB;AACH,GAFM,MAEA;AACHQ,IAAAA,IAAI,GAAGV,QAAQ,CAACG,EAAhB;AACH;;AACD,SAAOO,IAAP;AACH,C","sourcesContent":["import useSize from 'ahooks/lib/useSize';\n\nconst COL_SIZE = {\n lg: 'lg',\n md: 'md',\n sm: 'sm',\n};\n\nexport default ref => {\n const dom = ref?.current || document.querySelector('body');\n const { width } = useSize(dom) || {};\n let size = COL_SIZE.lg;\n if (width >= 1370) {\n size = COL_SIZE.lg;\n } else if (width >= 992) {\n size = COL_SIZE.md;\n } else {\n size = COL_SIZE.sm;\n }\n return size;\n};\n"],"file":"useColSize.js"}
|
package/lib/_util/useSet.js
CHANGED
|
@@ -7,9 +7,9 @@ exports["default"] = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
|
|
10
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly
|
|
10
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
11
11
|
|
|
12
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source =
|
|
12
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
13
13
|
|
|
14
14
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
15
15
|
|
package/lib/index.js
CHANGED
|
@@ -3,52 +3,52 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
Object.defineProperty(exports, "
|
|
6
|
+
Object.defineProperty(exports, "VtxFormLayout", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function get() {
|
|
9
|
-
return
|
|
9
|
+
return _vtxFormLayout["default"];
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
Object.defineProperty(exports, "
|
|
12
|
+
Object.defineProperty(exports, "VtxPageLayout", {
|
|
13
13
|
enumerable: true,
|
|
14
14
|
get: function get() {
|
|
15
|
-
return
|
|
15
|
+
return _vtxPageLayout["default"];
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
-
Object.defineProperty(exports, "
|
|
18
|
+
Object.defineProperty(exports, "VtxSearch", {
|
|
19
19
|
enumerable: true,
|
|
20
20
|
get: function get() {
|
|
21
|
-
return
|
|
21
|
+
return _vtxSearch["default"];
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
Object.defineProperty(exports, "
|
|
24
|
+
Object.defineProperty(exports, "VtxColorPicker", {
|
|
25
25
|
enumerable: true,
|
|
26
26
|
get: function get() {
|
|
27
|
-
return
|
|
27
|
+
return _vtxColorPicker["default"];
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
|
-
Object.defineProperty(exports, "
|
|
30
|
+
Object.defineProperty(exports, "VtxCombogrid", {
|
|
31
31
|
enumerable: true,
|
|
32
32
|
get: function get() {
|
|
33
|
-
return
|
|
33
|
+
return _vtxCombogrid["default"];
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
|
-
Object.defineProperty(exports, "
|
|
36
|
+
Object.defineProperty(exports, "VtxDatePicker", {
|
|
37
37
|
enumerable: true,
|
|
38
38
|
get: function get() {
|
|
39
|
-
return
|
|
39
|
+
return _vtxDatePicker["default"];
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
|
-
Object.defineProperty(exports, "
|
|
42
|
+
Object.defineProperty(exports, "VtxEditor", {
|
|
43
43
|
enumerable: true,
|
|
44
44
|
get: function get() {
|
|
45
|
-
return
|
|
45
|
+
return _vtxEditor["default"];
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
|
-
Object.defineProperty(exports, "
|
|
48
|
+
Object.defineProperty(exports, "VtxExport", {
|
|
49
49
|
enumerable: true,
|
|
50
50
|
get: function get() {
|
|
51
|
-
return
|
|
51
|
+
return _vtxExport["default"];
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
54
|
Object.defineProperty(exports, "VtxImport", {
|
|
@@ -57,64 +57,64 @@ Object.defineProperty(exports, "VtxImport", {
|
|
|
57
57
|
return _vtxImport["default"];
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
|
-
Object.defineProperty(exports, "
|
|
60
|
+
Object.defineProperty(exports, "VtxSearchMapInput", {
|
|
61
61
|
enumerable: true,
|
|
62
62
|
get: function get() {
|
|
63
|
-
return
|
|
63
|
+
return _vtxSearchMapInput["default"];
|
|
64
64
|
}
|
|
65
65
|
});
|
|
66
|
-
Object.defineProperty(exports, "
|
|
66
|
+
Object.defineProperty(exports, "VtxSelect", {
|
|
67
67
|
enumerable: true,
|
|
68
68
|
get: function get() {
|
|
69
|
-
return
|
|
69
|
+
return _vtxSelect["default"];
|
|
70
70
|
}
|
|
71
71
|
});
|
|
72
|
-
Object.defineProperty(exports, "
|
|
72
|
+
Object.defineProperty(exports, "VtxInput", {
|
|
73
73
|
enumerable: true,
|
|
74
74
|
get: function get() {
|
|
75
|
-
return
|
|
75
|
+
return _vtxInput["default"];
|
|
76
76
|
}
|
|
77
77
|
});
|
|
78
|
-
Object.defineProperty(exports, "
|
|
78
|
+
Object.defineProperty(exports, "VtxTimePicker", {
|
|
79
79
|
enumerable: true,
|
|
80
80
|
get: function get() {
|
|
81
|
-
return
|
|
81
|
+
return _vtxTimePicker["default"];
|
|
82
82
|
}
|
|
83
83
|
});
|
|
84
|
-
Object.defineProperty(exports, "
|
|
84
|
+
Object.defineProperty(exports, "VtxUpload", {
|
|
85
85
|
enumerable: true,
|
|
86
86
|
get: function get() {
|
|
87
|
-
return
|
|
87
|
+
return _vtxUpload["default"];
|
|
88
88
|
}
|
|
89
89
|
});
|
|
90
|
-
Object.defineProperty(exports, "
|
|
90
|
+
Object.defineProperty(exports, "VtxZtreeSelect", {
|
|
91
91
|
enumerable: true,
|
|
92
92
|
get: function get() {
|
|
93
|
-
return
|
|
93
|
+
return _vtxZtreeSelect["default"];
|
|
94
94
|
}
|
|
95
95
|
});
|
|
96
|
-
Object.defineProperty(exports, "
|
|
96
|
+
Object.defineProperty(exports, "VtxDatagrid", {
|
|
97
97
|
enumerable: true,
|
|
98
98
|
get: function get() {
|
|
99
|
-
return
|
|
99
|
+
return _vtxDatagrid["default"];
|
|
100
100
|
}
|
|
101
101
|
});
|
|
102
|
-
Object.defineProperty(exports, "
|
|
102
|
+
Object.defineProperty(exports, "VtxEllipsisText", {
|
|
103
103
|
enumerable: true,
|
|
104
104
|
get: function get() {
|
|
105
|
-
return
|
|
105
|
+
return _vtxEllipsisText["default"];
|
|
106
106
|
}
|
|
107
107
|
});
|
|
108
|
-
Object.defineProperty(exports, "
|
|
108
|
+
Object.defineProperty(exports, "VtxImage", {
|
|
109
109
|
enumerable: true,
|
|
110
110
|
get: function get() {
|
|
111
|
-
return
|
|
111
|
+
return _vtxImage["default"];
|
|
112
112
|
}
|
|
113
113
|
});
|
|
114
|
-
Object.defineProperty(exports, "
|
|
114
|
+
Object.defineProperty(exports, "VtxRpsFrame", {
|
|
115
115
|
enumerable: true,
|
|
116
116
|
get: function get() {
|
|
117
|
-
return
|
|
117
|
+
return _vtxRpsFrame["default"];
|
|
118
118
|
}
|
|
119
119
|
});
|
|
120
120
|
Object.defineProperty(exports, "VtxZtree", {
|
|
@@ -123,10 +123,16 @@ Object.defineProperty(exports, "VtxZtree", {
|
|
|
123
123
|
return _vtxZtree["default"];
|
|
124
124
|
}
|
|
125
125
|
});
|
|
126
|
-
Object.defineProperty(exports, "
|
|
126
|
+
Object.defineProperty(exports, "VtxSplitPane", {
|
|
127
127
|
enumerable: true,
|
|
128
128
|
get: function get() {
|
|
129
|
-
return
|
|
129
|
+
return _vtxSplitPane["default"];
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
Object.defineProperty(exports, "VtxModal", {
|
|
133
|
+
enumerable: true,
|
|
134
|
+
get: function get() {
|
|
135
|
+
return _vtxModal["default"];
|
|
130
136
|
}
|
|
131
137
|
});
|
|
132
138
|
|
|
@@ -162,6 +168,8 @@ var _vtxZtreeSelect = _interopRequireDefault(require("./vtx-ztree-select"));
|
|
|
162
168
|
|
|
163
169
|
var _vtxDatagrid = _interopRequireDefault(require("./vtx-datagrid"));
|
|
164
170
|
|
|
171
|
+
var _vtxEllipsisText = _interopRequireDefault(require("./vtx-ellipsis-text"));
|
|
172
|
+
|
|
165
173
|
var _vtxImage = _interopRequireDefault(require("./vtx-image"));
|
|
166
174
|
|
|
167
175
|
var _vtxRpsFrame = _interopRequireDefault(require("./vtx-rps-frame"));
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;;AACA;;AACA;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAGA","sourcesContent":["// layout\nexport { default as VtxFormLayout } from './vtx-form-layout';\nexport { default as VtxPageLayout } from './vtx-page-layout';\nexport { default as VtxSearch } from './vtx-search';\n\n// data entry\nexport { default as VtxColorPicker } from './vtx-color-picker';\nexport { default as VtxCombogrid } from './vtx-combogrid';\nexport { default as VtxDatePicker } from './vtx-date-picker';\nexport { default as VtxEditor } from './vtx-editor';\nexport { default as VtxExport } from './vtx-export';\nexport { default as VtxImport } from './vtx-import';\nexport { default as VtxSearchMapInput } from './vtx-search-map-input';\nexport { default as VtxSelect } from './vtx-select';\nexport { default as VtxInput } from './vtx-input';\nexport { default as VtxTimePicker } from './vtx-time-picker';\nexport { default as VtxUpload } from './vtx-upload';\nexport { default as VtxZtreeSelect } from './vtx-ztree-select';\n\n// data display\nexport { default as VtxDatagrid } from './vtx-datagrid';\nexport { default as VtxEllipsisText } from './vtx-ellipsis-text';\nexport { default as VtxImage } from './vtx-image';\nexport { default as VtxRpsFrame } from './vtx-rps-frame';\nexport { default as VtxZtree } from './vtx-ztree';\nexport { default as VtxSplitPane } from './vtx-split-pane';\n\n// feedback\nexport { default as VtxModal } from './vtx-modal';\n"],"file":"index.js"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -33,9 +33,9 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
33
33
|
|
|
34
34
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
35
35
|
|
|
36
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly
|
|
36
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
37
37
|
|
|
38
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source =
|
|
38
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
39
39
|
|
|
40
40
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
41
41
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -59,9 +59,9 @@ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symb
|
|
|
59
59
|
|
|
60
60
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
61
61
|
|
|
62
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly
|
|
62
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
63
63
|
|
|
64
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source =
|
|
64
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
65
65
|
|
|
66
66
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
67
67
|
|
|
@@ -42,7 +42,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
42
42
|
var renderColumnButtons = function renderColumnButtons(renderButtons) {
|
|
43
43
|
var _renderButtons;
|
|
44
44
|
|
|
45
|
-
var visible = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] :
|
|
45
|
+
var visible = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 4;
|
|
46
46
|
var text = arguments.length > 2 ? arguments[2] : undefined;
|
|
47
47
|
var record = arguments.length > 3 ? arguments[3] : undefined;
|
|
48
48
|
var index = arguments.length > 4 ? arguments[4] : undefined;
|
|
@@ -59,9 +59,11 @@ var renderColumnButtons = function renderColumnButtons(renderButtons) {
|
|
|
59
59
|
var actionsLen = actions.length; // 更多
|
|
60
60
|
|
|
61
61
|
var moreRender;
|
|
62
|
+
var realVisible = visible;
|
|
62
63
|
|
|
63
64
|
if (actionsLen > visible) {
|
|
64
|
-
|
|
65
|
+
realVisible = realVisible - 1;
|
|
66
|
+
var moreActions = actions.slice(realVisible);
|
|
65
67
|
/* eslint-disable */
|
|
66
68
|
|
|
67
69
|
moreRender = /*#__PURE__*/_react["default"].createElement(_dropdown["default"], {
|
|
@@ -78,7 +80,7 @@ var renderColumnButtons = function renderColumnButtons(renderButtons) {
|
|
|
78
80
|
}, /*#__PURE__*/_react["default"].createElement("a", null, "\u66F4\u591A", /*#__PURE__*/_react["default"].createElement(_DownOutlined["default"], null)));
|
|
79
81
|
}
|
|
80
82
|
|
|
81
|
-
return [].concat(_toConsumableArray(actions.slice(0,
|
|
83
|
+
return [].concat(_toConsumableArray(actions.slice(0, realVisible).map(function (item, i) {
|
|
82
84
|
var name = item.name,
|
|
83
85
|
onClick = item.onClick,
|
|
84
86
|
popconfirm = item.popconfirm;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["vtx-datagrid/renderColumnButtons.jsx"],"names":["renderColumnButtons","renderButtons","visible","text","record","index","actions","filter","item","Array","isArray","actionsLen","length","moreRender","moreActions","slice","e","key","onClick","map","i","name","popconfirm","btnNode","undefined","confirm","rest"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAMA,mBAAmB,GAAG,SAAtBA,mBAAsB,CAACC,aAAD,EAAqD;AAAA;;AAAA,MAArCC,OAAqC,uEAA3B,CAA2B;AAAA,MAAxBC,IAAwB;AAAA,MAAlBC,MAAkB;AAAA,MAAVC,KAAU;AAC7E,MAAMC,OAAO,qBAAGL,aAAa,CAACE,IAAD,EAAOC,MAAP,EAAeC,KAAf,CAAhB,mDAAG,eAAoCE,MAApC,CACZ,UAAAC,IAAI;AAAA;;AAAA,WAAIA,IAAI,sBAAKA,IAAI,CAACN,OAAV,yDAAqB,IAArB,CAAR;AAAA,GADQ,CAAhB;;AAGA,MAAI,CAACO,KAAK,CAACC,OAAN,CAAcJ,OAAd,CAAL,EAA6B;AACzB;AACH;;AACD,MAAMK,UAAU,GAAGL,OAAO,CAACM,MAA3B,CAP6E,CAQ7E;;AACA,MAAIC,UAAJ;;AACA,
|
|
1
|
+
{"version":3,"sources":["vtx-datagrid/renderColumnButtons.jsx"],"names":["renderColumnButtons","renderButtons","visible","text","record","index","actions","filter","item","Array","isArray","actionsLen","length","moreRender","realVisible","moreActions","slice","e","key","onClick","map","i","name","popconfirm","btnNode","undefined","confirm","rest"],"mappings":"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","sourcesContent":["import React from 'react';\nimport Popconfirm from 'antd/lib/popconfirm';\nimport Dropdown from 'antd/lib/dropdown';\nimport Menu from 'antd/lib/menu';\nimport Divider from 'antd/lib/divider';\nimport DownOutlined from '@ant-design/icons/DownOutlined';\n\nconst renderColumnButtons = (renderButtons, visible = 4, text, record, index) => {\n const actions = renderButtons(text, record, index)?.filter(\n item => item && (item.visible ?? true),\n );\n if (!Array.isArray(actions)) {\n return;\n }\n const actionsLen = actions.length;\n // 更多\n let moreRender;\n let realVisible = visible;\n if (actionsLen > visible) {\n realVisible = realVisible - 1;\n const moreActions = actions.slice(realVisible);\n /* eslint-disable */\n moreRender = (\n <Dropdown\n key=\"more\"\n overlay={\n <Menu onClick={e => moreActions[e.key].onClick(record, index)}>\n {moreActions.map((item, i) => (\n <Menu.Item key={i}>{item.name}</Menu.Item>\n ))}\n </Menu>\n }\n >\n <a>\n 更多\n <DownOutlined />\n </a>\n </Dropdown>\n );\n }\n\n return [\n ...actions.slice(0, realVisible).map((item, i) => {\n const { name, onClick, popconfirm } = item;\n let btnNode = (\n <a\n key={name}\n onClick={onClick && !popconfirm ? () => onClick(record, index) : undefined}\n >\n {name}\n </a>\n );\n\n if (popconfirm) {\n const { confirm, ...rest } = popconfirm;\n btnNode = (\n <Popconfirm\n {...rest}\n onConfirm={confirm ? () => confirm(record, index) : undefined}\n key={name}\n >\n {btnNode}\n </Popconfirm>\n );\n }\n\n return [btnNode, i != actionsLen - 1 && <Divider key={i} type=\"vertical\" />];\n }),\n moreRender,\n ];\n};\n\nexport default renderColumnButtons;\n"],"file":"renderColumnButtons.js"}
|
|
@@ -78,9 +78,10 @@
|
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
81
|
+
// fix: checkbox 选中时 固定列 最上面一层透明会 和下面重叠
|
|
82
|
+
// .ant-table-tbody > tr.ant-table-row-selected td {
|
|
83
|
+
// background: transparent;
|
|
84
|
+
// }
|
|
84
85
|
&-alert {
|
|
85
86
|
margin-bottom: 8px;
|
|
86
87
|
&-message {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -17,9 +17,9 @@ var _excluded = ["value", "earliestSelectableDate", "latestSelectableDate"];
|
|
|
17
17
|
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
19
|
|
|
20
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly
|
|
20
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
21
21
|
|
|
22
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source =
|
|
22
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
23
23
|
|
|
24
24
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
25
25
|
|
|
@@ -29,15 +29,15 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
29
29
|
|
|
30
30
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
31
31
|
|
|
32
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps);
|
|
32
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
33
33
|
|
|
34
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
|
|
34
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
35
35
|
|
|
36
36
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
37
37
|
|
|
38
38
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
39
39
|
|
|
40
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; }
|
|
40
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
41
41
|
|
|
42
42
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
43
43
|
|
package/lib/vtx-editor/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _classnames2 = _interopRequireDefault(require("classnames"));
|
|
11
|
+
|
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
|
|
14
|
+
var _tooltip = _interopRequireDefault(require("antd/lib/tooltip"));
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
|
+
|
|
18
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
19
|
+
|
|
20
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
21
|
+
|
|
22
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
23
|
+
|
|
24
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
25
|
+
|
|
26
|
+
function VtxEllipsisText(props) {
|
|
27
|
+
var _classnames;
|
|
28
|
+
|
|
29
|
+
var text = props.text,
|
|
30
|
+
_props$lineClamp = props.lineClamp,
|
|
31
|
+
lineClamp = _props$lineClamp === void 0 ? 1 : _props$lineClamp,
|
|
32
|
+
_props$tooltip = props.tooltip,
|
|
33
|
+
tooltip = _props$tooltip === void 0 ? {} : _props$tooltip,
|
|
34
|
+
className = props.className,
|
|
35
|
+
style = props.style;
|
|
36
|
+
var textStyle = {};
|
|
37
|
+
|
|
38
|
+
if (lineClamp > 2) {
|
|
39
|
+
textStyle['WebkitLineClamp'] = lineClamp;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return /*#__PURE__*/_react["default"].createElement(_tooltip["default"], _extends({
|
|
43
|
+
title: text,
|
|
44
|
+
placement: "topLeft",
|
|
45
|
+
mouseEnterDelay: 0.3
|
|
46
|
+
}, tooltip), /*#__PURE__*/_react["default"].createElement("p", {
|
|
47
|
+
className: (0, _classnames2["default"])('vtx-ellipsis-text', (_classnames = {}, _defineProperty(_classnames, 'vtx-ellipsis-text--single', lineClamp < 2), _defineProperty(_classnames, 'vtx-ellipsis-text--multi', lineClamp >= 2), _classnames), className),
|
|
48
|
+
style: _objectSpread(_objectSpread({}, style), textStyle)
|
|
49
|
+
}, text));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
VtxEllipsisText.propTypes = {
|
|
53
|
+
text: _propTypes["default"].string,
|
|
54
|
+
lineClamp: _propTypes["default"].number,
|
|
55
|
+
tooltip: _propTypes["default"].object,
|
|
56
|
+
className: _propTypes["default"].string,
|
|
57
|
+
style: _propTypes["default"].object
|
|
58
|
+
};
|
|
59
|
+
var _default = VtxEllipsisText;
|
|
60
|
+
exports["default"] = _default;
|
|
61
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["vtx-ellipsis-text/index.jsx"],"names":["VtxEllipsisText","props","text","lineClamp","tooltip","className","style","textStyle","propTypes","PropTypes","string","number","object"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;;;;;;;;;;;AAEA,SAASA,eAAT,CAAyBC,KAAzB,EAAgC;AAAA;;AAC5B,MAAQC,IAAR,GAAgED,KAAhE,CAAQC,IAAR;AAAA,yBAAgED,KAAhE,CAAcE,SAAd;AAAA,MAAcA,SAAd,iCAA0B,CAA1B;AAAA,uBAAgEF,KAAhE,CAA6BG,OAA7B;AAAA,MAA6BA,OAA7B,+BAAuC,EAAvC;AAAA,MAA2CC,SAA3C,GAAgEJ,KAAhE,CAA2CI,SAA3C;AAAA,MAAsDC,KAAtD,GAAgEL,KAAhE,CAAsDK,KAAtD;AAEA,MAAMC,SAAS,GAAG,EAAlB;;AACA,MAAIJ,SAAS,GAAG,CAAhB,EAAmB;AACfI,IAAAA,SAAS,CAAC,iBAAD,CAAT,GAA+BJ,SAA/B;AACH;;AAED,sBACI,gCAAC,mBAAD;AAAS,IAAA,KAAK,EAAED,IAAhB;AAAsB,IAAA,SAAS,EAAC,SAAhC;AAA0C,IAAA,eAAe,EAAE;AAA3D,KAAoEE,OAApE,gBACI;AACI,IAAA,SAAS,EAAE,6BACP,mBADO,kDAGF,2BAHE,EAG4BD,SAAS,GAAG,CAHxC,gCAIF,0BAJE,EAI2BA,SAAS,IAAI,CAJxC,iBAMPE,SANO,CADf;AASI,IAAA,KAAK,kCAAOC,KAAP,GAAiBC,SAAjB;AATT,KAWKL,IAXL,CADJ,CADJ;AAiBH;;AAEDF,eAAe,CAACQ,SAAhB,GAA4B;AACxBN,EAAAA,IAAI,EAAEO,sBAAUC,MADQ;AAExBP,EAAAA,SAAS,EAAEM,sBAAUE,MAFG;AAGxBP,EAAAA,OAAO,EAAEK,sBAAUG,MAHK;AAIxBP,EAAAA,SAAS,EAAEI,sBAAUC,MAJG;AAKxBJ,EAAAA,KAAK,EAAEG,sBAAUG;AALO,CAA5B;eAQeZ,e","sourcesContent":["import React from 'react';\nimport classnames from 'classnames';\nimport PropTypes from 'prop-types';\nimport Tooltip from 'antd/lib/tooltip';\n\nfunction VtxEllipsisText(props) {\n const { text, lineClamp = 1, tooltip = {}, className, style } = props;\n\n const textStyle = {};\n if (lineClamp > 2) {\n textStyle['WebkitLineClamp'] = lineClamp;\n }\n\n return (\n <Tooltip title={text} placement=\"topLeft\" mouseEnterDelay={0.3} {...tooltip}>\n <p\n className={classnames(\n 'vtx-ellipsis-text',\n {\n ['vtx-ellipsis-text--single']: lineClamp < 2,\n ['vtx-ellipsis-text--multi']: lineClamp >= 2,\n },\n className,\n )}\n style={{ ...style, ...textStyle }}\n >\n {text}\n </p>\n </Tooltip>\n );\n}\n\nVtxEllipsisText.propTypes = {\n text: PropTypes.string,\n lineClamp: PropTypes.number,\n tooltip: PropTypes.object,\n className: PropTypes.string,\n style: PropTypes.object,\n};\n\nexport default VtxEllipsisText;\n"],"file":"index.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["vtx-ellipsis-text/style/index.js"],"names":[],"mappings":";;AAAA;;AACA","sourcesContent":["import 'antd/lib/tooltip/style';\nimport './index.less';\n"],"file":"css.js"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
.vtx-ellipsis-text {
|
|
2
|
+
margin: 0;
|
|
3
|
+
overflow: hidden;
|
|
4
|
+
text-overflow: ellipsis;
|
|
5
|
+
}
|
|
6
|
+
.vtx-ellipsis-text--single {
|
|
7
|
+
white-space: nowrap;
|
|
8
|
+
}
|
|
9
|
+
.vtx-ellipsis-text--multi {
|
|
10
|
+
display: -webkit-box;
|
|
11
|
+
-webkit-line-clamp: 2;
|
|
12
|
+
-webkit-box-orient: vertical;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["vtx-ellipsis-text/style/index.js"],"names":[],"mappings":";;AAAA;;AACA","sourcesContent":["import 'antd/lib/tooltip/style';\nimport './index.less';\n"],"file":"index.js"}
|