@luzmo/analytics-components-kit 1.0.1-alpha.89 → 1.0.1-alpha.90
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.
- package/angular/components/draggable-data-item/types.ts +5 -3
- package/angular/esm/components/draggable-data-item/types.d.ts +3 -4
- package/components/draggable-data-item/index.cjs +14 -16
- package/components/draggable-data-item/index.js +71 -72
- package/components/draggable-data-item/types.d.ts +3 -4
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Column, Currency, Formula, HierarchyLevel } from '@luzmo/dashboard-contents-types';
|
|
2
2
|
|
|
3
|
-
type ColumnItemData = {
|
|
3
|
+
export type ColumnItemData = {
|
|
4
4
|
type: Column['type'];
|
|
5
5
|
name: Column['name'];
|
|
6
6
|
datasetId: string;
|
|
@@ -14,12 +14,14 @@ type ColumnItemData = {
|
|
|
14
14
|
| 'subtype'
|
|
15
15
|
| 'format'
|
|
16
16
|
| 'lowestLevel'
|
|
17
|
+
| 'highestLevel'
|
|
18
|
+
| 'hierarchy_enabled'
|
|
17
19
|
| 'duration_levels'
|
|
18
20
|
| 'duration_format'
|
|
19
21
|
| 'expression'
|
|
20
22
|
>>;
|
|
21
23
|
|
|
22
|
-
type FormulaItemData = {
|
|
24
|
+
export type FormulaItemData = {
|
|
23
25
|
type: Formula['type'];
|
|
24
26
|
name: Formula['name'];
|
|
25
27
|
datasetId: string;
|
|
@@ -37,4 +39,4 @@ type FormulaItemData = {
|
|
|
37
39
|
| 'expression'
|
|
38
40
|
>>;
|
|
39
41
|
|
|
40
|
-
export type DraggableDataItemData = ColumnItemData | FormulaItemData;
|
|
42
|
+
export type DraggableDataItemData = ColumnItemData | FormulaItemData;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Column, Currency, Formula, HierarchyLevel } from '@luzmo/dashboard-contents-types';
|
|
2
|
-
type ColumnItemData = {
|
|
2
|
+
export type ColumnItemData = {
|
|
3
3
|
type: Column['type'];
|
|
4
4
|
name: Column['name'];
|
|
5
5
|
datasetId: string;
|
|
@@ -8,8 +8,8 @@ type ColumnItemData = {
|
|
|
8
8
|
level?: number;
|
|
9
9
|
hierarchyLevels?: Pick<HierarchyLevel, 'id' | 'level' | 'name'>[];
|
|
10
10
|
currency?: Pick<Currency, 'id' | 'name' | 'symbol'>;
|
|
11
|
-
} & Partial<Pick<Column, 'description' | 'subtype' | 'format' | 'lowestLevel' | 'duration_levels' | 'duration_format' | 'expression'>>;
|
|
12
|
-
type FormulaItemData = {
|
|
11
|
+
} & Partial<Pick<Column, 'description' | 'subtype' | 'format' | 'lowestLevel' | 'highestLevel' | 'hierarchy_enabled' | 'duration_levels' | 'duration_format' | 'expression'>>;
|
|
12
|
+
export type FormulaItemData = {
|
|
13
13
|
type: Formula['type'];
|
|
14
14
|
name: Formula['name'];
|
|
15
15
|
datasetId: string;
|
|
@@ -19,4 +19,3 @@ type FormulaItemData = {
|
|
|
19
19
|
currency?: Pick<Currency, 'id' | 'name' | 'symbol'>;
|
|
20
20
|
} & Partial<Pick<Formula, 'description' | 'subtype' | 'format' | 'lowestLevel' | 'duration_levels' | 'duration_format' | 'expression'>>;
|
|
21
21
|
export type DraggableDataItemData = ColumnItemData | FormulaItemData;
|
|
22
|
-
export {};
|
|
@@ -17,27 +17,25 @@
|
|
|
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 c=require("@lit/localize"),
|
|
21
|
-
sublevel
|
|
22
|
-
.data=${h}
|
|
23
|
-
.language=${this.language}
|
|
24
|
-
.size=${this.size}
|
|
25
|
-
.variant=${this.variant}
|
|
26
|
-
.disabled=${this.disabled}
|
|
27
|
-
?hide-type-icon=${this.hideTypeIcon}
|
|
28
|
-
></luzmo-draggable-data-item-level>`});return l.html`
|
|
29
|
-
<div class="draggable-data-item-sublevels">${i}</div>
|
|
30
|
-
`}else if(g&&"hierarchyLevels"in this.data&&Array.isArray(this.data.hierarchyLevels)&&this.data.hierarchyLevels.length>2){const a=this.data.hierarchyLevels.filter(t=>t?.level>=1).map(t=>{const i={...this.data,level:t.level,name:t.name};return l.html`<luzmo-draggable-data-item-level
|
|
20
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("@lit/localize"),u=require("../periods.const-3jA-ECRf.cjs"),i=require("lit"),o=require("lit/decorators.js"),v=require("../focusable-QLh-LlNt.cjs"),b=require("../sized-mixin-DcvJLFeo.cjs"),m=require("../set-locale-BRRalqne.cjs");require("../draggable-data-item-level/index.cjs");const p=":host{--draggable-data-item-sublevels-margin-vertical: var(--luzmo-spacing-1);--draggable-data-item-sublevels-gap: 0}:host([size=s]){--draggable-data-item-sublevels-margin-vertical: var(--luzmo-spacing-1)}:host([size=l]){--draggable-data-item-sublevels-margin-vertical: var(--luzmo-spacing-2)}:host([size=xl]){--draggable-data-item-sublevels-margin-vertical: var(--luzmo-spacing-3)}:host{display:block}.draggable-data-item-sublevels{display:flex;flex-direction:column;gap:var(--luzmo-draggable-data-item-sublevels-gap, var(--draggable-data-item-sublevels-gap));margin:var(--luzmo-draggable-data-item-sublevels-margin-vertical, var(--draggable-data-item-sublevels-margin-vertical)) 0}:host{box-sizing:border-box}";var y=Object.defineProperty,z=Object.getOwnPropertyDescriptor,g=(n,a,r,t)=>{for(var l=t>1?void 0:t?z(a,r):a,e=n.length-1,s;e>=0;e--)(s=n[e])&&(l=(t?s(a,r,l):s(l))||l);return t&&l&&y(a,r,l),l};exports.LuzmoDraggableDataItem=class extends b.SizedMixin(v.LuzmoElement,{validSizes:["s","m","l","xl"],noDefaultSize:!0}){constructor(){super(...arguments),this.variant="normal",this.language="en",this.data={}}willUpdate(a){if(a.has("language")){const r=[...m.targetLocales];this.language!==m.getLocale()&&(r.includes(this.language)||this.language==="en")&&m.setLocale(this.language)}}renderSublevels(){if(!this.data)return i.html``;const a=this.data?.type,r=a==="datetime"||a==="array[datetime]",t=[],l=e=>"formulaId"in e;if("hierarchyLevels"in this.data&&Array.isArray(this.data.hierarchyLevels)&&this.data.hierarchyLevels.length>2&&this.data.hierarchy_enabled&&t.push(...this.data.hierarchyLevels.filter(e=>e?.level>=1).map(e=>{const s={...this.data,level:e.level,name:e.name};return i.html`<luzmo-draggable-data-item-level
|
|
31
21
|
sublevel
|
|
32
|
-
.data=${
|
|
22
|
+
.data=${s}
|
|
33
23
|
.language=${this.language}
|
|
34
24
|
.size=${this.size}
|
|
35
25
|
.variant=${this.variant}
|
|
36
26
|
.disabled=${this.disabled}
|
|
37
27
|
?hide-type-icon=${this.hideTypeIcon}
|
|
38
|
-
></luzmo-draggable-data-item-level>`});
|
|
39
|
-
|
|
40
|
-
|
|
28
|
+
></luzmo-draggable-data-item-level>`})),!l(this.data)&&r&&this.data.lowestLevel){const e=Math.min(Math.max(this.data.lowestLevel,1),u.DATETIME_LEVELS.length),s=Math.min(Math.max(this.data.highestLevel??1,1),u.DATETIME_LEVELS.length);for(let d=s;d<=e;d++){const h={...this.data,level:d,name:{[this.language]:u.DATETIME_LEVELS[d-1].i18n()}};t.push(i.html`<luzmo-draggable-data-item-level
|
|
29
|
+
sublevel
|
|
30
|
+
.data=${h}
|
|
31
|
+
.language=${this.language}
|
|
32
|
+
.size=${this.size}
|
|
33
|
+
.variant=${this.variant}
|
|
34
|
+
.disabled=${this.disabled}
|
|
35
|
+
?hide-type-icon=${this.hideTypeIcon}
|
|
36
|
+
></luzmo-draggable-data-item-level>`)}}return t.length>0?i.html`
|
|
37
|
+
<div class="draggable-data-item-sublevels">${t}</div>
|
|
38
|
+
`:i.html``}render(){return this.data?i.html`
|
|
41
39
|
<luzmo-draggable-data-item-level
|
|
42
40
|
.data=${this.data}
|
|
43
41
|
.language=${this.language}
|
|
@@ -47,4 +45,4 @@
|
|
|
47
45
|
?hide-type-icon=${this.hideTypeIcon}
|
|
48
46
|
></luzmo-draggable-data-item-level>
|
|
49
47
|
${this.hideSublevels?"":this.renderSublevels()}
|
|
50
|
-
`:
|
|
48
|
+
`:i.html``}};exports.LuzmoDraggableDataItem.styles=i.unsafeCSS(p);g([o.property({type:String,reflect:!0})],exports.LuzmoDraggableDataItem.prototype,"variant",2);g([o.property({type:String,reflect:!0})],exports.LuzmoDraggableDataItem.prototype,"language",2);g([o.property({type:Boolean,reflect:!0})],exports.LuzmoDraggableDataItem.prototype,"disabled",2);g([o.property({type:Boolean,reflect:!0,attribute:"hide-sublevels"})],exports.LuzmoDraggableDataItem.prototype,"hideSublevels",2);g([o.property({type:Boolean,reflect:!0,attribute:"hide-type-icon"})],exports.LuzmoDraggableDataItem.prototype,"hideTypeIcon",2);g([o.property({type:Object})],exports.LuzmoDraggableDataItem.prototype,"data",2);exports.LuzmoDraggableDataItem=g([c.localized()],exports.LuzmoDraggableDataItem);customElements.get("luzmo-draggable-data-item")||customElements.define("luzmo-draggable-data-item",exports.LuzmoDraggableDataItem);
|
|
@@ -17,13 +17,13 @@
|
|
|
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 { localized as
|
|
21
|
-
import { D as
|
|
22
|
-
import { html as
|
|
23
|
-
import { property as
|
|
24
|
-
import { L as
|
|
25
|
-
import { S as
|
|
26
|
-
import { t as
|
|
20
|
+
import { localized as g } from "@lit/localize";
|
|
21
|
+
import { D as d } from "../periods.const-CjHXYn-w.js";
|
|
22
|
+
import { html as s, unsafeCSS as z } from "lit";
|
|
23
|
+
import { property as n } from "lit/decorators.js";
|
|
24
|
+
import { L as b } from "../focusable-BS2pbY7w.js";
|
|
25
|
+
import { S as h } from "../sized-mixin-cJbo3PKR.js";
|
|
26
|
+
import { t as p, g as f, s as v } from "../set-locale-hKTMz37h.js";
|
|
27
27
|
import "../draggable-data-item-level/index.js";
|
|
28
28
|
(function() {
|
|
29
29
|
if (typeof document < "u" && !document.querySelector("style[data-luzmo-vars]")) {
|
|
@@ -32,56 +32,36 @@ import "../draggable-data-item-level/index.js";
|
|
|
32
32
|
}
|
|
33
33
|
})();
|
|
34
34
|
const x = ":host{--draggable-data-item-sublevels-margin-vertical: var(--luzmo-spacing-1);--draggable-data-item-sublevels-gap: 0}:host([size=s]){--draggable-data-item-sublevels-margin-vertical: var(--luzmo-spacing-1)}:host([size=l]){--draggable-data-item-sublevels-margin-vertical: var(--luzmo-spacing-2)}:host([size=xl]){--draggable-data-item-sublevels-margin-vertical: var(--luzmo-spacing-3)}:host{display:block}.draggable-data-item-sublevels{display:flex;flex-direction:column;gap:var(--luzmo-draggable-data-item-sublevels-gap, var(--draggable-data-item-sublevels-gap));margin:var(--luzmo-draggable-data-item-sublevels-margin-vertical, var(--draggable-data-item-sublevels-margin-vertical)) 0}:host{box-sizing:border-box}";
|
|
35
|
-
var
|
|
36
|
-
for (var e =
|
|
37
|
-
(
|
|
38
|
-
return
|
|
35
|
+
var y = Object.defineProperty, w = Object.getOwnPropertyDescriptor, u = (a, o, r, m) => {
|
|
36
|
+
for (var e = m > 1 ? void 0 : m ? w(o, r) : o, i = a.length - 1, t; i >= 0; i--)
|
|
37
|
+
(t = a[i]) && (e = (m ? t(o, r, e) : t(e)) || e);
|
|
38
|
+
return m && e && y(o, r, e), e;
|
|
39
39
|
};
|
|
40
|
-
let
|
|
40
|
+
let l = class extends h(b, {
|
|
41
41
|
validSizes: ["s", "m", "l", "xl"],
|
|
42
42
|
noDefaultSize: !0
|
|
43
43
|
}) {
|
|
44
44
|
constructor() {
|
|
45
45
|
super(...arguments), this.variant = "normal", this.language = "en", this.data = {};
|
|
46
46
|
}
|
|
47
|
-
willUpdate(
|
|
48
|
-
if (
|
|
49
|
-
const o = [...
|
|
50
|
-
this.language !==
|
|
47
|
+
willUpdate(a) {
|
|
48
|
+
if (a.has("language")) {
|
|
49
|
+
const o = [...p];
|
|
50
|
+
this.language !== f() && (o.includes(this.language) || this.language === "en") && v(this.language);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
renderSublevels() {
|
|
54
54
|
if (!this.data)
|
|
55
|
-
return
|
|
56
|
-
const
|
|
57
|
-
if (
|
|
58
|
-
|
|
59
|
-
const g = {
|
|
60
|
-
...this.data,
|
|
61
|
-
level: d + 1,
|
|
62
|
-
name: { [this.language]: c[d].i18n() }
|
|
63
|
-
};
|
|
64
|
-
return t`<luzmo-draggable-data-item-level
|
|
65
|
-
sublevel
|
|
66
|
-
.data=${g}
|
|
67
|
-
.language=${this.language}
|
|
68
|
-
.size=${this.size}
|
|
69
|
-
.variant=${this.variant}
|
|
70
|
-
.disabled=${this.disabled}
|
|
71
|
-
?hide-type-icon=${this.hideTypeIcon}
|
|
72
|
-
></luzmo-draggable-data-item-level>`;
|
|
73
|
-
});
|
|
74
|
-
return t`
|
|
75
|
-
<div class="draggable-data-item-sublevels">${i}</div>
|
|
76
|
-
`;
|
|
77
|
-
} else if (m && "hierarchyLevels" in this.data && Array.isArray(this.data.hierarchyLevels) && this.data.hierarchyLevels.length > 2) {
|
|
78
|
-
const a = this.data.hierarchyLevels.filter((e) => e?.level >= 1).map((e) => {
|
|
55
|
+
return s``;
|
|
56
|
+
const a = this.data?.type, o = a === "datetime" || a === "array[datetime]", r = [], m = (e) => "formulaId" in e;
|
|
57
|
+
if ("hierarchyLevels" in this.data && Array.isArray(this.data.hierarchyLevels) && this.data.hierarchyLevels.length > 2 && this.data.hierarchy_enabled && r.push(
|
|
58
|
+
...this.data.hierarchyLevels.filter((e) => e?.level >= 1).map((e) => {
|
|
79
59
|
const i = {
|
|
80
60
|
...this.data,
|
|
81
61
|
level: e.level,
|
|
82
62
|
name: e.name
|
|
83
63
|
};
|
|
84
|
-
return
|
|
64
|
+
return s`<luzmo-draggable-data-item-level
|
|
85
65
|
sublevel
|
|
86
66
|
.data=${i}
|
|
87
67
|
.language=${this.language}
|
|
@@ -90,15 +70,34 @@ let r = class extends p(h, {
|
|
|
90
70
|
.disabled=${this.disabled}
|
|
91
71
|
?hide-type-icon=${this.hideTypeIcon}
|
|
92
72
|
></luzmo-draggable-data-item-level>`;
|
|
93
|
-
})
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
73
|
+
})
|
|
74
|
+
), !m(this.data) && o && this.data.lowestLevel) {
|
|
75
|
+
const e = Math.min(Math.max(this.data.lowestLevel, 1), d.length), i = Math.min(Math.max(this.data.highestLevel ?? 1, 1), d.length);
|
|
76
|
+
for (let t = i; t <= e; t++) {
|
|
77
|
+
const c = {
|
|
78
|
+
...this.data,
|
|
79
|
+
level: t,
|
|
80
|
+
name: { [this.language]: d[t - 1].i18n() }
|
|
81
|
+
};
|
|
82
|
+
r.push(
|
|
83
|
+
s`<luzmo-draggable-data-item-level
|
|
84
|
+
sublevel
|
|
85
|
+
.data=${c}
|
|
86
|
+
.language=${this.language}
|
|
87
|
+
.size=${this.size}
|
|
88
|
+
.variant=${this.variant}
|
|
89
|
+
.disabled=${this.disabled}
|
|
90
|
+
?hide-type-icon=${this.hideTypeIcon}
|
|
91
|
+
></luzmo-draggable-data-item-level>`
|
|
92
|
+
);
|
|
93
|
+
}
|
|
97
94
|
}
|
|
98
|
-
return
|
|
95
|
+
return r.length > 0 ? s`
|
|
96
|
+
<div class="draggable-data-item-sublevels">${r}</div>
|
|
97
|
+
` : s``;
|
|
99
98
|
}
|
|
100
99
|
render() {
|
|
101
|
-
return this.data ?
|
|
100
|
+
return this.data ? s`
|
|
102
101
|
<luzmo-draggable-data-item-level
|
|
103
102
|
.data=${this.data}
|
|
104
103
|
.language=${this.language}
|
|
@@ -108,32 +107,32 @@ let r = class extends p(h, {
|
|
|
108
107
|
?hide-type-icon=${this.hideTypeIcon}
|
|
109
108
|
></luzmo-draggable-data-item-level>
|
|
110
109
|
${this.hideSublevels ? "" : this.renderSublevels()}
|
|
111
|
-
` :
|
|
110
|
+
` : s``;
|
|
112
111
|
}
|
|
113
112
|
};
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
],
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
],
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
],
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
],
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
],
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
],
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
],
|
|
136
|
-
customElements.get("luzmo-draggable-data-item") || customElements.define("luzmo-draggable-data-item",
|
|
113
|
+
l.styles = z(x);
|
|
114
|
+
u([
|
|
115
|
+
n({ type: String, reflect: !0 })
|
|
116
|
+
], l.prototype, "variant", 2);
|
|
117
|
+
u([
|
|
118
|
+
n({ type: String, reflect: !0 })
|
|
119
|
+
], l.prototype, "language", 2);
|
|
120
|
+
u([
|
|
121
|
+
n({ type: Boolean, reflect: !0 })
|
|
122
|
+
], l.prototype, "disabled", 2);
|
|
123
|
+
u([
|
|
124
|
+
n({ type: Boolean, reflect: !0, attribute: "hide-sublevels" })
|
|
125
|
+
], l.prototype, "hideSublevels", 2);
|
|
126
|
+
u([
|
|
127
|
+
n({ type: Boolean, reflect: !0, attribute: "hide-type-icon" })
|
|
128
|
+
], l.prototype, "hideTypeIcon", 2);
|
|
129
|
+
u([
|
|
130
|
+
n({ type: Object })
|
|
131
|
+
], l.prototype, "data", 2);
|
|
132
|
+
l = u([
|
|
133
|
+
g()
|
|
134
|
+
], l);
|
|
135
|
+
customElements.get("luzmo-draggable-data-item") || customElements.define("luzmo-draggable-data-item", l);
|
|
137
136
|
export {
|
|
138
|
-
|
|
137
|
+
l as LuzmoDraggableDataItem
|
|
139
138
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Column, Currency, Formula, HierarchyLevel } from '@luzmo/dashboard-contents-types';
|
|
2
|
-
type ColumnItemData = {
|
|
2
|
+
export type ColumnItemData = {
|
|
3
3
|
type: Column['type'];
|
|
4
4
|
name: Column['name'];
|
|
5
5
|
datasetId: string;
|
|
@@ -8,8 +8,8 @@ type ColumnItemData = {
|
|
|
8
8
|
level?: number;
|
|
9
9
|
hierarchyLevels?: Pick<HierarchyLevel, 'id' | 'level' | 'name'>[];
|
|
10
10
|
currency?: Pick<Currency, 'id' | 'name' | 'symbol'>;
|
|
11
|
-
} & Partial<Pick<Column, 'description' | 'subtype' | 'format' | 'lowestLevel' | 'duration_levels' | 'duration_format' | 'expression'>>;
|
|
12
|
-
type FormulaItemData = {
|
|
11
|
+
} & Partial<Pick<Column, 'description' | 'subtype' | 'format' | 'lowestLevel' | 'highestLevel' | 'hierarchy_enabled' | 'duration_levels' | 'duration_format' | 'expression'>>;
|
|
12
|
+
export type FormulaItemData = {
|
|
13
13
|
type: Formula['type'];
|
|
14
14
|
name: Formula['name'];
|
|
15
15
|
datasetId: string;
|
|
@@ -19,4 +19,3 @@ type FormulaItemData = {
|
|
|
19
19
|
currency?: Pick<Currency, 'id' | 'name' | 'symbol'>;
|
|
20
20
|
} & Partial<Pick<Formula, 'description' | 'subtype' | 'format' | 'lowestLevel' | 'duration_levels' | 'duration_format' | 'expression'>>;
|
|
21
21
|
export type DraggableDataItemData = ColumnItemData | FormulaItemData;
|
|
22
|
-
export {};
|