@fangzhongya/page 0.0.1 → 0.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.
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 +5 -4
@@ -0,0 +1,161 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const require$$0 = require("vue");
4
+ const gridItem = require("./grid-item-Dp497fop.cjs");
5
+ const getCss = require("@fangzhongya/utils/css/getCss");
6
+ const page = require("./page-z22w7mwk.cjs");
7
+ const index = require("./index-DyWEL-aT.cjs");
8
+ const _sfc_main = /* @__PURE__ */ require$$0.defineComponent({
9
+ __name: "grid-layout",
10
+ props: {
11
+ self: {
12
+ type: Boolean,
13
+ default: false
14
+ },
15
+ autoSize: {
16
+ default: true,
17
+ type: Boolean
18
+ },
19
+ colNum: {
20
+ type: Number,
21
+ default: 24
22
+ },
23
+ layout: {
24
+ type: Array,
25
+ default() {
26
+ return [];
27
+ }
28
+ },
29
+ margin: {
30
+ default: () => [10, 10],
31
+ type: Array
32
+ },
33
+ rowHeight: {
34
+ default: 150,
35
+ type: Number
36
+ },
37
+ useCssTransforms: {
38
+ default: false,
39
+ type: Boolean
40
+ }
41
+ },
42
+ setup(__props) {
43
+ const position = page.enums.position;
44
+ const props = __props;
45
+ const refDom = require$$0.ref();
46
+ const width = require$$0.ref(0);
47
+ const mergedStyle = require$$0.ref({});
48
+ const rowHeight = require$$0.ref(props.rowHeight);
49
+ const getNumber = (dom, key) => {
50
+ return Math.ceil(Number(getCss.getCss(dom, key).replaceAll(/[^0-9.-]/g, "")));
51
+ };
52
+ const maxh = require$$0.computed(() => {
53
+ let h = 0;
54
+ const arr = props.layout || [];
55
+ arr.forEach((v) => {
56
+ const z = v.y + v.h;
57
+ if (z > h) {
58
+ h = z;
59
+ }
60
+ });
61
+ return h;
62
+ });
63
+ const bottom = (layout) => {
64
+ let max = 0;
65
+ let bottomY;
66
+ for (let i = 0; i < layout.length; i++) {
67
+ bottomY = layout[i].y + layout[i].h;
68
+ if (bottomY > max) {
69
+ max = bottomY;
70
+ }
71
+ }
72
+ return max;
73
+ };
74
+ const updateHeight = () => {
75
+ const height = containerHeight();
76
+ mergedStyle.value = { height };
77
+ };
78
+ const containerHeight = () => {
79
+ if (!props.autoSize || !props.layout) return;
80
+ if (props.self) {
81
+ return "100%";
82
+ }
83
+ const m2 = props.margin[1];
84
+ return `${bottom(props.layout) * (props.rowHeight + m2) + m2}px`;
85
+ };
86
+ let t;
87
+ const onWindowResize = () => {
88
+ clearTimeout(t);
89
+ t = setTimeout(() => {
90
+ if (refDom.value) {
91
+ width.value = getNumber(refDom.value, "width");
92
+ if (props.self) {
93
+ const g = maxh.value;
94
+ const m = props.margin[1];
95
+ const h = getNumber(refDom.value, "height");
96
+ const row = (h - (g + 1) * m) / g;
97
+ rowHeight.value = row;
98
+ }
99
+ }
100
+ }, 200);
101
+ };
102
+ const observer = new ResizeObserver((entries) => {
103
+ onWindowResize();
104
+ });
105
+ require$$0.onMounted(() => {
106
+ if (refDom.value) {
107
+ onWindowResize();
108
+ updateHeight();
109
+ observer.observe(refDom.value);
110
+ }
111
+ });
112
+ require$$0.onUnmounted(() => {
113
+ if (refDom.value) {
114
+ observer.unobserve(refDom.value);
115
+ }
116
+ });
117
+ return (_ctx, _cache) => {
118
+ return require$$0.openBlock(), require$$0.createElementBlock("div", {
119
+ ref_key: "refDom",
120
+ ref: refDom,
121
+ class: "grid-layout",
122
+ style: require$$0.normalizeStyle(require$$0.unref(mergedStyle))
123
+ }, [
124
+ require$$0.renderSlot(_ctx.$slots, "default", {
125
+ colNum: props.colNum,
126
+ containerWidth: require$$0.unref(width),
127
+ margin: props.margin,
128
+ useCssTransforms: props.useCssTransforms,
129
+ rowHeight: require$$0.unref(rowHeight)
130
+ }, () => [
131
+ (require$$0.openBlock(true), require$$0.createElementBlock(require$$0.Fragment, null, require$$0.renderList(__props.layout, (item, index2) => {
132
+ return require$$0.openBlock(), require$$0.createBlock(gridItem.default, {
133
+ key: item.i,
134
+ colNum: props.colNum,
135
+ containerWidth: require$$0.unref(width),
136
+ margin: props.margin,
137
+ useCssTransforms: props.useCssTransforms,
138
+ rowHeight: require$$0.unref(rowHeight),
139
+ w: item.w,
140
+ y: item.y,
141
+ h: item.h,
142
+ x: item.x,
143
+ static: item.static
144
+ }, {
145
+ default: require$$0.withCtx(() => [
146
+ require$$0.renderSlot(_ctx.$slots, "item", {
147
+ value: item,
148
+ index: index2
149
+ }, void 0, true)
150
+ ]),
151
+ _: 2
152
+ }, 1032, ["colNum", "containerWidth", "margin", "useCssTransforms", "rowHeight", "w", "y", "h", "x", "static"]);
153
+ }), 128))
154
+ ], true),
155
+ require$$0.renderSlot(_ctx.$slots, require$$0.unref(position), {}, void 0, true)
156
+ ], 4);
157
+ };
158
+ }
159
+ });
160
+ const gridLayout = /* @__PURE__ */ index._export_sfc(_sfc_main, [["__scopeId", "data-v-d4a5d882"]]);
161
+ exports.default = gridLayout;
@@ -0,0 +1,161 @@
1
+ import { defineComponent, ref, computed, onMounted, onUnmounted, createElementBlock, openBlock, normalizeStyle, unref, renderSlot, Fragment, renderList, createBlock, withCtx } from "vue";
2
+ import GridItem from "./grid-item-Cmdo7s5E.js";
3
+ import { getCss } from "@fangzhongya/utils/css/getCss";
4
+ import { e as enums } from "./page-tkDDIngz.js";
5
+ import { _ as _export_sfc } from "./index-DN34gSCV.js";
6
+ const _sfc_main = /* @__PURE__ */ defineComponent({
7
+ __name: "grid-layout",
8
+ props: {
9
+ self: {
10
+ type: Boolean,
11
+ default: false
12
+ },
13
+ autoSize: {
14
+ default: true,
15
+ type: Boolean
16
+ },
17
+ colNum: {
18
+ type: Number,
19
+ default: 24
20
+ },
21
+ layout: {
22
+ type: Array,
23
+ default() {
24
+ return [];
25
+ }
26
+ },
27
+ margin: {
28
+ default: () => [10, 10],
29
+ type: Array
30
+ },
31
+ rowHeight: {
32
+ default: 150,
33
+ type: Number
34
+ },
35
+ useCssTransforms: {
36
+ default: false,
37
+ type: Boolean
38
+ }
39
+ },
40
+ setup(__props) {
41
+ const position = enums.position;
42
+ const props = __props;
43
+ const refDom = ref();
44
+ const width = ref(0);
45
+ const mergedStyle = ref({});
46
+ const rowHeight = ref(props.rowHeight);
47
+ const getNumber = (dom, key) => {
48
+ return Math.ceil(Number(getCss(dom, key).replaceAll(/[^0-9.-]/g, "")));
49
+ };
50
+ const maxh = computed(() => {
51
+ let h = 0;
52
+ const arr = props.layout || [];
53
+ arr.forEach((v) => {
54
+ const z = v.y + v.h;
55
+ if (z > h) {
56
+ h = z;
57
+ }
58
+ });
59
+ return h;
60
+ });
61
+ const bottom = (layout) => {
62
+ let max = 0;
63
+ let bottomY;
64
+ for (let i = 0; i < layout.length; i++) {
65
+ bottomY = layout[i].y + layout[i].h;
66
+ if (bottomY > max) {
67
+ max = bottomY;
68
+ }
69
+ }
70
+ return max;
71
+ };
72
+ const updateHeight = () => {
73
+ const height = containerHeight();
74
+ mergedStyle.value = { height };
75
+ };
76
+ const containerHeight = () => {
77
+ if (!props.autoSize || !props.layout) return;
78
+ if (props.self) {
79
+ return "100%";
80
+ }
81
+ const m2 = props.margin[1];
82
+ return `${bottom(props.layout) * (props.rowHeight + m2) + m2}px`;
83
+ };
84
+ let t;
85
+ const onWindowResize = () => {
86
+ clearTimeout(t);
87
+ t = setTimeout(() => {
88
+ if (refDom.value) {
89
+ width.value = getNumber(refDom.value, "width");
90
+ if (props.self) {
91
+ const g = maxh.value;
92
+ const m = props.margin[1];
93
+ const h = getNumber(refDom.value, "height");
94
+ const row = (h - (g + 1) * m) / g;
95
+ rowHeight.value = row;
96
+ }
97
+ }
98
+ }, 200);
99
+ };
100
+ const observer = new ResizeObserver((entries) => {
101
+ onWindowResize();
102
+ });
103
+ onMounted(() => {
104
+ if (refDom.value) {
105
+ onWindowResize();
106
+ updateHeight();
107
+ observer.observe(refDom.value);
108
+ }
109
+ });
110
+ onUnmounted(() => {
111
+ if (refDom.value) {
112
+ observer.unobserve(refDom.value);
113
+ }
114
+ });
115
+ return (_ctx, _cache) => {
116
+ return openBlock(), createElementBlock("div", {
117
+ ref_key: "refDom",
118
+ ref: refDom,
119
+ class: "grid-layout",
120
+ style: normalizeStyle(unref(mergedStyle))
121
+ }, [
122
+ renderSlot(_ctx.$slots, "default", {
123
+ colNum: props.colNum,
124
+ containerWidth: unref(width),
125
+ margin: props.margin,
126
+ useCssTransforms: props.useCssTransforms,
127
+ rowHeight: unref(rowHeight)
128
+ }, () => [
129
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.layout, (item, index) => {
130
+ return openBlock(), createBlock(GridItem, {
131
+ key: item.i,
132
+ colNum: props.colNum,
133
+ containerWidth: unref(width),
134
+ margin: props.margin,
135
+ useCssTransforms: props.useCssTransforms,
136
+ rowHeight: unref(rowHeight),
137
+ w: item.w,
138
+ y: item.y,
139
+ h: item.h,
140
+ x: item.x,
141
+ static: item.static
142
+ }, {
143
+ default: withCtx(() => [
144
+ renderSlot(_ctx.$slots, "item", {
145
+ value: item,
146
+ index
147
+ }, void 0, true)
148
+ ]),
149
+ _: 2
150
+ }, 1032, ["colNum", "containerWidth", "margin", "useCssTransforms", "rowHeight", "w", "y", "h", "x", "static"]);
151
+ }), 128))
152
+ ], true),
153
+ renderSlot(_ctx.$slots, unref(position), {}, void 0, true)
154
+ ], 4);
155
+ };
156
+ }
157
+ });
158
+ const gridLayout = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-d4a5d882"]]);
159
+ export {
160
+ gridLayout as default
161
+ };
@@ -0,0 +1,6 @@
1
+
2
+ .grid-layout[data-v-d4a5d882] {
3
+ position: relative;
4
+ transition: height 200ms ease;
5
+ background-color: #f2f2f2;
6
+ }
@@ -1,8 +1,8 @@
1
1
  import { defineComponent, createBlock, openBlock, normalizeProps, guardReactiveProps, withCtx, createElementVNode, createVNode, unref } from "vue";
2
2
  import { Window } from "@fangzhongya/fang-ui/components/window/index";
3
- import iconifys from "@fangzhongya/icons/json";
3
+ import { getNames } from "@fangzhongya/icons/name";
4
4
  import Picker from "@fangzhongya/icons/picker/index";
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: "icon",
8
8
  props: {
@@ -33,6 +33,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
33
33
  emits: ["blur"],
34
34
  setup(__props, { emit: __emit }) {
35
35
  const props = __props;
36
+ const iconifys = getNames().map((o) => o.icon);
36
37
  const emit = __emit;
37
38
  return (_ctx, _cache) => {
38
39
  return openBlock(), createBlock(_sfc_main$1, normalizeProps(guardReactiveProps(props)), {
@@ -2,9 +2,9 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const require$$0 = require("vue");
4
4
  const index$1 = require("@fangzhongya/fang-ui/components/window/index");
5
- const iconifys = require("@fangzhongya/icons/json");
5
+ const name = require("@fangzhongya/icons/name");
6
6
  const Picker = require("@fangzhongya/icons/picker/index");
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: "icon",
10
10
  props: {
@@ -35,6 +35,7 @@ const _sfc_main = /* @__PURE__ */ require$$0.defineComponent({
35
35
  emits: ["blur"],
36
36
  setup(__props, { emit: __emit }) {
37
37
  const props = __props;
38
+ const iconifys = name.getNames().map((o) => o.icon);
38
39
  const emit = __emit;
39
40
  return (_ctx, _cache) => {
40
41
  return require$$0.openBlock(), require$$0.createBlock(index._sfc_main, require$$0.normalizeProps(require$$0.guardReactiveProps(props)), {