@luzmo/analytics-components-kit 1.0.8-beta.6 → 1.0.8-beta.7
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/components/index.cjs +1 -1
- package/components/index.js +1 -1
- package/components/viz-item-menu/index.cjs +1 -1
- package/components/viz-item-menu/index.js +1 -1
- package/components/viz-item-menu/viz-item-menu.d.ts +3 -0
- package/components/{viz-item-menu-Ht6bklNL.js → viz-item-menu-B7yRaSAU.js} +1 -1
- package/components/{viz-item-menu-XHh4qhtn.cjs → viz-item-menu-hLdU-02Q.cjs} +1 -1
- package/custom-elements.json +14 -0
- package/package.json +1 -1
- package/react/package.json +2 -2
- package/angular/README.md +0 -40
- package/angular/components/ai-chat-empty-state.ts +0 -98
- package/angular/components/ai-chat.ts +0 -440
- package/angular/components/ai-interaction-textarea.ts +0 -283
- package/angular/components/data-field-level.ts +0 -130
- package/angular/components/data-field-panel.ts +0 -256
- package/angular/components/data-field.ts +0 -130
- package/angular/components/data-fields-select.ts +0 -212
- package/angular/components/dataset-icon.ts +0 -83
- package/angular/components/dataset-selector-list.ts +0 -147
- package/angular/components/dataset-selector-row.ts +0 -198
- package/angular/components/display-settings-binning.ts +0 -92
- package/angular/components/display-settings-datetime.ts +0 -100
- package/angular/components/display-settings-grand-totals.ts +0 -92
- package/angular/components/display-settings-numeric.ts +0 -113
- package/angular/components/display-settings-period-over-period.ts +0 -107
- package/angular/components/display-settings.ts +0 -227
- package/angular/components/filter-expression-picker.ts +0 -168
- package/angular/components/filter-item.ts +0 -175
- package/angular/components/filter-parameter-picker.ts +0 -155
- package/angular/components/filter-value-picker-datetime.ts +0 -125
- package/angular/components/filter-value-picker-hierarchy.ts +0 -146
- package/angular/components/filter-value-picker-numeric.ts +0 -146
- package/angular/components/filter-value-picker.ts +0 -160
- package/angular/components/filters.ts +0 -209
- package/angular/components/formula-editor.ts +0 -229
- package/angular/components/formula-field.ts +0 -198
- package/angular/components/formula.ts +0 -170
- package/angular/components/interactive-viz-item.ts +0 -186
- package/angular/components/item-grid-item-actions-menu.ts +0 -113
- package/angular/components/item-grid.ts +0 -242
- package/angular/components/item-option-action-button-group.ts +0 -105
- package/angular/components/item-option-color-palette-picker.ts +0 -126
- package/angular/components/item-option-color-picker.ts +0 -134
- package/angular/components/item-option-color-range.ts +0 -168
- package/angular/components/item-option-guidelines.ts +0 -84
- package/angular/components/item-option-multi-language-field.ts +0 -133
- package/angular/components/item-option-number-field.ts +0 -161
- package/angular/components/item-option-panel.ts +0 -149
- package/angular/components/item-option-picker.ts +0 -120
- package/angular/components/item-option-position-picker.ts +0 -98
- package/angular/components/item-option-positions-number-field.ts +0 -140
- package/angular/components/item-option-radio-button-group.ts +0 -119
- package/angular/components/item-option-slider.ts +0 -126
- package/angular/components/item-option-switch.ts +0 -98
- package/angular/components/item-option-text-field.ts +0 -112
- package/angular/components/item-option.ts +0 -163
- package/angular/components/item-slot-drop-panel.ts +0 -236
- package/angular/components/item-slot-drop.ts +0 -231
- package/angular/components/item-slot-picker-panel.ts +0 -299
- package/angular/components/item-slot-picker.ts +0 -241
- package/angular/components/slot-menu-list.ts +0 -121
- package/angular/components/slot-menu.ts +0 -304
- package/angular/components/viz-item-menu.ts +0 -118
- package/angular/esm/components/ai-chat-empty-state.d.ts +0 -39
- package/angular/esm/components/ai-chat-empty-state.js +0 -99
- package/angular/esm/components/ai-chat.d.ts +0 -147
- package/angular/esm/components/ai-chat.js +0 -455
- package/angular/esm/components/ai-interaction-textarea.d.ts +0 -106
- package/angular/esm/components/ai-interaction-textarea.js +0 -305
- package/angular/esm/components/data-field-level.d.ts +0 -50
- package/angular/esm/components/data-field-level.js +0 -129
- package/angular/esm/components/data-field-panel.d.ts +0 -86
- package/angular/esm/components/data-field-panel.js +0 -268
- package/angular/esm/components/data-field.d.ts +0 -50
- package/angular/esm/components/data-field.js +0 -129
- package/angular/esm/components/data-fields-select.d.ts +0 -81
- package/angular/esm/components/data-fields-select.js +0 -227
- package/angular/esm/components/dataset-icon.d.ts +0 -34
- package/angular/esm/components/dataset-icon.js +0 -86
- package/angular/esm/components/dataset-selector-list.d.ts +0 -56
- package/angular/esm/components/dataset-selector-list.js +0 -155
- package/angular/esm/components/dataset-selector-row.d.ts +0 -70
- package/angular/esm/components/dataset-selector-row.js +0 -197
- package/angular/esm/components/display-settings-binning.d.ts +0 -37
- package/angular/esm/components/display-settings-binning.js +0 -91
- package/angular/esm/components/display-settings-datetime.d.ts +0 -40
- package/angular/esm/components/display-settings-datetime.js +0 -99
- package/angular/esm/components/display-settings-grand-totals.d.ts +0 -37
- package/angular/esm/components/display-settings-grand-totals.js +0 -91
- package/angular/esm/components/display-settings-numeric.d.ts +0 -45
- package/angular/esm/components/display-settings-numeric.js +0 -115
- package/angular/esm/components/display-settings-period-over-period.d.ts +0 -44
- package/angular/esm/components/display-settings-period-over-period.js +0 -107
- package/angular/esm/components/display-settings.d.ts +0 -83
- package/angular/esm/components/display-settings.js +0 -231
- package/angular/esm/components/filter-expression-picker.d.ts +0 -64
- package/angular/esm/components/filter-expression-picker.js +0 -179
- package/angular/esm/components/filter-item.d.ts +0 -63
- package/angular/esm/components/filter-item.js +0 -187
- package/angular/esm/components/filter-parameter-picker.d.ts +0 -56
- package/angular/esm/components/filter-parameter-picker.js +0 -151
- package/angular/esm/components/filter-value-picker-datetime.d.ts +0 -47
- package/angular/esm/components/filter-value-picker-datetime.js +0 -131
- package/angular/esm/components/filter-value-picker-hierarchy.d.ts +0 -53
- package/angular/esm/components/filter-value-picker-hierarchy.js +0 -155
- package/angular/esm/components/filter-value-picker-numeric.d.ts +0 -53
- package/angular/esm/components/filter-value-picker-numeric.js +0 -155
- package/angular/esm/components/filter-value-picker.d.ts +0 -57
- package/angular/esm/components/filter-value-picker.js +0 -171
- package/angular/esm/components/filters.d.ts +0 -75
- package/angular/esm/components/filters.js +0 -215
- package/angular/esm/components/formula-editor.d.ts +0 -78
- package/angular/esm/components/formula-editor.js +0 -236
- package/angular/esm/components/formula-field.d.ts +0 -70
- package/angular/esm/components/formula-field.js +0 -209
- package/angular/esm/components/formula.d.ts +0 -60
- package/angular/esm/components/formula.js +0 -177
- package/angular/esm/components/interactive-viz-item.d.ts +0 -63
- package/angular/esm/components/interactive-viz-item.js +0 -188
- package/angular/esm/components/item-grid-item-actions-menu.d.ts +0 -45
- package/angular/esm/components/item-grid-item-actions-menu.js +0 -115
- package/angular/esm/components/item-grid.d.ts +0 -80
- package/angular/esm/components/item-grid.js +0 -245
- package/angular/esm/components/item-option-action-button-group.d.ts +0 -41
- package/angular/esm/components/item-option-action-button-group.js +0 -107
- package/angular/esm/components/item-option-color-palette-picker.d.ts +0 -48
- package/angular/esm/components/item-option-color-palette-picker.js +0 -131
- package/angular/esm/components/item-option-color-picker.d.ts +0 -51
- package/angular/esm/components/item-option-color-picker.js +0 -139
- package/angular/esm/components/item-option-color-range.d.ts +0 -66
- package/angular/esm/components/item-option-color-range.js +0 -179
- package/angular/esm/components/item-option-guidelines.d.ts +0 -34
- package/angular/esm/components/item-option-guidelines.js +0 -83
- package/angular/esm/components/item-option-multi-language-field.d.ts +0 -50
- package/angular/esm/components/item-option-multi-language-field.js +0 -139
- package/angular/esm/components/item-option-number-field.d.ts +0 -58
- package/angular/esm/components/item-option-number-field.js +0 -171
- package/angular/esm/components/item-option-panel.d.ts +0 -54
- package/angular/esm/components/item-option-panel.js +0 -155
- package/angular/esm/components/item-option-picker.d.ts +0 -46
- package/angular/esm/components/item-option-picker.js +0 -123
- package/angular/esm/components/item-option-position-picker.d.ts +0 -39
- package/angular/esm/components/item-option-position-picker.js +0 -99
- package/angular/esm/components/item-option-positions-number-field.d.ts +0 -54
- package/angular/esm/components/item-option-positions-number-field.js +0 -147
- package/angular/esm/components/item-option-radio-button-group.d.ts +0 -45
- package/angular/esm/components/item-option-radio-button-group.js +0 -123
- package/angular/esm/components/item-option-slider.d.ts +0 -46
- package/angular/esm/components/item-option-slider.js +0 -131
- package/angular/esm/components/item-option-switch.d.ts +0 -40
- package/angular/esm/components/item-option-switch.js +0 -99
- package/angular/esm/components/item-option-text-field.d.ts +0 -44
- package/angular/esm/components/item-option-text-field.js +0 -115
- package/angular/esm/components/item-option.d.ts +0 -58
- package/angular/esm/components/item-option.js +0 -171
- package/angular/esm/components/item-slot-drop-panel.d.ts +0 -82
- package/angular/esm/components/item-slot-drop-panel.js +0 -249
- package/angular/esm/components/item-slot-drop.d.ts +0 -77
- package/angular/esm/components/item-slot-drop.js +0 -227
- package/angular/esm/components/item-slot-picker-panel.d.ts +0 -97
- package/angular/esm/components/item-slot-picker-panel.js +0 -309
- package/angular/esm/components/item-slot-picker.d.ts +0 -86
- package/angular/esm/components/item-slot-picker.js +0 -259
- package/angular/esm/components/slot-menu-list.d.ts +0 -46
- package/angular/esm/components/slot-menu-list.js +0 -123
- package/angular/esm/components/slot-menu.d.ts +0 -104
- package/angular/esm/components/slot-menu.js +0 -300
- package/angular/esm/components/viz-item-menu.d.ts +0 -42
- package/angular/esm/components/viz-item-menu.js +0 -111
- package/angular/esm/index.d.ts +0 -109
- package/angular/esm/index.js +0 -217
- package/angular/index.ts +0 -223
- package/angular/package.json +0 -40
- package/angular/tsconfig.json +0 -36
- package/angular/type-fallbacks.d.ts +0 -0
- package/angular/utils/ai-prompt/attachments.d.ts +0 -10
- package/angular/utils/ai-prompt/dictation.d.ts +0 -50
- package/angular/utils/ai-prompt/image-upload.d.ts +0 -12
- package/angular/utils/ai-prompt/index.d.ts +0 -6
- package/angular/utils/ai-prompt/tests/attachments.test.d.ts +0 -1
- package/angular/utils/ai-prompt/tests/dictation.test.d.ts +0 -1
- package/angular/utils/ai-prompt/tests/image-upload.test.d.ts +0 -1
- package/angular/utils/base/base.d.ts +0 -16
- package/angular/utils/base/focus-visible.d.ts +0 -29
- package/angular/utils/base/focusable.d.ts +0 -58
- package/angular/utils/base/index.d.ts +0 -5
- package/angular/utils/base/localized-mixin.d.ts +0 -22
- package/angular/utils/base/sized-mixin.d.ts +0 -17
- package/angular/utils/color/color-palettes.d.ts +0 -17
- package/angular/utils/color/extrapolate-color.d.ts +0 -1
- package/angular/utils/data/load-data-fields-for-datasets.d.ts +0 -22
- package/angular/utils/data-broker/index.d.ts +0 -263
- package/angular/utils/data-field-types/calculate-data-field-icon.d.ts +0 -12
- package/angular/utils/data-field-types/default-acceptable-data-field-types.d.ts +0 -1
- package/angular/utils/data-field-types/tests/calculate-data-field-icon.test.d.ts +0 -1
- package/angular/utils/drag/draggable.d.ts +0 -13
- package/angular/utils/drag/pragmatic-element-adapter.d.ts +0 -2
- package/angular/utils/drag/tests/pragmatic-element-adapter.first-import.test.d.ts +0 -1
- package/angular/utils/drag/tests/pragmatic-element-adapter.test.d.ts +0 -1
- package/angular/utils/filters/expressions.d.ts +0 -15
- package/angular/utils/filters/index.d.ts +0 -1
- package/angular/utils/formatter/calculate-duration.d.ts +0 -2
- package/angular/utils/formatter/decompose-numeric-format.d.ts +0 -11
- package/angular/utils/formatter/default-local-formats.d.ts +0 -20
- package/angular/utils/formatter/formats/cs.d.ts +0 -20
- package/angular/utils/formatter/formats/da.d.ts +0 -20
- package/angular/utils/formatter/formats/de.d.ts +0 -21
- package/angular/utils/formatter/formats/en-GB.d.ts +0 -21
- package/angular/utils/formatter/formats/en-US.d.ts +0 -1
- package/angular/utils/formatter/formats/en.d.ts +0 -1
- package/angular/utils/formatter/formats/es.d.ts +0 -54
- package/angular/utils/formatter/formats/fi.d.ts +0 -20
- package/angular/utils/formatter/formats/fr.d.ts +0 -54
- package/angular/utils/formatter/formats/he.d.ts +0 -20
- package/angular/utils/formatter/formats/hu.d.ts +0 -20
- package/angular/utils/formatter/formats/it.d.ts +0 -54
- package/angular/utils/formatter/formats/ja.d.ts +0 -20
- package/angular/utils/formatter/formats/ko.d.ts +0 -20
- package/angular/utils/formatter/formats/mk.d.ts +0 -20
- package/angular/utils/formatter/formats/nl.d.ts +0 -21
- package/angular/utils/formatter/formats/no.d.ts +0 -21
- package/angular/utils/formatter/formats/pl.d.ts +0 -20
- package/angular/utils/formatter/formats/pt.d.ts +0 -20
- package/angular/utils/formatter/formats/ru.d.ts +0 -20
- package/angular/utils/formatter/formats/sv.d.ts +0 -20
- package/angular/utils/formatter/formats/tr.d.ts +0 -21
- package/angular/utils/formatter/formats/zh-CN.d.ts +0 -20
- package/angular/utils/formatter/formats/zh-TW.d.ts +0 -20
- package/angular/utils/formatter/formatter.d.ts +0 -9
- package/angular/utils/formatter/get-dataset-name.d.ts +0 -2
- package/angular/utils/formatter/get-localized-name.d.ts +0 -4
- package/angular/utils/formatter/localize.d.ts +0 -3
- package/angular/utils/formatter/smart-datetime-formats.const.d.ts +0 -36
- package/angular/utils/formatter/tests/calculate-duration.test.d.ts +0 -1
- package/angular/utils/formatter/tests/decompose-numeric-format.test.d.ts +0 -1
- package/angular/utils/formatter/tests/default-local-formats.test.d.ts +0 -1
- package/angular/utils/formatter/tests/formatter.test.d.ts +0 -1
- package/angular/utils/formatter/tests/get-localized-name.test.d.ts +0 -1
- package/angular/utils/formatter/tests/localize.test.d.ts +0 -1
- package/angular/utils/formula/base/formula-base.d.ts +0 -117
- package/angular/utils/formula/base/formula-input-base.d.ts +0 -62
- package/angular/utils/formula/codemirror/actions.d.ts +0 -47
- package/angular/utils/formula/codemirror/drop-cursor.d.ts +0 -15
- package/angular/utils/formula/codemirror/icon-element.d.ts +0 -7
- package/angular/utils/formula/codemirror/parser.d.ts +0 -16
- package/angular/utils/formula/codemirror/tests/actions.test.d.ts +0 -1
- package/angular/utils/formula/codemirror/theme.d.ts +0 -20
- package/angular/utils/formula/codemirror/widget.d.ts +0 -18
- package/angular/utils/formula/config/aggregations.d.ts +0 -9
- package/angular/utils/formula/config/build-datasets.d.ts +0 -10
- package/angular/utils/formula/config/expression-helpers.d.ts +0 -42
- package/angular/utils/formula/config/functions.d.ts +0 -3
- package/angular/utils/formula/config/groupings.d.ts +0 -9
- package/angular/utils/formula/config/regex.d.ts +0 -39
- package/angular/utils/formula/config/resolve-column-presentation.d.ts +0 -19
- package/angular/utils/formula/config/tests/build-datasets.test.d.ts +0 -1
- package/angular/utils/formula/config/validate-expression.d.ts +0 -19
- package/angular/utils/formula/load-formula-codemirror.d.ts +0 -4
- package/angular/utils/formula/render-explanation-tooltip.d.ts +0 -7
- package/angular/utils/formula/store/formula-display-store.d.ts +0 -93
- package/angular/utils/formula/store/formula-editor-context.d.ts +0 -8
- package/angular/utils/formula/store/formula-editor-store.d.ts +0 -46
- package/angular/utils/formula/store/tests/formula-editor-store.test.d.ts +0 -1
- package/angular/utils/formula/tests/validate-expression.test.d.ts +0 -1
- package/angular/utils/get-css-variable.d.ts +0 -1
- package/angular/utils/index.d.ts +0 -10
- package/angular/utils/localize/set-locale.d.ts +0 -7
- package/angular/utils/map-tile-providers/index.d.ts +0 -93
- package/angular/utils/set-nested-value.d.ts +0 -6
- package/angular/utils/slot-content/ad-hoc-slot-content.d.ts +0 -7
- package/angular/utils/slot-content/render-calculation-label.d.ts +0 -7
- package/angular/utils/slot-content/tests/ad-hoc-slot-content.test.d.ts +0 -1
- package/angular/utils/slot-state/slot-context.d.ts +0 -4
- package/angular/utils/slot-state/slot-store.d.ts +0 -39
- package/angular/utils/store/base-store.d.ts +0 -158
- package/angular/utils/store/dashboard-store.d.ts +0 -49
- package/angular/utils/store/index.d.ts +0 -135
- package/angular/utils/store/item-store.d.ts +0 -33
- package/angular/utils/store/store-registry.d.ts +0 -170
- package/angular/utils/store/tests/dashboard-store.test.d.ts +0 -1
- package/angular/utils/store/tests/item-store.test.d.ts +0 -1
- package/angular/utils/store/tests/store-registry.test.d.ts +0 -1
- package/angular/utils/store/types.d.ts +0 -270
- package/angular/utils/switch-item/index.d.ts +0 -34
- package/angular/utils/switch-item/slot-role-classification.d.ts +0 -31
- package/angular/utils/switch-item/stories/switch-item.stories.d.ts +0 -17
- package/angular/utils/switch-item/tests/slot-role-classification.test.d.ts +0 -1
- package/angular/utils/switch-item/tests/switch-item.test.d.ts +0 -1
- package/angular/utils/tests/set-nested-value.test.d.ts +0 -1
- package/angular/utils/themes/bliss.d.ts +0 -2
- package/angular/utils/themes/classic-dark.d.ts +0 -2
- package/angular/utils/themes/classic.d.ts +0 -2
- package/angular/utils/themes/default-dark.d.ts +0 -2
- package/angular/utils/themes/default.d.ts +0 -2
- package/angular/utils/themes/index.d.ts +0 -4
- package/angular/utils/themes/orion.d.ts +0 -2
- package/angular/utils/themes/pinky.d.ts +0 -2
- package/angular/utils/themes/radiant.d.ts +0 -2
- package/angular/utils/themes/royale.d.ts +0 -2
- package/angular/utils/themes/seasonal.d.ts +0 -2
- package/angular/utils/themes/urban.d.ts +0 -2
- package/angular/utils/themes/vivid.d.ts +0 -2
- package/angular/utils/time/formats.const.d.ts +0 -4
- package/angular/utils/time/period-over-period-condition.const.d.ts +0 -8
- package/angular/utils/time/periods.const.d.ts +0 -15
- package/angular/utils/timezone/datetime-timezone.d.ts +0 -25
- package/angular/utils/timezone/tests/datetime-timezone.test.d.ts +0 -1
- package/angular/utils/transformations/convert-data-field-to-slot-content.d.ts +0 -9
- package/angular/utils/transformations/convert-datasets-to-data-fields.d.ts +0 -30
- package/angular/utils/transformations/tests/convert-data-field-to-slot-content.test.d.ts +0 -1
- package/angular/utils/transformations/tests/convert-datasets-to-data-fields.test.d.ts +0 -1
- package/angular/utils/types/tests/type-check.test.d.ts +0 -1
- package/angular/utils/types/type-check.d.ts +0 -28
|
@@ -1,242 +0,0 @@
|
|
|
1
|
-
import { booleanAttribute, ChangeDetectionStrategy, Component, DestroyRef, ElementRef, inject, Input, OnChanges, output, Renderer2, SimpleChanges } from '@angular/core';
|
|
2
|
-
import '@luzmo/analytics-components-kit/item-grid';
|
|
3
|
-
import type { LuzmoItemGrid as LuzmoItemGridHostElement, ClonedItemPositioning, GridItemActionEventDetail, GridItemData, GridItemRenderer, GridItemStatesChangedEventDetail, GridLifecycleEventDetail, InputActionGroup, ItemStates } from '@luzmo/analytics-components-kit/item-grid';
|
|
4
|
-
export type { Action, ActionGroup, AddGridItemInput, ClonedItemPositioning, DefaultActionType, GridItemActionEventDetail, GridItemData, GridItemPatch, GridItemPosition, GridItemPositionPatch, GridItemRenderer, GridItemSizePatch, GridItemStatesChangedEventDetail, GridLifecycleEventDetail, InputActionGroup, ItemStates } from '@luzmo/analytics-components-kit/item-grid';
|
|
5
|
-
import type { ThemeConfig } from '@luzmo/dashboard-contents-types';
|
|
6
|
-
import type { Placement } from '@luzmo/lucero';
|
|
7
|
-
|
|
8
|
-
@Component({
|
|
9
|
-
selector: 'luzmo-item-grid',
|
|
10
|
-
exportAs: 'luzmoItemGrid',
|
|
11
|
-
standalone: true,
|
|
12
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
13
|
-
template: '<ng-content />'
|
|
14
|
-
})
|
|
15
|
-
/**
|
|
16
|
-
* Angular wrapper component for <luzmo-item-grid>
|
|
17
|
-
*/
|
|
18
|
-
export class LuzmoItemGrid implements OnChanges {
|
|
19
|
-
private readonly elementRef = inject<ElementRef<LuzmoItemGridHostElement>>(ElementRef);
|
|
20
|
-
private readonly renderer = inject<Renderer2>(Renderer2);
|
|
21
|
-
private readonly destroyRef = inject<DestroyRef>(DestroyRef);
|
|
22
|
-
private readonly host = this.elementRef.nativeElement;
|
|
23
|
-
private readonly listenerCleanup: Array<() => void> = [];
|
|
24
|
-
|
|
25
|
-
/** The underlying custom element instance. Use to call imperative methods. */
|
|
26
|
-
get nativeElement(): LuzmoItemGridHostElement {
|
|
27
|
-
return this.host;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/** The URL of the app server */
|
|
31
|
-
@Input({ alias: 'appServer' })
|
|
32
|
-
appServer?: string;
|
|
33
|
-
|
|
34
|
-
/** The API Host of the databroker */
|
|
35
|
-
@Input({ alias: 'apiHost' })
|
|
36
|
-
apiHost?: string;
|
|
37
|
-
|
|
38
|
-
/** The auth key of the databroker */
|
|
39
|
-
@Input({ alias: 'authKey' })
|
|
40
|
-
authKey?: string;
|
|
41
|
-
|
|
42
|
-
/** The auth token of the databroker */
|
|
43
|
-
@Input({ alias: 'authToken' })
|
|
44
|
-
authToken?: string;
|
|
45
|
-
|
|
46
|
-
/** The cache time of the databroker */
|
|
47
|
-
@Input({ alias: 'cacheTime' })
|
|
48
|
-
cacheTime?: number;
|
|
49
|
-
|
|
50
|
-
/** The language of the settings interface */
|
|
51
|
-
@Input({ alias: 'language' })
|
|
52
|
-
language?: string;
|
|
53
|
-
|
|
54
|
-
/** The language to use for locale-aware formatting and labels */
|
|
55
|
-
@Input({ alias: 'contentLanguage' })
|
|
56
|
-
contentLanguage?: string;
|
|
57
|
-
|
|
58
|
-
/** The number of columns in the grid. */
|
|
59
|
-
@Input({ alias: 'columns' })
|
|
60
|
-
columns?: number;
|
|
61
|
-
|
|
62
|
-
/** The height of each row in pixels in the grid. */
|
|
63
|
-
@Input({ alias: 'rowHeight' })
|
|
64
|
-
rowHeight?: number;
|
|
65
|
-
|
|
66
|
-
/** Whether the grid is in view mode. When true, dragging, resizing and action buttons are disabled. */
|
|
67
|
-
@Input({ alias: 'viewMode', transform: booleanAttribute })
|
|
68
|
-
viewMode?: boolean;
|
|
69
|
-
|
|
70
|
-
/** When true (default), the item actions menu uses the Document Popover API (`popover="manual"`), which paints in the top layer. Set to false when embedding the grid next to another UI that also uses a document popover (e.g. an analyst side pane) so the actions menu stays in normal stacking with `position: fixed` + Floating UI instead. */
|
|
71
|
-
@Input({ alias: 'itemActionsDocumentPopover', transform: booleanAttribute })
|
|
72
|
-
itemActionsDocumentPopover?: boolean;
|
|
73
|
-
|
|
74
|
-
/** The placement of the item actions menu. */
|
|
75
|
-
@Input({ alias: 'placementItemActionsMenu' })
|
|
76
|
-
placementItemActionsMenu?: Placement;
|
|
77
|
-
|
|
78
|
-
/** The default item actions menu. */
|
|
79
|
-
@Input({ alias: 'defaultItemActionsMenu' })
|
|
80
|
-
defaultItemActionsMenu?: InputActionGroup[];
|
|
81
|
-
|
|
82
|
-
/** Where to position a cloned item in the grid. - `'below-item'` (default): places the clone directly below the original item, shifting other items down. - `'auto-position'`: lets the grid engine find the first available space (row-major scan, then compact upward). */
|
|
83
|
-
@Input({ alias: 'clonedItemPositioning' })
|
|
84
|
-
clonedItemPositioning?: ClonedItemPositioning;
|
|
85
|
-
|
|
86
|
-
/** Grid options configuration */
|
|
87
|
-
@Input({ alias: 'theme' })
|
|
88
|
-
theme?: ThemeConfig;
|
|
89
|
-
|
|
90
|
-
/** Items to add to the grid. The array is cloned on set so the component never mutates the caller's data. */
|
|
91
|
-
@Input({ alias: 'items' })
|
|
92
|
-
items?: GridItemData[];
|
|
93
|
-
|
|
94
|
-
/** Seed value for uncontrolled items mode. The component manages item changes internally from this starting point. Ignored when `items` is set. */
|
|
95
|
-
@Input({ alias: 'initialItems' })
|
|
96
|
-
initialItems?: GridItemData[];
|
|
97
|
-
|
|
98
|
-
/** Custom renderers for different item types */
|
|
99
|
-
@Input({ alias: 'renderers' })
|
|
100
|
-
renderers?: Record<string, GridItemRenderer>;
|
|
101
|
-
|
|
102
|
-
/** Controlled item states. When set, the component becomes controlled: it only reflects what the parent provides and does not update internal state on user interaction. */
|
|
103
|
-
@Input({ alias: 'itemStates' })
|
|
104
|
-
itemStates?: ItemStates;
|
|
105
|
-
|
|
106
|
-
/** Seed value for uncontrolled mode. The component manages state internally from this starting point. Ignored if `itemStates` is set. Only one item with one active action is supported. If multiple items or actions are provided, a warning is emitted and only the first item with its first action is applied. Use controlled mode (`itemStates`) for multiple simultaneous active items. */
|
|
107
|
-
@Input({ alias: 'initialItemStates' })
|
|
108
|
-
initialItemStates?: ItemStates;
|
|
109
|
-
|
|
110
|
-
/** Fired when an item action is performed */
|
|
111
|
-
readonly luzmoItemGridItemAction = output<CustomEvent<GridItemActionEventDetail>>({ alias: 'luzmoItemGridItemAction' });
|
|
112
|
-
|
|
113
|
-
/** Fired when the grid layout is changed */
|
|
114
|
-
readonly luzmoItemGridLayoutChanged = output<CustomEvent<GridLifecycleEventDetail>>({ alias: 'luzmoItemGridLayoutChanged' });
|
|
115
|
-
|
|
116
|
-
/** Fired when the grid is ready */
|
|
117
|
-
readonly luzmoItemGridReady = output<CustomEvent<GridLifecycleEventDetail>>({ alias: 'luzmoItemGridReady' });
|
|
118
|
-
|
|
119
|
-
/** Fired when item states change (controlled and uncontrolled mode) */
|
|
120
|
-
readonly luzmoItemGridItemStatesChanged = output<CustomEvent<GridItemStatesChangedEventDetail>>({ alias: 'luzmoItemGridItemStatesChanged' });
|
|
121
|
-
|
|
122
|
-
constructor() {
|
|
123
|
-
this.bindEvents();
|
|
124
|
-
this.destroyRef.onDestroy(() => {
|
|
125
|
-
for (const cleanup of this.listenerCleanup) {
|
|
126
|
-
cleanup();
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
ngOnChanges(changes: SimpleChanges): void {
|
|
132
|
-
for (const key of Object.keys(changes)) {
|
|
133
|
-
switch (key) {
|
|
134
|
-
case 'appServer':
|
|
135
|
-
this.setHostProperty('appServer', changes['appServer'].currentValue);
|
|
136
|
-
break;
|
|
137
|
-
case 'apiHost':
|
|
138
|
-
this.setHostProperty('apiHost', changes['apiHost'].currentValue);
|
|
139
|
-
break;
|
|
140
|
-
case 'authKey':
|
|
141
|
-
this.setHostProperty('authKey', changes['authKey'].currentValue);
|
|
142
|
-
break;
|
|
143
|
-
case 'authToken':
|
|
144
|
-
this.setHostProperty('authToken', changes['authToken'].currentValue);
|
|
145
|
-
break;
|
|
146
|
-
case 'cacheTime':
|
|
147
|
-
this.setHostProperty('cacheTime', changes['cacheTime'].currentValue);
|
|
148
|
-
break;
|
|
149
|
-
case 'language':
|
|
150
|
-
this.setHostProperty('language', changes['language'].currentValue);
|
|
151
|
-
break;
|
|
152
|
-
case 'contentLanguage':
|
|
153
|
-
this.setHostProperty('contentLanguage', changes['contentLanguage'].currentValue);
|
|
154
|
-
break;
|
|
155
|
-
case 'columns':
|
|
156
|
-
this.setHostProperty('columns', changes['columns'].currentValue);
|
|
157
|
-
break;
|
|
158
|
-
case 'rowHeight':
|
|
159
|
-
this.setHostProperty('rowHeight', changes['rowHeight'].currentValue);
|
|
160
|
-
break;
|
|
161
|
-
case 'viewMode':
|
|
162
|
-
this.setHostProperty('viewMode', changes['viewMode'].currentValue);
|
|
163
|
-
break;
|
|
164
|
-
case 'itemActionsDocumentPopover':
|
|
165
|
-
this.setHostProperty('itemActionsDocumentPopover', changes['itemActionsDocumentPopover'].currentValue);
|
|
166
|
-
break;
|
|
167
|
-
case 'placementItemActionsMenu':
|
|
168
|
-
this.setHostProperty('placementItemActionsMenu', changes['placementItemActionsMenu'].currentValue);
|
|
169
|
-
break;
|
|
170
|
-
case 'defaultItemActionsMenu':
|
|
171
|
-
this.setHostProperty('defaultItemActionsMenu', changes['defaultItemActionsMenu'].currentValue);
|
|
172
|
-
break;
|
|
173
|
-
case 'clonedItemPositioning':
|
|
174
|
-
this.setHostProperty('clonedItemPositioning', changes['clonedItemPositioning'].currentValue);
|
|
175
|
-
break;
|
|
176
|
-
case 'theme':
|
|
177
|
-
this.setHostProperty('theme', changes['theme'].currentValue);
|
|
178
|
-
break;
|
|
179
|
-
case 'items':
|
|
180
|
-
this.setHostProperty('items', changes['items'].currentValue);
|
|
181
|
-
break;
|
|
182
|
-
case 'initialItems':
|
|
183
|
-
this.setHostProperty('initialItems', changes['initialItems'].currentValue);
|
|
184
|
-
break;
|
|
185
|
-
case 'renderers':
|
|
186
|
-
this.setHostProperty('renderers', changes['renderers'].currentValue);
|
|
187
|
-
break;
|
|
188
|
-
case 'itemStates':
|
|
189
|
-
this.setHostProperty('itemStates', changes['itemStates'].currentValue);
|
|
190
|
-
break;
|
|
191
|
-
case 'initialItemStates':
|
|
192
|
-
this.setHostProperty('initialItemStates', changes['initialItemStates'].currentValue);
|
|
193
|
-
break;
|
|
194
|
-
default:
|
|
195
|
-
break;
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
/**
|
|
201
|
-
* Forward a wrapper @Input to the underlying host element via Renderer2 so
|
|
202
|
-
* the wrapper stays compatible with non-DOM Angular platforms (SSR, tests).
|
|
203
|
-
* Unlike a "skip undefined" guard, this lets consumers reset values back to
|
|
204
|
-
* undefined / null by clearing their bindings.
|
|
205
|
-
*/
|
|
206
|
-
private setHostProperty(key: string, value: unknown): void {
|
|
207
|
-
this.renderer.setProperty(this.host, key, value);
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
private bindEvents(): void {
|
|
211
|
-
this.listenerCleanup.push(
|
|
212
|
-
this.renderer.listen(this.host, 'luzmo-item-grid-item-action', (event: Event) => {
|
|
213
|
-
const typed = event as CustomEvent<GridItemActionEventDetail>;
|
|
214
|
-
this.luzmoItemGridItemAction.emit(typed);
|
|
215
|
-
})
|
|
216
|
-
);
|
|
217
|
-
|
|
218
|
-
this.listenerCleanup.push(
|
|
219
|
-
this.renderer.listen(this.host, 'luzmo-item-grid-layout-changed', (event: Event) => {
|
|
220
|
-
const typed = event as CustomEvent<GridLifecycleEventDetail>;
|
|
221
|
-
this.luzmoItemGridLayoutChanged.emit(typed);
|
|
222
|
-
})
|
|
223
|
-
);
|
|
224
|
-
|
|
225
|
-
this.listenerCleanup.push(
|
|
226
|
-
this.renderer.listen(this.host, 'luzmo-item-grid-ready', (event: Event) => {
|
|
227
|
-
const typed = event as CustomEvent<GridLifecycleEventDetail>;
|
|
228
|
-
this.luzmoItemGridReady.emit(typed);
|
|
229
|
-
})
|
|
230
|
-
);
|
|
231
|
-
|
|
232
|
-
this.listenerCleanup.push(
|
|
233
|
-
this.renderer.listen(this.host, 'luzmo-item-grid-item-states-changed', (event: Event) => {
|
|
234
|
-
const typed = event as CustomEvent<GridItemStatesChangedEventDetail>;
|
|
235
|
-
this.luzmoItemGridItemStatesChanged.emit(typed);
|
|
236
|
-
})
|
|
237
|
-
);
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
/** The underlying custom element type for LuzmoItemGrid */
|
|
242
|
-
export type LuzmoItemGridElement = LuzmoItemGridHostElement;
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { booleanAttribute, ChangeDetectionStrategy, Component, DestroyRef, ElementRef, inject, Input, OnChanges, output, Renderer2, SimpleChanges } from '@angular/core';
|
|
2
|
-
import '@luzmo/analytics-components-kit/item-option-action-button-group';
|
|
3
|
-
import type { LuzmoItemOptionActionButtonGroup as LuzmoItemOptionActionButtonGroupHostElement, ItemOptionChangedEventDetail } from '@luzmo/analytics-components-kit/item-option-action-button-group';
|
|
4
|
-
export type { ItemOptionChangedEventDetail } from '@luzmo/analytics-components-kit/item-option-action-button-group';
|
|
5
|
-
|
|
6
|
-
@Component({
|
|
7
|
-
selector: 'luzmo-item-option-action-button-group',
|
|
8
|
-
exportAs: 'luzmoItemOptionActionButtonGroup',
|
|
9
|
-
standalone: true,
|
|
10
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
11
|
-
template: '<ng-content />'
|
|
12
|
-
})
|
|
13
|
-
/**
|
|
14
|
-
* Angular wrapper component for <luzmo-item-option-action-button-group>
|
|
15
|
-
*/
|
|
16
|
-
export class LuzmoItemOptionActionButtonGroup implements OnChanges {
|
|
17
|
-
private readonly elementRef = inject<ElementRef<LuzmoItemOptionActionButtonGroupHostElement>>(ElementRef);
|
|
18
|
-
private readonly renderer = inject<Renderer2>(Renderer2);
|
|
19
|
-
private readonly destroyRef = inject<DestroyRef>(DestroyRef);
|
|
20
|
-
private readonly host = this.elementRef.nativeElement;
|
|
21
|
-
private readonly listenerCleanup: Array<() => void> = [];
|
|
22
|
-
|
|
23
|
-
/** The underlying custom element instance. Use to call imperative methods. */
|
|
24
|
-
get nativeElement(): LuzmoItemOptionActionButtonGroupHostElement {
|
|
25
|
-
return this.host;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/** The available buttons to choose from (key → button content). */
|
|
29
|
-
@Input({ alias: 'values' })
|
|
30
|
-
values?: unknown;
|
|
31
|
-
|
|
32
|
-
/** Whether the control is disabled (non-interactive). */
|
|
33
|
-
@Input({ alias: 'disabled', transform: booleanAttribute })
|
|
34
|
-
disabled?: boolean;
|
|
35
|
-
|
|
36
|
-
/** Selection mode: `single` or `multiple`. */
|
|
37
|
-
@Input({ alias: 'selects' })
|
|
38
|
-
selects?: 'single' | 'multiple';
|
|
39
|
-
|
|
40
|
-
/** The currently selected button key(s). */
|
|
41
|
-
@Input({ alias: 'value' })
|
|
42
|
-
value?: [string];
|
|
43
|
-
|
|
44
|
-
/** The default selection used when no value is set. */
|
|
45
|
-
@Input({ alias: 'default' })
|
|
46
|
-
default?: [string];
|
|
47
|
-
|
|
48
|
-
/** Emitted when the option value changes. */
|
|
49
|
-
readonly luzmoOptionChanged = output<CustomEvent<ItemOptionChangedEventDetail>>({ alias: 'luzmoOptionChanged' });
|
|
50
|
-
|
|
51
|
-
constructor() {
|
|
52
|
-
this.bindEvents();
|
|
53
|
-
this.destroyRef.onDestroy(() => {
|
|
54
|
-
for (const cleanup of this.listenerCleanup) {
|
|
55
|
-
cleanup();
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
ngOnChanges(changes: SimpleChanges): void {
|
|
61
|
-
for (const key of Object.keys(changes)) {
|
|
62
|
-
switch (key) {
|
|
63
|
-
case 'values':
|
|
64
|
-
this.setHostProperty('values', changes['values'].currentValue);
|
|
65
|
-
break;
|
|
66
|
-
case 'disabled':
|
|
67
|
-
this.setHostProperty('disabled', changes['disabled'].currentValue);
|
|
68
|
-
break;
|
|
69
|
-
case 'selects':
|
|
70
|
-
this.setHostProperty('selects', changes['selects'].currentValue);
|
|
71
|
-
break;
|
|
72
|
-
case 'value':
|
|
73
|
-
this.setHostProperty('value', changes['value'].currentValue);
|
|
74
|
-
break;
|
|
75
|
-
case 'default':
|
|
76
|
-
this.setHostProperty('default', changes['default'].currentValue);
|
|
77
|
-
break;
|
|
78
|
-
default:
|
|
79
|
-
break;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Forward a wrapper @Input to the underlying host element via Renderer2 so
|
|
86
|
-
* the wrapper stays compatible with non-DOM Angular platforms (SSR, tests).
|
|
87
|
-
* Unlike a "skip undefined" guard, this lets consumers reset values back to
|
|
88
|
-
* undefined / null by clearing their bindings.
|
|
89
|
-
*/
|
|
90
|
-
private setHostProperty(key: string, value: unknown): void {
|
|
91
|
-
this.renderer.setProperty(this.host, key, value);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
private bindEvents(): void {
|
|
95
|
-
this.listenerCleanup.push(
|
|
96
|
-
this.renderer.listen(this.host, 'luzmo-option-changed', (event: Event) => {
|
|
97
|
-
const typed = event as CustomEvent<ItemOptionChangedEventDetail>;
|
|
98
|
-
this.luzmoOptionChanged.emit(typed);
|
|
99
|
-
})
|
|
100
|
-
);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
/** The underlying custom element type for LuzmoItemOptionActionButtonGroup */
|
|
105
|
-
export type LuzmoItemOptionActionButtonGroupElement = LuzmoItemOptionActionButtonGroupHostElement;
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import { booleanAttribute, ChangeDetectionStrategy, Component, DestroyRef, ElementRef, inject, Input, OnChanges, output, Renderer2, SimpleChanges } from '@angular/core';
|
|
2
|
-
import '@luzmo/analytics-components-kit/item-option-color-palette-picker';
|
|
3
|
-
import type { LuzmoItemOptionColorPalettePicker as LuzmoItemOptionColorPalettePickerHostElement, ItemOptionChangedEventDetail } from '@luzmo/analytics-components-kit/item-option-color-palette-picker';
|
|
4
|
-
export type { ItemOptionChangedEventDetail } from '@luzmo/analytics-components-kit/item-option-color-palette-picker';
|
|
5
|
-
|
|
6
|
-
@Component({
|
|
7
|
-
selector: 'luzmo-item-option-color-palette-picker',
|
|
8
|
-
exportAs: 'luzmoItemOptionColorPalettePicker',
|
|
9
|
-
standalone: true,
|
|
10
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
11
|
-
template: '<ng-content />'
|
|
12
|
-
})
|
|
13
|
-
/**
|
|
14
|
-
* Angular wrapper component for <luzmo-item-option-color-palette-picker>
|
|
15
|
-
*/
|
|
16
|
-
export class LuzmoItemOptionColorPalettePicker implements OnChanges {
|
|
17
|
-
private readonly elementRef = inject<ElementRef<LuzmoItemOptionColorPalettePickerHostElement>>(ElementRef);
|
|
18
|
-
private readonly renderer = inject<Renderer2>(Renderer2);
|
|
19
|
-
private readonly destroyRef = inject<DestroyRef>(DestroyRef);
|
|
20
|
-
private readonly host = this.elementRef.nativeElement;
|
|
21
|
-
private readonly listenerCleanup: Array<() => void> = [];
|
|
22
|
-
|
|
23
|
-
/** The underlying custom element instance. Use to call imperative methods. */
|
|
24
|
-
get nativeElement(): LuzmoItemOptionColorPalettePickerHostElement {
|
|
25
|
-
return this.host;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/** The selected color palette key of the picker */
|
|
29
|
-
@Input({ alias: 'value' })
|
|
30
|
-
value?: string;
|
|
31
|
-
|
|
32
|
-
/** The default color palette key of the picker */
|
|
33
|
-
@Input({ alias: 'default' })
|
|
34
|
-
default?: string;
|
|
35
|
-
|
|
36
|
-
/** The color palette keys of the picker */
|
|
37
|
-
@Input({ alias: 'values' })
|
|
38
|
-
values?: string[];
|
|
39
|
-
|
|
40
|
-
/** Whether the picker is disabled */
|
|
41
|
-
@Input({ alias: 'disabled', transform: booleanAttribute })
|
|
42
|
-
disabled?: boolean;
|
|
43
|
-
|
|
44
|
-
/** Whether the picker is horizontal */
|
|
45
|
-
@Input({ alias: 'horizontal', transform: booleanAttribute })
|
|
46
|
-
horizontal?: boolean;
|
|
47
|
-
|
|
48
|
-
/** The function to parse the value */
|
|
49
|
-
@Input({ alias: 'parseValue' })
|
|
50
|
-
parseValue?: unknown;
|
|
51
|
-
|
|
52
|
-
/** The function to convert the value to a string */
|
|
53
|
-
@Input({ alias: 'toValue' })
|
|
54
|
-
toValue?: unknown;
|
|
55
|
-
|
|
56
|
-
/** The number of colors to display */
|
|
57
|
-
@Input({ alias: 'numberOfColors' })
|
|
58
|
-
numberOfColors?: number;
|
|
59
|
-
|
|
60
|
-
/** Emitted when the option value changes. */
|
|
61
|
-
readonly luzmoOptionChanged = output<CustomEvent<ItemOptionChangedEventDetail>>({ alias: 'luzmoOptionChanged' });
|
|
62
|
-
|
|
63
|
-
constructor() {
|
|
64
|
-
this.bindEvents();
|
|
65
|
-
this.destroyRef.onDestroy(() => {
|
|
66
|
-
for (const cleanup of this.listenerCleanup) {
|
|
67
|
-
cleanup();
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
ngOnChanges(changes: SimpleChanges): void {
|
|
73
|
-
for (const key of Object.keys(changes)) {
|
|
74
|
-
switch (key) {
|
|
75
|
-
case 'value':
|
|
76
|
-
this.setHostProperty('value', changes['value'].currentValue);
|
|
77
|
-
break;
|
|
78
|
-
case 'default':
|
|
79
|
-
this.setHostProperty('default', changes['default'].currentValue);
|
|
80
|
-
break;
|
|
81
|
-
case 'values':
|
|
82
|
-
this.setHostProperty('values', changes['values'].currentValue);
|
|
83
|
-
break;
|
|
84
|
-
case 'disabled':
|
|
85
|
-
this.setHostProperty('disabled', changes['disabled'].currentValue);
|
|
86
|
-
break;
|
|
87
|
-
case 'horizontal':
|
|
88
|
-
this.setHostProperty('horizontal', changes['horizontal'].currentValue);
|
|
89
|
-
break;
|
|
90
|
-
case 'parseValue':
|
|
91
|
-
this.setHostProperty('parseValue', changes['parseValue'].currentValue);
|
|
92
|
-
break;
|
|
93
|
-
case 'toValue':
|
|
94
|
-
this.setHostProperty('toValue', changes['toValue'].currentValue);
|
|
95
|
-
break;
|
|
96
|
-
case 'numberOfColors':
|
|
97
|
-
this.setHostProperty('numberOfColors', changes['numberOfColors'].currentValue);
|
|
98
|
-
break;
|
|
99
|
-
default:
|
|
100
|
-
break;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Forward a wrapper @Input to the underlying host element via Renderer2 so
|
|
107
|
-
* the wrapper stays compatible with non-DOM Angular platforms (SSR, tests).
|
|
108
|
-
* Unlike a "skip undefined" guard, this lets consumers reset values back to
|
|
109
|
-
* undefined / null by clearing their bindings.
|
|
110
|
-
*/
|
|
111
|
-
private setHostProperty(key: string, value: unknown): void {
|
|
112
|
-
this.renderer.setProperty(this.host, key, value);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
private bindEvents(): void {
|
|
116
|
-
this.listenerCleanup.push(
|
|
117
|
-
this.renderer.listen(this.host, 'luzmo-option-changed', (event: Event) => {
|
|
118
|
-
const typed = event as CustomEvent<ItemOptionChangedEventDetail>;
|
|
119
|
-
this.luzmoOptionChanged.emit(typed);
|
|
120
|
-
})
|
|
121
|
-
);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
/** The underlying custom element type for LuzmoItemOptionColorPalettePicker */
|
|
126
|
-
export type LuzmoItemOptionColorPalettePickerElement = LuzmoItemOptionColorPalettePickerHostElement;
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import { booleanAttribute, ChangeDetectionStrategy, Component, DestroyRef, ElementRef, inject, Input, OnChanges, output, Renderer2, SimpleChanges } from '@angular/core';
|
|
2
|
-
import '@luzmo/analytics-components-kit/item-option-color-picker';
|
|
3
|
-
import type { LuzmoItemOptionColorPicker as LuzmoItemOptionColorPickerHostElement, ItemOptionChangedEventDetail } from '@luzmo/analytics-components-kit/item-option-color-picker';
|
|
4
|
-
export type { ItemOptionChangedEventDetail } from '@luzmo/analytics-components-kit/item-option-color-picker';
|
|
5
|
-
import type { Placement } from '@luzmo/lucero';
|
|
6
|
-
|
|
7
|
-
@Component({
|
|
8
|
-
selector: 'luzmo-item-option-color-picker',
|
|
9
|
-
exportAs: 'luzmoItemOptionColorPicker',
|
|
10
|
-
standalone: true,
|
|
11
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
12
|
-
template: '<ng-content />'
|
|
13
|
-
})
|
|
14
|
-
/**
|
|
15
|
-
* Angular wrapper component for <luzmo-item-option-color-picker>
|
|
16
|
-
*/
|
|
17
|
-
export class LuzmoItemOptionColorPicker implements OnChanges {
|
|
18
|
-
private readonly elementRef = inject<ElementRef<LuzmoItemOptionColorPickerHostElement>>(ElementRef);
|
|
19
|
-
private readonly renderer = inject<Renderer2>(Renderer2);
|
|
20
|
-
private readonly destroyRef = inject<DestroyRef>(DestroyRef);
|
|
21
|
-
private readonly host = this.elementRef.nativeElement;
|
|
22
|
-
private readonly listenerCleanup: Array<() => void> = [];
|
|
23
|
-
|
|
24
|
-
/** The underlying custom element instance. Use to call imperative methods. */
|
|
25
|
-
get nativeElement(): LuzmoItemOptionColorPickerHostElement {
|
|
26
|
-
return this.host;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/** Preset colors offered as quick-pick swatches. */
|
|
30
|
-
@Input({ alias: 'swatches' })
|
|
31
|
-
swatches?: string[];
|
|
32
|
-
|
|
33
|
-
/** Corner rounding of the color swatch: `full`, `light`, or `none`. */
|
|
34
|
-
@Input({ alias: 'rounding' })
|
|
35
|
-
rounding?: 'full' | 'light' | 'none';
|
|
36
|
-
|
|
37
|
-
/** Shape of the color swatch: `circle` or `rectangle`. */
|
|
38
|
-
@Input({ alias: 'shape' })
|
|
39
|
-
shape?: 'circle' | 'rectangle';
|
|
40
|
-
|
|
41
|
-
/** Delay in milliseconds before the change event is emitted after the user stops interacting. */
|
|
42
|
-
@Input({ alias: 'debounce' })
|
|
43
|
-
debounce?: number;
|
|
44
|
-
|
|
45
|
-
/** Internal timer handle used to debounce change events. */
|
|
46
|
-
@Input({ alias: 'debounceTimeout' })
|
|
47
|
-
debounceTimeout?: any;
|
|
48
|
-
|
|
49
|
-
/** The current color value. */
|
|
50
|
-
@Input({ alias: 'value' })
|
|
51
|
-
value?: string;
|
|
52
|
-
|
|
53
|
-
/** Whether the control is disabled (non-interactive). */
|
|
54
|
-
@Input({ alias: 'disabled', transform: booleanAttribute })
|
|
55
|
-
disabled?: boolean;
|
|
56
|
-
|
|
57
|
-
/** Disables the alpha (opacity) channel in the color picker. */
|
|
58
|
-
@Input({ alias: 'noAlphaChannel', transform: booleanAttribute })
|
|
59
|
-
noAlphaChannel?: boolean;
|
|
60
|
-
|
|
61
|
-
/** Placement of the color picker dropdown relative to its trigger. */
|
|
62
|
-
@Input({ alias: 'placement' })
|
|
63
|
-
placement?: Placement;
|
|
64
|
-
|
|
65
|
-
/** Emitted when the option value changes. */
|
|
66
|
-
readonly luzmoOptionChanged = output<CustomEvent<ItemOptionChangedEventDetail>>({ alias: 'luzmoOptionChanged' });
|
|
67
|
-
|
|
68
|
-
constructor() {
|
|
69
|
-
this.bindEvents();
|
|
70
|
-
this.destroyRef.onDestroy(() => {
|
|
71
|
-
for (const cleanup of this.listenerCleanup) {
|
|
72
|
-
cleanup();
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
ngOnChanges(changes: SimpleChanges): void {
|
|
78
|
-
for (const key of Object.keys(changes)) {
|
|
79
|
-
switch (key) {
|
|
80
|
-
case 'swatches':
|
|
81
|
-
this.setHostProperty('swatches', changes['swatches'].currentValue);
|
|
82
|
-
break;
|
|
83
|
-
case 'rounding':
|
|
84
|
-
this.setHostProperty('rounding', changes['rounding'].currentValue);
|
|
85
|
-
break;
|
|
86
|
-
case 'shape':
|
|
87
|
-
this.setHostProperty('shape', changes['shape'].currentValue);
|
|
88
|
-
break;
|
|
89
|
-
case 'debounce':
|
|
90
|
-
this.setHostProperty('debounce', changes['debounce'].currentValue);
|
|
91
|
-
break;
|
|
92
|
-
case 'debounceTimeout':
|
|
93
|
-
this.setHostProperty('debounceTimeout', changes['debounceTimeout'].currentValue);
|
|
94
|
-
break;
|
|
95
|
-
case 'value':
|
|
96
|
-
this.setHostProperty('value', changes['value'].currentValue);
|
|
97
|
-
break;
|
|
98
|
-
case 'disabled':
|
|
99
|
-
this.setHostProperty('disabled', changes['disabled'].currentValue);
|
|
100
|
-
break;
|
|
101
|
-
case 'noAlphaChannel':
|
|
102
|
-
this.setHostProperty('noAlphaChannel', changes['noAlphaChannel'].currentValue);
|
|
103
|
-
break;
|
|
104
|
-
case 'placement':
|
|
105
|
-
this.setHostProperty('placement', changes['placement'].currentValue);
|
|
106
|
-
break;
|
|
107
|
-
default:
|
|
108
|
-
break;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* Forward a wrapper @Input to the underlying host element via Renderer2 so
|
|
115
|
-
* the wrapper stays compatible with non-DOM Angular platforms (SSR, tests).
|
|
116
|
-
* Unlike a "skip undefined" guard, this lets consumers reset values back to
|
|
117
|
-
* undefined / null by clearing their bindings.
|
|
118
|
-
*/
|
|
119
|
-
private setHostProperty(key: string, value: unknown): void {
|
|
120
|
-
this.renderer.setProperty(this.host, key, value);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
private bindEvents(): void {
|
|
124
|
-
this.listenerCleanup.push(
|
|
125
|
-
this.renderer.listen(this.host, 'luzmo-option-changed', (event: Event) => {
|
|
126
|
-
const typed = event as CustomEvent<ItemOptionChangedEventDetail>;
|
|
127
|
-
this.luzmoOptionChanged.emit(typed);
|
|
128
|
-
})
|
|
129
|
-
);
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
/** The underlying custom element type for LuzmoItemOptionColorPicker */
|
|
134
|
-
export type LuzmoItemOptionColorPickerElement = LuzmoItemOptionColorPickerHostElement;
|