vue3-extended-multiselect 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.browserslistrc +3 -0
- package/.eslintrc.js +29 -0
- package/CHANGELOG.md +9 -0
- package/README.md +696 -0
- package/babel.config.js +5 -0
- package/index.js +3 -0
- package/jest.config.js +57 -0
- package/package.json +44 -0
- package/public/favicon.ico +0 -0
- package/public/index.html +17 -0
- package/src/assets/base-arrow.svg +70 -0
- package/src/assets/cancel.svg +35 -0
- package/src/assets/circle-arrow.svg +7 -0
- package/src/assets/double-arrow.svg +39 -0
- package/src/assets/inner-arrow.svg +8 -0
- package/src/assets/loader.svg +6 -0
- package/src/assets/triangle-arrow.svg +72 -0
- package/src/assets/triangle-circle-arrow.svg +38 -0
- package/src/assets/wide-arrow.svg +72 -0
- package/src/components/ExtendedMultiselectCancel.vue +142 -0
- package/src/components/ExtendedMultiselectInput.vue +619 -0
- package/src/components/ExtendedMultiselectLoader.vue +176 -0
- package/src/components/ExtendedMultiselectMultiple.vue +292 -0
- package/src/components/ExtendedMultiselectOptions.vue +1088 -0
- package/src/components/ExtendedMultiselectToggle.vue +255 -0
- package/src/components/Vue3ExtendedMultiselect.vue +1651 -0
- package/src/composition/cancel.js +31 -0
- package/src/composition/labels.js +40 -0
- package/src/composition/preselected-options.js +67 -0
- package/src/composition/search-value.js +34 -0
- package/src/composition/sizes.js +43 -0
- package/src/composition/toggle.js +34 -0
- package/src/sass/animations.sass +13 -0
- package/src/sass/main.sass +340 -0
- package/src/sass/mixins.sass +40 -0
- package/src/sass/variables.sass +37 -0
- package/src/sets/sets.js +100 -0
- package/tests/unit/events.spec.js +136 -0
- package/tests/unit/props.spec.js +1041 -0
- package/tests/utils/mount.js +38 -0
- package/tests/utils/stubs.js +1 -0
- package/tests/utils/utils.js +21 -0
- package/typings/vue3-extended-multiselect.d.ts +34 -0
package/babel.config.js
ADDED
package/index.js
ADDED
package/jest.config.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
preset: '@vue/cli-plugin-unit-jest',
|
|
3
|
+
transform: {
|
|
4
|
+
'^.+\\.vue$': 'vue-jest'
|
|
5
|
+
},
|
|
6
|
+
expand: true,
|
|
7
|
+
displayName: {
|
|
8
|
+
name: "vue3-extended-multiselect",
|
|
9
|
+
color: "bgGreen",
|
|
10
|
+
},
|
|
11
|
+
extraGlobals: [],
|
|
12
|
+
globals: {
|
|
13
|
+
OPTIONS: [
|
|
14
|
+
{ label: "First Option", customLabel: "First Option Custom Label" },
|
|
15
|
+
{ label: "Second Option" },
|
|
16
|
+
126,
|
|
17
|
+
],
|
|
18
|
+
INPUT_ID: "vue3-extended-multiselect-input-1",
|
|
19
|
+
SEARCH_VALUE: "Search for options",
|
|
20
|
+
SEARCH_VALUE_WITH_RESULTS: "First",
|
|
21
|
+
MORE_THAN_LIMIT: "You have to select no more than one option",
|
|
22
|
+
LESS_THAN_LIMIT: "You have to select at least two options",
|
|
23
|
+
},
|
|
24
|
+
include: [
|
|
25
|
+
"<rootDir>/components/ExtendedMultiselectOptions.vue"
|
|
26
|
+
],
|
|
27
|
+
injectGlobals: true,
|
|
28
|
+
moduleFileExtensions: [
|
|
29
|
+
"ts",
|
|
30
|
+
"tsx",
|
|
31
|
+
"js",
|
|
32
|
+
"json",
|
|
33
|
+
"jsx",
|
|
34
|
+
"mjs",
|
|
35
|
+
"node",
|
|
36
|
+
"vue"
|
|
37
|
+
],
|
|
38
|
+
moduleNameMapper: {
|
|
39
|
+
"\\.svg$" : "<rootDir>/tests/utils/stubs",
|
|
40
|
+
"\\.sass$" : "identity-obj-proxy",
|
|
41
|
+
},
|
|
42
|
+
modulePathIgnorePatterns: ["<rootDir>/assets"],
|
|
43
|
+
resetModules: true,
|
|
44
|
+
resetMocks: true,
|
|
45
|
+
rootDir: "./",
|
|
46
|
+
slowTestThreshold: 20,
|
|
47
|
+
testEnvironment: "jsdom",
|
|
48
|
+
testLocationInResults: true,
|
|
49
|
+
testMatch: [
|
|
50
|
+
"**/tests/**/*.[jt]s?(x)",
|
|
51
|
+
"**/?(*.)+(spec|test).[tj]s?(x)"
|
|
52
|
+
],
|
|
53
|
+
testPathIgnorePatterns: [
|
|
54
|
+
"tests/utils"
|
|
55
|
+
],
|
|
56
|
+
timers: "real",
|
|
57
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "vue3-extended-multiselect",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Extended multiselect component for applications based on Vue 3 framework",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"multiselect",
|
|
7
|
+
"select",
|
|
8
|
+
"extended",
|
|
9
|
+
"vue",
|
|
10
|
+
"vue3"
|
|
11
|
+
],
|
|
12
|
+
"typings": "typings/vue3-extended-multiselect.d.ts",
|
|
13
|
+
"author": "Ridiger Daniil Dmitrievich <extendedmultiselect@yandex.ru>",
|
|
14
|
+
"scripts": {
|
|
15
|
+
"start": "vue-cli-service serve",
|
|
16
|
+
"build": "vue-cli-service build",
|
|
17
|
+
"test:unit": "vue-cli-service test:unit",
|
|
18
|
+
"lint": "vue-cli-service lint"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"click-outside": "^2.0.2",
|
|
22
|
+
"core-js": "^3.6.5",
|
|
23
|
+
"lodash.debounce": "^4.0.8",
|
|
24
|
+
"tiny-emitter": "^2.1.0",
|
|
25
|
+
"vue": "^3.0.0"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@testing-library/vue": "^6.6.1",
|
|
29
|
+
"@vue/cli-plugin-babel": "~4.5.19",
|
|
30
|
+
"@vue/cli-plugin-eslint": "~4.5.19",
|
|
31
|
+
"@vue/cli-plugin-unit-jest": "~4.5.19",
|
|
32
|
+
"@vue/cli-plugin-vuex": "~4.5.19",
|
|
33
|
+
"@vue/cli-service": "~4.5.19",
|
|
34
|
+
"@vue/compiler-sfc": "^3.0.0",
|
|
35
|
+
"@vue/test-utils": "^2.0.0-0",
|
|
36
|
+
"babel-eslint": "^10.1.0",
|
|
37
|
+
"eslint": "^6.7.2",
|
|
38
|
+
"eslint-plugin-vue": "^7.0.0",
|
|
39
|
+
"sass": "^1.56.1",
|
|
40
|
+
"sass-loader": "^10.0.0",
|
|
41
|
+
"typescript": "~3.9.3",
|
|
42
|
+
"vue-jest": "^5.0.0-0"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
6
|
+
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
|
7
|
+
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
|
8
|
+
<title><%= htmlWebpackPlugin.options.title %></title>
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
<noscript>
|
|
12
|
+
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
|
13
|
+
</noscript>
|
|
14
|
+
<div id="app"></div>
|
|
15
|
+
<!-- built files will be auto injected -->
|
|
16
|
+
</body>
|
|
17
|
+
</html>
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
+
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
|
3
|
+
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
4
|
+
viewBox="0 0 490 490" style="enable-background:new 0 0 490 490;" xml:space="preserve">
|
|
5
|
+
<g>
|
|
6
|
+
<g>
|
|
7
|
+
<polygon points="0,332.668 245.004,82.631 490,332.668 413.507,407.369 245.004,235.402 76.493,407.369 "/>
|
|
8
|
+
</g>
|
|
9
|
+
<g>
|
|
10
|
+
</g>
|
|
11
|
+
<g>
|
|
12
|
+
</g>
|
|
13
|
+
<g>
|
|
14
|
+
</g>
|
|
15
|
+
<g>
|
|
16
|
+
</g>
|
|
17
|
+
<g>
|
|
18
|
+
</g>
|
|
19
|
+
<g>
|
|
20
|
+
</g>
|
|
21
|
+
<g>
|
|
22
|
+
</g>
|
|
23
|
+
<g>
|
|
24
|
+
</g>
|
|
25
|
+
<g>
|
|
26
|
+
</g>
|
|
27
|
+
<g>
|
|
28
|
+
</g>
|
|
29
|
+
<g>
|
|
30
|
+
</g>
|
|
31
|
+
<g>
|
|
32
|
+
</g>
|
|
33
|
+
<g>
|
|
34
|
+
</g>
|
|
35
|
+
<g>
|
|
36
|
+
</g>
|
|
37
|
+
<g>
|
|
38
|
+
</g>
|
|
39
|
+
</g>
|
|
40
|
+
<g>
|
|
41
|
+
</g>
|
|
42
|
+
<g>
|
|
43
|
+
</g>
|
|
44
|
+
<g>
|
|
45
|
+
</g>
|
|
46
|
+
<g>
|
|
47
|
+
</g>
|
|
48
|
+
<g>
|
|
49
|
+
</g>
|
|
50
|
+
<g>
|
|
51
|
+
</g>
|
|
52
|
+
<g>
|
|
53
|
+
</g>
|
|
54
|
+
<g>
|
|
55
|
+
</g>
|
|
56
|
+
<g>
|
|
57
|
+
</g>
|
|
58
|
+
<g>
|
|
59
|
+
</g>
|
|
60
|
+
<g>
|
|
61
|
+
</g>
|
|
62
|
+
<g>
|
|
63
|
+
</g>
|
|
64
|
+
<g>
|
|
65
|
+
</g>
|
|
66
|
+
<g>
|
|
67
|
+
</g>
|
|
68
|
+
<g>
|
|
69
|
+
</g>
|
|
70
|
+
</svg>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<?xml version="1.0" ?>
|
|
2
|
+
<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'>
|
|
3
|
+
<svg style="enable-background:new 0 0 35.999 36.005;" version="1.1" viewBox="0 0 35.505 36.005" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
4
|
+
<g id="Close">
|
|
5
|
+
<g id="Layer_10">
|
|
6
|
+
<g id="ClipView_7">
|
|
7
|
+
<path d="M0,0v36.005h35.999V0H0z" marker-end="none" marker-start="none" style="fill:none;"/>
|
|
8
|
+
<g>
|
|
9
|
+
<defs>
|
|
10
|
+
<rect height="36.005" id="SVGID_1_" width="35.999" y="0"/>
|
|
11
|
+
</defs>
|
|
12
|
+
<clipPath id="SVGID_2_">
|
|
13
|
+
<use style="overflow:visible;" xlink:href="#SVGID_1_"/>
|
|
14
|
+
</clipPath>
|
|
15
|
+
<g style="clip-path:url(#SVGID_2_);">
|
|
16
|
+
<g id="Group_18">
|
|
17
|
+
<path d="M2.995,4.799v26.403c0,0.995,0.805,1.8,1.799,1.8 h26.405c0.995,0,1.8-0.805,1.8-1.8V4.799c0-0.994-0.805-1.799-1.8-1.799H4.794C3.8,3,2.995,3.805,2.995,4.799z" marker-end="none" marker-start="none" style="fill:#990E0D;"/>
|
|
18
|
+
<linearGradient gradientTransform="matrix(1 0 0 1 167.998 491.77)" gradientUnits="userSpaceOnUse" id="SVGID_3_" x1="-150.3105" x2="-149.2125" y1="-461.7169" y2="-504.473">
|
|
19
|
+
<stop offset="0" style="stop-color:#DF1413"/>
|
|
20
|
+
<stop offset="1" style="stop-color:#990E0D"/></linearGradient>
|
|
21
|
+
<path d="M3.745,31.202V4.799 c0-0.579,0.469-1.049,1.049-1.049h26.405c0.581,0,1.05,0.47,1.05,1.049v26.403c0,0.581-0.47,1.05-1.05,1.05H4.794 C4.214,32.252,3.745,31.784,3.745,31.202z" marker-end="none" marker-start="none" style="fill:url(#SVGID_3_);"/>
|
|
22
|
+
</g>
|
|
23
|
+
<g id="Group_19"><path d="M9.961,8.892 l16.073,16.072" style="fill:none;stroke:#990E0D;stroke-width:4.287;stroke-linejoin:round;stroke-miterlimit:79.8403;"/>
|
|
24
|
+
<path d=" M26.034,8.892L9.961,24.964" style="fill:none;stroke:#990E0D;stroke-width:4.287;stroke-linejoin:round;stroke-miterlimit:79.8403;"/>
|
|
25
|
+
</g>
|
|
26
|
+
<g id="Group_20"><path d="M9.961,9.964 l16.073,16.073" style="fill:none;stroke:#FFFFFF;stroke-width:4.287;stroke-linejoin:round;stroke-miterlimit:79.8403;"/>
|
|
27
|
+
<path d=" M26.034,9.964L9.961,26.037" style="fill:none;stroke:#FFFFFF;stroke-width:4.287;stroke-linejoin:round;stroke-miterlimit:79.8403;"/>
|
|
28
|
+
</g>
|
|
29
|
+
</g>
|
|
30
|
+
</g>
|
|
31
|
+
</g>
|
|
32
|
+
</g>
|
|
33
|
+
</g>
|
|
34
|
+
<g id="Layer_1"/>
|
|
35
|
+
</svg>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<?xml version='1.0' encoding='iso-8859-1'?>
|
|
2
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 26 26" xmlns:xlink="http://www.w3.org/1999/xlink" enable-background="new 0 0 26 26">
|
|
3
|
+
<g>
|
|
4
|
+
<path d="m13,0c-7.2,0-13,5.8-13,13s5.8,13 13,13 13-5.8 13-13-5.8-13-13-13zm0,22c-5,0-9-4-9-9s4-9 9-9 9,4 9,9-4,9-9,9z"/>
|
|
5
|
+
<path d="M18.8,14.4l-5-6C13.6,8.2,13.3,8,13,8s-0.6,0.1-0.8,0.4l-5,6l-0.1,0.1C7,14.7,7,14.8,7,15c0,0.3,0.2,0.7,0.5,0.9l1.7,1 C9.3,17,9.5,17,9.7,17c0.3,0,0.5-0.1,0.7-0.3l1.8-2.1c0.4-0.5,1.1-0.5,1.5,0l1.8,2.1c0.2,0.2,0.4,0.3,0.7,0.3c0.2,0,0.4,0,0.5-0.1 l1.7-1c0.3-0.2,0.5-0.5,0.5-0.9c0-0.2,0-0.3-0.1-0.5C18.8,14.4,18.8,14.4,18.8,14.4z"/>
|
|
6
|
+
</g>
|
|
7
|
+
</svg>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
+
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
|
3
|
+
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
4
|
+
viewBox="0 0 490.037 490.037" style="enable-background:new 0 0 490.037 490.037;" xml:space="preserve">
|
|
5
|
+
<path d="M91.483,490.019l153.535-160.332l153.535,160.332l91.483-91.439l-69.81-72.906l69.81-69.775L245.019,0.019L0,255.898
|
|
6
|
+
l69.81,69.775L0,398.58L91.483,490.019z M42.905,255.434L245.019,44.346l202.114,211.089l-48.1,48.07L245.019,142.678
|
|
7
|
+
L91.004,303.504L42.905,255.434z M245.019,187.02l202.114,211.081l-48.1,48.085L245.019,285.345L91.004,446.186l-48.1-48.085
|
|
8
|
+
L245.019,187.02z"/>
|
|
9
|
+
<g>
|
|
10
|
+
</g>
|
|
11
|
+
<g>
|
|
12
|
+
</g>
|
|
13
|
+
<g>
|
|
14
|
+
</g>
|
|
15
|
+
<g>
|
|
16
|
+
</g>
|
|
17
|
+
<g>
|
|
18
|
+
</g>
|
|
19
|
+
<g>
|
|
20
|
+
</g>
|
|
21
|
+
<g>
|
|
22
|
+
</g>
|
|
23
|
+
<g>
|
|
24
|
+
</g>
|
|
25
|
+
<g>
|
|
26
|
+
</g>
|
|
27
|
+
<g>
|
|
28
|
+
</g>
|
|
29
|
+
<g>
|
|
30
|
+
</g>
|
|
31
|
+
<g>
|
|
32
|
+
</g>
|
|
33
|
+
<g>
|
|
34
|
+
</g>
|
|
35
|
+
<g>
|
|
36
|
+
</g>
|
|
37
|
+
<g>
|
|
38
|
+
</g>
|
|
39
|
+
</svg>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<?xml version='1.0' encoding='iso-8859-1'?>
|
|
2
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 137.145 137.145" xmlns:xlink="http://www.w3.org/1999/xlink" enable-background="new 0 0 137.145 137.145">
|
|
3
|
+
<g>
|
|
4
|
+
<g>
|
|
5
|
+
<path d="m37.711,89.198l30.861-28.835-10.287-9.612-30.861,28.835 10.287,9.612zm72.004-89.198h-82.286c-15.149,0-27.429,12.281-27.429,27.429v82.287c0,15.148 12.28,27.429 27.429,27.429h82.286c15.149,0 27.429-12.28 27.429-27.429v-82.287c0-15.148-12.28-27.429-27.429-27.429zm13.715,102.858c0,11.361-9.21,20.572-20.572,20.572h-68.572c-11.361,0-20.571-9.211-20.571-20.572v-68.572c0-11.361 9.21-20.572 20.571-20.572h68.572c11.361,0 20.572,9.211 20.572,20.572v68.572zm-65.145-52.107l41.148,38.447 10.287-9.612-41.148-38.446-10.287,9.611z"/>
|
|
6
|
+
</g>
|
|
7
|
+
</g>
|
|
8
|
+
</svg>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<?xml version="1.0" ?>
|
|
2
|
+
<svg id="Layer_1" style="enable-background:new 0 0 128 128;" version="1.1" viewBox="0 0 128 128" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
3
|
+
<g>
|
|
4
|
+
<path d="M96.1,103.6c-10.4,8.4-23.5,12.4-36.8,11.1c-10.5-1-20.3-5.1-28.2-11.8H44v-8H18v26h8v-11.9c9.1,7.7,20.4,12.5,32.6,13.6 c1.9,0.2,3.7,0.3,5.5,0.3c13.5,0,26.5-4.6,37-13.2c19.1-15.4,26.6-40.5,19.1-63.9l-7.6,2.4C119,68.6,112.6,90.3,96.1,103.6z"/><path d="M103,19.7c-21.2-18.7-53.5-20-76.1-1.6C7.9,33.5,0.4,58.4,7.7,81.7l7.6-2.4C9,59.2,15.5,37.6,31.9,24.4 C51.6,8.4,79.7,9.6,98,26H85v8h26V8h-8V19.7z"/>
|
|
5
|
+
</g>
|
|
6
|
+
</svg>
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
+
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
|
3
|
+
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
4
|
+
viewBox="0 0 491.858 491.858" style="enable-background:new 0 0 491.858 491.858;" xml:space="preserve">
|
|
5
|
+
<g>
|
|
6
|
+
<g>
|
|
7
|
+
<path d="M491.858,442.461c0,13.931-11.293,25.224-25.224,25.224L245.93,373.097L25.224,467.686
|
|
8
|
+
C11.292,467.686,0,456.392,0,442.461L227.011,32.58c0,0,18.918-18.918,37.834,0C283.764,51.499,491.858,442.461,491.858,442.461z"
|
|
9
|
+
/>
|
|
10
|
+
</g>
|
|
11
|
+
<g>
|
|
12
|
+
</g>
|
|
13
|
+
<g>
|
|
14
|
+
</g>
|
|
15
|
+
<g>
|
|
16
|
+
</g>
|
|
17
|
+
<g>
|
|
18
|
+
</g>
|
|
19
|
+
<g>
|
|
20
|
+
</g>
|
|
21
|
+
<g>
|
|
22
|
+
</g>
|
|
23
|
+
<g>
|
|
24
|
+
</g>
|
|
25
|
+
<g>
|
|
26
|
+
</g>
|
|
27
|
+
<g>
|
|
28
|
+
</g>
|
|
29
|
+
<g>
|
|
30
|
+
</g>
|
|
31
|
+
<g>
|
|
32
|
+
</g>
|
|
33
|
+
<g>
|
|
34
|
+
</g>
|
|
35
|
+
<g>
|
|
36
|
+
</g>
|
|
37
|
+
<g>
|
|
38
|
+
</g>
|
|
39
|
+
<g>
|
|
40
|
+
</g>
|
|
41
|
+
</g>
|
|
42
|
+
<g>
|
|
43
|
+
</g>
|
|
44
|
+
<g>
|
|
45
|
+
</g>
|
|
46
|
+
<g>
|
|
47
|
+
</g>
|
|
48
|
+
<g>
|
|
49
|
+
</g>
|
|
50
|
+
<g>
|
|
51
|
+
</g>
|
|
52
|
+
<g>
|
|
53
|
+
</g>
|
|
54
|
+
<g>
|
|
55
|
+
</g>
|
|
56
|
+
<g>
|
|
57
|
+
</g>
|
|
58
|
+
<g>
|
|
59
|
+
</g>
|
|
60
|
+
<g>
|
|
61
|
+
</g>
|
|
62
|
+
<g>
|
|
63
|
+
</g>
|
|
64
|
+
<g>
|
|
65
|
+
</g>
|
|
66
|
+
<g>
|
|
67
|
+
</g>
|
|
68
|
+
<g>
|
|
69
|
+
</g>
|
|
70
|
+
<g>
|
|
71
|
+
</g>
|
|
72
|
+
</svg>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
+
<!-- Generator: Adobe Illustrator 18.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
|
3
|
+
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
4
|
+
viewBox="0 0 16 16" style="enable-background:new 0 0 16 16;" xml:space="preserve">
|
|
5
|
+
<g>
|
|
6
|
+
<path style="fill:#030104;" d="M8,0C3.582,0,0,3.582,0,8s3.582,8,8,8s8-3.582,8-8S12.418,0,8,0z M4,11l4-7l4,7H4z"/>
|
|
7
|
+
</g>
|
|
8
|
+
<g>
|
|
9
|
+
</g>
|
|
10
|
+
<g>
|
|
11
|
+
</g>
|
|
12
|
+
<g>
|
|
13
|
+
</g>
|
|
14
|
+
<g>
|
|
15
|
+
</g>
|
|
16
|
+
<g>
|
|
17
|
+
</g>
|
|
18
|
+
<g>
|
|
19
|
+
</g>
|
|
20
|
+
<g>
|
|
21
|
+
</g>
|
|
22
|
+
<g>
|
|
23
|
+
</g>
|
|
24
|
+
<g>
|
|
25
|
+
</g>
|
|
26
|
+
<g>
|
|
27
|
+
</g>
|
|
28
|
+
<g>
|
|
29
|
+
</g>
|
|
30
|
+
<g>
|
|
31
|
+
</g>
|
|
32
|
+
<g>
|
|
33
|
+
</g>
|
|
34
|
+
<g>
|
|
35
|
+
</g>
|
|
36
|
+
<g>
|
|
37
|
+
</g>
|
|
38
|
+
</svg>
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
+
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
|
3
|
+
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
4
|
+
viewBox="0 0 490 490" style="enable-background:new 0 0 490 490;" xml:space="preserve">
|
|
5
|
+
<g>
|
|
6
|
+
<g>
|
|
7
|
+
<g>
|
|
8
|
+
<polygon points="0,249.888 245.004,8.139 490,249.888 490,481.861 245.004,239.71 0,481.861 "/>
|
|
9
|
+
</g>
|
|
10
|
+
</g>
|
|
11
|
+
<g>
|
|
12
|
+
</g>
|
|
13
|
+
<g>
|
|
14
|
+
</g>
|
|
15
|
+
<g>
|
|
16
|
+
</g>
|
|
17
|
+
<g>
|
|
18
|
+
</g>
|
|
19
|
+
<g>
|
|
20
|
+
</g>
|
|
21
|
+
<g>
|
|
22
|
+
</g>
|
|
23
|
+
<g>
|
|
24
|
+
</g>
|
|
25
|
+
<g>
|
|
26
|
+
</g>
|
|
27
|
+
<g>
|
|
28
|
+
</g>
|
|
29
|
+
<g>
|
|
30
|
+
</g>
|
|
31
|
+
<g>
|
|
32
|
+
</g>
|
|
33
|
+
<g>
|
|
34
|
+
</g>
|
|
35
|
+
<g>
|
|
36
|
+
</g>
|
|
37
|
+
<g>
|
|
38
|
+
</g>
|
|
39
|
+
<g>
|
|
40
|
+
</g>
|
|
41
|
+
</g>
|
|
42
|
+
<g>
|
|
43
|
+
</g>
|
|
44
|
+
<g>
|
|
45
|
+
</g>
|
|
46
|
+
<g>
|
|
47
|
+
</g>
|
|
48
|
+
<g>
|
|
49
|
+
</g>
|
|
50
|
+
<g>
|
|
51
|
+
</g>
|
|
52
|
+
<g>
|
|
53
|
+
</g>
|
|
54
|
+
<g>
|
|
55
|
+
</g>
|
|
56
|
+
<g>
|
|
57
|
+
</g>
|
|
58
|
+
<g>
|
|
59
|
+
</g>
|
|
60
|
+
<g>
|
|
61
|
+
</g>
|
|
62
|
+
<g>
|
|
63
|
+
</g>
|
|
64
|
+
<g>
|
|
65
|
+
</g>
|
|
66
|
+
<g>
|
|
67
|
+
</g>
|
|
68
|
+
<g>
|
|
69
|
+
</g>
|
|
70
|
+
<g>
|
|
71
|
+
</g>
|
|
72
|
+
</svg>
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
aria-label="Clear options list"
|
|
4
|
+
id="extended__multiselect-cancel"
|
|
5
|
+
role="button"
|
|
6
|
+
:class="classes"
|
|
7
|
+
:tabindex="increasedTabindex"
|
|
8
|
+
@click.stop="cancel"
|
|
9
|
+
@keypress.stop="cancel"
|
|
10
|
+
>
|
|
11
|
+
<img
|
|
12
|
+
alt=""
|
|
13
|
+
v-if="!loading"
|
|
14
|
+
:class="iconSizeClass"
|
|
15
|
+
:src="require('../assets/cancel.svg')"
|
|
16
|
+
/>
|
|
17
|
+
<extended-multiselect-loader
|
|
18
|
+
v-else
|
|
19
|
+
:icon-filter="iconFilter"
|
|
20
|
+
:icon-size="iconSize"
|
|
21
|
+
/>
|
|
22
|
+
</div>
|
|
23
|
+
</template>
|
|
24
|
+
|
|
25
|
+
<script setup>
|
|
26
|
+
import {
|
|
27
|
+
computed,
|
|
28
|
+
defineProps,
|
|
29
|
+
toRefs,
|
|
30
|
+
} from "vue";
|
|
31
|
+
|
|
32
|
+
import useCancel from "../composition/cancel";
|
|
33
|
+
import useSizes from "../composition/sizes";
|
|
34
|
+
|
|
35
|
+
import ExtendedMultiselectLoader from "./ExtendedMultiselectLoader.vue";
|
|
36
|
+
|
|
37
|
+
const props = defineProps({
|
|
38
|
+
/**
|
|
39
|
+
* Blocks cancel button
|
|
40
|
+
* @property {boolean} disabled
|
|
41
|
+
*/
|
|
42
|
+
disabled: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
required: true,
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Defines a svg-filter for icons
|
|
49
|
+
* @property {string} iconFilter
|
|
50
|
+
*/
|
|
51
|
+
iconFilter: {
|
|
52
|
+
type: String,
|
|
53
|
+
required: true,
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Provides size to create special size-class
|
|
58
|
+
* for each kind of icon
|
|
59
|
+
* @property {string} iconSize
|
|
60
|
+
*/
|
|
61
|
+
iconSize: {
|
|
62
|
+
type: String,
|
|
63
|
+
required: true,
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Replaces cancel button with loader
|
|
68
|
+
* @property {boolean} loading
|
|
69
|
+
*/
|
|
70
|
+
loading: {
|
|
71
|
+
type: Boolean,
|
|
72
|
+
required: true,
|
|
73
|
+
},
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Determines whether to clear current value of search field
|
|
77
|
+
* @property {boolean} showSearchField
|
|
78
|
+
*/
|
|
79
|
+
showSearchField: {
|
|
80
|
+
type: Boolean,
|
|
81
|
+
required: true,
|
|
82
|
+
},
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Defines "tabindex" attribute of cancel button
|
|
86
|
+
* @default null
|
|
87
|
+
* @property {number|null} tabindex
|
|
88
|
+
*/
|
|
89
|
+
tabindex: {
|
|
90
|
+
type: Number,
|
|
91
|
+
default: null,
|
|
92
|
+
},
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* List of selected options
|
|
96
|
+
* @property {Array} selectedOptions
|
|
97
|
+
*/
|
|
98
|
+
selectedOptions: {
|
|
99
|
+
type: Array,
|
|
100
|
+
required: true,
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
const {
|
|
105
|
+
disabled,
|
|
106
|
+
iconFilter,
|
|
107
|
+
iconSize,
|
|
108
|
+
loading,
|
|
109
|
+
selectedOptions,
|
|
110
|
+
showSearchField,
|
|
111
|
+
tabindex,
|
|
112
|
+
} = toRefs(props);
|
|
113
|
+
|
|
114
|
+
const { cancel } = useCancel(
|
|
115
|
+
disabled,
|
|
116
|
+
showSearchField,
|
|
117
|
+
selectedOptions,
|
|
118
|
+
);
|
|
119
|
+
const { iconSizeClass } = useSizes(iconSize);
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Toggles classes of component if "loading"
|
|
123
|
+
* or "disabled" props equals true
|
|
124
|
+
* @function
|
|
125
|
+
* @returns {string} class
|
|
126
|
+
*/
|
|
127
|
+
const classes = computed(() => {
|
|
128
|
+
return (loading.value || disabled.value)
|
|
129
|
+
? "extended__multiselect-cancel--disabled"
|
|
130
|
+
: "extended__multiselect-cancel";
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Sets "tabindex" attibute of clear button based on
|
|
135
|
+
* given tabindex
|
|
136
|
+
* @function
|
|
137
|
+
* @returns {number} tabindex
|
|
138
|
+
*/
|
|
139
|
+
const increasedTabindex = computed(() => {
|
|
140
|
+
return tabindex.value ? tabindex.value + 2 : 0;
|
|
141
|
+
});
|
|
142
|
+
</script>
|