@masterteam/components 0.0.69 → 0.0.71

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 (99) hide show
  1. package/README.md +63 -63
  2. package/assets/cairo.css +70 -70
  3. package/assets/common.css +2 -2
  4. package/assets/i18n/ar.json +39 -36
  5. package/assets/i18n/en.json +39 -36
  6. package/assets/inter.css +418 -418
  7. package/fesm2022/masterteam-components-avatar-text.mjs +2 -2
  8. package/fesm2022/masterteam-components-avatar-text.mjs.map +1 -1
  9. package/fesm2022/masterteam-components-avatar.mjs +2 -2
  10. package/fesm2022/masterteam-components-avatar.mjs.map +1 -1
  11. package/fesm2022/masterteam-components-breadcrumb.mjs +2 -2
  12. package/fesm2022/masterteam-components-breadcrumb.mjs.map +1 -1
  13. package/fesm2022/masterteam-components-button-group.mjs +2 -2
  14. package/fesm2022/masterteam-components-button-group.mjs.map +1 -1
  15. package/fesm2022/masterteam-components-button.mjs +2 -2
  16. package/fesm2022/masterteam-components-button.mjs.map +1 -1
  17. package/fesm2022/masterteam-components-card.mjs +2 -2
  18. package/fesm2022/masterteam-components-card.mjs.map +1 -1
  19. package/fesm2022/masterteam-components-checkbox-field.mjs +2 -2
  20. package/fesm2022/masterteam-components-checkbox-field.mjs.map +1 -1
  21. package/fesm2022/masterteam-components-chip.mjs +2 -2
  22. package/fesm2022/masterteam-components-chip.mjs.map +1 -1
  23. package/fesm2022/masterteam-components-color-picker-field.mjs +2 -2
  24. package/fesm2022/masterteam-components-color-picker-field.mjs.map +1 -1
  25. package/fesm2022/masterteam-components-confirmation.mjs +2 -2
  26. package/fesm2022/masterteam-components-confirmation.mjs.map +1 -1
  27. package/fesm2022/masterteam-components-date-field.mjs +2 -2
  28. package/fesm2022/masterteam-components-date-field.mjs.map +1 -1
  29. package/fesm2022/masterteam-components-dialog.mjs.map +1 -1
  30. package/fesm2022/masterteam-components-drawer.mjs +2 -2
  31. package/fesm2022/masterteam-components-drawer.mjs.map +1 -1
  32. package/fesm2022/masterteam-components-dynamic-drawer.mjs +68 -68
  33. package/fesm2022/masterteam-components-dynamic-drawer.mjs.map +1 -1
  34. package/fesm2022/masterteam-components-editor-field.mjs +2 -2
  35. package/fesm2022/masterteam-components-editor-field.mjs.map +1 -1
  36. package/fesm2022/masterteam-components-field-validation.mjs +20 -20
  37. package/fesm2022/masterteam-components-field-validation.mjs.map +1 -1
  38. package/fesm2022/masterteam-components-icon-field.mjs +2 -2
  39. package/fesm2022/masterteam-components-icon-field.mjs.map +1 -1
  40. package/fesm2022/masterteam-components-list.mjs +2 -2
  41. package/fesm2022/masterteam-components-list.mjs.map +1 -1
  42. package/fesm2022/masterteam-components-menu.mjs +2 -2
  43. package/fesm2022/masterteam-components-menu.mjs.map +1 -1
  44. package/fesm2022/masterteam-components-modal.mjs.map +1 -1
  45. package/fesm2022/masterteam-components-module-summary-card.mjs +2 -2
  46. package/fesm2022/masterteam-components-module-summary-card.mjs.map +1 -1
  47. package/fesm2022/masterteam-components-multi-select-field.mjs +2 -2
  48. package/fesm2022/masterteam-components-multi-select-field.mjs.map +1 -1
  49. package/fesm2022/masterteam-components-number-field.mjs +2 -2
  50. package/fesm2022/masterteam-components-number-field.mjs.map +1 -1
  51. package/fesm2022/masterteam-components-page-header.mjs +2 -2
  52. package/fesm2022/masterteam-components-page-header.mjs.map +1 -1
  53. package/fesm2022/masterteam-components-page.mjs +2 -2
  54. package/fesm2022/masterteam-components-page.mjs.map +1 -1
  55. package/fesm2022/masterteam-components-paginator.mjs +2 -2
  56. package/fesm2022/masterteam-components-paginator.mjs.map +1 -1
  57. package/fesm2022/masterteam-components-pick-list-field.mjs +2 -2
  58. package/fesm2022/masterteam-components-pick-list-field.mjs.map +1 -1
  59. package/fesm2022/masterteam-components-radio-button-field.mjs +2 -2
  60. package/fesm2022/masterteam-components-radio-button-field.mjs.map +1 -1
  61. package/fesm2022/masterteam-components-radio-cards-field.mjs +2 -2
  62. package/fesm2022/masterteam-components-radio-cards-field.mjs.map +1 -1
  63. package/fesm2022/masterteam-components-radio-cards.mjs +2 -2
  64. package/fesm2022/masterteam-components-radio-cards.mjs.map +1 -1
  65. package/fesm2022/masterteam-components-select-field.mjs +2 -2
  66. package/fesm2022/masterteam-components-select-field.mjs.map +1 -1
  67. package/fesm2022/masterteam-components-sidebar.mjs +2 -2
  68. package/fesm2022/masterteam-components-sidebar.mjs.map +1 -1
  69. package/fesm2022/masterteam-components-slider-field.mjs +2 -2
  70. package/fesm2022/masterteam-components-slider-field.mjs.map +1 -1
  71. package/fesm2022/masterteam-components-table.mjs +299 -75
  72. package/fesm2022/masterteam-components-table.mjs.map +1 -1
  73. package/fesm2022/masterteam-components-tabs.mjs +2 -2
  74. package/fesm2022/masterteam-components-tabs.mjs.map +1 -1
  75. package/fesm2022/masterteam-components-text-field.mjs +2 -2
  76. package/fesm2022/masterteam-components-text-field.mjs.map +1 -1
  77. package/fesm2022/masterteam-components-textarea-field.mjs +2 -2
  78. package/fesm2022/masterteam-components-textarea-field.mjs.map +1 -1
  79. package/fesm2022/masterteam-components-toast.mjs +2 -2
  80. package/fesm2022/masterteam-components-toast.mjs.map +1 -1
  81. package/fesm2022/masterteam-components-toggle-field.mjs +2 -2
  82. package/fesm2022/masterteam-components-toggle-field.mjs.map +1 -1
  83. package/fesm2022/masterteam-components-tooltip.mjs.map +1 -1
  84. package/fesm2022/masterteam-components-topbar.mjs +2 -2
  85. package/fesm2022/masterteam-components-topbar.mjs.map +1 -1
  86. package/fesm2022/masterteam-components-tree.mjs +146 -0
  87. package/fesm2022/masterteam-components-tree.mjs.map +1 -0
  88. package/fesm2022/masterteam-components-upload-field.mjs +6 -6
  89. package/fesm2022/masterteam-components-upload-field.mjs.map +1 -1
  90. package/fesm2022/masterteam-components-user-search-field.mjs +2 -2
  91. package/fesm2022/masterteam-components-user-search-field.mjs.map +1 -1
  92. package/fesm2022/masterteam-components.mjs +61 -61
  93. package/fesm2022/masterteam-components.mjs.map +1 -1
  94. package/package.json +5 -5
  95. package/types/masterteam-components-table.d.ts +81 -14
  96. package/types/masterteam-components-tree.d.ts +91 -0
  97. package/fesm2022/masterteam-components-formula-builder.mjs +0 -360
  98. package/fesm2022/masterteam-components-formula-builder.mjs.map +0 -1
  99. package/types/masterteam-components-formula-builder.d.ts +0 -69
@@ -1,8 +1,10 @@
1
+ import * as _masterteam_components_table from '@masterteam/components/table';
1
2
  import * as _angular_core from '@angular/core';
2
3
  import { TemplateRef } from '@angular/core';
3
4
  import { MTIcon } from '@masterteam/icons';
4
5
  import { ConfirmationConfig, ConfirmationService } from '@masterteam/components/confirmation';
5
- import { TablePageEvent } from 'primeng/table';
6
+ import { Table as Table$1, TablePageEvent } from 'primeng/table';
7
+ import { ControlValueAccessor } from '@angular/forms';
6
8
 
7
9
  /**
8
10
  * Table action confirmation config with optional event
@@ -22,10 +24,22 @@ interface FilterOption {
22
24
  * Configuration for filtering on a specific column.
23
25
  */
24
26
  interface FilterConfig {
25
- type: 'text' | 'select';
26
- label: string;
27
+ type: 'text' | 'select' | 'date' | 'boolean';
28
+ label?: string;
27
29
  options?: FilterOption[];
28
30
  }
31
+ /**
32
+ * Filter value for date range or simple value
33
+ */
34
+ interface FilterValue {
35
+ value?: any;
36
+ from?: Date | null;
37
+ to?: Date | null;
38
+ }
39
+ /**
40
+ * Table filters map
41
+ */
42
+ type TableFilters = Record<string, FilterValue | any>;
29
43
  /**
30
44
  * Column type definition
31
45
  */
@@ -62,6 +76,10 @@ interface TableAction {
62
76
  declare class Table {
63
77
  selectionChange: _angular_core.OutputEmitterRef<any[]>;
64
78
  cellChange: _angular_core.OutputEmitterRef<CellChangeEvent>;
79
+ lazyLoad: _angular_core.OutputEmitterRef<any>;
80
+ columnReorder: _angular_core.OutputEmitterRef<any>;
81
+ rowReorder: _angular_core.OutputEmitterRef<any>;
82
+ filters: _angular_core.ModelSignal<TableFilters>;
65
83
  data: _angular_core.InputSignal<any[]>;
66
84
  columns: _angular_core.InputSignal<ColumnDef[]>;
67
85
  rowActions: _angular_core.InputSignal<TableAction[]>;
@@ -73,6 +91,13 @@ declare class Table {
73
91
  showFilters: _angular_core.InputSignalWithTransform<boolean, unknown>;
74
92
  loading: _angular_core.InputSignalWithTransform<boolean, unknown>;
75
93
  updating: _angular_core.InputSignalWithTransform<boolean, unknown>;
94
+ lazy: _angular_core.InputSignalWithTransform<boolean, unknown>;
95
+ lazyTotalRecords: _angular_core.InputSignal<number | undefined>;
96
+ reorderableColumns: _angular_core.InputSignalWithTransform<boolean, unknown>;
97
+ reorderableRows: _angular_core.InputSignalWithTransform<boolean, unknown>;
98
+ dataKey: _angular_core.InputSignal<string | undefined>;
99
+ exportable: _angular_core.InputSignalWithTransform<boolean, unknown>;
100
+ exportFilename: _angular_core.InputSignal<string>;
76
101
  tabs: _angular_core.InputSignal<any[] | undefined>;
77
102
  tabsOptionLabel: _angular_core.InputSignal<string | undefined>;
78
103
  tabsOptionValue: _angular_core.InputSignal<string | undefined>;
@@ -82,6 +107,7 @@ declare class Table {
82
107
  captionStartContent: _angular_core.Signal<TemplateRef<any> | undefined>;
83
108
  captionEndContent: _angular_core.Signal<TemplateRef<any> | undefined>;
84
109
  emptyContent: _angular_core.Signal<TemplateRef<any> | undefined>;
110
+ protected tableRef: _angular_core.Signal<Table$1<any> | undefined>;
85
111
  paginatorPosition: _angular_core.InputSignal<"end" | "start" | "center">;
86
112
  pageSize: _angular_core.ModelSignal<number>;
87
113
  currentPage: _angular_core.ModelSignal<number>;
@@ -89,32 +115,73 @@ declare class Table {
89
115
  filterTerm: _angular_core.ModelSignal<string>;
90
116
  confirmationService: ConfirmationService;
91
117
  protected selectedRows: _angular_core.WritableSignal<Set<any>>;
92
- protected isFilterPanelOpen: _angular_core.WritableSignal<boolean>;
93
- protected pendingFilters: _angular_core.WritableSignal<Record<string, any>>;
94
- protected appliedFilters: _angular_core.WritableSignal<Record<string, any>>;
95
- protected filterableColumns: _angular_core.Signal<ColumnDef[]>;
118
+ protected exportColumns: _angular_core.Signal<{
119
+ field: string;
120
+ header: string;
121
+ key: string;
122
+ label: string;
123
+ type?: _masterteam_components_table.ColumnType;
124
+ customCellTpl?: TemplateRef<any>;
125
+ filterConfig?: _masterteam_components_table.FilterConfig;
126
+ }[]>;
96
127
  protected activeFilterCount: _angular_core.Signal<number>;
97
128
  protected filteredData: _angular_core.Signal<any[]>;
98
129
  protected displayData: _angular_core.Signal<any[]>;
99
130
  protected totalRecords: _angular_core.Signal<number>;
100
131
  protected paginatedData: _angular_core.Signal<any[]>;
101
132
  protected allSelectedOnPage: _angular_core.Signal<boolean>;
102
- toggleFilterPanel(): void;
103
- updatePendingFilter(key: string, value: any): void;
104
- applyFilters(): void;
105
- resetFilters(): void;
133
+ onFilterApplied(filters: TableFilters): void;
134
+ onFilterReset(): void;
135
+ protected matchesFilter(item: any, key: string, filterValue: FilterValue | any): boolean;
106
136
  toggleRow(row: any): void;
107
137
  toggleAllRowsOnPage(): void;
108
138
  getProperty(obj: any, key: string): any;
109
139
  tabChanged(tab: any): void;
110
140
  onTablePage(event: TablePageEvent): void;
141
+ handleLazyLoad(event: any): void;
142
+ onPaginatorPage(event: any): void;
111
143
  onSearchChange(searchTerm: Event): void;
112
144
  onCellChange(row: any, columnKey: string, newValue: any, type?: ColumnTypeForActionCell): void;
113
145
  resolveActionLoading(action: TableAction, row: any): boolean | undefined;
146
+ onColumnReorder(event: any): void;
147
+ onRowReorder(event: any): void;
148
+ protected updatePagingFromEvent(event: any): void;
149
+ protected emitLazyLoad(event: any): void;
150
+ exportCSV(): void;
114
151
  rowAction(event: Event, action: TableAction, row: any): void;
115
152
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<Table, never>;
116
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<Table, "mt-table", never, { "data": { "alias": "data"; "required": true; "isSignal": true; }; "columns": { "alias": "columns"; "required": true; "isSignal": true; }; "rowActions": { "alias": "rowActions"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "showGridlines": { "alias": "showGridlines"; "required": false; "isSignal": true; }; "stripedRows": { "alias": "stripedRows"; "required": false; "isSignal": true; }; "selectableRows": { "alias": "selectableRows"; "required": false; "isSignal": true; }; "generalSearch": { "alias": "generalSearch"; "required": false; "isSignal": true; }; "showFilters": { "alias": "showFilters"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "updating": { "alias": "updating"; "required": false; "isSignal": true; }; "tabs": { "alias": "tabs"; "required": false; "isSignal": true; }; "tabsOptionLabel": { "alias": "tabsOptionLabel"; "required": false; "isSignal": true; }; "tabsOptionValue": { "alias": "tabsOptionValue"; "required": false; "isSignal": true; }; "activeTab": { "alias": "activeTab"; "required": false; "isSignal": true; }; "actions": { "alias": "actions"; "required": false; "isSignal": true; }; "paginatorPosition": { "alias": "paginatorPosition"; "required": false; "isSignal": true; }; "pageSize": { "alias": "pageSize"; "required": false; "isSignal": true; }; "currentPage": { "alias": "currentPage"; "required": false; "isSignal": true; }; "first": { "alias": "first"; "required": false; "isSignal": true; }; "filterTerm": { "alias": "filterTerm"; "required": false; "isSignal": true; }; }, { "selectionChange": "selectionChange"; "cellChange": "cellChange"; "activeTab": "activeTabChange"; "onTabChange": "onTabChange"; "pageSize": "pageSizeChange"; "currentPage": "currentPageChange"; "first": "firstChange"; "filterTerm": "filterTermChange"; }, ["captionStartContent", "captionEndContent", "emptyContent"], never, true, never>;
153
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<Table, "mt-table", never, { "filters": { "alias": "filters"; "required": false; "isSignal": true; }; "data": { "alias": "data"; "required": true; "isSignal": true; }; "columns": { "alias": "columns"; "required": true; "isSignal": true; }; "rowActions": { "alias": "rowActions"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "showGridlines": { "alias": "showGridlines"; "required": false; "isSignal": true; }; "stripedRows": { "alias": "stripedRows"; "required": false; "isSignal": true; }; "selectableRows": { "alias": "selectableRows"; "required": false; "isSignal": true; }; "generalSearch": { "alias": "generalSearch"; "required": false; "isSignal": true; }; "showFilters": { "alias": "showFilters"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "updating": { "alias": "updating"; "required": false; "isSignal": true; }; "lazy": { "alias": "lazy"; "required": false; "isSignal": true; }; "lazyTotalRecords": { "alias": "lazyTotalRecords"; "required": false; "isSignal": true; }; "reorderableColumns": { "alias": "reorderableColumns"; "required": false; "isSignal": true; }; "reorderableRows": { "alias": "reorderableRows"; "required": false; "isSignal": true; }; "dataKey": { "alias": "dataKey"; "required": false; "isSignal": true; }; "exportable": { "alias": "exportable"; "required": false; "isSignal": true; }; "exportFilename": { "alias": "exportFilename"; "required": false; "isSignal": true; }; "tabs": { "alias": "tabs"; "required": false; "isSignal": true; }; "tabsOptionLabel": { "alias": "tabsOptionLabel"; "required": false; "isSignal": true; }; "tabsOptionValue": { "alias": "tabsOptionValue"; "required": false; "isSignal": true; }; "activeTab": { "alias": "activeTab"; "required": false; "isSignal": true; }; "actions": { "alias": "actions"; "required": false; "isSignal": true; }; "paginatorPosition": { "alias": "paginatorPosition"; "required": false; "isSignal": true; }; "pageSize": { "alias": "pageSize"; "required": false; "isSignal": true; }; "currentPage": { "alias": "currentPage"; "required": false; "isSignal": true; }; "first": { "alias": "first"; "required": false; "isSignal": true; }; "filterTerm": { "alias": "filterTerm"; "required": false; "isSignal": true; }; }, { "selectionChange": "selectionChange"; "cellChange": "cellChange"; "lazyLoad": "lazyLoad"; "columnReorder": "columnReorder"; "rowReorder": "rowReorder"; "filters": "filtersChange"; "activeTab": "activeTabChange"; "onTabChange": "onTabChange"; "pageSize": "pageSizeChange"; "currentPage": "currentPageChange"; "first": "firstChange"; "filterTerm": "filterTermChange"; }, ["captionStartContent", "captionEndContent", "emptyContent"], never, true, never>;
154
+ }
155
+
156
+ declare class TableFilter implements ControlValueAccessor {
157
+ readonly columns: _angular_core.InputSignal<ColumnDef[]>;
158
+ readonly data: _angular_core.InputSignal<any[]>;
159
+ readonly filterApplied: _angular_core.OutputEmitterRef<TableFilters>;
160
+ readonly filterReset: _angular_core.OutputEmitterRef<void>;
161
+ protected pendingFilters: _angular_core.WritableSignal<TableFilters>;
162
+ protected appliedFilters: _angular_core.WritableSignal<TableFilters>;
163
+ protected booleanOptions: {
164
+ label: string;
165
+ value: boolean;
166
+ }[];
167
+ private onChange;
168
+ private onTouched;
169
+ protected filterableColumns: _angular_core.Signal<ColumnDef[]>;
170
+ protected activeFilterCount: _angular_core.Signal<number>;
171
+ protected getFilterType(col: ColumnDef): string;
172
+ protected getFilterValue(key: string): any;
173
+ protected getDateRangeValue(key: string, part: 'from' | 'to'): Date | null;
174
+ protected updateFilter(key: string, value: any): void;
175
+ protected updateDateFilter(key: string, part: 'from' | 'to', value: Date | null): void;
176
+ protected apply(): void;
177
+ protected reset(): void;
178
+ private hasValue;
179
+ writeValue(value: TableFilters | null): void;
180
+ registerOnChange(fn: (value: TableFilters) => void): void;
181
+ registerOnTouched(fn: () => void): void;
182
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<TableFilter, never>;
183
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<TableFilter, "mt-table-filter", never, { "columns": { "alias": "columns"; "required": true; "isSignal": true; }; "data": { "alias": "data"; "required": false; "isSignal": true; }; }, { "filterApplied": "filterApplied"; "filterReset": "filterReset"; }, never, never, true, never>;
117
184
  }
118
185
 
119
- export { Table };
120
- export type { CellChangeEvent, ColumnDef, ColumnType, ColumnTypeForActionCell, FilterConfig, FilterOption, TableAction, TableActionConfirmationConfig };
186
+ export { Table, TableFilter };
187
+ export type { CellChangeEvent, ColumnDef, ColumnType, ColumnTypeForActionCell, FilterConfig, FilterOption, FilterValue, TableAction, TableActionConfirmationConfig, TableFilters };
@@ -0,0 +1,91 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { Tree as Tree$1 } from 'primeng/tree';
3
+ import { TreeNode, MenuItem } from 'primeng/api';
4
+ export { TreeNode } from 'primeng/api';
5
+ import { MTIcon } from '@masterteam/icons';
6
+ import { Directionality } from '@angular/cdk/bidi';
7
+ import { TranslocoService } from '@jsverse/transloco';
8
+
9
+ /**
10
+ * Defines an action button for tree nodes
11
+ */
12
+ interface TreeAction {
13
+ icon?: MTIcon | undefined;
14
+ severity?: 'info' | 'success' | 'warn' | 'danger' | 'secondary' | 'contrast' | 'help' | 'primary';
15
+ variant?: 'text' | 'outlined' | undefined;
16
+ size?: 'small' | 'large' | undefined;
17
+ label?: string;
18
+ tooltip?: string;
19
+ hidden?: (node: any) => boolean;
20
+ action: (node: any) => void;
21
+ loading?: boolean | ((node: any) => boolean);
22
+ }
23
+ /**
24
+ * Defines a context menu action for tree nodes
25
+ */
26
+ interface TreeContextMenuAction {
27
+ icon?: MTIcon | undefined;
28
+ label: string;
29
+ action: (node: any) => void;
30
+ }
31
+ /**
32
+ * Tree action types - all possible events from tree component
33
+ */
34
+ type TreeActionType = 'selectionChange' | 'nodeSelect' | 'nodeUnselect' | 'nodeExpand' | 'nodeCollapse';
35
+ /**
36
+ * Tree action event interface - unified event structure for all tree actions
37
+ */
38
+ interface TreeActionEvent {
39
+ action: TreeActionType;
40
+ data: any;
41
+ }
42
+
43
+ declare class Tree {
44
+ transloco: TranslocoService;
45
+ dir: Directionality | null;
46
+ readonly primeTree: _angular_core.Signal<Tree$1 | undefined>;
47
+ readonly value: _angular_core.InputSignal<TreeNode<any>[]>;
48
+ readonly selection: _angular_core.ModelSignal<TreeNode<any> | TreeNode<any>[] | null | undefined>;
49
+ readonly selectionMode: _angular_core.InputSignal<"single" | "multiple" | "checkbox" | undefined>;
50
+ readonly nodeIcon: _angular_core.InputSignal<MTIcon | undefined>;
51
+ readonly propagateSelectionUp: _angular_core.InputSignal<boolean>;
52
+ readonly propagateSelectionDown: _angular_core.InputSignal<boolean>;
53
+ readonly loading: _angular_core.InputSignal<boolean>;
54
+ readonly emptyMessage: _angular_core.InputSignal<string>;
55
+ readonly filterPlaceholder: _angular_core.InputSignal<string>;
56
+ readonly dataKey: _angular_core.InputSignal<string>;
57
+ readonly filter: _angular_core.InputSignal<boolean>;
58
+ readonly filterMode: _angular_core.InputSignal<"lenient" | "strict">;
59
+ readonly styleClass: _angular_core.InputSignal<string>;
60
+ readonly style: _angular_core.InputSignal<Record<string, string> | undefined>;
61
+ readonly pInputs: _angular_core.InputSignal<Partial<Tree$1> | undefined>;
62
+ readonly nodeActions: _angular_core.InputSignal<TreeAction[]>;
63
+ readonly nodeContextmenuActions: _angular_core.InputSignal<TreeContextMenuAction[]>;
64
+ readonly contextMenuSelection: _angular_core.ModelSignal<TreeNode<any> | null>;
65
+ readonly contextMenuItems: _angular_core.Signal<MenuItem[]>;
66
+ readonly action: _angular_core.OutputEmitterRef<TreeActionEvent>;
67
+ constructor();
68
+ onSelectionChange(event: TreeNode | TreeNode[] | null): void;
69
+ onNodeSelect(event: {
70
+ node: TreeNode;
71
+ }): void;
72
+ onNodeUnselect(event: {
73
+ node: TreeNode;
74
+ }): void;
75
+ onNodeExpand(event: {
76
+ node: TreeNode;
77
+ }): void;
78
+ onNodeCollapse(event: {
79
+ node: TreeNode;
80
+ }): void;
81
+ onContextMenuSelect(event: TreeNode): void;
82
+ toggleNodeSelection(node: TreeNode, event: MouseEvent): void;
83
+ handleCheckedNodes(): void;
84
+ resolveActionLoading(action: TreeAction, node: any): boolean | undefined;
85
+ nodeAction(action: TreeAction, node: any): void;
86
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<Tree, never>;
87
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<Tree, "mt-tree", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "selection": { "alias": "selection"; "required": false; "isSignal": true; }; "selectionMode": { "alias": "selectionMode"; "required": false; "isSignal": true; }; "nodeIcon": { "alias": "nodeIcon"; "required": false; "isSignal": true; }; "propagateSelectionUp": { "alias": "propagateSelectionUp"; "required": false; "isSignal": true; }; "propagateSelectionDown": { "alias": "propagateSelectionDown"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "emptyMessage": { "alias": "emptyMessage"; "required": false; "isSignal": true; }; "filterPlaceholder": { "alias": "filterPlaceholder"; "required": false; "isSignal": true; }; "dataKey": { "alias": "dataKey"; "required": false; "isSignal": true; }; "filter": { "alias": "filter"; "required": false; "isSignal": true; }; "filterMode": { "alias": "filterMode"; "required": false; "isSignal": true; }; "styleClass": { "alias": "styleClass"; "required": false; "isSignal": true; }; "style": { "alias": "style"; "required": false; "isSignal": true; }; "pInputs": { "alias": "pInputs"; "required": false; "isSignal": true; }; "nodeActions": { "alias": "nodeActions"; "required": false; "isSignal": true; }; "nodeContextmenuActions": { "alias": "nodeContextmenuActions"; "required": false; "isSignal": true; }; "contextMenuSelection": { "alias": "contextMenuSelection"; "required": false; "isSignal": true; }; }, { "selection": "selectionChange"; "contextMenuSelection": "contextMenuSelectionChange"; "action": "action"; }, never, never, true, never>;
88
+ }
89
+
90
+ export { Tree };
91
+ export type { TreeAction, TreeActionEvent, TreeActionType, TreeContextMenuAction };
@@ -1,360 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { input, booleanAttribute, inject, signal, computed, Component } from '@angular/core';
3
- import * as i1 from '@angular/forms';
4
- import { FormsModule } from '@angular/forms';
5
- import * as i3 from '@angular/cdk/drag-drop';
6
- import { moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop';
7
- import { Button } from '@masterteam/components/button';
8
- import { InputTextModule } from 'primeng/inputtext';
9
- import * as i2 from 'primeng/chip';
10
- import { ChipModule } from 'primeng/chip';
11
- import { HttpClient } from '@angular/common/http';
12
- import { map, catchError, EMPTY, of } from 'rxjs';
13
- import { SelectField } from '@masterteam/components/select-field';
14
- import * as i4 from 'primeng/inputgroup';
15
- import { InputGroupModule } from 'primeng/inputgroup';
16
- import * as i5 from 'primeng/inputgroupaddon';
17
- import { InputGroupAddonModule } from 'primeng/inputgroupaddon';
18
- import { TextField } from '@masterteam/components/text-field';
19
-
20
- const types = {
21
- function: {
22
- bg: 'var(--p-green-50)',
23
- border: 'var(--p-green-500)',
24
- },
25
- value: {
26
- bg: 'var(--p-purple-100)',
27
- border: 'var(--p-purple-500)',
28
- },
29
- field: {
30
- bg: 'var(--p-orange-50)',
31
- border: 'var(--p-orange-500)',
32
- },
33
- operator: {
34
- bg: 'var(--p-primary-50)',
35
- border: 'var(--p-primary-500)',
36
- },
37
- };
38
- const operators = [
39
- {
40
- key: '+',
41
- name: '+',
42
- type: 'operator',
43
- },
44
- {
45
- key: '-',
46
- name: '-',
47
- type: 'operator',
48
- },
49
- {
50
- key: '*',
51
- name: '×',
52
- type: 'operator',
53
- },
54
- {
55
- key: '/',
56
- name: '÷',
57
- type: 'operator',
58
- },
59
- // {
60
- // key: '==',
61
- // name: '=',
62
- // type: 'operator',
63
- // },
64
- // {
65
- // key: '!=',
66
- // name: '≠',
67
- // type: 'operator',
68
- // },
69
- // {
70
- // key: '<',
71
- // name: '<',
72
- // type: 'operator',
73
- // },
74
- // {
75
- // key: '<=',
76
- // name: '≤',
77
- // type: 'operator',
78
- // },
79
- // {
80
- // key: '>',
81
- // name: '>',
82
- // type: 'operator',
83
- // },
84
- // {
85
- // key: '>=',
86
- // name: '≥',
87
- // type: 'operator',
88
- // },
89
- // {
90
- // key: '||',
91
- // name: '||',
92
- // type: 'operator',
93
- // },
94
- // {
95
- // key: '&&',
96
- // name: '&&',
97
- // type: 'operator',
98
- // },
99
- {
100
- key: '(',
101
- name: '(',
102
- type: 'operator',
103
- },
104
- {
105
- key: ')',
106
- name: ')',
107
- type: 'operator',
108
- },
109
- {
110
- key: ',',
111
- name: ',',
112
- type: 'operator',
113
- },
114
- {
115
- key: ';',
116
- name: ';',
117
- type: 'operator',
118
- },
119
- ];
120
-
121
- class FormulaBuilder {
122
- hideTitle = input(false, { ...(ngDevMode ? { debugName: "hideTitle" } : {}), transform: booleanAttribute });
123
- properties = input([], ...(ngDevMode ? [{ debugName: "properties" }] : []));
124
- // validationUrl = input<string>('app/checkformula');
125
- validationUrl = input(...(ngDevMode ? [undefined, { debugName: "validationUrl" }] : []));
126
- httpClient = inject(HttpClient);
127
- // translateService: TranslateService = inject(TranslateService);
128
- // functions = computed(() => []);
129
- functions = [
130
- {
131
- // name: this.translateService.instant('formula-builder.count'),
132
- name: 'formula-builder.count',
133
- key: 'count',
134
- hint: '',
135
- },
136
- {
137
- // name: this.translateService.instant('formula-builder.sum'),
138
- name: 'formula-builder.sum',
139
- key: 'sum',
140
- hint: '',
141
- },
142
- {
143
- // name: this.translateService.instant('formula-builder.average'),
144
- name: 'formula-builder.average',
145
- key: 'average',
146
- hint: '',
147
- },
148
- {
149
- // name: this.translateService.instant('formula-builder.count-value'),
150
- name: 'formula-builder.count-value',
151
- key: 'countvalue',
152
- // hint: this.translateService.instant('formula-builder.count-value-hint'),
153
- hint: 'formula-builder.count-value-hint',
154
- },
155
- {
156
- // name: this.translateService.instant('formula-builder.average-count'),
157
- name: 'formula-builder.average-count',
158
- key: 'averagecount',
159
- // hint: this.translateService.instant('formula-builder.average-count-hint'),
160
- hint: 'formula-builder.average-count-hint',
161
- },
162
- {
163
- // name: this.translateService.instant('formula-builder.mode'),
164
- name: 'formula-builder.mode',
165
- key: 'mode',
166
- // hint: this.translateService.instant('formula-builder.mode-hint'),
167
- hint: 'formula-builder.mode-hint',
168
- },
169
- {
170
- // name: this.translateService.instant('formula-builder.median'),
171
- name: 'formula-builder.median',
172
- key: 'median',
173
- // hint: this.translateService.instant('formula-builder.median-hint'),
174
- hint: 'formula-builder.median-hint',
175
- },
176
- {
177
- // name: this.translateService.instant('formula-builder.standard-deviation'),
178
- name: 'formula-builder.standard-deviation',
179
- key: 'stddev',
180
- hint: '',
181
- },
182
- {
183
- // name: this.translateService.instant('formula-builder.min-max'),
184
- name: 'formula-builder.min-max',
185
- key: 'range',
186
- // hint: this.translateService.instant('formula-builder.min-max-hint'),
187
- hint: 'formula-builder.min-max-hint',
188
- },
189
- ];
190
- selectedLookup = signal(null, ...(ngDevMode ? [{ debugName: "selectedLookup" }] : []));
191
- formula = signal([], ...(ngDevMode ? [{ debugName: "formula" }] : []));
192
- disabled = signal(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
193
- touched = signal(false, ...(ngDevMode ? [{ debugName: "touched" }] : []));
194
- types = types;
195
- operators = operators;
196
- formulaText = computed(() => {
197
- return '';
198
- }, ...(ngDevMode ? [{ debugName: "formulaText" }] : []));
199
- onChange(_formula) { }
200
- onTouched() { }
201
- emitChange() {
202
- const str = this.formula()
203
- .map((x) => x.key)
204
- .join(' ');
205
- this.onChange(str);
206
- }
207
- onAdd(item) {
208
- this.markAsTouched();
209
- if (!this.disabled()) {
210
- this.formula.update((formula) => [...formula, item]);
211
- this.emitChange();
212
- }
213
- }
214
- onRemove(index) {
215
- this.markAsTouched();
216
- if (!this.disabled()) {
217
- this.formula.update((formula) => {
218
- formula.splice(index, 1);
219
- return formula;
220
- });
221
- this.emitChange();
222
- }
223
- }
224
- onAddProperty(property, dropdown) {
225
- if (!property?.key)
226
- return;
227
- this.onAdd({
228
- key: property.key,
229
- name: property.name,
230
- type: 'field',
231
- dataType: property?.dataType,
232
- });
233
- // TODO: fix input clearing
234
- dropdown?.clearSelection();
235
- this.selectedLookup.set(null);
236
- }
237
- onAddValue(el) {
238
- this.onAdd({
239
- key: el.value(),
240
- name: el.value(),
241
- type: 'value',
242
- });
243
- el.value.set('');
244
- }
245
- onAddFunction(func, dropdown) {
246
- if (!func?.key)
247
- return;
248
- this.onAdd({
249
- key: func.key,
250
- name: func.name,
251
- type: 'function',
252
- });
253
- dropdown?.clearSelection();
254
- }
255
- writeValue(formulaString) {
256
- if (formulaString) {
257
- this.formula.set(this.parseStringToItems(formulaString));
258
- }
259
- }
260
- registerOnChange(onChange) {
261
- this.onChange = onChange;
262
- }
263
- registerOnTouched(onTouched) {
264
- this.onTouched = onTouched;
265
- }
266
- setDisabledState(isDisabled) {
267
- this.disabled.set(isDisabled);
268
- }
269
- markAsTouched() {
270
- if (!this.touched()) {
271
- this.onTouched();
272
- this.touched.set(true);
273
- }
274
- }
275
- validate(control) {
276
- const formula = control.value;
277
- if (this.validationUrl()) {
278
- const res$ = this.httpClient.post(this.validationUrl(), {
279
- formula,
280
- });
281
- return res$.pipe(map(({ data }) => {
282
- return data ? null : { mustBeValidFormula: formula };
283
- }), catchError(() => {
284
- return EMPTY;
285
- }));
286
- }
287
- else {
288
- return of(null);
289
- }
290
- }
291
- drop(event) {
292
- this.formula.update((formula) => {
293
- moveItemInArray(formula, event.previousIndex, event.currentIndex);
294
- return formula;
295
- });
296
- }
297
- parseStringToItems(strValue) {
298
- if (!strValue || !strValue.trim())
299
- return [];
300
- const tokens = strValue.split(/\s+/);
301
- const results = [];
302
- tokens.forEach((token) => {
303
- let found = this.operators.find((el) => el.key === token);
304
- if (found) {
305
- results.push(found);
306
- return;
307
- }
308
- found = this.functions.find((el) => el.key === token);
309
- if (found) {
310
- results.push({
311
- key: token,
312
- name: found.name,
313
- type: 'function',
314
- });
315
- return;
316
- }
317
- found = this.properties().find((el) => el.key === token);
318
- if (found) {
319
- results.push({
320
- key: token,
321
- name: found.name,
322
- type: 'field',
323
- });
324
- return;
325
- }
326
- results.push({
327
- key: token,
328
- name: token,
329
- type: 'value',
330
- });
331
- });
332
- return results;
333
- }
334
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: FormulaBuilder, deps: [], target: i0.ɵɵFactoryTarget.Component });
335
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: FormulaBuilder, isStandalone: true, selector: "mt-formula-builder", inputs: { hideTitle: { classPropertyName: "hideTitle", publicName: "hideTitle", isSignal: true, isRequired: false, transformFunction: null }, properties: { classPropertyName: "properties", publicName: "properties", isSignal: true, isRequired: false, transformFunction: null }, validationUrl: { classPropertyName: "validationUrl", publicName: "validationUrl", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"@container w-full flex flex-col gap-2\">\n @if (!hideTitle()) {\n <h6 class=\"m-0\" translate>formula-builder.formula-builder</h6>\n }\n @if (!disabled()) {\n <div class=\"grid grid-cols-6 gap-2\">\n @if (properties()?.length) {\n <div class=\"col-span-6 @md:col-span-3 @2xl:col-span-2\">\n <mt-select-field\n #propertyDropdown=\"\"\n (onChange)=\"onAddProperty($event, propertyDropdown)\"\n label=\"formula-builder.property\"\n selectId=\"-1\"\n placeholder=\"{{ 'formula-builder.select-property' }}\"\n styleClass=\"w-full\"\n [filter]=\"true\"\n filterBy=\"name\"\n [ngModel]=\"null\"\n [options]=\"properties()\"\n optionLabel=\"name\"\n dataKey=\"key\"\n appendTo=\"body\"\n ></mt-select-field>\n </div>\n }\n @if (functions?.length) {\n <div class=\"col-span-6 @md:col-span-3 @2xl:col-span-2\">\n <mt-select-field\n #functionDropdown=\"\"\n label=\"formula-builder.function\"\n (onChange)=\"onAddFunction($event, functionDropdown)\"\n selectId=\"-1\"\n placeholder=\"{{ 'formula-builder.select-function' }}\"\n styleClass=\"w-full\"\n [filter]=\"true\"\n filterBy=\"name\"\n [ngModel]=\"null\"\n [options]=\"functions\"\n optionLabel=\"name\"\n dataKey=\"key\"\n appendTo=\"body\"\n ></mt-select-field>\n </div>\n }\n <div class=\"col-span-6 @md:col-span-3 @2xl:col-span-2\">\n <label for=\"configuration\" translate>formula-builder.operators</label>\n <div dir=\"ltr\" class=\"flex flex-wrap gap-1\">\n @for (operator of operators; track operator) {\n <mt-button\n type=\"button\"\n [outlined]=\"true\"\n [label]=\"operator.name\"\n (click)=\"onAdd(operator)\"\n >\n </mt-button>\n }\n </div>\n </div>\n <div class=\"col-span-6 @md:col-span-3 @2xl:col-span-2\">\n <label for=\"configuration\" translate\n >formula-builder.custom-value</label\n >\n <p-input-group>\n <mt-text-field\n #customInput\n type=\"text\"\n [field]=\"false\"\n [placeholder]=\"'formula-builder.custom-value'\"\n style=\"width: 100%\"\n ></mt-text-field>\n <p-inputgroup-addon>\n <mt-button\n class=\"\"\n type=\"button\"\n (click)=\"onAddValue(customInput)\"\n [disabled]=\"disabled() || !customInput.value()\"\n label=\"\"\n icon=\"general.plus\"\n ></mt-button>\n </p-inputgroup-addon>\n </p-input-group>\n </div>\n </div>\n }\n <div>\n <label for=\"configuration\" translate>formula-builder.formula</label>\n <div\n dir=\"ltr\"\n cdkDropList=\"\"\n cdkDropListOrientation=\"mixed\"\n [cdkDropListData]=\"formula()\"\n (cdkDropListDropped)=\"drop($event)\"\n [cdkDropListDisabled]=\"disabled()\"\n class=\"flex flex-wrap gap-1 rounded-lg border-1 border-gray-500 bg-gray-50 p-2 formula-preview\"\n >\n @for (item of formula(); track item; let i = $index) {\n <p-chip\n [style]=\"{\n background: types[item.type]?.bg ?? 'var(--p-gary-50)',\n borderColor: types[item.type]?.border ?? 'var(--p-gary-500)',\n }\"\n styleClass=\"text-black-alpha-90 border-1 border-round cursor-grab\"\n [label]=\"item.name\"\n [removable]=\"!disabled()\"\n (onRemove)=\"onRemove(i)\"\n [cdkDragDisabled]=\"disabled()\"\n cdkDrag=\"\"\n ></p-chip>\n }\n </div>\n </div>\n</div>\n", styles: [":host .formula-preview{border-color:var(--p-gray-500);min-height:60px}:host.ng-valid .formula-preview{border-color:var(--p-green-500)}:host.ng-invalid .formula-preview{border-color:var(--p-red-500)}:host ::ng-deep .cdk-drop-list{display:flex}:host ::ng-deep .cdk-drag-preview{box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f;z-index:1000}:host ::ng-deep .cdk-drag-placeholder{opacity:.5}:host ::ng-deep .cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}:host ::ng-deep .formula-preview.cdk-drop-list-dragging .formula-preview:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}::ng-deep .p-inputgroupaddon:first-child .p-inputtext,::ng-deep .p-inputgroup>mt-text-field:first-child .p-inputtext{height:100%;width:100%;border-radius:0;border-start-start-radius:var(--p-inputgroup-addon-border-radius);border-end-start-radius:var(--p-inputgroup-addon-border-radius)}::ng-deep .p-inputgroupaddon:first-child,::ng-deep .p-inputgroup>p-autocomplete:first-child{width:100%}::ng-deep .p-inputgroupaddon:first-child>div,::ng-deep .p-inputgroup>p-autocomplete:first-child>div{width:100%;height:100%}::ng-deep .p-inputgroupaddon:first-child>div ul,::ng-deep .p-inputgroup>p-autocomplete:first-child>div ul{border-radius:0;border-start-start-radius:var(--p-inputgroup-addon-border-radius);border-end-start-radius:var(--p-inputgroup-addon-border-radius)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: SelectField, selector: "mt-select-field", inputs: ["field", "label", "placeholder", "hasPlaceholderPrefix", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "clearAfterSelect", "required", "group", "optionGroupLabel", "optionGroupChildren", "loading"], outputs: ["onChange"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: ChipModule }, { kind: "component", type: i2.Chip, selector: "p-chip", inputs: ["label", "icon", "image", "alt", "styleClass", "disabled", "removable", "removeIcon", "chipProps"], outputs: ["onRemove", "onImageError"] }, { kind: "ngmodule", type:
336
- // TranslateModule,
337
- DragDropModule }, { kind: "directive", type: i3.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i3.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "ngmodule", type: InputGroupModule }, { kind: "component", type: i4.InputGroup, selector: "p-inputgroup, p-inputGroup, p-input-group", inputs: ["styleClass"] }, { kind: "ngmodule", type: InputGroupAddonModule }, { kind: "component", type: i5.InputGroupAddon, selector: "p-inputgroup-addon, p-inputGroupAddon", inputs: ["style", "styleClass"] }, { kind: "component", type: TextField, selector: "mt-text-field", inputs: ["field", "hint", "label", "placeholder", "class", "type", "readonly", "pInputs", "required", "icon", "iconPosition"] }] });
338
- }
339
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: FormulaBuilder, decorators: [{
340
- type: Component,
341
- args: [{ selector: 'mt-formula-builder', standalone: true, imports: [
342
- FormsModule,
343
- SelectField,
344
- InputTextModule,
345
- Button,
346
- ChipModule,
347
- // TranslateModule,
348
- DragDropModule,
349
- InputGroupModule,
350
- InputGroupAddonModule,
351
- TextField,
352
- ], template: "<div class=\"@container w-full flex flex-col gap-2\">\n @if (!hideTitle()) {\n <h6 class=\"m-0\" translate>formula-builder.formula-builder</h6>\n }\n @if (!disabled()) {\n <div class=\"grid grid-cols-6 gap-2\">\n @if (properties()?.length) {\n <div class=\"col-span-6 @md:col-span-3 @2xl:col-span-2\">\n <mt-select-field\n #propertyDropdown=\"\"\n (onChange)=\"onAddProperty($event, propertyDropdown)\"\n label=\"formula-builder.property\"\n selectId=\"-1\"\n placeholder=\"{{ 'formula-builder.select-property' }}\"\n styleClass=\"w-full\"\n [filter]=\"true\"\n filterBy=\"name\"\n [ngModel]=\"null\"\n [options]=\"properties()\"\n optionLabel=\"name\"\n dataKey=\"key\"\n appendTo=\"body\"\n ></mt-select-field>\n </div>\n }\n @if (functions?.length) {\n <div class=\"col-span-6 @md:col-span-3 @2xl:col-span-2\">\n <mt-select-field\n #functionDropdown=\"\"\n label=\"formula-builder.function\"\n (onChange)=\"onAddFunction($event, functionDropdown)\"\n selectId=\"-1\"\n placeholder=\"{{ 'formula-builder.select-function' }}\"\n styleClass=\"w-full\"\n [filter]=\"true\"\n filterBy=\"name\"\n [ngModel]=\"null\"\n [options]=\"functions\"\n optionLabel=\"name\"\n dataKey=\"key\"\n appendTo=\"body\"\n ></mt-select-field>\n </div>\n }\n <div class=\"col-span-6 @md:col-span-3 @2xl:col-span-2\">\n <label for=\"configuration\" translate>formula-builder.operators</label>\n <div dir=\"ltr\" class=\"flex flex-wrap gap-1\">\n @for (operator of operators; track operator) {\n <mt-button\n type=\"button\"\n [outlined]=\"true\"\n [label]=\"operator.name\"\n (click)=\"onAdd(operator)\"\n >\n </mt-button>\n }\n </div>\n </div>\n <div class=\"col-span-6 @md:col-span-3 @2xl:col-span-2\">\n <label for=\"configuration\" translate\n >formula-builder.custom-value</label\n >\n <p-input-group>\n <mt-text-field\n #customInput\n type=\"text\"\n [field]=\"false\"\n [placeholder]=\"'formula-builder.custom-value'\"\n style=\"width: 100%\"\n ></mt-text-field>\n <p-inputgroup-addon>\n <mt-button\n class=\"\"\n type=\"button\"\n (click)=\"onAddValue(customInput)\"\n [disabled]=\"disabled() || !customInput.value()\"\n label=\"\"\n icon=\"general.plus\"\n ></mt-button>\n </p-inputgroup-addon>\n </p-input-group>\n </div>\n </div>\n }\n <div>\n <label for=\"configuration\" translate>formula-builder.formula</label>\n <div\n dir=\"ltr\"\n cdkDropList=\"\"\n cdkDropListOrientation=\"mixed\"\n [cdkDropListData]=\"formula()\"\n (cdkDropListDropped)=\"drop($event)\"\n [cdkDropListDisabled]=\"disabled()\"\n class=\"flex flex-wrap gap-1 rounded-lg border-1 border-gray-500 bg-gray-50 p-2 formula-preview\"\n >\n @for (item of formula(); track item; let i = $index) {\n <p-chip\n [style]=\"{\n background: types[item.type]?.bg ?? 'var(--p-gary-50)',\n borderColor: types[item.type]?.border ?? 'var(--p-gary-500)',\n }\"\n styleClass=\"text-black-alpha-90 border-1 border-round cursor-grab\"\n [label]=\"item.name\"\n [removable]=\"!disabled()\"\n (onRemove)=\"onRemove(i)\"\n [cdkDragDisabled]=\"disabled()\"\n cdkDrag=\"\"\n ></p-chip>\n }\n </div>\n </div>\n</div>\n", styles: [":host .formula-preview{border-color:var(--p-gray-500);min-height:60px}:host.ng-valid .formula-preview{border-color:var(--p-green-500)}:host.ng-invalid .formula-preview{border-color:var(--p-red-500)}:host ::ng-deep .cdk-drop-list{display:flex}:host ::ng-deep .cdk-drag-preview{box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f;z-index:1000}:host ::ng-deep .cdk-drag-placeholder{opacity:.5}:host ::ng-deep .cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}:host ::ng-deep .formula-preview.cdk-drop-list-dragging .formula-preview:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}::ng-deep .p-inputgroupaddon:first-child .p-inputtext,::ng-deep .p-inputgroup>mt-text-field:first-child .p-inputtext{height:100%;width:100%;border-radius:0;border-start-start-radius:var(--p-inputgroup-addon-border-radius);border-end-start-radius:var(--p-inputgroup-addon-border-radius)}::ng-deep .p-inputgroupaddon:first-child,::ng-deep .p-inputgroup>p-autocomplete:first-child{width:100%}::ng-deep .p-inputgroupaddon:first-child>div,::ng-deep .p-inputgroup>p-autocomplete:first-child>div{width:100%;height:100%}::ng-deep .p-inputgroupaddon:first-child>div ul,::ng-deep .p-inputgroup>p-autocomplete:first-child>div ul{border-radius:0;border-start-start-radius:var(--p-inputgroup-addon-border-radius);border-end-start-radius:var(--p-inputgroup-addon-border-radius)}\n"] }]
353
- }], propDecorators: { hideTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideTitle", required: false }] }], properties: [{ type: i0.Input, args: [{ isSignal: true, alias: "properties", required: false }] }], validationUrl: [{ type: i0.Input, args: [{ isSignal: true, alias: "validationUrl", required: false }] }] } });
354
-
355
- /**
356
- * Generated bundle index. Do not edit.
357
- */
358
-
359
- export { FormulaBuilder };
360
- //# sourceMappingURL=masterteam-components-formula-builder.mjs.map