@thinkpixellab-public/px-vue 3.0.51 → 3.0.54

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.
@@ -17,6 +17,7 @@
17
17
  :key="getItemKey(item)"
18
18
  :disabled="getItemDisabled(item)"
19
19
  @click="itemClick(item)"
20
+ v-bind="getTabAttrs(item)"
20
21
  >
21
22
  <span :ref="getTabContentRefName(item)">
22
23
  <slot :item="item" :selected="isItemSelected(item)">
@@ -49,9 +50,14 @@ export default {
49
50
  components: {},
50
51
  mixins: [PxBaseResize, PxBaseItemsSelect],
51
52
  props: {
53
+ // classes that get set on the tabs and selector line
52
54
  tabClass: { type: String, default: 'px-pivot__tab' },
53
55
  selectorClass: { type: String, default: 'px-pivot__selector' },
54
56
 
57
+ // a function that will return attributes that should be set on the tab buttons (takes the
58
+ // button item as an arg)
59
+ tabAttrsFn: { type: Function, default: null },
60
+
55
61
  // if true scrolls horizontally when no more room
56
62
  scrolls: { type: Boolean, default: true },
57
63
 
@@ -139,6 +145,13 @@ export default {
139
145
  this.animated = false;
140
146
  }, 100);
141
147
  },
148
+
149
+ getTabAttrs(item) {
150
+ if (this.tabAttrsFn) {
151
+ return this.tabAttrsFn(item);
152
+ }
153
+ return null;
154
+ },
142
155
  },
143
156
  };
144
157
  </script>
@@ -48,6 +48,8 @@ export default {
48
48
  duration: { type: Number, default: 1 },
49
49
  ease: { type: String, default: 'power3.out' },
50
50
  slideAmount: { default: '40vw' },
51
+
52
+ disableAnimations: { type: Boolean, default: false },
51
53
  },
52
54
  computed: {
53
55
  tweenShared() {
@@ -57,6 +59,11 @@ export default {
57
59
  };
58
60
  },
59
61
  },
62
+ mounted() {
63
+ if (this.disableAnimations) {
64
+ gsap.globalTimeline.timeScale(Number.MAX_VALUE);
65
+ }
66
+ },
60
67
  methods: {
61
68
  directionAmount(direction, addEquals = false) {
62
69
  let dir;
@@ -10,6 +10,7 @@
10
10
  :class="bem('slide-wrapper', { selected: isItemSelected(item) })"
11
11
  >
12
12
  <px-slide-transition
13
+ :disable-animations="disableAnimations"
13
14
  :direction="direction"
14
15
  @before-leave="transitionStart"
15
16
  @after-leave="transitionEnd"
@@ -73,6 +74,9 @@ export default {
73
74
 
74
75
  // override default
75
76
  autoSelectFirst: { type: Boolean, default: true },
77
+
78
+ // disable animations
79
+ disableAnimations: { type: Boolean, default: false },
76
80
  },
77
81
 
78
82
  data() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thinkpixellab-public/px-vue",
3
- "version": "3.0.51",
3
+ "version": "3.0.54",
4
4
  "description": "General purpose Vue components and helpers that can be used across projects.",
5
5
  "author": "Pixel Lab",
6
6
  "license": "MIT",