29
0
mirror of https://github.com/joomla/joomla-cms.git synced 2024-06-25 14:53:01 +00:00

[4.0] Update Choices.js, fix placeholder for a select with multiple attribute (#27093)

This commit is contained in:
Fedir Zinchuk 2019-11-18 15:51:08 +02:00 committed by George Wilson
parent 4e7bc1c9e0
commit cb00087348
3 changed files with 27 additions and 31 deletions

View File

@ -107,6 +107,15 @@ window.customElements.define('joomla-field-fancy-select', class extends HTMLElem
this.isDisconnected = false;
// Add placeholder option for multiple mode,
// Because it not supported as parameter by Choices for <select> https://github.com/jshjohnson/Choices#placeholder
if (this.select.multiple && this.placeholder) {
const option = document.createElement('option');
option.setAttribute('placeholder', '');
option.textContent = this.placeholder;
this.select.appendChild(option);
}
// Init Choices
this.choicesInstance = new Choices(this.select, {
placeholderValue: this.placeholder,

47
package-lock.json generated
View File

@ -2310,14 +2310,13 @@
"dev": true
},
"choices.js": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/choices.js/-/choices.js-7.0.0.tgz",
"integrity": "sha512-qK9NEX4/riACBGle27BOWf6dZf+VqitbALB96LERBslqa05Tsn91bicACmLhw2Qym227mQIKN17hcIPwsRZ0mQ==",
"version": "9.0.0",
"resolved": "https://registry.npmjs.org/choices.js/-/choices.js-9.0.0.tgz",
"integrity": "sha512-j84XEJ3S49N1b9dWom7sSENaOVJRgp50nW9VrltG7IqgNwa6z9MlvIS0D5ZZFusX/JhboLcOPCglONq2jt6G1Q==",
"requires": {
"classnames": "^2.2.6",
"deepmerge": "^2.2.1",
"fuse.js": "3.4.2",
"redux": "^3.3.1"
"deepmerge": "^4.2.0",
"fuse.js": "^3.4.5",
"redux": "^4.0.4"
}
},
"chokidar": {
@ -2344,11 +2343,6 @@
"jquery": ">=1.4.4"
}
},
"classnames": {
"version": "2.2.6",
"resolved": "https://registry.npmjs.org/classnames/-/classnames-2.2.6.tgz",
"integrity": "sha512-JR/iSQOSt+LQIWwrwEzJ9uk0xfN3mTVYMwt1Ir5mUcSN6pU+V4zQFFaJsclJbPuAUQH+yfWef6tm7l1quW3C8Q=="
},
"cli-cursor": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz",
@ -2908,9 +2902,9 @@
"dev": true
},
"deepmerge": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-2.2.1.tgz",
"integrity": "sha512-R9hc1Xa/NOBi9WRVUWg19rl1UB7Tt4kuPd+thNJgFZoxXsTz7ncaPaeIm+40oSGuP33DfMb4sZt1QIGiJzC4EA=="
"version": "4.2.2",
"resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz",
"integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg=="
},
"define-properties": {
"version": "1.1.3",
@ -3852,9 +3846,9 @@
"dev": true
},
"fuse.js": {
"version": "3.4.2",
"resolved": "https://registry.npmjs.org/fuse.js/-/fuse.js-3.4.2.tgz",
"integrity": "sha512-WVbrm+cAxPtyMqdtL7cYhR7aZJPhtOfjNClPya8GKMVukKDYs7pEnPINeRVX1C9WmWgU8MdYGYbUPAP2AJXdoQ=="
"version": "3.4.5",
"resolved": "https://registry.npmjs.org/fuse.js/-/fuse.js-3.4.5.tgz",
"integrity": "sha512-s9PGTaQIkT69HaeoTVjwGsLfb8V8ScJLx5XGFcKHg0MqLUH/UZ4EKOtqtXX9k7AFqCGxD1aJmYb8Q5VYDibVRQ=="
},
"gauge": {
"version": "2.7.4",
@ -5060,11 +5054,6 @@
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
"integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A=="
},
"lodash-es": {
"version": "4.17.11",
"resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.11.tgz",
"integrity": "sha512-DHb1ub+rMjjrxqlB3H56/6MXtm1lSksDp2rA2cNWjG8mlDUYFhUj3Di2Zn5IwSU87xLv8tNIQ7sSwE/YOX/D/Q=="
},
"lodash.isplainobject": {
"version": "4.0.6",
"resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz",
@ -6539,14 +6528,12 @@
}
},
"redux": {
"version": "3.7.2",
"resolved": "https://registry.npmjs.org/redux/-/redux-3.7.2.tgz",
"integrity": "sha512-pNqnf9q1hI5HHZRBkj3bAngGZW/JMCmexDlOxw4XagXY2o1327nHH54LoTjiPJ0gizoqPDRqWyX/00g0hD6w+A==",
"version": "4.0.4",
"resolved": "https://registry.npmjs.org/redux/-/redux-4.0.4.tgz",
"integrity": "sha512-vKv4WdiJxOWKxK0yRoaK3Y4pxxB0ilzVx6dszU2W8wLxlb2yikRph4iV/ymtdJ6ZxpBLFbyrxklnT5yBbQSl3Q==",
"requires": {
"lodash": "^4.2.1",
"lodash-es": "^4.2.1",
"loose-envify": "^1.1.0",
"symbol-observable": "^1.0.3"
"loose-envify": "^1.4.0",
"symbol-observable": "^1.2.0"
}
},
"regenerate": {

View File

@ -31,7 +31,7 @@
"@webcomponents/webcomponentsjs": "2.1.2",
"awesomplete": "1.1.4",
"bootstrap": "~4.3",
"choices.js": "^7.0.0",
"choices.js": "^9.0.0",
"chosen-js": "1.6.2",
"codemirror": "5.40.0",
"cropperjs": "1.2.2",