@kdcloudjs/table 1.2.2-canary.6 → 1.2.2-canary.7
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/dist/@kdcloudjs/table.css +1 -1
- package/dist/@kdcloudjs/table.js +10 -7
- package/dist/@kdcloudjs/table.js.map +1 -1
- package/dist/@kdcloudjs/table.min.css +1 -1
- package/dist/@kdcloudjs/table.min.js +2 -2
- package/dist/@kdcloudjs/table.min.js.map +1 -1
- package/es/table/base/styles.js +1 -1
- package/es/table/pipeline/features/rowDrag.js +8 -5
- package/lib/table/base/styles.js +1 -1
- package/lib/table/pipeline/features/rowDrag.js +8 -5
- package/package.json +1 -1
package/es/table/base/styles.js
CHANGED
|
@@ -111,7 +111,7 @@ var Z = {
|
|
|
111
111
|
scrollItem: 30,
|
|
112
112
|
loadingIndicator: 40
|
|
113
113
|
};
|
|
114
|
-
export var GlobalStyle = createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", "{\n position: absolute;\n top:0;\n left:0;\n z-index: 9999;\n pointer-events:none;\n user-select: none;\n\n display:flex;\n opacity: 0.9;\n align-items:center;\n min-width:80px;\n padding: 0px 8px;\n border: 1px solid #d9d9d9;\n box-shadow: 0px 6px 16px 3px rgba(0,0,0,0.08);\n border-radius: 2px;\n background: #fff;\n\n .", "{\n font-size:12px;\n overflow:hidden;\n text-overflow: ellipsis;\n white-space:nowrap;\n }\n \n }\n\n .", "{\n position: absolute;\n top:0;\n left:0;\n z-index: 9998;\n pointer-events:none;\n user-select: none;\n height: 2px;\n background: var(--primary-color);\n }\n .", ":before{\n content: \" \";\n position: absolute;\n width: 8px;\n height: 8px;\n top:-4px;\n border: 2px solid var(--primary-color);\n border-radius: 50%;\n background:#fff;\n }\n"])), Classes.rowDragElement, Classes.rowDragElementLabel, Classes.rowDragLine, Classes.treeTableRowDragLine);
|
|
114
|
+
export var GlobalStyle = createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", "{\n position: absolute;\n top:0;\n left:0;\n z-index: 9999;\n pointer-events:none;\n user-select: none;\n\n display:flex;\n opacity: 0.9;\n align-items:center;\n min-width:80px;\n padding: 0px 8px;\n border: 1px solid #d9d9d9;\n box-shadow: 0px 6px 16px 3px rgba(0,0,0,0.08);\n border-radius: 2px;\n background: #fff;\n max-height:48px;\n\n .", "{\n font-size:12px;\n overflow:hidden;\n text-overflow: ellipsis;\n white-space:nowrap;\n }\n \n }\n\n .", "{\n position: absolute;\n top:0;\n left:0;\n z-index: 9998;\n pointer-events:none;\n user-select: none;\n height: 2px;\n background: var(--primary-color);\n }\n .", ":before{\n content: \" \";\n position: absolute;\n width: 8px;\n height: 8px;\n top:-4px;\n border: 2px solid var(--primary-color);\n border-radius: 50%;\n background:#fff;\n }\n"])), Classes.rowDragElement, Classes.rowDragElementLabel, Classes.rowDragLine, Classes.treeTableRowDragLine);
|
|
115
115
|
var outerBorderStyleMixin = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n border-top: 1px solid #cccccc;\n border-right: 1px solid #cccccc;\n border-bottom: 1px solid #cccccc;\n border-left: 1px solid #cccccc;\n\n td.", ",\n th.", " {\n border-left: none;\n }\n td.", ",\n th.", " {\n border-right: none;\n }\n\n thead tr.", " th,\n tbody tr.", " td {\n border-top: none;\n }\n &.has-footer tfoot tr.", " td {\n border-bottom: none;\n }\n &:not(.has-footer) tbody tr.", " td {\n border-bottom: none;\n }\n td.", ":not(.", "){\n border-left: var(---cell-border-vertical);\n }\n td.", ":not(.", "){\n border-right: var(---cell-border-vertical);\n }\n"])), Classes.first, Classes.first, Classes.last, Classes.last, Classes.first, Classes.first, Classes.last, Classes.last, Classes.rowSpan, Classes.first, Classes.rowSpan, Classes.last);
|
|
116
116
|
export var defaultCSSVariables = {
|
|
117
117
|
'--row-height': '48px',
|
|
@@ -185,7 +185,7 @@ export function rowDrag(opt) {
|
|
|
185
185
|
timeoutId = setTimeout(function () {
|
|
186
186
|
intervalId = setInterval(function () {
|
|
187
187
|
tableBody.scrollTop += moveOffset;
|
|
188
|
-
},
|
|
188
|
+
}, 50);
|
|
189
189
|
}, 500);
|
|
190
190
|
};
|
|
191
191
|
var handleDragStart = function handleDragStart(mouseDownEvent) {
|
|
@@ -276,6 +276,9 @@ export function rowDrag(opt) {
|
|
|
276
276
|
}
|
|
277
277
|
};
|
|
278
278
|
var handleDragStop = function handleDragStop(mouseUpEvent) {
|
|
279
|
+
if (!isValidDrag) {
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
279
282
|
removeElement(dragElement);
|
|
280
283
|
removeElement(dragLine);
|
|
281
284
|
artTable.classList.remove(cx(Classes.rowDragging));
|
|
@@ -283,10 +286,6 @@ export function rowDrag(opt) {
|
|
|
283
286
|
clearTimeout(timeoutId);
|
|
284
287
|
clearInterval(intervalId);
|
|
285
288
|
clearTimeout(expandRowTimeoutId);
|
|
286
|
-
while (expandRowCallBackList.length > 0) {
|
|
287
|
-
var callback = expandRowCallBackList.pop();
|
|
288
|
-
callback();
|
|
289
|
-
}
|
|
290
289
|
var rowDropZones = rowDragApi.getRowDropZone();
|
|
291
290
|
rowDropZones.forEach(function (dropzone) {
|
|
292
291
|
var container = dropzone.getContainer();
|
|
@@ -300,6 +299,10 @@ export function rowDrag(opt) {
|
|
|
300
299
|
var dragEvent = createDropTargetEvent(dropTarget, mouseUpEvent, startDataItem, currentDropZone);
|
|
301
300
|
dropTarget.onDragStop(dragEvent);
|
|
302
301
|
}
|
|
302
|
+
while (expandRowCallBackList.length > 0) {
|
|
303
|
+
var callback = expandRowCallBackList.pop();
|
|
304
|
+
callback();
|
|
305
|
+
}
|
|
303
306
|
};
|
|
304
307
|
var mousemove$ = fromEvent(window, 'mousemove');
|
|
305
308
|
var mouseup$ = fromEvent(window, 'mouseup');
|
package/lib/table/base/styles.js
CHANGED
|
@@ -123,7 +123,7 @@ var Z = {
|
|
|
123
123
|
scrollItem: 30,
|
|
124
124
|
loadingIndicator: 40
|
|
125
125
|
};
|
|
126
|
-
var GlobalStyle = exports.GlobalStyle = (0, _styledComponents.createGlobalStyle)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .", "{\n position: absolute;\n top:0;\n left:0;\n z-index: 9999;\n pointer-events:none;\n user-select: none;\n\n display:flex;\n opacity: 0.9;\n align-items:center;\n min-width:80px;\n padding: 0px 8px;\n border: 1px solid #d9d9d9;\n box-shadow: 0px 6px 16px 3px rgba(0,0,0,0.08);\n border-radius: 2px;\n background: #fff;\n\n .", "{\n font-size:12px;\n overflow:hidden;\n text-overflow: ellipsis;\n white-space:nowrap;\n }\n \n }\n\n .", "{\n position: absolute;\n top:0;\n left:0;\n z-index: 9998;\n pointer-events:none;\n user-select: none;\n height: 2px;\n background: var(--primary-color);\n }\n .", ":before{\n content: \" \";\n position: absolute;\n width: 8px;\n height: 8px;\n top:-4px;\n border: 2px solid var(--primary-color);\n border-radius: 50%;\n background:#fff;\n }\n"])), Classes.rowDragElement, Classes.rowDragElementLabel, Classes.rowDragLine, Classes.treeTableRowDragLine);
|
|
126
|
+
var GlobalStyle = exports.GlobalStyle = (0, _styledComponents.createGlobalStyle)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .", "{\n position: absolute;\n top:0;\n left:0;\n z-index: 9999;\n pointer-events:none;\n user-select: none;\n\n display:flex;\n opacity: 0.9;\n align-items:center;\n min-width:80px;\n padding: 0px 8px;\n border: 1px solid #d9d9d9;\n box-shadow: 0px 6px 16px 3px rgba(0,0,0,0.08);\n border-radius: 2px;\n background: #fff;\n max-height:48px;\n\n .", "{\n font-size:12px;\n overflow:hidden;\n text-overflow: ellipsis;\n white-space:nowrap;\n }\n \n }\n\n .", "{\n position: absolute;\n top:0;\n left:0;\n z-index: 9998;\n pointer-events:none;\n user-select: none;\n height: 2px;\n background: var(--primary-color);\n }\n .", ":before{\n content: \" \";\n position: absolute;\n width: 8px;\n height: 8px;\n top:-4px;\n border: 2px solid var(--primary-color);\n border-radius: 50%;\n background:#fff;\n }\n"])), Classes.rowDragElement, Classes.rowDragElementLabel, Classes.rowDragLine, Classes.treeTableRowDragLine);
|
|
127
127
|
var outerBorderStyleMixin = (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n border-top: 1px solid #cccccc;\n border-right: 1px solid #cccccc;\n border-bottom: 1px solid #cccccc;\n border-left: 1px solid #cccccc;\n\n td.", ",\n th.", " {\n border-left: none;\n }\n td.", ",\n th.", " {\n border-right: none;\n }\n\n thead tr.", " th,\n tbody tr.", " td {\n border-top: none;\n }\n &.has-footer tfoot tr.", " td {\n border-bottom: none;\n }\n &:not(.has-footer) tbody tr.", " td {\n border-bottom: none;\n }\n td.", ":not(.", "){\n border-left: var(---cell-border-vertical);\n }\n td.", ":not(.", "){\n border-right: var(---cell-border-vertical);\n }\n"])), Classes.first, Classes.first, Classes.last, Classes.last, Classes.first, Classes.first, Classes.last, Classes.last, Classes.rowSpan, Classes.first, Classes.rowSpan, Classes.last);
|
|
128
128
|
var defaultCSSVariables = exports.defaultCSSVariables = {
|
|
129
129
|
'--row-height': '48px',
|
|
@@ -196,7 +196,7 @@ function rowDrag(opt) {
|
|
|
196
196
|
timeoutId = setTimeout(function () {
|
|
197
197
|
intervalId = setInterval(function () {
|
|
198
198
|
tableBody.scrollTop += moveOffset;
|
|
199
|
-
},
|
|
199
|
+
}, 50);
|
|
200
200
|
}, 500);
|
|
201
201
|
};
|
|
202
202
|
var handleDragStart = function handleDragStart(mouseDownEvent) {
|
|
@@ -287,6 +287,9 @@ function rowDrag(opt) {
|
|
|
287
287
|
}
|
|
288
288
|
};
|
|
289
289
|
var handleDragStop = function handleDragStop(mouseUpEvent) {
|
|
290
|
+
if (!isValidDrag) {
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
290
293
|
removeElement(dragElement);
|
|
291
294
|
removeElement(dragLine);
|
|
292
295
|
artTable.classList.remove((0, _classnames.default)(_styles.Classes.rowDragging));
|
|
@@ -294,10 +297,6 @@ function rowDrag(opt) {
|
|
|
294
297
|
clearTimeout(timeoutId);
|
|
295
298
|
clearInterval(intervalId);
|
|
296
299
|
clearTimeout(expandRowTimeoutId);
|
|
297
|
-
while (expandRowCallBackList.length > 0) {
|
|
298
|
-
var callback = expandRowCallBackList.pop();
|
|
299
|
-
callback();
|
|
300
|
-
}
|
|
301
300
|
var rowDropZones = rowDragApi.getRowDropZone();
|
|
302
301
|
rowDropZones.forEach(function (dropzone) {
|
|
303
302
|
var container = dropzone.getContainer();
|
|
@@ -311,6 +310,10 @@ function rowDrag(opt) {
|
|
|
311
310
|
var dragEvent = createDropTargetEvent(dropTarget, mouseUpEvent, startDataItem, currentDropZone);
|
|
312
311
|
dropTarget.onDragStop(dragEvent);
|
|
313
312
|
}
|
|
313
|
+
while (expandRowCallBackList.length > 0) {
|
|
314
|
+
var callback = expandRowCallBackList.pop();
|
|
315
|
+
callback();
|
|
316
|
+
}
|
|
314
317
|
};
|
|
315
318
|
var mousemove$ = (0, _rxjs.fromEvent)(window, 'mousemove');
|
|
316
319
|
var mouseup$ = (0, _rxjs.fromEvent)(window, 'mouseup');
|