toggle-components-library 1.37.0-beta.0 → 1.37.0-beta.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "toggle-components-library",
3
- "version": "1.37.0-beta.0",
3
+ "version": "1.37.0-beta.1",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -1,19 +1,26 @@
1
1
  <template>
2
2
  <div class="toggle-breadcrumb" v-if="breadcrumb_computed">
3
3
  <div v-for="(crumb, index) in breadcrumb_computed" :key="index">
4
- <router-link :to="{ name: crumb.link}" class="back-product" v-if="crumb.link && !isNuxt">{{ crumb.name }}</router-link>
5
- <NuxtLink :to="{ name: crumb.link}" class="back-product" v-if="crumb.link && isNuxt">{{ crumb.name }}</NuxtLink>
6
- <i class="toggle-breadcrumb-arrow-right" v-if="crumb.link"></i>
7
- <h1 class="toggle-breadcrumb-h1" v-if="!crumb.link">{{ crumb.name }}</h1>
4
+ <template v-if="index === breadcrumb_computed.length - 1 && editable">
5
+ <input
6
+ class="toggle-breadcrumb-editable-input"
7
+ v-model="crumb.name"
8
+ maxlength="50"
9
+ @input="autoResizeInput($event.target); updateContent($event);"
10
+ />
11
+ </template>
12
+ <template v-else>
13
+ <router-link :to="{ name: crumb.link}" class="back-product" v-if="crumb.link && !isNuxt">{{ crumb.name }}</router-link>
14
+ <NuxtLink :to="{ name: crumb.link}" class="back-product" v-if="crumb.link && isNuxt">{{ crumb.name }}</NuxtLink>
15
+ <i class="toggle-breadcrumb-arrow-right" v-if="crumb.link"></i>
16
+ <h1 class="toggle-breadcrumb-h1" v-if="!crumb.link">{{ crumb.name }}</h1>
17
+ </template>
8
18
  </div>
9
19
  </div>
10
20
  </template>
11
21
 
12
22
  <script>
13
-
14
-
15
23
  export default {
16
-
17
24
  mixins: [],
18
25
  props: {
19
26
  isNuxt: {
@@ -23,21 +30,31 @@ export default {
23
30
  breadcrumb: {
24
31
  type: Array,
25
32
  required: false
33
+ },
34
+ editable: {
35
+ type: Boolean,
36
+ default: false
26
37
  }
27
38
  },
28
39
 
29
40
  data: function () {
30
-
31
-
32
41
  return {};
33
42
  },
34
43
 
35
44
  computed: {
36
-
37
45
  breadcrumb_computed() {
38
- return this.isNuxt ? this.breadcrumb : this.$route.meta.breadcrumb
46
+ return this.isNuxt ? this.breadcrumb : this.$route.meta.breadcrumb
39
47
  },
40
- }
48
+ },
41
49
 
50
+ methods: {
51
+ autoResizeInput(input) {
52
+ input.style.width = input.value.length * 11 + "px";
53
+ },
54
+ updateContent(event) {
55
+ const newContent = event.target.value;
56
+ this.$emit('update:lastCrumb', newContent);
57
+ }
58
+ }
42
59
  }
43
60
  </script>
@@ -10,6 +10,37 @@
10
10
 
11
11
  }
12
12
 
13
+ .toggle-breadcrumb-editable-input {
14
+ font-size: $toggle-font-size-extra-large;
15
+ font-family: "DIN-2014","Lato",sans-serif;
16
+ color: $toggle-black;
17
+ background-color: transparent;
18
+ display: inline-flex;
19
+ align-items: center;
20
+ min-width: 10rem !important;
21
+ max-width: 31rem !important;
22
+ height: 2rem;
23
+ width: 15rem;
24
+ padding-right: 0.5rem;
25
+ border: none;
26
+ border-radius: 4px;
27
+ white-space: nowrap;
28
+ overflow: hidden;
29
+ line-height: 1;
30
+ border: 1px solid transparent;
31
+ margin: -1px 0 0 0;
32
+ }
33
+ .toggle-breadcrumb-editable-input:hover {
34
+ border: 1px solid #ccc;
35
+ background-color: $toggle-off-white;
36
+ }
37
+
38
+ .toggle-breadcrumb-editable-input:focus {
39
+ border: 1px solid #ccc;
40
+ outline: none;
41
+ }
42
+
43
+
13
44
  a {
14
45
 
15
46
  font-size: $toggle-font-size-extra-large;