@kumori/aurora-wui-components 0.0.273-dev4131.18 → 0.0.273-dev4131.19
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.
|
@@ -21,9 +21,11 @@ export declare class AxebowFormPanelField extends LitElement {
|
|
|
21
21
|
connectedCallback(): void;
|
|
22
22
|
disconnectedCallback(): void;
|
|
23
23
|
private _handleOutsideClick;
|
|
24
|
+
private get _isSelector();
|
|
24
25
|
private _handleFocus;
|
|
25
26
|
private _handleBlur;
|
|
26
27
|
private _handleInput;
|
|
28
|
+
private _handleKeyDown;
|
|
27
29
|
private _handleActionClick;
|
|
28
30
|
private _handleSecondaryActionClick;
|
|
29
31
|
private _handleCloseClick;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"axebow-form-panel-field.d.ts","sourceRoot":"","sources":["../../../src/components/axebow-form-panel-field/axebow-form-panel-field.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,UAAU,EAAa,MAAM,KAAK,CAAC;AAEvD,OAAO,+BAA+B,CAAC;AAEvC,MAAM,MAAM,mBAAmB,GAAG,aAAa,GAAG,QAAQ,CAAC;AAE3D,qBACa,oBAAqB,SAAQ,UAAU;IAClD,MAAM,CAAC,MAAM,4BAiBX;IAE0B,YAAY,EAAE,mBAAmB,CAAiB;IACjD,QAAQ,UAAS;IAClB,KAAK,SAAiB;IACtB,KAAK,SAAM;IACV,SAAS,UAAQ;IACjB,YAAY,UAAS;IACrB,aAAa,UAAS;IACvB,eAAe,SAA4B;IAC1C,cAAc,UAAS;IACxB,UAAU,SAAkB;IAC5B,SAAS,SAAM;IACd,uBAAuB,UAAS;IACjC,mBAAmB,SAAiB;IAEhE,oDAAoD;IACzB,OAAO,EAAE,MAAM,EAAE,CAAM;IAEzC,OAAO,CAAC,eAAe,CAAS;IAEzC,iBAAiB;IAKjB,oBAAoB;IAKpB,OAAO,CAAC,mBAAmB,CAIzB;IAEF,OAAO,CAAC,YAAY;IAWpB,OAAO,CAAC,WAAW;IAWnB,OAAO,CAAC,YAAY;IAapB,OAAO,CAAC,kBAAkB;IAe1B,OAAO,CAAC,2BAA2B;IAWnC,OAAO,CAAC,iBAAiB;IAWzB,OAAO,CAAC,oBAAoB;IAe5B,OAAO,CAAC,aAAa;IAqBrB,MAAM;
|
|
1
|
+
{"version":3,"file":"axebow-form-panel-field.d.ts","sourceRoot":"","sources":["../../../src/components/axebow-form-panel-field/axebow-form-panel-field.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,UAAU,EAAa,MAAM,KAAK,CAAC;AAEvD,OAAO,+BAA+B,CAAC;AAEvC,MAAM,MAAM,mBAAmB,GAAG,aAAa,GAAG,QAAQ,CAAC;AAE3D,qBACa,oBAAqB,SAAQ,UAAU;IAClD,MAAM,CAAC,MAAM,4BAiBX;IAE0B,YAAY,EAAE,mBAAmB,CAAiB;IACjD,QAAQ,UAAS;IAClB,KAAK,SAAiB;IACtB,KAAK,SAAM;IACV,SAAS,UAAQ;IACjB,YAAY,UAAS;IACrB,aAAa,UAAS;IACvB,eAAe,SAA4B;IAC1C,cAAc,UAAS;IACxB,UAAU,SAAkB;IAC5B,SAAS,SAAM;IACd,uBAAuB,UAAS;IACjC,mBAAmB,SAAiB;IAEhE,oDAAoD;IACzB,OAAO,EAAE,MAAM,EAAE,CAAM;IAEzC,OAAO,CAAC,eAAe,CAAS;IAEzC,iBAAiB;IAKjB,oBAAoB;IAKpB,OAAO,CAAC,mBAAmB,CAIzB;IAEF,OAAO,KAAK,WAAW,GAEtB;IAED,OAAO,CAAC,YAAY;IAWpB,OAAO,CAAC,WAAW;IAWnB,OAAO,CAAC,YAAY;IAapB,OAAO,CAAC,cAAc;IAWtB,OAAO,CAAC,kBAAkB;IAe1B,OAAO,CAAC,2BAA2B;IAWnC,OAAO,CAAC,iBAAiB;IAWzB,OAAO,CAAC,oBAAoB;IAe5B,OAAO,CAAC,aAAa;IAqBrB,MAAM;CAuHP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,yBAAyB,EAAE,oBAAoB,CAAC;KACjD;CACF"}
|
package/dist/index.js
CHANGED
|
@@ -11465,6 +11465,9 @@ var AxebowFormPanelField = class AxebowFormPanelField extends LitElement {
|
|
|
11465
11465
|
super.disconnectedCallback();
|
|
11466
11466
|
window.removeEventListener("click", this._handleOutsideClick);
|
|
11467
11467
|
}
|
|
11468
|
+
get _isSelector() {
|
|
11469
|
+
return Boolean(this.showDropdown || this.options && this.options.length > 0);
|
|
11470
|
+
}
|
|
11468
11471
|
_handleFocus(_e) {
|
|
11469
11472
|
if (this.disabled) return;
|
|
11470
11473
|
this.dispatchEvent(new CustomEvent("focus", {
|
|
@@ -11482,7 +11485,7 @@ var AxebowFormPanelField = class AxebowFormPanelField extends LitElement {
|
|
|
11482
11485
|
}));
|
|
11483
11486
|
}
|
|
11484
11487
|
_handleInput(e) {
|
|
11485
|
-
if (this.disabled) return;
|
|
11488
|
+
if (this.disabled || this._isSelector) return;
|
|
11486
11489
|
const target = e.target;
|
|
11487
11490
|
this.value = target.value;
|
|
11488
11491
|
this.dispatchEvent(new CustomEvent("change", {
|
|
@@ -11491,6 +11494,16 @@ var AxebowFormPanelField = class AxebowFormPanelField extends LitElement {
|
|
|
11491
11494
|
composed: true
|
|
11492
11495
|
}));
|
|
11493
11496
|
}
|
|
11497
|
+
_handleKeyDown(e) {
|
|
11498
|
+
if (this.disabled || !this._isSelector) return;
|
|
11499
|
+
if (e.key === "Enter" || e.key === " " || e.key === "ArrowDown") {
|
|
11500
|
+
e.preventDefault();
|
|
11501
|
+
this._handleDropdownClick(e);
|
|
11502
|
+
} else if (e.key === "Escape" && this._isDropdownOpen) {
|
|
11503
|
+
e.preventDefault();
|
|
11504
|
+
this._isDropdownOpen = false;
|
|
11505
|
+
}
|
|
11506
|
+
}
|
|
11494
11507
|
_handleActionClick(e) {
|
|
11495
11508
|
e.stopPropagation();
|
|
11496
11509
|
const textToCopy = this.copyValue !== void 0 && this.copyValue !== "" ? this.copyValue : this.value;
|
|
@@ -11543,6 +11556,7 @@ var AxebowFormPanelField = class AxebowFormPanelField extends LitElement {
|
|
|
11543
11556
|
}));
|
|
11544
11557
|
}
|
|
11545
11558
|
render() {
|
|
11559
|
+
const isSelector = this._isSelector;
|
|
11546
11560
|
const isFilled = this.styleVariant && this.styleVariant.toLowerCase() === "filled" || !!this.value;
|
|
11547
11561
|
const bgClass = this.disabled ? "bg-(--axebow-base) border border-solid border-(--axebow-border-gray)" : "bg-white border border-solid border-(--axebow-border-gray) focus-within:border-(--axebow-tertiary)";
|
|
11548
11562
|
const textColor = this.disabled ? "text-(--axebow-gray)" : isFilled ? "text-(--axebow-strong-gray)" : "text-(--axebow-gray)";
|
|
@@ -11550,8 +11564,9 @@ var AxebowFormPanelField = class AxebowFormPanelField extends LitElement {
|
|
|
11550
11564
|
<div class="relative w-full">
|
|
11551
11565
|
<!-- Field Container -->
|
|
11552
11566
|
<div
|
|
11553
|
-
class="field-container border flex items-center justify-between gap-2 ${bgClass} ${
|
|
11554
|
-
@click=${
|
|
11567
|
+
class="field-container border flex items-center justify-between gap-2 ${bgClass} ${isSelector && !this.disabled ? "cursor-pointer select-none" : ""}"
|
|
11568
|
+
@click=${isSelector ? this._handleDropdownClick : null}
|
|
11569
|
+
@keydown=${this._handleKeyDown}
|
|
11555
11570
|
>
|
|
11556
11571
|
<div class="flex flex-col justify-center flex-1 min-w-0">
|
|
11557
11572
|
<!-- Top Label -->
|
|
@@ -11563,10 +11578,11 @@ var AxebowFormPanelField = class AxebowFormPanelField extends LitElement {
|
|
|
11563
11578
|
<!-- Value / Input -->
|
|
11564
11579
|
<input
|
|
11565
11580
|
type="text"
|
|
11566
|
-
class="w-full bg-transparent border-0 p-0 text-sm font-normal ${textColor} focus:outline-none truncate"
|
|
11581
|
+
class="w-full bg-transparent border-0 p-0 text-sm font-normal ${textColor} focus:outline-none truncate ${isSelector && !this.disabled ? "cursor-pointer select-none" : ""}"
|
|
11567
11582
|
.value=${this.value}
|
|
11568
11583
|
placeholder=${this.placeholderCopy}
|
|
11569
11584
|
?disabled=${this.disabled}
|
|
11585
|
+
?readonly=${isSelector}
|
|
11570
11586
|
@input=${this._handleInput}
|
|
11571
11587
|
@focus=${this._handleFocus}
|
|
11572
11588
|
@blur=${this._handleBlur}
|
|
@@ -11602,7 +11618,7 @@ var AxebowFormPanelField = class AxebowFormPanelField extends LitElement {
|
|
|
11602
11618
|
<axebow-icon iconName="cancel" iconColor="currentColor" size="lg"></axebow-icon>
|
|
11603
11619
|
</button>
|
|
11604
11620
|
` : ""}
|
|
11605
|
-
${
|
|
11621
|
+
${isSelector ? html`
|
|
11606
11622
|
<button
|
|
11607
11623
|
type="button"
|
|
11608
11624
|
class="p-0 border-0 bg-transparent cursor-pointer flex items-center justify-center text-(--axebow-tertiary) hover:text-(--axebow-gray) transition-colors"
|
|
@@ -11620,7 +11636,7 @@ var AxebowFormPanelField = class AxebowFormPanelField extends LitElement {
|
|
|
11620
11636
|
</div>
|
|
11621
11637
|
|
|
11622
11638
|
<!-- Dropdown Menu Overlay -->
|
|
11623
|
-
${
|
|
11639
|
+
${isSelector && this._isDropdownOpen && this.options && this.options.length > 0 ? html`
|
|
11624
11640
|
<div
|
|
11625
11641
|
class="absolute left-0 top-full mt-1 w-full bg-white border border-solid border-(--axebow-border-gray) rounded-md shadow-lg z-50 max-h-48 overflow-y-auto py-1 box-border"
|
|
11626
11642
|
>
|