1
0
mirror of synced 2024-11-22 04:56:08 +03:00

added license banner

This commit is contained in:
Igor Vaynberg 2019-06-27 08:42:41 -07:00
parent 14f5a33dfe
commit 6c00b633fc
7 changed files with 182 additions and 73 deletions

22
BANNER.txt Normal file
View File

@ -0,0 +1,22 @@
Copyright <%= moment().format('YYYY') %> Igor Vaynberg and Select2 contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Bundle of <%= pkg.name %>
Generated: <%= moment().format('YYYY-MM-DD') %>
Version: <%= pkg.version %>
Dependencies:
<% _.forEach(dependencies, function (dependency) { %>
<%= dependency.name %> -- <%= dependency.version %>
<% }) %>

4
dist/select25.css vendored
View File

@ -19,8 +19,11 @@
.s25-search {
font-size: 100%;
line-height: 24px;
box-shadow: none;
outline: 0;
}
.s25-search:focus {
box-shadow: none;
outline: 0;
}
@ -182,6 +185,7 @@
overflow-y: auto;
position: relative;
box-sizing: border-box;
max-height: 175px;
}
.s25-dropdown .s25-options {
width: 100%;

164
dist/select25.js vendored
View File

@ -1,3 +1,29 @@
/**
* Copyright 2019 Igor Vaynberg and Select2 contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
* persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
* WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Bundle of select2
* Generated: 2019-06-27
* Version: 5.0.0-snapshot
* Dependencies:
*
* tslib -- 1.9.3
*
* preact -- 10.0.0-beta.3
*/
!(function(e, t) {
'object' == typeof exports && 'undefined' != typeof module
? t(exports)
@ -199,7 +225,7 @@
var t = l(e.type, e.props, e.key, null);
return (t.__e = e.__e), t;
}
function x(e, t) {
function I(e, t) {
(this.props = e), (this.context = t);
}
function s(e) {
@ -216,7 +242,7 @@
)
e.__d && e.forceUpdate(!1);
}
function I(e, t, n, o, r, s, a, i) {
function x(e, t, n, o, r, s, a, i) {
var l,
u,
c,
@ -326,7 +352,7 @@
? (v = (c = t.__c = n.__c).__p = c.__E)
: (_.prototype && _.prototype.render
? (t.__c = c = new _(m, y))
: ((t.__c = c = new x(m, y)), (c.constructor = _), (c.render = O)),
: ((t.__c = c = new I(m, y)), (c.constructor = _), (c.render = O)),
g && g.sub(c),
(c.props = m),
c.state || (c.state = {}),
@ -379,7 +405,7 @@
for (
null != c.getChildContext && (o = S(S({}, o), c.getChildContext())),
p || null == c.getSnapshotBeforeUpdate || (h = c.getSnapshotBeforeUpdate(d, f)),
I(e, t, n, o, r, s, a, l),
x(e, t, n, o, r, s, a, l),
c.base = t.__e;
(u = c.__h.pop());
@ -418,7 +444,7 @@
null == s &&
((c && u && c.__html == u.__html) || (e.innerHTML = (c && c.__html) || '')),
d.multiple && (e.multiple = d.multiple),
I(e, t, n, o, 'foreignObject' !== t.type && r, s, a, w),
x(e, t, n, o, 'foreignObject' !== t.type && r, s, a, w),
(function(e, t, n, o) {
var r,
s,
@ -545,12 +571,12 @@
})(e, document.getElementById('s25-live-polite'));
}
(b = {}),
(x.prototype.setState = function(e, t) {
(I.prototype.setState = function(e, t) {
var n = (this.__s !== this.state && this.__s) || (this.__s = S({}, this.state));
('function' == typeof e && !(e = e(n, this.props))) || S(n, e),
null != e && this.__v && (t && this.__h.push(t), s(this));
}),
(x.prototype.forceUpdate = function(e) {
(I.prototype.forceUpdate = function(e) {
var t,
n,
o,
@ -593,7 +619,7 @@
})(r)),
e && e();
}),
(x.prototype.render = k),
(I.prototype.render = k),
(n = []),
(r = 'function' == typeof Promise ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout),
(u = /[A-Z]/g),
@ -642,20 +668,20 @@
});
var U,
B,
H = function(t, e) {
j = function(t, e) {
if (!e.length) return t;
var n = e.shift();
return (
void 0 === n ||
(j(t) &&
j(n) &&
(H(t) &&
H(n) &&
Object.keys(n).forEach(function(e) {
j(n[e]) ? (t[e] || (t[e] = {}), H(t[e], [n[e]])) : (t[e] = n[e]);
H(n[e]) ? (t[e] || (t[e] = {}), j(t[e], [n[e]])) : (t[e] = n[e]);
})),
H(t, e)
j(t, e)
);
},
j = function(e) {
H = function(e) {
return (
(function(e) {
return null !== e && 'object' == typeof e;
@ -704,7 +730,7 @@
}
var Y,
G = { allowDuplicates: !1, itemId: 'id', itemLabel: 'text', minimumCharacters: 0, quiet: 50, tabIndex: 0 },
$ = (t(J, (Y = x)),
$ = (t(J, (Y = I)),
Object.defineProperty(J.prototype, 'dictionary', {
get: function() {
var e = this.props.dictionary;
@ -714,7 +740,7 @@
configurable: !0
}),
(J.prototype.updateState = function(e, t) {
var n = H(this.state, Array.isArray(e) ? e : [e]);
var n = j(this.state, Array.isArray(e) ? e : [e]);
this.setState(n, t);
}),
(J.prototype.loadMore = function() {
@ -926,7 +952,7 @@
);
}
var Z,
Q = (t(ee, (Z = x)),
Q = (t(ee, (Z = I)),
(ee.prototype.getChildContext = function() {
return this.props.context;
}),
@ -943,7 +969,7 @@
return f(D(Q, { context: this.context }, t), n), null;
}
var ne,
oe = (t(re, (ne = x)),
oe = (t(re, (ne = I)),
(re.prototype.componentWillMount = function() {
(this.container = document.createElement('div')),
this.props.class && (this.container.className = this.props.class),
@ -1089,9 +1115,10 @@
(le.searchResultsMinimumError = 's25-search-results-minimum-error'),
(le.hiddenAccessible = 's25-hidden-accessible'),
(le.hidden = 's25-hidden'),
(le.placeholder = 's25-placeholder');
(le.placeholder = 's25-placeholder'),
(le.scroll = 's25-scroll');
var ue,
ce = (t(pe, (ue = x)),
ce = (t(pe, (ue = I)),
(pe.prototype.getResultDomId = function(e) {
return this.props.namespace + e;
}),
@ -1107,13 +1134,7 @@
{ class: ie.body },
D(
'div',
{
ref: this.container,
onScroll: this.onScroll,
class: ie.searchResults,
'aria-busy': i.loading,
style: { maxHeight: '175px' }
},
{ ref: this.container, onScroll: this.onScroll, class: ie.searchResults, 'aria-busy': i.loading },
i.loading &&
D(
'div',
@ -1248,27 +1269,28 @@
s = e.tabIndex,
a = e.minimumCharacters,
i = e.valuesLabel,
l = (e.comboboxLabel, t.open),
c = t.loading,
p = t.focused,
d = t.search,
f = t.values,
h = f.active,
v = f.selected,
m = t.results,
g = this.dictionary,
y = q(ie.control, ie.multi, (((n = {})[ie.open] = l), n), (((o = {})[ie.focused] = p), o));
e.containerClass && 0 < e.containerClass.length && (y += ' ' + e.containerClass);
var _ = this.namespace + '-instructions',
b = this.namespace + '-results',
w = this.namespace + '-res-';
l = e.comboboxLabel,
c = t.open,
p = t.loading,
d = t.focused,
f = t.search,
h = t.values,
v = h.active,
m = h.selected,
g = t.results,
y = this.dictionary,
_ = q(ie.control, ie.multi, (((n = {})[ie.open] = c), n), (((o = {})[ie.focused] = d), o));
e.containerClass && 0 < e.containerClass.length && (_ += ' ' + e.containerClass);
var b = this.namespace + '-instructions',
w = this.namespace + '-results',
R = this.namespace + '-res-';
return D(
k,
null,
D(
'div',
{
class: y,
class: _,
ref: this.containerRef,
onFocusCapture: this.onFocusIn,
onBlurCapture: this.onFocusOut,
@ -1280,11 +1302,11 @@
{ class: q(ie.body), ref: this.bodyRef, onClick: this.onBodyClick },
D(
'div',
{ id: _, class: q(ie.offscreen), style: { display: 'none' } },
g.multiSelectInstructions()
{ id: b, class: q(ie.offscreen), style: { display: 'none' } },
y.multiSelectInstructions()
),
z(function() {
var e = 0 <= h ? u.namespace + '-vl-' + h : void 0;
var e = 0 <= v ? u.namespace + '-vl-' + v : void 0;
return r && 0 < r.length
? D(
'div',
@ -1297,15 +1319,15 @@
'aria-multiselectable': 'true',
'aria-activedescendant': e,
'aria-label': i,
'aria-describedby': _,
'aria-describedby': b,
onFocus: u.onValuesFocus,
onBlur: u.onValuesBlur,
onKeyDown: u.onValuesKeyDown
},
r.map(function(e, t) {
var n,
o = v[t],
r = h === t,
o = m[t],
r = v === t,
s = q(ie.item, (((n = {})[ie.selected] = o), (n[ie.active] = r), n)),
a = u.namespace + '-vl-' + t,
i = u.getItemLabel(e),
@ -1331,7 +1353,7 @@
}),
z(function() {
var e,
t = !v.find(function(e) {
t = !m.find(function(e) {
return !0 === e;
});
return D(
@ -1342,26 +1364,26 @@
onFocus: u.onRemoveSelectedFocus,
disabled: t,
'aria-disabled': t,
title: g.removeButtonTitle()
title: y.removeButtonTitle()
},
D('span', null, D(ae, { width: 20, height: 20 }))
);
}),
D('label', { htmlFor: void 0, className: ie.offscreen }, e.comboboxLabel),
D('label', { htmlFor: void 0, className: ie.offscreen }, l),
D('input', {
type: 'text',
ref: this.searchRef,
value: d,
value: f,
class: q(ie.search),
role: 'combobox',
'aria-label': e.comboboxLabel,
'aria-autocomplete': 'list',
'aria-haspopup': 'true',
'aria-owns': b,
'aria-controls': b,
'aria-expanded': l ? 'true' : 'false',
'aria-activedescendant': 0 <= m.active ? w + m.active : void 0,
'aria-busy': c,
'aria-owns': w,
'aria-controls': w,
'aria-expanded': c ? 'true' : 'false',
'aria-activedescendant': 0 <= g.active ? R + g.active : void 0,
'aria-busy': p,
onInput: this.onSearchInput,
onKeyDown: this.onSearchKeyDown,
onFocus: this.onSearchFocus
@ -1373,7 +1395,7 @@
)
)
),
l &&
c &&
D(
oe,
{
@ -1386,17 +1408,17 @@
ce,
C(
{
namespace: w,
namespace: R,
minimumCharacters: a,
dictionary: this.dictionary,
itemLabel: this.getItemLabel,
renderItem: this.renderResult,
listboxDomId: b,
search: d
listboxDomId: w,
search: f
},
this.state.results,
{
loading: c,
loading: p,
onResultClicked: this.onResultClicked,
onMouseMove: this.onResultMouseMove,
onLoadMore: this.onLoadMoreResults
@ -1882,7 +1904,7 @@
n.initEvent('change', !1, !0), (n[t] = t), e.dispatchEvent(n);
}
var De,
ke = (t(Me, (De = x)),
ke = (t(Me, (De = I)),
(Me.prototype.componentDidUpdate = function() {
this.setHiddenValue(this.state.values);
}),
@ -1928,8 +1950,8 @@
t
);
}
var xe,
Ie = (t(Le, (xe = x)),
var Ie,
xe = (t(Le, (Ie = I)),
(Le.prototype.componentDidMount = function() {
this.setHiddenValue(this.state.value);
}),
@ -1968,7 +1990,7 @@
}),
Le);
function Le(e) {
var t = xe.call(this, e) || this;
var t = Ie.call(this, e) || this;
return (
(t.onChange = function(e) {
t.setState({ value: e }), t.setHiddenValue(e), Se(t.props.element, e);
@ -2032,20 +2054,20 @@
};
})(t.data))),
!t.tabIndex && e.tabIndex && (t.tabIndex = e.tabIndex),
e.getAttribute('s25-style'))
e.getAttribute('data-s25-container-style'))
) {
var o = t.containerStyle || '';
0 < o.length && (o += ';'), (o += e.getAttribute('s25-style')), (t.containerStyle = o);
0 < o.length && (o += ';'), (o += e.getAttribute('data-s25-container-style')), (t.containerStyle = o);
}
if (e.getAttribute('s25-class')) {
if (e.getAttribute('data-s25-container-class')) {
var r = t.containerClass || '';
0 < r.length && (r += ' '), (r += e.getAttribute('s25-class')), (t.containerClass = r);
0 < r.length && (r += ' '), (r += e.getAttribute('data-s25-container-class')), (t.containerClass = r);
}
var s = e.parentElement,
a = document.createElement('div');
s.insertBefore(a, e),
n.set(be.targetElement, a),
t.multiple ? f(D(ke, { element: e, options: t }), s, a) : f(D(Ie, { element: e, options: t }), s, a);
t.multiple ? f(D(ke, { element: e, options: t }), s, a) : f(D(xe, { element: e, options: t }), s, a);
},
destroy: function(e) {
if (we.hasStore(e)) {

File diff suppressed because one or more lines are too long

50
package-lock.json generated
View File

@ -3682,6 +3682,12 @@
"integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==",
"dev": true
},
"commenting": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/commenting/-/commenting-1.1.0.tgz",
"integrity": "sha512-YeNK4tavZwtH7jEgK1ZINXzLKm6DZdEMfsaaieOsCAN0S8vsY7UeuO3Q7d/M018EFgE+IeUAuBOKkFccBZsUZA==",
"dev": true
},
"component-emitter": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz",
@ -8817,6 +8823,12 @@
}
}
},
"moment": {
"version": "2.24.0",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz",
"integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==",
"dev": true
},
"ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
@ -11102,6 +11114,31 @@
"inherits": "^2.0.1"
}
},
"rollup": {
"version": "1.16.2",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-1.16.2.tgz",
"integrity": "sha512-UAZxaQvH0klYZdF+90xv9nGb+m4p8jdoaow1VL5/RzDK/gN/4CjvaMmJNcOIv1/+gtzswKhAg/467mzF0sLpAg==",
"dev": true,
"requires": {
"@types/estree": "0.0.39",
"@types/node": "^12.0.8",
"acorn": "^6.1.1"
},
"dependencies": {
"@types/node": {
"version": "12.0.10",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.0.10.tgz",
"integrity": "sha512-LcsGbPomWsad6wmMNv7nBLw7YYYyfdYcz6xryKYQhx89c3XXan+8Q6AJ43G5XDIaklaVkK3mE4fCb0SBvMiPSQ==",
"dev": true
},
"acorn": {
"version": "6.1.1",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-6.1.1.tgz",
"integrity": "sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA==",
"dev": true
}
}
},
"rollup-plugin-babel": {
"version": "4.3.2",
"resolved": "https://registry.npmjs.org/rollup-plugin-babel/-/rollup-plugin-babel-4.3.2.tgz",
@ -11125,6 +11162,19 @@
"rollup-pluginutils": "^2.7.0"
}
},
"rollup-plugin-license": {
"version": "0.9.0",
"resolved": "https://registry.npmjs.org/rollup-plugin-license/-/rollup-plugin-license-0.9.0.tgz",
"integrity": "sha512-/1PW3C1+xIeUsaSQdvRsMFu7Oqmou6ArLBy5vDfem1Yv8wEBGlJ4+izYTZn61Lq39srT+6bndK+zfYTz0CrXQQ==",
"dev": true,
"requires": {
"commenting": "1.1.0",
"lodash": "4.17.11",
"magic-string": "0.25.2",
"mkdirp": "0.5.1",
"moment": "2.24.0"
}
},
"rollup-plugin-node-resolve": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-5.0.1.tgz",

View File

@ -39,8 +39,10 @@
"prettier": "^1.17.1",
"pretty": "^2.0.0",
"puppeteer": "^1.17.0",
"rollup": "^1.16.2",
"rollup-plugin-babel": "^4.3.2",
"rollup-plugin-commonjs": "^10.0.0",
"rollup-plugin-license": "^0.9.0",
"rollup-plugin-node-resolve": "^5.0.1",
"rollup-plugin-replace": "^2.2.0",
"rollup-plugin-scss": "^1.0.1",

View File

@ -3,6 +3,8 @@ import resolve from 'rollup-plugin-node-resolve';
import scss from 'rollup-plugin-scss';
import typescript from 'rollup-plugin-typescript';
import { uglify } from 'rollup-plugin-uglify';
const license = require('rollup-plugin-license');
const path = require('path');
export default [
// browser-friendly UMD build
@ -14,6 +16,13 @@ export default [
format: 'umd',
sourcemap: true
},
plugins: [resolve(), commonjs(), typescript(), uglify(), scss()]
plugins: [
resolve(),
commonjs(),
typescript(),
uglify(),
scss(),
license({ banner: { file: path.join(__dirname, 'BANNER.txt'), encoding: 'utf-8' } })
]
}
];