codexly-ui 0.10.10 → 0.10.12
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 +165 -5
- package/fesm2022/codexly-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/codexly-ui.d.ts +59 -8
package/fesm2022/codexly-ui.mjs
CHANGED
|
@@ -14204,7 +14204,7 @@ class ClxProductComponent {
|
|
|
14204
14204
|
clx-button
|
|
14205
14205
|
type="button"
|
|
14206
14206
|
[color]="clxColor()"
|
|
14207
|
-
variant="
|
|
14207
|
+
variant="ghost"
|
|
14208
14208
|
[size]="_buttonSize()"
|
|
14209
14209
|
icon="favorite"
|
|
14210
14210
|
[iconOnly]="true"
|
|
@@ -14248,7 +14248,7 @@ class ClxProductComponent {
|
|
|
14248
14248
|
clx-button
|
|
14249
14249
|
type="button"
|
|
14250
14250
|
[color]="clxColor()"
|
|
14251
|
-
variant="
|
|
14251
|
+
variant="ghost"
|
|
14252
14252
|
[size]="_buttonSize()"
|
|
14253
14253
|
icon="shopping_cart"
|
|
14254
14254
|
iconPosition="left"
|
|
@@ -14339,7 +14339,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
|
|
|
14339
14339
|
clx-button
|
|
14340
14340
|
type="button"
|
|
14341
14341
|
[color]="clxColor()"
|
|
14342
|
-
variant="
|
|
14342
|
+
variant="ghost"
|
|
14343
14343
|
[size]="_buttonSize()"
|
|
14344
14344
|
icon="favorite"
|
|
14345
14345
|
[iconOnly]="true"
|
|
@@ -14383,7 +14383,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
|
|
|
14383
14383
|
clx-button
|
|
14384
14384
|
type="button"
|
|
14385
14385
|
[color]="clxColor()"
|
|
14386
|
-
variant="
|
|
14386
|
+
variant="ghost"
|
|
14387
14387
|
[size]="_buttonSize()"
|
|
14388
14388
|
icon="shopping_cart"
|
|
14389
14389
|
iconPosition="left"
|
|
@@ -15747,6 +15747,166 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
|
|
|
15747
15747
|
}]
|
|
15748
15748
|
}] });
|
|
15749
15749
|
|
|
15750
|
+
let _clxSearchIdCounter = 0;
|
|
15751
|
+
/** Storefront search bar — same color/size/CVA conventions as ClxInputComponent, but styled as
|
|
15752
|
+
* one continuous pill (input fused with a solid search button) rather than a bordered field with
|
|
15753
|
+
* a detached button, matching how e-commerce header search boxes are typically laid out. */
|
|
15754
|
+
class ClxSearchComponent {
|
|
15755
|
+
_themeSvc = inject(ClxThemeService);
|
|
15756
|
+
color = input(undefined, ...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
|
|
15757
|
+
_color = computed(() => this.color() ?? this._themeSvc.config().primaryColor, ...(ngDevMode ? [{ debugName: "_color" }] : /* istanbul ignore next */ []));
|
|
15758
|
+
size = input(undefined, ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
15759
|
+
_size = computed(() => (this.size() ?? this._themeSvc.config().defaultSize), ...(ngDevMode ? [{ debugName: "_size" }] : /* istanbul ignore next */ []));
|
|
15760
|
+
placeholder = input('Buscar...', ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
15761
|
+
buttonLabel = input('Buscar', ...(ngDevMode ? [{ debugName: "buttonLabel" }] : /* istanbul ignore next */ []));
|
|
15762
|
+
/** Initial value for standalone use (without FormControl) */
|
|
15763
|
+
value = input('', ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
15764
|
+
/** Disabled state for standalone use (without FormControl) */
|
|
15765
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
15766
|
+
search = output();
|
|
15767
|
+
_inputId = `clx-search-${++_clxSearchIdCounter}`;
|
|
15768
|
+
_value = signal('', ...(ngDevMode ? [{ debugName: "_value" }] : /* istanbul ignore next */ []));
|
|
15769
|
+
_cvaDisabled = signal(false, ...(ngDevMode ? [{ debugName: "_cvaDisabled" }] : /* istanbul ignore next */ []));
|
|
15770
|
+
_cvaConnected = false;
|
|
15771
|
+
_cardDisabled = inject(CLX_CARD_DISABLED_CONTEXT, { optional: true });
|
|
15772
|
+
_disabled = computed(() => this._cvaDisabled() || this.disabled() || !!this._cardDisabled?.(), ...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
|
|
15773
|
+
_valueEffect = effect(() => {
|
|
15774
|
+
const v = this.value();
|
|
15775
|
+
if (!this._cvaConnected)
|
|
15776
|
+
untracked(() => this._value.set(v));
|
|
15777
|
+
}, ...(ngDevMode ? [{ debugName: "_valueEffect" }] : /* istanbul ignore next */ []));
|
|
15778
|
+
_onChange = () => { };
|
|
15779
|
+
_onTouched = () => { };
|
|
15780
|
+
_sizeConfig = computed(() => INPUT_SIZE_MAP[this._size()], ...(ngDevMode ? [{ debugName: "_sizeConfig" }] : /* istanbul ignore next */ []));
|
|
15781
|
+
_buttonSize = computed(() => {
|
|
15782
|
+
switch (this._size()) {
|
|
15783
|
+
case 'sm': return 'sm';
|
|
15784
|
+
case 'lg': return 'lg';
|
|
15785
|
+
default: return 'md';
|
|
15786
|
+
}
|
|
15787
|
+
}, ...(ngDevMode ? [{ debugName: "_buttonSize" }] : /* istanbul ignore next */ []));
|
|
15788
|
+
_wrapperClass = computed(() => {
|
|
15789
|
+
const focusCls = this._disabled() ? '' : resolveColor(this._color()).focusWithin;
|
|
15790
|
+
return `relative flex items-stretch ${resolveRadius(this._themeSvc.config().borderRadius)} border border-clx-border ${focusCls} overflow-hidden transition-[border-color,box-shadow] duration-200`;
|
|
15791
|
+
}, ...(ngDevMode ? [{ debugName: "_wrapperClass" }] : /* istanbul ignore next */ []));
|
|
15792
|
+
_inputClass = computed(() => {
|
|
15793
|
+
const size = this._sizeConfig();
|
|
15794
|
+
const disabledCls = this._disabled()
|
|
15795
|
+
? `cursor-not-allowed ${CLX_TEXT_DISABLED} ${CLX_BG_DISABLED}`
|
|
15796
|
+
: `${CLX_TEXT_INPUT} ${CLX_BG_SURFACE}`;
|
|
15797
|
+
return `flex-1 min-w-0 ${size.input} pl-3 pr-3 outline-none border-0 ${CLX_PLACEHOLDER} ${disabledCls}`;
|
|
15798
|
+
}, ...(ngDevMode ? [{ debugName: "_inputClass" }] : /* istanbul ignore next */ []));
|
|
15799
|
+
writeValue(val) {
|
|
15800
|
+
this._cvaConnected = true;
|
|
15801
|
+
this._value.set(val ?? '');
|
|
15802
|
+
}
|
|
15803
|
+
registerOnChange(fn) {
|
|
15804
|
+
this._onChange = fn;
|
|
15805
|
+
}
|
|
15806
|
+
registerOnTouched(fn) {
|
|
15807
|
+
this._onTouched = fn;
|
|
15808
|
+
}
|
|
15809
|
+
setDisabledState(disabled) {
|
|
15810
|
+
this._cvaDisabled.set(disabled);
|
|
15811
|
+
}
|
|
15812
|
+
_handleInput(event) {
|
|
15813
|
+
const val = event.target.value;
|
|
15814
|
+
this._value.set(val);
|
|
15815
|
+
this._onChange(val);
|
|
15816
|
+
}
|
|
15817
|
+
_handleBlur() {
|
|
15818
|
+
this._onTouched();
|
|
15819
|
+
}
|
|
15820
|
+
_handleSubmit() {
|
|
15821
|
+
if (this._disabled())
|
|
15822
|
+
return;
|
|
15823
|
+
this.search.emit(this._value());
|
|
15824
|
+
}
|
|
15825
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: ClxSearchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
15826
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.15", type: ClxSearchComponent, isStandalone: true, selector: "clx-search", inputs: { color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, buttonLabel: { classPropertyName: "buttonLabel", publicName: "buttonLabel", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { search: "search" }, host: { classAttribute: "block w-full" }, providers: [
|
|
15827
|
+
{
|
|
15828
|
+
provide: NG_VALUE_ACCESSOR,
|
|
15829
|
+
useExisting: forwardRef(() => ClxSearchComponent),
|
|
15830
|
+
multi: true,
|
|
15831
|
+
},
|
|
15832
|
+
], ngImport: i0, template: `
|
|
15833
|
+
<div [class]="_wrapperClass()">
|
|
15834
|
+
<input
|
|
15835
|
+
[id]="_inputId"
|
|
15836
|
+
type="search"
|
|
15837
|
+
[placeholder]="placeholder()"
|
|
15838
|
+
[disabled]="_disabled()"
|
|
15839
|
+
[value]="_value()"
|
|
15840
|
+
[class]="_inputClass()"
|
|
15841
|
+
autocomplete="off"
|
|
15842
|
+
(input)="_handleInput($event)"
|
|
15843
|
+
(keydown.enter)="_handleSubmit()"
|
|
15844
|
+
(blur)="_handleBlur()"
|
|
15845
|
+
/>
|
|
15846
|
+
<button
|
|
15847
|
+
clx-button
|
|
15848
|
+
type="button"
|
|
15849
|
+
variant="solid"
|
|
15850
|
+
[color]="_color()"
|
|
15851
|
+
[size]="_buttonSize()"
|
|
15852
|
+
icon="search"
|
|
15853
|
+
[disabled]="_disabled()"
|
|
15854
|
+
class="rounded-l-none shrink-0"
|
|
15855
|
+
(click)="_handleSubmit()">
|
|
15856
|
+
{{ buttonLabel() }}
|
|
15857
|
+
</button>
|
|
15858
|
+
</div>
|
|
15859
|
+
`, isInline: true, dependencies: [{ kind: "component", type: ClxButtonComponent, selector: "button[clx-button], a[clx-button]", inputs: ["variant", "color", "size", "shape", "loading", "disabled", "block", "icon", "iconPosition", "iconOnly", "badge", "badgeColor"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
15860
|
+
}
|
|
15861
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: ClxSearchComponent, decorators: [{
|
|
15862
|
+
type: Component,
|
|
15863
|
+
args: [{
|
|
15864
|
+
selector: 'clx-search',
|
|
15865
|
+
standalone: true,
|
|
15866
|
+
imports: [ClxButtonComponent],
|
|
15867
|
+
providers: [
|
|
15868
|
+
{
|
|
15869
|
+
provide: NG_VALUE_ACCESSOR,
|
|
15870
|
+
useExisting: forwardRef(() => ClxSearchComponent),
|
|
15871
|
+
multi: true,
|
|
15872
|
+
},
|
|
15873
|
+
],
|
|
15874
|
+
template: `
|
|
15875
|
+
<div [class]="_wrapperClass()">
|
|
15876
|
+
<input
|
|
15877
|
+
[id]="_inputId"
|
|
15878
|
+
type="search"
|
|
15879
|
+
[placeholder]="placeholder()"
|
|
15880
|
+
[disabled]="_disabled()"
|
|
15881
|
+
[value]="_value()"
|
|
15882
|
+
[class]="_inputClass()"
|
|
15883
|
+
autocomplete="off"
|
|
15884
|
+
(input)="_handleInput($event)"
|
|
15885
|
+
(keydown.enter)="_handleSubmit()"
|
|
15886
|
+
(blur)="_handleBlur()"
|
|
15887
|
+
/>
|
|
15888
|
+
<button
|
|
15889
|
+
clx-button
|
|
15890
|
+
type="button"
|
|
15891
|
+
variant="solid"
|
|
15892
|
+
[color]="_color()"
|
|
15893
|
+
[size]="_buttonSize()"
|
|
15894
|
+
icon="search"
|
|
15895
|
+
[disabled]="_disabled()"
|
|
15896
|
+
class="rounded-l-none shrink-0"
|
|
15897
|
+
(click)="_handleSubmit()">
|
|
15898
|
+
{{ buttonLabel() }}
|
|
15899
|
+
</button>
|
|
15900
|
+
</div>
|
|
15901
|
+
`,
|
|
15902
|
+
encapsulation: ViewEncapsulation.None,
|
|
15903
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
15904
|
+
host: {
|
|
15905
|
+
class: 'block w-full',
|
|
15906
|
+
},
|
|
15907
|
+
}]
|
|
15908
|
+
}], propDecorators: { color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], buttonLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "buttonLabel", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], search: [{ type: i0.Output, args: ["search"] }] } });
|
|
15909
|
+
|
|
15750
15910
|
class ClxAnimateGroupDirective {
|
|
15751
15911
|
stagger = input(100, { ...(ngDevMode ? { debugName: "stagger" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
15752
15912
|
children;
|
|
@@ -16017,5 +16177,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
|
|
|
16017
16177
|
* Generated bundle index. Do not edit.
|
|
16018
16178
|
*/
|
|
16019
16179
|
|
|
16020
|
-
export { CLX_ADDON_BORDER, CLX_ADDON_TEXT, CLX_ALERT_OPTIONS, CLX_ALERT_RESOLVE, CLX_BG_ADDON, CLX_BG_DISABLED, CLX_BG_ICON_WRAP, CLX_BG_SECTION, CLX_BG_SURFACE, CLX_BORDER_DEFAULT, CLX_BORDER_DISABLED, CLX_BORDER_MEDIUM, CLX_COLOR_HEX, CLX_COLOR_HEX_100, CLX_COLOR_MAP, CLX_FONT_CATALOG, CLX_MODAL_ANIM_CONFIG, CLX_MODAL_DATA, CLX_MODAL_REF, CLX_OPTION_DISABLED, CLX_PLACEHOLDER, CLX_RADIO_GROUP, CLX_RADIUS_MAP, CLX_TEXT_BODY, CLX_TEXT_DISABLED, CLX_TEXT_HEADING, CLX_TEXT_HINT, CLX_TEXT_IDLE, CLX_TEXT_INPUT, CLX_TEXT_LABEL, CLX_TEXT_OPTION, CLX_TEXT_SUBTITLE, CLX_TEXT_TITLE, CLX_THEME_CONFIG, CLX_THEME_DEFAULTS, CLX_TOAST_DEFAULTS, ClxAlertComponent, ClxAlertService, ClxAnimateDirective, ClxAnimateGroupDirective, ClxAnimateService, ClxAppLayoutComponent, ClxAvatarComponent, ClxBadgeComponent, ClxBrandComponent, ClxButtonComponent, ClxButtonGroupComponent, ClxCardBodyDirective, ClxCardComponent, ClxCardFooterDirective, ClxCardHeaderActionsDirective, ClxCardHeaderDirective, ClxCarouselComponent, ClxCarouselDirective, ClxCartComponent, ClxCartSummaryDrawer, ClxCellDirective, ClxCheckboxComponent, ClxColorPickerComponent, ClxColumnDefDirective, ClxDateRangePickerComponent, ClxDatepickerComponent, ClxDrawerComponent, ClxDrawerService, ClxEditorComponent, ClxEditorLinkModalComponent, ClxFabComponent, ClxFilterPanelComponent, ClxHeaderCellDirective, ClxIconComponent, ClxInputComponent, ClxListComponent, ClxListItemComponent, ClxMenuComponent, ClxMenuItemComponent, ClxModalComponent, ClxModalService, ClxNativeOverlayService, ClxNavGroupComponent, ClxNumberComponent, ClxPageEmptyComponent, ClxPageHeaderComponent, ClxPageHeaderTitleDirective, ClxPageNotFoundComponent, ClxPageServerErrorComponent, ClxPageUnauthorizedComponent, ClxPaginationComponent, ClxProductComponent, ClxProductDetailComponent, ClxProfileComponent, ClxProgressBarComponent, ClxRadioComponent, ClxRadioGroupComponent, ClxRatingComponent, ClxSelectComponent, ClxSkeletonComponent, ClxSliderComponent, ClxSpinnerComponent, ClxStatCardComponent, ClxStepComponent, ClxStepperComponent, ClxSwitchComponent, ClxTabDirective, ClxTableComponent, ClxTabsComponent, ClxTagComponent, ClxTextareaComponent, ClxThemeService, ClxTimelineComponent, ClxTimelineItemComponent, ClxTimepickerComponent, ClxToastComponent, ClxToastContainerComponent, ClxToastService, ClxTooltipComponent, ClxTooltipDirective, ClxTreeComponent, ClxUploadComponent, ClxWishlistComponent, ClxWizardComponent, TIMEPICKER_SIZE_MAP, parseColorInput, provideCodexlyTheme, resolveColor, resolveContainerRadius, resolveRadius };
|
|
16180
|
+
export { CLX_ADDON_BORDER, CLX_ADDON_TEXT, CLX_ALERT_OPTIONS, CLX_ALERT_RESOLVE, CLX_BG_ADDON, CLX_BG_DISABLED, CLX_BG_ICON_WRAP, CLX_BG_SECTION, CLX_BG_SURFACE, CLX_BORDER_DEFAULT, CLX_BORDER_DISABLED, CLX_BORDER_MEDIUM, CLX_COLOR_HEX, CLX_COLOR_HEX_100, CLX_COLOR_MAP, CLX_FONT_CATALOG, CLX_MODAL_ANIM_CONFIG, CLX_MODAL_DATA, CLX_MODAL_REF, CLX_OPTION_DISABLED, CLX_PLACEHOLDER, CLX_RADIO_GROUP, CLX_RADIUS_MAP, CLX_TEXT_BODY, CLX_TEXT_DISABLED, CLX_TEXT_HEADING, CLX_TEXT_HINT, CLX_TEXT_IDLE, CLX_TEXT_INPUT, CLX_TEXT_LABEL, CLX_TEXT_OPTION, CLX_TEXT_SUBTITLE, CLX_TEXT_TITLE, CLX_THEME_CONFIG, CLX_THEME_DEFAULTS, CLX_TOAST_DEFAULTS, ClxAlertComponent, ClxAlertService, ClxAnimateDirective, ClxAnimateGroupDirective, ClxAnimateService, ClxAppLayoutComponent, ClxAvatarComponent, ClxBadgeComponent, ClxBrandComponent, ClxButtonComponent, ClxButtonGroupComponent, ClxCardBodyDirective, ClxCardComponent, ClxCardFooterDirective, ClxCardHeaderActionsDirective, ClxCardHeaderDirective, ClxCarouselComponent, ClxCarouselDirective, ClxCartComponent, ClxCartSummaryDrawer, ClxCellDirective, ClxCheckboxComponent, ClxColorPickerComponent, ClxColumnDefDirective, ClxDateRangePickerComponent, ClxDatepickerComponent, ClxDrawerComponent, ClxDrawerService, ClxEditorComponent, ClxEditorLinkModalComponent, ClxFabComponent, ClxFilterPanelComponent, ClxHeaderCellDirective, ClxIconComponent, ClxInputComponent, ClxListComponent, ClxListItemComponent, ClxMenuComponent, ClxMenuItemComponent, ClxModalComponent, ClxModalService, ClxNativeOverlayService, ClxNavGroupComponent, ClxNumberComponent, ClxPageEmptyComponent, ClxPageHeaderComponent, ClxPageHeaderTitleDirective, ClxPageNotFoundComponent, ClxPageServerErrorComponent, ClxPageUnauthorizedComponent, ClxPaginationComponent, ClxProductComponent, ClxProductDetailComponent, ClxProfileComponent, ClxProgressBarComponent, ClxRadioComponent, ClxRadioGroupComponent, ClxRatingComponent, ClxSearchComponent, ClxSelectComponent, ClxSkeletonComponent, ClxSliderComponent, ClxSpinnerComponent, ClxStatCardComponent, ClxStepComponent, ClxStepperComponent, ClxSwitchComponent, ClxTabDirective, ClxTableComponent, ClxTabsComponent, ClxTagComponent, ClxTextareaComponent, ClxThemeService, ClxTimelineComponent, ClxTimelineItemComponent, ClxTimepickerComponent, ClxToastComponent, ClxToastContainerComponent, ClxToastService, ClxTooltipComponent, ClxTooltipDirective, ClxTreeComponent, ClxUploadComponent, ClxWishlistComponent, ClxWizardComponent, TIMEPICKER_SIZE_MAP, parseColorInput, provideCodexlyTheme, resolveColor, resolveContainerRadius, resolveRadius };
|
|
16021
16181
|
//# sourceMappingURL=codexly-ui.mjs.map
|