@fangzhongya/page 0.0.1 → 0.0.3

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.
Files changed (60) hide show
  1. package/dist/{array-DF5dKg_I.js → array-DNzTqnWI.js} +1 -1
  2. package/dist/{array-BVDKMOD7.cjs → array-m4xM7bY6.cjs} +1 -1
  3. package/dist/{boolean-CRnQP8xw.cjs → boolean-BrAyoMWr.cjs} +1 -1
  4. package/dist/{boolean-_6yy8HAk.js → boolean-O7ClnMtA.js} +1 -1
  5. package/dist/{button-editor-CcDUGH-p.js → button-editor-B9Hwtqh3.js} +1 -1
  6. package/dist/{button-editor-CAoFo90o.cjs → button-editor-C5HmDQZY.cjs} +1 -1
  7. package/dist/{choice-C2EtQx15.cjs → choice-C2_KDs8f.cjs} +1 -1
  8. package/dist/{choice-Da0KhSqy.js → choice-DfHgWwQd.js} +1 -1
  9. package/dist/{class-D4wqwdp6.cjs → class-D5OY1alc.cjs} +1 -1
  10. package/dist/{class-DEhbKupu.js → class-wYp7_2ao.js} +1 -1
  11. package/dist/{code-ByDX8VyE.js → code-BR3C6XHK.js} +1 -1
  12. package/dist/{code-D_c8L97a.cjs → code-Bi6mCasH.cjs} +1 -1
  13. package/dist/{codes-JsogPxe_.js → codes-4Mb8F7yh.js} +1 -1
  14. package/dist/{codes-SsHelxy1.cjs → codes-CUdIl60P.cjs} +1 -1
  15. package/dist/{color-C_tr4O7e.cjs → color-BmeGoq56.cjs} +1 -1
  16. package/dist/{color-BkNnjOah.js → color-DiUa8kw0.js} +1 -1
  17. package/dist/container-MDOC4zc5.cjs +25 -0
  18. package/dist/container-pN3_xq6I.js +25 -0
  19. package/dist/{editor-DalhYR-Q.js → editor-B4tRH4Du.js} +2 -2
  20. package/dist/{editor-BYMhYIRN.cjs → editor-DPwBedZ2.cjs} +2 -2
  21. package/dist/{emits-Bw0lbdTu.cjs → emits-B7KwdqmA.cjs} +1 -1
  22. package/dist/{emits-Dbd3qZ6W.js → emits-CHkGnd-Y.js} +2 -2
  23. package/dist/{emits-BMijilxI.cjs → emits-Ca-GNz_C.cjs} +2 -2
  24. package/dist/{emits-KNWePDCi.js → emits-D2Rl4rjw.js} +1 -1
  25. package/dist/{general-CxOdXWgx.js → general-DxwEYB6g.js} +1 -1
  26. package/dist/{general-CSPNay-X.cjs → general-UJlyOZvQ.cjs} +1 -1
  27. package/dist/grid-item-Cmdo7s5E.js +121 -0
  28. package/dist/grid-item-Dp497fop.cjs +121 -0
  29. package/dist/grid-item.css +4 -0
  30. package/dist/grid-layout-T6cqoGHe.cjs +161 -0
  31. package/dist/grid-layout-eQkarQXt.js +161 -0
  32. package/dist/grid-layout.css +6 -0
  33. package/dist/{icon-CLpX27eC.js → icon-Df2JcOTJ.js} +3 -2
  34. package/dist/{icon-Dsqcps7B.cjs → icon-pkpHgiKt.cjs} +3 -2
  35. package/dist/{index-wb1Ag0of.js → index-DN34gSCV.js} +757 -623
  36. package/dist/{index-C5atHkSE.cjs → index-DyWEL-aT.cjs} +905 -771
  37. package/dist/index.cjs +2 -2
  38. package/dist/index.css +0 -10
  39. package/dist/index.js +3 -3
  40. package/dist/{number-BmVW8K_E.js → number-C3VpEtV8.js} +1 -1
  41. package/dist/{number-sHlMr3LR.cjs → number-CflHfHtP.cjs} +1 -1
  42. package/dist/{object-vWWUhwjq.js → object-DBCu1gwK.js} +1 -1
  43. package/dist/{object-Bb9KeI-8.cjs → object-ozr75zb0.cjs} +1 -1
  44. package/dist/{page-COadbdNM.js → page-tkDDIngz.js} +199 -290
  45. package/dist/{page-DEhMa4kp.cjs → page-z22w7mwk.cjs} +185 -276
  46. package/dist/page.cjs +1 -1
  47. package/dist/page.js +2 -2
  48. package/dist/position-kgl0BpQL.cjs +28 -0
  49. package/dist/position-whWAuF4H.js +28 -0
  50. package/dist/{props-DDXfZarK.js → props-6xREXIbi.js} +1 -1
  51. package/dist/{props-CQPBTWY-.cjs → props-D7vQsQVi.cjs} +1 -1
  52. package/dist/{slots-DixInFAv.cjs → slots-Bh6P4SS6.cjs} +1 -1
  53. package/dist/{slots-DTHucbpJ.js → slots-CEcjOaFL.js} +1 -1
  54. package/dist/{string-Cb09VE7i.cjs → string-Cj2nmHmv.cjs} +1 -1
  55. package/dist/{string-XxsCUm0A.js → string-DnjyAONX.js} +1 -1
  56. package/dist/{style-CZJA2xg_.cjs → style-CfAbL6Bz.cjs} +1 -1
  57. package/dist/{style-Bj6ckwYY.js → style-D0hLGzVR.js} +1 -1
  58. package/dist/{style-2VtVKyIu.cjs → style-IOBZgXpF.cjs} +2 -2
  59. package/dist/{style-CARwnhEM.js → style-c2dTkxib.js} +2 -2
  60. package/package.json +9 -7
@@ -1,7 +1,7 @@
1
1
  import { EditData } from "@fangzhongya/fang-ui/components/edit-data/index";
2
2
  import "@fangzhongya/fang-ui/components/edit-data/style/index2.scss";
3
3
  import { defineComponent, createBlock, openBlock, normalizeProps, guardReactiveProps, withCtx, createVNode } from "vue";
4
- import { _ as _sfc_main$1 } from "./index-wb1Ag0of.js";
4
+ import { a as _sfc_main$1 } from "./index-DN34gSCV.js";
5
5
  const _sfc_main = /* @__PURE__ */ defineComponent({
6
6
  __name: "array",
7
7
  props: {
@@ -3,7 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const index$1 = require("@fangzhongya/fang-ui/components/edit-data/index");
4
4
  require("@fangzhongya/fang-ui/components/edit-data/style/index2.scss");
5
5
  const require$$0 = require("vue");
6
- const index = require("./index-C5atHkSE.cjs");
6
+ const index = require("./index-DyWEL-aT.cjs");
7
7
  const _sfc_main = /* @__PURE__ */ require$$0.defineComponent({
8
8
  __name: "array",
9
9
  props: {
@@ -3,7 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const index$1 = require("@fangzhongya/fang-ui/components/switch/index");
4
4
  require("@fangzhongya/fang-ui/components/switch/style/index2.scss");
5
5
  const require$$0 = require("vue");
6
- const index = require("./index-C5atHkSE.cjs");
6
+ const index = require("./index-DyWEL-aT.cjs");
7
7
  const _sfc_main = /* @__PURE__ */ require$$0.defineComponent({
8
8
  __name: "boolean",
9
9
  props: {
@@ -1,7 +1,7 @@
1
1
  import { Switch } from "@fangzhongya/fang-ui/components/switch/index";
2
2
  import "@fangzhongya/fang-ui/components/switch/style/index2.scss";
3
3
  import { defineComponent, createBlock, openBlock, normalizeProps, guardReactiveProps, withCtx, createVNode, mergeProps } from "vue";
4
- import { _ as _sfc_main$1 } from "./index-wb1Ag0of.js";
4
+ import { a as _sfc_main$1 } from "./index-DN34gSCV.js";
5
5
  const _sfc_main = /* @__PURE__ */ defineComponent({
6
6
  __name: "boolean",
7
7
  props: {
@@ -1,7 +1,7 @@
1
1
  import { Button } from "@fangzhongya/fang-ui/components/button/index";
2
2
  import "@fangzhongya/fang-ui/components/button/style/index2.scss";
3
3
  import { defineComponent, inject, createElementBlock, openBlock, withModifiers, normalizeClass, unref, renderSlot, createBlock, withCtx, createTextVNode, toDisplayString, createElementVNode, nextTick } from "vue";
4
- import { g as getClass } from "./index-wb1Ag0of.js";
4
+ import { g as getClass } from "./index-DN34gSCV.js";
5
5
  const _sfc_main = /* @__PURE__ */ defineComponent({
6
6
  __name: "button-editor",
7
7
  props: {
@@ -2,7 +2,7 @@
2
2
  const index$1 = require("@fangzhongya/fang-ui/components/button/index");
3
3
  require("@fangzhongya/fang-ui/components/button/style/index2.scss");
4
4
  const require$$0 = require("vue");
5
- const index = require("./index-C5atHkSE.cjs");
5
+ const index = require("./index-DyWEL-aT.cjs");
6
6
  const _sfc_main = /* @__PURE__ */ require$$0.defineComponent({
7
7
  __name: "button-editor",
8
8
  props: {
@@ -5,7 +5,7 @@ require("element-plus/es/components/base/style/css");
5
5
  require("element-plus/es/components/select/style/css");
6
6
  require("element-plus/es/components/option/style/css");
7
7
  const require$$0 = require("vue");
8
- const index = require("./index-C5atHkSE.cjs");
8
+ const index = require("./index-DyWEL-aT.cjs");
9
9
  const _sfc_main = /* @__PURE__ */ require$$0.defineComponent({
10
10
  __name: "choice",
11
11
  props: {
@@ -3,7 +3,7 @@ import "element-plus/es/components/base/style/css";
3
3
  import "element-plus/es/components/select/style/css";
4
4
  import "element-plus/es/components/option/style/css";
5
5
  import { defineComponent, createBlock, openBlock, normalizeProps, guardReactiveProps, withCtx, createVNode, createElementBlock, Fragment, renderList } from "vue";
6
- import { _ as _sfc_main$1 } from "./index-wb1Ag0of.js";
6
+ import { a as _sfc_main$1 } from "./index-DN34gSCV.js";
7
7
  const _sfc_main = /* @__PURE__ */ defineComponent({
8
8
  __name: "choice",
9
9
  props: {
@@ -5,7 +5,7 @@ require("element-plus/es/components/base/style/css");
5
5
  require("element-plus/es/components/select/style/css");
6
6
  require("element-plus/es/components/option/style/css");
7
7
  const require$$0 = require("vue");
8
- const index = require("./index-C5atHkSE.cjs");
8
+ const index = require("./index-DyWEL-aT.cjs");
9
9
  const _sfc_main = /* @__PURE__ */ require$$0.defineComponent({
10
10
  __name: "class",
11
11
  props: {
@@ -3,7 +3,7 @@ import "element-plus/es/components/base/style/css";
3
3
  import "element-plus/es/components/select/style/css";
4
4
  import "element-plus/es/components/option/style/css";
5
5
  import { defineComponent, inject, computed, createBlock, openBlock, unref, isRef, withCtx, createElementBlock, Fragment, renderList } from "vue";
6
- import { e as extractCssClass } from "./index-wb1Ag0of.js";
6
+ import { e as extractCssClass } from "./index-DN34gSCV.js";
7
7
  const _sfc_main = /* @__PURE__ */ defineComponent({
8
8
  __name: "class",
9
9
  props: {
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, ref, createBlock, openBlock, mergeProps, unref, isRef, withCtx, createVNode } from "vue";
2
- import { a as _sfc_main$1, b as _sfc_main$2 } from "./index-wb1Ag0of.js";
2
+ import { b as _sfc_main$1, c as _sfc_main$2 } from "./index-DN34gSCV.js";
3
3
  const _sfc_main = /* @__PURE__ */ defineComponent({
4
4
  __name: "code",
5
5
  props: {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const require$$0 = require("vue");
4
- const index = require("./index-C5atHkSE.cjs");
4
+ const index = require("./index-DyWEL-aT.cjs");
5
5
  const _sfc_main = /* @__PURE__ */ require$$0.defineComponent({
6
6
  __name: "code",
7
7
  props: {
@@ -9,7 +9,7 @@ import "@fangzhongya/fang-ui/components/button/style/index2.scss";
9
9
  import { Inputs } from "@fangzhongya/fang-ui/components/inputs/index";
10
10
  import "@fangzhongya/fang-ui/components/inputs/style/index2.scss";
11
11
  import { defineComponent, ref, createElementBlock, openBlock, createVNode, mergeProps, unref, isRef, withCtx, createTextVNode, createCommentVNode, createElementVNode, Fragment } from "vue";
12
- import { a as _sfc_main$1, D as Draggable, b as _sfc_main$2 } from "./index-wb1Ag0of.js";
12
+ import { b as _sfc_main$1, D as Draggable, c as _sfc_main$2 } from "./index-DN34gSCV.js";
13
13
  const _hoisted_1 = { class: "handle codes-li" };
14
14
  const _hoisted_2 = { key: 0 };
15
15
  const _hoisted_3 = { class: "codes-box" };
@@ -11,7 +11,7 @@ require("@fangzhongya/fang-ui/components/button/style/index2.scss");
11
11
  const index$2 = require("@fangzhongya/fang-ui/components/inputs/index");
12
12
  require("@fangzhongya/fang-ui/components/inputs/style/index2.scss");
13
13
  const require$$0 = require("vue");
14
- const index = require("./index-C5atHkSE.cjs");
14
+ const index = require("./index-DyWEL-aT.cjs");
15
15
  const _hoisted_1 = { class: "handle codes-li" };
16
16
  const _hoisted_2 = { key: 0 };
17
17
  const _hoisted_3 = { class: "codes-box" };
@@ -4,7 +4,7 @@ const es = require("element-plus/es");
4
4
  require("element-plus/es/components/base/style/css");
5
5
  require("element-plus/es/components/color-picker/style/css");
6
6
  const require$$0 = require("vue");
7
- const index = require("./index-C5atHkSE.cjs");
7
+ const index = require("./index-DyWEL-aT.cjs");
8
8
  const _sfc_main = /* @__PURE__ */ require$$0.defineComponent({
9
9
  __name: "color",
10
10
  props: {
@@ -2,7 +2,7 @@ import { ElColorPicker } from "element-plus/es";
2
2
  import "element-plus/es/components/base/style/css";
3
3
  import "element-plus/es/components/color-picker/style/css";
4
4
  import { defineComponent, createBlock, openBlock, normalizeProps, guardReactiveProps, withCtx, createVNode } from "vue";
5
- import { _ as _sfc_main$1 } from "./index-wb1Ag0of.js";
5
+ import { a as _sfc_main$1 } from "./index-DN34gSCV.js";
6
6
  const _sfc_main = /* @__PURE__ */ defineComponent({
7
7
  __name: "color",
8
8
  props: {
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const require$$0 = require("vue");
4
+ const _sfc_main = /* @__PURE__ */ require$$0.defineComponent({
5
+ __name: "container",
6
+ props: {
7
+ height: {
8
+ type: [String, Number],
9
+ default: "100%"
10
+ }
11
+ },
12
+ setup(__props) {
13
+ const props = __props;
14
+ return (_ctx, _cache) => {
15
+ return require$$0.openBlock(), require$$0.createElementBlock("div", {
16
+ style: require$$0.normalizeStyle({
17
+ height: props.height
18
+ })
19
+ }, [
20
+ require$$0.renderSlot(_ctx.$slots, "default")
21
+ ], 4);
22
+ };
23
+ }
24
+ });
25
+ exports.default = _sfc_main;
@@ -0,0 +1,25 @@
1
+ import { defineComponent, createElementBlock, openBlock, normalizeStyle, renderSlot } from "vue";
2
+ const _sfc_main = /* @__PURE__ */ defineComponent({
3
+ __name: "container",
4
+ props: {
5
+ height: {
6
+ type: [String, Number],
7
+ default: "100%"
8
+ }
9
+ },
10
+ setup(__props) {
11
+ const props = __props;
12
+ return (_ctx, _cache) => {
13
+ return openBlock(), createElementBlock("div", {
14
+ style: normalizeStyle({
15
+ height: props.height
16
+ })
17
+ }, [
18
+ renderSlot(_ctx.$slots, "default")
19
+ ], 4);
20
+ };
21
+ }
22
+ });
23
+ export {
24
+ _sfc_main as default
25
+ };
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, createBlock, openBlock, normalizeProps, guardReactiveProps, withCtx, createVNode, mergeProps } from "vue";
2
- import { _ as _sfc_main$1 } from "./index-wb1Ag0of.js";
3
- import { _ as _sfc_main$2 } from "./button-editor-CcDUGH-p.js";
2
+ import { a as _sfc_main$1 } from "./index-DN34gSCV.js";
3
+ import { _ as _sfc_main$2 } from "./button-editor-B9Hwtqh3.js";
4
4
  const _sfc_main = /* @__PURE__ */ defineComponent({
5
5
  __name: "editor",
6
6
  props: {
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const require$$0 = require("vue");
4
- const index = require("./index-C5atHkSE.cjs");
5
- const buttonEditor = require("./button-editor-CAoFo90o.cjs");
4
+ const index = require("./index-DyWEL-aT.cjs");
5
+ const buttonEditor = require("./button-editor-C5HmDQZY.cjs");
6
6
  const _sfc_main = /* @__PURE__ */ require$$0.defineComponent({
7
7
  __name: "editor",
8
8
  props: {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const require$$0 = require("vue");
4
- const index = require("./index-C5atHkSE.cjs");
4
+ const index = require("./index-DyWEL-aT.cjs");
5
5
  const _sfc_main = /* @__PURE__ */ require$$0.defineComponent({
6
6
  __name: "emits",
7
7
  props: {
@@ -2,8 +2,8 @@ import { ElButton } from "element-plus/es";
2
2
  import "element-plus/es/components/base/style/css";
3
3
  import "element-plus/es/components/button/style/css";
4
4
  import { defineComponent, createBlock, openBlock, normalizeProps, guardReactiveProps, withCtx, createVNode, createElementBlock, createCommentVNode, renderSlot, createTextVNode } from "vue";
5
- import { _ as _sfc_main$1 } from "./index-wb1Ag0of.js";
6
- import { _ as _sfc_main$2 } from "./button-editor-CcDUGH-p.js";
5
+ import { a as _sfc_main$1 } from "./index-DN34gSCV.js";
6
+ import { _ as _sfc_main$2 } from "./button-editor-B9Hwtqh3.js";
7
7
  const _hoisted_1 = { key: 0 };
8
8
  const _sfc_main = /* @__PURE__ */ defineComponent({
9
9
  __name: "emits",
@@ -4,8 +4,8 @@ const es = require("element-plus/es");
4
4
  require("element-plus/es/components/base/style/css");
5
5
  require("element-plus/es/components/button/style/css");
6
6
  const require$$0 = require("vue");
7
- const index = require("./index-C5atHkSE.cjs");
8
- const buttonEditor = require("./button-editor-CAoFo90o.cjs");
7
+ const index = require("./index-DyWEL-aT.cjs");
8
+ const buttonEditor = require("./button-editor-C5HmDQZY.cjs");
9
9
  const _hoisted_1 = { key: 0 };
10
10
  const _sfc_main = /* @__PURE__ */ require$$0.defineComponent({
11
11
  __name: "emits",
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, computed, createBlock, openBlock, unref, isRef } from "vue";
2
- import { b as _sfc_main$1 } from "./index-wb1Ag0of.js";
2
+ import { c as _sfc_main$1 } from "./index-DN34gSCV.js";
3
3
  const _sfc_main = /* @__PURE__ */ defineComponent({
4
4
  __name: "emits",
5
5
  props: {
@@ -1,7 +1,7 @@
1
1
  import { EditData } from "@fangzhongya/fang-ui/components/edit-data/index";
2
2
  import "@fangzhongya/fang-ui/components/edit-data/style/index2.scss";
3
3
  import { defineComponent, createBlock, openBlock, normalizeProps, guardReactiveProps, withCtx, createVNode } from "vue";
4
- import { _ as _sfc_main$1 } from "./index-wb1Ag0of.js";
4
+ import { a as _sfc_main$1 } from "./index-DN34gSCV.js";
5
5
  const _sfc_main = /* @__PURE__ */ defineComponent({
6
6
  __name: "general",
7
7
  props: {
@@ -3,7 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const index$1 = require("@fangzhongya/fang-ui/components/edit-data/index");
4
4
  require("@fangzhongya/fang-ui/components/edit-data/style/index2.scss");
5
5
  const require$$0 = require("vue");
6
- const index = require("./index-C5atHkSE.cjs");
6
+ const index = require("./index-DyWEL-aT.cjs");
7
7
  const _sfc_main = /* @__PURE__ */ require$$0.defineComponent({
8
8
  __name: "general",
9
9
  props: {
@@ -0,0 +1,121 @@
1
+ import { defineComponent, ref, reactive, watch, createElementBlock, openBlock, normalizeStyle, unref, renderSlot } from "vue";
2
+ import { _ as _export_sfc } from "./index-DN34gSCV.js";
3
+ const _sfc_main = /* @__PURE__ */ defineComponent({
4
+ __name: "grid-item",
5
+ props: {
6
+ colNum: {
7
+ required: true,
8
+ type: Number
9
+ },
10
+ containerWidth: {
11
+ required: true,
12
+ type: Number
13
+ },
14
+ h: {
15
+ required: true,
16
+ type: Number
17
+ },
18
+ w: {
19
+ required: true,
20
+ type: Number
21
+ },
22
+ x: {
23
+ required: true,
24
+ type: Number
25
+ },
26
+ y: {
27
+ required: true,
28
+ type: Number
29
+ },
30
+ margin: {
31
+ required: true,
32
+ type: Array
33
+ },
34
+ rowHeight: {
35
+ required: true,
36
+ type: Number
37
+ },
38
+ static: {
39
+ default: false,
40
+ type: Boolean
41
+ },
42
+ useCssTransforms: {
43
+ type: Boolean,
44
+ default: false
45
+ }
46
+ },
47
+ setup(__props, { expose: __expose }) {
48
+ const props = __props;
49
+ const inner = ref({
50
+ h: props.h,
51
+ w: props.w,
52
+ x: props.x,
53
+ y: props.y
54
+ });
55
+ const style = reactive({ props: {} });
56
+ const cols = ref(props.colNum);
57
+ const setTopLeft = (top, left, width, height) => ({
58
+ height: `${height}px`,
59
+ left: `${left}px`,
60
+ position: "absolute",
61
+ top: `${top}px`,
62
+ width: `${width}px`
63
+ });
64
+ const setTransform = (top, left, width, height) => ({
65
+ height: `${height}px`,
66
+ position: "absolute",
67
+ transform: `translate3d(${left}px,${top}px, 0)`,
68
+ width: `${width}px`
69
+ });
70
+ const calcColWidth = () => {
71
+ const m1 = props.margin?.[0] || 0;
72
+ return (props.containerWidth - m1 * (cols.value + 1)) / cols.value;
73
+ };
74
+ const calcPosition = (x, y, w, h) => {
75
+ const colWidth = calcColWidth();
76
+ const m1 = props.margin?.[0] || 0;
77
+ const m2 = props.margin?.[1] || 0;
78
+ return {
79
+ height: h === Infinity ? h : Math.round(props.rowHeight * h + Math.max(0, h - 1) * m2),
80
+ left: Math.round(colWidth * x + (x + 1) * m2),
81
+ top: Math.round(props.rowHeight * y + (y + 1) * m2),
82
+ width: w === Infinity ? w : Math.round(colWidth * w + Math.max(0, w - 1) * m1)
83
+ };
84
+ };
85
+ const createStyle = () => {
86
+ const pos = calcPosition(
87
+ inner.value.x,
88
+ inner.value.y,
89
+ inner.value.w,
90
+ inner.value.h
91
+ );
92
+ if (props.x + props.w > cols.value) {
93
+ inner.value.x = 0;
94
+ inner.value.w = props.w > cols.value ? cols.value : props.w;
95
+ } else {
96
+ inner.value.x = props.x;
97
+ inner.value.w = props.w;
98
+ }
99
+ style.props = props.useCssTransforms ? setTransform(pos.top, pos.left, pos.width, pos.height) : setTopLeft(pos.top, pos.left, pos.width, pos.height);
100
+ };
101
+ createStyle();
102
+ watch([() => props.rowHeight, () => props.containerWidth], (value) => {
103
+ createStyle();
104
+ });
105
+ __expose({
106
+ createStyle
107
+ });
108
+ return (_ctx, _cache) => {
109
+ return openBlock(), createElementBlock("div", {
110
+ class: "grid-item",
111
+ style: normalizeStyle(unref(style).props)
112
+ }, [
113
+ renderSlot(_ctx.$slots, "default", {}, void 0, true)
114
+ ], 4);
115
+ };
116
+ }
117
+ });
118
+ const GridItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-130c2b70"]]);
119
+ export {
120
+ GridItem as default
121
+ };
@@ -0,0 +1,121 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const require$$0 = require("vue");
4
+ const index = require("./index-DyWEL-aT.cjs");
5
+ const _sfc_main = /* @__PURE__ */ require$$0.defineComponent({
6
+ __name: "grid-item",
7
+ props: {
8
+ colNum: {
9
+ required: true,
10
+ type: Number
11
+ },
12
+ containerWidth: {
13
+ required: true,
14
+ type: Number
15
+ },
16
+ h: {
17
+ required: true,
18
+ type: Number
19
+ },
20
+ w: {
21
+ required: true,
22
+ type: Number
23
+ },
24
+ x: {
25
+ required: true,
26
+ type: Number
27
+ },
28
+ y: {
29
+ required: true,
30
+ type: Number
31
+ },
32
+ margin: {
33
+ required: true,
34
+ type: Array
35
+ },
36
+ rowHeight: {
37
+ required: true,
38
+ type: Number
39
+ },
40
+ static: {
41
+ default: false,
42
+ type: Boolean
43
+ },
44
+ useCssTransforms: {
45
+ type: Boolean,
46
+ default: false
47
+ }
48
+ },
49
+ setup(__props, { expose: __expose }) {
50
+ const props = __props;
51
+ const inner = require$$0.ref({
52
+ h: props.h,
53
+ w: props.w,
54
+ x: props.x,
55
+ y: props.y
56
+ });
57
+ const style = require$$0.reactive({ props: {} });
58
+ const cols = require$$0.ref(props.colNum);
59
+ const setTopLeft = (top, left, width, height) => ({
60
+ height: `${height}px`,
61
+ left: `${left}px`,
62
+ position: "absolute",
63
+ top: `${top}px`,
64
+ width: `${width}px`
65
+ });
66
+ const setTransform = (top, left, width, height) => ({
67
+ height: `${height}px`,
68
+ position: "absolute",
69
+ transform: `translate3d(${left}px,${top}px, 0)`,
70
+ width: `${width}px`
71
+ });
72
+ const calcColWidth = () => {
73
+ const m1 = props.margin?.[0] || 0;
74
+ return (props.containerWidth - m1 * (cols.value + 1)) / cols.value;
75
+ };
76
+ const calcPosition = (x, y, w, h) => {
77
+ const colWidth = calcColWidth();
78
+ const m1 = props.margin?.[0] || 0;
79
+ const m2 = props.margin?.[1] || 0;
80
+ return {
81
+ height: h === Infinity ? h : Math.round(props.rowHeight * h + Math.max(0, h - 1) * m2),
82
+ left: Math.round(colWidth * x + (x + 1) * m2),
83
+ top: Math.round(props.rowHeight * y + (y + 1) * m2),
84
+ width: w === Infinity ? w : Math.round(colWidth * w + Math.max(0, w - 1) * m1)
85
+ };
86
+ };
87
+ const createStyle = () => {
88
+ const pos = calcPosition(
89
+ inner.value.x,
90
+ inner.value.y,
91
+ inner.value.w,
92
+ inner.value.h
93
+ );
94
+ if (props.x + props.w > cols.value) {
95
+ inner.value.x = 0;
96
+ inner.value.w = props.w > cols.value ? cols.value : props.w;
97
+ } else {
98
+ inner.value.x = props.x;
99
+ inner.value.w = props.w;
100
+ }
101
+ style.props = props.useCssTransforms ? setTransform(pos.top, pos.left, pos.width, pos.height) : setTopLeft(pos.top, pos.left, pos.width, pos.height);
102
+ };
103
+ createStyle();
104
+ require$$0.watch([() => props.rowHeight, () => props.containerWidth], (value) => {
105
+ createStyle();
106
+ });
107
+ __expose({
108
+ createStyle
109
+ });
110
+ return (_ctx, _cache) => {
111
+ return require$$0.openBlock(), require$$0.createElementBlock("div", {
112
+ class: "grid-item",
113
+ style: require$$0.normalizeStyle(require$$0.unref(style).props)
114
+ }, [
115
+ require$$0.renderSlot(_ctx.$slots, "default", {}, void 0, true)
116
+ ], 4);
117
+ };
118
+ }
119
+ });
120
+ const GridItem = /* @__PURE__ */ index._export_sfc(_sfc_main, [["__scopeId", "data-v-130c2b70"]]);
121
+ exports.default = GridItem;
@@ -0,0 +1,4 @@
1
+
2
+ .grid-item[data-v-130c2b70] {
3
+ background-color: #fff;
4
+ }