Steps.js 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. var __defProp = Object.defineProperty;
  2. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  3. var __getOwnPropNames = Object.getOwnPropertyNames;
  4. var __hasOwnProp = Object.prototype.hasOwnProperty;
  5. var __export = (target, all) => {
  6. for (var name2 in all)
  7. __defProp(target, name2, { get: all[name2], enumerable: true });
  8. };
  9. var __copyProps = (to, from, except, desc) => {
  10. if (from && typeof from === "object" || typeof from === "function") {
  11. for (let key of __getOwnPropNames(from))
  12. if (!__hasOwnProp.call(to, key) && key !== except)
  13. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  14. }
  15. return to;
  16. };
  17. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  18. var stdin_exports = {};
  19. __export(stdin_exports, {
  20. STEPS_KEY: () => STEPS_KEY,
  21. default: () => stdin_default
  22. });
  23. module.exports = __toCommonJS(stdin_exports);
  24. var import_vue = require("vue");
  25. var import_vue2 = require("vue");
  26. var import_utils = require("../utils");
  27. var import_use = require("@vant/use");
  28. const [name, bem] = (0, import_utils.createNamespace)("steps");
  29. const stepsProps = {
  30. active: (0, import_utils.makeNumericProp)(0),
  31. direction: (0, import_utils.makeStringProp)("horizontal"),
  32. activeIcon: (0, import_utils.makeStringProp)("checked"),
  33. iconPrefix: String,
  34. finishIcon: String,
  35. activeColor: String,
  36. inactiveIcon: String,
  37. inactiveColor: String
  38. };
  39. const STEPS_KEY = Symbol(name);
  40. var stdin_default = (0, import_vue2.defineComponent)({
  41. name,
  42. props: stepsProps,
  43. emits: ["click-step"],
  44. setup(props, {
  45. emit,
  46. slots
  47. }) {
  48. const {
  49. linkChildren
  50. } = (0, import_use.useChildren)(STEPS_KEY);
  51. const onClickStep = (index) => emit("click-step", index);
  52. linkChildren({
  53. props,
  54. onClickStep
  55. });
  56. return () => {
  57. var _a;
  58. return (0, import_vue.createVNode)("div", {
  59. "class": bem([props.direction])
  60. }, [(0, import_vue.createVNode)("div", {
  61. "class": bem("items")
  62. }, [(_a = slots.default) == null ? void 0 : _a.call(slots)])]);
  63. };
  64. }
  65. });