codexly-ui 0.5.6 → 0.5.8
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/fesm2022/codexly-ui.mjs +378 -324
- package/fesm2022/codexly-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/codexly-ui.d.ts +20 -1
package/fesm2022/codexly-ui.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, computed, ChangeDetectionStrategy, ViewEncapsulation, Component, InjectionToken, inject, PLATFORM_ID, signal, effect, Injectable, ElementRef, HostAttributeToken, output, Directive,
|
|
2
|
+
import { input, computed, ChangeDetectionStrategy, ViewEncapsulation, Component, InjectionToken, inject, PLATFORM_ID, signal, effect, Injectable, ElementRef, HostAttributeToken, output, Directive, forwardRef, contentChild, Renderer2, ApplicationRef, EnvironmentInjector, DestroyRef, createComponent, untracked, HostListener, viewChild, ViewChild, Injector, ChangeDetectorRef, NgZone, model, contentChildren, ContentChildren, ViewChildren, Input, numberAttribute, booleanAttribute } from '@angular/core';
|
|
3
3
|
import { isPlatformBrowser, NgTemplateOutlet, DOCUMENT, NgStyle, CurrencyPipe, DecimalPipe } from '@angular/common';
|
|
4
4
|
import * as i1$1 from '@angular/forms';
|
|
5
5
|
import { NG_VALUE_ACCESSOR, FormControl, NgControl, ReactiveFormsModule, FormGroup, Validators, FormsModule } from '@angular/forms';
|
|
@@ -655,6 +655,24 @@ const BADGE_SHAPE_FIXED = {
|
|
|
655
655
|
circle: 'rounded-full',
|
|
656
656
|
};
|
|
657
657
|
|
|
658
|
+
// ── Context ───────────────────────────────────────────────────────────────────
|
|
659
|
+
/** Provided by clx-card so nested form controls/buttons can inherit its disabled state. */
|
|
660
|
+
const CLX_CARD_DISABLED_CONTEXT = new InjectionToken('CLX_CARD_DISABLED_CONTEXT');
|
|
661
|
+
const CARD_PADDING_MAP = {
|
|
662
|
+
none: '',
|
|
663
|
+
sm: 'p-2',
|
|
664
|
+
md: 'p-3',
|
|
665
|
+
lg: 'p-5',
|
|
666
|
+
};
|
|
667
|
+
const CARD_SHADOW_MAP = {
|
|
668
|
+
none: 'shadow-none',
|
|
669
|
+
sm: 'shadow-sm',
|
|
670
|
+
md: 'shadow-md',
|
|
671
|
+
lg: 'shadow-lg',
|
|
672
|
+
xl: 'shadow-xl',
|
|
673
|
+
'2xl': 'shadow-2xl',
|
|
674
|
+
};
|
|
675
|
+
|
|
658
676
|
const SPINNER_SIZE_MAP = {
|
|
659
677
|
xxs: 'w-3 h-3 border-2',
|
|
660
678
|
xs: 'w-4 h-4 border-2',
|
|
@@ -788,7 +806,8 @@ class ClxButtonComponent {
|
|
|
788
806
|
* necessarily painted yet when the constructor runs — otherwise any consumer-supplied
|
|
789
807
|
* classes (e.g. positioning utilities like `absolute`/`top-1`) would be silently lost. */
|
|
790
808
|
_consumerClass = inject(new HostAttributeToken('class'), { optional: true }) ?? '';
|
|
791
|
-
|
|
809
|
+
_cardDisabled = inject(CLX_CARD_DISABLED_CONTEXT, { optional: true });
|
|
810
|
+
_inactive = computed(() => this.loading() || this.disabled() || !!this._cardDisabled?.(), ...(ngDevMode ? [{ debugName: "_inactive" }] : /* istanbul ignore next */ []));
|
|
792
811
|
_badgeClass = computed(() => {
|
|
793
812
|
const t = resolveColor(this.badgeColor());
|
|
794
813
|
const size = BADGE_CIRCLE_SIZE_MAP['xs'];
|
|
@@ -1208,21 +1227,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
|
|
|
1208
1227
|
}]
|
|
1209
1228
|
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], shape: [{ type: i0.Input, args: [{ isSignal: true, alias: "shape", required: false }] }], onRemove: [{ type: i0.Output, args: ["onRemove"] }] } });
|
|
1210
1229
|
|
|
1211
|
-
const CARD_PADDING_MAP = {
|
|
1212
|
-
none: '',
|
|
1213
|
-
sm: 'p-2',
|
|
1214
|
-
md: 'p-3',
|
|
1215
|
-
lg: 'p-5',
|
|
1216
|
-
};
|
|
1217
|
-
const CARD_SHADOW_MAP = {
|
|
1218
|
-
none: 'shadow-none',
|
|
1219
|
-
sm: 'shadow-sm',
|
|
1220
|
-
md: 'shadow-md',
|
|
1221
|
-
lg: 'shadow-lg',
|
|
1222
|
-
xl: 'shadow-xl',
|
|
1223
|
-
'2xl': 'shadow-2xl',
|
|
1224
|
-
};
|
|
1225
|
-
|
|
1226
1230
|
class ClxCardHeaderDirective {
|
|
1227
1231
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: ClxCardHeaderDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1228
1232
|
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.15", type: ClxCardHeaderDirective, isStandalone: true, selector: "[clxCardHeader]", ngImport: i0 });
|
|
@@ -1234,20 +1238,48 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
|
|
|
1234
1238
|
|
|
1235
1239
|
class ClxCardBodyDirective {
|
|
1236
1240
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: ClxCardBodyDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1237
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.15", type: ClxCardBodyDirective, isStandalone: true, selector: "[clxCardBody]",
|
|
1241
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.15", type: ClxCardBodyDirective, isStandalone: true, selector: "[clxCardBody]", providers: [
|
|
1242
|
+
{
|
|
1243
|
+
provide: CLX_CARD_DISABLED_CONTEXT,
|
|
1244
|
+
useFactory: () => inject(forwardRef(() => ClxCardComponent)).disabled,
|
|
1245
|
+
},
|
|
1246
|
+
], ngImport: i0 });
|
|
1238
1247
|
}
|
|
1239
1248
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: ClxCardBodyDirective, decorators: [{
|
|
1240
1249
|
type: Directive,
|
|
1241
|
-
args: [{
|
|
1250
|
+
args: [{
|
|
1251
|
+
selector: '[clxCardBody]',
|
|
1252
|
+
standalone: true,
|
|
1253
|
+
providers: [
|
|
1254
|
+
{
|
|
1255
|
+
provide: CLX_CARD_DISABLED_CONTEXT,
|
|
1256
|
+
useFactory: () => inject(forwardRef(() => ClxCardComponent)).disabled,
|
|
1257
|
+
},
|
|
1258
|
+
],
|
|
1259
|
+
}]
|
|
1242
1260
|
}] });
|
|
1243
1261
|
|
|
1244
1262
|
class ClxCardFooterDirective {
|
|
1245
1263
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: ClxCardFooterDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1246
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.15", type: ClxCardFooterDirective, isStandalone: true, selector: "[clxCardFooter]",
|
|
1264
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.15", type: ClxCardFooterDirective, isStandalone: true, selector: "[clxCardFooter]", providers: [
|
|
1265
|
+
{
|
|
1266
|
+
provide: CLX_CARD_DISABLED_CONTEXT,
|
|
1267
|
+
useFactory: () => inject(forwardRef(() => ClxCardComponent)).disabled,
|
|
1268
|
+
},
|
|
1269
|
+
], ngImport: i0 });
|
|
1247
1270
|
}
|
|
1248
1271
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: ClxCardFooterDirective, decorators: [{
|
|
1249
1272
|
type: Directive,
|
|
1250
|
-
args: [{
|
|
1273
|
+
args: [{
|
|
1274
|
+
selector: '[clxCardFooter]',
|
|
1275
|
+
standalone: true,
|
|
1276
|
+
providers: [
|
|
1277
|
+
{
|
|
1278
|
+
provide: CLX_CARD_DISABLED_CONTEXT,
|
|
1279
|
+
useFactory: () => inject(forwardRef(() => ClxCardComponent)).disabled,
|
|
1280
|
+
},
|
|
1281
|
+
],
|
|
1282
|
+
}]
|
|
1251
1283
|
}] });
|
|
1252
1284
|
|
|
1253
1285
|
class ClxCardComponent {
|
|
@@ -1257,6 +1289,7 @@ class ClxCardComponent {
|
|
|
1257
1289
|
padding = input('md', ...(ngDevMode ? [{ debugName: "padding" }] : /* istanbul ignore next */ []));
|
|
1258
1290
|
shadow = input(undefined, ...(ngDevMode ? [{ debugName: "shadow" }] : /* istanbul ignore next */ []));
|
|
1259
1291
|
hover = input(false, ...(ngDevMode ? [{ debugName: "hover" }] : /* istanbul ignore next */ []));
|
|
1292
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
1260
1293
|
_color = computed(() => this.color() ?? this._themeSvc.config().primaryColor, ...(ngDevMode ? [{ debugName: "_color" }] : /* istanbul ignore next */ []));
|
|
1261
1294
|
_headerSlot = contentChild(ClxCardHeaderDirective, ...(ngDevMode ? [{ debugName: "_headerSlot" }] : /* istanbul ignore next */ []));
|
|
1262
1295
|
_bodySlot = contentChild(ClxCardBodyDirective, ...(ngDevMode ? [{ debugName: "_bodySlot" }] : /* istanbul ignore next */ []));
|
|
@@ -1264,10 +1297,13 @@ class ClxCardComponent {
|
|
|
1264
1297
|
_hasHeader = computed(() => !!this._headerSlot(), ...(ngDevMode ? [{ debugName: "_hasHeader" }] : /* istanbul ignore next */ []));
|
|
1265
1298
|
_hasBody = computed(() => !!this._bodySlot(), ...(ngDevMode ? [{ debugName: "_hasBody" }] : /* istanbul ignore next */ []));
|
|
1266
1299
|
_hasFooter = computed(() => !!this._footerSlot(), ...(ngDevMode ? [{ debugName: "_hasFooter" }] : /* istanbul ignore next */ []));
|
|
1300
|
+
/** Blocks interaction only — applied to body/footer so the header (e.g. an enable/disable switch) stays clickable. */
|
|
1301
|
+
_disabledInteractionCls = computed(() => this.disabled() ? 'pointer-events-none' : '', ...(ngDevMode ? [{ debugName: "_disabledInteractionCls" }] : /* istanbul ignore next */ []));
|
|
1267
1302
|
_bodyClass = computed(() => {
|
|
1268
1303
|
const pad = this._hasBody() ? CARD_PADDING_MAP[this.padding()] : CARD_PADDING_MAP[this.padding()];
|
|
1269
|
-
return `clx-card-body flex-1 ${pad}
|
|
1304
|
+
return `clx-card-body flex-1 ${pad} ${this._disabledInteractionCls()}`.trim();
|
|
1270
1305
|
}, ...(ngDevMode ? [{ debugName: "_bodyClass" }] : /* istanbul ignore next */ []));
|
|
1306
|
+
_footerClass = computed(() => `clx-card-footer flex items-center gap-2 px-4 py-2 border-t border-clx-border-soft bg-clx-surface-2 ${this._disabledInteractionCls()}`.trim(), ...(ngDevMode ? [{ debugName: "_footerClass" }] : /* istanbul ignore next */ []));
|
|
1271
1307
|
_hostClass = computed(() => {
|
|
1272
1308
|
const variant = this.variant();
|
|
1273
1309
|
const t = resolveColor(this._color());
|
|
@@ -1286,10 +1322,11 @@ class ClxCardComponent {
|
|
|
1286
1322
|
const shadowClass = shadowInput !== undefined ? CARD_SHADOW_MAP[shadowInput] : '';
|
|
1287
1323
|
variantClass = `bg-clx-surface-2 border border-transparent ${shadowClass}`;
|
|
1288
1324
|
}
|
|
1289
|
-
|
|
1325
|
+
const disabledCls = this.disabled() ? 'opacity-50' : '';
|
|
1326
|
+
return `flex flex-col ${resolveContainerRadius(this._themeSvc.config().borderRadius)} overflow-hidden w-full ${variantClass} ${hover} ${disabledCls}`.trim();
|
|
1290
1327
|
}, ...(ngDevMode ? [{ debugName: "_hostClass" }] : /* istanbul ignore next */ []));
|
|
1291
1328
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: ClxCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1292
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.15", type: ClxCardComponent, isStandalone: true, selector: "clx-card", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, padding: { classPropertyName: "padding", publicName: "padding", isSignal: true, isRequired: false, transformFunction: null }, shadow: { classPropertyName: "shadow", publicName: "shadow", isSignal: true, isRequired: false, transformFunction: null }, hover: { classPropertyName: "hover", publicName: "hover", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_hostClass()" } }, queries: [{ propertyName: "_headerSlot", first: true, predicate: ClxCardHeaderDirective, descendants: true, isSignal: true }, { propertyName: "_bodySlot", first: true, predicate: ClxCardBodyDirective, descendants: true, isSignal: true }, { propertyName: "_footerSlot", first: true, predicate: ClxCardFooterDirective, descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
1329
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.15", type: ClxCardComponent, isStandalone: true, selector: "clx-card", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, padding: { classPropertyName: "padding", publicName: "padding", isSignal: true, isRequired: false, transformFunction: null }, shadow: { classPropertyName: "shadow", publicName: "shadow", isSignal: true, isRequired: false, transformFunction: null }, hover: { classPropertyName: "hover", publicName: "hover", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_hostClass()", "attr.aria-disabled": "disabled() || null" } }, queries: [{ propertyName: "_headerSlot", first: true, predicate: ClxCardHeaderDirective, descendants: true, isSignal: true }, { propertyName: "_bodySlot", first: true, predicate: ClxCardBodyDirective, descendants: true, isSignal: true }, { propertyName: "_footerSlot", first: true, predicate: ClxCardFooterDirective, descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
1293
1330
|
@if (_hasHeader()) {
|
|
1294
1331
|
<div class="clx-card-header flex items-center justify-between gap-3 px-4 py-3 border-b border-clx-border-soft">
|
|
1295
1332
|
<ng-content select="[clxCardHeader]" />
|
|
@@ -1304,7 +1341,7 @@ class ClxCardComponent {
|
|
|
1304
1341
|
</div>
|
|
1305
1342
|
|
|
1306
1343
|
@if (_hasFooter()) {
|
|
1307
|
-
<div class="
|
|
1344
|
+
<div [class]="_footerClass()">
|
|
1308
1345
|
<ng-content select="[clxCardFooter]" />
|
|
1309
1346
|
</div>
|
|
1310
1347
|
}
|
|
@@ -1318,7 +1355,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
|
|
|
1318
1355
|
imports: [],
|
|
1319
1356
|
encapsulation: ViewEncapsulation.None,
|
|
1320
1357
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1321
|
-
host: {
|
|
1358
|
+
host: {
|
|
1359
|
+
'[class]': '_hostClass()',
|
|
1360
|
+
'[attr.aria-disabled]': 'disabled() || null',
|
|
1361
|
+
},
|
|
1322
1362
|
template: `
|
|
1323
1363
|
@if (_hasHeader()) {
|
|
1324
1364
|
<div class="clx-card-header flex items-center justify-between gap-3 px-4 py-3 border-b border-clx-border-soft">
|
|
@@ -1334,13 +1374,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
|
|
|
1334
1374
|
</div>
|
|
1335
1375
|
|
|
1336
1376
|
@if (_hasFooter()) {
|
|
1337
|
-
<div class="
|
|
1377
|
+
<div [class]="_footerClass()">
|
|
1338
1378
|
<ng-content select="[clxCardFooter]" />
|
|
1339
1379
|
</div>
|
|
1340
1380
|
}
|
|
1341
1381
|
`,
|
|
1342
1382
|
}]
|
|
1343
|
-
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], padding: [{ type: i0.Input, args: [{ isSignal: true, alias: "padding", required: false }] }], shadow: [{ type: i0.Input, args: [{ isSignal: true, alias: "shadow", required: false }] }], hover: [{ type: i0.Input, args: [{ isSignal: true, alias: "hover", required: false }] }], _headerSlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ClxCardHeaderDirective), { isSignal: true }] }], _bodySlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ClxCardBodyDirective), { isSignal: true }] }], _footerSlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ClxCardFooterDirective), { isSignal: true }] }] } });
|
|
1383
|
+
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], padding: [{ type: i0.Input, args: [{ isSignal: true, alias: "padding", required: false }] }], shadow: [{ type: i0.Input, args: [{ isSignal: true, alias: "shadow", required: false }] }], hover: [{ type: i0.Input, args: [{ isSignal: true, alias: "hover", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], _headerSlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ClxCardHeaderDirective), { isSignal: true }] }], _bodySlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ClxCardBodyDirective), { isSignal: true }] }], _footerSlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ClxCardFooterDirective), { isSignal: true }] }] } });
|
|
1344
1384
|
|
|
1345
1385
|
const CLX_LIST_CONTEXT = new InjectionToken('CLX_LIST_CONTEXT');
|
|
1346
1386
|
// ── Variant maps ──────────────────────────────────────────────────────────────
|
|
@@ -2623,7 +2663,8 @@ class ClxInputComponent {
|
|
|
2623
2663
|
_value = signal('', ...(ngDevMode ? [{ debugName: "_value" }] : /* istanbul ignore next */ []));
|
|
2624
2664
|
_cvaDisabled = signal(false, ...(ngDevMode ? [{ debugName: "_cvaDisabled" }] : /* istanbul ignore next */ []));
|
|
2625
2665
|
_cvaConnected = false;
|
|
2626
|
-
|
|
2666
|
+
_cardDisabled = inject(CLX_CARD_DISABLED_CONTEXT, { optional: true });
|
|
2667
|
+
_disabled = computed(() => this._cvaDisabled() || this.disabled() || !!this._cardDisabled?.(), ...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
|
|
2627
2668
|
_valueEffect = effect(() => {
|
|
2628
2669
|
const v = this.value();
|
|
2629
2670
|
if (!this._cvaConnected)
|
|
@@ -2972,8 +3013,9 @@ class ClxTextareaComponent {
|
|
|
2972
3013
|
_value = signal('', ...(ngDevMode ? [{ debugName: "_value" }] : /* istanbul ignore next */ []));
|
|
2973
3014
|
_themeSvc = inject(ClxThemeService);
|
|
2974
3015
|
_cvaDisabled = signal(false, ...(ngDevMode ? [{ debugName: "_cvaDisabled" }] : /* istanbul ignore next */ []));
|
|
3016
|
+
_cardDisabled = inject(CLX_CARD_DISABLED_CONTEXT, { optional: true });
|
|
2975
3017
|
_cvaConnected = false;
|
|
2976
|
-
_disabled = computed(() => this._cvaDisabled() || this.disabled(), ...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
|
|
3018
|
+
_disabled = computed(() => this._cvaDisabled() || this.disabled() || !!this._cardDisabled?.(), ...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
|
|
2977
3019
|
_valueEffect = effect(() => {
|
|
2978
3020
|
const v = this.value();
|
|
2979
3021
|
if (!this._cvaConnected)
|
|
@@ -3239,8 +3281,9 @@ class ClxNumberComponent {
|
|
|
3239
3281
|
// ── Internal state ───────────────────────────────────────────────────────
|
|
3240
3282
|
_value = signal(0, ...(ngDevMode ? [{ debugName: "_value" }] : /* istanbul ignore next */ []));
|
|
3241
3283
|
_cvaDisabled = signal(false, ...(ngDevMode ? [{ debugName: "_cvaDisabled" }] : /* istanbul ignore next */ []));
|
|
3284
|
+
_cardDisabled = inject(CLX_CARD_DISABLED_CONTEXT, { optional: true });
|
|
3242
3285
|
_cvaConnected = false;
|
|
3243
|
-
_disabled = computed(() => this._cvaDisabled() || this.disabled(), ...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
|
|
3286
|
+
_disabled = computed(() => this._cvaDisabled() || this.disabled() || !!this._cardDisabled?.(), ...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
|
|
3244
3287
|
_valueEffect = effect(() => {
|
|
3245
3288
|
const v = this.value();
|
|
3246
3289
|
if (!this._cvaConnected)
|
|
@@ -3611,6 +3654,7 @@ class ClxSelectComponent {
|
|
|
3611
3654
|
_wasTouched = signal(false, ...(ngDevMode ? [{ debugName: "_wasTouched" }] : /* istanbul ignore next */ []));
|
|
3612
3655
|
_selectedVals = signal([], ...(ngDevMode ? [{ debugName: "_selectedVals" }] : /* istanbul ignore next */ []));
|
|
3613
3656
|
_cvaDisabled = signal(false, ...(ngDevMode ? [{ debugName: "_cvaDisabled" }] : /* istanbul ignore next */ []));
|
|
3657
|
+
_cardDisabled = inject(CLX_CARD_DISABLED_CONTEXT, { optional: true });
|
|
3614
3658
|
// ── DI ─────────────────────────────────────────────────────────────────────
|
|
3615
3659
|
_themeSvc = inject(ClxThemeService);
|
|
3616
3660
|
_ngControl = inject(NgControl, { optional: true, self: true });
|
|
@@ -3654,7 +3698,7 @@ class ClxSelectComponent {
|
|
|
3654
3698
|
{ originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom', offsetY: -4 },
|
|
3655
3699
|
];
|
|
3656
3700
|
// ── Computed ───────────────────────────────────────────────────────────────
|
|
3657
|
-
_disabled = computed(() => this._cvaDisabled() || this.disabled(), ...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
|
|
3701
|
+
_disabled = computed(() => this._cvaDisabled() || this.disabled() || !!this._cardDisabled?.(), ...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
|
|
3658
3702
|
_sizeConfig = computed(() => SELECT_SIZE_MAP[this._size()], ...(ngDevMode ? [{ debugName: "_sizeConfig" }] : /* istanbul ignore next */ []));
|
|
3659
3703
|
_hasValue = computed(() => this._selectedVals().length > 0, ...(ngDevMode ? [{ debugName: "_hasValue" }] : /* istanbul ignore next */ []));
|
|
3660
3704
|
_isInvalid = computed(() => this._wasTouched() && (this._ngControl?.control?.invalid ?? false), ...(ngDevMode ? [{ debugName: "_isInvalid" }] : /* istanbul ignore next */ []));
|
|
@@ -3821,147 +3865,147 @@ class ClxSelectComponent {
|
|
|
3821
3865
|
this._cvaDisabled.set(disabled);
|
|
3822
3866
|
}
|
|
3823
3867
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: ClxSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3824
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.15", type: ClxSelectComponent, isStandalone: true, selector: "clx-select", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, searchable: { classPropertyName: "searchable", publicName: "searchable", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, activeColor: { classPropertyName: "activeColor", publicName: "activeColor", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, async: { classPropertyName: "async", publicName: "async", isSignal: true, isRequired: false, transformFunction: null }, loadOptions: { classPropertyName: "loadOptions", publicName: "loadOptions", isSignal: true, isRequired: false, transformFunction: null }, debounceMs: { classPropertyName: "debounceMs", publicName: "debounceMs", isSignal: true, isRequired: false, transformFunction: null }, minChars: { classPropertyName: "minChars", publicName: "minChars", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "keydown.escape": "onEscape()" }, classAttribute: "flex flex-col gap-1.5 w-full" }, ngImport: i0, template: `
|
|
3825
|
-
@if (label()) {
|
|
3826
|
-
<span [id]="_labelId" [class]="_labelClass()">{{ label() }}</span>
|
|
3827
|
-
}
|
|
3828
|
-
|
|
3829
|
-
<!-- ── Trigger ─────────────────────────────────────────────────────────── -->
|
|
3830
|
-
<div
|
|
3831
|
-
#origin="cdkOverlayOrigin"
|
|
3832
|
-
cdkOverlayOrigin
|
|
3833
|
-
[class]="_triggerClass()"
|
|
3834
|
-
[attr.tabindex]="_disabled() ? null : '0'"
|
|
3835
|
-
role="combobox"
|
|
3836
|
-
[attr.aria-labelledby]="label() ? _labelId : null"
|
|
3837
|
-
[attr.aria-expanded]="_isOpen()"
|
|
3838
|
-
aria-haspopup="listbox"
|
|
3839
|
-
(click)="!_disabled() && _togglePanel()"
|
|
3840
|
-
(keydown)="_onTriggerKeydown($event)">
|
|
3841
|
-
|
|
3842
|
-
<!-- Multi mode: tag chips -->
|
|
3843
|
-
@if (multiple()) {
|
|
3844
|
-
<div [class]="_tagContainerClass()">
|
|
3845
|
-
@for (opt of _selectedOptions(); track opt.value) {
|
|
3846
|
-
<span
|
|
3847
|
-
clx-tag
|
|
3848
|
-
variant="soft"
|
|
3849
|
-
[color]="_activeColor()"
|
|
3850
|
-
[size]="_sizeConfig().tagSize"
|
|
3851
|
-
(onRemove)="_deselect(opt.value)">
|
|
3852
|
-
{{ opt.label }}
|
|
3853
|
-
</span>
|
|
3854
|
-
}
|
|
3855
|
-
@if (!_selectedOptions().length) {
|
|
3856
|
-
<span [class]="_placeholderClass()">{{ placeholder() }}</span>
|
|
3857
|
-
}
|
|
3858
|
-
</div>
|
|
3859
|
-
|
|
3860
|
-
<!-- Single mode: display value -->
|
|
3861
|
-
} @else {
|
|
3862
|
-
<span [class]="_singleDisplayClass()" [style.font-family]="_displayFontFamily()">{{ _displayValue() }}</span>
|
|
3863
|
-
}
|
|
3864
|
-
|
|
3865
|
-
<!-- Right controls: clear + chevron -->
|
|
3866
|
-
<div class="absolute right-2 top-1/2 -translate-y-1/2 flex items-center gap-0.5">
|
|
3867
|
-
@if (_hasValue() && !_disabled() && multiple()) {
|
|
3868
|
-
<button
|
|
3869
|
-
clx-button
|
|
3870
|
-
type="button"
|
|
3871
|
-
variant="ghost"
|
|
3872
|
-
[color]="_activeColor()"
|
|
3873
|
-
shape="circle"
|
|
3874
|
-
[size]="_sizeConfig().btnSize"
|
|
3875
|
-
icon="close"
|
|
3876
|
-
[iconOnly]="true"
|
|
3877
|
-
(mousedown)="$event.preventDefault()"
|
|
3878
|
-
(click)="$event.stopPropagation(); _clearAll()">
|
|
3879
|
-
</button>
|
|
3880
|
-
}
|
|
3881
|
-
<button
|
|
3882
|
-
clx-button
|
|
3883
|
-
type="button"
|
|
3884
|
-
variant="ghost"
|
|
3885
|
-
[color]="_activeColor()"
|
|
3886
|
-
shape="circle"
|
|
3887
|
-
[size]="_sizeConfig().btnSize"
|
|
3888
|
-
icon="keyboard_arrow_down"
|
|
3889
|
-
[iconOnly]="true"
|
|
3890
|
-
[class]="_chevronBtnClass()"
|
|
3891
|
-
(mousedown)="$event.preventDefault()">
|
|
3892
|
-
</button>
|
|
3893
|
-
</div>
|
|
3894
|
-
</div>
|
|
3895
|
-
|
|
3896
|
-
<!-- ── Overlay panel ───────────────────────────────────────────────────── -->
|
|
3897
|
-
<ng-template
|
|
3898
|
-
cdkConnectedOverlay
|
|
3899
|
-
[cdkConnectedOverlayOrigin]="origin"
|
|
3900
|
-
[cdkConnectedOverlayOpen]="_isOpen()"
|
|
3901
|
-
[cdkConnectedOverlayPositions]="_positions"
|
|
3902
|
-
[cdkConnectedOverlayScrollStrategy]="_scrollStrategy"
|
|
3903
|
-
[cdkConnectedOverlayWidth]="_overlayWidth()"
|
|
3904
|
-
[cdkConnectedOverlayPush]="true"
|
|
3905
|
-
(overlayOutsideClick)="_closePanel()"
|
|
3906
|
-
(overlayKeydown)="_onOverlayKeydown($event)">
|
|
3907
|
-
|
|
3908
|
-
<div [class]="_panelClass()" role="listbox">
|
|
3909
|
-
|
|
3910
|
-
<!-- Search / Autocomplete input -->
|
|
3911
|
-
@if (searchable() || async()) {
|
|
3912
|
-
<div class="p-2 border-b border-clx-border-soft" (click)="$event.stopPropagation()">
|
|
3913
|
-
<clx-input
|
|
3914
|
-
[formControl]="_searchControl"
|
|
3915
|
-
[placeholder]="async() ? 'Buscar...' : searchPlaceholder()"
|
|
3916
|
-
[color]="_activeColor()"
|
|
3917
|
-
[suffixIcon]="async() && _asyncLoading() ? '' : 'search'"
|
|
3918
|
-
size="sm">
|
|
3919
|
-
</clx-input>
|
|
3920
|
-
</div>
|
|
3921
|
-
}
|
|
3922
|
-
|
|
3923
|
-
<!-- Options list -->
|
|
3924
|
-
<div class="overflow-y-auto max-h-60 p-1 space-y-0.5">
|
|
3925
|
-
@if (async() && _asyncLoading()) {
|
|
3926
|
-
<div class="flex items-center justify-center py-6 gap-2 text-sm text-clx-text-subtle">
|
|
3927
|
-
<clx-spinner size="sm" [color]="_activeColor()" />
|
|
3928
|
-
Buscando...
|
|
3929
|
-
</div>
|
|
3930
|
-
} @else if (_showAsyncPlaceholder()) {
|
|
3931
|
-
<div class="px-3 py-4 text-center text-sm text-clx-text-subtle">
|
|
3932
|
-
Escribe {{ minChars() === 1 ? 'al menos 1 carácter' : 'al menos ' + minChars() + ' caracteres' }}
|
|
3933
|
-
</div>
|
|
3934
|
-
} @else if (_filteredOptions().length === 0) {
|
|
3935
|
-
<div class="px-3 py-4 text-center text-sm text-clx-text-subtle">Sin resultados</div>
|
|
3936
|
-
} @else {
|
|
3937
|
-
@for (opt of _filteredOptions(); track opt.value) {
|
|
3938
|
-
<button
|
|
3939
|
-
type="button"
|
|
3940
|
-
[class]="_optionClass(opt)"
|
|
3941
|
-
[disabled]="opt.disabled ?? false"
|
|
3942
|
-
(mousedown)="$event.preventDefault()"
|
|
3943
|
-
(click)="_selectOption(opt)">
|
|
3944
|
-
<span class="flex-1 text-left truncate" [style.font-family]="opt.previewFontFamily ?? null">{{ opt.label }}</span>
|
|
3945
|
-
@if (_isSelected(opt.value)) {
|
|
3946
|
-
<span clx-icon name="check" size="xs" class="shrink-0"></span>
|
|
3947
|
-
}
|
|
3948
|
-
</button>
|
|
3949
|
-
}
|
|
3950
|
-
}
|
|
3951
|
-
</div>
|
|
3952
|
-
|
|
3953
|
-
</div>
|
|
3954
|
-
</ng-template>
|
|
3955
|
-
|
|
3956
|
-
<!-- ── Bottom message ─────────────────────────────────────────────────── -->
|
|
3957
|
-
@if (_isInvalid()) {
|
|
3958
|
-
<p class="text-xs text-red-500 flex items-center gap-1">
|
|
3959
|
-
<span clx-icon name="error" size="xs"></span>
|
|
3960
|
-
{{ errorMessage() }}
|
|
3961
|
-
</p>
|
|
3962
|
-
} @else if (hint()) {
|
|
3963
|
-
<p [class]="_hintClass()">{{ hint() }}</p>
|
|
3964
|
-
}
|
|
3868
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.15", type: ClxSelectComponent, isStandalone: true, selector: "clx-select", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, searchable: { classPropertyName: "searchable", publicName: "searchable", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, activeColor: { classPropertyName: "activeColor", publicName: "activeColor", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, async: { classPropertyName: "async", publicName: "async", isSignal: true, isRequired: false, transformFunction: null }, loadOptions: { classPropertyName: "loadOptions", publicName: "loadOptions", isSignal: true, isRequired: false, transformFunction: null }, debounceMs: { classPropertyName: "debounceMs", publicName: "debounceMs", isSignal: true, isRequired: false, transformFunction: null }, minChars: { classPropertyName: "minChars", publicName: "minChars", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "keydown.escape": "onEscape()" }, classAttribute: "flex flex-col gap-1.5 w-full" }, ngImport: i0, template: `
|
|
3869
|
+
@if (label()) {
|
|
3870
|
+
<span [id]="_labelId" [class]="_labelClass()">{{ label() }}</span>
|
|
3871
|
+
}
|
|
3872
|
+
|
|
3873
|
+
<!-- ── Trigger ─────────────────────────────────────────────────────────── -->
|
|
3874
|
+
<div
|
|
3875
|
+
#origin="cdkOverlayOrigin"
|
|
3876
|
+
cdkOverlayOrigin
|
|
3877
|
+
[class]="_triggerClass()"
|
|
3878
|
+
[attr.tabindex]="_disabled() ? null : '0'"
|
|
3879
|
+
role="combobox"
|
|
3880
|
+
[attr.aria-labelledby]="label() ? _labelId : null"
|
|
3881
|
+
[attr.aria-expanded]="_isOpen()"
|
|
3882
|
+
aria-haspopup="listbox"
|
|
3883
|
+
(click)="!_disabled() && _togglePanel()"
|
|
3884
|
+
(keydown)="_onTriggerKeydown($event)">
|
|
3885
|
+
|
|
3886
|
+
<!-- Multi mode: tag chips -->
|
|
3887
|
+
@if (multiple()) {
|
|
3888
|
+
<div [class]="_tagContainerClass()">
|
|
3889
|
+
@for (opt of _selectedOptions(); track opt.value) {
|
|
3890
|
+
<span
|
|
3891
|
+
clx-tag
|
|
3892
|
+
variant="soft"
|
|
3893
|
+
[color]="_activeColor()"
|
|
3894
|
+
[size]="_sizeConfig().tagSize"
|
|
3895
|
+
(onRemove)="_deselect(opt.value)">
|
|
3896
|
+
{{ opt.label }}
|
|
3897
|
+
</span>
|
|
3898
|
+
}
|
|
3899
|
+
@if (!_selectedOptions().length) {
|
|
3900
|
+
<span [class]="_placeholderClass()">{{ placeholder() }}</span>
|
|
3901
|
+
}
|
|
3902
|
+
</div>
|
|
3903
|
+
|
|
3904
|
+
<!-- Single mode: display value -->
|
|
3905
|
+
} @else {
|
|
3906
|
+
<span [class]="_singleDisplayClass()" [style.font-family]="_displayFontFamily()">{{ _displayValue() }}</span>
|
|
3907
|
+
}
|
|
3908
|
+
|
|
3909
|
+
<!-- Right controls: clear + chevron -->
|
|
3910
|
+
<div class="absolute right-2 top-1/2 -translate-y-1/2 flex items-center gap-0.5">
|
|
3911
|
+
@if (_hasValue() && !_disabled() && multiple()) {
|
|
3912
|
+
<button
|
|
3913
|
+
clx-button
|
|
3914
|
+
type="button"
|
|
3915
|
+
variant="ghost"
|
|
3916
|
+
[color]="_activeColor()"
|
|
3917
|
+
shape="circle"
|
|
3918
|
+
[size]="_sizeConfig().btnSize"
|
|
3919
|
+
icon="close"
|
|
3920
|
+
[iconOnly]="true"
|
|
3921
|
+
(mousedown)="$event.preventDefault()"
|
|
3922
|
+
(click)="$event.stopPropagation(); _clearAll()">
|
|
3923
|
+
</button>
|
|
3924
|
+
}
|
|
3925
|
+
<button
|
|
3926
|
+
clx-button
|
|
3927
|
+
type="button"
|
|
3928
|
+
variant="ghost"
|
|
3929
|
+
[color]="_activeColor()"
|
|
3930
|
+
shape="circle"
|
|
3931
|
+
[size]="_sizeConfig().btnSize"
|
|
3932
|
+
icon="keyboard_arrow_down"
|
|
3933
|
+
[iconOnly]="true"
|
|
3934
|
+
[class]="_chevronBtnClass()"
|
|
3935
|
+
(mousedown)="$event.preventDefault()">
|
|
3936
|
+
</button>
|
|
3937
|
+
</div>
|
|
3938
|
+
</div>
|
|
3939
|
+
|
|
3940
|
+
<!-- ── Overlay panel ───────────────────────────────────────────────────── -->
|
|
3941
|
+
<ng-template
|
|
3942
|
+
cdkConnectedOverlay
|
|
3943
|
+
[cdkConnectedOverlayOrigin]="origin"
|
|
3944
|
+
[cdkConnectedOverlayOpen]="_isOpen()"
|
|
3945
|
+
[cdkConnectedOverlayPositions]="_positions"
|
|
3946
|
+
[cdkConnectedOverlayScrollStrategy]="_scrollStrategy"
|
|
3947
|
+
[cdkConnectedOverlayWidth]="_overlayWidth()"
|
|
3948
|
+
[cdkConnectedOverlayPush]="true"
|
|
3949
|
+
(overlayOutsideClick)="_closePanel()"
|
|
3950
|
+
(overlayKeydown)="_onOverlayKeydown($event)">
|
|
3951
|
+
|
|
3952
|
+
<div [class]="_panelClass()" role="listbox">
|
|
3953
|
+
|
|
3954
|
+
<!-- Search / Autocomplete input -->
|
|
3955
|
+
@if (searchable() || async()) {
|
|
3956
|
+
<div class="p-2 border-b border-clx-border-soft" (click)="$event.stopPropagation()">
|
|
3957
|
+
<clx-input
|
|
3958
|
+
[formControl]="_searchControl"
|
|
3959
|
+
[placeholder]="async() ? 'Buscar...' : searchPlaceholder()"
|
|
3960
|
+
[color]="_activeColor()"
|
|
3961
|
+
[suffixIcon]="async() && _asyncLoading() ? '' : 'search'"
|
|
3962
|
+
size="sm">
|
|
3963
|
+
</clx-input>
|
|
3964
|
+
</div>
|
|
3965
|
+
}
|
|
3966
|
+
|
|
3967
|
+
<!-- Options list -->
|
|
3968
|
+
<div class="overflow-y-auto max-h-60 p-1 space-y-0.5">
|
|
3969
|
+
@if (async() && _asyncLoading()) {
|
|
3970
|
+
<div class="flex items-center justify-center py-6 gap-2 text-sm text-clx-text-subtle">
|
|
3971
|
+
<clx-spinner size="sm" [color]="_activeColor()" />
|
|
3972
|
+
Buscando...
|
|
3973
|
+
</div>
|
|
3974
|
+
} @else if (_showAsyncPlaceholder()) {
|
|
3975
|
+
<div class="px-3 py-4 text-center text-sm text-clx-text-subtle">
|
|
3976
|
+
Escribe {{ minChars() === 1 ? 'al menos 1 carácter' : 'al menos ' + minChars() + ' caracteres' }}
|
|
3977
|
+
</div>
|
|
3978
|
+
} @else if (_filteredOptions().length === 0) {
|
|
3979
|
+
<div class="px-3 py-4 text-center text-sm text-clx-text-subtle">Sin resultados</div>
|
|
3980
|
+
} @else {
|
|
3981
|
+
@for (opt of _filteredOptions(); track opt.value) {
|
|
3982
|
+
<button
|
|
3983
|
+
type="button"
|
|
3984
|
+
[class]="_optionClass(opt)"
|
|
3985
|
+
[disabled]="opt.disabled ?? false"
|
|
3986
|
+
(mousedown)="$event.preventDefault()"
|
|
3987
|
+
(click)="_selectOption(opt)">
|
|
3988
|
+
<span class="flex-1 text-left truncate" [style.font-family]="opt.previewFontFamily ?? null">{{ opt.label }}</span>
|
|
3989
|
+
@if (_isSelected(opt.value)) {
|
|
3990
|
+
<span clx-icon name="check" size="xs" class="shrink-0"></span>
|
|
3991
|
+
}
|
|
3992
|
+
</button>
|
|
3993
|
+
}
|
|
3994
|
+
}
|
|
3995
|
+
</div>
|
|
3996
|
+
|
|
3997
|
+
</div>
|
|
3998
|
+
</ng-template>
|
|
3999
|
+
|
|
4000
|
+
<!-- ── Bottom message ─────────────────────────────────────────────────── -->
|
|
4001
|
+
@if (_isInvalid()) {
|
|
4002
|
+
<p class="text-xs text-red-500 flex items-center gap-1">
|
|
4003
|
+
<span clx-icon name="error" size="xs"></span>
|
|
4004
|
+
{{ errorMessage() }}
|
|
4005
|
+
</p>
|
|
4006
|
+
} @else if (hint()) {
|
|
4007
|
+
<p [class]="_hintClass()">{{ hint() }}</p>
|
|
4008
|
+
}
|
|
3965
4009
|
`, isInline: true, dependencies: [{ kind: "ngmodule", type: OverlayModule }, { kind: "directive", type: i1.CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "directive", type: i1.CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: ClxTagComponent, selector: "span[clx-tag]", inputs: ["variant", "color", "size", "shape"], outputs: ["onRemove"] }, { kind: "component", type: ClxIconComponent, selector: "span[clx-icon]", inputs: ["name", "size", "color", "fill"] }, { kind: "component", type: ClxButtonComponent, selector: "button[clx-button], a[clx-button]", inputs: ["variant", "color", "size", "shape", "loading", "disabled", "block", "icon", "iconPosition", "iconOnly", "badge", "badgeColor"] }, { kind: "component", type: ClxInputComponent, selector: "clx-input", inputs: ["label", "placeholder", "type", "color", "hint", "prefixIcon", "suffixIcon", "prefixText", "suffixText", "status", "statusMessage", "size", "value", "disabled", "autocomplete"] }, { kind: "component", type: ClxSpinnerComponent, selector: "clx-spinner", inputs: ["size", "color", "variant"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
3966
4010
|
}
|
|
3967
4011
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: ClxSelectComponent, decorators: [{
|
|
@@ -3970,147 +4014,147 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
|
|
|
3970
4014
|
selector: 'clx-select',
|
|
3971
4015
|
standalone: true,
|
|
3972
4016
|
imports: [OverlayModule, ReactiveFormsModule, ClxTagComponent, ClxIconComponent, ClxButtonComponent, ClxInputComponent, ClxSpinnerComponent],
|
|
3973
|
-
template: `
|
|
3974
|
-
@if (label()) {
|
|
3975
|
-
<span [id]="_labelId" [class]="_labelClass()">{{ label() }}</span>
|
|
3976
|
-
}
|
|
3977
|
-
|
|
3978
|
-
<!-- ── Trigger ─────────────────────────────────────────────────────────── -->
|
|
3979
|
-
<div
|
|
3980
|
-
#origin="cdkOverlayOrigin"
|
|
3981
|
-
cdkOverlayOrigin
|
|
3982
|
-
[class]="_triggerClass()"
|
|
3983
|
-
[attr.tabindex]="_disabled() ? null : '0'"
|
|
3984
|
-
role="combobox"
|
|
3985
|
-
[attr.aria-labelledby]="label() ? _labelId : null"
|
|
3986
|
-
[attr.aria-expanded]="_isOpen()"
|
|
3987
|
-
aria-haspopup="listbox"
|
|
3988
|
-
(click)="!_disabled() && _togglePanel()"
|
|
3989
|
-
(keydown)="_onTriggerKeydown($event)">
|
|
3990
|
-
|
|
3991
|
-
<!-- Multi mode: tag chips -->
|
|
3992
|
-
@if (multiple()) {
|
|
3993
|
-
<div [class]="_tagContainerClass()">
|
|
3994
|
-
@for (opt of _selectedOptions(); track opt.value) {
|
|
3995
|
-
<span
|
|
3996
|
-
clx-tag
|
|
3997
|
-
variant="soft"
|
|
3998
|
-
[color]="_activeColor()"
|
|
3999
|
-
[size]="_sizeConfig().tagSize"
|
|
4000
|
-
(onRemove)="_deselect(opt.value)">
|
|
4001
|
-
{{ opt.label }}
|
|
4002
|
-
</span>
|
|
4003
|
-
}
|
|
4004
|
-
@if (!_selectedOptions().length) {
|
|
4005
|
-
<span [class]="_placeholderClass()">{{ placeholder() }}</span>
|
|
4006
|
-
}
|
|
4007
|
-
</div>
|
|
4008
|
-
|
|
4009
|
-
<!-- Single mode: display value -->
|
|
4010
|
-
} @else {
|
|
4011
|
-
<span [class]="_singleDisplayClass()" [style.font-family]="_displayFontFamily()">{{ _displayValue() }}</span>
|
|
4012
|
-
}
|
|
4013
|
-
|
|
4014
|
-
<!-- Right controls: clear + chevron -->
|
|
4015
|
-
<div class="absolute right-2 top-1/2 -translate-y-1/2 flex items-center gap-0.5">
|
|
4016
|
-
@if (_hasValue() && !_disabled() && multiple()) {
|
|
4017
|
-
<button
|
|
4018
|
-
clx-button
|
|
4019
|
-
type="button"
|
|
4020
|
-
variant="ghost"
|
|
4021
|
-
[color]="_activeColor()"
|
|
4022
|
-
shape="circle"
|
|
4023
|
-
[size]="_sizeConfig().btnSize"
|
|
4024
|
-
icon="close"
|
|
4025
|
-
[iconOnly]="true"
|
|
4026
|
-
(mousedown)="$event.preventDefault()"
|
|
4027
|
-
(click)="$event.stopPropagation(); _clearAll()">
|
|
4028
|
-
</button>
|
|
4029
|
-
}
|
|
4030
|
-
<button
|
|
4031
|
-
clx-button
|
|
4032
|
-
type="button"
|
|
4033
|
-
variant="ghost"
|
|
4034
|
-
[color]="_activeColor()"
|
|
4035
|
-
shape="circle"
|
|
4036
|
-
[size]="_sizeConfig().btnSize"
|
|
4037
|
-
icon="keyboard_arrow_down"
|
|
4038
|
-
[iconOnly]="true"
|
|
4039
|
-
[class]="_chevronBtnClass()"
|
|
4040
|
-
(mousedown)="$event.preventDefault()">
|
|
4041
|
-
</button>
|
|
4042
|
-
</div>
|
|
4043
|
-
</div>
|
|
4044
|
-
|
|
4045
|
-
<!-- ── Overlay panel ───────────────────────────────────────────────────── -->
|
|
4046
|
-
<ng-template
|
|
4047
|
-
cdkConnectedOverlay
|
|
4048
|
-
[cdkConnectedOverlayOrigin]="origin"
|
|
4049
|
-
[cdkConnectedOverlayOpen]="_isOpen()"
|
|
4050
|
-
[cdkConnectedOverlayPositions]="_positions"
|
|
4051
|
-
[cdkConnectedOverlayScrollStrategy]="_scrollStrategy"
|
|
4052
|
-
[cdkConnectedOverlayWidth]="_overlayWidth()"
|
|
4053
|
-
[cdkConnectedOverlayPush]="true"
|
|
4054
|
-
(overlayOutsideClick)="_closePanel()"
|
|
4055
|
-
(overlayKeydown)="_onOverlayKeydown($event)">
|
|
4056
|
-
|
|
4057
|
-
<div [class]="_panelClass()" role="listbox">
|
|
4058
|
-
|
|
4059
|
-
<!-- Search / Autocomplete input -->
|
|
4060
|
-
@if (searchable() || async()) {
|
|
4061
|
-
<div class="p-2 border-b border-clx-border-soft" (click)="$event.stopPropagation()">
|
|
4062
|
-
<clx-input
|
|
4063
|
-
[formControl]="_searchControl"
|
|
4064
|
-
[placeholder]="async() ? 'Buscar...' : searchPlaceholder()"
|
|
4065
|
-
[color]="_activeColor()"
|
|
4066
|
-
[suffixIcon]="async() && _asyncLoading() ? '' : 'search'"
|
|
4067
|
-
size="sm">
|
|
4068
|
-
</clx-input>
|
|
4069
|
-
</div>
|
|
4070
|
-
}
|
|
4071
|
-
|
|
4072
|
-
<!-- Options list -->
|
|
4073
|
-
<div class="overflow-y-auto max-h-60 p-1 space-y-0.5">
|
|
4074
|
-
@if (async() && _asyncLoading()) {
|
|
4075
|
-
<div class="flex items-center justify-center py-6 gap-2 text-sm text-clx-text-subtle">
|
|
4076
|
-
<clx-spinner size="sm" [color]="_activeColor()" />
|
|
4077
|
-
Buscando...
|
|
4078
|
-
</div>
|
|
4079
|
-
} @else if (_showAsyncPlaceholder()) {
|
|
4080
|
-
<div class="px-3 py-4 text-center text-sm text-clx-text-subtle">
|
|
4081
|
-
Escribe {{ minChars() === 1 ? 'al menos 1 carácter' : 'al menos ' + minChars() + ' caracteres' }}
|
|
4082
|
-
</div>
|
|
4083
|
-
} @else if (_filteredOptions().length === 0) {
|
|
4084
|
-
<div class="px-3 py-4 text-center text-sm text-clx-text-subtle">Sin resultados</div>
|
|
4085
|
-
} @else {
|
|
4086
|
-
@for (opt of _filteredOptions(); track opt.value) {
|
|
4087
|
-
<button
|
|
4088
|
-
type="button"
|
|
4089
|
-
[class]="_optionClass(opt)"
|
|
4090
|
-
[disabled]="opt.disabled ?? false"
|
|
4091
|
-
(mousedown)="$event.preventDefault()"
|
|
4092
|
-
(click)="_selectOption(opt)">
|
|
4093
|
-
<span class="flex-1 text-left truncate" [style.font-family]="opt.previewFontFamily ?? null">{{ opt.label }}</span>
|
|
4094
|
-
@if (_isSelected(opt.value)) {
|
|
4095
|
-
<span clx-icon name="check" size="xs" class="shrink-0"></span>
|
|
4096
|
-
}
|
|
4097
|
-
</button>
|
|
4098
|
-
}
|
|
4099
|
-
}
|
|
4100
|
-
</div>
|
|
4101
|
-
|
|
4102
|
-
</div>
|
|
4103
|
-
</ng-template>
|
|
4104
|
-
|
|
4105
|
-
<!-- ── Bottom message ─────────────────────────────────────────────────── -->
|
|
4106
|
-
@if (_isInvalid()) {
|
|
4107
|
-
<p class="text-xs text-red-500 flex items-center gap-1">
|
|
4108
|
-
<span clx-icon name="error" size="xs"></span>
|
|
4109
|
-
{{ errorMessage() }}
|
|
4110
|
-
</p>
|
|
4111
|
-
} @else if (hint()) {
|
|
4112
|
-
<p [class]="_hintClass()">{{ hint() }}</p>
|
|
4113
|
-
}
|
|
4017
|
+
template: `
|
|
4018
|
+
@if (label()) {
|
|
4019
|
+
<span [id]="_labelId" [class]="_labelClass()">{{ label() }}</span>
|
|
4020
|
+
}
|
|
4021
|
+
|
|
4022
|
+
<!-- ── Trigger ─────────────────────────────────────────────────────────── -->
|
|
4023
|
+
<div
|
|
4024
|
+
#origin="cdkOverlayOrigin"
|
|
4025
|
+
cdkOverlayOrigin
|
|
4026
|
+
[class]="_triggerClass()"
|
|
4027
|
+
[attr.tabindex]="_disabled() ? null : '0'"
|
|
4028
|
+
role="combobox"
|
|
4029
|
+
[attr.aria-labelledby]="label() ? _labelId : null"
|
|
4030
|
+
[attr.aria-expanded]="_isOpen()"
|
|
4031
|
+
aria-haspopup="listbox"
|
|
4032
|
+
(click)="!_disabled() && _togglePanel()"
|
|
4033
|
+
(keydown)="_onTriggerKeydown($event)">
|
|
4034
|
+
|
|
4035
|
+
<!-- Multi mode: tag chips -->
|
|
4036
|
+
@if (multiple()) {
|
|
4037
|
+
<div [class]="_tagContainerClass()">
|
|
4038
|
+
@for (opt of _selectedOptions(); track opt.value) {
|
|
4039
|
+
<span
|
|
4040
|
+
clx-tag
|
|
4041
|
+
variant="soft"
|
|
4042
|
+
[color]="_activeColor()"
|
|
4043
|
+
[size]="_sizeConfig().tagSize"
|
|
4044
|
+
(onRemove)="_deselect(opt.value)">
|
|
4045
|
+
{{ opt.label }}
|
|
4046
|
+
</span>
|
|
4047
|
+
}
|
|
4048
|
+
@if (!_selectedOptions().length) {
|
|
4049
|
+
<span [class]="_placeholderClass()">{{ placeholder() }}</span>
|
|
4050
|
+
}
|
|
4051
|
+
</div>
|
|
4052
|
+
|
|
4053
|
+
<!-- Single mode: display value -->
|
|
4054
|
+
} @else {
|
|
4055
|
+
<span [class]="_singleDisplayClass()" [style.font-family]="_displayFontFamily()">{{ _displayValue() }}</span>
|
|
4056
|
+
}
|
|
4057
|
+
|
|
4058
|
+
<!-- Right controls: clear + chevron -->
|
|
4059
|
+
<div class="absolute right-2 top-1/2 -translate-y-1/2 flex items-center gap-0.5">
|
|
4060
|
+
@if (_hasValue() && !_disabled() && multiple()) {
|
|
4061
|
+
<button
|
|
4062
|
+
clx-button
|
|
4063
|
+
type="button"
|
|
4064
|
+
variant="ghost"
|
|
4065
|
+
[color]="_activeColor()"
|
|
4066
|
+
shape="circle"
|
|
4067
|
+
[size]="_sizeConfig().btnSize"
|
|
4068
|
+
icon="close"
|
|
4069
|
+
[iconOnly]="true"
|
|
4070
|
+
(mousedown)="$event.preventDefault()"
|
|
4071
|
+
(click)="$event.stopPropagation(); _clearAll()">
|
|
4072
|
+
</button>
|
|
4073
|
+
}
|
|
4074
|
+
<button
|
|
4075
|
+
clx-button
|
|
4076
|
+
type="button"
|
|
4077
|
+
variant="ghost"
|
|
4078
|
+
[color]="_activeColor()"
|
|
4079
|
+
shape="circle"
|
|
4080
|
+
[size]="_sizeConfig().btnSize"
|
|
4081
|
+
icon="keyboard_arrow_down"
|
|
4082
|
+
[iconOnly]="true"
|
|
4083
|
+
[class]="_chevronBtnClass()"
|
|
4084
|
+
(mousedown)="$event.preventDefault()">
|
|
4085
|
+
</button>
|
|
4086
|
+
</div>
|
|
4087
|
+
</div>
|
|
4088
|
+
|
|
4089
|
+
<!-- ── Overlay panel ───────────────────────────────────────────────────── -->
|
|
4090
|
+
<ng-template
|
|
4091
|
+
cdkConnectedOverlay
|
|
4092
|
+
[cdkConnectedOverlayOrigin]="origin"
|
|
4093
|
+
[cdkConnectedOverlayOpen]="_isOpen()"
|
|
4094
|
+
[cdkConnectedOverlayPositions]="_positions"
|
|
4095
|
+
[cdkConnectedOverlayScrollStrategy]="_scrollStrategy"
|
|
4096
|
+
[cdkConnectedOverlayWidth]="_overlayWidth()"
|
|
4097
|
+
[cdkConnectedOverlayPush]="true"
|
|
4098
|
+
(overlayOutsideClick)="_closePanel()"
|
|
4099
|
+
(overlayKeydown)="_onOverlayKeydown($event)">
|
|
4100
|
+
|
|
4101
|
+
<div [class]="_panelClass()" role="listbox">
|
|
4102
|
+
|
|
4103
|
+
<!-- Search / Autocomplete input -->
|
|
4104
|
+
@if (searchable() || async()) {
|
|
4105
|
+
<div class="p-2 border-b border-clx-border-soft" (click)="$event.stopPropagation()">
|
|
4106
|
+
<clx-input
|
|
4107
|
+
[formControl]="_searchControl"
|
|
4108
|
+
[placeholder]="async() ? 'Buscar...' : searchPlaceholder()"
|
|
4109
|
+
[color]="_activeColor()"
|
|
4110
|
+
[suffixIcon]="async() && _asyncLoading() ? '' : 'search'"
|
|
4111
|
+
size="sm">
|
|
4112
|
+
</clx-input>
|
|
4113
|
+
</div>
|
|
4114
|
+
}
|
|
4115
|
+
|
|
4116
|
+
<!-- Options list -->
|
|
4117
|
+
<div class="overflow-y-auto max-h-60 p-1 space-y-0.5">
|
|
4118
|
+
@if (async() && _asyncLoading()) {
|
|
4119
|
+
<div class="flex items-center justify-center py-6 gap-2 text-sm text-clx-text-subtle">
|
|
4120
|
+
<clx-spinner size="sm" [color]="_activeColor()" />
|
|
4121
|
+
Buscando...
|
|
4122
|
+
</div>
|
|
4123
|
+
} @else if (_showAsyncPlaceholder()) {
|
|
4124
|
+
<div class="px-3 py-4 text-center text-sm text-clx-text-subtle">
|
|
4125
|
+
Escribe {{ minChars() === 1 ? 'al menos 1 carácter' : 'al menos ' + minChars() + ' caracteres' }}
|
|
4126
|
+
</div>
|
|
4127
|
+
} @else if (_filteredOptions().length === 0) {
|
|
4128
|
+
<div class="px-3 py-4 text-center text-sm text-clx-text-subtle">Sin resultados</div>
|
|
4129
|
+
} @else {
|
|
4130
|
+
@for (opt of _filteredOptions(); track opt.value) {
|
|
4131
|
+
<button
|
|
4132
|
+
type="button"
|
|
4133
|
+
[class]="_optionClass(opt)"
|
|
4134
|
+
[disabled]="opt.disabled ?? false"
|
|
4135
|
+
(mousedown)="$event.preventDefault()"
|
|
4136
|
+
(click)="_selectOption(opt)">
|
|
4137
|
+
<span class="flex-1 text-left truncate" [style.font-family]="opt.previewFontFamily ?? null">{{ opt.label }}</span>
|
|
4138
|
+
@if (_isSelected(opt.value)) {
|
|
4139
|
+
<span clx-icon name="check" size="xs" class="shrink-0"></span>
|
|
4140
|
+
}
|
|
4141
|
+
</button>
|
|
4142
|
+
}
|
|
4143
|
+
}
|
|
4144
|
+
</div>
|
|
4145
|
+
|
|
4146
|
+
</div>
|
|
4147
|
+
</ng-template>
|
|
4148
|
+
|
|
4149
|
+
<!-- ── Bottom message ─────────────────────────────────────────────────── -->
|
|
4150
|
+
@if (_isInvalid()) {
|
|
4151
|
+
<p class="text-xs text-red-500 flex items-center gap-1">
|
|
4152
|
+
<span clx-icon name="error" size="xs"></span>
|
|
4153
|
+
{{ errorMessage() }}
|
|
4154
|
+
</p>
|
|
4155
|
+
} @else if (hint()) {
|
|
4156
|
+
<p [class]="_hintClass()">{{ hint() }}</p>
|
|
4157
|
+
}
|
|
4114
4158
|
`,
|
|
4115
4159
|
encapsulation: ViewEncapsulation.None,
|
|
4116
4160
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
@@ -4141,8 +4185,9 @@ class ClxCheckboxComponent {
|
|
|
4141
4185
|
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
4142
4186
|
_checked = signal(false, ...(ngDevMode ? [{ debugName: "_checked" }] : /* istanbul ignore next */ []));
|
|
4143
4187
|
_cvaDisabled = signal(false, ...(ngDevMode ? [{ debugName: "_cvaDisabled" }] : /* istanbul ignore next */ []));
|
|
4188
|
+
_cardDisabled = inject(CLX_CARD_DISABLED_CONTEXT, { optional: true });
|
|
4144
4189
|
_cvaConnected = false;
|
|
4145
|
-
_disabled = computed(() => this._cvaDisabled() || this.disabled(), ...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
|
|
4190
|
+
_disabled = computed(() => this._cvaDisabled() || this.disabled() || !!this._cardDisabled?.(), ...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
|
|
4146
4191
|
_valueEffect = effect(() => {
|
|
4147
4192
|
const v = this.value();
|
|
4148
4193
|
if (!this._cvaConnected)
|
|
@@ -4288,8 +4333,9 @@ class ClxRadioGroupComponent {
|
|
|
4288
4333
|
/** Current selected value — readable by child clx-radio via injection */
|
|
4289
4334
|
_value = signal(null, ...(ngDevMode ? [{ debugName: "_value" }] : /* istanbul ignore next */ []));
|
|
4290
4335
|
_cvaDisabled = signal(false, ...(ngDevMode ? [{ debugName: "_cvaDisabled" }] : /* istanbul ignore next */ []));
|
|
4336
|
+
_cardDisabled = inject(CLX_CARD_DISABLED_CONTEXT, { optional: true });
|
|
4291
4337
|
/** Merged disabled state (input + CVA) — readable by child clx-radio */
|
|
4292
|
-
isDisabled = computed(() => this._cvaDisabled() || this.disabled(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
4338
|
+
isDisabled = computed(() => this._cvaDisabled() || this.disabled() || !!this._cardDisabled?.(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
4293
4339
|
_onChange = () => { };
|
|
4294
4340
|
_onTouched = () => { };
|
|
4295
4341
|
select(value) {
|
|
@@ -4476,8 +4522,9 @@ class ClxSwitchComponent {
|
|
|
4476
4522
|
changed = output();
|
|
4477
4523
|
_checked = signal(false, ...(ngDevMode ? [{ debugName: "_checked" }] : /* istanbul ignore next */ []));
|
|
4478
4524
|
_cvaDisabled = signal(false, ...(ngDevMode ? [{ debugName: "_cvaDisabled" }] : /* istanbul ignore next */ []));
|
|
4525
|
+
_cardDisabled = inject(CLX_CARD_DISABLED_CONTEXT, { optional: true });
|
|
4479
4526
|
_cvaConnected = false;
|
|
4480
|
-
_disabled = computed(() => this._cvaDisabled() || this.disabled(), ...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
|
|
4527
|
+
_disabled = computed(() => this._cvaDisabled() || this.disabled() || !!this._cardDisabled?.(), ...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
|
|
4481
4528
|
_valueEffect = effect(() => {
|
|
4482
4529
|
const v = this.value();
|
|
4483
4530
|
if (!this._cvaConnected)
|
|
@@ -4624,11 +4671,12 @@ class ClxSliderComponent {
|
|
|
4624
4671
|
// ── Internal state ───────────────────────────────────────────────────────────
|
|
4625
4672
|
_currentValue = signal(0, ...(ngDevMode ? [{ debugName: "_currentValue" }] : /* istanbul ignore next */ []));
|
|
4626
4673
|
_cvaDisabled = signal(false, ...(ngDevMode ? [{ debugName: "_cvaDisabled" }] : /* istanbul ignore next */ []));
|
|
4674
|
+
_cardDisabled = inject(CLX_CARD_DISABLED_CONTEXT, { optional: true });
|
|
4627
4675
|
_isFocused = signal(false, ...(ngDevMode ? [{ debugName: "_isFocused" }] : /* istanbul ignore next */ []));
|
|
4628
4676
|
_isActive = signal(false, ...(ngDevMode ? [{ debugName: "_isActive" }] : /* istanbul ignore next */ []));
|
|
4629
4677
|
_wasTouched = signal(false, ...(ngDevMode ? [{ debugName: "_wasTouched" }] : /* istanbul ignore next */ []));
|
|
4630
4678
|
// ── Computed ─────────────────────────────────────────────────────────────────
|
|
4631
|
-
_disabled = computed(() => this._cvaDisabled() || this.disabled(), ...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
|
|
4679
|
+
_disabled = computed(() => this._cvaDisabled() || this.disabled() || !!this._cardDisabled?.(), ...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
|
|
4632
4680
|
_sizeConfig = computed(() => SLIDER_SIZE_MAP[this._size()], ...(ngDevMode ? [{ debugName: "_sizeConfig" }] : /* istanbul ignore next */ []));
|
|
4633
4681
|
_colorTokens = computed(() => resolveColor(this._isInvalid() ? 'red' : this._activeColor()), ...(ngDevMode ? [{ debugName: "_colorTokens" }] : /* istanbul ignore next */ []));
|
|
4634
4682
|
_pct = computed(() => {
|
|
@@ -4982,6 +5030,7 @@ class ClxUploadComponent {
|
|
|
4982
5030
|
_ngControl = inject(NgControl, { optional: true, self: true });
|
|
4983
5031
|
_cvaDisabled = signal(false, ...(ngDevMode ? [{ debugName: "_cvaDisabled" }] : /* istanbul ignore next */ []));
|
|
4984
5032
|
_cvaConnected = false;
|
|
5033
|
+
_cardDisabled = inject(CLX_CARD_DISABLED_CONTEXT, { optional: true });
|
|
4985
5034
|
_onChange = () => { };
|
|
4986
5035
|
_onTouched = () => { };
|
|
4987
5036
|
// ── Template refs ──────────────────────────────────────────────────────────
|
|
@@ -4991,7 +5040,7 @@ class ClxUploadComponent {
|
|
|
4991
5040
|
this._ngControl.valueAccessor = this;
|
|
4992
5041
|
}
|
|
4993
5042
|
// ── Computed ───────────────────────────────────────────────────────────────
|
|
4994
|
-
_disabled = computed(() => this._cvaDisabled() || this.disabled(), ...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
|
|
5043
|
+
_disabled = computed(() => this._cvaDisabled() || this.disabled() || !!this._cardDisabled?.(), ...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
|
|
4995
5044
|
_sizeConfig = computed(() => UPLOAD_SIZE_MAP[this._size()], ...(ngDevMode ? [{ debugName: "_sizeConfig" }] : /* istanbul ignore next */ []));
|
|
4996
5045
|
_isError = computed(() => this._errorKey() !== null, ...(ngDevMode ? [{ debugName: "_isError" }] : /* istanbul ignore next */ []));
|
|
4997
5046
|
_thumbClass = computed(() => `relative group flex flex-col ${resolveRadius(this._themeSvc.config().borderRadius)} border border-clx-border bg-clx-surface-2`, ...(ngDevMode ? [{ debugName: "_thumbClass" }] : /* istanbul ignore next */ []));
|
|
@@ -5650,6 +5699,7 @@ class ClxColorPickerComponent {
|
|
|
5650
5699
|
_sso = inject(ScrollStrategyOptions);
|
|
5651
5700
|
_wasTouched = signal(false, ...(ngDevMode ? [{ debugName: "_wasTouched" }] : /* istanbul ignore next */ []));
|
|
5652
5701
|
_cvaDisabled = signal(false, ...(ngDevMode ? [{ debugName: "_cvaDisabled" }] : /* istanbul ignore next */ []));
|
|
5702
|
+
_cardDisabled = inject(CLX_CARD_DISABLED_CONTEXT, { optional: true });
|
|
5653
5703
|
_scrollStrategy = this._sso.reposition();
|
|
5654
5704
|
_onChange = () => { };
|
|
5655
5705
|
_onTouched = () => { };
|
|
@@ -5673,7 +5723,7 @@ class ClxColorPickerComponent {
|
|
|
5673
5723
|
{ originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom', offsetY: -4 },
|
|
5674
5724
|
];
|
|
5675
5725
|
// ── Computed ───────────────────────────────────────────────────────────────
|
|
5676
|
-
_disabled = computed(() => this._cvaDisabled() || this.disabled(), ...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
|
|
5726
|
+
_disabled = computed(() => this._cvaDisabled() || this.disabled() || !!this._cardDisabled?.(), ...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
|
|
5677
5727
|
_sizeConfig = computed(() => COLOR_PICKER_SIZE_MAP[this._size()], ...(ngDevMode ? [{ debugName: "_sizeConfig" }] : /* istanbul ignore next */ []));
|
|
5678
5728
|
_hasValue = computed(() => this._hasColor(), ...(ngDevMode ? [{ debugName: "_hasValue" }] : /* istanbul ignore next */ []));
|
|
5679
5729
|
_isInvalid = computed(() => this._wasTouched() && (this._ngControl?.control?.invalid ?? false), ...(ngDevMode ? [{ debugName: "_isInvalid" }] : /* istanbul ignore next */ []));
|
|
@@ -6255,8 +6305,9 @@ class ClxDatepickerComponent {
|
|
|
6255
6305
|
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
6256
6306
|
_value = signal(null, ...(ngDevMode ? [{ debugName: "_value" }] : /* istanbul ignore next */ []));
|
|
6257
6307
|
_cvaDisabled = signal(false, ...(ngDevMode ? [{ debugName: "_cvaDisabled" }] : /* istanbul ignore next */ []));
|
|
6308
|
+
_cardDisabled = inject(CLX_CARD_DISABLED_CONTEXT, { optional: true });
|
|
6258
6309
|
_cvaConnected = false;
|
|
6259
|
-
_disabled = computed(() => this._cvaDisabled() || this.disabled(), ...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
|
|
6310
|
+
_disabled = computed(() => this._cvaDisabled() || this.disabled() || !!this._cardDisabled?.(), ...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
|
|
6260
6311
|
_cursorYear = signal(new Date().getFullYear(), ...(ngDevMode ? [{ debugName: "_cursorYear" }] : /* istanbul ignore next */ []));
|
|
6261
6312
|
_cursorMonth = signal(new Date().getMonth(), ...(ngDevMode ? [{ debugName: "_cursorMonth" }] : /* istanbul ignore next */ []));
|
|
6262
6313
|
_isOpen = signal(false, ...(ngDevMode ? [{ debugName: "_isOpen" }] : /* istanbul ignore next */ []));
|
|
@@ -6681,13 +6732,14 @@ class ClxTimepickerComponent {
|
|
|
6681
6732
|
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
6682
6733
|
_value = signal(null, ...(ngDevMode ? [{ debugName: "_value" }] : /* istanbul ignore next */ []));
|
|
6683
6734
|
_cvaDisabled = signal(false, ...(ngDevMode ? [{ debugName: "_cvaDisabled" }] : /* istanbul ignore next */ []));
|
|
6735
|
+
_cardDisabled = inject(CLX_CARD_DISABLED_CONTEXT, { optional: true });
|
|
6684
6736
|
_cvaConnected = false;
|
|
6685
6737
|
_valueEffect = effect(() => {
|
|
6686
6738
|
const v = this.value();
|
|
6687
6739
|
if (!this._cvaConnected)
|
|
6688
6740
|
untracked(() => { this._value.set(v); });
|
|
6689
6741
|
}, ...(ngDevMode ? [{ debugName: "_valueEffect" }] : /* istanbul ignore next */ []));
|
|
6690
|
-
_disabled = computed(() => this._cvaDisabled() || this.disabled(), ...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
|
|
6742
|
+
_disabled = computed(() => this._cvaDisabled() || this.disabled() || !!this._cardDisabled?.(), ...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
|
|
6691
6743
|
_isOpen = signal(false, ...(ngDevMode ? [{ debugName: "_isOpen" }] : /* istanbul ignore next */ []));
|
|
6692
6744
|
_hours = HOURS;
|
|
6693
6745
|
_minutes = MINUTES;
|
|
@@ -7033,7 +7085,8 @@ class ClxDateRangePickerComponent {
|
|
|
7033
7085
|
_presets = DATE_PRESETS;
|
|
7034
7086
|
_dayLabels = DAY_LABELS;
|
|
7035
7087
|
_cvaDisabled = signal(false, ...(ngDevMode ? [{ debugName: "_cvaDisabled" }] : /* istanbul ignore next */ []));
|
|
7036
|
-
|
|
7088
|
+
_cardDisabled = inject(CLX_CARD_DISABLED_CONTEXT, { optional: true });
|
|
7089
|
+
_disabled = computed(() => this._cvaDisabled() || this.disabled() || !!this._cardDisabled?.(), ...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
|
|
7037
7090
|
_isOpen = signal(false, ...(ngDevMode ? [{ debugName: "_isOpen" }] : /* istanbul ignore next */ []));
|
|
7038
7091
|
// Cursor: left calendar month
|
|
7039
7092
|
_cursorYear = signal(new Date().getFullYear(), ...(ngDevMode ? [{ debugName: "_cursorYear" }] : /* istanbul ignore next */ []));
|
|
@@ -8076,7 +8129,8 @@ class ClxEditorComponent {
|
|
|
8076
8129
|
_headingCtrl = new FormControl('p');
|
|
8077
8130
|
// ── State ─────────────────────────────────────────────────────────────────
|
|
8078
8131
|
_cvaDisabled = signal(false, ...(ngDevMode ? [{ debugName: "_cvaDisabled" }] : /* istanbul ignore next */ []));
|
|
8079
|
-
|
|
8132
|
+
_cardDisabled = inject(CLX_CARD_DISABLED_CONTEXT, { optional: true });
|
|
8133
|
+
_disabled = computed(() => this._cvaDisabled() || this.disabled() || !!this._cardDisabled?.(), ...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
|
|
8080
8134
|
_tick = signal(0, ...(ngDevMode ? [{ debugName: "_tick" }] : /* istanbul ignore next */ []));
|
|
8081
8135
|
_sourceMode = signal(false, ...(ngDevMode ? [{ debugName: "_sourceMode" }] : /* istanbul ignore next */ []));
|
|
8082
8136
|
_sourceValue = signal('', ...(ngDevMode ? [{ debugName: "_sourceValue" }] : /* istanbul ignore next */ []));
|