@vscode-elements/elements 2.1.1-pre.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/custom-elements.json +1235 -963
- package/dist/bundled.js +286 -124
- package/dist/includes/VscElement.js +1 -1
- package/dist/includes/VscElement.js.map +1 -1
- package/dist/includes/test-helpers.d.ts +2 -2
- package/dist/includes/test-helpers.d.ts.map +1 -1
- package/dist/includes/test-helpers.js +2 -1
- package/dist/includes/test-helpers.js.map +1 -1
- package/dist/main.d.ts +1 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +1 -0
- package/dist/main.js.map +1 -1
- package/dist/vscode-button/vscode-button.d.ts +8 -0
- package/dist/vscode-button/vscode-button.d.ts.map +1 -1
- package/dist/vscode-button/vscode-button.js +37 -12
- package/dist/vscode-button/vscode-button.js.map +1 -1
- package/dist/vscode-button/vscode-button.styles.d.ts.map +1 -1
- package/dist/vscode-button/vscode-button.styles.js +47 -54
- package/dist/vscode-button/vscode-button.styles.js.map +1 -1
- package/dist/vscode-button-group/vscode-button-group.styles.d.ts.map +1 -1
- package/dist/vscode-button-group/vscode-button-group.styles.js +2 -0
- package/dist/vscode-button-group/vscode-button-group.styles.js.map +1 -1
- package/dist/vscode-checkbox/vscode-checkbox.d.ts +5 -2
- package/dist/vscode-checkbox/vscode-checkbox.d.ts.map +1 -1
- package/dist/vscode-checkbox/vscode-checkbox.js +14 -9
- package/dist/vscode-checkbox/vscode-checkbox.js.map +1 -1
- package/dist/vscode-checkbox/vscode-checkbox.styles.d.ts.map +1 -1
- package/dist/vscode-checkbox/vscode-checkbox.styles.js +71 -0
- package/dist/vscode-checkbox/vscode-checkbox.styles.js.map +1 -1
- package/dist/vscode-progress-bar/index.d.ts +2 -0
- package/dist/vscode-progress-bar/index.d.ts.map +1 -0
- package/dist/vscode-progress-bar/index.js +2 -0
- package/dist/vscode-progress-bar/index.js.map +1 -0
- package/dist/vscode-progress-bar/vscode-progress-bar.d.ts +45 -0
- package/dist/vscode-progress-bar/vscode-progress-bar.d.ts.map +1 -0
- package/dist/vscode-progress-bar/vscode-progress-bar.js +135 -0
- package/dist/vscode-progress-bar/vscode-progress-bar.js.map +1 -0
- package/dist/vscode-progress-bar/vscode-progress-bar.styles.d.ts +4 -0
- package/dist/vscode-progress-bar/vscode-progress-bar.styles.d.ts.map +1 -0
- package/dist/vscode-progress-bar/vscode-progress-bar.styles.js +82 -0
- package/dist/vscode-progress-bar/vscode-progress-bar.styles.js.map +1 -0
- package/dist/vscode-table/vscode-table.js +1 -1
- package/dist/vscode-table/vscode-table.js.map +1 -1
- package/package.json +1 -1
- package/vscode.css-custom-data.json +5 -0
- package/vscode.html-custom-data.json +33 -1
|
@@ -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,GAAG,
|
|
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,GAAG,OAAO,CAAC;AACxB,MAAM,UAAU,GAAG,2CAA2C,CAAC;AAE/D,MAAM,OAAO,UAAW,SAAQ,UAAU;IACxC,8BAA8B;IAC9B,IAAI,OAAO;QACT,OAAO,OAAO,CAAC;IACjB,CAAC;CACF;AASD;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,OAAe,EAAE,EAAE;IAC/C,OAAO,CAAC,aAAiC,EAAE,EAAE;QAC3C,MAAM,kBAAkB,GAAG,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAEvD,IAAI,CAAC,kBAAkB,EAAE,CAAC;YACxB,cAAc,CAAC,MAAM,CAAC,OAAO,EAAE,aAAyC,CAAC,CAAC;YAC1E,OAAO;QACT,CAAC;QAED,IAAI,UAAU,IAAI,MAAM,EAAE,CAAC;YACzB,OAAO;QACT,CAAC;QAED,MAAM,EAAE,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QAC3C,MAAM,cAAc,GAAI,EAAiB,EAAE,OAAO,CAAC;QACnD,IAAI,OAAO,GAAG,EAAE,CAAC;QAEjB,IAAI,CAAC,cAAc,EAAE,CAAC;YACpB,OAAO;gBACL,mEAAmE,CAAC;QACxE,CAAC;aAAM,IAAI,cAAc,KAAK,OAAO,EAAE,CAAC;YACtC,OAAO;gBACL,mEAAmE,CAAC;YACtE,OAAO,IAAI,oBAAoB,OAAO,8BAA8B,cAAc,IAAI,CAAC;QACzF,CAAC;aAAM,CAAC;YACN,OAAO,IAAI,iEAAiE,OAAO,IAAI,CAAC;QAC1F,CAAC;QAED,sCAAsC;QACtC,OAAO,CAAC,IAAI,CACV,qBAAqB,OAAO,IAAI,OAAO,0CAA0C,UAAU,UAAU,CACtG,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import {LitElement} from 'lit';\n\nconst VERSION = '2.3.0';\nconst CONFIG_KEY = '__vscodeElements_disableRegistryWarning__';\n\nexport class VscElement extends LitElement {\n /** VSCode Elements version */\n get version(): string {\n return VERSION;\n }\n}\n\ntype CustomElementClass = Omit<typeof HTMLElement, 'new'>;\n\nexport type Constructor<T> = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n new (...args: any[]): T;\n};\n\n/**\n * Own implementation of Lit's customElement decorator.\n */\nexport const customElement = (tagName: string) => {\n return (classOrTarget: CustomElementClass) => {\n const customElementClass = customElements.get(tagName);\n\n if (!customElementClass) {\n customElements.define(tagName, classOrTarget as CustomElementConstructor);\n return;\n }\n\n if (CONFIG_KEY in window) {\n return;\n }\n\n const el = document.createElement(tagName);\n const anotherVersion = (el as VscElement)?.version;\n let message = '';\n\n if (!anotherVersion) {\n message +=\n 'is already registered by an unknown custom element handler class.';\n } else if (anotherVersion !== VERSION) {\n message +=\n 'is already registered by a different version of VSCode Elements. ';\n message += `This version is \"${VERSION}\", while the other one is \"${anotherVersion}\".`;\n } else {\n message += `is already registered by the same version of VSCode Elements (${VERSION}).`;\n }\n\n // eslint-disable-next-line no-console\n console.warn(\n `[VSCode Elements] ${tagName} ${message}\\nTo suppress this warning, set window.${CONFIG_KEY} to true`\n );\n };\n};\n"]}
|
|
@@ -32,9 +32,9 @@ deltaY?: number, callbacks?: {
|
|
|
32
32
|
type AllTagNames = keyof HTMLElementTagNameMap | keyof SVGElementTagNameMap;
|
|
33
33
|
type TagNameToElement<K extends AllTagNames> = K extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[K] : K extends keyof SVGElementTagNameMap ? SVGElementTagNameMap[K] : Element;
|
|
34
34
|
export declare function $<K extends AllTagNames>(selector: K): TagNameToElement<K>;
|
|
35
|
-
export declare function $<K extends AllTagNames>(root: Element, selector: K): TagNameToElement<K>;
|
|
35
|
+
export declare function $<K extends AllTagNames>(root: Element | ShadowRoot, selector: K): TagNameToElement<K>;
|
|
36
36
|
export declare function $<T extends Element = Element>(selector: string): T;
|
|
37
|
-
export declare function $<T extends Element = Element>(root: Element, selector: string): T;
|
|
37
|
+
export declare function $<T extends Element = Element>(root: Element | ShadowRoot, selector: string): T;
|
|
38
38
|
export declare function $$<K extends AllTagNames>(selector: K): NodeListOf<TagNameToElement<K>>;
|
|
39
39
|
export declare function $$<K extends AllTagNames>(root: Element, selector: K): NodeListOf<TagNameToElement<K>>;
|
|
40
40
|
export declare function $$<T extends Element = Element>(selector: string): NodeListOf<T>;
|
|
@@ -1 +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,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AS,WAAW,EACrC,IAAI,EAAE,OAAO,GAAG,UAAU,EAC1B,QAAQ,EAAE,CAAC,GACV,gBAAgB,CAAC,CAAC,CAAC,CAAC;AACvB,wBAAgB,CAAC,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,CAAC,CAAC;AACpE,wBAAgB,CAAC,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO,EAC3C,IAAI,EAAE,OAAO,GAAG,UAAU,EAC1B,QAAQ,EAAE,MAAM,GACf,CAAC,CAAC;AA2BL,wBAAgB,EAAE,CAAC,CAAC,SAAS,WAAW,EACtC,QAAQ,EAAE,CAAC,GACV,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;AACnC,wBAAgB,EAAE,CAAC,CAAC,SAAS,WAAW,EACtC,IAAI,EAAE,OAAO,EACb,QAAQ,EAAE,CAAC,GACV,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;AACnC,wBAAgB,EAAE,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO,EAC5C,QAAQ,EAAE,MAAM,GACf,UAAU,CAAC,CAAC,CAAC,CAAC;AACjB,wBAAgB,EAAE,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO,EAC5C,IAAI,EAAE,OAAO,EACb,QAAQ,EAAE,MAAM,GACf,UAAU,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -78,7 +78,8 @@ export function $(arg1, arg2) {
|
|
|
78
78
|
if (typeof arg1 === 'string') {
|
|
79
79
|
result = document.querySelector(arg1);
|
|
80
80
|
}
|
|
81
|
-
else if (arg1 instanceof Element
|
|
81
|
+
else if ((arg1 instanceof Element || arg1 instanceof ShadowRoot) &&
|
|
82
|
+
typeof arg2 === 'string') {
|
|
82
83
|
result = arg1.querySelector(arg2);
|
|
83
84
|
}
|
|
84
85
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-helpers.js","sourceR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AAC,IAAK,CAAC;QACzD,MAAM,OAAO,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,cAAc,CAAC;QACvE,MAAM,IAAI,KAAK,CAAC,0BAA0B,QAAQ,OAAO,OAAO,EAAE,CAAC,CAAC;IACtE,CAAC;IAED,OAAO,MAAW,CAAC;AACrB,CAAC;AAgBD,MAAM,UAAU,EAAE,CAChB,IAAsB,EACtB,IAAa;IAEb,IAAI,MAA2B,CAAC;IAEhC,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC7B,MAAM,GAAG,QAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;SAAM,IAAI,IAAI,YAAY,OAAO,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC/D,MAAM,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;IACtD,CAAC;IAED,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,MAAM,QAAQ,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAK,CAAC;QACzD,MAAM,OAAO,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,cAAc,CAAC;QACvE,MAAM,IAAI,KAAK,CAAC,4BAA4B,QAAQ,OAAO,OAAO,EAAE,CAAC,CAAC;IACxE,CAAC;IAED,OAAO,MAAuB,CAAC;AACjC,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\ntype AllTagNames = keyof HTMLElementTagNameMap | keyof SVGElementTagNameMap;\n\ntype TagNameToElement<K extends AllTagNames> =\n K extends keyof HTMLElementTagNameMap\n ? HTMLElementTagNameMap[K]\n : K extends keyof SVGElementTagNameMap\n ? SVGElementTagNameMap[K]\n : Element;\n\nexport function $<K extends AllTagNames>(selector: K): TagNameToElement<K>;\nexport function $<K extends AllTagNames>(\n root: Element | ShadowRoot,\n selector: K\n): TagNameToElement<K>;\nexport function $<T extends Element = Element>(selector: string): T;\nexport function $<T extends Element = Element>(\n root: Element | ShadowRoot,\n selector: string\n): T;\nexport function $<T extends Element = Element>(\n arg1: string | Element | ShadowRoot,\n arg2?: string\n): T {\n let result: Element | null;\n\n if (typeof arg1 === 'string') {\n result = document.querySelector(arg1);\n } else if (\n (arg1 instanceof Element || arg1 instanceof ShadowRoot) &&\n typeof arg2 === 'string'\n ) {\n result = arg1.querySelector(arg2);\n } else {\n throw new Error('Invalid arguments passed to $()');\n }\n\n if (!result) {\n const selector = typeof arg1 === 'string' ? arg1 : arg2!;\n const context = typeof arg1 === 'string' ? 'document' : 'root element';\n throw new Error(`No match for selector: ${selector} in ${context}`);\n }\n\n return result as T;\n}\n\nexport function $$<K extends AllTagNames>(\n selector: K\n): NodeListOf<TagNameToElement<K>>;\nexport function $$<K extends AllTagNames>(\n root: Element,\n selector: K\n): NodeListOf<TagNameToElement<K>>;\nexport function $$<T extends Element = Element>(\n selector: string\n): NodeListOf<T>;\nexport function $$<T extends Element = Element>(\n root: Element,\n selector: string\n): NodeListOf<T>;\nexport function $$<T extends Element = Element>(\n arg1: string | Element,\n arg2?: string\n): NodeListOf<T> {\n let result: NodeListOf<Element>;\n\n if (typeof arg1 === 'string') {\n result = document.querySelectorAll(arg1);\n } else if (arg1 instanceof Element && typeof arg2 === 'string') {\n result = arg1.querySelectorAll(arg2);\n } else {\n throw new Error('Invalid arguments passed to $$()');\n }\n\n if (result.length === 0) {\n const selector = typeof arg1 === 'string' ? arg1 : arg2!;\n const context = typeof arg1 === 'string' ? 'document' : 'root element';\n throw new Error(`No matches for selector: ${selector} in ${context}`);\n }\n\n return result as NodeListOf<T>;\n}\n"]}
|
package/dist/main.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export { VscodeLabel } from './vscode-label/index.js';
|
|
|
15
15
|
export { VscodeMultiSelect } from './vscode-multi-select/index.js';
|
|
16
16
|
export { VscodeOption } from './vscode-option/index.js';
|
|
17
17
|
export { VscodeProgressRing } from './vscode-progress-ring/index.js';
|
|
18
|
+
export { VscodeProgressBar } from './vscode-progress-bar/index.js';
|
|
18
19
|
export { VscodeRadio } from './vscode-radio/index.js';
|
|
19
20
|
export { VscodeRadioGroup } from './vscode-radio-group/index.js';
|
|
20
21
|
export { VscodeSingleSelect } from './vscode-single-select/index.js';
|
package/dist/main.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAC,YAAY,EAAC,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAC,iBAAiB,EAAC,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAC,cAAc,EAAC,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAC,mBAAmB,EAAC,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAC,iBAAiB,EAAC,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAC,qBAAqB,EAAC,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAC,iBAAiB,EAAC,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAC,aAAa,EAAC,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAC,mBAAmB,EAAC,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAC,eAAe,EAAC,MAAM,8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,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAC,kBAAkB,EAAC,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAC,iBAAiB,EAAC,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAC,eAAe,EAAC,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAC,cAAc,EAAC,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAC,eAAe,EAAC,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAC,eAAe,EAAC,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAC,iBAAiB,EAAC,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAC,qBAAqB,EAAC,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAC,cAAc,EAAC,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAC,WAAW,EAAC,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAC,UAAU,EAAC,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAC,cAAc,EAAC,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAC,eAAe,EAAC,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAC,mBAAmB,EAAC,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAC,sBAAsB,EAAC,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAC,UAAU,EAAC,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAC,cAAc,EAAC,MAAM,6BAA6B,CAAC"}
|
package/dist/main.js
CHANGED
|
@@ -15,6 +15,7 @@ export { VscodeLabel } from './vscode-label/index.js';
|
|
|
15
15
|
export { VscodeMultiSelect } from './vscode-multi-select/index.js';
|
|
16
16
|
export { VscodeOption } from './vscode-option/index.js';
|
|
17
17
|
export { VscodeProgressRing } from './vscode-progress-ring/index.js';
|
|
18
|
+
export { VscodeProgressBar } from './vscode-progress-bar/index.js';
|
|
18
19
|
export { VscodeRadio } from './vscode-radio/index.js';
|
|
19
20
|
export { VscodeRadioGroup } from './vscode-radio-group/index.js';
|
|
20
21
|
export { VscodeSingleSelect } from './vscode-single-select/index.js';
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAC,YAAY,EAAC,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAC,iBAAiB,EAAC,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAC,cAAc,EAAC,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAC,mBAAmB,EAAC,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAC,iBAAiB,EAAC,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAC,qBAAqB,EAAC,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAC,iBAAiB,EAAC,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAC,aAAa,EAAC,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAC,mBAAmB,EAAC,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAC,eAAe,EAAC,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAC,gBAAgB,EAAC,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAC,UAAU,EAAC,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAC,WAAW,EAAC,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAC,iBAAiB,EAAC,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAC,YAAY,EAAC,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAC,kBAAkB,EAAC,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAC,WAAW,EAAC,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAC,gBAAgB,EAAC,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAC,kBAAkB,EAAC,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAC,iBAAiB,EAAC,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAC,eAAe,EAAC,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAC,cAAc,EAAC,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAC,eAAe,EAAC,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAC,eAAe,EAAC,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAC,iBAAiB,EAAC,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAC,qBAAqB,EAAC,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAC,cAAc,EAAC,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAC,WAAW,EAAC,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAC,UAAU,EAAC,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAC,cAAc,EAAC,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAC,eAAe,EAAC,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAC,mBAAmB,EAAC,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAC,sBAAsB,EAAC,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAC,UAAU,EAAC,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAC,cAAc,EAAC,MAAM,6BAA6B,CAAC","sourcesContent":["export {VscodeBadge} from './vscode-badge/index.js';\nexport {VscodeButton} from './vscode-button/index.js';\nexport {VscodeButtonGroup} from './vscode-button-group/index.js';\nexport {VscodeCheckbox} from './vscode-checkbox/index.js';\nexport {VscodeCheckboxGroup} from './vscode-checkbox-group/index.js';\nexport {VscodeCollapsible} from './vscode-collapsible/index.js';\nexport {VscodeContextMenuItem} from './vscode-context-menu-item/index.js';\nexport {VscodeContextMenu} from './vscode-context-menu/index.js';\nexport {VscodeDivider} from './vscode-divider/index.js';\nexport {VscodeFormContainer} from './vscode-form-container/index.js';\nexport {VscodeFormGroup} from './vscode-form-group/index.js';\nexport {VscodeFormHelper} from './vscode-form-helper/index.js';\nexport {VscodeIcon} from './vscode-icon/index.js';\nexport {VscodeLabel} from './vscode-label/index.js';\nexport {VscodeMultiSelect} from './vscode-multi-select/index.js';\nexport {VscodeOption} from './vscode-option/index.js';\nexport {VscodeProgressRing} from './vscode-progress-ring/index.js';\nexport {VscodeRadio} from './vscode-radio/index.js';\nexport {VscodeRadioGroup} from './vscode-radio-group/index.js';\nexport {VscodeSingleSelect} from './vscode-single-select/index.js';\nexport {VscodeScrollable} from './vscode-scrollable/index.js';\nexport {VscodeSplitLayout} from './vscode-split-layout/index.js';\nexport {VscodeTabHeader} from './vscode-tab-header/index.js';\nexport {VscodeTabPanel} from './vscode-tab-panel/index.js';\nexport {VscodeTableBody} from './vscode-table-body/index.js';\nexport {VscodeTableCell} from './vscode-table-cell/index.js';\nexport {VscodeTableHeader} from './vscode-table-header/index.js';\nexport {VscodeTableHeaderCell} from './vscode-table-header-cell/index.js';\nexport {VscodeTableRow} from './vscode-table-row/index.js';\nexport {VscodeTable} from './vscode-table/index.js';\nexport {VscodeTabs} from './vscode-tabs/index.js';\nexport {VscodeTextarea} from './vscode-textarea/index.js';\nexport {VscodeTextfield} from './vscode-textfield/index.js';\nexport {VscodeToolbarButton} from './vscode-toolbar-button/index.js';\nexport {VscodeToolbarContainer} from './vscode-toolbar-container/index.js';\nexport {VscodeTree} from './vscode-tree/index.js';\nexport {VscodeTreeItem} from './vscode-tree-item/index.js';\n"]}
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAC,YAAY,EAAC,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAC,iBAAiB,EAAC,MAAM,gCAAgC,CAAC;AACjE,OAA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BAA8B,CAAC;AAC7D,OAAO,EAAC,iBAAiB,EAAC,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAC,qBAAqB,EAAC,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAC,cAAc,EAAC,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAC,WAAW,EAAC,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAC,UAAU,EAAC,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAC,cAAc,EAAC,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAC,eAAe,EAAC,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAC,mBAAmB,EAAC,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAC,sBAAsB,EAAC,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAC,UAAU,EAAC,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAC,cAAc,EAAC,MAAM,6BAA6B,CAAC","sourcesContent":["export {VscodeBadge} from './vscode-badge/index.js';\nexport {VscodeButton} from './vscode-button/index.js';\nexport {VscodeButtonGroup} from './vscode-button-group/index.js';\nexport {VscodeCheckbox} from './vscode-checkbox/index.js';\nexport {VscodeCheckboxGroup} from './vscode-checkbox-group/index.js';\nexport {VscodeCollapsible} from './vscode-collapsible/index.js';\nexport {VscodeContextMenuItem} from './vscode-context-menu-item/index.js';\nexport {VscodeContextMenu} from './vscode-context-menu/index.js';\nexport {VscodeDivider} from './vscode-divider/index.js';\nexport {VscodeFormContainer} from './vscode-form-container/index.js';\nexport {VscodeFormGroup} from './vscode-form-group/index.js';\nexport {VscodeFormHelper} from './vscode-form-helper/index.js';\nexport {VscodeIcon} from './vscode-icon/index.js';\nexport {VscodeLabel} from './vscode-label/index.js';\nexport {VscodeMultiSelect} from './vscode-multi-select/index.js';\nexport {VscodeOption} from './vscode-option/index.js';\nexport {VscodeProgressRing} from './vscode-progress-ring/index.js';\nexport {VscodeProgressBar} from './vscode-progress-bar/index.js';\nexport {VscodeRadio} from './vscode-radio/index.js';\nexport {VscodeRadioGroup} from './vscode-radio-group/index.js';\nexport {VscodeSingleSelect} from './vscode-single-select/index.js';\nexport {VscodeScrollable} from './vscode-scrollable/index.js';\nexport {VscodeSplitLayout} from './vscode-split-layout/index.js';\nexport {VscodeTabHeader} from './vscode-tab-header/index.js';\nexport {VscodeTabPanel} from './vscode-tab-panel/index.js';\nexport {VscodeTableBody} from './vscode-table-body/index.js';\nexport {VscodeTableCell} from './vscode-table-cell/index.js';\nexport {VscodeTableHeader} from './vscode-table-header/index.js';\nexport {VscodeTableHeaderCell} from './vscode-table-header-cell/index.js';\nexport {VscodeTableRow} from './vscode-table-row/index.js';\nexport {VscodeTable} from './vscode-table/index.js';\nexport {VscodeTabs} from './vscode-tabs/index.js';\nexport {VscodeTextarea} from './vscode-textarea/index.js';\nexport {VscodeTextfield} from './vscode-textfield/index.js';\nexport {VscodeToolbarButton} from './vscode-toolbar-button/index.js';\nexport {VscodeToolbarContainer} from './vscode-toolbar-container/index.js';\nexport {VscodeTree} from './vscode-tree/index.js';\nexport {VscodeTreeItem} from './vscode-tree-item/index.js';\n"]}
|
|
@@ -17,6 +17,11 @@ import '../vscode-icon/index.js';
|
|
|
17
17
|
* @cssprop [--vscode-button-secondaryBackground=#313131]
|
|
18
18
|
* @cssprop [--vscode-button-secondaryHoverBackground=#3c3c3c]
|
|
19
19
|
* @cssprop [--vscode-focusBorder=#0078d4]
|
|
20
|
+
*
|
|
21
|
+
* @csspart base - The main content area of the component.
|
|
22
|
+
*
|
|
23
|
+
* @slot content-before - Slot before the main content.
|
|
24
|
+
* @slot content-after - Slot after the main content.
|
|
20
25
|
*/
|
|
21
26
|
export declare class VscodeButton extends VscElement {
|
|
22
27
|
static styles: import("lit").CSSResultGroup;
|
|
@@ -63,6 +68,8 @@ export declare class VscodeButton extends VscElement {
|
|
|
63
68
|
value: string;
|
|
64
69
|
private _prevTabindex;
|
|
65
70
|
private _internals;
|
|
71
|
+
private _hasContentBefore;
|
|
72
|
+
private _hasContentAfter;
|
|
66
73
|
get form(): HTMLFormElement | null;
|
|
67
74
|
constructor();
|
|
68
75
|
connectedCallback(): void;
|
|
@@ -73,6 +80,7 @@ export declare class VscodeButton extends VscElement {
|
|
|
73
80
|
private _handleClick;
|
|
74
81
|
private _handleFocus;
|
|
75
82
|
private _handleBlur;
|
|
83
|
+
private _handleSlotChange;
|
|
76
84
|
render(): TemplateResult;
|
|
77
85
|
}
|
|
78
86
|
declare global {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vscode-button.d.ts","sourceRoot":"","sources":["../../src/vscode-button/vscode-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,gBAAgB,EAAE,cAAc,EAAC,MAAM,KAAK,CAAC;AAGpE,OAAO,EAAgB,UAAU,EAAC,MAAM,2BAA2B,CAAC;AACpE,OAAO,yBAAyB,CAAC;AAIjC
|
|
1
|
+
{"version":3,"file":"vscode-button.d.ts","sourceRoot":"","sources":["../../src/vscode-button/vscode-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,gBAAgB,EAAE,cAAc,EAAC,MAAM,KAAK,CAAC;AAGpE,OAAO,EAAgB,UAAU,EAAC,MAAM,2BAA2B,CAAC;AACpE,OAAO,yBAAyB,CAAC;AAIjC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBACa,YAAa,SAAQ,UAAU;IAC1C,OAAgB,MAAM,+BAAU;IAEhC,gBAAgB;IAChB,MAAM,CAAC,cAAc,UAAQ;IAGpB,SAAS,UAAS;IAE3B,gBAAgB;IAEP,QAAQ,SAAK;IAEtB;;OAEG;IAEH,SAAS,UAAS;IAElB,gBAAgB;IAEP,IAAI,SAAY;IAGzB,QAAQ,UAAS;IAEjB;;OAEG;IAEH,IAAI,SAAM;IAEV;;OAEG;IAEH,QAAQ,CAAC,sBAAS;IAElB;;OAEG;IAEH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;OAEG;IAEH,SAAS,SAAM;IAEf;;OAEG;IAEH,aAAa,UAAS;IAEtB;;OAEG;IAMH,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAG/B,OAAO,UAAS;IAGhB,IAAI,EAAE,MAAM,GAAG,SAAS,CAAa;IAGrC,QAAQ,UAAS;IAGjB,IAAI,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAY;IAG/C,KAAK,SAAM;IAEX,OAAO,CAAC,aAAa,CAAK;IAC1B,OAAO,CAAC,UAAU,CAAmB;IAGrC,OAAO,CAAC,iBAAiB,CAAS;IAGlC,OAAO,CAAC,gBAAgB,CAAS;IAEjC,IAAI,IAAI,IAAI,eAAe,GAAG,IAAI,CAEjC;;IASQ,iBAAiB,IAAI,IAAI;IAkBzB,oBAAoB,IAAI,IAAI;IAM5B,MAAM,CAEb,iBAAiB,EAAE,gBAAgB,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,WAAW,EAAE,OAAO,CAAC,GACnE,IAAI;IAqBP,OAAO,CAAC,cAAc;IAUtB,OAAO,CAAC,cAAc;IAiBtB,OAAO,CAAC,YAAY;IASpB,OAAO,CAAC,YAAY,CAElB;IAEF,OAAO,CAAC,WAAW,CAEjB;IAEF,OAAO,CAAC,iBAAiB;IAYhB,MAAM,IAAI,cAAc;CA0ClC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,eAAe,EAAE,YAAY,CAAC;KAC/B;CACF"}
|
|
@@ -5,7 +5,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
import { html, nothing } from 'lit';
|
|
8
|
-
import { property } from 'lit/decorators.js';
|
|
8
|
+
import { property, state } from 'lit/decorators.js';
|
|
9
9
|
import { classMap } from 'lit/directives/class-map.js';
|
|
10
10
|
import { customElement, VscElement } from '../includes/VscElement.js';
|
|
11
11
|
import '../vscode-icon/index.js';
|
|
@@ -27,6 +27,11 @@ import { ifDefined } from 'lit/directives/if-defined.js';
|
|
|
27
27
|
* @cssprop [--vscode-button-secondaryBackground=#313131]
|
|
28
28
|
* @cssprop [--vscode-button-secondaryHoverBackground=#3c3c3c]
|
|
29
29
|
* @cssprop [--vscode-focusBorder=#0078d4]
|
|
30
|
+
*
|
|
31
|
+
* @csspart base - The main content area of the component.
|
|
32
|
+
*
|
|
33
|
+
* @slot content-before - Slot before the main content.
|
|
34
|
+
* @slot content-after - Slot after the main content.
|
|
30
35
|
*/
|
|
31
36
|
let VscodeButton = class VscodeButton extends VscElement {
|
|
32
37
|
get form() {
|
|
@@ -66,6 +71,8 @@ let VscodeButton = class VscodeButton extends VscElement {
|
|
|
66
71
|
this.type = 'button';
|
|
67
72
|
this.value = '';
|
|
68
73
|
this._prevTabindex = 0;
|
|
74
|
+
this._hasContentBefore = false;
|
|
75
|
+
this._hasContentAfter = false;
|
|
69
76
|
this._handleFocus = () => {
|
|
70
77
|
this.focused = true;
|
|
71
78
|
};
|
|
@@ -144,14 +151,23 @@ let VscodeButton = class VscodeButton extends VscElement {
|
|
|
144
151
|
this._executeAction();
|
|
145
152
|
}
|
|
146
153
|
}
|
|
154
|
+
_handleSlotChange(ev) {
|
|
155
|
+
const slot = ev.target;
|
|
156
|
+
if (slot.name === 'content-before') {
|
|
157
|
+
this._hasContentBefore = slot.assignedElements().length > 0;
|
|
158
|
+
}
|
|
159
|
+
if (slot.name === 'content-after') {
|
|
160
|
+
this._hasContentAfter = slot.assignedElements().length > 0;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
147
163
|
render() {
|
|
148
164
|
const hasIcon = this.icon !== '';
|
|
149
165
|
const hasIconAfter = this.iconAfter !== '';
|
|
150
|
-
const
|
|
151
|
-
|
|
152
|
-
'has-icon-before': hasIcon,
|
|
153
|
-
'has-icon-after': hasIconAfter,
|
|
166
|
+
const baseClasses = {
|
|
167
|
+
base: true,
|
|
154
168
|
'icon-only': this.iconOnly,
|
|
169
|
+
'has-content-before': this._hasContentBefore,
|
|
170
|
+
'has-content-after': this._hasContentAfter,
|
|
155
171
|
};
|
|
156
172
|
const iconElem = hasIcon
|
|
157
173
|
? html `<vscode-icon
|
|
@@ -170,13 +186,16 @@ let VscodeButton = class VscodeButton extends VscElement {
|
|
|
170
186
|
></vscode-icon>`
|
|
171
187
|
: nothing;
|
|
172
188
|
return html `
|
|
173
|
-
<div
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
189
|
+
<div
|
|
190
|
+
class=${classMap(baseClasses)}
|
|
191
|
+
part="base"
|
|
192
|
+
@slotchange=${this._handleSlotChange}
|
|
193
|
+
>
|
|
194
|
+
<slot name="content-before"></slot>
|
|
195
|
+
${iconElem}
|
|
196
|
+
<slot></slot>
|
|
197
|
+
${iconAfterElem}
|
|
198
|
+
<slot name="content-after"></slot>
|
|
180
199
|
</div>
|
|
181
200
|
`;
|
|
182
201
|
}
|
|
@@ -236,6 +255,12 @@ __decorate([
|
|
|
236
255
|
__decorate([
|
|
237
256
|
property()
|
|
238
257
|
], VscodeButton.prototype, "value", void 0);
|
|
258
|
+
__decorate([
|
|
259
|
+
state()
|
|
260
|
+
], VscodeButton.prototype, "_hasContentBefore", void 0);
|
|
261
|
+
__decorate([
|
|
262
|
+
state()
|
|
263
|
+
], VscodeButton.prototype, "_hasContentAfter", void 0);
|
|
239
264
|
VscodeButton = __decorate([
|
|
240
265
|
customElement('vscode-button')
|
|
241
266
|
], VscodeButton);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vscode-button.js","sourceRoot":"","sources":["../../src/vscode-button/vscode-button.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAC,IAAI,EAAE,OAAO,EAAmC,MAAM,KAAK,CAAC;AACpE,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAC,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nothing, PropertyValueMap, TemplateResult} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {customElement, VscElement} from '../includes/VscElement.js';\nimport '../vscode-icon/index.js';\nimport styles from './vscode-button.styles.js';\nimport {ifDefined} from 'lit/directives/if-defined.js';\n\n/**\n * Clickable element that are used to trigger actions.\n *\n * @tag vscode-button\n *\n * @cssprop [--vscode-button-background=#0078d4]\n * @cssprop [--vscode-button-foreground=#ffffff]\n * @cssprop [--vscode-button-border=var(--vscode-button-background, rgba(255, 255, 255, 0.07))]\n * @cssprop [--vscode-button-hoverBackground=#026ec1]\n * @cssprop [--vscode-font-family=sans-serif] - A sans-serif font type depends on the host OS.\n * @cssprop [--vscode-font-size=13px]\n * @cssprop [--vscode-font-weight=normal]\n * @cssprop [--vscode-button-secondaryForeground=#cccccc]\n * @cssprop [--vscode-button-secondaryBackground=#313131]\n * @cssprop [--vscode-button-secondaryHoverBackground=#3c3c3c]\n * @cssprop [--vscode-focusBorder=#0078d4]\n */\n@customElement('vscode-button')\nexport class VscodeButton extends VscElement {\n static override styles = styles;\n\n /** @internal */\n static formAssociated = true;\n\n @property({type: Boolean, reflect: true})\n override autofocus = false;\n\n /** @internal */\n @property({type: Number, reflect: true})\n override tabIndex = 0;\n\n /**\n * Button has a less prominent style.\n */\n @property({type: Boolean, reflect: true})\n secondary = false;\n\n /** @internal */\n @property({reflect: true})\n override role = 'button';\n\n @property({type: Boolean, reflect: true})\n disabled = false;\n\n /**\n * A [Codicon](https://microsoft.github.io/vscode-codicons/dist/codicon.html) before the label\n */\n @property()\n icon = '';\n\n /**\n * Spin property for the icon\n */\n @property({type: Boolean, reflect: true, attribute: 'icon-spin'})\n iconSpin? = false;\n\n /**\n * Duration property for the icon\n */\n @property({type: Number, reflect: true, attribute: 'icon-spin-duration'})\n iconSpinDuration?: number;\n\n /**\n * A [Codicon](https://microsoft.github.io/vscode-codicons/dist/codicon.html) after the label\n */\n @property({attribute: 'icon-after'})\n iconAfter = '';\n\n /**\n * Spin property for the after icon\n */\n @property({type: Boolean, reflect: true, attribute: 'icon-after-spin'})\n iconAfterSpin = false;\n\n /**\n * Duration property for the after icon\n */\n @property({\n type: Number,\n reflect: true,\n attribute: 'icon-after-spin-duration',\n })\n iconAfterSpinDuration?: number;\n\n @property({type: Boolean, reflect: true})\n focused = false;\n\n @property({type: String, reflect: true})\n name: string | undefined = undefined;\n\n @property({type: Boolean, reflect: true, attribute: 'icon-only'})\n iconOnly = false;\n\n @property({reflect: true})\n type: 'submit' | 'reset' | 'button' = 'button';\n\n @property()\n value = '';\n\n private _prevTabindex = 0;\n private _internals: ElementInternals;\n\n get form(): HTMLFormElement | null {\n return this._internals.form;\n }\n\n constructor() {\n super();\n this.addEventListener('keydown', this._handleKeyDown.bind(this));\n this.addEventListener('click', this._handleClick.bind(this));\n this._internals = this.attachInternals();\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n\n if (this.autofocus) {\n if (this.tabIndex < 0) {\n this.tabIndex = 0;\n }\n\n this.updateComplete.then(() => {\n this.focus();\n this.requestUpdate();\n });\n }\n\n this.addEventListener('focus', this._handleFocus);\n this.addEventListener('blur', this._handleBlur);\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.removeEventListener('focus', this._handleFocus);\n this.removeEventListener('blur', this._handleBlur);\n }\n\n override update(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>\n ): void {\n super.update(changedProperties);\n\n if (changedProperties.has('value')) {\n this._internals.setFormValue(this.value);\n }\n\n if (changedProperties.has('disabled')) {\n if (this.disabled) {\n // Save the original tabIndex, which may have been modified by the user.\n this._prevTabindex = this.tabIndex;\n // It's a native property, we don't care about re-rendering.\n // eslint-disable-next-line lit/no-property-change-update\n this.tabIndex = -1;\n } else {\n // eslint-disable-next-line lit/no-property-change-update\n this.tabIndex = this._prevTabindex;\n }\n }\n }\n\n private _executeAction() {\n if (this.type === 'submit' && this._internals.form) {\n this._internals.form.requestSubmit();\n }\n\n if (this.type === 'reset' && this._internals.form) {\n this._internals.form.reset();\n }\n }\n\n private _handleKeyDown(event: KeyboardEvent) {\n if (\n (event.key === 'Enter' || event.key === ' ') &&\n !this.hasAttribute('disabled')\n ) {\n const syntheticClick = new MouseEvent('click', {\n bubbles: true,\n cancelable: true,\n }) as Event & {synthetic?: boolean};\n\n syntheticClick.synthetic = true;\n this.dispatchEvent(syntheticClick);\n\n this._executeAction();\n }\n }\n\n private _handleClick(event: MouseEvent) {\n if ((event as MouseEvent & {synthetic?: boolean}).synthetic) {\n return;\n }\n if (!this.hasAttribute('disabled')) {\n this._executeAction();\n }\n }\n\n private _handleFocus = () => {\n this.focused = true;\n };\n\n private _handleBlur = () => {\n this.focused = false;\n };\n\n override render(): TemplateResult {\n const hasIcon = this.icon !== '';\n const hasIconAfter = this.iconAfter !== '';\n const contentClasses = {\n content: true,\n 'has-icon-before': hasIcon,\n 'has-icon-after': hasIconAfter,\n 'icon-only': this.iconOnly,\n };\n\n const iconElem = hasIcon\n ? html`<vscode-icon\n name=${this.icon}\n ?spin=${this.iconSpin}\n spin-duration=${ifDefined(this.iconSpinDuration)}\n class=\"icon\"\n ></vscode-icon>`\n : nothing;\n\n const iconAfterElem = hasIconAfter\n ? html`<vscode-icon\n name=${this.iconAfter}\n ?spin=${this.iconAfterSpin}\n spin-duration=${ifDefined(this.iconAfterSpinDuration)}\n class=\"icon-after\"\n ></vscode-icon>`\n : nothing;\n\n return html`\n <div class=\"root\" part=\"base\">\n <div class=${classMap(contentClasses)}>\n ${iconElem}\n <slot></slot>\n ${iconAfterElem}\n </div>\n <div class=\"divider\"><div></div></div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'vscode-button': VscodeButton;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"vscode-button.js","sourceRoot":"","sources":["../../src/vscode-button/vscode-button.ts"],"names":[],"mappings":";;;;;;AAAA,O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+CACrB;AAMf;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,iBAAiB,EAAC,CAAC;mDACjD;AAUtB;IALC,QAAQ,CAAC;QACR,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,IAAI;QACb,SAAS,EAAE,0BAA0B;KACtC,CAAC;2DAC6B;AAG/B;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;6CACzB;AAGhB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;0CACH;AAGrC;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAC,CAAC;8CAChD;AAGjB;IADC,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;0CACqB;AAG/C;IADC,QAAQ,EAAE;2CACA;AAMH;IADP,KAAK,EAAE;uDAC0B;AAG1B;IADP,KAAK,EAAE;sDACyB;AAxFtB,YAAY;IADxB,aAAa,CAAC,eAAe,CAAC;GAClB,YAAY,CAuPxB","sourcesContent":["import {html, nothing, PropertyValueMap, TemplateResult} from 'lit';\nimport {property, state} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {customElement, VscElement} from '../includes/VscElement.js';\nimport '../vscode-icon/index.js';\nimport styles from './vscode-button.styles.js';\nimport {ifDefined} from 'lit/directives/if-defined.js';\n\n/**\n * Clickable element that are used to trigger actions.\n *\n * @tag vscode-button\n *\n * @cssprop [--vscode-button-background=#0078d4]\n * @cssprop [--vscode-button-foreground=#ffffff]\n * @cssprop [--vscode-button-border=var(--vscode-button-background, rgba(255, 255, 255, 0.07))]\n * @cssprop [--vscode-button-hoverBackground=#026ec1]\n * @cssprop [--vscode-font-family=sans-serif] - A sans-serif font type depends on the host OS.\n * @cssprop [--vscode-font-size=13px]\n * @cssprop [--vscode-font-weight=normal]\n * @cssprop [--vscode-button-secondaryForeground=#cccccc]\n * @cssprop [--vscode-button-secondaryBackground=#313131]\n * @cssprop [--vscode-button-secondaryHoverBackground=#3c3c3c]\n * @cssprop [--vscode-focusBorder=#0078d4]\n *\n * @csspart base - The main content area of the component.\n *\n * @slot content-before - Slot before the main content.\n * @slot content-after - Slot after the main content.\n */\n@customElement('vscode-button')\nexport class VscodeButton extends VscElement {\n static override styles = styles;\n\n /** @internal */\n static formAssociated = true;\n\n @property({type: Boolean, reflect: true})\n override autofocus = false;\n\n /** @internal */\n @property({type: Number, reflect: true})\n override tabIndex = 0;\n\n /**\n * Button has a less prominent style.\n */\n @property({type: Boolean, reflect: true})\n secondary = false;\n\n /** @internal */\n @property({reflect: true})\n override role = 'button';\n\n @property({type: Boolean, reflect: true})\n disabled = false;\n\n /**\n * A [Codicon](https://microsoft.github.io/vscode-codicons/dist/codicon.html) before the label\n */\n @property()\n icon = '';\n\n /**\n * Spin property for the icon\n */\n @property({type: Boolean, reflect: true, attribute: 'icon-spin'})\n iconSpin? = false;\n\n /**\n * Duration property for the icon\n */\n @property({type: Number, reflect: true, attribute: 'icon-spin-duration'})\n iconSpinDuration?: number;\n\n /**\n * A [Codicon](https://microsoft.github.io/vscode-codicons/dist/codicon.html) after the label\n */\n @property({attribute: 'icon-after'})\n iconAfter = '';\n\n /**\n * Spin property for the after icon\n */\n @property({type: Boolean, reflect: true, attribute: 'icon-after-spin'})\n iconAfterSpin = false;\n\n /**\n * Duration property for the after icon\n */\n @property({\n type: Number,\n reflect: true,\n attribute: 'icon-after-spin-duration',\n })\n iconAfterSpinDuration?: number;\n\n @property({type: Boolean, reflect: true})\n focused = false;\n\n @property({type: String, reflect: true})\n name: string | undefined = undefined;\n\n @property({type: Boolean, reflect: true, attribute: 'icon-only'})\n iconOnly = false;\n\n @property({reflect: true})\n type: 'submit' | 'reset' | 'button' = 'button';\n\n @property()\n value = '';\n\n private _prevTabindex = 0;\n private _internals: ElementInternals;\n\n @state()\n private _hasContentBefore = false;\n\n @state()\n private _hasContentAfter = false;\n\n get form(): HTMLFormElement | null {\n return this._internals.form;\n }\n\n constructor() {\n super();\n this.addEventListener('keydown', this._handleKeyDown.bind(this));\n this.addEventListener('click', this._handleClick.bind(this));\n this._internals = this.attachInternals();\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n\n if (this.autofocus) {\n if (this.tabIndex < 0) {\n this.tabIndex = 0;\n }\n\n this.updateComplete.then(() => {\n this.focus();\n this.requestUpdate();\n });\n }\n\n this.addEventListener('focus', this._handleFocus);\n this.addEventListener('blur', this._handleBlur);\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.removeEventListener('focus', this._handleFocus);\n this.removeEventListener('blur', this._handleBlur);\n }\n\n override update(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>\n ): void {\n super.update(changedProperties);\n\n if (changedProperties.has('value')) {\n this._internals.setFormValue(this.value);\n }\n\n if (changedProperties.has('disabled')) {\n if (this.disabled) {\n // Save the original tabIndex, which may have been modified by the user.\n this._prevTabindex = this.tabIndex;\n // It's a native property, we don't care about re-rendering.\n // eslint-disable-next-line lit/no-property-change-update\n this.tabIndex = -1;\n } else {\n // eslint-disable-next-line lit/no-property-change-update\n this.tabIndex = this._prevTabindex;\n }\n }\n }\n\n private _executeAction() {\n if (this.type === 'submit' && this._internals.form) {\n this._internals.form.requestSubmit();\n }\n\n if (this.type === 'reset' && this._internals.form) {\n this._internals.form.reset();\n }\n }\n\n private _handleKeyDown(event: KeyboardEvent) {\n if (\n (event.key === 'Enter' || event.key === ' ') &&\n !this.hasAttribute('disabled')\n ) {\n const syntheticClick = new MouseEvent('click', {\n bubbles: true,\n cancelable: true,\n }) as Event & {synthetic?: boolean};\n\n syntheticClick.synthetic = true;\n this.dispatchEvent(syntheticClick);\n\n this._executeAction();\n }\n }\n\n private _handleClick(event: MouseEvent) {\n if ((event as MouseEvent & {synthetic?: boolean}).synthetic) {\n return;\n }\n if (!this.hasAttribute('disabled')) {\n this._executeAction();\n }\n }\n\n private _handleFocus = () => {\n this.focused = true;\n };\n\n private _handleBlur = () => {\n this.focused = false;\n };\n\n private _handleSlotChange(ev: Event) {\n const slot = ev.target as HTMLSlotElement;\n\n if (slot.name === 'content-before') {\n this._hasContentBefore = slot.assignedElements().length > 0;\n }\n\n if (slot.name === 'content-after') {\n this._hasContentAfter = slot.assignedElements().length > 0;\n }\n }\n\n override render(): TemplateResult {\n const hasIcon = this.icon !== '';\n const hasIconAfter = this.iconAfter !== '';\n const baseClasses = {\n base: true,\n 'icon-only': this.iconOnly,\n 'has-content-before': this._hasContentBefore,\n 'has-content-after': this._hasContentAfter,\n };\n\n const iconElem = hasIcon\n ? html`<vscode-icon\n name=${this.icon}\n ?spin=${this.iconSpin}\n spin-duration=${ifDefined(this.iconSpinDuration)}\n class=\"icon\"\n ></vscode-icon>`\n : nothing;\n\n const iconAfterElem = hasIconAfter\n ? html`<vscode-icon\n name=${this.iconAfter}\n ?spin=${this.iconAfterSpin}\n spin-duration=${ifDefined(this.iconAfterSpinDuration)}\n class=\"icon-after\"\n ></vscode-icon>`\n : nothing;\n\n return html`\n <div\n class=${classMap(baseClasses)}\n part=\"base\"\n @slotchange=${this._handleSlotChange}\n >\n <slot name=\"content-before\"></slot>\n ${iconElem}\n <slot></slot>\n ${iconAfterElem}\n <slot name=\"content-after\"></slot>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'vscode-button': VscodeButton;\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,EAAY,MAAM,KAAK,CAAC;AAMnD,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,EAAY,MAAM,KAAK,CAAC;AAMnD,QAAA,MAAM,MAAM,EAAE,cAgLb,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -11,7 +11,8 @@ const styles = [
|
|
|
11
11
|
width: auto;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
.
|
|
14
|
+
.base {
|
|
15
|
+
align-items: center;
|
|
15
16
|
background-color: var(--vscode-button-background, #0078d4);
|
|
16
17
|
border-bottom-left-radius: var(--vsc-border-left-radius, 2px);
|
|
17
18
|
border-bottom-right-radius: var(--vsc-border-right-radius, 2px);
|
|
@@ -25,19 +26,42 @@ const styles = [
|
|
|
25
26
|
border-top-width: 1px;
|
|
26
27
|
box-sizing: border-box;
|
|
27
28
|
color: var(--vscode-button-foreground, #ffffff);
|
|
28
|
-
display:
|
|
29
|
+
display: flex;
|
|
29
30
|
font-family: var(--vscode-font-family, ${defaultFontStack});
|
|
30
31
|
font-size: var(--vscode-font-size, 13px);
|
|
31
32
|
font-weight: var(--vscode-font-weight, normal);
|
|
33
|
+
height: 100%;
|
|
34
|
+
justify-content: center;
|
|
32
35
|
line-height: 22px;
|
|
33
36
|
overflow: hidden;
|
|
34
|
-
padding:
|
|
37
|
+
padding: 1px calc(13px + var(--vsc-base-additional-right-padding, 0px))
|
|
38
|
+
1px 13px;
|
|
39
|
+
position: relative;
|
|
35
40
|
user-select: none;
|
|
36
41
|
white-space: nowrap;
|
|
37
42
|
width: 100%;
|
|
38
43
|
}
|
|
39
44
|
|
|
40
|
-
:
|
|
45
|
+
.base:after {
|
|
46
|
+
background-color: var(
|
|
47
|
+
--vscode-button-separator,
|
|
48
|
+
rgba(255, 255, 255, 0.4)
|
|
49
|
+
);
|
|
50
|
+
content: var(--vsc-base-after-content);
|
|
51
|
+
display: var(--vsc-divider-display, none);
|
|
52
|
+
position: absolute;
|
|
53
|
+
right: 0;
|
|
54
|
+
top: 4px;
|
|
55
|
+
bottom: 4px;
|
|
56
|
+
width: 1px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
:host([secondary]) .base:after {
|
|
60
|
+
background-color: var(--vscode-button-secondaryForeground, #cccccc);
|
|
61
|
+
opacity: 0.4;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
:host([secondary]) .base {
|
|
41
65
|
color: var(--vscode-button-secondaryForeground, #cccccc);
|
|
42
66
|
background-color: var(--vscode-button-secondaryBackground, #313131);
|
|
43
67
|
border-color: var(
|
|
@@ -52,19 +76,19 @@ const styles = [
|
|
|
52
76
|
pointer-events: none;
|
|
53
77
|
}
|
|
54
78
|
|
|
55
|
-
:host(:hover) .
|
|
79
|
+
:host(:hover) .base {
|
|
56
80
|
background-color: var(--vscode-button-hoverBackground, #026ec1);
|
|
57
81
|
}
|
|
58
82
|
|
|
59
|
-
:host([disabled]:hover) .
|
|
83
|
+
:host([disabled]:hover) .base {
|
|
60
84
|
background-color: var(--vscode-button-background, #0078d4);
|
|
61
85
|
}
|
|
62
86
|
|
|
63
|
-
:host([secondary]:hover) .
|
|
87
|
+
:host([secondary]:hover) .base {
|
|
64
88
|
background-color: var(--vscode-button-secondaryHoverBackground, #3c3c3c);
|
|
65
89
|
}
|
|
66
90
|
|
|
67
|
-
:host([secondary][disabled]:hover) .
|
|
91
|
+
:host([secondary][disabled]:hover) .base {
|
|
68
92
|
background-color: var(--vscode-button-secondaryBackground, #313131);
|
|
69
93
|
}
|
|
70
94
|
|
|
@@ -73,22 +97,22 @@ const styles = [
|
|
|
73
97
|
outline: none;
|
|
74
98
|
}
|
|
75
99
|
|
|
76
|
-
:host(:focus) .
|
|
100
|
+
:host(:focus) .base {
|
|
77
101
|
background-color: var(--vscode-button-hoverBackground, #026ec1);
|
|
78
102
|
outline: 1px solid var(--vscode-focusBorder, #0078d4);
|
|
79
103
|
outline-offset: 2px;
|
|
80
104
|
}
|
|
81
105
|
|
|
82
|
-
:host([disabled]:focus) .
|
|
106
|
+
:host([disabled]:focus) .base {
|
|
83
107
|
background-color: var(--vscode-button-background, #0078d4);
|
|
84
108
|
outline: 0;
|
|
85
109
|
}
|
|
86
110
|
|
|
87
|
-
:host([secondary]:focus) .
|
|
111
|
+
:host([secondary]:focus) .base {
|
|
88
112
|
background-color: var(--vscode-button-secondaryHoverBackground, #3c3c3c);
|
|
89
113
|
}
|
|
90
114
|
|
|
91
|
-
:host([secondary][disabled]:focus) .
|
|
115
|
+
:host([secondary][disabled]:focus) .base {
|
|
92
116
|
background-color: var(--vscode-button-secondaryBackground, #313131);
|
|
93
117
|
}
|
|
94
118
|
|
|
@@ -111,20 +135,17 @@ const styles = [
|
|
|
111
135
|
}
|
|
112
136
|
|
|
113
137
|
.content {
|
|
114
|
-
align-items: center;
|
|
115
|
-
box-sizing: border-box;
|
|
116
138
|
display: flex;
|
|
117
|
-
justify-content: center;
|
|
118
139
|
position: relative;
|
|
119
140
|
width: 100%;
|
|
120
141
|
height: 100%;
|
|
121
142
|
padding: 1px 13px;
|
|
122
143
|
}
|
|
123
144
|
|
|
124
|
-
:host(:empty) .
|
|
125
|
-
|
|
145
|
+
:host(:empty) .base,
|
|
146
|
+
.base.icon-only {
|
|
126
147
|
min-height: 24px;
|
|
127
|
-
min-width:
|
|
148
|
+
min-width: 26px;
|
|
128
149
|
padding: 1px 4px;
|
|
129
150
|
}
|
|
130
151
|
|
|
@@ -134,6 +155,14 @@ const styles = [
|
|
|
134
155
|
height: 100%;
|
|
135
156
|
}
|
|
136
157
|
|
|
158
|
+
.has-content-before slot[name='content-before'] {
|
|
159
|
+
margin-right: 4px;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.has-content-after slot[name='content-after'] {
|
|
163
|
+
margin-left: 4px;
|
|
164
|
+
}
|
|
165
|
+
|
|
137
166
|
.icon,
|
|
138
167
|
.icon-after {
|
|
139
168
|
color: inherit;
|
|
@@ -148,42 +177,6 @@ const styles = [
|
|
|
148
177
|
:host([icon]) .icon-after {
|
|
149
178
|
margin-left: 3px;
|
|
150
179
|
}
|
|
151
|
-
|
|
152
|
-
.divider {
|
|
153
|
-
display: var(--vsc-divider-display, none);
|
|
154
|
-
background-color: transparent;
|
|
155
|
-
padding: 4px 0;
|
|
156
|
-
box-sizing: border-box;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
:host(:hover) .divider,
|
|
160
|
-
:host(:focus) .divider {
|
|
161
|
-
background-color: var(--vscode-button-hoverBackground, #026ec1);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
:host([secondary]) .divider {
|
|
165
|
-
background-color: var(--vscode-button-secondaryBackground, #313131);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
:host([secondary]:hover) .divider,
|
|
169
|
-
:host([secondary]:focus) .divider {
|
|
170
|
-
background-color: var(--vscode-button-secondaryHoverBackground, #3c3c3c);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
.divider > div {
|
|
174
|
-
background-color: var(
|
|
175
|
-
--vscode-button-separator,
|
|
176
|
-
rgba(255, 255, 255, 0.4)
|
|
177
|
-
);
|
|
178
|
-
height: 100%;
|
|
179
|
-
width: 1px;
|
|
180
|
-
margin: 0;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
:host([secondary]) .divider > div {
|
|
184
|
-
background-color: var(--vscode-button-secondaryForeground, #cccccc);
|
|
185
|
-
opacity: 0.4;
|
|
186
|
-
}
|
|
187
180
|
`,
|
|
188
181
|
];
|
|
189
182
|
export default styles;
|
|
@@ -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,EAAkB,SAAS,EAAC,MAAM,KAAK,CAAC;AACnD,OAAO,aAAa,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAC,mBAAmB,EAAC,MAAM,wBAAwB,CAAC;AAE3D,MAAM,gBAAgB,GAAG,SAAS,CAAC,mBAAmB,EAAE,CAAC,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,EAAkB,SAAS,EAAC,MAAM,KAAK,CAAC;AACnD,OAAO,aAAa,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAC,mBAAmB,EAAC,MAAM,wBAAwB,CAAC;AAE3D,MAAM,gBAAgB,GAAG,SAAS,CAAC,mBAAmB,EAAE,CAAC,CAAC;AAE1D,MAAM,MAAM,GAAmB;IAC7B,aAAa;IACb,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;+CAuB0C,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsJ5D;CACF,CAAC;AAEF,eAAe,MAAM,CAAC","sourcesContent":["import {css, CSSResultGroup, unsafeCSS} from 'lit';\nimport defaultStyles from '../includes/default.styles.js';\nimport {getDefaultFontStack} from '../includes/helpers.js';\n\nconst defaultFontStack = unsafeCSS(getDefaultFontStack());\n\nconst styles: CSSResultGroup = [\n defaultStyles,\n css`\n :host {\n cursor: pointer;\n display: inline-block;\n width: auto;\n }\n\n .base {\n align-items: center;\n background-color: var(--vscode-button-background, #0078d4);\n border-bottom-left-radius: var(--vsc-border-left-radius, 2px);\n border-bottom-right-radius: var(--vsc-border-right-radius, 2px);\n border-bottom-width: 1px;\n border-color: var(--vscode-button-border, transparent);\n border-left-width: var(--vsc-border-left-width, 1px);\n border-right-width: var(--vsc-border-right-width, 1px);\n border-style: solid;\n border-top-left-radius: var(--vsc-border-left-radius, 2px);\n border-top-right-radius: var(--vsc-border-right-radius, 2px);\n border-top-width: 1px;\n box-sizing: border-box;\n color: var(--vscode-button-foreground, #ffffff);\n display: flex;\n font-family: var(--vscode-font-family, ${defaultFontStack});\n font-size: var(--vscode-font-size, 13px);\n font-weight: var(--vscode-font-weight, normal);\n height: 100%;\n justify-content: center;\n line-height: 22px;\n overflow: hidden;\n padding: 1px calc(13px + var(--vsc-base-additional-right-padding, 0px))\n 1px 13px;\n position: relative;\n user-select: none;\n white-space: nowrap;\n width: 100%;\n }\n\n .base:after {\n background-color: var(\n --vscode-button-separator,\n rgba(255, 255, 255, 0.4)\n );\n content: var(--vsc-base-after-content);\n display: var(--vsc-divider-display, none);\n position: absolute;\n right: 0;\n top: 4px;\n bottom: 4px;\n width: 1px;\n }\n\n :host([secondary]) .base:after {\n background-color: var(--vscode-button-secondaryForeground, #cccccc);\n opacity: 0.4;\n }\n\n :host([secondary]) .base {\n color: var(--vscode-button-secondaryForeground, #cccccc);\n background-color: var(--vscode-button-secondaryBackground, #313131);\n border-color: var(\n --vscode-button-border,\n var(--vscode-button-secondaryBackground, rgba(255, 255, 255, 0.07))\n );\n }\n\n :host([disabled]) {\n cursor: default;\n opacity: 0.4;\n pointer-events: none;\n }\n\n :host(:hover) .base {\n background-color: var(--vscode-button-hoverBackground, #026ec1);\n }\n\n :host([disabled]:hover) .base {\n background-color: var(--vscode-button-background, #0078d4);\n }\n\n :host([secondary]:hover) .base {\n background-color: var(--vscode-button-secondaryHoverBackground, #3c3c3c);\n }\n\n :host([secondary][disabled]:hover) .base {\n background-color: var(--vscode-button-secondaryBackground, #313131);\n }\n\n :host(:focus),\n :host(:active) {\n outline: none;\n }\n\n :host(:focus) .base {\n background-color: var(--vscode-button-hoverBackground, #026ec1);\n outline: 1px solid var(--vscode-focusBorder, #0078d4);\n outline-offset: 2px;\n }\n\n :host([disabled]:focus) .base {\n background-color: var(--vscode-button-background, #0078d4);\n outline: 0;\n }\n\n :host([secondary]:focus) .base {\n background-color: var(--vscode-button-secondaryHoverBackground, #3c3c3c);\n }\n\n :host([secondary][disabled]:focus) .base {\n background-color: var(--vscode-button-secondaryBackground, #313131);\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(*:last-child) {\n margin-right: 0;\n }\n\n ::slotted(vscode-icon) {\n color: inherit;\n }\n\n .content {\n display: flex;\n position: relative;\n width: 100%;\n height: 100%;\n padding: 1px 13px;\n }\n\n :host(:empty) .base,\n .base.icon-only {\n min-height: 24px;\n min-width: 26px;\n padding: 1px 4px;\n }\n\n slot {\n align-items: center;\n display: flex;\n height: 100%;\n }\n\n .has-content-before slot[name='content-before'] {\n margin-right: 4px;\n }\n\n .has-content-after slot[name='content-after'] {\n margin-left: 4px;\n }\n\n .icon,\n .icon-after {\n color: inherit;\n display: block;\n }\n\n :host(:not(:empty)) .icon {\n margin-right: 3px;\n }\n\n :host(:not(:empty)) .icon-after,\n :host([icon]) .icon-after {\n margin-left: 3px;\n }\n `,\n];\n\nexport default styles;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vscode-button-group.styles.d.ts","sourceRoot":"","sources":["../../src/vscode-button-group/vscode-button-group.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,cAAc,EAAC,MAAM,KAAK,CAAC;AAIxC,QAAA,MAAM,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"vscode-button-group.styles.d.ts","sourceRoot":"","sources":["../../src/vscode-button-group/vscode-button-group.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,cAAc,EAAC,MAAM,KAAK,CAAC;AAIxC,QAAA,MAAM,MAAM,EAAE,cAoCb,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -21,6 +21,8 @@ const styles = [
|
|
|
21
21
|
|
|
22
22
|
::slotted(vscode-button:not(:last-child)) {
|
|
23
23
|
--vsc-divider-display: block;
|
|
24
|
+
--vsc-base-additional-right-padding: 1px;
|
|
25
|
+
--vsc-base-after-content: '';
|
|
24
26
|
--vsc-border-right-width: 0;
|
|
25
27
|
--vsc-border-right-radius: 0;
|
|
26
28
|
--vsc-border-right-width: 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vscode-button-group.styles.js","sourceRoot":"","sources":["../../src/vscode-button-group/vscode-button-group.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAiB,MAAM,KAAK,CAAC;AAExC,OAAO,aAAa,MAAM,+BAA+B,CAAC;AAE1D,MAAM,MAAM,GAAmB;IAC7B,aAAa;IACb,GAAG,CAAA
|
|
1
|
+
{"version":3,"file":"vscode-button-group.styles.js","sourceRoot":"","sources":["../../src/vscode-button-group/vscode-button-group.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAiB,MAAM,KAAK,CAAC;AAExC,OAAO,aAAa,MAAM,+BAA+B,CAAC;AAE1D,MAAM,MAAM,GAAmB;IAC7B,aAAa;IACb,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCF;CACF,CAAC;AAEF,eAAe,MAAM,CAAC","sourcesContent":["import {css, CSSResultGroup} from 'lit';\n\nimport defaultStyles from '../includes/default.styles.js';\n\nconst styles: CSSResultGroup = [\n defaultStyles,\n css`\n :host {\n display: inline-block;\n }\n\n .root {\n align-items: stretch;\n display: flex;\n width: 100%;\n }\n\n ::slotted(vscode-button:not(:first-child)) {\n --vsc-border-left-width: 0;\n --vsc-border-left-radius: 0;\n --vsc-border-left-width: 0;\n }\n\n ::slotted(vscode-button:not(:last-child)) {\n --vsc-divider-display: block;\n --vsc-base-additional-right-padding: 1px;\n --vsc-base-after-content: '';\n --vsc-border-right-width: 0;\n --vsc-border-right-radius: 0;\n --vsc-border-right-width: 0;\n }\n\n ::slotted(vscode-button:focus) {\n z-index: 1;\n }\n\n ::slotted(vscode-button:not(:empty)) {\n width: 100%;\n }\n `,\n];\n\nexport default styles;\n"]}
|