@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.
- package/custom-elements.json +390 -86
- package/dist/bundled.js +118 -83
- package/dist/includes/VscElement.js +1 -1
- package/dist/includes/VscElement.js.map +1 -1
- package/dist/includes/form-button-widget/FormButtonWidgetBase.d.ts.map +1 -1
- package/dist/includes/form-button-widget/FormButtonWidgetBase.js.map +1 -1
- package/dist/includes/form-button-widget/LabelledCheckboxOrRadio.d.ts +1 -1
- package/dist/includes/form-button-widget/LabelledCheckboxOrRadio.d.ts.map +1 -1
- package/dist/includes/form-button-widget/LabelledCheckboxOrRadio.js.map +1 -1
- package/dist/includes/test-helpers.d.ts +32 -0
- package/dist/includes/test-helpers.d.ts.map +1 -0
- package/dist/includes/test-helpers.js +76 -0
- package/dist/includes/test-helpers.js.map +1 -0
- package/dist/includes/vscode-select/styles.d.ts.map +1 -1
- package/dist/includes/vscode-select/styles.js +12 -14
- package/dist/includes/vscode-select/styles.js.map +1 -1
- package/dist/includes/vscode-select/vscode-select-base.d.ts +2 -2
- package/dist/includes/vscode-select/vscode-select-base.d.ts.map +1 -1
- package/dist/includes/vscode-select/vscode-select-base.js +4 -4
- package/dist/includes/vscode-select/vscode-select-base.js.map +1 -1
- package/dist/vscode-button/vscode-button.styles.d.ts.map +1 -1
- package/dist/vscode-button/vscode-button.styles.js +8 -2
- package/dist/vscode-button/vscode-button.styles.js.map +1 -1
- package/dist/vscode-checkbox/vscode-checkbox.styles.js +1 -1
- package/dist/vscode-checkbox/vscode-checkbox.styles.js.map +1 -1
- package/dist/vscode-collapsible/vscode-collapsible.styles.js +1 -1
- package/dist/vscode-collapsible/vscode-collapsible.styles.js.map +1 -1
- package/dist/vscode-context-menu/vscode-context-menu.d.ts +1 -1
- package/dist/vscode-context-menu/vscode-context-menu.d.ts.map +1 -1
- package/dist/vscode-context-menu/vscode-context-menu.js +1 -1
- package/dist/vscode-context-menu/vscode-context-menu.js.map +1 -1
- package/dist/vscode-context-menu-item/vscode-context-menu-item.styles.d.ts.map +1 -1
- package/dist/vscode-context-menu-item/vscode-context-menu-item.styles.js +4 -1
- package/dist/vscode-context-menu-item/vscode-context-menu-item.styles.js.map +1 -1
- package/dist/vscode-divider/vscode-divider.d.ts +1 -1
- package/dist/vscode-divider/vscode-divider.d.ts.map +1 -1
- package/dist/vscode-divider/vscode-divider.js +2 -2
- package/dist/vscode-divider/vscode-divider.js.map +1 -1
- package/dist/vscode-multi-select/vscode-multi-select.js +1 -1
- package/dist/vscode-multi-select/vscode-multi-select.js.map +1 -1
- package/dist/vscode-progress-ring/vscode-progress-ring.d.ts +1 -1
- package/dist/vscode-progress-ring/vscode-progress-ring.d.ts.map +1 -1
- package/dist/vscode-progress-ring/vscode-progress-ring.js +2 -2
- package/dist/vscode-progress-ring/vscode-progress-ring.js.map +1 -1
- package/dist/vscode-radio-group/vscode-radio-group.d.ts.map +1 -1
- package/dist/vscode-radio-group/vscode-radio-group.js.map +1 -1
- package/dist/vscode-scrollable/vscode-scrollable.d.ts.map +1 -1
- package/dist/vscode-scrollable/vscode-scrollable.js.map +1 -1
- package/dist/vscode-single-select/vscode-single-select.d.ts +0 -1
- package/dist/vscode-single-select/vscode-single-select.d.ts.map +1 -1
- package/dist/vscode-single-select/vscode-single-select.js +1 -5
- package/dist/vscode-single-select/vscode-single-select.js.map +1 -1
- package/dist/vscode-single-select/vscode-single-select.styles.d.ts.map +1 -1
- package/dist/vscode-single-select/vscode-single-select.styles.js.map +1 -1
- package/dist/vscode-split-layout/vscode-split-layout.d.ts +65 -12
- package/dist/vscode-split-layout/vscode-split-layout.d.ts.map +1 -1
- package/dist/vscode-split-layout/vscode-split-layout.js +244 -110
- package/dist/vscode-split-layout/vscode-split-layout.js.map +1 -1
- package/dist/vscode-split-layout/vscode-split-layout.styles.d.ts.map +1 -1
- package/dist/vscode-split-layout/vscode-split-layout.styles.js +29 -11
- package/dist/vscode-split-layout/vscode-split-layout.styles.js.map +1 -1
- package/dist/vscode-tab-header/vscode-tab-header.styles.js +1 -1
- package/dist/vscode-tab-header/vscode-tab-header.styles.js.map +1 -1
- package/dist/vscode-table/vscode-table.d.ts +1 -1
- package/dist/vscode-table/vscode-table.d.ts.map +1 -1
- package/dist/vscode-table/vscode-table.js +1 -1
- package/dist/vscode-table/vscode-table.js.map +1 -1
- package/dist/vscode-table-body/vscode-table-body.styles.d.ts.map +1 -1
- package/dist/vscode-table-body/vscode-table-body.styles.js +1 -2
- package/dist/vscode-table-body/vscode-table-body.styles.js.map +1 -1
- package/dist/vscode-textarea/vscode-textarea.styles.d.ts.map +1 -1
- package/dist/vscode-textarea/vscode-textarea.styles.js +4 -1
- package/dist/vscode-textarea/vscode-textarea.styles.js.map +1 -1
- package/dist/vscode-textfield/vscode-textfield.d.ts +15 -0
- package/dist/vscode-textfield/vscode-textfield.d.ts.map +1 -1
- package/dist/vscode-textfield/vscode-textfield.js +15 -0
- package/dist/vscode-textfield/vscode-textfield.js.map +1 -1
- package/dist/vscode-textfield/vscode-textfield.styles.d.ts.map +1 -1
- package/dist/vscode-textfield/vscode-textfield.styles.js +5 -2
- package/dist/vscode-textfield/vscode-textfield.styles.js.map +1 -1
- package/dist/vscode-tree/vscode-tree.styles.d.ts.map +1 -1
- package/dist/vscode-tree/vscode-tree.styles.js +4 -1
- package/dist/vscode-tree/vscode-tree.styles.js.map +1 -1
- package/package.json +13 -12
- package/vscode.html-custom-data.json +35 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VscElement.js","sourceRoot":"","sources":["../../src/includes/VscElement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,KAAK,CAAC;AAE/B,MAAM,OAAO,UAAW,SAAQ,UAAU;IAA1C;;QACU,aAAQ,GAAG,OAAO,CAAC;IAM7B,CAAC;IAJC,0BAA0B;IAC1B,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;CACF","sourcesContent":["import {LitElement} from 'lit';\n\nexport class VscElement extends LitElement {\n private _version = '1.
|
|
1
|
+
{"version":3,"file":"VscElement.js","sourceRoot":"","sources":["../../src/includes/VscElement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,KAAK,CAAC;AAE/B,MAAM,OAAO,UAAW,SAAQ,UAAU;IAA1C;;QACU,aAAQ,GAAG,OAAO,CAAC;IAM7B,CAAC;IAJC,0BAA0B;IAC1B,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;CACF","sourcesContent":["import {LitElement} from 'lit';\n\nexport class VscElement extends LitElement {\n private _version = '1.8.1';\n\n /** VSC Element version */\n get version() {\n return this._version;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormButtonWidgetBase.d.ts","sourceRoot":"","sources":["../../../src/includes/form-button-widget/FormButtonWidgetBase.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAE5C,qBAAa,oBAAqB,SAAQ,UAAU;IAElD,OAAO,UAAS;;IAOhB,iBAAiB,IAAI,IAAI;IAMzB,oBAAoB,IAAI,IAAI;IAM5B,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAW5E,OAAO,CAAC,aAAa,CAAK;IAE1B,OAAO,CAAC,YAAY,
|
|
1
|
+
{"version":3,"file":"FormButtonWidgetBase.d.ts","sourceRoot":"","sources":["../../../src/includes/form-button-widget/FormButtonWidgetBase.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAE5C,qBAAa,oBAAqB,SAAQ,UAAU;IAElD,OAAO,UAAS;;IAOhB,iBAAiB,IAAI,IAAI;IAMzB,oBAAoB,IAAI,IAAI;IAM5B,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAW5E,OAAO,CAAC,aAAa,CAAK;IAE1B,OAAO,CAAC,YAAY,CAElB;IAEF,OAAO,CAAC,WAAW,CAEjB;CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormButtonWidgetBase.js","sourceRoot":"","sources":["../../../src/includes/form-button-widget/FormButtonWidgetBase.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAC,mBAAmB,EAAC,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAE5C,MAAM,OAAO,oBAAqB,SAAQ,UAAU;IAIlD;QACE,KAAK,EAAE,CAAC;QAHV,YAAO,GAAG,KAAK,CAAC;QA8BR,kBAAa,GAAG,CAAC,CAAC;QAElB,iBAAY,GAAG,GAAS,EAAE;YAChC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACtB,CAAC,
|
|
1
|
+
{"version":3,"file":"FormButtonWidgetBase.js","sourceRoot":"","sources":["../../../src/includes/form-button-widget/FormButtonWidgetBase.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAC,mBAAmB,EAAC,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAE5C,MAAM,OAAO,oBAAqB,SAAQ,UAAU;IAIlD;QACE,KAAK,EAAE,CAAC;QAHV,YAAO,GAAG,KAAK,CAAC;QA8BR,kBAAa,GAAG,CAAC,CAAC;QAElB,iBAAY,GAAG,GAAS,EAAE;YAChC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACtB,CAAC,CAAC;QAEM,gBAAW,GAAG,GAAS,EAAE;YAC/B,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACvB,CAAC,CAAC;QAlCA,mBAAmB,EAAE,CAAC;IACxB,CAAC;IAED,iBAAiB;QACf,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QAClD,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IAClD,CAAC;IAED,oBAAoB;QAClB,KAAK,CAAC,oBAAoB,EAAE,CAAC;QAC7B,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QACrD,IAAI,CAAC,mBAAmB,CAAC,MAAM,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IACrD,CAAC;IAED,wBAAwB,CAAC,IAAY,EAAE,MAAc,EAAE,MAAc;QACnE,KAAK,CAAC,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QAErD,IAAI,IAAI,KAAK,UAAU,IAAI,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,EAAE,CAAC;YACzD,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,QAAQ,CAAC;YACnC,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC;QACrB,CAAC;aAAM,IAAI,IAAI,KAAK,UAAU,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,EAAE,CAAC;YACjE,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,aAAa,CAAC;QACrC,CAAC;IACH,CAAC;CAWF;AAvCC;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;qDACzB","sourcesContent":["import {property} from 'lit/decorators.js';\nimport {applyForegroundRGBA} from '../themeHelpers.js';\nimport {VscElement} from '../VscElement.js';\n\nexport class FormButtonWidgetBase extends VscElement {\n @property({type: Boolean, reflect: true})\n focused = false;\n\n constructor() {\n super();\n applyForegroundRGBA();\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n this.addEventListener('focus', this._handleFocus);\n this.addEventListener('blur', this._handleBlur);\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.removeEventListener('focus', this._handleFocus);\n this.removeEventListener('blur', this._handleBlur);\n }\n\n attributeChangedCallback(name: string, oldVal: string, newVal: string): void {\n super.attributeChangedCallback(name, oldVal, newVal);\n\n if (name === 'disabled' && this.hasAttribute('disabled')) {\n this._prevTabindex = this.tabIndex;\n this.tabIndex = -1;\n } else if (name === 'disabled' && !this.hasAttribute('disabled')) {\n this.tabIndex = this._prevTabindex;\n }\n }\n\n private _prevTabindex = 0;\n\n private _handleFocus = (): void => {\n this.focused = true;\n };\n\n private _handleBlur = (): void => {\n this.focused = false;\n };\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LitElement, TemplateResult } from 'lit';
|
|
2
|
-
type Constructor<T =
|
|
2
|
+
type Constructor<T = unknown> = new (...args: any[]) => T;
|
|
3
3
|
export declare class LabelledCheckboxOrRadioInterface {
|
|
4
4
|
label: string;
|
|
5
5
|
protected _handleSlotChange(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LabelledCheckboxOrRadio.d.ts","sourceRoot":"","sources":["../../../src/includes/form-button-widget/LabelledCheckboxOrRadio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,UAAU,EAAW,cAAc,EAAC,MAAM,KAAK,CAAC;AAI9D,KAAK,WAAW,CAAC,CAAC,GAAG,
|
|
1
|
+
{"version":3,"file":"LabelledCheckboxOrRadio.d.ts","sourceRoot":"","sources":["../../../src/includes/form-button-widget/LabelledCheckboxOrRadio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,UAAU,EAAW,cAAc,EAAC,MAAM,KAAK,CAAC;AAI9D,KAAK,WAAW,CAAC,CAAC,GAAG,OAAO,IAAI,KAAK,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AAE,EAAE,CAAC;gBAC7B,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;YACrD,CAAC;QACH,CAAC;QAES,qBAAqB;YAC7B,OAAO,IAAI,CAAC,YAAY,KAAK,EAAE;gBAC7B,CAAC,CAAC,IAAI,CAAA,4BAA4B,IAAI,CAAC,MAAM,SAAS;gBACtD,CAAC,CAAC,IAAI,CAAA,GAAG,OAAO,EAAE,CAAC;QACvB,CAAC;KACF;IA7BC;QADC,QAAQ,EAAE;wDAOV;IAyBH,OAAO,uBACJ,CAAC;AACN,CAAC,CAAC","sourcesContent":["import {html, LitElement, nothing, TemplateResult} from 'lit';\nimport {property} from 'lit/decorators.js';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype Constructor<T = unknown> = new (...args: any[]) => T;\n\nexport declare class LabelledCheckboxOrRadioInterface {\n label: string;\n protected _handleSlotChange(): void;\n protected _renderLabelAttribute(): TemplateResult;\n}\n\nexport const LabelledCheckboxOrRadioMixin = <T extends Constructor<LitElement>>(\n superClass: T\n) => {\n class LabelledCheckboxOrRadio extends superClass {\n @property()\n set label(val: string) {\n this._label = val;\n\n if (this._slottedText === '') {\n this.setAttribute('aria-label', val);\n }\n }\n\n get label(): string {\n return this._label;\n }\n\n private _label = '';\n\n private _slottedText = '';\n\n protected _handleSlotChange(): void {\n this._slottedText = this.textContent ? this.textContent.trim() : '';\n\n if (this._slottedText !== '') {\n this.setAttribute('aria-label', this._slottedText);\n }\n }\n\n protected _renderLabelAttribute(): TemplateResult {\n return this._slottedText === ''\n ? html`<span class=\"label-attr\">${this._label}</span>`\n : html`${nothing}`;\n }\n }\n\n return LabelledCheckboxOrRadio as unknown as Constructor<LabelledCheckboxOrRadioInterface> &\n T;\n};\n"]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/** A testing utility that measures an element's position and clicks on it. */
|
|
2
|
+
export declare function clickOnElement(
|
|
3
|
+
/** The element to click */
|
|
4
|
+
el: Element,
|
|
5
|
+
/** The location of the element to click */
|
|
6
|
+
position?: 'top' | 'right' | 'bottom' | 'left' | 'center',
|
|
7
|
+
/** The horizontal offset to apply to the position when clicking */
|
|
8
|
+
offsetX?: number,
|
|
9
|
+
/** The vertical offset to apply to the position when clicking */
|
|
10
|
+
offsetY?: number): Promise<void>;
|
|
11
|
+
/** A testing utility that moves the mouse onto an element. */
|
|
12
|
+
export declare function moveMouseOnElement(
|
|
13
|
+
/** The element to click */
|
|
14
|
+
el: Element,
|
|
15
|
+
/** The location of the element to click */
|
|
16
|
+
position?: 'top' | 'right' | 'bottom' | 'left' | 'center',
|
|
17
|
+
/** The horizontal offset to apply to the position when clicking */
|
|
18
|
+
offsetX?: number,
|
|
19
|
+
/** The vertical offset to apply to the position when clicking */
|
|
20
|
+
offsetY?: number): Promise<void>;
|
|
21
|
+
/** A testing utility that drags an element with the mouse. */
|
|
22
|
+
export declare function dragElement(
|
|
23
|
+
/** The element to drag */
|
|
24
|
+
el: Element,
|
|
25
|
+
/** The horizontal distance to drag in pixels */
|
|
26
|
+
deltaX?: number,
|
|
27
|
+
/** The vertical distance to drag in pixels */
|
|
28
|
+
deltaY?: number, callbacks?: {
|
|
29
|
+
afterMouseDown?: () => void | Promise<void>;
|
|
30
|
+
afterMouseMove?: () => void | Promise<void>;
|
|
31
|
+
}): Promise<void>;
|
|
32
|
+
//# sourceMappingURL=test-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-helpers.d.ts","sourceRoot":"","sources":["../../src/includes/test-helpers.ts"],"names":[],"mappings":"AA2CA,8EAA8E;AAC9E,wBAAsB,cAAc;AAClC,2BAA2B;AAC3B,EAAE,EAAE,OAAO;AACX,2CAA2C;AAC3C,QAAQ,GAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAmB;AACnE,mEAAmE;AACnE,OAAO,SAAI;AACX,iEAAiE;AACjE,OAAO,SAAI,iBAUZ;AAED,8DAA8D;AAC9D,wBAAsB,kBAAkB;AACtC,2BAA2B;AAC3B,EAAE,EAAE,OAAO;AACX,2CAA2C;AAC3C,QAAQ,GAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAmB;AACnE,mEAAmE;AACnE,OAAO,SAAI;AACX,iEAAiE;AACjE,OAAO,SAAI,iBAUZ;AAED,8DAA8D;AAC9D,wBAAsB,WAAW;AAC/B,0BAA0B;AAC1B,EAAE,EAAE,OAAO;AACX,gDAAgD;AAChD,MAAM,SAAI;AACV,8CAA8C;AAC9C,MAAM,SAAI,EACV,SAAS,GAAE;IACT,cAAc,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5C,cAAc,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACxC,GACL,OAAO,CAAC,IAAI,CAAC,CAYf"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// Borrowed from Shoelace
|
|
2
|
+
import { sendMouse } from '@web/test-runner-commands';
|
|
3
|
+
function determineMousePosition(el, position, offsetX, offsetY) {
|
|
4
|
+
const { x, y, width, height } = el.getBoundingClientRect();
|
|
5
|
+
const centerX = Math.floor(x + window.scrollX + width / 2);
|
|
6
|
+
const centerY = Math.floor(y + window.scrollY + height / 2);
|
|
7
|
+
let clickX;
|
|
8
|
+
let clickY;
|
|
9
|
+
switch (position) {
|
|
10
|
+
case 'top':
|
|
11
|
+
clickX = centerX;
|
|
12
|
+
clickY = y;
|
|
13
|
+
break;
|
|
14
|
+
case 'right':
|
|
15
|
+
clickX = x + width - 1;
|
|
16
|
+
clickY = centerY;
|
|
17
|
+
break;
|
|
18
|
+
case 'bottom':
|
|
19
|
+
clickX = centerX;
|
|
20
|
+
clickY = y + height - 1;
|
|
21
|
+
break;
|
|
22
|
+
case 'left':
|
|
23
|
+
clickX = x;
|
|
24
|
+
clickY = centerY;
|
|
25
|
+
break;
|
|
26
|
+
default:
|
|
27
|
+
clickX = centerX;
|
|
28
|
+
clickY = centerY;
|
|
29
|
+
}
|
|
30
|
+
clickX += offsetX;
|
|
31
|
+
clickY += offsetY;
|
|
32
|
+
return { clickX, clickY };
|
|
33
|
+
}
|
|
34
|
+
/** A testing utility that measures an element's position and clicks on it. */
|
|
35
|
+
export async function clickOnElement(
|
|
36
|
+
/** The element to click */
|
|
37
|
+
el,
|
|
38
|
+
/** The location of the element to click */
|
|
39
|
+
position = 'center',
|
|
40
|
+
/** The horizontal offset to apply to the position when clicking */
|
|
41
|
+
offsetX = 0,
|
|
42
|
+
/** The vertical offset to apply to the position when clicking */
|
|
43
|
+
offsetY = 0) {
|
|
44
|
+
const { clickX, clickY } = determineMousePosition(el, position, offsetX, offsetY);
|
|
45
|
+
await sendMouse({ type: 'click', position: [clickX, clickY] });
|
|
46
|
+
}
|
|
47
|
+
/** A testing utility that moves the mouse onto an element. */
|
|
48
|
+
export async function moveMouseOnElement(
|
|
49
|
+
/** The element to click */
|
|
50
|
+
el,
|
|
51
|
+
/** The location of the element to click */
|
|
52
|
+
position = 'center',
|
|
53
|
+
/** The horizontal offset to apply to the position when clicking */
|
|
54
|
+
offsetX = 0,
|
|
55
|
+
/** The vertical offset to apply to the position when clicking */
|
|
56
|
+
offsetY = 0) {
|
|
57
|
+
const { clickX, clickY } = determineMousePosition(el, position, offsetX, offsetY);
|
|
58
|
+
await sendMouse({ type: 'move', position: [clickX, clickY] });
|
|
59
|
+
}
|
|
60
|
+
/** A testing utility that drags an element with the mouse. */
|
|
61
|
+
export async function dragElement(
|
|
62
|
+
/** The element to drag */
|
|
63
|
+
el,
|
|
64
|
+
/** The horizontal distance to drag in pixels */
|
|
65
|
+
deltaX = 0,
|
|
66
|
+
/** The vertical distance to drag in pixels */
|
|
67
|
+
deltaY = 0, callbacks = {}) {
|
|
68
|
+
await moveMouseOnElement(el);
|
|
69
|
+
await sendMouse({ type: 'down' });
|
|
70
|
+
await callbacks.afterMouseDown?.();
|
|
71
|
+
const { clickX, clickY } = determineMousePosition(el, 'center', deltaX, deltaY);
|
|
72
|
+
await sendMouse({ type: 'move', position: [clickX, clickY] });
|
|
73
|
+
await callbacks.afterMouseMove?.();
|
|
74
|
+
await sendMouse({ type: 'up' });
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=test-helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-helpers.js","sourceRoot":"","sources":["../../src/includes/test-helpers.ts"],"names":[],"mappings":"AAAA,yBAAyB;AAEzB,OAAO,EAAC,SAAS,EAAC,MAAM,2BAA2B,CAAC;AAEpD,SAAS,sBAAsB,CAC7B,EAAW,EACX,QAAgB,EAChB,OAAe,EACf,OAAe;IAEf,MAAM,EAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAC,GAAG,EAAE,CAAC,qBAAqB,EAAE,CAAC;IACzD,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,OAAO,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC;IAC3D,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,OAAO,GAAG,MAAM,GAAG,CAAC,CAAC,CAAC;IAC5D,IAAI,MAAc,CAAC;IACnB,IAAI,MAAc,CAAC;IAEnB,QAAQ,QAAQ,EAAE,CAAC;QACjB,KAAK,KAAK;YACR,MAAM,GAAG,OAAO,CAAC;YACjB,MAAM,GAAG,CAAC,CAAC;YACX,MAAM;QACR,KAAK,OAAO;YACV,MAAM,GAAG,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC;YACvB,MAAM,GAAG,OAAO,CAAC;YACjB,MAAM;QACR,KAAK,QAAQ;YACX,MAAM,GAAG,OAAO,CAAC;YACjB,MAAM,GAAG,CAAC,GAAG,MAAM,GAAG,CAAC,CAAC;YACxB,MAAM;QACR,KAAK,MAAM;YACT,MAAM,GAAG,CAA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,8CAA8C;AAC9C,MAAM,GAAG,CAAC,EACV,YAGI,EAAE;IAEN,MAAM,kBAAkB,CAAC,EAAE,CAAC,CAAC;IAC7B,MAAM,SAAS,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC,CAAC;IAEhC,MAAM,SAAS,CAAC,cAAc,EAAE,EAAE,CAAC;IAEnC,MAAM,EAAC,MAAM,EAAE,MAAM,EAAC,GAAG,sBAAsB,CAAC,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9E,MAAM,SAAS,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAC,CAAC,CAAC;IAE5D,MAAM,SAAS,CAAC,cAAc,EAAE,EAAE,CAAC;IAEnC,MAAM,SAAS,CAAC,EAAC,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC;AAChC,CAAC","sourcesContent":["// Borrowed from Shoelace\n\nimport {sendMouse} from '@web/test-runner-commands';\n\nfunction determineMousePosition(\n el: Element,\n position: string,\n offsetX: number,\n offsetY: number\n) {\n const {x, y, width, height} = el.getBoundingClientRect();\n const centerX = Math.floor(x + window.scrollX + width / 2);\n const centerY = Math.floor(y + window.scrollY + height / 2);\n let clickX: number;\n let clickY: number;\n\n switch (position) {\n case 'top':\n clickX = centerX;\n clickY = y;\n break;\n case 'right':\n clickX = x + width - 1;\n clickY = centerY;\n break;\n case 'bottom':\n clickX = centerX;\n clickY = y + height - 1;\n break;\n case 'left':\n clickX = x;\n clickY = centerY;\n break;\n default:\n clickX = centerX;\n clickY = centerY;\n }\n\n clickX += offsetX;\n clickY += offsetY;\n return {clickX, clickY};\n}\n\n/** A testing utility that measures an element's position and clicks on it. */\nexport async function clickOnElement(\n /** The element to click */\n el: Element,\n /** The location of the element to click */\n position: 'top' | 'right' | 'bottom' | 'left' | 'center' = 'center',\n /** The horizontal offset to apply to the position when clicking */\n offsetX = 0,\n /** The vertical offset to apply to the position when clicking */\n offsetY = 0\n) {\n const {clickX, clickY} = determineMousePosition(\n el,\n position,\n offsetX,\n offsetY\n );\n\n await sendMouse({type: 'click', position: [clickX, clickY]});\n}\n\n/** A testing utility that moves the mouse onto an element. */\nexport async function moveMouseOnElement(\n /** The element to click */\n el: Element,\n /** The location of the element to click */\n position: 'top' | 'right' | 'bottom' | 'left' | 'center' = 'center',\n /** The horizontal offset to apply to the position when clicking */\n offsetX = 0,\n /** The vertical offset to apply to the position when clicking */\n offsetY = 0\n) {\n const {clickX, clickY} = determineMousePosition(\n el,\n position,\n offsetX,\n offsetY\n );\n\n await sendMouse({type: 'move', position: [clickX, clickY]});\n}\n\n/** A testing utility that drags an element with the mouse. */\nexport async function dragElement(\n /** The element to drag */\n el: Element,\n /** The horizontal distance to drag in pixels */\n deltaX = 0,\n /** The vertical distance to drag in pixels */\n deltaY = 0,\n callbacks: {\n afterMouseDown?: () => void | Promise<void>;\n afterMouseMove?: () => void | Promise<void>;\n } = {}\n): Promise<void> {\n await moveMouseOnElement(el);\n await sendMouse({type: 'down'});\n\n await callbacks.afterMouseDown?.();\n\n const {clickX, clickY} = determineMousePosition(el, 'center', deltaX, deltaY);\n await sendMouse({type: 'move', position: [clickX, clickY]});\n\n await callbacks.afterMouseMove?.();\n\n await sendMouse({type: 'up'});\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/includes/vscode-select/styles.ts"],"names":[],"mappings":";AAGA,
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/includes/vscode-select/styles.ts"],"names":[],"mappings":";AAGA,wBAqVE"}
|
|
@@ -43,9 +43,16 @@ export default [
|
|
|
43
43
|
|
|
44
44
|
.select-face {
|
|
45
45
|
cursor: pointer;
|
|
46
|
+
display: block;
|
|
46
47
|
padding: 3px 4px;
|
|
47
48
|
}
|
|
48
49
|
|
|
50
|
+
.select-face .text {
|
|
51
|
+
display: block;
|
|
52
|
+
height: 18px;
|
|
53
|
+
overflow: hidden;
|
|
54
|
+
}
|
|
55
|
+
|
|
49
56
|
.select-face.multiselect {
|
|
50
57
|
padding: 0;
|
|
51
58
|
}
|
|
@@ -73,11 +80,6 @@ export default [
|
|
|
73
80
|
display: flex;
|
|
74
81
|
}
|
|
75
82
|
|
|
76
|
-
.empty-label-placeholder {
|
|
77
|
-
display: block;
|
|
78
|
-
height: 16px;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
83
|
:host(:focus) .select-face,
|
|
82
84
|
:host(:focus) .combobox-face,
|
|
83
85
|
:host([focused]) .select-face,
|
|
@@ -141,10 +143,6 @@ export default [
|
|
|
141
143
|
width: 100%;
|
|
142
144
|
}
|
|
143
145
|
|
|
144
|
-
.select-face:empty:before {
|
|
145
|
-
content: '\\00a0';
|
|
146
|
-
}
|
|
147
|
-
|
|
148
146
|
.dropdown {
|
|
149
147
|
background-color: var(--vscode-settings-dropdownBackground);
|
|
150
148
|
border-color: var(--vscode-settings-dropdownListBorder);
|
|
@@ -160,7 +158,7 @@ export default [
|
|
|
160
158
|
z-index: var(--dropdown-z-index, 2);
|
|
161
159
|
}
|
|
162
160
|
|
|
163
|
-
:host([position=
|
|
161
|
+
:host([position='above']) .dropdown {
|
|
164
162
|
border-radius: 3px 3px 0 0;
|
|
165
163
|
bottom: 26px;
|
|
166
164
|
padding-bottom: 0;
|
|
@@ -251,13 +249,13 @@ export default [
|
|
|
251
249
|
|
|
252
250
|
.dropdown.multiple .option.selected {
|
|
253
251
|
background-color: var(--vscode-list-hoverBackground);
|
|
254
|
-
border-color:
|
|
252
|
+
border-color: var(--vscode-list-hoverBackground);
|
|
255
253
|
}
|
|
256
254
|
|
|
257
255
|
.dropdown.multiple .option.selected.active {
|
|
258
256
|
background-color: var(--vscode-list-activeSelectionBackground);
|
|
259
257
|
color: var(--vscode-list-activeSelectionForeground);
|
|
260
|
-
border-color:
|
|
258
|
+
border-color: var(--vscode-list-activeSelectionBackground);
|
|
261
259
|
}
|
|
262
260
|
|
|
263
261
|
.checkbox-icon {
|
|
@@ -336,10 +334,10 @@ export default [
|
|
|
336
334
|
font-weight: var(--vscode-font-weight);
|
|
337
335
|
line-height: 1.3;
|
|
338
336
|
padding: 6px 4px;
|
|
339
|
-
word-wrap:break-word;
|
|
337
|
+
word-wrap: break-word;
|
|
340
338
|
}
|
|
341
339
|
|
|
342
|
-
:host([position=
|
|
340
|
+
:host([position='above']) .description {
|
|
343
341
|
border-width: 0 0 1px;
|
|
344
342
|
}
|
|
345
343
|
`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/includes/vscode-select/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AACxB,OAAO,aAAa,MAAM,sBAAsB,CAAC;AAEjD,eAAe;IACb,aAAa;IACb,GAAG,CAAA
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/includes/vscode-select/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AACxB,OAAO,aAAa,MAAM,sBAAsB,CAAC;AAEjD,eAAe;IACb,aAAa;IACb,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkVF;CACF,CAAC","sourcesContent":["import {css} from 'lit';\nimport defaultStyles from '../default.styles.js';\n\nexport default [\n defaultStyles,\n css`\n :host {\n display: inline-block;\n max-width: 100%;\n outline: none;\n position: relative;\n width: 320px;\n }\n\n .main-slot {\n display: none;\n }\n\n .select-face,\n .combobox-face {\n background-color: var(--vscode-settings-dropdownBackground);\n border-color: var(--vscode-settings-dropdownBorder);\n border-radius: 2px;\n border-style: solid;\n border-width: 1px;\n box-sizing: border-box;\n color: var(--vscode-settings-dropdownForeground);\n font-family: var(--vscode-font-family);\n font-size: var(--vscode-font-size);\n font-weight: var(--vscode-font-weight);\n line-height: 18px;\n position: relative;\n user-select: none;\n width: 100%;\n }\n\n :host([invalid]) .select-face,\n :host(:invalid) .select-face,\n :host([invalid]) .combobox-face,\n :host(:invalid) .combobox-face {\n background-color: var(--vscode-inputValidation-errorBackground);\n border-color: var(--vscode-inputValidation-errorBorder, #be1100);\n }\n\n .select-face {\n cursor: pointer;\n display: block;\n padding: 3px 4px;\n }\n\n .select-face .text {\n display: block;\n height: 18px;\n overflow: hidden;\n }\n\n .select-face.multiselect {\n padding: 0;\n }\n\n .select-face-badge {\n background-color: var(--vscode-badge-background);\n border-radius: 2px;\n color: var(--vscode-badge-foreground);\n display: inline-block;\n flex-shrink: 0;\n font-size: 11px;\n line-height: 16px;\n margin: 2px;\n padding: 2px 3px;\n text-transform: uppercase;\n white-space: nowrap;\n }\n\n .select-face-badge.no-item {\n background-color: transparent;\n color: inherit;\n }\n\n .combobox-face {\n display: flex;\n }\n\n :host(:focus) .select-face,\n :host(:focus) .combobox-face,\n :host([focused]) .select-face,\n :host([focused]) .combobox-face {\n border-color: var(--vscode-focusBorder);\n outline: none;\n }\n\n .combobox-input {\n background-color: transparent;\n box-sizing: border-box;\n border: 0;\n color: var(--vscode-foreground);\n display: block;\n font-family: var(--vscode-font-family);\n font-size: var(--vscode-font-size);\n line-height: 16px;\n padding: 4px;\n width: 100%;\n }\n\n .combobox-input:focus {\n outline: none;\n }\n\n .combobox-button {\n background-color: transparent;\n border: 0;\n color: var(--vscode-foreground);\n cursor: pointer;\n flex-shrink: 0;\n height: 24px;\n margin: 0;\n padding: 0;\n width: 30px;\n }\n\n .combobox-button:focus,\n .combobox-button:hover {\n background-color: var(--vscode-list-hoverBackground);\n }\n\n .combobox-button:focus {\n outline: 0;\n }\n\n .icon {\n color: var(--vscode-foreground);\n display: block;\n height: 14px;\n pointer-events: none;\n position: absolute;\n right: 8px;\n top: 5px;\n width: 14px;\n }\n\n .icon svg {\n color: var(--vscode-foreground);\n height: 100%;\n width: 100%;\n }\n\n .dropdown {\n background-color: var(--vscode-settings-dropdownBackground);\n border-color: var(--vscode-settings-dropdownListBorder);\n border-radius: 0 0 3px 3px;\n border-style: solid;\n border-width: 1px;\n box-sizing: border-box;\n left: 0;\n padding-bottom: 2px;\n position: absolute;\n top: 100%;\n width: 100%;\n z-index: var(--dropdown-z-index, 2);\n }\n\n :host([position='above']) .dropdown {\n border-radius: 3px 3px 0 0;\n bottom: 26px;\n padding-bottom: 0;\n padding-top: 2px;\n top: auto;\n }\n\n :host(:focus) .dropdown,\n :host([focused]) .dropdown {\n border-color: var(--vscode-focusBorder);\n }\n\n .options {\n box-sizing: border-box;\n cursor: pointer;\n list-style: none;\n margin: 0;\n max-height: 222px;\n overflow: auto;\n padding: 1px;\n }\n\n .option {\n align-items: center;\n color: var(--vscode-foreground);\n cursor: pointer;\n display: flex;\n font-family: var(--vscode-font-family);\n font-size: var(--vscode-font-size);\n font-weight: var(--vscode-font-weight);\n line-height: 18px;\n min-height: calc(var(--vscode-font-size) * 1.3);\n padding: 1px 3px;\n user-select: none;\n border-width: 1px;\n border-style: solid;\n border-color: transparent;\n }\n\n .option b {\n color: var(--vscode-list-highlightForeground);\n }\n\n .option.active b {\n color: var(--vscode-list-focusHighlightForeground);\n }\n\n .option:hover {\n background-color: var(--vscode-list-hoverBackground);\n color: var(--vscode-list-hoverForeground);\n }\n\n :host-context(body[data-vscode-theme-kind='vscode-high-contrast'])\n .option:hover,\n :host-context(body[data-vscode-theme-kind='vscode-high-contrast-light'])\n .option:hover {\n border-style: dotted;\n border-color: var(--vscode-list-focusOutline);\n }\n\n .option.disabled {\n cursor: not-allowed;\n opacity: 0.4;\n }\n\n .option.active,\n .option.active:hover {\n background-color: var(--vscode-list-activeSelectionBackground);\n color: var(--vscode-list-activeSelectionForeground);\n border-color: var(--vscode-list-activeSelectionBackground);\n border-style: solid;\n border-width: 1px;\n }\n\n :host-context(body[data-vscode-theme-kind='vscode-high-contrast'])\n .option.active,\n :host-context(body[data-vscode-theme-kind='vscode-high-contrast-light'])\n .option.active:hover {\n border-color: var(--vscode-list-focusOutline);\n border-style: dashed;\n }\n\n .option-label {\n display: block;\n pointer-events: none;\n width: 100%;\n }\n\n .dropdown.multiple .option.selected {\n background-color: var(--vscode-list-hoverBackground);\n border-color: var(--vscode-list-hoverBackground);\n }\n\n .dropdown.multiple .option.selected.active {\n background-color: var(--vscode-list-activeSelectionBackground);\n color: var(--vscode-list-activeSelectionForeground);\n border-color: var(--vscode-list-activeSelectionBackground);\n }\n\n .checkbox-icon {\n background-color: var(--vscode-settings-checkboxBackground);\n border: 1px solid currentColor;\n border-radius: 2px;\n box-sizing: border-box;\n height: 14px;\n margin-right: 5px;\n overflow: hidden;\n position: relative;\n width: 14px;\n }\n\n .checkbox-icon.checked:before,\n .checkbox-icon.checked:after {\n content: '';\n display: block;\n height: 5px;\n position: absolute;\n transform: rotate(-45deg);\n width: 10px;\n }\n\n .checkbox-icon.checked:before {\n background-color: var(--vscode-foreground);\n left: 1px;\n top: 2.5px;\n }\n\n .checkbox-icon.checked:after {\n background-color: var(--vscode-settings-checkboxBackground);\n left: 1px;\n top: -0.5px;\n }\n\n .dropdown-controls {\n display: flex;\n justify-content: flex-end;\n padding: 4px;\n }\n\n .dropdown-controls :not(:last-child) {\n margin-right: 4px;\n }\n\n .action-icon {\n align-items: center;\n background-color: transparent;\n border: 0;\n color: var(--vscode-foreground);\n cursor: pointer;\n display: flex;\n height: 24px;\n justify-content: center;\n padding: 0;\n width: 24px;\n }\n\n .action-icon:focus {\n outline: none;\n }\n\n .action-icon:focus-visible {\n outline: 1px solid var(--vscode-focusBorder);\n outline-offset: -1px;\n }\n\n .description {\n border-color: var(--vscode-settings-dropdownBorder);\n border-style: solid;\n border-width: 1px 0 0;\n color: var(--vscode-foreground);\n font-family: var(--vscode-font-family);\n font-size: var(--vscode-font-size);\n font-weight: var(--vscode-font-weight);\n line-height: 1.3;\n padding: 6px 4px;\n word-wrap: break-word;\n }\n\n :host([position='above']) .description {\n border-width: 0 0 1px;\n }\n `,\n];\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TemplateResult } from 'lit';
|
|
2
|
-
import '../../vscode-button';
|
|
3
|
-
import '../../vscode-option';
|
|
2
|
+
import '../../vscode-button/index.js';
|
|
3
|
+
import '../../vscode-option/index.js';
|
|
4
4
|
import type { InternalOption, Option, SearchMethod } from './types.js';
|
|
5
5
|
import { VscElement } from '../VscElement.js';
|
|
6
6
|
interface OptionListStat {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vscode-select-base.d.ts","sourceRoot":"","sources":["../../../src/includes/vscode-select/vscode-select-base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,cAAc,EAAC,MAAM,KAAK,CAAC;AAGlD,OAAO,
|
|
1
|
+
{"version":3,"file":"vscode-select-base.d.ts","sourceRoot":"","sources":["../../../src/includes/vscode-select/vscode-select-base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,cAAc,EAAC,MAAM,KAAK,CAAC;AAGlD,OAAO,8BAA8B,CAAC;AACtC,OAAO,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EAAC,cAAc,EAAE,MAAM,EAAE,YAAY,EAAC,MAAM,YAAY,CAAC;AAErE,OAAO,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAE5C,UAAU,cAAc;IACtB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,MAAM,EAAE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;IAIvC,SAAS,CAAC,cAAc,IAAI,cAAc,GAAG,cAAc,EAAE;IAI7D,OAAO,CAAC,kBAAkB;IAY1B,SAAS,CAAC,iBAAiB,IAAI,cAAc;IAI7C,SAAS,CAAC,mBAAmB,IAAI,cAAc;IAI/C,SAAS,CAAC,uBAAuB,IAAI,cAAc;IAInD,OAAO,CAAC,eAAe;IAevB,MAAM,IAAI,cAAc;CAOzB"}
|
|
@@ -7,8 +7,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { html, nothing } from 'lit';
|
|
8
8
|
import { property, query, queryAssignedElements, state } from 'lit/decorators.js';
|
|
9
9
|
import { classMap } from 'lit/directives/class-map.js';
|
|
10
|
-
import '../../vscode-button';
|
|
11
|
-
import '../../vscode-option';
|
|
10
|
+
import '../../vscode-button/index.js';
|
|
11
|
+
import '../../vscode-option/index.js';
|
|
12
12
|
import { filterOptionsByPattern } from './helpers.js';
|
|
13
13
|
import { VscElement } from '../VscElement.js';
|
|
14
14
|
const VISIBLE_OPTS = 10;
|
|
@@ -420,9 +420,9 @@ export class VscodeSelectBase extends VscElement {
|
|
|
420
420
|
});
|
|
421
421
|
return html `
|
|
422
422
|
<div class="${classes}">
|
|
423
|
-
${this.position ===
|
|
423
|
+
${this.position === 'above' ? this._renderDescription() : nothing}
|
|
424
424
|
${this._renderOptions()} ${this._renderDropdownControls()}
|
|
425
|
-
${this.position ===
|
|
425
|
+
${this.position === 'below' ? this._renderDescription() : nothing}
|
|
426
426
|
</div>
|
|
427
427
|
`;
|
|
428
428
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vscode-select-base.js","sourceRoot":"","sources":["../../../src/includes/vscode-select/vscode-select-base.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAC,IAAI,EAAE,OAAO,EAAiB,MAAM,KAAK,CAAC;AAClD,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAE,qBAAqB,EAAE,KAAK,EAAC,MAAM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;AAGtB;IADT,KAAK,EAAE;kDACkC;AAGhC;IADT,KAAK,EAAE;gDACc;AAGZ;IADT,KAAK,EAAE;iDACyB;AAGvB;IADT,KAAK,EAAE;wDACqB;AAGrB;IADP,KAAK,CAAC,UAAU,CAAC;sDACsB","sourcesContent":["import {html, nothing, TemplateResult} from 'lit';\nimport {property, query, queryAssignedElements, state} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport '../../vscode-button';\nimport '../../vscode-option';\nimport {VscodeOption} from '../../vscode-option/index.js';\nimport type {InternalOption, Option, SearchMethod} from './types.js';\nimport {filterOptionsByPattern} from './helpers.js';\nimport {VscElement} from '../VscElement.js';\n\ninterface OptionListStat {\n selectedIndexes: number[];\n values: string[];\n}\n\nconst VISIBLE_OPTS = 10;\nconst OPT_HEIGHT = 22;\nconst LIST_HEIGHT = VISIBLE_OPTS + OPT_HEIGHT + 2;\n\n/**\n * @cssprop --dropdown-z-index - workaround for dropdown z-index issues\n */\nexport class VscodeSelectBase extends VscElement {\n /** @internal */\n @property({type: String, reflect: true, attribute: 'aria-expanded'})\n ariaExpanded = 'false';\n\n @property({type: Boolean, reflect: true})\n combobox = false;\n\n @property({type: Boolean, reflect: true})\n set disabled(newState: boolean) {\n this._disabled = newState;\n this.ariaDisabled = newState ? 'true' : 'false';\n\n if (newState === true) {\n this._originalTabIndex = this.tabIndex;\n this.tabIndex = -1;\n } else {\n this.tabIndex = this._originalTabIndex ?? 0;\n this._originalTabIndex = undefined;\n }\n\n this.requestUpdate();\n }\n\n get disabled(): boolean {\n return this._disabled;\n }\n\n /**\n * Sets the invalid state manually.\n */\n @property({type: Boolean, reflect: true})\n invalid = false;\n\n /**\n * Search method in the filtered list within the combobox mode.\n *\n * - contains - The list item includes the searched pattern at any position.\n * - fuzzy - The list item contains the letters of the search pattern in the same order, but at any position.\n * - startsWith - The search pattern matches the beginning of the searched text.\n * - startsWithPerTerm - The search pattern matches the beginning of any word in the searched text.\n *\n * @default 'fuzzy'\n */\n @property()\n set filter(val: 'contains' | 'fuzzy' | 'startsWith' | 'startsWithPerTerm') {\n const validValues: SearchMethod[] = [\n 'contains',\n 'fuzzy',\n 'startsWith',\n 'startsWithPerTerm',\n ];\n\n if (validValues.includes(val as SearchMethod)) {\n this._filter = val as SearchMethod;\n } else {\n this._filter = 'fuzzy';\n console.warn(\n `[VSCode Webview Elements] Invalid filter: \"${val}\", fallback to default. Valid values are: \"contains\", \"fuzzy\", \"startsWith\", \"startsWithPerm\".`,\n this\n );\n }\n }\n get filter(): 'contains' | 'fuzzy' | 'startsWith' | 'startsWithPerTerm' {\n return this._filter;\n }\n\n @property({type: Boolean, reflect: true})\n focused = false;\n\n /**\n * @attr [options=[]]\n * @type {Option[]}\n */\n @property({type: Array})\n set options(opts: Option[]) {\n this._options = opts.map((op, index) => ({...op, index}));\n }\n get options(): Option[] {\n return this._options.map(\n ({label, value, description, selected, disabled}) => ({\n label,\n value,\n description,\n selected,\n disabled,\n })\n );\n }\n\n /**\n * Position of the options list when visible.\n */\n @property({reflect: true})\n position: 'above' | 'below' = 'below';\n\n /** @internal */\n @property({type: Number, attribute: true, reflect: true})\n tabIndex = 0;\n\n @queryAssignedElements({\n flatten: true,\n selector: 'vscode-option',\n })\n private _assignedOptions!: VscodeOption[];\n\n connectedCallback(): void {\n super.connectedCallback();\n this.addEventListener('keydown', this._onComponentKeyDown);\n this.addEventListener('focus', this._onComponentFocus);\n this.addEventListener('blur', this._onComponentBlur);\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.removeEventListener('keydown', this._onComponentKeyDown);\n this.removeEventListener('focus', this._onComponentFocus);\n this.removeEventListener('blur', this._onComponentBlur);\n }\n\n @state()\n protected _activeIndex = -1;\n\n @state()\n protected _currentDescription = '';\n\n @state()\n protected _filter: SearchMethod = 'fuzzy';\n\n @state()\n protected get _filteredOptions(): InternalOption[] {\n if (!this.combobox || this._filterPattern === '') {\n return this._options;\n }\n\n return filterOptionsByPattern(\n this._options,\n this._filterPattern,\n this._filter\n );\n }\n\n @state()\n protected _filterPattern = '';\n\n @state()\n protected _selectedIndex = -1;\n\n @state()\n protected _selectedIndexes: number[] = [];\n\n @state()\n protected _showDropdown = false;\n\n @state()\n protected _options: InternalOption[] = [];\n\n @state()\n protected _value = '';\n\n @state()\n protected _values: string[] = [];\n\n @state()\n protected _listScrollTop = 0;\n\n @query('.options')\n private _listElement!: HTMLUListElement;\n\n /** @internal */\n protected _multiple = false;\n\n /**\n * @internal\n * Quick-searchable map for searching a value in the options list.\n * Keys are the options values, values are the option indexes.\n */\n protected _valueOptionIndexMap: {[key: string]: number} = {};\n\n private _isHoverForbidden = false;\n private _disabled = false;\n private _originalTabIndex: number | undefined = undefined;\n\n protected get _currentOptions(): InternalOption[] {\n return this.combobox ? this._filteredOptions : this._options;\n }\n\n protected _addOptionsFromSlottedElements(): OptionListStat {\n const options: InternalOption[] = [];\n let nextIndex = 0;\n const optionElements = this._assignedOptions ?? [];\n const optionsListStat: OptionListStat = {\n selectedIndexes: [],\n values: [],\n };\n this._valueOptionIndexMap = {};\n\n optionElements.forEach((el) => {\n const {innerText, description, disabled} = el;\n const value = (el.value ?? '') ? el.value : innerText.trim();\n const selected = el.selected ?? false;\n const op: InternalOption = {\n label: innerText.trim(),\n value,\n description,\n selected,\n index: nextIndex,\n disabled,\n };\n\n nextIndex = options.push(op);\n\n if (selected) {\n optionsListStat.selectedIndexes.push(options.length - 1);\n optionsListStat.values.push(value);\n }\n\n this._valueOptionIndexMap[op.value] = op.index;\n });\n\n this._options = options;\n\n return optionsListStat;\n }\n\n protected async _toggleDropdown(visible: boolean): Promise<void> {\n this._showDropdown = visible;\n this.ariaExpanded = String(visible);\n\n if (visible && !this._multiple && !this.combobox) {\n this._activeIndex = this._selectedIndex;\n\n if (this._activeIndex > VISIBLE_OPTS - 1) {\n await this.updateComplete;\n\n this._listElement.scrollTop = Math.floor(\n this._activeIndex * OPT_HEIGHT\n );\n }\n }\n\n if (visible) {\n window.addEventListener('click', this._onClickOutside);\n } else {\n window.removeEventListener('click', this._onClickOutside);\n }\n }\n\n protected _dispatchChangeEvent(): void {\n if (!this._multiple) {\n /** @deprecated */\n this.dispatchEvent(\n new CustomEvent('vsc-change', {\n detail: {\n selectedIndex: this._selectedIndex,\n value: this._value,\n },\n })\n );\n } else {\n /** @deprecated */\n this.dispatchEvent(\n new CustomEvent('vsc-change', {\n detail: {\n selectedIndexes: this._selectedIndexes,\n value: this._values,\n },\n })\n );\n }\n this.dispatchEvent(new Event('change'));\n }\n\n protected _onFaceClick(): void {\n this._toggleDropdown(!this._showDropdown);\n\n if (this._multiple) {\n this._activeIndex = 0;\n }\n }\n\n private _onClickOutside = (event: MouseEvent): void => {\n const path = event.composedPath();\n const found = path.findIndex((et) => et === this);\n\n if (found === -1) {\n this._toggleDropdown(false);\n window.removeEventListener('click', this._onClickOutside);\n }\n }\n\n private _onMouseMove = () => {\n this._isHoverForbidden = false;\n window.removeEventListener('mousemove', this._onMouseMove);\n }\n\n private _toggleComboboxDropdown() {\n this._filterPattern = '';\n this._toggleDropdown(!this._showDropdown);\n\n if (this._multiple) {\n this._activeIndex = -1;\n }\n }\n\n protected _onComboboxButtonClick(): void {\n this._toggleComboboxDropdown();\n }\n\n protected _onComboboxButtonKeyDown(ev: KeyboardEvent): void {\n if (ev.key === 'Enter') {\n this._toggleComboboxDropdown();\n }\n }\n\n protected _onOptionMouseOver(ev: MouseEvent): void {\n if (this._isHoverForbidden) {\n return;\n }\n\n const el = ev.target as HTMLElement;\n\n if (!el.matches('.option')) {\n return;\n }\n\n this._activeIndex = Number(\n this.combobox ? el.dataset.filteredIndex : el.dataset.index\n );\n }\n\n protected _onEnterKeyDown(): void {\n const list = this.combobox ? this._filteredOptions : this._options;\n const showDropdownNext = !this._showDropdown;\n\n this._toggleDropdown(showDropdownNext);\n\n if (\n !this._multiple &&\n !showDropdownNext &&\n this._selectedIndex !== this._activeIndex\n ) {\n this._selectedIndex = list[this._activeIndex].index;\n this._value = this._options[this._selectedIndex].value;\n this._dispatchChangeEvent();\n }\n\n if (this.combobox) {\n if (!this._multiple && !showDropdownNext) {\n this._selectedIndex = this._filteredOptions[this._activeIndex].index;\n }\n\n if (!this._multiple && showDropdownNext) {\n this.updateComplete.then(() => {\n this._scrollActiveElementToTop();\n });\n }\n }\n\n if (this._multiple && showDropdownNext) {\n this._activeIndex = 0;\n }\n }\n\n private _onSpaceKeyDown() {\n if (!this._showDropdown) {\n this._toggleDropdown(true);\n return;\n }\n\n if (this._showDropdown && this._multiple && this._activeIndex > -1) {\n const opts = this.combobox ? this._filteredOptions : this._options;\n const {selected} = opts[this._activeIndex];\n\n opts[this._activeIndex].selected = !selected;\n this._selectedIndexes = [];\n\n opts.forEach(({index, selected}) => {\n if (selected) {\n this._selectedIndexes.push(index);\n }\n });\n }\n }\n\n private _scrollActiveElementToTop() {\n this._listElement.scrollTop = Math.floor(this._activeIndex * OPT_HEIGHT);\n }\n\n private async _adjustOptionListScrollPos(direction: 'down' | 'up') {\n const numOpts = this.combobox\n ? this._filteredOptions.length\n : this._options.length;\n\n if (numOpts <= VISIBLE_OPTS) {\n return;\n }\n\n this._isHoverForbidden = true;\n window.addEventListener('mousemove', this._onMouseMove);\n\n if (!this._listElement) {\n await this.updateComplete;\n }\n\n const ulScrollTop = this._listElement.scrollTop;\n const liPosY = this._activeIndex * OPT_HEIGHT;\n\n if (direction === 'down') {\n if (liPosY + OPT_HEIGHT >= LIST_HEIGHT + ulScrollTop) {\n this._listElement.scrollTop =\n (this._activeIndex - (VISIBLE_OPTS - 1)) * OPT_HEIGHT;\n }\n }\n\n if (direction === 'up') {\n if (liPosY <= ulScrollTop - OPT_HEIGHT) {\n this._scrollActiveElementToTop();\n }\n }\n }\n\n protected _onArrowUpKeyDown(): void {\n if (this._showDropdown) {\n if (this._activeIndex <= 0) {\n return;\n }\n\n this._activeIndex -= 1;\n this._adjustOptionListScrollPos('up');\n }\n }\n\n protected _onArrowDownKeyDown(): void {\n if (this._showDropdown) {\n if (this._activeIndex >= this._currentOptions.length - 1) {\n return;\n }\n\n this._activeIndex += 1;\n this._adjustOptionListScrollPos('down');\n }\n }\n\n private _onComponentKeyDown(event: KeyboardEvent) {\n if ([' ', 'ArrowUp', 'ArrowDown', 'Escape'].includes(event.key)) {\n event.stopPropagation();\n event.preventDefault();\n }\n\n if (event.key === 'Enter') {\n this._onEnterKeyDown();\n }\n\n if (event.key === ' ') {\n this._onSpaceKeyDown();\n }\n\n if (event.key === 'Escape') {\n this._toggleDropdown(false);\n }\n\n if (event.key === 'ArrowUp') {\n this._onArrowUpKeyDown();\n }\n\n if (event.key === 'ArrowDown') {\n this._onArrowDownKeyDown();\n }\n }\n\n private _onComponentFocus() {\n this.focused = true;\n }\n\n private _onComponentBlur() {\n this.focused = false;\n }\n\n protected _onSlotChange(): void {\n const stat = this._addOptionsFromSlottedElements();\n\n if (stat.selectedIndexes.length > 0) {\n this._selectedIndex = stat.selectedIndexes[0];\n this._selectedIndexes = stat.selectedIndexes;\n this._value = stat.values[0];\n this._values = stat.values;\n }\n\n if (\n !this._multiple &&\n !this.combobox &&\n stat.selectedIndexes.length === 0\n ) {\n this._selectedIndex = 0;\n }\n\n this.requestUpdate();\n }\n\n protected _onComboboxInputFocus(ev: FocusEvent): void {\n (ev.target as HTMLInputElement).select();\n }\n\n protected _onComboboxInputInput(ev: InputEvent): void {\n this._filterPattern = (ev.target as HTMLInputElement).value;\n this._activeIndex = -1;\n this._toggleDropdown(true);\n }\n\n protected _onComboboxInputClick(): void {\n this._toggleDropdown(true);\n }\n\n protected _renderOptions(): TemplateResult | TemplateResult[] {\n return [];\n }\n\n private _renderDescription() {\n if (!this._options[this._activeIndex]) {\n return nothing;\n }\n\n const {description} = this._options[this._activeIndex];\n\n return description\n ? html`<div class=\"description\">${description}</div>`\n : nothing;\n }\n\n protected _renderSelectFace(): TemplateResult {\n return html`${nothing}`;\n }\n\n protected _renderComboboxFace(): TemplateResult {\n return html`${nothing}`;\n }\n\n protected _renderDropdownControls(): TemplateResult {\n return html`${nothing}`;\n }\n\n private _renderDropdown() {\n const classes = classMap({\n dropdown: true,\n multiple: this._multiple,\n });\n\n return html`\n <div class=\"${classes}\">\n ${this.position === \"above\" ? this._renderDescription() : nothing}\n ${this._renderOptions()} ${this._renderDropdownControls()}\n ${this.position === \"below\" ? this._renderDescription() : nothing}\n </div>\n `;\n }\n\n render(): TemplateResult {\n return html`\n <slot class=\"main-slot\" @slotchange=\"${this._onSlotChange}\"></slot>\n ${this.combobox ? this._renderComboboxFace() : this._renderSelectFace()}\n ${this._showDropdown ? this._renderDropdown() : nothing}\n `;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"vscode-select-base.js","sourceRoot":"","sources":["../../../src/includes/vscode-select/vscode-select-base.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAC,IAAI,EAAE,OAAO,EAAiB,MAAM,KAAK,CAAC;AAClD,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAE,qBAAqB,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAChF,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AACrD,OAAO,8BAA8B,CAAC;AACtC,OAAO,8BAA8B,CAAC;AAGtC,OAAO,EAAC,sBAAsB,EAAC,MAAM,cAAc,CAAC;AACpD,OAAO,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAO5C,MAAM,YAAY,GAAG,EAAE,CAAC;AACxB,MAAM,UAAU,GAAG,EAAE,CAAC;AACtB,MAAM,WAAW,GAAG,YAAY,GAAG,UAAU,GAAG,CAAC,CAAC;AAElD;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,UAAU;IAAhD;;QACE,gBAAgB;QAEhB,iBAAY,GAAG,OAAO,CAAC;QAGvB,aAAQ,GAAG,KAAK,CAAC;QAsBjB;;WAEG;QAEH,YAAO,GAAG,KAAK,CAAC;QAoChB,YAAO,GAAG,KAAK,CAAC;QAsBhB;;WAEG;QAEH,aAAQ,GAAsB,OAA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AI,EAAC,CAAC;iDACzB;AAOhB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,KAAK,EAAC,CAAC;+CAGvB;AAiBD;IADC,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;kDACY;AAItC;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;kDAC5C;AAML;IAJP,qBAAqB,CAAC;QACrB,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,eAAe;KAC1B,CAAC;0DACwC;AAiBhC;IADT,KAAK,EAAE;sDACoB;AAGlB;IADT,KAAK,EAAE;6DAC2B;AAGzB;IADT,KAAK,EAAE;iDACkC;AAG1C;IADC,KAAK,EAAE;wDAWP;AAGS;IADT,KAAK,EAAE;wDACsB;AAGpB;IADT,KAAK,EAAE;wDACsB;AAGpB;IADT,KAAK,EAAE;0DACkC;AAGhC;IADT,KAAK,EAAE;uDACwB;AAGtB;IADT,KAAK,EAAE;kDACkC;AAGhC;IADT,KAAK,EAAE;gDACc;AAGZ;IADT,KAAK,EAAE;iDACyB;AAGvB;IADT,KAAK,EAAE;wDACqB;AAGrB;IADP,KAAK,CAAC,UAAU,CAAC;sDACsB","sourcesContent":["import {html, nothing, TemplateResult} from 'lit';\nimport {property, query, queryAssignedElements, state} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport '../../vscode-button/index.js';\nimport '../../vscode-option/index.js';\nimport {VscodeOption} from '../../vscode-option/index.js';\nimport type {InternalOption, Option, SearchMethod} from './types.js';\nimport {filterOptionsByPattern} from './helpers.js';\nimport {VscElement} from '../VscElement.js';\n\ninterface OptionListStat {\n selectedIndexes: number[];\n values: string[];\n}\n\nconst VISIBLE_OPTS = 10;\nconst OPT_HEIGHT = 22;\nconst LIST_HEIGHT = VISIBLE_OPTS + OPT_HEIGHT + 2;\n\n/**\n * @cssprop --dropdown-z-index - workaround for dropdown z-index issues\n */\nexport class VscodeSelectBase extends VscElement {\n /** @internal */\n @property({type: String, reflect: true, attribute: 'aria-expanded'})\n ariaExpanded = 'false';\n\n @property({type: Boolean, reflect: true})\n combobox = false;\n\n @property({type: Boolean, reflect: true})\n set disabled(newState: boolean) {\n this._disabled = newState;\n this.ariaDisabled = newState ? 'true' : 'false';\n\n if (newState === true) {\n this._originalTabIndex = this.tabIndex;\n this.tabIndex = -1;\n } else {\n this.tabIndex = this._originalTabIndex ?? 0;\n this._originalTabIndex = undefined;\n }\n\n this.requestUpdate();\n }\n\n get disabled(): boolean {\n return this._disabled;\n }\n\n /**\n * Sets the invalid state manually.\n */\n @property({type: Boolean, reflect: true})\n invalid = false;\n\n /**\n * Search method in the filtered list within the combobox mode.\n *\n * - contains - The list item includes the searched pattern at any position.\n * - fuzzy - The list item contains the letters of the search pattern in the same order, but at any position.\n * - startsWith - The search pattern matches the beginning of the searched text.\n * - startsWithPerTerm - The search pattern matches the beginning of any word in the searched text.\n *\n * @default 'fuzzy'\n */\n @property()\n set filter(val: 'contains' | 'fuzzy' | 'startsWith' | 'startsWithPerTerm') {\n const validValues: SearchMethod[] = [\n 'contains',\n 'fuzzy',\n 'startsWith',\n 'startsWithPerTerm',\n ];\n\n if (validValues.includes(val as SearchMethod)) {\n this._filter = val as SearchMethod;\n } else {\n this._filter = 'fuzzy';\n console.warn(\n `[VSCode Webview Elements] Invalid filter: \"${val}\", fallback to default. Valid values are: \"contains\", \"fuzzy\", \"startsWith\", \"startsWithPerm\".`,\n this\n );\n }\n }\n get filter(): 'contains' | 'fuzzy' | 'startsWith' | 'startsWithPerTerm' {\n return this._filter;\n }\n\n @property({type: Boolean, reflect: true})\n focused = false;\n\n /**\n * @attr [options=[]]\n * @type {Option[]}\n */\n @property({type: Array})\n set options(opts: Option[]) {\n this._options = opts.map((op, index) => ({...op, index}));\n }\n get options(): Option[] {\n return this._options.map(\n ({label, value, description, selected, disabled}) => ({\n label,\n value,\n description,\n selected,\n disabled,\n })\n );\n }\n\n /**\n * Position of the options list when visible.\n */\n @property({reflect: true})\n position: 'above' | 'below' = 'below';\n\n /** @internal */\n @property({type: Number, attribute: true, reflect: true})\n tabIndex = 0;\n\n @queryAssignedElements({\n flatten: true,\n selector: 'vscode-option',\n })\n private _assignedOptions!: VscodeOption[];\n\n connectedCallback(): void {\n super.connectedCallback();\n this.addEventListener('keydown', this._onComponentKeyDown);\n this.addEventListener('focus', this._onComponentFocus);\n this.addEventListener('blur', this._onComponentBlur);\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.removeEventListener('keydown', this._onComponentKeyDown);\n this.removeEventListener('focus', this._onComponentFocus);\n this.removeEventListener('blur', this._onComponentBlur);\n }\n\n @state()\n protected _activeIndex = -1;\n\n @state()\n protected _currentDescription = '';\n\n @state()\n protected _filter: SearchMethod = 'fuzzy';\n\n @state()\n protected get _filteredOptions(): InternalOption[] {\n if (!this.combobox || this._filterPattern === '') {\n return this._options;\n }\n\n return filterOptionsByPattern(\n this._options,\n this._filterPattern,\n this._filter\n );\n }\n\n @state()\n protected _filterPattern = '';\n\n @state()\n protected _selectedIndex = -1;\n\n @state()\n protected _selectedIndexes: number[] = [];\n\n @state()\n protected _showDropdown = false;\n\n @state()\n protected _options: InternalOption[] = [];\n\n @state()\n protected _value = '';\n\n @state()\n protected _values: string[] = [];\n\n @state()\n protected _listScrollTop = 0;\n\n @query('.options')\n private _listElement!: HTMLUListElement;\n\n /** @internal */\n protected _multiple = false;\n\n /**\n * @internal\n * Quick-searchable map for searching a value in the options list.\n * Keys are the options values, values are the option indexes.\n */\n protected _valueOptionIndexMap: {[key: string]: number} = {};\n\n private _isHoverForbidden = false;\n private _disabled = false;\n private _originalTabIndex: number | undefined = undefined;\n\n protected get _currentOptions(): InternalOption[] {\n return this.combobox ? this._filteredOptions : this._options;\n }\n\n protected _addOptionsFromSlottedElements(): OptionListStat {\n const options: InternalOption[] = [];\n let nextIndex = 0;\n const optionElements = this._assignedOptions ?? [];\n const optionsListStat: OptionListStat = {\n selectedIndexes: [],\n values: [],\n };\n this._valueOptionIndexMap = {};\n\n optionElements.forEach((el) => {\n const {innerText, description, disabled} = el;\n const value = (el.value ?? '') ? el.value : innerText.trim();\n const selected = el.selected ?? false;\n const op: InternalOption = {\n label: innerText.trim(),\n value,\n description,\n selected,\n index: nextIndex,\n disabled,\n };\n\n nextIndex = options.push(op);\n\n if (selected) {\n optionsListStat.selectedIndexes.push(options.length - 1);\n optionsListStat.values.push(value);\n }\n\n this._valueOptionIndexMap[op.value] = op.index;\n });\n\n this._options = options;\n\n return optionsListStat;\n }\n\n protected async _toggleDropdown(visible: boolean): Promise<void> {\n this._showDropdown = visible;\n this.ariaExpanded = String(visible);\n\n if (visible && !this._multiple && !this.combobox) {\n this._activeIndex = this._selectedIndex;\n\n if (this._activeIndex > VISIBLE_OPTS - 1) {\n await this.updateComplete;\n\n this._listElement.scrollTop = Math.floor(\n this._activeIndex * OPT_HEIGHT\n );\n }\n }\n\n if (visible) {\n window.addEventListener('click', this._onClickOutside);\n } else {\n window.removeEventListener('click', this._onClickOutside);\n }\n }\n\n protected _dispatchChangeEvent(): void {\n if (!this._multiple) {\n /** @deprecated */\n this.dispatchEvent(\n new CustomEvent('vsc-change', {\n detail: {\n selectedIndex: this._selectedIndex,\n value: this._value,\n },\n })\n );\n } else {\n /** @deprecated */\n this.dispatchEvent(\n new CustomEvent('vsc-change', {\n detail: {\n selectedIndexes: this._selectedIndexes,\n value: this._values,\n },\n })\n );\n }\n this.dispatchEvent(new Event('change'));\n }\n\n protected _onFaceClick(): void {\n this._toggleDropdown(!this._showDropdown);\n\n if (this._multiple) {\n this._activeIndex = 0;\n }\n }\n\n private _onClickOutside = (event: MouseEvent): void => {\n const path = event.composedPath();\n const found = path.findIndex((et) => et === this);\n\n if (found === -1) {\n this._toggleDropdown(false);\n window.removeEventListener('click', this._onClickOutside);\n }\n };\n\n private _onMouseMove = () => {\n this._isHoverForbidden = false;\n window.removeEventListener('mousemove', this._onMouseMove);\n };\n\n private _toggleComboboxDropdown() {\n this._filterPattern = '';\n this._toggleDropdown(!this._showDropdown);\n\n if (this._multiple) {\n this._activeIndex = -1;\n }\n }\n\n protected _onComboboxButtonClick(): void {\n this._toggleComboboxDropdown();\n }\n\n protected _onComboboxButtonKeyDown(ev: KeyboardEvent): void {\n if (ev.key === 'Enter') {\n this._toggleComboboxDropdown();\n }\n }\n\n protected _onOptionMouseOver(ev: MouseEvent): void {\n if (this._isHoverForbidden) {\n return;\n }\n\n const el = ev.target as HTMLElement;\n\n if (!el.matches('.option')) {\n return;\n }\n\n this._activeIndex = Number(\n this.combobox ? el.dataset.filteredIndex : el.dataset.index\n );\n }\n\n protected _onEnterKeyDown(): void {\n const list = this.combobox ? this._filteredOptions : this._options;\n const showDropdownNext = !this._showDropdown;\n\n this._toggleDropdown(showDropdownNext);\n\n if (\n !this._multiple &&\n !showDropdownNext &&\n this._selectedIndex !== this._activeIndex\n ) {\n this._selectedIndex = list[this._activeIndex].index;\n this._value = this._options[this._selectedIndex].value;\n this._dispatchChangeEvent();\n }\n\n if (this.combobox) {\n if (!this._multiple && !showDropdownNext) {\n this._selectedIndex = this._filteredOptions[this._activeIndex].index;\n }\n\n if (!this._multiple && showDropdownNext) {\n this.updateComplete.then(() => {\n this._scrollActiveElementToTop();\n });\n }\n }\n\n if (this._multiple && showDropdownNext) {\n this._activeIndex = 0;\n }\n }\n\n private _onSpaceKeyDown() {\n if (!this._showDropdown) {\n this._toggleDropdown(true);\n return;\n }\n\n if (this._showDropdown && this._multiple && this._activeIndex > -1) {\n const opts = this.combobox ? this._filteredOptions : this._options;\n const {selected} = opts[this._activeIndex];\n\n opts[this._activeIndex].selected = !selected;\n this._selectedIndexes = [];\n\n opts.forEach(({index, selected}) => {\n if (selected) {\n this._selectedIndexes.push(index);\n }\n });\n }\n }\n\n private _scrollActiveElementToTop() {\n this._listElement.scrollTop = Math.floor(this._activeIndex * OPT_HEIGHT);\n }\n\n private async _adjustOptionListScrollPos(direction: 'down' | 'up') {\n const numOpts = this.combobox\n ? this._filteredOptions.length\n : this._options.length;\n\n if (numOpts <= VISIBLE_OPTS) {\n return;\n }\n\n this._isHoverForbidden = true;\n window.addEventListener('mousemove', this._onMouseMove);\n\n if (!this._listElement) {\n await this.updateComplete;\n }\n\n const ulScrollTop = this._listElement.scrollTop;\n const liPosY = this._activeIndex * OPT_HEIGHT;\n\n if (direction === 'down') {\n if (liPosY + OPT_HEIGHT >= LIST_HEIGHT + ulScrollTop) {\n this._listElement.scrollTop =\n (this._activeIndex - (VISIBLE_OPTS - 1)) * OPT_HEIGHT;\n }\n }\n\n if (direction === 'up') {\n if (liPosY <= ulScrollTop - OPT_HEIGHT) {\n this._scrollActiveElementToTop();\n }\n }\n }\n\n protected _onArrowUpKeyDown(): void {\n if (this._showDropdown) {\n if (this._activeIndex <= 0) {\n return;\n }\n\n this._activeIndex -= 1;\n this._adjustOptionListScrollPos('up');\n }\n }\n\n protected _onArrowDownKeyDown(): void {\n if (this._showDropdown) {\n if (this._activeIndex >= this._currentOptions.length - 1) {\n return;\n }\n\n this._activeIndex += 1;\n this._adjustOptionListScrollPos('down');\n }\n }\n\n private _onComponentKeyDown(event: KeyboardEvent) {\n if ([' ', 'ArrowUp', 'ArrowDown', 'Escape'].includes(event.key)) {\n event.stopPropagation();\n event.preventDefault();\n }\n\n if (event.key === 'Enter') {\n this._onEnterKeyDown();\n }\n\n if (event.key === ' ') {\n this._onSpaceKeyDown();\n }\n\n if (event.key === 'Escape') {\n this._toggleDropdown(false);\n }\n\n if (event.key === 'ArrowUp') {\n this._onArrowUpKeyDown();\n }\n\n if (event.key === 'ArrowDown') {\n this._onArrowDownKeyDown();\n }\n }\n\n private _onComponentFocus() {\n this.focused = true;\n }\n\n private _onComponentBlur() {\n this.focused = false;\n }\n\n protected _onSlotChange(): void {\n const stat = this._addOptionsFromSlottedElements();\n\n if (stat.selectedIndexes.length > 0) {\n this._selectedIndex = stat.selectedIndexes[0];\n this._selectedIndexes = stat.selectedIndexes;\n this._value = stat.values[0];\n this._values = stat.values;\n }\n\n if (\n !this._multiple &&\n !this.combobox &&\n stat.selectedIndexes.length === 0\n ) {\n this._selectedIndex = 0;\n }\n\n this.requestUpdate();\n }\n\n protected _onComboboxInputFocus(ev: FocusEvent): void {\n (ev.target as HTMLInputElement).select();\n }\n\n protected _onComboboxInputInput(ev: InputEvent): void {\n this._filterPattern = (ev.target as HTMLInputElement).value;\n this._activeIndex = -1;\n this._toggleDropdown(true);\n }\n\n protected _onComboboxInputClick(): void {\n this._toggleDropdown(true);\n }\n\n protected _renderOptions(): TemplateResult | TemplateResult[] {\n return [];\n }\n\n private _renderDescription() {\n if (!this._options[this._activeIndex]) {\n return nothing;\n }\n\n const {description} = this._options[this._activeIndex];\n\n return description\n ? html`<div class=\"description\">${description}</div>`\n : nothing;\n }\n\n protected _renderSelectFace(): TemplateResult {\n return html`${nothing}`;\n }\n\n protected _renderComboboxFace(): TemplateResult {\n return html`${nothing}`;\n }\n\n protected _renderDropdownControls(): TemplateResult {\n return html`${nothing}`;\n }\n\n private _renderDropdown() {\n const classes = classMap({\n dropdown: true,\n multiple: this._multiple,\n });\n\n return html`\n <div class=\"${classes}\">\n ${this.position === 'above' ? this._renderDescription() : nothing}\n ${this._renderOptions()} ${this._renderDropdownControls()}\n ${this.position === 'below' ? this._renderDescription() : nothing}\n </div>\n `;\n }\n\n render(): TemplateResult {\n return html`\n <slot class=\"main-slot\" @slotchange=\"${this._onSlotChange}\"></slot>\n ${this.combobox ? this._renderComboboxFace() : this._renderSelectFace()}\n ${this._showDropdown ? this._renderDropdown() : nothing}\n `;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vscode-button.styles.d.ts","sourceRoot":"","sources":["../../src/vscode-button/vscode-button.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,cAAc,EAAC,MAAM,KAAK,CAAC;AAGxC,QAAA,MAAM,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"vscode-button.styles.d.ts","sourceRoot":"","sources":["../../src/vscode-button/vscode-button.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,cAAc,EAAC,MAAM,KAAK,CAAC;AAGxC,QAAA,MAAM,MAAM,EAAE,cAyHb,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -5,7 +5,10 @@ const styles = [
|
|
|
5
5
|
css `
|
|
6
6
|
:host {
|
|
7
7
|
background-color: var(--vscode-button-background);
|
|
8
|
-
border-color: var(
|
|
8
|
+
border-color: var(
|
|
9
|
+
--vscode-button-border,
|
|
10
|
+
var(--vscode-button-background)
|
|
11
|
+
);
|
|
9
12
|
border-style: solid;
|
|
10
13
|
border-radius: 2px;
|
|
11
14
|
border-width: 1px;
|
|
@@ -25,7 +28,10 @@ const styles = [
|
|
|
25
28
|
:host([secondary]) {
|
|
26
29
|
color: var(--vscode-button-secondaryForeground);
|
|
27
30
|
background-color: var(--vscode-button-secondaryBackground);
|
|
28
|
-
border-color: var(
|
|
31
|
+
border-color: var(
|
|
32
|
+
--vscode-button-border,
|
|
33
|
+
var(--vscode-button-secondaryBackground)
|
|
34
|
+
);
|
|
29
35
|
}
|
|
30
36
|
|
|
31
37
|
:host([disabled]) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vscode-button.styles.js","sourceRoot":"","sources":["../../src/vscode-button/vscode-button.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAiB,MAAM,KAAK,CAAC;AACxC,OAAO,aAAa,MAAM,+BAA+B,CAAC;AAE1D,MAAM,MAAM,GAAmB;IAC7B,aAAa;IACb,GAAG,CAAA
|
|
1
|
+
{"version":3,"file":"vscode-button.styles.js","sourceRoot":"","sources":["../../src/vscode-button/vscode-button.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAiB,MAAM,KAAK,CAAC;AACxC,OAAO,aAAa,MAAM,+BAA+B,CAAC;AAE1D,MAAM,MAAM,GAAmB;IAC7B,aAAa;IACb,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsHF;CACF,CAAC;AAEF,eAAe,MAAM,CAAC","sourcesContent":["import {css, CSSResultGroup} from 'lit';\nimport defaultStyles from '../includes/default.styles.js';\n\nconst styles: CSSResultGroup = [\n defaultStyles,\n css`\n :host {\n background-color: var(--vscode-button-background);\n border-color: var(\n --vscode-button-border,\n var(--vscode-button-background)\n );\n border-style: solid;\n border-radius: 2px;\n border-width: 1px;\n color: var(--vscode-button-foreground);\n cursor: pointer;\n display: inline-block;\n font-family: var(--vscode-font-family);\n font-size: var(--vscode-font-size);\n font-weight: var(--vscode-font-weight);\n line-height: 22px;\n overflow: hidden;\n padding: 1px 13px;\n user-select: none;\n white-space: nowrap;\n }\n\n :host([secondary]) {\n color: var(--vscode-button-secondaryForeground);\n background-color: var(--vscode-button-secondaryBackground);\n border-color: var(\n --vscode-button-border,\n var(--vscode-button-secondaryBackground)\n );\n }\n\n :host([disabled]) {\n cursor: default;\n opacity: 0.4;\n pointer-events: none;\n }\n\n :host(:hover) {\n background-color: var(--vscode-button-hoverBackground);\n }\n\n :host([disabled]:hover) {\n background-color: var(--vscode-button-background);\n }\n\n :host([secondary]:hover) {\n background-color: var(--vscode-button-secondaryHoverBackground);\n }\n\n :host([secondary][disabled]:hover) {\n background-color: var(--vscode-button-secondaryBackground);\n }\n\n :host(:focus),\n :host(:active) {\n outline: none;\n }\n\n :host(:focus) {\n background-color: var(--vscode-button-hoverBackground);\n outline: 1px solid var(--vscode-focusBorder);\n outline-offset: 2px;\n }\n\n :host([disabled]:focus) {\n background-color: var(--vscode-button-background);\n outline: 0;\n }\n\n :host([secondary]:focus) {\n background-color: var(--vscode-button-secondaryHoverBackground);\n }\n\n :host([secondary][disabled]:focus) {\n background-color: var(--vscode-button-secondaryBackground);\n }\n\n ::slotted(*) {\n display: inline-block;\n margin-left: 4px;\n margin-right: 4px;\n }\n\n ::slotted(*:first-child) {\n margin-left: 0;\n }\n\n ::slotted(vscode-icon) {\n color: inherit;\n }\n\n .wrapper {\n align-items: center;\n box-sizing: border-box;\n display: flex;\n justify-content: center;\n position: relative;\n width: 100%;\n }\n\n slot {\n align-items: center;\n display: flex;\n height: 100%;\n }\n\n .icon {\n color: inherit;\n display: block;\n margin-right: 3px;\n }\n\n .icon-after {\n color: inherit;\n display: block;\n margin-left: 3px;\n }\n `,\n];\n\nexport default styles;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vscode-checkbox.styles.js","sourceRoot":"","sources":["../../src/vscode-checkbox/vscode-checkbox.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAiB,MAAM,KAAK,CAAC;AACxC,OAAO,aAAa,MAAM,+BAA+B,CAAC;AAC1D,OAAO,UAAU,MAAM,+CAA+C,CAAC;AACvE,OAAO,oBAAoB,MAAM,qCAAqC,CAAC;AAEvE,MAAM,MAAM,GAAmB;IAC7B,aAAa;IACb,UAAU;IACV,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;GAsBF;IACD,oBAAoB;CACrB,CAAC;AAEF,eAAe,MAAM,CAAC","sourcesContent":["import {css, CSSResultGroup} from 'lit';\nimport defaultStyles from '../includes/default.styles.js';\nimport baseStyles from '../includes/form-button-widget/base.styles.js';\nimport formHelperTextStyles from '../includes/formHelperTextStyles.js';\n\nconst styles: CSSResultGroup = [\n defaultStyles,\n baseStyles,\n css`\n :host(:invalid) .icon,\n :host([invalid]) .icon {\n background-color: var(--vscode-inputValidation-errorBackground);\n border-color: var(--vscode-inputValidation-errorBorder, #be1100);\n }\n\n .icon {\n border-radius: 3px;\n }\n\n .indeterminate-icon {\n background-color: currentColor;\n position: absolute;\n height: 1px;\n width: 12px;\n }\n\n :host(:focus):host(:not([disabled])) .icon {\n outline: 1px solid var(--focus-border);\n outline-offset: -1px;\n }\n `,\n formHelperTextStyles
|
|
1
|
+
{"version":3,"file":"vscode-checkbox.styles.js","sourceRoot":"","sources":["../../src/vscode-checkbox/vscode-checkbox.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAiB,MAAM,KAAK,CAAC;AACxC,OAAO,aAAa,MAAM,+BAA+B,CAAC;AAC1D,OAAO,UAAU,MAAM,+CAA+C,CAAC;AACvE,OAAO,oBAAoB,MAAM,qCAAqC,CAAC;AAEvE,MAAM,MAAM,GAAmB;IAC7B,aAAa;IACb,UAAU;IACV,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;GAsBF;IACD,oBAAoB;CACrB,CAAC;AAEF,eAAe,MAAM,CAAC","sourcesContent":["import {css, CSSResultGroup} from 'lit';\nimport defaultStyles from '../includes/default.styles.js';\nimport baseStyles from '../includes/form-button-widget/base.styles.js';\nimport formHelperTextStyles from '../includes/formHelperTextStyles.js';\n\nconst styles: CSSResultGroup = [\n defaultStyles,\n baseStyles,\n css`\n :host(:invalid) .icon,\n :host([invalid]) .icon {\n background-color: var(--vscode-inputValidation-errorBackground);\n border-color: var(--vscode-inputValidation-errorBorder, #be1100);\n }\n\n .icon {\n border-radius: 3px;\n }\n\n .indeterminate-icon {\n background-color: currentColor;\n position: absolute;\n height: 1px;\n width: 12px;\n }\n\n :host(:focus):host(:not([disabled])) .icon {\n outline: 1px solid var(--focus-border);\n outline-offset: -1px;\n }\n `,\n formHelperTextStyles,\n];\n\nexport default styles;\n"]}
|