@foxeltech/angular-ui 0.3.0 → 0.4.0

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 (54) hide show
  1. package/fesm2022/foxeltech-angular-ui-chart.mjs +392 -0
  2. package/fesm2022/foxeltech-angular-ui-chart.mjs.map +1 -0
  3. package/fesm2022/foxeltech-angular-ui-flow.mjs +38 -0
  4. package/fesm2022/foxeltech-angular-ui-flow.mjs.map +1 -0
  5. package/fesm2022/foxeltech-angular-ui-rich-text.mjs +156 -0
  6. package/fesm2022/foxeltech-angular-ui-rich-text.mjs.map +1 -0
  7. package/fesm2022/foxeltech-angular-ui.mjs +890 -1499
  8. package/fesm2022/foxeltech-angular-ui.mjs.map +1 -1
  9. package/fx-icons.svg +97 -0
  10. package/package.json +23 -16
  11. package/src/lib/styles/tailwind.css +0 -1
  12. package/src/lib/ui/components/button/button.component.html +14 -14
  13. package/src/lib/ui/components/checkbox/checkbox.component.html +2 -2
  14. package/src/lib/ui/components/circle-progress-bar/circle-progress-bar.component.html +2 -2
  15. package/src/lib/ui/components/datetime-picker/datetime-picker.component.html +54 -28
  16. package/src/lib/ui/components/datetime-picker/datetime-picker.component.scss +25 -137
  17. package/src/lib/ui/components/dnd-upload/dnd-upload.component.html +3 -3
  18. package/src/lib/ui/components/drawer/drawer.component.html +75 -61
  19. package/src/lib/ui/components/empty-state/empty-state.component.html +2 -2
  20. package/src/lib/ui/components/hero-icon/hero-icon.component.html +10 -9
  21. package/src/lib/ui/components/info-field/info-field.component.html +1 -1
  22. package/src/lib/ui/components/input/input.component.html +6 -6
  23. package/src/lib/ui/components/kanban-board/kanban-board.component.html +1 -1
  24. package/src/lib/ui/components/loading-panel/loading-panel.component.html +53 -53
  25. package/src/lib/ui/components/master-detail/master-detail.component.html +9 -9
  26. package/src/lib/ui/components/menu/menu.component.html +27 -0
  27. package/src/lib/ui/components/radio-button/radio-button.component.html +26 -26
  28. package/src/lib/ui/components/radio-button-toggle/radio-button-toggle.component.html +3 -3
  29. package/src/lib/ui/components/search-bar/search-bar.component.html +12 -11
  30. package/src/lib/ui/components/section-card/section-card.component.html +1 -1
  31. package/src/lib/ui/components/select/select.component.html +14 -12
  32. package/src/lib/ui/components/skeleton-detail/skeleton-detail.component.html +2 -2
  33. package/src/lib/ui/components/skeleton-list/skeleton-list.component.html +1 -1
  34. package/src/lib/ui/components/skeleton-table-loading/skeleton-table-loading.component.html +5 -5
  35. package/src/lib/ui/components/slider/slider.component.html +22 -20
  36. package/src/lib/ui/components/stat-cards/stat-cards.component.html +1 -1
  37. package/src/lib/ui/components/switch/switch.component.html +1 -1
  38. package/src/lib/ui/components/tab-group/tab-group.component.html +35 -32
  39. package/src/lib/ui/components/table-cell/table-cell.component.html +2 -2
  40. package/src/lib/ui/components/tag/tag.component.html +4 -4
  41. package/src/lib/ui/components/toast/toast.component.html +42 -40
  42. package/src/lib/ui/components/toast-container/toast-container.component.html +1 -0
  43. package/src/lib/ui/components/tree-diagram/tree-diagram.component.html +22 -20
  44. package/tailwind.css +0 -1
  45. package/types/foxeltech-angular-ui-chart.d.ts +53 -0
  46. package/types/foxeltech-angular-ui-flow.d.ts +14 -0
  47. package/types/foxeltech-angular-ui-rich-text.d.ts +35 -0
  48. package/{index.d.ts → types/foxeltech-angular-ui.d.ts} +394 -387
  49. package/src/lib/ui/components/chart/chart.component.html +0 -20
  50. package/src/lib/ui/components/chart/chart.component.scss +0 -49
  51. package/src/lib/ui/components/flow-connection/flow-connection.component.html +0 -10
  52. package/src/lib/ui/components/flow-connection/flow-connection.component.scss +0 -0
  53. package/src/lib/ui/components/rich-text-area/rich-text-area.component.html +0 -3
  54. package/src/lib/ui/components/rich-text-area/rich-text-area.component.scss +0 -18
@@ -9,7 +9,7 @@
9
9
  [style.pointerEvents]="canScrollLeft ? 'auto' : 'none'"
10
10
  [attr.tabindex]="canScrollLeft ? null : -1"
11
11
  [attr.aria-hidden]="!canScrollLeft"
12
- >
12
+ >
13
13
  <svg
14
14
  aria-hidden="true"
15
15
  xmlns="http://www.w3.org/2000/svg"
@@ -17,7 +17,7 @@
17
17
  fill="none"
18
18
  viewBox="0 0 24 24"
19
19
  stroke="currentColor"
20
- >
20
+ >
21
21
  <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7" />
22
22
  </svg>
23
23
  </button>
@@ -27,38 +27,39 @@
27
27
  role="tablist"
28
28
  class="relative flex overflow-x-auto no-scrollbar scroll-smooth"
29
29
  (scroll)="onScroll()"
30
- >
31
- <button
32
- *ngFor="let tab of tabs.toArray(); let i = index"
33
- type="button"
34
- role="tab"
35
- [attr.aria-selected]="i === activeIndex"
36
- [tabindex]="i === activeIndex ? 0 : -1"
37
- (click)="selectTab(i)"
38
- (keydown)="onTabKeydown($event, i)"
39
- class="tab-btn tab-bar-btn"
40
30
  >
41
- <div class="flex flex-row items-center justify-center">
42
- @if (tab.icon) {
43
- <fx-ui-hero-icon
44
- [icon]="tab.icon"
45
- [size]="20"
46
- class="flex mr-[2px]"
31
+ @for (tab of tabs(); track tab; let i = $index) {
32
+ <button
33
+ type="button"
34
+ role="tab"
35
+ [attr.aria-selected]="i === activeIndex"
36
+ [tabindex]="i === activeIndex ? 0 : -1"
37
+ (click)="selectTab(i)"
38
+ (keydown)="onTabKeydown($event, i)"
39
+ class="tab-btn tab-bar-btn"
40
+ >
41
+ <div class="flex flex-row items-center justify-center">
42
+ @if (tab.icon) {
43
+ <fx-ui-hero-icon
44
+ [icon]="tab.icon"
45
+ [size]="20"
46
+ class="flex mr-[2px]"
47
47
  [ngClass]="{
48
48
  'text-gradient-primary-start mb-small': i === activeIndex,
49
49
  'text-text-placeholder': i !== activeIndex,
50
50
  }"
51
- ></fx-ui-hero-icon>
52
- }
53
- <div
51
+ ></fx-ui-hero-icon>
52
+ }
53
+ <div
54
54
  [ngClass]="
55
55
  i === activeIndex ? 'txt-field-label text-gradient-primary-start' : 'txt-placeholder'
56
56
  "
57
- >
58
- {{ tab.label }}
57
+ >
58
+ {{ tab.label() }}
59
+ </div>
59
60
  </div>
60
- </div>
61
- </button>
61
+ </button>
62
+ }
62
63
 
63
64
  <span #underline class="underline" style="width: 0; transform: translateX(0)"></span>
64
65
  </div>
@@ -72,7 +73,7 @@
72
73
  [style.pointerEvents]="canScrollRight ? 'auto' : 'none'"
73
74
  [attr.tabindex]="canScrollRight ? null : -1"
74
75
  [attr.aria-hidden]="!canScrollRight"
75
- >
76
+ >
76
77
  <svg
77
78
  aria-hidden="true"
78
79
  xmlns="http://www.w3.org/2000/svg"
@@ -80,7 +81,7 @@
80
81
  fill="none"
81
82
  viewBox="0 0 24 24"
82
83
  stroke="currentColor"
83
- >
84
+ >
84
85
  <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
85
86
  </svg>
86
87
  </button>
@@ -88,9 +89,11 @@
88
89
 
89
90
  <!-- Tab content -->
90
91
  <div class="transition-all duration-300 ease-in-out mt-4">
91
- <ng-container *ngFor="let tab of tabs.toArray(); let i = index">
92
- <div *ngIf="i === activeIndex" role="tabpanel" class="animate-fadeIn">
93
- <ng-container *ngTemplateOutlet="tab.content"></ng-container>
94
- </div>
95
- </ng-container>
92
+ @for (tab of tabs(); track tab; let i = $index) {
93
+ @if (i === activeIndex) {
94
+ <div role="tabpanel" class="animate-fadeIn">
95
+ <ng-container *ngTemplateOutlet="tab.content()"></ng-container>
96
+ </div>
97
+ }
98
+ }
96
99
  </div>
@@ -1,7 +1,7 @@
1
- @if (!loading) {
1
+ @if (!loading()) {
2
2
  <div animate.enter="fade-in-animation" class="inline-block my-normal">
3
3
  <ng-content />
4
4
  </div>
5
5
  } @else {
6
- <div animate.enter="fade-in-animation" class="skeleton-load my-semi" [class]="skeletonClass"></div>
6
+ <div animate.enter="fade-in-animation" class="skeleton-load my-semi" [class]="skeletonClass()"></div>
7
7
  }
@@ -6,18 +6,18 @@
6
6
  [attr.role]="clicked.observed ? 'button' : null"
7
7
  [attr.tabindex]="clicked.observed ? 0 : null"
8
8
  [class]="
9
- `flex flex-row gap-small ${rounded ? 'tag-round' : 'tag-square'} tag-${type}${solid ? '-solid' : ''}${clicked.observed ? ' cursor-pointer focus-visible:ring-2 focus-visible:ring-primary/50' : ''}`
9
+ `flex flex-row gap-small ${rounded() ? 'tag-round' : 'tag-square'} tag-${type()}${solid() ? '-solid' : ''}${clicked.observed ? ' cursor-pointer focus-visible:ring-2 focus-visible:ring-primary/50' : ''}`
10
10
  "
11
11
  >
12
12
  @if (icon) {
13
13
  <fx-ui-hero-icon
14
- [class]="`flex txt-tag-${type} ${solid && type !== 'default' ? 'text-white' : ''}`"
14
+ [class]="`flex txt-tag-${type()} ${solid() && type() !== 'default' ? 'text-white' : ''}`"
15
15
  [icon]="icon"
16
16
  [size]="18"
17
17
  ></fx-ui-hero-icon>
18
18
  }
19
19
 
20
- <div [class]="`txt-tag-${type} ${solid && type !== 'default' ? 'text-white font-medium' : ''}`">
21
- {{ label }}
20
+ <div [class]="`txt-tag-${type()} ${solid() && type() !== 'default' ? 'text-white font-medium' : ''}`">
21
+ {{ label() }}
22
22
  </div>
23
23
  </div>
@@ -1,49 +1,51 @@
1
1
  <div
2
2
  animate.enter="horizontal-fade-in-animation"
3
3
  animate.leave="horizontal-fade-out-animation"
4
- [attr.role]="type === 'error' ? 'alert' : 'status'"
4
+ [attr.role]="type() === 'error' ? 'alert' : 'status'"
5
5
  class="flex border-l-[3px] items-center bg-bg-primary gap-semi min-w-[250px] max-w-[400px] px-large py-semi rounded shadow-lg transition-all duration-300 ease-in-out transform opacity-100 translate-y-0"
6
6
  [ngClass]="{
7
- 'border-success': type === 'success',
8
- 'border-critical': type === 'error',
9
- 'border-warning': type === 'warning',
10
- 'border-information': type === 'info'
7
+ 'border-success': type() === 'success',
8
+ 'border-critical': type() === 'error',
9
+ 'border-warning': type() === 'warning',
10
+ 'border-information': type() === 'info'
11
11
  }"
12
- >
12
+ >
13
13
  <div class="" aria-hidden="true">
14
- @switch (type) { @case('success') {
15
- <fx-ui-hero-icon
16
- icon="check-circle"
17
- [solid]="true"
18
- [size]="30"
19
- class="text-success"
20
- ></fx-ui-hero-icon>
21
- } @case('error') {
22
- <fx-ui-hero-icon
23
- icon="exclamation-circle"
24
- [solid]="true"
25
- [size]="30"
26
- class="text-critical"
27
- ></fx-ui-hero-icon>
28
- } @case('warning') {
29
- <fx-ui-hero-icon
30
- icon="exclamation-triangle"
31
- [solid]="true"
32
- [size]="30"
33
- class="text-warning"
34
- ></fx-ui-hero-icon>
35
- } @default {
36
- <fx-ui-hero-icon
37
- icon="information-circle"
38
- [solid]="true"
39
- [size]="30"
40
- class="text-information"
41
- ></fx-ui-hero-icon>
42
- } }
43
- </div>
14
+ @switch (type()) { @case('success') {
15
+ <fx-ui-hero-icon
16
+ icon="check-circle"
17
+ [solid]="true"
18
+ [size]="30"
19
+ class="text-success"
20
+ ></fx-ui-hero-icon>
21
+ } @case('error') {
22
+ <fx-ui-hero-icon
23
+ icon="exclamation-circle"
24
+ [solid]="true"
25
+ [size]="30"
26
+ class="text-critical"
27
+ ></fx-ui-hero-icon>
28
+ } @case('warning') {
29
+ <fx-ui-hero-icon
30
+ icon="exclamation-triangle"
31
+ [solid]="true"
32
+ [size]="30"
33
+ class="text-warning"
34
+ ></fx-ui-hero-icon>
35
+ } @default {
36
+ <fx-ui-hero-icon
37
+ icon="information-circle"
38
+ [solid]="true"
39
+ [size]="30"
40
+ class="text-information"
41
+ ></fx-ui-hero-icon>
42
+ } }
43
+ </div>
44
44
 
45
- <div class="flex flex-col">
46
- <strong *ngIf="title" class="txt-field-label">{{ title }}</strong>
47
- <p class="txt-default">{{ message }}</p>
45
+ <div class="flex flex-col">
46
+ @if (title) {
47
+ <strong class="txt-field-label">{{ title }}</strong>
48
+ }
49
+ <p class="txt-default">{{ message() }}</p>
50
+ </div>
48
51
  </div>
49
- </div>
@@ -4,6 +4,7 @@
4
4
  @for (toast of toasts; track toast) {
5
5
  <fx-ui-toast
6
6
  class="pointer-events-auto"
7
+ [toastId]="toast.id"
7
8
  [message]="toast.message"
8
9
  [title]="toast.title"
9
10
  [type]="toast.type"
@@ -4,20 +4,21 @@
4
4
  <div
5
5
  #root
6
6
  class="mx-auto w-fit bg-blue-600 text-white px-7 py-3 rounded-md font-semibold text-center"
7
- >
8
- {{ data.label }}
7
+ >
8
+ {{ data().label }}
9
9
  </div>
10
10
 
11
11
  <!-- CHILDREN -->
12
12
  <div class="mt-16 flex justify-center gap-16">
13
- <div
14
- *ngFor="let child of data.children"
15
- #child
16
- class="w-48 bg-rose-600 text-white px-4 py-4 rounded-lg text-center"
17
- >
18
- <div class="font-semibold text-lg">{{ child.label }}</div>
19
- <div class="mt-1 text-sm opacity-90">{{ child.status }}</div>
20
- </div>
13
+ @for (child of data().children; track child) {
14
+ <div
15
+ #child
16
+ class="w-48 bg-rose-600 text-white px-4 py-4 rounded-lg text-center"
17
+ >
18
+ <div class="font-semibold text-lg">{{ child.label }}</div>
19
+ <div class="mt-1 text-sm opacity-90">{{ child.status }}</div>
20
+ </div>
21
+ }
21
22
  </div>
22
23
 
23
24
  <!-- SVG CONNECTORS -->
@@ -25,16 +26,17 @@
25
26
  class="absolute inset-0 pointer-events-none"
26
27
  [attr.width]="svgWidth"
27
28
  [attr.height]="svgHeight"
28
- >
29
- <line
30
- *ngFor="let line of lines"
31
- [attr.x1]="line.x1"
32
- [attr.y1]="line.y1"
33
- [attr.x2]="line.x2"
34
- [attr.y2]="line.y2"
35
- stroke="#1f2937"
36
- stroke-width="2"
37
- />
29
+ >
30
+ @for (line of lines; track line) {
31
+ <line
32
+ [attr.x1]="line.x1"
33
+ [attr.y1]="line.y1"
34
+ [attr.x2]="line.x2"
35
+ [attr.y2]="line.y2"
36
+ stroke="#1f2937"
37
+ stroke-width="2"
38
+ />
39
+ }
38
40
  </svg>
39
41
 
40
42
  </div>
package/tailwind.css CHANGED
@@ -8,7 +8,6 @@
8
8
  @import './components.css' layer(components);
9
9
  @import './dialogs.css' layer(components);
10
10
  @import './animations.css';
11
- @import '@danielmoncada/angular-datetime-picker/assets/style/picker.min.css';
12
11
 
13
12
  html,
14
13
  body {
@@ -0,0 +1,53 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { OnChanges, AfterViewInit, OnDestroy, ElementRef, ChangeDetectorRef } from '@angular/core';
3
+ import { EChartsOption, ECharts } from 'echarts';
4
+
5
+ type IChartType = 'bar' | 'pie' | 'sunburst' | 'auto';
6
+ declare class ChartComponent implements OnChanges, AfterViewInit, OnDestroy {
7
+ private ref;
8
+ private cdr;
9
+ readonly type: _angular_core.InputSignal<IChartType>;
10
+ readonly data: _angular_core.InputSignal<any>;
11
+ readonly options: _angular_core.InputSignal<EChartsOption | undefined>;
12
+ readonly palette: _angular_core.InputSignal<string[] | undefined>;
13
+ readonly height: _angular_core.InputSignal<string>;
14
+ readonly loading: _angular_core.InputSignal<boolean>;
15
+ readonly pieLegendAlign: _angular_core.InputSignal<string | number>;
16
+ readonly pieLegendPosition: _angular_core.InputSignal<string | number>;
17
+ readonly showPieLabel: _angular_core.InputSignal<boolean>;
18
+ readonly mobileWidth: _angular_core.InputSignal<number>;
19
+ readonly labelFontFamily: _angular_core.InputSignal<string>;
20
+ readonly emptyText: _angular_core.InputSignal<string>;
21
+ readonly chartClick: _angular_core.OutputEmitterRef<any>;
22
+ readonly chartInit: _angular_core.OutputEmitterRef<ECharts>;
23
+ chartOptions: EChartsOption;
24
+ isEmpty: boolean;
25
+ labelFontSize: number;
26
+ private chartInstance?;
27
+ private resizeObserver?;
28
+ private intersectionObserver?;
29
+ private canInit;
30
+ private isMobile;
31
+ private containerWidth;
32
+ constructor(ref: ElementRef<HTMLElement>, cdr: ChangeDetectorRef);
33
+ ngAfterViewInit(): void;
34
+ ngOnChanges(): void;
35
+ ngOnDestroy(): void;
36
+ onThemeChange(): void;
37
+ onChartClick(event: any): void;
38
+ onChartInit(chart: any): void;
39
+ private updateResponsiveState;
40
+ private forceMediaRecalc;
41
+ private rebuildChart;
42
+ private checkEmpty;
43
+ private registry;
44
+ private calcPieLayout;
45
+ private detectType;
46
+ private buildOptions;
47
+ private resolvePalette;
48
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ChartComponent, never>;
49
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ChartComponent, "fx-ui-chart", never, { "type": { "alias": "type"; "required": false; "isSignal": true; }; "data": { "alias": "data"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "palette": { "alias": "palette"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "pieLegendAlign": { "alias": "pieLegendAlign"; "required": false; "isSignal": true; }; "pieLegendPosition": { "alias": "pieLegendPosition"; "required": false; "isSignal": true; }; "showPieLabel": { "alias": "showPieLabel"; "required": false; "isSignal": true; }; "mobileWidth": { "alias": "mobileWidth"; "required": false; "isSignal": true; }; "labelFontFamily": { "alias": "labelFontFamily"; "required": false; "isSignal": true; }; "emptyText": { "alias": "emptyText"; "required": false; "isSignal": true; }; }, { "chartClick": "chartClick"; "chartInit": "chartInit"; }, never, never, true, never>;
50
+ }
51
+
52
+ export { ChartComponent };
53
+ export type { IChartType };
@@ -0,0 +1,14 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { Node, Edge, Connection } from 'ngx-vflow';
3
+
4
+ declare class FlowConnection {
5
+ readonly nodes: _angular_core.InputSignal<Node[]>;
6
+ edges: Edge[];
7
+ readonly backgroundColor: _angular_core.InputSignal<any>;
8
+ readonly view: _angular_core.InputSignal<any>;
9
+ handleConnection(connection: Connection): void;
10
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<FlowConnection, never>;
11
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<FlowConnection, "fx-ui-flow-connection", never, { "nodes": { "alias": "nodes"; "required": false; "isSignal": true; }; "edges": { "alias": "edges"; "required": false; }; "backgroundColor": { "alias": "backgroundColor"; "required": false; "isSignal": true; }; "view": { "alias": "view"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
12
+ }
13
+
14
+ export { FlowConnection };
@@ -0,0 +1,35 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { AfterViewInit, ElementRef } from '@angular/core';
3
+ import { FxComponent } from '@foxeltech/angular-ui';
4
+
5
+ declare class QuillStyleLoaderService {
6
+ private platformId;
7
+ private loaded;
8
+ private loadingPromise;
9
+ constructor(platformId: object);
10
+ /**
11
+ * Load Quill CSS (only in browser). Returns a promise that resolves when
12
+ * the CSS links have been appended.
13
+ */
14
+ load(): Promise<void>;
15
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<QuillStyleLoaderService, never>;
16
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<QuillStyleLoaderService>;
17
+ }
18
+
19
+ declare class RichTextAreaComponent extends FxComponent<any> implements AfterViewInit {
20
+ private styleLoader;
21
+ private platformId;
22
+ readonly editorContainer: _angular_core.Signal<ElementRef<HTMLDivElement>>;
23
+ readonly placeholder: _angular_core.InputSignal<string>;
24
+ readonly toolbarOptions: _angular_core.InputSignal<any>;
25
+ readonly contentChange: _angular_core.OutputEmitterRef<string>;
26
+ private quillInstance;
27
+ constructor(styleLoader: QuillStyleLoaderService, platformId: object);
28
+ ngAfterViewInit(): Promise<void>;
29
+ writeValue(value: any): void;
30
+ setDisabledState(isDisabled: boolean): void;
31
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<RichTextAreaComponent, never>;
32
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<RichTextAreaComponent, "fx-ui-rich-text-area", never, { "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "toolbarOptions": { "alias": "toolbarOptions"; "required": false; "isSignal": true; }; }, { "contentChange": "contentChange"; }, never, never, true, never>;
33
+ }
34
+
35
+ export { QuillStyleLoaderService, RichTextAreaComponent };