@nova-design-system/nova-webcomponents 3.16.0 → 3.17.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.
- package/dist/cjs/index-93d3b2f8.js +4 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/native.cjs.js +1 -1
- package/dist/cjs/nv-button.cjs.entry.js +1 -7
- package/dist/cjs/nv-button.cjs.entry.js.map +1 -1
- package/dist/cjs/nv-split.cjs.entry.js +339 -0
- package/dist/cjs/nv-split.cjs.entry.js.map +1 -0
- package/dist/cjs/nv-stack.cjs.entry.js +1 -1
- package/dist/cjs/nv-table.cjs.entry.js +1 -1
- package/dist/cjs/nv-toggle.cjs.entry.js +2 -2
- package/dist/cjs/nv-togglebutton.cjs.entry.js +1 -1
- package/dist/cjs/nv-togglebuttongroup.cjs.entry.js +1 -1
- package/dist/cjs/nv-tooltip.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/nv-button/nv-button.js +1 -13
- package/dist/collection/components/nv-button/nv-button.js.map +1 -1
- package/dist/collection/components/nv-split/nv-split.docs.js +41 -0
- package/dist/collection/components/nv-split/nv-split.docs.js.map +1 -0
- package/dist/collection/components/nv-split/nv-split.js +549 -0
- package/dist/collection/components/nv-split/nv-split.js.map +1 -0
- package/dist/collection/components/nv-split/styles/nv-split.css +96 -0
- package/dist/collection/components/nv-stack/nv-stack.js +1 -1
- package/dist/collection/components/nv-table/nv-table.js +1 -1
- package/dist/collection/components/nv-toggle/nv-toggle.js +2 -2
- package/dist/collection/components/nv-togglebutton/nv-togglebutton.js +1 -1
- package/dist/collection/components/nv-togglebuttongroup/nv-togglebuttongroup.js +1 -1
- package/dist/collection/components/nv-tooltip/nv-tooltip.js +1 -1
- package/dist/components/nv-breadcrumb.js +1 -1
- package/dist/components/nv-button.js +1 -1
- package/dist/components/nv-dialog.js +2 -2
- package/dist/components/nv-dialogfooter.js +1 -1
- package/dist/components/nv-split.d.ts +11 -0
- package/dist/components/nv-split.js +366 -0
- package/dist/components/nv-split.js.map +1 -0
- package/dist/components/nv-stack.js +1 -1
- package/dist/components/nv-table.js +1 -1
- package/dist/components/nv-toggle.js +2 -2
- package/dist/components/nv-togglebutton.js +1 -1
- package/dist/components/nv-togglebuttongroup.js +1 -1
- package/dist/components/nv-tooltip.js +1 -1
- package/dist/components/{p-9707528d.js → p-6f2b257e.js} +2 -2
- package/dist/components/{p-9707528d.js.map → p-6f2b257e.js.map} +1 -1
- package/dist/components/{p-a1ef5e37.js → p-7b5102c8.js} +2 -2
- package/dist/components/{p-a1ef5e37.js.map → p-7b5102c8.js.map} +1 -1
- package/dist/components/{p-2d64749f.js → p-9e7468e3.js} +3 -9
- package/dist/components/p-9e7468e3.js.map +1 -0
- package/dist/esm/index-dc2723f3.js +4 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/native.js +1 -1
- package/dist/esm/nv-button.entry.js +1 -7
- package/dist/esm/nv-button.entry.js.map +1 -1
- package/dist/esm/nv-split.entry.js +335 -0
- package/dist/esm/nv-split.entry.js.map +1 -0
- package/dist/esm/nv-stack.entry.js +1 -1
- package/dist/esm/nv-table.entry.js +1 -1
- package/dist/esm/nv-toggle.entry.js +2 -2
- package/dist/esm/nv-togglebutton.entry.js +1 -1
- package/dist/esm/nv-togglebuttongroup.entry.js +1 -1
- package/dist/esm/nv-tooltip.entry.js +1 -1
- package/dist/native/native.css +1 -1
- package/dist/native/native.esm.js +1 -1
- package/dist/native/native.esm.js.map +1 -1
- package/dist/native/{p-445221dc.entry.js → p-14e622e1.entry.js} +2 -2
- package/dist/native/p-2364aefa.entry.js +2 -0
- package/dist/native/p-2364aefa.entry.js.map +1 -0
- package/dist/native/{p-44a78545.entry.js → p-52d2c0ae.entry.js} +2 -2
- package/dist/native/{p-a2f58133.entry.js → p-638967bf.entry.js} +2 -2
- package/dist/native/{p-075d231e.entry.js → p-91fab6c2.entry.js} +2 -2
- package/dist/native/{p-d45ee8e5.entry.js → p-a6fc987a.entry.js} +2 -2
- package/dist/native/p-a6fc987a.entry.js.map +1 -0
- package/dist/native/{p-dfb6b65e.entry.js → p-cb0293ec.entry.js} +2 -2
- package/dist/native/{p-b02c896a.entry.js → p-d94bf052.entry.js} +2 -2
- package/dist/types/components/nv-button/nv-button.d.ts +0 -1
- package/dist/types/components/nv-split/nv-split.d.ts +128 -0
- package/dist/types/components/nv-split/nv-split.docs.d.ts +4 -0
- package/dist/types/components.d.ts +107 -0
- package/dist/vscode-data.json +25 -0
- package/hydrate/index.js +363 -15
- package/hydrate/index.mjs +363 -15
- package/package.json +5 -1
- package/dist/components/p-2d64749f.js.map +0 -1
- package/dist/native/p-d45ee8e5.entry.js.map +0 -1
- /package/dist/native/{p-445221dc.entry.js.map → p-14e622e1.entry.js.map} +0 -0
- /package/dist/native/{p-44a78545.entry.js.map → p-52d2c0ae.entry.js.map} +0 -0
- /package/dist/native/{p-a2f58133.entry.js.map → p-638967bf.entry.js.map} +0 -0
- /package/dist/native/{p-075d231e.entry.js.map → p-91fab6c2.entry.js.map} +0 -0
- /package/dist/native/{p-dfb6b65e.entry.js.map → p-cb0293ec.entry.js.map} +0 -0
- /package/dist/native/{p-b02c896a.entry.js.map → p-d94bf052.entry.js.map} +0 -0
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-93d3b2f8.js');
|
|
6
|
+
|
|
7
|
+
const nvSplitCss = "nv-split{display:flex;width:100%;height:100%;position:relative}nv-split[direction=horizontal]{flex-direction:row}nv-split[direction=vertical]{flex-direction:column}nv-split .nv-split-gutter{position:absolute;z-index:10;background:transparent;display:flex;align-items:center;justify-content:center;flex:0 0 auto;transition:background-color 0.2s ease}nv-split .nv-split-gutter::after{content:\"\";position:absolute;background:var(--nv-color-neutral-400, #ccc);border-radius:2px;transition:background-color 0.2s ease}nv-split .nv-split-gutter:hover::after{background:var(--nv-color-brand-primary, #0066cc)}nv-split .nv-split-gutter::before{content:\"\";position:absolute;background-repeat:no-repeat;background-position:center;opacity:0.4;transition:opacity 0.2s ease;pointer-events:none}nv-split .nv-split-gutter:hover::before{opacity:0.7}nv-split[direction=horizontal]>.nv-split-gutter{width:var(--nv-split-gutter-size, 24px);top:0;bottom:0;transform:translateX(-50%);cursor:col-resize}nv-split[direction=horizontal]>.nv-split-gutter::after{width:2px;height:60%;left:50%;top:20%;transform:translateX(-50%)}nv-split[direction=horizontal]>.nv-split-gutter::before{width:16px;height:16px}nv-split[direction=vertical]>.nv-split-gutter{height:var(--nv-split-gutter-size, 24px);left:0;right:0;transform:translateY(-50%);cursor:row-resize}nv-split[direction=vertical]>.nv-split-gutter::after{height:2px;width:60%;top:50%;left:20%;transform:translateY(-50%)}nv-split[direction=vertical]>.nv-split-gutter::before{width:16px;height:16px}nv-split[data-dragging=true]>.nv-split-gutter::after{background:var(--nv-color-neutral-500, #9ca3af)}nv-split>[slot=pane]{flex:1 1 auto;overflow:hidden;min-width:0;min-height:0;display:flex;flex-direction:column}nv-split>[slot=pane]>nv-split{flex:1 1 auto;width:100%;height:100%}";
|
|
8
|
+
const NvSplitStyle0 = nvSplitCss;
|
|
9
|
+
|
|
10
|
+
const NvSplit = class {
|
|
11
|
+
constructor(hostRef) {
|
|
12
|
+
index.registerInstance(this, hostRef);
|
|
13
|
+
this.sizesChanged = index.createEvent(this, "sizesChanged", 7);
|
|
14
|
+
/****************************************************************************/
|
|
15
|
+
//#region PROPERTIES
|
|
16
|
+
/**
|
|
17
|
+
* Direction of the split layout.
|
|
18
|
+
* - `horizontal`: panes side by side
|
|
19
|
+
* - `vertical`: panes stacked
|
|
20
|
+
*/
|
|
21
|
+
this.direction = 'horizontal';
|
|
22
|
+
/**
|
|
23
|
+
* Initial sizes of the panes in percentages.
|
|
24
|
+
* Example: `[50, 50]` means two equal panes.
|
|
25
|
+
* Explicitly `reflect: false` (array) for framework compatibility.
|
|
26
|
+
*/
|
|
27
|
+
this.sizes = [];
|
|
28
|
+
/**
|
|
29
|
+
* Width or height of the gutter (in px) depending on the split direction.
|
|
30
|
+
* Default is 24px to meet WCAG 2.2 target size requirements for touch accessibility.
|
|
31
|
+
*/
|
|
32
|
+
this.gutterSize = 24;
|
|
33
|
+
//#endregion
|
|
34
|
+
/****************************************************************************/
|
|
35
|
+
//#region STATE
|
|
36
|
+
this.isDragging = false;
|
|
37
|
+
this.dragIndex = -1;
|
|
38
|
+
this.startPos = 0;
|
|
39
|
+
this.startSizes = [];
|
|
40
|
+
// Handlers stored to be able to detach them
|
|
41
|
+
this.onDocMove = (ev) => this.handleMouseMove(ev);
|
|
42
|
+
this.onDocUp = () => this.stopDragging();
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
/****************************************************************************/
|
|
46
|
+
//#region WATCHERS
|
|
47
|
+
onSizesChanged() {
|
|
48
|
+
// Re-apply sizes if modified from the outside
|
|
49
|
+
this.applySizes();
|
|
50
|
+
}
|
|
51
|
+
onDirectionChanged() {
|
|
52
|
+
// Update the orientation and the cursors of the gutters
|
|
53
|
+
this.ensureGutters();
|
|
54
|
+
this.applySizes();
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
57
|
+
/****************************************************************************/
|
|
58
|
+
//#region LIFECYCLE
|
|
59
|
+
componentDidLoad() {
|
|
60
|
+
// Initialization (once)
|
|
61
|
+
this.ensureGutters();
|
|
62
|
+
this.applySizes();
|
|
63
|
+
this.positionGutters();
|
|
64
|
+
// Observer: reposition gutters when resized (nested or parent split changes)
|
|
65
|
+
this.ro = new ResizeObserver(() => this.positionGutters());
|
|
66
|
+
this.ro.observe(this.el);
|
|
67
|
+
window.addEventListener('resize', () => this.positionGutters());
|
|
68
|
+
}
|
|
69
|
+
disconnectedCallback() {
|
|
70
|
+
var _a;
|
|
71
|
+
// Security cleanup (in case a drag was in progress)
|
|
72
|
+
this.detachDocumentListeners();
|
|
73
|
+
(_a = this.ro) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
74
|
+
this.ro = undefined;
|
|
75
|
+
}
|
|
76
|
+
//#endregion
|
|
77
|
+
/****************************************************************************/
|
|
78
|
+
//#region PUBLIC METHODS
|
|
79
|
+
/**
|
|
80
|
+
* Programmatically set pane sizes.
|
|
81
|
+
* @param {Array<number>} sizes Array of pane sizes in percentages.
|
|
82
|
+
* @returns {Promise<void>}
|
|
83
|
+
*/
|
|
84
|
+
async setSizes(sizes) {
|
|
85
|
+
this.sizes = [...sizes];
|
|
86
|
+
this.applySizes();
|
|
87
|
+
this.sizesChanged.emit([...this.sizes]);
|
|
88
|
+
this.positionGutters();
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Returns the current pane sizes.
|
|
92
|
+
* @returns {Promise<number[]>} Array of pane sizes in percentages.
|
|
93
|
+
*/
|
|
94
|
+
async getSizes() {
|
|
95
|
+
return [...this.sizes];
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Collapse a specific pane to 0 size.
|
|
99
|
+
* @param {number} index Index of the pane to collapse.
|
|
100
|
+
* @returns {Promise<void>}
|
|
101
|
+
*/
|
|
102
|
+
async collapse(index) {
|
|
103
|
+
const panes = this.getPanes();
|
|
104
|
+
if (index < 0 || index >= panes.length)
|
|
105
|
+
return;
|
|
106
|
+
// Simple strategy: 0% for the index, the rest (100%) for its nearest neighbor
|
|
107
|
+
const next = new Array(panes.length).fill(0);
|
|
108
|
+
const target = index < panes.length - 1 ? index + 1 : index - 1;
|
|
109
|
+
if (target >= 0)
|
|
110
|
+
next[target] = 100;
|
|
111
|
+
this.sizes = next;
|
|
112
|
+
this.applySizes();
|
|
113
|
+
this.sizesChanged.emit([...this.sizes]);
|
|
114
|
+
this.positionGutters();
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Destroy the split instance: removes gutters and resets layout state.
|
|
118
|
+
* @returns {Promise<void>}
|
|
119
|
+
*/
|
|
120
|
+
async destroy() {
|
|
121
|
+
var _a;
|
|
122
|
+
this.sizes = [];
|
|
123
|
+
this.isDragging = false;
|
|
124
|
+
this.dragIndex = -1;
|
|
125
|
+
this.removeOwnGutters();
|
|
126
|
+
this.detachDocumentListeners();
|
|
127
|
+
(_a = this.ro) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
128
|
+
}
|
|
129
|
+
//#endregion
|
|
130
|
+
/****************************************************************************/
|
|
131
|
+
//#region INTERNAL HELPERS
|
|
132
|
+
/**
|
|
133
|
+
* Returns the panes of the split.
|
|
134
|
+
* @returns {HTMLElement[]} The panes of the split.
|
|
135
|
+
*/
|
|
136
|
+
getPanes() {
|
|
137
|
+
// Only the direct children slot="pane"
|
|
138
|
+
return Array.from(this.el.querySelectorAll(':scope > [slot="pane"]'));
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Returns the own gutters of the split.
|
|
142
|
+
* @returns {HTMLElement[]} The own gutters of the split.
|
|
143
|
+
*/
|
|
144
|
+
getOwnGutters() {
|
|
145
|
+
// Only the direct gutters of THIS instance
|
|
146
|
+
return Array.from(this.el.querySelectorAll(':scope > .nv-split-gutter[data-auto="true"]'));
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Removes the own gutters of the split.
|
|
150
|
+
*/
|
|
151
|
+
removeOwnGutters() {
|
|
152
|
+
this.getOwnGutters().forEach(g => g.remove());
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Ensures the gutters of the split.
|
|
156
|
+
*/
|
|
157
|
+
ensureGutters() {
|
|
158
|
+
const panes = this.getPanes();
|
|
159
|
+
// 1) Clean ONLY the old direct gutters of THIS instance
|
|
160
|
+
this.removeOwnGutters();
|
|
161
|
+
if (panes.length <= 1)
|
|
162
|
+
return;
|
|
163
|
+
// 2) Add the gutters (directs) between the panes
|
|
164
|
+
panes.forEach((pane, i) => {
|
|
165
|
+
if (i >= panes.length - 1)
|
|
166
|
+
return;
|
|
167
|
+
const g = document.createElement('div');
|
|
168
|
+
g.className = 'nv-split-gutter';
|
|
169
|
+
g.setAttribute('data-auto', 'true');
|
|
170
|
+
if (this.direction === 'horizontal') {
|
|
171
|
+
g.style.width = `${this.gutterSize}px`;
|
|
172
|
+
g.style.cursor = 'col-resize';
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
g.style.height = `${this.gutterSize}px`;
|
|
176
|
+
g.style.cursor = 'row-resize';
|
|
177
|
+
}
|
|
178
|
+
// Customizable internal slot
|
|
179
|
+
const slotEl = document.createElement('slot');
|
|
180
|
+
slotEl.name = 'gutter';
|
|
181
|
+
g.appendChild(slotEl);
|
|
182
|
+
// Listener drag (index = gutter between pane i and i+1)
|
|
183
|
+
g.addEventListener('mousedown', (ev) => this.startDragging(ev, i));
|
|
184
|
+
// Insert just after the pane
|
|
185
|
+
pane.insertAdjacentElement('afterend', g);
|
|
186
|
+
});
|
|
187
|
+
this.positionGutters();
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Applies the sizes to the panes.
|
|
191
|
+
*/
|
|
192
|
+
applySizes() {
|
|
193
|
+
const panes = this.getPanes();
|
|
194
|
+
const n = panes.length;
|
|
195
|
+
if (n === 0)
|
|
196
|
+
return;
|
|
197
|
+
// Default values if inconsistent
|
|
198
|
+
if (!this.sizes || this.sizes.length !== n) {
|
|
199
|
+
this.sizes = Array(n).fill(100 / n);
|
|
200
|
+
}
|
|
201
|
+
panes.forEach((pane, i) => {
|
|
202
|
+
var _a;
|
|
203
|
+
const size = Math.max(0, (_a = this.sizes[i]) !== null && _a !== void 0 ? _a : 100 / n);
|
|
204
|
+
// Flex-basis via flex shorthand (https://developer.mozilla.org/en-US/docs/Web/CSS/flex)
|
|
205
|
+
pane.style.flex = `0 0 ${size}%`;
|
|
206
|
+
pane.style.minWidth = '0';
|
|
207
|
+
pane.style.minHeight = '0';
|
|
208
|
+
pane.style.overflow = 'hidden'; // let a nv-split child extend
|
|
209
|
+
pane.style.display = 'flex';
|
|
210
|
+
pane.style.flexDirection = 'column';
|
|
211
|
+
});
|
|
212
|
+
this.positionGutters();
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Attaches the document listeners.
|
|
216
|
+
*/
|
|
217
|
+
attachDocumentListeners() {
|
|
218
|
+
document.addEventListener('mousemove', this.onDocMove);
|
|
219
|
+
document.addEventListener('mouseup', this.onDocUp);
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Detaches the document listeners.
|
|
223
|
+
*/
|
|
224
|
+
detachDocumentListeners() {
|
|
225
|
+
document.removeEventListener('mousemove', this.onDocMove);
|
|
226
|
+
document.removeEventListener('mouseup', this.onDocUp);
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Positions the gutters based on the current sizes of the panes.
|
|
230
|
+
*/
|
|
231
|
+
positionGutters() {
|
|
232
|
+
var _a, _b;
|
|
233
|
+
const panes = this.getPanes();
|
|
234
|
+
const gutters = this.getOwnGutters();
|
|
235
|
+
if (panes.length <= 1 || gutters.length === 0)
|
|
236
|
+
return;
|
|
237
|
+
const horizontal = this.direction === 'horizontal';
|
|
238
|
+
let cumPct = 0;
|
|
239
|
+
for (let i = 0; i < gutters.length; i++) {
|
|
240
|
+
const sizePct = (_b = (_a = this.sizes) === null || _a === void 0 ? void 0 : _a[i]) !== null && _b !== void 0 ? _b : 100 / panes.length;
|
|
241
|
+
cumPct += sizePct;
|
|
242
|
+
const g = gutters[i];
|
|
243
|
+
g.style.position = 'absolute';
|
|
244
|
+
if (horizontal) {
|
|
245
|
+
g.style.left = `${cumPct}%`;
|
|
246
|
+
g.style.top = '0';
|
|
247
|
+
g.style.bottom = '0';
|
|
248
|
+
g.style.height = '100%';
|
|
249
|
+
}
|
|
250
|
+
else {
|
|
251
|
+
g.style.top = `${cumPct}%`;
|
|
252
|
+
g.style.left = '0';
|
|
253
|
+
g.style.right = '0';
|
|
254
|
+
g.style.width = '100%';
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Starts the dragging process.
|
|
260
|
+
* @param {MouseEvent} ev - The mouse event.
|
|
261
|
+
* @param {number} index - The index of the gutter.
|
|
262
|
+
*/
|
|
263
|
+
startDragging(ev, index) {
|
|
264
|
+
this.isDragging = true;
|
|
265
|
+
this.dragIndex = index;
|
|
266
|
+
this.startPos = this.direction === 'horizontal' ? ev.clientX : ev.clientY;
|
|
267
|
+
this.startSizes = [...this.sizes];
|
|
268
|
+
this.attachDocumentListeners();
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Handles the mouse movement during dragging.
|
|
272
|
+
* @param {MouseEvent} ev - The mouse event.
|
|
273
|
+
*/
|
|
274
|
+
handleMouseMove(ev) {
|
|
275
|
+
var _a, _b, _c, _d;
|
|
276
|
+
if (!this.isDragging || this.dragIndex < 0)
|
|
277
|
+
return;
|
|
278
|
+
const panes = this.getPanes();
|
|
279
|
+
if (panes.length < 2)
|
|
280
|
+
return;
|
|
281
|
+
const rect = this.el.getBoundingClientRect();
|
|
282
|
+
// Ensure we never divide by zero if the element has zero width/height
|
|
283
|
+
const rawSize = this.direction === 'horizontal' ? rect.width : rect.height;
|
|
284
|
+
const totalPx = Math.max(rawSize, 1);
|
|
285
|
+
const deltaPx = (this.direction === 'horizontal' ? ev.clientX : ev.clientY) -
|
|
286
|
+
this.startPos;
|
|
287
|
+
const deltaPct = (deltaPx / totalPx) * 100;
|
|
288
|
+
const i = this.dragIndex;
|
|
289
|
+
const j = i + 1;
|
|
290
|
+
let left = this.startSizes[i] + deltaPct;
|
|
291
|
+
let right = this.startSizes[j] - deltaPct;
|
|
292
|
+
// minSizes (px) -> %
|
|
293
|
+
const minLeftPct = (((_b = (_a = this.minSizes) === null || _a === void 0 ? void 0 : _a[i]) !== null && _b !== void 0 ? _b : 0) / totalPx) * 100;
|
|
294
|
+
const minRightPct = (((_d = (_c = this.minSizes) === null || _c === void 0 ? void 0 : _c[j]) !== null && _d !== void 0 ? _d : 0) / totalPx) * 100;
|
|
295
|
+
left = Math.max(left, minLeftPct);
|
|
296
|
+
right = Math.max(right, minRightPct);
|
|
297
|
+
// Keep the sum of the pair i/j constant
|
|
298
|
+
const pairSum = left + right;
|
|
299
|
+
const targetSum = this.startSizes[i] + this.startSizes[j];
|
|
300
|
+
if (Math.abs(pairSum - targetSum) > 0.0001) {
|
|
301
|
+
const k = targetSum / (pairSum || 1);
|
|
302
|
+
left *= k;
|
|
303
|
+
right *= k;
|
|
304
|
+
}
|
|
305
|
+
const next = [...this.startSizes];
|
|
306
|
+
next[i] = left;
|
|
307
|
+
next[j] = right;
|
|
308
|
+
this.sizes = next;
|
|
309
|
+
this.applySizes();
|
|
310
|
+
this.sizesChanged.emit([...this.sizes]);
|
|
311
|
+
this.positionGutters();
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* Stops the dragging process.
|
|
315
|
+
*/
|
|
316
|
+
stopDragging() {
|
|
317
|
+
if (!this.isDragging)
|
|
318
|
+
return;
|
|
319
|
+
this.isDragging = false;
|
|
320
|
+
this.dragIndex = -1;
|
|
321
|
+
this.detachDocumentListeners();
|
|
322
|
+
}
|
|
323
|
+
//#endregion
|
|
324
|
+
/****************************************************************************/
|
|
325
|
+
//#region RENDER
|
|
326
|
+
render() {
|
|
327
|
+
return (index.h(index.Host, { key: 'e3b158ff1b4f665862079d245c219102d8b8ccda', "data-dragging": this.isDragging.toString() }, index.h("slot", { key: 'baa8105a05bf8446d7a31a23cd5276edb320ea2f', name: "pane" }), index.h("slot", { key: '44afe4f4a220aff45f802218f2618e9305141a9f', name: "gutter" })));
|
|
328
|
+
}
|
|
329
|
+
get el() { return index.getElement(this); }
|
|
330
|
+
static get watchers() { return {
|
|
331
|
+
"sizes": ["onSizesChanged"],
|
|
332
|
+
"direction": ["onDirectionChanged"]
|
|
333
|
+
}; }
|
|
334
|
+
};
|
|
335
|
+
NvSplit.style = NvSplitStyle0;
|
|
336
|
+
|
|
337
|
+
exports.nv_split = NvSplit;
|
|
338
|
+
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AI,IAAI,CAAC,GAAG,CAAC,OAAO,GAAG,SAAS,CAAC,GAAG,MAAM,EAAE;YAC1C,MAAM,CAAC,GAAG,SAAS,IAAI,OAAO,IAAI,CAAC,CAAC,CAAC;YACrC,IAAI,IAAI,CAAC,CAAC;YACV,KAAK,IAAI,CAAC,CAAC;SACZ;QAED,MAAM,IAAI,GAAG,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC;QAClC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;QACf,IAAI,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;QAEhB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,UAAU,EAAE,CAAC;QAClB,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;QACxC,IAAI,CAAC,eAAe,EAAE,CAAC;KACxB;;;;IAKO,YAAY;QAClB,IAAI,CAAC,IAAI,CAAC,UAAU;YAAE,OAAO;QAC7B,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QACxB,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC;QACpB,IAAI,CAAC,uBAAuB,EAAE,CAAC;KAChC;;;;IAMD,MAAM;QACJ,QACEA,QAACC,UAAI,sEAAgB,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,IAC7CD,mEAAM,IAAI,EAAC,MAAM,GAAQ,EACzBA,mEAAM,IAAI,EAAC,QAAQ,GAAQ,CACtB,EACP;KACH;;;;;;;;;;;","names":["h","Host"],"sources":["src/components/nv-split/styles/nv-split.scss?tag=nv-split","src/components/nv-split/nv-split.tsx"],"sourcesContent":["@use './mixins' as *;\n@use './variables' as *;\n\nnv-split {\n display: flex;\n width: 100%;\n height: 100%;\n position: relative;\n\n &[direction='horizontal'] {\n flex-direction: row;\n }\n\n &[direction='vertical'] {\n flex-direction: column;\n }\n\n .nv-split-gutter {\n @include split-gutter-base;\n }\n\n &[direction='horizontal'] > .nv-split-gutter {\n @include split-gutter-horizontal;\n }\n\n &[direction='vertical'] > .nv-split-gutter {\n @include split-gutter-vertical;\n }\n\n &[data-dragging='true'] > .nv-split-gutter::after {\n background: $nv-split-line-active-color;\n }\n\n > [slot='pane'] {\n flex: 1 1 auto;\n overflow: hidden;\n min-width: 0;\n min-height: 0;\n display: flex;\n flex-direction: column;\n }\n\n > [slot='pane'] > nv-split {\n flex: 1 1 auto;\n width: 100%;\n height: 100%;\n }\n}\n","import {\n Component,\n Host,\n h,\n Prop,\n Event,\n EventEmitter,\n Element,\n Method,\n State,\n Watch,\n} from '@stencil/core';\n\n/**\n * The `nv-split` component is an advanced layout container that enables the creation of interactively resizable panels. It provides a flexible solution for dividing available space between multiple interface sections, with precise control over dimensions and constraints for each panel.\n * @slot pane - Content of each split pane. Use multiple `<div slot=\"pane\">` elements.\n * @slot gutter - Optional custom content inside every gutter handle.\n */\n@Component({\n tag: 'nv-split',\n styleUrl: 'styles/nv-split.scss',\n shadow: false,\n})\nexport class NvSplit {\n @Element() el: HTMLNvSplitElement;\n\n /****************************************************************************/\n //#region PROPERTIES\n\n /**\n * Direction of the split layout.\n * - `horizontal`: panes side by side\n * - `vertical`: panes stacked\n */\n @Prop({ reflect: true })\n readonly direction: 'horizontal' | 'vertical' = 'horizontal';\n\n /**\n * Initial sizes of the panes in percentages.\n * Example: `[50, 50]` means two equal panes.\n * Explicitly `reflect: false` (array) for framework compatibility.\n */\n @Prop({ mutable: true, reflect: false })\n sizes: number[] = [];\n\n /**\n * Minimum sizes (in px) for each pane.\n * Example: `[100, 200]` => first pane min 100px, second min 200px.\n * Explicitly `reflect: false` (array) for framework compatibility.\n */\n @Prop({ reflect: false })\n readonly minSizes?: number[];\n\n /**\n * Width or height of the gutter (in px) depending on the split direction.\n * Default is 24px to meet WCAG 2.2 target size requirements for touch accessibility.\n */\n @Prop({ reflect: true })\n readonly gutterSize: number = 24;\n\n //#endregion\n /****************************************************************************/\n //#region STATE\n\n @State()\n private isDragging: boolean = false;\n\n private dragIndex: number = -1;\n private startPos: number = 0;\n private startSizes: number[] = [];\n private ro?: ResizeObserver;\n\n // Handlers stored to be able to detach them\n private onDocMove = (ev: MouseEvent) => this.handleMouseMove(ev);\n private onDocUp = () => this.stopDragging();\n\n //#endregion\n /****************************************************************************/\n //#region EVENTS\n\n /**\n * Emitted when pane sizes are updated (either via dragging or programmatically).\n * @bind sizes\n */\n @Event()\n sizesChanged: EventEmitter<number[]>;\n\n //#endregion\n /****************************************************************************/\n //#region WATCHERS\n\n @Watch('sizes')\n protected onSizesChanged(): void {\n // Re-apply sizes if modified from the outside\n this.applySizes();\n }\n\n @Watch('direction')\n protected onDirectionChanged(): void {\n // Update the orientation and the cursors of the gutters\n this.ensureGutters();\n this.applySizes();\n }\n\n //#endregion\n /****************************************************************************/\n //#region LIFECYCLE\n\n componentDidLoad(): void {\n // Initialization (once)\n this.ensureGutters();\n this.applySizes();\n this.positionGutters();\n\n // Observer: reposition gutters when resized (nested or parent split changes)\n this.ro = new ResizeObserver(() => this.positionGutters());\n this.ro.observe(this.el);\n\n window.addEventListener('resize', () => this.positionGutters());\n }\n\n disconnectedCallback(): void {\n // Security cleanup (in case a drag was in progress)\n this.detachDocumentListeners();\n this.ro?.disconnect();\n this.ro = undefined;\n }\n\n //#endregion\n /****************************************************************************/\n //#region PUBLIC METHODS\n\n /**\n * Programmatically set pane sizes.\n * @param {Array<number>} sizes Array of pane sizes in percentages.\n * @returns {Promise<void>}\n */\n @Method()\n async setSizes(sizes: number[]): Promise<void> {\n this.sizes = [...sizes];\n this.applySizes();\n this.sizesChanged.emit([...this.sizes]);\n this.positionGutters();\n }\n\n /**\n * Returns the current pane sizes.\n * @returns {Promise<number[]>} Array of pane sizes in percentages.\n */\n @Method()\n async getSizes(): Promise<number[]> {\n return [...this.sizes];\n }\n\n /**\n * Collapse a specific pane to 0 size.\n * @param {number} index Index of the pane to collapse.\n * @returns {Promise<void>}\n */\n @Method()\n async collapse(index: number): Promise<void> {\n const panes = this.getPanes();\n if (index < 0 || index >= panes.length) return;\n\n // Simple strategy: 0% for the index, the rest (100%) for its nearest neighbor\n const next = new Array(panes.length).fill(0);\n const target = index < panes.length - 1 ? index + 1 : index - 1;\n if (target >= 0) next[target] = 100;\n\n this.sizes = next;\n this.applySizes();\n this.sizesChanged.emit([...this.sizes]);\n this.positionGutters();\n }\n\n /**\n * Destroy the split instance: removes gutters and resets layout state.\n * @returns {Promise<void>}\n */\n @Method()\n async destroy(): Promise<void> {\n this.sizes = [];\n this.isDragging = false;\n this.dragIndex = -1;\n this.removeOwnGutters();\n this.detachDocumentListeners();\n this.ro?.disconnect();\n }\n\n //#endregion\n /****************************************************************************/\n //#region INTERNAL HELPERS\n\n /**\n * Returns the panes of the split.\n * @returns {HTMLElement[]} The panes of the split.\n */\n private getPanes(): HTMLElement[] {\n // Only the direct children slot=\"pane\"\n return Array.from(\n this.el.querySelectorAll<HTMLElement>(':scope > [slot=\"pane\"]'),\n );\n }\n\n /**\n * Returns the own gutters of the split.\n * @returns {HTMLElement[]} The own gutters of the split.\n */\n private getOwnGutters(): HTMLElement[] {\n // Only the direct gutters of THIS instance\n return Array.from(\n this.el.querySelectorAll<HTMLElement>(\n ':scope > .nv-split-gutter[data-auto=\"true\"]',\n ),\n );\n }\n\n /**\n * Removes the own gutters of the split.\n */\n private removeOwnGutters(): void {\n this.getOwnGutters().forEach(g => g.remove());\n }\n\n /**\n * Ensures the gutters of the split.\n */\n private ensureGutters(): void {\n const panes = this.getPanes();\n\n // 1) Clean ONLY the old direct gutters of THIS instance\n this.removeOwnGutters();\n\n if (panes.length <= 1) return;\n\n // 2) Add the gutters (directs) between the panes\n panes.forEach((pane, i) => {\n if (i >= panes.length - 1) return;\n\n const g = document.createElement('div');\n g.className = 'nv-split-gutter';\n g.setAttribute('data-auto', 'true');\n\n if (this.direction === 'horizontal') {\n g.style.width = `${this.gutterSize}px`;\n g.style.cursor = 'col-resize';\n } else {\n g.style.height = `${this.gutterSize}px`;\n g.style.cursor = 'row-resize';\n }\n\n // Customizable internal slot\n const slotEl = document.createElement('slot');\n slotEl.name = 'gutter';\n g.appendChild(slotEl);\n\n // Listener drag (index = gutter between pane i and i+1)\n g.addEventListener('mousedown', (ev: MouseEvent) =>\n this.startDragging(ev, i),\n );\n\n // Insert just after the pane\n pane.insertAdjacentElement('afterend', g);\n });\n\n this.positionGutters();\n }\n\n /**\n * Applies the sizes to the panes.\n */\n private applySizes(): void {\n const panes = this.getPanes();\n const n = panes.length;\n if (n === 0) return;\n\n // Default values if inconsistent\n if (!this.sizes || this.sizes.length !== n) {\n this.sizes = Array(n).fill(100 / n);\n }\n\n panes.forEach((pane, i) => {\n const size = Math.max(0, this.sizes[i] ?? 100 / n);\n // Flex-basis via flex shorthand (https://developer.mozilla.org/en-US/docs/Web/CSS/flex)\n pane.style.flex = `0 0 ${size}%`;\n pane.style.minWidth = '0';\n pane.style.minHeight = '0';\n pane.style.overflow = 'hidden'; // let a nv-split child extend\n pane.style.display = 'flex';\n pane.style.flexDirection = 'column';\n });\n\n this.positionGutters();\n }\n\n /**\n * Attaches the document listeners.\n */\n private attachDocumentListeners(): void {\n document.addEventListener('mousemove', this.onDocMove);\n document.addEventListener('mouseup', this.onDocUp);\n }\n\n /**\n * Detaches the document listeners.\n */\n private detachDocumentListeners(): void {\n document.removeEventListener('mousemove', this.onDocMove);\n document.removeEventListener('mouseup', this.onDocUp);\n }\n\n /**\n * Positions the gutters based on the current sizes of the panes.\n */\n private positionGutters(): void {\n const panes = this.getPanes();\n const gutters = this.getOwnGutters();\n if (panes.length <= 1 || gutters.length === 0) return;\n\n const horizontal = this.direction === 'horizontal';\n let cumPct = 0;\n\n for (let i = 0; i < gutters.length; i++) {\n const sizePct = this.sizes?.[i] ?? 100 / panes.length;\n cumPct += sizePct;\n\n const g = gutters[i];\n g.style.position = 'absolute';\n\n if (horizontal) {\n g.style.left = `${cumPct}%`;\n g.style.top = '0';\n g.style.bottom = '0';\n g.style.height = '100%';\n } else {\n g.style.top = `${cumPct}%`;\n g.style.left = '0';\n g.style.right = '0';\n g.style.width = '100%';\n }\n }\n }\n\n /**\n * Starts the dragging process.\n * @param {MouseEvent} ev - The mouse event.\n * @param {number} index - The index of the gutter.\n */\n private startDragging(ev: MouseEvent, index: number): void {\n this.isDragging = true;\n this.dragIndex = index;\n this.startPos = this.direction === 'horizontal' ? ev.clientX : ev.clientY;\n this.startSizes = [...this.sizes];\n this.attachDocumentListeners();\n }\n\n /**\n * Handles the mouse movement during dragging.\n * @param {MouseEvent} ev - The mouse event.\n */\n private handleMouseMove(ev: MouseEvent): void {\n if (!this.isDragging || this.dragIndex < 0) return;\n\n const panes = this.getPanes();\n if (panes.length < 2) return;\n\n const rect = this.el.getBoundingClientRect();\n\n // Ensure we never divide by zero if the element has zero width/height\n const rawSize = this.direction === 'horizontal' ? rect.width : rect.height;\n const totalPx = Math.max(rawSize, 1);\n\n const deltaPx =\n (this.direction === 'horizontal' ? ev.clientX : ev.clientY) -\n this.startPos;\n const deltaPct = (deltaPx / totalPx) * 100;\n\n const i = this.dragIndex;\n const j = i + 1;\n\n let left = this.startSizes[i] + deltaPct;\n let right = this.startSizes[j] - deltaPct;\n\n // minSizes (px) -> %\n const minLeftPct = ((this.minSizes?.[i] ?? 0) / totalPx) * 100;\n const minRightPct = ((this.minSizes?.[j] ?? 0) / totalPx) * 100;\n\n left = Math.max(left, minLeftPct);\n right = Math.max(right, minRightPct);\n\n // Keep the sum of the pair i/j constant\n const pairSum = left + right;\n const targetSum = this.startSizes[i] + this.startSizes[j];\n if (Math.abs(pairSum - targetSum) > 0.0001) {\n const k = targetSum / (pairSum || 1);\n left *= k;\n right *= k;\n }\n\n const next = [...this.startSizes];\n next[i] = left;\n next[j] = right;\n\n this.sizes = next;\n this.applySizes();\n this.sizesChanged.emit([...this.sizes]);\n this.positionGutters();\n }\n\n /**\n * Stops the dragging process.\n */\n private stopDragging(): void {\n if (!this.isDragging) return;\n this.isDragging = false;\n this.dragIndex = -1;\n this.detachDocumentListeners();\n }\n\n //#endregion\n /****************************************************************************/\n //#region RENDER\n\n render() {\n return (\n <Host data-dragging={this.isDragging.toString()}>\n <slot name=\"pane\"></slot>\n <slot name=\"gutter\"></slot>\n </Host>\n );\n }\n\n //#endregion\n /****************************************************************************/\n}\n"],"version":3}
|
|
@@ -23,7 +23,7 @@ const NvStack = class {
|
|
|
23
23
|
/****************************************************************************/
|
|
24
24
|
//#region RENDER
|
|
25
25
|
render() {
|
|
26
|
-
return (index.h(index.Host, { key: '
|
|
26
|
+
return (index.h(index.Host, { key: '5922efd8652a14d73e812e85dd6770101e22fe46', class: clsx.clsx(this.fill && 'nv-stack-fill', this.flex && 'nv-stack-flex', this.full && 'w-full', this.gutter && !this.vertical && `gap-x-${this.gutter}`, this.gutter && this.vertical && `gap-y-${this.gutter}`, this.vertical && 'nv-stack-vertical') }, index.h("slot", { key: '71daf4ee34bd57d785203f98799b6ea7c66ffa3b' })));
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
29
|
NvStack.style = NvStackStyle0;
|
|
@@ -236,7 +236,7 @@ const NvTable = class {
|
|
|
236
236
|
/****************************************************************************/
|
|
237
237
|
//#region RENDER
|
|
238
238
|
render() {
|
|
239
|
-
return (index.h(index.Host, { key: '
|
|
239
|
+
return (index.h(index.Host, { key: '16b564cc29e8987d8b3fda3a84c0b19882a733bd' }, index.h("slot", { key: '1305cbc6d29caa60df55bfa01a39a3417a27ec01' })));
|
|
240
240
|
}
|
|
241
241
|
get host() { return index.getElement(this); }
|
|
242
242
|
};
|
|
@@ -66,8 +66,8 @@ const NvToggle = class {
|
|
|
66
66
|
/****************************************************************************/
|
|
67
67
|
//#region RENDER
|
|
68
68
|
render() {
|
|
69
|
-
return (index.h(index.Host, { key: '
|
|
70
|
-
this.el.querySelector('[slot="description"]')) && (index.h("div", { key: '
|
|
69
|
+
return (index.h(index.Host, { key: '0f440b59ac0c32d9abe9577668d7045081819b49', class: clsx.clsx(this.labelPlacement === 'before' && 'label-placement-before') }, index.h("div", { key: '4289435e34eb31a8e59e00cefcba2e17e98bd03a', class: "input-container" }, index.h("input", { key: '1b7d05f77fd32cece9eed2e6cf79c7e2e707f64c', type: "checkbox", id: this.inputId, name: this.name, autocomplete: "off", value: this.value, checked: Boolean(this.checked), disabled: this.disabled || this.readonly, readonly: this.readonly })), index.h("div", { key: '6d78d7e80eb790bbead21bba6108329f9ded3746', class: "text-container" }, (this.label || this.el.querySelector('[slot="label"]')) && (index.h("label", { key: '524a2c2542a45945bddb688c5dff6c9426d58570', htmlFor: this.inputId, class: clsx.clsx(this.hideLabel && 'visually-hidden') }, index.h("slot", { key: '59eda4b826602062620e7167acf3c8de0f77ebef', name: "label" }, this.label))), (this.description ||
|
|
70
|
+
this.el.querySelector('[slot="description"]')) && (index.h("div", { key: '6e8412879ed60fc6806464432348bd52483e3567', class: "description" }, index.h("slot", { key: '85a876130569a5a4051e271eaf1cf49593a014a6', name: "description" }, this.description))))));
|
|
71
71
|
}
|
|
72
72
|
static get formAssociated() { return true; }
|
|
73
73
|
get el() { return index.getElement(this); }
|
|
@@ -48,7 +48,7 @@ const NvTogglebutton = class {
|
|
|
48
48
|
/****************************************************************************/
|
|
49
49
|
//#region RENDER
|
|
50
50
|
render() {
|
|
51
|
-
return (index.h(index.Host, { key: '
|
|
51
|
+
return (index.h(index.Host, { key: 'b9e37fc1cb34272bca476c7b61db173ab2a9d238', role: "button", tabindex: "0", "aria-pressed": String(this.active), onClick: this.handleClick }, index.h("slot", { key: 'cf9cf3445fd93873def1f9fa9cbec46c35600025' })));
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
54
|
NvTogglebutton.style = NvTogglebuttonStyle0;
|
|
@@ -156,7 +156,7 @@ const NvTogglebuttongroup = class {
|
|
|
156
156
|
/****************************************************************************/
|
|
157
157
|
//#region RENDER
|
|
158
158
|
render() {
|
|
159
|
-
return (index.h(index.Host, { key: '
|
|
159
|
+
return (index.h(index.Host, { key: '7aad0160ae8e093765ba42649293e27d7b93ab75' }, index.h("slot", { key: '39364122a5e65b1a454bd782a5daacc7edfee8b0' })));
|
|
160
160
|
}
|
|
161
161
|
get el() { return index.getElement(this); }
|
|
162
162
|
static get watchers() { return {
|
|
@@ -46,7 +46,7 @@ const NvTooltip = class {
|
|
|
46
46
|
/****************************************************************************/
|
|
47
47
|
//#region RENDER
|
|
48
48
|
render() {
|
|
49
|
-
return (index.h(index.Host, { key: '
|
|
49
|
+
return (index.h(index.Host, { key: '5d5facbf2a0487bda4fbae49913a2cb4f69dcf5a' }, index.h("slot", { key: '91080d347f3473879109f7b0b59b159f5bb5979b' }), index.h("nv-popover", { key: '876e5e2487d1b2b5182e42909a6edeab5b3e9db2', triggerMode: "hover", hasArrow: true, placement: this.placement, strategy: this.strategy, triggerElement: this.triggerElement, groupName: 'tooltip', enterDelay: this.enterDelay }, index.h("p", { key: 'e30ce16ed27e41dee7359fb44ccba7a780e72d37', slot: "content" }, this.message), index.h("slot", { key: '395c75d7f45bab9aaebf979bd75087058b979350', name: "content" }))));
|
|
50
50
|
}
|
|
51
51
|
get el() { return index.getElement(this); }
|
|
52
52
|
};
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"components/nv-notificationcontainer/nv-notificationcontainer.js",
|
|
41
41
|
"components/nv-popover/nv-popover.js",
|
|
42
42
|
"components/nv-row/nv-row.js",
|
|
43
|
+
"components/nv-split/nv-split.js",
|
|
43
44
|
"components/nv-stack/nv-stack.js",
|
|
44
45
|
"components/nv-table/nv-table.js",
|
|
45
46
|
"components/nv-toggle/nv-toggle.js",
|
|
@@ -107,12 +107,6 @@ export class NvButton {
|
|
|
107
107
|
this.el.click();
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
-
handleTouchStart(event) {
|
|
111
|
-
if (event.touches.length > 1)
|
|
112
|
-
return;
|
|
113
|
-
event.preventDefault();
|
|
114
|
-
this.el.click();
|
|
115
|
-
}
|
|
116
110
|
//#endregion EVENTS
|
|
117
111
|
/****************************************************************************/
|
|
118
112
|
//#region WATCHERS
|
|
@@ -140,7 +134,7 @@ export class NvButton {
|
|
|
140
134
|
/****************************************************************************/
|
|
141
135
|
//#region RENDER
|
|
142
136
|
render() {
|
|
143
|
-
return (h(Host, { key: '
|
|
137
|
+
return (h(Host, { key: '42488f71ad33233c839cd70b3ea57aee50b143b3', role: "button", tabindex: "0", onClick: this.handleButtonClick }, this.loading && (h("nv-loader", { key: 'a30c71eebb8f0476bcca5acbc8e7ac7f6377740c', size: this.size === ButtonSize.Large ? 'sm' : 'xs' })), h("slot", { key: '4bbcee81ef7236ae35471c649971c122e4b468f3', name: "leading-icon" }), h("slot", { key: '82203f6aed911e61aef2438bba3b3e664ffb9f76' }), h("slot", { key: 'c97a5ce78c15556b8c1a91a4d06eb6bc9a9cd255', name: "trailing-icon" })));
|
|
144
138
|
}
|
|
145
139
|
static get is() { return "nv-button"; }
|
|
146
140
|
static get formAssociated() { return true; }
|
|
@@ -372,12 +366,6 @@ export class NvButton {
|
|
|
372
366
|
"target": undefined,
|
|
373
367
|
"capture": false,
|
|
374
368
|
"passive": false
|
|
375
|
-
}, {
|
|
376
|
-
"name": "touchstart",
|
|
377
|
-
"method": "handleTouchStart",
|
|
378
|
-
"target": undefined,
|
|
379
|
-
"capture": false,
|
|
380
|
-
"passive": false
|
|
381
369
|
}];
|
|
382
370
|
}
|
|
383
371
|
static get attachInternalsMemberName() { return "internals"; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nv-button.js","sourceRoot":"","sources":["../../../src/components/nv-button/nv-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,MAAM,EACN,IAAI,EACJ,CAAC,EACD,IAAI,EACJ,eAAe,EACf,OAAO,EACP,KAAK,GACN,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,UAAU,EAAkB,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAE/E;;;;GAIG;AAOH,MAAM,OAAO,QAAQ;IANrB;QAUE,8EAA8E;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I,GACvC,CACd;YAED,6DAAM,IAAI,EAAC,cAAc,GAAQ;YACjC,8DAAa;YACb,6DAAM,IAAI,EAAC,eAAe,GAAQ,CAC7B,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGF","sourcesContent":["import {\n Component,\n Listen,\n Host,\n h,\n Prop,\n AttachInternals,\n Element,\n Watch,\n} from '@stencil/core';\n\nimport { ButtonSize, ButtonEmphasis, ButtonType } from '../../utils/constants';\n\n/**\n * @slot default - Content of the button.\n * @slot leading-icon - Icon before the label.\n * @slot trailing-icon - Icon after the label.\n */\n@Component({\n tag: 'nv-button',\n shadow: false,\n formAssociated: true,\n styleUrl: 'styles/nv-button.scss',\n})\nexport class NvButton {\n @AttachInternals() internals: ElementInternals;\n @Element() el: HTMLNvButtonElement;\n\n /****************************************************************************/\n //#region PROPERTIES\n\n /**\n * Determines how large or small the button appears, allowing for\n * customization of the button's dimensions to fit different design\n * specifications and user needs.\n */\n @Prop({ reflect: true })\n readonly size: `${ButtonSize}` = 'md';\n\n /**\n * Adjusts the button's emphasis to make it more or less visually prominent\n * to users. Use this to draw attention to important actions or reduce focus\n * on less critical ones\n */\n @Prop({ reflect: true })\n readonly emphasis: `${ButtonEmphasis}` = 'high';\n\n /**\n * Use this prop to highlight the button when it represents the current page\n * or active selection. This helps users understand their navigation context.\n */\n @Prop({ reflect: true })\n readonly active: boolean = false;\n\n /**\n * Applies styling that visually indicates the button represents a dangerous\n * action.\n */\n @Prop({ reflect: true })\n readonly danger: boolean = false;\n\n /**\n * Set this to true to show a spinner on the button, letting users know that\n * their action is being processed. It helps improve user experience by\n * indicating ongoing activities.\n */\n @Prop({ reflect: true, mutable: true })\n loading: boolean = false;\n\n /**\n * Disables the button, preventing user interaction.\n */\n @Prop({ reflect: true, mutable: true })\n disabled: boolean = false;\n\n /**\n * Allows the button to stretch and fill the entire width of its container.\n */\n @Prop({ reflect: true })\n readonly fluid: boolean = false;\n\n /**\n * Sets the button type to control its function in forms. Use 'submit' to send\n * form data, 'reset' to clear the form, or 'button' for a standard button\n * that doesn't interact with form submission by default.\n */\n @Prop({ reflect: true })\n readonly type: `${ButtonType}` = 'button';\n\n /**\n * Sets the form associated with the button in case the (submit) button is not a child of a form.\n * Matches the native HTML button 'form' attribute behavior.\n */\n @Prop({ reflect: true })\n readonly form: string;\n\n //#endregion PROPERTIES\n /****************************************************************************/\n //#region METHODS\n\n /**\n * Handles button click events, managing form actions and disabled states.\n * Prevents default behavior when button is disabled or loading, and\n * processes form submissions/resets when appropriate.\n * @param {Event} event - The click event.\n */\n private handleButtonClick = (event: Event): void => {\n if (this.loading || this.disabled) {\n event.preventDefault();\n return;\n }\n\n if (\n this.type !== ButtonType.Button &&\n (this.form || this.internals?.form)\n ) {\n this.processFormAction();\n } else if (this.form && this.type === ButtonType.Button) {\n console.warn(\n 'Button has a form id but is not of type submit or reset so no form action will be processed.',\n `Button:`,\n this.el,\n );\n }\n };\n\n /**\n * Processes form-related actions by finding the associated form element\n * and triggering the appropriate action (submit/reset) based on button type.\n * Falls back to ElementInternals form if no explicit form ID is provided.\n */\n private processFormAction = (): void => {\n const formElement = this.form\n ? (document.getElementById(this.form) as HTMLFormElement)\n : this.internals?.form;\n\n if (!formElement) {\n console.warn(\n 'No form element found.',\n `Form ID: ${this.form || 'Not provided'}`,\n `Internals form:`,\n this.internals?.form,\n );\n return;\n }\n\n switch (this.type) {\n case ButtonType.Submit:\n formElement.requestSubmit();\n break;\n case ButtonType.Reset:\n formElement.reset();\n break;\n }\n };\n\n //#endregion METHODS\n /****************************************************************************/\n //#region EVENTS\n\n @Listen('keydown', { passive: false })\n handleKeyDown(event: KeyboardEvent) {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n this.el.click();\n }\n }\n\n //#endregion EVENTS\n /****************************************************************************/\n //#region WATCHERS\n\n @Watch('loading')\n handleLoadingChange(loading: boolean) {\n this.loading = loading;\n this.disabled = loading;\n }\n\n @Watch('disabled')\n handleDisabledChange(disabled: boolean) {\n if (this.loading) {\n this.disabled = this.loading;\n } else {\n this.disabled = disabled;\n }\n }\n\n //#endregion WATCHERS\n /****************************************************************************/\n //#region LIFECYCLE\n\n componentWillLoad() {\n if (this.loading) {\n this.disabled = this.loading;\n }\n }\n\n //#endregion LIFECYCLE\n /****************************************************************************/\n //#region RENDER\n\n render() {\n return (\n <Host role=\"button\" tabindex=\"0\" onClick={this.handleButtonClick}>\n {this.loading && (\n <nv-loader\n size={this.size === ButtonSize.Large ? 'sm' : 'xs'}\n ></nv-loader>\n )}\n\n <slot name=\"leading-icon\"></slot>\n <slot></slot>\n <slot name=\"trailing-icon\"></slot>\n </Host>\n );\n }\n\n //#endregion RENDER\n}\n"]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
import { nameof } from "../../utils/class.utils";
|
|
3
|
+
const NvSplitDocs = {
|
|
4
|
+
component: 'nv-split',
|
|
5
|
+
subcomponents: ['nv-alert'],
|
|
6
|
+
badge: 'beta',
|
|
7
|
+
stories: [
|
|
8
|
+
{
|
|
9
|
+
name: 'Default',
|
|
10
|
+
args: {
|
|
11
|
+
direction: 'horizontal',
|
|
12
|
+
sizes: [50, 50],
|
|
13
|
+
},
|
|
14
|
+
template: (h("nv-split", { class: "h-96 w-full", "data-storybook-args": true }, h("div", { slot: "pane", class: "bg-turquoise-500" }, "Left pane"), h("div", { slot: "pane", class: "bg-orange-500" }, "Right pane"))),
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: nameof(x => x.direction),
|
|
18
|
+
args: { direction: 'vertical', sizes: [70, 30] },
|
|
19
|
+
template: (h("nv-split", { class: "h-screen w-full", "data-storybook-args": true }, h("div", { slot: "pane" }, "Top pane"), h("div", { slot: "pane" }, "Bottom pane"))),
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: nameof(x => x.gutterSize),
|
|
23
|
+
args: { gutterSize: 8, sizes: [50, 50] },
|
|
24
|
+
template: (h("nv-split", { class: "h-screen w-full", "data-storybook-args": true }, h("div", { slot: "pane" }, "Pane A"), h("div", { slot: "pane" }, "Pane B"))),
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'complex',
|
|
28
|
+
description: 'Note: Only the parent nv-split responds to Storybook controls. Nested nv-split components have hardcoded values.',
|
|
29
|
+
args: { gutterSize: 8, sizes: [50, 50], direction: 'vertical' },
|
|
30
|
+
template: (h("div", { class: "flex flex-col gap-4 h-screen w-full" }, h("nv-alert", { feedback: "warning", class: "m-4" }, "Only the parent nv-split responds to Storybook controls. The nested nv-split has hardcoded values."), h("nv-split", { class: "flex-1", "data-storybook-args": true }, h("div", { slot: "pane", class: "bg-turquoise-500" }, "Top"), h("div", { slot: "pane", class: "bg-orange-500" }, h("nv-split", { direction: "horizontal", sizes: [20, 80] }, h("div", { slot: "pane", class: "bg-red-500" }, "Left"), h("div", { slot: "pane", class: "bg-yellow-500" }, "center"), h("div", { slot: "pane", class: "bg-green-500" }, "Right")))))),
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'NestedSplit',
|
|
34
|
+
description: 'Note: Only the root nv-split responds to Storybook controls. All nested nv-split components have hardcoded values.',
|
|
35
|
+
args: { gutterSize: 8, sizes: [10, 90], direction: 'horizontal' },
|
|
36
|
+
template: (h("div", { class: "flex flex-col gap-4 h-screen w-full" }, h("nv-alert", { feedback: "warning", class: "m-4" }, "Only the root nv-split responds to Storybook controls. All nested nv-split components have hardcoded values."), h("nv-split", { class: "flex-1", "data-storybook-args": true }, h("div", { slot: "pane", class: "bg-purple-300" }, "Sidebar"), h("div", { slot: "pane", class: "bg-gray-200" }, h("nv-split", { direction: "vertical", sizes: [10, 90], class: "h-full w-full" }, h("div", { slot: "pane", class: "bg-pink-300" }, "Top Content"), h("div", { slot: "pane", class: "bg-cyan-300" }, h("nv-split", { direction: "horizontal", sizes: [10, 90], class: "h-full w-full" }, h("div", { slot: "pane", class: "bg-lime-300" }, "Bottom Left"), h("div", { slot: "pane", class: "bg-orange-300" }, "Bottom Right")))))))),
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
};
|
|
40
|
+
export default NvSplitDocs;
|
|
41
|
+
//# sourceMappingURL=nv-split.docs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nv-split.docs.js","sourceRoot":"","sources":["../../../src/components/nv-split/nv-split.docs.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAGlC,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEjD,MAAM,WAAW,GAAiC;IAChD,SAAS,EAAE,UAAU;IACrB,aAAa,EAAE,CAAC,UAAU,CAAC;IAC3B,KAAK,EAAE,MAAM;IACb,OAAO,EAAE;QACP;YACE,IAAI,EAAE,SAAS;YACf,IAAI,EAAE;gBACJ,SAAS,EAAE,YAAY;gBACvB,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;aAChB;YACD,QAAQ,EAAE,CACR,gBAAU,KAAK,EAAC,aAAa;gBAC3B,WAAK,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,kBAAkB,gBAEnC;gBACN,WAAK,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,eAAe,iBAEhC,CACG,CACZ;SACF;QACD;YACE,IAAI,EAAE,MAAM,CAAqB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;YAClD,IAAI,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,C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IAAI,EAAE,aAAa;YACnB,WAAW,EACT,oHAAoH;YACtH,IAAI,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE;YACjE,QAAQ,EAAE,CACR,WAAK,KAAK,EAAC,qCAAqC;gBAC9C,gBAAU,QAAQ,EAAC,SAAS,EAAC,KAAK,EAAC,KAAK,mHAG7B;gBACX,gBAAU,KAAK,EAAC,QAAQ;oBACtB,WAAK,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,eAAe,cAEhC;oBACN,WAAK,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,aAAa;wBAClC,gBACE,SAAS,EAAC,UAAU,EACpB,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EACf,KAAK,EAAC,eAAe;4BAErB,WAAK,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,aAAa,kBAE9B;4BACN,WAAK,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,aAAa;gCAClC,gBACE,SAAS,EAAC,YAAY,EACtB,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EACf,KAAK,EAAC,eAAe;oCAErB,WAAK,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,aAAa,kBAE9B;oCACN,WAAK,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,eAAe,mBAEhC,CACG,CACP,CACG,CACP,CACG,CACP,CACP;SACF;KACF;CACF,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import { h } from '@stencil/core';\nimport type { NovaDocs } from '../../nova-docs';\nimport { Components } from '../../components';\nimport { nameof } from '../../utils/class.utils';\n\nconst NvSplitDocs: NovaDocs<Components.NvSplit> = {\n component: 'nv-split',\n subcomponents: ['nv-alert'],\n badge: 'beta',\n stories: [\n {\n name: 'Default',\n args: {\n direction: 'horizontal',\n sizes: [50, 50],\n },\n template: (\n <nv-split class=\"h-96 w-full\" data-storybook-args>\n <div slot=\"pane\" class=\"bg-turquoise-500\">\n Left pane\n </div>\n <div slot=\"pane\" class=\"bg-orange-500\">\n Right pane\n </div>\n </nv-split>\n ),\n },\n {\n name: nameof<Components.NvSplit>(x => x.direction),\n args: { direction: 'vertical', sizes: [70, 30] },\n template: (\n <nv-split class=\"h-screen w-full\" data-storybook-args>\n <div slot=\"pane\">Top pane</div>\n <div slot=\"pane\">Bottom pane</div>\n </nv-split>\n ),\n },\n {\n name: nameof<Components.NvSplit>(x => x.gutterSize),\n args: { gutterSize: 8, sizes: [50, 50] },\n template: (\n <nv-split class=\"h-screen w-full\" data-storybook-args>\n <div slot=\"pane\">Pane A</div>\n <div slot=\"pane\">Pane B</div>\n </nv-split>\n ),\n },\n {\n name: 'complex',\n description:\n 'Note: Only the parent nv-split responds to Storybook controls. Nested nv-split components have hardcoded values.',\n args: { gutterSize: 8, sizes: [50, 50], direction: 'vertical' },\n template: (\n <div class=\"flex flex-col gap-4 h-screen w-full\">\n <nv-alert feedback=\"warning\" class=\"m-4\">\n Only the parent nv-split responds to Storybook controls. The nested\n nv-split has hardcoded values.\n </nv-alert>\n <nv-split class=\"flex-1\" data-storybook-args>\n <div slot=\"pane\" class=\"bg-turquoise-500\">\n Top\n </div>\n <div slot=\"pane\" class=\"bg-orange-500\">\n <nv-split direction=\"horizontal\" sizes={[20, 80]}>\n <div slot=\"pane\" class=\"bg-red-500\">\n Left\n </div>\n <div slot=\"pane\" class=\"bg-yellow-500\">\n center\n </div>\n <div slot=\"pane\" class=\"bg-green-500\">\n Right\n </div>\n </nv-split>\n </div>\n </nv-split>\n </div>\n ),\n },\n {\n name: 'NestedSplit',\n description:\n 'Note: Only the root nv-split responds to Storybook controls. All nested nv-split components have hardcoded values.',\n args: { gutterSize: 8, sizes: [10, 90], direction: 'horizontal' },\n template: (\n <div class=\"flex flex-col gap-4 h-screen w-full\">\n <nv-alert feedback=\"warning\" class=\"m-4\">\n Only the root nv-split responds to Storybook controls. All nested\n nv-split components have hardcoded values.\n </nv-alert>\n <nv-split class=\"flex-1\" data-storybook-args>\n <div slot=\"pane\" class=\"bg-purple-300\">\n Sidebar\n </div>\n <div slot=\"pane\" class=\"bg-gray-200\">\n <nv-split\n direction=\"vertical\"\n sizes={[10, 90]}\n class=\"h-full w-full\"\n >\n <div slot=\"pane\" class=\"bg-pink-300\">\n Top Content\n </div>\n <div slot=\"pane\" class=\"bg-cyan-300\">\n <nv-split\n direction=\"horizontal\"\n sizes={[10, 90]}\n class=\"h-full w-full\"\n >\n <div slot=\"pane\" class=\"bg-lime-300\">\n Bottom Left\n </div>\n <div slot=\"pane\" class=\"bg-orange-300\">\n Bottom Right\n </div>\n </nv-split>\n </div>\n </nv-split>\n </div>\n </nv-split>\n </div>\n ),\n },\n ],\n};\n\nexport default NvSplitDocs;\n"]}
|