diff --git a/netbox/extras/urls.py b/netbox/extras/urls.py index 0a1786f1f..6a729a082 100644 --- a/netbox/extras/urls.py +++ b/netbox/extras/urls.py @@ -136,4 +136,7 @@ urlpatterns = [ # Markdown path('render/markdown/', views.RenderMarkdownView.as_view(), name="render_markdown"), + + # Testing + path('tom-select/', views.TomSelectView.as_view(), name="tom_select"), ] diff --git a/netbox/extras/views.py b/netbox/extras/views.py index ad00d7412..2ccf6c4d9 100644 --- a/netbox/extras/views.py +++ b/netbox/extras/views.py @@ -30,6 +30,13 @@ from .reports import run_report from .scripts import run_script +class TomSelectView(View): + + def get(self, request): + return render(request, 'extras/tom_select.html', { + }) + + # # Custom fields # diff --git a/netbox/project-static/dist/netbox.css b/netbox/project-static/dist/netbox.css index 194e79351..48a70fd10 100644 Binary files a/netbox/project-static/dist/netbox.css and b/netbox/project-static/dist/netbox.css differ diff --git a/netbox/project-static/package-lock.json b/netbox/project-static/package-lock.json index 1c40ad5a3..36401ecd0 100644 --- a/netbox/project-static/package-lock.json +++ b/netbox/project-static/package-lock.json @@ -25,6 +25,7 @@ "query-string": "^7.1.1", "sass": "^1.55.0", "slim-select": "^1.27.1", + "tom-select": "^2.3.1", "typeface-inter": "^3.18.1", "typeface-roboto-mono": "^1.1.13" }, @@ -225,6 +226,19 @@ "node": ">= 8" } }, + "node_modules/@orchidjs/sifter": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@orchidjs/sifter/-/sifter-1.0.3.tgz", + "integrity": "sha512-zCZbwKegHytfsPm8Amcfh7v/4vHqTAaOu6xFswBYcn8nznBOuseu6COB2ON7ez0tFV0mKL0nRNnCiZZA+lU9/g==", + "dependencies": { + "@orchidjs/unicode-variants": "^1.0.4" + } + }, + "node_modules/@orchidjs/unicode-variants": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@orchidjs/unicode-variants/-/unicode-variants-1.0.4.tgz", + "integrity": "sha512-NvVBRnZNE+dugiXERFsET1JlKZfM5lJDEpSMilKW4bToYJ7pxf0Zne78xyXB2ny2c2aHfJ6WLnz1AaTNHAmQeQ==" + }, "node_modules/@pkgr/utils": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/@pkgr/utils/-/utils-2.3.1.tgz", @@ -3888,6 +3902,22 @@ "integrity": "sha1-bkWxJj8gF/oKzH2J14sVuL932jI=", "license": "MIT" }, + "node_modules/tom-select": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/tom-select/-/tom-select-2.3.1.tgz", + "integrity": "sha512-QS4vnOcB6StNGqX4sGboGXL2fkhBF2gIBB+8Hwv30FZXYPn0CyYO8kkdATRvwfCTThxiR4WcXwKJZ3cOmtI9eg==", + "dependencies": { + "@orchidjs/sifter": "^1.0.3", + "@orchidjs/unicode-variants": "^1.0.4" + }, + "engines": { + "node": "*" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/tom-select" + } + }, "node_modules/tsconfig-paths": { "version": "3.14.1", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz", diff --git a/netbox/project-static/package.json b/netbox/project-static/package.json index a46612d55..d4a52e82d 100644 --- a/netbox/project-static/package.json +++ b/netbox/project-static/package.json @@ -35,6 +35,7 @@ "query-string": "^7.1.1", "sass": "^1.55.0", "slim-select": "^1.27.1", + "tom-select": "^2.3.1", "typeface-inter": "^3.18.1", "typeface-roboto-mono": "^1.1.13" }, diff --git a/netbox/project-static/styles/netbox.scss b/netbox/project-static/styles/netbox.scss index 17c6d88c9..0fece199b 100644 --- a/netbox/project-static/styles/netbox.scss +++ b/netbox/project-static/styles/netbox.scss @@ -1,7 +1,8 @@ @import 'variables'; -// Tabler +// Tabler & vendors @import '../node_modules/@tabler/core/src/scss/_core.scss'; +@import '../node_modules/@tabler/core/src/scss/vendor/tom-select'; // Overrides of external libraries @import 'overrides/slim-select'; diff --git a/netbox/project-static/yarn.lock b/netbox/project-static/yarn.lock index 14c62ad03..2d71a07e3 100644 --- a/netbox/project-static/yarn.lock +++ b/netbox/project-static/yarn.lock @@ -80,6 +80,18 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" +"@orchidjs/sifter@^1.0.3": + version "1.0.3" + resolved "https://registry.npmjs.org/@orchidjs/sifter/-/sifter-1.0.3.tgz" + integrity sha512-zCZbwKegHytfsPm8Amcfh7v/4vHqTAaOu6xFswBYcn8nznBOuseu6COB2ON7ez0tFV0mKL0nRNnCiZZA+lU9/g== + dependencies: + "@orchidjs/unicode-variants" "^1.0.4" + +"@orchidjs/unicode-variants@^1.0.4": + version "1.0.4" + resolved "https://registry.npmjs.org/@orchidjs/unicode-variants/-/unicode-variants-1.0.4.tgz" + integrity sha512-NvVBRnZNE+dugiXERFsET1JlKZfM5lJDEpSMilKW4bToYJ7pxf0Zne78xyXB2ny2c2aHfJ6WLnz1AaTNHAmQeQ== + "@pkgr/utils@^2.3.1": version "2.3.1" resolved "https://registry.npmjs.org/@pkgr/utils/-/utils-2.3.1.tgz" @@ -2004,6 +2016,14 @@ toggle-selection@^1.0.6: resolved "https://registry.npmjs.org/toggle-selection/-/toggle-selection-1.0.6.tgz" integrity sha1-bkWxJj8gF/oKzH2J14sVuL932jI= +tom-select@^2.2.2, tom-select@^2.3.1: + version "2.3.1" + resolved "https://registry.npmjs.org/tom-select/-/tom-select-2.3.1.tgz" + integrity sha512-QS4vnOcB6StNGqX4sGboGXL2fkhBF2gIBB+8Hwv30FZXYPn0CyYO8kkdATRvwfCTThxiR4WcXwKJZ3cOmtI9eg== + dependencies: + "@orchidjs/sifter" "^1.0.3" + "@orchidjs/unicode-variants" "^1.0.4" + tsconfig-paths@^3.14.1: version "3.14.1" resolved "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz" diff --git a/netbox/templates/extras/tom_select.html b/netbox/templates/extras/tom_select.html new file mode 100644 index 000000000..a6d38002a --- /dev/null +++ b/netbox/templates/extras/tom_select.html @@ -0,0 +1,59 @@ +{% extends 'base/layout.html' %} + +{% block content %} +