dasar-ui 1.1.0 → 1.3.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.
- package/README.md +19 -14
- package/fesm2022/dasar-ui.mjs +9664 -0
- package/fesm2022/dasar-ui.mjs.map +1 -0
- package/package.json +39 -42
- package/types/dasar-ui.d.ts +2114 -0
- package/.editorconfig +0 -17
- package/.nvmrc +0 -1
- package/.prettierrc +0 -12
- package/.vscode/extensions.json +0 -4
- package/.vscode/launch.json +0 -20
- package/.vscode/settings.json +0 -4
- package/.vscode/tasks.json +0 -42
- package/CHANGELOG.md +0 -18
- package/angular.json +0 -37
- package/projects/dasar-ui/README.md +0 -64
- package/projects/dasar-ui/ng-package.json +0 -10
- package/projects/dasar-ui/package.json +0 -27
- package/projects/dasar-ui/src/lib/components/dasar-button/dasar-button.html +0 -9
- package/projects/dasar-ui/src/lib/components/dasar-button/dasar-button.scss +0 -352
- package/projects/dasar-ui/src/lib/components/dasar-button/dasar-button.spec.ts +0 -21
- package/projects/dasar-ui/src/lib/components/dasar-button/dasar-button.ts +0 -154
- package/projects/dasar-ui/src/lib/components/dasar-button-group/dasar-button-group.html +0 -1
- package/projects/dasar-ui/src/lib/components/dasar-button-group/dasar-button-group.scss +0 -69
- package/projects/dasar-ui/src/lib/components/dasar-button-group/dasar-button-group.spec.ts +0 -21
- package/projects/dasar-ui/src/lib/components/dasar-button-group/dasar-button-group.ts +0 -30
- package/projects/dasar-ui/src/lib/components/dasar-calendar/dasar-calendar.html +0 -158
- package/projects/dasar-ui/src/lib/components/dasar-calendar/dasar-calendar.scss +0 -371
- package/projects/dasar-ui/src/lib/components/dasar-calendar/dasar-calendar.spec.ts +0 -21
- package/projects/dasar-ui/src/lib/components/dasar-calendar/dasar-calendar.ts +0 -458
- package/projects/dasar-ui/src/lib/components/dasar-card/dasar-card.html +0 -80
- package/projects/dasar-ui/src/lib/components/dasar-card/dasar-card.scss +0 -184
- package/projects/dasar-ui/src/lib/components/dasar-card/dasar-card.spec.ts +0 -21
- package/projects/dasar-ui/src/lib/components/dasar-card/dasar-card.ts +0 -294
- package/projects/dasar-ui/src/lib/components/dasar-chip/dasar-chip.html +0 -42
- package/projects/dasar-ui/src/lib/components/dasar-chip/dasar-chip.scss +0 -38
- package/projects/dasar-ui/src/lib/components/dasar-chip/dasar-chip.ts +0 -207
- package/projects/dasar-ui/src/lib/components/dasar-datepicker/dasar-datepicker.html +0 -102
- package/projects/dasar-ui/src/lib/components/dasar-datepicker/dasar-datepicker.scss +0 -301
- package/projects/dasar-ui/src/lib/components/dasar-datepicker/dasar-datepicker.spec.ts +0 -21
- package/projects/dasar-ui/src/lib/components/dasar-datepicker/dasar-datepicker.ts +0 -527
- package/projects/dasar-ui/src/lib/components/dasar-icon/dasar-icon.html +0 -1
- package/projects/dasar-ui/src/lib/components/dasar-icon/dasar-icon.registry.ts +0 -5089
- package/projects/dasar-ui/src/lib/components/dasar-icon/dasar-icon.scss +0 -24
- package/projects/dasar-ui/src/lib/components/dasar-icon/dasar-icon.spec.ts +0 -21
- package/projects/dasar-ui/src/lib/components/dasar-icon/dasar-icon.ts +0 -97
- package/projects/dasar-ui/src/lib/components/dasar-input/dasar-input.html +0 -54
- package/projects/dasar-ui/src/lib/components/dasar-input/dasar-input.scss +0 -281
- package/projects/dasar-ui/src/lib/components/dasar-input/dasar-input.spec.ts +0 -21
- package/projects/dasar-ui/src/lib/components/dasar-input/dasar-input.ts +0 -323
- package/projects/dasar-ui/src/lib/components/dasar-menu/dasar-menu.html +0 -63
- package/projects/dasar-ui/src/lib/components/dasar-menu/dasar-menu.scss +0 -195
- package/projects/dasar-ui/src/lib/components/dasar-menu/dasar-menu.spec.ts +0 -21
- package/projects/dasar-ui/src/lib/components/dasar-menu/dasar-menu.ts +0 -240
- package/projects/dasar-ui/src/lib/components/dasar-number-input/dasar-number-input.html +0 -90
- package/projects/dasar-ui/src/lib/components/dasar-number-input/dasar-number-input.scss +0 -358
- package/projects/dasar-ui/src/lib/components/dasar-number-input/dasar-number-input.spec.ts +0 -21
- package/projects/dasar-ui/src/lib/components/dasar-number-input/dasar-number-input.ts +0 -337
- package/projects/dasar-ui/src/lib/components/dasar-pagination/dasar-pagination.html +0 -98
- package/projects/dasar-ui/src/lib/components/dasar-pagination/dasar-pagination.scss +0 -51
- package/projects/dasar-ui/src/lib/components/dasar-pagination/dasar-pagination.spec.ts +0 -21
- package/projects/dasar-ui/src/lib/components/dasar-pagination/dasar-pagination.ts +0 -99
- package/projects/dasar-ui/src/lib/components/dasar-pin/dasar-pin.css +0 -0
- package/projects/dasar-ui/src/lib/components/dasar-pin/dasar-pin.html +0 -1
- package/projects/dasar-ui/src/lib/components/dasar-pin/dasar-pin.spec.ts +0 -21
- package/projects/dasar-ui/src/lib/components/dasar-pin/dasar-pin.ts +0 -9
- package/projects/dasar-ui/src/lib/components/dasar-pivot-table/dasar-pivot-table.html +0 -163
- package/projects/dasar-ui/src/lib/components/dasar-pivot-table/dasar-pivot-table.scss +0 -283
- package/projects/dasar-ui/src/lib/components/dasar-pivot-table/dasar-pivot-table.ts +0 -230
- package/projects/dasar-ui/src/lib/components/dasar-radio/dasar-radio.css +0 -0
- package/projects/dasar-ui/src/lib/components/dasar-radio/dasar-radio.html +0 -1
- package/projects/dasar-ui/src/lib/components/dasar-radio/dasar-radio.spec.ts +0 -21
- package/projects/dasar-ui/src/lib/components/dasar-radio/dasar-radio.ts +0 -9
- package/projects/dasar-ui/src/lib/components/dasar-select/dasar-select.html +0 -185
- package/projects/dasar-ui/src/lib/components/dasar-select/dasar-select.scss +0 -347
- package/projects/dasar-ui/src/lib/components/dasar-select/dasar-select.spec.ts +0 -21
- package/projects/dasar-ui/src/lib/components/dasar-select/dasar-select.ts +0 -497
- package/projects/dasar-ui/src/lib/components/dasar-slider/dasar-slider.css +0 -0
- package/projects/dasar-ui/src/lib/components/dasar-slider/dasar-slider.html +0 -1
- package/projects/dasar-ui/src/lib/components/dasar-slider/dasar-slider.spec.ts +0 -21
- package/projects/dasar-ui/src/lib/components/dasar-slider/dasar-slider.ts +0 -9
- package/projects/dasar-ui/src/lib/components/dasar-table/dasar-table.html +0 -162
- package/projects/dasar-ui/src/lib/components/dasar-table/dasar-table.scss +0 -283
- package/projects/dasar-ui/src/lib/components/dasar-table/dasar-table.spec.ts +0 -21
- package/projects/dasar-ui/src/lib/components/dasar-table/dasar-table.ts +0 -380
- package/projects/dasar-ui/src/lib/components/dasar-tabs/dasar-tabs.html +0 -41
- package/projects/dasar-ui/src/lib/components/dasar-tabs/dasar-tabs.scss +0 -126
- package/projects/dasar-ui/src/lib/components/dasar-tabs/dasar-tabs.spec.ts +0 -21
- package/projects/dasar-ui/src/lib/components/dasar-tabs/dasar-tabs.ts +0 -72
- package/projects/dasar-ui/src/lib/components/dasar-textarea/dasar-textarea.html +0 -43
- package/projects/dasar-ui/src/lib/components/dasar-textarea/dasar-textarea.scss +0 -189
- package/projects/dasar-ui/src/lib/components/dasar-textarea/dasar-textarea.spec.ts +0 -21
- package/projects/dasar-ui/src/lib/components/dasar-textarea/dasar-textarea.ts +0 -139
- package/projects/dasar-ui/src/lib/components/dasar-theme-provider/dasar-theme-provider.ts +0 -286
- package/projects/dasar-ui/src/lib/components/dasar-toast/dasar-toast.css +0 -0
- package/projects/dasar-ui/src/lib/components/dasar-toast/dasar-toast.html +0 -1
- package/projects/dasar-ui/src/lib/components/dasar-toast/dasar-toast.spec.ts +0 -21
- package/projects/dasar-ui/src/lib/components/dasar-toast/dasar-toast.ts +0 -9
- package/projects/dasar-ui/src/lib/components/dasar-toggle/dasar-toggle.css +0 -0
- package/projects/dasar-ui/src/lib/components/dasar-toggle/dasar-toggle.html +0 -1
- package/projects/dasar-ui/src/lib/components/dasar-toggle/dasar-toggle.spec.ts +0 -21
- package/projects/dasar-ui/src/lib/components/dasar-toggle/dasar-toggle.ts +0 -9
- package/projects/dasar-ui/src/lib/components/dasar-tooltip/dasar-tooltip.css +0 -0
- package/projects/dasar-ui/src/lib/components/dasar-tooltip/dasar-tooltip.html +0 -1
- package/projects/dasar-ui/src/lib/components/dasar-tooltip/dasar-tooltip.spec.ts +0 -21
- package/projects/dasar-ui/src/lib/components/dasar-tooltip/dasar-tooltip.ts +0 -9
- package/projects/dasar-ui/src/lib/models/theme.model.ts +0 -643
- package/projects/dasar-ui/src/lib/models/type.model.ts +0 -11
- package/projects/dasar-ui/src/lib/services/theme.service.ts +0 -643
- package/projects/dasar-ui/src/lib/styles/theme.ts +0 -70
- package/projects/dasar-ui/src/lib/utils/common.ts +0 -175
- package/projects/dasar-ui/src/public-api.ts +0 -23
- package/projects/dasar-ui/tsconfig.lib.json +0 -21
- package/projects/dasar-ui/tsconfig.lib.prod.json +0 -11
- package/projects/dasar-ui/tsconfig.spec.json +0 -11
- package/tsconfig.json +0 -37
- /package/{projects/dasar-ui/src/lib/styles → styles}/theme.scss +0 -0
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ViewEncapsulation,
|
|
3
|
-
booleanAttribute,
|
|
4
|
-
HostBinding,
|
|
5
|
-
Component,
|
|
6
|
-
inject,
|
|
7
|
-
Input,
|
|
8
|
-
} from '@angular/core';
|
|
9
|
-
import { CommonModule } from '@angular/common';
|
|
10
|
-
|
|
11
|
-
import { DASAR_THEME_PROVIDER } from '../dasar-theme-provider/dasar-theme-provider';
|
|
12
|
-
import { ClassType, ScaleAttributeType, StyleType } from '../../models/type.model';
|
|
13
|
-
import { parseClassesToArray, resolveThemeDefault } from '../../utils/common';
|
|
14
|
-
import { DasarThemeService } from '../../services/theme.service';
|
|
15
|
-
|
|
16
|
-
export type DasarButtonSizeType = Extract<ScaleAttributeType, 'xs' | 'sm' | 'md' | 'lg' | 'xl'>;
|
|
17
|
-
export type DasarButtonVariantType =
|
|
18
|
-
'primary' | 'success' | 'warning' | 'danger' | 'secondary' | 'ghost';
|
|
19
|
-
export type DasarButtonAppearanceType = 'solid' | 'subtle' | 'outline';
|
|
20
|
-
export type DasarButtonType = 'button' | 'submit' | 'reset';
|
|
21
|
-
export type DasarButtonRadiusType = ScaleAttributeType;
|
|
22
|
-
|
|
23
|
-
export interface DasarButtonConfig {
|
|
24
|
-
appearance?: DasarButtonAppearanceType;
|
|
25
|
-
variant?: DasarButtonVariantType;
|
|
26
|
-
radius?: DasarButtonRadiusType;
|
|
27
|
-
size?: DasarButtonSizeType;
|
|
28
|
-
buttonStyle?: StyleType;
|
|
29
|
-
buttonClass?: ClassType;
|
|
30
|
-
type?: DasarButtonType;
|
|
31
|
-
fullWidth?: boolean;
|
|
32
|
-
iconOnly?: boolean;
|
|
33
|
-
disabled?: boolean;
|
|
34
|
-
fluid?: boolean;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
@Component({
|
|
38
|
-
encapsulation: ViewEncapsulation.None,
|
|
39
|
-
styleUrls: ['./dasar-button.scss'],
|
|
40
|
-
templateUrl: './dasar-button.html',
|
|
41
|
-
selector: 'dasar-button',
|
|
42
|
-
imports: [CommonModule],
|
|
43
|
-
})
|
|
44
|
-
export class DasarButton {
|
|
45
|
-
private themeProvider = inject(DASAR_THEME_PROVIDER, { optional: true });
|
|
46
|
-
private themeService = inject(DasarThemeService, { optional: true });
|
|
47
|
-
|
|
48
|
-
@Input() appearance = resolveThemeDefault(
|
|
49
|
-
'button',
|
|
50
|
-
'appearance',
|
|
51
|
-
'solid',
|
|
52
|
-
this.themeProvider,
|
|
53
|
-
this.themeService,
|
|
54
|
-
);
|
|
55
|
-
@Input() variant = resolveThemeDefault(
|
|
56
|
-
'button',
|
|
57
|
-
'variant',
|
|
58
|
-
'primary',
|
|
59
|
-
this.themeProvider,
|
|
60
|
-
this.themeService,
|
|
61
|
-
);
|
|
62
|
-
@Input() radius = resolveThemeDefault(
|
|
63
|
-
'button',
|
|
64
|
-
'radius',
|
|
65
|
-
'md',
|
|
66
|
-
this.themeProvider,
|
|
67
|
-
this.themeService,
|
|
68
|
-
);
|
|
69
|
-
@Input() size = resolveThemeDefault(
|
|
70
|
-
'button',
|
|
71
|
-
'size',
|
|
72
|
-
'md',
|
|
73
|
-
this.themeProvider,
|
|
74
|
-
this.themeService,
|
|
75
|
-
);
|
|
76
|
-
@Input({ alias: 'button-style' }) buttonStyle = resolveThemeDefault(
|
|
77
|
-
'button',
|
|
78
|
-
'buttonStyle',
|
|
79
|
-
null,
|
|
80
|
-
this.themeProvider,
|
|
81
|
-
this.themeService,
|
|
82
|
-
);
|
|
83
|
-
@Input({ alias: 'button-class' }) buttonClass = resolveThemeDefault(
|
|
84
|
-
'button',
|
|
85
|
-
'buttonClass',
|
|
86
|
-
null,
|
|
87
|
-
this.themeProvider,
|
|
88
|
-
this.themeService,
|
|
89
|
-
);
|
|
90
|
-
@Input() type = resolveThemeDefault(
|
|
91
|
-
'button',
|
|
92
|
-
'type',
|
|
93
|
-
'button',
|
|
94
|
-
this.themeProvider,
|
|
95
|
-
this.themeService,
|
|
96
|
-
);
|
|
97
|
-
@Input({ transform: booleanAttribute }) disabled = resolveThemeDefault(
|
|
98
|
-
'button',
|
|
99
|
-
'iconOnly',
|
|
100
|
-
false,
|
|
101
|
-
this.themeProvider,
|
|
102
|
-
this.themeService,
|
|
103
|
-
);
|
|
104
|
-
@Input({ transform: booleanAttribute }) fluid = resolveThemeDefault(
|
|
105
|
-
'button',
|
|
106
|
-
'fluid',
|
|
107
|
-
false,
|
|
108
|
-
this.themeProvider,
|
|
109
|
-
this.themeService,
|
|
110
|
-
);
|
|
111
|
-
@Input({ alias: 'full-width', transform: booleanAttribute }) fullWidth = resolveThemeDefault(
|
|
112
|
-
'button',
|
|
113
|
-
'fullWidth',
|
|
114
|
-
false,
|
|
115
|
-
this.themeProvider,
|
|
116
|
-
this.themeService,
|
|
117
|
-
);
|
|
118
|
-
@Input({ alias: 'icon-only', transform: booleanAttribute }) iconOnly = resolveThemeDefault(
|
|
119
|
-
'button',
|
|
120
|
-
'iconOnly',
|
|
121
|
-
false,
|
|
122
|
-
this.themeProvider,
|
|
123
|
-
this.themeService,
|
|
124
|
-
);
|
|
125
|
-
|
|
126
|
-
@HostBinding('class')
|
|
127
|
-
get hostClasses(): string {
|
|
128
|
-
const classes = ['dasar-button'];
|
|
129
|
-
if (this.fullWidth) classes.push('full-width');
|
|
130
|
-
if (this.disabled) classes.push('disabled');
|
|
131
|
-
return classes.join(' ');
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
get buttonClasses(): Record<string, boolean> {
|
|
135
|
-
const overrideClass = parseClassesToArray(this.buttonClass);
|
|
136
|
-
const baseClass = {
|
|
137
|
-
[this.appearance]: this.appearance !== 'solid',
|
|
138
|
-
[`radius-${this.radius}`]: !!this.radius,
|
|
139
|
-
[`size-${this.size}`]: true,
|
|
140
|
-
[this.variant]: true,
|
|
141
|
-
'icon-only': this.iconOnly,
|
|
142
|
-
fluid: this.fluid,
|
|
143
|
-
};
|
|
144
|
-
if (overrideClass && overrideClass?.length > 0) {
|
|
145
|
-
return {
|
|
146
|
-
...baseClass,
|
|
147
|
-
...Object.fromEntries(overrideClass.map((name) => [name, true])),
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
return baseClass;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
export const DasarButtonComponent = [DasarButton] as const;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<ng-content></ng-content>
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
@use '../../styles/theme.scss' as *;
|
|
2
|
-
|
|
3
|
-
:host {
|
|
4
|
-
display: inline-flex;
|
|
5
|
-
vertical-align: middle;
|
|
6
|
-
|
|
7
|
-
&.vertical {
|
|
8
|
-
flex-direction: column;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
&.attached {
|
|
12
|
-
&.horizontal {
|
|
13
|
-
dasar-button {
|
|
14
|
-
&:not(:first-child) {
|
|
15
|
-
margin-left: -1px;
|
|
16
|
-
.dasar-button-native {
|
|
17
|
-
border-top-left-radius: 0 !important;
|
|
18
|
-
border-bottom-left-radius: 0 !important;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
&:not(:last-child) {
|
|
23
|
-
.dasar-button-native {
|
|
24
|
-
border-top-right-radius: 0 !important;
|
|
25
|
-
border-bottom-right-radius: 0 !important;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
&:hover,
|
|
30
|
-
&:focus-within {
|
|
31
|
-
position: relative;
|
|
32
|
-
z-index: 2;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
&.vertical {
|
|
38
|
-
dasar-button {
|
|
39
|
-
&:not(:first-child) {
|
|
40
|
-
margin-top: -1px;
|
|
41
|
-
.dasar-button-native {
|
|
42
|
-
border-top-left-radius: 0 !important;
|
|
43
|
-
border-top-right-radius: 0 !important;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
&:not(:last-child) {
|
|
48
|
-
.dasar-button-native {
|
|
49
|
-
border-bottom-left-radius: 0 !important;
|
|
50
|
-
border-bottom-right-radius: 0 !important;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
&:hover,
|
|
55
|
-
&:focus-within {
|
|
56
|
-
position: relative;
|
|
57
|
-
z-index: 2;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
&:not(.attached) {
|
|
64
|
-
gap: 8px;
|
|
65
|
-
&.vertical {
|
|
66
|
-
flex-direction: column;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
import { DasarButtonGroup } from './dasar-button-group';
|
|
3
|
-
|
|
4
|
-
describe('DasarButtonGroup', () => {
|
|
5
|
-
let component: DasarButtonGroup;
|
|
6
|
-
let fixture: ComponentFixture<DasarButtonGroup>;
|
|
7
|
-
|
|
8
|
-
beforeEach(async () => {
|
|
9
|
-
await TestBed.configureTestingModule({
|
|
10
|
-
imports: [DasarButtonGroup],
|
|
11
|
-
}).compileComponents();
|
|
12
|
-
|
|
13
|
-
fixture = TestBed.createComponent(DasarButtonGroup);
|
|
14
|
-
component = fixture.componentInstance;
|
|
15
|
-
await fixture.whenStable();
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it('should create', () => {
|
|
19
|
-
expect(component).toBeTruthy();
|
|
20
|
-
});
|
|
21
|
-
});
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { booleanAttribute, Component, Input, ViewEncapsulation } from '@angular/core';
|
|
2
|
-
import { CommonModule } from '@angular/common';
|
|
3
|
-
|
|
4
|
-
export type DasarButtonGroupOrientationType = 'horizontal' | 'vertical';
|
|
5
|
-
|
|
6
|
-
@Component({
|
|
7
|
-
styleUrls: ['./dasar-button-group.scss'],
|
|
8
|
-
templateUrl: './dasar-button-group.html',
|
|
9
|
-
encapsulation: ViewEncapsulation.None,
|
|
10
|
-
selector: 'dasar-button-group',
|
|
11
|
-
imports: [CommonModule],
|
|
12
|
-
standalone: true,
|
|
13
|
-
// host: {
|
|
14
|
-
|
|
15
|
-
// }
|
|
16
|
-
// //dasar-button-native-group
|
|
17
|
-
})
|
|
18
|
-
export class DasarButtonGroup {
|
|
19
|
-
@Input() orientation: DasarButtonGroupOrientationType = 'horizontal';
|
|
20
|
-
@Input({ transform: booleanAttribute }) attached = true;
|
|
21
|
-
|
|
22
|
-
get buttonClasses(): Record<string, boolean> {
|
|
23
|
-
return {
|
|
24
|
-
'dasar-button-native-group': true,
|
|
25
|
-
horizontal: this.orientation === "vertical",
|
|
26
|
-
vertical: this.orientation === "vertical",
|
|
27
|
-
'attached': this.attached,
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
}
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
<div
|
|
2
|
-
class="dasar-calendar-container size-{{ size }} appearance-{{ appearance }} radius-{{
|
|
3
|
-
radius
|
|
4
|
-
}} variant-{{ variant }} "
|
|
5
|
-
[ngStyle]="containerStyle"
|
|
6
|
-
[ngClass]="containerClass"
|
|
7
|
-
>
|
|
8
|
-
@if (!hideHeader) {
|
|
9
|
-
@if (headerTemplate) {
|
|
10
|
-
<ng-container
|
|
11
|
-
*ngTemplateOutlet="headerTemplate.templateRef; context: { $implicit: this }"
|
|
12
|
-
></ng-container>
|
|
13
|
-
} @else {
|
|
14
|
-
<div class="calendar-header" [ngStyle]="headerStyle" [ngClass]="headerClass">
|
|
15
|
-
<div
|
|
16
|
-
class="header-title-wrapper"
|
|
17
|
-
(click)="variant != 'dashboard' ? toggleViewMode() : null"
|
|
18
|
-
>
|
|
19
|
-
<span class="current-month">
|
|
20
|
-
@if (viewMode === 'days') {
|
|
21
|
-
{{ currentMonthYear }}
|
|
22
|
-
} @else if (viewMode === 'months') {
|
|
23
|
-
{{ currentViewDate.getFullYear() }}
|
|
24
|
-
} @else {
|
|
25
|
-
Select Year
|
|
26
|
-
}
|
|
27
|
-
</span>
|
|
28
|
-
@if (variant != 'dashboard') {
|
|
29
|
-
<dasar-icon
|
|
30
|
-
[name]="viewMode === 'days' ? 'chevron-down' : 'chevron-up'"
|
|
31
|
-
class="header-chevron"
|
|
32
|
-
>
|
|
33
|
-
</dasar-icon>
|
|
34
|
-
}
|
|
35
|
-
</div>
|
|
36
|
-
@if (viewMode === 'days') {
|
|
37
|
-
<div class="header-actions">
|
|
38
|
-
@if (prevYearTemplate && variant === 'dashboard') {
|
|
39
|
-
<ng-container
|
|
40
|
-
*ngTemplateOutlet="prevYearTemplate.templateRef; context: { $implicit: this }"
|
|
41
|
-
></ng-container>
|
|
42
|
-
} @else if (variant === 'dashboard') {
|
|
43
|
-
<dasar-button size="sm" variant="ghost" icon-only (click)="changeYear(-1, $event)">
|
|
44
|
-
<dasar-icon name="arrow-left"></dasar-icon>
|
|
45
|
-
</dasar-button>
|
|
46
|
-
}
|
|
47
|
-
@if (prevMonthTemplate) {
|
|
48
|
-
<ng-container
|
|
49
|
-
*ngTemplateOutlet="prevMonthTemplate.templateRef; context: { $implicit: this }"
|
|
50
|
-
></ng-container>
|
|
51
|
-
} @else {
|
|
52
|
-
<dasar-button size="sm" variant="ghost" icon-only (click)="changeMonth(-1, $event)">
|
|
53
|
-
<dasar-icon name="chevron-left"></dasar-icon>
|
|
54
|
-
</dasar-button>
|
|
55
|
-
}
|
|
56
|
-
@if (todayTemplate && variant === 'dashboard') {
|
|
57
|
-
<ng-container
|
|
58
|
-
*ngTemplateOutlet="todayTemplate.templateRef; context: { $implicit: this }"
|
|
59
|
-
></ng-container>
|
|
60
|
-
} @else if (variant === 'dashboard') {
|
|
61
|
-
<dasar-button size="sm" variant="primary" (click)="goToToday($event)"
|
|
62
|
-
>Today</dasar-button
|
|
63
|
-
>
|
|
64
|
-
}
|
|
65
|
-
@if (nextMonthTemplate) {
|
|
66
|
-
<ng-container
|
|
67
|
-
*ngTemplateOutlet="nextMonthTemplate.templateRef; context: { $implicit: this }"
|
|
68
|
-
></ng-container>
|
|
69
|
-
} @else {
|
|
70
|
-
<dasar-button size="sm" variant="ghost" icon-only (click)="changeMonth(1, $event)">
|
|
71
|
-
<dasar-icon name="chevron-right"></dasar-icon>
|
|
72
|
-
</dasar-button>
|
|
73
|
-
}
|
|
74
|
-
@if (nextYearTemplate && variant === 'dashboard') {
|
|
75
|
-
<ng-container
|
|
76
|
-
*ngTemplateOutlet="nextYearTemplate.templateRef; context: { $implicit: this }"
|
|
77
|
-
></ng-container>
|
|
78
|
-
} @else if (variant === 'dashboard') {
|
|
79
|
-
<dasar-button size="sm" variant="ghost" icon-only (click)="changeYear(1, $event)">
|
|
80
|
-
<dasar-icon name="arrow-right"></dasar-icon>
|
|
81
|
-
</dasar-button>
|
|
82
|
-
}
|
|
83
|
-
</div>
|
|
84
|
-
}
|
|
85
|
-
</div>
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
@if (viewMode === 'days') {
|
|
89
|
-
<div class="calendar-grid-wrapper radius-{{ radius }}">
|
|
90
|
-
<div class="calendar-grid">
|
|
91
|
-
@if (variant === 'dropdown') {
|
|
92
|
-
@for (wd of localizedDropdownWeekdays; track wd) {
|
|
93
|
-
<div class="weekday-header">{{ wd }}</div>
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
@for (day of calendarDays; track day.date.getTime()) {
|
|
97
|
-
<div
|
|
98
|
-
class="day-cell"
|
|
99
|
-
[class.other-month]="!day.isCurrentMonth"
|
|
100
|
-
[class.selected]="day.isSelected"
|
|
101
|
-
(click)="selectDate(day, $event)"
|
|
102
|
-
>
|
|
103
|
-
@if (variant === 'dashboard') {
|
|
104
|
-
<div class="cell-top">
|
|
105
|
-
<div class="day-number" [class.today]="day.isToday">{{ day.dayNumber }}</div>
|
|
106
|
-
@if (day.weekdayStr) {
|
|
107
|
-
<div class="weekday-label">{{ day.weekdayStr }}</div>
|
|
108
|
-
}
|
|
109
|
-
</div>
|
|
110
|
-
@if (!hideFullDate) {
|
|
111
|
-
<div class="cell-content">{{ day.fullDateStr }}</div>
|
|
112
|
-
}
|
|
113
|
-
} @else {
|
|
114
|
-
<div class="day-number" [class.today]="day.isToday">
|
|
115
|
-
{{ day.dayNumber }}
|
|
116
|
-
</div>
|
|
117
|
-
}
|
|
118
|
-
</div>
|
|
119
|
-
}
|
|
120
|
-
</div>
|
|
121
|
-
</div>
|
|
122
|
-
}
|
|
123
|
-
@if (viewMode === 'months') {
|
|
124
|
-
<div class="picker-grid-wrapper radius-{{ radius }}">
|
|
125
|
-
<div class="picker-grid months-grid">
|
|
126
|
-
@for (m of monthsList; track m.index) {
|
|
127
|
-
<button
|
|
128
|
-
type="button"
|
|
129
|
-
class="picker-cell"
|
|
130
|
-
[class.selected]="m.index === currentViewDate.getMonth()"
|
|
131
|
-
(click)="selectMonth(m.index, $event)"
|
|
132
|
-
>
|
|
133
|
-
{{ m.name }}
|
|
134
|
-
</button>
|
|
135
|
-
}
|
|
136
|
-
</div>
|
|
137
|
-
</div>
|
|
138
|
-
}
|
|
139
|
-
@if (viewMode === 'years') {
|
|
140
|
-
<div class="picker-grid-wrapper radius-{{ radius }}">
|
|
141
|
-
<div class="picker-grid years-grid">
|
|
142
|
-
@for (y of yearsList; track y) {
|
|
143
|
-
<button
|
|
144
|
-
type="button"
|
|
145
|
-
class="picker-cell"
|
|
146
|
-
[class.selected]="y === currentViewDate.getFullYear()"
|
|
147
|
-
(click)="selectYear(y, $event)"
|
|
148
|
-
>
|
|
149
|
-
{{ y }}
|
|
150
|
-
</button>
|
|
151
|
-
}
|
|
152
|
-
</div>
|
|
153
|
-
</div>
|
|
154
|
-
}
|
|
155
|
-
@if (footerSlot) {
|
|
156
|
-
<ng-content select="[calendar-footer-slot]"></ng-content>
|
|
157
|
-
}
|
|
158
|
-
</div>
|