refactored implementation for native select using tom-select

This commit is contained in:
Carlo Wisse 2022-11-28 12:43:56 +11:00
Родитель 12cdeb5a93
Коммит a7a2944a5f
10 изменённых файлов: 168 добавлений и 167 удалений

Просмотреть файл

@ -27,12 +27,9 @@
<div class="form-group">
<label for="selResourceId" class="form-label">Cluster:</label>
<div class="mb-3">
<div class="select-search">
<input id="enterResourceId" class="form-control" type="text" placeholder="Fetching clusters..." disabled>
<select id="selResourceId">
<option class="option-header" disabled>Select a cluster below</option>
</select>
</div>
<select id="selResourceId" autocomplete="off" placeholder="Search clusters..." disabled>
<option value=""></option>
</select>
</div>
</div>

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@ -1,59 +1,59 @@
/*!
* Bootstrap alert.js v5.2.2 (https://getbootstrap.com/)
* Bootstrap alert.js v5.2.3 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
/*!
* Bootstrap base-component.js v5.2.2 (https://getbootstrap.com/)
* Bootstrap base-component.js v5.2.3 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
/*!
* Bootstrap component-functions.js v5.2.2 (https://getbootstrap.com/)
* Bootstrap component-functions.js v5.2.3 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
/*!
* Bootstrap config.js v5.2.2 (https://getbootstrap.com/)
* Bootstrap config.js v5.2.3 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
/*!
* Bootstrap data.js v5.2.2 (https://getbootstrap.com/)
* Bootstrap data.js v5.2.3 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
/*!
* Bootstrap dropdown.js v5.2.2 (https://getbootstrap.com/)
* Bootstrap dropdown.js v5.2.3 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
/*!
* Bootstrap event-handler.js v5.2.2 (https://getbootstrap.com/)
* Bootstrap event-handler.js v5.2.3 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
/*!
* Bootstrap index.js v5.2.2 (https://getbootstrap.com/)
* Bootstrap index.js v5.2.3 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
/*!
* Bootstrap manipulator.js v5.2.2 (https://getbootstrap.com/)
* Bootstrap manipulator.js v5.2.3 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
/*!
* Bootstrap selector-engine.js v5.2.2 (https://getbootstrap.com/)
* Bootstrap selector-engine.js v5.2.3 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

174
portal/v1/package-lock.json сгенерированный
Просмотреть файл

@ -11,7 +11,8 @@
"dependencies": {
"@popperjs/core": "^2.11.6",
"bootstrap": "^5.2.2",
"jquery": "^3.6.1"
"jquery": "^3.6.1",
"tom-select": "^2.2.2"
},
"devDependencies": {
"copy-webpack-plugin": "^11.0.0",
@ -164,6 +165,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/@popperjs/core": {
"version": "2.11.6",
"resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.6.tgz",
@ -388,9 +402,9 @@
}
},
"node_modules/@types/yargs": {
"version": "17.0.13",
"resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.13.tgz",
"integrity": "sha512-9sWaruZk2JGxIQU+IhI1fhPYRcQ0UuTNuKuCW9bR5fp7qi2Llf7WDzNa17Cy7TKnh3cdxDOiyTu6gaLS0eDatg==",
"version": "17.0.14",
"resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.14.tgz",
"integrity": "sha512-9Pj7abXoW1RSTcZaL2Hk6G2XyLMlp5ECdVC/Zf2p/KBjC3srijLGgRAXOBjtFrJoIrvxdTKyKDA14bEcbxBaWw==",
"dev": true,
"dependencies": {
"@types/yargs-parser": "*"
@ -712,9 +726,9 @@
}
},
"node_modules/anymatch": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz",
"integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==",
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz",
"integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==",
"dev": true,
"dependencies": {
"normalize-path": "^3.0.0",
@ -803,9 +817,9 @@
"dev": true
},
"node_modules/bootstrap": {
"version": "5.2.2",
"resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.2.2.tgz",
"integrity": "sha512-dEtzMTV71n6Fhmbg4fYJzQsw1N29hJKO1js5ackCgIpDcGid2ETMGC6zwSYw09v05Y+oRdQ9loC54zB1La3hHQ==",
"version": "5.2.3",
"resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.2.3.tgz",
"integrity": "sha512-cEKPM+fwb3cT8NzQZYEu4HilJ3anCrWqh3CHAok1p9jXqMPsPTBhU25fBckEJHJ/p+tTxTFTsFQGM+gaHpi3QQ==",
"funding": [
{
"type": "github",
@ -920,9 +934,9 @@
}
},
"node_modules/caniuse-lite": {
"version": "1.0.30001431",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001431.tgz",
"integrity": "sha512-zBUoFU0ZcxpvSt9IU66dXVT/3ctO1cy4y9cscs1szkPlcWb6pasYM144GqrUygUbT+k7cmUCW61cvskjcv0enQ==",
"version": "1.0.30001434",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001434.tgz",
"integrity": "sha512-aOBHrLmTQw//WFa2rcF1If9fa3ypkC1wzqqiKHgfdrXTWcU8C4gKVZT77eQAPWN1APys3+uQ0Df07rKauXGEYA==",
"dev": true,
"funding": [
{
@ -1012,9 +1026,9 @@
}
},
"node_modules/ci-info": {
"version": "3.6.1",
"resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.6.1.tgz",
"integrity": "sha512-up5ggbaDqOqJ4UqLKZ2naVkyqSJQgJi5lwD6b6mM748ysrghDBX0bx/qJTUHzw7zu6Mq4gycviSF5hJnwceD8w==",
"version": "3.7.0",
"resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.7.0.tgz",
"integrity": "sha512-2CpRNYmImPx+RXKLq6jko/L07phmS9I02TyqkcNU20GCF/GgaWvc58hPtjxDX8lPpkdwc9sNh72V9k00S7ezog==",
"dev": true,
"engines": {
"node": ">=8"
@ -1614,9 +1628,9 @@
}
},
"node_modules/enhanced-resolve": {
"version": "5.10.0",
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.10.0.tgz",
"integrity": "sha512-T0yTFjdpldGY8PmuXXR0PyQ1ufZpEGiHVrp7zHKB7jdR4qlmZHhONVM5AQOAWXuF/w3dnHbEQVrNptJgt7F+cQ==",
"version": "5.12.0",
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.12.0.tgz",
"integrity": "sha512-QHTXI/sZQmko1cbDoNAa3mJ5qhWUUNAq3vR0/YiD379fWQrcfuoX1+HW2S0MTt7XmoPLapdaDKUtelUSPic7hQ==",
"dev": true,
"dependencies": {
"graceful-fs": "^4.2.4",
@ -2356,9 +2370,9 @@
}
},
"node_modules/ignore": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz",
"integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==",
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.1.tgz",
"integrity": "sha512-d2qQLzTJ9WxQftPAuEQpSPmKqzxePjzVbpAVv62AQ64NTL+wR4JkrVqR/LqFsFEUsHDAiId52mJteHDFuDkElA==",
"dev": true,
"engines": {
"node": ">= 4"
@ -2698,9 +2712,9 @@
}
},
"node_modules/memfs": {
"version": "3.4.11",
"resolved": "https://registry.npmjs.org/memfs/-/memfs-3.4.11.tgz",
"integrity": "sha512-GvsCITGAyDCxxsJ+X6prJexFQEhOCJaIlUbsAvjzSI5o5O7j2dle3jWvz5Z5aOdpOxW6ol3vI1+0ut+641F1+w==",
"version": "3.4.12",
"resolved": "https://registry.npmjs.org/memfs/-/memfs-3.4.12.tgz",
"integrity": "sha512-BcjuQn6vfqP+k100e0E9m61Hyqa//Brp+I3f0OBmN0ATHlFA8vx3Lt8z57R3u2bPqe3WGDBC+nF72fTH7isyEw==",
"dev": true,
"dependencies": {
"fs-monkey": "^1.0.3"
@ -3638,9 +3652,9 @@
}
},
"node_modules/postcss-selector-parser": {
"version": "6.0.10",
"resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.10.tgz",
"integrity": "sha512-IQ7TZdoaqbT+LCpShg46jnZVlhWD2w6iQYAcYXfHARZ7X1t/UGhhceQDs5X0cGqKvYlHNOuv7Oa1xmb0oQuA3w==",
"version": "6.0.11",
"resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.11.tgz",
"integrity": "sha512-zbARubNdogI9j7WY4nQJBiNqQf3sLS3wCP4WfOidu+p28LofJqDH1tcXypGrcmMHhDk2t9wGhCsYe/+szLTy1g==",
"dev": true,
"dependencies": {
"cssesc": "^3.0.0",
@ -4507,9 +4521,9 @@
}
},
"node_modules/terser": {
"version": "5.15.1",
"resolved": "https://registry.npmjs.org/terser/-/terser-5.15.1.tgz",
"integrity": "sha512-K1faMUvpm/FBxjBXud0LWVAGxmvoPbZbfTCYbSgaaYQaIXI3/TdI7a7ZGA73Zrou6Q8Zmz3oeUTsp/dj+ag2Xw==",
"version": "5.16.0",
"resolved": "https://registry.npmjs.org/terser/-/terser-5.16.0.tgz",
"integrity": "sha512-KjTV81QKStSfwbNiwlBXfcgMcOloyuRdb62/iLFPGBcVNF4EXjhdYBhYHmbJpiBrVxZhDvltE11j+LBQUxEEJg==",
"dev": true,
"dependencies": {
"@jridgewell/source-map": "^0.3.2",
@ -4654,6 +4668,22 @@
"node": ">=0.6"
}
},
"node_modules/tom-select": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/tom-select/-/tom-select-2.2.2.tgz",
"integrity": "sha512-igGah1yY6yhrnN2h/Ky8I5muw/nE/YQxIsEZoYu5qaA4bsRibvKto3s8QZZosKpOd0uO8fNYhRfAwgHB4IAYew==",
"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/tslib": {
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz",
@ -5228,6 +5258,19 @@
"fastq": "^1.6.0"
}
},
"@orchidjs/sifter": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/@orchidjs/sifter/-/sifter-1.0.3.tgz",
"integrity": "sha512-zCZbwKegHytfsPm8Amcfh7v/4vHqTAaOu6xFswBYcn8nznBOuseu6COB2ON7ez0tFV0mKL0nRNnCiZZA+lU9/g==",
"requires": {
"@orchidjs/unicode-variants": "^1.0.4"
}
},
"@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=="
},
"@popperjs/core": {
"version": "2.11.6",
"resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.6.tgz",
@ -5445,9 +5488,9 @@
}
},
"@types/yargs": {
"version": "17.0.13",
"resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.13.tgz",
"integrity": "sha512-9sWaruZk2JGxIQU+IhI1fhPYRcQ0UuTNuKuCW9bR5fp7qi2Llf7WDzNa17Cy7TKnh3cdxDOiyTu6gaLS0eDatg==",
"version": "17.0.14",
"resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.14.tgz",
"integrity": "sha512-9Pj7abXoW1RSTcZaL2Hk6G2XyLMlp5ECdVC/Zf2p/KBjC3srijLGgRAXOBjtFrJoIrvxdTKyKDA14bEcbxBaWw==",
"dev": true,
"requires": {
"@types/yargs-parser": "*"
@ -5715,9 +5758,9 @@
}
},
"anymatch": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz",
"integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==",
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz",
"integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==",
"dev": true,
"requires": {
"normalize-path": "^3.0.0",
@ -5795,9 +5838,9 @@
"dev": true
},
"bootstrap": {
"version": "5.2.2",
"resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.2.2.tgz",
"integrity": "sha512-dEtzMTV71n6Fhmbg4fYJzQsw1N29hJKO1js5ackCgIpDcGid2ETMGC6zwSYw09v05Y+oRdQ9loC54zB1La3hHQ==",
"version": "5.2.3",
"resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.2.3.tgz",
"integrity": "sha512-cEKPM+fwb3cT8NzQZYEu4HilJ3anCrWqh3CHAok1p9jXqMPsPTBhU25fBckEJHJ/p+tTxTFTsFQGM+gaHpi3QQ==",
"requires": {}
},
"brace-expansion": {
@ -5875,9 +5918,9 @@
}
},
"caniuse-lite": {
"version": "1.0.30001431",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001431.tgz",
"integrity": "sha512-zBUoFU0ZcxpvSt9IU66dXVT/3ctO1cy4y9cscs1szkPlcWb6pasYM144GqrUygUbT+k7cmUCW61cvskjcv0enQ==",
"version": "1.0.30001434",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001434.tgz",
"integrity": "sha512-aOBHrLmTQw//WFa2rcF1If9fa3ypkC1wzqqiKHgfdrXTWcU8C4gKVZT77eQAPWN1APys3+uQ0Df07rKauXGEYA==",
"dev": true
},
"chalk": {
@ -5935,9 +5978,9 @@
"dev": true
},
"ci-info": {
"version": "3.6.1",
"resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.6.1.tgz",
"integrity": "sha512-up5ggbaDqOqJ4UqLKZ2naVkyqSJQgJi5lwD6b6mM748ysrghDBX0bx/qJTUHzw7zu6Mq4gycviSF5hJnwceD8w==",
"version": "3.7.0",
"resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.7.0.tgz",
"integrity": "sha512-2CpRNYmImPx+RXKLq6jko/L07phmS9I02TyqkcNU20GCF/GgaWvc58hPtjxDX8lPpkdwc9sNh72V9k00S7ezog==",
"dev": true
},
"clean-css": {
@ -6366,9 +6409,9 @@
"dev": true
},
"enhanced-resolve": {
"version": "5.10.0",
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.10.0.tgz",
"integrity": "sha512-T0yTFjdpldGY8PmuXXR0PyQ1ufZpEGiHVrp7zHKB7jdR4qlmZHhONVM5AQOAWXuF/w3dnHbEQVrNptJgt7F+cQ==",
"version": "5.12.0",
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.12.0.tgz",
"integrity": "sha512-QHTXI/sZQmko1cbDoNAa3mJ5qhWUUNAq3vR0/YiD379fWQrcfuoX1+HW2S0MTt7XmoPLapdaDKUtelUSPic7hQ==",
"dev": true,
"requires": {
"graceful-fs": "^4.2.4",
@ -6926,9 +6969,9 @@
"requires": {}
},
"ignore": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz",
"integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==",
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.1.tgz",
"integrity": "sha512-d2qQLzTJ9WxQftPAuEQpSPmKqzxePjzVbpAVv62AQ64NTL+wR4JkrVqR/LqFsFEUsHDAiId52mJteHDFuDkElA==",
"dev": true
},
"import-local": {
@ -7181,9 +7224,9 @@
"dev": true
},
"memfs": {
"version": "3.4.11",
"resolved": "https://registry.npmjs.org/memfs/-/memfs-3.4.11.tgz",
"integrity": "sha512-GvsCITGAyDCxxsJ+X6prJexFQEhOCJaIlUbsAvjzSI5o5O7j2dle3jWvz5Z5aOdpOxW6ol3vI1+0ut+641F1+w==",
"version": "3.4.12",
"resolved": "https://registry.npmjs.org/memfs/-/memfs-3.4.12.tgz",
"integrity": "sha512-BcjuQn6vfqP+k100e0E9m61Hyqa//Brp+I3f0OBmN0ATHlFA8vx3Lt8z57R3u2bPqe3WGDBC+nF72fTH7isyEw==",
"dev": true,
"requires": {
"fs-monkey": "^1.0.3"
@ -7813,9 +7856,9 @@
}
},
"postcss-selector-parser": {
"version": "6.0.10",
"resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.10.tgz",
"integrity": "sha512-IQ7TZdoaqbT+LCpShg46jnZVlhWD2w6iQYAcYXfHARZ7X1t/UGhhceQDs5X0cGqKvYlHNOuv7Oa1xmb0oQuA3w==",
"version": "6.0.11",
"resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.11.tgz",
"integrity": "sha512-zbARubNdogI9j7WY4nQJBiNqQf3sLS3wCP4WfOidu+p28LofJqDH1tcXypGrcmMHhDk2t9wGhCsYe/+szLTy1g==",
"dev": true,
"requires": {
"cssesc": "^3.0.0",
@ -8449,9 +8492,9 @@
"dev": true
},
"terser": {
"version": "5.15.1",
"resolved": "https://registry.npmjs.org/terser/-/terser-5.15.1.tgz",
"integrity": "sha512-K1faMUvpm/FBxjBXud0LWVAGxmvoPbZbfTCYbSgaaYQaIXI3/TdI7a7ZGA73Zrou6Q8Zmz3oeUTsp/dj+ag2Xw==",
"version": "5.16.0",
"resolved": "https://registry.npmjs.org/terser/-/terser-5.16.0.tgz",
"integrity": "sha512-KjTV81QKStSfwbNiwlBXfcgMcOloyuRdb62/iLFPGBcVNF4EXjhdYBhYHmbJpiBrVxZhDvltE11j+LBQUxEEJg==",
"dev": true,
"requires": {
"@jridgewell/source-map": "^0.3.2",
@ -8551,6 +8594,15 @@
"integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==",
"dev": true
},
"tom-select": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/tom-select/-/tom-select-2.2.2.tgz",
"integrity": "sha512-igGah1yY6yhrnN2h/Ky8I5muw/nE/YQxIsEZoYu5qaA4bsRibvKto3s8QZZosKpOd0uO8fNYhRfAwgHB4IAYew==",
"requires": {
"@orchidjs/sifter": "^1.0.3",
"@orchidjs/unicode-variants": "^1.0.4"
}
},
"tslib": {
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz",

Просмотреть файл

@ -10,9 +10,10 @@
"author": "Microsoft",
"license": "Apache2",
"dependencies": {
"@popperjs/core": "^2.11.6",
"bootstrap": "^5.2.2",
"jquery": "^3.6.1",
"@popperjs/core": "^2.11.6"
"tom-select": "^2.2.2"
},
"devDependencies": {
"copy-webpack-plugin": "^11.0.0",

Просмотреть файл

@ -27,12 +27,9 @@
<div class="form-group">
<label for="selResourceId" class="form-label">Cluster:</label>
<div class="mb-3">
<div class="select-search">
<input id="enterResourceId" class="form-control" type="text" placeholder="Fetching clusters..." disabled>
<select id="selResourceId">
<option class="option-header" disabled>Select a cluster below</option>
</select>
</div>
<select id="selResourceId" autocomplete="off" placeholder="Search clusters..." disabled>
<option value=""></option>
</select>
</div>
</div>

Просмотреть файл

@ -5,7 +5,8 @@ import 'bootstrap/js/dist/dropdown';
import 'bootstrap/js/dist/alert';
import "./select/select.css"
import "./select/select.js"
import 'tom-select/dist/css/tom-select.bootstrap5.min.css';
import TomSelect from 'tom-select/dist/js/tom-select.complete.min';
jQuery.extend({
redirect: function (location, args) {
@ -33,8 +34,20 @@ jQuery(function () {
$.each(clusters, function (i, cluster) {
$("#selResourceId").append($("<option>").text(cluster.resourceId));
});
$("#enterResourceId").attr("placeholder", "Search for a cluster...");
$("#enterResourceId").prop("disabled", false);
$("#selResourceId").prop("disabled", false);
new TomSelect("#selResourceId", {
plugins: ["dropdown_input"],
maxOptions: null,
maxItems: 1,
placeholder: "Search clusters...",
onDropdownOpen: function (value) {
$(".dropdown-input").val($(".ts-control").children("div").html());
}
});
$("#selResourceId").css("display", "none");
},
dataType: "json",
});

Просмотреть файл

@ -1,36 +1,23 @@
.select-search {
.ts-control .item {
white-space: nowrap;
padding-right: 10px;
}
.ts-dropdown [data-selectable].option {
width: fit-content;
}
.ts-dropdown-content {
overflow: auto !important;
white-space: nowrap;
}
#selResourceId {
position: relative;
z-index: 2;
}
.select-search>select {
visibility: hidden;
width: 100%;
position: absolute;
z-index: -1;
border: 1px solid #ced4da;
border-radius: 0.375rem;
cursor: pointer;
max-height: 60vh;
}
.select-search>select>option {
padding: 10px;
}
.select-search>select>option:checked {
background-color: #dfdfdf;
}
.option-header {
text-transform: uppercase;
background: #aaaaaa;
color: #222222 !important;
cursor: default;
font-weight: 600;
}
.select-search>select>option:hover:not(:first-child) {
color: #ffffff;
background: #0d6efd;
.ts-wrapper:not(.form-control):not(.form-select).single .ts-control {
background: none !important;
overflow-x: auto;
}

Просмотреть файл

@ -1,46 +0,0 @@
const select_input = $("#enterResourceId");
const select_element = $("#selResourceId");
select_element.css("top", select_input.outerHeight());
function selectResourceId() {
select_input.val(select_element.find(":selected").text());
select_element.css("visibility", "hidden");
}
select_input.on("keyup change", function () {
if (select_input.val().length >= 2) {
select_element.children().each(function (i) {
if (i != 0) {
if (!$(this).text().toLowerCase().match(select_input.val().toLowerCase())) {
$(this).hide();
} else {
$(this).show();
}
}
});
} else {
select_element.children().each(function () {
$(this).show();
select_element.attr("size", select_element.children().length);
});
}
});
select_input.focus(function () {
select_element.attr("size", select_element.children().length);
select_element.css("z-index", "3");
select_element.css("visibility", "visible");
});
select_element.change(function () {
selectResourceId();
});
select_input.blur(function () {
setTimeout(function () {
if (!select_element.is(":focus")) {
selectResourceId();
}
}, 50);
});