toggle-components-library 1.33.0-beta.13 → 1.33.0-beta.14
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/dist/toggle-components-library.common.js +38836 -12845
- package/dist/toggle-components-library.common.js.map +1 -1
- package/dist/toggle-components-library.css +1 -1
- package/dist/toggle-components-library.umd.js +38836 -12845
- package/dist/toggle-components-library.umd.js.map +1 -1
- package/dist/toggle-components-library.umd.min.js +285 -8
- package/dist/toggle-components-library.umd.min.js.map +1 -1
- package/package-lock.json +20279 -0
- package/package.json +2 -1
- package/src/assets/img/feedback.svg +1 -0
- package/src/components/boosters/ToggleBoosterButton.vue +27 -11
- package/src/components/buttons/ToggleButton.vue +39 -9
- package/src/components/forms/ToggleDatePicker.vue +229 -138
- package/src/components/forms/ToggleInputSelect.vue +7 -13
- package/src/components/forms/ToggleInputText.vue +6 -15
- package/src/components/tables/ToggleTable.vue +49 -114
- package/src/components/tables/ToggleTableRow.vue +20 -2
- package/src/index.js +1 -3
- package/src/sass/includes/_as_boosters.scss +55 -4
- package/src/sass/includes/_as_buttons.scss +80 -0
- package/src/sass/includes/_as_inputs.scss +832 -832
- package/src/sass/includes/_as_table.scss +180 -178
- package/src/sass/includes/_as_variables.scss +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "toggle-components-library",
|
|
3
|
-
"version": "1.33.0-beta.
|
|
3
|
+
"version": "1.33.0-beta.14",
|
|
4
4
|
"private": false,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"serve": "vue-cli-service serve",
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"vue-moment": "^4.1.0",
|
|
39
39
|
"vue-multiselect": "^2.0.8",
|
|
40
40
|
"vue-router": "^3.6.4",
|
|
41
|
+
"vue2-datepicker": "^3.11.1",
|
|
41
42
|
"vue2-dropzone": "^3.6.0",
|
|
42
43
|
"vuedraggable": "^2.24.3",
|
|
43
44
|
"webfontloader": "^1.6.28"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?><svg id="Layer_2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 759.32 112.34"><defs><style>.cls-1{fill:#fff;}.cls-1,.cls-2{stroke-width:0px;}.cls-2{fill:#fe6c66;}</style></defs><g id="Layer_1-2"><path class="cls-1" d="M107.9,4.19c11.4,0,22.9.9,34.16,2.66,22.93,3.6,45.06,10.78,65.75,21.32,2.34,1.19,3.8,3.57,3.8,6.2v43.59c0,2.63-1.46,5.01-3.8,6.2-20.7,10.55-42.83,17.72-65.76,21.32-11.26,1.77-22.75,2.66-34.15,2.66s-22.89-.9-34.16-2.66c-22.93-3.6-45.05-10.77-65.76-21.32-2.35-1.19-3.8-3.57-3.8-6.2v-43.59c0-2.63,1.46-5.01,3.8-6.2C28.69,17.62,50.82,10.45,73.74,6.85c11.26-1.77,22.75-2.66,34.16-2.66M107.9,0c-11.62,0-23.33.91-34.81,2.71C49.73,6.38,27.19,13.69,6.09,24.44h0c-3.74,1.9-6.09,5.74-6.09,9.94v43.59c0,4.19,2.35,8.03,6.09,9.94h0c21.1,10.75,43.65,18.06,67.01,21.73,11.48,1.8,23.19,2.72,34.81,2.72s23.33-.91,34.8-2.72c23.37-3.67,45.91-10.98,67.01-21.73h0c3.74-1.9,6.09-5.74,6.09-9.93v-43.59c0-4.19-2.35-8.03-6.09-9.93h0c-21.09-10.75-43.64-18.06-67.01-21.73-11.48-1.8-23.19-2.71-34.81-2.71h0Z"/><path class="cls-1" d="M213.58,2.75v3.63h-.75v-3.63h-1.23v-.68h3.2v.68h-1.23ZM219.05,6.38v-3.53l-1.17,3.42h-.54l-1.17-3.41v3.52h-.75V2.06h1.18l1.03,3.11,1.03-3.11h1.15v4.32h-.75Z"/><path class="cls-1" d="M108.07,41.14c-3.08,0-5.58,2.5-5.58,5.58v2.2c0,1.41.03,1.5.9,3.07l6.23,10.99s.04.06.04.04c.01.07,0,.16,0,.33v2.16c0,.9-.72,1.64-1.6,1.64s-1.59-.74-1.59-1.64v-1.47c0-.7-.6-1.3-1.3-1.3h-1.38c-.7,0-1.3.6-1.3,1.3v1.47c0,3.08,2.5,5.58,5.58,5.58s5.58-2.5,5.58-5.58v-2.16c0-1.36-.03-1.47-.9-3.02l-6.23-10.99s-.03-.06-.04-.05c-.01-.07,0-.17,0-.38v-2.2c0-.88.72-1.6,1.59-1.6s1.6.72,1.6,1.6v1.47c0,.73.57,1.3,1.3,1.3h1.38c.73,0,1.3-.57,1.3-1.3v-1.47c0-3.08-2.5-5.58-5.58-5.58Z"/><path class="cls-1" d="M34.07,31.78c-.3-.05-.6-.07-.89-.07-3.63,0-6.37,3.42-6.37,7.95v39.49c0,.37.12.72.34.97.22.26.53.41.85.41.05,0,.1,0,.15-.01l1.9-.29c.7-.11,1.24-.81,1.24-1.64v-20.29s5.43-.08,5.43-.08v19.47c0,.36.11.68.31.92.25.3.62.44,1.02.38l1.9-.29c.7-.11,1.24-.78,1.24-1.56v-36.13c0-4.5-3.19-8.64-7.1-9.24ZM36.7,40.64v12.45l-5.43-.08v-12.98c0-1.86,1.2-3.23,2.7-3.05,1.5.19,2.73,1.83,2.73,3.65Z"/><path class="cls-1" d="M59.41,36.25l-1.9-.29c-.73-.11-1.34.44-1.34,1.21v37.96c0,.66.49,1.16,1.14,1.16.07,0,.13,0,.2-.02l1.9-.29c.7-.11,1.23-.72,1.23-1.41v-36.91c0-.66-.57-1.31-1.23-1.41Z"/><path class="cls-1" d="M82.56,39.89l-4.92-.75c-.68-.1-1.29.07-1.73.44-.36.32-.56.75-.56,1.22v31.3c0,.29.12.56.33.75.2.17.48.27.78.27.07,0,.15,0,.23-.02l1.9-.29c.6-.09,1.24-.62,1.24-1.26v-13.63l2.66-.04v-.34s.08.34.08.34c.72,0,1.39.22,1.89.61.48.38.74.88.74,1.41v10.76c0,.62.58,1.05,1.34.93l1.9-.29c.7-.11,1.23-.62,1.23-1.19v-10.36c0-1.41-.66-2.72-1.86-3.73,1.22-1.02,1.86-2.28,1.86-3.69v-5.91c0-3-3.19-5.93-7.1-6.53ZM85.2,46.05v6.14c0,.51-.26,1-.74,1.37-.5.39-1.17.6-1.94.6h0l-2.69-.04v-10.84l2.64.33c1.5.19,2.73,1.28,2.73,2.44Z"/><path class="cls-1" d="M138.67,38.47l-1.84.22c-.68.08-1.25.66-1.25,1.27v14.22l-5.43.06v-13.57c0-.61-.61-1.09-1.33-1l-1.9.23c-.68.08-1.25.64-1.25,1.26v29.97c0,.6.54,1.12,1.25,1.21l1.9.23c.74.1,1.33-.37,1.33-1v-13.52l5.43.06v14.16c0,.64.54,1.18,1.25,1.27l1.84.22c.06,0,.12.01.18.01.65,0,1.15-.46,1.15-1.07v-33.18c0-.64-.61-1.15-1.33-1.06Z"/><path class="cls-1" d="M158.15,35.96l-1.9.23c-.68.08-1.25.72-1.25,1.45v37.02c0,.69.55,1.3,1.24,1.39l1.9.23c.06,0,.11,0,.16,0,.66,0,1.17-.51,1.17-1.19v-37.96c0-.7-.6-1.26-1.33-1.18Z"/><path class="cls-1" d="M189.33,40.98c0-4.66-3.24-8.23-7.19-7.76l-5.87.72c-.74.09-1.25.85-1.25,1.58v41.79c0,.76.55,1.42,1.25,1.51l1.9.23s.09,0,.13,0c.64,0,1.14-.58,1.14-1.32v-18.89l2.81.03c3.91,0,7.09-3.79,7.09-8.44v-9.46ZM184.86,50.56c0,1.78-1.21,3.24-2.69,3.25l-2.74.03v-15.28l2.78-.27c1.47-.15,2.65,1.19,2.65,2.99v9.27Z"/><rect class="cls-2" x="216.68" y="55.44" width="74.29" height="2" transform="translate(162.02 299.72) rotate(-81.86)"/><path class="cls-1" d="M283.07,93.94l10.09-72.29h48.23l-1.55,11.64h-35.13l-2.72,19.99h30.66l-1.65,11.74h-30.66l-4.08,28.92h-13.2Z"/><path class="cls-1" d="M367.16,95.11c-5.18,0-9.7-1.13-13.58-3.4-3.88-2.26-6.88-5.35-8.98-9.27-2.1-3.91-3.15-8.29-3.15-13.15,0-4.01.71-7.78,2.13-11.3,1.42-3.52,3.4-6.65,5.92-9.36,2.52-2.72,5.48-4.84,8.88-6.36,3.4-1.52,7.07-2.28,11.01-2.28,5.24,0,9.67,1.07,13.29,3.2,3.62,2.13,6.37,5,8.25,8.59,1.88,3.59,2.81,7.62,2.81,12.08,0,1.16-.1,2.36-.29,3.59-.19,1.23-.45,2.49-.78,3.79h-40.75l.68-9.8h33.48l-6.4,4.37c.91-2.85,1.02-5.43.34-7.76-.68-2.33-1.96-4.17-3.83-5.53-1.88-1.36-4.17-2.04-6.89-2.04-3.49,0-6.32.89-8.49,2.67-2.17,1.78-3.75,4.16-4.75,7.13-1,2.98-1.5,6.31-1.5,9.99,0,2.85.53,5.3,1.6,7.38,1.07,2.07,2.57,3.64,4.51,4.71,1.94,1.07,4.21,1.6,6.79,1.6,2.91,0,5.47-.64,7.67-1.94,2.2-1.29,3.95-2.94,5.24-4.95l10.09,5.34c-1.23,2.52-2.99,4.74-5.29,6.65-2.3,1.91-4.98,3.4-8.05,4.46-3.07,1.07-6.39,1.6-9.95,1.6Z"/><path class="cls-1" d="M426.65,95.11c-5.18,0-9.7-1.13-13.58-3.4-3.88-2.26-6.88-5.35-8.98-9.27-2.1-3.91-3.15-8.29-3.15-13.15,0-4.01.71-7.78,2.13-11.3,1.42-3.52,3.4-6.65,5.92-9.36,2.52-2.72,5.48-4.84,8.88-6.36,3.4-1.52,7.07-2.28,11.01-2.28,5.24,0,9.67,1.07,13.29,3.2,3.62,2.13,6.37,5,8.25,8.59,1.88,3.59,2.81,7.62,2.81,12.08,0,1.16-.1,2.36-.29,3.59-.19,1.23-.45,2.49-.78,3.79h-40.75l.68-9.8h33.48l-6.4,4.37c.91-2.85,1.02-5.43.34-7.76-.68-2.33-1.96-4.17-3.83-5.53-1.88-1.36-4.17-2.04-6.89-2.04-3.49,0-6.32.89-8.49,2.67-2.17,1.78-3.75,4.16-4.75,7.13-1,2.98-1.5,6.31-1.5,9.99,0,2.85.53,5.3,1.6,7.38,1.07,2.07,2.57,3.64,4.51,4.71,1.94,1.07,4.21,1.6,6.79,1.6,2.91,0,5.47-.64,7.67-1.94,2.2-1.29,3.95-2.94,5.24-4.95l10.09,5.34c-1.23,2.52-2.99,4.74-5.29,6.65-2.3,1.91-4.98,3.4-8.05,4.46-3.07,1.07-6.39,1.6-9.95,1.6Z"/><path class="cls-1" d="M485.45,95.11c-4.98,0-9.35-1.07-13.1-3.2-3.75-2.13-6.7-5.09-8.83-8.88-2.13-3.78-3.2-8.13-3.2-13.05,0-4.46.78-8.52,2.33-12.18,1.55-3.65,3.65-6.81,6.31-9.46,2.65-2.65,5.76-4.71,9.32-6.16,3.56-1.46,7.31-2.18,11.26-2.18s7.78.83,10.92,2.47c3.14,1.65,5.58,3.9,7.33,6.74l-2.72,2.43,4.27-31.15h12.91l-10.19,73.46h-12.13l1.36-10.19,2.81,1.94c-1.94,3.17-4.58,5.53-7.91,7.08-3.33,1.55-6.91,2.33-10.72,2.33ZM487.19,83.46c3.17,0,5.95-.79,8.34-2.38,2.39-1.58,4.29-3.72,5.68-6.4,1.39-2.68,2.09-5.64,2.09-8.88,0-2.72-.57-5.14-1.7-7.28-1.13-2.13-2.69-3.8-4.66-5-1.97-1.2-4.29-1.79-6.94-1.79-3.17,0-5.98.78-8.44,2.33-2.46,1.55-4.38,3.66-5.77,6.31-1.39,2.65-2.09,5.63-2.09,8.93,0,2.78.57,5.22,1.7,7.33,1.13,2.1,2.72,3.77,4.75,5,2.04,1.23,4.38,1.84,7.04,1.84Z"/><path class="cls-1" d="M554.44,95.11c-4.14,0-7.88-.78-11.21-2.33-3.33-1.55-5.87-3.79-7.62-6.7l1.65-2.33-1.36,10.19h-12.13l10.29-73.46h12.81l-4.27,31.15-3.49-2.81c2.07-2.85,4.71-5.03,7.91-6.55s6.74-2.28,10.63-2.28c4.92,0,9.25,1.15,13,3.45,3.75,2.3,6.71,5.38,8.88,9.27,2.17,3.88,3.25,8.25,3.25,13.1,0,4.01-.73,7.8-2.18,11.35-1.46,3.56-3.48,6.68-6.07,9.36-2.59,2.69-5.6,4.79-9.02,6.31-3.43,1.52-7.12,2.28-11.06,2.28ZM553.18,83.46c3.17,0,5.98-.79,8.44-2.38,2.46-1.58,4.38-3.7,5.77-6.36,1.39-2.65,2.09-5.6,2.09-8.83,0-2.78-.57-5.24-1.7-7.38s-2.72-3.8-4.75-5c-2.04-1.2-4.42-1.79-7.13-1.79-3.11,0-5.87.79-8.3,2.38-2.43,1.59-4.32,3.71-5.68,6.36-1.36,2.65-2.04,5.56-2.04,8.73,0,2.78.57,5.26,1.7,7.42,1.13,2.17,2.7,3.85,4.71,5.05,2,1.2,4.3,1.79,6.89,1.79Z"/><path class="cls-1" d="M606.16,95.11c-3.43,0-6.45-.55-9.07-1.65-2.62-1.1-4.67-2.72-6.16-4.85-1.49-2.13-2.23-4.75-2.23-7.86,0-3.36.86-6.24,2.57-8.64,1.71-2.39,4.06-4.35,7.04-5.87,2.97-1.52,6.4-2.57,10.29-3.15l17.76-2.81-.97,9.7-14.94,2.62c-2.39.45-4.4,1.28-6.02,2.47-1.62,1.2-2.43,2.83-2.43,4.9,0,1.81.66,3.17,1.99,4.08,1.33.91,3.02,1.36,5.09,1.36,2.59,0,4.92-.6,6.99-1.79,2.07-1.2,3.78-2.8,5.14-4.8,1.36-2,2.17-4.2,2.43-6.6l1.84-13.2c.19-1.75-.1-3.22-.87-4.41s-1.88-2.12-3.3-2.77c-1.42-.65-3.01-.97-4.75-.97-2.91,0-5.5.78-7.76,2.33-2.26,1.55-4.01,3.53-5.24,5.92l-9.99-5.53c1.29-2.78,3.14-5.18,5.53-7.18,2.39-2,5.16-3.57,8.3-4.71,3.14-1.13,6.45-1.7,9.95-1.7,4.33,0,8.17.84,11.5,2.52,3.33,1.68,5.87,3.98,7.62,6.89,1.75,2.91,2.33,6.31,1.75,10.19l-4.75,34.35h-12.13l1.26-9.03,3.2.1c-1.62,2.27-3.43,4.16-5.43,5.68-2.01,1.52-4.19,2.64-6.55,3.35-2.36.71-4.9,1.07-7.62,1.07Z"/><path class="cls-1" d="M672.82,95.11c-4.98,0-9.45-1.13-13.39-3.4-3.95-2.26-7.04-5.35-9.27-9.27-2.23-3.91-3.35-8.33-3.35-13.24,0-4.08.76-7.89,2.28-11.45,1.52-3.56,3.61-6.66,6.26-9.31,2.65-2.65,5.74-4.72,9.27-6.21,3.52-1.49,7.33-2.23,11.4-2.23s7.41.66,10.58,1.99c3.17,1.33,5.87,3.17,8.1,5.53,2.23,2.36,3.77,5.13,4.61,8.3l-11.35,4.56c-.84-2.72-2.33-4.84-4.46-6.36-2.13-1.52-4.66-2.28-7.57-2.28-3.11,0-5.86.81-8.25,2.43-2.39,1.62-4.24,3.75-5.53,6.4-1.29,2.65-1.94,5.53-1.94,8.64,0,2.78.53,5.24,1.6,7.38s2.59,3.82,4.56,5.04c1.97,1.23,4.22,1.84,6.74,1.84,3.17,0,5.95-.82,8.34-2.47,2.39-1.65,4.17-3.83,5.34-6.55l10.87,5.34c-1.23,2.98-3.07,5.63-5.53,7.96-2.46,2.33-5.34,4.14-8.64,5.43-3.3,1.29-6.86,1.94-10.67,1.94Z"/><path class="cls-1" d="M703.33,93.94l10.29-73.46h12.91l-6.79,48.13-5.92-1.46,28.43-26.01h17.08l-22.51,21.25,15.53,31.54h-13.88l-13.29-27.37,6.99-1.55-18.34,17.18,5.14-7.86-2.72,19.6h-12.91Z"/></g></svg>
|
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
<div :class="[{'toggle-booster-button-tooltip-container': !!tooltipText }]">
|
|
3
|
+
<button :class="['toggle-booster-button-container', boosterType, {'toggle-booster-button-disabled': disabled}]" :disabled="disabled" @click="click">
|
|
4
|
+
|
|
5
|
+
<img
|
|
6
|
+
:src="logo.src"
|
|
7
|
+
:alt="logo.alt"
|
|
8
|
+
class="toggle-booster-button-logo"
|
|
9
|
+
>
|
|
10
|
+
|
|
11
|
+
<div :class="['toggle-booster-button', boosterType]" >
|
|
12
|
+
<p class="plus">+</p>
|
|
13
|
+
<div v-if="buttonText" class="toggle-booster-button-button-text">
|
|
14
|
+
<slot>{{buttonText}}</slot>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
</button>
|
|
9
18
|
|
|
10
|
-
<div
|
|
11
|
-
<
|
|
12
|
-
<slot>{{buttonText}}</slot>
|
|
19
|
+
<div class="toggle-booster-button-tooltip-text" v-if="tooltipText">
|
|
20
|
+
<div >{{ tooltipText }}</div>
|
|
13
21
|
</div>
|
|
14
|
-
</
|
|
22
|
+
</div>
|
|
15
23
|
</template>
|
|
16
24
|
|
|
17
25
|
<script>
|
|
@@ -34,6 +42,14 @@
|
|
|
34
42
|
type: Object,
|
|
35
43
|
required: true,
|
|
36
44
|
},
|
|
45
|
+
disabled: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: false,
|
|
48
|
+
},
|
|
49
|
+
tooltipText: {
|
|
50
|
+
type: String,
|
|
51
|
+
required: false
|
|
52
|
+
}
|
|
37
53
|
},
|
|
38
54
|
methods: {
|
|
39
55
|
click() {
|
|
@@ -1,22 +1,29 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div :class="[ 'toggle-button-container', {'toggle-button-container-mini':isMini}]">
|
|
2
|
+
<div :class="[ 'toggle-button-container', {'toggle-button-container-mini':isMini, 'toggle-button-tooltip-container': !!tooltipText }]">
|
|
3
3
|
<button
|
|
4
4
|
v-if="!$slots.default"
|
|
5
5
|
:type="type"
|
|
6
|
-
:class="[ 'toggle-button', buttonStyle, {'toggle-button-loading':loading, 'toggle-button-subscribed': !subscribed}]"
|
|
6
|
+
:class="[ 'toggle-button', buttonStyle, {'toggle-button-loading':loading, 'toggle-button-subscribed': !subscribed, 'toggle-button-booster-badge': boosterImageProperties}]"
|
|
7
7
|
:disabled="(loading || disabled)"
|
|
8
8
|
@click="click"
|
|
9
9
|
>
|
|
10
10
|
<div class="toggle-button-loader" v-if="loading" ></div>
|
|
11
11
|
<span v-html="buttonText" v-if="!isMini"/>
|
|
12
|
+
|
|
13
|
+
<div v-if="boosterImageProperties" :class="['toggle-button-booster-image-badge', {'shimmer': boosterShimmer && !disabled, 'toggle-button-loading': loading, 'toggle-button-disabled': disabled}]" :style="'background-color: ' + boosterImageProperties.bgColor">
|
|
14
|
+
<img class="toggle-button-booster-image" :src="boosterImageProperties.src" :alt="boosterImageProperties.alt">
|
|
15
|
+
</div>
|
|
12
16
|
</button>
|
|
13
17
|
<div v-else :class="[ 'toggle-button-a', buttonStyle, {'toggle-button-a-loading':loading, 'disabled':disabled, 'toggle-button-subscribed': !subscribed}]">
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
<div class="toggle-button-loader" v-if="loading" ></div>
|
|
19
|
+
<div class="toggle-button-a-border" />
|
|
20
|
+
<!--
|
|
21
|
+
@slot String of button text
|
|
22
|
+
-->
|
|
23
|
+
<slot>{{buttonText}}</slot>
|
|
24
|
+
</div>
|
|
25
|
+
<div class="toggle-button-tooltip-text" v-if="tooltipText">
|
|
26
|
+
<div >{{ tooltipText }}</div>
|
|
20
27
|
</div>
|
|
21
28
|
</div>
|
|
22
29
|
</template>
|
|
@@ -67,10 +74,33 @@ export default {
|
|
|
67
74
|
type:String,
|
|
68
75
|
default:'confirm'
|
|
69
76
|
},
|
|
70
|
-
/*
|
|
77
|
+
/*
|
|
78
|
+
* Grey out button if booster not enabled
|
|
79
|
+
*/
|
|
71
80
|
subscribed: {
|
|
72
81
|
type: Boolean,
|
|
73
82
|
default: true
|
|
83
|
+
},
|
|
84
|
+
/*
|
|
85
|
+
* Booster badge image properties, image, alt text, background colour
|
|
86
|
+
*/
|
|
87
|
+
boosterImageProperties: {
|
|
88
|
+
type: Object,
|
|
89
|
+
required: false,
|
|
90
|
+
},
|
|
91
|
+
/*
|
|
92
|
+
* Turns the shimmer animation on and off for the booster badge
|
|
93
|
+
*/
|
|
94
|
+
boosterShimmer: {
|
|
95
|
+
type: Boolean,
|
|
96
|
+
default: true
|
|
97
|
+
},
|
|
98
|
+
/*
|
|
99
|
+
* Text displayed in tooltip
|
|
100
|
+
*/
|
|
101
|
+
tooltipText: {
|
|
102
|
+
type: String,
|
|
103
|
+
required: false
|
|
74
104
|
}
|
|
75
105
|
},
|
|
76
106
|
computed: {
|
|
@@ -1,167 +1,258 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
|
|
3
|
-
<div class="toggle-date-container" :class="['datepicker-trigger',{'toggle-input-is-invalid':isInvalid }]">
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
<label class="toggle-input-label">{{label}}</label>
|
|
7
|
-
|
|
8
|
-
<div class="toggle-date-input-container">
|
|
9
|
-
<div class="toggle-date-input-calendar-icon">
|
|
10
|
-
<input type="text" class="toggle-input" :name="name" ref="date-input" :id="'toggle-date-input'+_uid" :value="date" v-on:keypress="$event.preventDefault()">
|
|
11
|
-
</div>
|
|
12
|
-
<button type="button" class="toggle-clear" v-on:click="clearDate" v-if="displayValue"></button>
|
|
13
|
-
</div>
|
|
14
|
-
|
|
15
|
-
<AirbnbStyleDatepicker
|
|
16
|
-
:trigger-element-id="'toggle-date-input'+_uid"
|
|
17
|
-
:trigger="datePickerOpen"
|
|
18
|
-
:mode="'single'"
|
|
19
|
-
:date-one="displayValue"
|
|
20
|
-
@date-one-selected="val => { displayValue = val}"
|
|
21
|
-
@closed="toggleDatePickerState(false)"
|
|
22
|
-
@cancelled="toggleDatePickerState(false)"
|
|
23
|
-
:monthsToShow="1"
|
|
24
|
-
:showShortcutsMenuTrigger="false"
|
|
25
|
-
/>
|
|
26
|
-
<label
|
|
27
|
-
class="toggle-input-label-error"
|
|
28
|
-
v-if="isInvalid"
|
|
29
|
-
:for="name ? name : 'ToggleInputText' "
|
|
30
|
-
>
|
|
31
|
-
{{ errorMessage }}
|
|
32
|
-
</label>
|
|
3
|
+
<div class="toggle-date-container" :class="[{'visible': show}, 'datepicker-trigger',{'toggle-input-is-invalid':isInvalid }, { 'toggle-input-is-disabled': disabled }]">
|
|
33
4
|
|
|
5
|
+
<label class="toggle-input-label">{{label}}</label>
|
|
6
|
+
|
|
7
|
+
<div :class="['toggle-date-input-container', 'toggle-date-input-container-' + size, {'toggle-date-input-disabled': disabled} ]">
|
|
8
|
+
<date-picker v-model="inputVal" prefix-class="toggle-mxdatepicker" :formatter="momentFormat" :range="range" :type="type" :disabled="disabled">
|
|
9
|
+
</date-picker>
|
|
34
10
|
</div>
|
|
11
|
+
|
|
12
|
+
<label
|
|
13
|
+
class="toggle-input-label-error"
|
|
14
|
+
v-if="isInvalid"
|
|
15
|
+
:for="name ? name : 'ToggleInputText' "
|
|
16
|
+
>
|
|
17
|
+
{{ errorMessage }}
|
|
18
|
+
</label>
|
|
19
|
+
|
|
20
|
+
</div>
|
|
35
21
|
</template>
|
|
36
22
|
|
|
37
23
|
<script>
|
|
38
24
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
import AirbnbStyleDatepicker from 'vue-airbnb-style-datepicker';
|
|
43
|
-
import variables from '../../sass/includes/_as_variables.scss';
|
|
44
|
-
|
|
45
|
-
Vue.use(AirbnbStyleDatepicker, {
|
|
46
|
-
colors: {
|
|
47
|
-
selected : variables.toggleblue,
|
|
48
|
-
inRange : variables.togglelightblue,
|
|
49
|
-
selectedText : variables.togglewhite,
|
|
50
|
-
text : variables.toggleinputcolour,
|
|
51
|
-
inRangeBorder: variables.togglewhite,
|
|
52
|
-
disabled : variables.togglewhite,
|
|
53
|
-
},
|
|
54
|
-
texts: {
|
|
55
|
-
apply: 'Done'
|
|
56
|
-
},
|
|
57
|
-
});
|
|
25
|
+
import { mixins } from '../mixins/mixins'
|
|
26
|
+
import moment from 'moment';
|
|
27
|
+
import DatePicker from 'vue2-datepicker';
|
|
58
28
|
|
|
59
29
|
export default {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
name: {
|
|
68
|
-
type: String,
|
|
69
|
-
default: "ToggleInputText"
|
|
70
|
-
},
|
|
71
|
-
label: {
|
|
72
|
-
type: String,
|
|
73
|
-
required: false
|
|
74
|
-
},
|
|
75
|
-
placeholder: {
|
|
76
|
-
type: String,
|
|
77
|
-
required: false
|
|
78
|
-
},
|
|
79
|
-
autocomplete: {
|
|
80
|
-
type: Boolean,
|
|
81
|
-
default: true
|
|
82
|
-
},
|
|
83
|
-
size: {
|
|
84
|
-
type: String,
|
|
85
|
-
validator: function (value) {
|
|
86
|
-
return ['extra-small', 'small', 'medium', 'large', 'full'].indexOf(value) !== -1
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
|
-
required: {
|
|
90
|
-
type: Boolean,
|
|
91
|
-
default: false
|
|
92
|
-
},
|
|
93
|
-
isInvalid: {
|
|
94
|
-
type: Boolean,
|
|
95
|
-
default: false
|
|
96
|
-
},
|
|
97
|
-
errorMessage: {
|
|
98
|
-
type: String,
|
|
99
|
-
required: false
|
|
100
|
-
},
|
|
101
|
-
maxLength:{
|
|
102
|
-
type: Number,
|
|
103
|
-
required:false
|
|
104
|
-
}
|
|
30
|
+
mixins:[mixins],
|
|
31
|
+
components:{
|
|
32
|
+
DatePicker
|
|
33
|
+
},
|
|
34
|
+
props: {
|
|
35
|
+
set_value: {
|
|
36
|
+
type: [Boolean,Date,Object]
|
|
105
37
|
},
|
|
106
|
-
|
|
107
|
-
|
|
38
|
+
value: {},
|
|
39
|
+
// datepicker mode, see: https://www.npmjs.com/package/vue2-datepicker#props
|
|
40
|
+
type: {
|
|
41
|
+
type: String,
|
|
42
|
+
validator: function (value) {
|
|
43
|
+
return ['date', 'datetime', 'year', 'month', 'time', 'week'].indexOf(value) !== -1
|
|
44
|
+
},
|
|
45
|
+
default: "date"
|
|
108
46
|
},
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
47
|
+
// singular date or range between 2 dates
|
|
48
|
+
range: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: false
|
|
113
51
|
},
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
let state = newVal ? 'open' : 'closed';
|
|
118
|
-
this.$emit('state', state);
|
|
119
|
-
}
|
|
120
|
-
|
|
52
|
+
name: {
|
|
53
|
+
type: String,
|
|
54
|
+
default: "ToggleInputText"
|
|
121
55
|
},
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
},
|
|
126
|
-
|
|
127
|
-
// plugin only accepts MM/DD/YYYY, so change this so that it excepts and outputs JS dates
|
|
128
|
-
displayValue: {
|
|
129
|
-
get: function() {
|
|
130
|
-
return this.formatDate(this.value)
|
|
131
|
-
},
|
|
132
|
-
set: function(modifiedValue) {
|
|
133
|
-
if(modifiedValue){
|
|
134
|
-
modifiedValue = new Date(new Date(modifiedValue+' 00:00:00').toISOString());
|
|
135
|
-
}
|
|
136
|
-
else modifiedValue = false;
|
|
137
|
-
this.$emit('input', modifiedValue);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
56
|
+
label: {
|
|
57
|
+
type: String,
|
|
58
|
+
required: false
|
|
140
59
|
},
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
60
|
+
placeholder: {
|
|
61
|
+
type: String,
|
|
62
|
+
required: false
|
|
63
|
+
},
|
|
64
|
+
autocomplete: {
|
|
65
|
+
type: Boolean,
|
|
66
|
+
default: true
|
|
67
|
+
},
|
|
68
|
+
size: {
|
|
69
|
+
type: String,
|
|
70
|
+
validator: function (value) {
|
|
71
|
+
return ['small', 'medium'].indexOf(value) !== -1
|
|
72
|
+
},
|
|
73
|
+
default: 'medium'
|
|
74
|
+
},
|
|
75
|
+
displayFormat: {
|
|
76
|
+
type: String,
|
|
77
|
+
default: 'DD/MM/Y'
|
|
78
|
+
},
|
|
79
|
+
required: {
|
|
80
|
+
type: Boolean,
|
|
81
|
+
default: false
|
|
82
|
+
},
|
|
83
|
+
isInvalid: {
|
|
84
|
+
type: Boolean,
|
|
85
|
+
default: false
|
|
86
|
+
},
|
|
87
|
+
errorMessage: {
|
|
88
|
+
type: String,
|
|
89
|
+
required: false
|
|
90
|
+
},
|
|
91
|
+
maxLength:{
|
|
92
|
+
type: Number,
|
|
93
|
+
required:false
|
|
94
|
+
},
|
|
95
|
+
disabled: {
|
|
96
|
+
type: Boolean,
|
|
97
|
+
default: false
|
|
98
|
+
},
|
|
99
|
+
// in toggle-table context, if search bar height expand transition has finished
|
|
100
|
+
searchIsOpen: {
|
|
101
|
+
type: Boolean,
|
|
102
|
+
required: false,
|
|
103
|
+
default: null
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
data : function(){
|
|
107
|
+
return {
|
|
108
|
+
show: false,
|
|
147
109
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
else this.datePickerOpen = !this.datePickerOpen;
|
|
153
|
-
});
|
|
110
|
+
momentFormat: {
|
|
111
|
+
//[optional] Date to String
|
|
112
|
+
stringify: (date) => {
|
|
113
|
+
return date ? moment(date).format(this.displayFormat) : ''
|
|
154
114
|
},
|
|
115
|
+
//[optional] String to Date
|
|
116
|
+
parse: (value) => {
|
|
117
|
+
return value ? moment(value, this.displayFormat).toDate() : null
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
},
|
|
122
|
+
created : function(){
|
|
123
|
+
// in table mode, has search bar expand transition finished?
|
|
124
|
+
if(this.searchIsOpen === null || this.searchIsOpen){
|
|
125
|
+
this.show = true;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
},
|
|
129
|
+
watch :{
|
|
130
|
+
// search bar expand transition / if in table context
|
|
131
|
+
searchIsOpen(new_value){
|
|
132
|
+
if(new_value){
|
|
133
|
+
this.show = true;
|
|
134
|
+
}
|
|
155
135
|
}
|
|
136
|
+
},
|
|
137
|
+
computed: {
|
|
138
|
+
|
|
139
|
+
inputVal: {
|
|
140
|
+
get: function (){
|
|
141
|
+
return this.convertRangeObject(this.value);
|
|
142
|
+
},
|
|
143
|
+
set: function (value){
|
|
144
|
+
this.$emit('input', this.convertRangeObject(value));
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
|
|
148
|
+
},
|
|
149
|
+
methods: {
|
|
150
|
+
// convert singular date to range. Plugin uses array with 2 values / parents in Toggle dash expect object with start & end keys
|
|
151
|
+
convertRangeObject(input)
|
|
152
|
+
{
|
|
153
|
+
if(!this.range){
|
|
154
|
+
return input
|
|
155
|
+
}
|
|
156
|
+
return Array.isArray(input) ? {
|
|
157
|
+
start: input[0],
|
|
158
|
+
end: input[1]
|
|
159
|
+
} : [
|
|
160
|
+
input.start,
|
|
161
|
+
input.end
|
|
162
|
+
];
|
|
163
|
+
},
|
|
164
|
+
}
|
|
156
165
|
}
|
|
157
166
|
|
|
158
167
|
|
|
159
168
|
</script>
|
|
160
169
|
|
|
170
|
+
<style scoped>
|
|
171
|
+
.toggle-date-container {
|
|
172
|
+
display: none;
|
|
173
|
+
&.visible {
|
|
174
|
+
display: block;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
</style>
|
|
178
|
+
|
|
161
179
|
<style lang="scss">
|
|
180
|
+
$namespace: 'toggle-mxdatepicker';
|
|
181
|
+
|
|
182
|
+
@import '~vue2-datepicker/scss/index.scss';
|
|
162
183
|
|
|
163
|
-
|
|
164
184
|
|
|
185
|
+
.toggle-mxdatepicker-datepicker, .toggle-mxdatepicker-datepicker-range {
|
|
186
|
+
width: 100%;
|
|
187
|
+
}
|
|
188
|
+
.toggle-mxdatepicker-input {
|
|
189
|
+
padding: 0.5rem 3.5rem 0.5rem 1rem;
|
|
190
|
+
background-color: #F4F6F7 !important;
|
|
191
|
+
height: 2.8rem;
|
|
192
|
+
width: 100%;
|
|
193
|
+
box-shadow: none;
|
|
194
|
+
border: 0;
|
|
195
|
+
color: #354b64 !important;
|
|
196
|
+
font-weight: bold !important;
|
|
197
|
+
font-size: 1.2rem !important;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
i.toggle-mxdatepicker-icon-clear {
|
|
201
|
+
display: flex;
|
|
202
|
+
align-items: center;
|
|
203
|
+
justify-content: center;
|
|
204
|
+
width: 1.5rem;
|
|
205
|
+
height: 1.5rem;
|
|
206
|
+
&:after{
|
|
207
|
+
cursor: pointer;
|
|
208
|
+
content: url('../../assets/icons/delete.svg');
|
|
209
|
+
width: 1.5rem;
|
|
210
|
+
height: 1.5rem;
|
|
211
|
+
position: absolute;
|
|
212
|
+
pointer-events: none;
|
|
213
|
+
z-index: 2;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
i.toggle-mxdatepicker-icon-calendar {
|
|
218
|
+
display: flex;
|
|
219
|
+
align-items: center;
|
|
220
|
+
justify-content: center;
|
|
221
|
+
width: 1.5rem;
|
|
222
|
+
height: 1.5rem;
|
|
223
|
+
&:after{
|
|
224
|
+
cursor: pointer;
|
|
225
|
+
content: url("../../assets/icons/calendar.svg");
|
|
226
|
+
width: 1.5rem;
|
|
227
|
+
height: 1.5rem;
|
|
228
|
+
position: absolute;
|
|
229
|
+
pointer-events: none;
|
|
230
|
+
z-index: 2;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.toggle-date-input-container-small {
|
|
235
|
+
.toggle-mxdatepicker-input {
|
|
236
|
+
background-color: transparent;
|
|
237
|
+
margin-top: 11px;
|
|
238
|
+
padding: 1px 1.65rem 1px 3px;
|
|
239
|
+
font-size: 0.9rem !important;
|
|
240
|
+
height: 1.5rem;
|
|
241
|
+
}
|
|
242
|
+
i.toggle-mxdatepicker-icon-calendar, i.toggle-mxdatepicker-icon-clear {
|
|
243
|
+
margin-top: 6px;
|
|
244
|
+
width: 1em;
|
|
245
|
+
height: 1em;
|
|
246
|
+
&:after{
|
|
247
|
+
width: 1rem;
|
|
248
|
+
height: 1rem;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.toggle-mxdatepicker-calendar-content {
|
|
254
|
+
height: auto;
|
|
255
|
+
}
|
|
165
256
|
</style>
|
|
166
257
|
|
|
167
258
|
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
|
|
3
3
|
<div class="toggle-input-container" :class="{'toggle-input-is-invalid':isInvalid, 'toggle-input-is-disabled':disabled}" v-on:click="focusClosestInput">
|
|
4
|
-
<label
|
|
4
|
+
<label
|
|
5
5
|
v-if="label"
|
|
6
|
-
:for="name ? name : 'ToggleInputSelect' "
|
|
6
|
+
:for="name ? name : 'ToggleInputSelect' "
|
|
7
7
|
class="toggle-input-label"
|
|
8
|
-
> {{ label }}
|
|
8
|
+
> {{ label }}
|
|
9
9
|
</label>
|
|
10
10
|
|
|
11
11
|
<div class="toggle-input-select-container">
|
|
12
|
-
<select
|
|
13
|
-
:name="name ? name : 'ToggleInputSelect' "
|
|
12
|
+
<select
|
|
13
|
+
:name="name ? name : 'ToggleInputSelect' "
|
|
14
14
|
:class="[ 'toggle-input-select', size]"
|
|
15
|
-
v-model="inputVal"
|
|
15
|
+
v-model="inputVal"
|
|
16
16
|
:autocomplete="autocomplete ? 'on' : 'off' "
|
|
17
17
|
:required="required"
|
|
18
18
|
:disabled="disabled"
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
</div>
|
|
25
25
|
|
|
26
26
|
<label
|
|
27
|
-
class="toggle-input-label-error"
|
|
27
|
+
class="toggle-input-label-error"
|
|
28
28
|
v-if="isInvalid"
|
|
29
29
|
:for="name ? name : 'ToggleInputText' "
|
|
30
30
|
>
|
|
@@ -39,11 +39,6 @@ import { mixins } from '../mixins/mixins'
|
|
|
39
39
|
|
|
40
40
|
export default {
|
|
41
41
|
mixins:[mixins],
|
|
42
|
-
data() {
|
|
43
|
-
return {
|
|
44
|
-
show: false
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
42
|
props: {
|
|
48
43
|
value: {},
|
|
49
44
|
name: {
|
|
@@ -92,7 +87,6 @@ export default {
|
|
|
92
87
|
},
|
|
93
88
|
|
|
94
89
|
created : function(){
|
|
95
|
-
|
|
96
90
|
},
|
|
97
91
|
computed: {
|
|
98
92
|
inputVal: {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
|
|
3
3
|
<div class="toggle-input-container" :class="{'toggle-input-is-invalid':isInvalid, 'toggle-input-is-disabled':disabled}" v-on:click="focusClosestInput">
|
|
4
|
-
<label
|
|
4
|
+
<label
|
|
5
5
|
v-if="label"
|
|
6
|
-
:for="name ? name : 'InputText' "
|
|
6
|
+
:for="name ? name : 'InputText' "
|
|
7
7
|
class="toggle-input-label"
|
|
8
|
-
> {{ label }}
|
|
8
|
+
> {{ label }}
|
|
9
9
|
</label>
|
|
10
10
|
<span class="toggle-input-counter" v-if="maxLength">{{messageLength(inputVal, maxLength)}}</span>
|
|
11
11
|
<input
|
|
12
12
|
:type="type"
|
|
13
|
-
:name="name ? name : 'ToggleInputText' "
|
|
13
|
+
:name="name ? name : 'ToggleInputText' "
|
|
14
14
|
:class="[ 'toggle-input', size]"
|
|
15
15
|
:placeholder="placeholder ? placeholder : '' "
|
|
16
16
|
:autocomplete="autocomplete ? 'on' : 'off' "
|
|
@@ -19,11 +19,9 @@
|
|
|
19
19
|
:maxlength="maxLength"
|
|
20
20
|
:disabled="disabled"
|
|
21
21
|
:readonly="readonly"
|
|
22
|
-
:ref="'input_ele'"
|
|
23
|
-
@keyup.esc="handleEscPress"
|
|
24
22
|
/>
|
|
25
23
|
<label
|
|
26
|
-
class="toggle-input-label-error"
|
|
24
|
+
class="toggle-input-label-error"
|
|
27
25
|
v-if="isInvalid"
|
|
28
26
|
:for="name ? name : 'ToggleInputText' "
|
|
29
27
|
>
|
|
@@ -105,9 +103,7 @@ export default {
|
|
|
105
103
|
}
|
|
106
104
|
},
|
|
107
105
|
|
|
108
|
-
created : function()
|
|
109
|
-
{
|
|
110
|
-
this.$nextTick(() => this.$refs['input_ele'].focus());
|
|
106
|
+
created : function(){
|
|
111
107
|
},
|
|
112
108
|
computed: {
|
|
113
109
|
inputVal: {
|
|
@@ -122,11 +118,6 @@ export default {
|
|
|
122
118
|
},
|
|
123
119
|
methods: {
|
|
124
120
|
|
|
125
|
-
handleEscPress()
|
|
126
|
-
{
|
|
127
|
-
this.$emit('bail');
|
|
128
|
-
},
|
|
129
|
-
|
|
130
121
|
/*
|
|
131
122
|
* Concat message for count characters
|
|
132
123
|
* @return string
|