@api-client/ui 0.5.38 → 0.5.40
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/build/src/md/list/internals/ListItem.d.ts +24 -15
- package/build/src/md/list/internals/ListItem.d.ts.map +1 -1
- package/build/src/md/list/internals/ListItem.js +85 -59
- package/build/src/md/list/internals/ListItem.js.map +1 -1
- package/build/src/md/list/internals/ListItem.styles.js +11 -11
- package/build/src/md/list/internals/ListItem.styles.js.map +1 -1
- package/build/src/md/select/internals/Option.d.ts +4 -14
- package/build/src/md/select/internals/Option.d.ts.map +1 -1
- package/build/src/md/select/internals/Option.js +13 -28
- package/build/src/md/select/internals/Option.js.map +1 -1
- package/build/src/md/select/internals/Select.d.ts +1 -1
- package/build/src/md/select/internals/Select.d.ts.map +1 -1
- package/build/src/md/select/internals/Select.js +15 -5
- package/build/src/md/select/internals/Select.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -0
- package/package.json +1 -1
- package/src/md/list/internals/ListItem.styles.ts +11 -11
- package/src/md/list/internals/ListItem.ts +68 -43
- package/src/md/select/internals/Option.ts +14 -26
- package/src/md/select/internals/Select.ts +15 -5
- package/.aiexclude +0 -3
- package/.cursor/rules/html-and-css-best-practices.mdc +0 -63
- package/.cursor/rules/lit-best-practices.mdc +0 -89
- package/.editorconfig +0 -29
- package/.github/CONTRIBUTING.md +0 -24
- package/.github/instructions/html-and-css-best-practices.instructions.md +0 -70
- package/.github/instructions/lit-best-practices.instructions.md +0 -90
- package/.github/release.yml +0 -14
- package/.github/stale.yml +0 -23
- package/.github/workflows/auto-release.yml +0 -182
- package/.github/workflows/release.yml +0 -82
- package/.prettierrc.js +0 -14
- package/.vscode/settings.json +0 -18
- package/RELEASE.md +0 -163
- package/RELEASE_SETUP.md +0 -235
- package/build/src/demo/DemoPage.d.ts +0 -81
- package/build/src/demo/DemoPage.d.ts.map +0 -1
- package/build/src/demo/DemoPage.js +0 -175
- package/build/src/demo/DemoPage.js.map +0 -1
- package/build/src/demo/DemoStyles.d.ts +0 -3
- package/build/src/demo/DemoStyles.d.ts.map +0 -1
- package/build/src/demo/DemoStyles.js +0 -60
- package/build/src/demo/DemoStyles.js.map +0 -1
- package/build/test/elements/navigation/Navigation.test.d.ts +0 -3
- package/build/test/elements/navigation/Navigation.test.d.ts.map +0 -1
- package/build/test/elements/navigation/Navigation.test.js +0 -113
- package/build/test/elements/navigation/Navigation.test.js.map +0 -1
- package/commitlint.config.cjs +0 -2
- package/demo/elements/authorization/AuthPlugin.js +0 -57
- package/demo/elements/authorization/AuthProxy.js +0 -215
- package/demo/elements/authorization/api-key.html +0 -27
- package/demo/elements/authorization/api-key.ts +0 -44
- package/demo/elements/authorization/basic.html +0 -27
- package/demo/elements/authorization/basic.ts +0 -43
- package/demo/elements/authorization/bearer.html +0 -27
- package/demo/elements/authorization/bearer.ts +0 -43
- package/demo/elements/authorization/env.js +0 -8
- package/demo/elements/authorization/index.html +0 -44
- package/demo/elements/authorization/ntlm.html +0 -27
- package/demo/elements/authorization/ntlm.ts +0 -43
- package/demo/elements/authorization/oauth-authorize.html +0 -75
- package/demo/elements/authorization/oauth-authorize.ts +0 -40
- package/demo/elements/authorization/oauth-error.html +0 -18
- package/demo/elements/authorization/oauth-error.ts +0 -10
- package/demo/elements/authorization/oauth-popup.html +0 -36
- package/demo/elements/authorization/oauth2.html +0 -27
- package/demo/elements/authorization/oauth2.ts +0 -100
- package/demo/elements/authorization/oidc.html +0 -27
- package/demo/elements/authorization/oidc.ts +0 -139
- package/demo/elements/authorization/private.crt +0 -31
- package/demo/elements/authorization/private.csr +0 -28
- package/demo/elements/authorization/private.key +0 -51
- package/demo/elements/authorization/private.pem +0 -31
- package/demo/elements/authorization/redirect.html +0 -20
- package/demo/elements/authorization/ssl-commands.sh +0 -30
- package/demo/elements/authorization/ssl.conf +0 -24
- package/demo/elements/autocomplete/index.html +0 -64
- package/demo/elements/autocomplete/index.ts +0 -171
- package/demo/elements/code-editor/CodeEditorDemo.ts +0 -173
- package/demo/elements/code-editor/index.html +0 -19
- package/demo/elements/context-menu/DemoIcons.ts +0 -21
- package/demo/elements/context-menu/basic.html +0 -25
- package/demo/elements/context-menu/basic.ts +0 -119
- package/demo/elements/context-menu/custom-data.html +0 -25
- package/demo/elements/context-menu/custom-data.ts +0 -62
- package/demo/elements/context-menu/demo.css +0 -28
- package/demo/elements/context-menu/enabled-state.html +0 -25
- package/demo/elements/context-menu/enabled-state.ts +0 -73
- package/demo/elements/context-menu/icons.html +0 -25
- package/demo/elements/context-menu/icons.ts +0 -64
- package/demo/elements/context-menu/index.html +0 -43
- package/demo/elements/context-menu/nested.html +0 -25
- package/demo/elements/context-menu/nestedt.ts +0 -152
- package/demo/elements/context-menu/no-execute.html +0 -25
- package/demo/elements/context-menu/no-execute.ts +0 -134
- package/demo/elements/context-menu/radio-menu.html +0 -25
- package/demo/elements/context-menu/radio-menu.ts +0 -83
- package/demo/elements/context-menu/separators.html +0 -25
- package/demo/elements/context-menu/separators.ts +0 -172
- package/demo/elements/currency/index.html +0 -91
- package/demo/elements/currency/index.ts +0 -352
- package/demo/elements/environment/environment-editor.html +0 -20
- package/demo/elements/environment/environment-editor.ts +0 -49
- package/demo/elements/environment/index.html +0 -33
- package/demo/elements/environment/server-editor.html +0 -20
- package/demo/elements/environment/server-editor.ts +0 -67
- package/demo/elements/environment/variables-editor.html +0 -20
- package/demo/elements/environment/variables-editor.ts +0 -94
- package/demo/elements/har/har-viewer.html +0 -20
- package/demo/elements/har/har-viewer.ts +0 -76
- package/demo/elements/har/har1.har +0 -3044
- package/demo/elements/har/har2.json +0 -439
- package/demo/elements/har/index.html +0 -26
- package/demo/elements/highlight/example.md +0 -27
- package/demo/elements/highlight/index.html +0 -31
- package/demo/elements/highlight/marked-highlight.html +0 -132
- package/demo/elements/highlight/marked-highlight.ts +0 -22
- package/demo/elements/highlight/prism-highlight.html +0 -62
- package/demo/elements/highlight/prism-highlight.ts +0 -17
- package/demo/elements/http/body-editor.html +0 -17
- package/demo/elements/http/body-editor.ts +0 -115
- package/demo/elements/http/headers.html +0 -17
- package/demo/elements/http/headers.ts +0 -59
- package/demo/elements/http/http-assertions.html +0 -20
- package/demo/elements/http/http-assertions.ts +0 -89
- package/demo/elements/http/http-flows.html +0 -23
- package/demo/elements/http/http-flows.ts +0 -89
- package/demo/elements/http/index.html +0 -45
- package/demo/elements/http/request-editor.html +0 -26
- package/demo/elements/http/request-editor.ts +0 -197
- package/demo/elements/http/request-log.html +0 -16
- package/demo/elements/http/request-log.ts +0 -136
- package/demo/elements/http/url-editing.html +0 -17
- package/demo/elements/http/url-editing.ts +0 -112
- package/demo/elements/icons/index.html +0 -81
- package/demo/elements/icons/index.ts +0 -52
- package/demo/elements/index.html +0 -72
- package/demo/elements/mention-textarea/index.html +0 -19
- package/demo/elements/mention-textarea/index.ts +0 -205
- package/demo/elements/navigation/navigation-item.html +0 -49
- package/demo/elements/navigation/navigation-item.ts +0 -131
- package/demo/elements/navigation/navigation.html +0 -20
- package/demo/elements/navigation/navigation.ts +0 -45
- package/demo/elements/project/index.html +0 -29
- package/demo/elements/project/project-run-report.html +0 -20
- package/demo/elements/project/project-run-report.ts +0 -132
- package/demo/elements/project/request-editor.html +0 -23
- package/demo/elements/project/request-editor.ts +0 -232
- package/demo/elements/user/user-avatar.html +0 -17
- package/demo/elements/user/user-avatar.ts +0 -60
- package/demo/env.js +0 -4
- package/demo/index.html +0 -34
- package/demo/layout/index.html +0 -94
- package/demo/layout/index.ts +0 -190
- package/demo/md/DemoStyles.ts +0 -61
- package/demo/md/UiDemoPage.ts +0 -6
- package/demo/md/buttons/button.html +0 -121
- package/demo/md/buttons/button.ts +0 -246
- package/demo/md/buttons/group.html +0 -36
- package/demo/md/buttons/group.ts +0 -171
- package/demo/md/checkbox/index.html +0 -39
- package/demo/md/checkbox/index.ts +0 -220
- package/demo/md/chip/chip.html +0 -70
- package/demo/md/chip/chip.ts +0 -219
- package/demo/md/chip/pawel6c9a.jpg +0 -0
- package/demo/md/collapse/CustomDetail.ts +0 -89
- package/demo/md/collapse/collapse.html +0 -21
- package/demo/md/collapse/collapse.ts +0 -78
- package/demo/md/date-picker/date-picker.ts +0 -336
- package/demo/md/date-picker/index.html +0 -171
- package/demo/md/dialog/confirm-dialog.html +0 -49
- package/demo/md/dialog/confirm-dialog.ts +0 -121
- package/demo/md/dialog/dialog.html +0 -25
- package/demo/md/dialog/dialog.ts +0 -468
- package/demo/md/dropdown-list/index.html +0 -31
- package/demo/md/dropdown-list/index.ts +0 -158
- package/demo/md/icon-button/index.html +0 -122
- package/demo/md/icon-button/index.ts +0 -132
- package/demo/md/index.html +0 -73
- package/demo/md/inputs/input.html +0 -73
- package/demo/md/inputs/input.ts +0 -278
- package/demo/md/inputs/radio.html +0 -39
- package/demo/md/inputs/radio.ts +0 -156
- package/demo/md/inputs/switch.html +0 -45
- package/demo/md/inputs/switch.ts +0 -144
- package/demo/md/list/list.html +0 -65
- package/demo/md/list/list.ts +0 -204
- package/demo/md/listbox/listbox.html +0 -31
- package/demo/md/listbox/listbox.ts +0 -27
- package/demo/md/menu/index.html +0 -19
- package/demo/md/menu/index.ts +0 -514
- package/demo/md/notification/snack.html +0 -21
- package/demo/md/notification/snack.ts +0 -70
- package/demo/md/progress/progress.html +0 -46
- package/demo/md/progress/progress.ts +0 -161
- package/demo/md/segmented-button/index.html +0 -21
- package/demo/md/segmented-button/index.ts +0 -55
- package/demo/md/select/index.html +0 -16
- package/demo/md/select/index.ts +0 -207
- package/demo/md/tabs/tabs.html +0 -40
- package/demo/md/tabs/tabs.ts +0 -214
- package/demo/oauth-popup.html +0 -36
- package/demo/page.css +0 -8
- package/demo/resources/calendar-month.png +0 -0
- package/demo/resources/favorite.png +0 -0
- package/demo/resources/fingerprint.png +0 -0
- package/demo/resources/home-work.png +0 -0
- package/demo/resources/mood.png +0 -0
- package/demo/resources/print.png +0 -0
- package/demo/resources/stars.png +0 -0
- package/demo/resources/theaters.png +0 -0
- package/demo/tsconfig.json +0 -4
- package/eslint.config.js +0 -97
- package/scripts/copy-assets.js +0 -21
- package/scripts/release.js +0 -66
- package/src/demo/DemoPage.ts +0 -169
- package/src/demo/DemoStyles.ts +0 -60
- package/test/README.md +0 -375
- package/test/contextual-menu/ContextMenu.test.ts +0 -760
- package/test/contextual-menu/ContextMenuElement.test.ts +0 -569
- package/test/core/activity.spec.ts +0 -413
- package/test/core/activity_manager.spec.ts +0 -544
- package/test/core/application.spec.ts +0 -218
- package/test/core/fragment.spec.ts +0 -565
- package/test/core/fragment_manager.spec.ts +0 -404
- package/test/core/live_data.spec.ts +0 -558
- package/test/core/renderer.spec.ts +0 -113
- package/test/dom-assertions.test.ts +0 -182
- package/test/elements/MonacoSetup.ts +0 -65
- package/test/elements/authorization/basic-method.test.ts +0 -177
- package/test/elements/authorization/bearer-method.test.ts +0 -143
- package/test/elements/authorization/ntlm-method.test.ts +0 -219
- package/test/elements/authorization/oauth2-client-credentials-method.test.ts +0 -334
- package/test/elements/authorization/oauth2-code-method.test.ts +0 -320
- package/test/elements/authorization/oauth2-custom-grant-method.test.ts +0 -255
- package/test/elements/authorization/oauth2-device-code-method.test.ts +0 -371
- package/test/elements/authorization/oauth2-implicit-method.test.ts +0 -407
- package/test/elements/authorization/oauth2-jwt-method.test.ts +0 -217
- package/test/elements/authorization/oauth2-password-method.test.ts +0 -275
- package/test/elements/authorization/openid-method.test.ts +0 -591
- package/test/elements/autocomplete/autocomplete-input.spec.ts +0 -646
- package/test/elements/code-editor/code-editor.accessibility.test.ts +0 -298
- package/test/elements/code-editor/code-editor.test.ts +0 -574
- package/test/elements/currency/CurrencyPicker.accessibility.test.ts +0 -328
- package/test/elements/currency/CurrencyPicker.core.test.ts +0 -318
- package/test/elements/currency/CurrencyPicker.integration.test.ts +0 -482
- package/test/elements/currency/CurrencyPicker.test.ts +0 -486
- package/test/elements/data-table/DataTable.browser.test.ts +0 -649
- package/test/elements/har/HarUtils.test.ts +0 -45
- package/test/elements/har/HarViewerElement.test.ts +0 -687
- package/test/elements/har/test-data/har1.har +0 -3044
- package/test/elements/highlight/MarkedHighlightElement.test.ts +0 -452
- package/test/elements/highlight/PrismHighlightElement.test.ts +0 -79
- package/test/elements/highlight/PrismHighlighter.test.ts +0 -94
- package/test/elements/highlight/remoteSanitization.md +0 -1
- package/test/elements/highlight/test.md +0 -3
- package/test/elements/highlight/test1.md +0 -3
- package/test/elements/highlight/test2.md +0 -1
- package/test/elements/http/BodyFormdataEditorElement.test.ts +0 -482
- package/test/elements/http/BodyMultipartEditorElement.test.ts +0 -658
- package/test/elements/http/BodyRawEditorElement.test.ts +0 -90
- package/test/elements/http/CertificateAdd.test.ts +0 -457
- package/test/elements/http/HttpAssertions.test.ts +0 -994
- package/test/elements/http/HttpFlows.test.ts +0 -502
- package/test/elements/http/UrlEncodeUtils.test.ts +0 -202
- package/test/elements/layout/SplitItem.test.ts +0 -440
- package/test/elements/layout/SplitLayoutManager.test.ts +0 -1501
- package/test/elements/layout/SplitPanel.test.ts +0 -1109
- package/test/elements/mention-textarea/MentionTextArea.basic.test.ts +0 -114
- package/test/elements/mention-textarea/MentionTextArea.test.ts +0 -613
- package/test/elements/navigation/Navigation.test.ts +0 -120
- package/test/env.ts +0 -15
- package/test/events/EventTypes.test.ts +0 -363
- package/test/events/EventsTestHelpers.ts +0 -16
- package/test/helpers/TestUtils.ts +0 -243
- package/test/helpers/UiMock.ts +0 -185
- package/test/lib/Dom.test.ts +0 -231
- package/test/md/button/UiButton.test.ts +0 -347
- package/test/md/button/UiIconButton.test.ts +0 -155
- package/test/md/chip/UiChip.test.ts +0 -219
- package/test/md/collapse/UiCollapse.test.ts +0 -250
- package/test/md/collapse/flex-layout.test.ts +0 -105
- package/test/md/date-time/DateTime.test.ts +0 -348
- package/test/md/dialog/UiConfirmDialog.test.ts +0 -131
- package/test/md/dialog/UiDialog.test.ts +0 -759
- package/test/md/menu/Menu.test.ts +0 -855
- package/test/md/menu/MenuIntegration.test.ts +0 -426
- package/test/md/menu/MenuItem.test.ts +0 -652
- package/test/md/menu/SubMenu.test.ts +0 -410
- package/test/md/progress/UiCircularProgressElement.test.ts +0 -481
- package/test/md/progress/UiProgressElement.test.ts +0 -117
- package/test/md/progress/UiRangeElement.test.ts +0 -156
- package/test/md/select/Select.test.ts +0 -925
- package/test/plugins/takeScreenshotPlugin.js +0 -35
- package/test/setup.test.ts +0 -217
- package/test/setup.ts +0 -117
- package/test/tsconfig.json +0 -7
- package/web-dev-server.config.js +0 -21
- package/web-test-runner.config.js +0 -90
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import { html, TemplateResult } from 'lit'
|
|
2
|
-
import { DemoPage } from '../../../src/demo/DemoPage.js'
|
|
3
|
-
import { UiDialogClosingReason } from '../../../src/md/dialog/internals/Dialog.js'
|
|
4
|
-
import { reactive } from '../../../src/decorators/index.js'
|
|
5
|
-
import '../../../src/md/dialog/ui-confirm-dialog.js'
|
|
6
|
-
import '../../../src/md/button/ui-button.js'
|
|
7
|
-
|
|
8
|
-
class ConfirmDialogDemo extends DemoPage {
|
|
9
|
-
override accessor componentName = 'UI Confirm Dialog'
|
|
10
|
-
|
|
11
|
-
@reactive() accessor basicDialogOpen = false
|
|
12
|
-
|
|
13
|
-
@reactive() accessor deleteDialogOpen = false
|
|
14
|
-
|
|
15
|
-
@reactive() accessor customDialogOpen = false
|
|
16
|
-
|
|
17
|
-
@reactive() accessor lastResult = ''
|
|
18
|
-
|
|
19
|
-
protected openBasicDialog(): void {
|
|
20
|
-
this.basicDialogOpen = true
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
protected openDeleteDialog(): void {
|
|
24
|
-
this.deleteDialogOpen = true
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
protected openCustomDialog(): void {
|
|
28
|
-
this.customDialogOpen = true
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
protected handleBasicClose(e: CustomEvent<UiDialogClosingReason>): void {
|
|
32
|
-
this.basicDialogOpen = false
|
|
33
|
-
this.updateResult('Basic Dialog', e.detail)
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
protected handleDeleteClose(e: CustomEvent<UiDialogClosingReason>): void {
|
|
37
|
-
this.deleteDialogOpen = false
|
|
38
|
-
this.updateResult('Delete Dialog', e.detail)
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
protected handleCustomClose(e: CustomEvent<UiDialogClosingReason>): void {
|
|
42
|
-
this.customDialogOpen = false
|
|
43
|
-
this.updateResult('Custom Dialog', e.detail)
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
private updateResult(dialogType: string, detail: UiDialogClosingReason): void {
|
|
47
|
-
const action = detail.cancelled ? 'dismissed' : 'confirmed'
|
|
48
|
-
this.lastResult = `${dialogType} was ${action}`
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
contentTemplate(): TemplateResult {
|
|
52
|
-
return html`
|
|
53
|
-
<a href="../">Back</a>
|
|
54
|
-
<h1>Confirm Dialog Demo</h1>
|
|
55
|
-
|
|
56
|
-
<section class="demo-section">
|
|
57
|
-
<h2>Basic Confirm Dialog</h2>
|
|
58
|
-
<p>A simple confirmation dialog with default button labels.</p>
|
|
59
|
-
<div class="button-group">
|
|
60
|
-
<ui-button color="filled" @click="${this.openBasicDialog}">Open Basic Dialog</ui-button>
|
|
61
|
-
</div>
|
|
62
|
-
|
|
63
|
-
<ui-confirm-dialog .open="${this.basicDialogOpen}" @close="${this.handleBasicClose}">
|
|
64
|
-
<span slot="title">Confirm Action</span>
|
|
65
|
-
<p>Are you sure you want to proceed with this action?</p>
|
|
66
|
-
</ui-confirm-dialog>
|
|
67
|
-
</section>
|
|
68
|
-
|
|
69
|
-
<section class="demo-section">
|
|
70
|
-
<h2>Delete Confirmation Dialog</h2>
|
|
71
|
-
<p>A confirmation dialog with custom button labels for a destructive action.</p>
|
|
72
|
-
<div class="button-group">
|
|
73
|
-
<ui-button color="filled" @click="${this.openDeleteDialog}">Delete Item</ui-button>
|
|
74
|
-
</div>
|
|
75
|
-
|
|
76
|
-
<ui-confirm-dialog
|
|
77
|
-
confirmLabel="Delete"
|
|
78
|
-
dismissLabel="Keep"
|
|
79
|
-
destructive
|
|
80
|
-
.open="${this.deleteDialogOpen}"
|
|
81
|
-
@close="${this.handleDeleteClose}"
|
|
82
|
-
>
|
|
83
|
-
<span slot="title">Delete Item</span>
|
|
84
|
-
<p>Are you sure you want to delete this item? This action cannot be undone.</p>
|
|
85
|
-
<p><strong>This will permanently remove the item from your account.</strong></p>
|
|
86
|
-
</ui-confirm-dialog>
|
|
87
|
-
</section>
|
|
88
|
-
|
|
89
|
-
<section class="demo-section">
|
|
90
|
-
<h2>Custom Styled Dialog</h2>
|
|
91
|
-
<p>A confirmation dialog with custom button labels for a specific workflow.</p>
|
|
92
|
-
<div class="button-group">
|
|
93
|
-
<ui-button color="filled" @click="${this.openCustomDialog}">Save & Exit</ui-button>
|
|
94
|
-
</div>
|
|
95
|
-
|
|
96
|
-
<ui-confirm-dialog
|
|
97
|
-
confirmLabel="Save & Exit"
|
|
98
|
-
dismissLabel="Continue Editing"
|
|
99
|
-
.open="${this.customDialogOpen}"
|
|
100
|
-
@close="${this.handleCustomClose}"
|
|
101
|
-
>
|
|
102
|
-
<span slot="title">Save Changes</span>
|
|
103
|
-
<p>You have unsaved changes in your document.</p>
|
|
104
|
-
<p>Would you like to save your changes before exiting?</p>
|
|
105
|
-
</ui-confirm-dialog>
|
|
106
|
-
</section>
|
|
107
|
-
|
|
108
|
-
${this.lastResult
|
|
109
|
-
? html`
|
|
110
|
-
<section class="demo-section">
|
|
111
|
-
<h2>Last Action Result</h2>
|
|
112
|
-
<div class="result">${this.lastResult}</div>
|
|
113
|
-
</section>
|
|
114
|
-
`
|
|
115
|
-
: ''}
|
|
116
|
-
`
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
const instance = new ConfirmDialogDemo()
|
|
121
|
-
instance.render()
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en-GB">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8">
|
|
5
|
-
<title>UI dialog</title>
|
|
6
|
-
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, minimum-scale=1.0">
|
|
7
|
-
<link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap" rel="stylesheet">
|
|
8
|
-
<link href="../../../src/styles/m3/tokens.css" rel="stylesheet" type="text/css" />
|
|
9
|
-
<link href="../../../src/styles/m3/theme.css" rel="stylesheet" type="text/css" />
|
|
10
|
-
<style>
|
|
11
|
-
.demo-row {
|
|
12
|
-
margin: 20px 0;
|
|
13
|
-
}
|
|
14
|
-
</style>
|
|
15
|
-
</head>
|
|
16
|
-
<body>
|
|
17
|
-
<div id="app"></div>
|
|
18
|
-
|
|
19
|
-
<dialog id="myDialog">
|
|
20
|
-
<p>This dialog is not initially visible.</p>
|
|
21
|
-
</dialog>
|
|
22
|
-
|
|
23
|
-
<script type="module" src="/.tmp/demo/md/dialog/dialog.js"></script>
|
|
24
|
-
</body>
|
|
25
|
-
</html>
|
package/demo/md/dialog/dialog.ts
DELETED
|
@@ -1,468 +0,0 @@
|
|
|
1
|
-
import { html, TemplateResult } from 'lit'
|
|
2
|
-
import { DemoPage } from '../../../src/demo/DemoPage.js'
|
|
3
|
-
import '../../../src/md/button/ui-button.js'
|
|
4
|
-
import '../../../src/md/icons/ui-icon.js'
|
|
5
|
-
import '../../../src/md/dialog/ui-dialog.js'
|
|
6
|
-
import '../../../src/md/divider/ui-divider.js'
|
|
7
|
-
import '../../../src/md/list/ui-list.js'
|
|
8
|
-
import '../../../src/md/list/ui-list-item.js'
|
|
9
|
-
import { reactive } from '../../../src/decorators/index.js'
|
|
10
|
-
import UiDialog, { type UiDialogClosingReason } from '../../../src/md/dialog/internals/Dialog.js'
|
|
11
|
-
|
|
12
|
-
class ComponentDemoPage extends DemoPage {
|
|
13
|
-
override accessor componentName = 'UI dialog'
|
|
14
|
-
|
|
15
|
-
@reactive() accessor simpleOpened = false
|
|
16
|
-
|
|
17
|
-
@reactive() accessor fullOpened = false
|
|
18
|
-
|
|
19
|
-
@reactive() accessor overflowOpened = false
|
|
20
|
-
|
|
21
|
-
@reactive() accessor formOpened = false
|
|
22
|
-
|
|
23
|
-
@reactive() accessor destructiveOpened = false
|
|
24
|
-
|
|
25
|
-
@reactive() accessor nonModalOpened = false
|
|
26
|
-
|
|
27
|
-
protected openSimple(): void {
|
|
28
|
-
this.simpleOpened = true
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
protected basicClosed(e: CustomEvent<UiDialogClosingReason>): void {
|
|
32
|
-
this.simpleOpened = false
|
|
33
|
-
this.reportClosingReason(e.detail)
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
protected openFull(): void {
|
|
37
|
-
this.fullOpened = true
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
protected fullClosed(e: CustomEvent<UiDialogClosingReason>): void {
|
|
41
|
-
this.fullOpened = false
|
|
42
|
-
this.reportClosingReason(e.detail)
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
protected openOverflow(): void {
|
|
46
|
-
this.overflowOpened = true
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
protected overflowClosed(e: CustomEvent<UiDialogClosingReason>): void {
|
|
50
|
-
this.overflowOpened = false
|
|
51
|
-
this.reportClosingReason(e.detail)
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
protected openForm(): void {
|
|
55
|
-
this.formOpened = true
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
protected formClosed(e: CustomEvent<UiDialogClosingReason>): void {
|
|
59
|
-
this.formOpened = false
|
|
60
|
-
this.reportClosingReason(e.detail)
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
protected openDestructive(): void {
|
|
64
|
-
this.destructiveOpened = true
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
protected destructiveClosed(e: CustomEvent<UiDialogClosingReason>): void {
|
|
68
|
-
this.destructiveOpened = false
|
|
69
|
-
this.reportClosingReason(e.detail)
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
protected openNonModal(): void {
|
|
73
|
-
this.nonModalOpened = true
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
protected nonModalClosed(e: CustomEvent<UiDialogClosingReason>): void {
|
|
77
|
-
this.nonModalOpened = false
|
|
78
|
-
this.reportClosingReason(e.detail)
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
imperativeDialog: UiDialog | null = null
|
|
82
|
-
|
|
83
|
-
protected openImperative(): void {
|
|
84
|
-
if (this.imperativeDialog) {
|
|
85
|
-
document.body.removeChild(this.imperativeDialog)
|
|
86
|
-
this.imperativeDialog = null
|
|
87
|
-
}
|
|
88
|
-
const dialog = document.createElement('ui-dialog')
|
|
89
|
-
dialog.textContent = 'This is a dialog content.'
|
|
90
|
-
dialog.dismissLabel = 'Close'
|
|
91
|
-
dialog.confirmLabel = 'OK'
|
|
92
|
-
dialog.open = true
|
|
93
|
-
document.body.appendChild(dialog)
|
|
94
|
-
this.imperativeDialog = dialog
|
|
95
|
-
dialog.addEventListener('close', (e: Event): void => {
|
|
96
|
-
document.body.removeChild(dialog)
|
|
97
|
-
this.imperativeDialog = null
|
|
98
|
-
const event = e as CustomEvent<UiDialogClosingReason>
|
|
99
|
-
this.reportClosingReason(event.detail)
|
|
100
|
-
})
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
protected reportClosingReason(reason: UiDialogClosingReason): void {
|
|
104
|
-
if (reason.cancelled) {
|
|
105
|
-
console.log('The dialog was dismissed')
|
|
106
|
-
} else {
|
|
107
|
-
console.log('The dialog was confirmed')
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
protected handleInertButton(): void {
|
|
112
|
-
console.log('An inert button was clicked.')
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
contentTemplate(): TemplateResult {
|
|
116
|
-
return html`
|
|
117
|
-
<a href="../">Back</a>
|
|
118
|
-
${this.simpleDialog()} ${this.fullDialog()} ${this.overflowDialog()} ${this.formDialog()}
|
|
119
|
-
${this.destructiveDialog()} ${this.nonModalDialog()} ${this.renderImperativeDialog()}
|
|
120
|
-
`
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
simpleDialog(): TemplateResult {
|
|
124
|
-
return html`
|
|
125
|
-
<section class="demo-section">
|
|
126
|
-
<h2 class="title-large">Simple dialog</h2>
|
|
127
|
-
<ui-button color="filled" @click="${this.openSimple}">Open</ui-button>
|
|
128
|
-
<ui-dialog ?open="${this.simpleOpened}" @close="${this.basicClosed}">
|
|
129
|
-
<p>This is a confirmation dialog content</p>
|
|
130
|
-
<ui-button color="text" slot="button" value="dismiss">Dismiss</ui-button>
|
|
131
|
-
</ui-dialog>
|
|
132
|
-
</section>
|
|
133
|
-
`
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
fullDialog(): TemplateResult {
|
|
137
|
-
return html`
|
|
138
|
-
<section class="demo-section">
|
|
139
|
-
<h2 class="title-large">Full UI dialog</h2>
|
|
140
|
-
<ui-button color="filled" @click="${this.openFull}">Open</ui-button>
|
|
141
|
-
<ui-dialog ?open="${this.fullOpened}" @close="${this.fullClosed}" modal style="--ui-dialog-max-width: 380px">
|
|
142
|
-
<ui-icon slot="icon" icon="deleteOutline"></ui-icon>
|
|
143
|
-
<span slot="title">Reset settings?</span>
|
|
144
|
-
<p>
|
|
145
|
-
This will reset your app preferences back to their default settings. The following accounts will also be
|
|
146
|
-
signed out:
|
|
147
|
-
</p>
|
|
148
|
-
<ui-divider></ui-divider>
|
|
149
|
-
<ui-list>
|
|
150
|
-
<ui-list-item>email1@gmail.com</ui-list-item>
|
|
151
|
-
<ui-list-item>email2@gmail.com</ui-list-item>
|
|
152
|
-
</ui-list>
|
|
153
|
-
<ui-divider></ui-divider>
|
|
154
|
-
<ui-button color="text" slot="button" @click="${this.handleInertButton}">Learn more</ui-button>
|
|
155
|
-
<ui-button color="text" slot="button" value="dismiss">Cancel</ui-button>
|
|
156
|
-
<ui-button color="text" slot="button" value="confirm">Accept</ui-button>
|
|
157
|
-
</ui-dialog>
|
|
158
|
-
</section>
|
|
159
|
-
`
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
overflowDialog(): TemplateResult {
|
|
163
|
-
return html`
|
|
164
|
-
<section class="demo-section">
|
|
165
|
-
<h2 class="title-large">Overflow dialog</h2>
|
|
166
|
-
<p>This dialog contains a lot of content that will overflow the container.</p>
|
|
167
|
-
<ui-button color="filled" @click="${this.openOverflow}">Open</ui-button>
|
|
168
|
-
<ui-dialog
|
|
169
|
-
?open="${this.overflowOpened}"
|
|
170
|
-
@close="${this.overflowClosed}"
|
|
171
|
-
modal
|
|
172
|
-
style="--ui-dialog-max-width: 400px; --ui-dialog-max-height: 500px;"
|
|
173
|
-
>
|
|
174
|
-
<ui-icon slot="icon" icon="info"></ui-icon>
|
|
175
|
-
<span slot="title">Terms and Conditions</span>
|
|
176
|
-
<div style="overflow-y: auto; max-height: 300px;">
|
|
177
|
-
<h3>1. Introduction</h3>
|
|
178
|
-
<p>
|
|
179
|
-
Welcome to our application. These terms and conditions outline the rules and regulations for the use of
|
|
180
|
-
our software.
|
|
181
|
-
</p>
|
|
182
|
-
|
|
183
|
-
<h3>2. User Agreement</h3>
|
|
184
|
-
<p>
|
|
185
|
-
By accessing this application, we assume you accept these terms and conditions. Do not continue to use our
|
|
186
|
-
application if you do not agree to take all of the terms and conditions stated on this page.
|
|
187
|
-
</p>
|
|
188
|
-
|
|
189
|
-
<h3>3. Privacy Policy</h3>
|
|
190
|
-
<p>
|
|
191
|
-
Your privacy is important to us. Our Privacy Policy explains how we collect, use, and protect your
|
|
192
|
-
information when you use our service. By using our service, you agree to the collection and use of
|
|
193
|
-
information in accordance with our Privacy Policy.
|
|
194
|
-
</p>
|
|
195
|
-
|
|
196
|
-
<h3>4. Data Collection</h3>
|
|
197
|
-
<p>
|
|
198
|
-
We collect several different types of information for various purposes to provide and improve our service
|
|
199
|
-
to you. This includes:
|
|
200
|
-
</p>
|
|
201
|
-
<ul>
|
|
202
|
-
<li>
|
|
203
|
-
Personal Data: While using our service, we may ask you to provide us with certain personally
|
|
204
|
-
identifiable information.
|
|
205
|
-
</li>
|
|
206
|
-
<li>Usage Data: We may also collect information on how the service is accessed and used.</li>
|
|
207
|
-
<li>Tracking & Cookies Data: We use cookies and similar tracking technologies to track activity.</li>
|
|
208
|
-
</ul>
|
|
209
|
-
|
|
210
|
-
<h3>5. User Responsibilities</h3>
|
|
211
|
-
<p>
|
|
212
|
-
Users are responsible for maintaining the confidentiality of their account information and for all
|
|
213
|
-
activities that occur under their account. You agree to:
|
|
214
|
-
</p>
|
|
215
|
-
<ul>
|
|
216
|
-
<li>Provide accurate and complete information</li>
|
|
217
|
-
<li>Maintain the security of your password</li>
|
|
218
|
-
<li>Notify us immediately of any unauthorized use</li>
|
|
219
|
-
<li>Use the service in compliance with applicable laws</li>
|
|
220
|
-
</ul>
|
|
221
|
-
|
|
222
|
-
<h3>6. Prohibited Uses</h3>
|
|
223
|
-
<p>You may not use our service:</p>
|
|
224
|
-
<ul>
|
|
225
|
-
<li>For any unlawful purpose or to solicit others to perform acts</li>
|
|
226
|
-
<li>
|
|
227
|
-
To violate any international, federal, provincial, or state regulations, rules, laws, or local
|
|
228
|
-
ordinances
|
|
229
|
-
</li>
|
|
230
|
-
<li>
|
|
231
|
-
To infringe upon or violate our intellectual property rights or the intellectual property rights of
|
|
232
|
-
others
|
|
233
|
-
</li>
|
|
234
|
-
<li>To harass, abuse, insult, harm, defame, slander, disparage, intimidate, or discriminate</li>
|
|
235
|
-
<li>To submit false or misleading information</li>
|
|
236
|
-
</ul>
|
|
237
|
-
|
|
238
|
-
<h3>7. Intellectual Property</h3>
|
|
239
|
-
<p>
|
|
240
|
-
The service and its original content, features, and functionality are and will remain the exclusive
|
|
241
|
-
property of our company and its licensors. The service is protected by copyright, trademark, and other
|
|
242
|
-
laws.
|
|
243
|
-
</p>
|
|
244
|
-
|
|
245
|
-
<h3>8. Termination</h3>
|
|
246
|
-
<p>
|
|
247
|
-
We may terminate or suspend your account and bar access to the service immediately, without prior notice
|
|
248
|
-
or liability, under our sole discretion, for any reason whatsoever and without limitation.
|
|
249
|
-
</p>
|
|
250
|
-
|
|
251
|
-
<h3>9. Disclaimer</h3>
|
|
252
|
-
<p>
|
|
253
|
-
The information on this application is provided on an "as is" basis. To the fullest extent permitted by
|
|
254
|
-
law, this company excludes all representations, warranties, conditions and terms.
|
|
255
|
-
</p>
|
|
256
|
-
|
|
257
|
-
<h3>10. Limitation of Liability</h3>
|
|
258
|
-
<p>
|
|
259
|
-
In no event shall our company, nor its directors, employees, partners, agents, suppliers, or affiliates,
|
|
260
|
-
be liable for any indirect, incidental, special, consequential, or punitive damages.
|
|
261
|
-
</p>
|
|
262
|
-
|
|
263
|
-
<h3>11. Changes to Terms</h3>
|
|
264
|
-
<p>
|
|
265
|
-
We reserve the right, at our sole discretion, to modify or replace these terms at any time. If a revision
|
|
266
|
-
is material, we will provide at least 30 days notice prior to any new terms taking effect.
|
|
267
|
-
</p>
|
|
268
|
-
|
|
269
|
-
<h3>12. Contact Information</h3>
|
|
270
|
-
<p>
|
|
271
|
-
If you have any questions about these Terms and Conditions, please contact us at support@example.com or
|
|
272
|
-
through our contact form.
|
|
273
|
-
</p>
|
|
274
|
-
</div>
|
|
275
|
-
<ui-button color="text" slot="button" value="dismiss">Decline</ui-button>
|
|
276
|
-
<ui-button color="filled" slot="button" value="confirm">Accept</ui-button>
|
|
277
|
-
</ui-dialog>
|
|
278
|
-
</section>
|
|
279
|
-
`
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
formDialog(): TemplateResult {
|
|
283
|
-
return html`
|
|
284
|
-
<section class="demo-section">
|
|
285
|
-
<h2 class="title-large">Form dialog</h2>
|
|
286
|
-
<p>This dialog contains a form with validation and submit handling.</p>
|
|
287
|
-
<ui-button color="filled" @click="${this.openForm}">Open Form Dialog</ui-button>
|
|
288
|
-
<form @submit="${this.handleFormSubmit}" style="display: contents;">
|
|
289
|
-
<ui-dialog
|
|
290
|
-
?open="${this.formOpened}"
|
|
291
|
-
@close="${this.formClosed}"
|
|
292
|
-
modal
|
|
293
|
-
style="--ui-dialog-max-width: 500px;"
|
|
294
|
-
submitClose
|
|
295
|
-
>
|
|
296
|
-
<ui-icon slot="icon" icon="info"></ui-icon>
|
|
297
|
-
<span slot="title">User Registration</span>
|
|
298
|
-
|
|
299
|
-
<div style="display: flex; flex-direction: column; gap: 16px;">
|
|
300
|
-
<label style="display: flex; flex-direction: column; gap: 4px;">
|
|
301
|
-
<span style="font-weight: 500; color: var(--md-sys-color-on-surface);">Full Name *</span>
|
|
302
|
-
<input
|
|
303
|
-
type="text"
|
|
304
|
-
name="fullName"
|
|
305
|
-
required
|
|
306
|
-
style="padding: 12px; border: 1px solid var(--md-sys-color-outline); border-radius: 4px; font-size: 14px;"
|
|
307
|
-
placeholder="Enter your full name"
|
|
308
|
-
/>
|
|
309
|
-
</label>
|
|
310
|
-
|
|
311
|
-
<label style="display: flex; flex-direction: column; gap: 4px;">
|
|
312
|
-
<span style="font-weight: 500; color: var(--md-sys-color-on-surface);">Email *</span>
|
|
313
|
-
<input
|
|
314
|
-
type="email"
|
|
315
|
-
name="email"
|
|
316
|
-
required
|
|
317
|
-
style="padding: 12px; border: 1px solid var(--md-sys-color-outline); border-radius: 4px; font-size: 14px;"
|
|
318
|
-
placeholder="Enter your email address"
|
|
319
|
-
/>
|
|
320
|
-
</label>
|
|
321
|
-
|
|
322
|
-
<label style="display: flex; flex-direction: column; gap: 4px;">
|
|
323
|
-
<span style="font-weight: 500; color: var(--md-sys-color-on-surface);">Phone Number</span>
|
|
324
|
-
<input
|
|
325
|
-
type="tel"
|
|
326
|
-
name="phone"
|
|
327
|
-
style="padding: 12px; border: 1px solid var(--md-sys-color-outline); border-radius: 4px; font-size: 14px;"
|
|
328
|
-
placeholder="Enter your phone number (optional)"
|
|
329
|
-
/>
|
|
330
|
-
</label>
|
|
331
|
-
|
|
332
|
-
<label style="display: flex; flex-direction: column; gap: 4px;">
|
|
333
|
-
<span style="font-weight: 500; color: var(--md-sys-color-on-surface);">Department</span>
|
|
334
|
-
<select
|
|
335
|
-
name="department"
|
|
336
|
-
style="padding: 12px; border: 1px solid var(--md-sys-color-outline); border-radius: 4px; font-size: 14px; background: white;"
|
|
337
|
-
>
|
|
338
|
-
<option value="">Select a department</option>
|
|
339
|
-
<option value="engineering">Engineering</option>
|
|
340
|
-
<option value="design">Design</option>
|
|
341
|
-
<option value="marketing">Marketing</option>
|
|
342
|
-
<option value="sales">Sales</option>
|
|
343
|
-
<option value="support">Support</option>
|
|
344
|
-
</select>
|
|
345
|
-
</label>
|
|
346
|
-
|
|
347
|
-
<label style="display: flex; align-items: center; gap: 8px; margin-top: 8px;">
|
|
348
|
-
<input type="checkbox" name="newsletter" style="margin: 0;" />
|
|
349
|
-
<span style="font-size: 14px; color: var(--md-sys-color-on-surface);">
|
|
350
|
-
Subscribe to our newsletter
|
|
351
|
-
</span>
|
|
352
|
-
</label>
|
|
353
|
-
|
|
354
|
-
<label style="display: flex; align-items: center; gap: 8px;">
|
|
355
|
-
<input type="checkbox" name="terms" required style="margin: 0;" />
|
|
356
|
-
<span style="font-size: 14px; color: var(--md-sys-color-on-surface);">
|
|
357
|
-
I agree to the <a href="#" style="color: var(--md-sys-color-primary);">Terms and Conditions</a> *
|
|
358
|
-
</span>
|
|
359
|
-
</label>
|
|
360
|
-
</div>
|
|
361
|
-
|
|
362
|
-
<ui-button color="text" slot="button" value="dismiss">Cancel</ui-button>
|
|
363
|
-
<ui-button color="filled" slot="button" value="confirm" type="submit">Register</ui-button>
|
|
364
|
-
</ui-dialog>
|
|
365
|
-
</form>
|
|
366
|
-
</section>
|
|
367
|
-
`
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
protected handleFormSubmit(e: CustomEvent): void {
|
|
371
|
-
e.preventDefault()
|
|
372
|
-
|
|
373
|
-
// Get form data from the event
|
|
374
|
-
const form = e.target as HTMLFormElement
|
|
375
|
-
const formData = new FormData(form)
|
|
376
|
-
|
|
377
|
-
// Convert to regular object for easier handling
|
|
378
|
-
const data: Record<string, string | boolean> = {}
|
|
379
|
-
for (const [key, value] of formData.entries()) {
|
|
380
|
-
if (key === 'newsletter' || key === 'terms') {
|
|
381
|
-
data[key] = value === 'on'
|
|
382
|
-
} else {
|
|
383
|
-
data[key] = value as string
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
console.log('Form submitted with data:', data)
|
|
388
|
-
|
|
389
|
-
// Simulate form validation
|
|
390
|
-
if (!data.fullName || !data.email) {
|
|
391
|
-
console.error('Required fields are missing')
|
|
392
|
-
return
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
if (!data.terms) {
|
|
396
|
-
console.error('Terms and conditions must be accepted')
|
|
397
|
-
return
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
// If validation passes, the dialog will close automatically
|
|
401
|
-
console.log('Registration successful!', data)
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
renderImperativeDialog(): TemplateResult {
|
|
405
|
-
return html`
|
|
406
|
-
<section class="demo-section">
|
|
407
|
-
<h2 class="title-large">Imperative dialog</h2>
|
|
408
|
-
<p>This dialog is created using imperative API.</p>
|
|
409
|
-
<ui-button color="filled" @click="${this.openImperative}">Open</ui-button>
|
|
410
|
-
</section>
|
|
411
|
-
`
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
destructiveDialog(): TemplateResult {
|
|
415
|
-
return html`
|
|
416
|
-
<section class="demo-section">
|
|
417
|
-
<h2 class="title-large">Destructive dialog</h2>
|
|
418
|
-
<p>This dialog demonstrates the destructive attribute for dangerous actions.</p>
|
|
419
|
-
<ui-button color="filled" @click="${this.openDestructive}">Open destructive dialog</ui-button>
|
|
420
|
-
<ui-dialog
|
|
421
|
-
?open="${this.destructiveOpened}"
|
|
422
|
-
@close="${this.destructiveClosed}"
|
|
423
|
-
modal
|
|
424
|
-
confirmLabel="Delete"
|
|
425
|
-
dismissLabel="Cancel"
|
|
426
|
-
destructive
|
|
427
|
-
>
|
|
428
|
-
<ui-icon slot="icon" icon="warning"></ui-icon>
|
|
429
|
-
<span slot="title">Delete Account</span>
|
|
430
|
-
<p>
|
|
431
|
-
Are you sure you want to permanently delete your account? This action cannot be undone and all your data
|
|
432
|
-
will be lost.
|
|
433
|
-
</p>
|
|
434
|
-
</ui-dialog>
|
|
435
|
-
</section>
|
|
436
|
-
`
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
nonModalDialog(): TemplateResult {
|
|
440
|
-
return html`
|
|
441
|
-
<section class="demo-section">
|
|
442
|
-
<h2 class="title-large">Non-modal dialog</h2>
|
|
443
|
-
<p>This dialog demonstrates a non-modal dialog that is centered in the viewport.</p>
|
|
444
|
-
<ui-button color="filled" @click="${this.openNonModal}">Open non-modal dialog</ui-button>
|
|
445
|
-
<ui-dialog
|
|
446
|
-
?open="${this.nonModalOpened}"
|
|
447
|
-
@close="${this.nonModalClosed}"
|
|
448
|
-
confirmLabel="Got it"
|
|
449
|
-
dismissLabel="Close"
|
|
450
|
-
>
|
|
451
|
-
<ui-icon slot="icon" icon="info"></ui-icon>
|
|
452
|
-
<span slot="title">Non-Modal Information</span>
|
|
453
|
-
<p>
|
|
454
|
-
This is a non-modal dialog. Unlike modal dialogs, you can still interact with the content behind this
|
|
455
|
-
dialog. The dialog is automatically centered in the viewport and maintains the smooth opening animation.
|
|
456
|
-
</p>
|
|
457
|
-
<p>
|
|
458
|
-
Non-modal dialogs are useful for displaying information that doesn't require the user's full attention or
|
|
459
|
-
when you want to allow interaction with the background content.
|
|
460
|
-
</p>
|
|
461
|
-
</ui-dialog>
|
|
462
|
-
</section>
|
|
463
|
-
`
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
const instance = new ComponentDemoPage()
|
|
468
|
-
instance.render()
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en-GB">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8">
|
|
5
|
-
<meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes">
|
|
6
|
-
<title>UI list</title>
|
|
7
|
-
<link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap" rel="stylesheet">
|
|
8
|
-
<link href="../../../src/styles/m3/tokens.css" rel="stylesheet" type="text/css" />
|
|
9
|
-
<link href="../../../src/styles/m3/theme.css" rel="stylesheet" type="text/css" />
|
|
10
|
-
<style>
|
|
11
|
-
.demo-row {
|
|
12
|
-
margin: 20px 0;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.button-in-lists {
|
|
16
|
-
display: inline-block;
|
|
17
|
-
vertical-align: top;
|
|
18
|
-
width: 48px;
|
|
19
|
-
height: 48px;
|
|
20
|
-
overflow: hidden;
|
|
21
|
-
|
|
22
|
-
margin-right: 40px;;
|
|
23
|
-
}
|
|
24
|
-
</style>
|
|
25
|
-
</head>
|
|
26
|
-
<body>
|
|
27
|
-
<div id="app"></div>
|
|
28
|
-
|
|
29
|
-
<script type="module" src="/.tmp/demo/md/dropdown-list/index.js"></script>
|
|
30
|
-
</body>
|
|
31
|
-
</html>
|