@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
|
@@ -17,39 +17,43 @@
|
|
|
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 { luzmoIcon as
|
|
22
|
-
import { unsafeCSS as
|
|
23
|
-
import { property as
|
|
20
|
+
import { localized as p } from "@lit/localize";
|
|
21
|
+
import { luzmoIcon as u, luzmoSpin as h, luzmoArrowRight as b } from "@luzmo/icons";
|
|
22
|
+
import { unsafeCSS as g, LitElement as z, html as d } from "lit";
|
|
23
|
+
import { property as r, state as m } from "lit/decorators.js";
|
|
24
24
|
import { classMap as x } from "lit/directives/class-map.js";
|
|
25
25
|
import "../dataset-selector-row/index.js";
|
|
26
26
|
(function() {
|
|
27
27
|
if (typeof document < "u" && !document.querySelector("style[data-luzmo-vars]")) {
|
|
28
|
-
const
|
|
29
|
-
|
|
28
|
+
const e = document.createElement("style");
|
|
29
|
+
e.setAttribute("data-luzmo-vars", ""), e.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(e);
|
|
30
30
|
}
|
|
31
31
|
})();
|
|
32
|
-
const
|
|
33
|
-
var
|
|
34
|
-
for (var n = l > 1 ? void 0 : l ?
|
|
35
|
-
(
|
|
36
|
-
return l && n &&
|
|
32
|
+
const f = ":host{box-sizing:border-box;display:flex;flex-direction:column;background-color:var(--luzmo-ai-interaction-textarea-background-color, var(--ai-interaction-textarea-background-color));border:1px solid var(--luzmo-ai-interaction-textarea-border-color, var(--ai-interaction-textarea-border-color));border-radius:var(--luzmo-ai-interaction-textarea-border-radius, var(--ai-interaction-textarea-border-radius));padding:var(--luzmo-ai-interaction-textarea-padding, var(--ai-interaction-textarea-padding));gap:var(--luzmo-ai-interaction-textarea-gap, var(--ai-interaction-textarea-gap));font-family:var(--luzmo-ai-interaction-textarea-font-family, var(--ai-interaction-textarea-font-family));font-size:var(--luzmo-ai-interaction-textarea-font-size, var(--ai-interaction-textarea-font-size))}:host:has(textarea:focus){border-color:var(--luzmo-ai-interaction-textarea-focus-border-color, var(--ai-interaction-textarea-focus-border-color));box-shadow:var(--luzmo-ai-interaction-textarea-focus-box-shadow, var(--ai-interaction-textarea-focus-box-shadow))}:host .content-wrapper{display:flex;flex-direction:column;gap:var(--luzmo-ai-interaction-textarea-gap, var(--ai-interaction-textarea-gap))}:host .content-wrapper.single-line{flex-direction:row;align-items:center}:host .content-wrapper.single-line textarea{flex:1;min-height:auto}:host .content-wrapper.single-line .button-container{align-self:flex-end}:host .content-wrapper.disabled{opacity:.6;pointer-events:none;cursor:not-allowed}:host .content-wrapper.disabled *{pointer-events:none}:host textarea{background-color:var(--luzmo-ai-interaction-textarea-textarea-background, var(--ai-interaction-textarea-textarea-background));border:none;resize:none;outline:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;vertical-align:middle;padding:0;min-height:var(--luzmo-ai-interaction-textarea-textarea-min-height, var(--ai-interaction-textarea-textarea-min-height, 3rem));color:var(--luzmo-ai-interaction-textarea-textarea-color, var(--ai-interaction-textarea-textarea-color));font-family:var(--luzmo-ai-interaction-textarea-font-family, var(--ai-interaction-textarea-font-family));font-size:var(--luzmo-ai-interaction-textarea-font-size, var(--ai-interaction-textarea-font-size));line-height:1.5}:host textarea::placeholder{color:var(--luzmo-ai-interaction-textarea-textarea-placeholder-color, var(--ai-interaction-textarea-textarea-placeholder-color))}:host .button-container{text-align:var(--luzmo-ai-interaction-textarea-button-container-text-align, var(--ai-interaction-textarea-button-container-text-align))}:host .button-container button{padding:var(--luzmo-ai-interaction-textarea-button-padding, var(--ai-interaction-textarea-button-padding));min-width:var(--luzmo-ai-interaction-textarea-button-min-width, var(--ai-interaction-textarea-button-min-width));min-height:var(--luzmo-ai-interaction-textarea-button-min-height, var(--ai-interaction-textarea-button-min-height));border:none;border-radius:var(--luzmo-ai-interaction-textarea-button-border-radius, var(--ai-interaction-textarea-button-border-radius));font-size:var(--luzmo-ai-interaction-textarea-button-font-size, var(--ai-interaction-textarea-button-font-size));cursor:pointer;display:inline-flex;align-items:center;justify-content:center;transition:all .15s ease}:host .button-container button:disabled{opacity:.6;cursor:not-allowed}:host .button-container button.disabled{opacity:.6;cursor:not-allowed}:host .button-container button svg{display:flex;align-items:center;justify-content:center}:host .button-container button svg.spin{animation:spin 1s linear infinite}:host .button-container button.btn-primary{background-color:var(--luzmo-ai-interaction-textarea-button-background-color, var(--ai-interaction-textarea-button-background-color));color:var(--luzmo-ai-interaction-textarea-button-color, var(--ai-interaction-textarea-button-color))}:host .button-container button.btn-primary:hover:not(:disabled):not(.disabled){background-color:var(--luzmo-ai-interaction-textarea-button-background-color-hover, var(--ai-interaction-textarea-button-background-color-hover))}:host .button-container button.btn-primary:disabled,:host .button-container button.btn-primary.disabled{background-color:var(--luzmo-ai-interaction-textarea-button-background-color-disabled, var(--ai-interaction-textarea-button-background-color-disabled));opacity:.6}@keyframes spin{to{transform:rotate(360deg)}}:host{--ai-interaction-textarea-background-color: var(--luzmo-background-color-alt-2);--ai-interaction-textarea-border-color: var(--luzmo-border-color);--ai-interaction-textarea-border-radius: .5rem;--ai-interaction-textarea-padding: .75rem;--ai-interaction-textarea-gap: 1rem;--ai-interaction-textarea-focus-border-color: var(--luzmo-primary);--ai-interaction-textarea-focus-box-shadow: 0 0 1rem 0 var(--luzmo-primary-50);--ai-interaction-textarea-font-family: var(--luzmo-font-family);--ai-interaction-textarea-font-size: .875rem;--ai-interaction-textarea-textarea-background: transparent;--ai-interaction-textarea-textarea-color: var(--luzmo-font-color);--ai-interaction-textarea-textarea-placeholder-color: var(--luzmo-font-color-extra-dimmed);--ai-interaction-textarea-textarea-min-height: 3rem;--ai-interaction-textarea-button-container-text-align: right;--ai-interaction-textarea-button-padding: 0;--ai-interaction-textarea-button-min-width: 2rem;--ai-interaction-textarea-button-min-height: 1.875rem;--ai-interaction-textarea-button-border-radius: .5rem;--ai-interaction-textarea-button-font-size: 1rem;--ai-interaction-textarea-button-background-color: var(--luzmo-primary);--ai-interaction-textarea-button-background-color-hover: var(--luzmo-primary-hover);--ai-interaction-textarea-button-background-color-disabled: var(--luzmo-primary);--ai-interaction-textarea-button-color: var(--luzmo-primary-inverse-color)}";
|
|
33
|
+
var v = Object.defineProperty, y = Object.getOwnPropertyDescriptor, a = (t, e, i, l) => {
|
|
34
|
+
for (var n = l > 1 ? void 0 : l ? y(e, i) : e, s = t.length - 1, c; s >= 0; s--)
|
|
35
|
+
(c = t[s]) && (n = (l ? c(e, i, n) : c(n)) || n);
|
|
36
|
+
return l && n && v(e, i, n), n;
|
|
37
37
|
};
|
|
38
|
-
let
|
|
38
|
+
let o = class extends z {
|
|
39
39
|
constructor() {
|
|
40
|
-
super(...arguments), this.placeholder = "Type your prompt here...", this.selectedDatasets = [], this.authKey = "", this.authToken = "", this.apiUrl = "https://api.luzmo.com", this.appServer = "https://app.luzmo.com", this.flagOpendata = !1, this.disabled = !1, this._promptValue = "", this._isPromptValid = !1;
|
|
40
|
+
super(...arguments), this.placeholder = "Type your prompt here...", this.selectedDatasets = [], this.authKey = "", this.authToken = "", this.apiUrl = "https://api.luzmo.com", this.appServer = "https://app.luzmo.com", this.flagOpendata = !1, this.disabled = !1, this.singleLine = !1, this.hideDatasetButton = !1, this.isGenerating = !1, this.value = "", this._promptValue = "", this._isPromptValid = !1;
|
|
41
41
|
}
|
|
42
42
|
get _buttonDisabled() {
|
|
43
|
-
return this.disabled || this.selectedDatasets.length === 0 || !this._isPromptValid;
|
|
43
|
+
return this.hideDatasetButton ? this.disabled || !this._isPromptValid : this.disabled || this.selectedDatasets.length === 0 || !this._isPromptValid;
|
|
44
44
|
}
|
|
45
45
|
_autoResizeTextarea(t) {
|
|
46
|
-
t.style.height = "auto"
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
if (t.style.height = "auto", this.singleLine) {
|
|
47
|
+
const i = Number.parseFloat(getComputedStyle(t).fontSize) || 14, l = 1.5 * i, n = 8 * 1.5 * i, s = Math.max(l, Math.min(t.scrollHeight, n));
|
|
48
|
+
t.style.height = `${s}px`;
|
|
49
|
+
} else {
|
|
50
|
+
const l = Math.max(48, Math.min(t.scrollHeight, 192));
|
|
51
|
+
t.style.height = `${l}px`;
|
|
52
|
+
}
|
|
49
53
|
}
|
|
50
54
|
_handlePromptInput(t) {
|
|
51
|
-
const
|
|
52
|
-
this._promptValue =
|
|
55
|
+
const e = t.target;
|
|
56
|
+
this._promptValue = e.value, this._isPromptValid = e.value.trim().length > 0, this._autoResizeTextarea(e), e.scrollTo({ top: e.scrollHeight });
|
|
53
57
|
}
|
|
54
58
|
_handleKeyDown(t) {
|
|
55
59
|
t.key === "Enter" && !t.shiftKey && (t.preventDefault(), this._submitPrompt());
|
|
@@ -70,12 +74,18 @@ let e = class extends h {
|
|
|
70
74
|
);
|
|
71
75
|
}
|
|
72
76
|
_handleDatasetSelected(t) {
|
|
73
|
-
const
|
|
74
|
-
this.selectedDatasets.some((
|
|
77
|
+
const e = t.detail;
|
|
78
|
+
this.selectedDatasets.some((i) => i.id === e.id) || (this.selectedDatasets = [...this.selectedDatasets, e]);
|
|
75
79
|
}
|
|
76
80
|
_handleDatasetRemoved(t) {
|
|
77
|
-
const
|
|
78
|
-
this.selectedDatasets = this.selectedDatasets.filter((
|
|
81
|
+
const e = t.detail;
|
|
82
|
+
this.selectedDatasets = this.selectedDatasets.filter((i) => i.id !== e.id);
|
|
83
|
+
}
|
|
84
|
+
willUpdate(t) {
|
|
85
|
+
t.has("value") && (this._promptValue = this.value, this._isPromptValid = this.value.trim().length > 0, requestAnimationFrame(() => {
|
|
86
|
+
const e = this.shadowRoot?.querySelector("textarea");
|
|
87
|
+
e && this._autoResizeTextarea(e);
|
|
88
|
+
}));
|
|
79
89
|
}
|
|
80
90
|
firstUpdated() {
|
|
81
91
|
const t = this.shadowRoot?.querySelector("textarea");
|
|
@@ -84,21 +94,24 @@ let e = class extends h {
|
|
|
84
94
|
render() {
|
|
85
95
|
const t = {
|
|
86
96
|
"content-wrapper": !0,
|
|
87
|
-
disabled: this.disabled
|
|
97
|
+
disabled: this.disabled,
|
|
98
|
+
"single-line": this.singleLine
|
|
88
99
|
};
|
|
89
|
-
return
|
|
100
|
+
return d`
|
|
90
101
|
<div class=${x(t)}>
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
+
${this.hideDatasetButton ? "" : d`
|
|
103
|
+
<luzmo-dataset-selector-row
|
|
104
|
+
.selectedDatasets=${this.selectedDatasets}
|
|
105
|
+
auth-key=${this.authKey}
|
|
106
|
+
auth-token=${this.authToken}
|
|
107
|
+
api-url=${this.apiUrl}
|
|
108
|
+
app-server=${this.appServer}
|
|
109
|
+
?flag-opendata=${this.flagOpendata}
|
|
110
|
+
?disabled=${this.disabled}
|
|
111
|
+
@dataset-selected=${this._handleDatasetSelected}
|
|
112
|
+
@dataset-removed=${this._handleDatasetRemoved}
|
|
113
|
+
></luzmo-dataset-selector-row>
|
|
114
|
+
`}
|
|
102
115
|
|
|
103
116
|
<textarea
|
|
104
117
|
?autofocus=${!this.disabled}
|
|
@@ -107,7 +120,7 @@ let e = class extends h {
|
|
|
107
120
|
.value=${this._promptValue}
|
|
108
121
|
@input=${this._handlePromptInput}
|
|
109
122
|
@keydown=${this._handleKeyDown}
|
|
110
|
-
rows
|
|
123
|
+
rows=${this.singleLine ? "1" : "2"}
|
|
111
124
|
></textarea>
|
|
112
125
|
|
|
113
126
|
<div class="button-container">
|
|
@@ -116,49 +129,61 @@ let e = class extends h {
|
|
|
116
129
|
?disabled=${this._buttonDisabled}
|
|
117
130
|
@click=${this._submitPrompt}
|
|
118
131
|
>
|
|
119
|
-
${
|
|
132
|
+
${this.isGenerating ? u(h, { className: "spin" }) : u(b)}
|
|
120
133
|
</button>
|
|
121
134
|
</div>
|
|
122
135
|
</div>
|
|
123
136
|
`;
|
|
124
137
|
}
|
|
125
138
|
};
|
|
126
|
-
|
|
127
|
-
|
|
139
|
+
o.styles = g(f);
|
|
140
|
+
o.tagName = "luzmo-ai-interaction-textarea";
|
|
141
|
+
a([
|
|
142
|
+
r({ type: String })
|
|
143
|
+
], o.prototype, "placeholder", 2);
|
|
144
|
+
a([
|
|
145
|
+
r({ type: Array })
|
|
146
|
+
], o.prototype, "selectedDatasets", 2);
|
|
147
|
+
a([
|
|
148
|
+
r({ type: String, attribute: "auth-key" })
|
|
149
|
+
], o.prototype, "authKey", 2);
|
|
150
|
+
a([
|
|
151
|
+
r({ type: String, attribute: "auth-token" })
|
|
152
|
+
], o.prototype, "authToken", 2);
|
|
128
153
|
a([
|
|
129
|
-
|
|
130
|
-
],
|
|
154
|
+
r({ type: String, attribute: "api-url" })
|
|
155
|
+
], o.prototype, "apiUrl", 2);
|
|
131
156
|
a([
|
|
132
|
-
|
|
133
|
-
],
|
|
157
|
+
r({ type: String, attribute: "app-server" })
|
|
158
|
+
], o.prototype, "appServer", 2);
|
|
134
159
|
a([
|
|
135
|
-
|
|
136
|
-
],
|
|
160
|
+
r({ type: Boolean, attribute: "flag-opendata" })
|
|
161
|
+
], o.prototype, "flagOpendata", 2);
|
|
137
162
|
a([
|
|
138
|
-
|
|
139
|
-
],
|
|
163
|
+
r({ type: Boolean, reflect: !0, attribute: "disabled" })
|
|
164
|
+
], o.prototype, "disabled", 2);
|
|
140
165
|
a([
|
|
141
|
-
|
|
142
|
-
],
|
|
166
|
+
r({ type: Boolean, attribute: "single-line" })
|
|
167
|
+
], o.prototype, "singleLine", 2);
|
|
143
168
|
a([
|
|
144
|
-
|
|
145
|
-
],
|
|
169
|
+
r({ type: Boolean, attribute: "hide-dataset-button" })
|
|
170
|
+
], o.prototype, "hideDatasetButton", 2);
|
|
146
171
|
a([
|
|
147
|
-
|
|
148
|
-
],
|
|
172
|
+
r({ type: Boolean, attribute: "is-generating" })
|
|
173
|
+
], o.prototype, "isGenerating", 2);
|
|
149
174
|
a([
|
|
150
|
-
|
|
151
|
-
],
|
|
175
|
+
r({ type: String })
|
|
176
|
+
], o.prototype, "value", 2);
|
|
152
177
|
a([
|
|
153
|
-
|
|
154
|
-
],
|
|
178
|
+
m()
|
|
179
|
+
], o.prototype, "_promptValue", 2);
|
|
155
180
|
a([
|
|
156
|
-
|
|
157
|
-
],
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
],
|
|
161
|
-
customElements.get("luzmo-ai-interaction-textarea") || customElements.define("luzmo-ai-interaction-textarea",
|
|
181
|
+
m()
|
|
182
|
+
], o.prototype, "_isPromptValid", 2);
|
|
183
|
+
o = a([
|
|
184
|
+
p()
|
|
185
|
+
], o);
|
|
186
|
+
customElements.get("luzmo-ai-interaction-textarea") || customElements.define("luzmo-ai-interaction-textarea", o);
|
|
162
187
|
export {
|
|
163
|
-
|
|
188
|
+
o as LuzmoAiInteractionTextarea
|
|
164
189
|
};
|
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
import '@luzmo/lucero/
|
|
2
|
-
import '@luzmo/lucero/icon';
|
|
3
|
-
import '@luzmo/lucero/menu';
|
|
4
|
-
import '@luzmo/lucero/picker';
|
|
1
|
+
import '@luzmo/lucero/select';
|
|
5
2
|
import { CSSResultArray, PropertyValues, TemplateResult } from 'lit';
|
|
6
3
|
import { LuzmoElement } from '@luzmo/lucero/utils';
|
|
7
|
-
import {
|
|
8
|
-
declare const
|
|
4
|
+
import { DataItemExtended } from 'src/types';
|
|
5
|
+
declare const LuzmoDataItemsSelect_base: typeof LuzmoElement & {
|
|
9
6
|
new (...args: any[]): import("@luzmo/lucero").SizedElementInterface;
|
|
10
7
|
prototype: import("@luzmo/lucero").SizedElementInterface;
|
|
11
8
|
};
|
|
12
9
|
/**
|
|
13
|
-
* @element luzmo-
|
|
14
|
-
* @fires data-
|
|
10
|
+
* @element luzmo-data-items-select
|
|
11
|
+
* @fires data-items-selected - Emitted when data items are selected. Event detail contains `{ dataItems: DataItemSelected[] }`
|
|
15
12
|
*/
|
|
16
|
-
export declare class
|
|
13
|
+
export declare class LuzmoDataItemsSelect extends LuzmoDataItemsSelect_base {
|
|
17
14
|
static get styles(): CSSResultArray;
|
|
18
15
|
/**
|
|
19
16
|
* The language of the settings interface
|
|
@@ -24,17 +21,13 @@ export declare class LuzmoFilterDataItemPicker extends LuzmoFilterDataItemPicker
|
|
|
24
21
|
*/
|
|
25
22
|
contentLanguage: string;
|
|
26
23
|
/**
|
|
27
|
-
*
|
|
28
|
-
*/
|
|
29
|
-
hasLabel: boolean;
|
|
30
|
-
/**
|
|
31
|
-
* The label for the picker, if hasLabel is true
|
|
24
|
+
* The accessible label for the select (used for aria-label)
|
|
32
25
|
*/
|
|
33
26
|
label?: string;
|
|
34
27
|
/**
|
|
35
28
|
* Where to show icons
|
|
36
29
|
*/
|
|
37
|
-
icons?: 'none' | 'only
|
|
30
|
+
icons?: 'none' | 'menu-only' | 'all';
|
|
38
31
|
/**
|
|
39
32
|
* Allow no selection. If true, the picker will not show a value when no item is selected. Else if no value is provided it will pick the first item.
|
|
40
33
|
*/
|
|
@@ -44,9 +37,14 @@ export declare class LuzmoFilterDataItemPicker extends LuzmoFilterDataItemPicker
|
|
|
44
37
|
*/
|
|
45
38
|
placeholder: string;
|
|
46
39
|
/**
|
|
47
|
-
*
|
|
40
|
+
* Whether the picker allows single or multiple selections.
|
|
41
|
+
* @default 'single'
|
|
42
|
+
*/
|
|
43
|
+
selects: 'single' | 'multiple';
|
|
44
|
+
/**
|
|
45
|
+
* The dataItemIds to display in the picker. If not provided, the first item will be displayed (when allowEmpty is false).
|
|
48
46
|
*/
|
|
49
|
-
|
|
47
|
+
dataItemIds: string[];
|
|
50
48
|
/**
|
|
51
49
|
* Whether the picker is in loading state
|
|
52
50
|
*/
|
|
@@ -55,6 +53,22 @@ export declare class LuzmoFilterDataItemPicker extends LuzmoFilterDataItemPicker
|
|
|
55
53
|
* Whether the picker is invalid - eg. the dataItemId is not found in the datasetsDataItems or query failed to fetch data
|
|
56
54
|
*/
|
|
57
55
|
invalid: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Whether the picker is clearable
|
|
58
|
+
*/
|
|
59
|
+
clearable: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Whether the picker is in pending state
|
|
62
|
+
*/
|
|
63
|
+
pending: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Whether the picker is disabled
|
|
66
|
+
*/
|
|
67
|
+
disabled: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* The placement of the dropdown menu
|
|
70
|
+
*/
|
|
71
|
+
placement: 'top' | 'top-start' | 'top-end' | 'right' | 'right-start' | 'right-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end';
|
|
58
72
|
/**
|
|
59
73
|
* The datasets and their dataItems to display
|
|
60
74
|
*/
|
|
@@ -63,13 +77,14 @@ export declare class LuzmoFilterDataItemPicker extends LuzmoFilterDataItemPicker
|
|
|
63
77
|
name: {
|
|
64
78
|
[key: string]: string;
|
|
65
79
|
};
|
|
66
|
-
columns:
|
|
67
|
-
formulas:
|
|
80
|
+
columns: DataItemExtended[];
|
|
81
|
+
formulas: DataItemExtended[];
|
|
68
82
|
}[];
|
|
69
|
-
private
|
|
83
|
+
private _dataItemsSelected;
|
|
70
84
|
private _sendChangeEvent;
|
|
85
|
+
private _enrichDataItem;
|
|
71
86
|
setDataItem(event: CustomEvent): void;
|
|
72
|
-
private
|
|
87
|
+
private _findDataItemsInDatasetsDataItems;
|
|
73
88
|
protected willUpdate(changedProperties: PropertyValues): void;
|
|
74
89
|
protected render(): TemplateResult;
|
|
75
90
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
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";require("@luzmo/lucero/select");const I=require("lit"),f=require("@lit/localize"),p=require("@luzmo/lucero/utils"),h=require("../set-locale-B8iQGfk0.cjs"),r=require("lit/decorators.js"),g=require("../calculate-data-item-icon-DtVGbet3.cjs"),y=require("../localize-C4zNlrwK.cjs"),b=":host{font-family:var(--luzmo-font-family)}";var _=Object.defineProperty,D=Object.getOwnPropertyDescriptor,l=(o,s,i,e)=>{for(var t=e>1?void 0:e?D(s,i):s,n=o.length-1,c;n>=0;n--)(c=o[n])&&(t=(e?c(s,i,t):c(t))||t);return e&&t&&_(s,i,t),t};let a=class extends p.SizedMixin(p.LuzmoElement,{validSizes:Object.values(p.ElementSizes)}){constructor(){super(...arguments),this.language="en",this.contentLanguage="en",this.icons="menu-only",this.allowEmpty=!1,this.placeholder=f.msg("Select..."),this.selects="single",this.dataItemIds=[],this.loading=!1,this.invalid=!1,this.clearable=!1,this.pending=!1,this.disabled=!1,this.placement="bottom-start",this.datasetsDataItems=[],this._dataItemsSelected=[]}static get styles(){return[I.unsafeCSS(b)]}_sendChangeEvent(){this.dispatchEvent(new CustomEvent("data-items-selected",{bubbles:!0,composed:!0,cancelable:!0,detail:{dataItems:this._dataItemsSelected}}))}_enrichDataItem(o,s,i=!1){const{id:e,...t}=o,n={...t,datasetId:s};return i?n.formulaId=e:n.columnId=e,n}setDataItem(o){const s=o?.detail?.value??[];this._dataItemsSelected=[];for(const i of s)for(const e of this.datasetsDataItems){const t=e.columns??[],n=e.formulas??[],c=t.find(d=>d.id===i);if(c){this._dataItemsSelected.push(this._enrichDataItem(c,e.id));break}const u=n.find(d=>d.id===i);if(u){this._dataItemsSelected.push(this._enrichDataItem(u,e.id,!0));break}}this.dataItemIds=s,this._sendChangeEvent()}_findDataItemsInDatasetsDataItems(o){this._dataItemsSelected=[];for(const s of o)for(const i of this.datasetsDataItems){const e=i.columns,t=i.formulas,n=e?.find(u=>u.id===s);if(n){this._dataItemsSelected.push(this._enrichDataItem(n,i.id));break}const c=t?.find(u=>u.id===s);if(c){this._dataItemsSelected.push(this._enrichDataItem(c,i.id,!0));break}}}willUpdate(o){const s=o.has("language"),i=o.has("dataItemIds"),e=o.has("datasetsDataItems");if(s&&this.language!==h.getLocale()&&([...h.targetLocales].includes(this.language??"en")||this.language==="en")&&h.setLocale(this.language),(i||e)&&(this._findDataItemsInDatasetsDataItems(this.dataItemIds),this._dataItemsSelected.length===0&&!this.allowEmpty&&!this.loading)){for(const t of this.datasetsDataItems)if(t?.columns?.length>0){this._dataItemsSelected=[this._enrichDataItem(t.columns[0],t.id)];break}else if(t?.formulas?.length>0){this._dataItemsSelected=[this._enrichDataItem(t.formulas[0],t.id,!0)];break}this.dataItemIds=this._dataItemsSelected.map(t=>t.id),this._sendChangeEvent()}}render(){const o=[],s=this.icons!=="none";for(const n of this.datasetsDataItems??[]){const c=n?.columns??[],u=n?.formulas??[];for(const d of c){const m={value:d.id,label:y.localize(d?.name??{},this.contentLanguage)??""};s&&(m.icon=g.calculateDataItemIcon(d,this.size)),o.push(m)}for(const d of u){const m={value:d.id,label:y.localize(d?.name??{},this.contentLanguage)??""};s&&(m.icon=g.calculateDataItemIcon(d,this.size)),o.push(m)}}const i=this.pending?"":this.label||this.placeholder||f.msg("Select..."),e=this.pending||this.dataItemIds.length===0?[]:this.dataItemIds,t=this.icons==="none"||this.icons==="menu-only"?"none":void 0;return I.html`<luzmo-select
|
|
21
|
+
id="data-items"
|
|
22
|
+
.size=${this.size}
|
|
23
|
+
.label=${i}
|
|
24
|
+
.retrieving=${this.loading}
|
|
25
|
+
.icons=${t}
|
|
26
|
+
.selects=${this.selects}
|
|
27
|
+
.variant=${"highlight"}
|
|
28
|
+
.placement=${this.placement}
|
|
29
|
+
emphasized
|
|
30
|
+
no-wrap
|
|
31
|
+
?invalid=${this.invalid}
|
|
32
|
+
?clearable=${this.clearable}
|
|
33
|
+
?pending=${this.pending}
|
|
34
|
+
?disabled=${this.disabled}
|
|
35
|
+
.options=${o}
|
|
36
|
+
.value=${e}
|
|
37
|
+
@change=${this.setDataItem}
|
|
38
|
+
>
|
|
39
|
+
</luzmo-select>`}};l([r.property({type:String,reflect:!0})],a.prototype,"language",2);l([r.property({type:String,attribute:"content-language",reflect:!0})],a.prototype,"contentLanguage",2);l([r.property({type:String,reflect:!0})],a.prototype,"label",2);l([r.property({type:String,reflect:!0})],a.prototype,"icons",2);l([r.property({type:Boolean,attribute:"allow-empty",reflect:!0})],a.prototype,"allowEmpty",2);l([r.property({type:String,attribute:"placeholder",reflect:!0})],a.prototype,"placeholder",2);l([r.property({type:String,reflect:!0})],a.prototype,"selects",2);l([r.property({type:Array,attribute:"data-item-ids",reflect:!0})],a.prototype,"dataItemIds",2);l([r.property({type:Boolean,attribute:"loading",reflect:!0})],a.prototype,"loading",2);l([r.property({type:Boolean,attribute:"invalid",reflect:!0})],a.prototype,"invalid",2);l([r.property({type:Boolean,attribute:"clearable",reflect:!0})],a.prototype,"clearable",2);l([r.property({type:Boolean,attribute:"pending",reflect:!0})],a.prototype,"pending",2);l([r.property({type:Boolean,attribute:"disabled",reflect:!0})],a.prototype,"disabled",2);l([r.property({type:String,reflect:!0})],a.prototype,"placement",2);l([r.property({type:Array,reflect:!1})],a.prototype,"datasetsDataItems",2);a=l([f.localized()],a);customElements.get("luzmo-data-items-select")||customElements.define("luzmo-data-items-select",a);
|