Skip to content

Commit

Permalink
renamed class GlobalFunctions to PEGlobalFunctions
Browse files Browse the repository at this point in the history
  • Loading branch information
heinerwalter committed Nov 2, 2023
1 parent 341d001 commit f76cbe0
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 40 deletions.
41 changes: 13 additions & 28 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
"version": "1.0.0",
"license": "MIT",
"description": "An Angular library containing simple input components and a property editor component which automatically builds a form for editing all properties of any object.",
"keywords": ["angular", "bootstrap", "input"],
"keywords": [
"angular",
"bootstrap",
"input"
],
"author": "Heiner Walter",
"repository": {
"type": "git",
Expand All @@ -30,7 +34,7 @@
"@angular/platform-browser-dynamic": "^16.2.0",
"@angular/router": "^16.2.0",
"bootstrap": "^5.3.2",
"ngx-property-editor": "file:projects/ngx-property-editor",
"ngx-property-editor": "^0.0.4",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.13.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Component, EventEmitter, Input, Output } from '@angular/core';
import { GlobalFunctions } from '../../global-functions';
import { PEGlobalFunctions } from '../../global-functions';

@Component({
template: '',
})
export class InputBase {

/** ID attribute of the input element (required if a label is defined). */
@Input() id: string = GlobalFunctions.generateRandomId();
@Input() id: string = PEGlobalFunctions.generateRandomId();
/** Name attribute of the input element. */
@Input() name: string | undefined = undefined;
/** If not empty a label is displayed at the top of this form group. */
Expand Down Expand Up @@ -82,15 +82,15 @@ export class InputBaseWithValueAndDataSource<TValue, TDataSource = any> extends
* @param item An item of the `dataSource`.
*/
evaluateValuePropertyName(item: { [key: string]: any }): any {
return GlobalFunctions.evaluateValuePropertyName(this.valuePropertyName, item);
return PEGlobalFunctions.evaluateValuePropertyName(this.valuePropertyName, item);
}

/**
* Evaluates the `displayPropertyName` on the given data source item.
* @param item An item of the `dataSource`.
*/
evaluateDisplayPropertyName(item: { [key: string]: any }): string {
return GlobalFunctions.evaluateDisplayPropertyName(this.displayPropertyName, item);
return PEGlobalFunctions.evaluateDisplayPropertyName(this.displayPropertyName, item);
}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component, Input } from '@angular/core';
import { GlobalFunctions } from '../../../global-functions';
import { PEGlobalFunctions } from '../../../global-functions';
import { PropertyConfiguration } from '../property-configuration';

@Component({
Expand All @@ -10,7 +10,7 @@ import { PropertyConfiguration } from '../property-configuration';
export class PropertyInputComponent {

/** ID attribute of the input element. */
id: string = GlobalFunctions.generateRandomId();
id: string = PEGlobalFunctions.generateRandomId();

/**
* Configuration of the displayed property including name, data type, displayed value etc.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core';
import { PropertiesConfiguration, PropertyConfiguration } from '../property-configuration';
import { TableData } from '../table-configuration';
import { GlobalFunctions } from '../../../global-functions';
import { PEGlobalFunctions } from '../../../global-functions';

/**
* This component displays all property values of any object in a table
Expand Down Expand Up @@ -76,8 +76,8 @@ export class PropertyTableComponent implements OnInit, OnChanges {
property.valuePropertyName != property.displayPropertyName) {
const dataSource = property.getDataSource(this.data);
if (dataSource) {
const item = GlobalFunctions.getDataSourceItem(dataSource, property.valuePropertyName, propertyValue);
const itemValue = GlobalFunctions.evaluateDisplayPropertyName(property.displayPropertyName, item);
const item = PEGlobalFunctions.getDataSourceItem(dataSource, property.valuePropertyName, propertyValue);
const itemValue = PEGlobalFunctions.evaluateDisplayPropertyName(property.displayPropertyName, item);
if (itemValue)
propertyValue = itemValue;
}
Expand Down
2 changes: 1 addition & 1 deletion projects/ngx-property-editor/src/lib/global-functions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export class GlobalFunctions {
export class PEGlobalFunctions {

/**
* Generates a new randim ID for components which don't have an assigned ID.
Expand Down

0 comments on commit f76cbe0

Please sign in to comment.