@kumori/aurora-wui-components 0.0.177 → 0.0.178

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.
@@ -44,6 +44,10 @@ export declare class AxebowInput extends LitElement {
44
44
  addDialogLabels: AddDialogLabels;
45
45
  compact: boolean;
46
46
  integerOnly: boolean;
47
+ fixedWidth?: string;
48
+ fixedHeight?: string;
49
+ showStepper: boolean;
50
+ stepAmount: number;
47
51
  render(): TemplateResult<1>;
48
52
  }
49
53
  //# sourceMappingURL=axebow-input.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"axebow-input.d.ts","sourceRoot":"","sources":["../../../src/components/axebow-input/axebow-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAa,cAAc,EAAE,MAAM,KAAK,CAAC;AAEvE,OAAO,yDAAyD,CAAC;AAGjE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAA6B,MAAM,0BAA0B,CAAC;AACtF,OAAO,wBAAwB,CAAC;AAChC,OAAO,2BAA2B,CAAC;AACnC,OAAO,0BAA0B,CAAC;AAClC,OAAO,4BAA4B,CAAC;AACpC,OAAO,4BAA4B,CAAC;AACpC,OAAO,6BAA6B,CAAC;AAErC,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,QAAQ,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,WAAW,GAAG,aAAa,CAAC;AAC7H,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,cAAc,CAAC;CAChC;AAED,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,CAAC;AAE9C;;;;;GAKG;AACH,qBACa,WAAY,SAAQ,UAAU;IACzC,MAAM,CAAC,MAAM,4BASX;IAE0B,KAAK,SAAM;IACX,WAAW,SAAM;IACjB,KAAK,SAAM;IACX,WAAW,SAAM;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 +1,25 @@
1
+ import { PropertyValues } from 'lit';
1
2
  import { AxebowInputBase } from './axebow-input-base.js';
2
3
  export declare class AxebowNumericInput extends AxebowInputBase {
3
4
  static styles: import('lit').CSSResult[];
4
5
  max: number;
5
6
  min: number;
6
7
  integerOnly: boolean;
8
+ /** Opt-in exact field width/height (e.g. '6.1875rem' / '2.5rem'). Left
9
+ * unset, every existing caller keeps the field's previous default sizing
10
+ * unchanged. */
11
+ fixedWidth?: string;
12
+ fixedHeight?: string;
13
+ /** Adds a 22x38 +/- stepper flush against the field's right border,
14
+ * wired to the same min/max/integerOnly rules as typed input. Off by
15
+ * default - opt in per caller. */
16
+ showStepper: boolean;
17
+ stepAmount: number;
18
+ updated(changed: PropertyValues): void;
7
19
  protected handleChange(e: Event): void;
8
20
  protected handleKeyDown(e: KeyboardEvent): void;
21
+ private _bumpValue;
22
+ private _renderStepper;
9
23
  render(): import('lit-html').TemplateResult;
10
24
  }
11
25
  //# sourceMappingURL=axebow-numeric-input.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"axebow-numeric-input.d.ts","sourceRoot":"","sources":["../../../src/components/axebow-input/axebow-numeric-input.ts"],"names":[],"mappings":"AAGA,OAAO,yDAAyD,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,qBACa,kBAAmB,SAAQ,eAAe;IACrD,MAAM,CAAC,MAAM,4BAAmC;IAEpB,GAAG,SAA2B;IAC9B,GAAG,SAAK;IACP,WAAW,UAAS;IAEjD,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE,KAAK;IAgB/B,SAAS,CAAC,aAAa,CAAC,CAAC,EAAE,aAAa;IAMxC,MAAM;CAkBP"}
1
+ {"version":3,"file":"axebow-numeric-input.d.ts","sourceRoot":"","sources":["../../../src/components/axebow-input/axebow-numeric-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,cAAc,EAAE,MAAM,KAAK,CAAC;AAGhD,OAAO,yDAAyD,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,qBACa,kBAAmB,SAAQ,eAAe;IACrD,MAAM,CAAC,MAAM,4BA+CX;IAE0B,GAAG,SAA2B;IAC9B,GAAG,SAAK;IACP,WAAW,UAAS;IAEjD;;qBAEiB;IACW,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IAEjD;;uCAEmC;IACN,WAAW,UAAS;IACrB,UAAU,SAAK;IAE3C,OAAO,CAAC,OAAO,EAAE,cAAc;IAmB/B,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE,KAAK;IAgB/B,SAAS,CAAC,aAAa,CAAC,CAAC,EAAE,aAAa;IAMxC,OAAO,CAAC,UAAU;IAYlB,OAAO,CAAC,cAAc;IA2BtB,MAAM;CAoBP"}
package/dist/index.js CHANGED
@@ -1520,9 +1520,67 @@ var AxebowNumericInput = class AxebowNumericInput extends AxebowInputBase {
1520
1520
  this.max = Number.MAX_SAFE_INTEGER;
1521
1521
  this.min = 0;
1522
1522
  this.integerOnly = false;
1523
+ this.showStepper = false;
1524
+ this.stepAmount = 1;
1523
1525
  }
1524
1526
  static {
1525
- this.styles = [...AxebowInputBase.baseStyles];
1527
+ this.styles = [...AxebowInputBase.baseStyles, css`
1528
+ :host {
1529
+ display: block;
1530
+ width: 100%;
1531
+ }
1532
+ /* Both guarded by their own host class - absent unless the matching
1533
+ property is set - so neither ever touches sl-input's own default
1534
+ sizing/padding for every existing caller that doesn't opt in. */
1535
+ :host(.axebow-fixed-height) sl-input::part(base) {
1536
+ height: var(--axebow-input-height);
1537
+ }
1538
+ :host(.axebow-has-stepper) sl-input::part(base) {
1539
+ padding-right: 0;
1540
+ }
1541
+ :host(.axebow-has-stepper) sl-input::part(suffix) {
1542
+ height: 100%;
1543
+ margin: 0;
1544
+ padding: 0;
1545
+ }
1546
+
1547
+ .axebow-numeric-stepper {
1548
+ display: flex;
1549
+ flex-direction: column;
1550
+ width: 1.375rem;
1551
+ height: 2.375rem;
1552
+ border-radius: 0 var(--sl-input-border-radius-medium, 0.25rem) var(--sl-input-border-radius-medium, 0.25rem) 0;
1553
+ overflow: hidden;
1554
+ }
1555
+ .axebow-numeric-stepper-btn {
1556
+ flex: 1;
1557
+ display: flex;
1558
+ align-items: center;
1559
+ justify-content: center;
1560
+ min-width: 0;
1561
+ border: 1px solid var(--axebow-gray);
1562
+ background: transparent;
1563
+ padding: 0;
1564
+ margin: 0;
1565
+ cursor: pointer;
1566
+ }
1567
+ .axebow-numeric-stepper-btn:disabled {
1568
+ cursor: not-allowed;
1569
+ opacity: 0.5;
1570
+ }
1571
+ `];
1572
+ }
1573
+ updated(changed) {
1574
+ super.updated(changed);
1575
+ if (changed.has("fixedWidth")) this.style.width = this.fixedWidth || "";
1576
+ if (changed.has("fixedHeight")) if (this.fixedHeight) {
1577
+ this.style.setProperty("--axebow-input-height", this.fixedHeight);
1578
+ this.classList.add("axebow-fixed-height");
1579
+ } else {
1580
+ this.style.removeProperty("--axebow-input-height");
1581
+ this.classList.remove("axebow-fixed-height");
1582
+ }
1583
+ if (changed.has("showStepper")) this.classList.toggle("axebow-has-stepper", this.showStepper);
1526
1584
  }
1527
1585
  handleChange(e) {
1528
1586
  if (this.disabled) return;
@@ -1540,6 +1598,45 @@ var AxebowNumericInput = class AxebowNumericInput extends AxebowInputBase {
1540
1598
  handleKeyDown(e) {
1541
1599
  if (this.integerOnly && (e.key === "." || e.key === "," || e.key === "e" || e.key === "E")) e.preventDefault();
1542
1600
  }
1601
+ _bumpValue(sign) {
1602
+ if (this.disabled) return;
1603
+ const step = this.integerOnly ? Math.trunc(this.stepAmount) || 1 : this.stepAmount;
1604
+ const current = Number(this.value) || 0;
1605
+ const next = Math.min(this.max, Math.max(this.min, current + sign * step));
1606
+ const input = this.renderRoot.querySelector("sl-input");
1607
+ if (!input) return;
1608
+ input.value = next.toString();
1609
+ input.dispatchEvent(new Event("sl-input", {
1610
+ bubbles: true,
1611
+ composed: true
1612
+ }));
1613
+ }
1614
+ _renderStepper() {
1615
+ if (!this.showStepper) return "";
1616
+ const current = Number(this.value) || 0;
1617
+ return html`
1618
+ <div slot="suffix" class="axebow-numeric-stepper">
1619
+ <button
1620
+ type="button"
1621
+ class="axebow-numeric-stepper-btn"
1622
+ ?disabled=${this.disabled || current >= this.max}
1623
+ aria-label="increment"
1624
+ @click=${() => this._bumpValue(1)}
1625
+ >
1626
+ <axebow-icon iconName="add" iconColor="var(--axebow-tertiary)" size="small"></axebow-icon>
1627
+ </button>
1628
+ <button
1629
+ type="button"
1630
+ class="axebow-numeric-stepper-btn"
1631
+ ?disabled=${this.disabled || current <= this.min}
1632
+ aria-label="decrement"
1633
+ @click=${() => this._bumpValue(-1)}
1634
+ >
1635
+ <axebow-icon iconName="remove" iconColor="var(--axebow-tertiary)" size="small"></axebow-icon>
1636
+ </button>
1637
+ </div>
1638
+ `;
1639
+ }
1543
1640
  render() {
1544
1641
  const containerClass = this.hasError ? "input-error" : "";
1545
1642
  return this.renderWrapper(html`
@@ -1554,7 +1651,9 @@ var AxebowNumericInput = class AxebowNumericInput extends AxebowInputBase {
1554
1651
  max=${this.max}
1555
1652
  min=${this.min}
1556
1653
  step=${this.integerOnly ? "1" : "any"}
1557
- ></sl-input>
1654
+ >
1655
+ ${this._renderStepper()}
1656
+ </sl-input>
1558
1657
  </div>
1559
1658
  `);
1560
1659
  }
@@ -1562,6 +1661,10 @@ var AxebowNumericInput = class AxebowNumericInput extends AxebowInputBase {
1562
1661
  __decorate([property({ type: Number })], AxebowNumericInput.prototype, "max", void 0);
1563
1662
  __decorate([property({ type: Number })], AxebowNumericInput.prototype, "min", void 0);
1564
1663
  __decorate([property({ type: Boolean })], AxebowNumericInput.prototype, "integerOnly", void 0);
1664
+ __decorate([property({ type: String })], AxebowNumericInput.prototype, "fixedWidth", void 0);
1665
+ __decorate([property({ type: String })], AxebowNumericInput.prototype, "fixedHeight", void 0);
1666
+ __decorate([property({ type: Boolean })], AxebowNumericInput.prototype, "showStepper", void 0);
1667
+ __decorate([property({ type: Number })], AxebowNumericInput.prototype, "stepAmount", void 0);
1565
1668
  AxebowNumericInput = __decorate([customElement("axebow-numeric-input")], AxebowNumericInput);
1566
1669
  //#endregion
1567
1670
  //#region src/components/axebow-input/axebow-checkbox-input.ts
@@ -1918,6 +2021,8 @@ var AxebowInput = class AxebowInput extends LitElement {
1918
2021
  this.addDialogLabels = DEFAULT_ADD_DIALOG_LABELS;
1919
2022
  this.compact = false;
1920
2023
  this.integerOnly = false;
2024
+ this.showStepper = false;
2025
+ this.stepAmount = 1;
1921
2026
  }
1922
2027
  static {
1923
2028
  this.styles = [
@@ -1928,6 +2033,10 @@ var AxebowInput = class AxebowInput extends LitElement {
1928
2033
  sl-select {
1929
2034
  width: 100%;
1930
2035
  }
2036
+ axebow-numeric-input {
2037
+ display: block;
2038
+ width: 100%;
2039
+ }
1931
2040
  `
1932
2041
  ];
1933
2042
  }
@@ -1962,6 +2071,10 @@ var AxebowInput = class AxebowInput extends LitElement {
1962
2071
  .max=${this.max}
1963
2072
  .min=${this.min}
1964
2073
  .compact=${this.compact}
2074
+ .fixedWidth=${this.fixedWidth}
2075
+ .fixedHeight=${this.fixedHeight}
2076
+ .showStepper=${this.showStepper}
2077
+ .stepAmount=${this.stepAmount}
1965
2078
  ></axebow-numeric-input>
1966
2079
  `;
1967
2080
  case "integer": return html`
@@ -1979,6 +2092,10 @@ var AxebowInput = class AxebowInput extends LitElement {
1979
2092
  .min=${this.min}
1980
2093
  .integerOnly=${true}
1981
2094
  .compact=${this.compact}
2095
+ .fixedWidth=${this.fixedWidth}
2096
+ .fixedHeight=${this.fixedHeight}
2097
+ .showStepper=${this.showStepper}
2098
+ .stepAmount=${this.stepAmount}
1982
2099
  ></axebow-numeric-input>
1983
2100
  `;
1984
2101
  case "select": return html`
@@ -2114,6 +2231,10 @@ __decorate([property({ attribute: false })], AxebowInput.prototype, "onAddNew",
2114
2231
  __decorate([property({ attribute: false })], AxebowInput.prototype, "addDialogLabels", void 0);
2115
2232
  __decorate([property({ type: Boolean })], AxebowInput.prototype, "compact", void 0);
2116
2233
  __decorate([property({ type: Boolean })], AxebowInput.prototype, "integerOnly", void 0);
2234
+ __decorate([property({ type: String })], AxebowInput.prototype, "fixedWidth", void 0);
2235
+ __decorate([property({ type: String })], AxebowInput.prototype, "fixedHeight", void 0);
2236
+ __decorate([property({ type: Boolean })], AxebowInput.prototype, "showStepper", void 0);
2237
+ __decorate([property({ type: Number })], AxebowInput.prototype, "stepAmount", void 0);
2117
2238
  AxebowInput = __decorate([customElement("axebow-input")], AxebowInput);
2118
2239
  //#endregion
2119
2240
  //#region src/components/axebow-dialog/axebow-dialog.ts