@progress/kendo-angular-treelist 12.1.1-develop.1 → 12.2.0-develop.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/dragdrop/drag-hint.service.d.ts +10 -6
- package/esm2020/dragdrop/drag-hint.service.mjs +67 -40
- package/esm2020/dragdrop/draggable-column.directive.mjs +2 -2
- package/esm2020/package-metadata.mjs +2 -2
- package/fesm2015/progress-kendo-angular-treelist.mjs +100 -75
- package/fesm2020/progress-kendo-angular-treelist.mjs +99 -75
- package/package.json +15 -15
- package/schematics/ngAdd/index.js +3 -3
|
@@ -3,17 +3,18 @@
|
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
6
|
+
import { IconsService } from '@progress/kendo-angular-icons';
|
|
6
7
|
import * as i0 from "@angular/core";
|
|
7
8
|
/**
|
|
8
9
|
* @hidden
|
|
9
10
|
*/
|
|
10
11
|
export declare class DragHintService {
|
|
11
12
|
private santizer;
|
|
13
|
+
private iconsService;
|
|
12
14
|
private dom;
|
|
13
|
-
private
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
create(down: any, target: Element, title: string): void;
|
|
15
|
+
private cancelIcon;
|
|
16
|
+
constructor(santizer: DomSanitizer, iconsService: IconsService);
|
|
17
|
+
create(title: string): void;
|
|
17
18
|
attach(): Function;
|
|
18
19
|
remove(): void;
|
|
19
20
|
show(): void;
|
|
@@ -22,8 +23,11 @@ export declare class DragHintService {
|
|
|
22
23
|
disable(): void;
|
|
23
24
|
removeLock(): void;
|
|
24
25
|
toggleLock(locked: boolean): void;
|
|
25
|
-
move(move:
|
|
26
|
-
|
|
26
|
+
move(move: {
|
|
27
|
+
pageX: number;
|
|
28
|
+
pageY: number;
|
|
29
|
+
}): void;
|
|
30
|
+
private get isSVG();
|
|
27
31
|
static ɵfac: i0.ɵɵFactoryDeclaration<DragHintService, never>;
|
|
28
32
|
static ɵprov: i0.ɵɵInjectableDeclaration<DragHintService>;
|
|
29
33
|
}
|
|
@@ -5,53 +5,82 @@
|
|
|
5
5
|
import { Injectable, SecurityContext } from '@angular/core';
|
|
6
6
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
7
7
|
import { isDocumentAvailable } from '@progress/kendo-angular-common';
|
|
8
|
-
import { append
|
|
8
|
+
import { append } from './common';
|
|
9
|
+
import { IconsService } from '@progress/kendo-angular-icons';
|
|
10
|
+
import { lockIcon, unlockIcon, plusIcon, cancelIcon } from '@progress/kendo-svg-icons';
|
|
9
11
|
import * as i0 from "@angular/core";
|
|
10
12
|
import * as i1 from "@angular/platform-browser";
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
icon
|
|
14
|
-
|
|
13
|
+
import * as i2 from "@progress/kendo-angular-icons";
|
|
14
|
+
const updateClass = (element, valid, svg) => {
|
|
15
|
+
const icon = element.querySelector('.k-icon, .k-svg-icon');
|
|
16
|
+
if (svg) {
|
|
17
|
+
const svg = icon.firstElementChild;
|
|
18
|
+
svg.removeChild(svg.firstElementChild);
|
|
19
|
+
const path = valid ? plusIcon.content : cancelIcon.content;
|
|
20
|
+
icon.firstElementChild.innerHTML = path + icon.firstElementChild.innerHTML;
|
|
21
|
+
}
|
|
22
|
+
icon.className = icon.className.replace(/(plus|cancel)/, valid ? 'plus' : 'cancel');
|
|
15
23
|
};
|
|
16
|
-
const updateLock = (element, locked = null) => {
|
|
17
|
-
const icon = element.querySelectorAll('.k-icon')[1];
|
|
18
|
-
const value = locked === null ? '' : (locked ? '
|
|
19
|
-
|
|
20
|
-
.replace(/(k-i-unlock|k-i-lock)/, '') + ` ${value}`;
|
|
24
|
+
const updateLock = (element, locked = null, svg) => {
|
|
25
|
+
const icon = element.querySelectorAll('.k-icon, .k-svg-icon')[1];
|
|
26
|
+
const value = locked === null ? '' : (locked ? `k${svg ? '-svg' : ''}-i-lock` : `k${svg ? '-svg' : ''}-i-unlock`);
|
|
27
|
+
if (svg) {
|
|
28
|
+
icon.className = icon.className.replace(/(k-svg-i-unlock|k-svg-i-lock)/, '').trim() + ` ${value}`;
|
|
29
|
+
icon.firstElementChild.innerHTML = locked ? lockIcon.content : unlockIcon.content;
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
icon.className = icon.className.replace(/(k-i-unlock|k-i-lock)/, '').trim() + ` ${value}`;
|
|
33
|
+
}
|
|
21
34
|
};
|
|
22
|
-
const decorate = (element
|
|
23
|
-
const targetStyles = getComputedStyle(target);
|
|
35
|
+
const decorate = (element) => {
|
|
24
36
|
element.className = 'k-header k-drag-clue';
|
|
25
37
|
element.style.position = 'absolute';
|
|
26
38
|
element.style.zIndex = '20000';
|
|
27
|
-
element.style.paddingLeft = targetStyles.paddingLeft;
|
|
28
|
-
element.style.paddingTop = targetStyles.paddingTop;
|
|
29
|
-
element.style.paddingBottom = targetStyles.paddingBottom;
|
|
30
|
-
element.style.paddingRight = targetStyles.paddingRight;
|
|
31
|
-
element.style.width = targetStyles.width;
|
|
32
|
-
element.style.height = targetStyles.height;
|
|
33
39
|
};
|
|
40
|
+
const svgIconsMarkup = (viewBox, content, safeTitle) => `
|
|
41
|
+
<span class="k-svg-icon k-drag-status k-svg-i-cancel">
|
|
42
|
+
<svg
|
|
43
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
44
|
+
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
45
|
+
viewBox="${viewBox}"
|
|
46
|
+
aria-hidden="true">
|
|
47
|
+
${content}
|
|
48
|
+
<span class="k-svg-icon k-icon-modifier">
|
|
49
|
+
<svg
|
|
50
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
51
|
+
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
52
|
+
viewBox="${viewBox}"
|
|
53
|
+
aria-hidden="true">
|
|
54
|
+
</svg>
|
|
55
|
+
</span>
|
|
56
|
+
</svg>
|
|
57
|
+
</span>
|
|
58
|
+
${safeTitle}`;
|
|
59
|
+
const fontIconsMarkup = (safeTitle) => `
|
|
60
|
+
<span class="k-icon k-drag-status k-i-cancel">
|
|
61
|
+
<span class="k-icon k-icon-modifier"></span>
|
|
62
|
+
</span>
|
|
63
|
+
${safeTitle}`;
|
|
34
64
|
/**
|
|
35
65
|
* @hidden
|
|
36
66
|
*/
|
|
37
67
|
export class DragHintService {
|
|
38
|
-
constructor(santizer) {
|
|
68
|
+
constructor(santizer, iconsService) {
|
|
39
69
|
this.santizer = santizer;
|
|
70
|
+
this.iconsService = iconsService;
|
|
71
|
+
this.cancelIcon = cancelIcon;
|
|
40
72
|
}
|
|
41
|
-
create(
|
|
73
|
+
create(title) {
|
|
42
74
|
if (!isDocumentAvailable()) {
|
|
43
75
|
return;
|
|
44
76
|
}
|
|
45
|
-
this.initCoords(down);
|
|
46
77
|
this.dom = document.createElement("div");
|
|
47
|
-
decorate(this.dom
|
|
78
|
+
decorate(this.dom);
|
|
48
79
|
const safeTitle = this.santizer.sanitize(SecurityContext.HTML, title);
|
|
49
|
-
this.
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
${safeTitle}
|
|
54
|
-
`;
|
|
80
|
+
const innerHtml = this.isSVG ?
|
|
81
|
+
svgIconsMarkup(this.cancelIcon.viewBox, this.cancelIcon.content, safeTitle) :
|
|
82
|
+
fontIconsMarkup(safeTitle);
|
|
83
|
+
this.dom.innerHTML = innerHtml;
|
|
55
84
|
}
|
|
56
85
|
attach() {
|
|
57
86
|
return append(this.dom);
|
|
@@ -71,29 +100,27 @@ export class DragHintService {
|
|
|
71
100
|
this.dom.style.display = "none";
|
|
72
101
|
}
|
|
73
102
|
enable() {
|
|
74
|
-
updateClass(this.dom, true);
|
|
103
|
+
updateClass(this.dom, true, this.isSVG);
|
|
75
104
|
}
|
|
76
105
|
disable() {
|
|
77
|
-
updateClass(this.dom, false);
|
|
106
|
+
updateClass(this.dom, false, this.isSVG);
|
|
78
107
|
}
|
|
79
108
|
removeLock() {
|
|
80
|
-
updateLock(this.dom);
|
|
109
|
+
updateLock(this.dom, false, this.isSVG);
|
|
81
110
|
}
|
|
82
111
|
toggleLock(locked) {
|
|
83
|
-
updateLock(this.dom, locked);
|
|
112
|
+
updateLock(this.dom, locked, this.isSVG);
|
|
84
113
|
}
|
|
85
114
|
move(move) {
|
|
86
|
-
this.dom.style.top =
|
|
87
|
-
this.dom.style.left =
|
|
115
|
+
this.dom.style.top = move.pageY + 'px';
|
|
116
|
+
this.dom.style.left = move.pageX + 'px';
|
|
88
117
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
this.initialTop = top - down.pageY;
|
|
92
|
-
this.initialLeft = left - down.pageX;
|
|
118
|
+
get isSVG() {
|
|
119
|
+
return (this.iconsService.iconSettings?.type || this.iconsService.changes.value.type) === 'svg';
|
|
93
120
|
}
|
|
94
121
|
}
|
|
95
|
-
DragHintService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: DragHintService, deps: [{ token: i1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
122
|
+
DragHintService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: DragHintService, deps: [{ token: i1.DomSanitizer }, { token: i2.IconsService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
96
123
|
DragHintService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: DragHintService });
|
|
97
124
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: DragHintService, decorators: [{
|
|
98
125
|
type: Injectable
|
|
99
|
-
}], ctorParameters: function () { return [{ type: i1.DomSanitizer }]; } });
|
|
126
|
+
}], ctorParameters: function () { return [{ type: i1.DomSanitizer }, { type: i2.IconsService }]; } });
|
|
@@ -64,8 +64,8 @@ export class DraggableColumnDirective {
|
|
|
64
64
|
originalEvent.preventDefault();
|
|
65
65
|
}
|
|
66
66
|
this.nav.navigateTo(originalEvent.target);
|
|
67
|
-
}), switchMap(preventOnDblClick(this.draggable.kendoRelease)), tap(
|
|
68
|
-
this.hint.create(
|
|
67
|
+
}), switchMap(preventOnDblClick(this.draggable.kendoRelease)), tap(() => {
|
|
68
|
+
this.hint.create(this.context.hint);
|
|
69
69
|
this.cue.create();
|
|
70
70
|
}), switchMap(down => this.draggable.kendoDrag.pipe(tap((e) => {
|
|
71
71
|
if (e.isTouch) {
|
|
@@ -9,7 +9,7 @@ export const packageMetadata = {
|
|
|
9
9
|
name: '@progress/kendo-angular-treelist',
|
|
10
10
|
productName: 'Kendo UI for Angular',
|
|
11
11
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
12
|
-
publishDate:
|
|
13
|
-
version: '12.
|
|
12
|
+
publishDate: 1684331239,
|
|
13
|
+
version: '12.2.0-develop.1',
|
|
14
14
|
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
|
|
15
15
|
};
|