web/elements: add dropdown css to DOM directly instead of including

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
Jens Langhammer 2023-02-05 23:32:54 +01:00
parent b9a2323c51
commit 00a16bee76
No known key found for this signature in database
3 changed files with 4 additions and 5 deletions

View File

@ -13,7 +13,6 @@
<link rel="stylesheet" type="text/css" href="{% static 'dist/page.css' %}"> <link rel="stylesheet" type="text/css" href="{% static 'dist/page.css' %}">
<link rel="stylesheet" type="text/css" href="{% static 'dist/empty-state.css' %}"> <link rel="stylesheet" type="text/css" href="{% static 'dist/empty-state.css' %}">
<link rel="stylesheet" type="text/css" href="{% static 'dist/spinner.css' %}"> <link rel="stylesheet" type="text/css" href="{% static 'dist/spinner.css' %}">
<link rel="stylesheet" type="text/css" href="{% static 'dist/dropdown.css' %}">
{% block head_before %} {% block head_before %}
{% endblock %} {% endblock %}
<link rel="stylesheet" type="text/css" href="{% static 'dist/authentik.css' %}"> <link rel="stylesheet" type="text/css" href="{% static 'dist/authentik.css' %}">

View File

@ -24,10 +24,6 @@ export const resources = [
src: "node_modules/@patternfly/patternfly/patternfly-base.css", src: "node_modules/@patternfly/patternfly/patternfly-base.css",
dest: "dist/", dest: "dist/",
}, },
{
src: "node_modules/@patternfly/patternfly/components/Dropdown/dropdown.css",
dest: "dist/",
},
{ {
src: "node_modules/@patternfly/patternfly/components/Page/page.css", src: "node_modules/@patternfly/patternfly/components/Page/page.css",
dest: "dist/", dest: "dist/",

View File

@ -9,6 +9,7 @@ import { CSSResult, TemplateResult, html, render } from "lit";
import { customElement, property } from "lit/decorators.js"; import { customElement, property } from "lit/decorators.js";
import AKGlobal from "@goauthentik/common/styles/authentik.css"; import AKGlobal from "@goauthentik/common/styles/authentik.css";
import PFDropdown from "@patternfly/patternfly/components/Dropdown/dropdown.css";
import PFForm from "@patternfly/patternfly/components/Form/form.css"; import PFForm from "@patternfly/patternfly/components/Form/form.css";
import PFFormControl from "@patternfly/patternfly/components/FormControl/form-control.css"; import PFFormControl from "@patternfly/patternfly/components/FormControl/form-control.css";
import PFSelect from "@patternfly/patternfly/components/Select/select.css"; import PFSelect from "@patternfly/patternfly/components/Select/select.css";
@ -73,6 +74,9 @@ export class SearchSelect<T> extends AKElement {
constructor() { constructor() {
super(); super();
if (!document.adoptedStyleSheets.includes(PFDropdown)) {
document.adoptedStyleSheets = [...document.adoptedStyleSheets, PFDropdown];
}
this.dropdownContainer = document.createElement("div"); this.dropdownContainer = document.createElement("div");
this.observer = new IntersectionObserver(() => { this.observer = new IntersectionObserver(() => {
this.open = false; this.open = false;