@luzmo/analytics-components-kit 1.0.1-alpha.87 → 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/display-settings-binning.component.ts +2 -2
- package/angular/components/display-settings-datetime.component.ts +2 -2
- package/angular/components/display-settings-grand-totals.component.ts +2 -2
- package/angular/components/display-settings-numeric.component.ts +2 -2
- package/angular/components/display-settings.component.ts +3 -3
- package/angular/components/draggable-data-item/index.ts +1 -0
- package/angular/components/draggable-data-item/types.ts +42 -0
- package/angular/components/draggable-data-item-level/index.ts +1 -0
- package/angular/components/draggable-data-item-level/types.ts +15 -0
- package/angular/components/draggable-data-item-level.component.ts +4 -10
- package/angular/components/draggable-data-item.component.ts +4 -10
- package/angular/components/droppable-slot/index.ts +1 -0
- package/angular/components/droppable-slot/types.ts +16 -0
- package/angular/components/droppable-slot.component.ts +5 -3
- package/angular/components/slot-menu/index.ts +1 -0
- package/angular/components/slot-menu/types.ts +31 -0
- package/angular/components/slot-menu-list.component.ts +2 -2
- package/angular/components/slot-menu.component.ts +3 -3
- package/angular/esm/components/display-settings-binning.component.d.ts +2 -1
- package/angular/esm/components/display-settings-datetime.component.d.ts +2 -2
- package/angular/esm/components/display-settings-grand-totals.component.d.ts +2 -1
- package/angular/esm/components/display-settings-numeric.component.d.ts +2 -1
- package/angular/esm/components/display-settings.component.d.ts +3 -3
- package/angular/esm/components/draggable-data-item/index.d.ts +1 -0
- package/angular/esm/components/draggable-data-item/index.js +1 -0
- package/angular/esm/components/draggable-data-item/types.d.ts +21 -0
- package/angular/esm/components/draggable-data-item/types.js +1 -0
- package/angular/esm/components/draggable-data-item-level/index.d.ts +1 -0
- package/angular/esm/components/draggable-data-item-level/index.js +1 -0
- package/angular/esm/components/draggable-data-item-level/types.d.ts +12 -0
- package/angular/esm/components/draggable-data-item-level/types.js +1 -0
- package/angular/esm/components/draggable-data-item-level.component.d.ts +9 -7
- package/angular/esm/components/draggable-data-item-level.component.js +2 -17
- package/angular/esm/components/draggable-data-item.component.d.ts +9 -7
- package/angular/esm/components/draggable-data-item.component.js +2 -17
- package/angular/esm/components/droppable-slot/index.d.ts +1 -0
- package/angular/esm/components/droppable-slot/index.js +1 -0
- package/angular/esm/components/droppable-slot/types.d.ts +9 -0
- package/angular/esm/components/droppable-slot/types.js +1 -0
- package/angular/esm/components/droppable-slot.component.d.ts +5 -4
- package/angular/esm/components/droppable-slot.component.js +7 -2
- package/angular/esm/components/slot-menu/index.d.ts +1 -0
- package/angular/esm/components/slot-menu/index.js +1 -0
- package/angular/esm/components/slot-menu/types.d.ts +25 -0
- package/angular/esm/components/slot-menu/types.js +1 -0
- package/angular/esm/components/slot-menu-list.component.d.ts +2 -1
- package/angular/esm/components/slot-menu.component.d.ts +3 -3
- package/angular/esm/types.d.ts +9 -3
- package/angular/tsconfig.json +3 -0
- package/angular/types.ts +24 -3
- package/angular/utils/base/base.d.ts +16 -0
- package/angular/utils/base/focus-visible.d.ts +29 -0
- package/angular/utils/base/focusable.d.ts +58 -0
- package/angular/utils/base/index.d.ts +4 -0
- package/angular/utils/base/sized-mixin.d.ts +17 -0
- package/angular/utils/color/color-palettes.d.ts +17 -0
- package/angular/utils/color/extrapolate-color.d.ts +1 -0
- package/angular/utils/data/load-draggable-items-for-datasets.d.ts +24 -0
- package/angular/utils/data-broker/index.d.ts +191 -0
- package/angular/utils/data-item-types/calculate-data-item-icon.d.ts +10 -0
- package/angular/utils/data-item-types/tests/calculate-data-item-icon.test.d.ts +1 -0
- package/angular/utils/drag/draggable.d.ts +13 -0
- package/angular/utils/filters/expressions.d.ts +15 -0
- package/angular/utils/filters/index.d.ts +1 -0
- package/angular/utils/formatter/calculate-duration.d.ts +2 -0
- package/angular/utils/formatter/decompose-numeric-format.d.ts +11 -0
- package/angular/utils/formatter/default-local-formats.d.ts +20 -0
- package/angular/utils/formatter/formats/cs.d.ts +20 -0
- package/angular/utils/formatter/formats/da.d.ts +20 -0
- package/angular/utils/formatter/formats/de.d.ts +21 -0
- package/angular/utils/formatter/formats/en-GB.d.ts +21 -0
- package/angular/utils/formatter/formats/en-US.d.ts +1 -0
- package/angular/utils/formatter/formats/en.d.ts +1 -0
- package/angular/utils/formatter/formats/es.d.ts +54 -0
- package/angular/utils/formatter/formats/fi.d.ts +20 -0
- package/angular/utils/formatter/formats/fr.d.ts +54 -0
- package/angular/utils/formatter/formats/he.d.ts +20 -0
- package/angular/utils/formatter/formats/hu.d.ts +20 -0
- package/angular/utils/formatter/formats/it.d.ts +54 -0
- package/angular/utils/formatter/formats/ja.d.ts +20 -0
- package/angular/utils/formatter/formats/ko.d.ts +20 -0
- package/angular/utils/formatter/formats/mk.d.ts +20 -0
- package/angular/utils/formatter/formats/nl.d.ts +21 -0
- package/angular/utils/formatter/formats/no.d.ts +21 -0
- package/angular/utils/formatter/formats/pl.d.ts +20 -0
- package/angular/utils/formatter/formats/pt.d.ts +20 -0
- package/angular/utils/formatter/formats/ru.d.ts +20 -0
- package/angular/utils/formatter/formats/sv.d.ts +20 -0
- package/angular/utils/formatter/formats/tr.d.ts +21 -0
- package/angular/utils/formatter/formats/zh-CN.d.ts +20 -0
- package/angular/utils/formatter/formats/zh-TW.d.ts +20 -0
- package/angular/utils/formatter/formatter.d.ts +9 -0
- package/angular/utils/formatter/localize.d.ts +3 -0
- package/angular/utils/formatter/smart-datetime-formats.const.d.ts +36 -0
- package/angular/utils/get-css-variable.d.ts +1 -0
- package/angular/utils/index.d.ts +7 -0
- package/angular/utils/localize/set-locale.d.ts +7 -0
- package/angular/utils/map-tile-providers/index.d.ts +93 -0
- package/angular/utils/store/slot-context.d.ts +4 -0
- package/angular/utils/store/slot-store.d.ts +39 -0
- package/angular/utils/switch-item/index.d.ts +14 -0
- package/angular/utils/themes/bliss.d.ts +43 -0
- package/angular/utils/themes/classic-dark.d.ts +34 -0
- package/angular/utils/themes/classic.d.ts +43 -0
- package/angular/utils/themes/default-dark.d.ts +46 -0
- package/angular/utils/themes/default.d.ts +46 -0
- package/angular/utils/themes/index.d.ts +3 -0
- package/angular/utils/themes/orion.d.ts +44 -0
- package/angular/utils/themes/pinky.d.ts +42 -0
- package/angular/utils/themes/radiant.d.ts +42 -0
- package/angular/utils/themes/royale.d.ts +36 -0
- package/angular/utils/themes/seasonal.d.ts +43 -0
- package/angular/utils/themes/urban.d.ts +44 -0
- package/angular/utils/themes/vivid.d.ts +42 -0
- package/angular/utils/time/formats.const.d.ts +4 -0
- package/angular/utils/time/periods.const.d.ts +15 -0
- package/angular/utils/transformations/convert-data-item-to-slot-content.d.ts +9 -0
- package/angular/utils/transformations/convert-datasets-to-draggable-items.d.ts +17 -0
- package/angular/utils/transformations/tests/convert-data-item-to-slot-content.test.d.ts +1 -0
- package/angular/utils/transformations/tests/convert-datasets-to-draggable-items.test.d.ts +1 -0
- package/angular/utils/types/type-check.d.ts +7 -0
- package/components/ai-chat-message-assistant/index.cjs +1 -1
- package/components/ai-chat-message-assistant/index.js +0 -1
- package/components/calculate-data-item-icon-DMDhKq_m.js +147 -0
- package/components/{calculate-data-item-icon-CX4VW9Km.cjs → calculate-data-item-icon-DtVGbet3.cjs} +1 -1
- package/components/dataset-selector-list/index.cjs +1 -1
- package/components/dataset-selector-list/index.js +1 -1
- package/components/display-settings/display-settings.d.ts +4 -2
- package/components/display-settings/index.cjs +1 -1
- package/components/display-settings/index.js +1 -1
- package/components/display-settings-binning/display-settings-binning.d.ts +2 -1
- package/components/display-settings-datetime/display-settings-datetime.d.ts +2 -1
- package/components/display-settings-datetime/index.cjs +1 -1
- package/components/display-settings-datetime/index.js +4 -4
- package/components/display-settings-grand-totals/display-settings-grand-totals.d.ts +2 -1
- package/components/display-settings-numeric/display-settings-numeric.d.ts +2 -1
- package/components/display-settings-numeric/index.cjs +10 -10
- package/components/display-settings-numeric/index.js +5 -5
- package/components/draggable-data-item/draggable-data-item.d.ts +5 -7
- package/components/draggable-data-item/index.cjs +14 -22
- package/components/draggable-data-item/index.d.ts +1 -0
- package/components/draggable-data-item/index.js +80 -88
- package/components/draggable-data-item/types.d.ts +21 -0
- package/components/draggable-data-item-level/draggable-data-item-level.d.ts +4 -6
- package/components/draggable-data-item-level/helpers/generate-preview.d.ts +9 -1
- package/components/draggable-data-item-level/index.cjs +13 -13
- package/components/draggable-data-item-level/index.js +84 -102
- package/components/draggable-data-item-level/types.d.ts +12 -0
- package/components/droppable-slot/droppable-slot.d.ts +4 -2
- package/components/droppable-slot/index.cjs +13 -13
- package/components/droppable-slot/index.d.ts +1 -0
- package/components/droppable-slot/index.js +198 -199
- package/components/droppable-slot/types.d.ts +9 -0
- package/components/{en-CtCctD2c.js → en-D3ihEGXg.js} +67 -67
- package/components/{en--a5SfjnM.cjs → en-DZcn_iz_.cjs} +1 -1
- package/components/{en-GB-CXVKFWyH.cjs → en-GB-TqvgIw9B.cjs} +1 -1
- package/components/{en-GB-CbNfyZMo.js → en-GB-ialeqj_z.js} +1 -1
- package/components/filter-data-item-picker/index.cjs +1 -1
- package/components/filter-data-item-picker/index.js +1 -1
- package/components/filter-item/index.cjs +1 -1
- package/components/filter-item/index.js +8 -8
- package/components/filter-value-picker-hierarchy/index.cjs +1 -1
- package/components/filter-value-picker-hierarchy/index.js +1 -1
- package/components/filter-value-picker-numeric/index.cjs +1 -1
- package/components/filter-value-picker-numeric/index.js +1 -1
- package/components/{get-css-variable-CuDaWSjr.cjs → get-css-variable-COd1d84B.cjs} +3 -3
- package/components/{get-css-variable-DEf4GhTH.js → get-css-variable-CdwF98oh.js} +31 -31
- package/components/grid/index.cjs +1 -7
- package/components/grid/index.js +0 -7
- package/components/{index-BUal0r_D.cjs → index-BekTY3Em.cjs} +1 -1
- package/components/index-CFL6gmIu.cjs +20 -0
- package/components/{index-3WsfvkZF.js → index-CqKpf0B8.js} +1 -1
- package/components/{index-BGb_wRRW.js → index-DNPULp4A.js} +177 -188
- package/components/index.cjs +1 -1
- package/components/index.js +26 -24
- package/components/slot-contents-picker/index.cjs +1 -1
- package/components/slot-contents-picker/index.js +2 -2
- package/components/slot-menu/index.cjs +1 -1
- package/components/slot-menu/index.d.ts +1 -0
- package/components/slot-menu/index.js +64 -69
- package/components/slot-menu/slot-menu.d.ts +7 -6
- package/components/slot-menu/types.d.ts +25 -0
- package/components/slot-menu-list/index.cjs +1 -1
- package/components/slot-menu-list/index.js +2 -2
- package/components/slot-menu-list/slot-menu-list.d.ts +2 -1
- package/components/utils.cjs +1 -1
- package/components/utils.js +129 -62
- package/custom-elements.json +123 -126
- package/item-definitions/slicer-filter/slicer-filter-options.config.d.ts +1 -1
- package/package.json +1 -1
- package/types.d.ts +9 -3
- package/utils/data/load-draggable-items-for-datasets.d.ts +24 -0
- package/utils/data-broker/index.d.ts +69 -66
- package/utils/data-item-types/calculate-data-item-icon.d.ts +8 -2
- package/utils/data-item-types/tests/calculate-data-item-icon.test.d.ts +1 -0
- package/utils/index.d.ts +2 -0
- package/utils/transformations/convert-data-item-to-slot-content.d.ts +9 -0
- package/utils/transformations/convert-datasets-to-draggable-items.d.ts +17 -0
- package/utils/transformations/tests/convert-data-item-to-slot-content.test.d.ts +1 -0
- package/utils/transformations/tests/convert-datasets-to-draggable-items.test.d.ts +1 -0
- package/components/calculate-data-item-icon-C8CbsMQf.js +0 -139
- package/components/index-D1Y5TRsH.cjs +0 -20
- package/utils/types/column.types.d.ts +0 -57
|
@@ -17,34 +17,58 @@
|
|
|
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 { a as
|
|
21
|
-
import { ContextProvider as
|
|
22
|
-
import { msg as
|
|
23
|
-
import { Task as
|
|
24
|
-
import { luzmoIcon as
|
|
20
|
+
import { a as w } from "../get-css-variable-CdwF98oh.js";
|
|
21
|
+
import { ContextProvider as k } from "@lit/context";
|
|
22
|
+
import { msg as m, localized as S } from "@lit/localize";
|
|
23
|
+
import { Task as A } from "@lit/task";
|
|
24
|
+
import { luzmoIcon as z, luzmoCog as E, luzmoTrashOutline as L } from "@luzmo/icons";
|
|
25
25
|
import "@luzmo/lucero/tooltip";
|
|
26
|
-
import { d as
|
|
27
|
-
import { l as
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
26
|
+
import { d as y } from "../index-DNPULp4A.js";
|
|
27
|
+
import { i as c, l as I } from "../localize-CcDpq940.js";
|
|
28
|
+
import { D as $ } from "../en-D3ihEGXg.js";
|
|
29
|
+
import { html as d, unsafeCSS as O } from "lit";
|
|
30
|
+
import { property as n, query as _, state as x } from "lit/decorators.js";
|
|
31
|
+
import { L as T } from "../focusable-BS2pbY7w.js";
|
|
32
|
+
import { S as M } from "../sized-mixin-cJbo3PKR.js";
|
|
33
|
+
import { s as U } from "../index-CqKpf0B8.js";
|
|
34
|
+
import { signal as h, computed as F } from "@lit-labs/signals";
|
|
35
|
+
import { P as g } from "../types-RxAJdtVT.js";
|
|
36
|
+
import { g as P, t as B, s as G } from "../set-locale-hKTMz37h.js";
|
|
36
37
|
import "../slot-menu/index.js";
|
|
37
38
|
(function() {
|
|
38
39
|
if (typeof document < "u" && !document.querySelector("style[data-luzmo-vars]")) {
|
|
39
|
-
const
|
|
40
|
-
|
|
40
|
+
const t = document.createElement("style");
|
|
41
|
+
t.setAttribute("data-luzmo-vars", ""), t.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(t);
|
|
41
42
|
}
|
|
42
43
|
})();
|
|
43
|
-
|
|
44
|
+
const R = (o, t) => {
|
|
45
|
+
const e = {
|
|
46
|
+
type: o.type,
|
|
47
|
+
datasetId: o.datasetId,
|
|
48
|
+
set: o.datasetId
|
|
49
|
+
// TODO: Remove this once column/set -> columnId/datasetId migration is fully done.
|
|
50
|
+
};
|
|
51
|
+
"columnId" in o && !c(o.columnId) && o.columnId !== "" ? (e.columnId = o.columnId, e.column = o.columnId) : "formulaId" in o && !c(o.formulaId) && o.formulaId !== "" && (e.formulaId = o.formulaId, e.formula = o.formulaId);
|
|
52
|
+
const l = o.type === "datetime" || o.type === "array[datetime]", r = { ...o.name ?? { en: "Untitled" } };
|
|
53
|
+
let i = o.level;
|
|
54
|
+
if (l && (i = i ?? o.lowestLevel ?? 9, t)) {
|
|
55
|
+
const p = $.shortLevels?.filter((b) => b !== "All") ?? [], u = Math.max(0, Math.min(p.length - 1, (i ?? 1) - 1)), f = p[u];
|
|
56
|
+
if (f) {
|
|
57
|
+
const b = `(${f})`, D = Object.keys(r);
|
|
58
|
+
for (const v of D)
|
|
59
|
+
r[v] = `${r[v]} ${b}`;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return e.label = r, c(o.subtype) || (e.subtype = o.subtype), "lowestLevel" in o && !c(o.lowestLevel) && (e.lowestLevel = o.lowestLevel), c(o.format) || (e.format = o.format), c(i) || (e.level = i), c(o.lowestLevel) || (e.lowestLevel = o.lowestLevel), o.type === "numeric" && o.subtype === "currency" && o.currency?.symbol && (e.currency = o.currency.symbol), Array.isArray(o.duration_levels) && o.duration_format && (e.duration = {
|
|
63
|
+
levels: o.duration_levels,
|
|
64
|
+
format: o.duration_format
|
|
65
|
+
}), e;
|
|
66
|
+
};
|
|
67
|
+
class N {
|
|
44
68
|
constructor() {
|
|
45
|
-
this.slotContents =
|
|
69
|
+
this.slotContents = h([]), this.slotsContents = h([]), this.periodOverPeriodUiType = h(
|
|
46
70
|
null
|
|
47
|
-
), this.linkedDataset =
|
|
71
|
+
), this.linkedDataset = h(
|
|
48
72
|
[]
|
|
49
73
|
), this._popEnabledChartTypes = [
|
|
50
74
|
"area-chart",
|
|
@@ -52,36 +76,31 @@ class P {
|
|
|
52
76
|
"combination-chart",
|
|
53
77
|
"column-chart",
|
|
54
78
|
"line-chart"
|
|
55
|
-
], this.activeSlotContents =
|
|
79
|
+
], this.activeSlotContents = F(() => this.slotContents.get()[this.activeIndex.get()]), this.activeIndex = h(0);
|
|
56
80
|
}
|
|
57
|
-
isArrayColumnType(
|
|
58
|
-
return (
|
|
59
|
-
"array[numeric]",
|
|
60
|
-
"array[spatial]",
|
|
61
|
-
"array[datetime]",
|
|
62
|
-
"array[hierarchy]"
|
|
63
|
-
])).has(o);
|
|
81
|
+
isArrayColumnType(t) {
|
|
82
|
+
return t.startsWith("array[");
|
|
64
83
|
}
|
|
65
|
-
setPeriodOverPeriodCondition(
|
|
84
|
+
setPeriodOverPeriodCondition(t, e) {
|
|
66
85
|
if (!e?.periodOverPeriod?.newUi) {
|
|
67
|
-
this.periodOverPeriodUiType.set(this.oldConditionalLogic(
|
|
86
|
+
this.periodOverPeriodUiType.set(this.oldConditionalLogic(t));
|
|
68
87
|
return;
|
|
69
88
|
}
|
|
70
89
|
this.periodOverPeriodUiType.set(
|
|
71
90
|
this.getUiConditionToApply(e)
|
|
72
91
|
);
|
|
73
92
|
}
|
|
74
|
-
getUiConditionToApply(
|
|
75
|
-
const e = this.hasDatetimeColumnOnCategoryOrXAxis(), l =
|
|
93
|
+
getUiConditionToApply(t) {
|
|
94
|
+
const e = this.hasDatetimeColumnOnCategoryOrXAxis(), l = t?.periodOverPeriod?.hasConnectedComparisonFilter, r = this.linkedDataset.get().some(
|
|
76
95
|
({ columns: i }) => i?.some((p) => p.type === "datetime")
|
|
77
96
|
);
|
|
78
|
-
return !e && !l && !r ? null : e && l ?
|
|
97
|
+
return !e && !l && !r ? null : e && l ? g.HasDatetimeColumnAndComparisonFilters : e && !l ? g.HasDatetimeColumnAndNoComparisonFilters : !e && l ? g.NoDatetimeColumnButComparisonFilters : g.NoDatetimeColumnAndNoComparisonFilters;
|
|
79
98
|
}
|
|
80
|
-
oldConditionalLogic(
|
|
99
|
+
oldConditionalLogic(t) {
|
|
81
100
|
const e = this.slotsContents.get() ?? [], r = (e.find(
|
|
82
|
-
(
|
|
83
|
-
)?.content ?? [])?.[0] ?? null, i = e.find((
|
|
84
|
-
return r && this._popEnabledChartTypes.includes(
|
|
101
|
+
(u) => ["y-axis", "x-axis", "row"].includes(u.name)
|
|
102
|
+
)?.content ?? [])?.[0] ?? null, i = e.find((u) => u.name === "measure")?.content ?? [];
|
|
103
|
+
return r && this._popEnabledChartTypes.includes(t) && r.type === "datetime" && !this.isArrayColumnType(r.type) && !r.datetimeDisplayMode && r.level !== 4 && i.length > 0 ? g.OldImplementation : null;
|
|
85
104
|
}
|
|
86
105
|
/**
|
|
87
106
|
* Detects if there's a datetime column on Category or X-axis slots
|
|
@@ -93,54 +112,54 @@ class P {
|
|
|
93
112
|
return !!(l && l.type === "datetime" && !this.isArrayColumnType(l.type));
|
|
94
113
|
}
|
|
95
114
|
/** Replace the full list (e.g. after dropping or re-ordering). */
|
|
96
|
-
setContents(
|
|
97
|
-
if (this.slotContents.set(
|
|
115
|
+
setContents(t, e) {
|
|
116
|
+
if (this.slotContents.set(t), this.activeIndex.get() >= t.length && this.activeIndex.set(t.length > 0 ? t.length - 1 : 0), e) {
|
|
98
117
|
const l = structuredClone(this.slotsContents.get()) ?? [], r = l.find((i) => i.name === e);
|
|
99
|
-
r && (r.content =
|
|
118
|
+
r && (r.content = t), this.setFullContents(l);
|
|
100
119
|
}
|
|
101
120
|
}
|
|
102
|
-
setFullContents(
|
|
103
|
-
this.slotsContents.set(
|
|
121
|
+
setFullContents(t) {
|
|
122
|
+
this.slotsContents.set(t);
|
|
104
123
|
}
|
|
105
124
|
/** Change which item is considered active (e.g. user clicked in list). */
|
|
106
|
-
updateActive(
|
|
107
|
-
|
|
125
|
+
updateActive(t) {
|
|
126
|
+
t >= 0 && t < this.slotContents.get().length && this.activeIndex.set(t);
|
|
108
127
|
}
|
|
109
128
|
/** Update / overwrite a single content entry. */
|
|
110
|
-
updateContent(
|
|
129
|
+
updateContent(t, e = this.activeIndex.get()) {
|
|
111
130
|
if (e < 0 || e >= this.slotContents.get().length) return;
|
|
112
131
|
const l = [...this.slotContents.get()];
|
|
113
|
-
l[e] = structuredClone(
|
|
132
|
+
l[e] = structuredClone(t), this.slotContents.set(l);
|
|
114
133
|
}
|
|
115
134
|
/** Remove one content entry by index. */
|
|
116
|
-
removeContent(
|
|
117
|
-
if (
|
|
118
|
-
const e = this.slotContents.get().filter((l, r) => r !==
|
|
135
|
+
removeContent(t) {
|
|
136
|
+
if (t < 0 || t >= this.slotContents.get().length) return;
|
|
137
|
+
const e = this.slotContents.get().filter((l, r) => r !== t);
|
|
119
138
|
this.slotContents.set(e), this.activeIndex.get() >= e.length && this.activeIndex.set(e.length > 0 ? e.length - 1 : 0);
|
|
120
139
|
}
|
|
121
140
|
}
|
|
122
|
-
const
|
|
123
|
-
Category: () =>
|
|
124
|
-
Measure: () =>
|
|
125
|
-
Legend: () =>
|
|
126
|
-
"Y-Axis": () =>
|
|
127
|
-
"X-Axis": () =>
|
|
128
|
-
"Group by": () =>
|
|
141
|
+
const j = ":host{font-family:var(--luzmo-droppable-slot-font-family, var(--luzmo-font-family));--slot-height: var( --luzmo-droppable-slot-height, var(--droppable-slot-height) )}.droppable-slot-wrapper{position:relative;width:var(--slot-height);min-width:var(--slot-height);height:auto;overflow:visible}.droppable-slot[filled]{border:var(--luzmo-droppable-slot-filled-border-width, var(--droppable-slot-filled-border-width)) var(--luzmo-droppable-slot-filled-border-style, var(--droppable-slot-filled-border-style)) var(--luzmo-droppable-slot-filled-border-color, var(--droppable-slot-filled-border-color));background-color:var(--luzmo-droppable-slot-filled-background-color, var(--droppable-slot-filled-background-color));color:var(--luzmo-droppable-slot-filled-color, var(--droppable-slot-filled-color));padding-right:0;gap:var(--luzmo-droppable-slot-filled-gap, var(--droppable-slot-filled-gap))}.droppable-slot[filled]>*:not(luzmo-overlay){cursor:pointer}.droppable-slot{background-color:var(--luzmo-droppable-slot-background-color, var(--droppable-slot-background-color));color:var(--luzmo-droppable-slot-font-color, var(--droppable-slot-font-color));border:var(--luzmo-droppable-slot-border-width, var(--droppable-slot-border-width)) var(--luzmo-droppable-slot-border-style, var(--droppable-slot-border-style)) var(--luzmo-droppable-slot-border-color, var(--droppable-slot-border-color));display:flex;justify-content:space-between;align-items:center;padding-left:var(--luzmo-droppable-slot-edge-to-label, var(--droppable-slot-edge-to-label));padding-right:var(--luzmo-droppable-slot-label-to-controls, var(--droppable-slot-label-to-controls));border-radius:var(--luzmo-droppable-slot-border-radius, var(--droppable-slot-border-radius));height:var(--luzmo-droppable-slot-height, var(--droppable-slot-height))}:host(.pulse) .droppable-slot{animation:dropelementpulse 1s infinite ease-in-out}:host([accept-drag]) .droppable-slot{background-color:var(--luzmo-droppable-slot-accept-drag-background-color, var(--droppable-slot-accept-drag-background-color));color:var(--luzmo-droppable-slot-accept-drag-font-color, var(--droppable-slot-accept-drag-font-color));border-color:var(--luzmo-droppable-slot-accept-drag-border-color, var(--droppable-slot-accept-drag-border-color));animation:dropelementpulse 1s infinite ease-in-out}:host([accept-drag]) .controls{background-color:var(--luzmo-droppable-slot-accept-drag-controls-background-color, var(--droppable-slot-accept-drag-controls-background-color));color:var(--luzmo-droppable-slot-accept-drag-controls-color, var(--droppable-slot-accept-drag-controls-color))}:host([would-accept-drag]) .droppable-slot:not([filled]){animation:var(--luzmo-slot-would-accept-drop-animation, none)}@keyframes dropelementpulse{0%{box-shadow:0 0 0 0 var(--luzmo-droppable-slot-pulse-color, var(--droppable-slot-pulse-color)),0 0 0 0 var(--luzmo-droppable-slot-pulse-color, var(--droppable-slot-pulse-color))}to{box-shadow:0 0 0 1rem transparent,0 0 0 1rem transparent}}:host([disabled]) .droppable-slot{background-color:var(--luzmo-droppable-slot-background-color-disabled, var(--droppable-slot-background-color-disabled));color:var(--luzmo-droppable-slot-color-disabled, var(--droppable-slot-color-disabled));cursor:not-allowed}:host([disabled]) .drag-handle-icon{opacity:.25;font-size:12px}.drag-handle-icon{opacity:.5;font-size:12px}.droppable-slot-label{font-size:var(--luzmo-droppable-slot-label-font-size, var(--droppable-slot-label-font-size));padding-top:var(--luzmo-droppable-slot-label-padding-top, var(--droppable-slot-label-padding-top));padding-bottom:var(--luzmo-droppable-slot-label-padding-bottom, var(--droppable-slot-label-padding-bottom));flex-grow:1;max-width:var(--luzmo-droppable-slot-label-max-width);margin-right:var(--luzmo-droppable-slot-text-to-controls, var(--droppable-slot-text-to-controls));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.controls{height:100%;display:flex;align-items:center;gap:var(--luzmo-droppable-slot-controls-gap, var(--droppable-slot-controls-gap));background-color:var(--luzmo-droppable-slot-controls-background-color, var(--droppable-slot-controls-background-color));color:var(--luzmo-droppable-slot-controls-color, var(--droppable-slot-controls-color));margin-right:var(--luzmo-droppable-slot-controls-to-edge, var(--droppable-slot-controls-to-edge));padding:0 var(--luzmo-droppable-slot-controls-horizontal-padding, var(--droppable-slot-controls-horizontal-padding));font-size:var(--luzmo-droppable-slot-controls-font-size)}.controls div{cursor:pointer;height:100%;display:flex;align-items:center;padding:0 var(--luzmo-droppable-slot-controls-control-horizontal-padding, var(--droppable-slot-controls-control-horizontal-padding))}.droppable-slot.rotate{position:absolute;top:0;left:50%;transform-origin:center;max-width:15rem;transform:translate(-50%) rotate(-90deg)}luzmo-slot-menu[placement=bottom],luzmo-slot-menu[placement=top],luzmo-slot-menu[placement=bottom-start],luzmo-slot-menu[placement=top-start],luzmo-slot-menu[placement=bottom-end],luzmo-slot-menu[placement=top-end]{margin:var(--luzmo-droppable-slot-overlay-vertical-gap, var(--droppable-slot-overlay-vertical-gap)) 0}luzmo-slot-menu[placement=left],luzmo-slot-menu[placement=right],luzmo-slot-menu[placement=left-start],luzmo-slot-menu[placement=right-start],luzmo-slot-menu[placement=left-end],luzmo-slot-menu[placement=right-end]{margin:0 var(--luzmo-droppable-slot-overlay-horizontal-gap, var(--droppable-slot-overlay-horizontal-gap))}:host{--droppable-slot-border-width: var(--luzmo-border-width);--droppable-slot-border-style: dashed;--droppable-slot-border-color: var(--luzmo-border-color);--droppable-slot-background-color: transparent;--droppable-slot-accept-drag-background-color: var(--luzmo-positive-color);--droppable-slot-accept-drag-color: white;--droppable-slot-accept-drag-border-color: var(--luzmo-positive-color-down);--droppable-slot-accept-drag-font-color: white;--droppable-slot-font-color: var(--luzmo-font-color);--droppable-slot-controls-background-color: var(--luzmo-primary-down);--droppable-slot-controls-color: var(--luzmo-primary-inverse-color);--droppable-slot-accept-drag-controls-background-color: var( --luzmo-positive-color-down );--droppable-slot-accept-drag-controls-color: white;--droppable-slot-text-to-controls: var(--luzmo-spacing-3);--droppable-slot-controls-to-edge: 0;--droppable-slot-controls-gap: var(--luzmo-spacing-2);--droppable-slot-controls-horizontal-padding: var(--luzmo-spacing-2);--droppable-slot-controls-control-horizontal-padding: var(--luzmo-spacing-3);--droppable-slot-filled-background-color: var(--luzmo-primary);--droppable-slot-filled-color: var(--luzmo-primary-inverse-color);--droppable-slot-filled-border-width: var(--luzmo-border-width);--droppable-slot-filled-border-style: solid;--droppable-slot-filled-border-color: var(--luzmo-primary-down);--droppable-slot-height: var( --luzmo-droppable-slot-height, var(--luzmo-component-height) );--droppable-slot-label-font-size: var(--luzmo-font-size);--droppable-slot-icon-type-font-size: var(--luzmo-font-size);--droppable-slot-edge-to-label: var(--luzmo-spacing-5);--droppable-slot-label-to-controls: var(--luzmo-spacing-5);--droppable-slot-color-disabled: var(--luzmo-color-disabled);--droppable-slot-background-color-disabled: var( --luzmo-background-color-disabled );--droppable-slot-pulse-color: rgba(var(--luzmo-positive-color-rgb), .2);--droppable-slot-border-radius: var(--luzmo-border-radius);--droppable-slot-filled-gap: var(--luzmo-spacing-5)}:host{--droppable-slot-height: var( --luzmo-droppable-slot-height, var(--luzmo-component-height) );--droppable-slot-label-font-size: var(--luzmo-font-size);--droppable-slot-icon-type-font-size: var(--luzmo-font-size);--droppable-slot-horizontal-padding: var(--luzmo-spacing-4);--droppable-slot-overlay-horizontal-gap: var(--luzmo-spacing-4);--droppable-slot-overlay-vertical-gap: var(--luzmo-spacing-4)}:host([size=s]){--droppable-slot-height: var( --luzmo-droppable-slot-height, var(--luzmo-component-height-s) );--droppable-slot-label-font-size: var(--luzmo-font-size-s);--droppable-slot-icon-type-font-size: var(--luzmo-font-size-s);--droppable-slot-horizontal-padding: var(--luzmo-spacing-4);--droppable-slot-overlay-horizontal-gap: var(--luzmo-spacing-4);--droppable-slot-overlay-vertical-gap: var(--luzmo-spacing-4)}:host([size=l]){--droppable-slot-height: var( --luzmo-droppable-slot-height, var(--luzmo-component-height-l) );--droppable-slot-label-font-size: var(--luzmo-font-size-l);--droppable-slot-icon-type-font-size: var(--luzmo-font-size-l);--droppable-slot-horizontal-padding: var(--luzmo-spacing-5);--droppable-slot-overlay-horizontal-gap: var(--luzmo-spacing-5);--droppable-slot-overlay-vertical-gap: var(--luzmo-spacing-5)}:host([size=xl]){--droppable-slot-height: var( --luzmo-droppable-slot-height, var(--luzmo-component-height-xl) );--droppable-slot-label-font-size: var(--luzmo-font-size-xl);--droppable-slot-icon-type-font-size: var(--luzmo-font-size-xl);--droppable-slot-horizontal-padding: var(--luzmo-spacing-5);--droppable-slot-overlay-horizontal-gap: var(--luzmo-spacing-5);--droppable-slot-overlay-vertical-gap: var(--luzmo-spacing-5)}:host{box-sizing:border-box}", C = {
|
|
142
|
+
Category: () => m("Category", { desc: "Category label" }),
|
|
143
|
+
Measure: () => m("Measure", { desc: "Measure label" }),
|
|
144
|
+
Legend: () => m("Legend", { desc: "Legend label" }),
|
|
145
|
+
"Y-Axis": () => m("Y-Axis", { desc: "Y-Axis label" }),
|
|
146
|
+
"X-Axis": () => m("X-Axis", { desc: "X-Axis label" }),
|
|
147
|
+
"Group by": () => m("Group by", { desc: "Group by label" })
|
|
129
148
|
};
|
|
130
|
-
var
|
|
131
|
-
for (var r = l > 1 ? void 0 : l ?
|
|
132
|
-
(p =
|
|
133
|
-
return l && r &&
|
|
149
|
+
var H = Object.defineProperty, V = Object.getOwnPropertyDescriptor, a = (o, t, e, l) => {
|
|
150
|
+
for (var r = l > 1 ? void 0 : l ? V(t, e) : t, i = o.length - 1, p; i >= 0; i--)
|
|
151
|
+
(p = o[i]) && (r = (l ? p(t, e, r) : p(r)) || r);
|
|
152
|
+
return l && r && H(t, e, r), r;
|
|
134
153
|
};
|
|
135
|
-
let
|
|
154
|
+
let s = class extends M(T, {
|
|
136
155
|
validSizes: ["s", "m", "l", "xl"],
|
|
137
156
|
noDefaultSize: !0
|
|
138
157
|
}) {
|
|
139
158
|
constructor() {
|
|
140
|
-
super(), this._loadSlotsConfig = new
|
|
141
|
-
task: async ([
|
|
142
|
-
if (
|
|
143
|
-
const
|
|
159
|
+
super(), this._loadSlotsConfig = new A(this, {
|
|
160
|
+
task: async ([o]) => {
|
|
161
|
+
if (o && o !== this._itemTypeLoaded) {
|
|
162
|
+
const t = /* @__PURE__ */ Object.assign({
|
|
144
163
|
"../../item-definitions/area-chart/area-chart-slots.config.ts": () => import("../area-chart-slots.config-DoytjTpw.js"),
|
|
145
164
|
"../../item-definitions/bar-chart/bar-chart-slots.config.ts": () => import("../bar-chart-slots.config-Dn0IV43j.js"),
|
|
146
165
|
"../../item-definitions/box-plot/box-plot-slots.config.ts": () => import("../box-plot-slots.config-FI5Id-7p.js"),
|
|
@@ -186,16 +205,16 @@ let a = class extends $(L, {
|
|
|
186
205
|
"../../item-definitions/venn-diagram/venn-diagram-slots.config.ts": () => import("../venn-diagram-slots.config-BPxkBFb6.js"),
|
|
187
206
|
"../../item-definitions/video/video-slots.config.ts": () => import("../video-slots.config-IpwUxDyU.js"),
|
|
188
207
|
"../../item-definitions/wordcloud-chart/wordcloud-chart-slots.config.ts": () => import("../wordcloud-chart-slots.config-BS4sOOHt.js")
|
|
189
|
-
}), e = `../../item-definitions/${
|
|
190
|
-
if (
|
|
191
|
-
const l = await
|
|
192
|
-
this._itemTypeLoaded =
|
|
208
|
+
}), e = `../../item-definitions/${o}/${o}-slots.config.ts`;
|
|
209
|
+
if (t[e]) {
|
|
210
|
+
const l = await t[e]();
|
|
211
|
+
this._itemTypeLoaded = o, this._slotsConfig = l?.default ?? {};
|
|
193
212
|
}
|
|
194
213
|
return this._slotsConfig;
|
|
195
214
|
}
|
|
196
215
|
},
|
|
197
216
|
args: () => [this.itemType, this.language]
|
|
198
|
-
}), this.slotConfiguration = {}, this.slotsContents = [], this.language = "en", this.apiUrl = "https://api.luzmo.com", this.authKey = "", this.authToken = "", this.menu = "default", this.placement = "bottom-end", this._slotContents = [], this._overlayReady = !1, this._store = new
|
|
217
|
+
}), this._slotsConfig = [], this.slotConfiguration = {}, this.slotsContents = [], this.language = "en", this.rotate = !1, this.apiUrl = "https://api.luzmo.com", this.authKey = "", this.authToken = "", this.menu = "default", this.placement = "bottom-end", this._slotContents = [], this._overlayReady = !1, this._store = new N(), this._currentSlotContents = [], this._lastFetchedDatasetId = null, this._linkedDatasetsIds = [], this._acceptableColumnTypes = [
|
|
199
218
|
"datetime",
|
|
200
219
|
"hierarchy",
|
|
201
220
|
"numeric",
|
|
@@ -205,36 +224,15 @@ let a = class extends $(L, {
|
|
|
205
224
|
"array[hierarchy]",
|
|
206
225
|
"array[spatial]"
|
|
207
226
|
], this._attachDroppable = () => {
|
|
208
|
-
this._cleanupDroppable || (this._cleanupDroppable =
|
|
227
|
+
this._cleanupDroppable || (this._cleanupDroppable = w({
|
|
209
228
|
element: this,
|
|
210
|
-
onDrop: async (
|
|
211
|
-
const
|
|
212
|
-
|
|
213
|
-
}, l = o?.type;
|
|
214
|
-
if (l === "datetime" && !o.level && (o.level = o.lowestLevel ?? (o.subtype === "date" ? 5 : 9)), l === "datetime" && t?.source?.element?.hasAttribute("sublevel")) {
|
|
215
|
-
const p = [
|
|
216
|
-
"(Yr)",
|
|
217
|
-
"(Qtr)",
|
|
218
|
-
"(Mth)",
|
|
219
|
-
"(Wk)",
|
|
220
|
-
"(Date)",
|
|
221
|
-
"(Hr)",
|
|
222
|
-
"(Min)",
|
|
223
|
-
"(Sec)",
|
|
224
|
-
"(Msec)"
|
|
225
|
-
], m = o?.level ?? 1, C = Object.keys(e);
|
|
226
|
-
for (const g of C)
|
|
227
|
-
e[g] = `${e[g]} ${p[m - 1]}`;
|
|
228
|
-
o.label = o.name = e;
|
|
229
|
-
}
|
|
230
|
-
const { securable_id: r } = o;
|
|
231
|
-
r && r !== this._lastFetchedDatasetId && (this._lastFetchedDatasetId = r, await f.fetchDatasetsRecursive([r]), this._linkedDatasetsIds = f.getLinkedDatasetsIds(r));
|
|
232
|
-
const i = this._slotContents?.length === 0;
|
|
233
|
-
this._slotContents = this.slotConfiguration?.canAcceptMultipleDataItems ? [...this._slotContents ?? [], o] : [o], this.removeAttribute("accept-drag"), i ? (this._overlayReady = !1, setTimeout(() => {
|
|
229
|
+
onDrop: async (o) => {
|
|
230
|
+
const t = { ...o.source?.data }, e = o?.source?.element?.hasAttribute("sublevel") ?? !1, l = this._slotContents?.length === 0, r = t.datasetId, i = R(t, e);
|
|
231
|
+
this._slotContents = this.slotConfiguration?.canAcceptMultipleDataItems ? [...this._slotContents ?? [], i] : [i], this.removeAttribute("accept-drag"), r && r !== this._lastFetchedDatasetId && (this._lastFetchedDatasetId = r, await y.fetchDatasetsRecursive([r]), this._linkedDatasetsIds = y.getLinkedDatasetsIds(r)), l ? (this._overlayReady = !1, setTimeout(() => {
|
|
234
232
|
this._overlayReady = !0;
|
|
235
233
|
}, 200)) : this._overlayReady = !0, this.changedSlotContents(this._slotContents, this._linkedDatasetsIds), this.classList.remove("pulse");
|
|
236
234
|
},
|
|
237
|
-
canDrop: ({ source:
|
|
235
|
+
canDrop: ({ source: o }) => this._canDropItem({ source: o }),
|
|
238
236
|
getDropEffect: () => "move",
|
|
239
237
|
onDragEnter: () => {
|
|
240
238
|
this.setAttribute("accept-drag", ""), this.classList.add("pulse");
|
|
@@ -243,44 +241,42 @@ let a = class extends $(L, {
|
|
|
243
241
|
this.removeAttribute("accept-drag"), this.classList.remove("pulse");
|
|
244
242
|
}
|
|
245
243
|
}));
|
|
246
|
-
}, this._canDropItem = ({ source:
|
|
244
|
+
}, this._canDropItem = ({ source: o }) => {
|
|
247
245
|
if (![
|
|
248
246
|
"LUZMO-DRAGGABLE-DATA-ITEM-LEVEL",
|
|
249
247
|
"LUZMO-DRAGGABLE-DATA-ITEM"
|
|
250
|
-
].includes(
|
|
248
|
+
].includes(o.element?.tagName) || !this.slotConfiguration?.canAcceptFormula && (o?.data?.formulaId || o?.data?.formula || o?.data?.entity === "formula"))
|
|
251
249
|
return !1;
|
|
252
|
-
const
|
|
253
|
-
return
|
|
254
|
-
|
|
255
|
-
)
|
|
256
|
-
}, this.changedSlotContents = (t, o = []) => {
|
|
257
|
-
this._store?.setContents(t, this.slotName), this.dispatchEvent(
|
|
250
|
+
const { acceptableDataItemTypes: t, acceptableColumnSubtypes: e } = this.slotConfiguration ?? {}, l = Array.isArray(t) && t.length > 0 ? t : this._acceptableColumnTypes;
|
|
251
|
+
return o?.data?.type && !l.includes(o?.data?.type) ? !1 : !(o?.data?.subtype && Array.isArray(e) && e.length > 0 && !e.includes(o?.data?.subtype));
|
|
252
|
+
}, this.changedSlotContents = (o, t = []) => {
|
|
253
|
+
this._store?.setContents(o, this.slotName), this.dispatchEvent(
|
|
258
254
|
new CustomEvent("slot-contents-changed", {
|
|
259
255
|
bubbles: !0,
|
|
260
256
|
composed: !0,
|
|
261
257
|
cancelable: !0,
|
|
262
258
|
detail: {
|
|
263
|
-
slotContents:
|
|
264
|
-
linkedDatasetsIds:
|
|
259
|
+
slotContents: o,
|
|
260
|
+
linkedDatasetsIds: t
|
|
265
261
|
}
|
|
266
262
|
})
|
|
267
263
|
);
|
|
268
|
-
}, this._handleDragStart = (
|
|
269
|
-
const
|
|
264
|
+
}, this._handleDragStart = (o) => {
|
|
265
|
+
const t = o, e = t.detail?.data;
|
|
270
266
|
if (this._overlayElement && (this._overlayElement.open = !1), !e) return;
|
|
271
267
|
const l = {
|
|
272
268
|
data: e,
|
|
273
269
|
element: {
|
|
274
|
-
tagName:
|
|
270
|
+
tagName: t.target instanceof HTMLElement && t.target.tagName === "LUZMO-DRAGGABLE-DATA-ITEM-LEVEL" ? "LUZMO-DRAGGABLE-DATA-ITEM-LEVEL" : "LUZMO-DRAGGABLE-DATA-ITEM"
|
|
275
271
|
}
|
|
276
272
|
};
|
|
277
273
|
this._canDropItem({ source: l }) && this.setAttribute("would-accept-drag", "");
|
|
278
274
|
}, this._handleDragEnd = () => {
|
|
279
275
|
this.removeAttribute("would-accept-drag");
|
|
280
|
-
}, this._handleOverlayClick = (
|
|
281
|
-
|
|
282
|
-
}, new
|
|
283
|
-
context:
|
|
276
|
+
}, this._handleOverlayClick = (o) => {
|
|
277
|
+
o.detail > 0 && o.target === this._overlayElement ? this._overlayElement.open = !1 : o.stopPropagation();
|
|
278
|
+
}, new k(this, {
|
|
279
|
+
context: U,
|
|
284
280
|
initialValue: this._store
|
|
285
281
|
});
|
|
286
282
|
}
|
|
@@ -293,15 +289,15 @@ let a = class extends $(L, {
|
|
|
293
289
|
this._handleDragStart
|
|
294
290
|
), document.removeEventListener("data-item-dropped", this._handleDragEnd);
|
|
295
291
|
}
|
|
296
|
-
emptySlotContents(
|
|
297
|
-
|
|
292
|
+
emptySlotContents(o) {
|
|
293
|
+
o.preventDefault(), o.stopPropagation(), this._slotContents = [], this.changedSlotContents([]);
|
|
298
294
|
}
|
|
299
|
-
willUpdate(
|
|
300
|
-
|
|
295
|
+
willUpdate(o) {
|
|
296
|
+
o.has("slotConfiguration") && (this._cleanupDroppable && (this._cleanupDroppable(), this._cleanupDroppable = void 0), this._attachDroppable()), o.has("slotsContents") && this._processSlotsContents(), o.has("language") && this.language !== P() && ([...B].includes(this.language ?? "en") || this.language === "en") && G(this.language);
|
|
301
297
|
}
|
|
302
298
|
_processSlotsContents() {
|
|
303
299
|
this._store?.setFullContents(this.slotsContents), this._slotContents = this.slotsContents?.find(
|
|
304
|
-
(
|
|
300
|
+
(o) => o.name === this.slotName
|
|
305
301
|
)?.content ?? [], this._currentSlotContents = [...this._slotContents], this._slotContents?.length > 0 && (this._overlayReady = !0), this._store?.setContents(this._slotContents);
|
|
306
302
|
}
|
|
307
303
|
firstUpdated() {
|
|
@@ -310,9 +306,9 @@ let a = class extends $(L, {
|
|
|
310
306
|
/**
|
|
311
307
|
* Handle overlay open event - reset slot menu position
|
|
312
308
|
*/
|
|
313
|
-
_onOverlayClosed(
|
|
314
|
-
const
|
|
315
|
-
this._slotMenuElement &&
|
|
309
|
+
_onOverlayClosed(o) {
|
|
310
|
+
const t = o.overlay;
|
|
311
|
+
this._slotMenuElement && t === this._overlayElement && (setTimeout(() => {
|
|
316
312
|
this._slotMenuElement.resetPosition();
|
|
317
313
|
}, 500), this.dispatchEvent(
|
|
318
314
|
new CustomEvent("slot-menu-inactive", {
|
|
@@ -321,9 +317,9 @@ let a = class extends $(L, {
|
|
|
321
317
|
})
|
|
322
318
|
));
|
|
323
319
|
}
|
|
324
|
-
_onOverlayOpened(
|
|
325
|
-
const
|
|
326
|
-
if (this._slotMenuElement &&
|
|
320
|
+
_onOverlayOpened(o) {
|
|
321
|
+
const t = o.overlay;
|
|
322
|
+
if (this._slotMenuElement && t === this._overlayElement) {
|
|
327
323
|
const e = this._store?.activeIndex.get?.() ?? 0, l = this._slotContents?.[e] ?? this._slotContents?.[0];
|
|
328
324
|
if (!l) return;
|
|
329
325
|
const r = l?.column ?? l?.columnId, i = l?.set ?? l?.datasetId, p = l?.formula;
|
|
@@ -332,7 +328,7 @@ let a = class extends $(L, {
|
|
|
332
328
|
bubbles: !0,
|
|
333
329
|
composed: !0,
|
|
334
330
|
detail: {
|
|
335
|
-
|
|
331
|
+
datasetId: i
|
|
336
332
|
}
|
|
337
333
|
})
|
|
338
334
|
), setTimeout(() => {
|
|
@@ -341,55 +337,55 @@ let a = class extends $(L, {
|
|
|
341
337
|
bubbles: !0,
|
|
342
338
|
composed: !0,
|
|
343
339
|
detail: {
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
340
|
+
datasetId: i,
|
|
341
|
+
level: l?.level ?? 0,
|
|
342
|
+
...r && { columnId: r },
|
|
343
|
+
...p && { formulaId: p }
|
|
348
344
|
}
|
|
349
345
|
})
|
|
350
346
|
);
|
|
351
347
|
}));
|
|
352
348
|
}
|
|
353
349
|
}
|
|
354
|
-
_onSlotMenuChanges(
|
|
355
|
-
|
|
356
|
-
const
|
|
357
|
-
this._slotContents.length ===
|
|
350
|
+
_onSlotMenuChanges(o) {
|
|
351
|
+
o.preventDefault(), o.stopPropagation();
|
|
352
|
+
const t = o.detail.linkedDatasetsIds;
|
|
353
|
+
this._slotContents.length === o.detail.slotContents?.length ? (this._currentSlotContents = o.detail.slotContents, this.changedSlotContents(this._currentSlotContents, t)) : (this._slotContents = o.detail.slotContents, this.changedSlotContents(this._slotContents, t));
|
|
358
354
|
}
|
|
359
355
|
get _fullLabel() {
|
|
360
|
-
let
|
|
361
|
-
const
|
|
362
|
-
this._currentSlotContents?.length === 1 ?
|
|
356
|
+
let o = "";
|
|
357
|
+
const t = C[this.slotConfiguration?.label] ? C[this.slotConfiguration?.label]() : this.slotConfiguration?.label;
|
|
358
|
+
this._currentSlotContents?.length === 1 ? o = I(
|
|
363
359
|
this._currentSlotContents?.[0]?.label,
|
|
364
360
|
this.language
|
|
365
|
-
) ?? "Untitled" : this._currentSlotContents?.length > 1 && (
|
|
366
|
-
let e = this.label ||
|
|
367
|
-
return this._currentSlotContents?.length > 0 && (e += this._currentSlotContents?.length > 1 ? `: ${this._currentSlotContents.length} items` : `: ${
|
|
361
|
+
) ?? "Untitled" : this._currentSlotContents?.length > 1 && (o = `${this._currentSlotContents.length} items`);
|
|
362
|
+
let e = this.label || t || "Untitled";
|
|
363
|
+
return this._currentSlotContents?.length > 0 && (e += this._currentSlotContents?.length > 1 ? `: ${this._currentSlotContents.length} items` : `: ${o}`), e;
|
|
368
364
|
}
|
|
369
365
|
droppableSlotMarkup() {
|
|
370
|
-
const
|
|
366
|
+
const o = d`
|
|
371
367
|
<div
|
|
372
368
|
id="trigger"
|
|
373
|
-
class="droppable-slot ${this.
|
|
369
|
+
class="droppable-slot ${this.rotate ? "rotate" : ""}"
|
|
374
370
|
?filled=${this._slotContents?.length > 0}
|
|
375
371
|
>
|
|
376
372
|
<div class="droppable-slot-label">${this._fullLabel}</div>
|
|
377
373
|
${this._slotContents?.length > 0 && !(this.hideConfiguration && this.hideDelete) ? d`<div class="controls">
|
|
378
374
|
${this.hideConfiguration ? "" : d`<div>
|
|
379
|
-
${
|
|
375
|
+
${z(E)}
|
|
380
376
|
<luzmo-tooltip
|
|
381
377
|
self-managed
|
|
382
|
-
placement=${this.
|
|
378
|
+
placement=${this.rotate ? "right" : "top"}
|
|
383
379
|
size=${this.size}
|
|
384
380
|
>
|
|
385
381
|
edit
|
|
386
382
|
</luzmo-tooltip>
|
|
387
383
|
</div> `}
|
|
388
384
|
${this.hideDelete ? "" : d`<div @click=${this.emptySlotContents}>
|
|
389
|
-
${
|
|
385
|
+
${z(L)}
|
|
390
386
|
<luzmo-tooltip
|
|
391
387
|
self-managed
|
|
392
|
-
placement=${this.
|
|
388
|
+
placement=${this.rotate ? "right" : "top"}
|
|
393
389
|
size=${this.size}
|
|
394
390
|
>
|
|
395
391
|
Delete
|
|
@@ -399,7 +395,7 @@ let a = class extends $(L, {
|
|
|
399
395
|
${this._slotContents?.length > 0 && this._overlayReady ? d`<luzmo-overlay
|
|
400
396
|
trigger="trigger@click"
|
|
401
397
|
.placement=${this.placement}
|
|
402
|
-
offset=${this.
|
|
398
|
+
offset=${this.rotate ? "-100" : "-20"}
|
|
403
399
|
@luzmo-closed=${this._onOverlayClosed}
|
|
404
400
|
@luzmo-opened=${this._onOverlayOpened}
|
|
405
401
|
@click=${this._handleOverlayClick}
|
|
@@ -427,86 +423,89 @@ let a = class extends $(L, {
|
|
|
427
423
|
</luzmo-overlay>` : ""}
|
|
428
424
|
</div>
|
|
429
425
|
`;
|
|
430
|
-
return this.
|
|
426
|
+
return this.rotate ? d`<div class="droppable-slot-wrapper">${o}</div>` : o;
|
|
431
427
|
}
|
|
432
428
|
render() {
|
|
433
429
|
return this.slotConfiguration && Object.keys(this.slotConfiguration).length > 0 ? this.droppableSlotMarkup() : this._loadSlotsConfig.render({
|
|
434
430
|
pending: () => d`<p>Loading...</p>`,
|
|
435
|
-
complete: (
|
|
436
|
-
if (this.slotName && this.itemType &&
|
|
437
|
-
const
|
|
438
|
-
|
|
431
|
+
complete: (o) => {
|
|
432
|
+
if (this.slotName && this.itemType && o) {
|
|
433
|
+
const t = o.find((e) => e.name === this.slotName);
|
|
434
|
+
t && (this.slotConfiguration = t);
|
|
439
435
|
}
|
|
440
436
|
return this.droppableSlotMarkup();
|
|
441
437
|
},
|
|
442
|
-
error: (
|
|
438
|
+
error: (o) => d`
|
|
443
439
|
<div>
|
|
444
440
|
Could not load droppable slot: '${this.slotName}' of chart
|
|
445
|
-
'${this.itemType}': ${
|
|
441
|
+
'${this.itemType}': ${o}.
|
|
446
442
|
</div>
|
|
447
443
|
`
|
|
448
444
|
});
|
|
449
445
|
}
|
|
450
446
|
};
|
|
451
|
-
|
|
452
|
-
|
|
447
|
+
s.styles = O(j);
|
|
448
|
+
a([
|
|
453
449
|
n({ type: String, reflect: !0, attribute: "item-type" })
|
|
454
|
-
],
|
|
455
|
-
|
|
450
|
+
], s.prototype, "itemType", 2);
|
|
451
|
+
a([
|
|
456
452
|
n({ type: String, reflect: !0, attribute: "slot-name" })
|
|
457
|
-
],
|
|
458
|
-
|
|
453
|
+
], s.prototype, "slotName", 2);
|
|
454
|
+
a([
|
|
459
455
|
n({ type: Object })
|
|
460
|
-
],
|
|
461
|
-
|
|
456
|
+
], s.prototype, "slotConfiguration", 2);
|
|
457
|
+
a([
|
|
462
458
|
n({ type: Object })
|
|
463
|
-
],
|
|
464
|
-
|
|
459
|
+
], s.prototype, "slotsContents", 2);
|
|
460
|
+
a([
|
|
465
461
|
n({ type: String, reflect: !0 })
|
|
466
|
-
],
|
|
467
|
-
|
|
462
|
+
], s.prototype, "label", 2);
|
|
463
|
+
a([
|
|
468
464
|
n({ type: String, reflect: !0 })
|
|
469
|
-
],
|
|
470
|
-
|
|
465
|
+
], s.prototype, "language", 2);
|
|
466
|
+
a([
|
|
471
467
|
n({ type: String, reflect: !0, attribute: "drag-boundary" })
|
|
472
|
-
],
|
|
473
|
-
|
|
468
|
+
], s.prototype, "dragBoundary", 2);
|
|
469
|
+
a([
|
|
470
|
+
n({ type: Boolean, reflect: !0 })
|
|
471
|
+
], s.prototype, "rotate", 2);
|
|
472
|
+
a([
|
|
474
473
|
n({ type: String, attribute: "api-url", reflect: !0 })
|
|
475
|
-
],
|
|
476
|
-
|
|
474
|
+
], s.prototype, "apiUrl", 2);
|
|
475
|
+
a([
|
|
477
476
|
n({ type: String, attribute: "auth-key", reflect: !0 })
|
|
478
|
-
],
|
|
479
|
-
|
|
477
|
+
], s.prototype, "authKey", 2);
|
|
478
|
+
a([
|
|
480
479
|
n({ type: String, attribute: "auth-token", reflect: !0 })
|
|
481
|
-
],
|
|
482
|
-
|
|
480
|
+
], s.prototype, "authToken", 2);
|
|
481
|
+
a([
|
|
483
482
|
n({ type: String, reflect: !0 })
|
|
484
|
-
],
|
|
485
|
-
|
|
483
|
+
], s.prototype, "menu", 2);
|
|
484
|
+
a([
|
|
486
485
|
n({ type: String, reflect: !0 })
|
|
487
|
-
],
|
|
488
|
-
|
|
486
|
+
], s.prototype, "placement", 2);
|
|
487
|
+
a([
|
|
489
488
|
n({ type: Boolean, reflect: !0, attribute: "hide-delete" })
|
|
490
|
-
],
|
|
491
|
-
|
|
489
|
+
], s.prototype, "hideDelete", 2);
|
|
490
|
+
a([
|
|
492
491
|
n({ type: Boolean, reflect: !0, attribute: "hide-configuration" })
|
|
493
|
-
],
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
],
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
],
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
],
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
],
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
],
|
|
509
|
-
customElements.get("luzmo-droppable-slot") || customElements.define("luzmo-droppable-slot",
|
|
492
|
+
], s.prototype, "hideConfiguration", 2);
|
|
493
|
+
a([
|
|
494
|
+
_("luzmo-slot-menu")
|
|
495
|
+
], s.prototype, "_slotMenuElement", 2);
|
|
496
|
+
a([
|
|
497
|
+
_("luzmo-overlay")
|
|
498
|
+
], s.prototype, "_overlayElement", 2);
|
|
499
|
+
a([
|
|
500
|
+
x()
|
|
501
|
+
], s.prototype, "_slotContents", 2);
|
|
502
|
+
a([
|
|
503
|
+
x()
|
|
504
|
+
], s.prototype, "_overlayReady", 2);
|
|
505
|
+
s = a([
|
|
506
|
+
S()
|
|
507
|
+
], s);
|
|
508
|
+
customElements.get("luzmo-droppable-slot") || customElements.define("luzmo-droppable-slot", s);
|
|
510
509
|
export {
|
|
511
|
-
|
|
510
|
+
s as LuzmoDroppableSlot
|
|
512
511
|
};
|