@vscode-elements/elements 1.7.1 → 1.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/custom-elements.json +390 -86
  2. package/dist/bundled.js +118 -83
  3. package/dist/includes/VscElement.js +1 -1
  4. package/dist/includes/VscElement.js.map +1 -1
  5. package/dist/includes/form-button-widget/FormButtonWidgetBase.d.ts.map +1 -1
  6. package/dist/includes/form-button-widget/FormButtonWidgetBase.js.map +1 -1
  7. package/dist/includes/form-button-widget/LabelledCheckboxOrRadio.d.ts +1 -1
  8. package/dist/includes/form-button-widget/LabelledCheckboxOrRadio.d.ts.map +1 -1
  9. package/dist/includes/form-button-widget/LabelledCheckboxOrRadio.js.map +1 -1
  10. package/dist/includes/test-helpers.d.ts +32 -0
  11. package/dist/includes/test-helpers.d.ts.map +1 -0
  12. package/dist/includes/test-helpers.js +76 -0
  13. package/dist/includes/test-helpers.js.map +1 -0
  14. package/dist/includes/vscode-select/styles.d.ts.map +1 -1
  15. package/dist/includes/vscode-select/styles.js +12 -14
  16. package/dist/includes/vscode-select/styles.js.map +1 -1
  17. package/dist/includes/vscode-select/vscode-select-base.d.ts +2 -2
  18. package/dist/includes/vscode-select/vscode-select-base.d.ts.map +1 -1
  19. package/dist/includes/vscode-select/vscode-select-base.js +4 -4
  20. package/dist/includes/vscode-select/vscode-select-base.js.map +1 -1
  21. package/dist/vscode-button/vscode-button.styles.d.ts.map +1 -1
  22. package/dist/vscode-button/vscode-button.styles.js +8 -2
  23. package/dist/vscode-button/vscode-button.styles.js.map +1 -1
  24. package/dist/vscode-checkbox/vscode-checkbox.styles.js +1 -1
  25. package/dist/vscode-checkbox/vscode-checkbox.styles.js.map +1 -1
  26. package/dist/vscode-collapsible/vscode-collapsible.styles.js +1 -1
  27. package/dist/vscode-collapsible/vscode-collapsible.styles.js.map +1 -1
  28. package/dist/vscode-context-menu/vscode-context-menu.d.ts +1 -1
  29. package/dist/vscode-context-menu/vscode-context-menu.d.ts.map +1 -1
  30. package/dist/vscode-context-menu/vscode-context-menu.js +1 -1
  31. package/dist/vscode-context-menu/vscode-context-menu.js.map +1 -1
  32. package/dist/vscode-context-menu-item/vscode-context-menu-item.styles.d.ts.map +1 -1
  33. package/dist/vscode-context-menu-item/vscode-context-menu-item.styles.js +4 -1
  34. package/dist/vscode-context-menu-item/vscode-context-menu-item.styles.js.map +1 -1
  35. package/dist/vscode-divider/vscode-divider.d.ts +1 -1
  36. package/dist/vscode-divider/vscode-divider.d.ts.map +1 -1
  37. package/dist/vscode-divider/vscode-divider.js +2 -2
  38. package/dist/vscode-divider/vscode-divider.js.map +1 -1
  39. package/dist/vscode-multi-select/vscode-multi-select.js +1 -1
  40. package/dist/vscode-multi-select/vscode-multi-select.js.map +1 -1
  41. package/dist/vscode-progress-ring/vscode-progress-ring.d.ts +1 -1
  42. package/dist/vscode-progress-ring/vscode-progress-ring.d.ts.map +1 -1
  43. package/dist/vscode-progress-ring/vscode-progress-ring.js +2 -2
  44. package/dist/vscode-progress-ring/vscode-progress-ring.js.map +1 -1
  45. package/dist/vscode-radio-group/vscode-radio-group.d.ts.map +1 -1
  46. package/dist/vscode-radio-group/vscode-radio-group.js.map +1 -1
  47. package/dist/vscode-scrollable/vscode-scrollable.d.ts.map +1 -1
  48. package/dist/vscode-scrollable/vscode-scrollable.js.map +1 -1
  49. package/dist/vscode-single-select/vscode-single-select.d.ts +0 -1
  50. package/dist/vscode-single-select/vscode-single-select.d.ts.map +1 -1
  51. package/dist/vscode-single-select/vscode-single-select.js +1 -5
  52. package/dist/vscode-single-select/vscode-single-select.js.map +1 -1
  53. package/dist/vscode-single-select/vscode-single-select.styles.d.ts.map +1 -1
  54. package/dist/vscode-single-select/vscode-single-select.styles.js.map +1 -1
  55. package/dist/vscode-split-layout/vscode-split-layout.d.ts +65 -12
  56. package/dist/vscode-split-layout/vscode-split-layout.d.ts.map +1 -1
  57. package/dist/vscode-split-layout/vscode-split-layout.js +244 -110
  58. package/dist/vscode-split-layout/vscode-split-layout.js.map +1 -1
  59. package/dist/vscode-split-layout/vscode-split-layout.styles.d.ts.map +1 -1
  60. package/dist/vscode-split-layout/vscode-split-layout.styles.js +29 -11
  61. package/dist/vscode-split-layout/vscode-split-layout.styles.js.map +1 -1
  62. package/dist/vscode-tab-header/vscode-tab-header.styles.js +1 -1
  63. package/dist/vscode-tab-header/vscode-tab-header.styles.js.map +1 -1
  64. package/dist/vscode-table/vscode-table.d.ts +1 -1
  65. package/dist/vscode-table/vscode-table.d.ts.map +1 -1
  66. package/dist/vscode-table/vscode-table.js +1 -1
  67. package/dist/vscode-table/vscode-table.js.map +1 -1
  68. package/dist/vscode-table-body/vscode-table-body.styles.d.ts.map +1 -1
  69. package/dist/vscode-table-body/vscode-table-body.styles.js +1 -2
  70. package/dist/vscode-table-body/vscode-table-body.styles.js.map +1 -1
  71. package/dist/vscode-textarea/vscode-textarea.styles.d.ts.map +1 -1
  72. package/dist/vscode-textarea/vscode-textarea.styles.js +4 -1
  73. package/dist/vscode-textarea/vscode-textarea.styles.js.map +1 -1
  74. package/dist/vscode-textfield/vscode-textfield.d.ts +15 -0
  75. package/dist/vscode-textfield/vscode-textfield.d.ts.map +1 -1
  76. package/dist/vscode-textfield/vscode-textfield.js +15 -0
  77. package/dist/vscode-textfield/vscode-textfield.js.map +1 -1
  78. package/dist/vscode-textfield/vscode-textfield.styles.d.ts.map +1 -1
  79. package/dist/vscode-textfield/vscode-textfield.styles.js +5 -2
  80. package/dist/vscode-textfield/vscode-textfield.styles.js.map +1 -1
  81. package/dist/vscode-tree/vscode-tree.styles.d.ts.map +1 -1
  82. package/dist/vscode-tree/vscode-tree.styles.js +4 -1
  83. package/dist/vscode-tree/vscode-tree.styles.js.map +1 -1
  84. package/package.json +13 -12
  85. package/vscode.html-custom-data.json +35 -8
@@ -6,103 +6,222 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
6
6
  };
7
7
  var VscodeSplitLayout_1;
8
8
  import { html } from 'lit';
9
- import { customElement, property, queryAssignedElements, state, } from 'lit/decorators.js';
9
+ import { customElement, property, query, queryAssignedElements, state, } from 'lit/decorators.js';
10
10
  import { classMap } from 'lit/directives/class-map.js';
11
11
  import { styleMap } from 'lit/directives/style-map.js';
12
12
  import { VscElement } from '../includes/VscElement.js';
13
13
  import styles from './vscode-split-layout.styles.js';
14
+ const DEFAULT_INITIAL_POSITION = '50%';
15
+ const DEFAULT_HANDLE_SIZE = 4;
16
+ export const parseValue = (raw) => {
17
+ if (!raw) {
18
+ return { value: 0, unit: 'pixel' };
19
+ }
20
+ let unit;
21
+ let rawVal;
22
+ if (raw.endsWith('%')) {
23
+ unit = 'percent';
24
+ rawVal = +raw.substring(0, raw.length - 1);
25
+ }
26
+ else if (raw.endsWith('px')) {
27
+ unit = 'pixel';
28
+ rawVal = +raw.substring(0, raw.length - 2);
29
+ }
30
+ else {
31
+ unit = 'pixel';
32
+ rawVal = +raw;
33
+ }
34
+ const value = isNaN(rawVal) ? 0 : rawVal;
35
+ return { unit, value };
36
+ };
37
+ // Returns a percentage between 0 and 100
38
+ export const pxToPercent = (current, max) => {
39
+ return max === 0 ? 0 : Math.min(100, (current / max) * 100);
40
+ };
41
+ export const percentToPx = (current, max) => {
42
+ return max * (current / 100);
43
+ };
14
44
  /**
15
45
  * @cssprop [--hover-border=var(--vscode-sash-hoverBorder)]
16
46
  */
17
47
  let VscodeSplitLayout = VscodeSplitLayout_1 = class VscodeSplitLayout extends VscElement {
48
+ /**
49
+ * Direction of the divider.
50
+ */
51
+ set split(newVal) {
52
+ this._split = newVal;
53
+ this.resetHandlePosition();
54
+ }
55
+ get split() {
56
+ return this._split;
57
+ }
58
+ /**
59
+ * Set the handle position programmatically. The value must include a unit,
60
+ * either `%` or `px`. If no unit is specified, the value is interpreted as
61
+ * `px`.
62
+ */
63
+ set handlePosition(newVal) {
64
+ this._rawHandlePosition = newVal;
65
+ this._handlePositionPropChanged();
66
+ }
67
+ get handlePosition() {
68
+ return this._rawHandlePosition;
69
+ }
70
+ /**
71
+ * The size of the fixed pane will not change when the component is resized.
72
+ */
73
+ set fixedPane(newVal) {
74
+ this._fixedPane = newVal;
75
+ this._fixedPanePropChanged();
76
+ }
77
+ get fixedPane() {
78
+ return this._fixedPane;
79
+ }
18
80
  constructor() {
19
- super(...arguments);
20
- this.split = 'vertical';
81
+ super();
82
+ this._split = 'vertical';
83
+ /**
84
+ * Controls whether the handle position should reset to the value set in the
85
+ * `initialHandlePosition` when it is double-clicked.
86
+ */
21
87
  this.resetOnDblClick = false;
22
88
  /**
23
- * Controls the draggable area size in pixels. it is recommended to use the value of `workbench.sash.size`.
89
+ * Controls the draggable area size in pixels. it is intended to use the value
90
+ * of `workbench.sash.size`.
24
91
  */
25
92
  this.handleSize = 4;
26
- this.initialHandlePosition = '50%';
27
- this._startPaneRight = 0;
28
- this._startPaneBottom = 0;
29
- this._endPaneTop = 0;
30
- this._endPaneLeft = 0;
31
- this._handleLeft = 0;
32
- this._handleTop = 0;
93
+ /**
94
+ * The handler position will reset to this position when it is double-clicked,
95
+ * or the `resetHandlePosition()` is called.
96
+ */
97
+ this.initialHandlePosition = DEFAULT_INITIAL_POSITION;
98
+ this._fixedPane = 'none';
99
+ this._handlePosition = 0;
33
100
  this._isDragActive = false;
34
101
  this._hover = false;
35
102
  this._hide = false;
36
103
  this._boundRect = new DOMRect();
37
104
  this._handleOffset = 0;
38
- this._handleMouseUp = () => {
105
+ this._wrapperObserved = false;
106
+ this._fixedPaneSize = 0;
107
+ this._handleResize = (entries) => {
108
+ const rect = entries[0].contentRect;
109
+ const { width, height } = rect;
110
+ this._boundRect = rect;
111
+ const max = this.split === 'vertical' ? width : height;
112
+ if (this.fixedPane === 'start') {
113
+ this._handlePosition = this._fixedPaneSize;
114
+ }
115
+ if (this.fixedPane === 'end') {
116
+ this._handlePosition = max - this._fixedPaneSize;
117
+ }
118
+ };
119
+ this._handleMouseUp = (ev) => {
39
120
  this._isDragActive = false;
121
+ if (ev.target !== this) {
122
+ this._hover = false;
123
+ this._hide = true;
124
+ }
40
125
  window.removeEventListener('mouseup', this._handleMouseUp);
41
126
  window.removeEventListener('mousemove', this._handleMouseMove);
127
+ const { width, height } = this._boundRect;
128
+ const max = this.split === 'vertical' ? width : height;
129
+ const positionInPercentage = pxToPercent(this._handlePosition, max);
130
+ this.dispatchEvent(new CustomEvent('vsc-split-layout-change', {
131
+ detail: {
132
+ position: this._handlePosition,
133
+ positionInPercentage,
134
+ },
135
+ composed: true,
136
+ }));
42
137
  };
43
138
  this._handleMouseMove = (event) => {
44
139
  const { clientX, clientY } = event;
45
140
  const { left, top, height, width } = this._boundRect;
46
- if (this.split === 'vertical') {
47
- const mouseXLocal = clientX - left;
48
- const handleLeftPx = Math.max(0, Math.min(mouseXLocal - this._handleOffset, width));
49
- const startPaneRightPx = Math.max(0, width - handleLeftPx);
50
- const handleLeftPercentage = (handleLeftPx / width) * 100;
51
- const startPaneRightPercentage = (startPaneRightPx / width) * 100;
52
- this._handleLeft = handleLeftPercentage;
53
- this._startPaneRight = startPaneRightPercentage;
54
- this._endPaneLeft = this._handleLeft;
141
+ const vert = this.split === 'vertical';
142
+ const maxPos = vert ? width : height;
143
+ const mousePos = vert ? clientX - left : clientY - top;
144
+ this._handlePosition = Math.max(0, Math.min(mousePos - this._handleOffset + this.handleSize / 2, maxPos));
145
+ if (this.fixedPane === 'start') {
146
+ this._fixedPaneSize = this._handlePosition;
55
147
  }
56
- if (this.split === 'horizontal') {
57
- const mouseYLocal = clientY - top;
58
- const handleTopPx = Math.max(0, Math.min(mouseYLocal - this._handleOffset, height));
59
- const startPaneBottomPx = Math.max(0, height - handleTopPx);
60
- const handleTopPercentage = (handleTopPx / height) * 100;
61
- const startPaneBottomPercentage = (startPaneBottomPx / height) * 100;
62
- this._handleTop = handleTopPercentage;
63
- this._startPaneBottom = startPaneBottomPercentage;
64
- this._endPaneTop = this._handleTop;
148
+ if (this.fixedPane === 'end') {
149
+ this._fixedPaneSize = maxPos - this._handlePosition;
65
150
  }
66
151
  };
152
+ this._resizeObserver = new ResizeObserver(this._handleResize);
153
+ }
154
+ /**
155
+ * Sets the handle position to the value specified in the `initialHandlePosition` property.
156
+ */
157
+ resetHandlePosition() {
158
+ if (!this._wrapperEl) {
159
+ this._handlePosition = 0;
160
+ return;
161
+ }
162
+ const { width, height } = this._wrapperEl.getBoundingClientRect();
163
+ const max = this.split === 'vertical' ? width : height;
164
+ const { value, unit } = parseValue(this.initialHandlePosition ?? DEFAULT_INITIAL_POSITION);
165
+ if (unit === 'percent') {
166
+ this._handlePosition = percentToPx(value, max);
167
+ }
168
+ else {
169
+ this._handlePosition = value;
170
+ }
67
171
  }
68
172
  connectedCallback() {
69
173
  super.connectedCallback();
70
- this._initPosition();
71
174
  }
72
- /** @internal */
73
- initializeResizeHandler() {
74
- this._initPosition();
175
+ firstUpdated(_changedProperties) {
176
+ if (this.fixedPane !== 'none') {
177
+ this._resizeObserver.observe(this._wrapperEl);
178
+ this._wrapperObserved = true;
179
+ }
180
+ this._boundRect = this._wrapperEl.getBoundingClientRect();
181
+ const { value, unit } = this.handlePosition
182
+ ? parseValue(this.handlePosition)
183
+ : parseValue(this.initialHandlePosition);
184
+ this._setPosition(value, unit);
185
+ this._initFixedPane();
75
186
  }
76
- _initPosition() {
77
- this._boundRect = this.getBoundingClientRect();
78
- const { height, width } = this._boundRect;
79
- const maxPos = this.split === 'vertical' ? width : height;
80
- const matches = /(^[0-9.]+)(%{0,1})$/.exec(this.initialHandlePosition);
81
- let pos = 0;
82
- let numericVal = 0;
83
- if (matches) {
84
- numericVal = parseFloat(matches[1]);
187
+ _handlePositionPropChanged() {
188
+ if (this.handlePosition && this._wrapperEl) {
189
+ this._boundRect = this._wrapperEl.getBoundingClientRect();
190
+ const { value, unit } = parseValue(this.handlePosition);
191
+ this._setPosition(value, unit);
85
192
  }
86
- if (matches && matches[2] === '%') {
87
- pos = Math.min(maxPos, (maxPos / 100) * numericVal);
193
+ }
194
+ _fixedPanePropChanged() {
195
+ if (!this._wrapperEl) {
196
+ return;
88
197
  }
89
- else if (matches && matches[2] !== '%') {
90
- pos = Math.min(numericVal, maxPos);
198
+ this._initFixedPane();
199
+ }
200
+ _initFixedPane() {
201
+ if (this.fixedPane === 'none') {
202
+ if (this._wrapperObserved) {
203
+ this._resizeObserver.unobserve(this._wrapperEl);
204
+ this._wrapperObserved = false;
205
+ }
91
206
  }
92
207
  else {
93
- pos = maxPos / 2;
94
- }
95
- if (this.split === 'vertical') {
96
- this._startPaneRight = ((maxPos - pos) / width) * 100;
97
- this._endPaneLeft = (pos / width) * 100;
98
- this._handleLeft = (pos / width) * 100;
99
- }
100
- if (this.split === 'horizontal') {
101
- this._startPaneBottom = ((maxPos - pos) / height) * 100;
102
- this._endPaneTop = (pos / height) * 100;
103
- this._handleTop = (pos / height) * 100;
208
+ const { width, height } = this._boundRect;
209
+ const max = this.split === 'vertical' ? width : height;
210
+ this._fixedPaneSize =
211
+ this.fixedPane === 'start'
212
+ ? this._handlePosition
213
+ : max - this._handlePosition;
214
+ if (!this._wrapperObserved) {
215
+ this._resizeObserver.observe(this._wrapperEl);
216
+ this._wrapperObserved = true;
217
+ }
104
218
  }
105
219
  }
220
+ _setPosition(value, unit) {
221
+ const { width, height } = this._boundRect;
222
+ const max = this.split === 'vertical' ? width : height;
223
+ this._handlePosition = unit === 'percent' ? percentToPx(value, max) : value;
224
+ }
106
225
  _handleMouseOver() {
107
226
  this._hover = true;
108
227
  this._hide = false;
@@ -116,17 +235,17 @@ let VscodeSplitLayout = VscodeSplitLayout_1 = class VscodeSplitLayout extends Vs
116
235
  _handleMouseDown(event) {
117
236
  event.stopPropagation();
118
237
  event.preventDefault();
119
- this._boundRect = this.getBoundingClientRect();
120
- const { left, top, width, height } = this._boundRect;
121
- const mouseXLocal = ((event.clientX - left) / width) * 100;
122
- const mouseYLocal = ((event.clientY - top) / height) * 100;
238
+ this._boundRect = this._wrapperEl.getBoundingClientRect();
239
+ const { left, top } = this._boundRect;
240
+ const { left: handleLeft, top: handleTop } = this._handleEl.getBoundingClientRect();
241
+ const mouseXLocal = event.clientX - left;
242
+ const mouseYLocal = event.clientY - top;
123
243
  if (this.split === 'vertical') {
124
- this._handleOffset = mouseXLocal - this._handleLeft;
244
+ this._handleOffset = mouseXLocal - (handleLeft - left);
125
245
  }
126
246
  if (this.split === 'horizontal') {
127
- this._handleOffset = mouseYLocal - this._handleTop;
247
+ this._handleOffset = mouseYLocal - (handleTop - top);
128
248
  }
129
- this._boundRect = this.getBoundingClientRect();
130
249
  this._isDragActive = true;
131
250
  window.addEventListener('mouseup', this._handleMouseUp);
132
251
  window.addEventListener('mousemove', this._handleMouseMove);
@@ -135,7 +254,7 @@ let VscodeSplitLayout = VscodeSplitLayout_1 = class VscodeSplitLayout extends Vs
135
254
  if (!this.resetOnDblClick) {
136
255
  return;
137
256
  }
138
- this._initPosition();
257
+ this.resetHandlePosition();
139
258
  }
140
259
  _handleSlotChange() {
141
260
  const nestedLayouts = [
@@ -144,30 +263,42 @@ let VscodeSplitLayout = VscodeSplitLayout_1 = class VscodeSplitLayout extends Vs
144
263
  ];
145
264
  nestedLayouts.forEach((e) => {
146
265
  if (e instanceof VscodeSplitLayout_1) {
147
- e.initializeResizeHandler();
266
+ e.resetHandlePosition();
148
267
  }
149
268
  });
150
269
  }
151
270
  render() {
152
- const startPaneStyles = styleMap({
153
- bottom: `${this._startPaneBottom}%`,
154
- right: `${this._startPaneRight}%`,
155
- });
156
- const endPaneStyles = styleMap({
157
- left: `${this._endPaneLeft}%`,
158
- top: `${this._endPaneTop}%`,
159
- });
271
+ const { width, height } = this._boundRect;
272
+ const maxPos = this.split === 'vertical' ? width : height;
273
+ const handlePosCss = this.fixedPane !== 'none'
274
+ ? `${this._handlePosition}px`
275
+ : `${pxToPercent(this._handlePosition, maxPos)}%`;
276
+ let startPaneSize = '';
277
+ if (this.fixedPane === 'start') {
278
+ startPaneSize = `0 0 ${this._fixedPaneSize}px`;
279
+ }
280
+ else {
281
+ startPaneSize = `1 1 ${pxToPercent(this._handlePosition, maxPos)}%`;
282
+ }
283
+ let endPaneSize = '';
284
+ if (this.fixedPane === 'end') {
285
+ endPaneSize = `0 0 ${this._fixedPaneSize}px`;
286
+ }
287
+ else {
288
+ endPaneSize = `1 1 ${pxToPercent(maxPos - this._handlePosition, maxPos)}%`;
289
+ }
160
290
  const handleStylesPropObj = {
161
- left: `${this._handleLeft}%`,
162
- top: `${this._handleTop}%`,
291
+ left: this.split === 'vertical' ? handlePosCss : '0',
292
+ top: this.split === 'vertical' ? '0' : handlePosCss,
163
293
  };
294
+ const handleSize = this.handleSize ?? DEFAULT_HANDLE_SIZE;
164
295
  if (this.split === 'vertical') {
165
- handleStylesPropObj.marginLeft = `${0 - this.handleSize / 2}px`;
166
- handleStylesPropObj.width = `${this.handleSize}px`;
296
+ handleStylesPropObj.marginLeft = `${0 - handleSize / 2}px`;
297
+ handleStylesPropObj.width = `${handleSize}px`;
167
298
  }
168
299
  if (this.split === 'horizontal') {
169
- handleStylesPropObj.height = `${this.handleSize}px`;
170
- handleStylesPropObj.marginTop = `${0 - this.handleSize / 2}px`;
300
+ handleStylesPropObj.height = `${handleSize}px`;
301
+ handleStylesPropObj.marginTop = `${0 - handleSize / 2}px`;
171
302
  }
172
303
  const handleStyles = styleMap(handleStylesPropObj);
173
304
  const handleOverlayClasses = classMap({
@@ -183,29 +314,35 @@ let VscodeSplitLayout = VscodeSplitLayout_1 = class VscodeSplitLayout extends Vs
183
314
  'split-vertical': this.split === 'vertical',
184
315
  'split-horizontal': this.split === 'horizontal',
185
316
  });
317
+ const wrapperClasses = {
318
+ wrapper: true,
319
+ horizontal: this.split === 'horizontal',
320
+ };
186
321
  return html `
187
- <div class="start" style="${startPaneStyles}">
188
- <slot name="start" @slotchange=${this._handleSlotChange}></slot>
322
+ <div class="${classMap(wrapperClasses)}">
323
+ <div class="start" style="${styleMap({ flex: startPaneSize })}">
324
+ <slot name="start" @slotchange=${this._handleSlotChange}></slot>
325
+ </div>
326
+ <div class="end" style="${styleMap({ flex: endPaneSize })}">
327
+ <slot name="end" @slotchange=${this._handleSlotChange}></slot>
328
+ </div>
329
+ <div class="${handleOverlayClasses}"></div>
330
+ <div
331
+ class="${handleClasses}"
332
+ style="${handleStyles}"
333
+ @mouseover="${this._handleMouseOver}"
334
+ @mouseout="${this._handleMouseOut}"
335
+ @mousedown="${this._handleMouseDown}"
336
+ @dblclick="${this._handleDblClick}"
337
+ ></div>
189
338
  </div>
190
- <div class="end" style="${endPaneStyles}">
191
- <slot name="end" @slotchange=${this._handleSlotChange}></slot>
192
- </div>
193
- <div class="${handleOverlayClasses}"></div>
194
- <div
195
- class="${handleClasses}"
196
- style="${handleStyles}"
197
- @mouseover="${this._handleMouseOver}"
198
- @mouseout="${this._handleMouseOut}"
199
- @mousedown="${this._handleMouseDown}"
200
- @dblclick="${this._handleDblClick}"
201
- ></div>
202
339
  `;
203
340
  }
204
341
  };
205
342
  VscodeSplitLayout.styles = styles;
206
343
  __decorate([
207
344
  property({ reflect: true })
208
- ], VscodeSplitLayout.prototype, "split", void 0);
345
+ ], VscodeSplitLayout.prototype, "split", null);
209
346
  __decorate([
210
347
  property({ type: Boolean, reflect: true, attribute: 'reset-on-dbl-click' })
211
348
  ], VscodeSplitLayout.prototype, "resetOnDblClick", void 0);
@@ -216,23 +353,14 @@ __decorate([
216
353
  property({ reflect: true, attribute: 'initial-handle-position' })
217
354
  ], VscodeSplitLayout.prototype, "initialHandlePosition", void 0);
218
355
  __decorate([
219
- state()
220
- ], VscodeSplitLayout.prototype, "_startPaneRight", void 0);
356
+ property({ attribute: 'handle-position' })
357
+ ], VscodeSplitLayout.prototype, "handlePosition", null);
221
358
  __decorate([
222
- state()
223
- ], VscodeSplitLayout.prototype, "_startPaneBottom", void 0);
359
+ property({ attribute: 'fixed-pane' })
360
+ ], VscodeSplitLayout.prototype, "fixedPane", null);
224
361
  __decorate([
225
362
  state()
226
- ], VscodeSplitLayout.prototype, "_endPaneTop", void 0);
227
- __decorate([
228
- state()
229
- ], VscodeSplitLayout.prototype, "_endPaneLeft", void 0);
230
- __decorate([
231
- state()
232
- ], VscodeSplitLayout.prototype, "_handleLeft", void 0);
233
- __decorate([
234
- state()
235
- ], VscodeSplitLayout.prototype, "_handleTop", void 0);
363
+ ], VscodeSplitLayout.prototype, "_handlePosition", void 0);
236
364
  __decorate([
237
365
  state()
238
366
  ], VscodeSplitLayout.prototype, "_isDragActive", void 0);
@@ -242,6 +370,12 @@ __decorate([
242
370
  __decorate([
243
371
  state()
244
372
  ], VscodeSplitLayout.prototype, "_hide", void 0);
373
+ __decorate([
374
+ query('.wrapper')
375
+ ], VscodeSplitLayout.prototype, "_wrapperEl", void 0);
376
+ __decorate([
377
+ query('.handle')
378
+ ], VscodeSplitLayout.prototype, "_handleEl", void 0);
245
379
  __decorate([
246
380
  queryAssignedElements({ slot: 'start', selector: 'vscode-split-layout' })
247
381
  ], VscodeSplitLayout.prototype, "_nestedLayoutsAtStart", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"vscode-split-layout.js","sourceRoot":"","sources":["../../src/vscode-split-layout/vscode-split-layout.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAC,IAAI,EAAiB,MAAM,KAAK,CAAC;AACzC,OAAO,EACL,aAAa,EACb,QAAQ,EACR,qBAAqB,EACrB,KAAK,GACN,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAC,UAAU,EAAC,MAAM,2BAA2B,CAAC;AACrD,OAAO,MAAM,MAAM,iCAAiC,CAAC;AAErD;;GAEG;AAEI,IAAM,iBAAiB,yBAAvB,MAAM,iBAAkB,SAAQ,UAAU;IAA1C;;QAIL,UAAK,GAA8B,UAAU,CAAC;QAG9C,oBAAe,GAAG,KAAK,CAAC;QAExB;;WAEG;QAEH,eAAU,GAAG,CAAC,CAAC;Q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BAAgB;qBACtB,IAAI,CAAC,eAAe;;KAEpC,CAAC;IACJ,CAAC;;AAlQM,wBAAM,GAAG,MAAM,AAAT,CAAU;AAGvB;IADC,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;gDACoB;AAG9C;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,oBAAoB,EAAC,CAAC;0DAClD;AAMxB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,aAAa,EAAC,CAAC;qDACnD;AAGf;IADC,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,yBAAyB,EAAC,CAAC;gEAClC;AAGtB;IADP,KAAK,EAAE;0DACoB;AAGpB;IADP,KAAK,EAAE;2DACqB;AAGrB;IADP,KAAK,EAAE;sDACgB;AAGhB;IADP,KAAK,EAAE;uDACiB;AAGjB;IADP,KAAK,EAAE;sDACgB;AAGhB;IADP,KAAK,EAAE;qDACe;AAGf;IADP,KAAK,EAAE;wDACsB;AAGtB;IADP,KAAK,EAAE;iDACe;AAGf;IADP,KAAK,EAAE;gDACc;AAGd;IADP,qBAAqB,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,qBAAqB,EAAC,CAAC;gEAC1B;AAGtC;IADP,qBAAqB,CAAC,EAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,qBAAqB,EAAC,CAAC;8DAC1B;AAjDjC,iBAAiB;IAD7B,aAAa,CAAC,qBAAqB,CAAC;GACxB,iBAAiB,CAoQ7B","sourcesContent":["import {html, TemplateResult} from 'lit';\nimport {\n customElement,\n property,\n queryAssignedElements,\n state,\n} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {styleMap} from 'lit/directives/style-map.js';\nimport {VscElement} from '../includes/VscElement.js';\nimport styles from './vscode-split-layout.styles.js';\n\n/**\n * @cssprop [--hover-border=var(--vscode-sash-hoverBorder)]\n */\n@customElement('vscode-split-layout')\nexport class VscodeSplitLayout extends VscElement {\n static styles = styles;\n\n @property({reflect: true})\n split: 'horizontal' | 'vertical' = 'vertical';\n\n @property({type: Boolean, reflect: true, attribute: 'reset-on-dbl-click'})\n resetOnDblClick = false;\n\n /**\n * Controls the draggable area size in pixels. it is recommended to use the value of `workbench.sash.size`.\n */\n @property({type: Number, reflect: true, attribute: 'handle-size'})\n handleSize = 4;\n\n @property({reflect: true, attribute: 'initial-handle-position'})\n initialHandlePosition = '50%';\n\n @state()\n private _startPaneRight = 0;\n\n @state()\n private _startPaneBottom = 0;\n\n @state()\n private _endPaneTop = 0;\n\n @state()\n private _endPaneLeft = 0;\n\n @state()\n private _handleLeft = 0;\n\n @state()\n private _handleTop = 0;\n\n @state()\n private _isDragActive = false;\n\n @state()\n private _hover = false;\n\n @state()\n private _hide = false;\n\n @queryAssignedElements({slot: 'start', selector: 'vscode-split-layout'})\n private _nestedLayoutsAtStart!: HTMLElement[];\n\n @queryAssignedElements({slot: 'end', selector: 'vscode-split-layout'})\n private _nestedLayoutsAtEnd!: HTMLElement[];\n\n private _boundRect: DOMRect = new DOMRect();\n private _handleOffset = 0;\n\n connectedCallback(): void {\n super.connectedCallback();\n\n this._initPosition();\n }\n\n /** @internal */\n initializeResizeHandler() {\n this._initPosition();\n }\n\n private _initPosition() {\n this._boundRect = this.getBoundingClientRect();\n const {height, width} = this._boundRect;\n const maxPos = this.split === 'vertical' ? width : height;\n const matches = /(^[0-9.]+)(%{0,1})$/.exec(this.initialHandlePosition);\n let pos = 0;\n let numericVal = 0;\n\n if (matches) {\n numericVal = parseFloat(matches[1]);\n }\n\n if (matches && matches[2] === '%') {\n pos = Math.min(maxPos, (maxPos / 100) * numericVal);\n } else if (matches && matches[2] !== '%') {\n pos = Math.min(numericVal, maxPos);\n } else {\n pos = maxPos / 2;\n }\n\n if (this.split === 'vertical') {\n this._startPaneRight = ((maxPos - pos) / width) * 100;\n this._endPaneLeft = (pos / width) * 100;\n this._handleLeft = (pos / width) * 100;\n }\n\n if (this.split === 'horizontal') {\n this._startPaneBottom = ((maxPos - pos) / height) * 100;\n this._endPaneTop = (pos / height) * 100;\n this._handleTop = (pos / height) * 100;\n }\n }\n\n private _handleMouseOver() {\n this._hover = true;\n this._hide = false;\n }\n\n private _handleMouseOut(event: MouseEvent) {\n if (event.buttons !== 1) {\n this._hover = false;\n this._hide = true;\n }\n }\n\n private _handleMouseDown(event: MouseEvent) {\n event.stopPropagation();\n event.preventDefault();\n\n this._boundRect = this.getBoundingClientRect();\n const {left, top, width, height} = this._boundRect;\n\n const mouseXLocal = ((event.clientX - left) / width) * 100;\n const mouseYLocal = ((event.clientY - top) / height) * 100;\n\n if (this.split === 'vertical') {\n this._handleOffset = mouseXLocal - this._handleLeft;\n }\n\n if (this.split === 'horizontal') {\n this._handleOffset = mouseYLocal - this._handleTop;\n }\n\n this._boundRect = this.getBoundingClientRect();\n this._isDragActive = true;\n\n window.addEventListener('mouseup', this._handleMouseUp);\n window.addEventListener('mousemove', this._handleMouseMove);\n }\n\n private _handleMouseUp = () => {\n this._isDragActive = false;\n window.removeEventListener('mouseup', this._handleMouseUp);\n window.removeEventListener('mousemove', this._handleMouseMove);\n };\n\n private _handleMouseMove = (event: MouseEvent) => {\n const {clientX, clientY} = event;\n const {left, top, height, width} = this._boundRect;\n\n if (this.split === 'vertical') {\n const mouseXLocal = clientX - left;\n const handleLeftPx = Math.max(\n 0,\n Math.min(mouseXLocal - this._handleOffset, width)\n );\n const startPaneRightPx = Math.max(0, width - handleLeftPx);\n\n const handleLeftPercentage = (handleLeftPx / width) * 100;\n const startPaneRightPercentage = (startPaneRightPx / width) * 100;\n\n this._handleLeft = handleLeftPercentage;\n this._startPaneRight = startPaneRightPercentage;\n this._endPaneLeft = this._handleLeft;\n }\n\n if (this.split === 'horizontal') {\n const mouseYLocal = clientY - top;\n const handleTopPx = Math.max(\n 0,\n Math.min(mouseYLocal - this._handleOffset, height)\n );\n const startPaneBottomPx = Math.max(0, height - handleTopPx);\n\n const handleTopPercentage = (handleTopPx / height) * 100;\n const startPaneBottomPercentage = (startPaneBottomPx / height) * 100;\n\n this._handleTop = handleTopPercentage;\n this._startPaneBottom = startPaneBottomPercentage;\n this._endPaneTop = this._handleTop;\n }\n };\n\n private _handleDblClick() {\n if (!this.resetOnDblClick) {\n return;\n }\n\n this._initPosition();\n }\n\n private _handleSlotChange() {\n const nestedLayouts = [\n ...this._nestedLayoutsAtStart,\n ...this._nestedLayoutsAtEnd,\n ];\n\n nestedLayouts.forEach((e) => {\n if (e instanceof VscodeSplitLayout) {\n e.initializeResizeHandler();\n }\n });\n }\n\n render(): TemplateResult {\n const startPaneStyles = styleMap({\n bottom: `${this._startPaneBottom}%`,\n right: `${this._startPaneRight}%`,\n });\n\n const endPaneStyles = styleMap({\n left: `${this._endPaneLeft}%`,\n top: `${this._endPaneTop}%`,\n });\n\n const handleStylesPropObj: {[prop: string]: string} = {\n left: `${this._handleLeft}%`,\n top: `${this._handleTop}%`,\n };\n\n if (this.split === 'vertical') {\n handleStylesPropObj.marginLeft = `${0 - this.handleSize / 2}px`;\n handleStylesPropObj.width = `${this.handleSize}px`;\n }\n\n if (this.split === 'horizontal') {\n handleStylesPropObj.height = `${this.handleSize}px`;\n handleStylesPropObj.marginTop = `${0 - this.handleSize / 2}px`;\n }\n\n const handleStyles = styleMap(handleStylesPropObj);\n\n const handleOverlayClasses = classMap({\n 'handle-overlay': true,\n active: this._isDragActive,\n 'split-vertical': this.split === 'vertical',\n 'split-horizontal': this.split === 'horizontal',\n });\n\n const handleClasses = classMap({\n handle: true,\n hover: this._hover,\n hide: this._hide,\n 'split-vertical': this.split === 'vertical',\n 'split-horizontal': this.split === 'horizontal',\n });\n\n return html`\n <div class=\"start\" style=\"${startPaneStyles}\">\n <slot name=\"start\" @slotchange=${this._handleSlotChange}></slot>\n </div>\n <div class=\"end\" style=\"${endPaneStyles}\">\n <slot name=\"end\" @slotchange=${this._handleSlotChange}></slot>\n </div>\n <div class=\"${handleOverlayClasses}\"></div>\n <div\n class=\"${handleClasses}\"\n style=\"${handleStyles}\"\n @mouseover=\"${this._handleMouseOver}\"\n @mouseout=\"${this._handleMouseOut}\"\n @mousedown=\"${this._handleMouseDown}\"\n @dblclick=\"${this._handleDblClick}\"\n ></div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'vscode-split-layout': VscodeSplitLayout;\n }\n}\n"]}
1
+ {"version":3,"file":"vscode-split-layout.js","sourceRoot":"","sources":["../../src/vscode-split-layout/vscode-split-layout.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAC,IAAI,EAAiC,MAAM,KAAK,CAAC;AACzD,OAAO,EACL,aAAa,EACb,QAAQ,EACR,KAAK,EACL,qBAAqB,EACrB,KAAK,GACN,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAC,UAAU,EAAC,MAAM,2BAA2B,CAAC;AACrD,OAAO,MAAM,MAAM,iCAAiC,CAAC;AAErD,MAAM,wBAAwB,GAAG,KAAK,CAAC;AACvC,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAM9B,MAAM,CAAC,MAAM,UAAU,GAAG,CACxB,GAAW,EAC0B,EAAE;IACvC,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,OAAO,EAAC,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAC,CAAC;IACnC,CAAC;IAED,IAAI,IAAkB,CAAC;IACvB,IAAI,MAAc,CAAC;IAEnB,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACtB,IAAI,GAAG,SAAS,CAAC;QACjB,MAAM,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,GAAG,CAA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,EAAE,SAAS,EAAE,yBAAyB,EAAC,CAAC;gEACP;AAQzD;IADC,QAAQ,CAAC,EAAC,SAAS,EAAE,iBAAiB,EAAC,CAAC;uDAIxC;AAUD;IADC,QAAQ,CAAC,EAAC,SAAS,EAAE,YAAY,EAAC,CAAC;kDAInC;AAOO;IADP,KAAK,EAAE;0DACoB;AAGpB;IADP,KAAK,EAAE;wDACsB;AAGtB;IADP,KAAK,EAAE;iDACe;AAGf;IADP,KAAK,EAAE;gDACc;AAGd;IADP,KAAK,CAAC,UAAU,CAAC;qDACkB;AAG5B;IADP,KAAK,CAAC,SAAS,CAAC;oDACkB;AAG3B;IADP,qBAAqB,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,qBAAqB,EAAC,CAAC;gEAC1B;AAGtC;IADP,qBAAqB,CAAC,EAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,qBAAqB,EAAC,CAAC;8DAC1B;AAvFjC,iBAAiB;IAD7B,aAAa,CAAC,qBAAqB,CAAC;GACxB,iBAAiB,CAwY7B","sourcesContent":["import {html, PropertyValues, TemplateResult} from 'lit';\nimport {\n customElement,\n property,\n query,\n queryAssignedElements,\n state,\n} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {styleMap} from 'lit/directives/style-map.js';\nimport {VscElement} from '../includes/VscElement.js';\nimport styles from './vscode-split-layout.styles.js';\n\nconst DEFAULT_INITIAL_POSITION = '50%';\nconst DEFAULT_HANDLE_SIZE = 4;\n\ntype PositionUnit = 'pixel' | 'percent';\ntype Orientation = 'horizontal' | 'vertical';\ntype FixedPaneType = 'start' | 'end' | 'none';\n\nexport const parseValue = (\n raw: string\n): {value: number; unit: PositionUnit} => {\n if (!raw) {\n return {value: 0, unit: 'pixel'};\n }\n\n let unit: PositionUnit;\n let rawVal: number;\n\n if (raw.endsWith('%')) {\n unit = 'percent';\n rawVal = +raw.substring(0, raw.length - 1);\n } else if (raw.endsWith('px')) {\n unit = 'pixel';\n rawVal = +raw.substring(0, raw.length - 2);\n } else {\n unit = 'pixel';\n rawVal = +raw;\n }\n\n const value = isNaN(rawVal) ? 0 : rawVal;\n\n return {unit, value};\n};\n\n// Returns a percentage between 0 and 100\nexport const pxToPercent = (current: number, max: number) => {\n return max === 0 ? 0 : Math.min(100, (current / max) * 100);\n};\n\nexport const percentToPx = (current: number, max: number) => {\n return max * (current / 100);\n};\n\nexport type VscSplitLayoutChangeEvent = CustomEvent<{\n position: number;\n positionInPercentage: number;\n}>;\n\n/**\n * @cssprop [--hover-border=var(--vscode-sash-hoverBorder)]\n */\n@customElement('vscode-split-layout')\nexport class VscodeSplitLayout extends VscElement {\n static styles = styles;\n\n /**\n * Direction of the divider.\n */\n @property({reflect: true})\n set split(newVal: Orientation) {\n this._split = newVal;\n this.resetHandlePosition();\n }\n get split(): Orientation {\n return this._split;\n }\n private _split: Orientation = 'vertical';\n\n /**\n * Controls whether the handle position should reset to the value set in the\n * `initialHandlePosition` when it is double-clicked.\n */\n @property({type: Boolean, reflect: true, attribute: 'reset-on-dbl-click'})\n resetOnDblClick = false;\n\n /**\n * Controls the draggable area size in pixels. it is intended to use the value\n * of `workbench.sash.size`.\n */\n @property({type: Number, reflect: true, attribute: 'handle-size'})\n handleSize = 4;\n\n /**\n * The handler position will reset to this position when it is double-clicked,\n * or the `resetHandlePosition()` is called.\n */\n @property({reflect: true, attribute: 'initial-handle-position'})\n initialHandlePosition: string = DEFAULT_INITIAL_POSITION;\n\n /**\n * Set the handle position programmatically. The value must include a unit,\n * either `%` or `px`. If no unit is specified, the value is interpreted as\n * `px`.\n */\n @property({attribute: 'handle-position'})\n set handlePosition(newVal: string) {\n this._rawHandlePosition = newVal;\n this._handlePositionPropChanged();\n }\n get handlePosition(): string | undefined {\n return this._rawHandlePosition;\n }\n private _rawHandlePosition?: string;\n\n /**\n * The size of the fixed pane will not change when the component is resized.\n */\n @property({attribute: 'fixed-pane'})\n set fixedPane(newVal: FixedPaneType) {\n this._fixedPane = newVal;\n this._fixedPanePropChanged();\n }\n get fixedPane(): FixedPaneType {\n return this._fixedPane;\n }\n private _fixedPane: FixedPaneType = 'none';\n\n @state()\n private _handlePosition = 0;\n\n @state()\n private _isDragActive = false;\n\n @state()\n private _hover = false;\n\n @state()\n private _hide = false;\n\n @query('.wrapper')\n private _wrapperEl!: HTMLDivElement;\n\n @query('.handle')\n private _handleEl!: HTMLDivElement;\n\n @queryAssignedElements({slot: 'start', selector: 'vscode-split-layout'})\n private _nestedLayoutsAtStart!: HTMLElement[];\n\n @queryAssignedElements({slot: 'end', selector: 'vscode-split-layout'})\n private _nestedLayoutsAtEnd!: HTMLElement[];\n\n private _boundRect: DOMRect = new DOMRect();\n private _handleOffset = 0;\n private _resizeObserver: ResizeObserver;\n private _wrapperObserved: boolean = false;\n private _fixedPaneSize: number = 0;\n\n constructor() {\n super();\n\n this._resizeObserver = new ResizeObserver(this._handleResize);\n }\n\n /**\n * Sets the handle position to the value specified in the `initialHandlePosition` property.\n */\n resetHandlePosition() {\n if (!this._wrapperEl) {\n this._handlePosition = 0;\n return;\n }\n\n const {width, height} = this._wrapperEl.getBoundingClientRect();\n const max = this.split === 'vertical' ? width : height;\n const {value, unit} = parseValue(\n this.initialHandlePosition ?? DEFAULT_INITIAL_POSITION\n );\n\n if (unit === 'percent') {\n this._handlePosition = percentToPx(value, max);\n } else {\n this._handlePosition = value;\n }\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n }\n\n protected firstUpdated(_changedProperties: PropertyValues): void {\n if (this.fixedPane !== 'none') {\n this._resizeObserver.observe(this._wrapperEl);\n this._wrapperObserved = true;\n }\n\n this._boundRect = this._wrapperEl.getBoundingClientRect();\n\n const {value, unit} = this.handlePosition\n ? parseValue(this.handlePosition)\n : parseValue(this.initialHandlePosition);\n\n this._setPosition(value, unit);\n this._initFixedPane();\n }\n\n private _handlePositionPropChanged() {\n if (this.handlePosition && this._wrapperEl) {\n this._boundRect = this._wrapperEl.getBoundingClientRect();\n const {value, unit} = parseValue(this.handlePosition);\n this._setPosition(value, unit);\n }\n }\n\n private _fixedPanePropChanged() {\n if (!this._wrapperEl) {\n return;\n }\n\n this._initFixedPane();\n }\n\n private _initFixedPane() {\n if (this.fixedPane === 'none') {\n if (this._wrapperObserved) {\n this._resizeObserver.unobserve(this._wrapperEl);\n this._wrapperObserved = false;\n }\n } else {\n const {width, height} = this._boundRect;\n const max = this.split === 'vertical' ? width : height;\n\n this._fixedPaneSize =\n this.fixedPane === 'start'\n ? this._handlePosition\n : max - this._handlePosition;\n\n if (!this._wrapperObserved) {\n this._resizeObserver.observe(this._wrapperEl);\n this._wrapperObserved = true;\n }\n }\n }\n\n private _handleResize = (entries: ResizeObserverEntry[]) => {\n const rect = entries[0].contentRect;\n const {width, height} = rect;\n this._boundRect = rect;\n const max = this.split === 'vertical' ? width : height;\n\n if (this.fixedPane === 'start') {\n this._handlePosition = this._fixedPaneSize;\n }\n\n if (this.fixedPane === 'end') {\n this._handlePosition = max - this._fixedPaneSize;\n }\n };\n\n private _setPosition(value: number, unit: PositionUnit) {\n const {width, height} = this._boundRect;\n const max = this.split === 'vertical' ? width : height;\n\n this._handlePosition = unit === 'percent' ? percentToPx(value, max) : value;\n }\n\n private _handleMouseOver() {\n this._hover = true;\n this._hide = false;\n }\n\n private _handleMouseOut(event: MouseEvent) {\n if (event.buttons !== 1) {\n this._hover = false;\n this._hide = true;\n }\n }\n\n private _handleMouseDown(event: MouseEvent) {\n event.stopPropagation();\n event.preventDefault();\n\n this._boundRect = this._wrapperEl.getBoundingClientRect();\n const {left, top} = this._boundRect;\n const {left: handleLeft, top: handleTop} =\n this._handleEl.getBoundingClientRect();\n\n const mouseXLocal = event.clientX - left;\n const mouseYLocal = event.clientY - top;\n\n if (this.split === 'vertical') {\n this._handleOffset = mouseXLocal - (handleLeft - left);\n }\n\n if (this.split === 'horizontal') {\n this._handleOffset = mouseYLocal - (handleTop - top);\n }\n\n this._isDragActive = true;\n\n window.addEventListener('mouseup', this._handleMouseUp);\n window.addEventListener('mousemove', this._handleMouseMove);\n }\n\n private _handleMouseUp = (ev: MouseEvent) => {\n this._isDragActive = false;\n\n if (ev.target !== this) {\n this._hover = false;\n this._hide = true;\n }\n\n window.removeEventListener('mouseup', this._handleMouseUp);\n window.removeEventListener('mousemove', this._handleMouseMove);\n\n const {width, height} = this._boundRect;\n const max = this.split === 'vertical' ? width : height;\n const positionInPercentage = pxToPercent(this._handlePosition, max);\n\n this.dispatchEvent(\n new CustomEvent('vsc-split-layout-change', {\n detail: {\n position: this._handlePosition,\n positionInPercentage,\n },\n composed: true,\n }) as VscSplitLayoutChangeEvent\n );\n };\n\n private _handleMouseMove = (event: MouseEvent) => {\n const {clientX, clientY} = event;\n const {left, top, height, width} = this._boundRect;\n const vert = this.split === 'vertical';\n const maxPos = vert ? width : height;\n const mousePos = vert ? clientX - left : clientY - top;\n\n this._handlePosition = Math.max(\n 0,\n Math.min(mousePos - this._handleOffset + this.handleSize / 2, maxPos)\n );\n\n if (this.fixedPane === 'start') {\n this._fixedPaneSize = this._handlePosition;\n }\n\n if (this.fixedPane === 'end') {\n this._fixedPaneSize = maxPos - this._handlePosition;\n }\n };\n\n private _handleDblClick() {\n if (!this.resetOnDblClick) {\n return;\n }\n\n this.resetHandlePosition();\n }\n\n private _handleSlotChange() {\n const nestedLayouts = [\n ...this._nestedLayoutsAtStart,\n ...this._nestedLayoutsAtEnd,\n ];\n\n nestedLayouts.forEach((e) => {\n if (e instanceof VscodeSplitLayout) {\n e.resetHandlePosition();\n }\n });\n }\n\n render(): TemplateResult {\n const {width, height} = this._boundRect;\n const maxPos = this.split === 'vertical' ? width : height;\n const handlePosCss =\n this.fixedPane !== 'none'\n ? `${this._handlePosition}px`\n : `${pxToPercent(this._handlePosition, maxPos)}%`;\n\n let startPaneSize = '';\n\n if (this.fixedPane === 'start') {\n startPaneSize = `0 0 ${this._fixedPaneSize}px`;\n } else {\n startPaneSize = `1 1 ${pxToPercent(this._handlePosition, maxPos)}%`;\n }\n\n let endPaneSize = '';\n\n if (this.fixedPane === 'end') {\n endPaneSize = `0 0 ${this._fixedPaneSize}px`;\n } else {\n endPaneSize = `1 1 ${pxToPercent(maxPos - this._handlePosition, maxPos)}%`;\n }\n\n const handleStylesPropObj: {[prop: string]: string} = {\n left: this.split === 'vertical' ? handlePosCss : '0',\n top: this.split === 'vertical' ? '0' : handlePosCss,\n };\n\n const handleSize = this.handleSize ?? DEFAULT_HANDLE_SIZE;\n\n if (this.split === 'vertical') {\n handleStylesPropObj.marginLeft = `${0 - handleSize / 2}px`;\n handleStylesPropObj.width = `${handleSize}px`;\n }\n\n if (this.split === 'horizontal') {\n handleStylesPropObj.height = `${handleSize}px`;\n handleStylesPropObj.marginTop = `${0 - handleSize / 2}px`;\n }\n\n const handleStyles = styleMap(handleStylesPropObj);\n\n const handleOverlayClasses = classMap({\n 'handle-overlay': true,\n active: this._isDragActive,\n 'split-vertical': this.split === 'vertical',\n 'split-horizontal': this.split === 'horizontal',\n });\n\n const handleClasses = classMap({\n handle: true,\n hover: this._hover,\n hide: this._hide,\n 'split-vertical': this.split === 'vertical',\n 'split-horizontal': this.split === 'horizontal',\n });\n\n const wrapperClasses = {\n wrapper: true,\n horizontal: this.split === 'horizontal',\n };\n\n return html`\n <div class=\"${classMap(wrapperClasses)}\">\n <div class=\"start\" style=\"${styleMap({flex: startPaneSize})}\">\n <slot name=\"start\" @slotchange=${this._handleSlotChange}></slot>\n </div>\n <div class=\"end\" style=\"${styleMap({flex: endPaneSize})}\">\n <slot name=\"end\" @slotchange=${this._handleSlotChange}></slot>\n </div>\n <div class=\"${handleOverlayClasses}\"></div>\n <div\n class=\"${handleClasses}\"\n style=\"${handleStyles}\"\n @mouseover=\"${this._handleMouseOver}\"\n @mouseout=\"${this._handleMouseOut}\"\n @mousedown=\"${this._handleMouseDown}\"\n @dblclick=\"${this._handleDblClick}\"\n ></div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'vscode-split-layout': VscodeSplitLayout;\n }\n\n interface GlobalEventHandlersEventMap {\n 'vsc-split-layout-change': VscSplitLayoutChangeEvent;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"vscode-split-layout.styles.d.ts","sourceRoot":"","sources":["../../src/vscode-split-layout/vscode-split-layout.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,cAAc,EAAC,MAAM,KAAK,CAAC;AAGxC,QAAA,MAAM,MAAM,EAAE,cA4Fb,CAAC;AAEF,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"vscode-split-layout.styles.d.ts","sourceRoot":"","sources":["../../src/vscode-split-layout/vscode-split-layout.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,cAAc,EAAC,MAAM,KAAK,CAAC;AAGxC,QAAA,MAAM,MAAM,EAAE,cA8Gb,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -21,12 +21,21 @@ const styles = [
21
21
  border: 0;
22
22
  }
23
23
 
24
+ .wrapper {
25
+ display: flex;
26
+ height: 100%;
27
+ width: 100%;
28
+ }
29
+
30
+ .wrapper.horizontal {
31
+ flex-direction: column;
32
+ }
33
+
24
34
  .start {
25
35
  box-sizing: border-box;
26
- left: 0;
27
- top: 0;
28
- overflow: hidden;
29
- position: absolute;
36
+ flex: 1;
37
+ min-height: 0;
38
+ min-width: 0;
30
39
  }
31
40
 
32
41
  :host([split='vertical']) .start {
@@ -38,11 +47,19 @@ const styles = [
38
47
  }
39
48
 
40
49
  .end {
41
- bottom: 0;
42
- box-sizing: border-box;
43
- overflow: hidden;
44
- position: absolute;
45
- right: 0;
50
+ flex: 1;
51
+ min-height: 0;
52
+ min-width: 0;
53
+ }
54
+
55
+ :host([split='vertical']) .start,
56
+ :host([split='vertical']) .end {
57
+ height: 100%;
58
+ }
59
+
60
+ :host([split='horizontal']) .start,
61
+ :host([split='horizontal']) .end {
62
+ width: 100%;
46
63
  }
47
64
 
48
65
  .handle-overlay {
@@ -68,18 +85,19 @@ const styles = [
68
85
  }
69
86
 
70
87
  .handle {
88
+ background-color: transparent;
71
89
  position: absolute;
72
90
  z-index: 2;
73
91
  }
74
92
 
75
93
  .handle.hover {
94
+ transition: background-color 0.1s ease-out 0.3s;
76
95
  background-color: var(--vscode-sash-hoverBorder);
77
- transition: background-color 100ms linear 300ms;
78
96
  }
79
97
 
80
98
  .handle.hide {
81
99
  background-color: transparent;
82
- transition: background-color 100ms linear;
100
+ transition: background-color 0.1s ease-out;
83
101
  }
84
102
 
85
103
  .handle.split-vertical {