@stemy/ngx-dynamic-form 19.9.34 → 19.9.36
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/stemy-ngx-dynamic-form.mjs +4 -29
- package/fesm2022/stemy-ngx-dynamic-form.mjs.map +1 -1
- package/ngx-dynamic-form/common-types.d.ts +1 -1
- package/ngx-dynamic-form/ngx-dynamic-form.imports.d.ts +2 -2
- package/ngx-dynamic-form/utils/misc.d.ts +0 -12
- package/package.json +2 -2
- package/public_api.d.ts +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { InjectionToken, inject, Inject, Injectable, untracked, input, Renderer2, ElementRef, computed, signal, effect, HostBinding, Directive, Input, Optional, Pipe, Type, Component, Injector, output, ChangeDetectionStrategy, ViewEncapsulation, viewChild, makeEnvironmentProviders, NgModule } from '@angular/core';
|
|
3
3
|
import * as i2 from '@stemy/ngx-utils';
|
|
4
|
-
import { cachedFactory, ReflectUtils, ObjectUtils, LANGUAGE_SERVICE, ForbiddenZone, SetUtils, ArrayUtils, API_SERVICE, StringUtils, AsyncMethodBase, EventsService, NgxUtilsModule } from '@stemy/ngx-utils';
|
|
4
|
+
import { cachedFactory, ReflectUtils, ObjectUtils, convertToDateFormat, LANGUAGE_SERVICE, convertToDate, ForbiddenZone, SetUtils, ArrayUtils, API_SERVICE, StringUtils, AsyncMethodBase, EventsService, NgxUtilsModule } from '@stemy/ngx-utils';
|
|
5
5
|
import { of, merge, Observable, firstValueFrom, BehaviorSubject, combineLatestWith, switchMap, distinctUntilChanged, first, Subject, map, filter } from 'rxjs';
|
|
6
6
|
import { debounceTime } from 'rxjs/operators';
|
|
7
7
|
import * as i1 from '@angular/forms';
|
|
@@ -146,31 +146,6 @@ function controlStatus(control, timeout = 10) {
|
|
|
146
146
|
const changes$ = control.statusChanges.pipe(debounceTime(timeout));
|
|
147
147
|
return merge(initial$, changes$);
|
|
148
148
|
}
|
|
149
|
-
/**
|
|
150
|
-
* Convert value to a string with corrected date format (date, date-time)
|
|
151
|
-
* @param value Value to convert to date string
|
|
152
|
-
* @param format Expected date format (date, date-time)
|
|
153
|
-
*/
|
|
154
|
-
function convertToDateFormat(value, format = "date") {
|
|
155
|
-
if (!ObjectUtils.isDefined(value) || !format?.includes("date"))
|
|
156
|
-
return value;
|
|
157
|
-
value = ObjectUtils.isDate(value) ? value : new Date(value);
|
|
158
|
-
const date = isNaN(value) ? new Date() : value;
|
|
159
|
-
const target = new Date(date.getTime() - date.getTimezoneOffset() * 60000).toISOString();
|
|
160
|
-
return format === "datetime-local" || format === "date-time"
|
|
161
|
-
? target.slice(0, 16)
|
|
162
|
-
: target.slice(0, 10);
|
|
163
|
-
}
|
|
164
|
-
/**
|
|
165
|
-
* Convert value to date object with format (date, date-time)
|
|
166
|
-
* @param value Value to convert to date
|
|
167
|
-
* @param format Expected date format (date, date-time)
|
|
168
|
-
*/
|
|
169
|
-
function convertToDate(value, format = "date") {
|
|
170
|
-
return (!ObjectUtils.isDefined(value) || !format?.includes("date"))
|
|
171
|
-
? value
|
|
172
|
-
: new Date(convertToDateFormat(value, format));
|
|
173
|
-
}
|
|
174
149
|
/**
|
|
175
150
|
* Convert potential number value to an actual number
|
|
176
151
|
* @param value Value to convert to number
|
|
@@ -2240,11 +2215,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.22", ngImpo
|
|
|
2240
2215
|
|
|
2241
2216
|
class DynamicFormDateComponent extends DynamicFieldType {
|
|
2242
2217
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: DynamicFormDateComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
2243
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.22", type: DynamicFormDateComponent, isStandalone: false, selector: "dynamic-form-date", usesInheritance: true, ngImport: i0, template: "<date-picker [formControl]=\"formControl\"\n [min]=\"$any(props.min)\"\n [max]=\"$any(props.max)\"\n [disabledDays]=\"props.
|
|
2218
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.22", type: DynamicFormDateComponent, isStandalone: false, selector: "dynamic-form-date", usesInheritance: true, ngImport: i0, template: "<date-picker [formControl]=\"formControl\"\n [testId]=\"field.testId\"\n [min]=\"$any(props.min)\"\n [max]=\"$any(props.max)\"\n [disabledDays]=\"props.disabledDays\"\n [disabledDates]=\"props.disabledDates\"\n [formlyAttributes]=\"field\"></date-picker>\n", dependencies: [{ kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i2.DatePickerComponent, selector: "date-picker" }, { kind: "directive", type: i3.LegacyFormlyAttributes, selector: "[formlyAttributes]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
2244
2219
|
}
|
|
2245
2220
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: DynamicFormDateComponent, decorators: [{
|
|
2246
2221
|
type: Component,
|
|
2247
|
-
args: [{ standalone: false, selector: "dynamic-form-date", encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<date-picker [formControl]=\"formControl\"\n [min]=\"$any(props.min)\"\n [max]=\"$any(props.max)\"\n [disabledDays]=\"props.
|
|
2222
|
+
args: [{ standalone: false, selector: "dynamic-form-date", encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<date-picker [formControl]=\"formControl\"\n [testId]=\"field.testId\"\n [min]=\"$any(props.min)\"\n [max]=\"$any(props.max)\"\n [disabledDays]=\"props.disabledDays\"\n [disabledDates]=\"props.disabledDates\"\n [formlyAttributes]=\"field\"></date-picker>\n" }]
|
|
2248
2223
|
}] });
|
|
2249
2224
|
|
|
2250
2225
|
class DynamicFormEditorComponent extends DynamicFieldType {
|
|
@@ -2526,5 +2501,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.22", ngImpo
|
|
|
2526
2501
|
* Generated bundle index. Do not edit.
|
|
2527
2502
|
*/
|
|
2528
2503
|
|
|
2529
|
-
export { AsyncSubmitDirective, DEFAULT_NUMERIC_STEP, DynamicFieldType, DynamicFormAlertComponent, DynamicFormArrayComponent, DynamicFormBuilderService, DynamicFormChipsComponent, DynamicFormComponent, DynamicFormDateComponent, DynamicFormEditorComponent, DynamicFormFieldComponent, DynamicFormFieldsetComponent, DynamicFormGroupComponent, DynamicFormPasswordComponent, DynamicFormSchemaService, DynamicFormService, DynamicFormStaticComponent, DynamicFormTemplateDirective, DynamicFormTemplatePipe, DynamicFormTemplateService, DynamicFormTranslationComponent, DynamicFormUploadComponent, DynamicFormWysiwygComponent, EDITOR_TYPES, FORM_ROOT_ID, FormArray, FormDate, FormFieldSet, FormGroup, FormInput, FormSelect, FormSerializable, FormStatic, FormUpload, MAX_INPUT_NUM, MIN_INPUT_NUM, NgxDynamicFormModule, RichTranslationModel, TranslationModel, addFieldValidators, arrayLengthValidation, clearFieldArray, controlStatus, controlValues,
|
|
2504
|
+
export { AsyncSubmitDirective, DEFAULT_NUMERIC_STEP, DynamicFieldType, DynamicFormAlertComponent, DynamicFormArrayComponent, DynamicFormBuilderService, DynamicFormChipsComponent, DynamicFormComponent, DynamicFormDateComponent, DynamicFormEditorComponent, DynamicFormFieldComponent, DynamicFormFieldsetComponent, DynamicFormGroupComponent, DynamicFormPasswordComponent, DynamicFormSchemaService, DynamicFormService, DynamicFormStaticComponent, DynamicFormTemplateDirective, DynamicFormTemplatePipe, DynamicFormTemplateService, DynamicFormTranslationComponent, DynamicFormUploadComponent, DynamicFormWysiwygComponent, EDITOR_TYPES, FORM_ROOT_ID, FormArray, FormDate, FormFieldSet, FormGroup, FormInput, FormSelect, FormSerializable, FormStatic, FormUpload, MAX_INPUT_NUM, MIN_INPUT_NUM, NgxDynamicFormModule, RichTranslationModel, TranslationModel, addFieldValidators, arrayLengthValidation, clearFieldArray, controlStatus, controlValues, convertToNumber, customizeFormField, emailValidation, enumValidation, equalsValidation, getFieldByPath, getFieldsByKey, getFieldsByPredicate, getSelectOptions, insertToFieldArray, isFieldHidden, isFieldVisible, jsonValidation, maxLengthValidation, maxValueValidation, minLengthValidation, minValueValidation, phoneValidation, removeFieldValidators, removeFromFieldArray, replaceFieldArray, replaceSpecialChars, requiredValidation, setFieldDefault, setFieldDisabled, setFieldHidden, setFieldHooks, setFieldMinDate, setFieldProp, setFieldProps, setFieldSerialize, setFieldValue, translationValidation };
|
|
2530
2505
|
//# sourceMappingURL=stemy-ngx-dynamic-form.mjs.map
|