@luzmo/analytics-components-kit 1.0.1-alpha.97 → 1.0.1-alpha.99
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/README.md +2 -2
- package/angular/components/ai-interaction-textarea.component.ts +8 -0
- package/angular/components/{filter-data-item-picker.component.ts → data-items-select.component.ts} +34 -17
- package/angular/components/edit-filters/index.ts +1 -0
- package/angular/components/edit-filters/types.ts +10 -0
- package/angular/components/edit-filters.component.ts +41 -0
- package/angular/components/slot-contents-picker.component.ts +8 -6
- package/angular/esm/components/ai-interaction-textarea.component.d.ts +5 -1
- package/angular/esm/components/ai-interaction-textarea.component.js +22 -2
- package/angular/esm/components/data-items-select.component.d.ts +33 -0
- package/angular/esm/components/{filter-data-item-picker.component.js → data-items-select.component.js} +41 -26
- package/angular/esm/components/edit-filters/index.d.ts +1 -0
- package/angular/esm/components/edit-filters/index.js +1 -0
- package/angular/esm/components/edit-filters/types.d.ts +8 -0
- package/angular/esm/components/edit-filters/types.js +1 -0
- package/angular/esm/components/edit-filters.component.d.ts +21 -0
- package/angular/esm/components/edit-filters.component.js +89 -0
- package/angular/esm/components/slot-contents-picker.component.d.ts +7 -6
- package/angular/esm/components/slot-contents-picker.component.js +11 -6
- package/angular/esm/index.d.ts +5 -5
- package/angular/esm/index.js +6 -6
- package/angular/esm/types.d.ts +9 -0
- package/angular/index.ts +6 -6
- package/angular/types.ts +17 -0
- package/angular/utils/filters/expressions.d.ts +1 -1
- package/components/ai-interaction-textarea/ai-interaction-textarea.d.ts +21 -0
- package/components/ai-interaction-textarea/index.cjs +17 -15
- package/components/ai-interaction-textarea/index.js +90 -65
- package/components/{filter-data-item-picker/filter-data-item-picker.d.ts → data-items-select/data-items-select.d.ts} +36 -21
- package/components/data-items-select/index.cjs +39 -0
- package/components/data-items-select/index.d.ts +6 -0
- package/components/{filter-data-item-picker → data-items-select}/index.js +127 -109
- package/components/dataset-selector-list/index.cjs +1 -1
- package/components/dataset-selector-list/index.js +3 -3
- package/components/dataset-selector-row/index.cjs +1 -1
- package/components/dataset-selector-row/index.js +1 -1
- package/components/{de-COKGBX9L.cjs → de-DOYL4txr.cjs} +1 -1
- package/components/{de-DU0DlXuf.js → de-SDzGVifr.js} +10 -1
- package/components/display-settings-binning/index.cjs +1 -1
- package/components/display-settings-binning/index.js +1 -1
- package/components/display-settings-datetime/index.cjs +1 -1
- package/components/display-settings-datetime/index.js +1 -1
- package/components/display-settings-grand-totals/index.cjs +1 -1
- package/components/display-settings-grand-totals/index.js +1 -1
- package/components/display-settings-numeric/index.cjs +1 -1
- package/components/display-settings-numeric/index.js +1 -1
- package/components/display-settings-period-over-period/index.cjs +1 -1
- package/components/display-settings-period-over-period/index.js +1 -1
- package/components/draggable-data-item/index.cjs +1 -1
- package/components/draggable-data-item/index.js +1 -1
- package/components/draggable-data-item-level/index.cjs +1 -1
- package/components/draggable-data-item-level/index.js +1 -1
- package/components/droppable-slot/index.cjs +9 -9
- package/components/droppable-slot/index.js +82 -158
- package/components/edit-filters/edit-filters.d.ts +79 -0
- package/components/edit-filters/index.cjs +144 -0
- package/components/edit-filters/index.d.ts +8 -0
- package/components/edit-filters/index.js +341 -0
- package/components/edit-filters/types.d.ts +8 -0
- package/components/{es-BxR1uGKR.js → es-B1TeapPZ.js} +10 -1
- package/components/{es-CaKfa7fn.cjs → es-DcQvrHgz.cjs} +1 -1
- package/components/filter-expression-picker/index.cjs +1 -1
- package/components/filter-expression-picker/index.js +1 -1
- package/components/filter-item/filter-item.d.ts +1 -1
- package/components/filter-item/index.cjs +7 -5
- package/components/filter-item/index.js +78 -68
- package/components/filter-value-picker/index.cjs +1 -1
- package/components/filter-value-picker/index.js +1 -1
- package/components/filter-value-picker-datetime/index.cjs +2 -2
- package/components/filter-value-picker-datetime/index.js +4 -4
- package/components/filter-value-picker-hierarchy/index.cjs +1 -1
- package/components/filter-value-picker-hierarchy/index.js +2 -2
- package/components/filter-value-picker-numeric/index.cjs +2 -1
- package/components/filter-value-picker-numeric/index.js +3 -2
- package/components/{fr-DiZbjx_a.cjs → fr-D6QmA3Ve.cjs} +1 -1
- package/components/{fr-CvltYxR_.js → fr-sZFBmltf.js} +10 -1
- package/components/{get-css-variable-Pzks_rOx.cjs → get-css-variable-C0B_Sxqf.cjs} +1 -1
- package/components/{get-css-variable-Bb7TxJdX.js → get-css-variable-DgTBQV3c.js} +2 -1
- package/components/grid/index.cjs +1 -1
- package/components/grid/index.js +1 -1
- package/components/{index-DNPULp4A.js → index-BikhVAa1.js} +1 -1
- package/components/{index-CFL6gmIu.cjs → index-CAbDIHYI.cjs} +1 -1
- package/components/{index-BNAmjOkm.cjs → index-DM58h73U.cjs} +3 -3
- package/components/{index-DdyZ2g5L.js → index-DR5275fa.js} +48 -18
- package/components/index.cjs +1 -1
- package/components/index.js +105 -106
- package/components/{nl-CLs7FmRK.js → nl-BYXZ-qNp.js} +10 -1
- package/components/{nl-Bot6bJ4g.cjs → nl-D7oNsLn0.cjs} +1 -1
- package/components/{set-locale-hKTMz37h.js → set-locale-B5562CBM.js} +1 -1
- package/components/{set-locale-BRRalqne.cjs → set-locale-B8iQGfk0.cjs} +1 -1
- package/components/slot-contents-picker/index.cjs +31 -27
- package/components/slot-contents-picker/index.js +137 -124
- package/components/slot-contents-picker/slot-contents-picker.d.ts +26 -5
- package/components/slot-menu/index.cjs +6 -6
- package/components/slot-menu/index.js +76 -76
- package/components/slot-menu-list/index.cjs +1 -1
- package/components/slot-menu-list/index.js +1 -1
- package/components/slot-store-CRfN0nD3.js +98 -0
- package/components/slot-store-Dd_cPNXk.cjs +20 -0
- package/components/utils.cjs +1 -1
- package/components/utils.js +1 -1
- package/components/viz-item-menu/index.cjs +6 -6
- package/components/viz-item-menu/index.js +27 -28
- package/custom-elements.json +1922 -1631
- package/index.d.ts +1 -1
- package/package.json +12 -12
- package/types.d.ts +9 -0
- package/utils/filters/expressions.d.ts +1 -1
- package/angular/components/filter-group.component.ts +0 -29
- package/angular/esm/components/filter-data-item-picker.component.d.ts +0 -30
- package/angular/esm/components/filter-group.component.d.ts +0 -12
- package/angular/esm/components/filter-group.component.js +0 -56
- package/components/filter-data-item-picker/index.cjs +0 -47
- package/components/filter-data-item-picker/index.d.ts +0 -7
- package/components/filter-group/filter-group.d.ts +0 -26
- package/components/filter-group/index.d.ts +0 -7
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/*! * A kit of modern Luzmo Web Components for analytics in your web application.
|
|
2
|
+
*
|
|
3
|
+
* Copyright © 2025 Luzmo
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
* Luzmo web components (“Luzmo Web Components”)
|
|
6
|
+
* must be used according to the Luzmo Terms of Service.
|
|
7
|
+
* This license allows users with a current active Luzmo account
|
|
8
|
+
* to use the Luzmo Web Components. This license terminates
|
|
9
|
+
* automatically if a user no longer has an active Luzmo account.
|
|
10
|
+
* Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
|
|
11
|
+
*
|
|
12
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
13
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
14
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
15
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
16
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
17
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
18
|
+
* SOFTWARE.
|
|
19
|
+
* */
|
|
20
|
+
import { signal as i, computed as C } from "@lit-labs/signals";
|
|
21
|
+
import { P as l } from "./types-RxAJdtVT.js";
|
|
22
|
+
class u {
|
|
23
|
+
constructor() {
|
|
24
|
+
this.slotContents = i([]), this.slotsContents = i([]), this.periodOverPeriodUiType = i(
|
|
25
|
+
null
|
|
26
|
+
), this.linkedDataset = i(
|
|
27
|
+
[]
|
|
28
|
+
), this._popEnabledChartTypes = [
|
|
29
|
+
"area-chart",
|
|
30
|
+
"bar-chart",
|
|
31
|
+
"combination-chart",
|
|
32
|
+
"column-chart",
|
|
33
|
+
"line-chart"
|
|
34
|
+
], this.activeSlotContents = C(() => this.slotContents.get()[this.activeIndex.get()]), this.activeIndex = i(0);
|
|
35
|
+
}
|
|
36
|
+
isArrayColumnType(t) {
|
|
37
|
+
return t.startsWith("array[");
|
|
38
|
+
}
|
|
39
|
+
setPeriodOverPeriodCondition(t, e) {
|
|
40
|
+
if (!e?.periodOverPeriod?.newUi) {
|
|
41
|
+
this.periodOverPeriodUiType.set(this.oldConditionalLogic(t));
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
this.periodOverPeriodUiType.set(
|
|
45
|
+
this.getUiConditionToApply(e)
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
getUiConditionToApply(t) {
|
|
49
|
+
const e = this.hasDatetimeColumnOnCategoryOrXAxis(), n = t?.periodOverPeriod?.hasConnectedComparisonFilter, o = this.linkedDataset.get().some(
|
|
50
|
+
({ columns: s }) => s?.some((a) => a.type === "datetime")
|
|
51
|
+
);
|
|
52
|
+
return !e && !n && !o ? null : e && n ? l.HasDatetimeColumnAndComparisonFilters : e && !n ? l.HasDatetimeColumnAndNoComparisonFilters : !e && n ? l.NoDatetimeColumnButComparisonFilters : l.NoDatetimeColumnAndNoComparisonFilters;
|
|
53
|
+
}
|
|
54
|
+
oldConditionalLogic(t) {
|
|
55
|
+
const e = this.slotsContents.get() ?? [], o = (e.find(
|
|
56
|
+
(r) => ["y-axis", "x-axis", "row"].includes(r.name)
|
|
57
|
+
)?.content ?? [])?.[0] ?? null, s = e.find((r) => r.name === "measure")?.content ?? [];
|
|
58
|
+
return o && this._popEnabledChartTypes.includes(t) && o.type === "datetime" && !this.isArrayColumnType(o.type) && !o.datetimeDisplayMode && o.level !== 4 && s.length > 0 ? l.OldImplementation : null;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Detects if there's a datetime column on Category or X-axis slots
|
|
62
|
+
*/
|
|
63
|
+
hasDatetimeColumnOnCategoryOrXAxis() {
|
|
64
|
+
const n = ((this.slotsContents.get() ?? []).find(
|
|
65
|
+
(o) => ["y-axis", "x-axis"].includes(o.name)
|
|
66
|
+
)?.content ?? [])?.[0] ?? null;
|
|
67
|
+
return !!(n && n.type === "datetime" && !this.isArrayColumnType(n.type));
|
|
68
|
+
}
|
|
69
|
+
/** Replace the full list (e.g. after dropping or re-ordering). */
|
|
70
|
+
setContents(t, e) {
|
|
71
|
+
if (this.slotContents.set(t), this.activeIndex.get() >= t.length && this.activeIndex.set(t.length > 0 ? t.length - 1 : 0), e) {
|
|
72
|
+
const n = structuredClone(this.slotsContents.get()) ?? [], o = n.find((s) => s.name === e);
|
|
73
|
+
o && (o.content = t), this.setFullContents(n);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
setFullContents(t) {
|
|
77
|
+
this.slotsContents.set(t);
|
|
78
|
+
}
|
|
79
|
+
/** Change which item is considered active (e.g. user clicked in list). */
|
|
80
|
+
updateActive(t) {
|
|
81
|
+
t >= 0 && t < this.slotContents.get().length && this.activeIndex.set(t);
|
|
82
|
+
}
|
|
83
|
+
/** Update / overwrite a single content entry. */
|
|
84
|
+
updateContent(t, e = this.activeIndex.get()) {
|
|
85
|
+
if (e < 0 || e >= this.slotContents.get().length) return;
|
|
86
|
+
const n = [...this.slotContents.get()];
|
|
87
|
+
n[e] = structuredClone(t), this.slotContents.set(n);
|
|
88
|
+
}
|
|
89
|
+
/** Remove one content entry by index. */
|
|
90
|
+
removeContent(t) {
|
|
91
|
+
if (t < 0 || t >= this.slotContents.get().length) return;
|
|
92
|
+
const e = this.slotContents.get().filter((n, o) => o !== t);
|
|
93
|
+
this.slotContents.set(e), this.activeIndex.get() >= e.length && this.activeIndex.set(e.length > 0 ? e.length - 1 : 0);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
export {
|
|
97
|
+
u as S
|
|
98
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*! * A kit of modern Luzmo Web Components for analytics in your web application.
|
|
2
|
+
*
|
|
3
|
+
* Copyright © 2025 Luzmo
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
* Luzmo web components (“Luzmo Web Components”)
|
|
6
|
+
* must be used according to the Luzmo Terms of Service.
|
|
7
|
+
* This license allows users with a current active Luzmo account
|
|
8
|
+
* to use the Luzmo Web Components. This license terminates
|
|
9
|
+
* automatically if a user no longer has an active Luzmo account.
|
|
10
|
+
* Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
|
|
11
|
+
*
|
|
12
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
13
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
14
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
15
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
16
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
17
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
18
|
+
* SOFTWARE.
|
|
19
|
+
* */
|
|
20
|
+
"use strict";const i=require("@lit-labs/signals"),r=require("./types-VPf7E5dD.cjs");class C{constructor(){this.slotContents=i.signal([]),this.slotsContents=i.signal([]),this.periodOverPeriodUiType=i.signal(null),this.linkedDataset=i.signal([]),this._popEnabledChartTypes=["area-chart","bar-chart","combination-chart","column-chart","line-chart"],this.activeSlotContents=i.computed(()=>this.slotContents.get()[this.activeIndex.get()]),this.activeIndex=i.signal(0)}isArrayColumnType(t){return t.startsWith("array[")}setPeriodOverPeriodCondition(t,e){if(!e?.periodOverPeriod?.newUi){this.periodOverPeriodUiType.set(this.oldConditionalLogic(t));return}this.periodOverPeriodUiType.set(this.getUiConditionToApply(e))}getUiConditionToApply(t){const e=this.hasDatetimeColumnOnCategoryOrXAxis(),n=t?.periodOverPeriod?.hasConnectedComparisonFilter,o=this.linkedDataset.get().some(({columns:s})=>s?.some(a=>a.type==="datetime"));return!e&&!n&&!o?null:e&&n?r.PeriodOverPeriodCondition.HasDatetimeColumnAndComparisonFilters:e&&!n?r.PeriodOverPeriodCondition.HasDatetimeColumnAndNoComparisonFilters:!e&&n?r.PeriodOverPeriodCondition.NoDatetimeColumnButComparisonFilters:r.PeriodOverPeriodCondition.NoDatetimeColumnAndNoComparisonFilters}oldConditionalLogic(t){const e=this.slotsContents.get()??[],o=(e.find(l=>["y-axis","x-axis","row"].includes(l.name))?.content??[])?.[0]??null,s=e.find(l=>l.name==="measure")?.content??[];return o&&this._popEnabledChartTypes.includes(t)&&o.type==="datetime"&&!this.isArrayColumnType(o.type)&&!o.datetimeDisplayMode&&o.level!==4&&s.length>0?r.PeriodOverPeriodCondition.OldImplementation:null}hasDatetimeColumnOnCategoryOrXAxis(){const n=((this.slotsContents.get()??[]).find(o=>["y-axis","x-axis"].includes(o.name))?.content??[])?.[0]??null;return!!(n&&n.type==="datetime"&&!this.isArrayColumnType(n.type))}setContents(t,e){if(this.slotContents.set(t),this.activeIndex.get()>=t.length&&this.activeIndex.set(t.length>0?t.length-1:0),e){const n=structuredClone(this.slotsContents.get())??[],o=n.find(s=>s.name===e);o&&(o.content=t),this.setFullContents(n)}}setFullContents(t){this.slotsContents.set(t)}updateActive(t){t>=0&&t<this.slotContents.get().length&&this.activeIndex.set(t)}updateContent(t,e=this.activeIndex.get()){if(e<0||e>=this.slotContents.get().length)return;const n=[...this.slotContents.get()];n[e]=structuredClone(t),this.slotContents.set(n)}removeContent(t){if(t<0||t>=this.slotContents.get().length)return;const e=this.slotContents.get().filter((n,o)=>o!==t);this.slotContents.set(e),this.activeIndex.get()>=e.length&&this.activeIndex.set(e.length>0?e.length-1:0)}}exports.SlotStore=C;
|
package/components/utils.cjs
CHANGED
|
@@ -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 m=require("./index-
|
|
20
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./index-CAbDIHYI.cjs"),C=require("./decompose-numeric-format-B3rVVHpO.cjs"),k=require("./en-DZcn_iz_.cjs"),T=require("./localize-C4zNlrwK.cjs"),h=require("./index-6PmXiNch.cjs"),g=require("./index-Vdyb9z2D.cjs"),f=r=>!!(r&&Object.keys(r).length>0),O=(r,e,i={})=>{if(e.hidden===!0&&!i.includeHidden||!e.id||!e.type)return null;const s=f(e.name)?e.name:{en:"Untitled"},n={datasetId:r,columnId:e.id,type:e.type,name:s};return e.description&&f(e.description)&&(n.description=e.description),e.subtype&&(n.subtype=e.subtype),e.format&&(n.format=e.format),typeof e.lowestLevel=="number"&&(n.lowestLevel=e.lowestLevel),e.expression&&(n.expression=e.expression),Array.isArray(e.duration_levels)&&e.duration_levels.length>0&&(n.duration_levels=[...e.duration_levels]),e.duration_format&&(n.duration_format=e.duration_format),Array.isArray(e.hierarchyLevels)&&e.hierarchyLevels.length>0&&(n.hierarchyLevels=e.hierarchyLevels.map(({id:d,level:a,name:l})=>({id:d,level:a,name:l}))),e.currency?.id&&e.currency.symbol&&(n.currency={id:e.currency.id,name:e.currency.name,symbol:e.currency.symbol}),n},M=(r,e,i={})=>{if(e.hidden===!0&&!i.includeHidden||!e.id||!e.type)return null;const s=f(e.name)?e.name:{en:"Untitled"},n={datasetId:r,formulaId:e.id,type:e.type,name:s};return e.description&&f(e.description)&&(n.description=e.description),e.subtype&&(n.subtype=e.subtype),e.format&&(n.format=e.format),typeof e.lowestLevel=="number"&&(n.lowestLevel=e.lowestLevel),e.expression&&(n.expression=e.expression),Array.isArray(e.duration_levels)&&e.duration_levels.length>0&&(n.duration_levels=[...e.duration_levels]),e.duration_format&&(n.duration_format=e.duration_format),e.currency?.id&&e.currency.symbol&&(n.currency={id:e.currency.id,name:e.currency.name,symbol:e.currency.symbol}),n},_=(r,e={})=>{if(!r?.id)return[];const i=[];return Array.isArray(r.columns)&&r.columns.forEach(c=>{const s=O(r.id,c,e);s&&i.push(s)}),Array.isArray(r.formulas)&&r.formulas.forEach(c=>{const s=M(r.id,c,e);s&&i.push(s)}),i},w=(r,e={})=>r.map(i=>({id:i.id,name:i.name,description:i.description,dataItems:_(i,e)})),E=async(r,e)=>{if(!Array.isArray(r)||r.length===0)throw new Error("At least one dataset ID is required");const{dataBrokerConfig:i}=e;if(!i)throw new Error("dataBrokerConfig is required");if(!i.authKey||!i.authToken)throw new Error("Both authKey and authToken are required for DataBroker configuration");if(!i.apiUrl)throw new Error("apiUrl is required for DataBroker configuration");if(typeof i.apiUrl!="string")throw new TypeError("apiUrl must be a valid string");m.dataBroker.configure(i);try{const c=await m.dataBroker.fetchDatasetsWithColumnsAndFormulas(r);return w(c)}catch(c){throw c instanceof Error&&c.message.includes("Authentication failed")?new Error("Failed to load datasets: Authentication failed. Please verify your API credentials are correct."):c}};function F(r){const e=[],i=[];Object.keys(h.slotsConfigs).forEach(t=>{t.replace("SlotsConfig","");const o=t.replace("SlotsConfig","").replaceAll(/([A-Z])/g,"-$1").toLowerCase();i.push({type:o,slotsConfig:h.slotsConfigs[t]})});const c=i.find(t=>t.type===r?.oldItemType),s=i.find(t=>t.type===r?.newItemType),n=structuredClone(s?.slotsConfig??[]);if(!s)return{type:c?.type??"bar-chart",slots:r.slots??[]};const d=structuredClone(r.slots??[]);for(const t of d){const o=c?.slotsConfig.find(A=>A.name===t.name);t.type=o?.type??t?.type}const a=d.filter(t=>t.type==="mixed").sort((t,o)=>t.order-o.order),l=n.filter(t=>t.type==="mixed").sort((t,o)=>t.order-o.order),b=d.filter(t=>t.type==="numeric").sort((t,o)=>t.order-o.order),x=n.filter(t=>t.type==="numeric").sort((t,o)=>t.order-o.order),p=[];for(const t of b)for(const o of t.content)o.key="old-measure-"+t?.name+"-"+t.content.indexOf(o),p.push(o);for(const t of a)for(const o of t.content)o.type==="numeric"&&(o.key="old-mixed-"+t?.name+"-"+t.content.indexOf(o),p.push(o));const S=[...x,...l].sort((t,o)=>n.indexOf(t)-n.indexOf(o));for(const t of p)for(const o of S)e.includes(t.key)||(o.content=o?.content??[],(o?.content?.length===0||o?.content?.length>0&&o?.canAcceptMultipleDataItems===!0)&&(o.content.push(t),e.push(t.key)));const I=d.filter(t=>t.type==="categorical").sort((t,o)=>t.order-o.order),D=n.filter(t=>t.type==="categorical").sort((t,o)=>t.order-o.order),y=[];for(const t of I)for(const o of t.content)o.key="old-dimension-"+t?.name+"-"+t.content.indexOf(o),y.push(o);for(const t of a)for(const o of t.content)o.type!=="numeric"&&(o.key="old-mixed-"+t?.name+"-"+t.content.indexOf(o),y.push(o));const v=[...D,...l].sort((t,o)=>n.indexOf(t)-n.indexOf(o));for(const t of y)if(!e.includes(t.key))for(const o of v)o&&!e.includes(t.key)&&(o.content=o?.content??[],(o?.content?.length===0||o?.content?.length>0&&o?.canAcceptMultipleDataItems===!0)&&(o.content.push(t),e.push(t.key)));let u={...r.options};return s.setInitialOptions&&(u=s?.setInitialOptions({...u})),{type:s.type??"bar-chart",slots:n.map(t=>({name:t.name,content:t.content??[]}))??[],options:u??{...r.options}}}exports.decomposeNumericFormat=C.decomposeNumericFormat;exports.formatter=k.formatter;exports.localize=T.localize;exports.getTheme=g.getTheme;exports.systemThemeIds=g.systemThemeIds;exports.convertDatasetsToDraggableItems=w;exports.loadDraggableItemsForDatasets=E;exports.switchItem=F;
|
package/components/utils.js
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
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 h } from "./index-
|
|
20
|
+
import { d as h } from "./index-BikhVAa1.js";
|
|
21
21
|
import { d as F } from "./decompose-numeric-format-BuZcjH2k.js";
|
|
22
22
|
import { f as H } from "./en-D3ihEGXg.js";
|
|
23
23
|
import { l as q } from "./localize-CcDpq940.js";
|
|
@@ -17,25 +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
|
|
20
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("@lit/localize"),v=require("@luzmo/icons");require("@luzmo/lucero/icon");require("@luzmo/lucero/tooltip");const n=require("lit"),r=require("lit/decorators.js"),s=require("../set-locale-B8iQGfk0.cjs"),z=':host{box-sizing:border-box;display:block;width:min-content}:host luzmo-icon{display:flex}:host .viz-item-menu{display:flex;flex-direction:column;align-items:center;gap:var(--luzmo-viz-item-menu-gap, var(--viz-item-menu-gap));font-size:var(--luzmo-viz-item-menu-font-size, var(--viz-item-menu-font-size));width:min-content}:host .viz-item-menu .viz-item-menu-top-section{display:flex;flex-direction:column;gap:var(--luzmo-viz-item-menu-button-edit-gap, var(--viz-item-menu-button-edit-gap))}:host .viz-item-menu .viz-item-menu-top-section>.viz-item-menu-button{padding:var(--luzmo-viz-item-menu-button-edit-padding, var(--viz-item-menu-button-edit-padding));background-color:var(--luzmo-viz-item-menu-button-edit-background, var(--viz-item-menu-button-edit-background))}:host .viz-item-menu .viz-item-menu-top-section>.viz-item-menu-button:first-of-type{border-top-right-radius:var(--luzmo-viz-item-menu-button-edit-border-radius, var(--viz-item-menu-button-edit-border-radius));border-top-left-radius:var(--luzmo-viz-item-menu-button-edit-border-radius, var(--viz-item-menu-button-edit-border-radius))}:host .viz-item-menu .viz-item-menu-top-section>.viz-item-menu-button:last-of-type{border-bottom-right-radius:var(--luzmo-viz-item-menu-button-edit-border-radius, var(--viz-item-menu-button-edit-border-radius));border-bottom-left-radius:var(--luzmo-viz-item-menu-button-edit-border-radius, var(--viz-item-menu-button-edit-border-radius));box-shadow:var(--luzmo-viz-item-menu-box-shadow, var(--viz-item-menu-box-shadow))}:host .viz-item-menu .viz-item-menu-top-section>.viz-item-menu-button:hover{background-color:var(--luzmo-viz-item-menu-button-edit-background-hover, var(--viz-item-menu-button-edit-background-hover))}:host .viz-item-menu .viz-item-menu-top-section>.viz-item-menu-button:active,:host .viz-item-menu .viz-item-menu-top-section>.viz-item-menu-button[selected]{background-color:var(--luzmo-viz-item-menu-button-edit-background-active, var(--viz-item-menu-button-edit-background-active))}:host .viz-item-menu .viz-item-menu-top-section>.viz-item-menu-button luzmo-icon{color:var(--luzmo-viz-item-menu-button-edit-icon-color, var(--viz-item-menu-button-edit-icon-color))}:host .viz-item-menu .viz-item-menu-button{display:flex;align-items:center;justify-content:center;cursor:pointer;position:relative;transition:var(--luzmo-viz-item-menu-transition, var(--viz-item-menu-transition));width:1rem;height:1rem}:host .viz-item-menu .viz-item-menu-button-delete{padding:var(--luzmo-viz-item-menu-delete-padding, var(--viz-item-menu-delete-padding));border-radius:var(--luzmo-viz-item-menu-delete-border-radius, var(--viz-item-menu-delete-border-radius));background-color:var(--luzmo-viz-item-menu-delete-background, var(--viz-item-menu-delete-background));box-shadow:var(--luzmo-viz-item-menu-box-shadow, var(--viz-item-menu-box-shadow))}:host .viz-item-menu .viz-item-menu-button-delete:hover,:host .viz-item-menu .viz-item-menu-button-delete[selected]{background-color:var(--luzmo-viz-item-menu-delete-background-hover, var(--viz-item-menu-delete-background-hover))}:host .viz-item-menu .viz-item-menu-button-delete:hover luzmo-icon,:host .viz-item-menu .viz-item-menu-button-delete[selected] luzmo-icon{color:var(--luzmo-viz-item-menu-delete-icon-color-hover, var(--viz-item-menu-delete-icon-color-hover))}:host .viz-item-menu .viz-item-menu-button-delete:active{background-color:var(--luzmo-viz-item-menu-delete-background-active, var(--viz-item-menu-delete-background-active))}:host .viz-item-menu .viz-item-menu-button-delete:active luzmo-icon{color:var(--luzmo-viz-item-menu-delete-icon-color-hover, var(--viz-item-menu-delete-icon-color-hover))}:host .viz-item-menu .viz-item-menu-button-delete luzmo-icon{color:var(--luzmo-viz-item-menu-delete-icon-color, var(--viz-item-menu-delete-icon-color))}:host .viz-item-menu luzmo-tooltip{--tooltip-font-family: var( --luzmo-viz-item-menu-tooltip-font-family, var(--viz-item-menu-tooltip-font-family) );font-family:var(--luzmo-viz-item-menu-tooltip-font-family, var(--viz-item-menu-tooltip-font-family))}:host{--viz-item-menu-gap: var(--luzmo-spacing-3, .375rem);--viz-item-menu-button-edit-gap: 0;--viz-item-menu-button-edit-padding: var(--luzmo-spacing-3, .125rem);--viz-item-menu-button-edit-border-radius: var(--luzmo-border-radius, .25rem);--viz-item-menu-button-edit-background: var(--luzmo-selected-color-hover, rgb(70, 69, 76));--viz-item-menu-button-edit-background-hover: var(--secondary, var(--luzmo-primary));--viz-item-menu-button-edit-background-active: var(--primary, var(--luzmo-primary));--viz-item-menu-button-edit-icon-color: var(--luzmo-primary-inverse-color, white);--viz-item-menu-delete-padding: var(--luzmo-spacing-3, .125rem);--viz-item-menu-delete-border-radius: var(--luzmo-border-radius, .25rem);--viz-item-menu-delete-background: var(--luzmo-selected-color-hover, rgb(70, 69, 76));--viz-item-menu-delete-background-hover: var(--luzmo-negative-color, rgb(222, 55, 55));--viz-item-menu-delete-background-active: var(--luzmo-negative-color, rgb(222, 55, 55));--viz-item-menu-delete-icon-color: var(--luzmo-primary-inverse-color, white);--viz-item-menu-delete-icon-color-hover: var(--luzmo-primary-inverse-color, white);--viz-item-menu-transition: all var(--luzmo-animation-duration, .2s) ease;--viz-item-menu-font-size: var(--luzmo-font-size-m, .875rem);--viz-item-menu-box-shadow: 0px 4px 4px 0px var(--Boxshadow, rgba(var(--luzmo-border-color-rgb), .2));--viz-item-menu-tooltip-font-family: var(--luzmo-font-family, "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif)}';var c=Object.defineProperty,b=Object.getOwnPropertyDescriptor,u=(l,e,i,t)=>{for(var o=t>1?void 0:t?b(e,i):e,a=l.length-1,d;a>=0;a--)(d=l[a])&&(o=(t?d(e,i,o):d(o))||o);return t&&o&&c(e,i,o),o};exports.LuzmoVizItemMenu=class extends n.LitElement{constructor(){super(...arguments),this.vizItemId="",this.hiddenButtons=[],this.language="en",this.selectedButton=null,this.menuButtonConfigs={edit:{icon:v.luzmoEdit,label:"Edit",eventName:"edit",type:"edit",cssClass:"viz-item-menu-button viz-item-menu-button-edit",dataE2e:"viz-item-menu-button-edit",onHover:()=>this._handleHoverOverEdit()},clone:{icon:v.luzmoClone,label:"Clone",eventName:"clone",type:"clone",cssClass:"viz-item-menu-button viz-item-menu-button-clone",dataE2e:"viz-item-menu-button-clone"},delete:{icon:v.luzmoTrashOutline,label:"Delete",eventName:"delete",type:"delete",cssClass:"viz-item-menu-button viz-item-menu-button-delete",dataE2e:"viz-item-menu-button-delete"}}}get hasTopSectionButtons(){const e=this._shouldShowButton("edit"),i=this._shouldShowButton("clone");return e||i}_shouldShowButton(e){return!this.hiddenButtons?.includes(e)}willUpdate(e){e.has("language")&&this.language!==s.getLocale()&&([...s.targetLocales].includes(this.language??"en")||this.language==="en")&&s.setLocale(this.language)}_handleSelectedToggle(e){e==="edit"&&(this.selectedButton=this.selectedButton===e?null:e,this._emitSelectedChanged())}_emitSelectedChanged(){this.dispatchEvent(new CustomEvent("selected-changed",{bubbles:!0,composed:!0,detail:{selectedButton:this.selectedButton}}))}_handleMenuButtonClick(e){this._handleSelectedToggle(e.type),this.dispatchEvent(new CustomEvent("button-clicked",{bubbles:!0,composed:!0,detail:{action:e.eventName,type:e.type,id:this.vizItemId}}))}_createMenuButtonClickHandler(e){return()=>this._handleMenuButtonClick(e)}_handleHoverOverEdit(){this.dispatchEvent(new CustomEvent("edit-button-hovered",{bubbles:!0,composed:!0}))}_renderMenuButton(e){const i=this.selectedButton===e.type;let t="";return e.type==="edit"?t=m.msg("Edit",{desc:"Grid item action tooltip"}):e.type==="clone"?t=m.msg("Clone",{desc:"Grid item action tooltip"}):e.type==="delete"&&(t=m.msg("Delete",{desc:"Grid item action tooltip"})),n.html`
|
|
21
21
|
<div
|
|
22
22
|
class=${e.cssClass}
|
|
23
23
|
data-e2e=${e.dataE2e||""}
|
|
24
24
|
data-menu-button=${e.type}
|
|
25
25
|
role="button"
|
|
26
26
|
tabindex="0"
|
|
27
|
-
aria-label=${
|
|
28
|
-
?selected=${
|
|
27
|
+
aria-label=${t}
|
|
28
|
+
?selected=${i}
|
|
29
29
|
@mouseenter=${e.onHover}
|
|
30
30
|
@click=${this._createMenuButtonClickHandler(e)}
|
|
31
31
|
>
|
|
32
|
-
<luzmo-icon .icon=${e.icon} size="
|
|
32
|
+
<luzmo-icon .icon=${e.icon} size="xs"></luzmo-icon>
|
|
33
33
|
<luzmo-tooltip
|
|
34
34
|
self-managed
|
|
35
35
|
placement="right"
|
|
36
36
|
fallback-placements="left"
|
|
37
37
|
>
|
|
38
|
-
${
|
|
38
|
+
${t}
|
|
39
39
|
</luzmo-tooltip>
|
|
40
40
|
</div>
|
|
41
41
|
`}_renderTopSection(){return this.hasTopSectionButtons?n.html`
|
|
@@ -48,4 +48,4 @@
|
|
|
48
48
|
${this._renderTopSection()}
|
|
49
49
|
${this._renderBottomSection()}
|
|
50
50
|
</div>
|
|
51
|
-
`}};exports.LuzmoVizItemMenu.styles=n.unsafeCSS(z);exports.LuzmoVizItemMenu.tagName="luzmo-viz-item-menu";u([
|
|
51
|
+
`}};exports.LuzmoVizItemMenu.styles=n.unsafeCSS(z);exports.LuzmoVizItemMenu.tagName="luzmo-viz-item-menu";u([r.property({type:String,reflect:!0,attribute:"viz-item-id"})],exports.LuzmoVizItemMenu.prototype,"vizItemId",2);u([r.property({type:Array,attribute:!1})],exports.LuzmoVizItemMenu.prototype,"hiddenButtons",2);u([r.property({type:String,reflect:!0})],exports.LuzmoVizItemMenu.prototype,"language",2);u([r.property({type:String,reflect:!0,attribute:"selected-button"})],exports.LuzmoVizItemMenu.prototype,"selectedButton",2);exports.LuzmoVizItemMenu=u([m.localized()],exports.LuzmoVizItemMenu);customElements.get("luzmo-viz-item-menu")||customElements.define("luzmo-viz-item-menu",exports.LuzmoVizItemMenu);
|
|
@@ -17,26 +17,26 @@
|
|
|
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 { luzmoTrashOutline as
|
|
20
|
+
import { localized as c, msg as s } from "@lit/localize";
|
|
21
|
+
import { luzmoTrashOutline as z, luzmoClone as v, luzmoEdit as b } from "@luzmo/icons";
|
|
22
22
|
import "@luzmo/lucero/icon";
|
|
23
23
|
import "@luzmo/lucero/tooltip";
|
|
24
24
|
import { unsafeCSS as h, LitElement as p, html as n } from "lit";
|
|
25
25
|
import { property as l } from "lit/decorators.js";
|
|
26
|
-
import { g, t as f, s as x } from "../set-locale-
|
|
26
|
+
import { g, t as f, s as x } from "../set-locale-B5562CBM.js";
|
|
27
27
|
(function() {
|
|
28
28
|
if (typeof document < "u" && !document.querySelector("style[data-luzmo-vars]")) {
|
|
29
29
|
const o = document.createElement("style");
|
|
30
30
|
o.setAttribute("data-luzmo-vars", ""), o.textContent = 'html{--luzmo-animation-duration: 0.15s;--luzmo-border-color: rgba(var(--luzmo-border-color-rgb), 0.1);--luzmo-border-color-hover: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-down: rgba(var(--luzmo-border-color-rgb), 0.3);--luzmo-border-color-focus: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-rgb: 0, 0, 0;--luzmo-border-color-full: rgb(180, 180, 180);--luzmo-border-color-full-hover: rgb(140, 140, 140);--luzmo-border-color-full-down: rgb(110, 110, 110);--luzmo-border-color-full-focus: rgb(140, 140, 140);--luzmo-border-color-disabled: #dddddd;--luzmo-border-radius: 6px;--luzmo-border-radius-s: 4px;--luzmo-border-radius-l: 8px;--luzmo-border-radius-xl: 12px;--luzmo-border-radius-full: 999rem;--luzmo-background-color: #ffffff;--luzmo-background-color-rgb: 255, 255, 255;--luzmo-background-color-disabled: #eeeeee;--luzmo-background-color-hover: #f0f0fc;--luzmo-background-color-down: #f1f1ff;--luzmo-background-color-focus: #f0f0fc;--luzmo-background-color-highlight: rgb(240, 240, 240);--luzmo-background-color-highlight-disabled: rgb(245, 245, 245);--luzmo-background-color-highlight-hover: rgb(225, 225, 225);--luzmo-background-color-highlight-down: rgb(215, 215, 215);--luzmo-background-color-highlight-focus: rgb(225, 225, 225);--luzmo-background-color-alt-1: rgb(250, 250, 250);--luzmo-background-color-alt-2: rgb(239, 239, 239);--luzmo-border-width: 1px;--luzmo-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif;--luzmo-font-size-xs: 10px;--luzmo-font-size-s: 12px;--luzmo-font-size-m: 14px;--luzmo-font-size: 14px;--luzmo-font-size-l: 16px;--luzmo-font-size-xl: 18px;--luzmo-font-size-xxl: 20px;--luzmo-font-style: normal;--luzmo-line-height: normal;--luzmo-font-weight: 400;--luzmo-font-weight-semibold: 500;--luzmo-font-weight-bold: 600;--luzmo-font-color: #333;--luzmo-font-color-hard: #000;--luzmo-font-color-disabled: var(--luzmo-color-disabled);--luzmo-font-color-extra-dimmed: #888;--luzmo-font-color-hover: #333;--luzmo-font-color-down: #111;--luzmo-font-color-focus: #333;--luzmo-primary: #4434ff;--luzmo-primary-hover: #4234e4;--luzmo-primary-down: #392cc7;--luzmo-primary-focus: #4234e4;--luzmo-primary-inverse-color: #ffffff;--luzmo-primary-rgb: 68, 52, 255;--luzmo-secondary: #ff00ff;--luzmo-secondary-hover: #e309e3;--luzmo-secondary-down: #c711c7;--luzmo-secondary-focus: #e309e3;--luzmo-secondary-inverse-color: #ffffff;--luzmo-secondary-rgb: 255, 0, 255;--luzmo-secondary-outline: rgba(255, 0, 255, 0.2);--luzmo-negative-color: #ca221c;--luzmo-negative-color-hover: #b3241f;--luzmo-negative-color-down: #9f231f;--luzmo-negative-color-focus: #b3241f;--luzmo-negative-color-rgb: 202, 34, 28;--luzmo-positive-color: rgb(20, 150, 101);--luzmo-positive-color-hover: rgb(17, 128, 86);--luzmo-positive-color-down: rgb(16, 105, 71);--luzmo-positive-color-focus: rgb(17, 128, 86);--luzmo-positive-color-rgb: 20, 150, 101;--luzmo-selected-color: rgb(110, 110, 110);--luzmo-selected-color-hover: rgb(70, 70, 70);--luzmo-selected-color-down: rgb(40, 40, 40);--luzmo-selected-color-focus: rgb(70, 70, 70);--luzmo-selected-color-hard: #1e1e1e;--luzmo-selected-color-hard-hover: rgb(0, 0, 0);--luzmo-selected-color-hard-down: rgb(0, 0, 0);--luzmo-selected-color-hard-focus: rgb(0, 0, 0);--luzmo-color-informative: #1a77e9;--luzmo-color-informative-rgb: 26, 119, 233;--luzmo-color-disabled: #aaaaaa;--luzmo-spacing-1: 2px;--luzmo-spacing-2: 4px;--luzmo-spacing-3: 8px;--luzmo-spacing-4: 12px;--luzmo-spacing-5: 16px;--luzmo-indicator-gap: 2px;--luzmo-indicator-width: 1px;--luzmo-indicator-color: var(--luzmo-primary);--luzmo-component-height-xxs: 20px;--luzmo-component-height-xs: 24px;--luzmo-component-height-s: 28px;--luzmo-component-height: 32px;--luzmo-component-height-l: 40px;--luzmo-component-height-xl: 48px;--luzmo-component-height-xxl: 64px;--luzmo-icon-size-xxs: 12px;--luzmo-icon-size-xs: 14px;--luzmo-icon-size-s: 16px;--luzmo-icon-size-m: 18px;--luzmo-icon-size-l: 20px;--luzmo-icon-size-xl: 22px;--luzmo-icon-size-xxl: 32px}', document.head.appendChild(o);
|
|
31
31
|
}
|
|
32
32
|
})();
|
|
33
|
-
const y = ':host{box-sizing:border-box;display:block;width:min-content}:host luzmo-icon{display:flex}:host .viz-item-menu{display:flex;flex-direction:column;align-items:center;gap:var(--luzmo-viz-item-menu-gap, var(--viz-item-menu-gap));font-size:var(--luzmo-viz-item-menu-font-size, var(--viz-item-menu-font-size));width:min-content}:host .viz-item-menu .viz-item-menu-top-section{display:flex;flex-direction:column;gap:var(--luzmo-viz-item-menu-button-edit-gap, var(--viz-item-menu-button-edit-gap))}:host .viz-item-menu .viz-item-menu-top-section>.viz-item-menu-button{padding:var(--luzmo-viz-item-menu-button-edit-padding, var(--viz-item-menu-button-edit-padding));background-color:var(--luzmo-viz-item-menu-button-edit-background, var(--viz-item-menu-button-edit-background))}:host .viz-item-menu .viz-item-menu-top-section>.viz-item-menu-button:first-of-type{border-top-right-radius:var(--luzmo-viz-item-menu-button-edit-border-radius, var(--viz-item-menu-button-edit-border-radius));border-top-left-radius:var(--luzmo-viz-item-menu-button-edit-border-radius, var(--viz-item-menu-button-edit-border-radius))}:host .viz-item-menu .viz-item-menu-top-section>.viz-item-menu-button:last-of-type{border-bottom-right-radius:var(--luzmo-viz-item-menu-button-edit-border-radius, var(--viz-item-menu-button-edit-border-radius));border-bottom-left-radius:var(--luzmo-viz-item-menu-button-edit-border-radius, var(--viz-item-menu-button-edit-border-radius));box-shadow:var(--luzmo-viz-item-menu-box-shadow, var(--viz-item-menu-box-shadow))}:host .viz-item-menu .viz-item-menu-top-section>.viz-item-menu-button:hover
|
|
34
|
-
var k = Object.defineProperty, w = Object.getOwnPropertyDescriptor, u = (e, o,
|
|
35
|
-
for (var
|
|
36
|
-
(d = e[a]) && (
|
|
37
|
-
return m &&
|
|
33
|
+
const y = ':host{box-sizing:border-box;display:block;width:min-content}:host luzmo-icon{display:flex}:host .viz-item-menu{display:flex;flex-direction:column;align-items:center;gap:var(--luzmo-viz-item-menu-gap, var(--viz-item-menu-gap));font-size:var(--luzmo-viz-item-menu-font-size, var(--viz-item-menu-font-size));width:min-content}:host .viz-item-menu .viz-item-menu-top-section{display:flex;flex-direction:column;gap:var(--luzmo-viz-item-menu-button-edit-gap, var(--viz-item-menu-button-edit-gap))}:host .viz-item-menu .viz-item-menu-top-section>.viz-item-menu-button{padding:var(--luzmo-viz-item-menu-button-edit-padding, var(--viz-item-menu-button-edit-padding));background-color:var(--luzmo-viz-item-menu-button-edit-background, var(--viz-item-menu-button-edit-background))}:host .viz-item-menu .viz-item-menu-top-section>.viz-item-menu-button:first-of-type{border-top-right-radius:var(--luzmo-viz-item-menu-button-edit-border-radius, var(--viz-item-menu-button-edit-border-radius));border-top-left-radius:var(--luzmo-viz-item-menu-button-edit-border-radius, var(--viz-item-menu-button-edit-border-radius))}:host .viz-item-menu .viz-item-menu-top-section>.viz-item-menu-button:last-of-type{border-bottom-right-radius:var(--luzmo-viz-item-menu-button-edit-border-radius, var(--viz-item-menu-button-edit-border-radius));border-bottom-left-radius:var(--luzmo-viz-item-menu-button-edit-border-radius, var(--viz-item-menu-button-edit-border-radius));box-shadow:var(--luzmo-viz-item-menu-box-shadow, var(--viz-item-menu-box-shadow))}:host .viz-item-menu .viz-item-menu-top-section>.viz-item-menu-button:hover{background-color:var(--luzmo-viz-item-menu-button-edit-background-hover, var(--viz-item-menu-button-edit-background-hover))}:host .viz-item-menu .viz-item-menu-top-section>.viz-item-menu-button:active,:host .viz-item-menu .viz-item-menu-top-section>.viz-item-menu-button[selected]{background-color:var(--luzmo-viz-item-menu-button-edit-background-active, var(--viz-item-menu-button-edit-background-active))}:host .viz-item-menu .viz-item-menu-top-section>.viz-item-menu-button luzmo-icon{color:var(--luzmo-viz-item-menu-button-edit-icon-color, var(--viz-item-menu-button-edit-icon-color))}:host .viz-item-menu .viz-item-menu-button{display:flex;align-items:center;justify-content:center;cursor:pointer;position:relative;transition:var(--luzmo-viz-item-menu-transition, var(--viz-item-menu-transition));width:1rem;height:1rem}:host .viz-item-menu .viz-item-menu-button-delete{padding:var(--luzmo-viz-item-menu-delete-padding, var(--viz-item-menu-delete-padding));border-radius:var(--luzmo-viz-item-menu-delete-border-radius, var(--viz-item-menu-delete-border-radius));background-color:var(--luzmo-viz-item-menu-delete-background, var(--viz-item-menu-delete-background));box-shadow:var(--luzmo-viz-item-menu-box-shadow, var(--viz-item-menu-box-shadow))}:host .viz-item-menu .viz-item-menu-button-delete:hover,:host .viz-item-menu .viz-item-menu-button-delete[selected]{background-color:var(--luzmo-viz-item-menu-delete-background-hover, var(--viz-item-menu-delete-background-hover))}:host .viz-item-menu .viz-item-menu-button-delete:hover luzmo-icon,:host .viz-item-menu .viz-item-menu-button-delete[selected] luzmo-icon{color:var(--luzmo-viz-item-menu-delete-icon-color-hover, var(--viz-item-menu-delete-icon-color-hover))}:host .viz-item-menu .viz-item-menu-button-delete:active{background-color:var(--luzmo-viz-item-menu-delete-background-active, var(--viz-item-menu-delete-background-active))}:host .viz-item-menu .viz-item-menu-button-delete:active luzmo-icon{color:var(--luzmo-viz-item-menu-delete-icon-color-hover, var(--viz-item-menu-delete-icon-color-hover))}:host .viz-item-menu .viz-item-menu-button-delete luzmo-icon{color:var(--luzmo-viz-item-menu-delete-icon-color, var(--viz-item-menu-delete-icon-color))}:host .viz-item-menu luzmo-tooltip{--tooltip-font-family: var( --luzmo-viz-item-menu-tooltip-font-family, var(--viz-item-menu-tooltip-font-family) );font-family:var(--luzmo-viz-item-menu-tooltip-font-family, var(--viz-item-menu-tooltip-font-family))}:host{--viz-item-menu-gap: var(--luzmo-spacing-3, .375rem);--viz-item-menu-button-edit-gap: 0;--viz-item-menu-button-edit-padding: var(--luzmo-spacing-3, .125rem);--viz-item-menu-button-edit-border-radius: var(--luzmo-border-radius, .25rem);--viz-item-menu-button-edit-background: var(--luzmo-selected-color-hover, rgb(70, 69, 76));--viz-item-menu-button-edit-background-hover: var(--secondary, var(--luzmo-primary));--viz-item-menu-button-edit-background-active: var(--primary, var(--luzmo-primary));--viz-item-menu-button-edit-icon-color: var(--luzmo-primary-inverse-color, white);--viz-item-menu-delete-padding: var(--luzmo-spacing-3, .125rem);--viz-item-menu-delete-border-radius: var(--luzmo-border-radius, .25rem);--viz-item-menu-delete-background: var(--luzmo-selected-color-hover, rgb(70, 69, 76));--viz-item-menu-delete-background-hover: var(--luzmo-negative-color, rgb(222, 55, 55));--viz-item-menu-delete-background-active: var(--luzmo-negative-color, rgb(222, 55, 55));--viz-item-menu-delete-icon-color: var(--luzmo-primary-inverse-color, white);--viz-item-menu-delete-icon-color-hover: var(--luzmo-primary-inverse-color, white);--viz-item-menu-transition: all var(--luzmo-animation-duration, .2s) ease;--viz-item-menu-font-size: var(--luzmo-font-size-m, .875rem);--viz-item-menu-box-shadow: 0px 4px 4px 0px var(--Boxshadow, rgba(var(--luzmo-border-color-rgb), .2));--viz-item-menu-tooltip-font-family: var(--luzmo-font-family, "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif)}';
|
|
34
|
+
var k = Object.defineProperty, w = Object.getOwnPropertyDescriptor, u = (e, o, t, m) => {
|
|
35
|
+
for (var r = m > 1 ? void 0 : m ? w(o, t) : o, a = e.length - 1, d; a >= 0; a--)
|
|
36
|
+
(d = e[a]) && (r = (m ? d(o, t, r) : d(r)) || r);
|
|
37
|
+
return m && r && k(o, t, r), r;
|
|
38
38
|
};
|
|
39
|
-
let
|
|
39
|
+
let i = class extends p {
|
|
40
40
|
constructor() {
|
|
41
41
|
super(...arguments), this.vizItemId = "", this.hiddenButtons = [], this.language = "en", this.selectedButton = null, this.menuButtonConfigs = {
|
|
42
42
|
edit: {
|
|
@@ -57,7 +57,7 @@ let t = class extends p {
|
|
|
57
57
|
dataE2e: "viz-item-menu-button-clone"
|
|
58
58
|
},
|
|
59
59
|
delete: {
|
|
60
|
-
icon:
|
|
60
|
+
icon: z,
|
|
61
61
|
label: "Delete",
|
|
62
62
|
eventName: "delete",
|
|
63
63
|
type: "delete",
|
|
@@ -134,28 +134,27 @@ let t = class extends p {
|
|
|
134
134
|
* Render a menu button
|
|
135
135
|
*/
|
|
136
136
|
_renderMenuButton(e) {
|
|
137
|
-
const o = this.selectedButton === e.type
|
|
138
|
-
|
|
139
|
-
})
|
|
140
|
-
return n`
|
|
137
|
+
const o = this.selectedButton === e.type;
|
|
138
|
+
let t = "";
|
|
139
|
+
return e.type === "edit" ? t = s("Edit", { desc: "Grid item action tooltip" }) : e.type === "clone" ? t = s("Clone", { desc: "Grid item action tooltip" }) : e.type === "delete" && (t = s("Delete", { desc: "Grid item action tooltip" })), n`
|
|
141
140
|
<div
|
|
142
141
|
class=${e.cssClass}
|
|
143
142
|
data-e2e=${e.dataE2e || ""}
|
|
144
143
|
data-menu-button=${e.type}
|
|
145
144
|
role="button"
|
|
146
145
|
tabindex="0"
|
|
147
|
-
aria-label=${
|
|
146
|
+
aria-label=${t}
|
|
148
147
|
?selected=${o}
|
|
149
148
|
@mouseenter=${e.onHover}
|
|
150
149
|
@click=${this._createMenuButtonClickHandler(e)}
|
|
151
150
|
>
|
|
152
|
-
<luzmo-icon .icon=${e.icon} size="
|
|
151
|
+
<luzmo-icon .icon=${e.icon} size="xs"></luzmo-icon>
|
|
153
152
|
<luzmo-tooltip
|
|
154
153
|
self-managed
|
|
155
154
|
placement="right"
|
|
156
155
|
fallback-placements="left"
|
|
157
156
|
>
|
|
158
|
-
${
|
|
157
|
+
${t}
|
|
159
158
|
</luzmo-tooltip>
|
|
160
159
|
</div>
|
|
161
160
|
`;
|
|
@@ -186,24 +185,24 @@ let t = class extends p {
|
|
|
186
185
|
`;
|
|
187
186
|
}
|
|
188
187
|
};
|
|
189
|
-
|
|
190
|
-
|
|
188
|
+
i.styles = h(y);
|
|
189
|
+
i.tagName = "luzmo-viz-item-menu";
|
|
191
190
|
u([
|
|
192
191
|
l({ type: String, reflect: !0, attribute: "viz-item-id" })
|
|
193
|
-
],
|
|
192
|
+
], i.prototype, "vizItemId", 2);
|
|
194
193
|
u([
|
|
195
194
|
l({ type: Array, attribute: !1 })
|
|
196
|
-
],
|
|
195
|
+
], i.prototype, "hiddenButtons", 2);
|
|
197
196
|
u([
|
|
198
197
|
l({ type: String, reflect: !0 })
|
|
199
|
-
],
|
|
198
|
+
], i.prototype, "language", 2);
|
|
200
199
|
u([
|
|
201
200
|
l({ type: String, reflect: !0, attribute: "selected-button" })
|
|
202
|
-
],
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
],
|
|
206
|
-
customElements.get("luzmo-viz-item-menu") || customElements.define("luzmo-viz-item-menu",
|
|
201
|
+
], i.prototype, "selectedButton", 2);
|
|
202
|
+
i = u([
|
|
203
|
+
c()
|
|
204
|
+
], i);
|
|
205
|
+
customElements.get("luzmo-viz-item-menu") || customElements.define("luzmo-viz-item-menu", i);
|
|
207
206
|
export {
|
|
208
|
-
|
|
207
|
+
i as LuzmoVizItemMenu
|
|
209
208
|
};
|