@luzmo/analytics-components-kit 1.0.1-alpha.138 → 1.0.1-alpha.139
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/README.md +6 -6
- package/angular/utils/data-broker/index.d.ts +2 -0
- package/components/ai-chat/index.cjs +1 -1
- package/components/ai-chat/index.js +4 -4
- package/components/ai-interaction-textarea/index.cjs +1 -1
- package/components/ai-interaction-textarea/index.js +3 -3
- package/components/convert-datasets-to-data-fields-BV57XueO.cjs +20 -0
- package/components/{convert-datasets-to-data-fields-BrMaMTte.js → convert-datasets-to-data-fields-Ct3YLD0R.js} +1 -1
- package/components/data-fields-select/data-fields-select.d.ts +21 -0
- package/components/data-fields-select/index.cjs +1 -1
- package/components/data-fields-select/index.js +4 -3
- package/components/{data-fields-select-f028At8m.js → data-fields-select-0-QPdj3X.js} +95 -66
- package/components/data-fields-select-DOFNOn2D.cjs +40 -0
- package/components/dataset-selector-list/index.cjs +1 -1
- package/components/dataset-selector-list/index.js +2 -2
- package/components/{dataset-selector-list-TCwsPRXj.cjs → dataset-selector-list-BdeJlo0u.cjs} +1 -1
- package/components/{dataset-selector-list-DX-UEt94.js → dataset-selector-list-DO_ExOrO.js} +1 -1
- package/components/dataset-selector-row/index.cjs +1 -1
- package/components/dataset-selector-row/index.js +3 -3
- package/components/{dataset-selector-row-BAgWSX0U.cjs → dataset-selector-row-CAlRVIk_.cjs} +1 -1
- package/components/{dataset-selector-row-DOOAS7S4.js → dataset-selector-row-VsvdrVDf.js} +1 -1
- package/components/{de-DKG5mEUy.js → de-DEzbbWVL.js} +2 -1
- package/components/{de-DDVFCeiM.cjs → de-nxCdeqFz.cjs} +1 -1
- package/components/display-settings/index.cjs +1 -1
- package/components/display-settings/index.js +2 -2
- package/components/display-settings-binning/index.cjs +1 -1
- package/components/display-settings-binning/index.js +3 -3
- package/components/{display-settings-binning-CINPWs9W.js → display-settings-binning-BXlXiFNV.js} +1 -1
- package/components/{display-settings-binning-D3upbl0e.cjs → display-settings-binning-C4V_P8mI.cjs} +1 -1
- package/components/display-settings-datetime/index.cjs +1 -1
- package/components/display-settings-datetime/index.js +3 -3
- package/components/{display-settings-datetime-JgOzqYhH.cjs → display-settings-datetime-Db-0j9VZ.cjs} +1 -1
- package/components/{display-settings-datetime-DDM-aLcG.js → display-settings-datetime-LqM04khP.js} +1 -1
- package/components/display-settings-grand-totals/index.cjs +1 -1
- package/components/display-settings-grand-totals/index.js +3 -3
- package/components/{display-settings-grand-totals-CvQEblpx.cjs → display-settings-grand-totals-0ihnPMfZ.cjs} +1 -1
- package/components/{display-settings-grand-totals-Dn7LWTtv.js → display-settings-grand-totals-BDDMVFrg.js} +1 -1
- package/components/display-settings-numeric/index.cjs +1 -1
- package/components/display-settings-numeric/index.js +3 -3
- package/components/{display-settings-numeric-CbjlAfSg.cjs → display-settings-numeric-CfBT04A7.cjs} +1 -1
- package/components/{display-settings-numeric-B4nBbaZV.js → display-settings-numeric-Cpp9mQCA.js} +1 -1
- package/components/display-settings-period-over-period/index.cjs +1 -1
- package/components/display-settings-period-over-period/index.js +3 -3
- package/components/{display-settings-period-over-period-BPAS1OlP.cjs → display-settings-period-over-period-CWOpgJmd.cjs} +1 -1
- package/components/{display-settings-period-over-period-sfz3k1Rt.js → display-settings-period-over-period-pxCijPAW.js} +1 -1
- package/components/draggable-data-field/index.cjs +1 -1
- package/components/draggable-data-field/index.js +3 -3
- package/components/{draggable-data-field-BszGH2hR.cjs → draggable-data-field-BsvgQjQY.cjs} +1 -1
- package/components/{draggable-data-field-BwUc-uSE.js → draggable-data-field-C6ojUWMf.js} +1 -1
- package/components/draggable-data-field-level/index.cjs +1 -1
- package/components/draggable-data-field-level/index.js +2 -2
- package/components/draggable-data-fields-panel/index.cjs +1 -1
- package/components/draggable-data-fields-panel/index.js +5 -5
- package/components/{draggable-data-fields-panel-CmCqHUVg.js → draggable-data-fields-panel-DJPz42xa.js} +2 -2
- package/components/{draggable-data-fields-panel-70svWKIX.cjs → draggable-data-fields-panel-oNEzkow0.cjs} +1 -1
- package/components/droppable-slot/index.cjs +1 -1
- package/components/droppable-slot/index.js +3 -3
- package/components/{droppable-slot-BZfO0Ppm.cjs → droppable-slot-C8rhDVI-.cjs} +1 -1
- package/components/{droppable-slot-C_Gxf_cK.js → droppable-slot-DEpOqyps.js} +1 -1
- package/components/edit-filters/index.cjs +1 -1
- package/components/edit-filters/index.js +11 -11
- package/components/{edit-filters-UO8H7Vj2.js → edit-filters-D2oZa0E_.js} +1 -1
- package/components/{edit-filters-ZyitsNtO.cjs → edit-filters-pq1q7Eff.cjs} +1 -1
- package/components/edit-item/index.cjs +1 -1
- package/components/edit-item/index.js +2 -2
- package/components/edit-option/index.cjs +1 -1
- package/components/edit-option/index.js +2 -2
- package/components/edit-option-action-button-group/index.cjs +1 -1
- package/components/edit-option-action-button-group/index.js +2 -2
- package/components/edit-option-color-palette-picker/index.cjs +1 -1
- package/components/edit-option-color-palette-picker/index.js +2 -2
- package/components/edit-option-color-picker/index.cjs +1 -1
- package/components/edit-option-color-picker/index.js +2 -2
- package/components/edit-option-color-range/index.cjs +1 -1
- package/components/edit-option-color-range/index.js +2 -2
- package/components/edit-option-multi-language-field/index.cjs +1 -1
- package/components/edit-option-multi-language-field/index.js +2 -2
- package/components/edit-option-number-field/index.cjs +1 -1
- package/components/edit-option-number-field/index.js +2 -2
- package/components/edit-option-picker/index.cjs +1 -1
- package/components/edit-option-picker/index.js +2 -2
- package/components/edit-option-position-picker/index.cjs +1 -1
- package/components/edit-option-position-picker/index.js +2 -2
- package/components/edit-option-positions-number-field/index.cjs +1 -1
- package/components/edit-option-positions-number-field/index.js +2 -2
- package/components/edit-option-radio-button-group/index.cjs +1 -1
- package/components/edit-option-radio-button-group/index.js +2 -2
- package/components/edit-option-slider/index.cjs +1 -1
- package/components/edit-option-slider/index.js +2 -2
- package/components/edit-option-switch/index.cjs +1 -1
- package/components/edit-option-switch/index.js +2 -2
- package/components/edit-option-text-field/index.cjs +1 -1
- package/components/edit-option-text-field/index.js +2 -2
- package/components/{es-BiI3O1EW.cjs → es-BEBp9Wdb.cjs} +1 -1
- package/components/{es-Bakn2isb.js → es-DIIjhY-_.js} +2 -1
- package/components/filter-expression-picker/index.cjs +1 -1
- package/components/filter-expression-picker/index.js +3 -3
- package/components/{filter-expression-picker-CKZ35JVd.js → filter-expression-picker-BKJXpOiw.js} +1 -1
- package/components/{filter-expression-picker-BYW1sWt8.cjs → filter-expression-picker-Jcv2KTB6.cjs} +1 -1
- package/components/filter-item/index.cjs +1 -1
- package/components/filter-item/index.js +10 -10
- package/components/{filter-item-BuajKNpv.cjs → filter-item-Bqhpikdf.cjs} +1 -1
- package/components/{filter-item-B5v1gZ9o.js → filter-item-RaC0VdlI.js} +2 -2
- package/components/filter-value-picker/index.cjs +1 -1
- package/components/filter-value-picker/index.js +7 -7
- package/components/{filter-value-picker-2X5i7d_K.cjs → filter-value-picker-49_ZrLE2.cjs} +1 -1
- package/components/{filter-value-picker-whw_4Fwe.js → filter-value-picker-C92yj41B.js} +1 -1
- package/components/filter-value-picker-datetime/index.cjs +1 -1
- package/components/filter-value-picker-datetime/index.js +3 -3
- package/components/{filter-value-picker-datetime-CRgSZ3zw.js → filter-value-picker-datetime-CwrpeAdQ.js} +1 -1
- package/components/{filter-value-picker-datetime-BRwkCx6v.cjs → filter-value-picker-datetime-f3T5FuxN.cjs} +1 -1
- package/components/filter-value-picker-hierarchy/index.cjs +1 -1
- package/components/filter-value-picker-hierarchy/index.js +4 -4
- package/components/{filter-value-picker-hierarchy-W79ppZj4.js → filter-value-picker-hierarchy-BjWbzo8J.js} +1 -1
- package/components/{filter-value-picker-hierarchy-C0PZ4yxp.cjs → filter-value-picker-hierarchy-D6FbH0gw.cjs} +1 -1
- package/components/filter-value-picker-numeric/index.cjs +1 -1
- package/components/filter-value-picker-numeric/index.js +3 -3
- package/components/{filter-value-picker-numeric-CYRLXXgZ.cjs → filter-value-picker-numeric-BCfpod5c.cjs} +1 -1
- package/components/{filter-value-picker-numeric-Bl3BvMZ8.js → filter-value-picker-numeric-F1XJRVFa.js} +1 -1
- package/components/{fr-uaZD-jXr.cjs → fr-BSmOmsww.cjs} +1 -1
- package/components/{fr-DxpxaE8N.js → fr-D9ILwOuz.js} +2 -1
- package/components/grid/index.cjs +1 -1
- package/components/grid/index.js +3 -3
- package/components/{grid-DONVpi0m.cjs → grid-DxG8VUv8.cjs} +21 -21
- package/components/{grid-0bhW-S1S.js → grid-OIvA-Frd.js} +6 -2
- package/components/index.cjs +1 -1
- package/components/index.js +27 -27
- package/components/item-data-drop-panel/index.cjs +1 -1
- package/components/item-data-drop-panel/index.js +4 -4
- package/components/{item-data-drop-panel-mNoJhGSe.js → item-data-drop-panel-BMubV7pj.js} +1 -1
- package/components/{item-data-drop-panel-D6fBmjbq.cjs → item-data-drop-panel-Bt8rKT6s.cjs} +1 -1
- package/components/item-data-picker-panel/index.cjs +1 -1
- package/components/item-data-picker-panel/index.js +6 -5
- package/components/{item-data-picker-panel-BPwzfemU.js → item-data-picker-panel-DBK2fVsG.js} +1 -1
- package/components/{item-data-picker-panel-DDySy9dN.cjs → item-data-picker-panel-DZOIUxuS.cjs} +1 -1
- package/components/{load-data-fields-for-datasets-Do2bR03I.cjs → load-data-fields-for-datasets-B6cGgPld.cjs} +1 -1
- package/components/{load-data-fields-for-datasets-BgOnd-ku.js → load-data-fields-for-datasets-CW4n0Pvf.js} +1 -1
- package/components/{localized-mixin-D9lextG3.cjs → localized-mixin-DTvVLuXW.cjs} +1 -1
- package/components/{localized-mixin-DxtnedKb.js → localized-mixin-cLT0UbaF.js} +1 -1
- package/components/{nl-BNKXBOsD.cjs → nl-BiQ2EuE6.cjs} +1 -1
- package/components/{nl-D5wciOUH.js → nl-DhD5Rlf7.js} +2 -1
- package/components/{set-locale-C3lll-Q8.cjs → set-locale-CKjJZRH6.cjs} +1 -1
- package/components/{set-locale-7KskD7al.js → set-locale-Uv6F4uSq.js} +4 -4
- package/components/slot-contents-picker/index.cjs +1 -1
- package/components/slot-contents-picker/index.js +5 -4
- package/components/{slot-contents-picker-CdMRGp3Y.js → slot-contents-picker-CgACNIVS.js} +8 -3
- package/components/{slot-contents-picker-8yCQLPhI.cjs → slot-contents-picker-HRJuZQq5.cjs} +1 -1
- package/components/slot-menu/index.cjs +1 -1
- package/components/slot-menu/index.js +2 -2
- package/components/slot-menu-list/index.cjs +1 -1
- package/components/slot-menu-list/index.js +2 -2
- package/components/utils/base.cjs +1 -1
- package/components/utils/base.js +2 -2
- package/components/utils.cjs +1 -1
- package/components/utils.js +3 -3
- package/components/viz-item-menu/index.cjs +1 -1
- package/components/viz-item-menu/index.js +3 -3
- package/components/{viz-item-menu-BZJdFfkL.js → viz-item-menu-CjA1X_Vg.js} +1 -1
- package/components/{viz-item-menu-kuGm-D6X.cjs → viz-item-menu-D18d77aP.cjs} +1 -1
- package/package.json +2 -2
- package/react/utils/data-broker/index.d.ts +2 -0
- package/utils/data-broker/index.d.ts +2 -0
- package/components/convert-datasets-to-data-fields-C7b8VFWT.cjs +0 -20
- package/components/data-fields-select-DeJFAEaP.cjs +0 -40
package/README.md
CHANGED
|
@@ -75,12 +75,12 @@ npm install @luzmo/analytics-components-kit
|
|
|
75
75
|
|
|
76
76
|
### Data Components (Individual)
|
|
77
77
|
|
|
78
|
-
| Component | Import | Description
|
|
79
|
-
| -------------------- | ------------------------------------------------------ |
|
|
80
|
-
| Draggable Data Field | `@luzmo/analytics-components-kit/draggable-data-field` | Draggable representation of a dataset column or formula
|
|
81
|
-
| Droppable Slot | `@luzmo/analytics-components-kit/droppable-slot` | Drop target for data items in chart configuration
|
|
82
|
-
| Slot Contents Picker | `@luzmo/analytics-components-kit/slot-contents-picker` | Picker-based slot content selection
|
|
83
|
-
| Data Fields Select | `@luzmo/analytics-components-kit/data-fields-select` | Dropdown select for columns, saved formulas, and ad hoc formulas |
|
|
78
|
+
| Component | Import | Description |
|
|
79
|
+
| -------------------- | ------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ |
|
|
80
|
+
| Draggable Data Field | `@luzmo/analytics-components-kit/draggable-data-field` | Draggable representation of a dataset column or formula |
|
|
81
|
+
| Droppable Slot | `@luzmo/analytics-components-kit/droppable-slot` | Drop target for data items in chart configuration |
|
|
82
|
+
| Slot Contents Picker | `@luzmo/analytics-components-kit/slot-contents-picker` | Picker-based slot content selection with expandable datetime/hierarchy sublevels |
|
|
83
|
+
| Data Fields Select | `@luzmo/analytics-components-kit/data-fields-select` | Dropdown select for columns, saved formulas, and ad hoc formulas; datetime and hierarchy columns expand to show selectable sublevels |
|
|
84
84
|
|
|
85
85
|
### Filter Components
|
|
86
86
|
|
|
@@ -19,6 +19,8 @@ export interface DatasetListItem {
|
|
|
19
19
|
}
|
|
20
20
|
export interface DatasetColumnMetadata extends Pick<Column, 'id' | 'name' | 'description' | 'type' | 'subtype' | 'format' | 'lowestLevel' | 'expression' | 'joins' | 'duration_levels' | 'duration_format' | 'hierarchyLevels' | 'currency'> {
|
|
21
21
|
hidden?: boolean;
|
|
22
|
+
highestLevel?: Column['highestLevel'];
|
|
23
|
+
hierarchy_enabled?: Column['hierarchy_enabled'];
|
|
22
24
|
}
|
|
23
25
|
export type DatasetFormulaMetadata = Partial<Formula> & Pick<Formula, 'id' | 'name' | 'expression'> & {
|
|
24
26
|
hidden?: boolean;
|
|
@@ -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
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../base-C_azywlB.cjs`),require(`../focus-visible-3ACCHno4.cjs`),require(`../set-locale-
|
|
20
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../base-C_azywlB.cjs`),require(`../focus-visible-3ACCHno4.cjs`),require(`../set-locale-CKjJZRH6.cjs`),require(`../localized-mixin-DTvVLuXW.cjs`);const e=require(`../ai-chat-CbqvVZDp.cjs`);require(`../dataset-icon-BbNgugDA.cjs`),require(`../data-broker-BUIUM5hr.cjs`),require(`../dataset-selector-list-BdeJlo0u.cjs`),require(`../dataset-selector-row-CAlRVIk_.cjs`),require(`../ai-interaction-textarea-DDVKMfTQ.cjs`),exports.LuzmoAiChat=e.t;
|
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
})();
|
|
26
26
|
import "../base-rg2x95aL.js";
|
|
27
27
|
import "../focus-visible-D1pJhWEh.js";
|
|
28
|
-
import "../set-locale-
|
|
29
|
-
import "../localized-mixin-
|
|
28
|
+
import "../set-locale-Uv6F4uSq.js";
|
|
29
|
+
import "../localized-mixin-cLT0UbaF.js";
|
|
30
30
|
import { t as LuzmoAiChat } from "../ai-chat-Dg2dvhDq.js";
|
|
31
31
|
import "../dataset-icon-x6Q8nhYc.js";
|
|
32
32
|
import "../data-broker-cLR-t5LM.js";
|
|
33
|
-
import "../dataset-selector-list-
|
|
34
|
-
import "../dataset-selector-row-
|
|
33
|
+
import "../dataset-selector-list-DO_ExOrO.js";
|
|
34
|
+
import "../dataset-selector-row-VsvdrVDf.js";
|
|
35
35
|
import "../ai-interaction-textarea-ZDQPVgXC.js";
|
|
36
36
|
export { LuzmoAiChat };
|
|
@@ -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
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../set-locale-
|
|
20
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../set-locale-CKjJZRH6.cjs`),require(`../dataset-icon-BbNgugDA.cjs`),require(`../data-broker-BUIUM5hr.cjs`),require(`../dataset-selector-list-BdeJlo0u.cjs`),require(`../dataset-selector-row-CAlRVIk_.cjs`);const e=require(`../ai-interaction-textarea-DDVKMfTQ.cjs`);Object.defineProperty(exports,`LuzmoAiInteractionTextarea`,{enumerable:!0,get:function(){return e.t}});
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
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-scrollbar-size: 6px;--luzmo-scrollbar-width: thin;--luzmo-scrollbar-track-background: transparent;--luzmo-scrollbar-track-border-radius: var(--luzmo-border-radius-s);--luzmo-scrollbar-thumb-background: rgba(var(--luzmo-border-color-rgb), 0.3);--luzmo-scrollbar-thumb-border-radius: var(--luzmo-border-radius-s);--luzmo-scrollbar-thumb-hover-background: rgba(var(--luzmo-border-color-rgb), 0.4);--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);
|
|
24
24
|
}
|
|
25
25
|
})();
|
|
26
|
-
import "../set-locale-
|
|
26
|
+
import "../set-locale-Uv6F4uSq.js";
|
|
27
27
|
import "../dataset-icon-x6Q8nhYc.js";
|
|
28
28
|
import "../data-broker-cLR-t5LM.js";
|
|
29
|
-
import "../dataset-selector-list-
|
|
30
|
-
import "../dataset-selector-row-
|
|
29
|
+
import "../dataset-selector-list-DO_ExOrO.js";
|
|
30
|
+
import "../dataset-selector-row-VsvdrVDf.js";
|
|
31
31
|
import { t as LuzmoAiInteractionTextarea } from "../ai-interaction-textarea-ZDQPVgXC.js";
|
|
32
32
|
export { LuzmoAiInteractionTextarea };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*! * A kit of modern Luzmo Web Components for analytics in your web application.
|
|
2
|
+
*
|
|
3
|
+
* Copyright © 2026 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
|
+
var e=e=>!!(e&&Object.keys(e).length>0);const t=(t,n,r={})=>{if(n.hidden===!0&&!r.includeHidden||!n.id||!n.type)return null;let i=e(n.name)?n.name:{en:`Untitled`},a={datasetId:t,columnId:n.id,type:n.type,name:i};return n.description&&e(n.description)&&(a.description=n.description),n.subtype&&(a.subtype=n.subtype),n.format&&(a.format=n.format),typeof n.lowestLevel==`number`&&(a.lowestLevel=n.lowestLevel),typeof n.highestLevel==`number`&&(a.highestLevel=n.highestLevel),typeof n.hierarchy_enabled==`boolean`&&(a.hierarchy_enabled=n.hierarchy_enabled),n.expression&&(a.expression=n.expression),Array.isArray(n.duration_levels)&&n.duration_levels.length>0&&(a.duration_levels=[...n.duration_levels]),n.duration_format&&(a.duration_format=n.duration_format),Array.isArray(n.hierarchyLevels)&&n.hierarchyLevels.length>0&&(a.hierarchyLevels=n.hierarchyLevels.map(({id:e,level:t,name:n})=>({id:e,level:t,name:n}))),n.currency?.id&&n.currency.symbol&&(a.currency={id:n.currency.id,name:n.currency.name,symbol:n.currency.symbol}),a},n=(t,n,r={})=>{if(n.hidden===!0&&!r.includeHidden||!n.id||!n.type)return null;let i=e(n.name)?n.name:{en:`Untitled`},a={datasetId:t,formulaId:n.id,type:n.type,name:i};return n.description&&e(n.description)&&(a.description=n.description),n.subtype&&(a.subtype=n.subtype),n.format&&(a.format=n.format),typeof n.lowestLevel==`number`&&(a.lowestLevel=n.lowestLevel),n.expression&&(a.expression=n.expression),Array.isArray(n.duration_levels)&&n.duration_levels.length>0&&(a.duration_levels=[...n.duration_levels]),n.duration_format&&(a.duration_format=n.duration_format),n.currency?.id&&n.currency.symbol&&(a.currency={id:n.currency.id,name:n.currency.name,symbol:n.currency.symbol}),a},r=(e,r={})=>{if(!e?.id)return[];let i=[];return Array.isArray(e.columns)&&e.columns.forEach(n=>{let a=t(e.id,n,r);a&&i.push(a)}),Array.isArray(e.formulas)&&e.formulas.forEach(t=>{let a=n(e.id,t,r);a&&i.push(a)}),i},i=(e,t={})=>e.map(e=>({id:e.id,name:e.name,description:e.description,dataFields:r(e,t)}));Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return i}});
|
|
@@ -26,7 +26,7 @@ const mapDatasetColumnToDatasetDataField = (t, n, r = {}) => {
|
|
|
26
26
|
type: n.type,
|
|
27
27
|
name: i
|
|
28
28
|
};
|
|
29
|
-
return n.description && hasNonEmptyObject(n.description) && (a.description = n.description), n.subtype && (a.subtype = n.subtype), n.format && (a.format = n.format), typeof n.lowestLevel == "number" && (a.lowestLevel = n.lowestLevel), n.expression && (a.expression = n.expression), Array.isArray(n.duration_levels) && n.duration_levels.length > 0 && (a.duration_levels = [...n.duration_levels]), n.duration_format && (a.duration_format = n.duration_format), Array.isArray(n.hierarchyLevels) && n.hierarchyLevels.length > 0 && (a.hierarchyLevels = n.hierarchyLevels.map(({ id: e, level: t, name: n }) => ({
|
|
29
|
+
return n.description && hasNonEmptyObject(n.description) && (a.description = n.description), n.subtype && (a.subtype = n.subtype), n.format && (a.format = n.format), typeof n.lowestLevel == "number" && (a.lowestLevel = n.lowestLevel), typeof n.highestLevel == "number" && (a.highestLevel = n.highestLevel), typeof n.hierarchy_enabled == "boolean" && (a.hierarchy_enabled = n.hierarchy_enabled), n.expression && (a.expression = n.expression), Array.isArray(n.duration_levels) && n.duration_levels.length > 0 && (a.duration_levels = [...n.duration_levels]), n.duration_format && (a.duration_format = n.duration_format), Array.isArray(n.hierarchyLevels) && n.hierarchyLevels.length > 0 && (a.hierarchyLevels = n.hierarchyLevels.map(({ id: e, level: t, name: n }) => ({
|
|
30
30
|
id: e,
|
|
31
31
|
level: t,
|
|
32
32
|
name: n
|
|
@@ -93,9 +93,30 @@ export declare class LuzmoDataFieldsSelect extends LuzmoDataFieldsSelect_base {
|
|
|
93
93
|
* Searches the formulas array (which may contain both saved and ad hoc formulas) for a match.
|
|
94
94
|
*/
|
|
95
95
|
private _findFormulaMatch;
|
|
96
|
+
/**
|
|
97
|
+
* Resolves a selected value (which may be a compound sublevel value) to a DatasetDataField.
|
|
98
|
+
* Returns the resolved field and whether a dataset match was found.
|
|
99
|
+
*/
|
|
100
|
+
private _resolveDataFieldFromValue;
|
|
96
101
|
setDataField(event: CustomEvent): void;
|
|
97
102
|
private _findDataFieldsInDatasetsDataFields;
|
|
98
103
|
protected willUpdate(changedProperties: PropertyValues): void;
|
|
104
|
+
/**
|
|
105
|
+
* Build expandable children for a datetime column based on its highestLevel / lowestLevel range.
|
|
106
|
+
*/
|
|
107
|
+
private _buildDatetimeChildren;
|
|
108
|
+
/**
|
|
109
|
+
* Build expandable children for a hierarchy column based on its hierarchyLevels.
|
|
110
|
+
*/
|
|
111
|
+
private _buildHierarchyChildren;
|
|
112
|
+
/**
|
|
113
|
+
* Returns true when a column should render expandable datetime children.
|
|
114
|
+
*/
|
|
115
|
+
private _isExpandableDatetime;
|
|
116
|
+
/**
|
|
117
|
+
* Returns true when a column should render expandable hierarchy children.
|
|
118
|
+
*/
|
|
119
|
+
private _isExpandableHierarchy;
|
|
99
120
|
protected render(): TemplateResult;
|
|
100
121
|
}
|
|
101
122
|
export {};
|
|
@@ -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
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../set-locale-
|
|
20
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../set-locale-CKjJZRH6.cjs`),require(`../localized-mixin-DTvVLuXW.cjs`),require(`../periods.const-CX2ZWWrf.cjs`),require(`../calculate-data-field-icon-BhiGlh0u.cjs`);const e=require(`../data-fields-select-DOFNOn2D.cjs`);Object.defineProperty(exports,`LuzmoDataFieldsSelect`,{enumerable:!0,get:function(){return e.t}});
|
|
@@ -23,8 +23,9 @@
|
|
|
23
23
|
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-scrollbar-size: 6px;--luzmo-scrollbar-width: thin;--luzmo-scrollbar-track-background: transparent;--luzmo-scrollbar-track-border-radius: var(--luzmo-border-radius-s);--luzmo-scrollbar-thumb-background: rgba(var(--luzmo-border-color-rgb), 0.3);--luzmo-scrollbar-thumb-border-radius: var(--luzmo-border-radius-s);--luzmo-scrollbar-thumb-hover-background: rgba(var(--luzmo-border-color-rgb), 0.4);--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);
|
|
24
24
|
}
|
|
25
25
|
})();
|
|
26
|
-
import "../set-locale-
|
|
27
|
-
import "../localized-mixin-
|
|
26
|
+
import "../set-locale-Uv6F4uSq.js";
|
|
27
|
+
import "../localized-mixin-cLT0UbaF.js";
|
|
28
|
+
import "../periods.const-Ch6SfeaG.js";
|
|
28
29
|
import "../calculate-data-field-icon-CY7Y6fn1.js";
|
|
29
|
-
import { t as LuzmoDataFieldsSelect } from "../data-fields-select-
|
|
30
|
+
import { t as LuzmoDataFieldsSelect } from "../data-fields-select-0-QPdj3X.js";
|
|
30
31
|
export { LuzmoDataFieldsSelect };
|
|
@@ -18,17 +18,24 @@
|
|
|
18
18
|
* SOFTWARE.
|
|
19
19
|
* */
|
|
20
20
|
import { t as __decorate } from "./decorate-Da6S_xrw.js";
|
|
21
|
-
import { t as LocalizedMixin } from "./localized-mixin-
|
|
21
|
+
import { t as LocalizedMixin } from "./localized-mixin-cLT0UbaF.js";
|
|
22
22
|
import { t as localize } from "./localize-Dlt3EN5i.js";
|
|
23
|
+
import { n as DATETIME_LEVELS } from "./periods.const-Ch6SfeaG.js";
|
|
23
24
|
import { t as calculateDataFieldIcon } from "./calculate-data-field-icon-CY7Y6fn1.js";
|
|
24
|
-
import { n as mapDatasetColumnToDatasetDataField, r as mapDatasetFormulaToDatasetDataField } from "./convert-datasets-to-data-fields-
|
|
25
|
+
import { n as mapDatasetColumnToDatasetDataField, r as mapDatasetFormulaToDatasetDataField } from "./convert-datasets-to-data-fields-Ct3YLD0R.js";
|
|
25
26
|
import { html, unsafeCSS } from "lit";
|
|
26
27
|
import { property } from "lit/decorators.js";
|
|
27
28
|
import { localized, msg } from "@lit/localize";
|
|
28
29
|
import { luzmoFormula } from "@luzmo/icons";
|
|
29
30
|
import "@luzmo/lucero/select";
|
|
30
31
|
import { ElementSizes, LuzmoElement, SizedMixin } from "@luzmo/lucero/utils";
|
|
31
|
-
var data_fields_select_module_default = ":host{font-family:var(--luzmo-font-family)}",
|
|
32
|
+
var data_fields_select_module_default = ":host{font-family:var(--luzmo-font-family)}", LEVEL_SEPARATOR = "::level::", encodeSublevelValue = (e, p) => `${e}${LEVEL_SEPARATOR}${p}`, decodeSublevelValue = (e) => {
|
|
33
|
+
let p = e.indexOf(LEVEL_SEPARATOR);
|
|
34
|
+
return p === -1 ? null : {
|
|
35
|
+
columnId: e.slice(0, p),
|
|
36
|
+
level: Number(e.slice(p + 9))
|
|
37
|
+
};
|
|
38
|
+
}, LuzmoDataFieldsSelect = class extends LocalizedMixin(SizedMixin(LuzmoElement, { validSizes: Object.values(ElementSizes) })) {
|
|
32
39
|
constructor(...e) {
|
|
33
40
|
super(...e), this.contentLanguage = "en", this.icons = "menu-only", this.allowEmpty = !1, this.selects = "single", this.value = [], this.retrieving = !1, this.invalid = !1, this.clearable = !1, this.pending = !1, this.disabled = !1, this.search = "auto", this.placement = "bottom-start", this.datasetsDataFields = [], this._dataFieldsSelected = [];
|
|
34
41
|
}
|
|
@@ -46,12 +53,12 @@ var data_fields_select_module_default = ":host{font-family:var(--luzmo-font-fami
|
|
|
46
53
|
detail: { dataFields: this._dataFieldsSelected }
|
|
47
54
|
}));
|
|
48
55
|
}
|
|
49
|
-
_toDataFieldData(e,
|
|
50
|
-
return
|
|
56
|
+
_toDataFieldData(e, p, m = !1) {
|
|
57
|
+
return m ? mapDatasetFormulaToDatasetDataField(p, e, { includeHidden: !0 }) : mapDatasetColumnToDatasetDataField(p, e, { includeHidden: !0 });
|
|
51
58
|
}
|
|
52
|
-
_toAdHocFormulaFieldData(e,
|
|
59
|
+
_toAdHocFormulaFieldData(e, p) {
|
|
53
60
|
return {
|
|
54
|
-
datasetId:
|
|
61
|
+
datasetId: p,
|
|
55
62
|
formula: e.formula,
|
|
56
63
|
type: e.type,
|
|
57
64
|
name: e.label ?? { en: "Ad-hoc formula" },
|
|
@@ -59,59 +66,58 @@ var data_fields_select_module_default = ":host{font-family:var(--luzmo-font-fami
|
|
|
59
66
|
format: e.format
|
|
60
67
|
};
|
|
61
68
|
}
|
|
62
|
-
_findFormulaMatch(e,
|
|
63
|
-
for (let
|
|
64
|
-
if (
|
|
65
|
-
} else if (
|
|
69
|
+
_findFormulaMatch(e, p, m) {
|
|
70
|
+
for (let h of e) if (this._isAdHocFormula(h)) {
|
|
71
|
+
if (h.formula === p) return this._toAdHocFormulaFieldData(h, m);
|
|
72
|
+
} else if (h.id === p) return this._toDataFieldData(h, m, !0);
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
_resolveDataFieldFromValue(e, p) {
|
|
76
|
+
let m = decodeSublevelValue(e), h = m ? m.columnId : e;
|
|
77
|
+
for (let g of p) {
|
|
78
|
+
let p = g.columns ?? [], _ = g.formulas ?? [], v = p.find((e) => e.id === h);
|
|
79
|
+
if (v) {
|
|
80
|
+
let e = this._toDataFieldData(v, g.id, !1);
|
|
81
|
+
if (e && m && (e.level = m.level, this._isExpandableHierarchy(v))) {
|
|
82
|
+
let p = v.hierarchyLevels?.find((e) => e.level === m.level);
|
|
83
|
+
p && (e.name = p.name);
|
|
84
|
+
}
|
|
85
|
+
return e;
|
|
86
|
+
}
|
|
87
|
+
let y = this._findFormulaMatch(_, e, g.id);
|
|
88
|
+
if (y) return y;
|
|
89
|
+
}
|
|
66
90
|
return null;
|
|
67
91
|
}
|
|
68
92
|
setDataField(e) {
|
|
69
|
-
let
|
|
93
|
+
let p = e?.detail?.value ?? [];
|
|
70
94
|
this._dataFieldsSelected = [];
|
|
71
|
-
for (let e of
|
|
72
|
-
let
|
|
73
|
-
|
|
74
|
-
let e = this._toDataFieldData(f, l.id, !1);
|
|
75
|
-
e && this._dataFieldsSelected.push(e);
|
|
76
|
-
break;
|
|
77
|
-
}
|
|
78
|
-
let p = this._findFormulaMatch(d, e, l.id);
|
|
79
|
-
if (p) {
|
|
80
|
-
this._dataFieldsSelected.push(p);
|
|
81
|
-
break;
|
|
82
|
-
}
|
|
95
|
+
for (let e of p) {
|
|
96
|
+
let p = this._resolveDataFieldFromValue(e, this.datasetsDataFields);
|
|
97
|
+
p && this._dataFieldsSelected.push(p);
|
|
83
98
|
}
|
|
84
|
-
this.value =
|
|
99
|
+
this.value = p, this._sendChangeEvent();
|
|
85
100
|
}
|
|
86
101
|
_findDataFieldsInDatasetsDataFields(e) {
|
|
87
102
|
this._dataFieldsSelected = [];
|
|
88
|
-
for (let
|
|
89
|
-
let
|
|
90
|
-
|
|
91
|
-
let l = this._toDataFieldData(f, e.id, !1);
|
|
92
|
-
l && this._dataFieldsSelected.push(l);
|
|
93
|
-
break;
|
|
94
|
-
}
|
|
95
|
-
let p = this._findFormulaMatch(d ?? [], l, e.id);
|
|
96
|
-
if (p) {
|
|
97
|
-
this._dataFieldsSelected.push(p);
|
|
98
|
-
break;
|
|
99
|
-
}
|
|
103
|
+
for (let p of e) {
|
|
104
|
+
let e = this._resolveDataFieldFromValue(p, this.datasetsDataFields);
|
|
105
|
+
e && this._dataFieldsSelected.push(e);
|
|
100
106
|
}
|
|
101
107
|
}
|
|
102
108
|
willUpdate(e) {
|
|
103
109
|
super.willUpdate(e);
|
|
104
|
-
let
|
|
105
|
-
if ((
|
|
110
|
+
let p = e.has("value"), m = e.has("datasetsDataFields");
|
|
111
|
+
if ((p || m) && (this._findDataFieldsInDatasetsDataFields(this.value), this._dataFieldsSelected.length === 0 && !this.allowEmpty && !this.retrieving)) {
|
|
106
112
|
for (let e of this.datasetsDataFields) if (e?.columns?.length > 0) {
|
|
107
|
-
let
|
|
108
|
-
this._dataFieldsSelected =
|
|
113
|
+
let p = this._toDataFieldData(e.columns[0], e.id, !1);
|
|
114
|
+
this._dataFieldsSelected = p ? [p] : [];
|
|
109
115
|
break;
|
|
110
116
|
} else {
|
|
111
|
-
let
|
|
112
|
-
if (
|
|
113
|
-
let
|
|
114
|
-
this._dataFieldsSelected =
|
|
117
|
+
let p = e?.formulas?.find((e) => !this._isAdHocFormula(e));
|
|
118
|
+
if (p && !this._isAdHocFormula(p)) {
|
|
119
|
+
let m = this._toDataFieldData(p, e.id, !0);
|
|
120
|
+
this._dataFieldsSelected = m ? [m] : [];
|
|
115
121
|
break;
|
|
116
122
|
}
|
|
117
123
|
}
|
|
@@ -122,38 +128,61 @@ var data_fields_select_module_default = ":host{font-family:var(--luzmo-font-fami
|
|
|
122
128
|
}).filter((e) => typeof e == "string" && e.length > 0), this._sendChangeEvent();
|
|
123
129
|
}
|
|
124
130
|
}
|
|
131
|
+
_buildDatetimeChildren(e) {
|
|
132
|
+
let p = [], m = Math.min(Math.max(e.lowestLevel ?? 1, 1), DATETIME_LEVELS.length), g = Math.min(Math.max(e.highestLevel ?? 1, 1), DATETIME_LEVELS.length);
|
|
133
|
+
for (let _ = g; _ <= m; _++) p.push({
|
|
134
|
+
value: encodeSublevelValue(e.id, _),
|
|
135
|
+
label: DATETIME_LEVELS[_ - 1]?.i18n() ?? ""
|
|
136
|
+
});
|
|
137
|
+
return p;
|
|
138
|
+
}
|
|
139
|
+
_buildHierarchyChildren(e) {
|
|
140
|
+
let p = [], h = e.hierarchyLevels ?? [];
|
|
141
|
+
for (let g of h) g.level < 1 || p.push({
|
|
142
|
+
value: encodeSublevelValue(e.id, g.level),
|
|
143
|
+
label: localize(g.name ?? {}, this.contentLanguage) ?? ""
|
|
144
|
+
});
|
|
145
|
+
return p;
|
|
146
|
+
}
|
|
147
|
+
_isExpandableDatetime(e) {
|
|
148
|
+
let p = e.type;
|
|
149
|
+
return (p === "datetime" || p === "array[datetime]") && typeof e.lowestLevel == "number";
|
|
150
|
+
}
|
|
151
|
+
_isExpandableHierarchy(e) {
|
|
152
|
+
return Array.isArray(e.hierarchyLevels) && e.hierarchyLevels.length > 2 && e.hierarchy_enabled === !0;
|
|
153
|
+
}
|
|
125
154
|
render() {
|
|
126
|
-
let e = [],
|
|
127
|
-
for (let
|
|
128
|
-
let
|
|
129
|
-
for (let
|
|
130
|
-
let
|
|
131
|
-
value:
|
|
132
|
-
label: localize(
|
|
155
|
+
let e = [], p = this.icons !== "none";
|
|
156
|
+
for (let h of this.datasetsDataFields ?? []) {
|
|
157
|
+
let _ = h?.columns ?? [], v = h?.formulas ?? [];
|
|
158
|
+
for (let h of _) {
|
|
159
|
+
let _ = {
|
|
160
|
+
value: h.id,
|
|
161
|
+
label: localize(h?.name ?? {}, this.contentLanguage) ?? ""
|
|
133
162
|
};
|
|
134
|
-
|
|
163
|
+
p && (_.icon = calculateDataFieldIcon(h, this.size)), this._isExpandableDatetime(h) ? _.children = this._buildDatetimeChildren(h) : this._isExpandableHierarchy(h) && (_.children = this._buildHierarchyChildren(h)), e.push(_);
|
|
135
164
|
}
|
|
136
|
-
for (let
|
|
137
|
-
let
|
|
138
|
-
value:
|
|
139
|
-
label:
|
|
165
|
+
for (let h of v) if (this._isAdHocFormula(h)) {
|
|
166
|
+
let g = h.label ? localize(h.label, this.contentLanguage) : msg("Ad-hoc formula"), _ = {
|
|
167
|
+
value: h.formula,
|
|
168
|
+
label: g ?? msg("Ad-hoc formula")
|
|
140
169
|
};
|
|
141
|
-
|
|
170
|
+
p && (_.icon = luzmoFormula), e.push(_);
|
|
142
171
|
} else {
|
|
143
|
-
let
|
|
144
|
-
value:
|
|
145
|
-
label: localize(
|
|
172
|
+
let _ = {
|
|
173
|
+
value: h.id,
|
|
174
|
+
label: localize(h?.name ?? {}, this.contentLanguage) ?? ""
|
|
146
175
|
};
|
|
147
|
-
|
|
176
|
+
p && (_.icon = calculateDataFieldIcon(h, this.size)), e.push(_);
|
|
148
177
|
}
|
|
149
178
|
}
|
|
150
|
-
let
|
|
179
|
+
let h = msg("Select..."), _ = this.pending ? "" : this.label || this.placeholder || h, v = this.pending || this.value.length === 0 ? [] : this.value, b = this.icons === "none" || this.icons === "menu-only" ? "none" : void 0;
|
|
151
180
|
return html`<luzmo-select
|
|
152
181
|
id="data-fields"
|
|
153
182
|
.size=${this.size}
|
|
154
|
-
.label=${
|
|
183
|
+
.label=${_}
|
|
155
184
|
.retrieving=${this.retrieving}
|
|
156
|
-
.icons=${
|
|
185
|
+
.icons=${b}
|
|
157
186
|
.selects=${this.selects}
|
|
158
187
|
.variant=${this.selects === "multiple" ? "checkmarks" : "highlight"}
|
|
159
188
|
.placement=${this.placement}
|
|
@@ -165,7 +194,7 @@ var data_fields_select_module_default = ":host{font-family:var(--luzmo-font-fami
|
|
|
165
194
|
?pending=${this.pending}
|
|
166
195
|
?disabled=${this.disabled}
|
|
167
196
|
.options=${e}
|
|
168
|
-
.value=${
|
|
197
|
+
.value=${v}
|
|
169
198
|
@change=${this.setDataField}
|
|
170
199
|
>
|
|
171
200
|
</luzmo-select>`;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/*! * A kit of modern Luzmo Web Components for analytics in your web application.
|
|
2
|
+
*
|
|
3
|
+
* Copyright © 2026 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
|
+
const e=require(`./chunk-350yNsax.cjs`),t=require(`./decorate-Dq4-zbi1.cjs`),n=require(`./localized-mixin-DTvVLuXW.cjs`),r=require(`./localize-BBuZJf_h.cjs`),i=require(`./periods.const-CX2ZWWrf.cjs`),a=require(`./calculate-data-field-icon-BhiGlh0u.cjs`),o=require(`./convert-datasets-to-data-fields-BV57XueO.cjs`);let s=require(`lit`),c=require(`lit/decorators.js`),l=require(`@lit/localize`),u=require(`@luzmo/icons`);require(`@luzmo/lucero/select`);let d=require(`@luzmo/lucero/utils`);var f=`:host{font-family:var(--luzmo-font-family)}`,p=`::level::`,m=(e,t)=>`${e}${p}${t}`,h=e=>{let t=e.indexOf(p);return t===-1?null:{columnId:e.slice(0,t),level:Number(e.slice(t+9))}},g=class extends n.t((0,d.SizedMixin)(d.LuzmoElement,{validSizes:Object.values(d.ElementSizes)})){constructor(...e){super(...e),this.contentLanguage=`en`,this.icons=`menu-only`,this.allowEmpty=!1,this.selects=`single`,this.value=[],this.retrieving=!1,this.invalid=!1,this.clearable=!1,this.pending=!1,this.disabled=!1,this.search=`auto`,this.placement=`bottom-start`,this.datasetsDataFields=[],this._dataFieldsSelected=[]}static get styles(){return[(0,s.unsafeCSS)(f)]}_isAdHocFormula(e){return`formula`in e&&typeof e.formula==`string`}_sendChangeEvent(){this.dispatchEvent(new CustomEvent(`luzmo-data-fields-selected`,{bubbles:!0,composed:!0,cancelable:!0,detail:{dataFields:this._dataFieldsSelected}}))}_toDataFieldData(e,t,n=!1){return n?o.r(t,e,{includeHidden:!0}):o.n(t,e,{includeHidden:!0})}_toAdHocFormulaFieldData(e,t){return{datasetId:t,formula:e.formula,type:e.type,name:e.label??{en:`Ad-hoc formula`},subtype:e.subtype??void 0,format:e.format}}_findFormulaMatch(e,t,n){for(let r of e)if(this._isAdHocFormula(r)){if(r.formula===t)return this._toAdHocFormulaFieldData(r,n)}else if(r.id===t)return this._toDataFieldData(r,n,!0);return null}_resolveDataFieldFromValue(e,t){let n=h(e),r=n?n.columnId:e;for(let i of t){let t=i.columns??[],a=i.formulas??[],o=t.find(e=>e.id===r);if(o){let e=this._toDataFieldData(o,i.id,!1);if(e&&n&&(e.level=n.level,this._isExpandableHierarchy(o))){let t=o.hierarchyLevels?.find(e=>e.level===n.level);t&&(e.name=t.name)}return e}let s=this._findFormulaMatch(a,e,i.id);if(s)return s}return null}setDataField(e){let t=e?.detail?.value??[];this._dataFieldsSelected=[];for(let e of t){let t=this._resolveDataFieldFromValue(e,this.datasetsDataFields);t&&this._dataFieldsSelected.push(t)}this.value=t,this._sendChangeEvent()}_findDataFieldsInDatasetsDataFields(e){this._dataFieldsSelected=[];for(let t of e){let e=this._resolveDataFieldFromValue(t,this.datasetsDataFields);e&&this._dataFieldsSelected.push(e)}}willUpdate(e){super.willUpdate(e);let t=e.has(`value`),n=e.has(`datasetsDataFields`);if((t||n)&&(this._findDataFieldsInDatasetsDataFields(this.value),this._dataFieldsSelected.length===0&&!this.allowEmpty&&!this.retrieving)){for(let e of this.datasetsDataFields)if(e?.columns?.length>0){let t=this._toDataFieldData(e.columns[0],e.id,!1);this._dataFieldsSelected=t?[t]:[];break}else{let t=e?.formulas?.find(e=>!this._isAdHocFormula(e));if(t&&!this._isAdHocFormula(t)){let n=this._toDataFieldData(t,e.id,!0);this._dataFieldsSelected=n?[n]:[];break}}this.value=this._dataFieldsSelected.map(e=>{if(`columnId`in e&&e.columnId)return e.columnId;if(`formulaId`in e&&e.formulaId)return e.formulaId;if(`formula`in e&&e.formula)return e.formula}).filter(e=>typeof e==`string`&&e.length>0),this._sendChangeEvent()}}_buildDatetimeChildren(e){let t=[],n=Math.min(Math.max(e.lowestLevel??1,1),i.n.length),r=Math.min(Math.max(e.highestLevel??1,1),i.n.length);for(let a=r;a<=n;a++)t.push({value:m(e.id,a),label:i.n[a-1]?.i18n()??``});return t}_buildHierarchyChildren(e){let t=[],n=e.hierarchyLevels??[];for(let i of n)i.level<1||t.push({value:m(e.id,i.level),label:r.t(i.name??{},this.contentLanguage)??``});return t}_isExpandableDatetime(e){let t=e.type;return(t===`datetime`||t===`array[datetime]`)&&typeof e.lowestLevel==`number`}_isExpandableHierarchy(e){return Array.isArray(e.hierarchyLevels)&&e.hierarchyLevels.length>2&&e.hierarchy_enabled===!0}render(){let e=[],t=this.icons!==`none`;for(let n of this.datasetsDataFields??[]){let i=n?.columns??[],o=n?.formulas??[];for(let n of i){let i={value:n.id,label:r.t(n?.name??{},this.contentLanguage)??``};t&&(i.icon=a.t(n,this.size)),this._isExpandableDatetime(n)?i.children=this._buildDatetimeChildren(n):this._isExpandableHierarchy(n)&&(i.children=this._buildHierarchyChildren(n)),e.push(i)}for(let n of o)if(this._isAdHocFormula(n)){let i=n.label?r.t(n.label,this.contentLanguage):(0,l.msg)(`Ad-hoc formula`),a={value:n.formula,label:i??(0,l.msg)(`Ad-hoc formula`)};t&&(a.icon=u.luzmoFormula),e.push(a)}else{let i={value:n.id,label:r.t(n?.name??{},this.contentLanguage)??``};t&&(i.icon=a.t(n,this.size)),e.push(i)}}let n=(0,l.msg)(`Select...`),i=this.pending?``:this.label||this.placeholder||n,o=this.pending||this.value.length===0?[]:this.value,c=this.icons===`none`||this.icons===`menu-only`?`none`:void 0;return s.html`<luzmo-select
|
|
21
|
+
id="data-fields"
|
|
22
|
+
.size=${this.size}
|
|
23
|
+
.label=${i}
|
|
24
|
+
.retrieving=${this.retrieving}
|
|
25
|
+
.icons=${c}
|
|
26
|
+
.selects=${this.selects}
|
|
27
|
+
.variant=${this.selects===`multiple`?`checkmarks`:`highlight`}
|
|
28
|
+
.placement=${this.placement}
|
|
29
|
+
.search=${this.search}
|
|
30
|
+
emphasized
|
|
31
|
+
no-wrap
|
|
32
|
+
?invalid=${this.invalid}
|
|
33
|
+
?clearable=${this.clearable&&this.allowEmpty}
|
|
34
|
+
?pending=${this.pending}
|
|
35
|
+
?disabled=${this.disabled}
|
|
36
|
+
.options=${e}
|
|
37
|
+
.value=${o}
|
|
38
|
+
@change=${this.setDataField}
|
|
39
|
+
>
|
|
40
|
+
</luzmo-select>`}};t.t([(0,c.property)({type:String,attribute:`content-language`,reflect:!0})],g.prototype,`contentLanguage`,void 0),t.t([(0,c.property)({type:String,reflect:!0})],g.prototype,`label`,void 0),t.t([(0,c.property)({type:String,reflect:!0})],g.prototype,`icons`,void 0),t.t([(0,c.property)({type:Boolean,attribute:`allow-empty`,reflect:!0})],g.prototype,`allowEmpty`,void 0),t.t([(0,c.property)({type:String,attribute:`placeholder`,reflect:!0})],g.prototype,`placeholder`,void 0),t.t([(0,c.property)({type:String,reflect:!0})],g.prototype,`selects`,void 0),t.t([(0,c.property)({type:Array,reflect:!0})],g.prototype,`value`,void 0),t.t([(0,c.property)({type:Boolean,attribute:`retrieving`,reflect:!0})],g.prototype,`retrieving`,void 0),t.t([(0,c.property)({type:Boolean,attribute:`invalid`,reflect:!0})],g.prototype,`invalid`,void 0),t.t([(0,c.property)({type:Boolean,attribute:`clearable`,reflect:!0})],g.prototype,`clearable`,void 0),t.t([(0,c.property)({type:Boolean,attribute:`pending`,reflect:!0})],g.prototype,`pending`,void 0),t.t([(0,c.property)({type:Boolean,attribute:`disabled`,reflect:!0})],g.prototype,`disabled`,void 0),t.t([(0,c.property)({type:String,attribute:`search`,reflect:!0})],g.prototype,`search`,void 0),t.t([(0,c.property)({type:String,reflect:!0})],g.prototype,`placement`,void 0),t.t([(0,c.property)({type:Array,reflect:!1})],g.prototype,`datasetsDataFields`,void 0),g=t.t([(0,l.localized)()],g),customElements.get(`luzmo-data-fields-select`)||customElements.define(`luzmo-data-fields-select`,g),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return g}});
|
|
@@ -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
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../set-locale-
|
|
20
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../set-locale-CKjJZRH6.cjs`),require(`../dataset-icon-BbNgugDA.cjs`),require(`../data-broker-BUIUM5hr.cjs`);const e=require(`../dataset-selector-list-BdeJlo0u.cjs`);exports.LuzmoDatasetSelectorList=e.t;
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
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-scrollbar-size: 6px;--luzmo-scrollbar-width: thin;--luzmo-scrollbar-track-background: transparent;--luzmo-scrollbar-track-border-radius: var(--luzmo-border-radius-s);--luzmo-scrollbar-thumb-background: rgba(var(--luzmo-border-color-rgb), 0.3);--luzmo-scrollbar-thumb-border-radius: var(--luzmo-border-radius-s);--luzmo-scrollbar-thumb-hover-background: rgba(var(--luzmo-border-color-rgb), 0.4);--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);
|
|
24
24
|
}
|
|
25
25
|
})();
|
|
26
|
-
import "../set-locale-
|
|
26
|
+
import "../set-locale-Uv6F4uSq.js";
|
|
27
27
|
import "../dataset-icon-x6Q8nhYc.js";
|
|
28
28
|
import "../data-broker-cLR-t5LM.js";
|
|
29
|
-
import { t as LuzmoDatasetSelectorList } from "../dataset-selector-list-
|
|
29
|
+
import { t as LuzmoDatasetSelectorList } from "../dataset-selector-list-DO_ExOrO.js";
|
|
30
30
|
export { LuzmoDatasetSelectorList };
|
package/components/{dataset-selector-list-TCwsPRXj.cjs → dataset-selector-list-BdeJlo0u.cjs}
RENAMED
|
@@ -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
|
-
const e=require(`./chunk-350yNsax.cjs`),t=require(`./decorate-Dq4-zbi1.cjs`),n=require(`./set-locale-C3lll-Q8.cjs`),r=require(`./localize-BBuZJf_h.cjs`),i=require(`./data-broker-BUIUM5hr.cjs`);let a=require(`lit`),o=require(`lit/decorators.js`),s=require(`lit/directives/repeat.js`);var c=`:host{box-sizing:border-box;height:100%;font-family:var(--luzmo-dataset-selector-list-font-family,var(--dataset-selector-list-font-family));color:var(--luzmo-dataset-selector-list-color);flex-direction:column;display:flex}:host .dataset-selector-list{gap:var(--luzmo-dataset-selector-list-gap,var(--dataset-selector-list-gap));background:var(--luzmo-dataset-selector-list-background,var(--dataset-selector-list-background));height:100%;padding:var(--luzmo-dataset-selector-list-padding,var(--dataset-selector-list-padding));border-radius:var(--luzmo-dataset-selector-list-border-radius,var(--dataset-selector-list-border-radius));flex-direction:column;display:flex}:host .search-input{background-color:var(--luzmo-dataset-selector-list-input-background,var(--dataset-selector-list-input-background));border:none;border-bottom:1px solid var(--luzmo-dataset-selector-list-input-border-color,var(--dataset-selector-list-input-border-color));color:var(--luzmo-dataset-selector-list-input-color,var(--dataset-selector-list-input-color));line-height:var(--luzmo-dataset-selector-list-input-line-height,var(--dataset-selector-list-input-line-height));font-size:var(--luzmo-dataset-selector-list-input-font-size,var(--dataset-selector-list-input-font-size));padding:var(--luzmo-dataset-selector-list-input-padding,var(--dataset-selector-list-input-padding));box-sizing:border-box;outline:none;width:100%;margin:0}:host .search-input::placeholder{color:var(--luzmo-font-color-tertiary,#999)}:host .datasets-scroll-container{flex:1;min-height:0;overflow:hidden auto}:host .datasets-scroll-container::-webkit-scrollbar{width:var(--luzmo-dataset-selector-list-scrollbar-width,var(--dataset-selector-list-scrollbar-width))}:host .datasets-scroll-container::-webkit-scrollbar-track{background:var(--luzmo-dataset-selector-list-scrollbar-track-background,var(--dataset-selector-list-scrollbar-track-background));border-radius:var(--luzmo-dataset-selector-list-scrollbar-track-border-radius,var(--dataset-selector-list-scrollbar-track-border-radius))}:host .datasets-scroll-container::-webkit-scrollbar-thumb{background:var(--luzmo-dataset-selector-list-scrollbar-thumb-background,var(--dataset-selector-list-scrollbar-thumb-background));border-radius:var(--luzmo-dataset-selector-list-scrollbar-thumb-border-radius,var(--dataset-selector-list-scrollbar-thumb-border-radius))}:host .datasets-scroll-container::-webkit-scrollbar-thumb:hover{background:var(--luzmo-dataset-selector-list-scrollbar-thumb-hover-background,var(--dataset-selector-list-scrollbar-thumb-hover-background))}:host .datasets-scroll-container{scrollbar-width:var(--luzmo-scrollbar-width,thin);scrollbar-color:var(--luzmo-dataset-selector-list-scrollbar-thumb-background,var(--dataset-selector-list-scrollbar-thumb-background,var(--luzmo-scrollbar-thumb-background)))var(--luzmo-dataset-selector-list-scrollbar-track-background,var(--dataset-selector-list-scrollbar-track-background,var(--luzmo-scrollbar-track-background)))}:host .datasets-list{flex-direction:column;display:flex}:host .available-dataset-item{padding:var(--luzmo-dataset-selector-list-item-padding,var(--dataset-selector-list-item-padding));color:var(--luzmo-dataset-selector-available-dataset-color,var(--dataset-selector-available-dataset-color));align-items:center;gap:var(--luzmo-dataset-selector-list-item-gap,var(--dataset-selector-list-item-gap));cursor:pointer;border-radius:var(--luzmo-dataset-selector-list-item-border-radius,var(--dataset-selector-list-item-border-radius));flex-direction:row;transition:background-color .15s;display:flex}:host .available-dataset-item:hover{background-color:var(--luzmo-dataset-selector-list-item-hover-background,var(--dataset-selector-list-item-hover-background))}:host .available-dataset-item:focus{outline:none}:host .available-dataset-item .dataset-icon{flex-shrink:0;justify-content:center;align-items:center;width:16px;height:16px;display:flex}:host .available-dataset-item .dataset-icon luzmo-icon{display:flex}:host .available-dataset-item .dataset-icon-img{object-fit:contain;width:16px;height:16px}:host .available-dataset-item .dataset-name{line-height:var(--luzmo-dataset-selector-list-item-line-height,var(--dataset-selector-list-item-line-height));font-size:var(--luzmo-dataset-selector-list-item-font-size,var(--dataset-selector-list-item-font-size));text-overflow:ellipsis;white-space:nowrap;flex:1;overflow:hidden}:host .available-dataset-item .dataset-name .dataset-name-search-highlight{background:var(--luzmo-dataset-selector-list-search-highlight-background,var(--dataset-selector-list-search-highlight-background));color:var(--luzmo-dataset-selector-list-search-highlight-color,var(--dataset-selector-list-search-highlight-color));border-radius:var(--luzmo-border-radius-s);padding:0}:host .no-datasets-found{height:50%;color:var(--luzmo-dataset-selector-list-no-datasets-color,var(--dataset-selector-list-no-datasets-color));font-size:var(--luzmo-dataset-selector-list-no-datasets-font-size,var(--dataset-selector-list-no-datasets-font-size));text-align:center;padding:var(--luzmo-spacing-4,1rem);justify-content:center;align-items:center;display:flex}:host .loader{padding:var(--luzmo-spacing-5,1.25rem)0;justify-content:center;align-items:center;display:flex}:host .loader .spinner{width:var(--luzmo-dataset-selector-list-loader-size,var(--dataset-selector-list-loader-size));height:var(--luzmo-dataset-selector-list-loader-size,var(--dataset-selector-list-loader-size));border:2px solid var(--luzmo-border-color-light,#e0e0e0);border-top-color:var(--luzmo-dataset-selector-list-loader-color,var(--dataset-selector-list-loader-color));border-radius:50%;animation:.8s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}:host{--dataset-selector-list-background:var(--luzmo-background-color);--dataset-selector-list-padding:0;--dataset-selector-list-gap:var(--luzmo-spacing-2);--dataset-selector-list-border-radius:var(--luzmo-border-radius-m);--dataset-selector-list-font-family:var(--luzmo-font-family);--dataset-selector-list-input-background:var(--luzmo-background-color);--dataset-selector-list-input-border-color:var(--luzmo-border-color-light,#0000000d);--dataset-selector-list-input-color:var(--luzmo-font-color);--dataset-selector-list-input-padding:0 var(--luzmo-spacing-4)var(--luzmo-spacing-2);--dataset-selector-list-input-font-size:var(--luzmo-font-size-s);--dataset-selector-list-input-line-height:1.5rem;--dataset-selector-list-item-padding:var(--luzmo-spacing-1)var(--luzmo-spacing-4);--dataset-selector-list-item-gap:var(--luzmo-spacing-3);--dataset-selector-list-item-hover-background:var(--luzmo-background-color-highlight);--dataset-selector-list-item-font-size:var(--luzmo-font-size-s);--dataset-selector-list-item-line-height:1.5rem;--dataset-selector-list-item-border-radius:var(--luzmo-border-radius-s);--dataset-selector-list-search-highlight-background:rgba(var(--luzmo-primary-rgb),.15);--dataset-selector-list-search-highlight-color:var(--luzmo-primary);--dataset-selector-list-scrollbar-width:var(--luzmo-scrollbar-size);--dataset-selector-list-scrollbar-track-background:var(--luzmo-scrollbar-track-background);--dataset-selector-list-scrollbar-track-border-radius:var(--luzmo-scrollbar-track-border-radius);--dataset-selector-list-scrollbar-thumb-background:var(--luzmo-scrollbar-thumb-background);--dataset-selector-list-scrollbar-thumb-border-radius:var(--luzmo-scrollbar-thumb-border-radius);--dataset-selector-list-scrollbar-thumb-hover-background:var(--luzmo-scrollbar-thumb-hover-background);--dataset-selector-list-loader-size:24px;--dataset-selector-list-loader-color:var(--luzmo-primary);--dataset-selector-list-no-datasets-color:var(--luzmo-font-color);--dataset-selector-list-no-datasets-font-size:var(--luzmo-font-size-s);--dataset-selector-available-dataset-color:var(--luzmo-font-color)}`,l=7,u=600,d=5,f=class extends a.LitElement{constructor(...e){super(...e),this._selectedDatasets=new Set,this.showSearch=!0,this.searchPlaceholder=`Search datasets...`,this.noDatasetsMessage=`No datasets found`,this.highlightSearchMatches=!0,this.authKey=``,this.authToken=``,this.apiUrl=`https://api.luzmo.com`,this.appServer=`https://app.luzmo.com`,this.flagOpendata=!1,this._availableDatasets=[],this._status={allDatasetsLoaded:!1,paging:!1,busy:!0,error:!1},this._searchValue=``,this._currentOffset=0,this._searchDebounceTimer=null,this._queryCache=new Map,this._calculatedQueryLimit=null,this._hasLoadedEmptyPage=!1}static{this.styles=(0,a.unsafeCSS)(c)}set selectedDatasets(e){this._selectedDatasets=e,this._shouldLoadMoreDatasetsForViewport()&&this._loadAvailableDatasets({append:!0})}get selectedDatasets(){return this._selectedDatasets}connectedCallback(){super.connectedCallback?.(),this._configureBroker(),this._waitForContainerHeightAndLoad()}_configureBroker(){(this.authKey||this.authToken||this.apiUrl)&&i.t.configure({authKey:this.authKey,authToken:this.authToken,apiUrl:this.apiUrl})}_waitForContainerHeightAndLoad(){requestAnimationFrame(()=>{this._loadAvailableDatasets({append:!1})})}_calculateOptimalQueryLimit(){if(this._calculatedQueryLimit!==null)return this._calculatedQueryLimit;let e=this.shadowRoot?.querySelector(`.dataset-selector-list`);if(!e)return l;let t=getComputedStyle(e),n=e.clientHeight,r=Number.parseFloat(t.height),i=Math.max(n,r);if(i<=0)return l;let a=Math.floor(i/24),o=Math.max(a+d,l);return this._calculatedQueryLimit=o,o}get _filteredDatasets(){return this._selectedDatasets.size===0?this._availableDatasets:this._availableDatasets.filter(e=>!this._selectedDatasets.has(e.id))}_handleSearchInput(e){this._searchValue=e.target.value,this._searchDebounceTimer!==null&&clearTimeout(this._searchDebounceTimer),this._searchDebounceTimer=window.setTimeout(()=>{this._loadAvailableDatasets({append:!1})},u)}_handleScroll(e){let t=e.target,n=t.scrollTop,r=t.scrollHeight;n+t.clientHeight>=r-50&&!this._status.allDatasetsLoaded&&!this._status.busy&&this._loadAvailableDatasets({append:!0})}async _loadAvailableDatasets({append:e}){e||(this._calculatedQueryLimit=null,this._hasLoadedEmptyPage=!1),this._status={...this._status,busy:!0,allDatasetsLoaded:e?this._status.allDatasetsLoaded:!1,paging:e};let t=this._generateQuery(e),n=JSON.stringify(t),r=this._queryCache.has(n);try{let a;r?a=this._queryCache.get(n):(a=await i.t.fetchApi(`/securable`,{action:`get`,version:`0.1.0`,find:t}),this._queryCache.set(n,a)),this._onDatasetsLoaded(e,a),this._shouldLoadMoreDatasetsForViewport()&&await this._loadAvailableDatasets({append:!0})}catch(e){console.error(`Error loading datasets:`,e),this._status={...this._status,busy:!1,paging:!1,error:!0}}finally{this._status={...this._status,busy:!1,paging:!1}}}_generateQuery(e){let t=this._calculateOptimalQueryLimit();e?this._currentOffset+=t:this._currentOffset=0;let n=this._searchValue?{search:{match_types:[`name`,`description`],keyphrase:this._searchValue,securable_types:`dataset`},order:[[`name`,`asc`]]}:{order:[[`updated_at`,`desc`]]};return{attributes:[`id`,`updated_at`,`name`,`subtype`],include:[{model:`Collection`,attributes:[`id`,`favorite`],where:{favorite:!0}},{model:`Account`,attributes:[`id`,`provider`,`name`],include:[{model:`Plugin`,attributes:[`id`],include:[{model:`Thumbnail`,where:{size:`32px`}}]}]}],where:{type:`dataset`},limit:t,offset:this._currentOffset,...n,...this.flagOpendata?{public:null}:{}}}_onDatasetsLoaded(e,{rows:t,count:n}){let r;if(e){let e=new Set(this._availableDatasets.map(e=>e.id)),n=t.filter(t=>!e.has(t.id));r=[...this._availableDatasets,...n]}else r=t||[];e&&t.length===0?this._hasLoadedEmptyPage=!0:t.length>0&&(this._hasLoadedEmptyPage=!1);let i=r.reduce((e,t)=>(e.some(e=>e.id===t.id)||e.push(t),e),[]),a=r.length,o=this._hasLoadedEmptyPage||a>=n;this._status={...this._status,allDatasetsLoaded:o},this._availableDatasets=i}_shouldLoadMoreDatasetsForViewport(){if(this._status.allDatasetsLoaded||this._hasLoadedEmptyPage||this._status.busy)return!1;let e=this.shadowRoot?.querySelector(`.datasets-scroll-container`);if(!e)return!1;let t=e.clientHeight,n=Math.ceil(t/24),r=Math.ceil(n*1.5);return this._filteredDatasets.length<r}_getDatasetName(e){let t=n.t();return r.t(e.name,t)||e.id||`Unknown Dataset`}_escapeRegExp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}_renderHighlightedDatasetName(e){let t=this._getDatasetName(e),n=this._searchValue.trim();if(!this.highlightSearchMatches||!n)return t;let r=this._escapeRegExp(n),i=RegExp(`(${r})`,`gi`),o=t.split(i),s=n.toLowerCase();return o.length===1?t:a.html`${o.map(e=>e.toLowerCase()===s?a.html`<span class="dataset-name-search-highlight">${e}</span>`:e)}`}_selectDataset(e){this.dispatchEvent(new CustomEvent(`dataset-selected`,{detail:e,bubbles:!0,composed:!0}))}_handleDatasetClick(e){let t=e.currentTarget.dataset.datasetId,n=this._filteredDatasets.find(e=>e.id===t);n&&this._selectDataset(n)}_handleDatasetKeydown(e){if(e.key===`Enter`||e.key===` `){e.preventDefault();let t=e.currentTarget.dataset.datasetId,n=this._filteredDatasets.find(e=>e.id===t);n&&this._selectDataset(n)}}_renderLoader(){return a.html`
|
|
20
|
+
const e=require(`./chunk-350yNsax.cjs`),t=require(`./decorate-Dq4-zbi1.cjs`),n=require(`./set-locale-CKjJZRH6.cjs`),r=require(`./localize-BBuZJf_h.cjs`),i=require(`./data-broker-BUIUM5hr.cjs`);let a=require(`lit`),o=require(`lit/decorators.js`),s=require(`lit/directives/repeat.js`);var c=`:host{box-sizing:border-box;height:100%;font-family:var(--luzmo-dataset-selector-list-font-family,var(--dataset-selector-list-font-family));color:var(--luzmo-dataset-selector-list-color);flex-direction:column;display:flex}:host .dataset-selector-list{gap:var(--luzmo-dataset-selector-list-gap,var(--dataset-selector-list-gap));background:var(--luzmo-dataset-selector-list-background,var(--dataset-selector-list-background));height:100%;padding:var(--luzmo-dataset-selector-list-padding,var(--dataset-selector-list-padding));border-radius:var(--luzmo-dataset-selector-list-border-radius,var(--dataset-selector-list-border-radius));flex-direction:column;display:flex}:host .search-input{background-color:var(--luzmo-dataset-selector-list-input-background,var(--dataset-selector-list-input-background));border:none;border-bottom:1px solid var(--luzmo-dataset-selector-list-input-border-color,var(--dataset-selector-list-input-border-color));color:var(--luzmo-dataset-selector-list-input-color,var(--dataset-selector-list-input-color));line-height:var(--luzmo-dataset-selector-list-input-line-height,var(--dataset-selector-list-input-line-height));font-size:var(--luzmo-dataset-selector-list-input-font-size,var(--dataset-selector-list-input-font-size));padding:var(--luzmo-dataset-selector-list-input-padding,var(--dataset-selector-list-input-padding));box-sizing:border-box;outline:none;width:100%;margin:0}:host .search-input::placeholder{color:var(--luzmo-font-color-tertiary,#999)}:host .datasets-scroll-container{flex:1;min-height:0;overflow:hidden auto}:host .datasets-scroll-container::-webkit-scrollbar{width:var(--luzmo-dataset-selector-list-scrollbar-width,var(--dataset-selector-list-scrollbar-width))}:host .datasets-scroll-container::-webkit-scrollbar-track{background:var(--luzmo-dataset-selector-list-scrollbar-track-background,var(--dataset-selector-list-scrollbar-track-background));border-radius:var(--luzmo-dataset-selector-list-scrollbar-track-border-radius,var(--dataset-selector-list-scrollbar-track-border-radius))}:host .datasets-scroll-container::-webkit-scrollbar-thumb{background:var(--luzmo-dataset-selector-list-scrollbar-thumb-background,var(--dataset-selector-list-scrollbar-thumb-background));border-radius:var(--luzmo-dataset-selector-list-scrollbar-thumb-border-radius,var(--dataset-selector-list-scrollbar-thumb-border-radius))}:host .datasets-scroll-container::-webkit-scrollbar-thumb:hover{background:var(--luzmo-dataset-selector-list-scrollbar-thumb-hover-background,var(--dataset-selector-list-scrollbar-thumb-hover-background))}:host .datasets-scroll-container{scrollbar-width:var(--luzmo-scrollbar-width,thin);scrollbar-color:var(--luzmo-dataset-selector-list-scrollbar-thumb-background,var(--dataset-selector-list-scrollbar-thumb-background,var(--luzmo-scrollbar-thumb-background)))var(--luzmo-dataset-selector-list-scrollbar-track-background,var(--dataset-selector-list-scrollbar-track-background,var(--luzmo-scrollbar-track-background)))}:host .datasets-list{flex-direction:column;display:flex}:host .available-dataset-item{padding:var(--luzmo-dataset-selector-list-item-padding,var(--dataset-selector-list-item-padding));color:var(--luzmo-dataset-selector-available-dataset-color,var(--dataset-selector-available-dataset-color));align-items:center;gap:var(--luzmo-dataset-selector-list-item-gap,var(--dataset-selector-list-item-gap));cursor:pointer;border-radius:var(--luzmo-dataset-selector-list-item-border-radius,var(--dataset-selector-list-item-border-radius));flex-direction:row;transition:background-color .15s;display:flex}:host .available-dataset-item:hover{background-color:var(--luzmo-dataset-selector-list-item-hover-background,var(--dataset-selector-list-item-hover-background))}:host .available-dataset-item:focus{outline:none}:host .available-dataset-item .dataset-icon{flex-shrink:0;justify-content:center;align-items:center;width:16px;height:16px;display:flex}:host .available-dataset-item .dataset-icon luzmo-icon{display:flex}:host .available-dataset-item .dataset-icon-img{object-fit:contain;width:16px;height:16px}:host .available-dataset-item .dataset-name{line-height:var(--luzmo-dataset-selector-list-item-line-height,var(--dataset-selector-list-item-line-height));font-size:var(--luzmo-dataset-selector-list-item-font-size,var(--dataset-selector-list-item-font-size));text-overflow:ellipsis;white-space:nowrap;flex:1;overflow:hidden}:host .available-dataset-item .dataset-name .dataset-name-search-highlight{background:var(--luzmo-dataset-selector-list-search-highlight-background,var(--dataset-selector-list-search-highlight-background));color:var(--luzmo-dataset-selector-list-search-highlight-color,var(--dataset-selector-list-search-highlight-color));border-radius:var(--luzmo-border-radius-s);padding:0}:host .no-datasets-found{height:50%;color:var(--luzmo-dataset-selector-list-no-datasets-color,var(--dataset-selector-list-no-datasets-color));font-size:var(--luzmo-dataset-selector-list-no-datasets-font-size,var(--dataset-selector-list-no-datasets-font-size));text-align:center;padding:var(--luzmo-spacing-4,1rem);justify-content:center;align-items:center;display:flex}:host .loader{padding:var(--luzmo-spacing-5,1.25rem)0;justify-content:center;align-items:center;display:flex}:host .loader .spinner{width:var(--luzmo-dataset-selector-list-loader-size,var(--dataset-selector-list-loader-size));height:var(--luzmo-dataset-selector-list-loader-size,var(--dataset-selector-list-loader-size));border:2px solid var(--luzmo-border-color-light,#e0e0e0);border-top-color:var(--luzmo-dataset-selector-list-loader-color,var(--dataset-selector-list-loader-color));border-radius:50%;animation:.8s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}:host{--dataset-selector-list-background:var(--luzmo-background-color);--dataset-selector-list-padding:0;--dataset-selector-list-gap:var(--luzmo-spacing-2);--dataset-selector-list-border-radius:var(--luzmo-border-radius-m);--dataset-selector-list-font-family:var(--luzmo-font-family);--dataset-selector-list-input-background:var(--luzmo-background-color);--dataset-selector-list-input-border-color:var(--luzmo-border-color-light,#0000000d);--dataset-selector-list-input-color:var(--luzmo-font-color);--dataset-selector-list-input-padding:0 var(--luzmo-spacing-4)var(--luzmo-spacing-2);--dataset-selector-list-input-font-size:var(--luzmo-font-size-s);--dataset-selector-list-input-line-height:1.5rem;--dataset-selector-list-item-padding:var(--luzmo-spacing-1)var(--luzmo-spacing-4);--dataset-selector-list-item-gap:var(--luzmo-spacing-3);--dataset-selector-list-item-hover-background:var(--luzmo-background-color-highlight);--dataset-selector-list-item-font-size:var(--luzmo-font-size-s);--dataset-selector-list-item-line-height:1.5rem;--dataset-selector-list-item-border-radius:var(--luzmo-border-radius-s);--dataset-selector-list-search-highlight-background:rgba(var(--luzmo-primary-rgb),.15);--dataset-selector-list-search-highlight-color:var(--luzmo-primary);--dataset-selector-list-scrollbar-width:var(--luzmo-scrollbar-size);--dataset-selector-list-scrollbar-track-background:var(--luzmo-scrollbar-track-background);--dataset-selector-list-scrollbar-track-border-radius:var(--luzmo-scrollbar-track-border-radius);--dataset-selector-list-scrollbar-thumb-background:var(--luzmo-scrollbar-thumb-background);--dataset-selector-list-scrollbar-thumb-border-radius:var(--luzmo-scrollbar-thumb-border-radius);--dataset-selector-list-scrollbar-thumb-hover-background:var(--luzmo-scrollbar-thumb-hover-background);--dataset-selector-list-loader-size:24px;--dataset-selector-list-loader-color:var(--luzmo-primary);--dataset-selector-list-no-datasets-color:var(--luzmo-font-color);--dataset-selector-list-no-datasets-font-size:var(--luzmo-font-size-s);--dataset-selector-available-dataset-color:var(--luzmo-font-color)}`,l=7,u=600,d=5,f=class extends a.LitElement{constructor(...e){super(...e),this._selectedDatasets=new Set,this.showSearch=!0,this.searchPlaceholder=`Search datasets...`,this.noDatasetsMessage=`No datasets found`,this.highlightSearchMatches=!0,this.authKey=``,this.authToken=``,this.apiUrl=`https://api.luzmo.com`,this.appServer=`https://app.luzmo.com`,this.flagOpendata=!1,this._availableDatasets=[],this._status={allDatasetsLoaded:!1,paging:!1,busy:!0,error:!1},this._searchValue=``,this._currentOffset=0,this._searchDebounceTimer=null,this._queryCache=new Map,this._calculatedQueryLimit=null,this._hasLoadedEmptyPage=!1}static{this.styles=(0,a.unsafeCSS)(c)}set selectedDatasets(e){this._selectedDatasets=e,this._shouldLoadMoreDatasetsForViewport()&&this._loadAvailableDatasets({append:!0})}get selectedDatasets(){return this._selectedDatasets}connectedCallback(){super.connectedCallback?.(),this._configureBroker(),this._waitForContainerHeightAndLoad()}_configureBroker(){(this.authKey||this.authToken||this.apiUrl)&&i.t.configure({authKey:this.authKey,authToken:this.authToken,apiUrl:this.apiUrl})}_waitForContainerHeightAndLoad(){requestAnimationFrame(()=>{this._loadAvailableDatasets({append:!1})})}_calculateOptimalQueryLimit(){if(this._calculatedQueryLimit!==null)return this._calculatedQueryLimit;let e=this.shadowRoot?.querySelector(`.dataset-selector-list`);if(!e)return l;let t=getComputedStyle(e),n=e.clientHeight,r=Number.parseFloat(t.height),i=Math.max(n,r);if(i<=0)return l;let a=Math.floor(i/24),o=Math.max(a+d,l);return this._calculatedQueryLimit=o,o}get _filteredDatasets(){return this._selectedDatasets.size===0?this._availableDatasets:this._availableDatasets.filter(e=>!this._selectedDatasets.has(e.id))}_handleSearchInput(e){this._searchValue=e.target.value,this._searchDebounceTimer!==null&&clearTimeout(this._searchDebounceTimer),this._searchDebounceTimer=window.setTimeout(()=>{this._loadAvailableDatasets({append:!1})},u)}_handleScroll(e){let t=e.target,n=t.scrollTop,r=t.scrollHeight;n+t.clientHeight>=r-50&&!this._status.allDatasetsLoaded&&!this._status.busy&&this._loadAvailableDatasets({append:!0})}async _loadAvailableDatasets({append:e}){e||(this._calculatedQueryLimit=null,this._hasLoadedEmptyPage=!1),this._status={...this._status,busy:!0,allDatasetsLoaded:e?this._status.allDatasetsLoaded:!1,paging:e};let t=this._generateQuery(e),n=JSON.stringify(t),r=this._queryCache.has(n);try{let a;r?a=this._queryCache.get(n):(a=await i.t.fetchApi(`/securable`,{action:`get`,version:`0.1.0`,find:t}),this._queryCache.set(n,a)),this._onDatasetsLoaded(e,a),this._shouldLoadMoreDatasetsForViewport()&&await this._loadAvailableDatasets({append:!0})}catch(e){console.error(`Error loading datasets:`,e),this._status={...this._status,busy:!1,paging:!1,error:!0}}finally{this._status={...this._status,busy:!1,paging:!1}}}_generateQuery(e){let t=this._calculateOptimalQueryLimit();e?this._currentOffset+=t:this._currentOffset=0;let n=this._searchValue?{search:{match_types:[`name`,`description`],keyphrase:this._searchValue,securable_types:`dataset`},order:[[`name`,`asc`]]}:{order:[[`updated_at`,`desc`]]};return{attributes:[`id`,`updated_at`,`name`,`subtype`],include:[{model:`Collection`,attributes:[`id`,`favorite`],where:{favorite:!0}},{model:`Account`,attributes:[`id`,`provider`,`name`],include:[{model:`Plugin`,attributes:[`id`],include:[{model:`Thumbnail`,where:{size:`32px`}}]}]}],where:{type:`dataset`},limit:t,offset:this._currentOffset,...n,...this.flagOpendata?{public:null}:{}}}_onDatasetsLoaded(e,{rows:t,count:n}){let r;if(e){let e=new Set(this._availableDatasets.map(e=>e.id)),n=t.filter(t=>!e.has(t.id));r=[...this._availableDatasets,...n]}else r=t||[];e&&t.length===0?this._hasLoadedEmptyPage=!0:t.length>0&&(this._hasLoadedEmptyPage=!1);let i=r.reduce((e,t)=>(e.some(e=>e.id===t.id)||e.push(t),e),[]),a=r.length,o=this._hasLoadedEmptyPage||a>=n;this._status={...this._status,allDatasetsLoaded:o},this._availableDatasets=i}_shouldLoadMoreDatasetsForViewport(){if(this._status.allDatasetsLoaded||this._hasLoadedEmptyPage||this._status.busy)return!1;let e=this.shadowRoot?.querySelector(`.datasets-scroll-container`);if(!e)return!1;let t=e.clientHeight,n=Math.ceil(t/24),r=Math.ceil(n*1.5);return this._filteredDatasets.length<r}_getDatasetName(e){let t=n.t();return r.t(e.name,t)||e.id||`Unknown Dataset`}_escapeRegExp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}_renderHighlightedDatasetName(e){let t=this._getDatasetName(e),n=this._searchValue.trim();if(!this.highlightSearchMatches||!n)return t;let r=this._escapeRegExp(n),i=RegExp(`(${r})`,`gi`),o=t.split(i),s=n.toLowerCase();return o.length===1?t:a.html`${o.map(e=>e.toLowerCase()===s?a.html`<span class="dataset-name-search-highlight">${e}</span>`:e)}`}_selectDataset(e){this.dispatchEvent(new CustomEvent(`dataset-selected`,{detail:e,bubbles:!0,composed:!0}))}_handleDatasetClick(e){let t=e.currentTarget.dataset.datasetId,n=this._filteredDatasets.find(e=>e.id===t);n&&this._selectDataset(n)}_handleDatasetKeydown(e){if(e.key===`Enter`||e.key===` `){e.preventDefault();let t=e.currentTarget.dataset.datasetId,n=this._filteredDatasets.find(e=>e.id===t);n&&this._selectDataset(n)}}_renderLoader(){return a.html`
|
|
21
21
|
<div class="loader">
|
|
22
22
|
<div class="spinner"></div>
|
|
23
23
|
</div>
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* SOFTWARE.
|
|
19
19
|
* */
|
|
20
20
|
import { t as __decorate } from "./decorate-Da6S_xrw.js";
|
|
21
|
-
import { t as getLocale } from "./set-locale-
|
|
21
|
+
import { t as getLocale } from "./set-locale-Uv6F4uSq.js";
|
|
22
22
|
import { t as localize } from "./localize-Dlt3EN5i.js";
|
|
23
23
|
import { t as dataBroker } from "./data-broker-cLR-t5LM.js";
|
|
24
24
|
import { LitElement, html, nothing, unsafeCSS } from "lit";
|
|
@@ -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
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../set-locale-
|
|
20
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../set-locale-CKjJZRH6.cjs`),require(`../dataset-icon-BbNgugDA.cjs`),require(`../data-broker-BUIUM5hr.cjs`),require(`../dataset-selector-list-BdeJlo0u.cjs`);const e=require(`../dataset-selector-row-CAlRVIk_.cjs`);exports.LuzmoDatasetSelectorRow=e.t;
|