@aquera/nile-visualization 2.9.1 → 2.9.3

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.
Files changed (28) hide show
  1. package/dist/src/nile-chart/nile-chart.css.js +6 -0
  2. package/dist/src/nile-filter-chart/nile-filter-chart.css.js +274 -4
  3. package/dist/src/nile-filter-chart/nile-filter-chart.d.ts +59 -206
  4. package/dist/src/nile-filter-chart/nile-filter-chart.js +330 -436
  5. package/dist/src/nile-filter-chart/utils/badge.d.ts +3 -0
  6. package/dist/src/nile-filter-chart/utils/badge.js +33 -0
  7. package/dist/src/nile-filter-chart/utils/comparison.d.ts +3 -0
  8. package/dist/src/nile-filter-chart/utils/comparison.js +24 -0
  9. package/dist/src/nile-filter-chart/utils/dropdown.d.ts +3 -0
  10. package/dist/src/nile-filter-chart/utils/dropdown.js +24 -0
  11. package/dist/src/nile-filter-chart/utils/preset.d.ts +3 -0
  12. package/dist/src/nile-filter-chart/utils/preset.js +16 -0
  13. package/dist/src/nile-filter-chart/utils/prompt.d.ts +12 -0
  14. package/dist/src/nile-filter-chart/utils/prompt.js +676 -0
  15. package/dist/src/nile-filter-chart/utils/radio.d.ts +3 -0
  16. package/dist/src/nile-filter-chart/utils/radio.js +13 -0
  17. package/dist/src/nile-filter-chart/utils/search.d.ts +3 -0
  18. package/dist/src/nile-filter-chart/utils/search.js +12 -0
  19. package/dist/src/nile-filter-chart/utils/segmented.d.ts +3 -0
  20. package/dist/src/nile-filter-chart/utils/segmented.js +15 -0
  21. package/dist/src/nile-filter-chart/utils/threshold.d.ts +3 -0
  22. package/dist/src/nile-filter-chart/utils/threshold.js +58 -0
  23. package/dist/src/nile-filter-chart/utils/toggle.d.ts +3 -0
  24. package/dist/src/nile-filter-chart/utils/toggle.js +19 -0
  25. package/dist/src/nile-filter-chart/utils/types.d.ts +334 -0
  26. package/dist/src/nile-filter-chart/utils/types.js +2 -0
  27. package/dist/src/nile-kpi-chart/nile-kpi-chart.css.js +62 -4
  28. package/package.json +1 -1
@@ -0,0 +1,3 @@
1
+ import { TemplateResult } from 'lit';
2
+ import type { FilterChartHost, NormalizedFilterControl } from './types.js';
3
+ export declare function renderBadge(host: FilterChartHost, ctrl: NormalizedFilterControl): TemplateResult;
@@ -0,0 +1,33 @@
1
+ import { html } from 'lit';
2
+ export function renderBadge(host, ctrl) {
3
+ const current = host.selectedValues.get(ctrl.id);
4
+ return html `
5
+ <div class="fc-badge-group" role="group" aria-label="${ctrl.label}">
6
+ ${(ctrl.options ?? []).map(opt => {
7
+ const sel = ctrl.selection === 'multi'
8
+ ? (Array.isArray(current) && current.includes(opt.value))
9
+ : current === opt.value;
10
+ return html `
11
+ <nile-tag
12
+ pill
13
+ size="medium"
14
+ variant="${sel ? (opt.ngVariant ?? 'primary') : 'normal'}"
15
+ @click="${() => {
16
+ if (ctrl.selection === 'single') {
17
+ host.setValue(ctrl.id, sel ? '' : opt.value);
18
+ }
19
+ else {
20
+ const arr = Array.isArray(current) ? [...current] : [];
21
+ const idx = arr.indexOf(opt.value);
22
+ if (idx === -1)
23
+ arr.push(opt.value);
24
+ else
25
+ arr.splice(idx, 1);
26
+ host.setValue(ctrl.id, arr);
27
+ }
28
+ }}"
29
+ >${opt.label}</nile-tag>`;
30
+ })}
31
+ </div>`;
32
+ }
33
+ //# sourceMappingURL=badge.js.map
@@ -0,0 +1,3 @@
1
+ import { TemplateResult } from 'lit';
2
+ import type { FilterChartHost, NormalizedFilterControl } from './types.js';
3
+ export declare function renderComparison(host: FilterChartHost, ctrl: NormalizedFilterControl): TemplateResult;
@@ -0,0 +1,24 @@
1
+ import { html } from 'lit';
2
+ export function renderComparison(host, ctrl) {
3
+ const valA = host.selectedValues.get(ctrl.id) ?? '';
4
+ const valB = host.selectedValues.get(`${ctrl.id}__b`) ?? '';
5
+ return html `
6
+ <div class="fc-comparison">
7
+ <nile-select
8
+ .value="${valA}"
9
+ placeholder="Period A"
10
+ @nile-change="${(e) => { e.stopPropagation(); host.setValue(ctrl.id, e.detail.value); }}"
11
+ >
12
+ ${(ctrl.options ?? []).map(o => html `<nile-option value="${o.value}">${o.label}</nile-option>`)}
13
+ </nile-select>
14
+ <span class="fc-vs">VS</span>
15
+ <nile-select
16
+ .value="${valB}"
17
+ placeholder="Period B"
18
+ @nile-change="${(e) => { e.stopPropagation(); host.setValue(`${ctrl.id}__b`, e.detail.value); }}"
19
+ >
20
+ ${(ctrl.options ?? []).map(o => html `<nile-option value="${o.value}">${o.label}</nile-option>`)}
21
+ </nile-select>
22
+ </div>`;
23
+ }
24
+ //# sourceMappingURL=comparison.js.map
@@ -0,0 +1,3 @@
1
+ import { TemplateResult } from 'lit';
2
+ import type { FilterChartHost, NormalizedFilterControl } from './types.js';
3
+ export declare function renderDropdown(host: FilterChartHost, ctrl: NormalizedFilterControl): TemplateResult;
@@ -0,0 +1,24 @@
1
+ import { html } from 'lit';
2
+ export function renderDropdown(host, ctrl) {
3
+ const raw = host.selectedValues.get(ctrl.id);
4
+ const current = Array.isArray(raw) ? raw : (raw ? [raw] : []);
5
+ const isMulti = ctrl.selection === 'multi';
6
+ return html `
7
+ <nile-select
8
+ .value="${isMulti ? current : (current[0] ?? '')}"
9
+ ?multiple="${isMulti}"
10
+ searchEnabled
11
+ placeholder="${ctrl.placeholders?.[0] ?? `Select ${ctrl.label || 'option'}…`}"
12
+ @nile-change="${(e) => {
13
+ e.stopPropagation();
14
+ host.setValue(ctrl.id, e.detail.value);
15
+ }}"
16
+ >
17
+ ${(ctrl.options ?? []).map(opt => html `
18
+ <nile-option
19
+ value="${opt.value}"
20
+ ?selected="${isMulti ? current.includes(opt.value) : current[0] === opt.value}"
21
+ >${opt.label}</nile-option>`)}
22
+ </nile-select>`;
23
+ }
24
+ //# sourceMappingURL=dropdown.js.map
@@ -0,0 +1,3 @@
1
+ import { TemplateResult } from 'lit';
2
+ import type { FilterChartHost, NormalizedFilterControl } from './types.js';
3
+ export declare function renderPreset(host: FilterChartHost, ctrl: NormalizedFilterControl): TemplateResult;
@@ -0,0 +1,16 @@
1
+ import { html, nothing } from 'lit';
2
+ export function renderPreset(host, ctrl) {
3
+ const current = host.selectedValues.get(ctrl.id);
4
+ return html `
5
+ <div class="fc-preset-list">
6
+ ${(ctrl.options ?? []).map(opt => html `
7
+ <button
8
+ class="fc-preset-item ${current === opt.value ? 'fc-preset-item--selected' : ''}"
9
+ @click="${() => host.setValue(ctrl.id, opt.value)}"
10
+ >
11
+ ${opt.icon ? html `<span class="fc-preset-icon">${opt.icon}</span>` : nothing}
12
+ ${opt.label}
13
+ </button>`)}
14
+ </div>`;
15
+ }
16
+ //# sourceMappingURL=preset.js.map
@@ -0,0 +1,12 @@
1
+ import { TemplateResult } from 'lit';
2
+ import type { FilterChartHost, FilterControl, NormalizedFilterControl, QueryNode } from './types.js';
3
+ /**
4
+ * Parse + compile a strict-mode prompt expression. Resolves with both the
5
+ * parsed AST (jsep) and the compiled filtrex predicate, or rejects with
6
+ * a parse / compile Error.
7
+ */
8
+ export declare function validatePromptExpression(value: string, ctrl: FilterControl): Promise<{
9
+ ast: QueryNode;
10
+ evaluate: (row: unknown) => unknown;
11
+ }>;
12
+ export declare function renderPrompt(host: FilterChartHost, ctrl: NormalizedFilterControl): TemplateResult;