@api-client/ui 0.2.3 → 0.2.5
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/.aiexclude +3 -0
- package/.vscode/settings.json +6 -3
- package/build/src/elements/authorization/ui/ApiKeyAuthorization.d.ts +1 -1
- package/build/src/elements/authorization/ui/ApiKeyAuthorization.d.ts.map +1 -1
- package/build/src/elements/authorization/ui/ApiKeyAuthorization.js +7 -7
- package/build/src/elements/authorization/ui/ApiKeyAuthorization.js.map +1 -1
- package/build/src/elements/authorization/ui/Authorization.styles.js +4 -4
- package/build/src/elements/authorization/ui/Authorization.styles.js.map +1 -1
- package/build/src/elements/authorization/ui/BasicAuthorization.d.ts +1 -1
- package/build/src/elements/authorization/ui/BasicAuthorization.d.ts.map +1 -1
- package/build/src/elements/authorization/ui/BasicAuthorization.js +5 -5
- package/build/src/elements/authorization/ui/BasicAuthorization.js.map +1 -1
- package/build/src/elements/authorization/ui/BearerAuthorization.d.ts +1 -1
- package/build/src/elements/authorization/ui/BearerAuthorization.d.ts.map +1 -1
- package/build/src/elements/authorization/ui/BearerAuthorization.js +3 -3
- package/build/src/elements/authorization/ui/BearerAuthorization.js.map +1 -1
- package/build/src/elements/authorization/ui/NtlmAuthorization.d.ts +1 -1
- package/build/src/elements/authorization/ui/NtlmAuthorization.d.ts.map +1 -1
- package/build/src/elements/authorization/ui/NtlmAuthorization.js +7 -7
- package/build/src/elements/authorization/ui/NtlmAuthorization.js.map +1 -1
- package/build/src/elements/authorization/ui/OAuth2Authorization.d.ts +1 -1
- package/build/src/elements/authorization/ui/OAuth2Authorization.d.ts.map +1 -1
- package/build/src/elements/authorization/ui/OAuth2Authorization.js +32 -27
- package/build/src/elements/authorization/ui/OAuth2Authorization.js.map +1 -1
- package/build/src/elements/authorization/ui/OidcAuthorization.js +4 -4
- package/build/src/elements/authorization/ui/OidcAuthorization.js.map +1 -1
- package/build/src/elements/autocomplete/autocomplete-input.d.ts +10 -0
- package/build/src/elements/autocomplete/autocomplete-input.d.ts.map +1 -0
- package/build/src/{md/text-field/ui-text-field.js → elements/autocomplete/autocomplete-input.js} +9 -9
- package/build/src/elements/autocomplete/autocomplete-input.js.map +1 -0
- package/build/src/elements/autocomplete/internals/autocomplete.d.ts +257 -0
- package/build/src/elements/autocomplete/internals/autocomplete.d.ts.map +1 -0
- package/build/src/elements/autocomplete/internals/autocomplete.js +619 -0
- package/build/src/elements/autocomplete/internals/autocomplete.js.map +1 -0
- package/build/src/elements/autocomplete/internals/autocomplete.styles.d.ts +3 -0
- package/build/src/elements/autocomplete/internals/autocomplete.styles.d.ts.map +1 -0
- package/build/src/elements/autocomplete/internals/autocomplete.styles.js +25 -0
- package/build/src/elements/autocomplete/internals/autocomplete.styles.js.map +1 -0
- package/build/src/elements/dialog/internals/DeleteCookieAction.element.d.ts +1 -1
- package/build/src/elements/dialog/internals/DeleteCookieAction.element.d.ts.map +1 -1
- package/build/src/elements/dialog/internals/DeleteCookieAction.element.js +5 -5
- package/build/src/elements/dialog/internals/DeleteCookieAction.element.js.map +1 -1
- package/build/src/elements/dialog/internals/Rename.d.ts +1 -1
- package/build/src/elements/dialog/internals/Rename.d.ts.map +1 -1
- package/build/src/elements/dialog/internals/Rename.js +3 -3
- package/build/src/elements/dialog/internals/Rename.js.map +1 -1
- package/build/src/elements/dialog/internals/SetCookieAction.element.d.ts +1 -1
- package/build/src/elements/dialog/internals/SetCookieAction.element.d.ts.map +1 -1
- package/build/src/elements/dialog/internals/SetCookieAction.element.js +9 -9
- package/build/src/elements/dialog/internals/SetCookieAction.element.js.map +1 -1
- package/build/src/elements/environment/EnvironmentEditor.d.ts +1 -1
- package/build/src/elements/environment/EnvironmentEditor.d.ts.map +1 -1
- package/build/src/elements/environment/EnvironmentEditor.js +3 -3
- package/build/src/elements/environment/EnvironmentEditor.js.map +1 -1
- package/build/src/elements/environment/EnvironmentEditor.styles.js +1 -1
- package/build/src/elements/environment/EnvironmentEditor.styles.js.map +1 -1
- package/build/src/elements/environment/ServerEditor.d.ts +1 -1
- package/build/src/elements/environment/ServerEditor.d.ts.map +1 -1
- package/build/src/elements/environment/ServerEditor.js +7 -7
- package/build/src/elements/environment/ServerEditor.js.map +1 -1
- package/build/src/elements/environment/ServerEditor.styles.js +1 -1
- package/build/src/elements/environment/ServerEditor.styles.js.map +1 -1
- package/build/src/elements/http/BodyMultipartEditor.d.ts.map +1 -1
- package/build/src/elements/http/BodyMultipartEditor.js +4 -0
- package/build/src/elements/http/BodyMultipartEditor.js.map +1 -1
- package/build/src/elements/http/CertificateAdd.element.d.ts +1 -1
- package/build/src/elements/http/CertificateAdd.element.d.ts.map +1 -1
- package/build/src/elements/http/CertificateAdd.element.js +8 -8
- package/build/src/elements/http/CertificateAdd.element.js.map +1 -1
- package/build/src/elements/http/CertificateAdd.styles.js +1 -1
- package/build/src/elements/http/CertificateAdd.styles.js.map +1 -1
- package/build/src/elements/http/HttpAssertions.element.js +3 -3
- package/build/src/elements/http/HttpAssertions.element.js.map +1 -1
- package/build/src/elements/http/HttpFlows.element.js +3 -3
- package/build/src/elements/http/HttpFlows.element.js.map +1 -1
- package/build/src/elements/http/HttpFlowsUi.d.ts +1 -1
- package/build/src/elements/http/HttpFlowsUi.d.ts.map +1 -1
- package/build/src/elements/http/HttpFlowsUi.js +31 -31
- package/build/src/elements/http/HttpFlowsUi.js.map +1 -1
- package/build/src/elements/http/RequestConfigElement.d.ts +1 -1
- package/build/src/elements/http/RequestConfigElement.d.ts.map +1 -1
- package/build/src/elements/http/RequestConfigElement.js +7 -7
- package/build/src/elements/http/RequestConfigElement.js.map +1 -1
- package/build/src/elements/http/UrlParamsForm.d.ts +1 -1
- package/build/src/elements/http/UrlParamsForm.d.ts.map +1 -1
- package/build/src/elements/http/UrlParamsForm.js +1 -1
- package/build/src/elements/http/UrlParamsForm.js.map +1 -1
- package/build/src/elements/project/ProjectRunner.d.ts +1 -1
- package/build/src/elements/project/ProjectRunner.d.ts.map +1 -1
- package/build/src/elements/project/ProjectRunner.js +5 -5
- package/build/src/elements/project/ProjectRunner.js.map +1 -1
- package/build/src/md/input/Input.d.ts +0 -15
- package/build/src/md/input/Input.d.ts.map +1 -1
- package/build/src/md/input/Input.js +7 -42
- package/build/src/md/input/Input.js.map +1 -1
- package/build/src/md/list/internals/List.d.ts +7 -2
- package/build/src/md/list/internals/List.d.ts.map +1 -1
- package/build/src/md/list/internals/List.js +6 -0
- package/build/src/md/list/internals/List.js.map +1 -1
- package/build/src/md/list/internals/ListItem.styles.d.ts.map +1 -1
- package/build/src/md/list/internals/ListItem.styles.js +8 -0
- package/build/src/md/list/internals/ListItem.styles.js.map +1 -1
- package/build/src/md/listbox/internals/Listbox.d.ts +2 -2
- package/build/src/md/listbox/internals/Listbox.d.ts.map +1 -1
- package/build/src/md/listbox/internals/Listbox.js.map +1 -1
- package/build/src/md/text-area/internals/TextAreaElement.d.ts.map +1 -1
- package/build/src/md/text-area/internals/TextAreaElement.js +0 -5
- package/build/src/md/text-area/internals/TextAreaElement.js.map +1 -1
- package/build/src/md/text-area/ui-text-area.d.ts.map +1 -1
- package/build/src/md/text-area/ui-text-area.js +3 -2
- package/build/src/md/text-area/ui-text-area.js.map +1 -1
- package/build/src/md/text-field/internals/{TextFieldElement.d.ts → TextField.d.ts} +2 -2
- package/build/src/md/text-field/internals/TextField.d.ts.map +1 -0
- package/build/src/md/text-field/internals/{TextFieldElement.js → TextField.js} +2 -5
- package/build/src/md/text-field/internals/TextField.js.map +1 -0
- package/build/src/md/text-field/internals/{TextField.styles.d.ts → common.styles.d.ts} +1 -1
- package/build/src/md/text-field/internals/common.styles.d.ts.map +1 -0
- package/build/src/md/text-field/internals/{TextField.styles.js → common.styles.js} +8 -94
- package/build/src/md/text-field/internals/common.styles.js.map +1 -0
- package/build/src/md/text-field/internals/filled.styles.d.ts +3 -0
- package/build/src/md/text-field/internals/filled.styles.d.ts.map +1 -0
- package/build/src/md/text-field/internals/filled.styles.js +107 -0
- package/build/src/md/text-field/internals/filled.styles.js.map +1 -0
- package/build/src/md/text-field/internals/outlined.styles.d.ts +3 -0
- package/build/src/md/text-field/internals/outlined.styles.d.ts.map +1 -0
- package/build/src/md/text-field/internals/outlined.styles.js +43 -0
- package/build/src/md/text-field/internals/outlined.styles.js.map +1 -0
- package/build/src/md/text-field/ui-filled-text-field.d.ts +11 -0
- package/build/src/md/text-field/ui-filled-text-field.d.ts.map +1 -0
- package/build/src/md/text-field/ui-filled-text-field.js +28 -0
- package/build/src/md/text-field/ui-filled-text-field.js.map +1 -0
- package/build/src/md/text-field/ui-outlined-text-field.d.ts +11 -0
- package/build/src/md/text-field/ui-outlined-text-field.d.ts.map +1 -0
- package/build/src/md/text-field/ui-outlined-text-field.js +28 -0
- package/build/src/md/text-field/ui-outlined-text-field.js.map +1 -0
- package/build/src/types/input.d.ts +1 -1
- package/build/src/types/input.d.ts.map +1 -1
- package/build/src/types/input.js.map +1 -1
- package/demo/elements/authorization/oauth-authorize.html +4 -4
- package/demo/elements/authorization/oauth-authorize.ts +1 -1
- package/demo/elements/autocomplete/index.html +64 -0
- package/demo/elements/autocomplete/index.ts +171 -0
- package/demo/elements/http/body-editor.ts +3 -3
- package/demo/elements/index.html +15 -11
- package/demo/md/index.html +1 -1
- package/demo/md/inputs/input.html +10 -15
- package/demo/md/inputs/input.ts +389 -101
- package/demo/page.css +4 -0
- package/package.json +1 -1
- package/src/elements/authorization/ui/ApiKeyAuthorization.ts +7 -7
- package/src/elements/authorization/ui/Authorization.styles.ts +4 -4
- package/src/elements/authorization/ui/BasicAuthorization.ts +5 -5
- package/src/elements/authorization/ui/BearerAuthorization.ts +3 -3
- package/src/elements/authorization/ui/NtlmAuthorization.ts +7 -7
- package/src/elements/authorization/ui/OAuth2Authorization.ts +32 -27
- package/src/elements/authorization/ui/OidcAuthorization.ts +4 -4
- package/src/elements/autocomplete/autocomplete-input.ts +14 -0
- package/src/elements/autocomplete/internals/autocomplete.styles.ts +25 -0
- package/src/elements/autocomplete/internals/autocomplete.ts +599 -0
- package/src/elements/dialog/internals/DeleteCookieAction.element.ts +5 -5
- package/src/elements/dialog/internals/Rename.ts +3 -3
- package/src/elements/dialog/internals/SetCookieAction.element.ts +9 -9
- package/src/elements/environment/EnvironmentEditor.styles.ts +1 -1
- package/src/elements/environment/EnvironmentEditor.ts +3 -3
- package/src/elements/environment/ServerEditor.styles.ts +1 -1
- package/src/elements/environment/ServerEditor.ts +7 -7
- package/src/elements/http/BodyMultipartEditor.ts +4 -0
- package/src/elements/http/CertificateAdd.element.ts +8 -8
- package/src/elements/http/CertificateAdd.styles.ts +1 -1
- package/src/elements/http/HttpAssertions.element.ts +3 -3
- package/src/elements/http/HttpFlows.element.ts +3 -3
- package/src/elements/http/HttpFlowsUi.ts +31 -31
- package/src/elements/http/RequestConfigElement.ts +7 -7
- package/src/elements/http/UrlParamsForm.ts +1 -1
- package/src/elements/project/ProjectRunner.ts +5 -5
- package/src/md/input/Input.ts +6 -21
- package/src/md/list/internals/List.ts +14 -2
- package/src/md/list/internals/ListItem.styles.ts +8 -0
- package/src/md/listbox/internals/Listbox.ts +2 -2
- package/src/md/text-area/internals/TextAreaElement.ts +0 -5
- package/src/md/text-area/ui-text-area.ts +3 -2
- package/src/md/text-field/internals/{TextFieldElement.ts → TextField.ts} +1 -4
- package/src/md/text-field/internals/{TextField.styles.ts → common.styles.ts} +7 -93
- package/src/md/text-field/internals/filled.styles.ts +107 -0
- package/src/md/text-field/internals/outlined.styles.ts +43 -0
- package/src/md/text-field/ui-filled-text-field.ts +16 -0
- package/src/md/text-field/ui-outlined-text-field.ts +16 -0
- package/src/types/input.ts +0 -1
- package/test/elements/authorization/basic-method.test.ts +3 -3
- package/test/elements/authorization/bearer-method.test.ts +2 -2
- package/test/elements/authorization/ntlm-method.test.ts +4 -4
- package/test/elements/autocomplete/autocomplete-input.spec.ts +643 -0
- package/test/elements/http/BodyMultipartEditorElement.test.ts +15 -16
- package/test/elements/http/CertificateAdd.test.ts +11 -11
- package/test/elements/http/HttpAssertions.test.ts +9 -9
- package/test/elements/http/HttpFlows.test.ts +4 -4
- package/build/src/md/text-field/internals/TextField.styles.d.ts.map +0 -1
- package/build/src/md/text-field/internals/TextField.styles.js.map +0 -1
- package/build/src/md/text-field/internals/TextFieldElement.d.ts.map +0 -1
- package/build/src/md/text-field/internals/TextFieldElement.js.map +0 -1
- package/build/src/md/text-field/ui-text-field.d.ts +0 -11
- package/build/src/md/text-field/ui-text-field.d.ts.map +0 -1
- package/build/src/md/text-field/ui-text-field.js.map +0 -1
- package/src/md/text-field/ui-text-field.ts +0 -15
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { nanoid } from 'nanoid'
|
|
2
2
|
import '../../../src/md/button/ui-filled-button.js'
|
|
3
|
-
import '../../../src/md/text-field/ui-text-field.js'
|
|
3
|
+
import '../../../src/md/text-field/ui-filled-text-field.js'
|
|
4
4
|
|
|
5
5
|
function setupFormAction(): void {
|
|
6
6
|
const u = new URL(window.location.href)
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
<meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes">
|
|
7
|
+
<title>Autocomplete</title>
|
|
8
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
9
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
10
|
+
<link
|
|
11
|
+
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"
|
|
12
|
+
rel="stylesheet"
|
|
13
|
+
/>
|
|
14
|
+
<link href="../../../src/styles/m3/tokens.css" rel="stylesheet" type="text/css" />
|
|
15
|
+
<link href="../../../src/styles/m3/theme.css" rel="stylesheet" type="text/css" />
|
|
16
|
+
<link href="../../page.css" rel="stylesheet" type="text/css" />
|
|
17
|
+
<style>
|
|
18
|
+
.share-input {
|
|
19
|
+
.input-container {
|
|
20
|
+
min-height: 3em;
|
|
21
|
+
border: none;
|
|
22
|
+
padding: 4px 12px;
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-wrap: wrap;
|
|
25
|
+
box-sizing: border-box;
|
|
26
|
+
gap: 4px;
|
|
27
|
+
border-radius: 4px;
|
|
28
|
+
background-color: var(--md-sys-color-surface-container-lowest);
|
|
29
|
+
|
|
30
|
+
outline-color: var(--md-sys-color-primary);
|
|
31
|
+
outline-style: solid;
|
|
32
|
+
outline-width: 1px;
|
|
33
|
+
outline-offset: -1px;
|
|
34
|
+
transition:
|
|
35
|
+
outline-width 0.14s ease-in-out,
|
|
36
|
+
outline-offset 0.14s ease-in-out;
|
|
37
|
+
|
|
38
|
+
&:focus-within {
|
|
39
|
+
outline-width: 2px;
|
|
40
|
+
outline-offset: -2px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.native-input {
|
|
44
|
+
flex: 1;
|
|
45
|
+
outline: none;
|
|
46
|
+
border: none;
|
|
47
|
+
background: transparent;
|
|
48
|
+
color: var(--md-sys-color-on-surface);
|
|
49
|
+
font-size: 1rem;
|
|
50
|
+
font-family: var(--md-sys-typescale-body-large-font-family);
|
|
51
|
+
line-height: var(--md-sys-typescale-body-large-line-height);
|
|
52
|
+
padding: 0;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
</style>
|
|
57
|
+
</head>
|
|
58
|
+
|
|
59
|
+
<body class="demo">
|
|
60
|
+
<div id="app"></div>
|
|
61
|
+
<script type="module" src="/.tmp/demo/elements/autocomplete/index.js"></script>
|
|
62
|
+
</body>
|
|
63
|
+
|
|
64
|
+
</html>
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { html, TemplateResult } from 'lit'
|
|
2
|
+
import { live } from 'lit/directives/live.js'
|
|
3
|
+
import { DemoPage } from '../../../src/demo/DemoPage.js'
|
|
4
|
+
import reactive from '../../../src/decorators/reactive.js'
|
|
5
|
+
import type { IUser } from '@api-client/core/models/store/User.js'
|
|
6
|
+
import { User } from '@api-client/core/mocking/lib/User.js'
|
|
7
|
+
|
|
8
|
+
import '../../../src/elements/autocomplete/autocomplete-input.js'
|
|
9
|
+
import '../../../src/md/text-field/ui-outlined-text-field.js'
|
|
10
|
+
import '../../../src/md/listbox/ui-listbox.js'
|
|
11
|
+
import '../../../src/md/list/ui-list-item.js'
|
|
12
|
+
|
|
13
|
+
class ComponentDemoPage extends DemoPage {
|
|
14
|
+
override accessor componentName = 'Autocomplete input'
|
|
15
|
+
|
|
16
|
+
@reactive() accessor fixedValue = ''
|
|
17
|
+
@reactive() accessor dynamicValue = ''
|
|
18
|
+
@reactive() accessor dynamicCustomValue = ''
|
|
19
|
+
@reactive() accessor users: IUser[] = []
|
|
20
|
+
@reactive() accessor customUsers: IUser[] = []
|
|
21
|
+
|
|
22
|
+
userMock = new User()
|
|
23
|
+
|
|
24
|
+
handleFixedAutocomplete(event: CustomEvent<{ item: HTMLElement }>): void {
|
|
25
|
+
const item = event.detail.item
|
|
26
|
+
this.fixedValue = item.getAttribute('data-value') || item.textContent || ''
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
handleFixedInput(event: InputEvent): void {
|
|
30
|
+
const target = event.target as HTMLInputElement
|
|
31
|
+
this.fixedValue = target.value
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
handleDynamicAutocomplete(event: CustomEvent<{ item: HTMLElement }>): void {
|
|
35
|
+
const item = event.detail.item
|
|
36
|
+
this.dynamicValue = item.dataset.name || ''
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
handleDynamicInput(event: InputEvent): void {
|
|
40
|
+
const target = event.target as HTMLInputElement
|
|
41
|
+
this.dynamicValue = target.value
|
|
42
|
+
this.generateMockUsers(target.value, 'users')
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
generateMockUsers(startsWith: string, prop: 'users' | 'customUsers'): void {
|
|
46
|
+
const timeout = this.userMock.types.number({ min: 100, max: 1000 })
|
|
47
|
+
const results = this.userMock.types.number({ min: 0, max: 30 })
|
|
48
|
+
setTimeout(() => {
|
|
49
|
+
this[prop] = Array.from({ length: results }, () => {
|
|
50
|
+
const item = this.userMock.user()
|
|
51
|
+
item.name = item.name.startsWith(startsWith) ? item.name : `${startsWith}${item.name}`
|
|
52
|
+
return item
|
|
53
|
+
})
|
|
54
|
+
console.log('Generated users:', this[prop])
|
|
55
|
+
}, timeout)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
handleDynamicCustomInput(event: InputEvent): void {
|
|
59
|
+
const target = event.target as HTMLInputElement
|
|
60
|
+
this.dynamicCustomValue = target.value
|
|
61
|
+
this.generateMockUsers(target.value, 'customUsers')
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
handleDynamicCustomAutocomplete(event: CustomEvent<{ item: HTMLElement }>): void {
|
|
65
|
+
const item = event.detail.item
|
|
66
|
+
this.dynamicCustomValue = item.dataset.name || ''
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
override contentTemplate(): TemplateResult {
|
|
70
|
+
return html`
|
|
71
|
+
<a href="../">Back</a>
|
|
72
|
+
|
|
73
|
+
<section class="demo-section">
|
|
74
|
+
<h2 class="title-large">Fixed suggestions</h2>
|
|
75
|
+
|
|
76
|
+
<div class="demo-row">
|
|
77
|
+
<autocomplete-input @autocomplete="${this.handleFixedAutocomplete}">
|
|
78
|
+
<ui-outlined-text-field
|
|
79
|
+
slot="input"
|
|
80
|
+
label="Select a fruit"
|
|
81
|
+
name="fixed"
|
|
82
|
+
.value="${live(this.fixedValue)}"
|
|
83
|
+
@input="${this.handleFixedInput}"
|
|
84
|
+
></ui-outlined-text-field>
|
|
85
|
+
<ui-listbox slot="suggestions">
|
|
86
|
+
<ui-list-item data-value="apple" role="option">Apple</ui-list-item>
|
|
87
|
+
<ui-list-item data-value="banana" role="option">Banana</ui-list-item>
|
|
88
|
+
<ui-list-item data-value="cherry" role="option">Cherry</ui-list-item>
|
|
89
|
+
<ui-list-item data-value="date" role="option">Date</ui-list-item>
|
|
90
|
+
<ui-list-item data-value="elderberry" role="option">Elderberry</ui-list-item>
|
|
91
|
+
<ui-list-item data-value="fig" role="option">Fig</ui-list-item>
|
|
92
|
+
<ui-list-item data-value="grape" role="option">Grape</ui-list-item>
|
|
93
|
+
<ui-list-item data-value="honeydew" role="option">Honeydew</ui-list-item>
|
|
94
|
+
<ui-list-item data-value="kiwi" role="option">Kiwi</ui-list-item>
|
|
95
|
+
<ui-list-item data-value="lemon" role="option">Lemon</ui-list-item>
|
|
96
|
+
<ui-list-item data-value="mango" role="option">Mango</ui-list-item>
|
|
97
|
+
<ui-list-item data-value="nectarine" role="option">Nectarine</ui-list-item>
|
|
98
|
+
<ui-list-item data-value="orange" role="option">Orange</ui-list-item>
|
|
99
|
+
<ui-list-item data-value="papaya" role="option">Papaya</ui-list-item>
|
|
100
|
+
</ui-listbox>
|
|
101
|
+
</autocomplete-input>
|
|
102
|
+
</div>
|
|
103
|
+
</section>
|
|
104
|
+
|
|
105
|
+
<section class="demo-section">
|
|
106
|
+
<h2 class="title-large">Dynamic suggestions</h2>
|
|
107
|
+
|
|
108
|
+
<div class="demo-row">
|
|
109
|
+
<autocomplete-input @autocomplete="${this.handleDynamicAutocomplete}">
|
|
110
|
+
<ui-outlined-text-field
|
|
111
|
+
slot="input"
|
|
112
|
+
label="Choose a user"
|
|
113
|
+
name="dynamic"
|
|
114
|
+
.value="${live(this.dynamicValue)}"
|
|
115
|
+
@input="${this.handleDynamicInput}"
|
|
116
|
+
></ui-outlined-text-field>
|
|
117
|
+
<ui-listbox slot="suggestions"
|
|
118
|
+
>${this.users.map(
|
|
119
|
+
(user) =>
|
|
120
|
+
html`<ui-list-item
|
|
121
|
+
data-name="${user.name}"
|
|
122
|
+
data-email="${user.email[0].email}"
|
|
123
|
+
data-index="name email"
|
|
124
|
+
role="option"
|
|
125
|
+
>${user.name}<span slot="supporting-text">${user.email[0].email}</span></ui-list-item
|
|
126
|
+
>`
|
|
127
|
+
)}</ui-listbox
|
|
128
|
+
>
|
|
129
|
+
</autocomplete-input>
|
|
130
|
+
</div>
|
|
131
|
+
</section>
|
|
132
|
+
|
|
133
|
+
<section class="demo-section">
|
|
134
|
+
<h2 class="title-large">Custom Input</h2>
|
|
135
|
+
|
|
136
|
+
<div class="demo-row">
|
|
137
|
+
<autocomplete-input @autocomplete="${this.handleDynamicCustomAutocomplete}">
|
|
138
|
+
<div class="share-input" slot="anchor">
|
|
139
|
+
<div class="input-container">
|
|
140
|
+
<input
|
|
141
|
+
type="text"
|
|
142
|
+
slot="input"
|
|
143
|
+
autocomplete="off"
|
|
144
|
+
placeholder="Enter name or email"
|
|
145
|
+
name="dynamic-custom"
|
|
146
|
+
class="native-input"
|
|
147
|
+
.value="${live(this.dynamicCustomValue)}"
|
|
148
|
+
@input="${this.handleDynamicCustomInput}"
|
|
149
|
+
/>
|
|
150
|
+
</div>
|
|
151
|
+
</div>
|
|
152
|
+
<ui-listbox slot="suggestions"
|
|
153
|
+
>${this.customUsers.map(
|
|
154
|
+
(user) =>
|
|
155
|
+
html`<ui-list-item
|
|
156
|
+
data-name="${user.name}"
|
|
157
|
+
data-email="${user.email[0].email}"
|
|
158
|
+
data-index="name email"
|
|
159
|
+
role="option"
|
|
160
|
+
>${user.name}<span slot="supporting-text">${user.email[0].email}</span></ui-list-item
|
|
161
|
+
>`
|
|
162
|
+
)}</ui-listbox
|
|
163
|
+
>
|
|
164
|
+
</autocomplete-input>
|
|
165
|
+
</div>
|
|
166
|
+
</section>
|
|
167
|
+
`
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
const instance = new ComponentDemoPage()
|
|
171
|
+
instance.render()
|
|
@@ -8,7 +8,7 @@ import BodyEditor from '../../../src/elements/http/BodyEditor.js'
|
|
|
8
8
|
import Input from '../../../src/md/input/Input.js'
|
|
9
9
|
import { Events } from '../../../src/events/Events.js'
|
|
10
10
|
import '../../../src/define/http/http-body-editor.js'
|
|
11
|
-
import '../../../src/md/text-field/ui-text-field.js'
|
|
11
|
+
import '../../../src/md/text-field/ui-filled-text-field.js'
|
|
12
12
|
|
|
13
13
|
const STORE_KEY = 'demo.request-ui.editor.body'
|
|
14
14
|
|
|
@@ -90,11 +90,11 @@ class ComponentDemoPage extends DemoPage {
|
|
|
90
90
|
<a href="./">Back</a>
|
|
91
91
|
<section class="demo-section">
|
|
92
92
|
<h2 class="title-large">Setup</h2>
|
|
93
|
-
<ui-text-field
|
|
93
|
+
<ui-filled-text-field
|
|
94
94
|
label="Content type"
|
|
95
95
|
.value="${live(this.contentType || '')}"
|
|
96
96
|
@change="${this.handleContentType}"
|
|
97
|
-
></ui-text-field>
|
|
97
|
+
></ui-filled-text-field>
|
|
98
98
|
</section>
|
|
99
99
|
<section class="demo-section">
|
|
100
100
|
<h2 class="title-large">HTTP body editor</h2>
|
package/demo/elements/index.html
CHANGED
|
@@ -18,11 +18,21 @@
|
|
|
18
18
|
<a href="../">Back</a>
|
|
19
19
|
<nav>
|
|
20
20
|
<dl>
|
|
21
|
-
|
|
22
|
-
<
|
|
21
|
+
|
|
22
|
+
<dt><a href="autocomplete/index.html">Autocomplete input</a></dt>
|
|
23
|
+
<dd>Turns an input element into an autocomplete.</dd>
|
|
24
|
+
|
|
25
|
+
<dt><a href="authorization/index.html">Authorization element</a></dt>
|
|
26
|
+
<dd>Elements to define HTTP authorization.</dd>
|
|
27
|
+
|
|
28
|
+
<dt><a href="context-menu/index.html">Context menu</a></dt>
|
|
29
|
+
<dd>An element that render a context menu.</dd>
|
|
23
30
|
|
|
24
31
|
<dt><a href="environment/index.html">Environment</a></dt>
|
|
25
32
|
<dd>The environment elements library.</dd>
|
|
33
|
+
|
|
34
|
+
<dt><a href="har/index.html">HAR utilities</a></dt>
|
|
35
|
+
<dd>Elements related to processing and visualizing HAR data.</dd>
|
|
26
36
|
|
|
27
37
|
<dt><a href="highlight/index.html">Highlight</a></dt>
|
|
28
38
|
<dd>The syntax highlighting library.</dd>
|
|
@@ -33,18 +43,12 @@
|
|
|
33
43
|
<dt><a href="http-client/index.html">HTTP Client</a></dt>
|
|
34
44
|
<dd>The HTTP Client UI library.</dd>
|
|
35
45
|
|
|
46
|
+
<dt><a href="icons/index.html">Icons</a></dt>
|
|
47
|
+
<dd>The icons library.</dd>
|
|
48
|
+
|
|
36
49
|
<dt><a href="project/index.html">HTTP project</a></dt>
|
|
37
50
|
<dd>Elements related to HTTP project.</dd>
|
|
38
51
|
|
|
39
|
-
<dt><a href="har/index.html">HAR utilities</a></dt>
|
|
40
|
-
<dd>Elements related to processing and visualizing HAR data.</dd>
|
|
41
|
-
|
|
42
|
-
<dt><a href="context-menu/index.html">Context menu</a></dt>
|
|
43
|
-
<dd>An element that render a context menu.</dd>
|
|
44
|
-
|
|
45
|
-
<dt><a href="authorization/index.html">Authorization element</a></dt>
|
|
46
|
-
<dd>Elements to define HTTP authorization.</dd>
|
|
47
|
-
|
|
48
52
|
<dt><a href="user/user-avatar.html">User avatar</a></dt>
|
|
49
53
|
<dd>User avatar element.</dd>
|
|
50
54
|
</dl>
|
package/demo/md/index.html
CHANGED
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
<dd>A Material 3-styled list and list item.</dd>
|
|
38
38
|
<dt><a href="list/dropdown-list.html">dropdown-list</a></dt>
|
|
39
39
|
<dd>A Material 3-styled dropdown-list.</dd>
|
|
40
|
-
<dt><a href="inputs/input.html">
|
|
40
|
+
<dt><a href="inputs/input.html">Text field</a></dt>
|
|
41
41
|
<dd>A Material 3-styled text field and text area.</dd>
|
|
42
42
|
<dt><a href="notification/snack.html">ui-snackbar</a></dt>
|
|
43
43
|
<dd>A Material 3-styled snackbar notification.</dd>
|
|
@@ -8,26 +8,21 @@
|
|
|
8
8
|
<link href="../../../src/styles/m3/tokens.css" rel="stylesheet" type="text/css" />
|
|
9
9
|
<link href="../../../src/styles/m3/theme.css" rel="stylesheet" type="text/css" />
|
|
10
10
|
<style>
|
|
11
|
-
.demo-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
.grid-5 {
|
|
16
|
-
display: grid;
|
|
17
|
-
grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
|
|
18
|
-
justify-items: center;
|
|
11
|
+
.demo-section {
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
gap: 20px;
|
|
19
15
|
}
|
|
20
16
|
|
|
21
|
-
.
|
|
17
|
+
.input-compare {
|
|
22
18
|
display: grid;
|
|
23
|
-
grid-template-columns:
|
|
24
|
-
|
|
19
|
+
grid-template-columns: repeat(2, 1fr);
|
|
20
|
+
grid-template-rows: repeat(1, 1fr);
|
|
21
|
+
gap: 8px;;
|
|
25
22
|
}
|
|
26
23
|
|
|
27
|
-
.
|
|
28
|
-
|
|
29
|
-
grid-template-columns: 1fr 1fr 1fr;
|
|
30
|
-
justify-items: center;
|
|
24
|
+
.demo-row {
|
|
25
|
+
margin: 20px 0;
|
|
31
26
|
}
|
|
32
27
|
</style>
|
|
33
28
|
</head>
|