@api-client/ui 0.5.39 → 0.5.41

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.
Files changed (292) hide show
  1. package/build/src/elements/contextual-menu/{internals/ContextualMenu.d.ts → ContextualMenu.d.ts} +11 -6
  2. package/build/src/elements/contextual-menu/ContextualMenu.d.ts.map +1 -0
  3. package/build/src/elements/contextual-menu/{internals/ContextualMenu.js → ContextualMenu.js} +25 -3
  4. package/build/src/elements/contextual-menu/ContextualMenu.js.map +1 -0
  5. package/build/src/elements/contextual-menu/internals/types.d.ts +16 -7
  6. package/build/src/elements/contextual-menu/internals/types.d.ts.map +1 -1
  7. package/build/src/elements/contextual-menu/internals/types.js.map +1 -1
  8. package/build/tsconfig.tsbuildinfo +1 -0
  9. package/package.json +1 -1
  10. package/src/elements/contextual-menu/{internals/ContextualMenu.ts → ContextualMenu.ts} +31 -7
  11. package/src/elements/contextual-menu/internals/types.ts +17 -7
  12. package/.aiexclude +0 -3
  13. package/.cursor/rules/html-and-css-best-practices.mdc +0 -63
  14. package/.cursor/rules/lit-best-practices.mdc +0 -89
  15. package/.editorconfig +0 -29
  16. package/.github/CONTRIBUTING.md +0 -24
  17. package/.github/instructions/html-and-css-best-practices.instructions.md +0 -70
  18. package/.github/instructions/lit-best-practices.instructions.md +0 -90
  19. package/.github/release.yml +0 -14
  20. package/.github/stale.yml +0 -23
  21. package/.github/workflows/auto-release.yml +0 -182
  22. package/.github/workflows/release.yml +0 -82
  23. package/.prettierrc.js +0 -14
  24. package/.vscode/settings.json +0 -18
  25. package/RELEASE.md +0 -163
  26. package/RELEASE_SETUP.md +0 -235
  27. package/build/src/demo/DemoPage.d.ts +0 -81
  28. package/build/src/demo/DemoPage.d.ts.map +0 -1
  29. package/build/src/demo/DemoPage.js +0 -175
  30. package/build/src/demo/DemoPage.js.map +0 -1
  31. package/build/src/demo/DemoStyles.d.ts +0 -3
  32. package/build/src/demo/DemoStyles.d.ts.map +0 -1
  33. package/build/src/demo/DemoStyles.js +0 -60
  34. package/build/src/demo/DemoStyles.js.map +0 -1
  35. package/build/src/elements/contextual-menu/internals/ContextualMenu.d.ts.map +0 -1
  36. package/build/src/elements/contextual-menu/internals/ContextualMenu.js.map +0 -1
  37. package/build/test/elements/navigation/Navigation.test.d.ts +0 -3
  38. package/build/test/elements/navigation/Navigation.test.d.ts.map +0 -1
  39. package/build/test/elements/navigation/Navigation.test.js +0 -113
  40. package/build/test/elements/navigation/Navigation.test.js.map +0 -1
  41. package/commitlint.config.cjs +0 -2
  42. package/demo/elements/authorization/AuthPlugin.js +0 -57
  43. package/demo/elements/authorization/AuthProxy.js +0 -215
  44. package/demo/elements/authorization/api-key.html +0 -27
  45. package/demo/elements/authorization/api-key.ts +0 -44
  46. package/demo/elements/authorization/basic.html +0 -27
  47. package/demo/elements/authorization/basic.ts +0 -43
  48. package/demo/elements/authorization/bearer.html +0 -27
  49. package/demo/elements/authorization/bearer.ts +0 -43
  50. package/demo/elements/authorization/env.js +0 -8
  51. package/demo/elements/authorization/index.html +0 -44
  52. package/demo/elements/authorization/ntlm.html +0 -27
  53. package/demo/elements/authorization/ntlm.ts +0 -43
  54. package/demo/elements/authorization/oauth-authorize.html +0 -75
  55. package/demo/elements/authorization/oauth-authorize.ts +0 -40
  56. package/demo/elements/authorization/oauth-error.html +0 -18
  57. package/demo/elements/authorization/oauth-error.ts +0 -10
  58. package/demo/elements/authorization/oauth-popup.html +0 -36
  59. package/demo/elements/authorization/oauth2.html +0 -27
  60. package/demo/elements/authorization/oauth2.ts +0 -100
  61. package/demo/elements/authorization/oidc.html +0 -27
  62. package/demo/elements/authorization/oidc.ts +0 -139
  63. package/demo/elements/authorization/private.crt +0 -31
  64. package/demo/elements/authorization/private.csr +0 -28
  65. package/demo/elements/authorization/private.key +0 -51
  66. package/demo/elements/authorization/private.pem +0 -31
  67. package/demo/elements/authorization/redirect.html +0 -20
  68. package/demo/elements/authorization/ssl-commands.sh +0 -30
  69. package/demo/elements/authorization/ssl.conf +0 -24
  70. package/demo/elements/autocomplete/index.html +0 -64
  71. package/demo/elements/autocomplete/index.ts +0 -171
  72. package/demo/elements/code-editor/CodeEditorDemo.ts +0 -173
  73. package/demo/elements/code-editor/index.html +0 -19
  74. package/demo/elements/context-menu/DemoIcons.ts +0 -21
  75. package/demo/elements/context-menu/basic.html +0 -25
  76. package/demo/elements/context-menu/basic.ts +0 -119
  77. package/demo/elements/context-menu/custom-data.html +0 -25
  78. package/demo/elements/context-menu/custom-data.ts +0 -62
  79. package/demo/elements/context-menu/demo.css +0 -28
  80. package/demo/elements/context-menu/enabled-state.html +0 -25
  81. package/demo/elements/context-menu/enabled-state.ts +0 -73
  82. package/demo/elements/context-menu/icons.html +0 -25
  83. package/demo/elements/context-menu/icons.ts +0 -64
  84. package/demo/elements/context-menu/index.html +0 -43
  85. package/demo/elements/context-menu/nested.html +0 -25
  86. package/demo/elements/context-menu/nestedt.ts +0 -152
  87. package/demo/elements/context-menu/no-execute.html +0 -25
  88. package/demo/elements/context-menu/no-execute.ts +0 -134
  89. package/demo/elements/context-menu/radio-menu.html +0 -25
  90. package/demo/elements/context-menu/radio-menu.ts +0 -83
  91. package/demo/elements/context-menu/separators.html +0 -25
  92. package/demo/elements/context-menu/separators.ts +0 -172
  93. package/demo/elements/currency/index.html +0 -91
  94. package/demo/elements/currency/index.ts +0 -352
  95. package/demo/elements/environment/environment-editor.html +0 -20
  96. package/demo/elements/environment/environment-editor.ts +0 -49
  97. package/demo/elements/environment/index.html +0 -33
  98. package/demo/elements/environment/server-editor.html +0 -20
  99. package/demo/elements/environment/server-editor.ts +0 -67
  100. package/demo/elements/environment/variables-editor.html +0 -20
  101. package/demo/elements/environment/variables-editor.ts +0 -94
  102. package/demo/elements/har/har-viewer.html +0 -20
  103. package/demo/elements/har/har-viewer.ts +0 -76
  104. package/demo/elements/har/har1.har +0 -3044
  105. package/demo/elements/har/har2.json +0 -439
  106. package/demo/elements/har/index.html +0 -26
  107. package/demo/elements/highlight/example.md +0 -27
  108. package/demo/elements/highlight/index.html +0 -31
  109. package/demo/elements/highlight/marked-highlight.html +0 -132
  110. package/demo/elements/highlight/marked-highlight.ts +0 -22
  111. package/demo/elements/highlight/prism-highlight.html +0 -62
  112. package/demo/elements/highlight/prism-highlight.ts +0 -17
  113. package/demo/elements/http/body-editor.html +0 -17
  114. package/demo/elements/http/body-editor.ts +0 -115
  115. package/demo/elements/http/headers.html +0 -17
  116. package/demo/elements/http/headers.ts +0 -59
  117. package/demo/elements/http/http-assertions.html +0 -20
  118. package/demo/elements/http/http-assertions.ts +0 -89
  119. package/demo/elements/http/http-flows.html +0 -23
  120. package/demo/elements/http/http-flows.ts +0 -89
  121. package/demo/elements/http/index.html +0 -45
  122. package/demo/elements/http/request-editor.html +0 -26
  123. package/demo/elements/http/request-editor.ts +0 -197
  124. package/demo/elements/http/request-log.html +0 -16
  125. package/demo/elements/http/request-log.ts +0 -136
  126. package/demo/elements/http/url-editing.html +0 -17
  127. package/demo/elements/http/url-editing.ts +0 -112
  128. package/demo/elements/icons/index.html +0 -81
  129. package/demo/elements/icons/index.ts +0 -52
  130. package/demo/elements/index.html +0 -72
  131. package/demo/elements/mention-textarea/index.html +0 -19
  132. package/demo/elements/mention-textarea/index.ts +0 -205
  133. package/demo/elements/navigation/navigation-item.html +0 -49
  134. package/demo/elements/navigation/navigation-item.ts +0 -131
  135. package/demo/elements/navigation/navigation.html +0 -20
  136. package/demo/elements/navigation/navigation.ts +0 -45
  137. package/demo/elements/project/index.html +0 -29
  138. package/demo/elements/project/project-run-report.html +0 -20
  139. package/demo/elements/project/project-run-report.ts +0 -132
  140. package/demo/elements/project/request-editor.html +0 -23
  141. package/demo/elements/project/request-editor.ts +0 -232
  142. package/demo/elements/user/user-avatar.html +0 -17
  143. package/demo/elements/user/user-avatar.ts +0 -60
  144. package/demo/env.js +0 -4
  145. package/demo/index.html +0 -34
  146. package/demo/layout/index.html +0 -94
  147. package/demo/layout/index.ts +0 -190
  148. package/demo/md/DemoStyles.ts +0 -61
  149. package/demo/md/UiDemoPage.ts +0 -6
  150. package/demo/md/buttons/button.html +0 -121
  151. package/demo/md/buttons/button.ts +0 -246
  152. package/demo/md/buttons/group.html +0 -36
  153. package/demo/md/buttons/group.ts +0 -171
  154. package/demo/md/checkbox/index.html +0 -39
  155. package/demo/md/checkbox/index.ts +0 -220
  156. package/demo/md/chip/chip.html +0 -70
  157. package/demo/md/chip/chip.ts +0 -219
  158. package/demo/md/chip/pawel6c9a.jpg +0 -0
  159. package/demo/md/collapse/CustomDetail.ts +0 -89
  160. package/demo/md/collapse/collapse.html +0 -21
  161. package/demo/md/collapse/collapse.ts +0 -78
  162. package/demo/md/date-picker/date-picker.ts +0 -336
  163. package/demo/md/date-picker/index.html +0 -171
  164. package/demo/md/dialog/confirm-dialog.html +0 -49
  165. package/demo/md/dialog/confirm-dialog.ts +0 -121
  166. package/demo/md/dialog/dialog.html +0 -25
  167. package/demo/md/dialog/dialog.ts +0 -468
  168. package/demo/md/dropdown-list/index.html +0 -31
  169. package/demo/md/dropdown-list/index.ts +0 -158
  170. package/demo/md/icon-button/index.html +0 -122
  171. package/demo/md/icon-button/index.ts +0 -132
  172. package/demo/md/index.html +0 -73
  173. package/demo/md/inputs/input.html +0 -73
  174. package/demo/md/inputs/input.ts +0 -278
  175. package/demo/md/inputs/radio.html +0 -39
  176. package/demo/md/inputs/radio.ts +0 -156
  177. package/demo/md/inputs/switch.html +0 -45
  178. package/demo/md/inputs/switch.ts +0 -144
  179. package/demo/md/list/list.html +0 -65
  180. package/demo/md/list/list.ts +0 -204
  181. package/demo/md/listbox/listbox.html +0 -31
  182. package/demo/md/listbox/listbox.ts +0 -27
  183. package/demo/md/menu/index.html +0 -19
  184. package/demo/md/menu/index.ts +0 -514
  185. package/demo/md/notification/snack.html +0 -21
  186. package/demo/md/notification/snack.ts +0 -70
  187. package/demo/md/progress/progress.html +0 -46
  188. package/demo/md/progress/progress.ts +0 -161
  189. package/demo/md/segmented-button/index.html +0 -21
  190. package/demo/md/segmented-button/index.ts +0 -55
  191. package/demo/md/select/index.html +0 -16
  192. package/demo/md/select/index.ts +0 -217
  193. package/demo/md/tabs/tabs.html +0 -40
  194. package/demo/md/tabs/tabs.ts +0 -214
  195. package/demo/oauth-popup.html +0 -36
  196. package/demo/page.css +0 -8
  197. package/demo/resources/calendar-month.png +0 -0
  198. package/demo/resources/favorite.png +0 -0
  199. package/demo/resources/fingerprint.png +0 -0
  200. package/demo/resources/home-work.png +0 -0
  201. package/demo/resources/mood.png +0 -0
  202. package/demo/resources/print.png +0 -0
  203. package/demo/resources/stars.png +0 -0
  204. package/demo/resources/theaters.png +0 -0
  205. package/demo/tsconfig.json +0 -4
  206. package/eslint.config.js +0 -97
  207. package/scripts/copy-assets.js +0 -21
  208. package/scripts/release.js +0 -66
  209. package/src/demo/DemoPage.ts +0 -169
  210. package/src/demo/DemoStyles.ts +0 -60
  211. package/test/README.md +0 -375
  212. package/test/contextual-menu/ContextMenu.test.ts +0 -760
  213. package/test/contextual-menu/ContextMenuElement.test.ts +0 -569
  214. package/test/core/activity.spec.ts +0 -413
  215. package/test/core/activity_manager.spec.ts +0 -544
  216. package/test/core/application.spec.ts +0 -218
  217. package/test/core/fragment.spec.ts +0 -565
  218. package/test/core/fragment_manager.spec.ts +0 -404
  219. package/test/core/live_data.spec.ts +0 -558
  220. package/test/core/renderer.spec.ts +0 -113
  221. package/test/dom-assertions.test.ts +0 -182
  222. package/test/elements/MonacoSetup.ts +0 -65
  223. package/test/elements/authorization/basic-method.test.ts +0 -177
  224. package/test/elements/authorization/bearer-method.test.ts +0 -143
  225. package/test/elements/authorization/ntlm-method.test.ts +0 -219
  226. package/test/elements/authorization/oauth2-client-credentials-method.test.ts +0 -334
  227. package/test/elements/authorization/oauth2-code-method.test.ts +0 -320
  228. package/test/elements/authorization/oauth2-custom-grant-method.test.ts +0 -255
  229. package/test/elements/authorization/oauth2-device-code-method.test.ts +0 -371
  230. package/test/elements/authorization/oauth2-implicit-method.test.ts +0 -407
  231. package/test/elements/authorization/oauth2-jwt-method.test.ts +0 -217
  232. package/test/elements/authorization/oauth2-password-method.test.ts +0 -275
  233. package/test/elements/authorization/openid-method.test.ts +0 -591
  234. package/test/elements/autocomplete/autocomplete-input.spec.ts +0 -646
  235. package/test/elements/code-editor/code-editor.accessibility.test.ts +0 -298
  236. package/test/elements/code-editor/code-editor.test.ts +0 -574
  237. package/test/elements/currency/CurrencyPicker.accessibility.test.ts +0 -328
  238. package/test/elements/currency/CurrencyPicker.core.test.ts +0 -318
  239. package/test/elements/currency/CurrencyPicker.integration.test.ts +0 -482
  240. package/test/elements/currency/CurrencyPicker.test.ts +0 -486
  241. package/test/elements/data-table/DataTable.browser.test.ts +0 -649
  242. package/test/elements/har/HarUtils.test.ts +0 -45
  243. package/test/elements/har/HarViewerElement.test.ts +0 -687
  244. package/test/elements/har/test-data/har1.har +0 -3044
  245. package/test/elements/highlight/MarkedHighlightElement.test.ts +0 -452
  246. package/test/elements/highlight/PrismHighlightElement.test.ts +0 -79
  247. package/test/elements/highlight/PrismHighlighter.test.ts +0 -94
  248. package/test/elements/highlight/remoteSanitization.md +0 -1
  249. package/test/elements/highlight/test.md +0 -3
  250. package/test/elements/highlight/test1.md +0 -3
  251. package/test/elements/highlight/test2.md +0 -1
  252. package/test/elements/http/BodyFormdataEditorElement.test.ts +0 -482
  253. package/test/elements/http/BodyMultipartEditorElement.test.ts +0 -658
  254. package/test/elements/http/BodyRawEditorElement.test.ts +0 -90
  255. package/test/elements/http/CertificateAdd.test.ts +0 -457
  256. package/test/elements/http/HttpAssertions.test.ts +0 -994
  257. package/test/elements/http/HttpFlows.test.ts +0 -502
  258. package/test/elements/http/UrlEncodeUtils.test.ts +0 -202
  259. package/test/elements/layout/SplitItem.test.ts +0 -440
  260. package/test/elements/layout/SplitLayoutManager.test.ts +0 -1501
  261. package/test/elements/layout/SplitPanel.test.ts +0 -1109
  262. package/test/elements/mention-textarea/MentionTextArea.basic.test.ts +0 -114
  263. package/test/elements/mention-textarea/MentionTextArea.test.ts +0 -613
  264. package/test/elements/navigation/Navigation.test.ts +0 -120
  265. package/test/env.ts +0 -15
  266. package/test/events/EventTypes.test.ts +0 -363
  267. package/test/events/EventsTestHelpers.ts +0 -16
  268. package/test/helpers/TestUtils.ts +0 -243
  269. package/test/helpers/UiMock.ts +0 -185
  270. package/test/lib/Dom.test.ts +0 -231
  271. package/test/md/button/UiButton.test.ts +0 -347
  272. package/test/md/button/UiIconButton.test.ts +0 -155
  273. package/test/md/chip/UiChip.test.ts +0 -219
  274. package/test/md/collapse/UiCollapse.test.ts +0 -250
  275. package/test/md/collapse/flex-layout.test.ts +0 -105
  276. package/test/md/date-time/DateTime.test.ts +0 -348
  277. package/test/md/dialog/UiConfirmDialog.test.ts +0 -131
  278. package/test/md/dialog/UiDialog.test.ts +0 -759
  279. package/test/md/menu/Menu.test.ts +0 -855
  280. package/test/md/menu/MenuIntegration.test.ts +0 -426
  281. package/test/md/menu/MenuItem.test.ts +0 -652
  282. package/test/md/menu/SubMenu.test.ts +0 -410
  283. package/test/md/progress/UiCircularProgressElement.test.ts +0 -481
  284. package/test/md/progress/UiProgressElement.test.ts +0 -117
  285. package/test/md/progress/UiRangeElement.test.ts +0 -156
  286. package/test/md/select/Select.test.ts +0 -925
  287. package/test/plugins/takeScreenshotPlugin.js +0 -35
  288. package/test/setup.test.ts +0 -217
  289. package/test/setup.ts +0 -117
  290. package/test/tsconfig.json +0 -7
  291. package/web-dev-server.config.js +0 -21
  292. 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>
@@ -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>