vue-slider-timer-control 1.0.0 → 1.0.2

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.
@@ -27,22 +27,6 @@ var update = add("b06be540", content, true, {"sourceMap":false,"shadowMode":fals
27
27
 
28
28
  /***/ }),
29
29
 
30
- /***/ 72:
31
- /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
32
-
33
- // style-loader: Adds some css to the DOM by adding a <style> tag
34
-
35
- // load the styles
36
- var content = __webpack_require__(853);
37
- if(content.__esModule) content = content.default;
38
- if(typeof content === 'string') content = [[module.id, content, '']];
39
- if(content.locals) module.exports = content.locals;
40
- // add the styles to the DOM
41
- var add = (__webpack_require__(548)/* ["default"] */ .A)
42
- var update = add("3f289cee", content, true, {"sourceMap":false,"shadowMode":false});
43
-
44
- /***/ }),
45
-
46
30
  /***/ 113:
47
31
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
48
32
 
@@ -62,6 +46,22 @@ ___CSS_LOADER_EXPORT___.push([module.id, ".vue-slider-disabled{opacity:.5;cursor
62
46
  /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
63
47
 
64
48
 
49
+ /***/ }),
50
+
51
+ /***/ 222:
52
+ /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
53
+
54
+ // style-loader: Adds some css to the DOM by adding a <style> tag
55
+
56
+ // load the styles
57
+ var content = __webpack_require__(667);
58
+ if(content.__esModule) content = content.default;
59
+ if(typeof content === 'string') content = [[module.id, content, '']];
60
+ if(content.locals) module.exports = content.locals;
61
+ // add the styles to the DOM
62
+ var add = (__webpack_require__(548)/* ["default"] */ .A)
63
+ var update = add("3abedde0", content, true, {"sourceMap":false,"shadowMode":false});
64
+
65
65
  /***/ }),
66
66
 
67
67
  /***/ 274:
@@ -455,7 +455,7 @@ module.exports = function (i) {
455
455
 
456
456
  /***/ }),
457
457
 
458
- /***/ 853:
458
+ /***/ 667:
459
459
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
460
460
 
461
461
  "use strict";
@@ -469,7 +469,7 @@ __webpack_require__.r(__webpack_exports__);
469
469
 
470
470
  var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
471
471
  // Module
472
- ___CSS_LOADER_EXPORT___.push([module.id, ".time-slider-container[data-v-2836fa1c]{position:relative;padding:20px;width:100%;box-sizing:border-box}", ""]);
472
+ ___CSS_LOADER_EXPORT___.push([module.id, ".time-slider-container[data-v-e98463a8]{position:relative;padding:20px;width:100%;box-sizing:border-box}", ""]);
473
473
  // Exports
474
474
  /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
475
475
 
@@ -579,8 +579,8 @@ if (typeof window !== 'undefined') {
579
579
  // Indicate to webpack that this file can be concatenated
580
580
  /* harmony default export */ var setPublicPath = (null);
581
581
 
582
- ;// ./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/VueSliderTimerControl/index.vue?vue&type=template&id=2836fa1c&scoped=true
583
- var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{ref:"sliderWrapper",staticClass:"time-slider-container"},[(_vm.showCurrentTime)?_c('div',{staticClass:"time-label",style:(_vm.timeLabelStyle)},[_vm._v(" "+_vm._s(_vm.formattedTime)+" ")]):_vm._e(),_c('vue-slider',{ref:"slider",attrs:{"min":_vm.min,"max":_vm.max,"step":_vm.step,"tooltip":_vm.tooltip,"tooltip-formatter":_vm.tooltipFormatter || _vm.formatTooltip,"rail-style":_vm.railStyle,"process-style":_vm.processStyle,"dot-style":_vm.dotStyle},on:{"change":_vm.handleSeek},model:{value:(_vm.currentSecond),callback:function ($$v) {_vm.currentSecond=$$v},expression:"currentSecond"}}),(_vm.showHoverTooltip && _vm.hoverVisible)?_c('div',{style:([_vm.hoverTooltipStyle, { left: _vm.hoverX + 'px' }])},[_vm._v(" "+_vm._s((_vm.tooltipFormatter || _vm.formatTooltip)(_vm.hoverSecond))+" ")]):_vm._e(),(_vm.showTickLabels)?_c('div',{staticClass:"tick-labels",style:(_vm.tickLabelsStyle)},_vm._l((_vm.tickLabels),function(label){return _c('span',{key:label},[_vm._v(_vm._s(label))])}),0):_vm._e()],1)
582
+ ;// ./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/VueSliderTimerControl/index.vue?vue&type=template&id=e98463a8&scoped=true
583
+ var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{ref:"sliderWrapper",staticClass:"time-slider-container"},[(_vm.showCurrentTime)?_c('div',{staticClass:"time-label",style:(_vm.timeLabelStyle)},[_vm._v(" "+_vm._s(_vm.formattedTime)+" ")]):_vm._e(),_c('vue-slider',{ref:"slider",attrs:{"min":_vm.min,"max":_vm.max,"step":_vm.step,"tooltip":_vm.tooltip,"tooltip-formatter":_vm.tooltipFormatter || _vm.formatTooltip,"rail-style":_vm.railStyle,"process-style":_vm.processStyle,"dot-style":_vm.dotStyle},on:{"drag-start":_vm.onDragStart,"drag-end":_vm.onDragEnd,"change":_vm.handleSeek},model:{value:(_vm.currentSecond),callback:function ($$v) {_vm.currentSecond=$$v},expression:"currentSecond"}}),(_vm.showHoverTooltip && _vm.hoverVisible)?_c('div',{style:([_vm.hoverTooltipStyle, { left: _vm.hoverX + 'px' }])},[_vm._v(" "+_vm._s((_vm.tooltipFormatter || _vm.formatTooltip)(_vm.hoverSecond))+" ")]):_vm._e(),(_vm.showTickLabels)?_c('div',{staticClass:"tick-labels",style:(_vm.tickLabelsStyle)},_vm._l((_vm.tickLabels),function(label){return _c('span',{key:label},[_vm._v(_vm._s(label))])}),0):_vm._e()],1)
584
584
  }
585
585
  var staticRenderFns = []
586
586
 
@@ -590,162 +590,182 @@ var vue_slider_component_umd_min = __webpack_require__(378);
590
590
  var vue_slider_component_umd_min_default = /*#__PURE__*/__webpack_require__.n(vue_slider_component_umd_min);
591
591
  // EXTERNAL MODULE: ./node_modules/vue-slider-component/theme/default.css
592
592
  var theme_default = __webpack_require__(46);
593
- ;// ./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/VueSliderTimerControl/index.vue?vue&type=script&lang=js
594
-
595
-
596
-
597
-
598
- /* harmony default export */ var VueSliderTimerControlvue_type_script_lang_js = ({
599
- name: "VueSliderTimerControl",
600
- components: { VueSlider: (vue_slider_component_umd_min_default()) },
601
- props: {
602
- min: { type: Number, default: 0 },
603
- max: { type: Number, default: 86400 },
604
- step: { type: Number, default: 1 },
605
- currentTime: { type: Number, default: 0 },
606
-
607
- // 是否显示当前时间
608
- showCurrentTime: { type: Boolean, default: false },
609
-
610
- // 当前时间样式
611
- timeLabelStyle: {
612
- type: Object,
613
- default: () => ({
614
- textAlign: "center",
615
- fontSize: "18px",
616
- fontWeight: "500",
617
- marginBottom: "10px",
618
- }),
619
- },
620
-
621
- // hover 提示是否显示
622
- showHoverTooltip: { type: Boolean, default: true },
623
- hoverTooltipStyle: {
624
- type: Object,
625
- default: () => ({
626
- position: "absolute",
627
- top: "58px",
628
- transform: "translateY(-70%)",
629
- backgroundColor: "rgba(0, 0, 0, 0.75)",
630
- color: "#fff",
631
- padding: "2px 6px",
632
- borderRadius: "4px",
633
- fontSize: "12px",
634
- pointerEvents: "none",
635
- whiteSpace: "nowrap",
636
- zIndex: 10,
637
- }),
638
- },
639
-
640
- // 是否显示刻度
641
- showTickLabels: { type: Boolean, default: false },
642
- tickLabels: {
643
- type: Array,
644
- default: () => ["00:00", "12:00", "24:00"],
645
- },
646
- tickLabelsStyle: {
647
- type: Object,
648
- default: () => ({
649
- display: "flex",
650
- justifyContent: "space-between",
651
- fontSize: "14px",
652
- color: "#666",
653
- marginTop: "6px",
654
- padding: "0 2px",
655
- }),
656
- },
657
-
658
- // 滑块样式配置
659
- railStyle: {
660
- type: Object,
661
- default: () => ({ backgroundColor: "#d3d3d3" }),
662
- },
663
- processStyle: {
664
- type: Object,
665
- default: () => ({ backgroundColor: "#409EFF" }),
666
- },
667
- dotStyle: {
668
- type: Object,
669
- default: () => ({ backgroundColor: "#409EFF", border: "none" }),
670
- },
671
-
672
- tooltip: { type: [Boolean, String], default: "always" },
673
- tooltipFormatter: { type: Function, default: null },
674
- },
675
- data() {
676
- return {
677
- rawSecond: 0,
678
- hoverVisible: false,
679
- hoverSecond: 0,
680
- hoverX: 0,
681
- };
682
- },
683
- computed: {
684
- currentSecond: {
685
- get() {
686
- return this.rawSecond;
687
- },
688
- set(val) {
689
- this.rawSecond = val;
690
- this.$emit("seek", val);
691
- },
692
- },
693
- formattedTime() {
694
- return (this.tooltipFormatter || this.formatTooltip)(this.currentSecond);
695
- },
696
- },
697
- watch: {
698
- currentTime(val) {
699
- if (val !== this.rawSecond) {
700
- this.rawSecond = val;
701
- }
702
- },
703
- },
704
- mounted() {
705
- this.$nextTick(() => {
706
- const rail = this.$refs.slider?.$el?.querySelector(".vue-slider-rail");
707
- if (rail && this.showHoverTooltip) {
708
- rail.addEventListener("mousemove", this.handleHover);
709
- rail.addEventListener("mouseleave", this.hideHoverTime);
710
- }
711
- });
712
- },
713
- methods: {
714
- formatTooltip(val) {
715
- const h = String(Math.floor(val / 3600)).padStart(2, "0");
716
- const m = String(Math.floor((val % 3600) / 60)).padStart(2, "0");
717
- const s = String(val % 60).padStart(2, "0");
718
- return `${h}:${m}:${s}`;
719
- },
720
- handleHover(e) {
721
- const rail = this.$refs.slider?.$el?.querySelector(".vue-slider-rail");
722
- if (!rail) return;
723
-
724
- const rect = rail.getBoundingClientRect();
725
- const offsetX = e.clientX - rect.left;
726
- const ratio = Math.min(Math.max(offsetX / rect.width, 0), 1);
727
- const second = Math.round((this.max - this.min) * ratio + this.min);
728
-
729
- this.hoverVisible = true;
730
- this.hoverX = offsetX;
731
- this.hoverSecond = second;
732
- },
733
- hideHoverTime() {
734
- this.hoverVisible = false;
735
- },
736
- handleSeek(val) {
737
- this.$emit("seek", val);
738
- },
739
- },
740
- });
593
+ ;// ./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/VueSliderTimerControl/index.vue?vue&type=script&lang=js
594
+
595
+
596
+
597
+
598
+ /* harmony default export */ var VueSliderTimerControlvue_type_script_lang_js = ({
599
+ name: "VueVideoTimerControl",
600
+ components: { VueSlider: (vue_slider_component_umd_min_default()) },
601
+ props: {
602
+ min: { type: Number, default: 0 },
603
+ max: { type: Number, default: 86400 },
604
+ step: { type: Number, default: 1 },
605
+ currentTime: { type: Number, default: 0 },
606
+ // 是否显示当前时间
607
+ showCurrentTime: { type: Boolean, default: false },
608
+ // 当前时间样式
609
+ timeLabelStyle: {
610
+ type: Object,
611
+ default: () => ({
612
+ textAlign: "center",
613
+ fontSize: "18px",
614
+ fontWeight: "500",
615
+ marginBottom: "10px",
616
+ }),
617
+ },
618
+ // hover 提示是否显示
619
+ showHoverTooltip: { type: Boolean, default: true },
620
+ hoverTooltipStyle: {
621
+ type: Object,
622
+ default: () => ({
623
+ position: "absolute",
624
+ top: "58px",
625
+ transform: "translateY(-70%)",
626
+ backgroundColor: "rgba(0, 0, 0, 0.75)",
627
+ color: "#fff",
628
+ padding: "2px 6px",
629
+ borderRadius: "4px",
630
+ fontSize: "12px",
631
+ pointerEvents: "none",
632
+ whiteSpace: "nowrap",
633
+ zIndex: 10,
634
+ }),
635
+ },
636
+
637
+ // 是否显示刻度
638
+ showTickLabels: { type: Boolean, default: false },
639
+ tickLabels: {
640
+ type: Array,
641
+ default: () => ["00:00", "12:00", "24:00"],
642
+ },
643
+ tickLabelsStyle: {
644
+ type: Object,
645
+ default: () => ({
646
+ display: "flex",
647
+ justifyContent: "space-between",
648
+ fontSize: "14px",
649
+ color: "#666",
650
+ marginTop: "6px",
651
+ padding: "0 2px",
652
+ }),
653
+ },
654
+ // 滑块样式配置
655
+ railStyle: {
656
+ type: Object,
657
+ default: () => ({ backgroundColor: "#d3d3d3" }),
658
+ },
659
+ processStyle: {
660
+ type: Object,
661
+ default: () => ({ backgroundColor: "#409EFF" }),
662
+ },
663
+ dotStyle: {
664
+ type: Object,
665
+ default: () => ({ backgroundColor: "#409EFF", border: "none" }),
666
+ },
667
+
668
+ tooltip: { type: [Boolean, String], default: "always" },
669
+ tooltipFormatter: { type: Function, default: null },
670
+ },
671
+ data() {
672
+ return {
673
+ rawSecond: 0,
674
+ hoverVisible: false,
675
+ hoverSecond: 0,
676
+ hoverX: 0,
677
+ isDragging: false, // 拖动标志
678
+ };
679
+ },
680
+ computed: {
681
+ currentSecond: {
682
+ get() {
683
+ return this.rawSecond;
684
+ },
685
+ set(val) {
686
+ this.rawSecond = val;
687
+ // this.$emit("seek", val);
688
+ },
689
+ },
690
+ formattedTime() {
691
+ return (this.tooltipFormatter || this.formatTooltip)(this.currentSecond);
692
+ },
693
+ },
694
+ watch: {
695
+ currentTime(val) {
696
+ if (!this.isDragging && val !== this.rawSecond) {
697
+ this.rawSecond = val;
698
+ }
699
+ },
700
+ },
701
+ mounted() {
702
+ this.$nextTick(() => {
703
+ const slider = this.$refs.slider;
704
+ const sliderEl = slider && slider.$el;
705
+ const rail = sliderEl && sliderEl.querySelector(".vue-slider-rail");
706
+ if (rail && this.showHoverTooltip) {
707
+ rail.addEventListener("mousemove", this.handleHover);
708
+ rail.addEventListener("mouseleave", this.hideHoverTime);
709
+ }
710
+ });
711
+ },
712
+ methods: {
713
+ formatTooltip(val) {
714
+ const h = String(Math.floor(val / 3600)).padStart(2, "0");
715
+ const m = String(Math.floor((val % 3600) / 60)).padStart(2, "0");
716
+ const s = String(val % 60).padStart(2, "0");
717
+ return `${h}:${m}:${s}`;
718
+ },
719
+ handleHover(e) {
720
+ const slider = this.$refs.slider;
721
+ const sliderEl = slider && slider.$el;
722
+ const rail = sliderEl && sliderEl.querySelector(".vue-slider-rail");
723
+ if (!rail) return;
724
+ const rect = rail.getBoundingClientRect();
725
+ const offsetX = e.clientX - rect.left;
726
+ const ratio = Math.min(Math.max(offsetX / rect.width, 0), 1);
727
+ const second = Math.round((this.max - this.min) * ratio + this.min);
728
+
729
+ this.hoverVisible = true;
730
+ this.hoverX = offsetX;
731
+ this.hoverSecond = second;
732
+ },
733
+ hideHoverTime() {
734
+ this.hoverVisible = false;
735
+ },
736
+ onDragStart() {
737
+ this.isDragging = true;
738
+ this.$emit("dragging-change", true); // 通知父组件开始拖动
739
+ },
740
+ onDragEnd() {
741
+ this.isDragging = false;
742
+ this.$emit("dragging-change", false); // 通知父组件结束拖动
743
+ this.$emit("seek", this.rawSecond); // 拖动结束时手动触发
744
+ },
745
+ handleSeek(val, index) {
746
+ if (!this.isDragging) {
747
+ this.rawSecond = val;
748
+ this.$emit("seek", val); // 点击轨道时触发
749
+ }
750
+ // 拖动中不触发
751
+ },
752
+ // onDragging(val, index) {
753
+ // console.log(val, index, "dragging");
754
+ // },
755
+ // // 只要轨道落点变了就出发用于该组件的change监听(点击的时候可用但是拖动触发太频繁需要节流)
756
+ // handleSeek(val) {
757
+ // this.$emit("seek", val);
758
+ // },
759
+ },
760
+ });
741
761
 
742
762
  ;// ./src/components/VueSliderTimerControl/index.vue?vue&type=script&lang=js
743
763
  /* harmony default export */ var components_VueSliderTimerControlvue_type_script_lang_js = (VueSliderTimerControlvue_type_script_lang_js);
744
- // EXTERNAL MODULE: ./node_modules/vue-style-loader/index.js??clonedRuleSet-54.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-54.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-54.use[2]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-54.use[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/VueSliderTimerControl/index.vue?vue&type=style&index=0&id=2836fa1c&prod&scoped=true&lang=css
745
- var VueSliderTimerControlvue_type_style_index_0_id_2836fa1c_prod_scoped_true_lang_css = __webpack_require__(72);
746
- ;// ./src/components/VueSliderTimerControl/index.vue?vue&type=style&index=0&id=2836fa1c&prod&scoped=true&lang=css
764
+ // EXTERNAL MODULE: ./node_modules/vue-style-loader/index.js??clonedRuleSet-54.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-54.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-54.use[2]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-54.use[3]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/VueSliderTimerControl/index.vue?vue&type=style&index=0&id=e98463a8&prod&scoped=true&lang=css
765
+ var VueSliderTimerControlvue_type_style_index_0_id_e98463a8_prod_scoped_true_lang_css = __webpack_require__(222);
766
+ ;// ./src/components/VueSliderTimerControl/index.vue?vue&type=style&index=0&id=e98463a8&prod&scoped=true&lang=css
747
767
 
748
- ;// ./node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js
768
+ ;// ./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js
749
769
  /* globals __VUE_SSR_CONTEXT__ */
750
770
 
751
771
  // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
@@ -858,7 +878,7 @@ var component = normalizeComponent(
858
878
  staticRenderFns,
859
879
  false,
860
880
  null,
861
- "2836fa1c",
881
+ "e98463a8",
862
882
  null
863
883
 
864
884
  )
@@ -868,6 +888,7 @@ var component = normalizeComponent(
868
888
  // 这个文件是插件的入口文件,它的作用是将插件注册到Vue中,这样就可以在Vue的任何组件中使用插件了。
869
889
 
870
890
  //import vue文件的name from 路径
891
+ // 导入组件,SDK通过webpack.ProvidePlugin提供为全局变量
871
892
 
872
893
 
873
894
  const components = [VueSliderTimerControl];