@oneflowui/ui 0.6.0 → 0.8.0

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 (27) hide show
  1. package/dist/components/Dashboard/index.vue.d.ts +3 -1
  2. package/dist/components/Dashboard/index.vue.js +2 -2
  3. package/dist/components/Dashboard/index.vue2.js +59 -30
  4. package/dist/components/database/DatabaseView.vue.js +4 -4
  5. package/dist/components/database/DatabaseView.vue2.js +597 -442
  6. package/dist/components/detail/DetailLayout.vue.d.ts +12 -1
  7. package/dist/components/detail/DetailLayout.vue.js +2 -2
  8. package/dist/components/detail/DetailLayout.vue2.js +115 -68
  9. package/dist/components/gallery/GalleryView.vue.d.ts +3 -1
  10. package/dist/components/gallery/GalleryView.vue.js +2 -2
  11. package/dist/components/gallery/GalleryView.vue2.js +51 -27
  12. package/dist/components/overlay/Drawer.vue.d.ts +10 -0
  13. package/dist/components/overlay/Drawer.vue.js +1 -1
  14. package/dist/components/overlay/Drawer.vue2.js +74 -48
  15. package/dist/components/overlay/SidePanel.vue.d.ts +8 -0
  16. package/dist/components/overlay/SidePanel.vue.js +2 -2
  17. package/dist/components/overlay/SidePanel.vue2.js +97 -65
  18. package/dist/components/table/DataTable.vue.d.ts +32 -2
  19. package/dist/components/table/DataTable.vue.js +3 -3
  20. package/dist/components/table/DataTable.vue2.js +751 -609
  21. package/dist/components/table/FieldCell.vue.js +2 -2
  22. package/dist/components/table/FieldCell.vue2.js +26 -24
  23. package/dist/components/table/TableDataRow.vue.d.ts +19 -0
  24. package/dist/components/table/TableDataRow.vue.js +3 -3
  25. package/dist/components/table/TableDataRow.vue2.js +110 -73
  26. package/dist/style.css +1 -1
  27. package/package.json +1 -1
@@ -20,5 +20,7 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
20
20
  columns: number;
21
21
  gap: number;
22
22
  widgets: DashboardWidget[];
23
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLElement>;
23
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
24
+ dashboardRef: HTMLElement;
25
+ }, HTMLElement>;
24
26
  export default _default;
@@ -1,7 +1,7 @@
1
1
  import o from "./index.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const _ = /* @__PURE__ */ t(o, [["__scopeId", "data-v-16196679"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-eff3b1be"]]);
5
5
  export {
6
- _ as default
6
+ m as default
7
7
  };
@@ -1,5 +1,5 @@
1
- import { defineComponent as m, defineAsyncComponent as t, computed as s, openBlock as o, createElementBlock as r, createElementVNode as n, toDisplayString as u, normalizeStyle as i, Fragment as f, renderList as b, createBlock as y, resolveDynamicComponent as _, mergeProps as h } from "vue";
2
- const g = { class: "of-dashboard" }, S = { class: "of-dashboard__header" }, v = { class: "of-dashboard__title" }, C = /* @__PURE__ */ m({
1
+ import { defineComponent as M, defineAsyncComponent as o, ref as h, computed as s, onMounted as k, onBeforeUnmount as w, openBlock as d, createElementBlock as u, createElementVNode as c, toDisplayString as D, normalizeStyle as b, Fragment as R, renderList as x, createBlock as C, resolveDynamicComponent as B, mergeProps as E } from "vue";
2
+ const F = { class: "of-dashboard__header" }, T = { class: "of-dashboard__title" }, I = /* @__PURE__ */ M({
3
3
  __name: "index",
4
4
  props: {
5
5
  title: { default: "Dashboard" },
@@ -7,17 +7,45 @@ const g = { class: "of-dashboard" }, S = { class: "of-dashboard__header" }, v =
7
7
  columns: { default: 4 },
8
8
  gap: { default: 16 }
9
9
  },
10
- setup(l) {
11
- const a = l, d = {
12
- bar: t(() => import("./charts/BarChart.vue.js")),
13
- pie: t(() => import("./charts/PieChart.vue.js")),
14
- doughnut: t(() => import("./charts/DoughnutChart.vue2.js")),
15
- "number-card": t(() => import("./charts/NumberCard.vue.js")),
16
- table: t(() => import("./charts/TableChart.vue.js"))
17
- }, c = s(() => ({
18
- gridTemplateColumns: `repeat(${a.columns}, minmax(0, 1fr))`,
19
- gap: `${a.gap}px`
20
- })), p = s(() => a.widgets.length > 0 ? a.widgets : [
10
+ setup(p) {
11
+ const r = p, v = {
12
+ bar: o(() => import("./charts/BarChart.vue.js")),
13
+ pie: o(() => import("./charts/PieChart.vue.js")),
14
+ doughnut: o(() => import("./charts/DoughnutChart.vue2.js")),
15
+ "number-card": o(() => import("./charts/NumberCard.vue.js")),
16
+ table: o(() => import("./charts/TableChart.vue.js"))
17
+ }, l = h(null), i = h(0);
18
+ let a = null;
19
+ const y = s(() => Math.max(1, Math.floor(r.columns))), m = s(() => {
20
+ const e = i.value, t = y.value;
21
+ return e ? e < 560 ? 1 : e < 840 ? Math.min(t, 2) : e < 1120 ? Math.min(t, 3) : t : t;
22
+ }), g = s(() => ({
23
+ "--dashboard-columns": String(m.value),
24
+ gap: `${r.gap}px`
25
+ }));
26
+ function f(e) {
27
+ var t;
28
+ if (e) {
29
+ i.value = Math.round(e.contentRect.width);
30
+ return;
31
+ }
32
+ i.value = Math.round(((t = l.value) == null ? void 0 : t.getBoundingClientRect().width) ?? 0);
33
+ }
34
+ k(() => {
35
+ f(), !(typeof ResizeObserver > "u" || !l.value) && (a = new ResizeObserver((e) => {
36
+ e[0] && f(e[0]);
37
+ }), a.observe(l.value));
38
+ }), w(() => {
39
+ a == null || a.disconnect(), a = null;
40
+ });
41
+ function _(e) {
42
+ const t = m.value;
43
+ return {
44
+ gridColumn: `span ${Math.min(e.colSpan ?? 1, t)}`,
45
+ gridRow: `span ${e.rowSpan ?? 1}`
46
+ };
47
+ }
48
+ const S = s(() => r.widgets.length > 0 ? r.widgets : [
21
49
  {
22
50
  id: "metric-1",
23
51
  type: "number-card",
@@ -69,31 +97,32 @@ const g = { class: "of-dashboard" }, S = { class: "of-dashboard__header" }, v =
69
97
  colSpan: 4
70
98
  }
71
99
  ]);
72
- return (k, D) => (o(), r("section", g, [
73
- n("header", S, [
74
- n("h3", v, u(l.title), 1)
100
+ return (e, t) => (d(), u("section", {
101
+ ref_key: "dashboardRef",
102
+ ref: l,
103
+ class: "of-dashboard"
104
+ }, [
105
+ c("header", F, [
106
+ c("h3", T, D(p.title), 1)
75
107
  ]),
76
- n("div", {
108
+ c("div", {
77
109
  class: "of-dashboard__grid",
78
- style: i(c.value)
110
+ style: b(g.value)
79
111
  }, [
80
- (o(!0), r(f, null, b(p.value, (e) => (o(), r("article", {
81
- key: e.id,
112
+ (d(!0), u(R, null, x(S.value, (n) => (d(), u("article", {
113
+ key: n.id,
82
114
  class: "of-dashboard__item",
83
- style: i({
84
- gridColumn: `span ${e.colSpan ?? 1}`,
85
- gridRow: `span ${e.rowSpan ?? 1}`
86
- })
115
+ style: b(_(n))
87
116
  }, [
88
- (o(), y(_(d[e.type]), h({
89
- title: e.title,
90
- data: e.data
91
- }, { ref_for: !0 }, e.config ?? {}), null, 16, ["title", "data"]))
117
+ (d(), C(B(v[n.type]), E({
118
+ title: n.title,
119
+ data: n.data
120
+ }, { ref_for: !0 }, n.config ?? {}), null, 16, ["title", "data"]))
92
121
  ], 4))), 128))
93
122
  ], 4)
94
- ]));
123
+ ], 512));
95
124
  }
96
125
  });
97
126
  export {
98
- C as default
127
+ I as default
99
128
  };
@@ -1,7 +1,7 @@
1
- import a from "./DatabaseView.vue2.js";
1
+ import o from "./DatabaseView.vue2.js";
2
2
  /* empty css */
3
- import o from "../../_virtual/_plugin-vue_export-helper.js";
4
- const f = /* @__PURE__ */ o(a, [["__scopeId", "data-v-da61dfa4"]]);
3
+ import t from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-1e404627"]]);
5
5
  export {
6
- f as default
6
+ m as default
7
7
  };