Grid.js 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. GRID_KEY: () => GRID_KEY,
  21. default: () => stdin_default,
  22. gridProps: () => gridProps
  23. });
  24. module.exports = __toCommonJS(stdin_exports);
  25. var import_vue = require("vue");
  26. var import_vue2 = require("vue");
  27. var import_utils = require("../utils");
  28. var import_constant = require("../utils/constant");
  29. var import_use = require("@vant/use");
  30. const [name, bem] = (0, import_utils.createNamespace)("grid");
  31. const gridProps = {
  32. square: Boolean,
  33. center: import_utils.truthProp,
  34. border: import_utils.truthProp,
  35. gutter: import_utils.numericProp,
  36. reverse: Boolean,
  37. iconSize: import_utils.numericProp,
  38. direction: String,
  39. clickable: Boolean,
  40. columnNum: (0, import_utils.makeNumericProp)(4)
  41. };
  42. const GRID_KEY = Symbol(name);
  43. var stdin_default = (0, import_vue2.defineComponent)({
  44. name,
  45. props: gridProps,
  46. setup(props, {
  47. slots
  48. }) {
  49. const {
  50. linkChildren
  51. } = (0, import_use.useChildren)(GRID_KEY);
  52. linkChildren({
  53. props
  54. });
  55. return () => {
  56. var _a;
  57. return (0, import_vue.createVNode)("div", {
  58. "style": {
  59. paddingLeft: (0, import_utils.addUnit)(props.gutter)
  60. },
  61. "class": [bem(), {
  62. [import_constant.BORDER_TOP]: props.border && !props.gutter
  63. }]
  64. }, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
  65. };
  66. }
  67. });