chrome-devtools-frontend 1.0.934857 → 1.0.935332
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/config/gni/all_devtools_files.gni +0 -3
- package/config/gni/devtools_grd_files.gni +1 -2
- package/front_end/core/i18n/locales/en-US.json +9 -0
- package/front_end/core/i18n/locales/en-XL.json +9 -0
- package/front_end/entrypoints/inspector_main/RenderingOptions.ts +1 -1
- package/front_end/entrypoints/shell/shell.json +0 -2
- package/front_end/panels/application/module.json +0 -2
- package/front_end/panels/console/module.json +0 -2
- package/front_end/panels/coverage/module.json +0 -1
- package/front_end/panels/css_overview/module.json +1 -2
- package/front_end/panels/developer_resources/module.json +1 -2
- package/front_end/panels/elements/StylesSidebarPane.ts +15 -0
- package/front_end/panels/event_listeners/module.json +1 -2
- package/front_end/panels/media/module.json +0 -1
- package/front_end/panels/network/module.json +0 -2
- package/front_end/panels/profiler/module.json +1 -3
- package/front_end/panels/settings/emulation/devicesSettingsTab.css +1 -1
- package/front_end/panels/sources/NavigatorView.ts +8 -8
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +15 -0
- package/front_end/panels/sources/module.json +0 -1
- package/front_end/panels/sources/watchExpressionsSidebarPane.css +10 -3
- package/front_end/panels/timeline/module.json +0 -1
- package/front_end/panels/webauthn/module.json +0 -1
- package/front_end/ui/legacy/TabbedPane.ts +4 -0
- package/front_end/ui/legacy/components/cookie_table/module.json +1 -2
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +3 -1
- package/front_end/ui/legacy/components/data_grid/dataGrid.css +5 -0
- package/front_end/ui/legacy/components/inline_editor/CSSLength.ts +10 -3
- package/front_end/ui/legacy/components/inline_editor/cssLength.css +30 -9
- package/front_end/ui/legacy/components/source_frame/module.json +1 -2
- package/package.json +1 -1
- package/front_end/ui/legacy/components/data_grid/module.json +0 -8
- package/front_end/ui/legacy/components/object_ui/module.json +0 -5
|
@@ -53,8 +53,6 @@ all_devtools_files = [
|
|
|
53
53
|
"front_end/legacy_test_runner/cpu_profiler_test_runner/cpu_profiler_test_runner.js",
|
|
54
54
|
"front_end/panels/css_overview/module.json",
|
|
55
55
|
"front_end/legacy_test_runner/data_grid_test_runner/data_grid_test_runner.js",
|
|
56
|
-
"front_end/ui/legacy/components/data_grid/dataGrid.css",
|
|
57
|
-
"front_end/ui/legacy/components/data_grid/module.json",
|
|
58
56
|
"front_end/legacy_test_runner/device_mode_test_runner/device_mode_test_runner.js",
|
|
59
57
|
"front_end/legacy_test_runner/elements_test_runner/elements_test_runner.js",
|
|
60
58
|
"front_end/legacy_test_runner/elements_test_runner/EditDOMTestRunner.js",
|
|
@@ -101,7 +99,6 @@ all_devtools_files = [
|
|
|
101
99
|
"front_end/panels/network/module.json",
|
|
102
100
|
"front_end/entrypoints/node_main/module.json",
|
|
103
101
|
"front_end/entrypoints/node_main/nodeConnectionsPanel.css",
|
|
104
|
-
"front_end/ui/legacy/components/object_ui/module.json",
|
|
105
102
|
"front_end/ui/legacy/components/perf_ui/chartViewport.css",
|
|
106
103
|
"front_end/ui/legacy/components/perf_ui/filmStripView.css",
|
|
107
104
|
"front_end/ui/legacy/components/perf_ui/flameChart.css",
|
|
@@ -514,14 +514,12 @@ grd_files_release_sources = [
|
|
|
514
514
|
"front_end/ui/legacy/components/cookie_table/cookie_table_module.js",
|
|
515
515
|
"front_end/ui/legacy/components/data_grid/data_grid-legacy.js",
|
|
516
516
|
"front_end/ui/legacy/components/data_grid/data_grid.js",
|
|
517
|
-
"front_end/ui/legacy/components/data_grid/data_grid_module.js",
|
|
518
517
|
"front_end/ui/legacy/components/inline_editor/inline_editor-legacy.js",
|
|
519
518
|
"front_end/ui/legacy/components/inline_editor/inline_editor.js",
|
|
520
519
|
"front_end/ui/legacy/components/inline_editor/inline_editor_module.js",
|
|
521
520
|
"front_end/ui/legacy/components/object_ui/object_ui-legacy.js",
|
|
522
521
|
"front_end/ui/legacy/components/object_ui/object_ui-meta.js",
|
|
523
522
|
"front_end/ui/legacy/components/object_ui/object_ui.js",
|
|
524
|
-
"front_end/ui/legacy/components/object_ui/object_ui_module.js",
|
|
525
523
|
"front_end/ui/legacy/components/perf_ui/perf_ui-legacy.js",
|
|
526
524
|
"front_end/ui/legacy/components/perf_ui/perf_ui-meta.js",
|
|
527
525
|
"front_end/ui/legacy/components/perf_ui/perf_ui.js",
|
|
@@ -1503,6 +1501,7 @@ grd_files_debug_sources = [
|
|
|
1503
1501
|
"front_end/ui/legacy/components/data_grid/ShowMoreDataGridNode.js",
|
|
1504
1502
|
"front_end/ui/legacy/components/data_grid/SortableDataGrid.js",
|
|
1505
1503
|
"front_end/ui/legacy/components/data_grid/ViewportDataGrid.js",
|
|
1504
|
+
"front_end/ui/legacy/components/data_grid/dataGrid.css.js",
|
|
1506
1505
|
"front_end/ui/legacy/components/inline_editor/BezierEditor.js",
|
|
1507
1506
|
"front_end/ui/legacy/components/inline_editor/BezierUI.js",
|
|
1508
1507
|
"front_end/ui/legacy/components/inline_editor/CSSAngle.js",
|
|
@@ -4778,6 +4778,15 @@
|
|
|
4778
4778
|
"panels/elements/StylesSidebarPane.ts | copySelector": {
|
|
4779
4779
|
"message": "Copy selector"
|
|
4780
4780
|
},
|
|
4781
|
+
"panels/elements/StylesSidebarPane.ts | cssPropertyName": {
|
|
4782
|
+
"message": "CSS property name"
|
|
4783
|
+
},
|
|
4784
|
+
"panels/elements/StylesSidebarPane.ts | cssPropertyValue": {
|
|
4785
|
+
"message": "CSS property value"
|
|
4786
|
+
},
|
|
4787
|
+
"panels/elements/StylesSidebarPane.ts | cssSelector": {
|
|
4788
|
+
"message": "CSS selector"
|
|
4789
|
+
},
|
|
4781
4790
|
"panels/elements/StylesSidebarPane.ts | filter": {
|
|
4782
4791
|
"message": "Filter"
|
|
4783
4792
|
},
|
|
@@ -4778,6 +4778,15 @@
|
|
|
4778
4778
|
"panels/elements/StylesSidebarPane.ts | copySelector": {
|
|
4779
4779
|
"message": "Ĉóp̂ý selector"
|
|
4780
4780
|
},
|
|
4781
|
+
"panels/elements/StylesSidebarPane.ts | cssPropertyName": {
|
|
4782
|
+
"message": "CSS p̂ŕôṕêŕt̂ý n̂ám̂é"
|
|
4783
|
+
},
|
|
4784
|
+
"panels/elements/StylesSidebarPane.ts | cssPropertyValue": {
|
|
4785
|
+
"message": "CSS p̂ŕôṕêŕt̂ý v̂ál̂úê"
|
|
4786
|
+
},
|
|
4787
|
+
"panels/elements/StylesSidebarPane.ts | cssSelector": {
|
|
4788
|
+
"message": "CSS ŝél̂éĉt́ôŕ"
|
|
4789
|
+
},
|
|
4781
4790
|
"panels/elements/StylesSidebarPane.ts | filter": {
|
|
4782
4791
|
"message": "F̂íl̂t́êŕ"
|
|
4783
4792
|
},
|
|
@@ -208,7 +208,7 @@ const supportsPrefersContrast = (): boolean => {
|
|
|
208
208
|
};
|
|
209
209
|
|
|
210
210
|
const supportsJpegXl = async(): Promise<boolean> => {
|
|
211
|
-
const JPEG_XL_IMAGE_URL = 'data:image/jxl;base64,/
|
|
211
|
+
const JPEG_XL_IMAGE_URL = 'data:image/jxl;base64,/wr/BwiDBAwASyAY';
|
|
212
212
|
const promise = new Promise<boolean>((resolve): void => {
|
|
213
213
|
const img = document.createElement('img');
|
|
214
214
|
img.onload = (): void => resolve(true);
|
|
@@ -7,11 +7,9 @@
|
|
|
7
7
|
{ "name": "ui/legacy/components/color_picker" },
|
|
8
8
|
{ "name": "panels/console" },
|
|
9
9
|
{ "name": "panels/coverage" },
|
|
10
|
-
{ "name": "ui/legacy/components/data_grid" },
|
|
11
10
|
{ "name": "panels/event_listeners" },
|
|
12
11
|
{ "name": "ui/legacy/components/inline_editor" },
|
|
13
12
|
{ "name": "panels/input"},
|
|
14
|
-
{ "name": "ui/legacy/components/object_ui" },
|
|
15
13
|
{ "name": "ui/legacy/components/perf_ui" },
|
|
16
14
|
{ "name": "panels/profiler" },
|
|
17
15
|
{ "name": "panels/protocol_monitor"},
|
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
"ui/legacy/components/source_frame",
|
|
4
4
|
"ui/legacy/components/cookie_table",
|
|
5
5
|
"ui/legacy/components/inline_editor",
|
|
6
|
-
"ui/legacy/components/data_grid",
|
|
7
6
|
"ui/legacy",
|
|
8
|
-
"ui/legacy/components/object_ui",
|
|
9
7
|
"ui/legacy/components/perf_ui",
|
|
10
8
|
"panels/mobile_throttling",
|
|
11
9
|
"panels/network",
|
|
@@ -160,6 +160,18 @@ const UIStrings = {
|
|
|
160
160
|
*@description Tooltip text that appears when hovering over the largeicon add button in the Styles Sidebar Pane of the Elements panel
|
|
161
161
|
*/
|
|
162
162
|
newStyleRule: 'New Style Rule',
|
|
163
|
+
/**
|
|
164
|
+
*@description Text that is announced by the screen reader when the user focuses on an input field for entering the name of a CSS property in the Styles panel
|
|
165
|
+
*/
|
|
166
|
+
cssPropertyName: '`CSS` property name',
|
|
167
|
+
/**
|
|
168
|
+
*@description Text that is announced by the screen reader when the user focuses on an input field for entering the value of a CSS property in the Styles panel
|
|
169
|
+
*/
|
|
170
|
+
cssPropertyValue: '`CSS` property value',
|
|
171
|
+
/**
|
|
172
|
+
*@description Text that is announced by the screen reader when the user focuses on an input field for editing the name of a CSS selector in the Styles panel
|
|
173
|
+
*/
|
|
174
|
+
cssSelector: '`CSS` selector',
|
|
163
175
|
};
|
|
164
176
|
|
|
165
177
|
const str_ = i18n.i18n.registerUIStrings('panels/elements/StylesSidebarPane.ts', UIStrings);
|
|
@@ -1235,6 +1247,7 @@ export class StylePropertiesSection {
|
|
|
1235
1247
|
|
|
1236
1248
|
const selectorContainer = document.createElement('div');
|
|
1237
1249
|
this.selectorElement = document.createElement('span');
|
|
1250
|
+
UI.ARIAUtils.setAccessibleName(this.selectorElement, i18nString(UIStrings.cssSelector));
|
|
1238
1251
|
this.selectorElement.classList.add('selector');
|
|
1239
1252
|
this.selectorElement.textContent = this.headerText();
|
|
1240
1253
|
selectorContainer.appendChild(this.selectorElement);
|
|
@@ -2985,6 +2998,7 @@ export class StylesSidebarPropertyRenderer {
|
|
|
2985
2998
|
|
|
2986
2999
|
renderName(): Element {
|
|
2987
3000
|
const nameElement = document.createElement('span');
|
|
3001
|
+
UI.ARIAUtils.setAccessibleName(nameElement, i18nString(UIStrings.cssPropertyName));
|
|
2988
3002
|
nameElement.className = 'webkit-css-property';
|
|
2989
3003
|
nameElement.textContent = this.propertyName;
|
|
2990
3004
|
nameElement.normalize();
|
|
@@ -2993,6 +3007,7 @@ export class StylesSidebarPropertyRenderer {
|
|
|
2993
3007
|
|
|
2994
3008
|
renderValue(): Element {
|
|
2995
3009
|
const valueElement = document.createElement('span');
|
|
3010
|
+
UI.ARIAUtils.setAccessibleName(valueElement, i18nString(UIStrings.cssPropertyValue));
|
|
2996
3011
|
valueElement.className = 'value';
|
|
2997
3012
|
if (!this.propertyValue) {
|
|
2998
3013
|
return valueElement;
|
|
@@ -782,8 +782,8 @@ export class NavigatorView extends UI.Widget.VBox implements SDK.TargetManager.O
|
|
|
782
782
|
this.rename(node, false);
|
|
783
783
|
}
|
|
784
784
|
|
|
785
|
-
private handleContextMenuExclude(project: Workspace.Workspace.Project, path: string): void {
|
|
786
|
-
const shouldExclude =
|
|
785
|
+
private async handleContextMenuExclude(project: Workspace.Workspace.Project, path: string): Promise<void> {
|
|
786
|
+
const shouldExclude = await UI.UIUtils.ConfirmDialog.show(i18nString(UIStrings.areYouSureYouWantToExcludeThis));
|
|
787
787
|
if (shouldExclude) {
|
|
788
788
|
UI.UIUtils.startBatchUpdate();
|
|
789
789
|
project.excludeFolder(
|
|
@@ -792,8 +792,8 @@ export class NavigatorView extends UI.Widget.VBox implements SDK.TargetManager.O
|
|
|
792
792
|
}
|
|
793
793
|
}
|
|
794
794
|
|
|
795
|
-
private handleContextMenuDelete(uiSourceCode: Workspace.UISourceCode.UISourceCode): void {
|
|
796
|
-
const shouldDelete =
|
|
795
|
+
private async handleContextMenuDelete(uiSourceCode: Workspace.UISourceCode.UISourceCode): Promise<void> {
|
|
796
|
+
const shouldDelete = await UI.UIUtils.ConfirmDialog.show(i18nString(UIStrings.areYouSureYouWantToDeleteThis));
|
|
797
797
|
if (shouldDelete) {
|
|
798
798
|
uiSourceCode.project().deleteFile(uiSourceCode);
|
|
799
799
|
}
|
|
@@ -816,8 +816,8 @@ export class NavigatorView extends UI.Widget.VBox implements SDK.TargetManager.O
|
|
|
816
816
|
contextMenu.show();
|
|
817
817
|
}
|
|
818
818
|
|
|
819
|
-
private handleDeleteOverrides(node: NavigatorTreeNode): void {
|
|
820
|
-
const shouldRemove =
|
|
819
|
+
private async handleDeleteOverrides(node: NavigatorTreeNode): Promise<void> {
|
|
820
|
+
const shouldRemove = await UI.UIUtils.ConfirmDialog.show(i18nString(UIStrings.areYouSureYouWantToDeleteAll));
|
|
821
821
|
if (shouldRemove) {
|
|
822
822
|
this.handleDeleteOverridesHelper(node);
|
|
823
823
|
}
|
|
@@ -871,8 +871,8 @@ export class NavigatorView extends UI.Widget.VBox implements SDK.TargetManager.O
|
|
|
871
871
|
if (project.type() === Workspace.Workspace.projectTypes.FileSystem) {
|
|
872
872
|
contextMenu.defaultSection().appendAction('sources.add-folder-to-workspace', undefined, true);
|
|
873
873
|
if (node instanceof NavigatorGroupTreeNode) {
|
|
874
|
-
contextMenu.defaultSection().appendItem(i18nString(UIStrings.removeFolderFromWorkspace), () => {
|
|
875
|
-
const shouldRemove =
|
|
874
|
+
contextMenu.defaultSection().appendItem(i18nString(UIStrings.removeFolderFromWorkspace), async () => {
|
|
875
|
+
const shouldRemove = await UI.UIUtils.ConfirmDialog.show(i18nString(UIStrings.areYouSureYouWantToRemoveThis));
|
|
876
876
|
if (shouldRemove) {
|
|
877
877
|
project.remove();
|
|
878
878
|
}
|
|
@@ -303,6 +303,7 @@ export class WatchExpression extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
|
303
303
|
private textPrompt?: ObjectUI.ObjectPropertiesSection.ObjectPropertyPrompt;
|
|
304
304
|
private result?: SDK.RemoteObject.RemoteObject|null;
|
|
305
305
|
private preventClickTimeout?: number;
|
|
306
|
+
private resizeObserver?: ResizeObserver;
|
|
306
307
|
constructor(
|
|
307
308
|
expression: string|null,
|
|
308
309
|
expandController: ObjectUI.ObjectPropertiesSection.ObjectPropertiesSectionsTreeExpandController,
|
|
@@ -412,6 +413,7 @@ export class WatchExpression extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
|
412
413
|
if (this.expressionInternal) {
|
|
413
414
|
this.expandController.stopWatchSectionsWithId(this.expressionInternal);
|
|
414
415
|
}
|
|
416
|
+
this.resizeObserver?.disconnect();
|
|
415
417
|
this.expressionInternal = newExpression;
|
|
416
418
|
this.update();
|
|
417
419
|
this.dispatchEventToListeners(Events.ExpressionUpdated, this);
|
|
@@ -442,6 +444,19 @@ export class WatchExpression extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
|
442
444
|
expressionValue?: SDK.RemoteObject.RemoteObject, exceptionDetails?: Protocol.Runtime.ExceptionDetails): Element {
|
|
443
445
|
const headerElement = this.element.createChild('div', 'watch-expression-header');
|
|
444
446
|
const deleteButton = UI.Icon.Icon.create('smallicon-cross', 'watch-expression-delete-button');
|
|
447
|
+
this.resizeObserver = new ResizeObserver(entries => {
|
|
448
|
+
entries.forEach(entry => {
|
|
449
|
+
// 55 serves as a width threshold here (in px)
|
|
450
|
+
if (entry.contentRect.width < 55) {
|
|
451
|
+
deleteButton.classList.remove('right-aligned');
|
|
452
|
+
deleteButton.classList.add('left-aligned');
|
|
453
|
+
} else {
|
|
454
|
+
deleteButton.classList.remove('left-aligned');
|
|
455
|
+
deleteButton.classList.add('right-aligned');
|
|
456
|
+
}
|
|
457
|
+
});
|
|
458
|
+
});
|
|
459
|
+
this.resizeObserver.observe(headerElement);
|
|
445
460
|
UI.Tooltip.Tooltip.install(deleteButton, i18nString(UIStrings.deleteWatchExpression));
|
|
446
461
|
deleteButton.addEventListener('click', this.deleteWatchExpression.bind(this), false);
|
|
447
462
|
|
|
@@ -7,12 +7,19 @@
|
|
|
7
7
|
.watch-expression-delete-button {
|
|
8
8
|
position: absolute;
|
|
9
9
|
top: 5px;
|
|
10
|
-
right: 16px;
|
|
11
10
|
cursor: pointer;
|
|
12
11
|
opacity: 0%;
|
|
13
12
|
}
|
|
14
13
|
|
|
15
|
-
.
|
|
14
|
+
.right-aligned {
|
|
15
|
+
right: 16px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.left-aligned {
|
|
19
|
+
left: -11px;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.watch-expression-title:hover .watch-expression-delete-button {
|
|
16
23
|
opacity: 100%;
|
|
17
24
|
}
|
|
18
25
|
|
|
@@ -108,7 +115,7 @@ li.watch-expression-editing::before {
|
|
|
108
115
|
}
|
|
109
116
|
|
|
110
117
|
@media (forced-colors: active) {
|
|
111
|
-
.watch-expression-
|
|
118
|
+
.watch-expression-title:hover .watch-expression-delete-button,
|
|
112
119
|
.watch-expressions .dimmed {
|
|
113
120
|
opacity: 100%;
|
|
114
121
|
}
|
|
@@ -251,6 +251,10 @@ export class TabbedPane extends Common.ObjectWrapper.eventMixin<EventTypes, type
|
|
|
251
251
|
}
|
|
252
252
|
|
|
253
253
|
closeTabs(ids: string[], userGesture?: boolean): void {
|
|
254
|
+
if (ids.length === 0) {
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
|
|
254
258
|
const focused = this.hasFocus();
|
|
255
259
|
for (let i = 0; i < ids.length; ++i) {
|
|
256
260
|
this.innerCloseTab(ids[i], userGesture);
|
|
@@ -31,6 +31,8 @@ import * as i18n from '../../../../core/i18n/i18n.js';
|
|
|
31
31
|
import * as Platform from '../../../../core/platform/platform.js';
|
|
32
32
|
import * as UI from '../../legacy.js';
|
|
33
33
|
|
|
34
|
+
import dataGridStyles from './dataGrid.css.js';
|
|
35
|
+
|
|
34
36
|
const UIStrings = {
|
|
35
37
|
/**
|
|
36
38
|
*@description Accessible text label for expandible nodes in datagrids
|
|
@@ -169,7 +171,6 @@ export class DataGridImpl<T> extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
|
169
171
|
const {displayName, columns: columnsArray, editCallback, deleteCallback, refreshCallback} = dataGridParameters;
|
|
170
172
|
this.element = document.createElement('div');
|
|
171
173
|
this.element.classList.add('data-grid');
|
|
172
|
-
UI.Utils.appendStyle(this.element, 'ui/legacy/components/data_grid/dataGrid.css');
|
|
173
174
|
this.element.tabIndex = 0;
|
|
174
175
|
this.element.addEventListener('keydown', this.keyDown.bind(this), false);
|
|
175
176
|
this.element.addEventListener('contextmenu', this.contextMenu.bind(this), true);
|
|
@@ -2351,6 +2352,7 @@ export class DataGridWidget<T> extends UI.Widget.VBox {
|
|
|
2351
2352
|
}
|
|
2352
2353
|
|
|
2353
2354
|
wasShown(): void {
|
|
2355
|
+
this.registerCSSFiles([dataGridStyles]);
|
|
2354
2356
|
this.dataGrid.wasShown();
|
|
2355
2357
|
}
|
|
2356
2358
|
|
|
@@ -154,6 +154,7 @@
|
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
.data-grid th .sort-order-icon-container {
|
|
157
|
+
background-color: var(--color-background-elevation-1);
|
|
157
158
|
position: absolute;
|
|
158
159
|
top: 1px;
|
|
159
160
|
right: 0;
|
|
@@ -162,6 +163,10 @@
|
|
|
162
163
|
align-items: center;
|
|
163
164
|
}
|
|
164
165
|
|
|
166
|
+
.data-grid th:hover .sort-order-icon-container {
|
|
167
|
+
background-color: var(--color-background-highlight);
|
|
168
|
+
}
|
|
169
|
+
|
|
165
170
|
.data-grid th .sort-order-icon {
|
|
166
171
|
margin-right: 4px;
|
|
167
172
|
margin-bottom: -2px;
|
|
@@ -77,6 +77,10 @@ export class CSSLength extends HTMLElement {
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
private onValueMousedown(event: MouseEvent): void {
|
|
80
|
+
if (event.button !== 0) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
|
|
80
84
|
this.currentMouseClientX = event.clientX;
|
|
81
85
|
const targetDocument = event.target instanceof Node && event.target.ownerDocument;
|
|
82
86
|
if (targetDocument) {
|
|
@@ -136,9 +140,12 @@ export class CSSLength extends HTMLElement {
|
|
|
136
140
|
<span class="value"
|
|
137
141
|
@mousedown=${this.onValueMousedown}
|
|
138
142
|
@mouseup=${this.onValueMouseup}
|
|
139
|
-
>${this.length.value}</span><
|
|
140
|
-
|
|
141
|
-
|
|
143
|
+
>${this.length.value}</span><span class="unit">${this.length.unit}</span><div class="unit-dropdown">
|
|
144
|
+
<span class="icon"></span>
|
|
145
|
+
<select @mouseup=${this.onUnitMouseup} @change=${this.onUnitChange}>
|
|
146
|
+
${options}
|
|
147
|
+
</select>
|
|
148
|
+
</div>
|
|
142
149
|
`;
|
|
143
150
|
// clang-format on
|
|
144
151
|
}
|
|
@@ -14,21 +14,42 @@
|
|
|
14
14
|
cursor: ew-resize;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
.unit-dropdown {
|
|
18
|
+
display: none;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.unit-dropdown select {
|
|
18
22
|
all: unset;
|
|
19
23
|
cursor: pointer;
|
|
20
|
-
|
|
24
|
+
opacity: 0%;
|
|
25
|
+
width: 0.8em;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.icon {
|
|
29
|
+
position: absolute;
|
|
30
|
+
display: inline-block;
|
|
31
|
+
-webkit-mask-image: var(--image-file-chevrons);
|
|
32
|
+
-webkit-mask-position: -12px 4px;
|
|
33
|
+
-webkit-mask-size: 19px 6px;
|
|
34
|
+
-webkit-mask-repeat: no-repeat;
|
|
35
|
+
background-color: var(--color-text-primary);
|
|
36
|
+
content: '';
|
|
37
|
+
height: 1em;
|
|
38
|
+
width: 1em;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
:host(:not(:last-child)) {
|
|
42
|
+
margin-right: 0.1em;
|
|
21
43
|
}
|
|
22
44
|
|
|
23
|
-
|
|
24
|
-
|
|
45
|
+
:host(:not(:last-child)) .unit-dropdown {
|
|
46
|
+
position: absolute;
|
|
25
47
|
}
|
|
26
48
|
|
|
27
|
-
|
|
28
|
-
|
|
49
|
+
.css-length:hover .unit-dropdown {
|
|
50
|
+
display: inline-block;
|
|
29
51
|
}
|
|
30
52
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
width: 4ch;
|
|
53
|
+
:host(:last-child) .unit-dropdown select {
|
|
54
|
+
width: 0.6em;
|
|
34
55
|
}
|
package/package.json
CHANGED