@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.
- package/build/src/elements/contextual-menu/{internals/ContextualMenu.d.ts → ContextualMenu.d.ts} +11 -6
- package/build/src/elements/contextual-menu/ContextualMenu.d.ts.map +1 -0
- package/build/src/elements/contextual-menu/{internals/ContextualMenu.js → ContextualMenu.js} +25 -3
- package/build/src/elements/contextual-menu/ContextualMenu.js.map +1 -0
- package/build/src/elements/contextual-menu/internals/types.d.ts +16 -7
- package/build/src/elements/contextual-menu/internals/types.d.ts.map +1 -1
- package/build/src/elements/contextual-menu/internals/types.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -0
- package/package.json +1 -1
- package/src/elements/contextual-menu/{internals/ContextualMenu.ts → ContextualMenu.ts} +31 -7
- package/src/elements/contextual-menu/internals/types.ts +17 -7
- 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/src/elements/contextual-menu/internals/ContextualMenu.d.ts.map +0 -1
- package/build/src/elements/contextual-menu/internals/ContextualMenu.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 -217
- 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,33 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en-GB">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8">
|
|
5
|
-
<title>API Client UI</title>
|
|
6
|
-
<link
|
|
7
|
-
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"
|
|
8
|
-
rel="stylesheet"
|
|
9
|
-
/>
|
|
10
|
-
<link href="../../../src/styles/m3/tokens.css" rel="stylesheet" type="text/css" />
|
|
11
|
-
<link href="../../../src/styles/m3/theme.css" rel="stylesheet" type="text/css" />
|
|
12
|
-
<link href="../../page.css" rel="stylesheet" type="text/css" />
|
|
13
|
-
</head>
|
|
14
|
-
<body>
|
|
15
|
-
<main>
|
|
16
|
-
<h1>The UI library for environments</h1>
|
|
17
|
-
<a href="../">Back</a>
|
|
18
|
-
<nav>
|
|
19
|
-
<h2>Elements</h2>
|
|
20
|
-
<dl>
|
|
21
|
-
<dt><a href="environment-editor.html">Environment editor</a></dt>
|
|
22
|
-
<dd>Editor for an Environment.</dd>
|
|
23
|
-
|
|
24
|
-
<dt><a href="server-editor.html">Server editor</a></dt>
|
|
25
|
-
<dd>Editor for a Server.</dd>
|
|
26
|
-
|
|
27
|
-
<dt><a href="variables-editor.html">Variables editor</a></dt>
|
|
28
|
-
<dd>Editor for a list of variables.</dd>
|
|
29
|
-
</dl>
|
|
30
|
-
</nav>
|
|
31
|
-
</main>
|
|
32
|
-
</body>
|
|
33
|
-
</html>
|
|
@@ -1,20 +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>Server editor</title>
|
|
7
|
-
<link
|
|
8
|
-
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"
|
|
9
|
-
rel="stylesheet"
|
|
10
|
-
/>
|
|
11
|
-
<link href="../../../src/styles/m3/tokens.css" rel="stylesheet" type="text/css" />
|
|
12
|
-
<link href="../../../src/styles/m3/theme.css" rel="stylesheet" type="text/css" />
|
|
13
|
-
<link href="../../page.css" rel="stylesheet" type="text/css" />
|
|
14
|
-
</head>
|
|
15
|
-
<body>
|
|
16
|
-
<div id="app"></div>
|
|
17
|
-
|
|
18
|
-
<script type="module" src="/.tmp/demo/elements/environment/server-editor.js"></script>
|
|
19
|
-
</body>
|
|
20
|
-
</html>
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { html, TemplateResult } from 'lit'
|
|
2
|
-
import { IServer } from '@api-client/core/models/Server.js'
|
|
3
|
-
import { DemoPage } from '../../../src/demo/DemoPage.js'
|
|
4
|
-
import { reactive } from '../../../src/decorators/index.js'
|
|
5
|
-
import ServerEditor from '../../../src/elements/environment/ServerEditor.js'
|
|
6
|
-
import '../../../src/define/environment/server-editor.js'
|
|
7
|
-
|
|
8
|
-
const storeKey = 'api-client.demo.elements.environment.server-editor'
|
|
9
|
-
|
|
10
|
-
class ComponentDemoPage extends DemoPage {
|
|
11
|
-
override accessor componentName = 'Server editor'
|
|
12
|
-
|
|
13
|
-
@reactive() accessor server: IServer | undefined
|
|
14
|
-
|
|
15
|
-
constructor() {
|
|
16
|
-
super()
|
|
17
|
-
this.restoreValues()
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
restoreValues(): void {
|
|
21
|
-
const data = localStorage.getItem(storeKey)
|
|
22
|
-
if (!data) {
|
|
23
|
-
return
|
|
24
|
-
}
|
|
25
|
-
try {
|
|
26
|
-
this.server = JSON.parse(data) as IServer
|
|
27
|
-
} catch {
|
|
28
|
-
// ...
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
storeValues(): void {
|
|
33
|
-
const { server } = this
|
|
34
|
-
if (!server) {
|
|
35
|
-
localStorage.removeItem(storeKey)
|
|
36
|
-
} else {
|
|
37
|
-
localStorage.setItem(storeKey, JSON.stringify(server))
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
_changedHandler(): void {
|
|
42
|
-
console.log('change')
|
|
43
|
-
const editor = document.querySelector('server-editor') as ServerEditor
|
|
44
|
-
this.server = editor.getSchema()
|
|
45
|
-
this.storeValues()
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
contentTemplate(): TemplateResult {
|
|
49
|
-
const { server } = this
|
|
50
|
-
const { uri, basePath, description, protocol } = server || {}
|
|
51
|
-
return html`
|
|
52
|
-
<a href="./">Back</a>
|
|
53
|
-
<section class="demo-section">
|
|
54
|
-
<server-editor
|
|
55
|
-
.uri="${uri}"
|
|
56
|
-
.basePath="${basePath}"
|
|
57
|
-
.description="${description}"
|
|
58
|
-
.protocol="${protocol}"
|
|
59
|
-
@change="${this._changedHandler}"
|
|
60
|
-
></server-editor>
|
|
61
|
-
</section>
|
|
62
|
-
`
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const instance = new ComponentDemoPage()
|
|
67
|
-
instance.render()
|
|
@@ -1,20 +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>Variables editor</title>
|
|
7
|
-
<link
|
|
8
|
-
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"
|
|
9
|
-
rel="stylesheet"
|
|
10
|
-
/>
|
|
11
|
-
<link href="../../../src/styles/m3/tokens.css" rel="stylesheet" type="text/css" />
|
|
12
|
-
<link href="../../../src/styles/m3/theme.css" rel="stylesheet" type="text/css" />
|
|
13
|
-
<link href="../../page.css" rel="stylesheet" type="text/css" />
|
|
14
|
-
</head>
|
|
15
|
-
<body>
|
|
16
|
-
<div id="app"></div>
|
|
17
|
-
|
|
18
|
-
<script type="module" src="/.tmp/demo/elements/environment/variables-editor.js"></script>
|
|
19
|
-
</body>
|
|
20
|
-
</html>
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { html, TemplateResult } from 'lit'
|
|
2
|
-
import { IProperty, Property } from '@api-client/core/models/Property.js'
|
|
3
|
-
import { DemoPage } from '../../../src/demo/DemoPage.js'
|
|
4
|
-
import { reactive } from '../../../src/decorators/index.js'
|
|
5
|
-
import env from '../../env.js'
|
|
6
|
-
import VariablesEditor from '../../../src/elements/environment/VariablesEditor.js'
|
|
7
|
-
|
|
8
|
-
import '../../../src/define/environment/variables-editor.js'
|
|
9
|
-
import '../../../src/md/button/ui-button.js'
|
|
10
|
-
|
|
11
|
-
const storeKey = 'api-client.demo.elements.environment.variables-editor'
|
|
12
|
-
|
|
13
|
-
class ComponentDemoPage extends DemoPage {
|
|
14
|
-
override accessor componentName = 'Variables editor'
|
|
15
|
-
|
|
16
|
-
@reactive() accessor variables: IProperty[] | undefined
|
|
17
|
-
|
|
18
|
-
constructor() {
|
|
19
|
-
super()
|
|
20
|
-
this.restoreValues()
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
fromEnvironment(): void {
|
|
24
|
-
const result: IProperty[] = []
|
|
25
|
-
const vars = env.systemVariables as Record<string, string>
|
|
26
|
-
Object.keys(vars).forEach((key) => {
|
|
27
|
-
const value = vars[key]
|
|
28
|
-
const prop = Property.String(key, String(value))
|
|
29
|
-
result.push(prop.toJSON())
|
|
30
|
-
})
|
|
31
|
-
this.variables = result
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
restoreValues(): void {
|
|
35
|
-
const data = localStorage.getItem(storeKey)
|
|
36
|
-
if (!data) {
|
|
37
|
-
this.fromEnvironment()
|
|
38
|
-
return
|
|
39
|
-
}
|
|
40
|
-
try {
|
|
41
|
-
const list = JSON.parse(data) as IProperty[]
|
|
42
|
-
if (Array.isArray(list)) {
|
|
43
|
-
this.variables = list
|
|
44
|
-
} else {
|
|
45
|
-
this.fromEnvironment()
|
|
46
|
-
}
|
|
47
|
-
} catch {
|
|
48
|
-
this.fromEnvironment()
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
storeValues(): void {
|
|
53
|
-
const { variables } = this
|
|
54
|
-
if (!variables) {
|
|
55
|
-
localStorage.removeItem(storeKey)
|
|
56
|
-
} else {
|
|
57
|
-
localStorage.setItem(storeKey, JSON.stringify(variables))
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
loadSystem(): void {
|
|
62
|
-
this.fromEnvironment()
|
|
63
|
-
this.storeValues()
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
_changedHandler(): void {
|
|
67
|
-
console.log('change')
|
|
68
|
-
const editor = document.querySelector('variables-editor') as VariablesEditor
|
|
69
|
-
this.variables = editor.variables
|
|
70
|
-
this.storeValues()
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
contentTemplate(): TemplateResult {
|
|
74
|
-
return html`
|
|
75
|
-
<a href="./">Back</a>
|
|
76
|
-
${this.renderDataControl()}
|
|
77
|
-
<section class="demo-section">
|
|
78
|
-
<variables-editor .variables="${this.variables}" @change="${this._changedHandler}"></variables-editor>
|
|
79
|
-
</section>
|
|
80
|
-
`
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
renderDataControl(): TemplateResult {
|
|
84
|
-
return html`
|
|
85
|
-
<section class="demo-section">
|
|
86
|
-
<h2 class="title-large">Data control</h2>
|
|
87
|
-
<ui-button color="outlined" @click="${this.loadSystem}">Load system variables</ui-button>
|
|
88
|
-
</section>
|
|
89
|
-
`
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
const instance = new ComponentDemoPage()
|
|
94
|
-
instance.render()
|
|
@@ -1,20 +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>HAR viewer</title>
|
|
7
|
-
<link
|
|
8
|
-
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"
|
|
9
|
-
rel="stylesheet"
|
|
10
|
-
/>
|
|
11
|
-
<link href="../../../src/styles/m3/tokens.css" rel="stylesheet" type="text/css" />
|
|
12
|
-
<link href="../../../src/styles/m3/theme.css" rel="stylesheet" type="text/css" />
|
|
13
|
-
<link href="../../page.css" rel="stylesheet" type="text/css" />
|
|
14
|
-
</head>
|
|
15
|
-
<body>
|
|
16
|
-
<div id="app"></div>
|
|
17
|
-
|
|
18
|
-
<script type="module" src="/.tmp/demo/elements/har/har-viewer.js"></script>
|
|
19
|
-
</body>
|
|
20
|
-
</html>
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
import { html, TemplateResult } from 'lit'
|
|
3
|
-
import { IEnvironment, Environment } from '@api-client/core/models/Environment.js'
|
|
4
|
-
import { DemoPage } from '../../../src/demo/DemoPage.js'
|
|
5
|
-
import '../../../src/define/har/har-viewer.js'
|
|
6
|
-
import { reactive } from '../../../src/decorators/index.js'
|
|
7
|
-
|
|
8
|
-
class ComponentDemoPage extends DemoPage {
|
|
9
|
-
override accessor componentName = 'HAR viewer'
|
|
10
|
-
|
|
11
|
-
@reactive() accessor environment: IEnvironment = new Environment().toJSON()
|
|
12
|
-
|
|
13
|
-
startupHar = new URL('har1.har', window.location.href).toString()
|
|
14
|
-
|
|
15
|
-
@reactive() accessor har: any | undefined
|
|
16
|
-
|
|
17
|
-
constructor() {
|
|
18
|
-
super()
|
|
19
|
-
|
|
20
|
-
this.fetchHarFile(this.startupHar)
|
|
21
|
-
|
|
22
|
-
this.fileChanged = this.fileChanged.bind(this)
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
async fetchHarFile(url: string): Promise<void> {
|
|
26
|
-
const response = await fetch(url)
|
|
27
|
-
this.har = await response.json()
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
fileChanged(e: Event): void {
|
|
31
|
-
const node = e.target as HTMLInputElement
|
|
32
|
-
this.processFile((node.files as FileList)[0])
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
async processFile(file: File): Promise<void> {
|
|
36
|
-
this.har = undefined
|
|
37
|
-
if (!file) {
|
|
38
|
-
return
|
|
39
|
-
}
|
|
40
|
-
const text = await this.readFile(file)
|
|
41
|
-
const har = JSON.parse(text)
|
|
42
|
-
this.har = har
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
readFile(file: File): Promise<string> {
|
|
46
|
-
return new Promise((resolve) => {
|
|
47
|
-
const reader = new FileReader()
|
|
48
|
-
reader.onloadend = (): void => {
|
|
49
|
-
resolve(reader.result as string)
|
|
50
|
-
}
|
|
51
|
-
reader.readAsText(file)
|
|
52
|
-
})
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
contentTemplate(): TemplateResult {
|
|
56
|
-
return html`
|
|
57
|
-
<section class="centered">
|
|
58
|
-
<har-viewer slot="content" .har="${this.har}"></har-viewer>
|
|
59
|
-
</section>
|
|
60
|
-
|
|
61
|
-
${this.fileTemplate()}
|
|
62
|
-
`
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
fileTemplate(): TemplateResult {
|
|
66
|
-
return html`
|
|
67
|
-
<section class="documentation-section">
|
|
68
|
-
<h3>HAR data</h3>
|
|
69
|
-
<input type="file" aria-label="Select the file" @change="${this.fileChanged}" />
|
|
70
|
-
</section>
|
|
71
|
-
`
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
const instance = new ComponentDemoPage()
|
|
76
|
-
instance.render()
|