@wikicasa-dev/components 2.4.1-alpha.13 → 2.4.1-alpha.15

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.
@@ -0,0 +1,4 @@
1
+ import { Chart as t } from "chart.js";
2
+ export {
3
+ t as Chart
4
+ };
@@ -0,0 +1,5 @@
1
+ import { ArcElement as e, DoughnutController as t } from "chart.js";
2
+ export {
3
+ e as ArcElement,
4
+ t as DoughnutController
5
+ };
@@ -0,0 +1,9 @@
1
+ import { CategoryScale as n, Filler as r, LineController as o, LineElement as t, LinearScale as i, PointElement as a } from "chart.js";
2
+ export {
3
+ n as CategoryScale,
4
+ r as Filler,
5
+ o as LineController,
6
+ t as LineElement,
7
+ i as LinearScale,
8
+ a as PointElement
9
+ };
@@ -0,0 +1,4 @@
1
+ import { Legend as r } from "chart.js";
2
+ export {
3
+ r as Legend
4
+ };
@@ -0,0 +1,5 @@
1
+ import "chartjs-adapter-date-fns";
2
+ import { TimeScale as r } from "chart.js";
3
+ export {
4
+ r as TimeScale
5
+ };
@@ -0,0 +1,4 @@
1
+ import { Title as r } from "chart.js";
2
+ export {
3
+ r as Title
4
+ };
@@ -0,0 +1,4 @@
1
+ import { Tooltip as r } from "chart.js";
2
+ export {
3
+ r as Tooltip
4
+ };
@@ -1,5 +1,5 @@
1
1
  import { Autoplay as t } from "swiper/modules";
2
- import '../assets/swiper-autoplay.css';/* empty css */
2
+ import '../assets/swiper-controller.css';/* empty css */
3
3
  export {
4
4
  t as Autoplay
5
5
  };
@@ -1,5 +1,5 @@
1
1
  import { Controller as e } from "swiper/modules";
2
- import '../assets/swiper-autoplay.css';/* empty css */
2
+ import '../assets/swiper-controller.css';/* empty css */
3
3
  export {
4
4
  e as Controller
5
5
  };
@@ -1,5 +1,5 @@
1
1
  import { Keyboard as m } from "swiper/modules";
2
- import '../assets/swiper-autoplay.css';/* empty css */
2
+ import '../assets/swiper-controller.css';/* empty css */
3
3
  export {
4
4
  m as Keyboard
5
5
  };
@@ -1,5 +1,5 @@
1
1
  import { Thumbs as p } from "swiper/modules";
2
- import '../assets/swiper-autoplay.css';/* empty css */
2
+ import '../assets/swiper-controller.css';/* empty css */
3
3
  export {
4
4
  p as Thumbs
5
5
  };
@@ -0,0 +1,4 @@
1
+ import { Doughnut as u } from "vue-chartjs";
2
+ export {
3
+ u as default
4
+ };
@@ -0,0 +1,4 @@
1
+ import { Line as f } from "vue-chartjs";
2
+ export {
3
+ f as default
4
+ };
@@ -1,10 +1,14 @@
1
- import { ChartOptions, ChartType } from 'chart.js';
1
+ import { ChartOptions, ChartType, Chart as _Chart } from 'chart.js';
2
+ type Chart = typeof _Chart;
2
3
  export declare const useChartJsModules: <T extends ChartType = ChartType>(options: ChartOptions<T>) => {
3
- registerTitle: () => Promise<void>;
4
- registerLegend: () => Promise<void>;
5
- registerTooltip: () => Promise<void>;
6
- registerTimeCartesianAxis: () => Promise<void>;
7
- executeRegistration: (...args: (() => Promise<unknown>)[]) => Promise<void>;
8
- registerPlugins: () => Promise<void>;
9
- resolved: import('vue').Ref<boolean, boolean>;
4
+ registerTitle: (ChartJs: Chart) => Promise<void>;
5
+ registerLegend: (ChartJs: Chart) => Promise<void>;
6
+ registerTooltip: (ChartJs: Chart) => Promise<void>;
7
+ registerTimeCartesianAxis: (ChartJs: Chart) => Promise<void>;
8
+ executeRegistration: (...args: ((c: Chart) => Promise<unknown>)[]) => void;
9
+ registerPlugins: (ChartJs: Chart) => Promise<void>;
10
+ registerLineChart: (ChartJs: Chart) => Promise<void>;
11
+ registerDoughnutChart: (ChartJs: Chart) => Promise<void>;
12
+ resolved: import('vue').ShallowRef<boolean, boolean>;
10
13
  };
14
+ export {};
@@ -1,37 +1,72 @@
1
- import { computed as t, ref as f } from "vue";
2
- import { Chart as r, TimeScale as d, Tooltip as T, Legend as h, Title as w } from "chart.js";
3
- import "chartjs-adapter-date-fns";
4
- const L = (e) => {
5
- if (!e) throw Error("Options must be defined");
6
- const l = t(
7
- () => !!e.plugins?.tooltip
8
- ), o = t(
9
- () => e.scales?.x?.type === "time"
10
- ), c = t(() => !!e.plugins?.title), u = t(
11
- () => !!e.plugins?.legend
12
- ), i = async () => {
13
- l.value && r.register(T);
14
- }, g = async () => {
15
- o.value && r.register(d);
16
- }, s = async () => {
17
- c.value && r.register(w);
18
- }, n = async () => {
19
- u.value && r.register(h);
20
- }, a = f(!1);
1
+ import { shallowRef as d, computed as s } from "vue";
2
+ const P = (r) => {
3
+ if (!r) throw Error("Options must be defined");
4
+ const n = d(!1), c = s(
5
+ () => !!r.plugins?.tooltip
6
+ ), g = s(
7
+ () => r.scales?.x?.type === "time"
8
+ ), u = s(() => !!r.plugins?.title), m = s(
9
+ () => !!r.plugins?.legend
10
+ ), a = async (e) => {
11
+ if (!c.value) return;
12
+ const { Tooltip: t } = await import("../../ChartJs/Plugins/Tooltip.js");
13
+ e.register(t);
14
+ }, p = async (e) => {
15
+ if (!g.value) return;
16
+ const { TimeScale: t } = await import("../../ChartJs/Plugins/TimeScale.js");
17
+ e.register(t);
18
+ }, o = async (e) => {
19
+ if (!u.value) return;
20
+ const { Title: t } = await import("../../ChartJs/Plugins/Title.js");
21
+ e.register(t);
22
+ }, l = async (e) => {
23
+ if (!m.value) return;
24
+ const { Legend: t } = await import("../../ChartJs/Plugins/Legend.js");
25
+ e.register(t);
26
+ };
21
27
  return {
22
- registerTitle: s,
23
- registerLegend: n,
24
- registerTooltip: i,
25
- registerTimeCartesianAxis: g,
26
- executeRegistration: async (...m) => {
27
- await Promise.all(m.map((p) => p())), a.value = !0;
28
+ registerTitle: o,
29
+ registerLegend: l,
30
+ registerTooltip: a,
31
+ registerTimeCartesianAxis: p,
32
+ executeRegistration: (...e) => {
33
+ setTimeout(async () => {
34
+ const { Chart: t } = await import("../../ChartJs/Chart.js");
35
+ await Promise.all(e.map((i) => i(t))), n.value = !0;
36
+ });
37
+ },
38
+ registerPlugins: async (e) => {
39
+ await Promise.all([
40
+ a(e),
41
+ o(e),
42
+ l(e)
43
+ ]);
44
+ },
45
+ registerLineChart: async (e) => {
46
+ const {
47
+ LineController: t,
48
+ LineElement: i,
49
+ PointElement: w,
50
+ CategoryScale: h,
51
+ LinearScale: y,
52
+ Filler: T
53
+ } = await import("../../ChartJs/LineChart/index.js");
54
+ e.register(
55
+ t,
56
+ i,
57
+ w,
58
+ h,
59
+ y,
60
+ T
61
+ );
28
62
  },
29
- registerPlugins: async () => {
30
- await Promise.all([i(), s(), n()]);
63
+ registerDoughnutChart: async (e) => {
64
+ const { DoughnutController: t, ArcElement: i } = await import("../../ChartJs/DoughnutChart/index.js");
65
+ e.register(t, i);
31
66
  },
32
- resolved: a
67
+ resolved: n
33
68
  };
34
69
  };
35
70
  export {
36
- L as useChartJsModules
71
+ P as useChartJsModules
37
72
  };
@@ -1,27 +1,29 @@
1
- import { defineComponent as s, onBeforeMount as u, createBlock as i, createCommentVNode as c, unref as o, openBlock as m } from "vue";
2
- import { Doughnut as p } from "vue-chartjs";
3
- import { Chart as l, DoughnutController as d, ArcElement as f } from "chart.js";
4
- import { useChartJsModules as g } from "../../../../chart/composables/useChartjsModules.js";
5
- const y = /* @__PURE__ */ s({
1
+ import { defineComponent as i, defineAsyncComponent as c, onMounted as p, createBlock as d, createCommentVNode as m, unref as o, openBlock as h } from "vue";
2
+ import { useChartJsModules as l } from "../../../../chart/composables/useChartjsModules.js";
3
+ const x = /* @__PURE__ */ i({
6
4
  __name: "DoughnutChart",
7
5
  props: {
8
6
  options: {},
9
7
  data: {}
10
8
  },
11
9
  setup(t) {
12
- l.register(d, f);
13
- const e = t, { registerPlugins: r, resolved: n, executeRegistration: a } = g(
14
- e.options
15
- );
16
- return u(async () => {
17
- await a(r);
18
- }), (h, C) => o(n) ? (m(), i(o(p), {
10
+ const e = t, n = c(
11
+ () => import("../../../../VueChartJs/Doughnut.js")
12
+ ), {
13
+ registerDoughnutChart: r,
14
+ registerPlugins: s,
15
+ resolved: a,
16
+ executeRegistration: u
17
+ } = l(e.options);
18
+ return p(() => {
19
+ u(r, s);
20
+ }), (f, g) => o(a) ? (h(), d(o(n), {
19
21
  key: 0,
20
22
  options: t.options,
21
23
  data: t.data
22
- }, null, 8, ["options", "data"])) : c("", !0);
24
+ }, null, 8, ["options", "data"])) : m("", !0);
23
25
  }
24
26
  });
25
27
  export {
26
- y as default
28
+ x as default
27
29
  };
@@ -1,42 +1,39 @@
1
- import { defineComponent as m, onBeforeMount as p, useTemplateRef as u, computed as f, createBlock as d, createCommentVNode as h, unref as t, openBlock as C } from "vue";
2
- import { Line as g } from "vue-chartjs";
3
- import { Chart as x, LineController as L, LineElement as k, Filler as B, PointElement as E, CategoryScale as v, LinearScale as y } from "chart.js";
4
- import { useChartJsModules as M } from "../../../../chart/composables/useChartjsModules.js";
5
- const F = /* @__PURE__ */ m({
1
+ import { defineComponent as d, defineAsyncComponent as l, onMounted as h, useTemplateRef as f, computed as C, createBlock as g, createCommentVNode as x, unref as t, openBlock as k } from "vue";
2
+ import { useChartJsModules as y } from "../../../../chart/composables/useChartjsModules.js";
3
+ const M = /* @__PURE__ */ d({
6
4
  __name: "LineChart",
7
5
  props: {
8
6
  options: {},
9
7
  data: {}
10
8
  },
11
9
  setup(e, { expose: o }) {
12
- x.register(
13
- L,
14
- k,
15
- B,
16
- E,
17
- v,
18
- y
19
- );
20
- const r = e, {
21
- registerPlugins: n,
22
- registerTimeCartesianAxis: a,
10
+ const n = e, r = l(
11
+ () => import("../../../../VueChartJs/Line.js")
12
+ ), {
13
+ registerLineChart: a,
14
+ registerPlugins: s,
15
+ registerTimeCartesianAxis: c,
23
16
  executeRegistration: i,
24
- resolved: s
25
- } = M(r.options);
26
- p(() => {
27
- i(n, a);
17
+ resolved: p
18
+ } = y(n.options);
19
+ h(() => {
20
+ i(
21
+ a,
22
+ s,
23
+ c
24
+ );
28
25
  });
29
- const c = u("chart"), l = f(
30
- () => c.value?.chart
26
+ const u = f("chart"), m = C(
27
+ () => u.value?.chart
31
28
  );
32
- return o({ chartInstance: l }), (P, R) => t(s) ? (C(), d(t(g), {
29
+ return o({ chartInstance: m }), (A, L) => t(p) ? (k(), g(t(r), {
33
30
  key: 0,
34
31
  ref: "chart",
35
32
  options: e.options,
36
33
  data: e.data
37
- }, null, 8, ["options", "data"])) : h("", !0);
34
+ }, null, 8, ["options", "data"])) : x("", !0);
38
35
  }
39
36
  });
40
37
  export {
41
- F as default
38
+ M as default
42
39
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wikicasa-dev/components",
3
- "version": "2.4.1-alpha.13",
3
+ "version": "2.4.1-alpha.15",
4
4
  "description": "Wikicasa frontend components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",