ngx-material-entity 0.1.3 → 1.0.0
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/README.md +914 -336
- package/capsulation/lodash.utilities.d.ts +62 -0
- package/capsulation/reflect.utilities.d.ts +56 -0
- package/classes/{base-builder.class.d.ts → base.builder.d.ts} +2 -1
- package/classes/date.utilities.d.ts +70 -0
- package/classes/entity.model.d.ts +20 -0
- package/classes/entity.service.d.ts +108 -0
- package/classes/{entity-utilities.class.d.ts → entity.utilities.d.ts} +52 -16
- package/classes/file.utilities.d.ts +52 -0
- package/components/confirm-dialog/confirm-dialog-data.builder.d.ts +1 -1
- package/components/input/add-array-item-dialog-data.builder.d.ts +4 -4
- package/components/input/add-array-item-dialog-data.d.ts +2 -2
- package/components/input/array/array-date-input/array-date-input.component.d.ts +11 -0
- package/components/input/array/array-date-range-input/array-date-range-input.component.d.ts +20 -0
- package/components/input/array/array-date-time-input/array-date-time-input.component.d.ts +22 -0
- package/components/input/array/array-string-autocomplete-chips/array-string-autocomplete-chips.component.d.ts +51 -0
- package/components/input/array/array-string-chips-input/array-string-chips-input.component.d.ts +44 -0
- package/components/input/array/array-table.class.d.ts +49 -0
- package/components/input/base-input.component.d.ts +31 -0
- package/components/input/boolean/boolean-checkbox-input/boolean-checkbox-input.component.d.ts +10 -0
- package/components/input/boolean/boolean-dropdown-input/boolean-dropdown-input.component.d.ts +9 -0
- package/components/input/boolean/boolean-toggle-input/boolean-toggle-input.component.d.ts +10 -0
- package/components/input/custom/custom.component.d.ts +13 -0
- package/components/input/date/date-input/date-input.component.d.ts +13 -0
- package/components/input/date/date-range-input/date-range-input.component.d.ts +20 -0
- package/components/input/date/date-time-input/date-time-input.component.d.ts +31 -0
- package/components/input/file/file-default-input/file-default-input.component.d.ts +13 -0
- package/components/input/file/file-image-input/file-image-input.component.d.ts +22 -0
- package/components/input/file/file-input/dragDrop.directive.d.ts +32 -0
- package/components/input/file/file-input/file-input.component.d.ts +32 -0
- package/components/input/input.component.d.ts +49 -73
- package/components/input/input.module.d.ts +38 -15
- package/components/input/number/number-dropdown-input/number-dropdown-input.component.d.ts +9 -0
- package/components/input/number/number-input/number-input.component.d.ts +9 -0
- package/components/input/string/string-autocomplete-input/string-autocomplete-input.component.d.ts +18 -0
- package/components/input/string/string-dropdown-input/string-dropdown-input.component.d.ts +9 -0
- package/components/input/string/string-input/string-input.component.d.ts +9 -0
- package/components/input/string/string-textbox-input/string-textbox-input.component.d.ts +9 -0
- package/components/table/create-dialog/create-dialog-data.builder.d.ts +1 -1
- package/components/table/create-dialog/create-entity-dialog-data.builder.d.ts +5 -5
- package/components/table/create-dialog/create-entity-dialog-data.d.ts +3 -3
- package/components/table/create-dialog/create-entity-dialog.component.d.ts +9 -5
- package/components/table/edit-dialog/edit-dialog-data.builder.d.ts +4 -4
- package/components/table/edit-dialog/edit-entity-dialog-data.d.ts +3 -3
- package/components/table/edit-dialog/edit-entity-dialog.builder.d.ts +5 -5
- package/components/table/edit-dialog/edit-entity-dialog.component.d.ts +7 -5
- package/components/table/table-data.builder.d.ts +9 -9
- package/components/table/table-data.d.ts +8 -8
- package/components/table/table.component.d.ts +2 -2
- package/decorators/array/array-decorator-internal.data.d.ts +72 -7
- package/decorators/array/array-decorator.data.d.ts +179 -13
- package/decorators/array/array.decorator.d.ts +3 -3
- package/decorators/base/base-property.decorator.d.ts +2 -3
- package/decorators/base/decorator-types.enum.d.ts +15 -4
- package/decorators/base/dropdown-value.interface.d.ts +14 -0
- package/decorators/custom/custom-decorator-internal.data.d.ts +17 -0
- package/decorators/custom/custom-decorator.data.d.ts +33 -0
- package/decorators/custom/custom.decorator.d.ts +11 -0
- package/decorators/date/date-decorator-internal.data.d.ts +44 -0
- package/decorators/date/date-decorator.data.d.ts +129 -0
- package/decorators/date/date.decorator.d.ts +8 -0
- package/decorators/file/file-decorator-internal.data.d.ts +92 -0
- package/decorators/file/file-decorator.data.d.ts +92 -0
- package/decorators/file/file.decorator.d.ts +9 -0
- package/decorators/number/number-decorator-internal.data.d.ts +2 -4
- package/decorators/number/number-decorator.data.d.ts +2 -4
- package/decorators/number/number.decorator.d.ts +2 -2
- package/decorators/object/object-decorator-internal.data.d.ts +3 -3
- package/decorators/object/object-decorator.data.d.ts +5 -5
- package/decorators/object/object.decorator.d.ts +2 -2
- package/decorators/string/string-decorator-internal.data.d.ts +2 -4
- package/decorators/string/string-decorator.data.d.ts +2 -4
- package/esm2020/capsulation/lodash.utilities.mjs +75 -0
- package/esm2020/capsulation/reflect.utilities.mjs +69 -0
- package/esm2020/classes/base.builder.mjs +42 -0
- package/esm2020/classes/date.utilities.mjs +158 -0
- package/esm2020/classes/entity.model.mjs +23 -0
- package/esm2020/classes/entity.service.mjs +180 -0
- package/esm2020/classes/entity.utilities.mjs +686 -0
- package/esm2020/classes/file.utilities.mjs +123 -0
- package/esm2020/components/confirm-dialog/confirm-dialog-data.builder.mjs +5 -5
- package/esm2020/components/confirm-dialog/confirm-dialog.component.mjs +3 -3
- package/esm2020/components/input/add-array-item-dialog-data.builder.mjs +4 -4
- package/esm2020/components/input/add-array-item-dialog-data.mjs +1 -1
- package/esm2020/components/input/array/array-date-input/array-date-input.component.mjs +26 -0
- package/esm2020/components/input/array/array-date-range-input/array-date-range-input.component.mjs +50 -0
- package/esm2020/components/input/array/array-date-time-input/array-date-time-input.component.mjs +50 -0
- package/esm2020/components/input/array/array-string-autocomplete-chips/array-string-autocomplete-chips.component.mjs +119 -0
- package/esm2020/components/input/array/array-string-chips-input/array-string-chips-input.component.mjs +104 -0
- package/esm2020/components/input/array/array-table.class.mjs +107 -0
- package/esm2020/components/input/base-input.component.mjs +39 -0
- package/esm2020/components/input/boolean/boolean-checkbox-input/boolean-checkbox-input.component.mjs +23 -0
- package/esm2020/components/input/boolean/boolean-dropdown-input/boolean-dropdown-input.component.mjs +17 -0
- package/esm2020/components/input/boolean/boolean-toggle-input/boolean-toggle-input.component.mjs +23 -0
- package/esm2020/components/input/custom/custom.component.mjs +25 -0
- package/esm2020/components/input/date/date-input/date-input.component.mjs +23 -0
- package/esm2020/components/input/date/date-range-input/date-range-input.component.mjs +51 -0
- package/esm2020/components/input/date/date-time-input/date-time-input.component.mjs +63 -0
- package/esm2020/components/input/file/file-default-input/file-default-input.component.mjs +24 -0
- package/esm2020/components/input/file/file-image-input/file-image-input.component.mjs +79 -0
- package/esm2020/components/input/file/file-input/dragDrop.directive.mjs +64 -0
- package/esm2020/components/input/file/file-input/file-input.component.mjs +152 -0
- package/esm2020/components/input/input.component.mjs +143 -179
- package/esm2020/components/input/input.module.mjs +76 -6
- package/esm2020/components/input/number/number-dropdown-input/number-dropdown-input.component.mjs +18 -0
- package/esm2020/components/input/number/number-input/number-input.component.mjs +16 -0
- package/esm2020/components/input/string/string-autocomplete-input/string-autocomplete-input.component.mjs +37 -0
- package/esm2020/components/input/string/string-dropdown-input/string-dropdown-input.component.mjs +18 -0
- package/esm2020/components/input/string/string-input/string-input.component.mjs +16 -0
- package/esm2020/components/input/string/string-textbox-input/string-textbox-input.component.mjs +17 -0
- package/esm2020/components/table/create-dialog/create-dialog-data.builder.mjs +3 -3
- package/esm2020/components/table/create-dialog/create-entity-dialog-data.builder.mjs +2 -2
- package/esm2020/components/table/create-dialog/create-entity-dialog-data.mjs +1 -1
- package/esm2020/components/table/create-dialog/create-entity-dialog.component.mjs +16 -9
- package/esm2020/components/table/edit-dialog/edit-dialog-data.builder.mjs +3 -3
- package/esm2020/components/table/edit-dialog/edit-entity-dialog-data.mjs +1 -1
- package/esm2020/components/table/edit-dialog/edit-entity-dialog.builder.mjs +3 -3
- package/esm2020/components/table/edit-dialog/edit-entity-dialog.component.mjs +19 -11
- package/esm2020/components/table/table-data.builder.mjs +4 -4
- package/esm2020/components/table/table-data.mjs +1 -1
- package/esm2020/components/table/table.component.mjs +21 -23
- package/esm2020/decorators/array/array-decorator-internal.data.mjs +102 -14
- package/esm2020/decorators/array/array-decorator.data.mjs +2 -2
- package/esm2020/decorators/array/array.decorator.mjs +8 -2
- package/esm2020/decorators/base/base-property.decorator.mjs +4 -3
- package/esm2020/decorators/base/decorator-types.enum.mjs +10 -1
- package/esm2020/decorators/base/dropdown-value.interface.mjs +2 -0
- package/esm2020/decorators/base/property-decorator-internal.data.mjs +10 -10
- package/esm2020/decorators/base/property-decorator.data.mjs +1 -1
- package/esm2020/decorators/boolean/boolean-decorator-internal.data.mjs +3 -3
- package/esm2020/decorators/custom/custom-decorator-internal.data.mjs +26 -0
- package/esm2020/decorators/custom/custom-decorator.data.mjs +2 -0
- package/esm2020/decorators/custom/custom.decorator.mjs +13 -0
- package/esm2020/decorators/date/date-decorator-internal.data.mjs +48 -0
- package/esm2020/decorators/date/date-decorator.data.mjs +7 -0
- package/esm2020/decorators/date/date.decorator.mjs +21 -0
- package/esm2020/decorators/file/file-decorator-internal.data.mjs +98 -0
- package/esm2020/decorators/file/file-decorator.data.mjs +7 -0
- package/esm2020/decorators/file/file.decorator.mjs +22 -0
- package/esm2020/decorators/number/number-decorator-internal.data.mjs +1 -1
- package/esm2020/decorators/number/number-decorator.data.mjs +1 -1
- package/esm2020/decorators/number/number.decorator.mjs +3 -3
- package/esm2020/decorators/object/object-decorator-internal.data.mjs +2 -2
- package/esm2020/decorators/object/object-decorator.data.mjs +1 -1
- package/esm2020/decorators/object/object.decorator.mjs +1 -1
- package/esm2020/decorators/string/string-decorator-internal.data.mjs +1 -1
- package/esm2020/decorators/string/string-decorator.data.mjs +1 -1
- package/esm2020/decorators/string/string.decorator.mjs +1 -1
- package/esm2020/mocks/placeholder-data.png.mjs +3 -0
- package/esm2020/public-api.mjs +15 -5
- package/fesm2015/ngx-material-entity.mjs +2649 -422
- package/fesm2015/ngx-material-entity.mjs.map +1 -1
- package/fesm2020/ngx-material-entity.mjs +2537 -397
- package/fesm2020/ngx-material-entity.mjs.map +1 -1
- package/mocks/placeholder-data.png.d.ts +1 -0
- package/package.json +7 -1
- package/public-api.d.ts +15 -4
- package/classes/entity-model.class.d.ts +0 -9
- package/classes/entity-service.class.d.ts +0 -66
- package/esm2020/classes/base-builder.class.mjs +0 -43
- package/esm2020/classes/entity-model.class.mjs +0 -19
- package/esm2020/classes/entity-service.class.mjs +0 -76
- package/esm2020/classes/entity-utilities.class.mjs +0 -377
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Dictionary, Many, ValueKeyIteratee } from 'lodash';
|
|
2
|
+
/**
|
|
3
|
+
* Encapsulates all functionality of lodash.
|
|
4
|
+
*/
|
|
5
|
+
export declare abstract class LodashUtilities {
|
|
6
|
+
/**
|
|
7
|
+
* Performs a deep comparison between two values to determine if they are
|
|
8
|
+
* equivalent.
|
|
9
|
+
*
|
|
10
|
+
* **Note:** This method supports comparing arrays, array buffers, booleans,
|
|
11
|
+
* date objects, error objects, maps, numbers, `Object` objects, regexps,
|
|
12
|
+
* sets, strings, symbols, and typed arrays. `Object` objects are compared
|
|
13
|
+
* by their own, not inherited, enumerable properties. Functions and DOM
|
|
14
|
+
* nodes are **not** supported.
|
|
15
|
+
*
|
|
16
|
+
* @param value - The value to compare.
|
|
17
|
+
* @param other - The other value to compare.
|
|
18
|
+
* @returns Returns `true` if the values are equivalent, else `false`.
|
|
19
|
+
*/
|
|
20
|
+
static isEqual(value: unknown, other: unknown): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* This method is like _.clone except that it recursively clones value.
|
|
23
|
+
*
|
|
24
|
+
* @param value - The value to recursively clone.
|
|
25
|
+
* @returns Returns the deep cloned value.
|
|
26
|
+
*/
|
|
27
|
+
static cloneDeep<T>(value: T): T;
|
|
28
|
+
/**
|
|
29
|
+
* The opposite of `_.pick`; this method creates an object composed of the
|
|
30
|
+
* own and inherited enumerable properties of `object` that are not omitted.
|
|
31
|
+
*
|
|
32
|
+
* @param object - The source object.
|
|
33
|
+
* @param paths - The property names to omit, specified
|
|
34
|
+
* individually or in arrays.
|
|
35
|
+
* @returns Returns the new object.
|
|
36
|
+
*/
|
|
37
|
+
static omit<T extends object, K extends keyof T>(object: T | null | undefined, ...paths: Many<K>[]): Omit<T, K>;
|
|
38
|
+
/**
|
|
39
|
+
* Checks if `value` is `null` or `undefined`.
|
|
40
|
+
*
|
|
41
|
+
* @param value - The value to check.
|
|
42
|
+
* @returns Returns `true` if `value` is nullish, else `false`.
|
|
43
|
+
*/
|
|
44
|
+
static isNil(value: unknown): value is null | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* The opposite of `_.pickBy`; this method creates an object composed of the
|
|
47
|
+
* own and inherited enumerable properties of `object` that `predicate`
|
|
48
|
+
* doesn't return truthy for.
|
|
49
|
+
*
|
|
50
|
+
* @param object - The source object.
|
|
51
|
+
* @param predicate - The function invoked per property.
|
|
52
|
+
* @returns Returns the new object.
|
|
53
|
+
*/
|
|
54
|
+
static omitBy<T>(object: Dictionary<T> | null | undefined, predicate?: ValueKeyIteratee<T>): Dictionary<T>;
|
|
55
|
+
/**
|
|
56
|
+
* Checks if value is classified as an Array object.
|
|
57
|
+
*
|
|
58
|
+
* @param value - The value to check.
|
|
59
|
+
* @returns Returns true if value is correctly classified, else false.
|
|
60
|
+
*/
|
|
61
|
+
static isArray(value?: unknown): value is unknown[];
|
|
62
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Encapsulates all functionality of Reflect.
|
|
3
|
+
*/
|
|
4
|
+
export declare abstract class ReflectUtilities {
|
|
5
|
+
/**
|
|
6
|
+
* Gets the metadata value for the provided metadata key on the target object or its prototype chain.
|
|
7
|
+
*
|
|
8
|
+
* @param metadataKey - A key used to store and retrieve metadata.
|
|
9
|
+
* @param target - The target object on which the metadata is defined.
|
|
10
|
+
* @param propertyKey - The property key for the target.
|
|
11
|
+
* @returns The metadata value for the metadata key if found; otherwise, undefined.
|
|
12
|
+
*/
|
|
13
|
+
static getMetadata<T extends object>(metadataKey: string, target: T, propertyKey: keyof T): unknown;
|
|
14
|
+
/**
|
|
15
|
+
* Returns the string and symbol keys of the own properties of an object. The own properties of an object
|
|
16
|
+
* are those that are defined directly on that object, and are not inherited from the object's prototype.
|
|
17
|
+
*
|
|
18
|
+
* @param target - Object that contains the own properties.
|
|
19
|
+
* @returns The keys of the given object.
|
|
20
|
+
*/
|
|
21
|
+
static ownKeys<T extends object>(target: T): (keyof T)[];
|
|
22
|
+
/**
|
|
23
|
+
* Gets the property of target, equivalent to `target[propertyKey]`.
|
|
24
|
+
*
|
|
25
|
+
* @param target - Object that contains the property on itself or in its prototype chain.
|
|
26
|
+
* @param propertyKey - The property name.
|
|
27
|
+
* @returns The property of the target of the given key.
|
|
28
|
+
*/
|
|
29
|
+
static get<T extends object>(target: T, propertyKey: keyof T): unknown;
|
|
30
|
+
/**
|
|
31
|
+
* Sets the property of target, equivalent to `target[propertyKey] = value`.
|
|
32
|
+
*
|
|
33
|
+
* @param target - Object that contains the property on itself or in its prototype chain.
|
|
34
|
+
* @param propertyKey - The property name.
|
|
35
|
+
* @param value - The value to set the property to.
|
|
36
|
+
* @returns If setting the value was successful.
|
|
37
|
+
*/
|
|
38
|
+
static set<T extends object>(target: T, propertyKey: keyof T, value: unknown): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Equivalent to `propertyKey in target`.
|
|
41
|
+
*
|
|
42
|
+
* @param target - Object that contains the property on itself or in its prototype chain.
|
|
43
|
+
* @param propertyKey - Name of the property.
|
|
44
|
+
* @returns Whether or not the given target has the key.
|
|
45
|
+
*/
|
|
46
|
+
static has<T extends object>(target: T, propertyKey: keyof T): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Define a unique metadata entry on the target.
|
|
49
|
+
*
|
|
50
|
+
* @param metadataKey - A key used to store and retrieve metadata.
|
|
51
|
+
* @param metadataValue - A value that contains attached metadata.
|
|
52
|
+
* @param target - The target object on which to define metadata.
|
|
53
|
+
* @param propertyKey - The property key for the target.
|
|
54
|
+
*/
|
|
55
|
+
static defineMetadata<T extends object>(metadataKey: unknown, metadataValue: unknown, target: T, propertyKey: string): void;
|
|
56
|
+
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { BaseEntityType } from './entity.model';
|
|
1
2
|
/**
|
|
2
3
|
* The abstract BaseBuilder class.
|
|
3
4
|
*/
|
|
4
|
-
export declare abstract class BaseBuilder<InternalType extends InputType, InputType extends
|
|
5
|
+
export declare abstract class BaseBuilder<InternalType extends InputType, InputType extends BaseEntityType<InputType>> {
|
|
5
6
|
private readonly data;
|
|
6
7
|
private readonly inputData?;
|
|
7
8
|
protected constructor(data?: InputType);
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Time } from '@angular/common';
|
|
2
|
+
import { DateFilterFn } from '@angular/material/datepicker';
|
|
3
|
+
import { DropdownValue } from '../decorators/base/dropdown-value.interface';
|
|
4
|
+
/**
|
|
5
|
+
* Valid steps from one time value to the next. Needs to be able to divide 60 minutes without remainder.
|
|
6
|
+
*/
|
|
7
|
+
declare type MinuteSteps = 1 | 2 | 3 | 4 | 5 | 6 | 10 | 12 | 15 | 20 | 30 | 60;
|
|
8
|
+
/**
|
|
9
|
+
* Contains Helper Functions for handling date properties.
|
|
10
|
+
*/
|
|
11
|
+
export declare abstract class DateUtilities {
|
|
12
|
+
/**
|
|
13
|
+
* The default filter function to user when none was provided by the user.
|
|
14
|
+
*/
|
|
15
|
+
static defaultDateFilter: DateFilterFn<Date | null | undefined>;
|
|
16
|
+
/**
|
|
17
|
+
* Gets the given value as a date value.
|
|
18
|
+
*
|
|
19
|
+
* @param value - The value to get as a date.
|
|
20
|
+
* @returns The given value as a date.
|
|
21
|
+
*/
|
|
22
|
+
static asDate(value: unknown): Date;
|
|
23
|
+
/**
|
|
24
|
+
* Gets the default times used by the DateTime picker when nothing is specified by the user.
|
|
25
|
+
*
|
|
26
|
+
* @param format - The time format. Defaults to 24.
|
|
27
|
+
* @param minuteSteps - The steps from one time value to the next. Defaults to 30.
|
|
28
|
+
* @returns Times in the 24 hour format from 0:00 until 23:30 in 30 minute steps.
|
|
29
|
+
*/
|
|
30
|
+
static getDefaultTimes(format?: 12 | 24, minuteSteps?: MinuteSteps): DropdownValue<Time>[];
|
|
31
|
+
private static getTimeDropdownValue;
|
|
32
|
+
private static getFormattedHour;
|
|
33
|
+
private static getFormattedMinute;
|
|
34
|
+
/**
|
|
35
|
+
* Gets the Time object from the given date.
|
|
36
|
+
*
|
|
37
|
+
* @param value - The date to get the time object from.
|
|
38
|
+
* @returns The Time object build from the date value.
|
|
39
|
+
*/
|
|
40
|
+
static getTimeFromDate(value: Date): Time | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Gets the dates between the two given gates. Does additional filtering based on the provided DateRange metadata.
|
|
43
|
+
*
|
|
44
|
+
* @param startDate - The start date.
|
|
45
|
+
* @param endDate - The end date.
|
|
46
|
+
* @param filter - The custom filter from the metadata.
|
|
47
|
+
* @returns All dates between the two provided dates. Includes start and end date.
|
|
48
|
+
*/
|
|
49
|
+
static getDatesBetween(startDate: Date, endDate: Date, filter?: DateFilterFn<Date>): Date[];
|
|
50
|
+
/**
|
|
51
|
+
* Get all valid times for the dropdown of a datetime property.
|
|
52
|
+
*
|
|
53
|
+
* @param date - The date of the datetime.
|
|
54
|
+
* @param times - All given times to filter.
|
|
55
|
+
* @param min - The function that defines the minimum time.
|
|
56
|
+
* @param max - The function that defines the maximum time.
|
|
57
|
+
* @param filter - A filter function to do more specific time filtering. This could be e.g. The removal of lunch breaks.
|
|
58
|
+
* @returns All valid dropdown values for the datetime property.
|
|
59
|
+
*/
|
|
60
|
+
static getValidTimesForDropdown(date: Date, times: DropdownValue<Time>[], min?: (date?: Date) => Time, max?: (date?: Date) => Time, filter?: ((time: Time) => boolean) | (() => boolean)): DropdownValue<Time>[];
|
|
61
|
+
/**
|
|
62
|
+
* Checks if the time object has processable hours and minutes properties.
|
|
63
|
+
* Doesn't check custom validators like min/max from the metadata configuration.
|
|
64
|
+
*
|
|
65
|
+
* @param time - The time to check.
|
|
66
|
+
* @returns Whether or not the time object is unprocessable.
|
|
67
|
+
*/
|
|
68
|
+
static timeIsUnprocessable(time?: Time): boolean;
|
|
69
|
+
}
|
|
70
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The newable type used whenever an entity class is passed to create an entity and initialize its metadata.
|
|
3
|
+
*/
|
|
4
|
+
export declare type EntityClassNewable<EntityType extends BaseEntityType<EntityType>> = new (data?: EntityType) => EntityType;
|
|
5
|
+
/**
|
|
6
|
+
* The Generic Base EntityType.
|
|
7
|
+
*/
|
|
8
|
+
export declare type BaseEntityType<T> = {
|
|
9
|
+
[K in keyof T]: unknown;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* A base Entity class with a builtin id.
|
|
13
|
+
*/
|
|
14
|
+
export declare abstract class Entity {
|
|
15
|
+
/**
|
|
16
|
+
* A unique identifier for the Entity.
|
|
17
|
+
*/
|
|
18
|
+
id: string;
|
|
19
|
+
constructor(entity?: Entity);
|
|
20
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { HttpClient } from '@angular/common/http';
|
|
2
|
+
import { BehaviorSubject } from 'rxjs';
|
|
3
|
+
import { BaseEntityType } from './entity.model';
|
|
4
|
+
/**
|
|
5
|
+
* A generic EntityService class.
|
|
6
|
+
* Offers basic CRUD-functionality.
|
|
7
|
+
* You should create a service for every Entity you have.
|
|
8
|
+
* If you extend from this you need to make sure that the extended Service can be injected.
|
|
9
|
+
*/
|
|
10
|
+
export declare abstract class EntityService<EntityType extends BaseEntityType<EntityType>> {
|
|
11
|
+
private readonly http;
|
|
12
|
+
/**
|
|
13
|
+
* The base url used for api requests. If u want to have more control over this,
|
|
14
|
+
* you can override the create, read, update and delete methods.
|
|
15
|
+
*
|
|
16
|
+
* Create Sends a POST-Request to baseUrl.
|
|
17
|
+
*
|
|
18
|
+
* Read Sends a GET-Request to baseUrl.
|
|
19
|
+
*
|
|
20
|
+
* Update Sends a PATCH-Request to baseUrl/{id}.
|
|
21
|
+
*
|
|
22
|
+
* Delete Sends a DEL-Request to baseUrl/{id}.
|
|
23
|
+
*/
|
|
24
|
+
abstract readonly baseUrl: string;
|
|
25
|
+
/**
|
|
26
|
+
* The key which holds the id value.
|
|
27
|
+
*
|
|
28
|
+
* @default 'id'
|
|
29
|
+
*/
|
|
30
|
+
readonly idKey: keyof EntityType;
|
|
31
|
+
/**
|
|
32
|
+
* A subject of all the entity values.
|
|
33
|
+
* Can be subscribed to when you want to do a specific thing whenever the entities change.
|
|
34
|
+
*/
|
|
35
|
+
readonly entitiesSubject: BehaviorSubject<EntityType[]>;
|
|
36
|
+
/**
|
|
37
|
+
* Gets the entities in an array from the internal entitiesSubject.
|
|
38
|
+
*
|
|
39
|
+
* @returns The current entities in form of an array.
|
|
40
|
+
*/
|
|
41
|
+
get entities(): EntityType[];
|
|
42
|
+
constructor(http: HttpClient);
|
|
43
|
+
/**
|
|
44
|
+
* Creates a new Entity and pushes it to the entities array.
|
|
45
|
+
*
|
|
46
|
+
* @param entity - The data of the entity to create.
|
|
47
|
+
* All values that should be omitted will be removed from it inside this method.
|
|
48
|
+
* @returns A Promise of the created entity.
|
|
49
|
+
*/
|
|
50
|
+
create(entity: EntityType): Promise<EntityType>;
|
|
51
|
+
/**
|
|
52
|
+
* Creates the entity with form data when the entity contains files in contrast to creating it with a normal json body.
|
|
53
|
+
* All file values are stored inside their respective property key and their name.
|
|
54
|
+
* Form data is able to handle setting multiple files to the same key.
|
|
55
|
+
*
|
|
56
|
+
* @param body - The body Of the request.
|
|
57
|
+
* @param filePropertyKeys - All property keys that are files and need to be added to the form data.
|
|
58
|
+
* @param entity - The entity to create. This is needed in addition to the body because the body doesn't contain any metadata.
|
|
59
|
+
* @returns The created entity from the server.
|
|
60
|
+
*/
|
|
61
|
+
protected createWithFormData(body: Partial<EntityType>, filePropertyKeys: (keyof EntityType)[], entity: EntityType): Promise<EntityType>;
|
|
62
|
+
/**
|
|
63
|
+
* Creates the entity with a normal json body in contrast to creating it with form data when the entity contains files.
|
|
64
|
+
*
|
|
65
|
+
* @param body - The body Of the request.
|
|
66
|
+
* @returns The created entity from the server.
|
|
67
|
+
*/
|
|
68
|
+
protected createWithJson(body: Partial<EntityType>): Promise<EntityType>;
|
|
69
|
+
/**
|
|
70
|
+
* Gets all existing entities and pushes them to the entities array.
|
|
71
|
+
*
|
|
72
|
+
* @returns A Promise of all received Entities.
|
|
73
|
+
*/
|
|
74
|
+
read(): Promise<EntityType[]>;
|
|
75
|
+
/**
|
|
76
|
+
* Updates a specific Entity.
|
|
77
|
+
*
|
|
78
|
+
* @param entity - The updated Entity
|
|
79
|
+
* All values that should be omitted will be removed from it inside this method.
|
|
80
|
+
* @param entityPriorChanges - The current Entity.
|
|
81
|
+
* It Is used to get changed values and only update them instead of sending the whole entity data.
|
|
82
|
+
*/
|
|
83
|
+
update(entity: EntityType, entityPriorChanges: EntityType): Promise<void>;
|
|
84
|
+
/**
|
|
85
|
+
* Updates the entity with form data when the entity contains files in contrast to creating it with a normal json body.
|
|
86
|
+
* All file values are stored inside their respective property key and their name.
|
|
87
|
+
* Form data is able to handle setting multiple files to the same key.
|
|
88
|
+
*
|
|
89
|
+
* @param body - The request body. Already contains only properties that have changed.
|
|
90
|
+
* @param filePropertyKeys - The keys of all properties which are files and need to separately be appended to the form data.
|
|
91
|
+
* @param entity - The original entity. Is needed to get the metadata of all the files.
|
|
92
|
+
* @param id - The id of the entity to update.
|
|
93
|
+
*/
|
|
94
|
+
protected updateWithFormData(body: Partial<EntityType>, filePropertyKeys: (keyof EntityType)[], entity: EntityType, id: EntityType[keyof EntityType]): Promise<void>;
|
|
95
|
+
/**
|
|
96
|
+
* Updates the entity with a normal json body in contrast to updating it with form data when the entity contains files.
|
|
97
|
+
*
|
|
98
|
+
* @param body - The body of the Request. Has already removed all unnecessary values.
|
|
99
|
+
* @param id - The id of the entity to update.
|
|
100
|
+
*/
|
|
101
|
+
protected updateWithJson(body: Partial<EntityType>, id: EntityType[keyof EntityType]): Promise<void>;
|
|
102
|
+
/**
|
|
103
|
+
* Deletes a specific Entity.
|
|
104
|
+
*
|
|
105
|
+
* @param entity - The entity to delete.
|
|
106
|
+
*/
|
|
107
|
+
delete(entity: EntityType): Promise<void>;
|
|
108
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DecoratorType, DecoratorTypes } from '../decorators/base/decorator-types.enum';
|
|
2
|
-
import {
|
|
2
|
+
import { PropertyDecoratorConfigInternal } from '../decorators/base/property-decorator-internal.data';
|
|
3
|
+
import { BaseEntityType } from './entity.model';
|
|
3
4
|
/**
|
|
4
5
|
* Contains HelperMethods around handling Entities and their property-metadata.
|
|
5
6
|
*/
|
|
@@ -10,14 +11,22 @@ export declare abstract class EntityUtilities {
|
|
|
10
11
|
* @param entity - The entity to get the properties which should be left out for updating from.
|
|
11
12
|
* @returns The properties which should be left out for updating an Entity.
|
|
12
13
|
*/
|
|
13
|
-
static getOmitForUpdate<EntityType extends
|
|
14
|
+
static getOmitForUpdate<EntityType extends BaseEntityType<EntityType>>(entity: EntityType): (keyof EntityType)[];
|
|
14
15
|
/**
|
|
15
16
|
* Gets the properties to omit when creating new entities.
|
|
16
17
|
*
|
|
17
18
|
* @param entity - The entity to get the properties which should be left out for creating from.
|
|
18
19
|
* @returns The properties which should be left out for creating a new Entity.
|
|
19
20
|
*/
|
|
20
|
-
static getOmitForCreate<EntityType extends
|
|
21
|
+
static getOmitForCreate<EntityType extends BaseEntityType<EntityType>>(entity: EntityType): (keyof EntityType)[];
|
|
22
|
+
/**
|
|
23
|
+
* Gets all properties on the given entity which are files.
|
|
24
|
+
*
|
|
25
|
+
* @param entity - The entity to check for file properties.
|
|
26
|
+
* @param omit - Whether to leave out values that are omitted for create or delete.
|
|
27
|
+
* @returns The keys of all file properties on the given entity.
|
|
28
|
+
*/
|
|
29
|
+
static getFileProperties<EntityType extends BaseEntityType<EntityType>>(entity: EntityType, omit?: 'create' | 'update'): (keyof EntityType)[];
|
|
21
30
|
/**
|
|
22
31
|
* Gets the metadata included in an property.
|
|
23
32
|
*
|
|
@@ -27,7 +36,7 @@ export declare abstract class EntityUtilities {
|
|
|
27
36
|
* @returns The metadata of the property.
|
|
28
37
|
* @throws When no metadata can be found for the given property.
|
|
29
38
|
*/
|
|
30
|
-
static getPropertyMetadata<EntityType extends
|
|
39
|
+
static getPropertyMetadata<EntityType extends BaseEntityType<EntityType>, T extends DecoratorTypes, CustomMetadataType extends Record<string, unknown>>(entity: EntityType, propertyKey: keyof EntityType, type?: T): DecoratorType<T, CustomMetadataType>;
|
|
31
40
|
/**
|
|
32
41
|
* Gets the type of the property-metadata.
|
|
33
42
|
*
|
|
@@ -36,7 +45,7 @@ export declare abstract class EntityUtilities {
|
|
|
36
45
|
* @returns The type of the metadata.
|
|
37
46
|
* @throws Will throw an error if no metadata can be found for the given property.
|
|
38
47
|
*/
|
|
39
|
-
static getPropertyType<EntityType extends
|
|
48
|
+
static getPropertyType<EntityType extends BaseEntityType<EntityType>>(entity: EntityType, propertyKey: keyof EntityType): DecoratorTypes;
|
|
40
49
|
/**
|
|
41
50
|
* Sets all property values based on a given entity data-object.
|
|
42
51
|
*
|
|
@@ -46,7 +55,7 @@ export declare abstract class EntityUtilities {
|
|
|
46
55
|
* @alias build
|
|
47
56
|
* @alias construct
|
|
48
57
|
*/
|
|
49
|
-
static new<EntityType extends
|
|
58
|
+
static new<EntityType extends BaseEntityType<EntityType>>(target: EntityType, entity?: EntityType): void;
|
|
50
59
|
static construct: typeof EntityUtilities.new;
|
|
51
60
|
static build: typeof EntityUtilities.new;
|
|
52
61
|
/**
|
|
@@ -57,7 +66,7 @@ export declare abstract class EntityUtilities {
|
|
|
57
66
|
* @param omit - Whether to check for creating or editing validity.
|
|
58
67
|
* @returns Whether or not the entity is valid.
|
|
59
68
|
*/
|
|
60
|
-
static isEntityValid<EntityType extends
|
|
69
|
+
static isEntityValid<EntityType extends BaseEntityType<EntityType>>(entity: EntityType, omit: 'create' | 'update'): boolean;
|
|
61
70
|
/**
|
|
62
71
|
* Checks if a single property value is valid.
|
|
63
72
|
*
|
|
@@ -68,6 +77,14 @@ export declare abstract class EntityUtilities {
|
|
|
68
77
|
* @throws Throws when it extracts an unknown metadata type.
|
|
69
78
|
*/
|
|
70
79
|
private static isPropertyValid;
|
|
80
|
+
private static isBooleanValid;
|
|
81
|
+
private static isStringValid;
|
|
82
|
+
private static isTextboxValid;
|
|
83
|
+
private static isNumberValid;
|
|
84
|
+
private static isDateValid;
|
|
85
|
+
private static isDateRangeValid;
|
|
86
|
+
private static isDateTimeValid;
|
|
87
|
+
private static isFileDataValid;
|
|
71
88
|
/**
|
|
72
89
|
* Checks if an entity is "dirty" (if its values have changed).
|
|
73
90
|
*
|
|
@@ -75,7 +92,8 @@ export declare abstract class EntityUtilities {
|
|
|
75
92
|
* @param entityPriorChanges - The entity before the changes.
|
|
76
93
|
* @returns Whether or not the entity is dirty.
|
|
77
94
|
*/
|
|
78
|
-
static dirty(entity:
|
|
95
|
+
static dirty<EntityType extends BaseEntityType<EntityType>>(entity: EntityType, entityPriorChanges: EntityType): Promise<boolean>;
|
|
96
|
+
private static differencesForDirty;
|
|
79
97
|
/**
|
|
80
98
|
* Compares two Entities and returns their difference in an object.
|
|
81
99
|
*
|
|
@@ -83,16 +101,34 @@ export declare abstract class EntityUtilities {
|
|
|
83
101
|
* @param entityPriorChanges - The second entity to compare.
|
|
84
102
|
* @returns The difference between the two Entities in form of a Partial.
|
|
85
103
|
*/
|
|
86
|
-
static difference<EntityType extends
|
|
104
|
+
static difference<EntityType extends BaseEntityType<EntityType>>(entity: EntityType, entityPriorChanges: EntityType): Promise<Partial<EntityType>>;
|
|
105
|
+
/**
|
|
106
|
+
* Checks if two given values are equal.
|
|
107
|
+
* It uses the isEqual method from LodashUtilities and extends it with functionality regarding Dates.
|
|
108
|
+
*
|
|
109
|
+
* @param value - The updated value.
|
|
110
|
+
* @param valuePriorChanges - The value before any changes.
|
|
111
|
+
* @param metadata - The metadata of the property.
|
|
112
|
+
* @param type - The type of the property.
|
|
113
|
+
* @returns Whether or not the given values are equal.
|
|
114
|
+
*/
|
|
115
|
+
static isEqual(value: unknown, valuePriorChanges: unknown, metadata: PropertyDecoratorConfigInternal, type: DecoratorTypes): Promise<boolean>;
|
|
116
|
+
private static isEqualArrayDate;
|
|
117
|
+
private static isEqualArrayDateRange;
|
|
118
|
+
private static isEqualDateTime;
|
|
119
|
+
private static isEqualDate;
|
|
120
|
+
private static isEqualDateRange;
|
|
121
|
+
private static isEqualFile;
|
|
122
|
+
private static isEqualCustom;
|
|
87
123
|
/**
|
|
88
124
|
* Compare function for sorting entity keys by their order value.
|
|
89
125
|
*
|
|
90
126
|
* @param a - First key of entity.
|
|
91
127
|
* @param b - Second key of entity.
|
|
92
128
|
* @param entity - Current entity (used to get metadata of entity keys).
|
|
93
|
-
* @returns 0 if both values have the same order, a negative value if
|
|
129
|
+
* @returns 0 if both values have the same order, a negative value if 'a' comes before 'b', a positive value if 'a' comes behind 'b'.
|
|
94
130
|
*/
|
|
95
|
-
static compareOrder<EntityType extends
|
|
131
|
+
static compareOrder<EntityType extends BaseEntityType<EntityType>>(a: keyof EntityType, b: keyof EntityType, entity: EntityType): number;
|
|
96
132
|
/**
|
|
97
133
|
* Gets the bootstrap column values for "lg", "md", "sm".
|
|
98
134
|
*
|
|
@@ -101,14 +137,14 @@ export declare abstract class EntityUtilities {
|
|
|
101
137
|
* @param type - Defines for which screen size the column values should be returned.
|
|
102
138
|
* @returns Bootstrap column value.
|
|
103
139
|
*/
|
|
104
|
-
static getWidth<EntityType extends
|
|
140
|
+
static getWidth<EntityType extends BaseEntityType<EntityType>>(entity: EntityType, key: keyof EntityType, type: 'lg' | 'md' | 'sm'): number;
|
|
105
141
|
/**
|
|
106
142
|
* Resets all changes on an entity.
|
|
107
143
|
*
|
|
108
144
|
* @param entity - The entity to reset.
|
|
109
145
|
* @param entityPriorChanges - The entity before any changes.
|
|
110
146
|
*/
|
|
111
|
-
static resetChangesOnEntity<EntityType extends
|
|
147
|
+
static resetChangesOnEntity<EntityType extends BaseEntityType<EntityType>>(entity: EntityType, entityPriorChanges: EntityType): void;
|
|
112
148
|
/**
|
|
113
149
|
* Gets the rows that are used to display the given entity.
|
|
114
150
|
*
|
|
@@ -117,7 +153,7 @@ export declare abstract class EntityUtilities {
|
|
|
117
153
|
* @param hideOmitForEdit - Whether or not keys with the metadata omitForUpdate should be filtered out.
|
|
118
154
|
* @returns The sorted Rows containing the row number and the keys to display in that row.
|
|
119
155
|
*/
|
|
120
|
-
static getEntityRows<EntityType extends
|
|
156
|
+
static getEntityRows<EntityType extends BaseEntityType<EntityType>>(entity: EntityType, hideOmitForCreate?: boolean, hideOmitForEdit?: boolean): EntityRow<EntityType>[];
|
|
121
157
|
private static getKeysForRow;
|
|
122
158
|
private static getNumberOfRows;
|
|
123
159
|
/**
|
|
@@ -128,12 +164,12 @@ export declare abstract class EntityUtilities {
|
|
|
128
164
|
* @param hideOmitForEdit - Whether or not keys with the metadata omitForUpdate should be filtered out.
|
|
129
165
|
* @returns An array of keys of the entity.
|
|
130
166
|
*/
|
|
131
|
-
static keysOf<EntityType extends
|
|
167
|
+
static keysOf<EntityType extends BaseEntityType<EntityType>>(entity: EntityType, hideOmitForCreate?: boolean, hideOmitForEdit?: boolean): (keyof EntityType)[];
|
|
132
168
|
}
|
|
133
169
|
/**
|
|
134
170
|
* A row that contains all the information about how to display an entity.
|
|
135
171
|
*/
|
|
136
|
-
export interface EntityRow<EntityType extends
|
|
172
|
+
export interface EntityRow<EntityType extends BaseEntityType<EntityType>> {
|
|
137
173
|
/**
|
|
138
174
|
* The row in which this should be displayed.
|
|
139
175
|
*/
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { FileDataWithFile } from '../decorators/file/file-decorator-internal.data';
|
|
2
|
+
import { FileData } from '../decorators/file/file-decorator.data';
|
|
3
|
+
/**
|
|
4
|
+
* Provides functionality regarding files.
|
|
5
|
+
*/
|
|
6
|
+
export declare abstract class FileUtilities {
|
|
7
|
+
/**
|
|
8
|
+
* Gets the accept value for the html input.
|
|
9
|
+
*
|
|
10
|
+
* @param mimeTypes - The mimeTypes to get the accept string from.
|
|
11
|
+
* @returns A comma separated string of all the provided mime types.
|
|
12
|
+
*/
|
|
13
|
+
static getAcceptString(mimeTypes?: string[]): string;
|
|
14
|
+
/**
|
|
15
|
+
* Reads a url to display the given file.
|
|
16
|
+
*
|
|
17
|
+
* @param file - The file to get the url from.
|
|
18
|
+
* @returns A promise of the url. Undefined if no file was provided.
|
|
19
|
+
*/
|
|
20
|
+
static getDataURLFromFile(file?: Blob): Promise<string | undefined>;
|
|
21
|
+
/**
|
|
22
|
+
* Gets a file from the given url.
|
|
23
|
+
*
|
|
24
|
+
* @param url - The url to get the file from.
|
|
25
|
+
* @returns A promise of the File.
|
|
26
|
+
*/
|
|
27
|
+
private static getFileFromUrl;
|
|
28
|
+
/**
|
|
29
|
+
* Gets the file data with the blob from the given File Data.
|
|
30
|
+
*
|
|
31
|
+
* @param data - The File Data to get the file data with blob from.
|
|
32
|
+
* @returns FileDataWithFile.
|
|
33
|
+
*/
|
|
34
|
+
static getFileData(data: FileData): Promise<FileDataWithFile>;
|
|
35
|
+
/**
|
|
36
|
+
* Checks if the given file has a valid mime type.
|
|
37
|
+
*
|
|
38
|
+
* @param type - The type of the file to check.
|
|
39
|
+
* @param allowedMimeTypes - The allowed mime types.
|
|
40
|
+
* @returns Whether or not the given file has a valid mime type.
|
|
41
|
+
*/
|
|
42
|
+
static isMimeTypeValid(type: string, allowedMimeTypes: string[]): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Transform the given value to Megabytes.
|
|
45
|
+
*
|
|
46
|
+
* @param value - The original value.
|
|
47
|
+
* @param unit - If the value is B, KB or GB.
|
|
48
|
+
* @returns The given value as bytes.
|
|
49
|
+
*/
|
|
50
|
+
static transformToMegaBytes(value: number, unit: 'B' | 'KB' | 'GB'): number;
|
|
51
|
+
private static transformToBytes;
|
|
52
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseBuilder } from '../../classes/base
|
|
1
|
+
import { BaseBuilder } from '../../classes/base.builder';
|
|
2
2
|
import { ConfirmDialogData, ConfirmDialogTypes } from './confirm-dialog-data';
|
|
3
3
|
/**
|
|
4
4
|
* The internal ConfirmDialogData. Requires all default values the user can leave out.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { NgModel } from '@angular/forms';
|
|
2
|
-
import { BaseBuilder } from '../../classes/base
|
|
3
|
-
import {
|
|
2
|
+
import { BaseBuilder } from '../../classes/base.builder';
|
|
3
|
+
import { BaseEntityType } from '../../classes/entity.model';
|
|
4
4
|
import { CreateDialogDataInternal } from '../table/create-dialog/create-dialog-data.builder';
|
|
5
5
|
import { AddArrayItemDialogData } from './add-array-item-dialog-data';
|
|
6
6
|
/**
|
|
7
7
|
* The internal AddArrayItemDialogData. Requires all default values the user can leave out.
|
|
8
8
|
*/
|
|
9
|
-
export declare class AddArrayItemDialogDataInternal<EntityType extends
|
|
9
|
+
export declare class AddArrayItemDialogDataInternal<EntityType extends BaseEntityType<EntityType>> implements AddArrayItemDialogData<EntityType> {
|
|
10
10
|
entity: EntityType;
|
|
11
11
|
createDialogData: CreateDialogDataInternal;
|
|
12
12
|
getValidationErrorMessage: (model: NgModel) => string;
|
|
@@ -15,7 +15,7 @@ export declare class AddArrayItemDialogDataInternal<EntityType extends Entity> i
|
|
|
15
15
|
/**
|
|
16
16
|
* The Builder for the AddArrayItemDialogData. Sets default values.
|
|
17
17
|
*/
|
|
18
|
-
export declare class AddArrayItemDialogDataBuilder<EntityType extends
|
|
18
|
+
export declare class AddArrayItemDialogDataBuilder<EntityType extends BaseEntityType<EntityType>> extends BaseBuilder<AddArrayItemDialogDataInternal<EntityType>, AddArrayItemDialogData<EntityType>> {
|
|
19
19
|
constructor(data: AddArrayItemDialogData<EntityType>);
|
|
20
20
|
protected generateBaseData(data: AddArrayItemDialogData<EntityType>): AddArrayItemDialogDataInternal<EntityType>;
|
|
21
21
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { NgModel } from '@angular/forms';
|
|
2
|
-
import {
|
|
2
|
+
import { BaseEntityType } from '../../classes/entity.model';
|
|
3
3
|
import { CreateDialogData } from '../table/table-data';
|
|
4
4
|
/**
|
|
5
5
|
* The configuration options for the dialog that adds items to an array.
|
|
6
6
|
*/
|
|
7
|
-
export interface AddArrayItemDialogData<EntityType extends
|
|
7
|
+
export interface AddArrayItemDialogData<EntityType extends BaseEntityType<EntityType>> {
|
|
8
8
|
/**
|
|
9
9
|
* An empty entity that is used as the data model.
|
|
10
10
|
*/
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { DateUtilities } from '../../../../classes/date.utilities';
|
|
3
|
+
import { ArrayTableComponent } from '../array-table.class';
|
|
4
|
+
import { BaseEntityType } from '../../../../classes/entity.model';
|
|
5
|
+
import { DecoratorTypes } from '../../../../decorators/base/decorator-types.enum';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export declare class ArrayDateInputComponent<EntityType extends BaseEntityType<EntityType>> extends ArrayTableComponent<Date, EntityType, DecoratorTypes.ARRAY_DATE> implements OnInit {
|
|
8
|
+
DateUtilities: typeof DateUtilities;
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ArrayDateInputComponent<any>, never>;
|
|
10
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ArrayDateInputComponent<any>, "array-date-input", never, {}, {}, never, never>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { BaseEntityType } from '../../../../classes/entity.model';
|
|
3
|
+
import { DateUtilities } from '../../../../classes/date.utilities';
|
|
4
|
+
import { DateRange } from '../../../../decorators/date/date-decorator.data';
|
|
5
|
+
import { ArrayTableComponent } from '../array-table.class';
|
|
6
|
+
import { DecoratorTypes } from '../../../../decorators/base/decorator-types.enum';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
export declare class ArrayDateRangeInputComponent<EntityType extends BaseEntityType<EntityType>> extends ArrayTableComponent<DateRange, EntityType, DecoratorTypes.ARRAY_DATE_RANGE> implements OnInit {
|
|
9
|
+
DateUtilities: typeof DateUtilities;
|
|
10
|
+
dateRangeStart?: Date;
|
|
11
|
+
dateRangeEnd?: Date;
|
|
12
|
+
ngOnInit(): void;
|
|
13
|
+
/**
|
|
14
|
+
* Adds a DateRange to the array.
|
|
15
|
+
*/
|
|
16
|
+
addDateRange(): void;
|
|
17
|
+
protected resetInput(): void;
|
|
18
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ArrayDateRangeInputComponent<any>, never>;
|
|
19
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ArrayDateRangeInputComponent<any>, "array-date-range-input", never, {}, {}, never, never>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { DateUtilities } from '../../../../classes/date.utilities';
|
|
3
|
+
import { ArrayTableComponent } from '../array-table.class';
|
|
4
|
+
import { Time } from '@angular/common';
|
|
5
|
+
import { DropdownValue } from '../../../../decorators/base/dropdown-value.interface';
|
|
6
|
+
import { BaseEntityType } from '../../../../classes/entity.model';
|
|
7
|
+
import { DecoratorTypes } from '../../../../decorators/base/decorator-types.enum';
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
export declare class ArrayDateTimeInputComponent<EntityType extends BaseEntityType<EntityType>> extends ArrayTableComponent<Date, EntityType, DecoratorTypes.ARRAY_DATE_TIME> implements OnInit {
|
|
10
|
+
DateUtilities: typeof DateUtilities;
|
|
11
|
+
dateTime?: Date;
|
|
12
|
+
time?: Time;
|
|
13
|
+
timeDropdownValues: DropdownValue<Time>[];
|
|
14
|
+
ngOnInit(): void;
|
|
15
|
+
protected resetInput(): void;
|
|
16
|
+
/**
|
|
17
|
+
* Adds a date time to the array.
|
|
18
|
+
*/
|
|
19
|
+
addDateTime(): void;
|
|
20
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ArrayDateTimeInputComponent<any>, never>;
|
|
21
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ArrayDateTimeInputComponent<any>, "array-date-time-input", never, {}, {}, never, never>;
|
|
22
|
+
}
|