@stemy/ngx-utils 19.2.24 → 19.3.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 +27 -27
- package/assets/ng.mjs +5 -5
- package/fesm2022/stemy-ngx-utils-tools.mjs.map +1 -1
- package/fesm2022/stemy-ngx-utils.mjs +462 -319
- package/fesm2022/stemy-ngx-utils.mjs.map +1 -1
- package/ng.mjs +5 -5
- package/ngx-utils/components/dropdown-box/dropdown-box.component.d.ts +55 -0
- package/ngx-utils/components/dynamic-table/dynamic-table.component.d.ts +1 -1
- package/ngx-utils/components/pagination-menu/pagination-menu.component.d.ts +1 -8
- package/ngx-utils/directives/async-method.base.d.ts +1 -1
- package/ngx-utils/directives/dropdown-content.directive.d.ts +15 -6
- package/ngx-utils/directives/dropdown.directive.d.ts +26 -4
- package/ngx-utils/ngx-utils.imports.d.ts +1 -1
- package/ngx-utils/ngx-utils.module.d.ts +9 -8
- package/ngx-utils/utils/file-system.d.ts +5 -5
- package/ngx-utils/utils/misc.d.ts +1 -0
- package/package.json +10 -9
- package/public_api.d.ts +1 -0
package/README.md
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
# NgxUtils
|
|
2
|
-
|
|
3
|
-
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.7.3.
|
|
4
|
-
|
|
5
|
-
## Development server
|
|
6
|
-
|
|
7
|
-
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
|
|
8
|
-
|
|
9
|
-
## Code scaffolding
|
|
10
|
-
|
|
11
|
-
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
|
|
12
|
-
|
|
13
|
-
## Build
|
|
14
|
-
|
|
15
|
-
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.
|
|
16
|
-
|
|
17
|
-
## Running unit tests
|
|
18
|
-
|
|
19
|
-
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
|
20
|
-
|
|
21
|
-
## Running end-to-end tests
|
|
22
|
-
|
|
23
|
-
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
|
|
24
|
-
|
|
25
|
-
## Further help
|
|
26
|
-
|
|
27
|
-
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
|
|
1
|
+
# NgxUtils
|
|
2
|
+
|
|
3
|
+
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.7.3.
|
|
4
|
+
|
|
5
|
+
## Development server
|
|
6
|
+
|
|
7
|
+
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
|
|
8
|
+
|
|
9
|
+
## Code scaffolding
|
|
10
|
+
|
|
11
|
+
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
|
|
12
|
+
|
|
13
|
+
## Build
|
|
14
|
+
|
|
15
|
+
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.
|
|
16
|
+
|
|
17
|
+
## Running unit tests
|
|
18
|
+
|
|
19
|
+
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
|
20
|
+
|
|
21
|
+
## Running end-to-end tests
|
|
22
|
+
|
|
23
|
+
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
|
|
24
|
+
|
|
25
|
+
## Further help
|
|
26
|
+
|
|
27
|
+
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
|
package/assets/ng.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { register } from "node:module";
|
|
2
|
-
import { pathToFileURL } from "node:url";
|
|
3
|
-
|
|
4
|
-
register("ts-node/esm", pathToFileURL("./"));
|
|
5
|
-
import "@angular/cli/bin/ng.js";
|
|
1
|
+
import { register } from "node:module";
|
|
2
|
+
import { pathToFileURL } from "node:url";
|
|
3
|
+
|
|
4
|
+
register("ts-node/esm", pathToFileURL("./"));
|
|
5
|
+
import "@angular/cli/bin/ng.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stemy-ngx-utils-tools.mjs","sources":["../../tools/config.ts","../../tools/stemy-ngx-utils-tools.ts"],"sourcesContent":["export function isPrimitive(value: any): boolean {\
|
|
1
|
+
{"version":3,"file":"stemy-ngx-utils-tools.mjs","sources":["../../tools/config.ts","../../tools/stemy-ngx-utils-tools.ts"],"sourcesContent":["export function isPrimitive(value: any): boolean {\n const type = typeof value;\n return value == null || (type !== \"object\" && type !== \"function\");\n}\n\nexport function isDate(value: any): value is Date {\n return null !== value && !isNaN(value) && \"undefined\" !== typeof value.getDate;\n}\n\nexport interface IEnvironmentAlternatives {\n [name: string]: string[]\n}\n\nfunction convertValue(value: any, type: string): any {\n switch (type) {\n case \"boolean\":\n value = typeof value == \"string\" ? value.toLowerCase() : value;\n return (value == \"no\" || value == \"false\" || value == \"0\") ? false : !!value;\n case \"number\":\n const val = parseFloat(value);\n return isNaN(val) ? 0 : val;\n }\n return value;\n}\n\nfunction getFromEnv(path: string, alternatives: IEnvironmentAlternatives, value: any): any {\n const name = path.replace(/\\.?([A-Z|0-9]+)/g, function (x,y){\n return \"_\" + y.toLowerCase()\n }).replace(/\\./gi, \"_\").replace(/^_/, \"\").toUpperCase();\n const alts = Array.from(alternatives[name] || []);\n alts.unshift(name);\n for (const envName of alts) {\n const envValue = process.env[envName];\n if (typeof envValue !== \"undefined\") {\n const val = convertValue(envValue, typeof value);\n console.log(name, envName, val);\n return convertValue(envValue, typeof value);\n }\n }\n console.log(name, value);\n return value;\n}\n\nfunction createConfigRecursive(target: any, source: any, path: string, alternatives: IEnvironmentAlternatives): any {\n if (isPrimitive(source) || isDate(source)) {\n return getFromEnv(path, alternatives, source);\n }\n if (Array.isArray(source)) {\n target = Array.isArray(target) ? Array.from(target) : [];\n source.forEach((item, index) => {\n if (target.length > index)\n target[index] = createConfigRecursive(target[index], item, !path ? `${index}` : `${path}.${index}`, alternatives);\n else\n target.push(createConfigRecursive(null, item, !path ? `${index}` : `${path}.${index}`, alternatives));\n });\n return target;\n }\n return Object.keys(source).reduce((result, key) => {\n result[key] = createConfigRecursive(result[key], source[key], !path ? `${key}` : `${path}.${key}`, alternatives);\n return result;\n }, Object.assign({}, target));\n}\n\nexport function parseConfig(config: any): any {\n if (typeof config == \"string\") {\n try {\n config = JSON.parse(config);\n } catch (e) {\n return {};\n }\n }\n return config;\n}\n\nexport function createConfig(config: any, alternatives?: IEnvironmentAlternatives): any {\n alternatives = alternatives || {};\n console.log(\"Parsing config...\");\n return createConfigRecursive(null, parseConfig(config), \"\", alternatives);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":"AAAM,SAAU,WAAW,CAAC,KAAU,EAAA;AAClC,IAAA,MAAM,IAAI,GAAG,OAAO,KAAK;AACzB,IAAA,OAAO,KAAK,IAAI,IAAI,KAAK,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,UAAU,CAAC;AACtE;AAEM,SAAU,MAAM,CAAC,KAAU,EAAA;AAC7B,IAAA,OAAO,IAAI,KAAK,KAAK,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,WAAW,KAAK,OAAO,KAAK,CAAC,OAAO;AAClF;AAMA,SAAS,YAAY,CAAC,KAAU,EAAE,IAAY,EAAA;IAC1C,QAAQ,IAAI;AACR,QAAA,KAAK,SAAS;AACV,YAAA,KAAK,GAAG,OAAO,KAAK,IAAI,QAAQ,GAAG,KAAK,CAAC,WAAW,EAAE,GAAG,KAAK;YAC9D,OAAO,CAAC,KAAK,IAAI,IAAI,IAAI,KAAK,IAAI,OAAO,IAAI,KAAK,IAAI,GAAG,IAAI,KAAK,GAAG,CAAC,CAAC,KAAK;AAChF,QAAA,KAAK,QAAQ;AACT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