@ship-ui/core 0.18.0 → 0.18.1
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.
|
@@ -2522,7 +2522,7 @@
|
|
|
2522
2522
|
{
|
|
2523
2523
|
"name": "data-passing-dialog",
|
|
2524
2524
|
"html": "<div style=\"padding: 2rem\">\n <p>Dialog received: {{ data()?.message }}</p>\n <button shButton (click)=\"closeWithValue()\">Close with value</button>\n</div>\n",
|
|
2525
|
-
"ts": "import { Component, inject, input, output } from '@angular/core';\nimport { ShipButton, ShipDialogService } from 'ship-ui';\n\n@Component({\n selector: 'data-passing-dialog',\n standalone: true,\n imports: [ShipButton],\n templateUrl: './data-passing-dialog.html',\n styleUrl: './data-passing-dialog.scss',\n})\nexport class DataPassingDialog {\n #dialog = inject(ShipDialogService);\n\n type = input<string>();\n\n openDialog() {\n const dialogRef = this.#dialog.open(DataDialogContent, {\n class: this.type() ?? '',\n data: { message: 'Hello from parent!', hello: true },\n closed: (result
|
|
2525
|
+
"ts": "import { Component, inject, input, output } from '@angular/core';\nimport { ShipButton, ShipDialogService } from 'ship-ui';\n\n@Component({\n selector: 'data-passing-dialog',\n standalone: true,\n imports: [ShipButton],\n templateUrl: './data-passing-dialog.html',\n styleUrl: './data-passing-dialog.scss',\n})\nexport class DataPassingDialog {\n #dialog = inject(ShipDialogService);\n\n type = input<string>();\n\n openDialog() {\n const dialogRef = this.#dialog.open(DataDialogContent, {\n class: this.type() ?? '',\n data: { message: 'Hello from parent!', hello: true },\n closed: (result) => {\n // Keep so we can easily see if the types break\n const someString: string = result;\n console.log('Dialog function closed with: \\t' + someString);\n },\n });\n\n dialogRef.component.closed.subscribe((res) => {\n console.log('Dialog component closed: \\t', res);\n });\n\n dialogRef.closed.subscribe((res) => {\n console.log('Dialog ref closed: \\t', res);\n });\n }\n}\n\n@Component({\n selector: 'data-dialog-content',\n standalone: true,\n imports: [ShipButton],\n templateUrl: './data-dialog-content.html',\n styleUrl: './data-dialog-content.scss',\n})\nclass DataDialogContent {\n data = input<{ message: string; hello: boolean }>();\n closed = output<string>();\n\n closeWithValue() {\n console.log('closeWithValue');\n this.closed.emit('Some value from dialog');\n }\n}\n"
|
|
2526
2526
|
},
|
|
2527
2527
|
{
|
|
2528
2528
|
"name": "dialog-as-component",
|
|
@@ -2566,7 +2566,7 @@
|
|
|
2566
2566
|
{
|
|
2567
2567
|
"name": "data-passing-dialog",
|
|
2568
2568
|
"html": "<div style=\"padding: 2rem\">\n <p>Dialog received: {{ data()?.message }}</p>\n <button shButton (click)=\"closeWithValue()\">Close with value</button>\n</div>\n",
|
|
2569
|
-
"ts": "import { Component, inject, input, output } from '@angular/core';\nimport { ShipButton, ShipDialogService } from 'ship-ui';\n\n@Component({\n selector: 'data-passing-dialog',\n standalone: true,\n imports: [ShipButton],\n templateUrl: './data-passing-dialog.html',\n styleUrl: './data-passing-dialog.scss',\n})\nexport class DataPassingDialog {\n #dialog = inject(ShipDialogService);\n\n type = input<string>();\n\n openDialog() {\n const dialogRef = this.#dialog.open(DataDialogContent, {\n class: this.type() ?? '',\n data: { message: 'Hello from parent!', hello: true },\n closed: (result
|
|
2569
|
+
"ts": "import { Component, inject, input, output } from '@angular/core';\nimport { ShipButton, ShipDialogService } from 'ship-ui';\n\n@Component({\n selector: 'data-passing-dialog',\n standalone: true,\n imports: [ShipButton],\n templateUrl: './data-passing-dialog.html',\n styleUrl: './data-passing-dialog.scss',\n})\nexport class DataPassingDialog {\n #dialog = inject(ShipDialogService);\n\n type = input<string>();\n\n openDialog() {\n const dialogRef = this.#dialog.open(DataDialogContent, {\n class: this.type() ?? '',\n data: { message: 'Hello from parent!', hello: true },\n closed: (result) => {\n // Keep so we can easily see if the types break\n const someString: string = result;\n console.log('Dialog function closed with: \\t' + someString);\n },\n });\n\n dialogRef.component.closed.subscribe((res) => {\n console.log('Dialog component closed: \\t', res);\n });\n\n dialogRef.closed.subscribe((res) => {\n console.log('Dialog ref closed: \\t', res);\n });\n }\n}\n\n@Component({\n selector: 'data-dialog-content',\n standalone: true,\n imports: [ShipButton],\n templateUrl: './data-dialog-content.html',\n styleUrl: './data-dialog-content.scss',\n})\nclass DataDialogContent {\n data = input<{ message: string; hello: boolean }>();\n closed = output<string>();\n\n closeWithValue() {\n console.log('closeWithValue');\n this.closed.emit('Some value from dialog');\n }\n}\n"
|
|
2570
2570
|
},
|
|
2571
2571
|
{
|
|
2572
2572
|
"name": "dialog-as-component",
|