@vallift/ngl 22.0.3 → 22.0.4
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/vallift-ngl.mjs +110 -1
- package/fesm2022/vallift-ngl.mjs.map +1 -1
- package/package.json +1 -1
- package/types/vallift-ngl.d.ts +36 -3
package/fesm2022/vallift-ngl.mjs
CHANGED
|
@@ -14159,6 +14159,115 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImpor
|
|
|
14159
14159
|
args: ['trackRef']
|
|
14160
14160
|
}] } });
|
|
14161
14161
|
|
|
14162
|
+
function validateSignalForm(signalForm) {
|
|
14163
|
+
const root = signalForm();
|
|
14164
|
+
root.markAsTouched();
|
|
14165
|
+
if (root.invalid()) {
|
|
14166
|
+
root.focusBoundControl();
|
|
14167
|
+
return false;
|
|
14168
|
+
}
|
|
14169
|
+
return true;
|
|
14170
|
+
}
|
|
14171
|
+
|
|
14172
|
+
class SignalFormDirective {
|
|
14173
|
+
fieldTree = input.required({ ...(ngDevMode ? { debugName: "fieldTree" } : /* istanbul ignore next */ {}), alias: 'signalForm' });
|
|
14174
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: SignalFormDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
14175
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.1", type: SignalFormDirective, isStandalone: true, selector: "form[signalForm]", inputs: { fieldTree: { classPropertyName: "fieldTree", publicName: "signalForm", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 });
|
|
14176
|
+
}
|
|
14177
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: SignalFormDirective, decorators: [{
|
|
14178
|
+
type: Directive,
|
|
14179
|
+
args: [{
|
|
14180
|
+
selector: 'form[signalForm]',
|
|
14181
|
+
}]
|
|
14182
|
+
}], propDecorators: { fieldTree: [{ type: i0.Input, args: [{ isSignal: true, alias: "signalForm", required: true }] }] } });
|
|
14183
|
+
|
|
14184
|
+
const BASE_CLASSES = 'relative inline-flex items-center justify-center gap-2 rounded-lg text-button whitespace-nowrap transition-colors duration-200 focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-primary-subtle';
|
|
14185
|
+
const SIZE_CLASSES = {
|
|
14186
|
+
sm: 'h-9 px-4 text-caption',
|
|
14187
|
+
md: 'h-10 px-5 text-body2',
|
|
14188
|
+
lg: 'h-11 px-5 text-body1',
|
|
14189
|
+
};
|
|
14190
|
+
const DISABLED_CLASSES = 'bg-surface-disabled text-role-disabled border border-disabled cursor-not-allowed';
|
|
14191
|
+
const APPEARANCE_CLASSES = {
|
|
14192
|
+
primary: 'bg-surface-primary text-primary-on-color hover:bg-surface-primary-hover active:bg-surface-primary-active border border-transparent',
|
|
14193
|
+
outline: 'bg-transparent border border-default text-primary hover:border-primary-hover hover:bg-page-secondary active:bg-surface-primary-subtle',
|
|
14194
|
+
ghost: 'bg-transparent border border-transparent text-primary hover:bg-page-secondary active:bg-surface-primary-subtle',
|
|
14195
|
+
text: 'bg-transparent border border-transparent text-primary hover:text-primary-hover active:text-primary-active',
|
|
14196
|
+
};
|
|
14197
|
+
function getSignalButtonClasses(appearance, size, disabled, fullWidth) {
|
|
14198
|
+
const widthClass = fullWidth ? 'w-full' : '';
|
|
14199
|
+
const stateClasses = disabled ? DISABLED_CLASSES : APPEARANCE_CLASSES[appearance];
|
|
14200
|
+
return `${BASE_CLASSES} ${SIZE_CLASSES[size]} ${stateClasses} ${widthClass}`.trim();
|
|
14201
|
+
}
|
|
14202
|
+
function getSignalButtonIconClasses(appearance, disabled) {
|
|
14203
|
+
if (disabled) {
|
|
14204
|
+
return 'text-role-disabled';
|
|
14205
|
+
}
|
|
14206
|
+
switch (appearance) {
|
|
14207
|
+
case 'primary':
|
|
14208
|
+
return 'text-primary-on-color';
|
|
14209
|
+
case 'outline':
|
|
14210
|
+
case 'ghost':
|
|
14211
|
+
case 'text':
|
|
14212
|
+
default:
|
|
14213
|
+
return 'text-primary';
|
|
14214
|
+
}
|
|
14215
|
+
}
|
|
14216
|
+
function getSignalButtonSpinnerBorderClass(appearance, disabled) {
|
|
14217
|
+
if (disabled) {
|
|
14218
|
+
return 'border-disabled';
|
|
14219
|
+
}
|
|
14220
|
+
return appearance === 'primary' ? 'border-primary-on-color' : 'border-primary';
|
|
14221
|
+
}
|
|
14222
|
+
|
|
14223
|
+
class SignalButton {
|
|
14224
|
+
parentSignalForm = inject(SignalFormDirective, { optional: true });
|
|
14225
|
+
type = input('button', /* @ts-ignore */
|
|
14226
|
+
...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
|
|
14227
|
+
appearance = input('primary', /* @ts-ignore */
|
|
14228
|
+
...(ngDevMode ? [{ debugName: "appearance" }] : /* istanbul ignore next */ []));
|
|
14229
|
+
size = input('md', /* @ts-ignore */
|
|
14230
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
14231
|
+
disabled = input(false, /* @ts-ignore */
|
|
14232
|
+
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
14233
|
+
loading = input(false, /* @ts-ignore */
|
|
14234
|
+
...(ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []));
|
|
14235
|
+
fullWidth = input(true, /* @ts-ignore */
|
|
14236
|
+
...(ngDevMode ? [{ debugName: "fullWidth" }] : /* istanbul ignore next */ []));
|
|
14237
|
+
iconSrc = input(null, /* @ts-ignore */
|
|
14238
|
+
...(ngDevMode ? [{ debugName: "iconSrc" }] : /* istanbul ignore next */ []));
|
|
14239
|
+
iconSize = input(18, /* @ts-ignore */
|
|
14240
|
+
...(ngDevMode ? [{ debugName: "iconSize" }] : /* istanbul ignore next */ []));
|
|
14241
|
+
clicked = output();
|
|
14242
|
+
buttonClasses = computed(() => getSignalButtonClasses(this.appearance(), this.size(), this.disabled(), this.fullWidth()), /* @ts-ignore */
|
|
14243
|
+
...(ngDevMode ? [{ debugName: "buttonClasses" }] : /* istanbul ignore next */ []));
|
|
14244
|
+
iconClasses = computed(() => getSignalButtonIconClasses(this.appearance(), this.disabled()), /* @ts-ignore */
|
|
14245
|
+
...(ngDevMode ? [{ debugName: "iconClasses" }] : /* istanbul ignore next */ []));
|
|
14246
|
+
spinnerBorderClass = computed(() => getSignalButtonSpinnerBorderClass(this.appearance(), this.disabled()), /* @ts-ignore */
|
|
14247
|
+
...(ngDevMode ? [{ debugName: "spinnerBorderClass" }] : /* istanbul ignore next */ []));
|
|
14248
|
+
onClick(event) {
|
|
14249
|
+
if (this.disabled() || this.loading()) {
|
|
14250
|
+
event.preventDefault();
|
|
14251
|
+
event.stopPropagation();
|
|
14252
|
+
return;
|
|
14253
|
+
}
|
|
14254
|
+
if (this.type() === 'submit' && this.parentSignalForm) {
|
|
14255
|
+
if (!validateSignalForm(this.parentSignalForm.fieldTree())) {
|
|
14256
|
+
event.preventDefault();
|
|
14257
|
+
event.stopPropagation();
|
|
14258
|
+
return;
|
|
14259
|
+
}
|
|
14260
|
+
}
|
|
14261
|
+
this.clicked.emit();
|
|
14262
|
+
}
|
|
14263
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: SignalButton, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
14264
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.1", type: SignalButton, isStandalone: true, selector: "lib-signal-button", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, fullWidth: { classPropertyName: "fullWidth", publicName: "fullWidth", isSignal: true, isRequired: false, transformFunction: null }, iconSrc: { classPropertyName: "iconSrc", publicName: "iconSrc", isSignal: true, isRequired: false, transformFunction: null }, iconSize: { classPropertyName: "iconSize", publicName: "iconSize", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clicked: "clicked" }, ngImport: i0, template: "<button\n [type]=\"type()\"\n [disabled]=\"disabled() || loading()\"\n [class]=\"buttonClasses()\"\n [attr.aria-busy]=\"loading() || null\"\n (click)=\"onClick($event)\">\n @if (iconSrc()) {\n <app-svg-icon\n [src]=\"iconSrc()!\"\n [size]=\"iconSize()\"\n [class]=\"iconClasses() + (loading() ? ' invisible' : '')\" />\n }\n\n <span [class.invisible]=\"loading()\">\n <ng-content />\n </span>\n\n @if (loading()) {\n <app-spinner\n class=\"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2\"\n [borderColor]=\"spinnerBorderClass()\" />\n }\n</button>\n", dependencies: [{ kind: "component", type: AppSvgIconComponent, selector: "app-svg-icon", inputs: ["src", "stretch", "size", "svgStyle"] }, { kind: "component", type: SpinnerComponent, selector: "app-spinner", inputs: ["borderColor"] }] });
|
|
14265
|
+
}
|
|
14266
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: SignalButton, decorators: [{
|
|
14267
|
+
type: Component,
|
|
14268
|
+
args: [{ selector: 'lib-signal-button', imports: [AppSvgIconComponent, SpinnerComponent], template: "<button\n [type]=\"type()\"\n [disabled]=\"disabled() || loading()\"\n [class]=\"buttonClasses()\"\n [attr.aria-busy]=\"loading() || null\"\n (click)=\"onClick($event)\">\n @if (iconSrc()) {\n <app-svg-icon\n [src]=\"iconSrc()!\"\n [size]=\"iconSize()\"\n [class]=\"iconClasses() + (loading() ? ' invisible' : '')\" />\n }\n\n <span [class.invisible]=\"loading()\">\n <ng-content />\n </span>\n\n @if (loading()) {\n <app-spinner\n class=\"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2\"\n [borderColor]=\"spinnerBorderClass()\" />\n }\n</button>\n" }]
|
|
14269
|
+
}], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], fullWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullWidth", required: false }] }], iconSrc: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconSrc", required: false }] }], iconSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconSize", required: false }] }], clicked: [{ type: i0.Output, args: ["clicked"] }] } });
|
|
14270
|
+
|
|
14162
14271
|
class DateUtils {
|
|
14163
14272
|
convertToMMDDYYYY(dateString) {
|
|
14164
14273
|
if (!dateString) {
|
|
@@ -14458,5 +14567,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImpor
|
|
|
14458
14567
|
* Generated bundle index. Do not edit.
|
|
14459
14568
|
*/
|
|
14460
14569
|
|
|
14461
|
-
export { AlertDialogComponent, AppErrorComponent, AppSvgIconComponent, BaseApiService, BaseControlValueAccessor, BaseControlValueAccessorV2, BaseControlValueAccessorV3, BaseInputComponent, BaseOverlayComponent, BaseTableComponent, BreadcrumbComponent, ButtonComponent, CheckboxComponent, ClickOutsideDirective, CloseButtonComponent, ColorConverterService, ColorFormats, ColorPickerComponent, ColorPickerDirective, ContextMenuButtonComponent, ContextMenuIconComponent, DEFAULT_PHONE_COUNTRIES, DataTableComponent, DateInputComponent, DatePickerComponent, DatePickerOverlayComponent, DateRangePickerComponent, DateUtils, DropdownComponent, DynamicRendererComponent, EnvBannerComponent, FORM_ERRORS, FileUploaderComponent, FormValidationUtils, HumanizeFormMessagesPipe, InfiniteScrollDirective, InfiniteScrollModule, InputDateFormat, InvalidControlScrollContainerDirective, InvalidControlScrollDirective, InvalidTokenError, ListviewComponent, LoaderComponent, LoaderService, MultiSelectDropdownAppearance, MultiSelectDropdownComponent, MultiSelectionFieldComponent, NGL_CONFIG, NetworkImageComponent, NglService, NoDataComponent, NoDataTableComponent, NumberInputComponent, OpenFloatingMenuDirective, OverlayContextMenuComponent, OverlayService, OverlayWizardUtils, PaginationComponent, PaginationState, PhoneNumberInputComponent, RadioButtonComponent, RequestState, ResizableColumnDirective, ResponsiveHelperComponent, SharedConstants, ShimmerComponent, SignalCheckbox, SignalDateField, SignalDatePicker, SignalDateRangeField, SignalDateRangePicker, SignalDropdown, SignalMultiSelectDropdown, SignalNumberField, SignalOtpField, SignalPhoneNumberField, SignalRadio, SignalRadioGroup, SignalRangeSlider, SignalRating, SignalSlider, SignalSwitch, SignalTextField, SignalTextarea, SignalTimeField, SignalTimePicker, SingleItemPickerInputComponent, SingleSelectionFieldComponent, SortableTableDirective, SpinnerComponent, State, StatusBadgeComponent, SvgUrlIconComponent, SwitchComponent, TableCustomComponent, TableResizableColumnsDirective, TemplateResolverArrayUtil, TemplateResolverFormat, TextAreaInputComponent, TextInputComponent, ThemeService, TimePickerComponent, ToastComponent, ToastService, ToasterComponent, TooltipDirective, UnsavedAwareDirective, arrayToCSV, arrayToSeparator, arrayToSpaceSeparator, deepEqual, defaultErrors, getDynamicTypeStructure, isDynamicType, isValid, jsonEqual, jwtDecode, mmddyyyyDateValidatorAsync, onlyFutureDateValidator, onlyPastDateValidator, openLink, phoneNumbers, phoneNumbersAll, printInvalidFields, provideNglConfig, resolveTemplateWithObject, toSentenceCase };
|
|
14570
|
+
export { AlertDialogComponent, AppErrorComponent, AppSvgIconComponent, BaseApiService, BaseControlValueAccessor, BaseControlValueAccessorV2, BaseControlValueAccessorV3, BaseInputComponent, BaseOverlayComponent, BaseTableComponent, BreadcrumbComponent, ButtonComponent, CheckboxComponent, ClickOutsideDirective, CloseButtonComponent, ColorConverterService, ColorFormats, ColorPickerComponent, ColorPickerDirective, ContextMenuButtonComponent, ContextMenuIconComponent, DEFAULT_PHONE_COUNTRIES, DataTableComponent, DateInputComponent, DatePickerComponent, DatePickerOverlayComponent, DateRangePickerComponent, DateUtils, DropdownComponent, DynamicRendererComponent, EnvBannerComponent, FORM_ERRORS, FileUploaderComponent, FormValidationUtils, HumanizeFormMessagesPipe, InfiniteScrollDirective, InfiniteScrollModule, InputDateFormat, InvalidControlScrollContainerDirective, InvalidControlScrollDirective, InvalidTokenError, ListviewComponent, LoaderComponent, LoaderService, MultiSelectDropdownAppearance, MultiSelectDropdownComponent, MultiSelectionFieldComponent, NGL_CONFIG, NetworkImageComponent, NglService, NoDataComponent, NoDataTableComponent, NumberInputComponent, OpenFloatingMenuDirective, OverlayContextMenuComponent, OverlayService, OverlayWizardUtils, PaginationComponent, PaginationState, PhoneNumberInputComponent, RadioButtonComponent, RequestState, ResizableColumnDirective, ResponsiveHelperComponent, SharedConstants, ShimmerComponent, SignalButton, SignalCheckbox, SignalDateField, SignalDatePicker, SignalDateRangeField, SignalDateRangePicker, SignalDropdown, SignalFormDirective, SignalMultiSelectDropdown, SignalNumberField, SignalOtpField, SignalPhoneNumberField, SignalRadio, SignalRadioGroup, SignalRangeSlider, SignalRating, SignalSlider, SignalSwitch, SignalTextField, SignalTextarea, SignalTimeField, SignalTimePicker, SingleItemPickerInputComponent, SingleSelectionFieldComponent, SortableTableDirective, SpinnerComponent, State, StatusBadgeComponent, SvgUrlIconComponent, SwitchComponent, TableCustomComponent, TableResizableColumnsDirective, TemplateResolverArrayUtil, TemplateResolverFormat, TextAreaInputComponent, TextInputComponent, ThemeService, TimePickerComponent, ToastComponent, ToastService, ToasterComponent, TooltipDirective, UnsavedAwareDirective, arrayToCSV, arrayToSeparator, arrayToSpaceSeparator, deepEqual, defaultErrors, getDynamicTypeStructure, getSignalButtonClasses, getSignalButtonIconClasses, getSignalButtonSpinnerBorderClass, isDynamicType, isValid, jsonEqual, jwtDecode, mmddyyyyDateValidatorAsync, onlyFutureDateValidator, onlyPastDateValidator, openLink, phoneNumbers, phoneNumbersAll, printInvalidFields, provideNglConfig, resolveTemplateWithObject, toSentenceCase, validateSignalForm };
|
|
14462
14571
|
//# sourceMappingURL=vallift-ngl.mjs.map
|