@ship-ui/core 0.18.0 → 0.18.2
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",
|
|
@@ -2532,7 +2532,7 @@
|
|
|
2532
2532
|
{
|
|
2533
2533
|
"name": "template-dialog",
|
|
2534
2534
|
"html": "<button shButton (click)=\"openTemplateDialog(myDialog)\">Open Template Dialog</button>\n\n<ng-template #myDialog let-data let-close=\"close\">\n <div content>\n <h2>{{ data.message }}</h2>\n <p>This dialog is rendered entirely from a TemplateRef.</p>\n <div>\n <button shButton (click)=\"close()\">Close Dialog</button>\n </div>\n </div>\n</ng-template>\n",
|
|
2535
|
-
"ts": "import { Component, inject, input, TemplateRef } from '@angular/core';\nimport { ShipButton, ShipDialogService } from 'ship-ui';\n\n@Component({\n selector: 'template-dialog',\n standalone: true,\n imports: [ShipButton],\n templateUrl: './template-dialog.html',\n styleUrl: './template-dialog.scss',\n})\nexport class TemplateDialog {\n #dialog = inject(ShipDialogService);\n type = input<string>();\n\n openTemplateDialog(template: TemplateRef<any>) {\n this.#dialog.open(template, {\n data: { message: 'Hello from Template!' },\n class: this.type() || '
|
|
2535
|
+
"ts": "import { Component, inject, input, TemplateRef } from '@angular/core';\nimport { ShipButton, ShipDialogService } from 'ship-ui';\n\n@Component({\n selector: 'template-dialog',\n standalone: true,\n imports: [ShipButton],\n templateUrl: './template-dialog.html',\n styleUrl: './template-dialog.scss',\n})\nexport class TemplateDialog {\n #dialog = inject(ShipDialogService);\n type = input<string>();\n\n openTemplateDialog(template: TemplateRef<any>) {\n this.#dialog.open(template, {\n data: { message: 'Hello from Template!' },\n class: this.type() || '',\n });\n }\n}\n"
|
|
2536
2536
|
},
|
|
2537
2537
|
{
|
|
2538
2538
|
"name": "basic-dynamic-dialog",
|
|
@@ -2556,8 +2556,8 @@
|
|
|
2556
2556
|
"methods": [
|
|
2557
2557
|
{
|
|
2558
2558
|
"name": "open",
|
|
2559
|
-
"parameters": "componentOrTemplate:
|
|
2560
|
-
"returnType": "
|
|
2559
|
+
"parameters": "componentOrTemplate: Type<I> | (I extends TemplateRef<any> ? I : never),\n options?: _Options",
|
|
2560
|
+
"returnType": "I extends TemplateRef<any> ? ShipDialogTemplateInstance<I> : ShipDialogInstance<I>;\n open<T = any, K = ComponentDataType<T>, U = ComponentClosedType<T>>(\n componentOrTemplate: Type<T> | TemplateRef<any>,\n options?: any\n ): ShipDialogInstance<any>",
|
|
2561
2561
|
"description": ""
|
|
2562
2562
|
}
|
|
2563
2563
|
],
|
|
@@ -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",
|
|
@@ -2576,7 +2576,7 @@
|
|
|
2576
2576
|
{
|
|
2577
2577
|
"name": "template-dialog",
|
|
2578
2578
|
"html": "<button shButton (click)=\"openTemplateDialog(myDialog)\">Open Template Dialog</button>\n\n<ng-template #myDialog let-data let-close=\"close\">\n <div content>\n <h2>{{ data.message }}</h2>\n <p>This dialog is rendered entirely from a TemplateRef.</p>\n <div>\n <button shButton (click)=\"close()\">Close Dialog</button>\n </div>\n </div>\n</ng-template>\n",
|
|
2579
|
-
"ts": "import { Component, inject, input, TemplateRef } from '@angular/core';\nimport { ShipButton, ShipDialogService } from 'ship-ui';\n\n@Component({\n selector: 'template-dialog',\n standalone: true,\n imports: [ShipButton],\n templateUrl: './template-dialog.html',\n styleUrl: './template-dialog.scss',\n})\nexport class TemplateDialog {\n #dialog = inject(ShipDialogService);\n type = input<string>();\n\n openTemplateDialog(template: TemplateRef<any>) {\n this.#dialog.open(template, {\n data: { message: 'Hello from Template!' },\n class: this.type() || '
|
|
2579
|
+
"ts": "import { Component, inject, input, TemplateRef } from '@angular/core';\nimport { ShipButton, ShipDialogService } from 'ship-ui';\n\n@Component({\n selector: 'template-dialog',\n standalone: true,\n imports: [ShipButton],\n templateUrl: './template-dialog.html',\n styleUrl: './template-dialog.scss',\n})\nexport class TemplateDialog {\n #dialog = inject(ShipDialogService);\n type = input<string>();\n\n openTemplateDialog(template: TemplateRef<any>) {\n this.#dialog.open(template, {\n data: { message: 'Hello from Template!' },\n class: this.type() || '',\n });\n }\n}\n"
|
|
2580
2580
|
},
|
|
2581
2581
|
{
|
|
2582
2582
|
"name": "basic-dynamic-dialog",
|