@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.
Files changed (47) hide show
  1. package/README.md +1 -1
  2. package/custom-elements.json +1235 -963
  3. package/dist/bundled.js +286 -124
  4. package/dist/includes/VscElement.js +1 -1
  5. package/dist/includes/VscElement.js.map +1 -1
  6. package/dist/includes/test-helpers.d.ts +2 -2
  7. package/dist/includes/test-helpers.d.ts.map +1 -1
  8. package/dist/includes/test-helpers.js +2 -1
  9. package/dist/includes/test-helpers.js.map +1 -1
  10. package/dist/main.d.ts +1 -0
  11. package/dist/main.d.ts.map +1 -1
  12. package/dist/main.js +1 -0
  13. package/dist/main.js.map +1 -1
  14. package/dist/vscode-button/vscode-button.d.ts +8 -0
  15. package/dist/vscode-button/vscode-button.d.ts.map +1 -1
  16. package/dist/vscode-button/vscode-button.js +37 -12
  17. package/dist/vscode-button/vscode-button.js.map +1 -1
  18. package/dist/vscode-button/vscode-button.styles.d.ts.map +1 -1
  19. package/dist/vscode-button/vscode-button.styles.js +47 -54
  20. package/dist/vscode-button/vscode-button.styles.js.map +1 -1
  21. package/dist/vscode-button-group/vscode-button-group.styles.d.ts.map +1 -1
  22. package/dist/vscode-button-group/vscode-button-group.styles.js +2 -0
  23. package/dist/vscode-button-group/vscode-button-group.styles.js.map +1 -1
  24. package/dist/vscode-checkbox/vscode-checkbox.d.ts +5 -2
  25. package/dist/vscode-checkbox/vscode-checkbox.d.ts.map +1 -1
  26. package/dist/vscode-checkbox/vscode-checkbox.js +14 -9
  27. package/dist/vscode-checkbox/vscode-checkbox.js.map +1 -1
  28. package/dist/vscode-checkbox/vscode-checkbox.styles.d.ts.map +1 -1
  29. package/dist/vscode-checkbox/vscode-checkbox.styles.js +71 -0
  30. package/dist/vscode-checkbox/vscode-checkbox.styles.js.map +1 -1
  31. package/dist/vscode-progress-bar/index.d.ts +2 -0
  32. package/dist/vscode-progress-bar/index.d.ts.map +1 -0
  33. package/dist/vscode-progress-bar/index.js +2 -0
  34. package/dist/vscode-progress-bar/index.js.map +1 -0
  35. package/dist/vscode-progress-bar/vscode-progress-bar.d.ts +45 -0
  36. package/dist/vscode-progress-bar/vscode-progress-bar.d.ts.map +1 -0
  37. package/dist/vscode-progress-bar/vscode-progress-bar.js +135 -0
  38. package/dist/vscode-progress-bar/vscode-progress-bar.js.map +1 -0
  39. package/dist/vscode-progress-bar/vscode-progress-bar.styles.d.ts +4 -0
  40. package/dist/vscode-progress-bar/vscode-progress-bar.styles.d.ts.map +1 -0
  41. package/dist/vscode-progress-bar/vscode-progress-bar.styles.js +82 -0
  42. package/dist/vscode-progress-bar/vscode-progress-bar.styles.js.map +1 -0
  43. package/dist/vscode-table/vscode-table.js +1 -1
  44. package/dist/vscode-table/vscode-table.js.map +1 -1
  45. package/package.json +1 -1
  46. package/vscode.css-custom-data.json +5 -0
  47. package/vscode.html-custom-data.json +33 -1
@@ -1,4 +1,4 @@
1
- import { PropertyValueMap, TemplateResult } from 'lit';
1
+ import { TemplateResult } from 'lit';
2
2
  import { FormButtonWidgetBase } from '../includes/form-button-widget/FormButtonWidgetBase.js';
3
3
  import { AssociatedFormControl } from '../includes/AssociatedFormControl.js';
4
4
  declare const VscodeCheckbox_base: (new (...args: any[]) => import("../includes/form-button-widget/LabelledCheckboxOrRadio.js").LabelledCheckboxOrRadioInterface) & typeof FormButtonWidgetBase;
@@ -50,6 +50,10 @@ export declare class VscodeCheckbox extends VscodeCheckbox_base implements Assoc
50
50
  defaultChecked: boolean;
51
51
  invalid: boolean;
52
52
  name: string | undefined;
53
+ /**
54
+ * When true, renders as a toggle switch instead of a checkbox.
55
+ */
56
+ toggle: boolean;
53
57
  /**
54
58
  * Associate a value to the checkbox. According to the native checkbox [specification](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#value_2), If the component participates in a form:
55
59
  *
@@ -87,7 +91,6 @@ export declare class VscodeCheckbox extends VscodeCheckbox_base implements Assoc
87
91
  constructor();
88
92
  connectedCallback(): void;
89
93
  disconnectedCallback(): void;
90
- update(changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
91
94
  /** @internal */
92
95
  formResetCallback(): void;
93
96
  /** @internal */
@@ -1 +1 @@
1
- {"version":3,"file":"vscode-checkbox.d.ts","sourceRoot":"","sources":["../../src/vscode-checkbox/vscode-checkbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,gBAAgB,EAAE,cAAc,EAAC,MAAM,KAAK,CAAC;AAIhF,OAAO,EAAC,oBAAoB,EAAC,MAAM,wDAAwD,CAAC;AAG5F,OAAO,EAAC,qBAAqB,EAAC,MAAM,sCAAsC,CAAC;;AAE3E;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,qBACa,cACX,SAAQ,mBACR,YAAW,qBAAqB;IAEhC,OAAgB,MAAM,+BAAU;IAEhC,gBAAgB;IAChB,MAAM,CAAC,cAAc,UAAQ;IAE7B,gBAAgB;IAChB,OAAgB,iBAAiB,EAAE,cAAc,CAG/C;IAEF;;;;OAIG;IAEM,SAAS,UAAS;IAE3B,IACI,OAAO,CAAC,MAAM,EAAE,OAAO,EAI1B;IACD,IAAI,OAAO,IAAI,OAAO,CAErB;IAED,OAAO,CAAC,QAAQ,CAAS;IAEzB;;OAEG;IAEH,cAAc,UAAS;IAGvB,OAAO,UAAS;IAGhB,IAAI,EAAE,MAAM,GAAG,SAAS,CAAa;IAErC;;;;;;OAMG;IAEH,KAAK,SAAM;IAGX,QAAQ,UAAS;IAGjB,aAAa,UAAS;IAEtB,IACI,QAAQ,CAAC,MAAM,EAAE,OAAO,EAI3B;IACD,IAAI,QAAQ,IALS,OAAO,CAO3B;IACD,OAAO,CAAC,SAAS,CAAS;IAE1B,IAAI,IAAI,IAAI,eAAe,GAAG,IAAI,CAEjC;IAED,gBAAgB;IAEhB,IAAI,SAAc;IAElB,IAAI,QAAQ,IAAI,aAAa,CAE5B;IAED,IAAI,iBAAiB,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UAAU,qBAAqB;QAC7B,iBAAiB,EAAE,cAAc,CAAC;KACnC;CACF"}
@@ -5,6 +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, LitElement, nothing } from 'lit';
8
+ import { ifDefined } from 'lit/directives/if-defined.js';
8
9
  import { property, query } from 'lit/decorators.js';
9
10
  import { classMap } from 'lit/directives/class-map.js';
10
11
  import { customElement } from '../includes/VscElement.js';
@@ -101,6 +102,10 @@ let VscodeCheckbox = class VscodeCheckbox extends LabelledCheckboxOrRadioMixin(F
101
102
  this.defaultChecked = false;
102
103
  this.invalid = false;
103
104
  this.name = undefined;
105
+ /**
106
+ * When true, renders as a toggle switch instead of a checkbox.
107
+ */
108
+ this.toggle = false;
104
109
  /**
105
110
  * Associate a value to the checkbox. According to the native checkbox [specification](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#value_2), If the component participates in a form:
106
111
  *
@@ -145,14 +150,6 @@ let VscodeCheckbox = class VscodeCheckbox extends LabelledCheckboxOrRadioMixin(F
145
150
  disconnectedCallback() {
146
151
  this.removeEventListener('keydown', this._handleKeyDown);
147
152
  }
148
- update(
149
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
150
- changedProperties) {
151
- super.update(changedProperties);
152
- if (changedProperties.has('checked')) {
153
- this.ariaChecked = this.checked ? 'true' : 'false';
154
- }
155
- }
156
153
  /** @internal */
157
154
  formResetCallback() {
158
155
  this.checked = this.defaultChecked;
@@ -222,6 +219,9 @@ let VscodeCheckbox = class VscodeCheckbox extends LabelledCheckboxOrRadioMixin(F
222
219
  const indeterminate = this.indeterminate
223
220
  ? html `<span class="indeterminate-icon"></span>`
224
221
  : nothing;
222
+ const iconContent = this.toggle
223
+ ? html `<span class="thumb"></span>`
224
+ : html `${indeterminate}${check}`;
225
225
  return html `
226
226
  <div class="wrapper">
227
227
  <input
@@ -230,9 +230,11 @@ let VscodeCheckbox = class VscodeCheckbox extends LabelledCheckboxOrRadioMixin(F
230
230
  class="checkbox"
231
231
  type="checkbox"
232
232
  ?checked=${this.checked}
233
+ role=${ifDefined(this.toggle ? 'switch' : undefined)}
234
+ aria-checked=${ifDefined(this.toggle ? (this.checked ? 'true' : 'false') : undefined)}
233
235
  value=${this.value}
234
236
  >
235
- <div class=${iconClasses}>${indeterminate}${check}</div>
237
+ <div class=${iconClasses}>${iconContent}</div>
236
238
  <label for="input" class="label" @click=${this._handleClick}>
237
239
  <span class=${labelInnerClasses}>
238
240
  ${this._renderLabelAttribute()}
@@ -266,6 +268,9 @@ __decorate([
266
268
  __decorate([
267
269
  property({ reflect: true })
268
270
  ], VscodeCheckbox.prototype, "name", void 0);
271
+ __decorate([
272
+ property({ type: Boolean, reflect: true })
273
+ ], VscodeCheckbox.prototype, "toggle", void 0);
269
274
  __decorate([
270
275
  property()
271
276
  ], VscodeCheckbox.prototype, "value", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"vscode-checkbox.js","sourceRoot":"","sources":["../../src/vscode-checkbox/vscode-checkbox.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAmC,MAAM,KAAK,CAAC;AAChF,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAC,aAAa,EAAC,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAC,oBAAoB,EAAC,MAAM,wDAAwD,CAAC;AAC5F,OAAO,EAAC,4BAA4B,EAAC,MAAM,2DAA2D,CAAC;AACvG,OAAO,MAAM,MAAM,6BAA6B,CAAC;AAGjD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEI,IAAM,cAAc,GAApB,MAAM,cACX,SAAQ,4BAA4B,CAAC,oBAAoB,CAAC;IAuB1D,IAAI,OAAO,CAAC,MAAe;QACzB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hC,gBAAgB;AACT,6BAAc,GAAG,IAAI,AAAP,CAAQ;AAE7B,gBAAgB;AACA,gCAAiB,GAAmB;IAClD,GAAG,UAAU,CAAC,iBAAiB;IAC/B,cAAc,EAAE,IAAI;CACrB,AAHgC,CAG/B;AAQO;IADR,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;iDACd;AAG3B;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;6CAKxC;AAWD;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,iBAAiB,EAAC,CAAC;sDAChD;AAGvB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;+CACzB;AAGhB;IADC,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;4CACW;AAUrC;IADC,QAAQ,EAAE;6CACA;AAGX;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;gDACxB;AAGjB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;qDACnB;AAGtB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;8CAKxC;AAYD;IADC,QAAQ,EAAE;4CACO;AAkFV;IADP,KAAK,CAAC,QAAQ,CAAC;gDACoB;AAlKzB,cAAc;IAD1B,aAAa,CAAC,iBAAiB,CAAC;GACpB,cAAc,CAsR1B","sourcesContent":["import {html, LitElement, nothing, PropertyValueMap, TemplateResult} from 'lit';\nimport {property, query} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {customElement} from '../includes/VscElement.js';\nimport {FormButtonWidgetBase} from '../includes/form-button-widget/FormButtonWidgetBase.js';\nimport {LabelledCheckboxOrRadioMixin} from '../includes/form-button-widget/LabelledCheckboxOrRadio.js';\nimport styles from './vscode-checkbox.styles.js';\nimport {AssociatedFormControl} from '../includes/AssociatedFormControl.js';\n\n/**\n * Allows users to select one or more options from a set. When participating in a form, it supports\n * the `:invalid` pseudo class. Otherwise the error styles can be applied through the `invalid`\n * property.\n *\n * @tag vscode-checkbox\n *\n * @attr name - Name which is used as a variable name in the data of the form-container.\n * @attr label - Attribute pair of the `label` property.\n * @prop label - Label text. It is only applied if component's innerHTML doesn't contain any text.\n *\n * @fires {Event} change - Dispatched when checked state is changed. The event is bubbled, so it can be listened on a parent element like the `CheckboxGroup`.\n * @fires {Event} invalid - Dispatched when the element is invalid and `checkValidity()` has been called or the form containing this element is submitted.\n *\n * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event)\n *\n * @cssprop [--vscode-font-family=sans-serif]\n * @cssprop [--vscode-font-size=13px]\n * @cssprop [--vscode-font-weight=normal]\n * @cssprop [--vscode-foreground=#cccccc]\n * @cssprop [--vscode-settings-checkboxBackground=#313131]\n * @cssprop [--vscode-settings-checkboxBorder=#3c3c3c]\n * @cssprop [--vscode-settings-checkboxForeground=#cccccc]\n * @cssprop [--vscode-focusBorder=#0078d4]\n * @cssprop [--vscode-inputValidation-errorBackground=#5a1d1d]\n * @cssprop [--vscode-inputValidation-errorBorder=#be1100]\n */\n@customElement('vscode-checkbox')\nexport class VscodeCheckbox\n extends LabelledCheckboxOrRadioMixin(FormButtonWidgetBase)\n implements AssociatedFormControl\n{\n static override styles = styles;\n\n /** @internal */\n static formAssociated = true;\n\n /** @internal */\n static override shadowRootOptions: ShadowRootInit = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n /**\n * Automatically focus on the element when the page loads.\n *\n * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus)\n */\n @property({type: Boolean, reflect: true})\n override autofocus = false;\n\n @property({type: Boolean, reflect: true})\n set checked(newVal: boolean) {\n this._checked = newVal;\n this._manageRequired();\n this.requestUpdate();\n }\n get checked(): boolean {\n return this._checked;\n }\n\n private _checked = false;\n\n /**\n * The element's initial checked state, which will be restored when the containing form is reset.\n */\n @property({type: Boolean, reflect: true, attribute: 'default-checked'})\n defaultChecked = false;\n\n @property({type: Boolean, reflect: true})\n invalid = false;\n\n @property({reflect: true})\n name: string | undefined = undefined;\n\n /**\n * Associate a value to the checkbox. According to the native checkbox [specification](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#value_2), If the component participates in a form:\n *\n * - If it is unchecked, the value will not be submitted.\n * - If it is checked but the value is not set, `on` will be submitted.\n * - If it is checked and value is set, the value will be submitted.\n */\n @property()\n value = '';\n\n @property({type: Boolean, reflect: true})\n disabled = false;\n\n @property({type: Boolean, reflect: true})\n indeterminate = false;\n\n @property({type: Boolean, reflect: true})\n set required(newVal: boolean) {\n this._required = newVal;\n this._manageRequired();\n this.requestUpdate();\n }\n get required() {\n return this._required;\n }\n private _required = false;\n\n get form(): HTMLFormElement | null {\n return this._internals.form;\n }\n\n /** @internal */\n @property()\n type = 'checkbox';\n\n get validity(): ValidityState {\n return this._internals.validity;\n }\n\n get validationMessage(): string {\n return this._internals.validationMessage;\n }\n\n get willValidate(): boolean {\n return this._internals.willValidate;\n }\n\n /**\n * Returns `true` if the element's value is valid; otherwise, it returns `false`.\n * If the element's value is invalid, an invalid event is triggered on the element.\n *\n * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/checkValidity)\n */\n checkValidity(): boolean {\n return this._internals.checkValidity();\n }\n\n /**\n * Returns `true` if the element's value is valid; otherwise, it returns `false`.\n * If the element's value is invalid, an invalid event is triggered on the element, and the\n * browser displays an error message to the user.\n *\n * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/reportValidity)\n */\n reportValidity(): boolean {\n return this._internals.reportValidity();\n }\n\n constructor() {\n super();\n this._internals = this.attachInternals();\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n\n this.addEventListener('keydown', this._handleKeyDown);\n\n this.updateComplete.then(() => {\n this._manageRequired();\n this._setActualFormValue();\n });\n }\n\n override disconnectedCallback(): void {\n this.removeEventListener('keydown', this._handleKeyDown);\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('checked')) {\n this.ariaChecked = this.checked ? 'true' : 'false';\n }\n }\n\n /** @internal */\n formResetCallback(): void {\n this.checked = this.defaultChecked;\n }\n\n /** @internal */\n formStateRestoreCallback(\n state: string,\n _mode: 'restore' | 'autocomplete'\n ): void {\n if (state) {\n this.checked = true;\n }\n }\n\n @query('#input')\n private _inputEl!: HTMLInputElement;\n\n private _internals: ElementInternals;\n\n // Sets the value of the control according to the native checkbox behavior.\n // - If the checkbox is unchecked, the value will be null, so the control will\n // excluded from the form.\n // - If the control is checked but the value is not set, the value will be \"on\".\n // - If the control is checked and value is set, the value won't be changed.\n private _setActualFormValue() {\n let actualValue: string | null = '';\n\n if (this.checked) {\n actualValue = !this.value ? 'on' : this.value;\n } else {\n actualValue = null;\n }\n\n this._internals.setFormValue(actualValue);\n }\n\n private _toggleState() {\n this.checked = !this.checked;\n this.indeterminate = false;\n this._setActualFormValue();\n this._manageRequired();\n this.dispatchEvent(new Event('change', {bubbles: true}));\n }\n\n private _handleClick = (ev: MouseEvent): void => {\n ev.preventDefault();\n\n if (this.disabled) {\n return;\n }\n\n this._toggleState();\n };\n\n private _handleKeyDown = (ev: KeyboardEvent): void => {\n if (!this.disabled && (ev.key === 'Enter' || ev.key === ' ')) {\n ev.preventDefault();\n\n if (ev.key === ' ') {\n this._toggleState();\n }\n\n if (ev.key === 'Enter') {\n this._internals.form?.requestSubmit();\n }\n }\n };\n\n private _manageRequired() {\n if (!this.checked && this.required) {\n this._internals.setValidity(\n {\n valueMissing: true,\n },\n 'Please check this box if you want to proceed.',\n this._inputEl ?? undefined\n );\n } else {\n this._internals.setValidity({});\n }\n }\n\n override render(): TemplateResult {\n const iconClasses = classMap({\n icon: true,\n checked: this.checked,\n indeterminate: this.indeterminate,\n });\n const labelInnerClasses = classMap({\n 'label-inner': true,\n });\n\n const icon = html`<svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n class=\"check-icon\"\n >\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M14.431 3.323l-8.47 10-.79-.036-3.35-4.77.818-.574 2.978 4.24 8.051-9.506.764.646z\"\n />\n </svg>`;\n const check = this.checked && !this.indeterminate ? icon : nothing;\n const indeterminate = this.indeterminate\n ? html`<span class=\"indeterminate-icon\"></span>`\n : nothing;\n\n return html`\n <div class=\"wrapper\">\n <input\n ?autofocus=${this.autofocus}\n id=\"input\"\n class=\"checkbox\"\n type=\"checkbox\"\n ?checked=${this.checked}\n value=${this.value}\n >\n <div class=${iconClasses}>${indeterminate}${check}</div>\n <label for=\"input\" class=\"label\" @click=${this._handleClick}>\n <span class=${labelInnerClasses}>\n ${this._renderLabelAttribute()}\n <slot @slotchange=${this._handleSlotChange}></slot>\n </span>\n </label>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'vscode-checkbox': VscodeCheckbox;\n }\n}\n"]}
1
+ {"version":3,"file":"vscode-checkbox.js","sourceRoot":"","sources":["../../src/vscode-checkbox/vscode-checkbox.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAiB,MAAM,KAAK,CAAC;AAC9D,OAAO,EAAC,SAAS,EAAC,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,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AI,EAAC,CAAC;8CAC1B;AAUf;IADC,QAAQ,EAAE;6CACA;AAGX;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;gDACxB;AAGjB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;qDACnB;AAGtB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;8CAKxC;AAYD;IADC,QAAQ,EAAE;4CACO;AAuEV;IADP,KAAK,CAAC,QAAQ,CAAC;gDACoB;AA7JzB,cAAc;IAD1B,aAAa,CAAC,iBAAiB,CAAC;GACpB,cAAc,CAyR1B","sourcesContent":["import {html, LitElement, nothing, TemplateResult} from 'lit';\nimport {ifDefined} from 'lit/directives/if-defined.js';\nimport {property, query} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {customElement} from '../includes/VscElement.js';\nimport {FormButtonWidgetBase} from '../includes/form-button-widget/FormButtonWidgetBase.js';\nimport {LabelledCheckboxOrRadioMixin} from '../includes/form-button-widget/LabelledCheckboxOrRadio.js';\nimport styles from './vscode-checkbox.styles.js';\nimport {AssociatedFormControl} from '../includes/AssociatedFormControl.js';\n\n/**\n * Allows users to select one or more options from a set. When participating in a form, it supports\n * the `:invalid` pseudo class. Otherwise the error styles can be applied through the `invalid`\n * property.\n *\n * @tag vscode-checkbox\n *\n * @attr name - Name which is used as a variable name in the data of the form-container.\n * @attr label - Attribute pair of the `label` property.\n * @prop label - Label text. It is only applied if component's innerHTML doesn't contain any text.\n *\n * @fires {Event} change - Dispatched when checked state is changed. The event is bubbled, so it can be listened on a parent element like the `CheckboxGroup`.\n * @fires {Event} invalid - Dispatched when the element is invalid and `checkValidity()` has been called or the form containing this element is submitted.\n *\n * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event)\n *\n * @cssprop [--vscode-font-family=sans-serif]\n * @cssprop [--vscode-font-size=13px]\n * @cssprop [--vscode-font-weight=normal]\n * @cssprop [--vscode-foreground=#cccccc]\n * @cssprop [--vscode-settings-checkboxBackground=#313131]\n * @cssprop [--vscode-settings-checkboxBorder=#3c3c3c]\n * @cssprop [--vscode-settings-checkboxForeground=#cccccc]\n * @cssprop [--vscode-focusBorder=#0078d4]\n * @cssprop [--vscode-inputValidation-errorBackground=#5a1d1d]\n * @cssprop [--vscode-inputValidation-errorBorder=#be1100]\n */\n@customElement('vscode-checkbox')\nexport class VscodeCheckbox\n extends LabelledCheckboxOrRadioMixin(FormButtonWidgetBase)\n implements AssociatedFormControl\n{\n static override styles = styles;\n\n /** @internal */\n static formAssociated = true;\n\n /** @internal */\n static override shadowRootOptions: ShadowRootInit = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n /**\n * Automatically focus on the element when the page loads.\n *\n * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus)\n */\n @property({type: Boolean, reflect: true})\n override autofocus = false;\n\n @property({type: Boolean, reflect: true})\n set checked(newVal: boolean) {\n this._checked = newVal;\n this._manageRequired();\n this.requestUpdate();\n }\n get checked(): boolean {\n return this._checked;\n }\n\n private _checked = false;\n\n /**\n * The element's initial checked state, which will be restored when the containing form is reset.\n */\n @property({type: Boolean, reflect: true, attribute: 'default-checked'})\n defaultChecked = false;\n\n @property({type: Boolean, reflect: true})\n invalid = false;\n\n @property({reflect: true})\n name: string | undefined = undefined;\n\n /**\n * When true, renders as a toggle switch instead of a checkbox.\n */\n @property({type: Boolean, reflect: true})\n toggle = false;\n\n /**\n * Associate a value to the checkbox. According to the native checkbox [specification](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#value_2), If the component participates in a form:\n *\n * - If it is unchecked, the value will not be submitted.\n * - If it is checked but the value is not set, `on` will be submitted.\n * - If it is checked and value is set, the value will be submitted.\n */\n @property()\n value = '';\n\n @property({type: Boolean, reflect: true})\n disabled = false;\n\n @property({type: Boolean, reflect: true})\n indeterminate = false;\n\n @property({type: Boolean, reflect: true})\n set required(newVal: boolean) {\n this._required = newVal;\n this._manageRequired();\n this.requestUpdate();\n }\n get required() {\n return this._required;\n }\n private _required = false;\n\n get form(): HTMLFormElement | null {\n return this._internals.form;\n }\n\n /** @internal */\n @property()\n type = 'checkbox';\n\n get validity(): ValidityState {\n return this._internals.validity;\n }\n\n get validationMessage(): string {\n return this._internals.validationMessage;\n }\n\n get willValidate(): boolean {\n return this._internals.willValidate;\n }\n\n /**\n * Returns `true` if the element's value is valid; otherwise, it returns `false`.\n * If the element's value is invalid, an invalid event is triggered on the element.\n *\n * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/checkValidity)\n */\n checkValidity(): boolean {\n return this._internals.checkValidity();\n }\n\n /**\n * Returns `true` if the element's value is valid; otherwise, it returns `false`.\n * If the element's value is invalid, an invalid event is triggered on the element, and the\n * browser displays an error message to the user.\n *\n * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/reportValidity)\n */\n reportValidity(): boolean {\n return this._internals.reportValidity();\n }\n\n constructor() {\n super();\n this._internals = this.attachInternals();\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n\n this.addEventListener('keydown', this._handleKeyDown);\n\n this.updateComplete.then(() => {\n this._manageRequired();\n this._setActualFormValue();\n });\n }\n\n override disconnectedCallback(): void {\n this.removeEventListener('keydown', this._handleKeyDown);\n }\n\n /** @internal */\n formResetCallback(): void {\n this.checked = this.defaultChecked;\n }\n\n /** @internal */\n formStateRestoreCallback(\n state: string,\n _mode: 'restore' | 'autocomplete'\n ): void {\n if (state) {\n this.checked = true;\n }\n }\n\n @query('#input')\n private _inputEl!: HTMLInputElement;\n\n private _internals: ElementInternals;\n\n // Sets the value of the control according to the native checkbox behavior.\n // - If the checkbox is unchecked, the value will be null, so the control will\n // excluded from the form.\n // - If the control is checked but the value is not set, the value will be \"on\".\n // - If the control is checked and value is set, the value won't be changed.\n private _setActualFormValue() {\n let actualValue: string | null = '';\n\n if (this.checked) {\n actualValue = !this.value ? 'on' : this.value;\n } else {\n actualValue = null;\n }\n\n this._internals.setFormValue(actualValue);\n }\n\n private _toggleState() {\n this.checked = !this.checked;\n this.indeterminate = false;\n this._setActualFormValue();\n this._manageRequired();\n this.dispatchEvent(new Event('change', {bubbles: true}));\n }\n\n private _handleClick = (ev: MouseEvent): void => {\n ev.preventDefault();\n\n if (this.disabled) {\n return;\n }\n\n this._toggleState();\n };\n\n private _handleKeyDown = (ev: KeyboardEvent): void => {\n if (!this.disabled && (ev.key === 'Enter' || ev.key === ' ')) {\n ev.preventDefault();\n\n if (ev.key === ' ') {\n this._toggleState();\n }\n\n if (ev.key === 'Enter') {\n this._internals.form?.requestSubmit();\n }\n }\n };\n\n private _manageRequired() {\n if (!this.checked && this.required) {\n this._internals.setValidity(\n {\n valueMissing: true,\n },\n 'Please check this box if you want to proceed.',\n this._inputEl ?? undefined\n );\n } else {\n this._internals.setValidity({});\n }\n }\n\n override render(): TemplateResult {\n const iconClasses = classMap({\n icon: true,\n checked: this.checked,\n indeterminate: this.indeterminate,\n });\n const labelInnerClasses = classMap({\n 'label-inner': true,\n });\n\n const icon = html`<svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n class=\"check-icon\"\n >\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M14.431 3.323l-8.47 10-.79-.036-3.35-4.77.818-.574 2.978 4.24 8.051-9.506.764.646z\"\n />\n </svg>`;\n const check = this.checked && !this.indeterminate ? icon : nothing;\n const indeterminate = this.indeterminate\n ? html`<span class=\"indeterminate-icon\"></span>`\n : nothing;\n\n const iconContent = this.toggle\n ? html`<span class=\"thumb\"></span>`\n : html`${indeterminate}${check}`;\n\n return html`\n <div class=\"wrapper\">\n <input\n ?autofocus=${this.autofocus}\n id=\"input\"\n class=\"checkbox\"\n type=\"checkbox\"\n ?checked=${this.checked}\n role=${ifDefined(this.toggle ? 'switch' : undefined)}\n aria-checked=${ifDefined(\n this.toggle ? (this.checked ? 'true' : 'false') : undefined\n )}\n value=${this.value}\n >\n <div class=${iconClasses}>${iconContent}</div>\n <label for=\"input\" class=\"label\" @click=${this._handleClick}>\n <span class=${labelInnerClasses}>\n ${this._renderLabelAttribute()}\n <slot @slotchange=${this._handleSlotChange}></slot>\n </span>\n </label>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'vscode-checkbox': VscodeCheckbox;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"vscode-checkbox.styles.d.ts","sourceRoot":"","sources":["../../src/vscode-checkbox/vscode-checkbox.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,cAAc,EAAC,MAAM,KAAK,CAAC;AAIxC,QAAA,MAAM,MAAM,EAAE,cA0Bb,CAAC;AAEF,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"vscode-checkbox.styles.d.ts","sourceRoot":"","sources":["../../src/vscode-checkbox/vscode-checkbox.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,cAAc,EAAC,MAAM,KAAK,CAAC;AAIxC,QAAA,MAAM,MAAM,EAAE,cAiGb,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -26,6 +26,77 @@ const styles = [
26
26
  outline: 1px solid var(--vscode-focusBorder, #0078d4);
27
27
  outline-offset: -1px;
28
28
  }
29
+
30
+ /* Toggle appearance */
31
+ :host([toggle]) .icon {
32
+ /* Track */
33
+ width: 36px;
34
+ height: 20px;
35
+ border-radius: 999px;
36
+ background-color: var(--vscode-button-secondaryBackground, #313131);
37
+ border-color: var(--vscode-button-border, transparent);
38
+ justify-content: flex-start;
39
+ position: absolute;
40
+ }
41
+
42
+ :host(:focus):host([toggle]):host(:not([disabled])) .icon {
43
+ outline-offset: 2px;
44
+ }
45
+
46
+ /* Reserve space for the wider toggle track so text doesn't overlap */
47
+ :host([toggle]) .label-inner {
48
+ padding-left: 45px; /* 36px track + 9px spacing */
49
+ }
50
+
51
+ :host([toggle]) .label {
52
+ min-height: 20px;
53
+ }
54
+
55
+ :host([toggle]) .wrapper {
56
+ min-height: 20px;
57
+ line-height: 20px;
58
+ }
59
+
60
+ :host([toggle]) .thumb {
61
+ /* Thumb */
62
+ box-sizing: border-box;
63
+ display: block;
64
+ width: 16px;
65
+ height: 16px;
66
+ border-radius: 50%;
67
+ background-color: var(--vscode-button-secondaryForeground, #cccccc);
68
+ margin-left: 1px;
69
+ transition: transform 120ms ease-in-out;
70
+ }
71
+
72
+ :host([toggle][checked]) .icon {
73
+ background-color: var(--vscode-button-background, #04395e);
74
+ border-color: var(--vscode-button-border, transparent);
75
+ }
76
+
77
+ :host([toggle][checked]) .thumb {
78
+ transform: translateX(16px);
79
+ background-color: var(--vscode-button-foreground, #ffffff);
80
+ }
81
+
82
+ :host([toggle]):host(:invalid) .icon {
83
+ background-color: var(--vscode-inputValidation-errorBackground, #5a1d1d);
84
+ border-color: var(--vscode-inputValidation-errorBorder, #be1100);
85
+ }
86
+
87
+ :host([toggle]):host(:invalid) .thumb {
88
+ background-color: var(--vscode-inputValidation-errorBorder, #be1100);
89
+ }
90
+
91
+ :host([toggle]) .check-icon,
92
+ :host([toggle]) .indeterminate-icon {
93
+ display: none;
94
+ }
95
+
96
+ :host([toggle]:focus):host(:not([disabled])) .icon {
97
+ outline: 1px solid var(--vscode-focusBorder, #0078d4);
98
+ outline-offset: -1px;
99
+ }
29
100
  `,
30
101
  ];
31
102
  export default styles;
@@ -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;AAEvE,MAAM,MAAM,GAAmB;IAC7B,aAAa;IACb,UAAU;IACV,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;GAsBF;CACF,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';\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, #5a1d1d);\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(--vscode-focusBorder, #0078d4);\n outline-offset: -1px;\n }\n `,\n];\n\nexport default styles;\n"]}
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;AAEvE,MAAM,MAAM,GAAmB;IAC7B,aAAa;IACb,UAAU;IACV,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6FF;CACF,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';\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, #5a1d1d);\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(--vscode-focusBorder, #0078d4);\n outline-offset: -1px;\n }\n\n /* Toggle appearance */\n :host([toggle]) .icon {\n /* Track */\n width: 36px;\n height: 20px;\n border-radius: 999px;\n background-color: var(--vscode-button-secondaryBackground, #313131);\n border-color: var(--vscode-button-border, transparent);\n justify-content: flex-start;\n position: absolute;\n }\n\n :host(:focus):host([toggle]):host(:not([disabled])) .icon {\n outline-offset: 2px;\n }\n\n /* Reserve space for the wider toggle track so text doesn't overlap */\n :host([toggle]) .label-inner {\n padding-left: 45px; /* 36px track + 9px spacing */\n }\n\n :host([toggle]) .label {\n min-height: 20px;\n }\n\n :host([toggle]) .wrapper {\n min-height: 20px;\n line-height: 20px;\n }\n\n :host([toggle]) .thumb {\n /* Thumb */\n box-sizing: border-box;\n display: block;\n width: 16px;\n height: 16px;\n border-radius: 50%;\n background-color: var(--vscode-button-secondaryForeground, #cccccc);\n margin-left: 1px;\n transition: transform 120ms ease-in-out;\n }\n\n :host([toggle][checked]) .icon {\n background-color: var(--vscode-button-background, #04395e);\n border-color: var(--vscode-button-border, transparent);\n }\n\n :host([toggle][checked]) .thumb {\n transform: translateX(16px);\n background-color: var(--vscode-button-foreground, #ffffff);\n }\n\n :host([toggle]):host(:invalid) .icon {\n background-color: var(--vscode-inputValidation-errorBackground, #5a1d1d);\n border-color: var(--vscode-inputValidation-errorBorder, #be1100);\n }\n\n :host([toggle]):host(:invalid) .thumb {\n background-color: var(--vscode-inputValidation-errorBorder, #be1100);\n }\n\n :host([toggle]) .check-icon,\n :host([toggle]) .indeterminate-icon {\n display: none;\n }\n\n :host([toggle]:focus):host(:not([disabled])) .icon {\n outline: 1px solid var(--vscode-focusBorder, #0078d4);\n outline-offset: -1px;\n }\n `,\n];\n\nexport default styles;\n"]}
@@ -0,0 +1,2 @@
1
+ export { VscodeProgressBar } from './vscode-progress-bar.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vscode-progress-bar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAC,MAAM,0BAA0B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { VscodeProgressBar } from './vscode-progress-bar.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/vscode-progress-bar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAC,MAAM,0BAA0B,CAAC","sourcesContent":["export {VscodeProgressBar} from './vscode-progress-bar.js';\n"]}
@@ -0,0 +1,45 @@
1
+ import { TemplateResult } from 'lit';
2
+ import { VscElement } from '../includes/VscElement.js';
3
+ /**
4
+ * @tag vscode-progress-bar
5
+ *
6
+ * @cssprop [--vscode-progressBar-background=#0078d4]
7
+ */
8
+ export declare class VscodeProgressBar extends VscElement {
9
+ static styles: import("lit").CSSResultGroup;
10
+ /**
11
+ * @internal
12
+ */
13
+ ariaLabel: string;
14
+ /**
15
+ * Current value for determinate mode. If undefined/NaN, the bar is indeterminate.
16
+ */
17
+ value?: number;
18
+ /**
19
+ * Maximum value for determinate mode.
20
+ */
21
+ max: number;
22
+ /**
23
+ * Force indeterminate mode even if value is set.
24
+ */
25
+ indeterminate: boolean;
26
+ /**
27
+ * Switch to a gentler animation after this many ms in indeterminate mode.
28
+ */
29
+ longRunningThreshold: number;
30
+ private _longRunning;
31
+ private _longRunningHandle;
32
+ private get _isDeterminate();
33
+ connectedCallback(): void;
34
+ disconnectedCallback(): void;
35
+ protected willUpdate(): void;
36
+ render(): TemplateResult;
37
+ private _maybeStartLongRunningTimer;
38
+ private _clearLongRunningTimer;
39
+ }
40
+ declare global {
41
+ interface HTMLElementTagNameMap {
42
+ 'vscode-progress-bar': VscodeProgressBar;
43
+ }
44
+ }
45
+ //# sourceMappingURL=vscode-progress-bar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vscode-progress-bar.d.ts","sourceRoot":"","sources":["../../src/vscode-progress-bar/vscode-progress-bar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAO,MAAM,KAAK,CAAC;AAGzC,OAAO,EAAgB,UAAU,EAAC,MAAM,2BAA2B,CAAC;AAKpE;;;;GAIG;AACH,qBACa,iBAAkB,SAAQ,UAAU;IAC/C,OAAgB,MAAM,+BAAU;IAEhC;;OAEG;IAEM,SAAS,SAAa;IAE/B;;OAEG;IAEH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IAEH,GAAG,SAAO;IAEV;;OAEG;IAEH,aAAa,UAAS;IAEtB;;OAEG;IAEH,oBAAoB,SAAS;IAG7B,OAAO,CAAC,YAAY,CAAS;IAE7B,OAAO,CAAC,kBAAkB,CAA4C;IAEtE,OAAO,KAAK,cAAc,GAMzB;IAEQ,iBAAiB,IAAI,IAAI;IAKzB,oBAAoB,IAAI,IAAI;cAKlB,UAAU,IAAI,IAAI;IAI5B,MAAM,IAAI,cAAc;IAsCjC,OAAO,CAAC,2BAA2B;IAoBnC,OAAO,CAAC,sBAAsB;CAM/B;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,qBAAqB,EAAE,iBAAiB,CAAC;KAC1C;CACF"}
@@ -0,0 +1,135 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { html } from 'lit';
8
+ import { property, state } from 'lit/decorators.js';
9
+ import { ifDefined } from 'lit/directives/if-defined.js';
10
+ import { customElement, VscElement } from '../includes/VscElement.js';
11
+ import styles from './vscode-progress-bar.styles.js';
12
+ import { classMap } from 'lit/directives/class-map.js';
13
+ import { stylePropertyMap } from '../includes/style-property-map.js';
14
+ /**
15
+ * @tag vscode-progress-bar
16
+ *
17
+ * @cssprop [--vscode-progressBar-background=#0078d4]
18
+ */
19
+ let VscodeProgressBar = class VscodeProgressBar extends VscElement {
20
+ constructor() {
21
+ super(...arguments);
22
+ /**
23
+ * @internal
24
+ */
25
+ this.ariaLabel = 'Loading';
26
+ /**
27
+ * Maximum value for determinate mode.
28
+ */
29
+ this.max = 100;
30
+ /**
31
+ * Force indeterminate mode even if value is set.
32
+ */
33
+ this.indeterminate = false;
34
+ /**
35
+ * Switch to a gentler animation after this many ms in indeterminate mode.
36
+ */
37
+ this.longRunningThreshold = 15000;
38
+ this._longRunning = false;
39
+ }
40
+ get _isDeterminate() {
41
+ return (!this.indeterminate &&
42
+ typeof this.value === 'number' &&
43
+ isFinite(this.value));
44
+ }
45
+ connectedCallback() {
46
+ super.connectedCallback();
47
+ this._maybeStartLongRunningTimer();
48
+ }
49
+ disconnectedCallback() {
50
+ super.disconnectedCallback();
51
+ this._clearLongRunningTimer();
52
+ }
53
+ willUpdate() {
54
+ this._maybeStartLongRunningTimer();
55
+ }
56
+ render() {
57
+ const max = this.max > 0 ? this.max : 100;
58
+ const clamped = this._isDeterminate
59
+ ? Math.min(Math.max(this.value ?? 0, 0), max)
60
+ : 0;
61
+ const percent = this._isDeterminate ? (clamped / max) * 100 : 0;
62
+ const containerClasses = {
63
+ container: true,
64
+ discrete: this._isDeterminate,
65
+ infinite: !this._isDeterminate,
66
+ 'infinite-long-running': this._longRunning && !this._isDeterminate,
67
+ };
68
+ return html `
69
+ <div
70
+ class=${classMap(containerClasses)}
71
+ part="container"
72
+ role="progressbar"
73
+ aria-label=${this.ariaLabel}
74
+ aria-valuemin="0"
75
+ aria-valuemax=${String(max)}
76
+ aria-valuenow=${ifDefined(this._isDeterminate ? String(Math.round(clamped)) : undefined)}
77
+ >
78
+ <div class="track" part="track"></div>
79
+ <div
80
+ class="indicator"
81
+ part="indicator"
82
+ .style=${stylePropertyMap({
83
+ width: this._isDeterminate ? `${percent}%` : undefined,
84
+ })}
85
+ ></div>
86
+ </div>
87
+ `;
88
+ }
89
+ _maybeStartLongRunningTimer() {
90
+ const shouldRun = !this._isDeterminate && this.longRunningThreshold > 0 && this.isConnected;
91
+ if (!shouldRun) {
92
+ this._clearLongRunningTimer();
93
+ this._longRunning = false;
94
+ return;
95
+ }
96
+ if (this._longRunningHandle) {
97
+ return; // already scheduled
98
+ }
99
+ this._longRunningHandle = setTimeout(() => {
100
+ this._longRunning = true;
101
+ this._longRunningHandle = undefined;
102
+ this.requestUpdate();
103
+ }, this.longRunningThreshold);
104
+ }
105
+ _clearLongRunningTimer() {
106
+ if (this._longRunningHandle) {
107
+ clearTimeout(this._longRunningHandle);
108
+ this._longRunningHandle = undefined;
109
+ }
110
+ }
111
+ };
112
+ VscodeProgressBar.styles = styles;
113
+ __decorate([
114
+ property({ reflect: true, attribute: 'aria-label' })
115
+ ], VscodeProgressBar.prototype, "ariaLabel", void 0);
116
+ __decorate([
117
+ property({ type: Number, reflect: true })
118
+ ], VscodeProgressBar.prototype, "value", void 0);
119
+ __decorate([
120
+ property({ type: Number, reflect: true })
121
+ ], VscodeProgressBar.prototype, "max", void 0);
122
+ __decorate([
123
+ property({ type: Boolean, reflect: true })
124
+ ], VscodeProgressBar.prototype, "indeterminate", void 0);
125
+ __decorate([
126
+ property({ type: Number, attribute: 'long-running-threshold' })
127
+ ], VscodeProgressBar.prototype, "longRunningThreshold", void 0);
128
+ __decorate([
129
+ state()
130
+ ], VscodeProgressBar.prototype, "_longRunning", void 0);
131
+ VscodeProgressBar = __decorate([
132
+ customElement('vscode-progress-bar')
133
+ ], VscodeProgressBar);
134
+ export { VscodeProgressBar };
135
+ //# sourceMappingURL=vscode-progress-bar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vscode-progress-bar.js","sourceRoot":"","sources":["../../src/vscode-progress-bar/vscode-progress-bar.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAiB,IAAI,EAAC,MAAM,KAAK,CAAC;AACzC,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,SAAS,EAAC,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAC,aAAa,EAAE,UAAU,EAAC,MAAM,2BAA2B,CAAC;AACpE,OAAO,MAAM,MAAM,iCAAiC,CAAC;AACrD,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAC,gBAAgB,EAAC,MAAM,mCAAmC,CAAC;AAEnE;;;;GAIG;AAEI,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,UAAU;IAA1C;;QAGL;;WAEG;QAEM,cAAS,GAAG,SAAS,CAAC;QAQ/B;;WAEG;QAEH,QAAG,GAAG,GAAG,CAAC;QAEV;;WAEG;QAEH,kBAAa,GAAG,KAAK,CAAC;QAEtB;;WAEG;QAEH,yBAAoB,GAAG,KAAK,CAAC;QAGrB,iBAAY,GAAG,KAAK,CAAC;IA0F/B,CAAC;IAtFC,IAAY,cAAc;QACxB,OAAO,CACL,CAAC,IAAI,CAAC,aAAa;YACnB,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ;YAC9B,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CACrB,CAAC;IACJ,CAAC;IAEQ,iBAAiB;QACxB,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,2BAA2B,EAAE,CAAC;IACrC,CAAC;IAEQ,oB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C,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,wBAAwB,EAAC,CAAC;+DACjC;AAGrB;IADP,KAAK,EAAE;uDACqB;AAlClB,iBAAiB;IAD7B,aAAa,CAAC,qBAAqB,CAAC;GACxB,iBAAiB,CA4H7B","sourcesContent":["import {TemplateResult, html} from 'lit';\nimport {property, state} from 'lit/decorators.js';\nimport {ifDefined} from 'lit/directives/if-defined.js';\nimport {customElement, VscElement} from '../includes/VscElement.js';\nimport styles from './vscode-progress-bar.styles.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {stylePropertyMap} from '../includes/style-property-map.js';\n\n/**\n * @tag vscode-progress-bar\n *\n * @cssprop [--vscode-progressBar-background=#0078d4]\n */\n@customElement('vscode-progress-bar')\nexport class VscodeProgressBar extends VscElement {\n static override styles = styles;\n\n /**\n * @internal\n */\n @property({reflect: true, attribute: 'aria-label'})\n override ariaLabel = 'Loading';\n\n /**\n * Current value for determinate mode. If undefined/NaN, the bar is indeterminate.\n */\n @property({type: Number, reflect: true})\n value?: number;\n\n /**\n * Maximum value for determinate mode.\n */\n @property({type: Number, reflect: true})\n max = 100;\n\n /**\n * Force indeterminate mode even if value is set.\n */\n @property({type: Boolean, reflect: true})\n indeterminate = false;\n\n /**\n * Switch to a gentler animation after this many ms in indeterminate mode.\n */\n @property({type: Number, attribute: 'long-running-threshold'})\n longRunningThreshold = 15000;\n\n @state()\n private _longRunning = false;\n\n private _longRunningHandle: ReturnType<typeof setTimeout> | undefined;\n\n private get _isDeterminate(): boolean {\n return (\n !this.indeterminate &&\n typeof this.value === 'number' &&\n isFinite(this.value)\n );\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n this._maybeStartLongRunningTimer();\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this._clearLongRunningTimer();\n }\n\n protected override willUpdate(): void {\n this._maybeStartLongRunningTimer();\n }\n\n override render(): TemplateResult {\n const max = this.max > 0 ? this.max : 100;\n const clamped = this._isDeterminate\n ? Math.min(Math.max(this.value ?? 0, 0), max)\n : 0;\n const percent = this._isDeterminate ? (clamped / max) * 100 : 0;\n\n const containerClasses = {\n container: true,\n discrete: this._isDeterminate,\n infinite: !this._isDeterminate,\n 'infinite-long-running': this._longRunning && !this._isDeterminate,\n };\n\n return html`\n <div\n class=${classMap(containerClasses)}\n part=\"container\"\n role=\"progressbar\"\n aria-label=${this.ariaLabel}\n aria-valuemin=\"0\"\n aria-valuemax=${String(max)}\n aria-valuenow=${ifDefined(\n this._isDeterminate ? String(Math.round(clamped)) : undefined\n )}\n >\n <div class=\"track\" part=\"track\"></div>\n <div\n class=\"indicator\"\n part=\"indicator\"\n .style=${stylePropertyMap({\n width: this._isDeterminate ? `${percent}%` : undefined,\n })}\n ></div>\n </div>\n `;\n }\n\n private _maybeStartLongRunningTimer(): void {\n const shouldRun =\n !this._isDeterminate && this.longRunningThreshold > 0 && this.isConnected;\n if (!shouldRun) {\n this._clearLongRunningTimer();\n this._longRunning = false;\n return;\n }\n\n if (this._longRunningHandle) {\n return; // already scheduled\n }\n\n this._longRunningHandle = setTimeout(() => {\n this._longRunning = true;\n this._longRunningHandle = undefined;\n this.requestUpdate();\n }, this.longRunningThreshold);\n }\n\n private _clearLongRunningTimer(): void {\n if (this._longRunningHandle) {\n clearTimeout(this._longRunningHandle);\n this._longRunningHandle = undefined;\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'vscode-progress-bar': VscodeProgressBar;\n }\n}\n"]}
@@ -0,0 +1,4 @@
1
+ import { CSSResultGroup } from 'lit';
2
+ declare const styles: CSSResultGroup;
3
+ export default styles;
4
+ //# sourceMappingURL=vscode-progress-bar.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vscode-progress-bar.styles.d.ts","sourceRoot":"","sources":["../../src/vscode-progress-bar/vscode-progress-bar.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,cAAc,EAAC,MAAM,KAAK,CAAC;AAGxC,QAAA,MAAM,MAAM,EAAE,cA6Eb,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -0,0 +1,82 @@
1
+ import { css } from 'lit';
2
+ import defaultStyles from '../includes/default.styles.js';
3
+ const styles = [
4
+ defaultStyles,
5
+ css `
6
+ :host {
7
+ display: block;
8
+ height: 2px;
9
+ width: 100%;
10
+ outline: none;
11
+ }
12
+
13
+ .container {
14
+ position: relative;
15
+ width: 100%;
16
+ height: 100%;
17
+ overflow: hidden;
18
+ }
19
+
20
+ .track {
21
+ position: absolute;
22
+ inset: 0;
23
+ background: transparent;
24
+ }
25
+
26
+ .indicator {
27
+ position: absolute;
28
+ left: 0;
29
+ top: 0;
30
+ bottom: 0;
31
+ height: 100%;
32
+ background: var(--vscode-progressBar-background, #0078d4);
33
+ will-change: transform, width, left;
34
+ }
35
+
36
+ /* Determinate mode: width is set inline via style attribute */
37
+ .discrete .indicator {
38
+ transition: width 100ms linear;
39
+ }
40
+
41
+ /* Indeterminate mode: VS Code style progress bit */
42
+ .infinite .indicator {
43
+ width: 2%;
44
+ animation-name: progress;
45
+ animation-duration: 4s;
46
+ animation-iteration-count: infinite;
47
+ animation-timing-function: linear;
48
+ transform: translate3d(0px, 0px, 0px);
49
+ }
50
+
51
+ /* Long running: reduce GPU pressure using stepped animation */
52
+ .infinite.infinite-long-running .indicator {
53
+ animation-timing-function: steps(100);
54
+ }
55
+
56
+ /* Keyframes adapted from VS Code */
57
+ @keyframes progress {
58
+ from {
59
+ transform: translateX(0%) scaleX(1);
60
+ }
61
+ 50% {
62
+ transform: translateX(2500%) scaleX(3);
63
+ }
64
+ to {
65
+ transform: translateX(4900%) scaleX(1);
66
+ }
67
+ }
68
+
69
+ @media (prefers-reduced-motion: reduce) {
70
+ .discrete .indicator {
71
+ transition: none;
72
+ }
73
+ .infinite .indicator,
74
+ .infinite-long-running .indicator {
75
+ animation: none;
76
+ width: 100%;
77
+ }
78
+ }
79
+ `,
80
+ ];
81
+ export default styles;
82
+ //# sourceMappingURL=vscode-progress-bar.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vscode-progress-bar.styles.js","sourceRoot":"","sources":["../../src/vscode-progress-bar/vscode-progress-bar.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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0EF;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 display: block;\n height: 2px;\n width: 100%;\n outline: none;\n }\n\n .container {\n position: relative;\n width: 100%;\n height: 100%;\n overflow: hidden;\n }\n\n .track {\n position: absolute;\n inset: 0;\n background: transparent;\n }\n\n .indicator {\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n height: 100%;\n background: var(--vscode-progressBar-background, #0078d4);\n will-change: transform, width, left;\n }\n\n /* Determinate mode: width is set inline via style attribute */\n .discrete .indicator {\n transition: width 100ms linear;\n }\n\n /* Indeterminate mode: VS Code style progress bit */\n .infinite .indicator {\n width: 2%;\n animation-name: progress;\n animation-duration: 4s;\n animation-iteration-count: infinite;\n animation-timing-function: linear;\n transform: translate3d(0px, 0px, 0px);\n }\n\n /* Long running: reduce GPU pressure using stepped animation */\n .infinite.infinite-long-running .indicator {\n animation-timing-function: steps(100);\n }\n\n /* Keyframes adapted from VS Code */\n @keyframes progress {\n from {\n transform: translateX(0%) scaleX(1);\n }\n 50% {\n transform: translateX(2500%) scaleX(3);\n }\n to {\n transform: translateX(4900%) scaleX(1);\n }\n }\n\n @media (prefers-reduced-motion: reduce) {\n .discrete .indicator {\n transition: none;\n }\n .infinite .indicator,\n .infinite-long-running .indicator {\n animation: none;\n width: 100%;\n }\n }\n `,\n];\n\nexport default styles;\n"]}
@@ -429,7 +429,7 @@ let VscodeTable = class VscodeTable extends VscElement {
429
429
  if (this._headerCellsToResize[1]) {
430
430
  this._headerCellsToResize[1].style.width = nextColCss;
431
431
  }
432
- if (resizeBodyCells) {
432
+ if (resizeBodyCells && this._cellsToResize[0]) {
433
433
  this._cellsToResize[0].style.width = prevColCss;
434
434
  if (this._cellsToResize[1]) {
435
435
  this._cellsToResize[1].style.width = nextColCss;