@dile/ui 2.24.1 → 2.25.0
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.
|
@@ -85,6 +85,11 @@ export class DileAppDrawer extends DileCloseOnEscPressed(LitElement) {
|
|
|
85
85
|
left: var(--dile-app-drawer-closed-left, 0);
|
|
86
86
|
height: var(--dile-app-drawer-content-height, auto);
|
|
87
87
|
width: var(--dile-app-drawer-content-width, 100vw);
|
|
88
|
+
box-shadow: none;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
:host([direction="top"][opened]) .menu {
|
|
92
|
+
transform: translateY(100vh);
|
|
88
93
|
box-shadow: var(--dile-app-drawer-box-shadow, 0 1px 8px #000);
|
|
89
94
|
}
|
|
90
95
|
|
|
@@ -93,16 +98,13 @@ export class DileAppDrawer extends DileCloseOnEscPressed(LitElement) {
|
|
|
93
98
|
left: var(--dile-app-drawer-closed-left, 0);
|
|
94
99
|
height: var(--dile-app-drawer-content-height, 100vh);
|
|
95
100
|
width: var(--dile-app-drawer-content-width, auto);
|
|
96
|
-
box-shadow:
|
|
101
|
+
box-shadow: none;
|
|
97
102
|
transform: translateX(-100%);
|
|
98
103
|
}
|
|
99
104
|
|
|
100
|
-
:host([direction="top"][opened]) .menu {
|
|
101
|
-
transform: translateY(100vh);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
105
|
:host([direction="left"][opened]) .menu {
|
|
105
106
|
transform: translateX(0);
|
|
107
|
+
box-shadow: var(--dile-app-drawer-box-shadow, 1px 0 8px #000);
|
|
106
108
|
}
|
|
107
109
|
`;
|
|
108
110
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DileWebVisor } from "./src/DileWebVisor.js";
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { html, css, LitElement } from "lit";
|
|
2
|
+
import "../../button/button.js";
|
|
3
|
+
import '../../icon/icon.js';
|
|
4
|
+
import { zoomInIcon, zoomOutIcon, cropIcon } from "@dile/icons/index.js";
|
|
5
|
+
|
|
6
|
+
export class DileWebVisor extends LitElement {
|
|
7
|
+
|
|
8
|
+
static styles = css`
|
|
9
|
+
:host {
|
|
10
|
+
display: block;
|
|
11
|
+
border: 1px solid #e0e0e0;
|
|
12
|
+
border-radius: 8px;
|
|
13
|
+
overflow: hidden;
|
|
14
|
+
font-family: sans-serif;
|
|
15
|
+
background: #f5f5f5;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.toolbar {
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
justify-content: space-between;
|
|
22
|
+
padding: 8px 12px;
|
|
23
|
+
background: #ffffff;
|
|
24
|
+
border-bottom: 1px solid #e0e0e0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.controls {
|
|
28
|
+
display: flex;
|
|
29
|
+
gap: 8px;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
iframe {
|
|
33
|
+
width: 100%;
|
|
34
|
+
height: 100%;
|
|
35
|
+
border: none;
|
|
36
|
+
transform-origin: 0 0;
|
|
37
|
+
transition: transform 0.2s ease-in-out;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.zoom {
|
|
41
|
+
--dile-icon-color: #000000;
|
|
42
|
+
}
|
|
43
|
+
`;
|
|
44
|
+
static properties = {
|
|
45
|
+
url: { type: String },
|
|
46
|
+
title: { type: String },
|
|
47
|
+
_zoom: { type: Number }
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
constructor() {
|
|
51
|
+
super();
|
|
52
|
+
this.url = "";
|
|
53
|
+
this.title = "";
|
|
54
|
+
this._zoom = 1;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
render() {
|
|
58
|
+
return html`
|
|
59
|
+
<div class="web-visor">
|
|
60
|
+
${this._toolbarTemplate}
|
|
61
|
+
${this._webTemplate}
|
|
62
|
+
</div>
|
|
63
|
+
`;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
get _toolbarTemplate() {
|
|
67
|
+
return html`
|
|
68
|
+
<div class="toolbar">
|
|
69
|
+
<span class="url-display">${this.title}</span>
|
|
70
|
+
<div class="controls">
|
|
71
|
+
<dile-button @click=${this._zoomOut}>
|
|
72
|
+
<dile-icon class="zoom" .icon=${zoomOutIcon}></dile-icon>
|
|
73
|
+
</dile-button>
|
|
74
|
+
<dile-button @click=${this._zoomIn}>
|
|
75
|
+
<dile-icon class="zoom" .icon=${zoomInIcon}></dile-icon>
|
|
76
|
+
</dile-button>
|
|
77
|
+
<dile-button @click=${this._toggleFullScreen}>
|
|
78
|
+
<dile-icon class="zoom" .icon=${cropIcon}></dile-icon>
|
|
79
|
+
</dile-button>
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
`;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
get _webTemplate() {
|
|
86
|
+
return html`
|
|
87
|
+
<iframe
|
|
88
|
+
src="${this.url}"
|
|
89
|
+
style="transform: scale(${this._zoom}); width: ${100 / this._zoom}%; height: ${100 / this._zoom}%;"
|
|
90
|
+
title=${this.title}
|
|
91
|
+
></iframe>
|
|
92
|
+
`;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
_toggleFullScreen() {
|
|
96
|
+
const target = this.renderRoot?.querySelector(".web-visor");
|
|
97
|
+
if (!target) return;
|
|
98
|
+
|
|
99
|
+
const isFullscreen = document.fullscreenElement || document.webkitFullscreenElement;
|
|
100
|
+
|
|
101
|
+
if (!isFullscreen) {
|
|
102
|
+
const request = target.requestFullscreen || target.webkitRequestFullscreen;
|
|
103
|
+
if (request) {
|
|
104
|
+
request.call(target).catch?.((err) => {
|
|
105
|
+
console.error("Error al entrar en pantalla completa:", err);
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
} else {
|
|
109
|
+
const exit = document.exitFullscreen || document.webkitExitFullscreen;
|
|
110
|
+
if (exit) {
|
|
111
|
+
exit.call(document);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
_zoomIn() {
|
|
117
|
+
this._zoom += 0.1;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
_zoomOut() {
|
|
121
|
+
if (this._zoom > 0.2) this._zoom -= 0.1;
|
|
122
|
+
}
|
|
123
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dile/ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.25.0",
|
|
4
4
|
"description": "UI Core components from dile-components.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
"publishConfig": {
|
|
27
27
|
"access": "public"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "f65c62d5678f82edf5c921058c7e25dfc6ee2922"
|
|
30
30
|
}
|