@nuralyui/panel 0.0.1 → 0.0.4
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/bundle.js +1076 -0
- package/index.d.ts +9 -0
- package/index.js +9 -0
- package/index.js.map +1 -0
- package/package.json +45 -45
- package/panel.component.d.ts +199 -0
- package/panel.component.js +720 -0
- package/panel.component.js.map +1 -0
- package/panel.style.d.ts +7 -0
- package/panel.style.js +498 -0
- package/panel.style.js.map +1 -0
- package/panel.types.d.ts +94 -0
- package/panel.types.js +50 -0
- package/panel.types.js.map +1 -0
- package/react.d.ts +11 -0
- package/react.js +18 -0
- package/react.js.map +1 -0
- package/README.md +0 -218
package/index.d.ts
ADDED
package/index.js
ADDED
package/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/panel/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2023 Nuraly, Laabidi Aymen\n * SPDX-License-Identifier: MIT\n */\n\nexport * from './panel.component.js';\nexport * from './panel.types.js';\nexport * from './controllers/index.js';\n"]}
|
package/package.json
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
"name": "@nuralyui/panel",
|
|
3
|
+
"version": "0.0.4",
|
|
4
|
+
"description": "Panel component for NuralyUI - transformable panel/window with drag and resize",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"import": "./index.js"
|
|
10
|
+
},
|
|
11
|
+
"./bundle": {
|
|
12
|
+
"import": "./bundle.js"
|
|
13
|
+
}
|
|
10
14
|
},
|
|
11
|
-
"
|
|
12
|
-
|
|
15
|
+
"files": [
|
|
16
|
+
"*.js",
|
|
17
|
+
"*.d.ts",
|
|
18
|
+
"*.js.map",
|
|
19
|
+
"panel.bundled.js",
|
|
20
|
+
"bundle.js"
|
|
21
|
+
],
|
|
22
|
+
"scripts": {
|
|
23
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
24
|
+
},
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "https://github.com/Nuralyio/NuralyUI.git",
|
|
28
|
+
"directory": "src/components/panel"
|
|
29
|
+
},
|
|
30
|
+
"keywords": [
|
|
31
|
+
"panel",
|
|
32
|
+
"window",
|
|
33
|
+
"draggable",
|
|
34
|
+
"resizable",
|
|
35
|
+
"web-components",
|
|
36
|
+
"lit"
|
|
37
|
+
],
|
|
38
|
+
"author": "Nuraly, Laabidi Aymen",
|
|
39
|
+
"license": "ISC",
|
|
40
|
+
"nuralyui": {
|
|
41
|
+
"requiredComponents": [
|
|
42
|
+
"nr-icon"
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
"peerDependencies": {
|
|
46
|
+
"@nuralyui/icon": "^0.0.1",
|
|
47
|
+
"@nuralyui/common": "^0.0.1"
|
|
13
48
|
}
|
|
14
|
-
},
|
|
15
|
-
"files": [
|
|
16
|
-
"*.js",
|
|
17
|
-
"*.d.ts",
|
|
18
|
-
"*.js.map",
|
|
19
|
-
"panel.bundled.js",
|
|
20
|
-
"bundle.js"
|
|
21
|
-
],
|
|
22
|
-
"scripts": {
|
|
23
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
24
|
-
},
|
|
25
|
-
"repository": {
|
|
26
|
-
"type": "git",
|
|
27
|
-
"url": "https://github.com/Nuralyio/NuralyUI.git",
|
|
28
|
-
"directory": "src/components/panel"
|
|
29
|
-
},
|
|
30
|
-
"keywords": [
|
|
31
|
-
"panel",
|
|
32
|
-
"window",
|
|
33
|
-
"draggable",
|
|
34
|
-
"resizable",
|
|
35
|
-
"web-components",
|
|
36
|
-
"lit"
|
|
37
|
-
],
|
|
38
|
-
"author": "Nuraly, Laabidi Aymen",
|
|
39
|
-
"license": "ISC",
|
|
40
|
-
"nuralyui": {
|
|
41
|
-
"requiredComponents": [
|
|
42
|
-
"nr-icon"
|
|
43
|
-
]
|
|
44
|
-
},
|
|
45
|
-
"peerDependencies": {
|
|
46
|
-
"@nuralyui/icon": "^0.0.1",
|
|
47
|
-
"@nuralyui/common": "^0.0.1"
|
|
48
|
-
}
|
|
49
49
|
}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
6
|
+
import { LitElement, nothing, type PropertyValues } from 'lit';
|
|
7
|
+
import { PanelMode, PanelSize, PanelPosition, MaximizePosition } from './panel.types.js';
|
|
8
|
+
import '../icon/index.js';
|
|
9
|
+
import '../label/index.js';
|
|
10
|
+
import { PanelDragHost, PanelResizeHost } from './controllers/index.js';
|
|
11
|
+
declare const NrPanelElement_base: (new (...args: any[]) => import("@nuralyui/common/mixins").DependencyAware) & (new (...args: any[]) => import("@nuralyui/common/mixins").ThemeAware) & (new (...args: any[]) => import("@nuralyui/common/mixins").EventHandlerCapable) & typeof LitElement;
|
|
12
|
+
/**
|
|
13
|
+
* Versatile panel component that can transform between panel and window modes.
|
|
14
|
+
*
|
|
15
|
+
* Features:
|
|
16
|
+
* - Transform between panel (docked) and window (floating) modes
|
|
17
|
+
* - Draggable in window mode
|
|
18
|
+
* - Resizable panels
|
|
19
|
+
* - Collapsible content
|
|
20
|
+
* - Minimizable to compact view
|
|
21
|
+
* - Theme-aware styling with light/dark mode support
|
|
22
|
+
* - Multiple size presets
|
|
23
|
+
* - Positioned docking (left, right, top, bottom)
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```html
|
|
27
|
+
* <!-- Panel docked to right side -->
|
|
28
|
+
* <nr-panel
|
|
29
|
+
* title="Settings Panel"
|
|
30
|
+
* mode="panel"
|
|
31
|
+
* position="right"
|
|
32
|
+
* size="medium">
|
|
33
|
+
* <p>Panel content here</p>
|
|
34
|
+
* </nr-panel>
|
|
35
|
+
*
|
|
36
|
+
* <!-- Floating draggable window -->
|
|
37
|
+
* <nr-panel
|
|
38
|
+
* title="Tool Window"
|
|
39
|
+
* mode="window"
|
|
40
|
+
* draggable
|
|
41
|
+
* resizable
|
|
42
|
+
* size="medium">
|
|
43
|
+
* <p>Window content here</p>
|
|
44
|
+
* </nr-panel>
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* @fires panel-mode-change - Panel mode changed
|
|
48
|
+
* @fires panel-close - Panel closed
|
|
49
|
+
* @fires panel-minimize - Panel minimized
|
|
50
|
+
* @fires panel-maximize - Panel maximized/restored
|
|
51
|
+
* @fires panel-drag-start - Panel drag started
|
|
52
|
+
* @fires panel-drag-end - Panel drag ended
|
|
53
|
+
* @fires panel-resize - Panel resized
|
|
54
|
+
*
|
|
55
|
+
* @slot default - Panel body content
|
|
56
|
+
* @slot header - Custom header content
|
|
57
|
+
* @slot footer - Custom footer content
|
|
58
|
+
*/
|
|
59
|
+
export declare class NrPanelElement extends NrPanelElement_base implements PanelDragHost, PanelResizeHost {
|
|
60
|
+
static styles: import("lit").CSSResult;
|
|
61
|
+
requiredComponents: string[];
|
|
62
|
+
/** Panel mode (panel, window, minimized) */
|
|
63
|
+
mode: PanelMode;
|
|
64
|
+
/** Panel size */
|
|
65
|
+
size: PanelSize;
|
|
66
|
+
/** Panel position (for panel mode) */
|
|
67
|
+
position: PanelPosition;
|
|
68
|
+
/** Position where the window appears when maximizing from embedded mode */
|
|
69
|
+
maximizePosition: MaximizePosition;
|
|
70
|
+
/** Whether the panel can be dragged (window mode only) */
|
|
71
|
+
draggable: boolean;
|
|
72
|
+
/** Whether the panel is resizable */
|
|
73
|
+
resizable: boolean;
|
|
74
|
+
/** Whether the panel content can be collapsed */
|
|
75
|
+
collapsible: boolean;
|
|
76
|
+
/** Whether the panel can be minimized */
|
|
77
|
+
minimizable: boolean;
|
|
78
|
+
/** Whether the panel can be closed */
|
|
79
|
+
closable: boolean;
|
|
80
|
+
/** Whether to enable smooth animations for position/mode changes */
|
|
81
|
+
animated: boolean;
|
|
82
|
+
/** Panel title */
|
|
83
|
+
title: string;
|
|
84
|
+
/** Header icon */
|
|
85
|
+
icon: string;
|
|
86
|
+
/** Custom width */
|
|
87
|
+
width: string;
|
|
88
|
+
/** Custom height */
|
|
89
|
+
height: string;
|
|
90
|
+
/** Whether the panel is open/visible */
|
|
91
|
+
open: boolean;
|
|
92
|
+
/** Collapsed state */
|
|
93
|
+
private collapsed;
|
|
94
|
+
/** Dragging state */
|
|
95
|
+
isDragging: boolean;
|
|
96
|
+
/** Animation state */
|
|
97
|
+
private animating;
|
|
98
|
+
/** Current X offset for dragging */
|
|
99
|
+
offsetX: number;
|
|
100
|
+
/** Current Y offset for dragging */
|
|
101
|
+
offsetY: number;
|
|
102
|
+
/** Current panel width */
|
|
103
|
+
panelWidth: number;
|
|
104
|
+
/** Current panel height */
|
|
105
|
+
panelHeight: number;
|
|
106
|
+
/** Original mode before any transformations (for restoration from minimized) */
|
|
107
|
+
private originalMode;
|
|
108
|
+
/** Track if panel is maximized from embedded mode */
|
|
109
|
+
private isMaximizedFromEmbedded;
|
|
110
|
+
/** Track if this panel was created from a tab pop-out */
|
|
111
|
+
isTabPopOut: boolean;
|
|
112
|
+
/** Track if this is the first update to capture initial mode */
|
|
113
|
+
private isFirstUpdate;
|
|
114
|
+
/** Original dimensions before maximizing from embedded mode */
|
|
115
|
+
private originalEmbeddedWidth;
|
|
116
|
+
/** Original dimensions before maximizing from embedded mode */
|
|
117
|
+
private originalEmbeddedHeight;
|
|
118
|
+
private dragController;
|
|
119
|
+
private _resizeController;
|
|
120
|
+
connectedCallback(): void;
|
|
121
|
+
willUpdate(changedProperties: PropertyValues): void;
|
|
122
|
+
updated(changedProperties: PropertyValues): void;
|
|
123
|
+
/**
|
|
124
|
+
* Handle mode change
|
|
125
|
+
*/
|
|
126
|
+
private handleModeChange;
|
|
127
|
+
/**
|
|
128
|
+
* Transform to window mode
|
|
129
|
+
*/
|
|
130
|
+
transformToWindow(): void;
|
|
131
|
+
/**
|
|
132
|
+
* Transform to panel mode
|
|
133
|
+
*/
|
|
134
|
+
transformToPanel(): void;
|
|
135
|
+
/**
|
|
136
|
+
* Restore panel to its original state
|
|
137
|
+
*/
|
|
138
|
+
restore(): void;
|
|
139
|
+
/**
|
|
140
|
+
* Minimize panel
|
|
141
|
+
*/
|
|
142
|
+
minimize(): void;
|
|
143
|
+
/**
|
|
144
|
+
* Maximize embedded panel to floating window
|
|
145
|
+
*/
|
|
146
|
+
maximizeEmbedded(): void;
|
|
147
|
+
/**
|
|
148
|
+
* Set the window position based on maximizePosition with slight randomization
|
|
149
|
+
*/
|
|
150
|
+
private setMaximizePosition;
|
|
151
|
+
/**
|
|
152
|
+
* Restore maximized embedded panel back to embedded mode
|
|
153
|
+
*/
|
|
154
|
+
restoreEmbedded(): void;
|
|
155
|
+
/**
|
|
156
|
+
* Maximize/restore panel
|
|
157
|
+
*/
|
|
158
|
+
maximize(): void;
|
|
159
|
+
/**
|
|
160
|
+
* Close panel
|
|
161
|
+
*/
|
|
162
|
+
close(): void;
|
|
163
|
+
/**
|
|
164
|
+
* Toggle collapsed state
|
|
165
|
+
*/
|
|
166
|
+
toggleCollapse(): void;
|
|
167
|
+
/**
|
|
168
|
+
* Get label size based on panel size
|
|
169
|
+
*/
|
|
170
|
+
private getLabelSize;
|
|
171
|
+
/**
|
|
172
|
+
* Get panel classes
|
|
173
|
+
*/
|
|
174
|
+
private getPanelClasses;
|
|
175
|
+
/**
|
|
176
|
+
* Get panel styles
|
|
177
|
+
*/
|
|
178
|
+
private getPanelStyles;
|
|
179
|
+
/**
|
|
180
|
+
* Render header
|
|
181
|
+
*/
|
|
182
|
+
private renderHeader;
|
|
183
|
+
/**
|
|
184
|
+
* Render footer
|
|
185
|
+
*/
|
|
186
|
+
private renderFooter;
|
|
187
|
+
/**
|
|
188
|
+
* Render resize handles
|
|
189
|
+
*/
|
|
190
|
+
private renderResizeHandles;
|
|
191
|
+
render(): typeof nothing | import("lit-html").TemplateResult<1>;
|
|
192
|
+
}
|
|
193
|
+
declare global {
|
|
194
|
+
interface HTMLElementTagNameMap {
|
|
195
|
+
'nr-panel': NrPanelElement;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
export {};
|
|
199
|
+
//# sourceMappingURL=panel.component.d.ts.map
|