@skyux/inline-form 7.0.0 → 7.1.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/documentation.json +3 -3
- package/package.json +3 -3
package/documentation.json
CHANGED
|
@@ -1087,7 +1087,7 @@
|
|
|
1087
1087
|
{
|
|
1088
1088
|
"fileName": "inline-form-demo.component.ts",
|
|
1089
1089
|
"filePath": "/projects/inline-form/documentation/code-examples/inline-form/basic/inline-form-demo.component.ts",
|
|
1090
|
-
"rawContents": "import { Component
|
|
1090
|
+
"rawContents": "import { Component } from '@angular/core';\nimport { FormBuilder, FormControl, FormGroup } from '@angular/forms';\nimport {\n SkyInlineFormButtonLayout,\n SkyInlineFormCloseArgs,\n SkyInlineFormConfig,\n} from '@skyux/inline-form';\n\n@Component({\n selector: 'app-inline-form-demo',\n templateUrl: './inline-form-demo.component.html',\n})\nexport class InlineFormDemoComponent {\n public firstName = 'Jane';\n\n public myForm: FormGroup;\n\n public inlineFormConfig: SkyInlineFormConfig = {\n buttonLayout: SkyInlineFormButtonLayout.SaveCancel,\n };\n\n public showForm = false;\n\n constructor(formBuilder: FormBuilder) {\n this.myForm = formBuilder.group({\n myFirstName: new FormControl(),\n });\n }\n\n public onInlineFormClose(args: SkyInlineFormCloseArgs): void {\n if (args.reason === 'save') {\n this.firstName = this.myForm.get('myFirstName')?.value;\n }\n\n this.showForm = false;\n this.myForm.patchValue({\n myFirstName: undefined,\n });\n }\n\n public onInlineFormOpen(): void {\n this.showForm = true;\n this.myForm.patchValue({\n myFirstName: this.firstName,\n });\n }\n}\n"
|
|
1091
1091
|
},
|
|
1092
1092
|
{
|
|
1093
1093
|
"fileName": "inline-form-demo.module.ts",
|
|
@@ -1102,7 +1102,7 @@
|
|
|
1102
1102
|
{
|
|
1103
1103
|
"fileName": "inline-form-demo.component.ts",
|
|
1104
1104
|
"filePath": "/projects/inline-form/documentation/code-examples/inline-form/custom-buttons/inline-form-demo.component.ts",
|
|
1105
|
-
"rawContents": "import { Component, OnInit } from '@angular/core';\nimport { FormBuilder, FormControl, FormGroup } from '@angular/forms';\nimport {\n SkyInlineFormButtonLayout,\n SkyInlineFormCloseArgs,\n SkyInlineFormConfig,\n} from '@skyux/inline-form';\n\n@Component({\n selector: 'app-inline-form-demo',\n templateUrl: './inline-form-demo.component.html',\n})\nexport class InlineFormDemoComponent implements OnInit {\n public firstName = 'Jane';\n\n public myForm: FormGroup;\n\n public inlineFormConfig: SkyInlineFormConfig = {\n buttonLayout: SkyInlineFormButtonLayout.Custom,\n buttons: [\n {\n action: 'save',\n text: 'Save',\n styleType: 'primary',\n },\n {\n action: 'delete',\n text: 'Delete',\n styleType: 'default',\n },\n {\n action: 'reset',\n text: 'Reset',\n styleType: 'default',\n },\n {\n action: 'cancel',\n text: 'Cancel',\n styleType: 'link',\n },\n ],\n };\n\n public showForm = false;\n\n constructor(
|
|
1105
|
+
"rawContents": "import { Component, OnInit } from '@angular/core';\nimport { FormBuilder, FormControl, FormGroup } from '@angular/forms';\nimport {\n SkyInlineFormButtonLayout,\n SkyInlineFormCloseArgs,\n SkyInlineFormConfig,\n} from '@skyux/inline-form';\n\n@Component({\n selector: 'app-inline-form-demo',\n templateUrl: './inline-form-demo.component.html',\n})\nexport class InlineFormDemoComponent implements OnInit {\n public firstName = 'Jane';\n\n public myForm: FormGroup;\n\n public inlineFormConfig: SkyInlineFormConfig = {\n buttonLayout: SkyInlineFormButtonLayout.Custom,\n buttons: [\n {\n action: 'save',\n text: 'Save',\n styleType: 'primary',\n },\n {\n action: 'delete',\n text: 'Delete',\n styleType: 'default',\n },\n {\n action: 'reset',\n text: 'Reset',\n styleType: 'default',\n },\n {\n action: 'cancel',\n text: 'Cancel',\n styleType: 'link',\n },\n ],\n };\n\n public showForm = false;\n\n constructor(formBuilder: FormBuilder) {\n this.myForm = formBuilder.group({\n myFirstName: new FormControl(),\n });\n }\n\n public ngOnInit(): void {\n this.myForm.valueChanges.subscribe(() => {\n if (\n this.inlineFormConfig.buttons &&\n this.inlineFormConfig.buttons[0].disabled !== this.myForm.invalid\n ) {\n this.inlineFormConfig.buttons[0].disabled = this.myForm.invalid;\n this.inlineFormConfig = { ...{}, ...this.inlineFormConfig };\n }\n });\n }\n\n public onInlineFormClose(args: SkyInlineFormCloseArgs): void {\n if (args.reason === 'save') {\n this.firstName = this.myForm.get('myFirstName')?.value;\n }\n\n this.showForm = false;\n this.myForm.patchValue({\n myFirstName: undefined,\n });\n }\n\n public onInlineFormOpen(): void {\n this.showForm = true;\n this.myForm.patchValue({\n myFirstName: this.firstName,\n });\n }\n}\n"
|
|
1106
1106
|
},
|
|
1107
1107
|
{
|
|
1108
1108
|
"fileName": "inline-form-demo.module.ts",
|
|
@@ -1127,7 +1127,7 @@
|
|
|
1127
1127
|
{
|
|
1128
1128
|
"fileName": "inline-form-demo.component.ts",
|
|
1129
1129
|
"filePath": "/projects/inline-form/documentation/code-examples/inline-form/repeaters/inline-form-demo.component.ts",
|
|
1130
|
-
"rawContents": "import { Component
|
|
1130
|
+
"rawContents": "import { Component } from '@angular/core';\nimport { FormBuilder, FormControl, FormGroup } from '@angular/forms';\nimport {\n SkyInlineFormButtonLayout,\n SkyInlineFormCloseArgs,\n SkyInlineFormConfig,\n} from '@skyux/inline-form';\n\nimport { InlineFormDemoItem } from './inline-form-demo-item';\n\n@Component({\n selector: 'app-inline-form-demo',\n templateUrl: './inline-form-demo.component.html',\n styleUrls: ['./inline-form-demo.component.scss'],\n})\nexport class InlineFormDemoComponent {\n public activeInlineFormId: string | undefined;\n\n public inlineFormConfig: SkyInlineFormConfig = {\n buttonLayout: SkyInlineFormButtonLayout.SaveCancel,\n };\n\n public items: InlineFormDemoItem[] = [\n {\n id: '1',\n title: '2019 Spring Gala',\n note: 'Gala for friends and family',\n },\n {\n id: '2',\n title: '2019 Special Winter Event',\n note: 'A special event',\n },\n {\n id: '3',\n title: '2019 Donor Appreciation Event',\n note: 'Event for all donors and families',\n },\n {\n id: '4',\n title: '2020 Spring Gala',\n note: 'Gala for friends and family',\n },\n ];\n\n public myForm: FormGroup;\n\n constructor(formBuilder: FormBuilder) {\n this.myForm = formBuilder.group({\n id: new FormControl(),\n title: new FormControl(),\n note: new FormControl(),\n });\n }\n\n public showInlineForm(item: InlineFormDemoItem): void {\n this.activeInlineFormId = item.id;\n this.myForm.patchValue({\n note: item.note,\n title: item.title,\n });\n }\n\n public onInlineFormClose(args: SkyInlineFormCloseArgs): void {\n if (args.reason === 'save') {\n const found = this.items.find(\n (item) => item.id === this.activeInlineFormId\n );\n if (found) {\n found.note = this.myForm.get('note')?.value;\n found.title = this.myForm.get('title')?.value;\n }\n }\n\n this.myForm.patchValue({\n note: undefined,\n title: undefined,\n });\n\n // Close the active form.\n this.activeInlineFormId = undefined;\n }\n}\n"
|
|
1131
1131
|
},
|
|
1132
1132
|
{
|
|
1133
1133
|
"fileName": "inline-form-demo.module.ts",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skyux/inline-form",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.1.0",
|
|
4
4
|
"author": "Blackbaud, Inc.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"blackbaud",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"@angular/animations": "^14.2.11",
|
|
36
36
|
"@angular/common": "^14.2.11",
|
|
37
37
|
"@angular/core": "^14.2.11",
|
|
38
|
-
"@skyux/core": "7.
|
|
39
|
-
"@skyux/i18n": "7.
|
|
38
|
+
"@skyux/core": "7.1.0",
|
|
39
|
+
"@skyux/i18n": "7.1.0"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"tslib": "^2.3.1"
|