@kumori/aurora-wui-components 0.0.313-dev4582.2 → 0.0.313-dev4582.3

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.
@@ -16,9 +16,12 @@ export declare class AxebowResourceBar extends LitElement {
16
16
  barWidth?: string;
17
17
  barHeight?: string;
18
18
  unit?: string;
19
+ decimals?: number;
19
20
  private _renderIcon;
20
21
  private get _isFixedVariant();
21
22
  private _formatValue;
23
+ private _formatCurrent;
24
+ private _formatLimit;
22
25
  private _renderCurrent;
23
26
  private _renderBar;
24
27
  private _renderLimit;
@@ -1 +1 @@
1
- {"version":3,"file":"axebow-resource-bar.d.ts","sourceRoot":"","sources":["../../../src/components/axebow-summary/axebow-resource-bar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAwB,MAAM,KAAK,CAAC;AAIvD,OAAO,+BAA+B,CAAC;AAEvC,qBACa,iBAAkB,SAAQ,UAAU;IAC/C,MAAM,CAAC,MAAM,4BAQX;IAE0B,IAAI,SAAM;IACV,KAAK,SAAM;IACX,OAAO,SAAK;IACZ,KAAK,SAAK;IACV,UAAU,SAAK;IACf,MAAM,SAAO;IAEb,QAAQ,SAAQ;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IAE1C,OAAO,CAAC,WAAW;IAsBnB,OAAO,KAAK,eAAe,GAE1B;IAED,OAAO,CAAC,YAAY;IAMpB,OAAO,CAAC,cAAc;IAMtB,OAAO,CAAC,UAAU;IAkBlB,OAAO,CAAC,YAAY;IAUpB,OAAO,CAAC,aAAa;IAWrB,MAAM;CAyBP"}
1
+ {"version":3,"file":"axebow-resource-bar.d.ts","sourceRoot":"","sources":["../../../src/components/axebow-summary/axebow-resource-bar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAwB,MAAM,KAAK,CAAC;AAIvD,OAAO,+BAA+B,CAAC;AAGvC,qBACa,iBAAkB,SAAQ,UAAU;IAC/C,MAAM,CAAC,MAAM,4BAQX;IAE0B,IAAI,SAAM;IACV,KAAK,SAAM;IACX,OAAO,SAAK;IACZ,KAAK,SAAK;IACV,UAAU,SAAK;IACf,MAAM,SAAO;IAEb,QAAQ,SAAQ;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAE9C,OAAO,CAAC,WAAW;IAsBnB,OAAO,KAAK,eAAe,GAE1B;IAED,OAAO,CAAC,YAAY;IAMpB,OAAO,CAAC,cAAc;IAKtB,OAAO,CAAC,YAAY;IAMpB,OAAO,CAAC,cAAc;IAMtB,OAAO,CAAC,UAAU;IAkBlB,OAAO,CAAC,YAAY;IAUpB,OAAO,CAAC,aAAa;IAWrB,MAAM;CAyBP"}
@@ -0,0 +1,2 @@
1
+ export declare function formatSummaryNumber(value: number, decimals: number): string;
2
+ //# sourceMappingURL=axebow-summary-format.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"axebow-summary-format.d.ts","sourceRoot":"","sources":["../../../src/components/axebow-summary/axebow-summary-format.ts"],"names":[],"mappings":"AAAA,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAI3E"}
@@ -36,6 +36,8 @@ export declare class AxebowSummaryLimits extends LitElement {
36
36
  supportedStorage: string[];
37
37
  labels: SummaryLimitsLabels;
38
38
  showSoftErrors: boolean;
39
+ decimals?: number;
40
+ private _format;
39
41
  private renderSection;
40
42
  render(): import('lit-html').TemplateResult<1>;
41
43
  }
@@ -1 +1 @@
1
- {"version":3,"file":"axebow-summary-limits.d.ts","sourceRoot":"","sources":["../../../src/components/axebow-summary/axebow-summary-limits.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAwB,MAAM,KAAK,CAAC;AAIvD,OAAO,qCAAqC,CAAC;AAC7C,OAAO,+BAA+B,CAAC;AAEvC,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IAClC,MAAM,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IACrC,eAAe,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9C,oBAAoB,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IACnD,iBAAiB,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;CACjD;AAED,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,qBACa,mBAAoB,SAAQ,UAAU;IACjD,MAAM,CAAC,MAAM,4BASX;IAE0B,MAAM,EAAG,iBAAiB,CAAC;IAC5B,gBAAgB,EAAE,MAAM,EAAE,CAAM;IAC/B,MAAM,EAAG,mBAAmB,CAAC;IAC5B,cAAc,UAAS;IAEpD,OAAO,CAAC,aAAa;IAkErB,MAAM;CASP"}
1
+ {"version":3,"file":"axebow-summary-limits.d.ts","sourceRoot":"","sources":["../../../src/components/axebow-summary/axebow-summary-limits.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAwB,MAAM,KAAK,CAAC;AAKvD,OAAO,qCAAqC,CAAC;AAC7C,OAAO,+BAA+B,CAAC;AAEvC,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IAClC,MAAM,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IACrC,eAAe,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9C,oBAAoB,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IACnD,iBAAiB,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;CACjD;AAED,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,qBACa,mBAAoB,SAAQ,UAAU;IACjD,MAAM,CAAC,MAAM,4BASX;IAE0B,MAAM,EAAG,iBAAiB,CAAC;IAC5B,gBAAgB,EAAE,MAAM,EAAE,CAAM;IAC/B,MAAM,EAAG,mBAAmB,CAAC;IAC5B,cAAc,UAAS;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAE9C,OAAO,CAAC,OAAO;IAIf,OAAO,CAAC,aAAa;IAkErB,MAAM;CASP"}
package/dist/index.js CHANGED
@@ -11778,6 +11778,13 @@ __decorate([property({ type: String })], AxebowSummaryKeyValue.prototype, "label
11778
11778
  __decorate([property({ type: String })], AxebowSummaryKeyValue.prototype, "value", void 0);
11779
11779
  AxebowSummaryKeyValue = __decorate([customElement("axebow-summary-key-value")], AxebowSummaryKeyValue);
11780
11780
  //#endregion
11781
+ //#region src/components/axebow-summary/axebow-summary-format.ts
11782
+ function formatSummaryNumber(value, decimals) {
11783
+ if (!Number.isFinite(value)) return String(value);
11784
+ const factor = 10 ** decimals;
11785
+ return (Math.round(value * factor) / factor).toFixed(decimals);
11786
+ }
11787
+ //#endregion
11781
11788
  //#region src/components/axebow-summary/axebow-resource-bar.ts
11782
11789
  var AxebowResourceBar = class AxebowResourceBar extends LitElement {
11783
11790
  constructor(..._args) {
@@ -11827,8 +11834,17 @@ var AxebowResourceBar = class AxebowResourceBar extends LitElement {
11827
11834
  const decimals = hundredths % 10 === 0 ? 1 : 2;
11828
11835
  return (hundredths / 100).toFixed(decimals);
11829
11836
  }
11837
+ _formatCurrent() {
11838
+ if (this.decimals !== void 0) return formatSummaryNumber(this.current, this.decimals);
11839
+ return this._isFixedVariant ? this._formatValue(this.current) : this.current.toFixed(2);
11840
+ }
11841
+ _formatLimit() {
11842
+ if (this.limit == null) return "-";
11843
+ if (this.decimals !== void 0) return formatSummaryNumber(this.limit, this.decimals);
11844
+ return this._isFixedVariant ? this._formatValue(this.limit) : this.limit;
11845
+ }
11830
11846
  _renderCurrent() {
11831
- const value = this._isFixedVariant ? this._formatValue(this.current) : this.current.toFixed(2);
11847
+ const value = this._formatCurrent();
11832
11848
  return html`<p class="text-base ${this._isFixedVariant ? "text-(--axebow-primary)" : "text-(--axebow-gray)"}">${value}</p>`;
11833
11849
  }
11834
11850
  _renderBar() {
@@ -11845,7 +11861,7 @@ var AxebowResourceBar = class AxebowResourceBar extends LitElement {
11845
11861
  `;
11846
11862
  }
11847
11863
  _renderLimit() {
11848
- const value = this.limit == null ? "-" : this._isFixedVariant ? this._formatValue(this.limit) : this.limit;
11864
+ const value = this._formatLimit();
11849
11865
  const colorClass = this._isFixedVariant ? "text-(--axebow-black)" : "text-(--axebow-gray)";
11850
11866
  const weightClass = this._isFixedVariant ? "font-normal" : "font-bold";
11851
11867
  return html`
@@ -11895,6 +11911,7 @@ __decorate([property({ type: String })], AxebowResourceBar.prototype, "valuesHei
11895
11911
  __decorate([property({ type: String })], AxebowResourceBar.prototype, "barWidth", void 0);
11896
11912
  __decorate([property({ type: String })], AxebowResourceBar.prototype, "barHeight", void 0);
11897
11913
  __decorate([property({ type: String })], AxebowResourceBar.prototype, "unit", void 0);
11914
+ __decorate([property({ type: Number })], AxebowResourceBar.prototype, "decimals", void 0);
11898
11915
  AxebowResourceBar = __decorate([customElement("axebow-resource-bar")], AxebowResourceBar);
11899
11916
  //#endregion
11900
11917
  //#region src/components/axebow-summary/axebow-summary-step-header.ts
@@ -12213,6 +12230,9 @@ var AxebowSummaryLimits = class AxebowSummaryLimits extends LitElement {
12213
12230
  `
12214
12231
  ];
12215
12232
  }
12233
+ _format(value) {
12234
+ return this.decimals === void 0 ? value : formatSummaryNumber(value, this.decimals);
12235
+ }
12216
12236
  renderSection(title, limitKey) {
12217
12237
  const isMin = limitKey === "min";
12218
12238
  const isCpuError = isMin && this.showSoftErrors && this.limits.cpu && this.limits.cpu.min > this.limits.cpu.max;
@@ -12226,33 +12246,33 @@ var AxebowSummaryLimits = class AxebowSummaryLimits extends LitElement {
12226
12246
  <div class="flex gap-1.5">
12227
12247
  <div class="w-41 h-4.25 text-base flex items-center gap-1">
12228
12248
  <span>${this.labels.vcpus}:</span>
12229
- <span class="${isCpuError ? "text-(--axebow-error)" : "text-(--axebow-gray)"}">${this.limits.cpu ? this.limits.cpu[limitKey] : 0}</span>
12249
+ <span class="${isCpuError ? "text-(--axebow-error)" : "text-(--axebow-gray)"}">${this._format(this.limits.cpu ? this.limits.cpu[limitKey] : 0)}</span>
12230
12250
  ${isCpuError ? html`<axebow-icon iconName="error" iconColor="var(--axebow-error)" size="md"></axebow-icon>` : ""}
12231
12251
  </div>
12232
12252
  <div class="w-41 h-4.25 text-base flex items-center gap-1">
12233
12253
  <span>${this.labels.memory}</span>
12234
- <span class="${isMemError ? "text-(--axebow-error)" : "text-(--axebow-gray)"}">${this.limits.memory ? this.limits.memory[limitKey] : 0} GB</span>
12254
+ <span class="${isMemError ? "text-(--axebow-error)" : "text-(--axebow-gray)"}">${this._format(this.limits.memory ? this.limits.memory[limitKey] : 0)} GB</span>
12235
12255
  ${isMemError ? html`<axebow-icon iconName="error" iconColor="var(--axebow-error)" size="md"></axebow-icon>` : ""}
12236
12256
  </div>
12237
12257
  </div>
12238
12258
  ${this.supportedStorage.includes("volatile") && this.limits.volatileStorage ? html`
12239
12259
  <p class="text-base m-0 flex items-center gap-1">
12240
12260
  <span>${this.labels.volatile}:</span>
12241
- <span class="${isVolatileError ? "text-(--axebow-error)" : "text-(--axebow-gray)"}">${this.limits.volatileStorage[limitKey]} GB</span>
12261
+ <span class="${isVolatileError ? "text-(--axebow-error)" : "text-(--axebow-gray)"}">${this._format(this.limits.volatileStorage[limitKey])} GB</span>
12242
12262
  ${isVolatileError ? html`<axebow-icon iconName="error" iconColor="var(--axebow-error)" size="md"></axebow-icon>` : ""}
12243
12263
  </p>
12244
12264
  ` : ""}
12245
12265
  ${this.supportedStorage.includes("nonReplicated") && this.limits.nonReplicatedStorage ? html`
12246
12266
  <p class="text-base m-0 flex items-center gap-1">
12247
12267
  <span>${this.labels.nonReplicated}:</span>
12248
- <span class="${isNonRepError ? "text-(--axebow-error)" : "text-(--axebow-gray)"}">${this.limits.nonReplicatedStorage[limitKey]} GB</span>
12268
+ <span class="${isNonRepError ? "text-(--axebow-error)" : "text-(--axebow-gray)"}">${this._format(this.limits.nonReplicatedStorage[limitKey])} GB</span>
12249
12269
  ${isNonRepError ? html`<axebow-icon iconName="error" iconColor="var(--axebow-error)" size="md"></axebow-icon>` : ""}
12250
12270
  </p>
12251
12271
  ` : ""}
12252
12272
  ${this.supportedStorage.includes("persistent") && this.limits.persistentStorage ? html`
12253
12273
  <p class="text-base m-0 flex items-center gap-1">
12254
12274
  <span>${this.labels.persistent}:</span>
12255
- <span class="${isPersError ? "text-(--axebow-error)" : "text-(--axebow-gray)"}">${this.limits.persistentStorage[limitKey]} GB</span>
12275
+ <span class="${isPersError ? "text-(--axebow-error)" : "text-(--axebow-gray)"}">${this._format(this.limits.persistentStorage[limitKey])} GB</span>
12256
12276
  ${isPersError ? html`<axebow-icon iconName="error" iconColor="var(--axebow-error)" size="md"></axebow-icon>` : ""}
12257
12277
  </p>
12258
12278
  ` : ""}
@@ -12272,6 +12292,7 @@ __decorate([property({ type: Object })], AxebowSummaryLimits.prototype, "limits"
12272
12292
  __decorate([property({ type: Array })], AxebowSummaryLimits.prototype, "supportedStorage", void 0);
12273
12293
  __decorate([property({ type: Object })], AxebowSummaryLimits.prototype, "labels", void 0);
12274
12294
  __decorate([property({ type: Boolean })], AxebowSummaryLimits.prototype, "showSoftErrors", void 0);
12295
+ __decorate([property({ type: Number })], AxebowSummaryLimits.prototype, "decimals", void 0);
12275
12296
  AxebowSummaryLimits = __decorate([customElement("axebow-summary-limits")], AxebowSummaryLimits);
12276
12297
  //#endregion
12277
12298
  //#region src/components/axebow-summary/axebow-summary-flavors.ts