@dnncommunity/dnn-elements 0.13.1 → 0.14.0-beta.12
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/README.md +2 -2
- package/dist/cjs/dnn-button.cjs.entry.js +2 -2
- package/dist/cjs/dnn-button.cjs.entry.js.map +1 -1
- package/dist/cjs/{dnn-button_14.cjs.entry.js → dnn-button_16.cjs.entry.js} +333 -121
- package/dist/cjs/dnn-button_16.cjs.entry.js.map +1 -0
- package/dist/cjs/dnn-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/dnn-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/dnn-chevron.cjs.entry.js +2 -2
- package/dist/cjs/dnn-chevron.cjs.entry.js.map +1 -1
- package/dist/cjs/dnn-collapsible.cjs.entry.js +27 -73
- package/dist/cjs/dnn-collapsible.cjs.entry.js.map +1 -1
- package/dist/cjs/dnn-color-picker.cjs.entry.js +2 -2
- package/dist/cjs/dnn-color-picker.cjs.entry.js.map +1 -1
- package/dist/cjs/dnn-dropzone.cjs.entry.js +2 -2
- package/dist/cjs/dnn-dropzone.cjs.entry.js.map +1 -1
- package/dist/cjs/dnn-image-cropper.cjs.entry.js +8 -24
- package/dist/cjs/dnn-image-cropper.cjs.entry.js.map +1 -1
- package/dist/cjs/dnn-modal.cjs.entry.js +2 -2
- package/dist/cjs/dnn-modal.cjs.entry.js.map +1 -1
- package/dist/cjs/dnn-searchbox.cjs.entry.js +2 -2
- package/dist/cjs/dnn-searchbox.cjs.entry.js.map +1 -1
- package/dist/cjs/dnn-sort-icon.cjs.entry.js +1 -1
- package/dist/cjs/dnn-tab.cjs.entry.js +1 -1
- package/dist/cjs/dnn-tabs.cjs.entry.js +6 -4
- package/dist/cjs/dnn-tabs.cjs.entry.js.map +1 -1
- package/dist/cjs/dnn-toggle.cjs.entry.js +2 -2
- package/dist/cjs/dnn-toggle.cjs.entry.js.map +1 -1
- package/dist/cjs/dnn-treeview-item.cjs.entry.js +35 -15
- package/dist/cjs/dnn-treeview-item.cjs.entry.js.map +1 -1
- package/dist/cjs/dnn-vertical-overflow-menu.cjs.entry.js +122 -0
- package/dist/cjs/dnn-vertical-overflow-menu.cjs.entry.js.map +1 -0
- package/dist/cjs/dnn-vertical-splitview.cjs.entry.js +127 -0
- package/dist/cjs/dnn-vertical-splitview.cjs.entry.js.map +1 -0
- package/dist/cjs/dnn.cjs.js +2 -2
- package/dist/cjs/{index-e85ec026.js → index-7505bd72.js} +4 -5
- package/dist/cjs/index-7505bd72.js.map +1 -0
- package/dist/cjs/{index-eede7745.js → index-aff4d89a.js} +2 -2
- package/dist/cjs/{index-eede7745.js.map → index-aff4d89a.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/mouseUtilities-75be531a.js +25 -0
- package/dist/cjs/mouseUtilities-75be531a.js.map +1 -0
- package/dist/collection/collection-manifest.json +3 -1
- package/dist/collection/components/dnn-collapsible/dnn-collapsible.css +4 -3
- package/dist/collection/components/dnn-collapsible/dnn-collapsible.js +27 -72
- package/dist/collection/components/dnn-collapsible/dnn-collapsible.js.map +1 -1
- package/dist/collection/components/dnn-image-cropper/dnn-image-cropper.js +6 -22
- package/dist/collection/components/dnn-image-cropper/dnn-image-cropper.js.map +1 -1
- package/dist/collection/components/dnn-tabs/dnn-tabs.js +4 -2
- package/dist/collection/components/dnn-tabs/dnn-tabs.js.map +1 -1
- package/dist/collection/components/dnn-treeview-item/dnn-treeview-item.css +2 -2
- package/dist/collection/components/dnn-treeview-item/dnn-treeview-item.js +66 -16
- package/dist/collection/components/dnn-treeview-item/dnn-treeview-item.js.map +1 -1
- package/dist/collection/components/dnn-vertical-overflow-menu/dnn-vertical-overflow-menu.css +56 -0
- package/dist/collection/components/dnn-vertical-overflow-menu/dnn-vertical-overflow-menu.js +132 -0
- package/dist/collection/components/dnn-vertical-overflow-menu/dnn-vertical-overflow-menu.js.map +1 -0
- package/dist/collection/components/dnn-vertical-splitview/dnn-vertical-splitview.css +37 -0
- package/dist/collection/components/dnn-vertical-splitview/dnn-vertical-splitview.js +228 -0
- package/dist/collection/components/dnn-vertical-splitview/dnn-vertical-splitview.js.map +1 -0
- package/dist/collection/utilities/mouseUtilities.js +20 -0
- package/dist/collection/utilities/mouseUtilities.js.map +1 -0
- package/dist/dnn/app-globals-497eb362.system.js +2 -0
- package/dist/dnn/app-globals-497eb362.system.js.map +1 -0
- package/dist/dnn/css-shim-856c55de.system.js +2 -0
- package/dist/dnn/css-shim-856c55de.system.js.map +1 -0
- package/dist/dnn/debounce-eef81bf7.system.js +2 -0
- package/dist/dnn/debounce-eef81bf7.system.js.map +1 -0
- package/dist/dnn/dnn-button.entry.js +2 -2
- package/dist/dnn/dnn-button.entry.js.map +1 -1
- package/dist/dnn/dnn-button.system.entry.js +2 -0
- package/dist/dnn/dnn-button.system.entry.js.map +1 -0
- package/dist/dnn/dnn-checkbox.entry.js +2 -2
- package/dist/dnn/dnn-checkbox.entry.js.map +1 -1
- package/dist/dnn/dnn-checkbox.system.entry.js +2 -0
- package/dist/dnn/dnn-checkbox.system.entry.js.map +1 -0
- package/dist/dnn/dnn-chevron.entry.js +2 -2
- package/dist/dnn/dnn-chevron.entry.js.map +1 -1
- package/dist/dnn/dnn-chevron.system.entry.js +2 -0
- package/dist/dnn/dnn-chevron.system.entry.js.map +1 -0
- package/dist/dnn/dnn-collapsible.entry.js +27 -73
- package/dist/dnn/dnn-collapsible.entry.js.map +1 -1
- package/dist/dnn/dnn-collapsible.system.entry.js +2 -0
- package/dist/dnn/dnn-collapsible.system.entry.js.map +1 -0
- package/dist/dnn/dnn-color-picker.entry.js +2 -2
- package/dist/dnn/dnn-color-picker.entry.js.map +1 -1
- package/dist/dnn/dnn-color-picker.system.entry.js +12 -0
- package/dist/dnn/dnn-color-picker.system.entry.js.map +1 -0
- package/dist/dnn/dnn-dropzone.entry.js +2 -2
- package/dist/dnn/dnn-dropzone.entry.js.map +1 -1
- package/dist/dnn/dnn-dropzone.system.entry.js +2 -0
- package/dist/dnn/dnn-dropzone.system.entry.js.map +1 -0
- package/dist/dnn/dnn-image-cropper.entry.js +8 -24
- package/dist/dnn/dnn-image-cropper.entry.js.map +1 -1
- package/dist/dnn/dnn-image-cropper.system.entry.js +2 -0
- package/dist/dnn/dnn-image-cropper.system.entry.js.map +1 -0
- package/dist/dnn/dnn-modal.entry.js +2 -2
- package/dist/dnn/dnn-modal.entry.js.map +1 -1
- package/dist/dnn/dnn-modal.system.entry.js +2 -0
- package/dist/dnn/dnn-modal.system.entry.js.map +1 -0
- package/dist/dnn/dnn-searchbox.entry.js +2 -2
- package/dist/dnn/dnn-searchbox.entry.js.map +1 -1
- package/dist/dnn/dnn-searchbox.system.entry.js +2 -0
- package/dist/dnn/dnn-searchbox.system.entry.js.map +1 -0
- package/dist/dnn/dnn-sort-icon.entry.js +1 -1
- package/dist/dnn/dnn-sort-icon.system.entry.js +2 -0
- package/dist/dnn/dnn-sort-icon.system.entry.js.map +1 -0
- package/dist/dnn/dnn-tab.entry.js +1 -1
- package/dist/dnn/dnn-tab.system.entry.js +2 -0
- package/dist/dnn/dnn-tab.system.entry.js.map +1 -0
- package/dist/dnn/dnn-tabs.entry.js +6 -4
- package/dist/dnn/dnn-tabs.entry.js.map +1 -1
- package/dist/dnn/dnn-tabs.system.entry.js +2 -0
- package/dist/dnn/dnn-tabs.system.entry.js.map +1 -0
- package/dist/dnn/dnn-toggle.entry.js +2 -2
- package/dist/dnn/dnn-toggle.entry.js.map +1 -1
- package/dist/dnn/dnn-toggle.system.entry.js +2 -0
- package/dist/dnn/dnn-toggle.system.entry.js.map +1 -0
- package/dist/dnn/dnn-treeview-item.entry.js +35 -15
- package/dist/dnn/dnn-treeview-item.entry.js.map +1 -1
- package/dist/dnn/dnn-treeview-item.system.entry.js +2 -0
- package/dist/dnn/dnn-treeview-item.system.entry.js.map +1 -0
- package/dist/dnn/dnn-vertical-overflow-menu.entry.js +118 -0
- package/dist/dnn/dnn-vertical-overflow-menu.entry.js.map +1 -0
- package/dist/dnn/dnn-vertical-overflow-menu.system.entry.js +2 -0
- package/dist/dnn/dnn-vertical-overflow-menu.system.entry.js.map +1 -0
- package/dist/dnn/dnn-vertical-splitview.entry.js +123 -0
- package/dist/dnn/dnn-vertical-splitview.entry.js.map +1 -0
- package/dist/dnn/dnn-vertical-splitview.system.entry.js +2 -0
- package/dist/dnn/dnn-vertical-splitview.system.entry.js.map +1 -0
- package/dist/dnn/dnn.esm.js +2 -2
- package/dist/dnn/dnn.js +130 -0
- package/dist/dnn/dnn.system.js +2 -0
- package/dist/dnn/dnn.system.js.map +1 -0
- package/dist/dnn/dom-938307ec.system.js +22 -0
- package/dist/dnn/dom-938307ec.system.js.map +1 -0
- package/dist/dnn/index-a3a55419.system.js +2 -0
- package/dist/dnn/index-a3a55419.system.js.map +1 -0
- package/dist/dnn/{index-6c0764e5.js → index-b5a28c1d.js} +2 -2
- package/dist/dnn/{index-6c0764e5.js.map → index-b5a28c1d.js.map} +1 -1
- package/dist/dnn/index.system.js +2 -0
- package/dist/dnn/index.system.js.map +1 -0
- package/dist/dnn/mouseUtilities-817973b4.js +23 -0
- package/dist/dnn/mouseUtilities-817973b4.js.map +1 -0
- package/dist/dnn/mouseUtilities-e7e4e78f.system.js +2 -0
- package/dist/dnn/mouseUtilities-e7e4e78f.system.js.map +1 -0
- package/dist/dnn/p-058ba146.system.js +2 -0
- package/dist/dnn/p-058ba146.system.js.map +1 -0
- package/dist/dnn/p-45ce2139.js +2 -0
- package/dist/dnn/p-45ce2139.js.map +1 -0
- package/dist/dnn/p-4d2d8419.system.entry.js +11 -0
- package/dist/dnn/p-4d2d8419.system.entry.js.map +1 -0
- package/dist/dnn/p-646cfb1b.system.js +2 -0
- package/dist/dnn/p-646cfb1b.system.js.map +1 -0
- package/dist/dnn/p-e4da2e36.entry.js +11 -0
- package/dist/dnn/p-e4da2e36.entry.js.map +1 -0
- package/dist/dnn/p-f91193e2.system.js +2 -0
- package/dist/dnn/p-f91193e2.system.js.map +1 -0
- package/dist/dnn/p-fb637662.system.js +2 -0
- package/dist/dnn/p-fb637662.system.js.map +1 -0
- package/dist/dnn/shadow-css-d573707f.system.js +14 -0
- package/dist/dnn/shadow-css-d573707f.system.js.map +1 -0
- package/dist/esm/dnn-button.entry.js +2 -2
- package/dist/esm/dnn-button.entry.js.map +1 -1
- package/dist/esm/{dnn-button_14.entry.js → dnn-button_16.entry.js} +332 -122
- package/dist/esm/dnn-button_16.entry.js.map +1 -0
- package/dist/esm/dnn-checkbox.entry.js +2 -2
- package/dist/esm/dnn-checkbox.entry.js.map +1 -1
- package/dist/esm/dnn-chevron.entry.js +2 -2
- package/dist/esm/dnn-chevron.entry.js.map +1 -1
- package/dist/esm/dnn-collapsible.entry.js +27 -73
- package/dist/esm/dnn-collapsible.entry.js.map +1 -1
- package/dist/esm/dnn-color-picker.entry.js +2 -2
- package/dist/esm/dnn-color-picker.entry.js.map +1 -1
- package/dist/esm/dnn-dropzone.entry.js +2 -2
- package/dist/esm/dnn-dropzone.entry.js.map +1 -1
- package/dist/esm/dnn-image-cropper.entry.js +8 -24
- package/dist/esm/dnn-image-cropper.entry.js.map +1 -1
- package/dist/esm/dnn-modal.entry.js +2 -2
- package/dist/esm/dnn-modal.entry.js.map +1 -1
- package/dist/esm/dnn-searchbox.entry.js +2 -2
- package/dist/esm/dnn-searchbox.entry.js.map +1 -1
- package/dist/esm/dnn-sort-icon.entry.js +1 -1
- package/dist/esm/dnn-tab.entry.js +1 -1
- package/dist/esm/dnn-tabs.entry.js +6 -4
- package/dist/esm/dnn-tabs.entry.js.map +1 -1
- package/dist/esm/dnn-toggle.entry.js +2 -2
- package/dist/esm/dnn-toggle.entry.js.map +1 -1
- package/dist/esm/dnn-treeview-item.entry.js +35 -15
- package/dist/esm/dnn-treeview-item.entry.js.map +1 -1
- package/dist/esm/dnn-vertical-overflow-menu.entry.js +118 -0
- package/dist/esm/dnn-vertical-overflow-menu.entry.js.map +1 -0
- package/dist/esm/dnn-vertical-splitview.entry.js +123 -0
- package/dist/esm/dnn-vertical-splitview.entry.js.map +1 -0
- package/dist/esm/dnn.js +2 -2
- package/dist/esm/{index-6c0764e5.js → index-b5a28c1d.js} +2 -2
- package/dist/esm/{index-6c0764e5.js.map → index-b5a28c1d.js.map} +1 -1
- package/dist/esm/{index-f79d9e82.js → index-cdbad319.js} +4 -5
- package/dist/esm/index-cdbad319.js.map +1 -0
- package/dist/esm/loader.js +2 -2
- package/dist/esm/mouseUtilities-817973b4.js +23 -0
- package/dist/esm/mouseUtilities-817973b4.js.map +1 -0
- package/dist/esm-es5/debounce-06f55268.js +2 -0
- package/dist/esm-es5/debounce-06f55268.js.map +1 -0
- package/dist/esm-es5/dnn-button_16.entry.js +11 -0
- package/dist/esm-es5/dnn-button_16.entry.js.map +1 -0
- package/dist/esm-es5/dnn.js +2 -0
- package/dist/esm-es5/dnn.js.map +1 -0
- package/dist/esm-es5/index-cdbad319.js +2 -0
- package/dist/esm-es5/index-cdbad319.js.map +1 -0
- package/dist/esm-es5/index.js +2 -0
- package/dist/esm-es5/index.js.map +1 -0
- package/dist/esm-es5/loader.js +2 -0
- package/dist/esm-es5/loader.js.map +1 -0
- package/dist/types/components/dnn-collapsible/dnn-collapsible.d.ts +7 -11
- package/dist/types/components/dnn-image-cropper/dnn-image-cropper.d.ts +0 -1
- package/dist/types/components/dnn-treeview-item/dnn-treeview-item.d.ts +10 -2
- package/dist/types/components/dnn-vertical-overflow-menu/dnn-vertical-overflow-menu.d.ts +16 -0
- package/dist/types/components/dnn-vertical-splitview/dnn-vertical-splitview.d.ts +27 -0
- package/dist/types/components.d.ts +64 -2
- package/dist/types/utilities/mouseUtilities.d.ts +4 -0
- package/loader/index.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/dnn-button_14.cjs.entry.js.map +0 -1
- package/dist/cjs/index-e85ec026.js.map +0 -1
- package/dist/dnn/p-7acf3104.entry.js +0 -11
- package/dist/dnn/p-7acf3104.entry.js.map +0 -1
- package/dist/dnn/p-bd3d3361.js +0 -2
- package/dist/dnn/p-bd3d3361.js.map +0 -1
- package/dist/esm/dnn-button_14.entry.js.map +0 -1
- package/dist/esm/index-f79d9e82.js.map +0 -1
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { r as registerInstance, e as createEvent, h, f as Host, g as getElement } from './index-b5a28c1d.js';
|
|
2
|
+
import { g as getMovementFromEvent } from './mouseUtilities-817973b4.js';
|
|
3
|
+
|
|
4
|
+
const dnnVerticalSplitviewCss = ":host{display:-ms-flexbox;display:flex;-ms-flex-align:stretch;align-items:stretch;margin:0 auto;position:relative;--left-pane-background-color:transparent;--right-pane-background-color:transparent}button{border:none;margin:0;padding:0;cursor:ew-resize;position:absolute;height:100%;background-color:transparent}button.transition{-webkit-transition:all 300ms ease-in-out;transition:all 300ms ease-in-out}.pane{overflow-y:auto}.pane.transition{-webkit-transition:all 300ms ease-in-out;transition:all 300ms ease-in-out}.pane.left{background-color:var(--left-pane-background-color)}.pane.right{background-color:var(--right-pane-background-color);-ms-flex-positive:1;flex-grow:1}";
|
|
5
|
+
|
|
6
|
+
let DnnVerticalSplitview = class {
|
|
7
|
+
constructor(hostRef) {
|
|
8
|
+
registerInstance(this, hostRef);
|
|
9
|
+
this.widthChanged = createEvent(this, "widthChanged", 7);
|
|
10
|
+
/** The width of the splitter area. */
|
|
11
|
+
this.splitterWidth = 16;
|
|
12
|
+
/** The percentage position of the splitter in the container. */
|
|
13
|
+
this.splitWidthPercentage = 30;
|
|
14
|
+
this.leftWidth = 0;
|
|
15
|
+
this.rightWidth = 0;
|
|
16
|
+
}
|
|
17
|
+
/** Sets the width percentage of the divider */
|
|
18
|
+
async setSplitWidthPercentage(newWidth) {
|
|
19
|
+
const panes = this.element.shadowRoot.querySelectorAll(".pane");
|
|
20
|
+
requestAnimationFrame(() => {
|
|
21
|
+
panes.forEach(pane => pane.classList.add("transition"));
|
|
22
|
+
this.splitter.classList.add("transition");
|
|
23
|
+
requestAnimationFrame(() => {
|
|
24
|
+
const fullWidth = this.element.getBoundingClientRect().width;
|
|
25
|
+
let newLeft = fullWidth * newWidth / 100;
|
|
26
|
+
if (newLeft < 0) {
|
|
27
|
+
newLeft = 0;
|
|
28
|
+
}
|
|
29
|
+
if (newLeft > fullWidth) {
|
|
30
|
+
newLeft = fullWidth;
|
|
31
|
+
}
|
|
32
|
+
this.leftWidth = newLeft;
|
|
33
|
+
this.rightWidth = fullWidth - newLeft;
|
|
34
|
+
setTimeout(() => {
|
|
35
|
+
panes.forEach(pane => pane.classList.remove("transition"));
|
|
36
|
+
this.splitter.classList.remove("transition");
|
|
37
|
+
}, 300);
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
/** Gets the current divider position percentage. */
|
|
42
|
+
async getSplitWidthPercentage() {
|
|
43
|
+
const fullWidth = this.element.getBoundingClientRect().width;
|
|
44
|
+
return this.leftWidth / fullWidth;
|
|
45
|
+
}
|
|
46
|
+
componentDidLoad() {
|
|
47
|
+
requestAnimationFrame(() => {
|
|
48
|
+
const fullWidth = this.element.getBoundingClientRect().width;
|
|
49
|
+
this.leftWidth = fullWidth * this.splitWidthPercentage / 100;
|
|
50
|
+
this.rightWidth = fullWidth - this.leftWidth;
|
|
51
|
+
this.widthChanged.emit(this.splitWidthPercentage);
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
handleMouseDown(event) {
|
|
55
|
+
event.preventDefault();
|
|
56
|
+
const handleDrag = (ev) => {
|
|
57
|
+
let { movementX } = getMovementFromEvent(ev, this.previousTouch);
|
|
58
|
+
let fullWidth = this.element.getBoundingClientRect().width;
|
|
59
|
+
let newLeft = this.leftWidth + movementX;
|
|
60
|
+
if (newLeft < 0) {
|
|
61
|
+
newLeft = 0;
|
|
62
|
+
}
|
|
63
|
+
if (newLeft > fullWidth) {
|
|
64
|
+
newLeft = fullWidth;
|
|
65
|
+
}
|
|
66
|
+
this.leftWidth = newLeft;
|
|
67
|
+
this.rightWidth = fullWidth - newLeft;
|
|
68
|
+
};
|
|
69
|
+
const handleDragFinished = () => {
|
|
70
|
+
document.removeEventListener("mousemove", handleDrag);
|
|
71
|
+
document.removeEventListener("touchmove", handleDrag);
|
|
72
|
+
const fullWidth = this.element.getBoundingClientRect().width;
|
|
73
|
+
const newPercentage = this.leftWidth / fullWidth * 100;
|
|
74
|
+
this.widthChanged.emit(newPercentage);
|
|
75
|
+
};
|
|
76
|
+
document.addEventListener("mouseup", handleDragFinished);
|
|
77
|
+
document.addEventListener("touchend", handleDragFinished);
|
|
78
|
+
document.addEventListener("mousemove", handleDrag);
|
|
79
|
+
document.addEventListener("touchmove", handleDrag);
|
|
80
|
+
}
|
|
81
|
+
handleKeyDown(e) {
|
|
82
|
+
let movementX = 0;
|
|
83
|
+
switch (e.key) {
|
|
84
|
+
case "ArrowLeft":
|
|
85
|
+
movementX = -10;
|
|
86
|
+
break;
|
|
87
|
+
case "ArrowRight":
|
|
88
|
+
movementX = 10;
|
|
89
|
+
break;
|
|
90
|
+
default:
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
if (e.shiftKey) {
|
|
94
|
+
movementX = movementX * 10;
|
|
95
|
+
}
|
|
96
|
+
const fullWidth = this.element.getBoundingClientRect().width;
|
|
97
|
+
let newLeft = this.leftWidth + movementX;
|
|
98
|
+
if (newLeft < 0) {
|
|
99
|
+
newLeft = 0;
|
|
100
|
+
}
|
|
101
|
+
if (newLeft > fullWidth) {
|
|
102
|
+
newLeft = fullWidth;
|
|
103
|
+
}
|
|
104
|
+
this.leftWidth = newLeft;
|
|
105
|
+
this.rightWidth = fullWidth - this.leftWidth;
|
|
106
|
+
}
|
|
107
|
+
render() {
|
|
108
|
+
return (h(Host, null, h("div", { class: "left pane", style: {
|
|
109
|
+
width: `${this.leftWidth}px`,
|
|
110
|
+
} }, h("slot", { name: "left" })), h("button", { onMouseDown: e => this.handleMouseDown(e), onTouchStart: e => this.handleMouseDown(e), onKeyDown: e => this.handleKeyDown(e), ref: el => this.splitter = el, style: {
|
|
111
|
+
minWidth: `${this.splitterWidth.toString()}px`,
|
|
112
|
+
left: `${this.leftWidth - 2}px`,
|
|
113
|
+
} }, h("slot", null)), h("div", { class: "right pane", style: {
|
|
114
|
+
width: `${this.rightWidth}px`,
|
|
115
|
+
} }, h("slot", { name: "right" }))));
|
|
116
|
+
}
|
|
117
|
+
get element() { return getElement(this); }
|
|
118
|
+
};
|
|
119
|
+
DnnVerticalSplitview.style = dnnVerticalSplitviewCss;
|
|
120
|
+
|
|
121
|
+
export { DnnVerticalSplitview as dnn_vertical_splitview };
|
|
122
|
+
|
|
123
|
+
//# sourceMappingURL=dnn-vertical-splitview.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"dnn-vertical-splitview.entry.esm.js","mappings":";;;AAAA,MAAM,uBAAuB,GAAG,oqBAAoqB;;ICavrB,oBAAoB;EALjC;;;;IAQU,kBAAa,GAAG,EAAE,CAAC;;IAGnB,yBAAoB,GAAG,EAAE,CAAC;IAwCzB,cAAS,GAAG,CAAC,CAAC;IACd,eAAU,GAAG,CAAC,CAAC;GAoGzB;;EAvIC,MAAM,uBAAuB,CAAC,QAAgB;IAC5C,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAChE,qBAAqB,CAAC;MACpB,KAAK,CAAC,OAAO,CAAC,IAAI,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC;MACxD,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;MAC1C,qBAAqB,CAAC;QACpB,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,qBAAqB,EAAE,CAAC,KAAK,CAAC;QAC7D,IAAI,OAAO,GAAG,SAAS,GAAG,QAAQ,GAAG,GAAG,CAAC;QACzC,IAAI,OAAO,GAAG,CAAC,EAAC;UACd,OAAO,GAAG,CAAC,CAAC;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nn-vertical-splitview/dnn-vertical-splitview.scss?tag=dnn-vertical-splitview&encapsulation=shadow","./src/components/dnn-vertical-splitview/dnn-vertical-splitview.tsx"],"sourcesContent":[":host {\r\n display: flex;\r\n align-items: stretch;\r\n margin: 0 auto;\r\n position: relative;\r\n\r\n /** @prop --left-pane-background-color: Allows customizing the left pane background-color */\r\n --left-pane-background-color: transparent;\r\n\r\n /** @prop --right-pane-background-color: Allows customizing the right pane background-color */\r\n --right-pane-background-color: transparent;\r\n}\r\n\r\nbutton{\r\n border: none;\r\n margin:0;\r\n padding:0;\r\n cursor: ew-resize;\r\n position: absolute;\r\n height: 100%;\r\n background-color: transparent;\r\n &.transition{\r\n transition: all 300ms ease-in-out;\r\n }\r\n}\r\n\r\n\r\n.pane{\r\n overflow-y: auto;\r\n &.transition{\r\n transition: all 300ms ease-in-out;\r\n }\r\n &.left{\r\n background-color: var(--left-pane-background-color);\r\n }\r\n &.right{\r\n background-color: var(--right-pane-background-color);\r\n flex-grow: 1;\r\n }\r\n}","import { Component, Host, h, Prop, Element, State, Method, Event, EventEmitter } from '@stencil/core';\r\nimport { getMovementFromEvent } from \"../../utilities/mouseUtilities\";\r\n\r\n/**\r\n * @slot default - The split divider control you want to use.\r\n * @slot left - The content of the left pane.\r\n * @slot right - The content of the right pane.\r\n */\r\n@Component({\r\n tag: 'dnn-vertical-splitview',\r\n styleUrl: 'dnn-vertical-splitview.scss',\r\n shadow: true,\r\n})\r\nexport class DnnVerticalSplitview {\r\n\r\n /** The width of the splitter area. */\r\n @Prop() splitterWidth = 16;\r\n\r\n /** The percentage position of the splitter in the container. */\r\n @Prop() splitWidthPercentage = 30;\r\n \r\n private splitter!: HTMLButtonElement;\r\n\r\n /** Sets the width percentage of the divider */\r\n @Method()\r\n async setSplitWidthPercentage(newWidth: number) {\r\n const panes = this.element.shadowRoot.querySelectorAll(\".pane\");\r\n requestAnimationFrame(() => {\r\n panes.forEach(pane => pane.classList.add(\"transition\"));\r\n this.splitter.classList.add(\"transition\");\r\n requestAnimationFrame(() => {\r\n const fullWidth = this.element.getBoundingClientRect().width;\r\n let newLeft = fullWidth * newWidth / 100;\r\n if (newLeft < 0){\r\n newLeft = 0;\r\n }\r\n if (newLeft > fullWidth){\r\n newLeft = fullWidth;\r\n }\r\n this.leftWidth = newLeft;\r\n this.rightWidth = fullWidth - newLeft;\r\n setTimeout(() => {\r\n panes.forEach(pane => pane.classList.remove(\"transition\"));\r\n this.splitter.classList.remove(\"transition\");\r\n }, 300);\r\n });\r\n });\r\n }\r\n\r\n /** Gets the current divider position percentage. */\r\n @Method()\r\n async getSplitWidthPercentage(){\r\n const fullWidth = this.element.getBoundingClientRect().width;\r\n return this.leftWidth / fullWidth;\r\n }\r\n\r\n /** Fires when the width of the divider changes. */\r\n @Event() widthChanged: EventEmitter<number>;\r\n\r\n @State() leftWidth = 0;\r\n @State() rightWidth = 0;\r\n\r\n @Element() element : HTMLDnnVerticalSplitviewElement;\r\n \r\n componentDidLoad() {\r\n requestAnimationFrame(() => {\r\n const fullWidth = this.element.getBoundingClientRect().width;\r\n this.leftWidth = fullWidth * this.splitWidthPercentage / 100;\r\n this.rightWidth = fullWidth - this.leftWidth;\r\n this.widthChanged.emit(this.splitWidthPercentage);\r\n });\r\n }\r\n \r\n private previousTouch: Touch;\r\n\r\n private handleMouseDown(event: MouseEvent | TouchEvent) {\r\n event.preventDefault();\r\n const handleDrag = (ev: MouseEvent | TouchEvent) => {\r\n let {movementX} = getMovementFromEvent(ev, this.previousTouch);\r\n let fullWidth = this.element.getBoundingClientRect().width;\r\n let newLeft = this.leftWidth + movementX;\r\n if (newLeft < 0){\r\n newLeft = 0;\r\n }\r\n if (newLeft > fullWidth){\r\n newLeft = fullWidth;\r\n }\r\n this.leftWidth = newLeft;\r\n this.rightWidth = fullWidth - newLeft;\r\n }\r\n const handleDragFinished = () => {\r\n document.removeEventListener(\"mousemove\", handleDrag);\r\n document.removeEventListener(\"touchmove\", handleDrag);\r\n const fullWidth = this.element.getBoundingClientRect().width;\r\n const newPercentage = this.leftWidth / fullWidth * 100;\r\n this.widthChanged.emit(newPercentage);\r\n };\r\n document.addEventListener(\"mouseup\", handleDragFinished);\r\n document.addEventListener(\"touchend\", handleDragFinished);\r\n document.addEventListener(\"mousemove\", handleDrag);\r\n document.addEventListener(\"touchmove\", handleDrag);\r\n }\r\n\r\n private handleKeyDown(e: KeyboardEvent): void {\r\n let movementX = 0;\r\n switch (e.key) {\r\n case \"ArrowLeft\":\r\n movementX = -10;\r\n break;\r\n case \"ArrowRight\":\r\n movementX = 10;\r\n break;\r\n default:\r\n return;\r\n }\r\n if (e.shiftKey){\r\n movementX = movementX * 10;\r\n }\r\n const fullWidth = this.element.getBoundingClientRect().width;\r\n let newLeft = this.leftWidth + movementX;\r\n if (newLeft < 0){\r\n newLeft = 0;\r\n }\r\n if (newLeft > fullWidth){\r\n newLeft = fullWidth;\r\n }\r\n this.leftWidth = newLeft;\r\n this.rightWidth = fullWidth - this.leftWidth;\r\n }\r\n\r\n render() {\r\n return (\r\n <Host>\r\n <div class=\"left pane\" style={{\r\n width: `${this.leftWidth}px`,\r\n }}>\r\n <slot name=\"left\"></slot>\r\n </div>\r\n <button\r\n onMouseDown={e => this.handleMouseDown(e)}\r\n onTouchStart={e => this.handleMouseDown(e)}\r\n onKeyDown={e => this.handleKeyDown(e)}\r\n ref={el => this.splitter = el}\r\n style={{\r\n minWidth: `${this.splitterWidth.toString()}px`,\r\n left: `${this.leftWidth - 2}px`,\r\n }}\r\n >\r\n <slot></slot>\r\n </button>\r\n <div\r\n class=\"right pane\"\r\n style={{\r\n width: `${this.rightWidth}px`,\r\n }}>\r\n <slot name=\"right\"></slot>\r\n </div>\r\n </Host>\r\n );\r\n }\r\n}\r\n"],"version":3}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,e,n,i){function r(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,o){function a(t){try{u(i.next(t))}catch(t){o(t)}}function s(t){try{u(i["throw"](t))}catch(t){o(t)}}function u(t){t.done?n(t.value):r(t.value).then(a,s)}u((i=i.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,r,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(t){return function(e){return u([t,e])}}function u(a){if(i)throw new TypeError("Generator is already executing.");while(n)try{if(i=1,r&&(o=a[0]&2?r["return"]:a[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;if(r=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:n.label++;return{value:a[1],done:false};case 5:n.label++;r=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){n.label=a[1];break}if(a[0]===6&&n.label<o[1]){n.label=o[1];o=a;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(a);break}if(o[2])n.ops.pop();n.trys.pop();continue}a=e.call(t,n)}catch(t){a=[6,t];r=0}finally{i=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register(["./index-a3a55419.system.js","./mouseUtilities-e7e4e78f.system.js"],(function(t){"use strict";var e,n,i,r,o,a;return{setters:[function(t){e=t.r;n=t.e;i=t.h;r=t.f;o=t.g},function(t){a=t.g}],execute:function(){var s=":host{display:-ms-flexbox;display:flex;-ms-flex-align:stretch;align-items:stretch;margin:0 auto;position:relative;--left-pane-background-color:transparent;--right-pane-background-color:transparent}button{border:none;margin:0;padding:0;cursor:ew-resize;position:absolute;height:100%;background-color:transparent}button.transition{-webkit-transition:all 300ms ease-in-out;transition:all 300ms ease-in-out}.pane{overflow-y:auto}.pane.transition{-webkit-transition:all 300ms ease-in-out;transition:all 300ms ease-in-out}.pane.left{background-color:var(--left-pane-background-color)}.pane.right{background-color:var(--right-pane-background-color);-ms-flex-positive:1;flex-grow:1}";var u=t("dnn_vertical_splitview",function(){function t(t){e(this,t);this.widthChanged=n(this,"widthChanged",7);this.splitterWidth=16;this.splitWidthPercentage=30;this.leftWidth=0;this.rightWidth=0}t.prototype.setSplitWidthPercentage=function(t){return __awaiter(this,void 0,void 0,(function(){var e;var n=this;return __generator(this,(function(i){e=this.element.shadowRoot.querySelectorAll(".pane");requestAnimationFrame((function(){e.forEach((function(t){return t.classList.add("transition")}));n.splitter.classList.add("transition");requestAnimationFrame((function(){var i=n.element.getBoundingClientRect().width;var r=i*t/100;if(r<0){r=0}if(r>i){r=i}n.leftWidth=r;n.rightWidth=i-r;setTimeout((function(){e.forEach((function(t){return t.classList.remove("transition")}));n.splitter.classList.remove("transition")}),300)}))}));return[2]}))}))};t.prototype.getSplitWidthPercentage=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){t=this.element.getBoundingClientRect().width;return[2,this.leftWidth/t]}))}))};t.prototype.componentDidLoad=function(){var t=this;requestAnimationFrame((function(){var e=t.element.getBoundingClientRect().width;t.leftWidth=e*t.splitWidthPercentage/100;t.rightWidth=e-t.leftWidth;t.widthChanged.emit(t.splitWidthPercentage)}))};t.prototype.handleMouseDown=function(t){var e=this;t.preventDefault();var n=function(t){var n=a(t,e.previousTouch).movementX;var i=e.element.getBoundingClientRect().width;var r=e.leftWidth+n;if(r<0){r=0}if(r>i){r=i}e.leftWidth=r;e.rightWidth=i-r};var i=function(){document.removeEventListener("mousemove",n);document.removeEventListener("touchmove",n);var t=e.element.getBoundingClientRect().width;var i=e.leftWidth/t*100;e.widthChanged.emit(i)};document.addEventListener("mouseup",i);document.addEventListener("touchend",i);document.addEventListener("mousemove",n);document.addEventListener("touchmove",n)};t.prototype.handleKeyDown=function(t){var e=0;switch(t.key){case"ArrowLeft":e=-10;break;case"ArrowRight":e=10;break;default:return}if(t.shiftKey){e=e*10}var n=this.element.getBoundingClientRect().width;var i=this.leftWidth+e;if(i<0){i=0}if(i>n){i=n}this.leftWidth=i;this.rightWidth=n-this.leftWidth};t.prototype.render=function(){var t=this;return i(r,null,i("div",{class:"left pane",style:{width:this.leftWidth+"px"}},i("slot",{name:"left"})),i("button",{onMouseDown:function(e){return t.handleMouseDown(e)},onTouchStart:function(e){return t.handleMouseDown(e)},onKeyDown:function(e){return t.handleKeyDown(e)},ref:function(e){return t.splitter=e},style:{minWidth:this.splitterWidth.toString()+"px",left:this.leftWidth-2+"px"}},i("slot",null)),i("div",{class:"right pane",style:{width:this.rightWidth+"px"}},i("slot",{name:"right"})))};Object.defineProperty(t.prototype,"element",{get:function(){return o(this)},enumerable:false,configurable:true});return t}());u.style=s}}}));
|
|
2
|
+
//# sourceMappingURL=dnn-vertical-splitview.system.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["src/components/dnn-vertical-splitview/dnn-vertical-splitview.scss?tag=dnn-vertical-splitview&encapsulation=shadow","src/components/dnn-vertical-splitview/dnn-vertical-splitview.tsx"],"names":["dnnVerticalSplitviewCss","DnnVerticalSplitview","exports","class_1","hostRef","this","splitterWidth","splitWidthPercentage","leftWidth","rightWidth","prototype","setSplitWidthPercentage","newWidth","panes","element","shadowRoot","querySelectorAll","requestAnimationFrame","forEach","pane","classList","add","_this","splitter","fullWidth","getBoundingClientRect","width","newLeft","setTimeout","remove","getSplitWidthPercentage","componentDidLoad","widthChanged","emit","handleMouseDown","event","preventDefault","handleDrag","ev","movementX","getMovementFromEvent","previousTouch","handleDragFinished","document","removeEventListener","newPercentage","addEventListener","handleKeyDown","e","key","shiftKey","render","h","Host","class","style","name","onMouseDown","onTouchStart","onKeyDown","ref","el","minWidth","toString","left"],"mappings":"0pDAAA,IAAMA,EAA0B,yqBCanBC,EAAoBC,EAAA,yBAAA,WALjC,SAAAC,EA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AAK,SAAAC,GAAM,OAAAvC,EAAKC,SAAWsC,GAC3BN,MAAO,CACLO,SAAazD,KAAKC,cAAcyD,WAAU,KAC1CC,KAAS3D,KAAKG,UAAY,EAAC,OAG7B4C,EAAA,OAAA,OAEFA,EAAA,MAAA,CACEE,MAAM,aACNC,MAAO,CACL7B,MAAUrB,KAAKI,WAAU,OAE3B2C,EAAA,OAAA,CAAMI,KAAK,uIA9IU","sourcesContent":[":host {\r\n display: flex;\r\n align-items: stretch;\r\n margin: 0 auto;\r\n position: relative;\r\n\r\n /** @prop --left-pane-background-color: Allows customizing the left pane background-color */\r\n --left-pane-background-color: transparent;\r\n\r\n /** @prop --right-pane-background-color: Allows customizing the right pane background-color */\r\n --right-pane-background-color: transparent;\r\n}\r\n\r\nbutton{\r\n border: none;\r\n margin:0;\r\n padding:0;\r\n cursor: ew-resize;\r\n position: absolute;\r\n height: 100%;\r\n background-color: transparent;\r\n &.transition{\r\n transition: all 300ms ease-in-out;\r\n }\r\n}\r\n\r\n\r\n.pane{\r\n overflow-y: auto;\r\n &.transition{\r\n transition: all 300ms ease-in-out;\r\n }\r\n &.left{\r\n background-color: var(--left-pane-background-color);\r\n }\r\n &.right{\r\n background-color: var(--right-pane-background-color);\r\n flex-grow: 1;\r\n }\r\n}","import { Component, Host, h, Prop, Element, State, Method, Event, EventEmitter } from '@stencil/core';\r\nimport { getMovementFromEvent } from \"../../utilities/mouseUtilities\";\r\n\r\n/**\r\n * @slot default - The split divider control you want to use.\r\n * @slot left - The content of the left pane.\r\n * @slot right - The content of the right pane.\r\n */\r\n@Component({\r\n tag: 'dnn-vertical-splitview',\r\n styleUrl: 'dnn-vertical-splitview.scss',\r\n shadow: true,\r\n})\r\nexport class DnnVerticalSplitview {\r\n\r\n /** The width of the splitter area. */\r\n @Prop() splitterWidth = 16;\r\n\r\n /** The percentage position of the splitter in the container. */\r\n @Prop() splitWidthPercentage = 30;\r\n \r\n private splitter!: HTMLButtonElement;\r\n\r\n /** Sets the width percentage of the divider */\r\n @Method()\r\n async setSplitWidthPercentage(newWidth: number) {\r\n const panes = this.element.shadowRoot.querySelectorAll(\".pane\");\r\n requestAnimationFrame(() => {\r\n panes.forEach(pane => pane.classList.add(\"transition\"));\r\n this.splitter.classList.add(\"transition\");\r\n requestAnimationFrame(() => {\r\n const fullWidth = this.element.getBoundingClientRect().width;\r\n let newLeft = fullWidth * newWidth / 100;\r\n if (newLeft < 0){\r\n newLeft = 0;\r\n }\r\n if (newLeft > fullWidth){\r\n newLeft = fullWidth;\r\n }\r\n this.leftWidth = newLeft;\r\n this.rightWidth = fullWidth - newLeft;\r\n setTimeout(() => {\r\n panes.forEach(pane => pane.classList.remove(\"transition\"));\r\n this.splitter.classList.remove(\"transition\");\r\n }, 300);\r\n });\r\n });\r\n }\r\n\r\n /** Gets the current divider position percentage. */\r\n @Method()\r\n async getSplitWidthPercentage(){\r\n const fullWidth = this.element.getBoundingClientRect().width;\r\n return this.leftWidth / fullWidth;\r\n }\r\n\r\n /** Fires when the width of the divider changes. */\r\n @Event() widthChanged: EventEmitter<number>;\r\n\r\n @State() leftWidth = 0;\r\n @State() rightWidth = 0;\r\n\r\n @Element() element : HTMLDnnVerticalSplitviewElement;\r\n \r\n componentDidLoad() {\r\n requestAnimationFrame(() => {\r\n const fullWidth = this.element.getBoundingClientRect().width;\r\n this.leftWidth = fullWidth * this.splitWidthPercentage / 100;\r\n this.rightWidth = fullWidth - this.leftWidth;\r\n this.widthChanged.emit(this.splitWidthPercentage);\r\n });\r\n }\r\n \r\n private previousTouch: Touch;\r\n\r\n private handleMouseDown(event: MouseEvent | TouchEvent) {\r\n event.preventDefault();\r\n const handleDrag = (ev: MouseEvent | TouchEvent) => {\r\n let {movementX} = getMovementFromEvent(ev, this.previousTouch);\r\n let fullWidth = this.element.getBoundingClientRect().width;\r\n let newLeft = this.leftWidth + movementX;\r\n if (newLeft < 0){\r\n newLeft = 0;\r\n }\r\n if (newLeft > fullWidth){\r\n newLeft = fullWidth;\r\n }\r\n this.leftWidth = newLeft;\r\n this.rightWidth = fullWidth - newLeft;\r\n }\r\n const handleDragFinished = () => {\r\n document.removeEventListener(\"mousemove\", handleDrag);\r\n document.removeEventListener(\"touchmove\", handleDrag);\r\n const fullWidth = this.element.getBoundingClientRect().width;\r\n const newPercentage = this.leftWidth / fullWidth * 100;\r\n this.widthChanged.emit(newPercentage);\r\n };\r\n document.addEventListener(\"mouseup\", handleDragFinished);\r\n document.addEventListener(\"touchend\", handleDragFinished);\r\n document.addEventListener(\"mousemove\", handleDrag);\r\n document.addEventListener(\"touchmove\", handleDrag);\r\n }\r\n\r\n private handleKeyDown(e: KeyboardEvent): void {\r\n let movementX = 0;\r\n switch (e.key) {\r\n case \"ArrowLeft\":\r\n movementX = -10;\r\n break;\r\n case \"ArrowRight\":\r\n movementX = 10;\r\n break;\r\n default:\r\n return;\r\n }\r\n if (e.shiftKey){\r\n movementX = movementX * 10;\r\n }\r\n const fullWidth = this.element.getBoundingClientRect().width;\r\n let newLeft = this.leftWidth + movementX;\r\n if (newLeft < 0){\r\n newLeft = 0;\r\n }\r\n if (newLeft > fullWidth){\r\n newLeft = fullWidth;\r\n }\r\n this.leftWidth = newLeft;\r\n this.rightWidth = fullWidth - this.leftWidth;\r\n }\r\n\r\n render() {\r\n return (\r\n <Host>\r\n <div class=\"left pane\" style={{\r\n width: `${this.leftWidth}px`,\r\n }}>\r\n <slot name=\"left\"></slot>\r\n </div>\r\n <button\r\n onMouseDown={e => this.handleMouseDown(e)}\r\n onTouchStart={e => this.handleMouseDown(e)}\r\n onKeyDown={e => this.handleKeyDown(e)}\r\n ref={el => this.splitter = el}\r\n style={{\r\n minWidth: `${this.splitterWidth.toString()}px`,\r\n left: `${this.leftWidth - 2}px`,\r\n }}\r\n >\r\n <slot></slot>\r\n </button>\r\n <div\r\n class=\"right pane\"\r\n style={{\r\n width: `${this.rightWidth}px`,\r\n }}>\r\n <slot name=\"right\"></slot>\r\n </div>\r\n </Host>\r\n );\r\n }\r\n}\r\n"]}
|
package/dist/dnn/dnn.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BUILD, c as consoleDevInfo, p as plt, w as win, H, d as doc, N as NAMESPACE, a as promiseResolve, b as bootstrapLazy } from './index-
|
|
1
|
+
import { B as BUILD, c as consoleDevInfo, p as plt, w as win, H, d as doc, N as NAMESPACE, a as promiseResolve, b as bootstrapLazy } from './index-b5a28c1d.js';
|
|
2
2
|
import { g as globalScripts } from './app-globals-0f993ce5.js';
|
|
3
3
|
|
|
4
4
|
/*
|
|
@@ -121,7 +121,7 @@ const patchCloneNodeFix = (HTMLElementPrototype) => {
|
|
|
121
121
|
|
|
122
122
|
patchBrowser().then(options => {
|
|
123
123
|
globalScripts();
|
|
124
|
-
return bootstrapLazy([["dnn-image-cropper",[[1,"dnn-image-cropper",{"width":[2],"height":[2],"resx":[16],"quality":[2],"preventUndersized":[4,"prevent-undersized"],"view":[32]}]]],["dnn-treeview-item",[[1,"dnn-treeview-item",{"expanded":[
|
|
124
|
+
return bootstrapLazy([["dnn-image-cropper",[[1,"dnn-image-cropper",{"width":[2],"height":[2],"resx":[16],"quality":[2],"preventUndersized":[4,"prevent-undersized"],"view":[32]}]]],["dnn-treeview-item",[[1,"dnn-treeview-item",{"expanded":[1540],"hasChildren":[32]}]]],["dnn-checkbox",[[1,"dnn-checkbox",{"checked":[1028],"useIntermediate":[4,"use-intermediate"],"value":[1]}]]],["dnn-chevron",[[1,"dnn-chevron",{"expandText":[1,"expand-text"],"collapseText":[1,"collapse-text"],"expanded":[1540]}]]],["dnn-color-picker",[[1,"dnn-color-picker",{"color":[1],"colorBoxHeight":[1,"color-box-height"],"currentColor":[32],"rgbDisplay":[32],"hslDisplay":[32],"hexDisplay":[32]}]]],["dnn-searchbox",[[1,"dnn-searchbox",{"placeholder":[1],"debounced":[4],"query":[1025]}]]],["dnn-sort-icon",[[1,"dnn-sort-icon",{"sortDirection":[1,"sort-direction"]}]]],["dnn-tab",[[1,"dnn-tab",{"tabTitle":[1,"tab-title"],"visible":[32],"show":[64],"hide":[64]}]]],["dnn-tabs",[[1,"dnn-tabs",{"tabTitles":[32],"selectedTabTitle":[32]}]]],["dnn-toggle",[[1,"dnn-toggle",{"checked":[1028],"disabled":[4]}]]],["dnn-vertical-overflow-menu",[[1,"dnn-vertical-overflow-menu",{"showDropdownButton":[32],"showDropdownMenu":[32]}]]],["dnn-vertical-splitview",[[1,"dnn-vertical-splitview",{"splitterWidth":[2,"splitter-width"],"splitWidthPercentage":[2,"split-width-percentage"],"leftWidth":[32],"rightWidth":[32],"setSplitWidthPercentage":[64],"getSplitWidthPercentage":[64]}]]],["dnn-button",[[1,"dnn-button",{"type":[1],"reversed":[4],"size":[1],"confirm":[4],"confirmYesText":[1,"confirm-yes-text"],"confirmNoText":[1,"confirm-no-text"],"confirmMessage":[1,"confirm-message"],"disabled":[4],"modalVisible":[32]}]]],["dnn-collapsible",[[1,"dnn-collapsible",{"expanded":[516],"transitionDuration":[2,"transition-duration"],"updateSize":[64]},[[0,"dnnCollapsibleHeightChanged","handleHeightChanged"]]]]],["dnn-dropzone",[[1,"dnn-dropzone",{"resx":[16],"allowedExtensions":[16],"allowCameraMode":[4,"allow-camera-mode"],"captureQuality":[2,"capture-quality"],"canTakeSnapshots":[32],"takingPicture":[32]}]]],["dnn-modal",[[1,"dnn-modal",{"backdropDismiss":[4,"backdrop-dismiss"],"closeText":[1,"close-text"],"showCloseButton":[4,"show-close-button"],"visible":[32],"show":[64],"hide":[64]}]]]], options);
|
|
125
125
|
});
|
|
126
126
|
|
|
127
127
|
//# sourceMappingURL=dnn.esm.js.map
|