@kumori/aurora-wui-components 0.0.177 → 0.0.179
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/dist/components/axebow-input/axebow-input.d.ts +4 -0
- package/dist/components/axebow-input/axebow-input.d.ts.map +1 -1
- package/dist/components/axebow-input/axebow-numeric-input.d.ts +15 -0
- package/dist/components/axebow-input/axebow-numeric-input.d.ts.map +1 -1
- package/dist/index.js +134 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -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;A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,EAAE,CAAM;IACvB,aAAa,EAAE,YAAY,EAAE,CAAM;IACf,QAAQ,UAAS;IAChC,oBAAoB,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,OAAO,CAAC;IAC3D,YAAY,SAAM;IACjB,QAAQ,UAAS;IAClB,GAAG,SAA2B;IAC9B,GAAG,SAAK;IACR,SAAS,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,UAAS;IACrB,WAAW,SAAkB;IAC7B,gBAAgB,SAAmB;IAClC,mBAAmB,UAAQ;IAC3B,SAAS,UAAQ;IACd,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACrF,eAAe,EAAE,eAAe,CAA6B;IAChE,OAAO,UAAS;IAChB,WAAW,UAAS;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,UAAS;IACrB,UAAU,SAAK;IAE3C,MAAM;CA+KP"}
|
|
@@ -1,11 +1,26 @@
|
|
|
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 size for the field itself - the sl-input box, not the
|
|
9
|
+
* label/description column above it (e.g. fixedWidth '6.1875rem' for a
|
|
10
|
+
* 99px-wide field, fixedHeight '2.5rem' for 40px). Left unset, every
|
|
11
|
+
* existing caller keeps the field's previous default sizing unchanged. */
|
|
12
|
+
fixedWidth?: string;
|
|
13
|
+
fixedHeight?: string;
|
|
14
|
+
/** Adds a 22x38 +/- stepper flush against the field's right border,
|
|
15
|
+
* wired to the same min/max/integerOnly rules as typed input. Off by
|
|
16
|
+
* default - opt in per caller. */
|
|
17
|
+
showStepper: boolean;
|
|
18
|
+
stepAmount: number;
|
|
19
|
+
updated(changed: PropertyValues): void;
|
|
7
20
|
protected handleChange(e: Event): void;
|
|
8
21
|
protected handleKeyDown(e: KeyboardEvent): void;
|
|
22
|
+
private _bumpValue;
|
|
23
|
+
private _renderStepper;
|
|
9
24
|
render(): import('lit-html').TemplateResult;
|
|
10
25
|
}
|
|
11
26
|
//# 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":"
|
|
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,4BAoDX;IAE0B,GAAG,SAA2B;IAC9B,GAAG,SAAK;IACP,WAAW,UAAS;IAEjD;;;+EAG2E;IAC/C,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;IAyB/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,78 @@ 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
|
+
/* All three guarded by their own host class - absent unless the
|
|
1533
|
+
matching property is set - so none ever touch sl-input's own
|
|
1534
|
+
default sizing/padding for every existing caller that doesn't opt
|
|
1535
|
+
in. fixedWidth only constrains the field itself (not the host, so
|
|
1536
|
+
the label above keeps its full width and doesn't wrap). */
|
|
1537
|
+
:host(.axebow-fixed-width) sl-input {
|
|
1538
|
+
width: var(--axebow-input-width);
|
|
1539
|
+
}
|
|
1540
|
+
:host(.axebow-fixed-height) sl-input::part(base) {
|
|
1541
|
+
height: var(--axebow-input-height);
|
|
1542
|
+
}
|
|
1543
|
+
:host(.axebow-has-stepper) sl-input::part(base) {
|
|
1544
|
+
padding-right: 0;
|
|
1545
|
+
}
|
|
1546
|
+
:host(.axebow-has-stepper) sl-input::part(suffix) {
|
|
1547
|
+
height: 100%;
|
|
1548
|
+
margin: 0;
|
|
1549
|
+
padding: 0;
|
|
1550
|
+
}
|
|
1551
|
+
|
|
1552
|
+
.axebow-numeric-stepper {
|
|
1553
|
+
display: flex;
|
|
1554
|
+
flex-direction: column;
|
|
1555
|
+
width: 1.375rem;
|
|
1556
|
+
height: 2.375rem;
|
|
1557
|
+
border-radius: 0 var(--sl-input-border-radius-medium, 0.25rem) var(--sl-input-border-radius-medium, 0.25rem) 0;
|
|
1558
|
+
overflow: hidden;
|
|
1559
|
+
}
|
|
1560
|
+
.axebow-numeric-stepper-btn {
|
|
1561
|
+
flex: 1;
|
|
1562
|
+
display: flex;
|
|
1563
|
+
align-items: center;
|
|
1564
|
+
justify-content: center;
|
|
1565
|
+
min-width: 0;
|
|
1566
|
+
border: 1px solid var(--axebow-gray);
|
|
1567
|
+
background: transparent;
|
|
1568
|
+
padding: 0;
|
|
1569
|
+
margin: 0;
|
|
1570
|
+
cursor: pointer;
|
|
1571
|
+
}
|
|
1572
|
+
.axebow-numeric-stepper-btn:disabled {
|
|
1573
|
+
cursor: not-allowed;
|
|
1574
|
+
opacity: 0.5;
|
|
1575
|
+
}
|
|
1576
|
+
`];
|
|
1577
|
+
}
|
|
1578
|
+
updated(changed) {
|
|
1579
|
+
super.updated(changed);
|
|
1580
|
+
if (changed.has("fixedWidth")) if (this.fixedWidth) {
|
|
1581
|
+
this.style.setProperty("--axebow-input-width", this.fixedWidth);
|
|
1582
|
+
this.classList.add("axebow-fixed-width");
|
|
1583
|
+
} else {
|
|
1584
|
+
this.style.removeProperty("--axebow-input-width");
|
|
1585
|
+
this.classList.remove("axebow-fixed-width");
|
|
1586
|
+
}
|
|
1587
|
+
if (changed.has("fixedHeight")) if (this.fixedHeight) {
|
|
1588
|
+
this.style.setProperty("--axebow-input-height", this.fixedHeight);
|
|
1589
|
+
this.classList.add("axebow-fixed-height");
|
|
1590
|
+
} else {
|
|
1591
|
+
this.style.removeProperty("--axebow-input-height");
|
|
1592
|
+
this.classList.remove("axebow-fixed-height");
|
|
1593
|
+
}
|
|
1594
|
+
if (changed.has("showStepper")) this.classList.toggle("axebow-has-stepper", this.showStepper);
|
|
1526
1595
|
}
|
|
1527
1596
|
handleChange(e) {
|
|
1528
1597
|
if (this.disabled) return;
|
|
@@ -1540,6 +1609,45 @@ var AxebowNumericInput = class AxebowNumericInput extends AxebowInputBase {
|
|
|
1540
1609
|
handleKeyDown(e) {
|
|
1541
1610
|
if (this.integerOnly && (e.key === "." || e.key === "," || e.key === "e" || e.key === "E")) e.preventDefault();
|
|
1542
1611
|
}
|
|
1612
|
+
_bumpValue(sign) {
|
|
1613
|
+
if (this.disabled) return;
|
|
1614
|
+
const step = this.integerOnly ? Math.trunc(this.stepAmount) || 1 : this.stepAmount;
|
|
1615
|
+
const current = Number(this.value) || 0;
|
|
1616
|
+
const next = Math.min(this.max, Math.max(this.min, current + sign * step));
|
|
1617
|
+
const input = this.renderRoot.querySelector("sl-input");
|
|
1618
|
+
if (!input) return;
|
|
1619
|
+
input.value = next.toString();
|
|
1620
|
+
input.dispatchEvent(new Event("sl-input", {
|
|
1621
|
+
bubbles: true,
|
|
1622
|
+
composed: true
|
|
1623
|
+
}));
|
|
1624
|
+
}
|
|
1625
|
+
_renderStepper() {
|
|
1626
|
+
if (!this.showStepper) return "";
|
|
1627
|
+
const current = Number(this.value) || 0;
|
|
1628
|
+
return html`
|
|
1629
|
+
<div slot="suffix" class="axebow-numeric-stepper">
|
|
1630
|
+
<button
|
|
1631
|
+
type="button"
|
|
1632
|
+
class="axebow-numeric-stepper-btn"
|
|
1633
|
+
?disabled=${this.disabled || current >= this.max}
|
|
1634
|
+
aria-label="increment"
|
|
1635
|
+
@click=${() => this._bumpValue(1)}
|
|
1636
|
+
>
|
|
1637
|
+
<axebow-icon iconName="add" iconColor="var(--axebow-tertiary)" size="small"></axebow-icon>
|
|
1638
|
+
</button>
|
|
1639
|
+
<button
|
|
1640
|
+
type="button"
|
|
1641
|
+
class="axebow-numeric-stepper-btn"
|
|
1642
|
+
?disabled=${this.disabled || current <= this.min}
|
|
1643
|
+
aria-label="decrement"
|
|
1644
|
+
@click=${() => this._bumpValue(-1)}
|
|
1645
|
+
>
|
|
1646
|
+
<axebow-icon iconName="remove" iconColor="var(--axebow-tertiary)" size="small"></axebow-icon>
|
|
1647
|
+
</button>
|
|
1648
|
+
</div>
|
|
1649
|
+
`;
|
|
1650
|
+
}
|
|
1543
1651
|
render() {
|
|
1544
1652
|
const containerClass = this.hasError ? "input-error" : "";
|
|
1545
1653
|
return this.renderWrapper(html`
|
|
@@ -1554,7 +1662,9 @@ var AxebowNumericInput = class AxebowNumericInput extends AxebowInputBase {
|
|
|
1554
1662
|
max=${this.max}
|
|
1555
1663
|
min=${this.min}
|
|
1556
1664
|
step=${this.integerOnly ? "1" : "any"}
|
|
1557
|
-
|
|
1665
|
+
>
|
|
1666
|
+
${this._renderStepper()}
|
|
1667
|
+
</sl-input>
|
|
1558
1668
|
</div>
|
|
1559
1669
|
`);
|
|
1560
1670
|
}
|
|
@@ -1562,6 +1672,10 @@ var AxebowNumericInput = class AxebowNumericInput extends AxebowInputBase {
|
|
|
1562
1672
|
__decorate([property({ type: Number })], AxebowNumericInput.prototype, "max", void 0);
|
|
1563
1673
|
__decorate([property({ type: Number })], AxebowNumericInput.prototype, "min", void 0);
|
|
1564
1674
|
__decorate([property({ type: Boolean })], AxebowNumericInput.prototype, "integerOnly", void 0);
|
|
1675
|
+
__decorate([property({ type: String })], AxebowNumericInput.prototype, "fixedWidth", void 0);
|
|
1676
|
+
__decorate([property({ type: String })], AxebowNumericInput.prototype, "fixedHeight", void 0);
|
|
1677
|
+
__decorate([property({ type: Boolean })], AxebowNumericInput.prototype, "showStepper", void 0);
|
|
1678
|
+
__decorate([property({ type: Number })], AxebowNumericInput.prototype, "stepAmount", void 0);
|
|
1565
1679
|
AxebowNumericInput = __decorate([customElement("axebow-numeric-input")], AxebowNumericInput);
|
|
1566
1680
|
//#endregion
|
|
1567
1681
|
//#region src/components/axebow-input/axebow-checkbox-input.ts
|
|
@@ -1918,6 +2032,8 @@ var AxebowInput = class AxebowInput extends LitElement {
|
|
|
1918
2032
|
this.addDialogLabels = DEFAULT_ADD_DIALOG_LABELS;
|
|
1919
2033
|
this.compact = false;
|
|
1920
2034
|
this.integerOnly = false;
|
|
2035
|
+
this.showStepper = false;
|
|
2036
|
+
this.stepAmount = 1;
|
|
1921
2037
|
}
|
|
1922
2038
|
static {
|
|
1923
2039
|
this.styles = [
|
|
@@ -1928,6 +2044,10 @@ var AxebowInput = class AxebowInput extends LitElement {
|
|
|
1928
2044
|
sl-select {
|
|
1929
2045
|
width: 100%;
|
|
1930
2046
|
}
|
|
2047
|
+
axebow-numeric-input {
|
|
2048
|
+
display: block;
|
|
2049
|
+
width: 100%;
|
|
2050
|
+
}
|
|
1931
2051
|
`
|
|
1932
2052
|
];
|
|
1933
2053
|
}
|
|
@@ -1962,6 +2082,10 @@ var AxebowInput = class AxebowInput extends LitElement {
|
|
|
1962
2082
|
.max=${this.max}
|
|
1963
2083
|
.min=${this.min}
|
|
1964
2084
|
.compact=${this.compact}
|
|
2085
|
+
.fixedWidth=${this.fixedWidth}
|
|
2086
|
+
.fixedHeight=${this.fixedHeight}
|
|
2087
|
+
.showStepper=${this.showStepper}
|
|
2088
|
+
.stepAmount=${this.stepAmount}
|
|
1965
2089
|
></axebow-numeric-input>
|
|
1966
2090
|
`;
|
|
1967
2091
|
case "integer": return html`
|
|
@@ -1979,6 +2103,10 @@ var AxebowInput = class AxebowInput extends LitElement {
|
|
|
1979
2103
|
.min=${this.min}
|
|
1980
2104
|
.integerOnly=${true}
|
|
1981
2105
|
.compact=${this.compact}
|
|
2106
|
+
.fixedWidth=${this.fixedWidth}
|
|
2107
|
+
.fixedHeight=${this.fixedHeight}
|
|
2108
|
+
.showStepper=${this.showStepper}
|
|
2109
|
+
.stepAmount=${this.stepAmount}
|
|
1982
2110
|
></axebow-numeric-input>
|
|
1983
2111
|
`;
|
|
1984
2112
|
case "select": return html`
|
|
@@ -2114,6 +2242,10 @@ __decorate([property({ attribute: false })], AxebowInput.prototype, "onAddNew",
|
|
|
2114
2242
|
__decorate([property({ attribute: false })], AxebowInput.prototype, "addDialogLabels", void 0);
|
|
2115
2243
|
__decorate([property({ type: Boolean })], AxebowInput.prototype, "compact", void 0);
|
|
2116
2244
|
__decorate([property({ type: Boolean })], AxebowInput.prototype, "integerOnly", void 0);
|
|
2245
|
+
__decorate([property({ type: String })], AxebowInput.prototype, "fixedWidth", void 0);
|
|
2246
|
+
__decorate([property({ type: String })], AxebowInput.prototype, "fixedHeight", void 0);
|
|
2247
|
+
__decorate([property({ type: Boolean })], AxebowInput.prototype, "showStepper", void 0);
|
|
2248
|
+
__decorate([property({ type: Number })], AxebowInput.prototype, "stepAmount", void 0);
|
|
2117
2249
|
AxebowInput = __decorate([customElement("axebow-input")], AxebowInput);
|
|
2118
2250
|
//#endregion
|
|
2119
2251
|
//#region src/components/axebow-dialog/axebow-dialog.ts
|