/******/ (function() { // webpackBootstrap
/******/ 	"use strict";
/******/ 	// The require scope
/******/ 	var __webpack_require__ = {};
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/compat get default export */
/******/ 	!function() {
/******/ 		// getDefaultExport function for compatibility with non-harmony modules
/******/ 		__webpack_require__.n = function(module) {
/******/ 			var getter = module && module.__esModule ?
/******/ 				function() { return module['default']; } :
/******/ 				function() { return module; };
/******/ 			__webpack_require__.d(getter, { a: getter });
/******/ 			return getter;
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/define property getters */
/******/ 	!function() {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = function(exports, definition) {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	!function() {
/******/ 		__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/make namespace object */
/******/ 	!function() {
/******/ 		// define __esModule on exports
/******/ 		__webpack_require__.r = function(exports) {
/******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 			}
/******/ 			Object.defineProperty(exports, '__esModule', { value: true });
/******/ 		};
/******/ 	}();
/******/ 	
/************************************************************************/
var __webpack_exports__ = {};
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "default": function() { return /* binding */ anchor_steps; }
});

;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./packages/anchor-steps/src/main.vue?vue&type=template&id=d1b91c98&
var render = function render() {
  var _vm = this,
    _c = _vm._self._c;
  return _c("div", {
    staticClass: "jdf-anchor-steps",
    class: [_vm.nodeName && "anchor-step-flex", "anchor-step-".concat(_vm.direction)]
  }, [_vm.nodeName ? _c("div", {
    staticClass: "document-status",
    style: _vm.statusStyle
  }, [_c("div", {
    staticClass: "row"
  }, [_c("span", {
    staticClass: "node-name"
  }, [_vm._v(_vm._s(_vm.nodeNameLabel))]), _c("span", {
    staticClass: "main-color"
  }, [_vm._v(_vm._s(_vm.nodeName))])])]) : _vm._e(), _c("div", {
    directives: [{
      name: "show",
      rawName: "v-show",
      value: !_vm.isEmpty(_vm.stepList),
      expression: "!isEmpty(stepList)"
    }],
    staticClass: "step-list",
    class: "step-".concat(_vm.direction),
    style: _vm.stepStyle
  }, [_vm.tooltip ? _c("el-tooltip", {
    attrs: {
      content: _vm.tooltip,
      placement: "left-start",
      effect: "light",
      "visible-arrow": false,
      "popper-class": "jdf-popper-tooltip"
    }
  }, [_c("i", {
    staticClass: "jdf-tooltip-icon el-icon-info"
  })]) : _vm._e(), _c("el-steps", {
    attrs: {
      direction: _vm.direction,
      active: _vm.activeIndex,
      simple: _vm.direction !== "vertical",
      "process-status": "finish"
    }
  }, _vm._l(_vm.stepList, function (item, index) {
    return _c("step", {
      key: index,
      attrs: {
        icon: item.icon,
        "line-finish": _vm.getLineFinish(index)
      },
      on: {
        headClick: function headClick($event) {
          return _vm.jump(item.anchor, index);
        }
      }
    }, [_vm.showStepTitle ? _c("div", {
      attrs: {
        slot: "title"
      },
      on: {
        click: function click($event) {
          return _vm.jump(item.anchor, index);
        }
      },
      slot: "title"
    }, [_vm._v(_vm._s(item.label))]) : _vm._e()]);
  }), 1)], 1)]);
};
var staticRenderFns = [];
render._withStripped = true;

;// CONCATENATED MODULE: ./packages/anchor-steps/src/main.vue?vue&type=template&id=d1b91c98&

;// CONCATENATED MODULE: external "@babel/runtime/helpers/defineProperty"
var defineProperty_namespaceObject = require("@babel/runtime/helpers/defineProperty");
var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty_namespaceObject);
;// CONCATENATED MODULE: external "globalthis/implementation"
var implementation_namespaceObject = require("globalthis/implementation");
;// CONCATENATED MODULE: external "lodash/findLastIndex"
var findLastIndex_namespaceObject = require("lodash/findLastIndex");
var findLastIndex_default = /*#__PURE__*/__webpack_require__.n(findLastIndex_namespaceObject);
;// CONCATENATED MODULE: external "lodash/transform"
var transform_namespaceObject = require("lodash/transform");
var transform_default = /*#__PURE__*/__webpack_require__.n(transform_namespaceObject);
;// CONCATENATED MODULE: external "lodash/assign"
var assign_namespaceObject = require("lodash/assign");
var assign_default = /*#__PURE__*/__webpack_require__.n(assign_namespaceObject);
;// CONCATENATED MODULE: external "lodash/isEmpty"
var isEmpty_namespaceObject = require("lodash/isEmpty");
var isEmpty_default = /*#__PURE__*/__webpack_require__.n(isEmpty_namespaceObject);
;// CONCATENATED MODULE: external "lodash/map"
var map_namespaceObject = require("lodash/map");
var map_default = /*#__PURE__*/__webpack_require__.n(map_namespaceObject);
;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./packages/anchor-steps/src/Step.vue?vue&type=template&id=0de36146&
var Stepvue_type_template_id_0de36146_render = function render() {
  var _vm = this,
    _c = _vm._self._c;
  return _c("div", {
    staticClass: "el-step",
    class: [!_vm.isSimple && "is-".concat(_vm.$parent.direction), _vm.isSimple && "is-simple", _vm.isLast && !_vm.space && !_vm.isCenter && "is-flex", _vm.isCenter && !_vm.isVertical && !_vm.isSimple && "is-center", _vm.lineFinish && "line-finish"],
    style: _vm.style
  }, [_c("div", {
    staticClass: "el-step__head",
    class: "is-".concat(_vm.currentStatus),
    on: {
      click: _vm.headClick
    }
  }, [_c("div", {
    staticClass: "el-step__line",
    style: _vm.isLast ? "" : {
      marginRight: _vm.$parent.stepOffset + "px"
    }
  }, [_c("i", {
    staticClass: "el-step__line-inner",
    style: _vm.lineStyle
  })]), _c("div", {
    staticClass: "el-step__icon",
    class: "is-".concat(_vm.icon ? "icon" : "text")
  }, [_vm.currentStatus !== "success" && _vm.currentStatus !== "error" ? _vm._t("icon", function () {
    return [_vm.icon ? _c("i", {
      staticClass: "el-step__icon-inner",
      class: [_vm.icon]
    }) : _vm._e(), !_vm.icon && !_vm.isSimple ? _c("div", {
      staticClass: "el-step__icon-inner"
    }, [_vm._v(_vm._s(_vm.index + 1))]) : _vm._e()];
  }) : _c("i", {
    staticClass: "el-step__icon-inner is-status",
    class: ["el-icon-" + (_vm.currentStatus === "success" ? "check" : "close")]
  })], 2)]), _c("div", {
    staticClass: "el-step__main",
    class: "is-".concat(_vm.currentStatus)
  }, [_c("div", {
    ref: "title",
    staticClass: "el-step__title",
    class: ["is-" + _vm.currentStatus]
  }, [_vm._t("title", function () {
    return [_vm._v(_vm._s(_vm.title))];
  })], 2), _vm.isSimple ? _c("div", {
    staticClass: "el-step__arrow"
  }) : _c("div", {
    staticClass: "el-step__description",
    class: ["is-" + _vm.currentStatus]
  }, [_vm._t("description", function () {
    return [_vm._v(_vm._s(_vm.description))];
  })], 2)])]);
};
var Stepvue_type_template_id_0de36146_staticRenderFns = [];
Stepvue_type_template_id_0de36146_render._withStripped = true;

;// CONCATENATED MODULE: ./packages/anchor-steps/src/Step.vue?vue&type=template&id=0de36146&

;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options!./packages/anchor-steps/src/Step.vue?vue&type=script&lang=js&
/* harmony default export */ var Stepvue_type_script_lang_js_ = ({
  props: {
    title: String,
    icon: String,
    description: String,
    status: String,
    lineFinish: Boolean
  },
  data: function data() {
    return {
      index: -1,
      lineStyle: {},
      internalStatus: ''
    };
  },
  beforeCreate: function beforeCreate() {
    this.$parent.steps.push(this);
  },
  beforeDestroy: function beforeDestroy() {
    var steps = this.$parent.steps;
    var index = steps.indexOf(this);
    if (index >= 0) {
      steps.splice(index, 1);
    }
  },
  computed: {
    currentStatus: function currentStatus() {
      return this.status || this.internalStatus;
    },
    prevStatus: function prevStatus() {
      var prevStep = this.$parent.steps[this.index - 1];
      return prevStep ? prevStep.currentStatus : 'wait';
    },
    isCenter: function isCenter() {
      return this.$parent.alignCenter;
    },
    isVertical: function isVertical() {
      return this.$parent.direction === 'vertical';
    },
    isSimple: function isSimple() {
      return this.$parent.simple;
    },
    isLast: function isLast() {
      var parent = this.$parent;
      return parent.steps[parent.steps.length - 1] === this;
    },
    stepsCount: function stepsCount() {
      return this.$parent.steps.length;
    },
    space: function space() {
      var isSimple = this.isSimple,
        space = this.$parent.space;
      return isSimple ? '' : space;
    },
    style: function style() {
      var style = {};
      var parent = this.$parent;
      var len = parent.steps.length;
      var space = typeof this.space === 'number' ? this.space + 'px' : this.space ? this.space : 100 / (len - (this.isCenter ? 0 : 1)) + '%';
      style.flexBasis = space;
      if (this.isVertical) return style;
      if (this.isLast) {
        style.maxWidth = 100 / this.stepsCount + '%';
      } else {
        style.marginRight = -this.$parent.stepOffset + 'px';
      }
      return style;
    }
  },
  methods: {
    updateStatus: function updateStatus(val) {
      var prevChild = this.$parent.$children[this.index - 1];
      if (val > this.index) {
        this.internalStatus = this.$parent.finishStatus;
      } else if (val === this.index && this.prevStatus !== 'error') {
        this.internalStatus = this.$parent.processStatus;
      } else {
        this.internalStatus = 'wait';
      }
      if (prevChild) prevChild.calcProgress(this.internalStatus);
    },
    calcProgress: function calcProgress(status) {
      var step = 100;
      var style = {};
      style.transitionDelay = 150 * this.index + 'ms';
      if (status === this.$parent.processStatus) {
        step = this.currentStatus !== 'error' ? 0 : 0;
      } else if (status === 'wait') {
        step = 0;
        style.transitionDelay = -150 * this.index + 'ms';
      }
      style.borderWidth = step && !this.isSimple ? '1px' : 0;
      this.$parent.direction === 'vertical' ? style.height = step + '%' : style.width = step + '%';
      this.lineStyle = style;
    },
    headClick: function headClick() {
      this.$emit('headClick');
    }
  },
  mounted: function mounted() {
    var _this = this;
    var unwatch = this.$watch('index', function (val) {
      _this.$watch('$parent.active', _this.updateStatus, {
        immediate: true
      });
      _this.$watch('$parent.processStatus', function () {
        var activeIndex = _this.$parent.active;
        _this.updateStatus(activeIndex);
      }, {
        immediate: true
      });
      unwatch();
    });
  }
});
;// CONCATENATED MODULE: ./packages/anchor-steps/src/Step.vue?vue&type=script&lang=js&
 /* harmony default export */ var src_Stepvue_type_script_lang_js_ = (Stepvue_type_script_lang_js_); 
;// CONCATENATED MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
/* globals __VUE_SSR_CONTEXT__ */

// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
// This module is a runtime utility for cleaner component module output and will
// be included in the final webpack user bundle.

function normalizeComponent(
  scriptExports,
  render,
  staticRenderFns,
  functionalTemplate,
  injectStyles,
  scopeId,
  moduleIdentifier /* server only */,
  shadowMode /* vue-cli only */
) {
  // Vue.extend constructor export interop
  var options =
    typeof scriptExports === 'function' ? scriptExports.options : scriptExports

  // render functions
  if (render) {
    options.render = render
    options.staticRenderFns = staticRenderFns
    options._compiled = true
  }

  // functional template
  if (functionalTemplate) {
    options.functional = true
  }

  // scopedId
  if (scopeId) {
    options._scopeId = 'data-v-' + scopeId
  }

  var hook
  if (moduleIdentifier) {
    // server build
    hook = function (context) {
      // 2.3 injection
      context =
        context || // cached call
        (this.$vnode && this.$vnode.ssrContext) || // stateful
        (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
      // 2.2 with runInNewContext: true
      if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
        context = __VUE_SSR_CONTEXT__
      }
      // inject component styles
      if (injectStyles) {
        injectStyles.call(this, context)
      }
      // register component module identifier for async chunk inferrence
      if (context && context._registeredComponents) {
        context._registeredComponents.add(moduleIdentifier)
      }
    }
    // used by ssr in case component is cached and beforeCreate
    // never gets called
    options._ssrRegister = hook
  } else if (injectStyles) {
    hook = shadowMode
      ? function () {
          injectStyles.call(
            this,
            (options.functional ? this.parent : this).$root.$options.shadowRoot
          )
        }
      : injectStyles
  }

  if (hook) {
    if (options.functional) {
      // for template-only hot-reload because in that case the render fn doesn't
      // go through the normalizer
      options._injectStyles = hook
      // register for functional component in vue file
      var originalRender = options.render
      options.render = function renderWithStyleInjection(h, context) {
        hook.call(context)
        return originalRender(h, context)
      }
    } else {
      // inject component registration as beforeCreate hook
      var existing = options.beforeCreate
      options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
    }
  }

  return {
    exports: scriptExports,
    options: options
  }
}

;// CONCATENATED MODULE: ./packages/anchor-steps/src/Step.vue





/* normalize component */
;
var component = normalizeComponent(
  src_Stepvue_type_script_lang_js_,
  Stepvue_type_template_id_0de36146_render,
  Stepvue_type_template_id_0de36146_staticRenderFns,
  false,
  null,
  null,
  null
  
)

/* harmony default export */ var Step = (component.exports);
;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options!./packages/anchor-steps/src/main.vue?vue&type=script&lang=js&

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { defineProperty_default()(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }







/* harmony default export */ var mainvue_type_script_lang_js_ = ({
  name: 'JdfAnchorSteps',
  components: {
    Step: Step
  },
  props: {
    nodeNameLabel: {
      type: String,
      default: '当前处理状态：'
    },
    nodeName: String,
    // 是否显示步骤标题
    showStepTitle: {
      type: Boolean,
      default: true
    },
    // 是否展示tooltip
    tooltip: {
      type: [Boolean, String],
      default: '点击跳转至对应区域'
    },
    // 步骤列表
    stepList: {
      type: Array,
      default: function _default() {
        return [];
      }
    },
    // 方向
    direction: {
      type: String,
      default: 'horizontal'
    },
    // 单条步骤条的宽度
    singleItemWidth: {
      type: Number,
      default: 180
    }
  },
  data: function data() {
    return {
      // 当前定位
      activeIndex: 0,
      // 锚点定位的各元素距顶部高度数组
      itemTabs: [],
      // 是否刚刚进行过跳转
      isJump: false,
      bodyHeightMut: 0,
      isEmpty: (isEmpty_default()),
      statusStyle: {},
      stepStyle: {}
    };
  },
  watch: {
    stepList: function stepList(val) {
      if (isEmpty_default()(val)) {
        return;
      }
      var stepWidth = val.length * this.singleItemWidth;
      var statusWidth = "".concat(implementation_namespaceObject.document.querySelector('.jdf-anchor-steps').offsetWidth - stepWidth - 7, "px");
      this.statusStyle = {
        width: statusWidth
      };
      this.stepStyle = {
        width: "".concat(stepWidth, "px")
      };
    }
  },
  created: function created() {
    // 监听滚动事件
    implementation_namespaceObject.window.addEventListener('scroll', this.onscroll);
  },
  methods: {
    /**
     * 鼠标滚动时进行锚点定位.
     */
    onscroll: function onscroll() {
      var _window$scrollY;
      if (isEmpty_default()(this.itemTabs)) {
        this.loadElements();
      }
      // 当前滚动条据顶部距离
      var top = (_window$scrollY = implementation_namespaceObject.window.scrollY) !== null && _window$scrollY !== void 0 ? _window$scrollY : implementation_namespaceObject.window.pageYOffset;
      // 获取当前激活的页签 如果刚刚跳转过就不再更改激活页签
      if (!this.isJump) {
        if (top + implementation_namespaceObject.document.documentElement.clientHeight >= implementation_namespaceObject.document.documentElement.scrollHeight) {
          this.activeIndex = this.itemTabs.length - 1;
        } else {
          this.activeIndex = findLastIndex_default()(this.itemTabs, function (it) {
            return top >= it - 30;
          });
        }
      }
      // 更改跳转状态
      this.isJump = false;
    },
    /**
     * 点击鼠标跳到指定的dom
     */
    jump: function jump(anchor, index) {
      this.loadElements();
      // 当前激活的页签
      this.activeIndex = index;
      // 是否刚刚跳转状态为真
      this.isJump = true;
      var scrollTop = this.itemTabs[index] - 30;
      implementation_namespaceObject.document.documentElement.scrollTop = scrollTop;
    },
    loadElements: function loadElements() {
      var _this$$parent$$parent, _this$$parent, _this$$parent$$parent2;
      var parentRefs = this.$parent.$refs;
      var topParentRefs = (_this$$parent$$parent = (_this$$parent = this.$parent) === null || _this$$parent === void 0 ? void 0 : (_this$$parent$$parent2 = _this$$parent.$parent) === null || _this$$parent$$parent2 === void 0 ? void 0 : _this$$parent$$parent2.$refs) !== null && _this$$parent$$parent !== void 0 ? _this$$parent$$parent : [];
      var siblingsRefs = map_default()(this.$parent.$children, function (c) {
        return c.$refs;
      }).filter(function (c) {
        return !isEmpty_default()(c);
      });
      // 将siblingsRefs数组转为对象
      var siblingsRefsObj = transform_default()(siblingsRefs, function (result, value) {
        assign_default()(result, value);
      }, {});
      var refs = _objectSpread(_objectSpread(_objectSpread({}, parentRefs), topParentRefs), siblingsRefsObj);
      if (!refs) {
        return;
      }
      var itemTabs = this.itemTabs;
      this.stepList.forEach(function (item, index) {
        var ref = refs[item.anchor];
        if (!ref) {
          return;
        }
        var ele = ref.$el;
        // eslint-disable-next-line no-nested-ternary
        var offsetTop = index === 0 ? 0 : ele ? ele.offsetTop : ref.offsetTop - 40;
        itemTabs[index] !== offsetTop && (itemTabs[index] = offsetTop);
      });
    },
    getLineFinish: function getLineFinish(index) {
      return index < this.activeIndex;
    }
  }
});
;// CONCATENATED MODULE: ./packages/anchor-steps/src/main.vue?vue&type=script&lang=js&
 /* harmony default export */ var src_mainvue_type_script_lang_js_ = (mainvue_type_script_lang_js_); 
;// CONCATENATED MODULE: ./packages/anchor-steps/src/main.vue





/* normalize component */
;
var main_component = normalizeComponent(
  src_mainvue_type_script_lang_js_,
  render,
  staticRenderFns,
  false,
  null,
  null,
  null
  
)

/* harmony default export */ var main = (main_component.exports);
;// CONCATENATED MODULE: ./packages/anchor-steps/index.js

main.install = function (Vue) {
  Vue.component(main.name, main);
};
/* harmony default export */ var anchor_steps = (main);
module.exports = __webpack_exports__;
/******/ })()
;