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,207 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Component,
|
|
3
|
-
Input,
|
|
4
|
-
Output,
|
|
5
|
-
EventEmitter,
|
|
6
|
-
booleanAttribute,
|
|
7
|
-
Directive,
|
|
8
|
-
TemplateRef,
|
|
9
|
-
ContentChild,
|
|
10
|
-
ViewEncapsulation,
|
|
11
|
-
ChangeDetectionStrategy,
|
|
12
|
-
ChangeDetectorRef,
|
|
13
|
-
inject,
|
|
14
|
-
HostBinding,
|
|
15
|
-
HostListener,
|
|
16
|
-
} from '@angular/core';
|
|
17
|
-
import { CommonModule } from '@angular/common';
|
|
18
|
-
|
|
19
|
-
import {
|
|
20
|
-
DasarButtonAppearanceType,
|
|
21
|
-
DasarButtonVariantType,
|
|
22
|
-
DasarButtonRadiusType,
|
|
23
|
-
DasarButtonComponent,
|
|
24
|
-
DasarButtonSizeType,
|
|
25
|
-
} from '../dasar-button/dasar-button';
|
|
26
|
-
import { DASAR_THEME_PROVIDER } from '../dasar-theme-provider/dasar-theme-provider';
|
|
27
|
-
import { DasarThemeService } from '../../services/theme.service';
|
|
28
|
-
import { ClassType, StyleType } from '../../models/type.model';
|
|
29
|
-
import { resolveThemeDefault } from '../../utils/common';
|
|
30
|
-
import { DasarIconComponent } from '../dasar-icon/dasar-icon';
|
|
31
|
-
|
|
32
|
-
export type DasarChipAppearanceType = DasarButtonAppearanceType;
|
|
33
|
-
export type DasarChipVariantType = DasarButtonVariantType;
|
|
34
|
-
|
|
35
|
-
export interface DasarChipConfig {
|
|
36
|
-
closeIconName?: string;
|
|
37
|
-
appearance?: DasarChipAppearanceType;
|
|
38
|
-
variant?: DasarChipVariantType;
|
|
39
|
-
iconName?: string;
|
|
40
|
-
radius?: DasarButtonRadiusType;
|
|
41
|
-
size?: DasarButtonSizeType;
|
|
42
|
-
label?: string;
|
|
43
|
-
removable?: boolean;
|
|
44
|
-
disabled?: boolean;
|
|
45
|
-
fluid?: boolean;
|
|
46
|
-
containerStyle?: StyleType;
|
|
47
|
-
contentStyle?: StyleType;
|
|
48
|
-
labelStyle?: StyleType;
|
|
49
|
-
containerClass?: ClassType;
|
|
50
|
-
contentClass?: ClassType;
|
|
51
|
-
labelClass?: ClassType;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
@Directive({ selector: '[chip-label-slot]', standalone: true })
|
|
55
|
-
export class DasarChipLabelSlot {}
|
|
56
|
-
@Directive({ selector: '[chip-close-slot]', standalone: true })
|
|
57
|
-
export class DasarChipCloseSlot {}
|
|
58
|
-
|
|
59
|
-
@Component({
|
|
60
|
-
imports: [CommonModule, DasarIconComponent, DasarButtonComponent],
|
|
61
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
62
|
-
encapsulation: ViewEncapsulation.None,
|
|
63
|
-
templateUrl: './dasar-chip.html',
|
|
64
|
-
styleUrls: ['./dasar-chip.scss'],
|
|
65
|
-
selector: 'dasar-chip',
|
|
66
|
-
standalone: true,
|
|
67
|
-
})
|
|
68
|
-
export class DasarChip {
|
|
69
|
-
private themeProvider = inject(DASAR_THEME_PROVIDER, { optional: true });
|
|
70
|
-
private themeService = inject(DasarThemeService, { optional: true });
|
|
71
|
-
private cdr = inject(ChangeDetectorRef);
|
|
72
|
-
|
|
73
|
-
@Input({ alias: 'close-icon-name' }) closeIconName = resolveThemeDefault(
|
|
74
|
-
'chip',
|
|
75
|
-
'closeIconName',
|
|
76
|
-
'x',
|
|
77
|
-
this.themeProvider,
|
|
78
|
-
this.themeService,
|
|
79
|
-
);
|
|
80
|
-
@Input() appearance = resolveThemeDefault(
|
|
81
|
-
'chip',
|
|
82
|
-
'appearance',
|
|
83
|
-
'solid',
|
|
84
|
-
this.themeProvider,
|
|
85
|
-
this.themeService,
|
|
86
|
-
);
|
|
87
|
-
@Input() variant = resolveThemeDefault(
|
|
88
|
-
'chip',
|
|
89
|
-
'variant',
|
|
90
|
-
'primary',
|
|
91
|
-
this.themeProvider,
|
|
92
|
-
this.themeService,
|
|
93
|
-
);
|
|
94
|
-
@Input({ alias: 'icon-name' }) iconName = resolveThemeDefault(
|
|
95
|
-
'chip',
|
|
96
|
-
'iconName',
|
|
97
|
-
undefined,
|
|
98
|
-
this.themeProvider,
|
|
99
|
-
this.themeService,
|
|
100
|
-
);
|
|
101
|
-
@Input() radius = resolveThemeDefault(
|
|
102
|
-
'chip',
|
|
103
|
-
'radius',
|
|
104
|
-
'md',
|
|
105
|
-
this.themeProvider,
|
|
106
|
-
this.themeService,
|
|
107
|
-
);
|
|
108
|
-
@Input() size = resolveThemeDefault('chip', 'size', 'xs', this.themeProvider, this.themeService);
|
|
109
|
-
@Input() label = resolveThemeDefault(
|
|
110
|
-
'chip',
|
|
111
|
-
'label',
|
|
112
|
-
undefined,
|
|
113
|
-
this.themeProvider,
|
|
114
|
-
this.themeService,
|
|
115
|
-
);
|
|
116
|
-
@Input({ alias: 'container-style' }) containerStyle = resolveThemeDefault(
|
|
117
|
-
'chip',
|
|
118
|
-
'containerStyle',
|
|
119
|
-
null,
|
|
120
|
-
this.themeProvider,
|
|
121
|
-
this.themeService,
|
|
122
|
-
);
|
|
123
|
-
@Input({ alias: 'content-style' }) contentStyle = resolveThemeDefault(
|
|
124
|
-
'chip',
|
|
125
|
-
'contentStyle',
|
|
126
|
-
null,
|
|
127
|
-
this.themeProvider,
|
|
128
|
-
this.themeService,
|
|
129
|
-
);
|
|
130
|
-
@Input({ alias: 'label-style' }) labelStyle = resolveThemeDefault(
|
|
131
|
-
'chip',
|
|
132
|
-
'labelStyle',
|
|
133
|
-
null,
|
|
134
|
-
this.themeProvider,
|
|
135
|
-
this.themeService,
|
|
136
|
-
);
|
|
137
|
-
@Input({ alias: 'container-class' }) containerClass = resolveThemeDefault(
|
|
138
|
-
'chip',
|
|
139
|
-
'containerClass',
|
|
140
|
-
null,
|
|
141
|
-
this.themeProvider,
|
|
142
|
-
this.themeService,
|
|
143
|
-
);
|
|
144
|
-
@Input({ alias: 'content-class' }) contentClass = resolveThemeDefault(
|
|
145
|
-
'chip',
|
|
146
|
-
'contentClass',
|
|
147
|
-
null,
|
|
148
|
-
this.themeProvider,
|
|
149
|
-
this.themeService,
|
|
150
|
-
);
|
|
151
|
-
@Input({ alias: 'label-class' }) labelClass = resolveThemeDefault(
|
|
152
|
-
'chip',
|
|
153
|
-
'labelClass',
|
|
154
|
-
null,
|
|
155
|
-
this.themeProvider,
|
|
156
|
-
this.themeService,
|
|
157
|
-
);
|
|
158
|
-
@Input({ transform: booleanAttribute }) removable = resolveThemeDefault(
|
|
159
|
-
'chip',
|
|
160
|
-
'removable',
|
|
161
|
-
false,
|
|
162
|
-
this.themeProvider,
|
|
163
|
-
this.themeService,
|
|
164
|
-
);
|
|
165
|
-
@Input({ transform: booleanAttribute }) disabled = resolveThemeDefault(
|
|
166
|
-
'chip',
|
|
167
|
-
'disabled',
|
|
168
|
-
false,
|
|
169
|
-
this.themeProvider,
|
|
170
|
-
this.themeService,
|
|
171
|
-
);
|
|
172
|
-
@Input({ transform: booleanAttribute }) fluid = resolveThemeDefault(
|
|
173
|
-
'chip',
|
|
174
|
-
'fluid',
|
|
175
|
-
false,
|
|
176
|
-
this.themeProvider,
|
|
177
|
-
this.themeService,
|
|
178
|
-
);
|
|
179
|
-
|
|
180
|
-
@ContentChild(DasarChipLabelSlot) labelSlot?: DasarChipLabelSlot;
|
|
181
|
-
@ContentChild(DasarChipCloseSlot) closeSlot?: DasarChipCloseSlot;
|
|
182
|
-
|
|
183
|
-
@Output() onClick = new EventEmitter<Event>();
|
|
184
|
-
@Output() onRemove = new EventEmitter<Event>();
|
|
185
|
-
|
|
186
|
-
@HostBinding('class.dasar-chip') readonly baseClass = true;
|
|
187
|
-
@HostListener('click', ['$event'])
|
|
188
|
-
onHostClick(event: MouseEvent) {
|
|
189
|
-
// stop the event from bubbling up to parent elements
|
|
190
|
-
event.stopPropagation();
|
|
191
|
-
// prevent default anchor/button behavior
|
|
192
|
-
event.preventDefault();
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
click(event: Event) {
|
|
196
|
-
if (this.disabled) return;
|
|
197
|
-
this.onClick.emit(event);
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
remove(event: Event) {
|
|
201
|
-
event.stopPropagation();
|
|
202
|
-
if (this.disabled) return;
|
|
203
|
-
this.onRemove.emit(event);
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
export const DasarChipComponent = [DasarChip, DasarChipLabelSlot, DasarChipCloseSlot] as const;
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
<div
|
|
2
|
-
class="dasar-datepicker-container"
|
|
3
|
-
[class.full-width]="fullWidth"
|
|
4
|
-
[class.disabled]="disabled"
|
|
5
|
-
[class.error]="error"
|
|
6
|
-
[class.fluid]="fluid"
|
|
7
|
-
[ngClass]="containerClass"
|
|
8
|
-
[ngStyle]="containerStyle"
|
|
9
|
-
>
|
|
10
|
-
@if (hasLabelRow) {
|
|
11
|
-
<div
|
|
12
|
-
class="dasar-datepicker-label-wrapper"
|
|
13
|
-
[ngClass]="labelWrapperClass"
|
|
14
|
-
[ngStyle]="labelWrapperStyle"
|
|
15
|
-
>
|
|
16
|
-
<div class="dasar-datepicker-label-content">
|
|
17
|
-
@if (labelSlot) {
|
|
18
|
-
<ng-content select="[label-slot]"></ng-content>
|
|
19
|
-
} @else if (label) {
|
|
20
|
-
{{ label }}
|
|
21
|
-
}
|
|
22
|
-
</div>
|
|
23
|
-
@if (extraLabelSlot) {
|
|
24
|
-
<div class="dasar-datepicker-extra-label-content">
|
|
25
|
-
<ng-content select="[extra-label-slot]"></ng-content>
|
|
26
|
-
</div>
|
|
27
|
-
}
|
|
28
|
-
</div>
|
|
29
|
-
}
|
|
30
|
-
<div
|
|
31
|
-
#triggerElement
|
|
32
|
-
class="dasar-datepicker-wrapper"
|
|
33
|
-
[ngClass]="wrapperClass"
|
|
34
|
-
[ngStyle]="wrapperStyle"
|
|
35
|
-
>
|
|
36
|
-
<div
|
|
37
|
-
class="dasar-datepicker-trigger appearance-{{ appearance }} size-{{ size }} radius-{{
|
|
38
|
-
radius
|
|
39
|
-
}}"
|
|
40
|
-
(click)="toggleDropdown($event)"
|
|
41
|
-
[class.has-value]="!!internalDate"
|
|
42
|
-
[class.active]="isOpen"
|
|
43
|
-
[ngClass]="triggerClass"
|
|
44
|
-
[ngStyle]="triggerStyle"
|
|
45
|
-
tabindex="0"
|
|
46
|
-
>
|
|
47
|
-
<ng-content select="[prefix-slot]"></ng-content>
|
|
48
|
-
<span class="value-text">{{ internalDate ? formattedDisplay : placeholder }}</span>
|
|
49
|
-
<div class="datepicker-actions">
|
|
50
|
-
@if (clearable && internalDate) {
|
|
51
|
-
<dasar-icon class="clear-icon" name="x" (click)="clearValue($event)"></dasar-icon>
|
|
52
|
-
}
|
|
53
|
-
<dasar-icon
|
|
54
|
-
[name]="type.includes('time') ? 'clock' : 'calendar'"
|
|
55
|
-
class="calendar-icon"
|
|
56
|
-
></dasar-icon>
|
|
57
|
-
</div>
|
|
58
|
-
</div>
|
|
59
|
-
@if (isOpen) {
|
|
60
|
-
<div
|
|
61
|
-
#dropdownElement
|
|
62
|
-
class="dasar-datepicker-dropdown radius-{{ radius }} placement-{{ placement }}"
|
|
63
|
-
[ngClass]="dropdownClass"
|
|
64
|
-
[ngStyle]="dropdownStyle"
|
|
65
|
-
>
|
|
66
|
-
<dasar-calendar
|
|
67
|
-
variant="dropdown"
|
|
68
|
-
(valueChange)="onCalendarSelect($event)"
|
|
69
|
-
(prevMonth)="onPrevMonthClick.emit()"
|
|
70
|
-
(nextMonth)="onNextMonthClick.emit()"
|
|
71
|
-
(prevYear)="onPrevYearClick.emit()"
|
|
72
|
-
(nextYear)="onNextYearClick.emit()"
|
|
73
|
-
[value-format]="valueFormat"
|
|
74
|
-
[(value)]="internalDate"
|
|
75
|
-
[locale]="locale"
|
|
76
|
-
>
|
|
77
|
-
@if (extraFooterSlot) {
|
|
78
|
-
<ng-content
|
|
79
|
-
ngProjectAs="[calendar-footer-slot]"
|
|
80
|
-
select="[extra-footer-slot]"
|
|
81
|
-
></ng-content>
|
|
82
|
-
}
|
|
83
|
-
</dasar-calendar>
|
|
84
|
-
</div>
|
|
85
|
-
}
|
|
86
|
-
</div>
|
|
87
|
-
@if (hasHintRow) {
|
|
88
|
-
<div
|
|
89
|
-
class="slot-wrapper hint-wrapper"
|
|
90
|
-
[class.disabled]="disabled"
|
|
91
|
-
[class.error]="error"
|
|
92
|
-
[ngClass]="hintWrapperClass"
|
|
93
|
-
[ngStyle]="hintWrapperStyle"
|
|
94
|
-
>
|
|
95
|
-
@if (hintSlot) {
|
|
96
|
-
<ng-content select="[hint-slot]"></ng-content>
|
|
97
|
-
} @else if (hint) {
|
|
98
|
-
{{ hint }}
|
|
99
|
-
}
|
|
100
|
-
</div>
|
|
101
|
-
}
|
|
102
|
-
</div>
|
|
@@ -1,301 +0,0 @@
|
|
|
1
|
-
@use '../../styles/theme.scss' as *;
|
|
2
|
-
|
|
3
|
-
.dasar-datepicker {
|
|
4
|
-
display: inline-flex;
|
|
5
|
-
flex-direction: column;
|
|
6
|
-
position: relative;
|
|
7
|
-
width: fit-content;
|
|
8
|
-
|
|
9
|
-
&.full-width {
|
|
10
|
-
width: 100%;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
&.disabled {
|
|
14
|
-
opacity: var(--datepicker-disabled-opacity, 0.6);
|
|
15
|
-
cursor: not-allowed;
|
|
16
|
-
|
|
17
|
-
.dasar-datepicker-trigger {
|
|
18
|
-
pointer-events: none;
|
|
19
|
-
background-color: var(--datepicker-disabled-bg, var(--theme-bg-hover-color));
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.dasar-datepicker-container {
|
|
25
|
-
display: inline-flex;
|
|
26
|
-
flex-direction: column;
|
|
27
|
-
gap: var(--datepicker-wrapper-gap, var(--space-1));
|
|
28
|
-
width: 100%;
|
|
29
|
-
|
|
30
|
-
&.fluid {
|
|
31
|
-
.dasar-datepicker-wrapper,
|
|
32
|
-
.dasar-datepicker-trigger,
|
|
33
|
-
.dasar-datepicker-label-wrapper,
|
|
34
|
-
.hint-wrapper {
|
|
35
|
-
border: none !important;
|
|
36
|
-
padding: 0 !important;
|
|
37
|
-
margin: 0 !important;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
&.error {
|
|
42
|
-
.dasar-datepicker-trigger {
|
|
43
|
-
border-color: var(--datepicker-error-border, var(--theme-danger-color)) !important;
|
|
44
|
-
|
|
45
|
-
&.open,
|
|
46
|
-
&:focus-within {
|
|
47
|
-
box-shadow: 0 0 0 3px var(--datepicker-error-focus-ring, var(--theme-danger-surface-color));
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.dasar-datepicker-label-wrapper {
|
|
54
|
-
display: flex;
|
|
55
|
-
justify-content: space-between;
|
|
56
|
-
align-items: flex-end;
|
|
57
|
-
font-weight: var(--datepicker-label-font-weight, var(--font-weight-medium));
|
|
58
|
-
color: var(--datepicker-label-color, var(--theme-text-primary-color));
|
|
59
|
-
margin-bottom: var(--datepicker-label-margin-bottom, var(--space-1));
|
|
60
|
-
line-height: var(--line-height-tight);
|
|
61
|
-
|
|
62
|
-
.dasar-datepicker-label-content {
|
|
63
|
-
font-size: var(--datepicker-label-font-size, var(--font-size-md));
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.dasar-datepicker-extra-label-content {
|
|
67
|
-
font-size: var(--datepicker-label-right-font-size, var(--font-size-sm));
|
|
68
|
-
font-weight: var(--datepicker-label-right-font-weight, var(--font-weight-regular));
|
|
69
|
-
color: var(--datepicker-label-right-color, var(--theme-text-secondary-color));
|
|
70
|
-
display: inline-flex;
|
|
71
|
-
align-items: center;
|
|
72
|
-
gap: var(--space-1);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.hint-wrapper {
|
|
77
|
-
font-size: var(--datepicker-hint-font-size, var(--font-size-xs));
|
|
78
|
-
color: var(--datepicker-hint-color, var(--theme-text-secondary-color));
|
|
79
|
-
margin-top: calc(var(--space-0-5) * -1);
|
|
80
|
-
line-height: var(--line-height-normal);
|
|
81
|
-
|
|
82
|
-
&.error {
|
|
83
|
-
color: var(--datepicker-hint-error-color, var(--theme-danger-color));
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
&.disabled {
|
|
87
|
-
opacity: var(--datepicker-disabled-opacity, 0.6);
|
|
88
|
-
cursor: not-allowed;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
.dasar-datepicker-wrapper {
|
|
93
|
-
flex-direction: column;
|
|
94
|
-
display: flex;
|
|
95
|
-
position: relative;
|
|
96
|
-
width: 100%;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.dasar-datepicker-trigger {
|
|
100
|
-
color: var(--datepicker-trigger-color, var(--theme-text-secondary-color));
|
|
101
|
-
border-radius: var(--datepicker-radius-sm, var(--radius-sm));
|
|
102
|
-
gap: var(--datepicker-gap, var(--space-base));
|
|
103
|
-
justify-content: space-between;
|
|
104
|
-
box-sizing: border-box;
|
|
105
|
-
font-family: inherit;
|
|
106
|
-
align-items: center;
|
|
107
|
-
cursor: pointer;
|
|
108
|
-
display: flex;
|
|
109
|
-
outline: none;
|
|
110
|
-
width: 100%;
|
|
111
|
-
|
|
112
|
-
&.has-value {
|
|
113
|
-
color: var(--datepicker-trigger-value-color, var(--theme-text-primary-color));
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
.value-text {
|
|
117
|
-
text-overflow: ellipsis;
|
|
118
|
-
white-space: nowrap;
|
|
119
|
-
overflow: hidden;
|
|
120
|
-
flex: 1;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
.calendar-icon {
|
|
124
|
-
flex-shrink: 0;
|
|
125
|
-
color: var(--datepicker-icon-color, var(--theme-text-secondary-color));
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
.datepicker-actions {
|
|
129
|
-
align-items: center;
|
|
130
|
-
flex-shrink: 0;
|
|
131
|
-
display: flex;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
.clear-icon {
|
|
135
|
-
color: var(--datepicker-clear-icon-color, var(--theme-text-disabled-color));
|
|
136
|
-
padding: var(--space-0-5);
|
|
137
|
-
border-radius: var(--radius-full);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
&.size-xs {
|
|
141
|
-
height: var(--datepicker-height-xs, var(--space-6));
|
|
142
|
-
padding: 0 var(--datepicker-padding-horizontal-xs, var(--space-base));
|
|
143
|
-
font-size: var(--font-size-xs);
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
&.size-sm {
|
|
147
|
-
height: var(--datepicker-height-sm, var(--space-8));
|
|
148
|
-
padding: 0 var(--datepicker-padding-horizontal-sm, var(--space-3));
|
|
149
|
-
font-size: var(--font-size-sm);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
&.size-md {
|
|
153
|
-
height: var(--datepicker-height-md, var(--space-10));
|
|
154
|
-
padding: 0 var(--datepicker-padding-horizontal-md, var(--space-4));
|
|
155
|
-
font-size: var(--font-size-base);
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
&.size-lg {
|
|
159
|
-
height: var(--datepicker-height-lg, var(--space-12));
|
|
160
|
-
padding: 0 var(--datepicker-padding-horizontal-lg, var(--space-5));
|
|
161
|
-
font-size: var(--font-size-lg);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
&.size-xl {
|
|
165
|
-
height: var(--datepicker-height-xl, var(--space-16));
|
|
166
|
-
padding: 0 var(--datepicker-padding-horizontal-xl, var(--space-6));
|
|
167
|
-
font-size: var(--font-size-xl);
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
&.radius-none {
|
|
171
|
-
border-radius: var(--datepicker-radius-none, var(--radius-none));
|
|
172
|
-
}
|
|
173
|
-
&.radius-xs {
|
|
174
|
-
border-radius: var(--datepicker-radius-xs, var(--radius-xs));
|
|
175
|
-
}
|
|
176
|
-
&.radius-sm {
|
|
177
|
-
border-radius: var(--datepicker-radius-sm, var(--radius-sm));
|
|
178
|
-
}
|
|
179
|
-
&.radius-md {
|
|
180
|
-
border-radius: var(--datepicker-radius-md, var(--radius-md));
|
|
181
|
-
}
|
|
182
|
-
&.radius-lg {
|
|
183
|
-
border-radius: var(--datepicker-radius-lg, var(--radius-lg));
|
|
184
|
-
}
|
|
185
|
-
&.radius-xl {
|
|
186
|
-
border-radius: var(--datepicker-radius-xl, var(--radius-xl));
|
|
187
|
-
}
|
|
188
|
-
&.radius-full {
|
|
189
|
-
border-radius: var(--datepicker-radius-full, var(--radius-full));
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
&.appearance-outline {
|
|
193
|
-
background-color: var(--datepicker-outline-bg, transparent);
|
|
194
|
-
border: 1px solid var(--datepicker-outline-border, var(--theme-border-strong-color));
|
|
195
|
-
|
|
196
|
-
&:hover {
|
|
197
|
-
border-color: var(--datepicker-outline-hover-border, var(--theme-primary-color));
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
&.active,
|
|
201
|
-
&:focus,
|
|
202
|
-
&.open {
|
|
203
|
-
border-color: var(--datepicker-outline-focus-border, var(--theme-primary-color));
|
|
204
|
-
box-shadow: 0 0 0 3px var(--datepicker-outline-focus-ring, var(--theme-primary-surface-color));
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
&.appearance-filled {
|
|
209
|
-
background-color: var(--datepicker-filled-bg, var(--theme-bg-hover-color));
|
|
210
|
-
border: 1px solid var(--datepicker-filled-border, transparent);
|
|
211
|
-
|
|
212
|
-
&:hover {
|
|
213
|
-
background-color: var(--datepicker-filled-hover-bg, var(--theme-border-subtle-color));
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
&.active,
|
|
217
|
-
&:focus,
|
|
218
|
-
&.open {
|
|
219
|
-
background-color: var(--datepicker-filled-focus-bg, var(--theme-bg-surface-color));
|
|
220
|
-
border-color: var(--datepicker-filled-focus-border, var(--theme-primary-color));
|
|
221
|
-
box-shadow: 0 0 0 3px var(--datepicker-filled-focus-ring, var(--theme-primary-surface-color));
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
&.appearance-subtle {
|
|
226
|
-
background-color: var(--datepicker-subtle-bg, transparent);
|
|
227
|
-
border: 1px solid var(--datepicker-subtle-border, transparent);
|
|
228
|
-
|
|
229
|
-
&:hover {
|
|
230
|
-
background-color: var(--datepicker-subtle-hover-bg, var(--theme-bg-hover-color));
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
&.active,
|
|
234
|
-
&:focus,
|
|
235
|
-
&.open {
|
|
236
|
-
background-color: var(--datepicker-subtle-focus-bg, var(--theme-bg-hover-color));
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
.dasar-datepicker-dropdown {
|
|
242
|
-
box-shadow: var(
|
|
243
|
-
--datepicker-dropdown-shadow,
|
|
244
|
-
0 10px 25px -5px rgba(0, 0, 0, 0.1),
|
|
245
|
-
0 8px 10px -6px rgba(0, 0, 0, 0.1)
|
|
246
|
-
);
|
|
247
|
-
background-color: var(--datepicker-dropdown-bg, var(--theme-bg-default-color));
|
|
248
|
-
border: 1px solid var(--datepicker-dropdown-border, var(--theme-border-subtle-color));
|
|
249
|
-
border-radius: var(--datepicker-dropdown-radius, var(--radius-md));
|
|
250
|
-
position: absolute;
|
|
251
|
-
z-index: var(--datepicker-dropdown-z-index, 50);
|
|
252
|
-
width: var(--datepicker-dropdown-width, 280px);
|
|
253
|
-
animation: dasarFadeInDown 0.15s ease-out forwards;
|
|
254
|
-
|
|
255
|
-
&.placement-bottom-start {
|
|
256
|
-
top: calc(100% + var(--space-1));
|
|
257
|
-
left: 0;
|
|
258
|
-
transform-origin: top left;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
&.placement-bottom-end {
|
|
262
|
-
top: calc(100% + var(--space-1));
|
|
263
|
-
right: 0;
|
|
264
|
-
transform-origin: top right;
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
&.placement-top-start {
|
|
268
|
-
bottom: calc(100% + var(--space-1));
|
|
269
|
-
left: 0;
|
|
270
|
-
transform-origin: bottom left;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
&.placement-top-end {
|
|
274
|
-
bottom: calc(100% + var(--space-1));
|
|
275
|
-
right: 0;
|
|
276
|
-
transform-origin: bottom right;
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
.dropdown-header-slot {
|
|
280
|
-
padding-bottom: var(--space-3);
|
|
281
|
-
margin-bottom: var(--space-3);
|
|
282
|
-
border-bottom: 1px solid var(--theme-border-subtle-color);
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
.dropdown-footer-slot {
|
|
286
|
-
padding-top: var(--space-3);
|
|
287
|
-
margin-top: var(--space-3);
|
|
288
|
-
border-top: 1px solid var(--theme-border-subtle-color);
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
@keyframes dasarFadeInDown {
|
|
293
|
-
from {
|
|
294
|
-
opacity: 0;
|
|
295
|
-
transform: translateY(-4px) scaleY(0.95);
|
|
296
|
-
}
|
|
297
|
-
to {
|
|
298
|
-
opacity: 1;
|
|
299
|
-
transform: translateY(0) scaleY(1);
|
|
300
|
-
}
|
|
301
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
import { DasarDatepicker } from './dasar-datepicker';
|
|
3
|
-
|
|
4
|
-
describe('DasarDatepicker', () => {
|
|
5
|
-
let component: DasarDatepicker;
|
|
6
|
-
let fixture: ComponentFixture<DasarDatepicker>;
|
|
7
|
-
|
|
8
|
-
beforeEach(async () => {
|
|
9
|
-
await TestBed.configureTestingModule({
|
|
10
|
-
imports: [DasarDatepicker],
|
|
11
|
-
}).compileComponents();
|
|
12
|
-
|
|
13
|
-
fixture = TestBed.createComponent(DasarDatepicker);
|
|
14
|
-
component = fixture.componentInstance;
|
|
15
|
-
await fixture.whenStable();
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it('should create', () => {
|
|
19
|
-
expect(component).toBeTruthy();
|
|
20
|
-
});
|
|
21
|
-
});
|