mirror of
https://github.com/Choices-js/Choices.git
synced 2024-06-08 08:52:19 +02:00
Version 3.0.4
This commit is contained in:
parent
394bde313d
commit
9b860da254
19
assets/scripts/dist/choices.js
vendored
19
assets/scripts/dist/choices.js
vendored
|
@ -1,4 +1,4 @@
|
|||
/*! choices.js v3.0.3 | (c) 2018 Josh Johnson | https://github.com/jshjohnson/Choices#readme */
|
||||
/*! choices.js v3.0.4 | (c) 2018 Josh Johnson | https://github.com/jshjohnson/Choices#readme */
|
||||
(function webpackUniversalModuleDefinition(root, factory) {
|
||||
if(typeof exports === 'object' && typeof module === 'object')
|
||||
module.exports = factory();
|
||||
|
@ -149,11 +149,14 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
noChoicesText: 'No choices to choose from',
|
||||
itemSelectText: 'Press to select',
|
||||
addItemText: function addItemText(value) {
|
||||
return 'Press Enter to add <b>"' + value + '"</b>';
|
||||
return 'Press Enter to add <b>"' + (0, _utils.stripHTML)(value) + '"</b>';
|
||||
},
|
||||
maxItemText: function maxItemText(maxItemCount) {
|
||||
return 'Only ' + maxItemCount + ' values can be added.';
|
||||
},
|
||||
itemComparer: function itemComparer(choice, item) {
|
||||
return choice === item;
|
||||
},
|
||||
uniqueItemText: 'Only unique values can be added.',
|
||||
classNames: {
|
||||
containerOuter: 'choices',
|
||||
|
@ -1067,7 +1070,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
choiceValue.forEach(function (val) {
|
||||
var foundChoice = choices.find(function (choice) {
|
||||
// Check 'value' property exists and the choice isn't already selected
|
||||
return choice.value === val;
|
||||
return _this11.config.itemComparer(choice.value, val);
|
||||
});
|
||||
|
||||
if (foundChoice) {
|
||||
|
@ -5910,14 +5913,12 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
};
|
||||
|
||||
/**
|
||||
* Remove html tags from a string
|
||||
* @param {String} Initial string/html
|
||||
* Escape html in a string
|
||||
* @param {String} html Initial string/html
|
||||
* @return {String} Sanitised string
|
||||
*/
|
||||
var stripHTML = exports.stripHTML = function stripHTML(html) {
|
||||
var el = document.createElement("DIV");
|
||||
el.innerHTML = html;
|
||||
return el.textContent || el.innerText || "";
|
||||
return html.replace(/&/g, '&').replace(/>/g, '&rt;').replace(/</g, '<').replace(/"/g, '"');
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -5978,7 +5979,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
var width = input.offsetWidth;
|
||||
|
||||
if (value) {
|
||||
var testEl = strToEl('<span>' + value + '</span>');
|
||||
var testEl = strToEl('<span>' + stripHTML(value) + '</span>');
|
||||
testEl.style.position = 'absolute';
|
||||
testEl.style.padding = '0';
|
||||
testEl.style.top = '-9999px';
|
||||
|
|
2
assets/scripts/dist/choices.js.map
vendored
2
assets/scripts/dist/choices.js.map
vendored
File diff suppressed because one or more lines are too long
8
assets/scripts/dist/choices.min.js
vendored
8
assets/scripts/dist/choices.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "choices.js",
|
||||
"version": "3.0.3",
|
||||
"version": "3.0.4",
|
||||
"description": "A vanilla JS customisable text input/select box plugin",
|
||||
"main": [
|
||||
"./assets/scripts/dist/choices.js",
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
<meta name="theme-color" content="#ffffff">
|
||||
|
||||
<!-- Ignore these -->
|
||||
<link rel="stylesheet" href="assets/styles/css/base.min.css?version=3.0.3">
|
||||
<link rel="stylesheet" href="assets/styles/css/base.min.css?version=3.0.4">
|
||||
<!-- End ignore these -->
|
||||
|
||||
<!-- Optional includes -->
|
||||
|
@ -24,8 +24,8 @@
|
|||
<!-- End optional includes -->
|
||||
|
||||
<!-- Choices includes -->
|
||||
<link rel="stylesheet" href="assets/styles/css/choices.min.css?version=3.0.3">
|
||||
<script src="assets/scripts/dist/choices.min.js?version=3.0.3"></script>
|
||||
<link rel="stylesheet" href="assets/styles/css/choices.min.css?version=3.0.4">
|
||||
<script src="assets/scripts/dist/choices.min.js?version=3.0.4"></script>
|
||||
<!-- End Choices includes -->
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "choices.js",
|
||||
"version": "3.0.3",
|
||||
"version": "3.0.4",
|
||||
"description": "A vanilla JS customisable text input/select box plugin",
|
||||
"main": "./assets/scripts/dist/choices.min.js",
|
||||
"types": "./types/index.d.ts",
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Example usage: npm --newVersion=3.0.3 run version
|
||||
// Example usage: npm --newVersion=3.0.4 run version
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
|
Loading…
Reference in a new issue