-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(options): adds parsing of options (#9)
* refactor: adds lodash typing * refactor: simplifies layout service This commit reworks the logic in layout service in order to make it easier to understand. The inital logic was pulled from angular-json-schema-form, but was proving to be difficult to follow as more functioanlity was added. This will hopefully break up the code a bit and make it more readable and maintainable * feat(options): formalized layout options Merges a few schema props into layout options as well as copying extra layout layout props into layout options. Mimics angular-json-schema-form * feat(options): add standard form options * refactor: adds additional use cases * docs: Adds missing docs * test: Add test cases for create * refactor: code cleanup * chore: update package lock
- Loading branch information
Showing
25 changed files
with
1,302 additions
and
631 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
{ | ||
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json", | ||
"dest": "../../dist/ngx-json-schema-form", | ||
"lib": { | ||
"entryFile": "src/public-api.ts", | ||
"umdModuleIds": { | ||
"lodash": "_", | ||
"ajv": "Ajv", | ||
"json-schema-traverse": "traverse" | ||
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json", | ||
"dest": "../../dist/ngx-json-schema-form", | ||
"lib": { | ||
"entryFile": "src/public-api.ts", | ||
"umdModuleIds": { | ||
"ajv": "Ajv", | ||
"json-schema-traverse": "traverse", | ||
"lodash": "_", | ||
"lodash-decorators": "lodashDecorators" | ||
} | ||
} | ||
} | ||
} |
8 changes: 7 additions & 1 deletion
8
projects/ngx-json-schema-form/src/lib/json-schema-form.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 10 additions & 22 deletions
32
projects/ngx-json-schema-form/src/lib/layout-item.data.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,19 @@ | ||
export interface LayoutBase { | ||
/** Name for the item. Will be used as the input[name] */ | ||
name?: string; | ||
} | ||
export interface LayoutNode extends LayoutBase { | ||
/** Unique Identifier for the item */ | ||
id: string; | ||
/** JSON path for accessing data for this layout item */ | ||
dataPointer?: string; | ||
/** Options for */ | ||
options: any; | ||
/** Type of widget is used to represent the data */ | ||
type: string; | ||
/** TODO */ | ||
// $ref?: any; | ||
// arrayItem?; | ||
// arrayItemType?; | ||
// dataType?; | ||
// items?: Array<any>; | ||
// recursiveReference?; | ||
} | ||
/** */ | ||
export interface LayoutItem extends LayoutBase { | ||
export interface LayoutItem { | ||
/** Object path to map this item to a data value */ | ||
key?: string; | ||
/** Name for the item. Will be used as the input[name] */ | ||
name?: string; | ||
/** | ||
* Container for options to set on widgets. | ||
* NOTE: this is optional as any undeclared property will automatically be put into an options contianer | ||
*/ | ||
options?: {[others: string]: any}; | ||
/** | ||
* Specify what type of widget is used to represent the data. | ||
* If not is specified, the JSON Schema will be used to determine the most appropriate widget | ||
*/ | ||
type?: string; | ||
|
||
[others: string]: any; | ||
} |
Oops, something went wrong.