@guajiritos/general-autocomplete 0.1.8 → 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 +0 -1
- package/esm2022/lib/guachos-general-autocomplete.component.mjs +36 -56
- package/esm2022/public-api.mjs +2 -3
- package/esm2022/utils/constants/constants.mjs +11 -0
- package/esm2022/utils/pipes/resolve-property-path.pipe.mjs +17 -61
- package/esm2022/utils/services/utils.service.mjs +8 -31
- package/fesm2022/guajiritos-general-autocomplete.mjs +57 -511
- package/fesm2022/guajiritos-general-autocomplete.mjs.map +1 -1
- package/lib/guachos-general-autocomplete.component.d.ts +5 -17
- package/package.json +8 -7
- package/public-api.d.ts +1 -2
- package/utils/constants/{contacts.d.ts → constants.d.ts} +1 -1
- package/utils/pipes/resolve-property-path.pipe.d.ts +9 -18
- package/utils/services/utils.service.d.ts +4 -16
- package/esm2022/utils/constants/contacts.mjs +0 -10
- package/esm2022/utils/interfaces/interfaces.mjs +0 -12
- package/esm2022/utils/pipes/duration.pipe.mjs +0 -18
- package/esm2022/utils/pipes/humanize-duration.pipe.mjs +0 -17
- package/esm2022/utils/pipes/i18n-field.pipe.mjs +0 -28
- package/esm2022/utils/pipes/ida-return.pipe.mjs +0 -23
- package/esm2022/utils/pipes/pipes.module.mjs +0 -84
- package/esm2022/utils/pipes/show-roles.pipe.mjs +0 -24
- package/esm2022/utils/pipes/show-segments.pipe.mjs +0 -24
- package/esm2022/utils/pipes/show-transport-types.pipe.mjs +0 -24
- package/esm2022/utils/services/autocomplete.service.mjs +0 -161
- package/utils/interfaces/interfaces.d.ts +0 -39
- package/utils/pipes/duration.pipe.d.ts +0 -8
- package/utils/pipes/humanize-duration.pipe.d.ts +0 -7
- package/utils/pipes/i18n-field.pipe.d.ts +0 -7
- package/utils/pipes/ida-return.pipe.d.ts +0 -8
- package/utils/pipes/pipes.module.d.ts +0 -15
- package/utils/pipes/show-roles.pipe.d.ts +0 -8
- package/utils/pipes/show-segments.pipe.d.ts +0 -8
- package/utils/pipes/show-transport-types.pipe.d.ts +0 -8
- package/utils/services/autocomplete.service.d.ts +0 -15
@@ -2,47 +2,24 @@ import { Injectable } from '@angular/core';
|
|
2
2
|
import * as i0 from "@angular/core";
|
3
3
|
export class UtilsService {
|
4
4
|
/**
|
5
|
-
*
|
5
|
+
* Resolves the value of a property in an object by providing a path.
|
6
6
|
*
|
7
|
-
* @param
|
8
|
-
* @
|
7
|
+
* @param {any} obj - The object to traverse.
|
8
|
+
* @param {string[]} path - An array of strings representing the path to the desired property.
|
9
|
+
* @return {any} The value of the property at the given path, or null if the path is invalid.
|
9
10
|
*/
|
10
|
-
static getTime(time) {
|
11
|
-
const hours = parseInt(Number(time) / 3600 + '', 10);
|
12
|
-
time = Number(time) - (hours * 3600);
|
13
|
-
const minutes = parseInt(Number(time) / 60 + '', 10);
|
14
|
-
return { hours, minutes };
|
15
|
-
}
|
16
|
-
/**
|
17
|
-
* Devuelve el tiempo en formato 'hh:mm'
|
18
|
-
*
|
19
|
-
* @param time - Tiempo
|
20
|
-
*/
|
21
|
-
static getTimePretty(time) {
|
22
|
-
const { hours, minutes } = UtilsService.getTime(time);
|
23
|
-
return (hours < 10 ? '0' + hours : hours) + ':' + (minutes < 10 ? '0' + minutes : minutes);
|
24
|
-
}
|
25
|
-
/**
|
26
|
-
* Devuelve el tiempo en formato 'hhh : mmm'
|
27
|
-
*
|
28
|
-
* @param time - Tiempo
|
29
|
-
*/
|
30
|
-
static humanizeDuration(time) {
|
31
|
-
const { hours, minutes } = UtilsService.getTime(time);
|
32
|
-
return (hours < 10 ? '0' + hours : hours) + 'h : ' + (minutes < 10 ? '0' + minutes : minutes) + 'm';
|
33
|
-
}
|
34
11
|
static resolvePropertyByPath(obj, path) {
|
35
12
|
return path.reduce((prev, curr) => {
|
36
13
|
return prev ? prev[curr] : null;
|
37
14
|
}, obj || self);
|
38
15
|
}
|
39
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.
|
40
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.
|
16
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UtilsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
17
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UtilsService, providedIn: 'root' }); }
|
41
18
|
}
|
42
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
19
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UtilsService, decorators: [{
|
43
20
|
type: Injectable,
|
44
21
|
args: [{
|
45
22
|
providedIn: 'root'
|
46
23
|
}]
|
47
24
|
}] });
|
48
|
-
//# sourceMappingURL=data:application/json;base64,
|
25
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2d1YWNob3MtZ2VuZXJhbC1hdXRvY29tcGxldGUvc3JjL3V0aWxzL3NlcnZpY2VzL3V0aWxzLnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFDLFVBQVUsRUFBQyxNQUFNLGVBQWUsQ0FBQzs7QUFLekMsTUFBTSxPQUFPLFlBQVk7SUFDckI7Ozs7OztPQU1HO0lBQ0ksTUFBTSxDQUFDLHFCQUFxQixDQUFDLEdBQVEsRUFBRSxJQUFjO1FBQ3hELE9BQU8sSUFBSSxDQUFDLE1BQU0sQ0FBQyxDQUFDLElBQUksRUFBRSxJQUFZLEVBQUUsRUFBRTtZQUN0QyxPQUFPLElBQUksQ0FBQyxDQUFDL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