@luzmo/analytics-components-kit 1.0.1-alpha.21 → 1.0.1-alpha.22

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.
@@ -17,4 +17,4 @@
17
17
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18
18
  * SOFTWARE.
19
19
  * */
20
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=require("./decompose-numeric-format-B3rVVHpO.cjs"),B=require("./formatter-DiJYkB6b.cjs"),G=require("./localize-r7ALOUy_.cjs"),N=require("./index-DXyAeBh6.cjs");function H(s){var y,C,M,g,x,w,D,A,T,b,O,q,I,z;const f=[];Object.keys(N.slotsConfigs).forEach(t=>{t.replace("SlotsConfig","");const o=t.replace("SlotsConfig","").replaceAll(/([A-Z])/g,"-$1").toLowerCase();f.push({type:o,slotsConfig:N.slotsConfigs[t]})});const m=[],a=[],c=f.find(t=>t.type===(s==null?void 0:s.oldItemType)),l=f.find(t=>t.type===(s==null?void 0:s.newItemType)),i=structuredClone((l==null?void 0:l.slotsConfig)??[]);if(!l)return{type:(c==null?void 0:c.type)??"bar-chart",slots:s.slots??[],unassignedMeasureSlots:[],unassignedDimensionSlots:[]};const r=structuredClone(s.slots??[]);for(const t of r){const o=c==null?void 0:c.slotsConfig.find(Z=>Z.name===t.name);t.type=(o==null?void 0:o.type)??(t==null?void 0:t.type)}const S=r.filter(t=>t.type==="mixed").sort((t,o)=>t.order-o.order),h=i.filter(t=>t.type==="mixed").sort((t,o)=>t.order-o.order),j=r.filter(t=>t.type==="numeric").sort((t,o)=>t.order-o.order),E=i.filter(t=>t.type==="numeric").sort((t,o)=>t.order-o.order),d=[];for(const t of j)for(const o of t.content)d.push(o);for(const t of S)for(const o of t.content)o.type==="numeric"&&d.push(o);let e=0;for(const t of d)for(const o of[E,h])o[e]&&(o[e].content=((y=o[e])==null?void 0:y.content)??[],((M=(C=o[e])==null?void 0:C.content)==null?void 0:M.length)===0||((x=(g=o[e])==null?void 0:g.content)==null?void 0:x.length)>0&&((w=o[e])==null?void 0:w.canAcceptMultipleColumns)===!0?o[e].content.push(t):e<o.length-1?(e++,o[e].content=((D=o[e])==null?void 0:D.content)??[],o[e].content.push(t)):m.push(t));const L=r.filter(t=>t.type==="categorical").sort((t,o)=>t.order-o.order),P=i.filter(t=>t.type==="categorical").sort((t,o)=>t.order-o.order),p=[];for(const t of L)for(const o of t.content)p.push(o);for(const t of S)for(const o of t.content)o.type!=="numeric"&&p.push(o);let n=0;for(const t of p)for(const o of[P,h])o[n]&&(o[n].content=((A=o[n])==null?void 0:A.content)??[],((b=(T=o[n])==null?void 0:T.content)==null?void 0:b.length)===0||((q=(O=o[n])==null?void 0:O.content)==null?void 0:q.length)>0&&((I=o[n])==null?void 0:I.canAcceptMultipleColumns)===!0?o[n].content.push(t):n<o.length-1?(n++,o[n].content=((z=o[n])==null?void 0:z.content)??[],o[n].content.push(t)):a.push(t));let u={...s.options};return l.setInitialOptions&&(u=l==null?void 0:l.setInitialOptions({...u})),{type:l.type??"bar-chart",slots:i.map(t=>({name:t.name,content:t.content??[]}))??[],options:u??{...s.options},unassignedMeasureSlots:m??[],unassignedDimensionSlots:a??[]}}exports.decomposeNumericFormat=$.decomposeNumericFormat;exports.formatter=B.formatter;exports.localize=G.localize;exports.switchItem=H;
20
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./decompose-numeric-format-B3rVVHpO.cjs"),A=require("./formatter-DiJYkB6b.cjs"),q=require("./localize-r7ALOUy_.cjs"),S=require("./index-DXyAeBh6.cjs");function z(o){var a,m,h,C;const c=[],f=[];Object.keys(S.slotsConfigs).forEach(e=>{e.replace("SlotsConfig","");const t=e.replace("SlotsConfig","").replaceAll(/([A-Z])/g,"-$1").toLowerCase();f.push({type:t,slotsConfig:S.slotsConfigs[e]})});const i=f.find(e=>e.type===(o==null?void 0:o.oldItemType)),n=f.find(e=>e.type===(o==null?void 0:o.newItemType)),s=structuredClone((n==null?void 0:n.slotsConfig)??[]);if(!n)return{type:(i==null?void 0:i.type)??"bar-chart",slots:o.slots??[]};const r=structuredClone(o.slots??[]);for(const e of r){const t=i==null?void 0:i.slotsConfig.find(T=>T.name===e.name);e.type=(t==null?void 0:t.type)??(e==null?void 0:e.type)}const u=r.filter(e=>e.type==="mixed").sort((e,t)=>e.order-t.order),y=s.filter(e=>e.type==="mixed").sort((e,t)=>e.order-t.order),x=r.filter(e=>e.type==="numeric").sort((e,t)=>e.order-t.order),O=s.filter(e=>e.type==="numeric").sort((e,t)=>e.order-t.order),l=[];for(const e of x)for(const t of e.content)t.key="old-measure-"+(e==null?void 0:e.name)+"-"+e.content.indexOf(t),l.push(t);for(const e of u)for(const t of e.content)t.type==="numeric"&&(t.key="old-mixed-"+(e==null?void 0:e.name)+"-"+e.content.indexOf(t),l.push(t));const k=[...O,...y].sort((e,t)=>s.indexOf(e)-s.indexOf(t));for(const e of l)for(const t of k)c.includes(e.key)||(t.content=(t==null?void 0:t.content)??[],(((a=t==null?void 0:t.content)==null?void 0:a.length)===0||((m=t==null?void 0:t.content)==null?void 0:m.length)>0&&(t==null?void 0:t.canAcceptMultipleColumns)===!0)&&(t.content.push(e),c.push(e.key)));const w=r.filter(e=>e.type==="categorical").sort((e,t)=>e.order-t.order),M=s.filter(e=>e.type==="categorical").sort((e,t)=>e.order-t.order),p=[];for(const e of w)for(const t of e.content)t.key="old-dimension-"+(e==null?void 0:e.name)+"-"+e.content.indexOf(t),p.push(t);for(const e of u)for(const t of e.content)t.type!=="numeric"&&(t.key="old-mixed-"+(e==null?void 0:e.name)+"-"+e.content.indexOf(t),p.push(t));const b=[...M,...y].sort((e,t)=>s.indexOf(e)-s.indexOf(t));for(const e of p)if(!c.includes(e.key))for(const t of b)t&&!c.includes(e.key)&&(t.content=(t==null?void 0:t.content)??[],(((h=t==null?void 0:t.content)==null?void 0:h.length)===0||((C=t==null?void 0:t.content)==null?void 0:C.length)>0&&(t==null?void 0:t.canAcceptMultipleColumns)===!0)&&(t.content.push(e),c.push(e.key)));let d={...o.options};return n.setInitialOptions&&(d=n==null?void 0:n.setInitialOptions({...d})),{type:n.type??"bar-chart",slots:s.map(e=>({name:e.name,content:e.content??[]}))??[],options:d??{...o.options}}}exports.decomposeNumericFormat=g.decomposeNumericFormat;exports.formatter=A.formatter;exports.localize=q.localize;exports.switchItem=z;
@@ -17,74 +17,76 @@
17
17
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18
18
  * SOFTWARE.
19
19
  * */
20
- import { d as K } from "./decompose-numeric-format-BuZcjH2k.js";
21
- import { f as Q } from "./formatter-CQDms6fU.js";
22
- import { l as U } from "./localize-BX7q0S0M.js";
23
- import { s as E } from "./index-Di00QW2f.js";
24
- function G(s) {
25
- var y, C, M, x, g, w, D, A, T, O, b, I, j, z;
26
- const f = [];
27
- Object.keys(E).forEach((t) => {
28
- t.replace("SlotsConfig", "");
29
- const o = t.replace("SlotsConfig", "").replaceAll(/([A-Z])/g, "-$1").toLowerCase();
20
+ import { d as j } from "./decompose-numeric-format-BuZcjH2k.js";
21
+ import { f as E } from "./formatter-CQDms6fU.js";
22
+ import { l as N } from "./localize-BX7q0S0M.js";
23
+ import { s as C } from "./index-Di00QW2f.js";
24
+ function g(t) {
25
+ var a, m, h, x;
26
+ const c = [], f = [];
27
+ Object.keys(C).forEach((e) => {
28
+ e.replace("SlotsConfig", "");
29
+ const o = e.replace("SlotsConfig", "").replaceAll(/([A-Z])/g, "-$1").toLowerCase();
30
30
  f.push({
31
31
  type: o,
32
- slotsConfig: E[t]
32
+ slotsConfig: C[e]
33
33
  });
34
34
  });
35
- const m = [], a = [], c = f.find(
36
- (t) => t.type === (s == null ? void 0 : s.oldItemType)
37
- ), l = f.find(
38
- (t) => t.type === (s == null ? void 0 : s.newItemType)
39
- ), i = structuredClone((l == null ? void 0 : l.slotsConfig) ?? []);
40
- if (!l)
35
+ const r = f.find(
36
+ (e) => e.type === (t == null ? void 0 : t.oldItemType)
37
+ ), n = f.find(
38
+ (e) => e.type === (t == null ? void 0 : t.newItemType)
39
+ ), s = structuredClone((n == null ? void 0 : n.slotsConfig) ?? []);
40
+ if (!n)
41
41
  return {
42
- type: (c == null ? void 0 : c.type) ?? "bar-chart",
43
- slots: s.slots ?? [],
44
- unassignedMeasureSlots: [],
45
- unassignedDimensionSlots: []
42
+ type: (r == null ? void 0 : r.type) ?? "bar-chart",
43
+ slots: t.slots ?? []
46
44
  };
47
- const r = structuredClone(s.slots ?? []);
48
- for (const t of r) {
49
- const o = c == null ? void 0 : c.slotsConfig.find(
50
- (q) => q.name === t.name
45
+ const i = structuredClone(t.slots ?? []);
46
+ for (const e of i) {
47
+ const o = r == null ? void 0 : r.slotsConfig.find(
48
+ (T) => T.name === e.name
51
49
  );
52
- t.type = (o == null ? void 0 : o.type) ?? (t == null ? void 0 : t.type);
50
+ e.type = (o == null ? void 0 : o.type) ?? (e == null ? void 0 : e.type);
53
51
  }
54
- const S = r.filter((t) => t.type === "mixed").sort((t, o) => t.order - o.order), h = i.filter((t) => t.type === "mixed").sort((t, o) => t.order - o.order), L = r.filter((t) => t.type === "numeric").sort((t, o) => t.order - o.order), N = i.filter((t) => t.type === "numeric").sort((t, o) => t.order - o.order), p = [];
55
- for (const t of L)
56
- for (const o of t.content)
57
- p.push(o);
58
- for (const t of S)
59
- for (const o of t.content)
60
- o.type === "numeric" && p.push(o);
61
- let e = 0;
62
- for (const t of p)
63
- for (const o of [N, h])
64
- o[e] && (o[e].content = ((y = o[e]) == null ? void 0 : y.content) ?? [], ((M = (C = o[e]) == null ? void 0 : C.content) == null ? void 0 : M.length) === 0 || ((g = (x = o[e]) == null ? void 0 : x.content) == null ? void 0 : g.length) > 0 && ((w = o[e]) == null ? void 0 : w.canAcceptMultipleColumns) === !0 ? o[e].content.push(t) : e < o.length - 1 ? (e++, o[e].content = ((D = o[e]) == null ? void 0 : D.content) ?? [], o[e].content.push(t)) : m.push(t));
65
- const Z = r.filter((t) => t.type === "categorical").sort((t, o) => t.order - o.order), $ = i.filter((t) => t.type === "categorical").sort((t, o) => t.order - o.order), d = [];
66
- for (const t of Z)
67
- for (const o of t.content)
68
- d.push(o);
69
- for (const t of S)
70
- for (const o of t.content)
71
- o.type !== "numeric" && d.push(o);
72
- let n = 0;
73
- for (const t of d)
74
- for (const o of [$, h])
75
- o[n] && (o[n].content = ((A = o[n]) == null ? void 0 : A.content) ?? [], ((O = (T = o[n]) == null ? void 0 : T.content) == null ? void 0 : O.length) === 0 || ((I = (b = o[n]) == null ? void 0 : b.content) == null ? void 0 : I.length) > 0 && ((j = o[n]) == null ? void 0 : j.canAcceptMultipleColumns) === !0 ? o[n].content.push(t) : n < o.length - 1 ? (n++, o[n].content = ((z = o[n]) == null ? void 0 : z.content) ?? [], o[n].content.push(t)) : a.push(t));
76
- let u = { ...s.options };
77
- return l.setInitialOptions && (u = l == null ? void 0 : l.setInitialOptions({ ...u })), {
78
- type: l.type ?? "bar-chart",
79
- slots: i.map((t) => ({ name: t.name, content: t.content ?? [] })) ?? [],
80
- options: u ?? { ...s.options },
81
- unassignedMeasureSlots: m ?? [],
82
- unassignedDimensionSlots: a ?? []
52
+ const y = i.filter((e) => e.type === "mixed").sort((e, o) => e.order - o.order), u = s.filter((e) => e.type === "mixed").sort((e, o) => e.order - o.order), S = i.filter((e) => e.type === "numeric").sort((e, o) => e.order - o.order), O = s.filter((e) => e.type === "numeric").sort((e, o) => e.order - o.order), l = [];
53
+ for (const e of S)
54
+ for (const o of e.content)
55
+ o.key = "old-measure-" + (e == null ? void 0 : e.name) + "-" + e.content.indexOf(o), l.push(o);
56
+ for (const e of y)
57
+ for (const o of e.content)
58
+ o.type === "numeric" && (o.key = "old-mixed-" + (e == null ? void 0 : e.name) + "-" + e.content.indexOf(o), l.push(o));
59
+ const k = [...O, ...u].sort(
60
+ (e, o) => s.indexOf(e) - s.indexOf(o)
61
+ );
62
+ for (const e of l)
63
+ for (const o of k)
64
+ c.includes(e.key) || (o.content = (o == null ? void 0 : o.content) ?? [], (((a = o == null ? void 0 : o.content) == null ? void 0 : a.length) === 0 || ((m = o == null ? void 0 : o.content) == null ? void 0 : m.length) > 0 && (o == null ? void 0 : o.canAcceptMultipleColumns) === !0) && (o.content.push(e), c.push(e.key)));
65
+ const w = i.filter((e) => e.type === "categorical").sort((e, o) => e.order - o.order), M = s.filter((e) => e.type === "categorical").sort((e, o) => e.order - o.order), p = [];
66
+ for (const e of w)
67
+ for (const o of e.content)
68
+ o.key = "old-dimension-" + (e == null ? void 0 : e.name) + "-" + e.content.indexOf(o), p.push(o);
69
+ for (const e of y)
70
+ for (const o of e.content)
71
+ o.type !== "numeric" && (o.key = "old-mixed-" + (e == null ? void 0 : e.name) + "-" + e.content.indexOf(o), p.push(o));
72
+ const A = [
73
+ ...M,
74
+ ...u
75
+ ].sort((e, o) => s.indexOf(e) - s.indexOf(o));
76
+ for (const e of p)
77
+ if (!c.includes(e.key))
78
+ for (const o of A)
79
+ o && !c.includes(e.key) && (o.content = (o == null ? void 0 : o.content) ?? [], (((h = o == null ? void 0 : o.content) == null ? void 0 : h.length) === 0 || ((x = o == null ? void 0 : o.content) == null ? void 0 : x.length) > 0 && (o == null ? void 0 : o.canAcceptMultipleColumns) === !0) && (o.content.push(e), c.push(e.key)));
80
+ let d = { ...t.options };
81
+ return n.setInitialOptions && (d = n == null ? void 0 : n.setInitialOptions({ ...d })), {
82
+ type: n.type ?? "bar-chart",
83
+ slots: s.map((e) => ({ name: e.name, content: e.content ?? [] })) ?? [],
84
+ options: d ?? { ...t.options }
83
85
  };
84
86
  }
85
87
  export {
86
- K as decomposeNumericFormat,
87
- Q as formatter,
88
- U as localize,
89
- G as switchItem
88
+ j as decomposeNumericFormat,
89
+ E as formatter,
90
+ N as localize,
91
+ g as switchItem
90
92
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luzmo/analytics-components-kit",
3
- "version": "1.0.1-alpha.21",
3
+ "version": "1.0.1-alpha.22",
4
4
  "type": "module",
5
5
  "main": "./components/index.js",
6
6
  "module": "./components/index.js",
@@ -3,8 +3,6 @@ export declare function switchItem(args: {
3
3
  newItemType: string;
4
4
  slots?: any[];
5
5
  options?: any;
6
- unassignedSlots?: any;
7
- inapplicableOptions?: any;
8
6
  customItemSlotsConfigs?: {
9
7
  type: string;
10
8
  slotsConfig: any;
@@ -13,6 +11,4 @@ export declare function switchItem(args: {
13
11
  type: string;
14
12
  slots: any[];
15
13
  options?: any;
16
- unassignedMeasureSlots: any[];
17
- unassignedDimensionSlots: any[];
18
14
  };