@wikicasa-dev/components 2.4.1-alpha.16 → 2.4.1-alpha.17

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,6 @@
1
+ import { Chart as r, DoughnutController as t, ArcElement as o } from "chart.js";
2
+ import { Chart as m } from "chart.js";
3
+ r.register(t, o);
4
+ export {
5
+ m as ChartJS
6
+ };
@@ -0,0 +1,6 @@
1
+ import { Chart as r, CategoryScale as a, LinearScale as e, Filler as t } from "chart.js";
2
+ import { Chart as C } from "chart.js";
3
+ r.register(a, e, t);
4
+ export {
5
+ C as ChartJS
6
+ };
@@ -0,0 +1,6 @@
1
+ import { Chart as r, LineController as e, LineElement as t, PointElement as o } from "chart.js";
2
+ import { Chart as a } from "chart.js";
3
+ r.register(e, t, o);
4
+ export {
5
+ a as ChartJS
6
+ };
@@ -1,4 +1,2 @@
1
- import { Legend as r } from "chart.js";
2
- export {
3
- r as Legend
4
- };
1
+ import { Chart as r, Legend as e } from "chart.js";
2
+ r.register(e);
@@ -1,5 +1,3 @@
1
1
  import "chartjs-adapter-date-fns";
2
- import { TimeScale as r } from "chart.js";
3
- export {
4
- r as TimeScale
5
- };
2
+ import { Chart as r, TimeScale as e } from "chart.js";
3
+ r.register(e);
@@ -1,4 +1,2 @@
1
- import { Title as r } from "chart.js";
2
- export {
3
- r as Title
4
- };
1
+ import { Chart as r, Title as t } from "chart.js";
2
+ r.register(t);
@@ -1,4 +1,2 @@
1
- import { Tooltip as r } from "chart.js";
2
- export {
3
- r as Tooltip
4
- };
1
+ import { Chart as r, Tooltip as o } from "chart.js";
2
+ r.register(o);
@@ -1,5 +1,5 @@
1
1
  import { Autoplay as t } from "swiper/modules";
2
- import '../assets/swiper-controller.css';/* empty css */
2
+ import '../assets/swiper-thumbs.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-controller.css';/* empty css */
2
+ import '../assets/swiper-thumbs.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-controller.css';/* empty css */
2
+ import '../assets/swiper-thumbs.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-controller.css';/* empty css */
2
+ import '../assets/swiper-thumbs.css';/* empty css */
3
3
  export {
4
4
  p as Thumbs
5
5
  };
@@ -0,0 +1,12 @@
1
+ const e = async (i) => {
2
+ const t = [
3
+ import("../../ChartJs/DoughnutChart/core.js")
4
+ // always needed
5
+ ];
6
+ i.timeAxis && t.push(import("../../ChartJs/Plugins/TimeScale.js")), i.tooltip && t.push(import("../../ChartJs/Plugins/Tooltip.js")), i.legend && t.push(import("../../ChartJs/Plugins/Legend.js")), i.title && t.push(import("../../ChartJs/Plugins/Title.js")), await Promise.all(t);
7
+ const { Doughnut: r } = await import("./index.js");
8
+ return r;
9
+ };
10
+ export {
11
+ e as createDoughnutChart
12
+ };
@@ -0,0 +1,4 @@
1
+ import { Doughnut as t } from "vue-chartjs";
2
+ export {
3
+ t as Doughnut
4
+ };
@@ -0,0 +1,14 @@
1
+ const e = async (i) => {
2
+ const t = [
3
+ import("../../ChartJs/LineChart/core.js"),
4
+ // always needed
5
+ import("../../ChartJs/LineChart/cartesian.js")
6
+ // always needed
7
+ ];
8
+ i.timeAxis && t.push(import("../../ChartJs/Plugins/TimeScale.js")), i.tooltip && t.push(import("../../ChartJs/Plugins/Tooltip.js")), i.legend && t.push(import("../../ChartJs/Plugins/Legend.js")), i.title && t.push(import("../../ChartJs/Plugins/Title.js")), await Promise.all(t);
9
+ const { Line: r } = await import("./index.js");
10
+ return r;
11
+ };
12
+ export {
13
+ e as createLineChart
14
+ };
@@ -0,0 +1,4 @@
1
+ import { Line as r } from "vue-chartjs";
2
+ export {
3
+ r as Line
4
+ };
@@ -1,14 +0,0 @@
1
- import { ChartOptions, ChartType, Chart as _Chart } from 'chart.js';
2
- type Chart = typeof _Chart;
3
- export declare const useChartJsModules: <T extends ChartType = ChartType>(options: ChartOptions<T>) => {
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>;
13
- };
14
- export {};
@@ -1,72 +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
- };
27
- return {
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
- );
62
- },
63
- registerDoughnutChart: async (e) => {
64
- const { DoughnutController: t, ArcElement: i } = await import("../../ChartJs/DoughnutChart/index.js");
65
- e.register(t, i);
66
- },
67
- resolved: n
68
- };
69
- };
70
- export {
71
- P as useChartJsModules
72
- };
1
+
@@ -42,9 +42,9 @@ declare const __VLS_component: import('vue').DefineComponent<IntersectionObserve
42
42
  }, string, import('vue').PublicProps, Readonly<IntersectionObserverProps> & Readonly<{
43
43
  onIntersection?: (() => any) | undefined;
44
44
  }>, {
45
- threshold: number;
46
45
  observeOnce: boolean;
47
46
  skip: boolean;
47
+ threshold: number;
48
48
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
49
49
  root: HTMLDivElement;
50
50
  }, any>;
@@ -1,30 +1,26 @@
1
- import { defineComponent as i, defineAsyncComponent as c, hydrateOnIdle as d, onMounted as p, createBlock as m, createCommentVNode as h, unref as e, openBlock as l } from "vue";
2
- import { useChartJsModules as f } from "../../../../chart/composables/useChartjsModules.js";
3
- const x = /* @__PURE__ */ i({
1
+ import { defineComponent as o, defineAsyncComponent as e, hydrateOnIdle as a, createBlock as i, openBlock as l, unref as r } from "vue";
2
+ import { createDoughnutChart as u } from "../../../../VueChartJs/Doughnut/factory.js";
3
+ const h = /* @__PURE__ */ o({
4
4
  __name: "DoughnutChart",
5
5
  props: {
6
6
  options: {},
7
7
  data: {}
8
8
  },
9
9
  setup(t) {
10
- const o = t, n = c({
11
- loader: () => import("../../../../VueChartJs/Doughnut.js"),
12
- hydrate: d()
13
- }), {
14
- registerDoughnutChart: r,
15
- registerPlugins: a,
16
- resolved: s,
17
- executeRegistration: u
18
- } = f(o.options);
19
- return p(() => {
20
- u(r, a);
21
- }), (g, C) => e(s) ? (l(), m(e(n), {
22
- key: 0,
10
+ const n = e({
11
+ loader: () => u({
12
+ tooltip: !!t.options.plugins?.tooltip,
13
+ legend: !!t.options.plugins?.legend,
14
+ title: !!t.options.plugins?.title
15
+ }),
16
+ hydrate: a()
17
+ });
18
+ return (s, d) => (l(), i(r(n), {
23
19
  options: t.options,
24
20
  data: t.data
25
- }, null, 8, ["options", "data"])) : h("", !0);
21
+ }, null, 8, ["options", "data"]));
26
22
  }
27
23
  });
28
24
  export {
29
- x as default
25
+ h as default
30
26
  };
@@ -1,40 +1,30 @@
1
- import { defineComponent as m, defineAsyncComponent as l, hydrateOnIdle as h, onMounted as f, useTemplateRef as C, computed as g, createBlock as x, createCommentVNode as y, unref as t, openBlock as k } from "vue";
2
- import { useChartJsModules as A } from "../../../../chart/composables/useChartjsModules.js";
3
- const M = /* @__PURE__ */ m({
1
+ import { defineComponent as i, defineAsyncComponent as c, hydrateOnIdle as s, useTemplateRef as l, computed as r, createBlock as p, openBlock as d, unref as m } from "vue";
2
+ import { createLineChart as u } from "../../../../VueChartJs/Line/factory.js";
3
+ const y = /* @__PURE__ */ i({
4
4
  __name: "LineChart",
5
5
  props: {
6
6
  options: {},
7
7
  data: {}
8
8
  },
9
- setup(e, { expose: o }) {
10
- const n = e, r = l({
11
- loader: () => import("../../../../VueChartJs/Line.js"),
12
- hydrate: h()
13
- }), {
14
- registerLineChart: a,
15
- registerPlugins: s,
16
- registerTimeCartesianAxis: c,
17
- executeRegistration: i,
18
- resolved: d
19
- } = A(n.options);
20
- f(() => {
21
- i(
22
- a,
23
- s,
24
- c
25
- );
26
- });
27
- const p = C("chart"), u = g(
28
- () => p.value?.chart
9
+ setup(t, { expose: e }) {
10
+ const n = c({
11
+ loader: () => u({
12
+ timeAxis: t.options.scales?.x?.type === "time",
13
+ tooltip: !!t.options.plugins?.tooltip,
14
+ legend: !!t.options.plugins?.legend,
15
+ title: !!t.options.plugins?.title
16
+ }),
17
+ hydrate: s()
18
+ }), o = l("chart"), a = r(
19
+ () => o.value?.chart
29
20
  );
30
- return o({ chartInstance: u }), (L, v) => t(d) ? (k(), x(t(r), {
31
- key: 0,
21
+ return e({ chartInstance: a }), (h, f) => (d(), p(m(n), {
32
22
  ref: "chart",
33
- options: e.options,
34
- data: e.data
35
- }, null, 8, ["options", "data"])) : y("", !0);
23
+ options: t.options,
24
+ data: t.data
25
+ }, null, 8, ["options", "data"]));
36
26
  }
37
27
  });
38
28
  export {
39
- M as default
29
+ y as default
40
30
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wikicasa-dev/components",
3
- "version": "2.4.1-alpha.16",
3
+ "version": "2.4.1-alpha.17",
4
4
  "description": "Wikicasa frontend components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,5 +0,0 @@
1
- import { ArcElement as e, DoughnutController as t } from "chart.js";
2
- export {
3
- e as ArcElement,
4
- t as DoughnutController
5
- };
@@ -1,9 +0,0 @@
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
- };
@@ -1,4 +0,0 @@
1
- import { Doughnut as u } from "vue-chartjs";
2
- export {
3
- u as default
4
- };
@@ -1,4 +0,0 @@
1
- import { Line as f } from "vue-chartjs";
2
- export {
3
- f as default
4
- };